pax_global_header00006660000000000000000000000064122660044710014514gustar00rootroot0000000000000052 comment=4e5bef4d84868428300cd1d1d282fa079c0933cb glpi-0.84.3+dfsg.1/000077500000000000000000000000001226600447100136215ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/.htaccess000066400000000000000000000002331226600447100154150ustar00rootroot00000000000000# If you have problem with session.auto_start on install you need to set this value to 0 on php.ini or uncomment this line #php_value session.auto_start 0 glpi-0.84.3+dfsg.1/AUTHORS.txt000066400000000000000000000002371226600447100155110ustar00rootroot00000000000000Main developers : Remi Collet Jean-Mathieu Doléans Julien Dombre Bazile Lebeau Nelly Mahu-Lasson Walid Nouh Damien Touraine Contibutors : Olivier Andreotti glpi-0.84.3+dfsg.1/CHANGELOG.txt000066400000000000000000000001001226600447100156400ustar00rootroot00000000000000See on the website for the changelog : http://glpi-project.org glpi-0.84.3+dfsg.1/COPYING.txt000066400000000000000000000432541226600447100155020ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. glpi-0.84.3+dfsg.1/LISEZMOI.txt000066400000000000000000000002211226600447100156100ustar00rootroot00000000000000Consulter le guide d'installation et de mise jour du logiciel GLPI prsent sur le site glpi-project.org http://www.glpi-project.org/LISEZMOI glpi-0.84.3+dfsg.1/README.txt000066400000000000000000000001721226600447100153170ustar00rootroot00000000000000See the Installation Guide found on GLPI-PROJECT.ORG for installation steps of GLPI. http://www.glpi-project.org/README glpi-0.84.3+dfsg.1/ajax/000077500000000000000000000000001226600447100145445ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/ajax/autocompletion.php000066400000000000000000000063511226600447100203240ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ // Include plugin if it is a plugin table if (!strstr($_POST['itemtype'],"Plugin")) { $AJAX_INCLUDE = 1; } include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::checkLoginUser(); // Security if (!isset($_POST['itemtype']) || !($item = getItemForItemtype($_POST['itemtype']))) { exit(); } $item->getEmpty(); $table = $item->getTable(); // Security if (!isset($item->fields[$_POST['field']]) || !$item->canView()) { exit(); } // Security : blacklist fields if (in_array($table.'.'.$_POST['field'], array('glpi_authldaps.rootdn', 'glpi_authldaps.rootdn_passwd', 'glpi_configs.proxy_passwd', 'glpi_mailcollectors.login', 'glpi_mailcollectors.passwd', 'glpi_users.name', 'glpi_users.password'))) { exit(); } $entity = ""; if (isset($_POST['entity_restrict']) && $_POST['entity_restrict']>=0) { if ($item->isEntityAssign()) { $entity = " AND `entities_id` = '".$_POST['entity_restrict']."' "; } } if (isset($_POST['user_restrict']) && $_POST['user_restrict']>0) { $entity = " AND `users_id` = '".$_POST['user_restrict']."' "; } $query = "SELECT COUNT(`".$_POST['field']."`) FROM `$table` WHERE `".$_POST['field']."` LIKE '".$_POST['query']."%' AND `".$_POST['field']."` <> '".$_POST['query']."' $entity "; $result = $DB->query($query); $totnum = $DB->result($result,0,0); $query = "SELECT DISTINCT `".$_POST['field']."` AS VAL FROM `$table` WHERE `".$_POST['field']."` LIKE '".$_POST['query']."%' AND `".$_POST['field']."` <> '".$_POST['query']."' $entity ORDER BY `".$_POST['field']."` LIMIT ".intval($_POST['start']).",".intval($_POST['limit']); if ($result=$DB->query($query)) { echo '{"totalCount":'.$totnum.',"items":['; if ($DB->numrows($result)>0) { $first = true; while ($data=$DB->fetch_assoc($result)) { if ($first) { $first = false; } else { echo ','; } echo '{"value":"'.$data['VAL'].'"}'; } } echo ']}'; } ?>glpi-0.84.3+dfsg.1/ajax/comments.php000066400000000000000000000047221226600447100171070ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ $AJAX_INCLUDE = 1; include ('../inc/includes.php'); // Send UTF8 Headers header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::checkLoginUser(); if (isset($_POST["table"]) && isset($_POST["value"])) { // Security if (!TableExists($_POST['table']) ) { exit(); } switch ($_POST["table"]) { case "glpi_users" : if ($_POST['value'] == 0) { $tmpname['link'] = $CFG_GLPI['root_doc']."/front/user.php"; $tmpname['comment'] = ""; } else { $tmpname = getUserName($_POST["value"],2); } echo $tmpname["comment"]; if (isset($_POST['withlink'])) { echo "\n"; } break; default : if ($_POST["value"] > 0) { $tmpname = Dropdown::getDropdownName($_POST["table"], $_POST["value"], 1); echo $tmpname["comment"]; if (isset($_POST['withlink'])) { echo "\n"; } } } } ?>glpi-0.84.3+dfsg.1/ajax/common.tabs.php000066400000000000000000000053401226600447100174770ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); if (isset($_POST['full_page_tab'])) { Html::header('Only tab for debug', $_SERVER['PHP_SELF']); } else { header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } if (!isset($_POST['glpi_tab'])) { exit(); } if (!isset($_POST['itemtype']) || empty($_POST['itemtype'])) { exit(); } if (!isset($_POST["sort"])) { $_POST["sort"] = ""; } if (!isset($_POST["order"])) { $_POST["order"] = ""; } if (!isset($_POST["withtemplate"])) { $_POST["withtemplate"] = ""; } if ($item = getItemForItemtype($_POST['itemtype'])) { if ($item instanceof CommonDBTM && $item->isNewItem() && (!isset($_POST["id"]) || !$item->can($_POST["id"],'r'))) { exit(); } } CommonGLPI::displayStandardTab($item, $_POST['glpi_tab'],$_POST["withtemplate"]); if (isset($_POST['full_page_tab'])) { echo "
"; Html::showSimpleForm($_SERVER['REQUEST_URI'], 'full_page_tab', 'Reload this tab', $_POST); echo "
"; Html::footer(); // I think that we should display this warning, because tabs are not prepare // for being used full space ... if (!isset($_SESSION['glpi_warned_about_full_page_tab'])) { // Debug string : not really need translation. $msg = 'WARNING: full page tabs are only for debug/validation purpose !\n'; $msg .= 'Actions on this page may have undefined result.'; echo ""; $_SESSION['glpi_warned_about_full_page_tab'] = true; } } else { Html::ajaxFooter(); } ?>glpi-0.84.3+dfsg.1/ajax/dropdownAllItems.php000066400000000000000000000053011226600447100205430ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::checkCentralAccess(); // Make a select box if ($_POST["idtable"] && class_exists($_POST["idtable"])) { $table = getTableForItemType($_POST["idtable"]); // Link to user for search only > normal users $link = "dropdownValue.php"; if ($_POST["idtable"] == 'User') { $link = "dropdownUsers.php"; } $rand = mt_rand(); $use_ajax = false; if ($CFG_GLPI["use_ajax"] && (countElementsInTable($table) > $CFG_GLPI["ajax_limit_count"])) { $use_ajax = true; } $paramsallitems = array('searchText' => '__VALUE__', 'table' => $table, 'itemtype' => $_POST["idtable"], 'rand' => $rand, 'myname' => $_POST["myname"], 'displaywith' => array('otherserial', 'serial'), 'display_emptychoice' => true); if (isset($_POST['value'])) { $paramsallitems['value'] = $_POST['value']; } if (isset($_POST['entity_restrict'])) { $paramsallitems['entity_restrict'] = $_POST['entity_restrict']; } if (isset($_POST['condition'])) { $paramsallitems['condition'] = stripslashes($_POST['condition']); } $default = ""; Ajax::dropdown($use_ajax, "/ajax/$link", $paramsallitems, $default, $rand); } ?>glpi-0.84.3+dfsg.1/ajax/dropdownConnect.php000066400000000000000000000142151226600447100204260ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (strpos($_SERVER['PHP_SELF'],"dropdownConnect.php")) { include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } if (!defined('GLPI_ROOT')) { die("Can not acces directly to this file"); } if (!isset($_POST['fromtype']) || !($fromitem = getItemForItemtype($_POST['fromtype']))) { exit(); } $fromitem->checkGlobal('w'); if (isset($_POST["used"]) && !is_numeric($_POST["used"]) && !is_array($_POST["used"])) { $used = Toolbox::decodeArrayFromInput($_POST["used"]); } else { $used = $_POST["used"]; } if (isset($used[$_POST['itemtype']])) { $used = $used[$_POST['itemtype']]; } else { $used = array(); } if (isset($_POST["entity_restrict"]) && !is_numeric($_POST["entity_restrict"]) && !is_array($_POST["entity_restrict"])) { $_POST["entity_restrict"] = Toolbox::decodeArrayFromInput($_POST["entity_restrict"]); } // Make a select box $table = getTableForItemType($_POST["itemtype"]); if (!$item = getItemForItemtype($_POST['itemtype'])) { exit; } $where = ""; if ($item->maybeDeleted()) { $where .= " AND `$table`.`is_deleted` = '0' "; } if ($item->maybeTemplate()) { $where .= " AND `$table`.`is_template` = '0' "; } if (isset($_POST['searchText']) && (strlen($_POST['searchText']) > 0) && ($_POST['searchText'] != $CFG_GLPI["ajax_wildcard"])) { $where .= " AND (`$table`.`name` ".Search::makeTextSearch($_POST['searchText'])." OR `$table`.`otherserial` ".Search::makeTextSearch($_POST['searchText'])." OR `$table`.`serial` ".Search::makeTextSearch($_POST['searchText'])." )"; } $multi = $item->maybeRecursive(); if (isset($_POST["entity_restrict"]) && !($_POST["entity_restrict"] < 0)) { $where .= getEntitiesRestrictRequest(" AND ", $table, '', $_POST["entity_restrict"], $multi); if (is_array($_POST["entity_restrict"]) && (count($_POST["entity_restrict"]) > 1)) { $multi = true; } } else { $where .= getEntitiesRestrictRequest(" AND ", $table, '', $_SESSION['glpiactiveentities'], $multi); if (count($_SESSION['glpiactiveentities']) > 1) { $multi = true; } } // $NBMAX = $CFG_GLPI["dropdown_max"]; // $LIMIT = "LIMIT 0,$NBMAX"; // // if (isset($_POST['searchText']) && ($_POST['searchText'] == $CFG_GLPI["ajax_wildcard"])) { // $LIMIT = ""; // } $where_used = ''; if (!empty($used)) { $where_used = " AND `$table`.`id` NOT IN ('".implode("','",$used)."')"; } if ($_POST["onlyglobal"] && ($_POST["itemtype"] != 'Computer')) { $CONNECT_SEARCH = " WHERE `$table`.`is_global` = '1' "; } else { if ($_POST["itemtype"] == 'Computer') { $CONNECT_SEARCH = " WHERE 1 $where_used"; } else { $CONNECT_SEARCH = " WHERE ((`glpi_computers_items`.`id` IS NULL $where_used) OR `$table`.`is_global` = '1') "; } } $LEFTJOINCONNECT = ""; if (($_POST["itemtype"] != 'Computer') && !$_POST["onlyglobal"]) { $LEFTJOINCONNECT = " LEFT JOIN `glpi_computers_items` ON (`$table`.`id` = `glpi_computers_items`.`items_id` AND `glpi_computers_items`.`itemtype` = '".$_POST['itemtype']."')"; } $query = "SELECT DISTINCT `$table`.`id`, `$table`.`name` AS name, `$table`.`serial` AS serial, `$table`.`otherserial` AS otherserial, `$table`.`entities_id` AS entities_id FROM `$table` $LEFTJOINCONNECT $CONNECT_SEARCH $where ORDER BY entities_id, name ASC"; $result = $DB->query($query); echo ""; ?> glpi-0.84.3+dfsg.1/ajax/dropdownConnectNetworkPort.php000066400000000000000000000114421226600447100226440ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @since version 0.84 * @brief */ $AJAX_INCLUDE = 1; include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::checkRight("networking", "w"); // Make a select box if (class_exists($_POST["itemtype"]) && isset($_POST["item"])) { $table = getTableForItemType($_POST["itemtype"]); if ($_POST['instantiation_type'] == 'NetworkPortEthernet') { $npname_field = "`glpi_netpoints`.`name`"; $JOINS = "LEFT JOIN `glpi_networkportethernets` ON (`glpi_networkportethernets`.`id` = `glpi_networkports`.`id`) LEFT JOIN `glpi_netpoints` ON (`glpi_netpoints`.`id`=`glpi_networkportethernets`.`netpoints_id`)"; } else { $npname_field = "''"; $JOINS = ""; } $query = "SELECT DISTINCT `glpi_networkports_networkports`.`id` AS wid, `glpi_networkports`.`id` AS did, `$table`.`name` AS cname, `glpi_networkports`.`name` AS nname, $npname_field AS npname FROM `$table` LEFT JOIN `glpi_networkports` ON (`glpi_networkports`.`items_id` = '".$_POST['item']."' AND `glpi_networkports`.`itemtype` = '".$_POST["itemtype"]."' AND `glpi_networkports`.`items_id` = `$table`.`id` AND `glpi_networkports`.`instantiation_type` = '".$_POST['instantiation_type']."') LEFT JOIN `glpi_networkports_networkports` ON (`glpi_networkports_networkports`.`networkports_id_1` = `glpi_networkports`.`id` OR `glpi_networkports_networkports`.`networkports_id_2`=`glpi_networkports`.`id`) $JOINS WHERE `glpi_networkports_networkports`.`id` IS NULL AND `glpi_networkports`.`id` IS NOT NULL AND `glpi_networkports`.`id` <> '".$_POST['networkports_id']."' AND `$table`.`is_deleted` = '0' AND `$table`.`is_template` = '0' ORDER BY `glpi_networkports`.`id`"; $result = $DB->query($query); echo "
"; echo ""; // echo ""; } ?> glpi-0.84.3+dfsg.1/ajax/dropdownConnectNetworkPortDeviceType.php000066400000000000000000000075021226600447100246300ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @since version 0.84 * @brief */ include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::checkRight("networking", "w"); // Make a select box if (class_exists($_POST["itemtype"])) { $table = getTableForItemType($_POST["itemtype"]); $rand = mt_rand(); $use_ajax = true; $paramsconnectpdt = array('searchText' => '__VALUE__', 'itemtype' => $_POST['itemtype'], 'rand' => $rand, 'myname' => "items", 'entity_restrict' => $_POST["entity_restrict"], // Beware: '\n' inside condition is transformed to 'n' in SQL request // so don't cut this SQL request ! 'condition' => "(`id` in (SELECT `items_id`". "FROM `glpi_networkports`". "WHERE `itemtype` = '".$_POST["itemtype"]."'". "AND `instantiation_type`". "= '".$_POST['instantiation_type']."'))", 'update_item' => array('value_fieldname' => 'item', 'to_update' => "results_item_$rand", 'url' => $CFG_GLPI["root_doc"]. "/ajax/dropdownConnectNetworkPort.php", 'moreparams' => array('networkports_id' => $_POST['networkports_id'], 'itemtype' => $_POST['itemtype'], 'myname' => $_POST['myname'], 'instantiation_type' => $_POST['instantiation_type']))); $default = "\n"; Ajax::dropdown($use_ajax, "/ajax/dropdownValue.php", $paramsconnectpdt, $default, $rand); echo ""; echo "\n"; } ?>glpi-0.84.3+dfsg.1/ajax/dropdownDelegationUsers.php000066400000000000000000000036621226600447100221360ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ // Direct access to file if (strpos($_SERVER['PHP_SELF'],"dropdownDelegationUsers.php")) { $AJAX_INCLUDE = 1; include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } if (!defined('GLPI_ROOT')) { die("Can not acces directly to this file"); } Session::checkLoginUser(); if ($_POST["nodelegate"] == 1) { $_POST['_users_id_requester'] = Session::getLoginUserID(); $_POST['_right'] = "id"; } else { $_POST['_right'] = "delegate"; } if (isset($_POST['_users_id_requester_notif']) && !empty($_POST['_users_id_requester_notif'])) { $_POST['_users_id_requester_notif'] = Toolbox::decodeArrayFromInput($_POST['_users_id_requester_notif']); } $ticket = new Ticket(); $ticket->showActorAddFormOnCreate(Ticket_User::REQUESTER, $_POST); ?>glpi-0.84.3+dfsg.1/ajax/dropdownFieldsBlacklist.php000066400000000000000000000030421226600447100220700ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (strpos($_SERVER['PHP_SELF'],"dropdownFieldsBlacklist.php")) { include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } Session::checkRight("config", "w"); $field = new Fieldblacklist(); if ($_POST['id'] > 0) { $field->getFromDB($_POST['id']); } else { $field->getEmpty(); $field->fields['itemtype'] = $_POST['itemtype']; } $field->selectCriterias($field); ?> glpi-0.84.3+dfsg.1/ajax/dropdownFindNum.php000066400000000000000000000112161226600447100203730ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief List of device for tracking. */ include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::checkRight("create_ticket", "1"); // Security if (!TableExists($_POST['table'])) { exit(); } $itemtypeisplugin = isPluginItemType($_POST['itemtype']); if (!$item = getItemForItemtype($_POST['itemtype'])) { exit; } if ($item->isEntityAssign()) { if (isset($_POST["entity_restrict"]) && ($_POST["entity_restrict"] >= 0)) { $entity = $_POST["entity_restrict"]; } else { $entity = ''; } // allow opening ticket on recursive object (printer, software, ...) $recursive = $item->maybeRecursive(); $where = getEntitiesRestrictRequest("WHERE", $_POST['table'], '', $entity, $recursive); } else { $where = "WHERE 1"; } if ($item->maybeDeleted()) { $where .= " AND `is_deleted` = '0' "; } if ($item->maybeTemplate()) { $where .= " AND `is_template` = '0' "; } if ((strlen($_POST['searchText']) > 0) && ($_POST['searchText'] != $CFG_GLPI["ajax_wildcard"])) { $search = Search::makeTextSearch($_POST['searchText']); $where .= " AND (`name` ".$search." OR `id` = '".$_POST['searchText']."'"; if ($_POST['table']!="glpi_softwares" && !$itemtypeisplugin) { $where .= " OR `contact` ".$search." OR `serial` ".$search." OR `otherserial` ".$search; } $where .= ")"; } //If software or plugins : filter to display only the objects that are allowed to be visible in Helpdesk if (in_array($_POST['itemtype'],$CFG_GLPI["helpdesk_visible_types"])) { $where .= " AND `is_helpdesk_visible` = '1' "; } $NBMAX = $CFG_GLPI["dropdown_max"]; $LIMIT = "LIMIT 0,$NBMAX"; if ($_POST['searchText'] == $CFG_GLPI["ajax_wildcard"]) { $LIMIT = ""; } $query = "SELECT * FROM `".$_POST['table']."` $where ORDER BY `name` $LIMIT"; $result = $DB->query($query); echo ""; // Auto update summary of active or just solved tickets $params = array('items_id' => '__VALUE__', 'itemtype' => $_POST['itemtype']); Ajax::updateItemOnSelectEvent("dropdown_find_num","item_ticket_selection_information", $CFG_GLPI["root_doc"]."/ajax/ticketiteminformation.php", $params); ?>glpi-0.84.3+dfsg.1/ajax/dropdownInstallVersion.php000066400000000000000000000057711226600447100220200ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (strpos($_SERVER['PHP_SELF'],"dropdownInstallVersion.php")) { $AJAX_INCLUDE = 1; include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } Session::checkRight("software", "w"); if ($_POST['softwares_id'] > 0) { if (!isset($_POST['value'])) { $_POST['value'] = 0; } $where = ''; if (isset($_POST['used'])) { if (is_array($_POST['used'])) { $used = $_POST['used']; } else { $used = Toolbox::decodeArrayFromInput($_POST['used']); } if (count($used)) { $where = " AND `glpi_softwareversions`.`id` NOT IN ('".implode("','",$used)."')"; } } // Make a select box $query = "SELECT DISTINCT `glpi_softwareversions`.*, `glpi_states`.`name` AS sname FROM `glpi_softwareversions` LEFT JOIN `glpi_states` ON (`glpi_softwareversions`.`states_id` = `glpi_states`.`id`) WHERE `glpi_softwareversions`.`softwares_id` = '".$_POST['softwares_id']."' $where ORDER BY `name`"; $result = $DB->query($query); $number = $DB->numrows($result); echo " "; } ?> glpi-0.84.3+dfsg.1/ajax/dropdownItilActors.php000066400000000000000000000144621226600447100211160ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::checkCentralAccess(); // Make a select box if (isset($_POST["type"]) && isset($_POST["actortype"]) && isset($_POST["itemtype"])) { $rand = mt_rand(); if ($item = getItemForItemtype($_POST["itemtype"])) { switch ($_POST["type"]) { case "user" : $right = 'all'; // Only steal or own ticket whit empty assign if ($_POST["actortype"] == 'assign') { $right = "own_ticket"; if (!$item->canAssign()) { $right = 'id'; } } $options = array('name' => '_itil_'.$_POST["actortype"].'[users_id]', 'entity' => $_POST['entity_restrict'], 'right' => $right, 'rand' => $rand, 'ldap_import' => true); if ($CFG_GLPI["use_mailing"]) { $withemail = (isset($_POST["allow_email"]) ? $_POST["allow_email"] : false); $paramscomment = array('value' => '__VALUE__', 'allow_email' => $withemail, 'field' => "_itil_".$_POST["actortype"]); // Fix rand value $options['rand'] = $rand; $options['toupdate'] = array('value_fieldname' => 'value', 'to_update' => "notif_user_$rand", 'url' => $CFG_GLPI["root_doc"]. "/ajax/uemailUpdate.php", 'moreparams' => $paramscomment); } if (($_POST["itemtype"] == 'Ticket') && ($_POST["actortype"] == 'assign')) { $toupdate = array(); if (isset($options['toupdate']) && is_array($options['toupdate'])) { $toupdate[] = $options['toupdate']; } $toupdate[] = array('value_fieldname' => 'value', 'to_update' => "countassign_$rand", 'url' => $CFG_GLPI["root_doc"]. "/ajax/ticketassigninformation.php", 'moreparams' => array('users_id_assign' => '__VALUE__')); $options['toupdate'] = $toupdate; } $rand = User::dropdown($options); // Display active tickets for a tech // Need to update information on dropdown changes if (($_POST["itemtype"] == 'Ticket') && ($_POST["actortype"] == 'assign')) { echo "
--"; echo ""; } if ($CFG_GLPI["use_mailing"] == 1) { echo "
"; if ($withemail) { echo __('Email followup').' '; $rand = Dropdown::showYesNo('_itil_'.$_POST["actortype"].'[use_notification]', 1); echo '
'; printf(__('%1$s: %2$s'),__('Email'), ""); } echo "
"; } break; case "group" : $cond = (($_POST["actortype"] == 'assign') ? $cond = '`is_assign`' : $cond = '`is_requester`'); $param = array('name' => '_itil_'.$_POST["actortype"].'[groups_id]', 'entity' => $_POST['entity_restrict'], 'condition' => $cond, 'rand' => $rand); if (($_POST["itemtype"] == 'Ticket') && ($_POST["actortype"] == 'assign')) { $param['toupdate'] = array('value_fieldname' => 'value', 'to_update' => "countgroupassign_$rand", 'url' => $CFG_GLPI["root_doc"]. "/ajax/ticketassigninformation.php", 'moreparams' => array('groups_id_assign' => '__VALUE__')); } $rand = Group::dropdown($param); if (($_POST["itemtype"] == 'Ticket') && ($_POST["actortype"] == 'assign')) { echo "
"; echo ""; } break; case "supplier" : $param = array('name' => '_itil_'.$_POST["actortype"].'[suppliers_id]', 'entity' => $_POST['entity_restrict'], 'rand' => $rand); $rand = Supplier::dropdown($param); break; } } } ?> glpi-0.84.3+dfsg.1/ajax/dropdownMassiveAction.php000066400000000000000000000070551226600447100216060ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); if (isset($_POST["action"]) && ($_POST["action"] != '-1') && isset($_POST["itemtype"]) && !empty($_POST["itemtype"])) { if (!isset($_POST['is_deleted'])) { $_POST['is_deleted'] = 0; } if (!($item = getItemForItemtype($_POST['itemtype']))) { exit(); } $checkitem = NULL; if (isset($_POST['check_itemtype'])) { if (!($checkitem = getItemForItemtype($_POST['check_itemtype']))) { exit(); } if (isset($_POST['check_items_id'])) { if (!$checkitem->getFromDB($_POST['check_items_id'])) { exit(); } echo ""; } echo ""; } $actions = $item->getAllMassiveActions($_POST['is_deleted'], $checkitem); if (!isset($_POST['specific_action']) || !$_POST['specific_action']) { echo ""; if (!isset($actions[$_POST['action']])) { Html::displayRightError(); exit(); } } else { if (!isset($actions[$_POST['action']])) { echo ""; } else { echo ""; } } echo ""; echo ""; echo ""; echo ' '; // Plugin specific actions $split = explode('_',$_POST["action"]); if (($split[0] == 'plugin') && isset($split[1])) { // Normalized name plugin_name_action // Allow hook from any plugin on any (core or plugin) type Plugin::doOneHook($split[1], 'MassiveActionsDisplay', array('itemtype' => $_POST["itemtype"], 'action' => $_POST["action"])); // } else if ($plug=isPluginItemType($_POST["itemtype"])) { // non-normalized name // hook from the plugin defining the type // Plugin::doOneHook($plug['plugin'], 'MassiveActionsDisplay', $_POST["itemtype"], // $_POST["action"]); } else { $item->showMassiveActionsParameters($_POST); } } ?> glpi-0.84.3+dfsg.1/ajax/dropdownMassiveActionAddActor.php000066400000000000000000000031631226600447100232040ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ $AJAX_INCLUDE = 1; include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::checkRight('update_ticket', 1); if ($_POST["actortype"] > 0) { $ticket = new Ticket(); $rand = mt_rand(); $ticket->showActorAddForm($_POST["actortype"], $rand, $_SESSION['glpiactive_entity'], array(), true, false, false); echo " "; } ?> glpi-0.84.3+dfsg.1/ajax/dropdownMassiveActionAuthMethods.php000066400000000000000000000040251226600447100237460ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ $AJAX_INCLUDE = 1; include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::checkRight('user_authtype', 'w'); if ($_POST["authtype"] > 0) { $name = 'massiveaction'; if (isset($_POST['name'])) { $name = $_POST['name']; } switch($_POST["authtype"]) { case Auth::DB_GLPI : echo ""; break; case Auth::LDAP : case Auth::EXTERNAL : AuthLDAP::dropdown(array('name' => "auths_id", 'condition' => "`is_active` = 1")); break; case Auth::MAIL : AuthMail::dropdown(array('name' => "auths_id", 'condition' => "`is_active` = 1")); break; } echo " "; } ?> glpi-0.84.3+dfsg.1/ajax/dropdownMassiveActionField.php000066400000000000000000000074311226600447100225500ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); if (!isset($_POST["itemtype"]) || !($item = getItemForItemtype($_POST['itemtype']))) { exit(); } if (in_array($_POST["itemtype"], $CFG_GLPI["infocom_types"])) { Session::checkSeveralRightsOr(array($_POST["itemtype"] => "w", "infocom" => "w")); } else { $item->checkGlobal("w"); } $inline = false; if (isset($_POST['inline']) && $_POST['inline']) { $inline = true; } $submitname = _sx('button','Post'); if (isset($_POST['submitname']) && $_POST['submitname']) { $submitname= stripslashes($_POST['submitname']); } if (isset($_POST["itemtype"]) && isset($_POST["id_field"]) && $_POST["id_field"]) { $search = Search::getOptions($_POST["itemtype"]); if (!isset($search[$_POST["id_field"]])) { exit(); } $search = $search[$_POST["id_field"]]; $FIELDNAME_PRINTED = false; $USE_TABLE = false; echo ""; if ($inline) { echo ""; } echo "
"; $plugdisplay = false; // Specific plugin Type case if (($plug = isPluginItemType($_POST["itemtype"])) // Specific for plugin which add link to core object || ($plug = isPluginItemType(getItemTypeForTable($search['table'])))) { $plugdisplay = Plugin::doOneHook($plug['plugin'], 'MassiveActionsFieldsDisplay', array('itemtype' => $_POST["itemtype"], 'options' => $search)); } $fieldname = ''; if (empty($search["linkfield"]) ||($search['table'] == 'glpi_infocoms')) { $fieldname = $search["field"]; } else { $fieldname = $search["linkfield"]; } if (!$plugdisplay) { $options = array(); $values = array(); // For ticket template or aditional options of massive actions if (isset($_POST['options']) && strlen($_POST['options'])) { $options = Toolbox::decodeArrayFromInput($_POST['options']); } if (isset($_POST['additionalvalues']) && strlen($_POST['additionalvalues'])) { $values = Toolbox::decodeArrayFromInput($_POST['additionalvalues']); } $values[$search["field"]] = ''; echo $item->getValueToSelect($search, $fieldname, $values, $options); } if (!$FIELDNAME_PRINTED) { echo ""; } echo "
"; if (!$inline) { echo "
"; } } ?> glpi-0.84.3+dfsg.1/ajax/dropdownNetpoint.php000066400000000000000000000133171226600447100206370ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ // Direct access to file if (strpos($_SERVER['PHP_SELF'],"dropdownNetpoint.php")) { $AJAX_INCLUDE = 1; include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } if (!defined('GLPI_ROOT')) { die("Can not acces directly to this file"); } Session::checkLoginUser(); // Make a select box with preselected values if (!isset($_POST["limit"])) { $_POST["limit"] = $_SESSION["glpidropdown_chars_limit"]; } if ((strlen($_POST['searchText']) > 0) && ($_POST['searchText'] != $CFG_GLPI["ajax_wildcard"])) { $where = " WHERE (`glpi_netpoints`.`name` ".Search::makeTextSearch($_POST['searchText'])." OR `glpi_locations`.`completename` ".Search::makeTextSearch($_POST['searchText']).")"; } else { $where = " WHERE 1 "; } $NBMAX = $CFG_GLPI["dropdown_max"]; $LIMIT = "LIMIT 0,$NBMAX"; if ($_POST['searchText'] == $CFG_GLPI["ajax_wildcard"]) { $LIMIT = ""; } $location_restrict = false; if (!(isset($_POST["devtype"]) && ($_POST["devtype"] != 'NetworkEquipment') && isset($_POST["locations_id"]) && ($_POST["locations_id"] > 0))) { if (isset($_POST["entity_restrict"]) && ($_POST["entity_restrict"] >= 0)) { $where .= " AND `glpi_netpoints`.`entities_id` = '".$_POST["entity_restrict"]."'"; } else { $where .= getEntitiesRestrictRequest(" AND ", "glpi_locations"); } } $query = "SELECT `glpi_netpoints`.`comment` AS comment, `glpi_netpoints`.`id`, `glpi_netpoints`.`name` AS netpname, `glpi_locations`.`completename` AS loc FROM `glpi_netpoints` LEFT JOIN `glpi_locations` ON (`glpi_netpoints`.`locations_id` = `glpi_locations`.`id`) "; if (isset($_POST["devtype"]) && !empty($_POST["devtype"])) { $query .= "LEFT JOIN `glpi_networkportethernets` ON (`glpi_netpoints`.`id` = `glpi_networkportethernets`.`netpoints_id`) LEFT JOIN `glpi_networkports` ON (`glpi_networkports`.`id` = `glpi_networkportethernets`.`id` AND `glpi_networkports`.`instantiation_type` = 'NetworkPortEthernet' AND `glpi_networkports`.`itemtype`"; if ($_POST["devtype"] == 'NetworkEquipment') { $query .= " = 'NetworkEquipment' )"; } else { $query .= " != 'NetworkEquipment' )"; if (isset($_POST["locations_id"]) && ($_POST["locations_id"] >= 0)) { $location_restrict = true; $where .= " AND `glpi_netpoints`.`locations_id` = '".$_POST["locations_id"]."' "; } } $where .= " AND `glpi_networkportethernets`.`netpoints_id` IS NULL "; } else if (isset($_POST["locations_id"]) && ($_POST["locations_id"] >= 0)) { $location_restrict = true; $where .= " AND `glpi_netpoints`.`locations_id` = '".$_POST["locations_id"]."' "; } $query .= $where ." ORDER BY `glpi_locations`.`completename`, `glpi_netpoints`.`name` $LIMIT"; $result = $DB->query($query); echo "\n"; if (isset($_POST["comment"]) && $_POST["comment"]) { $paramscomment = array('value' => '__VALUE__', 'table' => "glpi_netpoints"); Ajax::updateItemOnSelectEvent("dropdown_".$_POST["myname"].$_POST["rand"], "comment_".$_POST["myname"].$_POST["rand"], $CFG_GLPI["root_doc"]."/ajax/comments.php", $paramscomment); } ?> glpi-0.84.3+dfsg.1/ajax/dropdownNotificationEvent.php000066400000000000000000000026201226600447100224620ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (strpos($_SERVER['PHP_SELF'],"dropdownNotificationEvent.php")) { include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } Session::checkRight("notification", "w"); NotificationEvent::dropdownEvents($_POST['itemtype']); ?>glpi-0.84.3+dfsg.1/ajax/dropdownNotificationTemplate.php000066400000000000000000000026701226600447100231610ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (strpos($_SERVER['PHP_SELF'],"dropdownNotificationTemplate.php")) { include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } Session::checkRight("notification", "w"); NotificationTemplate::dropdownTemplates('notificationtemplates_id', $_POST['itemtype']); ?>glpi-0.84.3+dfsg.1/ajax/dropdownRubDocument.php000066400000000000000000000043771226600447100212740ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (strpos($_SERVER['PHP_SELF'],"dropdownRubDocument.php")) { $AJAX_INCLUDE = 1; include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } Session::checkCentralAccess(); // Make a select box if (isset($_POST["rubdoc"])) { if (!is_array($_POST['used'])) { $_POST['used'] = Toolbox::decodeArrayFromInput($_POST['used']); } $used = array(); // Clean used array if (is_array($_POST['used']) && count($_POST['used'])>0) { $query = "SELECT `id` FROM `glpi_documents` WHERE `id` IN (".implode(',',$_POST['used']).") AND `documentcategories_id` = '".$_POST["rubdoc"]."'"; foreach ($DB->request($query) AS $data) { $used[$data['id']] = $data['id']; } } Dropdown::show('Document', array('name' => $_POST['myname'], 'used' => $used, 'entity' => $_POST['entity'], 'rand' => $_POST['rand'], 'condition' => "glpi_documents.documentcategories_id='".$_POST["rubdoc"]."'")); } ?> glpi-0.84.3+dfsg.1/ajax/dropdownRules.php000066400000000000000000000054261226600447100201330ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ // Direct access to file if (strpos($_SERVER['PHP_SELF'],"dropdownRules.php")) { include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } if (!defined('GLPI_ROOT')) { die("Can not acces directly to this file"); } Session::checkLoginUser(); // Make a select box with preselected values if (!isset($_POST["limit"])) { $_POST["limit"] = $_SESSION["glpidropdown_chars_limit"]; } $NBMAX = $CFG_GLPI["dropdown_max"]; $LIMIT = "LIMIT 0,$NBMAX"; $sql = "SELECT `id`, `name`, `ranking` FROM `glpi_rules` WHERE `sub_type` = '".$_POST["type"]."'"; if ($_POST['searchText'] == $CFG_GLPI["ajax_wildcard"]) { $LIMIT = ""; } else { $sql .= " AND `name` ".Search::makeTextSearch($_POST['searchText']); } if (isset($_POST['entity_restrict']) && ($_POST['entity_restrict'] != '')) { $sql .= " AND `glpi_rules`.`entities_id` = '".$_POST['entity_restrict']."'"; } $sql .= " ORDER BY `ranking` ASC " . $LIMIT; $result = $DB->query($sql); echo ""; ?>glpi-0.84.3+dfsg.1/ajax/dropdownSelectSoftware.php000066400000000000000000000056471226600447100220000ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (strpos($_SERVER['PHP_SELF'],"dropdownSelectSoftware.php")) { $AJAX_INCLUDE = 1; include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } Session::checkRight("software", "w"); // Make a select box $rand = mt_rand(); $where = ""; if ((strlen($_POST['searchText']) > 0) && ($_POST['searchText'] != $CFG_GLPI["ajax_wildcard"])) { $where .=" AND `name` ".Search::makeTextSearch($_POST['searchText'])." "; } $where .= getEntitiesRestrictRequest(' AND', 'glpi_softwares','entities_id', $_POST["entity_restrict"], true); $query = "SELECT DISTINCT `glpi_softwares`.`id`, `glpi_softwares`.`name` FROM `glpi_softwares` WHERE `glpi_softwares`.`is_deleted` = '0' AND `glpi_softwares`.`is_template` = '0' $where ORDER BY `glpi_softwares`.`name`"; $result = $DB->query($query); echo "\n"; $paramsselsoft = array('softwares_id' => '__VALUE__', 'myname' => $_POST["myname"]); Ajax::updateItemOnSelectEvent("item_type$rand", "show_".$_POST["myname"].$rand, $CFG_GLPI["root_doc"]."/ajax/dropdownInstallVersion.php", $paramsselsoft); echo " \n"; ?> glpi-0.84.3+dfsg.1/ajax/dropdownSelectSoftwareLicense.php000066400000000000000000000062341226600447100232740ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (strpos($_SERVER['PHP_SELF'],"dropdownSelectSoftwareLicense.php")) { $AJAX_INCLUDE = 1; include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } Session::checkRight("software", "w"); // Make a select box $rand = mt_rand(); $where = ""; if ((strlen($_POST['searchText']) > 0) && ($_POST['searchText'] != $CFG_GLPI["ajax_wildcard"])) { $where .=" AND `glpi_softwares`.`name` ".Search::makeTextSearch($_POST['searchText'])." "; } $where .= getEntitiesRestrictRequest(' AND', 'glpi_softwarelicenses', 'entities_id', $_POST["entity_restrict"], true); $query = "SELECT DISTINCT `glpi_softwares`.`id`, `glpi_softwares`.`name` FROM `glpi_softwares` INNER JOIN `glpi_softwarelicenses` ON (`glpi_softwares`.`id` = `glpi_softwarelicenses`.`softwares_id`) WHERE `glpi_softwares`.`is_deleted` = '0' AND `glpi_softwares`.`is_template` = '0' $where ORDER BY `glpi_softwares`.`name`"; $result = $DB->query($query); echo "\n"; $paramsselsoft = array('softwares_id' => '__VALUE__', 'entity_restrict' => $_POST['entity_restrict'], 'myname' => $_POST['myname']); Ajax::updateItemOnSelectEvent("item_type$rand", "show_".$_POST["myname"].$rand, $CFG_GLPI["root_doc"]."/ajax/dropdownSoftwareLicense.php", $paramsselsoft); echo " \n"; ?> glpi-0.84.3+dfsg.1/ajax/dropdownShowIPNetwork.php000066400000000000000000000037401226600447100215610ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); $network = new IPNetwork(); if ($network->can($_POST['ipnetworks_id'], 'r')) { echo "
\n"; echo "".$network->fields['completename']."
\n"; $address = $network->getAddress()->getTextual(); $netmask = $network->getNetmask()->getTextual(); $gateway = $network->getGateway()->getTextual(); $start = new IPAddress(); $end = new IPAddress(); $network->computeNetworkRange($start, $end); //TRANS: %1$s is address, %2$s is netmask printf(__('IP network: %1$s/%2$s')."
\n", $address, $netmask); printf(__('First/last addresses: %1$s/%2$s'), $start->getTextual(), $end->getTextual()); if (!empty($gateway)) { echo "
\n"; printf(__('Gateway: %s')."\n", $gateway); } } ?>glpi-0.84.3+dfsg.1/ajax/dropdownSoftwareLicense.php000066400000000000000000000050441226600447100221320ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (strpos($_SERVER['PHP_SELF'],"dropdownSoftwareLicense.php")) { $AJAX_INCLUDE = 1; include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } Session::checkRight("software", "w"); if ($_POST['softwares_id'] > 0) { if (!isset($_POST['value'])) { $_POST['value'] = 0; } $restrict = getEntitiesRestrictRequest(' AND', 'glpi_softwarelicenses', 'entities_id', $_POST['entity_restrict'], true); // Make a select box $query = "SELECT DISTINCT * FROM `glpi_softwarelicenses` WHERE `glpi_softwarelicenses`.`softwares_id` = '".$_POST['softwares_id']."' $restrict ORDER BY `name`"; $result = $DB->query($query); $number = $DB->numrows($result); echo " "; } ?> glpi-0.84.3+dfsg.1/ajax/dropdownTicketCategories.php000066400000000000000000000037061226600447100222710ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (strpos($_SERVER['PHP_SELF'],"dropdownTicketCategories.php")) { include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } if (!defined('GLPI_ROOT')) { die("Can not acces directly to this file"); } $opt = array('entity' => $_POST["entity_restrict"]); if ($_POST['type'] == $_POST['currenttype']) { $opt['value'] = $_POST['value']; } if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") { $opt['condition'] = "`is_helpdeskvisible`='1' AND "; } else { $opt['condition'] = ''; } if ($_POST["type"]) { switch ($_POST['type']) { case Ticket::INCIDENT_TYPE : $opt['condition'].= " `is_incident`='1'"; break; case Ticket::DEMAND_TYPE: $opt['condition'].= " `is_request`='1'"; break; } } ItilCategory::dropdown($opt); ?>glpi-0.84.3+dfsg.1/ajax/dropdownTrackingDeviceType.php000066400000000000000000000046661226600447100225720ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::checkLoginUser(); // Make a select box if (isset($_POST["itemtype"]) && CommonITILObject::isPossibleToAssignType($_POST["itemtype"])) { $table = getTableForItemType($_POST["itemtype"]); $rand = mt_rand(); // Message for post-only if (!isset($_POST["admin"]) || ($_POST["admin"] == 0)) { echo "
".__('Enter the first letters (user, item name, serial or asset number)'); } echo "
"; Ajax::displaySearchTextForDropdown($_POST['myname'].$rand,8); $paramstrackingdt = array('searchText' => '__VALUE__', 'myname' => $_POST["myname"], 'table' => $table, 'itemtype' => $_POST["itemtype"], 'entity_restrict' => $_POST['entity_restrict']); Ajax::updateItemOnInputTextEvent("search_".$_POST['myname'].$rand, "results_ID$rand", $CFG_GLPI["root_doc"]."/ajax/dropdownFindNum.php", $paramstrackingdt); echo ""; echo "\n"; } ?> glpi-0.84.3+dfsg.1/ajax/dropdownUnicityFields.php000066400000000000000000000030421226600447100216040ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (strpos($_SERVER['PHP_SELF'],"dropdownUnicityFields.php")) { include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } Session::checkRight("config", "w"); $field = new FieldUnicity(); if ($_POST['id'] > 0) { $field->getFromDB($_POST['id']); } else { $field->getEmpty(); $field->fields['itemtype'] = $_POST['itemtype']; } FieldUnicity::selectCriterias($field); ?> glpi-0.84.3+dfsg.1/ajax/dropdownUsers.php000066400000000000000000000104741226600447100201410ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ // Direct access to file if (strpos($_SERVER['PHP_SELF'],"dropdownUsers.php")) { $AJAX_INCLUDE = 1; include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } if (!defined('GLPI_ROOT')) { die("Can not acces directly to this file"); } Session::checkLoginUser(); if (!isset($_POST['right'])) { $_POST['right'] = "all"; } // Default view : Nobody if (!isset($_POST['all'])) { $_POST['all'] = 0; } $used = array(); if (isset($_POST['used'])) { if (is_array($_POST['used'])) { $used = $_POST['used']; } else { $used = Toolbox::decodeArrayFromInput($_POST['used']); } } if (isset($_POST["entity_restrict"]) && !is_numeric($_POST["entity_restrict"]) && !is_array($_POST["entity_restrict"])) { $_POST["entity_restrict"] = Toolbox::decodeArrayFromInput($_POST["entity_restrict"]); } $result = User::getSqlSearchResult(false, $_POST['right'], $_POST["entity_restrict"], $_POST['value'], $used, $_POST['searchText']); $users = array(); if ($DB->numrows($result)) { while ($data=$DB->fetch_assoc($result)) { $users[$data["id"]] = formatUserName($data["id"], $data["name"], $data["realname"], $data["firstname"]); $logins[$data["id"]] = $data["name"]; } } if (!function_exists('dpuser_cmp')) { function dpuser_cmp($a, $b) { return strcasecmp($a, $b); } } // Sort non case sensitive uasort($users, 'dpuser_cmp'); echo ""; if (isset($_POST["comment"]) && $_POST["comment"]) { $paramscomment = array('value' => '__VALUE__', 'table' => "glpi_users"); if (isset($_POST['update_link'])) { $paramscomment['withlink'] = "comment_link_".$_POST["myname"].$_POST["rand"]; } Ajax::updateItemOnSelectEvent("dropdown_".$_POST["myname"].$_POST["rand"], "comment_".$_POST["myname"].$_POST["rand"], $CFG_GLPI["root_doc"]."/ajax/comments.php", $paramscomment); } Ajax::commonDropdownUpdateItem($_POST); ?>glpi-0.84.3+dfsg.1/ajax/dropdownValue.php000066400000000000000000000441531226600447100201150ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ // Direct access to file if (strpos($_SERVER['PHP_SELF'],"dropdownValue.php")) { include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } if (!defined('GLPI_ROOT')) { die("Can not acces directly to this file"); } Session::checkLoginUser(); // Security if (!($item = getItemForItemtype($_POST['itemtype']))) { exit(); } $table = $item->getTable(); $displaywith = false; if (isset($_POST['displaywith'])) { if (!is_array($_POST['displaywith'])) { $_POST['displaywith'] = Toolbox::decodeArrayFromInput($_POST["displaywith"]); } if (is_array($_POST['displaywith']) && count($_POST['displaywith'])) { $displaywith = true; } } // No define value if (!isset($_POST['value'])) { $_POST['value'] = ''; } if (!isset($_POST['permit_select_parent'])) { $_POST['permit_select_parent'] = false; } // No define rand if (!isset($_POST['rand'])) { $_POST['rand'] = mt_rand(); } if (isset($_POST['condition']) && !empty($_POST['condition'])) { $_POST['condition'] = rawurldecode(stripslashes($_POST['condition'])); } if (!isset($_POST['emptylabel']) || ($_POST['emptylabel'] == '')) { $_POST['emptylabel'] = Dropdown::EMPTY_VALUE; } if (isset($_POST["entity_restrict"]) && !empty($_POST["entity_restrict"]) && !is_numeric($_POST["entity_restrict"]) && !is_array($_POST["entity_restrict"])) { $_POST["entity_restrict"] = Toolbox::decodeArrayFromInput($_POST["entity_restrict"]); } // Make a select box with preselected values if (!isset($_POST["limit"])) { $_POST["limit"] = $_SESSION["glpidropdown_chars_limit"]; } $where = "WHERE 1 "; if ($item->maybeDeleted()) { $where .= " AND `is_deleted` = '0' "; } if ($item->maybeTemplate()) { $where .= " AND `is_template` = '0' "; } $NBMAX = $CFG_GLPI["dropdown_max"]; $LIMIT = "LIMIT 0,$NBMAX"; if ($_POST['searchText']==$CFG_GLPI["ajax_wildcard"]) { $LIMIT = ""; } $where .=" AND `$table`.`id` NOT IN ('".$_POST['value']."'"; if (isset($_POST['used'])) { if (is_array($_POST['used'])) { $used = $_POST['used']; } else { $used = Toolbox::decodeArrayFromInput($_POST['used']); } if (count($used)) { $where .= ",'".implode("','",$used)."'"; } } if (isset($_POST['toadd'])) { if (is_array($_POST['toadd'])) { $toadd = $_POST['toadd']; } else { $toadd = Toolbox::decodeArrayFromInput($_POST['toadd']); } } else { $toadd = array(); } $where .= ") "; if (isset($_POST['condition']) && $_POST['condition'] != '') { $where .= " AND ".$_POST['condition']." "; } if ($item instanceof CommonTreeDropdown) { if ($_POST['searchText']!=$CFG_GLPI["ajax_wildcard"]) { $where .= " AND `completename` ".Search::makeTextSearch($_POST['searchText']); } $multi = false; // Manage multiple Entities dropdowns $add_order = ""; if ($item->isEntityAssign()) { $recur = $item->maybeRecursive(); // Entities are not really recursive : do not display parents if ($_POST['itemtype'] == 'Entity') { $recur = false; } if (isset($_POST["entity_restrict"]) && !($_POST["entity_restrict"]<0)) { $where .= getEntitiesRestrictRequest(" AND ", $table, '', $_POST["entity_restrict"], $recur); if (is_array($_POST["entity_restrict"]) && count($_POST["entity_restrict"])>1) { $multi = true; } } else { $where .= getEntitiesRestrictRequest(" AND ", $table, '', '', $recur); if (count($_SESSION['glpiactiveentities'])>1) { $multi = true; } } // Force recursive items to multi entity view if ($recur) { $multi = true; } // no multi view for entitites if ($_POST['itemtype'] == "Entity") { $multi = false; } if ($multi) { $add_order = '`entities_id`, '; } } $query = "SELECT * FROM `$table` $where ORDER BY $add_order `completename` $LIMIT"; if ($result = $DB->query($query)) { echo ""; } } else { // Not a dropdowntree $multi = false; if ($item->isEntityAssign()) { $multi = $item->maybeRecursive(); if (isset($_POST["entity_restrict"]) && !($_POST["entity_restrict"] < 0)) { $where .= getEntitiesRestrictRequest("AND", $table, "entities_id", $_POST["entity_restrict"], $multi); if (is_array($_POST["entity_restrict"]) && (count($_POST["entity_restrict"]) > 1)) { $multi = true; } } else { $where .= getEntitiesRestrictRequest("AND", $table, '', '', $multi); if (count($_SESSION['glpiactiveentities'])>1) { $multi = true; } } } $field = "name"; if ($item instanceof CommonDevice) { $field = "designation"; } if ($_POST['searchText']!=$CFG_GLPI["ajax_wildcard"]) { $search = Search::makeTextSearch($_POST['searchText']); $where .=" AND (`$table`.`$field` ".$search; if ($_POST['itemtype']=="SoftwareLicense") { $where .= " OR `glpi_softwares`.`name` ".$search; } $where .= ')'; } switch ($_POST['itemtype']) { case "Contact" : $query = "SELECT `$table`.`entities_id`, CONCAT(`name`,' ',`firstname`) AS $field, `$table`.`comment`, `$table`.`id` FROM `$table` $where"; break; case "SoftwareLicense" : $query = "SELECT `$table`.*, CONCAT(`glpi_softwares`.`name`,' - ',`glpi_softwarelicenses`.`name`) AS $field FROM `$table` LEFT JOIN `glpi_softwares` ON (`glpi_softwarelicenses`.`softwares_id` = `glpi_softwares`.`id`) $where"; break; default : $query = "SELECT * FROM `$table` $where"; } if ($multi) { $query .= " ORDER BY `entities_id`, $field $LIMIT"; } else { $query .= " ORDER BY $field $LIMIT"; } if ($result = $DB->query($query)) { echo ""; } } if (isset($_POST["comment"]) && $_POST["comment"]) { $paramscomment = array('value' => '__VALUE__', 'table' => $table); if (isset($_POST['update_link'])) { $paramscomment['withlink'] = "comment_link_".$_POST["myname"].$_POST["rand"]; } Ajax::updateItemOnSelectEvent("dropdown_".$_POST["myname"].$_POST["rand"], "comment_".$_POST["myname"].$_POST["rand"], $CFG_GLPI["root_doc"]."/ajax/comments.php", $paramscomment); } Ajax::commonDropdownUpdateItem($_POST); ?> glpi-0.84.3+dfsg.1/ajax/dropdownValuesBlacklist.php000077500000000000000000000033511226600447100221270ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (strpos($_SERVER['PHP_SELF'], "dropdownValuesBlacklist.php")) { include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } Session::checkRight("config", "w"); if (isset($_POST['itemtype']) && isset($_POST['id_field'])) { $blacklist = new Fieldblacklist(); if (isset($_POST['id']) && ($_POST['id'] > 0)) { $blacklist->getFromDB($_POST['id']); } else { $blacklist->getEmpty(); } $blacklist->fields['field'] = $_POST['id_field']; $blacklist->fields['itemtype'] = $_POST['itemtype']; $blacklist->selectValues($_POST['id_field']); } ?>glpi-0.84.3+dfsg.1/ajax/entitytree.php000066400000000000000000000026611226600447100174560ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ $AJAX_INCLUDE = 1; include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::checkLoginUser(); if (!isset($_POST['target'])) { $_POST['target'] = $CFG_GLPI['root_doc']."/front/central.php"; } Entity::showSelector($_POST['target'], "activeentity"); Html::ajaxFooter(); ?>glpi-0.84.3+dfsg.1/ajax/entitytreesons.php000066400000000000000000000115341226600447100203600ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ $AJAX_INCLUDE = 1; include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::checkLoginUser(); if (isset($_POST['node'])) { if ($_SESSION['glpiactiveprofile']['interface']=='helpdesk') { $target = "helpdesk.public.php"; } else { $target = "central.php"; } $nodes = array(); // Get ancestors of current entity $ancestors = getAncestorsOf('glpi_entities', $_SESSION['glpiactive_entity']); // Root node if ($_POST['node'] == -1) { $pos = 0; foreach ($_SESSION['glpiactiveprofile']['entities'] as $entity) { $ID = $entity['id']; $is_recursive = $entity['is_recursive']; $path['text'] = Dropdown::getDropdownName("glpi_entities", $ID); $path['id'] = $ID; $path['position'] = $pos; $pos++; $path['draggable'] = false; $path['href'] = $CFG_GLPI["root_doc"]."/front/$target?active_entity=".$ID; // Check if node is a leaf or a folder. $path['leaf'] = true; $path['cls'] = 'file'; if ($is_recursive) { $query2 = "SELECT COUNT(`id`) FROM `glpi_entities` WHERE `entities_id` = '$ID'"; $result2 = $DB->query($query2); if ($DB->result($result2,0,0) >0) { $path['leaf'] = false; $path['cls'] = 'folder'; $path['text'] .= " ". "\"".__s('Show"; $path['expanded'] = isset($ancestors[$ID]); } } $nodes[] = $path; } } else { // standard node $query = "SELECT * FROM `glpi_entities` WHERE `entities_id` = '".$_POST['node']."' ORDER BY `name`"; if ($result=$DB->query($query)) { if ($DB->numrows($result)) { $pos = 0; while ($row = $DB->fetch_assoc($result)) { $path['text'] = $row['name']; $path['id'] = $row['id']; $path['position'] = $pos; $pos++; $path['draggable'] = false; $path['href'] = $CFG_GLPI["root_doc"]."/front/$target?active_entity=".$row['id']; // Check if node is a leaf or a folder. $query2 = "SELECT COUNT(`id`) FROM `glpi_entities` WHERE `entities_id` = '".$row['id']."'"; $result2 = $DB->query($query2); if ($DB->result($result2,0,0) >0) { $path['leaf'] = false; $path['cls'] = 'folder'; $path['text'] .= " ". "\"".__s('Show"; $path['expanded'] = isset($ancestors[$row['id']]); } else { $path['leaf'] = true; $path['cls'] = 'file'; } $nodes[] = $path; } } } } print json_encode($nodes); } ?>glpi-0.84.3+dfsg.1/ajax/genericdate.php000066400000000000000000000031761226600447100175360ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ $AJAX_INCLUDE = 1; include ('../inc/includes.php'); // Send UTF8 Headers header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::checkLoginUser(); if (isset($_POST['value']) && (strcmp($_POST['value'],'0') == 0)) { if ($_POST['withtime']) { Html::showDateTimeFormItem($_POST['name'], $_POST['specificvalue']); } else { Html::showDateFormItem($_POST['name'], $_POST['specificvalue']); } } else { echo ""; } ?>glpi-0.84.3+dfsg.1/ajax/index.php000066400000000000000000000021401226600447100163610ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ ?> glpi-0.84.3+dfsg.1/ajax/inputtext.php000066400000000000000000000032011226600447100173150ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ $AJAX_INCLUDE = 1; include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::checkLoginUser(); if (isset($_POST['name'])) { echo ""; } ?> glpi-0.84.3+dfsg.1/ajax/ldapdaterestriction.php000066400000000000000000000026701226600447100213260ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (strpos($_SERVER['PHP_SELF'],"ldapdaterestriction.php")) { include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } if (!defined('GLPI_ROOT')) { die("Can not acces directly to this file"); } Session::checkLoginUser(); AuthLdap::showDateRestrictionForm($_POST); ?> glpi-0.84.3+dfsg.1/ajax/massiveaction.php000066400000000000000000000061421226600447100201250ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.84 */ include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::checkLoginUser(); if (isset($_POST['itemtype'])) { if (!($item = getItemForItemtype($_POST['itemtype']))) { exit(); } if (!isset($_POST['is_deleted'])) { $_POST['is_deleted'] = 0; } $checkitem = NULL; if (isset($_POST['check_itemtype'])) { $checkitem = new $_POST['check_itemtype'](); if (isset($_POST['check_items_id'])) { $checkitem->getFromDB($_POST['check_items_id']); } } echo "

"; $params = array('action' => '__VALUE__'); foreach ($_POST as $key => $val) { $params[$key] = $val; } $rand = mt_rand(); $params['specific_action'] = 0; $actions = $item->getAllMassiveActions($_POST['is_deleted'], $checkitem); if (isset($_POST['specific_actions']) && is_array($_POST['specific_actions']) && count($_POST['specific_actions'])) { $specific_actions = Toolbox::stripslashes_deep($_POST['specific_actions']); // If specific actions is used to limit display if (count($specific_actions) != count(array_intersect_key($actions,$specific_actions))) { $params['specific_action'] = 1; } $actions = $specific_actions; } if (count($actions)) { _e('Action'); echo " "; echo "

"; Ajax::updateItemOnSelectEvent("massiveaction$rand", "show_massiveaction$rand", $CFG_GLPI["root_doc"]."/ajax/dropdownMassiveAction.php", $params); echo " \n"; } echo "
"; } ?> glpi-0.84.3+dfsg.1/ajax/planning.php000066400000000000000000000106751226600447100170740ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::checkCentralAccess(); if (isset($_POST["id"]) && ($_POST["id"] > 0)) { echo ""; } if (isset($_POST["begin"]) && !empty($_POST["begin"])) { $begin = $_POST["begin"]; } else { $minute = (floor(date('i')/10)*10); if ($minute < 10) { $minute = '0'.$minute; } $begin = date("Y-m-d H").":$minute:00"; } if (isset($_POST["end"]) && !empty($_POST["end"])) { $end = $_POST["end"]; } else { $end = date("Y-m-d H:i:s",strtotime($begin)+HOUR_TIMESTAMP); } echo ""; $rand_user = mt_rand(); if (isset($_POST["users_id"]) && isset($_POST["entity"])) { echo ""; echo "\n"; } echo "\n"; echo "\n"; if ((!isset($_POST["id"]) || ($_POST["id"] == 0)) && isset($_POST['itemtype']) && PlanningRecall::isAvailable()) { echo ""; } echo "
".__('By').""; $params = array('name' => "plan[users_id]", 'value' => $_POST["users_id"], 'right' => "own_ticket", 'rand' => $rand_user, 'entity' => $_POST["entity"]); $params['toupdate'] = array('value_fieldname' => 'users_id', 'to_update' => "user_available$rand_user", 'url' => $CFG_GLPI["root_doc"]."/ajax/planningcheck.php"); User::dropdown($params); echo "
".__('Start date').""; $rand_begin = Html::showDateTimeFormItem("plan[begin]", $begin, -1, false, true, '', '', $CFG_GLPI["planning_begin"], $CFG_GLPI["planning_end"]); echo "
".__('Period')." "; if (isset($_POST["users_id"])) { echo ""; include_once(GLPI_ROOT.'/ajax/planningcheck.php'); echo ""; } echo ""; $default_delay = floor((strtotime($end)-strtotime($begin))/15/MINUTE_TIMESTAMP)*15*MINUTE_TIMESTAMP; $rand = Dropdown::showTimeStamp("plan[_duration]", array('min' => 0, 'max' => 50*HOUR_TIMESTAMP, 'value' => $default_delay, 'emptylabel' => __('Specify an end date'))); echo "
"; $params = array('duration' => '__VALUE__', 'end' => $end, 'name' => "plan[end]", 'global_begin' => $CFG_GLPI["planning_begin"], 'global_end' => $CFG_GLPI["planning_end"]); Ajax::updateItemOnSelectEvent("dropdown_plan[_duration]$rand", "date_end$rand", $CFG_GLPI["root_doc"]."/ajax/planningend.php", $params); if ($default_delay == 0) { $params['duration'] = 0; Ajax::updateItem("date_end$rand", $CFG_GLPI["root_doc"]."/ajax/planningend.php", $params); } echo "
"._x('Planning','Reminder').""; PlanningRecall::dropdown(array('itemtype' => $_POST['itemtype'], 'items_id' => $_POST['items_id'])); echo "
\n"; Html::ajaxFooter(); ?>glpi-0.84.3+dfsg.1/ajax/planningcheck.php000066400000000000000000000035631226600447100200700ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.83 */ // Direct access to file if (strpos($_SERVER['PHP_SELF'],"planningcheck.php")) { $AJAX_INCLUDE = 1; include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } Session::checkLoginUser(); if (isset($_POST['users_id']) && ($_POST['users_id'] > 0)) { echo " \"".__s('Availability')."\" "; } ?>glpi-0.84.3+dfsg.1/ajax/planningend.php000066400000000000000000000032641226600447100175570ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ $AJAX_INCLUDE = 1; include ('../inc/includes.php'); // Send UTF8 Headers header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::checkLoginUser(); if (isset($_POST['duration']) && ($_POST['duration'] == 0) && isset($_POST['name'])) { if (!isset($_POST['global_begin'])) { $_POST['global_begin'] = ''; } if (!isset($_POST['global_end'])) { $_POST['global_end'] = ''; } Html::showDateTimeFormItem($_POST['name'], $_POST['end'], -1, false, true, '', '', $_POST['global_begin'], $_POST['global_end']); } ?>glpi-0.84.3+dfsg.1/ajax/priority.php000066400000000000000000000032551226600447100171430ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); // Send UTF8 Headers header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::checkLoginUser(); if (isset($_POST["urgency"]) && isset($_POST["impact"]) && isset($_POST["priority"])) { $priority = Ticket::computePriority($_POST["urgency"], $_POST["impact"]); if ($_POST["priority"]) { echo ""; } else { echo Ticket::getPriorityName($priority); } } ?>glpi-0.84.3+dfsg.1/ajax/private_public.php000066400000000000000000000050521226600447100202670ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (strpos($_SERVER['PHP_SELF'],"private_public.php")) { include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } if (!defined('GLPI_ROOT')) { die("Can not acces directly to this file"); } if (isset($_POST['is_private'])) { Session::checkLoginUser(); switch ($_POST['is_private']) { case true : echo "\n"; echo "\n"; echo "\n"; $private = __('Personal'); $link = "".__('Set public').""; printf(__('%1$s - %2$s'), $private, $link); break; case false : if (isset($_POST['entities_id']) && in_array($_POST['entities_id'], $_SESSION['glpiactiveentities'])) { $val = $_POST['entities_id']; } else { $val = $_SESSION['glpiactive_entity']; } echo "\n"; echo __('Public')." "; Entity::dropdown(array('value' => $val)); echo " "; _e('Child entities'); echo " "; Dropdown::showYesNo('is_recursive', $_POST["is_recursive"]); echo " ".__('Set personal').""; break; } } ?> glpi-0.84.3+dfsg.1/ajax/resaperiod.php000066400000000000000000000054061226600447100174170ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.84 */ $AJAX_INCLUDE = 1; include ('../inc/includes.php'); // Send UTF8 Headers header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::checkLoginUser(); if (isset($_POST['type']) && isset($_POST['end'])) { echo ""; switch ($_POST['type']) { case 'day' : echo ""; break; case 'week' : echo "
".__('End date').''; Html::showDateFormItem('periodicity[end]', $_POST['end']); echo "
".__('End date').''; Html::showDateFormItem('periodicity[end]', $_POST['end']); echo "
"; echo ""; echo ""; $days = array('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'); foreach ($days as $day) { echo ""; } echo "'; foreach ($days as $day) { echo ""; } echo ""; break; case 'month' : echo ""; echo ""; } echo '
 ".__($day)."
".__('By day').'
"; echo ""; echo "
".__('End date').''; Html::showDateFormItem('periodicity[end]', $_POST['end']); echo "
'; } ?>glpi-0.84.3+dfsg.1/ajax/ruleaction.php000066400000000000000000000053761226600447100174350ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ // Direct access to file if (strpos($_SERVER['PHP_SELF'],"ruleaction.php")) { include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } if (!defined('GLPI_ROOT')) { die("Can not acces directly to this file"); } Session::checkLoginUser(); // Non define case if (isset($_POST["sub_type"]) && class_exists($_POST["sub_type"])) { if (!isset($_POST["field"])) { $_POST["field"] = key(Rule::getActionsByType($_POST["sub_type"])); } if (!($item = getItemForItemtype($_POST["sub_type"]))) { exit(); } if (!isset($_POST[$item->getRuleIdField()])) { exit(); } $ra = getItemForItemtype($item->getRuleActionClass()); $used = $ra->getAlreadyUsedForRuleID($_POST[$item->getRuleIdField()], $item->getType()); $already_used = in_array($_POST["field"], $used); $randaction = RuleAction::dropdownActions($_POST["sub_type"], "action_type", $_POST["field"], $already_used); echo "  "; echo "\n"; echo "\n"; $paramsaction = array('action_type' => '__VALUE__', 'field' => $_POST["field"], 'sub_type' => $_POST["sub_type"]); Ajax::updateItemOnSelectEvent("dropdown_action_type$randaction", "action_type_span$randaction", $CFG_GLPI["root_doc"]."/ajax/ruleactionvalue.php", $paramsaction); Ajax::updateItem("action_type_span$randaction", $CFG_GLPI["root_doc"]."/ajax/ruleactionvalue.php", $paramsaction, "dropdown_action_type$randaction"); } ?> glpi-0.84.3+dfsg.1/ajax/ruleactionvalue.php000066400000000000000000000027621226600447100204660ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ // Direct access to file if (strpos($_SERVER['PHP_SELF'],"ruleactionvalue.php")) { include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } if (!defined('GLPI_ROOT')) { die("Can not acces directly to this file"); } Session::checkLoginUser(); $display = false; $ra = new RuleAction(); $ra->displayActionSelectPattern($_POST); ?>glpi-0.84.3+dfsg.1/ajax/rulecriteria.php000066400000000000000000000056151226600447100177560ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ // Direct access to file if (strpos($_SERVER['PHP_SELF'],"rulecriteria.php")) { include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } if (!defined('GLPI_ROOT')) { die("Can not acces directly to this file"); } Session::checkLoginUser(); if (isset($_POST["sub_type"]) && ($rule = getItemForItemtype($_POST["sub_type"]))) { $criterias = $rule->getAllCriteria(); if (count($criterias)) { // First include -> first of the predefined array if (!isset($_POST["criteria"])) { $_POST["criteria"] = key($criterias); } if (isset($criterias[$_POST["criteria"]]['allow_condition'])) { $allow_condition = $criterias[$_POST["criteria"]]['allow_condition']; } else { $allow_condition = array(); } $randcrit = RuleCriteria::dropdownConditions($_POST["sub_type"], array('criterion' => $_POST["criteria"], 'allow_conditions' => $allow_condition)); echo "  "; echo "\n"; echo "\n"; $paramscriteria = array('condition' => '__VALUE__', 'criteria' => $_POST["criteria"], 'sub_type' => $_POST["sub_type"]); Ajax::updateItemOnSelectEvent("dropdown_condition$randcrit", "condition_span$randcrit", $CFG_GLPI["root_doc"]."/ajax/rulecriteriavalue.php", $paramscriteria); Ajax::updateItem("condition_span$randcrit", $CFG_GLPI["root_doc"]."/ajax/rulecriteriavalue.php", $paramscriteria, "dropdown_condition$randcrit"); } } ?> glpi-0.84.3+dfsg.1/ajax/rulecriteriavalue.php000066400000000000000000000031501226600447100210030ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ // Direct access to file if (strstr($_SERVER['PHP_SELF'],"rulecriteriavalue.php")) { include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } if (!defined('GLPI_ROOT')) { die("Can not acces directly to this file"); } Session::checkLoginUser(); // Non define case if (isset($_POST["sub_type"]) && ($rule = getItemForItemtype($_POST["sub_type"]))) { $rule->displayCriteriaSelectPattern("pattern", $_POST["criteria"], $_POST['condition']); } ?>glpi-0.84.3+dfsg.1/ajax/searchoption.php000066400000000000000000000071031226600447100177540ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ // Direct access to file if (strpos($_SERVER['PHP_SELF'],"searchoption.php")) { include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } if (!defined('GLPI_ROOT')) { die("Can not acces directly to this file"); } Session::checkLoginUser(); $addmeta = ""; // Non define case if (isset($_POST["itemtype"]) && isset($_POST["field"]) ) { if (isset($_POST['meta']) && $_POST['meta']) { $addmeta = '2'; } else { $_POST['meta'] = 0; } $actions = Search::getActionsFor($_POST["itemtype"], $_POST["field"]); // is it a valid action for type ? if (count($actions) && (empty($_POST['searchtype']) || !isset($actions[$_POST['searchtype']]))) { $tmp = $actions; unset($tmp['searchopt']); $_POST['searchtype'] = key($tmp); unset($tmp); } $randsearch = -1; $dropdownname = "searchtype$addmeta".$_POST["itemtype"].$_POST["num"]; $searchopt = array(); echo "
"; if (count($actions)>0) { // get already get search options if (isset($actions['searchopt'])) { $searchopt = $actions['searchopt']; // No name for clean array whith quotes unset($searchopt['name']); unset($actions['searchopt']); } $randsearch = Dropdown::showFromArray("searchtype".$addmeta."[".$_POST["num"]."]", $actions, array('value' => $_POST["searchtype"])); } echo ""; echo "\n"; $_POST['value'] = stripslashes($_POST['value']); $_POST['searchopt'] = $searchopt; include(GLPI_ROOT."/ajax/searchoptionvalue.php"); echo "\n"; echo "
"; $paramsaction = array('searchtype' => '__VALUE__', 'field' => $_POST["field"], 'itemtype' => $_POST["itemtype"], 'num' => $_POST["num"], 'value' => rawurlencode($_POST['value']), 'searchopt' => $searchopt, 'meta' => $_POST['meta']); Ajax::updateItemOnSelectEvent("dropdown_searchtype".$addmeta."[".$_POST["num"]."]$randsearch", "span$dropdownname", $CFG_GLPI["root_doc"]."/ajax/searchoptionvalue.php", $paramsaction); } ?> glpi-0.84.3+dfsg.1/ajax/searchoptionvalue.php000066400000000000000000000114171226600447100210140ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ // Direct access to file if (strpos($_SERVER['PHP_SELF'],"searchoptionvalue.php")) { include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } if (!defined('GLPI_ROOT')) { die("Can not acces directly to this file"); } Session::checkLoginUser(); if (isset($_POST['searchtype'])) { if (!is_array($_POST['searchopt'])) { $searchopt = Toolbox::decodeArrayFromInput($_POST['searchopt']); } else { $searchopt = $_POST['searchopt']; } $_POST['value'] = rawurldecode($_POST['value']); $addmeta = ""; if (isset($_POST['meta']) && $_POST['meta']) { $addmeta = '2'; } $inputname = 'contains'.$addmeta.'['.$_POST['num'].']'; $display = false; $item = getItemForItemtype($_POST['itemtype']); $options['value'] = $_POST['value']; // For tree dropdpowns $options['permit_select_parent'] = true; switch ($_POST['searchtype']) { case "equals" : case "notequals" : case "morethan" : case "lessthan" : case "under" : case "notunder" : if (!$display && isset($searchopt['field'])) { // Specific cases switch ($searchopt['table'].".".$searchopt['field']) { case "glpi_changes.status" : case "glpi_changes.impact" : case "glpi_changes.urgency" : case "glpi_problems.status" : case "glpi_problems.impact" : case "glpi_problems.urgency" : case "glpi_tickets.status" : case "glpi_tickets.impact" : case "glpi_tickets.urgency" : $options['showtype'] = 'search'; break; case "glpi_changes.priority" : case "glpi_problems.priority" : case "glpi_tickets.priority" : $options['showtype'] = 'search'; $options['withmajor'] = true; break; case "glpi_tickets.global_validation" : $options['all'] = true; break; case "glpi_ticketvalidations.status" : $options['all'] = true; break; } // Standard datatype usage if (!$display && isset($searchopt['datatype'])) { switch ($searchopt['datatype']) { case "date" : case "date_delay" : case "datetime" : $options['relative_dates'] = true; break; } } $out = $item->getValueToSelect($searchopt, $inputname, $_POST['value'], $options); if (strlen($out)) { echo $out; $display = true; } break; //Could display be handled by a plugin ? if (!$display && $plug = isPluginItemType(getItemTypeForTable($searchopt['table']))) { $function = 'plugin_'.$plug['plugin'].'_searchOptionsValues'; if (function_exists($function)) { $params = array('name' => $inputname, 'searchtype' => $_POST['searchtype'], 'searchoption' => $searchopt, 'value' => $_POST['value']); $display = $function($params); } } } break; } // Default case : text field if (!$display) { echo ""; } } ?> glpi-0.84.3+dfsg.1/ajax/solution.php000066400000000000000000000035671226600447100171440ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ $AJAX_INCLUDE = 1; include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::checkLoginUser(); $rand = mt_rand(); Html::initEditorSystem("solution$rand"); if (isset($_POST['value']) && ($_POST['value'] > 0)) { $template = new SolutionTemplate(); if ($template->getFromDB($_POST['value'])) { echo "\n"; echo ""; } } else { echo ""; } ?>glpi-0.84.3+dfsg.1/ajax/subvisibility.php000066400000000000000000000037051226600447100201630ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ // Direct access to file if (strpos($_SERVER['PHP_SELF'],"subvisibility.php")) { $AJAX_INCLUDE = 1; include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } Session::checkLoginUser(); if (isset($_POST['type']) && !empty($_POST['type']) && isset($_POST['items_id']) && ($_POST['items_id'] > 0)) { switch ($_POST['type']) { case 'Group' : case 'Profile' : $params = array('value' => $_SESSION['glpiactive_entity']); if (Session::isViewAllEntities()) { $params['toadd'] = array(-1 => __('No restriction')); } _e('Entity'); echo " "; Entity::dropdown($params); echo " "; _e('Child entities'); echo " "; Dropdown::showYesNo('is_recursive'); break; } } ?>glpi-0.84.3+dfsg.1/ajax/textarea.php000066400000000000000000000031251226600447100170730ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ $AJAX_INCLUDE=1; include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::checkLoginUser(); if (isset($_POST['name'])) { echo ""; } ?>glpi-0.84.3+dfsg.1/ajax/ticketassigninformation.php000066400000000000000000000060111226600447100222110ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ // Direct access to file if (strpos($_SERVER['PHP_SELF'],"ticketassigninformation.php")) { $AJAX_INCLUDE = 1; include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } Session::checkLoginUser(); if (isset($_POST['users_id_assign']) && ($_POST['users_id_assign'] > 0)) { $ticket = new Ticket(); $options2['field'][0] = 5; // users_id assign $options2['searchtype'][0] = 'equals'; $options2['contains'][0] = $_POST['users_id_assign']; $options2['link'][0] = 'AND'; $options2['field'][1] = 12; // status $options2['searchtype'][1] = 'equals'; $options2['contains'][1] = 'notold'; $options2['link'][1] = 'AND'; $options2['reset'] = 'reset'; $url = $ticket->getSearchURL()."?".Toolbox::append_params($options2,'&'); //TRANS: %d is number of objects for the user echo " ("; printf(__('%1$s: %2$s'), __('Processing'), $ticket->countActiveObjectsForTech($_POST['users_id_assign'])); echo ")"; } else if (isset($_POST['groups_id_assign']) && ($_POST['groups_id_assign'] > 0)) { $ticket = new Ticket(); $options2['field'][0] = 8; // groups_id assign $options2['searchtype'][0] = 'equals'; $options2['contains'][0] = $_POST['groups_id_assign']; $options2['link'][0] = 'AND'; $options2['field'][1] = 12; // status $options2['searchtype'][1] = 'equals'; $options2['contains'][1] = 'notold'; $options2['link'][1] = 'AND'; $options2['reset'] = 'reset'; $url = $ticket->getSearchURL()."?".Toolbox::append_params($options2,'&'); echo " ("; printf(__('%1$s: %2$s'), __('Processing'), $ticket->countActiveObjectsForTechGroup($_POST['groups_id_assign'])); echo ")"; } ?>glpi-0.84.3+dfsg.1/ajax/ticketiteminformation.php000066400000000000000000000045151226600447100216720ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ // Direct access to file if (strpos($_SERVER['PHP_SELF'],"ticketiteminformation.php")) { $AJAX_INCLUDE = 1; include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } Session::checkLoginUser(); if (isset($_POST["my_items"]) && !empty($_POST["my_items"])) { $splitter = explode("_",$_POST["my_items"]); if (count($splitter) == 2) { $_POST["itemtype"] = $splitter[0]; $_POST["items_id"] = $splitter[1]; } } if (isset($_POST['itemtype']) && isset($_POST['items_id']) && ($_POST['items_id'] > 0)) { // Security if (!class_exists($_POST['itemtype']) ) { exit(); } $days = 3; $ticket = new Ticket(); $data = $ticket->getActiveOrSolvedLastDaysTicketsForItem($_POST['itemtype'], $_POST['items_id'], $days); $nb = count($data); printf(_n('%s ticket in progress or recently solved on this item.', '%s tickets in progress or recently solved on this item.', $nb), $nb); if ($nb) { $content = ''; foreach ($data as $title) { $content .= $title.'
'; } echo ' '; Html::showToolTip($content); } } ?>glpi-0.84.3+dfsg.1/ajax/ticketsatisfaction.php000077500000000000000000000070351226600447100211600ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ // Direct access to file if (strpos($_SERVER['PHP_SELF'],"ticketsatisfaction.php")) { $AJAX_INCLUDE = 1; include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } $entity = new Entity(); if (isset($_POST['inquest_config']) && isset($_POST['entities_id'])) { if ($entity->getFromDB($_POST['entities_id'])) { $inquest_config = $entity->getfield('inquest_config'); $inquest_delay = $entity->getfield('inquest_delay'); $inquest_rate = $entity->getfield('inquest_rate'); $max_closedate = $entity->getfield('max_closedate'); } else { $inquest_config = $_POST['inquest_config']; $inquest_delay = -1; $inquest_rate = -1; $max_closedate = ''; } if ($_POST['inquest_config'] > 0) { echo ""; echo ""; echo ""; echo "". ""; echo ""; if ($max_closedate != '') { echo ""; echo ""; } if ($_POST['inquest_config'] == 2) { echo ""; echo ""; echo ""; echo ""; } echo "
".__('Create survey after').""; Dropdown::showInteger('inquest_delay', $inquest_delay, 1, 90, 1, array('0' => __('As soon as possible')), array('unit' => 'day')); echo "
".__('Rate to trigger survey').""; Dropdown::showInteger('inquest_rate', $inquest_rate, 10, 100, 10, array(0 => __('Disabled')), array('unit' => '%')); echo "
". __('For tickets closed after')."" . Html::convDateTime($max_closedate)."
".__('Valid tags')."". "[TICKET_ID] [TICKET_NAME] [TICKET_CREATEDATE] [TICKET_SOLVEDATE] ". "[REQUESTTYPE_ID] [REQUESTTYPE_NAME] [ITEMTYPE] [ITEM_ID] [ITEM_NAME] ". "[TICKET_PRIORITY] [TICKETCATEGORY_ID] [TICKETCATEGORY_NAME] [TICKETTYPE_ID] ". "[TICKETTYPE_NAME] [SOLUTIONTYPE_ID] [SOLUTIONTYPE_NAME] ". "[SLA_ID] [SLA_NAME] [SLALEVEL_ID] [SLALEVEL_NAME]
" . __('URL') . ""; Html::autocompletionTextField($entity, "inquest_URL"); echo "
"; } } ?>glpi-0.84.3+dfsg.1/ajax/transfers.php000066400000000000000000000027411226600447100172700ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::checkRight("transfer", "r"); if (isset($_POST["id"]) && ($_POST["id"] > 0)) { $transfer = new Transfer(); $transfer->showForm($_POST["id"], array('target' => $CFG_GLPI["root_doc"]."/front/transfer.action.php")); } Html::ajaxFooter(); ?>glpi-0.84.3+dfsg.1/ajax/uemailUpdate.php000066400000000000000000000062231226600447100176770ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ $AJAX_INCLUDE = 1; if (strpos($_SERVER['PHP_SELF'],"uemailUpdate.php")) { include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } Session::checkLoginUser(); if ((isset($_POST['field']) && ($_POST["value"] > 0)) || (isset($_POST['allow_email']) && $_POST['allow_email'])) { $user = new User(); $default_email = ""; $emails = array(); if ($user->getFromDB($_POST["value"])) { $default_email = $user->getDefaultEmail(); $emails = $user->getAllEmails(); } echo __('Email followup').' '; $default_notif = true; if (isset($_POST['use_notification'])) { $default_notif = $_POST['use_notification']; } if (isset($_POST['alternative_email']) && !empty($_POST['alternative_email']) && empty($default_email)) { $default_email = $_POST['alternative_email']; } $rand = Dropdown::showYesNo($_POST['field'].'[use_notification]', $default_notif); $email_string = ''; // Only one email if ((count($emails) == 1) && !empty($default_email) && NotificationMail::isUserAddressValid($default_email)) { $email_string = $default_email; // Clean alternative email echo ""; } else if (count($emails) > 1) { // Several emails : select in the list $email_string = ""; } else { $email_string = ""; } echo '
'; printf(__('%1$s: %2$s'),__('Email'), $email_string); } Ajax::commonDropdownUpdateItem($_POST); ?>glpi-0.84.3+dfsg.1/ajax/updateMetaSearch.php000066400000000000000000000067541226600447100205100ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); if (!($item = getItemForItemtype($_POST['itemtype']))) { exit(); } $item->checkGlobal('r'); $first_group = true; $newgroup = ""; $items_in_group = 0; $searchopt = Search::getCleanedOptions($_POST["itemtype"], 'r', false); echo "
"; echo ""; echo ""; echo "\n"; $_POST['meta'] = 1; $_POST['searchtype'] = $_POST["searchtype2"]; include (GLPI_ROOT."/ajax/searchoption.php"); echo "\n"; $params = array('field' => '__VALUE__', 'itemtype' => $_POST["itemtype"], 'num' => $_POST["num"], 'value' => $_POST["value"], 'searchtype' => $_POST["searchtype2"], 'meta' => 1); Ajax::updateItemOnSelectEvent("Search2".$_POST["itemtype"].$_POST["num"], "Search2Span".$_POST["itemtype"].$_POST["num"], $CFG_GLPI["root_doc"]."/ajax/searchoption.php", $params); echo '
'; ?> glpi-0.84.3+dfsg.1/ajax/updateTrackingDeviceType.php000066400000000000000000000025721226600447100222120ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ $AJAX_INCLUDE = 1; include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::checkRight("update_ticket", "1"); Ticket::dropdownMyDevices($_POST["userID"], $_POST["entity_restrict"]); Html::ajaxFooter(); ?>glpi-0.84.3+dfsg.1/ajax/updatecurrenttab.php000066400000000000000000000030001226600447100206220ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ define('GLPI_ROOT', dirname(__DIR__)); include_once (GLPI_ROOT . "/config/based_config.php"); include_once (GLPI_ROOT . "/inc/autoload.function.php"); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::setPath(); Session::start(); // Manage tabs if (isset($_GET['glpi_tab']) && isset($_GET['itemtype'])) { Session::setActiveTab($_GET['itemtype'], $_GET['glpi_tab']); } ?>glpi-0.84.3+dfsg.1/ajax/viewsubitem.php000066400000000000000000000033301226600447100176170ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::checkLoginUser(); if (!isset($_POST['type'])) { exit(); } if (!isset($_POST['parenttype'])) { exit(); } if (($item = getItemForItemtype($_POST['type'])) && ($parent = getItemForItemtype($_POST['parenttype']))) { if (isset($_POST[$parent->getForeignKeyField()]) && isset($_POST["id"]) && $parent->getFromDB($_POST[$parent->getForeignKeyField()])) { $item->showForm($_POST["id"], array('parent' => $parent)); } else { _e('Access denied'); } } Html::ajaxFooter(); ?>glpi-0.84.3+dfsg.1/ajax/visibility.php000066400000000000000000000070251226600447100174500ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ // Direct access to file if (strpos($_SERVER['PHP_SELF'],"visibility.php")) { $AJAX_INCLUDE = 1; include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); } Session::checkLoginUser(); if (isset($_POST['type']) && !empty($_POST['type']) && isset($_POST['right'])) { $display = false; $rand = mt_rand(); switch ($_POST['type']) { case 'User' : User::dropdown(array('right' => $_POST['right'])); $display = true; break; case 'Group' : $params = array('rand' => $rand); $params['toupdate'] = array('value_fieldname' => 'value', 'to_update' => "subvisibility$rand", 'url' => $CFG_GLPI["root_doc"]."/ajax/subvisibility.php", 'moreparams' => array('items_id' => '__VALUE__', 'type' => $_POST['type'])); Group::dropdown($params); echo ""; $display = true; break; case 'Entity' : Entity::dropdown(array('entity' => $_SESSION['glpiactiveentities'], 'value' => $_SESSION['glpiactive_entity'])); _e('Child entities'); echo " "; Dropdown::showYesNo('is_recursive'); $display = true; break; case 'Profile' : $params = array('rand' => $rand, 'condition' => "`".$_POST['right']."` IN ('r','w')"); $params['toupdate'] = array('value_fieldname' => 'value', 'to_update' => "subvisibility$rand", 'url' => $CFG_GLPI["root_doc"]."/ajax/subvisibility.php", 'moreparams' => array('items_id' => '__VALUE__', 'type' => $_POST['type'])); Profile::dropdown($params); echo ""; $display = true; break; } if ($display) { echo " "; } } ?>glpi-0.84.3+dfsg.1/config/000077500000000000000000000000001226600447100150665ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/config/.htaccess000066400000000000000000000001631226600447100166640ustar00rootroot00000000000000 Require all denied deny from all glpi-0.84.3+dfsg.1/config/based_config.php000066400000000000000000000123101226600447100201770ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // Notice problem for date function : if (function_exists('date_default_timezone_set')) { $tz = ini_get('date.timezone'); if (!empty($tz)) { date_default_timezone_set($tz); } else { date_default_timezone_set(@date_default_timezone_get()); } } // If this file exists, it is load, allow to set configdir/dumpdir elsewhere if (file_exists(GLPI_ROOT ."/config/config_path.php")) { include_once(GLPI_ROOT ."/config/config_path.php"); } // Default location for database configuration : config_db.php if (!defined("GLPI_CONFIG_DIR")) { define("GLPI_CONFIG_DIR",GLPI_ROOT . "/config"); } // Default location for backup dump if (!defined("GLPI_DUMP_DIR")) { define("GLPI_DUMP_DIR",GLPI_ROOT . "/files/_dumps"); } // Path for documents storage if (!defined("GLPI_DOC_DIR")) { define("GLPI_DOC_DIR",GLPI_ROOT . "/files"); } // Path for cache storage if (!defined("GLPI_CACHE_DIR")) { // Need / at the end for Cache Lite compatibility define("GLPI_CACHE_DIR",GLPI_ROOT . "/files/_cache/"); } // Path for cron storage if (!defined("GLPI_CRON_DIR")) { define("GLPI_CRON_DIR",GLPI_ROOT . "/files/_cron"); } // Path for sessions storage if (!defined("GLPI_SESSION_DIR")) { define("GLPI_SESSION_DIR",GLPI_ROOT . "/files/_sessions"); } // Path for plugins documents storage if (!defined("GLPI_PLUGIN_DOC_DIR")) { define("GLPI_PLUGIN_DOC_DIR",GLPI_ROOT . "/files/_plugins"); } // Path for cache storage if (!defined("GLPI_LOCK_DIR")) { define("GLPI_LOCK_DIR",GLPI_ROOT . "/files/_lock"); } // Path for log storage if (!defined("GLPI_LOG_DIR")) { define("GLPI_LOG_DIR",GLPI_ROOT . "/files/_log"); } // Path for graph storage if (!defined("GLPI_GRAPH_DIR")) { define("GLPI_GRAPH_DIR",GLPI_ROOT . "/files/_graphs"); } // Path for temp storage if (!defined("GLPI_TMP_DIR")) { define("GLPI_TMP_DIR",GLPI_ROOT . "/files/_tmp"); } // Path for rss storage if (!defined("GLPI_RSS_DIR")) { define("GLPI_RSS_DIR",GLPI_ROOT . "/files/_rss"); } // Path for upload storage if (!defined("GLPI_UPLOAD_DIR")) { define("GLPI_UPLOAD_DIR",GLPI_ROOT . "/files/_uploads"); } // Default location scripts if (!defined("GLPI_SCRIPT_DIR")) { define("GLPI_SCRIPT_DIR",GLPI_ROOT . "/scripts"); } // Default PHPMailer installation dir if (!defined("GLPI_PHPMAILER_DIR")) { define("GLPI_PHPMAILER_DIR", GLPI_ROOT."/lib/phpmailer"); # if PHPMailer installed, use (in config_path.php) # define("GLPI_PHPMAILER_DIR", "/usr/share/php/phpmailer"); } // Default EZ Components path to base.php if (!defined("GLPI_EZC_BASE")) { define("GLPI_EZC_BASE", GLPI_ROOT."/lib/ezcomponents/Base/src/base.php"); # if EZ components installed as PEAR extension, use (in config_path.php) # define("GLPI_EZC_BASE", "ezc/Base/base.php"); } // Default Zend_Loader path if (!defined("GLPI_ZEND_PATH")) { define("GLPI_ZEND_PATH", GLPI_ROOT."/lib/Zend"); # if Zend Framework 2 available in system, use (in config_path.php) # define('GLPI_ZEND_PATH', '/usr/share/php/Zend'); } // Default SimplePie path if (!defined("GLPI_SIMPLEPIE_PATH")) { define("GLPI_SIMPLEPIE_PATH", GLPI_ROOT."/lib/simplepie"); # if SimplePie installed, use (in config_path.php) # define("GLPI_SIMPLEPIE_PATH", "/usr/share/php/simplepie"); // if not in standard include_path } // Default phpCAS installation dir if (!defined("GLPI_PHPCAS")) { define("GLPI_PHPCAS", GLPI_ROOT . "/lib/phpcas/CAS.php"); # if phpCAS installed as PEAR extension, use (in config_path.php) # define("GLPI_PHPCAS", "CAS.php"); } // Default path to FreeSans.ttf if (!defined("GLPI_FONT_FREESANS")) { define("GLPI_FONT_FREESANS", GLPI_ROOT . '/lib/ezcomponents/FreeSans.ttf'); # if FreeSans.ttf available in system, use (in config_path.php) # define("GLPI_FONT_FREESANS", '/usr/share/fonts/gnu-free/FreeSans.ttf'); } // Default patch to htmLawed if (!defined('GLPI_HTMLAWED')) { define('GLPI_HTMLAWED', GLPI_ROOT.'/lib/htmlawed/htmLawed.php'); # if htmLawed available in system, use (in config_path.php) # define('GLPI_HTMLAWED', '/usr/share/htmlawed/htmLawed.php'); } ?> glpi-0.84.3+dfsg.1/config/config.php000066400000000000000000000157671226600447100170640ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } include_once (GLPI_ROOT."/config/based_config.php"); include_once (GLPI_ROOT."/config/define.php"); include_once (GLPI_ROOT."/inc/dbconnection.class.php"); Session::setPath(); Session::start(); Config::detectRootDoc(); if (!file_exists(GLPI_CONFIG_DIR . "/config_db.php")) { Session::loadLanguage(); // no translation if (!isCommandLine()) { Html::nullHeader("DB Error",$CFG_GLPI["root_doc"]); echo "
"; echo "

Error: GLPI seems to not be installed properly.

"; echo "

config_db.php file is missing.

"; echo "

Please restart the install process.

"; echo "

Click here to proceed

"; echo "
"; Html::nullFooter(); } else { echo "Error: GLPI seems to not be installed properly.\n"; echo "config_db.php file is missing.\n"; echo "Please restart the install process.\n"; } die(); } else { require_once (GLPI_CONFIG_DIR . "/config_db.php"); //Database connection DBConnection::establishDBConnection((isset($USEDBREPLICATE) ? $USEDBREPLICATE : 0), (isset($DBCONNECTION_REQUIRED) ? $DBCONNECTION_REQUIRED : 0)); // *************************** Statics config options ********************** // ********************options d'installation statiques********************* // ************************************************************************* //Options from DB, do not touch this part. // Default Use mode if (!isset($_SESSION['glpi_use_mode'])) { $_SESSION['glpi_use_mode'] = Session::NORMAL_MODE; } $config_object = new Config(); $config_ok = false; if (!isset($_GET['donotcheckversion']) // use normal config table on restore process && (isset($TRY_OLD_CONFIG_FIRST) // index case || (isset($_SESSION['TRY_OLD_CONFIG_FIRST']) && $_SESSION['TRY_OLD_CONFIG_FIRST']))) { // backup case if (isset($_SESSION['TRY_OLD_CONFIG_FIRST'])) { unset($_SESSION['TRY_OLD_CONFIG_FIRST']); } // First try old config table : for update proces management from < 0.80 to >= 0.80 $config_object->forceTable('glpi_config'); if ($config_object->getFromDB(1)) { $config_ok = true; } else { $config_object->forceTable('glpi_configs'); if ($config_object->getFromDB(1)) { $config_ok = true; } } } else { // Normal load process : use normal config table. If problem try old one if ($config_object->getFromDB(1)) { $config_ok = true; } else { // Manage glpi_config table before 0.80 $config_object->forceTable('glpi_config'); if ($config_object->getFromDB(1)) { $config_ok = true; } } } if ($config_ok) { $CFG_GLPI = array_merge($CFG_GLPI,$config_object->fields); if (isset($config_object->fields['priority_matrix'])) { $CFG_GLPI['priority_matrix'] = importArrayFromDB($config_object->fields['priority_matrix'], true); } // Path for icon of document type $CFG_GLPI["typedoc_icon_dir"] = $CFG_GLPI["root_doc"]."/pics/icones"; } else { echo "Error accessing config table"; exit(); } if (isCommandLine() && isset($_SERVER['argv'])) { $key = array_search('--debug', $_SERVER['argv']); if ($key) { $_SESSION['glpi_use_mode'] = Session::DEBUG_MODE; unset($_SERVER['argv'][$key]); $_SERVER['argv'] = array_values($_SERVER['argv']); $_SERVER['argc']--; } } Toolbox::setDebugMode(); if (isset($_SESSION["glpiroot"]) && $CFG_GLPI["root_doc"]!=$_SESSION["glpiroot"]) { Html::redirect($_SESSION["glpiroot"]); } // Override cfg_features by session value foreach ($CFG_GLPI['user_pref_field'] as $field) { if (!isset($_SESSION["glpi$field"]) && isset($CFG_GLPI[$field])) { $_SESSION["glpi$field"] = $CFG_GLPI[$field]; } } if ((!isset($CFG_GLPI["version"]) || (trim($CFG_GLPI["version"]) != GLPI_VERSION)) && !isset($_GET["donotcheckversion"])) { Session::loadLanguage(); if (isCommandLine()) { _e('The version of the database is not compatible with the version of the installed files. An update is necessary.'); echo "\n"; } else { Html::nullHeader("UPDATE NEEDED",$CFG_GLPI["root_doc"]); echo "
"; echo ""; $error = Toolbox::commonCheckForUseGLPI(); echo "

"; if ($error) { echo "
"; echo ""; Html::closeForm(); } if ($error < 2) { if (!isset($CFG_GLPI["version"]) || (trim($CFG_GLPI["version"]) < GLPI_VERSION)) { echo ""; echo "

". __('The version of the database is not compatible with the version of the installed files. An update is necessary.')."

"; echo ""; Html::closeForm(); } else if (trim($CFG_GLPI["version"])>GLPI_VERSION) { echo "

". __('You are trying to use GLPI with files from an earlier version to the version of the database. Please install the GLPI files corresponding to the version of your database.')."

"; } } echo "
"; Html::nullFooter(); } exit(); } } ?> glpi-0.84.3+dfsg.1/config/define.php000066400000000000000000000413741226600447100170420ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ // Current version of GLPI define("GLPI_VERSION","0.84.3"); define("GLPI_DEMO_MODE","0"); define("GLPI_USE_CSRF_CHECK", "1"); define("GLPI_CSRF_EXPIRES","7200"); define("GLPI_CSRF_MAX_TOKENS","100"); // dictionnaries // 0 Name - 1 lang file - 2 extjs - 3 tiny_mce - 4 english lang name $CFG_GLPI['languages'] = //| NAME in native lang |LANG FILE |extjs| tinymce|english names| array('ar_SA' => array('العَرَبِيَّةُ', 'ar_SA.mo','en', 'ar','arabic'), 'bg_BG' => array('Български', 'bg_BG.mo','bg', 'bg','bulgarian'), 'id_ID' => array('Bahasa Indonesia', 'id_ID.mo','id', 'id','indonesian'), 'ms_MY' => array('Bahasa Melayu', 'ms_MY.mo','en', 'ms','malay'), 'ca_ES' => array('Català', 'ca_ES.mo','ca', 'ca','catalan'), // ca_CA 'cs_CZ' => array('Čeština', 'cs_CZ.mo','cs', 'cs','czech'), 'de_DE' => array('Deutsch', 'de_DE.mo','de', 'de','german'), 'da_DK' => array('Dansk', 'da_DK.mo','da', 'da','danish'), // dk_DK 'et_EE' => array('Eesti', 'et_EE.mo','en', 'et','estonian'), // ee_ET 'en_GB' => array('English', 'en_GB.mo','en', 'en','english'), 'en_US' => array('English (US)', 'en_US.mo','en', 'en','english'), 'es_AR' => array('Español (Argentina)', 'es_AR.mo','es', 'es','spanish'), 'es_CO' => array('Español (Colombia)', 'es_CO.mo','es', 'es','spanish'), 'es_ES' => array('Español (España)', 'es_ES.mo','es', 'es','spanish'), 'es_419' => array('Español (América Latina)', 'es_419.mo','es', 'es','spanish'), 'es_MX' => array('Español (Mexico)', 'es_MX.mo','es', 'es','spanish'), 'es_VE' => array('Español (Venezuela)', 'es_VE.mo','es', 'es','spanish'), 'eu_ES' => array('Euskara', 'eu_ES.mo','en', 'en','basque'), 'fr_FR' => array('Français', 'fr_FR.mo','fr', 'fr','french'), 'gl_ES' => array('Galego', 'gl_ES.mo','es', 'gl','galician'), 'el_GR' => array('Ελληνικά', 'el_GR.mo','el_GR', 'el','greek'), // el_EL 'he_IL' => array('עברית', 'he_IL.mo','he', 'he','hebrew'), // he_HE 'hr_HR' => array('Hrvatski', 'hr_HR.mo','hr', 'hr','croatian'), 'hu_HU' => array('Magyar', 'hu_HU.mo','hu', 'hu','hungarian'), 'it_IT' => array('Italiano', 'it_IT.mo','it', 'it','italian'), 'lv_LV' => array('Latviešu', 'lv_LV.mo','lv', 'lv','latvian'), 'lt_LT' => array('Lietuvių', 'lt_LT.mo','lt', 'lt','lithuanian'), 'nl_NL' => array('Nederlands', 'nl_NL.mo','nl', 'nl','dutch'), 'nb_NO' => array('Norsk (Bokmål)', 'nb_NO.mo','no_NB', 'nb','norwegian'), // no_NB 'nn_NO' => array('Norsk (Nynorsk)', 'nn_NO.mo','no_NN', 'nn','norwegian'), // no_NN 'fa_IR' => array('فارسی', 'fa_IR.mo','fa', 'fa','persian'), 'pl_PL' => array('Polski', 'pl_PL.mo','pl', 'pl','polish'), 'pt_PT' => array('Português', 'pt_PT.mo','pt', 'pt','portuguese'), 'pt_BR' => array('Português do Brasil', 'pt_BR.mo','pt_BR', 'pt','brazilian portuguese'), 'ro_RO' => array('Română', 'ro_RO.mo','ro', 'en','romanian'), 'ru_RU' => array('Pусский', 'ru_RU.mo','ru', 'ru','russian'), 'sk_SK' => array('Slovenčina', 'sk_SK.mo','sk', 'sk','slovak'), 'sl_SI' => array('Slovenščina', 'sl_SI.mo','sl', 'sl','slovenian slovene'), 'sr_RS' => array('Srpski', 'sr_RS.mo','sr', 'sr','serbian'), 'fi_FI' => array('Suomi', 'fi_FI.mo','fi', 'fi','finish'), 'sv_SE' => array('Svenska', 'sv_SE.mo','sv_SE', 'sv','swedish'), 'vi_VN' => array('Tiếng Việt', 'vi_VN.mo','vn', 'vi','vietnamese'), 'th_TH' => array('ภาษาไทย', 'th_TH.mo','th', 'th','thai'), 'tr_TR' => array('Türkçe', 'tr_TR.mo','tr', 'tr','turkish'), 'uk_UA' => array('Українська', 'uk_UA.mo','ukr', 'en','ukrainian'), // ua_UA 'ja_JP' => array('日本語', 'ja_JP.mo','ja', 'ja','japanese'), 'zh_CN' => array('简体中文', 'zh_CN.mo','zh_CN', 'zh','chinese'), 'zh_TW' => array('繁體中文', 'zh_TW.mo','zh_TW', 'zh','chinese'),); // Init to store glpi itemtype / tables link $CFG_GLPI['glpitables'] = array(); define("NOT_AVAILABLE",'N/A'); // key used to crypt passwords in DB for external access : proxy / smtp / ldap / mailcollectors // This key is not used to crypt user's passwords // If you hav to define passwords again define("GLPIKEY","GLPI£i'snarss'ç"); // TIMES define("MINUTE_TIMESTAMP",60); define("HOUR_TIMESTAMP",3600); define("DAY_TIMESTAMP",86400); define("WEEK_TIMESTAMP",604800); define("MONTH_TIMESTAMP",2592000); // ITEMS TYPE /// Temporary definition for test // TODO clean it. if (!strstr($_SERVER['PHP_SELF'], "/install/") && !strstr($_SERVER['PHP_SELF'], 'cliupdate.php')) { define("GENERAL_TYPE",''); define("COMPUTER_TYPE",'Computer'); define("NETWORKING_TYPE",'NetworkEquipment'); define("PRINTER_TYPE",'Printer'); define("MONITOR_TYPE",'Monitor'); define("PERIPHERAL_TYPE",'Peripheral'); define("SOFTWARE_TYPE",'Software'); define("CONTACT_TYPE",'Contact'); define("ENTERPRISE_TYPE",'Supplier'); define("INFOCOM_TYPE",'Infocom'); define("CONTRACT_TYPE",'Contract'); define("CARTRIDGEITEM_TYPE",'CartridgeItem'); define("TYPEDOC_TYPE",'DocumentType'); define("DOCUMENT_TYPE",'Document'); define("KNOWBASE_TYPE",'KnowbaseItem'); define("USER_TYPE",'User'); define("TRACKING_TYPE",'Ticket'); define("CONSUMABLEITEM_TYPE",'ConsumableItem'); define("CONSUMABLE_TYPE",'Consumable'); define("CARTRIDGE_TYPE",'Cartridge'); define("SOFTWARELICENSE_TYPE",'SoftwareLicense'); define("LINK_TYPE",'Link'); define("STATE_TYPE",'State'); define("PHONE_TYPE",'Phone'); define("DEVICE_TYPE",'Device'); define("REMINDER_TYPE",'Reminder'); define("STAT_TYPE",'Stat'); define("GROUP_TYPE",'Group'); define("ENTITY_TYPE",'Entity'); define("RESERVATION_TYPE",'ReservationItem'); define("AUTHMAIL_TYPE",'AuthMail'); define("AUTHLDAP_TYPE",'AuthLDAP'); define("OCSNG_TYPE",'OcsServer'); define("REGISTRY_TYPE",'RegistryKey'); define("PROFILE_TYPE",'Profile'); define("MAILGATE_TYPE",'MailCollector'); define("RULE_TYPE",'Rule'); define("TRANSFER_TYPE",'Transfer'); define("BOOKMARK_TYPE",'Bookmark'); define("SOFTWAREVERSION_TYPE",'SoftwareVersion'); define("PLUGIN_TYPE",'Plugin'); define("COMPUTERDISK_TYPE",'ComputerDisk'); define("NETWORKING_PORT_TYPE",'NetworkPort'); define("FOLLOWUP_TYPE",'TicketFollowup'); define("BUDGET_TYPE",'Budget'); } //Management modes define("MANAGEMENT_UNITARY",0); define("MANAGEMENT_GLOBAL",1); //Mail send methods define("MAIL_MAIL",0); define("MAIL_SMTP",1); define("MAIL_SMTPSSL",2); define("MAIL_SMTPTLS",3); // MESSAGE TYPE define("INFO",0); define("ERROR",1); // For plugins $PLUGIN_HOOKS = array(); $CFG_GLPI_PLUGINS = array(); $LANG = array(); $CFG_GLPI["unicity_types"] = array('Budget', 'Computer', 'Contact', 'Contract', 'Infocom', 'Monitor', 'NetworkEquipment', 'Peripheral', 'Phone', 'Printer', 'Software', 'SoftwareLicense', 'Supplier','User'); $CFG_GLPI["state_types"] = array('Computer', 'Monitor', 'NetworkEquipment', 'Peripheral', 'Phone', 'Printer'); $CFG_GLPI["asset_types"] = array('Computer', 'Monitor', 'NetworkEquipment', 'Peripheral', 'Phone', 'Printer'); $CFG_GLPI["document_types"] = array('Budget', 'CartridgeItem', /*'Change',*/ 'Computer', 'ConsumableItem', 'Contact', 'Contract', 'Document', 'Entity', 'KnowbaseItem', 'Monitor', 'NetworkEquipment', 'Peripheral', 'Phone', 'Printer', 'Problem', 'Reminder', 'Software', 'SoftwareLicense', 'Supplier', 'Ticket','User'); $CFG_GLPI["consumables_types"] = array('Group', 'User'); $CFG_GLPI["contract_types"] = array('Computer', 'Monitor', 'NetworkEquipment', 'Peripheral', 'Phone', 'Printer', 'Software', 'SoftwareLicense'); $CFG_GLPI["directconnect_types"] = array('Monitor', 'Peripheral', 'Phone', 'Printer'); $CFG_GLPI["infocom_types"] = array('Cartridge', 'CartridgeItem', 'Computer', 'Consumable', 'ConsumableItem', 'Monitor', 'NetworkEquipment', 'Peripheral', 'Phone', 'Printer', 'Software', 'SoftwareLicense'); $CFG_GLPI["reservation_types"] = array('Computer', 'Monitor', 'NetworkEquipment', 'Peripheral', 'Phone', 'Printer', 'Software'); $CFG_GLPI["linkuser_types"] = array('Computer', 'Monitor', 'NetworkEquipment', 'Peripheral', 'Phone', 'Printer', 'Software'); $CFG_GLPI["linkgroup_types"] = array('Computer', 'Monitor', 'NetworkEquipment', 'Peripheral', 'Phone', 'Printer', 'Software'); $CFG_GLPI["linkuser_tech_types"] = array('Computer', 'Monitor', 'NetworkEquipment', 'Peripheral', 'Phone', 'Printer', 'Software'); $CFG_GLPI["linkgroup_tech_types"] = array('Computer', 'Monitor', 'NetworkEquipment', 'Peripheral', 'Phone', 'Printer', 'Software'); $CFG_GLPI["ticket_types"] = array('Computer', 'Monitor', 'NetworkEquipment', 'Peripheral', 'Phone', 'Printer', 'Software'); $CFG_GLPI["link_types"] = array('Budget', 'CartridgeItem', 'Computer', 'ConsumableItem', 'Contact', 'Contract', 'Monitor', 'NetworkEquipment', 'Peripheral', 'Phone', 'Printer', 'Software', 'Supplier'); $CFG_GLPI["dictionnary_types"] = array('ComputerModel', 'ComputerType', 'Manufacturer', 'MonitorModel', 'MonitorType', 'NetworkEquipmentModel', 'NetworkEquipmentType', 'OperatingSystem', 'OperatingSystemServicePack', 'OperatingSystemVersion', 'PeripheralModel', 'PeripheralType', 'PhoneModel', 'PhoneType', 'Printer', 'PrinterModel', 'PrinterType', 'Software'); $CFG_GLPI["helpdesk_visible_types"] = array('Software'); $CFG_GLPI["networkport_types"] = array('Computer', 'NetworkEquipment', 'Peripheral', 'Phone', 'Printer'); // Warning : the order is used for displaying different NetworkPort types ! Keep it ! $CFG_GLPI['networkport_instantiations'] = array('NetworkPortEthernet', 'NetworkPortWifi' , 'NetworkPortAggregate', 'NetworkPortAlias', 'NetworkPortDialup', 'NetworkPortLocal' ); $CFG_GLPI["notificationtemplates_types"] = array('CartridgeItem', 'ConsumableItem', 'Contract', 'Crontask', 'DBConnection', 'FieldUnicity', 'Infocom', 'PlanningRecall', 'Problem', 'Reservation', 'SoftwareLicense', 'Ticket', 'User'); $CFG_GLPI["notificationmethods_types"] = array('NotificationMail'); $CFG_GLPI["union_search_type"] = array('ReservationItem' => "reservation_types", 'AllAssets' => "asset_types"); $CFG_GLPI["systeminformations_types"] = array('AuthLDAP', 'DBConnection', 'MailCollector', 'Plugin'); $CFG_GLPI["rulecollections_types"] = array('RuleImportEntityCollection', 'RuleImportComputerCollection', 'RuleMailCollectorCollection', 'RuleRightCollection', 'RuleSoftwareCategoryCollection', 'RuleTicketCollection'); // Items which can planned something $CFG_GLPI['planning_types'] = array(/*'ChangeTask', */'ProblemTask', 'Reminder', 'TicketTask'); $CFG_GLPI["globalsearch_types"] = array('Computer', 'Contact', 'Document', 'Monitor', 'NetworkEquipment', 'Peripheral', 'Phone', 'Printer', 'Software', 'Supplier', 'Ticket'); // New config options which can be missing during migration $CFG_GLPI["number_format"] = 0; $CFG_GLPI["decimal_number"] = 2; // Default debug options : may be locally overriden $CFG_GLPI["debug_sql"] = $CFG_GLPI["debug_vars"] = $CFG_GLPI["debug_lang"] = 1; // User Prefs fields which override $CFG_GLPI config $CFG_GLPI['user_pref_field'] = array('csv_delimiter', 'date_format', 'default_requesttypes_id', 'display_count_on_home', 'dropdown_chars_limit', 'duedatecritical_color', 'duedatecritical_less', 'duedatecritical_unit', 'duedateok_color', 'duedatewarning_color','duedatewarning_less', 'duedatewarning_unit', 'followup_private', 'is_categorized_soft_expanded', 'is_ids_visible', 'is_not_categorized_soft_expanded', 'language', 'list_limit', 'names_format', 'notification_to_myself', 'number_format', 'priority_1', 'priority_2', 'priority_3', 'priority_4', 'priority_5', 'priority_6', 'refresh_ticket_list', 'set_default_tech', 'show_count_on_tabs', 'show_jobs_at_login', 'task_private', 'use_flat_dropdowntree',); ?> glpi-0.84.3+dfsg.1/css/000077500000000000000000000000001226600447100144115ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/css/ext-all-glpi.css000066400000000000000000000243051226600447100174260ustar00rootroot00000000000000 # X-tab-panel .x-tab-panel { overflow:hidden; } .x-tab-panel-header, .x-tab-panel-footer { background:#deecfd; border:1px solid #eeeeee; overflow:hidden; zoom:1; } .x-tab-panel-header { border:1px solid #eeeeee; padding-bottom:2px; } .x-tab-panel-footer { border:1px solid #eeeeee; padding-top:2px; } .x-tab-strip-wrap { width:100%; overflow:hidden; position:relative; zoom:1; } ul.x-tab-strip { display:block; width:5000px; zoom:1; } ul.x-tab-strip-top { padding-top:1px; background:url(../pics/extjs/tabs/tab-strip-bg.gif) #cedff5 repeat-x bottom; border-bottom:1px solid #eeeeee; } ul.x-tab-strip-bottom { padding-bottom:1px; background:url(../pics/extjs/tabs/tab-strip-btm-bg.gif) #cedff5 repeat-x top; border-top:1px solid #eeeeee; border-bottom:0 none; } .x-tab-panel-header-plain .x-tab-strip-top { background:transparent!important; padding-top:0!important; } .x-tab-panel-header-plain { background:transparent!important; border-width:0!important; padding-bottom:0!important; } .x-tab-panel-header-plain .x-tab-strip-spacer { border:1px solid #eeeeee; border-top:0 none; height:0px; background:#eeeeee; font-size:1px; line-height:0px; } .ext-border-box .x-tab-panel-header-plain .x-tab-strip-spacer { height:3px; } ul.x-tab-strip li { float:left; margin-left:2px; } ul.x-tab-strip li.x-tab-edge { float:left; margin:0!important; padding:0!important; border:0 none!important; font-size:1px!important; line-height:1px!important; overflow:hidden; zoom:1; background:transparent!important; width:1px; } .x-tab-strip a, .x-tab-strip span, .x-tab-strip em { display:block; } .x-tab-strip a { text-decoration:none!important; -moz-outline:none; outline:none; cursor:pointer; } .x-tab-strip-inner { overflow:hidden; text-overflow:ellipsis; } .x-tab-strip span.x-tab-strip-text { font:normal 11px Verdana,Arial,Helvetica,sans-serif; color:#659900; white-space:nowrap; cursor:pointer; padding:4px 0; } .x-tab-strip .x-tab-with-icon .x-tab-right { padding-left:6px; } .x-tab-strip .x-tab-with-icon span.x-tab-strip-text { padding-left:20px; background-position:0 3px; background-repeat:no-repeat; } .x-tab-strip-over span.x-tab-strip-text { color:#659900; } .x-tab-strip-active { cursor:default; } .x-tab-strip-active span.x-tab-strip-text { cursor:default; color:#659900; font-weight:bold; } .x-tab-strip-disabled .x-tabs-text { cursor:default; color:#aaa; } .x-tab-panel-body { overflow:hidden; } .x-tab-panel-bwrap { overflow:hidden; } .ext-ie .x-tab-strip .x-tab-right { position:relative; } .x-tab-strip-top .x-tab-strip-active .x-tab-right { margin-bottom:-1px; } .x-tab-strip-top .x-tab-strip-active .x-tab-right span.x-tab-strip-text { padding-bottom:5px; } .x-tab-strip-bottom .x-tab-strip-active .x-tab-right { margin-top:-1px; } .x-tab-strip-bottom .x-tab-strip-active .x-tab-right span.x-tab-strip-text { padding-top:5px; } .x-tab-strip-top .x-tab-right { background:transparent url(../pics/extjs/tabs/tabs-sprite.gif) no-repeat 0 -51px; padding-left:10px; } .x-tab-strip-top .x-tab-left { background:transparent url(../pics/extjs/tabs/tabs-sprite.gif) no-repeat right -351px; padding-right:10px; } .x-tab-strip-top .x-tab-strip-inner { background:transparent url(../pics/extjs/tabs/tabs-sprite.gif) repeat-x 0 -201px; } .x-tab-strip-top .x-tab-strip-over .x-tab-right { background-position:0 -101px; } .x-tab-strip-top .x-tab-strip-over .x-tab-left { background-position:right -401px; } .x-tab-strip-top .x-tab-strip-over .x-tab-strip-inner { background-position:0 -251px; } .x-tab-strip-top .x-tab-strip-active .x-tab-right { background-position:0 0; } .x-tab-strip-top .x-tab-strip-active .x-tab-left { background-position:right -301px; } .x-tab-strip-top .x-tab-strip-active .x-tab-strip-inner { background-position:0 -151px; } .x-tab-strip-bottom .x-tab-right { background:url(../pics/extjs/tabs/tab-btm-inactive-right-bg.gif) no-repeat bottom right; } .x-tab-strip-bottom .x-tab-left { background:url(../pics/extjs/tabs/tab-btm-inactive-left-bg.gif) no-repeat bottom left; } .x-tab-strip-bottom .x-tab-strip-active .x-tab-right { background:url(../pics/extjs/tabs/tab-btm-right-bg.gif) no-repeat bottom left; } .x-tab-strip-bottom .x-tab-strip-active .x-tab-left { background:url(../pics/extjs/tabs/tab-btm-left-bg.gif) no-repeat bottom right; } .x-tab-strip-bottom .x-tab-left { padding:0 10px; } .x-tab-strip-bottom .x-tab-right { padding:0; } .x-tab-strip .x-tab-strip-close { display:none; } .x-tab-strip-closable { position:relative; } .x-tab-strip-closable .x-tab-left { padding-right:19px; } .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close { background-image:url(../pics/extjs/tabs/tab-close.gif); opacity:.6; -moz-opacity:.6; background-repeat:no-repeat; display:block; width:11px; height:11px; position:absolute; top:3px; right:3px; cursor:pointer; z-index:2; } .x-tab-strip .x-tab-strip-active a.x-tab-strip-close { opacity:.8; -moz-opacity:.8; } .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close:hover { background-image:url(../pics/extjs/tabs/tab-close.gif); opacity:1; -moz-opacity:1; } .x-tab-panel-body { border:1px solid #eeeeee; background:#fff; } .x-tab-panel-body-top { border-top:0 none; } .x-tab-panel-body-bottom { border-bottom:0 none; } .x-tab-scroller-left { background:transparent url(../pics/extjs/tabs/scroll-left.gif) no-repeat -18px 0; border-bottom:1px solid #C7C7AB; width:18px; position:absolute; left:0; top:0; z-index:10; cursor:pointer; } .x-tab-scroller-left-over { background-position:0 0; } .x-tab-scroller-left-disabled { background-position:-18px 0; opacity:.5; -moz-opacity:.5; filter:alpha(opacity=50); cursor:default; } .x-tab-scroller-right { background:transparent url(../pics/extjs/tabs/scroll-right.gif) no-repeat 0 0; border-bottom:1px solid #C7C7AB; width:18px; position:absolute; right:0; top:0; z-index:10; cursor:pointer; } .x-tab-scroller-right-over { background-position:-18px 0; } .x-tab-scroller-right-disabled { background-position:0 0; opacity:.5; -moz-opacity:.5; filter:alpha(opacity=50); cursor:default; } .x-tab-scrolling .x-tab-strip-wrap { margin-left:18px; margin-right:18px; } .x-tab-scrolling { position:relative; } .x-tab-panel-bbar .x-toolbar { border:1px solid #99bbe8; border-top:0 none; overflow:hidden; padding:2px; } .x-tab-panel-tbar .x-toolbar { border:1px solid #99bbe8; border-top:0 none; overflow:hidden; padding:2px; } .x-form-text, textarea.x-form-field { padding:1px 1px; background:#fff; border: 1px solid #888888; background-color:#FAFAFA; } # X-window /* Window */ .x-window-proxy { background:#e0e0e0; border-color:#b0b0b0; } .x-window-tl .x-window-header { color:#555; } .x-window-tc { background-image:url(../pics/extjs/window/top-bottom.png); } .x-window-tl { background-image:url(../pics/extjs/window/left-corners.png); } .x-window-tr { background-image:url(../pics/extjs/window/right-corners.png); } .x-window-bc { background-image:url(../pics/extjs/window/top-bottom.png); } .x-window-bl { background-image:url(../pics/extjs/window/left-corners.png); } .x-window-br { background-image:url(../pics/extjs/window/right-corners.png); } .x-window-mc { border:1px solid #d0d0d0; background:#e8e8e8; } .x-window-ml { background-image:url(../pics/extjs/window/left-right.png); } .x-window-mr { background-image:url(../pics/extjs/window/left-right.png); } .x-panel-ghost .x-window-tl { border-color:#d0d0d0; } .x-panel-collapsed .x-window-tl { border-color:#d0d0d0; } .x-window-plain .x-window-mc { background: #e8e8e8; border-right:1px solid #eee; border-bottom:1px solid #eee; border-top:1px solid #d0d0d0; border-left:1px solid #d0d0d0; } .x-window-plain .x-window-body { border-left:1px solid #eee; border-top:1px solid #eee; border-bottom:1px solid #d0d0d0; border-right:1px solid #d0d0d0; background:transparent !important; } body.x-body-masked .x-window-mc, body.x-body-masked .x-window-plain .x-window-mc { background-color: #e4e4e4; } /* Tools */ .x-tool { background-image:url(../pics/extjs/panel/tool-sprites.gif); } .loading-indicator-ie { /*font-size:11px;*/ background-image:url(../lib/extjs/resources/images/default/grid/loading.gif); background-repeat:no-repeat; background-position:left; padding-left:20px; /*line-height:16px;*/ margin:3px; } /* strong is not normal */ strong { font-weight:bolder; } /* X panel */ /* Allow class overlink to function grr */ .x-panel-body { overflow:visible; } .x-panel-bwrap { overflow:visible; } /* Correct for date picker */ .ext-ie .x-menu { overflow:visible; } /* Correct for kb */ #kbanswer em { font-style: italic; } /* Tooltip */ .x-tip .x-tip-close { background-image: url(../pics/extjs/qtip/close.gif); } .x-tip .x-tip-tc, .x-tip .x-tip-tl, .x-tip .x-tip-tr, .x-tip .x-tip-bc, .x-tip .x-tip-bl, .x-tip .x-tip-br, .x-tip .x-tip-ml, .x-tip .x-tip-mr { background-image: url(../pics/extjs/qtip/tip-sprite.gif); } .x-tip .x-tip-mc { font: normal 11px tahoma,arial,helvetica,sans-serif; } .x-tip .x-tip-ml { background-color: #fff; } .x-tip .x-tip-header-text { font: bold 11px tahoma,arial,helvetica,sans-serif; color:#444; } .x-tip .x-tip-body { font: normal 11px tahoma,arial,helvetica,sans-serif; color:#444; } .x-form-invalid-tip .x-tip-tc, .x-form-invalid-tip .x-tip-tl, .x-form-invalid-tip .x-tip-tr, .x-form-invalid-tip .x-tip-bc, .x-form-invalid-tip .x-tip-bl, .x-form-invalid-tip .x-tip-br, .x-form-invalid-tip .x-tip-ml, .x-form-invalid-tip .x-tip-mr { background-image: url(../images/default/form/error-tip-corners.gif); } .x-form-invalid-tip .x-tip-body { background-image:url(../images/default/form/exclamation.gif); } .x-tip-anchor { background-image:url(../pics/extjs/qtip/tip-anchor-sprite.gif); } .tab_bg_1 td .ux-datetime-date, .tab_bg_1 td .ux-datetime-time { padding: 0 4px 0 0; }glpi-0.84.3+dfsg.1/css/nothing.gif000066400000000000000000000000771226600447100165520ustar00rootroot00000000000000GIF89a!,ڋ޼HS;glpi-0.84.3+dfsg.1/css/print.css000066400000000000000000000616471226600447100162750ustar00rootroot00000000000000/* * @version $Id: print.css 20129 2013-02-04 16:53:59Z moyo $ ------------------------------------------------------------------------- GLPI - Gestionnaire Libre de Parc Informatique Copyright (C) 2003-2013 by the INDEPNET Development Team. http://indepnet.net/ http://glpi-project.org ------------------------------------------------------------------------- LICENSE This file is part of GLPI. GLPI is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. GLPI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GLPI. If not, see . -------------------------------------------------------------------------- */ /* ################--------------- GLPI CSS style ---------------#################### */ /* ################--------------- Default style ---------------#################### */ body { font-family: 'Bitstream Vera Sans', arial, Tahoma, 'Sans serif'; font-size: 12px; margin: 0; padding: 0; background: white; } ul, li, dt, dl, dd, form,img, input { margin: 0; padding: 0; } ul { list-style-type: none; } span.invisible { visibility: hidden; } /* separateur pour rétablir les comportements de block */ div.sep { font-size: 1px; height: 1px; padding: 0; margin: 0; clear: both; } img { border: 0; } small { font-family: verdana; font-size: 10px; } .b { font-weight: bold; } .center { text-align:center; } .left { text-align:left; } .right { text-align:right; } .center-h { margin:auto; } .middle { vertical-align:middle; } .bottom { vertical-align:bottom; } .top { vertical-align:top; } .relative { position: relative; } .red { color:red; } .blue { color:blue; } .green { color:green; } .deleted { background-color:#cf9b9b; } .separ { clear: both; visibility: hidden; } a, a:link { font-weight: bold; text-decoration: none; color : #659900; font-size : 11px; } a:hover { color: black; } hr { border: 1px solid #cccccc; } /* Over link div */ .over_link { display: none; position: absolute; border: 1px solid #CC9900; background: url("../pics/fd_hoverlink.png") 0 0 repeat; -moz-border-radius: 5px; padding: 5px; max-width: 350px; font-size: 11px; text-align: left; z-index:1000; } .pointer { cursor:pointer; } /* ################--------------- Tabs ---------------#################### */ /* TODO improve display */ .alltab { font-size:14px; text-align:center; background-color:#CC9900; padding: 5px; font-weight: bold; } /* ################--------------- Page ---------------#################### */ #page { margin: 0 auto; text-align:center; } #page form { font-size: 12px; margin:0; margin-bottom:5px; padding:0; } #page { margin-top:25px; } /* ################--------------- form ---------------#################### */ option { border:1px solid #ccc; background-color:#ffffff; } .submit { text-align:center; } select { font-size: 11px; border: 1px solid #888888; color: black; background-color: white; } textarea, input { background-color:#FAFAFA; color: black; border: 1px solid #888888; font-size: 11px; } input.submit { font-size: 11px; border: 1px solid #888888; background-color:#eeeeee; cursor:pointer; background: url("../pics/fond_form.png") repeat-x; } input.submit:hover { border: 1px inset #888888; background-color:#ffffff; background: url("../pics/fond_form_on.png") repeat-x; } .entity_select { border-left: 1px solid #C0CAD4; border-right: 1px solid#C0CAD4; padding:3px; } .entity_select:hover { border-left: 1px solid #C0CAD4; border-right: 1px solid #C0CAD4; border-bottom: 1px solid #C0CAD4; padding:3px; } .tree { width:100%; border:0; border-bottom:1px solid #C0CAD4; } .treeroot { width:100%; background: url("../pics/treeroot.png") 0 2px no-repeat; border:0; font-weight:bold; } .tree:hover { background-color:#eeeeee; } .treeroot:hover { background-color:#eeeeee; } /* ################--------------- Table ---------------#################### */ table { font-size: 11px; /* Probem WIth EXTJS calendar -> to sons*/ /*margin: 0 auto;*/ border:0; } th { } td { } .tab_glpi { margin: 0 auto; } .tab_cadre { margin: 0 auto; -moz-border-radius: 4px; border: 1px solid #cccccc; z-index:1; text-align: left; font-size: 11px; background-color: #ffffff; } .tab_cadre_central { margin: 0 auto; -moz-border-radius: 4px; border: 1px solid #bbbbbb; z-index:1; text-align: left; font-size: 11px; width:95%; background : url("../pics/fond-central.png") repeat-x top right ; } .tab_cadre_navigation { margin: 0 auto; padding: 4px; margin: 1px; border: 1px solid #aaaaaa; background-color: #ffffff; -moz-border-radius: 5px; font-size : 12px; font-weight: bold; } .tab_cadre_fixe, .tab_cadre_fixehov { margin: 0 auto; -moz-border-radius: 4px; border: 1px solid #cccccc; z-index:1; text-align: left; font-size: 11px; width:95%; } .tab_cadrehov, .tab_cadrehov_pointer { margin: 0 auto; -moz-border-radius: 4px; border: 1px solid #cccccc; text-align: left; font-size: 11px; width: 95%; background-color: #ffffff; } .tab_cadre_report { margin: 0 auto; -moz-border-radius: 4px; border: 1px solid #cccccc; z-index:1; text-align: left; font-size: 11px; text-align: center; width:95%; } .tab_cadre th, .tab_cadre_fixe th, .tab_cadre_fixehov th, .tab_cadrehov th, .tab_cadrehov_pointer th , .tab_cadre_report th { font-size: 11px; font-weight: bold; background-color: #fccc6f; text-align: center; background: url("../pics/fond_th.png") repeat-x; border-bottom:1px solid #cccccc; } .tab_cadre td, .tab_cadre_fixe td, .tab_cadre_fixehov td, .tab_cadrehov td, .tab_cadrehov_pointer td , .tab_cadre_report td { padding-left: 5px; } .tab_cadrehov tr:hover, .tab_cadre_fixehov tr:hover { background-color: #FFF4DF; } .tab_cadrehov_pointer tr:hover { cursor: pointer; background-color: #FFF4DF; } /* Ajout pour IE */ .tab_cadrehov_pointer tr { cursor: pointer; } .tab_bg_1 { background-color: #f2f2f2; } .tab_bg_1_2 { background-color: #cf9b9b; } .tab_bg_2 { background-color: #e4e4e2; } .tab_bg_2_2 { background-color: #cf9b9b; } .tab_bg_3 { background-color: #e7e7e2; } .tab_bg_4 { background-color: silver; } .tab_bg_5 { background-color: #f2f2f2; } .tab_find { background-color: #ccccc7; } .tab_find:hover { background-color:#FFF2C2; cursor:pointer; } .tab_resa { border:1px dashed #cccccc; background-color: #d7d7d2; font-size:10px } .tab_resa:hover { background-color: #ffffff; border:1px dotted #000000; } /* ################--------------- Pager ---------------#################### */ .tab_cadre_pager { margin: 0 auto; text-align:center; -moz-border-radius: 4px; border: 1px solid #cccccc; font-size:10px; width:95%; } .tab_cadre_pager select, .tab_cadre_pager span, .tab_cadre_pager form { font-size:10px; margin:0; } .tab_cadre_pager input { vertical-align:middle; } .tab_cadre_pager th { font-size: 10px; font-weight: bold; background-color: #fccc6f; text-align: center; background: url("../pics/fond_th.png") repeat-x; } /* ################--------------- Autocompletion ---------------#################### */ ul.autocomp { list-style-type: none; margin:0; margin-left:3px; padding:3px; text-align:left; } ul.autocomp li.selected { background-color: #FFF6CF; } li.auto_comp { list-style-type: none; display:block; margin:0; padding:2px; height:16px; } /* ################--------------- Tracking / Reminder ---------------#################### */ .tracking { width:100%; height:100%; cursor:pointer; } .tracking:hover { background-color: #FFF4DF; } .tracking_hour { font-family: verdana; font-size: 10px; } .tracking_bold { font-weight: bold; } .ldap_right, .reminder_right { position:absolute; right:0; margin-right:5px; font-size:10px; } .showplan { font-weight: bold; text-decoration: none; color : #659900; cursor:pointer; } .tracking_small { font-size:10px; } .reminder_list { text-align:left; margin-left:8px; } /* ################--------------- Calendrier / reservation ---------------#################### */ .calendrier { border: 1px solid #888888; background-color:#eeeeee; vertical-align:middle; background: url("../pics/fond_form.png") repeat-x; } .calendrier:hover { border: 1px inset #888888; background-color:#ffffff; cursor:pointer; } .calendrier_mois { font-family: Verdana, Arial, Sans, sans-serif; font-size: 10px; } .calendrier_jour { font-family: arial,helvetica,sans-serif; font-size: 14px; color: black; } .calendrier_case1 { margin-left: 10px; padding: 2px; -moz-border-radius: 5px; margin-top: 2px; border: 1px solid #666666; background-color: white; } .calendrier_case2 { margin-left: 10px; padding: 2px; -moz-border-radius: 5px; margin-top: 2px; border: 1px solid #cccccc; background-color: #eeeeee } .calendrier_case_white { background-color:#ffffff; } /* ################--------------- Knowledge FAQ ---------------#################### */ #contenukb { height: 100%; width: 600px; margin: 0 auto; } #contenukb legend { font-weight: bold; } #contenukb fieldset { background-color: #eeeeee; border: 1px solid #FFC65D; -moz-border-radius: 8px; padding-bottom:10px; width: 600px; } #contenukb textarea { width:550px; } #kbanswer ul { padding-left: 15px; } .tdkb_result { vertical-align:top; text-align:left; width: 33%; padding: 3px 20px 3px 25px; } .kb { text-align:left; padding-top:5px; } .kb_resume { text-align:left; font-size: 9px; line-height: 10px; clear: both; padding: 5px 0 10px 25px; } .tdkb { text-align:left; font-size:10px; color:#aaaaaa; } .baskb { position: relative; text-align:left; font-size:10px; color:#aaaaaa; } .baskb_right { position:absolute; right:0; margin-right:5px; } .code { width: 95%; border: dotted 2px #ccc; } a.knowbase { font-size: 13px; margin-left:8px; } a.pubfaq { font-size: 13px; margin-left:8px; color: #c9993C; } a.pubfaq:hover { color: black; } a.icon_nav_move img { padding: 4px; margin: 1px; border: 1px solid #aaaaaa; background-color: #ffffff; -moz-border-radius: 5px; } a.icon_nav_move:hover img { padding: 4px; margin: 1px; border: 1px solid #999999; background-color:#e4e4e4; -moz-border-radius: 5px; } /* ################--------------- planning ---------------#################### */ .planning { text-align:center; border:1px dashed #cccccc; background-color: #d7d7d2; font-size:9px; } .planing:hover { border: 1px solid #999999; background-color: white; } /* ################--------------- Onglet ---------------#################### */ div#menu_navigate { margin: 0 auto; z-index:1; font-size: 10px; width:950px; } div#menu_navigate li { margin-left:2px; display:block; float:left; padding:2px; } #barre_onglets { width:950px; margin-left: auto; margin-right: auto; margin-bottom:0; padding-bottom:0; } #barre_onglets_percent { width:80%; margin-left: auto; margin-right: auto; margin-bottom:0; padding-bottom:0; } ul#onglet { list-style-type: none; padding-bottom: 24px; border-bottom: 1px solid #ffffff; margin: 0; padding-left:0; } ul#onglet li { float: left; height: 21px; background-color: #eeeeee; margin: 2px 2px 0 1px; border: 1px solid #CC9900; border-bottom: 1px solid #fff; -moz-border-radius: 4px; background: url("../pics/fond_onglet.png") repeat-x; } ul#onglet li.actif { border-bottom: 1px ridge #659900; background-color: #fff; } ul#onglet li.invisible { border-bottom: 1px solid #fff; border: 1px solid #fff; background-color: #ffffff; width: 15px; background: transparent; } ul#onglet li.actif a { color: #000; } #onglet a { float: left; display: block; color: #666; text-decoration: none; padding: 3px; font-size: 10px; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: bold; } #onglet a:hover { color : #659900; } ul#onglet span.fake { float: left; display: block; color: #666; text-decoration: none; padding: 3px; font-size: 10px; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: bold; cursor:pointer; } /* Over onglet div */ #onglet_plugins { display: none; position: absolute; top:21px; left:-20px; padding: 5px; font-size: 8px; width:100px; background: transparent url("../pics/fd_hoverlink.png") repeat; border: 1px solid gray; -moz-border-radius: 5px; } #onglet_plugins dl { margin: 0; padding: 0; list-style-type: none; border:0; } #onglet_plugins dt { text-align: center; padding: 2px; background:none; border:0; width:100%; height:18px; } #onglet_plugins dt a { font-size:10px; color: #000; text-decoration: none; display: block; border: 0 none; } #onglet_plugins dt a:hover { color: #000; background: #fccc6f; } #onglet_plugins dt:hover { color: #000; background: #fccc6f; } /* ################--------------- box (redirect and other) ---------------#################### */ .box { margin: 0 auto; width:700px; text-align:center; } .box-tleft { background:transparent url(../pics/corners.gif) no-repeat 0 0; zoom:1; } .box-tcenter { height:8px; background:transparent url(../pics/tb.gif) repeat-x 0 0; overflow:hidden; } .box-tright { background:transparent url(../pics/corners.gif) no-repeat right -8px; } .box-mleft { background:transparent url(../pics/l.gif) repeat-y 0; padding-left:4px; overflow:hidden; zoom:1; } .box-mcenter { background:#eee url(../pics/tb.gif) repeat-x 0 -16px; padding:4px 10px; font-family:"Myriad Pro","Myriad Web","Tahoma","Helvetica","Arial",sans-serif; color:#393939; font-size:11px; } .box-mcenter h3 { font-size:11px; font-weight:bold; margin:0 0 4px 0; zoom:1; } .box-mright { background:transparent url(../pics/r.gif) repeat-y right; padding-right:4px; overflow:hidden; } .box-bleft { background:transparent url(../pics/corners.gif) no-repeat 0 -16px; zoom:1; } .box-bcenter { background:transparent url(../pics/tb.gif) repeat-x 0 -8px; height:8px; overflow:hidden; } .box-bright { background:transparent url(../pics/corners.gif) no-repeat right -24px; } .box-tleft, .box-bleft { padding-left:8px; overflow:hidden; } .box-tright, .box-bright { padding-right:8px; overflow:hidden; } /* ################--------------- Login Null Header ---------------#################### */ #contenulogin { height: 266px; width: 600px; margin-top:100px; margin-left: auto; margin-right: auto; background:url("../pics/login_glpi.png") no-repeat; font-family : Verdana,Arial,Helvetica,sans-serif; font-size : 12px; color :#659900; font-weight: bold; } #contenu-nullHeader { height: 424px; width: 739px; margin-top:50px; margin-left: auto; margin-right: auto; background:url("../pics/null-header.png") no-repeat; } #text-nullHeader { float:left; height: 300px; width: 739px; margin-right:auto; margin-left: auto; margin-top:100px; } #boxlogin { position:relative; background-color: transparent; padding-left: 15px; padding-top: 76px; text-align: left; /* Bug IE Grrr */ height: 190px; width: 300px; } #boxlogin p { text-align:center; } .row { clear: both; padding-top: 5px; } .label { float: left; margin-left:10px; text-align: left; } .formw { float: right; margin-right:10px; text-align: right; } #boxlogin fieldset { background-color: transparent; border: 2px solid #FFC65D; padding-bottom:22px; } #boxlogin legend { font-family:"Trebuchet MS",Verdana,Geneva,Arial,Helvetica,sans-serif; font-size: 15px; font-weight: 700; background-color: transparent; color :#659900; } #boxlogin input { border: 1px solid #659900; } #logo-login { font-size: 11px; float:right; height: 160px; width: 230px; margin-right:10px; margin-left:0px; margin-top:80px; color :#000000; overflow: auto; } #logo-login a:hover { color :#659900; text-decoration: underline; } #box-faq { float:right; margin-right:10px; } .sous_logo { font-family: arial; font-size: 9px; color: #eeeeee; text-decoration: none; } .error { color: red; margin-top:20px; text-align:center; } #footer-login { text-align:right; position: fixed !important; left: 0px; right: 10px; bottom: 0px !important; height: 40px; font-size : 10px; color :#757575; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: bold; margin-top:10px; margin:auto; /*css hack for IE*/ position: absolute; bottom: auto; top: expression((parseInt(document.documentElement.clientHeight)+parseInt(document.documentElement.scrollTop)-42)+'px'); width: expression(parseInt(document.documentElement.clientWidth)+'px'); } /* ################--------------- Header / menu ---------------#################### */ div#header { display : none; background: url("../pics/fd_nav1.png") 0 0 repeat-x; margin-bottom:10px; } div#c_preference { height: 20px; text-align: right; margin-right: 5px; position: relative; top: 4px; font-size: 0.9em; z-index:900; } div#c_preference ul { list-style: none; } div#c_preference ul li { float: right; margin: 0 10px; } div#c_preference ul li#deconnexion { margin-left: 25px; } div#c_preference a { color: #000; text-decoration: none; font-size: 0.9em; } div#c_preference a:hover { text-decoration: underline; } div#c_recherche { height: 21px; text-align: right; margin-right: 25px; position: relative; top: 5px; font-size: 0.9em; } div#c_recherche form { height: 15px; position: relative; bottom: 3px; } div#c_recherche form div#champRecherche input { border: 1px solid #000; height: 14px; font-family: 'Bitstream Vera Sans', arial, Tahoma, 'Sans serif'; font-size: 11px; } div#c_recherche form div#boutonRecherche { float: right; border: 1px solid #000; height: 14px; width: 14px; overflow: hidden; } div#c_recherche form div#boutonRecherche input { font-family: 'Bitstream Vera Sans', arial, Tahoma, 'Sans serif'; font-size: 0.7em; width: 15px; height: 15px; border: none; position: relative; right: 2px; } div#c_menu { height: 41px; position: absolute; top: 0px; z-index: 10; left: 45px; } div#c_menu ul#menu { position: relative; left: 10px; top: 23px; height: 20px; list-style: none; float: left; } ul#menu a.itemP, ul#menu a.itemP1 { display: block; height: 100%; width: 100%; text-align: center; text-decoration: none; border-right: 1px solid #9BA563; color: #000; } ul#menu ul.ssmenu { position: relative; top: 5px; width: 108px; border: 1px solid #CC9900; border-bottom: 0px; -moz-border-radius: 4px; background: url("../pics/fd_ssmenu.png") 0 0 repeat; display: none; } ul#menu ul li { list-style: none; text-align: center; border-bottom: 1px solid #CC9900; line-height: 20px; font-size: 0.9em; } ul#menu ul li a { color: #000; text-decoration: none; display: block; width: 100%; height: 100%; } ul#menu ul li a:hover { background: url("../pics/fd_nav2.png") 0 0 repeat; } ul#menu li#menu1 { float: left; width: 110px; } ul#menu li#menu1 ul.ssmenu { position: relative; width: 110px; } ul#menu li#menu2 { float: left; width: 110px; } ul#menu li#menu2 ul.ssmenu { position: relative; width: 110px; } ul#menu li#menu3 { float: left; width: 110px; } ul#menu li#menu3 ul.ssmenu { position: relative; width: 110px; } ul#menu li#menu4 { float: left; width: 110px; } ul#menu li#menu4 ul.ssmenu { position: relative; width: 110px; } ul#menu li#menu5 { float: left; width: 110px; } ul#menu li#menu5 ul.ssmenu { position: relative; width: 110px; } ul#menu li#menu6 { float: left; width: 110px; } ul#menu li#menu6 ul.ssmenu { position: relative; width: 110px; } ul#menu li#menu7 { float: left; width: 110px; } ul#menu li#menu7 ul.ssmenu { position: relative; width: 110px; } div#header div#c_logo { position: absolute; z-index: 1000; width: 64px; height: 41px; float: left; background: url("../pics/fd_logo.png") 0 0 repeat-x; } div#header div#c_logo a { display: block; width: 100%; height: 100%; text-decoration: none; } div#c_ssmenu1 { background: url("../pics/fd_nav2.png") 0 0 repeat-x; height: 24px; clear: both; font-size: 0.8em; } div#c_ssmenu1 ul { position: relative; top: 4px; left: 0px; list-style: none; } div#c_ssmenu1 ul li { float: left; padding: 0 10px; } div#c_ssmenu1 ul li a { text-decoration: none; color: #666; } div#c_ssmenu1 ul li a:hover { text-decoration: underline; } div#c_ssmenu2 { position: relative; z-index: 5; background: url("../pics/fd_nav3.png") 0 0 repeat-x; height: 28px; clear: both; font-size: 0.9em; } div#c_ssmenu2 ul { position: relative; top: 5px; left: 0px; list-style: none; } div#c_ssmenu2 ul li { position:relative; float: left; padding: 0 10px; } div#c_ssmenu2 ul li a { text-decoration: none; color: #000; } div#c_ssmenu2 a.here { font-size:14px; } div#show_entities { display: none; position: absolute; top:20px; left:1px; border: 1px solid #CC9900; background: url("../pics/fd_hoverlink.png") 0 0 repeat; -moz-border-radius: 5px; padding: 5px; font-size: 11px; text-align: left; z-index:1000; } div#show_entities_long { display: none; position: absolute; top:20px; left:1px; border: 1px solid #CC9900; background: url("../pics/fd_hoverlink.png") 0 0 repeat; -moz-border-radius: 5px; padding: 5px; font-size: 11px; text-align: left; z-index:1000; overflow:scroll; height:300px; width:300px; } div#show_all_menu { display: none; position: absolute; top:20px; left:5px; border: 1px solid #CC9900; background: url("../pics/fd_hoverlink.png") 0 0 repeat; -moz-border-radius: 5px; padding: 5px; font-size: 11px; text-align: left; z-index:1000; } #menu_navigate { display:none; } #tabspanel { display:none; } /* ################--------------- Footer ---------------#################### */ #footer { display:none; background: url("../pics/fd_footer.png") 0 0 repeat-x; font-size: 9px; color :#757575; padding: 3px; margin-top: 200px; clear:both; } .copyright { font-size: 9px; color :#757575; } /* ################--------------- DB Slave---------------#################### */ #dbslave-float { top: 0px; left: 300px; position: absolute; z-index: 100; } #dbslave-float a { border-top: 1px solid #cecece; border-bottom: 2px solid #4a4a4a; border-left: 1px solid #cecece; border-right: 1px solid #cecece; text-decoration: none; text-align: center; margin: 0; padding: 1px .5em; font-family: helvetica,arial,sans-serif; font-size: 10px; font-weight: bold; background-color: #fff; color:blue; } /* ################--------------- Debug ---------------#################### */ #debug-float { top: 0px; left: 80px; position: absolute; z-index: 100; } #debug-float a { border-top: 1px solid #cecece; border-bottom: 2px solid #4a4a4a; border-left: 1px solid #cecece; border-right: 1px solid #cecece; text-decoration: none; text-align: center; margin: 0; padding: 1px .5em; font-family: helvetica,arial,sans-serif; font-size: 10px; font-weight: bold; background-color: #fff; color:red; } #debug-float a:hover { background-color: #fc3; border-bottom: 2px solid #36f; } #debug { display:none; background-color:#F0F0F0; } #debugajax { display:none; margin: auto; text-align:center; } #debug h1, #debugajax h1 { font-size:14px; text-align:center; background-color:#efefe7; padding: 5px; } #debug h2, #debugajax h2 { font-size:14px; padding-left: 10px; border-left: 4px solid #FFC65D; border-bottom: 2px solid #FFC65D; } #debug table, #debugajax table { margin:0; } glpi-0.84.3+dfsg.1/css/style_install.css000066400000000000000000000160231226600447100200130ustar00rootroot00000000000000/* * @version $Id: style_install.css 20129 2013-02-04 16:53:59Z moyo $ ------------------------------------------------------------------------- GLPI - Gestionnaire Libre de Parc Informatique Copyright (C) 2003-2013 by the INDEPNET Development Team. http://indepnet.net/ http://glpi-project.org ------------------------------------------------------------------------- LICENSE This file is part of GLPI. GLPI is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. GLPI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GLPI. If not, see . -------------------------------------------------------------------------- */ /* ############# Definition des styles de l'install et de l'update ############# */ body { background-color:#ffffff; font-family: Verdana; color:#000000; } #principal { width:760px; font-family: Verdana; font-size:12px; text-align: center; margin: auto; padding: 40px 40px 40px 40px; } #bloc { width:760px; margin:0 auto; text-align:left; position:relative; padding:10px; background:#E9EDD0; background:-moz-linear-gradient(360deg, #E9EDD0, #BBC972); /* Firefox */ background:-webkit-gradient(linear, left top, left bottom, from(#E9EDD0), to(#BBC972)); /* Webkit */ /* For Internet Explorer 5.5 - 7 */ filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=#E9EDD0, endColorStr=#BBC972, GradientType=1); /* For Internet Explorer 8 */ -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#E9EDD0, endColorstr=#BBC972, GradientType=1)"; border:1px solid #aaa; border-radius:10px; -moz-border-radius:10px; -webkit-border-radius:10px; box-shadow:0 0 15px #aaa; -moz-box-shadow:0 0 15px #aaa; -webkit-box-shadow:0 0 15px #aaa; } #logo_bloc { position:absolute; top:-25px; padding:0; margin:0; width: 107px; height: 43px; background: url(../pics/login_logo_glpi.png) no-repeat; } p { padding-left:20px; padding-right:20px; } .center { text-align:center; } .left { text-align:left; } .inline { display:inline; } table { text-align:center; border: 0; margin: 20px; margin-left: auto; margin-right: auto; width: 90%; } th { font-size: 12px; font-weight: bold; color: #FFA500; vertical-align:bottom; } .tab_cadre { } .tab_bg_1 { } .tab_check { border: 1px solid #aaaaaa; padding:10px; } .tab_check th{ font-size: 14px; font-weight: bold; } .tab_check td { font-size:11px; border-bottom:1px solid #bbbbbb; } .red { color:red; } .green { color:green; } h2 { color:#D09800; text-align:center; } h3 { text-align:center; } input { border: 1px solid #ccc; } fieldset { margin:40px; padding: 20px; border: 2px solid #D09800; font-size: 12px; font-weight:200; } .block { display: inline-block; width:300px; } .submit { text-align:center; } input.submit { font-size: 11px; cursor:pointer; height: auto; font: bold 12px Arial, Helvetica; color: #8f5a0a; background-color: #ffb94b; background-image: -webkit-gradient(linear, left top, left bottom, from(#fddb6f), to(#ffb94b)); background-image: -webkit-linear-gradient(top, #fddb6f, #ffb94b); background-image: -moz-linear-gradient(top, #fddb6f, #ffb94b); background-image: -ms-linear-gradient(top, #fddb6f, #ffb94b); background-image: -o-linear-gradient(top, #fddb6f, #ffb94b); background-image: linear-gradient(top, #fddb6f, #ffb94b); /* For Internet Explorer 5.5 - 7 */ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#fddb6f, endColorstr=#ffb94b); /* For Internet Explorer 8 */ -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#fddb6f, endColorstr=#ffb94b)"; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; text-shadow: 0 1px 0 rgba(255,255,255,0.5); -moz-box-shadow: 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.3) inset; -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.3) inset; box-shadow: 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.3) inset; border-width: 1px; border-style: solid; border-color: #d69e31 #e3a037 #d5982d #e3a037 } input.submit:hover { border: 1px inset #888888; background-color: #fddb6f; background-image: -webkit-gradient(linear, left top, left bottom, from(#ffb94b), to(#fddb6f)); background-image: -webkit-linear-gradient(top, #ffb94b, #fddb6f); background-image: -moz-linear-gradient(top, #ffb94b, #fddb6f); background-image: -ms-linear-gradient(top, #ffb94b, #fddb6f); background-image: -o-linear-gradient(top, #ffb94b, #fddb6f); background-image: linear-gradient(top, #ffb94b, #fddb6f); } .vsubmit { font-size: 11px; cursor:pointer; height: auto; font: bold 12px Arial, Helvetica; color: #8f5a0a; background-color: #ffb94b; background-image: -webkit-gradient(linear, left top, left bottom, from(#fddb6f), to(#ffb94b)); background-image: -webkit-linear-gradient(top, #fddb6f, #ffb94b); background-image: -moz-linear-gradient(top, #fddb6f, #ffb94b); background-image: -ms-linear-gradient(top, #fddb6f, #ffb94b); background-image: -o-linear-gradient(top, #fddb6f, #ffb94b); background-image: linear-gradient(top, #fddb6f, #ffb94b); padding: 3px 9px; text-decoration: none; /* For Internet Explorer 5.5 - 7 */ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#fddb6f, endColorstr=#ffb94b); /* For Internet Explorer 8 */ -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#fddb6f, endColorstr=#ffb94b)"; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; text-shadow: 0 1px 0 rgba(255,255,255,0.5); -moz-box-shadow: 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.3) inset; -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.3) inset; box-shadow: 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.3) inset; border-width: 1px; border-style: solid; border-color: #d69e31 #e3a037 #d5982d #e3a037 } .vsubmit:hover { border: 1px inset #888888; background-color: #fddb6f; background-image: -webkit-gradient(linear, left top, left bottom, from(#ffb94b), to(#fddb6f)); background-image: -webkit-linear-gradient(top, #ffb94b, #fddb6f); background-image: -moz-linear-gradient(top, #ffb94b, #fddb6f); background-image: -ms-linear-gradient(top, #ffb94b, #fddb6f); background-image: -o-linear-gradient(top, #ffb94b, #fddb6f); background-image: linear-gradient(top, #ffb94b, #fddb6f); } glpi-0.84.3+dfsg.1/css/styles.css000066400000000000000000001043151226600447100164520ustar00rootroot00000000000000/* * @version $Id: styles.css 20192 2013-02-17 16:32:59Z moyo $ ------------------------------------------------------------------------- GLPI - Gestionnaire Libre de Parc Informatique Copyright (C) 2003-2013 by the INDEPNET Development Team. http://indepnet.net/ http://glpi-project.org ------------------------------------------------------------------------- LICENSE This file is part of GLPI. GLPI is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. GLPI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GLPI. If not, see . -------------------------------------------------------------------------- */ /* ################--------------- GLPI CSS style ---------------#################### */ /* ################--------------- Default style ---------------#################### */ body { font-family: 'Bitstream Vera Sans', arial, Tahoma, 'Sans serif'; font-size: 12px; margin: 0; padding: 0; background: #dfdfdf repeat-x; } ul, li, dt, dl, dd, form, img, input { margin: 0; padding: 0; } ul { list-style-type: none; } span.invisible { visibility: hidden; } /* separateur pour rétablir les comportements de block */ div.sep { font-size: 1px; height: 1px; padding: 0; margin: 0; clear: both; } img { border: 0; } small { font-family: verdana; font-size: 10px; } sup { vertical-align: baseline; position: relative; top: -0.4em; } .big { font-size: 14px; } .b { font-weight: bold; } .center { text-align:center; } .left { text-align:left; } .right { text-align:right; } .center-h { margin:auto; } .middle { vertical-align:middle; } .bottom { vertical-align:bottom; } .top { vertical-align:top; } .relative { position: relative; } .red { color:red; } .blue { color:blue; } .green { color:green; } .yellow { color:yellow; } .deleted { background-color:#cf9b9b; } .separ { clear: both; visibility: hidden; } a, a:link { font-weight: bold; text-decoration: none; color : #659900; font-size : 11px; } a:hover { color: black; } hr { border: 1px solid #cccccc; } /* Over link div */ .over_link { display: none; position: absolute; border: 1px solid #CC9900; background: url("../pics/fd_hoverlink.png") 0 0 repeat; -moz-border-radius: 5px; -webkit-border-radius: 5px; -o-border-radius: 5px; padding: 5px; max-width: 350px; font-size: 11px; text-align: left; z-index:1000; } .pointer { cursor:pointer; } /* ################--------------- Tabs ---------------#################### */ .alltab { font-size:14px; text-align:center; padding: 10px; font-weight: bold; } /* ################--------------- Page ---------------#################### */ #page { /*margin: 0 auto; text-align:center;*/ margin: 25px 10px; background: #FFFFFF repeat-x top left; -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; -moz-box-shadow: 0px 7px 10px #4D4D4D; -webkit-box-shadow: 0px 7px 10px #4D4D4D; box-shadow: 0px 7px 10px #4D4D4D; padding: 8px 8px 20px 8px; } #page form { font-size: 12px; margin:0; margin-bottom:5px; padding:0; } #page { margin-top:15px; } /* ################--------------- form ---------------#################### */ option { border:1px solid #ccc; background-color:#ffffff; } .submit { text-align:center; } select { font-size: 11px; border: 1px solid #888888; color: black; background-color: white; line-height: 19px; /* do not set height because using multiple select*/ } textarea, input { background-color:#FAFAFA; color: black; border: 1px solid #888888; font-size: 11px; } input { height: 17px; padding: 2px; vertical-align: middle; } input[type="image"] { height: auto; background-color: transparent; border: 0; } input[type="file"] { height: 22px; border: 1px solid #4E6378; } input.submit { cursor:pointer; height: auto; font: bold 12px Arial, Helvetica; color: #8f5a0a; background-color: #ffb94b; background-image: -webkit-gradient(linear, left top, left bottom, from(#fddb6f), to(#ffb94b)); background-image: -webkit-linear-gradient(top, #fddb6f, #ffb94b); background-image: -moz-linear-gradient(top, #fddb6f, #ffb94b); background-image: -ms-linear-gradient(top, #fddb6f, #ffb94b); background-image: -o-linear-gradient(top, #fddb6f, #ffb94b); background-image: linear-gradient(top, #fddb6f, #ffb94b); /* For Internet Explorer 5.5 - 7 */ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#fddb6f, endColorstr=#ffb94b); /* For Internet Explorer 8 */ -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#fddb6f, endColorstr=#ffb94b)"; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; text-shadow: 0 1px 0 rgba(255,255,255,0.5); -moz-box-shadow: 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.3) inset; -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.3) inset; box-shadow: 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.3) inset; border-width: 1px; border-style: solid; border-color: #d69e31 #e3a037 #d5982d #e3a037 } input.submit:hover { border: 1px inset #888888; background-color: #fddb6f; background-image: -webkit-gradient(linear, left top, left bottom, from(#ffb94b), to(#fddb6f)); background-image: -webkit-linear-gradient(top, #ffb94b, #fddb6f); background-image: -moz-linear-gradient(top, #ffb94b, #fddb6f); background-image: -ms-linear-gradient(top, #ffb94b, #fddb6f); background-image: -o-linear-gradient(top, #ffb94b, #fddb6f); background-image: linear-gradient(top, #ffb94b, #fddb6f); } input.save { } span.vsubmit, a.vsubmit { padding: 2px; vertical-align: middle; cursor:pointer; height: auto; font: bold 12px Arial, Helvetica; color: #8f5a0a; background-color: #ffb94b; background-image: -webkit-gradient(linear, left top, left bottom, from(#fddb6f), to(#ffb94b)); background-image: -webkit-linear-gradient(top, #fddb6f, #ffb94b); background-image: -moz-linear-gradient(top, #fddb6f, #ffb94b); background-image: -ms-linear-gradient(top, #fddb6f, #ffb94b); background-image: -o-linear-gradient(top, #fddb6f, #ffb94b); background-image: linear-gradient(top, #fddb6f, #ffb94b); white-space:nowrap; /* no line break*/ /* For Internet Explorer 5.5 - 7 */ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#fddb6f, endColorstr=#ffb94b); /* For Internet Explorer 8 */ -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#fddb6f, endColorstr=#ffb94b)"; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; text-shadow: 0 1px 0 rgba(255,255,255,0.5); -moz-box-shadow: 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.3) inset; -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.3) inset; box-shadow: 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.3) inset; border-width: 1px; border-style: solid; border-color: #d69e31 #e3a037 #d5982d #e3a037 } a.vsubmit:hover { padding: 2px; vertical-align: middle; cursor:pointer; height: auto; font: bold 12px Arial, Helvetica; color: #8f5a0a; border: 1px inset #888888; background-color: #fddb6f; background-image: -webkit-gradient(linear, left top, left bottom, from(#ffb94b), to(#fddb6f)); background-image: -webkit-linear-gradient(top, #ffb94b, #fddb6f); background-image: -moz-linear-gradient(top, #ffb94b, #fddb6f); background-image: -ms-linear-gradient(top, #ffb94b, #fddb6f); background-image: -o-linear-gradient(top, #ffb94b, #fddb6f); background-image: linear-gradient(top, #ffb94b, #fddb6f); white-space:nowrap; /* no line break*/ } .entity_select { border-left: 1px solid #C0CAD4; border-right: 1px solid#C0CAD4; padding:3px; } .entity_select:hover { border-left: 1px solid #C0CAD4; border-right: 1px solid #C0CAD4; border-bottom: 1px solid #C0CAD4; padding:3px; } .tree { width:100%; border:0; border-bottom:1px solid #C0CAD4; } .treeroot { width:100%; background: url("../pics/treeroot.png") 0 2px no-repeat; border:0; /*margin-top:5px;*/ font-weight:bold; } .tree:hover{ background-color:#eeeeee; } .treeroot:hover{ background-color:#eeeeee; } /* ################--------------- Table ---------------#################### */ table { font-size: 11px; /* Probem WIth EXTJS calendar -> to sons*/ /*margin: 0 auto;*/ border:0; } th { } td { } .tab_glpi { margin: 0 auto; } .tab_cadre { margin: 0 auto; -moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; border: 1px solid #cccccc; z-index:1; text-align: left; font-size: 11px; background-color: #ffffff; } .tab_cadre_central { margin: 0 auto; -moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; border: 1px solid #bbbbbb; z-index:1; text-align: left; font-size: 11px; width:950px; /* background-color: #FFF4DF; */ background : url("../pics/fond-central.png") repeat-x top right ; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; -moz-box-shadow: 0px 2px 5px #666; -webkit-box-shadow: 0px 2px 5px #666; box-shadow: 0px 2px 5px #666; } .tab_cadre_navigation { margin: 0 auto; padding: 4px; margin: 1px; border: 1px solid #aaaaaa; background-color: #ffffff; -moz-border-radius: 5px; -webkit-border-radius: 5px; -o-border-radius: 5px; font-size : 12px; font-weight: bold; } .tab_cadre_fixe, .tab_cadre_fixehov { margin: 0px auto 5px auto; -moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; /*border: 1px solid #cccccc;*/ background: #f2f2f2; z-index:1; text-align: left; font-size: 11px; width:950px; } /*.tab_cadre_fixe tr, .tab_cadre_fixe td { */ /* background-color: transparent; */ /*}*/ .tab_cadre_fixe img { vertical-align: middle; } .tab_cadrehov, .tab_cadrehov_pointer { margin: 0 auto; -moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; border: 1px solid #cccccc; text-align: left; font-size: 11px; width: 80%; background-color: #ffffff; -moz-box-shadow: 0px 2px 5px #666; -webkit-box-shadow: 0px 2px 5px #666; box-shadow: 0px 2px 5px #666; } .tab_cadre_report { margin: 0 auto; -moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; border: 1px solid #cccccc; z-index:1; text-align: left; font-size: 11px; text-align: center; width:90%; } .tab_cadre th, .tab_cadre_fixe th, .tab_cadre_fixehov th, .tab_cadrehov th, .tab_cadrehov_pointer th, .tab_cadre_report th { font-size: 12px; font-weight: bold; background-color: #E1D39E; text-align: center; -moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; padding: 2px; /*background: url("../pics/fond_th.png") repeat-x; border-bottom:1px solid #cccccc; padding: 2px;*/ } .tab_cadre td, .tab_cadre_fixe td, .tab_cadre_fixehov td, .tab_cadrehov td, .tab_cadrehov_pointer td, .tab_cadre_report td { padding: 3px 5px; } .tab_cadrehov tr:hover, .tab_cadre_fixehov tr:hover { background-color: #FFF4DF; } .tab_cadrehov_pointer tr:hover { cursor: pointer; background-color: #FFF4DF; } .tab_check { text-align:center; margin: 20px; margin-left: auto; margin-right: auto; width: 90%; border: 1px solid #aaaaaa; padding:10px; } .tab_check th { font-size: 12px; font-weight: bold; color: #fccc6f; vertical-align:bottom; } .tab_check td { font-size:11px; border-bottom:1px solid #bbbbbb; } /* Ajout pour IE */ .tab_cadrehov_pointer tr { cursor: pointer; } .tab_format { padding: 0px; width: 100%; margin: 0px; border: 0px; border-collapse:collapse; } .tab_format td { padding: 1px; margin: 0px; } .tab_bg_1 { background-color: #f2f2f2; } .tab_bg_1_2 { background-color: #cf9b9b; } .tab_bg_2 { background-color: #f2f2f2; } .tab_bg_2_2 { background-color: #cf9b9b; } .tab_bg_3 { /*background-color: #eeeeee;*/ background-color: #e7e7e2; } .tab_bg_4 { background-color: #e4e4e2; } .tab_bg_5 { background-color: #f2f2f2; } .tab_find { background-color: #ccccc7; } .tab_find:hover { background-color:#FFF2C2; cursor:pointer; } .tab_resa { border:1px dashed #cccccc; background-color: #d7d7d2; font-size:10px } .tab_resa:hover { background-color: #ffffff; border:1px dotted #000000; } .central { padding-top: 15px; width: 450px; } .central table { margin-bottom: 5px; } div.rss { margin-left: 10px; } td.numeric { text-align:right; /* width:10%;*/ /* padding-right:4%;*/ } td.htmltable_upper_separation_cell { border-top: dashed 1px #a0a0a0; } td.nopadding { padding:0; } /* ################--------------- Pager ---------------#################### */ .tab_cadre_pager { margin: 0 auto; text-align:center; -moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; border: 1px solid #cccccc; font-size:10px; width:950px; } .tab_cadre_pager select, .tab_cadre_pager span, .tab_cadre_pager form { font-size:10px; margin:0; } .tab_cadre_pager input { vertical-align:middle; } .tab_cadre_pager th { font-size: 10px; font-weight: bold; background-color: #fccc6f; text-align: center; background: url("../pics/fond_th.png") repeat-x; } /* ################--------------- Autocompletion ---------------#################### */ ul.autocomp { list-style-type: none; margin:0; margin-left:3px; padding:3px; text-align:left; } ul.autocomp li.selected { background-color: #FFF6CF; } li.auto_comp { list-style-type: none; display:block; margin:0; padding:2px; height:16px; } /* ################--------------- Tracking / Reminder ---------------#################### */ .tracking { width:100%; height:100%; cursor:pointer; } .tracking:hover { background-color: #FFF4DF; } .tracking_hour { font-family: verdana; font-size: 10px; } .tracking_bold { font-weight: bold; } .ldap_right, .reminder_right { position:absolute; right:0; margin-right:5px; font-size:10px; } .showplan { font-weight: bold; text-decoration: none; color : #659900; cursor:pointer; } .tracking_small { font-size:10px; } .reminder_list { text-align:left; margin-left:8px; } /* ################--------------- Space to replace   ---------------#################### */ /* 2 space */ .very_small_space { margin-left: 15px; } /* 5 spaces */ .small_space { margin-left: 38px; } /* 10 spaces */ .medium_space { margin-left: 120px; } /* 20 spaces */ .big_space { margin-left:250px; } /* ################--------------- Espacement des blocs ---------------#################### */ .spaced { margin-bottom: 15px; } .firstbloc { margin-bottom: 5px; } /* ################--------------- Calendrier / reservation ---------------#################### */ .calendrier { vertical-align:middle; /*border: 1px solid #888888; background-color:#eeeeee; background: url("../pics/fond_form.png") repeat-x; */ } .calendrier:hover { /*border: 1px inset #888888; background-color:#ffffff;*/ cursor:pointer; } .calendrier_mois { font-family: Verdana, Arial, Sans, sans-serif; font-size: 10px; } .calendrier_jour { font-family: arial,helvetica,sans-serif; font-size: 14px; color: black; } .calendrier_case1 { margin-left: 10px; padding: 2px; -moz-border-radius: 5px; -webkit-border-radius: 5px; -o-border-radius: 5px; margin-top: 2px; border: 1px solid #666666; background-color: white; } .calendrier_case2 { margin-left: 10px; padding: 2px; -moz-border-radius: 5px; -webkit-border-radius: 5px; -o-border-radius: 5px; margin-top: 2px; border: 1px solid #cccccc; background-color: #eeeeee } .calendrier_case_white { background-color:#ffffff; } /* ################--------------- Knowledge FAQ ---------------#################### */ #contenukb { height: 100%; width: 600px; margin: 0 auto; } #contenukb legend { font-weight: bold; } #contenukb fieldset { background-color: #eeeeee; border: 1px solid #FFC65D; -moz-border-radius: 8px; -webkit-border-radius: 8px; -o-border-radius: 8px; padding-bottom:10px; width: 600px; } #contenukb textarea { width:550px; } #kbanswer ul { padding-left: 15px; list-style-type: circle; } #kbanswer ol { padding-left: 15px; list-style-type: decimal; } .tdkb_result { vertical-align:top; text-align:left; width: 33%; padding: 3px 20px 3px 25px; } .kb { text-align:left; padding-top:5px; } .kb_resume { text-align:left; font-size: 9px; line-height: 10px; clear: both; padding: 5px 0 10px 25px; } .tdkb { text-align:left; font-size:10px; color:#aaaaaa; } .baskb { position: relative; text-align:left; font-size:10px; color:#aaaaaa; } .baskb_right { position:absolute; right:0; margin-right:5px; } .code { width: 95%; border: dotted 2px #ccc; } a.knowbase { margin-left:8px; } a.pubfaq { margin-left:8px; color: #c9993C; } a.pubfaq:hover { color: black; } a.icon_nav_move img { padding: 4px; margin: 1px; border: 1px solid #aaaaaa; background-color: #ffffff; -moz-border-radius: 5px; -webkit-border-radius: 5px; -o-border-radius: 5px; } a.icon_nav_move:hover img { padding: 4px; margin: 1px; border: 1px solid #999999; background-color:#e4e4e4; -moz-border-radius: 5px; -webkit-border-radius: 5px; -o-border-radius: 5px; } /* ################--------------- planning ---------------#################### */ .planning { text-align:center; border:1px dashed #cccccc; background-color: #d7d7d2; font-size:9px; } .planing:hover { border: 1px solid #999999; background-color: white; } .available { background-color: green; } .notavailable { background-color: red; } .partialavailableend { background-image: -webkit-linear-gradient(left, red 50%, green 0%); background-image: -moz-linear-gradient(left, red 50%, green 0%); background-image: -ms-linear-gradient(left, red 50%, green 0%); background-image: -o-linear-gradient(left, red 50%, green 0%); background-image: linear-gradient(left, red 50%, green 0%); } .partialavailablebegin { background-image: -webkit-linear-gradient(left, green 50%, red 0%); background-image: -moz-linear-gradient(left, green 50%, red 0%); background-image: -ms-linear-gradient(left, green 50%, red 0%); background-image: -o-linear-gradient(left, green 50%, red 0%); background-image: linear-gradient(left, green 50%, red 0%); } /* ################--------------- Menu navigation ---------------#################### */ div#menu_navigate { margin: 0 auto; z-index:1; font-size: 10px; width:950px; } div#menu_navigate li { margin-left:2px; display:block; float:left; padding:2px; } div#tabcontent { width:950px; text-align:center; margin: 0 auto; } /* ################--------------- box (redirect and other) ---------------#################### */ .box { margin: 0 auto; width:700px; text-align:center; } .box-tleft { background:transparent url(../pics/corners.gif) no-repeat 0 0; zoom:1; } .box-tcenter { height:8px; background:transparent url(../pics/tb.gif) repeat-x 0 0; overflow:hidden; } .box-tright { background:transparent url(../pics/corners.gif) no-repeat right -8px; } .box-mleft { background:transparent url(../pics/l.gif) repeat-y 0; padding-left:4px; overflow:hidden; zoom:1; } .box-mcenter { background:#eee url(../pics/tb.gif) repeat-x 0 -16px; padding:4px 10px; font-family:"Myriad Pro","Myriad Web","Tahoma","Helvetica","Arial",sans-serif; color:#393939; font-size:11px; } .box-mcenter h3 { font-size:11px; font-weight:bold; margin:0 0 4px 0; zoom:1; } .box-mright { background:transparent url(../pics/r.gif) repeat-y right; padding-right:4px; overflow:hidden; } .box-bleft { background:transparent url(../pics/corners.gif) no-repeat 0 -16px; zoom:1; } .box-bcenter { background:transparent url(../pics/tb.gif) repeat-x 0 -8px; height:8px; overflow:hidden; } .box-bright { background:transparent url(../pics/corners.gif) no-repeat right -24px; } .box-tleft, .box-bleft { padding-left:8px; overflow:hidden; } .box-tright, .box-bright { padding-right:8px; overflow:hidden; } /* ################--------------- Login Null Header ---------------#################### */ #firstboxlogin { height: 276px; width: 650px; margin-top:150px; margin-left: auto; margin-right: auto; font-family : Verdana,Arial,Helvetica,sans-serif; font-size : 12px; color :#659900; font-weight: bold; background-color:#FFFFFF; border:3px solid #ccc; border-radius:10px; -moz-border-radius:10px; -webkit-border-radius:10px; padding:10px; position: relative; } #logo_login { position:absolute; top:-25px; padding:0; margin:0; width: 107px; height: 43px; background: url(../pics/login_logo_glpi.png) no-repeat; } #text-login { font-size: 13px; margin-bottom:10px; max-height: 50px; width: 95%; /*margin-right:10px; margin-left:0px; margin-top:80px;*/ color :#000000; overflow: auto; padding:10px; } #text-login a:hover { color :#659900; text-decoration: underline; } #bloc { width:760px; margin:0 auto; text-align:left; position:relative; padding:10px; background:#E9EDD0; background:-moz-linear-gradient(360deg, #E9EDD0, #BBC972); /* Firefox */ background:-webkit-gradient(linear, left top, left bottom, from(#E9EDD0), to(#BBC972)); /* Webkit */ /* For Internet Explorer 5.5 - 7 */ filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=#E9EDD0, endColorStr=#BBC972, GradientType=1); /* For Internet Explorer 8 */ -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#E9EDD0, endColorstr=#BBC972, GradientType=1)"; border:1px solid #aaa; border-radius:10px; -moz-border-radius:10px; -webkit-border-radius:10px; box-shadow:0 0 15px #aaa; -moz-box-shadow:0 0 15px #aaa; -webkit-box-shadow:0 0 15px #aaa; } #logo_bloc { position:absolute; top:-25px; padding:0; margin:0; width: 107px; height: 43px; background: url(../pics/login_logo_glpi.png) no-repeat; } #boxlogin { position:relative; margin:auto; text-align: left; /* Bug IE Grrr */ width: 350px; padding:10px; background:#E9EDD0; background:-moz-linear-gradient(360deg, #E9EDD0, #BBC972); /* Firefox */ background:-webkit-gradient(linear, left top, left bottom, from(#E9EDD0), to(#BBC972)); /* Webkit */ /* For Internet Explorer 5.5 - 7 */ filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=#E9EDD0, endColorStr=#BBC972, GradientType=1); /* For Internet Explorer 8 */ -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#E9EDD0, endColorstr=#BBC972, GradientType=1)"; border:1px solid #aaa; border-radius:10px; -moz-border-radius:10px; -webkit-border-radius:10px; box-shadow:0 0 15px #aaa; -moz-box-shadow:0 0 15px #aaa; -webkit-box-shadow:0 0 15px #aaa; } #boxlogin p { text-align:center; } #forget { text-align:right; text-decoration: underline; } .row { clear: both; padding-top: 5px; } .label { float: left; margin-left:10px; text-align: left; } .formw { float: right; margin-right:10px; text-align: right; } #boxlogin fieldset { background-color: transparent; border: 2px solid #FFC65D; padding-bottom:22px; } #boxlogin legend { font-family:"Trebuchet MS",Verdana,Geneva,Arial,Helvetica,sans-serif; font-size: 15px; font-weight: 700; background-color: transparent; color :#659900; } #boxlogin input { border: 1px solid #659900; -moz-border-radius:5px; -webkit-border-radius:5px; } #boxlogin input[type=text], #boxlogin input[type=password]{ width:13em; } #boxlogin input[type=text]:focus, #boxlogin input[type=password]:focus{ border-color:#FFA500; background-color: #fff; -moz-box-shadow:0 0 3px #FFA500; -webkit-box-shadow:0 0 3px #FFA500; outline:none; /* Pour enlever le contour jaune lorsque l'on sélectionne un input dans Chrome */ } #box-faq { padding-top:30px; text-align:center; position:relative; margin:auto; } .sous_logo { font-family: arial; font-size: 9px; color: #eeeeee; text-decoration: none; } .error { color: red; margin-top:20px; text-align:center; } #footer-login { text-align:right; position: fixed !important; left: 0px; right: 10px; bottom: 0px !important; height: 40px; font-size : 10px; color :#757575; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: bold; margin-top:10px; margin:auto; /*css hack for IE*/ position: absolute; bottom: auto; top: expression((parseInt(document.documentElement.clientHeight)+parseInt(document.documentElement.scrollTop)-42)+'px'); width: expression(parseInt(document.documentElement.clientWidth)+'px'); } /* ################--------------- Header / menu ---------------#################### */ div#header { background: #f1f4e3 url("../pics/fd_nav1.png") 0 0 repeat-x; margin: 0px 10px 10px 10px; -moz-border-radius: 0px 0px 8px 8px; -webkit-border-radius: 0px 0px 8px 8px; border-radius: 0px 0px 8px 8px; -moz-box-shadow: 0px 7px 10px #4D4D4D; -webkit-box-shadow: 0px 7px 10px #4D4D4D; box-shadow: 0px 7px 10px #4D4D4D; padding-bottom: 8px; } div#c_preference { height: 20px; text-align: right; margin-right: 5px; position: relative; top: 4px; font-size: 0.9em; z-index:900; } div#c_preference ul { list-style: none; } div#c_preference ul li { float: right; margin: 0 10px; } div#c_preference ul li#deconnexion { margin-left: 25px; } div#c_preference a { color: #000; text-decoration: none; font-size: 0.9em; } div#c_preference a:hover{ text-decoration: underline; } div#c_recherche { height: 21px; text-align: right; margin-right: 25px; position: relative; top: 5px; font-size: 0.9em; } div#c_recherche form { height: 15px; position: relative; bottom: 3px; } div#c_recherche form div#champRecherche input { border: none; height: 14px; font-family: 'Bitstream Vera Sans', arial, Tahoma, 'Sans serif'; font-size: 11px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } div#c_recherche form div#boutonRecherche { position: absolute; right: 0px; top: 0px; border: none; height: 14px; width: 14px; overflow: hidden; } div#c_recherche form div#boutonRecherche input { font-family: 'Bitstream Vera Sans', arial, Tahoma, 'Sans serif'; font-size: 0.7em; width: 15px; height: 15px; border: none; position: relative; right: 2px; } div#c_menu { height: 41px; position: absolute; top: 0px; z-index: 100; left: 45px; } div#c_menu ul#menu { position: relative; left: 22px; top: 23px; height: 20px; list-style: none; float: left; } ul#menu a.itemP, ul#menu a.itemP1 { display: block; height: 100%; width: 100%; text-align: center; text-decoration: none; border-right: 1px solid #9BA563; color: #000; } ul#menu ul.ssmenu { position: relative; top: 5px; /* width: 108px;*/ border: 1px solid #CC9900; background: url("../pics/fd_ssmenu.png") 0 0 repeat; display: none; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; -moz-box-shadow: 0px 0px 4px #000000; -webkit-box-shadow: 0px 0px 4px #000000; box-shadow: 0px 0px 4px #000000; } ul#menu ul li { list-style: none; text-align: left; border-bottom: 1px solid #CC9900; line-height: 20px; font-size: 0.9em; padding: 5px 5px 5px 5px; } ul#menu ul li:last-child { border-bottom: 0px; } ul#menu ul li a { color: #000; text-decoration: none; display: block; width: 100%; height: 100%; } ul#menu ul li a:hover { background: #D0D99D; } ul#menu li#menu1 { float: left; width: 130px; } ul#menu li#menu1 ul.ssmenu { position: relative; width: 130px; } ul#menu li#menu2 { float: left; width: 130px; } ul#menu li#menu2 ul.ssmenu { position: relative; width: 130px; } ul#menu li#menu3 { float: left; width: 130px; } ul#menu li#menu3 ul.ssmenu { position: relative; width: 130px; } ul#menu li#menu4 { float: left; width: 130px; } ul#menu li#menu4 ul.ssmenu { position: relative; width: 130px; } ul#menu li#menu5 { float: left; width: 130px; } ul#menu li#menu5 ul.ssmenu { position: relative; width: 130px; } ul#menu li#menu6 { float: left; width: 135px; } ul#menu li#menu6 ul.ssmenu { position: relative; width: 135px; } ul#menu li#menu7 { float: left; width: 135px; } ul#menu li#menu7 ul.ssmenu { position: relative; width: 135px; } div#header div#c_logo { position: absolute; z-index: 1000; width: 64px; height: 41px; float: left; background: url("../pics/fd_logo.png") 0 0 repeat-x; } div#header div#c_logo a { display: block; width: 100%; height: 100%; text-decoration: none; } div#c_ssmenu1 { background: #D0D99D; height: 24px; clear: both; font-size: 0.8em; } div#c_ssmenu1 ul { position: relative; top: 4px; left: 0px; list-style: none; } div#c_ssmenu1 ul li { float: left; padding: 0 10px; } div#c_ssmenu1 ul li a { text-decoration: none; color: #666; } div#c_ssmenu1 ul li a:hover { text-decoration: underline; } div#c_ssmenu2 { position: relative; z-index: 5; /*background: url("../pics/fd_nav3.png") 0 0 repeat-x;*/ height: 28px; clear: both; font-size: 0.9em; } div#c_ssmenu2 ul { position: relative; top: 5px; left: 0px; list-style: none; } div#c_ssmenu2 ul li { position:relative; float: left; padding: 0 10px; } div#c_ssmenu2 ul li a { text-decoration: none; color: #000; } div#c_ssmenu2 a.here { font-size:14px; } div#show_all_menu { display: none; position: absolute; top:20px; left:5px; border: 1px solid #CC9900; background: url("../pics/fd_hoverlink.png") 0 0 repeat; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; -moz-box-shadow: 0px 0px 4px #000000; -webkit-box-shadow: 0px 0px 4px #000000; box-shadow: 0px 0px 4px #000000; padding: 5px; font-size: 11px; text-align: left; z-index:1000; } div#show_all_menu .tab_bg_1 { background: #E1CC7B; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; font-size: 12px; } div#show_all_menu a { color: #7F7F7F; display: inline-block; padding: 2px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } div#show_all_menu a:hover { background-color: #D0D99D; } div#show_all_menu .tab_bg_1 a { color: #000000!important; } div#show_all_menu .tab_bg_1 a:hover { background: transparent; } /* ################--------------- Footer ---------------#################### */ #footer { background: url("../pics/fd_footer.png") 0 0 repeat-x; font-size: 9px; color :#757575; padding: 6px; border: 2px solid #cccccc; position: relative; float: right; right: 10px; height: 18px; width: 70%; -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; -moz-box-shadow: 0px 7px 10px ; -webkit-box-shadow: 0px 7px 10px ; box-shadow: 0px 7px 10px ; } .copyright { font-size: 9px; color :#757575; } /* ################--------------- DB Slave---------------#################### */ #dbslave-float { top: 0px; left: 300px; position: absolute; z-index: 100; } #dbslave-float a { border-top: 1px solid #cecece; border-bottom: 2px solid #4a4a4a; border-left: 1px solid #cecece; border-right: 1px solid #cecece; text-decoration: none; text-align: center; margin: 0; padding: 1px .5em; font-family: helvetica,arial,sans-serif; font-size: 10px; font-weight: bold; background-color: #fff; color:blue; } /* ################--------------- Debug ---------------#################### */ #debug-float { top: 0px; left: 80px; position: absolute; z-index: 100; } #debug-float a { border-top: 1px solid #cecece; border-bottom: 2px solid #4a4a4a; border-left: 1px solid #cecece; border-right: 1px solid #cecece; text-decoration: none; text-align: center; margin: 0; padding: 1px .5em; font-family: helvetica,arial,sans-serif; font-size: 10px; font-weight: bold; background-color: #fff; color:red; } #debug-float a:hover { background-color: #fc3; border-bottom: 2px solid #36f; } #debugajax { margin: auto; text-align:center; } #debug { background-color:#F0F0F0; } #debug h1, #debugajax h1 { font-size:14px; text-align:center; background-color:#efefe7; padding: 5px; } #debug h2, #debugajax h2 { font-size:14px; padding-left: 10px; border-left: 4px solid #FFC65D; border-bottom: 2px solid #FFC65D; } #debug table, #debugajax table { margin:0; } #kbanswer p { margin: 1.12em 0 } #kbanswer h1 { font-size: 2em; margin: .67em 0 } #kbanswer h2 { font-size: 1.5em; margin: .75em 0; font-weight: bolder; } #kbanswer h3 { font-size: 1.17em; margin: .83em 0; font-weight: bolder; } #kbanswer h4 { margin: 1.12em 0; font-weight: bolder; } #kbanswer h5 { font-size: .83em; margin: 1.5em 0; font-weight: bolder; } #kbanswer h6 { font-size: .75em; margin: 1.67em 0; font-weight: bolder; } #kbanswer address { font-style: italic; } #kbanswer pre { font-family: monospace; white-space: pre; } glpi-0.84.3+dfsg.1/css/styles_ie.css000066400000000000000000000027141226600447100171270ustar00rootroot00000000000000/* * @version $Id: styles_ie.css 20129 2013-02-04 16:53:59Z moyo $ ------------------------------------------------------------------------- GLPI - Gestionnaire Libre de Parc Informatique Copyright (C) 2003-2013 by the INDEPNET Development Team. http://indepnet.net/ http://glpi-project.org ------------------------------------------------------------------------- LICENSE This file is part of GLPI. GLPI is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. GLPI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GLPI. If not, see . -------------------------------------------------------------------------- */ /* ################--------------- GLPI CSS style MOD and HACK for IE ---------------#################### */ img { behavior: url("../css/win_png.htc"); } div#c_ssmenu1 ul li { margin-top:4px; } #contenu-nullHeader { background-image:none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod='crop', src='../pics/null-header.png'); zoom:1; }glpi-0.84.3+dfsg.1/css/tab-scroller-menu.css000066400000000000000000000031211226600447100204530ustar00rootroot00000000000000/*! * @version $Id: tab-scroller-menu.css 20129 2013-02-04 16:53:59Z moyo $ ------------------------------------------------------------------------- GLPI - Gestionnaire Libre de Parc Informatique Copyright (C) 2003-2013 by the INDEPNET Development Team. http://indepnet.net/ http://glpi-project.org ------------------------------------------------------------------------- LICENSE This file is part of GLPI. GLPI is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. GLPI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GLPI. If not, see . -------------------------------------------------------------------------- */ .x-tab-scroller-right-over { background-position: -18px 0; } .x-tab-tabmenu-right { background: transparent url(../pics/extrajs/tab-scroller-menu.gif) no-repeat 0 0; border-bottom: 1px solid #8db2e3; width:18px; position:absolute; right:0; top:0; z-index:10; cursor:pointer; } .x-tab-tabmenu-over { background-position: -18px 0; } .x-tab-tabmenu-disabled { background-position: 0 0; opacity:.5; -moz-opacity:.5; filter:alpha(opacity=50); cursor:default; } glpi-0.84.3+dfsg.1/css/win_png.htc000066400000000000000000000017571226600447100165640ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/files/000077500000000000000000000000001226600447100147235ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/files/.htaccess000066400000000000000000000000151226600447100165150ustar00rootroot00000000000000deny from allglpi-0.84.3+dfsg.1/files/_cache/000077500000000000000000000000001226600447100161255ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/files/_cache/remove.txt000066400000000000000000000001201226600447100201540ustar00rootroot00000000000000Vous pouvez effacer ce fichier sans dommages. You can safely remove this file. glpi-0.84.3+dfsg.1/files/_cron/000077500000000000000000000000001226600447100160235ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/files/_cron/remove.txt000066400000000000000000000001201226600447100200520ustar00rootroot00000000000000Vous pouvez effacer ce fichier sans dommages. You can safely remove this file. glpi-0.84.3+dfsg.1/files/_dumps/000077500000000000000000000000001226600447100162125ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/files/_dumps/remove.txt000066400000000000000000000001201226600447100202410ustar00rootroot00000000000000Vous pouvez effacer ce fichier sans dommages. You can safely remove this file. glpi-0.84.3+dfsg.1/files/_graphs/000077500000000000000000000000001226600447100163465ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/files/_graphs/remove.txt000077500000000000000000000001201226600447100204000ustar00rootroot00000000000000Vous pouvez effacer ce fichier sans dommages. You can safely remove this file. glpi-0.84.3+dfsg.1/files/_lock/000077500000000000000000000000001226600447100160125ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/files/_lock/remove.txt000066400000000000000000000001201226600447100200410ustar00rootroot00000000000000Vous pouvez effacer ce fichier sans dommages. You can safely remove this file. glpi-0.84.3+dfsg.1/files/_log/000077500000000000000000000000001226600447100156435ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/files/_log/remove.txt000066400000000000000000000001201226600447100176720ustar00rootroot00000000000000Vous pouvez effacer ce fichier sans dommages. You can safely remove this file. glpi-0.84.3+dfsg.1/files/_plugins/000077500000000000000000000000001226600447100165435ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/files/_plugins/remove.txt000066400000000000000000000001201226600447100205720ustar00rootroot00000000000000Vous pouvez effacer ce fichier sans dommages. You can safely remove this file. glpi-0.84.3+dfsg.1/files/_rss/000077500000000000000000000000001226600447100156715ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/files/_rss/remove.txt000066400000000000000000000001201226600447100177200ustar00rootroot00000000000000Vous pouvez effacer ce fichier sans dommages. You can safely remove this file. glpi-0.84.3+dfsg.1/files/_sessions/000077500000000000000000000000001226600447100167305ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/files/_sessions/remove.txt000066400000000000000000000001201226600447100207570ustar00rootroot00000000000000Vous pouvez effacer ce fichier sans dommages. You can safely remove this file. glpi-0.84.3+dfsg.1/files/_tmp/000077500000000000000000000000001226600447100156625ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/files/_tmp/remove.txt000066400000000000000000000001201226600447100177110ustar00rootroot00000000000000Vous pouvez effacer ce fichier sans dommages. You can safely remove this file. glpi-0.84.3+dfsg.1/files/_uploads/000077500000000000000000000000001226600447100165315ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/files/_uploads/remove.txt000066400000000000000000000001201226600447100205600ustar00rootroot00000000000000Vous pouvez effacer ce fichier sans dommages. You can safely remove this file. glpi-0.84.3+dfsg.1/front/000077500000000000000000000000001226600447100147515ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/front/allassets.php000066400000000000000000000025121226600447100174550ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.84 (before states.php) */ include ('../inc/includes.php'); Session::checkCentralAccess(); Html::header(__('Global'), $_SERVER['PHP_SELF'], "inventory", "allassets"); Search::show('AllAssets'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/auth.others.php000066400000000000000000000027671226600447100177420ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("config", "w"); $config = new Config(); //Update CAS configuration if (isset($_POST["update"])) { $config->update($_POST); Html::redirect($CFG_GLPI["root_doc"] . "/front/auth.others.php"); } Html::header(__('External authentication sources'), $_SERVER['PHP_SELF'],"config","extauth","others"); Auth::showOtherAuthList(); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/auth.settings.php000066400000000000000000000025641226600447100202710ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("config", "w"); $config = new Config(); Html::header(__('External authentication sources'), $_SERVER['PHP_SELF'], "config", "extauth", "settings"); $config->showFormAuthentication(); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/authldap.form.php000066400000000000000000000104741226600447100202340ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("config", "w"); $config = new Config(); $config_ldap = new AuthLDAP(); if (!isset($_GET['id'])) { $_GET['id'] = ""; } //LDAP Server add/update/delete if (isset($_POST["update"])) { $config_ldap->update($_POST); Html::back(); } else if (isset($_POST["add"])) { //If no name has been given to this configuration, then go back to the page without adding if ($_POST["name"] != "") { if ($newID = $config_ldap->add($_POST)) { if (AuthLdap::testLDAPConnection($newID)) { Session::addMessageAfterRedirect(__('Test successful')); } else { Session::addMessageAfterRedirect(__('Test failed'), false, ERROR); } Html::redirect($CFG_GLPI["root_doc"] . "/front/authldap.php?next=extauth_ldap&id=".$newID); } } Html::back(); } else if (isset($_POST["delete"])) { $config_ldap->delete($_POST); $_SESSION['glpi_authconfig'] = 1; $config_ldap->redirectToList(); } else if (isset($_POST["test_ldap"])) { $config_ldap->getFromDB($_POST["id"]); if (AuthLdap::testLDAPConnection($_POST["id"])) { //TRANS: %s is the description of the test $_SESSION["LDAP_TEST_MESSAGE"] = sprintf(__('Test successful: %s'), //TRANS: %s is the name of the LDAP main server sprintf(__('Main server %s'), $config_ldap->fields["name"])); } else { //TRANS: %s is the description of the test $_SESSION["LDAP_TEST_MESSAGE"] = sprintf(__('Test failed: %s'), //TRANS: %s is the name of the LDAP main server sprintf(__('Main server %s'), $config_ldap->fields["name"])); } Html::back(); } else if (isset($_POST["test_ldap_replicate"])) { foreach ($_POST["test_ldap_replicate"] as $replicate_id => $value) { $replicate = new AuthLdapReplicate(); $replicate->getFromDB($replicate_id); if (AuthLdap::testLDAPConnection($_POST["id"],$replicate_id)) { //TRANS: %s is the description of the test $_SESSION["LDAP_TEST_MESSAGE"] = sprintf(__('Test successful: %s'), //TRANS: %s is the name of the LDAP main server sprintf(__('Replicate %s'), $ldap->fields["name"])); } else { //TRANS: %s is the description of the test $_SESSION["LDAP_TEST_MESSAGE"] = sprintf(__('Test failed: %s'), //TRANS: %s is the name of the LDAP main server sprintf(__('Replicate %s'), $ldap->fields["name"])); } } Html::back(); } else if (isset($_POST["add_replicate"])) { $replicate = new AuthLdapReplicate(); unset($_POST["next"]); unset($_POST["id"]); $replicate->add($_POST); Html::back(); } Html::header(AuthLDAP::getTypeName(1), $_SERVER['PHP_SELF'], 'config', 'extauth', 'ldap'); $config_ldap->showForm($_GET["id"], $_GET); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/authldap.php000066400000000000000000000024601226600447100172660ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("config", "r"); Html::header(AuthLDAP::getTypeName(2), $_SERVER['PHP_SELF'], 'config', 'extauth', 'ldap'); Search::show('AuthLDAP'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/authmail.form.php000066400000000000000000000042561226600447100202370ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("config", "w"); if (!isset($_GET["id"])) { $_GET["id"] = ""; } $config_mail = new AuthMail(); //IMAP/POP Server add/update/delete if (isset($_POST["update"])) { $config_mail->update($_POST); Html::back(); } else if (isset($_POST["add"])) { //If no name has been given to this configuration, then go back to the page without adding if ($_POST["name"] != "") { $newID = $config_mail->add($_POST); } Html::back(); } else if (isset($_POST["delete"])) { $config_mail->delete($_POST); $_SESSION['glpi_authconfig'] = 2; $config_mail->redirectToList(); } else if (isset($_POST["test"])) { if (AuthMail::testAuth($_POST["imap_string"], $_POST["imap_login"], $_POST["imap_password"])) { Session::addMessageAfterRedirect(__('Test successful')); } else { Session::addMessageAfterRedirect(__('Test failed'), false, ERROR); } Html::back(); } Html::header(AuthMail::getTypeName(1), $_SERVER['PHP_SELF'], "config", "extauth", "imap"); $config_mail->showForm($_GET["id"]); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/authmail.php000066400000000000000000000025221226600447100172670ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("config", "w"); Html::header(AuthMail::getTypeName(2), $_SERVER['PHP_SELF'],"config","extauth","imap"); if (Toolbox::canUseImapPop()) { Search::show('AuthMail'); } Html::footer(); ?>glpi-0.84.3+dfsg.1/front/autoupdatesystem.form.php000066400000000000000000000023571226600447100220530ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new AutoUpdateSystem(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/autoupdatesystem.php000066400000000000000000000023461226600447100211070ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new AutoUpdateSystem(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/backup.php000066400000000000000000000464521226600447100167420ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); if (isset($_POST['check_version'])) { Session::checkRight("check_update", "r"); Toolbox::checkNewVersionAvailable(0, true); Html::back(); } Session::checkRight("backup", "w"); // full path $path = GLPI_DUMP_DIR ; Html::header(__('Maintenance'), $_SERVER['PHP_SELF'], "admin", "backup"); $max_time = min(get_cfg_var("max_execution_time"), get_cfg_var("max_input_time")); if ($max_time == 0) { $defaulttimeout = 60; $defaultrowlimit = 5; } else if ($max_time > 5) { $defaulttimeout = $max_time-2; $defaultrowlimit = 5; } else { $defaulttimeout = max(1, $max_time-2); $defaultrowlimit = 2; } // les deux options qui suivent devraient etre incluses dans le fichier de config plutot non ? // 1 only with ZLib support, else change value to 0 $compression = 0; if ($compression == 1) { $filetype = "sql.gz"; } else { $filetype = "sql"; } /** * Genere un fichier backup.xml a partir de base dbhost connecte avec l'utilisateur dbuser * et le mot de passe dbpassword sur le serveur dbdefault **/ function xmlbackup() { global $CFG_GLPI, $DB; //on parcoure la DB et on liste tous les noms des tables dans $table //on incremente $query[] de "select * from $table" pour chaque occurence de $table $result = $DB->list_tables(); $i = 0; while ($line = $DB->fetch_row($result)) { $table = $line[0]; $query[$i] = "SELECT * FROM `$table`"; $i++; } //le nom du fichier a generer... //Si fichier existe deja il sera remplac�par le nouveau $chemin = GLPI_DUMP_DIR."/backup.xml"; // Creation d'une nouvelle instance de la classe // et initialisation des variables $A = new XML(); // Your query $A->SqlString = $query; //File path $A->FilePath = $chemin; // Type of layout : 1,2,3,4 // For details about Type see file genxml.php if (empty($Type)) { $A->Type = 4; } else { $A->Type = $Type; } //appelle de la methode gerant le fichier XML $A->DoXML(); // Affichage, si erreur affiche erreur //sinon affiche un lien vers le fichier XML genere if ($A->IsError == 1) { printf(__('ERROR:'), $A->ErrorString); } //fin de fonction xmlbackup } ////////////////////////// DUMP SQL FUNCTIONS /** * Init time to computer time spend **/ function init_time() { global $TPSDEB, $TPSCOUR; list($usec,$sec) = explode(" ", microtime()); $TPSDEB = $sec; $TPSCOUR = 0; } /** * Get current time **/ function current_time() { global $TPSDEB, $TPSCOUR; list($usec,$sec) = explode(" ", microtime()); $TPSFIN = $sec; if (round($TPSFIN-$TPSDEB,1) >= $TPSCOUR+1) {//une seconde de plus $TPSCOUR = round($TPSFIN-$TPSDEB,1); } } /** Get data of a table * * @param $DB DB object * @param $table table name * @param $from begin from * @param $limit limit to **/ function get_content($DB, $table, $from, $limit) { $content = ""; $gmqr = ""; $result = $DB->query("SELECT * FROM `$table` LIMIT ".intval($from).",".intval($limit)); if ($result) { $num_fields = $DB->num_fields($result); if (Toolbox::get_magic_quotes_runtime()) { $gmqr = true; } while ($row = $DB->fetch_row($result)) { if ($gmqr) { $row = Toolbox::addslashes_deep($row); } $insert = "INSERT INTO `$table` VALUES ("; for( $j=0 ; $j<$num_fields ; $j++) { if (is_null($row[$j])) { $insert .= "NULL,"; } else if ($row[$j] != "") { $insert .= "'".addslashes($row[$j])."',"; } else { $insert .= "'',"; } } $insert = preg_replace("/,$/","",$insert); $insert .= ");\n"; $content .= $insert; } } return $content; } /** Get structure of a table * * @param $DB DB object * @param $table table name **/ function get_def($DB, $table) { $def = "### Dump table $table\n\n"; $def .= "DROP TABLE IF EXISTS `$table`;\n"; $query = "SHOW CREATE TABLE `$table`"; $result = $DB->query($query); $DB->query("SET SESSION sql_quote_show_create = 1"); $row = $DB->fetch_row($result); $def .= preg_replace("/AUTO_INCREMENT=\w+/i","",$row[1]); $def .= ";"; return $def."\n\n"; } /** Restore a mysql dump * * @param $DB DB object * @param $dumpFile dump file * @param $duree max delay before refresh **/ function restoreMySqlDump($DB, $dumpFile, $duree) { global $DB, $TPSCOUR, $offset, $cpt; // $dumpFile, fichier source // $duree=timeout pour changement de page (-1 = aucun) // Desactivation pour empecher les addslashes au niveau de la creation des tables // En plus, au niveau du dump on considere qu'on est bon // set_magic_quotes_runtime(0); if (!file_exists($dumpFile)) { echo sprintf(__('File %s not found.'), $dumpFile)."
"; return false; } $fileHandle = fopen($dumpFile, "rb"); if (!$fileHandle) { //TRASN: %s is the name of the file echo sprintf(__('Unauthorized access to the file %s'), $dumpFile)."
"; return false; } if ($offset != 0) { if (fseek($fileHandle,$offset,SEEK_SET) != 0) { //erreur //TRANS: %s is the number of the byte printf(__("Unable to find the byte %s"), Html::formatNumber($offset, false, 0)); echo "
"; return false; } Html::glpi_flush(); } $formattedQuery = ""; while (!feof($fileHandle)) { current_time(); if (($duree > 0) && ($TPSCOUR >= $duree)) { //on atteint la fin du temps imparti return true; } // specify read length to be able to read long lines $buffer = fgets($fileHandle, 102400); // do not strip comments due to problems when # in begin of a data line $formattedQuery .= $buffer; if (Toolbox::get_magic_quotes_runtime()) { $formattedQuery = stripslashes($formattedQuery); } if (substr(rtrim($formattedQuery),-1) == ";") { // Do not use the $DB->query if ($DB->query($formattedQuery)) { //if no success continue to concatenate $offset = ftell($fileHandle); $formattedQuery = ""; $cpt++; } } } if ($DB->error) { echo "
"; //TRANS: %s is the SQL query which generates the error printf(__("Mysql error starting from %s"), "[$formattedQuery]"); echo "
".$DB->error()."
"; } fclose($fileHandle); $offset = -1; return true; } /** Backup a glpi DB * * @param $DB DB object * @param $dumpFile dump file * @param $duree max delay before refresh * @param $rowlimit rowlimit to backup in one time **/ function backupMySql($DB, $dumpFile, $duree, $rowlimit) { global $TPSCOUR, $offsettable, $offsetrow, $cpt; // $dumpFile, fichier source // $duree=timeout pour changement de page (-1 = aucun) $fileHandle = fopen($dumpFile, "a"); if (!$fileHandle) { //TRANS: %s is the name of the file echo sprintf(__('Unauthorized access to the file %s'), $dumpFile)."
"; return false; } if ($offsettable == 0 && $offsetrow == -1) { $time_file = date("Y-m-d-H-i"); $cur_time = date("Y-m-d H:i"); $todump = "#GLPI Dump database on $cur_time\n"; fwrite ($fileHandle, $todump); } $result = $DB->list_tables(); $numtab = 0; while ($t = $DB->fetch_row($result)) { $tables[$numtab] = $t[0]; $numtab++; } for ( ; $offsettable<$numtab ; $offsettable++) { // Dump de la structure table if ($offsetrow == -1) { $todump = "\n".get_def($DB,$tables[$offsettable]); fwrite ($fileHandle,$todump); $offsetrow++; $cpt++; } current_time(); if (($duree > 0) && ($TPSCOUR >= $duree)) { //on atteint la fin du temps imparti return true; } $fin = 0; while (!$fin) { $todump = get_content($DB,$tables[$offsettable],$offsetrow,$rowlimit); $rowtodump = substr_count($todump, "INSERT INTO"); if ($rowtodump > 0) { fwrite ($fileHandle,$todump); $cpt += $rowtodump; $offsetrow += $rowlimit; if ($rowtodump<$rowlimit) { $fin = 1; } current_time(); if (($duree > 0) && ($TPSCOUR >= $duree)) { //on atteint la fin du temps imparti return true; } } else { $fin = 1; $offsetrow = -1; } } if ($fin) { $offsetrow = -1; } current_time(); if (($duree > 0) && ($TPSCOUR >= $duree)) { //on atteint la fin du temps imparti return true; } } if ($DB->error()) { echo "
"; //TRANS: %s is the SQL query which generates the error printf(__("Mysql error starting from %s"), "[$formattedQuery]"); echo "
".$DB->error()."
"; } $offsettable = -1; fclose($fileHandle); return true; } // #################" DUMP sql################################# if (isset($_GET["dump"]) && $_GET["dump"] != "") { $time_file = date("Y-m-d-H-i"); $cur_time = date("Y-m-d H:i"); $filename = $path . "/glpi-".GLPI_VERSION."-$time_file.$filetype"; if (!isset($_GET["duree"]) && is_file($filename)) { echo "
".__('The file already exists')."
"; } else { init_time(); //initialise le temps //debut de fichier if (!isset($_GET["offsettable"])) { $offsettable = 0; } else { $offsettable = $_GET["offsettable"]; } //debut de fichier if (!isset($_GET["offsetrow"])) { $offsetrow = -1; } else { $offsetrow = $_GET["offsetrow"]; } //timeout de 5 secondes par defaut, -1 pour utiliser sans timeout if (!isset($_GET["duree"])) { $duree = $defaulttimeout; } else { $duree = $_GET["duree"]; } //Limite de lignes a dumper a chaque fois if (!isset($_GET["rowlimit"])) { $rowlimit = $defaultrowlimit; } else { $rowlimit = $_GET["rowlimit"]; } //si le nom du fichier n'est pas en parametre le mettre ici if (!isset($_GET["fichier"])) { $fichier = $filename; } else { $fichier = $_GET["fichier"]; } $tab = $DB->list_tables(); $tot = $DB->numrows($tab); if (isset($offsettable)) { if ($offsettable >= 0) { $percent = min(100,round(100*$offsettable/$tot,0)); } else { $percent = 100; } } else { $percent = 0; } if ($percent >= 0) { Html::displayProgressBar(400, $percent); echo '
'; } if ($offsettable >= 0) { if (backupMySql($DB,$fichier,$duree,$rowlimit)) { echo "
". "". __('Automatic redirection, else click').""; echo "
"; Html::glpi_flush(); exit; } } } } // ############################## fin dump sql########################"""" // ################################## dump XML ############################# if (isset($_GET["xmlnow"]) && ($_GET["xmlnow"] != "")) { xmlbackup(); } // ################################## fin dump XML ############################# if (isset($_GET["file"]) && ($_GET["file"] != "") && is_file($path."/".$_GET["file"])) { $_SESSION['TRY_OLD_CONFIG_FIRST'] = true; init_time(); //initialise le temps //debut de fichier if (!isset($_GET["offset"])) { $offset = 0; } else { $offset = $_GET["offset"]; } //timeout de 5 secondes par defaut, -1 pour utiliser sans timeout if (!isset($_GET["duree"])) { $duree = $defaulttimeout; } else { $duree = $_GET["duree"]; } $fsize = filesize($path."/".$_GET["file"]); if (isset($offset)) { if ($offset == -1) { $percent = 100; } else { $percent = min(100,round(100*$offset/$fsize,0)); } } else { $percent = 0; } if ($percent >= 0) { Html::displayProgressBar(400, $percent); echo '
'; } if ($offset != -1) { if (restoreMySqlDump($DB,$path."/".$_GET["file"],$duree)) { echo "
". ""; echo __('Automatic redirection, else click').""; echo "
"; Html::glpi_flush(); exit; } } else { DBmysql::optimize_tables(NULL, true); // Compatiblity for old version for utf8 complete conversion $cnf = new Config(); $input['id'] = 1; $input['utf8_conv'] = 1; $cnf->update($input); } } if (isset($_POST["delfile"])) { if (isset($_POST['file']) && ($_POST["file"] != "")) { $filename = $_POST["file"]; if (is_file($path."/".$_POST["file"])) { unlink($path."/".$_POST["file"]); // TRANS: %s is a file name echo "
".sprintf(__('%s deleted'), $filename)."
"; } } } if (Session::haveRight("check_update","r")) { echo "
"; echo "
"; Html::showSimpleForm($_SERVER['PHP_SELF'], 'check_version', __('Check if a new version is available')); echo "
"; } // Title backup echo "
"; echo ""; echo ""; echo "
". "\"".__s('Deleted')."\"". "".__('SQL Dump')." ".__('XML Dump')." 
"; echo "
". "". "". "". "". "". ""; $dir = opendir($path); $files = array(); while ($file = readdir($dir)) { if (($file != ".") && ($file != "..") && preg_match("/\.sql$/i",$file)) { $files[$file] = filemtime($path."/".$file); } } arsort($files); if (count($files)) { foreach ($files as $file => $date) { $taille_fic = filesize($path."/".$file); echo "". "". "". ""; echo ""; echo ""; } } closedir($dir); $dir = opendir($path); unset($files); $files = array(); while ($file = readdir($dir)) { if (($file != ".") && ($file != "..") && preg_match("/\.xml$/i",$file)) { $files[$file] = filemtime($path."/".$file); } } arsort($files); if (count($files)) { foreach ($files as $file => $date) { $taille_fic = filesize($path."/".$file); echo "". "". "". "". ""; "". ""; } } closedir($dir); echo "
".__('File')."".__('Size')."".__('Date')." 
$file ".Toolbox::getSize($taille_fic)." " . Html::convDateTime(date("Y-m-d H:i",$date)) . " "; //TRANS: %s is the filename $string = sprintf(__('Delete the file %s?'), $file); Html::showSimpleForm($_SERVER['PHP_SELF'], 'delfile', _x('button', 'Delete permanently'), array('file' => $file),'','',$string); echo " "; // Multiple confirmation $string = array(); //TRANS: %s is the filename $string[] = array(sprintf(__('Replace the current database with the backup file %s?'), $file)); $string[] = array(__('Warning, your actual database will be totaly overwriten by the database you want to restore !!!')); echo "".__('Restore')."  ". __('Download')."". "

$file ".Toolbox::getSize($taille_fic)." " . Html::convDateTime(date("Y-m-d H:i",$date)) . " "; //TRANS: %s is the filename $string = sprintf(__('Delete the file %s?'),$file); echo ""._x('button', 'Delete permanently')."     -   ".__('Download')."". "
"; echo "
"; Html::footer(); ?> glpi-0.84.3+dfsg.1/front/blacklist.form.php000066400000000000000000000023411226600447100203740ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new Blacklist(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/blacklist.php000066400000000000000000000023301226600447100174300ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new Blacklist(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/bookmark.php000066400000000000000000000057751226600447100173050ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!isset($_GET["type"])) { $_GET["type"] = -1; } if (!isset($_GET["itemtype"])) { $_GET["itemtype"] = -1; } if (!isset($_GET["url"])) { $_GET["url"] = ""; } $bookmark = new Bookmark(); if (isset($_POST["add"])) { $bookmark->check(-1, 'w', $_POST); $bookmark->add($_POST); $_GET["action"] = "load"; // Force popup on load. $_SESSION["glpipopup"]["name"] = "load_bookmark"; } else if (isset($_POST["update"])) { $bookmark->check($_POST["id"], 'w'); // Right to update the bookmark $bookmark->check(-1, 'w', $_POST); // Right when entity change $bookmark->update($_POST); $_GET["action"] = "load"; } else if ($_GET["action"] == "edit" && isset($_GET['mark_default']) && isset($_GET["id"])) { $bookmark->check($_GET["id"], 'r'); if ($_GET["mark_default"] > 0) { $bookmark->mark_default($_GET["id"]); } else if ($_GET["mark_default"] == 0) { $bookmark->unmark_default($_GET["id"]); } $_GET["action"] = "load"; } else if (($_GET["action"] == "load") && isset($_GET["id"]) && ($_GET["id"] > 0)) { $bookmark->check($_GET["id"], 'r'); $bookmark->load($_GET["id"]); } else if (isset($_POST["delete"])) { $bookmark->check($_POST["id"], 'd'); $bookmark->delete($_POST); $_GET["action"] = "load"; } if ($_GET["action"] == "edit") { if (isset($_GET['id']) && ($_GET['id'] > 0)) { // Modify $bookmark->check($_GET["id"], 'w'); $bookmark->showForm($_GET['id']); } else { // Create $bookmark->check(-1, 'w'); $bookmark->showForm(0, array('type' => $_GET["type"], 'url' => rawurldecode($_GET["url"]), 'itemtype' => $_GET["itemtype"])); } } else { echo '
'; $bookmark->showTabs(); echo "
 
"; echo ""; } ?>glpi-0.84.3+dfsg.1/front/budget.form.php000066400000000000000000000071061226600447100177020ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("budget", "r"); if (empty($_GET["id"])) { $_GET["id"] = ''; } if (!isset($_GET["withtemplate"])) { $_GET["withtemplate"] = ''; } $budget = new Budget(); if (isset($_POST["add"])) { $budget->check(-1,'w',$_POST); if ($newID = $budget->add($_POST)) { $budget->refreshParentInfos(); Event::log($newID, "budget", 4, "financial", //TRANS: %1$s is the user login, %2$s is the name of the item to add sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); } Html::back(); } else if (isset($_POST["delete"])) { $budget->check($_POST["id"],'d'); if ($budget->delete($_POST)) { Event::log($_POST["id"], "budget", 4, "financial", //TRANS: %s is the user login sprintf(__('%s deletes an item'), $_SESSION["glpiname"])); } $budget->redirectToList(); } else if (isset($_POST["restore"])) { $budget->check($_POST["id"],'d'); if ($budget->restore($_POST)) { Event::log($_POST["id"], "budget", 4, "financial", //TRANS: %s is the user login sprintf(__('%s restores an item'), $_SESSION["glpiname"])); } $budget->redirectToList(); } else if (isset($_POST["purge"])) { $budget->check($_POST["id"],'d'); if ($budget->delete($_POST,1)) { Event::log($_POST["id"], "budget", 4, "financial", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); } $budget->redirectToList(); } else if (isset($_POST["update"])) { $budget->check($_POST["id"],'w'); if ($budget->update($_POST)) { Event::log($_POST["id"], "budget", 4, "financial", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); } Html::back(); } else { if (isset($_GET['popup'])) { Html::popHeader(Budget::getTypeName(1),$_SERVER['PHP_SELF']); if (isset($_GET["rand"])) { $_SESSION["glpipopup"]["rand"] = $_GET["rand"]; } } else { Html::header(Budget::getTypeName(1), $_SERVER['PHP_SELF'], "financial", "budget"); } $budget->showForm($_GET["id"], array('withtemplate' => $_GET["withtemplate"])); if (isset($_GET['popup'])) { echo ""; Html::popFooter(); } else { Html::footer(); } } ?> glpi-0.84.3+dfsg.1/front/budget.php000066400000000000000000000024451226600447100167410ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("budget", "r"); Html::header(Budget::getTypeName(1), $_SERVER['PHP_SELF'], "financial", "budget"); Search::show('Budget'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/calendar.form.php000077500000000000000000000023401226600447100201770ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new Calendar(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/calendar.php000077500000000000000000000030741226600447100172420ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new Calendar(); /* $dropdown->getFromDB(1); $begin='2010-12-27 10:00:00'; $end='2010-12-25 09:33:00'; $delay=15*MINUTE_TIMESTAMP;*/ // $timestamp= $dropdown->getActiveTimeBetween($begin,$end); // echo 'timestamp='.$timestamp.'
'; // // echo '--'.Html::timestampToString($timestamp); // echo '
'; // echo 'END = '.$dropdown->computeEndDate($begin,$delay); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/calendar_holiday.form.php000077500000000000000000000030621226600447100217120ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkCentralAccess(); $item = new Calendar_holiday(); if (isset($_POST["add"])) { $item->check(-1, 'w', $_POST); if ($item->add($_POST)) { Event::log($_POST["calendars_id"], "calendars", 4, "setup", //TRANS: %s is the user login sprintf(__('%s adds a link with an item'), $_SESSION["glpiname"])); } Html::back(); } Html::displayErrorAndDie("lost"); ?>glpi-0.84.3+dfsg.1/front/calendarsegment.form.php000077500000000000000000000030551226600447100215660ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkCentralAccess(); $item = new CalendarSegment(); if (isset($_POST["add"])) { $item->check(-1, 'w', $_POST); if ($item->add($_POST)) { Event::log($_POST["calendars_id"], "calendars", 4, "setup", //TRANS: %s is the user login sprintf(__('%s adds a link with an item'), $_SESSION["glpiname"])); } Html::back(); } Html::displayErrorAndDie("lost"); ?>glpi-0.84.3+dfsg.1/front/cartridge.form.php000066400000000000000000000055131226600447100203740ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("cartridge", "r"); $cart = new Cartridge(); $cartype = new CartridgeItem(); if (isset($_POST["add"])) { $cartype->check($_POST["cartridgeitems_id"],'w'); for ($i=0 ; $i<$_POST["to_add"] ; $i++) { unset($cart->fields["id"]); $cart->add($_POST); } Event::log($_POST["cartridgeitems_id"], "cartridges", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s adds cartridges'), $_SESSION["glpiname"])); Html::back(); } else if (isset($_POST["delete"])) { $cartype->check($_POST["cartridgeitems_id"],'w'); if ($cart->delete($_POST)) { Event::log($_POST["cartridgeitems_id"], "cartridges", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s deletes a cartridge'), $_SESSION["glpiname"])); } Html::back(); } else if (isset($_POST["install"])) { if ($_POST["cartridgeitems_id"]) { $cartype->check($_POST["cartridgeitems_id"],'w'); if ($cart->install($_POST["printers_id"],$_POST["cartridgeitems_id"])) { Event::log($_POST["printers_id"], "printers", 5, "inventory", //TRANS: %s is the user login sprintf(__('%s installs a cartridge'), $_SESSION["glpiname"])); } } Html::redirect($CFG_GLPI["root_doc"]."/front/printer.form.php?id=".$_POST["printers_id"]); } else if (isset($_POST["update"])) { $cart->check($_POST["id"],'w'); if ($cart->update($_POST)) { Event::log($_POST["printers_id"], "printers", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s updates a cartridge'), $_SESSION["glpiname"])); } Html::back(); } else { Html::back(); } ?> glpi-0.84.3+dfsg.1/front/cartridgeitem.form.php000066400000000000000000000057511226600447100212570ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("cartridge", "r"); if (!isset($_GET["id"])) { $_GET["id"] = ""; } $cartype = new CartridgeItem(); if (isset($_POST["add"])) { $cartype->check(-1,'w',$_POST); if ($newID = $cartype->add($_POST)) { Event::log($newID, "cartridges", 4, "inventory", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); } Html::back(); } else if (isset($_POST["delete"])) { $cartype->check($_POST["id"],'d'); if ($cartype->delete($_POST)) { Event::log($_POST["id"], "cartridges", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s deletes an item'), $_SESSION["glpiname"])); } $cartype->redirectToList(); } else if (isset($_POST["restore"])) { $cartype->check($_POST["id"],'d'); if ($cartype->restore($_POST)) { Event::log($_POST["id"], "cartridges", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s restores an item'), $_SESSION["glpiname"])); } $cartype->redirectToList(); } else if (isset($_POST["purge"])) { $cartype->check($_POST["id"],'d'); if ($cartype->delete($_POST,1)) { Event::log($_POST["id"], "cartridges", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); } $cartype->redirectToList(); } else if (isset($_POST["update"])) { $cartype->check($_POST["id"],'w'); if ($cartype->update($_POST)) { Event::log($_POST["id"], "cartridges", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); } Html::back(); } else { Html::header(Cartridge::getTypeName(2), $_SERVER['PHP_SELF'], "inventory", "cartridge"); $cartype->showForm($_GET["id"]); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/cartridgeitem.php000066400000000000000000000024741226600447100203140ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("cartridge", "r"); Html::header(Cartridge::getTypeName(2), $_SERVER['PHP_SELF'], "inventory", "cartridge"); Search::show('CartridgeItem'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/cartridgeitem_printermodel.form.php000066400000000000000000000030721226600447100240350ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.84 */ include ('../inc/includes.php'); $cipm = new CartridgeItem_PrinterModel(); if (isset($_POST["add"])) { $cipm->check(-1,'w', $_POST); if ($cipm->add($_POST)) { Event::log($_POST["cartridgeitems_id"], "cartridges", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s associates a type'), $_SESSION["glpiname"])); } Html::back(); } Html::displayErrorAndDie('Lost'); ?> glpi-0.84.3+dfsg.1/front/cartridgeitemtype.form.php000066400000000000000000000023611226600447100221530ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new CartridgeItemType(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/cartridgeitemtype.php000066400000000000000000000023501226600447100212070ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new CartridgeItemType(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/central.php000066400000000000000000000047401226600447100171170ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkCentralAccess(); // Change profile system if (isset($_POST['newprofile'])) { if (isset($_SESSION["glpiprofiles"][$_POST['newprofile']])) { Session::changeProfile($_POST['newprofile']); if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") { if ($_SESSION['glpiactiveprofile']['create_ticket_on_login']) { Html::redirect($CFG_GLPI['root_doc'] . "/front/helpdesk.public.php?create_ticket=1"); } else { Html::redirect($CFG_GLPI['root_doc']."/front/helpdesk.public.php"); } } Html::redirect($_SERVER['PHP_SELF']); } Html::redirect(preg_replace("/entities_id.*/","",$_SERVER['HTTP_REFERER'])); } // Manage entity change if (isset($_GET["active_entity"])) { if (!isset($_GET["is_recursive"])) { $_GET["is_recursive"] = 0; } if (Session::changeActiveEntities($_GET["active_entity"],$_GET["is_recursive"])) { if (($_GET["active_entity"] == $_SESSION["glpiactive_entity"]) && isset($_SERVER['HTTP_REFERER'])) { Html::redirect(preg_replace("/entities_id.*/","",$_SERVER['HTTP_REFERER'])); } } } Html::header(Central::getTypeName(1), $_SERVER['PHP_SELF']); // Redirect management if (isset($_GET["redirect"])) { Toolbox::manageRedirect($_GET["redirect"]); } $central = new Central(); $central->show(); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/change.form.php000066400000000000000000000100641226600447100176520ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); if (empty($_GET["id"])) { $_GET["id"] = ''; } Session::checkLoginUser(); $change = new Change(); if (isset($_POST["add"])) { $change->check(-1, 'w', $_POST); $newID = $change->add($_POST); Event::log($newID, "change", 4, "maintain", //TRANS: %1$s is the user login, %2$s is the name of the item sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); Html::back(); } else if (isset($_POST["delete"])) { $change->check($_POST["id"], 'd'); $change->delete($_POST); Event::log($_POST["id"], "change", 4, "maintain", //TRANS: %s is the user login sprintf(__('%s deletes an item'), $_SESSION["glpiname"])); $change->redirectToList(); } else if (isset($_POST["restore"])) { $change->check($_POST["id"], 'd'); $change->restore($_POST); Event::log($_POST["id"], "change", 4, "maintain", //TRANS: %s is the user login sprintf(__('%s restores an item'), $_SESSION["glpiname"])); $change->redirectToList(); } else if (isset($_POST["purge"])) { $change->check($_POST["id"], 'd'); $change->delete($_POST,1); Event::log($_POST["id"], "change", 4, "maintain", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); $change->redirectToList(); } else if (isset($_POST["update"])) { $change->check($_POST["id"], 'w'); $change->update($_POST); Event::log($_POST["id"], "change", 4, "maintain", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } else if (isset($_POST['delete_user'])) { $change_user = new Change_User(); $change_user->check($_POST['id'], 'd'); $change_user->delete($_POST); Event::log($_POST['changes_id'], "change", 4, "maintain", sprintf(__('%s deletes an actor'), $_SESSION["glpiname"])); Html::redirect($CFG_GLPI["root_doc"]."/front/change.form.php?id=".$_POST['changes_id']); } else if (isset($_POST['delete_group'])) { $change_group = new Change_Group(); $change_group->check($_POST['id'], 'd'); $change_group->delete($_POST); Event::log($_POST['changes_id'], "change", 4, "maintain", sprintf(__('%s deletes an actor'), $_SESSION["glpiname"])); Html::redirect($CFG_GLPI["root_doc"]."/front/change.form.php?id=".$_POST['changes_id']); } else if (isset($_POST['delete_supplier'])) { $change_supplier = new Change_Supplier(); $change_supplier->check($_POST['id'], 'd'); $change_supplier->delete($_POST); Event::log($_POST['changes_id'], "change", 4, "maintain", sprintf(__('%s deletes an actor'), $_SESSION["glpiname"])); Html::redirect($CFG_GLPI["root_doc"]."/front/change.form.php?id=".$_POST['changes_id']); } else { Html::header(Change::getTypeName(2), $_SERVER['PHP_SELF'], "maintain", "change"); $change->showForm($_GET["id"], $_GET); Html::footer(); } ?> glpi-0.84.3+dfsg.1/front/change.php000066400000000000000000000025541226600447100167150ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkSeveralRightsOr(array('show_all_change' => '1', 'show_my_change' => '1')); Html::header(Change::getTypeName(2), '', "maintain", "change"); Search::show('Change'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/change_item.form.php000066400000000000000000000030421226600447100206660ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkLoginUser(); $item = new Change_Item(); if (isset($_POST["add"])) { $item->check(-1, 'w', $_POST); if ($item->add($_POST)) { Event::log($_POST["changes_id"], "change", 4, "tracking", //TRANS: %s is the user login sprintf(__('%s adds a link with an item'), $_SESSION["glpiname"])); } Html::back(); } Html::displayErrorAndDie("lost"); ?>glpi-0.84.3+dfsg.1/front/change_problem.form.php000066400000000000000000000030471226600447100213750ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkLoginUser(); $item = new Change_Problem(); if (isset($_POST["add"])) { $item->check(-1, 'w', $_POST); if ($item->add($_POST)) { Event::log($_POST["changes_id"], "change", 4, "maintain", //TRANS: %s is the user login sprintf(__('%s adds a link with an item'), $_SESSION["glpiname"])); } Html::back(); } Html::displayErrorAndDie("lost"); ?>glpi-0.84.3+dfsg.1/front/change_ticket.form.php000066400000000000000000000030451226600447100212160ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkLoginUser(); $item = new Change_Ticket(); if (isset($_POST["add"])) { $item->check(-1, 'w', $_POST); if ($item->add($_POST)) { Event::log($_POST["changes_id"], "change", 4, "maintain", //TRANS: %s is the user login sprintf(__('%s adds a link with an item'), $_SESSION["glpiname"])); } Html::back(); } Html::displayErrorAndDie("lost"); ?>glpi-0.84.3+dfsg.1/front/changetask.form.php000066400000000000000000000023051226600447100205340ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); include (GLPI_ROOT . "/front/commonitiltask.form.php"); ?> glpi-0.84.3+dfsg.1/front/commonitiltask.form.php000066400000000000000000000051111226600447100214570ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ // autoload include in objecttask.form (tickettask, problemtask,...) if (!defined('GLPI_ROOT')) { die("Can not acces directly to this file"); } Session::checkCentralAccess(); if (!($task instanceof CommonITILTask)) { Html::displayErrorAndDie(''); } if (!$task->canView()) { Html::displayRightError(); } $itemtype = $task->getItilObjectItemType(); $fk = getForeignKeyFieldForItemType($itemtype); if (isset($_POST["add"])) { $task->check(-1, 'w', $_POST); $task->add($_POST); Event::log($task->getField($fk), strtolower($itemtype), 4, "tracking", //TRANS: %s is the user login sprintf(__('%s adds a task'), $_SESSION["glpiname"])); Html::redirect(Toolbox::getItemTypeFormURL($itemtype)."?id=".$task->getField($fk)); } else if (isset($_POST["delete"])) { $task->check($_POST['id'], 'd'); $task->delete($_POST); Event::log($task->getField($fk), strtolower($itemtype), 4, "tracking", //TRANS: %s is the user login sprintf(__('%s deletes a task'), $_SESSION["glpiname"])); Html::redirect(Toolbox::getItemTypeFormURL($itemtype)."?id=".$task->getField($fk)); } else if (isset($_POST["update"])) { $task->check($_POST["id"], 'w'); $task->update($_POST); Event::log($task->getField($fk), strtolower($itemtype), 4, "tracking", //TRANS: %s is the user login sprintf(__('%s updates a task'), $_SESSION["glpiname"])); Html::back(); } Html::displayErrorAndDie('Lost'); ?>glpi-0.84.3+dfsg.1/front/computer.form.php000066400000000000000000000064201226600447100202640ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("computer", "r"); if (!isset($_GET["id"])) { $_GET["id"] = ""; } if (!isset($_GET["withtemplate"])) { $_GET["withtemplate"] = ""; } $computer = new Computer(); //Add a new computer if (isset($_POST["add"])) { $computer->check(-1, 'w', $_POST); if ($newID = $computer->add($_POST)) { Event::log($newID, "computers", 4, "inventory", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); } Html::back(); // delete a computer } else if (isset($_POST["delete"])) { $computer->check($_POST['id'], 'd'); $ok = $computer->delete($_POST); if ($ok) { Event::log($_POST["id"], "computers", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s deletes an item'), $_SESSION["glpiname"])); } $computer->redirectToList(); } else if (isset($_POST["restore"])) { $computer->check($_POST['id'], 'd'); if ($computer->restore($_POST)) { Event::log($_POST["id"],"computers", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s restores an item'), $_SESSION["glpiname"])); } $computer->redirectToList(); } else if (isset($_POST["purge"])) { $computer->check($_POST['id'], 'd'); if ($computer->delete($_POST,1)) { Event::log($_POST["id"], "computers", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); } $computer->redirectToList(); //update a computer } else if (isset($_POST["update"])) { $computer->check($_POST['id'], 'w'); $computer->update($_POST); Event::log($_POST["id"], "computers", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); // Disconnect a computer from a printer/monitor/phone/peripheral } else {//print computer information Html::header(Computer::GetTypeName(2), $_SERVER['PHP_SELF'], "inventory", "computer"); //show computer form to add $computer->showForm($_GET["id"], array('withtemplate' => $_GET["withtemplate"])); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/computer.php000066400000000000000000000024561226600447100173270ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("computer", "r"); Html::header(Computer::GetTypeName(2), $_SERVER['PHP_SELF'], "inventory", "computer"); Search::show('Computer'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/computer_item.form.php000066400000000000000000000037551226600447100213120ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.84 */ include ('../inc/includes.php'); Session::checkCentralAccess(); $conn = new Computer_Item(); if (isset($_POST["disconnect"])) { $conn->check($_POST["id"], 'd'); $conn->delete($_POST); Event::log($_POST["computers_id"], "computers", 5, "inventory", //TRANS: %s is the user login sprintf(__('%s disconnects an item'), $_SESSION["glpiname"])); Html::back(); // Connect a computer to a printer/monitor/phone/peripheral } else if (isset($_POST["add"])) { if (isset($_POST["items_id"]) && ($_POST["items_id"] > 0)) { $conn->check(-1, 'w', $_POST); $conn->add($_POST); Event::log($_POST["computers_id"], "computers", 5, "inventory", //TRANS: %s is the user login sprintf(__('%s connects an item'), $_SESSION["glpiname"])); } Html::back(); } Html::displayErrorAndDie('Lost'); ?>glpi-0.84.3+dfsg.1/front/computer_softwarelicense.form.php000066400000000000000000000031511226600447100235370ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("software", "w"); $csl = new Computer_SoftwareLicense(); if (isset($_POST["add"])) { if ($_POST['softwarelicenses_id'] > 0 ) { $csl->add($_POST); Event::log($_POST['softwarelicenses_id'], "softwarelicense", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s associates a computer and a license'), $_SESSION["glpiname"])); } Html::back(); } Html::displayErrorAndDie('Lost'); ?> glpi-0.84.3+dfsg.1/front/computer_softwareversion.form.php000066400000000000000000000035331226600447100236060ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("software", "w"); $inst = new Computer_SoftwareVersion(); // From Computer - Software tab (add form) if (isset($_POST["add"])) { if (isset($_POST["computers_id"]) && $_POST["computers_id"] && isset($_POST["softwareversions_id"]) && $_POST["softwareversions_id"]) { $inst->add(array('computers_id' => $_POST["computers_id"], 'softwareversions_id' => $_POST["softwareversions_id"])); Event::log($_POST["computers_id"], "computers", 5, "inventory", //TRANS: %s is the user login sprintf(__('%s installs software'), $_SESSION["glpiname"])); } Html::back(); } Html::displayErrorAndDie('Lost'); ?>glpi-0.84.3+dfsg.1/front/computerdisk.form.php000066400000000000000000000053131226600447100211370ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkCentralAccess(); if (!isset($_GET["id"])) { $_GET["id"] = ""; } if (!isset($_GET["computers_id"])) { $_GET["computers_id"] = ""; } $disk = new ComputerDisk(); if (isset($_POST["add"])) { $disk->check(-1,'w',$_POST); if ($newID = $disk->add($_POST)) { Event::log($_POST['computers_id'], "computers", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s adds a volume'), $_SESSION["glpiname"])); } Html::back(); } else if (isset($_POST["delete"])) { $disk->check($_POST["id"],'d'); if ($disk->delete($_POST)) { Event::log($disk->fields['computers_id'], "computers", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s deletes a volume'), $_SESSION["glpiname"])); } $computer = new Computer(); $computer->getFromDB($disk->fields['computers_id']); Html::redirect(Toolbox::getItemTypeFormURL('Computer').'?id='.$disk->fields['computers_id']. ($computer->fields['is_template']?"&withtemplate=1":"")); } else if (isset($_POST["update"])) { $disk->check($_POST["id"],'w'); if ($disk->update($_POST)) { Event::log($disk->fields['computers_id'], "computers", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s updates a volume'), $_SESSION["glpiname"])); } Html::back(); } else { Html::header(Computer::getTypeName(2), $_SERVER['PHP_SELF'], "inventory", "computer"); $disk->showForm($_GET["id"], array('computers_id' => $_GET["computers_id"])); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/computermodel.form.php000066400000000000000000000023501226600447100213030ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new ComputerModel(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/computermodel.php000066400000000000000000000023401226600447100203400ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new ComputerModel(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/computertype.form.php000066400000000000000000000023471226600447100211720ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new ComputerType(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/computertype.php000066400000000000000000000023361226600447100202260ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new ComputerType(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/computervirtualmachine.form.php000066400000000000000000000053761226600447100232310ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkCentralAccess(); if (!isset($_GET["id"])) { $_GET["id"] = ""; } if (!isset($_GET["computers_id"])) { $_GET["computers_id"] = ""; } $disk = new ComputerVirtualMachine(); if (isset($_POST["add"])) { $disk->check(-1, 'w', $_POST); if ($newID = $disk->add($_POST)) { Event::log($_POST['computers_id'], "computers", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s adds a virtual machine'), $_SESSION["glpiname"])); } Html::back(); } else if (isset($_POST["delete"])) { $disk->check($_POST["id"], 'd'); if ($disk->delete($_POST)) { Event::log($disk->fields['computers_id'], "computers", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s deletes a virtual machine'), $_SESSION["glpiname"])); } $computer = new Computer(); $computer->getFromDB($disk->fields['computers_id']); Html::redirect(Toolbox::getItemTypeFormURL('Computer').'?id='.$disk->fields['computers_id']. ($computer->fields['is_template']?"&withtemplate=1":"")); } else if (isset($_POST["update"])) { $disk->check($_POST["id"], 'w'); if ($disk->update($_POST)) { Event::log($disk->fields['computers_id'], "computers", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s updates a virtual machine'), $_SESSION["glpiname"])); } Html::back(); } else { Html::header(Computer::getTypeName(2), $_SERVER['PHP_SELF'], "inventory", "computer"); $disk->showForm($_GET["id"], array('computers_id' => $_GET["computers_id"])); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/config.form.php000066400000000000000000000030101226600447100176630ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("config", "w"); $config = new Config(); if (!empty($_POST["update_auth"])) { $config->update($_POST); Html::back(); } if (!empty($_POST["update"])) { $config->update($_POST); Html::redirect(Toolbox::getItemTypeFormURL('Config')); } Html::header(Config::getTypeName(1), $_SERVER['PHP_SELF'], "config", "config"); $config->showForm(1); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/consumable.form.php000066400000000000000000000032561226600447100205620ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("consumable", "r"); $con = new Consumable(); $constype = new ConsumableItem(); if (isset($_POST["add_several"])) { $constype->check($_POST["consumableitems_id"],'w'); for ($i=0 ; $i<$_POST["to_add"] ; $i++) { unset($con->fields["id"]); $con->add($_POST); } Event::log($_POST["consumableitems_id"], "consumables", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s adds consumables'), $_SESSION["glpiname"])); Html::back(); } else { Html::back(); } ?> glpi-0.84.3+dfsg.1/front/consumableitem.form.php000066400000000000000000000060131226600447100214330ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("consumable", "r"); if (!isset($_GET["id"])) { $_GET["id"] = ""; } $constype = new ConsumableItem(); if (isset($_POST["add"])) { $constype->check(-1,'w',$_POST); if ($newID = $constype->add($_POST)) { Event::log($newID, "consumables", 4, "inventory", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); } Html::back(); } else if (isset($_POST["delete"])) { $constype->check($_POST["id"],'d'); if ($constype->delete($_POST)) { Event::log($_POST["id"], "consumables", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s deletes an item'), $_SESSION["glpiname"])); } $constype->redirectToList(); } else if (isset($_POST["restore"])) { $constype->check($_POST["id"],'d'); if ($constype->restore($_POST)) { Event::log($_POST["id"], "consumables", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s restores an item'), $_SESSION["glpiname"])); } $constype->redirectToList(); } else if (isset($_POST["purge"])) { $constype->check($_POST["id"],'d'); if ($constype->delete($_POST,1)) { Event::log($_POST["id"], "consumables", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); } $constype->redirectToList(); } else if (isset($_POST["update"])) { $constype->check($_POST["id"],'w'); if ($constype->update($_POST)) { Event::log($_POST["id"], "consumables", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); } Html::back(); } else { Html::header(_n('Consumable', 'Consumables', 2), $_SERVER['PHP_SELF'], "inventory", "consumable"); $constype->showForm($_GET["id"]); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/consumableitem.php000066400000000000000000000026161226600447100204760ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("consumable", "r"); Html::header(Consumable::getTypeName(2), $_SERVER['PHP_SELF'], "inventory", "consumable"); if (isset($_GET["synthese"])) { Consumable::showSummary(); } else { Search::show('ConsumableItem'); } Html::footer(); ?>glpi-0.84.3+dfsg.1/front/consumableitemtype.form.php000066400000000000000000000023631226600447100223410ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new ConsumableItemType(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/consumableitemtype.php000066400000000000000000000023521226600447100213750ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new ConsumableItemType(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/contact.form.php000066400000000000000000000062441226600447100200650ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("contact_enterprise", "r"); if (empty($_GET["id"])) { $_GET["id"] = -1; } $contact = new Contact(); if (isset($_GET['getvcard'])) { if ($_GET["id"] < 0) { Html::redirect($CFG_GLPI["root_doc"]."/front/contact.php"); } $contact->check($_GET["id"],'r'); $contact->generateVcard(); } else if (isset($_POST["add"])) { $contact->check(-1,'w',$_POST); if ($newID = $contact->add($_POST)) { Event::log($newID, "contacts", 4, "financial", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); } Html::back(); } else if (isset($_POST["delete"])) { $contact->check($_POST["id"],'d'); if ($contact->delete($_POST)) { Event::log($_POST["id"], "contacts", 4, "financial", //TRANS: %s is the user login sprintf(__('%s deletes an item'), $_SESSION["glpiname"])); } $contact->redirectToList(); } else if (isset($_POST["restore"])) { $contact->check($_POST["id"],'d'); if ($contact->restore($_POST)) { Event::log($_POST["id"], "contacts", 4, "financial", //TRANS: %s is the user login sprintf(__('%s restores an item'), $_SESSION["glpiname"])); } $contact->redirectToList(); } else if (isset($_POST["purge"])) { $contact->check($_POST["id"],'d'); if ($contact->delete($_POST,1)) { Event::log($_POST["id"], "contacts", 4, "financial", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); } $contact->redirectToList(); } else if (isset($_POST["update"])) { $contact->check($_POST["id"],'w'); if ($contact->update($_POST)) { Event::log($_POST["id"], "contacts", 4, "financial", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); } Html::back(); } else { Html::header(Contact::getTypeName(2), $_SERVER['PHP_SELF'], "financial", "contact"); $contact->showForm($_GET["id"]); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/contact.php000066400000000000000000000024651226600447100171240ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("contact_enterprise", "r"); Html::header(Contact::getTypeName(2), $_SERVER['PHP_SELF'], "financial", "contact"); Search::show('Contact'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/contact_supplier.form.php000066400000000000000000000034111226600447100220010ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.84 */ include ('../inc/includes.php'); Session::checkCentralAccess(); $contactsupplier = new Contact_Supplier(); if (isset($_POST["add"])) { $contactsupplier->check(-1,'w',$_POST); if (isset($_POST["contacts_id"]) && ($_POST["contacts_id"] > 0) && isset($_POST["suppliers_id"]) && ($_POST["suppliers_id"] > 0)) { if ($contactsupplier->add($_POST)) { Event::log($_POST["contacts_id"], "contacts", 4, "financial", //TRANS: %s is the user login sprintf(__('%s adds a link with a supplier'), $_SESSION["glpiname"])); } } Html::back(); } Html::displayErrorAndDie('Lost'); ?>glpi-0.84.3+dfsg.1/front/contacttype.form.php000066400000000000000000000023451226600447100207650ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new ContactType(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/contacttype.php000066400000000000000000000023341226600447100200210ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new ContactType(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/contract.form.php000066400000000000000000000062731226600447100202510ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("contract", "r"); if (!isset($_GET["id"])) { $_GET["id"] = -1; } if (!isset($_GET["withtemplate"])) { $_GET["withtemplate"] = ""; } $contract = new Contract(); $contractitem = new Contract_Item(); $contractsupplier = new Contract_Supplier(); if (isset($_POST["add"])) { $contract->check(-1,'w',$_POST); if ($newID = $contract->add($_POST)) { Event::log($newID, "contracts", 4, "financial", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); } Html::back(); } else if (isset($_POST["delete"])) { $contract->check($_POST['id'],'d'); if ($contract->delete($_POST)) { Event::log($_POST["id"], "contracts", 4, "financial", //TRANS: %s is the user login sprintf(__('%s deletes an item'), $_SESSION["glpiname"])); } $contract->redirectToList(); } else if (isset($_POST["restore"])) { $contract->check($_POST['id'],'d'); if ($contract->restore($_POST)) { Event::log($_POST["id"], "contracts", 4, "financial", //TRANS: %s is the user login sprintf(__('%s restores an item'), $_SESSION["glpiname"])); } $contract->redirectToList(); } else if (isset($_POST["purge"])) { $contract->check($_POST['id'],'d'); if ($contract->delete($_POST,1)) { Event::log($_POST["id"], "contracts", 4, "financial", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); } $contract->redirectToList(); } else if (isset($_POST["update"])) { $contract->check($_POST['id'],'w'); if ($contract->update($_POST)) { Event::log($_POST["id"], "contracts", 4, "financial", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); } Html::back(); } else { Html::header(Contract::getTypeName(2), $_SERVER['PHP_SELF'], "financial", "contract"); $contract->showForm($_GET["id"], array('withtemplate' => $_GET["withtemplate"])); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/contract.php000066400000000000000000000024561226600447100173060ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("contract", "r"); Html::header(Contract::getTypeName(2), $_SERVER['PHP_SELF'], "financial", "contract"); Search::show('Contract'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/contract_item.form.php000066400000000000000000000031361226600447100212620ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.84 */ include ('../inc/includes.php'); Session::checkCentralAccess(); $contract_item = new Contract_Item(); if (isset($_POST["add"])) { $contract_item->check(-1,'w',$_POST); if ($contract_item->add($_POST)) { Event::log($_POST["contracts_id"], "contracts", 4, "financial", //TRANS: %s is the user login sprintf(__('%s adds a link with an item'), $_SESSION["glpiname"])); } Html::back(); } Html::displayErrorAndDie("lost"); ?>glpi-0.84.3+dfsg.1/front/contract_supplier.form.php000066400000000000000000000034221226600447100221650ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.84 */ include ('../inc/includes.php'); Session::checkCentralAccess(); $contractsupplier = new Contract_Supplier(); if (isset($_POST["add"])) { $contractsupplier->check(-1,'w',$_POST); if (isset($_POST["contracts_id"]) && ($_POST["contracts_id"] > 0) && isset($_POST["suppliers_id"]) && ($_POST["suppliers_id"] > 0)) { if ($contractsupplier->add($_POST)) { Event::log($_POST["contracts_id"], "contracts", 4, "financial", //TRANS: %s is the user login sprintf(__('%s adds a link with a supplier'), $_SESSION["glpiname"])); } } Html::back(); } Html::displayErrorAndDie('Lost'); ?>glpi-0.84.3+dfsg.1/front/contractcost.form.php000066400000000000000000000050661226600447100211410ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.84 */ include ('../inc/includes.php'); Session::checkCentralAccess(); if (!isset($_GET["id"])) { $_GET["id"] = ""; } if (!isset($_GET["contracts_id"])) { $_GET["contracts_id"] = ""; } $cost = new ContractCost(); if (isset($_POST["add"])) { $cost->check(-1,'w',$_POST); if ($newID = $cost->add($_POST)) { Event::log($_POST['contracts_id'], "contracts", 4, "financial", //TRANS: %s is the user login sprintf(__('%s adds a cost'), $_SESSION["glpiname"])); } Html::back(); } else if (isset($_POST["delete"])) { $cost->check($_POST["id"],'d'); if ($cost->delete($_POST)) { Event::log($cost->fields['contracts_id'], "contracts", 4, "financial", //TRANS: %s is the user login sprintf(__('%s deletes a cost'), $_SESSION["glpiname"])); } $contract = new Contract(); $contract->getFromDB($cost->fields['contracts_id']); Html::redirect(Toolbox::getItemTypeFormURL('Contract').'?id='.$cost->fields['contracts_id']. ($contract->fields['is_template']?"&withtemplate=1":"")); } else if (isset($_POST["update"])) { $cost->check($_POST["id"],'w'); if ($cost->update($_POST)) { Event::log($cost->fields['contracts_id'], "contracts", 4, "financial", //TRANS: %s is the user login sprintf(__('%s updates a cost'), $_SESSION["glpiname"])); } Html::back(); } Html::displayErrorAndDie('Lost'); ?>glpi-0.84.3+dfsg.1/front/contracttype.form.php000066400000000000000000000023471226600447100211510ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new ContractType(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/contracttype.php000066400000000000000000000023361226600447100202050ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new ContractType(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/control.php000066400000000000000000000023111226600447100171370ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Html::redirect ($CFG_GLPI['root_doc'] . "/front/fieldunicity.php"); ?> glpi-0.84.3+dfsg.1/front/cron.php000066400000000000000000000056161226600447100164330ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ // Ensure current directory when run from crontab chdir(dirname($_SERVER["SCRIPT_FILENAME"])); define('DO_NOT_CHECK_HTTP_REFERER', 1); include ('../inc/includes.php'); if (!is_writable(GLPI_LOCK_DIR)) { //TRANS: %s is a directory echo "\t".sprintf(__('ERROR: %s is not writable')."\n", GLPI_LOCK_DIR); echo "\t".__('run script as apache user')."\n"; exit (1); } if (!isCommandLine()) { //The advantage of using background-image is that cron is called in a separate //request and thus does not slow down output of the main page as it would if called //from there. $image = pack("H*", "47494638396118001800800000ffffff00000021f90401000000002c0000000". "018001800000216848fa9cbed0fa39cb4da8bb3debcfb0f86e248965301003b"); header("Content-Type: image/gif"); header("Content-Length: ".strlen($image)); header("Cache-Control: no-cache,no-store"); header("Pragma: no-cache"); header("Connection: close"); echo $image; flush(); CronTask::launch(CronTask::MODE_INTERNAL); } else if (isset($_SERVER['argc']) && ($_SERVER['argc'] > 1)) { // Parse command line options $mode = CronTask::MODE_EXTERNAL; // when taskname given, will allow --force for ($i=1 ; $i<$_SERVER['argc'] ; $i++) { if ($_SERVER['argv'][$i] == '--force') { $mode = -CronTask::MODE_EXTERNAL; } else if (is_numeric($_SERVER['argv'][$i])) { // Number of tasks CronTask::launch(CronTask::MODE_EXTERNAL, intval($_SERVER['argv'][$i])); // Only check first parameter when numeric is passed break; } else { // Task name CronTask::launch($mode, $CFG_GLPI['cron_limit'], $_SERVER['argv'][$i]); } } } else { // Default from configuration CronTask::launch(CronTask::MODE_EXTERNAL, $CFG_GLPI['cron_limit']); } ?> glpi-0.84.3+dfsg.1/front/crontask.form.php000066400000000000000000000047211226600447100202540ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief Form to edit Cron Task */ include ('../inc/includes.php'); Session::checkRight("config", "w"); $crontask = new CronTask(); if (isset($_POST['execute'])) { if (is_numeric($_POST['execute'])) { // Execute button from list. $name = CronTask::launch(CronTask::MODE_INTERNAL, intval($_POST['execute'])); } else { // Execute button from Task form (force) $name = CronTask::launch(-CronTask::MODE_INTERNAL, 1, $_POST['execute']); } if ($name) { //TRANS: %s is a task name Session::addMessageAfterRedirect(sprintf(__('Task %s executed'), $name)); } Html::back(); } else if (isset($_POST["update"])) { Session::checkRight('config', 'w'); $crontask->update($_POST); Html::back(); } else if (isset($_POST['resetdate']) && isset($_POST["id"])) { Session::checkRight('config', 'w'); if ($crontask->getFromDB($_POST["id"])) { $crontask->resetDate(); } Html::back(); } else if (isset($_POST['resetstate']) && isset($_POST["id"])) { Session::checkRight('config', 'w'); if ($crontask->getFromDB($_POST["id"])) { $crontask->resetState(); } Html::back(); }else { if (!isset($_GET["id"]) || empty($_GET["id"])) { exit(); } Html::header(Crontask::getTypeName(2), $_SERVER['PHP_SELF'], 'config', 'crontask'); $crontask->showForm($_GET["id"]); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/crontask.php000066400000000000000000000036751226600447100173210ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief Search engine from cron tasks */ include ('../inc/includes.php'); Session::checkRight("config", "w"); Html::header(Crontask::getTypeName(2), $_SERVER['PHP_SELF'], 'config', 'crontask'); $crontask = new CronTask(); if ($crontask->getNeedToRun(CronTask::MODE_INTERNAL)) { $name = sprintf(__('%1$s %2$s'), $crontask->fields['name'], Html::getSimpleForm($crontask->getFormURL(), array('execute' => $crontask->fields['name']), __('Execute'))); Html::displayTitle($CFG_GLPI['root_doc'].'/pics/warning.png', __('Next run'), sprintf(__('Next task to run: %s'), $name)); } else { Html::displayTitle($CFG_GLPI['root_doc'].'/pics/ok.png', __('No action pending'), __('No action pending')); } Search::show('CronTask'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/device.php000066400000000000000000000027331226600447100167260ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("device", "w"); Html::header(_n('Component', 'Components', 2), $_SERVER['PHP_SELF'], "config", "device"); echo "
"; $optgroup = Dropdown::getDeviceItemTypes(); Dropdown::showItemTypeMenu(_n('Component', 'Components', 2), $optgroup); Dropdown::showItemTypeList($optgroup); echo "
"; Html::footer(); ?>glpi-0.84.3+dfsg.1/front/devicecase.form.php000066400000000000000000000023431226600447100205210ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DeviceCase(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/devicecase.php000066400000000000000000000023321226600447100175550ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DeviceCase(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/devicecasetype.form.php000066400000000000000000000023521226600447100214230ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DeviceCaseType(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/devicecasetype.php000066400000000000000000000023411226600447100204570ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DeviceCaseType(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/devicecontrol.form.php000066400000000000000000000023501226600447100212640ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DeviceControl(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/devicecontrol.php000066400000000000000000000023371226600447100203270ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DeviceControl(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/devicedrive.form.php000066400000000000000000000023441226600447100207200ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DeviceDrive(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/devicedrive.php000066400000000000000000000023331226600447100177540ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DeviceDrive(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/devicegraphiccard.form.php000066400000000000000000000023601226600447100220540ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DeviceGraphicCard(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/devicegraphiccard.php000066400000000000000000000023471226600447100211170ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DeviceGraphicCard(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/deviceharddrive.form.php000066400000000000000000000023541226600447100215600ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DeviceHardDrive(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/deviceharddrive.php000066400000000000000000000023431226600447100206140ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DeviceHardDrive(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/devicememory.form.php000066400000000000000000000023461226600447100211210ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DeviceMemory(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/devicememory.php000066400000000000000000000023351226600447100201550ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DeviceMemory(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/devicememorytype.form.php000066400000000000000000000023561226600447100220240ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DeviceMemoryType(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/devicememorytype.php000066400000000000000000000023451226600447100210600ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DeviceMemoryType(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/devicemotherboard.form.php000066400000000000000000000023601226600447100221130ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DeviceMotherboard(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/devicemotherboard.php000066400000000000000000000023471226600447100211560ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DeviceMotherboard(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/devicenetworkcard.form.php000066400000000000000000000023601226600447100221300ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DeviceNetworkCard(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/devicenetworkcard.php000066400000000000000000000023471226600447100211730ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DeviceNetworkCard(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/devicepci.form.php000066400000000000000000000023401226600447100203560ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DevicePci(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/devicepci.php000066400000000000000000000023271226600447100174210ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DevicePci(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/devicepowersupply.form.php000066400000000000000000000023601226600447100222160ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DevicePowerSupply(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/devicepowersupply.php000066400000000000000000000023471226600447100212610ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DevicePowerSupply(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/deviceprocessor.form.php000066400000000000000000000023541226600447100216270ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DeviceProcessor(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/deviceprocessor.php000066400000000000000000000023431226600447100206630ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DeviceProcessor(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/devicesoundcard.form.php000066400000000000000000000023541226600447100215720ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DeviceSoundCard(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/devicesoundcard.php000066400000000000000000000023431226600447100206260ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DeviceSoundCard(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/dictionnary.php000066400000000000000000000132711226600447100200110ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkSeveralRightsOr(array('rule_dictionnary_dropdown' => 'r', 'rule_dictionnary_software' => 'r')); Html::header(__('Administration'), $_SERVER['PHP_SELF'], "admin", "dictionnary", -1); echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
" . __('Dictionaries') . "
"; echo ""; if (Session::haveRight("rule_dictionnary_software","r")) { echo ""; } if (Session::haveRight("rule_dictionnary_dropdown","r")) { echo ""; } if (Session::haveRight("rule_dictionnary_printer","r")) { echo ""; } echo "
".__('Global dictionary')."
"; echo "" . _n('Software','Software',2) ."
"; echo "" . _n('Manufacturer','Manufacturers',2) . "
"; echo "" . _n('Printer','Printers',2) ."
"; if (Session::haveRight("rule_dictionnary_dropdown","r")) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
"._n('Model','Models',2)."
". "" . _n('Computer model','Computer models',2) . "
". "" . _n('Monitor model','Monitor models',2) . "
". "" . _n('Printer model','Printer models',2) . "
". "" . _n('Device model','Device models',2) . "
". "". _n('Network equipment model', 'Network equipment models',2) . "
". "" . _n('Phone model','Phone models',2) . "
"; if (Session::haveRight("rule_dictionnary_dropdown","r")) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
"._n('Type','Types',2)."
". "" . _n('Computer type','Computer types',2) . "
". "" . _n('Monitor type','Monitor types',2) . "
". "" . _n('Printer type','Printer types',2) . "
". "" . _n('Device type','Device types',2) . "
". "". _n('Network equipment type', 'Network equipment types',2) . "
". "" . _n('Phone type','Phone types',2) . "
"; if (Session::haveRight("rule_dictionnary_dropdown","r")) { echo ""; echo ""; echo ""; echo ""; } echo "
"._n('Operating system','Operating systems',2)."
". "". _n('Operating system','Operating systems',2)."
". "". _n('Service pack', 'Service packs',2)."
". "" . _n('Version','Versions',2) . "
"; Html::footer(); ?>glpi-0.84.3+dfsg.1/front/display.options.php000066400000000000000000000032111226600447100206160ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.84 */ if (!defined('GLPI_ROOT')) { include ('../inc/includes.php'); } if (!isset($_GET['itemtype'])) { Html::displayErrorAndDie("lost"); } $itemtype = $_GET['itemtype']; if (!isset($_GET["sub_itemtype"])) { $_GET["sub_itemtype"] = ''; } if ($item = getItemForItemtype($itemtype)) { if (isset($_GET['update']) || isset($_GET['reset'])) { $item->updateDisplayOptions($_GET, $_GET["sub_itemtype"]); } $item->checkGlobal('r'); $item->showDislayOptions($_GET["sub_itemtype"]); Html::ajaxFooter(); } ?>glpi-0.84.3+dfsg.1/front/displaypreference.form.php000066400000000000000000000044461226600447100221400ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { include ('../inc/includes.php'); } if (!strpos($_SERVER['PHP_SELF'],"popup")) { Html::header(__('Setup'), $_SERVER['PHP_SELF'], "config", "display"); } Session::checkSeveralRightsOr(array("search_config_global" => "w", "search_config" => "w")); $setupdisplay = new DisplayPreference(); if (isset($_POST["activate"])) { $setupdisplay->activatePerso($_POST); } else if (isset($_POST["add"])) { $setupdisplay->add($_POST); } else if (isset($_POST["delete"]) || isset($_POST["delete_x"])) { $setupdisplay->delete($_POST); } else if (isset($_POST["up"]) || isset($_POST["up_x"])) { $setupdisplay->orderItem($_POST,'up'); } else if (isset($_POST["down"]) || isset($_POST["down_x"])) { $setupdisplay->orderItem($_POST,'down'); } // Datas may come from GET or POST : use REQUEST if ((strpos($_SERVER['PHP_SELF'],"popup") && $_REQUEST["itemtype"])) { $setupdisplay->showTabs(array('displaytype' => $_REQUEST['itemtype'])); echo "
 
"; echo ""; } if (!strpos($_SERVER['PHP_SELF'],"popup")) { Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/document.form.php000066400000000000000000000056741226600447100202560ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkLoginUser(); if (!isset($_GET["id"])) { $_GET["id"] = -1; } $doc = new Document(); $documentitem = new Document_Item(); if (isset($_POST["add"])) { $doc->check(-1,'w',$_POST); if ($newID = $doc->add($_POST)) { Event::log($newID, "documents", 4, "login", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $doc->fields["name"])); } Html::back(); } else if (isset($_POST["delete"])) { $doc->check($_POST["id"],'d'); if ($doc->delete($_POST)) { Event::log($_POST["id"], "documents", 4, "document", //TRANS: %s is the user login sprintf(__('%s deletes an item'), $_SESSION["glpiname"])); } $doc->redirectToList(); } else if (isset($_POST["restore"])) { $doc->check($_POST["id"],'d'); if ($doc->restore($_POST)) { Event::log($_POST["id"], "documents", 4, "document", //TRANS: %s is the user login sprintf(__('%s restores an item'), $_SESSION["glpiname"])); } $doc->redirectToList(); } else if (isset($_POST["purge"])) { $doc->check($_POST["id"],'d'); if ($doc->delete($_POST,1)) { Event::log($_POST["id"], "documents", 4, "document", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); } $doc->redirectToList(); } else if (isset($_POST["update"])) { $doc->check($_POST["id"],'w'); if ($doc->update($_POST)) { Event::log($_POST["id"], "documents", 4, "document", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); } Html::back(); } else { Html::header(Document::getTypeName(2), $_SERVER['PHP_SELF'], "financial","document"); $doc->showForm($_GET["id"]); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/document.php000066400000000000000000000024561226600447100173070ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("document", "r"); Html::header(Document::getTypeName(2), $_SERVER['PHP_SELF'], "financial", "document"); Search::show('Document'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/document.send.php000066400000000000000000000050071226600447100202320ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); if (!$CFG_GLPI["use_public_faq"]) { Session::checkLoginUser(); } $doc = new Document(); if (isset($_GET['docid'])) { // docid for document if (!$doc->getFromDB($_GET['docid'])) { Html::displayErrorAndDie(__('Unknown file'), true); } if (!file_exists(GLPI_DOC_DIR."/".$doc->fields['filepath'])) { Html::displayErrorAndDie(__('File not found'), true); // Not found } else if ($doc->canViewFile($_GET)) { if ($doc->fields['sha1sum'] && $doc->fields['sha1sum'] != sha1_file(GLPI_DOC_DIR."/".$doc->fields['filepath'])) { Html::displayErrorAndDie(__('File is altered (bad checksum)'), true); // Doc alterated } else { $doc->send(); } } else { Html::displayErrorAndDie(__('Unauthorized access to this file'), true); // No right } } else if (isset($_GET["file"])) { // for other file $splitter = explode("/",$_GET["file"]); if (count($splitter) == 2) { $send = false; if (($splitter[0] == "_dumps") && Session::haveRight("backup","w")) { $send = true; } if ($send && file_exists(GLPI_DOC_DIR."/".$_GET["file"])) { Toolbox::sendFile(GLPI_DOC_DIR."/".$_GET["file"], $splitter[1]); } else { Html::displayErrorAndDie(__('Unauthorized access to this file'), true); } } else { Html::displayErrorAndDie(__('Invalid filename'), true); } } ?>glpi-0.84.3+dfsg.1/front/document_item.form.php000066400000000000000000000031351226600447100212620ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.84 */ include ('../inc/includes.php'); Session::checkCentralAccess(); $document_item = new Document_Item(); if (isset($_POST["add"])) { $document_item->check(-1,'w',$_POST); if ($document_item->add($_POST)) { Event::log($_POST["documents_id"], "documents", 4, "document", //TRANS: %s is the user login sprintf(__('%s adds a link with an item'), $_SESSION["glpiname"])); } Html::back(); } Html::displayErrorAndDie("lost"); ?>glpi-0.84.3+dfsg.1/front/documentcategory.form.php000066400000000000000000000023561226600447100220060ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DocumentCategory(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/documentcategory.php000066400000000000000000000023451226600447100210420ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DocumentCategory(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/documenttype.form.php000066400000000000000000000023471226600447100211520ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DocumentType(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/documenttype.list.php000066400000000000000000000025031226600447100211540ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkLoginUser(); Html::popHeader(__('Setup'),$_SERVER['PHP_SELF']); Search::manageGetValues('DocumentType'); Search::showList('DocumentType',$_GET); Html::popFooter(); ?>glpi-0.84.3+dfsg.1/front/documenttype.php000066400000000000000000000023351226600447100202050ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new DocumentType(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/domain.form.php000066400000000000000000000023321226600447100176730ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new Domain(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/domain.php000066400000000000000000000023211226600447100167270ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new Domain(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/dropdown.common.form.php000066400000000000000000000105331226600447100215510ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!($dropdown instanceof CommonDropdown)) { Html::displayErrorAndDie(''); } if (!$dropdown->canView()) { // Gestion timeout session if (!Session::getLoginUserID()) { Html::redirect($CFG_GLPI["root_doc"] . "/index.php"); exit(); } Html::displayRightError(); } if (isset($_POST["id"])) { $_GET["id"] = $_POST["id"]; } else if (!isset($_GET["id"])) { $_GET["id"] = -1; } if (isset($_POST["add"])) { $dropdown->check(-1,'w',$_POST); if ($newID=$dropdown->add($_POST)) { $dropdown->refreshParentInfos(); if ($dropdown instanceof CommonDevice) { Event::log($newID, get_class($dropdown), 4, "inventory", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["designation"])); } else { Event::log($newID, get_class($dropdown), 4, "setup", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); } } Html::back(); } else if (isset($_POST["delete"])) { $dropdown->check($_POST["id"],'d'); if ($dropdown->isUsed() && empty($_POST["forcedelete"])) { Html::header($dropdown->getTypeName(1), $_SERVER['PHP_SELF'], "config", $dropdown->second_level_menu, str_replace('glpi_','',$dropdown->getTable())); $dropdown->showDeleteConfirmForm($_SERVER['PHP_SELF']); Html::footer(); } else { $dropdown->delete($_POST, 1); $dropdown->refreshParentInfos(); Event::log($_POST["id"], get_class($dropdown), 4, "setup", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); $dropdown->redirectToList(); } } else if (isset($_POST["replace"])) { $dropdown->check($_POST["id"],'d'); $dropdown->delete($_POST, 1); $dropdown->refreshParentInfos(); Event::log($_POST["id"], get_class($dropdown), 4, "setup", //TRANS: %s is the user login sprintf(__('%s replaces an item'), $_SESSION["glpiname"])); $dropdown->redirectToList(); } else if (isset($_POST["update"])) { $dropdown->check($_POST["id"],'w'); $dropdown->update($_POST); $dropdown->refreshParentInfos(); Event::log($_POST["id"], get_class($dropdown), 4, "setup", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } else if (isset($_POST['execute']) && isset($_POST['_method'])) { $method = 'execute'.$_POST['_method']; if (method_exists($dropdown, $method)) { call_user_func(array(&$dropdown, $method), $_POST); Html::back(); } else { Html::displayErrorAndDie(__('No selected element or badly defined operation')); } } else if (isset($_GET['popup'])) { Html::popHeader($dropdown->getTypeName(1),$_SERVER['PHP_SELF']); if (isset($_GET["rand"])) { $_SESSION["glpipopup"]["rand"] = $_GET["rand"]; } $dropdown->showForm($_GET["id"]); echo ""; Html::popFooter(); } else { $dropdown->displayHeader(); if (!isset($options)) { $options = array(); } $dropdown->showForm($_GET["id"],$options); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/dropdown.common.php000066400000000000000000000027631226600447100206150ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!($dropdown instanceof CommonDropdown)) { Html::displayErrorAndDie(''); } if (!$dropdown->canView()) { // Gestion timeout session if (!Session::getLoginUserID()) { Html::redirect($CFG_GLPI["root_doc"] . "/index.php"); exit(); } Html::displayRightError(); } $dropdown->displayHeader(); $dropdown->title(); Search::show(get_class($dropdown)); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/dropdown.php000066400000000000000000000027111226600447100173170ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session ::checkLoginUser(); Html::header(__('Setup'),$_SERVER['PHP_SELF'],"config","dropdowns"); echo "
"; $optgroup = Dropdown::getStandardDropdownItemTypes(); Dropdown::showItemTypeMenu(_n('Dropdown', 'Dropdowns', 2), $optgroup); Dropdown::showItemTypeList($optgroup); echo "
"; Html::footer(); ?>glpi-0.84.3+dfsg.1/front/entity.form.php000066400000000000000000000025721226600447100177460ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new Entity(); // Root entity : no delete if (isset($_GET['id']) && ($_GET['id'] == 0)) { $options = array('canedit' => true, 'candel' => false); } include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/entity.php000066400000000000000000000023211226600447100167740ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new Entity(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/event.php000066400000000000000000000031351226600447100166050ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ // Based on: // IRMA, Information Resource-Management and Administration // Christian Bauer /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("logs", "r"); Html::header(Event::getTypeName(2), $_SERVER['PHP_SELF'], "admin", "log"); // Show last events if (isset($_GET["order"])) { if (!isset($_GET["start"])) { $_GET["start"] = 0; } Event::showList($_SERVER['PHP_SELF'], $_GET["order"], $_GET["sort"], $_GET["start"]); } else { Event::showList($_SERVER['PHP_SELF']); } Html::footer(); ?> glpi-0.84.3+dfsg.1/front/fieldblacklist.form.php000066400000000000000000000023521226600447100214020ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new Fieldblacklist(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/fieldblacklist.php000066400000000000000000000023411226600447100204360ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new Fieldblacklist(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/fieldunicity.form.php000066400000000000000000000023461226600447100211210ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new FieldUnicity(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/fieldunicity.php000066400000000000000000000025171226600447100201570ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight('config', 'r'); Html::header(FieldUnicity::getTypeName(2), $_SERVER['PHP_SELF'], "config", "control", "FieldUnicity"); Search::show('FieldUnicity'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/filesystem.form.php000066400000000000000000000023421226600447100206110ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new Filesystem(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/filesystem.php000066400000000000000000000023311226600447100176450ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new Filesystem(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/find_num.php000066400000000000000000000133511226600447100172640ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); if (!$CFG_GLPI["use_anonymous_helpdesk"]) { exit(); } // Send UTF8 Headers header("Content-Type: text/html; charset=UTF-8"); ?> GLPI "; // Appel javascript echo ""; ?> "; echo "

".__('Search the ID of your hardware')."

"; echo " "; echo ""; echo ""; echo "
".__('Enter the first letters (user, item name, serial or asset number)'). "
"; echo ""; echo ""; // bug IE ! La validation par enter ne fonctionne pas sans cette ligne incroyable mais vrai ! echo ""; echo "
"; Html::closeForm(); echo ""; if (isset($_POST["send"])) { echo ""; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; $types = array('Computer' => __('Computer'), 'NetworkEquipment' => __('Network device'), 'Printer' => __('Printer'), 'Monitor' => __('Monitor'), 'Peripheral' => __('Device')); foreach ($types as $type => $label) { $query = "SELECT `name`, `id`, `contact`, `serial`, `otherserial` FROM `".getTableForItemType($type)."` WHERE `is_template` = '0' AND `is_deleted` = '0' AND (`contact` LIKE '%".$_POST["NomContact"]."%' OR `name` LIKE '%".$_POST["NomContact"]."%' OR `serial` LIKE '%".$_POST["NomContact"]."%' OR `otherserial` LIKE '%".$_POST["NomContact"]."%') ORDER BY `name`"; $result = $DB->query($query); while ($ligne = $DB->fetch_assoc($result)) { $Comp_num = $ligne['id']; $Contact = $ligne['contact']; $Computer = $ligne['name']; $s1 = $ligne['serial']; $s2 = $ligne['otherserial']; echo " "; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } } $query = "SELECT `name`, `id` FROM `glpi_softwares` WHERE `is_template` = '0' AND `is_deleted` = '0' AND (`name` LIKE '%".$_POST["NomContact"]."%' ) ORDER BY `name`"; $result = $DB->query($query); while ($ligne = $DB->fetch_assoc($result)) { $Comp_num = $ligne['id']; $Computer = $ligne['name']; echo " "; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
".__('Alternate username')."".__('Hardware type')."".__('Associated element')."".__('ID')."".__('Serial number')."".__('Inventory number')."
 $Contact  $label  $Computer  $Comp_num  $s1  $s2 "; echo "
  "._n('Software', 'Software', 1)."  $Computer  $Comp_num  
"; } echo ''; ?> glpi-0.84.3+dfsg.1/front/fqdn.form.php000066400000000000000000000023261226600447100173570ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new FQDN(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/fqdn.php000066400000000000000000000023151226600447100164130ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new FQDN(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/graph.send.php000066400000000000000000000033121226600447100175120ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session ::checkLoginUser(); if (isset($_GET["switchto"])) { $_SESSION['glpigraphtype'] = $_GET["switchto"]; Html::back(); } if (($uid = Session::getLoginUserID(false)) && isset($_GET["file"])) { list($userID,$filename) = explode("_",$_GET["file"]); if (($userID == $uid) && file_exists(GLPI_GRAPH_DIR."/".$_GET["file"])) { list($fname,$extension)=explode(".",$filename); Toolbox::sendFile(GLPI_GRAPH_DIR."/".$_GET["file"], 'glpi.'.$extension); } else { Html::displayErrorAndDie(__('Unauthorized access to this file'), true); } } ?>glpi-0.84.3+dfsg.1/front/group.form.php000066400000000000000000000052061226600447100175630ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("group", "r"); if (empty($_GET["id"])) { $_GET["id"] = ""; } $group = new Group(); $groupuser = new Group_User(); if (isset($_POST["add"])) { $group->check(-1,'w',$_POST); if ($newID=$group->add($_POST)) { Event::log($newID, "groups", 4, "setup", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); } Ajax::refreshDropdownPopupInMainWindow(); Html::back(); } else if (isset($_POST["delete"])) { $group->check($_POST["id"],'d'); $group->delete($_POST); Event::log($_POST["id"], "groups", 4, "setup", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); $group->redirectToList(); } else if (isset($_POST["update"])) { $group->check($_POST["id"],'w'); $group->update($_POST); Event::log($_POST["id"], "groups", 4, "setup", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } else if (isset($_GET['popup'])) { Html::popHeader(Group::getTypeName(2),$_SERVER['PHP_SELF']); if (isset($_GET["rand"])) { $_SESSION["glpipopup"]["rand"] = $_GET["rand"]; } $group->showForm($_GET["id"]); echo ""; Html::popFooter(); } else { Html::header(Group::getTypeName(2), $_SERVER['PHP_SELF'], "admin", "group"); $group->showForm($_GET["id"]); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/group.php000066400000000000000000000025031226600447100166160ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("group", "r"); Html::header(Group::getTypeName(2), $_SERVER['PHP_SELF'], "admin", "group"); $group = new Group(); $group->title(); Search::show('Group'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/group_user.form.php000066400000000000000000000031021226600447100206120ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since vesion 0.84 */ include ('../inc/includes.php'); Session::checkCentralAccess(); $group_user = new Group_User(); if (isset($_POST["add"])) { $group_user->check(-1,'w',$_POST); if ($group_user->add($_POST)) { Event::log($_POST["groups_id"], "groups", 4, "setup", //TRANS: %s is the user login sprintf(__('%s adds a user to a group'), $_SESSION["glpiname"])); } Html::back(); } Html::displayErrorAndDie("lost"); ?>glpi-0.84.3+dfsg.1/front/helpdesk.faq.php000066400000000000000000000042061226600447100200310ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); // Redirect management if (isset($_GET["redirect"])) { Toolbox::manageRedirect($_GET["redirect"]); } //******************* // Affichage Module FAQ //****************** $name = ""; Session:: checkFaqAccess(); if (Session::getLoginUserID()) { Html::helpHeader(__('FAQ'), $_SERVER['PHP_SELF'], $_SESSION["glpiname"]); } else { $_SESSION["glpilanguage"] = $CFG_GLPI['language']; // Anonymous FAQ Html::simpleHeader(__('FAQ'), array(__('Authentication') => $CFG_GLPI['root_doc'].'/', __('FAQ') => $CFG_GLPI['root_doc'].'/front/helpdesk.faq.php')); } if (isset($_GET["id"])) { $kb = new KnowbaseItem(); if ($kb->getFromDB($_GET["id"])) { $kb->showFull(false); } } else { // Manage forcetab : non standard system (file name <> class name) if (isset($_GET['forcetab'])) { Session::setActiveTab('Knowbase', $_GET['forcetab']); unset($_GET['forcetab']); } $kb = new Knowbase(); $kb->show($_GET); } Html::helpFooter(); ?>glpi-0.84.3+dfsg.1/front/helpdesk.html000066400000000000000000000006611226600447100174410ustar00rootroot00000000000000 Helpdesk glpi-0.84.3+dfsg.1/front/helpdesk.php000066400000000000000000000062701226600447100172660ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ ?> Helpdesk

Formulaire de signalement au support technique

Le problème doit être résolu Sélectionnez un niveau d'urgence :
Décrivez votre problème Titre :

glpi-0.84.3+dfsg.1/front/helpdesk.public.php000066400000000000000000000103631226600447100205410ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); // Change profile system if (isset($_POST['newprofile'])) { if (isset($_SESSION["glpiprofiles"][$_POST['newprofile']])) { Session::changeProfile($_POST['newprofile']); if ($_SESSION["glpiactiveprofile"]["interface"] == "central") { Html::redirect($CFG_GLPI['root_doc']."/front/central.php"); } else { Html::redirect($_SERVER['PHP_SELF']); } } else { Html::redirect(preg_replace("/entities_id=.*/","",$_SERVER['HTTP_REFERER'])); } } // Manage entity change if (isset($_GET["active_entity"])) { if (!isset($_GET["is_recursive"])) { $_GET["is_recursive"] = 0; } if (Session::changeActiveEntities($_GET["active_entity"],$_GET["is_recursive"])) { if ($_GET["active_entity"] == $_SESSION["glpiactive_entity"]) { Html::redirect(preg_replace("/entities_id.*/","",$_SERVER['HTTP_REFERER'])); } } } // Redirect management if (isset($_GET["redirect"])) { Toolbox::manageRedirect($_GET["redirect"]); } // redirect if no create ticket right if (!Session::haveRight('create_ticket',1)) { if (Session::haveRight('observe_ticket',1) || Session::haveRight('validate_request',1) || Session::haveRight('validate_incident',1)) { Html::redirect($CFG_GLPI['root_doc']."/front/ticket.php"); } else if (Session::haveRight('reservation_helpdesk',1)) { Html::redirect($CFG_GLPI['root_doc']."/front/reservationitem.php"); } else if (Session::haveRight('faq','r')) { Html::redirect($CFG_GLPI['root_doc']."/front/helpdesk.faq.php"); } } Session::checkHelpdeskAccess(); if (isset($_GET['create_ticket'])) { Html::helpHeader(__('New ticket'), $_SERVER['PHP_SELF'], $_SESSION["glpiname"]); $ticket = new Ticket(); $ticket->showFormHelpdesk(Session::getLoginUserID()); } else { Html::helpHeader(__('Home'), $_SERVER['PHP_SELF'], $_SESSION["glpiname"]); echo ""; echo ""; echo ""; echo "

"; echo ""; if (Session::haveRight('create_ticket',1)) { echo ""; } if (Session::haveRight("reminder_public","r")) { echo ""; } if (Session::haveRight("rssfeed_public","r")) { echo ""; } echo "
"; Ticket::showCentralCount(true); echo "
"; Reminder::showListForCentral(false); echo "
"; RSSFeed::showListForCentral(false); echo "

"; echo ""; // Show KB items if (Session::haveRight("faq","r")) { echo ""; echo ""; echo ""; } else { echo ""; } echo "
"; KnowbaseItem::showRecentPopular("popular"); echo "

"; KnowbaseItem::showRecentPopular("recent"); echo "

"; KnowbaseItem::showRecentPopular("lastupdate"); echo "
 
"; echo "
"; } Html::helpFooter(); ?>glpi-0.84.3+dfsg.1/front/holiday.form.php000077500000000000000000000023351226600447100200630ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new Holiday(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/holiday.php000077500000000000000000000023231226600447100171160ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new Holiday(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/index.php000066400000000000000000000021401226600447100165660ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ ?> glpi-0.84.3+dfsg.1/front/infocom.form.php000066400000000000000000000052271226600447100200640ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $ic = new Infocom(); if (isset($_POST['add'])) { $ic->check(-1, 'w', $_POST); $newID = $ic->add($_POST, false); Event::log($newID, "infocom", 4, "financial", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $newID)); Html::back(); } else if (isset($_POST["delete"])) { $ic->check($_POST["id"],'d'); $ic->delete($_POST); Event::log($_POST["id"], "infocom", 4, "financial", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); Html::back(); } else if (isset($_POST["update"])) { $ic->check($_POST["id"],'w'); $ic->update($_POST); Event::log($_POST["id"], "infocom", 4, "financial", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } else { Session::checkRight("infocom", "r"); Html::popHeader(Infocom::getTypeName(), $_SERVER['PHP_SELF']); if (isset($_GET["id"])) { $ic->getFromDB($_GET["id"]); $_GET["itemtype"] = $ic->fields["itemtype"]; $_GET["items_id"] = $ic->fields["items_id"]; } $item = false; if (isset($_GET["itemtype"]) && ($item = getItemForItemtype($_GET["itemtype"]))) { if (!isset($_GET["items_id"]) || !$item->getFromDB($_GET["items_id"])) { $item = false; } } if (isset($_GET["update"]) && ($_GET["update"] == 1)) { $withtemplate = 0; } else { $withtemplate = 2; } Infocom::showForItem($item, $withtemplate); Html::popFooter(); } ?>glpi-0.84.3+dfsg.1/front/interfacetype.form.php000066400000000000000000000023501226600447100212660ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new InterfaceType(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/interfacetype.php000066400000000000000000000023371226600447100203310ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new InterfaceType(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/ipnetwork.form.php000066400000000000000000000031031226600447100204430ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); if (isset($_POST['reinit_network'])) { if (Session::haveRight('internet', 'w') // Check access to all entities && Session::isViewAllEntities()) { IPNetwork::recreateTree(); Session::addMessageAfterRedirect(__('Successfully recreated network tree')); Html::back(); } else { Html::displayRightError(); } } $dropdown = new IPNetwork(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/ipnetwork.php000066400000000000000000000023271226600447100175100ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new IPNetwork(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/ipnetwork_vlan.form.php000066400000000000000000000032371226600447100214730ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.84 */ include ('../inc/includes.php'); Session::checkCentralAccess(); $npv = new IPNetwork_Vlan(); if (isset($_POST["add"])) { $npv->check(-1,'w',$_POST); if (isset($_POST["vlans_id"]) && ($_POST["vlans_id"] > 0)) { $npv->assignVlan($_POST["ipnetworks_id"], $_POST["vlans_id"]); Event::log(0, "ipnetwork", 5, "inventory", //TRANS: %s is the user login sprintf(__('%s associates a VLAN to a network port'), $_SESSION["glpiname"])); } Html::back(); } Html::displayErrorAndDie('Lost'); ?>glpi-0.84.3+dfsg.1/front/item_devices.form.php000066400000000000000000000032601226600447100210650ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.84 */ include ('../inc/includes.php'); Session::checkCentralAccess(); if (isset($_POST["add"])) { if (isset($_POST['devicetype'])) { if ($link = getItemForItemtype('Item_'.$_POST['devicetype'])) { $link->addDevices(1, $_POST['itemtype'], $_POST['items_id'], $_POST['devices_id']); } } Html::back(); } else if (isset($_POST["updateall"])) { Item_Devices::updateAll($_POST, false); Html::back(); } else if (isset($_POST["delete"])) { Item_Devices::updateAll($_POST, true); Html::back(); } Html::displayErrorAndDie('Lost'); ?>glpi-0.84.3+dfsg.1/front/item_problem.form.php000066400000000000000000000030471226600447100211060ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session ::checkLoginUser(); $item = new Item_Problem(); if (isset($_POST["add"])) { $item->check(-1, 'w', $_POST); if ($item->add($_POST)) { Event::log($_POST["problems_id"], "problem", 4, "tracking", //TRANS: %s is the user login sprintf(__('%s adds a link with an item'), $_SESSION["glpiname"])); } Html::back(); } Html::displayErrorAndDie("lost"); ?>glpi-0.84.3+dfsg.1/front/itilcategory.form.php000066400000000000000000000023471226600447100211310ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new ITILCategory(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/itilcategory.php000066400000000000000000000023351226600447100201640ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new ITILCategory(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/knowbaseitem.form.php000066400000000000000000000130331226600447100211140ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); if (!isset($_GET["id"])) { $_GET["id"] = ""; } if (!isset($_GET["item_itemtype"])) { $_GET["item_itemtype"] = ""; } if (!isset($_GET["item_items_id"])) { $_GET["item_items_id"] = ""; } if (!isset($_GET["modify"])) { $_GET["modify"] = ""; } $kb = new KnowbaseItem(); if (isset($_POST["add"])) { // ajoute un item dans la base de connaisssances $kb->check(-1,'w',$_POST); $newID = $kb->add($_POST); Event::log($newID, "knowbaseitem", 5, "tools", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $newID)); Html::redirect($CFG_GLPI["root_doc"]."/front/knowbaseitem.php"); } else if (isset($_POST["update"])) { // actualiser un item dans la base de connaissances $kb->check($_POST["id"],'w'); $kb->update($_POST); Event::log($_POST["id"], "knowbaseitem", 5, "tools", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::redirect($CFG_GLPI["root_doc"]."/front/knowbaseitem.form.php?id=".$_POST['id']); } else if (isset($_POST["delete"])) { // effacer un item dans la base de connaissances $kb->check($_POST["id"],'d'); $kb->delete($_POST); Event::log($_POST["id"], "knowbaseitem", 5, "tools", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); $kb->redirectToList(); } else if (isset($_POST["addvisibility"])) { if (isset($_POST["_type"]) && !empty($_POST["_type"]) && isset($_POST["knowbaseitems_id"]) && $_POST["knowbaseitems_id"]) { $item = NULL; switch ($_POST["_type"]) { case 'User' : if (isset($_POST['users_id']) && $_POST['users_id']) { $item = new KnowbaseItem_User(); } break; case 'Group' : if (isset($_POST['groups_id']) && $_POST['groups_id']) { $item = new Group_KnowbaseItem(); } break; case 'Profile' : if (isset($_POST['profiles_id']) && $_POST['profiles_id']) { $item = new KnowbaseItem_Profile(); } break; case 'Entity' : $item = new Entity_KnowbaseItem(); break; } if (!is_null($item)) { $item->add($_POST); Event::log($_POST["knowbaseitems_id"], "knowbaseitem", 4, "tools", //TRANS: %s is the user login sprintf(__('%s adds a target'), $_SESSION["glpiname"])); } } Html::back(); } else if ($_GET["id"] == "new") { // on affiche le formulaire de saisie de l'item $kb->check(-1,'w'); Html::header(KnowbaseItem::getTypeName(1), $_SERVER['PHP_SELF'], "utils", "knowbase"); $available_options = array('item_itemtype', 'item_items_id'); $options = array(); foreach ($available_options as $key) { if (isset($_GET[$key])) { $options[$key] = $_GET[$key]; } } $kb->showForm("",$options); Html::footer(); } else if (empty($_GET["id"])) { // No id or no tickets id to create from solution Html::redirect($CFG_GLPI["root_doc"]."/front/knowbaseitem.php"); } else if (isset($_GET["id"]) && ($_GET["modify"] == "yes")) { // modifier un item dans la base de connaissance $kb->check($_GET["id"],'r'); Html::header(KnowbaseItem::getTypeName(1), $_SERVER['PHP_SELF'], "utils", "knowbase"); $kb->showForm($_GET["id"]); Html::footer(); } else { // Affiche un item de la base de connaissances $kb->check($_GET["id"],'r'); if (Session::getLoginUserID()) { if ($_SESSION["glpiactiveprofile"]["interface"] == "central") { Html::header(KnowbaseItem::getTypeName(1), $_SERVER['PHP_SELF'], "utils", "knowbase"); } else { Html::helpHeader(__('FAQ'), $_SERVER['PHP_SELF']); } Html::helpHeader(__('FAQ'), $_SERVER['PHP_SELF'], $_SESSION["glpiname"]); } else { $_SESSION["glpilanguage"] = $CFG_GLPI['language']; // Anonymous FAQ Html::simpleHeader(__('FAQ'), array(__('Authentication') => $CFG_GLPI['root_doc'].'/', __('FAQ') => $CFG_GLPI['root_doc'].'/front/helpdesk.faq.php')); } $kb->showFull(true); if (Session::getLoginUserID()) { if ($_SESSION["glpiactiveprofile"]["interface"] == "central") { Html::footer(); } else { Html::helpFooter(); } } else { Html::helpFooter(); } } ?>glpi-0.84.3+dfsg.1/front/knowbaseitem.php000066400000000000000000000040031226600447100201470ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkSeveralRightsOr(array('knowbase' => 'r', 'faq' => 'r')); if (isset($_GET["id"])) { Html::redirect($CFG_GLPI["root_doc"]."/front/knowbaseitem.form.php?id=".$_GET["id"]); } Html::header(KnowbaseItem::getTypeName(1), $_SERVER['PHP_SELF'], "utils", "knowbase"); // Search a solution if (!isset($_GET["contains"]) && isset($_GET["item_itemtype"]) && isset($_GET["item_items_id"])) { if ($item = getItemForItemtype($_GET["item_itemtype"])) { if ($item->getFromDB($_GET["item_items_id"])) { $_GET["contains"] = addslashes($item->getField('name')); } } } // Manage forcetab : non standard system (file name <> class name) if (isset($_GET['forcetab'])) { Session::setActiveTab('Knowbase', $_GET['forcetab']); unset($_GET['forcetab']); } $kb = new Knowbase(); $kb->show($_GET); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/knowbaseitemcategory.form.php000066400000000000000000000023661226600447100226610ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new KnowbaseItemCategory(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/knowbaseitemcategory.php000066400000000000000000000023551226600447100217150ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new KnowbaseItemCategory(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/ldap.group.import.php000066400000000000000000000064171226600447100210560ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $group = new Group(); $group->checkGlobal('w'); Session::checkRight('user_authtype', 'w'); Html::header(__('LDAP directory link'), $_SERVER['PHP_SELF'], "admin", "group", "ldap"); if (isset($_GET['next'])) { AuthLdap::ldapChooseDirectory($_SERVER['PHP_SELF']); } else { if (isset($_POST["change_ldap_filter"])) { if (isset($_POST["ldap_filter"])) { $_SESSION["ldap_group_filter"] = $_POST["ldap_filter"]; } if (isset($_POST["ldap_filter2"])) { $_SESSION["ldap_group_filter2"] = $_POST["ldap_filter2"]; } Html::redirect($_SERVER['PHP_SELF']); } else { if (!isset($_GET['start'])) { $_GET['start'] = 0; } if (isset($_SESSION["ldap_import"])) { unset($_SESSION["ldap_import"]); } if (!isset($_SESSION["ldap_server"])) { if (isset($_POST["ldap_server"])) { $_SESSION["ldap_server"] = $_POST["ldap_server"]; } else { Html::redirect($CFG_GLPI["root_doc"]."/front/ldap.php"); } } if (!AuthLdap::testLDAPConnection($_SESSION["ldap_server"])) { unset($_SESSION["ldap_server"]); echo "
".__('Unable to connect to the LDAP directory')."
"; echo "".__('Back')."
"; } else { if (!isset($_SESSION["ldap_group_filter"])) { $_SESSION["ldap_group_filter"] = ''; } if (!isset($_SESSION["ldap_group_filter2"])) { $_SESSION["ldap_group_filter2"] = ''; } if (isset($_GET["order"])) { $_SESSION["ldap_sortorder"] = $_GET["order"]; } if (!isset($_SESSION["ldap_sortorder"])) { $_SESSION["ldap_sortorder"] = "ASC"; } AuthLdap::displayLdapFilter($_SERVER['PHP_SELF'], false); AuthLdap::showLdapGroups($_SERVER['PHP_SELF'], $_GET['start'], 0, $_SESSION["ldap_group_filter"], $_SESSION["ldap_group_filter2"], $_SESSION["glpiactive_entity"], $_SESSION["ldap_sortorder"]); } } } Html::footer(); ?>glpi-0.84.3+dfsg.1/front/ldap.group.php000066400000000000000000000043601226600447100175400ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $group = new Group(); $group->checkGlobal('w'); Session::checkRight('user_authtype', 'w'); Html::header(__('LDAP directory link'), $_SERVER['PHP_SELF'], "admin", "group", "ldap"); if (isset($_SESSION["ldap_import"])) { unset($_SESSION["ldap_import"]); } if (isset($_SESSION["ldap_import_entities"])) { unset($_SESSION["ldap_import_entities"]); } if (isset($_SESSION["ldap_server"])) { unset($_SESSION["ldap_server"]); } if (isset($_SESSION["entity"])) { unset($_SESSION["entity"]); } if (isset($_SESSION["ldap_sortorder"])) { unset($_SESSION["ldap_sortorder"]); } //Reset session variable related to filters if (isset($_SESSION["ldap_group_filter"])) { unset($_SESSION["ldap_group_filter"]); } if (isset($_SESSION["ldap_group_filter2"])) { unset($_SESSION["ldap_group_filter2"]); } echo "
"; echo ""; echo ""; echo "
".__('Bulk import groups from a LDAP directory')."
". "". __('Import of new groups')."
"; Html::footer(); ?>glpi-0.84.3+dfsg.1/front/ldap.import.php000066400000000000000000000045711226600447100177220ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { include ('../inc/includes.php'); } Session::checkRight("import_externalauth_users", 'w'); // Need REQUEST to manage initial walues and posted ones AuthLdap::manageValuesInSession($_REQUEST); if (isset($_SESSION['ldap_import']['popup']) && $_SESSION['ldap_import']['popup']) { Html::popHeader(__('LDAP directory link'), $_SERVER['PHP_SELF']); } else { Html::header(__('LDAP directory link'), $_SERVER['PHP_SELF'], "admin", "user", "ldap"); } if (isset($_GET['start'])) { $_SESSION['ldap_import']['start'] = $_GET['start']; } if (isset($_GET['order'])) { $_SESSION['ldap_import']['order'] = $_GET['order']; } if ($_SESSION['ldap_import']['action'] == 'show') { $authldap = new AuthLDAP(); $authldap->getFromDB($_SESSION['ldap_import']['authldaps_id']); AuthLdap::showUserImportForm($authldap); if (isset($_SESSION['ldap_import']['authldaps_id']) && ($_SESSION['ldap_import']['authldaps_id'] != NOT_AVAILABLE) && isset($_SESSION['ldap_import']['criterias']) && !empty($_SESSION['ldap_import']['criterias'])) { echo "
"; AuthLdap::searchUser($authldap); } } if (isset($_SESSION['ldap_import']['popup']) && $_SESSION['ldap_import']['popup']) { Html::ajaxFooter(); } else { Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/ldap.php000066400000000000000000000036001226600447100164010ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("import_externalauth_users", 'w'); Html::header(__('LDAP directory link'), $_SERVER['PHP_SELF'], "admin", "user", "ldap"); if (isset($_SESSION["ldap_sortorder"])) { unset($_SESSION["ldap_sortorder"]); } AuthLdap::manageValuesInSession(array(),true); echo "
"; echo ""; echo ""; echo ""; echo "
".__('Bulk import users from a LDAP directory')."
". "". __('Synchronizing already imported users'). "
". "". __('Import new users')."
"; Html::footer(); ?>glpi-0.84.3+dfsg.1/front/link.form.php000066400000000000000000000043441226600447100173660ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("link", "r"); if (empty($_GET["id"])) { $_GET["id"] = ""; } $link = new Link(); if (isset($_POST["add"])) { $link->check(-1,'w'); $newID = $link->add($_POST); Event::log($newID, "links", 4, "setup", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); Html::redirect(Toolbox::getItemTypeFormURL('Link')."?id=".$newID); } else if (isset($_POST["delete"])) { $link->check($_POST["id"],'d'); $link->delete($_POST); Event::log($_POST["id"], "links", 4, "setup", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); $link->redirectToList(); } else if (isset($_POST["update"])) { $link->check($_POST["id"],'w'); $link->update($_POST); Event::log($_POST["id"], "links", 4, "setup", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } else { Html::header(Link::getTypeName(2), $_SERVER['PHP_SELF'], "config", "link"); $link->showForm($_GET["id"]); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/link.php000066400000000000000000000024271226600447100164240ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("link", "r"); Html::header(Link::getTypeName(2), $_SERVER['PHP_SELF'], "config", "link"); Search::show('Link'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/link.send.php000066400000000000000000000056571226600447100173640ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("link", "r"); if (isset($_GET["lID"])) { $query = "SELECT `glpi_links`.`id`, `glpi_links`.`link`, `glpi_links`.`data` FROM `glpi_links` WHERE `glpi_links`.`id` = '".$_GET["lID"]."'"; $result = $DB->query($query); if ($DB->numrows($result) == 1) { $file = $DB->result($result,0,"data"); $link = $DB->result($result,0,"link"); if ($item = getItemForItemtype($_GET["itemtype"])) { if ($item->getFromDB($_GET["id"])) { $content_filename = Link::generateLinkContents($link, $item); $content_data = Link::generateLinkContents($file, $item); if (isset($_GET['rank']) && isset($content_filename[$_GET['rank']])) { $filename = $content_filename[$_GET['rank']]; } else { // first one (the same for all IP) $filename = reset($content_filename); } if (isset($_GET['rank']) && isset($content_data[$_GET['rank']])) { $data = $content_data[$_GET['rank']]; } else { // first one (probably missing arg) $data = reset($content_data); } header("Content-disposition: filename=\"$filename\""); $mime = "application/scriptfile"; header("Content-type: ".$mime); header('Pragma: no-cache'); header('Expires: 0'); // Pour que les \x00 ne devienne pas \0 $mc = Toolbox::get_magic_quotes_runtime(); if ($mc) { @set_magic_quotes_runtime(0); } // May have several values due to network datas : use only first one echo $data; if ($mc) { @set_magic_quotes_runtime($mc); } } } } } ?>glpi-0.84.3+dfsg.1/front/link_itemtype.form.php000066400000000000000000000031561226600447100213060ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkCentralAccess(); $link = new Link(); $link_itemtype = new Link_ItemType(); if (isset($_POST["add"])) { $link->check(-1,'w', $_POST); if ($link_itemtype->add($_POST)) { Event::log($_POST["links_id"], "links", 4, "setup", //TRANS: %s is the user login sprintf(__('%s adds a link with an item'), $_SESSION["glpiname"])); } Html::redirect($CFG_GLPI["root_doc"]."/front/link.form.php?id=".$_POST["links_id"]); } ?> glpi-0.84.3+dfsg.1/front/location.form.php000066400000000000000000000023361226600447100202400ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new Location(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/location.php000066400000000000000000000023251226600447100172740ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new Location(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/lock.form.php000066400000000000000000000041761226600447100173640ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.84 */ include ('../inc/includes.php'); if (isset($_POST['itemtype']) && isset($_POST["unlock"])) { $itemtype = $_POST['itemtype']; $source_item = new $itemtype(); if ($source_item->canCreate()) { $source_item->check($_POST['id'], 'w'); $actions = array("Computer_Item", "Computer_SoftwareLicense", "Computer_SoftwareVersion", "ComputerDisk", "ComputerVirtualMachine", "NetworkPort", "NetworkName", "IPAddress"); $devices = Item_Devices::getDeviceTypes(); $actions = array_merge($actions, array_values($devices)); foreach ($actions as $type) { if (isset($_POST[$type]) && count($_POST[$type])) { $item = new $type(); foreach ($_POST[$type] as $key => $val) { //Force unlock $item->restore(array('id' => $key)); } } } } } //Execute hook to unlock fields managed by a plugin, if needed Plugin::doHookFunction('unlock_fields', $_POST); Html::back(); ?>glpi-0.84.3+dfsg.1/front/lostpassword.php000066400000000000000000000036001226600447100202250ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); if (!$CFG_GLPI['use_mailing'] || !countElementsInTable('glpi_notifications', "`itemtype`='User' AND `event`='passwordforget' AND `is_active`=1")) { exit(); } $user = new User(); // Manage lost password Html::simpleHeader(__('Forgotten password?')); // REQUEST needed : GET on first access / POST on submit form if (isset($_REQUEST['password_forget_token'])) { if (isset($_POST['email'])) { $user->updateForgottenPassword($_REQUEST); } else { User::showPasswordForgetChangeForm($_REQUEST['password_forget_token']); } } else { if (isset($_POST['email'])) { $user->forgetPassword($_POST['email']); } else { User::showPasswordForgetRequestForm(); } } Html::nullFooter(); exit(); ?>glpi-0.84.3+dfsg.1/front/mailcollector.form.php000066400000000000000000000046441226600447100212650ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("config", "r"); if (!isset($_GET["id"])) { $_GET["id"] = ""; } $mailgate = new MailCollector(); if (isset($_POST["add"])) { $mailgate->check(-1,'w',$_POST); $newID = $mailgate->add($_POST); Event::log($newID, "mailcollector", 4, "setup", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); Html::back(); } else if (isset($_POST["delete"])) { $mailgate->check($_POST['id'],'d'); $mailgate->delete($_POST); Event::log($_POST["id"], "mailcollector", 4, "setup", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); $mailgate->redirectToList(); } else if (isset($_POST["update"])) { $mailgate->check($_POST['id'],'w'); $mailgate->update($_POST); Event::log($_POST["id"], "mailcollector", 4, "setup", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } else if (isset($_POST["get_mails"])) { $mailgate->check($_POST['id'],'w'); $mailgate->collect($_POST["id"],1); Html::back(); } else { Html::header(MailCollector::getTypeName(2), $_SERVER['PHP_SELF'], "config", "mailcollector"); $mailgate->showForm($_GET["id"]); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/mailcollector.php000066400000000000000000000034351226600447100203200ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("config", "w"); Html::header(MailCollector::getTypeName(2), $_SERVER['PHP_SELF'], "config","mailcollector"); if (!Toolbox::canUseImapPop()) { echo "
"; echo ""; echo ""; echo ""; echo "
" . _n('Receiver', 'Receivers', 2)."
" . __('Your PHP parser was compiled without the IMAP functions'); echo "
"; echo "
"; Html::footer(); exit(); } else { $mailcollector = new MailCollector(); $mailcollector->title(); Search::show('MailCollector'); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/manufacturer.form.php000066400000000000000000000023461226600447100211250ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new Manufacturer(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/manufacturer.php000066400000000000000000000023351226600447100201610ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new Manufacturer(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/massiveaction.php000066400000000000000000000120431226600447100203270ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkCentralAccess(); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); if (isset($_GET['multiple_actions'])) { if (isset($_SESSION['glpi_massiveaction']) && isset($_SESSION['glpi_massiveaction']['POST'])) { $_POST = $_SESSION['glpi_massiveaction']['POST']; } } if (!isset($_POST["itemtype"]) || !($item = getItemForItemtype($_POST["itemtype"])) || !isset($_POST['is_deleted'])) { exit(); } $checkitem = NULL; if (isset($_POST['check_itemtype'])) { if (!($checkitem = getItemForItemtype($_POST['check_itemtype']))) { exit(); } if (isset($_POST['check_items_id'])) { if (!$checkitem->getFromDB($_POST['check_items_id'])) { exit(); } } } $actions = $item->getAllMassiveActions($_POST['is_deleted'], $checkitem); if (!isset($_POST['specific_action']) || !$_POST['specific_action']) { if (!isset($actions[$_POST['action']])) { Html::displayRightError(); exit(); } } else { // No standard massive action for specific one if (isset($actions[$_POST['action']])) { Html::displayRightError(); exit(); } } Html::header(__('Bulk modification'), $_SERVER['PHP_SELF']); if (isset($_GET['multiple_actions'])) { if (isset($_SESSION['glpi_massiveaction']) && isset($_SESSION['glpi_massiveaction']['items'])) { $percent = min(100,round(100*($_SESSION['glpi_massiveaction']['item_count'] - count($_SESSION['glpi_massiveaction']['items'])) /$_SESSION['glpi_massiveaction']['item_count'],0)); Html::displayProgressBar(400, $percent); } } if (isset($_POST["action"]) && isset($_POST["itemtype"]) && isset($_POST["item"]) && count($_POST["item"])) { /// Save selection if (!isset($_SESSION['glpimassiveactionselected'][$_POST["itemtype"]]) || (count($_SESSION['glpimassiveactionselected'][$_POST["itemtype"]]) == 0)) { $_SESSION['glpimassiveactionselected'][$_POST["itemtype"]] = array(); foreach ($_POST["item"] as $key => $val) { if ($val == 1) { $_SESSION['glpimassiveactionselected'][$_POST["itemtype"]][$key] = $key; } } } if (isset($_SERVER['HTTP_REFERER'])) { $REDIRECT = $_SERVER['HTTP_REFERER']; } else { /// Security : not used if no problem $REDIRECT = $CFG_GLPI['root_doc']."/front/central.php"; } $nbok = 0; $nbnoright = 0; $nbko = 0; $res = $item->doMassiveActions($_POST); if (is_array($res) && isset($res['ok']) && isset($res['ko']) && isset($res['noright'])) { $nbok = $res['ok']; $nbko = $res['ko']; $nbnoright = $res['noright']; } else { if ($res) { $nbok++; } else { $nbko++; } } if (isset($res['REDIRECT'])) { $REDIRECT = $res['REDIRECT']; } // Default message : all ok $message = __('Operation successful'); // All failed. operations failed if ($nbok == 0) { $message = __('Failed operation'); if ($nbnoright) { //TRANS: %$1d and %$2d are numbers $message .= "
".sprintf(__('(%1$d authorizations problems, %2$d failures)'), $nbnoright, $nbko); } } else if ($nbnoright || $nbko) { // Partial success $message = __('Operation performed partially successful'); $message .= "
".sprintf(__('(%1$d authorizations problems, %2$d failures)'), $nbnoright, $nbko); } Session::addMessageAfterRedirect($message); Html::redirect($REDIRECT); } else { //action, itemtype or item not defined echo "
". "".__s(

"; echo "".__('No selected element or badly defined operation')."
"; Html::displayBackLink(); echo "
"; } Html::footer(); ?>glpi-0.84.3+dfsg.1/front/migration_cleaner.php000066400000000000000000000044741226600447100211550ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkSeveralRightsOr(array("networking" => "w", "internet" => "w")); if (!TableExists('glpi_networkportmigrations')) { Session::addMessageAfterRedirect(__('You don\'t need the "migration cleaner" tool anymore...')); Html::redirect($CFG_GLPI["root_doc"]."/front/central.php"); } Html::header(__('Migration cleaner'), $_SERVER['PHP_SELF'], "utils","migration"); echo "
"; echo ""; echo ""; if (Session::haveRight('internet', 'w') // Check access to all entities && Session::isViewAllEntities()) { echo ""; } if (Session::haveRight('networking', 'w')) { echo ""; } echo "
" . __('"Migration cleaner" tool') . "
"; Html::showSimpleForm(IPNetwork::getFormURL(), 'reinit_network', __('Reinit the network topology')); echo "
"; echo "". __('Clean the network port migration errors') . ""; echo "
"; echo "
"; Html::footer(); ?>glpi-0.84.3+dfsg.1/front/monitor.form.php000066400000000000000000000065541226600447100201250ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("monitor", "r"); if (empty($_GET["id"])) { $_GET["id"] = ""; } if (!isset($_GET["withtemplate"])) { $_GET["withtemplate"] = ""; } $monitor = new Monitor(); if (isset($_POST["add"])) { $monitor->check(-1,'w',$_POST); $newID = $monitor->add($_POST); Event::log($newID, "monitors", 4, "inventory", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); Html::back(); } else if (isset($_POST["delete"])) { $monitor->check($_POST["id"],'d'); $monitor->delete($_POST); Event::log($_POST["id"], "monitors", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s deletes an item'), $_SESSION["glpiname"])); $monitor->redirectToList(); } else if (isset($_POST["restore"])) { $monitor->check($_POST["id"],'d'); $monitor->restore($_POST); Event::log($_POST["id"], "monitors", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s restores an item'), $_SESSION["glpiname"])); $monitor->redirectToList(); } else if (isset($_POST["purge"])) { $monitor->check($_POST["id"],'d'); $monitor->delete($_POST,1); Event::log($_POST["id"], "monitors", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); $monitor->redirectToList(); } else if (isset($_POST["update"])) { $monitor->check($_POST["id"],'w'); $monitor->update($_POST); Event::log($_POST["id"], "monitors", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } else if (isset($_POST["unglobalize"])) { $monitor->check($_POST["id"],'w'); Computer_Item::unglobalizeItem($monitor); Event::log($_POST["id"], "monitors", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s sets unitary management'), $_SESSION["glpiname"])); Html::redirect($CFG_GLPI["root_doc"]."/front/monitor.form.php?id=".$_POST["id"]); } else { Html::header(Monitor::getTypeName(2), $_SERVER['PHP_SELF'], "inventory", "monitor"); $monitor->showForm($_GET["id"], array('withtemplate' => $_GET["withtemplate"])); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/monitor.php000066400000000000000000000024511226600447100171530ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("monitor", "r"); Html::header(Monitor::getTypeName(2), $_SERVER['PHP_SELF'], "inventory", "monitor"); Search::show('Monitor'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/monitormodel.form.php000066400000000000000000000023461226600447100211410ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new MonitorModel(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/monitormodel.php000066400000000000000000000023351226600447100201750ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new MonitorModel(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/monitortype.form.php000066400000000000000000000023441226600447100210200ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new MonitorType(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/monitortype.php000066400000000000000000000023331226600447100200540ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new MonitorType(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/netpoint.form.php000066400000000000000000000023361226600447100202700ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new Netpoint(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/netpoint.php000066400000000000000000000023251226600447100173240ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new Netpoint(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/network.form.php000066400000000000000000000023341226600447100201170ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new Network(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/network.php000066400000000000000000000023231226600447100171530ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new Network(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/networkalias.form.php000066400000000000000000000055601226600447100211350ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $alias = new NetworkAlias(); if (!isset($_GET["id"])) { $_GET["id"] = -1; } if (empty($_GET["networknames_id"])) { $_GET["networknames_id"] = ""; } if (isset($_POST["add"])) { $alias->check(-1,'w',$_POST); if ($newID=$alias->add($_POST)) { Ajax::refreshPopupTab(); Event::log($newID, $alias->getType(), 4, "setup", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); } Html::back(); } else if (isset($_POST["delete"])) { $alias->check($_POST['id'], 'd'); $item = $alias->getItem(); $alias->delete($_POST); Event::log($_POST["id"], $alias->getType(), 4, "setup", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); if ($item) { Html::redirect($item->getLinkURL()); } else { Html::redirect($CFG_GLPI['root_doc']."/front/central.php"); } } else if (isset($_POST["update"])) { $alias->check($_POST["id"],'w'); $alias->update($_POST); Ajax::refreshPopupMainWindow(); Event::log($_POST["id"], $alias->getType(), 4, "setup", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } if (isset($_GET['popup'])) { Html::popHeader(NetworkAlias::getTypeName(1), $_SERVER['PHP_SELF']); if (isset($_GET["rand"])) { $_SESSION["glpipopup"]["rand"]=$_GET["rand"]; } $alias->showForm($_GET["id"], $_GET); echo ""; Html::popFooter(); } else { Html::header(NetworkAlias::getTypeName(2), $_SERVER['PHP_SELF'], 'inventory'); $alias->showForm($_GET["id"],$_GET); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/networkequipment.form.php000066400000000000000000000061111226600447100220440ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("networking", "r"); if (!isset($_GET["id"])) { $_GET["id"] = ""; } if (!isset($_GET["withtemplate"])) { $_GET["withtemplate"] = ""; } $netdevice = new NetworkEquipment(); if (isset($_POST["add"])) { $netdevice->check(-1,'w',$_POST); $newID = $netdevice->add($_POST); Event::log($newID, "networkequipment", 4, "inventory", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); Html::back(); } else if (isset($_POST["delete"])) { $netdevice->check($_POST["id"],'d'); $netdevice->delete($_POST); Event::log($_POST["id"], "networkequipment", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s deletes an item'), $_SESSION["glpiname"])); $netdevice->redirectToList(); } else if (isset($_POST["restore"])) { $netdevice->check($_POST["id"],'d'); $netdevice->restore($_POST); Event::log($_POST["id"], "networkequipment", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s restores an item'), $_SESSION["glpiname"])); $netdevice->redirectToList(); } else if (isset($_POST["purge"])) { $netdevice->check($_POST["id"],'d'); $netdevice->delete($_POST,1); Event::log($_POST["id"], "networkequipment", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); $netdevice->redirectToList(); } else if (isset($_POST["update"])) { $netdevice->check($_POST["id"],'w'); $netdevice->update($_POST); Event::log($_POST["id"], "networkequipment", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } else { Html::header(NetworkEquipment::getTypeName(2), $_SERVER['PHP_SELF'], "inventory", "networking"); $netdevice->showForm($_GET["id"], array('withtemplate' => $_GET["withtemplate"])); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/networkequipment.php000066400000000000000000000025121226600447100211030ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("networking", "r"); Html::header(NetworkEquipment::getTypeName(2), $_SERVER['PHP_SELF'], "inventory", "networking"); Search::show('NetworkEquipment'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/networkequipmentfirmware.form.php000066400000000000000000000023761226600447100236120ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new NetworkEquipmentFirmware(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/networkequipmentfirmware.php000066400000000000000000000023651226600447100226460ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new NetworkEquipmentFirmware(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/networkequipmentmodel.form.php000066400000000000000000000023701226600447100230700ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new NetworkEquipmentModel(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/networkequipmentmodel.php000066400000000000000000000023571226600447100221330ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new NetworkEquipmentModel(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/networkequipmenttype.form.php000066400000000000000000000023661226600447100227560ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new NetworkEquipmentType(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/networkequipmenttype.php000066400000000000000000000023551226600447100220120ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new NetworkEquipmentType(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/networkinterface.form.php000066400000000000000000000023561226600447100220040ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new NetworkInterface(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/networkinterface.php000066400000000000000000000023451226600447100210400ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new NetworkInterface(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/networkname.form.php000066400000000000000000000073751226600447100207720ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $nn = new NetworkName(); if (isset($_POST["add"])) { $nn->check(-1, 'w', $_POST); $newID = $nn->add($_POST); Event::log($newID, "networkname", 5, "inventory", //TRANS: %s is the user login sprintf(__('%s adds an item'), $_SESSION["glpiname"])); Html::back(); } else if (isset($_POST["delete"])) { $nn->check($_POST['id'], 'd'); $nn->delete($_POST); Event::log($_POST["id"], "networkname", 5, "inventory", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); if ($node = getItemForItemtype($nn->fields["itemtype"])) { if ($node->can($nn->fields["items_id"], 'r')) { Html::redirect($node->getLinkURL()); } } $nn->redirectToList(); } else if (isset($_POST["update"])) { $nn->check($_POST['id'], 'w'); $nn->update($_POST); Event::log($_POST["id"], "networkname", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } else if (isset($_POST["unaffect"])) { $nn->check($_POST['id'], 'w'); $nn->unaffectAddressByID($_POST['id']); Event::log($_POST["id"], "networkname", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); if ($node = getItemForItemtype($nn->fields["itemtype"])) { if ($node->can($nn->fields["items_id"], 'r')) { Html::redirect($node->getLinkURL()); } } $nn->redirectToList(); } else if (isset($_POST['assign_address'])) { // From NetworkPort or NetworkEquipement $nn->check($_POST['addressID'],'w'); if ((!empty($_POST['itemtype'])) && (!empty($_POST['items_id']))) { if ($node = getItemForItemtype($_POST['itemtype'])) { $node->check($_POST['items_id'],'w'); } NetworkName::affectAddress($_POST['addressID'], $_POST['items_id'], $_POST['itemtype']); Event::log(0, "networkport", 5, "inventory", //TRANS: %s is the user login sprintf(__('%s associates a network name to an item'), $_SESSION["glpiname"])); Html::back(); } else { Html::displayNotFoundError(); } } else { if (!isset($_GET["id"])) { $_GET["id"] = ""; } if (empty($_GET["items_id"])) { $_GET["items_id"] = ""; } if (empty($_GET["itemtype"])) { $_GET["itemtype"] = ""; } Session::checkRight("internet","w"); Html::header(NetworkName::getTypeName(2), $_SERVER['PHP_SELF'], 'config', 'dropdowns', 'NetworkName'); $nn->showForm($_GET["id"], $_GET); Html::footer(); } ?> glpi-0.84.3+dfsg.1/front/networkname.php000066400000000000000000000025261226600447100200210ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("internet","r"); Html::header(NetworkName::getTypeName(2), $_SERVER['PHP_SELF'], 'config', 'dropdowns', 'NetworkName'); Search::show('NetworkName'); Html::footer(); ?> glpi-0.84.3+dfsg.1/front/networkport.form.php000066400000000000000000000103571226600447100210300ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.84 */ include ('../inc/includes.php'); $np = new NetworkPort(); $nn = new NetworkPort_NetworkPort(); $npv = new NetworkPort_Vlan(); if (!isset($_GET["id"])) { $_GET["id"] = ""; } if (isset($_POST["add"])) { // Is a preselected mac adress selected ? if (isset($_POST['pre_mac'])) { if (!empty($_POST['pre_mac'])) { $_POST['mac'] = $_POST['pre_mac']; } unset($_POST['pre_mac']); } if (!isset($_POST["several"])) { $np->check(-1, 'w', $_POST); $np->splitInputForElements($_POST); $newID = $np->add($_POST); $np->updateDependencies(1); Event::log($newID, "networkport", 5, "inventory", //TRANS: %s is the user login sprintf(__('%s adds an item'), $_SESSION["glpiname"])); Html::back(); } else { Session::checkRight("networking", "w"); $input = $_POST; unset($input['several']); unset($input['from_logical_number']); unset($input['to_logical_number']); for ($i=$_POST["from_logical_number"] ; $i<=$_POST["to_logical_number"] ; $i++) { $add = ""; if ($i < 10) { $add = "0"; } $input["logical_number"] = $i; $input["name"] = $_POST["name"].$add.$i; unset($np->fields["id"]); if ($np->can(-1, 'w', $input)) { $np->splitInputForElements($input); $np->add($input); $np->updateDependencies(1); } } Event::log(0, "networkport", 5, "inventory", //TRANS: %s is the user login sprintf(__('%s adds several network ports'), $_SESSION["glpiname"])); Html::back(); } } else if (isset($_POST["delete"])) { $np->check($_POST['id'], 'd'); $np->delete($_POST); Event::log($_POST['id'], "networkport", 5, "inventory", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); if ($item = getItemForItemtype($np->fields['itemtype'])) { Html::redirect($item->getFormURL().'?id='.$np->fields['items_id']); } Html::redirect($CFG_GLPI["root_doc"]."/front/central.php"); } else if (isset($_POST["update"])) { $np->check($_POST['id'], 'w'); $np->splitInputForElements($_POST); $np->update($_POST); $np->updateDependencies(1); Event::log($_POST["id"], "networkport", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } else if (isset($_POST["disconnect"])) { $nn->check($_POST['id'], 'd'); if (isset($_POST["id"])) { $nn->delete($_POST); } Html::back(); } else { if (empty($_GET["items_id"])) { $_GET["items_id"] = ""; } if (empty($_GET["itemtype"])) { $_GET["itemtype"] = ""; } if (empty($_GET["several"])) { $_GET["several"] = ""; } if (empty($_GET["instantiation_type"])) { $_GET["instantiation_type"] = ""; } Session::checkRight("networking", "w"); Html::header(NetworkPort::getTypeName(2), $_SERVER['PHP_SELF'], 'inventory'); $np->showForm($_GET["id"], $_GET); Html::footer(); } ?> glpi-0.84.3+dfsg.1/front/networkport_vlan.form.php000066400000000000000000000033161226600447100220450ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkCentralAccess(); $npv = new NetworkPort_Vlan(); if (isset($_POST["add"])) { $npv->check(-1,'w',$_POST); if (isset($_POST["vlans_id"]) && ($_POST["vlans_id"] > 0)) { $npv->assignVlan($_POST["networkports_id"], $_POST["vlans_id"], (isset($_POST['tagged']) ? '1' : '0')); Event::log(0, "networkport", 5, "inventory", //TRANS: %s is the user login sprintf(__('%s associates a VLAN to a network port'), $_SESSION["glpiname"])); } Html::back(); } Html::displayErrorAndDie('Lost'); ?>glpi-0.84.3+dfsg.1/front/networkportmigration.form.php000066400000000000000000000063561226600447100227460ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); if (!TableExists('glpi_networkportmigrations')) { Html::displayNotFoundError(); } $np = new NetworkPortMigration(); if (!isset($_GET["id"])) { $_GET["id"] = ""; } if (isset($_POST["delete"])) { $np->check($_POST['id'],'d'); $np->delete($_POST); Event::log($_POST['id'], "networkport", 5, "inventory", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); Html::redirect($CFG_GLPI["root_doc"]."/front/networkportmigration.php"); } else if (isset($_POST["delete_several"])) { Session::checkRight("networking", "w"); if (isset($_POST["del_port"]) && count($_POST["del_port"])) { foreach ($_POST["del_port"] as $port_id => $val) { if ($np->can($port_id,'d')) { $np->delete(array("id" => $port_id)); } } } Event::log(0, "networkport", 5, "inventory", //TRANS: %s is the user login sprintf(__('%s deletes several network ports'), $_SESSION["glpiname"])); Html::back(); } else if (isset($_POST["update"])) { $np->check($_POST['id'],'d'); $networkport = new NetworkPort(); if ($networkport->can($_POST['id'], 'w')) { if ($networkport->switchInstantiationType($_POST['transform_to']) !== false) { $instantiation = $networkport->getInstantiation(); $input = $np->fields; $input['networkports_id'] = $input['id']; unset($input['id']); if ($instantiation->add($input)) { $np->delete($_POST); } } else { Session::addMessageAfterRedirect(__('Cannot change a migration network port to an unknown one')); } } else { Session::addMessageAfterRedirect(__('Network port is not available...')); $np->delete($_POST); } Html::redirect($CFG_GLPI["root_doc"]."/front/networkportmigration.php"); } else { Session::checkRight("networking", "w"); Html::header(NetworkPort::getTypeName(2), $_SERVER['PHP_SELF'], "utils", "migration", "networkportmigration"); $np->showForm($_GET["id"]); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/networkportmigration.php000066400000000000000000000027141226600447100217760ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("networking", "w"); if (!TableExists('glpi_networkportmigrations')) { Html::displayNotFoundError(); } Html::header(NetworkPortMigration::getTypeName(2), $_SERVER['PHP_SELF'], "utils", "migration", "networkportmigration"); Search::show('NetworkPortMigration'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/notification.form.php000066400000000000000000000046241226600447100211200ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("notification", 'r'); if (!isset($_GET["id"])) { $_GET["id"] = ""; } $notification = new Notification(); if (isset($_POST["add"])) { $notification->check(-1,'w',$_POST); $newID = $notification->add($_POST); Event::log($newID, "notifications", 4, "notification", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); Html::redirect($_SERVER['PHP_SELF']."?id=$newID"); } else if (isset($_POST["delete"])) { $notification->check($_POST["id"],'d'); $notification->delete($_POST); Event::log($_POST["id"], "notifications", 4, "notification", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); $notification->redirectToList(); } else if (isset($_POST["update"])) { $notification->check($_POST["id"],'w'); $notification->update($_POST); Event::log($_POST["id"], "notifications", 4, "notification", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } else { Html::header(Notification::getTypeName(2), $_SERVER['PHP_SELF'], "config", "mailing", "notification"); $notification->showForm($_GET["id"]); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/notification.php000066400000000000000000000025271226600447100201560ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("notification", 'r'); Html::header(Notification::getTypeName(2), $_SERVER['PHP_SELF'], "config", "mailing", "notification"); Search::show('Notification'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/notification.tags.php000066400000000000000000000026101226600447100211040ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { include ('../inc/includes.php'); } if (isset($_GET["sub_type"])) { Session::checkRight("config", "r"); NotificationTemplateTranslation::showAvailableTags($_GET["sub_type"]); Html::ajaxFooter(); } else { Html::displayErrorAndDie("lost"); } ?>glpi-0.84.3+dfsg.1/front/notificationmailsetting.form.php000066400000000000000000000031301226600447100233500ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("config", "w"); $notificationmail = new NotificationMailSetting(); if (!empty($_POST["test_smtp_send"])) { NotificationMail::testNotification(); Html::back(); } else if (!empty($_POST["update"])) { $config = new Config(); $config->update($_POST); Html::back(); } Html::header(Notification::getTypeName(2), $_SERVER['PHP_SELF'], "config", "mailing", "config"); $notificationmail->showForm(1); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/notificationtarget.form.php000066400000000000000000000023541226600447100223250ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkCentralAccess(); NotificationTarget::updateTargets($_POST); Html::back(); ?>glpi-0.84.3+dfsg.1/front/notificationtemplate.form.php000066400000000000000000000052521226600447100226520ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkCentralAccess(); if (!isset($_GET["id"])) { $_GET["id"] = ""; } $notificationtemplate = new NotificationTemplate(); if (isset($_POST["add"])) { $notificationtemplate->check(-1,'w',$_POST); $newID = $notificationtemplate->add($_POST); Event::log($newID, "notificationtemplates", 4, "notification", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); $language = new NotificationTemplateTranslation(); $url = Toolbox::getItemTypeFormURL('NotificationTemplateTranslation', true); $url .="?notificationtemplates_id=$newID"; Html::redirect($url); } else if (isset($_POST["delete"])) { $notificationtemplate->check($_POST["id"],'d'); $notificationtemplate->delete($_POST); Event::log($_POST["id"], "notificationtemplates", 4, "notification", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); $notificationtemplate->redirectToList(); } else if (isset($_POST["update"])) { $notificationtemplate->check($_POST["id"],'w'); $notificationtemplate->update($_POST); Event::log($_POST["id"], "notificationtemplates", 4, "notification", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } else { Html::header(NotificationTemplate::getTypeName(2), $_SERVER['PHP_SELF'], "config", "mailing", "notificationtemplate"); $notificationtemplate->showForm($_GET["id"]); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/notificationtemplate.php000066400000000000000000000025611226600447100217100ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("config", "r"); Html::header(NotificationTemplate::getTypeName(2), $_SERVER['PHP_SELF'], "config", "mailing", "notificationtemplate"); Search::show('NotificationTemplate'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/notificationtemplatetranslation.form.php000066400000000000000000000051361226600447100251320ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkCentralAccess(); if (!isset($_GET["id"])) { $_GET["id"] = ""; } $language = new NotificationTemplateTranslation(); if (isset($_POST["add"])) { $language->check(-1,'w',$_POST); $newID = $language->add($_POST); Event::log($newID, "notificationtemplatetranslations", 4, "notification", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["language"])); Html::back(); } else if (isset($_POST["delete"])) { $language->check($_POST["id"],'d'); $language->delete($_POST); Event::log($_POST["id"], "notificationtemplatetranslations", 4, "notification", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); $language->redirectToList(); } else if (isset($_POST["update"])) { $language->check($_POST["id"],'w'); $language->update($_POST); Event::log($_POST["id"], "notificationtemplatetranslations", 4, "notification", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } else { Html::header(NotificationTemplate::getTypeName(2), $_SERVER['PHP_SELF'], "config", "mailing", "notificationtemplate"); if ($_GET["id"] == '') { $options = array("notificationtemplates_id" => $_GET["notificationtemplates_id"]); } else { $options = array(); } $language->showForm($_GET["id"], $options); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/notimportedemail.php000066400000000000000000000025451226600447100210440ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("config", "r"); Html::header(NotImportedEmail::getTypeName(2), $_SERVER['PHP_SELF'], "config", "mailcollector", "rejectedemails"); Search::show('NotImportedEmail'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/operatingsystem.form.php000066400000000000000000000023541226600447100216650ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new OperatingSystem(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/operatingsystem.php000066400000000000000000000023431226600447100207210ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new OperatingSystem(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/operatingsystemservicepack.form.php000066400000000000000000000024021226600447100240770ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new OperatingSystemServicePack(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/operatingsystemservicepack.php000066400000000000000000000023711226600447100231420ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new OperatingSystemServicePack(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/operatingsystemversion.form.php000066400000000000000000000023721226600447100232730ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new OperatingSystemVersion(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/operatingsystemversion.php000066400000000000000000000023611226600447100223270ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new OperatingSystemVersion(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/peripheral.form.php000066400000000000000000000067051226600447100205670ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("peripheral", "r"); if (empty($_GET["id"])) { $_GET["id"] = ""; } if (!isset($_GET["withtemplate"])) { $_GET["withtemplate"] = ""; } $peripheral = new Peripheral(); if (isset($_POST["add"])) { $peripheral->check(-1,'w',$_POST); $newID = $peripheral->add($_POST); Event::log($newID, "peripherals", 4, "inventory", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); Html::back(); } else if (isset($_POST["delete"])) { $peripheral->check($_POST["id"],'d'); $peripheral->delete($_POST); Event::log($_POST["id"], "peripherals", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s deletes an item'), $_SESSION["glpiname"])); $peripheral->redirectToList(); } else if (isset($_POST["restore"])) { $peripheral->check($_POST["id"],'d'); $peripheral->restore($_POST); Event::log($_POST["id"], "peripherals", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s restores an item'), $_SESSION["glpiname"])); $peripheral->redirectToList(); } else if (isset($_POST["purge"])) { $peripheral->check($_POST["id"],'d'); $peripheral->delete($_POST,1); Event::log($_POST["id"], "peripherals", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); $peripheral->redirectToList(); } else if (isset($_POST["update"])) { $peripheral->check($_POST["id"],'w'); $peripheral->update($_POST); Event::log($_POST["id"], "peripherals", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } else if (isset($_POST["unglobalize"])) { $peripheral->check($_POST["id"],'w'); Computer_Item::unglobalizeItem($peripheral); Event::log($_POST["id"], "peripherals", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s sets unitary management'), $_SESSION["glpiname"])); Html::redirect($CFG_GLPI["root_doc"]."/front/peripheral.form.php?id=".$_POST["id"]); } else { Html::header(Peripheral::getTypeName(2), $_SERVER['PHP_SELF'], "inventory", "peripheral"); $peripheral->showForm($_GET["id"], array('withtemplate' => $_GET["withtemplate"])); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/peripheral.php000066400000000000000000000024701226600447100176200ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("peripheral", "r"); Html::header(Peripheral::getTypeName(2), $_SERVER['PHP_SELF'], "inventory", "peripheral"); Search::show('Peripheral'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/peripheralmodel.form.php000066400000000000000000000023541226600447100216040ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new PeripheralModel(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/peripheralmodel.php000066400000000000000000000023431226600447100206400ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new PeripheralModel(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/peripheraltype.form.php000066400000000000000000000023521226600447100214630ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new PeripheralType(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/peripheraltype.php000066400000000000000000000023411226600447100205170ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new PeripheralType(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/phone.form.php000066400000000000000000000064621226600447100175450ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("phone", "r"); if (empty($_GET["id"])) { $_GET["id"] = ""; } if (!isset($_GET["withtemplate"])) { $_GET["withtemplate"] = ""; } $phone = new Phone(); if (isset($_POST["add"])) { $phone->check(-1,'w',$_POST); $newID = $phone->add($_POST); Event::log($newID, "phones", 4, "inventory", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); Html::back(); } else if (isset($_POST["delete"])) { $phone->check($_POST["id"],'d'); $phone->delete($_POST); Event::log($_POST["id"], "phones", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s deletes an item'), $_SESSION["glpiname"])); $phone->redirectToList(); } else if (isset($_POST["restore"])) { $phone->check($_POST["id"],'d'); $phone->restore($_POST); Event::log($_POST["id"], "phones", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s restores an item'), $_SESSION["glpiname"])); $phone->redirectToList(); } else if (isset($_POST["purge"])) { $phone->check($_POST["id"],'d'); $phone->delete($_POST,1); Event::log($_POST["id"], "phones", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); $phone->redirectToList(); } else if (isset($_POST["update"])) { $phone->check($_POST["id"],'w'); $phone->update($_POST); Event::log($_POST["id"], "phones", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } else if (isset($_POST["unglobalize"])) { $phone->check($_POST["id"],'w'); Computer_Item::unglobalizeItem($phone); Event::log($_POST["id"], "phones", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s sets unitary management'), $_SESSION["glpiname"])); Html::redirect($CFG_GLPI["root_doc"]."/front/phone.form.php?id=".$_POST["id"]); } else { Html::header(Phone::getTypeName(2), $_SERVER['PHP_SELF'], 'inventory', 'phone'); $phone->showForm($_GET["id"], array('withtemplate' => $_GET["withtemplate"])); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/phone.php000066400000000000000000000024371226600447100166010ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("phone", "r"); Html::header(Phone::getTypeName(2), $_SERVER['PHP_SELF'], 'inventory', 'phone'); Search::show('Phone'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/phonemodel.form.php000066400000000000000000000023421226600447100205570ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new PhoneModel(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/phonemodel.php000066400000000000000000000023311226600447100176130ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new PhoneModel(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/phonepowersupply.form.php000066400000000000000000000023561226600447100220750ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new PhonePowerSupply(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/phonepowersupply.php000066400000000000000000000023451226600447100211310ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new PhonePowerSupply(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/phonetype.form.php000066400000000000000000000023401226600447100204360ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new PhoneType(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/phonetype.php000066400000000000000000000023271226600447100175010ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new PhoneType(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/planning.php000066400000000000000000000110361226600447100172710ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); if (!isset($_GET["uID"])) { if (($uid = Session::getLoginUserID()) && !Session::haveRight("show_all_planning","1")) { $_GET["uID"] = $uid; } else { $_GET["uID"] = 0; } } if (!isset($_GET["gID"])) { $_GET["gID"] = 0; } if (!isset($_GET["limititemtype"])) { $_GET["limititemtype"] = ""; } // Normal call via $_GET if (isset($_GET['checkavailability'])) { Html::popHeader(__('Availability')); if (!isset($_GET["begin"])) { $_GET["begin"] = ""; } if (!isset($_GET["end"])) { $_GET["end"] = ""; } if (!isset($_GET["users_id"])) { $_GET["users_id"] = ""; } Planning::checkAvailability($_GET['users_id'], $_GET['begin'], $_GET['end']); Html::popFooter(); } else if (isset($_GET['genical'])) { if (isset($_GET['token'])) { // Check user token $user = new User(); if ($user->getFromDBByToken($_GET['token'])) { if (isset($_GET['entities_id']) && isset($_GET['is_recursive'])) { $user->loadMinimalSession($_GET['entities_id'], $_GET['is_recursive']); } //// check if the request is valid: rights on uID / gID // First check mine : user then groups $ismine = false; if ($user->getID() == $_GET["uID"]) { $ismine = true; } // Check groups if have right to see if (!$ismine && ($_GET["gID"] !== 0)) { if ($_GET["gID"] === 'mine') { $ismine = true; } else { $entities = Profile_User::getUserEntitiesForRight($user->getID(), 'show_group_planning'); $groups = Group_User::getUserGroups($user->getID()); foreach ($groups as $group) { if (($_GET["gID"] == $group['id']) && in_array($group['entities_id'], $entities)) { $ismine = true; } } } } $canview = false; // If not mine check global right if (!$ismine) { // First check user $entities = Profile_User::getUserEntitiesForRight($user->getID(), 'show_all_planning'); if ($_GET["uID"]) { $userentities = Profile_User::getUserEntities($user->getID()); $intersect = array_intersect($entities, $userentities); if (count($intersect)) { $canview = true; } } // Else check group if (!$canview && $_GET['gID']) { $group = new Group(); if ($group->getFromDB($_GET['gID'])) { if (in_array($group->getEntityID(), $entities)) { $canview = true; } } } } if ($ismine || $canview) { Planning::generateIcal($_GET["uID"], $_GET["gID"], $_GET["limititemtype"]); } } } } else { Html::header(__('Planning'), $_SERVER['PHP_SELF'], "maintain", "planning"); Session::checkSeveralRightsOr(array('show_all_planning' => '1', 'show_planning' => '1')); if (!isset($_GET["date"]) || empty($_GET["date"])) { $_GET["date"] = strftime("%Y-%m-%d"); } if (!isset($_GET["type"])) { $_GET["type"] = "week"; } $planning = new Planning(); $planning->show($_GET); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/planningrecall.form.php000066400000000000000000000025161226600447100214210ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session ::checkLoginUser(); $pr = new PlanningRecall(); if (isset($_POST["update"])) { $pr->manageDatas($_POST['_planningrecall']); Html::back(); } Html::displayErrorAndDie("lost"); ?>glpi-0.84.3+dfsg.1/front/plugin.form.php000066400000000000000000000027621226600447100177310ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.84 */ include ('../inc/includes.php'); Session::checkRight("config", "w"); $plugin = new Plugin(); if (isset($_POST['action']) && isset($_POST['id'])) { if (method_exists($plugin,$_POST['action'])) { $plugin->$_POST['action']($_POST['id']); } else { echo "Action ".$_POST['action']." undefined"; } Html::back(); } Html::displayErrorAndDie('Lost'); ?>glpi-0.84.3+dfsg.1/front/plugin.php000066400000000000000000000047071226600447100167700ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("config", "w"); /** * Obsolete function provided to detect compatibility issue * * @since version 0.84 **/ function handleObsoleteCall($func) { $name = NOT_AVAILABLE; foreach (debug_backtrace() as $row) { if (isset($row['function']) && ($row['function'] == $func) && isset($row['file']) && preg_match(':(/|\\\\)plugins(/|\\\\)(.*)(/|\\\\):', $row['file'], $reg)) { $name = $reg[3]; break; } } echo ""; Html::displayErrorAndDie(sprintf(__('The plugin %s is incompatible with this version of GLPI'), $name). "

".__('Delete or update it otherwise GLPI will not work correctly.')); } /** * Obsolete function keep only for compatibility old versions * * @param $name **/ function registerPluginType($name) { handleObsoleteCall('registerPluginType'); } /** * Obsolete function keep only for compatibility old versions **/ function getLoginUserID() { handleObsoleteCall('getLoginUserID'); } /** * Obsolete function keep only for compatibility old versions **/ function haveRight() { handleObsoleteCall('haveRight'); } $plugin = new Plugin(); Html::header(__('Setup'), $_SERVER['PHP_SELF'], "config", "plugins"); $plugin->listPlugins(); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/pluginimage.send.php000066400000000000000000000046671226600447100207300ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief Purpose of file: Send image generated by a plugin to browser Arguments : - plugin : name of the plugin, also the subdir in files/_plugins - name : of the image in the files/_plugins/xxxx dir - clean : delete the image after send it */ include ('../inc/includes.php'); if (!isset($_GET["name"]) || !isset($_GET["plugin"])) { Event::log("-1", "system", 2, "security", //TRANS: %s is user name sprintf(__('%s makes a bad usage.'), $_SESSION["glpiname"])); die("security"); } if ((basename($_GET["name"]) != $_GET["name"]) || (basename($_GET["plugin"]) != $_GET["plugin"])) { Event::log("-1", "system", 1, "security", sprintf(__('%s tries to use a non standard path.'), $_SESSION["glpiname"])); die("security"); } $Path = GLPI_PLUGIN_DOC_DIR."/".$_GET["plugin"]."/"; // Now send the file with header() magic header("Expires: Sun, 30 Jan 1966 06:30:00 GMT"); header('Pragma: private'); /// IE BUG + SSL header('Cache-control: private, must-revalidate'); /// IE BUG + SSL header('Content-disposition: filename="' . $_GET["name"] . '"'); header("Content-type: image/png"); if (file_exists($Path.$_GET["name"])) { readfile($Path.$_GET["name"]); if (isset($_GET["clean"])) { unlink($Path.$_GET["name"]); } } else { readfile($CFG_GLPI['root_doc'] . "/pics/warning.png"); } ?>glpi-0.84.3+dfsg.1/front/popup.php000066400000000000000000000076011226600447100166310ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkLoginUser(); if (isset($_GET["popup"])) { $_SESSION["glpipopup"]["name"] = $_GET["popup"]; } if (isset($_SESSION["glpipopup"]["name"])) { switch ($_SESSION["glpipopup"]["name"]) { case "search_config" : Html::popHeader(__('Setup'), $_SERVER['PHP_SELF']); if (isset($_POST["add"]) || isset($_POST["delete"]) || isset($_POST["delete_x"]) || isset($_POST["up"]) || isset($_POST["up_x"]) || isset($_POST["down"]) || isset($_POST["down_x"])) { echo ""; } include "displaypreference.form.php"; break; case "test_rule" : Html::popHeader(__('Test'), $_SERVER['PHP_SELF']); include "rule.test.php"; break; case "test_all_rules" : Html::popHeader(__('Test rules engine'), $_SERVER['PHP_SELF']); include "rulesengine.test.php"; break; case "show_cache" : Html::popHeader(__('Cache information'), $_SERVER['PHP_SELF']); include "rule.cache.php"; break; case "load_bookmark" : Html::popHeader(_n('Bookmark', 'Bookmarks', 2), $_SERVER['PHP_SELF']); $_GET["action"] = "load"; include "bookmark.php"; break; case "edit_bookmark" : Html::popHeader(_n('Bookmark', 'Bookmarks', 2), $_SERVER['PHP_SELF']); $_GET["action"] = "edit"; include "bookmark.php"; break; case "edit_user_notification" : Html::popHeader(__('Email followup'), $_SERVER['PHP_SELF']); switch ($_GET["itemtype"]) { case 'Ticket' : include "ticket_user.form.php"; break; case 'Problem' : include "problem_user.form.php"; break; } break; case "add_ldapuser" : Html::popHeader(__('Import a user'), $_SERVER['PHP_SELF']); include "ldap.import.php"; break; case "list_notificationtags" : Html::popHeader(__('List of available tags'), $_SERVER['PHP_SELF']); include "notification.tags.php"; break; case "show_kb" : Html::popHeader(__('Knowledge base'), $_SERVER['PHP_SELF']); $kb = new KnowbaseItem(); $kb->check($_GET["id"],'r'); $kb->showFull(true); break; case "display_options" : Html::popHeader(__('Display options'), $_SERVER['PHP_SELF']); include "display.options.php"; break; } echo ""; Html::popFooter(); } ?> glpi-0.84.3+dfsg.1/front/preference.php000066400000000000000000000042771226600447100176120ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $user = new User(); // Manage lost password if (isset($_GET['lostpassword'])) { Html::nullHeader(); if (isset($_GET['password_forget_token'])) { User::showPasswordForgetChangeForm($_GET['password_forget_token']); } else { User::showPasswordForgetRequestForm(); } Html::nullFooter(); exit(); } Session::checkLoginUser(); if (isset($_POST["update"]) && ($_POST["id"] === Session::getLoginUserID())) { $user->update($_POST); Event::log($_POST["id"], "users", 5, "setup", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } else { if ($_SESSION["glpiactiveprofile"]["interface"] == "central") { Html::header(Preference::getTypeName(1), $_SERVER['PHP_SELF'],'preference'); } else { Html::helpHeader(Preference::getTypeName(1), $_SERVER['PHP_SELF']); } $pref = new Preference(); $pref->show(); if ($_SESSION["glpiactiveprofile"]["interface"] == "central") { Html::footer(); } else { Html::helpFooter(); } } ?>glpi-0.84.3+dfsg.1/front/printer.form.php000066400000000000000000000065301226600447100201130ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("printer", "r"); if (!isset($_GET["id"])) { $_GET["id"] = ""; } if (!isset($_GET["withtemplate"])) { $_GET["withtemplate"] = ""; } $print = new Printer(); if (isset($_POST["add"])) { $print->check(-1,'w',$_POST); if ($newID=$print->add($_POST)) { Event::log($newID, "printers", 4, "inventory", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); } Html::back(); } else if (isset($_POST["delete"])) { $print->check($_POST["id"],'d'); $print->delete($_POST); Event::log($_POST["id"], "printers", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s deletes an item'), $_SESSION["glpiname"])); $print->redirectToList(); } else if (isset($_POST["restore"])) { $print->check($_POST["id"],'d'); $print->restore($_POST); Event::log($_POST["id"], "printers", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s restores an item'), $_SESSION["glpiname"])); $print->redirectToList(); } else if (isset($_POST["purge"])) { $print->check($_POST["id"],'d'); $print->delete($_POST, 1); Event::log($_POST["id"], "printers", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); $print->redirectToList(); } else if (isset($_POST["update"])) { $print->check($_POST["id"],'w'); $print->update($_POST); Event::log($_POST["id"], "printers", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } else if (isset($_POST["unglobalize"])) { $print->check($_POST["id"],'w'); Computer_Item::unglobalizeItem($print); Event::log($_POST["id"], "printers", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s sets unitary management'), $_SESSION["glpiname"])); Html::redirect($CFG_GLPI["root_doc"]."/front/printer.form.php?id=".$_POST["id"]); } else { Html::header(Printer::getTypeName(2), $_SERVER['PHP_SELF'], "inventory","printer"); $print->showForm($_GET["id"], array('withtemplate' => $_GET["withtemplate"])); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/printer.php000066400000000000000000000024511226600447100171470ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("printer", "r"); Html::header(Printer::getTypeName(2), $_SERVER['PHP_SELF'], "inventory", "printer"); Search::show('Printer'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/printermodel.form.php000066400000000000000000000023461226600447100211350ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new PrinterModel(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/printermodel.php000066400000000000000000000023351226600447100201710ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new PrinterModel(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/printertype.form.php000066400000000000000000000023441226600447100210140ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new PrinterType(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/printertype.php000066400000000000000000000023331226600447100200500ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new PrinterType(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/problem.form.php000066400000000000000000000104561226600447100200720ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); if (empty($_GET["id"])) { $_GET["id"] = ''; } Session::checkLoginUser(); $problem = new Problem(); if (isset($_POST["add"])) { $problem->check(-1, 'w', $_POST); $newID = $problem->add($_POST); Event::log($newID, "problem", 4, "maintain", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); Html::back(); } else if (isset($_POST["delete"])) { $problem->check($_POST["id"], 'd'); $problem->delete($_POST); Event::log($_POST["id"], "problem", 4, "maintain", //TRANS: %s is the user login sprintf(__('%s deletes an item'), $_SESSION["glpiname"])); $problem->redirectToList(); } else if (isset($_POST["restore"])) { $problem->check($_POST["id"], 'd'); $problem->restore($_POST); Event::log($_POST["id"], "problem", 4, "maintain", //TRANS: %s is the user login sprintf(__('%s restores an item'), $_SESSION["glpiname"])); $problem->redirectToList(); } else if (isset($_POST["purge"])) { $problem->check($_POST["id"], 'd'); $problem->delete($_POST,1); Event::log($_POST["id"], "problem", 4, "maintain", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); $problem->redirectToList(); } else if (isset($_POST["update"])) { $problem->check($_POST["id"], 'w'); $problem->update($_POST); Event::log($_POST["id"], "problem", 4, "maintain", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); // Copy solution to KB redirect to KB if (isset($_POST['_sol_to_kb']) && $_POST['_sol_to_kb']) { Html::redirect($CFG_GLPI["root_doc"]. "/front/knowbaseitem.form.php?id=new&item_itemtype=Problem&item_items_id=". $_POST["id"]); } else { Html::back(); } } else if (isset($_POST['delete_user'])) { $problem_user = new Problem_User(); $problem_user->check($_POST['id'], 'd'); $problem_user->delete($_POST); Event::log($_POST['problems_id'], "problem", 4, "maintain", sprintf(__('%s deletes an actor'), $_SESSION["glpiname"])); Html::redirect($CFG_GLPI["root_doc"]."/front/problem.form.php?id=".$_POST['problems_id']); } else if (isset($_POST['delete_group'])) { $group_problem = new Group_Problem(); $group_problem->check($_POST['id'], 'd'); $group_problem->delete($_POST); Event::log($_POST['problems_id'], "problem", 4, "maintain", sprintf(__('%s deletes an actor'), $_SESSION["glpiname"])); Html::redirect($CFG_GLPI["root_doc"]."/front/problem.form.php?id=".$_POST['problems_id']); } else if (isset($_POST['delete_supplier'])) { $problem_supplier = new Problem_Supplier(); $problem_supplier->check($_POST['id'], 'd'); $problem_supplier->delete($_POST); Event::log($_POST['problems_id'], "problem", 4, "maintain", sprintf(__('%s deletes an actor'), $_SESSION["glpiname"])); Html::redirect($CFG_GLPI["root_doc"]."/front/problem.form.php?id=".$_POST['problems_id']); } else { Html::header(Problem::getTypeName(2), $_SERVER['PHP_SELF'], "maintain", "problem"); $problem->showForm($_GET["id"],$_GET); Html::footer(); } ?> glpi-0.84.3+dfsg.1/front/problem.php000066400000000000000000000025611226600447100171260ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkSeveralRightsOr(array('show_all_problem' => '1', 'show_my_problem' => '1')); Html::header(Problem::getTypeName(2), '', "maintain", "problem"); Search::show('Problem'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/problem_ticket.form.php000066400000000000000000000030511226600447100214260ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session ::checkLoginUser(); $item = new Problem_Ticket(); if (isset($_POST["add"])) { $item->check(-1, 'w', $_POST); if ($item->add($_POST)) { Event::log($_POST["problems_id"], "problem", 4, "maintain", //TRANS: %s is the user login sprintf(__('%s adds a link with an item'), $_SESSION["glpiname"])); } Html::back(); } Html::displayErrorAndDie("lost"); ?>glpi-0.84.3+dfsg.1/front/problem_user.form.php000066400000000000000000000031631226600447100211250ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { include ('../inc/includes.php'); } $problem_user = new Problem_User(); Session ::checkLoginUser(); if (isset($_POST["update"])) { $problem_user->check($_POST["id"], 'w'); $problem_user->update($_POST); echo ""; } else if (isset($_GET["id"])) { $problem_user->showUserNotificationForm($_GET["id"]); } else { Html::displayErrorAndDie('Lost'); } ?>glpi-0.84.3+dfsg.1/front/problemtask.form.php000066400000000000000000000023411226600447100207470ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $task = new ProblemTask(); include (GLPI_ROOT . "/front/commonitiltask.form.php"); ?> glpi-0.84.3+dfsg.1/front/profile.form.php000066400000000000000000000036421226600447100200710ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("profile", "r"); if (!isset($_GET['id'])) { $_GET['id'] = ""; } $prof = new Profile(); if (isset($_POST["add"])) { $prof->check(-1,'w',$_POST); $ID = $prof->add($_POST); // We need to redirect to form to enter rights Html::redirect($CFG_GLPI["root_doc"]."/front/profile.form.php?id=$ID"); } else if (isset($_POST["delete"])) { $prof->check($_POST['id'],'d'); if ($prof->delete($_POST)) { $prof->redirectToList(); } else { Html::back(); } } else if (isset($_POST["update"]) || isset($_POST["interface"])) { $prof->check($_POST['id'],'w'); $prof->update($_POST); Html::back(); } Html::header(Profile::getTypeName(2), $_SERVER['PHP_SELF'], "admin", "profile"); $prof->showForm($_GET["id"]); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/profile.php000066400000000000000000000024451226600447100171270ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("profile", "r"); Html::header(Profile::getTypeName(2), $_SERVER['PHP_SELF'], "admin", "profile"); Search::show('Profile'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/profile_user.form.php000066400000000000000000000031241226600447100211220ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkCentralAccess(); $profile = new Profile(); $right = new Profile_User(); $user = new User(); if (isset($_POST["add"])) { $right->check(-1,'w',$_POST); if ($right->add($_POST)) { Event::log($_POST["users_id"], "users", 4, "setup", //TRANS: %s is the user login sprintf(__('%s adds a user to an entity'), $_SESSION["glpiname"])); } Html::back(); } Html::displayErrorAndDie("lost"); ?>glpi-0.84.3+dfsg.1/front/reminder.form.php000066400000000000000000000071421226600447100202350ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); if (!isset($_GET["id"])) { $_GET["id"] = ""; } $remind = new Reminder(); Session::checkLoginUser(); if (isset($_POST["add"])) { $remind->check(-1,'w',$_POST); $newID = $remind->add($_POST); Event::log($newID, "reminder", 4, "tools", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); Html::back(); } else if (isset($_POST["delete"])) { $remind->check($_POST["id"],'d'); $remind->delete($_POST); Event::log($_POST["id"], "reminder", 4, "tools", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); $remind->redirectToList(); } else if (isset($_POST["update"])) { $remind->check($_POST["id"],'w'); // Right to update the reminder $remind->update($_POST); Event::log($_POST["id"], "reminder", 4, "tools", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } else if (isset($_POST["addvisibility"])) { if (isset($_POST["_type"]) && !empty($_POST["_type"]) && isset($_POST["reminders_id"]) && $_POST["reminders_id"]) { $item = NULL; switch ($_POST["_type"]) { case 'User' : if (isset($_POST['users_id']) && $_POST['users_id']) { $item = new Reminder_User(); } break; case 'Group' : if (isset($_POST['groups_id']) && $_POST['groups_id']) { $item = new Group_Reminder(); } break; case 'Profile' : if (isset($_POST['profiles_id']) && $_POST['profiles_id']) { $item = new Profile_Reminder(); } break; case 'Entity' : $item = new Entity_Reminder(); break; } if (!is_null($item)) { $item->add($_POST); Event::log($_POST["reminders_id"], "reminder", 4, "tools", //TRANS: %s is the user login sprintf(__('%s adds a target'), $_SESSION["glpiname"])); } } Html::back(); } else { if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") { Html::helpHeader(Reminder::getTypeName(2),'',$_SESSION["glpiname"]); } else { Html::header(Reminder::getTypeName(2),'',"utils","reminder"); } $remind->showForm($_GET["id"]); if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") { Html::helpFooter(); } else { Html::footer(); } } ?>glpi-0.84.3+dfsg.1/front/reminder.php000066400000000000000000000024401226600447100172670ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkCentralAccess(); Html::header(Reminder::getTypeName(2),$_SERVER['PHP_SELF'],"utils","reminder"); Search::show('Reminder'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/report.contract.list.php000066400000000000000000000162031226600447100215650ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("reports", "r"); Html::header(Report::getTypeName(2), $_SERVER['PHP_SELF'], "utils", "report"); Report::title(); $items = array('Computer', 'Monitor', 'NetworkEquipment', 'Peripheral', 'Phone', 'Printer', 'Software'); # Titre echo "".__('List of the hardware under contract')."

"; # Request All if ((isset($_POST["item_type"][0]) && ($_POST["item_type"][0] == '0')) || !isset($_POST["item_type"])) { $_POST["item_type"] = $items; } if (isset($_POST["item_type"]) && is_array($_POST["item_type"])) { $query = array(); foreach ($_POST["item_type"] as $key => $val) { if (in_array($val,$items)) { $itemtable = getTableForItemType($val); $query[$val] = "SELECT `$itemtable`.`name` AS itemname, `$itemtable`.`is_deleted` AS itemdeleted, `glpi_locations`.`completename` AS location, `glpi_contracttypes`.`name` AS type, `glpi_infocoms`.`buy_date`, `glpi_infocoms`.`warranty_duration`, `glpi_contracts`.`begin_date`, `glpi_contracts`.`duration`, `glpi_entities`.`completename` AS entname, `glpi_entities`.`id` AS entID FROM `glpi_contracts_items` INNER JOIN `glpi_contracts` ON (`glpi_contracts_items`.`contracts_id` = `glpi_contracts`.`id`) INNER JOIN `$itemtable` ON (`glpi_contracts_items`.`itemtype` = '$val' AND `$itemtable`.`id` = `glpi_contracts_items`.`items_id`) LEFT JOIN `glpi_infocoms` ON (`glpi_infocoms`.`itemtype` = '$val' AND `$itemtable`.`id` = `glpi_infocoms`.`items_id`) LEFT JOIN `glpi_contracttypes` ON (`glpi_contracts`.`contracttypes_id` = `glpi_contracttypes`.`id`) LEFT JOIN `glpi_locations` ON (`$itemtable`.`locations_id` = `glpi_locations`.`id`) LEFT JOIN `glpi_entities` ON (`$itemtable`.`entities_id` = `glpi_entities`.`id`) WHERE `$itemtable`.`is_template` ='0' ". getEntitiesRestrictRequest("AND",$itemtable); if (isset($_POST["annee"][0]) && ($_POST["annee"][0] != 'toutes')) { $query[$val] .= " AND ( "; $first = true; foreach ($_POST["annee"] as $key2 => $val2) { if (!$first) { $query[$val] .= " OR "; } else { $first = false; } $query[$val] .= " YEAR(`glpi_infocoms`.`buy_date`) = '$val2' OR YEAR(`glpi_contracts`.`begin_date`) = '$val2'"; } $query[$val] .= ")"; } $query[$val] .= " ORDER BY entname ASC, itemdeleted DESC, itemname ASC"; } } } $display_entity = Session::isMultiEntitiesMode(); if (isset($query) && count($query)) { foreach ($query as $key => $val) { $result = $DB->query($val); if ($result && $DB->numrows($result)) { $item = new $key(); echo "".$item->getTypeName(1).""; echo ""; echo ""; echo ""; if ($display_entity) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; while ( $data = $DB->fetch_assoc($result)) { echo ""; if ($data['itemname']) { echo ""; } else { echo ""; } echo ""; if ($display_entity) { echo ""; } if ($data['location']) { echo ""; } else { echo ""; } if ($data['buy_date']) { echo ""; if ($data["warranty_duration"]) { echo ""; } else { echo ""; } } else { echo ""; } if ($data['type']) { echo ""; } else { echo ""; } if ($data['begin_date']) { echo ""; if ($data["duration"]) { echo ""; } else { echo ""; } } else { echo ""; } echo "\n"; } echo "
".__('Name')."".__('Deleted')."".__('Entity')."".__('Location')."".__('Date of purchase')."".__('Warranty expiration date')."".__('Contract type')."".__('Start date')."".__('End date')."
".$data['itemname']." ".NOT_AVAILABLE." ".Dropdown::getYesNo($data['itemdeleted'])." ".$data['entname']." ".$data['location']." ".NOT_AVAILABLE." ".Html::convDate($data['buy_date'])." ".Infocom::getWarrantyExpir($data["buy_date"], $data["warranty_duration"])." ".NOT_AVAILABLE." ".NOT_AVAILABLE." ".NOT_AVAILABLE." ".$data['type']." ".NOT_AVAILABLE." ".Html::convDate($data['begin_date'])." ".Infocom::getWarrantyExpir($data["begin_date"], $data["duration"])." ".NOT_AVAILABLE." ".NOT_AVAILABLE." ".NOT_AVAILABLE."



"; } } } Html::footer(); ?>glpi-0.84.3+dfsg.1/front/report.contract.php000066400000000000000000000055101226600447100206120ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("reports", "r"); Html::header(Report::getTypeName(2), $_SERVER['PHP_SELF'], "utils", "report"); Report::title(); # Titre echo ""; echo ""; echo ""; # 3. Selection d'affichage pour generer la liste echo ""; echo " "; echo ""; echo ""; echo "
".__('Hardware under contract')."
"; echo "

".__('Item type')."

"; echo "

"; echo "

".__('Date')."

"; echo "

"; echo "

"; Html::closeForm(); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/report.default.php000066400000000000000000000025011226600447100204160ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("reports", "r"); Html::header(Report::getTypeName(2), $_SERVER['PHP_SELF'], "utils", "report"); Report::title(); Report::showDefaultReport(); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/report.dynamic.php000066400000000000000000000071261226600447100204260ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkCentralAccess(); if (isset($_GET["item_type"]) && isset($_GET["display_type"])) { if ($_GET["display_type"] < 0) { $_GET["display_type"] = -$_GET["display_type"]; $_GET["export_all"] = 1; } // PDF case if ($_GET["display_type"] == Search::PDF_OUTPUT_LANDSCAPE || $_GET["display_type"] == Search::PDF_OUTPUT_PORTRAIT) { include (GLPI_ROOT . "/lib/ezpdf/class.ezpdf.php"); } switch ($_GET["item_type"]) { case 'KnowbaseItem' : KnowbaseItem::showList($_GET, $_GET["is_faq"]); break; case 'Stat' : if (isset($_GET["item_type_param"])) { $params = Toolbox::decodeArrayFromInput($_GET["item_type_param"]); switch ($params["type"]) { case "comp_champ" : $val = Stat::getItems($_GET["itemtype"], $params["date1"], $params["date2"], $params["dropdown"]); Stat::show($_GET["itemtype"], $params["type"], $params["date1"], $params["date2"], $params["start"], $val, $params["dropdown"]); break; case "device" : $val = Stat::getItems($_GET["itemtype"], $params["date1"], $params["date2"], $params["dropdown"]); Stat::show($_GET["itemtype"], $params["type"], $params["date1"], $params["date2"], $params["start"], $val, $params["dropdown"]); break; default : $val2 = (isset($params['value2']) ? $params['value2'] : 0); $val = Stat::getItems($_GET["itemtype"], $params["date1"], $params["date2"], $params["type"], $val2); Stat::show($_GET["itemtype"], $params["type"], $params["date1"], $params["date2"], $params["start"], $val, $val2); } } else if (isset($_GET["type"]) && ($_GET["type"] == "hardwares")) { Stat::showItems("", $_GET["date1"], $_GET["date2"], $_GET['start']); } break; default : // Plugin case if ($plug = isPluginItemType($_GET["item_type"])) { if (Plugin::doOneHook($plug['plugin'], 'dynamicReport', $_GET)) { exit(); } } Search::manageGetValues($_GET["item_type"]); Search::showList($_GET["item_type"],$_GET); } } ?> glpi-0.84.3+dfsg.1/front/report.infocom.conso.php000066400000000000000000000221041226600447100215450ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("reports", "r"); Html::header(Report::getTypeName(2), $_SERVER['PHP_SELF'], "utils", "report"); if (empty($_POST["date1"]) && empty($_POST["date2"])) { $year = date("Y")-1; $_POST["date1"] = date("Y-m-d", mktime(1,0,0,date("m"),date("d"),$year)); $_POST["date2"] = date("Y-m-d"); } if (!empty($_POST["date1"]) && !empty($_POST["date2"]) && (strcmp($_POST["date2"],$_POST["date1"]) < 0)) { $tmp = $_POST["date1"]; $_POST["date1"] = $_POST["date2"]; $_POST["date2"] = $tmp; } Report::title(); echo "\n"; echo ""; echo "". "\n"; echo ""; echo "
".__('Start date').""; Html::showDateFormItem("date1", $_POST["date1"]); echo ""; echo "
".__('End date').""; Html::showDateFormItem("date2", $_POST["date2"]); echo "
\n"; Html::closeForm(); $valeurtot = 0; $valeurnettetot = 0; $valeurnettegraphtot = array(); $valeurgraphtot = array(); /** Display an infocom report for items like consumables * * @param $itemtype item type * @param $begin begin date * @param $end end date **/ function display_infocoms_report($itemtype, $begin, $end) { global $DB, $valeurtot, $valeurnettetot, $valeurnettegraphtot, $valeurgraphtot, $CFG_GLPI; $itemtable = getTableForItemType($itemtype); $query = "SELECT `glpi_infocoms`.* FROM `glpi_infocoms` INNER JOIN `$itemtable` ON (`$itemtable`.`id` = `glpi_infocoms`.`items_id` AND `glpi_infocoms`.`itemtype`='$itemtype') "; switch ($itemtype) { case 'Consumable' : $query .= " INNER JOIN `glpi_consumableitems` ON (`glpi_consumables`.`consumableitems_id` = `glpi_consumableitems`.`id`) ". getEntitiesRestrictRequest("WHERE","glpi_consumableitems"); break; case 'Cartridge' : $query .= " INNER JOIN `glpi_cartridgeitems` ON (`glpi_cartridges`.`cartridgeitems_id` = `glpi_cartridgeitems`.`id`) ". getEntitiesRestrictRequest("WHERE","glpi_cartridgeitems"); break; case 'SoftwareLicense' : $query .= " INNER JOIN `glpi_softwares` ON (`glpi_softwarelicenses`.`softwares_id` = `glpi_softwares`.`id`) ". getEntitiesRestrictRequest("WHERE","glpi_softwarelicenses"); break; } if (!empty($begin)) { $query .= " AND (`glpi_infocoms`.`buy_date` >= '$begin' OR `glpi_infocoms`.`use_date` >= '$begin')"; } if (!empty($end)) { $query .= " AND (`glpi_infocoms`.`buy_date` <= '$end' OR `glpi_infocoms`.`use_date` <= '$end')"; } if ($result = $DB->query($query)) { if (($DB->numrows($result) > 0) && ($item = getItemForItemtype($itemtype))) { echo "

".$item->getTypeName(1)."

"; echo ""; $valeursoustot = 0; $valeurnettesoustot = 0; $valeurnettegraph = array(); $valeurgraph = array(); while ($line=$DB->fetch_assoc($result)) { if ($itemtype == 'SoftwareLicense') { $item->getFromDB($line["items_id"]); if ($item->fields["serial"] == "global") { if ($item->fields["number"] > 0) { $line["value"] *= $item->fields["number"]; } } } if ($line["value"] >0) { $valeursoustot += $line["value"]; } $valeurnette = Infocom::Amort($line["sink_type"], $line["value"], $line["sink_time"], $line["sink_coeff"], $line["buy_date"], $line["use_date"], $CFG_GLPI["date_tax"], "n"); $tmp = Infocom::Amort($line["sink_type"], $line["value"], $line["sink_time"], $line["sink_coeff"], $line["buy_date"], $line["use_date"], $CFG_GLPI["date_tax"], "all"); if (is_array($tmp) && (count($tmp) > 0)) { foreach ($tmp["annee"] as $key => $val) { if ($tmp["vcnetfin"][$key] > 0) { if (!isset($valeurnettegraph[$val])) { $valeurnettegraph[$val] = 0; } $valeurnettegraph[$val] += $tmp["vcnetdeb"][$key]; } } } if (!empty($line["buy_date"])) { $year = substr($line["buy_date"],0,4); if ($line["value"] >0) { if (!isset($valeurgraph[$year])) { $valeurgraph[$year] = 0; } $valeurgraph[$year] += $line["value"]; } } $valeurnettesoustot += str_replace(" ","",$valeurnette); } $valeurtot += $valeursoustot; $valeurnettetot += $valeurnettesoustot; if (count($valeurnettegraph) >0) { echo "\n"; } if (count($valeurgraph) >0) { echo ""; } echo "
"; ksort($valeurnettegraph); $valeurnettegraphdisplay = array_map('round', $valeurnettegraph); foreach ($valeurnettegraph as $key => $val) { if (!isset($valeurnettegraphtot[$key])) { $valeurnettegraphtot[$key] = 0; } $valeurnettegraphtot[$key] += $valeurnettegraph[$key]; } Stat::showGraph(array(__('Account net value') => $valeurnettegraphdisplay), array('title' => __('Account net value'), 'width' => 400)); echo "
"; ksort($valeurgraph); $valeurgraphdisplay = array_map('round', $valeurgraph); foreach ($valeurgraph as $key => $val) { if (!isset($valeurgraphtot[$key])) { $valeurgraphtot[$key] = 0; } $valeurgraphtot[$key] += $valeurgraph[$key]; } Stat::showGraph(array(__('Value') => $valeurgraphdisplay), array('title' => __('Value'), 'width' => 400)); echo "
\n"; return true; } } return false; } $types = array('Cartridge', 'Consumable', 'SoftwareLicense'); $i = 0; echo ""; $i++; if (($i%2) == 0) { echo ""; } echo "
"; while (count($types) > 0) { $type = array_shift($types); if (display_infocoms_report($type, $_POST["date1"],$_POST["date2"])) { echo "
"; } } if (($i%2) == 0) { echo "  "; } echo " 
"; //TRANS: %1$s and %2$s are values $tmpmsg = sprintf(__('Total: Value=%1$s - Account net value=%2$s'), Html::formatNumber($valeurtot), Html::formatNumber($valeurnettetot)); echo "

$tmpmsg

\n"; if (count($valeurnettegraphtot) >0) { $valeurnettegraphtotdisplay = array_map('round', $valeurnettegraphtot); Stat::showGraph(array(__('Account net value') => $valeurnettegraphtotdisplay), array('title' => __('Account net value'))); } if (count($valeurgraphtot) >0) { $valeurgraphtotdisplay = array_map('round', $valeurgraphtot); Stat::showGraph(array(__('Value') => $valeurgraphtotdisplay), array('title' => __('Value'))); } Html::footer(); ?>glpi-0.84.3+dfsg.1/front/report.infocom.php000066400000000000000000000231741226600447100204350ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("reports", "r"); Html::header(Report::getTypeName(2), $_SERVER['PHP_SELF'], "utils", "report"); if (empty($_POST["date1"]) && empty($_POST["date2"])) { $year = date("Y")-1; $_POST["date1"] = date("Y-m-d",mktime(1,0,0,date("m"),date("d"),$year)); $_POST["date2"] = date("Y-m-d"); } if (!empty($_POST["date1"]) && !empty($_POST["date2"]) && (strcmp($_POST["date2"],$_POST["date1"]) < 0)) { $tmp = $_POST["date1"]; $_POST["date1"] = $_POST["date2"]; $_POST["date2"] = $tmp; } Report::title(); echo "
"; echo ""; echo "". ""; echo ""; echo "
".__('Start date').""; Html::showDateFormItem("date1", $_POST["date1"]); echo ""; echo "
".__('End date').""; Html::showDateFormItem("date2" ,$_POST["date2"]); echo "
"; Html::closeForm(); echo "
"; $valeurtot = 0; $valeurnettetot = 0; $valeurnettegraphtot = array(); $valeurgraphtot = array(); /** Display an infocom report * * @param $itemtype item type * @param $begin begin date * @param $end end date **/ function display_infocoms_report($itemtype, $begin, $end) { global $DB, $valeurtot, $valeurnettetot, $valeurnettegraphtot, $valeurgraphtot, $CFG_GLPI; $itemtable = getTableForItemType($itemtype); $query = "SELECT `glpi_infocoms`.*, `$itemtable`.`name` AS name, `$itemtable`.`ticket_tco`, `glpi_entities`.`completename` AS entname, `glpi_entities`.`id` AS entID FROM `glpi_infocoms` INNER JOIN `$itemtable` ON (`$itemtable`.`id` = `glpi_infocoms`.`items_id` AND `glpi_infocoms`.`itemtype` = '$itemtype') LEFT JOIN `glpi_entities` ON (`$itemtable`.`entities_id` = `glpi_entities`.`id`) WHERE `$itemtable`.`is_template` = '0' ". getEntitiesRestrictRequest("AND", $itemtable); if (!empty($begin)) { $query .= " AND (`glpi_infocoms`.`buy_date` >= '$begin' OR `glpi_infocoms`.`use_date` >= '$begin') "; } if (!empty($end)) { $query .= " AND (`glpi_infocoms`.`buy_date` <= '$end' OR `glpi_infocoms`.`use_date` <= '$end') "; } $query .= " ORDER BY entname ASC, `buy_date`, `use_date`"; $display_entity = Session::isMultiEntitiesMode(); $result = $DB->query($query); if (($DB->numrows($result) > 0) && ($item = getItemForItemtype($itemtype))) { echo "

".$item->getTypeName(1)."

"; echo ""; if ($display_entity) { echo ""; } echo ""; echo ""; echo ""; $valeursoustot = 0; $valeurnettesoustot = 0; $valeurnettegraph = array(); $valeurgraph = array(); while ($line=$DB->fetch_assoc($result)) { if (isset($line["is_global"]) && $line["is_global"] && $item->getFromDB($line["items_id"])) { $line["value"] *= Computer_Item::countForItem($item); } if ($line["value"]>0) { $valeursoustot += $line["value"]; } $valeurnette = Infocom::Amort($line["sink_type"], $line["value"], $line["sink_time"], $line["sink_coeff"], $line["buy_date"], $line["use_date"], $CFG_GLPI["date_tax"], "n"); $tmp = Infocom::Amort($line["sink_type"], $line["value"], $line["sink_time"], $line["sink_coeff"], $line["buy_date"], $line["use_date"], $CFG_GLPI["date_tax"], "all"); if (is_array($tmp) && (count($tmp) > 0)) { foreach ($tmp["annee"] as $key => $val) { if ($tmp["vcnetfin"][$key] > 0) { if (!isset($valeurnettegraph[$val])) { $valeurnettegraph[$val] = 0; } $valeurnettegraph[$val] += $tmp["vcnetdeb"][$key]; } } } if (!empty($line["buy_date"])) { $year = substr($line["buy_date"],0,4); if ($line["value"] > 0) { if (!isset($valeurgraph[$year])) { $valeurgraph[$year] = 0; } $valeurgraph[$year] += $line["value"]; } } $valeurnettesoustot += str_replace(" ","",$valeurnette); echo ""; if ($display_entity) { echo ""; } echo "". "". "". "". "". ""; } $valeurtot += $valeursoustot; $valeurnettetot += $valeurnettesoustot; $tmpmsg = sprintf(__('Total: Value=%1$s - Account net value=%2$s'), Html::formatNumber($valeursoustot), Html::formatNumber($valeurnettesoustot)); echo ""; if (count($valeurnettegraph) > 0) { echo ""; } if (count($valeurgraph) > 0) { echo ""; } echo "
".__('Name')."".__('Entity')."".__('Value')."".__('ANV')."".__('TCO')."".__('Date of purchase')."".__('Startup date')."".__('Warranty expiration date')."
".$line["name"]."".$line['entname']."".Html::formatNumber($line["value"])."".Html::formatNumber($valeurnette)."".Infocom::showTco($line["ticket_tco"], $line["value"])."".Html::convDate($line["buy_date"])."".Html::convDate($line["use_date"])."".Infocom::getWarrantyExpir($line["buy_date"], $line["warranty_duration"]). "

$tmpmsg

"; ksort($valeurnettegraph); $valeurnettegraphdisplay = array_map('round', $valeurnettegraph); foreach ($valeurnettegraph as $key => $val) { if (!isset($valeurnettegraphtot[$key])) { $valeurnettegraphtot[$key] = 0; } $valeurnettegraphtot[$key] += $valeurnettegraph[$key]; } Stat::showGraph(array(__('Account net value') => $valeurnettegraphdisplay), array('title' => __('Account net value'), 'width' => 400)); echo "
"; ksort($valeurgraph); $valeurgraphdisplay = array_map('round',$valeurgraph); foreach ($valeurgraph as $key => $val) { if (!isset($valeurgraphtot[$key])) { $valeurgraphtot[$key] = 0; } $valeurgraphtot[$key] += $valeurgraph[$key]; } Stat::showGraph(array(__('Value') => $valeurgraphdisplay), array('title' => __('Value'), 'width' => 400)); echo "
"; return true; } return false; } $types = array('Computer', 'Monitor', 'NetworkEquipment', 'Peripheral', 'Phone', 'Printer'); $i = 0; echo ""; $i++; if (($i%2) == 0) { echo ""; } echo "
"; while (count($types) > 0) { $type = array_shift($types); if (display_infocoms_report($type, $_POST["date1"], $_POST["date2"])) { echo "
"; } } if (($i%2) == 0) { echo "  "; } echo "
"; $tmpmsg = sprintf(__('Total: Value=%1$s - Account net value=%2$s'), Html::formatNumber($valeurtot), Html::formatNumber($valeurnettetot)); echo "

$tmpmsg

"; if (count($valeurnettegraphtot) > 0) { $valeurnettegraphtotdisplay = array_map('round', $valeurnettegraphtot); Stat::showGraph(array(__('Account net value') => $valeurnettegraphtotdisplay), array('title' => __('Account net value'))); } if (count($valeurgraphtot) > 0) { $valeurgraphtotdisplay = array_map('round', $valeurgraphtot); Stat::showGraph(array(__('Value') => $valeurgraphtotdisplay), array('title' => __('Value'))); } Html::footer(); ?>glpi-0.84.3+dfsg.1/front/report.location.list.php000066400000000000000000000043151226600447100215610ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("reports", "r"); if (isset($_POST["locations_id"]) && $_POST["locations_id"]) { Html::header(Report::getTypeName(2), $_SERVER['PHP_SELF'], "utils", "report"); Report::title(); // Titre $name = Dropdown::getDropdownName("glpi_locations",$_POST["locations_id"]); echo "

".sprintf(__('Network report by location: %s'),$name). "

"; Report::reportForNetworkInformations( "`glpi_locations` INNER JOIN `glpi_netpoints` ON (`glpi_netpoints`.`locations_id` = `glpi_locations`.`id`) INNER JOIN `glpi_networkportethernets` ON (`glpi_networkportethernets`.`netpoints_id` = `glpi_netpoints`.`id`)", "PORT_1.`id` = `glpi_networkportethernets`.`networkports_id`", getRealQueryForTreeItem("glpi_locations",$_POST["locations_id"]), "`glpi_locations`.`completename`, PORT_1.`name`", "`glpi_netpoints`.`name` AS extra,", Netpoint::getTypeName()); Html::footer(); } else { Html::redirect($CFG_GLPI['root_doc']."/front/report.networking.php"); } ?>glpi-0.84.3+dfsg.1/front/report.netpoint.list.php000066400000000000000000000041711226600447100216110ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("reports", "r"); if (isset($_POST["prise"]) && $_POST["prise"]) { Html::header(Report::getTypeName(2), $_SERVER['PHP_SELF'], "utils", "report"); Report::title(); $name = Dropdown::getDropdownName("glpi_netpoints", $_POST["prise"]); // Titre echo "

".sprintf(__('Network report by outlet: %s'), $name). "

"; Report::reportForNetworkInformations( "`glpi_netpoints` LEFT JOIN `glpi_locations` ON (`glpi_locations`.`id` = `glpi_netpoints`.`locations_id`) INNER JOIN `glpi_networkportethernets` ON (`glpi_networkportethernets`.`netpoints_id` = `glpi_netpoints`.`id`)", "PORT_1.`id` = `glpi_networkportethernets`.`networkports_id`", "`glpi_netpoints`.`id` = '".$_POST["prise"]."'", '', "`glpi_locations`.`name` AS extra,", Location::getTypeName()); Html::footer(); } else { Html::redirect($CFG_GLPI['root_doc']."/front/report.networking.php"); } ?>glpi-0.84.3+dfsg.1/front/report.networking.php000066400000000000000000000056721226600447100211750ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief show choices for network reports */ include ('../inc/includes.php'); Session::checkRight("reports", "r"); Html::header(Report::getTypeName(2), $_SERVER['PHP_SELF'], "utils", "report"); Report::title(); # Titre echo ""; echo ""; echo "
 ".__('Network report')."

"; // 3. Selection d'affichage pour generer la liste echo ""; echo ""; echo ""; echo ""; echo "
".__('By location').""; Location::dropdown(array('entity' => $_SESSION["glpiactive_entity"])); echo ""; echo ""; echo "
"; Html::closeForm(); echo ""; echo ""; echo ""; echo ""; echo "
".__('By hardware').""; NetworkEquipment::dropdown(array('name' => 'switch')); echo ""; echo ""; echo "
"; Html::closeForm(); if (countElementsInTableForMyEntities("glpi_netpoints") > 0) { echo ""; echo ""; echo ""; echo ""; echo "
".__('By network outlet').""; Netpoint::dropdownNetpoint("prise",0,-1,1,$_SESSION["glpiactive_entity"]); echo ""; echo ""; echo "
"; Html::closeForm(); } Html::footer(); ?>glpi-0.84.3+dfsg.1/front/report.php000066400000000000000000000025661226600447100170060ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ // Based on: // IRMA, Information Resource-Management and Administration // Christian Bauer /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("reports", "r"); Html::header(Report::getTypeName(2), $_SERVER['PHP_SELF'], "utils", "report"); Report::title(); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/report.reservation.php000066400000000000000000000036231226600447100213410ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("reports", "r"); Html::header(Report::getTypeName(2), $_SERVER['PHP_SELF'], "utils", "report"); if (!isset($_GET["id"])) { $_GET["id"] = 0; } Report::title(); echo ""; echo ""; echo ""; echo ""; echo "
"; User::dropdown(array('name' => 'id', 'value' => $_GET["id"], 'right' => 'reservation_helpdesk')); echo "
"; Html::closeForm(); if ($_GET["id"] > 0) { Reservation::showForUser($_GET["id"]); } Html::footer(); ?>glpi-0.84.3+dfsg.1/front/report.state.php000066400000000000000000000026241226600447100201200ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.84 */ include ('../inc/includes.php'); Session::checkRight("reports", "r"); Html::header(Report::getTypeName(2), $_SERVER['PHP_SELF'], "utils", "report"); if (!isset($_GET["id"])) { $_GET["id"] = 0; } Report::title(); State::showSummary($_SERVER['PHP_SELF']); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/report.switch.list.php000066400000000000000000000037601226600447100212550ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief show network port by network equipment */ include ('../inc/includes.php'); Session::checkRight("reports", "r"); // Titre if (isset($_POST["switch"]) && $_POST["switch"]) { Html::header(Report::getTypeName(2), $_SERVER['PHP_SELF'], "utils", "report"); Report::title(); $name = Dropdown::getDropdownName("glpi_networkequipments",$_POST["switch"]); echo "

".sprintf(__('Network report by hardware: %s'),$name). "

"; Report::reportForNetworkInformations("`glpi_networkequipments` AS ITEM", "PORT_1.`itemtype` = 'NetworkEquipment' AND PORT_1.`items_id` = ITEM.`id`", "ITEM.`id` = '".$_POST["switch"]."'"); Html::footer(); } else { Html::redirect($CFG_GLPI['root_doc']."/front/report.networking.php"); } ?>glpi-0.84.3+dfsg.1/front/report.year.list.php000066400000000000000000000177731226600447100207250ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ("../inc/includes.php"); Session::checkRight("reports", "r"); Html::header(Report::getTypeName(2), $_SERVER['PHP_SELF'], "utils", "report"); Report::title(); $items = array('Computer', 'Monitor', 'NetworkEquipment', 'Peripheral', 'Phone', 'Printer', 'SoftwareLicense'); # Titre echo "
".__('Device list')."
"; # Request All if ((isset($_POST["item_type"][0]) && ($_POST["item_type"][0] == '0')) || !isset($_POST["item_type"])) { $_POST["item_type"] = $items; } if (isset($_POST["item_type"]) && is_array($_POST["item_type"])) { $query = array(); foreach ($_POST["item_type"] as $key => $val) { if (in_array($val,$items)) { $itemtable = getTableForItemType($val); $deleted_field = "`$itemtable`.`is_deleted`"; $location_field = "`glpi_locations`.`completename`"; $add_leftjoin = "LEFT JOIN `glpi_locations` ON (`$itemtable`.`locations_id` = `glpi_locations`.`id`)"; $template_condition = "`$itemtable`.`is_template` = '0'"; if ($val == 'SoftwareLicense') { $deleted_field = "`glpi_softwares`.`is_deleted`"; $location_field = "''"; $add_leftjoin = "LEFT JOIN `glpi_softwares` ON (`glpi_softwares`.`id` = `glpi_softwarelicenses`.`softwares_id`)"; $template_condition = "`glpi_softwares`.`is_template` = '0'"; } $query[$val] = "SELECT `$itemtable`.`name` AS itemname, $deleted_field AS itemdeleted, $location_field AS location, `glpi_contracttypes`.`name` AS type, `glpi_infocoms`.`buy_date`, `glpi_infocoms`.`warranty_duration`, `glpi_contracts`.`begin_date`, `glpi_contracts`.`duration`, `glpi_entities`.`completename` AS entname, `glpi_entities`.`id` AS entID FROM `$itemtable` $add_leftjoin LEFT JOIN `glpi_contracts_items` ON (`glpi_contracts_items`.`itemtype` = '$val' AND `$itemtable`.`id` = `glpi_contracts_items`.`items_id`) LEFT JOIN `glpi_contracts` ON (`glpi_contracts_items`.`contracts_id` = `glpi_contracts`.`id` AND `glpi_contracts_items`.`contracts_id` IS NOT NULL) LEFT JOIN `glpi_infocoms` ON (`glpi_infocoms`.`itemtype` = '$val' AND `$itemtable`.`id` = `glpi_infocoms`.`items_id`) LEFT JOIN `glpi_contracttypes` ON (`glpi_contracts`.`contracttypes_id` = `glpi_contracttypes`.`id`) LEFT JOIN `glpi_entities` ON (`$itemtable`.`entities_id` = `glpi_entities`.`id`) WHERE $template_condition ". getEntitiesRestrictRequest("AND",$itemtable); if (isset($_POST["annee"][0]) && ($_POST["annee"][0] != 'toutes')) { $query[$val] .= " AND ( "; $first = true; foreach ($_POST["annee"] as $key2 => $val2) { if (!$first) { $query[$val] .= " OR "; } else { $first = false; } $query[$val] .= " YEAR(`glpi_infocoms`.`buy_date`) = '$val2' OR YEAR(`glpi_contracts`.`begin_date`) = '$val2'"; } $query[$val] .= ")"; } $query[$val] .= " ORDER BY entname ASC, itemdeleted DESC, itemname ASC"; } } } $display_entity = Session::isMultiEntitiesMode(); if (isset($query) && count($query)) { foreach ($query as $key => $val) { $result = $DB->query($val); if ($result && $DB->numrows($result)) { $item = new $key(); echo "
".$item->getTypeName(1)."
"; echo ""; echo ""; echo ""; if ($display_entity) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; while ($data = $DB->fetch_assoc($result)) { echo ""; if ($data['itemname']) { echo ""; } else { echo ""; } echo ""; if ($display_entity) { echo ""; } if ($data['location']) { echo ""; } else { echo ""; } if ($data['buy_date']) { echo ""; if ($data["warranty_duration"]) { echo ""; } else { echo ""; } } else { echo ""; echo ""; } if ($data['type']) { echo ""; } else { echo ""; } if ($data['begin_date']) { echo ""; if ($data["duration"]) { echo ""; } else { echo ""; } } else { echo ""; echo ""; } echo "\n"; } echo "
".__('Name')."".__('Deleted')."".__('Entity')."".__('Location')."".__('Date of purchase')."".__('Warranty expiration date')."".__('Contract type')."".__('Start date')."".__('End date')."
".$data['itemname']."".NOT_AVAILABLE."".Dropdown::getYesNo($data['itemdeleted'])."".$data['entname']."".$data['location']."".NOT_AVAILABLE."".Html::convDate($data['buy_date'])."".Infocom::getWarrantyExpir($data["buy_date"], $data["warranty_duration"]). "".NOT_AVAILABLE."".NOT_AVAILABLE."".NOT_AVAILABLE."".$data['type']."".NOT_AVAILABLE."".Html::convDate($data['begin_date'])."".Infocom::getWarrantyExpir($data["begin_date"], $data["duration"])."".NOT_AVAILABLE."".NOT_AVAILABLE."".NOT_AVAILABLE."



"; } } } Html::footer(); ?>glpi-0.84.3+dfsg.1/front/report.year.php000066400000000000000000000054601226600447100177410ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("reports", "r"); Html::header(Report::getTypeName(2), $_SERVER['PHP_SELF'], "utils", "report"); Report::title(); # Titre echo ""; echo ""; echo ""; # 3. Selection d'affichage pour generer la liste echo ""; echo ""; echo ""; echo ""; echo "
".__("Equipment's report by year")."
"; echo "

".__('Item type')."

"; echo "

".__('Date')."

"; echo "

"; echo "
"; Html::closeForm(); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/requesttype.form.php000066400000000000000000000023441226600447100210210ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new RequestType(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/requesttype.php000066400000000000000000000023331226600447100200550ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new RequestType(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/reservation.form.php000066400000000000000000000171361226600447100207750ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("reservation_helpdesk", "1"); $rr = new Reservation(); if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") { Html::helpHeader(__('Simplified interface'), $_SERVER['PHP_SELF'], $_SESSION["glpiname"]); } else { Html::header(Reservation::getTypeName(2), $_SERVER['PHP_SELF'], "utils", "reservation"); } if (isset($_POST["update"])) { list($begin_year,$begin_month,$begin_day) = explode("-",$_POST['resa']["begin"]); Toolbox::manageBeginAndEndPlanDates($_POST['resa']); if (Session::haveRight("reservation_central","w") || (Session::getLoginUserID() === $_POST["users_id"])) { $_POST['_target'] = $_SERVER['PHP_SELF']; $_POST['_item'] = key($_POST["items"]); $_POST['begin'] = $_POST['resa']["begin"]; $_POST['end'] = $_POST['resa']["end"]; if ($rr->update($_POST)) { Html::redirect($CFG_GLPI["root_doc"]."/front/reservation.php?reservationitems_id=". $_POST['_item']."&mois_courant=$begin_month&annee_courante=$begin_year"); } } } else if (isset($_POST["delete"])) { $reservationitems_id = key($_POST["items"]); if ($rr->delete($_POST)) { Event::log($_POST["id"], "reservation", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); } list($begin_year,$begin_month,$begin_day) = explode("-",$rr->fields["begin"]); Html::redirect($CFG_GLPI["root_doc"]."/front/reservation.php?reservationitems_id=". "$reservationitems_id&mois_courant=$begin_month&annee_courante=$begin_year"); } else if (isset($_POST["add"])) { $all_ok = true; $reservationitems_id = 0; if (empty($_POST['users_id'])) { $_POST['users_id'] = Session::getLoginUserID(); } Toolbox::manageBeginAndEndPlanDates($_POST['resa']); $dates_to_add = array(); list($begin_year,$begin_month,$begin_day) = explode("-",$_POST['resa']["begin"]); if (isset($_POST['resa']["end"])) { // Compute dates to add. $dates_to_add[$_POST['resa']["begin"]] = $_POST['resa']["end"]; if (isset($_POST['periodicity']) && is_array($_POST['periodicity']) && isset($_POST['periodicity']['type']) && !empty($_POST['periodicity']['type'])) { // Compute others dates to add. $dates_to_add += Reservation::computePeriodicities($_POST['resa']["begin"], $_POST['resa']["end"], $_POST['periodicity']); } } // Sort dates ksort($dates_to_add); if (count($dates_to_add) && count($_POST['items']) && isset($_POST['users_id'])) { foreach ($_POST['items'] as $reservationitems_id) { $input = array(); $input['reservationitems_id'] = $reservationitems_id; $input['comment'] = $_POST['comment']; if (count($dates_to_add)) { $input['group'] = $rr->getUniqueGroupFor($reservationitems_id); } foreach ($dates_to_add as $begin => $end) { $input['begin'] = $begin; $input['end'] = $end; $input['users_id'] = $_POST['users_id']; if (Session::haveRight("reservation_central","w") || (Session::getLoginUserID() === $input["users_id"])) { unset($rr->fields["id"]); if ($newID = $rr->add($input)) { Event::log($reservationitems_id, "reservation", 4, "inventory", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $newID)); } else { $all_ok = false; } } } } } else { $all_ok = false; } if ($all_ok) { $toadd = ""; // Only one reservation : move to correct month if (count($_POST['items']) == 1) { $toadd = "?reservationitems_id=$reservationitems_id"; $toadd .= "&mois_courant=".intval($begin_month); $toadd .= "&annee_courante=".intval($begin_year); } Html::redirect($CFG_GLPI["root_doc"] . "/front/reservation.php$toadd"); } // $times = $_POST["periodicity_times"]; // $begin = $_POST["begin"]; // list($begin_year,$begin_month,$begin_day) = explode("-",$_POST["begin"]); // $end = $_POST["end"]; // $to_add = 1; // // if ($_POST["periodicity"] == "week") { // $to_add = 7; // } // $_POST['_target'] = $_SERVER['PHP_SELF']; // // $_POST['_ok'] = true; // if ($times > 1 ) { // $_POST['group'] = $rr->getUniqueGroupFor($reservationitems_id); // } // for ($i=0 ; $i<$times && ($_POST['_ok']) ; $i++) { // $_POST["begin"] = date('Y-m-d H:i:s', strtotime($begin." +".($i*$to_add)." day")); // $_POST["end"] = date('Y-m-d H:i:s', strtotime($end." +".($i*$to_add)." day")); // // if (Session::haveRight("reservation_central","w") // || (Session::getLoginUserID() === $_POST["users_id"])) { // unset($rr->fields["id"]); // $_POST['_ok'] = $rr->add($_POST); // } // } // if ($_POST['_ok']) { // Event::log($_POST["reservationitems_id"], "reservation", 4, "inventory", // sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["_ok"])); // } else { // $all_ok = false; // } // } // } else { // $all_ok = false; // } // if ($all_ok) { // $toadd = ""; // // Only one reservation : move to correct month // if (count($_POST['items']) == 1) { // $toadd = "?reservationitems_id=$reservationitems_id"; // $toadd .= "&mois_courant=".intval($begin_month); // $toadd .= "&annee_courante=".intval($begin_year); // } // Html::redirect($CFG_GLPI["root_doc"] . "/front/reservation.php$toadd"); // } } else if (isset($_GET["id"])) { if (!isset($_GET['date'])) { $_GET['date'] = date('Y-m-d'); } if (empty($_GET["id"]) && (!isset($_GET['item']) || (count($_GET['item']) == 0 ))) { Html::back(); } if (!empty($_GET["id"]) || (isset($_GET['item']) && isset($_GET['date']))) { $rr->showForm($_GET['id'], $_GET); } } if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") { Html::helpFooter(); } else { Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/reservation.php000066400000000000000000000032571226600447100200320ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkLoginUser(); if (!isset($_GET["reservationitems_id"])) { $_GET["reservationitems_id"] = ''; } if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") { Html::helpHeader(__('Simplified interface'), $_SERVER['PHP_SELF'], $_SESSION["glpiname"]); } else { Html::header(Reservation::getTypeName(2), $_SERVER['PHP_SELF'], "utils", "reservation"); } Reservation::showCalendar($_GET["reservationitems_id"]); if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") { Html::helpFooter(); } else { Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/reservationitem.form.php000066400000000000000000000057251226600447100216550ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkCentralAccess(); Session::checkRight("reservation_central", "w"); if (!isset($_GET["id"])) { $_GET["id"] = ''; } $ri = new ReservationItem(); if (isset($_POST["add"])) { $ri->check(-1, 'w', $_POST); if ($newID = $ri->add($_POST)) { Event::log($newID, "reservationitem", 4, "inventory", sprintf(__('%1$s adds the item %2$s (%3$d)'), $_SESSION["glpiname"], $_POST["itemtype"], $_POST["items_id"])); } Html::back(); } else if (isset($_POST["delete"])) { $ri->check($_POST["id"], 'd'); $ri->delete($_POST); Event::log($_POST['id'], "reservationitem", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s deletes an item'), $_SESSION["glpiname"])); Html::back(); } else if (isset($_POST["purge"])) { $ri->check($_POST["id"], 'd'); $ri->delete($_POST, 1); Event::log($_POST['id'], "reservationitem", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); Html::back(); } else if (isset($_POST["restore"])) { $ri->check($_POST["id"], 'd'); $ri->restore($_POST); Event::log($_POST['id'], "reservationitem", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s restores an item'), $_SESSION["glpiname"])); Html::back(); } else if (isset($_POST["update"])) { $ri->check($_POST["id"], 'w'); $ri->update($_POST); Event::log($_POST['id'], "reservationitem", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } else { $ri->check($_GET["id"], 'r'); Html::header(Reservation::getTypeName(2), $_SERVER['PHP_SELF'], "utils", "reservation"); $ri->showForm($_GET["id"]); } Html::footer(); ?> glpi-0.84.3+dfsg.1/front/reservationitem.php000066400000000000000000000034351226600447100207070ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkSeveralRightsOr(array("reservation_central" => "r", "reservation_helpdesk" => "1")); if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") { Html::helpHeader(__('Simplified interface'), $_SERVER['PHP_SELF'], $_SESSION["glpiname"]); } else { Html::header(Reservation::getTypeName(2), $_SERVER['PHP_SELF'], "utils", "reservation"); } if (!Session::haveRight("reservation_central","r")) { ReservationItem::showListSimple(); } else { Search::show('ReservationItem'); } if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") { Html::helpFooter(); } else { Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/rssfeed.form.php000066400000000000000000000073161226600447100200660ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.84 */ include ('../inc/includes.php'); if (!isset($_GET["id"])) { $_GET["id"] = ""; } $rssfeed = new RSSFeed(); Session::checkLoginUser(); if (isset($_POST["add"])) { $rssfeed->check(-1,'w',$_POST); $newID = $rssfeed->add($_POST); Event::log($newID, "rssfeed", 4, "tools", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $rssfeed->fields["name"])); Html::redirect($CFG_GLPI["root_doc"]."/front/rssfeed.form.php?id=".$newID); } else if (isset($_POST["delete"])) { $rssfeed->check($_POST["id"],'d'); $rssfeed->delete($_POST); Event::log($_POST["id"], "rssfeed", 4, "tools", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); $rssfeed->redirectToList(); } else if (isset($_POST["update"])) { $rssfeed->check($_POST["id"],'w'); // Right to update the rssfeed $rssfeed->update($_POST); Event::log($_POST["id"], "rssfeed", 4, "tools", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } else if (isset($_POST["addvisibility"])) { if (isset($_POST["_type"]) && !empty($_POST["_type"]) && isset($_POST["rssfeeds_id"]) && $_POST["rssfeeds_id"]) { $item = NULL; switch ($_POST["_type"]) { case 'User' : if (isset($_POST['users_id']) && $_POST['users_id']) { $item = new RSSFeed_User(); } break; case 'Group' : if (isset($_POST['groups_id']) && $_POST['groups_id']) { $item = new Group_RSSFeed(); } break; case 'Profile' : if (isset($_POST['profiles_id']) && $_POST['profiles_id']) { $item = new Profile_RSSFeed(); } break; case 'Entity' : $item = new Entity_RSSFeed(); break; } if (!is_null($item)) { $item->add($_POST); Event::log($_POST["rssfeeds_id"], "rssfeed", 4, "tools", //TRANS: %s is the user login sprintf(__('%s adds a target'), $_SESSION["glpiname"])); } } Html::back(); } else { if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") { Html::helpHeader(RSSFeed::getTypeName(2),'',$_SESSION["glpiname"]); } else { Html::header(RSSFeed::getTypeName(2),'',"utils","rssfeed"); } $rssfeed->showForm($_GET["id"]); if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") { Html::helpFooter(); } else { Html::footer(); } } ?>glpi-0.84.3+dfsg.1/front/rssfeed.php000066400000000000000000000024621226600447100171210ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.84 */ include ('../inc/includes.php'); Session::checkCentralAccess(); Html::header(RSSFeed::getTypeName(2),$_SERVER['PHP_SELF'],"utils","rssfeed"); Search::show('RSSFeed'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/rule.cache.php000066400000000000000000000036131226600447100174760ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { include ('../inc/includes.php'); } Session::checkCentralAccess(); if (!strpos($_SERVER['PHP_SELF'],"popup")) { Html::header(Rule::getTypeName(2), $_SERVER['PHP_SELF'], "admin", "dictionnary", "cache"); } if (isset($_GET["sub_type"])) { echo "
"; $rulecollection = RuleCollection::getClassByType($_GET["sub_type"]); if ($rulecollection->canView()) { if (!isset($_GET["rules_id"])) { $rulecollection->showCacheStatusForRuleType(); } else { if ($rule = getItemForItemtype($_GET["sub_type"])) { $rule->getRuleWithCriteriasAndActions($_GET["rules_id"],0,0); $rule->showCacheStatusByRule($_SERVER["HTTP_REFERER"]); } } } } if (!strpos($_SERVER['PHP_SELF'],"popup")) { Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/rule.common.form.php000066400000000000000000000054101226600447100206620ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } $rule = $rulecollection->getRuleClass(); $rulecollection->checkGlobal('r'); if (!isset($_GET["id"])) { $_GET["id"] = ""; } $rulecriteria = new RuleCriteria(get_class($rule)); $ruleaction = new RuleAction(get_class($rule)); if (isset($_POST["add_criteria"])) { $rulecollection->checkGlobal('w'); $rulecriteria->add($_POST); Html::back(); } else if (isset($_POST["add_action"])) { $rulecollection->checkGlobal('w'); $ruleaction->add($_POST); Html::back(); } else if (isset($_POST["update"])) { $rulecollection->checkGlobal('w'); $rule->update($_POST); Event::log($_POST['id'], "rules", 4, "setup", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } else if (isset($_POST["add"])) { $rulecollection->checkGlobal('w'); $newID = $rule->add($_POST); Event::log($newID, "rules", 4, "setup", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $newID)); Html::redirect($_SERVER['HTTP_REFERER']."?id=$newID"); } else if (isset($_POST["delete"])) { $rulecollection->checkGlobal('w'); $rulecollection->deleteRuleOrder($_POST["ranking"]); $rule->delete($_POST); Event::log($_POST["id"], "rules", 4, "setup", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); $rule->redirectToList(); } Html::header(Rule::getTypeName(2), $_SERVER['PHP_SELF'], 'admin', $rulecollection->menu_type, $rulecollection->menu_option); $rule->showForm($_GET["id"]); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/rule.common.php000066400000000000000000000075471226600447100177350ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } $rule = $rulecollection->getRuleClass(); if (!isset($_GET["id"])) { $_GET["id"] = ""; } $rulecollection->checkGlobal('r'); if (isset($_POST["action"])) { $rulecollection->checkGlobal('w'); $rulecollection->changeRuleOrder($_POST["id"],$_POST["action"]); Html::back(); // POST and GET needed to manage reload } else if (isset($_POST["replay_rule"]) || isset($_GET["replay_rule"])) { $rulecollection->checkGlobal('w'); // Current time $start = explode(" ",microtime()); $start = $start[0]+$start[1]; // Limit computed from current time $max = get_cfg_var("max_execution_time"); $max = $start + ($max>0 ? $max/2.0 : 30.0); Html::header(Rule::getTypeName(2), $_SERVER['PHP_SELF'], "admin", $rulecollection->menu_type, $rulecollection->menu_option); if (!(isset($_POST['replay_confirm']) || isset($_GET['offset'])) && $rulecollection->warningBeforeReplayRulesOnExistingDB($_SERVER['PHP_SELF'])) { Html::footer(); exit(); } echo ""; echo "\n"; echo "\n"; echo "
" .$rulecollection->getTitle(). "
" . __('Replay the rules dictionary'). "
"; Html::createProgressBar(__('Work in progress...')); echo "
"; if (!isset($_GET['offset'])) { // First run $offset = $rulecollection->replayRulesOnExistingDB(0, $max, array(), $_POST); $manufacturer = (isset($_POST["manufacturer"]) ? $_POST["manufacturer"] : 0); } else { // Next run $offset = $rulecollection->replayRulesOnExistingDB($_GET['offset'], $max, array(), $_GET); $manufacturer = $_GET["manufacturer"]; // global start for stat $start = $_GET["start"]; } if ($offset < 0) { // Work ended $end = explode(" ",microtime()); $duree = round($end[0]+$end[1]-$start); Html::changeProgressBarMessage(sprintf(__('Task completed in %s'), Html::timestampToString($duree))); echo "".__('Back').""; } else { // Need more work Html::redirect($_SERVER['PHP_SELF']."?start=$start&replay_rule=1&offset=$offset&manufacturer=". "$manufacturer"); } Html::footer(true); exit(); } Html::header(Rule::getTypeName(2), $_SERVER['PHP_SELF'], 'admin', $rulecollection->menu_type, $rulecollection->menu_option); $rulecollection->showTabs(); echo "
 
"; echo ""; Html::footer(); ?>glpi-0.84.3+dfsg.1/front/rule.generic.form.php000066400000000000000000000027061226600447100210130ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkCentralAccess(); if (isset($_GET["id"])) { $generic_rule = new Rule; $generic_rule->getFromDB($_GET["id"]); $generic_rule->checkGlobal('r'); $rulecollection = RuleCollection::getClassByType($generic_rule->fields["sub_type"]); include (GLPI_ROOT . "/front/rule.common.form.php"); } ?> glpi-0.84.3+dfsg.1/front/rule.php000066400000000000000000000047211226600447100164350ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkCentralAccess(); Html::header(Rule::getTypeName(2), $_SERVER['PHP_SELF'], "admin", "rule", -1); echo ""; echo ""; foreach ($CFG_GLPI["rulecollections_types"] as $rulecollectionclass) { $rulecollection = new $rulecollectionclass(); if ($rulecollection->canList()) { if ($plug = isPluginItemType($rulecollectionclass)) { $title = sprintf(__('%1$s - %2$s'), Plugin::getInfo($plug['plugin'], 'name'), $rulecollection->getTitle()); } else { $title = $rulecollection->getTitle(); } echo ""; } } if (Session::haveRight("transfer","r" ) && Session::isMultiEntitiesMode()) { echo ""; } if (Session::haveRight("config","r" )) { echo ""; } echo "
" . __('Rule type') . "
"; echo ""; echo $title."
"; echo "".__('Transfer').""; echo "
"; echo "". _n('Blacklist','Blacklists',2).""; echo "
"; Html::footer(); ?>glpi-0.84.3+dfsg.1/front/rule.test.php000066400000000000000000000051011226600447100174040ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { include ('../inc/includes.php'); } Session::checkCentralAccess(); if (isset($_POST["sub_type"])) { $sub_type = $_POST["sub_type"]; } else if (isset($_GET["sub_type"])) { $sub_type = $_GET["sub_type"]; } else { $sub_type = 0; } if (isset($_POST["rules_id"])) { $rules_id = $_POST["rules_id"]; } else if (isset($_GET["rules_id"])) { $rules_id = $_GET["rules_id"]; } else { $rules_id = 0; } if (!$rule = getItemForItemtype($sub_type)) { exit; } $rule->checkGlobal('r'); $test_rule_output = null; if (!strpos($_SERVER['PHP_SELF'],"popup")) { Html::header(__('Setup'),$_SERVER['PHP_SELF'],"config","display"); } $rule->showRulePreviewCriteriasForm($_SERVER['PHP_SELF'], $rules_id); if (isset($_POST["test_rule"])) { $params = array(); //Unset values that must not be processed by the rule unset($_POST["test_rule"]); unset($_POST["rules_id"]); unset($_POST["sub_type"]); $rule->getRuleWithCriteriasAndActions($rules_id,1,1); // Need for RuleEngines foreach ($_POST as $key => $val) { $_POST[$key] = stripslashes($_POST[$key]); } //Add rules specific POST fields to the param array $params = $rule->addSpecificParamsForPreview($params); $input = $rule->prepareAllInputDataForProcess($_POST, $params); //$rule->regex_results = array(); echo "
"; $rule->showRulePreviewResultsForm($_SERVER['PHP_SELF'], $input, $params); } if (!strpos($_SERVER['PHP_SELF'],"popup")) { Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/ruledictionnarycomputermodel.form.php000066400000000000000000000024241226600447100244410ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryComputerModelCollection(); include (GLPI_ROOT . "/front/rule.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnarycomputermodel.php000066400000000000000000000024121226600447100234740ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryComputerModelCollection(); include (GLPI_ROOT . "/front/rule.common.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnarycomputertype.form.php000066400000000000000000000024221226600447100243200ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryComputerTypeCollection(); include (GLPI_ROOT . "/front/rule.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnarycomputertype.php000066400000000000000000000024101226600447100233530ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryComputerTypeCollection(); include (GLPI_ROOT . "/front/rule.common.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnarymanufacturer.form.php000066400000000000000000000024221226600447100242540ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryManufacturerCollection(); include (GLPI_ROOT . "/front/rule.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnarymanufacturer.php000066400000000000000000000024101226600447100233070ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryManufacturerCollection(); include (GLPI_ROOT . "/front/rule.common.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnarymonitormodel.form.php000066400000000000000000000024221226600447100242700ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryMonitorModelCollection(); include (GLPI_ROOT . "/front/rule.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnarymonitormodel.php000066400000000000000000000024101226600447100233230ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryMonitorModelCollection(); include (GLPI_ROOT . "/front/rule.common.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnarymonitortype.form.php000066400000000000000000000024201226600447100241470ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryMonitorTypeCollection(); include (GLPI_ROOT . "/front/rule.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnarymonitortype.php000066400000000000000000000024061226600447100232110ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryMonitorTypeCollection(); include (GLPI_ROOT . "/front/rule.common.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnarynetworkequipmentmodel.form.php000066400000000000000000000024441226600447100262260ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryNetworkEquipmentModelCollection(); include (GLPI_ROOT . "/front/rule.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnarynetworkequipmentmodel.php000066400000000000000000000024321226600447100252610ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryNetworkEquipmentModelCollection(); include (GLPI_ROOT . "/front/rule.common.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnarynetworkequipmenttype.form.php000066400000000000000000000024421226600447100261050ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryNetworkEquipmentTypeCollection(); include (GLPI_ROOT . "/front/rule.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnarynetworkequipmenttype.php000066400000000000000000000024301226600447100251400ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryNetworkEquipmentTypeCollection(); include (GLPI_ROOT . "/front/rule.common.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnaryoperatingsystem.form.php000066400000000000000000000024301226600447100250140ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryOperatingSystemCollection(); include (GLPI_ROOT . "/front/rule.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnaryoperatingsystem.php000066400000000000000000000024161226600447100240560ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryOperatingSystemCollection(); include (GLPI_ROOT . "/front/rule.common.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnaryoperatingsystemservicepack.form.php000066400000000000000000000024561226600447100272440ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryOperatingSystemServicePackCollection(); include (GLPI_ROOT . "/front/rule.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnaryoperatingsystemservicepack.php000066400000000000000000000024441226600447100262770ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryOperatingSystemServicePackCollection(); include (GLPI_ROOT . "/front/rule.common.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnaryoperatingsystemversion.form.php000066400000000000000000000024461226600447100264310ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryOperatingSystemVersionCollection(); include (GLPI_ROOT . "/front/rule.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnaryoperatingsystemversion.php000066400000000000000000000024341226600447100254640ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryOperatingSystemVersionCollection(); include (GLPI_ROOT . "/front/rule.common.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnaryperipheralmodel.form.php000066400000000000000000000024301226600447100247330ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryPeripheralModelCollection(); include (GLPI_ROOT . "/front/rule.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnaryperipheralmodel.php000066400000000000000000000024161226600447100237750ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryPeripheralModelCollection(); include (GLPI_ROOT . "/front/rule.common.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnaryperipheraltype.form.php000066400000000000000000000024261226600447100246210ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryPeripheralTypeCollection(); include (GLPI_ROOT . "/front/rule.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnaryperipheraltype.php000066400000000000000000000024141226600447100236540ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryPeripheralTypeCollection(); include (GLPI_ROOT . "/front/rule.common.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnaryphonemodel.form.php000066400000000000000000000024161226600447100237150ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryPhoneModelCollection(); include (GLPI_ROOT . "/front/rule.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnaryphonemodel.php000066400000000000000000000024041226600447100227500ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryPhoneModelCollection(); include (GLPI_ROOT . "/front/rule.common.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnaryphonetype.form.php000066400000000000000000000024141226600447100235740ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryPhoneTypeCollection(); include (GLPI_ROOT . "/front/rule.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnaryphonetype.php000066400000000000000000000024021226600447100226270ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryPhoneTypeCollection(); include (GLPI_ROOT . "/front/rule.common.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnaryprinter.form.php000066400000000000000000000024101226600447100232400ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryPrinterCollection(); include (GLPI_ROOT . "/front/rule.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnaryprinter.php000066400000000000000000000023761226600447100223110ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryPrinterCollection(); include (GLPI_ROOT . "/front/rule.common.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnaryprintermodel.form.php000066400000000000000000000024221226600447100242640ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryPrinterModelCollection(); include (GLPI_ROOT . "/front/rule.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnaryprintermodel.php000066400000000000000000000024101226600447100233170ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryPrinterModelCollection(); include (GLPI_ROOT . "/front/rule.common.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnaryprintertype.form.php000066400000000000000000000024201226600447100241430ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryPrinterTypeCollection(); include (GLPI_ROOT . "/front/rule.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnaryprintertype.php000066400000000000000000000024061226600447100232050ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnaryPrinterTypeCollection(); include (GLPI_ROOT . "/front/rule.common.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnarysoftware.form.php000066400000000000000000000024121226600447100234110ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnarySoftwareCollection(); include (GLPI_ROOT . "/front/rule.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/ruledictionnarysoftware.php000066400000000000000000000024001226600447100224440ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleDictionnarySoftwareCollection(); include (GLPI_ROOT . "/front/rule.common.php"); ?> glpi-0.84.3+dfsg.1/front/ruleimportcomputer.form.php000066400000000000000000000024001226600447100224010ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleImportComputerCollection(); include (GLPI_ROOT . "/front/rule.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/ruleimportcomputer.php000066400000000000000000000023661226600447100214520ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleImportComputerCollection(); include (GLPI_ROOT . "/front/rule.common.php"); ?> glpi-0.84.3+dfsg.1/front/ruleimportentity.form.php000066400000000000000000000023761226600447100220730ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleImportEntityCollection(-1); include (GLPI_ROOT . "/front/rule.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/ruleimportentity.php000066400000000000000000000023641226600447100211260ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleImportEntityCollection(-1); include (GLPI_ROOT . "/front/rule.common.php"); ?> glpi-0.84.3+dfsg.1/front/rulemailcollector.form.php000066400000000000000000000023761226600447100221550ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleMailCollectorCollection(); include (GLPI_ROOT . "/front/rule.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/rulemailcollector.php000066400000000000000000000023641226600447100212100ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleMailCollectorCollection(); include (GLPI_ROOT . "/front/rule.common.php"); ?> glpi-0.84.3+dfsg.1/front/ruleright.form.php000066400000000000000000000023561226600447100204370ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleRightCollection(); include (GLPI_ROOT . "/front/rule.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/ruleright.php000066400000000000000000000023441226600447100174720ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleRightCollection(); include (GLPI_ROOT . "/front/rule.common.php"); ?> glpi-0.84.3+dfsg.1/front/rulerightparameter.form.php000066400000000000000000000023631226600447100223360ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new RuleRightParameter(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/rulerightparameter.php000066400000000000000000000023511226600447100213710ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new RuleRightParameter(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/rulesengine.test.php000066400000000000000000000043211226600447100207600ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { include ('../inc/includes.php'); } Session::checkCentralAccess(); if (isset($_POST["sub_type"])) { $sub_type = $_POST["sub_type"]; } else if (isset($_GET["sub_type"])) { $sub_type = $_GET["sub_type"]; } else { $sub_type = 0; } $rulecollection = RuleCollection::getClassByType($sub_type); if ($rulecollection->isRuleRecursive()) { $rulecollection->setEntity($_SESSION['glpiactive_entity']); } $rulecollection->checkGlobal('r'); if (!strpos($_SERVER['PHP_SELF'],"popup")) { Html::header(__('Setup'),$_SERVER['PHP_SELF'],"config","display"); } // Need for RuleEngines foreach ($_POST as $key => $val) { $_POST[$key] = stripslashes($_POST[$key]); } $input = $rulecollection->showRulesEnginePreviewCriteriasForm($_SERVER['PHP_SELF'], $_POST); if (isset($_POST["test_all_rules"])) { //Unset values that must not be processed by the rule unset($_POST["sub_type"]); unset($_POST["test_all_rules"]); echo "
"; $rulecollection->showRulesEnginePreviewResultsForm($_SERVER['PHP_SELF'], $_POST); } if (!strpos($_SERVER['PHP_SELF'],"popup")) { Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/rulesoftwarecategory.form.php000066400000000000000000000024041226600447100227040ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleSoftwareCategoryCollection(); include (GLPI_ROOT . "/front/rule.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/rulesoftwarecategory.php000066400000000000000000000023721226600447100217460ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleSoftwareCategoryCollection(); include (GLPI_ROOT . "/front/rule.common.php"); ?> glpi-0.84.3+dfsg.1/front/ruleticket.form.php000066400000000000000000000024161226600447100206020ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleTicketCollection($_SESSION['glpiactive_entity']); include (GLPI_ROOT . "/front/rule.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/ruleticket.php000066400000000000000000000024051226600447100176360ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $rulecollection = new RuleTicketCollection($_SESSION['glpiactive_entity']); include (GLPI_ROOT . "/front/rule.common.php"); ?> glpi-0.84.3+dfsg.1/front/search.php000066400000000000000000000047101226600447100167310ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkCentralAccess(); Html::header(__('Search'),$_SERVER['PHP_SELF']); if (!$CFG_GLPI['allow_search_global']) { Html::displayRightError(); } if (isset($_GET["globalsearch"])) { $searchtext=$_GET["globalsearch"]; foreach ($CFG_GLPI["globalsearch_types"] as $itemtype) { if (($item = getItemForItemtype($itemtype)) && $item->canView()) { $_GET["reset"] = 'reset'; $_GET["display_type"] = Search::GLOBAL_SEARCH; Search::manageGetValues($itemtype,false,true); if (!isset($_GET["field"][0])) { // From global search only $_GET["field"][0] = 'view'; } if ($_GET["field"][0] =='view') { $_GET["contains"][0] = $searchtext; $_GET["searchtype"][0] = 'contains'; $_SESSION["glpisearchcount"][$itemtype] = 1; } else { $_GET["field"][1] = 'view'; $_GET["contains"][1] = $searchtext; $_GET["searchtype"][1] = 'contains'; $_SESSION["glpisearchcount"][$itemtype] = 2; } Search::showList($itemtype, $_GET); unset($_GET["contains"]); unset($_GET["searchtype"]); echo "
"; $_GET = array(); } } } Html::footer(); ?>glpi-0.84.3+dfsg.1/front/setup.auth.php000066400000000000000000000047041226600447100175670ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("config", "r"); Html::header(__('External authentication sources'), $_SERVER['PHP_SELF'], "config", "extauth", -1); echo ""; echo ""; if (Session::haveRight("config","w")) { echo ""; } echo ""; echo ""; echo ""; echo "
 " . __('External authentications') . "
". "" .__('Setup')."
"; if (Toolbox::canUseLdap()) { echo "". _n('LDAP directory', 'LDAP directories', 2).""; } else { echo "

".__("The LDAP extension of your PHP parser isn't installed") ."

"; echo "

".__('Impossible to use LDAP as external source of connection').'

'; } echo "
"; if (Toolbox::canUseImapPop()) { echo "". _n('Mail server', 'Mail servers', 2).""; } else { echo "

".__('Your PHP parser was compiled without the IMAP functions') ."

"; echo "

".__('Impossible to use email server as external source of connection').'

'; } echo "
". "" . __('Others authentication methods') ."
"; Html::footer(); ?>glpi-0.84.3+dfsg.1/front/setup.notification.php000066400000000000000000000060531226600447100213130ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkSeveralRightsOr(array('notification' => 'r', 'config' => 'w')); Html::header(_n('Notification', 'Notifications',2), $_SERVER['PHP_SELF'], "config", "mailing", -1); if (isset($_POST['activate'])) { $config = new Config(); $tmp['id'] = $CFG_GLPI['id']; $tmp['use_mailing'] = 1; $config->update($tmp); Html::back(); } if (!$CFG_GLPI['use_mailing']) { if (Session::haveRight("config","w")) { echo "
"; Html::showSimpleForm($_SERVER['PHP_SELF'], 'activate', __('Enable followup via email')); echo "
"; } } else { if (!Session::haveRight("config","r") && Session::haveRight("notification","r") && $CFG_GLPI['use_mailing']) { Html::redirect($CFG_GLPI["root_doc"].'/front/notification.php'); } else { echo ""; echo ""; if (Session::haveRight("config","r")) { echo ""; echo ""; } if (Session::haveRight("notification","r") && $CFG_GLPI['use_mailing']) { echo ""; } else { echo ""; } echo "
" . _n('Notification', 'Notifications',2)."
". "". __('Email followups configuration') . "
" . _n('Notification template', 'Notification templates', 2) ."
". "". _n('Notification', 'Notifications',2)."
" . __('Impossible to configure the notifications: please configure your email followup using the above configuration.') . "
"; } } Html::footer(); ?> glpi-0.84.3+dfsg.1/front/setup.templates.php000066400000000000000000000031571226600447100206250ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ // Based on: // IRMA, Information Resource-Management and Administration // Christian Bauer /** @file * @brief */ include ('../inc/includes.php'); Session::checkCentralAccess(); if (isset($_GET["itemtype"])) { $link = Toolbox::getItemTypeFormURL($_GET["itemtype"]); $item = str_replace(".form.php","",$link); $item = str_replace("front/","",$item); Html::header(__('Manage templates...'), $_SERVER['PHP_SELF'], "inventory", $item); CommonDBTM::listTemplates($_GET["itemtype"], $link, $_GET["add"]); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/sla.form.php000077500000000000000000000043151226600447100172110ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("sla", "r"); if (empty($_GET["id"])) { $_GET["id"] = ""; } $sla = new SLA(); if (isset($_POST["add"])) { $sla->check(-1, 'w'); $newID = $sla->add($_POST); Event::log($newID, "slas", 4, "setup", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); Html::redirect($CFG_GLPI["root_doc"]."/front/sla.php"); } else if (isset($_POST["delete"])) { $sla->check($_POST["id"], 'd'); $sla->delete($_POST); Event::log($_POST["id"], "slas", 4, "setup", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); $sla->redirectToList(); } else if (isset($_POST["update"])) { $sla->check($_POST["id"], 'w'); $sla->update($_POST); Event::log($_POST["id"], "slas", 4, "setup", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } else { Html::header(SLA::getTypeName(2), $_SERVER['PHP_SELF'], "config", "sla"); $sla->showForm($_GET["id"]); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/sla.php000077500000000000000000000024221226600447100162440ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("sla", "r"); Html::header(SLA::getTypeName(2), $_SERVER['PHP_SELF'], "config", "sla"); Search::show('SLA'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/slalevel.form.php000077500000000000000000000054401226600447100202410ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $item = new SlaLevel(); if (isset($_POST["update"])) { $item->check($_POST["id"], 'w'); $item->update($_POST); Event::log($_POST["id"], "slas", 4, "setup", //TRANS: %s is the user login sprintf(__('%s updates a sla level'), $_SESSION["glpiname"])); Html::back(); } else if (isset($_POST["add"])) { $item->check(-1, 'w', $_POST); if ($item->add($_POST)) { Event::log($_POST["slas_id"], "slas", 4, "setup", //TRANS: %s is the user login sprintf(__('%s adds a link with an item'), $_SESSION["glpiname"])); } Html::back(); } else if (isset($_POST["delete"])) { if (isset($_POST['id'])) { $item->check($_POST['id'], 'd'); $ok = $item->delete($_POST); if ($ok) { Event::log($_POST["id"], "slas", 4, "setup", //TRANS: %s is the user login sprintf(__('%s deletes a sla level'), $_SESSION["glpiname"])); } $item->redirectToList(); } Html::back(); } else if (isset($_POST["add_action"])) { /// TODO create specific form $item->check($_POST['slalevels_id'], 'w'); $action = new SlaLevelAction(); $action->add($_POST); Html::back(); } else if (isset($_POST["add_criteria"])) { $item->check($_POST['slalevels_id'], 'w'); $criteria = new SlaLevelCriteria(); $criteria->add($_POST); Html::back(); } else if (isset($_GET["id"]) && ($_GET["id"] > 0)) { //print computer information Html::header(SlaLevel::getTypeName(2), $_SERVER['PHP_SELF'], "config", "sla"); //show computer form to add $item->showForm($_GET["id"]); Html::footer(); } Html::displayErrorAndDie('Lost'); ?>glpi-0.84.3+dfsg.1/front/software.form.php000066400000000000000000000056721226600447100202700ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("software", "r"); if (!isset($_GET["id"])) { $_GET["id"] = ""; } if (!isset($_GET["withtemplate"])) { $_GET["withtemplate"] = ""; } $soft = new Software(); if (isset($_POST["add"])) { $soft->check(-1,'w',$_POST); $newID = $soft->add($_POST); Event::log($newID, "software", 4, "inventory", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); Html::back(); } else if (isset($_POST["delete"])) { $soft->check($_POST["id"],'d'); $soft->delete($_POST); Event::log($_POST["id"], "software", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s deletes an item'), $_SESSION["glpiname"])); $soft->redirectToList(); } else if (isset($_POST["restore"])) { $soft->check($_POST["id"],'d'); $soft->restore($_POST); Event::log($_POST["id"], "software", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s restores an item'), $_SESSION["glpiname"])); $soft->redirectToList(); } else if (isset($_POST["purge"])) { $soft->check($_POST["id"],'d'); $soft->delete($_POST,1); Event::log($_POST["id"], "software", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); $soft->redirectToList(); } else if (isset($_POST["update"])) { $soft->check($_POST["id"],'w'); $soft->update($_POST); Event::log($_POST["id"], "software", 4, "inventory", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } else { Html::header(Software::getTypeName(2), $_SERVER['PHP_SELF'], "inventory", "software"); $soft->showForm($_GET["id"], array('withtemplate' => $_GET["withtemplate"])); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/software.php000066400000000000000000000024561226600447100173230ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("software", "r"); Html::header(Software::getTypeName(2), $_SERVER['PHP_SELF'], "inventory", "software"); Search::show('Software'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/softwarecategory.form.php000066400000000000000000000023561226600447100220220ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new SoftwareCategory(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/softwarecategory.php000066400000000000000000000023451226600447100210560ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new SoftwareCategory(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/softwarelicense.form.php000066400000000000000000000051431226600447100216240ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("software", "r"); if (!isset($_GET["id"])) { $_GET["id"] = ""; } if (!isset($_GET["softwares_id"])) { $_GET["softwares_id"] = ""; } $license = new SoftwareLicense(); if (isset($_POST["add"])) { $license->check(-1,'w',$_POST); $newID = $license->add($_POST); Event::log($_POST['softwares_id'], "software", 4, "inventory", //TRANS: %s is the user login, %2$s is the license id sprintf(__('%1$s adds the license %2$s'), $_SESSION["glpiname"], $newID)); Html::back(); } else if (isset($_POST["delete"])) { $license->check($_POST['id'],'d'); $license->delete($_POST); Event::log($license->fields['softwares_id'], "software", 4, "inventory", //TRANS: %s is the user login, %2$s is the license id sprintf(__('%1$s deletes the license %2$s'), $_SESSION["glpiname"], $_POST["id"])); $license->redirectToList(); } else if (isset($_POST["update"])) { $license->check($_POST['id'],'w'); $license->update($_POST); Event::log($license->fields['softwares_id'], "software", 4, "inventory", //TRANS: %s is the user login, %2$s is the license id sprintf(__('%1$s updates the license %2$s'), $_SESSION["glpiname"], $_POST["id"])); Html::back(); } else { Html::header(SoftwareLicense::getTypeName(2), $_SERVER['PHP_SELF'], "inventory", "software"); $license->showForm($_GET["id"], array('softwares_id' => $_GET["softwares_id"])); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/softwarelicensetype.form.php000066400000000000000000000023641226600447100225300ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new SoftwareLicenseType(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/softwarelicensetype.php000066400000000000000000000023531226600447100215640ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new SoftwareLicenseType(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/softwareversion.form.php000066400000000000000000000053741226600447100216750ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("software", "r"); if (!isset($_GET["id"])) { $_GET["id"] = ""; } if (!isset($_GET["softwares_id"])) { $_GET["softwares_id"] = ""; } $version = new SoftwareVersion(); if (isset($_POST["add"])) { $version->check(-1,'w',$_POST); if ($newID = $version->add($_POST)) { Event::log($_POST['softwares_id'], "software", 4, "inventory", //TRANS: %s is the user login, %2$s is the version id sprintf(__('%1$s adds the version %2$s'), $_SESSION["glpiname"], $newID)); Html::redirect($CFG_GLPI["root_doc"]."/front/software.form.php?id=". $version->fields['softwares_id']); } Html::back(); } else if (isset($_POST["delete"])) { $version->check($_POST['id'],'d'); $version->delete($_POST); Event::log($version->fields['softwares_id'], "software", 4, "inventory", //TRANS: %s is the user login, %2$s is the version id sprintf(__('%1$s deletes the version %2$s'), $_SESSION["glpiname"], $_POST["id"])); $version->redirectToList(); } else if (isset($_POST["update"])) { $version->check($_POST['id'],'w'); $version->update($_POST); Event::log($version->fields['softwares_id'], "software", 4, "inventory", //TRANS: %s is the user login, %2$s is the version id sprintf(__('%1$s updates the version %2$s'), $_SESSION["glpiname"], $_POST["id"])); Html::back(); } else { Html::header(SoftwareVersion::getTypeName(2), $_SERVER['PHP_SELF'], "inventory", "software"); $version->showForm($_GET["id"], array('softwares_id' => $_GET["softwares_id"])); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/solutiontemplate.form.php000066400000000000000000000023571226600447100220430ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new SolutionTemplate(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/solutiontemplate.php000066400000000000000000000023451226600447100210760ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new SolutionTemplate(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/solutiontype.form.php000066400000000000000000000023471226600447100212100ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new SolutionType(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?> glpi-0.84.3+dfsg.1/front/solutiontype.php000066400000000000000000000023351226600447100202430ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new SolutionType(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/ssovariable.form.php000066400000000000000000000023441226600447100207410ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new SsoVariable(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/ssovariable.php000066400000000000000000000023331226600447100177750ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new SsoVariable(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/stat.global.php000066400000000000000000000212371226600447100177010ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Html::header(__('Statistics'), $_SERVER['PHP_SELF'], "maintain", "stat"); Session::checkRight("statistic", "1"); if (empty($_GET["date1"]) && empty($_GET["date2"])) { $year = date("Y")-1; $_GET["date1"] = date("Y-m-d", mktime(1,0,0,date("m"), date("d"), $year)); $_GET["date2"] = date("Y-m-d"); } if (!empty($_GET["date1"]) && !empty($_GET["date2"]) && (strcmp($_GET["date2"],$_GET["date1"]) < 0)) { $tmp = $_GET["date1"]; $_GET["date1"] = $_GET["date2"]; $_GET["date2"] = $tmp; } Stat::title(); if (!$item = getItemForItemtype($_GET['itemtype'])) { exit; } echo "
"; echo ""; echo ""; echo ""; echo "
".__('Start date').""; Html::showDateFormItem("date1", $_GET["date1"]); echo ""; echo ""; echo "
".__('End date').""; Html::showDateFormItem("date2",$_GET["date2"]); echo "
"; ///////// Stats nombre intervention // Total des interventions $values['total'] = Stat::constructEntryValues($_GET['itemtype'], "inter_total", $_GET["date1"], $_GET["date2"]); // Total des interventions résolues $values['solved'] = Stat::constructEntryValues($_GET['itemtype'], "inter_solved", $_GET["date1"], $_GET["date2"]); // Total des interventions closes $values['closed'] = Stat::constructEntryValues($_GET['itemtype'], "inter_closed", $_GET["date1"], $_GET["date2"]); // Total des interventions closes $values['late'] = Stat::constructEntryValues($_GET['itemtype'], "inter_solved_late", $_GET["date1"], $_GET["date2"]); $available = array('total' => __('Opened'), 'solved' => __('Solved'), 'late' => __('Late'), 'closed' => __('Closed'),); echo "
"; $show_all = false; if (!isset($_GET['graph']) || (count($_GET['graph']) == 0)) { $show_all = true; } foreach ($available as $key => $name) { echo " ".$name." "; } echo "
"; $toprint = array(); foreach ($available as $key => $name) { if ($show_all || isset($_GET['graph'][$key])) { $toprint[$name] = $values[$key]; } } Stat::showGraph($toprint, array('title' => _x('Quantity', 'Number'), 'showtotal' => 1, 'unit' => $item->getTypeName(2))); //Temps moyen de resolution d'intervention $values2['avgsolved'] = Stat::constructEntryValues($_GET['itemtype'] ,"inter_avgsolvedtime", $_GET["date1"], $_GET["date2"]); // Pass to hour values foreach ($values2['avgsolved'] as $key => $val) { $values2['avgsolved'][$key] /= HOUR_TIMESTAMP; } //Temps moyen de cloture d'intervention $values2['avgclosed'] = Stat::constructEntryValues($_GET['itemtype'], "inter_avgclosedtime", $_GET["date1"], $_GET["date2"]); // Pass to hour values foreach ($values2['avgclosed'] as $key => $val) { $values2['avgclosed'][$key] /= HOUR_TIMESTAMP; } //Temps moyen d'intervention reel $values2['avgactiontime'] = Stat::constructEntryValues($_GET['itemtype'], "inter_avgactiontime", $_GET["date1"], $_GET["date2"]); // Pass to hour values foreach ($values2['avgactiontime'] as $key => $val) { $values2['avgactiontime'][$key] /= HOUR_TIMESTAMP; } $available = array('avgclosed' => __('Closure'), 'avgsolved' => __('Resolution'), 'avgactiontime' => __('Real duration')); if ($_GET['itemtype'] == 'Ticket') { $available['avgtaketime'] = __('Take into account'); //Temps moyen de prise en compte de l'intervention $values2['avgtaketime'] = Stat::constructEntryValues($_GET['itemtype'], "inter_avgtakeaccount", $_GET["date1"], $_GET["date2"]); // Pass to hour values foreach ($values2['avgtaketime'] as $key => $val) { $values2['avgtaketime'][$key] /= HOUR_TIMESTAMP; } } echo "
"; $show_all2 = false; if (!isset($_GET['graph2']) || (count($_GET['graph2']) == 0)) { $show_all2 = true; } foreach ($available as $key => $name) { echo " ".$name." "; } echo "
"; $toprint = array(); foreach ($available as $key => $name) { if ($show_all2 || isset($_GET['graph2'][$key])) { $toprint[$name] = $values2[$key]; } } Stat::showGraph($toprint, array('title' => __('Average time'), 'unit' => _n('Hour', 'Hours', 2), 'showtotal' => 1, 'datatype' => 'average')); if ($_GET['itemtype'] == 'Ticket') { ///////// Satisfaction $values['opensatisfaction'] = Stat::constructEntryValues($_GET['itemtype'], "inter_opensatisfaction", $_GET["date1"], $_GET["date2"]); $values['answersatisfaction'] = Stat::constructEntryValues($_GET['itemtype'], "inter_answersatisfaction", $_GET["date1"], $_GET["date2"]); $available = array('opensatisfaction' => __('Opened'), 'answersatisfaction' => __('Answered')); echo "
"; foreach ($available as $key => $name) { echo " ".$name." "; } echo "
"; $toprint = array(); foreach ($available as $key => $name) { if ($show_all || isset($_GET['graph'][$key])) { $toprint[$name] = $values[$key]; } } Stat::showGraph($toprint, array('title' => __('Satisfaction survey'), 'showtotal' => 1, 'unit' => __('Tickets'))); $values['avgsatisfaction'] = Stat::constructEntryValues($_GET['itemtype'], "inter_avgsatisfaction", $_GET["date1"], $_GET["date2"]); $available = array('avgsatisfaction' => __('Satisfaction')); echo "
"; foreach ($available as $key => $name) { echo " ".$name." "; } echo "
"; $toprint = array(); foreach ($available as $key => $name) { if ($show_all || isset($_GET['graph'][$key])) { $toprint[$name] = $values[$key]; } } Stat::showGraph($toprint, array('title' => __('Satisfaction'))); } // form using GET method : CRSF not needed echo ""; Html::footer(); ?>glpi-0.84.3+dfsg.1/front/stat.graph.php000066400000000000000000000441231226600447100175410ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Html::header(__('Statistics'), $_SERVER['PHP_SELF'], "maintain", "stat"); Session::checkRight("statistic", "1"); if (!$item = getItemForItemtype($_GET['itemtype'])) { exit; } if (empty($_POST["date1"]) && empty($_POST["date2"])) { if (isset($_GET["date1"])) { $_POST["date1"] = $_GET["date1"]; } if (isset($_GET["date2"])) { $_POST["date2"] = $_GET["date2"]; } } if (!empty($_POST["date1"]) && !empty($_POST["date2"]) && (strcmp($_POST["date2"],$_POST["date1"]) < 0)) { $tmp = $_POST["date1"]; $_POST["date1"] = $_POST["date2"]; $_POST["date2"] = $tmp; } $cleantarget = preg_replace("/[&]date[12]=[0-9-]*/","",$_SERVER['QUERY_STRING']); $cleantarget = preg_replace("/[&]*id=([0-9]+[&]{0,1})/","",$cleantarget); $cleantarget = preg_replace("/&/","&",$cleantarget); $next = 0; $prev = 0; $title = ""; $cond = ''; $parent = 0; $showuserlink = 0; if (Session::haveRight('user','r')) { $showuserlink = 1; } switch($_GET["type"]) { case "technicien" : $val1 = $_GET["id"]; $val2 = ""; $values = Stat::getItems($_GET["itemtype"], $_GET["date1"], $_GET["date2"], $_GET["type"]); $title = sprintf(__('%1$s: %2$s'), __('Technician'), $item->getAssignName($_GET["id"], 'User', $showuserlink)); break; case "technicien_followup" : $val1 = $_GET["id"]; $val2 = ""; $values = Stat::getItems($_GET["itemtype"], $_GET["date1"], $_GET["date2"], $_GET["type"]); $title = sprintf(__('%1$s: %2$s'), __('Technician'), $item->getAssignName($_GET["id"], 'User', $showuserlink)); break; case "suppliers_id_assign" : $val1 = $_GET["id"]; $val2 = ""; $values = Stat::getItems($_GET["itemtype"], $_GET["date1"], $_GET["date2"], $_GET["type"]); $title = sprintf(__('%1$s: %2$s'), __('Supplier'), $item->getAssignName($_GET["id"], 'Supplier', $showuserlink)); break; case "user" : $val1 = $_GET["id"]; $val2 = ""; $values = Stat::getItems($_GET["itemtype"], $_GET["date1"], $_GET["date2"], $_GET["type"]); $title = sprintf(__('%1$s: %2$s'), __('User'), getUserName($_GET["id"], $showuserlink)); break; case "users_id_recipient" : $val1 = $_GET["id"]; $val2 = ""; $values = Stat::getItems($_GET["itemtype"], $_GET["date1"], $_GET["date2"], $_GET["type"]); $title = sprintf(__('%1$s: %2$s'), __('User'), getUserName($_GET["id"], $showuserlink)); break; case "itilcategories_tree" : $parent = (isset($_GET['champ']) ? $_GET['champ'] : 0); $cond = "(`id` = '$parent' OR `itilcategories_id` = '$parent')"; // nobreak; case "itilcategories_id" : $val1 = $_GET["id"]; $val2 = ""; $values = Stat::getItems($_GET["itemtype"], $_GET["date1"], $_GET["date2"], $_GET["type"], $parent); $title = sprintf(__('%1$s: %2$s'), __('Category'), Dropdown::getDropdownName("glpi_itilcategories", $_GET["id"])); break; case 'locations_tree' : $parent = (isset($_GET['champ']) ? $_GET['champ'] : 0); $cond = "(`id` = '$parent' OR `locations_id` = '$parent')"; // nobreak; case 'locations_id' : $val1 = $_GET['id']; $val2 = ''; $values = Stat::getItems($_GET['itemtype'], $_GET['date1'], $_GET['date2'], $_GET['type'], $parent); $title = sprintf(__('%1$s: %2$s'), __('Location'), Dropdown::getDropdownName('glpi_locations', $_GET['id'])); break; case "type" : $val1 = $_GET["id"]; $val2 = ""; $values = Stat::getItems($_GET["itemtype"], $_GET["date1"], $_GET["date2"], $_GET["type"]); $title = sprintf(__('%1$s: %2$s'), __('Type'), Ticket::getTicketTypeName($_GET["id"])); break; case 'group_tree' : case 'groups_tree_assign' : $parent = (isset($_GET['champ']) ? $_GET['champ'] : 0); $cond = " (`id` = '$parent' OR `groups_id` = '$parent') AND ".(($_GET["type"] == 'group_tree') ? '`is_requester`' : '`is_assign`'); // nobreak; case "group" : $val1 = $_GET["id"]; $val2 = ""; $values = Stat::getItems($_GET["itemtype"], $_GET["date1"], $_GET["date2"], $_GET["type"], $parent); $title = sprintf(__('%1$s: %2$s'), __('Group'), Dropdown::getDropdownName("glpi_groups", $_GET["id"])); break; case "groups_id_assign" : $val1 = $_GET["id"]; $val2 = ""; $values = Stat::getItems($_GET["itemtype"], $_GET["date1"], $_GET["date2"], $_GET["type"]); $title = sprintf(__('%1$s: %2$s'), __('Group'), Dropdown::getDropdownName("glpi_groups", $_GET["id"])); break; case "priority" : $val1 = $_GET["id"]; $val2 = ""; $values = Stat::getItems($_GET["itemtype"], $_GET["date1"], $_GET["date2"], $_GET["type"]); $title = sprintf(__('%1$s: %2$s'), __('Priority'), $item->getPriorityName($_GET["id"])); break; case "urgency" : $val1 = $_GET["id"]; $val2 = ""; $values = Stat::getItems($_GET["itemtype"], $_GET["date1"], $_GET["date2"], $_GET["type"]); $title = sprintf(__('%1$s: %2$s'), __('Urgency'), $item->getUrgencyName($_GET["id"])); break; case "impact" : $val1 = $_GET["id"]; $val2 = ""; $values = Stat::getItems($_GET["itemtype"], $_GET["date1"], $_GET["date2"], $_GET["type"]); $title = sprintf(__('%1$s: %2$s'), __('Impact'), $item->getImpactName($_GET["id"])); break; case "usertitles_id" : $val1 = $_GET["id"]; $val2 = ""; $values = Stat::getItems($_GET["itemtype"], $_GET["date1"], $_GET["date2"], $_GET["type"]); $title = sprintf(__('%1$s: %2$s'), _x('person','Title'), Dropdown::getDropdownName("glpi_usertitles", $_GET["id"])); break; case "solutiontypes_id" : $val1 = $_GET["id"]; $val2 = ""; $values = Stat::getItems($_GET["itemtype"], $_GET["date1"], $_GET["date2"], $_GET["type"]); $title = sprintf(__('%1$s: %2$s'), __('Solution type'), Dropdown::getDropdownName("glpi_solutiontypes", $_GET["id"])); break; case "usercategories_id" : $val1 = $_GET["id"]; $val2 = ""; $values = Stat::getItems($_GET["itemtype"], $_GET["date1"], $_GET["date2"], $_GET["type"]); $title = sprintf(__('%1$s: %2$s'), __('Category'), Dropdown::getDropdownName("glpi_usercategories", $_GET["id"])); break; case "requesttypes_id" : $val1 = $_GET["id"]; $val2 = ""; $values = Stat::getItems($_GET["itemtype"], $_GET["date1"], $_GET["date2"], $_GET["type"]); $title = sprintf(__('%1$s: %2$s'), __('Request source'), Dropdown::getDropdownName("glpi_requesttypes", $_GET["id"])); break; case "device" : $val1 = $_GET["id"]; $val2 = $_GET["champ"]; if ($item = getItemForItemtype($_GET["champ"])) { $device_table = $item->getTable(); $values = Stat::getItems($_GET["itemtype"], $_GET["date1"], $_GET["date2"], $_GET["champ"]); $query = "SELECT `designation` FROM `".$device_table."` WHERE `id` = '".$_GET['id']."'"; $result = $DB->query($query); $title = sprintf(__('%1$s: %2$s'), $item->getTypeName(), $DB->result($result, 0, "designation")); } break; case "comp_champ" : $val1 = $_GET["id"]; $val2 = $_GET["champ"]; if ($item = getItemForItemtype($_GET["champ"])) { $table = $item->getTable(); $values = Stat::getItems($_GET["itemtype"], $_GET["date1"], $_GET["date2"], $_GET["champ"]); $title = sprintf(__('%1$s: %2$s'), $item->getTypeName(), Dropdown::getDropdownName($table, $_GET["id"])); } break; } // Found next and prev items $foundkey = -1; foreach ($values as $key => $val) { if ($val['id'] == $_GET["id"]) { $foundkey = $key; } } if ($foundkey >= 0) { if (isset($values[$foundkey+1])) { $next = $values[$foundkey+1]['id']; } if (isset($values[$foundkey-1])) { $prev = $values[$foundkey-1]['id']; } } echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
"; if ($prev > 0) { echo " \"".__s('Previous')."\""; } echo "$title"; if ($next > 0) { echo " \"".__s('Next')."\""; } echo "

"; $target = preg_replace("/&/","&",$_SERVER["REQUEST_URI"]); echo "
"; echo ""; echo ""; echo ""; echo "
".__('Start date').""; Html::showDateFormItem("date1", $_POST["date1"]); echo ""; echo ""; echo "
".__('End date').""; Html::showDateFormItem("date2", $_POST["date2"]); echo "
"; $show_all = false; if (!isset($_GET['graph']) || (count($_GET['graph']) == 0)) { $show_all = true; } ///////// Stats nombre intervention // Total des interventions $values['total'] = Stat::constructEntryValues($_GET['itemtype'], "inter_total", $_GET["date1"], $_GET["date2"], $_GET["type"], $val1, $val2); // Total des interventions résolues $values['solved'] = Stat::constructEntryValues($_GET['itemtype'], "inter_solved", $_GET["date1"], $_GET["date2"], $_GET["type"], $val1, $val2); // Total des interventions closes $values['closed'] = Stat::constructEntryValues($_GET['itemtype'], "inter_closed", $_GET["date1"], $_GET["date2"], $_GET["type"], $val1, $val2); // Total des interventions closes $values['late'] = Stat::constructEntryValues($_GET['itemtype'], "inter_solved_late", $_GET["date1"], $_GET["date2"], $_GET["type"], $val1, $val2); $available = array('total' => __('Opened'), 'solved' => __('Solved'), 'late' => __('Late'), 'closed' => __('Closed'),); echo "
"; foreach ($available as $key => $name) { echo " ".$name." "; } echo "
"; $toprint = array(); foreach ($available as $key => $name) { if ($show_all || isset($_GET['graph'][$key])) { $toprint[$name] = $values[$key]; } } Stat::showGraph($toprint, array('title' => _x('quantity', 'Number of tickets'), 'showtotal' => 1, 'unit' => __('Tickets'))); //Temps moyen de resolution d'intervention $values2['avgsolved'] = Stat::constructEntryValues($_GET['itemtype'], "inter_avgsolvedtime", $_GET["date1"], $_GET["date2"], $_GET["type"], $val1, $val2); // Pass to hour values foreach ($values2['avgsolved'] as $key => $val) { $values2['avgsolved'][$key] /= HOUR_TIMESTAMP; } //Temps moyen de cloture d'intervention $values2['avgclosed'] = Stat::constructEntryValues($_GET['itemtype'], "inter_avgclosedtime", $_GET["date1"], $_GET["date2"], $_GET["type"], $val1, $val2); // Pass to hour values foreach ($values2['avgclosed'] as $key => $val) { $values2['avgclosed'][$key] /= HOUR_TIMESTAMP; } //Temps moyen d'intervention reel $values2['avgactiontime'] = Stat::constructEntryValues($_GET['itemtype'], "inter_avgactiontime", $_GET["date1"], $_GET["date2"], $_GET["type"], $val1, $val2); // Pass to hour values foreach ($values2['avgactiontime'] as $key => $val) { $values2['avgactiontime'][$key] /= HOUR_TIMESTAMP; } $available = array('avgclosed' => __('Closure'), 'avgsolved' => __('Resolution'), 'avgactiontime' => __('Real duration')); if ($_GET['itemtype'] == 'Ticket') { $available['avgtaketime'] = __('Take into account'); //Temps moyen de prise en compte de l'intervention $values2['avgtaketime'] = Stat::constructEntryValues($_GET['itemtype'], "inter_avgtakeaccount", $_GET["date1"], $_GET["date2"], $_GET["type"], $val1, $val2); // Pass to hour values foreach ($values2['avgtaketime'] as $key => $val) { $values2['avgtaketime'][$key] /= HOUR_TIMESTAMP; } } echo "
"; $show_all2 = false; if (!isset($_GET['graph2']) || (count($_GET['graph2']) == 0)) { $show_all2 = true; } foreach ($available as $key => $name) { echo " ".$name." "; } echo "
"; $toprint = array(); foreach ($available as $key => $name) { if ($show_all2 || isset($_GET['graph2'][$key])) { $toprint[$name] = $values2[$key]; } } Stat::showGraph($toprint, array('title' => __('Average time'), 'unit' => _n('Hour', 'Hours', 2), 'showtotal' => 1, 'datatype' => 'average')); if ($_GET['itemtype'] == 'Ticket') { ///////// Satisfaction $values['opensatisfaction'] = Stat::constructEntryValues($_GET['itemtype'], "inter_opensatisfaction", $_GET["date1"], $_GET["date2"], $_GET["type"], $val1, $val2); $values['answersatisfaction'] = Stat::constructEntryValues($_GET['itemtype'], "inter_answersatisfaction", $_GET["date1"], $_GET["date2"], $_GET["type"], $val1, $val2); $available = array('opensatisfaction' => __('Opened'), 'answersatisfaction' => __('Answered')); echo "
"; foreach ($available as $key => $name) { echo " ".$name." "; } echo "
"; $toprint = array(); foreach ($available as $key => $name) { if ($show_all || isset($_GET['graph'][$key])) { $toprint[$name] = $values[$key]; } } Stat::showGraph($toprint, array('title' => __('Satisfaction survey'), 'showtotal' => 1, 'unit' => __('Tickets'))); $values['avgsatisfaction'] = Stat::constructEntryValues($_GET['itemtype'], "inter_avgsatisfaction", $_GET["date1"], $_GET["date2"], $_GET["type"], $val1, $val2); $available = array('avgsatisfaction' => __('Satisfaction')); echo "
"; foreach ($available as $key => $name) { echo " ".$name." "; } echo "
"; $toprint = array(); foreach ($available as $key => $name) { if ($show_all || isset($_GET['graph'][$key])) { $toprint[$name] = $values[$key]; } } Stat::showGraph($toprint, array('title' => __('Satisfaction'))); } // form using GET method : CRSF not needed echo "
"; Html::footer(); ?>glpi-0.84.3+dfsg.1/front/stat.item.php000066400000000000000000000050271226600447100173760ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Html::header(__('Statistics'), '', "maintain", "stat"); Session::checkRight("statistic", "1"); if (isset($_GET["date1"])) { $_POST["date1"] = $_GET["date1"]; } if (isset($_GET["date2"])) { $_POST["date2"] = $_GET["date2"]; } if (empty($_POST["date1"]) && empty($_POST["date2"])) { $year = date("Y")-1; $_POST["date1"] = date("Y-m-d",mktime(1,0,0,date("m"),date("d"),$year)); $_POST["date2"] = date("Y-m-d"); } if (!empty($_POST["date1"]) && !empty($_POST["date2"]) && (strcmp($_POST["date2"],$_POST["date1"]) < 0)) { $tmp = $_POST["date1"]; $_POST["date1"] = $_POST["date2"]; $_POST["date2"] = $tmp; } if (!isset($_GET["start"])) { $_GET["start"] = 0; } Stat::title(); echo "
"; echo ""; echo ""; echo ""; echo "
".__('Start date').""; Html::showDateFormItem("date1",$_POST["date1"]); echo ""; echo "
".__('End date').""; Html::showDateFormItem("date2",$_POST["date2"]); echo "
"; Html::closeForm(); echo "
"; Stat::showItems($_SERVER['PHP_SELF'], $_POST["date1"], $_POST["date2"], $_GET['start']); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/stat.location.php000066400000000000000000000173141226600447100202520ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Html::header(__('Statistics'), '', "maintain", "stat"); Session::checkRight("statistic", "1"); if (empty($_GET["showgraph"])) { $_GET["showgraph"] = 0; } if (empty($_GET["date1"]) && empty($_GET["date2"])) { $year = date("Y")-1; $_GET["date1"] = date("Y-m-d",mktime(1,0,0,date("m"),date("d"),$year)); $_GET["date2"] = date("Y-m-d"); } if (!empty($_GET["date1"]) && !empty($_GET["date2"]) && (strcmp($_GET["date2"], $_GET["date1"]) < 0)) { $tmp = $_GET["date1"]; $_GET["date1"] = $_GET["date2"]; $_GET["date2"] = $tmp; } if (!isset($_GET["start"])) { $_GET["start"] = 0; } // Why this test ?? For me it's doing nothing if (isset($_GET["dropdown"])) { $_GET["dropdown"] = $_GET["dropdown"]; } if (empty($_GET["dropdown"])) { $_GET["dropdown"] = "ComputerType"; } if (!isset($_GET['itemtype'])) { $_GET['itemtype'] = 'Ticket'; } Stat::title(); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
"; echo "".__('Start date').""; Html::showDateFormItem("date1",$_GET["date1"]); echo "".__('Show graphics').""; echo ""; echo "
".__('End date').""; Html::showDateFormItem("date2", $_GET["date2"]); echo ""; Dropdown::showYesNo('showgraph', $_GET['showgraph']); echo "
"; // form using GET method : CRSF not needed echo ""; if (empty($_GET["dropdown"]) || !($item = getItemForItemtype($_GET["dropdown"]))) { // Do nothing Html::footer(); exit(); } if (!($item instanceof CommonDevice)) { // echo "Dropdown"; $type = "comp_champ"; $val = Stat::getItems($_GET['itemtype'], $_GET["date1"], $_GET["date2"], $_GET["dropdown"]); $params = array('type' => $type, 'dropdown' => $_GET["dropdown"], 'date1' => $_GET["date1"], 'date2' => $_GET["date2"], 'start' => $_GET["start"]); } else { // echo "Device"; $type = "device"; $field = $_GET["dropdown"]; $val = Stat::getItems($_GET['itemtype'], $_GET["date1"], $_GET["date2"], $_GET["dropdown"]); $params = array('type' => $type, 'dropdown' => $_GET["dropdown"], 'date1' => $_GET["date1"], 'date2' => $_GET["date2"], 'start' => $_GET["start"]); } Html::printPager($_GET['start'], count($val), $CFG_GLPI['root_doc'].'/front/stat.location.php', "date1=".$_GET["date1"]."&date2=".$_GET["date2"]. "&itemtype=".$_GET['itemtype']."&dropdown=".$_GET["dropdown"], 'Stat', $params); if (!$_GET['showgraph']) { Stat::show($_GET['itemtype'], $type, $_GET["date1"], $_GET["date2"], $_GET['start'], $val, $_GET["dropdown"]); } else { $data = Stat::getDatas($_GET['itemtype'], $type, $_GET["date1"], $_GET["date2"], $_GET['start'], $val, $_GET["dropdown"]); if (isset($data['opened']) && is_array($data['opened'])) { foreach ($data['opened'] as $key => $val) { $cleandata[Html::clean($key)] = $val; } Stat::showGraph(array(__('Number opened') => $cleandata), array('title' => __('Number opened'), 'showtotal' => 1, 'unit' => __('Tickets'), 'type' => 'pie')); } if (isset($data['solved']) && is_array($data['solved'])) { foreach ($data['solved'] as $key => $val) { $cleandata[Html::clean($key)] = $val; } Stat::showGraph(array(__('Number solved') => $cleandata), array('title' => __('Number solved'), 'showtotal' => 1, 'unit' => __('Tickets'), 'type' => 'pie')); } if (isset($data['late']) && is_array($data['late'])) { foreach ($data['late'] as $key => $val) { $cleandata[Html::clean($key)] = $val; } Stat::showGraph(array(__('Number solved late') => $cleandata), array('title' => __('Number solved late'), 'showtotal' => 1, 'unit' => __('Tickets'), 'type' => 'pie')); } if (isset($data['closed']) && is_array($data['closed'])) { foreach ($data['closed'] as $key => $val) { $newkey = Html::clean($key); $cleandata[$newkey]=$val; } Stat::showGraph(array(__('Number closed') => $cleandata), array('title' => __('Number closed'), 'showtotal' => 1, 'unit' => __('Tickets'), 'type' => 'pie')); } if (isset($data['opensatisfaction']) && is_array($data['opensatisfaction'])) { foreach ($data['opensatisfaction'] as $key => $val) { $newkey = Html::clean($key); $cleandata[$newkey] = $val; } Stat::showGraph(array(__('Satisfaction survey') => $cleandata), array('title' => __('Satisfaction survey'), 'showtotal' => 1, 'unit' => __('Tickets'), 'type' => 'pie')); } } Html::footer(); ?> glpi-0.84.3+dfsg.1/front/stat.php000066400000000000000000000024011226600447100164320ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Html::header(__('Statistics'), '', "maintain", "stat"); Session::checkRight("statistic", "1"); Stat::title(); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/stat.tracking.php000066400000000000000000000220051226600447100202350ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Html::header(__('Statistics'), '', "maintain", "stat"); Session::checkRight("statistic", "1"); if (!$item = getItemForItemtype($_GET['itemtype'])) { exit; } if (empty($_GET["type"])) { $_GET["type"] = "user"; } if (empty($_GET["showgraph"])) { $_GET["showgraph"] = 0; } if (empty($_GET["value2"])) { $_GET["value2"] = 0; } if (empty($_GET["date1"]) && empty($_GET["date2"])) { $year = date("Y")-1; $_GET["date1"] = date("Y-m-d",mktime(1,0,0,date("m"),date("d"),$year)); $_GET["date2"] = date("Y-m-d"); } if (!empty($_GET["date1"]) && !empty($_GET["date2"]) && (strcmp($_GET["date2"],$_GET["date1"]) < 0)) { $tmp = $_GET["date1"]; $_GET["date1"] = $_GET["date2"]; $_GET["date2"] = $tmp; } if (!isset($_GET["start"])) { $_GET["start"] = 0; } Stat::title(); $requester = array('user' => array('title' => __('Requester')), 'users_id_recipient' => array('title' => __('Writer')), 'group' => array('title' => __('Group')), 'group_tree' => array('title' => __('Group tree')), 'usertitles_id' => array('title' => _x('person','Title')), 'usercategories_id' => array('title' => __('Category'))); $caract = array('itilcategories_id' => array('title' => __('Category')), 'itilcategories_tree' => array('title' => __('Category tree')), 'urgency' => array('title' => __('Urgency')), 'impact' => array('title' => __('Impact')), 'priority' => array('title' => __('Priority')), 'solutiontypes_id' => array('title' => __('Solution type'))); if ($_GET['itemtype'] == 'Ticket') { $caract['type'] = array('title' => __('Type')); $caract['requesttypes_id'] = array('title' => __('Request source')); $caract['locations_id'] = array('title' => __('Location')); $caract['locations_tree'] = array('title' => __('Location tree')); } $items = array(__('Requester') => $requester, __('Characteristics') => $caract, __('Assigned to') => array('technicien' => array('title' => __('Technician as assigned')), 'technicien_followup' => array('title' => __('Technician in tasks')), 'groups_id_assign' => array('title' => __('Group')), 'groups_tree_assign' => array('title' => __('Group tree')), 'suppliers_id_assign' => array('title' => __('Supplier')))); $INSELECT = ""; foreach ($items as $label => $tab) { $INSELECT .= ""; foreach ($tab as $key => $val) { $INSELECT .= ""; } $INSELECT .= ""; } echo "
"; echo ""; echo ""; echo ""; echo ""; echo "". ""; echo ""; echo "
"; echo "".__('Start date').""; Html::showDateFormItem("date1", $_GET["date1"]); echo "".__('Show graphics').""; echo ""; echo "
".__('End date').""; Html::showDateFormItem("date2", $_GET["date2"]); echo ""; echo ""; Dropdown::showYesNo('showgraph', $_GET['showgraph']); echo "
"; // form using GET method : CRSF not needed echo "
"; echo "
"; $val = Stat::getItems($_GET["itemtype"], $_GET["date1"], $_GET["date2"], $_GET["type"], $_GET["value2"]); $params = array('type' => $_GET["type"], 'date1' => $_GET["date1"], 'date2' => $_GET["date2"], 'value2' => $_GET["value2"], 'start' => $_GET["start"]); Html::printPager($_GET['start'], count($val), $CFG_GLPI['root_doc'].'/front/stat.tracking.php', "date1=".$_GET["date1"]."&date2=".$_GET["date2"]."&type=".$_GET["type"]. "&showgraph=".$_GET["showgraph"]."&itemtype=".$_GET["itemtype"]. "&value2=".$_GET['value2'], 'Stat', $params); if (!$_GET['showgraph']) { Stat::show($_GET["itemtype"], $_GET["type"], $_GET["date1"], $_GET["date2"], $_GET['start'], $val, $_GET['value2']); } else { $data = Stat::getDatas($_GET["itemtype"], $_GET["type"], $_GET["date1"], $_GET["date2"], $_GET['start'], $val, $_GET['value2']); if (isset($data['opened']) && is_array($data['opened'])) { foreach ($data['opened'] as $key => $val) { $newkey = Html::clean($key); $cleandata[$newkey] = $val; } Stat::showGraph(array(__('Number opened') => $cleandata), array('title' => __('Number opened'), 'showtotal' => 1, 'unit' => $item->getTypeName(2), 'type' => 'pie')); } if (isset($data['solved']) && is_array($data['solved'])) { foreach ($data['solved'] as $key => $val) { $newkey = Html::clean($key); $cleandata[$newkey] = $val; } Stat::showGraph(array(__('Number solved') => $cleandata), array('title' => __('Number solved'), 'showtotal' => 1, 'unit' => $item->getTypeName(2), 'type' => 'pie')); } if (isset($data['late']) && is_array($data['late'])) { foreach ($data['late'] as $key => $val) { $newkey = Html::clean($key); $cleandata[$newkey] = $val; } Stat::showGraph(array(__('Number solved late') => $cleandata), array('title' => __('Number solved late'), 'showtotal' => 1, 'unit' => $item->getTypeName(2), 'type' => 'pie')); } if (isset($data['closed']) && is_array($data['closed'])) { foreach ($data['closed'] as $key => $val) { $newkey = Html::clean($key); $cleandata[$newkey] = $val; } Stat::showGraph(array(__('Number closed') => $cleandata), array('title' => __('Number closed'), 'showtotal' => 1, 'unit' => $item->getTypeName(2), 'type' => 'pie')); } if ($_GET['itemtype'] == 'Ticket') { if (isset($data['opensatisfaction']) && is_array($data['opensatisfaction'])) { foreach ($data['opensatisfaction'] as $key => $val) { $newkey = Html::clean($key); $cleandata[$newkey] = $val; } Stat::showGraph(array(__('Satisfaction survey') => $cleandata), array('title' => __('Satisfaction survey'), 'showtotal' => 1, 'unit' => $item->getTypeName(2), 'type' => 'pie')); } } } Html::footer(); ?> glpi-0.84.3+dfsg.1/front/state.form.php000066400000000000000000000023301226600447100175420ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new State(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/state.php000066400000000000000000000023171226600447100166050ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new State(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/supplier.form.php000066400000000000000000000055121226600447100202720ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("contact_enterprise", "r"); if (!isset($_GET["id"])) { $_GET["id"] = -1; } $ent = new Supplier(); if (isset($_POST["add"])) { $ent->check(-1,'w',$_POST); if ($newID = $ent->add($_POST)) { Event::log($newID, "suppliers", 4, "financial", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); } Html::back(); } else if (isset($_POST["delete"])) { $ent->check($_POST["id"],'d'); $ent->delete($_POST); Event::log($_POST["id"], "suppliers", 4, "financial", //TRANS: %s is the user login sprintf(__('%s deletes an item'), $_SESSION["glpiname"])); $ent->redirectToList(); } else if (isset($_POST["restore"])) { $ent->check($_POST["id"],'d'); $ent->restore($_POST); Event::log($_POST["id"], "suppliers", 4, "financial", //TRANS: %s is the user login sprintf(__('%s restores an item'), $_SESSION["glpiname"])); $ent->redirectToList(); } else if (isset($_POST["purge"])) { $ent->check($_POST["id"],'d'); $ent->delete($_POST,1); Event::log($_POST["id"], "suppliers", 4, "financial", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); $ent->redirectToList(); } else if (isset($_POST["update"])) { $ent->check($_POST["id"],'w'); $ent->update($_POST); Event::log($_POST["id"], "suppliers", 4, "financial", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } else { Html::header(Supplier::getTypeName(2), '', "financial", "supplier"); $ent->showForm($_GET["id"]); Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/supplier.php000066400000000000000000000024461226600447100173330ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("contact_enterprise", "r"); Html::header(Supplier::getTypeName(2), '', "financial", "supplier"); Search::show('Supplier'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/suppliertype.form.php000066400000000000000000000023461226600447100211760ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new SupplierType(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/suppliertype.php000066400000000000000000000023351226600447100202320ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new SupplierType(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/taskcategory.form.php000066400000000000000000000023461226600447100211310ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new TaskCategory(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/taskcategory.php000066400000000000000000000023351226600447100201650ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new TaskCategory(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/ticket.form.php000066400000000000000000000153141226600447100177130ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkLoginUser(); $fup = new TicketFollowup(); $track = new Ticket(); if (!isset($_GET['id'])) { $_GET['id'] = ""; } if (isset($_POST["add"])) { $track->check(-1,'w',$_POST); if (isset($_POST["_my_items"]) && !empty($_POST["_my_items"])) { $splitter = explode("_",$_POST["_my_items"]); if (count($splitter) == 2) { $_POST["itemtype"] = $splitter[0]; $_POST["items_id"] = $splitter[1]; } } $track->add($_POST); Html::back(); } else if (isset($_POST['update'])) { $track->check($_POST['id'],'w'); if (isset($_POST["_my_items"]) && !empty($_POST["_my_items"])) { $splitter = explode("_",$_POST["_my_items"]); if (count($splitter) == 2) { $_POST["itemtype"] = $splitter[0]; $_POST["items_id"] = $splitter[1]; } } $track->update($_POST); Event::log($_POST["id"], "ticket", 4, "tracking", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); // Copy solution to KB redirect to KB if (isset($_POST['_sol_to_kb']) && $_POST['_sol_to_kb']) { Html::redirect($CFG_GLPI["root_doc"]. "/front/knowbaseitem.form.php?id=new&item_itemtype=Ticket&item_items_id=".$_POST["id"]); } else { if ($track->can($_POST["id"],'r')) { Html::redirect($CFG_GLPI["root_doc"]."/front/ticket.form.php?id=".$_POST["id"]); } Session::addMessageAfterRedirect(__('You have been redirected because you no longer have access to this ticket'), true, ERROR); Html::redirect($CFG_GLPI["root_doc"]."/front/ticket.php"); } } else if (isset($_POST['delete'])) { $track->check($_POST['id'],'d'); if ($track->delete($_POST)) { Event::log($_POST["id"], "ticket", 4, "tracking", //TRANS: %s is the user login sprintf(__('%s deletes an item'), $_SESSION["glpiname"])); } $track->redirectToList(); } else if (isset($_POST['purge'])) { $track->check($_POST['id'],'d'); if ($track->delete($_POST, 1)) { Event::log($_POST["id"], "ticket", 4, "tracking", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); } $track->redirectToList(); } else if (isset($_POST["restore"])) { $track->check($_POST['id'], 'd'); if ($track->restore($_POST)) { Event::log($_POST["id"], "ticket", 4, "tracking", //TRANS: %s is the user login sprintf(__('%s restores an item'), $_SESSION["glpiname"])); } $track->redirectToList(); } else if (isset($_POST['sla_delete'])) { $track->check($_POST["id"],'w'); $track->deleteSLA($_POST["id"]); Event::log($_POST["id"], "ticket", 4, "tracking", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::redirect($CFG_GLPI["root_doc"]."/front/ticket.form.php?id=".$_POST["id"]); } else if (isset($_POST['delete_user'])) { ///TODO try to move it to specific form page $ticket_user = new Ticket_User(); $ticket_user->check($_POST['id'], 'd'); $ticket_user->delete($_POST); Event::log($_POST['tickets_id'], "ticket", 4, "tracking", //TRANS: %s is the user login sprintf(__('%s deletes an actor'), $_SESSION["glpiname"])); Html::redirect($CFG_GLPI["root_doc"]."/front/ticket.form.php?id=".$_POST['tickets_id']); } else if (isset($_POST['delete_group'])) { $group_ticket = new Group_Ticket(); $group_ticket->check($_POST['id'], 'd'); $group_ticket->delete($_POST); Event::log($_POST['tickets_id'], "ticket", 4, "tracking", sprintf(__('%s deletes an actor'), $_SESSION["glpiname"])); Html::redirect($CFG_GLPI["root_doc"]."/front/ticket.form.php?id=".$_POST['tickets_id']); } else if (isset($_POST['delete_supplier'])) { $supplier_ticket = new Supplier_Ticket(); $supplier_ticket->check($_POST['id'], 'd'); $supplier_ticket->delete($_POST); Event::log($_POST['tickets_id'], "ticket", 4, "tracking", sprintf(__('%s deletes an actor'), $_SESSION["glpiname"])); Html::redirect($CFG_GLPI["root_doc"]."/front/ticket.form.php?id=".$_POST['tickets_id']); } else if (isset($_POST['addme_observer'])) { $ticket_user = new Ticket_User(); $track->check($_POST['tickets_id'], 'r'); $input = array('tickets_id' => $_POST['tickets_id'], 'users_id' => Session::getLoginUserID(), 'use_notification' => 1, 'type' => CommonITILActor::OBSERVER); $ticket_user->add($input); Event::log($_POST['tickets_id'], "ticket", 4, "tracking", //TRANS: %s is the user login sprintf(__('%s adds an actor'), $_SESSION["glpiname"])); Html::redirect($CFG_GLPI["root_doc"]."/front/ticket.form.php?id=".$_POST['tickets_id']); } if (isset($_GET["id"]) && ($_GET["id"] > 0)) { if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") { Html::helpHeader(Ticket::getTypeName(2), '', $_SESSION["glpiname"]); } else { Html::header(Ticket::getTypeName(2), '', "maintain", "ticket"); } $available_options = array('load_kb_sol'); $options = array(); foreach ($available_options as $key) { if (isset($_GET[$key])) { $options[$key] = $_GET[$key]; } } $track->showForm($_GET["id"],$options); } else { Html::header(__('New ticket'),'',"maintain","ticket"); $track->showForm(0); } if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") { Html::helpFooter(); } else { Html::footer(); } ?> glpi-0.84.3+dfsg.1/front/ticket.php000066400000000000000000000034321226600447100167470ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkLoginUser(); if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") { Html::helpHeader(Ticket::getTypeName(2),'',$_SESSION["glpiname"]); } else { Html::header(Ticket::getTypeName(2),'',"maintain","ticket"); } if ($_SESSION['glpirefresh_ticket_list'] > 0) { // Refresh automatique sur tracking.php echo "\n"; } Search::show('Ticket'); if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") { Html::helpFooter(); } else { Html::footer(); } ?>glpi-0.84.3+dfsg.1/front/ticket_ticket.form.php000066400000000000000000000032341226600447100212540ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.84 */ include ('../inc/includes.php'); $ticket_ticket = new Ticket_Ticket(); Session ::checkCentralAccess(); if (isset($_POST['delete'])) { $ticket_ticket->check($_POST['id'],'d'); $ticket_ticket->delete($_POST); Event::log($_POST['tickets_id'], "ticket", 4, "tracking", //TRANS: %s is the user login sprintf(__('%s deletes link between tickets'), $_SESSION["glpiname"])); Html::redirect($CFG_GLPI["root_doc"]."/front/ticket.form.php?id=".$_POST['tickets_id']); } Html::displayErrorAndDie("lost"); ?>glpi-0.84.3+dfsg.1/front/ticket_user.form.php000066400000000000000000000031551226600447100207510ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { include ('../inc/includes.php'); } $ticket_user = new Ticket_User(); Session ::checkLoginUser(); if (isset($_POST["update"])) { $ticket_user->check($_POST["id"], 'w'); $ticket_user->update($_POST); echo ""; } else if (isset($_GET["id"])) { $ticket_user->showUserNotificationForm($_GET["id"]); } else { Html::displayErrorAndDie('Lost'); } ?>glpi-0.84.3+dfsg.1/front/ticketcost.form.php000066400000000000000000000044041226600447100206020ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.84 */ include ('../inc/includes.php'); Session::checkCentralAccess(); $cost = new TicketCost(); if (isset($_POST["add"])) { $cost->check(-1,'w',$_POST); if ($newID = $cost->add($_POST)) { Event::log($_POST['tickets_id'], "tickets", 4, "tracking", //TRANS: %s is the user login sprintf(__('%s adds a cost'), $_SESSION["glpiname"])); } Html::back(); } else if (isset($_POST["delete"])) { $cost->check($_POST["id"],'d'); if ($cost->delete($_POST)) { Event::log($cost->fields['tickets_id'], "tickets", 4, "tracking", //TRANS: %s is the user login sprintf(__('%s deletes a cost'), $_SESSION["glpiname"])); } Html::redirect(Toolbox::getItemTypeFormURL('Ticket').'?id='.$cost->fields['tickets_id']); } else if (isset($_POST["update"])) { $cost->check($_POST["id"],'w'); if ($cost->update($_POST)) { Event::log($cost->fields['tickets_id'], "tickets", 4, "tracking", //TRANS: %s is the user login sprintf(__('%s updates a cost'), $_SESSION["glpiname"])); } Html::back(); } Html::displayErrorAndDie('Lost'); ?>glpi-0.84.3+dfsg.1/front/ticketfollowup.form.php000066400000000000000000000053111226600447100214770ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkLoginUser(); $fup = new TicketFollowup(); if (isset($_POST["add"])) { $fup->check(-1,'w',$_POST); $fup->add($_POST); Event::log($fup->getField('tickets_id'), "ticket", 4, "tracking", //TRANS: %s is the user login sprintf(__('%s adds a followup'), $_SESSION["glpiname"])); Html::back(); } else if (isset($_POST['add_close']) || isset($_POST['add_reopen'])) { $ticket = new Ticket(); if ($ticket->getFromDB($_POST["tickets_id"]) && $ticket->canApprove()) { $fup->add($_POST); Event::log($fup->getField('tickets_id'), "ticket", 4, "tracking", //TRANS: %s is the user login sprintf(__('%s approves or refuses a solution'), $_SESSION["glpiname"])); Html::back(); } } else if (isset($_POST["update"])) { $fup->check($_POST['id'], 'w'); $fup->update($_POST); Event::log($fup->getField('tickets_id'), "ticket", 4, "tracking", //TRANS: %s is the user login sprintf(__('%s updates a followup'), $_SESSION["glpiname"])); Html::redirect(Toolbox::getItemTypeFormURL('Ticket')."?id=".$fup->getField('tickets_id')); } else if (isset($_POST["delete"])) { $fup->check($_POST['id'], 'd'); $fup->delete($_POST); Event::log($fup->getField('tickets_id'), "ticket", 4, "tracking", //TRANS: %s is the user login sprintf(__('%s deletes a followup'), $_SESSION["glpiname"])); Html::redirect(Toolbox::getItemTypeFormURL('Ticket')."?id=".$fup->getField('tickets_id')); } Html::displayErrorAndDie('Lost'); ?>glpi-0.84.3+dfsg.1/front/ticketrecurrent.form.php000066400000000000000000000023541226600447100216450ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new TicketRecurrent(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/ticketrecurrent.php000066400000000000000000000023421226600447100207000ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new TicketRecurrent(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?>glpi-0.84.3+dfsg.1/front/ticketsatisfaction.form.php000066400000000000000000000030651226600447100223230ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkLoginUser(); $inquest = new TicketSatisfaction(); if (isset($_POST["update"])) { $inquest->check($_POST["tickets_id"], 'w'); $inquest->update($_POST); Event::log($inquest->getField('tickets_id'), "ticket", 4, "tracking", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } Html::displayErrorAndDie('Lost'); ?>glpi-0.84.3+dfsg.1/front/tickettask.form.php000066400000000000000000000023401226600447100205710ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $task = new TicketTask(); include (GLPI_ROOT . "/front/commonitiltask.form.php"); ?> glpi-0.84.3+dfsg.1/front/tickettemplate.form.php000066400000000000000000000023521226600447100214450ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new TicketTemplate(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/tickettemplate.php000066400000000000000000000023401226600447100205000ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new TicketTemplate(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?>glpi-0.84.3+dfsg.1/front/tickettemplatehiddenfield.form.php000066400000000000000000000031261226600447100236250ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session ::checkRight('tickettemplate','w'); $item = new TicketTemplateHiddenField(); if (isset($_POST["add"])) { $item->check(-1, 'w', $_POST); if ($item->add($_POST)) { Event::log($_POST["tickettemplates_id"], "tickettemplate", 4, "maintain", //TRANS: %s is the user login sprintf(__('%s adds hidden field'), $_SESSION["glpiname"])); } Html::back(); } Html::displayErrorAndDie("lost"); ?>glpi-0.84.3+dfsg.1/front/tickettemplatemandatoryfield.form.php000066400000000000000000000031411226600447100243650ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session ::checkRight('tickettemplate','w'); $item = new TicketTemplateMandatoryField(); if (isset($_POST["add"])) { $item->check(-1, 'w', $_POST); if ($item->add($_POST)) { Event::log($_POST["tickettemplates_id"], "tickettemplate", 4, "maintain", //TRANS: %s is the user login sprintf(__('%s adds mandatory field'), $_SESSION["glpiname"])); } Html::back(); } Html::displayErrorAndDie("lost"); ?>glpi-0.84.3+dfsg.1/front/tickettemplatepredefinedfield.form.php000066400000000000000000000032331226600447100244760ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session ::checkRight('tickettemplate','w'); $item = new TicketTemplatePredefinedField(); // Use masiveaction system to manage add value if (isset($_POST["massiveaction"])) { $item->check(-1, 'w', $_POST); if ($item->add($_POST)) { Event::log($_POST["tickettemplates_id"], "tickettemplate", 4, "maintain", //TRANS: %s is the user login sprintf(__('%s adds predefined field'), $_SESSION["glpiname"])); } Html::back(); } Html::displayErrorAndDie("lost"); ?>glpi-0.84.3+dfsg.1/front/ticketvalidation.form.php000066400000000000000000000044431226600447100217670ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkLoginUser(); if (!isset($_GET["id"])) { $_GET["id"] = ""; } $validation = new Ticketvalidation(); $ticket = new Ticket(); $user = new User(); if (isset($_POST["add"])) { $validation->check(-1,'w',$_POST); $validation->add($_POST); Event::log($validation->getField('tickets_id'), "ticket", 4, "tracking", //TRANS: %s is the user login sprintf(__('%s adds an approval'), $_SESSION["glpiname"])); Html::back(); } else if (isset($_POST["update"])) { $validation->check($_POST['id'],'w'); $validation->update($_POST); Event::log($validation->getField('tickets_id'), "ticket", 4, "tracking", //TRANS: %s is the user login sprintf(__('%s updates an approval'), $_SESSION["glpiname"])); Html::back(); } else if (isset($_POST["delete"])) { $validation->check($_POST['id'], 'd'); $validation->delete($_POST); Event::log($validation->getField('tickets_id'), "ticket", 4, "tracking", //TRANS: %s is the user login sprintf(__('%s deletes an approval'), $_SESSION["glpiname"])); Html::back(); } Html::displayErrorAndDie('Lost'); ?>glpi-0.84.3+dfsg.1/front/tracking.injector.php000066400000000000000000000065361226600447100211120ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ // Based on: // IRMA, Information Resource-Management and Administration // Christian Bauer /** @file * @brief */ include ('../inc/includes.php'); if (empty($_POST["_type"]) || ($_POST["_type"] != "Helpdesk") || !$CFG_GLPI["use_anonymous_helpdesk"]) { Session::checkRight("create_ticket", "1"); } $track = new Ticket(); // Security check if (empty($_POST) || (count($_POST) == 0)) { Html::redirect($CFG_GLPI["root_doc"]."/front/helpdesk.public.php"); } if (isset($_POST["_type"]) && ($_POST["_type"] == "Helpdesk")) { Html::nullHeader(Ticket::getTypeName(2)); } else if ($_POST["_from_helpdesk"]) { Html::helpHeader(__('Simplified interface'), '', $_SESSION["glpiname"]); } else { Html::header(__('Simplified interface'), '', $_SESSION["glpiname"], "maintain", "tracking"); } if (isset($_POST["_my_items"]) && !empty($_POST["_my_items"])) { $splitter = explode("_",$_POST["_my_items"]); if (count($splitter) == 2) { $_POST["itemtype"] = $splitter[0]; $_POST["items_id"] = $splitter[1]; } } if (!isset($_POST["itemtype"]) || (empty($_POST["items_id"]) && ($_POST["itemtype"] != 0))) { $_POST["itemtype"] = ''; $_POST["items_id"] = 0; } if (isset($_POST['add'])) { if ($newID = $track->add($_POST)) { if (isset($_POST["_type"]) && ($_POST["_type"] == "Helpdesk")) { echo "
". __('Your ticket has been registered, its treatment is in progress.'); Html::displayBackLink(); echo "
"; } else { echo "
"; echo "".__s("; Session::addMessageAfterRedirect(__('Thank you for using our automatic helpdesk system.')); Html::displayMessageAfterRedirect(); echo "
"; } } else { echo "
"; echo "".__s(
"; Html::displayMessageAfterRedirect(); echo "". __('Back')."
"; } Html::nullFooter(); } else { // reload display form $track->showFormHelpdesk(Session::getLoginUserID()); Html::helpFooter(); } ?>glpi-0.84.3+dfsg.1/front/transfer.action.php000066400000000000000000000076761226600447100206020ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Html::header(__('Transfer'), '', 'admin', 'rule', 'transfer'); $transfer = new Transfer(); $transfer->checkGlobal('r'); if (isset($_POST['transfer'])) { if (isset($_SESSION['glpitransfer_list'])) { if (!Session::haveAccessToEntity($_POST['to_entity'])) { Html::displayRightError(); } $transfer->moveItems($_SESSION['glpitransfer_list'], $_POST['to_entity'], $_POST); unset($_SESSION['glpitransfer_list']); echo "
".__('Operation successful')."
"; echo "".__('Back')."
"; Html::footer(); exit(); } } else if (isset($_POST['clear'])) { unset($_SESSION['glpitransfer_list']); echo "
".__('Operation successful')."
"; echo "".__('Back')."
"; echo ""; Html::footer(); exit(); } unset($_SESSION['glpimassiveactionselected']); $transfer->showTransferList(); Html::footer(); /* // Network links : 0 : delete 1 : keep disconnect 2 : keep connect $options['keep_networklink']=0; // Tickets : 0 : delete 1 : keep and clean ref 2 : keep and move $options['keep_ticket']=2; // Reservations : 0 : delete 1 : keep $options['keep_reservation']=1; // Devices : 0 : delete 1 : keep $options['keep_device']=1; // History : 0 : delete 1 : keep $options['keep_history']=1; // Infocoms : 0 : delete 1 : keep $options['keep_infocom']=1; // enterprises : 0 : delete 1 : keep $options['keep_supplier']=1; $options['clean_supplier']=1; // Contacts for enterprises : 0 : delete 1 : keep $options['keep_contact']=1; $options['clean_contact']=1; // Softwares : 0 : delete 1 : keep $options['keep_software']=1; $options['clean_software']=1; // Contracts : 0 : delete 1 : keep $options['keep_contract']=1; $options['clean_contract']=1; // Documents : 0 : delete 1 : keep $options['keep_document']=1; $options['clean_document']=1; // Monitor Direct Connect : keep_dc -> tranfer / clean_dc : delete if unused : 1 = delete, 2 = purge $options['keep_dc_monitor']=1; $options['clean_dc_monitor']=1; // Phone Direct Connect : keep_dc -> tranfer / clean_dc : delete if unused : 1 = delete, 2 = purge $options['keep_dc_phone']=1; $options['clean_dc_phone']=1; // Peripheral Direct Connect : keep_dc -> tranfer / clean_dc : delete if unused : 1 = delete, 2 = purge $options['keep_dc_peripheral']=1; $options['clean_dc_peripheral']=1; // Printer Direct Connect : keep_dc -> tranfer / clean_dc : delete if unused : 1 = delete, 2 = purge $options['keep_dc_printer']=1; $options['clean_dc_printer']=1; $options['keep_cartridgesitem']=1; $options['clean_cartridgesitem']=1; $options['keep_cartridge']=1; //$options['keep_consumablesitem']=1; // Not needed $options['keep_consumable']=1; //$entity_id=4; //$items['Computer']=array(403); //$transfer->moveItems($items,$entity_id,$options); */ ?> glpi-0.84.3+dfsg.1/front/transfer.form.php000066400000000000000000000044421226600447100202540ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("transfer", "r"); if (empty($_GET["id"])) { $_GET["id"] = ""; } $transfer = new Transfer(); if (isset($_POST["add"])) { $transfer->check(-1,'w',$_POST); $newID = $transfer->add($_POST); Event::log($newID, "transfers", 4, "setup", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); Html::back(); } else if (isset($_POST["delete"])) { $transfer->check($_POST["id"],'d'); $transfer->delete($_POST); Event::log($_POST["id"], "transfers", 4, "setup", //TRANS: %s is the user login sprintf(__('%s purges an item'), $_SESSION["glpiname"])); Html::redirect($CFG_GLPI["root_doc"]."/front/transfer.php"); } else if (isset($_POST["update"])) { $transfer->check($_POST["id"],'w'); $transfer->update($_POST); Event::log($_POST["id"], "transfers", 4, "setup", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } Html::header(__('Transfer'), '', 'admin', 'rule', 'transfer'); $transfer->showForm($_GET["id"], array('target' => $transfer->getFormURL())); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/transfer.php000066400000000000000000000024261226600447100173120ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("transfer", "r"); Html::header(__('Transfer'), '', 'admin', 'rule', 'transfer'); Search::show('Transfer'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/user.form.php000066400000000000000000000133001226600447100173770ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); if (empty($_GET["id"])) { $_GET["id"] = ""; } $user = new User(); $groupuser = new Group_User(); if (empty($_GET["id"]) && isset($_GET["name"])) { $user->getFromDBbyName($_GET["name"]); Html::redirect($CFG_GLPI["root_doc"]."/front/user.form.php?id=".$user->fields['id']); } if (empty($_GET["name"])) { $_GET["name"] = ""; } if (isset($_GET['getvcard'])) { if (empty($_GET["id"])) { Html::redirect($CFG_GLPI["root_doc"]."/front/user.php"); } $user->check($_GET['id'], 'r'); $user->generateVcard(); } else if (isset($_POST["add"])) { $user->check(-1, 'w', $_POST); // Pas de nom pas d'ajout if (!empty($_POST["name"]) && $newID=$user->add($_POST)) { Event::log($newID, "users", 4, "setup", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); } Html::back(); } else if (isset($_POST["delete"])) { $user->check($_POST['id'], 'd'); $user->delete($_POST); Event::log($_POST["id"], "users", 4, "setup", //TRANS: %s is the user login sprintf(__('%s deletes an item'), $_SESSION["glpiname"])); $user->redirectToList(); } else if (isset($_POST["restore"])) { $user->check($_POST['id'], 'd'); $user->restore($_POST); Event::log($_POST["id"], "users", 4, "setup", //TRANS: %s is the user login sprintf(__('%s restores an item'), $_SESSION["glpiname"])); $user->redirectToList(); } else if (isset($_POST["purge"])) { $user->check($_POST['id'], 'd'); $user->delete($_POST, 1); Event::log($_POST["id"], "users", 4, "setup", sprintf(__('%s purges an item'), $_SESSION["glpiname"])); $user->redirectToList(); } else if (isset($_POST["force_ldap_resynch"])) { Session::checkRight('user_authtype', 'w'); $user->getFromDB($_POST["id"]); AuthLdap::ldapImportUserByServerId(array('method' => AuthLDAP::IDENTIFIER_LOGIN, 'value' => $user->fields["name"]), true, $user->fields["auths_id"], true); Html::back(); } else if (isset($_POST["update"])) { $user->check($_POST['id'], 'w'); $user->update($_POST); Event::log($_POST['id'], "users", 5, "setup", //TRANS: %s is the user login sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } else if (isset($_POST["addgroup"])) { $groupuser->check(-1,'w',$_POST); if ($groupuser->add($_POST)) { Event::log($_POST["users_id"], "users", 4, "setup", //TRANS: %s is the user login sprintf(__('%s adds a user to a group'), $_SESSION["glpiname"])); } Html::back(); } else if (isset($_POST["deletegroup"])) { if (count($_POST["item"])) { foreach ($_POST["item"] as $key => $val) { if ($groupuser->can($key,'w')) { $groupuser->delete(array('id' => $key)); } } } Event::log($_POST["users_id"], "users", 4, "setup", //TRANS: %s is the user login sprintf(__('%s deletes users from a group'), $_SESSION["glpiname"])); Html::back(); } else if (isset($_POST["change_auth_method"])) { Session::checkRight('user_authtype', 'w'); if (isset($_POST["auths_id"])) { User::changeAuthMethod(array($_POST["id"]), $_POST["authtype"], $_POST["auths_id"]); } Html::back(); } else { if (isset($_GET["ext_auth"])) { Html::header(User::getTypeName(2), '', "admin", "user"); User::showAddExtAuthForm(); Html::footer(); } else if (isset($_POST['add_ext_auth_ldap'])) { Session::checkRight("import_externalauth_users", "w"); if (isset($_POST['login']) && !empty($_POST['login'])) { AuthLdap::importUserFromServers(array('name' => $_POST['login'])); } Html::back(); } else if (isset($_POST['add_ext_auth_simple'])) { if (isset($_POST['login']) && !empty($_POST['login'])) { Session::checkRight("import_externalauth_users", "w"); $input = array('name' => $_POST['login'], '_extauth' => 1, 'add' => 1); $user->check(-1, 'w', $input); $newID = $user->add($input); Event::log($newID, "users", 4, "setup", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["login"])); } Html::back(); } else { Session::checkRight("user", "r"); Html::header(User::getTypeName(2), '', "admin", "user"); $user->showForm($_GET["id"]); Html::footer(); } } ?>glpi-0.84.3+dfsg.1/front/user.php000066400000000000000000000024511226600447100164420ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); Session::checkRight("user", "r"); Html::header(User::getTypeName(2), '', "admin", "user"); $user = new User(); $user->title(); Search::show('User'); Html::footer(); ?>glpi-0.84.3+dfsg.1/front/usercategory.form.php000066400000000000000000000023461226600447100211450ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new UserCategory(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/usercategory.php000066400000000000000000000023351226600447100202010ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new UserCategory(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/usertitle.form.php000066400000000000000000000023401226600447100204430ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new UserTitle(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/usertitle.php000066400000000000000000000023271226600447100175060ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new UserTitle(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/virtualmachinestate.form.php000066400000000000000000000023641226600447100225050ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new VirtualMachineState(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/virtualmachinestate.php000066400000000000000000000023541226600447100215420ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new VirtualMachineState(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/virtualmachinesystem.form.php000066400000000000000000000023661226600447100227130ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new VirtualMachineSystem(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/virtualmachinesystem.php000066400000000000000000000023551226600447100217470ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new VirtualMachineSystem(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/virtualmachinetype.form.php000066400000000000000000000023621226600447100223440ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new VirtualMachineType(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/virtualmachinetype.php000066400000000000000000000023511226600447100214000ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new VirtualMachineType(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/vlan.form.php000066400000000000000000000023261226600447100173670ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new Vlan(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/vlan.php000066400000000000000000000023151226600447100164230ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new Vlan(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/front/wifinetwork.form.php000066400000000000000000000023441226600447100207770ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new WifiNetwork(); include (GLPI_ROOT . "/front/dropdown.common.form.php"); ?>glpi-0.84.3+dfsg.1/front/wifinetwork.php000066400000000000000000000023331226600447100200330ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ include ('../inc/includes.php'); $dropdown = new WifiNetwork(); include (GLPI_ROOT . "/front/dropdown.common.php"); ?> glpi-0.84.3+dfsg.1/inc/000077500000000000000000000000001226600447100143725ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/inc/ajax.class.php000066400000000000000000000603041226600447100171350ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // class Ajax class Ajax { /** * Create modal window * After display it using $name.show() * May be constraint to a predefined html item setting renderTo options * * @since version 0.84 * * @param $name name of the js object * @param $url URL to display in modal * @param $options array of possible options: * - width (default 800) * - height (default 400) * - modal : is a modal window ? (default true) * - container : specify a html element to render (default empty to html.body) * - title : window title (default empty) **/ static function createModalWindow($name, $url, $options=array() ) { $param = array('width' => 800, 'height' => 400, 'modal' => true, 'container' => '', 'title' => '', 'extraparams' => array()); if (count($options)) { foreach ($options as $key => $val) { if (isset($param[$key])) { $param[$key] = $val; } } } echo ""; } /** * Create fixed modal window * After display it using $name.show() * May be constraint to a predefined html item setting container options * * @since version 0.84 * * @param $name name of the js object * @param $options array of possible options: * - width (default 800) * - height (default 400) * - modal : is a modal window ? (default true) * - container : specify a html element to render (default empty to html.body) * - title : window title (default empty) **/ static function createFixedModalWindow($name, $options=array() ) { $param = array('width' => 800, 'height' => 400, 'modal' => true, 'container' => '', 'title' => ''); if (count($options)) { foreach ($options as $key => $val) { if (isset($param[$key])) { $param[$key] = $val; } } } echo ""; } /** * Call from a popup Windows, refresh the dropdown in main window **/ static function refreshDropdownPopupInMainWindow() { if (isset($_SESSION["glpipopup"]["rand"])) { echo ""; } } /** * Call from a popup Windows, refresh the dropdown in main window **/ static function refreshPopupMainWindow() { // $_SESSION["glpipopup"]["rand"] is not use here but do check to be sure that // we are in popup if (isset($_SESSION["glpipopup"]["rand"])) { echo ""; } } /** * Call from a popup Windows, refresh the tab in main window * * @since version 0.84 **/ static function refreshPopupTab() { echo ""; } /** * Input text used as search system in ajax system * * @param $id ID of the ajax item * @param $size size of the input text field (default 4) **/ static function displaySearchTextForDropdown($id, $size=4) { echo self::getSearchTextForDropdown($id, $size); } /** * Input text used as search system in ajax system * @since version 0.84 * * @param $id ID of the ajax item * @param $size size of the input text field (default 4) **/ static function getSearchTextForDropdown($id, $size=4) { global $CFG_GLPI; //TRANS: %s is the character used as wildcard in ajax search return "\n"; } /** * Create Ajax Tabs apply to 'tabspanel' div. Content is displayed in 'tabcontent' * * @param $tabdiv_id ID of the div containing the tabs (default 'tabspanel') * @param $tabdivcontent_id ID of the div containing the content loaded by tabs * (default 'tabcontent') * @param $tabs array of tabs to create : * tabs is array('key' => array('title'=> 'x', * url => 'url_toload', * params => 'url_params')... * @param $type for active tab * @param $size width of tabs panel (default 950) * * @return nothing **/ static function createTabs($tabdiv_id='tabspanel', $tabdivcontent_id='tabcontent', $tabs=array(), $type, $size=950) { global $CFG_GLPI; $active_tabs = Session::getActiveTab($type); if (count($tabs)>0) { echo ""; } } /** * Javascript code for update an item when another item changed * * @param $toobserve id (or array of id) of the select to observe * @param $toupdate id of the item to update * @param $url Url to get datas to update the item * @param $parameters array of parameters to send to ajax URL * @param $events array of the observed events (default 'change') * @param $minsize minimum size of data to update content (default -1) * @param $buffertime minimum time to wait before reload (default -1) * @param $forceloadfor array of content which must force update content * @param $display boolean display or get string (default true) **/ static function updateItemOnEvent($toobserve, $toupdate, $url, $parameters=array(), $events=array("change"), $minsize=-1, $buffertime=-1, $forceloadfor=array(), $display=true) { $output = ""; if ($display) { echo $output; } else { return $output; } } /** * Javascript code for update an item when a select item changed * * @param $toobserve id of the select to observe * @param $toupdate id of the item to update * @param $url Url to get datas to update the item * @param $parameters array of parameters to send to ajax URL * @param $display boolean display or get string (default true) **/ static function updateItemOnSelectEvent($toobserve, $toupdate, $url, $parameters=array(), $display=true) { return self::updateItemOnEvent($toobserve, $toupdate, $url, $parameters, array("change"), -1, -1, array(), $display); } /** * Javascript code for update an item when a Input text item changed * * @param $toobserve id of the Input text to observe * @param $toupdate id of the item to update * @param $url Url to get datas to update the item * @param $parameters array of parameters to send to ajax URL * @param $minsize minimum size of data to update content (default -1) * @param $buffertime minimum time to wait before reload (default -1) * @param $forceloadfor array of content which must force update content * @param $display boolean display or get string (default true) * **/ static function updateItemOnInputTextEvent($toobserve, $toupdate, $url, $parameters=array(), $minsize=-1, $buffertime=-1, $forceloadfor=array(), $display=true) { global $CFG_GLPI; if (count($forceloadfor) == 0) { $forceloadfor = array($CFG_GLPI['ajax_wildcard']); } // Need to define min size for text search if ($minsize < 0) { $minsize = $CFG_GLPI['ajax_min_textsearch_load']; } if ($buffertime < 0) { $buffertime = $CFG_GLPI['ajax_buffertime_load']; } return self::updateItemOnEvent($toobserve, $toupdate, $url, $parameters, array("dblclick", "keyup"), $minsize, $buffertime, $forceloadfor, $display); } /** * Javascript code for update an item when another item changed (Javascript code only) * * @param $toobserve id (or array of id) of the select to observe * @param $toupdate id of the item to update * @param $url Url to get datas to update the item * @param $parameters array of parameters to send to ajax URL * @param $events array of the observed events (default 'change') * @param $minsize minimum size of data to update content (default -1) * @param $buffertime minimum time to wait before reload (default -1) * @param $forceloadfor array of content which must force update content * @param $display boolean display or get string (default true) **/ static function updateItemOnEventJsCode($toobserve, $toupdate, $url, $parameters=array(), $events=array("change"), $minsize = -1, $buffertime=-1, $forceloadfor=array(), $display=true) { if (is_array($toobserve)) { $zones = $toobserve; } else { $zones = array($toobserve); } $output = ''; foreach ($zones as $zone) { foreach ($events as $event) { $output .= " Ext.get('$zone').on( '$event', function() {"; $condition = ''; if ($minsize >= 0) { $condition = " Ext.get('$zone').getValue().length >= $minsize "; } if (count($forceloadfor)) { foreach ($forceloadfor as $value) { if (!empty($condition)) { $condition .= " || "; } $condition .= "Ext.get('$zone').getValue() == '$value'"; } } if (!empty($condition)) { $output .= "if ($condition) {"; } $output .= self::updateItemJsCode($toupdate, $url, $parameters, $toobserve, false); if (!empty($condition)) { $output .= "}"; } $output .= "}"; if ($buffertime > 0) { $output.= ", this, { buffer : $buffertime }"; } $output .=");\n"; } } if ($display) { echo $output; } else { return $output; } } /** * Javascript code for update an item (Javascript code only) * * @param $options array of options * - toupdate : array / Update a specific item on select change on dropdown * (need value_fieldname, to_update, * url (@see Ajax::updateItemOnSelectEvent for information) * and may have moreparams) **/ static function commonDropdownUpdateItem($options) { if (isset($options["update_item"]) && (is_array($options["update_item"]) || (strlen($options["update_item"]) > 0))) { if (!is_array($options["update_item"])) { $datas = Toolbox::decodeArrayFromInput($options["update_item"]); } else { $datas = $options["update_item"]; } if (is_array($datas) && count($datas)) { // Put it in array if (isset($datas['to_update'])) { $datas = array($datas); } foreach ($datas as $data) { $paramsupdate = array(); if (isset($data['value_fieldname'])) { $paramsupdate = array($data['value_fieldname'] => '__VALUE__'); } if (isset($data["moreparams"]) && is_array($data["moreparams"]) && count($data["moreparams"])) { foreach ($data["moreparams"] as $key => $val) { $paramsupdate[$key] = $val; } } self::updateItemOnSelectEvent("dropdown_".$options["myname"].$options["rand"], $data['to_update'], $data['url'], $paramsupdate); } } } } /** * Javascript code for update an item (Javascript code only) * * @param $toupdate id of the item to update * @param $url Url to get datas to update the item * @param $parameters array of parameters to send to ajax URL * @param $toobserve id of another item used to get value in case of __VALUE__ used * or * array of id to get value in case of __VALUE#__ used (default '') * @param $display boolean display or get string (default true) **/ static function updateItemJsCode($toupdate, $url, $parameters=array(), $toobserve="", $display=true) { // Get it from a Ext.Element object $out = "Ext.get('$toupdate').load({ url: '$url', scripts: true"; if (count($parameters)) { $out .= ", params:'"; $first = true; foreach ($parameters as $key => $val) { if ($first) { $first = false; } else { $out .= "&"; } $out .= $key."="; if (is_array($val)) { $out .= Toolbox::prepareArrayForInput($val); } else if (preg_match('/^__VALUE(\d+)__$/',$val,$regs)) { $out .= "'+Ext.get('".$toobserve[$regs[1]]."').getValue()+'"; } else if ($val==="__VALUE__") { $out .= "'+Ext.get('$toobserve').getValue()+'"; } else { if (preg_match("/['\"]/",$val)) { $out .= rawurlencode($val); } else { $out .= $val; } } } $out .= "'\n"; } $out .= "});"; if ($display) { echo $out; } else { return $out; } } /** * Complete Dropdown system using ajax to get datas * * @param $use_ajax Use ajax search system (if not display a standard dropdown) * @param $relativeurl Relative URL to the root directory of GLPI * @param $params array of parameters to send to ajax URL * @param $default Default datas to print in case of $use_ajax (default ' ') * @param $rand Random parameter used (default 0) * @param $display boolean display or get string (default true) **/ static function dropdown($use_ajax, $relativeurl, $params=array(), $default=" ", $rand=0, $display=true) { global $CFG_GLPI, $DB; $initparams = $params; if ($rand == 0) { $rand = mt_rand(); } $locoutput = ''; if ($use_ajax) { $locoutput .= self::getSearchTextForDropdown($rand); $locoutput .= self::updateItemOnInputTextEvent("search_$rand", "results_$rand", $CFG_GLPI["root_doc"].$relativeurl, $params, $CFG_GLPI['ajax_min_textsearch_load'], $CFG_GLPI['ajax_buffertime_load'], array(), false); } $locoutput .= "\n"; if (!$use_ajax) { // Save post datas if exists $oldpost = array(); if (isset($_POST) && count($_POST)) { $oldpost = $_POST; } $_POST = $params; $_POST["searchText"] = $CFG_GLPI["ajax_wildcard"]; ob_start(); include (GLPI_ROOT.$relativeurl); $locoutput .= ob_get_contents(); ob_end_clean(); // Restore $_POST datas if (count($oldpost)) { $_POST = $oldpost; } } else { $locoutput .= $default; } $locoutput .= "\n"; $locoutput .= ""; if ($display) { echo $locoutput; } else { return $locoutput; } } /** * Javascript code for update an item * * @param $toupdate id of the item to update * @param $url Url to get datas to update the item * @param $parameters array of parameters to send to ajax URL * @param $toobserve id of another item used to get value in case of __VALUE__ used * (default '') * @param $display boolean display or get string (default true) * **/ static function updateItem($toupdate, $url, $parameters=array(), $toobserve="", $display=true) { $output = ""; if ($display) { echo $output; } else { return $output; } } } ?>glpi-0.84.3+dfsg.1/inc/alert.class.php000066400000000000000000000153501226600447100173220ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Alert class **/ class Alert extends CommonDBTM { // ALERTS TYPE const THRESHOLD = 1; const END = 2; const NOTICE = 3; const NOTCLOSED = 4; const ACTION = 5; const PERIODICITY = 6; function prepareInputForAdd($input) { if (!isset($input['date']) || empty($input['date'])) { $input['date'] = date("Y-m-d H:i:s"); } return $input; } /** * Clear all alerts of an alert type for an item * *@param $itemtype ID of the type to clear *@param $ID ID of the item to clear *@param $alert_type ID of the alert type to clear * *@return nothing **/ function clear($itemtype, $ID, $alert_type) { global $DB; $query = "DELETE FROM `".$this->getTable()."` WHERE `itemtype` = '$itemtype' AND `items_id` = '$ID' AND `type` = '$alert_type'"; $DB->query($query); } /** * Clear all alerts for an item * * @since version 0.84 * * @param $itemtype ID of the type to clear * @param $ID ID of the item to clear * * @return nothing **/ function cleanDBonItemDelete($itemtype, $ID) { global $DB; $query = "DELETE FROM `".$this->getTable()."` WHERE `itemtype` = '$itemtype' AND `items_id` = '$ID'"; $DB->query($query); } /** * @param $options array **/ static function dropdown($options=array()) { $p['name'] = 'alert'; $p['value'] = 0; $p['display'] = true; $p['inherit_parent'] = false; if (count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } if ($p['inherit_parent']) { $times[Entity::CONFIG_PARENT] = __('Inheritance of the parent entity'); } $times[Entity::CONFIG_NEVER] = __('Never'); $times[DAY_TIMESTAMP] = __('Each day'); $times[WEEK_TIMESTAMP] = __('Each week'); $times[MONTH_TIMESTAMP] = __('Each month'); return Dropdown::showFromArray($p['name'], $times, $p); } /** * @param $options array **/ static function dropdownYesNo($options = array()) { $p['name'] = 'alert'; $p['value'] = 0; $p['display'] = true; $p['inherit_parent'] = false; if (count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } if ($p['inherit_parent']) { $times[Entity::CONFIG_PARENT] = __('Inheritance of the parent entity'); } $times[0] = __('No'); $times[1] = __('Yes'); return Dropdown::showFromArray($p['name'], $times, $p); } /** * @param $name * @param $value * @param $options array **/ static function dropdownIntegerNever($name, $value, $options=array()) { $p['min'] = 1; $p['max'] = 100; $p['step'] = 1; $p['toadd'] = array(); $p['display'] = true; if (isset($options['inherit_parent']) && $options['inherit_parent']) { $p['toadd'][-2] = __('Inheritance of the parent entity'); } $never_string = __('Never'); if (isset($options['never_string']) && $options['never_string']) { $never_string = $options['never_string']; } if (isset($options['never_value']) && $options['never_value']) { $p['toadd'][$options['never_value']] = $never_string; } else { $p['toadd'][0] = $never_string; } $p['value'] = $value; foreach ($options as $key=>$val) { $p[$key] = $val; } return Dropdown::showNumber($name, $p); } /** * @param $itemtype (default '') * @param $items_id (default '') * @param $type (default '') **/ static function alertExists($itemtype='', $items_id='', $type='') { global $DB; $query = "SELECT `id` FROM `glpi_alerts` WHERE `itemtype` = '$itemtype' AND `type` = '$type' AND `items_id` = '$items_id'"; $result = $DB->query($query); if ($DB->numrows($result)) { return $DB->result($result,0,'id'); } return false; } /** * @since version 0.84 * * @param $itemtype (default '') * @param $items_id (default '') * @param $type (default '') **/ static function getAlertDate($itemtype='', $items_id='', $type='') { global $DB; $query = "SELECT `date` FROM `glpi_alerts` WHERE `itemtype` = '$itemtype' AND `type` = '$type' AND `items_id` = '$items_id'"; $result = $DB->query($query); if ($DB->numrows($result)) { return $DB->result($result,0,'date'); } return false; } /** * @param $itemtype * @param $items_id **/ static function displayLastAlert($itemtype, $items_id) { global $DB; if ($items_id) { $query = "SELECT `date` FROM `glpi_alerts` WHERE `itemtype` = '$itemtype' AND `items_id` = '$items_id' ORDER BY `date` DESC LIMIT 1"; $result = $DB->query($query); if ($DB->numrows($result) > 0) { //TRANS: %s is the date echo sprintf(__('Alert sent on %s'), Html::convDateTime($DB->result($result, 0, 'date'))); } } } } ?>glpi-0.84.3+dfsg.1/inc/auth.class.php000066400000000000000000001302661226600447100171600ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Identification class used to login **/ class Auth { //! Error string var $err =''; /** User class variable * @see User **/ var $user; //! External authentification variable : boolean var $extauth = 0; ///External authentifications methods; var $authtypes; ///Indicates if the user is authenticated or not var $auth_succeded = 0; ///Indicates if the user is already present in database var $user_present = 0; //Indicates if the user is deleted in the directory (doesn't mean that it can login) var $user_deleted_ldap = 0; /// LDAP connection descriptor var $ldap_connection; //Store user LDAP dn var $user_dn = false; const DB_GLPI = 1; const MAIL = 2; const LDAP = 3; const EXTERNAL = 4; const CAS = 5; const X509 = 6; const NOT_YET_AUTHENTIFIED = 0; /** * Constructor **/ function __construct() { $this->user = new User(); } /** * Is the user exists in the DB * @param $options array containing condition : array('name'=>'glpi') * or array('email' => 'test at test.com') * * @return 0 (Not in the DB -> check external auth), * 1 ( Exist in the DB with a password -> check first local connection and external after), * 2 (Exist in the DB with no password -> check only external auth) **/ function userExists($options=array()) { global $DB; $query = "SELECT * FROM `glpi_users` LEFT JOIN `glpi_useremails` ON (`glpi_users`.`id` = `glpi_useremails`.`users_id`) WHERE "; $first = true; foreach ($options as $key => $value) { if ($first) { $first = false; } else { $query .= " AND "; } $query.=" `$key`='$value'"; } $result = $DB->query($query); if ($DB->numrows($result) == 0) { $this->addToError(__('Incorrect username or password')); return 0; } else { $pwd = $DB->result($result, 0, "password"); if (empty($pwd)) { //If the user has an LDAP DN, then store it in the Auth object $user_dn = $DB->result($result, 0, "user_dn"); if ($user_dn) { $this->user_dn = $user_dn; } return 2; } return 1; } } /** * Try a IMAP/POP connection * * @param $host IMAP/POP host to connect * @param $login Login to try * @param $pass Password to try * * @return boolean : connection success **/ function connection_imap($host, $login, $pass) { // we prevent some delay... if (empty($host)) { return false; } $oldlevel = error_reporting(16); // No retry (avoid lock account when password is not correct) if ($mbox = imap_open($host, $login, $pass, NULL, 1)) { imap_close($mbox); error_reporting($oldlevel); return true; } $this->addToError(imap_last_error()); error_reporting($oldlevel); return false; } /** * Find a user in a LDAP and return is BaseDN * Based on GRR auth system * * @param $ldap_method ldap_method array to use * @param $login User Login * @param $password User Password * * @return String : basedn of the user / false if not founded **/ function connection_ldap($ldap_method, $login, $password) { // we prevent some delay... if (empty($ldap_method['host'])) { return false; } $this->ldap_connection = AuthLdap::tryToConnectToServer($ldap_method, $login, $password); $this->user_deleted_ldap = false; if ($this->ldap_connection) { $params['method'] = AuthLDAP::IDENTIFIER_LOGIN; $params['fields'][AuthLDAP::IDENTIFIER_LOGIN] = $ldap_method['login_field']; $infos = AuthLdap::searchUserDn($this->ldap_connection, array('basedn' => $ldap_method['basedn'], 'login_field' => $ldap_method['login_field'], 'search_parameters' => $params, 'user_params' => array('method' => AuthLDAP::IDENTIFIER_LOGIN, 'value' => $login), 'condition' => $ldap_method['condition'], 'user_dn' => $this->user_dn)); $dn = $infos['dn']; if (!empty($dn) && @ldap_bind($this->ldap_connection, $dn, $password)) { //Hook to implement to restrict access by checking the ldap directory if (Plugin::doHookFunction("restrict_ldap_auth", $dn)) { return $dn; } $this->addToError(__('User not authorized to connect in GLPI')); //Use is present by has no right to connect because of a plugin return false; } else { // Incorrect login $this->addToError(__('Incorrect username or password')); //Use is not present anymore in the directory! if ($dn == '') { $this->user_deleted_ldap = true; } return false; } } else { $this->addToError(__('Unable to connect to the LDAP directory')); //Directory is not available return false; } } /** * Find a user in the GLPI DB * * @param $name User Login * @param $password User Password * * try to connect to DB * update the instance variable user with the user who has the name $name * and the password is $password in the DB. * If not found or can't connect to DB updates the instance variable err * with an eventual error message * * @return boolean : user in GLPI DB with the right password **/ function connection_db($name, $password) { global $DB; // sanity check... we prevent empty passwords... if (empty($password)) { $this->addToError(__('Password field is empty')); return false; } $query = "SELECT `id`,`password` FROM `glpi_users` WHERE `name` = '" . $name . "'"; $result = $DB->query($query); if (!$result) { $this->addToError(__('Incorrect username or password')); return false; } if ($result) { if ($DB->numrows($result) == 1) { $password_db = $DB->result($result, 0, "password"); // MD5 password if (strlen($password_db) == 32) { $password_post = md5($password); } else { $password_post = sha1($password); } if (strcmp($password_db, $password_post) == 0) { // Update password to sha1 if (strlen($password_db) == 32) { $input['id'] = $DB->result($result, 0, "id"); // Set glpiID to allow passwod update $_SESSION['glpiID'] = $input['id']; $input['password'] = $password; $input['password2'] = $password; $user = new User(); $user->update($input); } return true; } } $this->addToError(__('Incorrect username or password')); return false; } $this->addToError("#".$DB->errno().": ".$DB->error()); return false; } // connection_db() /** * Try to get login of external auth method * * @param $authtype external auth type (default 0) * * @return boolean : user login success **/ function getAlternateAuthSystemsUserLogin($authtype=0) { global $CFG_GLPI; switch ($authtype) { case self::CAS : include (GLPI_PHPCAS); phpCAS::client(CAS_VERSION_2_0, $CFG_GLPI["cas_host"], intval($CFG_GLPI["cas_port"]), $CFG_GLPI["cas_uri"],false); // no SSL validation for the CAS server phpCAS::setNoCasServerValidation(); // force CAS authentication phpCAS::forceAuthentication(); $this->user->fields['name'] = phpCAS::getUser(); return true; case self::EXTERNAL : $ssovariable = Dropdown::getDropdownName('glpi_ssovariables', $CFG_GLPI["ssovariables_id"]); $login_string = ''; // MoYo : checking REQUEST create a security hole for me ! if (isset($_SERVER[$ssovariable])) { $login_string = $_SERVER[$ssovariable]; } // else { // $login_string = $_REQUEST[$ssovariable]; // } $login = $login_string; $pos = stripos($login_string,"\\"); if (!$pos === false) { $login = substr($login_string, $pos + 1); } if ($CFG_GLPI['existing_auth_server_field_clean_domain']) { $pos = stripos($login,"@"); if (!$pos === false) { $login = substr($login, 0, $pos); } } if (self::isValidLogin($login)) { $this->user->fields['name'] = $login; // Get data from SSO if defined $ret = $this->user->getFromSSO(); if (!$ret) { return false; } return true; } break; case self::X509 : // From eGroupWare http://www.egroupware.org // an X.509 subject looks like: // CN=john.doe/OU=Department/O=Company/C=xx/Email=john@comapy.tld/L=City/ $sslattribs = explode('/', $_SERVER['SSL_CLIENT_S_DN']); while ($sslattrib = next($sslattribs)) { list($key,$val) = explode('=', $sslattrib); $sslattributes[$key] = $val; } if (isset($sslattributes[$CFG_GLPI["x509_email_field"]]) && NotificationMail::isUserAddressValid($sslattributes[$CFG_GLPI["x509_email_field"]]) && self::isValidLogin($sslattributes[$CFG_GLPI["x509_email_field"]])) { $restrict = false; $CFG_GLPI["x509_ou_restrict"] = trim($CFG_GLPI["x509_ou_restrict"]); if (!empty($CFG_GLPI["x509_ou_restrict"])) { $split = explode ('$',$CFG_GLPI["x509_ou_restrict"]); if (!in_array($sslattributes['OU'], $split)) { $restrict = true; } } $CFG_GLPI["x509_o_restrict"] = trim($CFG_GLPI["x509_o_restrict"]); if (!empty($CFG_GLPI["x509_o_restrict"])) { $split = explode ('$',$CFG_GLPI["x509_o_restrict"]); if (!in_array($sslattributes['O'], $split)) { $restrict = true; } } $CFG_GLPI["x509_cn_restrict"] = trim($CFG_GLPI["x509_cn_restrict"]); if (!empty($CFG_GLPI["x509_cn_restrict"])) { $split = explode ('$',$CFG_GLPI["x509_cn_restrict"]); if (!in_array($sslattributes['CN'], $split)) { $restrict = true; } } if (!$restrict) { $this->user->fields['name'] = $sslattributes[$CFG_GLPI["x509_email_field"]]; // Can do other things if need : only add it here $this->user->fields['email'] = $this->user->fields['name']; return true; } } break; } return false; } /** * Get the current identification error * * @return string : current identification error **/ function getErr() { return $this->err; } /** * Get the current user object * * @return object : current user **/ function getUser() { return $this->user; } /** * Get all the authentication methods parameters * and return it as an array * * @return nothing **/ function getAuthMethods() { //Return all the authentication methods in an array $this->authtypes = array('ldap' => getAllDatasFromTable('glpi_authldaps'), 'mail' => getAllDatasFromTable('glpi_authmails')); } /** * Add a message to the global identification error message * * @param $message the message to add * * @return nothing **/ function addToError($message) { if (!strstr($this->err,$message)) { $this->err .= $message."
\n"; } } /** * Manage use authentication and initialize the session * * @param $login_name string * @param $login_password string * @param $noauto boolean (false by default) * * @return boolean (success) */ function Login($login_name, $login_password, $noauto=false) { global $DB, $CFG_GLPI; $this->getAuthMethods(); $this->user_present = 1; $this->auth_succeded = false; //In case the user was deleted in the LDAP directory $user_deleted_ldap = false; // Trim login_name : avoid LDAP search errors $login_name = trim($login_name); if (!$noauto && ($authtype = self::checkAlternateAuthSystems())) { if ($this->getAlternateAuthSystemsUserLogin($authtype) && !empty($this->user->fields['name'])) { // Used for log when login process failed $login_name = $this->user->fields['name']; $this->auth_succeded = true; $this->extauth = 1; $this->user_present = $this->user->getFromDBbyName(addslashes($login_name)); $this->user->fields['authtype'] = $authtype; $user_dn = false; //if LDAP enabled too, get user's infos from LDAP if (Toolbox::canUseLdap()) { $ldapservers = array(); //User has already authenticate, at least once : it's ldap server if filled if (isset($this->user->fields["auths_id"]) && ($this->user->fields["auths_id"] > 0)) { $authldap = new AuthLdap(); //If ldap server is enabled if ($authldap->getFromDB($this->user->fields["auths_id"]) && $authldap->fields['is_active']) { $ldapservers[] = $authldap->fields; } //User has never beeen authenticated : try all active ldap server to find the right one } else { foreach (getAllDatasFromTable('glpi_authldaps', "`is_active`='1'") as $ldap_config) { $ldapservers[] = $ldap_config; } } foreach ($ldapservers as $ldap_method) { $ds = AuthLdap::connectToServer($ldap_method["host"], $ldap_method["port"], $ldap_method["rootdn"], Toolbox::decrypt($ldap_method["rootdn_passwd"], GLPIKEY), $ldap_method["use_tls"], $ldap_method["deref_option"]); if ($ds) { $params['method'] = AuthLdap::IDENTIFIER_LOGIN; $params['fields'][AuthLdap::IDENTIFIER_LOGIN] = $ldap_method["login_field"]; $user_dn = AuthLdap::searchUserDn($ds, array('basedn' => $ldap_method["basedn"], 'login_field' => $ldap_method['login_field'], 'search_parameters' => $params, 'user_params' => array('method' => AuthLDAP::IDENTIFIER_LOGIN, 'value' => $login_name), 'condition' => $ldap_method["condition"])); if ($user_dn) { $this->user->fields['auths_id'] = $ldap_method['id']; $this->user->getFromLDAP($ds, $ldap_method, $user_dn['dn'], $login_name, !$this->user_present); break; } } } } if ((count($ldapservers) == 0) && ($authtype == self::EXTERNAL)) { // Case of using external auth and no LDAP servers, so get data from external auth $this->user->getFromSSO(); } else { //If user is set as present in GLPI but no LDAP DN found : it means that the user //is not present in an ldap directory anymore if (!$user_dn && $this->user_present) { $user_deleted_ldap = true; $this->user_deleted_ldap = true; } } // Reset to secure it $this->user->fields['name'] = $login_name; $this->user->fields["last_login"] = $_SESSION["glpi_currenttime"]; } else { $this->addToError(__('Empty login or password')); } } // If not already auth if (!$this->auth_succeded) { if (empty($login_name) || empty($login_password)) { $this->addToError(__('Empty login or password')); } else { // exists=0 -> user doesn't yet exist // exists=1 -> user is present in DB with password // exists=2 -> user is present in DB but without password $exists = $this->userExists(array('name' => addslashes($login_name))); // Pas en premier car sinon on ne fait pas le blankpassword // First try to connect via le DATABASE if ($exists == 1) { // Without UTF8 decoding if (!$this->auth_succeded) { $this->auth_succeded = $this->connection_db(addslashes($login_name), $login_password); if ($this->auth_succeded) { $this->extauth = 0; $this->user_present = $this->user->getFromDBbyName(addslashes($login_name)); $this->user->fields["authtype"] = self::DB_GLPI; $this->user->fields["password"] = $login_password; } } } else if ($exists == 2) { //The user is not authenticated on the GLPI DB, but we need to get information about him //to find out his authentication method $this->user->getFromDBbyName(addslashes($login_name)); //If the user has already been logged, the method_auth and auths_id are already set //so we test this connection first switch ($this->user->fields["authtype"]) { case self::CAS : case self::EXTERNAL : case self::LDAP : if (Toolbox::canUseLdap()) { AuthLdap::tryLdapAuth($this, $login_name, $login_password, $this->user->fields["auths_id"], $this->user->fields["user_dn"]); if (!$this->auth_succeded && $this->user_deleted_ldap) { $user_deleted_ldap = true; } } break; case self::MAIL : if (Toolbox::canUseImapPop()) { AuthMail::tryMailAuth($this, $login_name, $login_password, $this->user->fields["auths_id"]); } break; case self::NOT_YET_AUTHENTIFIED : break; } } else if (!$exists) { //test all ldap servers only is user is not present in glpi's DB if (!$this->auth_succeded && Toolbox::canUseLdap()) { AuthLdap::tryLdapAuth($this, $login_name, $login_password, 0, false, false); } //test all imap/pop servers if (!$this->auth_succeded && Toolbox::canUseImapPop()) { AuthMail::tryMailAuth($this, $login_name, $login_password, 0, false); } } // Fin des tests de connexion } } if ($user_deleted_ldap) { User::manageDeletedUserInLdap($this->user->fields["id"]); } // Ok, we have gathered sufficient data, if the first return false the user // is not present on the DB, so we add him. // if not, we update him. if ($this->auth_succeded) { // Prepare data $this->user->fields["last_login"] = $_SESSION["glpi_currenttime"]; if ($this->extauth) { $this->user->fields["_extauth"] = 1; } if ($DB->isSlave()) { if (!$this->user_present) { // Can't add in slave mode $this->addToError(__('User not authorized to connect in GLPI')); $this->auth_succeded = false; } } else { if ($this->user_present) { // First stripslashes to avoid double slashes $input = Toolbox::stripslashes_deep($this->user->fields); // Then ensure addslashes $input = Toolbox::addslashes_deep($input); // update user and Blank PWD to clean old database for the external auth $this->user->update($input); if ($this->extauth) { $this->user->blankPassword(); } } else if ($CFG_GLPI["is_users_auto_add"]) { // Auto add user // First stripslashes to avoid double slashes $input = Toolbox::stripslashes_deep($this->user->fields); // Then ensure addslashes $input = Toolbox::addslashes_deep($input); unset ($this->user->fields); $this->user->add($input); } else { // Auto add not enable so auth failed $this->addToError(__('User not authorized to connect in GLPI')); $this->auth_succeded = false; } } } // Log Event (if possible) if (!$DB->isSlave()) { // GET THE IP OF THE CLIENT $ip = (getenv("HTTP_X_FORWARDED_FOR")?getenv("HTTP_X_FORWARDED_FOR"):getenv("REMOTE_ADDR")); if ($this->auth_succeded) { if (GLPI_DEMO_MODE) { // not translation in GLPI_DEMO_MODE Event::log(-1, "system", 3, "login", $login_name." log in from ".$ip); } else { //TRANS: %1$s is the login of the user and %2$s its IP address Event::log(-1, "system", 3, "login", sprintf(__('%1$s log in from IP %2$s'), $login_name, $ip)); } } else { if (GLPI_DEMO_MODE) { Event::log(-1, "system", 3, "login", "login", "Connection failed for " . $login_name . " ($ip)"); } else { //TRANS: %1$s is the login of the user and %2$s its IP address Event::log(-1, "system", 3, "login", sprintf(__('Failed login for %1$s from IP %2$s'), $login_name, $ip)); } } } Session::init($this); if ($noauto) { $_SESSION["noAUTO"] = 1; } return $this->auth_succeded; } /** * Print all the authentication methods * * Parameters which could be used in options array : * - name : string / name of the select (default is auths_id) * * @param $options array of possible options / not used here * *@return Nothing (display) */ static function dropdown($options=array()) { global $DB; $p['name'] = 'auths_id'; $p['value'] = 0; $p['display'] = true; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } $methods[0] = Dropdown::EMPTY_VALUE; $methods[self::DB_GLPI] = __('Authentication on GLPI database'); $sql = "SELECT COUNT(*) AS cpt FROM `glpi_authldaps` WHERE `is_active` = 1"; $result = $DB->query($sql); if ($DB->result($result, 0, "cpt") > 0) { $methods[self::LDAP] = __('Authentication on a LDAP directory'); $methods[self::EXTERNAL] = __('External authentications'); } $sql = "SELECT COUNT(*) AS cpt FROM `glpi_authmails` WHERE `is_active` = 1"; $result = $DB->query($sql); if ($DB->result($result,0,"cpt") > 0) { $methods[self::MAIL] = __('Authentication on mail server'); } return Dropdown::showFromArray($p['name'], $methods, $p); } /** * Get name of an authentication method * * @param $authtype Authentication method * @param $auths_id Authentication method ID * @param $link show links to config page ? (default 0) * @param $name override the name if not empty (default '') * * @return string */ static function getMethodName($authtype, $auths_id, $link=0, $name='') { switch ($authtype) { case self::LDAP : $auth = new AuthLdap(); if ($auth->getFromDB($auths_id)) { //TRANS: %1$s is the auth method type, %2$s the auth method name or link return sprintf(__('%1$s: %2$s'), AuthLdap::getTypeName(1), $auth->getLink()); } return sprintf(__('%1$s: %2$s'), __('LDAP directory'), $name); case self::MAIL : $auth = new AuthMail(); if ($auth->getFromDB($auths_id)) { //TRANS: %1$s is the auth method type, %2$s the auth method name or link return sprintf(__('%1$s: %2$s'), AuthLdap::getTypeName(1), $auth->getLink()); } return sprintf(__('%1$s: %2$s'),__('Email server'), $name); case self::CAS : if ($auths_id > 0) { $auth = new AuthLdap(); if ($auth->getFromDB($auths_id)) { return sprintf(__('%1$s: %2$s'), sprintf(__('%1$s + %2$s'), __('CAS'),AuthLdap::getTypeName(1)), $auth->getLink()); } } return __('CAS'); case self::X509 : if ($auths_id > 0) { $auth = new AuthLdap(); if ($auth->getFromDB($auths_id)) { return sprintf(__('%1$s: %2$s'), sprintf(__('%1$s + %2$s'), __('x509 certificate authentication'), AuthLdap::getTypeName(1)), $auth->getLink()); } } return __('x509 certificate authentication'); case self::EXTERNAL : if ($auths_id > 0) { $auth = new AuthLdap(); if ($auth->getFromDB($auths_id)) { return sprintf(__('%1$s: %2$s'), sprintf(__('%1$s + %2$s'), __('Other'), AuthLdap::getTypeName(1)), $auth->getLink()); } } return __('Other'); case self::DB_GLPI : return __('GLPI internal database'); case self::NOT_YET_AUTHENTIFIED : return __('Not yet authenticated'); } return ''; } /** * Get all the authentication methods parameters for a specific authtype * and auths_id and return it as an array * * @param $authtype Authentication method * @param $auths_id Authentication method ID **/ static function getMethodsByID($authtype, $auths_id) { global $CFG_GLPI; switch ($authtype) { case self::X509 : case self::EXTERNAL : case self::CAS : case self::LDAP : $auth = new AuthLdap(); if ($auths_id>0 && $auth->getFromDB($auths_id)) { return ($auth->fields); } break; case self::MAIL : $auth = new AuthMail(); if ($auths_id>0 && $auth->getFromDB($auths_id)) { return ($auth->fields); } break; } return array(); } /** * Is an external authentication used ? * * @return boolean **/ static function useAuthExt() { //Get all the ldap directories if (AuthLdap::useAuthLdap()) { return true; } if (AuthMail::useAuthMail()) { return true; } if (!empty($CFG_GLPI["x509_email_field"])) { return true; } // Existing auth method if (!empty($CFG_GLPI["ssovariables_id"])) { return true; } // Using CAS server if (!empty($CFG_GLPI["cas_host"])) { return true; } return false; } /** * Is an alternate auth ? * * @param $authtype auth type * * @return boolean **/ static function isAlternateAuth($authtype) { return in_array($authtype, array(self::X509, self::CAS, self::EXTERNAL)); } /** * Check alternate authentication systems * * @param $redirect need to redirect (true) or get type of Auth system which match * (false by default) * @param $redirect_string redirect string if exists (default '') * * @return nothing if redirect is true, else Auth system ID **/ static function checkAlternateAuthSystems($redirect=false, $redirect_string='') { global $CFG_GLPI; if (isset($_GET["noAUTO"]) || isset($_POST["noAUTO"])) { return false; } $redir_string = ""; if (!empty($redirect_string)) { $redir_string = "?redirect=".$redirect_string; } // Using x509 server if (!empty($CFG_GLPI["x509_email_field"]) && isset($_SERVER['SSL_CLIENT_S_DN']) && strstr($_SERVER['SSL_CLIENT_S_DN'], $CFG_GLPI["x509_email_field"])) { if ($redirect) { Html::redirect("login.php".$redir_string); } else { return self::X509; } } // Existing auth method //Look for the field in $_SERVER AND $_REQUEST // MoYo : checking REQUEST create a security hole for me ! $ssovariable = Dropdown::getDropdownName('glpi_ssovariables', $CFG_GLPI["ssovariables_id"]); if ($CFG_GLPI["ssovariables_id"] && ((isset($_SERVER[$ssovariable]) && !empty($_SERVER[$ssovariable])) /*|| (isset($_REQUEST[$ssovariable]) && !empty($_REQUEST[$ssovariable]))*/)) { if ($redirect) { Html::redirect("login.php".$redir_string); } else { return self::EXTERNAL; } } // Using CAS server if (!empty($CFG_GLPI["cas_host"])) { if ($redirect) { Html::redirect("login.php".$redir_string); } else { return self::CAS; } } return false; } /** Display refresh button in the user page * * @param $user User object * * @return nothing **/ static function showSynchronizationForm(User $user) { global $DB, $CFG_GLPI; if (Session::haveRight("user_authtype", "w")) { echo "
"; echo "
"; switch($user->getField('authtype')) { case self::CAS : case self::EXTERNAL : case self::X509 : case self::LDAP : //Look it the auth server still exists ! // <- Bad idea : id not exists unable to change anything $sql = "SELECT `name` FROM `glpi_authldaps` WHERE `id` = '" . $user->getField('auths_id') . "' AND `is_active` = 1"; $result = $DB->query($sql); if ($DB->numrows($result) > 0) { echo "
"; echo ""; echo ""; echo "
"; } break; case self::DB_GLPI : case self::MAIL : break; } echo "
"; echo "
"; echo ""; echo ""; echo "
".__('Change of the authentication method')."
"; $rand = self::dropdown(array('name' => 'authtype')); $paramsmassaction = array('authtype' => '__VALUE__', 'name' => 'change_auth_method'); Ajax::updateItemOnSelectEvent("dropdown_authtype$rand", "show_massiveaction_field", $CFG_GLPI["root_doc"]."/ajax/dropdownMassiveActionAuthMethods.php", $paramsmassaction); echo ""; echo ""; echo "
"; echo "
"; Html::closeForm(); } } /** * Determine if a login is valid * * @param $login string: login to check * * @return boolean **/ static function isValidLogin($login) { return preg_match( "/^[[:alnum:]@.\-_ ]+$/i", $login); } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { switch ($item->getType()) { case 'User' : if (Session::haveRight("user_authtype", "w")) { return __('Synchronization'); } break; } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType()=='User') { self::showSynchronizationForm($item); } return true; } /** * Form for configuration authentification **/ static function showOtherAuthList() { global $DB, $CFG_GLPI; if (!Session::haveRight("config", "w")) { return false; } echo ""; echo ""; echo "
"; echo ""; // CAS config echo "\n"; if (function_exists('curl_init')) { //TRANS: for CAS SSO system echo ""; echo "\n"; //TRANS: for CAS SSO system echo ""; echo "\n"; //TRANS: for CAS SSO system echo ""; echo "\n"; //TRANS: for CAS SSO system echo ""; echo "". "\n"; } else { echo "\n"; } // X509 config echo "\n"; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; //Other configuration echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo "
" . __('CAS authentication').''; if (!empty($CFG_GLPI["cas_host"])) { echo _x('authentication','Enabled'); } echo "
" . __('CAS Host') . "
" . __('Port') . "
" . __('Root directory (optional)')."
" . __('Log out fallback URL') . "
"; echo "

".__("The CURL extension for your PHP parser isn't installed"); echo "

"; echo "

" .__('Impossible to use CAS as external source of connection')."

" . __('x509 certificate authentication').""; if (!empty($CFG_GLPI["x509_email_field"])) { echo _x('authentication','Enabled'); } echo "
". __('Email attribute for x509 authentication') .""; echo "
". sprintf(__('Restrict %s field for x509 authentication (separator $)'),'OU') .""; echo "
". sprintf(__('Restrict %s field for x509 authentication (separator $)'),'CN') .""; echo "
". sprintf(__('Restrict %s field for x509 authentication (separator $)'),'O') .""; echo "
" . __('Other authentication sent in the HTTP request').""; if (!empty($CFG_GLPI["ssovariables_id"])) { echo _x('authentication', 'Enabled'); } echo "
". __('Field storage of the login in the HTTP request').""; SsoVariable::dropdown(array('name' => 'ssovariables_id', 'value' => $CFG_GLPI["ssovariables_id"])); echo "
" . __('Remove the domain of logins like login@domain').""; Dropdown::showYesNo('existing_auth_server_field_clean_domain', $CFG_GLPI['existing_auth_server_field_clean_domain']); echo "
" . __('Surname') . "
" . __('First name') . "
" . __('Comments') . ""; echo "
" . __('Administrative number') . ""; echo "
" . __('Email') . ""; echo "
" . sprintf(__('%1$s %2$s'),_n('Email','Emails',1), '2') . ""; echo "
" . sprintf(__('%1$s %2$s'),_n('Email','Emails',1), '3') . ""; echo "
" . sprintf(__('%1$s %2$s'),_n('Email','Emails',1), '4') . ""; echo "
" . __('Phone') . ""; echo "
" . __('Phone 2') . ""; echo "
" . __('Mobile phone') . ""; echo "
" . _x('person','Title') . ""; echo "
" . __('Category') . "
" . __('Language') . "
"; echo ""; echo "
\n"; Html::closeForm(); } } ?>glpi-0.84.3+dfsg.1/inc/authldap.class.php000066400000000000000000003554371226600447100200320ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /** * Class used to manage Auth LDAP config **/ class AuthLDAP extends CommonDBTM { const SIMPLE_INTERFACE = 'simple'; const EXPERT_INTERFACE = 'expert'; const ACTION_IMPORT = 0; const ACTION_SYNCHRONIZE = 1; const ACTION_ALL = 2; const USER_IMPORTED = 0; const USER_SYNCHRONIZED = 1; const USER_DELETED_LDAP = 2; //Import user by giving his login const IDENTIFIER_LOGIN = 'login'; //Import user by giving his email const IDENTIFIER_EMAIL = 'email'; // From CommonDBTM public $dohistory = true; static function getTypeName($nb=0) { return _n('LDAP directory', 'LDAP directories', $nb); } static function canCreate() { return Session::haveRight('config', 'w'); } static function canView() { return Session::haveRight('config', 'r'); } function post_getEmpty() { $this->fields['port'] = '389'; $this->fields['condition'] = ''; $this->fields['login_field'] = 'uid'; $this->fields['use_tls'] = 0; $this->fields['group_field'] = ''; $this->fields['group_condition'] = ''; $this->fields['group_search_type'] = 0; $this->fields['group_member_field'] = ''; $this->fields['email1_field'] = 'mail'; $this->fields['email2_field'] = ''; $this->fields['email3_field'] = ''; $this->fields['email4_field'] = ''; $this->fields['realname_field'] = 'sn'; $this->fields['firstname_field'] = 'givenname'; $this->fields['phone_field'] = 'telephonenumber'; $this->fields['phone2_field'] = ''; $this->fields['mobile_field'] = ''; $this->fields['registration_number_field'] = ''; $this->fields['comment_field'] = ''; $this->fields['title_field'] = ''; $this->fields['use_dn'] = 0; } /** * Preconfig datas for standard system * * @param $type type of standard system : AD * * @return nothing **/ function preconfig($type) { switch($type) { case 'AD' : $this->fields['port'] = "389"; $this->fields['condition'] = '(&(objectClass=user)(objectCategory=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))'; $this->fields['login_field'] = 'samaccountname'; $this->fields['use_tls'] = 0; $this->fields['group_field'] = 'memberof'; $this->fields['group_condition'] = '(&(objectClass=user)(objectCategory=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))'; $this->fields['group_search_type'] = 0; $this->fields['group_member_field'] = ''; $this->fields['email1_field'] = 'mail'; $this->fields['email2_field'] = ''; $this->fields['email3_field'] = ''; $this->fields['email4_field'] = ''; $this->fields['realname_field'] = 'sn'; $this->fields['firstname_field'] = 'givenname'; $this->fields['phone_field'] = 'telephonenumber'; $this->fields['phone2_field'] = 'othertelephone'; $this->fields['mobile_field'] = 'mobile'; $this->fields['registration_number_field'] = 'employeenumber'; $this->fields['comment_field'] = 'info'; $this->fields['title_field'] = 'title'; $this->fields['entity_field'] = 'ou'; $this->fields['entity_condition'] = '(objectclass=organizationalUnit)'; $this->fields['use_dn'] = 1 ; $this->fields['can_support_pagesize'] = 1 ; $this->fields['pagesize'] = '1000'; break; default: $this->post_getEmpty(); } } function prepareInputForUpdate($input) { if (isset($input["rootdn_passwd"])) { if (empty($input["rootdn_passwd"])) { unset($input["rootdn_passwd"]); } else { $input["rootdn_passwd"] = Toolbox::encrypt(stripslashes($input["rootdn_passwd"]), GLPIKEY); } } if (isset($input["_blank_passwd"]) && $input["_blank_passwd"]) { $input['rootdn_passwd'] = ''; } // Set attributes in lower case if (count($input)) { foreach ($input as $key => $val) { if (preg_match('/_field$/',$key)) { $input[$key] = Toolbox::strtolower($val); } } } return $input; } /** * @since version 0.84 * * @param $field * @param $values * @param $options array **/ static function getSpecificValueToDisplay($field, $values, array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } switch ($field) { case 'group_search_type' : return self::getGroupSearchTypeName($values[$field]); } return parent::getSpecificValueToDisplay($field, $values, $options); } /** * @since version 0.84 * * @param $field * @param $name (default '') * @param $values (default('') * @param $options array **/ static function getSpecificValueToSelect($field, $name='', $values='', array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'group_search_type' : $options['value'] = $values[$field]; $options['name'] = $name; return self::dropdownGroupSearchType($options); } return parent::getSpecificValueToSelect($field, $name, $values, $options); } /** * @since version 0.84 * * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { global $CFG_GLPI; $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "import" : case "sync" : if (!Session::haveRight("import_externalauth_users", 'w')) { $res['nbnoright']++; } else if (isset($_GET['multiple_actions']) && isset($_SESSION["glpi_massiveaction"])) { if ($count = count($input["item"])) { $i = $input["ldap_process_count"]-$count+1; Html::createProgressBar(); Html::changeProgressBarPosition($i, $input["ldap_process_count"], sprintf(__('%1$s/%2$s'), $i, $input["ldap_process_count"])); $key = key($input["item"]); unset($input["item"][$key]); if (AuthLdap::ldapImportUserByServerId(array('method' => AuthLDAP::IDENTIFIER_LOGIN, 'value' => $key), $input["mode"], $input["authldaps_id"], true)) { $input['res']['ok']++; } else { $input['res']['ko']++; } if (count($input["item"])) { // more to do -> redirect $_SESSION['glpi_massiveaction']['POST'] = $input; Html::redirect($CFG_GLPI['root_doc'].'/front/massiveaction.php?multiple_actions=1'); } else { // Nothing to do redirect Html::changeProgressBarPosition(100, 100, __('Successful importation')); $res = $input['res']; $_SESSION['ldap_import']['action'] = 'show'; } } } else { if (count($input['item']) > 0) { $input["ldap_process_count"] = 0; $input["authldaps_id"] = $_SESSION['ldap_import']['authldaps_id']; $input["mode"] = $_SESSION['ldap_import']['mode']; $input['res'] = array('ok' => 0, 'ko' => 0, 'noright' => 0); foreach ($input['item'] as $key => $val) { if ($val) { $input["ldap_process_count"]++; } } $_SESSION['glpi_massiveaction']['POST'] = $input; Html::redirect($CFG_GLPI['root_doc'].'/front/massiveaction.php?multiple_actions=1'); } else { $res['ko'] ++; } } $res['REDIRECT'] = $CFG_GLPI['root_doc']."/front/ldap.import.php"; break; case "import_group" : $group = new Group; if (!Session::haveRight("user_authtype", 'w') || !$group->canGlobal('w')) { $res['nbnoright']++; } else if (isset($_GET['multiple_actions']) && isset($_SESSION["glpi_massiveaction"])) { if ($count = count($input["item"])) { $i = $input["ldap_process_count"]-$count+1; Html::createProgressBar(); Html::changeProgressBarPosition($i, $input["ldap_process_count"], sprintf(__('%1$s/%2$s'), $i, $input["ldap_process_count"])); $key = key($input["item"]); unset($input["item"][$key]); if (isset($input["ldap_import_entities"][$key])) { $entity = $input["ldap_import_entities"][$key]; } else { $entity = $_SESSION["glpiactive_entity"]; } if (AuthLdap::ldapImportGroup($key, array("authldaps_id" => $input["authldaps_id"], "entities_id" => $entity, "is_recursive" => $input["ldap_import_recursive"][$key], "type" => $input["ldap_import_type"][$key]))) { $input['res']['ok']++; } else { $input['res']['ko']++; } if (count($input["item"])) { // more to do -> redirect $_SESSION['glpi_massiveaction']['POST'] = $input; Html::redirect($CFG_GLPI['root_doc'].'/front/massiveaction.php?multiple_actions=1'); } else { // Nothing to do redirect Html::changeProgressBarPosition(100, 100, __('Successful importation')); $res = $input['res']; $_SESSION['ldap_import']['action'] = 'show'; } } } else { if (count($input['item']) > 0) { $input["ldap_process_count"] = 0; $input["authldaps_id"] = $_SESSION['ldap_server']; $input['res'] = array('ok' => 0, 'ko' => 0, 'noright' => 0); foreach ($input['item'] as $key => $val) { if ($val) { $input["ldap_process_count"]++; $input["ldap_import_entities"][$key] = $input["ldap_import_entities"][$key]; $input["ldap_import_type"][$key] = $input["ldap_import_type"][$key]; $input["ldap_import_recursive"][$key] = $input["ldap_import_recursive"][$key]; } } $_SESSION['glpi_massiveaction']['POST'] = $input; Html::redirect($CFG_GLPI['root_doc'].'/front/massiveaction.php?multiple_actions=1'); } else { $res['ko'] ++; } } $res['REDIRECT'] = $CFG_GLPI['root_doc']."/front/ldap.group.import.php"; break; default : return parent::doSpecificMassiveActions($input); } return $res; } /** * Print the auth ldap form * * @param $ID integer ID of the item * @param $options array * - target for the form * * @return Nothing (display) **/ function showForm($ID, $options=array()) { if (!Session::haveRight("config", "w")) { return false; } $spotted = false; if (empty($ID)) { if ($this->getEmpty()) { $spotted = true; } if (isset($options['preconfig'])) { $this->preconfig($options['preconfig']); } } else { if ($this->getFromDB($ID)) { $spotted = true; } } if (Toolbox::canUseLdap()) { $this->showTabs($options); $this->showFormHeader($options); if (empty($ID)) { $target = $_SERVER['PHP_SELF']; echo "".__('Preconfiguration')." "; echo ""; echo "".__('Active Directory').""; echo "  /  "; echo "".__('Default values'); echo ""; } echo "" . __('Name') . ""; echo ""; if ($ID > 0) { echo "".__('Last update')."".Html::convDateTime($this->fields["date_mod"]); } else { echo " "; } echo ""; echo "" . __('Default server') . ""; echo ""; Dropdown::showYesNo('is_default', $this->fields['is_default']); echo ""; echo "" . __('Active'). ""; echo ""; Dropdown::showYesNo('is_active', $this->fields['is_active']); echo ""; echo "" . __('Server') . ""; echo ""; echo "" . __('Port (default=389)') . ""; echo ""; echo ""; echo "" . __('Connection filter') . ""; echo ""; echo ""; echo ""; echo "" . __('BaseDN') . ""; echo ""; echo "fields["basedn"]."\">"; echo ""; echo "" . __('RootDN (for non anonymous binds)') . ""; echo "fields["rootdn"]."\">"; echo ""; echo "" . __('Password (for non-anonymous binds)') . ""; echo ""; if ($ID) { echo " ".__('Clear'); } echo ""; echo "" . __('Login field') . ""; echo ""; echo ""; echo "" . __('Comments') . ""; echo ""; echo ""; //Fill fields when using preconfiguration models if (!$ID) { $hidden_fields = array('comment_field', 'condition', 'email1_field', 'email2_field', 'email3_field', 'email4_field', 'entity_condition', 'entity_field', 'firstname_field', 'group_condition', 'group_field', 'group_member_field', 'group_search_type', 'mobile_field', 'phone_field', 'phone2_field', 'port', 'realname_field', 'registration_number_field', 'title_field', 'use_dn', 'use_tls'); foreach ($hidden_fields as $hidden_field) { echo ""; } } echo ""; $this->showFormButtons($options); $this->addDivForTabs(); } else { echo "
 "; echo ""; echo "
" . self::getTypeName(1) . "
"; echo "

". __("The LDAP extension of your PHP parser isn't installed")."

"; echo "

".__('Impossible to use LDAP as external source of connection')."

". "
"; } } function showFormAdvancedConfig() { $ID = $this->getField('id'); echo ""; echo "
"; echo ""; echo ""; echo ""; echo ""; if (self::isLdapPageSizeAvailable(false, false)) { echo ""; echo ""; echo ""; echo ""; echo ""; } else { echo ""; echo ""; echo ""; } echo ""; echo ""; echo ""; echo "
"; echo "". __('Advanced information')."
" . __('Use TLS') . ""; if (function_exists("ldap_start_tls")) { Dropdown::showYesNo('use_tls', $this->fields["use_tls"]); } else { echo "".__('ldap_start_tls does not exist'); } echo "" . __('LDAP directory time zone') . ""; Dropdown::showGMT("time_offset", $this->fields["time_offset"]); echo"
" . __('Use paged results') . ""; Dropdown::showYesNo('can_support_pagesize', $this->fields["can_support_pagesize"]); echo "" . __('Page size') . ""; Dropdown::showInteger("pagesize", $this->fields['pagesize'], 100, 100000, 100); echo"
" . __('Maximum number of results') . ""; Dropdown::showInteger('ldap_maxlimit', $this->fields['ldap_maxlimit'], 100, 999999, 100, array(0 => __('Unlimited'))); echo "
" . __('How LDAP aliases should be handled') . ""; $alias_options[LDAP_DEREF_NEVER] = __('Never dereferenced (default)'); $alias_options[LDAP_DEREF_ALWAYS] = __('Always dereferenced'); $alias_options[LDAP_DEREF_SEARCHING] = __('Dereferenced during the search (but not when locating)'); $alias_options[LDAP_DEREF_FINDING] = __('Dereferenced when locating (not during the search)'); Dropdown::showFromArray("deref_option", $alias_options, array('value' => $this->fields["deref_option"])); echo"
"; echo ""; echo "
"; Html::closeForm(); echo "
"; } function showFormReplicatesConfig() { global $DB; $ID = $this->getField('id'); $target = $this->getFormURL(); $rand = mt_rand(); AuthLdapReplicate::addNewReplicateForm($target, $ID); $sql = "SELECT * FROM `glpi_authldapreplicates` WHERE `authldaps_id` = '$ID' ORDER BY `name`"; $result = $DB->query($sql); if (($nb = $DB->numrows($result)) > 0) { echo "
"; $canedit = Session::haveRight("config", "w"); Html::openMassiveActionsForm('massAuthLdapReplicate'.$rand); echo "
"; $massiveactionparams = array('num_displayed' => $nb); Html::showMassiveActions('AuthLdapReplicate', $massiveactionparams); echo ""; echo ""; echo ""; if (isset($_SESSION["LDAP_TEST_MESSAGE"])) { echo ""; unset($_SESSION["LDAP_TEST_MESSAGE"]); } echo ""; echo ""; echo ""; echo "". ""; while ($ldap_replicate = $DB->fetch_assoc($result)) { echo ""; echo ""; echo ""; echo""; } echo "
".__('List of LDAP directory replicates') . "
"; echo $_SESSION["LDAP_TEST_MESSAGE"]; echo"
".Html::getCheckAllAsCheckbox('massAuthLdapReplicate'.$rand)."".__('Name')."".__('List of LDAP directory replicates')."
"; Html::showMassiveActionCheckBox('AuthLdapReplicate', $ldap_replicate["id"]); echo "" . $ldap_replicate["name"] . "".sprintf(__('%1$s: %2$s'), $ldap_replicate["host"], $ldap_replicate["port"]); echo ""; echo "
"; $massiveactionparams['ontop'] = false; Html::showMassiveActions('AuthLdapReplicate', $massiveactionparams); echo "
"; Html::closeForm(); } } /** * @since version 0.84 * * @param $options array **/ static function dropdownGroupSearchType(array $options) { $p['name'] = 'group_search_type'; $p['value'] = 0; $p['display'] = true; if (count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } $tab = self::getGroupSearchTypeName(); return Dropdown::showFromArray($p['name'], $tab, $p); } /** * Get the possible value for contract alert * * @since version 0.83 * * @param $val if not set, ask for all values, else for 1 value (default NULL) * * @return array or string **/ static function getGroupSearchTypeName($val=NULL) { $tmp[0] = __('In users'); $tmp[1] = __('In groups'); $tmp[2] = __('In users and groups'); if (is_null($val)) { return $tmp; } if (isset($tmp[$val])) { return $tmp[$val]; } return NOT_AVAILABLE; } function showFormGroupsConfig() { $ID = $this->getField('id'); echo ""; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
" . __('Belonging to groups') . "
" . __('Search type') . ""; self::dropdownGroupSearchType(array('value' => $this->fields["group_search_type"])); echo "" . __('User attribute containing its groups') . ""; echo "
" . __('Filter to search in groups').""; echo ""; echo "
" . __('Group attribute containing its users') . "" . __('Use DN in the search') . ""; Dropdown::showYesNo("use_dn", $this->fields["use_dn"]); echo "
"; echo ""; echo "
"; Html::closeForm(); echo "
"; } function showFormTestLDAP () { $ID = $this->getField('id'); if ($ID > 0) { echo ""; echo "
"; echo ""; echo ""; if (isset($_SESSION["LDAP_TEST_MESSAGE"])) { echo ""; unset($_SESSION["LDAP_TEST_MESSAGE"]); } echo ""; echo "
" . __('Test of connection to LDAP directory') . "
"; echo $_SESSION["LDAP_TEST_MESSAGE"]; echo"
"; echo ""; echo "
"; Html::closeForm(); } } function showFormUserConfig() { $ID = $this->getField('id'); echo ""; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
" . __('Binding to the LDAP directory') . "
" . __('Surname') . "" . __('First name') . "
" . __('Comments') . ""; echo "" . __('Administrative number') . ""; echo ""; echo "
" . __('Email') . ""; echo "" . sprintf(__('%1$s %2$s'),_n('Email','Emails',1), '2') . ""; echo "
" . sprintf(__('%1$s %2$s'),_n('Email','Emails',1), '3') . ""; echo "" . sprintf(__('%1$s %2$s'),_n('Email','Emails',1), '4') . ""; echo "
" . __('Phone') . ""; echo "" . __('Phone 2') . ""; echo "
" . __('Mobile phone') . ""; echo "" . _x('person','Title') . ""; echo "
" . __('Category') . "" . __('Language') . "
"; echo ""; echo "
"; Html::closeForm(); } function showFormEntityConfig() { $ID = $this->getField('id'); echo ""; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
". __('Import entities from LDAP directory')."
" . __('Attribute representing entity') . ""; echo ""; echo "
" . __('Search filter for entities') . ""; echo "
"; echo ""; echo "
"; Html::closeForm(); } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab(__CLASS__, $ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } function getSearchOptions() { $tab = array(); $tab['common'] = $this->getTypeName(1); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['datatype'] = 'number'; $tab[2]['massiveaction'] = false; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'host'; $tab[3]['name'] = __('Server'); $tab[3]['datatype'] = 'string'; $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'port'; $tab[4]['name'] = __('Port'); $tab[4]['datatype'] = 'integer'; $tab[5]['table'] = $this->getTable(); $tab[5]['field'] = 'basedn'; $tab[5]['name'] = __('BaseDN'); $tab[5]['datatype'] = 'string'; $tab[6]['table'] = $this->getTable(); $tab[6]['field'] = 'condition'; $tab[6]['name'] = __('Connection filter'); $tab[6]['datatype'] = 'text'; $tab[7]['table'] = $this->getTable(); $tab[7]['field'] = 'is_default'; $tab[7]['name'] = __('Default server'); $tab[7]['datatype'] = 'bool'; $tab[7]['massiveaction'] = false; $tab[8]['table'] = $this->getTable(); $tab[8]['field'] = 'login_field'; $tab[8]['name'] = __('Login field'); $tab[8]['massiveaction'] = false; $tab[8]['datatype'] = 'string'; $tab[9]['table'] = $this->getTable(); $tab[9]['field'] = 'realname_field'; $tab[9]['name'] = __('Surname'); $tab[9]['massiveaction'] = false; $tab[9]['datatype'] = 'string'; $tab[10]['table'] = $this->getTable(); $tab[10]['field'] = 'firstname_field'; $tab[10]['name'] = __('First name'); $tab[10]['massiveaction'] = false; $tab[10]['datatype'] = 'string'; $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'phone_field'; $tab[11]['name'] = __('Phone'); $tab[11]['massiveaction'] = false; $tab[11]['datatype'] = 'string'; $tab[12]['table'] = $this->getTable(); $tab[12]['field'] = 'phone2_field'; $tab[12]['name'] = __('Phone 2'); $tab[12]['massiveaction'] = false; $tab[12]['datatype'] = 'string'; $tab[13]['table'] = $this->getTable(); $tab[13]['field'] = 'mobile_field'; $tab[13]['name'] = __('Mobile phone'); $tab[13]['massiveaction'] = false; $tab[13]['datatype'] = 'string'; $tab[14]['table'] = $this->getTable(); $tab[14]['field'] = 'title_field'; $tab[14]['name'] = _x('person','Title'); $tab[14]['massiveaction'] = false; $tab[14]['datatype'] = 'string'; $tab[15]['table'] = $this->getTable(); $tab[15]['field'] = 'category_field'; $tab[15]['name'] = __('Category'); $tab[15]['massiveaction'] = false; $tab[15]['datatype'] = 'string'; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab[17]['table'] = $this->getTable(); $tab[17]['field'] = 'email1_field'; $tab[17]['name'] = __('Email'); $tab[17]['massiveaction'] = false; $tab[17]['datatype'] = 'string'; $tab[25]['table'] = $this->getTable(); $tab[25]['field'] = 'email2_field'; $tab[25]['name'] = sprintf(__('%1$s %2$s'),_n('Email','Emails',1), '2'); $tab[25]['massiveaction'] = false; $tab[25]['datatype'] = 'string'; $tab[26]['table'] = $this->getTable(); $tab[26]['field'] = 'email3_field'; $tab[26]['name'] = sprintf(__('%1$s %2$s'),_n('Email','Emails',1), '3'); $tab[26]['massiveaction'] = false; $tab[26]['datatype'] = 'string'; $tab[27]['table'] = $this->getTable(); $tab[27]['field'] = 'email4_field'; $tab[27]['name'] = sprintf(__('%1$s %2$s'),_n('Email','Emails',1), '4'); $tab[27]['massiveaction'] = false; $tab[27]['datatype'] = 'string'; $tab[18]['table'] = $this->getTable(); $tab[18]['field'] = 'use_dn'; $tab[18]['name'] = __('Use DN in the search'); $tab[18]['datatype'] = 'bool'; $tab[18]['massiveaction'] = false; $tab[19]['table'] = $this->getTable(); $tab[19]['field'] = 'date_mod'; $tab[19]['name'] = __('Last update'); $tab[19]['datatype'] = 'datetime'; $tab[19]['massiveaction'] = false; $tab[20]['table'] = $this->getTable(); $tab[20]['field'] = 'language_field'; $tab[20]['name'] = __('Language'); $tab[20]['massiveaction'] = false; $tab[20]['datatype'] = 'string'; $tab[21]['table'] = $this->getTable(); $tab[21]['field'] = 'group_field'; $tab[21]['name'] = __('User attribute containing its groups'); $tab[21]['massiveaction'] = false; $tab[21]['datatype'] = 'string'; $tab[22]['table'] = $this->getTable(); $tab[22]['field'] = 'group_condition'; $tab[22]['name'] = __('Filter to search in groups'); $tab[22]['massiveaction'] = false; $tab[22]['datatype'] = 'string'; $tab[23]['table'] = $this->getTable(); $tab[23]['field'] = 'group_member_field'; $tab[23]['name'] = __('Group attribute containing its users'); $tab[23]['massiveaction'] = false; $tab[23]['datatype'] = 'string'; $tab[24]['table'] = $this->getTable(); $tab[24]['field'] = 'group_search_type'; $tab[24]['datatype'] = 'specific'; $tab[24]['name'] = __('Search type'); $tab[24]['massiveaction'] = false; $tab[30]['table'] = $this->getTable(); $tab[30]['field'] = 'is_active'; $tab[30]['name'] = __('Active'); $tab[30]['datatype'] = 'bool'; return $tab; } /** * @param $width **/ function showSystemInformations($width) { // No need to translate, this part always display in english (for copy/paste to forum) $ldap_servers = self::getLdapServers(); if (!empty($ldap_servers)) { echo "" . self::getTypeName(2) . "\n"; echo "
\n \n";
         foreach ($ldap_servers as $ID => $value) {
            $fields = array('Server'            => 'host',
                            'Port'              => 'port',
                            'BaseDN'            => 'basedn',
                            'Connection filter' => 'condition',
                            'RootDN'            => 'rootdn',
                            'Use TLS'           => 'use_tls');
            $msg   = '';
            $first = true;
            foreach ($fields as $label => $field) {
               $msg .= (!$first ? ', ' : '').
                        $label.': '.
                        ($value[$field]? '\''.$value[$field].'\'' : 'none');
               $first = false;
            }
            echo wordwrap($msg."\n", $width, "\n\t\t");
         }
         echo "\n
"; } } /** * Get LDAP fields to sync to GLPI data from a glpi_authldaps array * * @param $authtype_array array Authentication method config array (from table) * * @return array of "user table field name" => "config value" **/ static function getSyncFields(array $authtype_array) { $ret = array(); $fields = array('login_field' => 'name', 'email1_field' => 'email1', 'email2_field' => 'email2', 'email3_field' => 'email3', 'email4_field' => 'email4', 'realname_field' => 'realname', 'firstname_field' => 'firstname', 'phone_field' => 'phone', 'phone2_field' => 'phone2', 'mobile_field' => 'mobile', 'comment_field' => 'comment', 'title_field' => 'usertitles_id', 'category_field' => 'usercategories_id', 'language_field' => 'language', 'registration_number_field' => 'registration_number'); foreach ($fields as $key => $val) { if (isset($authtype_array[$key]) && !empty($authtype_array[$key])) { $ret[$val] = $authtype_array[$key]; } } return $ret; } /** Display LDAP filter * * @param $target target for the form * @param $users boolean for user ? (true by default) * * @return nothing **/ static function displayLdapFilter($target, $users=true) { $config_ldap = new self(); $res = $config_ldap->getFromDB($_SESSION["ldap_server"]); if ($users) { $filter_name1 = "condition"; $filter_var = "ldap_filter"; } else { $filter_var = "ldap_group_filter"; switch ($config_ldap->fields["group_search_type"]) { case 0 : $filter_name1 = "condition"; break; case 1 : $filter_name1 = "group_condition"; break; case 2 : $filter_name1 = "group_condition"; $filter_name2 = "condition"; break; } } if (!isset($_SESSION[$filter_var]) || ($_SESSION[$filter_var] == '')) { $_SESSION[$filter_var] = $config_ldap->fields[$filter_name1]; } echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo ""; echo "
" . ($users?__('Search filter for users') :__('Filter to search in groups')) . "
"; echo ""; //Only display when looking for groups in users AND groups if (!$users && ($config_ldap->fields["group_search_type"] == 2)) { if (!isset($_SESSION["ldap_group_filter2"]) || ($_SESSION["ldap_group_filter2"] == '')) { $_SESSION["ldap_group_filter2"] = $config_ldap->fields[$filter_name2]; } echo "
" . __('Search filter for users') . "
"; echo "
"; echo "
"; Html::closeForm(); echo "
"; } /** Converts LDAP timestamps over to Unix timestamps * * @param $ldapstamp LDAP timestamp * @param $ldap_time_offset time offset (default 0) * * @return unix timestamp **/ static function ldapStamp2UnixStamp($ldapstamp, $ldap_time_offset=0) { global $CFG_GLPI; $year = substr($ldapstamp,0,4); $month = substr($ldapstamp,4,2); $day = substr($ldapstamp,6,2); $hour = substr($ldapstamp,8,2); $minute = substr($ldapstamp,10,2); $seconds = substr($ldapstamp,12,2); $stamp = gmmktime($hour,$minute,$seconds,$month,$day,$year); $stamp += $CFG_GLPI["time_offset"]-$ldap_time_offset; return $stamp; } /** Converts a Unix timestamp to an LDAP timestamps * * @param $date datetime * * @return ldap timestamp **/ static function date2ldapTimeStamp($date) { return date("YmdHis",strtotime($date)).'.0Z'; } /** Test a LDAP connection * * @param $auths_id ID of the LDAP server * @param $replicate_id use a replicate if > 0 (default -1) * * @return boolean connection succeeded ? **/ static function testLDAPConnection($auths_id, $replicate_id=-1) { $config_ldap = new self(); $res = $config_ldap->getFromDB($auths_id); $ldap_users = array(); // we prevent some delay... if (!$res) { return false; } //Test connection to a replicate if ($replicate_id != -1) { $replicate = new AuthLdapReplicate(); $replicate->getFromDB($replicate_id); $host = $replicate->fields["host"]; $port = $replicate->fields["port"]; } else { //Test connection to a master ldap server $host = $config_ldap->fields['host']; $port = $config_ldap->fields['port']; } $ds = self::connectToServer($host, $port, $config_ldap->fields['rootdn'], Toolbox::decrypt($config_ldap->fields['rootdn_passwd'], GLPIKEY), $config_ldap->fields['use_tls'], $config_ldap->fields['deref_option']); if ($ds) { return true; } return false; } /** * @since version 0.84 * * @param $limitexceeded (false by default) **/ static function displaySizeLimitWarning($limitexceeded=false) { global $CFG_GLPI; if ($limitexceeded) { echo "
"; echo "
"; echo "".__( ". __('Warning: The request exceeds the limit of the directory. The results are only partial.'); echo "
"; } } /** Show LDAP users to add or synchronise * * @return nothing **/ static function showLdapUsers() { global $CFG_GLPI; $values['order'] = 'DESC'; $values['start'] = 0; foreach ($_SESSION['ldap_import'] as $option => $value) { $values[$option] = $value; } $rand = mt_rand(); $results = array(); $limitexceeded = false; $ldap_users = self::getAllUsers($values, $results, $limitexceeded); if (is_array($ldap_users)) { $numrows = count($ldap_users); if ($numrows > 0) { self::displaySizeLimitWarning($limitexceeded); Html::printPager($values['start'], $numrows, $_SERVER['PHP_SELF'], ''); // delete end array_splice($ldap_users, $values['start'] + $_SESSION['glpilist_limit']); // delete begin if ($values['start'] > 0) { array_splice($ldap_users, 0, $values['start']); } $form_action = ''; $textbutton = ''; if ($_SESSION['ldap_import']['mode']) { $textbutton = _x('button','Synchronize'); $form_action = 'sync'; } else { $textbutton = _x('button','Import'); $form_action = 'import'; } Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $paramsma = array('num_displayed' => min(count($ldap_users), $_SESSION['glpilist_limit']), 'specific_actions' => array($form_action => $textbutton)); Html::showMassiveActions(__CLASS__, $paramsma); echo ""; echo ""; echo ""; $num = 0; echo Search::showHeaderItem(Search::HTML_OUTPUT, _n('User', 'Users', 2), $num, $_SERVER['PHP_SELF']. "?order=".($values['order']=="DESC"?"ASC":"DESC")); echo ""; if ($_SESSION['ldap_import']['mode']) { echo ""; } echo ""; foreach ($ldap_users as $userinfos) { $link = $user = $userinfos["user"]; if (isset($userinfos['id']) && Session::haveRight('user','r')) { $link = "$user"; } if (isset($userinfos["timestamp"])) { $stamp = $userinfos["timestamp"]; } else { $stamp = ''; } if (isset($userinfos["date_sync"])) { $date_sync = $userinfos["date_sync"]; } else { $date_sync = ''; } echo ""; //Need to use " instead of ' because it doesn't work with names with ' inside ! echo ""; echo ""; if ($stamp != '') { echo ""; } else { echo ""; } if ($_SESSION['ldap_import']['mode']) { if ($date_sync != '') { echo ""; } else { echo ""; } } echo ""; } echo ""; echo ""; $num = 0; echo Search::showHeaderItem(Search::HTML_OUTPUT, _n('User', 'Users', 2), $num, $_SERVER['PHP_SELF']. "?order=".($values['order']=="DESC"?"ASC":"DESC")); echo ""; if ($_SESSION['ldap_import']['mode']) { echo ""; } echo ""; echo "
"; Html::checkAllAsCheckbox('mass'.__CLASS__.$rand); echo "".__('Last update in the LDAP directory')."".__('Last update in GLPI')."
" . $link . "" .Html::convDateTime(date("Y-m-d H:i:s",$stamp)). " " . Html::convDateTime($date_sync) . " 
"; Html::checkAllAsCheckbox('mass'.__CLASS__.$rand); echo "".__('Last update in the LDAP directory')."".__('Last update in GLPI')."
"; $paramsma['ontop'] = false; Html::showMassiveActions(__CLASS__, $paramsma); Html::closeForm(); Html::printPager($values['start'], $numrows, $_SERVER['PHP_SELF'], ''); } else { echo "
". ($_SESSION['ldap_import']['mode']?__('No user to be synchronized') :__('No user to be imported'))."
"; } } else { echo "
". ($_SESSION['ldap_import']['mode']?__('No user to be synchronized') :__('No user to be imported'))."
"; } } static function searchForUsers($ds, $values, $filter, $attrs, &$limitexceeded, &$user_infos, &$ldap_users, $config_ldap) { //If paged results cannot be used (PHP < 5.4) $cookie = ''; //Cookie used to perform query using pages $count = 0; //Store the number of results ldap_search do { if (self::isLdapPageSizeAvailable($config_ldap)) { ldap_control_paged_result($ds, $config_ldap->fields['pagesize'], true, $cookie); } $sr = @ldap_search($ds, $values['basedn'], $filter, $attrs); if ($sr) { if (in_array(ldap_errno($ds),array(4,11))) { // openldap return 4 for Size limit exceeded $limitexceeded = true; } $info = self::get_entries_clean($ds, $sr); if (in_array(ldap_errno($ds),array(4,11))) { $limitexceeded = true; } $count += $info['count']; //If page results are enabled and the number of results is greater than the maximum allowed //warn user that limit is exceeded and stop search if (self::isLdapPageSizeAvailable($config_ldap) && $config_ldap->fields['ldap_maxlimit'] && ($count > $config_ldap->fields['ldap_maxlimit'])) { $limitexceeded = true; break; } for ($ligne = 0 ; $ligne < $info["count"] ; $ligne++) { //If ldap add if ($values['mode'] == self::ACTION_IMPORT) { if (in_array($config_ldap->fields['login_field'], $info[$ligne])) { $ldap_users[$info[$ligne][$config_ldap->fields['login_field']][0]] = $info[$ligne][$config_ldap->fields['login_field']][0]; $user_infos[$info[$ligne][$config_ldap->fields['login_field']][0]]["timestamp"] = self::ldapStamp2UnixStamp($info[$ligne]['modifytimestamp'][0], $config_ldap->fields['time_offset']); $user_infos[$info[$ligne][$config_ldap->fields['login_field']][0]]["user_dn"] = $info[$ligne]['dn']; } } else { //If ldap synchronisation if (in_array($config_ldap->fields['login_field'],$info[$ligne])) { $ldap_users[$info[$ligne][$config_ldap->fields['login_field']][0]] = self::ldapStamp2UnixStamp($info[$ligne]['modifytimestamp'][0], $config_ldap->fields['time_offset']); $user_infos[$info[$ligne][$config_ldap->fields['login_field']][0]]["timestamp"] = self::ldapStamp2UnixStamp($info[$ligne]['modifytimestamp'][0], $config_ldap->fields['time_offset']); $user_infos[$info[$ligne][$config_ldap->fields['login_field']][0]]["user_dn"] = $info[$ligne]['dn']; $user_infos[$info[$ligne][$config_ldap->fields['login_field']][0]]["name"] = $info[$ligne][$config_ldap->fields['login_field']][0]; } } } } else { return false; } if (self::isLdapPageSizeAvailable($config_ldap)) { ldap_control_paged_result_response($ds, $sr, $cookie); } } while (($cookie !== null) && ($cookie != '')); return true; } /** Get the list of LDAP users to add/synchronize * * @param $options array of possible options: * - authldaps_id ID of the server to use * - mode user to synchronise or add ? * - ldap_filter ldap filter to use * - basedn force basedn (default authldaps_id one) * - order display order * - begin_date begin date to time limit * - end_date end date to time limit * - script true if called by an external script * @param &$results result stats * @param &$limitexceeded limit exceeded exception * * @return array of the user **/ static function getAllUsers($options=array(), &$results, &$limitexceeded) { global $DB, $CFG_GLPI; $config_ldap = new self(); $res = $config_ldap->getFromDB($options['authldaps_id']); $values['order'] = 'DESC'; $values['mode'] = self::ACTION_SYNCHRONIZE; $values['ldap_filter'] = ''; $values['basedn'] = $config_ldap->fields['basedn']; $values['begin_date'] = NULL; $values['end_date'] = date('Y-m-d H:i:s', time()-DAY_TIMESTAMP); //Called by an external script or not $values['script'] = 0; foreach ($options as $option => $value) { // this test break mode detection - if ($value != '') { $values[$option] = $value; //} } $ldap_users = array(); $user_infos = array(); $limitexceeded = false; // we prevent some delay... if (!$res) { return false; } if ($values['order'] != "DESC") { $values['order'] = "ASC"; } $ds = $config_ldap->connect(); if ($ds) { //Search for ldap login AND modifyTimestamp, //which indicates the last update of the object in directory $attrs = array($config_ldap->fields['login_field'], "modifyTimestamp"); // Try a search to find the DN if ($values['ldap_filter'] == '') { $filter = "(".$config_ldap->fields['login_field']."=*)"; } else { $filter = $values['ldap_filter']; } if ($values['script'] && !empty($values['begin_date'])) { $filter_timestamp = self::addTimestampRestrictions($values['begin_date'], $values['end_date']); $filter = "(&$filter $filter_timestamp)"; } $result = self::searchForUsers($ds, $values, $filter, $attrs, $limitexceeded, $user_infos, $ldap_users, $config_ldap); if (!$result) { return false; } } else { return false; } $glpi_users = array(); $sql = "SELECT * FROM `glpi_users`"; if ($values['mode'] != self::ACTION_IMPORT) { $sql .= " WHERE `authtype` IN (-1,".Auth::LDAP.",".Auth::EXTERNAL.", ". Auth::CAS.") AND `auths_id` = '".$options['authldaps_id']."'"; } $sql .= " ORDER BY `name` ".$values['order']; foreach ($DB->request($sql) as $user) { $tmpuser = new User(); //Ldap add : fill the array with the login of the user if ($values['mode'] == self::ACTION_IMPORT) { $glpi_users[$user['name']] = $user['name']; } else { //Ldap synchronisation : look if the user exists in the directory //and compares the modifications dates (ldap and glpi db) $userfound = false; if (!empty($ldap_users[$user['name']]) || ($userfound = self::dnExistsInLdap($user_infos, $user['user_dn']))) { // userfound seems that user dn is present in GLPI DB but do not correspond to an GLPI user // -> renaming case if ($userfound) { //Get user in DB with this dn $tmpuser->getFromDBByDn($user['user_dn']); $glpi_users[] = array('id' => $user['id'], 'user' => $userfound['name'], 'timestamp' => $user_infos[$userfound['name']]['timestamp'], 'date_sync' => $tmpuser->fields['date_sync'], 'dn' => $user['user_dn']); //If entry was modified or if script should synchronize all the users } else if (($values['action'] == self::ACTION_ALL) || (($ldap_users[$user['name']] - strtotime($user['date_sync'])) > 0)) { $glpi_users[] = array('id' => $user['id'], 'user' => $user['name'], 'timestamp' => $user_infos[$user['name']]['timestamp'], 'date_sync' => $user['date_sync'], 'dn' => $user['user_dn']); } // Only manage deleted user if ALL (because of entity visibility in delegated mode) } else if (($values['action'] == self::ACTION_ALL) && !$limitexceeded) { //If user is marked as coming from LDAP, but is not present in it anymore if (!$user['is_deleted'] && ($user['auths_id'] == $options['ldapservers_id'])) { User::manageDeletedUserInLdap($user['id']); $results[self::USER_DELETED_LDAP] ++; } } } } //If add, do the difference between ldap users and glpi users if ($values['mode'] == self::ACTION_IMPORT) { $diff = array_diff_ukey($ldap_users,$glpi_users,'strcasecmp'); $list = array(); $tmpuser = new User(); foreach ($diff as $user) { //If user dn exists in DB, it means that user login field has changed if (!$tmpuser->getFromDBByDn(addslashes($user_infos[$user]["user_dn"]))) { $list[] = array("user" => $user, "timestamp" => $user_infos[$user]["timestamp"], "date_sync" => Dropdown::EMPTY_VALUE); } } if ($values['order'] == 'DESC') { rsort($list); } else { sort($list); } return $list; } return $glpi_users; } /** * Check if a user DN exists in a ldap user search result * * @since version 0.84 * * @param $ldap_infos ldap user search result * @param $user_dn user dn to look for * * @return false if the user dn doesn't exist, user ldap infos otherwise **/ static function dnExistsInLdap($ldap_infos, $user_dn) { $found = false; foreach ($ldap_infos as $ldap_info) { if ($ldap_info['user_dn'] == $user_dn) { $found = $ldap_info; break; } } return $found; } /** Show LDAP groups to add or synchronise in an entity * * @param $target target page for the form * @param $start where to start the list * @param $sync synchronise or add ? (default 0) * @param $filter ldap filter to use (default '') * @param $filter2 second ldap filter to use (which case ?) (default '') * @param $entity working entity * @param $order display order (default DESC) * * @return nothing **/ static function showLdapGroups($target, $start, $sync=0, $filter='', $filter2='', $entity, $order='DESC') { echo "
"; $limitexceeded = false; $ldap_groups = self::getAllGroups($_SESSION["ldap_server"], $filter, $filter2, $entity, $limitexceeded, $order); if (is_array($ldap_groups)) { $numrows = count($ldap_groups); $rand = mt_rand(); $colspan = (Session::isMultiEntitiesMode()?5:4); if ($numrows > 0) { self::displaySizeLimitWarning($limitexceeded); $parameters = ''; Html::printPager($start, $numrows, $target,$parameters); // delete end array_splice($ldap_groups, $start + $_SESSION['glpilist_limit']); // delete begin if ($start > 0) { array_splice($ldap_groups, 0, $start); } echo "
"; Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $paramsma = array('num_displayed' => min($_SESSION['glpilist_limit'], count($ldap_groups)), 'specific_actions' => array('import_group' => _sx('button','Import'))); Html::showMassiveActions(__CLASS__, $paramsma); echo ""; echo ""; echo ""; $header_num = 0; echo Search::showHeaderItem(Search::HTML_OUTPUT, __('Group'), $header_num, $target."?order=".($order=="DESC"?"ASC":"DESC"), 1, $order); echo ""; echo ""; if (Session::isMultiEntitiesMode()) { echo""; } echo ""; foreach ($ldap_groups as $groupinfos) { $group = $groupinfos["cn"]; $group_dn = $groupinfos["dn"]; $search_type = $groupinfos["search_type"]; echo ""; //Need to use " instead of ' because it doesn't work with names with ' inside ! echo ""; echo ""; echo ""; echo ""; if (Session::isMultiEntitiesMode()) { echo ""; } $paramsma['ontop'] = false; Html::showMassiveActions(__CLASS__, $paramsma); Html::closeForm(); echo ""; Html::printPager($start, $numrows, $target, $parameters); } else { echo "
" . __('No group to be imported') . "
"; } } else { echo "
" . __('No group to be imported') . "
"; } } /** Get all LDAP groups from a ldap server which are not already in an entity * * @since version 0.84 new parameter $limitexceeded * * @param $auths_id ID of the server to use * @param $filter ldap filter to use * @param $filter2 second ldap filter to use if needed * @param $entity entity to search * @param $limitexceeded * @param $order order to use (default DESC) * * @return array of the groups **/ static function getAllGroups($auths_id, $filter, $filter2, $entity, &$limitexceeded, $order='DESC') { global $DB; $config_ldap = new self(); $res = $config_ldap->getFromDB($auths_id); $infos = array(); $groups = array(); $ds = $config_ldap->connect(); if ($ds) { switch ($config_ldap->fields["group_search_type"]) { case 0 : $infos = self::getGroupsFromLDAP($ds, $config_ldap, $filter, false, $infos, $limitexceeded); break; case 1 : $infos = self::getGroupsFromLDAP($ds, $config_ldap, $filter, true, $infos, $limitexceeded); break; case 2 : $infos = self::getGroupsFromLDAP($ds, $config_ldap, $filter ,true, $infos, $limitexceeded); $infos = self::getGroupsFromLDAP($ds, $config_ldap, $filter2, false, $infos, $limitexceeded); break; } if (!empty($infos)) { $glpi_groups = array(); //Get all groups from GLPI DB for the current entity and the subentities $sql = "SELECT `name` FROM `glpi_groups` ". getEntitiesRestrictRequest("WHERE","glpi_groups"); $res = $DB->query($sql); //If the group exists in DB -> unset it from the LDAP groups while ($group = $DB->fetch_assoc($res)) { $glpi_groups[$group["name"]] = 1; } $ligne = 0; foreach ($infos as $dn => $info) { if (!isset($glpi_groups[$info["cn"]])) { $groups[$ligne]["dn"] = $dn; $groups[$ligne]["cn"] = $info["cn"]; $groups[$ligne]["search_type"] = $info["search_type"]; $ligne++; } } } if ($order == 'DESC') { function local_cmp($b, $a) { return strcasecmp($a['cn'], $b['cn']); } } else { function local_cmp($a ,$b) { return strcasecmp($a['cn'], $b['cn']); } } usort($groups,'local_cmp'); } return $groups; } /** * Get the group's cn by giving his DN * * @param $ldap_connection ldap connection to use * @param $group_dn the group's dn * * @return the group cn **/ static function getGroupCNByDn($ldap_connection, $group_dn) { $sr = @ ldap_read($ldap_connection, $group_dn, "objectClass=*", array("cn")); $v = self::get_entries_clean($ldap_connection, $sr); if (!is_array($v) || (count($v) == 0) || empty($v[0]["cn"][0])) { return false; } return $v[0]["cn"][0]; } /** * @since version 0.84 new parameter $limitexceeded * * @param $ldap_connection * @param $config_ldap * @param $filter * @param $search_in_groups (true by default) * @param $groups array * @param $limitexceeded **/ static function getGroupsFromLDAP($ldap_connection, $config_ldap, $filter, $search_in_groups=true, $groups=array(), &$limitexceeded) { global $DB; //First look for groups in group objects $extra_attribute = ($search_in_groups?"cn":$config_ldap->fields["group_field"]); $attrs = array("dn", $extra_attribute); if ($filter == '') { if ($search_in_groups) { $filter = (!empty($config_ldap->fields['group_condition']) ? $config_ldap->fields['group_condition'] : "(objectclass=*)"); } else { $filter = (!empty($config_ldap->fields['condition']) ? $config_ldap->fields['condition'] : "(objectclass=*)"); } } $cookie = ''; $count = 0; do { if (self::isLdapPageSizeAvailable($config_ldap)) { ldap_control_paged_result($ldap_connection, $config_ldap->fields['pagesize'], true, $cookie); } $sr = @ldap_search($ldap_connection, $config_ldap->fields['basedn'], $filter , $attrs); if ($sr) { if (in_array(ldap_errno($ldap_connection),array(4,11))) { // openldap return 4 for Size limit exceeded $limitexceeded = true; } $infos = self::get_entries_clean($ldap_connection, $sr); if (in_array(ldap_errno($ldap_connection),array(4,11))) { // openldap return 4 for Size limit exceeded $limitexceeded = true; } $count += $infos['count']; //If page results are enabled and the number of results is greater than the maximum allowed //warn user that limit is exceeded and stop search if (self::isLdapPageSizeAvailable($config_ldap) && $config_ldap->fields['ldap_maxlimit'] && ($count > $config_ldap->fields['ldap_maxlimit'])) { $limitexceeded = true; break; } for ($ligne=0 ; $ligne < $infos["count"] ; $ligne++) { if ($search_in_groups) { // No cn : not a real object if (isset($infos[$ligne]["cn"][0])) { $cn = $infos[$ligne]["cn"][0]; $groups[$infos[$ligne]["dn"]] = (array("cn" => $infos[$ligne]["cn"][0], "search_type" => "groups")); } } else { if (isset($infos[$ligne][$extra_attribute])) { if (($config_ldap->fields["group_field"] == 'dn') || in_array('ou', $groups)) { $dn = $infos[$ligne][$extra_attribute]; $ou = array(); for ($tmp=$dn ; count($tmptab=explode(',',$tmp,2))==2 ; $tmp=$tmptab[1]) { $ou[] = $tmptab[1]; } /// Search in DB for group with ldap_group_dn if (($config_ldap->fields["group_field"] == 'dn') && (count($ou) > 0)) { $query = "SELECT `ldap_value` FROM `glpi_groups` WHERE `ldap_group_dn` IN ('".implode("', '", Toolbox::addslashes_deep($ou))."')"; foreach ($DB->request($query) as $group) { $groups[$group['ldap_value']] = array("cn" => $group['ldap_value'], "search_type" => "users"); } } } else { for ($ligne_extra=0 ; $ligne_extra<$infos[$ligne][$extra_attribute]["count"] ; $ligne_extra++) { $groups[$infos[$ligne][$extra_attribute][$ligne_extra]] = array("cn" => self::getGroupCNByDn($ldap_connection, $infos[$ligne][$extra_attribute][$ligne_extra]), "search_type" => "users"); } } } } } } if (self::isLdapPageSizeAvailable($config_ldap)) { ldap_control_paged_result_response($ldap_connection, $sr, $cookie); } } while (($cookie !== null) && ($cookie != '')); return $groups; } /** Form to choose a ldap server * * @param $target target page for the form * * @return nothing **/ static function ldapChooseDirectory($target) { global $DB; $query = "SELECT * FROM `glpi_authldaps` WHERE `is_active` = '1' ORDER BY `name` ASC"; $result = $DB->query($query); if ($DB->numrows($result) == 1) { //If only one server, do not show the choose ldap server window $ldap = $DB->fetch_assoc($result); $_SESSION["ldap_server"] = $ldap["id"]; Html::redirect($_SERVER['PHP_SELF']); } echo ""; echo "
"; echo "

" . __('Please choose LDAP directory to import users from') . "

"; echo "
"; Html::checkAllAsCheckbox('mass'.__CLASS__.$rand); echo "".__('Group DN')."".__('Destination entity')."".__('Child entities')."
" . $group . "" .$group_dn. ""; Entity::dropdown(array('value' => $entity, 'name' => "ldap_import_entities[" .$group_dn . "]=".$entity)); echo ""; Dropdown::showYesNo("ldap_import_recursive[" .$group_dn . "]", 0); } else { echo ""; } echo "
"; echo ""; //If more than one ldap server if ($DB->numrows($result) > 1) { echo ""; echo ""; echo ""; } else { //No ldap server echo "". ""; } echo "
" . __('LDAP directory choice') . "
" . __('Name') . ""; AuthLDAP::Dropdown(array('name' => 'ldap_server', 'display_emptychoice' => false, 'comment' => true, 'condition' => "`is_active`='1'")); echo "
"; echo "
".__('No LDAP directory defined in GLPI')."
"; Html::closeForm(); } /** Import a user from a specific ldap server * * @param $params array of parameters: method (IDENTIFIER_LOGIN or IDENTIFIER_EMAIL) + value * @param $action synchoronize (true) or import (false) * @param $ldap_server ID of the LDAP server to use * @param $display display message information on redirect (false by default) * * @return nothing **/ static function ldapImportUserByServerId($params=array(), $action, $ldap_server, $display=false) { global $DB; static $conn_cache = array(); $params = Toolbox::stripslashes_deep($params); $config_ldap = new self(); $res = $config_ldap->getFromDB($ldap_server); $ldap_users = array(); // we prevent some delay... if (!$res) { return false; } $search_parameters = array(); //Connect to the directory if (isset($conn_cache[$ldap_server])) { $ds = $conn_cache[$ldap_server]; } else { $ds = $config_ldap->connect(); } if ($ds) { $conn_cache[$ldap_server] = $ds; $search_parameters['method'] = $params['method']; $search_parameters['fields'][self::IDENTIFIER_LOGIN] = $config_ldap->fields['login_field']; if ($params['method'] == self::IDENTIFIER_EMAIL) { $search_parameters['fields'][self::IDENTIFIER_EMAIL] = $config_ldap->fields['email1_field']; } //Get the user's dn & login $attribs = array('basedn' => $config_ldap->fields['basedn'], 'login_field' => $search_parameters['fields'][$search_parameters['method']], 'search_parameters' => $search_parameters, 'user_params' => $params, 'condition' => $config_ldap->fields['condition']); $infos = self::searchUserDn($ds,$attribs); if ($infos && $infos['dn']) { $user_dn = $infos['dn']; $login = $infos[$config_ldap->fields['login_field']]; $groups = array(); $user = new User(); //Get information from LDAP if ($user->getFromLDAP($ds, $config_ldap->fields, $user_dn, addslashes($login), ($action == self::ACTION_IMPORT))) { // Add the auth method // Force date sync $user->fields["date_sync"] = $_SESSION["glpi_currenttime"]; if ($action == self::ACTION_IMPORT) { $user->fields["authtype"] = Auth::LDAP; $user->fields["auths_id"] = $ldap_server; //Save information in database ! $input = $user->fields; // Display message after redirect if ($display) { $input['add'] = 1; } $user->fields["id"] = $user->add($input); return array('action' => self::USER_IMPORTED, 'id' => $user->fields["id"]); } $input = $user->fields; //Get the ID by user name if (!($id = User::getIdByfield('name', $login))) { //In case user id as changed : get id by dn $id = User::getIdByfield('user_dn', $user_dn); } $input['id'] = $id; if ($display) { $input['update'] = 1; } $user->update($input); return array('action' => self::USER_SYNCHRONIZED, 'id' => $input['id']); } return false; } if ($action != self::ACTION_IMPORT) { $users_id = User::getIdByField('name', $params['value']); User::manageDeletedUserInLdap($users_id); return array('action' => self::USER_DELETED_LDAP, 'id' => $users_id); } } else { return false; } } /** Converts an array of parameters into a query string to be appended to a URL. * * @param $group_dn dn of the group to import * @param $options array for * - authldaps_id * - entities_id where group must to be imported * - is_recursive * * @return nothing **/ static function ldapImportGroup ($group_dn, $options=array()) { $config_ldap = new self(); $res = $config_ldap->getFromDB($options['authldaps_id']); $ldap_users = array(); $group_dn = $group_dn; // we prevent some delay... if (!$res) { return false; } //Connect to the directory $ds = $config_ldap->connect(); if ($ds) { $group_infos = self::getGroupByDn($ds, stripslashes($group_dn)); $group = new Group(); if ($options['type'] == "groups") { return $group->add(array("name" => addslashes($group_infos["cn"][0]), "ldap_group_dn" => addslashes($group_infos["dn"]), "entities_id" => $options['entities_id'], "is_recursive" => $options['is_recursive'])); } return $group->add(array("name" => addslashes($group_infos["cn"][0]), "ldap_field" => $config_ldap->fields["group_field"], "ldap_value" => addslashes($group_infos["dn"]), "entities_id" => $options['entities_id'], "is_recursive" => $options['is_recursive'])); } return false; } /** * Open LDAP connexion to current serveur **/ function connect() { return $this->connectToServer($this->fields['host'], $this->fields['port'], $this->fields['rootdn'], Toolbox::decrypt($this->fields['rootdn_passwd'], GLPIKEY), $this->fields['use_tls'], $this->fields['deref_option']); } /** * Connect to a LDAP serveur * * @param $host LDAP host to connect * @param $port port to use * @param $login login to use (default '') * @param $password password to use (default '') * @param $use_tls use a tls connection ? (false by default) * @param $deref_options deref options used * * @return link to the LDAP server : false if connection failed **/ static function connectToServer($host, $port, $login="", $password="", $use_tls=false, $deref_options) { $ds = @ldap_connect($host, intval($port)); if ($ds) { @ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); @ldap_set_option($ds, LDAP_OPT_REFERRALS, 0); @ldap_set_option($ds, LDAP_OPT_DEREF, $deref_options); if ($use_tls) { if (!@ldap_start_tls($ds)) { return false; } } // Auth bind if ($login != '') { $b = @ldap_bind($ds, $login, $password); } else { // Anonymous bind $b = @ldap_bind($ds); } if ($b) { return $ds; } } return false; } /** * Try to connect to a ldap server * * @param $ldap_method ldap_method array to use * @param $login User Login * @param $password User Password * * @return link to the LDAP server : false if connection failed **/ static function tryToConnectToServer($ldap_method, $login, $password) { $ds = self::connectToServer($ldap_method['host'], $ldap_method['port'], $ldap_method['rootdn'], Toolbox::decrypt($ldap_method['rootdn_passwd'], GLPIKEY), $ldap_method['use_tls'], $ldap_method['deref_option']); // Test with login and password of the user if exists if (!$ds && !empty($login)) { $ds = self::connectToServer($ldap_method['host'], $ldap_method['port'], $login, $password, $ldap_method['use_tls'], $ldap_method['deref_option']); } //If connection is not successfull on this directory, try replicates (if replicates exists) if (!$ds && ($ldap_method['id'] > 0)) { foreach (self::getAllReplicateForAMaster($ldap_method['id']) as $replicate) { $ds = self::connectToServer($replicate["host"], $replicate["port"], $ldap_method['rootdn'], Toolbox::decrypt($ldap_method['rootdn_passwd'], GLPIKEY), $ldap_method['use_tls'], $ldap_method['deref_option']); // Test with login and password of the user if (!$ds && !empty($login)) { $ds = self::connectToServer($replicate["host"], $replicate["port"], $login, $password, $ldap_method['use_tls'], $ldap_method['deref_option']); } if ($ds) { return $ds; } } } return $ds; } static function getLdapServers() { return getAllDatasFromTable('glpi_authldaps', '', false, '`is_default` DESC'); } /** * Is the LDAP authentication used ? * * @return boolean **/ static function useAuthLdap() { global $DB; //Get all the ldap directories $sql = "SELECT COUNT(*) FROM `glpi_authldaps` WHERE `is_active` = 1"; $result = $DB->query($sql); if ($DB->result($result,0,0) > 0) { return true; } return false; } /** * Import a user from ldap * Check all the directories. When the user is found, then import it * * @param $options array containing condition: * array('name'=>'glpi') or array('email' => 'test at test.com') **/ static function importUserFromServers($options=array()) { $auth = new Auth(); $params = array(); if (isset($options['name'])) { $params['value'] = $options['name']; $params['method'] = self::IDENTIFIER_LOGIN; } if (isset($options['email'])) { $params['value'] = $options['email']; $params['method'] = self::IDENTIFIER_EMAIL; } $auth->user_present = $auth->userExists($options); //If the user does not exists if ($auth->user_present == 0) { $auth->getAuthMethods(); $ldap_methods = $auth->authtypes["ldap"]; $userid = -1; foreach ($ldap_methods as $ldap_method) { if ($ldap_method['is_active']) { $result = self::ldapImportUserByServerId($params, 0, $ldap_method["id"], true); if ($result != false) { return $result; } } } Session::addMessageAfterRedirect(__('User not found or several users found'), false, ERROR); } else { Session::addMessageAfterRedirect(__('Unable to add. The user already exist.'), false, ERROR); } return false; } /** * Authentify a user by checking a specific directory * * @param $auth identification object * @param $login user login * @param $password user password * @param $ldap_method ldap_method array to use * @param $user_dn user LDAP DN if present * * @return identification object **/ static function ldapAuth($auth, $login, $password, $ldap_method, $user_dn) { $oldlevel = error_reporting(0); $user_dn = $auth->connection_ldap($ldap_method, $login, $password); error_reporting($oldlevel); $auth->auth_succeded = false; $auth->extauth = 1; if ($user_dn) { $auth->auth_succeded = true; //There's already an existing user in DB with the same DN but its login field has changed if ($auth->user->getFromDBbyDn($user_dn)) { //Change user login $auth->user->fields['name'] = $login; $auth->user_present = true; //The user is a new user } else { $auth->user_present = $auth->user->getFromDBbyName(addslashes($login)); } $auth->user->getFromLDAP($auth->ldap_connection, $ldap_method, $user_dn, $login, !$auth->user_present); $auth->user->fields["authtype"] = Auth::LDAP; $auth->user->fields["auths_id"] = $ldap_method["id"]; } return $auth; } /** * Try to authentify a user by checking all the directories * * @param $auth identification object * @param $login user login * @param $password user password * @param $auths_id auths_id already used for the user (default 0) * @param $user_dn user LDAP DN if present (false by default) * @param $break if user is not found in the first directory, * stop searching or try the following ones (true by default) * * @return identification object **/ static function tryLdapAuth($auth, $login, $password, $auths_id=0, $user_dn=false, $break=true) { //If no specific source is given, test all ldap directories if ($auths_id <= 0) { foreach ($auth->authtypes["ldap"] as $ldap_method) { if (!$auth->auth_succeded && $ldap_method['is_active']) { $auth = self::ldapAuth($auth, $login, $password, $ldap_method, $user_dn); } else { if ($break) { break; } } } //Check if the ldap server indicated as the last good one still exists ! } else if (array_key_exists($auths_id, $auth->authtypes["ldap"])) { //A specific ldap directory is given, test it and only this one ! $auth = self::ldapAuth($auth, $login, $password, $auth->authtypes["ldap"][$auths_id], $user_dn); } return $auth; } /** * Get dn for a user * * @param $ds LDAP link * @param $options array of possible options: * - basedn : base dn used to search * - login_field : attribute to store login * - search_parameters array of search parameters * - user_params array of parameters : method (IDENTIFIER_LOGIN or IDENTIFIER_EMAIL) + value * - condition : ldap condition used * * @return dn of the user, else false **/ static function searchUserDn($ds, $options=array()) { $values['basedn'] = ''; $values['login_field'] = ''; $values['search_parameters'] = array(); $values['user_params'] = ''; $values['condition'] = ''; $values['user_dn'] = false; foreach ($options as $key => $value) { $values[$key] = $value; } //By default authentify users by login //$authentification_value = ''; $login_attr = $values['search_parameters']['fields'][self::IDENTIFIER_LOGIN]; $ldap_parameters = array("dn"); foreach ($values['search_parameters']['fields'] as $parameter) { $ldap_parameters[] = $parameter; } //First : if a user dn is provided, look for it in the directory //Before trying to find the user using his login_field if ($values['user_dn']) { $info = self::getUserByDn($ds, $values['user_dn'], $ldap_parameters); if ($info) { return array('dn' => $values['user_dn'], $login_attr => $info[$login_attr][0]); } } //$authentification_value = $values['user_params']['value']; // Tenter une recherche pour essayer de retrouver le DN $filter = "(".$values['login_field']."=".$values['user_params']['value'].")"; if (!empty($values['condition'])) { $filter = "(& $filter ".$values['condition'].")"; } if ($result = @ldap_search($ds, $values['basedn'], $filter, $ldap_parameters)) { $info = self::get_entries_clean($ds, $result); if (is_array($info) && ($info['count'] == 1)) { return array('dn' => $info[0]['dn'], $login_attr => $info[0][$login_attr][0]); } } return false; } /** * Get an object from LDAP by giving his DN * * @param ds the active connection to the directory * @param condition the LDAP filter to use for the search * @param $dn string DN of the object * @param attrs array of the attributes to retreive **/ static function getObjectByDn($ds, $condition, $dn, $attrs=array()) { if ($result = @ ldap_read($ds, $dn, $condition, $attrs)) { $info = self::get_entries_clean($ds, $result); if (is_array($info) && ($info['count'] == 1)) { return $info[0]; } } return false; } /** * @param $ds * @param $user_dn * @param $attrs **/ static function getUserByDn($ds, $user_dn, $attrs) { return self::getObjectByDn($ds, "objectClass=*", $user_dn, $attrs); } /** * Get infos for groups * * @param $ds LDAP link * @param $group_dn dn of the group * * @return group infos if found, else false **/ static function getGroupByDn($ds, $group_dn) { return self::getObjectByDn($ds, "objectClass=*", $group_dn, array("cn")); } /** * @param $options array * @param $delete (false by default) **/ static function manageValuesInSession($options=array(), $delete=false) { $fields = array('action', 'authldaps_id', 'basedn', 'begin_date', 'criterias', 'end_date', 'entities_id', 'interface', 'ldap_filter', 'mode'); //If form accessed via popup, do not show expert mode link if (isset($options['popup'])) { //If coming form the helpdesk form : reset all criterias $_SESSION['ldap_import']['popup'] = 1; $_SESSION['ldap_import']['no_expert_mode'] = 1; $_SESSION['ldap_import']['action'] = 'show'; $_SESSION['ldap_import']['interface'] = self::SIMPLE_INTERFACE; $_SESSION['ldap_import']['mode'] = self::ACTION_IMPORT; } if (!$delete) { if (isset($options["rand"])) { $_SESSION["glpipopup"]["rand"] = $options["rand"]; } if (!isset($_SESSION['ldap_import']['entities_id'])) { $options['entities_id'] = $_SESSION['glpiactive_entity']; } if (isset($options['toprocess'])) { $_SESSION['ldap_import']['action'] = 'process'; } if (isset($options['change_directory'])) { $options['ldap_filter'] = ''; } if (!isset($_SESSION['ldap_import']['authldaps_id'])) { $_SESSION['ldap_import']['authldaps_id'] = NOT_AVAILABLE; } if ((!Session::haveRight('config','w') && !Session::haveRight('entity','w')) || (!isset($_SESSION['ldap_import']['interface']) && !isset($options['interface']))) { $options['interface'] = self::SIMPLE_INTERFACE; } foreach ($fields as $field) { if (isset($options[$field])) { $_SESSION['ldap_import'][$field] = $options[$field]; } } if (isset($_SESSION['ldap_import']['begin_date']) && ($_SESSION['ldap_import']['begin_date'] == 'NULL')) { $_SESSION['ldap_import']['begin_date'] = ''; } if (isset($_SESSION['ldap_import']['end_date']) && ($_SESSION['ldap_import']['end_date'] == 'NULL')) { $_SESSION['ldap_import']['end_date'] = ''; } if (!isset($_SESSION['ldap_import']['criterias'])) { $_SESSION['ldap_import']['criterias'] = array(); } $authldap = new self(); //Filter computation if ($_SESSION['ldap_import']['interface'] == self::SIMPLE_INTERFACE) { $entity = new Entity(); if ($entity->getFromDB($_SESSION['ldap_import']['entities_id']) && ($entity->getField('authldaps_id') > 0)) { $authldap->getFromDB($_SESSION['ldap_import']['authldaps_id']); $_SESSION['ldap_import']['authldaps_id'] = $entity->getField('authldaps_id'); $_SESSION['ldap_import']['basedn'] = $entity->getField('ldap_dn'); // No dn specified in entity : use standard one if (empty($_SESSION['ldap_import']['basedn'])) { $_SESSION['ldap_import']['basedn'] = $authldap->getField('basedn'); } if ($entity->getField('entity_ldapfilter') != NOT_AVAILABLE) { $_SESSION['ldap_import']['entity_filter'] = $entity->getField('entity_ldapfilter'); } } else { $_SESSION['ldap_import']['authldaps_id'] = self::getDefault(); if ($_SESSION['ldap_import']['authldaps_id'] > 0) { $authldap->getFromDB($_SESSION['ldap_import']['authldaps_id']); $_SESSION['ldap_import']['basedn'] = $authldap->getField('basedn'); } } if ($_SESSION['ldap_import']['authldaps_id'] > 0) { $_SESSION['ldap_import']['ldap_filter'] = self::buildLdapFilter($authldap); } } else { if ($_SESSION['ldap_import']['authldaps_id'] == NOT_AVAILABLE || !$_SESSION['ldap_import']['authldaps_id']) { $_SESSION['ldap_import']['authldaps_id'] = self::getDefault(); if ($_SESSION['ldap_import']['authldaps_id'] > 0) { $authldap->getFromDB($_SESSION['ldap_import']['authldaps_id']); $_SESSION['ldap_import']['basedn'] = $authldap->getField('basedn'); } } if (!isset($_SESSION['ldap_import']['ldap_filter']) || $_SESSION['ldap_import']['ldap_filter'] == '') { $authldap->getFromDB($_SESSION['ldap_import']['authldaps_id']); $_SESSION['ldap_import']['basedn'] = $authldap->getField('basedn'); $_SESSION['ldap_import']['ldap_filter'] = self::buildLdapFilter($authldap); } } //Unset all values in session } else { unset($_SESSION['ldap_import']); } } /** * @param $authldap AuthLDAP object **/ static function showUserImportForm(AuthLDAP $authldap) { global $DB; //Get data related to entity (directory and ldap filter) $authldap->getFromDB($_SESSION['ldap_import']['authldaps_id']); echo "
"; echo ""; echo ""; echo ""; switch ($_SESSION['ldap_import']['interface']) { case self::EXPERT_INTERFACE : //If more than one directory configured //Display dropdown ldap servers if (($_SESSION['ldap_import']['authldaps_id'] != NOT_AVAILABLE) && ($_SESSION['ldap_import']['authldaps_id'] > 0)) { if (self::getNumberOfServers() > 1) { echo ""; echo ""; } echo ""; echo ""; } break; //case self::SIMPLE_INTERFACE : default : //If multi-entity mode and more than one entity visible //else no need to select entity if (Session::isMultiEntitiesMode() && (count($_SESSION['glpiactiveentities']) > 1)) { echo "". ""; } else { //Only one entity is active, store it echo ""; } if ((isset($_SESSION['ldap_import']['begin_date']) && !empty($_SESSION['ldap_import']['begin_date'])) || (isset($_SESSION['ldap_import']['end_date']) && !empty($_SESSION['ldap_import']['end_date']))) { $enabled = 1; } else { $enabled = 0; } Dropdown::showAdvanceDateRestrictionSwitch($enabled); echo "
"; echo "" .($_SESSION['ldap_import']['mode']?__('Synchronizing already imported users') :__('Import new users')); // Expert interface allow user to override configuration. // If not coming from the ticket form, then give expert/simple link if ((Session::haveRight('config','w') || Session::haveRight('entity','w')) && !isset($_SESSION['ldap_import']['no_expert_mode'])) { echo " ".__('Expert mode').""; } else { echo "&interface=".self::SIMPLE_INTERFACE."'>".__('Simple mode').""; } } else { $_SESSION['ldap_import']['interface'] = self::SIMPLE_INTERFACE; } echo "
"; echo "
".__('LDAP directory choice').""; self::dropdown(array('name' => 'authldaps_id', 'value' => $_SESSION['ldap_import']['authldaps_id'], 'condition' => "`is_active` = '1'", 'display_emptychoice' => false)); echo " "; echo "
".__('BaseDN').""; echo ""; echo "
".__('Search filter for users').""; echo ""; echo "
".__('Select the desired entity').""; Entity::dropdown(array('value' => $_SESSION['ldap_import']['entities_id'], 'entity' => $_SESSION['glpiactiveentities'], 'on_change' => 'submit()')); echo "
"; if (($_SESSION['ldap_import']['authldaps_id'] != NOT_AVAILABLE) && ($_SESSION['ldap_import']['authldaps_id'] > 0)) { $field_counter = 0; $fields = array('login_field' => __('Login'), 'email1_field' => __('Email'), 'email2_field' => sprintf(__('%1$s %2$s'), _n('Email','Emails',1), '2'), 'email3_field' => sprintf(__('%1$s %2$s'), _n('Email','Emails',1), '3'), 'email4_field' => sprintf(__('%1$s %2$s'), _n('Email','Emails',1), '4'), 'realname_field' => __('Surname'), 'firstname_field' => __('First name'), 'phone_field' => __('Phone'), 'phone2_field' => __('Phone 2'), 'mobile_field' => __('Mobile phone'), 'title_field' => _x('person','Title'), 'category_field' => __('Category')); $available_fields = array(); foreach ($fields as $field => $label) { if (isset($authldap->fields[$field]) && ($authldap->fields[$field] != '')) { $available_fields[$field] = $label; } } echo ""; foreach ($available_fields as $field => $label) { if ($field_counter == 0) { echo ""; } echo ""; if ($field_counter == 2) { echo ""; $field_counter = 0; } } if ($field_counter > 0) { while ($field_counter < 2) { echo ""; $field_counter++; } $field_counter = 0; echo ""; } } break; } if (($_SESSION['ldap_import']['authldaps_id'] != NOT_AVAILABLE) && ($_SESSION['ldap_import']['authldaps_id'] > 0)) { if ($_SESSION['ldap_import']['authldaps_id']) { echo ""; } else { echo "<". "td colspan='4' class='center'>".__('No directory selected').""; } } else { echo ""; } echo "
" . __('Search criteria for users') . "
$label"; $field_counter++; echo ""; echo "
"; echo ""; echo "
". __('No directory associated to entity: impossible search')."
"; Html::closeForm(); echo "
"; } static function getNumberOfServers() { global $DB; $query = "SELECT COUNT(*) AS cpt FROM `glpi_authldaps` WHERE `is_active` = '1'"; $result = $DB->query($query); return $DB->result($result,0,'cpt'); } /** * @param $authldap AuthLDAP object **/ static private function buildLdapFilter(AuthLdap $authldap) { //Build search filter $counter = 0; $filter = ''; if (!empty($_SESSION['ldap_import']['criterias']) && ($_SESSION['ldap_import']['interface'] == self::SIMPLE_INTERFACE)) { foreach ($_SESSION['ldap_import']['criterias'] as $criteria => $value) { if ($value != '') { $begin = 0; $end = 0; if (($length = strlen($value)) > 0) { if ($value[0] == '^') { $begin = 1; } if ($value[$length-1] == '$') { $end = 1; } } if ($begin || $end) { // no Toolbox::substr, to be consistent with strlen result $value = substr($value, $begin, $length-$end-$begin); } $counter++; $filter .= '('.$authldap->fields[$criteria].'='.($begin?'':'*').$value.($end?'':'*').')'; } } } else { $filter = "(".$authldap->getField("login_field")."=*)"; } //If time restriction $begin_date = (isset($_SESSION['ldap_import']['begin_date']) && !empty($_SESSION['ldap_import']['begin_date']) ? $_SESSION['ldap_import']['begin_date'] : NULL); $end_date = (isset($_SESSION['ldap_import']['end_date']) && !empty($_SESSION['ldap_import']['end_date']) ? $_SESSION['ldap_import']['end_date'] : NULL); $filter .= self::addTimestampRestrictions($begin_date, $end_date); $ldap_condition = $authldap->getField('condition'); //Add entity filter and filter filled in directory's configuration form return "(&".(isset($_SESSION['ldap_import']['entity_filter']) ?$_SESSION['ldap_import']['entity_filter'] :'')." $filter $ldap_condition)"; } /** * @param $begin_date datetime begin date to search (NULL if not take into account) * @param $end_date datetime end date to search (NULL if not take into account) **/ static function addTimestampRestrictions($begin_date, $end_date) { $condition = ''; //If begin date if (!empty($begin_date)) { $stampvalue = self::date2ldapTimeStamp($begin_date); $condition .= "(modifyTimestamp> = ".$stampvalue.")"; } //If end date if (!empty($end_date)) { $stampvalue = self::date2ldapTimeStamp($end_date); $condition .= "(modifyTimestamp <= ".$stampvalue.")"; } return $condition; } /** * @param $authldap AuthLDAP object **/ static function searchUser(AuthLDAP $authldap) { if (self::connectToServer($authldap->getField('host'), $authldap->getField('port'), $authldap->getField('rootdn'), Toolbox::decrypt($authldap->getField('rootdn_passwd'), GLPIKEY), $authldap->getField('use_tls'), $authldap->getField('deref_option'))) { self::showLdapUsers(); } else { echo "
".__('Unable to connect to the LDAP directory'); } } static function getDefault() { global $DB; foreach ($DB->request('glpi_authldaps', array('is_default' => 1)) as $data) { return $data['id']; } return 0; } function post_updateItem($history=1) { global $DB; if (in_array('is_default',$this->updates) && $this->input["is_default"]==1) { $query = "UPDATE `". $this->getTable()."` SET `is_default` = '0' WHERE `id` <> '".$this->input['id']."'"; $DB->query($query); } } function post_addItem() { global $DB; if (isset($this->fields['is_default']) && $this->fields["is_default"]==1) { $query = "UPDATE ". $this->getTable()." SET `is_default` = '0' WHERE `id` <> '".$this->fields['id']."'"; $DB->query($query); } } function prepareInputForAdd($input) { //If it's the first ldap directory then set it as the default directory if (!self::getNumberOfServers()) { $input['is_default'] = 1; } if (isset($input["rootdn_passwd"]) && !empty($input["rootdn_passwd"])) { $input["rootdn_passwd"] = Toolbox::encrypt(stripslashes($input["rootdn_passwd"]), GLPIKEY); } return $input; } /** * @param $value (default 0) **/ static function dropdownUserDeletedActions($value=0) { $options[0] = __('Preserve'); $options[1] = __('Put in dustbin'); $options[2] = __('Withdraw dynamic authorizations and groups'); $options[3] = __('Disable'); asort($options); return Dropdown::showFromArray('user_deleted_ldap', $options, array('value' => $value)); } /** * Return all the ldap servers where email field is configured * * @return array of LDAP server's ID **/ static function getServersWithImportByEmailActive() { global $DB; $ldaps = array(); // Always get default first $query = "SELECT `id` FROM `glpi_authldaps` WHERE `is_active` = 1 AND (`email1_field` <> '' OR `email2_field` <> '' OR `email3_field` <> '' OR `email4_field` <> '') ORDER BY `is_default` DESC"; foreach ($DB->request($query) as $data) { $ldaps[] = $data['id']; } return $ldaps; } /** * @param $options array **/ static function showDateRestrictionForm($options=array()) { echo ""; echo ""; $enabled = (isset($options['enabled'])?$options['enabled']:false); if (!$enabled) { echo ""; } if ($enabled) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
"; echo "".__('Enable filtering by date').""; echo "
".__('View updated users')."".__('from').""; $begin_date = (isset($_SESSION['ldap_import']['begin_date']) ?$_SESSION['ldap_import']['begin_date'] :''); Html::showDateTimeFormItem("begin_date", $begin_date, 1, true); echo "".__('to').""; $end_date = (isset($_SESSION['ldap_import']['end_date']) ?$_SESSION['ldap_import']['end_date'] :date('Y-m-d H:i:s',time()-DAY_TIMESTAMP)); Html::showDateTimeFormItem("end_date", $end_date, 1, true); echo "
"; echo "".__('Disable filtering by date').""; echo "
"; } function cleanDBonPurge() { Rule::cleanForItemCriteria($this, 'LDAP_SERVER'); } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate && $item->can($item->getField('id'),'r')) { $ong = array(); $ong[1] = __('Main'); // test connexion $ong[2] = _n('User', 'Users', 2); $ong[3] = _n('Group', 'Groups', 2); $ong[4] = __('Entity'); // params for entity config $ong[5] = __('Advanced information'); // params for entity advanced config $ong[6] = _n('Replicate', 'Replicates', 2); return $ong; } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($tabnum) { case 1 : $item->showFormTestLDAP(); break; case 2 : $item->showFormUserConfig(); break; case 3 : $item->showFormGroupsConfig(); break; case 4 : $item->showFormEntityConfig(); break; case 5 : $item->showFormAdvancedConfig(); break; case 6 : $item->showFormReplicatesConfig(); break; } return true; } /** * Get ldap query results and clean them at the same time * * @param link the directory connection * @param result the query results * * @return an array which contains ldap query results **/ static function get_entries_clean($link, $result) { return Toolbox::clean_cross_side_scripting_deep(ldap_get_entries($link, $result)); } /** * Get all replicate servers for a master one * * @param $master_id : master ldap server ID * * @return array of the replicate servers **/ static function getAllReplicateForAMaster($master_id) { global $DB; $replicates = array(); $query = "SELECT `id`, `host`, `port` FROM `glpi_authldapreplicates` WHERE `authldaps_id` = '$master_id'"; $result = $DB->query($query); if ($DB->numrows($result) > 0) { while ($replicate = $DB->fetch_assoc($result)) { $replicates[] = array("id" => $replicate["id"], "host" => $replicate["host"], "port" => $replicate["port"]); } } return $replicates; } /** * * Check if ldap results can be paged or not * This functionnality is available for PHP 5.4 and higer * @since 0.84 * return true if maxPageSize can be used, false otherwise */ static function isLdapPageSizeAvailable($config_ldap, $check_config_value = true) { return ((!$check_config_value || ($check_config_value && $config_ldap->fields['can_support_pagesize'])) && function_exists('ldap_control_paged_result') && function_exists('ldap_control_paged_result_response')); } } ?> glpi-0.84.3+dfsg.1/inc/authldapreplicate.class.php000066400000000000000000000062751226600447100217140ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /** * Class used to manage LDAP replicate config **/ class AuthLdapReplicate extends CommonDBTM { /** * @since version 0.84 **/ static function canCreate() { return Session::haveRight('config', 'w'); } /** * @since version 0.84 * * @return string **/ function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } function prepareInputForAdd($input) { if (isset($input["port"]) && (intval($input["port"]) == 0)) { $input["port"] = 389; } return $input; } function prepareInputForUpdate($input) { if (isset($input["port"]) && (intval($input["port"]) == 0)) { $input["port"] = 389; } return $input; } /** * Form to add a replicate to a ldap server * * @param $target target page for add new replicate * @param $master_id master ldap server ID **/ static function addNewReplicateForm($target, $master_id) { echo ""; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
".__('Add a LDAP directory replica'). "
".__('Name')."".__('Server')."".__('Port')."
"; echo ""; echo "
"; Html::closeForm(); } } ?>glpi-0.84.3+dfsg.1/inc/authmail.class.php000066400000000000000000000255561226600447100200300ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /** * Class used to manage Auth mail config **/ class AuthMail extends CommonDBTM { // From CommonDBTM public $dohistory = true; static function getTypeName($nb=0) { return _n('Mail server', 'Mail servers', $nb); } static function canCreate() { return Session::haveRight('config', 'w'); } static function canView() { return Session::haveRight('config', 'r'); } function prepareInputForUpdate($input) { if (isset($input['mail_server']) && !empty($input['mail_server'])) { $input["connect_string"] = Toolbox::constructMailServerConfig($input); } return $input; } function prepareInputForAdd($input) { if (isset($input['mail_server']) && !empty($input['mail_server'])) { $input["connect_string"] = Toolbox::constructMailServerConfig($input); } return $input; } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('authMail', $ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } function getSearchOptions() { $tab = array(); $tab['common'] = __('Email server'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['datatype'] = 'number'; $tab[2]['massiveaction'] = false; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'host'; $tab[3]['name'] = __('Server'); $tab[3]['datatype'] = 'string'; $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'connect_string'; $tab[4]['name'] = __('Connection string'); $tab[4]['massiveaction'] = false; $tab[4]['datatype'] = 'string'; $tab[6]['table'] = $this->getTable(); $tab[6]['field'] = 'is_active'; $tab[6]['name'] = __('Active'); $tab[6]['datatype'] = 'bool'; $tab[19]['table'] = $this->getTable(); $tab[19]['field'] = 'date_mod'; $tab[19]['name'] = __('Last update'); $tab[19]['datatype'] = 'datetime'; $tab[19]['massiveaction'] = false; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; return $tab; } /** * Print the auth mail form * * @param $ID Integer : ID of the item * @param $options array * * @return Nothing (display) **/ function showForm($ID, $options=array()) { if (!Session::haveRight("config", "w")) { return false; } $spotted = false; if (empty($ID)) { if ($this->getEmpty()) { $spotted = true; } } else { if ($this->getFromDB($ID)) { $spotted = true; } } if (Toolbox::canUseImapPop()) { $options['colspan'] = 1; $this->showTabs($options); $this->showFormHeader($options); echo "" . __('Name') . ""; echo ""; echo ""; echo ""; echo "" . __('Active') . ""; echo ""; Dropdown::showYesNo('is_active', $this->fields['is_active']); echo ""; echo ""; echo "". __('Email domain Name (users email will be login@domain)') .""; echo ""; echo ""; Toolbox::showMailServerConfig($this->fields["connect_string"]); echo "" . __('Comments') . ""; echo ""; echo ""; if ($ID>0) { echo "
"; //TRANS: %s is the datetime of update printf(__('Last update on %s'), Html::convDateTime($this->fields["date_mod"])); } echo ""; $this->showFormButtons($options); $this->addDivForTabs(); } else { echo "
 "; echo ""; echo "
" . __('Email server configuration') . "
"; echo "

".__('Your PHP parser was compiled without the IMAP functions')."

"; echo "

". __('Impossible to use email server as external source of connection')."

"; echo "
"; } } function showFormTestMail() { $ID = $this->getField('id'); if ($this->getFromDB($ID)) { echo ""; echo "fields['connect_string']."\">"; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
" . __('Test connection to email server') . "
" . __('Login') . "
" . __('Password') . "
"; echo "". "
"; Html::closeForm(); } } /** * Is the Mail authentication used ? * * @return boolean **/ static function useAuthMail() { return (countElementsInTable('glpi_authmails', "`is_active`") > 0); } /** * Test a connexion to the IMAP/POP server * * @param $connect_string mail server * @param $login user login * @param $password user password * * @return authentification succeeded ? **/ static function testAuth($connect_string, $login, $password) { $auth = new Auth(); return $auth->connection_imap($connect_string, Toolbox::decodeFromUtf8($login), Toolbox::decodeFromUtf8($password)); } /** * Authentify a user by checking a specific mail server * * @param $auth identification object * @param $login user login * @param $password user password * @param $mail_method mail_method array to use * * @return identification object **/ static function mailAuth($auth, $login, $password, $mail_method) { if (isset($mail_method["connect_string"]) && !empty($mail_method["connect_string"])) { $auth->auth_succeded = $auth->connection_imap($mail_method["connect_string"], Toolbox::decodeFromUtf8($login), Toolbox::decodeFromUtf8($password)); if ($auth->auth_succeded) { $auth->extauth = 1; $auth->user_present = $auth->user->getFromDBbyName(addslashes($login)); $auth->user->getFromIMAP($mail_method, Toolbox::decodeFromUtf8($login)); //Update the authentication method for the current user $auth->user->fields["authtype"] = Auth::MAIL; $auth->user->fields["auths_id"] = $mail_method["id"]; } } return $auth; } /** * Try to authentify a user by checking all the mail server * * @param $auth identification object * @param $login user login * @param $password user password * @param $auths_id auths_id already used for the user (default 0) * @param $break if user is not found in the first directory, * stop searching or try the following ones (true by default) * * @return identification object **/ static function tryMailAuth($auth, $login, $password, $auths_id=0, $break=true) { if ($auths_id <= 0) { foreach ($auth->authtypes["mail"] as $mail_method) { if (!$auth->auth_succeded && $mail_method['is_active']) { $auth = self::mailAuth($auth, $login, $password, $mail_method); } else { if ($break) { break; } } } } else if (array_key_exists($auths_id,$auth->authtypes["mail"])) { //Check if the mail server indicated as the last good one still exists ! $auth = self::mailAuth($auth, $login, $password, $auth->authtypes["mail"][$auths_id]); } return $auth; } function cleanDBonPurge() { Rule::cleanForItemCriteria($this, 'MAIL_SERVER'); } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate && $item->can($item->getField('id'),'r')) { $ong = array(); $ong[1] = __('Main'); // test connexion return $ong; } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($tabnum) { case 1 : $item->showFormTestMail(); break; } return true; } } ?>glpi-0.84.3+dfsg.1/inc/autoload.function.php000066400000000000000000000217311226600447100205430ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } include_once (GLPI_ROOT."/config/based_config.php"); include_once (GLPI_ROOT."/config/define.php"); /** * Is the script launch in Command line ? * * @return boolean **/ function isCommandLine() { return (!isset($_SERVER["SERVER_NAME"])); } /** * Determine if an object name is a plugin one * * @param $classname class name to analyze * * @return false or an object containing plugin name and class name **/ function isPluginItemType($classname) { if (preg_match("/Plugin([A-Z][a-z0-9]+)([A-Z]\w+)/",$classname,$matches)) { $plug = array(); $plug['plugin'] = $matches[1]; $plug['class'] = $matches[2]; return $plug; } // Standard case return false; } /// Translation functions /// since version 0.84 /** * For translation * * @param $str string * @param $domain string domain used (default is glpi, may be plugin name) * * @return translated string **/ function __($str, $domain='glpi') { global $TRANSLATE; $trans = $TRANSLATE->translate($str, $domain); // Wrong call when plural defined if (is_array($trans)) { return $trans[0]; } return $trans; } /** * For translation * * @param $str string * @param $domain string domain used (default is glpi, may be plugin name) * * @return protected string (with htmlentities) **/ function __s($str, $domain='glpi') { return htmlentities(__($str, $domain), ENT_QUOTES, 'UTF-8'); } /** * For translation * * @since version 0.84 * * @param $ctx string context * @param $str string to translate * @param $domain string domain used (default is glpi, may be plugin name) * * @return protected string (with htmlentities) **/ function _sx($ctx, $str, $domain='glpi') { return htmlentities(_x($ctx, $str, $domain), ENT_QUOTES, 'UTF-8'); } /** * to delete echo in translation * * @param $str string * @param $domain string domain used (default is glpi, may be plugin name) * * @return echo string **/ function _e($str, $domain='glpi') { echo __($str, $domain); } /** * For translation * * @param $sing string in singular * @param $plural string in plural * @param $nb to select singular or plurial * @param $domain string domain used (default is glpi, may be plugin name) * * @return translated string **/ function _n($sing, $plural, $nb, $domain='glpi') { global $TRANSLATE; return $TRANSLATE->translatePlural($sing, $plural, $nb, $domain); } /** * For translation * * @since version 0.84 * * @param $sing string in singular * @param $plural string in plural * @param $nb to select singular or plurial * @param $domain string domain used (default is glpi, may be plugin name) * * @return protected string (with htmlentities) **/ function _sn($sing, $plural, $nb, $domain='glpi') { global $TRANSLATE; return htmlentities(_n($sing, $plural, $nb, $domain), ENT_QUOTES, 'UTF-8'); } /** * For context in translation * * @param $ctx string context * @param $str string to translate * @param $domain string domain used (default is glpi, may be plugin name) * * @return string **/ function _x($ctx, $str, $domain='glpi') { // simulate pgettext $msg = $ctx."\004".$str; $trans = __($msg, $domain); if ($trans == $msg) { // No translation return $str; } return $trans; } /** * Echo for context in translation * * @param $ctx string context * @param $str string to translated * @param $domain string domain used (default is glpi, may be plugin name) * * @return string **/ function _ex($ctx, $str, $domain='glpi') { // simulate pgettext $msg = $ctx."\004".$str; $trans = __($msg, $domain); if ($trans == $msg) { // No translation echo $str; } echo $trans; } /** * For context in plural translation * * @param $ctx string context * @param $sing string in singular * @param $plural string in plural * @param $nb to select singular or plurial * @param $domain string domain used (default is glpi, may be plugin name) * * @return string **/ function _nx($ctx, $sing, $plural, $nb, $domain='glpi') { // simulate pgettext $singmsg = $ctx."\004".$sing; $pluralmsg = $ctx."\004".$plural; $trans = _n($singmsg, $pluralmsg, $nb, $domain); if ($trans == $singmsg) { // No translation return $sing; } if ($trans == $pluralmsg) { // No translation return $plural; } return $trans; } /** * To load classes * * @param $classname : class to load **/ function glpi_autoload($classname) { global $DEBUG_AUTOLOAD, $CFG_GLPI; static $notfound = array('xStates' => true, 'xAllAssets' => true, ); // empty classname or non concerted plugin or classname containing dot (leaving GLPI main treee) if (empty($classname) || is_numeric($classname) || (strpos($classname, '.') !== false)) { return false; } $dir = GLPI_ROOT . "/inc/"; if ($plug = isPluginItemType($classname)) { $plugname = strtolower($plug['plugin']); $dir = GLPI_ROOT . "/plugins/$plugname/inc/"; $item = strtolower($plug['class']); // Is the plugin activate ? // Command line usage of GLPI : need to do a real check plugin activation if (isCommandLine()) { $plugin = new Plugin(); if (count($plugin->find("directory='$plugname' AND state=".Plugin::ACTIVATED)) == 0) { // Plugin does not exists or not activated return false; } } else { // Standard use of GLPI if (!in_array($plugname,$_SESSION['glpi_plugins'])) { // Plugin not activated return false; } } } else { // Is ezComponent class ? if (preg_match('/^ezc([A-Z][a-z]+)/',$classname,$matches)) { include_once(GLPI_EZC_BASE); ezcBase::autoload($classname); return true; } // Do not try to load phpcas using GLPI autoload if (preg_match('/^CAS_.*/', $classname)) { return false; } $item = strtolower($classname); } // No errors for missing classes due to implementation if (file_exists("$dir$item.class.php")) { include_once("$dir$item.class.php"); if (isset($_SESSION['glpi_use_mode']) && ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE)) { $DEBUG_AUTOLOAD[] = $classname; } } else if (!isset($notfound["x$classname"])) { // trigger an error to get a backtrace, but only once (use prefix 'x' to handle empty case) // trigger_error("GLPI autoload : file $dir$item.class.php not founded trying to load class '$classname'"); $notfound["x$classname"] = true; } } require_once (GLPI_ZEND_PATH . '/Loader/StandardAutoloader.php'); $option = array(Zend\Loader\StandardAutoloader::LOAD_NS => array('Zend' => GLPI_ZEND_PATH)); $loader = new Zend\Loader\StandardAutoloader($option); $loader->register(); // SimplePie autoloader spl_autoload_register(array(new SimplePie_Autoloader(), 'autoload')); // Use spl autoload to allow stackable autoload. spl_autoload_register('glpi_autoload'); /** * Autoloader class * * @since version 0.84 * * @package SimplePie **/ class SimplePie_Autoloader { /** * Constructor **/ public function __construct() { $this->path = GLPI_SIMPLEPIE_PATH; } /** * Autoloader * * @param string $class The name of the class to attempt to load. **/ public function autoload($class) { // Only load the class if it starts with "SimplePie" if (strpos($class, 'SimplePie') !== 0) { return; } $filename = $this->path . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php'; require_once($filename); } } ?> glpi-0.84.3+dfsg.1/inc/autoupdatesystem.class.php000066400000000000000000000026011226600447100216260ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class AutoUpdateSystem class AutoUpdateSystem extends CommonDropdown { static function getTypeName($nb=0) { return _n('Update Source', 'Update Sources', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/blacklist.class.php000066400000000000000000000160471226600447100201670ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Blacklist class /// @since version 0.84 class Blacklist extends CommonDropdown { // From CommonDBTM public $dohistory = true; const IP = 1; const MAC = 2; const SERIAL = 3; const UUID = 4; const EMAIL = 5; static function canCreate() { return Session::haveRight('config', 'w'); } static function canView() { return Session::haveRight('config', 'r'); } function getAdditionalFields() { return array(array('name' => 'value', 'label' => __('Value'), 'type' => 'text', 'list' => true), array('name' => 'type', 'label' => _n('Type','Types',1), 'type' => '', 'list' => true)); } static function getTypeName($nb=0) { return _n('Blacklist','Blacklists',$nb); } /** * Get search function for the class * * @return array of search option **/ function getSearchOptions() { $tab = parent::getSearchOptions(); $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'value'; $tab[11]['name'] = __('Value'); $tab[11]['datatype'] = 'text'; $tab[12]['table'] = $this->getTable(); $tab[12]['field'] = 'type'; $tab[12]['name'] = _n('Type','Types',1); $tab[12]['searchtype'] = array('equals', 'notequals'); $tab[12]['datatype'] = 'specific'; return $tab; } /** * @see CommonDBTM::prepareInputForAdd() **/ function prepareInputForAdd($input) { if ((!isset($input['name']) || empty($input['name'])) && isset($input['value'])) { $input['name'] = $input['value']; } return $input; } /** * @see CommonDropdown::displaySpecificTypeField() **/ function displaySpecificTypeField($ID, $field=array()) { if ($field['name'] == 'type') { self::dropdownType($field['name'], array('value' => $this->fields['type'])); } } /** * @param $field * @param $values * @param $options array */ static function getSpecificValueToDisplay($field, $values, array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } switch ($field) { case 'type' : $types = self::getTypes(); return $types[$values[$field]]; } return parent::getSpecificValueToDisplay($field, $values, $options); } /** * @since version 0.84 * * @param $field * @param $name (default '') * @param $values (default '') * @param $options array **/ static function getSpecificValueToSelect($field, $name='', $values='', array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'type' : $options['value'] = $values[$field]; return self::dropdownType($name, $options); } return parent::getSpecificValueToSelect($field, $name, $values, $options); } /** * Dropdown of blacklist types * * @param $name select name * @param $options array of possible options: * - value : integer / preselected value (default 0) * - toadd : array / array of specific values to add at the begining * - on_change : string / value to transmit to "onChange" * - display * * @return string id of the select **/ static function dropdownType($name, $options=array()) { $params['value'] = 0; $params['toadd'] = array(); $params['on_change'] = ''; $params['display'] = true; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $params[$key] = $val; } } $items = array(); if (count($params['toadd'])>0) { $items = $params['toadd']; } $items += self::getTypes(); return Dropdown::showFromArray($name, $items, $params); } /** * Get blacklist types * * @return array of types **/ static function getTypes() { $options[self::IP] = __('IP'); $options[self::MAC] = __('MAC'); $options[self::SERIAL] = __('Serial number'); $options[self::UUID] = __('UUID'); $options[self::EMAIL] = _n('Email','Emails',1); return $options; } /** * Get blacklisted items for a specific type * * @param $type type to get (see constants) * * @return array of blacklisted items **/ static function getBlacklistedItems($type) { $datas = getAllDatasFromTable('glpi_blacklists', "type = '$type'"); $items = array(); if (count($datas)) { foreach ($datas as $val) { $items[] = $val['value']; } } return $items; } /** * Get blacklisted IP * * @return array of blacklisted IP **/ static function getIPs() { return self::getBlacklistedItems(self::IP); } /** * Get blacklisted MAC * * @return array of blacklisted MAC **/ static function getMACs() { return self::getBlacklistedItems(self::MAC); } /** * Get blacklisted Serial number * * @return array of blacklisted Serial number **/ static function getSerialNumbers() { return self::getBlacklistedItems(self::SERIAL); } /** * Get blacklisted UUID * * @return array of blacklisted UUID **/ static function getUUIDs() { return self::getBlacklistedItems(self::UUID); } /** * Get blacklisted Emails * * @return array of blacklisted Emails **/ static function getEmails() { return self::getBlacklistedItems(self::EMAIL); } } ?>glpi-0.84.3+dfsg.1/inc/bookmark.class.php000066400000000000000000000553431226600447100200260ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Bookmark class */ class Bookmark extends CommonDBTM { var $auto_message_on_action = false; protected $displaylist = false; const WIDTH = 750; const SEARCH = 1; //SEARCH SYSTEM bookmark const URI = 2; /** * @since version 0.84 * * @return string **/ function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } static function canCreate() { return true; } static function canView() { return true; } function canViewItem() { return ($this->fields['users_id'] == Session::getLoginUserID() || (Session::haveRight('bookmark_public', 'r') && Session::haveAccessToEntity($this->fields['entities_id'], $this->fields['is_recursive']))); } function canUpdateItem() { return ($this->fields['users_id'] == Session::getLoginUserID() || (!$this->fields['is_private'] && Session::haveRight('bookmark_public', 'w') && Session::haveAccessToEntity($this->fields['entities_id']))); } function isNewItem() { /// For tabs management : force isNewItem return false; } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab(__CLASS__, $ong, $options); $ong['no_all_tab'] = true; return $ong; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { switch ($item->getType()) { case __CLASS__: $ong = array(); $ong[1] = __('Personal'); if (Session::haveRight('bookmark_public','r')) { $ong[2] = __('Public'); } return $ong; } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($item->getType()) { case __CLASS__ : $is_private = 1; if ($tabnum == 2) { $is_private = 0; } $item->showBookmarkList($_POST['target'], $is_private); return true; } return false; } function prepareInputForAdd($input) { if (!isset($input['url']) || !isset($input['type'])) { return false; } $taburl = parse_url(rawurldecode($input['url'])); $index = strpos($taburl["path"], "plugins"); if (!$index) { $index = strpos($taburl["path"], "front"); } $input['path'] = Toolbox::substr($taburl["path"], $index, Toolbox::strlen($taburl["path"]) - $index); $query_tab = array(); if (isset($taburl["query"])) { parse_str($taburl["query"], $query_tab); } $input['query'] = Toolbox::append_params($this->prepareQueryToStore($input['type'], $query_tab, $input['itemtype'])); return $input; } function pre_updateInDB() { // Set new user if initial user have been deleted if (($this->fields['users_id'] == 0) && $uid=Session::getLoginUserID()) { $this->input['users_id'] = $uid; $this->fields['users_id'] = $uid; $this->updates[] = "users_id"; } } function post_getEmpty() { $this->fields["users_id"] = Session::getLoginUserID(); $this->fields["is_private"] = 1; $this->fields["is_recursive"] = 0; $this->fields["entities_id"] = $_SESSION["glpiactive_entity"]; } function cleanDBonPurge() { global $DB; $query="DELETE FROM `glpi_bookmarks_users` WHERE `bookmarks_id` = '".$this->fields['id']."'"; $DB->query($query); } /** * Print the bookmark form * * @param $ID integer ID of the item * @param $options array * - target for the Form * - type bookmark type when adding a new bookmark * - url when adding a new bookmark * - itemtype when adding a new bookmark **/ function showForm($ID, $options=array()) { global $CFG_GLPI; $ID = $this->fields['id']; // Only an edit form : always check w right if ($ID > 0) { $this->check($ID,'w'); } else { $this->check(-1,'w'); } echo '
'; echo ""; echo "
"; if (isset($options['itemtype'])) { echo ""; } if (isset($options['type']) && ($options['type'] != 0)) { echo ""; } if (isset($options['url'])) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if ($ID <= 0) { // add echo ""; echo ""; } else { echo ""; echo ""; } echo "
 "; if ($ID > 0) { //TRANS: %1$s is the Itemtype name and $2$d the ID of the item printf(__('%1$s - ID %2$d'), $this->getTypeName(1), $ID); } else { _e('New item'); } echo "
".__('Name').""; Html::autocompletionTextField($this, "name", array('user' => $this->fields["users_id"])); echo "
".__('Type').""; if (Session::haveRight('bookmark_public', 'w')) { Dropdown::showPrivatePublicSwitch($this->fields["is_private"], $this->fields["entities_id"], $this->fields["is_recursive"]); } else { if ($this->fields["is_private"]) { _e('Private'); } else { _e('Public'); } } echo "
"; echo ""; echo "
"; echo ""; echo "
"; echo ""; echo ""; echo "
"; echo ""; echo "
"; Html::closeForm(); } /** * Prepare query to store depending of the type * * @param $type bookmark type * @param $query_tab parameters array * @param $itemtype device type (default 0) * * @return clean query array **/ function prepareQueryToStore($type, $query_tab, $itemtype=0) { switch ($type) { case self::SEARCH : $fields_toclean = array('add_search_count', 'add_search_count2', 'delete_search_count', 'delete_search_count2', 'glpisearchcount', 'glpisearchcount2', 'start', '_glpi_csrf_token'); foreach ($fields_toclean as $field) { if (isset($query_tab[$field])) { unset($query_tab[$field]); } } // Manage glpisearchcount / dclean if needed + store if (isset($_SESSION["glpisearchcount"][$itemtype])) { $query_tab['glpisearchcount'] = $_SESSION["glpisearchcount"][$itemtype]; } else { $query_tab['glpisearchcount'] = 1; } // Manage glpisearchcount2 / dclean if needed + store if (isset($_SESSION["glpisearchcount2"][$itemtype])) { $query_tab['glpisearchcount2'] = $_SESSION["glpisearchcount2"][$itemtype]; } else { $query_tab['glpisearchcount2'] = 0; } break; } return $query_tab; } /** * Prepare query to use depending of the type * * @param $type bookmark type * @param $query_tab parameters array * * @return prepared query array **/ function prepareQueryToUse($type, $query_tab) { switch ($type) { case self::SEARCH : // Check if all datas are valid $opt = Search::getCleanedOptions($this->fields['itemtype']); $query_tab_save = $query_tab; $partial_load = false; // Standard search if (isset($query_tab_save['field']) && count($query_tab_save['field'])) { unset($query_tab['field']); unset($query_tab['searchtype']); unset($query_tab['contains']); unset($query_tab['link']); $new_key = 0; foreach ($query_tab_save['field'] as $key => $val) { if (($val != 'view') && ($val != 'all') && (!isset($opt[$val]) || (isset($opt[$val]['nosearch']) && $opt[$val]['nosearch']))) { $query_tab['glpisearchcount']--; $partial_load = true; } else { $query_tab['field'][$new_key] = $val; if (isset($query_tab_save['searchtype']) && isset($query_tab_save['searchtype'][$key])) { $query_tab['searchtype'][$new_key] = $query_tab_save['searchtype'][$key]; } $query_tab['contains'][$new_key] = $query_tab_save['contains'][$key]; if (isset($query_tab_save['link'][$key])) { $query_tab['link'][$new_key] = $query_tab_save['link'][$key]; } $new_key++; } } } if ($query_tab['glpisearchcount'] == 0) { $query_tab['glpisearchcount'] = 1; } // Meta search if (isset($query_tab_save['itemtype2']) && count($query_tab_save['itemtype2']) && isset($query_tab_save['field2'])) { $meta_ok = Search::getMetaItemtypeAvailable($query_tab['itemtype']); unset($query_tab['field2']); unset($query_tab['searchtype2']); unset($query_tab['contains2']); unset($query_tab['link2']); unset($query_tab['itemtype2']); $new_key = 0; foreach ($query_tab_save['field2'] as $key => $val) { $opt = Search::getCleanedOptions($query_tab_save['itemtype2'][$key]); // Use if meta type is valid and option available if (!in_array($query_tab_save['itemtype2'][$key], $meta_ok) || !isset($opt[$val])) { $query_tab['glpisearchcount2']--; $partial_load = true; } else { $query_tab['field2'][$new_key] = $val; if (isset($query_tab_save['searchtype2']) && isset($query_tab_save['searchtype2'][$key])) { $query_tab['searchtype2'][$new_key] = $query_tab_save['searchtype2'][$key]; } $query_tab['contains2'][$new_key] = $query_tab_save['contains2'][$key]; $query_tab['link2'][$new_key] = $query_tab_save['link2'][$key]; $query_tab['itemtype2'][$new_key] = $query_tab_save['itemtype2'][$key]; $new_key++; } } } // Display message if ($partial_load) { Session::addMessageAfterRedirect(__('Partial load of the bookmark.'), false, ERROR); } // add reset value $query_tab['reset'] = 'reset'; break; } return $query_tab; } /** * load a bookmark * * @param $ID ID of the bookmark * @param $opener boolean load bookmark in opener window ? false -> current window * (true by default) * * @return nothing **/ function load($ID, $opener=true) { global $CFG_GLPI; if ($params = $this->getParameters($ID)) { $url = $CFG_GLPI['root_doc']."/".rawurldecode($this->fields["path"]); $url .= "?".Toolbox::append_params($params); if ($opener) { echo ""; } else { Html::redirect($url); } } } /** * get bookmark parameters * * @param $ID ID of the bookmark * * @return nothing **/ function getParameters($ID) { if ($this->getFromDB($ID)) { $query_tab = array(); parse_str($this->fields["query"], $query_tab); return $this->prepareQueryToUse($this->fields["type"], $query_tab); } return false; } /** * Mark bookmark as default view for the currect user * * @param $ID ID of the bookmark * * @return nothing **/ function mark_default($ID) { global $DB; // Get bookmark / Only search bookmark if ($this->getFromDB($ID) && ($this->fields['type'] == self::SEARCH)) { $dd = new Bookmark_User(); // Is default view for this itemtype already exists ? $query = "SELECT `id` FROM `glpi_bookmarks_users` WHERE `users_id` = '".Session::getLoginUserID()."' AND `itemtype` = '".$this->fields['itemtype']."'"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { // already exists update it $updateID = $DB->result($result, 0, 0); $dd->update(array('id' => $updateID, 'bookmarks_id' => $ID)); } else { $dd->add(array('bookmarks_id' => $ID, 'users_id' => Session::getLoginUserID(), 'itemtype' => $this->fields['itemtype'])); } } } } /** * Mark bookmark as default view for the currect user * * @param $ID ID of the bookmark * * @return nothing **/ function unmark_default($ID) { global $DB; // Get bookmark / Only search bookmark if ($this->getFromDB($ID) && ($this->fields['type'] == self::SEARCH)) { $dd = new Bookmark_User(); // Is default view for this itemtype already exists ? $query = "SELECT `id` FROM `glpi_bookmarks_users` WHERE `users_id` = '".Session::getLoginUserID()."' AND `bookmarks_id` = '$ID' AND `itemtype` = '".$this->fields['itemtype']."'"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { // already exists delete it $deleteID = $DB->result($result,0,0); $dd->delete(array('id' => $deleteID)); } } } } /** * Show bookmarks list * * @param $target target to use for links * @param $is_private show private of public bookmarks ? (default 1) * * @return nothing **/ function showBookmarkList($target, $is_private=1) { global $DB, $CFG_GLPI; if (!$is_private && !static::canView()) { return false; } $query = "SELECT `".$this->getTable()."`.*, `glpi_bookmarks_users`.`id` AS IS_DEFAULT FROM `".$this->getTable()."` LEFT JOIN `glpi_bookmarks_users` ON (`".$this->getTable()."`.`itemtype` = `glpi_bookmarks_users`.`itemtype` AND `".$this->getTable()."`.`id` = `glpi_bookmarks_users`.`bookmarks_id`) WHERE "; if ($is_private) { $query .= "(`".$this->getTable()."`.`is_private`='1' AND `".$this->getTable()."`.`users_id`='".Session::getLoginUserID()."') "; } else { $query .= "(`".$this->getTable()."`.`is_private`='0' ". getEntitiesRestrictRequest("AND", $this->getTable(), "", "", true) . ")"; } $query .= " ORDER BY `itemtype`, `name`"; if ($result = $DB->query($query)) { $rand = mt_rand(); $numrows = $DB->numrows($result); Html::openMassiveActionsForm('mass'.__CLASS__.$rand); echo "
"; $massiveactionparams = array('num_displayed' => $numrows, 'width' => 600, 'height' => 200, 'rand' => $rand); // Html::showMassiveActions(__CLASS__, $massiveactionparams); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if ($numrows) { $current_type = -1; $current_type_name = NOT_AVAILABLE; while ($this->fields = $DB->fetch_assoc($result)) { if ($current_type != $this->fields['itemtype']) { $current_type = $this->fields['itemtype']; $current_type_name = NOT_AVAILABLE; if ($current_type == "AllAssets") { $current_type_name = __('Global'); } else if ($item = getItemForItemtype($current_type)) { $current_type_name = $item->getTypeName(1); } } $canedit = $this->can($this->fields["id"],"w"); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
".Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand)."".__('Bookmarks')." ".__('Default view')."
"; if ($canedit) { Html::showMassiveActionCheckBox(__CLASS__, $this->fields["id"]); } else { echo " "; } echo "$current_type_name"; if ($canedit) { echo "fields["id"]."\" alt='".__s('Update')."'>". $this->fields["name"].""; } else { echo $this->fields["name"]; } echo "fields["id"]."\" class='vsubmit'>".__('Load').""; echo ""; if ($this->fields['type'] == self::SEARCH) { if (is_null($this->fields['IS_DEFAULT'])) { echo "fields["id"]."\" alt=\"". __s('Not default search')."\" itle=\"".__s('Not default search')."\">". ""; } else { echo "fields["id"]."\" alt=\"". __s('Default search')."\" title=\"".__s('Default search')."\">". ""; } } echo "
"; if ($is_private || Session::haveRight('bookmark_public', 'w')) { $massiveactionparams['ontop'] = false; $massiveactionparams['forcecreate'] = true; Html::showMassiveActions(__CLASS__, $massiveactionparams); } } else { echo ""; _e('You have not recorded any bookmarks yet'); echo ""; } Html::closeForm(); } } /** * Display bookmark buttons * * @param $type bookmark type to use * @param $itemtype device type of item where is the bookmark (default 0) **/ static function showSaveButton($type, $itemtype=0) { global $CFG_GLPI; echo " "; echo "\"".__s('Save"; echo ""; } } ?> glpi-0.84.3+dfsg.1/inc/bookmark_user.class.php000066400000000000000000000024351226600447100210560ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class Bookmark_User extends CommonDBTM { var $auto_message_on_action = false; } ?> glpi-0.84.3+dfsg.1/inc/budget.class.php000066400000000000000000000600341226600447100174640ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Budget class */ class Budget extends CommonDropdown{ // From CommonDBTM public $dohistory = true; static function getTypeName($nb=0) { return _n('Budget', 'Budgets', $nb); } static function canCreate() { return Session::haveRight('budget', 'w'); } static function canView() { return Session::haveRight('budget', 'r'); } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab(__CLASS__,$ong, $options); $this->addStandardTab('Document_Item',$ong, $options); $this->addStandardTab('Link',$ong, $options); $this->addStandardTab('Note',$ong, $options); $this->addStandardTab('Log',$ong, $options); return $ong; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { switch ($item->getType()) { case __CLASS__ : return array (1 => __('Main'), 2 => _n('Item', 'Items', 2)); } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType() == __CLASS__) { switch ($tabnum) { case 1 : $item->showValuesByEntity(); break; case 2 : $item->showItems(); break; } } return true; } /** * Print the contact form * * @param $ID integer ID of the item * @param $options array of possible options: * - target for the Form * - withtemplate : template or basic item * * @return Nothing (display) **/ function showForm($ID, $options=array()) { $rowspan = 4; if ($ID > 0) { $rowspan++; } $this->initForm($ID, $options); $this->showTabs($options); $this->showFormHeader($options); echo ""; echo "".__('Name').""; echo ""; Html::autocompletionTextField($this, "name"); echo ""; echo "".__('Comments').""; echo "". "". ""; echo ""; echo "".__('Value').""; echo ""; echo ""; echo "".__('Start date').""; echo ""; Html::showDateFormItem("begin_date", $this->fields["begin_date"]); echo ""; echo ""; echo "".__('End date').""; echo ""; Html::showDateFormItem("end_date", $this->fields["end_date"]); echo ""; if ($ID > 0) { echo ""; echo "".__('Last update').""; echo ""; echo ($this->fields["date_mod"]? Html::convDateTime($this->fields["date_mod"]) : __('Never')); echo ""; } $this->showFormButtons($options); $this->addDivForTabs(); return true; } function prepareInputForAdd($input) { if (isset($input["id"]) && ($input["id"] > 0)) { $input["_oldID"] = $input["id"]; } unset($input['id']); unset($input['withtemplate']); return $input; } function post_addItem() { global $DB; // Manage add from template if (isset($this->input["_oldID"])) { // ADD Documents Document_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); } } function getSearchOptions() { $tab = array(); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab[19]['table'] = $this->getTable(); $tab[19]['field'] = 'date_mod'; $tab[19]['name'] = __('Last update'); $tab[19]['datatype'] = 'datetime'; $tab[19]['massiveaction'] = false; $tab[5]['table'] = $this->getTable(); $tab[5]['field'] = 'begin_date'; $tab[5]['name'] = __('Start date'); $tab[5]['datatype'] = 'date'; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'end_date'; $tab[3]['name'] = __('End date'); $tab[3]['datatype'] = 'date'; $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'value'; $tab[4]['name'] = __('Value'); $tab[4]['datatype'] = 'decimal'; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab[80]['table'] = 'glpi_entities'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = __('Entity'); $tab[80]['massiveaction'] = false; $tab[80]['datatype'] = 'dropdown'; $tab[86]['table'] = $this->getTable(); $tab[86]['field'] = 'is_recursive'; $tab[86]['name'] = __('Child entities'); $tab[86]['datatype'] = 'bool'; $tab[90]['table'] = $this->getTable(); $tab[90]['field'] = 'notepad'; $tab[90]['name'] = __('Notes'); $tab[90]['massiveaction'] = false; $tab[90]['datatype'] = 'text'; return $tab; } /** * Print the HTML array of Items on a budget * * @return Nothing (display) **/ function showItems() { global $DB; $budgets_id = $this->fields['id']; if (!$this->can($budgets_id,'r')) { return false; } $query = "SELECT DISTINCT `itemtype` FROM `glpi_infocoms` WHERE `budgets_id` = '$budgets_id' AND itemtype NOT IN ('ConsumableItem', 'CartridgeItem', 'Software') ORDER BY `itemtype`"; $result = $DB->query($query); $number = $DB->numrows($result); echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $num = 0; $itemtypes = array(); for ($i = 0; $i < $number ; $i++) { $itemtypes[] = $DB->result($result, $i, "itemtype"); } $itemtypes[] = 'Contract'; $itemtypes[] = 'Ticket'; foreach ($itemtypes as $itemtype) { if (!($item = getItemForItemtype($itemtype))) { continue; } if ($item->canView()) { switch ($itemtype) { case 'Contract' : $query = "SELECT `".$item->getTable()."`.`id`, `".$item->getTable()."`.`entities_id`, SUM(`glpi_contractcosts`.`cost`) as value FROM `glpi_contractcosts` INNER JOIN `".$item->getTable()."` ON (`".$item->getTable()."`.`id` = `glpi_contractcosts`.`contracts_id`) WHERE `glpi_contractcosts`.`budgets_id` = '$budgets_id' ". getEntitiesRestrictRequest(" AND", $item->getTable())." AND NOT `".$item->getTable()."`.`is_template` GROUP BY `".$item->getTable()."`.`id`, `".$item->getTable()."`.`entities_id` ORDER BY `".$item->getTable()."`.`entities_id`, `".$item->getTable()."`.`name`"; break; case 'Ticket' : $query = "SELECT `".$item->getTable()."`.`id`, `".$item->getTable()."`.`entities_id`, SUM(`glpi_ticketcosts`.`actiontime`*`glpi_ticketcosts`.`cost_time`/".HOUR_TIMESTAMP." + `glpi_ticketcosts`.`cost_fixed` + `glpi_ticketcosts`.`cost_material`) as value FROM `glpi_ticketcosts` INNER JOIN `".$item->getTable()."` ON (`".$item->getTable()."`.`id` = `glpi_ticketcosts`.`tickets_id`) WHERE `glpi_ticketcosts`.`budgets_id` = '$budgets_id' ". getEntitiesRestrictRequest(" AND", $item->getTable())." GROUP BY `".$item->getTable()."`.`id`, `".$item->getTable()."`.`entities_id` ORDER BY `".$item->getTable()."`.`entities_id`, `".$item->getTable()."`.`name`"; break; case 'Cartridge' : $query = "SELECT `".$item->getTable()."`.*, `glpi_cartridgeitems`.`name`, `glpi_infocoms`.`value` FROM `glpi_infocoms` INNER JOIN `".$item->getTable()."` ON (`".$item->getTable()."`.`id` = `glpi_infocoms`.`items_id`) INNER JOIN `glpi_cartridgeitems` ON (`".$item->getTable()."`.`cartridgeitems_id` = `glpi_cartridgeitems`.`id`) WHERE `glpi_infocoms`.`itemtype`='$itemtype' AND `glpi_infocoms`.`budgets_id` = '$budgets_id' ". getEntitiesRestrictRequest(" AND", $item->getTable())." ORDER BY `entities_id`, `glpi_cartridgeitems`.`name`"; break; case 'Consumable' : $query = "SELECT `".$item->getTable()."`.*, `glpi_consumableitems`.`name`, `glpi_infocoms`.`value` FROM `glpi_infocoms` INNER JOIN `".$item->getTable()."` ON (`".$item->getTable()."`.`id` = `glpi_infocoms`.`items_id`) INNER JOIN `glpi_consumableitems` ON (`".$item->getTable()."`.`consumableitems_id` = `glpi_consumableitems`.`id`) WHERE `glpi_infocoms`.`itemtype` = '$itemtype' AND `glpi_infocoms`.`budgets_id` = '$budgets_id' ". getEntitiesRestrictRequest(" AND", $item->getTable())." ORDER BY `entities_id`, `glpi_consumableitems`.`name`"; break; default : $query = "SELECT `".$item->getTable()."`.*, `glpi_infocoms`.`value` FROM `glpi_infocoms` INNER JOIN `".$item->getTable()."` ON (`".$item->getTable()."`.`id` = `glpi_infocoms`.`items_id`) WHERE `glpi_infocoms`.`itemtype` = '$itemtype' AND `glpi_infocoms`.`budgets_id` = '$budgets_id' ". getEntitiesRestrictRequest(" AND", $item->getTable())." ".($item->maybeTemplate()?" AND NOT `".$item->getTable()."`.`is_template`":'')." ORDER BY `".$item->getTable()."`.`entities_id`, `".$item->getTable()."`.`name`"; break; } if ($result_linked = $DB->query($query)) { $nb = $DB->numrows($result_linked); if ($nb > $_SESSION['glpilist_limit']) { echo ""; $name = $item->getTypeName($nb); //TRANS: %1$s is a name, %2$s is a number echo ""; echo ""; echo ""; } else if ($nb) { for ($prem=true ; $data=$DB->fetch_assoc($result_linked) ; $prem=false) { $name = NOT_AVAILABLE; if ($item->getFromDB($data["id"])) { $name = $item->getLink(array('additional' => true)); } echo ""; if ($prem) { $typename = $item->getTypeName($nb); echo ""; } echo ""; echo ""; echo ""; echo ""; } } $num += $nb; } } } if ($num>0) { echo ""; echo ""; echo " "; } echo "
"; Html::printPagerForm(); echo ""; if ($DB->numrows($result) == 0) { _e('No associated item'); } else { echo _n('Associated item', 'Associated items', $DB->numrows($result)); } echo "
".__('Type')."".__('Entity')."".__('Name')."".__('Serial number')."".__('Inventory number')."".__('Value')."
".sprintf(__('%1$s: %2$s'), $name, $nb).""; echo "". __('Device list')."---". "
". ($nb>1 ? sprintf(__('%1$s: %2$s'), $typename, $nb) : $typename)."".Dropdown::getDropdownName("glpi_entities", $data["entities_id"]); echo "".$name."".(isset($data["serial"])? "".$data["serial"]."" :"-"); echo "". (isset($data["otherserial"])? "".$data["otherserial"]."" :"-")."". (isset($data["value"]) ? "".Html::formatNumber($data["value"], true)."" :"-"); echo "
".sprintf(__('%1$s = %2$s'), __('Total'), $num)." 
"; } /** * Print the HTML array of value consumed for a budget * * @return Nothing (display) **/ function showValuesByEntity() { global $DB; $budgets_id = $this->fields['id']; if (!$this->can($budgets_id, 'r')) { return false; } // Type for which infocom are only template $ignore = array('CartridgeItem', 'ConsumableItem', 'Software'); $query = "SELECT DISTINCT `itemtype` FROM `glpi_infocoms` WHERE `budgets_id` = '$budgets_id' AND `itemtype` NOT IN ('".implode("','",$ignore)."')". getEntitiesRestrictRequest(" AND", 'glpi_infocoms', "entities_id")." GROUP BY `itemtype`"; $result = $DB->query($query); $total = 0; $totalbytypes = array(); $itemtypes = array(); $entities_values = array(); $entitiestype_values = array(); $found_types = array(); if ($DB->numrows($result)) { while ($types = $DB->fetch_assoc($result)) { $itemtypes[] = $types['itemtype']; } } $itemtypes[] = 'Contract'; $itemtypes[] = 'Ticket'; foreach ($itemtypes as $itemtype) { if (!($item = getItemForItemtype($itemtype))) { continue; } $table = getTableForItemType($itemtype); switch ($itemtype) { case 'Contract' : $query_infos = "SELECT SUM(`glpi_contractcosts`.`cost`) AS `sumvalue`, `$table`.`entities_id` FROM `glpi_contractcosts` INNER JOIN `$table` ON (`glpi_contractcosts`.`contracts_id` = `$table`.`id`) WHERE `glpi_contractcosts`.`budgets_id` = '$budgets_id' ". getEntitiesRestrictRequest(" AND", $table, "entities_id")." AND `$table`.`is_template` = '0' GROUP BY `$table`.`entities_id`"; break; case 'Ticket' : $query_infos = "SELECT SUM(`glpi_ticketcosts`.`actiontime`*`glpi_ticketcosts`.`cost_time`/".HOUR_TIMESTAMP." + `glpi_ticketcosts`.`cost_fixed` + `glpi_ticketcosts`.`cost_material`) AS `sumvalue`, `$table`.`entities_id` FROM `glpi_ticketcosts` INNER JOIN `$table` ON (`glpi_ticketcosts`.`tickets_id` = `$table`.`id`) WHERE `glpi_ticketcosts`.`budgets_id` = '$budgets_id' ". getEntitiesRestrictRequest(" AND", $table, "entities_id")." GROUP BY `$table`.`entities_id`"; break; default : $query_infos = "SELECT SUM(`glpi_infocoms`.`value`) AS `sumvalue`, `$table`.`entities_id` FROM `$table` INNER JOIN `glpi_infocoms` ON (`glpi_infocoms`.`items_id` = `$table`.`id` AND `glpi_infocoms`.`itemtype` = '$itemtype') WHERE `glpi_infocoms`.`budgets_id` = '$budgets_id' ". getEntitiesRestrictRequest(" AND", $table, "entities_id"); if ($item->maybeTemplate()) { $query_infos .= " AND `$table`.`is_template` = '0' "; } $query_infos .= "GROUP BY `$table`.`entities_id`"; break; } if ($result_infos = $DB->query($query_infos)) { if ($DB->numrows($result_infos)) { $found_types[$itemtype] = $item->getTypeName(1); $totalbytypes[$itemtype] = 0; //Store, for each entity, the budget spent while ($values = $DB->fetch_assoc($result_infos)) { if (!isset($entities_values[$values['entities_id']])) { $entities_values[$values['entities_id']] = 0; } if (!isset($entitiestype_values[$values['entities_id']][$itemtype])) { $entitiestype_values[$values['entities_id']][$itemtype] = 0; } $entities_values[$values['entities_id']] += $values['sumvalue']; $entitiestype_values[$values['entities_id']][$itemtype] += $values['sumvalue']; $total += $values['sumvalue']; $totalbytypes[$itemtype] += $values['sumvalue']; } } } } $budget = new self(); $budget->getFromDB($budgets_id); $colspan = count($found_types)+2; echo "
"; echo ""; echo ""; if (count($found_types)) { foreach ($found_types as $type => $typename) { echo ""; } } echo ""; echo ""; // get all entities ordered by names $allentities = getAllDatasFromTable('glpi_entities','',true, 'completename'); foreach ($allentities as $entity => $data) { if (isset($entities_values[$entity])) { echo ""; echo ""; if (count($found_types)) { foreach ($found_types as $type => $typename) { echo ""; } } echo ""; echo ""; } } if (count($found_types)) { echo ""; echo ""; foreach ($found_types as $type => $typename) { echo ""; } echo ""; echo ""; } echo ""; echo ""; echo ""; echo ""; if ($_SESSION['glpiactive_entity'] == $budget->fields['entities_id']) { echo ""; echo ""; echo ""; } echo "
".__('Total spent on the budget')."
".__('Entity')."$typename".__('Total')."
".Dropdown::getDropdownName('glpi_entities', $entity).""; $typevalue = 0; if (isset($entitiestype_values[$entity][$type])) { $typevalue = $entitiestype_values[$entity][$type]; } echo Html::formatNumber($typevalue); echo "".Html::formatNumber($entities_values[$entity])."
".__('Total').""; echo Html::formatNumber($totalbytypes[$type]); echo "".Html::formatNumber($total)."

".__('Total spent on the budget')."".Html::formatNumber($total)."
".__('Total remaining on the budget'). "".Html::formatNumber($budget->fields['value'] - $total). "
"; } } ?>glpi-0.84.3+dfsg.1/inc/calendar.class.php000077500000000000000000000403331226600447100177660ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Calendar class Calendar extends CommonDropdown { // From CommonDBTM var $dohistory = true; static protected $forward_entity_to = array('CalendarSegment'); /** * @since version 0.84 **/ function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'merge'; return $forbidden; } static function getTypeName($nb=0) { return _n('Calendar','Calendars',$nb); } static function canCreate() { return Session::haveRight('calendar', 'w'); } static function canView() { return Session::haveRight('calendar', 'r'); } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('CalendarSegment', $ong, $options); $this->addStandardTab('Calendar_Holiday', $ong, $options); return $ong; } /** * @see CommonDBTM::getSpecificMassiveActions() **/ function getSpecificMassiveActions($checkitem=NULL) { $isadmin = static::canUpdate(); $actions = parent::getSpecificMassiveActions($checkitem); if ($isadmin) { $actions['duplicate'] = _x('button', 'Duplicate'); } return $actions; } /** * @see CommonDBTM::showSpecificMassiveActionsParameters() **/ function showSpecificMassiveActionsParameters($input=array()) { switch ($input['action']) { case "duplicate" : Entity::dropdown(); echo "

"; return true; default : return parent::showSpecificMassiveActionsParameters($input); } return false; } /** * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "duplicate" : // For calendar duplicate in another entity if (method_exists($this,'duplicate')) { $options = array(); if ($this->isEntityAssign()) { $options = array('entities_id' => $input['entities_id']); } foreach ($input["item"] as $key => $val) { if ($val == 1) { if ($this->getFromDB($key)) { if (!$this->isEntityAssign() || ($input['entities_id'] != $this->getEntityID())) { if ($this->can(-1,'w',$options)) { if ($this->duplicate($options)) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } else { $res['ko']++; } } else { $res['ko']++; } } } } break; default : return parent::doSpecificMassiveActions($input); } return $res; } /** Clone a calendar to another entity : name is updated * * @param $options array of new values to set **/ function duplicate ($options=array()) { if (is_array($options) && count($options)) { foreach ($options as $key => $val) { if (isset($this->fields[$key])) { $this->fields[$key] = $val; } } } $input = $this->fields; $oldID = $input['id']; unset($input['id']); if ($newID = $this->add($input)) { Calendar_Holiday::cloneCalendar($oldID, $newID); CalendarSegment::cloneCalendar($oldID, $newID); $this->updateDurationCache($newID); return true; } return false; } function cleanDBonPurge() { global $DB; $query2 = "DELETE FROM `glpi_calendars_holidays` WHERE `calendars_id` = '".$this->fields['id']."'"; $DB->query($query2); $query2 = "DELETE FROM `glpi_calendarsegments` WHERE `calendars_id` = '".$this->fields['id']."'"; $DB->query($query2); } /** * is an holiday day ? * * @param $date date of the day to check * * @return boolean **/ function isHoliday($date) { global $DB; $query = "SELECT COUNT(*) AS cpt FROM `glpi_calendars_holidays` INNER JOIN `glpi_holidays` ON (`glpi_calendars_holidays`.`holidays_id` = `glpi_holidays`.`id`) WHERE `glpi_calendars_holidays`.`calendars_id` = '".$this->fields['id']."' AND (('$date' <= `glpi_holidays`.`end_date` AND '$date' >= `glpi_holidays`.`begin_date`) OR (`glpi_holidays`.`is_perpetual` = 1 AND MONTH(`end_date`)*100 + DAY(`end_date`) >= ".date('nd',strtotime($date))." AND MONTH(`begin_date`)*100 + DAY(`begin_date`) <= ".date('nd',strtotime($date))." ) )"; if ($result=$DB->query($query)) { return $DB->result($result, 0, 'cpt'); } return false; } /** * Get active time between to date time for the active calendar * * @param $start datetime begin * @param $end datetime end * @param $work_in_days boolean force working in days (false by default) * * @return timestamp of delay **/ function getActiveTimeBetween($start, $end, $work_in_days=false) { if (!isset($this->fields['id'])) { return false; } if ($end < $start) { return 0; } $timestart = strtotime($start); $timeend = strtotime($end); $datestart = date('Y-m-d',$timestart); $dateend = date('Y-m-d',$timeend); // Need to finish at the closing day : set hour to midnight : /// Before PHP 5.3 need to be 23:59:59 and not 24:00:00 $timerealend = strtotime($dateend.' 23:59:59'); $activetime = 0; if ($work_in_days) { $activetime = $timeend-$timestart; } else { $cache_duration = $this->getDurationsCache(); for ($actualtime=$timestart ; $actualtime<=$timerealend ; $actualtime+=DAY_TIMESTAMP) { $actualdate = date('Y-m-d',$actualtime); if (!$this->isHoliday($actualdate)) { $beginhour = '00:00:00'; /// Before PHP 5.3 need to be 23:59:59 and not 24:00:00 $endhour = '23:59:59'; $dayofweek = self::getDayNumberInWeek($actualtime); $timeoftheday = 0; if ($actualdate == $datestart) { // First day : cannot use cache $beginhour = date('H:i:s',$timestart); } if ($actualdate == $dateend) { // Last day : cannot use cache $endhour = date('H:i:s',$timeend); } if ((($actualdate == $datestart) || ($actualdate == $dateend)) && ($cache_duration[$dayofweek] > 0)) { $timeoftheday = CalendarSegment::getActiveTimeBetween($this->fields['id'], $dayofweek, $beginhour, $endhour); } else { $timeoftheday = $cache_duration[$dayofweek]; } // echo "time of the day = $timeoftheday ".Html::timestampToString($timeoftheday).'
'; $activetime += $timeoftheday; // echo "cumulate time = $activetime ".Html::timestampToString($activetime).'
'; } else { // echo "$actualdate is an holiday
"; } } } return $activetime; } /** * Is the time passed is in a working day * * @since version 0.84 * * @param $time time time to check * * @return boolean **/ function isAWorkingDay($time) { $cache_duration = $this->getDurationsCache(); $dayofweek = self::getDayNumberInWeek($time); $date = date('Y-m-d',$time); return (($cache_duration[$dayofweek] > 0) && !$this->isHoliday($date)); } /** * Add a delay to a date using the active calendar * * if delay >= DAY_TIMESTAMP : work in days * else work in minutes * * @param $start datetime begin * @param $delay timestamp delay to add * @param $work_in_days boolean force working in days (false by default) * * @return end date **/ function computeEndDate($start, $delay, $work_in_days=false) { if (!isset($this->fields['id'])) { return false; } $actualtime = strtotime($start); $timestart = strtotime($start); $datestart = date('Y-m-d',$timestart); if ($work_in_days) { // only based on days $cache_duration = $this->getDurationsCache(); // Compute Real starting time // If day is an holiday must start on the begin of next working day $actualdate = date('Y-m-d',$actualtime); $dayofweek = self::getDayNumberInWeek($actualtime); if ($this->isHoliday($actualdate) || ($cache_duration[$dayofweek] == 0)) { while ($this->isHoliday($actualdate) || ($cache_duration[$dayofweek] == 0)) { $actualtime += DAY_TIMESTAMP; $actualdate = date('Y-m-d',$actualtime); $dayofweek = self::getDayNumberInWeek($actualtime); } $firstworkhour = CalendarSegment::getFirstWorkingHour($this->fields['id'], $dayofweek); $actualtime = strtotime($actualdate.' '.$firstworkhour); } while ($delay > 0) { // Begin next day : do not take into account first day : must finish to a working day $actualtime += DAY_TIMESTAMP; $actualdate = date('Y-m-d',$actualtime); $dayofweek = self::getDayNumberInWeek($actualtime); if (!$this->isHoliday($actualdate) && ($cache_duration[$dayofweek] > 0)) { $delay -= DAY_TIMESTAMP; } if ($delay < 0) { // delay done : if < 0 delete hours $actualtime += $delay; } } // If > last working hour set last working hour $dayofweek = self::getDayNumberInWeek($actualtime); $lastworkinghour = CalendarSegment::getLastWorkingHour($this->fields['id'], $dayofweek); if ($lastworkinghour< date('H:i:s', $actualtime)) { $actualtime = strtotime(date('Y-m-d',$actualtime).' '.$lastworkinghour); } return date('Y-m-d H:i:s', $actualtime); } // else // based on working hours $cache_duration = $this->getDurationsCache(); // Only if segments exists if (countElementsInTable('glpi_calendarsegments', "`calendars_id` = '".$this->fields['id']."'")) { while ($delay >= 0) { $actualdate = date('Y-m-d',$actualtime); if (!$this->isHoliday($actualdate)) { $dayofweek = self::getDayNumberInWeek($actualtime); $beginhour = '00:00:00'; /// Before PHP 5.3 need to be 23:59:59 and not 24:00:00 $endhour = '23:59:59'; if ($actualdate == $datestart) { // First day cannot use cache $beginhour = date('H:i:s',$timestart); $timeoftheday = CalendarSegment::getActiveTimeBetween($this->fields['id'], $dayofweek, $beginhour, $endhour); } else { $timeoftheday = $cache_duration[$dayofweek]; } // Day do not complete the delay : pass to next day if ($timeoftheday<$delay) { $actualtime += DAY_TIMESTAMP; $delay -= $timeoftheday; } else { // End of the delay in the day : get hours with this delay $beginhour = '00:00:00'; /// Before PHP 5.3 need to be 23:59:59 and not 24:00:00 $endhour = '23:59:59'; if ($actualdate == $datestart) { $beginhour = date('H:i:s',$timestart); } $endhour = CalendarSegment::addDelayInDay($this->fields['id'], $dayofweek, $beginhour, $delay); return $actualdate.' '.$endhour; } } else { // Holiday : pass to next day $actualtime += DAY_TIMESTAMP; } } } return false; } /** * Get days durations including all segments of the current calendar * * @return end date **/ function getDurationsCache() { if (!isset($this->fields['id'])) { return false; } $cache_duration = importArrayFromDB($this->fields['cache_duration']); // Invalid cache duration : recompute it if (!isset($cache_duration[0])) { $this->updateDurationCache($this->fields['id']); $cache_duration = importArrayFromDB($this->fields['cache_duration']); } return $cache_duration; } /** * Get days durations including all segments of the current calendar * * @return end date **/ function getDaysDurations() { if (!isset($this->fields['id'])) { return false; } $results = array(); for ($i=0 ; $i<7 ; $i++) { /// Before PHP 5.3 need to be 23:59:59 and not 24:00:00 $results[$i] = CalendarSegment::getActiveTimeBetween($this->fields['id'], $i, '00:00:00', '23:59:59'); } return $results; } /** * Update the calendar cache * * @param $calendars_id integer calendar ID **/ function updateDurationCache($calendars_id) { if ($this->getFromDB($calendars_id)) { $input['id'] = $calendars_id; $input['cache_duration'] = exportArrayToDB($this->getDaysDurations()); return $this->update($input); } return false; } /** * Get day number (in week) for a date * * @param $date date **/ static function getDayNumberInWeek($date) { return date('w', $date); } } ?> glpi-0.84.3+dfsg.1/inc/calendar_holiday.class.php000077500000000000000000000161151226600447100215000ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class Calendar_Holiday extends CommonDBRelation { public $auto_message_on_action = false; // From CommonDBRelation static public $itemtype_1 = 'Calendar'; static public $items_id_1 = 'calendars_id'; static public $itemtype_2 = 'Holiday'; static public $items_id_2 = 'holidays_id'; static public $checkItem_2_Rights = self::DONT_CHECK_ITEM_RIGHTS; /** * @since version 0.84 **/ function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } /** * Show holidays for a calendar * * @param $calendar Calendar object **/ static function showForCalendar(Calendar $calendar) { global $DB, $CFG_GLPI; $ID = $calendar->getField('id'); if (!$calendar->can($ID,'r')) { return false; } $canedit = $calendar->can($ID,'w'); $rand = mt_rand(); $query = "SELECT DISTINCT `glpi_calendars_holidays`.`id` AS linkID, `glpi_holidays`.* FROM `glpi_calendars_holidays` LEFT JOIN `glpi_holidays` ON (`glpi_calendars_holidays`.`holidays_id` = `glpi_holidays`.`id`) WHERE `glpi_calendars_holidays`.`calendars_id` = '$ID' ORDER BY `glpi_holidays`.`name`"; $result = $DB->query($query); $holidays = array(); $used = array(); if ($numrows = $DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $holidays[$data['id']] = $data; $used[$data['id']] = $data['id']; } } if ($canedit) { echo "
"; echo ""; echo ""; echo ""; echo ""; echo "
".__('Add a close time')."
"; echo ""; Holiday::dropdown(array('used' => $used, 'entity' => $calendar->fields["entities_id"])); echo ""; echo ""; echo "
"; Html::closeForm(); echo "
"; } echo "
"; if ($canedit && $numrows) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $paramsma = array('num_displayed' => $numrows); Html::showMassiveActions(__CLASS__, $paramsma); } echo ""; echo ""; if ($canedit && $numrows) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; $used = array(); if ($numrows) { Session::initNavigateListItems('Holiday', //TRANS : %1$s is the itemtype name, %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), Calendar::getTypeName(1), $calendar->fields["name"])); foreach ($holidays as $data) { Session::addToNavigateListItems('Holiday', $data["id"]); echo ""; if ($canedit) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; } } echo "
"; Html::checkAllAsCheckbox('mass'.__CLASS__.$rand); echo "".__('Name')."".__('Start')."".__('End')."".__('Recurrent')."
"; Html::showMassiveActionCheckBox(__CLASS__, $data["linkID"]); echo "". $data["name"]."".Html::convDate($data["begin_date"])."".Html::convDate($data["end_date"])."".Dropdown::getYesNo($data["is_perpetual"])."
"; if ($canedit && $numrows) { $paramsma['ontop'] = false; Html::showMassiveActions(__CLASS__, $paramsma); Html::closeForm(); } echo "
"; } /** * Duplicate all holidays from a calendar to his clone * * @param $oldid * @param $newid **/ static function cloneCalendar($oldid, $newid) { global $DB; $query = "SELECT * FROM `glpi_calendars_holidays` WHERE `calendars_id` = '$oldid'"; foreach ($DB->request($query) as $data) { $ch = new self(); unset($data['id']); $data['calendars_id'] = $newid; $data['_no_history'] = true; $ch->add($data); } } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { switch ($item->getType()) { case 'Calendar' : if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(_n('Close time','Close times', 2), countElementsInTable($this->getTable(), "calendars_id = '".$item->getID()."'")); } return _n('Close time','Close times', 2); } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType()=='Calendar') { self::showForCalendar($item); } return true; } } ?>glpi-0.84.3+dfsg.1/inc/calendarsegment.class.php000077500000000000000000000305651226600447100213570ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Calendar class CalendarSegment extends CommonDBChild { // From CommonDBTM var $dohistory = true; // From CommonDBChild static public $itemtype = 'Calendar'; static public $items_id = 'calendars_id'; /** * @since version 0.84 **/ function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } static function getTypeName($nb=0) { return _n('Time range','Time ranges',$nb); } function prepareInputForAdd($input) { // Check override of segment : do not add if (count(self::getSegmentsBetween($input['calendars_id'], $input['day'], $input['begin'], $input['day'], $input['end'])) > 0 ) { Session::addMessageAfterRedirect(__('Can not add a range riding an existing period'), false, ERROR); return false; } return parent::prepareInputForAdd($input); } /** * Duplicate all segments from a calendar to his clone * * @param $oldid * @param $newid **/ static function cloneCalendar($oldid, $newid) { global $DB; $query = "SELECT * FROM `glpi_calendarsegments` WHERE `calendars_id`='$oldid'"; foreach ($DB->request($query) as $data) { $c = new self(); unset($data['id']); $data['calendars_id'] = $newid; $data['_no_history'] = true; $c->add($data); } } function post_addItem() { // Update calendar cache $cal = new Calendar(); $cal->updateDurationCache($this->fields['calendars_id']); parent::post_addItem(); } function post_deleteFromDB() { // Update calendar cache $cal = new Calendar(); $cal->updateDurationCache($this->fields['calendars_id']); parent::post_deleteFromDB(); } /** * Get segments of a calendar between 2 date * * @param $calendars_id id of the calendar * @param $begin_day begin day number * @param $begin_time begin time to check * @param $end_day end day number * @param $end_time end time to check **/ static function getSegmentsBetween($calendars_id, $begin_day, $begin_time, $end_day, $end_time) { global $DB; // Do not check hour if day before the end day of after the begin day return getAllDatasFromTable('glpi_calendarsegments', "`calendars_id` = '$calendars_id' AND `day` >= '$begin_day' AND `day` <= '$end_day' AND (`begin` < '$end_time' OR `day` < '$end_day') AND ('$begin_time' < `end` OR `day` > '$begin_day')"); } /** * Get segments of a calendar between 2 date * * @param $calendars_id id of the calendar * @param $day day number * @param $begin_time begin time to check * @param $end_time end time to check * * @return timestamp value **/ static function getActiveTimeBetween($calendars_id, $day, $begin_time, $end_time) { global $DB; $sum = 0; // Do not check hour if day before the end day of after the begin day $query = "SELECT TIMEDIFF(LEAST('$end_time',`end`), GREATEST(`begin`,'$begin_time')) AS TDIFF FROM `glpi_calendarsegments` WHERE `calendars_id` = '$calendars_id' AND `day` = '$day' AND (`begin` < '$end_time') AND ('$begin_time' < `end`)"; if ($result = $DB->query($query)) { if ($DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { list($hour, $minute ,$second) = explode(':', $data['TDIFF']); $sum += $hour*HOUR_TIMESTAMP+$minute*MINUTE_TIMESTAMP+$second; } } } return $sum; } /** * Add a delay of a starting hour in a specific day * * @param $calendars_id id of the calendar * @param $day day number * @param $begin_time begin time * @param $delay timestamp delay to add * * @return timestamp value **/ static function addDelayInDay($calendars_id, $day, $begin_time, $delay) { global $DB; $sum = 0; // Do not check hour if day before the end day of after the begin day $query = "SELECT GREATEST(`begin`,'$begin_time') AS BEGIN, TIMEDIFF(`end`,GREATEST(`begin`,'$begin_time')) AS TDIFF FROM `glpi_calendarsegments` WHERE `calendars_id` = '$calendars_id' AND `day` = '$day' AND ('$begin_time' < `end`) ORDER BY `begin`"; if ($result = $DB->query($query)) { if ($DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { list($hour, $minute, $second) = explode(':', $data['TDIFF']); $tstamp = $hour*HOUR_TIMESTAMP+$minute*MINUTE_TIMESTAMP+$second; // Delay is completed if ($delay <= $tstamp) { list($begin_hour, $begin_minute, $begin_second) = explode(':', $data['BEGIN']); $beginstamp = $begin_hour*HOUR_TIMESTAMP+$begin_minute*MINUTE_TIMESTAMP+$begin_second; $endstamp = $beginstamp+$delay; $units = Toolbox::getTimestampTimeUnits($endstamp); return str_pad($units['hour'], 2, '0', STR_PAD_LEFT).':'. str_pad($units['minute'], 2, '0', STR_PAD_LEFT).':'. str_pad($units['second'], 2, '0', STR_PAD_LEFT); } else { $delay -= $tstamp; } } } } return false; } /** * Get first working hour of a day * * @param $calendars_id id of the calendar * @param $day day number * * @return time value **/ static function getFirstWorkingHour($calendars_id, $day) { global $DB; $sum = 0; // Do not check hour if day before the end day of after the begin day $query = "SELECT MIN(`begin`) FROM `glpi_calendarsegments` WHERE `calendars_id` = '$calendars_id' AND `day` = '$day'"; if ($result = $DB->query($query)) { if ($DB->numrows($result)) { return $DB->result($result,0,0); } } return false; } /** * Get last working hour of a day * * @param $calendars_id id of the calendar * @param $day day number * * @return time value **/ static function getLastWorkingHour($calendars_id, $day) { global $DB; $sum = 0; // Do not check hour if day before the end day of after the begin day $query = "SELECT MAX(`end`) FROM `glpi_calendarsegments` WHERE `calendars_id` = '$calendars_id' AND `day` = '$day'"; if ($result = $DB->query($query)) { if ($DB->numrows($result)) { return $DB->result($result,0,0); } } return false; } /** * Show segments of a calendar * * @param $calendar Calendar object **/ static function showForCalendar(Calendar $calendar) { global $DB, $CFG_GLPI; $ID = $calendar->getField('id'); if (!$calendar->can($ID,'r')) { return false; } $canedit = $calendar->can($ID,'w'); $rand = mt_rand(); $query = "SELECT * FROM `glpi_calendarsegments` WHERE `calendars_id` = '$ID' ORDER BY `day`, `begin`, `end`"; $result = $DB->query($query); $numrows = $DB->numrows($result); if ($canedit) { echo "
"; echo ""; echo ""; echo ""; echo ""; echo "
".__('Add a schedule')."
".__('Day').""; echo ""; Dropdown::showFromArray('day', Toolbox::getDaysOfWeekArray()); echo "".__('Start').''; Dropdown::showHours("begin",date('H').":00"); echo "".__('End').''; Dropdown::showHours("end",(date('H')+1).":00"); echo ""; echo ""; echo "
"; Html::closeForm(); echo "
"; } echo "
"; if ($canedit && $numrows) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $paramsma = array('num_displayed' => $numrows); Html::showMassiveActions(__CLASS__, $paramsma); } echo ""; echo ""; if ($canedit && $numrows) { echo ""; } echo ""; echo ""; echo ""; echo ""; $daysofweek = Toolbox::getDaysOfWeekArray(); if ($numrows) { while ($data = $DB->fetch_assoc($result)) { echo ""; if ($canedit) { echo ""; } echo ""; echo ""; echo ""; } echo ""; } echo "
"; Html::checkAllAsCheckbox('mass'.__CLASS__.$rand); echo "".__('Day')."".__('Start')."".__('End')."
"; Html::showMassiveActionCheckBox(__CLASS__, $data["id"]); echo ""; echo $daysofweek[$data['day']]; echo "".$data["begin"]."".$data["end"]."
"; if ($canedit && $numrows) { $paramsma['ontop'] = false; Html::showMassiveActions(__CLASS__, $paramsma); Html::closeForm(); } echo "
"; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { switch ($item->getType()) { case 'Calendar' : if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(self::getTypeName(2), countElementsInTable($this->getTable(), "calendars_id = '".$item->getID()."'")); } return self::getTypeName(2); } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType()=='Calendar') { self::showForCalendar($item); } return true; } } ?> glpi-0.84.3+dfsg.1/inc/cartridge.class.php000066400000000000000000001063251226600447100201620ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } //! Cartridge Class /** * This class is used to manage the cartridges. * @see CartridgeItem * @author Julien Dombre **/ class Cartridge extends CommonDBChild { // From CommonDBTM static protected $forward_entity_to = array('Infocom'); public $dohistory = true; // From CommonDBChild static public $itemtype = 'CartridgeItem'; static public $items_id = 'cartridgeitems_id'; /** * @since version 0.84 **/ function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } function showSpecificMassiveActionsParameters($input=array()) { switch ($input['action']) { case "updatepages" : if (!isset($input['maxpages'])) { $input['maxpages'] = ''; } echo ""; echo "

"; return true; } return false; } static function getNameField() { return 'id'; } static function getTypeName($nb=0) { return _n('Cartridge', 'Cartridges', $nb); } function prepareInputForAdd($input) { $item = static::getItemFromArray(static::$itemtype, static::$items_id, $input); if ($item === false) { return false; } return array("cartridgeitems_id" => $item->fields["id"], "entities_id" => $item->getEntityID(), "date_in" => date("Y-m-d")); } function post_addItem() { Infocom::cloneItem('CartridgeItem', $this->fields["cartridgeitems_id"], $this->fields['id'], $this->getType()); parent::post_addItem(); } function post_updateItem($history=1) { if (in_array('pages', $this->updates)) { $printer = new Printer(); if ($printer->getFromDB($this->fields['printers_id']) && (($this->fields['pages'] > $printer->getField('last_pages_counter')) || ($this->oldvalues['pages'] == $printer->getField('last_pages_counter')))) { $printer->update(array('id' => $printer->getID(), 'last_pages_counter' => $this->fields['pages'] )); } } parent::post_updateItem($history); } /** * @since version 0.84 * * @see CommonDBTM::getPreAdditionalInfosForName **/ function getPreAdditionalInfosForName() { $ci = new CartridgeItem(); if ($ci->getFromDB($this->fields['cartridgeitems_id'])) { return $ci->getName(); } return ''; } /** * @since version 0.84 * * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "uninstall" : foreach ($input["item"] as $key => $val) { if ($val == 1) { if ($this->can($key,'w')) { if ($this->uninstall($key)) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } } break; case "updatepages" : if (isset($input['pages'])) { foreach ($input["item"] as $key => $val) { if ($val == 1) { if ($this->can($key,'w')) { if ($this->update(array('id' => $key, 'pages' => $input['pages']))) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } } } else { $res['ko']++; } break; default : return parent::doSpecificMassiveActions($input); } return $res; } /** * @see CommonDBTM::restore() */ function restore(array $input, $history=1) { global $DB; $query = "UPDATE `".$this->getTable()."` SET `date_out` = NULL, `date_use` = NULL, `printers_id` = '0' WHERE `id`='".$input["id"]."'"; if ($result = $DB->query($query) && ($DB->affected_rows() > 0)) { return true; } return false; } /** * Link a cartridge to a printer. * * Link the first unused cartridge of type $Tid to the printer $pID * * @param $tID : cartridge type identifier * @param $pID : printer identifier * * @return boolean : true for success **/ function install($pID, $tID) { global $DB; // Get first unused cartridge $query = "SELECT `id` FROM `".$this->getTable()."` WHERE (`cartridgeitems_id` = '$tID' AND `date_use` IS NULL)"; $result = $DB->query($query); if ($DB->numrows($result)>0) { $cID = $DB->result($result,0,0); // Mise a jour cartouche en prenant garde aux insertion multiples $query = "UPDATE `".$this->getTable()."` SET `date_use` = '".date("Y-m-d")."', `printers_id` = '$pID' WHERE (`id`='$cID' AND `date_use` IS NULL)"; if ($result = $DB->query($query) && ($DB->affected_rows() > 0)) { $changes[0] = '0'; $changes[1] = ''; $changes[2] = __('Installing a cartridge'); Log::history($pID, 'Printer', $changes, 0, Log::HISTORY_LOG_SIMPLE_MESSAGE); return true; } } else { Session::addMessageAfterRedirect(__('No free cartridge'), false, ERROR); } return false; } /** * UnLink a cartridge linked to a printer * * UnLink the cartridge identified by $ID * * @param $ID : cartridge identifier * * @return boolean **/ function uninstall($ID) { global $DB; if ($this->getFromDB($ID)) { $printer = new Printer(); $toadd = ''; if ($printer->getFromDB($this->getField("printers_id"))) { $toadd.= ", `pages` = '".$printer->fields['last_pages_counter']."' "; } $query = "UPDATE`".$this->getTable()."` SET `date_out` = '".date("Y-m-d")."' $toadd WHERE `id`='$ID'"; if ($result = $DB->query($query) && ($DB->affected_rows() > 0)) { $changes[0] = '0'; $changes[1] = ''; $changes[2] = __('Uninstalling a cartridge'); Log::history($this->getField("printers_id"), 'Printer', $changes, 0, Log::HISTORY_LOG_SIMPLE_MESSAGE); return true; } return false; } } /** * Print the cartridge count HTML array for the cartridge item $tID * * @param $tID integer: cartridge item identifier. *@param $alarm_threshold integer: threshold alarm value. * @param $nohtml integer: Return value without HTML tags (default 0) * * @return string to display **/ static function getCount($tID, $alarm_threshold, $nohtml=0) { global $DB; /// TODO to be more useful permit to have several columns and display number in it // Get total $total = self::getTotalNumber($tID); $out = ""; if ($total != 0) { $unused = self::getUnusedNumber($tID); $used = self::getUsedNumber($tID); $old = self::getOldNumber($tID); $highlight = ""; if ($unused <= $alarm_threshold) { $highlight = "tab_bg_1_2"; } if (!$nohtml) { $out .= ""; $out .= "
"; $out .= __('Total')."$total"; $out .= ""; $out .= _nx('cartridge','New','New',$unused); $out .= "$unused
"; $out .= _nx('cartridge','Used','Used',$used); $out .= "$used"; $out .= _nx('cartridge','Worn','Worn',$old); $out .= "$old
"; } else { //TRANS : for display cartridges count : %1$d is the total number, // %2$d the new one, %3$d the used one, %4$d worn one $out .= sprintf(__('Total: %1$d (%2$d new, %3$d used, %4$d worn)'), $total ,$unused, $used, $old); } } else { if (!$nohtml) { $out .= "
".__('No cartridge')."
"; } else { $out .= __('No cartridge'); } } return $out; } /** * count how many cartbridge for the cartridge item $tID * * @param $tID integer: cartridge item identifier. * * @return integer : number of cartridge counted. **/ static function getTotalNumber($tID) { global $DB; $query = "SELECT id FROM `glpi_cartridges` WHERE (`cartridgeitems_id` = '$tID')"; $result = $DB->query($query); return $DB->numrows($result); } /** * count how many cartridge used for the cartridge item $tID * * @param $tID integer: cartridge item identifier. * * @return integer : number of cartridge used counted. **/ static function getUsedNumber($tID) { global $DB; $query = "SELECT id FROM `glpi_cartridges` WHERE (`cartridgeitems_id` = '$tID' AND `date_use` IS NOT NULL AND `date_out` IS NULL)"; $result = $DB->query($query); return $DB->numrows($result); } /** * count how many old cartbridge for the cartridge item $tID * * @param $tID integer: cartridge item identifier. * * @return integer : number of old cartridge counted. **/ static function getOldNumber($tID) { global $DB; $query = "SELECT id FROM `glpi_cartridges` WHERE (`cartridgeitems_id` = '$tID' AND `date_out` IS NOT NULL)"; $result = $DB->query($query); return $DB->numrows($result); } /** * count how many cartbridge unused for the cartridge item $tID * * @param $tID integer: cartridge item identifier. * * @return integer : number of cartridge unused counted. **/ static function getUnusedNumber($tID) { global $DB; $query = "SELECT id FROM `glpi_cartridges` WHERE (`cartridgeitems_id` = '$tID' AND `date_use` IS NULL)"; $result = $DB->query($query); return $DB->numrows($result); } /** * Get the dict value for the status of a cartridge * * @param $date_use date : date of use * @param $date_out date : date of delete * * @return string : dict value for the cartridge status. **/ static function getStatus($date_use, $date_out) { if (is_null($date_use) || empty($date_use)) { return _x('cartridge', 'New'); } if (is_null($date_out) || empty($date_out)) { return _x('cartridge', 'Used'); } return _x('cartridge', 'Worn'); } /** * Print out the cartridges of a defined type * * @param $cartitem object of CartridgeItem class * @param $show_old boolean show old cartridges or not (default 0) * * @return Nothing (displays) **/ static function showForCartridgeItem(CartridgeItem $cartitem, $show_old=0) { global $DB, $CFG_GLPI; $tID = $cartitem->getField('id'); if (!$cartitem->can($tID,'r')) { return false; } $canedit = $cartitem->can($tID,'w'); $query = "SELECT COUNT(*) AS count FROM `glpi_cartridges` WHERE (`cartridgeitems_id` = '$tID')"; if ($result = $DB->query($query)) { $total = $DB->result($result, 0, "count"); if (!$show_old) { // NEW $where = " AND `glpi_cartridges`.`date_out` IS NULL"; } else { //OLD $where = " AND `glpi_cartridges`.`date_out` IS NOT NULL"; } $stock_time = 0; $use_time = 0; $pages_printed = 0; $nb_pages_printed = 0; $ORDER = " `glpi_cartridges`.`date_use` ASC, `glpi_cartridges`.`date_out` DESC, `glpi_cartridges`.`date_in`"; if (!$show_old) { $ORDER = " `glpi_cartridges`.`date_out` ASC, `glpi_cartridges`.`date_use` ASC, `glpi_cartridges`.`date_in`"; } $query = "SELECT `glpi_cartridges`.*, `glpi_printers`.`id` AS printID, `glpi_printers`.`name` AS printname, `glpi_printers`.`init_pages_counter` FROM `glpi_cartridges` LEFT JOIN `glpi_printers` ON (`glpi_cartridges`.`printers_id` = `glpi_printers`.`id`) WHERE `glpi_cartridges`.`cartridgeitems_id` = '$tID' $where ORDER BY $ORDER"; $result = $DB->query($query); $number = $DB->numrows($result); echo "
"; if ($canedit && $number) { $rand = mt_rand(); Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $actions = array('delete' => _x('button', 'Delete permanently'), 'activate_infocoms' => __('Enable the financial and administrative information'), 'restore' => __('Back to stock')); $paramsma = array('num_displayed' => $number, 'specific_actions' => $actions, 'rand' => $rand); Html::showMassiveActions(__CLASS__, $paramsma); } echo ""; if (!$show_old) { echo ""; echo ""; } else { // Old echo ""; echo ""; } $i = 0; echo ""; if ($canedit && $number) { echo ""; } echo ""; echo ""; echo ""; echo ""; if ($show_old) { echo ""; echo ""; } echo ""; echo ""; } $pages = array(); if ($number) { while ($data = $DB->fetch_assoc($result)) { $date_in = Html::convDate($data["date_in"]); $date_use = Html::convDate($data["date_use"]); $date_out = Html::convDate($data["date_out"]); $printer = $data["printers_id"]; $page = $data["pages"]; echo ""; if ($canedit) { echo ""; } echo "'; echo ""; echo ""; echo ""; if ($show_old) { // Get initial counter page if (!isset($pages[$printer])) { $pages[$printer] = $data['init_pages_counter']; } echo ""; } echo ""; echo ""; } if ($show_old && ($number > 0)) { if ($nb_pages_printed == 0) { $nb_pages_printed = 1; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } } echo "
".self::getCount($tID,-1)."
".__('Worn cartridges')."
"; Html::checkAllAsCheckbox('mass'.__CLASS__.$rand); echo "".__('ID').""._x('item', 'State')."".__('Add date')."".__('Use date')."".__('Used on')."".__('End date')."".__('Printer counter')."".__('Financial and administrative information')."
"; Html::showMassiveActionCheckBox(__CLASS__, $data["id"]); echo "".$data['id'].'".self::getStatus($data["date_use"], $data["date_out"]); echo "".$date_in."".$date_use.""; if (!is_null($date_use)) { if ($data["printID"] > 0) { $printname = $data["printname"]; if ($_SESSION['glpiis_ids_visible'] || empty($printname)) { $printname = sprintf(__('%1$s (%2$s)'), $printname, $data["printID"]); } echo "".$printname.""; } else { echo NOT_AVAILABLE; } $tmp_dbeg = explode("-",$data["date_in"]); $tmp_dend = explode("-",$data["date_use"]); $stock_time_tmp = mktime(0, 0, 0, $tmp_dend[1], $tmp_dend[2], $tmp_dend[0]) - mktime(0, 0, 0, $tmp_dbeg[1], $tmp_dbeg[2], $tmp_dbeg[0]); $stock_time += $stock_time_tmp; } if ($show_old) { echo ""; echo $date_out; $tmp_dbeg = explode("-",$data["date_use"]); $tmp_dend = explode("-",$data["date_out"]); $use_time_tmp = mktime(0, 0, 0, $tmp_dend[1], $tmp_dend[2], $tmp_dend[0]) - mktime(0, 0, 0, $tmp_dbeg[1], $tmp_dbeg[2], $tmp_dbeg[0]); $use_time += $use_time_tmp; } echo ""; if ($pages[$printer] < $data['pages']) { $pages_printed += $data['pages']-$pages[$printer]; $nb_pages_printed++; $pp = $data['pages']-$pages[$printer]; printf(_n('%d printed page','%d printed pages',$pp), $pp); $pages[$printer] = $data['pages']; } else if ($data['pages'] != 0) { echo "".__('Counter error').""; } echo ""; Infocom::showDisplayLink('Cartridge',$data["id"],1); echo "
 ".__('Average time in stock')."
"; echo round($stock_time/$number/60/60/24/30.5,1)." ".__('month')."
 ".__('Average time in use')."
"; echo round($use_time/$number/60/60/24/30.5,1)." ".__('month')."
".__('Average number of printed pages')."
"; echo round($pages_printed/$nb_pages_printed)."
 
"; if ($canedit && $number) { $paramsma['ontop'] = false; Html::showMassiveActions(__CLASS__, $paramsma); Html::closeForm(); } echo "
\n\n"; } /** * Print out a link to add directly a new cartridge from a cartridge item. * * @param $cartitem CartridgeItem object * * @return Nothing (displays) **/ static function showAddForm(CartridgeItem $cartitem) { global $CFG_GLPI; $ID = $cartitem->getField('id'); if (!$cartitem->can($ID, 'w')) { return false; } if ($ID > 0) { echo "
"; echo ""; echo ""; echo ""; echo "
"; echo "\n"; Dropdown::showInteger('to_add',1,1,100); echo " "; echo "
"; Html::closeForm(); echo "
"; } } /** * Show installed cartridges * * @since version 0.84 (before showInstalled) * * @param $printer Printer object * @param $old boolean old cartridges or not ? (default 0) * * @return nothing (display) **/ static function showForPrinter(Printer $printer, $old=0) { global $DB, $CFG_GLPI; $instID = $printer->getField('id'); if (!Session::haveRight("cartridge","r")) { return false; } $canedit = Session::haveRight("cartridge", "w"); $rand = mt_rand(); $query = "SELECT `glpi_cartridgeitems`.`id` AS tID, `glpi_cartridgeitems`.`is_deleted`, `glpi_cartridgeitems`.`ref` AS ref, `glpi_cartridgeitems`.`name` AS type, `glpi_cartridges`.`id`, `glpi_cartridges`.`pages` AS pages, `glpi_cartridges`.`date_use` AS date_use, `glpi_cartridges`.`date_out` AS date_out, `glpi_cartridges`.`date_in` AS date_in FROM `glpi_cartridges`, `glpi_cartridgeitems` WHERE (`glpi_cartridges`.`date_out` IS ".($old?"NOT":"")." NULL AND `glpi_cartridges`.`printers_id` = '$instID' AND `glpi_cartridges`.`cartridgeitems_id` = `glpi_cartridgeitems`.`id`) ORDER BY `glpi_cartridges`.`date_out` ASC, `glpi_cartridges`.`date_use` DESC, `glpi_cartridges`.`date_in`"; $result = $DB->query($query); $number = $DB->numrows($result); $i = 0; if ($canedit && !$old) { echo "
"; echo ""; echo ""; echo ""; echo "
"; echo "\n"; $installok = false; if (CartridgeItem::dropdownForPrinter($printer)) { $installok = true; } else { _e('No cartridge available'); } echo ""; echo "
"; Html::closeForm(); echo "
"; } echo "
"; $pages = $printer->fields['init_pages_counter']; echo "
"; if ($canedit && $number) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); if (!$old) { $actions = array('uninstall' => __('End of life')); } else { $actions = array('updatepages' => __('Update printer counter'), 'delete' => _x('button', 'Delete permanently')); } $paramsma = array('num_displayed' => $number, 'specific_actions' => $actions, 'rand' => $rand, 'extraparams' => array('maxpages' => $printer->fields['last_pages_counter'])); Html::showMassiveActions(__CLASS__, $paramsma); } echo ""; if ($old == 0) { echo ""; } else { echo ""; } echo ""; if ($canedit) { echo ""; } echo ""; echo ""; echo ""; if ($old != 0) { echo ""; echo ""; echo ""; } echo ""; $stock_time = 0; $use_time = 0; $pages_printed = 0; $nb_pages_printed = 0; while ($data = $DB->fetch_assoc($result)) { $cart_id = $data["id"]; $date_in = Html::convDate($data["date_in"]); $date_use = Html::convDate($data["date_use"]); $date_out = Html::convDate($data["date_out"]); $viewitemjs = ($canedit ? "style='cursor:pointer' onClick=\"viewEditCartridge".$data['id']. "$rand();\"" : ''); echo ""; if ($canedit) { echo ""; } echo ""; echo ""; echo ""; echo ""; $tmp_dbeg = explode("-", $data["date_in"]); $tmp_dend = explode("-", $data["date_use"]); $stock_time_tmp = mktime(0, 0, 0, $tmp_dend[1], $tmp_dend[2], $tmp_dend[0]) - mktime(0, 0, 0, $tmp_dbeg[1], $tmp_dbeg[2], $tmp_dbeg[0]); $stock_time += $stock_time_tmp; if ($old != 0) { echo ""; echo ""; } echo ""; } if ($old) { // Print average if ($number > 0) { if ($nb_pages_printed == 0) { $nb_pages_printed = 1; } echo ""; echo ""; echo ""; echo ""; echo ""; } } echo "
".__('Used cartridges')."
".__('Worn cartridges')."
"; Html::checkAllAsCheckbox('mass'.__CLASS__.$rand); echo "".__('ID').""._n('Cartridge model','Cartridge models',1)."".__('Add date')."".__('Use date')."".__('End date')."".__('Printer counter')."".__('Printed pages')."
"; Html::showMassiveActionCheckBox(__CLASS__, $data["id"]); echo ""; if ($canedit) { echo "\n\n"; } echo $data["id"].""; echo ""; printf(__('%1$s - %2$s'), $data["type"], $data["ref"]); echo "".$date_in."".$date_use."".$date_out; $tmp_dbeg = explode("-", $data["date_use"]); $tmp_dend = explode("-", $data["date_out"]); $use_time_tmp = mktime(0, 0, 0, $tmp_dend[1], $tmp_dend[2], $tmp_dend[0]) - mktime(0, 0, 0, $tmp_dbeg[1], $tmp_dbeg[2], $tmp_dbeg[0]); $use_time += $use_time_tmp; echo "".$data['pages'].""; if ($pages < $data['pages']) { $pages_printed += $data['pages']-$pages; $nb_pages_printed++; $pp = $data['pages']-$pages; echo $pp; $pages = $data['pages']; } else { echo " "; } echo "
 ".__('Average time in stock')."
"; $time_stock = round($stock_time/$number/60/60/24/30.5,1); echo sprintf(_n('%d month', '%d months', $time_stock), $time_stock)."
".__('Average time in use')."
"; $time_use = round($use_time/$number/60/60/24/30.5,1); echo sprintf(_n('%d month', '%d months', $time_use), $time_use)."
".__('Average number of printed pages')."
"; echo round($pages_printed/$nb_pages_printed)."
"; if ($canedit && $number) { $paramsma['ontop'] = false; Html::showMassiveActions(__CLASS__, $paramsma); Html::closeForm(); } echo "
\n\n"; } /** form for Cartridge * * @since version 0.84 * * @param $ID integer Id of the cartridge * @param $options array of possible options: * - parent Object : the printers where the cartridge is used **/ function showForm($ID, $options=array()) { global $DB, $CFG_GLPI; if (isset($options['parent']) && !empty($options['parent'])) { $printer = $options['parent']; } if (!$this->getFromDB($ID)) { return false; } $printer = new Printer; $printer->check($this->getField('printers_id'),'w'); $cartitem = new CartridgeItem; $cartitem->getFromDB($this->getField('cartridgeitems_id'),'w'); $is_old = !empty($this->fields['date_out']); $is_used = !empty($this->fields['date_use']); $options['colspan'] = 2; $options['candel'] = false; // Do not permit delete here $options['canedit'] = $is_used; // Do not permit edit if cart is not used $this->showFormHeader($options); echo ""; echo ""._n('Printer','Printers',1).""; echo $printer->getLink(); echo "\n"; echo "\n"; echo "\n"; echo ""._n('Cartridge model','Cartridge models',1).""; echo "".$cartitem->getLink()."\n"; echo ""; echo "".__('Add date').""; echo "".Html::convDate($this->fields["date_in"]).""; echo "".__('Use date').""; if ($is_used && !$is_old) { Html::showDateFormItem("date_use", $this->fields["date_use"], false, true, $this->fields["date_in"]); } else { echo Html::convDate($this->fields["date_use"]); } echo "\n"; if ($is_old) { echo ""; echo "".__('End date').""; Html::showDateFormItem("date_out", $this->fields["date_out"], false, true, $this->fields["date_use"]); echo ""; echo "".__('Printer counter').""; echo "fields['pages']."\">"; echo "\n"; } $this->showFormButtons($options); return true; } /** * Get notification parameters by entity * * @param entity the entity (default 0) */ static function getNotificationParameters($entity=0) { global $DB, $CFG_GLPI; //Look for parameters for this entity $query = "SELECT `cartridges_alert_repeat` FROM `glpi_entities` WHERE `id` = '$entity'"; $iterator = $DB->request($query); if (!$iterator->numrows()) { //No specific parameters defined, taking global configuration params return $CFG_GLPI['cartridges_alert_repeat']; } else { $datas = $iterator->next(); //This entity uses global parameters -> return global config if ($datas['cartridges_alert_repeat'] == -1) { return $CFG_GLPI['cartridges_alert_repeat']; } // ELSE Special configuration for this entity return $datas['cartridges_alert_repeat']; } } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate && Session::haveRight("cartridge","r")) switch ($item->getType()) { case 'Printer' : if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(self::getTypeName(2), self::countForPrinter($item)); } return self::getTypeName(2); case 'CartridgeItem' : if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(self::getTypeName(2), self::countForCartridgeItem($item)); } return self::getTypeName(2); } return ''; } static function countForCartridgeItem(CartridgeItem $item) { $restrict = "`glpi_cartridges`.`cartridgeitems_id` = '".$item->getField('id') ."'"; return countElementsInTable(array('glpi_cartridges'), $restrict); } /** * @param $item Printer object **/ static function countForPrinter(Printer $item) { $restrict = "`glpi_cartridges`.`printers_id` = '".$item->getField('id') ."'"; return countElementsInTable(array('glpi_cartridges'), $restrict); } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($item->getType()) { case 'Printer' : self::showForPrinter($item); self::showForPrinter($item, 1); return true; case 'CartridgeItem' : self::showAddForm($item); self::showForCartridgeItem($item); self::showForCartridgeItem($item, 1); return true; } } } ?> glpi-0.84.3+dfsg.1/inc/cartridgeitem.class.php000066400000000000000000000437531226600447100210460ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * CartridgeItem Class * This class is used to manage the various types of cartridges. * \see Cartridge **/ class CartridgeItem extends CommonDBTM { // From CommonDBTM static protected $forward_entity_to = array('Cartridge', 'Infocom'); public $dohistory = true; static function getTypeName($nb=0) { return _n('Cartridge model','Cartridge models',$nb); } static function canCreate() { return Session::haveRight('cartridge', 'w'); } static function canView() { return Session::haveRight('cartridge', 'r'); } /** * @since version 0.84 * * @see CommonDBTM::getPostAdditionalInfosForName **/ function getPostAdditionalInfosForName() { if (isset($this->fields["ref"]) && !empty($this->fields["ref"])) { return $this->fields["ref"]; } return ''; } function cleanDBonPurge() { $class = new Cartridge(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); $class = new CartridgeItem_PrinterModel(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); $class = new Alert(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); } function post_getEmpty() { $this->fields["alarm_threshold"] = Entity::getUsedConfig("cartriges_alert_repeat", $this->fields["entities_id"], "default_cartridges_alarm_threshold", 10); } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('Cartridge', $ong, $options); $this->addStandardTab('CartridgeItem_PrinterModel', $ong, $options); $this->addStandardTab('Infocom', $ong, $options); $this->addStandardTab('Document_Item',$ong, $options); $this->addStandardTab('Link',$ong, $options); $this->addStandardTab('Note',$ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } ///// SPECIFIC FUNCTIONS /** * Count cartridge of the cartridge type * * @return number of cartridges **/ static function getCount() { global $DB; $query = "SELECT * FROM `glpi_cartridges` WHERE `cartridgeitems_id` = '".$this->fields["id"]."'"; if ($result = $DB->query($query)) { $number = $DB->numrows($result); return $number; } return false; } /** * Add a compatible printer type for a cartridge type * * @param $cartridgeitems_id integer: cartridge type identifier * @param printermodels_id integer: printer type identifier * * @return boolean : true for success **/ function addCompatibleType($cartridgeitems_id, $printermodels_id) { global $DB; if (($cartridgeitems_id > 0) && ($printermodels_id > 0)) { $query = "INSERT INTO `glpi_cartridgeitems_printermodels` (`cartridgeitems_id`, `printermodels_id`) VALUES ('$cartridgeitems_id', '$printermodels_id');"; if ($result = $DB->query($query) && ($DB->affected_rows() > 0)) { return true; } } return false; } /** * Print the cartridge type form * * @param $ID integer ID of the item * @param $options array os possible options: * - target for the Form * - withtemplate : 1 for newtemplate, 2 for newobject from template * * @return Nothing (display) **/ function showForm($ID, $options=array()) { $this->initForm($ID, $options); $this->showTabs($options); $this->showFormHeader($options); echo ""; echo "".__('Name').""; echo ""; Html::autocompletionTextField($this, "name"); echo ""; echo "".__('Type').""; echo ""; CartridgeItemType::dropdown(array('value' => $this->fields["cartridgeitemtypes_id"])); echo ""; echo ""; echo "".__('Reference').""; echo ""; Html::autocompletionTextField($this, "ref"); echo ""; echo "".__('Manufacturer').""; echo ""; Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"])); echo ""; echo ""; echo "".__('Technician in charge of the hardware').""; echo ""; User::dropdown(array('name' => 'users_id_tech', 'value' => $this->fields["users_id_tech"], 'right' => 'own_ticket', 'entity' => $this->fields["entities_id"])); echo ""; echo "".__('Comments').""; echo " "; echo ""; echo ""; echo "".__('Group in charge of the hardware').""; echo ""; Group::dropdown(array('name' => 'groups_id_tech', 'value' => $this->fields['groups_id_tech'], 'entity' => $this->fields['entities_id'], 'condition' => '`is_assign`')); echo "\n"; echo ""; echo "".__('Stock location').""; echo ""; Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"])); echo ""; echo ""; echo "".__('Alert threshold').""; echo ""; Dropdown::showInteger('alarm_threshold', $this->fields["alarm_threshold"], 0, 100, 1, array('-1' => __('Never'))); Alert::displayLastAlert('CartridgeItem', $ID); echo ""; $this->showFormButtons($options); $this->addDivForTabs(); return true; } /** * @see CommonDBTM::getSpecificMassiveActions() **/ function getSpecificMassiveActions($checkitem=NULL) { $isadmin = static::canUpdate(); $actions = parent::getSpecificMassiveActions($checkitem); if (Session::haveRight('transfer','r') && Session::isMultiEntitiesMode() && $isadmin) { $actions['add_transfer_list'] = _x('button', 'Add to transfer list'); } return $actions; } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab[34]['table'] = $this->getTable(); $tab[34]['field'] = 'ref'; $tab[34]['name'] = __('Reference'); $tab[34]['datatype'] = 'string'; $tab[4]['table'] = 'glpi_cartridgeitemtypes'; $tab[4]['field'] = 'name'; $tab[4]['name'] = __('Type'); $tab[4]['datatype'] = 'dropdown'; $tab[23]['table'] = 'glpi_manufacturers'; $tab[23]['field'] = 'name'; $tab[23]['name'] = __('Manufacturer'); $tab[23]['datatype'] = 'dropdown'; $tab += Location::getSearchOptionsToAdd(); $tab[24]['table'] = 'glpi_users'; $tab[24]['field'] = 'name'; $tab[24]['linkfield'] = 'users_id_tech'; $tab[24]['name'] = __('Technician in charge of the hardware'); $tab[24]['datatype'] = 'dropdown'; $tab[24]['right'] = 'own_ticket'; $tab[49]['table'] = 'glpi_groups'; $tab[49]['field'] = 'completename'; $tab[49]['linkfield'] = 'groups_id_tech'; $tab[49]['name'] = __('Group in charge of the hardware'); $tab[49]['condition'] = '`is_assign`'; $tab[49]['datatype'] = 'dropdown'; $tab[8]['table'] = $this->getTable(); $tab[8]['field'] = 'alarm_threshold'; $tab[8]['name'] = __('Alert threshold'); $tab[8]['datatype'] = 'number'; $tab[8]['toadd'] = array('-1' => __('Never')); $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab[90]['table'] = $this->getTable(); $tab[90]['field'] = 'notepad'; $tab[90]['name'] = __('Notes'); $tab[90]['massiveaction'] = false; $tab[90]['datatype'] = 'text'; $tab[80]['table'] = 'glpi_entities'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = __('Entity'); $tab[80]['massiveaction'] = false; $tab[80]['datatype'] = 'dropdown'; $tab[40]['table'] = 'glpi_printermodels'; $tab[40]['field'] = 'name'; $tab[40]['datatype'] = 'dropdown'; $tab[40]['name'] = _n('Printer model', 'Printer models', 2); $tab[40]['forcegroupby'] = true; $tab[40]['joinparams'] = array('beforejoin' => array('table' => 'glpi_cartridgeitems_printermodels', 'joinparams' => array('jointype' => 'child'))); return $tab; } static function cronInfo($name) { return array('description' => __('Send alarms on cartridges')); } /** * Cron action on cartridges : alert if a stock is behind the threshold * * @param $task for log, display information if NULL? (default NULL) * * @return 0 : nothing to do 1 : done with success **/ static function cronCartridge($task=NULL) { global $DB, $CFG_GLPI; $cron_status = 1; if ($CFG_GLPI["use_mailing"]) { $message = array(); $alert = new Alert(); foreach (Entity::getEntitiesToNotify('cartridges_alert_repeat') as $entity => $repeat) { // if you change this query, please don't forget to also change in showDebug() $query_alert = "SELECT `glpi_cartridgeitems`.`id` AS cartID, `glpi_cartridgeitems`.`entities_id` AS entity, `glpi_cartridgeitems`.`ref` AS ref, `glpi_cartridgeitems`.`name` AS name, `glpi_cartridgeitems`.`alarm_threshold` AS threshold, `glpi_alerts`.`id` AS alertID, `glpi_alerts`.`date` FROM `glpi_cartridgeitems` LEFT JOIN `glpi_alerts` ON (`glpi_cartridgeitems`.`id` = `glpi_alerts`.`items_id` AND `glpi_alerts`.`itemtype` = 'CartridgeItem') WHERE `glpi_cartridgeitems`.`is_deleted` = '0' AND `glpi_cartridgeitems`.`alarm_threshold` >= '0' AND `glpi_cartridgeitems`.`entities_id` = '".$entity."' AND (`glpi_alerts`.`date` IS NULL OR (`glpi_alerts`.`date`+$repeat) < CURRENT_TIMESTAMP());"; $message = ""; $items = array(); foreach ($DB->request($query_alert) as $cartridge) { if (($unused=Cartridge::getUnusedNumber($cartridge["cartID"]))<=$cartridge["threshold"]) { //TRANS: %1$s is the cartridge name, %2$s its reference, %3$d the remaining number $message .= sprintf(__('Threshold of alarm reached for the type of cartridge: %1$s - Reference %2$s - Remaining %3$d'), $cartridge["name"], $cartridge["ref"], $unused); $message .='
'; $items[$cartridge["cartID"]] = $cartridge; // if alert exists -> delete if (!empty($cartridge["alertID"])) { $alert->delete(array("id" => $cartridge["alertID"])); } } } if (!empty($items)) { $options['entities_id'] = $entity; $options['items'] = $items; $entityname = Dropdown::getDropdownName("glpi_entities", $entity); if (NotificationEvent::raiseEvent('alert', new CartridgeItem(), $options)) { if ($task) { $task->log(sprintf(__('%1$s: %2$s')."\n", $entityname, $message)); $task->addVolume(1); } else { Session::addMessageAfterRedirect(sprintf(__('%1$s: %2$s'), $entityname, $message)); } $input["type"] = Alert::THRESHOLD; $input["itemtype"] = 'CartridgeItem'; // add alerts foreach ($items as $ID => $consumable) { $input["items_id"] = $ID; $alert->add($input); unset($alert->fields['id']); } } else { //TRANS: %s is entity name $msg = sprintf(__('%s: send cartridge alert failed'), $entityname); if ($task) { $task->log($msg); } else { //TRANS: %s is the entity Session::addMessageAfterRedirect($msg, false, ERROR); } } } } } } /** * Print a select with compatible cartridge * * @param $printer Printer object * * @return nothing (display) **/ static function dropdownForPrinter(Printer $printer) { global $DB; $query = "SELECT COUNT(*) AS cpt, `glpi_locations`.`completename` AS location, `glpi_cartridgeitems`.`ref` AS ref, `glpi_cartridgeitems`.`name` AS name, `glpi_cartridgeitems`.`id` AS tID FROM `glpi_cartridgeitems` INNER JOIN `glpi_cartridgeitems_printermodels` ON (`glpi_cartridgeitems`.`id` = `glpi_cartridgeitems_printermodels`.`cartridgeitems_id`) INNER JOIN `glpi_cartridges` ON (`glpi_cartridges`.`cartridgeitems_id` = `glpi_cartridgeitems`.`id` AND `glpi_cartridges`.`date_use` IS NULL) LEFT JOIN `glpi_locations` ON (`glpi_locations`.`id` = `glpi_cartridgeitems`.`locations_id`) WHERE `glpi_cartridgeitems_printermodels`.`printermodels_id` = '".$printer->fields["printermodels_id"]."' AND `glpi_cartridgeitems`.`entities_id` ='".$printer->fields["entities_id"]."' GROUP BY tID ORDER BY `name`, `ref`"; $datas = array(); if ($result = $DB->query($query)) { if ($DB->numrows($result)) { while ($data= $DB->fetch_assoc($result)) { $text = sprintf(__('%1$s - %2$s'), $data["name"], $data["ref"]); $text = sprintf(__('%1$s (%2$s)'), $text, $data["cpt"]); $text = sprintf(__('%1$s - %2$s'), $text, $data["location"]); $datas[$data["tID"]] = $text; } } } if (count($datas)) { return Dropdown::showFromArray('cartridgeitems_id', $datas); } return false; } function getEvents() { return array('alert' => __('Send alarms on cartridges')); } /** * Display debug information for current object **/ function showDebug() { // see query_alert in cronCartridge() $item = array('cartID' => $this->fields['id'], 'entity' => $this->fields['entities_id'], 'ref' => $this->fields['ref'], 'name' => $this->fields['name'], 'threshold' => $this->fields['alarm_threshold']); $options = array(); $options['entities_id'] = $this->getEntityID(); $options['items'] = array($item); NotificationEvent::debugEvent($this, $options); } } ?> glpi-0.84.3+dfsg.1/inc/cartridgeitem_printermodel.class.php000066400000000000000000000150551226600447100236240ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // Relation between CartridgeItem and PrinterModel // since version 0.84 class CartridgeItem_PrinterModel extends CommonDBRelation { // From CommonDBRelation static public $itemtype_1 = 'CartridgeItem'; static public $items_id_1 = 'cartridgeitems_id'; static public $itemtype_2 = 'PrinterModel'; static public $items_id_2 = 'printermodels_id'; static public $checkItem_2_Rights = self::DONT_CHECK_ITEM_RIGHTS; function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($item->getType()) { case 'CartridgeItem' : self::showForCartridgeItem($item); break; } return true; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate && Session::haveRight("printer","r")) { switch ($item->getType()) { case 'CartridgeItem' : if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(PrinterModel::getTypeName(2), self::countForCartridgeItem($item)); } return PrinterModel::getTypeName(2); break; } } return ''; } /** * @param $item CartridgeItem object **/ static function countForCartridgeItem(CartridgeItem $item) { $restrict = "`".static::getTable()."`.`cartridgeitems_id` = '".$item->getField('id') ."' AND `".static::getTable()."`.`printermodels_id` = `glpi_printermodels`.`id`"; return countElementsInTable(array('glpi_printermodels', static::getTable()), $restrict); } /** * Show the printer types that are compatible with a cartridge type * * @param $item CartridgeItem object * * @return nothing (display) **/ static function showForCartridgeItem(CartridgeItem $item) { global $DB, $CFG_GLPI; $instID = $item->getField('id'); if (!$item->can($instID, 'r')) { return false; } $canedit = $item->can($instID, 'w'); $rand = mt_rand(); $query = "SELECT `".static::getTable()."`.`id`, `glpi_printermodels`.`name` AS `type`, `glpi_printermodels`.`id` AS `pmid` FROM `".static::getTable()."`, `glpi_printermodels` WHERE `".static::getTable()."`.`printermodels_id` = `glpi_printermodels`.`id` AND `".static::getTable()."`.`cartridgeitems_id` = '$instID' ORDER BY `glpi_printermodels`.`name`"; $result = $DB->query($query); $i = 0; function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } $used = array(); $datas = array(); if ($number = $DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $used[$data["pmid"]] = $data["pmid"]; $datas[$data["id"]] = $data; } } if ($canedit) { echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
".__('Add a compatible printer model')."
"; echo ""; PrinterModel::dropdown(array('used' => $used)); echo ""; echo ""; echo "
"; Html::closeForm(); echo "
"; } if ($number) { echo "
"; if ($canedit) { $rand = mt_rand(); Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $paramsma = array('num_displayed' => count($used)); Html::showMassiveActions(__CLASS__, $paramsma); } echo ""; echo ""; if ($canedit) { echo ""; } echo ""; foreach ($datas as $data) { echo ""; if ($canedit) { echo ""; } echo ""; echo ""; } echo "
"; Html::checkAllAsCheckbox('mass'.__CLASS__.$rand); echo "".__('Model')."
"; Html::showMassiveActionCheckBox(__CLASS__, $data["id"]); echo "".$data['type']."
"; if ($canedit) { $paramsma['ontop'] = false; Html::showMassiveActions(__CLASS__, $paramsma); Html::closeForm(); } echo "
"; } else { echo "

".__('No item found')."

"; } } } ?> glpi-0.84.3+dfsg.1/inc/cartridgeitemtype.class.php000066400000000000000000000026051226600447100217370ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class CartridgeItemType class CartridgeItemType extends CommonDropdown { static function getTypeName($nb=0) { return _n('Cartridge type', 'Cartridge types', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/central.class.php000066400000000000000000000177171226600447100176540ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // class Central class Central extends CommonGLPI { static function getTypeName($nb=0) { // No plural return __('Standard interface'); } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab(__CLASS__, $ong, $options); return $ong; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if ($item->getType() == __CLASS__) { $tabs[1] = __('Personal View'); $tabs[2] = __('Group View'); $tabs[3] = __('Global View'); $tabs[4] = _n('RSS feed', 'RSS feeds', 2); return $tabs; } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType() == __CLASS__) { switch ($tabnum) { case 1 : // all $item->showMyView(); break; case 2 : $item->showGroupView(); break; case 3 : $item->showGlobalView(); break; case 4 : $item->showRSSView(); break; } } return true; } /** * Show the central global view **/ static function showGlobalView() { $showticket = Session::haveRight("show_all_ticket","1"); $showproblem = Session::haveRight("show_all_problem","1"); echo ""; echo ""; if (Session::haveRight("logs","r")) { echo ""; } echo "
"; echo ""; echo ""; echo "
"; if ($showticket) { Ticket::showCentralCount(); } if ($showproblem) { Problem::showCentralCount(); } if (Session::haveRight("contract","r")) { Contract::showCentral(); } echo "
"; //Show last add events Event::showForUser($_SESSION["glpiname"]); echo "
"; if ($_SESSION["glpishow_jobs_at_login"] && $showticket) { echo "
"; Ticket::showCentralNewList(); } } /** * Show the central personal view **/ static function showMyView() { global $DB, $CFG_GLPI; $showticket = (Session::haveRight("show_all_ticket", "1") || Session::haveRight("show_assign_ticket", "1")); $showproblem = (Session::haveRight("show_all_problem", "1") || Session::haveRight("show_my_problem", "1")); echo ""; if (Session::haveRight("config", "w")) { $logins = User::checkDefaultPasswords(); $user = new User(); if (!empty($logins)) { $accouts = array(); foreach ($logins as $login) { $user->getFromDBbyName($login); $accounts[] = $user->getLink(); } $message = sprintf(__('For security reasons, please change the password for the default users: %s'), implode(" ", $accounts)); echo ""; } if (file_exists(GLPI_ROOT . "/install/install.php")) { echo ""; } } if ($DB->isSlave() && !$DB->first_connection) { echo ""; } echo ""; echo "
"; Html::displayTitle($CFG_GLPI['root_doc']."/pics/warning.png", $message, $message); echo "
"; $message = sprintf(__('For security reasons, please remove file: %s'), "install/install.php"); Html::displayTitle($CFG_GLPI['root_doc']."/pics/warning.png", $message, $message); echo "
"; Html::displayTitle($CFG_GLPI['root_doc']."/pics/warning.png", __('MySQL replica: read only'), __('MySQL replica: read only')); echo "
"; echo ""; echo "
"; if (Session::haveRight('validate_request',1) || Session::haveRight('validate_incident',1)) { Ticket::showCentralList(0,"tovalidate",false); } Ticket::showCentralList(0, "toapprove", false); Ticket::showCentralList(0, "rejected", false); Ticket::showCentralList(0, "requestbyself", false); Ticket::showCentralList(0, "observed", false); if ($showticket) { Ticket::showCentralList(0, "process", false); Ticket::showCentralList(0, "waiting", false); } if ($showproblem) { Problem::showCentralList(0, "process", false); } echo "
"; echo ""; echo "
"; Planning::showCentral(Session::getLoginUserID()); Reminder::showListForCentral(); if (Session::haveRight("reminder_public","r")) { Reminder::showListForCentral(false); } echo "
"; } /** * Show the central RSS view * * @since version 0.84 **/ static function showRSSView() { echo ""; echo ""; echo "
"; RSSFeed::showListForCentral(); echo ""; if (Session::haveRight("rssfeed_public","r")) { RSSFeed::showListForCentral(false); } else { echo " "; } echo "
"; } /** * Show the central group view **/ static function showGroupView() { $showticket = (Session::haveRight("show_all_ticket","1") || Session::haveRight("show_assign_ticket","1")); $showproblem = (Session::haveRight("show_all_problem", "1") || Session::haveRight("show_my_problem", "1")); echo ""; echo ""; echo "
"; echo ""; echo "
"; if ($showticket) { Ticket::showCentralList(0, "process", true); } if (Session::haveRight('show_group_ticket','1')) { Ticket::showCentralList(0, "waiting", true); } if ($showproblem) { Problem::showCentralList(0, "process", true); } echo "
"; echo ""; echo "
"; if (Session::haveRight('show_group_ticket','1')) { Ticket::showCentralList(0, "toapprove", true); Ticket::showCentralList(0, "requestbyself", true); Ticket::showCentralList(0, "observed", true); } else { Ticket::showCentralList(0, "waiting", true); } echo "
"; } } ?>glpi-0.84.3+dfsg.1/inc/change.class.php000066400000000000000000001046571226600447100174510ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Change class class Change extends CommonITILObject { // From CommonDBTM public $dohistory = true; // From CommonITIL public $userlinkclass = 'Change_User'; public $grouplinkclass = 'Change_Group'; public $supplierlinkclass = 'Change_Supplier'; const MATRIX_FIELD = 'priority_matrix'; const URGENCY_MASK_FIELD = 'urgency_mask'; const IMPACT_MASK_FIELD = 'impact_mask'; const STATUS_MATRIX_FIELD = 'change_status'; /** * Name of the type * * @param $nb : number of item in the type (default 0) **/ static function getTypeName($nb=0) { return _n('Change','Changes',$nb); } function canAdminActors() { return Session::haveRight('edit_all_change', '1'); } function canAssign() { return Session::haveRight('edit_all_change', '1'); } function canAssignToMe() { return Session::haveRight('edit_all_change', '1'); } function canSolve() { return (self::isAllowedStatus($this->fields['status'], self::SOLVED) // No edition on closed status && !in_array($this->fields['status'], $this->getClosedStatusArray()) && (Session::haveRight("edit_all_change", "1") || (Session::haveRight('show_my_change', 1) && ($this->isUser(CommonITILActor::ASSIGN, Session::getLoginUserID()) || (isset($_SESSION["glpigroups"]) && $this->haveAGroup(CommonITILActor::ASSIGN, $_SESSION["glpigroups"])))))); } static function canCreate() { return Session::haveRight('edit_all_change', '1'); } static function canView() { return (Session::haveRight('edit_all_change', '1') || Session::haveRight('show_my_change', '1')); } /** * Is the current user have right to show the current change ? * * @return boolean **/ function canViewItem() { if (!Session::haveAccessToEntity($this->getEntityID())) { return false; } return (Session::haveRight('edit_all_change', 1) || (Session::haveRight('show_my_change', 1) && ($this->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID()) || $this->isUser(CommonITILActor::OBSERVER, Session::getLoginUserID()) || (isset($_SESSION["glpigroups"]) && ($this->haveAGroup(CommonITILActor::REQUESTER, $_SESSION["glpigroups"]) || $this->haveAGroup(CommonITILActor::OBSERVER, $_SESSION["glpigroups"]))) || ($this->isUser(CommonITILActor::ASSIGN, Session::getLoginUserID()) || (isset($_SESSION["glpigroups"]) && $this->haveAGroup(CommonITILActor::ASSIGN, $_SESSION["glpigroups"])))))); } /** * Is the current user have right to approve solution of the current change ? * * @return boolean **/ function canApprove() { return (($this->fields["users_id_recipient"] === Session::getLoginUserID()) || $this->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID()) || (isset($_SESSION["glpigroups"]) && $this->haveAGroup(CommonITILActor::REQUESTER, $_SESSION["glpigroups"]))); } /** * Is the current user have right to create the current change ? * * @return boolean **/ function canCreateItem() { if (!Session::haveAccessToEntity($this->getEntityID())) { return false; } return Session::haveRight('edit_all_change', 1); } function pre_deleteItem() { NotificationEvent::raiseEvent('delete', $this); return true; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (static::canView()) { $nb = 0; switch ($item->getType()) { case 'Problem' : if ($_SESSION['glpishow_count_on_tabs']) { $nb = countElementsInTable('glpi_changes_problems', "`problems_id` = '".$item->getID()."'"); } return self::createTabEntry(self::getTypeName(2), $nb); case 'Ticket' : if ($_SESSION['glpishow_count_on_tabs']) { $nb = countElementsInTable('glpi_changes_tickets', "`tickets_id` = '".$item->getID()."'"); } return self::createTabEntry(self::getTypeName(2), $nb); case __CLASS__ : return array (1 => __('Analysis'), 2 => __('Plans'), 3 => __('Solution')); } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($item->getType()) { case 'Problem' : Change_Problem::showForProblem($item); break; case 'Ticket' : Change_Ticket::showForTicket($item); break; case __CLASS__ : switch ($tabnum) { case 1 : $item->showAnalysisForm(); break; case 2 : $item->showPlanForm(); break; case 3 : if (!isset($_POST['load_kb_sol'])) { $_POST['load_kb_sol'] = 0; } $item->showSolutionForm($_POST['load_kb_sol']); break; } break; } return true; } function defineTabs($options=array()) { // show related tickets and changes $ong['empty'] = $this->getTypeName(1); $this->addStandardTab(__CLASS__, $ong, $options); $this->addStandardTab('ChangeTask', $ong, $options); $this->addStandardTab('Problem', $ong, $options); $this->addStandardTab('Ticket', $ong, $options); $this->addStandardTab('Document_Item', $ong, $options); $this->addStandardTab('Change_Item', $ong, $options); /// TODO add stats $this->addStandardTab('Note', $ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } function cleanDBonPurge() { global $DB; /// TODO uncomment when changetask OK // $query1 = "DELETE // FROM `glpi_changetasks` // WHERE `changes_id` = '".$this->fields['id']."'"; // $DB->query($query1); parent::cleanDBonPurge(); } function prepareInputForUpdate($input) { // Get change : need for comparison // $this->getFromDB($input['id']); $input = parent::prepareInputForUpdate($input); return $input; } function pre_updateInDB() { parent::pre_updateInDB(); } function post_updateItem($history=1) { global $CFG_GLPI; $donotif = false; if (isset($this->input['_forcenotif'])) { $donotif = true; } if (isset($this->input['_disablenotif'])) { $donotif = false; } if ($donotif && $CFG_GLPI["use_mailing"]) { $mailtype = "update"; if (isset($this->input["status"]) && $this->input["status"] && in_array("status",$this->updates) && ($this->input["status"] == self::SOLVED)) { $mailtype = "solved"; } if (isset($this->input["status"]) && $this->input["status"] && in_array("status",$this->updates) && ($this->input["status"] == self::CLOSED)) { $mailtype = "closed"; } // Read again change to be sure that all data are up to date $this->getFromDB($this->fields['id']); NotificationEvent::raiseEvent($mailtype, $this); } /// TODO auto solve tickets / changes ? } function prepareInputForAdd($input) { $input = parent::prepareInputForAdd($input); return $input; } function post_addItem() { global $CFG_GLPI; parent::post_addItem(); if (isset($this->input['_tickets_id'])) { $ticket = new Ticket(); if ($ticket->getFromDB($this->input['_tickets_id'])) { $pt = new Change_Ticket(); $pt->add(array('tickets_id' => $this->input['_tickets_id'], 'changes_id' => $this->fields['id'])); if (!empty($ticket->fields['itemtype']) && $ticket->fields['items_id']>0) { $it = new Change_Item(); $it->add(array('changes_id' => $this->fields['id'], 'itemtype' => $ticket->fields['itemtype'], 'items_id' => $ticket->fields['items_id'])); } } } if (isset($this->input['_problems_id'])) { $problem = new Problem(); if ($problem->getFromDB($this->input['_problems_id'])) { $cp = new Change_Problem(); $cp->add(array('problems_id' => $this->input['_problems_id'], 'changes_id' => $this->fields['id'])); /// TODO add linked tickets and linked hardware (to problem and tickets) /// create standard function } } // Processing Email if ($CFG_GLPI["use_mailing"]) { // Clean reload of the change $this->getFromDB($this->fields['id']); $type = "new"; if (isset($this->fields["status"]) && ($this->fields["status"] == self::SOLVED)) { $type = "solved"; } NotificationEvent::raiseEvent($type, $this); } } /** * Get default values to search engine to override **/ static function getDefaultSearchRequest() { $search = array('field' => array(0 => 12), 'searchtype' => array(0 => 'equals'), 'contains' => array(0 => 'notold'), 'sort' => 19, 'order' => 'DESC'); return $search; } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Title'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['searchtype'] = 'contains'; $tab[1]['massiveaction'] = false; $tab[21]['table'] = $this->getTable(); $tab[21]['field'] = 'content'; $tab[21]['name'] = __('Description'); $tab[21]['massiveaction'] = false; $tab[21]['datatype'] = 'text'; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab[12]['table'] = $this->getTable(); $tab[12]['field'] = 'status'; $tab[12]['name'] = __('Status'); $tab[12]['searchtype'] = 'equals'; $tab[12]['datatype'] = 'specific'; $tab[10]['table'] = $this->getTable(); $tab[10]['field'] = 'urgency'; $tab[10]['name'] = __('Urgency'); $tab[10]['searchtype'] = 'equals'; $tab[10]['datatype'] = 'specific'; $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'impact'; $tab[11]['name'] = __('Impact'); $tab[11]['searchtype'] = 'equals'; $tab[11]['datatype'] = 'specific'; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'priority'; $tab[3]['name'] = __('Priority'); $tab[3]['searchtype'] = 'equals'; $tab[3]['datatype'] = 'specific'; $tab[15]['table'] = $this->getTable(); $tab[15]['field'] = 'date'; $tab[15]['name'] = __('Opening date'); $tab[15]['datatype'] = 'datetime'; $tab[15]['massiveaction'] = false; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'closedate'; $tab[16]['name'] = __('Closing date'); $tab[16]['datatype'] = 'datetime'; $tab[16]['massiveaction'] = false; $tab[18]['table'] = $this->getTable(); $tab[18]['field'] = 'due_date'; $tab[18]['name'] = __('Due date'); $tab[18]['datatype'] = 'datetime'; $tab[18]['maybefuture'] = true; $tab[18]['massiveaction'] = false; $tab[17]['table'] = $this->getTable(); $tab[17]['field'] = 'solvedate'; $tab[17]['name'] = __('Resolution date'); $tab[17]['datatype'] = 'datetime'; $tab[17]['massiveaction'] = false; $tab[19]['table'] = $this->getTable(); $tab[19]['field'] = 'date_mod'; $tab[19]['name'] = __('Last update'); $tab[19]['datatype'] = 'datetime'; $tab[19]['massiveaction'] = false; $tab[7]['table'] = 'glpi_itilcategories'; $tab[7]['field'] = 'completename'; $tab[7]['name'] = __('Category'); $tab[7]['datatype'] = 'dropdown'; $tab[80]['table'] = 'glpi_entities'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = __('Entity'); $tab[80]['massiveaction'] = false; $tab[80]['datatype'] = 'dropdown'; $tab[45]['table'] = $this->getTable(); $tab[45]['field'] = 'actiontime'; $tab[45]['name'] = __('Total duration'); $tab[45]['datatype'] = 'timestamp'; $tab[45]['massiveaction'] = false; $tab[45]['nosearch'] = true; $tab[64]['table'] = 'glpi_users'; $tab[64]['field'] = 'name'; $tab[64]['linkfield'] = 'users_id_lastupdater'; $tab[64]['name'] = __('Last edit by'); $tab[64]['massiveaction'] = false; $tab[64]['datatype'] = 'dropdown'; $tab[64]['right'] = 'all'; $tab += $this->getSearchOptionsActors(); $tab['analysis'] = __('Control list'); $tab[60]['table'] = $this->getTable(); $tab[60]['field'] = 'impactcontent'; $tab[60]['name'] = __('Impact'); $tab[60]['massiveaction'] = false; $tab[60]['datatype'] = 'text'; $tab[61]['table'] = $this->getTable(); $tab[61]['field'] = 'controlistcontent'; $tab[61]['name'] = __('Control list'); $tab[61]['massiveaction'] = false; $tab[61]['datatype'] = 'text'; $tab[62]['table'] = $this->getTable(); $tab[62]['field'] = 'rolloutplancontent'; $tab[62]['name'] = __('Deployment plan'); $tab[62]['massiveaction'] = false; $tab[62]['datatype'] = 'text'; $tab[63]['table'] = $this->getTable(); $tab[63]['field'] = 'backoutplancontent'; $tab[63]['name'] = __('Backup plan'); $tab[63]['massiveaction'] = false; $tab[63]['datatype'] = 'text'; $tab[64]['table'] = $this->getTable(); $tab[64]['field'] = 'checklistcontent'; $tab[64]['name'] = __('Checklist'); $tab[64]['massiveaction'] = false; $tab[64]['datatype'] = 'text'; $tab[90]['table'] = $this->getTable(); $tab[90]['field'] = 'notepad'; $tab[90]['name'] = __('Notes'); $tab[90]['massiveaction'] = false; $tab[90]['datatype'] = 'text'; /// TODO define when task created // $tab['task'] = _n('Task', 'Tasks', 2); // // $tab[26]['table'] = 'glpi_changetasks'; // $tab[26]['field'] = 'content'; // $tab[26]['name'] = __('Task description'); // $tab[26]['forcegroupby'] = true; // $tab[26]['splititems'] = true; // $tab[26]['massiveaction'] = false; // $tab[26]['joinparams'] = array('jointype' => 'child'); // // $tab[28]['table'] = 'glpi_changetasks'; // $tab[28]['field'] = 'count'; // $tab[28]['name'] = __('Number of tasks'); // $tab[28]['forcegroupby'] = true; // $tab[28]['usehaving'] = true; // $tab[28]['datatype'] = 'number'; // $tab[28]['massiveaction'] = false; // $tab[28]['joinparams'] = array('jointype' => 'child'); // // $tab[20]['table'] = 'glpi_taskcategories'; // $tab[20]['field'] = 'name'; // $tab[20]['name'] = __('Task category'); // $tab[20]['forcegroupby'] = true; // $tab[20]['splititems'] = true; // $tab[20]['massiveaction'] = false; // $tab[20]['joinparams'] = array('beforejoin' // => array('table' => 'glpi_changetasks', // 'joinparams' => array('jointype' => 'child'))); $tab['solution'] = _n('Solution', 'Solutions', 1); $tab[23]['table'] = 'glpi_solutiontypes'; $tab[23]['field'] = 'name'; $tab[23]['name'] = __('Solution type'); $tab[23]['datatype'] = 'dropdown'; $tab[24]['table'] = $this->getTable(); $tab[24]['field'] = 'solution'; $tab[24]['name'] = _n('Solution', 'Solutions', 1); $tab[24]['datatype'] = 'text'; $tab[24]['htmltext'] = true; $tab[24]['massiveaction'] = false; return $tab; } /** * get the change status list * To be overridden by class * * @param $withmetaforsearch boolean (default false) * * @return an array **/ static function getAllStatusArray($withmetaforsearch=false) { // new, evaluation, approbation, process (sub status : test, qualification, applied), review, closed, abandoned /// TODO to be done : try to keep closed. Is abandonned usable ? /// TODO define standard function to check solved / closed status // To be overridden by class $tab = array(self::INCOMING => _x('change', 'New'), self::EVALUATION => __('Evaluation'), self::APPROVAL => __('Approval'), self::ACCEPTED => _x('change', 'Accepted'), self::WAITING => __('Pending'), // self::ACCEPTED => __('Processing (assigned)'), // self::PLANNED => __('Processing (planned)'), self::TEST => __('Test'), self::QUALIFICATION => __('Qualification'), self::SOLVED => __('Applied'), self::OBSERVED => __('Review'), self::CLOSED => _x('change', 'Closed'), // 'abandoned' => __('Abandonned'), // managed using dustbin ? ); if ($withmetaforsearch) { $tab['notold'] = _x('change', 'Not solved'); $tab['notclosed'] = _x('change', 'Not closed'); $tab['process'] = __('Processing'); $tab['old'] = _x('change', 'Solved + Closed'); $tab['all'] = __('All'); } return $tab; } /** * Get the ITIL object closed status list * To be overridden by class * * @since version 0.83 * * @return an array **/ static function getClosedStatusArray() { // To be overridden by class $tab = array(self::CLOSED/*, 'abandoned'*/); return $tab; } /** * Get the ITIL object solved or observe status list * To be overridden by class * * @since version 0.83 * * @return an array **/ static function getSolvedStatusArray() { // To be overridden by class $tab = array(self::OBSERVED, self::SOLVED); return $tab; } /** * Get the ITIL object new status list * * @since version 0.83.8 * * @return an array **/ static function getNewStatusArray() { return array(self::INCOMING, self::ACCEPTED, self::EVALUATION, self::APPROVAL); } /** * Get the ITIL object test, qualification or accepted status list * To be overridden by class * * @since version 0.83 * * @return an array **/ static function getProcessStatusArray() { // To be overridden by class $tab = array(self::ACCEPTED, self::QUALIFICATION, self::TEST); return $tab; } function showForm($ID, $options=array()) { global $CFG_GLPI, $DB; if (!static::canView()) { return false; } // Set default options if (!$ID) { $values = array('_users_id_requester' => Session::getLoginUserID(), '_users_id_requester_notif' => array('use_notification' => 1), '_groups_id_requester' => 0, '_users_id_assign' => 0, '_users_id_assign_notif' => array('use_notification' => 1), '_groups_id_assign' => 0, '_users_id_observer' => 0, '_users_id_observer_notif' => array('use_notification' => 1), '_groups_id_observer' => 0, '_suppliers_id_assign' => 0, 'priority' => 3, 'urgency' => 3, 'impact' => 3, 'content' => '', 'entities_id' => $_SESSION['glpiactive_entity'], 'name' => '', 'itilcategories_id' => 0); foreach ($values as $key => $val) { if (!isset($options[$key])) { $options[$key] = $val; } } if (isset($options['tickets_id'])) { $ticket = new Ticket(); if ($ticket->getFromDB($options['tickets_id'])) { $options['content'] = $ticket->getField('content'); $options['name'] = $ticket->getField('name'); $options['impact'] = $ticket->getField('impact'); $options['urgency'] = $ticket->getField('urgency'); $options['priority'] = $ticket->getField('priority'); $options['itilcategories_id'] = $ticket->getField('itilcategories_id'); } } if (isset($options['problems_id'])) { $problem = new Problem(); if ($problem->getFromDB($options['problems_id'])) { $options['content'] = $problem->getField('content'); $options['name'] = $problem->getField('name'); $options['impact'] = $problem->getField('impact'); $options['urgency'] = $problem->getField('urgency'); $options['priority'] = $problem->getField('priority'); $options['itilcategories_id'] = $problem->getField('itilcategories_id'); } } } if ($ID > 0) { $this->check($ID,'r'); } else { // Create item $this->check(-1,'w',$options); } $showuserlink = 0; if (Session::haveRight('user','r')) { $showuserlink = 1; } $this->showTabs($options); $this->showFormHeader($options); echo ""; echo ""; if (isset($options['tickets_id'])) { echo ""; } if (isset($options['problems_id'])) { echo ""; } echo ""; echo ""; echo ""; echo ""; if ($ID) { echo ""; } echo "
".__('Opening date').""; $date = $this->fields["date"]; if (!$ID) { $date = date("Y-m-d H:i:s"); } Html::showDateTimeFormItem("date", $date, 1, false); echo "
".__('By').""; User::dropdown(array('name' => 'users_id_recipient', 'value' => $this->fields["users_id_recipient"], 'entity' => $this->fields["entities_id"], 'right' => 'all')); echo "
"; echo ""; echo ""; echo ""; if ($ID) { echo ""; echo ""; } // SLA echo ""; echo ""; echo ""; if ($ID) { switch ($this->fields["status"]) { case self::CLOSED : echo ""; echo ""; echo ""; break; case self::SOLVED : case self::OBSERVED : echo ""; echo ""; echo ""; break; } } echo "
".__('Last update')."".Html::convDateTime($this->fields["date_mod"])."\n"; if ($this->fields['users_id_lastupdater'] > 0) { //TRANS: %s is the user name printf(__('By %s'), getUserName($this->fields["users_id_lastupdater"], $showuserlink)); } echo ""; echo "
".__('Due date').""; if ($this->fields["due_date"] == 'NULL') { $this->fields["due_date"] = ''; } Html::showDateTimeFormItem("due_date", $this->fields["due_date"], 1, true); echo "
".__('Close date').""; Html::showDateTimeFormItem("closedate", $this->fields["closedate"], 1, false); echo "
".__('Resolution date').""; Html::showDateTimeFormItem("solvedate", $this->fields["solvedate"], 1, false); echo "
"; echo ""; echo ""; echo "".__('Status').""; echo ""; self::dropdownStatus(array('value' => $this->fields["status"], 'showtype' => 'allowed')); echo ""; echo "".__('Urgency').""; echo ""; // Only change during creation OR when allowed to change priority OR when user is the creator $idurgency = self::dropdownUrgency(array('value' => $this->fields["urgency"])); echo ""; echo ""; echo ""; echo "".__('Category').""; echo ""; $opt = array('value' => $this->fields["itilcategories_id"], 'entity' => $this->fields["entities_id"]); ITILCategory::dropdown($opt); echo ""; echo "".__('Impact').""; echo ""; $idimpact = self::dropdownImpact(array('value' => $this->fields["impact"])); echo ""; echo ""; echo ""; echo "".__('Total duration').""; echo "".parent::getActionTime($this->fields["actiontime"]).""; echo "".__('Priority').""; echo ""; $idpriority = parent::dropdownPriority(array('value' => $this->fields["priority"], 'withmajor' => true)); $idajax = 'change_priority_' . mt_rand(); echo " "; $params = array('urgency' => '__VALUE0__', 'impact' => '__VALUE1__', 'priority' => $idpriority); Ajax::updateItemOnSelectEvent(array($idurgency, $idimpact), $idajax, $CFG_GLPI["root_doc"]."/ajax/priority.php", $params); echo ""; echo ""; echo ""; $this->showActorsPartForm($ID,$options); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $options['colspan'] = 3; $this->showFormButtons($options); $this->addDivForTabs(); return true; } /** * Form to add an analysis to a change **/ function showAnalysisForm() { $this->check($this->getField('id'), 'r'); $canedit = $this->can($this->getField('id'), 'w'); $options = array(); $options['canedit'] = false; $this->showFormHeader($options); echo ""; echo ""; echo ""; echo ""; $options['candel'] = false; $options['canedit'] = $canedit; $this->showFormButtons($options); } /** * Form to add an analysis to a change **/ function showPlanForm() { $this->check($this->getField('id'), 'r'); $canedit = $this->can($this->getField('id'), 'w'); $options = array(); $options['canedit'] = false; $this->showFormHeader($options); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $options['candel'] = false; $options['canedit'] = $canedit; $this->showFormButtons($options); } } ?> glpi-0.84.3+dfsg.1/inc/change_group.class.php000066400000000000000000000027261226600447100206570ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Change_Group class Change_Group extends CommonITILActor { // From CommonDBRelation static public $itemtype_1 = 'Change'; static public $items_id_1 = 'changes_id'; static public $itemtype_2 = 'Group'; static public $items_id_2 = 'groups_id'; } ?> glpi-0.84.3+dfsg.1/inc/change_item.class.php000066400000000000000000000221421226600447100204530ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // Relation between Changes and Items class Change_Item extends CommonDBRelation{ // From CommonDBRelation static public $itemtype_1 = 'Change'; static public $items_id_1 = 'changes_id'; static public $itemtype_2 = 'itemtype'; static public $items_id_2 = 'items_id'; static public $checkItem_2_Rights = self::DONT_CHECK_ITEM_RIGHTS; function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } function prepareInputForAdd($input) { // Well, if I remember my PHP: empty(0) == true ... if (empty($input['changes_id']) || ($input['changes_id'] == 0)) { return false; } // Avoid duplicate entry $restrict = "`changes_id` = '".$input['changes_id']."' AND `itemtype` = '".$input['itemtype']."' AND `items_id` = '".$input['items_id']."'"; if (countElementsInTable($this->getTable(),$restrict)>0) { return false; } return parent::prepareInputForAdd($input); } static function countForItem(CommonDBTM $item) { $restrict = "`glpi_changes_items`.`changes_id` = `glpi_changes`.`id` AND `glpi_changes_items`.`items_id` = '".$item->getField('id')."' AND `glpi_changes_items`.`itemtype` = '".$item->getType()."'". getEntitiesRestrictRequest(" AND ", "glpi_changes", '', '', true); $nb = countElementsInTable(array('glpi_changes_items', 'glpi_changes'), $restrict); return $nb ; } /** * Print the HTML array for Items linked to a change * * @param $change Change object * * @return Nothing (display) **/ static function showForChange(Change $change) { global $DB, $CFG_GLPI; $instID = $change->fields['id']; if (!$change->can($instID,'r')) { return false; } $canedit = $change->can($instID,'w'); $rand = mt_rand(); $query = "SELECT DISTINCT `itemtype` FROM `glpi_changes_items` WHERE `glpi_changes_items`.`changes_id` = '$instID' ORDER BY `itemtype`"; $result = $DB->query($query); $number = $DB->numrows($result); if ($canedit) { echo "
"; echo ""; echo "
".__('Title').""; $rand = mt_rand(); echo "\n"; echo "
\n"; if (empty($this->fields["name"])) { _e('Without title'); } else { echo $this->fields["name"]; } echo "
\n"; echo "
\n"; if (!$ID) { echo ""; } echo "
 
".__('Description').""; $rand = mt_rand(); echo "\n"; echo "
\n"; if (!empty($this->fields["content"])) { echo nl2br($this->fields["content"]); } else { _e('Empty description'); } echo "
\n"; echo "
\n"; if (!$ID) { echo ""; } echo "
 
".__('Impacts').""; if ($canedit) { echo ""; } else { echo $this->getField('impactcontent'); } echo "
".__('Control list').""; if ($canedit) { echo ""; } else { echo $this->getField('controlistcontent'); } echo "
".__('Deployment plan').""; if ($canedit) { echo ""; } else { echo $this->getField('rolloutplancontent'); } echo "
".__('Backup plan').""; if ($canedit) { echo ""; } else { echo $this->getField('backoutplancontent'); } echo "
".__('Checklist').""; if ($canedit) { echo ""; } else { echo $this->getField('checklistcontent'); } echo "
"; echo ""; echo ""; echo "
".__('Add an item')."
"; $types = array(); foreach ($change->getAllTypesForHelpdesk() as $key => $val) { $types[] = $key; } Dropdown::showAllItems("items_id", 0, 0, ($change->fields['is_recursive']?-1:$change->fields['entities_id']), $types); echo ""; echo ""; echo ""; echo "
"; Html::closeForm(); echo "
"; } echo "
"; if ($canedit && $number) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $massiveactionparams = array(); Html::showMassiveActions(__CLASS__, $massiveactionparams); } echo ""; echo ""; if ($canedit && $number) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; $totalnb = 0; for ($i=0 ; $i<$number ; $i++) { $itemtype = $DB->result($result, $i, "itemtype"); if (!($item = getItemForItemtype($itemtype))) { continue; } if ($item->canView()) { $itemtable = getTableForItemType($itemtype); $query = "SELECT `$itemtable`.*, `glpi_changes_items`.`id` AS IDD, `glpi_entities`.`id` AS entity FROM `glpi_changes_items`, `$itemtable`"; if ($itemtype != 'Entity') { $query .= " LEFT JOIN `glpi_entities` ON (`$itemtable`.`entities_id`=`glpi_entities`.`id`) "; } $query .= " WHERE `$itemtable`.`id` = `glpi_changes_items`.`items_id` AND `glpi_changes_items`.`itemtype` = '$itemtype' AND `glpi_changes_items`.`changes_id` = '$instID'"; if ($item->maybeTemplate()) { $query .= " AND `$itemtable`.`is_template` = '0'"; } $query .= getEntitiesRestrictRequest(" AND", $itemtable, '', '', $item->maybeRecursive())." ORDER BY `glpi_entities`.`completename`, `$itemtable`.`name`"; $result_linked = $DB->query($query); $nb = $DB->numrows($result_linked); for ($prem=true ; $data=$DB->fetch_assoc($result_linked) ; $prem=false) { $link = Toolbox::getItemTypeFormURL($itemtype); $linkname = $data["name"]; if ($_SESSION["glpiis_ids_visible"] || empty($data["name"])) { $linkname = sprintf(__('%1$s (%2$s)'), $linkname, $data["id"]); } $name = "".$linkname.""; echo ""; if ($canedit) { echo ""; } if ($prem) { $itemname = $item->getTypeName($nb); echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; } $totalnb += $nb; } } echo ""; echo " "; echo "
".Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand)."".__('Type')."".__('Entity')."".__('Name')."".__('Serial number')."".__('Inventory number')."
"; Html::showMassiveActionCheckBox(__CLASS__, $data["IDD"]); echo "". ($nb>1 ? sprintf(__('%1$s: %2$s'), $itemname, $nb) : $itemname).""; echo Dropdown::getDropdownName("glpi_entities", $data['entity'])."".$name."". (isset($data["serial"])? "".$data["serial"]."" :"-")."". (isset($data["otherserial"])? "".$data["otherserial"]."" :"-")."
". (($totalnb > 0) ? sprintf(__('%1$s = %2$s'), __('Total'), $totalnb) : " "); echo " 
"; if ($canedit && $number) { $paramsma['ontop'] = false; Html::showMassiveActions(__CLASS__, $paramsma); Html::closeForm(); } echo "
"; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { switch ($item->getType()) { case 'Change' : return _n('Item', 'Items', 2); } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType() == 'Change') { self::showForChange($item); } return true; } } ?>glpi-0.84.3+dfsg.1/inc/change_problem.class.php000066400000000000000000000252411226600447100211600ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * @since version 0.84 **/ class Change_Problem extends CommonDBRelation{ // From CommonDBRelation static public $itemtype_1 = 'Change'; static public $items_id_1 = 'changes_id'; static public $itemtype_2 = 'Problem'; static public $items_id_2 = 'problems_id'; function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } static function getTypeName($nb=0) { return _n('Link Problem/Change','Links Problem/Change',$nb); } /** * Get search function for the class * * @return array of search option **/ function getSearchOptions() { return parent::getSearchOptions(); } /** * Show tickets for a problem * * @param $problem Problem object **/ static function showForProblem(Problem $problem) { global $DB, $CFG_GLPI; $ID = $problem->getField('id'); if (!$problem->can($ID,'r')) { return false; } $canedit = $problem->can($ID,'w'); $rand = mt_rand(); $showentities = Session::isMultiEntitiesMode(); $query = "SELECT DISTINCT `glpi_changes_problems`.`id` AS linkID, `glpi_changes`.* FROM `glpi_changes_problems` LEFT JOIN `glpi_changes` ON (`glpi_changes_problems`.`changes_id` = `glpi_changes`.`id`) WHERE `glpi_changes_problems`.`problems_id` = '$ID' ORDER BY `glpi_changes`.`name`"; $result = $DB->query($query); $changes = array(); $used = array(); if ($numrows = $DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $changes[$data['id']] = $data; $used[$data['id']] = $data['id']; } } if ($canedit) { echo "
"; echo ""; echo ""; echo ""; echo "
".__('Add a change')."
"; echo ""; Change::dropdown(array('used' => $used, 'entity' => $problem->getEntityID(), 'entity_sons' => $problem->isRecursive())); echo ""; echo ""; echo ""; echo ""; _e('Create a change from this problem'); echo ""; echo "
"; Html::closeForm(); echo "
"; } echo "
"; if ($canedit && $numrows) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $massiveactionparams = array('num_displayed' => $numrows); Html::showMassiveActions(__CLASS__, $massiveactionparams); } echo ""; echo ""; if ($canedit && $numrows) { echo ""; } echo ""; if ($showentities) { echo ""; } echo ""; $used = array(); if ($numrows) { Session::initNavigateListItems('Change', //TRANS : %1$s is the itemtype name, // %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), Problem::getTypeName(1), $problem->fields["name"])); foreach ($changes as $data) { Session::addToNavigateListItems('Change', $data["id"]); echo ""; if ($canedit) { echo ""; } echo ""; if ($showentities) { echo ""; } echo ""; } } echo "
".Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand).""._n('Change', 'Changes', 2); echo "".__('Entity')."
"; Html::showMassiveActionCheckBox(__CLASS__, $data["linkID"]); echo "". $data["name"]."".Dropdown::getDropdownName('glpi_entities', $data["entities_id"])."
"; if ($canedit && $numrows) { $massiveactionparams['ontop'] = false; Html::showMassiveActions(__CLASS__, $massiveactionparams); Html::closeForm(); } echo "
"; } /** * Show problems for a change * * @param $change Change object **/ static function showForChange(Change $change) { global $DB, $CFG_GLPI; $ID = $change->getField('id'); if (!$change->can($ID,'r')) { return false; } $canedit = $change->can($ID,'w'); $rand = mt_rand(); $showentities = Session::isMultiEntitiesMode(); $query = "SELECT DISTINCT `glpi_changes_problems`.`id` AS linkID, `glpi_problems`.* FROM `glpi_changes_problems` LEFT JOIN `glpi_problems` ON (`glpi_changes_problems`.`problems_id` = `glpi_problems`.`id`) WHERE `glpi_changes_problems`.`changes_id` = '$ID' ORDER BY `glpi_problems`.`name`"; $result = $DB->query($query); $problems = array(); $used = array(); if ($numrows = $DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $problems[$data['id']] = $data; $used[$data['id']] = $data['id']; } } if ($canedit) { echo "
"; echo ""; echo ""; echo ""; echo "
".__('Add a problem')."
"; echo ""; Problem::dropdown(array('used' => $used, 'entity' => $change->getEntityID())); echo ""; echo ""; echo "
"; Html::closeForm(); echo "
"; } echo "
"; if ($canedit && $numrows) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $massiveactionparams = array('num_displayed' => $numrows); Html::showMassiveActions(__CLASS__, $massiveactionparams); } echo ""; echo ""; if ($canedit && $numrows) { echo ""; } echo ""; if ($showentities) { echo ""; } echo ""; $used = array(); if ($numrows) { Session::initNavigateListItems('Problem', //TRANS : %1$s is the itemtype name, // %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), Change::getTypeName(1), $change->fields["name"])); foreach ($problems as $data) { Session::addToNavigateListItems('Problem', $data["id"]); echo ""; if ($canedit) { echo ""; } echo ""; if ($showentities) { echo ""; } echo ""; } } echo "
".Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand).""._n('Problem', 'Problems', 2)."".__('Entity')."
"; Html::showMassiveActionCheckBox(__CLASS__, $data["linkID"]); echo "". $data["name"]."".Dropdown::getDropdownName('glpi_entities', $data["entities_id"])."
"; if ($canedit && $numrows) { $massiveactionparams['ontop'] = false; Html::showMassiveActions(__CLASS__, $massiveactionparams); Html::closeForm(); } echo "
"; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (Session::haveRight("show_all_problem","1")) { $nb = 0; switch ($item->getType()) { case 'Change' : if ($_SESSION['glpishow_count_on_tabs']) { $nb = countElementsInTable('glpi_changes_problems', "`changes_id` = '".$item->getID()."'"); } return self::createTabEntry(self::getTypeName(2), $nb); } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($item->getType()) { case 'Change' : self::showForChange($item); break; } return true; } } ?> glpi-0.84.3+dfsg.1/inc/change_supplier.class.php000066400000000000000000000030111226600447100213520ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Class Change_Supplier * * @since version 0.84 * **/ class Change_Supplier extends CommonITILActor { // From CommonDBRelation static public $itemtype_1 = 'Change'; static public $items_id_1 = 'changes_id'; static public $itemtype_2 = 'Supplier'; static public $items_id_2 = 'suppliers_id'; } ?> glpi-0.84.3+dfsg.1/inc/change_ticket.class.php000066400000000000000000000231371226600447100210050ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class Change_Ticket extends CommonDBRelation{ // From CommonDBRelation static public $itemtype_1 = 'Change'; static public $items_id_1 = 'changes_id'; static public $itemtype_2 = 'Ticket'; static public $items_id_2 = 'tickets_id'; function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } static function getTypeName($nb=0) { return _n('Link Ticket/Change','Links Ticket/Change',$nb); } /** * Get search function for the class * * @return array of search option **/ function getSearchOptions() { return parent::getSearchOptions(); } /** * Show tickets for a change * * @param $change Change object **/ static function showForChange(Change $change) { global $DB, $CFG_GLPI; $ID = $change->getField('id'); if (!$change->can($ID,'r')) { return false; } $canedit = $change->can($ID,'w'); $rand = mt_rand(); echo Toolbox::getItemTypeFormURL(__CLASS__)."'>"; $query = "SELECT DISTINCT `glpi_changes_tickets`.`id` AS linkID, `glpi_tickets`.* FROM `glpi_changes_tickets` LEFT JOIN `glpi_tickets` ON (`glpi_changes_tickets`.`tickets_id` = `glpi_tickets`.`id`) WHERE `glpi_changes_tickets`.`changes_id` = '$ID' ORDER BY `glpi_tickets`.`name`"; $result = $DB->query($query); $tickets = array(); $used = array(); if ($numrows = $DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $tickets[$data['id']] = $data; $used[$data['id']] = $data['id']; } } if ($canedit) { echo "
"; echo ""; echo ""; echo ""; echo ""; echo "
".__('Add a ticket')."
"; echo ""; Ticket::dropdown(array('used' => $used, 'entity' => $change->getEntityID(), 'entity_sons' => $change->isRecursive())); echo ""; echo ""; echo "
"; Html::closeForm(); echo "
"; } echo "
"; if ($canedit && $numrows) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $massiveactionparams = array('num_displayed' => $numrows); Html::showMassiveActions(__CLASS__, $massiveactionparams); } echo ""; echo ""; if ($canedit && $numrows) { echo ""; } echo ""; if ($change->isRecursive()) { echo ""; } echo ""; $used = array(); if ($numrows) { Session::initNavigateListItems('Ticket', //TRANS : %1$s is the itemtype name, // %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), Change::getTypeName(1), $change->fields["name"])); foreach ($tickets as $data) { Session::addToNavigateListItems('Ticket', $data["id"]); echo ""; if ($canedit) { echo ""; } echo ""; if ($change->isRecursive()) { echo ""; } echo ""; } } echo "
".Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand)."".__('Title')."".__('Entity')."
"; Html::showMassiveActionCheckBox(__CLASS__, $data["linkID"]); echo "". $data["name"]."".Dropdown::getDropdownName('glpi_entities',$data["entities_id"])."
"; if ($canedit && $numrows) { $massiveactionparams['ontop'] = false; Html::showMassiveActions(__CLASS__, $massiveactionparams); Html::closeForm(); } echo "
"; } /** * Show changes for a ticket * * @param $ticket Ticket object **/ static function showForTicket(Ticket $ticket) { global $DB, $CFG_GLPI; $ID = $ticket->getField('id'); if (!$ticket->can($ID,'r')) { return false; } $canedit = $ticket->can($ID,'w'); $rand = mt_rand(); echo Toolbox::getItemTypeFormURL(__CLASS__)."'>"; $query = "SELECT DISTINCT `glpi_changes_tickets`.`id` AS linkID, `glpi_changes`.* FROM `glpi_changes_tickets` LEFT JOIN `glpi_changes` ON (`glpi_changes_tickets`.`changes_id` = `glpi_changes`.`id`) WHERE `glpi_changes_tickets`.`tickets_id` = '$ID' ORDER BY `glpi_changes`.`name`"; $result = $DB->query($query); $changes = array(); $used = array(); if ($numrows = $DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $changes[$data['id']] = $data; $used[$data['id']] = $data['id']; } } if ($canedit) { echo "
"; echo ""; echo ""; echo ""; echo "
".__('Add a change')."
"; echo ""; Change::dropdown(array('used' => $used, 'entity' => $ticket->getEntityID())); echo ""; echo ""; echo ""; echo ""; _e('Create a change from this ticket'); echo ""; echo "
"; Html::closeForm(); echo "
"; } echo "
"; if ($canedit && $numrows) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $massiveactionparams = array('num_displayed' => $numrows); Html::showMassiveActions(__CLASS__, $massiveactionparams); } echo ""; echo ""; if ($canedit && $numrows) { echo ""; } echo ""; echo ""; $used = array(); if ($numrows) { Session::initNavigateListItems('Change', //TRANS : %1$s is the itemtype name, %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), Ticket::getTypeName(1), $ticket->fields["name"])); foreach ($changes as $data) { $used[$data['id']] = $data['id']; Session::addToNavigateListItems('Change', $data["id"]); echo ""; if ($canedit) { echo ""; } echo ""; echo ""; } } echo "
".Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand)."".__('Title')."
"; Html::showMassiveActionCheckBox(__CLASS__, $data["linkID"]); echo "". $data["name"]."
"; if ($canedit && $numrows) { $massiveactionparams['ontop'] = false; Html::showMassiveActions(__CLASS__, $massiveactionparams); Html::closeForm(); } echo "
"; } } ?> glpi-0.84.3+dfsg.1/inc/change_user.class.php000066400000000000000000000027211226600447100204740ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Change_User class Change_User extends CommonITILActor { // From CommonDBRelation static public $itemtype_1 = 'Change'; static public $items_id_1 = 'changes_id'; static public $itemtype_2 = 'User'; static public $items_id_2 = 'users_id'; } ?> glpi-0.84.3+dfsg.1/inc/changetask.class.php000066400000000000000000000114261226600447100203230ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class ChangeTask extends CommonITILTask { /** * @since version 0.84 **/ static function getTypeName($nb=0) { return _n('Change task', 'Change tasks', $nb); } static function canCreate() { return (Session::haveRight('show_my_change', '1') || Session::haveRight('edit_all_change', '1')); } static function canView() { return (Session::haveRight('show_all_change', 1) || Session::haveRight('show_my_change', 1)); } static function canUpdate() { return (Session::haveRight('edit_all_change', 1) || Session::haveRight('show_my_change', 1)); } function canViewPrivates() { return true; } function canEditAll() { return Session::haveRight('edit_all_change', 1); } /** * Is the current user have right to show the current task ? * * @return boolean **/ function canViewItem() { return parent::canReadITILItem(); } /** * Is the current user have right to create the current task ? * * @return boolean **/ function canCreateItem() { if (!parent::canReadITILItem()) { return false; } $change = new Change(); if ($change->getFromDB($this->fields['changes_id'])) { return (Session::haveRight("edit_all_change", "1") || (Session::haveRight("show_my_change", "1") && ($change->isUser(CommonITILActor::ASSIGN, Session::getLoginUserID()) || (isset($_SESSION["glpigroups"]) && $change->haveAGroup(CommonITILActor::ASSIGN, $_SESSION['glpigroups']))))); } return false; } /** * Is the current user have right to update the current task ? * * @return boolean **/ function canUpdateItem() { if (!parent::canReadITILItem()) { return false; } if (($this->fields["users_id"] != Session::getLoginUserID()) && !Session::haveRight('edit_all_change', 1)) { return false; } return true; } /** * Is the current user have right to delete the current task ? * * @return boolean **/ function canDeleteItem() { return $this->canUpdateItem(); } /** * Populate the planning with planned ticket tasks * * @param $options array of possible options: * - who ID of the user (0 = undefined) * - who_group ID of the group of users (0 = undefined) * - begin Date * - end Date * * @return array of planning item **/ static function populatePlanning($options=array()) { return parent::genericPopulatePlanning('ChangeTask', $options); } /** * Display a Planning Item * * @param $val array of the item to display * * @return Already planned information **/ static function getAlreadyPlannedInformation($val) { return parent::genericGetAlreadyPlannedInformation('ChangeTask', $val); } /** * Display a Planning Item * * @param $val array of the item to display * @param $who ID of the user (0 if all) * @param $type position of the item in the time block (in, through, begin or end) * (default '') * @param $complete complete display (more details) (default 0) * * @return Nothing (display function) **/ static function displayPlanningItem(array $val, $who, $type="", $complete=0) { return parent::genericDisplayPlanningItem('ChangeTask',$val, $who, $type, $complete); } } ?>glpi-0.84.3+dfsg.1/inc/commondbchild.class.php000066400000000000000000000530601226600447100210150ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Common DataBase Relation Table Manager Class abstract class CommonDBChild extends CommonDBConnexity { // Mapping between DB fields // * definition static public $itemtype; // Class name or field name (start with itemtype) for link to Parent static public $items_id; // Field name // * rights static public $checkParentRights = self::HAVE_SAME_RIGHT_ON_ITEM; static public $mustBeAttached = true; // * log static public $logs_for_parent = true; static public $log_history_add = Log::HISTORY_ADD_SUBITEM; static public $log_history_update = Log::HISTORY_UPDATE_SUBITEM; static public $log_history_delete = Log::HISTORY_DELETE_SUBITEM; static public $log_history_lock = Log::HISTORY_LOCK_SUBITEM; static public $log_history_unlock = Log::HISTORY_UNLOCK_SUBITEM; /** * @since version 0.84 * * @param $itemtype * @param $items_id * * @return string **/ static function getSQLRequestToSearchForItem($itemtype, $items_id) { $conditions = array(); $fields = array('`'.static::getIndexName().'`'); // Check item 1 type $condition_id = "`".static::$items_id."` = '$items_id'"; $fields[] = "`".static::$items_id."` as items_id"; if (preg_match('/^itemtype/', static::$itemtype)) { $fields[] = "`".static::$itemtype."` AS itemtype"; $condition = "($condition_id AND `".static::$itemtype."` = '$itemtype')"; } else { $fields[] = "'".static::$itemtype."' AS itemtype"; if (($itemtype == static::$itemtype) || is_subclass_of($itemtype, static::$itemtype)) { $condition = $condition_id; } } if (isset($condition)) { return "SELECT ".implode(', ', $fields)." FROM `".static::getTable()."` WHERE $condition"; } return ''; } /** * @since version 0.84 **/ static function canCreate() { return static::canChild('canUpdate'); } /** * @since version 0.84 **/ static function canView() { return static::canChild('canView'); } /** * @since version 0.84 **/ static function canUpdate() { return static::canChild('canUpdate'); } /** * @since version 0.84 **/ static function canDelete() { return static::canChild('canUpdate'); } /** * @since version 0.84 **/ function canCreateItem() { return $this->canChildItem('canUpdateItem', 'canUpdate'); } /** * @since version 0.84 **/ function canViewItem() { return $this->canChildItem('canViewItem', 'canView'); } /** * @since version 0.84 **/ function canUpdateItem() { return $this->canChildItem('canUpdateItem', 'canUpdate'); } /** * @since version 0.84 **/ function canDeleteItem() { return $this->canChildItem('canUpdateItem', 'canUpdate'); } /** * @since version 0.84 * * @param $method **/ static function canChild($method) { return static::canConnexity($method, static::$checkParentRights, static::$itemtype, static::$items_id); } /** * @since version 0.84 * * @param $methodItem * @param $methodNotItem * * @return boolean **/ function canChildItem($methodItem, $methodNotItem) { try { return static::canConnexityItem($methodItem, $methodNotItem, static::$checkParentRights, static::$itemtype, static::$items_id, $item); } catch (CommonDBConnexityItemNotFound $e) { return !static::$mustBeAttached; } } /** * Get the item associated with the current object. Rely on CommonDBConnexity::getItemFromArray() * * @since version 0.84 * * @param $getFromDB (true by default) * @param $getEmpty (true by default) * * @return object of the concerned item or false on error **/ function getItem($getFromDB=true, $getEmpty=true) { return $this->getConnexityItem(static::$itemtype, static::$items_id, $getFromDB, $getEmpty); } /** * \brief recursively display the items of this * * @param $recursiveItems array of the items of the current elements (see recursivelyGetItems()) * @param $elementToDisplay what to display : 'Type', 'Name', 'Link' **/ static function displayRecursiveItems(array $recursiveItems, $elementToDisplay) { if ((!is_array($recursiveItems)) || (count($recursiveItems) == 0)) { _e('Item not linked to an object'); return; } switch ($elementToDisplay) { case 'Type' : $masterItem = $recursiveItems[count($recursiveItems) - 1]; echo $masterItem->getTypeName(1); break; case 'Name' : case 'Link' : $items_elements = array(); foreach ($recursiveItems as $item) { if ($elementToDisplay == 'Name') { $items_elements[] = $item->getName(); } else { $items_elements[] = $item->getLink(); } } echo implode(' < ', $items_elements); break; } } /** * Get all the items associated with the current object by recursive requests * * @since version 0.84 * * @return an array containing all the items **/ function recursivelyGetItems() { $item = $this->getItem(); if ($item !== false) { if ($item instanceof CommonDBChild) { return array_merge(array($item), $item->recursivelyGetItems()); } return array($item); } return array(); } /** * Get the ID of entity assigned to the object * * @return ID of the entity **/ function getEntityID () { // Case of Duplicate Entity info to child if (parent::isEntityAssign()) { return parent::getEntityID(); } $item = $this->getItem(); if (($item !== false) && ($item->isEntityAssign())) { return $item->getEntityID(); } return -1; } function isEntityAssign() { // Case of Duplicate Entity info to child if (parent::isEntityAssign()) { return true; } $item = $this->getItem(false); if ($item !== false) { return $item->isEntityAssign(); } return false; } /** * Is the object may be recursive * * @return boolean **/ function maybeRecursive() { // Case of Duplicate Entity info to child if (parent::maybeRecursive()) { return true; } $item = $this->getItem(false); if ($item !== false) { return $item->maybeRecursive(); } return false; } /** * Is the object recursive * * @return booleanDONT_CHECK_ITEM_RIGHTS **/ function isRecursive () { // Case of Duplicate Entity info to child if (parent::maybeRecursive()) { return parent::isRecursive(); } $item = $this->getItem(); if ($item !== false) { return $item->isRecursive(); } return false; } /** * @since version 0.84 **/ function addNeededInfoToInput($input) { // is entity missing and forwarding on ? if ($this->tryEntityForwarding() && !isset($input['entities_id'])) { // Merge both arrays to ensure all the fields are defined for the following checks $completeinput = array_merge($this->fields, $input); // Set the item to allow parent::prepareinputforadd to get the right item ... if ($itemToGetEntity = static::getItemFromArray(static::$itemtype, static::$items_id, $completeinput)) { if (($itemToGetEntity instanceof CommonDBTM) && $itemToGetEntity->isEntityForwardTo(get_called_class())) { $input['entities_id'] = $itemToGetEntity->getEntityID(); $input['is_recursive'] = intval($itemToGetEntity->isRecursive()); } else { // No entity link : set default values $input['entities_id'] = 0; $input['is_recursive'] = 0; } } } return $input; } /** * @since version 0.84 **/ function prepareInputForAdd($input) { if (!is_array($input)) { return false; } return $this->addNeededInfoToInput($input); } /** * @since version 0.84 **/ function prepareInputForUpdate($input) { if (!is_array($input)) { return false; } // True if item changed if (!parent::checkAttachedItemChangesAllowed($input, array(static::$itemtype, static::$items_id))) { return false; } return parent::addNeededInfoToInput($input); } /** * Get the history name of item * * @param $item the other item * @param $case : can be overwrite by object * - 'add' when this CommonDBChild is added (to and item) * - 'update item previous' transfert : this is removed from the old item * - 'update item next' transfert : this is added to the new item * - 'delete' when this CommonDBChild is remove (from an item) * * @return (string) the name of the entry for the database (ie. : correctly slashed) **/ function getHistoryNameForItem(CommonDBTM $item, $case) { return $this->getNameID(array('forceid' => true, 'additional' => true)); } /** * Actions done after the ADD of the item in the database * * @return nothing **/ function post_addItem() { if ((isset($this->input['_no_history']) && $this->input['_no_history']) || !static::$logs_for_parent) { return; } $item = $this->getItem(); if (($item !== false) && $item->dohistory) { $changes[0] = '0'; $changes[1] = ""; $changes[2] = $this->getHistoryNameForItem($item, 'add'); Log::history($item->getID(), $item->getType(), $changes, $this->getType(), static::$log_history_add); } } /** * Actions done after the UPDATE of the item in the database * * @since version 0.84 * * @param $history store changes history ? (default 1) * * @return nothing **/ function post_updateItem($history=1) { if ((isset($this->input['_no_history']) && $this->input['_no_history']) || !static::$logs_for_parent) { return; } $items_for_log = $this->getItemsForLog(static::$itemtype, static::$items_id); // Whatever case : we log the changes $oldvalues = $this->oldvalues; unset($oldvalues[static::$itemtype]); unset($oldvalues[static::$items_id]); $item = $items_for_log['new']; if (($item !== false) && $item->dohistory) { foreach ($oldvalues as $field => $value) { $changes = $this->getHistoryChangeWhenUpdateField($field); if ((!is_array($changes)) || (count($changes) != 3)) { continue; } Log::history($item->getID(), $item->getType(), $changes, $this->getType(), static::$log_history_update); } } if (isset($items_for_log['previous'])) { // Have updated the connexity relation $prevItem = $items_for_log['previous']; $newItem = $items_for_log['new']; if (($prevItem !== false) && $prevItem->dohistory) { $changes[0] = '0'; $changes[1] = addslashes($this->getHistoryNameForItem($prevItem, 'update item previous')); $changes[2] = ''; Log::history($prevItem->getID(), $prevItem->getType(), $changes, $this->getType(), static::$log_history_delete); } if (($newItem !== false) && $newItem->dohistory) { $changes[0] = '0'; $changes[1] = ''; $changes[2] = addslashes($this->getHistoryNameForItem($newItem, 'update item next')); Log::history($newItem->getID(), $newItem->getType(), $changes, $this->getType(), static::$log_history_add); } } } /** * Actions done after the DELETE of the item in the database * *@return nothing **/ function post_deleteFromDB() { if ((isset($this->input['_no_history']) && $this->input['_no_history']) || !static::$logs_for_parent) { return; } $item = $this->getItem(); if (($item !== false) && $item->dohistory) { $changes[0] = '0'; if (static::$log_history_delete == Log::HISTORY_LOG_SIMPLE_MESSAGE) { $changes[1] = ''; $changes[2] = addslashes($this->getHistoryNameForItem($item, 'delete')); } else { $changes[1] = addslashes($this->getHistoryNameForItem($item, 'delete')); $changes[2] = ''; } Log::history($item->getID(), $item->getType(), $changes, $this->getType(), static::$log_history_delete); } } /** * Actions done when item flag deleted is set to an item * * @since version 0.84 * * @return nothing **/ function cleanDBonMarkDeleted() { if ((isset($this->input['_no_history']) && $this->input['_no_history']) || !static::$logs_for_parent) { return; } if ($this->useDeletedToLockIfDynamic() && $this->isDynamic()) { $item = $this->getItem(); if (($item !== false) && $item->dohistory) { $changes[0] = '0'; $changes[1] = addslashes($this->getHistoryNameForItem($item, 'lock')); $changes[2] = ''; Log::history($item->getID(), $item->getType(), $changes, $this->getType(), static::$log_history_lock); } } } /** * Actions done after the restore of the item * * @since version 0.84 * * @return nothing **/ function post_restoreItem() { if ((isset($this->input['_no_history']) && $this->input['_no_history']) || !static::$logs_for_parent) { return; } if ($this->useDeletedToLockIfDynamic() && $this->isDynamic()) { $item = $this->getItem(); if (($item !== false) && $item->dohistory) { $changes[0] = '0'; $changes[1] = ''; $changes[2] = addslashes($this->getHistoryNameForItem($item, 'unlock')); Log::history($item->getID(), $item->getType(), $changes, $this->getType(), static::$log_history_unlock); } } } /** * get the Javascript "code" to add to the form when clicking on "+" * * @since version 0.84 * * @see showAddChildButtonForItemForm() * * @param $field_name the name of the HTML field inside Item's form * @param $child_count_js_var the name of the javascript variable containing current child number * of items * * @return (string) the code **/ static function getJSCodeToAddForItemChild($field_name, $child_count_js_var) { return ""; } /** * display the field of a given child * * @since version 0.84 * * @see showChildsForItemForm() * * @param $canedit true if we can edit the child * @param $field_name the name of the HTML field inside Item's form * * @return nothing (display only) **/ function showChildForItemForm($canedit, $field_name) { if ($this->isNewID($this->getID())) { $value = ''; } else { $value = $this->getName(); } if ($canedit) { echo ""; } else { echo "$value" ; } } /** * We can add several single CommonDBChild to a given Item. In such case, we display a "+" * button and the fields already entered * This method display the "+" button * * @since version 0.84 * * @todo study if we cannot use these methods for the user emails * @see showChildsForItemForm(CommonDBTM $item, $field_name) * * @param $item CommonDBTM object: the item on which to add the current CommenDBChild * @param $field_name the name of the HTML field inside Item's form * @param $canedit (default NULL) NULL to use default behaviour * * @return nothing (display only) **/ static function showAddChildButtonForItemForm(CommonDBTM $item, $field_name, $canedit=NULL) { global $CFG_GLPI; $items_id = $item->getID(); if (is_null($canedit)) { if ($item->isNewItem()) { if (!$item->canCreate()) { return false; } $canedit = $item->canUpdate(); } else { if (!$item->can($items_id,'r')) { return false; } $canedit = $item->can($items_id,"w"); } } if ($canedit) { $lower_name = strtolower(get_called_class()); $child_count_js_var = 'nb'.$lower_name.'s'; $div_id = "add_".$lower_name."_to_".$item->getType()."_".$items_id; echo " "; echo "". "\""." . static::getJSCodeToAddForItemChild($field_name, $child_count_js_var)."'); $child_count_js_var++;\" class='pointer' src='".$CFG_GLPI["root_doc"]."/pics/add_dropdown.png'>"; } } /** * We can add several single CommonDBChild to a given Item. In such case, we display a "+" * button and the fields already entered. * This method display the fields * * @since version 0.84 * * @todo study if we cannot use these methods for the user emails * @see showAddChildButtonForItemForm() * * @param $item CommonDBTM object the item on which to add the current CommenDBChild * @param $field_name the name of the HTML field inside Item's form * @param $canedit (default NULL) NULL to use default behaviour * * @return nothing (display only) **/ static function showChildsForItemForm(CommonDBTM $item, $field_name, $canedit=NULL) { global $DB, $CFG_GLPI; $items_id = $item->getID(); if (is_null($canedit)) { if ($item->isNewItem()) { if (!$item->canCreate()) { return false; } $canedit = $item->canUpdate(); } else { if (!$item->can($items_id,'r')) { return false; } $canedit = $item->can($items_id,"w"); } } $lower_name = strtolower(get_called_class()); $div_id = "add_".$lower_name."_to_".$item->getType()."_".$items_id; // To be sure not to load bad datas from this table if ($items_id == 0) { $items_id = -99; } $query = "SELECT * FROM `" . static::getTable() . "` WHERE `".static::$items_id."` = '".$item->getID()."'"; if (preg_match('/^itemtype/', static::$itemtype)) { $query .= " AND `itemtype` = '".$item->getType()."'"; } $current_item = new static(); if ($current_item->maybeDeleted()) { $query .= " AND `is_deleted` = '0'"; } $count = 0; foreach ($DB->request($query) as $data) { $current_item->fields = $data; if ($count) { echo '
'; } $count++; $current_item->showChildForItemForm($canedit, $field_name . "[" . $current_item->getID() . "]"); } if ($canedit) { echo "
"; // No Child display field if ($count == 0) { $current_item->getEmpty(); $current_item->showChildForItemForm($canedit, $field_name . "[-100]"); } echo "
"; } } } ?> glpi-0.84.3+dfsg.1/inc/commondbconnexity.class.php000066400000000000000000000354051226600447100217550ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * @since version 0.84 **/ class CommonDBConnexityItemNotFound extends Exception { } /** * Common DataBase Connexity Table Manager Class * This class factorize code for CommonDBChild and CommonDBRelation. Both classes themselves * factorize and normalize the behaviour of all Child and Relations. * As such, several elements are directly managed by these two classes since 0.84 : * - Check: all can* methods (canCreate, canUpdate, canViewItem, canDeleteItem ...) are * defined. * - Update: when we try to update an attached element, we check if we change its parent item(s). * If we change its parent(s), then we check if we can delete the item with previous * parent(s) (cf. "check" before) AND we can create the item with the new parent(s). * - Entity: Entity is automatically setted or updated when setting or changing an attached item. * Thus, you don't have any more to worry about entities. * (May be disable using $disableAutoEntityForwarding) * - Log: when we create, update or delete an item, we update its parent(s)'s histories to * notify them of the creation, update or deletion * - Flying items : some items can be on the stock. For instance, before beeing plugged inside a * computer, an Item_DeviceProcessor can be without any parent. It is now possible * to define such items and transfer them from parent to parent. * * The aim of the new check is that the rights on a Child or a Relation are driven by the * parent(s): you can create, delete or update the item if and only if you can update its parent(s); * you can view the item if and only if you can view its parent(s). Beware that it differs from the * default behaviour of CommonDBTM: if you don't define canUpdate or canDelete, then it checks * canCreate and by default canCreate returns false (thus, if you don't do anything, you don't have * any right). A side effect is that if you define specific rights (see NetworkName::canCreate()) * for your classes you must define all rights (canCreate, canView, canUpdate and canDelete). * * @warning You have to care of calling CommonDBChild or CommonDBRelation methods if you override * their methods (for instance: call parent::prepareInputForAdd($input) if you define * prepareInputForAdd). You can find an example with UserEmail::prepareInputForAdd($input). * * @since 0.84 **/ abstract class CommonDBConnexity extends CommonDBTM { const DONT_CHECK_ITEM_RIGHTS = 1; // Don't check the parent => always can*Child const HAVE_VIEW_RIGHT_ON_ITEM = 2; // canXXXChild = true if parent::canView == true const HAVE_SAME_RIGHT_ON_ITEM = 3; // canXXXChild = true if parent::canXXX == true static public $canDeleteOnItemClean = true; /// Disable auto forwarding information about entities ? static public $disableAutoEntityForwarding = false; /** * Return the SQL request to get all the connexities corresponding to $itemtype[$items_id] * That is used by cleanDBOnItem : the only interesting field is static::getIndexName() * But CommonDBRelation also use it to get more complex result * * @param $itemtype the type of the item to look for * @param $items_id the id of the item to look for * * @return the SQL request of '' if it is not possible **/ static function getSQLRequestToSearchForItem($itemtype, $items_id) { return ''; } /** * Clean the Connecity Table when item of the relation is deleted * To be call from the cleanDBonPurge of each Item class * * @param $itemtype type of the item * @param $items_id id of the item **/ function cleanDBonItemDelete ($itemtype, $items_id) { global $DB; $query = static::getSQLRequestToSearchForItem($itemtype, $items_id); if (!empty($query)) { $input = array('_no_history' => true, '_no_notif' => true); foreach ($DB->request($query) as $data) { $input[$this->getIndexName()] = $data[$this->getIndexName()]; $this->delete($input, 1); } } } /** * get associated item (defined by $itemtype and $items_id) * * @see CommonDBConnexity::getItemFromArray() * * @param $itemtype the name of the field of the type of the item to get * @param $items_id the name of the field of the id of the item to get * @param $getFromDB boolean do we have to load the item from the DB ? (true by default) * @param $getEmpty boolean else : do we have to load an empty item ? (true by default) * * @return the item or false if we cannot load the item **/ function getConnexityItem($itemtype, $items_id, $getFromDB=true, $getEmpty=true) { return static::getItemFromArray($itemtype, $items_id, $this->fields, $getFromDB, $getEmpty); } /** * get associated item (defined by $itemtype and $items_id) * * @param $itemtype the name of the field of the type of the item to get * @param $items_id the name of the field of the id of the item to get * @param $array array the array in we have to search ($input, $this->fields ...) * @param $getFromDB boolean do we have to load the item from the DB ? (true by default) * @param $getEmpty boolean else : do we have to load an empty item ? (true by default) * * @return the item or false if we cannot load the item **/ static function getItemFromArray($itemtype, $items_id, array $array, $getFromDB=true, $getEmpty=true) { if (preg_match('/^itemtype/', $itemtype)) { if (isset($array[$itemtype])) { $type = $array[$itemtype]; } else { $type = ''; } } else { $type = $itemtype; } $item = getItemForItemtype($type); if ($item !== false) { if ($getFromDB) { if ((isset($array[$items_id])) && ($item->getFromDB($array[$items_id]))) { return $item; } } else if ($getEmpty) { if ($item->getEmpty()) { return $item; } } else { return $item; } unset($item); } return false; } /** * Factorization of prepareInputForUpdate for CommonDBRelation and CommonDBChild. Just check if * we can change the item * * @warning if the update is not possible (right problem), then $input become false * * @param $input array the new values for the current item * @param $fields array list of fields that define the attached items * * @return true if the attached item has changed, false if the attached items has not changed **/ function checkAttachedItemChangesAllowed(array $input, array $fields) { // Merge both arrays to ensure all the fields are defined for the following checks $input = array_merge($this->fields, $input); $have_to_check = false; foreach ($fields as $field_name) { if ((isset($this->fields[$field_name])) && ($input[$field_name] != $this->fields[$field_name])) { $have_to_check = true; break; } } if ($have_to_check) { $new_item = clone $this; // Solution 1 : If we cannot create the new item or delete the old item, // then we cannot update the item unset($new_item->fields); if ((!$new_item->can(-1, 'w', $input)) || (!$this->can($this->getID(), 'd'))) { Session::addMessageAfterRedirect(__('Cannot update item: not enough right on the parent(s) item(s)'), INFO, true); return false; } // Solution 2 : simple check ! Can we update the item with new values ? // if (!$new_item->can($input['id'], 'w')) { // Session::addMessageAfterRedirect(__('Cannot update item: not enough right on the parent(s) item(s)'), // INFO, true); // return false; // } } return true; } /** * Is auto entityForwarding needed ? * * @return boolean **/ function tryEntityForwarding() { return (!static::$disableAutoEntityForwarding && $this->isEntityAssign()); } /** * Factorization of canCreate, canView, canUpate and canDelete. It checks the ability to * create, view, update or delete the item if it is possible (ie : $itemtype != 'itemtype') * * The aim is that the rights are driven by the attached item : if we can do the action on the * item, then we can do the action of the CommonDBChild or the CommonDBRelation. Thus, it is the * inverse of CommonDBTM's behaviour, that, by default forbid any action (cf. * CommonDBTM::canCreate and CommonDBTM::canView) * * @warning By default, if the action is possible regarding the attaching item, then it is * possible on the CommonDBChild and the CommonDBRelation. * * @param $method the method to check (canCreate, canView, canUpdate of canDelete) * @param $item_right the right to check (DONT_CHECK_ITEM_RIGHTS, HAVE_VIEW_RIGHT_ON_ITEM ...) * @param $itemtype the name of the field of the type of the item to get * @param $items_id the name of the field of the id of the item to get * * @return true if we have absolute right to create the current connexity **/ static function canConnexity($method, $item_right, $itemtype, $items_id) { if (($item_right != self::DONT_CHECK_ITEM_RIGHTS) &&(!preg_match('/^itemtype/', $itemtype))) { if ($item_right == self::HAVE_VIEW_RIGHT_ON_ITEM) { $method = 'canView'; } if (!$itemtype::$method()) { return false; } } return true; } /** * Factorization of canCreateItem, canViewItem, canUpateItem and canDeleteItem. It checks the * ability to create, view, update or delete the item. If we cannot check the item (none is * existing), then we can do the action of the current connexity * * @param $methodItem the method to check (canCreateItem, canViewItem, canUpdateItem of canDeleteItem) * @param $methodNotItem the method to check (canCreate, canView, canUpdate of canDelete) * @param $item_right the right to check (DONT_CHECK_ITEM_RIGHTS, HAVE_VIEW_RIGHT_ON_ITEM ...) * @param $itemtype the name of the field of the type of the item to get * @param $items_id the name of the field of the id of the item to get * @param &$item the item concerned by the item (default NULL) * * @return true if we have absolute right to create the current connexity **/ function canConnexityItem($methodItem, $methodNotItem, $item_right, $itemtype, $items_id, &$item=NULL) { // Do not get it twice if ($item == NULL) { $item = $this->getConnexityItem($itemtype, $items_id); } if ($item_right != self::DONT_CHECK_ITEM_RIGHTS) { if ($item !== false) { if ($item_right == self::HAVE_VIEW_RIGHT_ON_ITEM) { $methodNotItem = 'canView'; $methodItem = 'canViewItem'; } // here, we can check item's global rights if (preg_match('/^itemtype/', $itemtype)) { if (!$item->$methodNotItem()) { return false; } } return $item->$methodItem(); } else { // if we cannot get the parent, then we throw an exception throw new CommonDBConnexityItemNotFound(); } } return true; } /** * @since version 0.84 * * Get the change values for history when only the fields of the CommonDBChild are updated * @warning can be call as many time as fields are updated * * @param $field the name of the field that has changed * * @return array as the third parameter of Log::history() method or false if we don't want to * log for the given field **/ function getHistoryChangeWhenUpdateField($field) { return array('0', addslashes($this->oldvalues[$field]), addslashes($this->fields[$field])); } /** * Factorized method to search difference when updating a connexity : return both previous * item and new item if both are different. Otherwise returns new items * * @param $itemtype the name of the field of the type of the item to get * @param $items_id the name of the field of the id of the item to get * * @return array containing "previous" (if exists) and "new". Beware that both can be equal * to false **/ function getItemsForLog($itemtype, $items_id) { $newItemArray[$items_id] = $this->fields[$items_id]; if (isset($this->oldvalues[$items_id])) { $previousItemArray[$items_id] = $this->oldvalues[$items_id]; } else { $previousItemArray[$items_id] = $this->fields[$items_id]; } if (preg_match('/^itemtype/', $itemtype)) { $newItemArray[$itemtype] = $this->fields[$itemtype]; if (isset($this->oldvalues[$itemtype])) { $previousItemArray[$itemtype] = $this->oldvalues[$itemtype]; } else { $previousItemArray[$itemtype] = $this->fields[$itemtype]; } } $result = array('new' => self::getItemFromArray($itemtype, $items_id, $newItemArray)); if ($previousItemArray !== $newItemArray) { $result['previous'] = self::getItemFromArray($itemtype, $items_id, $previousItemArray); } return $result; } } ?> glpi-0.84.3+dfsg.1/inc/commondbrelation.class.php000066400000000000000000001012661226600447100215510ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Common DataBase Relation Table Manager Class abstract class CommonDBRelation extends CommonDBConnexity { // Item 1 information // * definition static public $itemtype_1; // Type ref or field name (must start with itemtype) static public $items_id_1; // Field name // * entity inheritance static public $take_entity_1 = true ; // * rights static public $checkItem_1_Rights = self::HAVE_SAME_RIGHT_ON_ITEM ; static public $mustBeAttached_1 = true; // * log static public $logs_for_item_1 = true; static public $log_history_1_add = Log::HISTORY_ADD_RELATION; static public $log_history_1_update = Log::HISTORY_UPDATE_RELATION; static public $log_history_1_delete = Log::HISTORY_DEL_RELATION; static public $log_history_1_lock = Log::HISTORY_LOCK_RELATION; static public $log_history_1_unlock = Log::HISTORY_UNLOCK_RELATION; // Item 2 information // * definition static public $itemtype_2; // Type ref or field name (must start with itemtype) static public $items_id_2; // Field name // * entity inheritance static public $take_entity_2 = false ; // * rights static public $checkItem_2_Rights = self::HAVE_SAME_RIGHT_ON_ITEM; static public $mustBeAttached_2 = true; // * log static public $logs_for_item_2 = true; static public $log_history_2_add = Log::HISTORY_ADD_RELATION; static public $log_history_2_update = Log::HISTORY_UPDATE_RELATION; static public $log_history_2_delete = Log::HISTORY_DEL_RELATION; static public $log_history_2_lock = Log::HISTORY_LOCK_RELATION; static public $log_history_2_unlock = Log::HISTORY_UNLOCK_RELATION; // Relation between items to check /// If both items must be checked for rights (default is only one) static public $checkAlwaysBothItems = false; /// If both items must be in viewable each other entities static public $check_entity_coherency = true; var $no_form_page = true; /** * @since version 0.84 * * @param $itemtype * @param $items_id * * @return string **/ static function getSQLRequestToSearchForItem($itemtype, $items_id) { $conditions = array(); $fields = array('`'.static::getIndexName().'`'); // Check item 1 type $condition_id_1 = "`".static::$items_id_1."` = '$items_id'"; $fields[] = "`".static::$items_id_1."` as items_id_1"; if (preg_match('/^itemtype/', static::$itemtype_1)) { $fields[] = "`".static::$itemtype_1."` AS itemtype_1"; $condition_1 = "($condition_id_1 AND `".static::$itemtype_1."` = '$itemtype')"; } else { $fields[] = "'".static::$itemtype_1."' AS itemtype_1"; if (($itemtype == static::$itemtype_1) || is_subclass_of($itemtype, static::$itemtype_1)) { $condition_1 = $condition_id_1; } } if (isset($condition_1)) { $conditions[] = $condition_1; $fields[] = "IF($condition_1, 1, 0) AS is_1"; } else { $fields[] = "0 AS is_1"; } // Check item 2 type $condition_id_2 = "`".static::$items_id_2."` = '$items_id'"; $fields[] = "`".static::$items_id_2."` as items_id_2"; if (preg_match('/^itemtype/', static::$itemtype_2)) { $fields[] = "`".static::$itemtype_2."` AS itemtype_2"; $condition_2 = "($condition_id_2 AND `".static::$itemtype_2."` = '$itemtype')"; } else { $fields[] = "'".static::$itemtype_2."' AS itemtype_2"; if (($itemtype == static::$itemtype_2) || is_subclass_of($itemtype, static::$itemtype_2)) { $condition_2 = $condition_id_2; } } if (isset($condition_2)) { $conditions[] = $condition_2; $fields[] = "IF($condition_2, 2, 0) AS is_2"; } else { $fields[] = "0 AS is_2"; } if (count($conditions) != 0) { return "SELECT ".implode(', ', $fields)." FROM `".static::getTable()."` WHERE ".implode(' OR ', $conditions).""; } return ''; } /** * @since version 0.84 * * @param $item CommonDBTM object * @param $relations_id (default NULL) **/ static function getOpposite(CommonDBTM $item, &$relations_id=NULL) { return static::getOppositeByTypeAndID($item->getType(), $item->getID(), $relations_id); } /** * @since version 0.84 * * @param $itemtype Type of the item to search for its opposite * @param $items_id ID of the item to search for its opposite * @param $relations_id (default NULL) **/ static function getOppositeByTypeAndID($itemtype, $items_id, &$relations_id=NULL) { global $DB; if ($items_id < 0) { return false; } $query = self::getSQLRequestToSearchForItem($itemtype, $items_id); if (!empty($query)) { $result = $DB->query($query); if ($DB->numrows($result) == 1) { $line = $DB->fetch_assoc($result); if ($line['is_1'] == $line['is_2']) { return false; } if ($line['is_1'] == 0) { $opposites_id = $line['items_id_1']; $oppositetype = $line['itemtype_1']; } if ($line['is_2'] == 0) { $opposites_id = $line['items_id_2']; $oppositetype = $line['itemtype_2']; } if ((isset($oppositetype)) && (isset($opposites_id))) { $opposite = getItemForItemtype($oppositetype); if ($opposite !== false) { if ($opposite->getFromDB($opposites_id)) { if (!is_null($relations_id)) { $relations_id = $line[static::getIndexName()]; } return $opposite; } unset($opposite); } } } } return false; } /** * @since version 0.84 * * @param $number * * @return boolean **/ function getOnePeer($number) { if ($number = 0) { $itemtype = static::$itemtype_1; $items_id = static::$items_id_1; } else if ($number = 1) { $itemtype = static::$itemtype_2; $items_id = static::$items_id_2; } else { return false; } return $this->getConnexityItem($itemtype, $items_id); } /** * Get link object between 2 items * * @since version 0.84 * * @param $item1 object 1 * @param $item2 object 2 * * @return boolean founded ? **/ function getFromDBForItems(CommonDBTM $item1, CommonDBTM $item2) { // Check items ID if (($item1->getID() < 0) || ($item2->getID() < 0)) { return false; } $wheres = array(); $wheres[] = "`".static::$items_id_1."` = '".$item1->getID()."'"; $wheres[] = "`".static::$items_id_2."` = '".$item2->getID()."'"; // Check item 1 type if (preg_match('/^itemtype/', static::$itemtype_1)) { $wheres[] = "`".static::$itemtype_1."` = '".$item1->getType()."'"; } else if (!is_a($item1, static::$itemtype_1)) { return false; } // Check item 1 type if (preg_match('/^itemtype/', static::$itemtype_2)) { $wheres[] = "`".static::$itemtype_2."` = '".$item2->getType()."'"; } else if (!is_a($item2, static::$itemtype_2)) { return false; } return $this->getFromDBByQuery("WHERE ".implode(' AND ', $wheres)); } /** * Get search function for the class * * @return array of search option **/ function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; if (!preg_match('/^itemtype/', static::$itemtype_1)) { $tab[3]['table'] = getTableForItemType(static::$itemtype_1); $tab[3]['field'] = static::$items_id_1; $tab[3]['name'] = call_user_func(array(static::$itemtype_1, 'getTypeName')); $tab[3]['datatype'] = 'text'; $tab[3]['massiveaction'] = false; } if (!preg_match('/^itemtype/', static::$itemtype_2)) { $tab[4]['table'] = getTableForItemType(static::$itemtype_2); $tab[4]['field'] = static::$items_id_2; $tab[4]['name'] = call_user_func(array(static::$itemtype_2, 'getTypeName')); $tab[4]['datatype'] = 'text'; $tab[4]['massiveaction'] = false; } return $tab; } /** * Specific check for check attach for relation 2 * * @since version 0.84 * * @param $input Array of data to be added * * @return boolean **/ function isAttach2Valid(Array &$input) { return false; } /** * Specific check for check attach for relation 1 * * @since version 0.84 * * @param $input Array of data to be added * * @return boolean **/ function isAttach1Valid(Array &$input) { return false; } /** * @since version 0.84 * * @param $method * @param $forceCheckBoth boolean force check both items(false by default) * * @return boolean **/ static function canRelation($method, $forceCheckBoth=false) { $can1 = static::canConnexity($method, static::$checkItem_1_Rights, static::$itemtype_1, static::$items_id_1); $can2 = static::canConnexity($method, static::$checkItem_2_Rights, static::$itemtype_2, static::$items_id_2); /// Check only one if SAME RIGHT for both items and not force checkBoth if (((static::HAVE_SAME_RIGHT_ON_ITEM == static::$checkItem_1_Rights) && (static::HAVE_SAME_RIGHT_ON_ITEM == static::$checkItem_2_Rights)) && !$forceCheckBoth) { if ($can1) { // Can view the second one ? if (!static::canConnexity($method, static::HAVE_VIEW_RIGHT_ON_ITEM, static::$itemtype_2, static::$items_id_2)) { return false; } return true; } else if ($can2) { // Can view the first one ? if (!static::canConnexity($method, static::HAVE_VIEW_RIGHT_ON_ITEM, static::$itemtype_1, static::$items_id_1)) { return false; } return true; } else { // No item have right return false; } } return ($can1 && $can2); } /** * @since version 0.84 * * @param $method * @param $methodNotItem * @param $check_entity (true by default) * @param $forceCheckBoth boolean force check both items (false by default) * * @return boolean **/ function canRelationItem($method, $methodNotItem, $check_entity=true, $forceCheckBoth=false) { $OneWriteIsEnough = (!$forceCheckBoth && ((static::HAVE_SAME_RIGHT_ON_ITEM == static::$checkItem_1_Rights) || (static::HAVE_SAME_RIGHT_ON_ITEM == static::$checkItem_2_Rights))); try { $item1 = NULL; $can1 = $this->canConnexityItem($method, $methodNotItem, static::$checkItem_1_Rights, static::$itemtype_1, static::$items_id_1, $item1); if ($OneWriteIsEnough) { $view1 = $this->canConnexityItem($method, $methodNotItem, static::HAVE_VIEW_RIGHT_ON_ITEM, static::$itemtype_1, static::$items_id_1, $item1); } } catch (CommonDBConnexityItemNotFound $e) { if (static::$mustBeAttached_1 && !static::isAttach1Valid($this->fields)) { return false; } $can1 = true; $view1 = true; $check_entity = false; // If no item, then, we cannot check entities } try { $item2 = NULL; $can2 = $this->canConnexityItem($method, $methodNotItem, static::$checkItem_2_Rights, static::$itemtype_2, static::$items_id_2, $item2); if ($OneWriteIsEnough) { $view2 = $this->canConnexityItem($method, $methodNotItem, static::HAVE_VIEW_RIGHT_ON_ITEM, static::$itemtype_2, static::$items_id_2, $item2); } } catch (CommonDBConnexityItemNotFound $e) { if (static::$mustBeAttached_2 && !static::isAttach2Valid($this->fields)) { return false; } $can2 = true; $view2 = true; $check_entity = false; // If no item, then, we cannot check entities } if ($OneWriteIsEnough) { if ((!$can1 && !$can2) || ($can1 && !$view2) || ($can2 && !$view1)) { return false; } } else { if (!$can1 || !$can2) { return false; } } // Check coherency of entities if ($check_entity && static::$check_entity_coherency) { // If one of both extremity is not valid => not allowed ! // (default is only to check on create and update not for view and delete) if ((!$item1 instanceof CommonDBTM) || (!$item2 instanceof CommonDBTM)) { return false; } if ($item1->isEntityAssign() && $item2->isEntityAssign()) { $entity1 = $item1->getEntityID(); $entity2 = $item2->getEntityID(); if ($entity1 == $entity2) { return true; } if (($item1->isRecursive()) && in_array($entity1, getAncestorsOf("glpi_entities", $entity2))) { return true; } if (($item2->isRecursive()) && in_array($entity2, getAncestorsOf("glpi_entities", $entity1))) { return true; } return false; } } return true; } /** * @since version 0.84 **/ static function canCreate() { return static::canRelation('canUpdate', static::$checkAlwaysBothItems); } /** * @since version 0.84 **/ static function canView() { // Always both checks for view return static::canRelation('canView', true); } /** * @since version 0.84 **/ static function canUpdate() { return static::canRelation('canUpdate', static::$checkAlwaysBothItems); } /** * @since version 0.84 **/ static function canDelete() { return static::canRelation('canUpdate', static::$checkAlwaysBothItems); } /** * @since version 0.84 **/ function canCreateItem() { return $this->canRelationItem('canUpdateItem', 'canUpdate', true, static::$checkAlwaysBothItems); } /** * @since version 0.84 **/ function canViewItem() { return $this->canRelationItem('canViewItem', 'canView', false, true); } /** * @since version 0.84 **/ function canUpdateItem() { return $this->canRelationItem('canUpdateItem', 'canUpdate', true, static::$checkAlwaysBothItems); } /** * @since version 0.84 **/ function canDeleteItem() { return $this->canRelationItem('canUpdateItem', 'canUpdate', false, static::$checkAlwaysBothItems); } /** * @since version 0.84 **/ function addNeededInfoToInput($input) { // is entity missing and forwarding on ? if ($this->tryEntityForwarding() && !isset($input['entities_id'])) { // Merge both arrays to ensure all the fields are defined for the following checks $completeinput = array_merge($this->fields, $input); $itemToGetEntity = false; // Set the item to allow parent::prepareinputforadd to get the right item ... if (static::$take_entity_1) { $itemToGetEntity = static::getItemFromArray(static::$itemtype_1, static::$items_id_1, $completeinput); } else if (static::$take_entity_2) { $itemToGetEntity = static::getItemFromArray(static::$itemtype_2, static::$items_id_2, $completeinput); } // Set the item to allow parent::prepareinputforadd to get the right item ... if (($itemToGetEntity instanceof CommonDBTM) && $itemToGetEntity->isEntityForwardTo(get_called_class())) { $input['entities_id'] = $itemToGetEntity->getEntityID(); $input['is_recursive'] = intval($itemToGetEntity->isRecursive()); } else { // No entity link : set default values $input['entities_id'] = 0; $input['is_recursive'] = 0; } } return $input; } /** * @since version 0.84 * * @param $input **/ function prepareInputForAdd($input) { if (!is_array($input)) { return false; } return $this->addNeededInfoToInput($input); } /** * @since version 0.84 **/ function prepareInputForUpdate($input) { if (!is_array($input)) { return false; } // True if item changed if (!parent::checkAttachedItemChangesAllowed($input, array(static::$itemtype_1, static::$items_id_1, static::$itemtype_2, static::$items_id_2))) { return false; } return parent::addNeededInfoToInput($input); } /** * Get the history name of first item * * @since version 0.84 * * @param $item CommonDBTM object the other item (ie. : $item2) * @param $case : can be overwrite by object * - 'add' when this CommonDBRelation is added (to and item) * - 'update item previous' transfert : this is removed from the old item * - 'update item next' transfert : this is added to the new item * - 'delete' when this CommonDBRelation is remove (from an item) * * @return (string) the name of the entry for the database (ie. : correctly slashed) **/ function getHistoryNameForItem1(CommonDBTM $item, $case) { return $item->getNameID(array('forceid' => true, 'additional' => true)); } /** * Get the history name of second item * * @since version 0.84 * * @param $item the other item (ie. : $item1) * @param $case : can be overwrite by object * - 'add' when this CommonDBRelation is added (to and item) * - 'update item previous' transfert : this is removed from the old item * - 'update item next' transfert : this is added to the new item * - 'delete' when this CommonDBRelation is remove (from an item) * * @return (string) the name of the entry for the database (ie. : correctly slashed) **/ function getHistoryNameForItem2(CommonDBTM $item, $case) { return $item->getNameID(array('forceid' => true, 'additional' => true)); } /** * Actions done after the ADD of the item in the database * * @return nothing **/ function post_addItem() { if ((isset($this->input['_no_history']) && $this->input['_no_history']) || (!static::$logs_for_item_1 && !static::$logs_for_item_2)) { return; } $item1 = $this->getConnexityItem(static::$itemtype_1, static::$items_id_1); $item2 = $this->getConnexityItem(static::$itemtype_2, static::$items_id_2); if (($item1 !== false) && ($item2 !== false)) { if ($item1->dohistory && static::$logs_for_item_1) { $changes[0] = '0'; $changes[1] = ""; $changes[2] = addslashes($this->getHistoryNameForItem1($item2, 'add')); Log::history($item1->getID(), $item1->getType(), $changes, $item2->getType(), static::$log_history_1_add); } if ($item2->dohistory && static::$logs_for_item_2) { $changes[0] = '0'; $changes[1] = ""; $changes[2] = addslashes($this->getHistoryNameForItem2($item1, 'add')); Log::history($item2->getID(), $item2->getType(), $changes, $item1->getType(), static::$log_history_2_add); } } } /** * Actions done after the UPDATE of the item in the database * * @since version 0.84 * * @param $history store changes history ? (default 1) * * @return nothing **/ function post_updateItem($history=1) { if ((isset($this->input['_no_history']) && $this->input['_no_history']) || (!static::$logs_for_item_1 && !static::$logs_for_item_2)) { return; } $items_1 = $this->getItemsForLog(static::$itemtype_1, static::$items_id_1); $items_2 = $this->getItemsForLog(static::$itemtype_2, static::$items_id_2); $new1 = $items_1['new']; if (isset($items_1['previous'])) { $previous1 = $items_1['previous']; } else { $previous1 = $items_1['new']; } $new2 = $items_2['new']; if (isset($items_2['previous'])) { $previous2 = $items_2['previous']; } else { $previous2 = $items_2['new']; } $oldvalues = $this->oldvalues; unset($oldvalues[static::$itemtype_1]); unset($oldvalues[static::$items_id_1]); unset($oldvalues[static::$itemtype_2]); unset($oldvalues[static::$items_id_2]); foreach ($oldvalues as $field => $value) { $changes = $this->getHistoryChangeWhenUpdateField($field); if ((!is_array($changes)) || (count($changes) != 3)) { continue; } /// TODO clean management of it if ($new1 && $new1->dohistory && static::$logs_for_item_1) { Log::history($new1->getID(), $new1->getType(), $changes, get_called_class().'#'.$field, static::$log_history_1_update); } if ($new2 && $new2->dohistory && static::$logs_for_item_2) { Log::history($new2->getID(), $new2->getType(), $changes, get_called_class().'#'.$field, static::$log_history_2_update); } } if (isset($items_1['previous']) || isset($items_2['previous'])) { if ($previous2 && $previous1 && $previous1->dohistory && static::$logs_for_item_1) { $changes[0] = '0'; $changes[1] = addslashes($this->getHistoryNameForItem1($previous2, 'update item previous')); $changes[2] = ""; Log::history($previous1->getID(), $previous1->getType(), $changes, $previous2->getType(), static::$log_history_1_delete); } if ($previous1 && $previous2 && $previous2->dohistory && static::$logs_for_item_2) { $changes[0] = '0'; $changes[1] = addslashes($this->getHistoryNameForItem2($previous1, 'update item previous')); $changes[2] = ""; Log::history($previous2->getID(), $previous2->getType(), $changes, $previous1->getType(), static::$log_history_2_delete); } if ($new2 && $new1 && $new1->dohistory && static::$logs_for_item_1) { $changes[0] = '0'; $changes[1] = ""; $changes[2] = addslashes($this->getHistoryNameForItem1($new2, 'update item next')); Log::history($new1->getID(), $new1->getType(), $changes, $new2->getType(), static::$log_history_1_add); } if ($new1 && $new2 && $new2->dohistory && static::$logs_for_item_2) { $changes[0] = '0'; $changes[1] = ""; $changes[2] = addslashes($this->getHistoryNameForItem2($new1, 'update item next')); Log::history($new2->getID(), $new2->getType(), $changes, $new1->getType(), static::$log_history_2_add); } } } /** * Actions done when item flag deleted is set to an item * * @since version 0.84 * * @return nothing **/ function cleanDBonMarkDeleted() { if ((isset($this->input['_no_history']) && $this->input['_no_history']) || (!static::$logs_for_item_1 && !static::$logs_for_item_2)) { return; } if ($this->useDeletedToLockIfDynamic() && $this->isDynamic()) { $item1 = $this->getConnexityItem(static::$itemtype_1, static::$items_id_1); $item2 = $this->getConnexityItem(static::$itemtype_2, static::$items_id_2); if (($item1 !== false) && ($item2 !== false)) { if ($item1->dohistory && static::$logs_for_item_1) { $changes[0] = '0'; $changes[1] = addslashes($this->getHistoryNameForItem1($item2, 'lock')); $changes[2] = ""; Log::history($item1->getID(), $item1->getType(), $changes, $item2->getType(), static::$log_history_1_lock); } if ($item2->dohistory && static::$logs_for_item_2) { $changes[0] = '0'; $changes[1] = addslashes($this->getHistoryNameForItem2($item1, 'lock')); $changes[2] = ""; Log::history($item2->getID(), $item2->getType(), $changes, $item1->getType(), static::$log_history_2_lock); } } } } /** * Actions done after the restore of the item * * @since version 0.84 * * @return nothing **/ function post_restoreItem() { if ((isset($this->input['_no_history']) && $this->input['_no_history']) || (!static::$logs_for_item_1 && !static::$logs_for_item_2)) { return; } if ($this->useDeletedToLockIfDynamic() && $this->isDynamic()) { $item1 = $this->getConnexityItem(static::$itemtype_1, static::$items_id_1); $item2 = $this->getConnexityItem(static::$itemtype_2, static::$items_id_2); if (($item1 !== false) && ($item2 !== false)) { if ($item1->dohistory && static::$logs_for_item_1) { $changes[0] = '0'; $changes[1] = ''; $changes[2] = addslashes($this->getHistoryNameForItem1($item2, 'unlock')); Log::history($item1->getID(), $item1->getType(), $changes, $item2->getType(), static::$log_history_1_unlock); } if ($item2->dohistory && static::$logs_for_item_2) { $changes[0] = '0'; $changes[1] = ''; $changes[2] = addslashes($this->getHistoryNameForItem2($item1, 'unlock')); Log::history($item2->getID(), $item2->getType(), $changes, $item1->getType(), static::$log_history_2_unlock); } } } } /** * Actions done after the DELETE of the item in the database * * @since version 0.84 * *@return nothing **/ function post_deleteFromDB() { if ((isset($this->input['_no_history']) && $this->input['_no_history']) || (!static::$logs_for_item_1 && !static::$logs_for_item_2)) { return; } $item1 = $this->getConnexityItem(static::$itemtype_1, static::$items_id_1); $item2 = $this->getConnexityItem(static::$itemtype_2, static::$items_id_2); if (($item1 !== false) && ($item2 !== false)) { if ($item1->dohistory && static::$logs_for_item_1) { $changes[0] = '0'; $changes[1] = addslashes($this->getHistoryNameForItem1($item2, 'delete')); $changes[2] = ""; Log::history($item1->getID(), $item1->getType(), $changes, $item2->getType(), static::$log_history_1_delete); } if ($item2->dohistory && static::$logs_for_item_2) { $changes[0] = '0'; $changes[1] = addslashes($this->getHistoryNameForItem2($item1, 'delete')); $changes[2] = ""; Log::history($item2->getID(), $item2->getType(), $changes, $item1->getType(), static::$log_history_2_delete); } } } /** * @since version 0.84 * * @param $itemtype * @param $base HTMLTableBase object * @param $super HTMLTableSuperHeader object (default NULL) * @param $father HTMLTableHeader object (default NULL) * @param $options array **/ static function getHTMLTableHeader($itemtype, HTMLTableBase $base, HTMLTableSuperHeader $super=NULL, HTMLTableHeader $father=NULL, array $options=array()) { if (isset($options[get_called_class().'_side'])) { $side = $options[get_called_class().'_side']; } else { $side = 0; } $oppositetype = ''; if (($side == 1) || ($itemtype == static::$itemtype_1)) { $oppositetype = static::$itemtype_2; } if (($side == 2) || ($itemtype == static::$itemtype_2)) { $oppositetype = static::$itemtype_1; } if (class_exists($oppositetype) && method_exists($oppositetype, 'getHTMLTableHeader')) { $oppositetype::getHTMLTableHeader(get_called_class(), $base, $super, $father, $options); } } /** * @since version 0.84 * * @param $row HTMLTableRow object (default NULL) * @param $item CommonDBTM object (default NULL) * @param $father HTMLTableCell object (default NULL) * @param $options array **/ static function getHTMLTableCellsForItem(HTMLTableRow $row=NULL, CommonDBTM $item=NULL, HTMLTableCell $father=NULL, array $options=array()) { global $DB, $CFG_GLPI; if (empty($item)) { if (empty($father)) { return; } $item = $father->getItem(); } $query = self::getSQLRequestToSearchForItem($item->getType(), $item->getID()); if (!empty($query)) { $relation = new static(); foreach ($DB->request($query) as $line) { if ($line['is_1'] != $line['is_2']) { if ($line['is_1'] == 0) { $options['items_id'] = $line['items_id_1']; $oppositetype = $line['itemtype_1']; } else { $options['items_id'] = $line['items_id_2']; $oppositetype = $line['itemtype_2']; } if (class_exists($oppositetype) && method_exists($oppositetype, 'getHTMLTableCellsForItem') && $relation->getFromDB($line[static::getIndexName()])) { $oppositetype::getHTMLTableCellsForItem($row, $relation, $father, $options); } } } } } } ?> glpi-0.84.3+dfsg.1/inc/commondbtm.class.php000066400000000000000000004463241226600447100203630ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** @file * @brief */ /** * Common DataBase Table Manager Class - Persistent Object */ class CommonDBTM extends CommonGLPI { /// Data of the Item var $fields = array(); /// Make an history of the changes var $dohistory = false; /// Black list fields for history log or date mod update var $history_blacklist = array(); /// Set false to desactivate automatic message on action var $auto_message_on_action = true; /// Set true to desactivate link generation because form page do not permit show/edit item var $no_form_page = false; /// Set true to desactivate auto compute table name static protected $notable = false; ///Additional fiedls for dictionnary processing var $additional_fields_for_dictionnary = array(); /// Forward entity datas to linked items static protected $forward_entity_to = array(); /// Foreign key field cache : set dynamically calling getForeignKeyField protected $fkfield = ""; ///Forward entity to plugins itemtypes static protected $plugins_forward_entity = array(); const SUCCESS = 0; //Process is OK const TYPE_MISMATCH = 1; //Type is not good, value cannot be inserted const ERROR_FIELDSIZE_EXCEEDED = 2; //Value is bigger than the field's size const HAS_DUPLICATE = 3; //Can insert or update because it's duplicating another item const NOTHING_TO_DO = 4; //Nothing to insert or update /** * Constructor **/ function __construct () { } /** * Return the table used to stor this object * * @return string **/ static function getTable() { if (static::$notable) { return ''; } if (empty($_SESSION['glpi_table_of'][get_called_class()])) { $_SESSION['glpi_table_of'][get_called_class()] = getTableForItemType(get_called_class()); } return $_SESSION['glpi_table_of'][get_called_class()]; } /** * force table value (used for config management for old versions) * * @param $table name of the table to be forced * * @return nothing **/ static function forceTable($table) { $_SESSION['glpi_table_of'][get_called_class()] = $table; } static function getForeignKeyField() { if (empty($_SESSION['glpi_foreign_key_field_of'][get_called_class()])) { $_SESSION['glpi_foreign_key_field_of'][get_called_class()] = getForeignKeyFieldForTable(static::getTable()); } return $_SESSION['glpi_foreign_key_field_of'][get_called_class()]; } /** * Retrieve an item from the database * * @param $ID ID of the item to get * * @return true if succeed else false **/ function getFromDB($ID) { global $DB; // Make new database object and fill variables // != 0 because 0 is consider as empty if (strlen($ID) == 0) { return false; } return $this->getFromDBByQuery("WHERE `" . $this->getTable() . "`.`" . $this->getIndexName() . "` = '" . Toolbox::cleanInteger($ID) . "' LIMIT 1"); } /** * Retrieve an item from the database by query. The query must include the WHERE keyword. Thus, * we can replace "WHERE" to make complex SQL JOINED queries (for instance, see * User::getFromDBbyEmail()). * * @since version 0.84 * * @param $query the "WHERE" or "JOIN" part of the SQL query * * @return true if succeed else false **/ function getFromDBByQuery($query) { global $DB; // Make new database object and fill variables if (empty($query)) { return false; } $query = "SELECT `".$this->getTable()."`.* FROM `".$this->getTable()."` $query"; if ($result = $DB->query($query)) { if ($DB->numrows($result) == 1) { $this->fields = $DB->fetch_assoc($result); $this->post_getFromDB(); return true; } } return false; } /** * Get the identifier of the current item * * @return ID **/ function getID() { if (isset($this->fields[static::getIndexName()])) { return $this->fields[static::getIndexName()]; } return -1; } /** * Actions done at the end of the getFromDB function * * @return nothing **/ function post_getFromDB() { } /** * Retrieve all items from the database * * @param $condition condition used to search if needed (empty get all) (default '') * @param $order order field if needed (default '') * @param $limit limit retrieved datas if needed (default '') * * @return true if succeed else false **/ function find($condition="", $order="", $limit="") { global $DB; // Make new database object and fill variables $query = "SELECT * FROM `".$this->getTable()."`"; if (!empty($condition)) { $query .= " WHERE $condition"; } if (!empty($order)) { $query .= " ORDER BY $order"; } if (!empty($limit)) { $query .= " LIMIT ".intval($limit); } $data = array(); if ($result = $DB->query($query)) { if ($DB->numrows($result)) { while ($line = $DB->fetch_assoc($result)) { $data[$line['id']] = $line; } } } return $data; } /** * Get the name of the index field * * @return name of the index field **/ static function getIndexName() { return "id"; } /** * Get an empty item * *@return true if succeed else false **/ function getEmpty() { global $DB; //make an empty database object $table = $this->getTable(); if (!empty($table) && ($fields = $DB->list_fields($table))) { foreach ($fields as $key => $val) { $this->fields[$key] = ""; } } else { return false; } if (array_key_exists('entities_id',$this->fields) && isset($_SESSION["glpiactive_entity"])) { $this->fields['entities_id'] = $_SESSION["glpiactive_entity"]; } $this->post_getEmpty(); // Call the plugin hook - $this->fields can be altered Plugin::doHook("item_empty", $this); return true; } /** * Actions done at the end of the getEmpty function * * @return nothing **/ function post_getEmpty() { } /** * Get type to register log on * * @since version 0.83 * * @return array of type + ID **/ function getLogTypeID() { return array($this->getType(), $this->fields['id']); } /** * Update the item in the database * * @param $updates fields to update * @param $oldvalues array of old values of the updated fields * * @return nothing **/ function updateInDB($updates, $oldvalues=array()) { global $DB, $CFG_GLPI; foreach ($updates as $field) { if (isset($this->fields[$field])) { $query = "UPDATE `".$this->getTable()."` SET `".$field."`"; if ($this->fields[$field]=="NULL") { $query .= " = ".$this->fields[$field]; } else { $query .= " = '".$this->fields[$field]."'"; } $query .= " WHERE `id` ='".$this->fields["id"]."'"; if (!$DB->query($query)) { if (isset($oldvalues[$field])) { unset($oldvalues[$field]); } } } else { // Clean oldvalues if (isset($oldvalues[$field])) { unset($oldvalues[$field]); } } } if (count($oldvalues)) { Log::constructHistory($this, $oldvalues, $this->fields); } return true; } /** * Add an item to the database * * @return new ID of the item is insert successfull else false **/ function addToDB() { global $DB; //unset($this->fields["id"]); $nb_fields = count($this->fields); if ($nb_fields > 0) { // Build query $query = "INSERT INTO `".$this->getTable()."` ("; $i = 0; foreach ($this->fields as $key => $val) { $fields[$i] = $key; $values[$i] = $val; $i++; } for ($i=0 ; $i<$nb_fields; $i++) { $query .= "`".$fields[$i]."`"; if ($i != ($nb_fields-1)) { $query .= ","; } } $query .= ") VALUES ("; for ($i=0 ; $i<$nb_fields ; $i++) { if ($values[$i] == 'NULL') { $query .= $values[$i]; } else { $query .= "'".$values[$i]."'"; } if ($i != ($nb_fields-1)) { $query .= ","; } } $query .= ")"; if ($result=$DB->query($query)) { // Already define for entity / insert_id does not work if (!isset($this->fields['id']) || is_null($this->fields['id']) || ($this->fields['id'] == 0)) { $this->fields['id'] = $DB->insert_id(); } return $this->fields['id']; } } return false; } /** * Restore item = set deleted flag to 0 * * @return true if succeed else false **/ function restoreInDB() { global $DB,$CFG_GLPI; if ($this->maybeDeleted()) { // Auto set date_mod if exsist $toadd = ''; if (isset($this->fields['date_mod'])) { $toadd = ", `date_mod` ='".$_SESSION["glpi_currenttime"]."' "; } $query = "UPDATE `".$this->getTable()."` SET `is_deleted`='0' $toadd WHERE `id` = '".$this->fields['id']."'"; if ($result = $DB->query($query)) { return true; } } return false; } /** * Mark deleted or purge an item in the database * * @param $force force the purge of the item (not used if the table do not have a deleted field) * (default 0) * * @return true if succeed else false **/ function deleteFromDB($force=0) { global $DB, $CFG_GLPI; if (($force == 1) || !$this->maybeDeleted() || ($this->useDeletedToLockIfDynamic() && !$this->isDynamic())) { $this->cleanDBonPurge(); $this->cleanHistory(); $this->cleanRelationData(); $this->cleanRelationTable(); $query = "DELETE FROM `".$this->getTable()."` WHERE `id` = '".$this->fields['id']."'"; if ($result = $DB->query($query)) { $this->post_deleteFromDB(); return true; } } else { // Auto set date_mod if exsist $toadd = ''; if (isset($this->fields['date_mod'])) { $toadd = ", `date_mod` ='".$_SESSION["glpi_currenttime"]."' "; } $query = "UPDATE `".$this->getTable()."` SET `is_deleted`='1' $toadd WHERE `id` = '".$this->fields['id']."'"; $this->cleanDBonMarkDeleted(); if ($result = $DB->query($query)) { return true; } } return false; } /** * Clean data in the tables which have linked the deleted item * * @return nothing **/ function cleanHistory() { global $DB; if ($this->dohistory) { $query = "DELETE FROM `glpi_logs` WHERE (`itemtype` = '".$this->getType()."' AND `items_id` = '".$this->fields['id']."')"; $DB->query($query); } } /** * Clean data in the tables which have linked the deleted item * Clear 1/N Relation * * @return nothing **/ function cleanRelationData() { global $DB, $CFG_GLPI; $RELATION = getDbRelations(); if (isset($RELATION[$this->getTable()])) { $newval = (isset($this->input['_replace_by']) ? $this->input['_replace_by'] : 0); foreach ($RELATION[$this->getTable()] as $tablename => $field) { if ($tablename[0] != '_') { $itemtype = getItemTypeForTable($tablename); // Code factorization : we transform the singleton to an array if (!is_array($field)) { $field = array($field); } foreach ($field as $f) { foreach ($DB->request($tablename, array($f => $this->getID())) as $data) { // Be carefull : we must use getIndexName because self::update rely on that ! if ($object = getItemForItemtype($itemtype)) { $idName = $object->getIndexName(); // And we must ensure that the index name is not the same as the field // we try to modify. Otherwise we will loose this element because all // will be set to $newval ... if ($idName != $f) { $object->update(array($idName => $data[$idName], $f => $newval, '_disablenotif' => true)); // Disable notifs } } } } } } } // Clean ticket open against the item if (in_array($this->getType(),$CFG_GLPI["ticket_types"])) { $job = new Ticket(); $query = "SELECT * FROM `glpi_tickets` WHERE `items_id` = '".$this->fields['id']."' AND `itemtype`='".$this->getType()."'"; $result = $DB->query($query); if ($DB->numrows($result)) { while ($data=$DB->fetch_assoc($result)) { if ($CFG_GLPI["keep_tickets_on_delete"] == 1) { $input = array(); $input['id'] = $data["id"]; $input['items_id'] = 0; $input['itemtype'] = ''; if ($data['status'] == 'closed') { $input['_disablenotif']= true; } $job->update($input); } else { $job->delete(array("id" => $data["id"])); } } } } } /** * Actions done after the DELETE of the item in the database * * @return nothing **/ function post_deleteFromDB() { } /** * Actions done when item is deleted from the database * * @return nothing **/ function cleanDBonPurge() { } /** * Clean the date in the relation tables for the deleted item * Clear N/N Relation **/ function cleanRelationTable() { global $CFG_GLPI, $DB; // If this type have INFOCOM, clean one associated to purged item if (in_array($this->getType(),$CFG_GLPI['infocom_types'])) { $infocom = new Infocom(); if ($infocom->getFromDBforDevice($this->getType(), $this->fields['id'])) { $infocom->delete(array('id' => $infocom->fields['id'])); } } // If this type have NETPORT, clean one associated to purged item if (in_array($this->getType(),$CFG_GLPI['networkport_types'])) { // If we don't use delete, then cleanDBonPurge() is not call and the NetworkPorts are not // clean properly $networkPortObject = new NetworkPort(); $networkPortObject->cleanDBonItemDelete($this->getType(), $this->getID()); // Manage networkportmigration if exists if (TableExists('glpi_networkportmigrations')) { $networkPortMigObject = new NetworkPortMigration(); $networkPortMigObject->cleanDBonItemDelete($this->getType(), $this->getID()); } } // If this type is RESERVABLE clean one associated to purged item if (in_array($this->getType(),$CFG_GLPI['reservation_types'])) { $rr = new ReservationItem(); if ($rr->getFromDBbyItem($this->getType(), $this->fields['id'])) { $rr->delete(array('id' => $infocom->fields['id'])); } } // If this type have CONTRACT, clean one associated to purged item if (in_array($this->getType(),$CFG_GLPI['contract_types'])) { $ci = new Contract_Item(); $ci->cleanDBonItemDelete($this->getType(), $this->fields['id']); } // If this type have DOCUMENT, clean one associated to purged item if (in_array($this->getType(),$CFG_GLPI["document_types"])) { $di = new Document_Item(); $di->cleanDBonItemDelete($this->getType(), $this->fields['id']); } } /** * Actions done when item flag deleted is set to an item * * @return nothing **/ function cleanDBonMarkDeleted() { } /** * Save the input data in the Session * * @since version 0.84 **/ protected function saveInput() { $_SESSION['saveInput'][$this->getType()] = $this->input; } /** * Clear the saved data stored in the session * * @since version 0.84 **/ protected function clearSavedInput() { unset($_SESSION['saveInput'][$this->getType()]); } /** * Get the data saved in the session * * @since version 0.84 * * @param $default Array of value used if session is empty * * @return Array of value **/ protected function restoreInput(Array $default=array()) { if (isset($_SESSION['saveInput'][$this->getType()])) { $saved = Html::cleanPostForTextArea($_SESSION['saveInput'][$this->getType()]); // clear saved data when restored (only need once) unset($_SESSION['saveInput'][$this->getType()]); return $saved; } return $default; } // Common functions /** * Add an item in the database with all it's items. * * @param $input array the _POST vars returned by the item form when press add * @param options array with the insert options * - unicity_message : do not display message if item it a duplicate (default is yes) * @param $history boolean do history log ? (true by default) * * @return integer the new ID of the added item (or false if fail) **/ function add(array $input, $options=array(), $history=true) { global $DB, $CFG_GLPI; if ($DB->isSlave()) { return false; } // Store input in the object to be available in all sub-method / hook $this->input = $input; if (isset($this->input['add'])) { // Input from the interface // Save this data to be available if add fail $this->saveInput(); } // Call the plugin hook - $this->input can be altered // This hook get the data from the form, not yet altered Plugin::doHook("pre_item_add", $this); if ($this->input && is_array($this->input)) { if (isset($this->input['add'])) { $this->input['_add'] = $this->input['add']; unset($this->input['add']); } $this->input = $this->prepareInputForAdd($this->input); } if ($this->input && is_array($this->input)) { // Call the plugin hook - $this->input can be altered // This hook get the data altered by the object method Plugin::doHook("post_prepareadd", $this); } if ($this->input && is_array($this->input)) { //Check values to inject $this->filterValues(!isCommandLine()); } if ($this->input && is_array($this->input)) { $this->fields = array(); $table_fields = $DB->list_fields($this->getTable()); // fill array for add foreach ($this->input as $key => $val) { if (($key[0] != '_') && isset($table_fields[$key])) { $this->fields[$key] = $this->input[$key]; } } // Auto set date_mod if exsist if (isset($table_fields['date_mod'])) { $this->fields['date_mod'] = $_SESSION["glpi_currenttime"]; } if ($this->checkUnicity(true,$options)) { if ($this->addToDB()) { $this->post_addItem(); $this->addMessageOnAddAction(); if ($this->dohistory && $history) { $changes[0] = 0; $changes[1] = $changes[2] = ""; Log::history($this->fields["id"], $this->getType(), $changes, 0, Log::HISTORY_CREATE_ITEM); } // Auto create infocoms if ($CFG_GLPI["auto_create_infocoms"] && in_array($this->getType(), $CFG_GLPI["infocom_types"])) { $ic = new Infocom(); if (!$ic->getFromDBforDevice($this->getType(), $this->fields['id'])) { $ic->add(array('itemtype' => $this->getType(), 'items_id' => $this->fields['id'])); } } // If itemtype is in infocomtype and if states_id field is filled // and item is not a template if (in_array($this->getType(),$CFG_GLPI["infocom_types"]) && isset($this->input['states_id']) && (!isset($this->input['is_template']) || !$this->input['is_template'])) { //Check if we have to automatical fill dates Infocom::manageDateOnStatusChange($this); } Plugin::doHook("item_add", $this); // As add have suceed, clean the old input value if (isset($this->input['_add'])) { $this->clearSavedInput(); } return $this->fields['id']; } } } $this->last_status = self::NOTHING_TO_DO; return false; } /** * Get the link to an item * * @param $options array of options * - comments : boolean / display comments * - complete : boolean / display completename instead of name * - additional : boolean / display aditionals information * - linkoption : string / additional options to add to * * @return string : HTML link **/ function getLink($options=array()) { $p['linkoption'] = ''; if (isset($options['linkoption'])) { $p['linkoption'] = $options['linkoption']; } if (!isset($this->fields['id'])) { return ''; } if ($this->no_form_page || !$this->can($this->fields['id'],'r')) { return $this->getNameID($options); } $link = $this->getLinkURL(); return "".$this->getNameID($options).""; } /** * Get the link url to an item * * @return string : HTML link **/ function getLinkURL() { global $CFG_GLPI; if (!isset($this->fields['id'])) { return ''; } $link_item = $this->getFormURL(); $link = $link_item; $link .= (strpos($link,'?') ? '&':'?').'id=' . $this->fields['id']; $link .= ($this->isTemplate() ? "&withtemplate=1" : ""); return $link; } /** * Add a message on add action **/ function addMessageOnAddAction() { global $CFG_GLPI; $addMessAfterRedirect = false; if (isset($this->input['_add'])) { $addMessAfterRedirect = true; } if (isset($this->input['_no_message']) || !$this->auto_message_on_action) { $addMessAfterRedirect = false; } if ($addMessAfterRedirect) { $link = $this->getFormURL(); if (!isset($link)) { return; } if (($name = $this->getName()) == NOT_AVAILABLE) { //TRANS: %1$s is the itemtype, %2$d is the id of the item $this->fields['name'] = sprintf(__('%1$s - ID %2$d'), $this->getTypeName(1), $this->fields['id']); } $display = (isset($this->input['_no_message_link'])?$this->getNameID() :$this->getLink()); // Do not display quotes //TRANS : %s is the description of the added item Session::addMessageAfterRedirect(sprintf(__('%1$s: %2$s'), __('Item successfully added'), stripslashes($display))); } } /** * Add needed information to $input (example entities_id) * * @param $input datas used to add the item * * @since version 0.84 * * @return the modified $input array **/ function addNeededInfoToInput($input) { return $input; } /** * Prepare input datas for adding the item * * @param $input datas used to add the item * * @return the modified $input array **/ function prepareInputForAdd($input) { return $input; } /** * Actions done after the ADD of the item in the database * * @return nothing **/ function post_addItem() { } /** * Update some elements of an item in the database. * * @param $input array the _POST vars returned by the item form when press update * @param $history boolean do history log ? (default 1) * @param options array with the insert options * * @return boolean : true on success **/ function update(array $input, $history=1, $options=array()) { global $DB, $CFG_GLPI; if ($DB->isSlave()) { return false; } if (!$this->getFromDB($input[static::getIndexName()])) { return false; } // Store input in the object to be available in all sub-method / hook $this->input = $input; // Plugin hook - $this->input can be altered Plugin::doHook("pre_item_update", $this); if ($this->input && is_array($this->input)) { $this->input = $this->prepareInputForUpdate($this->input); if (isset($this->input['update'])) { $this->input['_update'] = $this->input['update']; unset($this->input['update']); } $this->filterValues(!isCommandLine()); } // Valid input for update if ($this->checkUnicity(false,$options)) { if ($this->input && is_array($this->input)) { // Fill the update-array with changes $x = 0; $this->updates = array(); $this->oldvalues = array(); foreach ($this->input as $key => $val) { if (array_key_exists($key,$this->fields)) { // Prevent history for date statement (for date for example) if (is_null($this->fields[$key]) && ($this->input[$key] == 'NULL')) { $this->fields[$key] = 'NULL'; } if ($DB->escape($this->fields[$key]) != $this->input[$key]) { if ($key != "id") { // Store old values if (!in_array($key,$this->history_blacklist)) { $this->oldvalues[$key] = $this->fields[$key]; } $this->fields[$key] = $this->input[$key]; $this->updates[$x] = $key; $x++; } } } } if (count($this->updates)) { if (array_key_exists('date_mod',$this->fields)) { // is a non blacklist field exists if (count(array_diff($this->updates, $this->history_blacklist)) > 0) { $this->fields['date_mod'] = $_SESSION["glpi_currenttime"]; $this->updates[$x++] = 'date_mod'; } } $this->pre_updateInDB(); if (count($this->updates)) { if ($this->updateInDB($this->updates, ($this->dohistory && $history ? $this->oldvalues : array()))) { $this->addMessageOnUpdateAction(); Plugin::doHook("item_update", $this); //Fill forward_entity_to array with itemtypes coming from plugins if (isset(self::$plugins_forward_entity[$this->getType()])) { foreach (self::$plugins_forward_entity[$this->getType()] as $itemtype) { static::$forward_entity_to[] = $itemtype; } } // forward entity information if needed if (count(static::$forward_entity_to) && (in_array("entities_id",$this->updates) || in_array("is_recursive",$this->updates)) ) { $this->forwardEntityInformations(); } // If itemtype is in infocomtype and if states_id field is filled // and item not a template if (in_array($this->getType(),$CFG_GLPI["infocom_types"]) && in_array('states_id',$this->updates) && ($this->getField('is_template') != NOT_AVAILABLE)) { //Check if we have to automatical fill dates Infocom::manageDateOnStatusChange($this, false); } } } } $this->post_updateItem($history); return true; } } return false; } /** * Forward entity information to linked items **/ protected function forwardEntityInformations() { global $DB; if (!isset($this->fields['id']) || !($this->fields['id'] >= 0)) { return false; } if (count(static::$forward_entity_to)) { foreach (static::$forward_entity_to as $type) { $item = new $type(); $query = "SELECT `id` FROM `".$item->getTable()."` WHERE "; if ($item->isField('itemtype')) { $query .= " `itemtype` = '".$this->getType()."' AND `items_id` = '".$this->fields['id']."'"; } else { $query .= " `".$this->getForeignKeyField()."` = '".$this->fields['id']."'"; } $input = array('entities_id' => $this->getEntityID()); if ($this->maybeRecursive()) { $input['is_recursive'] = $this->isRecursive(); } foreach ($DB->request($query) as $data) { $input['id'] = $data['id']; // No history for such update $item->update($input, 0); } } } } /** * Add a message on update action **/ function addMessageOnUpdateAction() { $addMessAfterRedirect = false; if (isset($this->input['_update'])) { $addMessAfterRedirect = true; } if (isset($this->input['_no_message']) || !$this->auto_message_on_action) { $addMessAfterRedirect = false; } if ($addMessAfterRedirect) { $link = $this->getFormURL(); if (!isset($link)) { return; } // Do not display quotes if (isset($this->fields['name'])) { $this->fields['name'] = stripslashes($this->fields['name']); } else { //TRANS: %1$s is the itemtype, %2$d is the id of the item $this->fields['name'] = sprintf(__('%1$s - ID %2$d'), $this->getTypeName(1), $this->fields['id']); } if (isset($this->input['_no_message_link'])) { $display = $this->getNameID(); } else { $display = $this->getLink(); } //TRANS : %s is the description of the updated item Session::addMessageAfterRedirect(sprintf(__('%1$s: %2$s'), __('Item successfully updated'), $display)); } } /** * Prepare input datas for updating the item * * @param $input datas used to update the item * * @return the modified $input array **/ function prepareInputForUpdate($input) { return $input; } /** * Actions done after the UPDATE of the item in the database * * @param $history store changes history ? (default 1) * * @return nothing **/ function post_updateItem($history=1) { } /** * Actions done before the UPDATE of the item in the database * * @return nothing **/ function pre_updateInDB() { } /** * Delete an item in the database. * * @param $input array the _POST vars returned by the item form when press delete * @param $force boolean force deletion (default 0) * @param $history boolean do history log ? (default 1) * * @return boolean : true on success **/ function delete(array $input, $force=0, $history=1) { global $DB; if ($DB->isSlave()) { return false; } if (!$this->getFromDB($input[static::getIndexName()])) { return false; } // Force purge for templates / may not to be deleted / not dynamic lockable items if ($this->isTemplate() || !$this->maybeDeleted() // Do not take into account deleted field if maybe dynamic but not dynamic || ($this->useDeletedToLockIfDynamic() && !$this->isDynamic())) { $force = 1; } // Store input in the object to be available in all sub-method / hook $this->input = $input; if (isset($this->input['purge'])) { $this->input['_purge'] = $this->input['purge']; unset($this->input['purge']); } if (isset($this->input['delete'])) { $this->input['_delete'] = $this->input['delete']; unset($this->input['delete']); } // Purge if ($force) { Plugin::doHook("pre_item_purge", $this); } else { Plugin::doHook("pre_item_delete", $this); } if (!is_array($this->input)) { // $input clear by a hook to cancel delete return false; } if ($this->pre_deleteItem()) { if ($this->deleteFromDB($force)) { if ($force) { $this->addMessageOnPurgeAction(); $this->post_purgeItem(); Plugin::doHook("item_purge", $this); } else { $this->addMessageOnDeleteAction(); if ($this->dohistory && $history) { $changes[0] = 0; $changes[1] = $changes[2] = ""; $logaction = Log::HISTORY_DELETE_ITEM; if ($this->useDeletedToLockIfDynamic() && $this->isDynamic()) { $logaction = Log::HISTORY_LOCK_ITEM; } Log::history($this->fields["id"], $this->getType(), $changes, 0, $logaction); } $this->post_deleteItem(); Plugin::doHook("item_delete",$this); } return true; } } return false; } /** * Actions done after the DELETE (mark as deleted) of the item in the database * * @return nothing **/ function post_deleteItem() { } /** * Actions done after the PURGE of the item in the database * * @return nothing **/ function post_purgeItem() { } /** * Add a message on delete action **/ function addMessageOnDeleteAction() { if (!$this->maybeDeleted()) { return; } $addMessAfterRedirect = false; if (isset($this->input['_delete'])) { $addMessAfterRedirect = true; } if (isset($this->input['_no_message']) || !$this->auto_message_on_action) { $addMessAfterRedirect = false; } if ($addMessAfterRedirect) { $link = $this->getFormURL(); if (!isset($link)) { return; } if (isset($this->input['_no_message_link'])) { $display = $this->getNameID(); } else { $display = $this->getLink(); } //TRANS : %s is the description of the updated item Session::addMessageAfterRedirect(sprintf(__('%1$s: %2$s'), __('Item successfully deleted'), $display)); } } /** * Add a message on purge action **/ function addMessageOnPurgeAction() { $addMessAfterRedirect = false; if (isset($this->input['_purge']) || isset($this->input['_delete'])) { $addMessAfterRedirect = true; } if (isset($this->input['_no_message']) || !$this->auto_message_on_action) { $addMessAfterRedirect = false; } if ($addMessAfterRedirect) { $link = $this->getFormURL(); if (!isset($link)) { return; } if (isset($this->input['_no_message_link'])) { $display = $this->getNameID(); } else { $display = $this->getLink(); } //TRANS : %s is the description of the updated item Session::addMessageAfterRedirect(sprintf(__('%1$s: %2$s'), __('Item successfully purged'), $display)); } } /** * Actions done before the DELETE of the item in the database / * Maybe used to add another check for deletion * * @return bool : true if item need to be deleted else false **/ function pre_deleteItem() { return true; } /** * Restore an item put in the dustbin in the database. * * @param $input array the _POST vars returned by the item form when press restore * @param $history boolean do history log ? (default 1) * * @return boolean : true on success **/ function restore(array $input, $history=1) { if (!$this->getFromDB($input[static::getIndexName()])) { return false; } if (isset($input['restore'])) { $input['_restore'] = $input['restore']; unset($input['restore']); } // Store input in the object to be available in all sub-method / hook $this->input = $input; Plugin::doHook("pre_item_restore", $this); if ($this->restoreInDB()) { $this->addMessageOnRestoreAction(); if ($this->dohistory && $history) { $changes[0] = 0; $changes[1] = $changes[2] = ""; $logaction = Log::HISTORY_RESTORE_ITEM; if ($this->useDeletedToLockIfDynamic() && $this->isDynamic()) { $logaction = Log::HISTORY_UNLOCK_ITEM; } Log::history($this->input["id"], $this->getType(), $changes, 0, $logaction); } $this->post_restoreItem(); Plugin::doHook("item_restore", $this); return true; } return false; } /** * Actions done after the restore of the item * * @return nothing **/ function post_restoreItem() { } /** * Add a message on restore action **/ function addMessageOnRestoreAction() { $addMessAfterRedirect = false; if (isset($this->input['_restore'])) { $addMessAfterRedirect = true; } if (isset($this->input['_no_message']) || !$this->auto_message_on_action) { $addMessAfterRedirect = false; } if ($addMessAfterRedirect) { $link = $this->getFormURL(); if (!isset($link)) { return; } if (isset($this->input['_no_message_link'])) { $display = $this->getNameID(); } else { $display = $this->getLink(); } //TRANS : %s is the description of the updated item Session::addMessageAfterRedirect(sprintf(__('%1$s: %2$s'), __('Item successfully restored'), $display)); } } /** * Reset fields of the item **/ function reset() { $this->fields = array(); } /** * Have I the global right to add an item for the Object * May be overloaded if needed (ex Ticket) * * @since version 0.83 * * @param $type itemtype of object to add * * @return rights **/ function canAddItem($type) { return $this->can($this->getID(), 'w'); } /** * Have I the global right to "create" the Object * May be overloaded if needed (ex KnowbaseItem) * * @return booleen **/ static function canCreate() { return false; } /** * Have I the global right to "delete" the Object * * Default is calling canCreate * May be overloaded if needed * * @return booleen * @see canCreate **/ static function canDelete() { return static::canCreate(); } /** * Have I the global right to "update" the Object * * Default is calling canCreate * May be overloaded if needed * * @return booleen * @see canCreate **/ static function canUpdate() { return static::canCreate(); } /** * Have I the right to "create" the Object * * Default is true and check entity if the objet is entity assign * * May be overloaded if needed * * @return booleen **/ function canCreateItem() { // Is an item assign to an entity if ($this->isEntityAssign()) { // Have access to entity return Session::haveAccessToEntity($this->getEntityID()); } // else : Global item return true; } /** * Have I the right to "update" the Object * * Default is calling canCreateItem * May be overloaded if needed * * @return booleen * @see canCreate **/ function canUpdateItem() { return $this->canCreateItem(); } /** * Have I the right to "delete" the Object * * Default is calling canCreateItem * May be overloaded if needed * * @return booleen * @see canCreate **/ function canDeleteItem() { global $CFG_GLPI; if (!$this->canCreateItem()) { return false; } // Can delete an object with Infocom only if can delete Infocom if (in_array($this->getType(), $CFG_GLPI['infocom_types'])) { $infocom = new Infocom(); if ($infocom->getFromDBforDevice($this->getType(), $this->fields['id'])) { return $infocom->canDelete(); } } return true; } /** * Have I the global right to "view" the Object * * Default is true and check entity if the objet is entity assign * * May be overloaded if needed * * @return booleen **/ static function canView() { return false; } /** * Have I the right to "view" the Object * May be overloaded if needed * * @return booleen **/ function canViewItem() { // Is an item assign to an entity if ($this->isEntityAssign()) { // Can be recursive check if ($this->maybeRecursive()) { return Session::haveAccessToEntity($this->getEntityID(), $this->isRecursive()); } // else : No recursive item return Session::haveAccessToEntity($this->getEntityID()); } // else : Global item return true; } /** * Can I change recursive flag to false * check if there is "linked" object in another entity * * May be overloaded if needed * * @return booleen **/ function canUnrecurs() { global $DB, $CFG_GLPI; $ID = $this->fields['id']; if (($ID < 0) || !$this->fields['is_recursive']) { return true; } $entities = "('".$this->fields['entities_id']."'"; foreach (getAncestorsOf("glpi_entities",$this->fields['entities_id']) as $papa) { $entities .= ",'$papa'"; } $entities .= ")"; $RELATION = getDbRelations(); if ($this instanceof CommonTreeDropdown) { $f = getForeignKeyFieldForTable($this->getTable()); if (countElementsInTable($this->getTable(), "`$f`='$ID' AND entities_id NOT IN $entities") > 0) { return false; } } if (isset($RELATION[$this->getTable()])) { foreach ($RELATION[$this->getTable()] as $tablename => $field) { if ($tablename[0] != '_') { $itemtype = getItemTypeForTable($tablename); $item = new $itemtype(); if ($item->isEntityAssign()) { // 1->N Relation if (is_array($field)) { foreach ($field as $f) { if (countElementsInTable($tablename, "`$f`='$ID' AND entities_id NOT IN $entities") > 0) { return false; } } } else { if (countElementsInTable($tablename, "`$field`='$ID' AND entities_id NOT IN $entities") > 0) { return false; } } } else { foreach ($RELATION as $othertable => $rel) { // Search for a N->N Relation with devices if (($othertable == "_virtual_device") && isset($rel[$tablename])) { $devfield = $rel[$tablename][0]; // items_id... $typefield = $rel[$tablename][1]; // itemtype... $sql = "SELECT DISTINCT `$typefield` AS itemtype FROM `$tablename` WHERE `$field`='$ID'"; $res = $DB->query($sql); // Search linked device of each type if ($res) { while ($data = $DB->fetch_assoc($res)) { $itemtype = $data["itemtype"]; $itemtable = getTableForItemType($itemtype); $item = new $itemtype(); if ($item->isEntityAssign()) { if (countElementsInTable(array($tablename, $itemtable), "`$tablename`.`$field`='$ID' AND `$tablename`.`$typefield` ='$itemtype' AND `$tablename`.`$devfield` =`$itemtable`.id AND `$itemtable`.`entities_id` NOT IN $entities") > '0') { return false; } } } } // Search for another N->N Relation } else if (($othertable != $this->getTable()) && isset($rel[$tablename])) { $itemtype = getItemTypeForTable($othertable); $item = new $itemtype(); if ($item->isEntityAssign()) { if (is_array($rel[$tablename])) { foreach ($rel[$tablename] as $otherfield) { if (countElementsInTable(array($tablename, $othertable), "`$tablename`.`$field`='$ID' AND `$tablename`.`$otherfield` =`$othertable`.id AND `$othertable`.`entities_id` NOT IN $entities") > '0') { return false; } } } else { $otherfield = $rel[$tablename]; if (countElementsInTable(array($tablename, $othertable), "`$tablename`.`$field`=$ID AND `$tablename`.`$otherfield` =`$othertable`.id AND `$othertable`.`entities_id` NOT IN $entities") > '0') { return false; } } } } } } } } } // Doc links to this item if (($this->getType() > 0) && countElementsInTable(array('glpi_documents_items', 'glpi_documents'), "`glpi_documents_items`.`items_id`='$ID' AND `glpi_documents_items`.`itemtype`=".$this->getType()." AND `glpi_documents_items`.`documents_id`=`glpi_documents`.`id` AND `glpi_documents`.`entities_id` NOT IN $entities") > '0') { return false; } // TODO : do we need to check all relations in $RELATION["_virtual_device"] for this item return true; } /** * check if this action can be done on this field of this item by massive actions * * @since 0.83 * * @param $action string name of the action * @param $field integer id of the field * @param $value string value of the field * **/ function canMassiveAction($action, $field, $value) { return true; } /** * Display a 2 columns Footer for Form buttons * Close the form is user can edit * * @param $options array of possible options: * - withtemplate : 1 for newtemplate, 2 for newobject from template * - colspan for each column (default 2) * - candel : set to false to hide "delete" button * - canedit : set to false to hide all buttons * - addbuttons : array of buttons to add **/ function showFormButtons($options=array()) { // for single object like config if (isset($this->fields['id'])) { $ID = $this->fields['id']; } else { $ID = 1; } $params['colspan'] = 2; $params['withtemplate'] = ''; $params['candel'] = true; $params['canedit'] = true; $params['addbuttons'] = array(); if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $params[$key] = $val; } } if (!$params['canedit'] || (!$this->can($ID,'w') && !$this->can($ID,'d'))) { echo "
"; // Form Header always open form if (!$params['canedit']) { Html::closeForm(); } return false; } echo ""; if ($params['withtemplate'] ||$this->isNewID($ID)) { echo ""; if ($ID<=0 || $params['withtemplate']==2) { echo ""; } else { //TRANS : means update / actualize echo ""; } } else { if ($params['candel'] && !$this->can($ID,'d')) { $params['candel'] = false; } if ($params['candel']) { echo "\n"; echo ""; echo "\n"; if ($this->isDeleted()) { echo "\n"; echo ""; echo ""; } else { echo "\n"; // If maybe dynamic : do not take into account is_deleted field if (!$this->maybeDeleted() || $this->useDeletedToLockIfDynamic()) { echo ""; } else { echo ""; } } } else { echo "\n"; echo ""; } if ($this->isField('date_mod')) { echo ""; } } if (!$this->isNewID($ID)) { echo ""; } echo ""; echo "\n"; if ($params['canedit'] && count($params['addbuttons'])) { echo ""; if ((($params['colspan']*2) - count($params['addbuttons'])) > 0) { echo " ". ""; } foreach ($params['addbuttons'] as $key => $val) { echo ""; } echo ""; } // Close for Form echo "
"; Html::closeForm(); } /** * Initialize item and check right before managing the edit form * * @since version 0.84 * * @param $ID Integer ID of the item/template * @param $options Array of possible options: * - withtemplate : 1 for newtemplate, 2 for newobject from template * * @return value of withtemplate option (exit of no right) **/ function initForm($ID, Array $options=array()) { if (isset($options['withtemplate']) && ($options['withtemplate'] == 2) && !$this->isNewID($ID)) { // Create item from template // Check read right on the template $this->check($ID, 'r'); // Restore saved input or template data $input = $this->restoreInput($this->fields); // If entity assign force current entity to manage recursive templates if ($this->isEntityAssign()) { $input['entities_id'] = $_SESSION['glpiactive_entity']; } // Check create right $this->check(-1, 'w', $input); } else if ($this->isNewID($ID)) { // Restore saved input if available $input = $this->restoreInput($options); // Create item $this->check(-1, 'w', $input); } else { // Modify item $this->check($ID,'r'); } return (isset($options['withtemplate']) ? $options['withtemplate'] : ''); } /** * * Display a 2 columns Header 1 for ID, 1 for recursivity menu * Open the form is user can edit * * @param $options array of possible options: * - target for the Form * - withtemplate : 1 for newtemplate, 2 for newobject from template * - colspan for each column (default 2) * - formoptions string (javascript p.e.) * - canedit boolean edit mode of form ? **/ function showFormHeader($options=array()) { global $CFG_GLPI; $ID = $this->fields['id']; $params['target'] = $this->getFormURL(); $params['colspan'] = 2; $params['withtemplate'] = ''; $params['formoptions'] = ''; $params['canedit'] = true; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $params[$key] = $val; } } // Template case : clean entities data if (($params['withtemplate'] == 2) && $this->isEntityAssign()) { $this->fields['entities_id'] = $_SESSION['glpiactive_entity']; if ($this->maybeRecursive()) { $this->fields["is_recursive"] = 0; } } if ($this->can($ID,'w')) { echo ""; //Should add an hidden entities_id field ? //If the table has an entities_id field if ($this->isField("entities_id")) { //The object type can be assigned to an entity if ($this->isEntityAssign()) { if (isset($params['entities_id'])) { $entity = $this->fields['entities_id'] = $params['entities_id']; } else if ($this->isNewID($ID) || ($params['withtemplate'] == 2)) { //It's a new object to be added $entity = $_SESSION['glpiactive_entity']; } else { //It's an existing object to be displayed $entity = $this->fields['entities_id']; } echo ""; // For Rules except ruleticket and slalevel } else if ($this->getType() != 'User') { echo ""; } } // No link on popup window if (isset($_GET['popup']) && $_GET['popup']) { echo ""; } } echo "
"; echo ""; echo "\n"; } /** * is the parameter ID must be considered as new one ? * Default is empty of <0 may be overriden (for entity for example) * * @param $ID ID of the item (-1 if new item) * * @return boolean **/ static function isNewID($ID) { return (empty($ID) || ($ID <= 0)); } /** * is the current object a new one * * @since version 0.83 * * @return boolean **/ function isNewItem() { if (isset($this->fields['id'])) { return $this->isNewID($this->fields['id']); } return true; } /** * Check right on an item * * @param $ID ID of the item (-1 if new item) * @param $right Right to check : r / w / recursive * @param &$input array of input data (used for adding item) (default NULL) * * @return boolean **/ function can($ID, $right, array &$input=NULL) { // Clean ID : $ID = Toolbox::cleanInteger($ID); // Create process if ($this->isNewID($ID)) { if (!isset($this->fields['id'])) { // Only once $this->getEmpty(); } if (is_array($input)) { $input = $this->addNeededInfoToInput($input); // Copy input field to allow getEntityID() to work // from entites_id field or from parent item ref foreach ($input as $key => $val) { if (isset($this->fields[$key])) { $this->fields[$key] = $val; } } // Store to be available for others functions $this->input = $input; } if ($this->isPrivate() && ($this->fields['users_id'] === Session::getLoginUserID())) { return true; } return (static::canCreate() && $this->canCreateItem()); } // else : Get item if not already loaded if (!isset($this->fields['id']) || ($this->fields['id'] != $ID)) { // Item not found : no right if (!$this->getFromDB($ID)) { return false; } } switch ($right) { case 'r' : // Personnal item if ($this->isPrivate() && ($this->fields['users_id'] === Session::getLoginUserID())) { return true; } return (static::canView() && $this->canViewItem()); case 'w' : // Personnal item if ($this->isPrivate() && ($this->fields['users_id'] === Session::getLoginUserID())) { return true; } return (static::canUpdate() && $this->canUpdateItem()); case 'd' : // Personnal item if ($this->isPrivate() && ($this->fields['users_id'] === Session::getLoginUserID())) { return true; } return (static::canDelete() && $this->canDeleteItem()); case 'recursive' : if ($this->isEntityAssign() && $this->maybeRecursive()) { if (static::canCreate() && Session::haveAccessToEntity($this->getEntityID())) { // Can make recursive if recursive access to entity return Session::haveRecursiveAccessToEntity($this->getEntityID()); } } break; } return false; } /** * Check right on an item with block * * @param $ID ID of the item (-1 if new item) * @param $right Right to check : r / w / recursive * @param &$input array of input data (used for adding item) (default NULL) * * @return nothing **/ function check($ID, $right, array &$input=NULL) { global $CFG_GLPI; // Check item exists if (!$this->isNewID($ID) && !$this->getFromDB($ID)) { // Gestion timeout session if (!Session::getLoginUserID()) { Html::redirect($CFG_GLPI["root_doc"] . "/index.php"); exit (); } Html::displayNotFoundError(); } else { if (!$this->can($ID,$right,$input)) { // Gestion timeout session if (!Session::getLoginUserID()) { Html::redirect($CFG_GLPI["root_doc"] . "/index.php"); exit (); } Html::displayRightError(); } } } /** * Check global right on an object * * @param $right Right to check : c / r / w / d * * @return nothing **/ function checkGlobal($right) { global $CFG_GLPI; if (!$this->canGlobal($right)) { // Gestion timeout session if (!Session::getLoginUserID()) { Html::redirect($CFG_GLPI["root_doc"] . "/index.php"); exit (); } Html::displayRightError(); } } /** * Get global right on an object * * @param $right Right to check : c / r / w / d * * @return nothing **/ function canGlobal($right) { switch ($right) { case 'r' : return static::canView(); case 'w' : return static::canUpdate(); case 'c' : return static::canCreate(); case 'd' : return static::canDelete(); } return false; } /** * Get the ID of entity assigned to the object * * Can be overloaded (ex : infocom) * * @return ID of the entity **/ function getEntityID() { if ($this->isEntityAssign()) { return $this->fields["entities_id"]; } return -1; } /** * Is the object assigned to an entity * * Can be overloaded (ex : infocom) * * @return boolean **/ function isEntityAssign() { if (!array_key_exists('id', $this->fields)) { $this->getEmpty(); } return array_key_exists('entities_id', $this->fields); } /** * Is the object may be recursive * * Can be overloaded (ex : infocom) * * @return boolean **/ function maybeRecursive() { if (!array_key_exists('id',$this->fields)) { $this->getEmpty(); } return array_key_exists('is_recursive', $this->fields); } /** * Is the object recursive * * Can be overloaded (ex : infocom) * * @return boolean **/ function isRecursive() { if ($this->maybeRecursive()) { return $this->fields["is_recursive"]; } // Return integer value to be used to fill is_recursive field return 0; } /** * Is the object may be deleted * * @return boolean **/ function maybeDeleted() { if (!isset($this->fields['id'])) { $this->getEmpty(); } return array_key_exists('is_deleted', $this->fields); } /** * Is the object deleted * * @return boolean **/ function isDeleted() { if ($this->maybeDeleted()) { return $this->fields["is_deleted"]; } // Return integer value to be used to fill is_deleted field return 0; } /** * Is the object may be a template * * @return boolean **/ function maybeTemplate() { if (!isset($this->fields['id'])) { $this->getEmpty(); } return isset($this->fields['is_template']); } /** * Is the object a template * * @return boolean **/ function isTemplate() { if ($this->maybeTemplate()) { return $this->fields["is_template"]; } // Return integer value to be used to fill is_template field return 0; } /** * Can the object be dynamic * * @since 0.84 * * @return boolean **/ function maybeDynamic() { if (!isset($this->fields['id'])) { $this->getEmpty(); } return array_key_exists('is_dynamic', $this->fields); } /** * Use deleted field in case of dynamic management to lock ? * * need to be overriden if object need to use standard deleted management (Computer...) * @since 0.84 * * @return boolean **/ function useDeletedToLockIfDynamic() { return $this->maybeDynamic(); } /** * Is an object dynamic or not * * @since 0.84 * * @return boolean **/ function isDynamic() { if ($this->maybeDynamic()) { return $this->fields['is_dynamic']; } return 0; } /** * Is the object may be private * * @return boolean **/ function maybePrivate() { if (!isset($this->fields['id'])) { $this->getEmpty(); } return (array_key_exists('is_private', $this->fields) && array_key_exists('users_id', $this->fields)); } /** * Is the object private * * @return boolean **/ function isPrivate() { if ($this->maybePrivate()) { return $this->fields["is_private"]; } return false; } /** * Return the SQL command to retrieve linked object * * @return a SQL command which return a set of (itemtype, items_id) **/ function getSelectLinkedItem() { return ''; } /** * Return a field Value if exists * * @param $field field name * * @return value of the field / false if not exists **/ function getField($field) { if (array_key_exists($field,$this->fields)) { return $this->fields[$field]; } return NOT_AVAILABLE; } /** * Determine if a field exists * * @param $field field name * * @return boolean **/ function isField($field) { if (!isset($this->fields['id'])) { $this->getEmpty(); } return array_key_exists($field, $this->fields); } /** * Get comments of the Object * * @return String: comments of the object in the current language (HTML) **/ function getComments() { global $CFG_GLPI; $comment = ""; $toadd = array(); if ($this->isField('completename')) { $toadd[] = array('name' => __('Complete name'), 'value' => nl2br($this->getField('completename'))); } if ($this->isField('serial')) { $toadd[] = array('name' => __('Serial number'), 'value' => nl2br($this->getField('serial'))); } if ($this->isField('otherserial')) { $toadd[] = array('name' => __('Inventory number'), 'value' => nl2br($this->getField('otherserial'))); } if ($this->isField('states_id') && $this->getType()!='State') { $tmp = Dropdown::getDropdownName('glpi_states', $this->getField('states_id')); if ((strlen($tmp) != 0) && ($tmp != ' ')) { $toadd[] = array('name' => __('Status'), 'value' => $tmp); } } if ($this->isField('locations_id') && $this->getType()!='Location') { $tmp = Dropdown::getDropdownName("glpi_locations", $this->getField('locations_id')); if ((strlen($tmp) != 0) && ($tmp != ' ')) { $toadd[] = array('name' => __('Location'), 'value' => $tmp); } } if ($this->isField('users_id')) { $tmp = getUserName($this->getField('users_id')); if ((strlen($tmp) != 0) && ($tmp != ' ')) { $toadd[] = array('name' => __('User'), 'value' => $tmp); } } if ($this->isField('groups_id') && ($this->getType() != 'Group')) { $tmp = Dropdown::getDropdownName("glpi_groups",$this->getField('groups_id')); if ((strlen($tmp) != 0) && ($tmp != ' ')) { $toadd[] = array('name' => __('Group'), 'value' => $tmp); } } if ($this->isField('users_id_tech')) { $tmp = getUserName($this->getField('users_id_tech')); if ((strlen($tmp) != 0) && ($tmp != ' ')) { $toadd[] = array('name' => __('Technician in charge of the hardware'), 'value' => $tmp); } } if ($this->isField('contact')) { $toadd[] = array('name' => __('Alternate username'), 'value' => nl2br($this->getField('contact'))); } if ($this->isField('contact_num')) { $toadd[] = array('name' => __('Alternate username number'), 'value' => nl2br($this->getField('contact_num'))); } if (in_array( $this->getType(), $CFG_GLPI["infocom_types"])) { $infocom = new Infocom(); if ($infocom->getFromDBforDevice($this->getType(), $this->fields['id'])) { $toadd[] = array('name' => __('Warranty expiration date'), 'value' => Infocom::getWarrantyExpir($infocom->fields["warranty_date"], $infocom->fields["warranty_duration"], 0, true)); } } if (($this instanceof CommonDropdown) && $this->isField('comment')) { $toadd[] = array('name' => __('Comments'), 'value' => nl2br($this->getField('comment'))); } if (count($toadd)) { foreach ($toadd as $data) { // Do not use SPAN here $comment .= sprintf(__('%1$s: %2$s')."
", "".$data['name'], "".$data['value']); } } if (!empty($comment)) { return Html::showToolTip($comment, array('display' => false)); } return $comment; } /** * @since version 0.84 * * Get field used for name **/ static function getNameField() { return 'name'; } /** * @since version 0.84 * * Get field used for completename **/ static function getCompleteNameField() { return 'completename'; } /** * Get the name of the object * * @param $options array of options * - comments : boolean / display comments * - complete : boolean / display completename instead of name * - additional : boolean / display aditionals information * * @return String: name of the object in the current language * * @see CommonDBTM::getNameField * @see CommonDBTM::getCompleteNameField **/ function getName($options = array()) { $p['comments'] = false; $p['complete'] = false; $p['additional'] = false; if (is_array($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } $field = static::getNameField(); if ($p['complete'] && isset($this->fields[static::getCompleteNameField()])) { $field = static::getCompleteNameField(); } if (isset($this->fields[$field]) && (strlen($this->fields[$field]) != 0)) { $name = $this->fields[$field]; if ($p['additional']) { $pre = $this->getPreAdditionalInfosForName(); if (!empty($pre)) { $name = sprintf(__('%1$s - %2$s'), $pre, $name); } $post = $this->getPostAdditionalInfosForName(); if (!empty($post)) { $name = sprintf(__('%1$s - %2$s'), $name, $post); } } if ($p['comments']) { $comment = $this->getComments(); if (!empty($comment)) { $name = sprintf(__('%1$s - %2$s'), $name, $comment); } } return $name; } return NOT_AVAILABLE; } /** * Get additionals information to add before name * * @since version 0.84 * * @return String: string to add **/ function getPreAdditionalInfosForName() { return ''; } /** * Get additionals information to add after name * * @since version 0.84 * * @return String: string to add **/ function getPostAdditionalInfosForName() { return ''; } /** * Get the name of the object with the ID if the config is set * Should Not be overloaded (overload getName() instead) * * @see CommonDBTM::getName * * @param $options array of options * - comments : boolean / display comments * - complete : boolean / display completename instead of name * - additional : boolean / display aditionals information * - forceid : boolean override config and display item's ID (false by default) * * @return String: name of the object in the current language **/ function getNameID($options=array()) { global $CFG_GLPI; $p['forceid'] = false; $p['comments'] = false; if (is_array($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } if ($p['forceid'] || $_SESSION['glpiis_ids_visible']) { $addcomment = $p['comments']; // unset comment $p['comments'] = false; $name = $this->getName($p); //TRANS: %1$s is a name, %2$s is ID $name = sprintf(__('%1$s (%2$s)'), $name, $this->getField('id')); if ($addcomment) { $comment = $this->getComments(); if (!empty($comment)) { $name = sprintf(__('%1$s - %2$s'), $name, $comment); } } return $name; } return $this->getName($options); } /** * Get the Search options for the given Type * * This should be overloaded in Class * * @return an array of search options * More information on https://forge.indepnet.net/wiki/glpi/SearchEngine **/ function getSearchOptions() { $tab = array(); $tab['common'] =__('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; return $tab; } /** * Display options add action button for massive actions * * @since version 0.84 * * This must not be overloaded in Class * * @param $input array of input datas * * @return nothing display **/ function showMassiveActionsParameters($input=array()) { global $CFG_GLPI; switch ($input['action']) { case "add_contract_item" : if ($input['itemtype'] == 'Contract') { Dropdown::showAllItems("items_id", 0, 0, 1, $CFG_GLPI["contract_types"], false, true, 'item_itemtype'); echo "

"; } else { Contract::dropdown(array('name' => "contracts_id")); echo "

"; } break; case "remove_contract_item" : if ($input['itemtype'] == 'Contract') { Dropdown::showAllItems("items_id", 0, 0, 1, $CFG_GLPI["contract_types"], false, true, 'item_itemtype'); echo "

"; } else { Contract::dropdown(array('name' => "contracts_id")); echo "

"; } break; case "add_document" : Document::dropdown(array('name' => 'documents_id')); echo "

"; break; case "remove_document" : Document::dropdown(array('name' => 'documents_id')); echo "

"; break; case "update" : // Specific options for update fields if (isset($input['options'])) { $input['options'] = Toolbox::decodeArrayFromInput($input['options']); } else { $input['options'] = array(); } $first_group = true; $newgroup = ""; $items_in_group = 0; $show_all = true; $show_infocoms = true; if (in_array($input["itemtype"], $CFG_GLPI["infocom_types"]) && (!static::canUpdate() || !Infocom::canUpdate())) { $show_all = false; $show_infocoms = Infocom::canUpdate(); } $searchopt = Search::getCleanedOptions($input["itemtype"], 'w'); echo ""; $paramsmassaction = array('id_field' => '__VALUE__', 'itemtype' => $input["itemtype"], 'options' => $input['options']); foreach ($input as $key => $val) { if (preg_match("/extra_/",$key,$regs)) { $paramsmassaction[$key] = $val; } } Ajax::updateItemOnSelectEvent("massiveaction_field", "show_massiveaction_field", $CFG_GLPI["root_doc"]."/ajax/dropdownMassiveActionField.php", $paramsmassaction); echo "

 \n"; break; default : if (!$this->showSpecificMassiveActionsParameters($input)) { echo "\n"; } } return false; } /** * Display specific options add action button for massive actions * * This may be overloaded in Class * Parameters must not be : itemtype, action, is_deleted, check_itemtype or check_items_id * @param $input array of input datas * @since version 0.84 * @return boolean if parameters displayed ? **/ function showSpecificMassiveActionsParameters($input=array()) { return false; } /** * Do the standard massive actions * * @since version 0.84 * * This must not be overloaded in Class * @param $input array of input datas * * @return an array of results (ok, ko, noright counts, may include REDIRECT field to set REDIRECT page) **/ function doMassiveActions($input=array()) { global $CFG_GLPI; if (!isset($input["item"]) || (count($input["item"]) == 0)) { return false; } $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case 'add_document' : case 'remove_document' : $doc = new Document; return $doc->doSpecificMassiveActions($input); case "add_transfer_list" : if (!isset($_SESSION['glpitransfer_list'])) { $_SESSION['glpitransfer_list'] = array(); } if (!isset($_SESSION['glpitransfer_list'][$input["itemtype"]])) { $_SESSION['glpitransfer_list'][$input["itemtype"]] = array(); } foreach ($input["item"] as $key => $val) { if ($val == 1) { $_SESSION['glpitransfer_list'][$input["itemtype"]][$key] = $key; $res['ok']++; } } $res['REDIRECT'] = $CFG_GLPI['root_doc'].'/front/transfer.action.php'; break; case "delete" : foreach ($input["item"] as $key => $val) { if ($val == 1) { if ($this->can($key,'d')) { if ($this->delete(array("id" => $key))) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } } break; case "purge" : foreach ($input["item"] as $key => $val) { if ($val == 1) { if ($this->can($key,'d')) { $force = 1; // Only mark deletion for if ($this->maybeDeleted() && $this->useDeletedToLockIfDynamic() && $this->isDynamic()) { $force = 0; } if ($this->delete(array("id" => $key), $force)) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } } break; case "restore" : foreach ($input["item"] as $key => $val) { if ($val == 1) { if ($this->can($key,'d')) { if ($this->restore(array("id" => $key))) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } } break; case "update" : $searchopt = Search::getCleanedOptions($input["itemtype"],'w'); if (isset($searchopt[$input["id_field"]])) { /// Infocoms case if (!isPluginItemType($input["itemtype"]) && Search::isInfocomOption($input["itemtype"], $input["id_field"])) { $ic = new Infocom(); $link_entity_type = -1; /// Specific entity item if ($searchopt[$input["id_field"]]["table"] == "glpi_suppliers") { $ent = new Supplier(); if ($ent->getFromDB($input[$input["field"]])) { $link_entity_type = $ent->fields["entities_id"]; } } foreach ($input["item"] as $key => $val) { if ($val == 1) { if ($this->getFromDB($key)) { if (($link_entity_type < 0) || ($link_entity_type == $this->getEntityID()) || ($ent->fields["is_recursive"] && in_array($link_entity_type, getAncestorsOf("glpi_entities", $this->getEntityID())))) { $input2["items_id"] = $key; $input2["itemtype"] = $input["itemtype"]; if ($ic->can(-1,'w',$input2)) { // Add infocom if not exists if (!$ic->getFromDBforDevice($input["itemtype"],$key)) { $input2["items_id"] = $key; $input2["itemtype"] = $input["itemtype"]; unset($ic->fields); $ic->add($input2); $ic->getFromDBforDevice($input["itemtype"], $key); } $id = $ic->fields["id"]; unset($ic->fields); if ($ic->update(array('id' => $id, $input["field"] => $input[$input["field"]]))) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } else { $res['ko']++; } } else { $res['ko']++; } } } } else { /// Not infocoms $link_entity_type = array(); /// Specific entity item $itemtable = getTableForItemType($input["itemtype"]); $itemtype2 = getItemTypeForTable($searchopt[$input["id_field"]]["table"]); if ($item2 = getItemForItemtype($itemtype2)) { if (($input["id_field"] != 80) // No entities_id fields && ($searchopt[$input["id_field"]]["table"] != $itemtable) && $item2->isEntityAssign() && $this->isEntityAssign()) { if ($item2->getFromDB($input[$input["field"]])) { if (isset($item2->fields["entities_id"]) && ($item2->fields["entities_id"] >= 0)) { if (isset($item2->fields["is_recursive"]) && $item2->fields["is_recursive"]) { $link_entity_type = getSonsOf("glpi_entities", $item2->fields["entities_id"]); } else { $link_entity_type[] = $item2->fields["entities_id"]; } } } } } foreach ($input["item"] as $key => $val) { if ($val == 1) { if ($this->can($key,'w') && $this->canMassiveAction($input['action'], $input['field'], $input[$input["field"]])) { if ((count($link_entity_type) == 0) || in_array($this->fields["entities_id"], $link_entity_type)) { if ($this->update(array('id' => $key, $input["field"] => $input[$input["field"]]))) { $res['ok']++; } else { $res['ko']++; } } else { $res['ko']++; } } else { $res['noright']++; } } } } } break; case "activate_infocoms" : $ic = new Infocom(); if ($ic->canCreate()) { foreach ($input["item"] as $key => $val) { $input2 = array('itemtype' => $input['itemtype'], 'items_id' => $key); if (!$ic->getFromDBforDevice($input2['itemtype'], $key)) { if ($ic->can(-1,'w',$input2)) { if ($ic->add($input2)) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } else { $res['ko']++; } } } break; case "add_contract_item" : $contractitem = new Contract_Item(); foreach ($input["item"] as $key => $val) { if (isset($input['items_id'])) { // Add items to contracts $input2 = array('itemtype' => $input["item_itemtype"], 'items_id' => $input["items_id"], 'contracts_id' => $key); } if (isset($input['contracts_id'])) { // Add contract to item $input2 = array('itemtype' => $input["itemtype"], 'items_id' => $key, 'contracts_id' => $input['contracts_id']); } else { return false; } if ($contractitem->can(-1, 'w', $input2)) { if ($contractitem->add($input2)) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } break; case "remove_contract_item" : foreach ($input["item"] as $key => $val) { if (isset($input['items_id'])) { // Remove item to contracts $input2 = array('itemtype' => $input["item_itemtype"], 'items_id' => $input["items_id"], 'contracts_id' => $key); } else { // Remove contract to items $input2 = array('itemtype' => $input["itemtype"], 'items_id' => $key, 'contracts_id' => $input['contracts_id']); } $contractitem = new Contract_Item(); if ($contractitem->can(-1, 'w', $input2)) { if ($item = getItemForItemtype($input2["itemtype"])) { if ($item->getFromDB($input2['items_id'])) { $contract = new Contract(); if ($contract->getFromDB($input2['contracts_id'])) { if ($contractitem->getFromDBForItems($contract, $item)) { if ($contractitem->delete(array('id' => $contractitem->getID()))) { $res['ok']++; } else { $res['ko']++; } } else { $res['ko']++; } } else { $res['ko']++; } } else { $res['ko']++; } } else { $res['ko']++; } } else { $res['noright']++; } } break; //Lock management case 'unlock_Printer' : case 'unlock_Monitor' : case 'unlock_NetworkPort' : case 'unlock_NetworkName' : case 'unlock_IPAddress' : case 'unlock_ComputerDisk' : case 'unlock_ComputerVirtualMachine' : case 'unlock_Peripheral' : case 'unlock_SoftwareVersion' : $itemtype = Lock::getItemTypeForMassiveAction($input["action"]); if ($itemtype) { $res = Lock::unlockItems($itemtype, $this->getType(), $input["item"]); } break; case 'unlock_Device' : foreach (Item_Devices::getDeviceTypes() as $itemtype) { $res = Lock::unlockItems($itemtype, $this->getType(), $input["item"]); } break; default : // Plugin specific actions $split = explode('_',$input["action"]); $res = ''; if ($split[0] == 'plugin' && isset($split[1])) { // Normalized name plugin_name_action // Allow hook from any plugin on any (core or plugin) type $res = Plugin::doOneHook($split[1], 'MassiveActionsProcess', $input); // } else if ($plug=isPluginItemType($input["itemtype"])) { // non-normalized name // hook from the plugin defining the type // $res = Plugin::doOneHook($plug['plugin'], 'MassiveActionsProcess', $input); } else { $res = $this->doSpecificMassiveActions($input); } break; } return $res; } /** * Do the specific massive actions * * @since version 0.84 * * This may be overloaded in Class * @param $input array of input datas * * @return an array of results (nbok, nbko, nbnoright counts) **/ function doSpecificMassiveActions($input=array()) { return false; } /** * Get the standard massive actions * * @since version 0.84 * * This must not be overloaded in Class * @param $is_deleted massive action for deleted items ? (default 0) * @param $checkitem link item to check right (default NULL) * * @return an array of massive actions **/ function getAllMassiveActions($is_deleted=0, $checkitem=NULL) { global $CFG_GLPI, $PLUGIN_HOOKS; if (!is_null($checkitem)) { $isadmin = $checkitem->canUpdate(); } else { $isadmin = static::canUpdate(); } $itemtype = $this->getType(); $actions = array(); if ($is_deleted) { if ($isadmin) { $actions['purge'] = _x('button', 'Delete permanently'); $actions['restore'] = _x('button', 'Restore'); } } else { if ($isadmin || (in_array($itemtype, $CFG_GLPI["infocom_types"]) && Infocom::canUpdate())) { //TRANS: select action 'update' (before doing it) $actions['update'] = _x('button', 'Update'); } if (in_array($itemtype, $CFG_GLPI["infocom_types"]) && Infocom::canCreate()) { $actions['activate_infocoms'] = __('Enable the financial and administrative information'); } // No delete for entities and tracking of not have right if ($isadmin) { // do not take into account is_deleted if items may be dynamic if ($this->maybeDeleted() && !$this->useDeletedToLockIfDynamic()) { $actions['delete'] = _x('button', 'Put in dustbin'); } else { $actions['purge'] = _x('button', 'Delete permanently'); } } if (in_array($itemtype,$CFG_GLPI["document_types"])) { if (Document::canView()) { $actions['add_document'] = _x('button', 'Add a document'); $actions['remove_document'] = _x('button', 'Remove a document'); } } if (in_array($itemtype,$CFG_GLPI["contract_types"])) { if (Contract::canUpdate()) { $actions['add_contract_item'] = _x('button', 'Add a contract'); $actions['remove_contract_item'] = _x('button', 'Remove a contract'); } } // Specific actions $actions += $this->getSpecificMassiveActions($checkitem); // Plugin Specific actions if (isset($PLUGIN_HOOKS['use_massive_action'])) { foreach ($PLUGIN_HOOKS['use_massive_action'] as $plugin => $val) { $plug_actions = Plugin::doOneHook($plugin,'MassiveActions',$itemtype); if (count($plug_actions)) { $actions += $plug_actions; } } } } //Add unlock if needed $actions += Lock::getUnlockMassiveActions($itemtype); // Manage forbidden actions $forbidden_actions = $this->getForbiddenStandardMassiveAction(); if (is_array($forbidden_actions) && count($forbidden_actions)) { foreach ($forbidden_actions as $actiontodel) { if (isset($actions[$actiontodel])) { unset($actions[$actiontodel]); } } } return $actions; } /** * Get the standard massive actions which are forbidden * * @since version 0.84 * * This should be overloaded in Class * * @return an array of massive actions **/ function getForbiddenStandardMassiveAction() { return array(); } /** * Get the specific massive actions * * @since version 0.84 * * This should be overloaded in Class * * @param $checkitem link item to check right (default NULL) * * @return an array of massive actions **/ function getSpecificMassiveActions($checkitem=NULL) { return array(); } /** * Print out an HTML "
"; $name = ''; if (!empty($params['withtemplate']) && ($params['withtemplate'] == 2) && !$this->isNewID($ID)) { echo ""; //TRANS: %s is the template name printf(__('Created from the template %s'), $this->fields["template_name"]); } else if (!empty($params['withtemplate']) && ($params['withtemplate'] == 1)) { echo "\n"; _e('Template name'); Html::autocompletionTextField($this, "template_name", array('size' => 25)); } else if ($this->isNewID($ID)) { _e('New item'); } else { //TRANS: %1$s is the Itemtype name and $2$d the ID of the item printf(__('%1$s - ID %2$d'), $this->getTypeName(1), $ID); } $entityname = ''; if (isset($this->fields["entities_id"]) && Session::isMultiEntitiesMode() && $this->isEntityAssign()) { $entityname = Dropdown::getDropdownName("glpi_entities", $this->fields["entities_id"]); } echo ""; if (get_class($this) == 'Entity') { // is recursive but cannot be change } else { if ($this->maybeRecursive()) { if (Session::isMultiEntitiesMode()) { echo "". "
".$entityname."".__('Child entities').""; if ($params['canedit']) { if (!$this->can($ID,'recursive')) { echo Dropdown::getYesNo($this->fields["is_recursive"]); $comment = __('You are not allowed to change the visibility flag for child entities.'); // CommonDBChild : entity data is get or copy from parent } else if ( $this instanceof CommonDBChild) { echo Dropdown::getYesNo($this->isRecursive()); $comment = __("Can't change this attribute. It's inherited from its parent."); } else if ( !$this->canUnrecurs()) { echo Dropdown::getYesNo($this->fields["is_recursive"]); $comment = __('Flag change forbidden. Linked items found.'); } else { Dropdown::showYesNo("is_recursive", $this->fields["is_recursive"]); $comment = __('Change visibility in child entities'); } echo " "; Html::showToolTip($comment); } else { echo Dropdown::getYesNo($this->fields["is_recursive"]); } echo "
"; } else { echo $entityname; echo ""; } } else { echo $entityname; } } echo "
"; echo ""; echo ""; echo ""; echo "
".__('Notes')."
"; echo "
"; echo ""; // for all objects without id as primary key if (static::getIndexName() != 'id') { echo ""; } if ($canedit) { echo ""; } echo "
"; if ($canedit) { Html::closeForm(); } } /** * get the Entity of an Item * * @param $itemtype string item type * @param $items_id integer id of the item * * @return integer ID of the entity or -1 **/ static function getItemEntity($itemtype, $items_id) { if ($itemtype && ($item = getItemForItemtype($itemtype))) { if ($item->getFromDB($items_id)) { return $item->getEntityID(); } } return -1; } /** * display a specific field value * * @since version 0.83 * * @param $field String name of the field * @param $values String/Array with the value to display or a Single value * @param $options Array of options * * @return return the string to display **/ static function getSpecificValueToDisplay($field, $values, array $options=array()) { return ''; } /** * display a field using standard system * * @since version 0.83 * * @param $field_id_or_search_options integer/string/array id of the search option field * or field name * or search option array * @param $values mixed value to display * @param $options array of possible options: * Parameters which could be used in options array : * - comments : boolean / is the comments displayed near the value (default false) * - any others options passed to specific display method * * @return return the string to display **/ function getValueToDisplay($field_id_or_search_options, $values, $options=array()) { global $CFG_GLPI; $param['comments'] = false; $param['html'] = false; foreach ($param as $key => $val) { if (!isset($options[$key])) { $options[$key] = $val; } } $searchoptions = array(); if (is_array($field_id_or_search_options)) { $searchoptions = $field_id_or_search_options; } else { $searchopt = Search::getOptions($this->getType()); // Get if id of search option is passed if (is_numeric($field_id_or_search_options)) { if (isset($searchopt[$field_id_or_search_options])) { $searchoptions = $searchopt[$field_id_or_search_options]; } } else { // Get if field name is passed $searchoptions = $this->getSearchOptionByField('field', $field_id_or_search_options, $this->getTable()); } } if (count($searchoptions)) { $field = $searchoptions['field']; // Normalize option if (is_array($values)) { $value = $values[$field]; } else { $value = $values; $values = array($field => $value); } if (isset($searchoptions['datatype'])) { $unit = ''; if (isset($searchoptions['unit'])) { $unit = $searchoptions['unit']; } switch ($searchoptions['datatype']) { case "number" : if (isset($searchoptions['toadd']) && isset($searchoptions['toadd'][$value])) { return $searchoptions['toadd'][$value]; } if ($options['html']) { return Dropdown::getValueWithUnit(Html::formatNumber($value, false, 0), $unit); } return $value; case "decimal" : if ($options['html']) { return Dropdown::getValueWithUnit(Html::formatNumber($value), $unit); } return $value; case "string" : case "mac" : case "ip" : return $value; case "text" : if ($options['html']) { $text = nl2br($value); } else { $text = $value; } if (isset($searchoptions['htmltext']) && $searchoptions['htmltext']) { $text = Html::clean(Toolbox::unclean_cross_side_scripting_deep($text)); } return $text; case "bool" : return Dropdown::getYesNo($value); case "date" : case "date_delay" : if (isset($options['relative_dates']) && $options['relative_dates']) { $dates = Html::getGenericDateTimeSearchItems(array('with_time' => true, 'with_future' => true)); return $dates[$value]; } return Html::convDate(Html::computeGenericDateTimeSearch($value, true)); case "datetime" : if (isset($options['relative_dates']) && $options['relative_dates']) { $dates = Html::getGenericDateTimeSearchItems(array('with_time' => true, 'with_future' => true)); return $dates[$value]; } return Html::convDateTime(Html::computeGenericDateTimeSearch($value,false)); case "timestamp" : if (($value == 0) && isset($searchoptions['emptylabel'])) { return $searchoptions['emptylabel']; } $withseconds = false; if (isset($searchoptions['withseconds'])) { $withseconds = $searchoptions['withseconds']; } return Html::timestampToString($value,$withseconds); case "email" : if ($options['html']) { return "$value"; } return $value; case "weblink" : $orig_link = trim($value); if (!empty($orig_link)) { // strip begin of link $link = preg_replace('/https?:\/\/(www[^\.]*\.)?/','',$orig_link); $link = preg_replace('/\/$/', '', $link); if (Toolbox::strlen($link) > $CFG_GLPI["url_maxlength"]) { $link = Toolbox::substr($link, 0, $CFG_GLPI["url_maxlength"])."..."; } return "$link". ""; } return " "; case "itemlink" : if ($searchoptions['table'] == $this->getTable()) { break; } case "dropdown" : if (isset($searchoptions['toadd']) && isset($searchoptions['toadd'][$value])) { return $searchoptions['toadd'][$value]; } if (!is_numeric($value)) { return $value; } if (($value == 0) && isset($searchoptions['emptylabel'])) { return $searchoptions['emptylabel']; } if ($searchoptions['table'] == 'glpi_users') { if ($param['comments']) { $tmp = getUserName($value,2); return $tmp['name'].' '.Html::showToolTip($tmp['comment'], array('display' => false)); } return getUserName($value); } if ($param['comments']) { $tmp = Dropdown::getDropdownName($searchoptions['table'],$value,1); return $tmp['name'].' '.Html::showToolTip($tmp['comment'], array('display' => false)); } return Dropdown::getDropdownName($searchoptions['table'], $value); case "right" : return Profile::getRightValue($value); case "itemtypename" : if ($obj = getItemForItemtype($value)) { return $obj->getTypeName(1); } break; case "language" : if (isset($CFG_GLPI['languages'][$value])) { return $CFG_GLPI['languages'][$value][0]; } return __('Default value'); } } // Get specific display if available $itemtype = getItemTypeForTable($searchoptions['table']); if ($item = getItemForItemtype($itemtype)) { $specific = $item->getSpecificValueToDisplay($field, $values, $options); if (!empty($specific)) { return $specific; } } } return $value; } /** * display a specific field selection system * * @since version 0.83 * * @param $field String name of the field * @param $name string name of the select (if empty use linkfield) (default '') * @param $values String/Array with the value to select or a Single value (default '') * @param $options Array of options * * @return return the string to display **/ static function getSpecificValueToSelect($field, $name='', $values='', array $options=array()) { return ''; } /** * Select a field using standard system * * @since version 0.83 * * @param $field_id_or_search_options integer/string/array id of the search option field * or field name * or search option array * @param $name string name of the select (if empty use linkfield) * (default '') * @param $values mixed default value to display * (default '') * @param $options array of possible options: * Parameters which could be used in options array : * - comments : boolean / is the comments displayed near the value (default false) * - any others options passed to specific display method * * @return return the string to display **/ function getValueToSelect($field_id_or_search_options, $name='', $values='', $options=array()) { global $CFG_GLPI; $param['comments'] = false; $param['html'] = false; foreach ($param as $key => $val) { if (!isset($options[$key])) { $options[$key] = $val; } } $searchoptions = array(); if (is_array($field_id_or_search_options)) { $searchoptions = $field_id_or_search_options; } else { $searchopt = Search::getOptions($this->getType()); // Get if id of search option is passed if (is_numeric($field_id_or_search_options)) { if (isset($searchopt[$field_id_or_search_options])) { $searchoptions = $searchopt[$field_id_or_search_options]; } } else { // Get if field name is passed $searchoptions = $this->getSearchOptionByField('field', $field_id_or_search_options, $this->getTable()); } } if (count($searchoptions)) { $field = $searchoptions['field']; // Normalize option if (is_array($values)) { $value = $values[$field]; } else { $value = $values; $values = array($field => $value); } if (empty($name)) { $name = $searchoptions['linkfield']; } // If not set : set to specific if (!isset($searchoptions['datatype'])) { $searchoptions['datatype'] = 'specific'; } $options['display'] = false; $unit = ''; if (isset($searchoptions['unit'])) { $unit = $searchoptions['unit']; } switch ($searchoptions['datatype']) { case "number" : case "integer" : $copytooption = array('min', 'max', 'step', 'toadd', 'unit'); foreach ($copytooption as $key) { if (isset($searchoptions[$key]) && !isset($options[$key])) { $options[$key] = $searchoptions[$key]; } } $options['value'] = $value; return Dropdown::showNumber($name, $options); case "decimal" : case "mac" : case "ip" : case "string" : case "email" : case "weblink" : $this->fields[$name] = $value; return Html::autocompletionTextField($this, $name, $options); case "text" : return ""; case "bool" : return Dropdown::showYesNo($name, $value, -1, $options); case "date" : case "date_delay" : if (isset($options['relative_dates']) && $options['relative_dates']) { if (isset($searchoptions['maybefuture']) && $searchoptions['maybefuture']) { $options['maybefuture'] = true; } return Html::showGenericDateTimeSearch($name, $value, $options); } $copytooption = array('min', 'max', 'maybeempty', 'showyear'); foreach ($copytooption as $key) { if (isset($searchoptions[$key]) && !isset($options[$key])) { $options[$key] = $searchoptions[$key]; } } $options['value'] = $value; return Html::showDateField($name, $options); case "datetime" : if (isset($options['relative_dates']) && $options['relative_dates']) { if (isset($searchoptions['maybefuture']) && $searchoptions['maybefuture']) { $options['maybefuture'] = true; } $options['with_time'] = true; return Html::showGenericDateTimeSearch($name, $value, $options); } $copytooption = array('mindate', 'maxdate', 'mintime', 'maxtime', 'maybeempty', 'timestep'); foreach ($copytooption as $key) { if (isset($searchoptions[$key]) && !isset($options[$key])) { $options[$key] = $searchoptions[$key]; } } $options['value'] = $value; return Html::showDateTimeField($name, $options); case "timestamp" : $copytooption = array('addfirstminutes', 'emptylabel', 'inhours', 'max', 'min', 'step', 'toadd', 'display_emptychoice'); foreach ($copytooption as $key) { if (isset($searchoptions[$key]) && !isset($options[$key])) { $options[$key] = $searchoptions[$key]; } } $options['value'] = $value; return Dropdown::showTimeStamp($name, $options); case "itemlink" : // Do not use dropdown if wanted to select string value instead of ID if (isset($options['itemlink_as_string']) && $options['itemlink_as_string']) { break; } case "dropdown" : $copytooption = array('condition', 'displaywith', 'emptylabel', 'right', 'toadd'); $options['name'] = $name; $options['value'] = $value; foreach ($copytooption as $key) { if (isset($searchoptions[$key]) && !isset($options[$key])) { $options[$key] = $searchoptions[$key]; } } if (!isset($options['entity'])) { $options['entity'] = $_SESSION['glpiactiveentities']; } if ($searchoptions['table'] == 'glpi_users') { return User::dropdown($options); } return Dropdown::show(getItemTypeForTable($searchoptions["table"]), $options); case "right" : $copytooption = array('nonone', 'noread', 'nowrite'); $options['value'] = $value; foreach ($copytooption as $key) { if (isset($searchoptions[$key]) && !isset($options[$key])) { $options[$key] = $searchoptions[$key]; } } return Profile::dropdownRight($name, $options); case "itemtypename" : if (isset($searchoptions['itemtype_list'])) { $options['types'] = $CFG_GLPI[$searchoptions['itemtype_list']]; } $copytooption = array('types'); $options['value'] = $value; foreach ($copytooption as $key) { if (isset($searchoptions[$key]) && !isset($options[$key])) { $options[$key] = $searchoptions[$key]; } } if (isset($options['types'])) { return Dropdown::showItemTypes($name, $options['types'], $options); } return false; case "language" : $copytooption = array('emptylabel', 'display_emptychoice'); foreach ($copytooption as $key) { if (isset($searchoptions[$key]) && !isset($options[$key])) { $options[$key] = $searchoptions[$key]; } } $options['value'] = $value; return Dropdown::showLanguages($name, $options); } // Get specific display if available $itemtype = getItemTypeForTable($searchoptions['table']); if ($item = getItemForItemtype($itemtype)) { $specific = $item->getSpecificValueToSelect($searchoptions['field'], $name, $values, $options); if (strlen($specific)) { return $specific; } } } // default case field text $this->fields[$name] = $value; return Html::autocompletionTextField($this, $name, $options); } /** * @param $itemtype * @param $target * @param $add (default 0) */ static function listTemplates($itemtype, $target, $add=0) { global $DB; if (!($item = getItemForItemtype($itemtype))) { return false; } if (!$item->maybeTemplate()) { return false; } // Avoid to get old data $item->clearSavedInput(); //Check is user have minimum right r if (!$item->canView() && !$item->canCreate()) { return false; } $query = "SELECT * FROM `".$item->getTable()."` WHERE `is_template` = '1' "; if ($item->isEntityAssign()) { $query .= getEntitiesRestrictRequest('AND', $item->getTable(), 'entities_id', $_SESSION['glpiactive_entity'], $item->maybeRecursive()); } $query .= " ORDER by `template_name`"; if ($result = $DB->query($query)) { echo "
"; if ($add) { echo ""; echo ""; echo ""; echo ""; } else { echo ""; } while ($data = $DB->fetch_assoc($result)) { $templname = $data["template_name"]; if ($_SESSION["glpiis_ids_visible"] || empty($data["template_name"])) { $templname = sprintf(__('%1$s (%2$s)'), $templname, $data["id"]); } if ($item->canCreate() && !$add) { echo ""; echo ""; } else { echo ""; } echo ""; } if ($item->canCreate() && !$add) { echo ""; } echo "
" . $item->getTypeName(1)."".__('Choose a template')."
"; echo "".__('Blank Template')."
".$item->getTypeName(1)."".__('Templates')."
"; echo ""; echo "   $templname   "; Html::showSimpleForm($target, 'purge', _x('button', 'Delete permanently'), array('withtemplate' => 1, 'id' => $data['id'])); echo "
"; echo ""; echo "   $templname   
"; echo "" . __('Add a template...') . ""; echo "
\n"; } } /** * Specificy a plugin itemtype for which entities_id and is_recursive should be forwarded * * @since 0.83 * * @param $for_itemtype change of entity for this itemtype will be forwarder * @param $to_itemtype change of entity will affect this itemtype * * @return nothing **/ static function addForwardEntity($for_itemtype, $to_itemtype) { self::$plugins_forward_entity[$for_itemtype][] = $to_itemtype; } /** * Is entity informations forward To ? * * @since 0.84 * * @param $itemtype itemtype to check * * @return boolean **/ static function isEntityForwardTo($itemtype) { if (in_array($itemtype, static::$forward_entity_to)) { return true; } //Fill forward_entity_to array with itemtypes coming from plugins if (isset(static::$plugins_forward_entity[static::getType()]) && in_array($itemtype, static::$plugins_forward_entity[static::getType()])) { return true; } return false; } } ?> glpi-0.84.3+dfsg.1/inc/commondevice.class.php000066400000000000000000000175711226600447100206720ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // CommonDevice Class for Device*class abstract class CommonDevice extends CommonDropdown { static function canCreate() { return Session::haveRight('device', 'w'); } static function canView() { return Session::haveRight('device', 'r'); } function getAdditionalFields() { return array(array('name' => 'manufacturers_id', 'label' => __('Manufacturer'), 'type' => 'dropdownValue')); } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'designation'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[23]['table'] = 'glpi_manufacturers'; $tab[23]['field'] = 'name'; $tab[23]['name'] = __('Manufacturer'); $tab[23]['datatype'] = 'dropdown'; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; return $tab; } function title() { Dropdown::showItemTypeMenu(_n('Component', 'Components', 2), Dropdown::getDeviceItemTypes(), $this->getSearchURL()); } function displayHeader() { Html::header($this->getTypeName(1), '', "config", "device", get_class($this)); } /** * @since version 0.84 * * @see CommonDBTM::getNameField * * @return string **/ static function getNameField() { return 'designation'; } /** * @since version 0.84 * get the HTMLTable Header for the current device according to the type of the item that * is requesting * * @param $itemtype string the type of the item * @param $base HTMLTableBase object:the element on which adding the header * (ie.: HTMLTableMain or HTMLTableGroup) * @param $super HTMLTableSuperHeader object: the super header * (in case of adding to HTMLTableGroup) (default NULL) * @param $father HTMLTableHeader object: the father of the current headers * (default NULL) * @param $options array parameter such as restriction * * @return nothing (elements added to $base) **/ static function getHTMLTableHeader($itemtype, HTMLTableBase $base, HTMLTableSuperHeader $super=NULL, HTMLTableHeader $father=NULL, array $options=array()) { $this_type = get_called_class(); if (isset($options['dont_display'][$this_type])) { return $father; } if (static::canView()) { $content = "" . static::getTypeName(1) . ""; } else { $content = static::getTypeName(1); } switch ($itemtype) { case 'Computer': $column = $base->addHeader('device', $content, $super, $father); $column->setItemType($this_type, (isset($options['itemtype_title']) ? $options['itemtype_title'] : '')); break; default: $column = $father; break; } return $column; } /** * @since version 0.84 * * @warning note the difference between getHTMLTableCellForItem and getHTMLTableCellsForItem * * @param $row HTMLTableRow object * @param $item CommonDBTM object (default NULL) * @param $father HTMLTableCell object (default NULL) * @param $options array **/ function getHTMLTableCellForItem(HTMLTableRow $row=NULL, CommonDBTM $item=NULL, HTMLTableCell $father=NULL, array $options=array()) { global $CFG_GLPI; $this_type = $this->getType(); if (isset($options['dont_display'][$this_type])) { return $father; } if (static::canView()) { $content = $this->getLink(); } else { $content = $this->getName(); } if ($options['canedit']) { $field_name = 'quantity_'.$this->getType().'_'.$this->getID(); $content .= " " . __s("; $content .= ""); } switch ($item->getType()) { case 'Computer': $cell = $row->addCell($row->getHeaderByName('common', 'device'), $content, $father, $this); break; default: $cell = $father; break; } return $cell; } /** * Import a device is not exists * * @param $input array of datas * * @return interger ID of existing or new Device **/ function import(array $input) { global $DB; if (!isset($input['designation']) || empty($input['designation'])) { return 0; } $where = array(); $a_criteria = $this->getImportCriteria(); foreach ($a_criteria as $field => $compare) { if (isset($input[$field])) { $compare = explode(':', $compare); switch ($compare[0]) { case 'equal': $where[] = "`".$field."`='".$input[$field]."'"; break; case 'delta': $where[] = "`".$field."`>'".($input[$field] - $compare[1])."'"; $where[] = "`".$field."`<'".($input[$field] + $compare[1])."'"; break; } } } $query = "SELECT `id` FROM `".$this->getTable()."` WHERE ". implode(" AND ", $where); $result = $DB->query($query); if ($DB->numrows($result) > 0) { $line = $DB->fetch_assoc($result); return $line['id']; } return $this->add($input); } /** * Criteria used for import function * * @since version 0.84 **/ function getImportCriteria() { return array('designation' => 'equal', 'manufacturers_id' => 'equal'); } } ?>glpi-0.84.3+dfsg.1/inc/commondropdown.class.php000066400000000000000000000545421226600447100212660ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// CommonDropdown class - generic dropdown abstract class CommonDropdown extends CommonDBTM { // For delete operation (entity will overload this value) public $must_be_replace = false; //Indicates if only the dropdown or the whole page is refreshed when a new dropdown value //is added using popup window public $refresh_page = false; //Menu & navigation public $first_level_menu = "config"; public $second_level_menu = "dropdowns"; public $third_level_menu = ""; public $display_dropdowntitle = true; /** * Return Additional Fields for this type **/ function getAdditionalFields() { return array(); } function defineTabs($options=array()) { $ong = array(); if ($this->dohistory) { $this->addStandardTab('Log',$ong, $options); } return $ong; } /** * Have I the right to "create" the Object * * MUST be overloaded for entity_dropdown * * @return booleen **/ static function canCreate() { return Session::haveRight('dropdown', 'w'); } /** * Have I the right to "view" the Object * * MUST be overloaded for entity_dropdown * * @return booleen **/ static function canView() { return Session::haveRight('dropdown', 'r'); } /** * Display title above search engine * * @return nothing (HTML display if needed) **/ function title() { if ($this->display_dropdowntitle) { Dropdown::showItemTypeMenu(_n('Dropdown', 'Dropdowns', 2), Dropdown::getStandardDropdownItemTypes(), $this->getSearchURL()); } } function displayHeader() { if (empty($this->third_level_menu)) { $this->third_level_menu = $this->getType(); } Html::header($this->getTypeName(2), '', $this->first_level_menu, $this->second_level_menu, $this->third_level_menu); } /** * @since version 0.83.3 * * @see CommonDBTM::prepareInputForAdd() **/ function prepareInputForAdd($input) { if (isset($input['name'])) { // leading/ending space will break findID/import $input['name'] = trim($input['name']); } return $input; } /** * @since version 0.83.3 * * @see CommonDBTM::prepareInputForUpdate() **/ function prepareInputForUpdate($input) { return self::prepareInputForAdd($input); } function showForm($ID, $options=array()) { global $CFG_GLPI; if (!$this->isNewID($ID)) { $this->check($ID,'r'); } else { // Create item $this->check(-1,'w'); } $this->showTabs($options); $this->showFormHeader($options); $fields = $this->getAdditionalFields(); $nb = count($fields); echo "".__('Name').""; echo ""; /// TODO MoYo : Why add this field ? // echo ""; if ($this instanceof CommonDevice) { // Awfull hack for CommonDevice where name is designation Html::autocompletionTextField($this, "designation"); } else { Html::autocompletionTextField($this, "name"); } echo ""; echo "". __('Comments').""; echo " \n"; foreach ($fields as $field) { if (($field['name'] == 'entities_id') && ($ID == 0)) { // No display for root entity echo " "; break; } echo "".$field['label']; if (isset($field['comment']) && !empty($field['comment'])) { echo " "; Html::showToolTip($field['comment']); } echo ""; if (!isset($field['type'])) { $field['type'] = ''; } switch ($field['type']) { case 'UserDropdown' : $param = array('name' => $field['name'], 'value' => $this->fields[$field['name']], 'right' => 'interface', 'entity' => $this->fields["entities_id"]); if (isset($field['right'])) { $params['right'] = $field['right']; } User::dropdown($param); break; case 'dropdownValue' : $params = array('value' => $this->fields[$field['name']], 'name' => $field['name'], 'entity' => $this->getEntityID()); if (isset($field['condition'])) { $params['condition'] = $field['condition']; } Dropdown::show(getItemTypeForTable(getTableNameForForeignKeyField($field['name'])), $params); break; case 'text' : Html::autocompletionTextField($this, $field['name']); break; case 'textarea' : echo ""; break; case 'integer' : Dropdown::showInteger($field['name'], $this->fields[$field['name']]); break; case 'timestamp' : $param = array('value' => $this->fields[$field['name']]); if (isset($field['min'])) { $param['min'] = $field['min']; } if (isset($field['max'])) { $param['max'] = $field['max']; } if (isset($field['step'])) { $param['step'] = $field['step']; } Dropdown::showTimeStamp($field['name'], $param); break; case 'parent' : if ($field['name'] == 'entities_id') { $restrict = -1; } else { $restrict = $this->getEntityID(); } Dropdown::show(getItemTypeForTable($this->getTable()), array('value' => $this->fields[$field['name']], 'name' => $field['name'], 'entity' => $restrict, 'used' => ($ID>0 ? getSonsOf($this->getTable(), $ID) : array()))); break; case 'icon' : Dropdown::dropdownIcons($field['name'], $this->fields[$field['name']], GLPI_ROOT."/pics/icones"); if (!empty($this->fields[$field['name']])) { echo " "; } break; case 'bool' : Dropdown::showYesNo($field['name'], $this->fields[$field['name']]); break; case 'date' : Html::showDateFormItem($field['name'], $this->fields[$field['name']]); break; case 'datetime' : Html::showDateTimeFormItem($field['name'], $this->fields[$field['name']]); break; case 'password': echo ""; break; default: $this->displaySpecificTypeField($ID, $field); break; } if (isset($field['unit'])) { echo " ".$field['unit']; } echo "\n"; } if (isset($this->fields['is_protected']) && $this->fields['is_protected']) { $options['candel'] = false; } $this->showFormButtons($options); $this->addDivForTabs(); return true; } function displaySpecificTypeField($ID, $field=array()) { } function pre_deleteItem() { if (isset($this->fields['is_protected']) && $this->fields['is_protected']) { return false; } return true; } /** * @see CommonDBTM::getSpecificMassiveActions() **/ function getSpecificMassiveActions($checkitem=NULL) { $isadmin = static::canUpdate(); $actions = parent::getSpecificMassiveActions($checkitem); if ($isadmin && $this->maybeRecursive() && (count($_SESSION['glpiactiveentities']) > 1)) { $actions['merge'] = __('Transfer and merge'); } return $actions; } /** * @see CommonDBTM::showSpecificMassiveActionsParameters() **/ function showSpecificMassiveActionsParameters($input=array()) { switch ($input['action']) { case 'merge' : echo " ".$_SESSION['glpiactive_entity_shortname']; echo "

\n"; return true; default : return parent::showSpecificMassiveActionsParameters($input); } return false; } /** * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case 'merge' : $fk = $this->getForeignKeyField(); foreach ($input["item"] as $key => $val) { if ($val == 1) { if ($this->can($key,'w')) { if ($this->getEntityID() == $_SESSION['glpiactive_entity']) { if ($this->update(array('id' => $key, 'is_recursive' => 1))) { $res['ok']++; } else { $res['ko']++; } } else { $input2 = $this->fields; // Remove keys (and name, tree dropdown will use completename) if ($this instanceof CommonTreeDropdown) { unset($input2['id'], $input2['name'], $input2[$fk]); } else { unset($input2['id']); } // Change entity $input2['entities_id'] = $_SESSION['glpiactive_entity']; $input2['is_recursive'] = 1; $input2 = Toolbox::addslashes_deep($input2); // Import new if ($newid = $this->import($input2)) { // Delete old if ($newid > 0) { // delete with purge for dropdown with dustbin (Budget) $this->delete(array('id' => $key, '_replace_by' => $newid), 1); } $res['ok']++; } else { $res['ko']++; } } } else { $res['noright']++; } } } break; default : return parent::doSpecificMassiveActions($input); } return $res; } /** * Get search function for the class * * @return array of search option **/ function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; if ($this->isEntityAssign()) { $tab[80]['table'] = 'glpi_entities'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = __('Entity'); $tab[80]['massiveaction'] = false; $tab[80]['datatype'] = 'dropdown'; } if ($this->maybeRecursive()) { $tab[86]['table'] = $this->getTable(); $tab[86]['field'] = 'is_recursive'; $tab[86]['name'] = __('Child entities'); $tab[86]['datatype'] = 'bool'; } if ($this->isField('date_mod')) { $tab[19]['table'] = $this->getTable(); $tab[19]['field'] = 'date_mod'; $tab[19]['name'] = __('Last update'); $tab[19]['datatype'] = 'datetime'; $tab[19]['massiveaction'] = false; } return $tab; } /** Check if the dropdown $ID is used into item tables * * @return boolean : is the value used ? **/ function isUsed() { global $DB; $ID = $this->fields['id']; $RELATION = getDbRelations(); if (isset($RELATION[$this->getTable()])) { foreach ($RELATION[$this->getTable()] as $tablename => $field) { if ($tablename[0] != '_') { if (!is_array($field)) { $query = "SELECT COUNT(*) AS cpt FROM `$tablename` WHERE `$field` = '$ID'"; $result = $DB->query($query); if ($DB->result($result, 0, "cpt") > 0) { return true; } } else { foreach ($field as $f) { $query = "SELECT COUNT(*) AS cpt FROM `$tablename` WHERE `$f` = '$ID'"; $result = $DB->query($query); if ($DB->result($result, 0, "cpt") > 0) { return true; } } } } } } return false; } /** * Report if a dropdown have Child * Used to (dis)allow delete action **/ function haveChildren() { return false; } /** * Show a dialog to Confirm delete action * And propose a value to replace * * @param $target string URL **/ function showDeleteConfirmForm($target) { if ($this->haveChildren()) { echo "

" . __("You can't delete that item, because it has sub-items") . "

"; return false; } $ID = $this->fields['id']; echo "

"; _e("Caution: you're about to remove a heading used for one or more items."); echo "

"; if (!$this->must_be_replace) { // Delete form (set to 0) echo "

".__('If you confirm the deletion, all uses of this dropdown will be blanked.') . "

"; echo ""; echo ""; echo ""; echo "
"; echo ""; echo ""; echo ""; echo "
\n"; Html::closeForm(); } // Replace form (set to new value) echo "

". __('You can also replace all uses of this dropdown by another.') ."

"; echo ""; echo "
"; if ($this instanceof CommonTreeDropdown) { // TreeDropdown => default replacement is parent $fk = $this->getForeignKeyField(); Dropdown::show(getItemTypeForTable($this->getTable()), array('name' => '_replace_by', 'value' => $this->fields[$fk], 'entity' => $this->getEntityID(), 'used' => getSonsOf($this->getTable(), $ID))); } else { Dropdown::show(getItemTypeForTable($this->getTable()), array('name' => '_replace_by', 'entity' => $this->getEntityID(), 'used' => array($ID))); } echo ""; echo ""; echo ""; echo ""; echo ""; echo "
\n"; Html::closeForm(); echo "
"; } /** * check if a dropdown already exists (before import) * * @param &$input array of value to import (name) * * @return the ID of the new (or -1 if not found) **/ function findID(array &$input) { global $DB; if (!empty($input["name"])) { $query = "SELECT `id` FROM `".$this->getTable()."` WHERE `name` = '".$input["name"]."'"; if ($this->isEntityAssign()) { $query .= getEntitiesRestrictRequest(' AND ', $this->getTable(), '', $input['entities_id'], $this->maybeRecursive()); } $query .= " LIMIT 1"; // Check twin : if ($result_twin = $DB->query($query) ) { if ($DB->numrows($result_twin) > 0) { return $DB->result($result_twin, 0, "id"); } } } return -1; } /** * Import a dropdown - check if already exists * * @param $input array of value to import (name, ...) * * @return the ID of the new or existing dropdown **/ function import(array $input) { if (!isset($input['name'])) { return -1; } // Clean datas $input['name'] = trim($input['name']); if (empty($input['name'])) { return -1; } // Check twin : if ($ID = $this->findID($input)) { if ($ID > 0) { return $ID; } } return $this->add($input); } /** * Import a value in a dropdown table. * * This import a new dropdown if it doesn't exist - Play dictionnary if needed * * @param $value string Value of the new dropdown (need to be addslashes) * @param $entities_id int entity in case of specific dropdown (default -1) * @param $external_params array (manufacturer) (need to be addslashes) * @param $comment (default '') (need to be addslashes) * @param $add if true, add it if not found. if false, * just check if exists (true by default) * * @return integer : dropdown id. **/ function importExternal($value, $entities_id=-1, $external_params=array(), $comment="", $add=true) { $value = trim($value); if (strlen($value) == 0) { return 0; } $ruleinput = array("name" => stripslashes($value)); $rulecollection = RuleCollection::getClassByType($this->getType(),true); foreach ($this->additional_fields_for_dictionnary as $field) { if (isset($external_params[$field])) { $ruleinput[$field] = $external_params[$field]; } else { $ruleinput[$field] = ''; } } /* switch ($this->getTable()) { case "glpi_computermodels" : case "glpi_monitormodels" : case "glpi_printermodels" : case "glpi_peripheralmodels" : case "glpi_phonemodels" : case "glpi_networkequipmentmodels" : $ruleinput["manufacturer"] = $external_params["manufacturer"]; break; }*/ $input["name"] = $value; $input["comment"] = $comment; $input["entities_id"] = $entities_id; if ($rulecollection) { $res_rule = $rulecollection->processAllRules(Toolbox::stripslashes_deep($ruleinput), array(), array()); if (isset($res_rule["name"])) { $input["name"] = $res_rule["name"]; } } return ($add ? $this->import($input) : $this->findID($input)); } function refreshParentInfos() { if (!$this->refresh_page) { Ajax::refreshDropdownPopupInMainWindow(); } else { Ajax::refreshPopupMainWindow(); } } } ?>glpi-0.84.3+dfsg.1/inc/commonglpi.class.php000066400000000000000000000604121226600447100203560ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Common GLPI object **/ class CommonGLPI { /// GLPI Item type cache : set dynamically calling getType protected $type = -1; protected $displaylist = true; public $showdebug = false; static protected $othertabs = array(); /** * Return the localized name of the current Type * Should be overloaded in each new class * * @return string **/ static function getTypeName($nb=0) { return __('General'); } /** * Return the type of the object : class name * * @return string **/ static function getType() { return get_called_class(); } /** * Register tab on an objet * * @since version 0.83 * * @param $typeform string object class name to add tab on form * @param $typetab string object class name which manage the tab **/ static function registerStandardTab($typeform, $typetab) { if (isset(self::$othertabs[$typeform])) { self::$othertabs[$typeform][] = $typetab; } else { self::$othertabs[$typeform] = array($typetab); } } /** * Get the array of Tab managed by other types * Getter for plugin (ex PDF) to access protected property * * @since version 0.83 * * @param $typeform string object class name to add tab on form * * @return array of types **/ static function getOtherTabs($typeform) { if (isset(self::$othertabs[$typeform])) { return self::$othertabs[$typeform]; } return array(); } /** * Define tabs to display * * NB : Only called for existing object * * @param $options array * - withtemplate is a template view ? * * @return array containing the onglets **/ function defineTabs($options=array()) { return array(); } /** * return all the tabs for current object * * @since version 0.83 * * @param $options array * - withtemplate is a template view ? * * @return array containing the onglets **/ final function defineAllTabs($options=array()) { // Tabs known by the object if ($this->isNewItem()) { $onglets = array(); } else { $onglets = $this->defineTabs($options); } // Object with class with 'addtabon' attribute if (isset(self::$othertabs[$this->getType()]) && !$this->isNewItem()) { foreach (self::$othertabs[$this->getType()] as $typetab) { $this->addStandardTab($typetab, $onglets, $options); } } // Single tab if (empty($onglets)) { $onglets['empty'] = $this->getTypeName(1); } return $onglets; } /** * Add standard define tab * * @param $itemtype itemtype link to the tab * @param &$ong array defined tab array * @param $options array of options (for withtemplate) * * @return nothing (set the tab array) **/ function addStandardTab($itemtype, array &$ong, array $options) { $withtemplate = 0; if (isset($options['withtemplate'])) { $withtemplate = $options['withtemplate']; } switch ($itemtype) { case 'Note' : if (Session::haveRight("notes","r")) { $ong['Note'] = __('Notes'); } break; default : if (!is_integer($itemtype) && ($obj = getItemForItemtype($itemtype))) { $titles = $obj->getTabNameForItem($this, $withtemplate); if (!is_array($titles)) { $titles = array(1 => $titles); } foreach ($titles as $key => $val) { if (!empty($val)) { $ong[$itemtype.'$'.$key] = $val; } } } break; } } /** * Get Tab Name used for itemtype * * NB : Only called for existing object * Must check right on what will be displayed + template * * @since version 0.83 * * @param $item CommonDBTM object for which the tab need to be displayed * @param $withtemplate boolean is a template object ? (default 0) * * @return string tab name **/ function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { return ''; } /** * show Tab content * * @since version 0.83 * * @param $item CommonGLPI object for which the tab need to be displayed * @param $tabnum integer tab number (default 1) * @param $withtemplate boolean is a template object ? (default 0) * * @return true **/ static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { return false; } /** * display standard tab contents * * @param $item CommonGLPI object for which the tab need to be displayed * @param $tab string tab name * @param $withtemplate boolean is a template object ? (default 0) * * @return true **/ static function displayStandardTab(CommonGLPI $item, $tab, $withtemplate=0) { switch ($tab) { // All tab case -1 : // get tabs and loop over $ong = $item->defineAllTabs(array('withtemplate' => $withtemplate)); if (count($ong)) { foreach ($ong as $key => $val) { if ($key != 'empty') { echo "
$val
"; self::displayStandardTab($item, $key, $withtemplate); } } } return true; case 'Note' : $item->showNotesForm(); return true; case -2 : $item->showDebugInfo(); return true; default : $data = explode('$',$tab); $itemtype = $data[0]; // Default set $tabnum = 1; if (isset($data[1])) { $tabnum = $data[1]; } if (!is_integer($itemtype) && ($itemtype != 'empty') && ($obj = getItemForItemtype($itemtype))) { return $obj->displayTabContentForItem($item, $tabnum, $withtemplate); } break; } return false; } /** * create tab text entry * * @param $text string text to display * @param $nb integer number of items (default 0) * * @return array containing the onglets **/ static function createTabEntry($text, $nb=0) { if ($nb) { //TRANS: %1$s is the name of the tab, $2$d is number of items in the tab between () $text = sprintf(__('%1$s %2$s'), $text, "($nb)"); } return $text; } /** * Redirect to the list page from which the item was selected * Default to the search engine for the type **/ function redirectToList() { global $CFG_GLPI; if (isset($_GET['withtemplate']) && !empty($_GET['withtemplate'])) { Html::redirect($CFG_GLPI["root_doc"]."/front/setup.templates.php?add=0&itemtype=". $this->getType()); } else if (isset($_SESSION['glpilisturl'][$this->getType()]) && !empty($_SESSION['glpilisturl'][$this->getType()])) { Html::redirect($_SESSION['glpilisturl'][$this->getType()]); } else { Html::redirect($this->getSearchURL()); } } /** * is the current object a new one - Always false here (virtual Objet) * * @since version 0.83 * * @return boolean **/ function isNewItem() { return false; } /** * is the current object a new one - Always true here (virtual Objet) * * @since version 0.84 * * @return boolean **/ static function isNewID($ID) { return true; } /** * Show onglets * * @param $options array of parameters to add to URLs and ajax * - withtemplate is a template view ? * * @return Nothing () **/ function showTabs($options=array()) { global $CFG_GLPI; // for objects not in table like central if (isset($this->fields['id'])) { $ID = $this->fields['id']; } else { $ID = 0; } $target = $_SERVER['PHP_SELF']; $extraparamhtml = ""; $extraparam = ""; $withtemplate = ""; if (is_array($options) && count($options)) { if (isset($options['withtemplate'])) { $withtemplate = $options['withtemplate']; } foreach ($options as $key => $val) { // Do not include id options if (($key[0] != '_') && ($key != 'id')) { $extraparamhtml .= "&$key=$val"; $extraparam .= "&$key=$val"; } } } if (empty($withtemplate) && !$this->isNewID($ID) && $this->getType() && $this->displaylist) { $glpilistitems =& $_SESSION['glpilistitems'][$this->getType()]; $glpilisttitle =& $_SESSION['glpilisttitle'][$this->getType()]; $glpilisturl =& $_SESSION['glpilisturl'][$this->getType()]; if (empty($glpilisturl)) { $glpilisturl = $this->getSearchURL(); } echo ""; echo "
"; } echo "
"; $onglets = $this->defineAllTabs($options); $display_all = true; if (isset($onglets['no_all_tab'])) { $display_all = false; unset($onglets['no_all_tab']); } $class = $this->getType(); if (($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) && (($ID > 0) || $this->showdebug) && (method_exists($class, 'showDebug') || in_array($class, $CFG_GLPI["infocom_types"]) || in_array($class, $CFG_GLPI["reservation_types"]))) { $onglets[-2] = __('Debug'); } if (count($onglets)) { $tabpage = $this->getTabsURL(); $tabs = array(); foreach ($onglets as $key => $val ) { $tabs[$key] = array('title' => $val, 'url' => $tabpage, 'params' => "target=$target&itemtype=".$this->getType(). "&glpi_tab=$key&id=$ID$extraparam"); } // Not all tab for templates and if only 1 tab if ($display_all && empty($withtemplate) && count($tabs)>1) { $tabs[-1] = array('title' => __('All'), 'url' => $tabpage, 'params' => "target=$target&itemtype=".$this->getType(). "&glpi_tab=-1&id=$ID$extraparam"); } Ajax::createTabs('tabspanel', 'tabcontent', $tabs, $this->getType()); } } /** * Get the search page URL for the current classe * * @param $full path or relative one (true by default) **/ static function getTabsURL($full=true) { return Toolbox::getItemTypeTabsURL(get_called_class(), $full); } /** * Get the search page URL for the current classe * * @param $full path or relative one (true by default) **/ static function getSearchURL($full=true) { return Toolbox::getItemTypeSearchURL(get_called_class(), $full); } /** * Get the search page URL for the current classe * * @param $full path or relative one (true by default) **/ static function getFormURL($full=true) { return Toolbox::getItemTypeFormURL(get_called_class(), $full); } /** * Add div to display form's tabs **/ function addDivForTabs() { echo "
 
"; echo ""; } /** * @param $options array **/ function show($options=array()) { $this->showTabs($options); $this->addDivForTabs(); } /** * to list infos in debug tab **/ function showDebugInfo() { global $CFG_GLPI; $class = $this->getType(); if (method_exists($class, 'showDebug')) { $this->showDebug(); } if (in_array($class, $CFG_GLPI["infocom_types"])) { $infocom = new Infocom(); if ($infocom->getFromDBforDevice($class, $this->fields['id'])) { $infocom->showDebug(); } } if (in_array($class, $CFG_GLPI["reservation_types"])) { $resitem = new ReservationItem(); if ($resitem->getFromDBbyItem($class, $this->fields['id'])) { $resitem->showDebugResa(); } } } /** * Update $_SESSION to set the display options. * * @since version 0.84 * * @param $input array of data to update * @param $sub_itemtype string sub itemtype if needed (default '') * * @return nothing **/ static function updateDisplayOptions($input=array(), $sub_itemtype='') { $options = static::getAvailableDisplayOptions(); if (count($options)) { if (empty($sub_itemtype)) { $display_options = &$_SESSION['glpi_display_options'][self::getType()]; } else { $display_options = &$_SESSION['glpi_display_options'][self::getType()][$sub_itemtype]; } // reset if (isset($input['reset'])) { foreach ($options as $option_group_name => $option_group) { foreach ($option_group as $option_name => $attributs) { $display_options[$option_name] = $attributs['default']; } } } else { foreach ($options as $option_group_name => $option_group) { foreach ($option_group as $option_name => $attributs) { if (isset($input[$option_name]) && ($_GET[$option_name] == 'on')) { $display_options[$option_name] = true; } else { $display_options[$option_name] = false; } } } } // Store new display options for user if ($uid = Session::getLoginUserID()) { $user = new User(); if ($user->getFromDB($uid)) { $user->update(array('id' => $uid, 'display_options' => exportArrayToDB($_SESSION['glpi_display_options']))); } } echo ""; } } /** * Load display options to $_SESSION * * @since version 0.84 * * @param $sub_itemtype string sub itemtype if needed * * @return nothing **/ static function getDisplayOptions($sub_itemtype='') { if (!isset($_SESSION['glpi_display_options'])) { // Load display_options from user table $_SESSION['glpi_display_options'] = array(); if ($uid = Session::getLoginUserID()) { $user = new User(); if ($user->getFromDB($uid)) { $_SESSION['glpi_display_options'] = importArrayFromDB($user->fields['display_options']); } } } if (!isset($_SESSION['glpi_display_options'][self::getType()])) { $_SESSION['glpi_display_options'][self::getType()] = array(); } if (!empty($sub_itemtype)) { if (!isset($_SESSION['glpi_display_options'][self::getType()][$sub_itemtype])) { $_SESSION['glpi_display_options'][self::getType()][$sub_itemtype] = array(); } $display_options = &$_SESSION['glpi_display_options'][self::getType()][$sub_itemtype]; } else { $display_options = &$_SESSION['glpi_display_options'][self::getType()]; } // Load default values if not set $options = static::getAvailableDisplayOptions(); if (count($options)) { foreach ($options as $option_group_name => $option_group) { foreach ($option_group as $option_name => $attributs) { if (!isset($display_options[$option_name])) { $display_options[$option_name] = $attributs['default']; } } } } return $display_options; } /** * @since version 0.84 * * @param $sub_itemtype string sub_itemtype if needed (default '') **/ static function showDislayOptions($sub_itemtype='') { global $CFG_GLPI; $options = static::getAvailableDisplayOptions($sub_itemtype); if (count($options)) { if (empty($sub_itemtype)) { $display_options = $_SESSION['glpi_display_options'][self::getType()]; } else { $display_options = $_SESSION['glpi_display_options'][self::getType()][$sub_itemtype]; } echo "
"; echo "\n\n"; echo "\n"; echo "\n"; echo ""; echo "\n"; echo "\n"; foreach ($options as $option_group_name => $option_group) { if (count($option_group) > 0) { echo "\n"; foreach ($option_group as $option_name => $attributs) { echo ""; echo ""; echo ""; echo "\n"; } } } echo "\n"; echo "
".__s('Display options')."
"; echo ""; echo "
$option_group_name
"; echo ""; echo "".$attributs['name']."
"; echo ""; echo "
"; echo ""; echo "
"; } } /** * Get available display options array * * @since version 0.84 * * @return all the options **/ static function getAvailableDisplayOptions() { return array(); } /** * Get link for display options * * @since version 0.84 * @param $sub_itemtype string sub itemtype if needed for display options * @return link **/ static function getDisplayOptionsLink($sub_itemtype = '') { global $CFG_GLPI; $link ="\"".__s('Display"; return $link; } } ?>glpi-0.84.3+dfsg.1/inc/commonimplicittreedropdown.class.php000066400000000000000000000162161226600447100236750ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class CommonImplicitTreeDropdown : Manage implicit tree, ie., trees that cannot be manage by /// the user. For instance, Network hierarchy only depends on network addresses and netmasks. /// @since 0.84 class CommonImplicitTreeDropdown extends CommonTreeDropdown { function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'move_under'; return $forbidden; } /** * Method that must be overloaded. This method provides the ancestor of the current item * according to $this->input * * @return the id of the current object ancestor **/ function getNewAncestor() { return 0; // By default, we rattach to the root element } /** * Method that must be overloaded. This method provides the list of all potential sons of the * current item according to $this->fields. * * @return array of IDs of the potential sons **/ function getPotentialSons() { return array(); // By default, we don't have any son } /** * Used to set the ForeignKeyField * * @param $input datas used to add the item * * @return the modified $input array **/ function prepareInputForAdd($input) { $input[$this->getForeignKeyField()] = $this->getNewAncestor(); // We call the parent to manage tree return parent::prepareInputForAdd($input); } /** * Used to update the ForeignKeyField * * @param $input datas used to add the item * * @return the modified $input array **/ function prepareInputForUpdate($input) { $input[$this->getForeignKeyField()] = $this->getNewAncestor(); // We call the parent to manage tree return parent::prepareInputForUpdate($input); } /** * Used to update tree by redefining other items ForeignKeyField * * @return nothing **/ function post_addItem() { $this->alterElementInsideTree("add"); parent::post_addItem(); } /** * Used to update tree by redefining other items ForeignKeyField * * @param $history (default 1) * * @return nothing **/ function post_updateItem($history=1) { $this->alterElementInsideTree("update"); parent::post_updateItem($history); } /** * Used to update tree by redefining other items ForeignKeyField * * @return nothing **/ function pre_deleteItem() { $this->alterElementInsideTree("delete"); return parent::pre_deleteItem(); } /** * The haveChildren=false must be define to be sure that CommonDropdown allows the deletion of a * node of the tree **/ function haveChildren() { return false; } // Key function to manage the children of the node private function alterElementInsideTree($step) { global $DB; switch ($step) { case 'add' : $newParent = $this->input[$this->getForeignKeyField()]; $potentialSons = $this->getPotentialSons(); break; case 'update' : $oldParent = $this->fields[$this->getForeignKeyField()]; $newParent = $this->input[$this->getForeignKeyField()]; $potentialSons = $this->getPotentialSons(); break; case 'delete' : $oldParent = $this->fields[$this->getForeignKeyField()]; $potentialSons = array(); // Because there is no future sons ! break; } /** Here : * $oldParent contains the old parent, to check its sons to attach them to it * $newParent contains the new parent, to check its sons to potentially attach them to this * item. * $potentialSons list ALL potential childrens (sons as well as grandsons). That is use to * update them. (See getPotentialSons()) **/ if ($step != "add") { // Because there is no old sons of new node // First, get all my current direct sons (old ones) that are not new potential sons $query = "SELECT `id` FROM `".$this->getTable()."` WHERE `".$this->getForeignKeyField()."` = '".$this->getID()."' AND `id` NOT IN ('".implode("', '", $potentialSons)."')"; $oldSons = array(); foreach ($DB->request($query) as $oldSon) { $oldSons[] = $oldSon["id"]; } if (count($oldSons) > 0) { // Then make them pointing to old parent $query = "UPDATE `".$this->getTable()."` SET `".$this->getForeignKeyField()."` = '$oldParent' WHERE `id` IN ('".implode("', '",$oldSons)."')"; $DB->query($query); // Then, regenerate the old sons to reflect there new ancestors $this->regenerateTreeUnderID($oldParent, true, true); $this->recursiveCleanSonsAboveID($oldParent); } } if ($step != "delete") { // Because ther is no new sons for deleted nodes // And, get all direct sons of my new Father that must be attached to me (ie : that are // potential sons $query = "SELECT `id` FROM `".$this->getTable()."` WHERE `".$this->getForeignKeyField()."` = '$newParent' AND `id` IN ('".implode("', '", $potentialSons)."')"; $newSons = array(); foreach ($DB->request($query) as $newSon) { $newSons[] = $newSon["id"]; } if (count($newSons) > 0) { // Then make them pointing to me $query = "UPDATE `".$this->getTable()."` SET `".$this->getForeignKeyField()."` = '".$this->getID()."' WHERE `id` IN ('".implode("', '",$newSons)."')"; $DB->query($query); // Then, regenerate the new sons to reflect there new ancestors $this->regenerateTreeUnderID($this->getID(), true, true); $this->recursiveCleanSonsAboveID($this->getID()); } } } } ?> glpi-0.84.3+dfsg.1/inc/commonitilactor.class.php000066400000000000000000000206311226600447100214140ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Ticket_User abstract class CommonITILActor extends CommonDBRelation { // items_id_1, items_id_2, itemtype_1 and itemtype_2 are defined inside the inherited classes static public $checkItem_2_Rights = self::DONT_CHECK_ITEM_RIGHTS; static public $logs_for_item_2 = false; // Requester const REQUESTER = 1; // Assign const ASSIGN = 2; // Observer const OBSERVER = 3; function getActorForeignKey() { return static::$items_id_2; } static function getItilObjectForeignKey() { return static::$items_id_1; } /** * @since version 0.84 * * @param $input array of data to be added * * @see CommonDBRelation::isAttach2Valid() **/ function isAttach2Valid(Array &$input) { // Anonymous user (only email) as requester or observer if (isset($input['users_id']) && ($input['users_id'] == 0) && isset($input['alternative_email']) && !empty($input['alternative_email']) && isset($input['type']) && ($input['type'] != CommonITILActor::ASSIGN)) { return true; } return false; } /** * @param $items_id **/ function getActors($items_id) { global $DB; $users = array(); $query = "SELECT `".$this->getTable()."`.* FROM `".$this->getTable()."` WHERE `".static::getItilObjectForeignKey()."` = '$items_id'"; foreach ($DB->request($query) as $data) { $users[$data['type']][] = $data; } return $users; } /** * @param $items_id * @param $email **/ function isAlternateEmailForITILObject($items_id, $email) { global $DB; $query = "SELECT `".$this->getTable()."`.* FROM `".$this->getTable()."` WHERE `".static::getItilObjectForeignKey()."` = '$items_id' AND `alternative_email` = '$email'"; foreach ($DB->request($query) as $data) { return true; } return false; } function canUpdateItem() { return (parent::canUpdateItem() || (isset($this->fields['users_id']) && ($this->fields['users_id'] == Session::getLoginUserID()))); } /** * @since version 0.84 **/ function canDeleteItem() { return (parent::canDeleteItem() || (isset($this->fields['users_id']) && ($this->fields['users_id'] == Session::getLoginUserID()))); } /** * Print the object user form for notification * * @param $ID integer ID of the item * @param $options array * * @return Nothing (display) **/ function showUserNotificationForm($ID, $options=array()) { global $CFG_GLPI; $this->check($ID,'w'); if (!isset($this->fields['users_id'])) { return false; } $item = new static::$itemtype_1(); echo "
"; echo "
"; echo ""; echo ""; echo ""; $user = new User(); $default_email = ""; if ($user->getFromDB($this->fields["users_id"])) { $default_email = $user->getDefaultEmail(); $emails = $user->getAllEmails(); } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
".$item->getTypeName(1).""; if ($item->getFromDB($this->fields[static::getItilObjectForeignKey()])) { echo $item->getField('name'); } echo "
".__('User')."".$user->getName()."
".__('Email Followup').""; Dropdown::showYesNo('use_notification', $this->fields['use_notification']); echo "
".__('Email').""; if ((count($emails) == 1) && !empty($default_email) && NotificationMail::isUserAddressValid($default_email)) { echo $default_email; } else if (count($emails) > 1) { // Several emails : select in the list echo ""; } else { echo ""; } echo "
"; echo ""; echo ""; echo ""; echo "
"; Html::closeForm(); } function post_deleteFromDB() { global $CFG_GLPI; $donotif = $CFG_GLPI["use_mailing"]; if (isset($this->input["_no_notif"]) && $this->input["_no_notif"]) { $donotif = false; } $item = $this->getConnexityItem(static::$itemtype_1, static::getItilObjectForeignKey()); if ($item instanceof CommonDBTM) { if (($item->countSuppliers(CommonITILActor::ASSIGN) == 0) && ($item->countUsers(CommonITILActor::ASSIGN) == 0) && ($item->countGroups(CommonITILActor::ASSIGN) == 0) && ($item->fields['status'] != CommonITILObject::CLOSED) && ($item->fields['status'] != CommonITILObject::SOLVED)) { $item->update(array('id' => $this->fields[static::getItilObjectForeignKey()], 'status' => CommonITILObject::INCOMING)); } else { $item->updateDateMod($this->fields[static::getItilObjectForeignKey()]); if ($donotif) { $options = array(); if (isset($this->fields['users_id'])) { $options = array('_old_user' => $this->fields); } NotificationEvent::raiseEvent("update", $item, $options); } } } parent::post_deleteFromDB(); } function post_addItem() { $item = new static::$itemtype_1(); $no_stat_computation = true; if ($this->input['type'] == CommonITILActor::ASSIGN) { $no_stat_computation = false; } $item->updateDateMod($this->fields[static::getItilObjectForeignKey()], $no_stat_computation); // Check object status and update it if needed if (!isset($this->input['_from_object'])) { if ($item->getFromDB($this->fields[static::getItilObjectForeignKey()])) { if ($item->fields["status"] == CommonITILObject::INCOMING) { $item->update(array('id' => $item->getID(), 'status' => CommonITILObject::ASSIGNED)); } } } parent::post_addItem(); } } ?> glpi-0.84.3+dfsg.1/inc/commonitilobject.class.php000066400000000000000000004675751226600447100216000ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * CommonITILObject Class **/ abstract class CommonITILObject extends CommonDBTM { /// Users by type protected $users = array(); public $userlinkclass = ''; /// Groups by type protected $groups = array(); public $grouplinkclass = ''; /// Suppliers by type protected $suppliers = array(); public $supplierlinkclass = ''; /// Use user entity to select entity of the object protected $userentity_oncreate = false; const MATRIX_FIELD = ''; const URGENCY_MASK_FIELD = ''; const IMPACT_MASK_FIELD = ''; const STATUS_MATRIX_FIELD = ''; // STATUS const INCOMING = 1; // new const ASSIGNED = 2; // assign const PLANNED = 3; // plan const WAITING = 4; // waiting const SOLVED = 5; // solved const CLOSED = 6; // closed const ACCEPTED = 7; // accepted const OBSERVED = 8; // observe const EVALUATION = 9; // evaluation const APPROVAL = 10; // approbation const TEST = 11; // test const QUALIFICATION = 12; // qualification function post_getFromDB() { $this->loadActors(); } /** * @since version 0.84 **/ function loadActors() { if (!empty($this->grouplinkclass)) { $class = new $this->grouplinkclass(); $this->groups = $class->getActors($this->fields['id']); } if (!empty($this->userlinkclass)) { $class = new $this->userlinkclass(); $this->users = $class->getActors($this->fields['id']); } if (!empty($this->supplierlinkclass)) { $class = new $this->supplierlinkclass(); $this->suppliers = $class->getActors($this->fields['id']); } } /** * Retrieve an item from the database with datas associated (hardwares) * * @param $ID ID of the item to get * @param $purecontent boolean true : nothing change / false : convert to HTML display * * @return true if succeed else false **/ function getFromDBwithData($ID, $purecontent) { if ($this->getFromDB($ID)) { if (!$purecontent) { $this->fields["content"] = nl2br(preg_replace("/\r\n\r\n/", "\r\n", $this->fields["content"])); } $this->getAdditionalDatas(); return true; } return false; } function getAdditionalDatas() { } function canAdminActors() { return false; } function canAssign() { return false; } /** * Is a user linked to the object ? * * @param $type type to search (see constants) * @param $users_id integer user ID * * @return boolean **/ function isUser($type, $users_id) { if (isset($this->users[$type])) { foreach ($this->users[$type] as $data) { if ($data['users_id'] == $users_id) { return true; } } } return false; } /** * Is a group linked to the object ? * * @param $type type to search (see constants) * @param $groups_id integer group ID * * @return boolean **/ function isGroup($type, $groups_id) { if (isset($this->groups[$type])) { foreach ($this->groups[$type] as $data) { if ($data['groups_id'] == $groups_id) { return true; } } } return false; } /** * Is a supplier linked to the object ? * * @since version 0.84 * * @param $type type to search (see constants) * @param $suppliers_id integer supplier ID * * @return boolean **/ function isSupplier($type, $suppliers_id) { if (isset($this->suppliers[$type])) { foreach ($this->suppliers[$type] as $data) { if ($data['suppliers_id'] == $suppliers_id) { return true; } } } return false; } /** * get users linked to a object * * @param $type type to search (see constants) * * @return array **/ function getUsers($type) { if (isset($this->users[$type])) { return $this->users[$type]; } return array(); } /** * get groups linked to a object * * @param $type type to search (see constants) * * @return array **/ function getGroups($type) { if (isset($this->groups[$type])) { return $this->groups[$type]; } return array(); } /** * get suppliers linked to a object * * @since version 0.84 * * @param $type type to search (see constants) * * @return array **/ function getSuppliers($type) { if (isset($this->suppliers[$type])) { return $this->suppliers[$type]; } return array(); } /** * count users linked to object by type or global * * @param $type type to search (see constants) / 0 for all (default 0) * * @return integer **/ function countUsers($type=0) { if ($type > 0) { if (isset($this->users[$type])) { return count($this->users[$type]); } } else { if (count($this->users)) { $count = 0; foreach ($this->users as $u) { $count += count($u); } return $count; } } return 0; } /** * count groups linked to object by type or global * * @param $type type to search (see constants) / 0 for all (default 0) * * @return integer **/ function countGroups($type=0) { if ($type > 0) { if (isset($this->groups[$type])) { return count($this->groups[$type]); } } else { if (count($this->groups)) { $count = 0; foreach ($this->groups as $u) { $count += count($u); } return $count; } } return 0; } /** * count suppliers linked to object by type or global * * @since version 0.84 * * @param $type type to search (see constants) / 0 for all (default 0) * * @return integer **/ function countSuppliers($type=0) { if ($type > 0) { if (isset($this->suppliers[$type])) { return count($this->suppliers[$type]); } } else { if (count($this->suppliers)) { $count = 0; foreach ($this->suppliers as $u) { $count += count($u); } return $count; } } return 0; } /** * Is one of groups linked to the object ? * * @param $type type to search (see constants) * @param $groups array of group ID * * @return boolean **/ function haveAGroup($type, array $groups) { if (is_array($groups) && count($groups) && isset($this->groups[$type])) { foreach ($groups as $groups_id) { foreach ($this->groups[$type] as $data) { if ($data['groups_id'] == $groups_id) { return true; } } } } return false; } /** * Get Default actor when creating the object * * @param $type type to search (see constants) * * @return boolean **/ function getDefaultActor($type) { /// TODO own_ticket -> own_itilobject if ($type == CommonITILActor::ASSIGN) { if (Session::haveRight("own_ticket","1")) { return Session::getLoginUserID(); } } return 0; } /** * Get Default actor when creating the object * * @param $type type to search (see constants) * * @return boolean **/ function getDefaultActorRightSearch($type) { if ($type == CommonITILActor::ASSIGN) { return "own_ticket"; } return "all"; } /** * Count active ITIL Objects requested by a user * * @since version 0.83 * * @param $users_id integer ID of the User * * @return integer **/ function countActiveObjectsForUser($users_id) { $linkclass = new $this->userlinkclass(); $itemtable = $this->getTable(); $itemtype = $this->getType(); $itemfk = $this->getForeignKeyField(); $linktable = $linkclass->getTable(); return countElementsInTable(array($itemtable,$linktable), "`$linktable`.`$itemfk` = `$itemtable`.`id` AND `$linktable`.`users_id` = '$users_id' AND `$linktable`.`type` = '".CommonITILActor::REQUESTER."' AND `$itemtable`.`is_deleted` = 0 AND `$itemtable`.`status` NOT IN ('".implode("', '", array_merge($this->getSolvedStatusArray(), $this->getClosedStatusArray()) )."')"); } /** * Count active ITIL Objects assigned to a user * * @since version 0.83 * * @param $users_id integer ID of the User * * @return integer **/ function countActiveObjectsForTech($users_id) { $linkclass = new $this->userlinkclass(); $itemtable = $this->getTable(); $itemtype = $this->getType(); $itemfk = $this->getForeignKeyField(); $linktable = $linkclass->getTable(); return countElementsInTable(array($itemtable,$linktable), "`$linktable`.`$itemfk` = `$itemtable`.`id` AND `$linktable`.`users_id` = '$users_id' AND `$linktable`.`type` = '".CommonITILActor::ASSIGN."' AND `$itemtable`.`is_deleted` = 0 AND `$itemtable`.`status` NOT IN ('".implode("', '", array_merge($this->getSolvedStatusArray(), $this->getClosedStatusArray()) )."')"); } /** * Count active ITIL Objects assigned to a group * * @since version 0.84 * * @param $groups_id integer ID of the User * * @return integer **/ function countActiveObjectsForTechGroup($groups_id) { $linkclass = new $this->grouplinkclass(); $itemtable = $this->getTable(); $itemtype = $this->getType(); $itemfk = $this->getForeignKeyField(); $linktable = $linkclass->getTable(); return countElementsInTable(array($itemtable,$linktable), "`$linktable`.`$itemfk` = `$itemtable`.`id` AND `$linktable`.`groups_id` = '$groups_id' AND `$linktable`.`type` = '".CommonITILActor::ASSIGN."' AND `$itemtable`.`is_deleted` = 0 AND `$itemtable`.`status` NOT IN ('".implode("', '", array_merge($this->getSolvedStatusArray(), $this->getClosedStatusArray()) )."')"); } function cleanDBonPurge() { if (!empty($this->grouplinkclass)) { $class = new $this->grouplinkclass(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); } if (!empty($this->userlinkclass)) { $class = new $this->userlinkclass(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); } if (!empty($this->supplierlinkclass)) { $class = new $this->supplierlinkclass(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); } } function prepareInputForUpdate($input) { // Add document if needed $this->getFromDB($input["id"]); // entities_id field required if (!isset($input['_donotadddocs']) || !$input['_donotadddocs']) { $docadded = $this->addFiles($input["id"]); } if (isset($input["document"]) && ($input["document"] > 0)) { $doc = new Document(); if ($doc->getFromDB($input["document"])) { $docitem = new Document_Item(); if ($docitem->add(array('documents_id' => $input["document"], 'itemtype' => $this->getType(), 'items_id' => $input["id"]))) { // Force date_mod of tracking $input["date_mod"] = $_SESSION["glpi_currenttime"]; $input['_doc_added'][] = $doc->fields["name"]; } } unset($input["document"]); } if (isset($input["date"]) && empty($input["date"])) { unset($input["date"]); } if (isset($input["closedate"]) && empty($input["closedate"])) { unset($input["closedate"]); } if (isset($input["solvedate"]) && empty($input["solvedate"])) { unset($input["solvedate"]); } if (isset($input['_itil_requester'])) { if (isset($input['_itil_requester']['_type'])) { $input['_itil_requester']['type'] = CommonITILActor::REQUESTER; $input['_itil_requester'][$this->getForeignKeyField()] = $input['id']; switch ($input['_itil_requester']['_type']) { case "user" : if (!empty($this->userlinkclass)) { if (isset($input['_itil_requester']['alternative_email']) && $input['_itil_requester']['alternative_email'] && !NotificationMail::isUserAddressValid($input['_itil_requester']['alternative_email'])) { $input['_itil_requester']['alternative_email'] = ''; Session::addMessageAfterRedirect(__('Invalid email address'), false, ERROR); } if ((isset($input['_itil_requester']['alternative_email']) && $input['_itil_requester']['alternative_email']) || ($input['_itil_requester']['users_id'] > 0)) { $useractors = new $this->userlinkclass(); if (isset($input['_auto_update']) || $useractors->can(-1,'w',$input['_itil_requester'])) { $input['_itil_requester']['_from_object'] = true; $useractors->add($input['_itil_requester']); $input['_forcenotif'] = true; } } } break; case "group" : if (!empty($this->grouplinkclass) && ($input['_itil_requester']['groups_id'] > 0)) { $groupactors = new $this->grouplinkclass(); if (isset($input['_auto_update']) || $groupactors->can(-1,'w',$input['_itil_requester'])) { $input['_itil_requester']['_from_object'] = true; $groupactors->add($input['_itil_requester']); $input['_forcenotif'] = true; } } break; } } } if (isset($input['_itil_observer'])) { if (isset($input['_itil_observer']['_type'])) { $input['_itil_observer']['type'] = CommonITILActor::OBSERVER; $input['_itil_observer'][$this->getForeignKeyField()] = $input['id']; switch ($input['_itil_observer']['_type']) { case "user" : if (!empty($this->userlinkclass)) { if (isset($input['_itil_observer']['alternative_email']) && $input['_itil_observer']['alternative_email'] && !NotificationMail::isUserAddressValid($input['_itil_observer']['alternative_email'])) { $input['_itil_observer']['alternative_email'] = ''; Session::addMessageAfterRedirect(__('Invalid email address'), false, ERROR); } if ((isset($input['_itil_observer']['alternative_email']) && $input['_itil_observer']['alternative_email']) || ($input['_itil_observer']['users_id'] > 0)) { $useractors = new $this->userlinkclass(); if (isset($input['_auto_update']) || $useractors->can(-1,'w',$input['_itil_observer'])) { $input['_itil_observer']['_from_object'] = true; $useractors->add($input['_itil_observer']); $input['_forcenotif'] = true; } } } break; case "group" : if (!empty($this->grouplinkclass) && ($input['_itil_observer']['groups_id'] > 0)) { $groupactors = new $this->grouplinkclass(); if (isset($input['_auto_update']) || $groupactors->can(-1,'w',$input['_itil_observer'])) { $input['_itil_observer']['_from_object'] = true; $groupactors->add($input['_itil_observer']); $input['_forcenotif'] = true; } } break; } } } if (isset($input['_itil_assign'])) { if (isset($input['_itil_assign']['_type'])) { $input['_itil_assign']['type'] = CommonITILActor::ASSIGN; $input['_itil_assign'][$this->getForeignKeyField()] = $input['id']; switch ($input['_itil_assign']['_type']) { case "user" : if (!empty($this->userlinkclass) && ($input['_itil_assign']['users_id'] > 0)) { $useractors = new $this->userlinkclass(); if (isset($input['_auto_update']) || $useractors->can(-1,'w',$input['_itil_assign'])) { $input['_itil_assign']['_from_object'] = true; $useractors->add($input['_itil_assign']); $input['_forcenotif'] = true; if ((!isset($input['status']) && in_array($this->fields['status'], $this->getNewStatusArray())) || (isset($input['status']) && in_array($input['status'], $this->getNewStatusArray()))) { $input['status'] = self::ASSIGNED; } } } break; case "group" : if (!empty($this->grouplinkclass) && ($input['_itil_assign']['groups_id'] > 0)) { $groupactors = new $this->grouplinkclass(); if (isset($input['_auto_update']) || $groupactors->can(-1,'w',$input['_itil_assign'])) { $input['_itil_assign']['_from_object'] = true; $groupactors->add($input['_itil_assign']); $input['_forcenotif'] = true; if ((!isset($input['status']) && (in_array($this->fields['status'], $this->getNewStatusArray()))) || (isset($input['status']) && (in_array($input['status'], $this->getNewStatusArray())))) { $input['status'] = self::ASSIGNED; } } } break; case "supplier" : if (!empty($this->supplierlinkclass) && ($input['_itil_assign']['suppliers_id'] > 0)) { $supplieractors = new $this->supplierlinkclass(); if (isset($input['_auto_update']) || $supplieractors->can(-1,'w',$input['_itil_assign'])) { $input['_itil_assign']['_from_object'] = true; $supplieractors->add($input['_itil_assign']); $input['_forcenotif'] = true; if ((!isset($input['status']) && (in_array($this->fields['status'], $this->getNewStatusArray()))) || (isset($input['status']) && (in_array($input['status'], $this->getNewStatusArray())))) { $input['status'] = self::ASSIGNED; } } } break; } } } $this->addAdditionalActors(); // set last updater if interactive user if (!Session::isCron()) { $input['users_id_lastupdater'] = Session::getLoginUserID(); } if (isset($input["status"]) && !in_array($input["status"],array_merge($this->getSolvedStatusArray(), $this->getClosedStatusArray()))) { $input['solvedate'] = 'NULL'; } if (isset($input["status"]) && !in_array($input["status"],$this->getClosedStatusArray())) { $input['closedate'] = 'NULL'; } return $input; } function pre_updateInDB() { // get again object to reload actors $this->loadActors(); // Setting a solution or solution type means the problem is solved if ((in_array("solutiontypes_id",$this->updates) && ($this->input["solutiontypes_id"] > 0)) || (in_array("solution",$this->updates) && !empty($this->input["solution"]))) { if (!in_array('status', $this->updates)) { $this->oldvalues['status'] = $this->fields['status']; $this->updates[] = 'status'; } // Special case for Ticket : use autoclose if ($this->getType() == 'Ticket') { $autoclosedelay = Entity::getUsedConfig('autoclose_delay', $this->getEntityID(), '', Entity::CONFIG_NEVER); // 0 = immediatly if ($autoclosedelay == 0) { $this->fields['status'] = self::CLOSED; $this->input['status'] = self::CLOSED; } else { $this->fields['status'] = self::SOLVED; $this->input['status'] = self::SOLVED; } } else { $this->fields['status'] = self::SOLVED; $this->input['status'] = self::SOLVED; } } // Check dates change interval due to the fact that second are not displayed in form if ((($key = array_search('date',$this->updates)) !== false) && (substr($this->fields["date"],0,16) == substr($this->oldvalues['date'],0,16))) { unset($this->updates[$key]); unset($this->oldvalues['date']); } if ((($key=array_search('closedate',$this->updates)) !== false) && (substr($this->fields["closedate"],0,16) == substr($this->oldvalues['closedate'],0,16))) { unset($this->updates[$key]); unset($this->oldvalues['closedate']); } if ((($key=array_search('due_date',$this->updates)) !== false) && (substr($this->fields["due_date"],0,16) == substr($this->oldvalues['due_date'],0,16))) { unset($this->updates[$key]); unset($this->oldvalues['due_date']); } if ((($key=array_search('solvedate',$this->updates)) !== false) && (substr($this->fields["solvedate"],0,16) == substr($this->oldvalues['solvedate'],0,16))) { unset($this->updates[$key]); unset($this->oldvalues['solvedate']); } if (isset($this->input["status"])) { if (($this->input["status"] != self::WAITING) && ($this->countSuppliers(CommonITILActor::ASSIGN) == 0) && ($this->countUsers(CommonITILActor::ASSIGN) == 0) && ($this->countGroups(CommonITILActor::ASSIGN) == 0) && !in_array($this->fields['status'],array_merge($this->getSolvedStatusArray(), $this->getClosedStatusArray()))) { if (!in_array('status', $this->updates)) { $this->oldvalues['status'] = $this->fields['status']; $this->updates[] = 'status'; } $this->fields['status'] = self::INCOMING; } if (in_array("status", $this->updates) && in_array($this->input["status"], $this->getSolvedStatusArray())) { $this->updates[] = "solvedate"; $this->oldvalues['solvedate'] = $this->fields["solvedate"]; $this->fields["solvedate"] = $_SESSION["glpi_currenttime"]; // If invalid date : set open date if ($this->fields["solvedate"] < $this->fields["date"]) { $this->fields["solvedate"] = $this->fields["date"]; } } if (in_array("status", $this->updates) && in_array($this->input["status"], $this->getClosedStatusArray())) { $this->updates[] = "closedate"; $this->oldvalues['closedate'] = $this->fields["closedate"]; $this->fields["closedate"] = $_SESSION["glpi_currenttime"]; // If invalid date : set open date if ($this->fields["closedate"] < $this->fields["date"]) { $this->fields["closedate"] = $this->fields["date"]; } // Set solvedate to closedate if (empty($this->fields["solvedate"])) { $this->updates[] = "solvedate"; $this->oldvalues['solvedate'] = $this->fields["solvedate"]; $this->fields["solvedate"] = $this->fields["closedate"]; } } } // check dates // check due_date (SLA) if ((in_array("date",$this->updates) || in_array("due_date",$this->updates)) && !is_null($this->fields["due_date"])) { // Date set if ($this->fields["due_date"] < $this->fields["date"]) { Session::addMessageAfterRedirect(__('Invalid dates. Update cancelled.'), false, ERROR); if (($key = array_search('date',$this->updates)) !== false) { unset($this->updates[$key]); unset($this->oldvalues['date']); } if (($key = array_search('due_date',$this->updates)) !== false) { unset($this->updates[$key]); unset($this->oldvalues['due_date']); } } } // Status close : check dates if (in_array($this->fields["status"], $this->getClosedStatusArray()) && (in_array("date",$this->updates) || in_array("closedate",$this->updates))) { // Invalid dates : no change // closedate must be > solvedate if ($this->fields["closedate"] < $this->fields["solvedate"]) { Session::addMessageAfterRedirect(__('Invalid dates. Update cancelled.'), false, ERROR); if (($key = array_search('closedate',$this->updates)) !== false) { unset($this->updates[$key]); unset($this->oldvalues['closedate']); } } // closedate must be > create date if ($this->fields["closedate"] < $this->fields["date"]) { Session::addMessageAfterRedirect(__('Invalid dates. Update cancelled.'), false, ERROR); if (($key = array_search('date',$this->updates)) !== false) { unset($this->updates[$key]); unset($this->oldvalues['date']); } if (($key = array_search('closedate',$this->updates)) !== false) { unset($this->updates[$key]); unset($this->oldvalues['closedate']); } } } if ((($key = array_search('status',$this->updates)) !== false) && $this->oldvalues['status'] == $this->fields['status']) { unset($this->updates[$key]); unset($this->oldvalues['status']); } // Status solved : check dates if (in_array($this->fields["status"], $this->getSolvedStatusArray()) && (in_array("date",$this->updates) || in_array("solvedate",$this->updates))) { // Invalid dates : no change // solvedate must be > create date if ($this->fields["solvedate"] < $this->fields["date"]) { Session::addMessageAfterRedirect(__('Invalid dates. Update cancelled.'), false, ERROR); if (($key = array_search('date',$this->updates)) !== false) { unset($this->updates[$key]); unset($this->oldvalues['date']); } if (($key = array_search('solvedate',$this->updates)) !== false) { unset($this->updates[$key]); unset($this->oldvalues['solvedate']); } } } // Manage come back to waiting state if (!is_null($this->fields['begin_waiting_date']) && (($key = array_search('status',$this->updates)) !== false) && (($this->oldvalues['status'] == self::WAITING) // From solved to another state than closed || (in_array($this->oldvalues["status"], $this->getSolvedStatusArray()) && !in_array($this->fields["status"], $this->getClosedStatusArray())))) { // Compute ticket waiting time use calendar if exists $calendars_id = Entity::getUsedConfig('calendars_id', $this->fields['entities_id']); $calendar = new Calendar(); $delay_time = 0; // Compute ticket waiting time use calendar if exists // Using calendar if (($calendars_id > 0) && $calendar->getFromDB($calendars_id)) { $delay_time = $calendar->getActiveTimeBetween($this->fields['begin_waiting_date'], $_SESSION["glpi_currenttime"]); } else { // Not calendar defined $delay_time = strtotime($_SESSION["glpi_currenttime"]) -strtotime($this->fields['begin_waiting_date']); } // SLA case : compute sla duration if (isset($this->fields['slas_id']) && ($this->fields['slas_id'] > 0)) { $sla = new SLA(); if ($sla->getFromDB($this->fields['slas_id'])) { $sla->setTicketCalendar($calendars_id); $delay_time_sla = $sla->getActiveTimeBetween($this->fields['begin_waiting_date'], $_SESSION["glpi_currenttime"]); $this->updates[] = "sla_waiting_duration"; $this->fields["sla_waiting_duration"] += $delay_time_sla; } // Compute new due date $this->updates[] = "due_date"; $this->fields['due_date'] = $sla->computeDueDate($this->fields['date'], $this->fields["sla_waiting_duration"]); // Add current level to do $sla->addLevelToDo($this); } else { // Using calendar if (($calendars_id > 0) && $calendar->getFromDB($calendars_id)) { if ($this->fields['due_date'] > 0) { // compute new due date using calendar $this->updates[] = "due_date"; $this->fields['due_date'] = $calendar->computeEndDate($this->fields['due_date'], $delay_time); } } else { // Not calendar defined if ($this->fields['due_date'] > 0) { // compute new due date : no calendar so add computed delay_time $this->updates[] = "due_date"; $this->fields['due_date'] = date('Y-m-d H:i:s', $delay_time+strtotime($this->fields['due_date'])); } } } $this->updates[] = "waiting_duration"; $this->fields["waiting_duration"] += $delay_time; // Reset begin_waiting_date $this->updates[] = "begin_waiting_date"; $this->fields["begin_waiting_date"] = 'NULL'; } // Set begin waiting date if needed if ((($key = array_search('status', $this->updates)) !== false) && (($this->fields['status'] == self::WAITING) || in_array($this->fields["status"], $this->getSolvedStatusArray()))) { $this->updates[] = "begin_waiting_date"; $this->fields["begin_waiting_date"] = $_SESSION["glpi_currenttime"]; // Specific for tickets if (isset($this->fields['slas_id']) && ($this->fields['slas_id'] > 0)) { SLA::deleteLevelsToDo($this); } } // solve_delay_stat : use delay between opendate and solvedate if (in_array("solvedate",$this->updates)) { $this->updates[] = "solve_delay_stat"; $this->fields['solve_delay_stat'] = $this->computeSolveDelayStat(); } // close_delay_stat : use delay between opendate and closedate if (in_array("closedate",$this->updates)) { $this->updates[] = "close_delay_stat"; $this->fields['close_delay_stat'] = $this->computeCloseDelayStat(); } // Do not take into account date_mod if no update is done if ((count($this->updates) == 1) && (($key = array_search('date_mod',$this->updates)) !== false)) { unset($this->updates[$key]); } } function prepareInputForAdd($input) { global $CFG_GLPI; // Set default status to avoid notice if (!isset($input["status"])) { $input["status"] = self::INCOMING; } if (!isset($input["urgency"]) || !($CFG_GLPI['urgency_mask']&(1<<$input["urgency"]))) { $input["urgency"] = 3; } if (!isset($input["impact"]) || !($CFG_GLPI['impact_mask']&(1<<$input["impact"]))) { $input["impact"] = 3; } if (!isset($input["priority"])) { $input["priority"] = $this->computePriority($input["urgency"], $input["impact"]); } // set last updater if interactive user if (!Session::isCron() && ($last_updater = Session::getLoginUserID(true))) { $input['users_id_lastupdater'] = $last_updater; } // No Auto set Import for external source if (!isset($input['_auto_import'])) { if (!isset($input["_users_id_requester"])) { if ($uid = Session::getLoginUserID()) { $input["_users_id_requester"] = $uid; } } } // No Auto set Import for external source if (($uid = Session::getLoginUserID()) && !isset($input['_auto_import'])) { $input["users_id_recipient"] = $uid; } else if (isset($input["_users_id_requester"]) && $input["_users_id_requester"]) { $input["users_id_recipient"] = $input["_users_id_requester"]; } // No name set name $input["name"] = ltrim($input["name"]); $input['content'] = ltrim($input['content']); if (empty($input["name"])) { $input["name"] = preg_replace('/\\r\\n/',' ',$input['content']); $input["name"] = preg_replace('/\\n/',' ',$input['name']); // For mailcollector $input["name"] = preg_replace('/\\\\r\\\\n/',' ',$input['name']); $input["name"] = preg_replace('/\\\\n/',' ',$input['name']); $input["name"] = Toolbox::stripslashes_deep($input["name"]); $input["name"] = Toolbox::substr($input['name'],0,70); $input['name'] = Toolbox::addslashes_deep($input['name']); } // Set default dropdown $dropdown_fields = array('entities_id', 'itilcategories_id'); foreach ($dropdown_fields as $field ) { if (!isset($input[$field])) { $input[$field] = 0; } } $input = $this->computeDefaultValuesForAdd($input); return $input; } /** * Compute default values for Add * (to be passed in prepareInputForAdd before and after rules if needed) * * @since version 0.84 * * @param $input * * @return string **/ function computeDefaultValuesForAdd($input) { if (!isset($input["status"])) { $input["status"] = self::INCOMING; } if (!isset($input["date"]) || empty($input["date"])) { $input["date"] = $_SESSION["glpi_currenttime"]; } if (isset($input["status"]) && in_array($input["status"], $this->getSolvedStatusArray())) { if (isset($input["date"])) { $input["solvedate"] = $input["date"]; } else { $input["solvedate"] = $_SESSION["glpi_currenttime"]; } } if (isset($input["status"]) && in_array($input["status"], $this->getClosedStatusArray())) { if (isset($input["date"])) { $input["closedate"] = $input["date"]; } else { $input["closedate"] = $_SESSION["glpi_currenttime"]; } $input['solvedate'] = $input["closedate"]; } // Set begin waiting time if status is waiting if (isset($input["status"]) && ($input["status"] == self::WAITING)) { $input['begin_waiting_date'] = $input['date']; } return $input; } function post_addItem() { // Add document if needed, without notification $this->addFiles($this->fields['id'], 0); $useractors = NULL; // Add user groups linked to ITIL objects if (!empty($this->userlinkclass)) { $useractors = new $this->userlinkclass(); } $groupactors = NULL; if (!empty($this->grouplinkclass)) { $groupactors = new $this->grouplinkclass(); } $supplieractors = NULL; if (!empty($this->supplierlinkclass)) { $supplieractors = new $this->supplierlinkclass(); } if (!is_null($useractors)) { if (isset($this->input["_users_id_requester"]) && (($this->input["_users_id_requester"] > 0) || (isset($this->input["_users_id_requester_notif"]['alternative_email']) && !empty($this->input["_users_id_requester_notif"]['alternative_email'])))) { $input2 = array($useractors->getItilObjectForeignKey() => $this->fields['id'], 'users_id' => $this->input["_users_id_requester"], 'type' => CommonITILActor::REQUESTER); if (isset($this->input["_users_id_requester_notif"])) { foreach ($this->input["_users_id_requester_notif"] as $key => $val) { $input2[$key] = $val; } } $input2['_from_object'] = true; $useractors->add($input2); } if (isset($this->input["_users_id_observer"]) && (($this->input["_users_id_observer"] > 0) || (isset($this->input["_users_id_observer_notif"]['alternative_email']) && !empty($this->input["_users_id_observer_notif"]['alternative_email'])))) { $input2 = array($useractors->getItilObjectForeignKey() => $this->fields['id'], 'users_id' => $this->input["_users_id_observer"], 'type' => CommonITILActor::OBSERVER); if (isset($this->input["_users_id_observer_notif"])) { foreach ($this->input["_users_id_observer_notif"] as $key => $val) { $input2[$key] = $val; } } $input2['_from_object'] = true; $useractors->add($input2); } if (isset($this->input["_users_id_assign"]) && ($this->input["_users_id_assign"] > 0)) { $input2 = array($useractors->getItilObjectForeignKey() => $this->fields['id'], 'users_id' => $this->input["_users_id_assign"], 'type' => CommonITILActor::ASSIGN); if (isset($this->input["_users_id_assign_notif"])) { foreach ($this->input["_users_id_assign_notif"] as $key => $val) { $input2[$key] = $val; } } $input2['_from_object'] = true; $useractors->add($input2); } } if (!is_null($groupactors)) { if (isset($this->input["_groups_id_requester"]) && ($this->input["_groups_id_requester"] > 0)) { $groupactors->add(array($groupactors->getItilObjectForeignKey() => $this->fields['id'], 'groups_id' => $this->input["_groups_id_requester"], 'type' => CommonITILActor::REQUESTER, '_from_object' => true)); } if (isset($this->input["_groups_id_assign"]) && ($this->input["_groups_id_assign"] > 0)) { $groupactors->add(array($groupactors->getItilObjectForeignKey() => $this->fields['id'], 'groups_id' => $this->input["_groups_id_assign"], 'type' => CommonITILActor::ASSIGN, '_from_object' => true)); } if (isset($this->input["_groups_id_observer"]) && ($this->input["_groups_id_observer"] > 0)) { $groupactors->add(array($groupactors->getItilObjectForeignKey() => $this->fields['id'], 'groups_id' => $this->input["_groups_id_observer"], 'type' => CommonITILActor::OBSERVER, '_from_object' => true)); } } if (!is_null($supplieractors)) { if (isset($this->input["_suppliers_id_assign"]) && ($this->input["_suppliers_id_assign"] > 0)) { $supplieractors->add(array($supplieractors->getItilObjectForeignKey() => $this->fields['id'], 'suppliers_id' => $this->input["_suppliers_id_assign"], 'type' => CommonITILActor::ASSIGN, '_from_object' => true)); } } // Additional actors $this->addAdditionalActors(); } /** * @since version 0.84 **/ private function addAdditionalActors() { $useractors = NULL; // Add user groups linked to ITIL objects if (!empty($this->userlinkclass)) { $useractors = new $this->userlinkclass(); } $groupactors = NULL; if (!empty($this->grouplinkclass)) { $groupactors = new $this->grouplinkclass(); } $supplieractors = NULL; if (!empty($this->supplierlinkclass)) { $supplieractors = new $this->supplierlinkclass(); } // Additional groups actors if (!is_null($groupactors)) { // Requesters if (isset($this->input['_additional_groups_requesters']) && is_array($this->input['_additional_groups_requesters']) && count($this->input['_additional_groups_requesters'])) { $input2 = array($groupactors->getItilObjectForeignKey() => $this->fields['id'], 'type' => CommonITILActor::REQUESTER); foreach ($this->input['_additional_groups_requesters'] as $tmp) { if ($tmp > 0) { $input2['groups_id'] = $tmp; $input2['_from_object'] = true; $groupactors->add($input2); } } } // Observers if (isset($this->input['_additional_groups_observers']) && is_array($this->input['_additional_groups_observers']) && count($this->input['_additional_groups_observers'])) { $input2 = array($groupactors->getItilObjectForeignKey() => $this->fields['id'], 'type' => CommonITILActor::OBSERVER); foreach ($this->input['_additional_groups_observers'] as $tmp) { if ($tmp > 0) { $input2['groups_id'] = $tmp; $input2['_from_object'] = true; $groupactors->add($input2); } } } // Assigns if (isset($this->input['_additional_groups_assigns']) && is_array($this->input['_additional_groups_assigns']) && count($this->input['_additional_groups_assigns'])) { $input2 = array($groupactors->getItilObjectForeignKey() => $this->fields['id'], 'type' => CommonITILActor::ASSIGN); foreach ($this->input['_additional_groups_assigns'] as $tmp) { if ($tmp > 0) { $input2['groups_id'] = $tmp; $input2['_from_object'] = true; $groupactors->add($input2); } } } } // Additional suppliers actors if (!is_null($supplieractors)) { // Assigns if (isset($this->input['_additional_suppliers_assigns']) && is_array($this->input['_additional_suppliers_assigns']) && count($this->input['_additional_suppliers_assigns'])) { $input2 = array($supplieractors->getItilObjectForeignKey() => $this->fields['id'], 'type' => CommonITILActor::ASSIGN); foreach ($this->input['_additional_suppliers_assigns'] as $tmp) { if ($tmp > 0) { $input2['suppliers_id'] = $tmp; $input2['_from_object'] = true; $supplieractors->add($input2); } } } } // Additional actors : using default notification parameters if (!is_null($useractors)) { // Observers : for mailcollector if (isset($this->input["_additional_observers"]) && is_array($this->input["_additional_observers"]) && count($this->input["_additional_observers"])) { $input2 = array($useractors->getItilObjectForeignKey() => $this->fields['id'], 'type' => CommonITILActor::OBSERVER, '_from_object' => true); foreach ($this->input["_additional_observers"] as $tmp) { if (isset($tmp['users_id'])) { foreach ($tmp as $key => $val) { $input2[$key] = $val; } $useractors->add($input2); } } } if (isset($this->input["_additional_assigns"]) && is_array($this->input["_additional_assigns"]) && count($this->input["_additional_assigns"])) { $input2 = array($useractors->getItilObjectForeignKey() => $this->fields['id'], 'type' => CommonITILActor::ASSIGN, '_from_object' => true); foreach ($this->input["_additional_assigns"] as $tmp) { if (isset($tmp['users_id'])) { foreach ($tmp as $key => $val) { $input2[$key] = $val; } $useractors->add($input2); } } } if (isset($this->input["_additional_requesters"]) && is_array($this->input["_additional_requesters"]) && count($this->input["_additional_requesters"])) { $input2 = array($useractors->getItilObjectForeignKey() => $this->fields['id'], 'type' => CommonITILActor::REQUESTER, '_from_object' => true); foreach ($this->input["_additional_requesters"] as $tmp) { if (isset($tmp['users_id'])) { foreach ($tmp as $key => $val) { $input2[$key] = $val; } $useractors->add($input2); } } } } } /** * add files (from $_FILES) to an ITIL object * create document if needed * create link from document to ITIL object * * @param $id Integer ID of the ITIL object * @param $donotif Boolean if we want to raise notification (default 1) * * @return array of doc added name **/ function addFiles($id, $donotif=1) { global $CFG_GLPI; if (!isset($_FILES) || !isset($_FILES['filename'])) { return array(); } $docadded = array(); $doc = new Document(); $docitem = new Document_Item(); // if multiple files are uploaded $TMPFILE = array(); if (is_array($_FILES['filename']['name'])) { foreach ($_FILES['filename']['name'] as $key => $filename) { if (!empty($filename)) { $TMPFILE[$key]['filename']['name'] = $filename; $TMPFILE[$key]['filename']['type'] = $_FILES['filename']['type'][$key]; $TMPFILE[$key]['filename']['tmp_name'] = $_FILES['filename']['tmp_name'][$key]; $TMPFILE[$key]['filename']['error'] = $_FILES['filename']['error'][$key]; $TMPFILE[$key]['filename']['size'] = $_FILES['filename']['size'][$key]; } } } else { $TMPFILE = array( $_FILES ); } foreach ($TMPFILE as $_FILES) { if (isset($_FILES['filename']) && (count($_FILES['filename']) > 0) && ($_FILES['filename']["size"] > 0)) { // Check for duplicate if ($doc->getFromDBbyContent($this->fields["entities_id"], $_FILES['filename']['tmp_name'])) { $docID = $doc->fields["id"]; } else { $input2 = array(); //TRANS: Default document to files attached to tickets : %d is the ticket id $input2["name"] = addslashes(sprintf(__('Document Ticket %d'), $id)); if ($this->getType() == 'Ticket') { $input2["tickets_id"] = $id; } $input2["entities_id"] = $this->fields["entities_id"]; $input2["documentcategories_id"] = $CFG_GLPI["documentcategories_id_forticket"]; $input2["_only_if_upload_succeed"] = 1; $input2["entities_id"] = $this->fields["entities_id"]; $docID = $doc->add($input2); } if ($docID > 0) { if ($docitem->add(array('documents_id' => $docID, '_do_notif' => $donotif, 'itemtype' => $this->getType(), 'items_id' => $id))) { $docadded[] = sprintf(__('%1$s - %2$s'), stripslashes($doc->fields["name"]), stripslashes($doc->fields["filename"])); } } } else if (!empty($_FILES['filename']['name']) && isset($_FILES['filename']['error']) && $_FILES['filename']['error']) { Session::addMessageAfterRedirect(__('Failed to send the file (probably too large)'), false, ERROR); } // Only notification for the first New doc $donotif = 0; } unset ($_FILES); return $docadded; } /** * Compute Priority * * @since version 0.84 * * @param $urgency integer from 1 to 5 * @param $impact integer from 1 to 5 * * @return integer from 1 to 5 (priority) **/ static function computePriority($urgency, $impact) { global $CFG_GLPI; if (isset($CFG_GLPI[static::MATRIX_FIELD][$urgency][$impact])) { return $CFG_GLPI[static::MATRIX_FIELD][$urgency][$impact]; } // Failback to trivial return round(($urgency+$impact)/2); } /** * Dropdown of ITIL object priority * * @since version 0.84 new proto * * @param $options array of options * - name : select name (default is urgency) * - value : default value (default 0) * - showtype : list proposed : normal, search (default normal) * - wthmajor : boolean with major priority ? * - display : boolean if false get string * * @return string id of the select **/ static function dropdownPriority(array $options=array()) { $p['name'] = 'priority'; $p['value'] = 0; $p['showtype'] = 'normal'; $p['display'] = true; $p['withmajor'] = false; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } $id = "select_".$p['name'].mt_rand(); $output = ""; if ($p['display']) { echo $output; return $id; } return $output; } /** * Get ITIL object priority Name * * @param $value status ID **/ static function getPriorityName($value) { switch ($value) { case 6 : return _x('priority', 'Major'); case 5 : return _x('priority', 'Very high'); case 4 : return _x('priority', 'High'); case 3 : return _x('priority', 'Medium'); case 2 : return _x('priority', 'Low'); case 1 : return _x('priority', 'Very low'); default : // Return $value if not define return $value; } } /** * Dropdown of ITIL object Urgency * * @since version 0.84 new proto * * @param $options array of options * - name : select name (default is urgency) * - value : default value (default 0) * - showtype : list proposed : normal, search (default normal) * - display : boolean if false get string * * @return string id of the select **/ static function dropdownUrgency(array $options = array()) { global $CFG_GLPI; $p['name'] = 'urgency'; $p['value'] = 0; $p['showtype'] = 'normal'; $p['display'] = true; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } $id = "select_".$p['name'].mt_rand(); $output = ""; if ($p['display']) { echo $output; return $id; } return $output; } /** * Get ITIL object Urgency Name * * @param $value urgency ID **/ static function getUrgencyName($value) { switch ($value) { case 5 : return _x('urgency', 'Very high'); case 4 : return _x('urgency', 'High'); case 3 : return _x('urgency', 'Medium'); case 2 : return _x('urgency', 'Low'); case 1 : return _x('urgency', 'Very low'); default : // Return $value if not define return $value; } } /** * Dropdown of ITIL object Impact * * @since version 0.84 new proto * * @param $options array of options * - name : select name (default is impact) * - value : default value (default 0) * - showtype : list proposed : normal, search (default normal) * - display : boolean if false get string * * \ * @return string id of the select **/ static function dropdownImpact(array $options = array()) { global $CFG_GLPI; $p['name'] = 'impact'; $p['value'] = 0; $p['showtype'] = 'normal'; $p['display'] = true; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } $id = "select_".$p['name'].mt_rand(); $output = ""; if ($p['display']) { echo $output; return $id; } return $output; } /** * Get ITIL object Impact Name * * @param $value status ID **/ static function getImpactName($value) { switch ($value) { case 5 : return _x('impact', 'Very high'); case 4 : return _x('impact', 'High'); case 3 : return _x('impact', 'Medium'); case 2 : return _x('impact', 'Low'); case 1 : return _x('impact', 'Very low'); default : // Return $value if not define return $value; } } /** * Get the ITIL object status list * * @param $withmetaforsearch boolean (false by default) * * @return an array **/ static function getAllStatusArray($withmetaforsearch=false) { // To be overridden by class $tab = array(); return $tab; } /** * Get the ITIL object closed status list * * @since version 0.83 * * @return an array **/ static function getClosedStatusArray() { // To be overridden by class $tab = array(); return $tab; } /** * Get the ITIL object solved status list * * @since version 0.83 * * @return an array **/ static function getSolvedStatusArray() { // To be overridden by class $tab = array(); return $tab; } /** * Get the ITIL object new status list * * @since version 0.83.8 * * @return an array **/ static function getNewStatusArray() { // To be overriden by class $tab = array(); return $tab; } /** * Get the ITIL object process status list * * @since version 0.83 * * @return an array **/ static function getProcessStatus() { // To be overridden by class $tab = array(); return $tab; } /** * check is the user can change from / to a status * * @since version 0.84 * * @param $old string value of old/current status * @param $new string value of target status * * @return boolean **/ static function isAllowedStatus($old, $new) { if (isset($_SESSION['glpiactiveprofile'][static::STATUS_MATRIX_FIELD][$old][$new]) && !$_SESSION['glpiactiveprofile'][static::STATUS_MATRIX_FIELD][$old][$new]) { return false; } if (array_key_exists(static::STATUS_MATRIX_FIELD, $_SESSION['glpiactiveprofile'])) { // Not set for post-only) return true; } return false; } /** * Get the ITIL object status allowed for a current status * * @since version 0.84 new proto * * @param $current status * * @return an array **/ static function getAllowedStatusArray($current) { $tab = static::getAllStatusArray(); if (!isset($current)) { $current = self::INCOMING; } foreach ($tab as $status => $label) { if (($status != $current) && !self::isAllowedStatus($current, $status)) { unset($tab[$status]); } } return $tab; } /** * Dropdown of object status * * @since version 0.84 new proto * * @param $options array of options * - name : select name (default is status) * - value : default value (default self::INCOMING) * - showtype : list proposed : normal, search or allowed (default normal) * - display : boolean if false get string * * @return nothing (display) **/ static function dropdownStatus(array $options=array()) { $p['name'] = 'status'; $p['value'] = self::INCOMING; $p['showtype'] = 'normal'; $p['display'] = true; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } switch ($p['showtype']) { case 'allowed' : $tab = static::getAllowedStatusArray($p['value']); break; case 'search' : $tab = static::getAllStatusArray(true); break; default : $tab = static::getAllStatusArray(false); break; } $output = ""; if ($p['display']) { echo $output; } else { return $output; } } /** * Get ITIL object status Name * * @since version 0.84 * * @param $value status ID **/ static function getStatus($value) { $tab = static::getAllStatusArray(true); // Return $value if not defined return (isset($tab[$value]) ? $tab[$value] : $value); } /** * show groups asociated * * @param $type integer : user type * @param $canedit boolean : can edit ? * * @return nothing display **/ function showGroupsAssociated($type, $canedit) { global $CFG_GLPI; $groupicon = self::getActorIcon('group',$type); $group = new Group(); if (isset($this->groups[$type]) && count($this->groups[$type])) { foreach ($this->groups[$type] as $d) { $k = $d['groups_id']; echo "$groupicon "; if ($group->getFromDB($k)) { echo $group->getLink(array('comments' => true)); } if ($canedit) { echo " "; Html::showSimpleForm($this->getFormURL(), 'delete_group', _x('button', 'Delete permanently'), array('id' => $d['id'], $this->getForeignKeyField() => $this->fields['id']), $CFG_GLPI["root_doc"]."/pics/delete.png"); } echo '
'; } } } /** * show suppliers associated * * @since version 0.84 * * @param $type integer : user type * @param $canedit boolean : can edit ? * * @return nothing display **/ function showSuppliersAssociated($type, $canedit) { global $CFG_GLPI; $showsupplierlink = 0; if (Session::haveRight('contact_enterprise','r')) { $showsupplierlink = 1; } $suppliericon = self::getActorIcon('supplier',$type); $supplier = new Supplier(); if (isset($this->suppliers[$type]) && count($this->suppliers[$type])) { foreach ($this->suppliers[$type] as $d) { $k = $d['suppliers_id']; echo "$suppliericon "; if ($supplier->getFromDB($k)) { echo $supplier->getLink(array('comments' => $showsupplierlink)); echo " "; $tmpname = Dropdown::getDropdownName($supplier->getTable(), $k, 1); Html::showToolTip($tmpname['comment']); } if ($canedit) { echo " "; Html::showSimpleForm($this->getFormURL(), 'delete_supplier', _x('button', 'Delete permanently'), array('id' => $d['id'], $this->getForeignKeyField() => $this->fields['id']), $CFG_GLPI["root_doc"]."/pics/delete.png"); } echo '
'; } } } /** * display a value according to a field * * @since version 0.83 * * @param $field String name of the field * @param $values String / Array with the value to display * @param $options Array of option * * @return a string **/ static function getSpecificValueToDisplay($field, $values, array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } switch ($field) { case 'status': return self::getStatus($values[$field]); case 'urgency': return self::getUrgencyName($values[$field]); case 'impact': return self::getImpactName($values[$field]); case 'priority': return self::getPriorityName($values[$field]); } return parent::getSpecificValueToDisplay($field, $values, $options); } /** * @since version 0.84 * * @param $field * @param $name (default '') * @param $values (default '') * @param $options array **/ static function getSpecificValueToSelect($field, $name='', $values='', array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'status' : $options['name'] = $name; $options['value'] = $values[$field]; return self::dropdownStatus($options); case 'impact' : $options['name'] = $name; $options['value'] = $values[$field]; return self::dropdownImpact($options); case 'urgency' : $options['name'] = $name; $options['value'] = $values[$field]; return self::dropdownUrgency($options); case 'priority' : $options['name'] = $name; $options['value'] = $values[$field]; return self::dropdownPriority($options); } return parent::getSpecificValueToSelect($field, $name, $values, $options); } /** * @see CommonDBTM::showSpecificMassiveActionsParameters() **/ function showSpecificMassiveActionsParameters($input=array()) { global $CFG_GLPI; switch ($input['action']) { case "add_task" : $tasktype = $input['itemtype']."Task"; if ($ttype = getItemForItemtype($tasktype)) { $ttype->showFormMassiveAction(); return true; } break; case "add_actor" : $types = array(0 => Dropdown::EMPTY_VALUE, CommonITILActor::REQUESTER => __('Requester'), CommonITILActor::OBSERVER => __('Watcher'), CommonITILActor::ASSIGN => __('Assigned to')); $rand = Dropdown::showFromArray('actortype', $types); $paramsmassaction = array('actortype' => '__VALUE__'); Ajax::updateItemOnSelectEvent("dropdown_actortype$rand", "show_massiveaction_field", $CFG_GLPI["root_doc"]. "/ajax/dropdownMassiveActionAddActor.php", $paramsmassaction); echo " \n"; return true; default : return parent::showSpecificMassiveActionsParameters($input); } return false; } /** * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "add_actor" : $item = new $input['itemtype'](); foreach ($input["item"] as $key => $val) { if ($val == 1) { $input2 = array('id' => $key); if (isset($input['_itil_requester'])) { $input2['_itil_requester'] = $input['_itil_requester']; } if (isset($input['_itil_observer'])) { $input2['_itil_observer'] = $input['_itil_observer']; } if (isset($input['_itil_assign'])) { $input2['_itil_assign'] = $input['_itil_assign']; } if ($item->can($key,'w')) { if ($item->update($input2)) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } } break; case "add_task" : $taskitemtype = $_POST['itemtype'].'Task'; if (!($task = getItemForItemtype($taskitemtype))) { return false; } $field = $this->getForeignKeyField(); foreach ($input["item"] as $key => $val) { if ($val == 1) { $input2 = array($field => $key, 'taskcategories_id' => $input['taskcategories_id'], 'content' => $input['content']); if ($task->can(-1,'w',$input2)) { if ($task->add($input2)) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } } break; default : return parent::doSpecificMassiveActions($input); } return $res; } function getSearchOptionsStats() { $tab = array(); $tab['stats'] = __('Statistics'); $tab[151]['table'] = $this->getTable(); $tab[151]['field'] = 'solve_delay_stat'; $tab[151]['name'] = __('Resolution time'); $tab[151]['datatype'] = 'timestamp'; $tab[151]['forcegroupby'] = true; $tab[151]['massiveaction'] = false; $tab[152]['table'] = $this->getTable(); $tab[152]['field'] = 'close_delay_stat'; $tab[152]['name'] = __('Closing time'); $tab[152]['datatype'] = 'timestamp'; $tab[152]['forcegroupby'] = true; $tab[152]['massiveaction'] = false; $tab[153]['table'] = $this->getTable(); $tab[153]['field'] = 'waiting_duration'; $tab[153]['name'] = __('Waiting time'); $tab[153]['datatype'] = 'timestamp'; $tab[153]['forcegroupby'] = true; $tab[153]['massiveaction'] = false; return $tab; } function getSearchOptionsActors() { $tab = array(); $tab['requester'] = __('Requester'); $tab[4]['table'] = 'glpi_users'; $tab[4]['field'] = 'name'; $tab[4]['datatype'] = 'dropdown'; $tab[4]['right'] = 'all'; $tab[4]['name'] = __('Requester'); $tab[4]['forcegroupby'] = true; $tab[4]['massiveaction'] = false; $tab[4]['joinparams'] = array('beforejoin' => array('table' => getTableForItemType($this->userlinkclass), 'joinparams' => array('jointype' => 'child', 'condition' => 'AND NEWTABLE.`type` = '.CommonITILActor::REQUESTER))); if (!Session::isCron() // no filter for cron && isset($_SESSION['glpiactiveprofile']['interface']) && $_SESSION['glpiactiveprofile']['interface'] == 'helpdesk') { $tab[4]['right'] = 'id'; } $tab[71]['table'] = 'glpi_groups'; $tab[71]['field'] = 'completename'; $tab[71]['datatype'] = 'dropdown'; $tab[71]['name'] = __('Requester group'); $tab[71]['forcegroupby'] = true; $tab[71]['massiveaction'] = false; $tab[71]['condition'] = 'is_requester'; $tab[71]['joinparams'] = array('beforejoin' => array('table' => getTableForItemType($this->grouplinkclass), 'joinparams' => array('jointype' => 'child', 'condition' => 'AND NEWTABLE.`type` = '.CommonITILActor::REQUESTER))); if (!Session::isCron() // no filter for cron && isset($_SESSION['glpiactiveprofile']['interface']) && $_SESSION['glpiactiveprofile']['interface'] == 'helpdesk') { $tab[71]['condition'] .= " AND `id` IN ('".implode("','",$_SESSION['glpigroups'])."')"; } $tab[22]['table'] = 'glpi_users'; $tab[22]['field'] = 'name'; $tab[22]['datatype'] = 'dropdown'; $tab[22]['right'] = 'all'; $tab[22]['linkfield'] = 'users_id_recipient'; $tab[22]['name'] = __('Writer'); if (!Session::isCron() // no filter for cron && isset($_SESSION['glpiactiveprofile']['interface']) && $_SESSION['glpiactiveprofile']['interface'] == 'helpdesk') { $tab[22]['right'] = 'id'; } $tab['observer'] = __('Watcher'); $tab[66]['table'] = 'glpi_users'; $tab[66]['field'] = 'name'; $tab[66]['datatype'] = 'dropdown'; $tab[66]['right'] = 'all'; $tab[66]['name'] = __('Watcher'); $tab[66]['forcegroupby'] = true; $tab[66]['massiveaction'] = false; $tab[66]['joinparams'] = array('beforejoin' => array('table' => getTableForItemType($this->userlinkclass), 'joinparams' => array('jointype' => 'child', 'condition' => 'AND NEWTABLE.`type` = '.CommonITILActor::OBSERVER))); $tab[65]['table'] = 'glpi_groups'; $tab[65]['field'] = 'completename'; $tab[65]['datatype'] = 'dropdown'; $tab[65]['name'] = __('Watcher group'); $tab[65]['forcegroupby'] = true; $tab[65]['massiveaction'] = false; $tab[65]['condition'] = 'is_requester'; $tab[65]['joinparams'] = array('beforejoin' => array('table' => getTableForItemType($this->grouplinkclass), 'joinparams' => array('jointype' => 'child', 'condition' => 'AND NEWTABLE.`type` = '.CommonITILActor::OBSERVER))); $tab['assign'] = __('Assigned to'); $tab[5]['table'] = 'glpi_users'; $tab[5]['field'] = 'name'; $tab[5]['datatype'] = 'dropdown'; $tab[5]['right'] = 'own_ticket'; $tab[5]['name'] = __('Technician'); $tab[5]['forcegroupby'] = true; $tab[5]['massiveaction'] = false; $tab[5]['joinparams'] = array('beforejoin' => array('table' => getTableForItemType($this->userlinkclass), 'joinparams' => array('jointype' => 'child', 'condition' => 'AND NEWTABLE.`type` = '.CommonITILActor::ASSIGN))); $tab[6]['table'] = 'glpi_suppliers'; $tab[6]['field'] = 'name'; $tab[6]['datatype'] = 'dropdown'; $tab[6]['name'] = __('Assigned to a supplier'); $tab[6]['forcegroupby'] = true; $tab[6]['massiveaction'] = false; $tab[6]['joinparams'] = array('beforejoin' => array('table' => getTableForItemType($this->supplierlinkclass), 'joinparams' => array('jointype' => 'child', 'condition' => 'AND NEWTABLE.`type` = '.CommonITILActor::ASSIGN))); $tab[8]['table'] = 'glpi_groups'; $tab[8]['field'] = 'completename'; $tab[8]['datatype'] = 'dropdown'; $tab[8]['name'] = __('Technician group'); $tab[8]['forcegroupby'] = true; $tab[8]['massiveaction'] = false; $tab[8]['condition'] = 'is_assign'; $tab[8]['joinparams'] = array('beforejoin' => array('table' => getTableForItemType($this->grouplinkclass), 'joinparams' => array('jointype' => 'child', 'condition' => 'AND NEWTABLE.`type` = '.CommonITILActor::ASSIGN))); $tab['notification'] = _n('Notification', 'Notifications',2); $tab[35]['table'] = getTableForItemType($this->userlinkclass); $tab[35]['field'] = 'use_notification'; $tab[35]['name'] = __('Email followup'); $tab[35]['datatype'] = 'bool'; $tab[35]['massiveaction'] = false; $tab[35]['joinparams'] = array('jointype' => 'child', 'condition' => 'AND NEWTABLE.`type` = '.CommonITILActor::REQUESTER); $tab[34]['table'] = getTableForItemType($this->userlinkclass); $tab[34]['field'] = 'alternative_email'; $tab[34]['name'] = __('Email for followup'); $tab[34]['datatype'] = 'email'; $tab[34]['massiveaction'] = false; $tab[34]['joinparams'] = array('jointype' => 'child', 'condition' => 'AND NEWTABLE.`type` = '.CommonITILActor::REQUESTER); return $tab; } /** * Get status icon URL * * @since version 0.84 * * @param $status status to get icon URL * * @return icon URL **/ static function getStatusIconURL($status) { global $CFG_GLPI; switch ($status) { case self::INCOMING : return $CFG_GLPI["root_doc"]."/pics/new.png"; case self::ASSIGNED : return $CFG_GLPI["root_doc"]."/pics/assign.png"; case self::PLANNED : return $CFG_GLPI["root_doc"]."/pics/plan.png"; case self::WAITING : return $CFG_GLPI["root_doc"]."/pics/waiting.png"; case self::SOLVED : return $CFG_GLPI["root_doc"]."/pics/solved.png"; case self::CLOSED : return $CFG_GLPI["root_doc"]."/pics/closed.png"; case self::ACCEPTED : return $CFG_GLPI["root_doc"]."/pics/accepted.png"; case self::OBSERVED : return $CFG_GLPI["root_doc"]."/pics/observe.png"; case self::EVALUATION : return $CFG_GLPI["root_doc"]."/pics/evaluation.png"; case self::APPROVAL : return $CFG_GLPI["root_doc"]."/pics/approbation.png"; case self::TEST : return $CFG_GLPI["root_doc"]."/pics/test.png"; case self::QUALIFICATION : return $CFG_GLPI["root_doc"]."/pics/qualification.png"; } return ''; } /** * show Icon for Actor * * @param $user_group string 'user or 'group' * @param $type integer user/group type * * @return nothing display **/ static function getActorIcon($user_group, $type) { global $CFG_GLPI; switch ($user_group) { case 'user' : $icontitle = __s('User').' - '.$type; // should never be used switch ($type) { case CommonITILActor::REQUESTER : $icontitle = __s('Requester user'); break; case CommonITILActor::OBSERVER : $icontitle = __s('Watcher user'); break; case CommonITILActor::ASSIGN : $icontitle = __s('Technician'); break; } return "\"$icontitle\""; case 'group' : $icontitle = __('Group'); switch ($type) { case CommonITILActor::REQUESTER : $icontitle = __('Requester group'); break; case CommonITILActor::OBSERVER : $icontitle = __('Watcher group'); break; case CommonITILActor::ASSIGN : $icontitle = __('Group in charge of the ticket'); break; } return "\"$icontitle\""; case 'supplier' : $icontitle = __('Supplier'); return "\"$icontitle\""; } return ''; } /** * show tooltip for user notification information * * @param $type integer user type * @param $canedit boolean can edit ? * * @return nothing display **/ function showUsersAssociated($type, $canedit) { global $CFG_GLPI; $showuserlink = 0; if (Session::haveRight('user','r')) { $showuserlink = 2; } $usericon = self::getActorIcon('user',$type); $user = new User(); if (isset($this->users[$type]) && count($this->users[$type])) { foreach ($this->users[$type] as $d) { $k = $d['users_id']; echo "$usericon "; if ($k) { $userdata = getUserName($k, 2); } else { $email = $d['alternative_email']; $userdata = "$email"; } if ($k) { $param = array('display' => false); if ($showuserlink) { $param['link'] = $userdata["link"]; } echo $userdata['name']." ".Html::showToolTip($userdata["comment"], $param); } else { echo $userdata; } if ($CFG_GLPI['use_mailing']) { $text = __('Email followup')." ".Dropdown::getYesNo($d['use_notification']). '
'; if ($d['use_notification']) { $uemail = $d['alternative_email']; if (empty($uemail) && $user->getFromDB($d['users_id'])) { $uemail = $user->getDefaultEmail(); } $text .= sprintf(__('%1$s: %2$s'),__('Email'), $uemail); if (!NotificationMail::isUserAddressValid($uemail)) { $text .= " ".__('Invalid email address').""; } } echo " "; if ($canedit || ($d['users_id'] == Session::getLoginUserID())) { $opt = array('img' => $CFG_GLPI['root_doc'].'/pics/edit.png', 'popup' => 'edit_user_notification&itemtype='.$this->getType().'&id='.$d['id']); Html::showToolTip($text, $opt); } } if ($canedit) { echo " "; Html::showSimpleForm($this->getFormURL(), 'delete_user', _x('button', 'Delete permanently'), array('id' => $d['id'], $this->getForeignKeyField() => $this->fields['id']), $CFG_GLPI["root_doc"]."/pics/delete.png"); } echo "
"; } } } /** * show actor add div * * @param $type string actor type * @param $rand_type integer rand value of div to use * @param $entities_id integer entity ID * @param $is_hidden array of hidden fields (if empty consider as not hidden) * @param $withgroup boolean allow adding a group (true by default) * @param $withsupplier boolean allow adding a supplier (only one possible in ASSIGN case) * (false by default) * @param $inobject boolean display in ITIL object ? (true by default) * * @return nothing display **/ function showActorAddForm($type, $rand_type, $entities_id, $is_hidden=array(), $withgroup=true, $withsupplier=false, $inobject=true) { global $CFG_GLPI; $types = array('' => Dropdown::EMPTY_VALUE, 'user' => __('User')); if ($withgroup) { $types['group'] = __('Group'); } if ($withsupplier && ($type == CommonITILActor::ASSIGN)) { $types['supplier'] = __('Supplier'); } switch ($type) { case CommonITILActor::REQUESTER : $typename = 'requester'; if (isset($is_hidden['_users_id_requester']) && $is_hidden['_users_id_requester']) { unset($types['user']); } if (isset($is_hidden['_groups_id_requester']) && $is_hidden['_groups_id_requester']) { unset($types['group']); } break; case CommonITILActor::OBSERVER : $typename = 'observer'; if (isset($is_hidden['_users_id_observer']) && $is_hidden['_users_id_observer']) { unset($types['user']); } if (isset($is_hidden['_groups_id_observer']) && $is_hidden['_groups_id_observer']) { unset($types['group']); } break; case CommonITILActor::ASSIGN : $typename = 'assign'; if (isset($is_hidden['_users_id_assign']) && $is_hidden['_users_id_assign']) { unset($types['user']); } if (isset($is_hidden['_groups_id_assign']) && $is_hidden['_groups_id_assign']) { unset($types['group']); } if (isset($types['supplier']) && isset($is_hidden['_suppliers_id_assign']) && $is_hidden['_suppliers_id_assign']) { unset($types['supplier']); } break; default : return false; } echo "
"; $rand = Dropdown::showFromArray("_itil_".$typename."[_type]", $types); $params = array('type' => '__VALUE__', 'actortype' => $typename, 'itemtype' => $this->getType(), 'allow_email' => (($type == CommonITILActor::OBSERVER) || $type == CommonITILActor::REQUESTER), 'entity_restrict' => $entities_id); Ajax::updateItemOnSelectEvent("dropdown__itil_".$typename."[_type]$rand", "showitilactor".$typename."_$rand", $CFG_GLPI["root_doc"]."/ajax/dropdownItilActors.php", $params); echo " "; if ($inobject) { echo "
"; } echo "
"; } /** * show user add div on creation * * @param $type integer actor type * @param $options array options for default values ($options of showForm) * * @return nothing display **/ function showActorAddFormOnCreate($type, array $options) { global $CFG_GLPI; switch ($type) { case CommonITILActor::REQUESTER : $typename = 'requester'; break; case CommonITILActor::OBSERVER : $typename = 'observer'; break; case CommonITILActor::ASSIGN : $typename = 'assign'; break; default : return false; } $itemtype = $this->getType(); echo self::getActorIcon('user', $type); // For ticket templates : mandatories if (($itemtype == 'Ticket') && isset($options['_tickettemplate'])) { echo $options['_tickettemplate']->getMandatoryMark("_users_id_".$typename); } echo " "; if (!isset($options["_right"])) { $right = $this->getDefaultActorRightSearch($type); } else { $right = $options["_right"]; } if ($options["_users_id_".$typename] == 0) { $options["_users_id_".$typename] = $this->getDefaultActor($type); } $rand = mt_rand(); $params = array('name' => '_users_id_'.$typename, 'value' => $options["_users_id_".$typename], 'right' => $right, 'rand' => $rand, 'ldap_import' => true); if ($this->userentity_oncreate && ($type == CommonITILActor::REQUESTER)) { $params['on_change'] = 'submit()'; } else { // Force entity search if needed $params['entity'] = $options['entities_id']; } if ($CFG_GLPI['use_mailing']) { $paramscomment = array('value' => '__VALUE__', 'field' => "_users_id_".$typename."_notif", 'allow_email' => (($type == CommonITILActor::REQUESTER) || ($type == CommonITILActor::OBSERVER)), 'use_notification' => $options["_users_id_".$typename."_notif"]['use_notification']); if (isset($options["_users_id_".$typename."_notif"]['alternative_email'])) { $paramscomment['alternative_email'] = $options["_users_id_".$typename."_notif"]['alternative_email']; } $params['toupdate'] = array('value_fieldname' => 'value', 'to_update' => "notif_".$typename."_$rand", 'url' => $CFG_GLPI["root_doc"]."/ajax/uemailUpdate.php", 'moreparams' => $paramscomment); } if (($itemtype == 'Ticket') && ($type == CommonITILActor::ASSIGN)) { $toupdate = array(); if (isset($params['toupdate']) && is_array($params['toupdate'])) { $toupdate[] = $params['toupdate']; } $toupdate[] = array('value_fieldname' => 'value', 'to_update' => "countassign_$rand", 'url' => $CFG_GLPI["root_doc"]. "/ajax/ticketassigninformation.php", 'moreparams' => array('users_id_assign' => '__VALUE__')); $params['toupdate'] = $toupdate; } // List all users in the active entities User::dropdown($params); if ($itemtype == 'Ticket') { // display opened tickets for user if (($type == CommonITILActor::REQUESTER) && ($options["_users_id_".$typename] > 0) && ($_SESSION["glpiactiveprofile"]["interface"] != "helpdesk")) { $options2['field'][0] = 4; // users_id $options2['searchtype'][0] = 'equals'; $options2['contains'][0] = $options["_users_id_".$typename]; $options2['link'][0] = 'AND'; $options2['field'][1] = 12; // status $options2['searchtype'][1] = 'equals'; $options2['contains'][1] = 'notold'; $options2['link'][1] = 'AND'; $options2['reset'] = 'reset'; $url = $this->getSearchURL()."?".Toolbox::append_params($options2,'&'); echo " ("; printf(__('%1$s: %2$s'), __('Processing'), $this->countActiveObjectsForUser($options["_users_id_".$typename])); echo ")"; } // Display active tickets for a tech // Need to update information on dropdown changes if ($type == CommonITILActor::ASSIGN) { echo ""; echo ""; echo ""; } } if ($CFG_GLPI['use_mailing']) { echo "
"; echo "
"; echo ""; } } /** * show actor part in ITIL object form * * @param $ID integer ITIL object ID * @param $options array options for default values ($options of showForm) * * @return nothing display **/ function showActorsPartForm($ID, array $options) { global $CFG_GLPI; $showuserlink = 0; if (Session::haveRight('user','r')) { $showuserlink = 1; } // check is_hidden fields foreach (array('_users_id_requester', '_groups_id_requester', '_users_id_observer', '_groups_id_observer', '_users_id_assign', '_groups_id_assign', '_suppliers_id_assign') as $f) { $is_hidden[$f] = false; if (isset($options['_tickettemplate']) && $options['_tickettemplate']->isHiddenField($f)) { $is_hidden[$f] = true; } } $can_admin = $this->canAdminActors(); $can_assign = $this->canAssign(); $can_assigntome = $this->canAssignToMe(); if (isset($options['_noupdate']) && $options['_noupdate']) { $can_admin = false; $can_assign = false; $can_assigntome = false; } // Manage actors : requester and assign echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
".__('Actor').""; if (!$is_hidden['_users_id_requester'] || !$is_hidden['_groups_id_requester']) { _e('Requester'); } $rand_requester = -1; $candeleterequester = false; if ($ID && $can_admin && (!$is_hidden['_users_id_requester'] || !$is_hidden['_groups_id_requester'])) { $rand_requester = mt_rand(); echo "  "; echo "\"".__s('Add')."\""; $candeleterequester = true; } echo ""; if (!$is_hidden['_users_id_observer'] || !$is_hidden['_groups_id_observer']) { _e('Watcher'); } $rand_observer = -1; $candeleteobserver = false; if ($ID && $can_admin && (!$is_hidden['_users_id_observer'] || !$is_hidden['_groups_id_observer'])) { $rand_observer = mt_rand(); echo "  "; echo "\"".__s('Add')."\""; $candeleteobserver = true; } else if (($ID > 0) && !in_array($this->fields['status'], $this->getClosedStatusArray()) && !$is_hidden['_users_id_observer'] && !$this->isUser(CommonITILActor::OBSERVER, Session::getLoginUserID()) && !$this->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID())) { echo "    "; Html::showSimpleForm($this->getFormURL(), 'addme_observer', __('Associate myself with this ticket'), array('tickets_id' => $this->fields['id'])); } echo ""; if (!$is_hidden['_users_id_assign'] || !$is_hidden['_groups_id_assign'] || !$is_hidden['_suppliers_id_assign']) { _e('Assigned to'); } $rand_assign = -1; $candeleteassign = false; if ($ID && ($can_assign || $can_assigntome) && (!$is_hidden['_users_id_assign'] || !$is_hidden['_groups_id_assign'] || !$is_hidden['_suppliers_id_assign'])) { $rand_assign = mt_rand(); echo "  "; echo "\"".__s('Add')."\""; } if ($ID && $can_assign) { $candeleteassign = true; } echo "
"; if ($rand_requester >= 0) { $this->showActorAddForm(CommonITILActor::REQUESTER, $rand_requester, $this->fields['entities_id'], $is_hidden); } // Requester if (!$ID) { $reqdisplay = false; if ($can_admin && !$is_hidden['_users_id_requester']) { $this->showActorAddFormOnCreate(CommonITILActor::REQUESTER, $options); $reqdisplay = true; } else { $delegating = User::getDelegateGroupsForUser($options['entities_id']); if (count($delegating) && !$is_hidden['_users_id_requester']) { //$this->getDefaultActor(CommonITILActor::REQUESTER); $options['_right'] = "delegate"; $this->showActorAddFormOnCreate(CommonITILActor::REQUESTER, $options); $reqdisplay = true; } else { // predefined value if (isset($options["_users_id_requester"]) && $options["_users_id_requester"]) { echo self::getActorIcon('user', CommonITILActor::REQUESTER)." "; echo Dropdown::getDropdownName("glpi_users", $options["_users_id_requester"]); echo ""; echo '
'; $reqdisplay=true; } } } //If user have access to more than one entity, then display a combobox : Ticket case if ($this->userentity_oncreate && isset($this->countentitiesforuser) && ($this->countentitiesforuser > 1)) { echo "
"; $rand = Entity::dropdown(array('value' => $this->fields["entities_id"], 'entity' => $this->userentities, 'on_change' => 'submit()')); } else { echo ""; } if ($reqdisplay) { echo '
'; } } else if (!$is_hidden['_users_id_requester']) { $this->showUsersAssociated(CommonITILActor::REQUESTER, $candeleterequester); } // Requester Group if (!$ID) { if ($can_admin && !$is_hidden['_groups_id_requester']) { echo self::getActorIcon('group', CommonITILActor::REQUESTER); /// For ticket templates : mandatories if (isset($options['_tickettemplate'])) { echo $options['_tickettemplate']->getMandatoryMark('_groups_id_requester'); } echo " "; Group::dropdown(array('name' => '_groups_id_requester', 'value' => $options["_groups_id_requester"], 'entity' => $this->fields["entities_id"], 'condition' => '`is_requester`')); } else { // predefined value if (isset($options["_groups_id_requester"]) && $options["_groups_id_requester"]) { echo self::getActorIcon('group', CommonITILActor::REQUESTER)." "; echo Dropdown::getDropdownName("glpi_groups", $options["_groups_id_requester"]); echo ""; echo '
'; } } } else if (!$is_hidden['_groups_id_requester']) { $this->showGroupsAssociated(CommonITILActor::REQUESTER, $candeleterequester); } echo "
"; if ($rand_observer >= 0) { $this->showActorAddForm(CommonITILActor::OBSERVER, $rand_observer, $this->fields['entities_id'], $is_hidden); } // Observer if (!$ID) { if ($can_admin && !$is_hidden['_users_id_observer']) { $this->showActorAddFormOnCreate(CommonITILActor::OBSERVER, $options); echo '
'; } else { // predefined value if (isset($options["_users_id_observer"]) && $options["_users_id_observer"]) { echo self::getActorIcon('user', CommonITILActor::OBSERVER)." "; echo Dropdown::getDropdownName("glpi_users", $options["_users_id_observer"]); echo ""; echo '
'; } } } else if (!$is_hidden['_users_id_observer']) { $this->showUsersAssociated(CommonITILActor::OBSERVER, $candeleteobserver); } // Observer Group if (!$ID) { if ($can_admin && !$is_hidden['_groups_id_observer']) { echo self::getActorIcon('group', CommonITILActor::OBSERVER); /// For ticket templates : mandatories if (isset($options['_tickettemplate'])) { echo $options['_tickettemplate']->getMandatoryMark('_groups_id_observer'); } echo " "; Group::dropdown(array('name' => '_groups_id_observer', 'value' => $options["_groups_id_observer"], 'entity' => $this->fields["entities_id"], 'condition' => '`is_requester`')); } else { // predefined value if (isset($options["_groups_id_observer"]) && $options["_groups_id_observer"]) { echo self::getActorIcon('group', CommonITILActor::OBSERVER)." "; echo Dropdown::getDropdownName("glpi_groups", $options["_groups_id_observer"]); echo ""; echo '
'; } } } else if (!$is_hidden['_groups_id_observer']) { $this->showGroupsAssociated(CommonITILActor::OBSERVER, $candeleteobserver); } echo "
"; if ($rand_assign >= 0) { $this->showActorAddForm(CommonITILActor::ASSIGN, $rand_assign, $this->fields['entities_id'], $is_hidden, $can_assign, $can_assign); } // Assign User if (!$ID) { if ($can_assign && !$is_hidden['_users_id_assign']) { $this->showActorAddFormOnCreate(CommonITILActor::ASSIGN, $options); echo '
'; } else if ($can_assigntome && !$is_hidden['_users_id_assign']) { echo self::getActorIcon('user', CommonITILActor::ASSIGN)." "; User::dropdown(array('name' => '_users_id_assign', 'value' => $options["_users_id_assign"], 'entity' => $this->fields["entities_id"], 'ldap_import' => true)); echo '
'; } else { // predefined value if (isset($options["_users_id_assign"]) && $options["_users_id_assign"]) { echo self::getActorIcon('user', CommonITILActor::ASSIGN)." "; echo Dropdown::getDropdownName("glpi_users", $options["_users_id_assign"]); echo ""; echo '
'; } } } else if (!$is_hidden['_users_id_assign']) { $this->showUsersAssociated(CommonITILActor::ASSIGN, $candeleteassign); } // Assign Groups if (!$ID) { if ($can_assign && !$is_hidden['_groups_id_assign']) { echo self::getActorIcon('group', CommonITILActor::ASSIGN); /// For ticket templates : mandatories if (isset($options['_tickettemplate'])) { echo $options['_tickettemplate']->getMandatoryMark('_groups_id_assign'); } echo " "; $rand = mt_rand(); $params = array('name' => '_groups_id_assign', 'value' => $options["_groups_id_assign"], 'entity' => $this->fields["entities_id"], 'condition' => '`is_assign`', 'rand' => $rand); if ($this->getType() == 'Ticket') { $params['toupdate'] = array('value_fieldname' => 'value', 'to_update' => "countgroupassign_$rand", 'url' => $CFG_GLPI["root_doc"]. "/ajax/ticketassigninformation.php", 'moreparams' => array('groups_id_assign' => '__VALUE__')); } Group::dropdown($params); echo ""; echo ""; echo ""; echo '
'; } else { // predefined value if (isset($options["_groups_id_assign"]) && $options["_groups_id_assign"]) { echo self::getActorIcon('group', CommonITILActor::ASSIGN)." "; echo Dropdown::getDropdownName("glpi_groups", $options["_groups_id_assign"]); echo ""; echo '
'; } } } else if (!$is_hidden['_groups_id_assign']) { $this->showGroupsAssociated(CommonITILActor::ASSIGN, $candeleteassign); } // Assign Suppliers if (!$ID) { if ($can_assign && !$is_hidden['_suppliers_id_assign']) { echo self::getActorIcon('supplier', CommonITILActor::ASSIGN); /// For ticket templates : mandatories if (isset($options['_tickettemplate'])) { echo $options['_tickettemplate']->getMandatoryMark('_suppliers_id_assign'); } echo " "; $rand = mt_rand(); $params = array('name' => '_suppliers_id_assign', 'value' => $options["_suppliers_id_assign"], 'entity' => $this->fields["entities_id"], 'rand' => $rand); Supplier::dropdown($params); } else { // predefined value if (isset($options["_suppliers_id_assign"]) && $options["_suppliers_id_assign"]) { echo self::getActorIcon('supplier', CommonITILActor::ASSIGN)." "; echo Dropdown::getDropdownName("glpi_suppliers", $options["_suppliers_id_assign"]); echo ""; echo '
'; } } } else if (!$is_hidden['_suppliers_id_assign']) { $this->showSuppliersAssociated(CommonITILActor::ASSIGN, $candeleteassign); } echo "
"; } /** * @param $actiontime **/ static function getActionTime($actiontime) { return Html::timestampToString($actiontime, false); } /** * @param $ID * @param $itemtype * @param $link (default 0) **/ static function getAssignName($ID, $itemtype, $link=0) { switch ($itemtype) { case 'User' : if ($ID == 0) { return ""; } return getUserName($ID,$link); case 'Supplier' : case 'Group' : $item = new $itemtype(); if ($item->getFromDB($ID)) { $before = ""; $after = ""; if ($link) { return $item->getLink(array('comments' => true)); } return $item->getNameID(); } return ""; } } /** * Form to add a solution to an ITIL object * * @param $knowbase_id_toload integer load a kb article as solution (0 = no load by default) * (default 0) **/ function showSolutionForm($knowbase_id_toload=0) { global $CFG_GLPI; $this->check($this->getField('id'), 'r'); $canedit = $this->canSolve(); $options = array(); if ($knowbase_id_toload > 0) { $kb = new KnowbaseItem(); if ($kb->getFromDB($knowbase_id_toload)) { $this->fields['solution'] = $kb->getField('answer'); } } $this->showFormHeader($options); $show_template = $canedit; // && $this->getField('solutiontypes_id') == 0 // && empty($this->fields['solution']); $rand_template = mt_rand(); $rand_text = $rand_type = 0; if ($canedit) { $rand_text = mt_rand(); $rand_type = mt_rand(); } if ($show_template) { echo ""; echo ""._n('Solution template', 'Solution templates', 1).""; SolutionTemplate::dropdown(array('value' => 0, 'entity' => $this->getEntityID(), 'rand' => $rand_template, // Load type and solution from bookmark 'toupdate' => array('value_fieldname' => 'value', 'to_update' => 'solution'.$rand_text, 'url' => $CFG_GLPI["root_doc"]. "/ajax/solution.php", 'moreparams' => array('type_id' => 'dropdown_solutiontypes_id'. $rand_type)))); echo ""; if (Session::haveRight('knowbase','r') || Session::haveRight('faq','r')) { echo "".__('Search a solution').""; } echo ""; } echo ""; echo "".__('Solution type').""; $current = $this->fields['status']; // Settings a solution will set status to solved if ($canedit) { SolutionType::dropdown(array('value' => $this->getField('solutiontypes_id'), 'rand' => $rand_type, 'entity' => $this->getEntityID())); } else { echo Dropdown::getDropdownName('glpi_solutiontypes', $this->getField('solutiontypes_id')); } echo " "; if ($canedit && Session::haveRight('knowbase','w')) { echo "".__('Save and add to the knowledge base').""; Dropdown::showYesNo('_sol_to_kb', false); echo " "; } echo ""; echo "".__('Description').""; if ($canedit) { $rand = mt_rand(); Html::initEditorSystem("solution$rand"); echo "
"; echo "
"; } else { echo Toolbox::unclean_cross_side_scripting_deep($this->getField('solution')); } echo ""; $options['candel'] = false; $options['canedit'] = $canedit; $this->showFormButtons($options); } /** * Form to add a solution to an ITIL object * * @since version 0.84 * * @param $entities_id **/ static function showMassiveSolutionForm($entities_id) { global $CFG_GLPI; echo ""; echo ''; $rand_template = mt_rand(); $rand_text = mt_rand(); $rand_type = mt_rand(); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo '
'.__('Solve tickets').'
"._n('Solution template', 'Solution templates', 1).""; SolutionTemplate::dropdown(array('value' => 0, 'entity' => $entities_id, 'rand' => $rand_template, // Load type and solution from bookmark 'toupdate' => array('value_fieldname' => 'value', 'to_update' => 'solution'.$rand_text, 'url' => $CFG_GLPI["root_doc"]. "/ajax/solution.php", 'moreparams' => array('type_id' => 'dropdown_solutiontypes_id'. $rand_type)))); echo " 
".__('Solution type').""; SolutionType::dropdown(array('value' => 0, 'rand' => $rand_type, 'entity' => $entities_id)); echo " 
".__('Description').""; $rand = mt_rand(); Html::initEditorSystem("solution$rand"); echo "
"; echo "
"; echo "
'; } /** * Update date mod of the ITIL object * * @param $ID integer ID of the ITIL object * @param $no_stat_computation boolean do not cumpute take into account stat (false by default) * @param $users_id_lastupdater integer to force last_update id (default 0 = not used) **/ function updateDateMod($ID, $no_stat_computation=false, $users_id_lastupdater=0) { global $DB; if ($this->getFromDB($ID)) { // Force date mod and lastupdater $query = "UPDATE `".$this->getTable()."` SET `date_mod` = '".$_SESSION["glpi_currenttime"]."'"; // set last updater if interactive user if (!Session::isCron()) { $query .= ", `users_id_lastupdater` = '".Session::getLoginUserID()."' "; } else if ($users_id_lastupdater > 0) { $query .= ", `users_id_lastupdater` = '$users_id_lastupdater' "; } $query .= "WHERE `id` = '$ID'"; $DB->query($query); } } /** * Update actiontime of the object based on actiontime of the tasks * * @param $ID ID of the object * * @return boolean : success **/ function updateActionTime($ID) { global $DB; $tot = 0; $tasktable = getTableForItemType($this->getType().'Task'); $query = "SELECT SUM(`actiontime`) FROM `$tasktable` WHERE `".$this->getForeignKeyField()."` = '$ID'"; if ($result = $DB->query($query)) { $sum = $DB->result($result,0,0); if (!is_null($sum)) { $tot += $sum; } } $query2 = "UPDATE `".$this->getTable()."` SET `actiontime` = '$tot' WHERE `id` = '$ID'"; return $DB->query($query2); } /** * Get all available types to which an ITIL object can be assigned **/ static function getAllTypesForHelpdesk() { global $PLUGIN_HOOKS, $CFG_GLPI; /// TODO ticket_types -> itil_types $types = array(); //Types of the plugins (keep the plugin hook for right check) if (isset($PLUGIN_HOOKS['assign_to_ticket'])) { foreach ($PLUGIN_HOOKS['assign_to_ticket'] as $plugin => $value) { $types = Plugin::doOneHook($plugin, 'AssignToTicket', $types); } } //Types of the core (after the plugin for robustness) foreach ($CFG_GLPI["ticket_types"] as $itemtype) { if ($item = getItemForItemtype($itemtype)) { if (!isPluginItemType($itemtype) // No plugin here && in_array($itemtype,$_SESSION["glpiactiveprofile"]["helpdesk_item_type"])) { $types[$itemtype] = $item->getTypeName(1); } } } ksort($types); // core type first... asort could be better ? return $types; } /** * Check if it's possible to assign ITIL object to a type (core or plugin) * * @param $itemtype the object's type * * @return true if ticket can be assign to this type, false if not **/ static function isPossibleToAssignType($itemtype) { global $PLUGIN_HOOKS; /// TODO : assign_to_ticket to assign_to_itil // Plugin case if ($plug = isPluginItemType($itemtype)) { //If it's not a core's type, then check plugins $types = array(); if (isset($PLUGIN_HOOKS['assign_to_ticket'])) { $types = Plugin::doOneHook($plug['plugin'], 'AssignToTicket', $types); if (array_key_exists($itemtype,$types)) { return true; } } // standard case } else { if (in_array($itemtype, $_SESSION["glpiactiveprofile"]["helpdesk_item_type"])) { return true; } } return false; } /** * Compute solve delay stat of the current ticket **/ function computeSolveDelayStat() { if (isset($this->fields['id']) && !empty($this->fields['date']) && !empty($this->fields['solvedate'])) { $calendars_id = Entity::getUsedConfig('calendars_id', $this->fields['entities_id']); $calendar = new Calendar(); // Using calendar if (($calendars_id > 0) && $calendar->getFromDB($calendars_id)) { return max(0, $calendar->getActiveTimeBetween($this->fields['date'], $this->fields['solvedate']) -$this->fields["waiting_duration"]); } // Not calendar defined return max(0, strtotime($this->fields['solvedate'])-strtotime($this->fields['date']) -$this->fields["waiting_duration"]); } return 0; } /** * Compute close delay stat of the current ticket **/ function computeCloseDelayStat() { if (isset($this->fields['id']) && !empty($this->fields['date']) && !empty($this->fields['closedate'])) { $calendars_id = Entity::getUsedConfig('calendars_id', $this->fields['entities_id']); $calendar = new Calendar(); // Using calendar if (($calendars_id > 0) && $calendar->getFromDB($calendars_id)) { return max(0, $calendar->getActiveTimeBetween($this->fields['date'], $this->fields['closedate']) -$this->fields["waiting_duration"]); } // Not calendar defined return max(0, strtotime($this->fields['closedate'])-strtotime($this->fields['date']) -$this->fields["waiting_duration"]); } return 0; } function showStats() { if (!Session::haveRight('observe_ticket',1) || !isset($this->fields['id'])) { return false; } echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if (($this->fields['status'] == self::SOLVED) || ($this->fields['status'] == self::CLOSED)) { echo ""; echo ""; } if ($this->fields['status']==self::CLOSED) { echo ""; echo ""; } echo ""; if (isset($this->fields['takeintoaccount_delay_stat'])) { echo ""; } if (($this->fields['status'] == self::SOLVED) || ($this->fields['status'] == self::CLOSED)) { echo ""; } if ($this->fields['status'] == self::CLOSED) { echo ""; } echo ""; echo "
"._n('Date', 'Dates',2)."
".__('Opening date')."".Html::convDateTime($this->fields['date'])."
".__('Due date')."".Html::convDateTime($this->fields['due_date'])."
".__('Resolution date')."".Html::convDateTime($this->fields['solvedate'])."
".__('Closing date')."".Html::convDateTime($this->fields['closedate'])."
"._n('Time', 'Times',2)."
".__('Take into account').""; if ($this->fields['takeintoaccount_delay_stat'] > 0) { echo Html::timestampToString($this->fields['takeintoaccount_delay_stat'],0); } else { echo ' '; } echo "
".__('Resolution').""; if ($this->fields['solve_delay_stat'] > 0) { echo Html::timestampToString($this->fields['solve_delay_stat'],0); } else { echo ' '; } echo "
".__('Closure').""; if ($this->fields['close_delay_stat'] > 0) { echo Html::timestampToString($this->fields['close_delay_stat']); } else { echo ' '; } echo "
".__('Pending').""; if ($this->fields['waiting_duration'] > 0) { echo Html::timestampToString($this->fields['waiting_duration'],0); } else { echo ' '; } echo "
"; echo "
"; } /** Get users_ids of itil object between 2 dates * * @param $date1 date : begin date (default '') * @param $date2 date : end date (default '') * * @return array contains the distinct users_ids which have itil object **/ function getUsedAuthorBetween($date1='', $date2='') { global $DB; $linkclass = new $this->userlinkclass(); $linktable = $linkclass->getTable(); $query = "SELECT DISTINCT `glpi_users`.`id` AS users_id, `glpi_users`.`name` AS name, `glpi_users`.`realname` AS realname, `glpi_users`.`firstname` AS firstname FROM `".$this->getTable()."` LEFT JOIN `$linktable` ON (`$linktable`.`".$this->getForeignKeyField()."` = `".$this->getTable()."`.`id` AND `$linktable`.`type` = '".CommonITILActor::REQUESTER."') INNER JOIN `glpi_users` ON (`glpi_users`.`id` = `$linktable`.`users_id`) WHERE NOT `".$this->getTable()."`.`is_deleted` ". getEntitiesRestrictRequest("AND", $this->getTable()); if (!empty($date1) || !empty($date2)) { $query .= " AND (".getDateRequest("`".$this->getTable()."`.`date`", $date1, $date2)." OR ".getDateRequest("`".$this->getTable()."`.`closedate`", $date1, $date2).") "; } $query .= " ORDER BY realname, firstname, name"; $result = $DB->query($query); $tab = array(); if ($DB->numrows($result) >= 1) { while ($line = $DB->fetch_assoc($result)) { $tmp['id'] = $line["users_id"]; $tmp['link'] = formatUserName($line["users_id"], $line["name"], $line["realname"], $line["firstname"], 1); $tab[] = $tmp; } } return $tab; } /** Get recipient of itil object between 2 dates * * @param $date1 date : begin date (default '') * @param $date2 date : end date (default '') * * @return array contains the distinct recipents which have itil object **/ function getUsedRecipientBetween($date1='', $date2='') { global $DB; $query = "SELECT DISTINCT `glpi_users`.`id` AS user_id, `glpi_users`.`name` AS name, `glpi_users`.`realname` AS realname, `glpi_users`.`firstname` AS firstname FROM `".$this->getTable()."` LEFT JOIN `glpi_users` ON (`glpi_users`.`id` = `".$this->getTable()."`.`users_id_recipient`) WHERE NOT `".$this->getTable()."`.`is_deleted` ". getEntitiesRestrictRequest("AND", $this->getTable()); if (!empty($date1) || !empty($date2)) { $query .= " AND (".getDateRequest("`".$this->getTable()."`.`date`", $date1, $date2)." OR ".getDateRequest("`".$this->getTable()."`.`closedate`", $date1, $date2).") "; } $query .= " ORDER BY realname, firstname, name"; $result = $DB->query($query); $tab = array(); if ($DB->numrows($result) >= 1) { while ($line = $DB->fetch_assoc($result)) { $tmp['id'] = $line["user_id"]; $tmp['link'] = formatUserName($line["user_id"], $line["name"], $line["realname"], $line["firstname"], 1); $tab[] = $tmp; } } return $tab; } /** Get groups which have itil object between 2 dates * * @param $date1 date : begin date (default '') * @param $date2 date : end date (default '') * * @return array contains the distinct groups of tickets **/ function getUsedGroupBetween($date1='', $date2='') { global $DB; $linkclass = new $this->grouplinkclass(); $linktable = $linkclass->getTable(); $query = "SELECT DISTINCT `glpi_groups`.`id`, `glpi_groups`.`completename` FROM `".$this->getTable()."` LEFT JOIN `$linktable` ON (`$linktable`.`".$this->getForeignKeyField()."` = `".$this->getTable()."`.`id` AND `$linktable`.`type` = '".CommonITILActor::REQUESTER."') LEFT JOIN `glpi_groups` ON (`$linktable`.`groups_id` = `glpi_groups`.`id`) WHERE NOT `".$this->getTable()."`.`is_deleted` ". getEntitiesRestrictRequest("AND", $this->getTable()); if (!empty($date1) || !empty($date2)) { $query .= " AND (".getDateRequest("`".$this->getTable()."`.`date`", $date1, $date2)." OR ".getDateRequest("`".$this->getTable()."`.`closedate`", $date1, $date2).") "; } $query .= " ORDER BY `glpi_groups`.`completename`"; $result = $DB->query($query); $tab = array(); if ($DB->numrows($result) >=1 ) { while ($line = $DB->fetch_assoc($result)) { $tmp['id'] = $line["id"]; $tmp['link'] = $line["completename"]; $tab[] = $tmp; } } return $tab; } /** Get recipient of itil object between 2 dates * * @param $date1 date : begin date (default '') * @param $date2 date : end date (default '') * @param title : indicates if stat if by title (true) or type (false) (true by default) * * @return array contains the distinct recipents which have tickets **/ function getUsedUserTitleOrTypeBetween($date1='', $date2='', $title=true) { global $DB; $linkclass = new $this->userlinkclass(); $linktable = $linkclass->getTable(); if ($title) { $table = "glpi_usertitles"; $field = "usertitles_id"; } else { $table = "glpi_usercategories"; $field = "usercategories_id"; } $query = "SELECT DISTINCT `glpi_users`.`$field` FROM `".$this->getTable()."` INNER JOIN `$linktable` ON (`".$this->getTable()."`.`id` = `$linktable`.`".$this->getForeignKeyField()."`) INNER JOIN `glpi_users` ON (`glpi_users`.`id` = `$linktable`.`users_id`) LEFT JOIN `$table` ON (`$table`.`id` = `glpi_users`.`$field`) WHERE NOT `".$this->getTable()."`.`is_deleted` ". getEntitiesRestrictRequest("AND", $this->getTable()); if (!empty($date1)||!empty($date2)) { $query .= " AND (".getDateRequest("`".$this->getTable()."`.`date`", $date1, $date2)." OR ".getDateRequest("`".$this->getTable()."`.`closedate`", $date1, $date2).") "; } $query .=" ORDER BY `glpi_users`.`$field`"; $result = $DB->query($query); $tab = array(); if ($DB->numrows($result) >=1) { while ($line = $DB->fetch_assoc($result)) { $tmp['id'] = $line[$field]; $tmp['link'] = Dropdown::getDropdownName($table, $line[$field]); $tab[] = $tmp; } } return $tab; } /** * Get priorities of itil object between 2 dates * * @param $date1 date : begin date (default '') * @param $date2 date : end date (default '') * * @return array contains the distinct priorities of tickets **/ function getUsedPriorityBetween($date1='', $date2='') { global $DB; $query = "SELECT DISTINCT `priority` FROM `".$this->getTable()."` WHERE NOT `".$this->getTable()."`.`is_deleted` ". getEntitiesRestrictRequest("AND", $this->getTable()); if (!empty($date1) || !empty($date2)) { $query .= " AND (".getDateRequest("`".$this->getTable()."`.`date`", $date1, $date2)." OR ".getDateRequest("`".$this->getTable()."`.`closedate`", $date1, $date2).") "; } $query .= " ORDER BY `priority`"; $result = $DB->query($query); $tab = array(); if ($DB->numrows($result) >= 1) { $i = 0; while ($line = $DB->fetch_assoc($result)) { $tmp['id'] = $line["priority"]; $tmp['link'] = self::getPriorityName($line["priority"]); $tab[] = $tmp; } } return $tab; } /** * Get urgencies of itil object between 2 dates * * @param $date1 date : begin date (default '') * @param $date2 date : end date (default '') * * @return array contains the distinct priorities of tickets **/ function getUsedUrgencyBetween($date1='', $date2='') { global $DB; $query = "SELECT DISTINCT `urgency` FROM `".$this->getTable()."` WHERE NOT `".$this->getTable()."`.`is_deleted` ". getEntitiesRestrictRequest("AND", $this->getTable()); if (!empty($date1) || !empty($date2)) { $query .= " AND (".getDateRequest("`".$this->getTable()."`.`date`", $date1, $date2)." OR ".getDateRequest("`".$this->getTable()."`.`closedate`", $date1, $date2).") "; } $query .= " ORDER BY `urgency`"; $result = $DB->query($query); $tab = array(); if ($DB->numrows($result) >= 1) { $i = 0; while ($line = $DB->fetch_assoc($result)) { $tmp['id'] = $line["urgency"]; $tmp['link'] = self::getUrgencyName($line["urgency"]); $tab[] = $tmp; } } return $tab; } /** * Get impacts of itil object between 2 dates * * @param $date1 date : begin date (default '') * @param $date2 date : end date (default '') * * @return array contains the distinct priorities of tickets **/ function getUsedImpactBetween($date1='', $date2='') { global $DB; $query = "SELECT DISTINCT `impact` FROM `".$this->getTable()."` WHERE NOT `".$this->getTable()."`.`is_deleted` ". getEntitiesRestrictRequest("AND", $this->getTable()); if (!empty($date1) || !empty($date2)) { $query .= " AND (".getDateRequest("`".$this->getTable()."`.`date`", $date1, $date2)." OR ".getDateRequest("`".$this->getTable()."`.`closedate`", $date1, $date2).") "; } $query .= " ORDER BY `impact`"; $result = $DB->query($query); $tab = array(); if ($DB->numrows($result) >= 1) { $i = 0; while ($line = $DB->fetch_assoc($result)) { $tmp['id'] = $line["impact"]; $tmp['link'] = self::getImpactName($line["impact"]); $tab[] = $tmp; } } return $tab; } /** * Get request types of itil object between 2 dates * * @param $date1 date : begin date (default '') * @param $date2 date : end date (default '') * * @return array contains the distinct request types of tickets **/ function getUsedRequestTypeBetween($date1='', $date2='') { global $DB; $query = "SELECT DISTINCT `requesttypes_id` FROM `".$this->getTable()."` WHERE NOT `".$this->getTable()."`.`is_deleted` ". getEntitiesRestrictRequest("AND", $this->getTable()); if (!empty($date1) || !empty($date2)) { $query .= " AND (".getDateRequest("`".$this->getTable()."`.`date`", $date1, $date2)." OR ".getDateRequest("`".$this->getTable()."`.`closedate`", $date1, $date2).") "; } $query .= " ORDER BY `requesttypes_id`"; $result = $DB->query($query); $tab = array(); if ($DB->numrows($result) >= 1) { while ($line = $DB->fetch_assoc($result)) { $tmp['id'] = $line["requesttypes_id"]; $tmp['link'] = Dropdown::getDropdownName('glpi_requesttypes', $line["requesttypes_id"]); $tab[] = $tmp; } } return $tab; } /** * Get solution types of itil object between 2 dates * * @param $date1 date : begin date (default '') * @param $date2 date : end date (default '') * * @return array contains the distinct request types of tickets **/ function getUsedSolutionTypeBetween($date1='', $date2='') { global $DB; $query = "SELECT DISTINCT `solutiontypes_id` FROM `".$this->getTable()."` WHERE NOT `".$this->getTable()."`.`is_deleted` ". getEntitiesRestrictRequest("AND", $this->getTable()); if (!empty($date1) || !empty($date2)) { $query .= " AND (".getDateRequest("`".$this->getTable()."`.`date`", $date1, $date2)." OR ".getDateRequest("`".$this->getTable()."`.`closedate`", $date1, $date2).") "; } $query .= " ORDER BY `solutiontypes_id`"; $result = $DB->query($query); $tab = array(); if ($DB->numrows($result) >= 1) { while ($line = $DB->fetch_assoc($result)) { $tmp['id'] = $line["solutiontypes_id"]; $tmp['link'] = Dropdown::getDropdownName('glpi_solutiontypes', $line["solutiontypes_id"]); $tab[] = $tmp; } } return $tab; } /** Get users which have intervention assigned to between 2 dates * * @param $date1 date : begin date (default '') * @param $date2 date : end date (default '') * * @return array contains the distinct users which have any intervention assigned to. **/ function getUsedTechBetween($date1='',$date2='') { global $DB; $linkclass = new $this->userlinkclass(); $linktable = $linkclass->getTable(); $showlink = User::canView(); $query = "SELECT DISTINCT `glpi_users`.`id` AS users_id, `glpi_users`.`name` AS name, `glpi_users`.`realname` AS realname, `glpi_users`.`firstname` AS firstname FROM `".$this->getTable()."` LEFT JOIN `$linktable` ON (`$linktable`.`".$this->getForeignKeyField()."` = `".$this->getTable()."`.`id` AND `$linktable`.`type` = '".CommonITILActor::ASSIGN."') LEFT JOIN `glpi_users` ON (`glpi_users`.`id` = `$linktable`.`users_id`) WHERE NOT `".$this->getTable()."`.`is_deleted` ". getEntitiesRestrictRequest("AND", $this->getTable()); if (!empty($date1)||!empty($date2)) { $query .= " AND (".getDateRequest("`".$this->getTable()."`.`date`", $date1, $date2)." OR ".getDateRequest("`".$this->getTable()."`.`closedate`", $date1, $date2).") "; } $query .= " ORDER BY realname, firstname, name"; $result = $DB->query($query); $tab = array(); if ($DB->numrows($result) >= 1) { while ($line = $DB->fetch_assoc($result)) { $tmp['id'] = $line["users_id"]; $tmp['link'] = formatUserName($line["users_id"], $line["name"], $line["realname"], $line["firstname"], $showlink); $tab[] = $tmp; } } return $tab; } /** Get users which have followup assigned to between 2 dates * * @param $date1 date : begin date (default '') * @param $date2 date : end date (default '') * * @return array contains the distinct users which have any followup assigned to. **/ function getUsedTechTaskBetween($date1='',$date2='') { global $DB; $tasktable = getTableForItemType($this->getType().'Task'); $showlink = User::canView(); $query = "SELECT DISTINCT `glpi_users`.`id` AS users_id, `glpi_users`.`name` AS name, `glpi_users`.`realname` AS realname, `glpi_users`.`firstname` AS firstname FROM `".$this->getTable()."` LEFT JOIN `$tasktable` ON (`".$this->getTable()."`.`id` = `$tasktable`.`".$this->getForeignKeyField()."`) LEFT JOIN `glpi_users` ON (`glpi_users`.`id` = `$tasktable`.`users_id`) LEFT JOIN `glpi_profiles_users` ON (`glpi_users`.`id` = `glpi_profiles_users`.`users_id`) LEFT JOIN `glpi_profiles` ON (`glpi_profiles`.`id` = `glpi_profiles_users`.`profiles_id`) WHERE NOT `".$this->getTable()."`.`is_deleted` ". getEntitiesRestrictRequest("AND", $this->getTable()); if (!empty($date1) || !empty($date2)) { $query .= " AND (".getDateRequest("`".$this->getTable()."`.`date`", $date1, $date2)." OR ".getDateRequest("`".$this->getTable()."`.`closedate`", $date1, $date2).") "; } $query .=" AND `glpi_profiles`.`own_ticket` = 1 AND `$tasktable`.`users_id` <> '0' AND `$tasktable`.`users_id` IS NOT NULL ORDER BY realname, firstname, name"; $result = $DB->query($query); $tab = array(); if ($DB->numrows($result) >= 1) { while ($line = $DB->fetch_assoc($result)) { $tmp['id'] = $line["users_id"]; $tmp['link'] = formatUserName($line["users_id"], $line["name"], $line["realname"], $line["firstname"], $showlink); $tab[] = $tmp; } } return $tab; } /** Get enterprises which have itil object assigned to between 2 dates * * @param $date1 date : begin date (default '') * @param $date2 date : end date (default '') * * @return array contains the distinct enterprises which have any tickets assigned to. **/ function getUsedSupplierBetween($date1='', $date2='') { global $DB,$CFG_GLPI; $linkclass = new $this->supplierlinkclass(); $linktable = $linkclass->getTable(); $query = "SELECT DISTINCT `glpi_suppliers`.`id` AS suppliers_id_assign, `glpi_suppliers`.`name` AS name FROM `".$this->getTable()."` LEFT JOIN `$linktable` ON (`$linktable`.`".$this->getForeignKeyField()."` = `".$this->getTable()."`.`id` AND `$linktable`.`type` = '".CommonITILActor::ASSIGN."') LEFT JOIN `glpi_suppliers` ON (`glpi_suppliers`.`id` = `$linktable`.`suppliers_id`) WHERE NOT `".$this->getTable()."`.`is_deleted` ". getEntitiesRestrictRequest("AND", $this->getTable()); if (!empty($date1) || !empty($date2)) { $query .= " AND (".getDateRequest("`".$this->getTable()."`.`date`", $date1, $date2)." OR ".getDateRequest("`".$this->getTable()."`.`closedate`", $date1, $date2).") "; } $query .= " ORDER BY name"; $tab = array(); $result = $DB->query($query); if ($DB->numrows($result) > 0) { while ($line = $DB->fetch_assoc($result)) { $tmp["id"] = $line["suppliers_id_assign"]; $tmp["link"] = "".$line["name"].""; $tab[] = $tmp; } } return $tab; } /** Get groups assigned to itil object between 2 dates * * @param $date1 date : begin date (default '') * @param $date2 date : end date (default '') * * @return array contains the distinct groups assigned to a tickets **/ function getUsedAssignGroupBetween($date1='', $date2='') { global $DB; $linkclass = new $this->grouplinkclass(); $linktable = $linkclass->getTable(); $query = "SELECT DISTINCT `glpi_groups`.`id`, `glpi_groups`.`completename` FROM `".$this->getTable()."` LEFT JOIN `$linktable` ON (`$linktable`.`".$this->getForeignKeyField()."` = `".$this->getTable()."`.`id` AND `$linktable`.`type` = '".CommonITILActor::ASSIGN."') LEFT JOIN `glpi_groups` ON (`$linktable`.`groups_id` = `glpi_groups`.`id`) WHERE NOT `".$this->getTable()."`.`is_deleted` ". getEntitiesRestrictRequest("AND", $this->getTable()); if (!empty($date1) || !empty($date2)) { $query .= " AND (".getDateRequest("`".$this->getTable()."`.`date`", $date1, $date2)." OR ".getDateRequest("`".$this->getTable()."`.`closedate`", $date1, $date2).") "; } $query .= " ORDER BY `glpi_groups`.`completename`"; $result = $DB->query($query); $tab = array(); if ($DB->numrows($result) >= 1) { while ($line = $DB->fetch_assoc($result)) { $tmp['id'] = $line["id"]; $tmp['link'] = $line["completename"]; $tab[] = $tmp; } } return $tab; } } ?> glpi-0.84.3+dfsg.1/inc/commonitiltask.class.php000066400000000000000000001211711226600447100212470ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// TODO extends it from CommonDBChild abstract class CommonITILTask extends CommonDBTM { // From CommonDBTM public $auto_message_on_action = false; function getItilObjectItemType() { return str_replace('Task','',$this->getType()); } function canViewPrivates() { return false; } function canEditAll() { return false; } /** * Get the item associated with the current object. * * @since version 0.84 * * @return object of the concerned item or false on error **/ function getItem() { if ($item = getItemForItemtype($this->getItilObjectItemType())) { if ($item->getFromDB($this->fields[$item->getForeignKeyField()])) { return $item; } } return false; } /** * can read the parent ITIL Object ? * * @return boolean **/ function canReadITILItem() { $itemtype = $this->getItilObjectItemType(); $item = new $itemtype(); if (!$item->can($this->getField($item->getForeignKeyField()),'r')) { return false; } return true; } /** * Name of the type * * @param $nb : number of item in the type (default 0) **/ static function getTypeName($nb=0) { return _n('Task', 'Tasks', $nb); } /** * @since version 0.84 * * @param $field * @param $values * @param $options array **/ static function getSpecificValueToDisplay($field, $values, array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } switch ($field) { case 'state' : return Planning::getState($values[$field]); } return parent::getSpecificValueToDisplay($field, $values, $options); } /** * @since version 0.84 * * @param $field * @param $name (default '') * @param $values (default '') * @param $options array * * @return string **/ static function getSpecificValueToSelect($field, $name='', $values='', array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'state': return Planning::dropdownState($name, $values[$field], false); } return parent::getSpecificValueToSelect($field, $name, $values, $options); } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (($item->getType() == $this->getItilObjectItemType()) && $this->canView()) { if ($_SESSION['glpishow_count_on_tabs']) { $restrict = "`".$item->getForeignKeyField()."` = '".$item->getID()."'"; if ($this->maybePrivate() && !$this->canViewPrivates()) { $restrict .= " AND (`is_private` = '0' OR `users_id` = '" . Session::getLoginUserID() . "') "; } return self::createTabEntry(self::getTypeName(2), countElementsInTable($this->getTable(), $restrict)); } return self::getTypeName(2); } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { $itemtype = $item->getType().'Task'; if ($task = getItemForItemtype($itemtype)) { $task->showSummary($item); return true; } } function post_deleteFromDB() { $itemtype = $this->getItilObjectItemType(); $item = new $itemtype(); $item->getFromDB($this->fields[$item->getForeignKeyField()]); $item->updateActiontime($this->fields[$item->getForeignKeyField()]); $item->updateDateMod($this->fields[$item->getForeignKeyField()]); // Add log entry in the ITIL object $changes[0] = 0; $changes[1] = ''; $changes[2] = $this->fields['id']; Log::history($this->getField($item->getForeignKeyField()), $this->getItilObjectItemType(), $changes, $this->getType(), Log::HISTORY_DELETE_SUBITEM); $options = array('task_id' => $this->fields["id"], // Force is_private with data / not available 'is_private' => $this->isPrivate()); NotificationEvent::raiseEvent('delete_task', $item, $options); } function prepareInputForUpdate($input) { Toolbox::manageBeginAndEndPlanDates($input['plan']); if (isset($input['_planningrecall'])) { PlanningRecall::manageDatas($input['_planningrecall']); } // $input["actiontime"] = $input["hour"]*HOUR_TIMESTAMP+$input["minute"]*MINUTE_TIMESTAMP; if (isset($input['update']) && ($uid = Session::getLoginUserID())) { // Change from task form $input["users_id"] = $uid; } if (isset($input["plan"])) { $input["begin"] = $input['plan']["begin"]; $input["end"] = $input['plan']["end"]; $input["users_id_tech"] = $input['plan']["users_id"]; $timestart = strtotime($input["begin"]); $timeend = strtotime($input["end"]); $input["actiontime"] = $timeend-$timestart; unset($input["plan"]); if (!$this->test_valid_date($input)) { Session::addMessageAfterRedirect(__('Error in entering dates. The starting date is later than the ending date'), false, ERROR); return false; } Planning::checkAlreadyPlanned($input["users_id_tech"], $input["begin"], $input["end"], array($this->getType() => array($input["id"]))); } return $input; } function post_updateItem($history=1) { global $CFG_GLPI; if (in_array("begin",$this->updates)) { PlanningRecall::managePlanningUpdates($this->getType(), $this->getID(), $this->fields["begin"]); } $update_done = false; $itemtype = $this->getItilObjectItemType(); $item = new $itemtype(); if ($item->getFromDB($this->fields[$item->getForeignKeyField()])) { $item->updateDateMod($this->fields[$item->getForeignKeyField()]); if (count($this->updates)) { $update_done = true; if (in_array("actiontime",$this->updates)) { $item->updateActionTime($this->input[$item->getForeignKeyField()]); } if (!empty($this->fields['begin']) && (($item->fields["status"] == CommonITILObject::INCOMING) || ($item->fields["status"] == CommonITILObject::ASSIGNED))) { $input2['id'] = $item->getID(); $input2['status'] = CommonITILObject::PLANNED; $input2['_disablenotif'] = true; $item->update($input2); } if ($CFG_GLPI["use_mailing"]) { $options = array('task_id' => $this->fields["id"], 'is_private' => $this->isPrivate()); NotificationEvent::raiseEvent('update_task', $item, $options); } } } if ($update_done) { // Add log entry in the ITIL object $changes[0] = 0; $changes[1] = ''; $changes[2] = $this->fields['id']; Log::history($this->getField($item->getForeignKeyField()), $itemtype, $changes, $this->getType(), Log::HISTORY_UPDATE_SUBITEM); } } function prepareInputForAdd($input) { $itemtype = $this->getItilObjectItemType(); Toolbox::manageBeginAndEndPlanDates($input['plan']); if (isset($input["plan"])) { $input["begin"] = $input['plan']["begin"]; $input["end"] = $input['plan']["end"]; $input["users_id_tech"] = $input['plan']["users_id"]; $timestart = strtotime($input["begin"]); $timeend = strtotime($input["end"]); $input["actiontime"] = $timeend-$timestart; unset($input["plan"]); if (!$this->test_valid_date($input)) { Session::addMessageAfterRedirect(__('Error in entering dates. The starting date is later than the ending date'), false, ERROR); return false; } } $input["_job"] = new $itemtype(); if (!$input["_job"]->getFromDB($input[$input["_job"]->getForeignKeyField()])) { return false; } // Pass old assign From object in case of assign change if (isset($input["_old_assign"])) { $input["_job"]->fields["_old_assign"] = $input["_old_assign"]; } if (!isset($input["users_id"]) && ($uid = Session::getLoginUserID())) { $input["users_id"] = $uid; } if (!isset($input["date"])) { $input["date"] = $_SESSION["glpi_currenttime"]; } if (!isset($input["is_private"])) { $input['is_private'] = 0; } return $input; } function post_addItem() { global $CFG_GLPI; if (isset($this->input['_planningrecall'])) { $this->input['_planningrecall']['items_id'] = $this->fields['id']; PlanningRecall::manageDatas($this->input['_planningrecall']); } $donotif = $CFG_GLPI["use_mailing"]; if (isset($this->fields["begin"]) && !empty($this->fields["begin"])) { Planning::checkAlreadyPlanned($this->fields["users_id_tech"], $this->fields["begin"], $this->fields["end"], array($this->getType() => array($this->fields["id"]))); } if (isset($this->input["_no_notif"]) && $this->input["_no_notif"]) { $donotif = false; } $this->input["_job"]->updateDateMod($this->input[$this->input["_job"]->getForeignKeyField()]); if (isset($this->input["actiontime"]) && ($this->input["actiontime"] > 0)) { $this->input["_job"]->updateActionTime($this->input[$this->input["_job"]->getForeignKeyField()]); } if (!empty($this->fields['begin']) && (($this->input["_job"]->fields["status"] == CommonITILObject::INCOMING) || ($this->input["_job"]->fields["status"] == CommonITILObject::ASSIGNED))) { $input2['id'] = $this->input["_job"]->getID(); $input2['status'] = CommonITILObject::PLANNED; $input2['_disablenotif'] = true; $this->input["_job"]->update($input2); } if ($donotif) { $options = array('task_id' => $this->fields["id"], 'is_private' => $this->isPrivate()); NotificationEvent::raiseEvent('add_task', $this->input["_job"], $options); } // Add log entry in the ITIL object $changes[0] = 0; $changes[1] = ''; $changes[2] = $this->fields['id']; Log::history($this->getField($this->input["_job"]->getForeignKeyField()), $this->input["_job"]->getTYpe(), $changes, $this->getType(), Log::HISTORY_ADD_SUBITEM); } function post_getEmpty() { if ($this->maybePrivate() && isset($_SESSION['glpitask_private']) && $_SESSION['glpitask_private']) { $this->fields['is_private'] = 1; } // Default is todo $this->fields['state'] = 1; } /** * @see CommonDBTM::cleanDBonPurge() * * @since version 0.84 **/ function cleanDBonPurge() { $class = new PlanningRecall(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); } // SPECIFIC FUNCTIONS /** * Get the users_id name of the followup * * @param $link insert link ? (default 0) * *@return string of the users_id name **/ //TODO function never used function getAuthorName($link=0) { return getUserName($this->fields["users_id"], $link); } /** * @see CommonDBTM::getName() **/ function getName($options=array()) { $p['comments'] = false; if (is_array($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } if (!isset($this->fields['taskcategories_id'])) { return NOT_AVAILABLE; } if ($this->fields['taskcategories_id']) { $name = Dropdown::getDropdownName('glpi_taskcategories', $this->fields['taskcategories_id']); } else { $name = $this->getTypeName(1); } if ($p['comments']) { $addname = Html::convDateTime($this->fields['date']); $addname = sprintf(__('%1$s, %2$s'), $addname, getUserName($this->fields['users_id'])); // Manage private case if (isset($this->maybeprivate)) { $addname = sprintf(__('%1$s, %2$s'), $addname, ($this->fields['is_private'] ? __('Private') : __('Public'))); } $name = sprintf(__('%1$s (%2$s)'), $name, $addname); } return $name; } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'content'; $tab[1]['name'] = __('Description'); $tab[1]['datatype'] = 'text'; $tab[2]['table'] = 'glpi_taskcategories'; $tab[2]['field'] = 'name'; $tab[2]['name'] = __('Task category'); $tab[2]['forcegroupby'] = true; $tab[2]['datatype'] = 'dropdown'; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'date'; $tab[3]['name'] = __('Date'); $tab[3]['datatype'] = 'datetime'; if ($this->maybePrivate()) { $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'is_private'; $tab[4]['name'] = __('Public followup'); $tab[4]['datatype'] = 'bool'; } $tab[5]['table'] = 'glpi_users'; $tab[5]['field'] = 'name'; $tab[5]['name'] = __('Technician'); $tab[5]['datatype'] = 'dropdown'; $tab[5]['right'] = 'own_ticket'; $tab[6]['table'] = $this->getTable(); $tab[6]['field'] = 'actiontime'; $tab[6]['name'] = __('Total duration'); $tab[6]['datatype'] = 'actiontime'; $tab[6]['massiveaction'] = false; $tab[7]['table'] = $this->getTable(); $tab[7]['field'] = 'state'; $tab[7]['name'] = __('Status'); $tab[7]['datatype'] = 'specific'; return $tab; } /** * Current dates are valid ? begin before end * * @param $input * *@return boolean **/ function test_valid_date($input) { return (!empty($input["begin"]) && !empty($input["end"]) && (strtotime($input["begin"]) < strtotime($input["end"]))); } /** * Populate the planning with planned tasks * * @param $itemtype itemtype * @param $options array of options must contains : * - who ID of the user (0 = undefined) * - who_group ID of the group of users (0 = undefined) * - begin Date * - end Date * * @return array of planning item **/ static function genericPopulatePlanning($itemtype, $options=array()) { global $DB, $CFG_GLPI; $interv = array(); if (!isset($options['begin']) || ($options['begin'] == 'NULL') || !isset($options['end']) || ($options['end'] == 'NULL')) { return $interv; } if (!$item = getItemForItemtype($itemtype)) { return; } $parentitemtype = $item->getItilObjectItemType(); if (!$parentitem = getItemForItemtype($parentitemtype)) { return; } $who = $options['who']; $who_group = $options['who_group']; $begin = $options['begin']; $end = $options['end']; // Get items to print $ASSIGN = ""; if ($who_group === "mine") { if (count($_SESSION["glpigroups"])) { $groups = implode("','",$_SESSION['glpigroups']); $ASSIGN = "`".$item->getTable()."`.`users_id_tech` IN (SELECT DISTINCT `users_id` FROM `glpi_groups_users` INNER JOIN `glpi_groups` ON (`glpi_groups_users`.`groups_id` = `glpi_groups`.`id`) WHERE `glpi_groups_users`.`groups_id` IN ('$groups') AND `glpi_groups`.`is_assign`) AND "; } else { // Only personal ones $ASSIGN = "`".$item->getTable()."`.`users_id_tech` = '$who' AND "; } } else { if ($who > 0) { $ASSIGN = "`".$item->getTable()."`.`users_id_tech` = '$who' AND "; } if ($who_group > 0) { $ASSIGN = "`".$item->getTable()."`.`users_id_tech` IN (SELECT `users_id` FROM `glpi_groups_users` WHERE `groups_id` = '$who_group') AND "; } } if (empty($ASSIGN)) { $ASSIGN = "`".$item->getTable()."`.`users_id_tech` IN (SELECT DISTINCT `glpi_profiles_users`.`users_id` FROM `glpi_profiles` LEFT JOIN `glpi_profiles_users` ON (`glpi_profiles`.`id` = `glpi_profiles_users`.`profiles_id`) WHERE `glpi_profiles`.`interface` = 'central' ". getEntitiesRestrictRequest("AND", "glpi_profiles_users", '', $_SESSION["glpiactive_entity"], 1).") AND "; } $addrestrict = ''; if ($parentitem->maybeDeleted()) { $addrestrict = 'AND NOT `'.$parentitem->getTable().'`.`is_deleted`'; } $query = "SELECT `".$item->getTable()."`.* FROM `".$item->getTable()."` INNER JOIN `".$parentitem->getTable()."` ON (`".$parentitem->getTable()."`.`id` = `".$item->getTable()."`.`".$parentitem->getForeignKeyField()."`) WHERE $ASSIGN '$begin' < `".$item->getTable()."`.`end` AND '$end' > `".$item->getTable()."`.`begin` $addrestrict ORDER BY `".$item->getTable()."`.`begin`"; $result = $DB->query($query); $interv = array(); if ($DB->numrows($result) > 0) { for ($i=0 ; $data=$DB->fetch_assoc($result) ; $i++) { if ($item->getFromDB($data["id"])) { if ($parentitem->getFromDBwithData($item->fields[$parentitem->getForeignKeyField()],0)) { $key = $data["begin"]."$$$".$i; // Do not check entity here because webcal used non authenticated access // if (Session::haveAccessToEntity($item->fields["entities_id"])) { $interv[$key]['itemtype'] = $itemtype; $interv[$data["begin"]."$$$".$i]["url"] = $CFG_GLPI["url_base"]."/index.php?redirect=". strtolower($parentitemtype)."_". $item->fields[$parentitem->getForeignKeyField()]; $interv[$key][$item->getForeignKeyField()] = $data["id"]; $interv[$key]["id"] = $data["id"]; if (isset($data["state"])) { $interv[$key]["state"] = $data["state"]; } $interv[$key][$parentitem->getForeignKeyField()] = $item->fields[$parentitem->getForeignKeyField()]; $interv[$key]["users_id"] = $data["users_id"]; $interv[$key]["users_id_tech"] = $data["users_id_tech"]; if (strcmp($begin,$data["begin"]) > 0) { $interv[$key]["begin"] = $begin; } else { $interv[$key]["begin"] = $data["begin"]; } if (strcmp($end,$data["end"]) < 0) { $interv[$key]["end"] = $end; } else { $interv[$key]["end"] = $data["end"]; } $interv[$key]["name"] = $parentitem->fields["name"]; $interv[$key]["content"] = Html::resume_text($parentitem->fields["content"], $CFG_GLPI["cut"]); $interv[$key]["status"] = $parentitem->fields["status"]; $interv[$key]["priority"] = $parentitem->fields["priority"]; /// Specific for tickets $interv[$key]["device"] = ''; if (isset($parentitem->hardwaredatas)) { $interv[$key]["device"] = ($parentitem->hardwaredatas ?$parentitem->hardwaredatas->getName() :''); } // } } } } } return $interv; } /** * Display a Planning Item * * @param $itemtype itemtype * @param $val Array of the item to display * * @return Already planned information **/ static function genericGetAlreadyPlannedInformation($itemtype, array $val) { global $CFG_GLPI; if ($item = getItemForItemtype($itemtype)) { $objectitemtype = $item->getItilObjectItemType(); //TRANS: %1$s is a type, %2$$ is a date, %3$s is a date $out = sprintf(__('%1$s: from %2$s to %3$s:'), $item->getTypeName(1), Html::convDateTime($val["begin"]), Html::convDateTime($val["end"])); $out .= "
"; $out .= Html::resume_text($val["name"],80).''; return $out; } } /** * Display a Planning Item * * @param $itemtype itemtype * @param $val Array of the item to display * @param $who ID of the user (0 if all) * @param $type position of the item in the time block (in, through, begin or end) * (default '') * @param $complete complete display (more details) (default 0) * * @return Nothing (display function) **/ static function genericDisplayPlanningItem($itemtype, array $val, $who, $type="", $complete=0) { global $CFG_GLPI; $rand = mt_rand(); $styleText = ""; if (isset($val["state"])) { switch ($val["state"]) { case 2 : // Done $styleText = "color:#747474;"; break; } } $parenttype = str_replace('Task','',$itemtype); if ($parent = getItemForItemtype($parenttype)) { $parenttype_fk = $parent->getForeignKeyField(); } else { return; } echo "getTypeName(1))."\">  "; echo "".
             Html::entities_deep($parent->getStatus($val["status"]))."getStatus($val["status"]))."\">"; echo " "; switch ($type) { case "in" : //TRANS: %1$s is the start time of a planned item, %2$s is the end printf(__('From %1$s to %2$s :'), date("H:i",strtotime($val["begin"])), date("H:i",strtotime($val["end"]))) ; break; case "through" : break; case "begin" : //TRANS: %s is the start time of a planned item printf(__('Start at %s:'), date("H:i", strtotime($val["begin"]))) ; break; case "end" : //TRANS: %s is the end time of a planned item printf(__('End at %s:'), date("H:i", strtotime($val["end"]))) ; break; } echo "
"; //TRANS: %1$s is name of the item, %2$d is its ID printf(__('%1$s (#%2$d)'), Html::resume_text($val["name"],80), $val[$parenttype_fk]); if (!empty($val["device"])) { echo "
".$val["device"]; } if ($who <= 0) { // show tech for "show all and show group" echo "
"; //TRANS: %s is user name printf(__('By %s'), getUserName($val["users_id_tech"])); } echo "
"; $recall = ''; if (isset($val[getForeignKeyFieldForItemType($itemtype)]) && PlanningRecall::isAvailable()) { $pr = new PlanningRecall(); if ($pr->getFromDBForItemAndUser($val['itemtype'], $val[getForeignKeyFieldForItemType($itemtype)], Session::getLoginUserID())) { $recall = "
".sprintf(__('Recall on %s'), Html::convDateTime($pr->fields['when'])). ""; } } if ($complete) { echo "
"; if (isset($val["state"])) { echo Planning::getState($val["state"])."
"; } echo sprintf(__('%1$s: %2$s'), __('Priority'), $parent->getPriorityName($val["priority"])); echo "
".__('Description')."

".$val["content"]; echo $recall; } else { $content = ""; if (isset($val["state"])) { $content .= Planning::getState($val["state"])."
"; } $content .= sprintf(__('%1$s: %2$s'), __('Priority'), $parent->getPriorityName($val["priority"])). "
".__('Description')."

".$val["content"].$recall. ""; Html::showToolTip($content, array('applyto' => "content_tracking_".$val["id"].$rand)); } } /** * @param $item CommonITILObject * @param $rand * @param $showprivate (false by default) **/ function showInObjectSumnary(CommonITILObject $item, $rand, $showprivate=false) { global $DB, $CFG_GLPI; $canedit = $this->can($this->fields['id'],'w'); echo "fields['id']. $this->fields['id']."$rand();\""; } echo " id='viewfollowup" . $this->fields[$item->getForeignKeyField()] . $this->fields["id"] . "$rand'>"; echo ""; $typename = $this->getTypeName(1); if ($this->fields['taskcategories_id']) { printf(__('%1$s - %2$s'), $typename, Dropdown::getDropdownName('glpi_taskcategories', $this->fields['taskcategories_id'])); } else { echo $typename; } echo ""; echo ""; if ($canedit) { echo "\n\n"; } //else echo "--no--"; echo Html::convDateTime($this->fields["date"]) . ""; echo "" . nl2br($this->fields["content"]) . ""; echo ""; echo Html::timestampToString($this->fields["actiontime"], 0); echo ""; echo "" . getUserName($this->fields["users_id"]) . ""; if ($this->maybePrivate() && $showprivate) { echo "".Dropdown::getYesNo($this->fields["is_private"]).""; } echo ""; if (empty($this->fields["begin"])) { if (isset($this->fields["state"])) { echo Planning::getState($this->fields["state"])."
"; } _e('None'); } else { echo ""; if (isset($this->fields["state"])) { echo ""; } echo ""; echo ""; echo ""; if (PlanningRecall::isAvailable()) { echo ""; } echo "
"._x('item', 'State').""; echo Planning::getState($this->fields["state"])."
".__('Begin').""; echo Html::convDateTime($this->fields["begin"])."
".__('End').""; echo Html::convDateTime($this->fields["end"])."
".__('By').""; echo getUserName($this->fields["users_id_tech"])."
"._x('Planning','Reminder').""; PlanningRecall::specificForm(array('itemtype' => $this->getType(), 'items_id' => $this->fields["id"])); echo "
"; } echo ""; echo "\n"; } /** form for Task * * @param $ID Integer : Id of the task * @param $options array * - parent Object : the object **/ function showForm($ID, $options=array()) { global $DB, $CFG_GLPI; if (isset($options['parent']) && !empty($options['parent'])) { $item = $options['parent']; } $fkfield = $item->getForeignKeyField(); if ($ID > 0) { $this->check($ID,'r'); } else { // Create item $options[$fkfield] = $item->getField('id'); $this->check(-1,'w',$options); } $canplan = Session::haveRight("show_planning", "1"); $this->showFormHeader($options); $rowspan = 5 ; if ($this->maybePrivate()) { $rowspan++; } // Recall if (!empty($this->fields["begin"])) { $rowspan++; } echo ""; echo "".__('Description').""; echo "". ""; if ($ID > 0) { echo "".__('Date').""; echo ""; Html::showDateTimeFormItem("date", $this->fields["date"], 1, false); } else { echo " "; } echo ""; echo "\n"; echo ""; echo "".__('Category').""; TaskCategory::dropdown(array('value' => $this->fields["taskcategories_id"], 'entity' => $item->fields["entities_id"])); echo "\n"; if (isset($this->fields["state"])) { echo ""; echo "".__('Status').""; Planning::dropdownState("state", $this->fields["state"]); echo "\n"; } if ($this->maybePrivate()) { echo ""; echo "".__('Private').""; echo ""; Dropdown::showYesNo('is_private',$this->fields["is_private"]); echo ""; echo ""; } echo ""; echo "". __('Duration').""; $toadd = array(); for ($i=9 ; $i<=100 ; $i++) { $toadd[] = $i*HOUR_TIMESTAMP; } Dropdown::showTimeStamp("actiontime", array('min' => 0, 'max' => 8*HOUR_TIMESTAMP, 'value' => $this->fields["actiontime"], 'addfirstminutes' => true, 'inhours' => true, 'toadd' => $toadd)); echo "\n"; echo ""; echo "".__('Planning').""; echo ""; if (!empty($this->fields["begin"])) { if (Session::haveRight('show_planning', 1)) { echo "\n"; echo "
\n"; echo ""; } if (isset($this->fields["state"])) { echo Planning::getState($this->fields["state"])."
"; } printf(__('From %1$s to %2$s'), Html::convDateTime($this->fields["begin"]), Html::convDateTime($this->fields["end"])); echo "
".getUserName($this->fields["users_id_tech"]); if (Session::haveRight('show_planning', 1)) { echo "
"; echo "
\n"; echo "
\n"; } } else { if (Session::haveRight('show_planning', 1)) { echo ""; echo "
\n"; echo "".__('Plan this task').""; echo "
\n"; echo "
\n"; } else { _e('None'); } } echo ""; if (!empty($this->fields["begin"]) && PlanningRecall::isAvailable()) { echo ""._x('Planning','Reminder').""; PlanningRecall::dropdown(array('itemtype' => $this->getType(), 'items_id' => $this->getID())); echo ""; } $this->showFormButtons($options); return true; } /** * Show the current task sumnary * * @param $item CommonITILObject **/ function showSummary(CommonITILObject $item) { global $DB, $CFG_GLPI; if (!static::canView()) { return false; } $tID = $item->fields['id']; // Display existing Followups $showprivate = $this->canViewPrivates(); $caneditall = $this->canEditAll(); $tmp = array($item->getForeignKeyField() => $tID); $canadd = $this->can(-1, 'w', $tmp); $RESTRICT = ""; if ($this->maybePrivate() && !$showprivate) { $RESTRICT = " AND (`is_private` = '0' OR `users_id` ='" . Session::getLoginUserID() . "') "; } $query = "SELECT `id`, `date` FROM `".$this->getTable()."` WHERE `".$item->getForeignKeyField()."` = '$tID' $RESTRICT ORDER BY `date` DESC"; $result = $DB->query($query); $rand = mt_rand(); if ($caneditall || $canadd) { echo "
\n"; } if ($canadd) { echo "\n"; if (($item->fields["status"] != CommonITILObject::SOLVED) && ($item->fields["status"] != CommonITILObject::CLOSED)) { echo "


\n"; } } if ($DB->numrows($result) == 0) { echo "
" . __('No task found.'); echo "
"; } else { echo ""; echo ""; echo ""; echo ""; if ($this->maybePrivate() && $showprivate) { echo ""; } echo "\n"; while ($data = $DB->fetch_assoc($result)) { if ($this->getFromDB($data['id'])) { $this->showInObjectSumnary($item, $rand, $showprivate); } } echo "
".__('Type')."" . __('Date') . "" . __('Description') . "" . __('Duration') . "" . __('Writer') . "" . __('Private') . "" . __('Planning') . "
"; } } /** * Form for Ticket or Problem Task on Massive action **/ function showFormMassiveAction() { echo " ".__('Category')." "; TaskCategory::dropdown(); echo "
".__('Description')." "; echo " "; if ($this->maybePrivate()) { echo ""; } echo ""; } } ?> glpi-0.84.3+dfsg.1/inc/commontreedropdown.class.php000066400000000000000000000570411226600447100221430ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * CommonTreeDropdown Class * * Hierarchical and cross entities **/ abstract class CommonTreeDropdown extends CommonDropdown { /** * Return Additional Fileds for this type **/ function getAdditionalFields() { return array(array('name' => $this->getForeignKeyField(), 'label' => __('As child of'), 'type' => 'parent', 'list' => false)); } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab($this->getType(), $ong, $options); if ($this->dohistory) { $this->addStandardTab('Log',$ong, $options); } return $ong; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { if ($item->getType()==$this->getType()) { if ($_SESSION['glpishow_count_on_tabs']) { $nb = countElementsInTable($this->getTable(), "`".$this->getForeignKeyField()."` = '".$item->getID()."'"); return self::createTabEntry($this->getTypeName(2), $nb); } return $this->getTypeName(2); } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item instanceof CommonTreeDropdown) { $item->showChildren(); } return true; } /** * Compute completename based on parent one * * @param $parentCompleteName string parent complete name (need to be stripslashes / comes from DB) * @param $thisName string item name (need to be addslashes : comes from input) **/ static function getCompleteNameFromParents($parentCompleteName, $thisName) { return addslashes($parentCompleteName). " > ".$thisName; } /** * @param $input **/ function adaptTreeFieldsFromUpdateOrAdd($input) { $parent = clone $this; // Update case input['name'] not set : if (!isset($input['name']) && isset($this->fields['name'])) { $input['name'] = addslashes($this->fields['name']); } // leading/ending space will break findID/import $input['name'] = trim($input['name']); if (isset($input[$this->getForeignKeyField()]) && !$this->isNewID($input[$this->getForeignKeyField()]) && $parent->getFromDB($input[$this->getForeignKeyField()])) { $input['level'] = $parent->fields['level']+1; // Sometimes (internet address), the complete name may be different ... /* if ($input[$this->getForeignKeyField()]==0) { // Root entity case $input['completename'] = $input['name']; } else {*/ $input['completename'] = self::getCompleteNameFromParents($parent->fields['completename'], $input['name']); // } } else { $input[$this->getForeignKeyField()] = 0; $input['level'] = 1; $input['completename'] = $input['name']; } return $input; } function prepareInputForAdd($input) { return $this->adaptTreeFieldsFromUpdateOrAdd($input); } function pre_deleteItem() { global $DB; // Not set in case of massive delete : use parent if (isset($this->input['_replace_by']) && $this->input['_replace_by']) { $parent = $this->input['_replace_by']; } else { $parent = $this->fields[$this->getForeignKeyField()]; } $this->recursiveCleanSonsAboveID($parent); $tmp = clone $this; $crit = array('FIELDS' => 'id', $this->getForeignKeyField() => $this->fields["id"]); foreach ($DB->request($this->getTable(), $crit) as $data) { $data[$this->getForeignKeyField()] = $parent; $tmp->update($data); } return true; } function prepareInputForUpdate($input) { if (isset($input[$this->getForeignKeyField()])) { // Can't move a parent under a child if (in_array($input[$this->getForeignKeyField()], getSonsOf($this->getTable(), $input['id']))) { return false; } // Parent changes => clear ancestors and update its level and completename if ($input[$this->getForeignKeyField()] != $this->fields[$this->getForeignKeyField()]) { $input["ancestors_cache"] = NULL; return $this->adaptTreeFieldsFromUpdateOrAdd($input); } } // Name changes => update its completename (and its level : side effect ...) if ((isset($input['name'])) && ($input['name'] != $this->fields['name'])) { return $this->adaptTreeFieldsFromUpdateOrAdd($input); } return $input; } /** * @param $ID * @param $updateName * @param $changeParent **/ function regenerateTreeUnderID($ID, $updateName, $changeParent) { global $DB; if (($updateName) || ($changeParent)) { $currentNode = clone $this; if ($currentNode->getFromDB($ID)) { $currentNodeCompleteName = $currentNode->getField("completename"); $nextNodeLevel = ($currentNode->getField("level") + 1); } else { $nextNodeLevel = 1; } $query = "SELECT `id`, `name` FROM `".$this->getTable()."` WHERE `".$this->getForeignKeyField()."` = '$ID'"; foreach ($DB->request($query) as $data) { $query = "UPDATE `".$this->getTable()."` SET "; $fieldsToUpdate = array(); if ($updateName || $changeParent) { if (isset($currentNodeCompleteName)) { $fieldsToUpdate[] = "`completename`='". self::getCompleteNameFromParents($currentNodeCompleteName, addslashes($data["name"]))."'"; } else { $fieldsToUpdate[] = "`completename`='".addslashes($data["name"])."'"; } } if ($changeParent) { // We have to reset the ancestors as only these changes (ie : not the children). $fieldsToUpdate[] = "`ancestors_cache` = NULL"; // And we must update the level of the current node ... $fieldsToUpdate[] = "`level` = '$nextNodeLevel'"; } $query .= implode(', ',$fieldsToUpdate)." WHERE `id`= '".$data["id"]."'"; $DB->query($query); $this->regenerateTreeUnderID($data["id"], $updateName, $changeParent); } } } /** * @param $ID **/ function recursiveCleanSonsAboveID($ID) { global $DB; if ($ID > 0) { $query = "UPDATE `".$this->getTable()."` SET `sons_cache` = NULL WHERE `id` = '$ID'"; $DB->query($query); $currentNode = clone $this; if ($currentNode->getFromDB($ID)) { $parentID = $currentNode->getField($this->getForeignKeyField()); if ($ID != $parentID) { $this->recursiveCleanSonsAboveID($parentID); } } } } function post_addItem() { $parent = $this->fields[$this->getForeignKeyField()]; $this->recursiveCleanSonsAboveID($parent); if ($parent && $this->dohistory) { $changes[0] = '0'; $changes[1] = ''; $changes[2] = addslashes($this->getNameID()); Log::history($parent, $this->getType(), $changes, $this->getType(), Log::HISTORY_ADD_SUBITEM); } } function post_updateItem($history=1) { $ID = $this->getID(); $changeParent = in_array($this->getForeignKeyField(), $this->updates); $this->regenerateTreeUnderID($ID, in_array('name', $this->updates), $changeParent); $this->recursiveCleanSonsAboveID($ID); if ($changeParent) { $oldParentID = $this->oldvalues[$this->getForeignKeyField()]; $newParentID = $this->fields[$this->getForeignKeyField()]; $oldParentNameID = ''; $newParentNameID = ''; $parent = clone $this; if ($oldParentID > 0) { $this->recursiveCleanSonsAboveID($oldParentID); if ($history) { if ($parent->getFromDB($oldParentID)) { $oldParentNameID = $parent->getNameID(); } $changes[0] = '0'; $changes[1] = addslashes($this->getNameID()); $changes[2] = ''; Log::history($oldParentID, $this->getType(), $changes, $this->getType(), Log::HISTORY_DELETE_SUBITEM); } } if ($newParentID > 0) { if ($history) { if ($parent->getFromDB($newParentID)) { $newParentNameID = $parent->getNameID(); } $changes[0] = '0'; $changes[1] = ''; $changes[2] = addslashes($this->getNameID()); Log::history($newParentID, $this->getType(), $changes, $this->getType(), Log::HISTORY_ADD_SUBITEM); } } if ($history) { $changes[0] = '0'; $changes[1] = $oldParentNameID; $changes[2] = $newParentNameID; Log::history($ID, $this->getType(), $changes, $this->getType(), Log::HISTORY_UPDATE_SUBITEM); } } } function post_deleteFromDB() { $parent = $this->fields[$this->getForeignKeyField()]; if ($parent && $this->dohistory) { $changes[0] = '0'; $changes[1] = addslashes($this->getNameID()); $changes[2] = ''; Log::history($parent, $this->getType(), $changes, $this->getType(), Log::HISTORY_DELETE_SUBITEM); } } /** * Get the this for all the current item and all its parent * * @return string **/ function getTreeLink() { $link = ''; if ($this->fields[$this->getForeignKeyField()]) { $papa = clone $this; if ($papa->getFromDB($this->fields[$this->getForeignKeyField()])) { $link = $papa->getTreeLink() . " > "; } } return $link . $this->getLink(); } /** * Print the HTML array children of a TreeDropdown * * @return Nothing (display) **/ function showChildren() { global $DB, $CFG_GLPI; $ID = $this->getID(); $this->check($ID, 'r'); $fields = $this->getAdditionalFields(); $nb = count($fields); $entity_assign = $this->isEntityAssign(); // Minimal form for quick input. if (static::canCreate()) { $link = $this->getFormURL(); echo "
"; echo ""; echo ""; echo ""; echo ""; echo "\n"; echo "
".__('New child heading')."
".__('Name').""; Html::autocompletionTextField($this, "name", array('value' => '')); if ($entity_assign && ($this->getForeignKeyField() != 'entities_id')) { echo ""; } if ($entity_assign && $this->isRecursive()) { echo ""; } echo ""; echo "
"; Html::closeForm(); echo "
\n"; } echo "
"; echo ""; echo ""; echo ""; if ($entity_assign) { echo ""; } foreach ($fields as $field) { if ($field['list']) { echo ""; } } echo ""; echo "\n"; $fk = $this->getForeignKeyField(); $crit = array($fk => $ID, 'ORDER' => 'name'); if ($entity_assign) { if ($fk == 'entities_id') { $crit['id'] = $_SESSION['glpiactiveentities']; $crit['id'] += $_SESSION['glpiparententities']; } else { $crit['entities_id'] = $_SESSION['glpiactiveentities']; } } foreach ($DB->request($this->getTable(), $crit) as $data) { echo ""; echo ""; if ($entity_assign) { echo ""; } foreach ($fields as $field) { if ($field['list']) { echo ""; } } echo ""; echo "\n"; } echo "
".sprintf(__('Sons of %s'), $this->getTreeLink()); echo "
".__('Name')."".__('Entity')."".$field['label']."".__('Comments')."
".$data['name']."".Dropdown::getDropdownName("glpi_entities", $data["entities_id"]).""; switch ($field['type']) { case 'UserDropdown' : echo getUserName($data[$field['name']]); break; case 'bool' : echo Dropdown::getYesNo($data[$field['name']]); break; case 'dropdownValue' : echo Dropdown::getDropdownName(getTableNameForForeignKeyField($field['name']), $data[$field['name']]); break; default: echo $data[$field['name']]; } echo "".$data['comment']."
\n"; } /** * @see CommonDBTM::getSpecificMassiveActions() **/ function getSpecificMassiveActions($checkitem=NULL) { $isadmin = static::canUpdate(); $actions = parent::getSpecificMassiveActions($checkitem); if ($isadmin) { $actions['move_under'] = _x('button', 'Move'); } return $actions; } /** * @see CommonDBTM::showSpecificMassiveActionsParameters() **/ function showSpecificMassiveActionsParameters($input=array()) { switch ($input['action']) { case 'move_under' : _e('As child of'); Dropdown::show($input['itemtype'], array('name' => 'parent', 'comments' => 0, 'entity' => $_SESSION['glpiactive_entity'])); echo "

\n"; return true; default : return parent::showSpecificMassiveActionsParameters($input); } return false; } /** * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case 'move_under' : if (isset($input['parent'])) { $fk = $this->getForeignKeyField(); $parent = new $input["itemtype"](); if ($parent->getFromDB($input['parent'])) { foreach ($input["item"] as $key => $val) { if (($val == 1) && $this->can($key,'w')) { // Check if parent is not a child of the original one if (!in_array($parent->getID(), getSonsOf($this->getTable(), $this->getID()))) { if ($this->update(array('id' => $key, $fk => $input['parent']))) { $res['ok']++; } else { $res['ko']++; } } else { $res['ko']++; } } else { $res['noright']++; } } } } break; default : return parent::doSpecificMassiveActions($input); } return $res; } /** * Get search function for the class * * @return array of search option **/ function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'completename'; $tab[1]['name'] = __('Complete name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab[14]['table'] = $this->getTable(); $tab[14]['field'] = 'name'; $tab[14]['name'] = __('Name'); $tab[14]['datatype'] = 'itemlink'; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; if ($this->isEntityAssign()) { $tab[80]['table'] = 'glpi_entities'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = __('Entity'); $tab[80]['massiveaction'] = false; $tab[80]['datatype'] = 'dropdown'; } if ($this->maybeRecursive()) { $tab[86]['table'] = $this->getTable(); $tab[86]['field'] = 'is_recursive'; $tab[86]['name'] = __('Child entities'); $tab[86]['datatype'] = 'bool'; } if ($this->isField('date_mod')) { $tab[19]['table'] = $this->getTable(); $tab[19]['field'] = 'date_mod'; $tab[19]['name'] = __('Last update'); $tab[19]['datatype'] = 'datetime'; $tab[19]['massiveaction'] = false; } return $tab; } /** * Report if a dropdown have Child * Used to (dis)allow delete action **/ function haveChildren() { $fk = $this->getForeignKeyField(); $id = $this->fields['id']; return (countElementsInTable($this->getTable(), "`$fk`='$id'") > 0); } /** * reformat text field describing a tree (such as completename) * * @param $value string * * @return string **/ static function cleanTreeText($value) { $tmp = explode('>', $value); foreach ($tmp as $k => $v) { $v = trim($v); if (empty($v)) { unset($tmp[$k]); } else { $tmp[$k] = $v; } } return implode(' > ', $tmp); } /** * check if a tree dropdown already exists (before import) * * @param &$input array of value to import (name, ...) * * @return the ID of the new (or -1 if not found) **/ function findID(array &$input) { global $DB; if (isset($input['completename'])) { // Clean datas $input['completename'] = self::cleanTreeText($input['completename']); } if (isset($input['completename']) && !empty($input['completename'])) { $query = "SELECT `id` FROM `".$this->getTable()."` WHERE `completename` = '".$input['completename']."'"; if ($this->isEntityAssign()) { $query .= getEntitiesRestrictRequest(' AND ', $this->getTable(), '', $input['entities_id'], $this->maybeRecursive()); } // Check twin : if ($result_twin = $DB->query($query) ) { if ($DB->numrows($result_twin) > 0) { return $DB->result($result_twin,0,"id"); } } } else if (isset($input['name']) && !empty($input['name'])) { $fk = $this->getForeignKeyField(); $query = "SELECT `id` FROM `".$this->getTable()."` WHERE `name` = '".$input["name"]."' AND `$fk` = '".(isset($input[$fk]) ? $input[$fk] : 0)."'"; if ($this->isEntityAssign()) { $query .= getEntitiesRestrictRequest(' AND ', $this->getTable(), '', $input['entities_id'], $this->maybeRecursive()); } // Check twin : if ($result_twin = $DB->query($query) ) { if ($DB->numrows($result_twin) > 0) { return $DB->result($result_twin, 0, "id"); } } } return -1; } /** * Import a dropdown - check if already exists * * @param $input array of value to import (name or completename, ...) * * @return the ID of the new or existing dropdown **/ function import(array $input) { if (isset($input['name'])) { return parent::import($input); } if (!isset($input['completename']) || empty($input['completename'])) { return -1; } // Import a full tree from completename $names = explode('>',$input['completename']); $fk = $this->getForeignKeyField(); $i = count($names); $parent = 0; foreach ($names as $name) { $i--; if (empty($name)) { // Skip empty name (completename starting/endind with >, double >, ...) continue; } $tmp['name'] = $name; $tmp[$fk] = $parent; if (isset($input['entities_id'])) { $tmp['entities_id'] = $input['entities_id']; } if (!$i) { // Other fields (comment, ...) only for last node of the tree foreach ($input as $key => $val) { if ($key != 'completename') { $tmp[$key] = $val; } } } $parent = parent::import($tmp); } return $parent; } } ?> glpi-0.84.3+dfsg.1/inc/computer.class.php000066400000000000000000001256611226600447100200600ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Computer class **/ class Computer extends CommonDBTM { // From CommonDBTM public $dohistory = true; static protected $forward_entity_to = array('ComputerDisk','ComputerVirtualMachine', 'Computer_SoftwareVersion', 'Infocom', 'NetworkPort', 'ReservationItem'); // Specific ones ///Device container - format $device = array(ID,"device type","ID in device table","specificity value") var $devices = array(); /** * Name of the type * * @param $nb integer number of item in the type (default 0) **/ static function getTypeName($nb=0) { return _n('Computer', 'Computers', $nb); } static function canCreate() { return Session::haveRight('computer', 'w'); } static function canView() { return Session::haveRight('computer', 'r'); } /** * @see CommonDBTM::useDeletedToLockIfDynamic() * * @since version 0.84 **/ function useDeletedToLockIfDynamic() { return false; } /** * @see CommonGLPI::defineTabs() **/ function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('Item_Devices', $ong, $options); $this->addStandardTab('ComputerDisk', $ong, $options); $this->addStandardTab('Computer_SoftwareVersion', $ong, $options); $this->addStandardTab('Computer_Item', $ong, $options); $this->addStandardTab('NetworkPort', $ong, $options); $this->addStandardTab('Infocom', $ong, $options); $this->addStandardTab('Contract_Item', $ong, $options); $this->addStandardTab('Document_Item', $ong, $options); $this->addStandardTab('ComputerVirtualMachine', $ong, $options); $this->addStandardTab('Ticket', $ong, $options); $this->addStandardTab('Item_Problem', $ong, $options); $this->addStandardTab('Link', $ong, $options); $this->addStandardTab('Lock', $ong, $options); $this->addStandardTab('Note', $ong, $options); $this->addStandardTab('Reservation', $ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } function post_restoreItem() { $comp_softvers = new Computer_SoftwareVersion(); $comp_softvers->updateDatasForComputer($this->fields['id']); } function post_deleteItem() { $comp_softvers = new Computer_SoftwareVersion(); $comp_softvers->updateDatasForComputer($this->fields['id']); } /** * @see CommonDBTM::post_updateItem() **/ function post_updateItem($history=1) { global $DB, $CFG_GLPI; for ($i=0 ; $iupdates) ; $i++) { // Update contact of attached items if ((($this->updates[$i] == "contact") || ($this->updates[$i] == "contact_num")) && $CFG_GLPI["is_contact_autoupdate"]) { $items = array('Monitor', 'Peripheral', 'Phone', 'Printer'); $update_done = false; $updates3[0] = "contact"; $updates3[1] = "contact_num"; foreach ($items as $t) { $query = "SELECT * FROM `glpi_computers_items` WHERE `computers_id` = '".$this->fields["id"]."' AND `itemtype` = '".$t."'"; if ($result = $DB->query($query)) { $resultnum = $DB->numrows($result); $item = new $t(); if ($resultnum > 0) { for ($j=0 ; $j<$resultnum ; $j++) { $tID = $DB->result($result, $j, "items_id"); $item->getFromDB($tID); if (!$item->getField('is_global')) { if ($item->getField('contact') != $this->fields['contact'] || ($item->getField('contact_num') != $this->fields['contact_num'])) { $tmp["id"] = $item->getField('id'); $tmp['contact'] = $this->fields['contact']; $tmp['contact_num'] = $this->fields['contact_num']; $item->update($tmp); $update_done = true; } } } } } } if ($update_done) { Session::addMessageAfterRedirect( __('Alternate username updated. The connected items have been updated using this alternate username.'), true); } } // Update users and groups of attached items if ((($this->updates[$i] == "users_id") && ($this->fields["users_id"] != 0) && $CFG_GLPI["is_user_autoupdate"]) || (($this->updates[$i] == "groups_id") && ($this->fields["groups_id"] != 0) && $CFG_GLPI["is_group_autoupdate"])) { $items = array('Monitor', 'Peripheral', 'Phone', 'Printer'); $update_done = false; $updates4[0] = "users_id"; $updates4[1] = "groups_id"; foreach ($items as $t) { $query = "SELECT * FROM `glpi_computers_items` WHERE `computers_id` = '".$this->fields["id"]."' AND `itemtype` = '".$t."'"; if ($result = $DB->query($query)) { $resultnum = $DB->numrows($result); $item = new $t(); if ($resultnum > 0) { for ($j=0 ; $j<$resultnum ; $j++) { $tID = $DB->result($result, $j, "items_id"); $item->getFromDB($tID); if (!$item->getField('is_global')) { if (($item->getField('users_id') != $this->fields["users_id"]) || ($item->getField('groups_id') != $this->fields["groups_id"])) { $tmp["id"] = $item->getField('id'); if ($CFG_GLPI["is_user_autoupdate"]) { $tmp["users_id"] = $this->fields["users_id"]; } if ($CFG_GLPI["is_group_autoupdate"]) { $tmp["groups_id"] = $this->fields["groups_id"]; } $item->update($tmp); $update_done = true; } } } } } } if ($update_done) { Session::addMessageAfterRedirect( __('User or group updated. The connected items have been moved in the same values.'), true); } } // Update state of attached items if (($this->updates[$i] == "states_id") && ($CFG_GLPI["state_autoupdate_mode"] < 0)) { $items = array('Monitor', 'Peripheral', 'Phone', 'Printer'); $update_done = false; foreach ($items as $t) { $query = "SELECT * FROM `glpi_computers_items` WHERE `computers_id` = '".$this->fields["id"]."' AND `itemtype` = '".$t."'"; if ($result = $DB->query($query)) { $resultnum = $DB->numrows($result); $item = new $t(); if ($resultnum > 0) { for ($j=0 ; $j<$resultnum ; $j++) { $tID = $DB->result($result, $j, "items_id"); $item->getFromDB($tID); if (!$item->getField('is_global')) { if ($item->getField('states_id') != $this->fields["states_id"]) { $tmp["id"] = $item->getField('id'); $tmp["states_id"] = $this->fields["states_id"]; $item->update($tmp); $update_done = true; } } } } } } if ($update_done) { Session::addMessageAfterRedirect( __('Status updated. The connected items have been updated using this status.'), true); } } // Update loction of attached items if (($this->updates[$i] == "locations_id") && ($this->fields["locations_id"] != 0) && $CFG_GLPI["is_location_autoupdate"]) { $items = array('Monitor', 'Peripheral', 'Phone', 'Printer'); $update_done = false; $updates2[0] = "locations_id"; foreach ($items as $t) { $query = "SELECT * FROM `glpi_computers_items` WHERE `computers_id` = '".$this->fields["id"]."' AND `itemtype` = '".$t."'"; if ($result = $DB->query($query)) { $resultnum = $DB->numrows($result); $item = new $t(); if ($resultnum > 0) { for ($j=0 ; $j<$resultnum ; $j++) { $tID = $DB->result($result, $j, "items_id"); $item->getFromDB($tID); if (!$item->getField('is_global')) { if ($item->getField('locations_id') != $this->fields["locations_id"]) { $tmp["id"] = $item->getField('id'); $tmp["locations_id"] = $this->fields["locations_id"]; $item->update($tmp); $update_done = true; } } } } } } if ($update_done) { Session::addMessageAfterRedirect( __('Location updated. The connected items have been moved in the same location.'), true); } } } } /** * @see CommonDBTM::prepareInputForAdd() **/ function prepareInputForAdd($input) { if (isset($input["id"]) && ($input["id"] > 0)) { $input["_oldID"] = $input["id"]; } unset($input['id']); unset($input['withtemplate']); return $input; } function post_addItem() { global $DB; // Manage add from template if (isset($this->input["_oldID"])) { // ADD Devices Item_devices::cloneItem(__CLASS__, $this->input["_oldID"], $this->fields['id']); // ADD Infocoms Infocom::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); // ADD volumes ComputerDisk::cloneComputer($this->input["_oldID"], $this->fields['id']); // ADD software Computer_SoftwareVersion::cloneComputer($this->input["_oldID"], $this->fields['id']); Computer_SoftwareLicense::cloneComputer($this->input["_oldID"], $this->fields['id']); // ADD Contract Contract_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); // ADD Documents Document_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); // ADD Ports NetworkPort::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); // Add connected devices Computer_Item::cloneComputer($this->input["_oldID"], $this->fields['id']); } } function cleanDBonPurge() { $csv = new Computer_SoftwareVersion(); $csv->cleanDBonItemDelete('Computer', $this->fields['id']); $csl = new Computer_SoftwareLicense(); $csl->cleanDBonItemDelete('Computer', $this->fields['id']); $ip = new Item_Problem(); $ip->cleanDBonItemDelete('Computer', $this->fields['id']); $ci = new Computer_Item(); $ci->cleanDBonItemDelete('Computer', $this->fields['id']); Item_Devices::cleanItemDeviceDBOnItemDelete('Computer', $this->fields['id']); $disk = new ComputerDisk(); $disk->cleanDBonItemDelete('Computer', $this->fields['id']); $vm = new ComputerVirtualMachine(); $vm->cleanDBonItemDelete('Computer', $this->fields['id']); } /** * Print the computer form * * @param $ID integer ID of the item * @param $options array * - target for the Form * - withtemplate template or basic computer * *@return Nothing (display) **/ function showForm($ID, $options=array()) { global $CFG_GLPI, $DB; $this->initForm($ID, $options); $this->showTabs($options); $this->showFormHeader($options); echo ""; //TRANS: %1$s is a string, %2$s a second one without spaces between them : to change for RTL echo "".sprintf(__('%1$s%2$s'),__('Name'), (isset($options['withtemplate']) && $options['withtemplate']?"*":"")). ""; echo ""; $objectName = autoName($this->fields["name"], "name", (isset($options['withtemplate']) && ( $options['withtemplate']== 2)), $this->getType(), $this->fields["entities_id"]); Html::autocompletionTextField($this, 'name', array('value' => $objectName)); echo ""; echo "".__('Status').""; echo ""; State::dropdown(array('value' => $this->fields["states_id"])); echo "\n"; echo ""; echo "".__('Location').""; echo ""; Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"])); echo ""; echo "".__('Type').""; echo ""; ComputerType::dropdown(array('value' => $this->fields["computertypes_id"])); echo "\n"; echo ""; echo "".__('Technician in charge of the hardware').""; echo ""; User::dropdown(array('name' => 'users_id_tech', 'value' => $this->fields["users_id_tech"], 'right' => 'own_ticket', 'entity' => $this->fields["entities_id"])); echo ""; echo "".__('Manufacturer').""; echo ""; Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"])); echo "\n"; echo ""; echo "".__('Group in charge of the hardware').""; echo ""; Group::dropdown(array('name' => 'groups_id_tech', 'value' => $this->fields['groups_id_tech'], 'entity' => $this->fields['entities_id'], 'condition' => '`is_assign`')); echo ""; echo "".__('Model').""; echo ""; ComputerModel::dropdown(array('value' => $this->fields["computermodels_id"])); echo "\n"; echo ""; //TRANS: Number of the alternate username echo "".__('Alternate username number').""; echo ""; Html::autocompletionTextField($this,'contact_num'); echo ""; echo "".__('Serial number').""; echo ""; Html::autocompletionTextField($this,'serial'); echo "\n"; echo ""; echo "".__('Alternate username').""; echo ""; Html::autocompletionTextField($this,'contact'); echo ""; echo "".sprintf(__('%1$s%2$s'), __('Inventory number'), (isset($options['withtemplate']) && $options['withtemplate']?"*":"")). ""; echo ""; $objectName = autoName($this->fields["otherserial"], "otherserial", (isset($options['withtemplate']) && ($options['withtemplate'] == 2)), $this->getType(), $this->fields["entities_id"]); Html::autocompletionTextField($this, 'otherserial', array('value' => $objectName)); echo "\n"; echo ""; echo "".__('User').""; echo ""; User::dropdown(array('value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all')); echo ""; echo "".__('Network').""; echo ""; Network::dropdown(array('value' => $this->fields["networks_id"])); echo "\n"; echo ""; echo "".__('Group').""; echo ""; Group::dropdown(array('value' => $this->fields["groups_id"], 'entity' => $this->fields["entities_id"], 'condition' => '`is_itemgroup`')); echo ""; // Display auto inventory informations $rowspan = 10; $inventory_show = false; if (!empty($ID) && Plugin::haveImport() && $this->fields["is_dynamic"]) { $inventory_show = true; $rowspan -= 4; } echo "".__('Comments').""; echo ""; echo "\n"; echo ""; echo "".__('Domain').""; echo ""; Domain::dropdown(array('value' => $this->fields["domains_id"])); echo ""; echo ""; echo "".__('Operating system').""; echo ""; OperatingSystem::dropdown(array('value' => $this->fields["operatingsystems_id"])); echo "\n"; echo ""; echo "".__('Service pack').""; echo ""; OperatingSystemServicePack::dropdown(array('value' => $this->fields["operatingsystemservicepacks_id"])); echo "\n"; echo ""; echo "".__('Version of the operating system').""; echo ""; OperatingSystemVersion::dropdown(array('value' => $this->fields["operatingsystemversions_id"])); echo "\n"; echo ""; echo "".__('Product ID of the operating system').""; echo ""; Html::autocompletionTextField($this, 'os_licenseid'); echo "\n"; echo ""; echo "".__('Serial of the operating system').""; echo ""; Html::autocompletionTextField($this, 'os_license_number'); echo ""; if ($inventory_show) { echo "".__('Automatic inventory').""; echo ""; Plugin::doHook("autoinventory_information", $this); echo ""; } echo "\n"; echo ""; echo "".__('UUID').""; echo ""; Html::autocompletionTextField($this, 'uuid'); echo ""; echo "\n"; echo ""; echo ""; if ((!isset($options['withtemplate']) || ($options['withtemplate'] == 0)) && !empty($this->fields['template_name'])) { echo ""; printf(__('Created from the template %s'), $this->fields['template_name']); echo ""; } else { echo " "; } echo ""; if (isset($options['withtemplate']) && $options['withtemplate']) { //TRANS: %s is the datetime of insertion printf(__('Created on %s'), Html::convDateTime($_SESSION["glpi_currenttime"])); } else { //TRANS: %s is the datetime of update printf(__('Last update on %s'), Html::convDateTime($this->fields["date_mod"])); } echo "\n"; echo ""; echo "".__('Update Source').""; echo ""; AutoUpdateSystem::dropdown(array('value' => $this->fields["autoupdatesystems_id"])); echo ""; $this->showFormButtons($options); $this->addDivForTabs(); return true; } /** * Return the SQL command to retrieve linked object * * @return a SQL command which return a set of (itemtype, items_id) */ function getSelectLinkedItem() { return "SELECT `itemtype`, `items_id` FROM `glpi_computers_items` WHERE `computers_id` = '" . $this->fields['id']."'"; } /** * @see CommonDBTM::getSpecificMassiveActions() **/ function getSpecificMassiveActions($checkitem=NULL) { $isadmin = static::canUpdate(); $actions = parent::getSpecificMassiveActions($checkitem); if ($isadmin) { $actions['connect'] = _x('button', 'Connect'); $actions['install'] = _x('button', 'Install'); } if (Session::haveRight('transfer','r') && Session::isMultiEntitiesMode() && $isadmin) { $actions['add_transfer_list'] = _x('button', 'Add to transfer list'); } return $actions; } /** * @see CommonDBTM::showSpecificMassiveActionsParameters() **/ function showSpecificMassiveActionsParameters($input=array()) { switch ($input['action']) { case "install" : Software::dropdownSoftwareToInstall("softwareversions_id", $_SESSION["glpiactive_entity"], 1); echo "

"; return true; case "connect" : $ci = new Computer_Item(); return $ci->showSpecificMassiveActionsParameters($input); default : return parent::showSpecificMassiveActionsParameters($input); } return false; } /** * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "connect" : $ci = new Computer_Item(); return $ci->doSpecificMassiveActions($input); case "install" : if (isset($input['softwareversions_id']) && ($input['softwareversions_id'] > 0)) { $inst = new Computer_SoftwareVersion(); foreach ($input['item'] as $key => $val) { if ($val == 1) { $input2 = array('computers_id' => $key, 'softwareversions_id' => $input['softwareversions_id']); if ($inst->can(-1, 'w', $input2)) { if ($inst->add($input2)) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } } } else { $res['ko']++; } break; default : return parent::doSpecificMassiveActions($input); } return $res; } function getSearchOptions() { global $CFG_GLPI; $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; // implicit key==1 $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; // implicit field is id $tab[2]['datatype'] = 'number'; $tab += Location::getSearchOptionsToAdd(); $tab[4]['table'] = 'glpi_computertypes'; $tab[4]['field'] = 'name'; $tab[4]['name'] = __('Type'); $tab[4]['datatype'] = 'dropdown'; $tab[40]['table'] = 'glpi_computermodels'; $tab[40]['field'] = 'name'; $tab[40]['name'] = __('Model'); $tab[40]['datatype'] = 'dropdown'; $tab[31]['table'] = 'glpi_states'; $tab[31]['field'] = 'completename'; $tab[31]['name'] = __('Status'); $tab[31]['datatype'] = 'dropdown'; $tab[45]['table'] = 'glpi_operatingsystems'; $tab[45]['field'] = 'name'; $tab[45]['name'] = __('Operating system'); $tab[45]['datatype'] = 'dropdown'; $tab[46]['table'] = 'glpi_operatingsystemversions'; $tab[46]['field'] = 'name'; $tab[46]['name'] = __('Version of the operating system'); $tab[46]['datatype'] = 'dropdown'; $tab[41]['table'] = 'glpi_operatingsystemservicepacks'; $tab[41]['field'] = 'name'; $tab[41]['name'] = __('Service pack'); $tab[41]['datatype'] = 'dropdown'; $tab[42]['table'] = 'glpi_autoupdatesystems'; $tab[42]['field'] = 'name'; $tab[42]['name'] = __('Update Source'); $tab[42]['datatype'] = 'dropdown'; $tab[43]['table'] = $this->getTable(); $tab[43]['field'] = 'os_license_number'; $tab[43]['name'] = __('Serial of the operating system'); $tab[43]['datatype'] = 'string'; $tab[44]['table'] = $this->getTable(); $tab[44]['field'] = 'os_licenseid'; $tab[44]['name'] = __('Product ID of the operating system'); $tab[44]['datatype'] = 'string'; $tab[47]['table'] = $this->getTable(); $tab[47]['field'] = 'uuid'; $tab[47]['name'] = __('UUID'); $tab[47]['datatype'] = 'string'; $tab[5]['table'] = $this->getTable(); $tab[5]['field'] = 'serial'; $tab[5]['name'] = __('Serial number'); $tab[5]['datatype'] = 'string'; $tab[6]['table'] = $this->getTable(); $tab[6]['field'] = 'otherserial'; $tab[6]['name'] = __('Inventory number'); $tab[6]['datatype'] = 'string'; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab[90]['table'] = $this->getTable(); $tab[90]['field'] = 'notepad'; $tab[90]['name'] = __('Notes'); $tab[90]['massiveaction'] = false; $tab[90]['datatype'] = 'text'; $tab[7]['table'] = $this->getTable(); $tab[7]['field'] = 'contact'; $tab[7]['name'] = __('Alternate username'); $tab[7]['datatype'] = 'string'; $tab[8]['table'] = $this->getTable(); $tab[8]['field'] = 'contact_num'; $tab[8]['name'] = __('Alternate username number'); $tab[8]['datatype'] = 'string'; $tab[70]['table'] = 'glpi_users'; $tab[70]['field'] = 'name'; $tab[70]['name'] = __('User'); $tab[70]['datatype'] = 'dropdown'; $tab[70]['right'] = 'all'; $tab[71]['table'] = 'glpi_groups'; $tab[71]['field'] = 'completename'; $tab[71]['name'] = __('Group'); $tab[71]['condition'] = '`is_itemgroup`'; $tab[71]['datatype'] = 'dropdown'; $tab[19]['table'] = $this->getTable(); $tab[19]['field'] = 'date_mod'; $tab[19]['name'] = __('Last update'); $tab[19]['datatype'] = 'datetime'; $tab[19]['massiveaction'] = false; $tab[32]['table'] = 'glpi_networks'; $tab[32]['field'] = 'name'; $tab[32]['name'] = __('Network'); $tab[32]['datatype'] = 'dropdown'; $tab[33]['table'] = 'glpi_domains'; $tab[33]['field'] = 'name'; $tab[33]['name'] = __('Domain'); $tab[33]['datatype'] = 'dropdown'; $tab[23]['table'] = 'glpi_manufacturers'; $tab[23]['field'] = 'name'; $tab[23]['name'] = __('Manufacturer'); $tab[23]['datatype'] = 'dropdown'; $tab[24]['table'] = 'glpi_users'; $tab[24]['field'] = 'name'; $tab[24]['linkfield'] = 'users_id_tech'; $tab[24]['name'] = __('Technician in charge of the hardware'); $tab[24]['datatype'] = 'dropdown'; $tab[24]['right'] = 'own_ticket'; $tab[49]['table'] = 'glpi_groups'; $tab[49]['field'] = 'completename'; $tab[49]['linkfield'] = 'groups_id_tech'; $tab[49]['name'] = __('Group in charge of the hardware'); $tab[49]['condition'] = '`is_assign`'; $tab[49]['datatype'] = 'dropdown'; $tab[80]['table'] = 'glpi_entities'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = __('Entity'); $tab[80]['datatype'] = 'dropdown'; $tab['periph'] = _n('Component', 'Components', 2); $items_device_joinparams = array('jointype' => 'itemtype_item', 'specific_itemtype' => 'Computer'); $tab[17]['table'] = 'glpi_deviceprocessors'; $tab[17]['field'] = 'designation'; $tab[17]['name'] = __('Processor'); $tab[17]['forcegroupby'] = true; $tab[17]['usehaving'] = true; $tab[17]['massiveaction'] = false; $tab[17]['datatype'] = 'string'; $tab[17]['joinparams'] = array('beforejoin' => array('table' => 'glpi_items_deviceprocessors', 'joinparams' => $items_device_joinparams)); $tab[36]['table'] = 'glpi_items_deviceprocessors'; $tab[36]['field'] = 'frequency'; $tab[36]['name'] = __('Processor frequency'); $tab[36]['unit'] = __('MHz'); $tab[36]['forcegroupby'] = true; $tab[36]['usehaving'] = true; $tab[36]['datatype'] = 'number'; $tab[36]['width'] = 100; $tab[36]['massiveaction'] = false; $tab[36]['joinparams'] = $items_device_joinparams; $tab[10]['table'] = 'glpi_devicememories'; $tab[10]['field'] = 'designation'; $tab[10]['name'] = __('Memory type'); $tab[10]['forcegroupby'] = true; $tab[10]['usehaving'] = true; $tab[10]['massiveaction'] = false; $tab[10]['datatype'] = 'string'; $tab[10]['joinparams'] = array('beforejoin' => array('table' => 'glpi_items_devicememories', 'joinparams' => $items_device_joinparams)); $tab[35]['table'] = 'glpi_items_devicememories'; $tab[35]['field'] = 'size'; $tab[35]['name'] = sprintf(__('%1$s (%2$s)'),__('Memory'),__('Mio')); $tab[35]['forcegroupby'] = true; $tab[35]['usehaving'] = true; $tab[35]['datatype'] = 'number'; $tab[35]['width'] = 100; $tab[35]['massiveaction'] = false; $tab[35]['joinparams'] = $items_device_joinparams; $tab[11]['table'] = 'glpi_devicenetworkcards'; $tab[11]['field'] = 'designation'; $tab[11]['name'] = _n('Network interface', 'Network interfaces', 1); $tab[11]['forcegroupby'] = true; $tab[11]['massiveaction'] = false; $tab[11]['datatype'] = 'string'; $tab[11]['joinparams'] = array('beforejoin' => array('table' => 'glpi_items_devicenetworkcards', 'joinparams' => $items_device_joinparams)); $tab[12]['table'] = 'glpi_devicesoundcards'; $tab[12]['field'] = 'designation'; $tab[12]['name'] = __('Soundcard'); $tab[12]['forcegroupby'] = true; $tab[12]['massiveaction'] = false; $tab[12]['datatype'] = 'string'; $tab[12]['joinparams'] = array('beforejoin' => array('table' => 'glpi_items_devicesoundcards', 'joinparams' => $items_device_joinparams)); $tab[13]['table'] = 'glpi_devicegraphiccards'; $tab[13]['field'] = 'designation'; $tab[13]['name'] = __('Graphics card'); $tab[13]['forcegroupby'] = true; $tab[13]['massiveaction'] = false; $tab[13]['datatype'] = 'string'; $tab[13]['joinparams'] = array('beforejoin' => array('table' => 'glpi_items_devicegraphiccards', 'joinparams' => $items_device_joinparams)); $tab[14]['table'] = 'glpi_devicemotherboards'; $tab[14]['field'] = 'designation'; $tab[14]['name'] = __('System board'); $tab[14]['forcegroupby'] = true; $tab[14]['massiveaction'] = false; $tab[14]['datatype'] = 'string'; $tab[14]['joinparams'] = array('beforejoin' => array('table' => 'glpi_items_devicemotherboards', 'joinparams' => $items_device_joinparams)); $tab[15]['table'] = 'glpi_deviceharddrives'; $tab[15]['field'] = 'designation'; $tab[15]['name'] = __('Hard drive type'); $tab[15]['forcegroupby'] = true; $tab[15]['usehaving'] = true; $tab[15]['massiveaction'] = false; $tab[15]['datatype'] = 'string'; $tab[15]['joinparams'] = array('beforejoin' => array('table' => 'glpi_items_deviceharddrives', 'joinparams' => $items_device_joinparams)); $tab[34]['table'] = 'glpi_items_deviceharddrives'; $tab[34]['field'] = 'capacity'; $tab[34]['name'] = __('Hard drive size'); $tab[34]['forcegroupby'] = true; $tab[34]['usehaving'] = true; $tab[34]['datatype'] = 'number'; $tab[34]['width'] = 1000; $tab[34]['massiveaction'] = false; $tab[34]['joinparams'] = $items_device_joinparams; $tab[39]['table'] = 'glpi_devicepowersupplies'; $tab[39]['field'] = 'designation'; $tab[39]['name'] = __('Power supply'); $tab[39]['forcegroupby'] = true; $tab[39]['usehaving'] = true; $tab[39]['massiveaction'] = false; $tab[39]['datatype'] = 'string'; $tab[39]['joinparams'] = array('beforejoin' => array('table' => 'glpi_items_devicepowersupplies', 'joinparams' => $items_device_joinparams)); $tab['disk'] = _n('Volume', 'Volumes', 2); $tab[156]['table'] = 'glpi_computerdisks'; $tab[156]['field'] = 'name'; $tab[156]['name'] = __('Volume'); $tab[156]['forcegroupby'] = true; $tab[156]['massiveaction'] = false; $tab[156]['datatype'] = 'dropdown'; $tab[156]['joinparams'] = array('jointype' => 'child'); $tab[150]['table'] = 'glpi_computerdisks'; $tab[150]['field'] = 'totalsize'; $tab[150]['name'] = __('Global size'); $tab[150]['forcegroupby'] = true; $tab[150]['usehaving'] = true; $tab[150]['datatype'] = 'number'; $tab[150]['width'] = 1000; $tab[150]['massiveaction'] = false; $tab[150]['joinparams'] = array('jointype' => 'child'); $tab[151]['table'] = 'glpi_computerdisks'; $tab[151]['field'] = 'freesize'; $tab[151]['name'] = __('Free size'); $tab[151]['forcegroupby'] = true; $tab[151]['datatype'] = 'number'; $tab[151]['width'] = 1000; $tab[151]['massiveaction'] = false; $tab[151]['joinparams'] = array('jointype' => 'child'); $tab[152]['table'] = 'glpi_computerdisks'; $tab[152]['field'] = 'freepercent'; $tab[152]['name'] = __('Free percentage'); $tab[152]['forcegroupby'] = true; $tab[152]['datatype'] = 'decimal'; $tab[152]['width'] = 2; $tab[152]['computation'] = "ROUND(100*TABLE.freesize/TABLE.totalsize)"; $tab[152]['unit'] = '%'; $tab[152]['massiveaction'] = false; $tab[152]['joinparams'] = array('jointype' => 'child'); $tab[153]['table'] = 'glpi_computerdisks'; $tab[153]['field'] = 'mountpoint'; $tab[153]['name'] = __('Mount point'); $tab[153]['forcegroupby'] = true; $tab[153]['massiveaction'] = false; $tab[153]['datatype'] = 'string'; $tab[153]['joinparams'] = array('jointype' => 'child'); $tab[154]['table'] = 'glpi_computerdisks'; $tab[154]['field'] = 'device'; $tab[154]['name'] = __('Partition'); $tab[154]['forcegroupby'] = true; $tab[154]['massiveaction'] = false; $tab[154]['datatype'] = 'string'; $tab[154]['joinparams'] = array('jointype' => 'child'); $tab[155]['table'] = 'glpi_filesystems'; $tab[155]['field'] = 'name'; $tab[155]['name'] = __('File system'); $tab[155]['forcegroupby'] = true; $tab[155]['massiveaction'] = false; $tab[155]['datatype'] = 'dropdown'; $tab[155]['joinparams'] = array('beforejoin' => array('table' => 'glpi_computerdisks', 'joinparams' => array('jointype' => 'child'))); $tab['virtualmachine'] = _n('Virtual machine', 'Virtual machines', 2); $tab[160]['table'] = 'glpi_computervirtualmachines'; $tab[160]['field'] = 'name'; $tab[160]['name'] = __('Virtual machine'); $tab[160]['forcegroupby'] = true; $tab[160]['massiveaction'] = false; $tab[160]['datatype'] = 'dropdown'; $tab[160]['joinparams'] = array('jointype' => 'child'); $tab[161]['table'] = 'glpi_virtualmachinestates'; $tab[161]['field'] = 'name'; $tab[161]['name'] = __('State of the virtual machine'); $tab[161]['forcegroupby'] = true; $tab[161]['massiveaction'] = false; $tab[161]['datatype'] = 'dropdown'; $tab[161]['joinparams'] = array('beforejoin' => array('table' => 'glpi_computervirtualmachines', 'joinparams' => array('jointype' => 'child'))); $tab[162]['table'] = 'glpi_virtualmachinetypes'; $tab[162]['field'] = 'name'; $tab[162]['name'] = __('Virtualization model'); $tab[162]['forcegroupby'] = true; $tab[162]['massiveaction'] = false; $tab[162]['datatype'] = 'dropdown'; $tab[162]['joinparams'] = array('beforejoin' => array('table' => 'glpi_computervirtualmachines', 'joinparams' => array('jointype' => 'child'))); $tab[163]['table'] = 'glpi_virtualmachinetypes'; $tab[163]['field'] = 'name'; $tab[163]['name'] = __('Virtualization system'); $tab[163]['datatype'] = 'dropdown'; $tab[163]['forcegroupby'] = true; $tab[163]['massiveaction'] = false; $tab[163]['joinparams'] = array('beforejoin' => array('table' => 'glpi_computervirtualmachines', 'joinparams' => array('jointype' => 'child'))); $tab[164]['table'] = 'glpi_computervirtualmachines'; $tab[164]['field'] = 'vcpu'; $tab[164]['name'] = __('Virtual machine processor number'); $tab[164]['datatype'] = 'number'; $tab[164]['forcegroupby'] = true; $tab[164]['massiveaction'] = false; $tab[164]['joinparams'] = array('jointype' => 'child'); $tab[165]['table'] = 'glpi_computervirtualmachines'; $tab[165]['field'] = 'ram'; $tab[165]['name'] = __('Memory of virtual machines'); $tab[165]['datatype'] = 'number'; $tab[165]['unit'] = __('Mio'); $tab[165]['forcegroupby'] = true; $tab[165]['massiveaction'] = false; $tab[165]['joinparams'] = array('jointype' => 'child'); $tab[166]['table'] = 'glpi_computervirtualmachines'; $tab[166]['field'] = 'uuid'; $tab[166]['name'] = __('Virtual machine UUID'); $tab[165]['datatype'] = 'string'; $tab[166]['forcegroupby'] = true; $tab[166]['massiveaction'] = false; $tab[166]['joinparams'] = array('jointype' => 'child'); return $tab; } } ?> glpi-0.84.3+dfsg.1/inc/computer_item.class.php000066400000000000000000001005331226600447100210650ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // Relation between Computer and Items (monitor, printer, phone, peripheral only) class Computer_Item extends CommonDBRelation{ // From CommonDBRelation static public $itemtype_1 = 'Computer'; static public $items_id_1 = 'computers_id'; static public $itemtype_2 = 'itemtype'; static public $items_id_2 = 'items_id'; static public $checkItem_2_Rights = self::HAVE_VIEW_RIGHT_ON_ITEM; /** * @since version 0.84 * **/ function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } /** * Count connection for an item * * @param $item CommonDBTM object * * @return integer: count **/ static function countForItem(CommonDBTM $item) { return countElementsInTable('glpi_computers_items', "`itemtype` = '".$item->getType()."' AND `items_id` ='".$item->getField('id')."' AND `is_deleted` = '0'"); } /** * Count connection for a Computer * * @param $comp Computer object * * @return integer: count **/ static function countForComputer(Computer $comp) { return countElementsInTable('glpi_computers_items', "`computers_id` ='".$comp->getField('id')."' AND `is_deleted`='0'"); } /** * Count connection for a Computer and an itemtype * * @since version 0.84 * * @param $comp Computer object * @param $item CommonDBTM object * * @return integer: count **/ static function countForAll(Computer $comp, CommonDBTM $item) { return countElementsInTable('glpi_computers_items', "`computers_id` ='".$comp->getField('id')."' AND `itemtype` = '".$item->getType()."' AND `items_id` ='".$item->getField('id')."'"); } /** * Prepare input datas for adding the relation * * Overloaded to check is Disconnect needed (during OCS sync) * and to manage autoupdate feature * * @param $input array of datas used to add the item * * @return the modified $input array * **/ function prepareInputForAdd($input) { global $DB, $CFG_GLPI; $item = static::getItemFromArray(static::$itemtype_2, static::$items_id_2, $input); if (!($item instanceof CommonDBTM) || (($item->getField('is_global') == 0) && ($this->countForItem($item) > 0))) { return false; } $comp = static::getItemFromArray(static::$itemtype_1, static::$items_id_1, $input); if (!($item instanceof CommonDBTM) || (self::countForAll($comp, $item) >0)) { // no duplicates return false; } if (!$item->getField('is_global') ) { // Autoupdate some fields - should be in post_addItem (here to avoid more DB access) $updates = array(); if ($CFG_GLPI["is_location_autoupdate"] && ($comp->fields['locations_id'] != $item->getField('locations_id'))) { $updates['locations_id'] = addslashes($comp->fields['locations_id']); Session::addMessageAfterRedirect( __('Location updated. The connected items have been moved in the same location.'), true); } if (($CFG_GLPI["is_user_autoupdate"] && ($comp->fields['users_id'] != $item->getField('users_id'))) || ($CFG_GLPI["is_group_autoupdate"] && ($comp->fields['groups_id'] != $item->getField('groups_id')))) { if ($CFG_GLPI["is_user_autoupdate"]) { $updates['users_id'] = $comp->fields['users_id']; } if ($CFG_GLPI["is_group_autoupdate"]) { $updates['groups_id'] = $comp->fields['groups_id']; } Session::addMessageAfterRedirect( __('User or group updated. The connected items have been moved in the same values.'), true); } if ($CFG_GLPI["is_contact_autoupdate"] && (($comp->fields['contact'] != $item->getField('contact')) || ($comp->fields['contact_num'] != $item->getField('contact_num')))) { $updates['contact'] = addslashes($comp->fields['contact']); $updates['contact_num'] = addslashes($comp->fields['contact_num']); Session::addMessageAfterRedirect( __('Alternate username updated. The connected items have been updated using this alternate username.'), true); } if (($CFG_GLPI["state_autoupdate_mode"] < 0) && ($comp->fields['states_id'] != $item->getField('states_id'))) { $updates['states_id'] = $comp->fields['states_id']; Session::addMessageAfterRedirect( __('Status updated. The connected items have been updated using this status.'), true); } if (($CFG_GLPI["state_autoupdate_mode"] > 0) && ($item->getField('states_id') != $CFG_GLPI["state_autoupdate_mode"])) { $updates['states_id'] = $CFG_GLPI["state_autoupdate_mode"]; } if (count($updates)) { $updates['id'] = $input['items_id']; $item->update($updates); } } return parent::prepareInputForAdd($input); } /** * Actions done when item is deleted from the database * Overloaded to manage autoupdate feature * *@return nothing **/ function cleanDBonPurge() { global $CFG_GLPI; if (!isset($this->input['_no_auto_action'])) { //Get the computer name $computer = new Computer(); $computer->getFromDB($this->fields['computers_id']); //Get device fields if ($device = getItemForItemtype($this->fields['itemtype'])) { if ($device->getFromDB($this->fields['items_id'])) { if (!$device->getField('is_global')) { $updates = array(); if ($CFG_GLPI["is_location_autoclean"] && $device->isField('locations_id')) { $updates['locations_id'] = 0; } if ($CFG_GLPI["is_user_autoclean"] && $device->isField('users_id')) { $updates['users_id'] = 0; } if ($CFG_GLPI["is_group_autoclean"] && $device->isField('groups_id')) { $updates['groups_id'] = 0; } if ($CFG_GLPI["is_contact_autoclean"] && $device->isField('contact')) { $updates['contact'] = ""; } if ($CFG_GLPI["is_contact_autoclean"] && $device->isField('contact_num')) { $updates['contact_num'] = ""; } if (($CFG_GLPI["state_autoclean_mode"] < 0) && $device->isField('states_id')) { $updates['states_id'] = 0; } if (($CFG_GLPI["state_autoclean_mode"] > 0) && $device->isField('states_id') && ($device->getField('states_id') != $CFG_GLPI["state_autoclean_mode"])) { $updates['states_id'] = $CFG_GLPI["state_autoclean_mode"]; } if (count($updates)) { $updates['id'] = $this->fields['items_id']; $device->update($updates); } } } } } } /** * @see CommonDBTM::showSpecificMassiveActionsParameters() **/ function showSpecificMassiveActionsParameters($input=array()) { switch ($input['action']) { case "connect" : if ($input['itemtype'] == 'Computer') { Dropdown::showAllItems("items_id", 0, 0, $_SESSION["glpiactive_entity"], array('Monitor', 'Peripheral', 'Phone', 'Printer'), true, true, 'item_itemtype'); echo "

"; } else { Computer_Item::dropdownConnect('Computer', $input["itemtype"], "computers_id"); echo "

"; } return true; case "disconnect" : echo ""; return true; default : return parent::showSpecificMassiveActionsParameters($input); } return false; } /** * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "connect" : foreach ($input["item"] as $key => $val) { if ($val == 1) { if (isset($input["computers_id"])) { $input2 = array('computers_id' => $input["computers_id"], 'itemtype' => $input["itemtype"], 'items_id' => $key); } else if (isset($input["items_id"])) { $input2 = array('computers_id' => $key, 'itemtype' => $input["item_itemtype"], 'items_id' => $input["items_id"]); } else { return false; } if ($this->can(-1, 'w', $input2)) { if ($this->add($input2)) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } } break; case "disconnect" : if (!($item = getItemForItemtype($input["itemtype"]))) { return false; } foreach ($input["item"] as $key => $val) { if ($val == 1) { if ($item->can($key, 'd')) { if ($this->disconnectForItem($item)) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } } break; default : return parent::doSpecificMassiveActions($input); } return $res; } /** * Disconnect an item to its computer * * @param $item CommonDBTM object: the Monitor/Phone/Peripheral/Printer * * @return boolean : action succeeded */ function disconnectForItem(CommonDBTM $item) { global $DB; if ($item->getField('id')) { $query = "SELECT `id` FROM `glpi_computers_items` WHERE `itemtype` = '".$item->getType()."' AND `items_id` = '".$item->getField('id')."'"; $result = $DB->query($query); if ($DB->numrows($result) > 0) { $ok = true; while ($data = $DB->fetch_assoc($result)) { if ($this->can($data["id"],'w')) { $ok &= $this->delete($data); } } return $ok; } } return false; } /** * * Print the form for computers or templates connections to printers, screens or peripherals * * @param $comp Computer object * @param $withtemplate boolean Template or basic item (default '') * * @return Nothing (call to classes members) **/ static function showForComputer(Computer $comp, $withtemplate='') { global $DB, $CFG_GLPI; $ID = $comp->fields['id']; $canedit = $comp->can($ID,'w'); $rand = mt_rand(); $datas = array(); $used = array(); foreach ($CFG_GLPI["directconnect_types"] as $itemtype) { $item = new $itemtype(); if ($item->canView()) { $query = "SELECT `glpi_computers_items`.`id` as assoc_id, `glpi_computers_items`.`computers_id` as assoc_computers_id, `glpi_computers_items`.`itemtype` as assoc_itemtype, `glpi_computers_items`.`items_id` as assoc_items_id, `glpi_computers_items`.`is_dynamic` as assoc_is_dynamic, ".getTableForItemType($itemtype).".* FROM `glpi_computers_items` LEFT JOIN `".getTableForItemType($itemtype)."` ON (`".getTableForItemType($itemtype)."`.`id` = `glpi_computers_items`.`items_id`) WHERE `computers_id` = '$ID' AND `itemtype` = '".$itemtype."' AND `glpi_computers_items`.`is_deleted` = '0'"; if ($item->maybetemplate()) { $query.= " AND NOT `".getTableForItemType($itemtype)."`.`is_template` "; } if ($result = $DB->query($query)) { while ($data = $DB->fetch_assoc($result)) { $datas[] = $data; $used[$itemtype][] = $data['assoc_items_id']; } } } } $number = count($datas); if ($canedit) { echo "
"; echo ""; echo ""; echo ""; echo ""; echo "
".__('Connect an item')."
"; // Dropdown::showAllItems("items_id", 0, 0, $comp->fields['entities_id'], // $CFG_GLPI["directconnect_types"], false, true); if (!empty($withtemplate)) { echo ""; } self::dropdownAllConnect('Computer', "items_id", $comp->fields["entities_id"], $withtemplate, $used); echo ""; echo ""; echo ""; echo "
"; Html::closeForm(); echo "
"; } if ($number) { echo "
"; if ($canedit) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $massiveactionparams = array('num_displayed' => $number, 'specific_actions' => array('purge' => _x('button', 'Disconnect'))); Html::showMassiveActions(__CLASS__, $massiveactionparams); } echo ""; echo ""; if ($canedit) { echo ""; } echo ""; echo ""; if (Plugin::haveImport()) { echo ""; } echo ""; echo ""; echo ""; echo ""; foreach ($datas as $data) { $linkname = $data["name"]; $itemtype = $data['assoc_itemtype']; if ($_SESSION["glpiis_ids_visible"] || empty($data["name"])) { $linkname = sprintf(__('%1$s (%2$s)'), $linkname, $data["id"]); } $link = Toolbox::getItemTypeFormURL($itemtype); $name = "".$linkname.""; echo ""; if ($canedit) { echo ""; } echo ""; echo ""; if (Plugin::haveImport()) { echo ""; } echo ""; echo ""; echo ""; echo ""; } echo "
".Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand)."".__('Type')."".__('Name')."".__('Automatic inventory')."".__('Entity')."".__('Serial number')."".__('Inventory number')."
"; Html::showMassiveActionCheckBox(__CLASS__, $data["assoc_id"]); echo "".$data['assoc_itemtype']::getTypeName(1)."".$name.""; echo Dropdown::getYesNo($data['assoc_is_dynamic']); echo "".Dropdown::getDropdownName("glpi_entities", $data['entities_id']); echo "". (isset($data["serial"])? "".$data["serial"]."" :"-")."". (isset($data["otherserial"])? "".$data["otherserial"]."" :"-")."
"; if ($canedit && $number) { $massiveactionparams['ontop'] = false; Html::showMassiveActions(__CLASS__, $massiveactionparams); Html::closeForm(); } echo "
"; } } /** * Prints a direct connection to a computer * * @param $item CommonDBTM object: the Monitor/Phone/Peripheral/Printer * @param $withtemplate integer withtemplate param (default '') * * @return nothing (print out a table) **/ static function showForItem(CommonDBTM $item, $withtemplate='') { // Prints a direct connection to a computer global $DB; $comp = new Computer(); $ID = $item->getField('id'); if (!$item->can($ID,"r")) { return false; } $canedit = $item->can($ID,"w"); $rand = mt_rand(); // Is global connection ? $global = $item->getField('is_global'); $used = array(); $compids = array(); $crit = array('FIELDS' => array('id', 'computers_id', 'is_dynamic'), 'itemtype' => $item->getType(), 'items_id' => $ID, 'is_deleted' => 0); foreach ($DB->request('glpi_computers_items', $crit) as $data) { $compids[$data['id']] = $data['computers_id']; $dynamic[$data['id']] = $data['is_dynamic']; $used['Computer'][] = $data['computers_id']; } $number = count($compids); if ($canedit && ($global || !$number)) { echo "
"; echo ""; echo ""; echo ""; echo ""; echo "
".__('Connect a computer')."
"; echo ""; echo ""; if ($item->isRecursive()) { self::dropdownConnect('Computer', $item->getType(), "computers_id", getSonsOf("glpi_entities", $item->getEntityID()), 0, $used); } else { self::dropdownConnect('Computer', $item->getType(), "computers_id", $item->getEntityID(), 0, $used); } echo ""; echo ""; echo "
"; Html::closeForm(); echo "
"; } echo "
"; if ($canedit && $number) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $massiveactionparams = array('num_displayed' => $number, 'specific_actions' => array('purge' => _x('button', 'Disconnect'))); Html::showMassiveActions(__CLASS__, $massiveactionparams); } echo ""; if ($number > 0) { echo ""; if ($canedit) { echo ""; } echo ""; if (Plugin::haveImport()) { echo ""; } echo ""; echo ""; echo ""; echo ""; foreach ($compids as $key => $compid) { $comp->getFromDB($compid); echo ""; if ($canedit) { echo ""; } echo ""; if (Plugin::haveImport()) { echo ""; } echo ""; echo ""; echo ""; echo ""; } } else { echo ""; } echo "
".Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand)."".__('Name')."".__('Automatic inventory')."".__('Entity')."".__('Serial number')."".__('Inventory number')."
"; Html::showMassiveActionCheckBox(__CLASS__, $data["id"]); echo "getField('is_deleted')?"class='tab_bg_2_2'":""). ">".$comp->getLink().""; echo Dropdown::getYesNo($dynamic[$key]); echo "".Dropdown::getDropdownName("glpi_entities", $comp->getField('entities_id')); echo "".$comp->getField('serial')."".$comp->getField('otherserial')."
".__('Not connected').""; echo "
"; if ($canedit && $number) { $paramsma['ontop'] = false; Html::showMassiveActions(__CLASS__, $paramsma); Html::closeForm(); } echo "
"; } /** * Unglobalize an item : duplicate item and connections * * @param $item CommonDBTM object to unglobalize **/ static function unglobalizeItem(CommonDBTM $item) { global $DB; // Update item to unit management : if ($item->getField('is_global')) { $input = array('id' => $item->fields['id'], 'is_global' => 0); $item->update($input); // Get connect_wire for this connection $query = "SELECT `glpi_computers_items`.`id` FROM `glpi_computers_items` WHERE `glpi_computers_items`.`items_id` = '".$item->fields['id']."' AND `glpi_computers_items`.`itemtype` = '".$item->getType()."'"; $result = $DB->query($query); if ($data = $DB->fetch_assoc($result)) { // First one, keep the existing one // The others = clone the existing object unset($input['id']); $conn = new self(); while ($data = $DB->fetch_assoc($result)) { $temp = clone $item; unset($temp->fields['id']); if ($newID=$temp->add($temp->fields)) { $conn->update(array('id' => $data['id'], 'items_id' => $newID)); } } } } } /** * Make a select box for connections * * @since version 0.84 * * @param $fromtype from where the connection is * @param $myname select name * @param $entity_restrict Restrict to a defined entity (default = -1) * @param $onlyglobal display only global devices (used for templates) (default 0) * @param $used array Already used items ID: not to display in dropdown * * @return nothing (print out an HTML select box) */ static function dropdownAllConnect($fromtype, $myname, $entity_restrict=-1, $onlyglobal=0, $used=array()) { global $CFG_GLPI; $rand = mt_rand(); // $use_ajax = false; // if ($CFG_GLPI["use_ajax"]) { // $nb = 0; // if ($entity_restrict >= 0) { // $nb = countElementsInTableForEntity(getTableForItemType($itemtype), $entity_restrict); // } else { // $nb = countElementsInTableForMyEntities(getTableForItemType($itemtype)); // } // if ($nb > $CFG_GLPI["ajax_limit_count"]) { // $use_ajax = true; // } // } $options = array(); $options['checkright'] = true; $options['name'] = 'itemtype'; $rand = Dropdown::showItemType($CFG_GLPI['directconnect_types'], $options); if ($rand) { $params = array('itemtype' => '__VALUE__', 'fromtype' => $fromtype, 'value' => 0, 'myname' => $myname, 'onlyglobal' => $onlyglobal, 'entity_restrict' => $entity_restrict, 'used' => $used); if ($onlyglobal) { $params['condition'] = "`is_global` = '1'"; } Ajax::updateItemOnSelectEvent("itemtype$rand", "show_$myname$rand", $CFG_GLPI["root_doc"]."/ajax/dropdownConnect.php", $params); echo "
 \n"; } return $rand; } /** * Make a select box for connections * * @param $itemtype type to connect * @param $fromtype from where the connection is * @param $myname select name * @param $entity_restrict Restrict to a defined entity (default = -1) * @param $onlyglobal display only global devices (used for templates) (default 0) * @param $used array Already used items ID: not to display in dropdown * * @return nothing (print out an HTML select box) */ static function dropdownConnect($itemtype, $fromtype, $myname, $entity_restrict=-1, $onlyglobal=0, $used=array()) { global $CFG_GLPI; $rand = mt_rand(); $use_ajax = false; if ($CFG_GLPI["use_ajax"]) { $nb = 0; if ($entity_restrict >= 0) { $nb = countElementsInTableForEntity(getTableForItemType($itemtype), $entity_restrict); } else { $nb = countElementsInTableForMyEntities(getTableForItemType($itemtype)); } if ($nb > $CFG_GLPI["ajax_limit_count"]) { $use_ajax = true; } } $params = array('searchText' => '__VALUE__', 'fromtype' => $fromtype, 'itemtype' => $itemtype, 'myname' => $myname, 'onlyglobal' => $onlyglobal, 'entity_restrict' => $entity_restrict, 'used' => $used); $default = "\n"; Ajax::dropdown($use_ajax, "/ajax/dropdownConnect.php", $params, $default, $rand); return $rand; } /** * @see CommonGLPI::getTabNameForItem() **/ function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { // can exists for Template if ($item->can($item->getField('id'),'r')) { switch ($item->getType()) { case 'Phone' : case 'Printer' : case 'Peripheral' : case 'Monitor' : if (Session::haveRight('computer', 'r')) { if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(_n('Connection','Connections',2), self::countForItem($item)); } return _n('Connection','Connections',2); } break; case 'Computer' : if (Session::haveRight('phone', 'r') || Session::haveRight('printer', 'r') || Session::haveRight('peripheral', 'r') || Session::haveRight('monitor', 'r')) { if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(_n('Connection','Connections',2), self::countForComputer($item)); } return _n('Connection','Connections',2); } break; } } return ''; } /** * @param $item CommonGLPI object * @param $tabnum (default 1) * @param $withtemplate (default 0) */ static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($item->getType()) { case 'Phone' : case 'Printer' : case 'Peripheral' : case 'Monitor' : self::showForItem($item); return true; case 'Computer' : self::showForComputer($item); return true; } } /** * Duplicate connected items to computer from an item template to its clone * * @since version 0.84 * * @param $oldid ID of the item to clone * @param $newid ID of the item cloned **/ static function cloneComputer($oldid, $newid) { global $DB; $query = "SELECT * FROM `glpi_computers_items` WHERE `computers_id` = '".$oldid."';"; $result = $DB->query($query); foreach ($DB->request($query) as $data) { $conn = new Computer_Item(); $conn->add(array('computers_id' => $newid, 'itemtype' => $data["itemtype"], 'items_id' => $data["items_id"])); } } /** * Duplicate connected items to item from an item template to its clone * * @since version 0.83.3 * * @param $itemtype type of the item to clone * @param $oldid ID of the item to clone * @param $newid ID of the item cloned **/ static function cloneItem($itemtype, $oldid, $newid) { global $DB; $query = "SELECT * FROM `glpi_computers_items` WHERE `itemtype` = '$itemtype' AND `items_id` = '".$oldid."'"; $result = $DB->query($query); foreach ($DB->request($query) as $data) { $conn = new self(); $conn->add(array('computers_id' => $data["computers_id"], 'itemtype' => $data["itemtype"], 'items_id' => $newid)); } } } ?>glpi-0.84.3+dfsg.1/inc/computer_softwarelicense.class.php000066400000000000000000000617201226600447100233300ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class Computer_SoftwareLicense extends CommonDBRelation { // From CommonDBRelation static public $itemtype_1 = 'Computer'; static public $items_id_1 = 'computers_id'; static public $itemtype_2 = 'SoftwareLicense'; static public $items_id_2 = 'softwarelicenses_id'; /** * Get search function for the class * * @since version 0.84 * * @return array of search option **/ function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab[4]['table'] = 'glpi_softwarelicenses'; $tab[4]['field'] = 'name'; $tab[4]['name'] = _n('License', 'Licenses', 1); $tab[4]['datatype'] = 'dropdown'; $tab[4]['massiveaction'] = false; $tab[5]['table'] = 'glpi_computers'; $tab[5]['field'] = 'name'; $tab[5]['name'] = _n('Computer', 'Computers', 1); $tab[5]['massiveaction'] = false; $tab[5]['datatype'] = 'dropdown'; return $tab; } /** * @since version 0.84 * * @see CommonDBTM::showSpecificMassiveActionsParameters() **/ function showSpecificMassiveActionsParameters($input=array()) { switch ($input['action']) { case "move_license" : if (isset($input['options'])) { $input['options'] = Toolbox::decodeArrayFromInput($input['options']); if (isset($input['options']['move'])) { SoftwareLicense::dropdown(array('condition' => "`glpi_softwarelicenses`.`softwares_id` = '".$input['options']['move']['softwares_id']."'", 'used' => $input['options']['move']['used'])); echo "

 "; return true; } } return false; default : return parent::showSpecificMassiveActionsParameters($input); } return false; } /** * @since version 0.84 * * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "move_license" : if (isset($input['softwarelicenses_id'])) { foreach ($input["item"] as $key => $val) { if ($val == 1) { //Get software name and manufacturer if ($this->can($key,'w')) { //Process rules if ($this->update(array('id' => $key, 'softwarelicenses_id' => $input['softwarelicenses_id']))) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } } } else { $res['ko']++; } break; case "install" : $csl = new self(); $csv = new Computer_SoftwareVersion(); foreach ($input["item"] as $key => $val) { if ($val == 1) { if ($csl->getFromDB($key)) { $sl = new SoftwareLicense(); if ($sl->getFromDB($csl->fields["softwarelicenses_id"])) { $version = 0; if ($sl->fields["softwareversions_id_use"]>0) { $version = $sl->fields["softwareversions_id_use"]; } else { $version = $sl->fields["softwareversions_id_buy"]; } if ($version > 0) { $params = array('computers_id' => $csl->fields['computers_id'], 'softwareversions_id' => $version); //Get software name and manufacturer if ($csv->can(-1,'w', $params)) { //Process rules if ($csv->add($params)) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } else { $res['ko']++; } } else { $res['ko']++; } } else { $res['ko']++; } } } break; default : return parent::doSpecificMassiveActions($input); } return $res; } /** * Get number of installed licenses of a license * * @param $softwarelicenses_id license ID * @param $entity to search for computer in (default = all active entities) * (default '') * * @return number of installations **/ static function countForLicense($softwarelicenses_id, $entity='') { global $DB; $query = "SELECT COUNT(`glpi_computers_softwarelicenses`.`id`) FROM `glpi_computers_softwarelicenses` INNER JOIN `glpi_computers` ON (`glpi_computers_softwarelicenses`.`computers_id` = `glpi_computers`.`id`) WHERE `glpi_computers_softwarelicenses`.`softwarelicenses_id` = '$softwarelicenses_id' AND `glpi_computers`.`is_deleted` = '0' AND `glpi_computers`.`is_template` = '0' AND `glpi_computers_softwarelicenses`.`is_deleted` = '0'" . getEntitiesRestrictRequest('AND', 'glpi_computers','',$entity); $result = $DB->query($query); if ($DB->numrows($result) != 0) { return $DB->result($result, 0, 0); } return 0; } /** * Get number of installed licenses of a software * * @param $softwares_id software ID * * @return number of installations **/ static function countForSoftware($softwares_id) { global $DB; $query = "SELECT COUNT(`glpi_computers_softwarelicenses`.`id`) FROM `glpi_softwarelicenses` INNER JOIN `glpi_computers_softwarelicenses` ON (`glpi_softwarelicenses`.`id` = `glpi_computers_softwarelicenses`.`softwarelicenses_id`) INNER JOIN `glpi_computers` ON (`glpi_computers_softwarelicenses`.`computers_id` = `glpi_computers`.`id`) WHERE `glpi_softwarelicenses`.`softwares_id` = '$softwares_id' AND `glpi_computers`.`is_deleted` = '0' AND `glpi_computers`.`is_template` = '0' AND `glpi_computers_softwarelicenses`.`is_deleted` = '0'" . getEntitiesRestrictRequest('AND', 'glpi_computers'); $result = $DB->query($query); if ($DB->numrows($result) != 0) { return $DB->result($result, 0, 0); } return 0; } /** * Show number of installation per entity * * @param $license SoftwareLicense object * * @return nothing **/ static function showForLicenseByEntity(SoftwareLicense $license) { global $DB, $CFG_GLPI; $softwarelicense_id = $license->getField('id'); if (!Session::haveRight("software", "r") || !$softwarelicense_id) { return false; } echo "
"; echo ""; echo ""; echo ""; echo "\n"; $tot = 0; $sql = "SELECT `id`, `completename` FROM `glpi_entities` " . getEntitiesRestrictRequest('WHERE', 'glpi_entities') ." ORDER BY `completename`"; foreach ($DB->request($sql) as $ID => $data) { $nb = self::countForLicense($softwarelicense_id,$ID); if ($nb > 0) { echo ""; echo "\n"; $tot += $nb; } } if ($tot > 0) { echo ""; echo "\n"; } else { echo "\n"; } echo "
".__('Entity')."".__('Number of affected computers')."
" . $data["completename"] . "".$nb."
".__('Total')."".$tot."
" . __('No item found') . "
"; } /** * Show computers linked to a License * * @param $license SoftwareLicense object * * @return nothing **/ static function showForLicense(SoftwareLicense $license) { global $DB, $CFG_GLPI; $searchID = $license->getField('id'); if (!Session::haveRight("software", "r") || !$searchID) { return false; } $canedit = Session::haveRight("software", "w"); $canshowcomputer = Session::haveRight("computer", "r"); if (isset($_POST["start"])) { $start = $_POST["start"]; } else { $start = 0; } if (isset($_POST["order"]) && ($_POST["order"] == "DESC")) { $order = "DESC"; } else { $order = "ASC"; } if (isset($_POST["sort"]) && !empty($_POST["sort"])) { // manage several param like location,compname : order first $tmp = explode(",",$_POST["sort"]); $sort = "`".implode("` $order,`",$tmp)."`"; } else { $sort = "`entity` $order, `compname`"; } //SoftwareLicense ID $query_number = "SELECT COUNT(*) AS cpt FROM `glpi_computers_softwarelicenses` INNER JOIN `glpi_computers` ON (`glpi_computers_softwarelicenses`.`computers_id` = `glpi_computers`.`id`) WHERE `glpi_computers_softwarelicenses`.`softwarelicenses_id` = '$searchID'". getEntitiesRestrictRequest(' AND', 'glpi_computers') ." AND `glpi_computers`.`is_deleted` = '0' AND `glpi_computers`.`is_template` = '0' AND `glpi_computers_softwarelicenses`.`is_deleted` = '0'"; $number = 0; if ($result = $DB->query($query_number)) { $number = $DB->result($result, 0, 0); } echo "
"; if ($canedit) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
"; Computer::dropdown(array('entity' => $license->fields['entities_id'], 'entity_sons' => $license->fields['is_recursive'])); echo ""; echo "
"; Html::closeForm(); } if ($number < 1) { echo ""; echo ""; echo "
".__('No item found')."
\n"; return; } // Display the pager Html::printAjaxPager(__('Affected computers'), $start, $number); $query = "SELECT `glpi_computers_softwarelicenses`.*, `glpi_computers`.`name` AS compname, `glpi_computers`.`id` AS cID, `glpi_computers`.`serial`, `glpi_computers`.`otherserial`, `glpi_users`.`name` AS username, `glpi_users`.`id` AS userid, `glpi_users`.`realname` AS userrealname, `glpi_users`.`firstname` AS userfirstname, `glpi_softwarelicenses`.`name` AS license, `glpi_softwarelicenses`.`id` AS vID, `glpi_softwarelicenses`.`name` AS vername, `glpi_entities`.`completename` AS entity, `glpi_locations`.`completename` AS location, `glpi_states`.`name` AS state, `glpi_groups`.`name` AS groupe, `glpi_softwarelicenses`.`name` AS lname, `glpi_softwarelicenses`.`id` AS lID FROM `glpi_computers_softwarelicenses` INNER JOIN `glpi_softwarelicenses` ON (`glpi_computers_softwarelicenses`.`softwarelicenses_id` = `glpi_softwarelicenses`.`id`) INNER JOIN `glpi_computers` ON (`glpi_computers_softwarelicenses`.`computers_id` = `glpi_computers`.`id`) LEFT JOIN `glpi_entities` ON (`glpi_computers`.`entities_id` = `glpi_entities`.`id`) LEFT JOIN `glpi_locations` ON (`glpi_computers`.`locations_id` = `glpi_locations`.`id`) LEFT JOIN `glpi_states` ON (`glpi_computers`.`states_id` = `glpi_states`.`id`) LEFT JOIN `glpi_groups` ON (`glpi_computers`.`groups_id` = `glpi_groups`.`id`) LEFT JOIN `glpi_users` ON (`glpi_computers`.`users_id` = `glpi_users`.`id`) WHERE (`glpi_softwarelicenses`.`id` = '$searchID') " . getEntitiesRestrictRequest(' AND', 'glpi_computers') ." AND `glpi_computers`.`is_deleted` = '0' AND `glpi_computers`.`is_template` = '0' AND `glpi_computers_softwarelicenses`.`is_deleted` = '0' ORDER BY $sort $order LIMIT ".intval($start)."," . intval($_SESSION['glpilist_limit']); $rand = mt_rand(); if ($result = $DB->query($query)) { if ($data = $DB->fetch_assoc($result)) { if ($canedit) { $rand = mt_rand(); Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $paramsma = array('num_displayed' => $_SESSION['glpilist_limit'], 'specific_actions' => array('move_license' => _x('button', 'Move'), 'delete' => _x('button', 'Delete permanently'))); // Options to update license $paramsma['extraparams']['options']['move']['used'] = array($searchID); $paramsma['extraparams']['options']['move']['softwares_id'] = $license->fields['softwares_id']; Html::showMassiveActions(__CLASS__, $paramsma); } $soft = new Software(); $soft->getFromDB($license->fields['softwares_id']); $showEntity = ($license->isRecursive()); $linkUser = Session::haveRight('user', 'r'); $text = sprintf(__('%1$s = %2$s'), Software::getTypeName(1), $soft->fields["name"]); $text = sprintf(__('%1$s - %2$s'), $text, $data["vername"]); Session::initNavigateListItems('Computer', $text); $sort_img = ""; echo ""; if ($canedit) { echo ""; } echo ""; if ($showEntity) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; do { Session::addToNavigateListItems('Computer',$data["cID"]); echo ""; if ($canedit) { echo ""; } $compname = $data['compname']; if (empty($compname) || $_SESSION['glpiis_ids_visible']) { $compname = sprintf(__('%1$s (%2$s)'), $compname, $data['cID']); } if ($canshowcomputer) { echo ""; } else { echo ""; } if ($showEntity) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; } while ($data=$DB->fetch_assoc($result)); echo "
"; Html::checkAllAsCheckbox('mass'.__CLASS__.$rand); echo "".($sort=="`compname`"?$sort_img:""). "".__('Name')."".(strstr($sort,"entity")?$sort_img:""). "".__('Entity')."".($sort=="`serial`"?$sort_img:""). "".__('Serial number')."".($sort=="`otherserial`"?$sort_img:""). "".__('Inventory number'). "".(strstr($sort,"`location`")?$sort_img:""). "".__('Location')."".(strstr($sort,"state")?$sort_img:""). "".__('Status')."".(strstr($sort,"groupe")?$sort_img:""). "".__('Group')."".(strstr($sort,"username")?$sort_img:""). "".__('User')."
".Html::getMassiveActionCheckBox(__CLASS__, $data["id"])."$compname".$compname."".$data['entity']."".$data['serial']."".$data['otherserial']."".$data['location']."".$data['state']."".$data['groupe']."".formatUserName($data['userid'], $data['username'], $data['userrealname'], $data['userfirstname'], $linkUser)."
\n"; if ($canedit) { $paramsma['ontop'] = false; Html::showMassiveActions(__CLASS__, $paramsma); Html::closeForm(); } } else { // Not found _e('No item found'); } } // Query Html::printAjaxPager(__('Affected computers'), $start, $number); echo "\n"; } /** * Update license associated on a computer * * @param $licID ID of the install software lienk * @param $softwarelicenses_id ID of the new license * * @return nothing **/ function upgrade($licID, $softwarelicenses_id) { global $DB; if ($this->getFromDB($licID)) { $computers_id = $this->fields['computers_id']; $this->delete(array('id' => $licID)); $this->add(array('computers_id' => $computers_id, 'softwarelicenses_id' => $softwarelicenses_id)); } } /** * Get licenses list corresponding to an installation * * @param $computers_id ID of the computer * @param $softwareversions_id ID of the version * * @return nothing **/ static function GetLicenseForInstallation($computers_id, $softwareversions_id) { global $DB; $lic = array(); $sql = "SELECT `glpi_softwarelicenses`.*, `glpi_softwarelicensetypes`.`name` AS type FROM `glpi_softwarelicenses` INNER JOIN `glpi_computers_softwarelicenses` ON (`glpi_softwarelicenses`.`id` = `glpi_computers_softwarelicenses`.`softwarelicenses_id` AND `glpi_computers_softwarelicenses`.`computers_id` = '$computers_id') LEFT JOIN `glpi_softwarelicensetypes` ON (`glpi_softwarelicenses`.`softwarelicensetypes_id` =`glpi_softwarelicensetypes`.`id`) WHERE `glpi_softwarelicenses`.`softwareversions_id_use` = '$softwareversions_id' OR `glpi_softwarelicenses`.`softwareversions_id_buy` = '$softwareversions_id'"; foreach ($DB->request($sql) as $ID => $data) { $lic[$data['id']] = $data; } return $lic; } /** * Duplicate all software licenses from a computer template to its clone * * @param $oldid ID of the computer to clone * @param $newid ID of the computer cloned **/ static function cloneComputer($oldid, $newid) { global $DB; $query = "SELECT * FROM `glpi_computers_softwarelicenses` WHERE `computers_id` = '$oldid'"; foreach ($DB->request($query) as $data) { $csl = new self(); unset($data['id']); $data['computers_id'] = $newid; $data['_no_history'] = true; $csl->add($data); } } /** * @see CommonGLPI::getTabNameForItem() **/ function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { switch ($item->getType()) { case 'SoftwareLicense' : if (!$withtemplate) { $nb = 0; if ($_SESSION['glpishow_count_on_tabs']) { $nb = self::countForLicense($item->getID()); } return array(1 => SoftwareLicense::getTypeName(1), 2 => self::createTabEntry(Computer::getTypeName(2), $nb)); } break; } return ''; } /** * @param $item CommonGLPI object * @param $tabnum (default 1) * @param $withtemplate (default 0) **/ static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType() == 'SoftwareLicense') { switch ($tabnum) { case 1 : self::showForLicenseByEntity($item); break; case 2 : self::showForLicense($item); break; } } return true; } } ?>glpi-0.84.3+dfsg.1/inc/computer_softwareversion.class.php000066400000000000000000001312401226600447100233660ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class Computer_SoftwareVersion extends CommonDBRelation { // From CommonDBRelation static public $itemtype_1 = 'Computer'; static public $items_id_1 = 'computers_id'; static public $itemtype_2 = 'SoftwareVersion'; static public $items_id_2 = 'softwareversions_id'; static public $log_history_1_add = Log::HISTORY_INSTALL_SOFTWARE; static public $log_history_1_delete = Log::HISTORY_UNINSTALL_SOFTWARE; static public $log_history_2_add = Log::HISTORY_INSTALL_SOFTWARE; static public $log_history_2_delete = Log::HISTORY_UNINSTALL_SOFTWARE; static function getTypeName($nb=0) { return _n('Installation', 'Installations', $nb); } function prepareInputForAdd($input) { if (!isset($input['is_template_computer']) || !isset($input['is_deleted_computer'])) { // Get template and deleted information from computer // If computer set update is_template / is_deleted infos to ensure data validity if (isset($input['computers_id'])) { $computer = new Computer(); if ($computer->getFromDB($input['computers_id'])) { $input['is_template_computer'] = $computer->getField('is_template'); $input['is_deleted_computer'] = $computer->getField('is_deleted'); } } } return parent::prepareInputForAdd($input); } /** * @since version 0.84 **/ function prepareInputForUpdate($input) { if (!isset($input['is_template_computer']) || !isset($input['is_deleted_computer'])) { // If computer set update is_template / is_deleted infos to ensure data validity if (isset($input['computers_id'])) { // Get template and deleted information from computer $computer = new Computer(); if ($computer->getFromDB($input['computers_id'])) { $input['is_template_computer'] = $computer->getField('is_template'); $input['is_deleted_computer'] = $computer->getField('is_deleted'); } } } return parent::prepareInputForUpdate($input); } /** * @since version 0.84 * * @see CommonDBTM::showSpecificMassiveActionsParameters() **/ function showSpecificMassiveActionsParameters($input=array()) { switch ($input['action']) { case "move_version" : if (isset($input['options'])) { $input['options'] = Toolbox::decodeArrayFromInput($input['options']); if (isset($input['options']['move'])) { $options = array('softwares_id' => $input['options']['move']['softwares_id']); if (isset($input['options']['move']['used'])) { $options['used'] = $input['options']['move']['used']; } SoftwareVersion::dropdown($options); echo "

 "; return true; } } return false; default : return parent::showSpecificMassiveActionsParameters($input); } return false; } /** * @since version 0.84 * * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "move_version" : if (isset($input['softwareversions_id'])) { foreach ($input["item"] as $key => $val) { if ($val == 1) { //Get software name and manufacturer if ($this->can($key,'w')) { //Process rules if ($this->update(array('id' => $key, 'softwareversions_id' => $input['softwareversions_id']))) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } } } else { $res['ko']++; } break; default : return parent::doSpecificMassiveActions($input); } return $res; } /** * @param $computers_id **/ function updateDatasForComputer($computers_id) { global $DB; $comp = new Computer(); if ($comp->getFromDB($computers_id)) { $query = "UPDATE `".$this->getTable()."` SET `is_template_computer` = '".$comp->getField('is_template')."', `is_deleted_computer` = '".$comp->getField('is_deleted')."' WHERE `computers_id` = '$computers_id';"; return $DB->query($query); } return false; } /** * Get number of installed licenses of a version * * @param $softwareversions_id version ID * @param $entity to search for computer in (default '' = all active entities) * (default '') * * @return number of installations **/ static function countForVersion($softwareversions_id, $entity='') { global $DB; $query = "SELECT COUNT(`glpi_computers_softwareversions`.`id`) FROM `glpi_computers_softwareversions` INNER JOIN `glpi_computers` ON (`glpi_computers_softwareversions`.`computers_id` = `glpi_computers`.`id`) WHERE `glpi_computers_softwareversions`.`softwareversions_id` = '$softwareversions_id' AND `glpi_computers`.`is_deleted` = '0' AND `glpi_computers`.`is_template` = '0' AND `glpi_computers_softwareversions`.`is_deleted` = '0'" . getEntitiesRestrictRequest('AND', 'glpi_computers', '', $entity); $result = $DB->query($query); if ($DB->numrows($result) != 0) { return $DB->result($result, 0, 0); } return 0; } /** * Get number of installed versions of a software * * @param $softwares_id software ID * * @return number of installations **/ static function countForSoftware($softwares_id) { global $DB; $query = "SELECT COUNT(`glpi_computers_softwareversions`.`id`) FROM `glpi_softwareversions` INNER JOIN `glpi_computers_softwareversions` ON (`glpi_softwareversions`.`id` = `glpi_computers_softwareversions`.`softwareversions_id`) INNER JOIN `glpi_computers` ON (`glpi_computers_softwareversions`.`computers_id` = `glpi_computers`.`id`) WHERE `glpi_softwareversions`.`softwares_id` = '$softwares_id' AND `glpi_computers`.`is_deleted` = '0' AND `glpi_computers`.`is_template` = '0' AND `glpi_computers_softwareversions`.`is_deleted` = '0'" . getEntitiesRestrictRequest('AND', 'glpi_computers'); $result = $DB->query($query); if ($DB->numrows($result) != 0) { return $DB->result($result, 0, 0); } return 0; } /** * Show installation of a Software * * @param $software Software object * * @return nothing **/ static function showForSoftware(Software $software) { self::showInstallations($software->getField('id'), 'softwares_id'); } /** * Show installation of a Version * * @param $version SoftwareVersion object * * @return nothing **/ static function showForVersion(SoftwareVersion $version) { self::showInstallations($version->getField('id'), 'id'); } /** * Show installations of a software * * @param $searchID value of the ID to search * @param $crit to search : softwares_id (software) or id (version) * * @return nothing **/ private static function showInstallations($searchID, $crit) { global $DB, $CFG_GLPI; if (!Session::haveRight("software", "r") || !$searchID) { return false; } $canedit = Session::haveRight("software", "w"); $canshowcomputer = Session::haveRight("computer", "r"); if (isset($_POST["start"])) { $start = $_POST["start"]; } else { $start = 0; } if (isset($_POST["order"]) && ($_POST["order"] == "DESC")) { $order = "DESC"; } else { $order = "ASC"; } if (isset($_POST["sort"]) && !empty($_POST["sort"])) { // manage several param like location,compname : order first $tmp = explode(",",$_POST["sort"]); $sort = "`".implode("` $order,`",$tmp)."`"; } else { if ($crit == "softwares_id") { $sort = "`entity` $order, `version`, `compname`"; } else { $sort = "`entity` $order, `compname`"; } } // Total Number of events if ($crit == "softwares_id") { // Software ID $query_number = "SELECT COUNT(*) AS cpt FROM `glpi_computers_softwareversions` INNER JOIN `glpi_softwareversions` ON (`glpi_computers_softwareversions`.`softwareversions_id` = `glpi_softwareversions`.`id`) INNER JOIN `glpi_computers` ON (`glpi_computers_softwareversions`.`computers_id` = `glpi_computers`.`id`) WHERE `glpi_softwareversions`.`softwares_id` = '$searchID'" . getEntitiesRestrictRequest(' AND', 'glpi_computers') ." AND `glpi_computers`.`is_deleted` = '0' AND `glpi_computers`.`is_template` = '0' AND `glpi_computers_softwareversions`.`is_deleted` = '0'"; } else { //SoftwareVersion ID $query_number = "SELECT COUNT(*) AS cpt FROM `glpi_computers_softwareversions` INNER JOIN `glpi_computers` ON (`glpi_computers_softwareversions`.`computers_id` = `glpi_computers`.`id`) WHERE `glpi_computers_softwareversions`.`softwareversions_id` = '$searchID'". getEntitiesRestrictRequest(' AND', 'glpi_computers') ." AND `glpi_computers`.`is_deleted` = '0' AND `glpi_computers`.`is_template` = '0' AND `glpi_computers_softwareversions`.`is_deleted` = '0'"; } $number = 0; if ($result =$DB->query($query_number)) { $number = $DB->result($result,0,0); } echo "
"; if ($number < 1) { echo ""; echo ""; echo "
".__('No item found')."
\n"; return; } // Display the pager Html::printAjaxPager(self::getTypeName(2), $start, $number); $query = "SELECT DISTINCT `glpi_computers_softwareversions`.*, `glpi_computers`.`name` AS compname, `glpi_computers`.`id` AS cID, `glpi_computers`.`serial`, `glpi_computers`.`otherserial`, `glpi_users`.`name` AS username, `glpi_users`.`id` AS userid, `glpi_users`.`realname` AS userrealname, `glpi_users`.`firstname` AS userfirstname, `glpi_softwareversions`.`name` AS version, `glpi_softwareversions`.`id` AS vID, `glpi_softwareversions`.`softwares_id` AS sID, `glpi_softwareversions`.`name` AS vername, `glpi_entities`.`completename` AS entity, `glpi_locations`.`completename` AS location, `glpi_states`.`name` AS state, `glpi_groups`.`name` AS groupe FROM `glpi_computers_softwareversions` INNER JOIN `glpi_softwareversions` ON (`glpi_computers_softwareversions`.`softwareversions_id` = `glpi_softwareversions`.`id`) INNER JOIN `glpi_computers` ON (`glpi_computers_softwareversions`.`computers_id` = `glpi_computers`.`id`) LEFT JOIN `glpi_entities` ON (`glpi_computers`.`entities_id` = `glpi_entities`.`id`) LEFT JOIN `glpi_locations` ON (`glpi_computers`.`locations_id` = `glpi_locations`.`id`) LEFT JOIN `glpi_states` ON (`glpi_computers`.`states_id` = `glpi_states`.`id`) LEFT JOIN `glpi_groups` ON (`glpi_computers`.`groups_id` = `glpi_groups`.`id`) LEFT JOIN `glpi_users` ON (`glpi_computers`.`users_id` = `glpi_users`.`id`) WHERE (`glpi_softwareversions`.`$crit` = '$searchID') " . getEntitiesRestrictRequest(' AND', 'glpi_computers') ." AND `glpi_computers`.`is_deleted` = '0' AND `glpi_computers`.`is_template` = '0' AND `glpi_computers_softwareversions`.`is_deleted` = '0' ORDER BY $sort $order LIMIT ".intval($start)."," . intval($_SESSION['glpilist_limit']); $rand = mt_rand(); if ($result = $DB->query($query)) { if ($data = $DB->fetch_assoc($result)) { $softwares_id = $data['sID']; $soft = new Software(); $showEntity = ($soft->getFromDB($softwares_id) && $soft->isRecursive()); $linkUser = Session::haveRight('user', 'r'); $title = $soft->fields["name"]; if ($crit == "id") { $title = sprintf(__('%1$s - %2$s'), $title, $data["vername"]); } Session::initNavigateListItems('Computer', //TRANS : %1$s is the itemtype name, // %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), Software::getTypeName(1), $title)); $sort_img = ""; if ($canedit) { $rand = mt_rand(); Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $paramsma = array('num_displayed' => $_SESSION['glpilist_limit'], 'specific_actions' => array('move_version' => _x('button', 'Move'), 'purge' => _x('button', 'Delete permanently'))); // Options to update version $paramsma['extraparams']['options']['move']['softwares_id'] = $softwares_id; if ($crit=='softwares_id') { $paramsma['extraparams']['options']['move']['used'] = array(); } else { $paramsma['extraparams']['options']['move']['used'] = array($searchID); } Html::showMassiveActions(__CLASS__, $paramsma); } echo ""; if ($canedit) { echo ""; } if ($crit == "softwares_id") { echo ""; } echo ""; if ($showEntity) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; do { Session::addToNavigateListItems('Computer',$data["cID"]); echo ""; if ($canedit) { echo ""; } if ($crit == "softwares_id") { echo ""; } $compname = $data['compname']; if (empty($compname) || $_SESSION['glpiis_ids_visible']) { $compname = sprintf(__('%1$s (%2$s)'), $compname, $data['cID']); } if ($canshowcomputer) { echo ""; } else { echo ""; } if ($showEntity) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $lics = Computer_SoftwareLicense::GetLicenseForInstallation($data['cID'], $data['vID']); echo ""; echo "\n"; } while ($data = $DB->fetch_assoc($result)); echo "
"; Html::checkAllAsCheckbox('mass'.__CLASS__.$rand); echo "".($sort=="`vername`"?$sort_img:""). ""._n('Version', 'Versions',2). "".($sort=="`compname`"?$sort_img:""). "".__('Name')."".(strstr($sort,"entity")?$sort_img:""). "".__('Entity')."".($sort=="`serial`"?$sort_img:""). "".__('Serial number')."".($sort=="`otherserial`"?$sort_img:""). "".__('Inventory number'). "".(strstr($sort,"`location`")?$sort_img:""). "".__('Location')."".(strstr($sort,"state")?$sort_img:""). "".__('Status')."".(strstr($sort,"groupe")?$sort_img:""). "".__('Group')."".(strstr($sort,"username")?$sort_img:""). "".__('User')."".($sort=="`lname`"?$sort_img:""). ""._n('License', 'Licenses', 2). "
"; Html::showMassiveActionCheckBox(__CLASS__, $data["id"]); echo "". $data['version']."$compname".$compname."".$data['entity']."".$data['serial']."".$data['otherserial']."".$data['location']."".$data['state']."".$data['groupe']."".formatUserName($data['userid'], $data['username'], $data['userrealname'], $data['userfirstname'], $linkUser).""; if (count($lics)) { foreach ($lics as $data) { $serial = $data['serial']; if (!empty($data['type'])) { $serial = sprintf(__('%1$s (%2$s)'), $serial, $data['type']); } echo "".$data['name']; echo " - ".$serial; echo "
"; } } echo "
\n"; if ($canedit) { $paramsma['ontop'] =false; Html::showMassiveActions(__CLASS__, $paramsma); Html::closeForm(); } } else { // Not found _e('No item found'); } } // Query Html::printAjaxPager(self::getTypeName(2), $start, $number); echo "\n"; } /** * Show number of installations per entity * * @param $version SoftwareVersion object * * @return nothing **/ static function showForVersionByEntity(SoftwareVersion $version) { global $DB, $CFG_GLPI; $softwareversions_id = $version->getField('id'); if (!Session::haveRight("software", "r") || !$softwareversions_id) { return false; } echo "
"; echo ""; echo ""; echo ""; echo "\n"; $tot = 0; $sql = "SELECT `id`, `completename` FROM `glpi_entities` " . getEntitiesRestrictRequest('WHERE', 'glpi_entities') ." ORDER BY `completename`"; foreach ($DB->request($sql) as $ID => $data) { $nb = self::countForVersion($softwareversions_id,$ID); if ($nb > 0) { echo ""; echo "\n"; $tot += $nb; } } if ($tot > 0) { echo ""; echo "\n"; } else { echo "\n"; } echo "
".__('Entity')."".self::getTypeName(2)."
" . $data["completename"] . "".$nb."
".__('Total')."".$tot."
" . __('No item found') . "
"; } /** * Show software installed on a computer * * @param $comp Computer object * @param $withtemplate template case of the view process (default '') * * @return nothing **/ static function showForComputer(Computer $comp, $withtemplate='') { global $DB, $CFG_GLPI; if (!Session::haveRight("software", "r")) { return false; } $computers_id = $comp->getField('id'); $rand = mt_rand(); $canedit = Session::haveRight("software", "w"); $entities_id = $comp->fields["entities_id"]; $add_dynamic = ''; if (Plugin::haveImport()) { $add_dynamic = "`glpi_computers_softwareversions`.`is_dynamic`,"; } $query = "SELECT `glpi_softwares`.`softwarecategories_id`, `glpi_softwares`.`name` AS softname, `glpi_computers_softwareversions`.`id`, $add_dynamic `glpi_states`.`name` AS state, `glpi_softwareversions`.`id` AS verid, `glpi_softwareversions`.`softwares_id`, `glpi_softwareversions`.`name` AS version FROM `glpi_computers_softwareversions` LEFT JOIN `glpi_softwareversions` ON (`glpi_computers_softwareversions`.`softwareversions_id` = `glpi_softwareversions`.`id`) LEFT JOIN `glpi_states` ON (`glpi_states`.`id` = `glpi_softwareversions`.`states_id`) LEFT JOIN `glpi_softwares` ON (`glpi_softwareversions`.`softwares_id` = `glpi_softwares`.`id`) WHERE `glpi_computers_softwareversions`.`computers_id` = '$computers_id' AND `glpi_computers_softwareversions`.`is_deleted` = '0' ORDER BY `softwarecategories_id`, `softname`, `version`"; $result = $DB->query($query); $i = 0; if ((empty($withtemplate) || ($withtemplate != 2)) && $canedit) { echo ""; echo "
"; echo ""; echo "\n"; echo "
"; echo _n('Software', 'Software', 2)."  "; echo ""; Software::dropdownSoftwareToInstall("softwareversions_id", $entities_id); echo ""; echo ""; echo "
\n"; Html::closeForm(); } echo "
"; $cat = -1; Session::initNavigateListItems('Software', //TRANS : %1$s is the itemtype name, // %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), Computer::getTypeName(1), $comp->getName())); Session::initNavigateListItems('SoftwareLicense', //TRANS : %1$s is the itemtype name, // %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), Computer::getTypeName(1), $comp->getName())); $installed = array(); if ($number = $DB->numrows($result)) { if ($canedit) { $rand = mt_rand(); Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $paramsma = array('num_displayed' => $number, 'specific_actions' => array('purge' => _x('button', 'Delete permanently'))); Html::showMassiveActions(__CLASS__, $paramsma); } echo ""; while ($data = $DB->fetch_assoc($result)) { if ($data["softwarecategories_id"] != $cat) { self::displayCategoryFooter($cat, $rand, $canedit); $cat = self::displayCategoryHeader($computers_id, $data, $rand, $canedit); } $licids = self::displaySoftsByCategory($data, $computers_id, $withtemplate, $canedit); Session::addToNavigateListItems('Software', $data["softwares_id"]); foreach ($licids as $licid) { Session::addToNavigateListItems('SoftwareLicense', $licid); $installed[] = $licid; } } self::displayCategoryFooter($cat, $rand, $canedit); echo "
"; if ($canedit) { $paramsma['ontop'] =false; Html::showMassiveActions(__CLASS__, $paramsma); Html::closeForm(); } } echo "
\n"; if ((empty($withtemplate) || ($withtemplate != 2)) && $canedit) { echo ""; echo "
"; echo ""; echo "\n"; echo "
"; echo _n('License', 'Licenses', 2)."  "; echo ""; Software::dropdownLicenseToInstall("softwarelicenses_id", $entities_id); echo ""; echo ""; echo "
\n"; Html::closeForm(); } echo "
"; // Affected licenses NOT installed $query = "SELECT `glpi_softwarelicenses`.*, `glpi_computers_softwarelicenses`.`id` AS linkID, `glpi_softwares`.`name` AS softname, `glpi_softwareversions`.`name` AS version, `glpi_states`.`name` AS state FROM `glpi_softwarelicenses` LEFT JOIN `glpi_computers_softwarelicenses` ON (`glpi_computers_softwarelicenses`.softwarelicenses_id = `glpi_softwarelicenses`.`id`) INNER JOIN `glpi_softwares` ON (`glpi_softwarelicenses`.`softwares_id` = `glpi_softwares`.`id`) LEFT JOIN `glpi_softwareversions` ON (`glpi_softwarelicenses`.`softwareversions_id_use` = `glpi_softwareversions`.`id` OR (`glpi_softwarelicenses`.`softwareversions_id_use` = '0' AND `glpi_softwarelicenses`.`softwareversions_id_buy` = `glpi_softwareversions`.`id`)) LEFT JOIN `glpi_states` ON (`glpi_states`.`id` = `glpi_softwareversions`.`states_id`) WHERE `glpi_computers_softwarelicenses`.`computers_id` = '$computers_id' AND `glpi_computers_softwarelicenses`.`is_deleted` = '0'"; if (count($installed)) { $query .= " AND `glpi_softwarelicenses`.`id` NOT IN (".implode(',',$installed).")"; } $req = $DB->request($query); if ($number = $req->numrows()) { if ($canedit) { $rand = mt_rand(); Html::openMassiveActionsForm('massSoftwareLicense'.$rand); $actions = array('install' => _x('button', 'Install')); if (SoftwareLicense::canUpdate()) { $actions['purge'] = _x('button', 'Delete permanently'); } $paramsma = array('num_displayed' => $number, 'specific_actions' => $actions); Html::showMassiveActions('Computer_SoftwareLicense', $paramsma); echo ""; } echo ""; $cat = true; foreach ($req as $data) { if ($cat) { self::displayCategoryHeader($computers_id, $data, $rand, $canedit); $cat = false; } self::displaySoftsByLicense($data, $computers_id, $withtemplate, $canedit); Session::addToNavigateListItems('SoftwareLicense', $data["id"]); } self::displayCategoryFooter(NULL, $rand, $canedit); echo "
"; if ($canedit) { $paramsma['ontop'] = false; Html::showMassiveActions('Computer_SoftwareLicense', $paramsma); Html::closeForm(); } } echo "
\n"; } /** * Display category footer for Computer_SoftwareVersion::showForComputer function * * @param $cat current category ID * @param $rand random for unicity / no more used * @param $canedit boolean / no more used * * @return new category ID **/ private static function displayCategoryFooter($cat, $rand, $canedit) { // Close old one if ($cat != -1) { echo ""; echo ""; } } /** * Display category header for Computer_SoftwareVersion::showForComputer function * * @param $computers_ID ID of the computer * @param $data data used to display * @param $rand random for unicity * @param $canedit boolean * * @return new category ID **/ private static function displayCategoryHeader($computers_ID, $data, $rand, $canedit) { global $CFG_GLPI; $display = "none"; if (isset($data["softwarecategories_id"])) { $cat = $data["softwarecategories_id"]; if ($cat) { // Categorized $catname = Dropdown::getDropdownName('glpi_softwarecategories', $cat); $display = $_SESSION["glpiis_categorized_soft_expanded"]; } else { // Not categorized $catname = __('Uncategorized software'); $display = $_SESSION["glpiis_not_categorized_soft_expanded"]; } } else { // Not installed $cat = ''; $catname = __('Affected licenses of not installed software'); $display = true; } echo ""; echo ""; echo " ". $catname. ""; echo ""; echo ""; echo "
"; echo ""; if ($canedit) { echo ""; } echo ""; echo ""; if (isset($data['is_dynamic'])) { echo ""; } echo "\n"; return $cat; } /** * Display a installed software for a category * * @param $data data used to display * @param $computers_id ID of the computer * @param $withtemplate template case of the view process * @param $canedit boolean user can edit software ? * * @return array of found license id **/ private static function displaySoftsByCategory($data, $computers_id, $withtemplate, $canedit) { global $DB, $CFG_GLPI; $ID = $data["id"]; $verid = $data["verid"]; $multiple = false; echo ""; if ($canedit) { echo ""; } echo ""; echo ""; echo ""; echo ""; if (isset($data['is_dynamic'])) { echo ""; } echo "\n"; return $licids; } /** * Display a software for a License (not installed) * * @param $data data used to display * @param $computers_id ID of the computer * @param $withtemplate template case of the view process * @param $canedit boolean user can edit software ? * * @return nothing */ private static function displaySoftsByLicense($data, $computers_id, $withtemplate, $canedit) { global $CFG_GLPI; $version = 0; if ($data["softwareversions_id_use"]>0) { $version = $data["softwareversions_id_use"]; } else { $version = $data["softwareversions_id_buy"]; } $ID = $data['linkID']; $multiple = false; $link_item = Toolbox::getItemTypeFormURL('SoftwareLicense'); $link = $link_item."?id=".$data['id']; echo ""; if ($canedit) { echo ""; } echo ""; echo ""; echo "\n"; } /** * Update version installed on a computer * * @param $instID ID of the install software lienk * @param $softwareversions_id ID of the new version * @param $dohistory Do history ? (default 1) * * @return nothing **/ function upgrade($instID, $softwareversions_id, $dohistory=1) { if ($this->getFromDB($instID)) { $computers_id = $this->fields['computers_id']; $this->delete(array('id' => $instID)); $this->add(array('computers_id' => $computers_id, 'softwareversions_id' => $softwareversions_id)); } } /** * Duplicate all software from a computer template to its clone * * @param $oldid ID of the computer to clone * @param $newid ID of the computer cloned **/ static function cloneComputer($oldid, $newid) { global $DB; $query = "SELECT * FROM `glpi_computers_softwareversions` WHERE `computers_id` = '$oldid'"; foreach ($DB->request($query) as $data) { $csv = new self(); unset($data['id']); $data['computers_id'] = $newid; $data['_no_history'] = true; $csv->add($data); } } /** * @see CommonGLPI::getTabNameForItem() **/ function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { switch ($item->getType()) { case 'Software' : if (!$withtemplate) { if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(self::getTypeName(2), self::countForSoftware($item->getID())); } return self::getTypeName(2); } break; case 'SoftwareVersion' : if (!$withtemplate) { $nb = 0; if ($_SESSION['glpishow_count_on_tabs']) { $nb = self::countForVersion($item->getID()); } return array(1 => SoftwareVersion::getTypeName(1), 2 => self::createTabEntry(self::getTypeName(2), $nb)); } break; case 'Computer' : // Installation allowed for template if (Session::haveRight("software","r")) { if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(Software::getTypeName(2), countElementsInTable('glpi_computers_softwareversions', "computers_id = '".$item->getID()."' AND `is_deleted`='0'")); } return Software::getTypeName(2); } break; } return ''; } /** * @param $item CommonGLPI object * @param $tabnum (default 1) * @param $withtemplate (default 0) **/ static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType()=='Software') { self::showForSoftware($item); } else if ($item->getType()=='Computer') { self::showForComputer($item, $withtemplate); } else if ($item->getType()=='SoftwareVersion') { switch ($tabnum) { case 1 : self::showForVersionByEntity($item); break; case 2 : self::showForVersion($item); break; } } return true; } } ?> glpi-0.84.3+dfsg.1/inc/computerdisk.class.php000066400000000000000000000233641226600447100207300ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Disk class class ComputerDisk extends CommonDBChild { // From CommonDBChild static public $itemtype = 'Computer'; static public $items_id = 'computers_id'; public $dohistory = true; static function getTypeName($nb=0) { return _n('Volume', 'Volumes', $nb); } function post_getEmpty() { $this->fields["totalsize"] = '0'; $this->fields["freesize"] = '0'; } /** * @see CommonGLPI::getTabNameForItem() **/ function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { // can exists for template if (($item->getType() == 'Computer') && Session::haveRight("computer","r")) { if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(self::getTypeName(2), countElementsInTable('glpi_computerdisks', "computers_id = '".$item->getID()."' AND `is_deleted`='0'")); } return self::getTypeName(2); } return ''; } /** * @param $item CommonGLPI object * @param $tabnum (default 1) * @param $withtemplate (default 0) */ static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { self::showForComputer($item, $withtemplate); return true; } /** * Duplicate all disks from a computer template to his clone * * @since version 0.84 * * @param $oldid * @param $newid **/ static function cloneComputer ($oldid, $newid) { global $DB; $query = "SELECT * FROM `glpi_computerdisks` WHERE `computers_id` = '$oldid'"; foreach ($DB->request($query) as $data) { $cd = new self(); unset($data['id']); $data['computers_id'] = $newid; $data = Toolbox::addslashes_deep($data); $cd->add($data); } } /** * Print the version form * * @param $ID integer ID of the item * @param $options array * - target for the Form * - computers_id ID of the computer for add process * * @return true if displayed false if item not found or not right to display **/ function showForm($ID, $options=array()) { global $CFG_GLPI; if (!Session::haveRight("computer", "w")) { return false; } $comp = new Computer(); if ($ID > 0) { $this->check($ID,'r'); $comp->getFromDB($this->fields['computers_id']); } else { $this->check(-1, 'w', $options); $comp->getFromDB($options['computers_id']); } $this->showTabs($options); $this->showFormHeader($options); if ($this->isNewID($ID)) { echo ""; } echo ""; echo ""; echo ""; if (Plugin::haveImport()) { echo ""; echo ""; } else { echo ""; } echo "\n"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $this->showFormButtons($options); $this->addDivForTabs(); return true; } /** * Print the computers disks * * @param $comp Computer object * @param $withtemplate boolean Template or basic item (default '') * * @return Nothing (call to classes members) **/ static function showForComputer(Computer $comp, $withtemplate='') { global $DB; $ID = $comp->fields['id']; if (!$comp->getFromDB($ID) || !$comp->can($ID, "r")) { return false; } $canedit = $comp->can($ID, "w"); echo "
"; $query = "SELECT `glpi_filesystems`.`name` AS fsname, `glpi_computerdisks`.* FROM `glpi_computerdisks` LEFT JOIN `glpi_filesystems` ON (`glpi_computerdisks`.`filesystems_id` = `glpi_filesystems`.`id`) WHERE `computers_id` = '$ID' AND `is_deleted` = '0'"; if ($result = $DB->query($query)) { echo "
"; Html::checkAllAsCheckbox("softcat$cat$rand"); echo "" . __('Name') . "" . __('Status') . "" .__('Version')."" . __('License') . "".__('Automatic inventory')."
"; Html::showMassiveActionCheckBox(__CLASS__, $data["id"]); echo ""; echo ""; echo ($_SESSION["glpiis_ids_visible"] ? sprintf(__('%1$s (%2$s)'), $data["softname"], $data['softwares_id']) : $data["softname"]); echo "" . $data["state"] . "" . $data["version"]; echo ""; $query = "SELECT `glpi_softwarelicenses`.*, `glpi_softwarelicensetypes`.`name` AS type FROM `glpi_computers_softwarelicenses` INNER JOIN `glpi_softwarelicenses` ON (`glpi_computers_softwarelicenses`.`softwarelicenses_id` = `glpi_softwarelicenses`.`id`) LEFT JOIN `glpi_softwarelicensetypes` ON (`glpi_softwarelicenses`.`softwarelicensetypes_id` =`glpi_softwarelicensetypes`.`id`) WHERE `glpi_computers_softwarelicenses`.`computers_id` = '$computers_id' AND (`glpi_softwarelicenses`.`softwareversions_id_use` = '$verid' OR (`glpi_softwarelicenses`.`softwareversions_id_use` = '0' AND `glpi_softwarelicenses`.`softwareversions_id_buy` = '$verid'))"; $licids = array(); foreach ($DB->request($query) as $licdata) { $licids[] = $licdata['id']; $licserial = $licdata['serial']; if (!empty($licdata['type'])) { $licserial = sprintf(__('%1$s (%2$s)'), $licserial, $licdata['type']); } echo "". $licdata['name']. " - ".$licserial; $link_item = Toolbox::getItemTypeFormURL('SoftwareLicense'); $link = $link_item."?id=".$licdata['id']; $comment = "". "". "". "
".__('Name')."".$licdata['name']."
".__('Serial number')."".$licdata['serial']."
". __('Comments').''.$licdata['comment'].'
'; Html::showToolTip($comment, array('link' => $link)); echo "
"; } if (!count($licids)) { echo " "; } echo "
"; echo Dropdown::getYesNo($data['is_dynamic']); echo "
"; if ((empty($withtemplate) || ($withtemplate != 2)) && ($version > 0)) { Html::showMassiveActionCheckBox('Computer_SoftwareLicense', $ID); } echo ""; echo ""; echo ($_SESSION["glpiis_ids_visible"] ? sprintf(__('%1$s (%2$s)'), $data["softname"], $data['softwares_id']) : $data["softname"]); echo "" . $data["state"] . "" . $data["version"]; $serial = $data["serial"]; if ($data["softwarelicensetypes_id"]) { $serial = sprintf(__('%1$s (%2$s)'), $serial, Dropdown::getDropdownName("glpi_softwarelicensetypes", $data["softwarelicensetypes_id"])); } echo "" .$data["name"]." - ". $serial; $comment = ""."". "". "
".__('Name')."".$data['name']."
".__('Serial number')."".$data['serial']."
". __('Comments')."".$data['comment']."
"; Html::showToolTip($comment, array('link' => $link)); echo "
".__('Computer')."".$comp->getLink()."".__('Automatic inventory').""; if ($ID && $this->fields['is_dynamic']) { Plugin::doHook("autoinventory_information", $this); } else { _e('No'); } echo "
".__('Name').""; Html::autocompletionTextField($this, "name"); echo "".__('Partition').""; Html::autocompletionTextField($this, "device"); echo "
".__('Mount point').""; Html::autocompletionTextField($this, "mountpoint"); echo "".__('File system').""; FileSystem::dropdown(array('value' => $this->fields["filesystems_id"])); echo "
".__('Global size').""; Html::autocompletionTextField($this, "totalsize"); echo " ".__('Mio')."".__('Free size').""; Html::autocompletionTextField($this, "freesize"); echo " ".__('Mio')."
"; $colspan = 7; if (Plugin::haveImport()) { $colspan++; } echo ""; if ($DB->numrows($result)) { echo ""; if (Plugin::haveImport()) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; Session::initNavigateListItems(__CLASS__, //TRANS : %1$s is the itemtype name, // %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), Computer::getTypeName(1), $comp->getName())); $disk = new self(); while ($data = $DB->fetch_assoc($result)) { $disk->getFromDB($data['id']); echo ""; echo ""; if (Plugin::haveImport()) { echo ""; } echo ""; echo ""; echo ""; //TRANS: %s is a size $tmp = sprintf(__('%s Mio'), Html::formatNumber($data['totalsize'], false, 0)); echo ""; $tmp = sprintf(__('%s Mio'), Html::formatNumber($data['freesize'], false, 0)); echo ""; echo ""; echo ""; Session::addToNavigateListItems(__CLASS__, $data['id']); } } else { echo ""; } if ($canedit && !(!empty($withtemplate) && ($withtemplate == 2))) { echo ""; } echo "
".self::getTypeName($DB->numrows($result))."
".__('Name')."".__('Automatic inventory')."".__('Partition')."".__('Mount point')."".__('File system')."".__('Global size')."".__('Free size')."".__('Free percentage')."
".$disk->getLink().""; echo Dropdown::getYesNo($data['is_dynamic']); echo "".$data['device']."".$data['mountpoint']."".$data['fsname']."$tmp$tmp"; $percent = 0; if ($data['totalsize'] > 0) { $percent = round(100*$data['freesize']/$data['totalsize']); } Html::displayProgressBar('100', $percent, array('simple' => true, 'forcepadding' => false)); echo "
".__('No item found')."
"; echo "".__('Add a volume')."
"; } echo "

"; } } ?> glpi-0.84.3+dfsg.1/inc/computermodel.class.php000066400000000000000000000026741226600447100210770ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class ComputerModel class ComputerModel extends CommonDropdown { var $additional_fields_for_dictionnary = array('manufacturer'); static function getTypeName($nb=0) { return _n('Computer model', 'Computer models', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/computertype.class.php000066400000000000000000000025631226600447100207550ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class ComputerType class ComputerType extends CommonDropdown { static function getTypeName($nb=0) { return _n('Computer type', 'Computer types', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/computervirtualmachine.class.php000066400000000000000000000356771226600447100230230ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief Virtual machine management */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class to manage virtual machines class ComputerVirtualMachine extends CommonDBChild { // From CommonDBChild static public $itemtype = 'Computer'; static public $items_id = 'computers_id'; public $dohistory = true; static function getTypeName($nb=0) { return _n('Virtual machine', 'Virtual machines', $nb); } /** * @see CommonGLPI::getTabNameForItem() **/ function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate && ($item->getType() == 'Computer') && Session::haveRight("computer","r")) { if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(self::getTypeName(2), countElementsInTable('glpi_computervirtualmachines', "computers_id = '".$item->getID()."' AND `is_deleted`='0'")); } return self::getTypeName(2); } return ''; } /** * @param $item CommonGLPI object * @param $tabnum (default 1) * @param $withtemplate (default 0) **/ static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { self::showForVirtualMachine($item); self::showForComputer($item); return true; } function post_getEmpty() { $this->fields["vcpu"] = '0'; $this->fields["ram"] = '0'; } /** * Print the version form * * @param $ID integer ID of the item * @param $options array * - target for the Form * - computers_id ID of the computer for add process * * @return true if displayed false if item not found or not right to display **/ function showForm($ID, $options=array()) { global $CFG_GLPI; if (!Session::haveRight("computer","w")) { return false; } $comp = new Computer(); if ($ID > 0) { $this->check($ID,'r'); $comp->getFromDB($this->fields['computers_id']); } else { // Create item $this->check(-1, 'w', $options); $comp->getFromDB($options['computers_id']); } $this->showTabs($options); $this->showFormHeader($options); if ($this->isNewID($ID)) { echo ""; } echo ""; echo "".__('Computer').""; echo "".$comp->getLink().""; if (Plugin::haveImport()) { echo "".__('Automatic inventory').""; echo ""; if ($ID && $this->fields['is_dynamic']) { Plugin::doHook("autoinventory_information", $this); } else { _e('No'); } echo ""; } else { echo ""; } echo "\n"; echo ""; echo "".__('Name').""; echo ""; Html::autocompletionTextField($this, "name"); echo "".__('Virtualization system').""; echo ""; VirtualMachineType::dropdown(array('value' => $this->fields['virtualmachinetypes_id'])); echo ""; echo ""; echo "".__('Virtualization model').""; echo ""; VirtualMachineSystem::dropdown(array('value' => $this->fields['virtualmachinesystems_id'])); echo "".__('State of the virtual machine').""; echo ""; VirtualMachineState::dropdown(array('value' => $this->fields['virtualmachinestates_id'])); echo ""; echo ""; echo "".__('UUID').""; echo ""; Html::autocompletionTextField($this, "uuid"); echo ""; echo ""._x('quantity', 'Processors number').""; echo ""; Html::autocompletionTextField($this, "vcpu"); echo ""; echo ""; echo "".sprintf(__('%1$s (%2$s)'),__('Memory'),__('Mio')).""; echo ""; Html::autocompletionTextField($this, "ram"); echo ""; echo "".__('Machine').""; echo ""; if ($link_computer = self::findVirtualMachine($this->fields)) { $computer = new Computer(); if ($computer->getFromDB($link_computer)) { echo $computer->getLink(array('comments' => true)); } else { echo NOT_AVAILABLE; } } echo ""; echo ""; $this->showFormButtons($options); $this->addDivForTabs(); return true; } /** * Show hosts for a virtualmachine * * @param $comp Computer object that represents the virtual machine * * @return Nothing (call to classes members) **/ static function showForVirtualMachine(Computer $comp) { global $DB; $ID = $comp->fields['id']; if (!$comp->getFromDB($ID) || !$comp->can($ID, "r")) { return false; } $canedit = $comp->can($ID, "w"); echo "
"; if (isset($comp->fields['uuid']) && ($comp->fields['uuid'] != '')) { $where = "LOWER(`uuid`)".self::getUUIDRestrictRequest($comp->fields['uuid']); $hosts = getAllDatasFromTable('glpi_computervirtualmachines', $where); if (!empty($hosts)) { echo ""; echo ""; echo ""; echo ""; echo ""; $computer = new Computer(); foreach ($hosts as $host) { echo ""; echo ""; echo ""; } echo "
".__('List of host machines')."
".__('Name')."".__('Entity')."
"; if ($computer->can($host['computers_id'],'r')) { echo ""; echo $computer->fields['name'].""; $tooltip = "'; $tooltip.= "'; $tooltip.= "
".__('Name')."".$computer->fields['name']. '
".__('Serial number')."".$computer->fields['serial']. '
".__('Comments')."".$computer->fields['comment']. '
'; echo "  ".Html::showToolTip($tooltip, array('display' => false)); } else { echo $computer->fields['name']; } echo "
"; echo Dropdown::getDropdownName('glpi_entities', $computer->fields['entities_id']); echo "
"; } } echo "
"; if (!empty($hosts)) { echo "
"; } } /** * Print the computers disks * * @param $comp Computer object * * @return Nothing (call to classes members) **/ static function showForComputer(Computer $comp) { global $DB; $ID = $comp->fields['id']; if (!$comp->getFromDB($ID) || !$comp->can($ID, "r")) { return false; } $canedit = $comp->can($ID, "w"); echo "
"; $virtualmachines = getAllDatasFromTable('glpi_computervirtualmachines', "`computers_id` = '$ID' AND `is_deleted` = '0'"); echo ""; Session::initNavigateListItems('ComputerVirtualMachine', sprintf(__('%1$s = %2$s'), __('Computer'), (empty($comp->fields['name']) ? "($ID)" : $comp->fields['name']))); if (empty($virtualmachines)) { echo ""; } else { echo ""; echo ""; if (Plugin::haveImport()) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $vm = new self(); foreach ($virtualmachines as $virtualmachine) { $vm->getFromDB($virtualmachine['id']); echo ""; echo ""; if (Plugin::haveImport()) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; Session::addToNavigateListItems('ComputerVirtualMachine', $virtualmachine['id']); } } if ($canedit) { echo ""; } echo "
".__('No virtual machine associated with the computer')."
".__('List of virtual machines')."
".__('Name')."".__('Automatic inventory')."".__('Virtualization system')."".__('Virtualization model')."".__('State of the virtual machine')."".__('UUID').""._x('quantity', 'Processors number')."".sprintf(__('%1$s (%2$s)'), __('Memory'),__('Mio'))."".__('Machine')."
".$vm->getLink().""; echo Dropdown::getYesNo($vm->isDynamic()); echo ""; echo Dropdown::getDropdownName('glpi_virtualmachinetypes', $virtualmachine['virtualmachinetypes_id']); echo ""; echo Dropdown::getDropdownName('glpi_virtualmachinesystems', $virtualmachine['virtualmachinesystems_id']); echo ""; echo Dropdown::getDropdownName('glpi_virtualmachinestates', $virtualmachine['virtualmachinestates_id']); echo "".$virtualmachine['uuid']."".$virtualmachine['vcpu']."".$virtualmachine['ram'].""; if ($link_computer = self::findVirtualMachine($virtualmachine)) { $computer = new Computer(); if ($computer->can($link_computer,'r')) { $url = ""; $url .= $computer->fields["name"].""; $tooltip = "'; $tooltip.= "'; $tooltip.= "
".__('Name')."".$computer->fields['name']. '
".__('Serial number')."".$computer->fields['serial']. '
".__('Comments')."".$computer->fields['comment']. '
'; $url .= "  ".Html::showToolTip($tooltip, array('display' => false)); } else { $url = $computer->fields['name']; } echo $url; } echo "
"; echo "". __('Add a virtual machine')."
"; echo "
"; } /** * Get correct uuid sql search for virtualmachines * * @param $uuid the uuid given * * @return the restrict which contains uuid, uuid with first block flipped, * uuid with 3 first block flipped **/ static function getUUIDRestrictRequest($uuid) { //More infos about uuid, please see wikipedia : //http://en.wikipedia.org/wiki/Universally_unique_identifier //Some uuid are not conform, so preprocessing is necessary //A good uuid likes lik : 550e8400-e29b-41d4-a716-446655440000 //Case one : for example some uuid are like that : //56 4d 77 d0 6b ef 3d da-4d 67 5c 80 a9 52 e2 c9 $pattern = "/([\w]{2})\ ([\w]{2})\ ([\w]{2})\ ([\w]{2})\ "; $pattern .= "([\w]{2})\ ([\w]{2})\ ([\w]{2})\ ([\w]{2})-"; $pattern .= "([\w]{2})\ ([\w]{2})\ ([\w]{2})\ ([\w]{2})\ "; $pattern .= "([\w]{2})\ ([\w]{2})\ ([\w]{2})\ ([\w]{2})/"; if (preg_match($pattern, $uuid)) { $uuid = preg_replace($pattern, "$1$2$3$4-$5$6-$7$8-$9$10-$11$12$13$14$15$16", $uuid); } //Case two : why this code ? Because some dmidecode < 2.10 is buggy. //On unix is flips first block of uuid and on windows flips 3 first blocks... $in = " IN ('".strtolower($uuid)."'"; $regexes = array("/([\w]{2})([\w]{2})([\w]{2})([\w]{2})(.*)/" => "$4$3$2$1$5", "/([\w]{2})([\w]{2})([\w]{2})([\w]{2})-([\w]{2})([\w]{2})-([\w]{2})([\w]{2})(.*)/" => "$4$3$2$1-$6$5-$8$7$9"); foreach ($regexes as $pattern => $replace) { $reverse_uuid = preg_replace($pattern, $replace, $uuid); if ($reverse_uuid) { $in .= " ,'".strtolower($reverse_uuid)."'"; } } $in .= ")"; return $in; } /** * Find a virtual machine by uuid * * @param fields array of virtualmachine fields * * @return the ID of the computer that have this uuid or false otherwise **/ static function findVirtualMachine($fields=array()) { global $DB; if (!isset($fields['uuid']) || empty($fields['uuid'])) { return false; } $query = "SELECT `id` FROM `glpi_computers` WHERE LOWER(`uuid`) ".self::getUUIDRestrictRequest($fields['uuid']); $result = $DB->query($query); //Virtual machine found, return ID if ($DB->numrows($result)) { return $DB->result($result,0,'id'); } return false; } } ?> glpi-0.84.3+dfsg.1/inc/config.class.php000066400000000000000000001720241226600447100174620ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Config class **/ class Config extends CommonDBTM { // From CommonGLPI protected $displaylist = false; // From CommonDBTM public $auto_message_on_action = false; public $showdebug = true; static function getTypeName($nb=0) { return __('Setup'); } static function canCreate() { return false; } static function canUpdate() { return Session::haveRight('config', 'w'); } static function canView() { return Session::haveRight('config', 'r'); } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab(__CLASS__, $ong, $options); return $ong; } function showForm($ID, $options=array()) { $this->check(1, 'r'); $this->showTabs($options); $this->addDivForTabs(); } /** * Prepare input datas for updating the item * * @see CommonDBTM::prepareInputForUpdate() * * @param $input array of datas used to update the item * * @return the modified $input array **/ function prepareInputForUpdate($input) { if (isset($input['allow_search_view']) && !$input['allow_search_view']) { // Global search need "view" $input['allow_search_global'] = 0; } if (isset($input["smtp_passwd"])) { if (empty($input["smtp_passwd"])) { unset($input["smtp_passwd"]); } else { $input["smtp_passwd"] = Toolbox::encrypt(stripslashes($input["smtp_passwd"]), GLPIKEY); } } if (isset($input["_blank_smtp_passwd"]) && $input["_blank_smtp_passwd"]) { $input['smtp_passwd'] = ''; } if (isset($input["proxy_passwd"])) { if (empty($input["proxy_passwd"])) { unset($input["proxy_passwd"]); } else { $input["proxy_passwd"] = Toolbox::encrypt(stripslashes($input["proxy_passwd"]), GLPIKEY); } } if (isset($input["_blank_proxy_passwd"]) && $input["_blank_proxy_passwd"]) { $input['proxy_passwd'] = ''; } // Manage DB Slave process if (isset($input['_dbslave_status'])) { $already_active = DBConnection::isDBSlaveActive(); if ($input['_dbslave_status']) { DBConnection::changeCronTaskStatus(true); if (!$already_active) { // Activate Slave from the "system" tab DBConnection::createDBSlaveConfig(); } else if (isset($input["_dbreplicate_dbhost"])) { // Change parameter from the "replicate" tab DBConnection::saveDBSlaveConf($input["_dbreplicate_dbhost"], $input["_dbreplicate_dbuser"], $input["_dbreplicate_dbpassword"], $input["_dbreplicate_dbdefault"]); } } if (!$input['_dbslave_status'] && $already_active) { DBConnection::deleteDBSlaveConfig(); DBConnection::changeCronTaskStatus(false); } } // Matrix for Impact / Urgence / Priority if (isset($input['_matrix'])) { $tab = array(); for ($urgency=1 ; $urgency<=5 ; $urgency++) { for ($impact=1 ; $impact<=5 ; $impact++) { $priority = $input["_matrix_${urgency}_${impact}"]; $tab[$urgency][$impact] = $priority; } } $input['priority_matrix'] = exportArrayToDB($tab); $input['urgency_mask'] = 0; $input['impact_mask'] = 0; for ($i=1 ; $i<=5 ; $i++) { if ($input["_urgency_${i}"]) { $input['urgency_mask'] += (1<<$i); } if ($input["_impact_${i}"]) { $input['impact_mask'] += (1<<$i); } } } return $input; } /** * Print the config form for display * * @return Nothing (display) **/ function showFormDisplay() { global $CFG_GLPI; if (!Session::haveRight("config", "w")) { return false; } echo ""; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if ($CFG_GLPI["use_ajax"]) { echo ""; if ($CFG_GLPI["use_ajax"]) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
" . __('General setup') . "
" . __('URL of the application') . ""; echo "
" . __('Text in the login box') . ""; echo ""; echo "
" . __('Allow FAQ anonymous access') . ""; Dropdown::showYesNo("use_public_faq", $CFG_GLPI["use_public_faq"]); echo "" . __('Simplified interface help link') . "
" . __('Default search results limit (page)').""; Dropdown::showInteger("list_limit_max", $CFG_GLPI["list_limit_max"], 5, 200, 5); echo "" . __('Standard interface help link') . "
" . __('Default characters limit (summary text boxes)') . ""; Dropdown::showInteger('cut', $CFG_GLPI["cut"], 50, 500, 50); echo "" . __('Default url length limit') . ""; Dropdown::showInteger('url_maxlength', $CFG_GLPI["url_maxlength"], 20, 80, 5); echo "
" .__('Default decimals limit') . ""; Dropdown::showInteger("decimal_number", $CFG_GLPI["decimal_number"], 1, 4); echo "" . __('Default chart format').""; Dropdown::showFromArray("default_graphtype", array('png' => 'PNG', 'svg' => 'SVG'), array('value' => $CFG_GLPI["default_graphtype"])); echo "
".__('Dynamic display'). "
". __('Use dynamic display for dropdowns and text fields'). ""; Dropdown::showYesNo("use_ajax", $CFG_GLPI["use_ajax"]); echo "".__('Minimum text length for dynamic search in dropdowns').""; Dropdown::showInteger('ajax_min_textsearch_load', $CFG_GLPI["ajax_min_textsearch_load"], 0, 10, 1); } else { echo " "; } echo "
". __("Don't use dynamic display if the number of items is less than")." "; Dropdown::showInteger('ajax_limit_count', $CFG_GLPI["ajax_limit_count"], 1, 200, 1, array(0 => __('Never'))); echo "".__('Buffer time for dynamic search in dropdowns').""; Dropdown::showNumber('ajax_buffertime_load', array('value' => $CFG_GLPI["ajax_buffertime_load"], 'min' => 0, 'max' => 5000, 'step' => 100, 'unit' => 'millisecond')); echo "
" . __('Autocompletion of text fields') . ""; Dropdown::showYesNo("use_ajax_autocompletion", $CFG_GLPI["use_ajax_autocompletion"]); echo "". __('Character to force the full display of dropdowns (wildcard)')."
". __('Maximum number of items to display in the dropdown when wildcard is not used'). ""; Dropdown::showInteger('dropdown_max', $CFG_GLPI["dropdown_max"], 0, 200); echo " 
".__('Search engine')."
" . __('Items seen') . ""; $values = array(0 => __('No'), 1 => sprintf(__('%1$s (%2$s)'), __('Yes'), __('last criterion')), 2 => sprintf(__('%1$s (%2$s)'), __('Yes'), __('default criterion'))); Dropdown::showFromArray('allow_search_view', $values, array('value' => $CFG_GLPI['allow_search_view'])); echo "". __('Global search').""; if ($CFG_GLPI['allow_search_view']) { Dropdown::showYesNo('allow_search_global', $CFG_GLPI['allow_search_global']); } else { echo Dropdown::getYesNo(0); } echo "
" . __('All') . ""; $values = array(0 => __('No'), 1 => sprintf(__('%1$s (%2$s)'), __('Yes'), __('last criterion'))); Dropdown::showFromArray('allow_search_all', $values, array('value' => $CFG_GLPI['allow_search_all'])); echo "
"; echo ""; echo "
"; Html::closeForm(); } /** * Print the config form for restrictions * * @return Nothing (display) **/ function showFormInventory() { global $DB, $CFG_GLPI; if (!Session::haveRight("config", "w")) { return false; } echo ""; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
" . __('Assets') . "
". __('Enable the financial and administrative information by default').""; Dropdown::ShowYesNo('auto_create_infocoms', $CFG_GLPI["auto_create_infocoms"]); echo " " . __('Restrict monitor management') . ""; $this->dropdownGlobalManagement ("monitors_management_restrict", $CFG_GLPI["monitors_management_restrict"]); echo ""; echo "
" . __('Software category deleted by the dictionary rules') . ""; SoftwareCategory::dropdown(array('value' => $CFG_GLPI["softwarecategories_id_ondelete"], 'name' => "softwarecategories_id_ondelete")); echo " " . __('Restrict device management') . ""; $this->dropdownGlobalManagement ("peripherals_management_restrict", $CFG_GLPI["peripherals_management_restrict"]); echo "
" .__('Beginning of fiscal year') . ""; Html::showDateFormItem("date_tax", $CFG_GLPI["date_tax"], false, true, '', '', false); echo " " . __('Restrict phone management') . ""; $this->dropdownGlobalManagement ("phones_management_restrict", $CFG_GLPI["phones_management_restrict"]); echo "
" . __('Automatic fields (marked by *)') . ""; $tab = array(0 => __('Global'), 1 => __('By entity')); Dropdown::showFromArray('use_autoname_by_entity', $tab, array('value' => $CFG_GLPI["use_autoname_by_entity"])); echo " " . __('Restrict printer management') . ""; $this->dropdownGlobalManagement("printers_management_restrict", $CFG_GLPI["printers_management_restrict"]); echo "
"; if (Session::haveRight("transfer","w") && Session::isMultiEntitiesMode()) { echo "
"; echo ""; echo ""; echo ""; echo "
" . __('Automatic transfer of computers') . "
" . __('Template for the automatic transfer of computers in another entity') . ""; Transfer::dropdown(array('value' => $CFG_GLPI["transfers_id_auto"], 'name' => "transfers_id_auto", 'emptylabel' => __('No automatic transfer'))); echo "
"; } echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $fields = array("contact", "group", "location", "user"); echo ""; echo ""; $values[0] = __('Do not copy'); $values[1] = __('Copy'); foreach ($fields as $field) { echo ""; } echo ""; echo ""; echo ""; $values[0] = __('Do not delete'); $values[1] = __('Clear'); foreach ($fields as $field) { echo ""; } echo ""; echo ""; echo ""; echo "
".__('Automatically update of the elements related to the computers'); echo "".__('Unit management')."
 " . __('Alternate username') . "" . __('User') . "" . __('Group') . "" . __('Location') . "" . __('Status') . "
" . __('When connecting or updating') . ""; $fieldname = "is_".$field."_autoupdate"; Dropdown::showFromArray($fieldname, $values, array('value' => $CFG_GLPI[$fieldname])); echo ""; State::dropdownBehaviour("state_autoupdate_mode", __('Copy computer status'), $CFG_GLPI["state_autoupdate_mode"]); echo "
" . __('When disconnecting') . ""; $fieldname = "is_".$field."_autoclean"; Dropdown::showFromArray($fieldname, $values, array('value' => $CFG_GLPI[$fieldname])); echo ""; State::dropdownBehaviour("state_autoclean_mode", __('Clear status'), $CFG_GLPI["state_autoclean_mode"]); echo "
"; echo ""; echo "
"; Html::closeForm(); } /** * Print the config form for restrictions * * @return Nothing (display) **/ function showFormAuthentication() { global $DB, $CFG_GLPI; if (!Session::haveRight("config", "w")) { return false; } echo ""; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
" . __('Authentication') . "
". __('Automatically add users from an external authentication source').""; Dropdown::showYesNo("is_users_auto_add", $CFG_GLPI["is_users_auto_add"]); echo "". __('Add a user without accreditation from a LDAP directory').""; Dropdown::showYesNo("use_noright_users_add", $CFG_GLPI["use_noright_users_add"]); echo "
" . __('Action when a user is deleted from the LDAP directory') . ""; AuthLDap::dropdownUserDeletedActions($CFG_GLPI["user_deleted_ldap"]); echo " " . __('GLPI server time zone') . ""; Dropdown::showGMT("time_offset", $CFG_GLPI["time_offset"]); echo "
"; echo ""; echo "
"; Html::closeForm(); } /** * Print the config form for slave DB * * @return Nothing (display) **/ function showFormDBSlave() { global $DB, $CFG_GLPI, $DBslave; if (!Session::haveRight("config", "w")) { return false; } echo ""; echo "
"; echo ""; echo ""; echo ""; $active = DBConnection::isDBSlaveActive(); echo ""; $DBslave = DBConnection::getDBSlaveConf(); if (is_array($DBslave->dbhost)) { $host = implode(' ', $DBslave->dbhost); } else { $host = $DBslave->dbhost; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if ($DBslave->connected && !$DB->isSlave()) { echo ""; } echo ""; echo "
" . _n('Mysql replica', 'Mysql replicas',2) . "
" . __('Mysql server') . "" . __('Database') . ""; echo "
" . __('Mysql user') . "" . __('Mysql password') . ""; echo "
" . __('Use the slave for the search engine') . ""; $values = array(0 => __('Never'), 1 => __('If synced (all changes)'), 2 => __('If synced (current user changes)'), 3 => __('If synced or read-only account'), 4 => __('Always')); Dropdown::showFromArray('use_slave_for_search', $values, array('value' => $CFG_GLPI["use_slave_for_search"])); echo " 
"; DBConnection::showAllReplicateDelay(); echo "
"; echo ""; echo "
"; Html::closeForm(); } /** * Print the config form for connections * * @return Nothing (display) **/ function showFormHelpdesk() { global $DB, $CFG_GLPI; if (!Session::haveRight("config", "w")) { return false; } echo ""; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
" . __('Assistance') . "
" . __('Step for the hours (minutes)') . ""; Dropdown::showInteger('time_step', $CFG_GLPI["time_step"], 30, 60, 30, array(1 => 1, 5 => 5, 10 => 10, 15 => 15, 20 => 20)); echo "" .__('Limit of the schedules for planning') . ""; Dropdown::showHours('planning_begin', $CFG_GLPI["planning_begin"]); echo " -> "; Dropdown::showHours('planning_end', $CFG_GLPI["planning_end"]); echo "
".__('Default file size limit imported by the mails receiver').""; MailCollector::showMaxFilesize('default_mailcollector_filesize_max', $CFG_GLPI["default_mailcollector_filesize_max"]); echo "  
" . __('Default heading when adding a document to a ticket') . ""; DocumentCategory::dropdown(array('value' => $CFG_GLPI["documentcategories_id_forticket"], 'name' => "documentcategories_id_forticket")); echo "" . __('By default, a software may be linked to a ticket') . ""; Dropdown::showYesNo("default_software_helpdesk_visible", $CFG_GLPI["default_software_helpdesk_visible"]); echo "
" . __('Keep tickets when purging hardware in the inventory') . ""; Dropdown::showYesNo("keep_tickets_on_delete", $CFG_GLPI["keep_tickets_on_delete"]); echo "".__('Show personnal information in new ticket form (simplified interface)'); echo ""; Dropdown::showYesNo('use_check_pref', $CFG_GLPI['use_check_pref']); echo "
" .__('Allow anonymous ticket creation (helpdesk.receiver)') . ""; Dropdown::showYesNo("use_anonymous_helpdesk", $CFG_GLPI["use_anonymous_helpdesk"]); echo "" . __('Allow anonymous followups (receiver)') . ""; Dropdown::showYesNo("use_anonymous_followups", $CFG_GLPI["use_anonymous_followups"]); echo "
"; echo ""; echo ""; echo ""; echo ""; for ($impact=5 ; $impact>=1 ; $impact--) { echo ""; } echo ""; echo ""; echo ""; for ($impact=5 ; $impact>=1 ; $impact--) { echo ""; } echo ""; for ($urgency=5 ; $urgency>=1 ; $urgency--) { echo ""; echo ""; echo ""; for ($impact=5 ; $impact>=1 ; $impact--) { $pri = round(($urgency+$impact)/2); if (isset($CFG_GLPI['priority_matrix'][$urgency][$impact])) { $pri = $CFG_GLPI['priority_matrix'][$urgency][$impact]; } if ($isurgency[$urgency] && $isimpact[$impact]) { $bgcolor=$_SESSION["glpipriority_$pri"]; echo ""; } else { echo ""; } } echo "\n"; } echo ""; echo ""; echo "
" . __('Matrix of calculus for priority'); echo "
".__('Impact')."".Ticket::getImpactName($impact).' '; if ($impact==3) { $isimpact[3] = 1; echo ""; } else { $isimpact[$impact] = (($CFG_GLPI['impact_mask']&(1<<$impact)) >0); Dropdown::showYesNo("_impact_${impact}", $isimpact[$impact]); } echo "
".__('Urgency')." 
".Ticket::getUrgencyName($urgency)." "; if ($urgency==3) { $isurgency[3] = 1; echo ""; } else { $isurgency[$urgency] = (($CFG_GLPI['urgency_mask']&(1<<$urgency)) >0); Dropdown::showYesNo("_urgency_${urgency}", $isurgency[$urgency]); } echo ""; Ticket::dropdownPriority(array('value' => $pri, 'name' => "_matrix_${urgency}_${impact}")); echo "
"; echo ""; echo ""; echo "
"; Html::closeForm(); } /** * Print the config form for default user prefs * * @param $data array containing datas * (CFG_GLPI for global config / glpi_users fields for user prefs) * * @return Nothing (display) **/ function showFormUserPrefs($data=array()) { global $DB, $CFG_GLPI; $oncentral = ($_SESSION["glpiactiveprofile"]["interface"]=="central"); $userpref = false; $url = Toolbox::getItemTypeFormURL(__CLASS__); if (array_key_exists('last_login',$data)) { $userpref = true; if ($data["id"] === Session::getLoginUserID()) { $url = $CFG_GLPI['root_doc']."/front/preference.php"; } else { $url = $CFG_GLPI['root_doc']."/front/user.form.php"; } } echo ""; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $values = array(0 => '1 234.56', 1 => '1,234.56', 2 => '1 234,56'); echo ""; echo ""; if ($oncentral) { echo ""; } else { echo ""; } echo ""; echo ""; if ($oncentral) { echo ""; } else { echo ""; } if (!$userpref || ($CFG_GLPI['show_count_on_tabs'] != -1)) { echo ""; } else { echo ""; } echo ""; echo ""; if ($oncentral) { echo ""; } else { echo ""; } echo ""; echo ""; echo ""; if ($oncentral) { echo ""; } else { echo ""; } echo ""; if ($oncentral) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "". ""; echo ""; echo ""; } // Only for user if (array_key_exists('personal_token', $data)) { echo ""; echo ""; } echo ""; echo "". ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "". ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
" . __('Personalization') . "
" . ($userpref?__('Language'):__('Default language')) . ""; if (Session::haveRight("config","w") || !GLPI_DEMO_MODE) { Dropdown::showLanguages("language", array('value' => $data["language"])); } else { echo " "; } echo "" . __('Date format') .""; $date_formats = array(0 => __('YYYY-MM-DD'), 1 => __('DD-MM-YYYY'), 2 => __('MM-DD-YYYY')); Dropdown::showFromArray('date_format', $date_formats, array('value' => $data["date_format"])); echo "
" . __('Results to display by page').""; // Limit using global config Dropdown::showInteger('list_limit', (($data['list_limit'] < $CFG_GLPI['list_limit_max']) ? $data['list_limit'] : $CFG_GLPI['list_limit_max']), 5, $CFG_GLPI['list_limit_max'], 5); echo "" .__('Number format') . ""; Dropdown::showFromArray('number_format', $values, array('value' => $data["number_format"])); echo "
" . __('Default characters limit in dropdowns') . ""; Dropdown::showInteger('dropdown_chars_limit', $data["dropdown_chars_limit"], 20, 100); echo " ".__('Display order of surnames firstnames').""; $values = array(User::REALNAME_BEFORE => __('Surname, First name'), User::FIRSTNAME_BEFORE => __('First name, Surname')); Dropdown::showFromArray('names_format', $values, array('value' => $data["names_format"])); echo "
" . __('Display the complete name in tree dropdowns') . ""; Dropdown::showYesNo('use_flat_dropdowntree', $data["use_flat_dropdowntree"]); echo " ".__('Display counts in tabs').""; $values = array(0 => __('No'), 1 => __('Yes')); if (!$userpref) { $values[-1] = __('Never'); } Dropdown::showFromArray('show_count_on_tabs', $values, array('value' => $data["show_count_on_tabs"])); echo " 
" . __('Show GLPI ID') . ""; Dropdown::showYesNo("is_ids_visible", $data["is_ids_visible"]); echo "".__('CSV delimiter').""; $values = array(';' => ';', ',' => ','); Dropdown::showFromArray('csv_delimiter', $values, array('value' => $data["csv_delimiter"])); echo "
" . __('Notifications for my changes') . ""; Dropdown::showYesNo("notification_to_myself", $data["notification_to_myself"]); echo "".__('Results to display on home page').""; Dropdown::showInteger('display_count_on_home', $data['display_count_on_home'], 0, 30); echo " 
".__('Assistance')."
".__('Private followups by default').""; Dropdown::showYesNo("followup_private", $data["followup_private"]); echo " " . __('Show new tickets on the home page') . ""; Dropdown::showYesNo("show_jobs_at_login", $data["show_jobs_at_login"]); echo "
" . __('Private tasks by default') . ""; Dropdown::showYesNo("task_private", $data["task_private"]); echo " " . __('Request sources by default') . ""; RequestType::dropdown(array('value' => $data["default_requesttypes_id"], 'name' => "default_requesttypes_id")); echo "
".__('Pre-select me as a technician when creating a ticket'). ""; if (!$userpref || Session::haveRight('own_ticket', 1)) { Dropdown::showYesNo("set_default_tech", $data["set_default_tech"]); } else { echo Dropdown::getYesNo(0); } echo "" . __('Automatically refresh the list of tickets (minutes)') . ""; Dropdown::showInteger('refresh_ticket_list', $data["refresh_ticket_list"], 1, 30, 1, array(0 => __('Never'))); echo "
" . __('Priority colors') . ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
1 "; echo "2 "; echo "3 "; echo "4 "; echo "5 "; echo "6 "; echo "
"; echo "
". _n('Software category','Software categories', 2) ."
" . __('Unfold the software belonging to a category').""; Dropdown::showYesNo("is_categorized_soft_expanded", $data["is_categorized_soft_expanded"]); echo "" . __('Unfold the software without category') . ""; Dropdown::showYesNo("is_not_categorized_soft_expanded", $data["is_not_categorized_soft_expanded"]); echo "
". __('Remote access key') ."
" . __('Remote access key'); if (!empty($data["personal_token"])) { //TRANS: %s is the generation date echo "
".sprintf(__('generated on %s'), Html::convDateTime($data["personal_token_date"])); } echo "
"; echo " ".__('Regenerate'); echo "
".__('Due date progression')."
".__('OK state color').""; echo ""; echo " 
".__('Warning state color').""; echo ""; echo "".__('Warning state threshold').""; Dropdown::showNumber("duedatewarning_less", array('value' => $data['duedatewarning_less'])); $elements = array('%' => '%', 'hours' => _n('Hour', 'Hours', 2), 'days' => _n('Day', 'Days', 2)); echo " "; Dropdown::showFromArray("duedatewarning_unit", $elements, array('value' => $data['duedatewarning_unit'])); echo "
".__('Critical state color').""; echo ""; echo "".__('Critical state threshold').""; Dropdown::showNumber("duedatecritical_less", array('value' => $data['duedatecritical_less'])); echo " "; $elements = array('%' => '%', 'hours' => _n('Hour', 'Hours', 2), 'days' => _n('Day', 'Days', 2)); Dropdown::showFromArray("duedatecritical_unit", $elements, array('value' => $data['duedatecritical_unit'])); echo "
"; echo ""; echo "
"; Html::closeForm(); } /** * Display security checks on password * * @param $field string id of the field containing password to check (default 'password') * * @since version 0.84 **/ static function displayPasswordSecurityChecks($field='password') { global $CFG_GLPI; printf(__('%1$s: %2$s'), __('Password minimum length'), "".$CFG_GLPI['password_min_length']. ""); echo "'; if (count($needs)) { echo "
"; printf(__('%1$s: %2$s'), __('Password must contains'), implode(', ',$needs)); } } /** * Validate password based on security rules * * @since version 0.84 * * @param $password string password to validate * @param $display boolean display errors messages? (true by default) * * @return boolean is password valid? **/ static function validatePassword($password, $display=true) { global $CFG_GLPI; $ok = true; if ($CFG_GLPI["use_password_security"]) { if (Toolbox::strlen($password) < $CFG_GLPI['password_min_length']) { $ok = false; if ($display) { Session::addMessageAfterRedirect(__('Password too short!'), false, ERROR); } } if ($CFG_GLPI["password_need_number"] && !preg_match("/[0-9]+/", $password)) { $ok = false; if ($display) { Session::addMessageAfterRedirect(__('Password must include at least a digit!'), false, ERROR); } } if ($CFG_GLPI["password_need_letter"] && !preg_match("/[a-z]+/", $password)) { $ok = false; if ($display) { Session::addMessageAfterRedirect(__('Password must include at least a lowercase letter!'), false, ERROR); } } if ($CFG_GLPI["password_need_caps"] && !preg_match("/[A-Z]+/", $password)) { $ok = false; if ($display) { Session::addMessageAfterRedirect(__('Password must include at least a uppercase letter!'), false, ERROR); } } if ($CFG_GLPI["password_need_symbol"] && !preg_match("/\W+/", $password)) { $ok = false; if ($display) { Session::addMessageAfterRedirect(__('Password must include at least a symbol!'), false, ERROR); } } } return $ok; } /** * Display a HTML report about systeme information / configuration **/ function showSystemInformations() { global $DB, $CFG_GLPI; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; //TRANS: Proxy port echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
" . __('General setup') . "
" . __('Log Level') . ""; $values[1] = __('1- Critical (login error only)'); $values[2] = __('2- Severe (not used)'); $values[3] = __('3- Important (successful logins)'); $values[4] = __('4- Notices (add, delete, tracking)'); $values[5] = __('5- Complete (all)'); Dropdown::showFromArray('event_loglevel', $values, array('value' => $CFG_GLPI["event_loglevel"])); echo "".__('Maximal number of automatic actions (run by CLI)').""; Dropdown::showInteger('cron_limit', $CFG_GLPI["cron_limit"], 1, 30); echo "
" . __('Logs in files (SQL, email, automatic action...)') . ""; Dropdown::showYesNo("use_log_in_files", $CFG_GLPI["use_log_in_files"]); echo " " . _n('Mysql replica', 'Mysql replicas', 1) . ""; $active = DBConnection::isDBSlaveActive(); Dropdown::showYesNo("_dbslave_status", $active); echo "
".__('Password security policy'); echo "
" . __('Password security policy validation') . ""; Dropdown::showYesNo("use_password_security", $CFG_GLPI["use_password_security"]); echo "" . __('Password minimum length') . ""; Dropdown::showInteger('password_min_length', $CFG_GLPI["password_min_length"], 4, 30); echo "
" . __('Password need digit') . ""; Dropdown::showYesNo("password_need_number", $CFG_GLPI["password_need_number"]); echo "" . __('Password need lowercase character') . ""; Dropdown::showYesNo("password_need_letter", $CFG_GLPI["password_need_letter"]); echo "
" . __('Password need uppercase character') . ""; Dropdown::showYesNo("password_need_caps", $CFG_GLPI["password_need_caps"]); echo "" . __('Password need symbol') . ""; Dropdown::showYesNo("password_need_symbol", $CFG_GLPI["password_need_symbol"]); echo "
".__('Proxy configuration for upgrade check'); echo "
" . __('Server') . "" . __('Port') . "
" . __('Login') . "" . __('Password') . ""; echo "
".__('Clear'); echo "
"; echo ""; echo "
"; Html::closeForm(); $width = 128; echo ""; echo ""; $oldlang = $_SESSION['glpilanguage']; // Keep this, for some function call which still use translation (ex showAllReplicateDelay) Session::loadLanguage('en_GB'); // No need to translate, this part always display in english (for copy/paste to forum) echo ""; echo "\n"; echo ""; self::showLibrariesInformation(); foreach ($CFG_GLPI["systeminformations_types"] as $type) { $tmp = new $type(); $tmp->showSystemInformations($width); } Session::loadLanguage($oldlang); echo ""; echo "\n"; echo "
". __('Information about system installation and configuration')."
[code]\n \n";
      echo "GLPI ".$CFG_GLPI['version']." (".$CFG_GLPI['root_doc']." => ".
            dirname(dirname($_SERVER["SCRIPT_FILENAME"])).")\n";
      echo "\n
Server
\n \n";
      echo wordwrap("Operating system: ".php_uname()."\n", $width, "\n\t");
      $exts = get_loaded_extensions();
      sort($exts);
      echo wordwrap("PHP ".phpversion().' '.php_sapi_name()." (".implode(', ',$exts).")\n",
                    $width, "\n\t");
      $msg = "Setup: ";

      foreach (array('max_execution_time', 'memory_limit', 'post_max_size', 'safe_mode',
                     'session.save_handler', 'upload_max_filesize') as $key) {
         $msg .= $key.'="'.ini_get($key).'" ';
      }
      echo wordwrap($msg."\n", $width, "\n\t");

      $msg = 'Software: ';
      if (isset($_SERVER["SERVER_SOFTWARE"])) {
         $msg .= $_SERVER["SERVER_SOFTWARE"];
      }
      if (isset($_SERVER["SERVER_SIGNATURE"])) {
         $msg .= ' ('.Html::clean($_SERVER["SERVER_SIGNATURE"]).')';
      }
      echo wordwrap($msg."\n", $width, "\n\t");

      if (isset($_SERVER["HTTP_USER_AGENT"])) {
         echo "\t" . $_SERVER["HTTP_USER_AGENT"] . "\n";
      }

      echo "DBMS:\t";
      foreach ($DB->getInfo() as $key => $val) {
         echo "$key: $val\n\t";
      }
      echo "\n";

      self::checkWriteAccessToDirs(true);

      echo "\n
[/code]\n
". __('To copy/paste in your support request')."
\n"; } /** * show Libraries information in system information * * @since version 0.84 **/ static function showLibrariesInformation() { // No gettext echo "Libraries\n"; echo "
\n \n";

      include_once(GLPI_HTMLAWED);
      echo "htmLawed version " . hl_version() . " in (" . realpath(dirname(GLPI_HTMLAWED)) . ")\n";

      include (GLPI_PHPCAS);
      echo "phpCas version " . phpCAS::getVersion() . " in (" .
            (dirname(GLPI_PHPCAS) ? realpath(dirname(GLPI_PHPCAS)) : "system") . ")\n";

      require_once(GLPI_PHPMAILER_DIR . "/class.phpmailer.php");
      $pm = new PHPMailer();
      echo "PHPMailer version " . $pm->Version . " in (" . realpath(GLPI_PHPMAILER_DIR) . ")\n";

      // EZ component
      echo "eZ Graph componnent installed :  ".(class_exists('ezcGraph')?'OK':'KO'). "\n";

      // Zend
      $zv = new Zend\Version\Version;
      echo "Zend Framework version " . $zv::VERSION . " in (" . realpath(GLPI_ZEND_PATH) . ")\n";

      // SimplePie :
      $sp = new SimplePie();
      echo "SimplePie version " . SIMPLEPIE_VERSION . " in (" . realpath(GLPI_SIMPLEPIE_PATH) . ")\n";

      echo "\n
"; } /** * Dropdown for global management config * * @param $name select name * @param $value default value **/ static function dropdownGlobalManagement($name, $value) { $choices[0] = __('Yes - Restrict to unit management for manual add'); $choices[1] = __('Yes - Restrict to global management for manual add'); $choices[2] = __('No'); Dropdown::showFromArray($name,$choices,array('value'=>$value)); } /** * Get language in GLPI associated with the value coming from LDAP * Value can be, for example : English, en_EN or en * * @param $lang : the value coming from LDAP * * @return the locale's php page in GLPI or '' is no language associated with the value **/ static function getLanguage($lang) { global $CFG_GLPI; // Search in order : ID or extjs dico or tinymce dico / native lang / english name // / extjs dico / tinymce dico // ID or extjs dico or tinymce dico foreach ($CFG_GLPI["languages"] as $ID => $language) { if ((strcasecmp($lang,$ID) == 0) || (strcasecmp($lang,$language[2]) == 0) || (strcasecmp($lang,$language[3]) == 0)) { return $ID; } } // native lang foreach ($CFG_GLPI["languages"] as $ID => $language) { if (strcasecmp($lang,$language[0]) == 0) { return $ID; } } // english lang name foreach ($CFG_GLPI["languages"] as $ID => $language) { if (strcasecmp($lang,$language[4]) == 0) { return $ID; } } return ""; } static function detectRootDoc() { global $CFG_GLPI; if (!isset($CFG_GLPI["root_doc"])) { if (!isset($_SERVER['REQUEST_URI']) ) { $_SERVER['REQUEST_URI'] = $_SERVER['PHP_SELF']; } $currentdir = getcwd(); chdir(GLPI_ROOT); $glpidir = str_replace(str_replace('\\', '/',getcwd()), "", str_replace('\\', '/',$currentdir)); chdir($currentdir); $globaldir = Html::cleanParametersURL($_SERVER['REQUEST_URI']); $globaldir = preg_replace("/\/[0-9a-zA-Z\.\-\_]+\.php/","",$globaldir); $CFG_GLPI["root_doc"] = str_replace($glpidir,"",$globaldir); $CFG_GLPI["root_doc"] = preg_replace("/\/$/","",$CFG_GLPI["root_doc"]); // urldecode for space redirect to encoded URL : change entity $CFG_GLPI["root_doc"] = urldecode($CFG_GLPI["root_doc"]); } } /** * Display debug information for dbslave **/ function showDebug() { $options['diff'] = 0; $options['name'] = ''; NotificationEvent::debugEvent(new DBConnection(), $options); } /** * Display field unicity criterias form **/ function showFormFieldUnicity() { global $CFG_GLPI; $unicity = new FieldUnicity(); $unicity->showForm($CFG_GLPI["id"], -1); } /** * @see CommonGLPI::getTabNameForItem() **/ function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { switch ($item->getType()) { case 'Preference' : return __('Personalization'); case 'User' : if (Session::haveRight('user','w') && $item->currentUserHaveMoreRightThan($item->getID())) { return __('Settings'); } break; case __CLASS__ : $tabs[1] = __('General setup'); // Display $tabs[2] = __('Default values'); // Prefs $tabs[3] = __('Assets'); $tabs[4] = __('Assistance'); $tabs[5] = __('System'); if (DBConnection::isDBSlaveActive()) { $tabs[6] = _n('Mysql replica', 'Mysql replicas', 2); // Slave } return $tabs; } return ''; } /** * @param $item CommonGLPI object * @param $tabnum (default 1) * @param $withtemplate (default 0) **/ static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { global $CFG_GLPI; if ($item->getType() == 'Preference') { $config = new self(); $user = new User(); if ($user->getFromDB(Session::getLoginUserID())) { $user->computePreferences(); $config->showFormUserPrefs($user->fields); } } else if ($item->getType() == 'User') { $config = new self(); $item->computePreferences(); $config->showFormUserPrefs($item->fields); } else if ($item->getType() == __CLASS__) { switch ($tabnum) { case 1 : $item->showFormDisplay(); break; case 2 : $item->showFormUserPrefs($CFG_GLPI); break; case 3 : $item->showFormInventory(); break; case 4 : $item->showFormHelpdesk(); break; case 5 : $item->showSystemInformations(); break; case 6 : $item->showFormDBSlave(); break; } } return true; } /** * Check Write Access to needed directories * * @param $fordebug boolean display for debug (no html, no gettext required) (false by default) * * @return 2 : creation error 1 : delete error 0: OK **/ static function checkWriteAccessToDirs($fordebug=false) { global $CFG_GLPI; $dir_to_check = array(GLPI_CONFIG_DIR => __('Checking write permissions for setting files'), GLPI_DOC_DIR => __('Checking write permissions for document files'), GLPI_DUMP_DIR => __('Checking write permissions for dump files'), GLPI_SESSION_DIR => __('Checking write permissions for session files'), GLPI_CRON_DIR => __('Checking write permissions for automatic actions files'), GLPI_CACHE_DIR => __('Checking write permissions for cache files'), GLPI_GRAPH_DIR => __('Checking write permissions for graphic files'), GLPI_LOCK_DIR => __('Checking write permissions for lock files'), GLPI_PLUGIN_DOC_DIR => __('Checking write permissions for plugins document files'), GLPI_TMP_DIR => __('Checking write permissions for temporary files'), GLPI_RSS_DIR => __('Checking write permissions for rss files'), GLPI_UPLOAD_DIR => __('Checking write permissions for upload files')); $error = 0; foreach ($dir_to_check as $dir => $message) { if (!$fordebug) { echo "".$message.""; } $tmperror = Toolbox::testWriteAccessToDirectory($dir); $errors = array(4 => __('The directory could not be created.'), 3 => __('The directory was created but could not be removed.'), 2 => __('The file could not be created.'), 1 => __("The file was created but can't be deleted.")); if ($tmperror > 0) { if ($fordebug) { echo " ". sprintf(__('Check permissions to the directory: %s'), $dir). " ".$errors[$tmperror]."\n"; } else { echo "

". $errors[$tmperror]."

". sprintf(__('Check permissions to the directory: %s'), $dir). "'"; } $error = 2; } else { if ($fordebug) { echo "$dir : OK\n"; } else { echo "\"".". ""; } } } // Only write test for GLPI_LOG as SElinux prevent removing log file. if (!$fordebug) { echo "". __('Checking write permissions for log files').""; } if (error_log("Test\n", 3, GLPI_LOG_DIR."/php-errors.log")) { if ($fordebug) { echo "".GLPI_LOG_DIR." : OK\n"; } else { echo "\""."; } } else { if ($fordebug) { echo "". sprintf(__('Check permissions to the directory: %s'), GLPI_LOG_DIR)."\n"; } else { echo "". "

".__('The file could not be created.')."

". sprintf(__('Check permissions to the directory: %s'), GLPI_LOG_DIR).""; } $error = 1; } return $error; } } ?> glpi-0.84.3+dfsg.1/inc/consumable.class.php000066400000000000000000000527021226600447100203450ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } //! Consumable Class /** This class is used to manage the consumables. @see ConsumableItem @author Julien Dombre **/ class Consumable extends CommonDBChild { // From CommonDBTM static protected $forward_entity_to = array('Infocom'); var $no_form_page = true; // From CommonDBChild static public $itemtype = 'ConsumableItem'; static public $items_id = 'consumableitems_id'; /** * @since version 0.84 **/ function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } static function getTypeName($nb=0) { return _n('Consumable', 'Consumables', $nb); } static function getNameField() { return 'id'; } static function canCreate() { return Session::haveRight('consumable', 'w'); } static function canView() { return Session::haveRight('consumable', 'r'); } function cleanDBonPurge() { global $DB; $query = "DELETE FROM `glpi_infocoms` WHERE (`items_id` = '".$this->fields['id']."' AND `itemtype` = '".$this->getType()."')"; $result = $DB->query($query); } function prepareInputForAdd($input) { $item = new ConsumableItem(); if ($item->getFromDB($input["consumableitems_id"])) { return array("consumableitems_id" => $item->fields["id"], "entities_id" => $item->getEntityID(), "date_in" => date("Y-m-d")); } return array(); } function post_addItem() { Infocom::cloneItem('ConsumableItem', $this->fields["consumableitems_id"], $this->fields['id'], $this->getType()); } /** * @see CommonDBTM::restore() **/ function restore(array $input, $history=1) { global $DB; $query = "UPDATE `".$this->getTable()."` SET `date_out` = NULL WHERE `id` = '".$input["id"]."'"; if ($result = $DB->query($query)) { return true; } return false; } /** * @since version 0.84 * * @see CommonDBTM::getPreAdditionalInfosForName **/ function getPreAdditionalInfosForName() { $ci = new ConsumableItem(); if ($ci->getFromDB($this->fields['consumableitems_id'])) { return $ci->getName(); } return ''; } /** * UnLink a consumable linked to a printer * * UnLink the consumable identified by $ID * * @param $ID consumable identifier * @param $itemtype itemtype of who we give the consumable (default '') * @param $items_id ID of the item giving the consumable (default 0) * * @return boolean **/ function out($ID, $itemtype='', $items_id=0) { global $DB; if (!empty($itemtype) && ($items_id > 0)) { $query = "UPDATE `".$this->getTable()."` SET `date_out` = '".date("Y-m-d")."', `itemtype` = '$itemtype', `items_id` = '$items_id' WHERE `id` = '$ID'"; if ($result = $DB->query($query)) { return true; } } return false; } /** * @since version 0.84 * * @see CommonDBTM::showSpecificMassiveActionsParameters() **/ function showSpecificMassiveActionsParameters($input=array()) { global $CFG_GLPI; switch ($input['action']) { case "give" : if (isset($input["entities_id"])) { Dropdown::showAllItems("give_items_id", 0, 0,$input["entities_id"], $CFG_GLPI["consumables_types"], false, false, 'give_itemtype'); echo "

"; return true; } default : return parent::showSpecificMassiveActionsParameters($input); } return false; } /** * @since version 0.84 * * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); // print_r($input);exit(); switch ($input['action']) { case "give" : if (($input["give_items_id"] > 0) && !empty($input['give_itemtype'])) { foreach ($input["item"] as $key => $val) { if ($val == 1) { if ($this->can($key,'w')) { if ($this->out($key, $input['give_itemtype'],$input["give_items_id"])) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } } if ($item = getItemForItemtype($input['give_itemtype'])) { Event::log($input["consumableitems_id"], "consumables", 5, "inventory", //TRANS: %s is the user login sprintf(__('%s gives a consumable'), $_SESSION["glpiname"])); } } else { $res['ko']++; } break; default : return parent::doSpecificMassiveActions($input); } return $res; } /** * count how many consumable for the consumable item $tID * * @param $tID integer consumable item identifier. * * @return integer : number of consumable counted. **/ static function getTotalNumber($tID) { global $DB; $query = "SELECT `id` FROM `glpi_consumables` WHERE `consumableitems_id` = '$tID'"; $result = $DB->query($query); return $DB->numrows($result); } /** * count how many old consumable for the consumable item $tID * * @param $tID integer consumable item identifier. * * @return integer : number of old consumable counted. **/ static function getOldNumber($tID) { global $DB; $query = "SELECT `id` FROM `glpi_consumables` WHERE (`consumableitems_id` = '$tID' AND `date_out` IS NOT NULL)"; $result = $DB->query($query); return $DB->numrows($result); } /** * count how many consumable unused for the consumable item $tID * * @param $tID integer consumable item identifier. * * @return integer : number of consumable unused counted. **/ static function getUnusedNumber($tID) { global $DB; $query = "SELECT `id` FROM `glpi_consumables` WHERE (`consumableitems_id` = '$tID' AND `date_out` IS NULL)"; $result = $DB->query($query); return $DB->numrows($result); } /** * Get the consumable count HTML array for a defined consumable type * * @param $tID integer consumable item identifier. * @param $alarm_threshold integer threshold alarm value. * @param $nohtml integer Return value without HTML tags. (default 0) * * @return string to display **/ static function getCount($tID, $alarm_threshold, $nohtml=0) { // Get total $total = self::getTotalNumber($tID); if ($total != 0) { $unused = self::getUnusedNumber($tID); $old = self::getOldNumber($tID); $highlight = ""; if ($unused <= $alarm_threshold) { $highlight = "class='tab_bg_1_2'"; } //TRANS: For consumable. %1$d is total number, %2$d is unused number, %3$d is old number $tmptxt = sprintf(__('Total: %1$d, New: %2$d, Used: %3$d'), $total, $unused, $old); if ($nohtml) { $out = $tmptxt; } else { $out = "
".$tmptxt."
"; } } return $out; } /** * Check if a Consumable is New (not used, in stock) * * @param $cID integer consumable ID. **/ static function isNew($cID) { global $DB; $query = "SELECT `id` FROM `glpi_consumables` WHERE (`id` = '$cID' AND `date_out` IS NULL)"; $result = $DB->query($query); return ($DB->numrows($result) == 1); } /** * Check if a consumable is Old (used, not in stock) * * @param $cID integer consumable ID. **/ static function isOld($cID) { global $DB; $query = "SELECT `id` FROM `glpi_consumables` WHERE (`id` = '$cID' AND `date_out` IS NOT NULL)"; $result = $DB->query($query); return ($DB->numrows($result) == 1); } /** * Get the localized string for the status of a consumable * * @param $cID integer consumable ID. * * @return string : dict value for the consumable status. **/ static function getStatus($cID) { if (self::isNew($cID)) { return _nx('consumable', 'New', 'New',1); } else if (self::isOld($cID)) { return _nx('consumable', 'Used', 'Used',1); } } /** * Print out a link to add directly a new consumable from a consumable item. * * @param $consitem ConsumableItem object * * @return Nothing (displays) **/ static function showAddForm(ConsumableItem $consitem) { global $CFG_GLPI; $ID = $consitem->getField('id'); if (!$consitem->can($ID,'w')) { return false; } if ($ID > 0) { echo "
"; echo ""; echo ""; echo ""; echo "
"; echo "\n"; Dropdown::showInteger('to_add', 1, 1, 100); echo " "; echo "
"; Html::closeForm(); echo "
"; } } /** * Print out the consumables of a defined type * * @param $consitem ConsumableItem object * @param $show_old boolean show old consumables or not. (default 0) * * @return Nothing (displays) **/ static function showForConsumableItem(ConsumableItem $consitem, $show_old=0) { global $DB, $CFG_GLPI; $tID = $consitem->getField('id'); if (!$consitem->can($tID,'r')) { return false; } $canedit = $consitem->can($tID,'w'); $rand = mt_rand(); $where = ""; if (!$show_old) { // NEW $where = " AND `date_out` IS NULL ORDER BY `date_in`, `id`"; } else { //OLD $where = " AND `date_out` IS NOT NULL ORDER BY `date_out` DESC, `date_in`, `id`"; } $query = "SELECT `glpi_consumables`.* FROM `glpi_consumables` WHERE `consumableitems_id` = '$tID' $where"; $result = $DB->query($query); $number = $DB->numrows($result); if ($canedit && $number) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $actions = array('delete' => _x('button', 'Delete permanently'), 'activate_infocoms' => __('Enable the financial and administrative information')); if ($show_old) { $actions['restore'] = __('Back to stock'); } else { $actions['give'] = _x('button', 'Give'); } $paramsma = array('num_displayed' => $number, 'specific_actions' => $actions, 'extraparams' => array('entities_id' => $consitem->getEntityID())); Html::showMassiveActions(__CLASS__, $paramsma); echo "\n"; } echo "
"; if (!$show_old) { echo ""; } else { // Old echo ""; } if ($number) { $i = 0; echo ""; if ($canedit) { echo ""; } echo ""; echo ""; echo ""; if ($show_old) { echo ""; echo ""; } echo ""; echo ""; } if ($result = $DB->query($query)) { $number = $DB->numrows($result); while ($data = $DB->fetch_assoc($result)) { $date_in = Html::convDate($data["date_in"]); $date_out = Html::convDate($data["date_out"]); echo ""; if ($canedit) { echo ""; } echo ""; echo ""; echo ""; if ($show_old) { echo ""; echo ""; } echo ""; echo ""; } } echo "
"; echo self::getCount($tID, -1); echo "
".__('Used consumables')."
"; Html::checkAllAsCheckbox('mass'.__CLASS__.$rand); echo "".__('ID').""._x('item', 'State')."".__('Add date')."".__('Use date')."".__('Given to')."".__('Financial and administrative information')."
"; Html::showMassiveActionCheckBox(__CLASS__, $data["id"]); echo "".$data["id"]."".self::getStatus($data["id"])."".$date_in."".$date_out.""; if ($item = getItemForItemtype($data['itemtype'])) { if ($item->getFromDB($data['items_id'])) { echo $item->getLink(); } } echo ""; Infocom::showDisplayLink('Consumable', $data["id"],1); echo "
"; if ($canedit && $number) { $paramsma['ontop'] = false; Html::showMassiveActions(__CLASS__, $paramsma); Html::closeForm(); } echo "
"; } /** * Show the usage summary of consumables by user **/ static function showSummary() { global $DB; if (!Session::haveRight("consumable","r")) { return false; } $query = "SELECT COUNT(*) AS count, `consumableitems_id`, `itemtype`, `items_id` FROM `glpi_consumables` WHERE `date_out` IS NOT NULL AND `consumableitems_id` IN (SELECT `id` FROM `glpi_consumableitems` ". getEntitiesRestrictRequest("WHERE", "glpi_consumableitems").") GROUP BY `itemtype`, `items_id`, `consumableitems_id`"; $used = array(); if ($result = $DB->query($query)) { if ($DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $used[$data['itemtype'].'####'.$data['items_id']][$data["consumableitems_id"]] = $data["count"]; } } } $query = "SELECT COUNT(*) AS count, `consumableitems_id` FROM `glpi_consumables` WHERE `date_out` IS NULL AND `consumableitems_id` IN (SELECT `id` FROM `glpi_consumableitems` ". getEntitiesRestrictRequest("WHERE", "glpi_consumableitems").") GROUP BY `consumableitems_id`"; $new = array(); if ($result = $DB->query($query)) { if ($DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $new[$data["consumableitems_id"]] = $data["count"]; } } } $types = array(); $query = "SELECT * FROM `glpi_consumableitems` ". getEntitiesRestrictRequest("WHERE","glpi_consumableitems"); if ($result = $DB->query($query)) { if ($DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $types[$data["id"]] = $data["name"]; } } } asort($types); $total = array(); if (count($types) > 0) { // Produce headline echo "
"; // Type echo ""; foreach ($types as $key => $type) { echo ""; $total[$key] = 0; } echo ""; echo ""; // new echo ""; $tot = 0; foreach ($types as $id_type => $type) { if (!isset($new[$id_type])) { $new[$id_type] = 0; } echo ""; $total[$id_type] += $new[$id_type]; $tot += $new[$id_type]; } echo ""; echo ""; foreach ($used as $itemtype_items_id => $val) { echo ""; $tot = 0; foreach ($types as $id_type => $type) { if (!isset($val[$id_type])) { $val[$id_type] = 0; } echo ""; $total[$id_type] += $val[$id_type]; $tot += $val[$id_type]; } echo ""; echo ""; } echo ""; $tot = 0; foreach ($types as $id_type => $type) { $tot += $total[$id_type]; echo ""; } echo ""; echo ""; echo "
".__('Give to')."$type".__('Total')."
".__('In stock')."".$new[$id_type]."".$tot."
"; list($itemtype,$items_id) = explode('####',$itemtype_items_id); $item = new $itemtype(); if ($item->getFromDB($items_id)) { //TRANS: %1$s is a type name - %2$s is a name printf(__('%1$s - %2$s'), $item->getTypeName(1), $item->getNameID()); } echo "".$val[$id_type]."".$tot."
".__('Total')."".$total[$id_type]."".$tot."
"; } else { echo "
".__('No consumable found')."
"; } } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate && Session::haveRight("consumable","r")) { switch ($item->getType()) { case 'ConsumableItem' : if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(self::getTypeName(2), self::countForConsumableItem($item)); } return self::getTypeName(2); } } return ''; } /** * @param $item string ConsumableItem object **/ static function countForConsumableItem(ConsumableItem $item) { $restrict = "`glpi_consumables`.`consumableitems_id` = '".$item->getField('id') ."'"; return countElementsInTable(array('glpi_consumables'), $restrict); } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($item->getType()) { case 'ConsumableItem' : self::showAddForm($item); self::showForConsumableItem($item); self::showForConsumableItem($item, 1); return true; } } } ?>glpi-0.84.3+dfsg.1/inc/consumableitem.class.php000066400000000000000000000342421226600447100212230ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } //! ConsumableItem Class /** * This class is used to manage the various types of consumables. * @see Consumable * @author Julien Dombre */ class ConsumableItem extends CommonDBTM { // From CommonDBTM static protected $forward_entity_to = array('Consumable', 'Infocom'); static function getTypeName($nb=0) { return _n('Consumable model', 'Consumable models', $nb); } static function canCreate() { return Session::haveRight('consumable', 'w'); } static function canView() { return Session::haveRight('consumable', 'r'); } /** * @since version 0.84 * * @see CommonDBTM::getPostAdditionalInfosForName **/ function getPostAdditionalInfosForName() { if (isset($this->fields["ref"]) && !empty($this->fields["ref"])) { return $this->fields["ref"]; } return ''; } function cleanDBonPurge() { $class = new Consumable(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); $class = new Alert(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); } function post_getEmpty() { $this->fields["alarm_threshold"] = Entity::getUsedConfig("consumables_alert_repeat", $this->fields["entities_id"], "default_consumables_alarm_threshold", 10); } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('Consumable', $ong, $options); $this->addStandardTab('Infocom', $ong, $options); $this->addStandardTab('Document_Item',$ong, $options); $this->addStandardTab('Link', $ong, $options); $this->addStandardTab('Note', $ong, $options); return $ong; } /** * Print the consumable type form * * @param $ID integer ID of the item * @param $options array * - target filename : where to go when done. * - withtemplate boolean : template or basic item * * @return Nothing (display) * **/ function showForm($ID, $options=array()) { global $CFG_GLPI; $this->initForm($ID, $options); $this->showTabs($options); $this->showFormHeader($options); echo ""; echo "".__('Name').""; echo ""; Html::autocompletionTextField($this, "name"); echo ""; echo "".__('Type').""; echo ""; ConsumableItemType::dropdown(array('value' => $this->fields["consumableitemtypes_id"])); echo ""; echo ""; echo "".__('Reference')."\n"; echo ""; Html::autocompletionTextField($this, "ref"); echo ""; echo "".__('Manufacturer').""; echo ""; Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"])); echo "\n"; echo ""; echo "".__('Technician in charge of the hardware').""; echo ""; User::dropdown(array('name' => 'users_id_tech', 'value' => $this->fields["users_id_tech"], 'right' => 'own_ticket', 'entity' => $this->fields["entities_id"])); echo ""; echo "".__('Comments').""; echo " "; echo ""; echo ""; echo "".__('Group in charge of the hardware').""; echo ""; Group::dropdown(array('name' => 'groups_id_tech', 'value' => $this->fields['groups_id_tech'], 'entity' => $this->fields['entities_id'], 'condition' => '`is_assign`')); echo "\n"; echo ""; echo "".__('Stock location').""; echo ""; Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"])); echo ""; echo ""; echo "".__('Alert threshold').""; echo ""; Dropdown::showInteger('alarm_threshold', $this->fields["alarm_threshold"], 0, 100, 1, array('-1' => __('Never'))); Alert::displayLastAlert('ConsumableItem', $ID); echo ""; $this->showFormButtons($options); $this->addDivForTabs(); return true; } /** * @see CommonDBTM::getSpecificMassiveActions() **/ function getSpecificMassiveActions($checkitem=NULL) { $isadmin = static::canUpdate(); $actions = parent::getSpecificMassiveActions($checkitem); if (Session::haveRight('transfer','r') && Session::isMultiEntitiesMode() && $isadmin) { $actions['add_transfer_list'] = _x('button', 'Add to transfer list'); } return $actions; } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['datatype'] = 'number'; $tab[2]['massiveaction'] = false; $tab[34]['table'] = $this->getTable(); $tab[34]['field'] = 'ref'; $tab[34]['name'] = __('Reference'); $tab[34]['datatype'] = 'string'; $tab[4]['table'] = 'glpi_consumableitemtypes'; $tab[4]['field'] = 'name'; $tab[4]['name'] = __('Type'); $tab[4]['datatype'] = 'dropdown'; $tab[23]['table'] = 'glpi_manufacturers'; $tab[23]['field'] = 'name'; $tab[23]['name'] = __('Manufacturer'); $tab[23]['datatype'] = 'dropdown'; $tab += Location::getSearchOptionsToAdd(); $tab[24]['table'] = 'glpi_users'; $tab[24]['field'] = 'name'; $tab[24]['linkfield'] = 'users_id_tech'; $tab[24]['name'] = __('Technician in charge of the hardware'); $tab[24]['datatype'] = 'dropdown'; $tab[24]['right'] = 'own_ticket'; $tab[49]['table'] = 'glpi_groups'; $tab[49]['field'] = 'completename'; $tab[49]['linkfield'] = 'groups_id_tech'; $tab[49]['name'] = __('Group in charge of the hardware'); $tab[49]['condition'] = '`is_assign`'; $tab[49]['datatype'] = 'dropdown'; $tab[8]['table'] = $this->getTable(); $tab[8]['field'] = 'alarm_threshold'; $tab[8]['name'] = __('Alert threshold'); $tab[8]['datatype'] = 'number'; $tab[8]['toadd'] = array('-1' => __('Never')); $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab[90]['table'] = $this->getTable(); $tab[90]['field'] = 'notepad'; $tab[90]['name'] = __('Notes'); $tab[90]['massiveaction'] = false; $tab[90]['datatype'] = 'text'; $tab[80]['table'] = 'glpi_entities'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = __('Entity'); $tab[80]['massiveaction'] = false; $tab[80]['datatype'] = 'dropdown'; return $tab; } static function cronInfo($name) { return array('description' => __('Send alarms on consumables')); } /** * Cron action on consumables : alert if a stock is behind the threshold * * @param $task to log, if NULL display (default NULL) * * @return 0 : nothing to do 1 : done with success **/ static function cronConsumable($task=NULL) { global $DB, $CFG_GLPI; $cron_status = 1; if ($CFG_GLPI["use_mailing"]) { $message = array(); $items = array(); $alert = new Alert(); foreach (Entity::getEntitiesToNotify('consumables_alert_repeat') as $entity => $repeat) { $query_alert = "SELECT `glpi_consumableitems`.`id` AS consID, `glpi_consumableitems`.`entities_id` AS entity, `glpi_consumableitems`.`ref` AS ref, `glpi_consumableitems`.`name` AS name, `glpi_consumableitems`.`alarm_threshold` AS threshold, `glpi_alerts`.`id` AS alertID, `glpi_alerts`.`date` FROM `glpi_consumableitems` LEFT JOIN `glpi_alerts` ON (`glpi_consumableitems`.`id` = `glpi_alerts`.`items_id` AND `glpi_alerts`.`itemtype`='ConsumableItem') WHERE `glpi_consumableitems`.`is_deleted` = '0' AND `glpi_consumableitems`.`alarm_threshold` >= '0' AND `glpi_consumableitems`.`entities_id` = '".$entity."' AND (`glpi_alerts`.`date` IS NULL OR (`glpi_alerts`.date+$repeat) < CURRENT_TIMESTAMP());"; $message = ""; $items = array(); foreach ($DB->request($query_alert) as $consumable) { if (($unused=Consumable::getUnusedNumber($consumable["consID"])) <=$consumable["threshold"]) { // define message alert //TRANS: %1$s is the consumable name, %2$s its reference, %3$d the remaining number $message .= sprintf(__('Threshold of alarm reached for the type of consumable: %1$s - Reference %2$s - Remaining %3$d'), $consumable['name'], $consumable['ref'], $unused); $message.='
'; $items[$consumable["consID"]] = $consumable; // if alert exists -> delete if (!empty($consumable["alertID"])) { $alert->delete(array("id" => $consumable["alertID"])); } } } if (!empty($items)) { $options['entities_id'] = $entity; $options['items'] = $items; if (NotificationEvent::raiseEvent('alert', new ConsumableItem(), $options)) { if ($task) { $task->log(Dropdown::getDropdownName("glpi_entities", $entity)." : $message\n"); $task->addVolume(1); } else { Session::addMessageAfterRedirect(Dropdown::getDropdownName("glpi_entities", $entity). " : $message"); } $input["type"] = Alert::THRESHOLD; $input["itemtype"] = 'ConsumableItem'; // add alerts foreach ($items as $ID=>$consumable) { $input["items_id"] = $ID; $alert->add($input); unset($alert->fields['id']); } } else { $entityname = Dropdown::getDropdownName('glpi_entities', $entity); //TRANS: %s is entity name $msg = sprintf(__('%s: send consumable alert failed'), $entityname); if ($task) { $task->log($msg); } else { Session::addMessageAfterRedirect($msg, false, ERROR); } } } } } return $cron_status; } function getEvents() { return array('alert' => __('Send alarms on consumables')); } /** * Display debug information for current object **/ function showDebug() { // see query_alert in cronConsumable() $item = array('consID' => $this->fields['id'], 'entity' => $this->fields['entities_id'], 'ref' => $this->fields['ref'], 'name' => $this->fields['name'], 'threshold' => $this->fields['alarm_threshold']); $options = array(); $options['entities_id'] = $this->getEntityID(); $options['items'] = array($item); NotificationEvent::debugEvent($this, $options); } } ?> glpi-0.84.3+dfsg.1/inc/consumableitemtype.class.php000066400000000000000000000026101226600447100221170ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class ConsumableItemType class ConsumableItemType extends CommonDropdown { static function getTypeName($nb=0) { return _n('Consumable type', 'Consumable types',$nb); } } ?> glpi-0.84.3+dfsg.1/inc/contact.class.php000066400000000000000000000341771226600447100176560ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Contact class **/ class Contact extends CommonDBTM{ // From CommonDBTM public $dohistory = true; static function getTypeName($nb=0) { return _n('Contact', 'Contacts', $nb); } static function canCreate() { return Session::haveRight('contact_enterprise', 'w'); } static function canView() { return Session::haveRight('contact_enterprise', 'r'); } function cleanDBonPurge() { $cs = new Contact_Supplier(); $cs->cleanDBonItemDelete($this->getType(), $this->fields['id']); } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('Contact_Supplier', $ong, $options); $this->addStandardTab('Document_Item', $ong, $options); $this->addStandardTab('Link', $ong, $options); $this->addStandardTab('Note', $ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } /** * Get address of the contact (company one) * *@return string containing the address **/ function GetAddress() { global $DB; $query = "SELECT `glpi_suppliers`.`name`, `glpi_suppliers`.`address`, `glpi_suppliers`.`postcode`, `glpi_suppliers`.`town`, `glpi_suppliers`.`state`, `glpi_suppliers`.`country` FROM `glpi_suppliers`, `glpi_contacts_suppliers` WHERE `glpi_contacts_suppliers`.`contacts_id` = '".$this->fields["id"]."' AND `glpi_contacts_suppliers`.`suppliers_id` = `glpi_suppliers`.`id`"; if ($result = $DB->query($query)) { if ($DB->numrows($result)) { if ($data = $DB->fetch_assoc($result)) { return $data; } } } return ""; } /** * Get website of the contact (company one) * *@return string containing the website **/ function GetWebsite() { global $DB; $query = "SELECT `glpi_suppliers`.`website` as website FROM `glpi_suppliers`, `glpi_contacts_suppliers` WHERE `glpi_contacts_suppliers`.`contacts_id` = '".$this->fields["id"]."' AND `glpi_contacts_suppliers`.`suppliers_id` = `glpi_suppliers`.`id`"; if ($result = $DB->query($query)) { if ($DB->numrows($result)) { return $DB->result($result, 0, "website"); } return ""; } } /** * Print the contact form * * @param $ID integer ID of the item * @param $options array * - target filename : where to go when done. * - withtemplate boolean : template or basic item * * @return Nothing (display) **/ function showForm($ID, $options=array()) { $this->initForm($ID, $options); $this->showTabs($options); $this->showFormHeader($options); echo ""; echo "".__('Surname').""; echo ""; Html::autocompletionTextField($this, "name"); echo ""; echo "".__('Comments').""; echo ""; echo ""; echo ""; echo ""; echo "".__('First name').""; echo ""; Html::autocompletionTextField($this, "firstname"); echo ""; echo ""; echo "". __('Phone').""; echo ""; Html::autocompletionTextField($this, "phone"); echo ""; echo ""; echo "". __('Phone 2').""; echo ""; Html::autocompletionTextField($this, "phone2"); echo ""; echo ""; echo "".__('Mobile phone').""; echo ""; Html::autocompletionTextField($this, "mobile"); echo ""; echo "".__('Address').""; echo ""; echo ""; echo ""; echo ""; echo "".__('Fax').""; echo ""; Html::autocompletionTextField($this, "fax"); echo ""; echo "".__('Postal code').""; echo ""; Html::autocompletionTextField($this, "postcode", array('size' => 10)); echo "  ". __('City'). " "; Html::autocompletionTextField($this, "town", array('size' => 23)); echo ""; echo ""; echo ""._n('Email', 'Emails', 1).""; echo ""; Html::autocompletionTextField($this, "email"); echo ""; echo "".__('State').""; echo ""; Html::autocompletionTextField($this, "state"); echo ""; echo ""; echo "".__('Type').""; echo ""; ContactType::dropdown(array('value' => $this->fields["contacttypes_id"])); echo ""; echo "".__('Country').""; echo ""; Html::autocompletionTextField($this, "country"); echo ""; echo "" . _x('person','Title') . ""; UserTitle::dropdown(array('value' => $this->fields["usertitles_id"])); echo " "; if ($ID > 0) { echo "".__('Vcard').""; } echo ""; $this->showFormButtons($options); $this->addDivForTabs(); return true; } /** * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "add_contact_supplier" : $contactsupplier = new Contact_Supplier(); return $contactsupplier->doSpecificMassiveActions($input); default : return parent::doSpecificMassiveActions($input); } return false; } /** * @see CommonDBTM::showSpecificMassiveActionsParameters() **/ function showSpecificMassiveActionsParameters($input=array()) { switch ($input['action']) { case "add_contact_supplier" : $contactsupplier = new Contact_Supplier(); return $contactsupplier->showSpecificMassiveActionsParameters($input); default : return parent::showSpecificMassiveActionsParameters($input); } return false; } /** * @see CommonDBTM::getSpecificMassiveActions() **/ function getSpecificMassiveActions($checkitem=NULL) { $isadmin = static::canUpdate(); $actions = parent::getSpecificMassiveActions($checkitem); if ($isadmin) { $actions['add_contact_supplier'] = _x('button', 'Add a supplier'); } if (Session::haveRight('transfer','r') && Session::isMultiEntitiesMode() && $isadmin) { $actions['add_transfer_list'] = _x('button', 'Add to transfer list'); } return $actions; } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Surname'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'firstname'; $tab[11]['name'] = __('First name'); $tab[11]['datatype'] = 'string'; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'phone'; $tab[3]['name'] = __('Phone'); $tab[3]['datatype'] = 'string'; $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'phone2'; $tab[4]['name'] = __('Phone 2'); $tab[4]['datatype'] = 'string'; $tab[10]['table'] = $this->getTable(); $tab[10]['field'] = 'mobile'; $tab[10]['name'] = __('Mobile phone'); $tab[10]['datatype'] = 'string'; $tab[5]['table'] = $this->getTable(); $tab[5]['field'] = 'fax'; $tab[5]['name'] = __('Fax'); $tab[5]['datatype'] = 'string'; $tab[6]['table'] = $this->getTable(); $tab[6]['field'] = 'email'; $tab[6]['name'] = _n('Email', 'Emails', 1); $tab[6]['datatype'] = 'email'; $tab[82]['table'] = $this->getTable(); $tab[82]['field'] = 'address'; $tab[82]['name'] = __('Address'); $tab[83]['datatype'] = 'text'; $tab[84]['table'] = $this->getTable(); $tab[84]['field'] = 'town'; $tab[84]['name'] = __('City'); $tab[84]['datatype'] = 'string'; $tab[83]['table'] = $this->getTable(); $tab[83]['field'] = 'postcode'; $tab[83]['name'] = __('Postal code'); $tab[83]['datatype'] = 'string'; $tab[85]['table'] = $this->getTable(); $tab[85]['field'] = 'state'; $tab[85]['name'] = __('State'); $tab[85]['datatype'] = 'string'; $tab[87]['table'] = $this->getTable(); $tab[87]['field'] = 'country'; $tab[87]['name'] = __('Country'); $tab[87]['datatype'] = 'string'; $tab[9]['table'] = 'glpi_contacttypes'; $tab[9]['field'] = 'name'; $tab[9]['name'] = __('Type'); $tab[9]['datatype'] = 'dropdown'; $tab[81]['table'] = 'glpi_usertitles'; $tab[81]['field'] = 'name'; $tab[81]['name'] = _x('person','Title'); $tab[81]['datatype'] = 'dropdown'; $tab[8]['table'] = 'glpi_suppliers'; $tab[8]['field'] = 'name'; $tab[8]['name'] = __('Associated suppliers'); $tab[8]['forcegroupby'] = true; $tab[8]['datatype'] = 'itemlink'; $tab[8]['joinparams'] = array('beforejoin' => array('table' => 'glpi_contacts_suppliers', 'joinparams' => array('jointype' => 'child'))); $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab[90]['table'] = $this->getTable(); $tab[90]['field'] = 'notepad'; $tab[90]['name'] = __('Notes'); $tab[90]['massiveaction'] = false; $tab[90]['datatype'] = 'text'; $tab[80]['table'] = 'glpi_entities'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = __('Entity'); $tab[80]['massiveaction'] = false; $tab[80]['datatype'] = 'dropdown'; $tab[86]['table'] = $this->getTable(); $tab[86]['field'] = 'is_recursive'; $tab[86]['name'] = __('Child entities'); $tab[86]['datatype'] = 'bool'; return $tab; } /** * Generate the Vcard for the current Contact * *@return Nothing (display) **/ function generateVcard() { include (GLPI_ROOT . "/lib/vcardclass/classes-vcard.php"); if (!$this->can($this->fields['id'],'r')) { return false; } // build the Vcard $vcard = new vCard(); $vcard->setName($this->fields["name"], $this->fields["firstname"], "", ""); $vcard->setPhoneNumber($this->fields["phone"], "PREF;WORK;VOICE"); $vcard->setPhoneNumber($this->fields["phone2"], "HOME;VOICE"); $vcard->setPhoneNumber($this->fields["mobile"], "WORK;CELL"); $addr = $this->GetAddress(); if (is_array($addr)) { $vcard->setAddress($addr["name"], "", $addr["address"], $addr["town"], $addr["state"], $addr["postcode"], $addr["country"], "WORK;POSTAL"); } $vcard->setEmail($this->fields["email"]); $vcard->setNote($this->fields["comment"]); $vcard->setURL($this->GetWebsite(), "WORK"); // send the VCard $output = $vcard->getVCard(); $filename = $vcard->getFileName(); // "xxx xxx.vcf" @Header("Content-Disposition: attachment; filename=\"$filename\""); @Header("Content-Length: ".Toolbox::strlen($output)); @Header("Connection: close"); @Header("content-type: text/x-vcard; charset=UTF-8"); echo $output; } } ?>glpi-0.84.3+dfsg.1/inc/contact_supplier.class.php000066400000000000000000000417541226600447100216000ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class Contact_Supplier extends CommonDBRelation{ // From CommonDBRelation static public $itemtype_1 = 'Contact'; static public $items_id_1 = 'contacts_id'; static public $itemtype_2 = 'Supplier'; static public $items_id_2 = 'suppliers_id'; static function getTypeName($nb=0) { return _n('Link Contact/Supplier','Links Contact/Supplier',$nb); } function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } /** * Get search function for the class * * @return array of search option **/ function getSearchOptions() { return parent::getSearchOptions(); } /** * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "add_contact_supplier" : $contactsupplier = new Contact_Supplier(); foreach ($input["item"] as $key => $val) { if (isset($input['contacts_id'])) { $input = array('suppliers_id' => $key, 'contacts_id' => $input['contacts_id']); } else if (isset($input['suppliers_id'])) { $input = array('suppliers_id' => $input['suppliers_id'], 'contacts_id' => $key); } else { return false; } if ($contactsupplier->can(-1, 'w', $input)) { if ($contactsupplier->add($input)) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } break; default : return parent::doSpecificMassiveActions($input); } return $res; } /** * @see CommonDBTM::showSpecificMassiveActionsParameters() **/ function showSpecificMassiveActionsParameters($input=array()) { switch ($input['action']) { case "add_contact_supplier" : if ($input['itemtype'] == 'Supplier') { Contact::dropdown(array('name' => "contacts_id")); echo "

"; return true; } if ($input['itemtype'] == 'Contact') { Supplier::dropdown(array('name' => "suppliers_id")); echo "

"; return true; } break; default : return parent::showSpecificMassiveActionsParameters($input); } return false; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate && Session::haveRight("contact_enterprise","r")) { switch ($item->getType()) { case 'Supplier' : if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(_n('Contact', 'Contacts', 2), self::countForSupplier($item)); } return _n('Contact', 'Contacts', 2); case 'Contact' : if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(_n('Supplier', 'Suppliers', 2), self::countForContact($item)); } return _n('Supplier', 'Suppliers', 2); } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($item->getType()) { case 'Supplier' : self::showForSupplier($item); break; case 'Contact' : self::showForContact($item); break; } return true; } /** * @param $item string Supplier object **/ static function countForSupplier(Supplier $item) { $restrict = "`glpi_contacts_suppliers`.`suppliers_id` = '".$item->getField('id') ."' AND `glpi_contacts_suppliers`.`contacts_id` = `glpi_contacts`.`id` ". getEntitiesRestrictRequest(" AND ", "glpi_contacts", '', $_SESSION['glpiactiveentities'], true); return countElementsInTable(array('glpi_contacts_suppliers', 'glpi_contacts'), $restrict); } /** * @param $item string Contact object **/ static function countForContact(Contact $item) { $restrict = "`glpi_contacts_suppliers`.`contacts_id` = '".$item->getField('id') ."' AND `glpi_contacts_suppliers`.`suppliers_id` = `glpi_suppliers`.`id` ". getEntitiesRestrictRequest(" AND ", "glpi_suppliers", '', $_SESSION['glpiactiveentities'], true); return countElementsInTable(array('glpi_contacts_suppliers', 'glpi_suppliers'), $restrict); } /** * Print the HTML array for entreprises on the current contact * *@return Nothing (display) **/ static function showForContact(Contact $contact) { global $DB,$CFG_GLPI; $instID = $contact->fields['id']; if (!$contact->can($instID,'r')) { return false; } $canedit = $contact->can($instID,'w'); $rand = mt_rand(); $query = "SELECT `glpi_contacts_suppliers`.`id`, `glpi_suppliers`.`id` AS entID, `glpi_suppliers`.`name` AS name, `glpi_suppliers`.`website` AS website, `glpi_suppliers`.`fax` AS fax, `glpi_suppliers`.`phonenumber` AS phone, `glpi_suppliers`.`suppliertypes_id` AS type, `glpi_suppliers`.`is_deleted`, `glpi_entities`.`id` AS entity FROM `glpi_contacts_suppliers`, `glpi_suppliers` LEFT JOIN `glpi_entities` ON (`glpi_entities`.`id`=`glpi_suppliers`.`entities_id`) WHERE `glpi_contacts_suppliers`.`contacts_id` = '$instID' AND `glpi_contacts_suppliers`.`suppliers_id` = `glpi_suppliers`.`id`". getEntitiesRestrictRequest(" AND","glpi_suppliers",'','',true) ." ORDER BY `glpi_entities`.`completename`, `name`"; $result = $DB->query($query); $suppliers = array(); $used = array(); if ($number = $DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $suppliers[$data['id']] = $data; $used[$data['entID']] = $data['entID']; } } if ($canedit) { echo "
"; echo ""; echo ""; echo ""; echo ""; echo "
".__('Add a supplier')."
"; echo ""; Supplier::dropdown(array('used' => $used, 'entity' => $contact->fields["entities_id"], 'entity_sons' => $contact->fields["is_recursive"])); echo ""; echo ""; echo "
"; Html::closeForm(); echo "
"; } echo "
"; if ($canedit && $number) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $massiveactionparams = array('num_displayed' => $number); Html::showMassiveActions(__CLASS__, $massiveactionparams); } echo ""; echo ""; if ($canedit && $number) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $used = array(); if ($number > 0) { Session::initNavigateListItems('Supplier', //TRANS : %1$s is the itemtype name, // %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), Contact::getTypeName(1), $contact->getName())); foreach ($suppliers as $data) { $ID = $data["id"]; Session::addToNavigateListItems('Supplier', $data["entID"]); $used[$data["entID"]] = $data["entID"]; $website = $data["website"]; if (!empty($website)) { $website = $data["website"]; if (!preg_match("?https*://?",$website)) { $website = "http://".$website; } $website = "".$data["website"].""; } echo ""; if ($canedit) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } } echo "
".Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand)."".__('Supplier')."".__('Entity')."".__('Third party type')."". __('Phone')."".__('Fax')."".__('Website')."
".Html::getMassiveActionCheckBox(__CLASS__, $data["id"]).""; echo "". Dropdown::getDropdownName("glpi_suppliers", $data["entID"])."".Dropdown::getDropdownName("glpi_entities", $data["entity"]); echo "".Dropdown::getDropdownName("glpi_suppliertypes", $data["type"]); echo "".$data["phone"]."".$data["fax"]."".$website."
"; if ($canedit && $number) { $massiveactionparams['ontop'] = false; Html::showMassiveActions(__CLASS__, $massiveactionparams); Html::closeForm(); } echo "
"; } /** * Show contacts asociated to an enterprise **/ static function showForSupplier(Supplier $supplier) { global $DB,$CFG_GLPI; $instID = $supplier->fields['id']; if (!$supplier->can($instID,'r')) { return false; } $canedit = $supplier->can($instID,'w'); $rand = mt_rand(); $query = "SELECT `glpi_contacts`.*, `glpi_contacts_suppliers`.`id` AS ID_ent, `glpi_entities`.`id` AS entity FROM `glpi_contacts_suppliers`, `glpi_contacts` LEFT JOIN `glpi_entities` ON (`glpi_entities`.`id`=`glpi_contacts`.`entities_id`) WHERE `glpi_contacts_suppliers`.`contacts_id`=`glpi_contacts`.`id` AND `glpi_contacts_suppliers`.`suppliers_id` = '$instID'" . getEntitiesRestrictRequest(" AND", "glpi_contacts", '', '', true) ." ORDER BY `glpi_entities`.`completename`, `glpi_contacts`.`name`"; $result = $DB->query($query); $contacts = array(); $used = array(); if ($number = $DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $contacts[$data['ID_ent']] = $data; $used[$data['id']] = $data['id']; } } if ($canedit) { echo "
"; echo ""; echo ""; echo ""; echo ""; echo "
".__('Add a contact')."
"; echo ""; Contact::dropdown(array('used' => $used, 'entity' => $supplier->fields["entities_id"], 'entity_sons' => $supplier->fields["is_recursive"])); echo ""; echo ""; echo "
"; Html::closeForm(); echo "
"; } echo "
"; if ($canedit && $number) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $massiveactionparams = array('num_displayed' => $number); Html::showMassiveActions(__CLASS__, $massiveactionparams); } echo ""; echo ""; if ($canedit && $number) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $used = array(); if ($number) { Session::initNavigateListItems('Contact', //TRANS : %1$s is the itemtype name, %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), Supplier::getTypeName(1), $supplier->getName())); foreach ($contacts as $data) { $ID = $data["ID_ent"]; $used[$data["id"]] = $data["id"]; Session::addToNavigateListItems('Contact',$data["id"]); echo ""; if ($canedit) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } } echo "
".Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand)."".__('Name')."".__('Entity')."". __('Phone')."". __('Phone 2')."".__('Mobile phone')."".__('Fax').""._n('Email', 'Emails', 1)."".__('Type')."
".Html::getMassiveActionCheckBox(__CLASS__, $data["ID_ent"]).""; echo "". sprintf(__('%1$s %2$s'), $data["name"], $data["firstname"])."".Dropdown::getDropdownName("glpi_entities", $data["entity"])."".$data["phone"]."".$data["phone2"]."".$data["mobile"]."".$data["fax"].""; echo "".$data["email"]."".Dropdown::getDropdownName("glpi_contacttypes", $data["contacttypes_id"])."
"; if ($canedit && $number) { $massiveactionparams['ontop'] = false; Html::showMassiveActions(__CLASS__, $massiveactionparams); Html::closeForm(); } echo "
"; } } ?> glpi-0.84.3+dfsg.1/inc/contacttype.class.php000066400000000000000000000025561226600447100205540ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class ContactType class ContactType extends CommonDropdown { static function getTypeName($nb=0) { return _n('Contact type', 'Contact types', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/contract.class.php000066400000000000000000001567151226600447100200430ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Contract class */ class Contract extends CommonDBTM { // From CommonDBTM public $dohistory = true; static protected $forward_entity_to = array('ContractCost'); static function getTypeName($nb=0) { return _n('Contract', 'Contracts', $nb); } static function canCreate() { return Session::haveRight('contract', 'w'); } static function canView() { return Session::haveRight('contract', 'r'); } function post_getEmpty() { $this->fields["alert"] = Entity::getUsedConfig("use_contracts_alert", $this->fields["entities_id"], "default_contract_alert", 0); } function cleanDBonPurge() { $class = new Contract_Supplier(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); $class = new ContractCost(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); $class = new Contract_Item(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); $class = new Alert(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('ContractCost', $ong, $options); $this->addStandardTab('Contract_Supplier', $ong, $options); $this->addStandardTab('Contract_Item', $ong, $options); $this->addStandardTab('Document_Item', $ong, $options); $this->addStandardTab('Link', $ong, $options); $this->addStandardTab('Note', $ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } /** * @since version 0.83.3 * * @see CommonDBTM::prepareInputForAdd() */ function prepareInputForAdd($input) { if (isset($input["id"]) && $input["id"]>0) { $input["_oldID"] = $input["id"]; } unset($input['id']); unset($input['withtemplate']); return $input; } /** * @since version 0.84 **/ function post_addItem() { global $DB; // Manage add from template if (isset($this->input["_oldID"])) { // ADD Devices ContractCost::cloneContract($this->input["_oldID"], $this->fields['id']); } } function pre_updateInDB() { // Clean end alert if begin_date is after old one // Or if duration is greater than old one if ((isset($this->oldvalues['begin_date']) && ($this->oldvalues['begin_date'] < $this->fields['begin_date'])) || (isset($this->oldvalues['duration']) && ($this->oldvalues['duration'] < $this->fields['duration']))) { $alert = new Alert(); $alert->clear($this->getType(), $this->fields['id'], Alert::END); } // Clean notice alert if begin_date is after old one // Or if duration is greater than old one // Or if notice is lesser than old one if ((isset($this->oldvalues['begin_date']) && ($this->oldvalues['begin_date'] < $this->fields['begin_date'])) || (isset($this->oldvalues['duration']) && ($this->oldvalues['duration'] < $this->fields['duration'])) || (isset($this->oldvalues['notice']) && ($this->oldvalues['notice'] > $this->fields['notice']))) { $alert = new Alert(); $alert->clear($this->getType(), $this->fields['id'], Alert::NOTICE); } } /** * Print the contract form * * @param $ID integer ID of the item * @param $options array * - target filename : where to go when done. * - withtemplate boolean : template or basic item * *@return boolean item found **/ function showForm($ID,$options=array()) { $this->initForm($ID, $options); $can_edit = $this->can($ID,'w'); $this->showTabs($options); $this->showFormHeader($options); echo ""; echo "".__('Name').""; Html::autocompletionTextField($this, "name"); echo ""; echo "".__('Contract type').""; ContractType::dropdown(array('value' => $this->fields["contracttypes_id"])); echo ""; echo ""; echo ""._x('phone', 'Number').""; echo ""; Html::autocompletionTextField($this, "num"); echo ""; echo ""; echo ""; echo "".__('Start date').""; echo ""; Html::showDateFormItem("begin_date", $this->fields["begin_date"]); echo ""; echo "".__('Initial contract period').""; Dropdown::showInteger("duration", $this->fields["duration"], 1, 120, 1, array(0 => Dropdown::EMPTY_VALUE), array('unit' => 'month')); if (!empty($this->fields["begin_date"])) { echo " -> ".Infocom::getWarrantyExpir($this->fields["begin_date"], $this->fields["duration"], 0, true); } echo ""; echo ""; echo ""; echo "".__('Notice').""; Dropdown::showInteger("notice", $this->fields["notice"], 0, 120, 1, array(), array('unit' => 'month')); if (!empty($this->fields["begin_date"]) && ($this->fields["notice"] > 0)) { echo " -> ".Infocom::getWarrantyExpir($this->fields["begin_date"], $this->fields["duration"], $this->fields["notice"], true); } echo ""; echo "".__('Account number').""; Html::autocompletionTextField($this, "accounting_number"); echo ""; echo ""; echo "".__('Contract renewal period').""; Dropdown::showInteger("periodicity", $this->fields["periodicity"], 12, 60, 12, array(0 => Dropdown::EMPTY_VALUE, 1 => sprintf(_n('%d month', '%d months', 1), 1), 2 => sprintf(_n('%d month', '%d months', 2), 2), 3 => sprintf(_n('%d month', '%d months', 3), 3), 6 => sprintf(_n('%d month', '%d months', 6), 6)), array('unit' => 'month')); echo ""; echo "".__('Invoice period').""; echo ""; Dropdown::showInteger("billing", $this->fields["billing"], 12, 60, 12, array(0 => Dropdown::EMPTY_VALUE, 1 => sprintf(_n('%d month', '%d months', 1), 1), 2 => sprintf(_n('%d month', '%d months', 2), 2), 3 => sprintf(_n('%d month', '%d months', 3), 3), 6 => sprintf(_n('%d month', '%d months', 6), 6)), array('unit' => 'month')); echo ""; echo ""; echo "".__('Renewal').""; self::dropdownContractRenewal("renewal", $this->fields["renewal"]); echo ""; echo "".__('Max number of items').""; Dropdown::showInteger("max_links_allowed", $this->fields["max_links_allowed"], 1, 200, 1, array(0 => __('Unlimited'))); echo ""; echo ""; if (Entity::getUsedConfig("use_contracts_alert", $this->fields["entities_id"])) { echo ""; echo "".__('Email alarms').""; echo ""; self::dropdownAlert(array('name' => "alert", 'value' => $this->fields["alert"])); Alert::displayLastAlert(__CLASS__, $ID); echo ""; echo " "; echo ""; } echo "".__('Comments').""; echo ""; echo ""; echo ""; echo "".__('Support hours').""; echo " "; echo ""; echo "".__('on week').""; echo "". __('Start')." "; Dropdown::showHours("week_begin_hour", $this->fields["week_begin_hour"]); echo "".__('End')." "; Dropdown::showHours("week_end_hour", $this->fields["week_end_hour"]); echo ""; echo ""; echo "".__('on Saturday').""; echo ""; Dropdown::showYesNo("use_saturday", $this->fields["use_saturday"]); echo "".__('Start')." "; Dropdown::showHours("saturday_begin_hour", $this->fields["saturday_begin_hour"]); echo "".__('End')." "; Dropdown::showHours("saturday_end_hour", $this->fields["saturday_end_hour"]); echo ""; echo ""; echo "".__('Sundays and holidays').""; echo ""; Dropdown::showYesNo("use_monday", $this->fields["use_monday"]); echo "".__('Start')." "; Dropdown::showHours("monday_begin_hour", $this->fields["monday_begin_hour"]); echo "".__('End')." "; Dropdown::showHours("monday_end_hour", $this->fields["monday_end_hour"]); echo ""; $this->showFormButtons($options); $this->addDivForTabs(); return true; } static function getSearchOptionsToAdd() { $tab = array(); $tab['contract'] = self::getTypeName(2); $joinparams = array('beforejoin' => array('table' => 'glpi_contracts_items', 'joinparams' => array('jointype' => 'itemtype_item'))); $joinparamscost = array('jointype' => 'child', 'beforejoin' => array('table' => 'glpi_contracts', 'joinparams' => $joinparams)); $tab[139]['table'] = 'glpi_contracts_items'; $tab[139]['field'] = 'count'; $tab[139]['name'] = _x('quantity', 'Number of contracts'); $tab[139]['forcegroupby'] = true; $tab[139]['usehaving'] = true; $tab[139]['datatype'] = 'number'; $tab[139]['massiveaction'] = false; $tab[139]['joinparams'] = array('jointype' => 'itemtype_item'); $tab[29]['table'] = 'glpi_contracts'; $tab[29]['field'] = 'name'; $tab[29]['name'] = self::getTypeName(1); $tab[29]['forcegroupby'] = true; $tab[29]['datatype'] = 'itemlink'; $tab[29]['massiveaction'] = false; $tab[29]['joinparams'] = $joinparams; $tab[30]['table'] = 'glpi_contracts'; $tab[30]['field'] = 'num'; $tab[30]['name'] = __('Contract number'); $tab[30]['forcegroupby'] = true; $tab[30]['massiveaction'] = false; $tab[30]['joinparams'] = $joinparams; $tab[30]['datatype'] = 'string'; $tab[130]['table'] = 'glpi_contracts'; $tab[130]['field'] = 'duration'; $tab[130]['name'] = sprintf(__('%1$s - %2$s'), __('Contract'),__('Duration')); $tab[130]['datatype'] = 'number'; $tab[130]['max'] = 120; $tab[130]['unit'] = 'month'; $tab[130]['forcegroupby'] = true; $tab[130]['massiveaction'] = false; $tab[130]['joinparams'] = $joinparams; $tab[131]['table'] = 'glpi_contracts'; $tab[131]['field'] = 'periodicity'; //TRANS: %1$s is Contract, %2$s is field name $tab[131]['name'] = sprintf(__('%1$s - %2$s'), __('Contract'), __('Periodicity')); $tab[131]['forcegroupby'] = true; $tab[131]['massiveaction'] = false; $tab[131]['joinparams'] = $joinparams; $tab[131]['datatype'] = 'number'; $tab[131]['min'] = 12; $tab[131]['max'] = 60; $tab[131]['step'] = 12; $tab[131]['toadd'] = array(0 => Dropdown::EMPTY_VALUE, 1 => sprintf(_n('%d month', '%d months', 1), 1), 2 => sprintf(_n('%d month', '%d months', 2), 2), 3 => sprintf(_n('%d month', '%d months', 3), 3), 6 => sprintf(_n('%d month', '%d months', 6), 6)); $tab[131]['unit'] = 'month'; $tab[132]['table'] = 'glpi_contracts'; $tab[132]['field'] = 'begin_date'; $tab[132]['name'] = sprintf(__('%1$s - %2$s'), __('Contract'), __('Start date')); $tab[132]['forcegroupby'] = true; $tab[132]['datatype'] = 'date'; $tab[132]['massiveaction'] = false; $tab[132]['joinparams'] = $joinparams; $tab[133]['table'] = 'glpi_contracts'; $tab[133]['field'] = 'accounting_number'; $tab[133]['name'] = sprintf(__('%1$s - %2$s'), __('Contract'), __('Account number')); $tab[133]['forcegroupby'] = true; $tab[133]['massiveaction'] = false; $tab[133]['datatype'] = 'string'; $tab[133]['joinparams'] = $joinparams; $tab[134]['table'] = 'glpi_contracts'; $tab[134]['field'] = 'end_date'; $tab[134]['name'] = sprintf(__('%1$s - %2$s'), __('Contract'), __('End date')); $tab[134]['forcegroupby'] = true; $tab[134]['datatype'] = 'date_delay'; $tab[134]['datafields'][1] = 'begin_date'; $tab[134]['datafields'][2] = 'duration'; $tab[134]['searchunit'] = 'MONTH'; $tab[134]['delayunit'] = 'MONTH'; $tab[134]['massiveaction'] = false; $tab[134]['joinparams'] = $joinparams; $tab[135]['table'] = 'glpi_contracts'; $tab[135]['field'] = 'notice'; $tab[135]['name'] = sprintf(__('%1$s - %2$s'), __('Contract'), __('Notice')); $tab[135]['datatype'] = 'number'; $tab[135]['max'] = 120; $tab[135]['unit'] = 'month'; $tab[135]['forcegroupby'] = true; $tab[135]['massiveaction'] = false; $tab[135]['joinparams'] = $joinparams; $tab[136]['table'] = 'glpi_contractcosts'; $tab[136]['field'] = 'totalcost'; $tab[136]['name'] = sprintf(__('%1$s - %2$s'), __('Contract'), __('Cost')); $tab[136]['forcegroupby'] = true; $tab[136]['datatype'] = 'decimal'; $tab[136]['massiveaction'] = false; $tab[136]['usehaving'] = true; $tab[136]['joinparams'] = $joinparamscost; $tab[137]['table'] = 'glpi_contracts'; $tab[137]['field'] = 'billing'; $tab[137]['name'] = sprintf(__('%1$s - %2$s'), __('Contract'), __('Invoice period')); $tab[137]['forcegroupby'] = true; $tab[137]['massiveaction'] = false; $tab[137]['joinparams'] = $joinparams; $tab[137]['datatype'] = 'number'; $tab[137]['min'] = 12; $tab[137]['max'] = 60; $tab[137]['step'] = 12; $tab[137]['toadd'] = array(0 => Dropdown::EMPTY_VALUE, 1 => sprintf(_n('%d month', '%d months', 1), 1), 2 => sprintf(_n('%d month', '%d months', 2), 2), 3 => sprintf(_n('%d month', '%d months', 3), 3), 6 => sprintf(_n('%d month', '%d months', 6), 6)); $tab[137]['unit'] = 'month'; $tab[138]['table'] = 'glpi_contracts'; $tab[138]['field'] = 'renewal'; $tab[138]['name'] = sprintf(__('%1$s - %2$s'), __('Contract'), __('Renewal')); $tab[138]['forcegroupby'] = true; $tab[138]['massiveaction'] = false; $tab[138]['joinparams'] = $joinparams; $tab[138]['datatype'] = 'specific'; return $tab; } /** * @see CommonDBTM::getSpecificMassiveActions() **/ function getSpecificMassiveActions($checkitem=NULL) { $isadmin = static::canUpdate(); $actions = parent::getSpecificMassiveActions($checkitem); if ($isadmin) { $actions['add_contract_item'] = _x('button', 'Add an item'); $actions['remove_contract_item'] = _x('button', 'Remove an item'); } if (Session::haveRight('transfer','r') && Session::isMultiEntitiesMode() && $isadmin) { $actions['add_transfer_list'] = _x('button', 'Add to transfer list'); } return $actions; } /** * @since version 0.84 * * @param $field * @param $name (default '') * @param $values (default '') * @param $options array **/ static function getSpecificValueToSelect($field, $name='', $values='', array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'alert' : $options['name'] = $name; $options['value'] = $values[$field]; return self::dropdownAlert($options); case 'renewal' : $options['name'] = $name; return self::dropdownContractRenewal($name, $values[$field], false); } return parent::getSpecificValueToSelect($field, $name, $values, $options); } /** * @since version 0.84 * * @param $field * @param $values * @param $options array **/ static function getSpecificValueToDisplay($field, $values, array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } switch ($field) { case 'alert' : return self::getAlertName($values[$field]); case 'renewal' : return self::getContractRenewalName($values[$field]); } return parent::getSpecificValueToDisplay($field, $values, $options); } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'num'; $tab[3]['name'] = _x('phone', 'Number'); $tab[3]['datatype'] = 'string'; $tab[4]['table'] = 'glpi_contracttypes'; $tab[4]['field'] = 'name'; $tab[4]['name'] = __('Type'); $tab[4]['datatype'] = 'dropdown'; $tab[5]['table'] = $this->getTable(); $tab[5]['field'] = 'begin_date'; $tab[5]['name'] = __('Start date'); $tab[5]['datatype'] = 'date'; $tab[5]['maybefuture'] = true; $tab[6]['table'] = $this->getTable(); $tab[6]['field'] = 'duration'; $tab[6]['name'] = __('Duration'); $tab[6]['datatype'] = 'number'; $tab[6]['max'] = 120; $tab[6]['unit'] = 'month'; $tab[20]['table'] = $this->getTable(); $tab[20]['field'] = 'end_date'; $tab[20]['name'] = __('End date'); $tab[20]['datatype'] = 'date_delay'; $tab[20]['datafields'][1] = 'begin_date'; $tab[20]['datafields'][2] = 'duration'; $tab[20]['searchunit'] = 'MONTH'; $tab[20]['delayunit'] = 'MONTH'; $tab[20]['maybefuture'] = true; $tab[20]['massiveaction'] = false; $tab[7]['table'] = $this->getTable(); $tab[7]['field'] = 'notice'; $tab[7]['name'] = __('Notice'); $tab[7]['datatype'] = 'number'; $tab[7]['max'] = 120; $tab[7]['unit'] = 'month'; $tab[21]['table'] = $this->getTable(); $tab[21]['field'] = 'periodicity'; $tab[21]['name'] = __('Periodicity'); $tab[21]['massiveaction'] = false; $tab[21]['datatype'] = 'number'; $tab[21]['min'] = 12; $tab[21]['max'] = 60; $tab[21]['step'] = 12; $tab[21]['toadd'] = array(0 => Dropdown::EMPTY_VALUE, 1 => sprintf(_n('%d month', '%d months', 1), 1), 2 => sprintf(_n('%d month', '%d months', 2), 2), 3 => sprintf(_n('%d month', '%d months', 3), 3), 6 => sprintf(_n('%d month', '%d months', 6), 6)); $tab[21]['unit'] = 'month'; $tab[22]['table'] = $this->getTable(); $tab[22]['field'] = 'billing'; $tab[22]['name'] = __('Invoice period'); $tab[22]['massiveaction'] = false; $tab[22]['datatype'] = 'number'; $tab[22]['min'] = 12; $tab[22]['max'] = 60; $tab[22]['step'] = 12; $tab[22]['toadd'] = array(0 => Dropdown::EMPTY_VALUE, 1 => sprintf(_n('%d month', '%d months', 1), 1), 2 => sprintf(_n('%d month', '%d months', 2), 2), 3 => sprintf(_n('%d month', '%d months', 3), 3), 6 => sprintf(_n('%d month', '%d months', 6), 6)); $tab[22]['unit'] = 'month'; $tab[10]['table'] = $this->getTable(); $tab[10]['field'] = 'accounting_number'; $tab[10]['name'] = __('Account number'); $tab[10]['datatype'] = 'string'; $tab[23]['table'] = $this->getTable(); $tab[23]['field'] = 'renewal'; $tab[23]['name'] = __('Renewal'); $tab[23]['massiveaction'] = false; $tab[23]['datatype'] = 'specific'; $tab[12]['table'] = $this->getTable(); $tab[12]['field'] = 'expire'; $tab[12]['name'] = __('Expiration'); $tab[12]['datatype'] = 'date_delay'; $tab[12]['datafields'][1] = 'begin_date'; $tab[12]['datafields'][2] = 'duration'; $tab[12]['searchunit'] = 'DAY'; $tab[12]['delayunit'] = 'MONTH'; $tab[12]['maybefuture'] = true; $tab[12]['massiveaction'] = false; $tab[13]['table'] = $this->getTable(); $tab[13]['field'] = 'expire_notice'; $tab[13]['name'] = __('Expiration date + notice'); $tab[13]['datatype'] = 'date_delay'; $tab[13]['datafields'][1] = 'begin_date'; $tab[13]['datafields'][2] = 'duration'; $tab[13]['datafields'][3] = 'notice'; $tab[13]['searchunit'] = 'DAY'; $tab[13]['delayunit'] = 'MONTH'; $tab[13]['maybefuture'] = true; $tab[13]['massiveaction'] = false; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab[90]['table'] = $this->getTable(); $tab[90]['field'] = 'notepad'; $tab[90]['name'] = __('Notes'); $tab[90]['massiveaction'] = false; $tab[80]['table'] = 'glpi_entities'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = __('Entity'); $tab[80]['massiveaction'] = false; $tab[80]['datatype'] = 'dropdown'; $tab[59]['table'] = $this->getTable(); $tab[59]['field'] = 'alert'; $tab[59]['name'] = __('Email alarms'); $tab[59]['datatype'] = 'specific'; $tab[86]['table'] = $this->getTable(); $tab[86]['field'] = 'is_recursive'; $tab[86]['name'] = __('Child entities'); $tab[86]['datatype'] = 'bool'; $tab[72]['table'] = 'glpi_contracts_items'; $tab[72]['field'] = 'count'; $tab[72]['name'] = _x('quantity', 'Number of items'); $tab[72]['forcegroupby'] = true; $tab[72]['usehaving'] = true; $tab[72]['datatype'] = 'number'; $tab[72]['massiveaction'] = false; $tab[72]['joinparams'] = array('jointype' => 'child'); $tab[29]['table'] = 'glpi_suppliers'; $tab[29]['field'] = 'name'; $tab[29]['name'] = _n('Associated supplier', 'Associated suppliers', 2); $tab[29]['forcegroupby'] = true; $tab[29]['datatype'] = 'itemlink'; $tab[29]['massiveaction'] = false; $tab[29]['joinparams'] = array('beforejoin' => array('table' => 'glpi_contracts_suppliers', 'joinparams' => array('jointype' => 'child'))); $tab['cost'] = __('Cost'); $tab[11]['table'] = 'glpi_contractcosts'; $tab[11]['field'] = 'totalcost'; $tab[11]['name'] = __('Total cost'); $tab[11]['datatype'] = 'decimal'; $tab[11]['forcegroupby'] = true; $tab[11]['massiveaction'] = false; $tab[11]['usehaving'] = true; $tab[11]['joinparams'] = array('jointype' => 'child'); $tab[41]['table'] = 'glpi_contractcosts'; $tab[41]['field'] = 'cost'; $tab[41]['name'] = _n('Cost', 'Costs', 2); $tab[41]['datatype'] = 'decimal'; $tab[41]['forcegroupby'] = true; $tab[41]['massiveaction'] = false; $tab[41]['joinparams'] = array('jointype' => 'child'); $tab[42]['table'] = 'glpi_contractcosts'; $tab[42]['field'] = 'begin_date'; $tab[42]['name'] = sprintf(__('%1$s - %2$s'), __('Cost'), __('Begin date')); $tab[42]['datatype'] = 'date'; $tab[42]['forcegroupby'] = true; $tab[42]['massiveaction'] = false; $tab[42]['joinparams'] = array('jointype' => 'child'); $tab[43]['table'] = 'glpi_contractcosts'; $tab[43]['field'] = 'end_date'; $tab[43]['name'] = sprintf(__('%1$s - %2$s'), __('Cost'), __('End date')); $tab[43]['datatype'] = 'date'; $tab[43]['forcegroupby'] = true; $tab[43]['massiveaction'] = false; $tab[43]['joinparams'] = array('jointype' => 'child'); $tab[44]['table'] = 'glpi_contractcosts'; $tab[44]['field'] = 'name'; $tab[44]['name'] = sprintf(__('%1$s - %2$s'), __('Cost'), __('Name')); $tab[44]['forcegroupby'] = true; $tab[44]['massiveaction'] = false; $tab[44]['joinparams'] = array('jointype' => 'child'); $tab[44]['datatype'] = 'dropdown'; $tab[45]['table'] = 'glpi_budgets'; $tab[45]['field'] = 'name'; $tab[45]['name'] = sprintf(__('%1$s - %2$s'), __('Cost'), __('Budget')); $tab[45]['datatype'] = 'dropdown'; $tab[45]['forcegroupby'] = true; $tab[45]['massiveaction'] = false; $tab[45]['joinparams'] = array('beforejoin' => array('table' => 'glpi_contractcosts', 'joinparams' => array('jointype' => 'child'))); return $tab; } /** * Show central contract resume * HTML array * * @return Nothing (display) **/ static function showCentral() { global $DB,$CFG_GLPI; if (!Session::haveRight("contract", "r")) { return false; } // No recursive contract, not in local management // contrats echus depuis moins de 30j $query = "SELECT COUNT(*) FROM `glpi_contracts` WHERE `glpi_contracts`.`is_deleted`='0' ". getEntitiesRestrictRequest("AND","glpi_contracts")." AND DATEDIFF(ADDDATE(`glpi_contracts`.`begin_date`, INTERVAL `glpi_contracts`.`duration` MONTH),CURDATE() )>-30 AND DATEDIFF(ADDDATE(`glpi_contracts`.`begin_date`, INTERVAL `glpi_contracts`.`duration` MONTH),CURDATE() )<'0'"; $result = $DB->query($query); $contract0 = $DB->result($result,0,0); // contrats echeance j-7 $query = "SELECT COUNT(*) FROM `glpi_contracts` WHERE `glpi_contracts`.`is_deleted`='0' ". getEntitiesRestrictRequest("AND","glpi_contracts")." AND DATEDIFF(ADDDATE(`glpi_contracts`.`begin_date`, INTERVAL `glpi_contracts`.`duration` MONTH),CURDATE() )>'0' AND DATEDIFF(ADDDATE(`glpi_contracts`.`begin_date`, INTERVAL `glpi_contracts`.`duration` MONTH),CURDATE() )<='7'"; $result = $DB->query($query); $contract7 = $DB->result($result, 0, 0); // contrats echeance j -30 $query = "SELECT COUNT(*) FROM `glpi_contracts` WHERE `glpi_contracts`.`is_deleted`='0' ". getEntitiesRestrictRequest("AND","glpi_contracts")." AND DATEDIFF(ADDDATE(`glpi_contracts`.`begin_date`, INTERVAL `glpi_contracts`.`duration` MONTH),CURDATE() )>'7' AND DATEDIFF(ADDDATE(`glpi_contracts`.`begin_date`, INTERVAL `glpi_contracts`.`duration` MONTH),CURDATE() )<'30'"; $result = $DB->query($query); $contract30 = $DB->result($result,0,0); // contrats avec préavis echeance j-7 $query = "SELECT COUNT(*) FROM `glpi_contracts` WHERE `glpi_contracts`.`is_deleted`='0' ". getEntitiesRestrictRequest("AND","glpi_contracts")." AND `glpi_contracts`.`notice`<>'0' AND DATEDIFF(ADDDATE(`glpi_contracts`.`begin_date`, INTERVAL (`glpi_contracts`.`duration`-`glpi_contracts`.`notice`) MONTH),CURDATE() )>'0' AND DATEDIFF(ADDDATE(`glpi_contracts`.`begin_date`, INTERVAL (`glpi_contracts`.`duration`-`glpi_contracts`.`notice`) MONTH),CURDATE() )<='7'"; $result = $DB->query($query); $contractpre7 = $DB->result($result,0,0); // contrats avec préavis echeance j -30 $query = "SELECT COUNT(*) FROM `glpi_contracts` WHERE `glpi_contracts`.`is_deleted`='0'". getEntitiesRestrictRequest("AND","glpi_contracts")." AND `glpi_contracts`.`notice`<>'0' AND DATEDIFF(ADDDATE(`glpi_contracts`.`begin_date`, INTERVAL (`glpi_contracts`.`duration`-`glpi_contracts`.`notice`) MONTH),CURDATE() )>'7' AND DATEDIFF(ADDDATE(`glpi_contracts`.`begin_date`, INTERVAL (`glpi_contracts`.`duration`-`glpi_contracts`.`notice`) MONTH),CURDATE() )<'30'"; $result = $DB->query($query); $contractpre30 = $DB->result($result,0,0); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
"; echo "". self::getTypeName(1)."
". __('Contracts expired in the last 30 days')." ".$contract0."
". __('Contracts expiring in less than 7 days')."".$contract7."
". __('Contracts expiring in less than 30 days')."".$contract30."
". __('Contracts where notice begins in less than 7 days')."".$contractpre7."
". __('Contracts where notice begins in less than 30 days')."".$contractpre30."
"; } /** * Get the entreprise name for the contract * *@return string of names (HTML) **/ function getSuppliersNames() { global $DB; $query = "SELECT `glpi_suppliers`.`id` FROM `glpi_contracts_suppliers`, `glpi_suppliers` WHERE `glpi_contracts_suppliers`.`suppliers_id` = `glpi_suppliers`.`id` AND `glpi_contracts_suppliers`.`contracts_id` = '".$this->fields['id']."'"; $result = $DB->query($query); $out = ""; while ($data = $DB->fetch_assoc($result)) { $out .= Dropdown::getDropdownName("glpi_suppliers", $data['id'])."
"; } return $out; } static function cronInfo($name) { return array('description' => __('Send alarms on contracts')); } /** * Cron action on contracts : alert depending of the config : on notice and expire * * @param $task for log, if NULL display (default NULL) **/ static function cronContract($task=NULL) { global $DB, $CFG_GLPI; if (!$CFG_GLPI["use_mailing"]) { return 0; } $message = array(); $items_notice = array(); $items_end = array(); $cron_status = 0; $contract_infos[Alert::END] = array(); $contract_infos[Alert::NOTICE] = array(); $contract_messages = array(); foreach (Entity::getEntitiesToNotify('use_contracts_alert') as $entity => $value) { $before = Entity::getUsedConfig('send_contracts_alert_before_delay', $entity); $query_notice = "SELECT `glpi_contracts`.* FROM `glpi_contracts` LEFT JOIN `glpi_alerts` ON (`glpi_contracts`.`id` = `glpi_alerts`.`items_id` AND `glpi_alerts`.`itemtype` = 'Contract' AND `glpi_alerts`.`type`='".Alert::NOTICE."') WHERE (`glpi_contracts`.`alert` & ".pow(2,Alert::NOTICE).") >'0' AND `glpi_contracts`.`is_deleted` = '0' AND `glpi_contracts`.`begin_date` IS NOT NULL AND `glpi_contracts`.`duration` <> '0' AND `glpi_contracts`.`notice` <> '0' AND DATEDIFF(ADDDATE(`glpi_contracts`.`begin_date`, INTERVAL `glpi_contracts`.`duration` MONTH), CURDATE()) > '0' AND DATEDIFF(ADDDATE(`glpi_contracts`.`begin_date`, INTERVAL (`glpi_contracts`.`duration` -`glpi_contracts`.`notice`) MONTH), CURDATE()) < '$before' AND `glpi_alerts`.`date` IS NULL AND `glpi_contracts`.`entities_id` = '".$entity."'"; $query_end = "SELECT `glpi_contracts`.* FROM `glpi_contracts` LEFT JOIN `glpi_alerts` ON (`glpi_contracts`.`id` = `glpi_alerts`.`items_id` AND `glpi_alerts`.`itemtype` = 'Contract' AND `glpi_alerts`.`type`='".Alert::END."') WHERE (`glpi_contracts`.`alert` & ".pow(2,Alert::END).") > '0' AND `glpi_contracts`.`is_deleted` = '0' AND `glpi_contracts`.`begin_date` IS NOT NULL AND `glpi_contracts`.`duration` <> '0' AND DATEDIFF(ADDDATE(`glpi_contracts`.`begin_date`, INTERVAL (`glpi_contracts`.`duration`) MONTH), CURDATE()) < '$before' AND `glpi_alerts`.`date` IS NULL AND `glpi_contracts`.`entities_id` = '".$entity."'"; $querys = array('notice' => $query_notice, 'end' => $query_end); foreach ($querys as $type => $query) { foreach ($DB->request($query) as $data) { $entity = $data['entities_id']; $message = sprintf(__('%1$s: %2$s')."
\n", $data["name"], Infocom::getWarrantyExpir($data["begin_date"], $data["duration"], $data["notice"])); $contract_infos[$type][$entity][$data['id']] = $data; if (!isset($contract_messages[$type][$entity])) { switch ($type) { case 'notice' : $contract_messages[$type][$entity] = __('Contract entered in notice time'). "
"; break; case 'end' : $contract_messages[$type][$entity] = __('Contract ended')."
"; break; } } $contract_messages[$type][$entity] .= $message; } } // Get contrats with periodicity alerts $query_periodicity = "SELECT `glpi_contracts`.* FROM `glpi_contracts` WHERE `glpi_contracts`.`alert` & ".pow(2,Alert::PERIODICITY)." > '0' AND `glpi_contracts`.`entities_id` = '".$entity."' "; // Foreach ones : foreach ($DB->request($query_periodicity) as $data) { $entity = $data['entities_id']; // Compute end date + 12 month : do not send alerts after $end_alert = date('Y-m-d', strtotime($data['begin_date']." +".($data['duration']+12)." month")); if (!empty($data['begin_date']) && $data['periodicity'] && ($end_alert > date('Y-m-d'))) { $todo = array('periodicity' => Alert::PERIODICITY); if ($data['alert']&pow(2,Alert::NOTICE)) { $todo['periodicitynotice'] = Alert::NOTICE; } // Get previous alerts foreach ($todo as $type => $event) { $previous_alerts[$type] = Alert::getAlertDate(__CLASS__, $data['id'], $event); } // compute next alert date based on already send alerts (or not) foreach ($todo as $type => $event) { $next_alerts[$type] = date('Y-m-d', strtotime($data['begin_date']." -".($before)." day")); if ($type == Alert::NOTICE) { $next_alerts[$type] = date('Y-m-d', strtotime($next_alerts[$type]." -".($data['notice'])." month")); } $today_limit = date('Y-m-d', strtotime(date('Y-m-d')." -" .($data['periodicity'])." month")); // Init previous by begin date if not set if (empty($previous_alerts[$type])) { $previous_alerts[$type] = $today_limit; } while (($next_alerts[$type] < $previous_alerts[$type]) && ($next_alerts[$type] < $end_alert)) { $next_alerts[$type] = date('Y-m-d', strtotime($next_alerts[$type]." +".($data['periodicity'])." month")); } // If this date is passed : clean alerts and send again if ($next_alerts[$type] <= date('Y-m-d')) { $alert = new Alert(); $alert->clear(__CLASS__, $data['id'], $event); $real_alert_date = date('Y-m-d', strtotime($next_alerts[$type]." +".($before)." day")); $message = sprintf(__('%1$s: %2$s')."
\n", $data["name"], Html::convDate($real_alert_date)); $data['alert_date'] = $real_alert_date; $data['items'] = Contract_Item::getItemsForContract($data['id'], $entity); $contract_infos[$type][$entity][$data['id']] = $data; switch ($type) { case 'periodicitynotice' : $contract_messages[$type][$entity] = __('Contract entered in notice time for period')."
"; break; case 'periodicity' : $contract_messages[$type][$entity] = __('Contract period ended')."
"; break; } $contract_messages[$type][$entity] .= $message; } } } } } foreach (array('notice' => Alert::NOTICE, 'end' => Alert::END, 'periodicity' => Alert::PERIODICITY, 'periodicitynotice' => Alert::NOTICE) as $event => $type ) { if (isset($contract_infos[$event]) && count($contract_infos[$event])) { foreach ($contract_infos[$event] as $entity => $contracts) { if (NotificationEvent::raiseEvent($event, new self(), array('entities_id' => $entity, 'items' => $contracts))) { $message = $contract_messages[$event][$entity]; $cron_status = 1; $entityname = Dropdown::getDropdownName("glpi_entities", $entity); if ($task) { $task->log(sprintf(__('%1$s: %2$s')."\n", $entityname, $message)); $task->addVolume(1); } else { Session::addMessageAfterRedirect(sprintf(__('%1$s: %2$s'), $entityname, $message)); } $alert = new Alert(); $input["itemtype"] = __CLASS__; $input["type"] = $type; foreach ($contracts as $id => $contract) { $input["items_id"] = $id; $alert->add($input); unset($alert->fields['id']); } } else { $entityname = Dropdown::getDropdownName('glpi_entities', $entity); //TRANS: %1$s is entity name, %2$s is the message $msg = sprintf(__('%1$s: %2$s'), $entityname, __('send contract alert failed')); if ($task) { $task->log($msg); } else { Session::addMessageAfterRedirect($msg, false, ERROR); } } } } } return $cron_status; } /** * Print a select with contracts * * Print a select named $name with contracts options and selected value $value * @param $options array of possible options: * - name : string / name of the select (default is contracts_id) * - value : integer / preselected value (default 0) * - entity : integer or array / restrict to a defined entity or array of entities * (default -1 : no restriction) * - entity_sons : boolean / if entity restrict specified auto select its sons * only available if entity is a single value not an array (default false) * - used : array / Already used items ID: not to display in dropdown (default empty) * - nochecklimit : boolean / disable limit for nomber of device (for supplier, default false) * * @return Nothing (display) **/ static function dropdown($options=array()) { global $DB; //$name,$entity_restrict=-1,$alreadyused=array(),$nochecklimit=false $p['name'] = 'contracts_id'; $p['value'] = ''; $p['entity'] = ''; $p['entity_sons'] = false; $p['used'] = array(); $p['nochecklimit'] = false; $p['on_change'] = ''; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } if (!($p['entity'] < 0) && $p['entity_sons']) { if (is_array($p['entity'])) { // no translation needed (only for dev) echo "entity_sons options is not available with array of entity"; } else { $p['entity'] = getSonsOf('glpi_entities',$p['entity']); } } $entrest = ""; $idrest = ""; if ($p['entity'] >= 0) { $entrest = getEntitiesRestrictRequest("AND", "glpi_contracts", "entities_id", $p['entity'], true); } if (count($p['used'])) { $idrest = " AND `glpi_contracts`.`id` NOT IN('".implode("','",$p['used'])."') "; } $query = "SELECT `glpi_contracts`.* FROM `glpi_contracts` LEFT JOIN `glpi_entities` ON (`glpi_contracts`.`entities_id` = `glpi_entities`.`id`) WHERE `glpi_contracts`.`is_deleted` = '0' $entrest $idrest ORDER BY `glpi_entities`.`completename`, `glpi_contracts`.`name` ASC, `glpi_contracts`.`begin_date` DESC"; $result = $DB->query($query); echo ""; } /** * Print a select with contract renewal * * Print a select named $name with contract renewal options and selected value $value * * @param $name string HTML select name * @param $value integer HTML select selected value (default = 0) * @param $display boolean get or display string ? (true by default) * * @return Nothing (display) **/ static function dropdownContractRenewal($name, $value=0, $display=true) { $tmp[0] = __('Never'); $tmp[1] = __('Tacit'); $tmp[2] = __('Express'); return Dropdown::showFromArray($name, $tmp, array('value' => $value, 'display' => $display)); } /** * Get the renewal type name * * @param $value integer HTML select selected value * * @return string **/ static function getContractRenewalName($value) { switch ($value) { case 1 : return __('Tacit'); case 2 : return __('Express'); default : return ""; } } /** * Get renewal ID by name * * @param $value the name of the renewal * * @return the ID of the renewal **/ static function getContractRenewalIDByName($value) { if (stristr($value, __('Tacit'))) { return 1; } if (stristr($value, __('Express'))) { return 2; } return 0; } /** * @param $options array **/ static function dropdownAlert(array $options) { $p['name'] = 'alert'; $p['value'] = 0; $p['display'] = true; $p['inherit_parent'] = false; if (count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } $tab = array(); if ($p['inherit_parent']) { $tab[Entity::CONFIG_PARENT] = __('Inheritance of the parent entity'); } $tab += self::getAlertName(); return Dropdown::showFromArray($p['name'], $tab, $p); } /** * Get the possible value for contract alert * * @since version 0.83 * * @param $val if not set, ask for all values, else for 1 value (default NULL) * * @return array or string **/ static function getAlertName($val=NULL) { $tmp[0] = Dropdown::EMPTY_VALUE; $tmp[pow(2, Alert::END)] = __('End'); $tmp[pow(2, Alert::NOTICE)] = __('Notice'); $tmp[(pow(2, Alert::END) + pow(2, Alert::NOTICE))] = __('End + Notice'); $tmp[pow(2, Alert::PERIODICITY)] = __('Period end'); $tmp[pow(2, Alert::PERIODICITY) + pow(2, Alert::NOTICE)] = __('Period end + Notice'); if (is_null($val)) { return $tmp; } if (isset($tmp[$val])) { return $tmp[$val]; } // If not set and is a string return value if (is_string($val)) { return $val; } return NOT_AVAILABLE; } /** * Display debug information for current object **/ function showDebug() { $options['entities_id'] = $this->getEntityID(); $options['contracts'] = array(); NotificationEvent::debugEvent($this, $options); } function getUnallowedFieldsForUnicity() { return array_merge(parent::getUnallowedFieldsForUnicity(), array('begin_date', 'duration', 'entities_id', 'monday_begin_hour', 'monday_end_hour', 'saturday_begin_hour', 'saturday_end_hour', 'week_begin_hour', 'week_end_hour')); } } ?> glpi-0.84.3+dfsg.1/inc/contract_item.class.php000066400000000000000000000602411226600447100210450ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // Relation between Contracts and Items class Contract_Item extends CommonDBRelation{ // From CommonDBRelation static public $itemtype_1 = 'Contract'; static public $items_id_1 = 'contracts_id'; static public $itemtype_2 = 'itemtype'; static public $items_id_2 = 'items_id'; /** * @since version 0.84 **/ function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } /** * Don't create a Contract_Item on contract that is alreay max used * Was previously done (until 0.83.*) by Contract_Item::can() * * @see CommonDBRelation::canCreateItem() * * @since version 0.84 **/ function canCreateItem() { // Try to load the contract $contract = $this->getConnexityItem(static::$itemtype_1, static::$items_id_1); if ($contract === false) { return false; } if (($contract->fields['max_links_allowed'] > 0) && (countElementsInTable($this->getTable(), "`contracts_id`='".$this->input['contracts_id']."'") >= $contract->fields['max_links_allowed'])) { return false; } return parent::canCreateItem(); } static function getTypeName($nb=0) { return _n('Link Contract/Item','Links Contract/Item',$nb); } static function getSpecificValueToDisplay($field, $values, array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } switch ($field) { case 'items_id': if (isset($values['itemtype'])) { if (isset($options['comments']) && $options['comments']) { $tmp = Dropdown::getDropdownName(getTableForItemtype($values['itemtype']), $values[$field], 1); return sprintf(__('%1$s %2$s'), $tmp['name'], Html::showToolTip($tmp['comment'], array('display' => false))); } return Dropdown::getDropdownName(getTableForItemtype($values['itemtype']), $values[$field]); } break; } return parent::getSpecificValueToDisplay($field, $values, $options); } /** * @since version 0.84 * * @param $field * @param $name (default '') * @param $values (default '') * @param $options array **/ static function getSpecificValueToSelect($field, $name='', $values='', array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'items_id' : if (isset($values['itemtype']) && !empty($values['itemtype'])) { $options['name'] = $name; $options['value'] = $values[$field]; return Dropdown::show($values['itemtype'], $options); } break; } return parent::getSpecificValueToSelect($field, $name, $values, $options); } function getSearchOptions() { $tab = array(); $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'items_id'; $tab[3]['name'] = __('Associated item ID'); $tab[3]['massiveaction'] = false; $tab[3]['datatype'] = 'specific'; $tab[3]['additionalfields'] = array('itemtype'); $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'itemtype'; $tab[4]['name'] = __('Type'); $tab[4]['massiveaction'] = false; $tab[4]['datatype'] = 'itemtypename'; $tab[4]['itemtype_list'] = 'contract_types'; return $tab; } /** * @param $item CommonDBTM object **/ static function countForItem(CommonDBTM $item) { return countElementsInTable('glpi_contracts_items', "`itemtype` = '".$item->getType()."' AND `items_id` ='".$item->getField('id')."'"); } /** * @param $item Contract object **/ static function countForContract(Contract $item) { $restrict = "`glpi_contracts_items`.`contracts_id` = '".$item->getField('id')."'"; return countElementsInTable(array('glpi_contracts_items'), $restrict); } /** * @since version 0.84 * * @param $contract_id contract ID * @param $entities_id entity ID * * @return array of items linked to contracts **/ static function getItemsForContract($contract_id, $entities_id) { global $DB; $items = array(); $query = "SELECT DISTINCT `itemtype` FROM `glpi_contracts_items` WHERE `glpi_contracts_items`.`contracts_id` = '$contract_id' ORDER BY `itemtype`"; $result = $DB->query($query); $number = $DB->numrows($result); $data = array(); $totalnb = 0; for ($i=0 ; $i<$number ; $i++) { $itemtype = $DB->result($result, $i, "itemtype"); if (!($item = getItemForItemtype($itemtype))) { continue; } $itemtable = getTableForItemType($itemtype); $query = "SELECT `$itemtable`.*, `glpi_contracts_items`.`id` AS IDD, `glpi_entities`.`id` AS entity FROM `glpi_contracts_items`, `$itemtable`"; if ($itemtype != 'Entity') { $query .= " LEFT JOIN `glpi_entities` ON (`$itemtable`.`entities_id`=`glpi_entities`.`id`) "; } $query .= " WHERE `$itemtable`.`id` = `glpi_contracts_items`.`items_id` AND `glpi_contracts_items`.`itemtype` = '$itemtype' AND `glpi_contracts_items`.`contracts_id` = '$contract_id'"; if ($item->maybeTemplate()) { $query .= " AND `$itemtable`.`is_template` = '0'"; } $query .= getEntitiesRestrictRequest(" AND",$itemtable, '', $entities_id, $item->maybeRecursive())." ORDER BY `glpi_entities`.`completename`, `$itemtable`.`name`"; $result_linked = $DB->query($query); $nb = $DB->numrows($result_linked); while ($objdata = $DB->fetch_assoc($result_linked)) { $items[$itemtype][$objdata['id']] = $objdata; } } return $items; } /** * @see CommonGLPI::getTabNameForItem() **/ function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { global $CFG_GLPI; // Can exists on template if (Session::haveRight("contract","r")) { switch ($item->getType()) { case 'Contract' : if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(_n('Item', 'Items', 2), self::countForContract($item)); } return _n('Item', 'Items', 2); default : if ($_SESSION['glpishow_count_on_tabs'] && in_array($item->getType(), $CFG_GLPI["contract_types"])) { return self::createTabEntry(Contract::getTypeName(2), self::countForItem($item)); } return _n('Contract', 'Contracts', 2); } } return ''; } /** * @param $item CommonGLPI object * @param $tabnum (default 1) * @param $withtemplate (default 0) **/ static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { global $CFG_GLPI; switch ($item->getType()) { case 'Contract' : self::showForContract($item); default : if (in_array($item->getType(), $CFG_GLPI["contract_types"])) { self::showForItem($item, $withtemplate); } } return true; } /** * Duplicate contracts from an item template to its clone * * @since version 0.84 * * @param $itemtype itemtype of the item * @param $oldid ID of the item to clone * @param $newid ID of the item cloned * @param $newitemtype itemtype of the new item (= $itemtype if empty) (default '') **/ static function cloneItem($itemtype, $oldid, $newid, $newitemtype='') { global $DB; if (empty($newitemtype)) { $newitemtype = $itemtype; } $query = "SELECT `contracts_id` FROM `glpi_contracts_items` WHERE `items_id` = '$oldid' AND `itemtype` = '$itemtype';"; foreach ($DB->request($query) as $data) { $contractitem = new self(); $contractitem->add(array('contracts_id' => $data["contracts_id"], 'itemtype' => $newitemtype, 'items_id' => $newid)); } } /** * Print an HTML array of contract associated to an object * * @since version 0.84 * * @param $item CommonDBTM object wanted * @param $withtemplate not used (to be deleted) (default '') * * @return Nothing (display) **/ static function showForItem(CommonDBTM $item, $withtemplate='') { global $DB, $CFG_GLPI; $itemtype = $item->getType(); $ID = $item->fields['id']; if (!Session::haveRight("contract","r") || !$item->can($ID,"r")) { return false; } $canedit = $item->can($ID,"w"); $rand = mt_rand(); $query = "SELECT `glpi_contracts_items`.* FROM `glpi_contracts_items`, `glpi_contracts` LEFT JOIN `glpi_entities` ON (`glpi_contracts`.`entities_id`=`glpi_entities`.`id`) WHERE `glpi_contracts`.`id`=`glpi_contracts_items`.`contracts_id` AND `glpi_contracts_items`.`items_id` = '$ID' AND `glpi_contracts_items`.`itemtype` = '$itemtype'". getEntitiesRestrictRequest(" AND","glpi_contracts",'','',true)." ORDER BY `glpi_contracts`.`name`"; $result = $DB->query($query); $contracts = array(); $used = array(); if ($number = $DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $contracts[$data['id']] = $data; $used[$data['id']] = $data['id']; } } if ($canedit && ($withtemplate != 2)) { echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
".__('Add a contract')."
"; Contract::dropdown(array('entity' => $item->getEntityID(), 'used' => $used)); echo ""; echo ""; echo "
"; Html::closeForm(); echo "
"; } echo "
"; if ($withtemplate != 2) { if ($canedit && $number) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $massiveactionparams = array('num_displayed' => $number); Html::showMassiveActions(__CLASS__, $massiveactionparams); } } echo ""; echo ""; if ($canedit && $number && ($withtemplate != 2)) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if ($number > 0) { Session::initNavigateListItems(__CLASS__, //TRANS : %1$s is the itemtype name, // %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), $item->getTypeName(1), $item->getName())); foreach ($contracts as $data) { $cID = $data["contracts_id"]; Session::addToNavigateListItems(__CLASS__,$cID); $contracts[] = $cID; $assocID = $data["id"]; $con = new Contract(); $con->getFromDB($cID); echo ""; if ($canedit && ($withtemplate != 2)) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } } echo "
".Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand)."".__('Name')."".__('Entity').""._x('phone', 'Number')."".__('Contract type')."".__('Supplier')."".__('Start date')."".__('Initial contract period')."
"; Html::showMassiveActionCheckBox(__CLASS__, $data["id"]); echo ""; $name = $con->fields["name"]; if ($_SESSION["glpiis_ids_visible"] || empty($con->fields["name"])) { $name = sprintf(__('%1$s (%2$s)'), $name, $con->fields["id"]); } echo "".$name; echo ""; echo Dropdown::getDropdownName("glpi_entities", $con->fields["entities_id"])."".$con->fields["num"].""; echo Dropdown::getDropdownName("glpi_contracttypes", $con->fields["contracttypes_id"]). "".$con->getSuppliersNames()."".Html::convDate($con->fields["begin_date"])."".sprintf(__('%1$s %2$s'), $con->fields["duration"], _n('month', 'months', $con->fields["duration"])); if (($con->fields["begin_date"] != '') && !empty($con->fields["begin_date"])) { echo " -> ".Infocom::getWarrantyExpir($con->fields["begin_date"], $con->fields["duration"], 0, true); } echo "
"; if ($canedit && $number && ($withtemplate != 2)) { $massiveactionparams['ontop'] = false; Html::showMassiveActions(__CLASS__, $massiveactionparams); Html::closeForm(); } echo "
"; } /** * Print the HTML array for Items linked to current contract * * @since version 0.84 * * @param $contract Contract object * * @return Nothing (display) **/ static function showForContract(Contract $contract) { global $DB, $CFG_GLPI; $instID = $contract->fields['id']; if (!$contract->can($instID,'r')) { return false; } $canedit = $contract->can($instID,'w'); $rand = mt_rand(); $query = "SELECT DISTINCT `itemtype` FROM `glpi_contracts_items` WHERE `glpi_contracts_items`.`contracts_id` = '$instID' ORDER BY `itemtype`"; $result = $DB->query($query); $number = $DB->numrows($result); $data = array(); $totalnb = 0; for ($i=0 ; $i<$number ; $i++) { $itemtype = $DB->result($result, $i, "itemtype"); if (!($item = getItemForItemtype($itemtype))) { continue; } if ($item->canView()) { $itemtable = getTableForItemType($itemtype); $query = "SELECT `$itemtable`.*, `glpi_contracts_items`.`id` AS IDD, `glpi_entities`.`id` AS entity FROM `glpi_contracts_items`, `$itemtable`"; if ($itemtype != 'Entity') { $query .= " LEFT JOIN `glpi_entities` ON (`$itemtable`.`entities_id`=`glpi_entities`.`id`) "; } $query .= " WHERE `$itemtable`.`id` = `glpi_contracts_items`.`items_id` AND `glpi_contracts_items`.`itemtype` = '$itemtype' AND `glpi_contracts_items`.`contracts_id` = '$instID'"; if ($item->maybeTemplate()) { $query .= " AND `$itemtable`.`is_template` = '0'"; } $query .= getEntitiesRestrictRequest(" AND",$itemtable, '', '', $item->maybeRecursive())." ORDER BY `glpi_entities`.`completename`, `$itemtable`.`name`"; $result_linked = $DB->query($query); $nb = $DB->numrows($result_linked); if ($nb > $_SESSION['glpilist_limit']) { $link = "" . __('Device list').""; $data[$itemtype] = array('longlist' => true, 'name' => sprintf(__('%1$s: %2$s'), $item->getTypeName($nb), $nb), 'link' => $link); } else if ($nb > 0) { for ($prem=true ; $objdata=$DB->fetch_assoc($result_linked) ; $prem=false) { $data[$itemtype][$objdata['id']] = $objdata; } } $totalnb += $nb; } } if ($canedit && (($contract->fields['max_links_allowed'] == 0) || ($contract->fields['max_links_allowed'] > $totalnb))) { echo "
"; echo ""; echo ""; echo ""; echo ""; echo "
".__('Add an item')."
"; Dropdown::showAllItems("items_id", 0, 0, ($contract->fields['is_recursive']?-1:$contract->fields['entities_id']), $CFG_GLPI["contract_types"], false, true); echo ""; echo ""; echo ""; echo "
"; Html::closeForm(); echo "
"; } echo "
"; if ($canedit && $totalnb) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $massiveactionparams = array(); Html::showMassiveActions(__CLASS__, $massiveactionparams); } echo ""; echo ""; if ($canedit && $totalnb) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $totalnb = 0; foreach ($data as $itemtype => $datas) { if (isset($datas['longlist'])) { echo ""; if ($canedit) { echo ""; } echo ""; echo ""; echo ""; } else { $prem = true; $nb = count($datas); foreach ($datas as $id => $objdata) { $name = $objdata["name"]; if ($_SESSION["glpiis_ids_visible"] || empty($data["name"])) { $name = sprintf(__('%1$s (%2$s)'), $name, $objdata["id"]); } $link = Toolbox::getItemTypeFormURL($itemtype); $name = "".$name.""; echo ""; if ($canedit) { echo ""; } if ($prem) { $item = new $itemtype(); $typename = $item->getTypeName($nb); echo ""; $prem = false; } echo ""; echo ""; echo""; echo ""; echo ""; } } } echo ""; echo " "; echo "
".Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand)."".__('Type')."".__('Entity')."".__('Name')."".__('Serial number')."".__('Inventory number')."".__('Status')."
 ".$datas['name']."".$datas['link']."--
"; Html::showMassiveActionCheckBox(__CLASS__, $objdata["IDD"]); echo "". ($nb >1 ? sprintf(__('%1$s: %2$s'), $typename, $nb): $typename).""; echo Dropdown::getDropdownName("glpi_entities",$objdata['entity'])."".$name."". (isset($objdata["serial"])? "".$objdata["serial"]."" :"-")."". (isset($objdata["otherserial"])? "".$objdata["otherserial"]."" :"-").""; if (isset($objdata["states_id"])) { echo Dropdown::getDropdownName("glpi_states", $objdata['states_id']); } else { echo ' '; } echo "
". ($totalnb > 0 ? sprintf(__('%1$s = %2$s'), __('Total'), $totalnb) : " "); echo " 
"; if ($canedit && $number) { $paramsma['ontop'] = false; Html::showMassiveActions(__CLASS__, $paramsma); Html::closeForm(); } echo "
"; } } ?>glpi-0.84.3+dfsg.1/inc/contract_supplier.class.php000066400000000000000000000341751226600447100217610ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // Relation between Contracts and Suppliers class Contract_Supplier extends CommonDBRelation { // From CommonDBRelation static public $itemtype_1 = 'Contract'; static public $items_id_1 = 'contracts_id'; static public $itemtype_2 = 'Supplier'; static public $items_id_2 = 'suppliers_id'; /** * @since version 0.84 **/ function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } /** * @param $item string Supplier object **/ static function countForSupplier(Supplier $item) { $restrict = "`glpi_contracts_suppliers`.`suppliers_id` = '".$item->getField('id') ."' AND `glpi_contracts_suppliers`.`contracts_id` = `glpi_contracts`.`id` ". getEntitiesRestrictRequest(" AND ", "glpi_contracts", '', $_SESSION['glpiactiveentities']); return countElementsInTable(array('glpi_contracts_suppliers', 'glpi_contracts'), $restrict); } /** * @param $item string Contract object **/ static function countForContract(Contract $item) { $restrict = "`glpi_contracts_suppliers`.`contracts_id` = '".$item->getField('id') ."' AND `glpi_contracts_suppliers`.`suppliers_id` = `glpi_suppliers`.`id` ". getEntitiesRestrictRequest(" AND ", "glpi_suppliers", '', $_SESSION['glpiactiveentities'], true); return countElementsInTable(array('glpi_contracts_suppliers', 'glpi_suppliers'), $restrict); } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { switch ($item->getType()) { case 'Supplier' : if (Session::haveRight("contract","r")) { if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(Contract::getTypeName(2), self::countForSupplier($item)); } return Contract::getTypeName(2); } break; case 'Contract' : if (Session::haveRight("contact_enterprise","r")) { if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(Supplier::getTypeName(2), self::countForContract($item)); } return Supplier::getTypeName(2); } break; } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($item->getType()) { case 'Supplier' : self::showForSupplier($item); break; case 'Contract' : self::showForContract($item); break; } return true; } /** * Print an HTML array with contracts associated to the enterprise * * @since version 0.84 * * @param $supplier Supplier object * * @return Nothing (display) **/ static function showForSupplier(Supplier $supplier) { global $DB, $CFG_GLPI; $ID = $supplier->fields['id']; if (!Session::haveRight("contract","r") || !$supplier->can($ID,'r')) { return false; } $canedit = $supplier->can($ID,'w'); $rand = mt_rand(); $query = "SELECT `glpi_contracts`.*, `glpi_contracts_suppliers`.`id` AS assocID, `glpi_entities`.`id` AS entity FROM `glpi_contracts_suppliers`, `glpi_contracts` LEFT JOIN `glpi_entities` ON (`glpi_entities`.`id`=`glpi_contracts`.`entities_id`) WHERE `glpi_contracts_suppliers`.`suppliers_id` = '$ID' AND `glpi_contracts_suppliers`.`contracts_id`=`glpi_contracts`.`id`". getEntitiesRestrictRequest(" AND", "glpi_contracts", '', '', true)." ORDER BY `glpi_entities`.`completename`, `glpi_contracts`.`name`"; $result = $DB->query($query); $contracts = array(); $used = array(); if ($number = $DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $contracts[$data['assocID']] = $data; $used[$data['id']] = $data['id']; } } if ($canedit) { echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
".__('Add a contract')."
"; Contract::dropdown(array('used' => $used, 'entity' => $supplier->fields["entities_id"], 'entity_sons' => $supplier->fields["is_recursive"], 'nochecklimit' => true)); echo ""; echo ""; echo "
"; Html::closeForm(); echo "
"; } echo "
"; if ($canedit && $number) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $massiveactionparams = array('num_displayed' => $number); Html::showMassiveActions(__CLASS__, $massiveactionparams); } echo ""; echo ""; if ($canedit && $number) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $used = array(); foreach ($contracts as $data) { $cID = $data["id"]; $used[$cID] = $cID; $assocID = $data["assocID"]; echo ""; if ($canedit) { echo ""; } $name = $data["name"]; if ($_SESSION["glpiis_ids_visible"] || empty($data["name"])) { $name = sprintf(__('%1$s (%2$s)'), $name, $data["id"]); } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
".Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand)."".__('Name')."".__('Entity').""._x('phone', 'Number')."".__('Contract type')."".__('Start date')."".__('Initial contract period')."
"; Html::showMassiveActionCheckBox(__CLASS__, $data["assocID"]); echo " ".$name.""; echo "".Dropdown::getDropdownName("glpi_entities", $data["entity"]); echo "".$data["num"]."". Dropdown::getDropdownName("glpi_contracttypes",$data["contracttypes_id"])."".Html::convDate($data["begin_date"]).""; sprintf(_n('%d month', '%d months', $data["duration"]), $data["duration"]); if (($data["begin_date"] != '') && !empty($data["begin_date"])) { echo " -> ".Infocom::getWarrantyExpir($data["begin_date"], $data["duration"], 0, true); } echo "
"; if ($canedit && $number) { $massiveactionparams['ontop'] =false; Html::showMassiveActions(__CLASS__, $massiveactionparams); Html::closeForm(); } echo "
"; } /** * Print the HTML array of suppliers for this contract * * @since version 0.84 * * @param $contract Contract object * * @return Nothing (HTML display) **/ static function showForContract(Contract $contract) { global $DB, $CFG_GLPI; $instID = $contract->fields['id']; if (!$contract->can($instID,'r') || !Session::haveRight("contact_enterprise","r")) { return false; } $canedit = $contract->can($instID,'w'); $rand = mt_rand(); $query = "SELECT `glpi_contracts_suppliers`.`id`, `glpi_suppliers`.`id` AS entID, `glpi_suppliers`.`name` AS name, `glpi_suppliers`.`website` AS website, `glpi_suppliers`.`phonenumber` AS phone, `glpi_suppliers`.`suppliertypes_id` AS type, `glpi_entities`.`id` AS entity FROM `glpi_contracts_suppliers`, `glpi_suppliers` LEFT JOIN `glpi_entities` ON (`glpi_entities`.`id`=`glpi_suppliers`.`entities_id`) WHERE `glpi_contracts_suppliers`.`contracts_id` = '$instID' AND `glpi_contracts_suppliers`.`suppliers_id`=`glpi_suppliers`.`id`". getEntitiesRestrictRequest(" AND","glpi_suppliers",'','',true). " ORDER BY `glpi_entities`.`completename`, `name`"; $result = $DB->query($query); $suppliers = array(); $used = array(); if ($number = $DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $suppliers[$data['id']] = $data; $used[$data['entID']] = $data['entID']; } } if ($canedit) { echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
".__('Add a supplier')."
"; Supplier::dropdown(array('used' => $used, 'entity' => $contract->fields["entities_id"], 'entity_sons' => $contract->fields["is_recursive"])); echo ""; echo ""; echo "
"; Html::closeForm(); echo "
"; } echo "
"; if ($canedit && $number) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $massiveactionparams = array('num_displayed' => $number); Html::showMassiveActions(__CLASS__, $massiveactionparams); } echo ""; echo ""; if ($canedit && $number) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $used = array(); foreach ($suppliers as $data) { $ID = $data['id']; $website = $data['website']; if (!empty($website)) { if (!preg_match("?https*://?",$website)) { $website = "http://".$website; } $website = "".$data['website'].""; } $entID = $data['entID']; $entity = $data['entity']; $used[$entID] = $entID; $entname = Dropdown::getDropdownName("glpi_suppliers", $entID); echo ""; if ($canedit) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
".Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand)."".__('Supplier')."".__('Entity')."".__('Third party type')."".__('Phone')."".__('Website')."
"; Html::showMassiveActionCheckBox(__CLASS__, $data["id"]); echo ""; if ($_SESSION["glpiis_ids_visible"] || empty($entname)) { $entname = sprintf(__('%1$s (%2$s)'), $entname, $entID); } echo "".$entname; echo "".Dropdown::getDropdownName("glpi_entities",$entity).""; echo Dropdown::getDropdownName("glpi_suppliertypes", $data['type'])."".$data['phone']."".$website."
"; if ($canedit && $number) { $paramsma['ontop'] = false; Html::showMassiveActions(__CLASS__, $paramsma); Html::closeForm(); } echo "
"; } } ?> glpi-0.84.3+dfsg.1/inc/contractcost.class.php000066400000000000000000000266171226600447100207310ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// ContractCost class /// since version 0.84 class ContractCost extends CommonDBChild { // From CommonDBChild static public $itemtype = 'Contract'; static public $items_id = 'contracts_id'; public $dohistory = true; static function getTypeName($nb=0) { return _n('Cost', 'Costs', $nb); } /** * @see CommonDBChild::prepareInputForAdd() **/ function prepareInputForAdd($input) { if (empty($input['end_date']) || ($input['end_date'] == 'NULL') || ($input['end_date'] < $input['begin_date'])) { $input['end_date'] = $input['begin_date']; } return parent::prepareInputForAdd($input); } /** * @see CommonDBTM::prepareInputForUpdate() **/ function prepareInputForUpdate($input) { if (empty($input['end_date']) || ($input['end_date'] == 'NULL') || ($input['end_date'] < $input['begin_date'])) { $input['end_date'] = $input['begin_date']; } return parent::prepareInputForUpdate($input); } /** * @see CommonGLPI::getTabNameForItem() **/ function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { // can exists for template if (($item->getType() == 'Contract') && Session::haveRight("contract","r")) { if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(self::getTypeName(2), countElementsInTable('glpi_contractcosts', "contracts_id = '".$item->getID()."'")); } return self::getTypeName(2); } return ''; } /** * @param $item CommonGLPI object * @param $tabnum (default 1) * @param $withtemplate (default 0) */ static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { self::showForContract($item, $withtemplate); return true; } /** * Duplicate all costs from a contract template to its clone * * @since version 0.84 * * @param $oldid * @param $newid **/ static function cloneContract ($oldid, $newid) { global $DB; $query = "SELECT * FROM `glpi_contractcosts` WHERE `contracts_id` = '$oldid'"; foreach ($DB->request($query) as $data) { $cd = new self(); unset($data['id']); $data['contracts_id'] = $newid; $data = Toolbox::addslashes_deep($data); $cd->add($data); } } /** * Init cost for creation based on previous cost **/ function initBasedOnPrevious() { $ticket = new Ticket(); if (!isset($this->fields['contracts_id']) || !$ticket->getFromDB($this->fields['contracts_id'])) { return false; } $lastdata = $this->getLastCostForContract($this->fields['contracts_id']); if (isset($lastdata['end_date'])) { $this->fields['begin_date'] = $lastdata['end_date']; } if (isset($lastdata['cost'])) { $this->fields['cost'] = $lastdata['cost']; } if (isset($lastdata['name'])) { $this->fields['name'] = $lastdata['name']; } if (isset($lastdata['budgets_id'])) { $this->fields['budgets_id'] = $lastdata['budgets_id']; } } /** * Get last datas for a contract * * @param $contracts_id integer ID of the contract **/ function getLastCostForContract($contracts_id) { global $DB; $query = "SELECT * FROM `".$this->getTable()."` WHERE `contracts_id` = '$contracts_id' ORDER BY 'end_date' DESC, `id` DESC"; if ($result = $DB->query($query)) { return $DB->fetch_assoc($result); } return array(); } /** * Print the contract cost form * * @param $ID integer ID of the item * @param $options array options used **/ function showForm($ID, $options=array()) { if ($ID > 0) { $this->check($ID,'r'); } else { // Create item $options['contracts_id'] = $options['parent']->getField('id'); $this->check(-1,'w',$options); $this->initBasedOnPrevious(); } $this->showFormHeader($options); echo ""; echo "".__('Name').""; echo ""; echo ""; Html::autocompletionTextField($this,'name'); echo ""; echo "".__('Cost').""; echo ""; echo ""; echo ""; echo "".__('Begin date').""; echo ""; Html::showDateFormItem("begin_date", $this->fields['begin_date']); echo ""; $rowspan = 3; echo "".__('Comments').""; echo ""; echo ""; echo "\n"; echo "".__('End date').""; echo ""; Html::showDateFormItem("end_date", $this->fields['end_date']); echo ""; echo "".__('Budget').""; echo ""; Budget::dropdown(array('value' => $this->fields["budgets_id"])); echo ""; $this->showFormButtons($options); return true; } /** * Print the contract costs * * @param $contract Contract object * @param $withtemplate boolean Template or basic item (default '') * * @return Nothing (call to classes members) **/ static function showForContract(Contract $contract, $withtemplate='') { global $DB, $CFG_GLPI; $ID = $contract->fields['id']; if (!$contract->getFromDB($ID) || !$contract->can($ID, "r")) { return false; } $canedit = $contract->can($ID, "w"); echo "
"; $query = "SELECT * FROM `glpi_contractcosts` WHERE `contracts_id` = '$ID' ORDER BY `begin_date`"; $rand = mt_rand(); if ($canedit) { echo "
\n"; echo "\n"; echo "\n"; } if ($result = $DB->query($query)) { echo ""; echo ""; if ($DB->numrows($result)) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; Session::initNavigateListItems(__CLASS__, //TRANS : %1$s is the itemtype name, // %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), Contract::getTypeName(1), $contract->getName())); $total = 0; while ($data = $DB->fetch_assoc($result)) { echo ""; $name = (empty($data['name'])? sprintf(__('%1$s (%2$s)'), $data['name'], $data['id']) : $data['name']); echo ""; echo ""; echo ""; echo ""; echo ""; $total += $data['cost']; echo ""; Session::addToNavigateListItems(__CLASS__, $data['id']); } echo ""; echo "'; echo "'; } else { echo ""; } echo "
".self::getTypeName($DB->numrows($result))."
".__('Name')."".__('Begin date')."".__('End date')."".__('Budget')."".__('Cost')."
"; printf(__('%1$s %2$s'), $name, Html::showToolTip($data['comment'], array('display' => false))); if ($canedit) { echo "\n\n"; } echo "".Html::convDate($data['begin_date'])."".Html::convDate($data['end_date'])."".Dropdown::getDropdownName('glpi_budgets', $data['budgets_id'])."".Html::formatNumber($data['cost'])."
 ".__('Total cost').'".Html::formatNumber($total).'
".__('No item found')."
"; } echo "

"; } } ?> glpi-0.84.3+dfsg.1/inc/contracttype.class.php000066400000000000000000000025631226600447100207340ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class ContractType class ContractType extends CommonDropdown { static function getTypeName($nb=0) { return _n('Contract type', 'Contract types', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/crontask.class.php000066400000000000000000001375171226600447100200510ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * CronTask class */ class CronTask extends CommonDBTM{ // Specific ones static private $lockname = ''; private $timer = 0.0; private $startlog = 0; private $volume = 0; // Class constant const STATE_DISABLE = 0; const STATE_WAITING = 1; const STATE_RUNNING = 2; const MODE_INTERNAL = 1; const MODE_EXTERNAL = 2; function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'delete'; $forbidden[] = 'purge'; $forbidden[] = 'restore'; return $forbidden; } static function getTypeName($nb=0) { return _n('Automatic action', 'Automatic actions', $nb); } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('CronTaskLog', $ong, $options); return $ong; } static function canCreate() { return Session::haveRight('config', 'w'); } static function canView() { return Session::haveRight('config', 'r'); } static function canDelete() { return false; } function cleanDBonPurge() { global $DB; $query = "DELETE FROM `glpi_crontasklogs` WHERE `crontasks_id` = '".$this->fields['id']."'"; $result = $DB->query($query); } /** * Read a Crontask by its name * * Used by plugins to load its crontasks * * @param $itemtype itemtype of the crontask * @param $name name of the task * * @return true if succeed else false **/ function getFromDBbyName($itemtype, $name) { return $this->getFromDBByQuery("WHERE `".$this->getTable()."`.`name` = '$name' AND `".$this->getTable()."`.`itemtype` = '$itemtype'"); } /** * Give a task state * * @return integer 0 : task is enabled * if disable : 1: by config, 2: by system lock, 3: by plugin **/ function isDisabled() { if ($this->fields['state'] == self::STATE_DISABLE) { return 1; } if (is_file(GLPI_CRON_DIR. '/all.lock') || is_file(GLPI_CRON_DIR. '/'.$this->fields['name'].'.lock')) { // Global lock return 2; } if (!($tab = isPluginItemType($this->fields['itemtype']))) { return 0; } // Plugin case $plug = new Plugin(); if (!$plug->isActivated($tab["plugin"])) { return 3; } return 0; } /** * Start a task, timer, stat, log, ... * * @return bool : true if ok (not start by another) **/ function start() { global $DB; if (!isset($this->fields['id']) || ($DB->isSlave())) { return false; } $query = "UPDATE `".$this->getTable()."` SET `state` = '".self::STATE_RUNNING."', `lastrun` = NOW() WHERE `id` = '".$this->fields['id']."' AND `state` != '".self::STATE_RUNNING."'"; $result = $DB->query($query); if ($DB->affected_rows($result)>0) { $this->timer = microtime(true); $this->volume = 0; $log = new CronTaskLog(); $txt = sprintf(__('%1$s: %2$s'), __('Run mode'), $this->getModeName(isCommandLine() ? self::MODE_EXTERNAL : self::MODE_INTERNAL)); $this->startlog = $log->add(array('crontasks_id' => $this->fields['id'], 'date' => $_SESSION['glpi_currenttime'], 'content' => addslashes($txt), 'crontasklogs_id' => 0, 'state' => CronTaskLog::STATE_START, 'volume' => 0, 'elapsed' => 0)); return true; } return false; } /** * Set the currently proccessed volume of a running task * * @param $volume **/ function setVolume($volume) { $this->volume = $volume; } /** * Increase the currently proccessed volume of a running task * * @param $volume **/ function addVolume($volume) { $this->volume += $volume; } /** * Start a task, timer, stat, log, ... * * @param $retcode : <0 : need to run again, 0:nothing to do, >0:ok * * @return bool : true if ok (not start by another) **/ function end($retcode) { global $DB; if (!isset($this->fields['id'])) { return false; } $query = "UPDATE `".$this->getTable()."` SET `state` = '".$this->fields['state']."', `lastrun` = DATE_FORMAT(NOW(),'%Y-%m-%d %H:%i:00') WHERE `id` = '".$this->fields['id']."' AND `state` = '".self::STATE_RUNNING."'"; $result = $DB->query($query); if ($DB->affected_rows($result) > 0) { if ($retcode < 0) { $content = __('Action completed, partially processed'); } else if ($retcode > 0) { $content = __('Action completed, fully processed'); } else { $content = __('Action completed, no processing required'); } $log = new CronTaskLog(); $log->add(array('crontasks_id' => $this->fields['id'], 'date' => $_SESSION['glpi_currenttime'], 'content' => $content, 'crontasklogs_id' => $this->startlog, 'state' => CronTaskLog::STATE_STOP, 'volume' => $this->volume, 'elapsed' => (microtime(true)-$this->timer))); return true; } return false; } /** * Add a log message for a running task * * @param $content **/ function log($content) { if (!isset($this->fields['id'])) { return false; } $log = new CronTaskLog(); $content = Toolbox::substr($content, 0, 200); return $log->add(array('crontasks_id' => $this->fields['id'], 'date' => $_SESSION['glpi_currenttime'], 'content' => addslashes($content), 'crontasklogs_id' => $this->startlog, 'state' => CronTaskLog::STATE_RUN, 'volume' => $this->volume, 'elapsed' => (microtime(true)-$this->timer))); } /** * read the first task which need to be run by cron * * @param $mode >0 retrieve task configured for this mode * <0 retrieve task allowed for this mode (force, no time check) * (default 0) * @param $name one specify action (default '') * * @return false if no task to run **/ function getNeedToRun($mode=0, $name='') { global $DB; $hour = date('H'); // First core ones $query = "SELECT *, LOCATE('Plugin',itemtype) AS ISPLUGIN FROM `".$this->getTable()."` WHERE (`itemtype` NOT LIKE 'Plugin%'"; if (count($_SESSION['glpi_plugins'])) { // Only activated plugins foreach ($_SESSION['glpi_plugins'] as $plug) { $query .= " OR `itemtype` LIKE 'Plugin$plug%'"; } } $query .= ')'; if ($name) { $query .= " AND `name` = '".addslashes($name)."' "; } // In force mode if ($mode < 0) { $query .= " AND `state` != '".self::STATE_RUNNING."' AND (`allowmode` & ".(-intval($mode)).") "; } else { $query .= " AND `state` = '".self::STATE_WAITING."'"; if ($mode > 0) { $query .= " AND `mode` = '$mode' "; } // Get system lock if (is_file(GLPI_CRON_DIR. '/all.lock')) { // Global lock return false; } $locks = array(); foreach (glob(GLPI_CRON_DIR. '/*.lock') as $lock) { if (preg_match('!.*/(.*).lock$!', $lock, $reg)) { $locks[] = $reg[1]; } } if (count($locks)) { $lock = "AND `name` NOT IN ('".implode("','",$locks)."')"; } else { $lock = ''; } // Build query for frequency and allowed hour $query .= " AND ((`hourmin` < `hourmax` AND '$hour' >= `hourmin` AND '$hour' < `hourmax`) OR (`hourmin` > `hourmax` AND ('$hour' >= `hourmin` OR '$hour' < `hourmax`))) AND (`lastrun` IS NULL OR unix_timestamp(`lastrun`) + `frequency` <= unix_timestamp(now())) $lock "; } // Core task before plugins $query .= "ORDER BY ISPLUGIN, unix_timestamp(`lastrun`)+`frequency`"; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { $this->fields = $DB->fetch_assoc($result); return true; } } return false; } /** * Print the contact form * * @param $ID integer ID of the item * @param $options array * - target filename : where to go when done. * - withtemplate boolean : template or basic item * * @return Nothing (display) **/ function showForm($ID, $options=array()) { global $CFG_GLPI; if (!Session::haveRight("config","r") || !$this->getFromDB($ID)) { return false; } $this->showTabs($options); $this->showFormHeader($options); echo ""; echo "".__('Name').""; echo ""; $name = $this->fields["name"]; if ($isplug = isPluginItemType($this->fields["itemtype"])) { $name = sprintf(__('%1$s - %2$s'), $isplug["plugin"], $name); } echo $name.""; echo "".__('Comments').""; echo ""; echo ""; echo ""; echo "".__('Description').""; echo $this->getDescription($ID); echo ""; echo "".__('Run frequency').""; $this->dropdownFrequency('frequency', $this->fields["frequency"]); echo ""; $tmpstate = $this->fields["state"]; echo "".__('Status').""; if (is_file(GLPI_CRON_DIR. '/'.$this->fields["name"].'.lock') || is_file(GLPI_CRON_DIR. '/all.lock')) { echo "" . __('System lock')."
"; $tmpstate = self::STATE_DISABLE; } if ($isplug) { $plug = new Plugin(); if (!$plug->isActivated($isplug["plugin"])) { echo "" . __('Disabled plugin')."
"; $tmpstate = self::STATE_DISABLE; } } if ($this->fields["state"] == self::STATE_RUNNING) { echo "" . $this->getStateName(self::STATE_RUNNING).""; } else { self::dropdownState('state', $this->fields["state"]); } echo ""; echo "".__('Run mode').""; $modes = array(); if ($this->fields['allowmode']&self::MODE_INTERNAL) { $modes[self::MODE_INTERNAL] = self::getModeName(self::MODE_INTERNAL); } if ($this->fields['allowmode']&self::MODE_EXTERNAL) { $modes[self::MODE_EXTERNAL] = self::getModeName(self::MODE_EXTERNAL); } Dropdown::showFromArray('mode', $modes, array('value' => $this->fields['mode'])); echo ""; echo "".__('Run period').""; Dropdown::showInteger('hourmin', $this->fields['hourmin'], 0, 24); echo " -> "; Dropdown::showInteger('hourmax', $this->fields['hourmax'], 0, 24); echo ""; echo "".__('Number of days this action logs are stored').""; Dropdown::showInteger('logs_lifetime', $this->fields['logs_lifetime'], 10, 360, 10, array(0 => __('Infinite'))); echo "".__('Last run').""; if (empty($this->fields['lastrun'])) { _e('Never'); } else { echo Html::convDateTime($this->fields['lastrun']); echo " "; Html::showSimpleForm(static::getFormURL(), 'resetdate', __('Blank'), array('id' => $ID), $CFG_GLPI['root_doc']."/pics/reset.png"); } echo ""; $label = $this->getParameterDescription(); echo ""; if (empty($label)) { echo "  "; } else { echo $label." "; Dropdown::showInteger('param', $this->fields['param'],0,400,1); } echo "".__('Next run').""; if ($tmpstate == self::STATE_RUNNING) { $launch = false; } else { $launch = $this->fields['allowmode']&self::MODE_INTERNAL; } if ($tmpstate != self::STATE_WAITING) { echo $this->getStateName($tmpstate); } else if (empty($this->fields['lastrun'])) { _e('As soon as possible'); } else { $next = strtotime($this->fields['lastrun'])+$this->fields['frequency']; $h = date('H',$next); $deb = ($this->fields['hourmin'] < 10 ? "0".$this->fields['hourmin'] : $this->fields['hourmin']); $fin = ($this->fields['hourmax'] < 10 ? "0".$this->fields['hourmax'] : $this->fields['hourmax']); if (($deb < $fin) && ($h < $deb)) { $disp = date('Y-m-d', $next). " $deb:00:00"; $next = strtotime($disp); } else if (($deb < $fin) && ($h >= $this->fields['hourmax'])) { $disp = date('Y-m-d', $next+DAY_TIMESTAMP). " $deb:00:00"; $next = strtotime($disp); } if (($deb > $fin) && ($h < $deb) && ($h >= $fin)) { $disp = date('Y-m-d', $next). " $deb:00:00"; $next = strtotime($disp); } else { $disp = date("Y-m-d H:i:s", $next); } if ($next < time()) { echo __('As soon as possible').'
('.Html::convDateTime($disp).') '; } else { echo Html::convDateTime($disp); } } if ($launch) { echo " "; Html::showSimpleForm(static::getFormURL(), array('execute' => $this->fields['name']), __('Execute')); } if ($tmpstate == self::STATE_RUNNING) { Html::showSimpleForm(static::getFormURL(), 'resetstate', __('Blank'), array('id' => $ID), $CFG_GLPI['root_doc']."/pics/reset.png"); } echo ""; $this->showFormButtons($options); $this->addDivForTabs(); return true; } /** * reset the next launch date => for a launch as soon as possible **/ function resetDate () { global $DB; if (!isset($this->fields['id'])) { return false; } return $this->update(array('id' => $this->fields['id'], 'lastrun' => 'NULL')); } /** * reset the current state **/ function resetState () { global $DB; if (!isset($this->fields['id'])) { return false; } return $this->update(array('id' => $this->fields['id'], 'state' => self::STATE_WAITING)); } /** * Translate task description * * @param $id integer ID of the crontask * * @return string **/ public function getDescription($id) { if (!isset($this->fields['id']) || ($this->fields['id'] != $id)) { $this->getFromDB($id); } $hook = array($this->fields['itemtype'], 'cronInfo'); if (is_callable($hook)) { $info = call_user_func($hook, $this->fields['name']); } else { $info = false; } if (isset($info['description'])) { return $info['description']; } return $this->fields['name']; } /** * Translate task parameter description * * @return string **/ public function getParameterDescription() { $hook = array($this->fields['itemtype'], 'cronInfo'); if (is_callable($hook)) { $info = call_user_func($hook, $this->fields['name']); } else { $info = false; } if (isset($info['parameter'])) { return $info['parameter']; } return ''; } /** * Translate state to string * * @param $state integer * * @return string **/ static public function getStateName($state) { switch ($state) { case self::STATE_RUNNING : return __('Running'); case self::STATE_WAITING : return __('Scheduled'); case self::STATE_DISABLE : return __('Disabled'); } return '???'; } /** * Dropdown of state * * @param $name select name * @param $value default value (default 0) * @param $display display or get string (true by default) * * @return nothing (display) **/ static function dropdownState($name, $value=0, $display=true) { return Dropdown::showFromArray($name, array(self::STATE_DISABLE => __('Disabled'), self::STATE_WAITING => __('Scheduled')), array('value' => $value, 'display' => $display)); } /** * Translate Mode to string * * @param $mode integer * * @return string **/ static public function getModeName($mode) { switch ($mode) { case self::MODE_INTERNAL : return __('GLPI'); case self::MODE_EXTERNAL : return __('CLI'); } return '???'; } /** * Get a global database lock for cron * * @return Boolean **/ static private function get_lock() { global $DB; // Changer de nom toutes les heures en cas de blocage MySQL (ca arrive) $nom = "glpicron." . intval(time()/HOUR_TIMESTAMP-340000); if ($DB->getLock($nom)) { self::$lockname = $nom; return true; } return false; } /** * Release the global database lock **/ static private function release_lock() { global $DB; if (self::$lockname) { $DB->releaseLock(self::$lockname); self::$lockname = ''; } } /** * Launch the need cron tasks * * @param $mode (internal/external, <0 to force) * @param $max number of task to launch (default 1) * @param $name of task to run (default '') * * @return the name of last task launched **/ static public function launch($mode, $max=1, $name='') { $crontask = new self(); $taskname = ''; if (abs($mode) == self::MODE_EXTERNAL) { // If cron is launched in command line, and if memory is insufficient, // display a warning in the logs if (Toolbox::checkMemoryLimit() == 2) { Toolbox::logInFile('cron', __('A minimum of 64 Mio is commonly required for GLPI.')."\n"); } // If no task in CLI mode, call cron.php from command line is not really usefull ;) if (!countElementsInTable($crontask->getTable(), "`mode` = '".abs($mode)."'")) { Toolbox::logInFile('cron', __('No task with Run mode = CLI, fix your tasks configuration')."\n"); } } if (self::get_lock()) { for ($i=1 ; $i<=$max ; $i++) { $prefix = (abs($mode) == self::MODE_EXTERNAL ? __('External') : __('Internal')); if ($crontask->getNeedToRun($mode, $name)) { $_SESSION["glpicronuserrunning"] = "cron_".$crontask->fields['name']; if ($plug = isPluginItemType($crontask->fields['itemtype'])) { Plugin::load($plug['plugin'], true); } $fonction = array($crontask->fields['itemtype'], 'cron' . $crontask->fields['name']); if (is_callable($fonction)) { if ($crontask->start()) { // Lock in DB + log start $taskname = $crontask->fields['name']; //TRANS: %1$s is mode (external or internal), %2$s is an order number, $msgcron = sprintf(__('%1$s #%2$s'), $prefix, $i); $msgcron = sprintf(__('%1$s: %2$s'), $msgcron, sprintf(__('%1$s %2$s')."\n", __('Launch'), $crontask->fields['name'])); Toolbox::logInFile('cron', $msgcron); $retcode = call_user_func($fonction, $crontask); $crontask->end($retcode); // Unlock in DB + log end } else { $msgcron = sprintf(__('%1$s #%2$s'), $prefix, $i); $msgcron = sprintf(__('%1$s: %2$s'), $msgcron, sprintf(__('%1$s %2$s')."\n", __("Can't start"), $crontask->fields['name'])); Toolbox::logInFile('cron', $msgcron); } } else { if (is_array($fonction)) { $fonction = implode('::',$fonction); } Toolbox::logInFile('php-errors', sprintf(__('Undefined function %s (for cron)')."\n", $fonction)); $msgcron = sprintf(__('%1$s #%2$s'), $prefix, $i); $msgcron = sprintf(__('%1$s: %2$s'), $msgcron, sprintf(__('%1$s %2$s')."\n", __("Can't start"), $crontask->fields['name'])); Toolbox::logInFile('cron', $msgcron ."\n". sprintf(__('Undefined function %s (for cron)')."\n", $fonction)); } } else if ($i==1) { $msgcron = sprintf(__('%1$s #%2$s'), $prefix, $i); $msgcron = sprintf(__('%1$s: %2$s'), $msgcron, __('Nothing to launch')); Toolbox::logInFile('cron', $msgcron."\n"); } } // end for $_SESSION["glpicronuserrunning"]=''; self::release_lock(); } else { Toolbox::logInFile('cron', __("Can't get DB lock")."\n"); } return $taskname; } /** * Register new task for plugin (called by plugin during install) * * @param $itemtype itemtype of the plugin object * @param $name of the task * @param $frequency of execution * @param $options array of optional options * (state, mode, allowmode, hourmin, hourmax, logs_lifetime, param, comment) * * @return bool for success **/ static public function Register($itemtype, $name, $frequency, $options=array()) { // Check that hook exists if (!isPluginItemType($itemtype)) { return false; } $temp = new self(); // Avoid duplicate entry if ($temp->getFromDBbyName($itemtype, $name)) { return false; } $input = array('itemtype' => $itemtype, 'name' => $name, 'frequency' => $frequency); foreach (array('allowmode', 'comment', 'hourmax', 'hourmin', 'logs_lifetime', 'mode', 'param', 'state') as $key) { if (isset($options[$key])) { $input[$key] = $options[$key]; } } return $temp->add($input); } /** * Unregister tasks for a plugin (call by glpi after uninstall) * * @param $plugin : name of the plugin * * @return bool for success **/ static public function Unregister($plugin) { global $DB; if (empty($plugin)) { return false; } $temp = new CronTask(); $ret = true; $query = "SELECT * FROM `glpi_crontasks` WHERE `itemtype` LIKE 'Plugin$plugin%'"; $result = $DB->query($query); if ($DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { if (!$temp->delete($data)) { $ret = false; } } } return $ret; } /** * Display statistics of a task * * @return nothing **/ function showStatistics() { global $DB, $CFG_GLPI; echo "
"; echo ""; echo "\n"; $nbstart = countElementsInTable('glpi_crontasklogs', "`crontasks_id` = '".$this->fields['id']."' AND `state` = '".CronTaskLog::STATE_START."'"); $nbstop = countElementsInTable('glpi_crontasklogs', "`crontasks_id` = '".$this->fields['id']."' AND `state` = '".CronTaskLog::STATE_STOP."'"); echo ""; if ($nbstop) { $query = "SELECT MIN(`date`) AS datemin, MIN(`elapsed`) AS elapsedmin, MAX(`elapsed`) AS elapsedmax, AVG(`elapsed`) AS elapsedavg, SUM(`elapsed`) AS elapsedtot, MIN(`volume`) AS volmin, MAX(`volume`) AS volmax, AVG(`volume`) AS volavg, SUM(`volume`) AS voltot FROM `glpi_crontasklogs` WHERE `crontasks_id` = '".$this->fields['id']."' AND `state` = '".CronTaskLog::STATE_STOP."'"; $result = $DB->query($query); if ($data = $DB->fetch_assoc($result)) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } if ($data && ($data['voltot'] > 0)) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } } echo "
 ".__('Statistics')."
".__('Run count').""; if ($nbstart == $nbstop) { echo $nbstart; } else { // This should not appen => task crash ? //TRANS: %s is the number of starts printf(_n('%s start', '%s starts', $nbstart), $nbstart); echo "
"; //TRANS: %s is the number of stops printf(_n('%s stop', '%s stops', $nbstop), $nbstop); } echo "
".__('Start date')."".Html::convDateTime($data['datemin'])."
".__('Minimal time')."".sprintf(_n('%s second', '%s seconds', $data['elapsedmin']), number_format($data['elapsedmin'], 2)); echo "
".__('Maximal time')."".sprintf(_n('%s second', '%s seconds', $data['elapsedmax']), number_format($data['elapsedmax'], 2)); echo "
".__('Average time')."".sprintf(_n('%s second', '%s seconds', $data['elapsedavg']), number_format($data['elapsedavg'],2)); echo "
".__('Total duration')."".sprintf(_n('%s second', '%s seconds', $data['elapsedtot']), number_format($data['elapsedtot'],2)); echo "
".__('Minimal count')."".sprintf(_n('%s item', '%s items', $data['volmin']), $data['volmin'])."
".__('Maximal count')."".sprintf(_n('%s item', '%s items', $data['volmax']), $data['volmax'])."
".__('Average count')."".sprintf(_n('%s item', '%s items', $data['volavg']), number_format($data['volavg'],2)). "
".__('Total count')."". sprintf(_n('%s item', '%s items',$data['voltot']), $data['voltot'])."
".__('Average speed')."".sprintf(__('%s items/sec'), number_format($data['voltot']/$data['elapsedtot'],2)); echo "
"; } /** * Display list of a runned tasks * * @return nothing **/ function showHistory() { global $DB, $CFG_GLPI; if (isset($_POST["crontasklogs_id"]) && $_POST["crontasklogs_id"]) { return $this->showHistoryDetail($_POST["crontasklogs_id"]); } if (isset($_POST["start"])) { $start = $_POST["start"]; } else { $start = 0; } // Total Number of events $number = countElementsInTable('glpi_crontasklogs', "`crontasks_id` = '".$this->fields['id']."' AND `state` = '".CronTaskLog::STATE_STOP."'"); echo "
"; if ($number < 1) { echo ""; echo ""; echo "
".__('No item found')."
"; echo "
"; return; } // Display the pager Html::printAjaxPager(__('Last run list'), $start, $number); $query = "SELECT * FROM `glpi_crontasklogs` WHERE `crontasks_id` = '".$this->fields['id']."' AND `state` = '".CronTaskLog::STATE_STOP."' ORDER BY `id` DESC LIMIT ".intval($start)."," . intval($_SESSION['glpilist_limit']); if ($result = $DB->query($query)) { if ($data = $DB->fetch_assoc($result)) { echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; do { echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; } while ($data = $DB->fetch_assoc($result)); echo "
".__('Date')."".__('Total duration').""._x('quantity', 'Number')."".__('Description')."
".Html::convDateTime($data['date']). "".sprintf(_n('%s second','%s seconds', intval($data['elapsed'])), number_format($data['elapsed'], 3)). "   ".$data['volume']."".$data['content']."
"; } else { // Not found _e('No item found'); } } // Query Html::printAjaxPager(__('Last run list'), $start, $number); echo ""; } /** * Display detail of a runned task * * @param $logid : crontasklogs_id * * @return nothing **/ function showHistoryDetail($logid) { global $DB, $CFG_GLPI; echo "
"; echo "

".__('Last run list')."". "

"; $query = "SELECT * FROM `glpi_crontasklogs` WHERE `id` = '$logid' OR `crontasklogs_id` = '$logid' ORDER BY `id` ASC"; if ($result = $DB->query($query)) { if ($data = $DB->fetch_assoc($result)) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $first = true; do { echo ""; echo ""; switch ($data['state']) { case CronTaskLog::STATE_START : echo ""; break; case CronTaskLog::STATE_STOP : echo ""; break; default : echo ""; } echo ""; echo ""; echo ""; echo "\n"; $first = false; } while ($data = $DB->fetch_assoc($result)); echo "
".__('Date')."".__('Status')."". __('Duration').""._x('quantity', 'Number')."".__('Description')."
".($first ? Html::convDateTime($data['date']) : " ")."".__('Start')."".__('End')."".__('Running')."".sprintf(_n('%s second', '%s seconds', intval($data['elapsed'])), number_format($data['elapsed'], 3)). "  ".$data['volume']."".$data['content']."
"; } else { // Not found _e('No item found'); } } // Query echo "
"; } /** * @since version 0.84 * * @param $field * @param $name (default '') * @param $values (default '') * @param $options array **/ static function getSpecificValueToSelect($field, $name='', $values='', array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } $options['display'] = 0; switch ($field) { case 'mode': $options['value'] = $values[$field]; $tab[self::MODE_INTERNAL] = self::getModeName(self::MODE_INTERNAL); $tab[self::MODE_EXTERNAL] = self::getModeName(self::MODE_EXTERNAL); return Dropdown::showFromArray($name, $tab, $options); case 'state' : return CronTask::dropdownState($name, $values[$field], false); } return parent::getSpecificValueToSelect($field, $name, $values, $options); } static function getSpecificValueToDisplay($field, $values, array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } switch ($field) { case 'mode': return self::getModeName($values[$field]); case 'state': return self::getStateName($values[$field]); } return parent::getSpecificValueToDisplay($field, $values, $options); } /** * @see CommonDBTM::getSpecificMassiveActions() **/ function getSpecificMassiveActions($checkitem=NULL) { $isadmin = static::canUpdate(); $actions = parent::getSpecificMassiveActions($checkitem); if ($isadmin) { $actions['reset'] = __('Reset last run'); } return $actions; } /** * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case 'reset' : if (Session::haveRight('config', 'w')) { foreach ($input["item"] as $key => $val) { if (($val == 1) && $this->getFromDB($key)) { if ($this->resetDate()) { $res['ok']++; } else { $res['ko']++; } } else { $res['ko']++; } } } else { $res['noright']++; } break; default : return parent::doSpecificMassiveActions($input); } return $res; } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'description'; $tab[3]['name'] = __('Description'); $tab[3]['nosearch'] = true; $tab[3]['nosort'] = true; $tab[3]['massiveaction'] = false; $tab[3]['datatype'] = 'text'; $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'state'; $tab[4]['name'] = __('Status'); $tab[4]['searchtype'] = array('equals'); $tab[4]['massiveaction'] = false; $tab[4]['datatype'] = 'specific'; $tab[5]['table'] = $this->getTable(); $tab[5]['field'] = 'mode'; $tab[5]['name'] = __('Run mode'); $tab[5]['datatype'] = 'specific'; $tab[6]['table'] = $this->getTable(); $tab[6]['field'] = 'frequency'; $tab[6]['name'] = __('Run frequency'); $tab[6]['datatype'] = 'timestamp'; $tab[6]['massiveaction'] = false; $tab[7]['table'] = $this->getTable(); $tab[7]['field'] = 'lastrun'; $tab[7]['name'] = __('Last run'); $tab[7]['datatype'] = 'datetime'; $tab[7]['massiveaction'] = false; $tab[8]['table'] = $this->getTable(); $tab[8]['field'] = 'itemtype'; $tab[8]['name'] = __('Item type'); $tab[8]['massiveaction'] = false; $tab[8]['datatype'] = 'itemtypename'; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab[17]['table'] = $this->getTable(); $tab[17]['field'] = 'hourmin'; $tab[17]['name'] = __('Begin hour of run period'); $tab[17]['datatype'] = 'integer'; $tab[17]['min'] = 0; $tab[17]['max'] = 24; $tab[18]['table'] = $this->getTable(); $tab[18]['field'] = 'hourmax'; $tab[18]['name'] = __('End hour of run period'); $tab[18]['datatype'] = 'integer'; $tab[18]['min'] = 0; $tab[18]['max'] = 24; $tab[19]['table'] = $this->getTable(); $tab[19]['field'] = 'logs_lifetime'; $tab[19]['name'] = __('Number of days this action logs are stored'); $tab[19]['datatype'] = 'integer'; $tab[19]['min'] = 10; $tab[19]['max'] = 360; $tab[19]['step'] = 10; $tab[19]['toadd'] = array(0 => __('Infinite')); return $tab; } /** * Garbage collector for expired file session * * @param $task for log **/ static function cronSession($task) { // max time to keep the file session $maxlifetime = session_cache_expire(); $nb = 0; foreach (glob(GLPI_SESSION_DIR."/sess_*") as $filename) { if ((filemtime($filename) + $maxlifetime) < time()) { // Delete session file if not delete before if (@unlink($filename)) { $nb++; } } } $task->setVolume($nb); if ($nb) { //TRANS: % %1$d is a number, %2$s is a number of seconds $task->log(sprintf(_n('Clean %1$d session file created since more than %2$s seconds', 'Clean %1$d session files created since more than %2$s seconds', $nb)."\n", $nb, $maxlifetime)); return 1; } return 0; } /** * Garbage collector for cleaning graph files * * @param $task for log **/ static function cronGraph($task) { global $CFG_GLPI; // max time to keep the file session $maxlifetime = HOUR_TIMESTAMP; $nb = 0; foreach (glob(GLPI_GRAPH_DIR."/*") as $filename) { if ((filemtime($filename) + $maxlifetime) < time()) { // Delete session file if not delete before if (@unlink($filename)) { $nb++; } } } $task->setVolume($nb); if ($nb) { $task->log(sprintf(_n('Clean %1$d graph file created since more than %2$s seconds', 'Clean %1$d graph files created since more than %2$s seconds', $nb)."\n", $nb, $maxlifetime)); return 1; } return 0; } /** * Clean log cron function * * @param $task instance of CronTask **/ static function cronLogs($task) { global $DB; $vol = 0; // Expire Event Log if ($task->fields['param'] > 0) { $vol += Event::cleanOld($task->fields['param']); } foreach ($DB->request('glpi_crontasks') as $data) { if ($data['logs_lifetime']>0) { $vol += CronTaskLog::cleanOld($data['id'], $data['logs_lifetime']); } } $task->setVolume($vol); return ($vol > 0 ? 1 : 0); } /** * Cron job to check if a new version is available * * @param $task for log **/ static function cronCheckUpdate($task) { $result = Toolbox::checkNewVersionAvailable(1); $task->log($result); return 1; } /** * Clean log cron function * * @param $task for log **/ static function cronOptimize($task) { $nb = DBmysql::optimize_tables(NULL, true); $task->setVolume($nb); return 1; } /** * Check zombie crontask * * @param $task for log **/ static function cronWatcher($task) { global $CFG_GLPI, $DB; $cron_status = 0; // Crontasks running for more than 1 hour or 2 frequency $query = "SELECT * FROM `glpi_crontasks` WHERE `state` = '".self::STATE_RUNNING."' AND ((unix_timestamp(`lastrun`) + 2 * `frequency` < unix_timestamp(now())) OR (unix_timestamp(`lastrun`) + 2*".HOUR_TIMESTAMP." < unix_timestamp(now())))"; $crontasks = array(); foreach ($DB->request($query) as $data) { $crontasks[$data['id']] = $data; } if (count($crontasks)) { if (NotificationEvent::raiseEvent("alert", new Crontask(), array('items' => $crontasks))) { $cron_status = 1; $task->addVolume(1); } } return 1; } /** * get Cron description parameter for this class * * @param $name string name of the task * * @return array of string **/ static function cronInfo($name) { switch ($name) { case 'checkupdate' : return array('description' => __('Check for new updates')); case 'logs' : return array('description' => __('Clean old logs'), 'parameter' => __('System logs retention period (in days, 0 for infinite)')); case 'optimize' : return array('description' => __('Database optimization')); case 'session' : return array('description' => __('Clean expired sessions')); case 'graph' : return array('description' => __('Clean generated graphics')); case 'watcher' : return array('description' => __('Monitoring of automatic actions')); } } /** * Dropdown for frequency (interval between 2 actions) * * @param $name select name * @param $value default value (default 0) **/ function dropdownFrequency($name, $value=0) { $tab = array(); $tab[MINUTE_TIMESTAMP] = sprintf(_n('%d minute','%d minutes',1),1); // Minutes for ($i=5 ; $i<60 ; $i+=5) { $tab[$i*MINUTE_TIMESTAMP] = sprintf(_n('%d minute','%d minutes',$i), $i); } // Heures for ($i=1 ; $i<24 ; $i++) { $tab[$i*HOUR_TIMESTAMP] = sprintf(_n('%d hour','%d hours',$i), $i); } // Jours $tab[DAY_TIMESTAMP] = __('Each day'); for ($i=2 ; $i<7 ; $i++) { $tab[$i*DAY_TIMESTAMP] = sprintf(_n('%d day','%d days',$i),$i); } $tab[WEEK_TIMESTAMP] = __('Each week'); $tab[MONTH_TIMESTAMP] = __('Each month'); Dropdown::showFromArray($name, $tab, array('value' => $value)); } /** * Call cron without time check * * @return boolean : true if launched **/ static function callCronForce() { global $CFG_GLPI; $path = $CFG_GLPI['root_doc']."/front/cron.php"; echo "
"; return true; } /** * Call cron if time since last launch elapsed * * @return nothing **/ static function callCron() { if (isset($_SESSION["glpicrontimer"])) { // call static function callcron() every 5min if ((time() - $_SESSION["glpicrontimer"]) > 300) { if (self::callCronForce()) { // Restart timer $_SESSION["glpicrontimer"] = time(); } } } else { // Start timer $_SESSION["glpicrontimer"] = time(); } } } ?> glpi-0.84.3+dfsg.1/inc/crontasklog.class.php000066400000000000000000000061641226600447100205440ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * CronTaskLog class **/ class CronTaskLog extends CommonDBTM{ // Class constant const STATE_START = 0; const STATE_RUN = 1; const STATE_STOP = 2; /** * Clean old event for a task * * @param $id integer ID of the CronTask * @param $days integer number of day to keep * * @return integer number of events deleted **/ static function cleanOld($id, $days) { global $DB; $secs = $days * DAY_TIMESTAMP; $query_exp = "DELETE FROM `glpi_crontasklogs` WHERE `crontasks_id` = '$id' AND UNIX_TIMESTAMP(date) < UNIX_TIMESTAMP()-$secs"; $DB->query($query_exp); return $DB->affected_rows(); } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { switch ($item->getType()) { case 'CronTask' : $ong = array(); $ong[1] = __('Statistics'); if ($_SESSION['glpishow_count_on_tabs']) { $ong[2] = self::createTabEntry(_n('Log', 'Logs', 2), countElementsInTable($this->getTable(), "crontasks_id = '".$item->getID()."' AND `state` = '".self::STATE_STOP."' ")); } else { $ong[2] = _n('Log', 'Logs', 2); } return $ong; } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType()=='CronTask') { switch ($tabnum) { case 1 : $item->showStatistics(); break; case 2 : $item->showHistory(); break; } } return true; } } ?> glpi-0.84.3+dfsg.1/inc/db.function.php000066400000000000000000001302611226600447100173170ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Return foreign key field name for a table * * @param $table string table name * * @return string field name used for a foreign key to the parameter table **/ function getForeignKeyFieldForTable($table) { if (strpos($table,'glpi_') === false) { return ""; } return str_replace("glpi_","",$table)."_id"; } /** * Check if field is a foreign key field * * @since version 0.84 * * @param $field string field name * * @return string field name used for a foreign key to the parameter table **/ function isForeignKeyField($field) { // No _id drop if (strpos($field,'_id') === false) { return false; } return preg_match("/_id$/", $field) || preg_match("/_id_/", $field); } /** * Return foreign key field name for an itemtype * * @param $itemtype string itemtype * * @return string field name used for a foreign key to the parameter itemtype **/ function getForeignKeyFieldForItemType($itemtype) { return getForeignKeyFieldForTable(getTableForItemType($itemtype)); } /** * Return table name for a given foreign key name * * @param $fkname string foreign key name * * @return string table name corresponding to a foreign key name **/ function getTableNameForForeignKeyField($fkname) { if (strpos($fkname,'_id') === false) { return ""; } // If $fkname begin with _ strip it if ($fkname[0] == '_') { $fkname = substr($fkname, 1); } return "glpi_".preg_replace("/_id.*/", "", $fkname); } /** * Return ItemType for a table * * @param $table string table name * * @return string itemtype corresponding to a table name parameter **/ function getItemTypeForTable($table) { global $CFG_GLPI; if (isset($CFG_GLPI['glpiitemtypetables'][$table])) { return $CFG_GLPI['glpiitemtypetables'][$table]; } else { $inittable = $table; $table = str_replace("glpi_", "", $table); $prefix = ""; if (preg_match('/^plugin_([a-z0-9]+)_/',$table,$matches)) { $table = preg_replace('/^plugin_[a-z0-9]+_/','',$table); $prefix = "Plugin".Toolbox::ucfirst($matches[1]); } if (strstr($table,'_')) { $split = explode('_', $table); foreach ($split as $key => $part) { $split[$key] = Toolbox::ucfirst(getSingular($part)); } $table = implode('_',$split); } else { $table = Toolbox::ucfirst(getSingular($table)); } $itemtype = $prefix.$table; // Get real existence of itemtype if ($item = getItemForItemtype($itemtype)) { $itemtype = get_class($item); $CFG_GLPI['glpiitemtypetables'][$inittable] = $itemtype; $CFG_GLPI['glpitablesitemtype'][$itemtype] = $inittable; return $itemtype; } return "UNKNOWN"; } } /** * Return ItemType for a table * * @param $itemtype string itemtype * * @return string table name corresponding to the itemtype parameter **/ function getTableForItemType($itemtype) { global $CFG_GLPI; // Force singular for itemtype : States case $itemtype = getSingular($itemtype); if (isset($CFG_GLPI['glpitablesitemtype'][$itemtype])) { return $CFG_GLPI['glpitablesitemtype'][$itemtype]; } else { $prefix = "glpi_"; if ($plug = isPluginItemType($itemtype)) { $prefix .= "plugin_".strtolower($plug['plugin'])."_"; $table = strtolower($plug['class']); } else { $table = strtolower($itemtype); } if (strstr($table,'_')) { $split = explode('_',$table); foreach ($split as $key => $part) { $split[$key] = getPlural($part); } $table = implode('_',$split); } else { $table = getPlural($table); } $CFG_GLPI['glpitablesitemtype'][$itemtype] = $prefix.$table; $CFG_GLPI['glpiitemtypetables'][$prefix.$table] = $itemtype; return $prefix.$table; } } /** * Get new item objet for an itemtype * * @since version 0.83 * * @param $itemtype string itemtype * * @return itemtype object or false if class does not exists **/ function getItemForItemtype($itemtype) { if (class_exists($itemtype)) { return new $itemtype(); } return false; } /** * Return the plural of a string * * @param $string string input string * * @return string plural of the parameter string **/ function getPlural($string) { $rules = array(//'singular' => 'plural' 'criterias$' =>'criterias',// Special case (criterias) when getPLural is called on already plural form 'ch$' =>'ches', 'ches$' =>'ches', 'sh$' =>'shes', 'shes$' =>'shes', 'sses$' => 'sses', // Case like addresses 'ss$' => 'sses', // Special case (addresses) when getSingular is called on already singular form 'uses$' => 'uses', // Case like statuses 'us$' => 'uses', // Case like status '([^aeiou])y$' => '\1ies', // special case : category (but not key) '([^aeiou])ies$' => '\1ies', // special case : category (but not key) '([aeiou]{2})ses$' => '\1ses', // Case like aliases '([aeiou]{2})s$' => '\1ses', // Case like aliases 'x$' =>'xes', // 's$' =>'ses', '([^s])$' => '\1s', // Add at the end if not exists ); foreach ($rules as $singular => $plural) { $string = preg_replace("/$singular/", "$plural", $string, -1, $count); if ($count > 0) { break; } } return $string; } /** * Return the singular of a string * * @param $string string input string * * @return string singular of the parameter string **/ function getSingular($string) { $rules = array(//'plural' => 'singular' 'ches$' => 'ch', 'ch$' => 'ch', 'shes$' => 'sh', 'sh$' => 'sh', 'sses$' => 'ss', // Case like addresses 'ss$' => 'ss', // Special case (addresses) when getSingular is called on already singular form 'uses$' => 'us', // Case like statuses 'us$' => 'us', // Case like status '([aeiou]{2})ses$' => '\1s', // Case like aliases 'lias$' => 'lias', // Special case (aliases) when getSingular is called on already singular form '([^aeiou])ies$' => '\1y', // special case : category '([^aeiou])y$' => '\1y', // special case : category 'xes$' =>'x', 's$' => ''); // Add at the end if not exists foreach ($rules as $plural => $singular) { $string = preg_replace("/$plural/", "$singular", $string, -1, $count); if ($count > 0) { break; } } return $string; } /** * Is a table used for devices * * @param $tablename table name * * @return bool **/ function isDeviceTable($tablename) { // begin by glpi_devices but Not types tables (end = types) return (preg_match('/^glpi_devices', $tablename) && !preg_match('/types$', $tablename)); } /** * Count the number of elements in a table. * * @param $table string/array table names * @param $condition string condition to use (default '') * * @return int nb of elements in table **/ function countElementsInTable($table, $condition="") { global $DB; if (is_array($table)) { $table = implode('`,`',$table); } $query = "SELECT COUNT(*) AS cpt FROM `$table`"; if (!empty($condition)) { $query .= " WHERE $condition "; } $result = $DB->query($query); $ligne = $DB->fetch_assoc($result); return $ligne['cpt']; } /** * Count the number of elements in a table for a specific entity * * @param $table string table name * @param $condition string additional condition (default '') * * @return int nb of elements in table **/ function countElementsInTableForMyEntities($table, $condition='') { /// TODO clean it / maybe include when review of SQL requests $itemtype = getItemTypeForTable($table); $item = new $itemtype(); if (!empty($condition)) { $condition .= " AND "; } $condition .= getEntitiesRestrictRequest("", $table, '', '', $item->maybeRecursive()); return countElementsInTable($table, $condition); } /** * Count the number of elements in a table for a specific entity * * @param $table string table name * @param $entity integer the entity ID * @param $condition string additional condition (default '') * * @return int nb of elements in table **/ function countElementsInTableForEntity($table, $entity, $condition='') { /// TODO clean it / maybe include when review of SQL requests $itemtype = getItemTypeForTable($table); $item = new $itemtype(); if (!empty($condition)) { $condition .= " AND "; } $condition .= getEntitiesRestrictRequest("", $table, '', $entity,$item->maybeRecursive()); return countElementsInTable($table, $condition); } /** * Get datas from a table in an array : * CAUTION TO USE ONLY FOR SMALL TABLES OR USING A STRICT CONDITION * * @param $table string table name * @param $condition string condition to use (default '') * @param $usecache boolean (false by default) * @param $order string result order (default '') * * @return array containing all the datas **/ function getAllDatasFromTable($table, $condition='', $usecache=false, $order='') { global $DB; static $cache = array(); if (empty($condition) && empty($order) && $usecache && isset($cache[$table])) { return $cache[$table]; } $datas = array(); $query = "SELECT * FROM `$table` "; if (!empty($condition)) { $query .= " WHERE $condition "; } if (!empty($order)) { $query .= " ORDER BY $order "; } if ($result = $DB->query($query)) { while ($data = $DB->fetch_assoc($result)) { $datas[$data['id']] = $data; } } if (empty($condition) && empty($order) && $usecache) { $cache[$table] = $datas; } return $datas; } /** * Get the Name of the element of a Dropdown Tree table * * @param $table string Dropdown Tree table * @param $ID integer ID of the element * @param $withcomment boolean 1 if you want to give the array with the comments (false by default) * * @return string : name of the element * * @see getTreeValueCompleteName **/ function getTreeLeafValueName($table, $ID, $withcomment=false) { global $DB; $name = ""; $comment = ""; $query = "SELECT * FROM `$table` WHERE `id` = '$ID'"; if ($result = $DB->query($query)) { if ($DB->numrows($result) == 1) { $name = $DB->result($result, 0, "name"); $comment = $DB->result($result, 0, "comment"); } } if ($withcomment) { return array("name" => $name, "comment" => $comment); } return $name; } /** * Get completename of a Dropdown Tree table * * @param $table string Dropdown Tree table * @param $ID integer ID of the element * @param $withcomment boolean 1 if you want to give the array with the comments (false by default) * * @return string : completename of the element * * @see getTreeLeafValueName **/ function getTreeValueCompleteName($table, $ID, $withcomment=false) { global $DB; $name = ""; $comment = ""; $query = "SELECT * FROM `$table` WHERE `id` = '$ID'"; if ($result = $DB->query($query)) { if ($DB->numrows($result) == 1) { $name = $DB->result($result,0,"completename"); $comment = sprintf(__('%1$s: %2$s')."
", "".__('Complete name'), "".$name); $comment .= "".__('Comments')." ". nl2br($DB->result($result, 0, "comment")); } } if (empty($name)) { $name = " "; } if ($withcomment) { return array("name" => $name, "comment" => $comment); } return $name; } /** * show name category * DO NOT DELETE THIS FUNCTION : USED IN THE UPDATE * * @param $table string table name * @param $ID integer value ID * @param $wholename string current name to complete (use for recursivity) (default '') * @param $level integer current level of recursion (default 0) * * @return string name **/ function getTreeValueName($table, $ID, $wholename="", $level=0) { global $DB; $parentIDfield = getForeignKeyFieldForTable($table); $query = "SELECT `name`, `$parentIDfield` FROM `$table` WHERE `id` = '$ID'"; $name = ""; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { $row = $DB->fetch_assoc($result); $parentID = $row[$parentIDfield]; if ($wholename == "") { $name = $row["name"]; } else { $name = $row["name"] . " > "; } $level++; list($tmpname, $level) = getTreeValueName($table, $parentID, $name, $level); $name = $tmpname. $name; } } return array($name, $level); } /** * Get the ancestors of an item in a tree dropdown * * @param $table string table name * @param $items_id integer The ID of the item * * @return array of IDs of the ancestors **/ function getAncestorsOf($table, $items_id) { global $DB; // IDs to be present in the final array $id_found = array(); $parentIDfield = getForeignKeyFieldForTable($table); $use_cache = FieldExists($table, "ancestors_cache"); if ($use_cache && ($items_id > 0)) { $query = "SELECT `ancestors_cache`, `$parentIDfield` FROM `$table` WHERE `id` = '$items_id'"; if (($result = $DB->query($query)) && ($DB->numrows($result) > 0)) { $ancestors = trim($DB->result($result, 0, 0)); $parent = $DB->result($result, 0, 1); // Return datas from cache in DB if (!empty($ancestors)) { return importArrayFromDB($ancestors, true); } // Recursive solution for table with-cache if ($parent > 0) { $id_found = getAncestorsOf($table, $parent); } // ID=0 only exists for Entities if (($parent > 0) || ($table == 'glpi_entities')) { $id_found[$parent] = $parent; } // Store cache datas in DB $query = "UPDATE `$table` SET `ancestors_cache` = '".exportArrayToDB($id_found)."' WHERE `id` = '$items_id'"; $DB->query($query); } return $id_found; } // Get the leafs of previous founded item // iterative solution for table without cache $IDf = $items_id; while ($IDf > 0) { // Get next elements $query = "SELECT `$parentIDfield` FROM `$table` WHERE `id` = '$IDf'"; $result = $DB->query($query); if ($DB->numrows($result)>0) { $IDf = $DB->result($result,0,0); } else { $IDf = 0; } if (!isset($id_found[$IDf]) && (($IDf > 0) || ($table == 'glpi_entities'))) { $id_found[$IDf] = $IDf; } else { $IDf = 0; } } return $id_found; } /** * Get the sons of an item in a tree dropdown. Get datas in cache if available * * @param $table string table name * @param $IDf integer The ID of the father * * @return array of IDs of the sons **/ function getSonsOf($table, $IDf) { global $DB; $parentIDfield = getForeignKeyFieldForTable($table); $use_cache = FieldExists($table, "sons_cache"); if ($use_cache && ($IDf > 0)) { $query = "SELECT `sons_cache` FROM `$table` WHERE `id` = '$IDf'"; if (($result = $DB->query($query)) && ($DB->numrows($result) > 0)) { $sons = trim($DB->result($result, 0, 0)); if (!empty($sons)) { return importArrayFromDB($sons, true); } } } // IDs to be present in the final array $id_found[$IDf] = $IDf; // current ID found to be added $found = array(); // First request init the varriables $query = "SELECT `id` FROM `$table` WHERE `$parentIDfield` = '$IDf' ORDER BY `name`"; if (($result = $DB->query($query)) && ($DB->numrows($result) > 0)) { while ($row = $DB->fetch_assoc($result)) { $id_found[$row['id']] = $row['id']; $found[$row['id']] = $row['id']; } } // Get the leafs of previous founded item while (count($found) > 0) { $first = true; // Get next elements $query = "SELECT `id` FROM `$table` WHERE `$parentIDfield` IN ('" . implode("','",$found) . "')"; // CLear the found array unset($found); $found = array(); $result = $DB->query($query); if ($DB->numrows($result) > 0) { while ($row = $DB->fetch_assoc($result)) { if (!isset($id_found[$row['id']])) { $id_found[$row['id']] = $row['id']; $found[$row['id']] = $row['id']; } } } } // Store cache datas in DB if ($use_cache && ($IDf > 0)) { $query = "UPDATE `$table` SET `sons_cache`='".exportArrayToDB($id_found)."' WHERE `id` = '$IDf';"; $DB->query($query); } return $id_found; } /** * Get the sons and the ancestors of an item in a tree dropdown. Rely on getSonsOf and getAncestorsOf * * @since version 0.84 * * @param $table string table name * @param $IDf integer The ID of the father * * @return array of IDs of the sons and the ancestors **/ function getSonsAndAncestorsOf($table, $IDf) { return getAncestorsOf($table, $IDf) + getSonsOf($table, $IDf); } /** * Get the sons of an item in a tree dropdown * * @param $table string table name * @param $IDf integer The ID of the father * * @return array of IDs of the sons **/ function getTreeForItem($table, $IDf) { global $DB; $parentIDfield = getForeignKeyFieldForTable($table); // IDs to be present in the final array $id_found = array(); // current ID found to be added $found = array(); // First request init the varriables $query = "SELECT * FROM `$table` WHERE `$parentIDfield` = '$IDf' ORDER BY `name`"; if (($result = $DB->query($query)) && ($DB->numrows($result) > 0)) { while ($row = $DB->fetch_assoc($result)) { $id_found[$row['id']]['parent'] = $IDf; $id_found[$row['id']]['name'] = $row['name']; $found[$row['id']] = $row['id']; } } // Get the leafs of previous founded item while (count($found) > 0) { $first = true; // Get next elements $query = "SELECT * FROM `$table` WHERE `$parentIDfield` IN ('" . implode("','",$found)."') ORDER BY `name`"; // CLear the found array unset($found); $found = array(); $result = $DB->query($query); if ($DB->numrows($result) > 0) { while ($row = $DB->fetch_assoc($result)) { if (!isset($id_found[$row['id']])) { $id_found[$row['id']]['parent'] = $row[$parentIDfield]; $id_found[$row['id']]['name'] = $row['name']; $found[$row['id']] = $row['id']; } } } } $tree[$IDf]['name'] = Dropdown::getDropdownName($table, $IDf); $tree[$IDf]['tree'] = contructTreeFromList($id_found, $IDf); return $tree; } /** * Construct a tree from a list structure * * @param $list array the list * @param $root integer root of the tree * * @return list of items in the tree **/ function contructTreeFromList($list, $root) { $tree = array(); foreach ($list as $ID => $data) { if ($data['parent'] == $root) { unset($list[$ID]); $tree[$ID]['name'] = $data['name']; $tree[$ID]['tree'] = contructTreeFromList($list, $ID); } } return $tree; } /** * Construct a list from a tree structure * * @param $tree array the tree * @param $parent integer root of the tree (default =0) * * @return list of items in the tree **/ function contructListFromTree($tree, $parent=0) { $list = array(); foreach ($tree as $root => $data) { $list[$root] = $parent; if (is_array($data['tree']) && count($data['tree'])) { foreach ($data['tree'] as $ID => $underdata) { $list[$ID] = $root; if (is_array($underdata['tree']) && count($underdata['tree'])) { $list += contructListFromTree($underdata['tree'], $ID); } } } } return $list; } /** * Get the equivalent search query using ID of soons that the search of the father's ID argument * * @param $table string table name * @param $IDf integer The ID of the father * @param $reallink string real field to link ($table.id if not set) (default ='') * * @return string the query **/ function getRealQueryForTreeItem($table, $IDf, $reallink="") { global $DB; if (empty($IDf)) { return ""; } if (empty($reallink)) { $reallink = "`".$table."`.`id`"; } $id_found = getSonsOf($table, $IDf); // Construct the final request return $reallink." IN ('".implode("','", $id_found)."')"; } /** * Compute all completenames of Dropdown Tree table * * @param $table : dropdown tree table to compute * * @return nothing **/ function regenerateTreeCompleteName($table) { global $DB; $query = "SELECT `id` FROM `$table`"; $result = $DB->query($query); if ($DB->numrows($result) > 0) { while ($data=$DB->fetch_assoc($result)) { list($name, $level) = getTreeValueName($table, $data['id']); $query = "UPDATE `$table` SET `completename` = '".addslashes($name)."', `level` = '$level' WHERE `id` = '".$data['id']."'"; $DB->query($query); } } } /** * Get the ID of the next Item * * @param $table table to search next item * @param $ID current ID * @param $condition condition to add to the search (default ='') * @param $nextprev_item field used to sort (default ='name') * * @return the next ID, -1 if not exist **/ function getNextItem($table, $ID, $condition="", $nextprev_item="name") { global $DB, $CFG_GLPI; if (empty($nextprev_item)) { return false; } $itemtype = getItemTypeForTable($table); $item = new $itemtype(); $search = $ID; if ($nextprev_item != "id") { $query = "SELECT `$nextprev_item` FROM `$table` WHERE `id` = '$ID'"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { $search = addslashes($DB->result($result, 0, 0)); } else { $nextprev_item = "id"; } } } $LEFTJOIN = ''; if ($table == "glpi_users") { $LEFTJOIN = " LEFT JOIN `glpi_profiles_users` ON (`glpi_users`.`id` = `glpi_profiles_users`.`users_id`)"; } $query = "SELECT `$table`.`id` FROM `$table` $LEFTJOIN WHERE (`$table`.`$nextprev_item` > '$search' "; // Same name case if ($nextprev_item != "id") { $query .= " OR (`$table`.`".$nextprev_item."` = '$search' AND `$table`.`id` > '$ID') "; } $query .= ") "; if (!empty($condition)) { $query .= " AND $condition "; } if ($item->maybeDeleted()) { $query .= " AND `$table`.`is_deleted` = '0' "; } if ($item->maybeTemplate()) { $query .= " AND `$table`.`is_template` = '0' "; } // Restrict to active entities if ($table == "glpi_entities") { $query .= getEntitiesRestrictRequest("AND", $table, '', '', true); } else if ($item->isEntityAssign()) { $query .= getEntitiesRestrictRequest("AND", $table, '', '', $item->maybeRecursive()); } else if ($table == "glpi_users") { $query .= getEntitiesRestrictRequest("AND", "glpi_profiles_users"); } $query .= " ORDER BY `$table`.`$nextprev_item` ASC, `$table`.`id` ASC"; $result = $DB->query($query); if ($result && ($DB->numrows($result) > 0)) { return $DB->result($result, 0, "id"); } return -1; } /** * Get the ID of the previous Item * * @param $table table to search next item * @param $ID current ID * @param $condition condition to add to the search (default ='') * @param $nextprev_item field used to sort (default ='name') * * @return the previous ID, -1 if not exist **/ function getPreviousItem($table, $ID, $condition="", $nextprev_item="name") { global $DB, $CFG_GLPI; if (empty($nextprev_item)) { return false; } $itemtype = getItemTypeForTable($table); $item = new $itemtype(); $search = $ID; if ($nextprev_item != "id") { $query = "SELECT `$nextprev_item` FROM `$table` WHERE `id` = '$ID'"; $result = $DB->query($query); if ($DB->numrows($result) > 0) { $search = addslashes($DB->result($result, 0, 0)); } else { $nextprev_item = "id"; } } $LEFTJOIN = ''; if ($table == "glpi_users") { $LEFTJOIN = " LEFT JOIN `glpi_profiles_users` ON (`glpi_users`.`id` = `glpi_profiles_users`.`users_id`)"; } $query = "SELECT `$table`.`id` FROM `$table` $LEFTJOIN WHERE (`$table`.`$nextprev_item` < '$search' "; // Same name case if ($nextprev_item != "id") { $query .= " OR (`$table`.`$nextprev_item` = '$search' AND `$table`.`id` < '$ID') "; } $query .= ") "; if (!empty($condition)) { $query .= " AND $condition "; } if ($item->maybeDeleted()) { $query .= "AND `$table`.`is_deleted` = '0'"; } if ($item->maybeTemplate()) { $query .= "AND `$table`.`is_template` = '0'"; } // Restrict to active entities if ($table == "glpi_entities") { $query .= getEntitiesRestrictRequest("AND", $table, '', '', true); } else if ($item->isEntityAssign()) { $query .= getEntitiesRestrictRequest("AND", $table, '', '', $item->maybeRecursive()); } else if ($table == "glpi_users") { $query .= getEntitiesRestrictRequest("AND", "glpi_profiles_users"); } $query .= " ORDER BY `$table`.`$nextprev_item` DESC, `$table`.`id` DESC"; $result = $DB->query($query); if ($result && ($DB->numrows($result) > 0)) { return $DB->result($result, 0, "id"); } return -1; } /** * Format a user name * *@param $ID integer ID of the user. *@param $login string login of the user *@param $realname string realname of the user *@param $firstname string firstname of the user *@param $link integer include link (only if $link==1) (default =0) *@param $cut integer limit string length (0 = no limit) (default =0) *@param $force_config boolean force order and id_visible to use common config (false by default) * *@return string : formatted username **/ function formatUserName($ID, $login, $realname, $firstname, $link=0, $cut=0, $force_config=false) { global $CFG_GLPI; $before = ""; $after = ""; $order = $CFG_GLPI["names_format"]; if (isset($_SESSION["glpinames_format"]) && !$force_config) { $order = $_SESSION["glpinames_format"]; } $id_visible = $CFG_GLPI["is_ids_visible"]; if (isset($_SESSION["glpiis_ids_visible"]) && !$force_config) { $id_visible = $_SESSION["glpiis_ids_visible"]; } if (strlen($realname) > 0) { $temp = $realname; if (strlen($firstname) > 0) { if ($order == User::FIRSTNAME_BEFORE) { $temp = $firstname." ".$temp; } else { $temp .= " ".$firstname; } } if (($cut > 0) && (Toolbox::strlen($temp) > $cut)) { $temp = Toolbox::substr($temp, 0, $cut)." ..."; } } else { $temp = $login; } if ($ID > 0 && ((strlen($temp) == 0) || $id_visible)) { $temp = sprintf(__('%1$s (%2$s)'), $temp, $ID); } if (($link == 1) && ($ID > 0)) { $before = ""; $after = ""; } $username = $before.$temp.$after; return $username; } /** * Get name of the user with ID=$ID (optional with link to user.form.php) * *@param $ID integer ID of the user. *@param $link integer 1 = Show link to user.form.php 2 = return array with comments and link * (default =0) * *@return string : username string (realname if not empty and name if realname is empty). **/ function getUserName($ID, $link=0) { global $DB, $CFG_GLPI; $user = ""; if ($link == 2) { $user = array("name" => "", "link" => "", "comment" => ""); } if ($ID) { $query = "SELECT * FROM `glpi_users` WHERE `id` = '$ID'"; $result = $DB->query($query); if ($link == 2) { $user = array("name" => "", "comment" => "", "link" => ""); } if ($DB->numrows($result) == 1) { $data = $DB->fetch_assoc($result); $username = formatUserName($data["id"], $data["name"], $data["realname"], $data["firstname"], $link); if ($link == 2) { $user["name"] = $username; $user["link"] = $CFG_GLPI["root_doc"]."/front/user.form.php?id=".$ID; $user['comment'] = ''; $comments = array(); $comments[] = array('name' => __('Name'), 'value' => $username); $comments[] = array('name' => __('Login'), 'value' => $data["name"]); $email = UserEmail::getDefaultForUser($ID); if (!empty($email)) { $comments[] = array('name' => __('Email'), 'value' => $email); } if (!empty($data["phone"])) { $comments[] = array('name' => __('Phone'), 'value' => $data["phone"]); } if (!empty($data["mobile"])) { $comments[] = array('name' => __('Mobile phone'), 'value' => $data["mobile"]); } if ($data["locations_id"] > 0) { $comments[] = array('name' => __('Location'), 'value' => Dropdown::getDropdownName("glpi_locations", $data["locations_id"])); } if ($data["usertitles_id"] > 0) { $comments[] = array('name' => _x('person','Title'), 'value' => Dropdown::getDropdownName("glpi_usertitles", $data["usertitles_id"])); } if ($data["usercategories_id"] > 0) { $comments[] = array('name' => __('Category'), 'value' => Dropdown::getDropdownName("glpi_usercategories", $data["usercategories_id"])); } if (count($comments)) { foreach ($comments as $data) { // Do not use SPAN here $user['comment'] .= sprintf(__('%1$s: %2$s')."
", "".$data['name']."", $data['value']); } } } else { $user = $username; } } } return $user; } /** * Verify if a DB table exists * *@param $tablename string : Name of the table we want to verify. * *@return bool : true if exists, false elseway. **/ function TableExists($tablename) { global $DB; // Get a list of tables contained within the database. $result = $DB->list_tables("%".$tablename."%"); if ($rcount = $DB->numrows($result)) { while ($data = $DB->fetch_row($result)) { if ($data[0] === $tablename) { return true; } } } $DB->free_result($result); return false; } /** * Verify if a DB field exists * * @param $table String Name of the table we want to verify. * @param $field String Name of the field we want to verify. * @param $usecache Boolean if use field list cache (default true) * *@return bool : true if exists, false elseway. **/ function FieldExists($table, $field, $usecache=true) { global $DB; if ($fields = $DB->list_fields($table, $usecache)) { if (isset($fields[$field])) { return true; } return false; } return false; } /** * Determine if an index exists in database * * @param $table string table of the index * @param $field string name of the index * * @return boolean : index exists ? **/ function isIndex($table, $field) { global $DB; $result = $DB->query("SHOW INDEX FROM `$table`"); if ($result && $DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { if ($data["Key_name"] == $field) { return true; } } } return false; } /** * Create a new name using a autoname field defined in a template * * @param $objectName autoname template * @param $field field to autoname * @param $isTemplate true if create an object from a template * @param $itemtype item type * @param $entities_id limit generation to an entity (default -1) * * @return new auto string **/ function autoName($objectName, $field, $isTemplate, $itemtype, $entities_id=-1) { global $DB, $CFG_GLPI; $len = Toolbox::strlen($objectName); if ($isTemplate && ($len > 8) && (Toolbox::substr($objectName,0,4) === '<') && (Toolbox::substr($objectName,$len - 4,4) === '>')) { $autoNum = Toolbox::substr($objectName, 4, $len - 8); $mask = ''; if (preg_match( "/\\#{1,10}/", $autoNum, $mask)) { $global = ((strpos($autoNum, '\\g') !== false) && ($itemtype != 'Infocom')) ? 1 : 0; $autoNum = str_replace(array('\\y', '\\Y', '\\m', '\\d', '_','%', '\\g'), array(date('y'), date('Y'), date('m'), date('d'), '\\_', '\\%', ''), $autoNum); $mask = $mask[0]; $pos = strpos($autoNum, $mask) + 1; $len = Toolbox::strlen($mask); $like = str_replace('#', '_', $autoNum); if ($global == 1) { $query = ""; $first = 1; $types = array('Computer', 'Monitor', 'NetworkEquipment', 'Peripheral', 'Phone', 'Printer'); foreach ($types as $t) { $table = getTableForItemType($t); $query .= ($first ? "SELECT " : " UNION SELECT ")." $field AS code FROM `$table` WHERE `$field` LIKE '$like' AND `is_deleted` = '0' AND `is_template` = '0'"; if ($CFG_GLPI["use_autoname_by_entity"] && ($entities_id >= 0)) { $query .=" AND `entities_id` = '$entities_id' "; } $first = 0; } $query = "SELECT CAST(SUBSTRING(code, $pos, $len) AS unsigned) AS no FROM ($query) AS codes"; } else { $table = getTableForItemType($itemtype); $query = "SELECT CAST(SUBSTRING($field, $pos, $len) AS unsigned) AS no FROM `$table` WHERE `$field` LIKE '$like' "; if ($itemtype != INFOCOM_TYPE) { $query .= " AND `is_deleted` = '0' AND `is_template` = '0'"; if ($CFG_GLPI["use_autoname_by_entity"] && ($entities_id >= 0)) { $query .= " AND `entities_id` = '$entities_id' "; } } } $query = "SELECT MAX(Num.no) AS lastNo FROM (".$query.") AS Num"; $resultNo = $DB->query($query); if ($DB->numrows($resultNo) > 0) { $data = $DB->fetch_assoc($resultNo); $newNo = $data['lastNo'] + 1; } else { $newNo = 0; } $objectName = str_replace(array($mask, '\\_', '\\%'), array(Toolbox::str_pad($newNo, $len, '0', STR_PAD_LEFT), '_', '%'), $autoNum); } } return $objectName; } /** * Close active DB connections * *@return nothing **/ function closeDBConnections() { global $DB; // Case of not init $DB object if (method_exists($DB,"close")) { $DB->close(); } } /** * Format a web link adding http:// if missing * *@param $link link to format * *@return formatted link. **/ function formatOutputWebLink($link) { if (!preg_match("/^https?/",$link)) { return "http://".$link; } return $link; } /** * Add dates for request * * @param $field table.field to request * @param $begin date begin date * @param $end date end date * * @return sql **/ function getDateRequest($field, $begin, $end) { $sql = ''; if (!empty($begin)) { $sql .= " $field >= '$begin' "; } if (!empty($end)) { if (!empty($sql)) { $sql .= " AND "; } $sql .= " $field <= ADDDATE('$end' , INTERVAL 1 DAY) "; } return " (".$sql.") "; } /** * Export an array to be stored in a simple field in the database * * @param $TAB Array to export / encode (one level depth) * * @return string containing encoded array **/ function exportArrayToDB($TAB) { return json_encode($TAB); } /** * Import an array encoded in a simple field in the database * * @param $DATA data readed in DB to import * * @return array containing datas **/ function importArrayFromDB($DATA) { $TAB = json_decode($DATA,true); // Use old scheme to decode if (!is_array($TAB)) { $TAB = array(); foreach (explode(" ", $DATA) as $ITEM) { $A = explode("=>", $ITEM); if ((strlen($A[0]) > 0) && isset($A[1])) { $TAB[urldecode($A[0])] = urldecode($A[1]); } } } return $TAB; } /** * Get hour from sql * * @param $time datetime: time * * @return array **/ function get_hour_from_sql($time) { $t = explode(" ", $time); $p = explode(":", $t[1]); return $p[0].":".$p[1]; } /** * Get the $RELATION array. It's defined all relations between tables in the DB. * * @return the $RELATION array **/ function getDbRelations() { global $CFG_GLPI; include (GLPI_ROOT . "/inc/relation.constant.php"); // Add plugins relations $plug_rel = Plugin::getDatabaseRelations(); if (count($plug_rel) > 0) { $RELATION = array_merge_recursive($RELATION,$plug_rel); } return $RELATION; } /** * Get SQL request to restrict to current entities of the user * * @param $separator separator in the begin of the request (default AND) * @param $table table where apply the limit (if needed, multiple tables queries) * (default '') * @param $field field where apply the limit (id != entities_id) (default '') * @param $value entity to restrict (if not set use $_SESSION['glpiactiveentities']). * single item or array (default '') * @param $is_recursive need to use recursive process to find item * (field need to be named recursive) (false by default) * @param $complete_request need to use a complete request and not a simple one * when have acces to all entities (used for reminders) * (false by default) * * @return String : the WHERE clause to restrict **/ function getEntitiesRestrictRequest($separator="AND", $table="", $field="",$value='', $is_recursive=false, $complete_request=false) { $query = $separator ." ( "; // !='0' needed because consider as empty if (!$complete_request && ($value != '0') && empty($value) && isset($_SESSION['glpishowallentities']) && $_SESSION['glpishowallentities']) { // Not ADD "AND 1" if not needed if (trim($separator) == "AND") { return ""; } return $query." 1 ) "; } if (!empty($table)) { $query .= "`$table`."; } if (empty($field)) { if ($table == 'glpi_entities') { $field = "id"; } else { $field = "entities_id"; } } $query .= "`$field`"; if (is_array($value)) { $query .= " IN ('" . implode("','",$value) . "') "; } else { if (strlen($value) == 0) { $query .= " IN (".$_SESSION['glpiactiveentities_string'].") "; } else { $query .= " = '$value' "; } } if ($is_recursive) { $ancestors = array(); if (is_array($value)) { foreach ($value as $val) { $ancestors = array_unique(array_merge(getAncestorsOf("glpi_entities", $val), $ancestors)); } $ancestors = array_diff($ancestors, $value); } else if (strlen($value) == 0) { $ancestors = $_SESSION['glpiparententities']; } else { $ancestors = getAncestorsOf("glpi_entities", $value); } if (count($ancestors)) { if ($table == 'glpi_entities') { $query .= " OR `$table`.`$field` IN ('" . implode("','",$ancestors) . "')"; } else { $query .= " OR (`$table`.`is_recursive`='1' AND `$table`.`$field` IN ('" . implode("','",$ancestors) . "'))"; } } } $query .= " ) "; return $query; } ?>glpi-0.84.3+dfsg.1/inc/dbconnection.class.php000066400000000000000000000326161226600447100206640ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Database class for Mysql **/ class DBConnection extends CommonDBTM { static protected $notable = true; static function getTypeName($nb=0) { return _n('Mysql replica', 'Mysql replicas', $nb); } /** * Create slave DB configuration file * * @param host the slave DB host(s) * @param user the slave DB user * @param password the slave DB password * @param DBname the name of the slave DB * * @return boolean for success **/ static function createSlaveConnectionFile($host, $user, $password, $DBname) { $DB_str = ""; return Toolbox::writeConfig('config_db_slave.php', $DB_str); } /** * Indicates is the DB replicate is active or not * * @return true if active / false if not active **/ static function isDBSlaveActive() { return file_exists(GLPI_CONFIG_DIR . "/config_db_slave.php"); } /** * Read slave DB configuration file * * @param $choice integer, host number (default NULL) * * @return DBmysql object **/ static function getDBSlaveConf($choice=NULL) { if (self::isDBSlaveActive()) { include_once (GLPI_CONFIG_DIR . "/config_db_slave.php"); return new DBSlave($choice); } } /** * Create a default slave DB configuration file **/ static function createDBSlaveConfig() { self::createSlaveConnectionFile("localhost", "glpi", "glpi", "glpi"); } /** * Save changes to the slave DB configuration file * * @param $host * @param $user * @param $password * @param $DBname **/ static function saveDBSlaveConf($host, $user, $password, $DBname) { self::createSlaveConnectionFile($host, $user, $password, $DBname); } /** * Delete slave DB configuration file */ static function deleteDBSlaveConfig() { unlink(GLPI_CONFIG_DIR . "/config_db_slave.php"); } /** * Switch database connection to slave **/ static function switchToSlave() { global $DB; if (self::isDBSlaveActive()) { include_once (GLPI_CONFIG_DIR . "/config_db_slave.php"); $DB = new DBSlave(); return $DB->connected; } return false; } /** * Switch database connection to master **/ static function switchToMaster() { global $DB; $DB = new DB(); return $DB->connected; } /** * Get Connection to slave, if exists, * and if configured to be used for read only request * * @return DBmysql object **/ static function getReadConnection() { global $DB, $CFG_GLPI; if ($CFG_GLPI['use_slave_for_search'] && !$DB->isSlave() && self::isDBSlaveActive()) { include_once (GLPI_CONFIG_DIR . "/config_db_slave.php"); $DBread = new DBSlave(); if ($DBread->connected) { $sql = "SELECT MAX(`id`) AS maxid FROM `glpi_logs`"; switch ($CFG_GLPI['use_slave_for_search']) { case 3 : // If synced or read-only account if (Session::isReadOnlyAccount()) { return $DBread; } // nobreak; case 1 : // If synced (all changes) $slave = $DBread->request($sql)->next(); $master = $DB->request($sql)->next(); if (isset($slave['maxid']) && isset($master['maxid']) && ($slave['maxid'] == $master['maxid'])) { // Latest Master change available on Slave return $DBread; } break; case 2 : // If synced (current user changes or profile in read only) if (!isset($_SESSION['glpi_maxhistory'])) { // No change yet return $DBread; } $slave = $DBread->request($sql)->next(); if (isset($slave['maxid']) && ($slave['maxid'] >= $_SESSION['glpi_maxhistory'])) { // Latest current user change avaiable on Slave return $DBread; } break; default: // Always return $DBread; } } } return $DB; } /** * Establish a connection to a mysql server (main or replicate) * * @param $use_slave try to connect to slave server first not to main server * @param $required connection to the specified server is required * (if connection failed, do not try to connect to the other server) * @param $display display error message (true by default) **/ static function establishDBConnection($use_slave, $required, $display=true) { global $DB; $DB = null; $res = false; // First standard config : no use slave : try to connect to master if (!$use_slave) { $res = self::switchToMaster(); } // If not already connected to master due to config or error if (!$res) { // No DB slave : first connection to master give error if (!self::isDBSlaveActive()) { // Slave wanted but not defined -> use master // Ignore $required when no slave configured if ($use_slave) { $res = self::switchToMaster(); } // Slave DB configured } else { // Try to connect to slave if wanted if ($use_slave) { $res = self::switchToSlave(); } // No connection to 'mandatory' server if (!$res && !$required) { //Try to establish the connection to the other mysql server if ($use_slave) { $res = self::switchToMaster(); } else { $res = self::switchToSlave(); } if ($res) { $DB->first_connection = false; } } } } // Display error if needed if (!$res && $display) { self::displayMySQLError(); } return $res; } /** * Get delay between slave and master * * @param $choice integer, host number (default NULL) * * @return integer **/ static function getReplicateDelay($choice=NULL) { include_once (GLPI_CONFIG_DIR . "/config_db_slave.php"); return (int) (self::getHistoryMaxDate(new DB()) - self::getHistoryMaxDate(new DBSlave($choice))); } /** * Get history max date of a GLPI DB * * @param $DBconnection DB conneciton used **/ static function getHistoryMaxDate($DBconnection) { if ($DBconnection->connected) { $result = $DBconnection->query("SELECT UNIX_TIMESTAMP(MAX(`date_mod`)) AS max_date FROM `glpi_logs`"); if ($DBconnection->numrows($result) > 0) { return $DBconnection->result($result, 0, "max_date"); } } return 0; } /** * Display a common mysql connection error **/ static function displayMySQLError() { if (!isCommandLine()) { Html::nullHeader("Mysql Error", ''); echo "

A link to the Mysql server could not be established. Please check your configuration.

Le serveur Mysql est inaccessible. Vérifiez votre configuration

"; Html::nullFooter(); } else { echo "A link to the Mysql server could not be established. Please check your configuration.\n"; echo "Le serveur Mysql est inaccessible. Vérifiez votre configuration\n"; } die(); } /** * @param $name **/ static function cronInfo($name) { return array('description' => __('Check the MySQL replica'), 'parameter' => __('Max delay between master and slave (minutes)')); } /** * Cron process to check DB replicate state * * @param $task to log and get param **/ static function cronCheckDBreplicate($task) { global $DB; //Lauch cron only is : // 1 the master database is avalaible // 2 the slave database is configurated if (!$DB->isSlave() && self::isDBSlaveActive()) { $DBslave = self::getDBSlaveConf(); if (is_array($DBslave->dbhost)) { $hosts = $DBslave->dbhost; } else { $hosts = array($DBslave->dbhost); } foreach ($hosts as $num => $name) { $diff = self::getReplicateDelay($num); // Quite strange, but allow simple stat $task->addVolume($diff); if ($diff > 1000000000) { // very large means slave is disconnect $task->log(sprintf(__s("Mysql server: %s can't connect to the database"), $name)); } else { //TRANS: %1$s is the server name, %2$s is the time $task->log(sprintf(__('Mysql server: %1$s, difference between master and slave: %2$s'), $name, Html::timestampToString($diff, true))); } if ($diff > ($task->fields['param']*60)) { //Raise event if replicate is not synchronized $options = array('diff' => $diff, 'name' => $name, 'entities_id' => 0); // entity to avoid warning in getReplyTo NotificationEvent::raiseEvent('desynchronization', new self(), $options); } } return 1; } return 0; } /** * Display in HTML, delay between master and slave * 1 line per slave is multiple **/ static function showAllReplicateDelay() { $DBslave = self::getDBSlaveConf(); if (is_array($DBslave->dbhost)) { $hosts = $DBslave->dbhost; } else { $hosts = array($DBslave->dbhost); } foreach ($hosts as $num => $name) { $diff = self::getReplicateDelay($num); //TRANS: %s is namez of server Mysql printf(__('%1$s: %2$s'), __('Mysql server'), $name); echo " - "; if ($diff > 1000000000) { echo __("can't connect to the database") . "
"; } else if ($diff) { printf(__('%1$s: %2$s')."
", __('Difference between master and slave'), Html::timestampToString($diff, 1)); } else { printf(__('%1$s: %2$s')."
", __('Difference between master and slave'), __('None')); } } } /** * @param $width **/ function showSystemInformations($width) { // No need to translate, this part always display in english (for copy/paste to forum) echo "".self::getTypeName(2).""; echo "
\n \n";
      if (self::isDBSlaveActive()) {
         echo "Active\n";
         self::showAllReplicateDelay();
      } else {
         echo "Not active\n";
      }
      echo "\n
"; } /** * Enable or disable db replication check cron task * * @param enable of disable cron task (true by default) **/ static function changeCronTaskStatus($enable=true) { $cron = new CronTask(); $cron->getFromDBbyName('DBConnection', 'CheckDBreplicate'); $input['id'] = $cron->fields['id']; $input['state'] = ($enable?1:0); $cron->update($input); } } ?>glpi-0.84.3+dfsg.1/inc/dbmysql.class.php000066400000000000000000000562321226600447100176720ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Database class for Mysql **/ class DBmysql { //! Database Host - string or Array of string (round robin) var $dbhost = ""; //! Database User var $dbuser = ""; //! Database Password var $dbpassword = ""; //! Default Database var $dbdefault = ""; //! Database Handler var $dbh; //! Database Error var $error = 0; /// Slave management var $slave = false; /** Is it a first connection ? * Indicates if the first connection attempt is successful or not * if first attempt fail -> display a warning which indicates that glpi is in readonly **/ var $first_connection = true; /// Is connected to the DB ? var $connected = false; /** * Constructor / Connect to the MySQL Database * * try to connect * * @param $choice integer, host number (default NULL) * * @return nothing **/ function __construct($choice=NULL) { $this->connect($choice); } /** * Connect using current database settings * * Use dbhost, dbuser, dbpassword and dbdefault * * @param $choice integer, host number (default NULL) * * @return nothing **/ function connect($choice=NULL) { $this->connected = false; if (is_array($this->dbhost)) { // Round robin choice $i = (isset($choice) ? $choice : mt_rand(0,count($this->dbhost)-1)); $host = $this->dbhost[$i]; } else { $host = $this->dbhost; } $hostport = explode(":", $host); if (count($hostport) < 2) { // Host $this->dbh = new mysqli($host, $this->dbuser, rawurldecode($this->dbpassword), $this->dbdefault); } else if (intval($hostport[1])>0) { // Host:port $this->dbh = new mysqli($hostport[0], $this->dbuser, rawurldecode($this->dbpassword), $this->dbdefault, $hostport[1]); } else { // :Socket $this->dbh = new mysqli($hostport[0], $this->dbuser, rawurldecode($this->dbpassword), $this->dbdefault, ini_get('mysqli.default_port'), $hostport[1]); } if ($this->dbh->connect_error) { $this->connected = false; $this->error = 1; } else { $this->dbh->query("SET NAMES '" . (isset($this->dbenc) ? $this->dbenc : "utf8") . "'"); $this->connected = true; } } /** * Escapes special characters in a string for use in an SQL statement, * taking into account the current charset of the connection * * @since version 0.84 * * @param $string String to escape * * @return String escaped **/ function escape($string) { return $this->dbh->real_escape_string($string); } /** * Execute a MySQL query * * @param $query Query to execute * * @return Query result handler **/ function query($query) { global $CFG_GLPI, $DEBUG_SQL, $SQL_TOTAL_REQUEST; if (($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) && $CFG_GLPI["debug_sql"]) { $SQL_TOTAL_REQUEST++; $DEBUG_SQL["queries"][$SQL_TOTAL_REQUEST] = $query; $TIMER = new Timer(); $TIMER->start(); } $res = @$this->dbh->query($query); if (!$res) { // no translation for error logs $error = "*** MySQL query error: \n***\nSQL: ".addslashes($query)."\nError: ". $this->dbh->error."\n"; if (function_exists("debug_backtrace")) { $error .= "Backtrace :\n"; $traces = debug_backtrace(); foreach ($traces as $trace) { $error .= (isset($trace["file"]) ? $trace["file"] : "") . " :" . (isset($trace["line"]) ? $trace["line"] : "") . "\t\t" . (isset($trace["class"]) ? $trace["class"] : "") . (isset($trace["type"]) ? $trace["type"] : "") . (isset($trace["function"]) ? $trace["function"]."()" : "") ."\n"; } } else { $error .= "Script : " ; } $error .= $_SERVER["SCRIPT_FILENAME"]. "\n"; Toolbox::logInFile("sql-errors", $error."\n"); if (($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) && $CFG_GLPI["debug_sql"]) { $DEBUG_SQL["errors"][$SQL_TOTAL_REQUEST] = $this->error(); } } if (($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) && $CFG_GLPI["debug_sql"]) { $TIME = $TIMER->getTime(); $DEBUG_SQL["times"][$SQL_TOTAL_REQUEST] = $TIME; } return $res; } /** * Execute a MySQL query * * @since version 0.84 * * @param $query Query to execute * @param $message explaination of query (default '') * * @return Query result handler **/ function queryOrDie($query, $message='') { //TRANS: %1$s is the description, %2$s is the query, %3$s is the error message $res = $this->query($query) or die(sprintf(__('%1$s - Error during the database query: %2$s - Error is %3$s'), $message, $query, $this->error())); return $res; } /** * Give result from a mysql result * * @param $result MySQL result handler * @param $i Row to give * @param $field Field to give * * @return Value of the Row $i and the Field $field of the Mysql $result **/ function result($result, $i, $field) { if ($result && ($result->data_seek($i)) && ($data = $result->fetch_array()) && isset($data[$field])) { return (Toolbox::get_magic_quotes_runtime() ? Toolbox::stripslashes_deep($data[$field]) : $data[$field]); } return NULL; } /** * Give number of rows of a Mysql result * * @param $result MySQL result handler * * @return number of rows **/ function numrows($result) { return $result->num_rows; } /** * Fetch array of the next row of a Mysql query * Please prefer fetch_row or fetch_assoc * * @param $result MySQL result handler * * @return result array **/ function fetch_array($result) { return (Toolbox::get_magic_quotes_runtime() ? Toolbox::stripslashes_deep($result->fetch_array()) : $result->fetch_array()); } /** * Fetch row of the next row of a Mysql query * * @param $result MySQL result handler * * @return result row **/ function fetch_row($result) { return (Toolbox::get_magic_quotes_runtime() ? Toolbox::stripslashes_deep($result->fetch_row()) : $result->fetch_row()); } /** * Fetch assoc of the next row of a Mysql query * * @param $result MySQL result handler * * @return result associative array **/ function fetch_assoc($result) { return (Toolbox::get_magic_quotes_runtime() ? Toolbox::stripslashes_deep($result->fetch_assoc()) : $result->fetch_assoc()); } /** * Move current pointer of a Mysql result to the specific row * * @param $result MySQL result handler * @param $num row to move current pointer * * @return boolean **/ function data_seek($result, $num) { return $result->data_seek($num); } /** * Give ID of the last insert item by Mysql * * @return item ID **/ function insert_id() { return $this->dbh->insert_id; } /** * Give number of fields of a Mysql result * * @param $result MySQL result handler * * @return number of fields **/ function num_fields($result) { return $result->field_count; } /** * Give name of a field of a Mysql result * * @param $result MySQL result handler * @param $nb number of columns of the field * * @return name of the field **/ function field_name($result, $nb) { $finfo = $result->fetch_fields(); return $finfo[$nb]->name; } /** * Get flags of a field of a mysql result * * @param $result MySQL result handler * @param $field field name * * @return flags of the field **/ function field_flags($result, $field) { $finfo = $result->fetch_fields(); return $finfo[$nb]->flags; } /** * List tables in database * * @param $table table name condition (glpi_% as default to retrieve only glpi tables) * * @return list of tables **/ function list_tables($table="glpi_%") { return $this->query("SHOW TABLES LIKE '".$table."'"); } /** * List fields of a table * * @param $table String table name condition * @param $usecache Boolean if use field list cache (default true) * * @return list of fields **/ function list_fields($table, $usecache=true) { static $cache = array(); if ($usecache && isset($cache[$table])) { return $cache[$table]; } $result = $this->query("SHOW COLUMNS FROM `$table`"); if ($result) { if ($this->numrows($result) > 0) { $cache[$table] = array(); while ($data = $result->fetch_assoc()) { $cache[$table][$data["Field"]] = $data; } return $cache[$table]; } return array(); } return false; } /** * Get number of affected rows in previous MySQL operation * * @return number of affected rows on success, and -1 if the last query failed. **/ function affected_rows() { return $this->dbh->affected_rows; } /** * Free result memory * * @param $result MySQL result handler * * @return Returns TRUE on success or FALSE on failure. **/ function free_result($result) { return $result->free(); } /** * Returns the numerical value of the error message from previous MySQL operation * * @return error number from the last MySQL function, or 0 (zero) if no error occurred. **/ function errno() { return $this->dbh->errno; } /** * Returns the text of the error message from previous MySQL operation * * @return error text from the last MySQL function, or '' (empty string) if no error occurred. **/ function error() { return $this->dbh->error; } /** * Close MySQL connection * * @return TRUE on success or FALSE on failure. **/ function close() { if ($this->dbh) { return @$this->dbh->close(); } return false; } /** * is a slave database ? * * @return boolean **/ function isSlave() { return $this->slave; } /** * Execute all the request in a file * * @param $path string with file full path * * @return boolean true if all query are successfull **/ function runFile($path) { $DBf_handle = fopen($path, "rt"); if (!$DBf_handle) { return false; } $formattedQuery = ""; $lastresult = false; while (!feof($DBf_handle)) { // specify read length to be able to read long lines $buffer = fgets($DBf_handle,102400); // do not strip comments due to problems when # in begin of a data line $formattedQuery .= $buffer; if ((substr(rtrim($formattedQuery),-1) == ";") && (substr(rtrim($formattedQuery),-4) != ">") && (substr(rtrim($formattedQuery),-4) != "160;")) { if (Toolbox::get_magic_quotes_runtime()) { $formattedQuerytorun = stripslashes($formattedQuery); } else { $formattedQuerytorun = $formattedQuery; } // Do not use the $DB->query if ($this->query($formattedQuerytorun)) { //if no success continue to concatenate $formattedQuery = ""; $lastresult = true; } else { $lastresult = false; } } } return $lastresult; } /** * Instanciate a Simple DBIterator * * Examples = * foreach ($DB->request("select * from glpi_states") as $data) { ... } * foreach ($DB->request("glpi_states") as $ID => $data) { ... } * foreach ($DB->request("glpi_states", "ID=1") as $ID => $data) { ... } * foreach ($DB->request("glpi_states", "", "name") as $ID => $data) { ... } * foreach ($DB->request("glpi_computers",array("name"=>"SBEI003W","entities_id"=>1),array("serial","otherserial")) { ... } * * @param $tableorsql table name, array of names or SQL query * @param $crit string or array of filed/values, ex array("id"=>1), if empty => all rows * (default '') * * Examples = * array("id"=>NULL) * array("OR"=>array("id"=>1, "NOT"=>array("state"=>3))); * array("AND"=>array("id"=>1, array("NOT"=>array("state"=>array(3,4,5),"toto"=>2)))) * * FIELDS name or array of field names * ORDER name or array of field names * LIMIT max of row to retrieve * START first row to retrieve * * @return DBIterator **/ public function request ($tableorsql, $crit="") { return new DBmysqlIterator($this, $tableorsql, $crit); } /** * Optimize sql table * * @param $migration migration class (default NULL) * @param $cron to know if optimize must be done (false by default) * * @return number of tables **/ static function optimize_tables($migration=NULL, $cron=false) { global $DB; if (!is_null($migration) && method_exists($migration,'displayMessage')) { $migration->displayTitle(__('Optimizing tables')); $migration->addNewMessageArea('optimize_table'); // to force new ajax zone $migration->displayMessage(sprintf(__('%1$s - %2$s'), __('optimize'), __('Start'))); } $result = $DB->list_tables(); $nb = 0; while ($line = $DB->fetch_row($result)) { $table = $line[0]; // For big database to reduce delay of migration if ($cron || (countElementsInTable($table) < 15000000)) { if (!is_null($migration) && method_exists($migration,'displayMessage')) { $migration->displayMessage(sprintf(__('%1$s - %2$s'), __('optimize'), $table)); } $query = "OPTIMIZE TABLE `".$table."` ;"; $DB->query($query); $nb++; } } $DB->free_result($result); if (!is_null($migration) && method_exists($migration,'displayMessage') ) { $migration->displayMessage(sprintf(__('%1$s - %2$s'), __('optimize'), __('End'))); } return $nb; } /** * Get information about DB connection for showSystemInformations * * @since version 0.84 * * @return Array of label / value */ public function getInfo() { // No translation, used in sysinfo $ret = array(); $req = $this->request("SELECT @@version AS vers, @@version_comment AS stype"); if (($data = $req->next())) { if ($data['stype']) { $ret['Server Software'] = $data['stype']; } if ($data['vers']) { $ret['Server Version'] = $data['vers']; } else { $ret['Server Version'] = $this->dbh->server_info; } } $ret['Parameters'] = $this->dbuser."@".$this->dbhost."/".$this->dbdefault; $ret['Host info'] = $this->dbh->host_info; return $ret; } /** * Get a global DB lock * * @param $name String : name of the lock * * @since version 0.84 * * @return Boolean **/ public function getLock($name) { $name = addslashes($this->dbdefault.'.'.$name); $query = "SELECT GET_LOCK('$name', 0)"; $result = $this->query($query); list($lock_ok) = $this->fetch_row($result); return $lock_ok; } /** * Release a global DB lock * * @param $name String : name of the lock * * @since version 0.84 * * @return Boolean **/ public function releaseLock($name) { $name = addslashes($this->dbdefault.'.'.$name); $query = "SELECT RELEASE_LOCK('$name')"; $result = $this->query($query); list($lock_ok) = $this->fetch_row($result); return $lock_ok; } } /** * Helper for simple query => see $DBmysql->requete **/ class DBmysqlIterator implements Iterator { /// DBmysql object private $con; /// Current SQL query private $sql; /// Current result private $res = false; /// Current row private $row; /** * Constructor * * @param $dbconnexion Database Connnexion (must be a CommonDBTM object) * @param $table table name * @param $crit string or array of filed/values, ex array("id"=>1), if empty => all rows * (default '') **/ function __construct ($dbconnexion, $table, $crit="") { $this->conn = $dbconnexion; if (is_string($table) && strpos($table, " ")) { $this->sql = $table; } else { // Check field, orderby, limit, start in criterias $field = ""; $orderby = ""; $limit = 0; $start = 0; if (is_array($crit) && count($crit)) { foreach ($crit as $key => $val) { if ($key === "FIELDS") { $field = $val; unset($crit[$key]); } else if ($key === "ORDER") { $orderby = $val; unset($crit[$key]); } else if ($key === "LIMIT") { $limit = $val; unset($crit[$key]); } else if ($key === "START") { $start = $val; unset($crit[$key]); } } } // SELECT field list if (is_array($field)) { $this->sql = ""; foreach ($field as $t => $f) { if (is_numeric($t)) { $this->sql .= (empty($this->sql) ? "SELECT " : ",") . $f; } else if (is_array($f)) { $this->sql .= (empty($this->sql) ? "SELECT $t." : ",$t.") . implode(",$t.",$f); } else { $this->sql .= (empty($this->sql) ? "SELECT " : ",") . "$t.$f"; } } } else if (empty($field)) { $this->sql = "SELECT *"; } else { $this->sql = "SELECT `$field`"; } // FROM table list if (is_array($table)) { $this->sql .= " FROM `".implode("`, `",$table)."`"; } else { $this->sql .= " FROM `$table`"; } // WHERE criteria list if (!empty($crit)) { $this->sql .= " WHERE ".$this->analyseCrit($crit); } // ORDER BY if (is_array($orderby)) { $this->sql .= " ORDER BY `".implode("`, `",$orderby)."`"; } else if (!empty($orderby)) { $this->sql .= " ORDER BY `$orderby`"; } if (is_numeric($limit) && ($limit > 0)) { $this->sql .= " LIMIT $limit"; if (is_numeric($start) && ($start > 0)) { $this->sql .= " OFFSET $start"; } } } $this->res = $this->conn->query($this->sql); } function __destruct () { if ($this->res) { $this->conn->free_result($this->res); } } /** * @param $crit * @param $bool (default AND) **/ private function analyseCrit ($crit, $bool="AND") { if (!is_array($crit)) { return $crit; } $ret = ""; foreach ($crit as $name => $value) { if (!empty($ret)) { $ret .= " $bool "; } if (is_numeric($name)) { // No Key case => recurse. $ret .= "(" . $this->analyseCrit($value, $bool) . ")"; } else if (($name === "OR") || ($name === "AND")) { // Binary logical operator $ret .= "(" . $this->analyseCrit($value, $name) . ")"; } else if ($name === "NOT") { // Uninary logicial operator $ret .= " NOT (" . $this->analyseCrit($value, "AND") . ")"; } else if ($name === "FKEY") { // Foreign Key condition if (is_array($value) && (count($value) == 2)) { reset($value); list($t1,$f1) = each($value); list($t2,$f2) = each($value); $ret .= (is_numeric($t1) ? "$f1" : "$t1.$f1") . "=" . (is_numeric($t2) ? "$f2" : "$t2.$f2"); } else { trigger_error("BAD FOREIGN KEY", E_USER_ERROR); } } else if (is_array($value)) { // Array of Value $ret .= "$name IN ('". implode("','",$value)."')"; } else if (is_null($value)) { // NULL condition $ret .= "$name IS NULL"; } else if ((is_numeric($value)) || (preg_match("/^`.*?`$/", $value))) { // Integer or field name $ret .= "$name=$value"; } else { // String $ret .= "$name='$value'"; } } return $ret; } public function rewind() { if ($this->res && $this->conn->numrows($this->res)) { $this->conn->data_seek($this->res,0); } return $this->next(); } public function current() { return $this->row; } public function key() { return (isset($this->row["id"]) ? $this->row["id"] : 0); } public function next() { if (!$this->res) { return false; } $this->row = $this->conn->fetch_assoc($this->res); return $this->row; } public function valid() { return $this->res && $this->row; } public function numrows() { return ($this->res ? $this->conn->numrows($this->res) : 0); } } ?>glpi-0.84.3+dfsg.1/inc/devicecase.class.php000066400000000000000000000067421226600447100203130ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class DeviceCase class DeviceCase extends CommonDevice { static function getTypeName($nb=0) { return _n('Case', 'Cases', $nb); } function getAdditionalFields() { return array_merge(parent::getAdditionalFields(), array(array('name' => 'devicecasetypes_id', 'label' => __('Type'), 'type' => 'dropdownValue'))); } function getSearchOptions() { $tab = parent::getSearchOptions(); $tab[12]['table'] = 'glpi_devicecasetypes'; $tab[12]['field'] = 'name'; $tab[12]['name'] = __('Type'); $tab[12]['datatype'] = 'dropdown'; return $tab; } /** * @since version 0.84 * * @see CommonDevice::getHTMLTableHeader() **/ static function getHTMLTableHeader($itemtype, HTMLTableBase $base, HTMLTableSuperHeader $super=NULL, HTMLTableHeader $father=NULL, array $options=array()) { $column = parent::getHTMLTableHeader($itemtype, $base, $super, $father, $options); if ($column == $father) { return $father; } switch ($itemtype) { case 'Computer' : Manufacturer::getHTMLTableHeader(__CLASS__, $base, $super, $father, $options); break; } } /** * @since version 0.84 * * @see CommonDevice::getHTMLTableCellForItem() **/ function getHTMLTableCellForItem(HTMLTableRow $row=NULL, CommonDBTM $item=NULL, HTMLTableCell $father=NULL, array $options=array()) { $column = parent::getHTMLTableCellForItem($row, $item, $father, $options); if ($column == $father) { return $father; } switch ($item->getType()) { case 'Computer' : Manufacturer::getHTMLTableCellsForItem($row, $this, NULL, $options); break; } } /** * Criteria used for import function * * @see CommonDevice::getImportCriteria() * * @since version 0.84 **/ function getImportCriteria() { return array('designation' => 'equal', 'manufacturers_id' => 'equal', 'devicecasetypes_id' => 'equal'); } } ?> glpi-0.84.3+dfsg.1/inc/devicecasetype.class.php000066400000000000000000000026241226600447100212100ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class DeviceCaseType (Interface is a reserved keyword) class DeviceCaseType extends CommonDropdown { static function getTypeName($nb=0) { return _n('Case type', 'Case types', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/devicecontrol.class.php000066400000000000000000000072401226600447100210520ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class DeviceControl class DeviceControl extends CommonDevice { static function getTypeName($nb=0) { return _n('Controller', 'Controllers', $nb); } function getAdditionalFields() { return array_merge(parent::getAdditionalFields(), array(array('name' => 'is_raid', 'label' => __('RAID'), 'type' => 'bool'), array('name' => 'interfacetypes_id', 'label' => __('Interface'), 'type' => 'dropdownValue'))); } function getSearchOptions() { $tab = parent::getSearchOptions(); $tab[12]['table'] = $this->getTable(); $tab[12]['field'] = 'is_raid'; $tab[12]['name'] = __('RAID'); $tab[12]['datatype'] = 'bool'; $tab[14]['table'] = 'glpi_interfacetypes'; $tab[14]['field'] = 'name'; $tab[14]['name'] = __('Interface'); $tab[14]['datatype'] = 'dropdown'; return $tab; } /** * @since version 0.84 * * @see CommonDevice::getHTMLTableHeader() **/ static function getHTMLTableHeader($itemtype, HTMLTableBase $base, HTMLTableSuperHeader $super=NULL, HTMLTableHeader $father=NULL, array $options=array()) { $column = parent::getHTMLTableHeader($itemtype, $base, $super, $father, $options); if ($column == $father) { return $father; } switch ($itemtype) { case 'Computer' : Manufacturer::getHTMLTableHeader(__CLASS__, $base, $super, $father, $options); InterfaceType::getHTMLTableHeader(__CLASS__, $base, $super, $father, $options); break; } } /** * @since version 0.84 * * @see CommonDevice::getHTMLTableCellForItem() **/ function getHTMLTableCellForItem(HTMLTableRow $row=NULL, CommonDBTM $item=NULL, HTMLTableCell $father=NULL, array $options=array()) { $column = parent::getHTMLTableCellForItem($row, $item, $father, $options); if ($column == $father) { return $father; } switch ($item->getType()) { case 'Computer' : Manufacturer::getHTMLTableCellsForItem($row, $this, NULL, $options); InterfaceType::getHTMLTableCellsForItem($row, $this, NULL, $options); } } } ?>glpi-0.84.3+dfsg.1/inc/devicedrive.class.php000066400000000000000000000116321226600447100205030ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class DeviceDrive class DeviceDrive extends CommonDevice { static function getTypeName($nb=0) { return _n('Drive', 'Drives', $nb); } function getAdditionalFields() { return array_merge(parent::getAdditionalFields(), array(array('name' => 'is_writer', 'label' => __('Writing ability'), 'type' => 'bool'), array('name' => 'speed', 'label' => __('Speed'), 'type' => 'text'), array('name' => 'interfacetypes_id', 'label' => __('Interface'), 'type' => 'dropdownValue'))); } function getSearchOptions() { $tab = parent::getSearchOptions(); $tab[12]['table'] = $this->getTable(); $tab[12]['field'] = 'is_writer'; $tab[12]['name'] = __('Writing ability'); $tab[12]['datatype'] = 'bool'; $tab[13]['table'] = $this->getTable(); $tab[13]['field'] = 'speed'; $tab[13]['name'] = __('Speed'); $tab[13]['datatype'] = 'string'; $tab[14]['table'] = 'glpi_interfacetypes'; $tab[14]['field'] = 'name'; $tab[14]['name'] = __('Interface'); $tab[14]['datatype'] = 'dropdown'; return $tab; } /** * @since version 0.84 * * @see CommonDevice::getHTMLTableHeader() **/ static function getHTMLTableHeader($itemtype, HTMLTableBase $base, HTMLTableSuperHeader $super=NULL, HTMLTableHeader $father=NULL, array $options=array()) { $column = parent::getHTMLTableHeader($itemtype, $base, $super, $father, $options); if ($column == $father) { return $father; } switch ($itemtype) { case 'Computer' : Manufacturer::getHTMLTableHeader(__CLASS__, $base, $super, $father, $options); $base->addHeader('devicedrive_writer', __('Writing ability'), $super, $father); $base->addHeader('devicedrive_speed', __('Speed'), $super, $father); InterfaceType::getHTMLTableHeader(__CLASS__, $base, $super, $father, $options); break; } } /** * @since version 0.84 * * @see CommonDevice::getHTMLTableCellForItem() **/ function getHTMLTableCellForItem(HTMLTableRow $row=NULL, CommonDBTM $item=NULL, HTMLTableCell $father=NULL, array $options=array()) { $column = parent::getHTMLTableCellForItem($row, $item, $father, $options); if ($column == $father) { return $father; } switch ($item->getType()) { case 'Computer' : Manufacturer::getHTMLTableCellsForItem($row, $this, NULL, $options); if ($this->fields["is_writer"]) { $row->addCell($row->getHeaderByName('devicedrive_writer'), Dropdown::getYesNo($this->fields["is_writer"]), $father); } if ($this->fields["speed"]) { $row->addCell($row->getHeaderByName('devicedrive_speed'), $this->fields["speed"], $father); } InterfaceType::getHTMLTableCellsForItem($row, $this, NULL, $options); } } /** * Criteria used for import function * * @see CommonDevice::getImportCriteria() * * @since version 0.84 **/ function getImportCriteria() { return array('designation' => 'equal', 'manufacturers_id' => 'equal', 'interfacetypes_id' => 'equal'); } } ?>glpi-0.84.3+dfsg.1/inc/devicegraphiccard.class.php000066400000000000000000000101651226600447100216410ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class DeviceGraphicCard class DeviceGraphicCard extends CommonDevice { static function getTypeName($nb=0) { return _n('Graphics card', 'Graphics cards', $nb); } function getAdditionalFields() { return array_merge(parent::getAdditionalFields(), array(array('name' => 'memory_default', 'label' => __('Memory by default'), 'type' => 'text', 'unit' => __('Mio')), array('name' => 'interfacetypes_id', 'label' => __('Interface'), 'type' => 'dropdownValue'))); } function getSearchOptions() { $tab = parent::getSearchOptions(); $tab[12]['table'] = $this->getTable(); $tab[12]['field'] = 'memory_default'; $tab[12]['name'] = __('Memory by default'); $tab[12]['datatype'] = 'string'; $tab[14]['table'] = 'glpi_interfacetypes'; $tab[14]['field'] = 'name'; $tab[14]['name'] = __('Interface'); $tab[14]['datatype'] = 'dropdown'; return $tab; } /** * @since version 0.84 * * @see CommonDevice::getHTMLTableHeader() **/ static function getHTMLTableHeader($itemtype, HTMLTableBase $base, HTMLTableSuperHeader $super=NULL, HTMLTableHeader $father=NULL, array $options=array()) { $column = parent::getHTMLTableHeader($itemtype, $base, $super, $father, $options); if ($column == $father) { return $father; } switch ($itemtype) { case 'Computer' : Manufacturer::getHTMLTableHeader(__CLASS__, $base, $super, $father, $options); InterfaceType::getHTMLTableHeader(__CLASS__, $base, $super, $father, $options); break; } } /** * @since version 0.84 * * @see CommonDevice::getHTMLTableCellForItem() **/ function getHTMLTableCellForItem(HTMLTableRow $row=NULL, CommonDBTM $item=NULL, HTMLTableCell $father=NULL, array $options=array()) { $column = parent::getHTMLTableCellForItem($row, $item, $father, $options); if ($column == $father) { return $father; } switch ($item->getType()) { case 'Computer' : Manufacturer::getHTMLTableCellsForItem($row, $this, NULL, $options); InterfaceType::getHTMLTableCellsForItem($row, $this, NULL, $options); break; } } /** * Criteria used for import function * * @see CommonDevice::getImportCriteria() * * @since version 0.84 **/ function getImportCriteria() { return array('designation' => 'equal', 'manufacturers_id' => 'equal', 'interfacetypes_id' => 'equal'); } } ?>glpi-0.84.3+dfsg.1/inc/deviceharddrive.class.php000066400000000000000000000123611226600447100213420ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class DeviceHardDrive class DeviceHardDrive extends CommonDevice { static function getTypeName($nb=0) { return _n('Hard drive', 'Hard drives', $nb); } function getAdditionalFields() { return array_merge(parent::getAdditionalFields(), array(array('name' => 'capacity_default', 'label' => __('Capacity by default'), 'type' => 'text', 'unit' => __('Mio')), array('name' => 'rpm', 'label' => __('Rpm'), 'type' => 'text'), array('name' => 'cache', 'label' => __('Cache'), 'type' => 'text', 'unit' => __('Mio')), array('name' => 'interfacetypes_id', 'label' => __('Interface'), 'type' => 'dropdownValue'))); } function getSearchOptions() { $tab = parent::getSearchOptions(); $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'capacity_default'; $tab[11]['name'] = __('Capacity by default'); $tab[11]['datatype'] = 'string'; $tab[12]['table'] = $this->getTable(); $tab[12]['field'] = 'rpm'; $tab[12]['name'] = __('Rpm'); $tab[12]['datatype'] = 'string'; $tab[13]['table'] = $this->getTable(); $tab[13]['field'] = 'cache'; $tab[13]['name'] = __('Cache'); $tab[13]['datatype'] = 'string'; $tab[14]['table'] = 'glpi_interfacetypes'; $tab[14]['field'] = 'name'; $tab[14]['name'] = __('Interface'); $tab[14]['datatype'] = 'dropdown'; return $tab; } /** * @since version 0.84 * * @see CommonDevice::getHTMLTableHeader() **/ static function getHTMLTableHeader($itemtype, HTMLTableBase $base, HTMLTableSuperHeader $super=NULL, HTMLTableHeader $father=NULL, array $options=array()) { $column = parent::getHTMLTableHeader($itemtype, $base, $super, $father, $options); if ($column == $father) { return $father; } switch ($itemtype) { case 'Computer' : Manufacturer::getHTMLTableHeader(__CLASS__, $base, $super, $father, $options); $base->addHeader('deviceharddriver_rpm', __('Rpm'), $super, $father); $base->addHeader('deviceharddriver_cache', __('Cache'), $super, $father); InterfaceType::getHTMLTableHeader(__CLASS__, $base, $super, $father, $options); break; } } function getHTMLTableCellForItem(HTMLTableRow $row=NULL, CommonDBTM $item=NULL, HTMLTableCell $father=NULL, array $options=array()) { $column = parent::getHTMLTableCellForItem($row, $item, $father, $options); if ($column == $father) { return $father; } switch ($item->getType()) { case 'Computer' : Manufacturer::getHTMLTableCellsForItem($row, $this, NULL, $options); if ($this->fields["rpm"]) { $row->addCell($row->getHeaderByName('deviceharddriver_rpm'), $this->fields["rpm"]); } if ($this->fields["cache"]) { $row->addCell($row->getHeaderByName('deviceharddriver_cache'), $this->fields["cache"]); } InterfaceType::getHTMLTableCellsForItem($row, $this, NULL, $options); break; } } /** * Criteria used for import function * * @see CommonDevice::getImportCriteria() * * @since version 0.84 **/ function getImportCriteria() { return array('designation' => 'equal', 'manufacturers_id' => 'equal', 'interfacetypes_id' => 'equal'); } } ?>glpi-0.84.3+dfsg.1/inc/devicememory.class.php000066400000000000000000000121531226600447100207010ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class DeviceMemory class DeviceMemory extends CommonDevice { static function getTypeName($nb=0) { return _n('Memory', 'Memories', $nb); } function getAdditionalFields() { return array_merge(parent::getAdditionalFields(), array(array('name' => 'size_default', 'label' => __('Size by default'), 'type' => 'text', 'unit' => __('Mio')), array('name' => 'frequence', 'label' => __('Frequency'), 'type' => 'text', 'unit' => __('MHz')), array('name' => 'devicememorytypes_id', 'label' => __('Type'), 'type' => 'dropdownValue'))); } function getSearchOptions() { $tab = parent::getSearchOptions(); $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'size_default'; $tab[11]['name'] = __('Size by default'); $tab[11]['datatype'] = 'string'; $tab[12]['table'] = $this->getTable(); $tab[12]['field'] = 'frequence'; $tab[12]['name'] = __('Frequency'); $tab[12]['datatype'] = 'string'; $tab[13]['table'] = 'glpi_devicememorytypes'; $tab[13]['field'] = 'name'; $tab[13]['name'] = __('Type'); $tab[13]['datatype'] = 'dropdown'; return $tab; } /** * @since version 0.84 * * @see CommonDevice::getHTMLTableHeader() **/ static function getHTMLTableHeader($itemtype, HTMLTableBase $base, HTMLTableSuperHeader $super=NULL, HTMLTableHeader $father=NULL, array $options=array()) { $column = parent::getHTMLTableHeader($itemtype, $base, $super, $father, $options); if ($column == $father) { return $father; } switch ($itemtype) { case 'Computer' : Manufacturer::getHTMLTableHeader(__CLASS__, $base, $super, $father, $options); $base->addHeader('devicememory_type', __('Type'), $super, $father); $base->addHeader('devicememory_frequency', __('Frequency'), $super, $father); break; } } /** * @since version 0.84 * * @see CommonDevice::getHTMLTableCellForItem() **/ function getHTMLTableCellForItem(HTMLTableRow $row=NULL, CommonDBTM $item=NULL, HTMLTableCell $father=NULL, array $options=array()) { $column = parent::getHTMLTableCellForItem($row, $item, $father, $options); if ($column == $father) { return $father; } switch ($item->getType()) { case 'Computer' : Manufacturer::getHTMLTableCellsForItem($row, $this, NULL, $options); if ($this->fields["devicememorytypes_id"]) { $row->addCell($row->getHeaderByName('devicememory_type'), Dropdown::getDropdownName("glpi_devicememorytypes", $this->fields["devicememorytypes_id"]), $father); } if (!empty($this->fields["frequence"])) { $row->addCell($row->getHeaderByName('devicememory_frequency'), $this->fields["frequence"], $father); } break; } } /** * Criteria used for import function * * @see CommonDevice::getImportCriteria() * * @since version 0.84 **/ function getImportCriteria() { return array('designation' => 'equal', 'devicememorytypes_id' => 'equal', 'manufacturers_id' => 'equal', 'frequence' => 'delta:10'); } } ?>glpi-0.84.3+dfsg.1/inc/devicememorytype.class.php000066400000000000000000000025741226600447100216110ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class DeviceMemoryType class DeviceMemoryType extends CommonDropdown { static function getTypeName($nb=0) { return _n('Memory type', 'Memory types', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/devicemotherboard.class.php000066400000000000000000000067541226600447100217110ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class DeviceMotherboard class DeviceMotherboard extends CommonDevice { static function getTypeName($nb=0) { return _n('System board', 'System boards', $nb); } function getAdditionalFields() { return array_merge(parent::getAdditionalFields(), array(array('name' => 'chipset', 'label' => __('Chipset'), 'type' => 'text'))); } function getSearchOptions() { $tab = parent::getSearchOptions(); $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'chipset'; $tab[11]['name'] = __('Chipset'); $tab[11]['datatype'] = 'string'; return $tab; } /** * @since version 0.84 * * @see CommonDevice::getHTMLTableHeader() **/ static function getHTMLTableHeader($itemtype, HTMLTableBase $base, HTMLTableSuperHeader $super=NULL, HTMLTableHeader $father=NULL, array $options=array()) { $column = parent::getHTMLTableHeader($itemtype, $base, $super, $father, $options); if ($column == $father) { return $father; } switch ($itemtype) { case 'Computer' : Manufacturer::getHTMLTableHeader(__CLASS__, $base, $super, $father, $options); break; } } /** * @since version 0.84 * * @see CommonDevice::getHTMLTableCellForItem() **/ function getHTMLTableCellForItem(HTMLTableRow $row=NULL, CommonDBTM $item=NULL, HTMLTableCell $father=NULL, array $options=array()) { $column = parent::getHTMLTableCellForItem($row, $item, $father, $options); if ($column == $father) { return $father; } switch ($item->getType()) { case 'Computer' : Manufacturer::getHTMLTableCellsForItem($row, $this, NULL, $options); break; } } /** * Criteria used for import function * * @see CommonDevice::getImportCriteria() * * @since version 0.84 **/ function getImportCriteria() { return array('designation' => 'equal', 'manufacturers_id' => 'equal', 'chipset' => 'equal'); } } ?>glpi-0.84.3+dfsg.1/inc/devicenetworkcard.class.php000066400000000000000000000136321226600447100217170ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class DeviceNetworkCard class DeviceNetworkCard extends CommonDevice { static function getTypeName($nb=0) { return _n('Network card', 'Network cards', $nb); } /** * Criteria used for import function * * @since version 0.84 **/ function getImportCriteria() { return array('designation' => 'equal', 'manufacturers_id' => 'equal', 'mac' => 'equal'); } function getAdditionalFields() { return array_merge(parent::getAdditionalFields(), array(array('name' => 'mac_default', 'label' => __('MAC address by default'), 'type' => 'text'), array('name' => 'bandwidth', 'label' => __('Flow'), 'type' => 'text'))); } function getSearchOptions() { $tab = parent::getSearchOptions(); $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'mac_default'; $tab[11]['name'] = __('MAC address by default'); $tab[11]['datatype'] = 'string'; $tab[12]['table'] = $this->getTable(); $tab[12]['field'] = 'bandwidth'; $tab[12]['name'] = __('Flow'); $tab[12]['datatype'] = 'string'; return $tab; } /** * Import a device if not exists * * @param $input array of datas * * @return interger ID of existing or new Device **/ function import(array $input) { global $DB; if (!isset($input['designation']) || empty($input['designation'])) { return 0; } $query = "SELECT `id` FROM `".$this->getTable()."` WHERE `designation` = '" . $input['designation'] . "'"; if (isset($input["bandwidth"])) { $query .= " AND `bandwidth` = '".$input["bandwidth"]."'"; } $result = $DB->query($query); if ($DB->numrows($result) > 0) { $line = $DB->fetch_assoc($result); return $line['id']; } return $this->add($input); } /** * @since version 0.84 * * @see CommonDevice::getHTMLTableHeader() **/ static function getHTMLTableHeader($itemtype, HTMLTableBase $base, HTMLTableSuperHeader $super=NULL, HTMLTableHeader $father=NULL, array $options=array()) { $column_name = __CLASS__; if (isset($options['dont_display'][$column_name])) { return; } if (in_array($itemtype, NetworkPort::getNetworkPortInstantiations())) { $base->addHeader($column_name, __('Interface'), $super, $father); } else { $column = parent::getHTMLTableHeader($itemtype, $base, $super, $father, $options); if ($column == $father) { return $father; } Manufacturer::getHTMLTableHeader(__CLASS__, $base, $super, $father, $options); $base->addHeader('devicenetworkcard_bandwidth', __('Flow'), $super, $father); } } /** * @since version 0.84 * * @see CommonDevice::getHTMLTableCellForItem() **/ static function getHTMLTableCellsForItem(HTMLTableRow $row=NULL, CommonDBTM $item=NULL, HTMLTableCell $father=NULL, array $options=array()) { $column_name = __CLASS__; if (isset($options['dont_display'][$column_name])) { return; } if (empty($item)) { if (empty($father)) { return; } $item = $father->getItem(); } if (in_array($item->getType(), NetworkPort::getNetworkPortInstantiations())) { $link = new Item_DeviceNetworkCard(); if ($link->getFromDB($item->fields['items_devicenetworkcards_id'])) { $device = $link->getOnePeer(1); if ($device) { $row->addCell($row->getHeaderByName($column_name), $device->getLink(), $father); } } } } function getHTMLTableCellForItem(HTMLTableRow $row=NULL, CommonDBTM $item=NULL, HTMLTableCell $father=NULL, array $options=array()) { $column = parent::getHTMLTableCellForItem($row, $item, $father, $options); if ($column == $father) { return $father; } switch ($item->getType()) { case 'Computer' : Manufacturer::getHTMLTableCellsForItem($row, $this, NULL, $options); if ($this->fields["bandwidth"]) { $row->addCell($row->getHeaderByName('devicenetworkcard_bandwidth'), $this->fields["bandwidth"], $father); } break; } } } ?>glpi-0.84.3+dfsg.1/inc/devicepci.class.php000066400000000000000000000025541226600447100201500ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class DevicePci class DevicePci extends CommonDevice { static function getTypeName($nb=0) { return _n('Other component', 'Other components', $nb); } } ?>glpi-0.84.3+dfsg.1/inc/devicepowersupply.class.php000066400000000000000000000067341226600447100220120ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class DevicePowerSupply class DevicePowerSupply extends CommonDevice { static function getTypeName($nb=0) { return _n('Power supply', 'Power supplies', $nb); } function getAdditionalFields() { return array_merge(parent::getAdditionalFields(), array(array('name' => 'is_atx', 'label' => __('ATX'), 'type' => 'bool'), array('name' => 'power', 'label' => __('Power'), 'type' => 'text'))); } function getSearchOptions() { $tab = parent::getSearchOptions(); $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'is_atx'; $tab[11]['name'] = __('ATX'); $tab[11]['datatype'] = 'bool'; $tab[12]['table'] = $this->getTable(); $tab[12]['field'] = 'power'; $tab[12]['name'] = __('Power'); $tab[12]['datatype'] = 'string'; return $tab; } /** * @since version 0.84 * * @see CommonDevice::getHTMLTableHeader() **/ static function getHTMLTableHeader($itemtype, HTMLTableBase $base, HTMLTableSuperHeader $super=NULL, HTMLTableHeader $father=NULL, array $options=array()) { $column = parent::getHTMLTableHeader($itemtype, $base, $super, $father, $options); if ($column == $father) { return $father; } switch ($itemtype) { case 'Computer' : Manufacturer::getHTMLTableHeader(__CLASS__, $base, $super, $father, $options); break; } } /** * @since version 0.84 * * @see CommonDevice::getHTMLTableCellForItem() **/ function getHTMLTableCellForItem(HTMLTableRow $row=NULL, CommonDBTM $item=NULL, HTMLTableCell $father=NULL, array $options=array()) { $column = parent::getHTMLTableCellForItem($row, $item, $father, $options); if ($column == $father) { return $father; } switch ($item->getType()) { case 'Computer' : Manufacturer::getHTMLTableCellsForItem($row, $this, NULL, $options); } } } ?>glpi-0.84.3+dfsg.1/inc/deviceprocessor.class.php000066400000000000000000000102711226600447100214070ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class DeviceProcessor class DeviceProcessor extends CommonDevice { static function getTypeName($nb=0) { return _n('Processor', 'Processors', $nb); } function getAdditionalFields() { return array_merge(parent::getAdditionalFields(), array(array('name' => 'frequency_default', 'label' => __('Frequency by default'), 'type' => 'text', 'unit' => __('MHz')), array('name' => 'frequence', 'label' => __('Frequency'), 'type' => 'text', 'unit' => __('MHz')))); } function getSearchOptions() { $tab = parent::getSearchOptions(); $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'frequency_default'; $tab[11]['name'] = __('Frequency by default'); $tab[11]['datatype'] = 'string'; $tab[12]['table'] = $this->getTable(); $tab[12]['field'] = 'frequence'; $tab[12]['name'] = __('Frequency'); $tab[12]['datatype'] = 'string'; return $tab; } function prepareInputForAdd($input) { if (isset($input['frequence']) && !is_numeric($input['frequence'])) { $input['frequence'] = 0; } return $input; } /** * @since version 0.84 * * @see CommonDevice::getHTMLTableHeader() **/ static function getHTMLTableHeader($itemtype, HTMLTableBase $base, HTMLTableSuperHeader $super=NULL, HTMLTableHeader $father=NULL, array $options=array()) { $column = parent::getHTMLTableHeader($itemtype, $base, $super, $father, $options); if ($column == $father) { return $father; } switch ($itemtype) { case 'Computer' : Manufacturer::getHTMLTableHeader(__CLASS__, $base, $super, $father, $options); break; } } /** * @since version 0.84 * * @see CommonDevice::getHTMLTableCellForItem() **/ function getHTMLTableCellForItem(HTMLTableRow $row=NULL, CommonDBTM $item=NULL, HTMLTableCell $father=NULL, array $options=array()) { $column = parent::getHTMLTableCellForItem($row, $item, $father, $options); if ($column == $father) { return $father; } switch ($item->getType()) { case 'Computer' : Manufacturer::getHTMLTableCellsForItem($row, $this, NULL, $options); break; } } /** * Criteria used for import function * * @see CommonDevice::getImportCriteria() * * @since version 0.84 **/ function getImportCriteria() { return array('designation' => 'equal', 'manufacturers_id' => 'equal', 'frequence' => 'delta:10'); } } ?>glpi-0.84.3+dfsg.1/inc/devicesoundcard.class.php000066400000000000000000000066151226600447100213610ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class DeviceSoundCard class DeviceSoundCard extends CommonDevice { static function getTypeName($nb=0) { return _n('Soundcard', 'Soundcards', $nb); } function getAdditionalFields() { return array_merge(parent::getAdditionalFields(), array(array('name' => 'type', 'label' => __('Type'), 'type' => 'text'))); } function getSearchOptions() { $tab = parent::getSearchOptions(); $tab[12]['table'] = $this->getTable(); $tab[12]['field'] = 'type'; $tab[12]['name'] = __('Type'); $tab[12]['datatype'] = 'string'; return $tab; } /** * @since version 0.84 * * @see CommonDevice::getHTMLTableHeader() **/ static function getHTMLTableHeader($itemtype, HTMLTableBase $base, HTMLTableSuperHeader $super=NULL, HTMLTableHeader $father=NULL, array $options=array()) { $column = parent::getHTMLTableHeader($itemtype, $base, $super, $father, $options); if ($column == $father) { return $father; } switch ($itemtype) { case 'Computer' : Manufacturer::getHTMLTableHeader(__CLASS__, $base, $super, $father, $options); $base->addHeader('devicesoundcard_type', __('Type'), $super, $father); break; } } /** * @since version 0.84 * * @see CommonDevice::getHTMLTableCellForItem() **/ function getHTMLTableCellForItem(HTMLTableRow $row=NULL, CommonDBTM $item=NULL, HTMLTableCell $father=NULL, array $options=array()) { $column = parent::getHTMLTableCellForItem($row, $item, $father, $options); if ($column == $father) { return $father; } switch ($item->getType()) { case 'Computer' : Manufacturer::getHTMLTableCellsForItem($row, $this, NULL, $options); if ($this->fields["type"]) { $row->addCell($row->getHeaderByName('devicesoundcard_type'), $this->fields["type"], $father); } } } } ?>glpi-0.84.3+dfsg.1/inc/displaypreference.class.php000066400000000000000000000560221226600447100217200ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class DisplayPreference extends CommonDBTM { // From CommonDBTM var $auto_message_on_action = false; protected $displaylist = false; /** * @see CommonDBTM::prepareInputForAdd() **/ function prepareInputForAdd($input) { global $DB; $query = "SELECT MAX(`rank`) FROM `".$this->getTable()."` WHERE `itemtype` = '".$input["itemtype"]."' AND `users_id` = '".$input["users_id"]."'"; $result = $DB->query($query); $input["rank"] = $DB->result($result,0,0)+1; return $input; } /** * @since version 0.84 * * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "delete_for_user" : if (isset($input['users_id'])) { foreach ($input["item"] as $key => $val) { if ($val == 1) { //Get software name and manufacturer if ($input['users_id'] == Session::getLoginUserID()) { //Process rules if ($this->deleteByCriteria(array('users_id' => $input['users_id'], 'itemtype' => $key))) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } } } else { $res['ko']++; } break; default : return parent::doSpecificMassiveActions($input); } return $res; } /** * Get display preference for a user for an itemtype * * @param $itemtype itemtype * @param $user_id user ID **/ static function getForTypeUser($itemtype, $user_id) { global $DB; // Add default items for user $query = "SELECT * FROM `glpi_displaypreferences` WHERE `itemtype` = '$itemtype' AND `users_id` = '$user_id' ORDER BY `rank`"; $result = $DB->query($query); // GET default serach options if ($DB->numrows($result) == 0) { $query = "SELECT * FROM `glpi_displaypreferences` WHERE `itemtype` = '$itemtype' AND `users_id` = '0' ORDER BY `rank`"; $result = $DB->query($query); } $prefs = array(); if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { array_push($prefs, $data["num"]); } } return $prefs; } /** * Active personal config based on global one * * @param $input array parameter (itemtype,users_id) **/ function activatePerso(array $input) { global $DB; if (!Session::haveRight("search_config", "w")) { return false; } $query = "SELECT * FROM `".$this->getTable()."` WHERE `itemtype` = '".$input["itemtype"]."' AND `users_id` = '0'"; $result = $DB->query($query); if ($DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { unset($data["id"]); $data["users_id"] = $input["users_id"]; $this->fields = $data; $this->addToDB(); } } else { // No items in the global config $searchopt = Search::getOptions($input["itemtype"]); if (count($searchopt) > 1) { $done = false; foreach ($searchopt as $key => $val) { if (is_array($val) && ($key != 1) && !$done) { $data["users_id"] = $input["users_id"]; $data["itemtype"] = $input["itemtype"]; $data["rank"] = 1; $data["num"] = $key; $this->fields = $data; $this->addToDB(); $done = true; } } } } } /** * Order to move an item * * @param $input array parameter (id,itemtype,users_id) * @param $action up or down **/ function orderItem(array $input, $action) { global $DB; // Get current item $query = "SELECT `rank` FROM `".$this->getTable()."` WHERE `id` = '".$input['id']."'"; $result = $DB->query($query); $rank1 = $DB->result($result, 0, 0); // Get previous or next item $query = "SELECT `id`, `rank` FROM `".$this->getTable()."` WHERE `itemtype` = '".$input['itemtype']."' AND `users_id` = '".$input["users_id"]."'"; switch ($action) { case "up" : $query .= " AND `rank` < '$rank1' ORDER BY `rank` DESC"; break; case "down" : $query .= " AND `rank` > '$rank1' ORDER BY `rank` ASC"; break; default : return false; } $result = $DB->query($query); $rank2 = $DB->result($result, 0, "rank"); $ID2 = $DB->result($result, 0, "id"); // Update items $query = "UPDATE `".$this->getTable()."` SET `rank` = '$rank2' WHERE `id` = '".$input['id']."'"; $DB->query($query); $query = "UPDATE `".$this->getTable()."` SET `rank` = '$rank1' WHERE `id` = '$ID2'"; $DB->query($query); } /** * Print the search config form * * @param $target form target * @param $itemtype item type * * @return nothing **/ function showFormPerso($target, $itemtype) { global $CFG_GLPI, $DB; $searchopt = Search::getCleanedOptions($itemtype); if (!is_array($searchopt)) { return false; } $item = NULL; if ($itemtype != 'AllAssets') { $item = getItemForItemtype($itemtype); } $IDuser = Session::getLoginUserID(); echo "
"; // Defined items $query = "SELECT * FROM `".$this->getTable()."` WHERE `itemtype` = '$itemtype' AND `users_id` = '$IDuser' ORDER BY `rank`"; $result = $DB->query($query); $numrows = 0; $numrows = $DB->numrows($result); if ($numrows == 0) { Session::checkRight("search_config", "w"); echo "
"; echo ""; echo ""; echo ""; echo __('No personal criteria. Create personal parameters?').""; echo ""; echo ""; Html::closeForm(); echo "
\n"; } else { $already_added = self::getForTypeUser($itemtype, $IDuser); echo ""; echo "\n"; // print first element echo ""; echo ""; echo ""; echo ""; // print entity if (Session::isMultiEntitiesMode() && (isset($CFG_GLPI["union_search_type"][$itemtype]) || ($item && $item->maybeRecursive()) || (count($_SESSION["glpiactiveentities"]) > 1)) && isset($searchopt[80])) { echo ""; echo ""; echo ""; echo ""; } $i = 0; if ($numrows) { while ($data = $DB->fetch_assoc($result)) { if (($data["num"] !=1) && isset($searchopt[$data["num"]])) { echo ""; echo ""; if ($i != 0) { echo "\n"; } else { echo ""; } if ($i != ($numrows-1)) { echo "\n"; } else { echo ""; } echo "\n"; echo ""; $i++; } } } echo "
"; echo __('Select default items to show')."
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; Html::closeForm(); echo "
".$searchopt[1]["name"]." 
".$searchopt[80]["name"]." 
"; echo $searchopt[$data["num"]]["name"].""; echo ""; echo ""; echo ""; echo ""; echo ""; Html::closeForm(); echo " "; echo ""; echo ""; echo ""; echo ""; echo ""; Html::closeForm(); echo " "; echo ""; echo ""; echo ""; echo ""; echo ""; Html::closeForm(); echo "
"; } echo "
"; } /** * Print the search config form * * @param $target form target * @param $itemtype item type * * @return nothing **/ function showFormGlobal($target, $itemtype) { global $CFG_GLPI, $DB; $searchopt = Search::getOptions($itemtype); if (!is_array($searchopt)) { return false; } $IDuser = 0; $item = NULL; if ($itemtype != 'AllAssets') { $item = getItemForItemtype($itemtype); } $global_write = Session::haveRight("search_config_global", "w"); echo "
"; // Defined items $query = "SELECT * FROM `".$this->getTable()."` WHERE `itemtype` = '$itemtype' AND `users_id` = '$IDuser' ORDER BY `rank`"; $result = $DB->query($query); $numrows = $DB->numrows($result); echo "\n"; if ($global_write) { $already_added = self::getForTypeUser($itemtype, $IDuser); echo ""; } // print first element echo ""; echo ""; // print entity if (Session::isMultiEntitiesMode() && (isset($CFG_GLPI["union_search_type"][$itemtype]) || ($item && $item->maybeRecursive()) || (count($_SESSION["glpiactiveentities"]) > 1)) && isset($searchopt[80])) { echo ""; echo ""; echo ""; echo ""; } $i = 0; if ($numrows) { while ($data=$DB->fetch_assoc($result)) { if (($data["num"] != 1) && isset($searchopt[$data["num"]])) { echo ""; if ($global_write) { if ($i != 0) { echo ""; } else { echo "\n"; } if ($i != ($numrows-1)) { echo ""; } else { echo "\n"; } echo "\n"; } echo ""; $i++; } } } echo "
"; echo __('Select default items to show')."
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; Html::closeForm(); echo "
".$searchopt[1]["name"]; if ($global_write) { echo " "; } echo "
".$searchopt[80]["name"]." 
"; echo $searchopt[$data["num"]]["name"]; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; Html::closeForm(); echo " "; echo ""; echo ""; echo ""; echo ""; echo ""; Html::closeForm(); echo " "; echo ""; echo ""; echo ""; echo ""; echo ""; Html::closeForm(); echo "
"; echo "
"; } /** * show defined display preferences for a user * * @param $users_id integer user ID **/ static function showForUser($users_id) { global $DB; $url = Toolbox::getItemTypeFormURL(__CLASS__); $query = "SELECT `itemtype`, COUNT(*) AS nb FROM `glpi_displaypreferences` WHERE `users_id` = '$users_id' GROUP BY `itemtype`"; $req = $DB->request($query); if ($req->numrows() > 0) { $rand = mt_rand(); echo "
"; Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $paramsma = array('width' => 400, 'height' => 200, 'specific_actions' => array('delete_for_user' => _x('button', 'Delete permanently'))); Html::showMassiveActions(__CLASS__, $paramsma); echo ""; echo ""; echo ""; echo ""; echo ""; foreach ($req as $data) { echo ""; if ($item = getItemForItemtype($data["itemtype"])) { $name = $item->getTypeName(1); } else { $name = $data["itemtype"]; } echo ""; echo ""; } echo "
"; Html::checkAllAsCheckbox('mass'.__CLASS__.$rand); echo "".__('Type')."
"; Html::showMassiveActionCheckBox(__CLASS__, $data["itemtype"]); echo "$name".$data['nb']."
"; $paramsma['ontop'] = false; Html::showMassiveActions(__CLASS__, $paramsma); Html::closeForm(); echo "
"; } else { echo ""; echo ""; echo "
".__('No item found')."
"; } } /** * For tab management : force isNewItem * * @since version 0.83 **/ function isNewItem() { return false; } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab(__CLASS__, $ong, $options); $ong['no_all_tab'] = true; return $ong; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { switch ($item->getType()) { case 'Preference' : if (Session::haveRight('search_config', 'w')) { return __('Personal View'); } break; case __CLASS__: $ong = array(); $ong[1] = __('Global View'); if (Session::haveRight('search_config', 'w')) { $ong[2] = __('Personal View'); } return $ong; } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($item->getType()) { case 'Preference' : self::showForUser(Session::getLoginUserID()); return true; case __CLASS__ : switch ($tabnum) { case 1 : $item->showFormGlobal($_POST['target'], $_POST["displaytype"]); return true; case 2 : Session::checkRight('search_config', 'w'); $item->showFormPerso($_POST['target'], $_POST["displaytype"]); return true; } } return false; } } ?> glpi-0.84.3+dfsg.1/inc/document.class.php000066400000000000000000001267721226600447100200440ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Document class **/ class Document extends CommonDBTM { // From CommonDBTM public $dohistory = true; static protected $forward_entity_to = array('Document_Item'); static function getTypeName($nb=0) { return _n('Document', 'Documents', $nb); } static function canCreate() { // Have right to add document OR ticket followup return Session::haveRight('document', 'w') || Session::haveRight('add_followups', '1'); } static function canUpdate() { return Session::haveRight('document', 'w'); } function canCreateItem() { if (isset($this->input['itemtype']) && isset($this->input['items_id'])) { if ($item = getItemForItemtype($this->input['itemtype'])) { if ($item->canAddItem('Document')) { return true; } } } // From Ticket Document Tab => check right to add followup. if (isset($this->fields['tickets_id']) && ($this->fields['tickets_id'] > 0)) { $ticket = new Ticket(); if ($ticket->getFromDB($this->fields['tickets_id'])) { return $ticket->canAddFollowups(); } } if (Session::haveRight('document', 'w')) { return parent::canCreateItem(); } return false; } static function canView() { return Session::haveRight('document', 'r'); } function cleanDBonPurge() { $di = new Document_Item(); $di->cleanDBonItemDelete($this->getType(), $this->fields['id']); // UNLINK DU FICHIER if (!empty($this->fields["filepath"])) { if (is_file(GLPI_DOC_DIR."/".$this->fields["filepath"]) && !is_dir(GLPI_DOC_DIR."/".$this->fields["filepath"]) && (countElementsInTable($this->getTable(), "`sha1sum`='".$this->fields["sha1sum"]."'") <= 1)) { if (unlink(GLPI_DOC_DIR."/".$this->fields["filepath"])) { Session::addMessageAfterRedirect(sprintf(__('Succesful deletion of the file %s'), GLPI_DOC_DIR."/".$this->fields["filepath"])); } else { Session::addMessageAfterRedirect(sprintf(__('Failed to delete the file %s'), GLPI_DOC_DIR."/".$this->fields["filepath"]), false, ERROR); } } } } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('Document_Item', $ong, $options); $this->addStandardTab('Note', $ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } /** * @see CommonDBTM::prepareInputForAdd() **/ function prepareInputForAdd($input) { global $CFG_GLPI, $DB; // security (don't accept filename from $_POST) unset($input['filename']); if ($uid = Session::getLoginUserID()) { $input["users_id"] = Session::getLoginUserID(); } // Create a doc only selecting a file from a item form $create_from_item = false; if (isset($input["items_id"]) && isset($input["itemtype"]) && ($item = getItemForItemtype($input["itemtype"])) && ($input["items_id"] > 0)) { $typename = $item->getTypeName(1); $name = NOT_AVAILABLE; if ($item->getFromDB($input["items_id"])) { $name = $item->getNameID(); } //TRANS: %1$s is Document, %2$s is item type, %3$s is item name $input["name"] = addslashes(Html::resume_text(sprintf(__('%1$s: %2$s'), __('Document'), sprintf(__('%1$s - %2$s'),$typename, $name)), 200)); $create_from_item = true; } if (isset($input["upload_file"]) && !empty($input["upload_file"])) { // Move doc from upload dir $this->moveUploadedDocument($input, $input["upload_file"]); } else if (isset($_FILES) && isset($_FILES['filename'])) { // Move doc send with form $upload_result = $this->uploadDocument($input, $_FILES['filename']); // Upload failed : do not create document if ($create_from_item && !$upload_result) { return false; } // Document is moved, so $_FILES is no more useful unset($_FILES['filename']); } // Default document name if ((!isset($input['name']) || empty($input['name'])) && isset($input['filename'])) { $input['name'] = $input['filename']; } unset($input["upload_file"]); // Don't add if no file if (isset($input["_only_if_upload_succeed"]) && $input["_only_if_upload_succeed"] && (!isset($input['filename']) || empty($input['filename']))) { return false; } // Set default category for document linked to tickets if (isset($input['itemtype']) && $input['itemtype'] == 'Ticket' && (!isset($input['documentcategories_id']) || $input['documentcategories_id'] == 0)) { $input['documentcategories_id'] = $CFG_GLPI["documentcategories_id_forticket"]; } /* Unicity check if (isset($input['sha1sum'])) { // Check if already upload in the current entity $crit = array('sha1sum'=>$input['sha1sum'], 'entities_id'=>$input['entities_id']); foreach ($DB->request($this->getTable(), $crit) as $data) { $link=$this->getFormURL(); Session::addMessageAfterRedirect(__('"A document with that filename has already been attached to another record.'). " : ".$data['name']."", false, ERROR, true); return false; } } */ return $input; } function post_addItem() { if (isset($this->input["items_id"]) && isset($this->input["itemtype"]) && (($this->input["items_id"] > 0) || (($this->input["items_id"] == 0) && ($this->input["itemtype"] == 'Entity'))) && !empty($this->input["itemtype"])) { $docitem = new Document_Item(); $docitem->add(array('documents_id' => $this->fields['id'], 'itemtype' => $this->input["itemtype"], 'items_id' => $this->input["items_id"])); Event::log($this->fields['id'], "documents", 4, "document", //TRANS: %s is the user login sprintf(__('%s adds a link with an item'), $_SESSION["glpiname"])); } } /** * @see CommonDBTM::prepareInputForUpdate() **/ function prepareInputForUpdate($input) { // security (don't accept filename from $_POST) unset($input['filename']); if (isset($_FILES['filename']['type']) && !empty($_FILES['filename']['type'])) { $input['mime'] = $_FILES['filename']['type']; } if (isset($input['current_filepath'])) { if (isset($input["upload_file"]) && !empty($input["upload_file"])) { $this->moveUploadedDocument($input, $input["upload_file"]); } else if (isset($_FILES['filename'])) { $this->uploadDocument($input, $_FILES['filename']); // Document is moved, so $_FILES is no more useful unset($_FILES['filename']); } } if (empty($input['filename'])) { unset($input['filename']); } unset($input['current_filepath']); unset($input['current_filename']); return $input; } /** * Print the document form * * @param $ID integer ID of the item * @param $options array * - target filename : where to go when done. * - withtemplate boolean : template or basic item * * @return Nothing (display) **/ function showForm($ID, $options=array()) { global $CFG_GLPI; $this->initForm($ID, $options); $this->showTabs($options); $options['formoptions'] = " enctype='multipart/form-data'"; $this->showFormHeader($options); $showuserlink = 0; if (Session::haveRight('user','r')) { $showuserlink = 1; } if ($ID > 0) { echo ""; if ($this->fields["users_id"] > 0) { printf(__('Added by %s'), getUserName($this->fields["users_id"], $showuserlink)); } else { echo " "; } echo ""; echo ""; //TRANS: %s is the datetime of update printf(__('Last update on %s'), Html::convDateTime($this->fields["date_mod"])); echo "\n"; } echo ""; echo "".__('Name').""; echo ""; Html::autocompletionTextField($this, "name"); echo ""; echo "".__('Comments').""; echo ""; echo ""; echo ""; if ($ID > 0) { echo ""; echo "".__('Current file').""; echo "".$this->getDownloadLink('',45); echo ""; echo ""; echo ""; } echo ""; echo "".sprintf(__('%1$s (%2$s)'), __('File'), self::getMaxUploadSize()).""; echo ""; echo ""; echo ""; echo "".__('Use a FTP installed file').""; echo ""; $this->showUploadedFilesDropdown("upload_file"); echo ""; echo ""; echo "".__('Web Link').""; echo ""; Html::autocompletionTextField($this, "link"); echo ""; echo ""; echo "".__('Heading').""; echo ""; DocumentCategory::dropdown(array('value' => $this->fields["documentcategories_id"])); echo ""; echo ""; echo "".__('MIME type').""; echo ""; Html::autocompletionTextField($this, "mime"); if ($ID > 0) { echo "".sprintf(__('%1$s (%2$s)'), __('Checksum'), __('SHA1')).""; echo "".$this->fields["sha1sum"]; } echo ""; $this->showFormButtons($options); $this->addDivForTabs(); return true; } /** * Get max upload size from php config **/ static function getMaxUploadSize() { $max_size = Toolbox::return_bytes_from_ini_vars(ini_get("upload_max_filesize")); $max_size /= 1024*1024; //TRANS: %s is a size return sprintf(__('%s Mio max'), round($max_size, 1)); } /** * Send a document to navigator **/ function send() { $file = GLPI_DOC_DIR."/".$this->fields['filepath']; if (!file_exists($file)) { die("Error file ".$file." does not exist"); } // Now send the file with header() magic header("Expires: Mon, 26 Nov 1962 00:00:00 GMT"); header('Pragma: private'); /// IE BUG + SSL header('Cache-control: private, must-revalidate'); /// IE BUG + SSL header("Content-disposition: filename=\"".$this->fields['filename']."\""); header("Content-type: ".$this->fields['mime']); readfile($file) or die ("Error opening file $file"); } /** * Get download link for a document * * @param $params additonal parameters to be added to the link (default '') * @param $len maximum length of displayed string (default 20) * **/ function getDownloadLink($params='', $len=20) { global $DB,$CFG_GLPI; $splitter = explode("/",$this->fields['filename']); if (count($splitter) == 2) { // Old documents in EXT/filename $fileout = $splitter[1]; } else { // New document $fileout = $this->fields['filename']; } $initfileout = $fileout; if (Toolbox::strlen($fileout) > $len) { $fileout = Toolbox::substr($fileout,0,$len)."…"; } $out = ""; $splitter = explode("/",$this->fields['filepath']); if (count($splitter)) { $query = "SELECT * FROM `glpi_documenttypes` WHERE `ext` LIKE '".$splitter[0]."' AND `icon` <> ''"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { $icon = $DB->result($result,0,'icon'); $out .= " \""."; } } } $out .= "$fileout"; return $out; } /** * find a document with a file attached * * @param $entity of the document * @param $path of the searched file * * @return boolean **/ function getFromDBbyContent($entity, $path) { if (empty($path)) { return false; } $sum = sha1_file($path); if (!$sum) { return false; } return $this->getFromDBByQuery("WHERE `".$this->getTable()."`.`sha1sum` = '$sum' AND `".$this->getTable()."`.`entities_id` = '$entity'"); } /** * Check is the curent user is allowed to see the file * * @param $options array of options (only 'tickets_id' used) * * @return boolean **/ function canViewFile($options) { global $DB, $CFG_GLPI; if (isset($_SESSION["glpiactiveprofile"]["interface"]) && ($_SESSION["glpiactiveprofile"]["interface"] == "central")) { // My doc Check and Common doc right access if ($this->can($this->fields["id"],'r') || ($this->fields["users_id"] === Session::getLoginUserID())) { return true; } // Reminder Case $query = "SELECT * FROM `glpi_documents_items` LEFT JOIN `glpi_reminders` ON (`glpi_reminders`.`id` = `glpi_documents_items`.`items_id` AND `glpi_documents_items`.`itemtype` = 'Reminder') ".Reminder::addVisibilityJoins()." WHERE `glpi_documents_items`.`documents_id` = '".$this->fields["id"]."' AND ".Reminder::addVisibilityRestrict(); $result = $DB->query($query); if ($DB->numrows($result) > 0) { return true; } // Knowbase Case if (Session::haveRight("knowbase","r")) { $query = "SELECT * FROM `glpi_documents_items` LEFT JOIN `glpi_knowbaseitems` ON (`glpi_knowbaseitems`.`id` = `glpi_documents_items`.`items_id` AND `glpi_documents_items`.`itemtype` = 'KnowbaseItem') ".KnowbaseItem::addVisibilityJoins()." WHERE `glpi_documents_items`.`documents_id` = '".$this->fields["id"]."' AND ".KnowbaseItem::addVisibilityRestrict(); $result = $DB->query($query); if ($DB->numrows($result) > 0) { return true; } } if (Session::haveRight("faq","r")) { $query = "SELECT * FROM `glpi_documents_items` LEFT JOIN `glpi_knowbaseitems` ON (`glpi_knowbaseitems`.`id` = `glpi_documents_items`.`items_id` AND `glpi_documents_items`.`itemtype` = 'KnowbaseItem') ".KnowbaseItem::addVisibilityJoins()." WHERE `glpi_documents_items`.`documents_id` = '".$this->fields["id"]."' AND `glpi_knowbaseitems`.`is_faq` = '1' AND ".KnowbaseItem::addVisibilityRestrict(); $result = $DB->query($query); if ($DB->numrows($result) > 0) { return true; } } // Tracking Case if (isset($options["tickets_id"])) { $job = new Ticket(); if ($job->can($options["tickets_id"],'r')) { $query = "SELECT * FROM `glpi_documents_items` WHERE `glpi_documents_items`.`items_id` = '".$options["tickets_id"]."' AND `glpi_documents_items`.`itemtype` = 'Ticket' AND `documents_id`='".$this->fields["id"]."'"; $result = $DB->query($query); if ($DB->numrows($result) > 0) { return true; } } } } else if (Session::getLoginUserID()) { // ! central // Check if it is my doc if ($this->fields["users_id"] === Session::getLoginUserID()) { return true; } // Reminder Case $query = "SELECT * FROM `glpi_documents_items` LEFT JOIN `glpi_reminders` ON (`glpi_reminders`.`id` = `glpi_documents_items`.`items_id` AND `glpi_documents_items`.`itemtype` = 'Reminder') ".Reminder::addVisibilityJoins()." WHERE `glpi_documents_items`.`documents_id` = '".$this->fields["id"]."' AND ".Reminder::addVisibilityRestrict(); $result = $DB->query($query); if ($DB->numrows($result) > 0) { return true; } if (Session::haveRight("faq","r")) { // Check if it is a FAQ document $query = "SELECT * FROM `glpi_documents_items` LEFT JOIN `glpi_knowbaseitems` ON (`glpi_knowbaseitems`.`id` = `glpi_documents_items`.`items_id`) ".KnowbaseItem::addVisibilityJoins()." WHERE `glpi_documents_items`.`itemtype` = 'KnowbaseItem' AND `glpi_documents_items`.`documents_id` = '".$this->fields["id"]."' AND `glpi_knowbaseitems`.`is_faq` = '1' AND ".KnowbaseItem::addVisibilityRestrict(); $result = $DB->query($query); if ($DB->numrows($result) > 0) { return true; } } // Tracking Case if (isset($options["tickets_id"])) { $job = new Ticket(); if ($job->can($options["tickets_id"],'r')) { $query = "SELECT * FROM `glpi_documents_items` WHERE `glpi_documents_items`.`items_id` = '".$options["tickets_id"]."' AND `glpi_documents_items`.`itemtype` = 'Ticket' AND `documents_id` = '".$this->fields["id"]."'"; $result = $DB->query($query); if ($DB->numrows($result) > 0) { return true; } } } } // Public FAQ for not connected user if ($CFG_GLPI["use_public_faq"]) { $query = "SELECT * FROM `glpi_documents_items` LEFT JOIN `glpi_knowbaseitems` ON (`glpi_knowbaseitems`.`id` = `glpi_documents_items`.`items_id`) WHERE `glpi_documents_items`.`itemtype` = 'KnowbaseItem' AND `glpi_documents_items`.`documents_id` = '".$this->fields["id"]."' AND `glpi_knowbaseitems`.`is_faq` = '1' AND `glpi_knowbaseitems`.`entities_id` = '0' AND `glpi_knowbaseitems`.`is_recursive` = '1'"; $result = $DB->query($query); if ($DB->numrows($result) > 0) { return true; } } return false; } /** * @since version 0.84 **/ static function getSearchOptionsToAdd() { $tab = array(); $tab['document'] = self::getTypeName(2); $tab[119]['table'] = 'glpi_documents_items'; $tab[119]['field'] = 'count'; $tab[119]['name'] = _x('quantity', 'Number of documents'); $tab[119]['forcegroupby'] = true; $tab[119]['usehaving'] = true; $tab[119]['datatype'] = 'number'; $tab[119]['massiveaction'] = false; $tab[119]['joinparams'] = array('jointype' => 'itemtype_item'); return $tab; } /** * @see CommonDBTM::getSpecificMassiveActions() **/ function getSpecificMassiveActions($checkitem=NULL) { $isadmin = static::canUpdate(); $actions = parent::getSpecificMassiveActions($checkitem); if ($isadmin) { $actions['add_document_item'] = _x('button', 'Add an item'); $actions['remove_document_item'] = _x('button', 'Remove an item'); } if (Session::haveRight('transfer','r') && Session::isMultiEntitiesMode() && $isadmin) { $actions['add_transfer_list'] = _x('button', 'Add to transfer list'); } return $actions; } /** * @see CommonDBTM::showSpecificMassiveActionsParameters() **/ function showSpecificMassiveActionsParameters($input=array()) { global $CFG_GLPI; switch ($input['action']) { case "add_document_item" : Dropdown::showAllItems("items_id", 0, 0, -1, $CFG_GLPI["document_types"], false, true, 'item_itemtype'); echo "

"; return true; case "remove_document_item" : Dropdown::showAllItems("items_id", 0, 0, -1, $CFG_GLPI["document_types"], false, true, 'item_itemtype'); echo "

"; return true; default : return parent::showSpecificMassiveActionsParameters($input); } return false; } /** * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "add_document" : case "add_document_item" : $documentitem = new Document_Item(); foreach ($input["item"] as $key => $val) { if (isset($input['items_id'])) { // Add items to documents $input2 = array('itemtype' => $input["item_itemtype"], 'items_id' => $input["items_id"], 'documents_id' => $key); } else if (isset($input['documents_id'])) { // Add document to item $input2 = array('itemtype' => $input["itemtype"], 'items_id' => $key, 'documents_id' => $input['documents_id']); } else { return false; } if ($documentitem->can(-1, 'w', $input2)) { if ($documentitem->add($input2)) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } break; case "remove_document" : case "remove_document_item" : foreach ($input["item"] as $key => $val) { if (isset($input['items_id'])) { // Remove item to documents $input2 = array('itemtype' => $input["item_itemtype"], 'items_id' => $input["items_id"], 'documents_id' => $key); } else if (isset($input['documents_id'])) { // Remove contract to items $input2 = array('itemtype' => $input["itemtype"], 'items_id' => $key, 'documents_id' => $input['documents_id']); } else { return false; } $docitem = new Document_Item(); if ($docitem->can(-1, 'w', $input2)) { if ($item = getItemForItemtype($input2["itemtype"])) { if ($item->getFromDB($input2['items_id'])) { $doc = new self(); if ($doc->getFromDB($input2['documents_id'])) { if ($docitem->getFromDBForItems($doc, $item)) { if ($docitem->delete(array('id' => $docitem->getID()))) { $res['ok']++; } else { $res['ko']++; } } else { $res['ko']++; } } else { $res['ko']++; } } else { $res['ko']++; } } else { $res['ko']++; } } else { $res['noright']++; } } break; default : return parent::doSpecificMassiveActions($input); } return $res; } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'filename'; $tab[3]['name'] = __('File'); $tab[3]['massiveaction'] = false; $tab[3]['datatype'] = 'string'; $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'link'; $tab[4]['name'] = __('Web Link'); $tab[4]['datatype'] = 'weblink'; $tab[5]['table'] = $this->getTable(); $tab[5]['field'] = 'mime'; $tab[5]['name'] = __('MIME type'); $tab[5]['datatype'] = 'string'; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab[90]['table'] = $this->getTable(); $tab[90]['field'] = 'notepad'; $tab[90]['name'] = __('Notes'); $tab[90]['massiveaction'] = false; $tab[90]['datatype'] = 'text'; $tab[7]['table'] = 'glpi_documentcategories'; $tab[7]['field'] = 'completename'; $tab[7]['name'] = __('Heading'); $tab[7]['datatype'] = 'dropdown'; $tab[80]['table'] = 'glpi_entities'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = __('Entity'); $tab[80]['massiveaction'] = false; $tab[80]['datatype'] = 'dropdown'; $tab[86]['table'] = $this->getTable(); $tab[86]['field'] = 'is_recursive'; $tab[86]['name'] = __('Child entities'); $tab[86]['datatype'] = 'bool'; $tab[19]['table'] = $this->getTable(); $tab[19]['field'] = 'date_mod'; $tab[19]['name'] = __('Last update'); $tab[19]['datatype'] = 'datetime'; $tab[19]['massiveaction'] = false; $tab[20]['table'] = $this->getTable(); $tab[20]['field'] = 'sha1sum'; $tab[20]['name'] = sprintf(__('%1$s (%2$s)'), __('Checksum'), __('SHA1')); $tab[20]['massiveaction'] = false; $tab[20]['datatype'] = 'string'; $tab[72]['table'] = 'glpi_documents_items'; $tab[72]['field'] = 'count'; $tab[72]['name'] = __('Number of associated items'); $tab[72]['forcegroupby'] = true; $tab[72]['usehaving'] = true; $tab[72]['datatype'] = 'number'; $tab[72]['massiveaction'] = false; $tab[72]['joinparams'] = array('jointype' => 'child'); return $tab; } /** * Move a file to a new location * Work even if dest file already exists * * @param $srce source file path * @param $dest destination file path * * @return boolean : success **/ static function renameForce($srce, $dest) { // File already present if (is_file($dest)) { // As content is the same (sha1sum), no need to copy @unlink($srce); return true; } // Move return rename($srce,$dest); } /** * Move an uploadd document (files in GLPI_DOC_DIR."/_uploads" dir) * * @param $input array of datas used in adding process (need current_filepath) * @param $filename filename to move * * @return boolean for success / $input array is updated **/ static function moveUploadedDocument(array &$input, $filename) { global $CFG_GLPI; $fullpath = GLPI_DOC_DIR."/_uploads/".$filename; if (!is_dir(GLPI_DOC_DIR."/_uploads")) { Session::addMessageAfterRedirect(__("Upload directory doesn't exist"), false, ERROR); return false; } if (!is_file($fullpath)) { Session::addMessageAfterRedirect(sprintf(__('File %s not found.'), $fullpath), false, ERROR); return false; } $sha1sum = sha1_file($fullpath); $dir = self::isValidDoc($filename); $new_path = self::getUploadFileValidLocationName($dir, $sha1sum); if (!$sha1sum || !$dir || !$new_path) { return false; } // Delete old file (if not used by another doc) if (isset($input['current_filepath']) && !empty($input['current_filepath']) && is_file(GLPI_DOC_DIR."/".$input['current_filepath']) && (countElementsInTable('glpi_documents', "`sha1sum`='".sha1_file(GLPI_DOC_DIR."/". $input['current_filepath'])."'") <= 1)) { if (unlink(GLPI_DOC_DIR."/".$input['current_filepath'])) { Session::addMessageAfterRedirect(sprintf(__('Succesful deletion of the file %s'), $input['current_filename'])); } else { // TRANS: %1$s is the curent filename, %2$s is its directory Session::addMessageAfterRedirect(sprintf(__('Failed to delete the file %1$s (%2$s)'), $input['current_filename'], GLPI_DOC_DIR."/".$input['current_filepath']), false, ERROR); } } // Local file : try to detect mime type if (function_exists('finfo_open') && ($finfo = finfo_open(FILEINFO_MIME))) { $input['mime'] = finfo_file($finfo, $fullpath); finfo_close($finfo); } else if (function_exists('mime_content_type')) { $input['mime'] = mime_content_type($fullpath); } if (is_writable(GLPI_DOC_DIR."/_uploads/") && is_writable ($fullpath)) { // Move if allowed if (self::renameForce($fullpath, GLPI_DOC_DIR."/".$new_path)) { Session::addMessageAfterRedirect(__('Document move succeeded.')); } else { Session::addMessageAfterRedirect(__('File move failed.'), false, ERROR); return false; } } else { // Copy (will overwrite dest file is present) if (copy($fullpath, GLPI_DOC_DIR."/".$new_path)) { Session::addMessageAfterRedirect(__('Document copy succeeded.')); } else { Session::addMessageAfterRedirect(__('File move failed'), false, ERROR); return false; } } // For display $input['filename'] = addslashes($filename); // Storage path $input['filepath'] = $new_path; // Checksum $input['sha1sum'] = $sha1sum; return true; } /** * Upload a new file * * @param &$input array of datas need for add/update (will be completed) * @param $FILEDESC FILE descriptor * * @return true on success **/ static function uploadDocument(array &$input, $FILEDESC) { if (!count($FILEDESC) || empty($FILEDESC['name']) || !is_file($FILEDESC['tmp_name'])) { switch ($FILEDESC['error']) { case 1 : case 2 : Session::addMessageAfterRedirect(__('File too large to be added.'), false, ERROR); break; case 4 : // Session::addMessageAfterRedirect(__('No file specified.'),false,ERROR); break; } return false; } $sha1sum = sha1_file($FILEDESC['tmp_name']); $dir = self::isValidDoc($FILEDESC['name']); $path = self::getUploadFileValidLocationName($dir,$sha1sum); if (!$sha1sum || !$dir || !$path) { return false; } // Delete old file (if not used by another doc) if (isset($input['current_filepath']) && !empty($input['current_filepath']) && (countElementsInTable('glpi_documents', "`sha1sum`='".sha1_file(GLPI_DOC_DIR."/". $input['current_filepath'])."'") <= 1)) { if (unlink(GLPI_DOC_DIR."/".$input['current_filepath'])) { Session::addMessageAfterRedirect(sprintf(__('Succesful deletion of the file %s'), $input['current_filename'])); } else { // TRANS: %1$s is the curent filename, %2$s is its directory Session::addMessageAfterRedirect(sprintf(__('Failed to delete the file %1$s (%2$s)'), $input['current_filename'], GLPI_DOC_DIR."/".$input['current_filepath']), false, ERROR); } } // Mime type from client if (isset($FILEDESC['type']) && !empty($FILEDESC['type'])) { $input['mime'] = $FILEDESC['type']; } // Move uploaded file if (self::renameForce($FILEDESC['tmp_name'], GLPI_DOC_DIR."/".$path)) { Session::addMessageAfterRedirect(__('The file is valid. Upload is successful.')); // For display $input['filename'] = addslashes($FILEDESC['name']); // Storage path $input['filepath'] = $path; // Checksum $input['sha1sum'] = $sha1sum; return true; } Session::addMessageAfterRedirect(__('Potential upload attack or file too large. Moving temporary file failed.'), false, ERROR); return false; } /** * Find a valid path for the new file * * @param $dir dir to search a free path for the file * @param $sha1sum SHA1 of the file * * @return nothing **/ static function getUploadFileValidLocationName($dir, $sha1sum) { global $CFG_GLPI; if (empty($dir)) { $message = __('Unauthorized file type'); if (Session::haveRight('dropdown','r')) { $dt = new DocumentType(); $message .= " "; } Session::addMessageAfterRedirect($message, false, ERROR); return ''; } if (!is_dir(GLPI_DOC_DIR)) { Session::addMessageAfterRedirect(sprintf(__("The directory %s doesn't exist."), GLPI_DOC_DIR), false, ERROR); return ''; } $subdir = $dir.'/'.substr($sha1sum,0,2); if (!is_dir(GLPI_DOC_DIR."/".$subdir) && @mkdir(GLPI_DOC_DIR."/".$subdir,0777,true)) { Session::addMessageAfterRedirect(sprintf(__('Create the directory %s'), GLPI_DOC_DIR."/".$subdir)); } if (!is_dir(GLPI_DOC_DIR."/".$subdir)) { Session::addMessageAfterRedirect(sprintf(__('Failed to create the directory %s. Verify that you have the correct permission'), GLPI_DOC_DIR."/".$subdir), false, ERROR); return ''; } return $subdir.'/'.substr($sha1sum,2).'.'.$dir; } /** * Show dropdown of uploaded files * * @param $myname dropdown name **/ static function showUploadedFilesDropdown($myname) { global $CFG_GLPI; if (is_dir(GLPI_DOC_DIR."/_uploads")) { $uploaded_files = array(); if ($handle = opendir(GLPI_DOC_DIR."/_uploads")) { while (false !== ($file = readdir($handle))) { if (($file != ".") && ($file != "..")) { $dir = self::isValidDoc($file); if (!empty($dir)) { $uploaded_files[] = $file; } } } closedir($handle); } if (count($uploaded_files)) { echo ""; } else { _e('No file available'); } } else { _e("Upload directory doesn't exist"); } } /** * Is this file a valid file ? check based on file extension * * @param $filename filename to clean **/ static function isValidDoc($filename) { global $DB; $splitter = explode(".",$filename); $ext = end($splitter); $query="SELECT * FROM `glpi_documenttypes` WHERE `ext` LIKE '$ext' AND `is_uploadable`='1'"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { return Toolbox::strtoupper($ext); } } // Not found try with regex one $query = "SELECT * FROM `glpi_documenttypes` WHERE `ext` LIKE '/%/' AND `is_uploadable` = '1'"; foreach ($DB->request($query) as $data) { if (preg_match(Toolbox::unclean_cross_side_scripting_deep($data['ext'])."i", $ext, $results) > 0) { return Toolbox::strtoupper($ext); } } return ""; } /** * Make a select box for link document * * Parameters which could be used in options array : * - name : string / name of the select (default is documents_id) * - entity : integer or array / restrict to a defined entity or array of entities * (default -1 : no restriction) * - used : array / Already used items ID: not to display in dropdown (default empty) * * @param $options array of possible options * * @return nothing (print out an HTML select box) **/ static function dropdown($options=array()) { global $DB, $CFG_GLPI; $p['name'] = 'documents_id'; $p['entity'] = ''; $p['used'] = array(); if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } $rand = mt_rand(); $where = " WHERE `glpi_documents`.`is_deleted` = '0' ". getEntitiesRestrictRequest("AND", "glpi_documents", '', $p['entity'], true); if (count($p['used'])) { $where .= " AND `id` NOT IN ('0','".implode("','",$p['used'])."')"; } $query = "SELECT * FROM `glpi_documentcategories` WHERE `id` IN (SELECT DISTINCT `documentcategories_id` FROM `glpi_documents` $where) ORDER BY `name`"; $result = $DB->query($query); echo ""; $params = array('rubdoc' => '__VALUE__', 'entity' => $p['entity'], 'rand' => $rand, 'myname' => $p['name'], 'used' => $p['used']); Ajax::updateItemOnSelectEvent("rubdoc$rand","show_".$p['name']."$rand", $CFG_GLPI["root_doc"]."/ajax/dropdownRubDocument.php", $params); echo ""; $_POST["entity"] = $p['entity']; $_POST["rubdoc"] = 0; $_POST["myname"] = $p['name']; $_POST["rand"] = $rand; $_POST["used"] = $p['used']; include (GLPI_ROOT."/ajax/dropdownRubDocument.php"); echo "\n"; return $rand; } } ?> glpi-0.84.3+dfsg.1/inc/document_item.class.php000066400000000000000000000671401226600447100210530ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // Relation between Documents and Items class Document_Item extends CommonDBRelation{ // From CommonDBRelation static public $itemtype_1 = 'Document'; static public $items_id_1 = 'documents_id'; static public $take_entity_1 = true ; static public $itemtype_2 = 'itemtype'; static public $items_id_2 = 'items_id'; static public $take_entity_2 = false ; /** * @since version 0.84 **/ function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } function prepareInputForAdd($input) { if ((empty($input['items_id']) || ($input['items_id'] == 0)) && ($input['itemtype'] != 'Entity')) { return false; } // Do not insert circular link for document if (($input['itemtype'] == 'Document') && ($input['items_id'] == $input['documents_id'])) { return false; } // Avoid duplicate entry $restrict = "`documents_id` = '".$input['documents_id']."' AND `itemtype` = '".$input['itemtype']."' AND `items_id` = '".$input['items_id']."'"; if (countElementsInTable($this->getTable(),$restrict) > 0) { return false; } return parent::prepareInputForAdd($input); } function post_addItem() { if ($this->fields['itemtype'] == 'Ticket') { $ticket = new Ticket(); $input = array('id' => $this->fields['items_id'], 'date_mod' => $_SESSION["glpi_currenttime"], '_donotadddocs' => true); if (!isset($this->input['_do_notif']) || $this->input['_do_notif']) { $input['_forcenotif'] = true; } $ticket->update($input); } parent::post_addItem(); } function post_purgeItem() { if ($this->fields['itemtype'] == 'Ticket') { $ticket = new Ticket(); $input = array('id' => $this->fields['items_id'], 'date_mod' => $_SESSION["glpi_currenttime"], '_donotadddocs' => true); if (!isset($this->input['_do_notif']) || $this->input['_do_notif']) { $input['_forcenotif'] = true; } $ticket->update($input); } parent::post_purgeItem(); } /** * @param $item CommonDBTM object **/ static function countForItem(CommonDBTM $item) { $restrict = "`glpi_documents_items`.`items_id` = '".$item->getField('id')."' AND `glpi_documents_items`.`itemtype` = '".$item->getType()."'"; if (Session::getLoginUserID()) { $restrict .= getEntitiesRestrictRequest(" AND ", "glpi_documents_items", '', '', true); } else { // Anonymous access from FAQ $restrict .= " AND `glpi_documents_items`.`entities_id` = '0' "; } $nb = countElementsInTable(array('glpi_documents_items'), $restrict); // Document case : search in both if ($item->getType() == 'Document') { $restrict = "`glpi_documents_items`.`documents_id` = '".$item->getField('id')."' AND `glpi_documents_items`.`itemtype` = '".$item->getType()."'"; if (Session::getLoginUserID()) { $restrict .= getEntitiesRestrictRequest(" AND ", "glpi_documents_items", '', '', true); } else { // Anonymous access from FAQ $restrict .= " AND `glpi_documents_items`.`entities_id` = '0' "; } $nb += countElementsInTable(array('glpi_documents_items'), $restrict); } return $nb ; } /** * @param $item Document object **/ static function countForDocument(Document $item) { $restrict = "`glpi_documents_items`.`documents_id` = '".$item->getField('id')."' AND `glpi_documents_items`.`itemtype` != '".$item->getType()."'"; return countElementsInTable(array('glpi_documents_items'), $restrict); } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { switch ($item->getType()) { case 'Document' : $ong = array(); if ($_SESSION['glpishow_count_on_tabs']) { $ong[1] = self::createTabEntry(_n('Associated item', 'Associated items', self::countForDocument($item))); } $ong[1] = _n('Associated item', 'Associated items', 2); if ($_SESSION['glpishow_count_on_tabs']) { $ong[2] = Document::createTabEntry(Document::getTypeName(2), self::countForItem($item)); } $ong[2] = Document::getTypeName(2); return $ong; default : // Can exist for template if (Session::haveRight("document","r") || ($item->getType() == 'Ticket') || ($item->getType() == 'Reminder') || ($item->getType() == 'KnowbaseItem')) { if ($_SESSION['glpishow_count_on_tabs']) { return Document::createTabEntry(Document::getTypeName(2), self::countForItem($item)); } return Document::getTypeName(2); } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($item->getType()) { case 'Document' : switch ($tabnum) { case 1 : self::showForDocument($item); break; case 2 : self::showForItem($item, $withtemplate); break; } return true; default : self::showForitem($item, $withtemplate); } } /** * Duplicate documents from an item template to its clone * * @since version 0.84 * * @param $itemtype itemtype of the item * @param $oldid ID of the item to clone * @param $newid ID of the item cloned * @param $newitemtype itemtype of the new item (= $itemtype if empty) (default '') **/ static function cloneItem($itemtype, $oldid, $newid, $newitemtype='') { global $DB; if (empty($newitemtype)) { $newitemtype = $itemtype; } $query = "SELECT `documents_id` FROM `glpi_documents_items` WHERE `items_id` = '$oldid' AND `itemtype` = '$itemtype';"; foreach ($DB->request($query) as $data) { $docitem = new self(); $docitem->add(array('documents_id' => $data["documents_id"], 'itemtype' => $newitemtype, 'items_id' => $newid)); } } /** * Show items links to a document * * @since version 0.84 * * @param $doc Document object * * @return nothing (HTML display) **/ static function showForDocument(Document $doc) { global $DB, $CFG_GLPI; $instID = $doc->fields['id']; if (!$doc->can($instID,"r")) { return false; } $canedit = $doc->can($instID,'w'); // for a document, // don't show here others documents associated to this one, // it's done for both directions in self::showAssociated $query = "SELECT DISTINCT `itemtype` FROM `glpi_documents_items` WHERE `glpi_documents_items`.`documents_id` = '$instID' AND `glpi_documents_items`.`itemtype` != 'Document' ORDER BY `itemtype`"; $result = $DB->query($query); $number = $DB->numrows($result); $rand = mt_rand(); if ($canedit) { echo "
"; echo ""; echo ""; echo ""; echo ""; echo "
".__('Add an item')."
"; Dropdown::showAllItems("items_id", 0, 0, ($doc->fields['is_recursive']?-1:$doc->fields['entities_id']), $CFG_GLPI["document_types"], false, true); echo ""; echo ""; echo ""; echo "
"; Html::closeForm(); echo "
"; } echo "
"; if ($canedit && $number) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $massiveactionparams = array(); Html::showMassiveActions(__CLASS__, $massiveactionparams); } echo ""; echo ""; if ($canedit && $number) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; for ($i=0 ; $i < $number ; $i++) { $itemtype=$DB->result($result, $i, "itemtype"); if (!($item = getItemForItemtype($itemtype))) { continue; } if ($item->canView()) { $column = "name"; if ($itemtype == 'Ticket') { $column = "id"; } $itemtable = getTableForItemType($itemtype); $query = "SELECT `$itemtable`.*, `glpi_documents_items`.`id` AS IDD, "; if ($itemtype == 'KnowbaseItem') { $query .= "-1 AS entity FROM `glpi_documents_items`, `$itemtable` ".KnowbaseItem::addVisibilityJoins()." WHERE `$itemtable`.`id` = `glpi_documents_items`.`items_id` AND "; } else { $query .= "`glpi_entities`.`id` AS entity FROM `glpi_documents_items`, `$itemtable` LEFT JOIN `glpi_entities` ON (`glpi_entities`.`id` = `$itemtable`.`entities_id`) WHERE `$itemtable`.`id` = `glpi_documents_items`.`items_id` AND "; } $query .= "`glpi_documents_items`.`itemtype` = '$itemtype' AND `glpi_documents_items`.`documents_id` = '$instID' "; if ($itemtype =='KnowbaseItem') { if (Session::getLoginUserID()) { $where = "AND ".KnowbaseItem::addVisibilityRestrict(); } else { // Anonymous access if (Session::isMultiEntitiesMode()) { $where = " AND (`glpi_entities_knowbaseitems`.`entities_id` = '0' AND `glpi_entities_knowbaseitems`.`is_recursive` = '1')"; } } } else { $query .= getEntitiesRestrictRequest(" AND ", $itemtable, '', '', $item->maybeRecursive()); } if ($item->maybeTemplate()) { $query .= " AND `$itemtable`.`is_template` = '0'"; } if ($itemtype == 'KnowbaseItem') { $query .= " ORDER BY `$itemtable`.`$column`"; } else { $query .= " ORDER BY `glpi_entities`.`completename`, `$itemtable`.`$column`"; } if ($itemtype == 'SoftwareLicense') { $soft = new Software(); } if ($result_linked = $DB->query($query)) { if ($DB->numrows($result_linked)) { while ($data = $DB->fetch_assoc($result_linked)) { if ($itemtype == 'Ticket') { $data["name"] = sprintf(__('%1$s: %2$s'), __('Ticket'), $data["id"]); } if ($itemtype == 'SoftwareLicense') { $soft->getFromDB($data['softwares_id']); $data["name"] = sprintf(__('%1$s - %2$s'), $data["name"], $soft->fields['name']); } $linkname = $data["name"]; if ($_SESSION["glpiis_ids_visible"] || empty($data["name"])) { $linkname = sprintf(__('%1$s (%2$s)'), $linkname, $data["id"]); } $link = Toolbox::getItemTypeFormURL($itemtype); $name = "".$linkname.""; echo ""; if ($canedit) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } } } } } echo "
".Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand)."".__('Type')."".__('Name')."".__('Entity')."".__('Serial number')."".__('Inventory number')."
"; Html::showMassiveActionCheckBox(__CLASS__, $data["IDD"]); echo "".$item->getTypeName(1)."".$name."".Dropdown::getDropdownName("glpi_entities", $data['entity']); echo "". (isset($data["serial"])? "".$data["serial"]."" :"-")."". (isset($data["otherserial"])? "".$data["otherserial"]."" :"-")."
"; if ($canedit && $number) { $paramsma['ontop'] =false; Html::showMassiveActions(__CLASS__, $paramsma); Html::closeForm(); } echo "
"; } /** * Show documents associated to an item * * @since version 0.84 * * @param $item CommonDBTM object for which associated documents must be displayed * @param $withtemplate (default '') **/ static function showForItem(CommonDBTM $item, $withtemplate='') { global $DB, $CFG_GLPI; $ID = $item->getField('id'); if ($item->isNewID($ID)) { return false; } if (($item->getType() != 'Ticket') && ($item->getType() != 'KnowbaseItem') && ($item->getType() != 'Reminder') && !Session::haveRight('document','r')) { return false; } if (!$item->can($item->fields['id'],'r')) { return false; } if (empty($withtemplate)) { $withtemplate = 0; } $linkparam = ''; if (get_class($item) == 'Ticket') { $linkparam = "&tickets_id=".$item->fields['id']; } $canedit = $item->canadditem('Document'); $rand = mt_rand(); $is_recursive = $item->isRecursive(); if (isset($_POST["order"]) && ($_POST["order"] == "ASC")) { $order = "ASC"; } else { $order = "DESC"; } if (isset($_POST["sort"]) && !empty($_POST["sort"])) { $sort = "`".$_POST["sort"]."`"; } else { $sort = "`assocdate`"; } $query = "SELECT `glpi_documents_items`.`id` AS assocID, `glpi_documents_items`.`date_mod` AS assocdate, `glpi_entities`.`id` AS entityID, `glpi_entities`.`completename` AS entity, `glpi_documentcategories`.`completename` AS headings, `glpi_documents`.* FROM `glpi_documents_items` LEFT JOIN `glpi_documents` ON (`glpi_documents_items`.`documents_id`=`glpi_documents`.`id`) LEFT JOIN `glpi_entities` ON (`glpi_documents`.`entities_id`=`glpi_entities`.`id`) LEFT JOIN `glpi_documentcategories` ON (`glpi_documents`.`documentcategories_id`=`glpi_documentcategories`.`id`) WHERE `glpi_documents_items`.`items_id` = '$ID' AND `glpi_documents_items`.`itemtype` = '".$item->getType()."' "; if (Session::getLoginUserID()) { $query .= getEntitiesRestrictRequest(" AND","glpi_documents",'','',true); } else { // Anonymous access from FAQ $query .= " AND `glpi_documents`.`entities_id`= '0' "; } // Document : search links in both order using union if ($item->getType() == 'Document') { $query .= "UNION SELECT `glpi_documents_items`.`id` AS assocID, `glpi_documents_items`.`date_mod` AS assocdate, `glpi_entities`.`id` AS entityID, `glpi_entities`.`completename` AS entity, `glpi_documentcategories`.`completename` AS headings, `glpi_documents`.* FROM `glpi_documents_items` LEFT JOIN `glpi_documents` ON (`glpi_documents_items`.`items_id`=`glpi_documents`.`id`) LEFT JOIN `glpi_entities` ON (`glpi_documents`.`entities_id`=`glpi_entities`.`id`) LEFT JOIN `glpi_documentcategories` ON (`glpi_documents`.`documentcategories_id`=`glpi_documentcategories`.`id`) WHERE `glpi_documents_items`.`documents_id` = '$ID' AND `glpi_documents_items`.`itemtype` = '".$item->getType()."' "; if (Session::getLoginUserID()) { $query .= getEntitiesRestrictRequest(" AND","glpi_documents",'','',true); } else { // Anonymous access from FAQ $query .= " AND `glpi_documents`.`entities_id`='0' "; } } $query .= " ORDER BY $sort $order "; $result = $DB->query($query); $number = $DB->numrows($result); $i = 0; $documents = array(); $used = array(); if ($numrows = $DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $documents[$data['assocID']] = $data; $used[$data['id']] = $data['id']; } } if ($canedit && $withtemplate < 2) { // Restrict entity for knowbase $entities = ""; $entity = $_SESSION["glpiactive_entity"]; if ($item->isEntityAssign()) { /// Case of personal items : entity = -1 : create on active entity (Reminder case)) if ($item->getEntityID() >=0 ) { $entity = $item->getEntityID(); } if ($item->isRecursive()) { $entities = getSonsOf('glpi_entities',$entity); } else { $entities = $entity; } } $limit = getEntitiesRestrictRequest(" AND ","glpi_documents",'',$entities,true); $q = "SELECT COUNT(*) FROM `glpi_documents` WHERE `is_deleted` = '0' $limit"; $result = $DB->query($q); $nb = $DB->result($result,0,0); if ($item->getType() == 'Document') { $used[$ID] = $ID; } echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
".__('Add a document')."
"; _e('Heading'); echo ''; DocumentCategory::dropdown(array('entity' => $entities)); echo ""; echo ""; echo ""; echo ""; echo ""; if ($item->getType() == 'Ticket') { echo ""; } echo ""; echo ""; echo "(".Document::getMaxUploadSize().") "; echo ""; echo ""; echo "
"; Html::closeForm(); if (Session::haveRight('document','r') && ($nb > count($used))) { echo ""; echo ""; echo ""; echo ""; echo ""; echo "
"; echo ""; echo ""; echo ""; echo ""; if ($item->getType() == 'Ticket') { echo ""; echo ""; } Document::dropdown(array('entity' => $entities , 'used' => $used)); echo ""; echo ""; echo "
"; Html::closeForm(); } echo "
"; } echo "
"; if ($canedit && $number && ($withtemplate < 2)) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $massiveactionparams = array('num_displayed' => $number); Html::showMassiveActions(__CLASS__, $massiveactionparams); } $sort_img = ""; echo ""; echo ""; if ($canedit && $number && ($withtemplate < 2)) { echo ""; } $columns = array('name' => __('Name'), 'entity' => __('Entity'), 'filename' => __('File'), 'link'=> __('Web link'), 'headings' => __('Heading'), 'mime' => __('MIME type'), 'assocdate' => __('Date')); foreach ($columns as $key => $val) { echo ""; } echo ""; $used = array(); if ($number) { // Don't use this for document associated to document // To not loose navigation list for current document if ($item->getType() != 'Document') { Session::initNavigateListItems('Document', //TRANS : %1$s is the itemtype name, // %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), $item->getTypeName(1), $item->getName())); } $document = new Document(); foreach ($documents as $data) { $docID = $data["id"]; $link = NOT_AVAILABLE; $downloadlink = NOT_AVAILABLE; if ($document->getFromDB($docID)) { $link = $document->getLink(); $downloadlink = $document->getDownloadLink($linkparam); } if ($item->getType() != 'Document') { Session::addToNavigateListItems('Document', $docID); } $used[$docID] = $docID; $assocID = $data["assocID"]; echo ""; if ($canedit && ($withtemplate < 2)) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $i++; } } echo "
".Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand)."".(($sort == "`$key`") ?$sort_img:""). "$val
"; Html::showMassiveActionCheckBox(__CLASS__, $data["assocID"]); echo "$link".Dropdown::getDropdownName("glpi_entities", $data['entityID']); echo "$downloadlink"; if (!empty($data["link"])) { echo "".$data["link"]; echo ""; } else {; echo " "; } echo "".Dropdown::getDropdownName("glpi_documentcategories", $data["documentcategories_id"]); echo "".$data["mime"]."".Html::convDateTime($data["assocdate"])."
"; if ($canedit && $number && ($withtemplate < 2)) { $massiveactionparams['ontop'] = false; Html::showMassiveActions(__CLASS__, $massiveactionparams); Html::closeForm(); } echo "
"; } } ?> glpi-0.84.3+dfsg.1/inc/documentcategory.class.php000066400000000000000000000026111226600447100215630ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class DocumentCategory class DocumentCategory extends CommonTreeDropdown { static function getTypeName($nb=0) { return _n('Document heading', 'Document headings', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/documenttype.class.php000066400000000000000000000107621226600447100207350ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// DocumentType class class DocumentType extends CommonDropdown { function getAdditionalFields() { return array(array('name' => 'icon', 'label' => __('Icon'), 'type' => 'icon'), array('name' => 'is_uploadable', 'label' => __('Authorized upload'), 'type' => 'bool'), array('name' => 'ext', 'label' => __('Extension'), 'type' => 'text', 'comment' => __('May be a regular expression')), array('name' => 'mime', 'label' => __('MIME type'), 'type' => 'text')); } static function getTypeName($nb=0) { return _n('Document type', 'Document types', $nb); } /** * Get search function for the class * * @return array of search option **/ function getSearchOptions() { $tab = parent::getSearchOptions(); $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'ext'; $tab[3]['name'] = __('Extension'); $tab[3]['datatype'] = 'string'; $tab[6]['table'] = $this->getTable(); $tab[6]['field'] = 'icon'; $tab[6]['name'] = __('Icon'); $tab[6]['massiveaction'] = false; $tab[6]['datatype'] = 'specific'; $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'mime'; $tab[4]['name'] = __('MIME type'); $tab[4]['datatype'] = 'string'; $tab[5]['table'] = $this->getTable(); $tab[5]['field'] = 'is_uploadable'; $tab[5]['name'] = __('Authorized upload'); $tab[5]['datatype'] = 'bool'; return $tab; } /** * @since version 0.84 **/ static function getSpecificValueToDisplay($field, $values, array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } switch ($field) { case 'icon' : if (!empty($values[$field])) { return " "; } } return parent::getSpecificValueToDisplay($field, $values, $options); } /** * @since version 0.84 * * @param $field * @param $name (default '') * @param $values (default '') * @param $options array **/ static function getSpecificValueToSelect($field, $name='', $values='', array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'icon' : return Dropdown::dropdownIcons($name, $values[$field], GLPI_ROOT."/pics/icones", false); } return parent::getSpecificValueToSelect($field, $name, $values, $options); } static function canCreate() { return Session::haveRight('typedoc', 'w'); } static function canView() { return Session::haveRight('typedoc', 'r'); } } ?> glpi-0.84.3+dfsg.1/inc/domain.class.php000066400000000000000000000025231226600447100174600ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Domain class Domain extends CommonDropdown { static function getTypeName($nb=0) { return _n('Domain', 'Domains', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/dropdown.class.php000066400000000000000000002076371226600447100200620ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class Dropdown { //Empty value displayed in a dropdown const EMPTY_VALUE = '-----'; /** * Print out an HTML ""; $default .= ""; $output .= Ajax::dropdown($use_ajax, "/ajax/dropdownValue.php", $param, $default, $params['rand'], false); // Display comment if ($params['comments']) { $options_tooltip = array('contentid' => "comment_".$params['name'].$params['rand'], 'display' => false); if ($item->canView()) { if($params['value'] && $item->getFromDB($params['value']) && $item->canViewItem()) { $options_tooltip['link'] = $item->getLinkURL(); } else { $options_tooltip['link'] = $item->getSearchURL(); } $options_tooltip['linkid'] = "comment_link_".$params['name'].$params['rand']; $options_tooltip['linktarget'] = '_blank'; } $output .= Html::showToolTip($comment,$options_tooltip); if (($item instanceof CommonDropdown) && $item->canCreate() && !isset($_GET['popup'])) { $output .= "getFormURL()."?popup=1&rand=". $params['rand']."' ,'glpipopup', 'height=400, ". "width=1000, top=100, left=100, scrollbars=yes' );w.focus();\">"; } // Display specific Links if ($itemtype == "Supplier") { if ($item->getFromDB($params['value'])) { $output .= $item->getLinks(); } } if (($itemtype == 'ITILCategory') && Session::haveRight('knowbase','r')) { if ($params['value'] && $item->getFromDB($params['value'])) { $output .= ' '.$item->getLinks(); } } } if ($params['display']) { echo $output; return $params['rand']; } else { return $output; } } /** * Get the value of a dropdown * * Returns the value of the dropdown from $table with ID $id. * * @param $table the dropdown table from witch we want values on the select * @param $id id of the element to get * @param $withcomment give array with name and comment (default 0) * * @return string the value of the dropdown or   if not exists **/ static function getDropdownName($table, $id, $withcomment=0) { global $DB, $CFG_GLPI; $item = getItemForItemtype(getItemTypeForTable($table)); if ($item instanceof CommonTreeDropdown) { return getTreeValueCompleteName($table,$id,$withcomment); } $name = ""; $comment = ""; if ($id) { $query = "SELECT * FROM `". $table ."` WHERE `id` = '". $id ."'"; /// TODO review comment management... /// TODO getDropdownName need to return only name /// When needed to use comment use class instead : getComments function /// GetName of class already give Name !! /// TODO CommonDBTM : review getComments to be recursive and add informations from class hierarchy /// getUserName have the same system : clean it too /// Need to study the problem if ($result = $DB->query($query)) { if ($DB->numrows($result) != 0) { $data = $DB->fetch_assoc($result); $name = $data["name"]; if (isset($data["comment"])) { $comment = $data["comment"]; } switch ($table) { case "glpi_computers" : if (empty($name)) { $name = "($id)"; } break; case "glpi_contacts" : //TRANS: %1$s is the name, %2$s is the firstname $name = sprintf(__('%1$s %2$s'), $name, $data["firstname"]); if (!empty($data["phone"])) { $comment .= "
".sprintf(__('%1$s: %2$s'), "".__('Phone'), "".$data['phone']); } if (!empty($data["phone2"])) { $comment .= "
".sprintf(__('%1$s: %2$s'), "".__('Phone 2'), "".$data['phone2']); } if (!empty($data["mobile"])) { $comment .= "
".sprintf(__('%1$s: %2$s'), "".__('Mobile phone'), "".$data['mobile']); } if (!empty($data["fax"])) { $comment .= "
".sprintf(__('%1$s: %2$s'), "".__('Fax'), "".$data['fax']); } if (!empty($data["email"])) { $comment .= "
".sprintf(__('%1$s: %2$s'), "".__('Email'), "".$data['email']); } break; case "glpi_suppliers" : if (!empty($data["phonenumber"])) { $comment .= "
".sprintf(__('%1$s: %2$s'), "".__('Phone'), "".$data['phonenumber']); } if (!empty($data["fax"])) { $comment .= "
".sprintf(__('%1$s: %2$s'), "".__('Fax'), "".$data['fax']); } if (!empty($data["email"])) { $comment .= "
".sprintf(__('%1$s: %2$s'), "".__('Email'), "".$data['email']); } break; case "glpi_netpoints" : $name = sprintf(__('%1$s (%2$s)'), $name, self::getDropdownName("glpi_locations", $data["locations_id"])); break; } } } } if (empty($name)) { $name = " "; } if ($withcomment) { return array('name' => $name, 'comment' => $comment); } return $name; } /** * Get values of a dropdown for a list of item * * @param $table the dropdown table from witch we want values on the select * @param $ids array containing the ids to get * * @return array containing the value of the dropdown or   if not exists **/ static function getDropdownArrayNames($table, $ids) { global $DB, $CFG_GLPI; $tabs = array(); if (count($ids)) { $itemtype = getItemTypeForTable($table); if ($item = getItemForItemtype($itemtype)) { $field = 'name'; if ($item instanceof CommonTreeDropdown) { $field = 'completename'; } $query = "SELECT `id`, `$field` FROM `$table` WHERE `id` IN (".implode(',',$ids).")"; if ($result = $DB->query($query)) { while ($data = $DB->fetch_assoc($result)) { $tabs[$data['id']] = $data[$field]; } } } } return $tabs; } /** * Make a select box for device type * * @param $name name of the select box * @param $types array of types to display * @param $options array Already used items ID: not to display in dropdown * Parameters which could be used in options array : * - value : integer / preselected value (default '') * - used : array / Already used items ID: not to display in dropdown (default empty) * - emptylabel : Empty choice's label (default self::EMPTY_VALUE) * - display : boolean if false get string * * @return nothing (print out an HTML select box) **/ static function showItemTypes($name, $types=array(), $options=array()) { global $CFG_GLPI; $params['value'] = ''; $params['used'] = array(); $params['emptylabel'] = self::EMPTY_VALUE; $params['display'] = true; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $params[$key] = $val; } } $options = array('' => $params['emptylabel']); if (count($types)) { foreach ($types as $type) { if ($item = getItemForItemtype($type)) { $options[$type] = $item->getTypeName(1); } } } asort($options); return self::showFromArray($name, $options, array('value' => $params['value'], 'used' => $params['used'], 'display' => $params['display'])); } /** * Make a select box for device type * * @param $name name of the select box * @param $itemtype_ref string itemtype reference where to search in itemtype field * @param $options array of possible options: * - may be value (default value) / field (used field to search itemtype) * * @return nothing (print out an HTML select box) **/ static function dropdownUsedItemTypes($name, $itemtype_ref, $options=array()) { global $DB; $p['value'] = 0; $p['field'] = 'itemtype'; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } $query = "SELECT DISTINCT `".$p['field']."` FROM `".getTableForItemType($itemtype_ref)."`"; $tabs = array(); if ($result = $DB->query($query)) { while ($data = $DB->fetch_assoc($result)) { $tabs[$data[$p['field']]] = $data[$p['field']]; } } return self::showItemTypes($name, $tabs, array('value' => $p['value'])); } /** * Make a select box for icons * * @param $myname the name of the HTML select * @param $value the preselected value we want * @param $store_path path where icons are stored * @param $display boolean display of get string ? (true by default) * * @return nothing (print out an HTML select box) **/ static function dropdownIcons($myname, $value, $store_path, $display=true) { $output = ''; if (is_dir($store_path)) { if ($dh = opendir($store_path)) { $files = array(); while (($file = readdir($dh)) !== false) { $files[] = $file; } closedir($dh); sort($files); $output .= ""; } else { //TRANS: %s is the store path printf(__('Error reading directory %s'), $store_path); } } else { //TRANS: %s is the store path printf(__('Error: %s is not a directory'), $store_path); } if ($display) { echo $output; } else { return $output; } } /** * Dropdown for GMT selection * * @param $name select name * @param $value default value (default '') **/ static function showGMT($name, $value='') { $elements = array(-12, -11, -10, -9, -8, -7, -6, -5, -4, -3.5, -3, -2, -1, 0, '+1', '+2', '+3', '+3.5', '+4', '+4.5', '+5', '+5.5', '+6', '+6.5', '+7', '+8', '+9', '+9.5', '+10', '+11', '+12', '+13'); echo ""; } /** * Make a select box for a boolean choice (Yes/No) * * @param $name select name * @param $value preselected value. (default 0) * @param $restrict_to allows to display only yes or no in the dropdown (default -1) * @param $params Array of optional options (passed to showFromArray) * * @return rand value **/ static function showYesNo($name, $value=0, $restrict_to=-1, $params=array()) { if ($restrict_to != 0) { $options[0] = __('No'); } if ($restrict_to != 1) { $options[1] = __('Yes'); } $params['value'] = $value; return self::showFromArray($name, $options, $params); } /** * Get Yes No string * * @param $value Yes No value * * @return string **/ static function getYesNo($value) { if ($value) { return __('Yes'); } return __('No'); } /** * Get the Device list name the user is allowed to edit * * @return array (group of dropdown) of array (itemtype => localized name) **/ static function getDeviceItemTypes() { global $CFG_GLPI; static $optgroup = NULL; if (!Session::haveRight('device', 'r')) { return array(); } if (is_null($optgroup)) { $optgroup = array(_n('Component', 'Components', 2) => array('DeviceMotherboard' => DeviceMotherboard::getTypeName(2), 'DeviceProcessor' => DeviceProcessor::getTypeName(2), 'DeviceNetworkCard' => DeviceNetworkCard::getTypeName(2), 'DeviceMemory' => DeviceMemory::getTypeName(2), 'DeviceHardDrive' => DeviceHardDrive::getTypeName(2), 'DeviceDrive' => DeviceDrive::getTypeName(2), 'DeviceControl' => DeviceControl::getTypeName(2), 'DeviceGraphicCard' => DeviceGraphicCard::getTypeName(2), 'DeviceSoundCard' => DeviceSoundCard::getTypeName(2), 'DeviceCase' => DeviceCase::getTypeName(2), 'DevicePowerSupply' => DevicePowerSupply::getTypeName(2), 'DevicePci' => DevicePci::getTypeName(2))); } return $optgroup; } /** * Get the dropdown list name the user is allowed to edit * * @return array (group of dropdown) of array (itemtype => localized name) **/ static function getStandardDropdownItemTypes() { global $CFG_GLPI; static $optgroup = NULL; if (is_null($optgroup)) { $optgroup = array(__('Common') => array('Location' => _n('Location', 'Locations', 2), 'State' => _n('Status of items', 'Statuses of items', 2), 'Manufacturer' => _n('Manufacturer', 'Manufacturers', 2), 'Blacklist' => _n('Blacklist','Blacklists',2)), __('Assistance') => array('ITILCategory' => _n('Category of ticket', 'Categories of tickets',2), 'TaskCategory' => _n('Tasks category','Tasks categories', 2), 'SolutionType' => _n('Solution type', 'Solution types', 2), 'RequestType' => _n('Request source', 'Request sources', 2), 'SolutionTemplate' => _n('Solution template', 'Solution templates', 2)), _n('Type', 'Types', 2) => array('ComputerType' => _n('Computer type', 'Computers types', 2), 'NetworkEquipmentType' => _n('Networking equipment type', 'Networking equipment types', 2), 'PrinterType' => _n('Printer type', 'Printer types', 2), 'MonitorType' => _n('Monitor type', 'Monitor types', 2), 'PeripheralType' => _n('Devices type', 'Devices types', 2), 'PhoneType' => _n('Phone type', 'Phones types', 2), 'SoftwareLicenseType' => _n('License type', 'License types', 2), 'CartridgeItemType' => _n('Cartridge type', 'Cartridge types', 2), 'ConsumableItemType' => _n('Consumable type', 'Consumable types', 2), 'ContractType' => _n('Contract type', 'Contract types', 2), 'ContactType' => _n('Contact type', 'Contact types', 2), 'DeviceMemoryType' => _n('Memory type', 'Memory types', 2), 'SupplierType' => _n('Third party type', 'Third party types', 2), 'InterfaceType' => _n('Interface type (Hard drive...)', 'Interface types (Hard drive...)', 2) , 'DeviceCaseType' => _n('Case type', 'Case types', 2), 'PhonePowerSupply' => _n('Phone power supply type', 'Phones power supply types', 2), 'Filesystem' => _n('File system', 'File systems', 2)), __('Model') => array('ComputerModel' => _n('Computer model', 'Computer models', 2), 'NetworkEquipmentModel' => _n('Networking equipment model', 'Networking equipment models', 2), 'PrinterModel' => _n('Printer model', 'Printer models', 2), 'MonitorModel' => _n('Monitor model', 'Monitor models', 2), 'PeripheralModel' => _n('Peripheral model', 'Peripheral models', 2), 'PhoneModel' => _n('Phone model', 'Phone models', 2)), _n('Virtual machine', 'Virtual machines', 2) => array('VirtualMachineType' => _n('Virtualization model', 'Virtualization models', 2), 'VirtualMachineSystem' => _n('Virtualization system', 'Virtualization systems', 2), 'VirtualMachineState' => _n('State of the virtual machine', 'States of the virtual machine', 2)), __('Management') => array('DocumentCategory' => _n('Document heading', 'Document headings', 2), 'DocumentType' => _n('Document type', 'Document types', 2)), __('Tools') => array('KnowbaseItemCategory' => _n('Knowledge base category', 'Knowledge base categories', 2)), __('Calendar') => array('Calendar' => _n('Calendar', 'Calendars', 2), 'Holiday' => _n('Close time', 'Close times', 2)), _n('Operating system', 'Operating systems',2) => array('OperatingSystem' => _n('Operating system', 'Operating systems', 2), 'OperatingSystemVersion' => _n('Version of the operating system', 'Versions of the operating system', 2), 'OperatingSystemServicePack' => _n('Service pack', 'Service packs', 2), 'AutoUpdateSystem' => _n('Update source', 'Update sources', 2)), __('Networking') => array('NetworkInterface' => _n('Network interface', 'Network interfaces', 2), 'NetworkEquipmentFirmware' => _n('Firmware', 'Firmwares', 2), 'Netpoint' => _n('Network outlet', 'Network outlets', 2), 'Domain' => _n('Domain', 'Domains', 2), 'Network' => _n('Network', 'Networks', 2), 'Vlan' => __('VLAN')), __('Internet') => array('IPNetwork' => _n('IP network', 'IP networks', 2), 'FQDN' => _n('Internet domain', 'Internet domains', 2), 'WifiNetwork' => _n('Wifi network', 'Wifi networks', 2), 'NetworkName' => _n('Network name', 'Network names', 2)), _n('Software', 'Software', 1) => array('SoftwareCategory' => _n('Software category', 'Software categories', 2)), __('User') => array('UserTitle' => _n('User title', 'Users titles', 2), 'UserCategory' => _n('User category', 'User categories', 2)), __('Authorizations assignment rules') => array('RuleRightParameter' => _n('LDAP criterion', 'LDAP criteria', 2)), __('Fields unicity') => array('Fieldblacklist' => _n('Ignored value for the unicity', 'Ignored values for the unicity', 2)), __('External authentications') => array('SsoVariable' => _n('Field storage of the login in the HTTP request', 'Fields storage of the login in the HTTP request', 2)) ); //end $opt $plugdrop = Plugin::getDropdowns(); if (count($plugdrop)) { $optgroup = array_merge($optgroup, $plugdrop); } foreach ($optgroup as $label=>$dp) { foreach ($dp as $key => $val) { if ($tmp = getItemForItemtype($key)) { if (!$tmp->canView()) { unset($optgroup[$label][$key]); } } else { unset($optgroup[$label][$key]); } } if (count($optgroup[$label]) == 0) { unset($optgroup[$label]); } } } return $optgroup; } /** * Display a menu to select a itemtype which open the search form * * @param $title string title to display * @param $optgroup array (group of dropdown) of array (itemtype => localized name) * @param $value string URL of selected current value (default '') **/ static function showItemTypeMenu($title, $optgroup, $value='') { echo ""; echo ""; echo "
 ".$title."  "; echo " "; echo "

"; } /** * Display a list to select a itemtype with link to search form * * @param $optgroup array (group of dropdown) of array (itemtype => localized name) */ static function showItemTypeList($optgroup) { echo "
"; $nb = 0; foreach ($optgroup as $label => $dp) { $nb += count($dp); } $step = ($nb > 15 ? ($nb/3) : $nb); echo "
"; echo ""; $i = 1; foreach ($optgroup as $label => $dp) { echo "\n"; foreach ($dp as $key => $val) { $class="class='tab_bg_4'"; if (($itemtype = getItemForItemtype($key)) && $itemtype->isEntityAssign()) { $class="class='tab_bg_2'"; } echo "\n"; $i++; } if ($i >= $step) { echo "
$label
"; echo "$val
 "; $step += $step; } } echo "
"; } /** * Dropdown available languages * * @param $myname select name * @param $options array of additionnal options: * - display_emptychoice : allow selection of no language * - emptylabel : specific string to empty label if display_emptychoice is true **/ static function showLanguages($myname, $options=array()) { global $CFG_GLPI; $values = array(); if (isset($options['display_emptychoice']) && ($options['display_emptychoice'])) { if (isset($options['emptylabel'])) { $values[''] = $options['emptylabel']; } else { $values[''] = self::EMPTY_VALUE; } } foreach ($CFG_GLPI["languages"] as $key => $val) { if (isset($val[1]) && is_file(GLPI_ROOT ."/locales/".$val[1])) { $values[$key] = $val[0]; } } return self::showFromArray($myname, $values, $options); } /** * @since version 0.84 * * @param $value **/ static function getLanguageName($value) { global $CFG_GLPI; if (isset($CFG_GLPI["languages"][$value][0])) { return $CFG_GLPI["languages"][$value][0]; } return $value; } /** * Print a select with hours * * Print a select named $name with hours options and selected value $value * *@param $name string HTML select name *@param $value integer HTML select selected value *@param $limit_planning limit planning to the configuration range (default 0) * *@return Nothing (display) **/ static function showHours($name, $value, $limit_planning=0) { global $CFG_GLPI; $begin = 0; $end = 24; $step = $CFG_GLPI["time_step"]; // Check if the $step is Ok for the $value field $split = explode(":", $value); // Valid value XX:YY ou XX:YY:ZZ if ((count($split) == 2) || (count($split) == 3)) { $min = $split[1]; // Problem if (($min%$step) != 0) { // set minimum step $step = 5; } } if ($limit_planning) { $plan_begin = explode(":", $CFG_GLPI["planning_begin"]); $plan_end = explode(":", $CFG_GLPI["planning_end"]); $begin = (int) $plan_begin[0]; $end = (int) $plan_end[0]; } echo ""; } /** * show a dropdown to selec a type * * @since version 0.83 * * @param $types Types used (default "state_types") (default '') * @param $options Array of optional options * name, value, rand, emptylabel, display_emptychoice, on_change, plural, checkright * * @return integer rand for select id **/ static function showItemType($types='', $options=array()) { global $CFG_GLPI; $params['name'] = 'itemtype'; $params['value'] = ''; $params['rand'] = mt_rand(); $params['on_change'] = ''; $params['plural'] = false; //Parameters about choice 0 //Empty choice's label $params['emptylabel'] = self::EMPTY_VALUE; //Display emptychoice ? $params['display_emptychoice'] = true; $params['checkright'] = false; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $params[$key] = $val; } } if (!is_array($types)) { $types = $CFG_GLPI["state_types"]; } $options = array(); foreach ($types as $type) { if ($item = getItemForItemtype($type)) { if ($params['checkright'] && !$item->canView()) { continue; } $options[$type] = $item->getTypeName($params['plural'] ? 2 : 1); } } asort($options); if (count($options)) { echo ""; return $params['rand']; } return 0; } /** * Make a select box for all items * * @param $myname select name * @param $value_type default value for the device type (default 0) * @param $value default value (default 0) * @param $entity_restrict Restrict to a defined entity (default -1) * @param $types Types used (default '') * @param $onlyglobal Restrict to global items (false by default) * @param $checkright Restrict to items with read rights (false by default) * @param $itemtypename name used for itemtype select * * @return nothing (print out an HTML select box) **/ static function showAllItems($myname, $value_type=0, $value=0, $entity_restrict=-1, $types='', $onlyglobal=false, $checkright=false, $itemtypename = 'itemtype') { global $CFG_GLPI; $options = array(); $options['checkright'] = $checkright; $options['name'] = $itemtypename; $rand = self::showItemType($types, $options); if ($rand) { $params = array('idtable' => '__VALUE__', 'value' => $value, 'myname' => $myname, 'entity_restrict' => $entity_restrict); if ($onlyglobal) { $params['condition'] = "`is_global` = '1'"; } Ajax::updateItemOnSelectEvent("itemtype$rand", "show_$myname$rand", $CFG_GLPI["root_doc"]."/ajax/dropdownAllItems.php", $params); echo "
 \n"; if ($value > 0) { echo "\n"; $params["idtable"] = $value_type; Ajax::updateItem("show_$myname$rand", $CFG_GLPI["root_doc"]."/ajax/dropdownAllItems.php", $params); } } return $rand; } /** * Dropdown numbers * * @since version 0.84 * * @param $myname select name * @param $options array of additionnal options : * - value default value (defaul 0) * - rand random value * - min min value (default 0) * - max max value (default 100) * - step step used (default 1) * - toadd array of values to add at the beginning * - unit : string unit to used * - display : boolean if false get string **/ static function showNumber($myname, $options=array()) { $params['value'] = 0; $params['rand'] = mt_rand(); $params['min'] = 0; $params['max'] = 100; $params['step'] = 1; $params['toadd'] = array(); $params['unit'] = ''; $params['display'] = true; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $params[$key] = $val; } } $out = ""; if ($params['display']) { echo $out; return $params['rand']; } return $out; } /** * Get value with unit / Automatic management of standar unit (year, month, %, ...) * * @since v ersion 0.84 * * @param $value integer number of item * @param $unit string of unit (maybe year, month, day, hour, % for standard management) **/ static function getValueWithUnit($value, $unit) { if (strlen($unit) == 0) { return $value; } switch ($unit) { case 'year' : //TRANS: %d is a number of years return sprintf(_n('%d year', '%d years', $value), $value); case 'month' : //TRANS: %d is a number of months return sprintf(_n('%d month', '%d months', $value), $value); case 'day' : //TRANS: %d is a number of days return sprintf(_n('%d day', '%d days', $value), $value); case 'hour' : //TRANS: %d is a number of hours return sprintf(_n('%d hour', '%d hours', $value), $value); case 'minute' : //TRANS: %d is a number of minutes return sprintf(_n('%d minute', '%d minutes', $value), $value); case 'second' : //TRANS: %d is a number of seconds return sprintf(_n('%d second', '%d seconds', $value), $value); case 'millisecond' : //TRANS: %d is a number of milliseconds return sprintf(_n('%d millisecond', '%d milliseconds', $value), $value); case '%' : return sprintf(__('%d%%'), $value); default : return sprintf(__('%1$s %2$s'), $value, $unit); } } /** * Dropdown integers * * @param $myname select name * @param $value default value * @param $min min value (default 0) * @param $max max value (default 100) * @param $step step used (default 1) * @param $toadd array of values to add at the beginning * @param $options array of additionnal options : * - unit : string unit to used * - display : boolean if false get string * \deprecated use Dropdown::showNumber instead **/ static function showInteger($myname, $value, $min=0, $max=100, $step=1, $toadd=array(), $options=array()) { $opt = array('value' => $value, 'min' => $min, 'max' => $max, 'step' => $step, 'toadd' => $toadd); if (count($options)) { foreach ($options as $key => $val) { $opt[$key] = $val; } } return self::showNumber($myname,$opt); } /** * Dropdown integers * * @since version 0.83 * * @param $myname select name * @param $options array of options * - value : default value * - min : min value : default 0 * - max : max value : default DAY_TIMESTAMP * - value : default value * - addfirstminutes : add first minutes before first step (default false) * - toadd : array of values to add * - inhours : only show timestamp in hours not in days * - display : boolean / display or return string **/ static function showTimeStamp($myname, $options=array()) { global $CFG_GLPI; $params['value'] = 0; $params['min'] = 0; $params['max'] = DAY_TIMESTAMP; $params['step'] = $CFG_GLPI["time_step"]*MINUTE_TIMESTAMP; $params['emptylabel'] = self::EMPTY_VALUE; $params['addfirstminutes'] = false; $params['toadd'] = array(); $params['inhours'] = false; $params['display'] = true; $params['display_emptychoice'] = true; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $params[$key] = $val; } } // Manage min : $params['min'] = floor($params['min']/$params['step'])*$params['step']; if ($params['min'] == 0) { $params['min'] = $params['step']; } $params['max'] = max($params['value'], $params['max']); // Floor with MINUTE_TIMESTAMP for rounded purpose if (($params['value'] < max($params['min'], 10*MINUTE_TIMESTAMP)) && $params['addfirstminutes']) { $params['value'] = floor(($params['value'])/MINUTE_TIMESTAMP)*MINUTE_TIMESTAMP; } else { $params['value'] = floor(($params['value'])/$params['step'])*$params['step']; } $values = array(); if ($params['display_emptychoice']) { $values = array(0 => $params['emptylabel']); } if ($params['value']) { $values[$params['value']] = ''; } if ($params['addfirstminutes']) { for ($i=MINUTE_TIMESTAMP; $i $val) { if (empty($val)) { if ($params['inhours']) { $day = 0; $hour = floor($i/HOUR_TIMESTAMP); } else { $day = floor($i/DAY_TIMESTAMP); $hour = floor(($i%DAY_TIMESTAMP)/HOUR_TIMESTAMP); } $minute = floor(($i%HOUR_TIMESTAMP)/MINUTE_TIMESTAMP); if ($minute === '0') { $minute = '00'; } $values[$i] = ''; if ($day > 0) { if (($hour > 0) || ($minute > 0)) { if ($minute < 10) { $minute = '0'.$minute; } //TRANS: %1$d is the number of days, %2$d the number of hours, // %3$s the number of minutes : display 1 day 3h15 $values[$i] = sprintf(_n('%1$d day %2$dh%3$s','%1$d days %2$dh%3$s', $day), $day, $hour, $minute); } else { $values[$i] = sprintf(_n('%d day','%d days',$day), $day); } } else if ($hour > 0 || $minute > 0) { if ($minute < 10) { $minute = '0'.$minute; } //TRANS: %1$d the number of hours, %2$s the number of minutes : display 3h15 $values[$i] = sprintf(__('%1$dh%2$s'), $hour, $minute); } } } return Dropdown::showFromArray($myname, $values, array('value' => $params['value'], 'display' => $params['display'])); } /** * Private / Public switch for items which may be assign to a user and/or an entity * * @param $is_private default is private ? * @param $entity working entity ID * @param $is_recursive is the item recursive ? **/ static function showPrivatePublicSwitch($is_private, $entity, $is_recursive) { global $CFG_GLPI; $rand = mt_rand(); echo ""; echo ""; $_POST['rand'] = $rand; $_POST['is_private'] = $is_private; $_POST['is_recursive'] = $is_recursive; $_POST['entities_id'] = $entity; include (GLPI_ROOT."/ajax/private_public.php"); echo "\n"; return $rand; } /** * Toggle view in LDAP user import/synchro between no restriction and date restriction * * @param $enabled (default 0) **/ static function showAdvanceDateRestrictionSwitch($enabled=0) { global $CFG_GLPI; $rand = mt_rand(); $url = $CFG_GLPI["root_doc"]."/ajax/ldapdaterestriction.php"; echo ""; echo ""; echo ""; $_POST['enabled'] = $enabled; include (GLPI_ROOT."/ajax/ldapdaterestriction.php"); echo "\n"; return $rand; } /** * Dropdown of values in an array * * @param $name select name * @param $elements array of elements to display * @param $options array of possible options: * - value : integer / preselected value (default 0) * - used : array / Already used items ID: not to display in dropdown (default empty) * - readonly : boolean / used as a readonly item (default false) * - on_change : string / value to transmit to "onChange" * - multiple : boolean / can select several values (default false) * - size : integer / number of rows for the select (default = 1) * - mark_unmark_all : add buttons to select or deselect all options (only for multiple) * - display : boolean / display or return string * - other : boolean or string if not false, then we can use an "other" value * if it is a string, then the default value will be this string * - rand : specific rand if needed (default is generated one) * * Permit to use optgroup defining items in arrays * array('optgroupname' => array('key1' => 'val1', * 'key2' => 'val2'), * 'optgroupname2' => array('key3' => 'val3', * 'key4' => 'val4')) **/ static function showFromArray($name, array $elements, $options=array()) { $param['value'] = ''; $param['values'] = array(); $param['used'] = array(); $param['readonly'] = false; $param['on_change'] = ''; $param['multiple'] = false; $param['size'] = 1; $param['mark_unmark_all'] = false; $param['display'] = true; $param['other'] = false; $param['rand'] = mt_rand(); if (is_array($options) && count($options)) { if (isset($options['value']) && strlen($options['value'])) { $options['values'] = array($options['value']); unset($options['value']); } foreach ($options as $key => $val) { $param[$key] = $val; } } if ($param['other'] !== false) { $other_select_option = $name . '_other_value'; $param['on_change'] .= "displayOtherSelectOptions(this, \"$other_select_option\");"; // If $param['other'] is a string, then we must highlight "other" option if (is_string($param['other'])) { if (!$param["multiple"]) { $param['values'] = array($other_select_option); } else { $param['values'][] = $other_select_option; } } } if ($param["multiple"]) { $field_name = $name."[]"; } else { $field_name = $name; } $output = ''; // readonly mode if ($param['readonly']) { foreach ($param['values'] as $value) { $output .= ""; if (isset($elements[$value])) { $output .= $elements[$value]." "; } } } else { $field_id = "dropdown_".$name.$param['rand']; $output .= ""; if ($param['other'] !== false) { $output .= ""; $deselect = ""; if ($size > $max_option_size) { $output = ""; $output .= "
".$output.""; $output .= $select; $output .= "
"; $output .= $deselect; } else { $output = ""; $output .= "
".$output."
"; $output .= $select; $output .= ""; $output .= $deselect; } $output .= "
"; } } if ($param['display']) { echo $output; return $param['rand']; } return $output; } /** * Dropdown for global item management * * @param $ID item ID * @param attrs array which contains the extra paramters * * Parameters can be : * - target target for actions * - withtemplate template or basic computer * - value value of global state * - management_restrict global management restrict mode **/ static function showGlobalSwitch($ID, $attrs=array()) { global $CFG_GLPI; $params['management_restrict'] = 0; $params['value'] = 0; $params['name'] = 'is_global'; $params['target'] = ''; foreach ($attrs as $key => $value) { if ($value != '') { $params[$key] = $value; } } if ($params['value'] && empty($params['withtemplate'])) { _e('Global management'); if ($params['management_restrict'] == 2) { echo " "; Html::showSimpleForm($params['target'], 'unglobalize', __('Use unitary management'), array('id' => $ID), '', '', array(__('Do you really want to use unitary management for this item?'), __('Duplicate the element as many times as there are connections'))); echo " "; echo "\"".__s('Duplicate"; } } else { if ($params['management_restrict'] == 2) { echo ""; } else { // Templates edition if (!empty($params['withtemplate'])) { echo ""; echo (!$params['management_restrict']?__('Unit management') :__('Global management')); } else { echo (!$params['value']?__('Unit management'):__('Global management')); } } } } /** * Import a dropdown - check if already exists * * @param $itemtype string name of the class * @param $input array of value to import * * @return the ID of the new **/ static function import($itemtype, $input) { if (!($item = getItemForItemtype($itemtype))) { return false; } return $item->import($input); } /** * Import a value in a dropdown table. * * This import a new dropdown if it doesn't exist - Play dictionnary if needed * * @param $itemtype string name of the class * @param $value string Value of the new dropdown. (need to be addslashes) * @param $entities_id integer entity in case of specific dropdown (default -1) * @param $external_params array (need to be addslashes) * @param $comment (default '') (need to be addslashes) * @param $add if true, add it if not found. if false, just check if exists * (true by default) * * @return integer : dropdown id. **/ static function importExternal($itemtype, $value, $entities_id=-1, $external_params=array(), $comment='', $add=true) { if (!($item = getItemForItemtype($itemtype))) { return false; } return $item->importExternal($value, $entities_id, $external_params, $comment, $add); } /** * Get the label associated with a management type * * @param value the type of management (default 0) * * @return the label corresponding to it, or "" **/ static function getGlobalSwitch($value=0) { switch ($value) { case 0 : return __('Unit management'); case 1 : return __('Global management'); default : return ""; } } /** * show dropdown for output format * * @since version 0.83 **/ static function showOutputFormat() { global $CFG_GLPI; echo " "; echo ""; } /** * show dropdown to select list limit * * @since version 0.83 * * @param $onchange String optional, for ajax (default '') **/ static function showListLimit($onchange='') { global $CFG_GLPI; echo ""; } } ?> glpi-0.84.3+dfsg.1/inc/entity.class.php000066400000000000000000002532471226600447100175400ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Entity class */ class Entity extends CommonTreeDropdown { public $must_be_replace = true; public $dohistory = true; public $first_level_menu = "admin"; public $second_level_menu = "entity"; const CONFIG_PARENT = -2; const CONFIG_NEVER = -10; const AUTO_ASSIGN_HARDWARE_CATEGORY = 1; const AUTO_ASSIGN_CATEGORY_HARDWARE = 2; // Array of "right required to update" => array of fields allowed // Missing field here couldn't be update (no right) private static $field_right = array('entity' => array(// Address 'address', 'country', 'email', 'fax', 'notepad', 'phonenumber', 'postcode', 'state', 'town', 'website', // Advanced (could be user_authtype ?) 'authldaps_id', 'entity_ldapfilter', 'ldap_dn', 'mail_domain', 'tag', // Inventory 'autofill_buy_date', 'autofill_delivery_date', 'autofill_order_date', 'autofill_use_date', 'autofill_warranty_date', 'entities_id_software', 'level', 'name', 'completename', 'entities_id', 'ancestors_cache', 'sons_cache', 'comment'), // Notification 'notification' => array('admin_email', 'admin_reply', 'admin_email_name', 'admin_reply_name', 'default_cartridges_alarm_threshold', 'default_consumables_alarm_threshold', 'default_contract_alert', 'default_infocom_alert', 'mailing_signature', 'cartridges_alert_repeat', 'consumables_alert_repeat', 'notclosed_delay', 'use_licenses_alert', 'send_licenses_alert_before_delay', 'use_contracts_alert', 'send_contracts_alert_before_delay', 'use_reservations_alert', 'use_infocoms_alert', 'send_infocoms_alert_before_delay', 'notification_subject_tag'), // Helpdesk 'entity_helpdesk' => array('calendars_id', 'tickettype', 'auto_assign_mode', 'autoclose_delay', 'inquest_config', 'inquest_rate', 'inquest_delay', 'inquest_URL', 'max_closedate', 'tickettemplates_id')); function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'delete'; $forbidden[] = 'purge'; $forbidden[] = 'restore'; $forbidden[] = 'merge'; return $forbidden; } /** * @since version 0.84 **/ function pre_deleteItem() { // Security do not delete root entity if ($this->input['id'] == 0) { return false; } return true; } static function getTypeName($nb=0) { return _n('Entity', 'Entities', $nb); } static function canCreate() { return Session::haveRight('entity', 'w'); } /** * @Since version 0.84 */ static function canUpdate() { return (Session::haveRight('entity', 'w') || Session::haveRight('entity_helpdesk','w') || Session::haveRight('notification','w')); } static function canView() { return Session::haveRight('entity', 'r'); } function canCreateItem() { // Check the parent return Session::haveRecursiveAccessToEntity($this->getField('entities_id')); } function canUpdateItem() { // Check the current entity return Session::haveAccessToEntity($this->getField('id')); } /** * @since version 0.84 * * @see CommonDBTM::canViewItem() **/ function canViewItem() { // Check the current entity return Session::haveAccessToEntity($this->getField('id')); } /** * @see CommonDBTM::isNewID() **/ static function isNewID($ID) { return (($ID < 0) || !strlen($ID)); } /** * Check right on each field before add / update * * @since version 0.84 (before in entitydata.class) * * @param $input array (form) * * @return array (filtered input) **/ private function checkRightDatas($input) { $tmp = array(); if (isset($input['id'])) { $tmp['id'] = $input['id']; } foreach (self::$field_right as $right => $fields) { if (Session::haveRight($right, 'w')) { foreach ($fields as $field) { if (isset($input[$field])) { $tmp[$field] = $input[$field]; } } } } // Add framework / internal ones foreach ($input as $key => $val) { if ($key[0] == '_') { $tmp[$key] = $input[$key]; } } return $tmp; } /** * @since version 0.84 (before in entitydata.class) **/ function prepareInputForAdd($input) { global $DB; $input = parent::prepareInputForAdd($input); $query = "SELECT MAX(`id`)+1 AS newID FROM `glpi_entities`"; if ($result = $DB->query($query)) { $input['id'] = $DB->result($result,0,0); } else { return false; } $input['max_closedate'] = $_SESSION["glpi_currenttime"]; return $this->checkRightDatas($input); } /** * @since version 0.84 (before in entitydata.class) **/ function prepareInputForUpdate($input) { $input = parent::prepareInputForUpdate($input); // Si on change le taux de déclenchement de l'enquête (enquête activée) ou le type de l'enquete, // cela s'applique aux prochains tickets - Pas à l'historique if ((isset($input['inquest_rate']) && (($this->fields['inquest_rate'] == 0) || is_null($this->fields['max_closedate'])) && ($input['inquest_rate'] != $this->fields['inquest_rate'])) || (isset($input['inquest_config']) && (($this->fields['inquest_config'] == 0) || is_null($this->fields['max_closedate'])) && ($input['inquest_config'] != $this->fields['inquest_config']))) { $input['max_closedate'] = $_SESSION["glpi_currenttime"]; } // Force entities_id = -1 for root entity if ($input['id'] == 0) { $input['entities_id'] = -1; $input['level'] = 1; } if (!Session::isCron()) { // Filter input for connected $input = $this->checkRightDatas($input); } return $input; } /** * @see CommonTreeDropdown::defineTabs() **/ function defineTabs($options=array()) { $ong = array(); $this->addStandardTab($this->getType(), $ong, $options); $this->addStandardTab('Profile_User',$ong, $options); $this->addStandardTab(__CLASS__, $ong, $options); $this->addStandardTab('Rule', $ong, $options); $this->addStandardTab('Document_Item',$ong, $options); $this->addStandardTab('Note',$ong, $options); $this->addStandardTab('Log',$ong, $options); return $ong; } /** * @since version 0.84 (before in entitydata.class) **/ function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { switch ($item->getType()) { case __CLASS__ : $ong = array(); $ong[1] = $this->getTypeName(2); $ong[2] = __('Address'); $ong[3] = __('Advanced information'); if (Session::haveRight('notification','r')) { $ong[4] = _n('Notification', 'Notifications',2); } if (Session::haveRight('entity_helpdesk','r')) { $ong[5] = __('Assistance'); } $ong[6] = __('Assets'); return $ong; } } return ''; } /** * @since version 0.84 (before in entitydata.class) **/ static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType()==__CLASS__) { switch ($tabnum) { case 1 : $item->showChildren(); break; case 2 : self::showStandardOptions($item); break; case 3 : self::showAdvancedOptions($item); break; case 4 : self::showNotificationOptions($item); break; case 5 : self::showHelpdeskOptions($item); break; case 6 : self::showInventoryOptions($item); break; } } return true; } /** * Print a good title for entity pages * *@return nothing (display) **/ function title() { // Empty title for entities } function displayHeader() { Html::header($this->getTypeName(1), '', "admin", "entity"); } /** * Get the ID of entity assigned to the object * * simply return ID * * @return ID of the entity **/ function getEntityID() { if (isset($this->fields["id"])) { return $this->fields["id"]; } return -1; } function isEntityAssign() { return true; } function maybeRecursive() { return true; } /** * Is the object recursive * * Entity are always recursive * * @return integer (0/1) **/ function isRecursive () { return true; } function post_addItem() { parent::post_addItem(); // Add right to current user - Hack to avoid login/logout $_SESSION['glpiactiveentities'][$this->fields['id']] = $this->fields['id']; $_SESSION['glpiactiveentities_string'] .= ",'".$this->fields['id']."'"; } function cleanDBonPurge() { global $DB; // most use entities_id, RuleDictionnarySoftwareCollection use new_entities_id Rule::cleanForItemAction($this, '%entities_id'); Rule::cleanForItemCriteria($this); $gki = new Entity_KnowbaseItem(); $gki->cleanDBonItemDelete($this->getType(), $this->fields['id']); $gr = new Entity_Reminder(); $gr->cleanDBonItemDelete($this->getType(), $this->fields['id']); } function getSearchOptions() { /// TODO lots of specific values may be passed to standard ones. $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'completename'; $tab[1]['name'] = __('Complete name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'address'; $tab[3]['name'] = __('Address'); $tab[3]['massiveaction'] = false; $tab[3]['datatype'] = 'text'; $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'website'; $tab[4]['name'] = __('Website'); $tab[4]['massiveaction'] = false; $tab[4]['datatype'] = 'string'; $tab[5]['table'] = $this->getTable(); $tab[5]['field'] = 'phonenumber'; $tab[5]['name'] = __('Phone'); $tab[5]['massiveaction'] = false; $tab[5]['datatype'] = 'string'; $tab[6]['table'] = $this->getTable(); $tab[6]['field'] = 'email'; $tab[6]['name'] = _n('Email', 'Emails', 1); $tab[6]['datatype'] = 'email'; $tab[6]['massiveaction'] = false; $tab[7]['table'] = $this->getTable(); $tab[7]['field'] = 'ldap_dn'; $tab[7]['name'] = __('LDAP directory information attribute representing the entity'); $tab[7]['massiveaction'] = false; $tab[7]['datatype'] = 'string'; $tab[8]['table'] = $this->getTable(); $tab[8]['field'] = 'tag'; $tab[8]['name'] = __('Information in inventory tool (TAG) representing the entity'); $tab[8]['massiveaction'] = false; $tab[8]['datatype'] = 'string'; $tab[9]['table'] = 'glpi_authldaps'; $tab[9]['field'] = 'name'; $tab[9]['name'] = __('LDAP directory of an entity'); $tab[9]['massiveaction'] = false; $tab[9]['datatype'] = 'dropdown'; $tab[10]['table'] = $this->getTable(); $tab[10]['field'] = 'fax'; $tab[10]['name'] = __('Fax'); $tab[10]['massiveaction'] = false; $tab[10]['datatype'] = 'string'; $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'town'; $tab[11]['name'] = __('City'); $tab[11]['massiveaction'] = false; $tab[11]['datatype'] = 'string'; $tab[12]['table'] = $this->getTable(); $tab[12]['field'] = 'state'; $tab[12]['name'] = __('State'); $tab[12]['massiveaction'] = false; $tab[12]['datatype'] = 'string'; $tab[13]['table'] = $this->getTable(); $tab[13]['field'] = 'country'; $tab[13]['name'] = __('Country'); $tab[13]['massiveaction'] = false; $tab[13]['datatype'] = 'string'; $tab[14]['table'] = $this->getTable(); $tab[14]['field'] = 'name'; $tab[14]['name'] = __('Name'); $tab[14]['datatype'] = 'itemlink'; $tab[14]['massiveaction'] = false; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab[17]['table'] = $this->getTable(); $tab[17]['field'] = 'entity_ldapfilter'; $tab[17]['name'] = __('Search filter (if needed)'); $tab[17]['massiveaction'] = false; $tab[17]['datatype'] = 'string'; $tab[18]['table'] = $this->getTable(); $tab[18]['field'] = 'admin_email'; $tab[18]['name'] = __('Administrator email'); $tab[18]['massiveaction'] = false; $tab[18]['datatype'] = 'string'; $tab[19]['table'] = $this->getTable(); $tab[19]['field'] = 'admin_reply'; $tab[19]['name'] = __('Administrator reply-to email (if needed)'); $tab[19]['massiveaction'] = false; $tab[19]['datatype'] = 'string'; $tab[20]['table'] = $this->getTable(); $tab[20]['field'] = 'mail_domain'; $tab[20]['name'] = __('Mail domain'); $tab[20]['massiveaction'] = false; $tab[20]['datatype'] = 'string'; $tab[21]['table'] = $this->getTable(); $tab[21]['field'] = 'notification_subject_tag'; $tab[21]['name'] = __('Prefix for notifications'); $tab[21]['datatype'] = 'string'; $tab[22]['table'] = $this->getTable(); $tab[22]['field'] = 'admin_email_name'; $tab[22]['name'] = __('Administrator name'); $tab[22]['datatype'] = 'string'; $tab[23]['table'] = $this->getTable(); $tab[23]['field'] = 'admin_reply_name'; $tab[23]['name'] = __('Response address (if needed)'); $tab[23]['datatype'] = 'string'; $tab[24]['table'] = $this->getTable(); $tab[24]['field'] = 'mailing_signature'; $tab[24]['name'] = __('Email signature'); $tab[24]['datatype'] = 'text'; $tab[25]['table'] = $this->getTable(); $tab[25]['field'] = 'postcode'; $tab[25]['name'] = __('Postal code'); $tab[25]['datatype'] = 'string'; $tab[26]['table'] = $this->getTable(); $tab[26]['field'] = 'cartridges_alert_repeat'; $tab[26]['name'] = __('Alarms on cartridges'); $tab[26]['massiveaction'] = false; $tab[26]['nosearch'] = true; $tab[26]['datatype'] = 'specific'; $tab[27]['table'] = $this->getTable(); $tab[27]['field'] = 'consumables_alert_repeat'; $tab[27]['name'] = __('Alarms on consumables'); $tab[27]['massiveaction'] = false; $tab[27]['nosearch'] = true; $tab[27]['datatype'] = 'specific'; $tab[28]['table'] = $this->getTable(); $tab[28]['field'] = 'notepad'; $tab[28]['name'] = __('Notes'); $tab[28]['datatype'] = 'text'; $tab[29]['table'] = $this->getTable(); $tab[29]['field'] = 'use_licenses_alert'; $tab[29]['name'] = __('Alarms on expired licenses'); $tab[29]['massiveaction'] = false; $tab[29]['nosearch'] = true; $tab[29]['datatype'] = 'specific'; $tab[53]['table'] = $this->getTable(); $tab[53]['field'] = 'send_licenses_alert_before_delay'; $tab[53]['name'] = __('Send license alarms before'); $tab[53]['massiveaction'] = false; $tab[53]['nosearch'] = true; $tab[53]['datatype'] = 'specific'; $tab[30]['table'] = $this->getTable(); $tab[30]['field'] = 'use_contracts_alert'; $tab[30]['name'] = __('Alarms on contracts'); $tab[30]['massiveaction'] = false; $tab[30]['nosearch'] = true; $tab[30]['datatype'] = 'specific'; $tab[54]['table'] = $this->getTable(); $tab[54]['field'] = 'send_contracts_alert_before_delay'; $tab[54]['name'] = __('Send contract alarms before'); $tab[54]['massiveaction'] = false; $tab[54]['nosearch'] = true; $tab[54]['datatype'] = 'specific'; $tab[31]['table'] = $this->getTable(); $tab[31]['field'] = 'use_infocoms_alert'; $tab[31]['name'] = __('Alarms on financial and administrative information'); $tab[31]['massiveaction'] = false; $tab[31]['nosearch'] = true; $tab[31]['datatype'] = 'specific'; $tab[55]['table'] = $this->getTable(); $tab[55]['field'] = 'send_infocoms_alert_before_delay'; $tab[55]['name'] = __('Send financial and administrative information alarms before'); $tab[55]['massiveaction'] = false; $tab[55]['nosearch'] = true; $tab[55]['datatype'] = 'specific'; $tab[32]['table'] = $this->getTable(); $tab[32]['field'] = 'use_reservations_alert'; $tab[32]['name'] = __('Alerts on reservations'); $tab[32]['massiveaction'] = false; $tab[32]['nosearch'] = true; $tab[32]['datatype'] = 'specific'; $tab[33]['table'] = $this->getTable(); $tab[33]['field'] = 'autoclose_delay'; $tab[33]['name'] = __('Automatic closing of solved tickets after'); $tab[33]['massiveaction'] = false; $tab[33]['nosearch'] = true; $tab[33]['datatype'] = 'number'; $tab[33]['min'] = 1; $tab[33]['max'] = 99; $tab[33]['step'] = 1; $tab[33]['unit'] = 'day'; $tab[33]['toadd'] = array(self::CONFIG_PARENT => __('Inheritance of the parent entity'), self::CONFIG_NEVER => __('Never'), 0 => __('Immediatly')); $tab[34]['table'] = $this->getTable(); $tab[34]['field'] = 'notclosed_delay'; $tab[34]['name'] = __('Alerts on tickets which are not solved'); $tab[34]['massiveaction'] = false; $tab[34]['nosearch'] = true; $tab[34]['datatype'] = 'specific'; $tab[35]['table'] = $this->getTable(); $tab[35]['field'] = 'auto_assign_mode'; $tab[35]['name'] = __('Automatic assignment of tickets'); $tab[35]['massiveaction'] = false; $tab[35]['nosearch'] = true; $tab[35]['datatype'] = 'specific'; $tab[36]['table'] = $this->getTable(); $tab[36]['field'] = 'calendars_id'; // not a dropdown because of special value $tab[36]['name'] = __('Calendar'); $tab[36]['massiveaction'] = false; $tab[36]['nosearch'] = true; $tab[36]['datatype'] = 'specific'; $tab[37]['table'] = $this->getTable(); $tab[37]['field'] = 'tickettype'; $tab[37]['name'] = __('Tickets default type'); $tab[37]['massiveaction'] = false; $tab[37]['nosearch'] = true; $tab[37]['datatype'] = 'specific'; $tab[38]['table'] = $this->getTable(); $tab[38]['field'] = 'autofill_buy_date'; $tab[38]['name'] = __('Date of purchase'); $tab[38]['massiveaction'] = false; $tab[38]['nosearch'] = true; $tab[38]['datatype'] = 'specific'; $tab[39]['table'] = $this->getTable(); $tab[39]['field'] = 'autofill_order_date'; $tab[39]['name'] = __('Order date'); $tab[39]['massiveaction'] = false; $tab[39]['nosearch'] = true; $tab[39]['datatype'] = 'specific'; $tab[40]['table'] = $this->getTable(); $tab[40]['field'] = 'autofill_delivery_date'; $tab[40]['name'] = __('Delivery date'); $tab[40]['massiveaction'] = false; $tab[40]['nosearch'] = true; $tab[40]['datatype'] = 'specific'; $tab[41]['table'] = $this->getTable(); $tab[41]['field'] = 'autofill_use_date'; $tab[41]['name'] = __('Startup date'); $tab[41]['massiveaction'] = false; $tab[41]['nosearch'] = true; $tab[41]['datatype'] = 'specific'; $tab[42]['table'] = $this->getTable(); $tab[42]['field'] = 'autofill_warranty_date'; $tab[42]['name'] = __('Start date of warranty'); $tab[42]['massiveaction'] = false; $tab[42]['nosearch'] = true; $tab[42]['datatype'] = 'specific'; $tab[43]['table'] = $this->getTable(); $tab[43]['field'] = 'inquest_config'; $tab[43]['name'] = __('Satisfaction survey configuration'); $tab[43]['massiveaction'] = false; $tab[43]['nosearch'] = true; $tab[43]['datatype'] = 'specific'; $tab[44]['table'] = $this->getTable(); $tab[44]['field'] = 'inquest_rate'; $tab[44]['name'] = __('Satisfaction survey trigger rate'); $tab[44]['massiveaction'] = false; $tab[44]['datatype'] = 'number'; $tab[45]['table'] = $this->getTable(); $tab[45]['field'] = 'inquest_delay'; $tab[45]['name'] = __('Create survey after'); $tab[45]['massiveaction'] = false; $tab[45]['datatype'] = 'number'; $tab[46]['table'] = $this->getTable(); $tab[46]['field'] = 'inquest_URL'; $tab[46]['name'] = __('URL'); $tab[46]['massiveaction'] = false; $tab[46]['datatype'] = 'string'; $tab[47]['table'] = $this->getTable(); $tab[47]['field'] = 'tickettemplates_id'; // not a dropdown because of special value $tab[47]['name'] = _n('Ticket template', 'Ticket templates', 1); $tab[47]['massiveaction'] = false; $tab[47]['nosearch'] = true; $tab[47]['datatype'] = 'specific'; $tab[48]['table'] = $this->getTable(); $tab[48]['field'] = 'default_contract_alert'; $tab[48]['name'] =__('Default value for alarms on contracts'); $tab[48]['massiveaction'] = false; $tab[48]['nosearch'] = true; $tab[48]['datatype'] = 'specific'; $tab[49]['table'] = $this->getTable(); $tab[49]['field'] = 'default_infocom_alert'; $tab[49]['name'] = __('Default value for alarms on financial and administrative information'); $tab[49]['massiveaction'] = false; $tab[49]['nosearch'] = true; $tab[49]['datatype'] = 'specific'; $tab[50]['table'] = $this->getTable(); $tab[50]['field'] = 'default_cartridges_alarm_threshold'; $tab[50]['name'] = __('Default threshold for cartridges count'); $tab[50]['massiveaction'] = false; $tab[50]['nosearch'] = true; $tab[50]['datatype'] = 'number'; $tab[52]['table'] = $this->getTable(); $tab[52]['field'] = 'default_consumables_alarm_threshold'; $tab[52]['name'] = __('Default threshold for consumables count'); $tab[52]['massiveaction'] = false; $tab[52]['nosearch'] = true; $tab[52]['datatype'] = 'number'; $tab[51]['table'] = $this->getTable(); $tab[51]['field'] = 'entities_id_software'; // not a dropdown because of special value //TRANS: software in plural $tab[51]['name'] = __('Entity for software creation'); $tab[51]['massiveaction'] = false; $tab[51]['nosearch'] = true; $tab[51]['datatype'] = 'specific'; return $tab; } /** * Display entities of the loaded profile * * @param $target target for entity change action * @param $myname select name **/ static function showSelector($target, $myname) { global $CFG_GLPI; $rand = mt_rand(); echo "
"; echo "".__('Select the desired entity')."
( ".__s('to see the entity and its sub-entities').")
". "
"; echo "".str_replace(" "," ",__('Show all'))."
"; echo "
"; echo ""; echo "
"; echo "
"; } /** * @since version 0.83 (before addRule) * * @param $input array of values **/ function executeAddRule($input) { $this->check($_POST["affectentity"], 'w'); $collection = RuleCollection::getClassByType($_POST['sub_type']); $rule = $collection->getRuleClass($_POST['sub_type']); $ruleid = $rule->add($_POST); if ($ruleid) { //Add an action associated to the rule $ruleAction = new RuleAction(); //Action is : affect computer to this entity $ruleAction->addActionByAttributes("assign", $ruleid, "entities_id", $_POST["affectentity"]); switch ($_POST['sub_type']) { case 'RuleRight' : if ($_POST["profiles_id"]) { $ruleAction->addActionByAttributes("assign", $ruleid, "profiles_id", $_POST["profiles_id"]); } $ruleAction->addActionByAttributes("assign", $ruleid, "is_recursive", $_POST["is_recursive"]); } } Event::log($ruleid, "rules", 4, "setup", //TRANS: %s is the user login sprintf(__('%s adds the item'), $_SESSION["glpiname"])); Html::back(); } /** * get all entities with a notification option set * manage CONFIG_PARENT (or NULL) value * * @param $field String name of the field to search (>0) * * @return Array of id => value **/ static function getEntitiesToNotify($field) { global $DB, $CFG_GLPI; $entities = array(); // root entity first $ent = new self(); if ($ent->getFromDB(0)) { // always exists $val = $ent->getField($field); if ($val > 0) { $entities[0] = $val; } } // Others entities in level order (parent first) $query = "SELECT `glpi_entities`.`id` AS `entity`, `glpi_entities`.`entities_id` AS `parent`, `glpi_entities`.`$field` FROM `glpi_entities` ORDER BY `glpi_entities`.`level` ASC"; foreach ($DB->request($query) as $entitydatas) { if ((is_null($entitydatas[$field]) || ($entitydatas[$field] == self::CONFIG_PARENT)) && isset($entities[$entitydatas['parent']])) { // config inherit from parent $entities[$entitydatas['entity']] = $entities[$entitydatas['parent']]; } else if ($entitydatas[$field] > 0) { // config found in entity $entities[$entitydatas['entity']] = $entitydatas[$field]; } } return $entities; } /** * @since version 0.84 * * @param $entity Entity object **/ static function showStandardOptions(Entity $entity) { $con_spotted = false; $ID = $entity->getField('id'); if (!$entity->can($ID,'r')) { return false; } // Entity right applied $canedit = $entity->can($ID, 'w'); echo "
"; if ($canedit) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if ($canedit) { echo ""; echo ""; echo "
".__('Address')."
". __('Phone').""; Html::autocompletionTextField($entity, "phonenumber"); echo "".__('Address').""; echo ""; echo "
".__('Fax').""; Html::autocompletionTextField($entity, "fax"); echo "
".__('Website').""; Html::autocompletionTextField($entity, "website"); echo "
"._n('Email', 'Emails', 1).""; Html::autocompletionTextField($entity, "email"); echo "
".__('Postal code').""; Html::autocompletionTextField($entity,"postcode", array('size' => 7)); echo "  ". __('City'). " "; Html::autocompletionTextField($entity, "town", array('size' => 27)); echo "
".__('State').""; Html::autocompletionTextField($entity, "state"); echo "
".__('Country').""; Html::autocompletionTextField($entity, "country"); echo "
"; echo ""; echo ""; echo "
"; Html::closeForm(); } else { echo "
"; } echo ""; } /** * @since version 0.84 (before in entitydata.class) * * @param $entity Entity object **/ static function showAdvancedOptions(Entity $entity) { global $DB; $con_spotted = false; $ID = $entity->getField('id'); if (!$entity->can($ID,'r')) { return false; } // Entity right applied (could be user_authtype) $canedit = $entity->can($ID, 'w'); if ($canedit) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if (Toolbox::canUseLdap()) { echo ""; echo ""; echo ""; } echo ""; echo ""; echo ""; if (Toolbox::canUseLdap()) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } if ($canedit) { echo ""; echo ""; echo "
".__('Values for the generic rules for assignment to entities'). "
". __('These parameters are used as actions in generic rules for assignment to entities'). "
".__('Information in inventory tool (TAG) representing the entity').""; Html::autocompletionTextField($entity, "tag", array('size' => 100)); echo "
".__('LDAP directory information attribute representing the entity').""; Html::autocompletionTextField($entity, "ldap_dn", array('size' => 100)); echo "
".__('Mail domain surrogates entity').""; Html::autocompletionTextField($entity, "mail_domain", array('size' => 100)); echo "
". __('Values used in the interface to search users from a LDAP directory'). "
".__('LDAP directory of an entity').""; AuthLDAP::dropdown(array('value' => $entity->fields['authldaps_id'], 'emptylabel' => __('Default server'), 'condition' => "`is_active` = '1'")); echo "
".__('LDAP filter associated to the entity (if necessary)').""; Html::autocompletionTextField($entity, 'entity_ldapfilter', array('size' => 100)); echo "
"; echo ""; echo ""; echo "
"; Html::closeForm(); } else { echo ""; } } /** * @since version 0.84 (before in entitydata.class) * * @param $entity Entity object **/ static function showInventoryOptions(Entity $entity) { $ID = $entity->getField('id'); if (!$entity->can($ID,'r')) { return false; } // Notification right applied $canedit = Session::haveRight('infocom', 'w') && Session::haveAccessToEntity($ID); echo "
"; if ($canedit) { echo ""; } echo ""; echo ""; $options[0] = __('No autofill'); if ($ID > 0) { $options[self::CONFIG_PARENT] = __('Inheritance of the parent entity'); } foreach (getAllDatasFromTable('glpi_states') as $state) { $options[Infocom::ON_STATUS_CHANGE.'_'.$state['id']] //TRANS: %s is the name of the state = sprintf(__('Fill when shifting to state %s'), $state['name']); } $options[Infocom::COPY_WARRANTY_DATE] = __('Copy the start date of warranty'); //Buy date echo ""; echo ""; echo ""; //Order date echo ""; echo ""; //Delivery date echo ""; echo ""; echo ""; //Use date echo ""; echo ""; //Warranty date echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if ($canedit) { echo ""; echo ""; echo "
".__('Autofill dates for financial and administrative information'). "
" . __('Date of purchase') . ""; Dropdown::showFromArray('autofill_buy_date', $options, array('value' => $entity->getField('autofill_buy_date'))); echo " " . __('Order date') . ""; $options[Infocom::COPY_BUY_DATE] = __('Copy the date of purchase'); Dropdown::showFromArray('autofill_order_date', $options, array('value' => $entity->getField('autofill_order_date'))); echo "
" . __('Delivery date') . ""; $options[Infocom::COPY_ORDER_DATE] = __('Copy the order date'); Dropdown::showFromArray('autofill_delivery_date', $options, array('value' => $entity->getField('autofill_delivery_date'))); echo " " . __('Startup date') . " "; $options[Infocom::COPY_DELIVERY_DATE] = __('Copy the delivery date'); Dropdown::showFromArray('autofill_use_date', $options, array('value' => $entity->getField('autofill_use_date'))); echo "
" . __('Start date of warranty') . ""; $options = array(0 => __('No autofill'), Infocom::COPY_BUY_DATE => __('Copy the date of purchase'), Infocom::COPY_ORDER_DATE => __('Copy the order date'), Infocom::COPY_DELIVERY_DATE => __('Copy the delivery date')); if ($ID > 0) { $options[self::CONFIG_PARENT] = __('Inheritance of the parent entity'); } Dropdown::showFromArray('autofill_warranty_date', $options, array('value' => $entity->getField('autofill_warranty_date'))); echo "
"._n('Software', 'Software', 2)."
" . __('Entity for software creation') . ""; $toadd = array(self::CONFIG_NEVER => __('No change of entity')); // Keep software in PC entity if ($ID > 0) { $toadd[self::CONFIG_PARENT] = __('Inheritance of the parent entity'); } $entities = array($entity->fields['entities_id']); foreach (getAncestorsOf('glpi_entities', $entity->fields['entities_id']) as $ent) { if (Session::haveAccessToEntity($ent)) { $entities[] = $ent; } } self::dropdown(array('name' => 'entities_id_software', 'value' => $entity->getField('entities_id_software'), 'toadd' => $toadd, 'entity' => $entities, 'comments' => false)); if ($entity->fields['entities_id_software'] == self::CONFIG_PARENT) { $tid = self::getUsedConfig('entities_id_software', $entity->getField('entities_id')); echo "  "; echo self::getSpecificValueToDisplay('entities_id_software', $tid); echo ""; } echo "
"; echo ""; echo ""; echo "
"; Html::closeForm(); } else { echo ""; } echo "
"; } /** * @since version 0.84 (before in entitydata.class) * * @param $entity Entity object **/ static function showNotificationOptions(Entity $entity) { $ID = $entity->getField('id'); if (!$entity->can($ID,'r') || !Session::haveRight('notification','r')) { return false; } // Notification right applied $canedit = Session::haveRight('notification','w') && Session::haveAccessToEntity($ID); echo "
"; if ($canedit) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
".__('Notification options')."
".__('Administrator email').""; Html::autocompletionTextField($entity, "admin_email"); echo "" . __('Administrator name') . ""; Html::autocompletionTextField($entity, "admin_email_name"); echo "
".__('Administrator reply-to email (if needed)').""; Html::autocompletionTextField($entity, "admin_reply"); echo "" . __('Response address (if needed)') . ""; Html::autocompletionTextField($entity, "admin_reply_name"); echo "
".__('Prefix for notifications').""; Html::autocompletionTextField($entity, "notification_subject_tag"); echo " 
" . __('Email signature') . ""; echo ""; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if ($canedit) { echo ""; echo ""; echo "
".__('Alarms options')."
"; echo _n('Cartridge', 'Cartridges', 2); echo "" . __('Reminders frequency for alarms on cartridges') . ""; $default_value = $entity->fields['cartridges_alert_repeat']; Alert::dropdown(array('name' => 'cartridges_alert_repeat', 'value' => $default_value, 'inherit_parent' => (($ID > 0) ? 1 : 0))); if ($entity->fields['cartridges_alert_repeat'] == self::CONFIG_PARENT) { $tid = self::getUsedConfig('cartridges_alert_repeat', $entity->getField('entities_id')); echo "
"; echo self::getSpecificValueToDisplay('cartridges_alert_repeat', $tid); echo "
"; } echo "
" . __('Default threshold for cartridges count') .""; if ($ID > 0) { $toadd = array(self::CONFIG_PARENT => __('Inheritance of the parent entity'), self::CONFIG_NEVER => __('Never')); } else { $toadd = array(self::CONFIG_NEVER => __('Never')); } Dropdown::showInteger('default_cartridges_alarm_threshold', $entity->fields["default_cartridges_alarm_threshold"], 0, 100, 1, $toadd); if ($entity->fields['default_cartridges_alarm_threshold'] == self::CONFIG_PARENT) { $tid = self::getUsedConfig('default_cartridges_alarm_threshold', $entity->getField('entities_id')); echo "
"; echo self::getSpecificValueToDisplay('default_cartridges_alarm_threshold', $tid); echo "
"; } echo "
"; echo _n('Consumable', 'Consumables', 2); echo "" . __('Reminders frequency for alarms on consumables') . ""; $default_value = $entity->fields['consumables_alert_repeat']; Alert::dropdown(array('name' => 'consumables_alert_repeat', 'value' => $default_value, 'inherit_parent' => (($ID > 0) ? 1 : 0))); if ($entity->fields['consumables_alert_repeat'] == self::CONFIG_PARENT) { $tid = self::getUsedConfig('consumables_alert_repeat', $entity->getField('entities_id')); echo "
"; echo self::getSpecificValueToDisplay('consumables_alert_repeat', $tid); echo "
"; } echo "
" . __('Default threshold for consumables count') .""; if ($ID > 0) { $toadd = array(self::CONFIG_PARENT => __('Inheritance of the parent entity'), self::CONFIG_NEVER => __('Never')); } else { $toadd = array(self::CONFIG_NEVER => __('Never')); } Dropdown::showInteger('default_consumables_alarm_threshold', $entity->fields["default_consumables_alarm_threshold"], 0, 100, 1, $toadd); if ($entity->fields['default_consumables_alarm_threshold'] == self::CONFIG_PARENT) { $tid = self::getUsedConfig('default_consumables_alarm_threshold', $entity->getField('entities_id')); echo "
"; echo self::getSpecificValueToDisplay('default_consumables_alarm_threshold', $tid); echo "
"; } echo "
"; echo _n('Contract', 'Contracts', 2); echo "" . __('Alarms on contracts') . ""; $default_value = $entity->fields['use_contracts_alert']; Alert::dropdownYesNo(array('name' => "use_contracts_alert", 'value' => $default_value, 'inherit_parent' => (($ID > 0) ? 1 : 0))); if ($entity->fields['use_contracts_alert'] == self::CONFIG_PARENT) { $tid = self::getUsedConfig('use_contracts_alert', $entity->getField('entities_id')); echo "
"; echo self::getSpecificValueToDisplay('use_contracts_alert', $tid); echo "
"; } echo "
".__('Default value') . ""; Contract::dropdownAlert(array('name' => "default_contract_alert", 'value' => $entity->fields["default_contract_alert"], 'inherit_parent' => (($ID > 0) ? 1 : 0))); if ($entity->fields['default_contract_alert'] == self::CONFIG_PARENT) { $tid = self::getUsedConfig('default_contract_alert', $entity->getField('entities_id')); echo "
"; echo self::getSpecificValueToDisplay('default_contract_alert', $tid); echo "
"; } echo "
" . __('Send contract alarms before').""; Alert::dropdownIntegerNever('send_contracts_alert_before_delay', $entity->fields['send_contracts_alert_before_delay'], array('max' => 99, 'inherit_parent' => (($ID > 0) ? 1 : 0), 'unit' => 'day', 'never_string' => __('No'))); if ($entity->fields['send_contracts_alert_before_delay'] == self::CONFIG_PARENT) { $tid = self::getUsedConfig('send_contracts_alert_before_delay', $entity->getField('entities_id')); echo "
"; echo self::getSpecificValueToDisplay('send_contracts_alert_before_delay', $tid); echo "
"; } echo "
"; _e('Financial and administrative information'); echo "" . __('Alarms on financial and administrative information') . ""; $default_value = $entity->fields['use_infocoms_alert']; Alert::dropdownYesNo(array('name' => "use_infocoms_alert", 'value' => $default_value, 'inherit_parent' => (($ID > 0) ? 1 : 0))); if ($entity->fields['use_infocoms_alert'] == self::CONFIG_PARENT) { $tid = self::getUsedConfig('use_infocoms_alert', $entity->getField('entities_id')); echo "
"; echo self::getSpecificValueToDisplay('use_infocoms_alert', $tid); echo "
"; } echo "
" . __('Default value').""; Infocom::dropdownAlert(array('name' => 'default_infocom_alert', 'value' => $entity->fields["default_infocom_alert"], 'inherit_parent' => (($ID > 0) ? 1 : 0))); if ($entity->fields['default_infocom_alert'] == self::CONFIG_PARENT) { $tid = self::getUsedConfig('default_infocom_alert', $entity->getField('entities_id')); echo "
"; echo self::getSpecificValueToDisplay('default_infocom_alert', $tid); echo "
"; } echo "
" . __('Send financial and administrative information alarms before').""; Alert::dropdownIntegerNever('send_infocoms_alert_before_delay', $entity->fields['send_infocoms_alert_before_delay'], array('max' => 99, 'inherit_parent' => (($ID > 0) ? 1 : 0), 'unit' => 'day', 'never_string' => __('No'))); if ($entity->fields['send_infocoms_alert_before_delay'] == self::CONFIG_PARENT) { $tid = self::getUsedConfig('send_infocoms_alert_before_delay', $entity->getField('entities_id')); echo "
"; echo self::getSpecificValueToDisplay('send_infocoms_alert_before_delay', $tid); echo "
"; } echo "
"; echo _n('License', 'Licenses', 2); echo "" . __('Alarms on expired licenses') . ""; $default_value = $entity->fields['use_licenses_alert']; Alert::dropdownYesNo(array('name' => "use_licenses_alert", 'value' => $default_value, 'inherit_parent' => (($ID > 0) ? 1 : 0))); if ($entity->fields['use_licenses_alert'] == self::CONFIG_PARENT) { $tid = self::getUsedConfig('use_licenses_alert', $entity->getField('entities_id')); echo "
"; echo self::getSpecificValueToDisplay('use_licenses_alert', $tid); echo "
"; } echo "
" . __('Send license alarms before').""; Alert::dropdownIntegerNever('send_licenses_alert_before_delay', $entity->fields['send_licenses_alert_before_delay'], array('max' => 99, 'inherit_parent' => (($ID > 0) ? 1 : 0), 'unit' => 'day', 'never_string' => __('No'))); if ($entity->fields['send_licenses_alert_before_delay'] == self::CONFIG_PARENT) { $tid = self::getUsedConfig('send_licenses_alert_before_delay', $entity->getField('entities_id')); echo "
"; echo self::getSpecificValueToDisplay('send_licenses_alert_before_delay', $tid); echo "
"; } echo "
"; echo _n('Reservation', 'Reservations', 2); echo "" . __('Alerts on reservations') . ""; Alert::dropdownIntegerNever('use_reservations_alert', $entity->fields['use_reservations_alert'], array('max' => 99, 'inherit_parent' => (($ID > 0) ? 1 : 0), 'unit' => 'hour')); if ($entity->fields['use_reservations_alert'] == self::CONFIG_PARENT) { $tid = self::getUsedConfig('use_reservations_alert', $entity->getField('entities_id')); echo "
"; echo self::getSpecificValueToDisplay('use_reservations_alert', $tid); echo "
"; } echo "
"; echo _n('Ticket', 'Tickets', 2); echo "". __('Alerts on tickets which are not solved since'). ""; Alert::dropdownIntegerNever('notclosed_delay', $entity->fields["notclosed_delay"], array('max' => 99, 'inherit_parent' => (($ID > 0) ? 1 : 0), 'unit' => 'day')); if ($entity->fields['notclosed_delay'] == self::CONFIG_PARENT) { $tid = self::getUsedConfig('notclosed_delay', $entity->getField('entities_id')); echo "
"; echo self::getSpecificValueToDisplay('notclosed_delay', $tid); echo "
"; } echo "
"; echo ""; echo ""; echo "
"; Html::closeForm(); } else { echo ""; } echo "
"; } /** * @since version 0.84 (before in entitydata.class) * * @param $field * @param $value **/ private static function getEntityIDByField($field,$value) { global $DB; $sql = "SELECT `id` FROM `glpi_entities` WHERE `".$field."` = '".$value."'"; $result = $DB->query($sql); if ($DB->numrows($result) == 1) { return $DB->result($result, 0, "id"); } return -1; } /** * @since version 0.84 (before in entitydata.class) * * @param $value **/ static function getEntityIDByDN($value) { return self::getEntityIDByField("ldap_dn", $value); } /** * @since version 0.84 * * @param $value **/ static function getEntityIDByCompletename($value) { return self::getEntityIDByField("completename", $value); } /** * @since version 0.84 (before in entitydata.class) * * @param $value **/ static function getEntityIDByTag($value) { return self::getEntityIDByField("tag", $value); } /** * @since version 0.84 (before in entitydata.class) * * @param $value **/ static function getEntityIDByDomain($value) { return self::getEntityIDByField("mail_domain", $value); } /** * @since version 0.84 (before in entitydata.class) * * @param $entities_id **/ static function isEntityDirectoryConfigured($entities_id) { $entity = new self(); if ($entity->getFromDB($entities_id) && ($entity->getField('authldaps_id') != NOT_AVAILABLE)) { return true; } //If there's a directory marked as default if (AuthLdap::getDefault()) { return true; } return false; } /** * @since version 0.84 (before in entitydata.class) * * @param $entity Entity object **/ static function showHelpdeskOptions(Entity $entity) { global $CFG_GLPI; $ID = $entity->getField('id'); if (!$entity->can($ID,'r') || !Session::haveRight('entity_helpdesk','r')) { return false; } $canedit = Session::haveRight('entity_helpdesk','w') && Session::haveAccessToEntity($ID); echo "
"; if ($canedit) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "". ""; echo ""; echo ""; echo "". ""; echo "\n"; // Do not display for root entity in inherit case if (($entity->fields['inquest_config'] == self::CONFIG_PARENT) && ($ID !=0)) { $inquestconfig = self::getUsedConfig('inquest_config', $entity->fields['entities_id']); $inquestrate = self::getUsedConfig('inquest_config', $entity->fields['entities_id'], 'inquest_rate'); echo "\n"; } echo ""; if ($canedit) { echo ""; echo ""; echo "
"._n('Ticket template', 'Ticket templates', 1). ""; $toadd = array(); if ($ID != 0) { $toadd = array(self::CONFIG_PARENT => __('Inheritance of the parent entity')); } $options = array('value' => $entity->fields["tickettemplates_id"], 'entity' => $ID, 'toadd' => $toadd); TicketTemplate::dropdown($options); if (($entity->fields["tickettemplates_id"] == self::CONFIG_PARENT) && ($ID != 0)) { echo "  "; $tt = new TicketTemplate(); $tid = self::getUsedConfig('tickettemplates_id', $ID, '', 0); if (!$tid) { echo Dropdown::EMPTY_VALUE; } else if ($tt->getFromDB($tid)) { echo $tt->getLink(); } echo ""; } echo "
".__('Calendar').""; $options = array('value' => $entity->fields["calendars_id"], 'emptylabel' => __('24/7')); if ($ID != 0) { $options['toadd'] = array(self::CONFIG_PARENT => __('Inheritance of the parent entity')); } Calendar::dropdown($options); if (($entity->fields["calendars_id"] == self::CONFIG_PARENT) && ($ID != 0)) { echo "  "; $calendar = new Calendar(); $cid = self::getUsedConfig('calendars_id', $ID, '', 0); if (!$cid) { _e('24/7'); } else if ($calendar->getFromDB($cid)) { echo $calendar->getLink(); } echo ""; } echo "
".__('Tickets default type').""; $toadd = array(); if ($ID != 0) { $toadd = array(self::CONFIG_PARENT => __('Inheritance of the parent entity')); } Ticket::dropdownType('tickettype', array('value' => $entity->fields["tickettype"], 'toadd' => $toadd)); if (($entity->fields['tickettype'] == self::CONFIG_PARENT) && ($ID != 0)) { echo "  "; echo Ticket::getTicketTypeName(self::getUsedConfig('tickettype', $ID, '', Ticket::INCIDENT_TYPE)); echo ""; } echo "
".__('Automatic assignment of tickets').""; $autoassign = self::getAutoAssignMode(); if ($ID == 0) { unset($autoassign[self::CONFIG_PARENT]); } Dropdown::showFromArray('auto_assign_mode', $autoassign, array('value' => $entity->fields["auto_assign_mode"])); if (($entity->fields['auto_assign_mode'] == self::CONFIG_PARENT) && ($ID != 0)) { $auto_assign_mode = self::getUsedConfig('auto_assign_mode', $entity->fields['entities_id']); echo "  "; echo $autoassign[$auto_assign_mode]; echo ""; } echo "
".__('Automatic closing configuration')."
".__('Automatic closing of solved tickets after').""; $autoclose = array(self::CONFIG_PARENT => __('Inheritance of the parent entity'), self::CONFIG_NEVER => __('Never'), 0 => __('Immediatly')); if ($ID == 0) { unset($autoclose[self::CONFIG_PARENT]); } Dropdown::showInteger('autoclose_delay', $entity->fields['autoclose_delay'], 1, 99, 1, $autoclose, array('unit' => 'day')); if (($entity->fields['autoclose_delay'] == self::CONFIG_PARENT) && ($ID != 0)) { $autoclose_mode = self::getUsedConfig('autoclose_delay', $entity->fields['entities_id'], '', self::CONFIG_NEVER); echo "
  "; if ($autoclose_mode >= 0) { printf(_n('%d day','%d days',$autoclose_mode), $autoclose_mode); } else { echo $autoclose[$autoclose_mode]; } echo ""; } echo "
".__('Configuring the satisfaction survey')."
".__('Configuring the satisfaction survey').""; /// no inquest case = rate 0 $typeinquest = array(self::CONFIG_PARENT => __('Inheritance of the parent entity'), 1 => __('Internal survey'), 2 => __('External survey')); // No inherit from parent for root entity if ($ID == 0) { unset($typeinquest[self::CONFIG_PARENT]); if ($entity->fields['inquest_config'] == self::CONFIG_PARENT) { $entity->fields['inquest_config'] = 1; } } $rand = Dropdown::showFromArray('inquest_config', $typeinquest, $options = array('value' => $entity->fields['inquest_config'])); echo "
"; if ($inquestrate == 0) { _e('Disabled'); } else { echo $typeinquest[$inquestconfig].'
'; $inqconf = self::getUsedConfig('inquest_config', $entity->fields['entities_id'], 'inquest_delay'); printf(_n('%d day','%d days',$inqconf), $inqconf); echo "
"; //TRANS: %d is the percentage. %% to display % printf(__('%d%%'), $inquestrate); if ($inquestconfig == 2) { echo "
"; echo self::getUsedConfig('inquest_config', $entity->fields['entities_id'], 'inquest_URL'); } } echo "
"; $_POST = array('inquest_config' => $entity->fields['inquest_config'], 'entities_id' => $ID); $params = array('inquest_config' => '__VALUE__', 'entities_id' => $ID); echo "
"; include GLPI_ROOT.'/ajax/ticketsatisfaction.php'; echo "
\n"; echo "
"; echo ""; echo ""; echo "
"; Html::closeForm(); } else { echo ""; } echo "
"; Ajax::updateItemOnSelectEvent("dropdown_inquest_config$rand", "inquestconfig", $CFG_GLPI["root_doc"]."/ajax/ticketsatisfaction.php", $params); } /** * Retrieve data of current entity or parent entity * * @since version 0.84 (before in entitydata.class) * * @param $fieldref string name of the referent field to know if we look at parent entity * @param $entities_id * @param $fieldval string name of the field that we want value (default '') * @param $default_value value to return (default -2) **/ static function getUsedConfig($fieldref, $entities_id, $fieldval='', $default_value=-2) { // for calendar if (empty($fieldval)) { $fieldval = $fieldref; } $entity = new self(); // Search in entity data of the current entity if ($entity->getFromDB($entities_id)) { // Value is defined : use it if (isset($entity->fields[$fieldref])) { // Numerical value if (is_numeric($default_value) && ($entity->fields[$fieldref] != self::CONFIG_PARENT)) { return $entity->fields[$fieldval]; } // String value if (!is_numeric($default_value) && $entity->fields[$fieldref]) { return $entity->fields[$fieldval]; } } } // Entity data not found or not defined : search in parent one if ($entities_id > 0) { if ($entity->getFromDB($entities_id)) { $ret = self::getUsedConfig($fieldref, $entity->fields['entities_id'], $fieldval, $default_value); return $ret; } } /* switch ($fieldval) { case "tickettype" : // Default is Incident if not set return Ticket::INCIDENT_TYPE; } */ return $default_value; } /** * Generate link for ticket satisfaction * * @since version 0.84 (before in entitydata.class) * * @param $ticket ticket object * * @return url contents **/ static function generateLinkSatisfaction($ticket) { global $DB; $url = self::getUsedConfig('inquest_config', $ticket->fields['entities_id'], 'inquest_URL'); if (strstr($url,"[TICKET_ID]")) { $url = str_replace("[TICKET_ID]", $ticket->fields['id'], $url); } if (strstr($url,"[TICKET_NAME]")) { $url = str_replace("[TICKET_NAME]", urlencode($ticket->fields['name']), $url); } if (strstr($url,"[TICKET_CREATEDATE]")) { $url = str_replace("[TICKET_CREATEDATE]", $ticket->fields['date'], $url); } if (strstr($url,"[TICKET_SOLVEDATE]")) { $url = str_replace("[TICKET_SOLVEDATE]", $ticket->fields['solvedate'], $url); } if (strstr($url,"[REQUESTTYPE_ID]")) { $url = str_replace("[REQUESTTYPE_ID]", $ticket->fields['requesttypes_id'], $url); } if (strstr($url,"[REQUESTTYPE_NAME]")) { $url = str_replace("[REQUESTTYPE_NAME]", urlencode(Dropdown::getDropdownName('glpi_requesttypes', $ticket->fields['requesttypes_id'])), $url); } if (strstr($url,"[ITEMTYPE]") && $ticket->fields['itemtype'] && ($objet = getItemForItemtype($ticket->fields['itemtype']))) { $url = str_replace("[ITEMTYPE]", urlencode($objet->getTypeName(1)), $url); } if (strstr($url,"[ITEM_ID]")) { $url = str_replace("[ITEM_ID]", $ticket->fields['items_id'], $url); } if (strstr($url,"[ITEM_NAME]") && $ticket->fields['itemtype'] && ($objet = getItemForItemtype($ticket->fields['itemtype']))) { if ($objet->getFromDB($ticket->fields['items_id'])) { $url = str_replace("[ITEM_NAME]", urlencode($objet->getName()), $url); } } if (strstr($url,"[TICKET_PRIORITY]")) { $url = str_replace("[TICKET_PRIORITY]", $ticket->fields['priority'], $url); } if (strstr($url,"[TICKETCATEGORY_ID]")) { $url = str_replace("[TICKETCATEGORY_ID]", $ticket->fields['itilcategories_id'], $url); } if (strstr($url,"[TICKETCATEGORY_NAME]")) { $url = str_replace("[TICKETCATEGORY_NAME]", urlencode(Dropdown::getDropdownName('glpi_itilcategories', $ticket->fields['itilcategories_id'])), $url); } if (strstr($url,"[TICKETTYPE_ID]")) { $url = str_replace("[TICKETTYPE_ID]", $ticket->fields['type'], $url); } if (strstr($url,"[TICKET_TYPENAME]")) { $url = str_replace("[TICKET_TYPENAME]", Ticket::getTicketTypeName($ticket->fields['type']), $url); } if (strstr($url,"[SOLUTIONTYPE_ID]")) { $url = str_replace("[SOLUTIONTYPE_ID]", $ticket->fields['solutiontypes_id'], $url); } if (strstr($url,"[SOLUTIONTYPE_NAME]")) { $url = str_replace("[SOLUTIONTYPE_NAME]", urlencode(Dropdown::getDropdownName('glpi_solutiontypes', $ticket->fields['solutiontypes_id'])), $url); } if (strstr($url,"[SLA_ID]")) { $url = str_replace("[SLA_ID]", $ticket->fields['slas_id'], $url); } if (strstr($url,"[SLA_NAME]")) { $url = str_replace("[SLA_NAME]", urlencode(Dropdown::getDropdownName('glpi_slas', $ticket->fields['slas_id'])), $url); } if (strstr($url,"[SLALEVEL_ID]")) { $url = str_replace("[SLALEVEL_ID]", $ticket->fields['slalevels_id'], $url); } if (strstr($url,"[SLALEVEL_NAME]")) { $url = str_replace("[SLALEVEL_NAME]", urlencode(Dropdown::getDropdownName('glpi_slalevels', $ticket->fields['slalevels_id'])), $url); } return $url; } /** * get value for auto_assign_mode * * @since version 0.84 (created in version 0.83 in entitydata.class) * * @param $val if not set, ask for all values, else for 1 value (default NULL) * * @return array or string **/ static function getAutoAssignMode($val=NULL) { $tab = array(self::CONFIG_PARENT => __('Inheritance of the parent entity'), self::CONFIG_NEVER => __('No'), self::AUTO_ASSIGN_HARDWARE_CATEGORY => __('Based on the item then the category'), self::AUTO_ASSIGN_CATEGORY_HARDWARE => __('Based on the category then the item')); if (is_null($val)) { return $tab; } if (isset($tab[$val])) { return $tab[$val]; } return NOT_AVAILABLE; } /** * @since version 0.84 * * @param $options array **/ static function dropdownAutoAssignMode(array $options) { $p['name'] = 'auto_assign_mode'; $p['value'] = 0; $p['display'] = true; if (count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } $tab = self::getAutoAssignMode(); return Dropdown::showFromArray($p['name'], $tab, $p); } /** * @since version 0.84 (before in entitydata.class) * * @param $field * @param $values * @param $options array **/ static function getSpecificValueToDisplay($field, $values, array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } switch ($field) { case 'use_licenses_alert' : case 'use_contracts_alert' : case 'use_infocoms_alert' : if ($values[$field] == self::CONFIG_PARENT) { return __('Inheritance of the parent entity'); } return Dropdown::getYesNo($values[$field]); case 'use_reservations_alert' : switch ($values[$field]) { case self::CONFIG_PARENT : return __('Inheritance of the parent entity'); case 0 : return __('Never'); } return sprintf(_n('%d hour', '%d hours', $values[$field]), $values[$field]); case 'default_cartridges_alarm_threshold' : case 'default_consumables_alarm_threshold' : switch ($values[$field]) { case self::CONFIG_PARENT : return __('Inheritance of the parent entity'); case 0 : return __('Never'); } return $values[$field]; case 'send_contracts_alert_before_delay' : case 'send_infocoms_alert_before_delay' : case 'send_licenses_alert_before_delay' : switch ($values[$field]) { case self::CONFIG_PARENT : return __('Inheritance of the parent entity'); case 0 : return __('No'); } return sprintf(_n('%d day', '%d days', $values[$field]), $values[$field]); case 'cartridges_alert_repeat' : case 'consumables_alert_repeat' : switch ($values[$field]) { case self::CONFIG_PARENT : return __('Inheritance of the parent entity'); case self::CONFIG_NEVER : case 0 : // For compatibility issue return __('Never'); case DAY_TIMESTAMP : return __('Each day'); case WEEK_TIMESTAMP : return __('Each week'); case MONTH_TIMESTAMP : return __('Each month'); default : // Display value if not defined return $values[$field]; } break; case 'notclosed_delay' : // 0 means never switch ($values[$field]) { case self::CONFIG_PARENT : return __('Inheritance of the parent entity'); case 0 : return __('Never'); } return sprintf(_n('%d day', '%d days', $values[$field]), $values[$field]); case 'auto_assign_mode' : return self::getAutoAssignMode($values[$field]); case 'tickettype' : if ($values[$field] == self::CONFIG_PARENT) { return __('Inheritance of the parent entity'); } return Ticket::getTicketTypeName($values[$field]); case 'autofill_buy_date' : case 'autofill_order_date' : case 'autofill_delivery_date' : case 'autofill_use_date' : case 'autofill_warranty_date' : switch ($values[$field]) { case self::CONFIG_PARENT : return __('Inheritance of the parent entity'); case Infocom::COPY_WARRANTY_DATE : return __('Copy the start date of warranty'); case Infocom::COPY_BUY_DATE : return __('Copy the date of purchase'); case Infocom::COPY_ORDER_DATE : return __('Copy the order date'); case Infocom::COPY_DELIVERY_DATE : return __('Copy the delivery date'); default : if (strstr($values[$field], '_')) { list($type,$sid) = explode('_', $values[$field], 2); if ($type == Infocom::ON_STATUS_CHANGE) { // TRANS %s is the name of the state return sprintf(__('Fill when shifting to state %s'), Dropdown::getDropdownName('glpi_states', $sid)); } } } return __('No autofill'); case 'inquest_config' : if ($values[$field] == self::CONFIG_PARENT) { return __('Inheritance of the parent entity'); } return TicketSatisfaction::getTypeInquestName($values[$field]); case 'default_contract_alert' : return Contract::getAlertName($values[$field]); case 'default_infocom_alert' : return Infocom::getAlertName($values[$field]); case 'entities_id_software' : if ($values[$field] == self::CONFIG_NEVER) { return __('No change of entity'); } if ($values[$field] == self::CONFIG_PARENT) { return __('Inheritance of the parent entity'); } return Dropdown::getDropdownName('glpi_entities', $values[$field]); case 'tickettemplates_id' : if ($values[$field] == self::CONFIG_PARENT) { return __('Inheritance of the parent entity'); } return Dropdown::getDropdownName('glpi_tickettemplates', $values[$field]); case 'calendars_id' : switch ($values[$field]) { case self::CONFIG_PARENT : return __('Inheritance of the parent entity'); case 0 : return __('24/7'); } return Dropdown::getDropdownName('glpi_calendars', $values[$field]); } return parent::getSpecificValueToDisplay($field, $values, $options); } /** * @since version 0.84 * * @param $field * @param $name (default '') * @param $values (default '') * @param $options array **/ static function getSpecificValueToSelect($field, $name='', $values='', array $options=array()) { global $DB; if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'use_licenses_alert' : case 'use_contracts_alert' : case 'use_infocoms_alert' : $options['name'] = $name; $options['value'] = $values[$field]; return Alert::dropdownYesNo($options); case 'cartridges_alert_repeat' : case 'consumables_alert_repeat' : $options['name'] = $name; $options['value'] = $values[$field]; return Alert::dropdown($options); case 'send_contracts_alert_before_delay' : case 'send_infocoms_alert_before_delay' : case 'send_licenses_alert_before_delay' : $options['unit'] = 'day'; $options['never_string'] = __('No'); return Alert::dropdownIntegerNever($name, $values[$field], $options); case 'use_reservations_alert' : $options['unit'] = 'hour'; return Alert::dropdownIntegerNever($name, $values[$field], $options); case 'notclosed_delay' : $options['unit'] = 'hour'; return Alert::dropdownIntegerNever($name, $values[$field], $options); case 'auto_assign_mode' : $options['name'] = $name; $options['value'] = $values[$field]; return self::dropdownAutoAssignMode($options); case 'tickettype' : $options['value'] = $values[$field]; $options['toadd'] = array(self::CONFIG_PARENT => __('Inheritance of the parent entity')); return Ticket::dropdownType($name, $options); case 'autofill_buy_date' : case 'autofill_order_date' : case 'autofill_delivery_date' : case 'autofill_use_date' : $tab[0] = __('No autofill'); $tab[self::CONFIG_PARENT] = __('Inheritance of the parent entity'); foreach (getAllDatasFromTable('glpi_states') as $state) { $tab[Infocom::ON_STATUS_CHANGE.'_'.$state['id']] //TRANS: %s is the name of the state = sprintf(__('Fill when shifting to state %s'), $state['name']); } $tab[Infocom::COPY_WARRANTY_DATE] = __('Copy the start date of warranty'); if ($field != 'autofill_buy_date') { $tab[Infocom::COPY_BUY_DATE] = __('Copy the date of purchase'); if ($field != 'autofill_order_date') { $tab[Infocom::COPY_ORDER_DATE] = __('Copy the order date'); if ($field != 'autofill_delivery_date') { $options[Infocom::COPY_DELIVERY_DATE] = __('Copy the delivery date'); } } } $options['value'] = $values[$field]; return Dropdown::showFromArray($name, $tab, $options); case 'autofill_warranty_date' : $tab = array(0 => __('No autofill'), Infocom::COPY_BUY_DATE => __('Copy the date of purchase'), Infocom::COPY_ORDER_DATE => __('Copy the order date'), Infocom::COPY_DELIVERY_DATE => __('Copy the delivery date'), self::CONFIG_PARENT => __('Inheritance of the parent entity')); $options['value'] = $values[$field]; return Dropdown::showFromArray($name, $tab, $options); case 'inquest_config' : $typeinquest = array(self::CONFIG_PARENT => __('Inheritance of the parent entity'), 1 => __('Internal survey'), 2 => __('External survey')); $options['value'] = $values[$field]; return Dropdown::showFromArray($name, $typeinquest, $options); case 'default_contract_alert' : $options['name'] = $name; $options['value'] = $values[$field]; return Contract::dropdownAlert($options); case 'default_infocom_alert' : $options['name'] = $name; $options['value'] = $values[$field]; return Infocom::dropdownAlert($options); case 'entities_id_software' : $options['toadd'] = array(self::CONFIG_NEVER => __('No change of entity')); // Keep software in PC entity $options['toadd'][self::CONFIG_PARENT] = __('Inheritance of the parent entity'); return self::dropdown($options); } return parent::getSpecificValueToSelect($field, $name, $values, $options); } } ?> glpi-0.84.3+dfsg.1/inc/entity_knowbaseitem.class.php000066400000000000000000000043441226600447100223000ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Entity_KnowbaseItem /// since version 0.83 class Entity_KnowbaseItem extends CommonDBRelation { // From CommonDBRelation static public $itemtype_1 = 'KnowbaseItem'; static public $items_id_1 = 'knowbaseitems_id'; static public $itemtype_2 = 'Entity'; static public $items_id_2 = 'entities_id'; static public $checkItem_2_Rights = self::DONT_CHECK_ITEM_RIGHTS; static public $logs_for_item_2 = false; /** * Get entities for a knowbaseitem * * @param $knowbaseitems_id ID of the knowbaseitem * * @return array of entities linked to a knowbaseitem **/ static function getEntities($knowbaseitems_id) { global $DB; $ent = array(); $query = "SELECT `glpi_entities_knowbaseitems`.* FROM `glpi_entities_knowbaseitems` WHERE `knowbaseitems_id` = '$knowbaseitems_id'"; foreach ($DB->request($query) as $data) { $ent[$data['entities_id']][] = $data; } return $ent; } } ?>glpi-0.84.3+dfsg.1/inc/entity_reminder.class.php000066400000000000000000000042561226600447100214170ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Entity_Reminder /// @since version 0.83 class Entity_Reminder extends CommonDBRelation { // From CommonDBRelation static public $itemtype_1 = 'Reminder'; static public $items_id_1 = 'reminders_id'; static public $itemtype_2 = 'Entity'; static public $items_id_2 = 'entities_id'; static public $checkItem_2_Rights = self::DONT_CHECK_ITEM_RIGHTS; static public $logs_for_item_2 = false; /** * Get entities for a reminder * * @param $reminders_id ID of the reminder * * @return array of entities linked to a reminder **/ static function getEntities($reminders_id) { global $DB; $ent = array(); $query = "SELECT `glpi_entities_reminders`.* FROM `glpi_entities_reminders` WHERE `reminders_id` = '$reminders_id'"; foreach ($DB->request($query) as $data) { $ent[$data['entities_id']][] = $data; } return $ent; } } ?> glpi-0.84.3+dfsg.1/inc/entity_rssfeed.class.php000066400000000000000000000042401226600447100212360ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Entity_RSSFeed /// @since version 0.84 class Entity_RSSFeed extends CommonDBRelation { // From CommonDBRelation static public $itemtype_1 = 'RSSFeed'; static public $items_id_1 = 'rssfeeds_id'; static public $itemtype_2 = 'Entity'; static public $items_id_2 = 'entities_id'; static public $checkItem_2_Rights = self::DONT_CHECK_ITEM_RIGHTS; static public $logs_for_item_2 = false; /** * Get entities for a rssfeed * * @param $rssfeeds_id ID of the rssfeed * * @return array of entities linked to a rssfeed **/ static function getEntities($rssfeeds_id) { global $DB; $ent = array(); $query = "SELECT `glpi_entities_rssfeeds`.* FROM `glpi_entities_rssfeeds` WHERE `rssfeeds_id` = '$rssfeeds_id'"; foreach ($DB->request($query) as $data) { $ent[$data['entities_id']][] = $data; } return $ent; } } ?> glpi-0.84.3+dfsg.1/inc/event.class.php000066400000000000000000000316211226600447100173330ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // Event class class Event extends CommonDBTM { static function getTypeName($nb=0) { return _n('Log', 'Logs', $nb); } function prepareInputForAdd($input) { global $CFG_GLPI; if (isset($input['level']) && ($input['level'] <= $CFG_GLPI["event_loglevel"])) { return $input; } return false; } /** * Log an event. * * Log the event $event on the glpi_event table with all the others args, if * $level is above or equal to setting from configuration. * * @param $items_id * @param $type * @param $level * @param $service * @param $event **/ static function log($items_id, $type, $level, $service, $event) { $input = array('items_id' => intval($items_id), 'type' => addslashes($type), 'date' => $_SESSION["glpi_currenttime"], 'service' => addslashes($service), 'level' => intval($level), 'message' => addslashes($event)); $tmp = new self(); return $tmp->add($input); } /** * Clean old event - Call by cron * * @param $day integer * * @return integer number of events deleted **/ static function cleanOld($day) { global $DB; $secs = $day * DAY_TIMESTAMP; $query_exp = "DELETE FROM `glpi_events` WHERE UNIX_TIMESTAMP(date) < UNIX_TIMESTAMP()-$secs"; $DB->query($query_exp); return $DB->affected_rows(); } /** * Return arrays for function showEvent et lastEvent **/ static function logArray() { static $logItemtype = array(); static $logService = array(); if (count($logItemtype)) { return array($logItemtype, $logService); } $logItemtype = array('system' => __('System'), 'devices' => _n('Component', 'Components', 2), 'planning' => __('Planning'), 'reservation' => _n('Reservation', 'Reservations', 2), 'dropdown' => _n('Dropdown', 'Dropdowns', 2), 'rules' => _n('Rule', 'Rules', 2)); $logService = array('inventory' => __('Assets'), 'tracking' => _n('Ticket', 'Tickets', 2), 'maintain' => __('Assistance'), 'planning' => __('Planning'), 'tools' => __('Tools'), 'financial' => __('Management'), 'login' => __('Connection'), 'setup' => __('Setup'), 'security' => __('Security'), 'reservation' => _n('Reservation', 'Reservations', 2), 'cron' => _n('Automatic action', 'Automatic actions', 2), 'document' => _n('Document', 'Documents', 2), 'notification' => _n('Notification', 'Notifications',2), 'plugin' => __('Plugins')); return array($logItemtype, $logService); } /** * @param $type * @param $items_id **/ static function displayItemLogID($type, $items_id) { global $CFG_GLPI; if (($items_id == "-1") || ($items_id == "0")) { echo " ";//$item; } else { switch ($type) { case "rules" : echo "".$items_id.""; break; case "infocom" : echo "".$items_id.""; break; case "devices" : echo $items_id; break; case "reservationitem" : echo "".$items_id.""; break; default : $type = getSingular($type); $url = ''; if ($item = getItemForItemtype($type)) { $url = $item->getFormURL(); } if (!empty($url)) { echo "".$items_id.""; } else { echo $items_id; } break; } } } /** * Print a nice tab for last event from inventory section * * Print a great tab to present lasts events occured on glpi * * @param $user string name user to search on message (default '') **/ static function showForUser($user="") { global $DB, $CFG_GLPI; // Show events from $result in table form list($logItemtype, $logService) = self::logArray(); // define default sorting $usersearch = ""; if (!empty($user)) { $usersearch = $user." "; } // Query Database $query = "SELECT * FROM `glpi_events` WHERE `message` LIKE '".$usersearch."%' ORDER BY `date` DESC LIMIT 0,".intval($_SESSION['glpilist_limit']); // Get results $result = $DB->query($query); // Number of results $number = $DB->numrows($result); // No Events in database if ($number < 1) { echo "
"; echo ""; echo "
".__('No Event')."
"; return; } // Output events $i = 0; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; while ($i < $number) { $ID = $DB->result($result, $i, "id"); $items_id = $DB->result($result, $i, "items_id"); $type = $DB->result($result, $i, "type"); $date = $DB->result($result, $i, "date"); $service = $DB->result($result, $i, "service"); $message = $DB->result($result, $i, "message"); $itemtype = " "; if (isset($logItemtype[$type])) { $itemtype = $logItemtype[$type]; } else { $type = getSingular($type); if ($item = getItemForItemtype($type)) { $itemtype = $item->getTypeName(1); } } echo ""; echo ""; echo ""; $i++; } echo "
"; //TRANS: %d is the number of item to display echo "". sprintf(__('Last %d events'), $_SESSION['glpilist_limit']).""; echo "
".__('Source')."".__('Date')."".__('Service')."".__('Message')."
".$itemtype.""; self::displayItemLogID($type, $items_id); echo "".Html::convDateTime($date)."".$logService[$service]."".$message."
"; } /** * Print a nice tab for last event * * Print a great tab to present lasts events occured on glpi * * @param $target where to go when complete * @param $order order by clause occurences (eg: ) (default 'DESC') * @param $sort order by clause occurences (eg: date) (defaut 'date') * @param $start (default 0) **/ static function showList($target, $order='DESC', $sort='date', $start=0) { global $DB, $CFG_GLPI; // Show events from $result in table form list($logItemtype, $logService) = self::logArray(); // Columns of the Table $items = array("items_id" => array(__('Source'), "colspan='2'"), "date" => array(__('Date'), ""), "service" => array(__('Service'), "width='8%'"), "level" => array(__('Level'), "width='8%'"), "message" => array(__('Message'), "width='50%'")); // define default sorting if (!isset($items[$sort])) { $sort = "date"; } if ($order != "ASC") { $order = "DESC"; } // Query Database $query_limit = "SELECT * FROM `glpi_events` ORDER BY `$sort` $order LIMIT ".intval($start).",".intval($_SESSION['glpilist_limit']); // Number of results $numrows = countElementsInTable("glpi_events"); // Get results $result = $DB->query($query_limit); $number = $DB->numrows($result); // No Events in database if ($number < 1) { echo "
".__('No Event')."
"; return; } // Output events $i = 0; echo "
"; $parameters = "sort=$sort&order=$order"; Html::printPager($start, $numrows, $target, $parameters); echo ""; echo ""; foreach ($items as $field => $args) { echo ""; } echo ""; while ($i < $number) { $ID = $DB->result($result, $i, "id"); $items_id = $DB->result($result, $i, "items_id"); $type = $DB->result($result, $i, "type"); $date = $DB->result($result, $i, "date"); $service = $DB->result($result, $i, "service"); $level = $DB->result($result, $i, "level"); $message = $DB->result($result, $i, "message"); $itemtype = " "; if (isset($logItemtype[$type])) { $itemtype = $logItemtype[$type]; } else { $type = getSingular($type); if ($item = getItemForItemtype($type)) { $itemtype = $item->getTypeName(1); } } echo ""; echo ""; echo ""; echo ""; $i++; } echo "
"; if ($sort == $field) { if ($order == "DESC") { echo ""; } else { echo ""; } } echo "".$args[0]. "
$itemtype"; self::displayItemLogID($type, $items_id); echo "".Html::convDateTime($date)."".(isset($logService[$service])?$logService[$service]:$service); echo "".$level."".$message."

"; } /** Display how many logins since * * @return nothing **/ static function getCountLogin() { global $DB; $query = "SELECT COUNT(*) FROM `glpi_events` WHERE `message` LIKE '%logged in%'"; $query2 = "SELECT `date` FROM `glpi_events` ORDER BY `date` ASC LIMIT 1"; $result = $DB->query($query); $result2 = $DB->query($query2); $nb_login = $DB->result($result, 0, 0); $date = $DB->result($result2, 0, 0); // Only for DEMO mode (not need to be translated) printf(_n('%1$s login since %2$s', '%1$s logins since %2$s', $nb_login), ''.$nb_login.'', $date); } } ?> glpi-0.84.3+dfsg.1/inc/fieldblacklist.class.php000077500000000000000000000333131226600447100211710ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Fieldblacklist class Fieldblacklist extends CommonDropdown { static function getTypeName($nb=0) { return _n('Ignored value for the unicity', 'Ignored values for the unicity', $nb); } static function canCreate() { return Session::haveRight('config', 'w'); } static function canView() { return Session::haveRight('config', 'r'); } function getAdditionalFields() { return array(array('name' => 'itemtype', 'label' => __('Type'), 'type' => 'blacklist_itemtype'), array('name' => 'field', 'label' => _n('Field', 'Fields', 1), 'type' => 'blacklist_field'), array('name' => 'value', 'label' => __('Value'), 'type' => 'blacklist_value')); } /** * Get search function for the class * * @return array of search option **/ function getSearchOptions() { $tab = parent::getSearchOptions(); $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'itemtype'; $tab[4]['name'] = __('Type'); $tab[4]['massiveaction'] = false; $tab[4]['datatype'] = 'itemtypename'; $tab[4]['forcegroupby'] = true; $tab[6]['table'] = $this->getTable(); $tab[6]['field'] = 'field'; $tab[6]['name'] = _n('Field', 'Fields', 1); $tab[6]['massiveaction'] = false; $tab[6]['datatype'] = 'specific'; $tab[6]['additionalfields'] = array('itemtype'); $tab[7]['table'] = $this->getTable(); $tab[7]['field'] = 'value'; $tab[7]['name'] = __('Value'); // Is also specific $tab[7]['datatype'] = 'specific'; $tab[7]['additionalfields'] = array('itemtype', 'field'); $tab[7]['massiveaction'] = false; return $tab; } static function getSpecificValueToDisplay($field, $values, array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } switch ($field) { case 'field': if (isset($values['itemtype']) && !empty($values['itemtype'])) { $target = getItemForItemtype($values['itemtype']); $searchOption = $target->getSearchOptionByField('field', $values[$field]); // if (empty($searchOption)) { // if ($table = getTableNameForForeignKeyField($values[$field])) { // $searchOption = $target->getSearchOptionByField('field', 'name', $table); // } // echo $table.'--'; // } return $searchOption['name']; } break; case 'value' : if (isset($values['itemtype']) && !empty($values['itemtype'])) { $target = getItemForItemtype($values['itemtype']); if (isset($values['field']) && !empty($values['field'])) { $searchOption = $target->getSearchOptionByField('field', $values['field']); // MoYo : do not know why this part ? // if ($table = getTableNameForForeignKeyField($values['field'])) { // $searchOption = $target->getSearchOptionByField('field', 'name', $table); // } return $target->getValueToDisplay($searchOption, $values[$field]); } } break; } return parent::getSpecificValueToDisplay($field, $values, $options); } /** * @since version 0.84 * * @param $field * @param $name (default '') * @param $values (default '') * @param $options array **/ static function getSpecificValueToSelect($field, $name='', $values='', array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'field' : if (isset($values['itemtype']) && !empty($values['itemtype'])) { $options['value'] = $values[$field]; $options['name'] = $name; return self::dropdownField($values['itemtype'], $options); } break; case 'value' : if (isset($values['itemtype']) && !empty($values['itemtype'])) { if ($item = getItemForItemtype($values['itemtype'])) { if (isset($values['field']) && !empty($values['field'])) { $searchOption = $item->getSearchOptionByField('field', $values['field']); return $item->getValueToSelect($searchOption, $name, $values[$field], $options); } } } break; } return parent::getSpecificValueToSelect($field, $name, $values, $options); } /** * @see CommonDBTM::prepareInputForAdd() **/ function prepareInputForAdd($input) { $input = parent::prepareInputForAdd($input); return $input; } /** * @see CommonDBTM::prepareInputForUpdate() **/ function prepareInputForUpdate($input) { $input = parent::prepareInputForUpdate($input); return $input; } /** * Display specific fields for FieldUnicity * * @param $ID * @param $field array **/ function displaySpecificTypeField($ID, $field=array()) { switch ($field['type']) { case 'blacklist_itemtype' : $this->showItemtype(); break; case 'blacklist_field' : $this->selectCriterias(); break; case 'blacklist_value' : $this->selectValues(); break; } } /** * Display a dropdown which contains all the available itemtypes * * @return nothing **/ function showItemtype() { global $CFG_GLPI; if ($this->fields['id'] > 0) { if ($item = getItemForItemtype($this->fields['itemtype'])) { echo $item->getTypeName(1); } echo ""; } else { //Add criteria : display dropdown $options[0] = Dropdown::EMPTY_VALUE; foreach ($CFG_GLPI['unicity_types'] as $itemtype) { if ($item = getItemForItemtype($itemtype)) { if ($item->can(-1,'r')) { $options[$itemtype] = $item->getTypeName(1); } } } asort($options); $rand = Dropdown::showFromArray('itemtype', $options, array('value' => $this->fields['value'])); $params = array('itemtype' => '__VALUE__', 'id' => $this->fields['id']); Ajax::updateItemOnSelectEvent("dropdown_itemtype$rand", "span_fields", $CFG_GLPI["root_doc"]."/ajax/dropdownFieldsBlacklist.php", $params); } } function selectCriterias() { global $CFG_GLPI; echo ""; if (!isset($this->fields['itemtype']) || !$this->fields['itemtype']) { echo ""; return; } if (!isset($this->fields['entities_id'])) { $this->fields['entities_id'] = $_SESSION['glpiactive_entity']; } if ($rand = self::dropdownField($this->fields['itemtype'], array('value' => $this->fields['field']))) { $params = array('itemtype' => $this->fields['itemtype'], 'id_field' => '__VALUE__', 'id' => $this->fields['id']); Ajax::updateItemOnSelectEvent("dropdown_field$rand", "span_values", $CFG_GLPI["root_doc"]."/ajax/dropdownValuesBlacklist.php", $params); } echo "
"; } /** Dropdown fields for a specific itemtype * * @since version 0.84 * * @param $itemtype itemtype * @param $options array of options **/ static function dropdownField($itemtype, $options=array()) { global $DB; $p['name'] = 'field'; $p['display'] = true; $p['value'] = ''; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } if ($target = getItemForItemtype($itemtype)) { $criteria = array(); foreach ($DB->list_fields($target->getTable()) as $field) { $searchOption = $target->getSearchOptionByField('field', $field['Field']); // MoYo : do not know why this part ? // if (empty($searchOption)) { // if ($table = getTableNameForForeignKeyField($field['Field'])) { // $searchOption = $target->getSearchOptionByField('field', 'name', $table); // } // } if (!empty($searchOption) && !in_array($field['Type'], $target->getUnallowedFieldsForUnicity()) && !in_array($field['Field'], $target->getUnallowedFieldsForUnicity())) { $criteria[$field['Field']] = $searchOption['name']; } } return Dropdown::showFromArray($p['name'], $criteria, $p); } return false; } /** * @param $field (default '') **/ function selectValues($field='') { global $DB, $CFG_GLPI; if ($field == '') { $field = $this->fields['field']; } echo ""; if ($this->fields['itemtype'] != '') { if ($item = getItemForItemtype($this->fields['itemtype'])) { $searchOption = $item->getSearchOptionByField('field', $field); $options = array(); if (isset($this->fields['entity'])) { $options['entity'] = $this->fields['entity']; $options['entity_sons'] = $this->fields['is_recursive']; } echo $item->getValueToSelect($searchOption, 'value', $this->fields['value'], $options); // if (isset($searchOption['linkfield'])) { // $linkfield = $searchOption['linkfield']; // } else { // $linkfield = $searchOption['field']; // } // // if ($linkfield == $this->fields['field']) { // $value = $this->fields['value']; // } else { // $value = ''; // } } // //If field is a foreign key on another table or not // $table = getTableNameForForeignKeyField($linkfield); // if ($table == '') { // if (isset($searchOption['datatype'])) { // $datatype = $searchOption['datatype']; // } else { // $datatype = 'text'; // } // // switch ($datatype) { // case 'text' : // case 'string' : // default : // Html::autocompletionTextField($this, 'value', array('value' => $value)); // break; // // case 'bool': // Dropdown::showYesNo('value',$value); // break; // } // // } else { // $itemtype = getItemTypeForTable($table); // Dropdown::show($itemtype, array('name' => 'value', // 'value' => $value)); // } } echo ""; } /** * Check if a field & value are blacklisted or not * * @param itemtype itemtype of the blacklisted field * @param entities_id the entity in which the field must be saved * @param field the field to check * @param value the field's value * * @return true is value if blacklisted, false otherwise **/ static function isFieldBlacklisted($itemtype, $entities_id, $field, $value) { global $DB; $query = "SELECT COUNT(*) AS cpt FROM `glpi_fieldblacklists` WHERE `itemtype` = '$itemtype' AND `field` = '$field' AND `value` = '$value'". getEntitiesRestrictRequest(" AND", "glpi_fieldblacklists", "entities_id", $entities_id, true); return ($DB->result($DB->query($query), 0, 'cpt') ?true :false); } } ?>glpi-0.84.3+dfsg.1/inc/fieldunicity.class.php000077500000000000000000000446701226600447100207150ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class FieldUnicity class FieldUnicity extends CommonDropdown { // From CommonDBTM public $dohistory = true; var $second_level_menu = "control"; static function getTypeName($nb=0) { return __('Fields unicity'); } static function canCreate() { return Session::haveRight('config', 'w'); } static function canView() { return Session::haveRight('config', 'r'); } function getAdditionalFields() { return array(array('name' => 'is_active', 'label' => __('Active'), 'type' => 'bool'), array('name' => 'itemtype', 'label' => __('Type'), 'type' => 'unicity_itemtype'), array('name' => 'fields', 'label' => __('Unique fields'), 'type' => 'unicity_fields'), array('name' => 'action_refuse', 'label' => __('Record into the database denied'), 'type' => 'bool'), array('name' => 'action_notify', 'label' => __('Send a notification'), 'type' => 'bool')); } /** * Define tabs to display * * @param $options array **/ function defineTabs($options=array()) { $ong = array(); $ong['empty'] = $this->getTypeName(1); $this->addStandardTab($this->getType(), $ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { if ($item->getType() == $this->getType()) { return __('Duplicates'); } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType()==__CLASS__) { self::showDoubles($item); } return true; } /** * Display specific fields for FieldUnicity * * @param $ID * @param $field array **/ function displaySpecificTypeField($ID, $field=array()) { switch ($field['type']) { case 'unicity_itemtype' : $this->showItemtype($ID, $this->fields['itemtype']); break; case 'unicity_fields' : self::selectCriterias($this); break; } } /** * Display a dropdown which contains all the available itemtypes * * @param ID the field unicity item id * @param value the selected value (default 0) * * @return nothing **/ function showItemtype($ID, $value=0) { global $CFG_GLPI; //Criteria already added : only display the selected itemtype if ($ID > 0) { if ($item = getItemForItemtype($this->fields['itemtype'])) { echo $item->getTypeName().'--'; } echo "canCreate()) { $options[$itemtype] = $item->getTypeName(1); } } } asort($options); // print_r($options); $rand = Dropdown::showFromArray('itemtype', $options); $params = array('itemtype' => '__VALUE__', 'id' => $ID); Ajax::updateItemOnSelectEvent("dropdown_itemtype$rand", "span_fields", $CFG_GLPI["root_doc"]."/ajax/dropdownUnicityFields.php", $params); } } /** * Return criteria unicity for an itemtype, in an entity * * @param itemtype the itemtype for which unicity must be checked * @param entities_id the entity for which configuration must be retrivied (default 0) * @param $check_active (true by default) * * @return an array of fields to check, or an empty array if no **/ public static function getUnicityFieldsConfig($itemtype, $entities_id=0, $check_active=true) { global $DB; //Get the first active configuration for this itemtype $query = "SELECT * FROM `glpi_fieldunicities` WHERE `itemtype` = '$itemtype' ". getEntitiesRestrictRequest("AND", 'glpi_fieldunicities', "", $entities_id, true); if ($check_active) { $query .= " AND `is_active` = '1' "; } $query .= "ORDER BY `entities_id` DESC"; $current_entity = false; $return = array(); foreach ($DB->request($query) as $data) { //First row processed if (!$current_entity) { $current_entity = $data['entities_id']; } //Process only for one entity, not more if ($current_entity != $data['entities_id']) { break; } $return[] = $data; } return $return; } /** * Display a list of available fields for unicity checks * * @param $unicity an instance of CommonDBTM class * * @return nothing **/ static function selectCriterias(CommonDBTM $unicity) { global $DB; echo ""; if (!isset($unicity->fields['itemtype']) || !$unicity->fields['itemtype']) { echo ""; return; } if (!isset($unicity->fields['entities_id'])) { $unicity->fields['entities_id'] = $_SESSION['glpiactive_entity']; } $unicity_fields = explode(',', $unicity->fields['fields']); echo ""; self::dropdownFields($unicity->fields['itemtype'], array('values' => $unicity_fields, 'name' => '_fields')); echo ""; } /** Dropdown fields for a specific itemtype * * @since version 0.84 * * @param $itemtype itemtype * @param $options array of options **/ static function dropdownFields($itemtype, $options=array()) { global $DB; $p['name'] = 'fields'; $p['display'] = true; $p['values'] = array(); if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } //Search option for this type if ($target = getItemForItemtype($itemtype)) { //Do not check unicity on fields in DB with theses types $blacklisted_types = array('longtext', 'text'); //Construct list $values = array(); foreach ($DB->list_fields(getTableForItemType($itemtype)) as $field) { $searchOption = $target->getSearchOptionByField('field', $field['Field']); // if (empty($searchOption)) { // if ($table = getTableNameForForeignKeyField($field['Field'])) { // $searchOption = $target->getSearchOptionByField('field', 'name', $table); // } // } if (!empty($searchOption) && !in_array($field['Type'], $blacklisted_types) && !in_array($field['Field'], $target->getUnallowedFieldsForUnicity())) { $values[$field['Field']] = $searchOption['name']; } } $p['multiple'] = true; $p['size'] = 15; return Dropdown::showFromArray($p['name'], $values, $p); } return false; } function getSearchOptions() { $tab = array(); $tab['common'] = self::getTypeName(); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['datatype'] = 'number'; $tab[2]['massiveaction'] = false; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'fields'; $tab[3]['name'] = __('Unique fields'); $tab[3]['massiveaction'] = false; $tab[3]['datatype'] = 'specific'; $tab[3]['additionalfields'] = array('itemtype'); $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'itemtype'; $tab[4]['name'] = __('Type'); $tab[4]['massiveaction'] = false; $tab[4]['datatype'] = 'itemtypename'; $tab[4]['itemtype_list'] = 'unicity_types'; $tab[5]['table'] = $this->getTable(); $tab[5]['field'] = 'action_refuse'; $tab[5]['name'] = __('Record into the database denied'); $tab[5]['datatype'] = 'bool'; $tab[6]['table'] = $this->getTable(); $tab[6]['field'] = 'action_notify'; $tab[6]['name'] = __('Send a notification'); $tab[6]['datatype'] = 'bool'; $tab[86]['table'] = $this->getTable(); $tab[86]['field'] = 'is_recursive'; $tab[86]['name'] = __('Child entities'); $tab[86]['datatype'] = 'bool'; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab[30]['table'] = $this->getTable(); $tab[30]['field'] = 'is_active'; $tab[30]['name'] = __('Active'); $tab[30]['datatype'] = 'bool'; $tab[30]['massiveaction'] = false; $tab[80]['table'] = 'glpi_entities'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = __('Entity'); $tab[80]['datatype'] = 'dropdown'; return $tab; } /** * @since version 0.84 * * @param $field * @param $values * @param $options array **/ static function getSpecificValueToDisplay($field, $values, array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } switch ($field) { case 'fields': if (isset($values['itemtype']) && !empty($values['itemtype'])) { if ($target = getItemForItemtype($values['itemtype'])) { $searchOption = $target->getSearchOptionByField('field', $values[$field]); $fields = explode(',', $values[$field]); $message = array(); foreach ($fields as $field) { $searchOption = $target->getSearchOptionByField('field',$field); if (isset($searchOption['name'])) { $message[] = $searchOption['name']; } } return implode(', ',$message); } } break; } return parent::getSpecificValueToDisplay($field, $values, $options); } /** * @since version 0.84 * * @param $field * @param $name (default '') * @param $values (default '') * @param $options array **/ static function getSpecificValueToSelect($field, $name='', $values='', array $options=array()) { global $DB; if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'fields' : if (isset($values['itemtype']) && !empty($values['itemtype'])) { $options['values'] = explode(',', $values[$field]); $options['name'] = $name; return self::dropdownFields($values['itemtype'], $options); } break; } return parent::getSpecificValueToSelect($field, $name, $values, $options); } /** * Perform checks to be sure that an itemtype and at least a field are selected * * @param input the values to insert in DB * * @return input the values to insert, but modified **/ static function checkBeforeInsert($input) { if (!$input['itemtype'] || empty($input['_fields'])) { Session::addMessageAfterRedirect(__("It's mandatory to select a type and at least one field"), true, ERROR); $input = array(); } else { $input['fields'] = implode(',',$input['_fields']); unset($input['_fields']); } return $input; } function prepareInputForAdd($input) { return self::checkBeforeInsert($input); } function prepareInputForUpdate($input) { $input['fields'] = implode(',',$input['_fields']); unset($input['_fields']); return $input; } /** * Delete all criterias for an itemtype * * @param itemtype * * @return nothing **/ static function deleteForItemtype($itemtype) { global $DB; $query = "DELETE FROM `glpi_fieldunicities` WHERE `itemtype` LIKE '%Plugin$itemtype%'"; $DB->query($query); } /** * List doubles * * @param $unicity an instance of FieldUnicity class **/ static function showDoubles(FieldUnicity $unicity) { global $DB; $fields = array(); $where_fields = array(); if (!$item = getItemForItemtype($unicity->fields['itemtype'])) { return; } foreach (explode(',',$unicity->fields['fields']) as $field) { $fields[] = $field; $where_fields[] = $field; } if (!empty($fields)) { $colspan = count($fields) + 1; echo ""; echo ""; $entities = array($unicity->fields['entities_id']); if ($unicity->fields['is_recursive']) { $entities = getSonsOf('glpi_entities', $unicity->fields['entities_id']); } $fields_string = implode(',', $fields); if ($item->maybeTemplate()) { $where_template = " AND `".$item->getTable()."`.`is_template` = '0'"; } else { $where_template = ""; } $where_fields_string = ""; foreach ($where_fields as $where_field) { if (getTableNameForForeignKeyField($where_field)) { $where_fields_string.= " AND `$where_field` IS NOT NULL AND `$where_field` <> '0'"; } else { $where_fields_string.= " AND `$where_field` IS NOT NULL AND `$where_field` <> ''"; } } $query = "SELECT $fields_string, COUNT(*) AS cpt FROM `".$item->getTable()."` WHERE `".$item->getTable()."`.`entities_id` IN (".implode(',',$entities).") $where_template $where_fields_string GROUP BY $fields_string ORDER BY cpt DESC"; $results = array(); foreach ($DB->request($query) as $data) { if ($data['cpt'] > 1) { $results[] = $data; } } if (empty($results)) { echo ""; echo ""; } else { echo ""; foreach ($fields as $field) { $searchOption = $item->getSearchOptionByField('field',$field); echo ""; } echo ""; foreach ($results as $result) { echo ""; foreach ($fields as $field) { $table = getTableNameForForeignKeyField($field); if ($table != '') { echo ""; } else { echo ""; } } echo ""; } } } else { echo ""; echo ""; } echo "
".__('Duplicates')."
".__('No item to display')."
".$searchOption["name"].""._x('quantity', 'Number')."
".Dropdown::getDropdownName($table, $result[$field])."".$result[$field]."".$result['cpt']."
".__('No item to display')."
"; } /** * Display debug information for current object **/ function showDebug() { $params = array('message' => '', 'action_type' => true, 'action_user' => getUserName(Session::getLoginUserID()), 'entities_id' => $_SESSION['glpiactive_entity'], 'itemtype' => get_class($this), 'date' => $_SESSION['glpi_currenttime'], 'refuse' => true); NotificationEvent::debugEvent($this, $params); } } ?>glpi-0.84.3+dfsg.1/inc/filesystem.class.php000066400000000000000000000025521226600447100203770ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Filesystem class Filesystem extends CommonDropdown { static function getTypeName($nb=0) { return _n('File system', 'File systems', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/fqdn.class.php000066400000000000000000000137211226600447100171430ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class FQDN : Fully Qualified Domain Name /// since version 0.84 class FQDN extends CommonDropdown { public $dohistory = true; static function canCreate() { return Session::haveRight('internet', 'w'); } static function canView() { return Session::haveRight('internet', 'r'); } static function getTypeName($nb=0) { return _n('Internet domain', 'Internet domains', $nb); } function getAdditionalFields() { return array(array('name' => 'fqdn', 'label' => __('FQDN'), 'type' => 'text', 'comment' => __('Fully Qualified Domain Name. Use the classical notation (labels separated by dots). For example: indepnet.net'), 'list' => true)); } /** * \brief Prepare the input before adding or updating * Checking suppose that each FQDN is compose of dot separated array of labels and its unique * \see (FQDNLabel) * * @param $input fields of the record to check * * @return false or fields checks and update (lowercase for the fqdn field) **/ function prepareInput($input) { if (isset($input['fqdn']) || $this->isNewID($this->getID())) { // Check that FQDN is not empty if (empty($input['fqdn'])) { Session::addMessageAfterRedirect(__('FQDN must not be empty'), false, ERROR); return false; } // Transform it to lower case $input["fqdn"] = strtolower($input['fqdn']); // Then check its validity if (!self::checkFQDN($input["fqdn"])) { Session::addMessageAfterRedirect(__('FQDN is not valid'), false, ERROR); return false; } } return $input; } function prepareInputForAdd($input) { return $this->prepareInput(parent::prepareInputForAdd($input)); } function prepareInputForUpdate($input) { return $this->prepareInput(parent::prepareInputForUpdate($input)); } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('NetworkName', $ong, $options); $this->addStandardTab('NetworkAlias', $ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } /** * @return the FQDN of the element, or "" if invalid FQDN **/ function getFQDN() { if ($this->can($this->getID(), 'r')) { return $this->fields["fqdn"]; } return ""; } /** * Search FQDN id from string FDQDN * * @param $fqdn string value of the fdqn (for instance : indeptnet.net) * @param $wildcard_search boolean true if we search with wildcard (false by default) * * @return if $wildcard_search == false : the id of the fqdn, -1 if not found or several answers * if $wildcard_search == true : an array of the id of the fqdn **/ static function getFQDNIDByFQDN($fqdn, $wildcard_search=false) { global $DB; if (empty($fqdn)) { return 0; } $fqdn = strtolower($fqdn); if ($wildcard_search) { $count = 0; $fqdn = str_replace('*', '%', $fqdn, $count); if ($count == 0) { $fqdn = '%'.$fqdn.'%'; } $relation = "LIKE '$fqdn'"; } else { $relation = "= '$fqdn'"; } $query = "SELECT `id` FROM `glpi_fqdns` WHERE `fqdn` $relation "; $fqdns_id_list = array(); foreach ($DB->request($query) as $line) { $fqdns_id_list[] = $line['id']; } if (!$wildcard_search) { if (count($fqdns_id_list) != 1) { return -1; } return $fqdns_id_list[0]; } return $fqdns_id_list; } /** * @param $ID id of the FQDN * * @return the FQDN of the element, or "" if invalid FQDN **/ static function getFQDNFromID($ID) { $thisDomain = new self(); if ($thisDomain->getFromDB($ID)) { return $thisDomain->getFQDN(); } return ""; } function getSearchOptions() { $tab = parent::getSearchOptions(); $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'fqdn'; $tab[11]['name'] = __('FQDN'); $tab[11]['datatype'] = 'string'; return $tab; } /** * Check FQDN Validity * * @param $fqdn the FQDN to check * * @return true if the FQDN is valid **/ static function checkFQDN($fqdn) { // The FQDN must be compose of several labels separated by dots '.' $labels = explode("." , $fqdn); foreach ($labels as $label) { if (($label == "") || (!FQDNLabel::checkFQDNLabel($label))) { return false; } } return true; } } ?> glpi-0.84.3+dfsg.1/inc/fqdnlabel.class.php000066400000000000000000000171151226600447100201440ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief Create an abstration layer for any kind of internet label */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class FQDNLabel - any kind of internet label (computer name as well as alias) /// Since version 0.84 abstract class FQDNLabel extends CommonDBChild { // Inherits from CommonDBChild as it must be attached to a specific element // (NetworkName, NetworkPort, ...) function getInternetName() { // get the full computer name of the current object (for instance : forge.indepnet.net) return self::getInternetNameFromLabelAndDomainID($this->fields["name"], $this->fields["fqdns_id"]); } /** * Get the internet name from a label and a domain ID * * @param $label string the label of the computer or its alias * @param $domain integer id of the domain that owns the item * * @return result the full internet name **/ static function getInternetNameFromLabelAndDomainID($label, $domain) { $domainName = FQDN::getFQDNFromID($domain); if (!empty($domainName)) { return $label.".".$domainName; } return $label; } /** * \brief Check FQDN label * Check a label regarding section 2.1 of RFC 1123 : 63 lengths and no other characters * than alphanumerics. Minus ('-') is allowed if it is not at the end or begin of the lable. * * @param $label the label to check **/ static function checkFQDNLabel($label) { if (strlen($label) >= 63) { return false; } if (strlen($label) == 1) { if (!preg_match("/^[0-9A-Za-z]$/", $label, $regs)) { return false; } } else if (!preg_match("/^[0-9A-Za-z][0-9A-Za-z\-]*[0-9A-Za-z]+$/", $label, $regs)) { return false; } return true; } /** * @param $input **/ function prepareLabelInput($input) { if (isset($input['name']) && !empty($input['name'])) { // Empty names are allowed $input['name'] = strtolower($input['name']); // Before adding a name, we must unsure its is valid : it conforms to RFC if (!self::checkFQDNLabel($input['name'])) { Session::addMessageAfterRedirect(sprintf(__('Invalid internet name: %s'), $input['name']), false, ERROR); return false; } } return $input; } function prepareInputForAdd($input) { return parent::prepareInputForAdd($this->prepareLabelInput($input)); } function prepareInputForUpdate($input) { return parent::prepareInputForUpdate($this->prepareLabelInput($input)); } /** * Get all label IDs corresponding to given string label and FQDN ID * * @param $label string label to search for * @param $fqdns_id integer the id of the FQDN that owns the label * @param $wildcard_search boolean true if we search with wildcard (false by default) * * @return array two arrays (NetworkName and NetworkAlias) of the IDs **/ static function getIDsByLabelAndFQDNID($label, $fqdns_id, $wildcard_search=false) { global $DB; $label = strtolower($label); if ($wildcard_search) { $count = 0; $label = str_replace('*', '%', $label, $count); if ($count == 0) { $label = '%'.$label.'%'; } $relation = "LIKE '$label'"; } else { $relation = "= '$label'"; } $IDs = array(); foreach (array('NetworkName' => 'glpi_networknames', 'NetworkAlias' => 'glpi_networkaliases') as $class => $table) { $query = "SELECT `id` FROM `$table` WHERE `name` $relation "; if ((is_array($fqdns_id)) && (count($fqdns_id) > 0)) { $query .= " AND `fqdns_id` IN ('". implode('\', \'', $fqdns_id). "')"; } else if ((is_int($fqdns_id)) && ($fqdns_id > 0)) { $query .= " AND `fqdns_id` = '$fqdns_id'"; } foreach ($DB->request($query) as $element) { $IDs[$class][] = $element['id']; } } return $IDs; } /** * Look for "computer name" inside all databases * * @param $fqdn name to search (for instance : forge.indepnet.net) * @param $wildcard_search boolean true if we search with wildcard (false by default) * * @return (array) each value of the array (corresponding to one NetworkPort) is an array of the * items from the master item to the NetworkPort **/ static function getItemsByFQDN($fqdn, $wildcard_search=false) { $FQNDs_with_Items = array(); if (!$wildcard_search) { if (!FQDN::checkFQDN($fqdn)) { return array(); } } $position = strpos($fqdn, "."); if ($position !== false) { $label = strtolower(substr( $fqdn, 0, $position)); $fqdns_id = FQDN::getFQDNIDByFQDN(substr( $fqdn, $position + 1), $wildcard_search); } else { $label = $fqdn; $fqdns_id = -1; } foreach (self::getIDsByLabelAndFQDNID($label, $fqdns_id, $wildcard_search) as $class => $IDs) { if ($FQDNlabel = getItemForItemtype($class)) { foreach ($IDs as $ID) { if ($FQDNlabel->getFromDB($ID)) { $FQNDs_with_Items[] = array_merge(array_reverse($FQDNlabel->recursivelyGetItems()), array(clone $FQDNlabel)); } } } } return $FQNDs_with_Items; } /** * Get an Object ID by its name (only if one result is found in the entity) * * @param $value the name * @param $entity the entity to look for * * @return an array containing the object ID * or an empty array is no value of serverals ID where found **/ static function getUniqueItemByFQDN($value, $entity) { $labels_with_items = self::getItemsByFQDN($value); if (count($labels_with_items) == 1) { $label_with_items = $labels_with_items[0]; $item = $label_with_items[0]; if ($item->getEntityID() == $entity) { $result = array("id" => $item->getID(), "itemtype" => $item->getType()); unset($labels_with_items); return $result; } } return array(); } } ?> glpi-0.84.3+dfsg.1/inc/graphpalette.class.php000066400000000000000000000050051226600447100206670ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /** * Light color pallet for ezcGraph based on GLPI-project style guidelines at * http://glpi-project.org * **/ class GraphPalette extends ezcGraphPalette { /** * Axiscolor * * ezcGraphColor **/ protected $axisColor = '#e4b22b'; /** * Color of grid lines * * ezcGraphColor **/ protected $majorGridColor = '#D3D7DF'; /** * Array with colors for datasets * * array **/ protected $dataSetColor = array('#3465A4', '#4E9A06', '#CC0000', '#EDD400', '#75505B', '#F57900', '#204A87', '#C17D11'); /** * Array with symbols for datasets * * array **/ protected $dataSetSymbol = array(ezcGraph::BULLET); /** * Name of font to use * * string **/ protected $fontName = 'sans-serif'; /** * Fontcolor * * ezcGraphColor **/ protected $fontColor = '#2E3436'; /** * Backgroundcolor for chart * * ezcGraphColor **/ protected $chartBackground = '#FFFFFF'; /** * Padding in elements * * integer **/ protected $padding = 1; /** * Margin of elements * * integer **/ protected $margin = 0; } ?> glpi-0.84.3+dfsg.1/inc/group.class.php000066400000000000000000000615251226600447100173540ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Group class **/ class Group extends CommonTreeDropdown { public $dohistory = true; static function getTypeName($nb=0) { return _n('Group', 'Groups', $nb); } static function canCreate() { return Session::haveRight('group', 'w'); } static function canView() { return Session::haveRight('group', 'r'); } function post_getEmpty () { $this->fields['is_requester'] = 1; $this->fields['is_assign'] = 1; $this->fields['is_notify'] = 1; $this->fields['is_itemgroup'] = 1; $this->fields['is_usergroup'] = 1; } function cleanDBonPurge() { global $DB; $gu = new Group_User(); $gu->cleanDBonItemDelete($this->getType(), $this->fields['id']); $gt = new Group_Ticket(); $gt->cleanDBonItemDelete($this->getType(), $this->fields['id']); $gp = new Group_Problem(); $gp->cleanDBonItemDelete($this->getType(), $this->fields['id']); $gki = new Group_KnowbaseItem(); $gki->cleanDBonItemDelete($this->getType(), $this->fields['id']); $gr = new Group_Reminder(); $gr->cleanDBonItemDelete($this->getType(), $this->fields['id']); // Ticket rules use various _groups_id_* Rule::cleanForItemAction($this, '_groups_id%'); Rule::cleanForItemCriteria($this, '_groups_id%'); // GROUPS for RuleMailcollector Rule::cleanForItemCriteria($this, 'GROUPS'); // Set no group to consumables $query = "UPDATE `glpi_consumables` SET `items_id` = '0' WHERE `items_id` = '".$this->fields['id']."' AND `itemtype` = 'Group'"; $DB->query($query); } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate && Session::haveRight("group","r")) { switch ($item->getType()) { case 'Group' : $ong = array(); $nb = 0; if ($_SESSION['glpishow_count_on_tabs']) { $nb = countElementsInTable($this->getTable(), "`groups_id` = '".$item->getID()."'"); } $ong[4] = self::createTabEntry($this->getTypeName(2), $nb); if ($item->getField('is_itemgroup')) { $ong[1] = __('Used items'); } if ($item->getField('is_assign')) { $ong[2] = __('Managed items'); } if ($item->getField('is_usergroup') && Session::haveRight("group", "w") && Session::haveRight("user_authtype", "w") && AuthLdap::useAuthLdap()) { $ong[3] = __('LDAP directory link'); } return $ong; } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($item->getType()) { case 'Group' : switch ($tabnum) { case 1 : $item->showItems(false); return true; case 2 : $item->showItems(true); return true; case 3 : $item->showLDAPForm($item->getID()); return true; case 4 : $item->showChildren(); return true; } break; } return false; } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('Group', $ong, $options); if ($this->fields['is_usergroup']) { $this->addStandardTab('Group_User', $ong, $options); } if ($this->fields['is_notify']) { $this->addStandardTab('NotificationTarget', $ong, $options); } if ($this->fields['is_requester']) { $this->addStandardTab('Ticket', $ong, $options); } $this->addStandardTab('Log',$ong, $options); return $ong; } /** * Print the group form * * @param $ID integer ID of the item * @param $options array * - target filename : where to go when done. * - withtemplate boolean : template or basic item * * @return Nothing (display) **/ function showForm($ID, $options=array()) { $this->initForm($ID, $options); $this->showTabs($options); $options['colspan'] = 4; $this->showFormHeader($options); echo ""; echo "".__('Name').""; echo ""; Html::autocompletionTextField($this, "name"); echo ""; echo "".__('Comments').""; echo ""; echo ""; echo ""; echo ""; echo "".__('As child of').""; self::dropdown(array('value' => $this->fields['groups_id'], 'name' => 'groups_id', 'entity' => $this->fields['entities_id'], 'used' => (($ID > 0) ? getSonsOf($this->getTable(), $ID) : array()))); echo ""; echo ""; echo "".__('Visible in a ticket').""; echo ""; echo " "; echo "".__('Requester').""; echo ""; Dropdown::showYesNo('is_requester', $this->fields['is_requester']); echo ""; echo "".__('Assigned to')."     "; Dropdown::showYesNo('is_assign', $this->fields['is_assign']); echo ""; echo ""; echo "".__('Can be notified').""; echo ""; Dropdown::showYesNo('is_notify', $this->fields['is_notify']); echo ""; echo ""; echo "".__('Can contain').""; echo ""; echo " "; echo ""._n('Item', 'Items', 2).""; echo ""; Dropdown::showYesNo('is_itemgroup', $this->fields['is_itemgroup']); echo ""; echo ""._n('User', 'Users', 2)."   "; Dropdown::showYesNo('is_usergroup', $this->fields['is_usergroup']); echo ""; echo ""; echo ""; if (!$ID) { //TRANS: %s is the datetime of insertion printf(__('Created on %s'), Html::convDateTime($_SESSION["glpi_currenttime"])); } else { //TRANS: %s is the datetime of update printf(__('Last update on %s'), Html::convDateTime($this->fields["date_mod"])); } echo ""; $this->showFormButtons($options); $this->addDivForTabs(); return true; } /** * Print a good title for group pages * *@return nothing (display) **/ function title() { global $CFG_GLPI; $buttons = array(); if (Session::haveRight("group", "w") && Session::haveRight("user_authtype", "w") && AuthLdap::useAuthLdap()) { $buttons["ldap.group.php"] = __('LDAP directory link'); $title = ""; } else { $title = self::getTypeName(2); } Html::displayTitle($CFG_GLPI["root_doc"] . "/pics/groupes.png", self::getTypeName(2), $title, $buttons); } /** * @see CommonDBTM::getSpecificMassiveActions() **/ function getSpecificMassiveActions($checkitem=NULL) { $isadmin = static::canUpdate(); $actions = parent::getSpecificMassiveActions($checkitem); if ($isadmin) { $actions['add_user_group'] = _x('button', 'Add a user'); $actions['add_supervisor_group'] = _x('button', 'Add a supervisor'); $actions['add_delegatee_group'] = _x('button', 'Add a delegatee'); } if (Session::haveRight('transfer','r') && Session::isMultiEntitiesMode() && $isadmin) { $actions['add_transfer_list'] = _x('button', 'Add to transfer list'); } return $actions; } /** * @see CommonDBTM::showSpecificMassiveActionsParameters() **/ function showSpecificMassiveActionsParameters($input=array()) { global $CFG_GLPI; switch ($input['action']) { case "add_user_group" : case "add_supervisor_group" : case "add_delegatee_group" : $gu = new Group_User(); return $gu->showSpecificMassiveActionsParameters($input); case "changegroup" : if (isset($input['is_tech']) && isset($input['check_items_id']) && isset($input['check_itemtype'])) { if ($group = getItemForItemtype($input['check_itemtype'])) { if ($group->getFromDB($input['check_items_id'])) { self::dropdown(array('entity' => $group->fields["entities_id"], 'used' => array($group->fields["id"]), 'condition' => ($input['is_tech'] ? '`is_assign`' : '`is_itemgroup`'))); echo "

"; return true; } } } break; default : return parent::showSpecificMassiveActionsParameters($input); } return false; } /** * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "add_user_group" : case "add_supervisor_group" : case "add_delegatee_group" : $gu = new Group_User(); return $gu->doSpecificMassiveActions($input); case "changegroup" : if (isset($input["field"]) && isset($input['groups_id'])) { foreach ($input['item'] as $type => $ids) { if ($item = getItemForItemtype($type)) { foreach ($ids as $id => $val) { if ($val && $item->can($id, 'w')) { if ($item->update(array('id' => $id, $input["field"] => $input["groups_id"]))) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } } else { $res['ko']++; } } } else { $res['ko']++; } break; default : return parent::doSpecificMassiveActions($input); } return $res; } function getSearchOptions() { $tab = parent::getSearchOptions(); if (AuthLdap::useAuthLdap()) { $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'ldap_field'; $tab[3]['name'] = __('Attribute of the user containing its groups'); $tab[3]['datatype'] = 'string'; $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'ldap_value'; $tab[4]['name'] = __('Attribute value'); $tab[4]['datatype'] = 'text'; $tab[5]['table'] = $this->getTable(); $tab[5]['field'] = 'ldap_group_dn'; $tab[5]['name'] = __('Group DN'); $tab[5]['datatype'] = 'text'; } $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'is_requester'; $tab[11]['name'] = __('Requester'); $tab[11]['datatype'] = 'bool'; $tab[12]['table'] = $this->getTable(); $tab[12]['field'] = 'is_assign'; $tab[12]['name'] = __('Assigned to'); $tab[12]['datatype'] = 'bool'; $tab[13]['table'] = $this->getTable(); $tab[13]['field'] = 'is_notify'; $tab[13]['name'] = __('Can be notified'); $tab[13]['datatype'] = 'bool'; $tab[17]['table'] = $this->getTable(); $tab[17]['field'] = 'is_itemgroup'; $tab[17]['name'] = sprintf(__('%1$s %2$s'), __('Can contain'), _n('Item', 'Items', 2)); $tab[17]['datatype'] = 'bool'; $tab[15]['table'] = $this->getTable(); $tab[15]['field'] = 'is_usergroup'; $tab[15]['name'] = sprintf(__('%1$s %2$s'), __('Can contain'), User::getTypeName(2)); $tab[15]['datatype'] = 'bool'; $tab[70]['table'] = 'glpi_users'; $tab[70]['field'] = 'name'; $tab[70]['name'] = __('Manager'); $tab[70]['datatype'] = 'dropdown'; $tab[70]['right'] = 'all'; $tab[70]['forcegroupby'] = true; $tab[70]['massiveaction'] = false; $tab[70]['joinparams'] = array('beforejoin' => array('table' => 'glpi_groups_users', 'joinparams' => array('jointype' => 'child', 'condition' => "AND NEWTABLE.`is_manager` = 1"))); $tab[71]['table'] = 'glpi_users'; $tab[71]['field'] = 'name'; $tab[71]['name'] = __('Delegatee'); $tab[71]['datatype'] = 'dropdown'; $tab[71]['right'] = 'all'; $tab[71]['forcegroupby'] = true; $tab[71]['massiveaction'] = false; $tab[71]['joinparams'] = array('beforejoin' => array('table' => 'glpi_groups_users', 'joinparams' => array('jointype' => 'child', 'condition' => "AND NEWTABLE.`is_userdelegate` = 1"))); return $tab; } /** * @param $ID **/ function showLDAPForm($ID) { $options = array(); $this->initForm($ID, $options); echo ""; echo "
"; if (Session::haveRight("group", "w") && Session::haveRight("user_authtype", "w") && AuthLdap::useAuthLdap()) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } $options = array('colspan' => 1, 'candel' => false); $this->showFormButtons($options); } /** * get list of Computers in a group * * @since version 0.83 * * @param $types Array of types * @param $field String field name * @param $tree Boolean include child groups * @param $user Boolean include members (users) * @param $start Integer (first row to retrieve) * @param $res Array result filled on ouput * * @return integer total of items **/ function getDataItems(array $types, $field, $tree, $user, $start, array &$res) { global $DB; // include item of child groups ? if ($tree) { $grprestrict = "IN (".implode(',', getSonsOf('glpi_groups', $this->getID())).")"; } else { $grprestrict = "='".$this->getID()."'"; } // include items of members if ($user) { $ufield = str_replace('groups', 'users', $field); $grprestrict = "(`$field` $grprestrict OR (`$field`=0 AND `$ufield` IN (SELECT `users_id` FROM `glpi_groups_users` WHERE `groups_id` $grprestrict)))"; } else { $grprestrict = "`$field` $grprestrict"; } // Count the total of item $nb = array(); $tot = 0; foreach ($types as $itemtype) { $nb[$itemtype] = 0; if (!($item = getItemForItemtype($itemtype))) { continue; } if (!$item->canView()) { continue; } if (!$item->isField($field)) { continue; } $restrict[$itemtype] = $grprestrict; if ($item->isEntityAssign()) { $restrict[$itemtype] .= getEntitiesRestrictRequest(" AND ", $item->getTable(), '', '', $item->maybeRecursive()); } if ($item->maybeTemplate()) { $restrict[$itemtype] .= " AND NOT `is_template`"; } if ($item->maybeDeleted()) { $restrict[$itemtype] .= " AND NOT `is_deleted`"; } $tot += $nb[$itemtype] = countElementsInTable($item->getTable(), $restrict[$itemtype]); } $max = $_SESSION['glpilist_limit']; if ($start >= $tot) { $start = 0; } $res = array(); foreach ($types as $itemtype) { if (!($item = getItemForItemtype($itemtype))) { continue; } if ($start >= $nb[$itemtype]) { // No need to read $start -= $nb[$itemtype]; } else { $query = "SELECT `id` FROM `".$item->getTable()."` WHERE ".$restrict[$itemtype]." ORDER BY `name` LIMIT $start,$max"; foreach ($DB->request($query) as $data) { $res[] = array('itemtype' => $itemtype, 'items_id' => $data['id']); $max--; } // For next type $start = 0; } if (!$max) { break; } } return $tot; } /** * Show items for the group * * @param $tech boolean false search groups_id, true, search groups_id_tech **/ function showItems($tech) { global $DB, $CFG_GLPI; $rand = mt_rand(); $ID = $this->fields['id']; if ($tech) { $types = $CFG_GLPI['linkgroup_tech_types']; $field = 'groups_id_tech'; $title = __('Managed items'); } else { $types = $CFG_GLPI['linkgroup_types']; $field = 'groups_id'; $title = __('Used items'); } $tree = Session::getSavedOption(__CLASS__, 'tree', 0); $user = Session::getSavedOption(__CLASS__, 'user', 0); $type = Session::getSavedOption(__CLASS__, 'onlytype', ''); if (!in_array($type, $types)) { $type = ''; } echo "
"; // Mini Search engine echo "
".__('In users')."
".__('Attribute of the user containing its groups').""; Html::autocompletionTextField($this, "ldap_field"); echo "
".__('Attribute value').""; Html::autocompletionTextField($this, "ldap_value"); echo "
".__('In groups')."
".__('Group DN').""; Html::autocompletionTextField($this, "ldap_group_dn"); echo "
"; echo ""; echo "
$title
"; echo __('Type')." "; Dropdown::showItemType($types, array('value' => $type, 'name' => 'onlytype', 'plural' => true, 'on_change' => 'reloadTab("start=0&onlytype="+this.value)', 'checkright' => true)); if ($this->haveChildren()) { echo "".__('Child groups')." "; Dropdown::showYesNo('tree', $tree, -1, array('on_change' => 'reloadTab("start=0&tree="+this.value)')); } else { $tree = 0; } if ($this->getField('is_usergroup')) { echo "".User::getTypeName(2)." "; Dropdown::showYesNo('user', $user, -1, array('on_change' => 'reloadTab("start=0&user="+this.value)')); } else { $user = 0; } echo "
"; $datas = array(); if ($type) { $types = array($type); } $start = (isset($_POST['start']) ? $_POST['start'] : 0); $nb = $this->getDataItems($types, $field, $tree, $user, $start, $datas); $nbcan = 0; if ($nb) { Html::printAjaxPager('', $start, $nb); Html::openMassiveActionsForm('mass'.__CLASS__.$rand); echo ""; $paramsma = array('num_displayed' => $nb, 'check_itemtype' => 'Group', 'check_items_id' => $ID, 'extraparams' => array('is_tech' => $tech), 'specific_actions' => array('changegroup' => __('Move')) ); Html::showMassiveActions(__CLASS__, $paramsma); echo ""; echo ""; echo ""; if ($tree || $user) { echo ""; } echo ""; $tuser = new User(); $group = new Group(); foreach ($datas as $data) { if (!($item = getItemForItemtype($data['itemtype']))) { continue; } echo ""; } echo "
".Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand)."".__('Type')."".__('Name')."".__('Entity')."".sprintf(__('%1$s / %2$s'), self::getTypeName(1), User::getTypeName(1)). "
"; if ($item->can($data['items_id'], 'w')) { echo ""; } echo "".$item->getTypeName(1); echo "".$item->getLink(array('comments' => true)); echo "".Dropdown::getDropdownName("glpi_entities", $item->getEntityID()); if ($tree || $user) { echo ""; if ($grp = $item->getField($field)) { if ($group->getFromDB($grp)) { echo $group->getLink(array('comments' => true)); } } else if ($usr = $item->getField(str_replace('groups', 'users', $field))) { if ($tuser->getFromDB($usr)) { echo $tuser->getLink(array('comments' => true)); } } } echo "
"; } else { echo "

".__('No item found')."

"; } if ($nb) { $paramsma['ontop'] = false; Html::showMassiveActions(__CLASS__, $paramsma); } Html::closeForm(); if ($nb) { Html::printAjaxPager('', $start, $nb); } echo "
"; } } ?>glpi-0.84.3+dfsg.1/inc/group_knowbaseitem.class.php000066400000000000000000000043321226600447100221150ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Group_KnowbaseItem /// since version 0.83 class Group_KnowbaseItem extends CommonDBRelation { // From CommonDBRelation static public $itemtype_1 = 'KnowbaseItem'; static public $items_id_1 = 'knowbaseitems_id'; static public $itemtype_2 = 'Group'; static public $items_id_2 = 'groups_id'; static public $checkItem_2_Rights = self::DONT_CHECK_ITEM_RIGHTS; static public $logs_for_item_2 = false; /** * Get groups for a knowbaseitem * * @param $knowbaseitems_id ID of the knowbaseitem * * @return array of groups linked to a knowbaseitem **/ static function getGroups($knowbaseitems_id) { global $DB; $groups = array(); $query = "SELECT `glpi_groups_knowbaseitems`.* FROM `glpi_groups_knowbaseitems` WHERE knowbaseitems_id = '$knowbaseitems_id'"; foreach ($DB->request($query) as $data) { $groups[$data['groups_id']][] = $data; } return $groups; } } ?>glpi-0.84.3+dfsg.1/inc/group_problem.class.php000066400000000000000000000027331226600447100210700ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Group_Problem class Group_Problem extends CommonITILActor { // From CommonDBRelation static public $itemtype_1 = 'Problem'; static public $items_id_1 = 'problems_id'; static public $itemtype_2 = 'Group'; static public $items_id_2 = 'groups_id'; } ?> glpi-0.84.3+dfsg.1/inc/group_reminder.class.php000066400000000000000000000042461226600447100212360ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Group_Reminder /// @since version 0.83 class Group_Reminder extends CommonDBRelation { // From CommonDBRelation static public $itemtype_1 = 'Reminder'; static public $items_id_1 = 'reminders_id'; static public $itemtype_2 = 'Group'; static public $items_id_2 = 'groups_id'; static public $checkItem_2_Rights = self::DONT_CHECK_ITEM_RIGHTS; static public $logs_for_item_2 = false; /** * Get groups for a reminder * * @param $reminders_id ID of the reminder * * @return array of groups linked to a reminder **/ static function getGroups($reminders_id) { global $DB; $groups = array(); $query = "SELECT `glpi_groups_reminders`.* FROM `glpi_groups_reminders` WHERE `reminders_id` = '$reminders_id'"; foreach ($DB->request($query) as $data) { $groups[$data['groups_id']][] = $data; } return $groups; } } ?> glpi-0.84.3+dfsg.1/inc/group_rssfeed.class.php000066400000000000000000000042301226600447100210550ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Group_RSSFeed /// @since version 0.84 class Group_RSSFeed extends CommonDBRelation { // From CommonDBRelation static public $itemtype_1 = 'RSSFeed'; static public $items_id_1 = 'rssfeeds_id'; static public $itemtype_2 = 'Group'; static public $items_id_2 = 'groups_id'; static public $checkItem_2_Rights = self::DONT_CHECK_ITEM_RIGHTS; static public $logs_for_item_2 = false; /** * Get groups for a rssfeed * * @param $rssfeeds_id ID of the rssfeed * * @return array of groups linked to a rssfeed **/ static function getGroups($rssfeeds_id) { global $DB; $groups = array(); $query = "SELECT `glpi_groups_rssfeeds`.* FROM `glpi_groups_rssfeeds` WHERE `rssfeeds_id` = '$rssfeeds_id'"; foreach ($DB->request($query) as $data) { $groups[$data['groups_id']][] = $data; } return $groups; } } ?> glpi-0.84.3+dfsg.1/inc/group_ticket.class.php000066400000000000000000000027261226600447100207150ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Group_Ticket class Group_Ticket extends CommonITILActor { // From CommonDBRelation static public $itemtype_1 = 'Ticket'; static public $items_id_1 = 'tickets_id'; static public $itemtype_2 = 'Group'; static public $items_id_2 = 'groups_id'; } ?> glpi-0.84.3+dfsg.1/inc/group_user.class.php000066400000000000000000000643201226600447100204060ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Group_User class - Relation between Group and User class Group_User extends CommonDBRelation{ // From CommonDBRelation static $itemtype_1 = 'User'; static $items_id_1 = 'users_id'; static $itemtype_2 = 'Group'; static $items_id_2 = 'groups_id'; static public $logs_for_item_1 = false; /** * @param $users_id * @param $condition (default '') **/ static function getUserGroups($users_id, $condition='') { global $DB; $groups = array(); $query = "SELECT `glpi_groups`.*, `glpi_groups_users`.`id` AS IDD, `glpi_groups_users`.`id` AS linkID, `glpi_groups_users`.`is_dynamic` AS is_dynamic, `glpi_groups_users`.`is_manager` AS is_manager, `glpi_groups_users`.`is_userdelegate` AS is_userdelegate FROM `glpi_groups_users` LEFT JOIN `glpi_groups` ON (`glpi_groups`.`id` = `glpi_groups_users`.`groups_id`) WHERE `glpi_groups_users`.`users_id` = '$users_id' "; if (!empty($condition)) { $query .= " AND $condition "; } $query.=" ORDER BY `glpi_groups`.`name`"; foreach ($DB->request($query) as $data) { $groups[] = $data; } return $groups; } /** * @since version 0.84 * * @param $groups_id * @param $condition (default '') **/ static function getGroupUsers($groups_id, $condition='') { global $DB; $users = array(); $query = "SELECT `glpi_users`.*, `glpi_groups_users`.`id` AS IDD, `glpi_groups_users`.`id` AS linkID, `glpi_groups_users`.`is_dynamic` AS is_dynamic, `glpi_groups_users`.`is_manager` AS is_manager, `glpi_groups_users`.`is_userdelegate` AS is_userdelegate FROM `glpi_groups_users` LEFT JOIN `glpi_users` ON (`glpi_users`.`id` = `glpi_groups_users`.`users_id`) WHERE `glpi_groups_users`.`groups_id` = '$groups_id'"; if (!empty($condition)) { $query .= " AND $condition "; } $query .= "ORDER BY `glpi_users`.`name`"; foreach ($DB->request($query) as $data) { $users[] = $data; } return $users; } /** Show groups of a user * * @param $user User object **/ static function showForUser(User $user) { global $CFG_GLPI; $ID = $user->fields['id']; if (!Session::haveRight("group","r") || !$user->can($ID,'r')) { return false; } $canedit = $user->can($ID,'w'); $rand = mt_rand(); $groups = self::getUserGroups($ID); $used = array(); if (!empty($groups)) { foreach ($groups as $data) { $used[$data["id"]] = $data["id"]; } } if ($canedit) { echo "
"; echo ""; echo ""; echo ""; echo ""; echo "
".__('Associate to a group')."
"; echo ""; // All entities "edited user" have access $strict_entities = Profile_User::getUserEntities($ID, true); // Keep only entities "connected user" have access foreach ($strict_entities as $key => $val) { if (!Session::haveAccessToEntity($val)) { unset($strict_entities[$key]); } } $nb = countElementsInTableForEntity("glpi_groups", $strict_entities, '`is_usergroup`'); if ($nb > count($used)) { Group::dropdown(array('entity' => $strict_entities, 'used' => $used, 'condition' => '`is_usergroup`')); echo "".__('Manager').""; Dropdown::showYesNo('is_manager'); echo "".__('Delegatee').""; Dropdown::showYesNo('is_userdelegate'); echo ""; echo ""; } else { _e('None'); } echo "
"; Html::closeForm(); echo "
"; } echo "
"; if ($canedit && count($used)) { $rand = mt_rand(); Html::openMassiveActionsForm('mass'.__CLASS__.$rand); echo ""; $paramsma = array('num_displayed' => count($used)); Html::showMassiveActions(__CLASS__, $paramsma); } echo ""; if ($canedit && count($used)) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; $group = new Group(); if (!empty($groups)) { Session::initNavigateListItems('Group', //TRANS : %1$s is the itemtype name, // %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), User::getTypeName(1), $user->getName())); foreach ($groups as $data) { if (!$group->getFromDB($data["id"])) { continue; } Session::addToNavigateListItems('Group', $data["id"]); echo ""; if ($canedit && count($used)) { echo ""; } $link = $data["completename"]; if ($_SESSION["glpiis_ids_visible"]) { $link = sprintf(__('%1$s (%2$s)'), $link, $data["id"]); } $href = "". $link.""; if ($data["is_dynamic"]) { $href = sprintf(__('%1$s (%2$s)'), $href, "".__('D').""); } echo ""; echo ""; } } else { echo ""; echo ""; } echo "
"; Html::checkAllAsCheckbox('mass'.__CLASS__.$rand); echo "".Group::getTypeName(1)."".__('Dynamic')."".__('Manager')."".__('Delegatee')."
"; Html::showMassiveActionCheckBox(__CLASS__, $data["linkID"]); echo "".$group->getLink().""; if ($data['is_dynamic']) { echo ""; } echo ""; if ($data['is_manager']) { echo ""; } echo ""; if ($data['is_userdelegate']) { echo ""; } echo "
".__('None')."
"; if ($canedit && count($used)) { $paramsma['ontop'] = false; Html::showMassiveActions(__CLASS__, $paramsma); Html::closeForm(); } echo "
"; } /** * Show form to add a user in current group * * @since version 0.83 * * @param $group Group object * @param $used_ids Array of already add users * @param $entityrestrict Array of entities * @param $crit String for criteria (for default dropdown) **/ private static function showAddUserForm(Group $group, $used_ids, $entityrestrict, $crit) { global $CFG_GLPI, $DB; $rand = mt_rand(); $res = User::getSqlSearchResult (true, "all", $entityrestrict, 0, $used_ids); $nb = ($res ? $DB->result($res,0,"CPT") : 0); if ($nb) { echo ""; echo ""; echo "
"; echo ""; echo ""; echo ""; echo "
".__('Add a user')."
"; User::dropdown(array('right' => "all", 'entity' => $entityrestrict, 'used' => $used_ids)); echo "".__('Manager').""; Dropdown::showYesNo('is_manager', (($crit == 'is_manager') ? 1 : 0)); echo "".__('Delegatee').""; Dropdown::showYesNo('is_userdelegate', (($crit == 'is_userdelegate') ? 1 : 0)); echo ""; echo ""; echo ""; echo "
"; Html::closeForm(); } } /** * Retrieve list of member of a Group * * @since version 0.83 * * @param $group Group object * @param $members Array filled on output of member (filtered) * @param $ids Array of ids (not filtered) * @param $crit String filter (is_manager, is_userdelegate) (default '') * @param $tree Boolean true to include member of sub-group (default 0) * * @return String tab of entity for restriction **/ static function getDataForGroup(Group $group, &$members, &$ids, $crit='', $tree=0) { global $DB; // Entity restriction for this group, according to user allowed entities if ($group->fields['is_recursive']) { $entityrestrict = getSonsOf('glpi_entities', $group->fields['entities_id']); // active entity could be a child of object entity if (($_SESSION['glpiactive_entity'] != $group->fields['entities_id']) && in_array($_SESSION['glpiactive_entity'], $entityrestrict)) { $entityrestrict = getSonsOf('glpi_entities', $_SESSION['glpiactive_entity']); } } else { $entityrestrict = $group->fields['entities_id']; } if ($tree) { $restrict = "IN (".implode(',', getSonsOf('glpi_groups', $group->getID())).")"; } else { $restrict = "='".$group->getID()."'"; } // All group members $query = "SELECT DISTINCT `glpi_users`.`id`, `glpi_groups_users`.`id` AS linkID, `glpi_groups_users`.`groups_id`, `glpi_groups_users`.`is_dynamic` AS is_dynamic, `glpi_groups_users`.`is_manager` AS is_manager, `glpi_groups_users`.`is_userdelegate` AS is_userdelegate FROM `glpi_groups_users` INNER JOIN `glpi_users` ON (`glpi_users`.`id` = `glpi_groups_users`.`users_id`) INNER JOIN `glpi_profiles_users` ON (`glpi_profiles_users`.`users_id`=`glpi_users`.`id`) WHERE `glpi_groups_users`.`groups_id` $restrict ". getEntitiesRestrictRequest('AND', 'glpi_profiles_users', '', $entityrestrict, 1)." ORDER BY `glpi_users`.`realname`, `glpi_users`.`firstname`, `glpi_users`.`name`"; $result = $DB->query($query); if ($DB->numrows($result) > 0) { while ($data=$DB->fetch_assoc($result)) { // Add to display list, according to criterion if (empty($crit) || $data[$crit]) { $members[] = $data; } // Add to member list (member of sub-group are not member) if ($data['groups_id'] == $group->getID()) { $ids[] = $data['id']; } } } return $entityrestrict; } /** * Show users of a group * * @since version 0.83 * * @param $group Group object: the group **/ static function showForGroup(Group $group) { global $DB, $CFG_GLPI; $ID = $group->getID(); if (!Session::haveRight("user","r") || !$group->can($ID,'r')) { return false; } // Have right to manage members $canedit = self::canUpdate(); $rand = mt_rand(); $user = new User(); $crit = Session::getSavedOption(__CLASS__, 'criterion', ''); $tree = Session::getSavedOption(__CLASS__, 'tree', 0); $used = array(); $ids = array(); // Retrieve member list $entityrestrict = self::getDataForGroup($group, $used, $ids, $crit, $tree); if ($canedit) { self::showAddUserForm($group, $ids, $entityrestrict, $crit); } // Mini Search engine echo ""; echo ""; echo "
".User::getTypeName(2)."
"; echo _n('Criterion', 'Criteria', 1)." "; $crits = array('' => Dropdown::EMPTY_VALUE, 'is_manager' => __('Manager'), 'is_userdelegate' => __('Delegatee')); Dropdown::showFromArray('crit', $crits, array('value' => $crit, 'on_change' => 'reloadTab("start=0&criterion="+this.value)')); if ($group->haveChildren()) { echo "".__('Child groups'); Dropdown::showYesNo('tree', $tree, -1, array('on_change' => 'reloadTab("start=0&tree="+this.value)')); } else { $tree = 0; } echo "
"; $number = count($used); $start = (isset($_POST['start']) ? intval($_POST['start']) : 0); if ($start >= $number) { $start = 0; } // Display results if ($number) { echo "
"; Html::printAjaxPager(sprintf(__('%1$s (%2$s)'), User::getTypeName(2), __('D=Dynamic')), $start, $number); Session::initNavigateListItems('User', //TRANS : %1$s is the itemtype name, // %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), Group::getTypeName(1), $group->getName())); if ($canedit) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $paramsma = array('num_displayed' => min($number-$start, $_SESSION['glpilist_limit'])); Html::showMassiveActions(__CLASS__, $paramsma); } echo ""; if ($canedit) { echo ""; } echo ""; if ($tree) { echo ""; } echo ""; echo ""; echo ""; $tmpgrp = new Group(); for ($i=$start, $j=0 ; ($i < $number) && ($j < $_SESSION['glpilist_limit']) ; $i++, $j++) { $data = $used[$i]; $user->getFromDB($data["id"]); Session::addToNavigateListItems('User', $data["id"]); echo "\n"; if ($canedit) { echo ""; } echo ""; } echo "
"; Html::checkAllAsCheckbox('mass'.__CLASS__.$rand); echo "".User::getTypeName(1)."".Group::getTypeName(1)."".__('Dynamic')."".__('Manager')."".__('Delegatee')."
"; Html::showMassiveActionCheckBox(__CLASS__, $data["linkID"]); echo "".$user->getLink(); if ($tree) { echo ""; if ($tmpgrp->getFromDB($data['groups_id'])) { echo $tmpgrp->getLink(array('comments' => true)); } } echo ""; if ($data['is_dynamic']) { echo ""; } echo ""; if ($data['is_manager']) { echo ""; } echo ""; if ($data['is_userdelegate']) { echo ""; } echo "
"; if ($canedit) { $paramsma['ontop'] = false; Html::showMassiveActions(__CLASS__, $paramsma); Html::closeForm(); } Html::printAjaxPager(sprintf(__('%1$s (%2$s)'), User::getTypeName(2), __('D=Dynamic')), $start, $number); echo "
"; } else { echo "

".__('No item found')."

"; } } /** * @see CommonDBTM::showSpecificMassiveActionsParameters() **/ function showSpecificMassiveActionsParameters($input=array()) { switch ($input['action']) { case "add_user_group" : case "add_supervisor_group" : case "add_delegatee_group" : if ($input['itemtype'] == 'User') { Group::dropdown(array('condition' => '`is_usergroup`')); echo "

"; return true; } if ($input['itemtype'] == 'Group') { User::dropdown(array('right' => "all")); echo "

"; return true; } break; default : return parent::showSpecificMassiveActionsParameters($input); } return false; } /** * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "add_user_group" : case "add_supervisor_group" : case "add_delegatee_group" : foreach ($input["item"] as $key => $val) { if ($val == 1) { if (isset($input['users_id'])) { // Add users to groups $input2 = array('groups_id' => $key, 'users_id' => $input['users_id']); } else if (isset($input['groups_id'])) { // Add groups to users $input2 = array('groups_id' => $input["groups_id"], 'users_id' => $key); } else { return false; } $updateifnotfound = false; if ($input["action"] == 'add_supervisor_group') { $input2['is_manager'] = 1; $updateifnotfound = true; } if ($input["action"] == 'add_delegatee_group') { $input2['is_userdelegate'] = 1; $updateifnotfound = true; } $group = new Group(); $user = new user(); if ($group->getFromDB($input2['groups_id']) && $user->getFromDB($input2['users_id'])) { if ($updateifnotfound && $this->getFromDBForItems($user, $group)) { if ($this->can($this->getID(),'w')) { $input2['id'] = $this->getID(); if ($this->update($input2)) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } else { if ($this->can(-1,'w',$input2)) { if ($this->add($input2)) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } } else { $res['ko']++; } } } break; default : return parent::doSpecificMassiveActions($input); } return $res; } /** * Get search function for the class * * @return array of search option **/ function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'is_dynamic'; $tab[3]['name'] = __('Dynamic'); $tab[3]['datatype'] = 'bool'; $tab[3]['massiveaction'] = false; $tab[4]['table'] = 'glpi_groups'; $tab[4]['field'] = 'completename'; $tab[4]['name'] = __('Group'); $tab[4]['massiveaction'] = false; $tab[4]['datatype'] = 'dropdown'; $tab[5]['table'] = 'glpi_users'; $tab[5]['field'] = 'name'; $tab[5]['name'] = __('User'); $tab[5]['massiveaction'] = false; $tab[5]['datatype'] = 'dropdown'; $tab[5]['right'] = 'all'; $tab[6]['table'] = $this->getTable(); $tab[6]['field'] = 'is_manager'; $tab[6]['name'] = __('Manager'); $tab[6]['datatype'] = 'bool'; $tab[7]['table'] = $this->getTable(); $tab[7]['field'] = 'is_userdelegate'; $tab[7]['name'] = __('Delegatee'); $tab[7]['datatype'] = 'bool'; return $tab; } /** * @param $user_ID * @param $only_dynamic (false by default **/ static function deleteGroups($user_ID, $only_dynamic=false) { global $DB; $crit['users_id'] = $user_ID; if ($only_dynamic) { $crit['is_dynamic'] = '1'; } $obj = new self(); $obj->deleteByCriteria($crit); } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { switch ($item->getType()) { case 'User' : if (Session::haveRight("group","r")) { if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(Group::getTypeName(2), countElementsInTable($this->getTable(), "users_id = '".$item->getID()."'")); } return Group::getTypeName(2); } break; case 'Group' : if (Session::haveRight("user","r")) { if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(User::getTypeName(2), countElementsInTable("glpi_groups_users", "`groups_id` = '".$item->getID()."'" )); } return User::getTypeName(2); } break; } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($item->getType()) { case 'User' : self::showForUser($item); break; case 'Group' : self::showForGroup($item); break; } return true; } } ?> glpi-0.84.3+dfsg.1/inc/holiday.class.php000077500000000000000000000067141226600447100176530ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Holiday class Holiday extends CommonDropdown { static function getTypeName($nb=0) { return _n('Close time','Close times',$nb); } static function canCreate() { return Session::haveRight('calendar', 'w'); } static function canView() { return Session::haveRight('calendar', 'r'); } function getAdditionalFields() { return array(array('name' => 'begin_date', 'label' => __('Start'), 'type' => 'date'), array('name' => 'end_date', 'label' => __('End'), 'type' => 'date'), array('name' => 'is_perpetual', 'label' => __('Recurrent'), 'type' => 'bool')); } /** * Get search function for the class * * @return array of search option **/ function getSearchOptions() { $tab = parent::getSearchOptions(); $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'begin_date'; $tab[11]['name'] = __('Start'); $tab[11]['datatype'] = 'date'; $tab[12]['table'] = $this->getTable(); $tab[12]['field'] = 'end_date'; $tab[12]['name'] = __('End'); $tab[12]['datatype'] = 'date'; $tab[13]['table'] = $this->getTable(); $tab[13]['field'] = 'is_perpetual'; $tab[13]['name'] = __('Recurrent'); $tab[13]['datatype'] = 'bool'; return $tab; } /** * @see CommonDBTM::prepareInputForAdd() **/ function prepareInputForAdd($input) { $input = parent::prepareInputForAdd($input); if (empty($input['end_date']) || ($input['end_date'] == 'NULL') || ($input['end_date'] < $input['begin_date'])) { $input['end_date'] = $input['begin_date']; } return $input; } /** * @see CommonDBTM::prepareInputForUpdate() **/ function prepareInputForUpdate($input) { $input = parent::prepareInputForUpdate($input); if (empty($input['end_date']) || ($input['end_date'] == 'NULL') || ($input['end_date'] < $input['begin_date'])) { $input['end_date'] = $input['begin_date']; } return $input; } } ?> glpi-0.84.3+dfsg.1/inc/html.class.php000066400000000000000000005220561226600447100171650ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // class Html class Html { /** * Clean display value deleting html tags * * @param $value string: string value * * @return clean value **/ static function clean($value) { $value = preg_replace("/<(p|br|div)( [^>]*)?".">/i", "\n", $value); $specialfilter = array('@]*?x-hidden[^>]*?>.*?]*?>@si'); // Strip ToolTips $value = preg_replace($specialfilter, ' ', $value); $search = array('@]*?>.*?]*?>@si', // Strip out javascript '@]*?>.*?]*?>@si', // Strip style tags properly '@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags '@@'); // Strip multi-line comments including CDATA $value = preg_replace($search, ' ', $value); $value = preg_replace("/( | )+/", " ", $value); // nettoyer l'apostrophe curly qui pose probleme a certains rss-readers, lecteurs de mail... $value = str_replace("’", "'", $value); // Problem with this regex : may crash // $value = preg_replace("/ +/u", " ", $value); $value = str_replace(array("\r\n", "\r"), "\n", $value); $value = preg_replace("/(\n[ ]*){2,}/", "\n\n", $value, -1); return trim($value); } /** * Recursivly execute html_entity_decode on an Array * * @param $value string or array * * @return array of value (same struct as input) **/ static function entity_decode_deep($value) { return (is_array($value) ? array_map(array(__CLASS__, 'entity_decode_deep'), $value) : html_entity_decode($value, ENT_QUOTES, "UTF-8")); } /** * Recursivly execute htmlentities on an Array * * @param $value string or array * * @return array of value (same struct as input) **/ static function entities_deep($value) { return (is_array($value) ? array_map(array(__CLASS__, 'entities_deep'), $value) : htmlentities($value,ENT_QUOTES, "UTF-8")); } /** * Convert a date YY-MM-DD to DD-MM-YY for calendar * * @param $time date: date to convert * * @return $time or $date **/ static function convDate($time) { if (is_null($time) || ($time == 'NULL')) { return NULL; } if (!isset($_SESSION["glpidate_format"])) { $_SESSION["glpidate_format"] = 0; } switch ($_SESSION['glpidate_format']) { case 1 : // DD-MM-YYYY $date = substr($time, 8, 2)."-"; // day $date .= substr($time, 5, 2)."-"; // month $date .= substr($time, 0, 4); // year return $date; case 2 : // MM-DD-YYYY $date = substr($time, 5, 2)."-"; // month $date .= substr($time, 8, 2)."-"; // day $date .= substr($time, 0, 4); // year return $date; default : // YYYY-MM-DD if (strlen($time)>10) { return substr($time, 0, 10); } return $time; } } /** * Convert a date YY-MM-DD HH:MM to DD-MM-YY HH:MM for display in a html table * * @param $time datetime: datetime to convert * * @return $time or $date **/ static function convDateTime($time) { if (is_null($time) || ($time == 'NULL')) { return NULL; } return self::convDate($time).' '. substr($time, 11, 5); } /** * Clean string for input text field * * @param $string string: input text * * @return clean string **/ static function cleanInputText($string) { return preg_replace('/\"/', '"', $string); } /** * Clean all parameters of an URL. Get a clean URL * * @param $url string URL * * @return clean URL **/ static function cleanParametersURL($url) { $url = preg_replace("/(\/[0-9a-zA-Z\.\-\_]+\.php).*/", "$1", $url); return preg_replace("/\?.*/", "", $url); } /** * Recursivly execute nl2br on an Array * * @param $value string or array * * @return array of value (same struct as input) **/ static function nl2br_deep($value) { return (is_array($value) ? array_map(array(__CLASS__, 'nl2br_deep'), $value) : nl2br($value)); } /** * Resume text for followup * * @param $string string string to resume * @param $length integer resume length (default 255) * * @return cut string **/ static function resume_text($string, $length=255) { if (Toolbox::strlen($string) > $length) { $string = Toolbox::substr($string, 0, $length)." (...)"; } return $string; } /** * Resume a name for display * * @param $string string string to resume * @param $length integer resume length (default 255) * * @return cut string **/ static function resume_name($string, $length=255) { if (strlen($string) > $length) { $string = Toolbox::substr($string, 0, $length)."..."; } return $string; } /** * Clean post value for display in textarea * * @param $value string: string value * * @return clean value **/ static function cleanPostForTextArea($value) { if (is_array($value)) { return array_map(array(__CLASS__, __METHOD__), $value); } $order = array('\r\n', '\n', "\\'", '\"', '\\\\'); $replace = array("\n", "\n", "'", '"', "\\"); return str_replace($order, $replace, $value); } /** * Convert a number to correct display * * @param $number float Number to display * @param $edit boolean display number for edition ? (id edit use . in all case) * (false by default) * @param $forcedecimal integer Force decimal number (do not use default value) (default -1) * * @return formatted number **/ static function formatNumber($number, $edit=false, $forcedecimal=-1) { global $CFG_GLPI; // Php 5.3 : number_format() expects parameter 1 to be double, if ($number == "") { $number = 0; } else if ($number == "-") { // used for not defines value (from Infocom::Amort, p.e.) return "-"; } $number = doubleval($number); $decimal = $CFG_GLPI["decimal_number"]; if ($forcedecimal>=0) { $decimal = $forcedecimal; } // Edit : clean display for mysql if ($edit) { return number_format($number, $decimal, '.', ''); } // Display : clean display switch ($_SESSION['glpinumber_format']) { case 2 : // Other French return str_replace(' ', ' ', number_format($number, $decimal, ',', ' ')); case 0 : // French return str_replace(' ', ' ', number_format($number, $decimal, '.', ' ')); default: // English return number_format($number, $decimal, '.', ','); } } /** * Make a good string from the unix timestamp $sec * * @param $time integer timestamp * @param $display_sec boolean display seconds ? (true by default) * @param $use_days boolean use days for display ? (true by default) * * @return string **/ static function timestampToString($time, $display_sec=true, $use_days=true) { $sign = ''; if ($time < 0) { $sign = '- '; $time = abs($time); } $time = floor($time); // Force display seconds if time is null if ($time < MINUTE_TIMESTAMP) { $display_sec = true; } $units = Toolbox::getTimestampTimeUnits($time); $out = $sign; if ($use_days) { if ($units['day'] > 0) { if ($display_sec) { //TRANS: %1$d number of days, %2$d number of hours, %3$d number of minutes, // %4$d number of seconds return $out.sprintf(__('%1$d days %2$d hours %3$d minutes %4$d seconds'), $units['day'], $units['hour'], $units['minute'], $units['second']); } //TRANS: %1$d number of days, %2$d number of hours, %3$d number of minutes return $out.sprintf(__('%1$d days %2$d hours %3$d minutes'), $units['day'], $units['hour'], $units['minute']); } } else { if ($units['day'] > 0) { $units['hour'] += 24*$units['day']; } } if ($units['hour'] > 0) { if ($display_sec) { //TRANS: %1$d number of hours, %2$d number of minutes, %3$d number of seconds return $out.sprintf(__('%1$d hours %2$d minutes %3$d seconds'), $units['hour'], $units['minute'], $units['second']); } //TRANS: %1$d number of hours, %2$d number of minutes return $out.sprintf(__('%1$d hours %2$d minutes'), $units['hour'], $units['minute']); } if ($units['minute']>0) { if ($display_sec) { //TRANS: %1$d number of minutes, %2$d number of seconds return $out.sprintf(__('%1$d minutes %2$d seconds'), $units['minute'], $units['second']); } //TRANS: %d number of minutes return $out.sprintf(_n('%d minute', '%d minutes', $units['minute']), $units['minute']); } if ($display_sec) { //TRANS: %d number of seconds return $out.sprintf(_n('%s second', '%s seconds', $units['second']), $units['second']); } return ''; } /** * Extract url from web link * * @param $value string value * * @return clean value **/ static function weblink_extract($value) { $value = preg_replace('/]*>[^<]*<\/a>/i', "$1", $value); return $value; } /** * Redirection to $_SERVER['HTTP_REFERER'] page * * @return nothing **/ static function back() { self::redirect($_SERVER['HTTP_REFERER']); } /** * Redirection hack * * @param $dest string: Redirection destination * * @return nothing **/ static function redirect($dest) { $toadd = ''; if (!strpos($dest,"?")) { $toadd = '?tokonq='.Toolbox::getRandomString(5); } echo ""; exit(); } /** * Display common message for item not found * * @return Nothing **/ static function displayNotFoundError() { global $CFG_GLPI, $HEADER_LOADED; if (!$HEADER_LOADED) { if (!isset($_SESSION["glpiactiveprofile"]["interface"])) { self::nullHeader(__('Access denied')); } else if ($_SESSION["glpiactiveprofile"]["interface"] == "central") { self::header(__('Access denied')); } else if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") { self::helpHeader(__('Access denied')); } } echo "


"; echo "".__s("; echo "

" . __('Item not found') . "
"; self::nullFooter(); exit (); } /** * Display common message for privileges errors * * @return Nothing (die) **/ static function displayRightError() { self::displayErrorAndDie(__("You don't have permission to perform this action.")); } /** * Display a div containing a message set in session in the previous page **/ static function displayMessageAfterRedirect() { // Affichage du message apres redirection if (isset($_SESSION["MESSAGE_AFTER_REDIRECT"]) && !empty($_SESSION["MESSAGE_AFTER_REDIRECT"])) { echo "
"; echo "
"; echo "
"; echo "
"; echo $_SESSION["MESSAGE_AFTER_REDIRECT"]; echo "
"; echo "
"; echo "
"; echo "
"; } // Clean message $_SESSION["MESSAGE_AFTER_REDIRECT"] = ""; } /** * Common Title Function * * @param $ref_pic_link Path to the image to display (default '') * @param $ref_pic_text Alt text of the icon (default '') * @param $ref_title Title to display (default '') * @param $ref_btts Extra items to display array(link=>text...) (default '') * * @return nothing **/ static function displayTitle($ref_pic_link="", $ref_pic_text="", $ref_title="", $ref_btts="") { $ref_pic_text = htmlentities($ref_pic_text, ENT_QUOTES, 'UTF-8'); echo "
"; if ($ref_pic_link!="") { $ref_pic_text = self::clean($ref_pic_text); echo ""; } if ($ref_title != "") { echo ""; } if (is_array($ref_btts) && count($ref_btts)) { foreach ($ref_btts as $key => $val) { echo ""; } } echo "
\"".$ref_pic_text."\"  ".$ref_title." ".$val."
"; } /** * Clean Display of Request * * @since version 0.83.1 * * @param $request SQL request **/ static function cleanSQLDisplay($request) { $request = str_replace("<","<",$request); $request = str_replace(">",">",$request); $request = str_ireplace("UNION","
UNION
",$request); $request = str_ireplace("FROM","
FROM",$request); $request = str_ireplace("WHERE","
WHERE",$request); $request = str_ireplace("INNER JOIN","
INNER JOIN",$request); $request = str_ireplace("LEFT JOIN","
LEFT JOIN",$request); $request = str_ireplace("ORDER BY","
ORDER BY",$request); $request = str_ireplace("SORT","
SORT",$request); return $request; } /** * Display Debug Information * * @param $with_session with session information (true by default) **/ static function displayDebugInfos($with_session=true) { global $CFG_GLPI, $DEBUG_SQL, $SQL_TOTAL_REQUEST, $SQL_TOTAL_TIMER, $DEBUG_AUTOLOAD; // Only for debug mode so not need to be translated if ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) { // mode debug echo "
"; echo "

GLPI MODE DEBUG

"; if ($CFG_GLPI["debug_sql"]) { echo "

SQL REQUEST : "; echo $SQL_TOTAL_REQUEST." Queries "; echo "took ".array_sum($DEBUG_SQL['times'])."s

"; echo ""; echo ""; foreach ($DEBUG_SQL['queries'] as $num => $query) { echo ""; } echo "
QueriesTimeErrors
$num"; echo self::cleanSQLDisplay($query); echo ""; echo $DEBUG_SQL['times'][$num]; echo ""; if (isset($DEBUG_SQL['errors'][$num])) { echo $DEBUG_SQL['errors'][$num]; } else { echo " "; } echo "
"; } if ($CFG_GLPI["debug_vars"]) { echo "

AUTOLOAD

"; echo "

" . implode(', ', $DEBUG_AUTOLOAD) . "

"; echo "

POST VARIABLE

"; self::printCleanArray($_POST); echo "

GET VARIABLE

"; self::printCleanArray($_GET); if ($with_session) { echo "

SESSION VARIABLE

"; self::printCleanArray($_SESSION); } } echo "
"; } } /** * Display a Link to the last page using http_referer if available else use history.back **/ static function displayBackLink() { if (isset($_SERVER['HTTP_REFERER'])) { echo "".__('Back').""; } else { echo "".__('Back').""; } } /** * Simple Error message page * * @param $message string displayed before dying * @param $minimal set to true do not display app menu (false by default) * * @return nothing as function kill script **/ static function displayErrorAndDie ($message, $minimal=false) { global $CFG_GLPI, $HEADER_LOADED; if (!$HEADER_LOADED) { if ($minimal || !isset($_SESSION["glpiactiveprofile"]["interface"])) { self::nullHeader(__('Access denied'), ''); } else if ($_SESSION["glpiactiveprofile"]["interface"] == "central") { self::header(__('Access denied'), ''); } else if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") { self::helpHeader(__('Access denied'), ''); } } echo "


"; echo "".__s(

$message
"; self::nullFooter(); exit (); } /** * Add confirmation on button or link before action * * @param $string string to display or array of string for using multilines * @param $additionalactions string additional actions to do on success confirmation * (default '') * * @return nothing **/ static function addConfirmationOnAction($string, $additionalactions='') { if (!is_array($string)) { $string = array($string); } $string = Toolbox::addslashes_deep($string); $additionalactions = trim($additionalactions); $out = " onclick=\""; $multiple = false; $close_string = ''; // Manage multiple confirmation foreach ($string as $tab) { if (is_array($tab)) { $multiple = true; $out .="if (window.confirm('"; $out .= implode('\n',$tab); $out .= "')){ "; $close_string .= "return true;} else { return false;}"; } } // manage simple confirmation if (!$multiple) { $out .="if (window.confirm('"; $out .= implode('\n',$string); $out .= "')){ "; $close_string .= "return true;} else { return false;}"; } $out .= $additionalactions.(substr($additionalactions, -1)!=';'?';':'').$close_string."\""; return $out; } /** * Create a Dynamic Progress Bar * * @param $msg initial message (under the bar) (default ' ') * * @return nothing **/ static function createProgressBar($msg=" ") { echo "
". "
". "

"; echo "\n"; } /** * Change the Message under the Progress Bar * * @param $msg message under the bar (default ' ') * * @return nothing **/ static function changeProgressBarMessage($msg=" ") { echo "\n"; } /** * Change the Progress Bar Position * * @param $crt Current Value (less then $max) * @param $tot Maximum Value * @param $msg message inside the bar (default is %) (default '') * * @return nothing **/ static function changeProgressBarPosition($crt, $tot, $msg="") { if (!$tot) { $pct = 0; } else if ($crt>$tot) { $pct = 1; } else { $pct = $crt/$tot; } echo "\n"; self::glpi_flush(); } /** * Display a simple progress bar * * @param $width Width of the progress bar * @param $percent Percent of the progress bar * @param $options array of possible options: * - title : string title to display (default Progesssion) * - simple : display a simple progress bar (no title / only percent) * - forcepadding : boolean force str_pad to force refresh (default true) * * @return nothing **/ static function displayProgressBar($width, $percent, $options=array()) { global $CFG_GLPI; $param['title'] = __('Progress'); $param['simple'] = false; $param['forcepadding'] = true; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $param[$key] = $val; } } $percentwidth = floor($percent*$width/100); $output = "
"; if (!$param['simple']) { $output .= ""; } $output .= ""; $output .= "
".$param['title']." ".$percent."%
"; if ($param['simple']) { $output .= $percent."%"; } else { $output .= ' '; } $output .= "
"; $output .= "
"; if (!$param['forcepadding']) { echo $output; } else { echo Toolbox::str_pad($output, 4096); self::glpi_flush(); } } /** * Include common HTML headers * * @param $title title used for the page (default '') * * @return nothing **/ static function includeHeader($title='') { global $CFG_GLPI, $PLUGIN_HOOKS; // Send UTF8 Headers header("Content-Type: text/html; charset=UTF-8"); // Allow only frame from same server to prevent click-jacking header('x-frame-options:SAMEORIGIN'); // Send extra expires header self::header_nocache(); // Start the page echo ""; echo "\nGLPI - ".$title.""; echo ""; // Send extra expires header echo "\n"; echo "\n"; echo "\n"; // CSS link echo "\n"; // surcharge CSS hack for IE echo ""; echo "\n"; echo "\n"; // AJAX library echo "\n"; if ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) { echo "\n"; } else { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo ""; echo "\n"; if (isset($_SESSION['glpilanguage'])) { echo "\n"; } // EXTRA EXTJS echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo ""; // Some Javascript-Functions which we may need later echo "\n"; // Add specific javascript for plugins if (isset($PLUGIN_HOOKS['add_javascript']) && count($PLUGIN_HOOKS['add_javascript'])) { foreach ($PLUGIN_HOOKS["add_javascript"] as $plugin => $files) { if (is_array($files)) { foreach ($files as $file) { echo "\n"; } } else { echo "\n"; } } } // Add specific css for plugins if (isset($PLUGIN_HOOKS['add_css']) && count($PLUGIN_HOOKS['add_css'])) { foreach ($PLUGIN_HOOKS["add_css"] as $plugin => $files) { if (is_array($files)) { foreach ($files as $file) { echo "\n"; } } else { echo "\n"; } } } // End of Head echo "\n"; } /** * Print a nice HTML head for every page * * @param $title title of the page * @param $url not used anymore (default '') * @param $sector sector in which the page displayed is (default 'none') * @param $item item corresponding to the page displayed (default 'none') * @param $option option corresponding to the page displayed (default '') **/ static function header($title, $url='', $sector="none", $item="none", $option="") { global $CFG_GLPI, $PLUGIN_HOOKS, $HEADER_LOADED, $DB; // Print a nice HTML-head for every page if ($HEADER_LOADED) { return; } $HEADER_LOADED = true; self::includeHeader($title); // Body echo ""; // Generate array for menu and check right // INVENTORY $showallassets = false; $menu['inventory']['title'] = __('Assets'); if (Session::haveRight("computer","r")) { $menu['inventory']['default'] = '/front/computer.php'; $menu['inventory']['content']['computer']['title'] = _n('Computer', 'Computers', 2); $menu['inventory']['content']['computer']['shortcut'] = 'o'; $menu['inventory']['content']['computer']['page'] = '/front/computer.php'; $menu['inventory']['content']['computer']['links']['search'] = '/front/computer.php'; if (Session::haveRight("computer","w")) { $menu['inventory']['content']['computer']['links']['add'] = '/front/setup.templates.php?'.'itemtype=Computer&add=1'; $menu['inventory']['content']['computer']['links']['template'] = '/front/setup.templates.php?'.'itemtype=Computer&add=0'; } $showallassets = true; } if (Session::haveRight("monitor","r")) { $menu['inventory']['content']['monitor']['title'] = _n('Monitor', 'Monitors', 2); $menu['inventory']['content']['monitor']['shortcut'] = ''; $menu['inventory']['content']['monitor']['page'] = '/front/monitor.php'; $menu['inventory']['content']['monitor']['links']['search'] = '/front/monitor.php'; if (Session::haveRight("monitor","w")) { $menu['inventory']['content']['monitor']['links']['add'] = '/front/setup.templates.php?'.'itemtype=Monitor&add=1'; $menu['inventory']['content']['monitor']['links']['template'] = '/front/setup.templates.php?'.'itemtype=Monitor&add=0'; } $showallassets = true; } if (Session::haveRight("software","r")) { $menu['inventory']['content']['software']['title'] = _n('Software', 'Software', 2); $menu['inventory']['content']['software']['shortcut'] = 's'; $menu['inventory']['content']['software']['page'] = '/front/software.php'; $menu['inventory']['content']['software']['links']['search'] = '/front/software.php'; if (Session::haveRight("software","w")) { $menu['inventory']['content']['software']['links']['add'] = '/front/setup.templates.php?'.'itemtype=Software&add=1'; $menu['inventory']['content']['software']['links']['template'] = '/front/setup.templates.php?'.'itemtype=Software&add=0'; } } if (Session::haveRight("networking","r")) { $menu['inventory']['content']['networking']['title'] = _n('Network', 'Networks', 2); $menu['inventory']['content']['networking']['shortcut'] = ''; $menu['inventory']['content']['networking']['page'] = '/front/networkequipment.php'; $menu['inventory']['content']['networking']['links']['search'] = '/front/networkequipment.php'; $menu['inventory']['content']['networking']['options']['networkport']['title'] = _n('Network port', 'Network ports', 2); $menu['inventory']['content']['networking']['options']['networkport']['page'] = '/front/networkport.form.php'; $menu['inventory']['content']['networking']['options']['networkport']['links'] = array(); if (Session::haveRight("networking","w")) { $menu['inventory']['content']['networking']['links']['add'] = '/front/setup.templates.php?'.'itemtype=NetworkEquipment&add=1'; $menu['inventory']['content']['networking']['links']['template'] = '/front/setup.templates.php?'.'itemtype=NetworkEquipment&add=0'; } $showallassets = true; } if (Session::haveRight("peripheral","r")) { $menu['inventory']['content']['peripheral']['title'] = _n('Device', 'Devices', 2); $menu['inventory']['content']['peripheral']['shortcut'] = ''; $menu['inventory']['content']['peripheral']['page'] = '/front/peripheral.php'; $menu['inventory']['content']['peripheral']['links']['search'] = '/front/peripheral.php'; if (Session::haveRight("peripheral","w")) { $menu['inventory']['content']['peripheral']['links']['add'] = '/front/setup.templates.php?'.'itemtype=Peripheral&add=1'; $menu['inventory']['content']['peripheral']['links']['template'] = '/front/setup.templates.php?'.'itemtype=Peripheral&add=0'; } $showallassets = true; } if (Session::haveRight("printer","r")) { $menu['inventory']['content']['printer']['title'] = _n('Printer', 'Printers', 2); $menu['inventory']['content']['printer']['shortcut'] = ''; $menu['inventory']['content']['printer']['page'] = '/front/printer.php'; $menu['inventory']['content']['printer']['links']['search'] = '/front/printer.php'; if (Session::haveRight("printer","w")) { $menu['inventory']['content']['printer']['links']['add'] = '/front/setup.templates.php?'.'itemtype=Printer&add=1'; $menu['inventory']['content']['printer']['links']['template'] = '/front/setup.templates.php?'.'itemtype=Printer&add=0'; } $showallassets = true; } if (Session::haveRight("cartridge","r")) { $menu['inventory']['content']['cartridge']['title'] = _n('Cartridge', 'Cartridges', 2); $menu['inventory']['content']['cartridge']['shortcut'] = ''; $menu['inventory']['content']['cartridge']['page'] = '/front/cartridgeitem.php'; $menu['inventory']['content']['cartridge']['links']['search'] = '/front/cartridgeitem.php'; if (Session::haveRight("cartridge","w")) { $menu['inventory']['content']['cartridge']['links']['add'] = '/front/cartridgeitem.form.php'; } } if (Session::haveRight("consumable","r")) { $menu['inventory']['content']['consumable']['title'] = _n('Consumable', 'Consumables', 2); $menu['inventory']['content']['consumable']['shortcut'] = ''; $menu['inventory']['content']['consumable']['page'] = '/front/consumableitem.php'; $menu['inventory']['content']['consumable']['links']['search'] = '/front/consumableitem.php'; if (Session::haveRight("consumable","w")) { $menu['inventory']['content']['consumable']['links']['add'] = '/front/consumableitem.form.php'; } $menu['inventory']['content']['consumable']['links']['summary'] = '/front/consumableitem.php?'.'synthese=yes'; } if (Session::haveRight("phone","r")) { $menu['inventory']['content']['phone']['title'] = _n('Phone', 'Phones', 2); $menu['inventory']['content']['phone']['shortcut'] = ''; $menu['inventory']['content']['phone']['page'] = '/front/phone.php'; $menu['inventory']['content']['phone']['links']['search'] = '/front/phone.php'; if (Session::haveRight("phone","w")) { $menu['inventory']['content']['phone']['links']['add'] = '/front/setup.templates.php?'.'itemtype=Phone&add=1'; $menu['inventory']['content']['phone']['links']['template'] = '/front/setup.templates.php?'.'itemtype=Phone&add=0'; } $showallassets = true; } if ($showallassets) { $menu['inventory']['content']['allassets']['title'] = __('Global'); $menu['inventory']['content']['allassets']['shortcut'] = ''; $menu['inventory']['content']['allassets']['page'] = '/front/allassets.php'; $menu['inventory']['content']['allassets']['links']['search'] = '/front/allassets.php'; } // ASSISTANCE $menu['maintain']['title'] = __('Assistance'); if (Session::haveRight("observe_ticket","1") || Session::haveRight("show_all_ticket","1") || Session::haveRight("create_ticket","1")) { $menu['maintain']['default'] = '/front/ticket.php'; $menu['maintain']['content']['ticket']['title'] = _n('Ticket', 'Tickets', 2); $menu['maintain']['content']['ticket']['shortcut'] = 't'; $menu['maintain']['content']['ticket']['page'] = '/front/ticket.php'; $menu['maintain']['content']['ticket']['links']['search'] = '/front/ticket.php'; if (Session::haveRight('tickettemplate', 'r')) { $menu['maintain']['content']['ticket']['options']['TicketTemplate']['title'] = _n('Ticket template', 'Ticket templates', 2); $menu['maintain']['content']['ticket']['options']['TicketTemplate']['page'] = '/front/tickettemplate.php'; $menu['maintain']['content']['ticket']['options']['TicketTemplate']['links']['search'] = '/front/tickettemplate.php'; if (Session::haveRight('tickettemplate', 'w')) { $menu['maintain']['content']['ticket']['options']['TicketTemplate']['links']['add'] = '/front/tickettemplate.form.php'; } $menu['maintain']['content']['ticket']['links']['template'] = '/front/tickettemplate.php'; } if (Session::haveRight('validate_incident', 1) || Session::haveRight('validate_request', 1)) { $opt = array(); $opt['reset'] = 'reset'; $opt['field'][0] = 55; // validation status $opt['searchtype'][0] = 'equals'; $opt['contains'][0] = 'waiting'; $opt['link'][0] = 'AND'; $opt['field'][1] = 59; // validation aprobator $opt['searchtype'][1] = 'equals'; $opt['contains'][1] = Session::getLoginUserID(); $opt['link'][1] = 'AND'; $pic_validate = "\""."; $menu['maintain']['content']['ticket']['links'][$pic_validate] = '/front/ticket.php?'.Toolbox::append_params($opt, '&'); } } if (Session::haveRight("create_ticket","1")) { $menu['maintain']['content']['ticket']['links']['add'] = '/front/ticket.form.php'; } if (Session::haveRight("show_all_problem","1") || Session::haveRight("show_my_problem","1") || Session::haveRight("delete_problem", "1")) { $menu['maintain']['content']['problem']['title'] = _n('Problem', 'Problems', 2); $menu['maintain']['content']['problem']['shortcut'] = ''; $menu['maintain']['content']['problem']['page'] = '/front/problem.php'; $menu['maintain']['content']['problem']['links']['search'] = '/front/problem.php'; if (Session::haveRight("edit_all_problem","1")) { $menu['maintain']['content']['problem']['links']['add'] = '/front/problem.form.php'; } } // if (Session::haveRight("show_all_change","1") // || Session::haveRight("show_my_change","1")) { // $menu['maintain']['content']['change']['title'] = _n('Change', 'Changes', 2); // $menu['maintain']['content']['change']['shortcut'] = ''; // $menu['maintain']['content']['change']['page'] = '/front/change.php'; // $menu['maintain']['content']['change']['links']['search'] = '/front/change.php'; // if (Session::haveRight("edit_all_change","1")) { // $menu['maintain']['content']['change']['links']['add'] = '/front/change.form.php'; // } // } if (Session::haveRight("show_planning","1") || Session::haveRight("show_all_planning","1") || Session::haveRight("show_group_planning","1")) { $menu['maintain']['content']['planning']['title'] = __('Planning'); $menu['maintain']['content']['planning']['shortcut'] = 'p'; $menu['maintain']['content']['planning']['page'] = '/front/planning.php'; $menu['maintain']['content']['planning']['links']['search'] = '/front/planning.php'; } if (Session::haveRight("statistic","1")) { $menu['maintain']['content']['stat']['title'] = __('Statistics'); $menu['maintain']['content']['stat']['shortcut'] = 'a'; $menu['maintain']['content']['stat']['page'] = '/front/stat.php'; } if (Session::haveRight("ticketrecurrent","r")) { $menu['maintain']['content']['ticketrecurrent']['title'] = __('Recurrent tickets'); $menu['maintain']['content']['ticketrecurrent']['shortcut'] = ''; $menu['maintain']['content']['ticketrecurrent']['page'] = '/front/ticketrecurrent.php'; $menu['maintain']['content']['ticketrecurrent']['links']['search'] = '/front/ticketrecurrent.php'; if (Session::haveRight("ticketrecurrent","w")) { $menu['maintain']['content']['ticketrecurrent']['links']['add'] = '/front/ticketrecurrent.form.php'; } } // FINANCIAL $menu['financial']['title'] = __('Management'); if (Session::haveRight("budget", "r")) { $menu['financial']['default'] = '/front/budget.php'; $menu['financial']['content']['budget']['title'] = _n('Budget', 'Budgets', 2); $menu['financial']['content']['budget']['shortcut'] = ''; $menu['financial']['content']['budget']['page'] = '/front/budget.php'; $menu['financial']['content']['budget']['links']['search'] = '/front/budget.php'; if (Session::haveRight("budget","w")) { $menu['financial']['content']['budget']['links']['add'] = '/front/setup.templates.php?'.'itemtype=Budget&add=1'; $menu['financial']['content']['budget']['links']['template'] = '/front/setup.templates.php?'.'itemtype=Budget&add=0'; } } if (Session::haveRight("contact_enterprise", "r")) { $menu['financial']['content']['supplier']['title'] = _n('Supplier', 'Suppliers', 2); $menu['financial']['content']['supplier']['shortcut'] = ''; $menu['financial']['content']['supplier']['page'] = '/front/supplier.php'; $menu['financial']['content']['supplier']['links']['search'] = '/front/supplier.php'; $menu['financial']['content']['contact']['title'] = _n('Contact', 'Contacts', 2); $menu['financial']['content']['contact']['shortcut'] = ''; $menu['financial']['content']['contact']['page'] = '/front/contact.php'; $menu['financial']['content']['contact']['links']['search'] = '/front/contact.php'; if (Session::haveRight("contact_enterprise", "w")) { $menu['financial']['content']['contact']['links']['add'] = '/front/contact.form.php'; $menu['financial']['content']['supplier']['links']['add'] = '/front/supplier.form.php'; } } if (Session::haveRight("contract", "r")) { $menu['financial']['content']['contract']['title'] = _n('Contract', 'Contracts', 2); $menu['financial']['content']['contract']['shortcut'] = ''; $menu['financial']['content']['contract']['page'] = '/front/contract.php'; $menu['financial']['content']['contract']['links']['search'] = '/front/contract.php'; if (Session::haveRight("contract", "w")) { $menu['financial']['content']['contract']['links']['add'] = '/front/setup.templates.php?itemtype=Contract&add=1'; $menu['financial']['content']['contract']['links']['template'] = '/front/setup.templates.php?itemtype=Contract&add=0'; } } if (Session::haveRight("document", "r")) { $menu['financial']['content']['document']['title'] = _n('Document', 'Documents', 2); $menu['financial']['content']['document']['shortcut'] = 'd'; $menu['financial']['content']['document']['page'] = '/front/document.php'; $menu['financial']['content']['document']['links']['search'] = '/front/document.php'; if (Session::haveRight("document","w")) { $menu['financial']['content']['document']['links']['add'] = '/front/document.form.php'; } } // UTILS $menu['utils']['title'] = __('Tools'); $menu['utils']['default'] = '/front/reminder.php'; if (Session::haveRight('reminder_public', 'r')) { $menu['utils']['content']['reminder']['title'] = _n('Reminder', 'Reminders', 2); } else { $menu['utils']['content']['reminder']['title'] = _n('Personal reminder', 'Personal reminders', 2); } $menu['utils']['content']['reminder']['page'] = '/front/reminder.php'; $menu['utils']['content']['reminder']['links']['search'] = '/front/reminder.php'; $menu['utils']['content']['reminder']['links']['add'] = '/front/reminder.form.php'; $menu['utils']['content']['rssfeed']['title'] = _n('RSS feed', 'RSS feeds', 2); $menu['utils']['content']['rssfeed']['page'] = '/front/rssfeed.php'; $menu['utils']['content']['rssfeed']['links']['search'] = '/front/rssfeed.php'; $menu['utils']['content']['rssfeed']['links']['add'] = '/front/rssfeed.form.php'; if (Session::haveRight("knowbase","r") || Session::haveRight("faq","r")) { if (Session::haveRight("knowbase","r")) { $menu['utils']['content']['knowbase']['title'] = __('Knowledge base'); } else { $menu['utils']['content']['knowbase']['title'] = __('FAQ'); } $menu['utils']['content']['knowbase']['shortcut'] = 'b'; $menu['utils']['content']['knowbase']['page'] = '/front/knowbaseitem.php'; $menu['utils']['content']['knowbase']['links']['search'] = '/front/knowbaseitem.php'; if (Session::haveRight("knowbase","w") || Session::haveRight("faq","w")) { $menu['utils']['content']['knowbase']['links']['add'] = '/front/knowbaseitem.form.php?id=new'; } } if (Session::haveRight("reservation_helpdesk","1") || Session::haveRight("reservation_central","r")) { $menu['utils']['content']['reservation']['title'] = _n('Reservation', 'Reservations', 2); $menu['utils']['content']['reservation']['shortcut'] = 'r'; $menu['utils']['content']['reservation']['page'] = '/front/reservationitem.php'; $menu['utils']['content']['reservation']['links']['search'] = '/front/reservationitem.php'; $menu['utils']['content']['reservation']['links']['showall'] = '/front/reservation.php'; } if (Session::haveRight("reports","r")) { $menu['utils']['content']['report']['title'] = _n('Report', 'Reports', 2); $menu['utils']['content']['report']['shortcut'] = 'e'; $menu['utils']['content']['report']['page'] = '/front/report.php'; } if (!isset($_SESSION['glpishowmigrationcleaner'])) { if (TableExists('glpi_networkportmigrations') && (countElementsInTable('glpi_networkportmigrations') > 0)) { $_SESSION['glpishowmigrationcleaner'] = true; } else { $_SESSION['glpishowmigrationcleaner'] = false; } } if ($_SESSION['glpishowmigrationcleaner'] && (Session::haveRight("networking", "w") || Session::haveRight("internet", "w"))) { $menu['utils']['content']['migration']['title'] = __('Migration cleaner'); $menu['utils']['content']['migration']['page'] = '/front/migration_cleaner.php'; $menu['utils']['content']['migration']['options']['networkportmigration']['title'] = __('Network port migration'); $menu['utils']['content']['migration']['options']['networkportmigration']['page'] = '/front/networkportmigration.php'; $menu['utils']['content']['migration']['options']['networkportmigration']['links']['search'] = '/front/networkportmigration.php'; } // PLUGINS if (isset($PLUGIN_HOOKS["menu_entry"]) && count($PLUGIN_HOOKS["menu_entry"])) { $menu['plugins']['title'] = __('Plugins'); $plugins = array(); foreach ($PLUGIN_HOOKS["menu_entry"] as $plugin => $active) { if ($active) { // true or a string $plugins[$plugin] = Plugin::getInfo($plugin); } } if (count($plugins)) { $list = array(); foreach ($plugins as $key => $val) { $list[$key] = $val["name"]; } asort($list); foreach ($list as $key => $val) { $menu['plugins']['content'][$key]['title'] = $val; $menu['plugins']['content'][$key]['page'] = '/plugins/'.$key.'/'; if (is_string($PLUGIN_HOOKS["menu_entry"][$key])) { $menu['plugins']['content'][$key]['page'] .= $PLUGIN_HOOKS["menu_entry"][$key]; } // Set default link for plugins if (!isset($menu['plugins']['default'])) { $menu['plugins']['default'] = $menu['plugins']['content'][$key]['page']; } if (($sector == "plugins") && ($item == $key)) { if (isset($PLUGIN_HOOKS["submenu_entry"][$key]) && is_array($PLUGIN_HOOKS["submenu_entry"][$key])) { foreach ($PLUGIN_HOOKS["submenu_entry"][$key] as $name => $link) { // New complete option management if ($name == "options") { $menu['plugins']['content'][$key]['options'] = $link; } else { // Keep it for compatibility if (is_array($link)) { // Simple link option if (isset($link[$option])) { $menu['plugins']['content'][$key]['links'][$name] ='/plugins/'.$key.'/'.$link[$option]; } } else { $menu['plugins']['content'][$key]['links'][$name] ='/plugins/'.$key.'/'.$link; } } } } } } } } /// ADMINISTRATION $menu['admin']['title'] = __('Administration'); if (Session::haveRight("user","r")) { $menu['admin']['default'] = '/front/user.php'; $menu['admin']['content']['user']['title'] = _n('User', 'Users', 2); $menu['admin']['content']['user']['shortcut'] = 'u'; $menu['admin']['content']['user']['page'] = '/front/user.php'; $menu['admin']['content']['user']['links']['search'] = '/front/user.php'; if (Session::haveRight("user","w")) { $menu['admin']['content']['user']['links']['add'] = "/front/user.form.php"; } $menu['admin']['content']['user']['options']['ldap']['title'] = _n('LDAP directory', 'LDAP directories', 2); $menu['admin']['content']['user']['options']['ldap']['page'] = "/front/ldap.php"; } if (Session::haveRight("group","r")) { $menu['admin']['content']['group']['title'] = _n('Group', 'Groups', 2); $menu['admin']['content']['group']['shortcut'] = 'g'; $menu['admin']['content']['group']['page'] = '/front/group.php'; $menu['admin']['content']['group']['links']['search'] = '/front/group.php'; if (Session::haveRight("group","w")) { $menu['admin']['content']['group']['links']['add'] = "/front/group.form.php"; $menu['admin']['content']['group']['options']['ldap']['title'] = _n('LDAP directory', 'LDAP directories', 2); $menu['admin']['content']['group']['options']['ldap']['page'] = "/front/ldap.group.php"; } } if (Session::haveRight("entity","r")) { $menu['admin']['content']['entity']['title'] = _n('Entity', 'Entities', 2); $menu['admin']['content']['entity']['shortcut'] = ''; $menu['admin']['content']['entity']['page'] = '/front/entity.php'; $menu['admin']['content']['entity']['links']['search'] = '/front/entity.php'; $menu['admin']['content']['entity']['links']['add'] = "/front/entity.form.php"; } if (Session::haveRight("rule_ldap","r") || Session::haveRight("rule_import","r") || Session::haveRight("entity_rule_ticket","r") || Session::haveRight("rule_softwarecategories","r") || Session::haveRight("rule_mailcollector","r")) { $menu['admin']['content']['rule']['title'] = _n('Rule', 'Rules', 2); $menu['admin']['content']['rule']['shortcut'] = ''; $menu['admin']['content']['rule']['page'] = '/front/rule.php'; if (($sector == 'admin') && ($item == 'rule')) { foreach ($CFG_GLPI["rulecollections_types"] as $rulecollectionclass) { $rulecollection = new $rulecollectionclass(); if ($rulecollection->canList()) { $ruleclassname = $rulecollection->getRuleClassName(); $menu['admin']['content']['rule']['options'][$rulecollection->menu_option]['title'] = $rulecollection->getRuleClass()->getTitle(); $menu['admin']['content']['rule']['options'][$rulecollection->menu_option]['page'] = Toolbox::getItemTypeSearchURL($ruleclassname, false); $menu['admin']['content']['rule']['options'][$rulecollection->menu_option]['links']['search'] = Toolbox::getItemTypeSearchURL($ruleclassname, false); if ($rulecollection->canCreate()) { $menu['admin']['content']['rule']['options'][$rulecollection->menu_option]['links']['add'] = Toolbox::getItemTypeFormURL($ruleclassname, false); } } } } } if (Session::haveRight("transfer","r" ) && Session::isMultiEntitiesMode()) { $menu['admin']['content']['rule']['options']['transfer']['title'] = __('Transfer'); $menu['admin']['content']['rule']['options']['transfer']['page'] = "/front/transfer.php"; $menu['admin']['content']['rule']['options']['transfer']['links']['search'] = "/front/transfer.php"; if (Session::haveRight("transfer","w")) { $menu['admin']['content']['rule']['options']['transfer']['links']['summary'] = "/front/transfer.action.php"; $menu['admin']['content']['rule']['options']['transfer']['links']['add'] = "/front/transfer.form.php"; } } if (Session::haveRight("rule_dictionnary_dropdown","r") || Session::haveRight("rule_dictionnary_software","r") || Session::haveRight("rule_dictionnary_printer","r")) { $menu['admin']['content']['dictionnary']['title'] = __('Dictionaries'); $menu['admin']['content']['dictionnary']['shortcut'] = ''; $menu['admin']['content']['dictionnary']['page'] = '/front/dictionnary.php'; if (($sector == 'admin') && ($item == 'dictionnary')) { $menu['admin']['content']['dictionnary']['options']['manufacturers']['title'] = _n('Manufacturer', 'Manufacturers', 2); $menu['admin']['content']['dictionnary']['options']['manufacturers']['page'] = '/front/ruledictionnarymanufacturer.php'; $menu['admin']['content']['dictionnary']['options']['manufacturers']['links']['search'] = '/front/ruledictionnarymanufacturer.php'; if (Session::haveRight("rule_dictionnary_dropdown","w")) { $menu['admin']['content']['dictionnary']['options']['manufacturers']['links']['add'] = '/front/ruledictionnarymanufacturer.form.php'; } $menu['admin']['content']['dictionnary']['options']['software']['title'] = _n('Software', 'Software', 2); $menu['admin']['content']['dictionnary']['options']['software']['page'] = '/front/ruledictionnarysoftware.php'; $menu['admin']['content']['dictionnary']['options']['software']['links']['search'] = '/front/ruledictionnarysoftware.php'; if (Session::haveRight("rule_dictionnary_software","w")) { $menu['admin']['content']['dictionnary']['options']['software']['links']['add'] = '/front/ruledictionnarysoftware.form.php'; } $menu['admin']['content']['dictionnary']['options']['model.computer']['title'] = _n('Computer model', 'Computer models', 2); $menu['admin']['content']['dictionnary']['options']['model.computer']['page'] = '/front/ruledictionnarycomputermodel.php'; $menu['admin']['content']['dictionnary']['options']['model.computer']['links']['search'] = '/front/ruledictionnarycomputermodel.php'; if (Session::haveRight("rule_dictionnary_dropdown","w")) { $menu['admin']['content']['dictionnary']['options']['model.computer']['links']['add'] = '/front/ruledictionnarycomputermodel.form.php'; } $menu['admin']['content']['dictionnary']['options']['model.monitor']['title'] = _n('Monitor model', 'Monitor models', 2); $menu['admin']['content']['dictionnary']['options']['model.monitor']['page'] = '/front/ruledictionnarymonitormodel.php'; $menu['admin']['content']['dictionnary']['options']['model.monitor']['links']['search'] = '/front/ruledictionnarymonitormodel.php'; if (Session::haveRight("rule_dictionnary_dropdown","w")) { $menu['admin']['content']['dictionnary']['options']['model.monitor']['links']['add'] = '/front/ruledictionnarymonitormodel.form.php'; } $menu['admin']['content']['dictionnary']['options']['model.printer']['title'] = _n('Printer model', 'Printer models', 2); $menu['admin']['content']['dictionnary']['options']['model.printer']['page'] = '/front/ruledictionnaryprintermodel.php'; $menu['admin']['content']['dictionnary']['options']['model.printer']['links']['search'] = '/front/ruledictionnaryprintermodel.php'; if (Session::haveRight("rule_dictionnary_dropdown","w")) { $menu['admin']['content']['dictionnary']['options']['model.printer']['links']['add'] = '/front/ruledictionnaryprintermodel.form.php'; } $menu['admin']['content']['dictionnary']['options']['model.peripheral']['title'] = _n('Peripheral model', 'Peripheral models', 2); $menu['admin']['content']['dictionnary']['options']['model.peripheral']['page'] = '/front/ruledictionnaryperipheralmodel.php'; $menu['admin']['content']['dictionnary']['options']['model.peripheral']['links']['search'] = '/front/ruledictionnaryperipheralmodel.php'; if (Session::haveRight("rule_dictionnary_dropdown","w")) { $menu['admin']['content']['dictionnary']['options']['model.peripheral']['links']['add'] = '/front/ruledictionnaryperipheralmodel.form.php'; } $menu['admin']['content']['dictionnary']['options']['model.networking']['title'] = _n('Networking equipment model', 'Networking equipment models', 2); $menu['admin']['content']['dictionnary']['options']['model.networking']['page'] = '/front/ruledictionnarynetworkequipmentmodel.php'; $menu['admin']['content']['dictionnary']['options']['model.networking']['links']['search'] = '/front/ruledictionnarynetworkequipmentmodel.php'; if (Session::haveRight("rule_dictionnary_dropdown","w")) { $menu['admin']['content']['dictionnary']['options']['model.networking']['links']['add'] = '/front/ruledictionnarynetworkequipmentmodel.form.php'; } $menu['admin']['content']['dictionnary']['options']['model.phone']['title'] = _n('Phone model', 'Phone models', 2); $menu['admin']['content']['dictionnary']['options']['model.phone']['page'] = '/front/ruledictionnaryphonemodel.php'; $menu['admin']['content']['dictionnary']['options']['model.phone']['links']['search'] = '/front/ruledictionnaryphonemodel.php'; if (Session::haveRight("rule_dictionnary_dropdown","w")) { $menu['admin']['content']['dictionnary']['options']['model.phone']['links']['add'] = '/front/ruledictionnaryphonemodel.form.php'; } $menu['admin']['content']['dictionnary']['options']['type.computer']['title'] = _n('Computer type', 'Computer types', 2); $menu['admin']['content']['dictionnary']['options']['type.computer']['page'] = '/front/ruledictionnarycomputertype.php'; $menu['admin']['content']['dictionnary']['options']['type.computer']['links']['search'] = '/front/ruledictionnarycomputertype.php'; if (Session::haveRight("rule_dictionnary_dropdown","w")) { $menu['admin']['content']['dictionnary']['options']['type.computer']['links']['add'] = '/front/ruledictionnarycomputertype.form.php'; } $menu['admin']['content']['dictionnary']['options']['type.monitor']['title'] = _n('Monitor type', 'Monitors types', 2); $menu['admin']['content']['dictionnary']['options']['type.monitor']['page'] = '/front/ruledictionnarymonitortype.php'; $menu['admin']['content']['dictionnary']['options']['type.monitor']['links']['search'] = '/front/ruledictionnarymonitortype.php'; if (Session::haveRight("rule_dictionnary_dropdown","w")) { $menu['admin']['content']['dictionnary']['options']['type.monitor']['links']['add'] = '/front/ruledictionnarymonitortype.form.php'; } $menu['admin']['content']['dictionnary']['options']['type.printer']['title'] = _n('Printer type', 'Printer types', 2); $menu['admin']['content']['dictionnary']['options']['type.printer']['page'] = '/front/ruledictionnaryprintertype.php'; $menu['admin']['content']['dictionnary']['options']['type.printer']['links']['search'] = '/front/ruledictionnaryprintertype.php'; if (Session::haveRight("rule_dictionnary_dropdown","w")) { $menu['admin']['content']['dictionnary']['options']['type.printer']['links']['add'] = '/front/ruledictionnaryprintertype.form.php'; } $menu['admin']['content']['dictionnary']['options']['type.peripheral']['title'] = _n('Peripheral type', 'Peripheral types', 2); $menu['admin']['content']['dictionnary']['options']['type.peripheral']['page'] = '/front/ruledictionnaryperipheraltype.php'; $menu['admin']['content']['dictionnary']['options']['type.peripheral']['links']['search'] = '/front/ruledictionnaryperipheraltype.php'; if (Session::haveRight("rule_dictionnary_dropdown","w")) { $menu['admin']['content']['dictionnary']['options']['type.peripheral']['links']['add'] = '/front/ruledictionnaryperipheraltype.form.php'; } $menu['admin']['content']['dictionnary']['options']['type.networking']['title'] = _n('Networking equipment type', 'Networking equipment types', 2); $menu['admin']['content']['dictionnary']['options']['type.networking']['page'] = '/front/ruledictionnarynetworkequipmenttype.php'; $menu['admin']['content']['dictionnary']['options']['type.networking']['links']['search'] = '/front/ruledictionnarynetworkequipmenttype.php'; if (Session::haveRight("rule_dictionnary_dropdown","w")) { $menu['admin']['content']['dictionnary']['options']['type.networking']['links']['add'] = '/front/ruledictionnarynetworkequipmenttype.form.php'; } $menu['admin']['content']['dictionnary']['options']['type.phone']['title'] = _n('Phone type', 'Phone types', 2); $menu['admin']['content']['dictionnary']['options']['type.phone']['page'] = '/front/ruledictionnaryphonetype.php'; $menu['admin']['content']['dictionnary']['options']['type.phone']['links']['search'] = '/front/ruledictionnaryphonetype.php'; if (Session::haveRight("rule_dictionnary_dropdown","w")) { $menu['admin']['content']['dictionnary']['options']['type.phone']['links']['add'] = '/front/ruledictionnaryphonetype.form.php'; } $menu['admin']['content']['dictionnary']['options']['os']['title'] = __('Operating system'); $menu['admin']['content']['dictionnary']['options']['os']['page'] = '/front/ruledictionnaryoperatingsystem.php'; $menu['admin']['content']['dictionnary']['options']['os']['links']['search'] = '/front/ruledictionnaryoperatingsystem.php'; if (Session::haveRight("rule_dictionnary_dropdown","w")) { $menu['admin']['content']['dictionnary']['options']['os']['links']['add'] = '/front/ruledictionnaryoperatingsystem.form.php'; } $menu['admin']['content']['dictionnary']['options']['os_sp']['title'] = __('Service pack'); $menu['admin']['content']['dictionnary']['options']['os_sp']['page'] = '/front/ruledictionnaryoperatingsystemservicepack.php'; $menu['admin']['content']['dictionnary']['options']['os_sp']['links']['search'] = '/front/ruledictionnaryoperatingsystemservicepack.php'; if (Session::haveRight("rule_dictionnary_dropdown","w")) { $menu['admin']['content']['dictionnary']['options']['os_sp']['links']['add'] = '/front/ruledictionnaryoperatingsystemservicepack.form.php'; } $menu['admin']['content']['dictionnary']['options']['os_version']['title'] = __('Version of the operating system'); $menu['admin']['content']['dictionnary']['options']['os_version']['page'] = '/front/ruledictionnaryoperatingsystemversion.php'; $menu['admin']['content']['dictionnary']['options']['os_version']['links']['search'] = '/front/ruledictionnaryoperatingsystemversion.php'; if (Session::haveRight("rule_dictionnary_dropdown","w")) { $menu['admin']['content']['dictionnary']['options']['os_version']['links']['add'] = '/front/ruledictionnaryoperatingsystemversion.form.php'; } $menu['admin']['content']['dictionnary']['options']['printer']['title'] = _n('Printer', 'Printers', 2); $menu['admin']['content']['dictionnary']['options']['printer']['page'] = '/front/ruledictionnaryprinter.php'; $menu['admin']['content']['dictionnary']['options']['printer']['links']['search'] = '/front/ruledictionnaryprinter.php'; if (Session::haveRight("rule_dictionnary_printer","w")) { $menu['admin']['content']['dictionnary']['options']['printer']['links']['add'] = '/front/ruledictionnaryprinter.form.php'; } } } if (Session::haveRight("profile","r")) { $menu['admin']['content']['profile']['title'] = _n('Profile', 'Profiles', 2); $menu['admin']['content']['profile']['shortcut'] = ''; $menu['admin']['content']['profile']['page'] = '/front/profile.php'; $menu['admin']['content']['profile']['links']['search'] = "/front/profile.php"; if (Session::haveRight("profile","w")) { $menu['admin']['content']['profile']['links']['add'] = "/front/profile.form.php"; } } if (Session::haveRight("backup","w")) { $menu['admin']['content']['backup']['title'] = __('Maintenance'); $menu['admin']['content']['backup']['shortcut'] = ''; $menu['admin']['content']['backup']['page'] = '/front/backup.php'; } if (Session::haveRight("logs","r")) { $menu['admin']['content']['log']['title'] = _n('Log', 'Logs', 2); $menu['admin']['content']['log']['shortcut'] = ''; $menu['admin']['content']['log']['page'] = '/front/event.php'; } /// CONFIG $config = array(); $addconfig = array(); $menu['config']['title'] = __('Setup'); if (Session::haveRight("dropdown","r") || Session::haveRight("entity_dropdown","r") || Session::haveRight("internet","r")) { $menu['config']['content']['dropdowns']['title'] = _n('Dropdown', 'Dropdowns', 2); $menu['config']['content']['dropdowns']['shortcut'] = 'n'; $menu['config']['content']['dropdowns']['page'] = '/front/dropdown.php'; $menu['config']['default'] = '/front/dropdown.php'; if ($item == "dropdowns") { $dps = Dropdown::getStandardDropdownItemTypes(); foreach ($dps as $tab) { foreach ($tab as $key => $val) { if ($key == $option) { if ($tmp = getItemForItemtype($key)) { $menu['config']['content']['dropdowns']['options'][$option]['title'] = $val; $menu['config']['content']['dropdowns']['options'][$option]['page'] = $tmp->getSearchURL(false); $menu['config']['content']['dropdowns']['options'][$option]['links']['search'] = $tmp->getSearchURL(false); if ($tmp->canCreate()) { $menu['config']['content']['dropdowns']['options'][$option]['links']['add'] = $tmp->getFormURL(false); } } } } } } } if (Session::haveRight("device","w")) { $menu['config']['content']['device']['title'] = _n('Component', 'Components', 2); $menu['config']['content']['device']['page'] = '/front/device.php'; if ($item == "device") { $dps = Dropdown::getDeviceItemTypes(); foreach ($dps as $tab) { foreach ($tab as $key => $val) { if ($key == $option) { if ($tmp = getItemForItemtype($key)) { $menu['config']['content']['device']['options'][$option]['title'] = $val; $menu['config']['content']['device']['options'][$option]['page'] = $tmp->getSearchURL(false); $menu['config']['content']['device']['options'][$option]['links']['search'] = $tmp->getSearchURL(false); if ($tmp->canCreate()) { $menu['config']['content']['device']['options'][$option]['links']['add'] = $tmp->getFormURL(false); } } } } } } } if (($CFG_GLPI['use_mailing'] && Session::haveRight("notification","r")) || Session::haveRight("config","w")) { $menu['config']['content']['mailing']['title'] = _n('Notification', 'Notifications', 2); $menu['config']['content']['mailing']['page'] = '/front/setup.notification.php'; $menu['config']['content']['mailing']['options']['notification']['title'] = _n('Notification', 'Notifications', 2); $menu['config']['content']['mailing']['options']['notification']['page'] = '/front/notification.php'; $menu['config']['content']['mailing']['options']['notification']['links']['add'] = '/front/notification.form.php'; $menu['config']['content']['mailing']['options']['notification']['links']['search'] = '/front/notification.php'; } if (Session::haveRight("sla","r")) { $menu['config']['content']['sla']['title'] = _n('SLA', 'SLA', 2); $menu['config']['content']['sla']['page'] = '/front/sla.php'; $menu['config']['content']['sla']['links']['search'] = "/front/sla.php"; if (Session::haveRight("sla","w")) { $menu['config']['content']['sla']['links']['add'] = "/front/sla.form.php"; } } if (Session::haveRight("config","w")) { //TRANS: menu title for "General setup"" $menu['config']['content']['config']['title'] = _x('setup', 'General'); $menu['config']['content']['config']['page'] = '/front/config.form.php'; $menu['config']['content']['control']['title'] = _n('Check', 'Checks', 2); $menu['config']['content']['control']['page'] = '/front/control.php'; $menu['config']['content']['control']['options']['FieldUnicity']['title'] = __('Fields unicity'); $menu['config']['content']['control']['options']['FieldUnicity']['page'] = '/front/fieldunicity.php'; $menu['config']['content']['control']['options']['FieldUnicity']['links']['add'] = '/front/fieldunicity.form.php'; $menu['config']['content']['control']['options']['FieldUnicity']['links']['search'] = '/front/fieldunicity.php'; $menu['config']['content']['crontask']['title'] = _n('Automatic action', 'Automatic actions', 2); $menu['config']['content']['crontask']['page'] = '/front/crontask.php'; $menu['config']['content']['crontask']['links']['search'] = "/front/crontask.php"; $menu['config']['content']['mailing']['options']['config']['title'] = __('Email'); $menu['config']['content']['mailing']['options']['config']['page'] = '/front/notificationmailsetting.form.php'; $menu['config']['content']['mailing']['options']['notificationtemplate']['title'] = _n('Notification template', 'Notification templates', 2); $menu['config']['content']['mailing']['options']['notificationtemplate']['page'] = '/front/notificationtemplate.php'; $menu['config']['content']['mailing']['options']['notificationtemplate']['links']['add'] = '/front/notificationtemplate.form.php'; $menu['config']['content']['mailing']['options']['notificationtemplate']['links']['search'] = '/front/notificationtemplate.php'; $menu['config']['content']['extauth']['title'] = __('Authentication'); $menu['config']['content']['extauth']['page'] = '/front/setup.auth.php'; $menu['config']['content']['extauth']['options']['ldap']['title'] = _n('LDAP directory', 'LDAP directories', 2); $menu['config']['content']['extauth']['options']['ldap']['page'] = '/front/authldap.php'; $menu['config']['content']['extauth']['options']['imap']['title'] = _n('Mail server', 'Mail servers', 2); $menu['config']['content']['extauth']['options']['imap']['page'] = '/front/authmail.php'; $menu['config']['content']['extauth']['options']['others']['title'] = __('Others'); $menu['config']['content']['extauth']['options']['others']['page'] = '/front/auth.others.php'; $menu['config']['content']['extauth']['options']['settings']['title'] = __('Setup'); $menu['config']['content']['extauth']['options']['settings']['page'] = '/front/auth.settings.php'; switch ($option) { case "ldap" : // LDAP $menu['config']['content']['extauth']['options']['ldap']['links']['search'] = '/front/authldap.php'; $menu['config']['content']['extauth']['options']['ldap']['links']['add'] = '' .'/front/authldap.form.php'; break; case "imap" : // IMAP $menu['config']['content']['extauth']['links']['search'] = '/front/authmail.php'; $menu['config']['content']['extauth']['links']['add'] = '' .'/front/authmail.form.php'; break; } $menu['config']['content']['mailcollector']['title'] = _n('Receiver', 'Receivers', 2); $menu['config']['content']['mailcollector']['page'] = '/front/mailcollector.php'; if (Toolbox::canUseImapPop()) { $menu['config']['content']['mailcollector']['links']['search'] = '/front/mailcollector.php'; $menu['config']['content']['mailcollector']['links']['add'] = '/front/mailcollector.form.php'; $menu['config']['content']['mailcollector']['options']['rejectedemails']['links']['search'] = '/front/notimportedemail.php'; } } if (Session::haveRight("link","r")) { $menu['config']['content']['link']['title'] = _n('External link', 'External links', 2); $menu['config']['content']['link']['page'] = '/front/link.php'; $menu['config']['content']['link']['hide'] = true; $menu['config']['content']['link']['links']['search'] = '/front/link.php'; if (Session::haveRight("link","w")) { $menu['config']['content']['link']['links']['add'] = "/front/link.form.php"; } } if (Session::haveRight("config","w")) { $menu['config']['content']['plugins']['title'] = __('Plugins'); $menu['config']['content']['plugins']['page'] = '/front/plugin.php'; } // Special items $menu['preference']['title'] = __('My settings'); $menu['preference']['default'] = '/front/preference.php'; $already_used_shortcut = array('1'); echo ""; ///Main menu echo "
"; echo ""; echo "
"; echo "
"; // End navigation bar // End headline // Le sous menu contextuel 1 echo "
"; echo "
    "; // list sous-menu item if (isset($menu[$sector])) { if (isset($menu[$sector]['content']) && is_array($menu[$sector]['content'])) { $ssmenu = $menu[$sector]['content']; if (count($ssmenu) > 12) { foreach ($ssmenu as $key => $val) { if (isset($val['hide'])) { unset($ssmenu[$key]); } } $ssmenu = array_splice($ssmenu,0,12); } foreach ($ssmenu as $key => $val) { if (isset($val['page']) && isset($val['title'])) { echo "
  • ".Toolbox::shortcut($val['title'], $val['shortcut'])."
  • \n"; } else { echo ">".$val['title']."\n"; } } } } else { echo "
  •  
  • "; } } else { echo "
  •  
  • "; } echo "
"; // Le fil d ariane echo "
"; echo "
    "; // Display item echo "
  • ". __('Home')." >
  • "; if (isset($menu[$sector])) { $link = "/front/central.php"; if (isset($menu[$sector]['default'])) { $link = $menu[$sector]['default']; } echo "
  • ". $menu[$sector]['title']." >
  • "; } if (isset($menu[$sector]['content'][$item])) { // Title $with_option = false; if (!empty($option) && isset($menu[$sector]['content'][$item]['options'][$option]['title']) && isset($menu[$sector]['content'][$item]['options'][$option]['page'])) { $with_option = true; } if (isset($menu[$sector]['content'][$item]['page'])) { echo "
  • ". $menu[$sector]['content'][$item]['title']."".(!$with_option?"":" > "). "
  • "; } if ($with_option) { echo "
  • "; echo self::resume_name($menu[$sector]['content'][$item]['options'][$option]['title'], 17); echo "
  • "; } echo "
  •           
  • "; $links = array(); // Item with Option case if (!empty($option) && isset($menu[$sector]['content'][$item]['options'][$option]['links']) && is_array($menu[$sector]['content'][$item]['options'][$option]['links'])) { $links = $menu[$sector]['content'][$item]['options'][$option]['links']; // Without option case : only item links } else if (isset($menu[$sector]['content'][$item]['links']) && is_array($menu[$sector]['content'][$item]['links'])) { $links = $menu[$sector]['content'][$item]['links']; } // Add item echo "
  • "; if (isset($links['add'])) { echo ""; echo "\""."; } else { echo "\""."; } echo "
  • "; // Search Item if (isset($links['search'])) { echo "
  • "; echo "\"".__s('Search')."\"
  • "; } else { echo "
  • \"".__s('Search')."\"
  • "; } // Links if (count($links) > 0) { foreach ($links as $key => $val) { switch ($key) { case "add" : case "search" : break; case "template" : echo "
  • \"".__s('Manage". "
  • "; break; case "showall" : echo "
  • \"".__s('Show
  • "; break; case "summary" : echo "
  • \"".__s('Summary')."\"
  • "; break; case "config" : echo "
  • \"".__s('Setup')."\"
  • "; break; default : echo "
  • ".$key."
  • "; break; } } } } else { echo "
  •           
  • "; echo "
  •              ". "    
  • "; } // Add common items echo "
  • "; // Display MENU ALL echo "
    "; $items_per_columns = 15; $i = -1; echo "
    "; foreach ($menu as $part => $data) { if (isset($data['content']) && count($data['content'])) { if ($i > $items_per_columns) { $i = 0; echo "
    "; } $link = "#"; if (isset($data['default']) && !empty($data['default'])) { $link = $CFG_GLPI["root_doc"].$data['default']; } echo ""; $i++; // list menu item foreach ($data['content'] as $key => $val) { if ($i > $items_per_columns) { $i = 0; echo "
    "; echo "".$data['title'].""; echo "
    "; } if (isset($val['page']) && isset($val['title'])) { echo "\n"; $i++; } } } } echo "
    ".$val['title']."
    "; echo "
    "; echo "        "; echo "
  • "; /// Bookmark load echo "
  • "; echo ""; echo "\"".__s('Load"; echo "
  • "; /// MENU ALL echo "
  • "; echo ""; echo "
  • "; // check user id : header used for display messages when session logout if (Session::getLoginUserID()) { self::showProfileSelecter($CFG_GLPI["root_doc"]."/front/central.php"); } echo "
"; echo "
"; echo "\n"; // fin header echo "
"; if ($DB->isSlave() && !$DB->first_connection) { echo ""; } // call static function callcron() every 5min CronTask::callCron(); self::displayMessageAfterRedirect(); } /** * Print footer for every page * * @param $keepDB booleen, closeDBConnections if false (false by default) **/ static function footer($keepDB=false) { global $CFG_GLPI, $FOOTER_LOADED, $TIMER_DEBUG; // Print foot for every page if ($FOOTER_LOADED) { return; } $FOOTER_LOADED = true; echo "
"; // fin de la div id ='page' initiée dans la fonction header echo ""; if ($_SESSION['glpi_use_mode'] == Session::TRANSLATION_MODE) { // debug mode traduction echo "
"; echo "GLPI MODE TRANSLATION"; echo "
"; } if ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) { // mode debug echo "
"; echo "GLPI MODE DEBUG"; echo "
"; } self::displayDebugInfos(); echo ""; if (!$keepDB) { closeDBConnections(); } } /** * Display Ajax Footer for debug **/ static function ajaxFooter() { if ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) { // mode debug $rand = mt_rand(); echo "
"; echo " AJAX DEBUG"; if (!isset($_POST['full_page_tab']) && strstr($_SERVER['REQUEST_URI'], '/ajax/common.tabs.php')) { echo "    "; Html::showSimpleForm($_SERVER['REQUEST_URI'], 'full_page_tab', 'Display only tab for debug', $_POST); } echo "
"; echo "
"; self::displayDebugInfos(false); echo "
"; } } /** * Print a simple HTML head with links * * @param $title title of the page * @param $links array of links to display **/ static function simpleHeader($title, $links=array()) { global $CFG_GLPI, $HEADER_LOADED; // Print a nice HTML-head for help page if ($HEADER_LOADED) { return; } $HEADER_LOADED = true; self::includeHeader($title); // Body echo ""; // Main Headline echo ""; // fin header echo "
"; // call static function callcron() every 5min CronTask::callCron(); } /** * Print a nice HTML head for help page * * @param $title title of the page * @param $url not used anymore (default '') **/ static function helpHeader($title, $url='') { global $CFG_GLPI, $HEADER_LOADED, $PLUGIN_HOOKS; // Print a nice HTML-head for help page if ($HEADER_LOADED) { return; } $HEADER_LOADED = true; self::includeHeader($title); // Body echo ""; // Main Headline echo ""; // fin header echo "
"; // call static function callcron() every 5min CronTask::callCron(); self::displayMessageAfterRedirect(); } /** * Print footer for help page **/ static function helpFooter() { global $CFG_GLPI, $FOOTER_LOADED; // Print foot for help page if ($FOOTER_LOADED) { return; } $FOOTER_LOADED = true; echo "
"; // fin de la div id ='page' initiée dans la fonction header echo ""; if ($_SESSION['glpi_use_mode'] == Session::TRANSLATION_MODE) { // debug mode traduction echo "
"; echo "GLPI MODE TRANSLATION"; echo "
"; } if ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) { // mode debug echo "
"; echo "GLPI MODE DEBUG"; echo "
"; } self::displayDebugInfos(); echo ""; closeDBConnections(); } /** * Print a nice HTML head with no controls * * @param $title title of the page * @param $url not used anymore (default '') **/ static function nullHeader($title, $url='') { global $CFG_GLPI, $HEADER_LOADED; if ($HEADER_LOADED) { return; } $HEADER_LOADED = true; // Print a nice HTML-head with no controls // Detect root_doc in case of error Config::detectRootDoc(); // Send UTF8 Headers header("Content-Type: text/html; charset=UTF-8"); // Send extra expires header if configured self::header_nocache(); if (isCommandLine()) { return true; } self::includeHeader($title); // Body with configured stuff echo ""; echo "
"; echo "
"; echo "
"; } /** * Print footer for null page **/ static function nullFooter() { global $CFG_GLPI, $FOOTER_LOADED; // Print foot for null page if ($FOOTER_LOADED) { return; } $FOOTER_LOADED = true; if (!isCommandLine()) { echo "
"; echo ""; echo ""; } closeDBConnections(); } /** * Print a nice HTML head for popup window (nothing to display) * * @param $title title of the page * @param $url not used anymore (default '') **/ static function popHeader($title, $url='') { global $CFG_GLPI, $PLUGIN_HOOKS, $HEADER_LOADED; // Print a nice HTML-head for every page if ($HEADER_LOADED) { return; } $HEADER_LOADED = true; self::includeHeader($title); // Body echo ""; self::displayMessageAfterRedirect(); } /** * Print footer for a popup window **/ static function popFooter() { global $FOOTER_LOADED; if ($FOOTER_LOADED) { return; } $FOOTER_LOADED = true; // Print foot echo ""; } /** * Flush the current displayed items (do not works really fine) **/ static function glpi_flush() { flush(); if (function_exists("ob_flush") && (ob_get_length() !== FALSE)) { ob_flush(); } } /** * Set page not to use the cache **/ static function header_nocache() { header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date du passe } /** * show arrow for massives actions : opening * * @param $formname string * @param $fixed boolean used tab_cadre_fixe in both tables (false by default) * @param $ontop display on top of the list (false by default) * @param $onright display on right of the list (false by default) * \deprecated no more used. Use new massive actions system **/ static function openArrowMassives($formname, $fixed=false, $ontop=false, $onright=false) { global $CFG_GLPI; if ($fixed) { echo ""; } else { echo "
"; } echo ""; if (!$onright) { echo ""; } else { echo ""; } echo ""; echo ""; echo ""; if ($onright) { echo ""; echo "
"; echo "".__('Check all')."/"; echo "".__('Uncheck all').""; } else { echo ""; } } /** * show arrow for massives actions : closing * * @param $actions array of action : $name -> $label * @param $confirm array of confirmation string (optional) * \deprecated no more used. Use new massive actions system **/ static function closeArrowMassives($actions, $confirm=array()) { if (count($actions)) { foreach ($actions as $name => $label) { if (!empty($name)) { echo " "; } } } echo "
"; } /** * Display "check All as" checkbox * * @since version 0.84 * * @param $container_id string html of the container of checkboxes link to this check all checkbox * @param $rand string rand value to use (default is auto generated) * * @return nothing / display item **/ static function checkAllAsCheckbox($container_id, $rand='') { echo Html::getCheckAllAsCheckbox($container_id, $rand); } /** * Get "check All as" checkbox * * @since version 0.84 * * @param $container_id string html of the container of checkboxes link to this check all checkbox * @param $rand string rand value to use (default is auto generated) * * @return Get checkbox string **/ static function getCheckAllAsCheckbox($container_id, $rand='') { if (empty($rand)) { $rand = mt_rand(); } $out = ""; return $out; } /** * Get the massive action checkbox * * @since version 0.84 * * @param $itemtype Massive action itemtype * @param $id ID of the item * * @return get checkbox **/ static function getMassiveActionCheckBox($itemtype, $id) { $sel = ""; if (isset($_SESSION['glpimassiveactionselected'][$itemtype][$id])) { $sel = "checked"; } return ""; } /** * Show the massive action checkbox * * @since version 0.84 * * @param $itemtype Massive action itemtype * @param $id ID of the item * * @return show checkbox **/ static function showMassiveActionCheckBox($itemtype, $id) { echo Html::getMassiveActionCheckBox($itemtype, $id); } /** * Display open form for massive action * * @since version 0.84 * * @param $name given name/id to the form (default '') * * @return nothing / display item **/ static function openMassiveActionsForm($name='') { echo Html::getOpenMassiveActionsForm($name); } /** * Get open form for massive action string * * @since version 0.84 * * @param $name given name/id to the form (default '') * * @return open form string **/ static function getOpenMassiveActionsForm($name='') { global $CFG_GLPI; if (empty($name)) { $name = 'massaction_'.mt_rand(); } return ""; } /** * Display massive actions * * @since 0.84 (before Search::displayMassiveActions) * * @param $itemtype string itemtype for massive actions * @param $options array of parameters * may contains : * - num_displayed : integer number of displayed items. Permit to check suhosin limit. (default -1 not to check) * - ontop : boolean true if displayed on top (default true) * - fixed : boolean true if used with fixed table display (default true) * - forcecreate : boolean force creation of modal window (default = false). * Modal is automatically created when displayed the ontop item. * If only a bottom one is displayed use it * - check_itemtype : string alternate itemtype to check right if different from main itemtype (default empty) * - check_items_id : integer ID of the alternate item used to check right / optional (default empty) * - is_deleted : boolean is massive actions for deleted items ? * - extraparams : string extra URL parameters to pass to massive actions (default empty) * - specific_actions : array of specific actions (do not use standard one) * - confirm : string of confirm message before massive action * * @return nothing **/ static function showMassiveActions($itemtype, $options=array()) { global $CFG_GLPI; $p['ontop'] = true; $p['num_displayed'] = -1; $p['fixed'] = true; $p['forcecreate'] = false; $p['check_itemtype'] = ''; $p['check_items_id'] = ''; $p['is_deleted'] = false; $p['extraparams'] = array(); $p['width'] = 800; $p['height'] = 400; $p['specific_actions'] = array(); $p['confirm'] = ''; $p['rand'] = ''; foreach ($options as $key => $val) { if (isset($p[$key])) { $p[$key] = $val; } } $p['extraparams']['itemtype'] = $itemtype; $url = $CFG_GLPI['root_doc']."/ajax/massiveaction.php"; if ($p['is_deleted']) { $p['extraparams']['is_deleted'] = 1; } if (!empty($p['check_itemtype'])) { $p['extraparams']['check_itemtype'] = $p['check_itemtype']; } if (!empty($p['check_items_id'])) { $p['extraparams']['check_items_id'] = $p['check_items_id']; } if (is_array($p['specific_actions']) && count($p['specific_actions'])) { $p['extraparams']['specific_actions'] = $p['specific_actions']; } if ($p['fixed']) { $width= '950px'; } else { $width= '80%'; } $identifier = md5($url.$itemtype.serialize($p['extraparams']).$p['rand']); $max = Toolbox::get_max_input_vars(); if (($p['num_displayed'] >= 0) && ($max > 0) && ($max < ($p['num_displayed']+10))) { if (!$p['ontop'] || (isset($p['forcecreate']) && $p['forcecreate'])) { echo "". "
"; echo __('Selection too large, massive action disabled.').""; if ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) { echo "
".__('To increase the limit: change max_input_vars or suhosin.post.max_vars in php configuration.'); } echo "
"; } } else { // Create Modal window on top if ($p['ontop'] || (isset($p['forcecreate']) && $p['forcecreate'])) { echo "
"; // echo ""; Ajax::createModalWindow('massiveaction_window'.$identifier, $url, array('title' => _n('Action', 'Actions', 2), 'container' => 'massiveactioncontent'.$identifier, 'extraparams' => $p['extraparams'], 'width' => $p['width'], 'height' => $p['height'],)); } echo ""; echo ""; echo ""; echo "
"; echo ""; echo _n('Action', 'Actions',2).""; echo "
"; if (!$p['ontop'] || (isset($p['forcecreate']) && $p['forcecreate'])) { // Clean selection $_SESSION['glpimassiveactionselected'][$itemtype] = array(); } } } /** * Display Date form with calendar * * @param $element name of the element * @param $value default value to display (default '') * @param $maybeempty may be empty ? (true by default) * @param $can_edit could not modify element (true by default) * @param $minDate minimum allowed date (default '') * @param $maxDate maximum allowed date (default '') * @param $displayYear should we set/diplay the year? (true by default) * * @return rand value used * \deprecated used Html::showDateField instead **/ static function showDateFormItem($element, $value='', $maybeempty=true, $can_edit=true, $minDate='', $maxDate='', $displayYear=true) { return self::showDateField($element, array('value' => $value, 'maybeempty' => $maybeempty, 'canedit' => $can_edit, 'min' => $minDate, 'max' => $maxDate, 'showyear' => $displayYear)); } /** * Display Date form with calendar * * @since version 0.84 * * @param $name name of the element * @param $options array of possible options: * - value : default value to display (default '') * - maybeempty : may be empty ? (true by default) * - canedit : could not modify element (true by default) * - min : minimum allowed date (default '') * - max : maximum allowed date (default '') * - showyear : should we set/diplay the year? (true by default) * - display : boolean display of return string (default true) * - rand : specific rand value (default generated one) * * @return rand value used if displayes else string **/ static function showDateField($name, $options=array()) { global $CFG_GLPI; $p['value'] = ''; $p['maybeempty'] = true; $p['canedit'] = true; $p['min'] = ''; $p['max'] = ''; $p['showyear'] = true; $p['display'] = true; $p['rand'] = mt_rand(); foreach ($options as $key => $val) { if (isset($p[$key])) { $p[$key] = $val; } } $output = ""; $output .= "\n"; if ($p['display']) { echo $output; return $p['rand']; } else { return $output; } } /** * Display DateTime form with calendar * * @param $element name of the element * @param $value default value to display (default '') * @param $time_step step for time in minute (-1 use default config) (default -1) * @param $maybeempty may be empty ? (true by default) * @param $can_edit could not modify element (true by default) * @param $minDate minimum allowed date (default '') * @param $maxDate maximum allowed date (default '') * @param $minTime minimum allowed time (default '') * @param $maxTime maximum allowed time (default '') * * @return rand value used * \deprecated since 0.84 used Html::showDateTimeField instead **/ static function showDateTimeFormItem($element, $value='', $time_step=-1, $maybeempty=true, $can_edit=true, $minDate='', $maxDate='', $minTime='', $maxTime='') { return self::showDateTimeField($element, array('value' => $value, 'timestep' => $time_step, 'maybeempty' => $maybeempty, 'canedit' => $can_edit, 'mindate' => $minDate, 'maxdate' => $maxDate, 'mintime' => $minTime, 'maxtime' => $maxTime)); } /** * Display DateTime form with calendar * * @since version 0.84 * * @param $name name of the element * @param $options array of possible options: * - value : default value to display (default '') * - timestep : step for time in minute (-1 use default config) (default -1) * - maybeempty : may be empty ? (true by default) * - canedit : could not modify element (true by default) * - mindate : minimum allowed date (default '') * - maxdate : maximum allowed date (default '') * - mintime : minimum allowed time (default '') * - maxtime : maximum allowed time (default '') * - display : boolean display or get string (default true) * - rand : specific random value (default generated one) * * @return rand value used if displayes else string **/ static function showDateTimeField($name, $options = array()) { global $CFG_GLPI; $p['value'] = ''; $p['maybeempty'] = true; $p['canedit'] = true; $p['mindate'] = ''; $p['maxdate'] = ''; $p['mintime'] = ''; $p['maxtime'] = ''; $p['timestep'] = -1; $p['display'] = true; $p['rand'] = mt_rand(); foreach ($options as $key => $val) { if (isset($p[$key])) { $p[$key] = $val; } } if ($p['timestep'] < 0) { $p['timestep'] = $CFG_GLPI['time_step']; } $output = ""; $minHour = 0; $maxHour = 23; $minMinute = 0; $maxMinute = 59; $date_value = ''; $hour_value = ''; if (!empty($p['value'])) { list($date_value, $hour_value) = explode(' ', $p['value']); } if (!empty($p['mintime'])) { list($minHour, $minMinute, $minSec) = explode(':', $p['mintime']); $minMinute = 0; // Check time in interval if (!empty($hour_value) && ($hour_value < $p['mintime'])) { $hour_value = $p['mintime']; } } if (!empty($p['maxtime'])) { list($maxHour, $maxMinute, $maxSec) = explode(':', $p['maxtime']); $maxMinute = 59; // Check time in interval if (!empty($hour_value) && ($hour_value > $p['maxtime'])) { $hour_value = $p['maxtime']; } } // reconstruct value to be valid if (!empty($date_value)) { $p['value'] = $date_value.' '.$hour_value; } $output .= "\n"; if ($p['display']) { echo $output; return $p['rand']; } return $output; } /** * Show generic date search * * @param $element name of the html element * @param $value default value (default '') * @param $options array of possible options: * - with_time display with time selection ? (default false) * - with_future display with future date selection ? (default false) * - with_days display specific days selection TODAY, BEGINMONTH, LASTMONDAY... ? (default true) * * @return rand value of dropdown **/ static function showGenericDateTimeSearch($element, $value='', $options=array()) { global $CFG_GLPI; $p['with_time'] = false; $p['with_future'] = false; $p['with_days'] = true; $p['with_specific_date'] = true; $p['display'] = true; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } $rand = mt_rand(); $output = ''; // Validate value if (($value != 'NOW') && ($value != 'TODAY') && !preg_match("/\d{4}-\d{2}-\d{2}.*/",$value) && !strstr($value,'HOUR') && !strstr($value,'DAY') && !strstr($value,'WEEK') && !strstr($value,'MONTH') && !strstr($value,'YEAR')) { $value = ""; } if (empty($value)) { $value = 'NOW'; } $specific_value = date("Y-m-d H:i:s"); if (preg_match("/\d{4}-\d{2}-\d{2}.*/",$value)) { $specific_value = $value; $value = 0; } $output .= "
"; $output .= ""; $output .= ""; $output .= "
"; $params = array('value' => '__VALUE__', 'name' => $element, 'withtime' => $p['with_time'], 'specificvalue' => $specific_value); $output .= Ajax::updateItemOnSelectEvent("genericdate$element$rand", "displaygenericdate$element$rand", $CFG_GLPI["root_doc"]."/ajax/genericdate.php", $params, false); $params['value'] = $value; $output .= Ajax::updateItem("displaygenericdate$element$rand", $CFG_GLPI["root_doc"]."/ajax/genericdate.php", $params, '', false); $output .= "
"; if ($p['display']) { echo $output; return $rand; } return $output; } /** * Get items to display for showGenericDateTimeSearch * * @since version 0.83 * * @param $options array of possible options: * - with_time display with time selection ? (default false) * - with_future display with future date selection ? (default false) * - with_days display specific days selection TODAY, BEGINMONTH, LASTMONDAY... ? (default true) * * @return array of posible values * @see showGenericDateTimeSearch **/ static function getGenericDateTimeSearchItems($options) { $params['with_time'] = false; $params['with_future'] = false; $params['with_days'] = true; $params['with_specific_date'] = true; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $params[$key] = $val; } } $dates = array(); if ($params['with_time']) { $dates['NOW'] = __('Now'); if ($params['with_days']) { $dates['TODAY'] = __('Today'); } } else { $dates['NOW'] = __('Today'); } if ($params['with_specific_date']) { $dates[0] = __('Specify a date'); } if ($params['with_time']) { for ($i=1 ; $i<=24 ; $i++) { $dates['-'.$i.'HOUR'] = sprintf(_n('- %d hour', '- %d hours', $i), $i); } } for ($i=1 ; $i<=7 ; $i++) { $dates['-'.$i.'DAY'] = sprintf(_n('- %d day', '- %d days', $i), $i); } if ($params['with_days']) { $dates['LASTSUNDAY'] = __('last Sunday'); $dates['LASTMONDAY'] = __('last Monday'); $dates['LASTTUESDAY'] = __('last Tuesday'); $dates['LASTWEDNESDAY'] = __('last Wednesday'); $dates['LASTTHURSDAY'] = __('last Thursday'); $dates['LASTFRIDAY'] = __('last Friday'); $dates['LASTSATURDAY'] = __('last Saturday'); } for ($i=1 ; $i<=10 ; $i++) { $dates['-'.$i.'WEEK'] = sprintf(_n('- %d week', '- %d weeks', $i), $i); } if ($params['with_days']) { $dates['BEGINMONTH'] = __('Beginning of the month'); } for ($i=1 ; $i<=12 ; $i++) { $dates['-'.$i.'MONTH'] = sprintf(_n('- %d month', '- %d months', $i), $i); } if ($params['with_days']) { $dates['BEGINYEAR'] = __('Beginning of the year'); } for ($i=1 ; $i<=10 ; $i++) { $dates['-'.$i.'YEAR'] = sprintf(_n('- %d year', '- %d years', $i), $i); } if ($params['with_future']) { if ($params['with_time']) { for ($i=1 ; $i<=24 ; $i++) { $dates[$i.'HOUR'] = sprintf(_n('+ %d hour', '+ %d hours', $i), $i); } } for ($i=1 ; $i<=7 ; $i++) { $dates[$i.'DAY'] = sprintf(_n('+ %d day', '+ %d days', $i), $i); } for ($i=1 ; $i<=10 ; $i++) { $dates[$i.'WEEK'] = sprintf(_n('+ %d week', '+ %d weeks', $i), $i); } for ($i=1 ; $i<=12 ; $i++) { $dates[$i.'MONTH'] = sprintf(_n('+ %d month', '+ %d months', $i), $i); } for ($i=1 ; $i<=10 ; $i++) { $dates[$i.'YEAR'] = sprintf(_n('+ %d year', '+ %d years', $i), $i); } } return $dates; } /** * Compute date / datetime value resulting of showGenericDateTimeSearch * * @since version 0.83 * * @param $val date / datetime value passed * @param $force_day boolean force computation in days (false by default) * @param $specifictime timestamp set specific timestamp (default '') * * @return computed date / datetime value * @see showGenericDateTimeSearch **/ static function computeGenericDateTimeSearch($val, $force_day=false, $specifictime='') { if (empty($specifictime)) { $specifictime = strtotime($_SESSION["glpi_currenttime"]); } $format_use = "Y-m-d H:i:s"; if ($force_day) { $format_use = "Y-m-d"; } // Parsing relative date switch ($val) { case 'NOW' : return date($format_use, $specifictime); case 'TODAY' : return date("Y-m-d", $specifictime); } // Search on begin of month / year if (strstr($val,'BEGIN')) { $hour = 0; $minute = 0; $second = 0; $month = date("n", $specifictime); $day = 1; $year = date("Y", $specifictime); switch ($val) { case "BEGINYEAR": $month = 1; break; case "BEGINMONTH": break; } return date($format_use, mktime ($hour, $minute, $second, $month, $day, $year)); } // Search on Last monday, sunday... if (strstr($val,'LAST')) { $lastday = str_replace("LAST", "LAST ", $val); $hour = 0; $minute = 0; $second = 0; $month = date("n", strtotime($lastday)); $day = date("j", strtotime($lastday)); $year = date("Y", strtotime($lastday)); return date($format_use, mktime ($hour, $minute, $second, $month, $day, $year)); } // Search on +- x days, hours... if (preg_match("/^(-?)(\d+)(\w+)$/",$val,$matches)) { if (in_array($matches[3], array('YEAR', 'MONTH', 'WEEK', 'DAY', 'HOUR'))) { $nb = intval($matches[2]); if ($matches[1] == '-') { $nb = -$nb; } // Use it to have a clean delay computation (MONTH / YEAR have not always the same duration) $hour = date("H", $specifictime); $minute = date("i", $specifictime); $second = 0; $month = date("n", $specifictime); $day = date("j", $specifictime); $year = date("Y", $specifictime); switch ($matches[3]) { case "YEAR" : $year += $nb; break; case "MONTH" : $month += $nb; break; case "WEEK" : $day += 7*$nb; break; case "DAY" : $day += $nb; break; case "HOUR" : $format_use = "Y-m-d H:i:s"; $hour += $nb; break; } return date($format_use, mktime ($hour, $minute, $second, $month, $day, $year)); } } return $val; } /** * Print the form used to select profile if several are available * * @param $target target of the form * * @return nothing **/ static function showProfileSelecter($target) { global $CFG_GLPI; if (count($_SESSION["glpiprofiles"])>1) { echo '
  • '; echo ''; Html::closeForm(); echo '
  • '; } if (Session::isMultiEntitiesMode()) { echo "
  • "; Ajax::createModalWindow('entity_window', $CFG_GLPI['root_doc']."/ajax/entitytree.php", array('title' => __('Select the desired entity'), 'extraparams' => array('target' => $target))); echo "". $_SESSION["glpiactive_entity_shortname"].""; echo "
  • "; } } /** * Show a tooltip on an item * * @param $content string data to put in the tooltip * @param $options array of possible options: * - applyto : string / id of the item to apply tooltip (default empty). * If not set display an icon * - title : string / title to display (default empty) * - contentid : string / id for the content html container (default auto generated) (used for ajax) * - link : string / link to put on displayed image if contentid is empty * - linkid : string / html id to put to the link link (used for ajax) * - linktarget : string / target for the link * - popup : string / popup action : link not needed to use it * - img : string / url of a specific img to use * - display : boolean / display the item : false return the datas * - autoclose : boolean / autoclose the item : default true (false permit to scroll) * * @return nothing (print out an HTML div) **/ static function showToolTip($content, $options=array()) { global $CFG_GLPI; $param['applyto'] = ''; $param['title'] = ''; $param['contentid'] = ''; $param['link'] = ''; $param['linkid'] = ''; $param['linktarget'] = ''; $param['img'] = $CFG_GLPI["root_doc"]."/pics/aide.png"; $param['popup'] = ''; $param['ajax'] = ''; $param['display'] = true; $param['autoclose'] = true; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $param[$key] = $val; } } // No empty content to have a clean display if (empty($content)) { $content = " "; } $rand = mt_rand(); $out = ''; // Force link for popup if (!empty($param['popup'])) { $param['link'] = '#'; } if (empty($param['applyto'])) { if (!empty($param['link'])) { $out .= ""; if (!empty($param['link'])) { $out .= ""; } $param['applyto'] = "tooltip$rand"; } if (empty($param['contentid'])) { $param['contentid'] = "content".$param['applyto']; } $out .= "$content"; $out .= ""; if ($param['display']) { echo $out; } else { return $out; } } /** * Show div with auto completion * * @param $item item object used for create dropdown * @param $field field to search for autocompletion * @param $options array of possible options: * - name : string / name of the select (default is field parameter) * - value : integer / preselected value (default value of the item object) * - size : integer / size of the text field * - entity : integer / restrict to a defined entity (default entity of the object if define) * set to -1 not to take into account * - user : integer / restrict to a defined user (default -1 : no restriction) * - option : string / options to add to text field * - display : boolean / if false get string * * @return nothing (print out an HTML div) **/ static function autocompletionTextField(CommonDBTM $item, $field, $options=array()) { global $CFG_GLPI; $params['name'] = $field; $params['value'] = ''; if (array_key_exists($field,$item->fields)) { $params['value'] = $item->fields[$field]; } $params['size'] = 40; $params['entity'] = -1; if (array_key_exists('entities_id',$item->fields)) { $params['entity'] = $item->fields['entities_id']; } $params['user'] = -1; $params['option'] = ''; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $params[$key] = $val; } } $output = ''; if ($CFG_GLPI["use_ajax"] && $CFG_GLPI["use_ajax_autocompletion"]) { $rand = mt_rand(); $name = "field_".$params['name'].$rand; $output .= "\n"; $output .= ""; } else { $output .= "\n"; } if (!isset($options['display']) || $options['display']) { echo $output; } else { return $output; } } /** * Init the Editor System to a textarea * * @param $name name of the html textarea where to used * * @return nothing **/ static function initEditorSystem($name) { global $CFG_GLPI; echo ""; // invalid_elements : 'script', } /** * Print Ajax pager for list in tab panel * * @param $title displayed above * @param $start from witch item we start * @param $numrows total items * @param $additional_info Additional information to display (default '') * * @return nothing (print a pager) **/ static function printAjaxPager($title, $start, $numrows, $additional_info='') { global $CFG_GLPI; $list_limit = $_SESSION['glpilist_limit']; // Forward is the next step forward $forward = $start+$list_limit; // This is the end, my friend $end = $numrows-$list_limit; // Human readable count starts here $current_start = $start+1; // And the human is viewing from start to end $current_end = $current_start+$list_limit-1; if ($current_end > $numrows) { $current_end = $numrows; } // Empty case if ($current_end == 0) { $current_start = 0; } // Backward browsing if ($current_start-$list_limit <= 0) { $back = 0; } else { $back = $start-$list_limit; } // Print it echo "
    "; if (!empty($title)) { echo ""; } echo "\n"; // Back and fast backward button if (!$start == 0) { echo ""; echo ""; } echo ""; if (!empty($additional_info)) { echo ""; } // Print the "where am I?" echo "\n"; // Forward and fast forward button if ($forward < $numrows) { echo ""; echo ""; } // End pager echo "
    $title
    \"".__s('Start'). \"".__s('Previous')."; self::printPagerForm(); echo ""; echo $additional_info; echo ""; //TRANS: %1$d, %2$d, %3$d are page numbers echo sprintf(__('From %1$d to %2$d on %3$d'), $current_start, $current_end, $numrows); echo " \"".__s('Next'). \"".__s('End').
    "; } /** * Clean Printing of and array in a table * ONLY FOR DEBUG * * @param $tab the array to display * @param $pad Pad used (default 0) * * @return nothing **/ static function printCleanArray($tab, $pad=0) { if (count($tab)) { echo ""; // For debug / no gettext echo ""; foreach ($tab as $key => $val) { echo ""; } echo "
    KEY=>VALUE
    "; echo $key; echo "=>"; if (is_array($val)) { self::printCleanArray($val,$pad+1); } else { echo $val; } echo "
    "; } } /** * Print pager for search option (first/previous/next/last) * * @param $start from witch item we start * @param $numrows total items * @param $target page would be open when click on the option (last,previous etc) * @param $parameters parameters would be passed on the URL. * @param $item_type_output item type display - if >0 display export PDF et Sylk form * (default 0) * @param $item_type_output_param item type parameter for export (default 0) * @param $additional_info Additional information to display (default '') * * @return nothing (print a pager) * **/ static function printPager($start, $numrows, $target, $parameters, $item_type_output=0, $item_type_output_param=0, $additional_info='') { global $CFG_GLPI; $list_limit = $_SESSION['glpilist_limit']; // Forward is the next step forward $forward = $start+$list_limit; // This is the end, my friend $end = $numrows-$list_limit; // Human readable count starts here $current_start = $start+1; // And the human is viewing from start to end $current_end = $current_start+$list_limit-1; if ($current_end > $numrows) { $current_end = $numrows; } // Empty case if ($current_end == 0) { $current_start = 0; } // Backward browsing if ($current_start-$list_limit <= 0) { $back = 0; } else { $back = $start-$list_limit; } // Print it echo "
    "; echo ""; // Back and fast backward button if (!$start == 0) { echo ""; echo ""; } // Print the "where am I?" echo ""; if (!empty($additional_info)) { echo ""; } if (!empty($item_type_output) && isset($_SESSION["glpiactiveprofile"]) && ($_SESSION["glpiactiveprofile"]["interface"] == "central")) { echo "" ; } echo "\n"; // Forward and fast forward button if ($forward<$numrows) { echo "\n"; echo "\n"; } // End pager echo "
    "; echo ""; echo "\"".__s('Start')."; echo ""; echo ""; echo "\"".__s('Previous')."; echo ""; self::printPagerForm("$target?$parameters&start=$start"); echo ""; echo $additional_info; echo ""; echo ""; echo ""; if ($item_type_output_param != 0) { echo ""; } $split = explode("&",$parameters); for ($i=0 ; $i"; } Dropdown::showOutputFormat(); Html::closeForm(); echo ""; //TRANS: %1$d, %2$d, %3$d are page numbers printf(__('From %1$d to %2$d on %3$d'), $current_start, $current_end, $numrows); echo ""; echo ""; echo "\"".__s('Next')."; echo ""; echo ""; echo "\"".__s('End')."; echo "
    "; } /** * Display the list_limit combo choice * * @param $action page would be posted when change the value (URL + param) (default '') * * ajax Pager will be displayed if empty * * @return nothing (print a combo) **/ static function printPagerForm($action="") { if ($action) { echo ""; echo "".__('Display (number of items)')." "; Dropdown::showListLimit("submit()"); } else { echo "\n"; echo "".__('Display (number of items)')." "; Dropdown::showListLimit("reloadTab(\"glpilist_limit=\"+this.value)"); } Html::closeForm(); } /** * Create a title for list, as "List (5 on 35)" * * @param $string String text for title * @param $num Integer number of item displayed * @param $tot Integer number of item existing * * @since version 0.83.1 * * @return String **/ static function makeTitle ($string, $num, $tot) { if (($num > 0) && ($num < $tot)) { // TRANS %1$d %2$d are numbers (displayed, total) $cpt = sprintf(__('%1$d on %2$d'), $num, $tot); } else { // $num is 0, so means configured to display nothing // or $num == $tot $cpt = $tot; } return sprintf(__('%1$s (%2$s)'), $string, $cpt); } /** * create a minimal form for simple action * * @param $action String URL to call on submit * @param $btname String button name (maybe if name <> value) * @param $btlabel String button label * @param $fields Array field name => field value * @param $btimage String button image uri (optional) (default '') * @param $btoption String optional button option (default '') * @param $confirm String optional confirm message (default '') * * @since version 0.84 **/ static function getSimpleForm($action, $btname, $btlabel, Array $fields=array(), $btimage='', $btoption='', $confirm='') { if (GLPI_USE_CSRF_CHECK) { $fields['_glpi_csrf_token'] = Session::getNewCSRFToken(); } $fields['_glpi_simple_form'] = 1; $button = $btname; if (!is_array($btname)) { $button = array(); $button[$btname] = $btname; } $fields = array_merge($button, $fields); $javascriptArray = array(); foreach ($fields as $name => $value) { /// TODO : trouble : urlencode not available for array / do not pass array fields... if (!is_array($value)) { // Javascript no gettext $javascriptArray[] = "'$name': '".urlencode($value)."'"; } } $link = " $value) { // $SIMPLE_FORMS .= ""; // } // } // $SIMPLE_FORMS .= ""; // // echo ""; // $btlabel = htmlentities($btlabel, ENT_QUOTES, 'UTF-8'); // if (empty($btimage)) { // echo $btlabel; // } else { // echo "$btlabel"; // } // echo ""; // // $SIMPLE_FORMS .= Html::closeForm(false); } /** * create a minimal form for simple action * * @param $action String URL to call on submit * @param $btname String button name * @param $btlabel String button label * @param $fields Array field name => field value * @param $btimage String button image uri (optional) (default '') * @param $btoption String optional button option (default '') * @param $confirm String optional confirm message (default '') * * @since version 0.83.3 **/ static function showSimpleForm($action, $btname, $btlabel, Array $fields=array(), $btimage='', $btoption='', $confirm='') { echo self::getSimpleForm($action, $btname, $btlabel, $fields, $btimage, $btoption, $confirm); } /** * Create a close form part including CSRF token * * @param $display boolean Display or return string (default true) * * @since version 0.83. * * @return String **/ static function closeForm ($display=true) { $out = ''; if (GLPI_USE_CSRF_CHECK) { $out .= ""; } $out .= "\n"; if ($display) { echo $out; return true; } return $out; } } ?> glpi-0.84.3+dfsg.1/inc/htmltablebase.class.php000066400000000000000000000147341226600447100210270ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class HTMLTableUnknownHeader extends Exception {} class HTMLTableUnknownHeaders extends Exception {} class HTMLTableUnknownHeadersOrder extends Exception {} /** * @since version 0.84 **/ abstract class HTMLTableBase { private $headers = array(); private $headers_order = array(); private $headers_sub_order = array(); private $super; /** * @param $super **/ function __construct($super) { $this->super = $super; } /** * @param $header_object HTMLTableHeader object * @param $allow_super_header (false by default **/ function appendHeader(HTMLTableHeader $header_object, $allow_super_header=false) { if (!$header_object instanceof HTMLTableHeader) { throw new Exception('Implementation error: appendHeader requires HTMLTableHeader as parameter'); } //TODO $header_name AND $subHeader_name not initialized $header_object->getHeaderAndSubHeaderName($header_name, $subHeader_name); if ($header_object->isSuperHeader() && (!$this->super) && (!$allow_super_header)) { throw new Exception(sprintf('Implementation error: invalid super header name "%s"', $header_name)); } if (!$header_object->isSuperHeader() && $this->super) { throw new Exception(sprintf('Implementation error: invalid super header name "%s"', $header_name)); } if (!isset($this->headers[$header_name])) { $this->headers[$header_name] = array(); $this->headers_order[] = $header_name; $this->headers_sub_order[$header_name] = array(); } if (!isset($this->headers[$header_name][$subHeader_name])) { $this->headers_sub_order[$header_name][] = $subHeader_name; } $this->headers[$header_name][$subHeader_name] = $header_object; return $header_object; } /** * Internal test to see if we can add an header. For instance, we can only add a super header * to a table if there is no group defined. And we can only create a sub Header to a group if * it contains no row **/ abstract function tryAddHeader(); /** * create a new HTMLTableHeader * * Depending of "$this" type, this head will be an HTMLTableSuperHeader of a HTMLTableSubHeader * * @param $name string The name that can be refered by getHeaderByName() * @param $content string or array The content (see HTMLTableEntity#content) of the header * @param $super HTMLTableSuperHeader object: * the header that contains this new header only used * for HTMLTableSubHeader (default NULL) * (ie: $this instanceof HTMLTableGroup) * @param $father HTMLTableHeader object: the father of the current header * (default NULL) * * @exception Exception If there is no super header while creating a sub * header or a super header while creating a super one * * @return the HTMLTableHeader that have been created **/ function addHeader($name, $content, HTMLTableSuperHeader $super=NULL, HTMLTableHeader $father=NULL) { $this->tryAddHeader(); if (is_null($super)) { if (!$this->super) { throw new Exception('A sub header requires a super header'); } return $this->appendHeader(new HTMLTableSuperHeader($this, $name, $content, $father)); } if ($this->super) { throw new Exception('Cannot attach a super header to another header'); } return $this->appendHeader(new HTMLTableSubHeader($super, $name, $content, $father)); } /** * @param $name **/ function getSuperHeaderByName($name) { return $this->getHeaderByName($name, ''); } /** * @param $name * @param $sub_name (default NULL) **/ function getHeaderByName($name, $sub_name=NULL) { if (is_string($sub_name)) { if (isset($this->headers[$name][$sub_name])) { return $this->headers[$name][$sub_name]; } throw new HTMLTableUnknownHeader($name.':'.$sub_name); } foreach ($this->headers as $header) { if (isset($header[$name])) { return $header[$name]; } } throw new HTMLTableUnknownHeader($name); } /** * @param $header_name (default '') **/ function getHeaders($header_name='') { if (empty($header_name)) { return $this->headers; } if (isset($this->headers[$header_name])) { return $this->headers[$header_name]; } throw new HTMLTableUnknownHeaders($header_name); } /** * @param $header_name (default '') **/ function getHeaderOrder($header_name='') { if (empty($header_name)) { return $this->headers_order; } if (isset($this->headers_sub_order[$header_name])) { return $this->headers_sub_order[$header_name]; } throw new HTMLTableUnknownHeadersOrder($header_name); } } ?> glpi-0.84.3+dfsg.1/inc/htmltablecell.class.php000066400000000000000000000172301226600447100210260ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class HTMLTableCellFatherSameRow extends Exception {} class HTMLTableCellFatherCoherentHeader extends Exception {} class HTMLTableCellWithoutFather extends Exception {} /** * @since version 0.84 **/ class HTMLTableCell extends HTMLTableEntity { private $row; private $header; private $father; private $sons = array(); private $item; // List of rows that have specific attributs private $attributForTheRow = false; /** * @param $row * @param $header * @param $content see HTMLTableEntity#__construct() * @param $father HTMLTableCell object (default NULL) * @param $item CommonDBTM object: The item associated with the current cell (default NULL) **/ function __construct($row, $header, $content, HTMLTableCell $father=NULL, CommonDBTM $item=NULL) { parent::__construct($content); $this->row = $row; $this->header = $header; $this->father = $father; if (!empty($item)) { $this->item = clone $item; } else { $this->item = NULL; } if (!is_null($this->father)) { if ($this->father->row != $this->row) { throw new HTMLTableCellSameRow(); } if ($this->father->header != $this->header->getFather()) { if (($this->father->header instanceof HTMLTableHeader) && ($this->header->getFather() instanceof HTMLTableHeader)) { throw new HTMLTableCellFatherCoherentHeader($this->header->getFather()->getName() . ' != ' . $this->father->header->getName()); } if ($this->father->header instanceof HTMLTableHeader) { throw new HTMLTableCellFatherCoherentHeader('NULL != '. $this->father->header->getName()); } if ($this->header->getFather() instanceof HTMLTableHeader) { throw new HTMLTableCellFatherCoherentHeader($this->header->getFather()->getName() . ' != NULL'); } throw new HTMLTableCellFatherCoherentHeader('NULL != NULL'); } $this->father->addSon($this, $header); } else if (!is_null($this->header->getFather())) { throw new HTMLTableCellWithoutFather(); } $this->header->checkItemType($this->item); $this->copyAttributsFrom($this->header); if (is_string($content)) { $string = trim($content); $string = str_replace(' ', '', $string); $string = str_replace('
    ', '', $string); if (!empty($string)) { $this->header->addCell(); } } else { $this->header->addCell(); } } /** * @param $attributForTheRow **/ function setAttributForTheRow($attributForTheRow) { $this->attributForTheRow = $attributForTheRow; } function getHeader() { return $this->header; } function getItem() { if (!empty($this->item)) { return $this->item; } return false; } /** * @param $son HTMLTableCell object * @param $sons_header HTMLTableHeader object **/ function addSon(HTMLTableCell $son, HTMLTableHeader $sons_header) { if (!isset($this->sons[$sons_header->getName()])) { $this->sons[$sons_header->getName()] = array(); } $this->sons[$sons_header->getName()][] = $son; } function getNumberOfLines() { return $this->numberOfLines; } function computeNumberOfLines() { if (!isset($this->numberOfLines)) { $this->numberOfLines = 1; if (count($this->sons) > 0) { foreach ($this->sons as $headered_sons) { $numberOfLinesForHeader = 0; foreach ($headered_sons as $son) { $son->computeNumberOfLines(); $numberOfLinesForHeader += $son->getNumberOfLines(); } if ($this->numberOfLines < $numberOfLinesForHeader) { $this->numberOfLines = $numberOfLinesForHeader; } } } } } /** * @param $value **/ function addToNumberOfLines($value) { $this->numberOfLines += $value; } /** * @param $cells array * @param $totalNumberOflines **/ static function updateCellSteps(array $cells, $totalNumberOflines) { $numberOfLines = 0; foreach ($cells as $cell) { $numberOfLines += $cell->getNumberOfLines(); } $numberEmpty = $totalNumberOflines - $numberOfLines; $step = floor($numberEmpty / (count($cells))); $last = $numberEmpty % (count($cells)); $index = 0; foreach ($cells as $cell) { $cell->addToNumberOfLines($step + ($index < $last ? 1 : 0)); $index ++; } } /** * @param &$start **/ function computeStartEnd(&$start) { if (!isset($this->start)) { if ($this->attributForTheRow !== false) { $this->row->addAttributForLine($start, $this->attributForTheRow); } $this->start = $start; foreach ($this->sons as $sons_by_header) { self::updateCellSteps($sons_by_header, $this->getNumberOfLines()); $son_start = $this->start; foreach ($sons_by_header as $son) { $son->computeStartEnd($son_start); } } $start += $this->numberOfLines; } else { $start = $this->start + $this->numberOfLines; } } /** * @param $index * @param $options array **/ function displayCell($index, array $options=array()) { if (($index >= $this->start) && ($index < ($this->start + $this->numberOfLines))) { if ($index == $this->start) { if ($this->item instanceof CommonDBTM) { Session::addToNavigateListItems($this->item->getType(), $this->item->getID()); } echo "\t\t\tnumberOfLines > 1) { echo " rowspan='".$this->numberOfLines."'"; } $this->displayEntityAttributs($options); echo ">"; $this->displayContent(); echo "\n"; } return true; } return false; } } ?> glpi-0.84.3+dfsg.1/inc/htmltableentity.class.php000066400000000000000000000120501226600447100214160ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * @since version 0.84 * * The base entity for the table. The entity is the base of kind of cell (header or not). It * provides facilities to manage the cells such as attributs or specific content (mixing of strings * and call of method during table display) **/ abstract class HTMLTableEntity { private $html_id = ''; private $html_style = array(); private $html_class = array(); private $content; /** * Constructor of an entity * * @param $content The content of a cell, header, ... Can simply be a string. But it can also * be a call to a specific function during the rendering of the table in case * of direct display function (for instance: Dropdown::showInteger). A function * call is an array containing two elements : 'function', the name the function * and 'parameters', an array of the parameters given to the function. **/ function __construct($content) { $this->content = $content; } /** * @param $origin **/ function copyAttributsFrom(HTMLTableEntity $origin) { $this->html_id = $origin->html_id; $this->html_style = $origin->html_style; $this->html_class = $origin->html_class; } /** * @param $html_id **/ function setHTMLID($html_id) { $this->html_id = $html_id; } /** * userfull ? function never called * * @param $html_style **/ function setHTMLStyle($html_style) { if (is_array($html_style)) { $this->html_style = array_merge($this->html_style, $html_style); } else { $this->html_style[] = $html_style; } } /** * @param $html_class **/ function setHTMLClass($html_class) { if (is_array($html_class)) { $this->html_class = array_merge($this->html_class, $html_class); } else { $this->html_class[] = $html_class; } } /** * @param $options array **/ function displayEntityAttributs(array $options=array()) { $id = $this->html_id; if (isset($options['id'])) { $id = $options['id']; } if (!empty($id)) { echo " id='$id'"; } $style = $this->html_style; if (isset($options['style'])) { if (is_array($options['style'])) { $style = array_merge($style, $options['style']); } else { $style[] = $options['style']; } } if (count($style) > 0) { echo " style='".implode(';', $style)."'"; } $class = $this->html_class; if (isset($options['class'])) { if (is_array($options['class'])) { $class = array_merge($class, $options['class']); } else { $class[] = $options['class']; } } if (count($class) > 0) { echo " class='".implode(' ', $class)."'"; } } /** * @param $content **/ function setContent($content) { $this->content = $content; } function displayContent() { if (is_string($this->content)) { // Manage __RAND__ to be computed on display $content = $this->content; $content = str_replace('__RAND__',mt_rand(), $content); echo $content; } else if (is_array($this->content)) { foreach ($this->content as $content) { if (is_string($content)) { // Manage __RAND__ to be computed on display $content = str_replace('__RAND__',mt_rand(), $content); echo $content; } else if (isset($content['function'])) { if (isset($content['parameters'])) { $parameters = $content['parameters']; } else { $parameters = array(); } call_user_func_array ($content['function'], $parameters); } } } } } ?> glpi-0.84.3+dfsg.1/inc/htmltablegroup.class.php000066400000000000000000000170771226600447100212540ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * @since v ersion 0.84 **/ class HTMLTableGroup extends HTMLTableBase { private $name; private $content; private $new_headers = array(); private $table; private $rows = array(); /** * @param $table HTMLTableMain object * @param $name * @param $content **/ function __construct(HTMLTableMain $table, $name, $content) { parent::__construct(false); $this->table = $table; $this->name = $name; $this->content = $content; } function getName() { return $this->name; } function getTable() { return $this->table; } /** * @param $header HTMLTableHeader object **/ function haveHeader(HTMLTableHeader $header) { //TODO $header_name AND $subHeader_name not initialized $header->getHeaderAndSubHeaderName($header_name, $subheader_name); try { $subheaders = $this->getHeaders($header_name); } catch (HTMLTableUnknownHeaders $e) { try { $subheaders = $this->table->getHeaders($header_name); } catch (HTMLTableUnknownHeaders $e) { return false; } } return isset($subheaders[$subheader_name]); } function tryAddHeader() { if (isset($this->ordered_headers)) { throw new Exception('Implementation error: must define all headers before any row'); } } private function completeHeaders() { if (!isset($this->ordered_headers)) { $this->ordered_headers = array(); foreach ($this->table->getHeaderOrder() as $header_name) { $header = $this->table->getSuperHeaderByName($header_name); $header_names = $this->getHeaderOrder($header_name); if (!$header_names) { $this->ordered_headers[] = $header; } else { foreach ($header_names as $sub_header_name) { $this->ordered_headers[] = $this->getHeaderByName($header_name, $sub_header_name); } } } } } function createRow() { //$this->completeHeaders(); $new_row = new HTMLTableRow($this); $this->rows[] = $new_row; return $new_row; } function prepareDisplay() { foreach ($this->table->getHeaderOrder() as $super_header_name) { $super_header = $this->table->getSuperHeaderByName($super_header_name); try { $sub_header_names = $this->getHeaderOrder($super_header_name); $count = 0; foreach ($sub_header_names as $sub_header_name) { $sub_header = $this->getHeaderByName($super_header_name, $sub_header_name); if ($sub_header->hasToDisplay()) { $count ++; } } if ($count == 0) { $this->ordered_headers[] = $super_header; } else { $super_header->updateNumberOfSubHeader($count); foreach ($sub_header_names as $sub_header_name) { $sub_header = $this->getHeaderByName($super_header_name, $sub_header_name); if ($sub_header->hasToDisplay()) { $this->ordered_headers[] = $sub_header; $sub_header->numberOfSubHeaders = $count; } } } } catch (HTMLTableUnknownHeadersOrder $e) { $this->ordered_headers[] = $super_header; } } foreach ($this->rows as $row) { $row->prepareDisplay(); } } /** * Display the current group (with headers and rows) * * @param $totalNumberOfColumn Total number of columns : to span correctly the title * @param $params array of possible options: * 'display_super_for_each_group' display the super header (ie.: big header of the table) * before the group specific headers * 'display_title_for_each_group' display the title of the header before the group * specific headers * * @return nothing (display only) **/ function displayGroup($totalNumberOfColumn, array $params) { $p['display_header_for_each_group'] = true; $p['display_super_for_each_group'] = true; $p['display_title_for_each_group'] = true; foreach ($params as $key => $val) { $p[$key] = $val; } if ($this->getNumberOfRows() > 0) { if ($p['display_title_for_each_group'] && !empty($this->content)) { echo "\t" . $this->content . "\n"; } if ($p['display_super_for_each_group']) { echo "\t\n"; $this->table->displaySuperHeader(); echo "\t\n"; } echo "\t\n"; foreach ($this->ordered_headers as $header) { if ($header instanceof HTMLTableSubHeader) { $header->updateColSpan($header->numberOfSubHeaders); $with_content = true; } else { $with_content = false; } if ($p['display_header_for_each_group']) { echo "\t\t"; $header->displayTableHeader($with_content); echo "\n"; } } echo "\t\n"; $previousNumberOfSubRows = 0; foreach ($this->rows as $row) { if (!$row->notEmpty()) { continue; } $currentNumberOfSubRow = $row->getNumberOfSubRows(); if (($previousNumberOfSubRows * $currentNumberOfSubRow) > 1) { echo "\t
    ". "\n"; } $row->displayRow($this->ordered_headers); $previousNumberOfSubRows = $currentNumberOfSubRow; } } } function getNumberOfRows() { $numberOfRows = 0; foreach ($this->rows as $row) { if ($row->notEmpty()) { $numberOfRows ++; } } return $numberOfRows; } function getSuperHeaderByName($name) { try { return $this->getHeaderByName($name, ''); } catch (HTMLTableUnknownHeader $e) { return $this->table->getSuperHeaderByName($name); } } } ?> glpi-0.84.3+dfsg.1/inc/htmltableheader.class.php000066400000000000000000000100201226600447100213250ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * @since version 0.84 **/ abstract class HTMLTableHeader extends HTMLTableEntity { private $name; private $father; private $itemtypes = array(); private $colSpan = 1; private $numberCells = 0; /** * get the table of the header (for a subheader, it is the table of its super header) * * @return HTMLTableMain the table owning the current header **/ abstract protected function getTable(); /** * get its name and subname : usefull for instance to create an index for arrays * * @param $header_name [out] string header name * @param $subheader_name [out] string sub header name ( = '' in case of super header) * * @return nothing **/ abstract function getHeaderAndSubHeaderName(&$header_name, &$subheader_name); /** * check to see if it is a super header or not * * @return true if this is a super header **/ abstract function isSuperHeader(); /** * @param $name string the name of the header * @param $content see HTMLTableEntity#__construct() * @param $father HTMLTableHeader object: * the father of the current column (default NULL) **/ function __construct($name, $content, HTMLTableHeader $father=NULL) { parent::__construct($content); $this->name = $name; $this->father = $father; } /** * @param $itemtype * @param $title (default '') **/ function setItemType($itemtype, $title='') { $this->itemtypes[$itemtype] = $title; } /** * @param $item CommonDBTM object (default NULL) **/ function checkItemType(CommonDBTM $item=NULL) { if (($item === NULL) && (count($this->itemtypes) > 0)) { throw new Exception('Implementation error: header requires an item'); } if ($item !== NULL) { if (!isset($this->itemtypes[$item->getType()])) { throw new Exception('Implementation error: type mismatch between header and cell'); } $this->getTable()->addItemType($item->getType(), $this->itemtypes[$item->getType()]); } } function getName() { return $this->name; } /** * @param $colSpan **/ function setColSpan($colSpan) { $this->colSpan = $colSpan; } function addCell() { $this->numberCells ++ ; } function hasToDisplay() { return ($this->numberCells > 0); } function getColSpan() { return $this->colSpan; } /** * @param $with_content **/ function displayTableHeader($with_content) { echo ""; if ($with_content) { $this->displayContent(); } else { echo " "; } echo ""; } function getFather() { return $this->father; } } ?> glpi-0.84.3+dfsg.1/inc/htmltablemain.class.php000066400000000000000000000173171226600447100210410ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// HTMLTable class /// Create a smart HTML table. The table allows cells to depend on other ones. As such, it is /// possible to have rowspan for cells that are "father" of other ones. If a "father" has several /// sons, then, it "rowspans" on all. /// The table integrates the notion of group of rows (HTMLTableGroup). For instance, for /// Computer_Device, each group represents a kind of device (network card, graphique card, /// processor, memory, ...). /// There is HTMLTableSuperHeader that defines global headers for all groups. Each group can cut /// these HTMLTableSuperHeader as many HTMLTableSubHeader as necessary. There is an automatic /// organisation of the headers between groups. /// /// The (strict) order of definition of the table is: /// * Define all HTMLTableSuperHeader that are used by each group: HTMLTableMain::addHeader() /// * Define one HTMLTableGroup: HTMLTableMain::createGroup() /// * Define all HTMLTableSubHeader depending of previously defined HTMLTableSuperHeader /// for the given group: HTMLTableGroup::addHeader() /// * Create all HTMLTableRow for the given group: HTMLTableGroup::createRow() /// * Create all HTMLTableCell for the given row : HTMLTableRow::addCell() /// and so on for each group. /// When done, call HTMLTableMain::display() to render the table. /// /// A column that don't have any content is collapse /// /// For further explaination, refer to NetworkPort and all its dependencies (NetworkName, IPAddress, /// IPNetwork, ...) or Computer_Device and each kind of device. /// @since 0.84 class HTMLTableMain extends HTMLTableBase { private $groups = array(); private $itemtypes = array(); function __construct() { parent::__construct(true); } /** * We can define a global name for the table : this will print as header that colspan all columns * * @param $name the name to print inside the header * * @return nothing **/ function setTitle($name) { $this->title = $name; } function tryAddHeader() { if (count($this->groups) > 0) { throw new Exception('Implementation error: must define all headers before any subgroups'); } } /** * @param $name string The name of the group, to be able to retrieve the group * later with HTMLTableMain::getHeaderByName() * @param $content (@see HTMLTableEntity::content) * The title of the group : display before the group itself * * TODO : study to be sure that the order is the one we have defined ... * * @return nothing **/ function createGroup($name, $content) { if (!empty($name)) { if (!isset($this->groups[$name])) { $this->groups[$name] = new HTMLTableGroup($this, $name, $content); } } return $this->getGroup($name); } /** * @param $itemtype * @param $title **/ function addItemType($itemtype, $title) { $this->itemtypes[$itemtype] = $title; } /** * Retrieve a group by its name * * @param $group_name (string) the group name * * @return nothing **/ function getGroup($group_name) { if (isset($this->groups[$group_name])) { return $this->groups[$group_name]; } return false; } /** * Display the super headers, for the global table, or the groups **/ function displaySuperHeader() { echo "\t\t\n"; foreach ($this->getHeaderOrder() as $header_name) { $header = $this->getSuperHeaderByName($header_name); echo "\t\t\t"; $header->displayTableHeader(true); echo "\n"; } echo "\t\t\n"; } /** * get the total number of rows (ie.: the sum of each group number of rows) * * Beware that a row is counted only if it is not empty (ie.: at least one addCell) * * @return the total number of rows **/ function getNumberOfRows() { $numberOfRow = 0; foreach ($this->groups as $group) { $numberOfRow += $group->getNumberOfRows(); } return $numberOfRow; } /** * Display the table itself * * @param $params array of possible options: * 'html_id' the global HTML ID of the table * 'display_thead' display the header before the first group * 'display_tfoot' display the header at the end of the table * 'display_header_for_each_group' display the header of each group * 'display_super_for_each_group' display the super header befor each group * 'display_title_for_each_group' display the title of each group * * @return nothing (display only) **/ function display(array $params) { $p['html_id'] = ''; $p['display_thead'] = true; $p['display_tfoot'] = true; foreach ($params as $key => $val) { $p[$key] = $val; } foreach ($this->groups as $group) { $group->prepareDisplay(); } $totalNumberOfRow = $this->getNumberOfRows(); $totalNumberOfColumn = 0; foreach ($this->getHeaders() as $header) { $colspan = $header['']->getColSpan(); $totalNumberOfColumn += $colspan; } foreach ($this->itemtypes as $itemtype => $title) { Session::initNavigateListItems($itemtype, $title); } echo "\n\n"; $open_thead = ((!empty($this->title)) || ($p['display_thead'])); if ($open_thead) { echo "\t\n"; } if (!empty($this->title)) { echo "\t\t\n"; } if ($totalNumberOfRow == 0) { if ($open_thead) { echo "\t\n"; } echo "\t\t". "\n"; } else { if ($p['display_thead']) { $this->displaySuperHeader(); } if ($open_thead) { echo "\t\n"; } if ($p['display_tfoot']) { echo "\t\n"; $this->displaySuperHeader(); echo "\t\n"; } foreach ($this->groups as $group) { $group->displayGroup($totalNumberOfColumn, $p); } } echo "
    ".$this->title."
    " . __('None') ."
    \n"; } } ?> glpi-0.84.3+dfsg.1/inc/htmltablerow.class.php000066400000000000000000000131661226600447100207220ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * @since version 0.84 **/ class HTMLTableRow extends HTMLTableEntity { private $group; private $empty = true; private $cells = array(); private $numberOfSubRows = 1; private $linesWithAttributs = array(); /** * @param $group **/ function __construct($group) { $this->group = $group; } function getGroup() { return $this->group; } function notEmpty() { return !$this->empty; } function getNumberOfsubRows() { return $this->numberOfSubRows; } function createAnotherRow() { return $this->group->createRow(); } /** * @param $lineIndex * @param $attributs **/ function addAttributForLine($lineIndex, $attributs) { $this->linesWithAttributs[$lineIndex] = $attributs; } /** * @param $header HTMLTableHeader object * @param $content * @param $father HTMLTableCell object (default NULL) * @param $item CommonDBTM object: The item associated with the current cell (default NULL) **/ function addCell(HTMLTableHeader $header, $content, HTMLTableCell $father=NULL, CommonDBTM $item=NULL) { if (!$this->group->haveHeader($header)) { throw new Exception('Unavailable header !'); } $header_name = $header->getCompositeName(); if (!isset($this->cells[$header_name])) { $this->cells[$header_name] = array(); } $cell = new HTMLTableCell($this, $header, $content, $father, $item); $this->cells[$header_name][] = $cell; $this->empty = false; return $cell; } function prepareDisplay() { if ($this->empty) { return false; } // First, compute the total nomber of rows ... $this->numberOfSubRows = 0; foreach ($this->cells as $cellsOfHeader) { if (isset($cellsOfHeader[0])) { $header = $cellsOfHeader[0]->getHeader(); if (is_null($header->getFather())) { $numberOfSubRowsPerHeader = 0; foreach ($cellsOfHeader as $cell) { $cell->computeNumberOfLines(); $numberOfSubRowsPerHeader += $cell->getNumberOfLines(); } if ($this->numberOfSubRows < $numberOfSubRowsPerHeader) { $this->numberOfSubRows = $numberOfSubRowsPerHeader; } } } } // Then notify each cell and compute its starting row foreach ($this->cells as $cellsOfHeader) { if (isset($cellsOfHeader[0])) { $header = $cellsOfHeader[0]->getHeader(); // Only do this for cells that don't have father: they will propagate this to there sons if (is_null($header->getFather())) { HTMLTableCell::updateCellSteps($cellsOfHeader, $this->numberOfSubRows); $start = 0; foreach ($cellsOfHeader as $cell) { $cell->computeStartEnd($start); } } } } return true; } /** * @param $headers **/ function displayRow($headers) { echo "\tdisplayEntityAttributs(); echo ">\n"; for ($i = 0 ; $i < $this->numberOfSubRows ; $i++) { if (isset($this->linesWithAttributs[$i])) { $options = $this->linesWithAttributs[$i]; } else { $options = array(); } echo "\t\t\n"; foreach ($headers as $header) { $header_name = $header->getCompositeName(); if (isset($this->cells[$header_name])) { $display = false; foreach ($this->cells[$header_name] as $cell) { $display |= $cell->displayCell($i, $options); } if (!$display) { echo "\t\t\tdisplayEntityAttributs($options); echo ">\n"; } } else { echo "\t\t\tdisplayEntityAttributs($options); echo ">\n"; } } echo "\t\t\n"; } echo "\t\n"; } /** * @param $name * @param $sub_name (default NULL) */ function getHeaderByName($name, $sub_name = NULL) { return $this->group->getHeaderByName($name, $sub_name); } } ?> glpi-0.84.3+dfsg.1/inc/htmltablesubheader.class.php000066400000000000000000000047031226600447100220520ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * @since version 0.84 **/ class HTMLTableSubHeader extends HTMLTableHeader { // The headers of each column private $header; /** * @param $header HTMLTableSuperHeader object * @param $name * @param $content see HTMLTableEntity#__construct() * @param $father HTMLTableHeader object (default NULL) **/ function __construct(HTMLTableSuperHeader $header, $name, $content, HTMLTableHeader $father=NULL) { $this->header = $header; parent::__construct($name, $content, $father); $this->copyAttributsFrom($this->header); } function isSuperHeader() { return false; } function getHeaderAndSubHeaderName(&$header_name, &$subheader_name) { $header_name = $this->header->getName(); $subheader_name = parent::getName(); } function getCompositeName() { return $this->header->getCompositeName().$this->getName(); } protected function getTable() { return $this->header->getTable(); } function getHeader() { return $this->header; } /** * @param $numberOfSubHeaders **/ function updateColSpan($numberOfSubHeaders) { $this->setColSpan($this->header->getColSpan() / $numberOfSubHeaders); } } ?> glpi-0.84.3+dfsg.1/inc/htmltablesuperheader.class.php000066400000000000000000000066561226600447100224300ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Only an HTMLTableMain can create an HTMLTableSuperHeader. * @since version 0.84 **/ class HTMLTableSuperHeader extends HTMLTableHeader { /// The headers of each column private $headerSets = array(); /// The table that owns the current super header private $table; /** * @param $table HTMLTableMain object: table owning the current header * @param $name string the name of the header * @param $content see inc/HTMLTableEntity#__construct() * @param $father HTMLTableSuperHeader objet (default NULL) **/ function __construct(HTMLTableMain $table, $name, $content, HTMLTableSuperHeader $father=NULL) { $this->table = $table; parent::__construct($name, $content, $father); } /** * Compute the Least Common Multiple of two integers * * @param $first * @param $second * * @return integer LCM of $first and $second **/ private static function LCM($first, $second) { $result = $first * $second; while ($first > 1) { $reste = $first % $second; if ($reste == 0 ) { $result = $result / $second; break; // leave when LCM is found } $first = $second; $second = $reste; } return $result; } function isSuperHeader() { return true; } /** * @see HTMLTableHeader::getHeaderAndSubHeaderName() **/ function getHeaderAndSubHeaderName(&$header_name, &$subheader_name) { $header_name = $this->getName(); $subheader_name = ''; } function getCompositeName() { return $this->getName().':'; } protected function getTable() { return $this->table; } /** * compute the total number of current super header colspan: it is the Least Common * Multiple of the colspan of each subHeader it owns. * * @param $number the colspan for this header given by the group **/ function updateNumberOfSubHeader($number) { $this->setColSpan(self::LCM($number, $this->getColSpan())); } /** * The super headers always have to be displayed, conversely to sub headers * * @return always true **/ function hasToDisplay() { return true; } } ?>glpi-0.84.3+dfsg.1/inc/includes.php000066400000000000000000000127311226600447100167150ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { define('GLPI_ROOT', dirname(__DIR__)); } include_once (GLPI_ROOT . "/inc/autoload.function.php"); // Init Timer to compute time of display $TIMER_DEBUG = new Timer(); $TIMER_DEBUG->start(); foreach (array('glpi_table_of', 'glpi_foreign_key_field_of') as $session_array_fields) { if (!isset($_SESSION[$session_array_fields])) { $_SESSION[$session_array_fields] = array(); } } /// TODO try to remove them if possible include_once (GLPI_ROOT . "/inc/db.function.php"); // Standard includes include_once (GLPI_ROOT . "/config/config.php"); // Security of PHP_SELF $_SERVER['PHP_SELF'] = Html::cleanParametersURL($_SERVER['PHP_SELF']); // Load Language file Session::loadLanguage(); if (isset($_SESSION['glpi_use_mode']) && ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE)) { $SQL_TOTAL_REQUEST = 0; $DEBUG_SQL["queries"] = array(); $DEBUG_SQL["errors"] = array(); $DEBUG_SQL["times"] = array(); $DEBUG_AUTOLOAD = array(); } // Security system if (isset($_POST)) { if (Toolbox::get_magic_quotes_gpc()) { $_POST = array_map(array('Toolbox', 'stripslashes_deep'), $_POST); } if (isset($_POST['_glpi_simple_form'])) { $_POST = array_map('urldecode', $_POST); } $_POST = array_map(array('Toolbox','addslashes_deep'), $_POST); $_POST = array_map(array('Toolbox', 'clean_cross_side_scripting_deep'), $_POST); } if (isset($_GET)) { if (Toolbox::get_magic_quotes_gpc()) { $_GET = array_map(array('Toolbox', 'stripslashes_deep'), $_GET); } $_GET = array_map(array('Toolbox','addslashes_deep'), $_GET); $_GET = array_map(array('Toolbox', 'clean_cross_side_scripting_deep'), $_GET); } if (isset($_REQUEST)) { if (Toolbox::get_magic_quotes_gpc()) { $_REQUEST = array_map(array('Toolbox', 'stripslashes_deep'), $_REQUEST); } $_REQUEST = array_map(array('Toolbox','addslashes_deep'), $_REQUEST); $_REQUEST = array_map(array('Toolbox', 'clean_cross_side_scripting_deep'), $_REQUEST); } if (isset($_FILES)) { // GPC do not filter $_FILES // if (Toolbox::get_magic_quotes_gpc()) { // $_FILES = array_map(array('Toolbox', 'stripslashes_deep'), $_FILES); // } $_FILES = array_map(array('Toolbox','addslashes_deep'), $_FILES); $_FILES = array_map(array('Toolbox', 'clean_cross_side_scripting_deep'), $_FILES); } // Mark if Header is loaded or not : $HEADER_LOADED = false; $FOOTER_LOADED = false; if (isset($AJAX_INCLUDE)) { $HEADER_LOADED = true; } /* On startup, register all plugins configured for use. */ if (!isset($AJAX_INCLUDE) && !isset($PLUGINS_INCLUDED)) { // PLugin already included $PLUGINS_INCLUDED = 1; $LOADED_PLUGINS = array(); $plugin = new Plugin(); if (!isset($_SESSION["glpi_plugins"])) { $plugin->init(); } if (isset($_SESSION["glpi_plugins"]) && is_array($_SESSION["glpi_plugins"])) { //Plugin::doHook("config"); if (count($_SESSION["glpi_plugins"])) { foreach ($_SESSION["glpi_plugins"] as $name) { Plugin::load($name); } } // For plugins which require action after all plugin init Plugin::doHook("post_init"); } } if (!isset($_SESSION["MESSAGE_AFTER_REDIRECT"])) { $_SESSION["MESSAGE_AFTER_REDIRECT"]=""; } // Manage force tab if (isset($_REQUEST['forcetab'])) { if (preg_match('/([a-zA-Z]+).form.php/',$_SERVER['PHP_SELF'],$matches)) { $itemtype = $matches[1]; Session::setActiveTab($matches[1], $_REQUEST['forcetab']); } } // Manage tabs if (isset($_REQUEST['glpi_tab']) && isset($_REQUEST['itemtype'])) { Session::setActiveTab($_REQUEST['itemtype'], $_REQUEST['glpi_tab']); } // Override list-limit if choosen if (isset($_REQUEST['glpilist_limit'])) { $_SESSION['glpilist_limit'] = $_REQUEST['glpilist_limit']; } // Security : Check HTTP_REFERRER : need to be in GLPI. if (!defined('DO_NOT_CHECK_HTTP_REFERER') && !isCommandLine() && isset($_POST) && is_array($_POST) && count($_POST)) { Toolbox::checkValidReferer(); } // Security : check CSRF token if (GLPI_USE_CSRF_CHECK && isset($_POST) && is_array($_POST) && count($_POST) // ALL plugins need to be CSRF compliant /*&& Plugin::isAllPluginsCSRFCompliant()*/) { // No ajax pages if (!preg_match(':'.$CFG_GLPI['root_doc'].'(/plugins/[^/]*|)/ajax/:', $_SERVER['REQUEST_URI'])) { Session::checkCSRF($_POST); } } // SET new global Token $CURRENTCSRFTOKEN = ''; ?> glpi-0.84.3+dfsg.1/inc/index.php000066400000000000000000000021401226600447100162070ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ ?> glpi-0.84.3+dfsg.1/inc/infocom.class.php000066400000000000000000001745311226600447100176540ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Infocom class **/ class Infocom extends CommonDBChild { // From CommonDBChild static public $itemtype = 'itemtype'; static public $items_id = 'items_id'; public $dohistory = true; public $auto_message_on_action = false; // Link in message can't work' static public $logs_for_parent = false; //Option to automatically fill dates const ON_STATUS_CHANGE = 'STATUS'; const COPY_WARRANTY_DATE = 1; const COPY_BUY_DATE = 2; const COPY_ORDER_DATE = 3; const COPY_DELIVERY_DATE = 4; const ON_ASSET_IMPORT = 5; static function getTypeName($nb=0) { //TRANS: Always plural return __('Financial and administrative information'); } static function canCreate() { return (Session::haveRight('infocom', 'w') && parent::canCreate()); } static function canView() { return (Session::haveRight('infocom', 'r') && parent::canView()); } /** * @since version 0.84 **/ static function canUpdate() { return (Session::haveRight('infocom', 'w') && parent::canUpdate()); } /** * @since version 0.84 **/ static function canDelete() { return (Session::haveRight('infocom', 'w') && parent::canDelete()); } function post_getEmpty() { $this->fields["alert"] = Entity::getUsedConfig("use_infocoms_alert", $this->fields["entities_id"], "default_infocom_alert", 0); } function getLogTypeID() { return array($this->fields['itemtype'], $this->fields['items_id']); } /** * @see CommonGLPI::getTabNameForItem() **/ function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { // Can exists on template if (Session::haveRight("infocom","r")) { switch ($item->getType()) { case 'Supplier' : if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(_n('Item', 'Items', 2), self::countForSupplier($item)); } return _n('Item', 'Items', 2); default : if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(__('Management'), countElementsInTable('glpi_infocoms', "`itemtype` = '".$item->getType()."' AND `items_id` = '".$item->getID()."'")); } return __('Management'); } } return ''; } /** * @param $item CommonGLPI object * @param $tabnum (default 1) * @param $withtemplate (default 0) **/ static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($item->getType()) { case 'Supplier' : $item->showInfocoms(); break; default : self::showForItem($item, $withtemplate); } return true; } /** * @param $item Supplier object **/ static function countForSupplier(Supplier $item) { $restrict = "`glpi_infocoms`.`suppliers_id` = '".$item->getField('id') ."' AND `itemtype` NOT IN ('ConsumableItem', 'CartridgeItem', 'Software') ". getEntitiesRestrictRequest(" AND ", "glpi_infocoms", '', $_SESSION['glpiactiveentities']); return countElementsInTable(array('glpi_infocoms'), $restrict); } static function getSpecificValueToDisplay($field, $values, array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } switch ($field) { case 'sink_type' : return self::getAmortTypeName($values[$field]); case 'alert' : return self::getAlertName($values[$field]); } return parent::getSpecificValueToDisplay($field, $values, $options); } /** * @since version 0.84 * * @param $field * @param $name (default '') * @param $values (default '') * @param $options array **/ static function getSpecificValueToSelect($field, $name='', $values='', array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case "sink_type" : return self::dropdownAmortType($name, $values[$field], false); case "alert" : $options['name'] = $name; $options['value'] = $values[$field]; return self::dropdownAlert($options); } return parent::getSpecificValueToSelect($field, $name, $values, $options); } /** * Retrieve an item from the database for a device * * @param $itemtype type of the device to retrieve infocom * @param $ID ID of the device to retrieve infocom * * @return true if succeed else false **/ function getFromDBforDevice ($itemtype, $ID) { if ($this->getFromDBByQuery("WHERE `".$this->getTable()."`.`items_id` = '$ID' AND `".$this->getTable()."`.`itemtype` = '$itemtype'")) { return true; } $this->getEmpty(); $this->fields["items_id"] = $ID; $this->fields["itemtype"] = $itemtype; return false; } /** * @see CommonDBChild::prepareInputForAdd() **/ function prepareInputForAdd($input) { global $CFG_GLPI; if (!$this->getFromDBforDevice($input['itemtype'],$input['items_id'])) { if ($item = static::getItemFromArray(static::$itemtype, static::$items_id, $input)) { $input['alert'] = Entity::getUsedConfig('default_infocom_alert', $item->getEntityID()); return parent::prepareInputForAdd($input); } } return false; } /** * Fill, if necessary, automatically some dates when status changes * * @param item CommonDBTM object: the item whose status have changed * @param action_add true if object is added, false if updated (true by default) * * @return nothing **/ static function manageDateOnStatusChange(CommonDBTM $item, $action_add=true) { global $CFG_GLPI; $itemtype = get_class($item); $changes = $item->fields; //Autofill date on item's status change ? $infocom = new self(); $infocom->getFromDB($changes['id']); $tmp = array('itemtype' => $itemtype, 'items_id' => $changes['id']); $add_or_update = false; //For each date that can be automatically filled foreach (self::getAutoManagemendDatesFields() as $date => $date_field) { $resp = array(); $result = Entity::getUsedConfig($date, $changes['entities_id']); //Date must be filled if status corresponds to the one defined in the config if (preg_match('/'.self::ON_STATUS_CHANGE.'_(.*)/',$result,$values) && ($values[1] == $changes['states_id'])) { $add_or_update = true; $tmp[$date_field] = $_SESSION["glpi_currenttime"]; } } //One date or more has changed if ($add_or_update) { if (!$infocom->getFromDBforDevice($itemtype,$changes['id'])) { $infocom->add($tmp); } else { $tmp['id'] = $infocom->fields['id']; $infocom->update($tmp); } } } /** * Automatically manage copying one date to another is necessary * * @param infocoms array of item's infocom to modify * @param field the date to modify (default '') * @param action the action to peform (copy from another date) (default 0) * @param params array of additional parameters needed to perform the task * * @return nothing **/ static function autofillDates(&$infocoms=array(), $field='', $action=0, $params=array()) { if (isset($infocoms[$field])) { switch ($action) { default : case 0 : break; case self::COPY_WARRANTY_DATE : if ($infocoms[$field] && isset($infocoms['warranty_date'])) { $infocoms[$field] = $infocoms['warranty_date']; } break; case self::COPY_BUY_DATE : if ($infocoms[$field] && isset($infocoms['buy_date'])) { $infocoms[$field] = $infocoms['buy_date']; } break; case self::COPY_ORDER_DATE : if ($infocoms[$field] && isset($infocoms['order_date'])) { $infocoms[$field] = $infocoms['order_date']; } break; case self::COPY_DELIVERY_DATE : if ($infocoms[$field] && isset($infocoms['delivery_date'])) { $infocoms[$field] = $infocoms['delivery_date']; } break; } } } /** * Return all infocom dates that could be automaticall filled * * @return an array with all dates (configuration field & real field) **/ static function getAutoManagemendDatesFields() { return array('autofill_buy_date' => 'buy_date', 'autofill_use_date' => 'use_date', 'autofill_delivery_date' => 'delivery_date', 'autofill_warranty_date' => 'warranty_date', 'autofill_order_date' => 'order_date'); } /** * @see CommonDBChild::prepareInputForUpdate() **/ function prepareInputForUpdate($input) { // TODO: Check because I replaced creation of a cloned infocom by $this if (isset($input['warranty_duration'])) { $input['_warranty_duration'] = $this->fields['warranty_duration']; } //Check if one or more dates needs to be updated foreach (self::getAutoManagemendDatesFields() as $key => $field) { $result = Entity::getUsedConfig($key, $this->fields['entities_id']); //Only update date if it's empty in DB. Otherwise do nothing if (($result > 0) && !isset($this->fields[$field])) { self::autofillDates($input, $field, $result); } } return parent::prepareInputForUpdate($input); } function pre_updateInDB() { // Clean end alert if buy_date is after old one // Or if duration is greater than old one if ((isset($this->oldvalues['warranty_date']) && ($this->oldvalues['warranty_date'] < $this->fields['warranty_date'])) || (isset($this->oldvalues['warranty_duration']) && ($this->oldvalues['warranty_duration'] < $this->fields['warranty_duration']))) { $alert = new Alert(); $alert->clear($this->getType(), $this->fields['id'], Alert::END); } } /** * @since version 0.84 **/ function cleanDBonPurge() { $class = new Alert(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); } /** * @param $name **/ static function cronInfo($name) { return array('description' => __('Send alarms on financial and administrative information')); } /** * Cron action on infocom : alert on expired warranty * * @param $task to log, if NULL use display (default NULL) * * @return 0 : nothing to do 1 : done with success **/ static function cronInfocom($task=NULL) { global $DB, $CFG_GLPI; if (!$CFG_GLPI["use_mailing"]) { return 0; } $message = array(); $cron_status = 0; $items_infos = array(); $items_messages = array(); foreach (Entity::getEntitiesToNotify('use_infocoms_alert') as $entity => $value) { $before = Entity::getUsedConfig('send_infocoms_alert_before_delay', $entity); $query_end = "SELECT `glpi_infocoms`.* FROM `glpi_infocoms` LEFT JOIN `glpi_alerts` ON (`glpi_infocoms`.`id` = `glpi_alerts`.`items_id` AND `glpi_alerts`.`itemtype` = 'Infocom' AND `glpi_alerts`.`type`='".Alert::END."') WHERE (`glpi_infocoms`.`alert` & ".pow(2,Alert::END).") >'0' AND `glpi_infocoms`.`entities_id`='".$entity."' AND `glpi_infocoms`.`warranty_duration`>'0' AND `glpi_infocoms`.`warranty_date` IS NOT NULL AND DATEDIFF(ADDDATE(`glpi_infocoms`.`warranty_date`, INTERVAL (`glpi_infocoms`.`warranty_duration`) MONTH), CURDATE() ) <= '$before' AND `glpi_alerts`.`date` IS NULL"; foreach ($DB->request($query_end) as $data) { if ($item_infocom = getItemForItemtype($data["itemtype"])) { if ($item_infocom->getFromDB($data["items_id"])) { $entity = $data['entities_id']; $warranty = self::getWarrantyExpir($data["warranty_date"], $data["warranty_duration"]); //TRANS: %1$s is a type, %2$s is a name (used in croninfocom) $name = sprintf(__('%1$s - %2$s'), $item_infocom->getTypeName(1), $item_infocom->getName()); //TRANS: %1$s is the warranty end date and %2$s the name of the item $message = sprintf(__('Item reaching the end of warranty on %1$s: %2$s'), $warranty, $name)."
    "; $data['warrantyexpiration'] = $warranty; $data['item_name'] = $item_infocom->getName(); $items_infos[$entity][$data['id']] = $data; if (!isset($items_messages[$entity])) { $items_messages[$entity] = __('No item reaching the end of warranty.')."
    "; } $items_messages[$entity] .= $message; } } } } foreach ($items_infos as $entity => $items) { if (NotificationEvent::raiseEvent("alert", new self(), array('entities_id' => $entity, 'items' => $items))) { $message = $items_messages[$entity]; $cron_status = 1; if ($task) { $task->log(sprintf(__('%1$s: %2$s')."\n", Dropdown::getDropdownName("glpi_entities", $entity), $message)); $task->addVolume(1); } else { Session::addMessageAfterRedirect(sprintf(__('%1$s: %2$s'), Dropdown::getDropdownName("glpi_entities", $entity), $message)); } $alert = new Alert(); $input["itemtype"] = 'Infocom'; $input["type"] = Alert::END; foreach ($items as $id => $item) { $input["items_id"] = $id; $alert->add($input); unset($alert->fields['id']); } } else { $entityname = Dropdown::getDropdownName('glpi_entities', $entity); //TRANS: %s is entity name $msg = sprintf(__('%1$s: %2$s'), $entityname, __('send infocom alert failed')); if ($task) { $task->log($msg); } else { Session::addMessageAfterRedirect($msg, false, ERROR); } } } return $cron_status; } /** * Get the possible value for infocom alert * * @since version 0.84 (before in alert.class) * * @param $val if not set, ask for all values, else for 1 value (default NULL) * * @return array or string **/ static function getAlertName($val=NULL) { $tmp[0] = Dropdown::EMPTY_VALUE; $tmp[pow(2, Alert::END)] = __('Warranty expiration date'); if (is_null($val)) { return $tmp; } if (isset($tmp[$val])) { return $tmp[$val]; } // If not set and is a string return value if (is_string($val)) { return $val; } return NOT_AVAILABLE; } /** * @param $options array **/ static function dropdownAlert($options) { $p['name'] = 'alert'; $p['value'] = 0; $p['display'] = true; $p['inherit_parent'] = false; if (count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } $tab = array(); if ($p['inherit_parent']) { $tab[Entity::CONFIG_PARENT] = __('Inheritance of the parent entity'); } $tab += self::getAlertName(); return Dropdown::showFromArray($p['name'], $tab, $p); } /** * Dropdown of amortissement type for infocoms * * @param $name select name * @param $value default value (default 0) * @param $display display or get string (true by default) **/ static function dropdownAmortType($name, $value=0, $display=true) { $output = ""; if ($display) { echo $output; } else { return $output; } } /** * Get amortissement type name for infocoms * * @param $value status ID **/ static function getAmortTypeName($value) { switch ($value) { case 2 : return __('Linear'); case 1 : return __('Decreasing'); case 0 : return ""; } } /** * Calculate TCO and TCO by month for an item * * @param $ticket_tco Tco part of tickets * @param $value * @param $date_achat (default '') * * @return float **/ static function showTco($ticket_tco, $value, $date_achat="") { // Affiche le TCO ou le TCO mensuel pour un matériel $totalcost = $ticket_tco; if ($date_achat) { // on veut donc le TCO mensuel // just to avoid IDE warning $date_Y = $date_m = $date_d = 0; sscanf($date_achat, "%4s-%2s-%2s", $date_Y, $date_m, $date_d); $timestamp2 = mktime(0,0,0, $date_m, $date_d, $date_Y); $timestamp = mktime(0,0,0, date("m"), date("d"), date("Y")); $diff = floor(($timestamp - $timestamp2) / (MONTH_TIMESTAMP)); // Mois d'utilisation if ($diff) { return Html::formatNumber((($totalcost+$value)/$diff)); // TCO mensuel } return ""; } return Html::formatNumber(($totalcost+$value)); // TCO }// fin showTCO /** * Show infocom link to display popup * * @param $itemtype integer item type * @param $device_id integer item ID * @param $update integer (default 0) * * @return float **/ static function showDisplayLink($itemtype, $device_id, $update=0) { global $DB, $CFG_GLPI; if (!Session::haveRight("infocom","r") || !($item = getItemForItemtype($itemtype))) { return false; } $query = "SELECT COUNT(*) FROM `glpi_infocoms` WHERE `items_id` = '$device_id' AND `itemtype` = '$itemtype'"; $add = "add"; $text = __('Add'); $result = $DB->query($query); if ($DB->result($result,0,0) > 0) { $add = ""; $text = __('Show'); } else if (!Session::haveRight("infocom","w")) { return false; } if ($item->canView()) { echo " \"$text\" "; } } /** * Calculate amortissement for an item * * @param $type_amort type d'amortisssment "lineaire=2" ou "degressif=1" * @param $va valeur d'acquisition * @param $duree duree d'amortissement * @param $coef coefficient d'amortissement * @param $date_achat Date d'achat * @param $date_use Date d'utilisation * @param $date_tax date du debut de l'annee fiscale * @param $view "n" pour l'annee en cours ou "all" pour le tableau complet (default 'n') * * @return float or array **/ static function Amort($type_amort, $va, $duree, $coef, $date_achat, $date_use, $date_tax, $view="n") { // By Jean-Mathieu Doleans qui s'est un peu pris le chou :p // Attention date mise en service/dateachat ->amort lineaire et $prorata en jour !! // amort degressif au prorata du nombre de mois. // Son point de depart est le 1er jour du mois d'acquisition et non date de mise en service if ($type_amort == "2") { if (!empty($date_use)) { $date_achat = $date_use; } } $prorata = 0; $ecartfinmoiscourant = 0; $ecartmoisexercice = 0; $date_Y = $date_m = $date_d = $date_H = $date_i = $date_s = 0; sscanf($date_achat, "%4s-%2s-%2s %2s:%2s:%2s", $date_Y, $date_m, $date_d, $date_H, $date_i, $date_s); // un traitement sur la date mysql pour recuperer l'annee // un traitement sur la date mysql pour les infos necessaires $date_Y2 = $date_m2 = $date_d2 = $date_H2 = $date_i2 = $date_s2=0; sscanf($date_tax, "%4s-%2s-%2s %2s:%2s:%2s", $date_Y2, $date_m2, $date_d2, $date_H2, $date_i2, $date_s2); $date_Y2 = date("Y"); switch ($type_amort) { case "2" : ########################### Calcul amortissement lineaire ########################### if (($va > 0) && ($duree > 0) && !empty($date_achat)) { ## calcul du prorata temporis en jour ## $ecartfinmoiscourant = (30-$date_d); // calcul ecart entre jour date acquis // ou mise en service et fin du mois courant // en lineaire on calcule en jour if ($date_d2 < 30) { $ecartmoisexercice = (30-$date_d2); } if ($date_m > $date_m2) { $date_m2 = $date_m2+12; } // si l'annee fiscale debute au dela de l'annee courante $ecartmois = (($date_m2-$date_m)*30); // calcul ecart entre mois d'acquisition // et debut annee fiscale $prorata = $ecartfinmoiscourant+$ecartmois-$ecartmoisexercice; ## calcul tableau d'amortissement ## $txlineaire = (100/$duree); // calcul du taux lineaire $annuite = ($va*$txlineaire)/100; // calcul de l'annuitee $mrt = $va; // // si prorata temporis la derniere annnuite cours sur la duree n+1 if ($prorata > 0) { $duree = $duree+1; } for($i=1 ; $i<=$duree ; $i++) { $tab['annee'][$i] = $date_Y+$i-1; $tab['annuite'][$i] = $annuite; $tab['vcnetdeb'][$i] = $mrt; // Pour chaque annee on calcul la valeur comptable nette // de debut d'exercice $tab['vcnetfin'][$i] = abs(($mrt - $annuite)); // Pour chaque annee on calcule la valeur // comptable nette de fin d'exercice // calcul de la premiere annuite si prorata temporis if ($prorata >0) { $tab['annuite'][1] = $annuite*($prorata/360); $tab['vcnetfin'][1] = abs($va - $tab['annuite'][1]); } $mrt = $tab['vcnetfin'][$i]; } // calcul de la derniere annuite si prorata temporis if ($prorata > 0) { $tab['annuite'][$duree] = $tab['vcnetdeb'][$duree]; $tab['vcnetfin'][$duree] = $tab['vcnetfin'][$duree-1] - $tab['annuite'][$duree]; } } else { return "-"; } break; case "1" : ########################### Calcul amortissement degressif ########################### if (($va > 0) && ($duree > 0) && ($coef > 1) && !empty($date_achat)) { ## calcul du prorata temporis en mois ## // si l'annee fiscale debute au dela de l'annee courante if ($date_m > $date_m2) { $date_m2 = $date_m2+12; } $ecartmois = ($date_m2-$date_m)+1; // calcul ecart entre mois d'acquisition // et debut annee fiscale $prorata = $ecartfinmoiscourant+$ecartmois-$ecartmoisexercice; ## calcul tableau d'amortissement ## $txlineaire = (100/$duree); // calcul du taux lineaire virtuel $txdegressif = $txlineaire*$coef; // calcul du taux degressif $dureelineaire = (int) (100/$txdegressif); // calcul de la duree de l'amortissement // en mode lineaire $dureedegressif = $duree-$dureelineaire; // calcul de la duree de l'amortissement // en mode degressif $mrt = $va; // amortissement degressif pour les premieres annees for($i=1 ; $i<=$dureedegressif ; $i++) { $tab['annee'][$i] = $date_Y+$i-1; $tab['vcnetdeb'][$i] = $mrt; // Pour chaque annee on calcule la valeur comptable nette // de debut d'exercice $tab['annuite'][$i] = $tab['vcnetdeb'][$i]*$txdegressif/100; $tab['vcnetfin'][$i] = $mrt - $tab['annuite'][$i]; //Pour chaque annee on calcule la valeur //comptable nette de fin d'exercice // calcul de la premiere annuite si prorata temporis if ($prorata > 0) { $tab['annuite'][1] = ($va*$txdegressif/100)*($prorata/12); $tab['vcnetfin'][1] = $va - $tab['annuite'][1]; } $mrt = $tab['vcnetfin'][$i]; } // amortissement en lineaire pour les derneres annees if ($dureelineaire != 0) { $txlineaire = (100/$dureelineaire); // calcul du taux lineaire } else { $txlineaire = 100; } $annuite = ($tab['vcnetfin'][$dureedegressif]*$txlineaire)/100; // calcul de l'annuite $mrt = $tab['vcnetfin'][$dureedegressif]; for($i=$dureedegressif+1 ; $i<=$dureedegressif+$dureelineaire ; $i++) { $tab['annee'][$i] = $date_Y+$i-1; $tab['annuite'][$i] = $annuite; $tab['vcnetdeb'][$i] = $mrt; // Pour chaque annee on calcule la valeur comptable nette // de debut d'exercice $tab['vcnetfin'][$i] = abs(($mrt - $annuite)); // Pour chaque annee on calcule la valeur // comptable nette de fin d'exercice $mrt = $tab['vcnetfin'][$i]; } // calcul de la derniere annuite si prorata temporis if ($prorata > 0) { $tab['annuite'][$duree] = $tab['vcnetdeb'][$duree]; if (isset($tab['vcnetfin'][$duree-1])) { $tab['vcnetfin'][$duree] = ($tab['vcnetfin'][$duree-1] - $tab['annuite'][$duree]); } else { $tab['vcnetfin'][$duree] = 0; } } } else { return "-"; } break; default : return "-"; } // le return if ($view == "all") { // on retourne le tableau complet return $tab; } // on retourne juste la valeur residuelle // si on ne trouve pas l'annee en cours dans le tableau d'amortissement dans le tableau, // le materiel est amorti if (!array_search(date("Y"),$tab["annee"])) { $vnc = 0; } else if (mktime(0 , 0 , 0, $date_m2, $date_d2, date("Y")) - mktime(0 , 0 , 0 , date("m") , date("d") , date("Y")) < 0 ) { // on a depasse la fin d'exercice de l'annee en cours //on prend la valeur residuelle de l'annee en cours $vnc = $tab["vcnetfin"][array_search(date("Y"), $tab["annee"])]; } else { // on se situe avant la fin d'exercice // on prend la valeur residuelle de l'annee n-1 $vnc = $tab["vcnetdeb"][array_search(date("Y"), $tab["annee"])]; } return $vnc; } /** * Show Infocom form for an item (not a standard showForm) * * @param $item CommonDBTM object * @param $withtemplate integer template or basic item (default '') **/ static function showForItem(CommonDBTM $item, $withtemplate='') { global $CFG_GLPI; // Show Infocom or blank form if (!Session::haveRight("infocom","r")) { return false; } if (!$item) { echo "
    ".__('Requested item not found')."
    "; } else { $date_tax = $CFG_GLPI["date_tax"]; $dev_ID = $item->getField('id'); $ic = new self(); $option = ""; if ($withtemplate == 2) { $option = " readonly "; } if (!strpos($_SERVER['PHP_SELF'],"infocoms-show") && in_array($item->getType(), array('CartridgeItem', 'ConsumableItem', 'Software'))) { echo "
    ". __('For this type of item, the financial and administrative information are only a model for the items which you should add.'). "
    "; } if (!$ic->getFromDBforDevice($item->getType(),$dev_ID)) { $input = array('itemtype' => $item->getType(), 'items_id' => $dev_ID, 'entities_id' => $item->getEntityID()); if ($ic->can(-1,"w",$input) && ($withtemplate != 2)) { echo "
    "; echo ""; echo "
    "; echo sprintf(__('%1$s - %2$s'), $item->getTypeName(1), $item->getName())."
    "; Html::showSimpleForm($CFG_GLPI["root_doc"]."/front/infocom.form.php", 'add', __('Enable the financial and administrative information'), array('itemtype' => $item->getType(), 'items_id' => $dev_ID)); echo "
    "; } } else { // getFromDBforDevice $canedit = ($ic->can($ic->fields['id'], "w") && ($withtemplate != 2)); if ($canedit) { echo "
    "; } echo "
    "; echo ""; echo ""; echo ""; echo ""; echo ""; if (Session::haveRight("budget","r")) { echo ""; // Can edit calendar ? $editcalendar = ($withtemplate != 2); echo ""; echo ""; echo ""; echo ""; echo ""; $istemplate = ''; if ($item->isTemplate() || in_array($item->getType(), array('CartridgeItem', 'ConsumableItem', 'Software'))) { $istemplate = '*'; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if (!in_array($item->getType(), array('Cartridge', 'CartridgeItem', 'Consumable', 'ConsumableItem', 'Software', 'SoftwareLicense'))) { echo ""; if (!in_array($item->getType(), array('Cartridge', 'CartridgeItem', 'Consumable', 'ConsumableItem', 'Software', 'SoftwareLicense'))) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if ($CFG_GLPI['use_mailing']) { echo ""; echo ""; } else { echo ""; if ($canedit) { echo ""; echo ""; echo ""; echo "
    ".__('Financial and administrative information')."
    ".__('Supplier').""; if ($withtemplate == 2) { echo Dropdown::getDropdownName("glpi_suppliers", $ic->fields["suppliers_id"]); } else { Supplier::dropdown(array('value' => $ic->fields["suppliers_id"], 'entity' => $item->getEntityID())); } echo "".__('Budget').""; Budget::dropdown(array('value' => $ic->fields["budgets_id"], 'entity' => $item->getEntityID(), 'comments' => 1)); } else { echo ""; } echo "
    ".__('Order number').""; Html::autocompletionTextField($ic, "order_number", array('option' => $option)); echo "".__('Order date').""; Html::showDateFormItem("order_date", $ic->fields["order_date"], true, $editcalendar); echo "
    ".sprintf(__('%1$s%2$s'), __('Immobilization number'), $istemplate).""; $objectName = autoName($ic->fields["immo_number"], "immo_number", ($withtemplate == 2), 'Infocom', $item->getEntityID()); Html::autocompletionTextField($ic, "immo_number", array('value' => $objectName, 'option' => $option)); echo "".__('Date of purchase').""; Html::showDateFormItem("buy_date", $ic->fields["buy_date"], true, $editcalendar); echo "
    ".__('Invoice number').""; Html::autocompletionTextField($ic, "bill", array('option' => $option)); echo "".__('Delivery date').""; Html::showDateFormItem("delivery_date", $ic->fields["delivery_date"], true, $editcalendar); echo "
    ".__('Delivery form').""; Html::autocompletionTextField($ic, "delivery_number", array('option' => $option)); echo "".__('Startup date').""; Html::showDateFormItem("use_date",$ic->fields["use_date"], true, $editcalendar); echo "
    ".__('Value')."".__('Date of last physical inventory').""; Html::showDateFormItem("inventory_date",$ic->fields["inventory_date"], true, $editcalendar); echo "
    ".__('Warranty extension value')."".__('Comments').""; echo "
    ".__('Account net value').""; echo Html::formatNumber(self::Amort($ic->fields["sink_type"], $ic->fields["value"], $ic->fields["sink_time"], $ic->fields["sink_coeff"], $ic->fields["warranty_date"], $ic->fields["use_date"], $date_tax,"n")); echo "
    ".__('Amortization type').""; if ($withtemplate == 2) { echo self::getAmortTypeName($ic->fields["sink_type"]); } else { self::dropdownAmortType("sink_type", $ic->fields["sink_type"]); } echo "
    ".__('Amortization duration').""; if ($withtemplate == 2) { printf(_n('%d year', '%d years', $ic->fields["sink_time"]), $ic->fields["sink_time"]); } else { Dropdown::showNumber("sink_time", array('value' => $ic->fields["sink_time"], 'max' => 15, 'unit' => 'year')); } echo "
    ".__('Amortization coefficient').""; Html::autocompletionTextField($ic, "sink_coeff", array('size' => 14, 'option' => $option)); echo "
    ".__('TCO (value + tracking cost)').""; echo self::showTco($item->getField('ticket_tco'), $ic->fields["value"]); } else { echo ""; } echo "".__('Monthly TCO').""; echo self::showTco($item->getField('ticket_tco'), $ic->fields["value"], $ic->fields["warranty_date"]); } else { echo ""; } echo "
    ".__('Warranty information')."
    ".__('Start date of warranty').""; Html::showDateFormItem("warranty_date", $ic->fields["warranty_date"], true, $editcalendar); echo "".__('Warranty duration').""; if ($withtemplate == 2) { // -1 = life if ($ic->fields["warranty_duration"] == -1) { _e('Lifelong'); } else { printf(_n('%d month', '%d months', $ic->fields["warranty_duration"]), $ic->fields["warranty_duration"]); } } else { Dropdown::showInteger("warranty_duration", $ic->fields["warranty_duration"], 0, 120, 1, array(-1 => __('Lifelong')), array('unit' => 'month')); } $tmpdat = self::getWarrantyExpir($ic->fields["warranty_date"], $ic->fields["warranty_duration"], 0, true); if ($tmpdat) { echo "".sprintf(__('Valid to %s'), $tmpdat).""; } echo "
    ".__('Warranty information').""; Html::autocompletionTextField($ic, "warranty_info", array('option' => $option)); echo "".__('Alarms on financial and administrative information').""; self::dropdownAlert(array('name' => "alert", 'value' => $ic->fields["alert"])); Alert::displayLastAlert('Infocom', $ic->fields['id']); echo ""; } echo "
    "; echo ""; echo ""; echo ""; echo ""; echo "
    "; Html::closeForm(); } else { echo "
    "; } } } } /** * @param $itemtype **/ static function getSearchOptionsToAdd($itemtype) { // if ($itemtype == 'CartridgeItem') { // // Return the infocom linked to the Cartridge, not the template linked to the Type // $out = Search::addLeftJoin($itemtype, $rt, $already_link_tables, "glpi_cartridges", // $linkfield); // $specific_leftjoin = $out." // LEFT JOIN `$new_table` $AS ON (`glpi_cartridges`.`id` = `$nt`.`items_id` // AND `$nt`.`itemtype` = 'Cartridge') "; // } // if ($itemtype == 'ConsumableItem') { // // Return the infocom linked to the Comsumable, not the template linked to the Type // $out = Search::addLeftJoin($itemtype, $rt, $already_link_tables, "glpi_consumables", // $linkfield); // $specific_leftjoin = $out." // LEFT JOIN `$new_table` $AS ON (glpi_consumables.`id` = `$nt`.`items_id` // AND `$nt`.`itemtype` = 'Consumable') "; // } $specific_itemtype = ''; $beforejoin = array(); switch ($itemtype) { case 'Software' : // Return the infocom linked to the license, not the template linked to the software $beforejoin = array('table' => 'glpi_softwarelicenses', 'joinparams' => array('jointype' => 'child')); $specific_itemtype = 'SoftwareLicense'; break; case 'CartridgeItem' : // Return the infocom linked to the license, not the template linked to the software $beforejoin = array('table' => 'glpi_cartridges', 'joinparams' => array('jointype' => 'child')); $specific_itemtype = 'Cartridge'; break; case 'ConsumableItem' : // Return the infocom linked to the license, not the template linked to the software $beforejoin = array('table' => 'glpi_consumables', 'joinparams' => array('jointype' => 'child')); $specific_itemtype = 'Consumable'; break; } $joinparams = array('jointype' => 'itemtype_item', 'specific_itemtype' => $specific_itemtype); $complexjoinparams = array(); if (count($beforejoin)) { $complexjoinparams['beforejoin'][] = $beforejoin; $joinparams['beforejoin'] = $beforejoin; } $complexjoinparams['beforejoin'][] = array('table' => 'glpi_infocoms', 'joinparams' => $joinparams); $tab = array(); $tab['financial'] = __('Financial and administrative information'); $tab[25]['table'] = 'glpi_infocoms'; $tab[25]['field'] = 'immo_number'; $tab[25]['name'] = __('Immobilization number'); $tab[25]['forcegroupby'] = true; $tab[25]['joinparams'] = $joinparams; $tab[25]['datatype'] = 'string'; $tab[26]['table'] = 'glpi_infocoms'; $tab[26]['field'] = 'order_number'; $tab[26]['name'] = __('Order number'); $tab[26]['forcegroupby'] = true; $tab[26]['joinparams'] = $joinparams; $tab[26]['datatype'] = 'string'; $tab[27]['table'] = 'glpi_infocoms'; $tab[27]['field'] = 'delivery_number'; $tab[27]['name'] = __('Delivery form'); $tab[27]['forcegroupby'] = true; $tab[27]['joinparams'] = $joinparams; $tab[27]['datatype'] = 'string'; $tab[28]['table'] = 'glpi_infocoms'; $tab[28]['field'] = 'bill'; $tab[28]['name'] = __('Invoice number'); $tab[28]['forcegroupby'] = true; $tab[28]['joinparams'] = $joinparams; $tab[28]['datatype'] = 'string'; $tab[37]['table'] = 'glpi_infocoms'; $tab[37]['field'] = 'buy_date'; $tab[37]['name'] = __('Date of purchase'); $tab[37]['datatype'] = 'date'; $tab[37]['forcegroupby'] = true; $tab[37]['joinparams'] = $joinparams; $tab[38]['table'] = 'glpi_infocoms'; $tab[38]['field'] = 'use_date'; $tab[38]['name'] = __('Startup date'); $tab[38]['datatype'] = 'date'; $tab[38]['forcegroupby'] = true; $tab[38]['joinparams'] = $joinparams; $tab[121]['table'] = 'glpi_infocoms'; $tab[121]['field'] = 'delivery_date'; $tab[121]['name'] = __('Delivery date'); $tab[121]['datatype'] = 'date'; $tab[121]['forcegroupby'] = true; $tab[121]['joinparams'] = $joinparams; $tab[124]['table'] = 'glpi_infocoms'; $tab[124]['field'] = 'order_date'; $tab[124]['name'] = __('Order date'); $tab[124]['datatype'] = 'date'; $tab[124]['forcegroupby'] = true; $tab[124]['joinparams'] = $joinparams; $tab[123]['table'] = 'glpi_infocoms'; $tab[123]['field'] = 'warranty_date'; $tab[123]['name'] = __('Start date of warranty'); $tab[123]['datatype'] = 'date'; $tab[123]['forcegroupby'] = true; $tab[123]['joinparams'] = $joinparams; $tab[125]['table'] = 'glpi_infocoms'; $tab[125]['field'] = 'inventory_date'; $tab[125]['name'] = __('Date of last physical inventory'); $tab[125]['datatype'] = 'date'; $tab[125]['forcegroupby'] = true; $tab[125]['joinparams'] = $joinparams; $tab[50]['table'] = 'glpi_budgets'; $tab[50]['field'] = 'name'; $tab[50]['datatype'] = 'dropdown'; $tab[50]['name'] = __('Budget'); $tab[50]['forcegroupby'] = true; $tab[50]['joinparams'] = $complexjoinparams; $tab[51]['table'] = 'glpi_infocoms'; $tab[51]['field'] = 'warranty_duration'; $tab[51]['name'] = __('Warranty duration'); $tab[51]['forcegroupby'] = true; $tab[51]['joinparams'] = $joinparams; $tab[51]['datatype'] = 'number'; $tab[51]['unit'] = 'month'; $tab[51]['max'] = 120; $tab[51]['toadd'] = array(-1 => __('Lifelong')); $tab[52]['table'] = 'glpi_infocoms'; $tab[52]['field'] = 'warranty_info'; $tab[52]['name'] = __('Warranty information'); $tab[52]['forcegroupby'] = true; $tab[52]['joinparams'] = $joinparams; $tab[52]['datatype'] = 'string'; $tab[120]['table'] = 'glpi_infocoms'; $tab[120]['field'] = 'end_warranty'; $tab[120]['name'] = __('Warranty expiration date'); $tab[120]['datatype'] = 'date_delay'; $tab[120]['datafields'][1] = 'warranty_date'; $tab[120]['datafields'][2] = 'warranty_duration'; $tab[120]['searchunit'] = 'MONTH'; $tab[120]['delayunit'] = 'MONTH'; $tab[120]['forcegroupby'] = true; $tab[120]['massiveaction'] = false; $tab[120]['joinparams'] = $joinparams; $tab[53]['table'] = 'glpi_suppliers'; $tab[53]['field'] = 'name'; $tab[53]['datatype'] = 'dropdown'; $tab[53]['name'] = __('Supplier'); $tab[53]['forcegroupby'] = true; $tab[53]['joinparams'] = $complexjoinparams; $tab[54]['table'] = 'glpi_infocoms'; $tab[54]['field'] = 'value'; $tab[54]['name'] = __('Value'); $tab[54]['datatype'] = 'decimal'; $tab[54]['width'] = 100; $tab[54]['forcegroupby'] = true; $tab[54]['joinparams'] = $joinparams; $tab[55]['table'] = 'glpi_infocoms'; $tab[55]['field'] = 'warranty_value'; $tab[55]['name'] = __('Warranty extension value'); $tab[55]['datatype'] = 'decimal'; $tab[55]['width'] = 100; $tab[55]['forcegroupby'] = true; $tab[55]['joinparams'] = $joinparams; $tab[56]['table'] = 'glpi_infocoms'; $tab[56]['field'] = 'sink_time'; $tab[56]['name'] = __('Amortization duration'); $tab[56]['forcegroupby'] = true; $tab[56]['joinparams'] = $joinparams; $tab[56]['datatype'] = 'number'; $tab[56]['max'] = 15; $tab[56]['unit'] = 'year'; $tab[57]['table'] = 'glpi_infocoms'; $tab[57]['field'] = 'sink_type'; $tab[57]['name'] = __('Amortization type'); $tab[57]['forcegroupby'] = true; $tab[57]['joinparams'] = $joinparams; $tab[57]['datatype'] = 'specific'; $tab[58]['table'] = 'glpi_infocoms'; $tab[58]['field'] = 'sink_coeff'; $tab[58]['name'] = __('Amortization coefficient'); $tab[58]['forcegroupby'] = true; $tab[58]['joinparams'] = $joinparams; $tab[58]['datatype'] = 'decimal'; $tab[59]['table'] = 'glpi_infocoms'; $tab[59]['field'] = 'alert'; $tab[59]['name'] = __('Email alarms'); $tab[59]['forcegroupby'] = true; $tab[59]['joinparams'] = $joinparams; $tab[59]['datatype'] = 'specific'; $tab[122]['table'] = 'glpi_infocoms'; $tab[122]['field'] = 'comment'; $tab[122]['name'] = __('Comments on financial and administrative information'); $tab[122]['datatype'] = 'text'; $tab[122]['forcegroupby'] = true; $tab[122]['joinparams'] = $joinparams; return $tab; } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'buy_date'; $tab[4]['name'] = __('Date of purchase'); $tab[4]['datatype'] = 'date'; $tab[5]['table'] = $this->getTable(); $tab[5]['field'] = 'use_date'; $tab[5]['name'] = __('Startup date'); $tab[5]['datatype'] = 'date'; $tab[24]['table'] = 'glpi_infocoms'; $tab[24]['field'] = 'delivery_date'; $tab[24]['name'] = __('Delivery date'); $tab[24]['datatype'] = 'date'; $tab[24]['forcegroupby'] = true; $tab[23]['table'] = 'glpi_infocoms'; $tab[23]['field'] = 'order_date'; $tab[23]['name'] = __('Order date'); $tab[23]['datatype'] = 'date'; $tab[23]['forcegroupby'] = true; $tab[25]['table'] = 'glpi_infocoms'; $tab[25]['field'] = 'warranty_date'; $tab[25]['name'] = __('Start date of warranty'); $tab[25]['datatype'] = 'date'; $tab[25]['forcegroupby'] = true; $tab[26]['table'] = 'glpi_infocoms'; $tab[26]['field'] = 'inventory_date'; $tab[26]['name'] = __('Date of last physical inventory'); $tab[26]['datatype'] = 'date'; $tab[26]['forcegroupby'] = true; $tab[6]['table'] = $this->getTable(); $tab[6]['field'] = 'warranty_duration'; $tab[6]['name'] = __('Warranty duration'); $tab[6]['datatype'] = 'number'; $tab[6]['unit'] = 'month'; $tab[6]['max'] = 120; $tab[6]['toadd'] = array(-1 => __('Lifelong')); $tab[7]['table'] = $this->getTable(); $tab[7]['field'] = 'warranty_info'; $tab[7]['name'] = __('Warranty information'); $tab[7]['datatype'] = 'string'; $tab[8]['table'] = $this->getTable(); $tab[8]['field'] = 'warranty_value'; $tab[8]['name'] = __('Warranty extension value'); $tab[8]['datatype'] = 'decimal'; $tab[9]['table'] = 'glpi_suppliers'; $tab[9]['field'] = 'name'; $tab[9]['name'] = __('Supplier'); $tab[9]['datatype'] = 'dropdown'; $tab[10]['table'] = $this->getTable(); $tab[10]['field'] = 'order_number'; $tab[10]['name'] = __('Order number'); $tab[10]['datatype'] = 'string'; $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'delivery_number'; $tab[11]['name'] = __('Delivery form'); $tab[11]['datatype'] = 'string'; $tab[12]['table'] = $this->getTable(); $tab[12]['field'] = 'immo_number'; $tab[12]['name'] = __('Immobilization number'); $tab[12]['datatype'] = 'string'; $tab[13]['table'] = $this->getTable(); $tab[13]['field'] = 'value'; $tab[13]['name'] = __('Value'); $tab[13]['datatype'] = 'decimal'; $tab[14]['table'] = $this->getTable(); $tab[14]['field'] = 'sink_time'; $tab[14]['name'] = __('Amortization duration'); $tab[14]['datatype'] = 'number'; $tab[14]['max'] = 15; $tab[14]['unit'] = 'year'; $tab[15]['table'] = $this->getTable(); $tab[15]['field'] = 'sink_type'; $tab[15]['name'] = __('Amortization type'); $tab[15]['datatype'] = 'integer'; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab[17]['table'] = $this->getTable(); $tab[17]['field'] = 'sink_coeff'; $tab[17]['name'] = __('Amortization coefficient'); $tab[17]['datatype'] = 'decimal'; $tab[18]['table'] = $this->getTable(); $tab[18]['field'] = 'bill'; $tab[18]['name'] = __('Invoice number'); $tab[18]['datatype'] = 'string'; $tab[19]['table'] = 'glpi_budgets'; $tab[19]['field'] = 'name'; $tab[19]['name'] = __('Budget'); $tab[19]['datatype'] = 'itemlink'; $tab[20]['table'] = $this->getTable(); $tab[20]['field'] = 'itemtype'; $tab[20]['name'] = __('Type'); $tab[20]['datatype'] = 'itemtype'; $tab[20]['massiveaction'] = false; $tab[21]['table'] = $this->getTable(); $tab[21]['field'] = 'items_id'; $tab[21]['name'] = __('ID'); $tab[21]['datatype'] = 'integer'; $tab[21]['massiveaction'] = false; $tab[22]['table'] = $this->getTable(); $tab[22]['field'] = 'alert'; $tab[22]['name'] = __('Alarms on financial and administrative information'); $tab[22]['datatype'] = 'integer'; $tab[80]['table'] = 'glpi_entities'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = __('Entity'); $tab[80]['massiveaction'] = false; $tab[80]['datatype'] = 'dropdown'; $tab[86]['table'] = $this->getTable(); $tab[86]['field'] = 'is_recursive'; $tab[86]['name'] = __('Child entities'); $tab[86]['datatype'] = 'bool'; return $tab; } /** * Display debug information for infocom of current object **/ function showDebug() { $item = array('item_name' => '', 'warrantyexpiration' => '', 'itemtype' => $this->fields['itemtype'], 'items_id' => $this->fields['items_id']); $options['entities_id'] = $this->getEntityID(); $options['items'] = array($item); NotificationEvent::debugEvent($this, $options); } /** * Duplicate infocoms from an item template to its clone * * @param $itemtype itemtype of the item * @param $oldid ID of the item to clone * @param $newid ID of the item cloned * @param $newitemtype itemtype of the new item (= $itemtype if empty) (default '') **/ static function cloneItem($itemtype, $oldid, $newid, $newitemtype='') { global $DB; $ic = new self(); if ($ic->getFromDBforDevice($itemtype, $oldid)) { $input = $ic->fields; $input = Toolbox::addslashes_deep($input); $input['items_id'] = $newid; if (!empty($newitemtype)) { $input['itemtype'] = $newitemtype; } unset ($input["id"]); if (isset($input["immo_number"])) { $input["immo_number"] = autoName($input["immo_number"], "immo_number", 1, 'Infocom', $input['entities_id']); } $date_fields = array('buy_date', 'delivery_date', 'inventory_date', 'order_date', 'use_date', 'warranty_date'); foreach ($date_fields as $f) { if (empty($input[$f])) { unset($input[$f]); } } $ic2 = new self(); $ic2->add($input); } } /** * Get date using a begin date and a period in month * * @param $from date begin date * @param $addwarranty integer period in months * @param $deletenotice integer period in months of notice (default 0) * @param $color boolean if show expire date in red color (false by default) * * @return expiration date string **/ static function getWarrantyExpir($from, $addwarranty, $deletenotice=0, $color=false) { // Life warranty if (($addwarranty == -1) && ($deletenotice == 0)) { return __('Never'); } if (($from == NULL) || empty($from)) { return ""; } $datetime = strtotime("$from+$addwarranty month -$deletenotice month"); if ($color && ($datetime < time())) { return "".Html::convDate(date("Y-m-d", $datetime)).""; } return Html::convDate(date("Y-m-d", $datetime)); } } ?> glpi-0.84.3+dfsg.1/inc/interfacetype.class.php000066400000000000000000000057751226600447100210670ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class InterfaceType (Interface is a reserved keyword) class InterfaceType extends CommonDropdown { static function getTypeName($nb=0) { return _n('Interface type (Hard drive...)', 'Interface types (Hard drive...)', $nb); } /** * @since version 0.84 * * @param $itemtype * @param $base HTMLTableBase object * @param $super HTMLTableSuperHeader object (default NULL) * @param $father HTMLTableHeader object (default NULL) * @param $options array **/ static function getHTMLTableHeader($itemtype, HTMLTableBase $base, HTMLTableSuperHeader $super=NULL, HTMLTableHeader $father=NULL, array $options=array()) { $column_name = __CLASS__; if (isset($options['dont_display'][$column_name])) { return; } $base->addHeader($column_name, __('Interface'), $super, $father); } /** * @since version 0.84 * * @param $row HTMLTableRow object (default NULL) * @param $item CommonDBTM object (default NULL) * @param $father HTMLTableCell object (default NULL) * @param $options array **/ static function getHTMLTableCellsForItem(HTMLTableRow $row=NULL, CommonDBTM $item=NULL, HTMLTableCell $father=NULL, array $options=array()) { $column_name = __CLASS__; if (isset($options['dont_display'][$column_name])) { return; } if ($item->fields["interfacetypes_id"]) { $row->addCell($row->getHeaderByName($column_name), Dropdown::getDropdownName("glpi_interfacetypes", $item->fields["interfacetypes_id"])); } } } ?> glpi-0.84.3+dfsg.1/inc/ipaddress.class.php000066400000000000000000001313411226600447100201700ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * Represent an IPv4 or an IPv6 address. Both textual (ie. human readable) * and binary (ie. : used for request) are present * @since version 0.84 */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** Class IPAddress : Represents an IPv4 or an IPv6 address. Both textual (ie. human readable) * and binary (ie. : used for SQL requests) are present inside the DB. * The class itself contains three protected attributes. If the address is valid, then, these * attributes are not empty. * This object is usefull for SQL research and binary<=>textual conversions. * @warning textual (ie. human readable) representation is not unique for IPv6 addresses : * 2001:db8:0:85a3\::ac1f:8001 = 2001:db8:0:85a3:0:0:ac1f:8001 * @warning All textual representation of IPv6 addresses conforms to RFC 5952 : they are * automatically converted by IPAddress::setAddressFromString(). * @since version 0.84 **/ class IPAddress extends CommonDBChild { // From CommonDBChild static public $itemtype = 'itemtype'; static public $items_id = 'items_id'; public $dohistory = false; var $history_blacklist = array('binary_0', 'binary_1', 'binary_2', 'binary_3'); /// $version (integer) : version of the adresse. Should be 4 or 6, or empty if not valid address protected $version = ''; /// $this->textual (string) : human readable of the IP adress (for instance : 192.168.0.0, /// 2001:db8:0:85a3\::ac1f:8001) protected $textual = ''; /// $this->binary (bytes[4]) : binary version for the SQL requests. For IPv4 addresses, the /// first three bytes are set to [0, 0, 0xffff] protected $binary = array(0, 0, 0, 0); ////////////////////////////////////////////////////////////////////////////// // CommonDBTM related methods ////////////////////////////////////////////////////////////////////////////// /** * @param $ipaddress (default '') **/ function __construct($ipaddress='') { // First, be sure that the parent is correctly initialised parent::__construct(); // If $ipaddress if empty, then, empty address ! if ($ipaddress != '') { // If $ipaddress if an IPAddress, then just clone it if ($ipaddress instanceof IPAddress) { $this->version = $ipaddress->version; $this->textual = $ipaddress->textual; $this->binary = $ipaddress->binary; $this->fields = $ipaddress->fields; } else { // Else, check a binary then a string if (!$this->setAddressFromBinary($ipaddress)) { $this->setAddressFromString($ipaddress); } } } } // Keep can* because IP Address can be attach to whatever type of item static function canView() { return (Session::haveRight('internet', 'r') && parent::canView()); } static function canCreate() { return (Session::haveRight('internet', 'w') && parent::canCreate()); } static function canUpdate() { return (Session::haveRight('internet', 'w') && parent::canUpdate()); } static function canDelete() { return (Session::haveRight('internet', 'w') && parent::canDelete()); } static function getTypeName($nb=0) { return _n('IP address', 'IP addresses', $nb); } /** * @param $input **/ function prepareInput($input) { // If $input['name'] does not exists, then, don't check anything ! if (isset($input['name'])) { // WARNING: we must in every case, because, sometimes, fields are partially feels // If previous value differs from current one, then check it ! $this->setAddressFromString($input['name']); if (!$this->is_valid()) { if (isset($input['is_dynamic']) && $input['is_dynamic']) { // We allow invalid IPs that are dynamics ! $input['version'] = 0; $input['binary_0'] = 0; $input['binary_1'] = 0; $input['binary_2'] = 0; $input['binary_3'] = 0; return $input; } //TRANS: %s is the invalid address $msg = sprintf(__('%1$s: %2$s'), __('Invalid IP address'), $input['name']); Session::addMessageAfterRedirect($msg, false, ERROR); return false; } } return array_merge($input, $this->setArrayFromAddress($input, "version", "name", "binary")); } /** * @see CommonDBChild::prepareInputForAdd() **/ function prepareInputForAdd($input) { return parent::prepareInputForAdd($this->prepareInput($input)); } /** * @see CommonDBChild::prepareInputForUpdate() **/ function prepareInputForUpdate($input) { return parent::prepareInputForUpdate($this->prepareInput($input)); } /** * @see CommonDBTM::post_addItem() **/ function post_addItem() { IPAddress_IPNetwork::addIPAddress($this); parent::post_addItem(); } /** * @see CommonDBTM::post_updateItem() **/ function post_updateItem($history=1) { if ((isset($this->oldvalues['name'])) || (isset($this->oldvalues['entities_id']))) { $link = new IPAddress_IPNetwork(); $link->cleanDBonItemDelete($this->getType(), $this->getID()); $link->addIPAddress($this); } parent::post_updateItem($history); } function cleanDBonPurge() { $link = new IPAddress_IPNetwork(); $link->cleanDBonItemDelete($this->getType(), $this->getID()); return true; } function post_getFromDB () { // Don't forget set local object from DB field $this->setAddressFromArray($this->fields, "version", "name", "binary"); } static function showForItem(CommonGLPI $item, $withtemplate=0) { global $DB, $CFG_GLPI; if ($item->getType() == 'IPNetwork') { if (isset($_POST["start"])) { $start = $_POST["start"]; } else { $start = 0; } if (!empty($_POST["order"])) { $table_options['order'] = $_POST["order"]; } else { $table_options['order'] = 'ip'; } $order_by_itemtype = ($table_options['order'] == 'itemtype'); $table_options['SQL_options'] = "LIMIT ".$_SESSION['glpilist_limit']." OFFSET $start"; $table = new HTMLTableMain(); $content = "" . self::getTypeName(2) . ""; $internet_column = $table->addHeader('IP Address', $content); $content = sprintf(__('%1$s - %2$s'), _n('Item', 'Items', 2), "" . __('Order by item type') . ""); $item_column = $table->addHeader('Item', $content); if ($order_by_itemtype) { foreach ($CFG_GLPI["networkport_types"] as $itemtype) { $table_options['group_'.$itemtype] = $table->createGroup($itemtype, $itemtype::getTypeName(2)); self::getHTMLTableHeader($item->getType(), $table_options['group_'.$itemtype], $item_column, NULL, $table_options); } } $table_options['group_None'] = $table->createGroup('Main', __('Other kind of items')); self::getHTMLTableHeader($item->getType(), $table_options['group_None'], $item_column, NULL, $table_options); self::getHTMLTableCellsForItem(NULL, $item, NULL, $table_options); if ($table->getNumberOfRows() > 0) { Html::printAjaxPager(self::getTypeName(2), $start, self::countForItem($item)); Session::initNavigateListItems(__CLASS__, //TRANS : %1$s is the itemtype name, // %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), $item->getTypeName(1), $item->getName())); $table->display(array('display_title_for_each_group' => $order_by_itemtype, 'display_super_for_each_group' => false, 'display_tfoot' => false)); Html::printAjaxPager(self::getTypeName(2), $start, self::countForItem($item)); } else { echo ""; echo ""; echo "
    ".__('No IP address found')."
    "; } } } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($item->getType()) { case 'IPNetwork' : self::showForItem($item, $withtemplate); break; } } /** * @param $item CommonDBTM object **/ static function countForItem(CommonDBTM $item) { global $DB; switch ($item->getType()) { case 'IPNetwork' : $query = "SELECT DISTINCT COUNT(*) AS cpt FROM `glpi_ipaddresses_ipnetworks` WHERE `glpi_ipaddresses_ipnetworks`.`ipnetworks_id` = '".$item->getID()."'"; $result = $DB->query($query); $ligne = $DB->fetch_assoc($result); return $ligne['cpt']; } } /** * @param $item CommonGLPI object * @param $withtemplate (default 0) * * @return string **/ function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if ($item->getID() && $item->can($item->getField('id'),'r')) { if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(self::getTypeName(2), self::countForItem($item)); } return self::getTypeName(2); } return ''; } ////////////////////////////////////////////////////////////////////////////// // IP address specific methods (check, transformation ...) ////////////////////////////////////////////////////////////////////////////// /** * Disable the address **/ function disableAddress() { $this->version = ''; $this->textual = ''; $this->binary = ''; } /** * \brief Fill an array from the the local address object * Fill an array from the the local address object. Usefull for feeding $input variable for * preparing input to alter database. * If the field name is empty, then, the field is not set * If the object is not valid, then, version = 0, textual = "" and binary = (0, 0, 0, 0) * * @param $array array the array to Fill * @param $versionField the name of the key inside $array that contains de IP version number * @param $textualField the name of the key inside $array that contains de textual version * @param $binaryField the name of the key inside $array that contains de binary. * Each element of the array is post-fixed by _i, with i the index * * @return result the array altered **/ function setArrayFromAddress(array $array, $versionField, $textualField, $binaryField) { if (!empty($versionField)) { $version = $this->getVersion(); if ($version !== false) { $array[$versionField] = $version; } else { $array[$versionField] = "0"; } } if (!empty($textualField)) { $textual = $this->getTextual(); if ($textual !== false) { $array[$textualField] = $textual; } else { $array[$textualField] = ""; } } if (!empty($binaryField)) { $binary = $this->getBinary(); for ($i = 0 ; $i < 4 ; ++$i) { if ($binary !== false) { $array[$binaryField."_".$i] = $binary[$i]; } else { $array[$binaryField."_".$i] = '0'; } } } return $array; } /** * \brief Fill the local address object from an array * Fill the local address object from an array. Usefull for reading $input * * @param $array array the array to Fill * @param $versionField the name of the key inside $array that contains de IP version number * @param $textualField the name of the key inside $array that contains de textual version * @param $binaryField the name of the key inside $array that contains de binary. * Each element of the array is post-fixed by _i, with i the index * * If the field name is empty, then, the field is not set * * @return true is succeffully defined **/ function setAddressFromArray(array $array, $versionField, $textualField, $binaryField) { // First, we empty the fields to notify that this address is not valid $this->disableAddress(); if (!isset($array[$versionField])) { return false; } if (!isset($array[$textualField])) { return false; } if (!isset($array[$binaryField."_0"]) || !isset($array[$binaryField."_1"]) || !isset($array[$binaryField."_2"]) || !isset($array[$binaryField."_3"])) { return false; } $this->version = $array[$versionField]; $this->textual = $array[$textualField]; $this->binary = array(); $this->binary[0] = ($array[$binaryField."_0"] + 0); $this->binary[1] = ($array[$binaryField."_1"] + 0); $this->binary[2] = ($array[$binaryField."_2"] + 0); $this->binary[3] = ($array[$binaryField."_3"] + 0); return true; } /** * Check address validity **/ function is_valid() { return (($this->version != '') && ($this->textual != '') && ($this->binary != '')); } function getVersion() { if ($this->version != '') { return $this->version; } return false; } function is_ipv4() { return ($this->getVersion() == 4); } function is_ipv6() { return ($this->getVersion() == 6); } function getTextual() { if ($this->textual != '') { return $this->textual; } return false; } function getBinary() { if ($this->binary != '') { return $this->binary; } return false; } /** * Transform an IPv4 address to IPv6 * * @param $address (bytes[4] or bytes) the address to transform. * * @return IPv6 mapped address **/ static function getIPv4ToIPv6Address($address) { if (is_numeric($address)) { return array(0, 0, 0xffff, $address); } if ((is_array($address)) && (count($address) == 4)) { return self::getIPv4ToIPv6Address($address[3]); } return false; } /** * Check an address to see if it is IPv4 mapped to IPv6 address * * @param $address (bytes[4]) the address to check * * @return true if the address is IPv4 mapped to IPv6 **/ static function isIPv4MappedToIPv6Address($address) { if (is_array($address) && (count($address) == 4)) { if (($address[0] == 0) && ($address[1] == 0) && ($address[2] == 0xffff)) { return true; } return false; } return false; } /** * Replace textual representation by its canonical form. * * @return nothing (internal class update) **/ function canonicalizeTextual() { $this->setAddressFromBinary($this->getBinary()); } /** * \brief define an address from a string * Convert a textual address (string) to binary one. Opposite function that * setAddressFromBinary(). If item is valid ($itemtype not empty and $items_id > 0) then first * try to find it inside the database and load it from database. * \warning The resulting binary form is created inside the current object * * @param $address string textual (ie. human readable) address * @param $itemtype type of the item this address has to be attached (default '') * @param $items_id id of the item this address has to be attached (default -1) * * @return true if the address is valid. **/ function setAddressFromString($address, $itemtype="", $items_id=-1) { global $DB; $this->disableAddress(); if (!is_string($address)) { return false; } $address = trim($address); if (empty($address)) { return false; } if (!empty($itemtype) && ($items_id > 0)) { $query = "SELECT `id` FROM `".$this->getTable()."` WHERE `items_id` = '$items_id' AND `itemtype` = '$itemtype' AND `name` = '$address'"; $result = $DB->query($query); if ($DB->numrows($result) == 1) { $line = $DB->fetch_assoc($result); if ($this->getFromDB($line["id"])) { return true; } } } unset($binary); $singletons = explode(".", $address); // First, check to see if it is an IPv4 address if (count($singletons) == 4) { $binary = 0; foreach ($singletons as $singleton) { if (!is_numeric($singleton)) { return false; } $singleton = intval($singleton); if (($singleton < 0) || ($singleton > 255)) { return false; } $binary *= 256; $binary += intval($singleton); } $binary = self::getIPv4ToIPv6Address($binary); } // Else, it should be an IPv6 address $singletons = explode(":", $address); // Minimum IPv6 address is "::". So, we check that there is at least 3 singletons in the array // And no more than 8 singletons if ((count($singletons) >= 3) && (count($singletons) <= 8)) { $empty_count = 0; foreach ($singletons as $singleton) { $singleton = trim($singleton); // First, we check that each singleton is 4 hexadecimal ! if (!preg_match("/^[0-9A-Fa-f]{0,4}$/", $singleton, $regs)) { return false; } if ($singleton === '') { $empty_count ++; } } // EXTREMITY CHECKS : // If it starts with colon : the second one must be empty too (ie.: :2001 is not valid) $start_with_empty = ($singletons[0] === ''); if (($start_with_empty) && ($singletons[1] !== '')) { return false; } // If it ends with colon : the previous one must be empty too (ie.: 2001: is not valid) $end_with_empty = ($singletons[count($singletons) - 1] === ''); if (($end_with_empty) && ($singletons[count($singletons) - 2] !== '')) { return false; } // END OF EXTREMITY CHECKS // The number of empty singletons depends on the type of contraction switch ($empty_count) { case 0: // No empty singleton => no contraction at all // Thus, its side must be 8 ! if (count($singletons) != 8) { return false; } break; case 1: // One empty singleton : must be in the middle, otherwise EXTREMITY CHECKS // would return false break; case 2: // If there is two empty singletons then it must be at the beginning or the end if (!($start_with_empty XOR $end_with_empty)) { return false; } // Thus remove one of both empty singletons. if ($start_with_empty) { unset($singletons[0]); } else { // $end_with_empty == true unset($singletons[count($singletons) - 1]); } break; case 3: // Only '::' allows three empty singletons ('::x::' = four empty singletons) if (!($start_with_empty AND $end_with_empty)) { return false; } // Middle value must be '' otherwise EXTREMITY CHECKS returned an error if (count($singletons) != 3) { return false; } $singletons = array(''); break; default: return false; } // Here, we are sure that $singletons are valids and only contains 1 empty singleton that // will be convert to as many '0' as necessary to reach 8 singletons $numberEmpty = 9 - count($singletons); // = 8 - (count($singletons) - 1) $epanded = array(); foreach ($singletons as $singleton) { if ($singleton === '') { $epanded = array_merge($epanded, array_fill(0, $numberEmpty, 0)); } else { $epanded[] = hexdec($singleton); } } $binary = array(); for ($i = 0 ; $i < 4 ; $i++) { $binary[$i] = $epanded[2 * $i + 0] * 65536 + $epanded[2 * $i + 1]; } } // $binary is an array that is only defined for IPv4 or IPv6 address if (isset($binary)) { // Calling setAddressFromBinary is usefull to recheck one more time inside // glpi_ipaddresses table and to make canonical textual version return $this->setAddressFromBinary($binary, $itemtype, $items_id); } // Else, it is not IPv4 nor IPv6 address return false; } /** * \brief define an address from a binary * Convert a binary address (bytes[4]) to textual one. Opposite function that * setAddressFromString(). If item is valid ($itemtype not empty and $items_id > 0) then first * try to find it inside the database and load it from database. textual version is condensed * one (ie : 2001:db8:0:85a3\::ac1f:8001 rather than 2001:0db8:0000:85a3:0000:0000:ac1f:8001) * \warning The resulting binary form is created inside the current object * * @param $address (bytes[4]) binary (ie. SQL requests) address * @param $itemtype type of the item this address has to be attached (default '') * @param $items_id id of the item this address has to be attached (default -1) * * @return true if the address is valid. **/ function setAddressFromBinary($address, $itemtype="", $items_id=-1) { global $DB; $this->disableAddress(); if ((!is_array($address)) || (count($address) != 4)) { return false; } if (!empty($itemtype) && ($items_id > 0)) { $query = "SELECT `id` FROM `".$this->getTable()."` WHERE `items_id` = '$items_id' AND `itemtype` = '$itemtype'"; for ($i = 0 ; $i < 4 ; ++$i) { $query .= " AND `binary_".$i."` = '".$address[$i]."'"; } $result = $DB->query($query); if ($DB->numrows($result) == 1) { $line = $DB->fetch_assoc($result); if ($this->getFromDB($line["id"])) { return true; } } } $binary = array(); $textual = array(); $currentNull = ""; foreach ($address as $singleton) { if (is_numeric($singleton)) { $singleton = floatval($singleton); } if (is_float($singleton) || is_double($singleton)) { $binary[] = floatval($singleton); $singleton = str_pad(dechex($singleton), 8, "0", STR_PAD_LEFT); $elt = ltrim(substr($singleton, 0, 4), "0"); if (empty($elt)) { $textual[] = "0"; $currentNull .= "1"; } else { $currentNull .= "0"; $textual[] = $elt; } $elt = ltrim(substr($singleton, 4, 4), "0"); if (empty($elt)) { $textual[] = "0"; $currentNull .= "1"; } else { $currentNull .= "0"; $textual[] = $elt; } } else { return false; } } if (isset($binary) && (count($binary) == 4)) { if (self::isIPv4MappedToIPv6Address($binary)) { $this->version = 4; } else { $this->version = 6; } } else { return false; } $this->binary = $binary; if ($this->getVersion() == 4) { $hexValue = str_pad($textual[6], 4, "0", STR_PAD_LEFT).str_pad($textual[7], 4, "0", STR_PAD_LEFT); $textual = array(); for ($i = 0 ; $i < 4 ; $i++) { $textual[] = hexdec($hexValue[2*$i+0].$hexValue[2*$i+1]); } $textual = implode('.', $textual); } else { foreach (array("11111111", "1111111", "111111", "11111", "1111", "111", "11") as $elt) { $pos = strpos($currentNull, $elt); if ($pos !== false) { $first = array_slice($textual, 0, $pos); if (count($first) == 0) { $first = array(""); } $second = array_slice($textual, $pos + strlen($elt)); if (count($second) == 0) { $second = array(""); } $textual = array_merge($first, array(""), $second); break; } } $textual = implode(':', $textual); } $this->textual = $textual; return true; } /** * \brief add value to the address for iterator on addresses * * @param $address (in and out) the address to increment or decrement * @param $value the value to add or remove. Must be betwwen -0xffffffff and +0xffffffff * * @return true if the increment is valid **/ static function addValueToAddress(&$address, $value) { if (!is_array($address) || (count($address) != 4) || !is_numeric($value) || ($value < -0xffffffff) || ($value > 0xffffffff)) { return false; } for ($i = 3 ; $i >= 0 ; --$i) { $address[$i] += $value; if ($address[$i] < 0) { $address[$i] += (0x80000000 * 2); $value = -1; // For next value for right to left ... } else if ($address[$i] > 0xffffffff) { $address[$i] -= (0x80000000 * 2); $value = 1; // For next value for right to left ... } else { break; } } return true; } /** * \brief get absolute value of an integer * Convert a negative integer to positiv float. That is usefull as integer, in PHP are signed 32 * bits values. As such, they are limited from +2 147 483 647 to −2 147 483 648. Thus, when * working on integer with bit-wise boolean operations (&, |, ^, ~), the sign of the operand * remain inside the result. That make problem as IP address are only positiv ones. * * @param $value the integer that we want the absolute value * * @return float value that is the absolute of $value * **/ static function convertNegativeIntegerToPositiveFloat($value) { if (intval($value) && ($value < 0)) { $value = floatval($value) + floatval(0x80000000 * 2); } return $value; } /** * Search IP Addresses * * @param $IPaddress the address to search * * @return (array) each value of the array (corresponding to one IPAddress) is an array of the * items from the master item to the IPAddress **/ static function getItemsByIPAddress($IPaddress) { global $DB; // We must resolv binary address : // 1°) we don't know if the IP address is valid // 2°) we don't know its version // 3°) binary request is more efficient than textual one (polymorphism of IPv6 addresses) $address = new self(); if (!$address->setAddressFromString($IPaddress)) { return array(); } $query = "SELECT `gip`.`id` FROM `glpi_ipaddresses` as gip WHERE `gip`.`version` = '".$address->version."'\n"; $startIndex = (($address->version == 4) ? 3 : 1); $binaryIP = $address->getBinary(); for ($i = $startIndex ; $i < 4 ; ++$i) { $query .= "AND `gip`.`binary_$i` = '".$binaryIP[$i]."'"; } $addressesWithItems = array(); foreach ($DB->request($query) as $result) { if ($address->getFromDB($result['id'])) { $addressesWithItems[] = array_merge(array_reverse($address->recursivelyGetItems()), array(clone $address)); } } return $addressesWithItems; } /** * Get an Object ID by its IP address (only if one result is found in the entity) * * @param $value the ip address * @param $entity the entity to look for * * @return an array containing the object ID * or an empty array is no value of serverals ID where found **/ static function getUniqueItemByIPAddress($value, $entity) { $addressesWithItems = self::getItemsByIPAddress($value); if (count($addressesWithItems) == 1) { $addressWithItems = $addressesWithItems[0]; $item = $addressWithItems[0]; if ($item->getEntityID() == $entity) { $result = array("id" => $item->getID(), "itemtype" => $item->getType()); unset($addressesWithItems); return $result; } } return array(); } /** * Check if two addresses are equals * * @param $ipaddress the ip address to check with this * * @return return true if and only if both addresses are binary equals. **/ function equals($ipaddress) { // To normalise the address, just make new one $ipaddress = new self($ipaddress); if ((count($this->binary) != 4) || (count($ipaddress->binary) != 4) || ($this->version != $ipaddress->version)) { return false; } for ($index = 0 ; $index < 4 ; $index ++) { if ($this->binary[$index] != $ipaddress->binary[$index]) { return false; } } return true; } /** * @param $itemtype * @param $base HTMLTableBase object * @param $super HTMLTableSuperHeader object (default NULL) * @param $father HTMLTableHeader object (default NULL) * @param $options array **/ static function getHTMLTableHeader($itemtype, HTMLTableBase $base, HTMLTableSuperHeader $super=NULL, HTMLTableHeader $father=NULL, array $options=array()) { $column_name = __CLASS__; $content = self::getTypeName(); if ($itemtype == 'IPNetwork') { $base->addHeader('Item' , _n('Item', 'Items', 1) , $super, $father); $base->addHeader('NetworkPort', NetworkPort::getTypeName(0), $super, $father); $base->addHeader('NetworkName', NetworkName::getTypeName(1), $super, $father); $base->addHeader('Entity', Entity::getTypeName(1), $super, $father); } else { if (isset($options['dont_display'][$column_name])) { return; } if (isset($options['column_links'][$column_name])) { $content = "$content"; } $father = $base->addHeader($column_name, $content, $super, $father); if (isset($options['display_isDynamic']) && ($options['display_isDynamic'])) { $father = $base->addHeader($column_name.'_dynamic', __('Automatic inventory'), $super, $father); } IPNetwork::getHTMLTableHeader(__CLASS__, $base, $super, $father, $options); } } /** * @param $row HTMLTableRow object (default NULL) * @param $item CommonDBTM object (default NULL) * @param $father HTMLTableCell object (default NULL) * @param $options array **/ static function getHTMLTableCellsForItem(HTMLTableRow $row=NULL, CommonDBTM $item=NULL, HTMLTableCell $father=NULL, array $options=array()) { global $DB, $CFG_GLPI; if (($item !== NULL) && ($item->getType() == 'IPNetwork')) { $queries = array(); foreach ($CFG_GLPI["networkport_types"] as $itemtype) { $table = getTableForItemType($itemtype); $queries[] = "(SELECT ADDR.`binary_0` AS binary_0, ADDR.`binary_1` AS binary_1, ADDR.`binary_2` AS binary_2, ADDR.`binary_3` AS binary_3, ADDR.`name` AS ip, ADDR.`id` AS id, ADDR.`itemtype` AS addr_item_type, ADDR.`items_id` AS addr_item_id, `glpi_entities`.`completename` AS entity, NAME.`id` AS name_id, PORT.`id` AS port_id, ITEM.`id` AS item_id, '$itemtype' AS item_type FROM `glpi_ipaddresses_ipnetworks` AS LINK JOIN `glpi_ipaddresses` AS ADDR ON (ADDR.`id` = LINK.`ipaddresses_id` AND ADDR.`itemtype` = 'NetworkName' AND ADDR.`is_deleted` = '0') LEFT JOIN `glpi_entities` ON (ADDR.`entities_id` = `glpi_entities`.`id`) JOIN `glpi_networknames` AS NAME ON (NAME.`id` = ADDR.`items_id` AND NAME.`itemtype` = 'NetworkPort') JOIN `glpi_networkports` AS PORT ON (NAME.`items_id` = PORT.`id` AND PORT.`itemtype` = '$itemtype') JOIN `$table` AS ITEM ON (ITEM.`id` = PORT.`items_id`) WHERE LINK.`ipnetworks_id` = '".$item->getID()."')"; } $queries[] = "(SELECT ADDR.`binary_0` AS binary_0, ADDR.`binary_1` AS binary_1, ADDR.`binary_2` AS binary_2, ADDR.`binary_3` AS binary_3, ADDR.`name` AS ip, ADDR.`id` AS id, ADDR.`itemtype` AS addr_item_type, ADDR.`items_id` AS addr_item_id, `glpi_entities`.`completename` AS entity, NAME.`id` AS name_id, PORT.`id` AS port_id, NULL AS item_id, NULL AS item_type FROM `glpi_ipaddresses_ipnetworks` AS LINK JOIN `glpi_ipaddresses` AS ADDR ON (ADDR.`id` = LINK.`ipaddresses_id` AND ADDR.`itemtype` = 'NetworkName' AND ADDR.`is_deleted` = '0') LEFT JOIN `glpi_entities` ON (ADDR.`entities_id` = `glpi_entities`.`id`) JOIN `glpi_networknames` AS NAME ON (NAME.`id` = ADDR.`items_id` AND NAME.`itemtype` = 'NetworkPort') JOIN `glpi_networkports` AS PORT ON (NAME.`items_id` = PORT.`id` AND PORT.`itemtype` NOT IN ('" .implode("', '", $CFG_GLPI["networkport_types"])."')) WHERE LINK.`ipnetworks_id` = '".$item->getID()."')"; $queries[] = "(SELECT ADDR.`binary_0` AS binary_0, ADDR.`binary_1` AS binary_1, ADDR.`binary_2` AS binary_2, ADDR.`binary_3` AS binary_3, ADDR.`name` AS ip, ADDR.`id` AS id, ADDR.`itemtype` AS addr_item_type, ADDR.`items_id` AS addr_item_id, `glpi_entities`.`completename` AS entity, NAME.`id` AS name_id, NULL AS port_id, NULL AS item_id, NULL AS item_type FROM `glpi_ipaddresses_ipnetworks` AS LINK JOIN `glpi_ipaddresses` AS ADDR ON (ADDR.`id` = LINK.`ipaddresses_id` AND ADDR.`itemtype` = 'NetworkName' AND ADDR.`is_deleted` = '0') LEFT JOIN `glpi_entities` ON (ADDR.`entities_id` = `glpi_entities`.`id`) JOIN `glpi_networknames` AS NAME ON (NAME.`id` = ADDR.`items_id` AND NAME.`itemtype` != 'NetworkPort') WHERE LINK.`ipnetworks_id` = '".$item->getID()."')"; $queries[] = "(SELECT ADDR.`binary_0` AS binary_0, ADDR.`binary_1` AS binary_1, ADDR.`binary_2` AS binary_2, ADDR.`binary_3` AS binary_3, ADDR.`name` AS ip, ADDR.`id` AS id, ADDR.`itemtype` AS addr_item_type, ADDR.`items_id` AS addr_item_id, `glpi_entities`.`completename` AS entity, NULL AS name_id, NULL AS port_id, NULL AS item_id, NULL AS item_type FROM `glpi_ipaddresses_ipnetworks` AS LINK JOIN `glpi_ipaddresses` AS ADDR ON (ADDR.`id` = LINK.`ipaddresses_id` AND ADDR.`itemtype` != 'NetworkName' AND ADDR.`is_deleted` = '0') LEFT JOIN `glpi_entities` ON (ADDR.`entities_id` = `glpi_entities`.`id`) WHERE LINK.`ipnetworks_id` = '".$item->getID()."')"; $query = implode('UNION ', $queries); if (($options['order'] == 'ip') || ($options['order'] == 'itemtype')) { $query .= " ORDER BY binary_0, binary_1, binary_2, binary_3"; } if (isset($options['SQL_options'])) { $query .= "\n".$options['SQL_options']; } $canedit = (isset($options['canedit']) && $options['canedit']); $options['createRow'] = false; $address = new self(); $ipaddress = new self(); $networkname = new NetworkName(); $networkport = new NetworkPort(); $item = NULL; foreach ($DB->request($query) as $line) { unset($row); if (($options['order'] == 'itemtype') && !empty($line['item_type'])) { $row = $options['group_'.$line['item_type']]->createRow(); } if (!isset($row)) { $row = $options['group_None']->createRow(); } $ip_header = $row->getGroup()->getSuperHeaderByName('IP Address'); $item_header= $row->getGroup()->getHeaderByName('Item', 'Item'); $port_header= $row->getGroup()->getHeaderByName('Item', 'NetworkPort'); $name_header= $row->getGroup()->getHeaderByName('Item', 'NetworkName'); $entity_header= $row->getGroup()->getHeaderByName('Item', 'Entity'); $row->addCell($ip_header, $line['ip'], $father); if (!empty($line['name_id'])) { $networkname->getFromDB($line['name_id']); $row->addCell($name_header, $networkname->getLink(), $father); if (!empty($line['port_id'])) { $networkport->getFromDB($line['port_id']); $row->addCell($port_header, $networkport->getLink(), $father); if ((!empty($line['item_id'])) && (!empty($line['item_type']))) { $itemtype = $line['item_type']; $item = new $itemtype(); $item->getFromDB($line['item_id']); $row->addCell($item_header, $item->getLink(), $father); } } $row->addCell($entity_header, $line['entity'], $father); } else if ((!empty($line['addr_item_id'])) && (!empty($line['addr_item_type']))) { $itemtype = $line['addr_item_type']; $item = new $itemtype(); $item->getFromDB($line['addr_item_id']); if ($item instanceof CommonDBChild) { $items = $item->recursivelyGetItems(); $elements = array($item->getLink()); foreach ($items as $item_) { $elements[] = $item_->getLink(); } $row->addCell($item_header, implode(' > ', $elements), $father); } else { $row->addCell($item_header, $item->getLink(), $father); } $row->addCell($entity_header, $line['entity'], $father); } } } else { if (isset($options['dont_display']['IPAddress'])) { return; } $header= $row->getGroup()->getHeaderByName('Internet', __CLASS__); if (!$header) { return; } if (empty($item)) { if (empty($father)) { return; } $item = $father->getItem(); } $query = "SELECT `id` FROM `glpi_ipaddresses` WHERE `items_id` = '" . $item->getID() . "' AND `itemtype` = '" . $item->getType() . "' AND `is_deleted` = '0'"; $canedit = (isset($options['canedit']) && $options['canedit']); $createRow = (isset($options['createRow']) && $options['createRow']); $options['createRow'] = false; $address = new self(); foreach ($DB->request($query) as $ipaddress) { if ($address->getFromDB($ipaddress['id'])) { if ($createRow) { $row = $row->createRow(); } $content = $address->fields['name']; $this_cell = $row->addCell($header, $content, $father); if (isset($options['display_isDynamic']) && ($options['display_isDynamic'])) { $dyn_header = $row->getGroup()->getHeaderByName('Internet', __CLASS__.'_dynamic'); $this_cell = $row->addCell($dyn_header, Dropdown::getYesNo($address->fields['is_dynamic']), $this_cell); } IPNetwork::getHTMLTableCellsForItem($row, $address, $this_cell, $options); } } } } } ?> glpi-0.84.3+dfsg.1/inc/ipaddress_ipnetwork.class.php000066400000000000000000000064711226600447100222770ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class IPAddress_IPNetwork : Connection between IPAddress and IPNetwork /// @since 0.84 class IPAddress_IPNetwork extends CommonDBRelation { // From CommonDBRelation static public $itemtype_1 = 'IPAddress'; static public $items_id_1 = 'ipaddresses_id'; static public $itemtype_2 = 'IPNetwork'; static public $items_id_2 = 'ipnetworks_id'; /** * Update IPNetwork's dependency * * @param $network IPNetwork object **/ static function linkIPAddressFromIPNetwork(IPNetwork $network) { global $DB; $linkObject = new self(); $linkTable = $linkObject->getTable(); $ipnetworks_id = $network->getID(); // First, remove all links of the current Network $query = "SELECT `id` FROM `$linkTable` WHERE `ipnetworks_id` = '$ipnetworks_id'"; foreach ($DB->request($query) as $link) { $linkObject->delete(array('id' => $link['id'])); } // Then, look each IP address contained inside current Network $query = "SELECT '".$ipnetworks_id."' AS ipnetworks_id, `id` AS ipaddresses_id FROM `glpi_ipaddresses` WHERE ".$network->getWHEREForMatchingElement('glpi_ipaddresses', 'binary', 'version')." GROUP BY `id`"; foreach ($DB->request($query) as $link) { $linkObject->add($link); } } /** * @param $ipaddress IPAddress object **/ static function addIPAddress(IPAddress $ipaddress) { $linkObject = new self(); $input = array('ipaddresses_id' => $ipaddress->getID()); $entity = $ipaddress->getEntityID(); $ipnetworks_ids = IPNetwork::searchNetworksContainingIP($ipaddress, $entity); if ($ipnetworks_ids !== false) { // Beware that invalid IPaddresses don't have any valid address ! foreach (IPNetwork::searchNetworksContainingIP($ipaddress, $entity) as $ipnetworks_id) { $input['ipnetworks_id'] = $ipnetworks_id; $linkObject->add($input); } } } } ?> glpi-0.84.3+dfsg.1/inc/ipnetmask.class.php000066400000000000000000000077661226600447100202220ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class IPNetmask /// since version 0.84 class IPNetmask extends IPAddress { static protected $notable = true; /** * @param $ipnetmask (default '') * @param $version (default 0) **/ function __construct($ipnetmask='', $version=0) { // First, be sure that the parent is correctly initialised parent::__construct(); // If $ipnetmask if empty, then, empty netmask ! if ($ipnetmask != '') { // If $ipnetmask if an IPNetmask, then just clone it if ($ipnetmask instanceof IPNetmask) { $this->version = $ipnetmask->version; $this->textual = $ipnetmask->textual; $this->binary = $ipnetmask->binary; $this->fields = $ipnetmask->fields; } else { // Else, check a binary then a string if (!$this->setAddressFromBinary($ipnetmask)) { $this->setNetmaskFromString($ipnetmask, $version); } } } } static function getTypeName($nb=0) { return _n('Subnet mask', 'Subnet masks', $nb); } /** * \brief Create a Netmask from string * * Create a binary Netmask from dot notation (for instance : 255.255.255.0) or * integer (for instance /24). Rely on setAddressFromString() * * @param $netmask string netmask defined as textual * @param $version integer =4 or =6 : version of IP protocol * * @return false if the netmask is not valid or if it does not correspond to version **/ function setNetmaskFromString($netmask, $version) { if (is_numeric($netmask)) { if ($netmask < 0) { return false; } // Transform the number of bits to IPv6 netmasks ... $nbBits = $netmask + (($version == 4) ? 96 : 0); if ($nbBits > 128) { return false; } $bits = str_repeat("1", $nbBits).str_repeat("0", 128 - $nbBits); $this->version = $version; $this->textual = $netmask; $this->binary = array(); for ($i = 0 ; $i < 4 ; $i++) { $localBits = substr($bits, 32 * $i, 32); $this->binary[] = bindec($localBits); } } else { if (!$netmask = $this->setAddressFromString($netmask)) { return false; } if ($version != $this->getVersion()) { return false; } if ($version == 4) { for ($i = 0 ; $i < 3 ; $i++) { $this->binary[$i] = 0xffffffff; } } } if ($version == 4) { $mask = decbin($this->binary[3]); $textual = array(); for ($i = 0 ; $i < 4 ; $i++) { $textual[] = bindec(substr($mask, 8 * $i, 8)); } $this->textual = implode(".", $textual); } return true; } } ?> glpi-0.84.3+dfsg.1/inc/ipnetwork.class.php000066400000000000000000001075151226600447100202420ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class IPNetwork : Represent an IPv4 or an IPv6 network. /// It fully use IPAddress and IPNetmask to check validity and change representation from binary /// to textual values. /// \anchor parameterType Moreover, attributes of checking and retrieving functions allways allows /// both binary (ie: array of 4 bytes) or IPAddress Object. As such, $version is only use (and /// checked) with binary format of parameters. /// \anchor ipAddressToNetwork We have to notice that checking regarding an IP address is the same /// thing than checking regarding a network with all bits of the netmask set to 1 /// @since 0.84 class IPNetwork extends CommonImplicitTreeDropdown { public $dohistory = true; static function canCreate() { return Session::haveRight('internet', 'w'); } static function canView() { return Session::haveRight('internet', 'r'); } static function getTypeName($nb=0) { return _n('IP network', 'IP networks', $nb); } function getSearchOptions() { $tab = parent::getSearchOptions(); $tab[10]['table'] = $this->getTable(); $tab[10]['field'] = 'version'; $tab[10]['name'] = __('IP version'); $tab[10]['massiveaction'] = false; $tab[10]['datatype'] = 'number'; $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'address'; $tab[11]['name'] = IPAddress::getTypeName(1); $tab[11]['massiveaction'] = false; $tab[11]['datatype'] = 'string'; $tab[12]['table'] = $this->getTable(); $tab[12]['field'] = 'netmask'; $tab[12]['name'] = IPNetmask::getTypeName(1); $tab[12]['massiveaction'] = false; $tab[12]['datatype'] = 'string'; $tab[13]['table'] = $this->getTable(); $tab[13]['field'] = 'gateway'; $tab[13]['name'] = __('Gateway'); $tab[13]['massiveaction'] = false; $tab[13]['datatype'] = 'string'; $tab[14]['table'] = $this->getTable(); $tab[14]['field'] = 'addressable'; $tab[14]['name'] = __('Addressable network'); $tab[14]['datatype'] = 'bool'; return $tab; } function getAddress() { if (!isset($this->address)) { $this->address = new IPAddress(); if (!$this->address->setAddressFromArray($this->fields, "version", "address", "address")) { return false; } } return $this->address; } function getNetmask() { if (!isset($this->netmask)) { $this->netmask = new IPNetmask(); if (!$this->netmask->setAddressFromArray($this->fields, "version", "netmask", "netmask")) { return false; } } return $this->netmask; } function getGateway() { if (!isset($this->gateway)) { $this->gateway = new IPAddress(); if (!$this->gateway->setAddressFromArray($this->fields, "version", "gateway", "gateway")) { return false; } } return $this->gateway; } /** * When we load the object, we fill the "network" field with the correct address/netmask values **/ function post_getFromDB () { // Be sure to remove addresses, otherwise reusing will provide old objects for getAddress, ... unset($this->address); unset($this->netmask); unset($this->gateway); if (isset($this->fields["address"]) && isset($this->fields["netmask"])) { if ($this->fields["version"] == 4) { $this->fields["network"] = sprintf(__('%1$s / %2$s'), $this->fields["address"], $this->fields["netmask"]); } else { // IPv6 $this->fields["network"] = sprintf(__('%1$s/%2$s'), $this->fields["address"], $this->fields["netmask"]); } } } function getAdditionalFields() { return array(array('name' => 'network', 'label' => self::getTypeName(1), 'type' => 'text', 'list' => true, 'comment' => __('Set the network using notation address/mask')), array('name' => 'gateway', 'label' => __('Gateway'), 'type' => 'text', 'list' => true), array('name' => 'addressable', 'label' => __('Addressable network'), 'comment' => __('An addressable network is a network defined on an equipment'), 'type' => 'bool')); } function getNewAncestor() { if (isset($this->data_for_implicit_update)) { $params = array("address" => $this->data_for_implicit_update['address'], "netmask" => $this->data_for_implicit_update['netmask']); if (isset($this->fields['id'])) { $params['exclude IDs'] = $this->fields['id']; } $parents = self::searchNetworks("contains", $params, $this->data_for_implicit_update['entities_id']); if ((is_array($parents)) && (count($parents) > 0)) { return $parents[0]; } } return 0; } /** * @param $input **/ function prepareInput($input) { // In case of entity transfer, $input['network'] is not defined if (!isset($input['network']) && isset($this->fields['network'])) { $input['network'] = $this->fields['network']; } // In case of entity transfer, $input['gateway'] is not defined if (!isset($input['gateway']) && isset($this->fields['gateway'])) { $input['gateway'] = $this->fields['gateway']; } // If $this->fields["id"] is not set then, we are adding a new network // Or if $this->fields["network"] != $input["network"] we a updating the network $address = new IPAddress(); $netmask = new IPNetmask(); // Don't validate an empty network if (empty($input["network"])) { return array('error' => __('Invalid network address'), 'input' => false); } if (!isset($this->fields["id"]) || !isset($this->fields["network"]) || ($input["network"] != $this->fields["network"])) { $network = explode ("/", $input["network"]); if (count($network) != 2) { return array('error' => __('Invalid input format for the network'), 'input' => false); } if (!$address->setAddressFromString(trim($network[0]))) { return array('error' => __('Invalid network address'), 'input' => false); } if (!$netmask->setNetmaskFromString(trim($network[1]), $address->getVersion())) { return array('error' => __('Invalid subnet mask'), 'input' => false); } // After checking that address and netmask are valid, modify the address to be the "real" // network address : the first address of the network. This is not required for SQL, but // that looks better for the human self::computeNetworkRangeFromAdressAndNetmask($address, $netmask, $address); // Now, we look for already existing same network inside the database $params = array("address" => $address, "netmask" => $netmask); if (isset($this->fields["id"])) { $params["exclude IDs"] = $this->fields["id"]; } if (isset($this->fields["entities_id"])) { $entities_id = $this->fields["entities_id"]; } else if (isset($input["entities_id"])) { $entities_id = $input["entities_id"]; } else { $entities_id = -1; } // TODO : what is the best way ? recursive or not ? $sameNetworks = self::searchNetworks("equals", $params, $entities_id, false); // Check unicity ! if ($sameNetworks && (count($sameNetworks) > 0)) { return array('error' => __('Network already defined in visible entities'), 'input' => false); } // Then, update $input to reflect the network and the netmask $input = $address->setArrayFromAddress($input, "version", "address", "address"); $input = $netmask->setArrayFromAddress($input, "", "netmask", "netmask"); // We check to see if the network is modified $previousAddress = new IPAddress(); $previousAddress->setAddressFromArray($this->fields, "version", "address", "address"); $previousNetmask = new IPNetmask(); $previousNetmask->setAddressFromArray($this->fields, "version", "netmask", "netmask"); if ($previousAddress->equals($address) && $previousNetmask->equals($netmask)) { $this->networkUpdate = false; } else { $this->networkUpdate = true; } } else { // If netmask and address are not modified, then, load them from DB to check the validity // of the gateway $this->networkUpdate = false; $address->setAddressFromArray($this->fields, "version", "address", "address"); $netmask->setAddressFromArray($this->fields, "version", "netmask", "netmask"); $entities_id = $this->fields['entities_id']; } // Update class for the CommonImplicitTree update ... $this->data_for_implicit_update = array('address' => $address, 'netmask' => $netmask, 'entities_id' => $entities_id); $returnValue = array(); // If the gateway has been altered, or the network information (address or netmask) changed, // then, we must revalidate the gateway ! if (!isset($this->fields["gateway"]) || ($input["gateway"] != $this->fields["gateway"]) || $this->networkUpdate) { $gateway = new IPAddress(); if (!empty($input["gateway"])) { if (!$gateway->setAddressFromString($input["gateway"]) || !self::checkIPFromNetwork($gateway, $address, $netmask)) { $returnValue['error'] = __('Invalid gateway address'); if (!empty($this->fields["gateway"])) { if (!$gateway->setAddressFromString($this->fields["gateway"]) || !self::checkIPFromNetwork($gateway, $address, $netmask)) { $gateway->disableAddress(); } } else { $gateway->disableAddress(); } } } $input = $gateway->setArrayFromAddress($input, "", "gateway", "gateway"); } $returnValue['input'] = $input; return $returnValue; } /** * @see CommonImplicitTreeDropdown::prepareInputForAdd() **/ function prepareInputForAdd($input) { $preparedInput = $this->prepareInput($input); if (isset($preparedInput['error'])) { Session::addMessageAfterRedirect($preparedInput['error'], false, ERROR); } $input = $preparedInput['input']; if (is_array($input)) { return parent::prepareInputForAdd($input); } return false; } /** * @see CommonImplicitTreeDropdown::prepareInputForUpdate() **/ function prepareInputForUpdate($input) { $preparedInput = $this->prepareInput($input); if (isset($preparedInput['error'])) { Session::addMessageAfterRedirect($preparedInput['error'], false, ERROR); } $input = $preparedInput['input']; if (is_array($input)) { return parent::prepareInputForUpdate($input); } return false; } function post_addItem() { if ($this->networkUpdate) { IPAddress_IPNetwork::linkIPAddressFromIPNetwork($this); } unset($this->networkUpdate); parent::post_addItem(); } /** * @see CommonImplicitTreeDropdown::post_updateItem() **/ function post_updateItem($history=1) { if ($this->networkUpdate) { IPAddress_IPNetwork::linkIPAddressFromIPNetwork($this); } unset($this->networkUpdate); parent::post_updateItem($history); } function cleanDBonPurge() { $link = new IPNetwork_Vlan(); $link->cleanDBonItemDelete($this->getType(), $this->getID()); $link = new IPAddress_IPNetwork(); $link->cleanDBonItemDelete($this->getType(), $this->getID()); return true; } function getPotentialSons() { if (isset($this->data_for_implicit_update)) { $params = array("address" => $this->data_for_implicit_update['address'], "netmask" => $this->data_for_implicit_update['netmask'], "exclude IDs" => $this->getID()); $mysons = self::searchNetworks("is contained by", $params, $this->data_for_implicit_update['entities_id']); if (is_array($mysons)) { return $mysons; } } return array(); } /** * \brief Search any networks that contains the given IP * \ref ipAddressToNetwork * * @param $IP (see \ref parameterType) given IP * @param $entityID scope of the search (parents and childrens are check) (default -1) * @param $recursive set to false to only search in current entity, otherwise, all visible * entities will be search (true by default) * @param $fields list of fields to return in the result (default : only ID of the networks) * (default '') * @param $where (default '') * * @return list of networks (see searchNetworks()) **/ static function searchNetworksContainingIP($IP, $entityID=-1, $recursive=true, $fields="", $where="") { return self::searchNetworks('contains', array('address' => $IP, 'netmask' => array(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), 'fields' => $fields, 'where' => $where), $entityID, $recursive); } /** * Search networks relative to a given network * * @param $relation type of relation ("is contained by", "equals" or "contains") * regarding the networks given as parameter * @param $condition array of elements to select the good arrays (see Parameters above) * - fields : the fields of the network we wish to retrieve (single field or array of * fields). This parameter will impact the result of the function * - address (see \ref parameterType) : the address for the query * - netmask (see \ref parameterType) : the netmask for the query * - exclude IDs : the IDs to exclude from the query (for instance, $this->getID()) * - where : filters to add to the SQL request * * @param $entityID the entity on which the selection should occur (-1 => the current active * entity) (default -1) * @param $recursive set to false to only search in current entity, otherwise, all visible * entities will be search (true by default) * @param $version version of IP to look (only use when using arrays or string as input for * address or netmask n(default 0) * * @return array of networks found. If we want request several field, the return value will be * an array of array * * \warning The order of the elements inside the result are ordered from the nearest one to the * further. (ie. 0.0.0.0 is the further of whatever network if you lool for ones that * contains the current network. **/ static function searchNetworks($relation, $condition, $entityID=-1, $recursive=true, $version=0) { global $DB; if (empty($relation)) { return false; } if (empty($condition["fields"])) { $fields = 'id'; } else { $fields = $condition["fields"]; } if (!is_array($fields)) { $fields = array($fields); } $FIELDS = "`".implode("`, `", $fields)."`"; $startIndex = (($version == 4) ? 3 : 1); $addressDB = array('address_0', 'address_1', 'address_2', 'address_3'); $netmaskDB = array('netmask_0', 'netmask_1', 'netmask_2', 'netmask_3'); $WHERE = ""; if (isset($condition["address"]) && isset($condition["netmask"])) { $addressPa = new IPAddress($condition["address"]); // Check version equality ... if ($version != $addressPa->getVersion()) { if ($version != 0) { return false; } $version = $addressPa->getVersion(); } $netmaskPa = new IPNetmask($condition["netmask"], $version); // Get the array of the adresses $addressPa = $addressPa->getBinary(); $netmaskPa = $netmaskPa->getBinary(); // Check the binary is valid if (!is_array($addressPa) || (count($addressPa) != 4)) { return false; } if (!is_array($netmaskPa) || (count($netmaskPa) != 4)) { return false; } $startIndex = (($version == 4) ? 3 : 0); if ($relation == "equals") { for ($i = $startIndex ; $i < 4 ; ++$i) { $WHERE .= " AND (`".$addressDB[$i]."` & '".$netmaskPa[$i]."')= ('".$addressPa[$i]."' & '".$netmaskPa[$i]."') AND ('".$netmaskPa[$i]."' = `".$netmaskDB[$i]."`)"; } } else { for ($i = $startIndex ; $i < 4 ; ++$i) { if ($relation == "is contained by") { $globalNetmask = "'".$netmaskPa[$i]."'"; } else { $globalNetmask = "`".$netmaskDB[$i]."`"; } $WHERE .= " AND (`".$addressDB[$i]."` & $globalNetmask)= ('".$addressPa[$i]."' & $globalNetmask) AND ('".$netmaskPa[$i]."' & `".$netmaskDB[$i]."`)=$globalNetmask"; } } } $WHERE = "`version`='$version' $WHERE"; if ($entityID < 0) { $entityID = $_SESSION['glpiactive_entity']; } $entitiesID = array(); switch ($relation) { case "is contained by" : $ORDER_ORIENTATION = 'ASC'; if ($recursive) { $entitiesID = getSonsOf('glpi_entities', $entityID); } break; case "contains" : $ORDER_ORIENTATION = 'DESC'; if ($recursive) { $entitiesID = getAncestorsOf('glpi_entities', $entityID); } break; case "equals" : $ORDER_ORIENTATION = ''; if ($recursive) { $entitiesID = getSonsAndAncestorsOf('glpi_entities', $entityID); } break; } $entitiesID[] = $entityID; if (count($entitiesID) > 1) { // At least the current entity is defined $WHERE .= " AND `entities_id` IN ('".implode("', '", $entitiesID)."')"; } else { $WHERE .= " AND `entities_id` = '".$entitiesID[0]."'"; } if (!empty($condition["exclude IDs"])) { if (is_array($condition["exclude IDs"])) { if (count($condition["exclude IDs"]) > 1) { $WHERE .= " AND `id` NOT IN ('".implode("', '", $condition["exclude IDs"])."')"; } else { $WHERE .= " AND `id` <> '".$condition["exclude IDs"][0]."'"; } } else { $WHERE .= " AND `id` <> '".$condition["exclude IDs"]."'"; } } $ORDER = array(); for ($i = $startIndex ; $i < 4 ; ++$i) { $ORDER[] = "BIT_COUNT(`".$netmaskDB[$i]."`) $ORDER_ORIENTATION"; } if (!empty($condition["where"])) { $WHERE .= " AND " . $condition["where"]; } $query = "SELECT $FIELDS FROM `glpi_ipnetworks` WHERE $WHERE ORDER BY ".implode(', ', $ORDER); // By ordering on the netmask, we ensure that the first element is the nearest one (ie: // the last should be 0.0.0.0/0.0.0.0 of x.y.z.a/255.255.255.255 regarding the interested // element) $returnValues = array(); if ($result = $DB->query($query)) { while ($data = $DB->fetch_assoc($result)) { if (count($fields) > 1) { $returnValue = array(); foreach ($fields as $field) { $returnValue[$field] = $data[$field]; } } else { $returnValue = $data[$fields[0]]; } $returnValues[] = $returnValue; } } return $returnValues; } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('IPNetwork_Vlan', $ong, $options); $this->addStandardTab('IPAddress', $ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } /** * Get SQL WHERE statement for requesting elements that are contained inside the current network * * @param $tableName name of the table containing the element * (for instance : glpi_ipaddresses) * @param $binaryFieldPrefix prefix of the binary version of IP address * (binary for glpi ipaddresses) * @param $versionField the name of the field containing the version inside the database * * @return SQL request "WHERE" element **/ function getWHEREForMatchingElement($tableName, $binaryFieldPrefix, $versionField) { $version = $this->fields["version"]; $start = NULL; $this->computeNetworkRange($start); $result = array(); for ($i = ($version == 4 ? 3 : 0) ; $i < 4 ; ++$i) { $result[] = "(`$tableName`.`".$binaryFieldPrefix."_$i` & '".$this->fields["netmask_$i"]."') = ('".$start[$i]."')"; } $result = "`$tableName`.`version` = '$version' AND (".implode(" AND ", $result).")"; return $result; } /** * Check to see if an IP is inside a given network * See : \ref ipAddressToNetwork * * @param $address (see \ref parameterType) the IP address to check * @param $networkAddress (see \ref parameterType) the address of the network * @param $networkNetmask (see \ref parameterType) the netmask of the network * @param $version of IP : only usefull for binary array as input (default 0) * * @return true if the network owns the IP address **/ static function checkIPFromNetwork($address, $networkAddress, $networkNetmask, $version=0) { $IPNetmask = array(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff); $relativity = self::checkNetworkRelativity($address, $IPNetmask, $networkAddress, $networkNetmask, $version); return ($relativity == "equals") || ($relativity == "second contains first"); } /** * \brief Check network relativity * Check how networks are relative (fully different, equals, first contains second, ...) * * @param $firstAddress (see \ref parameterType) address of the first network * @param $firstNetmask (see \ref parameterType) netmask of the first network * @param $secondAddress (see \ref parameterType) address of the second network * @param $secondNetmask (see \ref parameterType) netmask of the second network * @param $version of IP : only usefull for binary array as input (default 0) * * @return string : * - "different version" : there is different versions between elements * - "?" : There is holes inside the netmask and both networks can partially intersect * - "different" : the networks are fully different ; * - "equals" : both networks are equals * - "first contains second" "second contains first" : one include the other */ static function checkNetworkRelativity($firstAddress, $firstNetmask, $secondAddress, $secondNetmask, $version=0) { if ($firstAddress instanceof IPAddress) { if ($version == 0) { $version = $firstAddress->getVersion(); } if ($version != $firstAddress->getVersion()) { return "different version"; } $firstAddress = $firstAddress->getBinary(); } if ($firstNetmask instanceof IPAddress) { if ($version != $firstNetmask->getVersion()) { return "different version"; } $firstNetmask = $firstNetmask->getBinary(); } if ($secondAddress instanceof IPAddress) { if ($version != $secondAddress->getVersion()) { return "different version"; } $secondAddress = $secondAddress->getBinary(); } if ($secondNetmask instanceof IPAddress) { if ($version != $secondNetmask->getVersion()) { return "different version"; } $secondNetmask = $secondNetmask->getBinary(); } $startIndex = (($version == 4) ? 3 : 0); $first = true; $second = true; for ($i = $startIndex ; $i < 4 ; ++$i) { $and = ($firstNetmask[$i] & $secondNetmask[$i]); // Be carefull : php integers are 32 bits SIGNED. // Thus, checking equality must be done by XOR ... $first &= (($and ^ $firstNetmask[$i]) == 0); $second &= (($and ^ $secondNetmask[$i]) == 0); } if (!$first && !$second) { return "?"; } if ($first && $second) { $result = "equals"; $mask = &$firstNetmask; } else if ($first) { $result = "first contains second"; $mask = &$firstNetmask; } else { // $second == true $result = "second contains first"; $mask = &$secondNetmask; } for ($i = $startIndex ; $i < 4 ; ++$i) { if ((($firstAddress[$i] & $mask[$i]) ^ ($secondAddress[$i] & $mask[$i])) != 0) { return "different"; } } return $result; } /** * Compute the first and the last address of $this * \see computeNetworkRangeFromAdressAndNetmask() * * @param $start * @param $end (default NULL) * @param $excludeBroadcastAndNetwork Don't provide extremties addresses * ($this->fields['addressable'] by default) * (default '') **/ function computeNetworkRange(&$start, &$end=NULL, $excludeBroadcastAndNetwork='') { if (!is_bool($excludeBroadcastAndNetwork)) { if (isset($this->fields['addressable'])) { $excludeBroadcastAndNetwork = ($this->fields['addressable'] == 1); } else { $excludeBroadcastAndNetwork = false; } } self::computeNetworkRangeFromAdressAndNetmask($this->getAddress(), $this->getNetmask(), $start, $end, $excludeBroadcastAndNetwork); } /** * \brief Compute the first and the last address of a network. * That is usefull, for instance, to compute the "real" network address (the first address) * or the broadcast address of the network * * @param $address (see \ref parameterType) the address of the network * @param $netmask (see \ref parameterType) its netmask * @param $firstAddress (see \ref parameterType - in/out) * the first address (ie real address of the network) * @param $lastAddress (see \ref parameterType - in/out) * the lastAddress of the network * (ie. : the broadcast address) (default NULL) * @param $excludeBroadcastAndNetwork boolean exclude broadcast and network address from the * result (false by default) **/ static function computeNetworkRangeFromAdressAndNetmask($address, $netmask, &$firstAddress, &$lastAddress=NULL, $excludeBroadcastAndNetwork=false) { if ($address instanceof IPAddress) { $address = $address->getBinary(); } if ($netmask instanceof IPNetmask) { $netmask = $netmask->getBinary(); } $start = array(); $end = array(); for ($i = 0 ; $i < 4 ; ++$i) { $start[$i] = IPAddress::convertNegativeIntegerToPositiveFloat($address[$i] & $netmask[$i]); $end[$i] = IPAddress::convertNegativeIntegerToPositiveFloat($address[$i] | ~$netmask[$i]); } if ($excludeBroadcastAndNetwork) { IPAddress::addValueToAddress($start, 1); IPAddress::addValueToAddress($end, -1); } if ($firstAddress instanceof IPAddress) { $firstAddress->setAddressFromBinary($start); } else { $firstAddress = $start; } if ($lastAddress instanceof IPAddress) { $lastAddress->setAddressFromBinary($end); } else { $lastAddress = $end; } } /** * \brief Recreate network tree * Among others, the migration create plan tree network. This method allows to recreate the tree. * You can also use it if you suspect the network tree to be corrupted. * * First, reset the tree, then, update each network by its own field, letting * CommonImplicitTreeDropdown working such as it would in case of standard update * * @return nothing **/ static function recreateTree() { global $DB; // Reset the tree $query = "UPDATE `glpi_ipnetworks` SET `ipnetworks_id` = 0, `level` = 1, `completename` = `name`"; $DB->query($query); // Foreach IPNetwork ... $query = "SELECT `id` FROM `glpi_ipnetworks`"; $network = new self(); foreach ($DB->request($query) as $network_entry) { if ($network->getFromDB($network_entry['id'])) { $input = $network->fields; // ... update it by its own entries $network->update($input); } } } /** * @since version 0.84 * * @param $itemtype * @param $base HTMLTableBase object * @param $super HTMLTableSuperHeader object (default NULL) * @param $father HTMLTableHeader object (default NULL) * @param $options array **/ static function getHTMLTableHeader($itemtype, HTMLTableBase $base, HTMLTableSuperHeader $super=NULL, HTMLTableHeader $father=NULL, array $options=array()) { if ($itemtype != 'IPAddress') { return; } $column_name = __CLASS__; if (isset($options['dont_display'][$column_name])) { return; } $content = self::getTypeName(); $this_header = $base->addHeader($column_name, $content, $super, $father); $this_header->setItemType(__CLASS__); } /** * @since version 0.84 * * @param $row HTMLTableRow object (default NULL) * @param $item CommonDBTM object (default NULL) * @param $father HTMLTableCell object (default NULL) * @param $options array **/ static function getHTMLTableCellsForItem(HTMLTableRow $row=NULL, CommonDBTM $item=NULL, HTMLTableCell $father=NULL, array $options=array()) { global $DB, $CFG_GLPI; if (empty($item)) { if (empty($father)) { return; } $item = $father->getItem(); } if ($item->getType() != 'IPAddress') { return; } $column_name = __CLASS__; if (isset($options['dont_display'][$column_name])) { return; } $header= $row->getGroup()->getHeaderByName('Internet', __CLASS__); if (!$header) { return; } $createRow = (isset($options['createRow']) && $options['createRow']); $options['createRow'] = false; $network = new self(); foreach (self::searchNetworksContainingIP($item) as $networks_id) { if ($network->getFromDB($networks_id)) { if ($createRow) { $row = $row->createRow(); } //TRANS: %1$s is address, %2$s is netmask $content = sprintf(__('%1$s / %2$s'), $network->getAddress()->getTextual(), $network->getNetmask()->getTextual()); if ($network->fields['addressable'] == 1) { $content = "".$content.""; } $content = sprintf(__('%1$s - %2$s'), $content, $network->getLink()); $this_cell = $row->addCell($header, $content, $father, $network); } } } /** * Show all available IPNetwork for a given entity * * @param $entities_id entity of the IPNetworks (-1 for all entities) * (default -1) **/ static function showIPNetworkProperties($entities_id=-1) { global $CFG_GLPI; $rand = mt_rand(); self::dropdown(array('entity' => $entities_id, 'rand' => $rand)); $params = array('ipnetworks_id' => '__VALUE__'); Ajax::updateItemOnSelectEvent("dropdown_ipnetworks_id$rand", "show_ipnetwork_$rand", $CFG_GLPI["root_doc"]. "/ajax/dropdownShowIPNetwork.php", $params); echo " \n"; } /** * Override title function to display the link to reinitialisation of the network tree **/ function title() { parent::title(); if (Session::haveRight('internet', 'w') && Session::isViewAllEntities()) { echo "
    "; echo ""; echo ""; echo "
    "; Html::showSimpleForm(IPNetwork::getFormURL(), 'reinit_network', __('Reinit the network topology')); echo "
    "; echo "
    "; } } } ?> glpi-0.84.3+dfsg.1/inc/ipnetwork_vlan.class.php000066400000000000000000000156041226600447100212570ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * @since version 0.84 * **/ class IPNetwork_Vlan extends CommonDBRelation { // From CommonDBRelation static public $itemtype_1 = 'IPNetwork'; static public $items_id_1 = 'ipnetworks_id'; static public $itemtype_2 = 'Vlan'; static public $items_id_2 = 'vlans_id'; static public $checkItem_2_Rights = self::HAVE_VIEW_RIGHT_ON_ITEM; function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } /** * Get search function for the class * * @return array of search option **/ function getSearchOptions() { $tab = parent::getSearchOptions(); return $tab; } /** * @param $portID * @param $vlanID **/ function unassignVlan($portID, $vlanID) { $this->getFromDBByQuery("WHERE `ipnetworks_id` = '$portID' AND `vlans_id` = '$vlanID'"); return $this->delete($this->fields); } /** * @param $port * @param $vlan **/ function assignVlan($port, $vlan) { $input = array('ipnetworks_id' => $port, 'vlans_id' => $vlan); return $this->add($input); } /** * @param $port IPNetwork object **/ static function showForIPNetwork(IPNetwork $port) { global $DB, $CFG_GLPI; $ID = $port->getID(); if (!$port->can($ID, 'r')) { return false; } $canedit = $port->can($ID, 'w'); $rand = mt_rand(); $query = "SELECT `".self::getTable()."`.id as assocID, `glpi_vlans`.* FROM `".self::getTable()."` LEFT JOIN `glpi_vlans` ON (`".self::getTable()."`.`vlans_id` = `glpi_vlans`.`id`) WHERE `ipnetworks_id` = '$ID'"; $result = $DB->query($query); $vlans = array(); $used = array(); if ($number = $DB->numrows($result)) { while ($line = $DB->fetch_assoc($result)) { $used[$line["id"]] = $line["id"]; $vlans[$line["assocID"]] = $line; } } if ($canedit) { echo "
    \n"; echo "\n"; echo "\n"; echo ""; echo "\n"; echo "
    ".__('Associate a VLAN')."
    "; echo ""; Vlan::dropdown(array('used' => $used)); echo " "; echo "
    \n"; Html::closeForm(); echo "
    \n"; } echo "
    "; if ($canedit && $number) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $massiveactionparams = array('num_displayed' => $number); Html::showMassiveActions(__CLASS__, $massiveactionparams); } echo ""; echo ""; if ($canedit && $number) { echo ""; } echo ""; echo ""; echo ""; echo ""; $used = array(); foreach ($vlans as $data) { echo ""; if ($canedit) { echo ""; } $name = $data["name"]; if ($_SESSION["glpiis_ids_visible"] || empty($data["name"])) { $name = sprintf(__('%1$s (%2$s)'), $name, $data["id"]); } echo ""; echo ""; echo ""; } echo "
    ".Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand)."".__('Name')."".__('Entity')."".__('ID TAG')."
    "; Html::showMassiveActionCheckBox(__CLASS__, $data["assocID"]); echo " ".$name. ""; echo "".Dropdown::getDropdownName("glpi_entities", $data["entities_id"]); echo "".$data["tag"]."
    "; if ($canedit && $number) { $massiveactionparams['ontop'] = false; Html::showMassiveActions(__CLASS__, $massiveactionparams); Html::closeForm(); } echo "
    "; } /** * @param $portID **/ static function getVlansForIPNetwork($portID) { global $DB; $vlans = array(); $query = "SELECT `vlans_id` FROM `".self::getTable()."` WHERE `ipnetworks_id` = '$portID'"; foreach ($DB->request($query) as $data) { $vlans[$data['vlans_id']] = $data['vlans_id']; } return $vlans; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { switch ($item->getType()) { case 'IPNetwork' : if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(Vlan::getTypeName(), countElementsInTable($this->getTable(), "ipnetworks_id = '".$item->getID()."'")); } return Vlan::getTypeName(); } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType()=='IPNetwork') { self::showForIPNetwork($item); } return true; } } ?> glpi-0.84.3+dfsg.1/inc/item_devicecase.class.php000066400000000000000000000026551226600447100213300ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Relation between item and devices **/ class Item_DeviceCase extends Item_Devices { static public $itemtype_2 = 'DeviceCase'; static public $items_id_2 = 'devicecases_id'; static protected $notable = false; } ?> glpi-0.84.3+dfsg.1/inc/item_devicecontrol.class.php000066400000000000000000000026711226600447100220730ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Relation between item and devices **/ class Item_DeviceControl extends Item_Devices { static public $itemtype_2 = 'DeviceControl'; static public $items_id_2 = 'devicecontrols_id'; static protected $notable = false; } ?> glpi-0.84.3+dfsg.1/inc/item_devicedrive.class.php000066400000000000000000000026611226600447100215230ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Relation between item and devices **/ class Item_DeviceDrive extends Item_Devices { static public $itemtype_2 = 'DeviceDrive'; static public $items_id_2 = 'devicedrives_id'; static protected $notable = false; } ?> glpi-0.84.3+dfsg.1/inc/item_devicegraphiccard.class.php000066400000000000000000000034321226600447100226560ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Relation between item and devices **/ class Item_DeviceGraphicCard extends Item_Devices { static public $itemtype_2 = 'DeviceGraphicCard'; static public $items_id_2 = 'devicegraphiccards_id'; static protected $notable = false; static function getSpecificities() { return array('memory' => array('long name' => sprintf(__('%1$s (%2$s)'), __('Memory'), __('Mio')), 'short name' => __('Memory'), 'size' => 10)); } } ?> glpi-0.84.3+dfsg.1/inc/item_deviceharddrive.class.php000066400000000000000000000037641226600447100223670ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Relation between item and devices **/ class Item_DeviceHardDrive extends Item_Devices { static public $itemtype_2 = 'DeviceHardDrive'; static public $items_id_2 = 'deviceharddrives_id'; static protected $notable = false; static function getSpecificities() { return array('capacity' => array('long name' => sprintf(__('%1$s (%2$s)'), __('Capacity'), __('Mio')), 'short name' => __('Capacity'), 'size' => 10), 'serial' => array('long name' => __('Serial number'), 'short name' => __('Serial number'), 'size' => 20)); } } ?> glpi-0.84.3+dfsg.1/inc/item_devicememory.class.php000066400000000000000000000037471226600447100217300ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.84 */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Relation between item and devices **/ class Item_DeviceMemory extends Item_Devices { static public $itemtype_2 = 'DeviceMemory'; static public $items_id_2 = 'devicememories_id'; static protected $notable = false; static function getSpecificities() { return array('size' => array('long name' => sprintf(__('%1$s (%2$s)'), __('Size'), __('Mio')), 'short name' => __('Size'), 'size' => 10), 'serial' => array('long name' => __('Serial number'), 'short name' => __('Serial number'), 'size' => 20)); } } ?> glpi-0.84.3+dfsg.1/inc/item_devicemotherboard.class.php000066400000000000000000000027111226600447100227140ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Relation between item and devices **/ class Item_DeviceMotherboard extends Item_Devices { static public $itemtype_2 = 'DeviceMotherboard'; static public $items_id_2 = 'devicemotherboards_id'; static protected $notable = false; } ?> glpi-0.84.3+dfsg.1/inc/item_devicenetworkcard.class.php000066400000000000000000000033161226600447100227330ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.84 */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Relation between item and devices **/ class Item_DeviceNetworkCard extends Item_Devices { static public $itemtype_2 = 'DeviceNetworkCard'; static public $items_id_2 = 'devicenetworkcards_id'; static protected $notable = false; static function getSpecificities() { return array('mac' => array('long name' => __('MAC address'), 'short name' => __('MAC address'), 'size' => 18)); } } ?> glpi-0.84.3+dfsg.1/inc/item_devicepci.class.php000066400000000000000000000026761226600447100211730ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.84 */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Relation between item and devices **/ class Item_DevicePci extends Item_Devices { static public $itemtype_2 = 'DevicePci'; static public $items_id_2 = 'devicepcis_id'; static protected $notable = false; } ?> glpi-0.84.3+dfsg.1/inc/item_devicepowersupply.class.php000066400000000000000000000027121226600447100230200ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Relation between item and devices **/ class Item_DevicePowerSupply extends Item_Devices { static public $itemtype_2 = 'DevicePowerSupply'; static public $items_id_2 = 'devicepowersupplies_id'; static protected $notable = false; } ?> glpi-0.84.3+dfsg.1/inc/item_deviceprocessor.class.php000066400000000000000000000037751226600447100224400ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Relation between item and devices **/ class Item_DeviceProcessor extends Item_Devices { static public $itemtype_2 = 'DeviceProcessor'; static public $items_id_2 = 'deviceprocessors_id'; static protected $notable = false; static function getSpecificities() { return array('frequency' => array('long name' => sprintf(__('%1$s (%2$s)'), __('Frequency'), __('MHz')), 'short name' => __('Frequency'), 'size' => 10), 'serial' => array('long name' => __('Serial number'), 'short name' => __('Serial number'), 'size' => 20)); } } ?> glpi-0.84.3+dfsg.1/inc/item_devices.class.php000066400000000000000000000371541226600447100206610ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.84 */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Relation between item and devices * We completely relies on CommonDBConnexity to manage the can* and the history and the deletion ... **/ class Item_Devices extends CommonDBRelation { static public $itemtype_1 = 'itemtype'; // Type ref or field name (must start with itemtype) static public $items_id_1 = 'items_id'; // Field name static public $checkItem_2_Rights = self::DONT_CHECK_ITEM_RIGHTS; static protected $notable = true; static public $logs_for_item_2 = false; static public $log_history_1_add = Log::HISTORY_ADD_DEVICE; static public $log_history_1_update = Log::HISTORY_UPDATE_DEVICE; static public $log_history_1_delete = Log::HISTORY_DELETE_DEVICE; static public $log_history_1_lock = Log::HISTORY_LOCK_DEVICE; static public $log_history_1_unlock = Log::HISTORY_UNLOCK_DEVICE; static function getSpecificities() { return array(); } /** * Get itemtype of devices * @todo : Think of allowing other kind of devices such as for NetworkPort Instantation types **/ static function getDeviceTypes() { return array(1 => 'Item_DeviceMotherboard', 2 => 'Item_DeviceProcessor', 3 => 'Item_DeviceMemory', 4 => 'Item_DeviceHardDrive', 5 => 'Item_DeviceNetworkCard', 6 => 'Item_DeviceDrive', 7 => 'Item_DeviceControl', 8 => 'Item_DeviceGraphicCard', 9 => 'Item_DeviceSoundCard', 10 => 'Item_DevicePci', 11 => 'Item_DeviceCase', 12 => 'Item_DevicePowerSupply'); } static function getDeviceType() { return str_replace ('Item_', '', get_called_class()); } static function cloneItem($itemtype, $oldid, $newid) { global $DB; foreach (self::getDeviceTypes() as $link_type) { $query = "SELECT * FROM `".$link_type::getTable()."` WHERE `itemtype` = '$itemtype' AND `items_id` = '$oldid'"; $result_iterator = $DB->request($query); if ($result_iterator->numrows() > 0) { $link = new $link_type(); foreach ($result_iterator as $data) { unset($data['id']); $data['items_id'] = $newid; $data['_itemtype'] = $itemtype; $data['_no_history'] = true; $data = Toolbox::addslashes_deep($data); $link->add($data); } } } } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if ($item->canView()) { switch ($item->getType()) { case 'Computer' : if ($_SESSION['glpishow_count_on_tabs']) { $nb = 0; foreach (self::getDeviceTypes() as $link_type) { $nb += countElementsInTable($link_type::getTable(), "`items_id` = '".$item->getID()."' AND `itemtype` = '".$item->getType()."' AND `is_deleted`='0'"); } } if (isset($nb)) { return self::createTabEntry(_n('Component', 'Components', 2), $nb); } return _n('Component', 'Components', 2); } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { self::showForItem($item, 1, $withtemplate); return true; } static function showForItem(CommonGLPI $item, $withtemplate=0) { $ID = $item->getField('id'); if (!$item->can($ID, 'r')) { return false; } $canedit = (($withtemplate != 2) && $item->can($ID, 'w')); echo "
    "; $rand = mt_rand(); if ($canedit) { echo "\n\n"; echo "\t\n"; echo "\t\n"; } $table = new HTMLTableMain(); $table->setTitle(_n('Component', 'Components', 2)); if ($canedit) { $delete_all_column = $table->addHeader('delete all', Html::getCheckAllAsCheckbox("form_device_action$rand", '__RAND__')); $delete_all_column->setHTMLClass('center'); } else { $delete_all_column = NULL; } $common_column = $table->addHeader('common', __('Type of component')); $specific_column = $table->addHeader('specificities', __('Specificities')); $specific_column->setHTMLClass('center'); $dynamic_column = ''; if ($item->isDynamic()) { $dynamic_column = $table->addHeader('is_dynamic', __('Automatic inventory')); $dynamic_column->setHTMLClass('center'); } if ($canedit) { $content = ""; $delete_column = $table->addHeader('delete one', $content); $delete_column->setHTMLClass('center'); } else { $delete_column = NULL; } $table_options = array('canedit' => $canedit); $devtypes = array(); foreach (self::getDeviceTypes() as $link_type) { $devtypes [] = $link_type::getDeviceType(); $link_type::getTableGroup($item, $table, $table_options, $delete_all_column, $common_column, $specific_column, $delete_column, $dynamic_column); } if ($canedit) { echo "
    "; echo __('Add a new component').""; Dropdown::showAllItems('devices_id', '', 0, -1, $devtypes, false, false, 'devicetype'); echo ""; echo ""; echo "
    "; } $table->display(array('display_super_for_each_group' => false, 'display_title_for_each_group' => false)); if ($canedit) { echo ""; Html::closeForm(); } echo "
    "; } static function getDeviceForeignKey() { return getForeignKeyFieldForTable(getTableForItemType(static::getDeviceType())); } static function getTableGroup(CommonDBTM $item, HTMLTableMain $table, array $options, HTMLTableSuperHeader $delete_all_column = NULL, HTMLTableSuperHeader $common_column, HTMLTableSuperHeader $specific_column, HTMLTableSuperHeader $delete_column = NULL, $dynamic_column) { global $DB; $device_type = static::getDeviceType(); $table_group = $table->createGroup($device_type, ''); //TRANS : %1$s is the type of the device // %2$s is the type of the item // %3$s is the name of the item (used for headings of a list), $options['itemtype_title'] = sprintf(__('%1$s of %2$s: %3$s'), $device_type::getTypeName(2), $item->getTypeName(1), $item->getName()); $device_type::getHTMLTableHeader($item->getType(), $table_group, $common_column, NULL, $options); $spec_column = NULL; $specificity_columns = array(); foreach (static::getSpecificities() as $field => $attributs) { $spec_column = $table_group->addHeader('spec_'.$field, $attributs['long name'], $specific_column, $spec_column); $specificity_columns[$field] = $spec_column; } if ($item->isDynamic()) { $dynamics_column = $table_group->addHeader('one', ' ', $dynamic_column, $spec_column); $previous_column = $dynamics_column; } else { $previous_column = $spec_column; } if ($options['canedit']) { $delete_one = $table_group->addHeader('one', ' ', $delete_column, $previous_column); } $fk = static::getDeviceForeignKey(); $query = "SELECT * FROM `".static::getTable()."` WHERE `itemtype` = '".$item->getType()."' AND `items_id` = '".$item->getID()."' AND `is_deleted` = '0' ORDER BY $fk"; $device = new $device_type(); $device->getEmpty(); foreach ($DB->request($query) as $link) { if ($link[$fk] != $device->getID()) { $device->getFromDB($link[$fk]); $current_row = $table_group->createRow(); $device_group = $device_type.'_'.$link[$fk].'_'.mt_rand(); $current_row->setHTMLID($device_group); if ($options['canedit']) { $cell_value = Html::getCheckAllAsCheckbox($device_group); $current_row->addCell($delete_all_column, $cell_value); } $device->getHTMLTableCellForItem($current_row, $item, NULL, $options); } $spec_cell = NULL; foreach (static::getSpecificities() as $field => $attributs) { $content = $link[$field]; if ($options['canedit']) { $content = ""; } $spec_cell = $current_row->addCell($specificity_columns[$field], $content, $spec_cell); } if ($item->isDynamic()) { $previous_cell = $current_row->addCell($dynamics_column, Dropdown::getYesNo($link['is_dynamic']), $spec_cell); } else { $previous_cell = $spec_cell; } if ($options['canedit']) { $cell_value = ""; $current_row->addCell($delete_one, $cell_value, $previous_cell); } } } /** * @param $numberToAdd * @param $itemtype * @param $items_id * @param $devices_id **/ function addDevices($numberToAdd, $itemtype, $items_id, $devices_id) { global $DB; if ($numberToAdd == 0) { return; } $input = array('itemtype' => $itemtype, 'items_id' => $items_id, static::getDeviceForeignKey() => $devices_id); $this->check(-1, 'w', $input); $device_type = static::getDeviceType(); $device = new $device_type(); $device->getFromDB($devices_id); foreach (static::getSpecificities() as $field => $attributs) { if (isset($device->fields[$field.'_default'])) { $input[$field] = $device->fields[$field.'_default']; } } for ($i = 0 ; $i < $numberToAdd ; $i ++) { $this->add($input); } } /** * @param $input * @param $delete **/ static function updateAll($input, $delete) { if (!isset($input['itemtype']) || !isset($input['items_id'])) { Html::displayNotFoundError(); } $itemtype = $input['itemtype']; $items_id = $input['items_id']; if (!$item = getItemForItemtype($itemtype)) { Html::displayNotFoundError(); } $item->check($input['items_id'], 'w', $_POST); $links = array(); // Update quantity $device_type = ''; foreach ($input as $key => $val) { $data = explode("_",$key); if (!empty($data[0])) { $command = $data[0]; } else { continue; } if (!empty($data[1]) && in_array('Item_'.$data[1], self::getDeviceTypes())) { $link_type = 'Item_'.$data[1]; } else { continue; } if (!empty($data[2])) { $links_id = $data[2]; } else { continue; } if (!isset($links[$link_type])) { $links[$link_type] = array('add' => array(), 'update' => array(), 'remove' => array()); } switch ($command) { case 'quantity' : $links[$link_type]['add'][$links_id] = $val; break; case 'value' : if (!isset($links[$link_type]['update'][$links_id])) { $links[$link_type]['update'][$links_id] = array(); } if (isset($data[3])) { $links[$link_type]['update'][$links_id][$data[3]] = $val; } break; case 'remove' : if ($val == 1) { $links[$link_type]['remove'][] = $links_id; } break; } } foreach ($links as $type => $commands) { if ($link = getItemForItemtype($type)) { if ($delete) { foreach ($commands['remove'] as $link_to_remove) { $link->delete(array('id' => $link_to_remove)); } } else { foreach ($commands['add'] as $link_to_add => $number) { $link->addDevices($number, $itemtype, $items_id, $link_to_add); } foreach ($commands['update'] as $link_to_update => $input) { $input['id'] = $link_to_update; $link->update($input); } } unset($link); } } } /** * @param $itemtype * @param $items_id **/ static function cleanItemDeviceDBOnItemDelete($itemtype, $items_id) { foreach (self::getDeviceTypes() as $link_type) { $link = getItemForItemtype($link_type); if ($link) { $link->cleanDBOnItemDelete($itemtype, $items_id); } } } } ?> glpi-0.84.3+dfsg.1/inc/item_devicesoundcard.class.php000066400000000000000000000027271226600447100223770ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.84 */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Relation between item and devices **/ class Item_DeviceSoundCard extends Item_Devices { static public $itemtype_2 = 'DeviceSoundCard'; static public $items_id_2 = 'devicesoundcards_id'; static protected $notable = false; } ?> glpi-0.84.3+dfsg.1/inc/item_problem.class.php000066400000000000000000000241531226600447100206720ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // Relation between Problems and Items class Item_Problem extends CommonDBRelation{ // From CommonDBRelation static public $itemtype_1 = 'Problem'; static public $items_id_1 = 'problems_id'; static public $itemtype_2 = 'itemtype'; static public $items_id_2 = 'items_id'; static public $checkItem_2_Rights = self::HAVE_VIEW_RIGHT_ON_ITEM; /** * @since version 0.84 **/ function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } /** * @see CommonDBTM::prepareInputForAdd() **/ function prepareInputForAdd($input) { // Avoid duplicate entry $restrict = " `problems_id` = '".$input['problems_id']."' AND `itemtype` = '".$input['itemtype']."' AND `items_id` = '".$input['items_id']."'"; if (countElementsInTable($this->getTable(),$restrict)>0) { return false; } return parent::prepareInputForAdd($input); } /** * @param $item CommonDBTM object **/ static function countForItem(CommonDBTM $item) { $restrict = "`glpi_items_problems`.`problems_id` = `glpi_problems`.`id` AND `glpi_items_problems`.`items_id` = '".$item->getField('id')."' AND `glpi_items_problems`.`itemtype` = '".$item->getType()."'". getEntitiesRestrictRequest(" AND ", "glpi_problems", '', '', true); $nb = countElementsInTable(array('glpi_items_problems', 'glpi_problems'), $restrict); return $nb ; } /** * Print the HTML array for Items linked to a problem * * @param $problem Problem object * * @return Nothing (display) **/ static function showForProblem(Problem $problem) { global $DB, $CFG_GLPI; $instID = $problem->fields['id']; if (!$problem->can($instID,'r')) { return false; } $canedit = $problem->can($instID,'w'); $rand = mt_rand(); $query = "SELECT DISTINCT `itemtype` FROM `glpi_items_problems` WHERE `glpi_items_problems`.`problems_id` = '$instID' ORDER BY `itemtype`"; $result = $DB->query($query); $number = $DB->numrows($result); if ($canedit) { echo "
    "; echo ""; echo ""; echo ""; echo ""; echo "
    ".__('Add an item')."
    "; $types = array(); foreach ($problem->getAllTypesForHelpdesk() as $key => $val) { $types[] = $key; } Dropdown::showAllItems("items_id", 0, 0, ($problem->fields['is_recursive']?-1:$problem->fields['entities_id']), $types); echo ""; echo ""; echo ""; echo "
    "; Html::closeForm(); echo "
    "; } echo "
    "; if ($canedit && $number) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $massiveactionparams = array(); Html::showMassiveActions(__CLASS__, $massiveactionparams); } echo ""; echo ""; if ($canedit && $number) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; $totalnb = 0; for ($i=0 ; $i<$number ; $i++) { $itemtype = $DB->result($result, $i, "itemtype"); if (!($item = getItemForItemtype($itemtype))) { continue; } if ($item->canView()) { $itemtable = getTableForItemType($itemtype); $query = "SELECT `$itemtable`.*, `glpi_items_problems`.`id` AS IDD, `glpi_entities`.`id` AS entity FROM `glpi_items_problems`, `$itemtable`"; if ($itemtype != 'Entity') { $query .= " LEFT JOIN `glpi_entities` ON (`$itemtable`.`entities_id`=`glpi_entities`.`id`) "; } $query .= " WHERE `$itemtable`.`id` = `glpi_items_problems`.`items_id` AND `glpi_items_problems`.`itemtype` = '$itemtype' AND `glpi_items_problems`.`problems_id` = '$instID'"; if ($item->maybeTemplate()) { $query .= " AND `$itemtable`.`is_template` = '0'"; } $query .= getEntitiesRestrictRequest(" AND", $itemtable, '', '', $item->maybeRecursive())." ORDER BY `glpi_entities`.`completename`, `$itemtable`.`name`"; $result_linked = $DB->query($query); $nb = $DB->numrows($result_linked); for ($prem=true ; $data=$DB->fetch_assoc($result_linked) ; $prem=false) { $name = $data["name"]; if ($_SESSION["glpiis_ids_visible"] || empty($data["name"])) { $name = sprintf(__('%1$s (%2$s)'), $name, $data["id"]); } $link = Toolbox::getItemTypeFormURL($itemtype); $namelink = "".$name.""; echo ""; if ($canedit) { echo ""; } if ($prem) { $typename = $item->getTypeName($nb); echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; } $totalnb += $nb; } } echo ""; echo " "; echo "
    ".Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand)."".__('Type')."".__('Entity')."".__('Name')."".__('Serial number')."".__('Inventory number')."
    "; Html::showMassiveActionCheckBox(__CLASS__, $data["IDD"]); echo "". (($nb > 1) ? sprintf(__('%1$s: %2$s'), $typename, $nb) : $typename).""; echo Dropdown::getDropdownName("glpi_entities", $data['entity'])."".$namelink."".(isset($data["serial"])? "".$data["serial"]."" :"-"). "". (isset($data["otherserial"])? "".$data["otherserial"]."" :"-")."
    ". (($totalnb > 0) ? sprintf(__('%1$s = %2$s'), __('Total'), $totalnb) :" "); echo " 
    "; if ($canedit && $number) { $massiveactionparams['ontop'] = false; Html::showMassiveActions(__CLASS__, $massiveactionparams); Html::closeForm(); } echo "
    "; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { switch ($item->getType()) { case 'Problem' : return _n('Item', 'Items', 2); default : if (Session::haveRight("show_all_problem","1")) { $nb = 0; if ($_SESSION['glpishow_count_on_tabs']) { // Direct one $nb = countElementsInTable('glpi_items_problems', " `itemtype` = '".$item->getType()."' AND `items_id` = '".$item->getID()."'"); // Linked items if ($subquery = $item->getSelectLinkedItem()) { $nb += countElementsInTable('glpi_items_problems', " (`itemtype`,`items_id`) IN (" . $subquery . ")"); } } return self::createTabEntry(Problem::getTypeName(2), $nb); } } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($item->getType()) { case 'Problem' : self::showForProblem($item); break; default : Problem::showListForItem($item); } return true; } } ?> glpi-0.84.3+dfsg.1/inc/itilcategory.class.php000066400000000000000000000266561226600447100207250ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// ITILCategory class class ITILCategory extends CommonTreeDropdown { // From CommonDBTM public $dohistory = true; static function canCreate() { return Session::haveRight('entity_dropdown', 'w'); } static function canView() { return Session::haveRight('entity_dropdown', 'r'); } function getAdditionalFields() { $tab = array(array('name' => $this->getForeignKeyField(), 'label' => __('As child of'), 'type' => 'parent', 'list' => false), array('name' => 'users_id', 'label' => __('Technician in charge of the hardware'), 'type' => 'UserDropdown', 'right' => 'own_ticket', 'list' => true), array('name' => 'groups_id', 'label' => __('Group in charge of the hardware'), 'type' => 'dropdownValue', 'condition' => '`is_assign`', 'list' => true), array('name' => 'knowbaseitemcategories_id', 'label' => __('Knowledge base'), 'type' => 'dropdownValue', 'list' => true), array('name' => 'is_helpdeskvisible', 'label' => __('Visible in the simplified interface'), 'type' => 'bool', 'list' => true), array('name' => 'is_incident', 'label' => __('Visible for an incident'), 'type' => 'bool', 'list' => true), array('name' => 'is_request', 'label' => __('Visible for a request'), 'type' => 'bool', 'list' => true), array('name' => 'is_problem', 'label' => __('Visible for a problem'), 'type' => 'bool', 'list' => true), array('name' => 'tickettemplates_id_demand', 'label' => __('Template for a request'), 'type' => 'dropdownValue', 'list' => true), array('name' => 'tickettemplates_id_incident', 'label' => __('Template for an incident'), 'type' => 'dropdownValue', 'list' => true), ); if (!Session::haveRight("edit_all_problem", "1") && !Session::haveRight("show_all_problem", "1") && !Session::haveRight("show_my_problem", "1") && !Session::haveRight("delete_problem", "1")) { unset($tab[7]); } return $tab; } function getSearchOptions() { $tab = parent::getSearchOptions(); $tab[70]['table'] = 'glpi_users'; $tab[70]['field'] = 'name'; $tab[70]['name'] = __('Technician in charge of the hardware'); $tab[70]['datatype'] = 'dropdown'; $tab[70]['right'] = 'own_ticket'; $tab[71]['table'] = 'glpi_groups'; $tab[71]['field'] = 'completename'; $tab[71]['name'] = __('Group'); $tab[71]['datatype'] = 'dropdown'; $tab[72]['table'] = 'glpi_tickettemplates'; $tab[72]['field'] = 'name'; $tab[72]['linkfield'] = 'tickettemplates_id_demand'; $tab[72]['name'] = __('Template for a request'); $tab[72]['datatype'] = 'dropdown'; $tab[73]['table'] = 'glpi_tickettemplates'; $tab[73]['field'] = 'name'; $tab[73]['linkfield'] = 'tickettemplates_id_incident'; $tab[73]['name'] = __('Template for an incident'); $tab[73]['datatype'] = 'dropdown'; $tab[74]['table'] = $this->getTable(); $tab[74]['field'] = 'is_incident'; $tab[74]['name'] = __('Visible for an incident'); $tab[74]['datatype'] = 'bool'; $tab[75]['table'] = $this->getTable(); $tab[75]['field'] = 'is_request'; $tab[75]['name'] = __('Visible for a request'); $tab[75]['datatype'] = 'bool'; $tab[76]['table'] = $this->getTable(); $tab[76]['field'] = 'is_problem'; $tab[76]['name'] = __('Visible for a problem'); $tab[76]['datatype'] = 'bool'; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'is_helpdeskvisible'; $tab[3]['name'] = __('Visible in the simplified interface'); $tab[3]['datatype'] = 'bool'; $tab[77]['table'] = 'glpi_tickets'; $tab[77]['field'] = 'count'; $tab[77]['name'] = _x('quantity', 'Number of tickets'); $tab[77]['datatype'] = 'integer'; $tab[77]['forcegroupby'] = true; $tab[77]['massiveaction'] = false; $tab[77]['joinparams'] = array('jointype' => 'child'); $tab[78]['table'] = 'glpi_problems'; $tab[78]['field'] = 'count'; $tab[78]['name'] = __('Number of problems'); $tab[78]['datatype'] = 'integer'; $tab[78]['forcegroupby'] = true; $tab[78]['massiveaction'] = false; $tab[78]['joinparams'] = array('jointype' => 'child'); $tab[79]['table'] = 'glpi_knowbaseitemcategories'; $tab[79]['field'] = 'completename'; $tab[79]['name'] = __('Knowledge base'); $tab[79]['datatype'] = 'dropdown'; return $tab; } static function getTypeName($nb=0) { return _n('Ticket category', 'Ticket categories', $nb); } function post_getEmpty() { $this->fields['is_helpdeskvisible'] = 1; $this->fields['is_request'] = 1; $this->fields['is_incident'] = 1; $this->fields['is_problem'] = 1; } /** * Get links to Faq * * @param $withname boolean also display name ? (false by default) **/ function getLinks($withname=false) { global $CFG_GLPI; $ret = ''; if ($withname) { $ret .= $this->fields["name"]; $ret .= "  "; } if ($this->fields['knowbaseitemcategories_id']) { $title = __('FAQ'); if (isset($_SESSION['glpiactiveprofile']) && ($_SESSION['glpiactiveprofile']['interface'] == 'central')) { $title = __('Knowledge base'); } $ret .= "". "\"$title\""; } return $ret; } function cleanDBonPurge() { Rule::cleanForItemCriteria($this); } /** * @since version 0.84 * * @param $item CommonGLPI object * @param $withtemplate (default 0) **/ function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (Session::haveRight("entity_dropdown","r")) { switch ($item->getType()) { case 'TicketTemplate' : $ong[1] = $this->getTypeName(2); return $ong; } } return parent::getTabNameForItem($item, $withtemplate); } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType() == 'TicketTemplate') { self::showForTicketTemplate($item, $withtemplate); } return parent::displayTabContentForItem($item, $tabnum, $withtemplate); } /** * @param $tt TicketTemplate object * @param $withtemplate (default '') **/ static function showForTicketTemplate(TicketTemplate $tt, $withtemplate='') { global $DB, $CFG_GLPI; $itilcategory = new self(); $ID = $tt->fields['id']; if (!$tt->getFromDB($ID) || !$tt->can($ID, "r")) { return false; } $ttm = new self(); $rand = mt_rand(); echo "
    "; $query = "SELECT `glpi_itilcategories`.* FROM `glpi_itilcategories` WHERE (`tickettemplates_id_incident` = '$ID') OR (`tickettemplates_id_demand` = '$ID') ORDER BY `name`"; if ($result=$DB->query($query)) { echo ""; echo ""; $used_incident = array(); $used_demand = array(); if ($DB->numrows($result)) { echo ""; echo ""; echo ""; echo ""; while ($data = $DB->fetch_assoc($result)) { echo ""; $itilcategory->getFromDB($data['id']); echo ""; if ($data['tickettemplates_id_incident'] == $ID) { echo ""; $used_incident[] = $data["id"]; } else { echo ""; } if ($data['tickettemplates_id_demand'] == $ID) { echo ""; $used_demand[] = $data["id"]; } else { echo ""; } } } else { echo ""; } echo "
    "; echo ""; echo self::getTypeName($DB->numrows($result)); echo ""; echo "
    ".__('Name')."".__('Incident')."".__('Request')."
    ".$itilcategory->getLink(array('comments' => true))."    
    ".__('No item found')."
    "; } } } ?> glpi-0.84.3+dfsg.1/inc/knowbase.class.php000066400000000000000000000115041226600447100200210ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // class Knowbase /** * class Knowbase * * @since version 0.84 * **/ class Knowbase extends CommonGLPI { static function getTypeName($nb=0) { // No plural return __('Knowledge base'); } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab(__CLASS__, $ong, $options); $ong['no_all_tab'] = true; return $ong; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if ($item->getType() == __CLASS__) { $tabs[1] = _x('button', 'Search'); $tabs[2] = _x('button', 'Browse'); if (KnowbaseItem::canCreate()) { $tabs[3] = _x('button', 'Manage'); } return $tabs; } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType() == __CLASS__) { switch ($tabnum) { case 1 : // all $item->showSearchView(); break; case 2 : $item->showBrowseView(); break; case 3 : $item->showManageView(); break; } } return true; } /** * Show the knowbase search view **/ static function showSearchView() { // Search a solution if (!isset($_POST["contains"]) && isset($_POST["itemtype"]) && isset($_POST["items_id"])) { if ($item = getItemForItemtype($_POST["itemtype"])) { if ($item->getFromDB($_POST["items_id"])) { $_POST["contains"] = addslashes($item->getField('name')); } } } if (isset($_POST["contains"])) { $_SESSION['kbcontains'] = $_POST["contains"]; } else if (isset($_SESSION['kbcontains'])) { $_POST['contains'] = $_SESSION["kbcontains"]; } $ki = new KnowbaseItem(); $ki->searchForm($_POST); if (!isset($_POST['contains']) || empty($_POST['contains'])) { echo "
    "; echo "
    "; KnowbaseItem::showRecentPopular("recent"); echo ""; KnowbaseItem::showRecentPopular("lastupdate"); echo ""; KnowbaseItem::showRecentPopular("popular"); echo "
    "; } else { KnowbaseItem::showList($_POST, 'search'); } } /** * Show the knowbase browse view **/ static function showBrowseView() { if (isset($_POST["knowbaseitemcategories_id"])) { $_SESSION['kbknowbaseitemcategories_id'] = $_POST["knowbaseitemcategories_id"]; } else if (isset($_SESSION['kbknowbaseitemcategories_id'])) { $_POST["knowbaseitemcategories_id"] = $_SESSION['kbknowbaseitemcategories_id']; } $ki = new KnowbaseItem(); $ki->showBrowseForm($_POST); if (!isset($_POST["itemtype"]) || !isset($_POST["items_id"])) { KnowbaseItemCategory::showFirstLevel($_POST); } KnowbaseItem::showList($_POST, 'browse'); } /** * Show the knowbase Manage view **/ static function showManageView() { if (isset($_POST["unpublished"])) { $_SESSION['kbunpublished'] = $_POST["unpublished"]; } else if (isset($_SESSION['kbunpublished'])) { $_POST["unpublished"] = $_SESSION['kbunpublished']; } if (!isset($_POST["unpublished"])) { $_POST["unpublished"] = 'myunpublished'; } $ki = new KnowbaseItem(); $ki->showManageForm($_POST); KnowbaseItem::showList($_POST, $_POST["unpublished"]); } } ?>glpi-0.84.3+dfsg.1/inc/knowbaseitem.class.php000066400000000000000000001626061226600447100207120ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // CLASSE knowledgebase class KnowbaseItem extends CommonDBTM { // For visibility checks protected $users = array(); protected $groups = array(); protected $profiles = array(); protected $entities = array(); static function getTypeName($nb=0) { return __('Knowledge base'); } static function canCreate() { return (Session::haveRight('knowbase', 'w') || Session::haveRight('faq', 'w')); } static function canView() { global $CFG_GLPI; return (Session::haveRight('knowbase', 'r') || Session::haveRight('faq', 'r') || ((Session::getLoginUserID() === false) && $CFG_GLPI["use_public_faq"])); } function canViewItem() { global $CFG_GLPI; if ($this->fields['users_id'] == Session::getLoginUserID()) { return true; } if (Session::haveRight('knowbase_admin', '1')) { return true; } if ($this->fields["is_faq"]) { return (((Session::haveRight('knowbase', 'r') || Session::haveRight('faq', 'r')) && $this->haveVisibilityAccess()) || ((Session::getLoginUserID() === false) && $this->isPubliclyVisible())); } return (Session::haveRight("knowbase", "r") && $this->haveVisibilityAccess()); } function canUpdateItem() { // Personal knowbase or visibility and write access return (Session::haveRight('knowbase_admin', '1') || ($this->fields['users_id'] == Session::getLoginUserID()) || ((($this->fields["is_faq"] && Session::haveRight("faq", "w")) || (!$this->fields["is_faq"] && Session::haveRight("knowbase", "w"))) && $this->haveVisibilityAccess())); } /** * Get the search page URL for the current classe * * @since version 0.84 * * @param $full path or relative one (true by default) **/ static function getSearchURL($full=true) { global $CFG_GLPI; $dir = ($full ? $CFG_GLPI['root_doc'] : ''); if (isset($_SESSION['glpiactiveprofile']) && ($_SESSION['glpiactiveprofile']['interface'] == "central")) { return "$dir/front/knowbaseitem.php"; } return "$dir/front/helpdesk.faq.php"; } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab(__CLASS__, $ong, $options); $this->addStandardTab('Document_Item', $ong, $options); return $ong; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { switch ($item->getType()) { case __CLASS__ : $ong[1] = $this->getTypeName(1); if ($item->canUpdate()) { if ($_SESSION['glpishow_count_on_tabs']) { $ong[2] = self::createTabEntry(__('Targets'), $item->countVisibilities()); } else { $ong[2] = __('Targets'); } } return $ong; } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType() == __CLASS__) { switch($tabnum) { case 1 : $item->showMenu(); break; case 2 : $item->showVisibility(); break; } } return true; } /** * Actions done at the end of the getEmpty function * *@return nothing **/ function post_getEmpty() { if (Session::haveRight("faq", "w") && !Session::haveRight("knowbase", "w")) { $this->fields["is_faq"] = 1; } } /** * @since version 0.83 **/ function post_getFromDB() { // Users $this->users = KnowbaseItem_User::getUsers($this->fields['id']); // Entities $this->entities = Entity_KnowbaseItem::getEntities($this->fields['id']); // Group / entities $this->groups = Group_KnowbaseItem::getGroups($this->fields['id']); // Profile / entities $this->profiles = KnowbaseItem_Profile::getProfiles($this->fields['id']); } /** * @see CommonDBTM::cleanDBonPurge() * * @since version 0.83.1 **/ function cleanDBonPurge() { $class = new KnowbaseItem_User(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); $class = new Entity_KnowbaseItem(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); $class = new Group_KnowbaseItem(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); $class = new KnowbaseItem_Profile(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); } /** * @since version 0.84 * * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "deletevisibility": foreach ($input['item'] as $type => $items) { if (in_array($type, array('Entity_KnowbaseItem', 'Group_KnowbaseItem', 'KnowbaseItem_Profile', 'KnowbaseItem_User'))) { $item = new $type(); foreach ($items as $key => $val) { if ($item->can($key,'w')) { if ($item->delete(array('id' => $key))) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } } } break; default : return parent::doSpecificMassiveActions($input); } return $res; } /** * @since version 0.83 **/ function countVisibilities() { return (count($this->entities) + count($this->users) + count($this->groups) + count($this->profiles)); } /** * Check is this item if visible to everybody (anonymous users) * * @since version 0.83 * * @return Boolean **/ function isPubliclyVisible() { global $CFG_GLPI; if (!$CFG_GLPI['use_public_faq']) { return false; } if (isset($this->entities[0])) { // Browse root entity rights foreach ($this->entities[0] as $entity) { if ($entity['is_recursive']) { return true; } } } return false; } /** * Is the login user have access to KnowbaseItem based on visibility configuration * * @since version 0.83 * * @return boolean **/ function haveVisibilityAccess() { // No public knowbaseitem right : no visibility check if (!Session::haveRight('faq', 'r') && !Session::haveRight('knowbase', 'r') ) { return false; } // Author if ($this->fields['users_id'] == Session::getLoginUserID()) { return true; } // Admin if (Session::haveRight('knowbase_admin', '1')) { return true; } // Users if (isset($this->users[Session::getLoginUserID()])) { return true; } // Groups if (count($this->groups) && isset($_SESSION["glpigroups"]) && count($_SESSION["glpigroups"])) { foreach ($this->groups as $key => $data) { foreach ($data as $group) { if (in_array($group['groups_id'], $_SESSION["glpigroups"])) { // All the group if ($group['entities_id'] < 0) { return true; } // Restrict to entities $entities = array($group['entities_id']); if ($group['is_recursive']) { $entities = getSonsOf('glpi_entities', $group['entities_id']); } if (Session::haveAccessToOneOfEntities($entities, true)) { return true; } } } } } // Entities if (count($this->entities) && isset($_SESSION["glpiactiveentities"]) && count($_SESSION["glpiactiveentities"])) { foreach ($this->entities as $key => $data) { foreach ($data as $entity) { $entities = array($entity['entities_id']); if ($entity['is_recursive']) { $entities = getSonsOf('glpi_entities', $entity['entities_id']); } if (Session::haveAccessToOneOfEntities($entities, true)) { return true; } } } } // Profiles if (count($this->profiles) && isset($_SESSION["glpiactiveprofile"]) && isset($_SESSION["glpiactiveprofile"]['id'])) { if (isset($this->profiles[$_SESSION["glpiactiveprofile"]['id']])) { foreach ($this->profiles[$_SESSION["glpiactiveprofile"]['id']] as $profile) { // All the profile if ($profile['entities_id'] < 0) { return true; } // Restrict to entities $entities = array($profile['entities_id']); if ($profile['is_recursive']) { $entities = getSonsOf('glpi_entities', $profile['entities_id']); } if (Session::haveAccessToOneOfEntities($entities, true)) { return true; } } } } return false; } /** * Return visibility joins to add to SQL * * @since version 0.83 * * @param $forceall force all joins (false by default) * * @return string joins to add **/ static function addVisibilityJoins($forceall=false) { $join = ''; // Users $join .= " LEFT JOIN `glpi_knowbaseitems_users` ON (`glpi_knowbaseitems_users`.`knowbaseitems_id` = `glpi_knowbaseitems`.`id`) "; // Groups if ($forceall || (isset($_SESSION["glpigroups"]) && count($_SESSION["glpigroups"]))) { $join .= " LEFT JOIN `glpi_groups_knowbaseitems` ON (`glpi_groups_knowbaseitems`.`knowbaseitems_id` = `glpi_knowbaseitems`.`id`) "; } // Profiles if ($forceall || (isset($_SESSION["glpiactiveprofile"]) && isset($_SESSION["glpiactiveprofile"]['id']))) { $join .= " LEFT JOIN `glpi_knowbaseitems_profiles` ON (`glpi_knowbaseitems_profiles`.`knowbaseitems_id` = `glpi_knowbaseitems`.`id`) "; } // Entities if ($forceall || !Session::getLoginUserID() || (isset($_SESSION["glpiactiveentities"]) && count($_SESSION["glpiactiveentities"]))) { $join .= " LEFT JOIN `glpi_entities_knowbaseitems` ON (`glpi_entities_knowbaseitems`.`knowbaseitems_id` = `glpi_knowbaseitems`.`id`) "; } return $join; } /** * Return visibility SQL restriction to add * * @since version 0.83 * * @return string restrict to add **/ static function addVisibilityRestrict() { $restrict = ''; if (Session::getLoginUserID()) { $restrict = "(`glpi_knowbaseitems_users`.`users_id` = '".Session::getLoginUserID()."' "; // Users $restrict .= " OR `glpi_knowbaseitems_users`.`users_id` = '".Session::getLoginUserID()."' "; // Groups if (isset($_SESSION["glpigroups"]) && count($_SESSION["glpigroups"])) { $restrict .= " OR (`glpi_groups_knowbaseitems`.`groups_id` IN ('".implode("','",$_SESSION["glpigroups"])."') AND (`glpi_groups_knowbaseitems`.`entities_id` < 0 ".getEntitiesRestrictRequest("OR", "glpi_groups_knowbaseitems", '', '', true).")) "; } // Profiles if (isset($_SESSION["glpiactiveprofile"]) && isset($_SESSION["glpiactiveprofile"]['id'])) { $restrict .= " OR (`glpi_knowbaseitems_profiles`.`profiles_id` = '".$_SESSION["glpiactiveprofile"]['id']."' AND (`glpi_knowbaseitems_profiles`.`entities_id` < 0 ".getEntitiesRestrictRequest("OR", "glpi_knowbaseitems_profiles", '', '', true).")) "; } // Entities if (isset($_SESSION["glpiactiveentities"]) && count($_SESSION["glpiactiveentities"])) { // Force complete SQL not summary when access to all entities $restrict .= getEntitiesRestrictRequest("OR", "glpi_entities_knowbaseitems", '', '', true, true); } $restrict .= ") "; } else { $restrict = '1'; } return $restrict; } /** * @see CommonDBTM::prepareInputForAdd() **/ function prepareInputForAdd($input) { // set new date if not exists if (!isset($input["date"]) || empty($input["date"])) { $input["date"] = $_SESSION["glpi_currenttime"]; } // set users_id // set title for question if empty if (isset($input["name"]) && empty($input["name"])) { $input["name"] = __('New item'); } if (Session::haveRight("faq", "w") && !Session::haveRight("knowbase", "w")) { $input["is_faq"] = 1; } if (!Session::haveRight("faq", "w") && Session::haveRight("knowbase", "w")) { $input["is_faq"] = 0; } return $input; } /** * @see CommonDBTM::prepareInputForUpdate() **/ function prepareInputForUpdate($input) { // set title for question if empty if (isset($input["name"]) && empty($input["name"])) { $input["name"] = __('New item'); } return $input; } /** * Print out an HTML "" for knowbase item * * @param $ID * @param $options array * - target for the Form * * @return nothing (display the form) **/ function showForm($ID, $options=array()) { // show kb item form if (!Session::haveRight("knowbase","w" ) && !Session::haveRight("faq","w")) { return false; } $this->initForm($ID, $options); $canedit = $this->can($ID,'w'); $canrecu = $this->can($ID,'recursive'); if ($canedit) { // Load ticket solution if (empty($ID) && isset($options['item_itemtype']) && !empty($options['item_itemtype']) && isset($options['item_items_id']) && !empty($options['item_items_id'])) { if ($item = getItemForItemtype($options['item_itemtype'])) { if ($item->getFromDB($options['item_items_id'])) { $this->fields['name'] = $item->getField('name'); $this->fields['answer'] = $item->getField('solution'); if ($item->isField('itilcategories_id')) { $ic = new ItilCategory(); if ($ic->getFromDB($item->getField('itilcategories_id'))) { $this->fields['knowbaseitemcategories_id'] = $ic->getField('knowbaseitemcategories_id'); } } } } } echo "
    "; Html::initEditorSystem('answer'); echo "getFormUrl()."\">"; if (!empty($ID)) { echo "\n"; } echo "
    "; echo "".__('Category name').""; echo "
    ".__('Select a category for this item')." "; KnowbaseItemCategory::dropdown(array('value' => $this->fields["knowbaseitemcategories_id"])); echo "
    "; echo "
    "; echo "".__('Subject').""; echo "
    "; echo ""; echo "
    "; echo "
    "; echo "".__('Content').""; echo "
    "; echo "
    "; $showuserlink = 0; if (Session::haveRight('user','r')) { $showuserlink = 1; } if (!empty($ID)) { echo "
    "; echo ""; echo "
    "; if ($this->fields["users_id"]) { //TRANS: %s is the writer name printf(__('%1$s: %2$s'), __('Writer'), getUserName($this->fields["users_id"], $showuserlink)); } echo ""; if ($this->fields["date_mod"]) { //TRANS: %s is the datetime of update printf(__('Last update on %s'), Html::convDateTime($this->fields["date_mod"])); } echo "
    "; if ($this->fields["date"]) { //TRANS: %s is the datetime of insertion printf(__('Created on %s'), Html::convDateTime($this->fields["date"])); } echo ""; //TRANS: %d is the number of view printf(_n('%d view', '%d views', $this->fields["view"]),$this->fields["view"]); echo "
    "; echo "
    "; } echo "

    "; // if (Session::isMultiEntitiesMode()) { // _e('Entity'); // Entity::dropdown(array('value' => $this->fields["entities_id"], // 'comments' => 0 )); // _e('Child entities: '); // if ($canrecu) { // Dropdown::showYesNo("is_recursive", $this->fields["is_recursive"]); // } else { // echo Dropdown::getYesNo($this->fields["is_recursive"]); // } // } // echo "

    " . echo __('Put this item in the FAQ')." "; if (Session::haveRight("faq","w") && Session::haveRight("knowbase","w")) { Dropdown::showYesNo('is_faq', $this->fields["is_faq"]); } else { echo Dropdown::getYesNo($this->fields["is_faq"]); } echo "

    "; if ($ID > 0) { echo ""; } else { echo ""; echo ""; } echo ""; echo ""; echo "

    "; Html::closeForm(); echo "
    "; return true; } // ELSE Cannot edit return false; } // function showForm /** * Add kb item to the public FAQ * * @return nothing **/ function addToFaq() { global $DB; $DB->query("UPDATE `".$this->getTable()."` SET `is_faq` = '1' WHERE `id` = '".$this->fields['id']."'"); if (isset($_SESSION['glpi_faqcategories'])) { unset($_SESSION['glpi_faqcategories']); } } /** * Print out an HTML Menu for knowbase item * * @return nothing (display the form) **/ function showMenu() { global $CFG_GLPI; $ID = $this->fields['id']; if (!$this->can($ID,'r') || (Session::getLoginUserID() === false)) { return false; } $edit = $this->can($ID, 'w'); $isFAQ = $this->fields["is_faq"]; $editFAQ = Session::haveRight("faq", "w"); echo "\n"; if ($edit) { echo ""; if ($editFAQ) { echo "\n"; } echo "\n"; echo ""; echo ""; } echo "
    "; if ($isFAQ) { _e('This item is part of the FAQ'); } else { _e('This item is not part of the FAQ'); } echo "
    "; if ($isFAQ) { Html::showSimpleForm(static::getFormURL(), 'update', __('Delete this item from the FAQ'), array('id' => $ID, 'is_faq' => 0), $CFG_GLPI["root_doc"]."/pics/faqremove.png"); } else { Html::showSimpleForm(static::getFormURL(), 'update', __('Put this item in the FAQ'), array('id' => $ID, 'is_faq' => 1), $CFG_GLPI["root_doc"]."/pics/faqadd.png"); } echo ""; echo "\"".__s('Edit')."; Html::showSimpleForm(static::getFormURL(), 'delete', _x('button', 'Delete permanently'), array('id' => $ID), $CFG_GLPI["root_doc"]."/pics/faqdelete.png", '', __("Are you sure you want to delete this item?")); echo "

    "; } /** * Increase the view counter of the current knowbaseitem * * @since version 0.83 */ function updateCounter() { global $DB; //update counter view $query = "UPDATE `glpi_knowbaseitems` SET `view` = `view`+1 WHERE `id` = '".$this->getID()."'"; $DB->query($query); } /** * Print out (html) show item : question and answer * * @param $linkusers_id display users_id link (true by default) * @param $options array of options * * @return nothing (display item : question and answer) **/ function showFull($linkusers_id=true, $options=array()) { global $DB, $CFG_GLPI; if (!$this->can($this->fields['id'],'r')) { return false; } // show item : question and answer if (!Session::haveRight("user", "r")) { $linkusers_id = false; } $inpopup = strpos($_SERVER['PHP_SELF'],"popup.php"); $this->updateCounter(); $knowbaseitemcategories_id = $this->fields["knowbaseitemcategories_id"]; $fullcategoryname = getTreeValueCompleteName("glpi_knowbaseitemcategories", $knowbaseitemcategories_id); if (!$inpopup) { $this->showTabs($options); } $options['colspan'] = 2; $options['canedit'] = 0; // Hide the buttons $this->showFormHeader($options); $tmp = "".$fullcategoryname.""; echo "".sprintf(__('%1$s: %2$s'), __('Category'), $tmp); echo ""; echo "

    ".__('Subject')."

    "; echo $this->fields["name"]; echo ""; echo "

    ".__('Content')."

    \n"; echo "
    "; echo Toolbox::unclean_html_cross_side_scripting_deep($this->fields["answer"]); echo "
    "; echo ""; echo ""; if ($this->fields["users_id"]) { // Integer because true may be 2 and getUserName return array if ($linkusers_id) { $linkusers_id = 1; } else { $linkusers_id = 0; } printf(__('%1$s: %2$s'), __('Writer'), getUserName($this->fields["users_id"], $linkusers_id)); echo "
    "; } if ($this->fields["date"]) { //TRANS: %s is the datetime of update printf(__('Created on %s'), Html::convDateTime($this->fields["date"])); } if ($this->countVisibilities() == 0) { echo "
    ".__('Unpublished').""; } echo ""; echo ""; if ($this->fields["date_mod"]) { //TRANS: %s is the datetime of update printf(__('Last update on %s'), Html::convDateTime($this->fields["date_mod"])); echo "
    "; } echo sprintf(_n('%d view', '%d views', $this->fields["view"]), $this->fields["view"]). ""; $this->showFormButtons($options); if (!$inpopup) { $this->addDivForTabs(); } return true; } /** * Print out an HTML form for Search knowbase item * * @param $options $_GET * * @return nothing (display the form) **/ function searchForm($options) { global $CFG_GLPI; if (!$CFG_GLPI["use_public_faq"] && !Session::haveRight("knowbase","r") && !Session::haveRight("faq","r")) { return false; } // Default values of parameters $params["contains"] = ""; $params["target"] = $_SERVER['PHP_SELF']; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $params[$key] = $val; } } echo "
    "; echo ""; echo ""; echo ""; echo ""; echo "
    "; echo ""; echo "
    "; if (isset($options['item_itemtype']) && isset($options['item_items_id'])) { echo ""; echo ""; } Html::closeForm(); echo "
    "; } /** * Print out an HTML "" for Search knowbase item * * @since version 0.84 * * @param $options $_GET * * @return nothing (display the form) **/ function showBrowseForm($options) { global $CFG_GLPI; if (!$CFG_GLPI["use_public_faq"] && !Session::haveRight("knowbase","r") && !Session::haveRight("faq","r")) { return false; } // Default values of parameters $params["knowbaseitemcategories_id"] = ""; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $params[$key] = $val; } } $faq = !Session::haveRight("knowbase","r"); // Category select not for anonymous FAQ if (Session::getLoginUserID() && !$faq) { echo "
    "; echo ""; echo ""; echo ""; echo "
    ".__('Category')." "; KnowbaseItemCategory::dropdown(array('value' => $params["knowbaseitemcategories_id"])); echo ""; echo "
    "; if (isset($options['item_itemtype']) && isset($options['item_items_id'])) { echo ""; echo ""; } Html::closeForm(); echo "
    "; } } /** * Print out an HTML form for Search knowbase item * * @since version 0.84 * * @param $options $_GET * * @return nothing (display the form) **/ function showManageForm($options) { global $CFG_GLPI; if (!Session::haveRight("knowbase","w") && !Session::haveRight("faq","w")) { return false; } $params['unpublished'] = 'my'; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $params[$key] = $val; } } $faq = !Session::haveRight("knowbase","w"); echo "
    "; echo ""; echo ""; echo ""; echo "
    "; $values = array('myunpublished' => __('My unpublished articles'), 'allmy' => __('All my articles')); if (Session::haveRight('knowbase_admin', '1')) { $values['allunpublished'] = __('All unpublished articles'); } Dropdown::showFromArray('unpublished', $values, array('value' => $params['unpublished'])); echo ""; echo "
    "; Html::closeForm(); echo "
    "; } /** * Build request for showList * * @since version 0.83 * * @param $params array (contains, knowbaseitemcategories_id, faq) * @param $type string search type : browse / search (default search) * * @return String : SQL request **/ static function getListRequest(array $params, $type='search') { global $DB; // Lists kb Items $where = ""; $order = ""; $score = ""; $join = self::addVisibilityJoins(true); switch ($type) { case 'myunpublished' : break; case 'allmy' : break; case 'allunpublished' : break; default : // Build query if (Session::getLoginUserID() && $type != 'myunpublished') { $where = self::addVisibilityRestrict()." AND "; } else { // Anonymous access if (Session::isMultiEntitiesMode()) { $where = " (`glpi_entities_knowbaseitems`.`entities_id` = '0' AND `glpi_entities_knowbaseitems`.`is_recursive` = '1') AND "; } } break; } if ($params['faq']) { // helpdesk $where .= " (`glpi_knowbaseitems`.`is_faq` = '1') AND "; } // a search with $contains switch ($type) { case 'allmy' : $where .= "`glpi_knowbaseitems`.`users_id` = '".Session::getLoginUserID()."'"; break; case 'myunpublished' : $where .= "`glpi_knowbaseitems`.`users_id` = '".Session::getLoginUserID()."' AND (`glpi_entities_knowbaseitems`.`entities_id` IS NULL AND `glpi_knowbaseitems_profiles`.`profiles_id` IS NULL AND `glpi_groups_knowbaseitems`.`groups_id` IS NULL AND `glpi_knowbaseitems_users`.`users_id` IS NULL)"; break; case 'allunpublished' : // Only published $where .= "(`glpi_entities_knowbaseitems`.`entities_id` IS NULL AND `glpi_knowbaseitems_profiles`.`profiles_id` IS NULL AND `glpi_groups_knowbaseitems`.`groups_id` IS NULL AND `glpi_knowbaseitems_users`.`users_id` IS NULL)"; break; case 'search' : if (strlen($params["contains"]) > 0) { $search = Toolbox::unclean_cross_side_scripting_deep($params["contains"]); $score = " ,MATCH(`glpi_knowbaseitems`.`name`, `glpi_knowbaseitems`.`answer`) AGAINST('$search' IN BOOLEAN MODE) AS SCORE "; $where_1 = $where." MATCH(`glpi_knowbaseitems`.`name`, `glpi_knowbaseitems`.`answer`) AGAINST('$search' IN BOOLEAN MODE) "; $order = "ORDER BY `SCORE` DESC"; // preliminar query to allow alternate search if no result with fulltext $query_1 = "SELECT COUNT(`glpi_knowbaseitems`.`id`) FROM `glpi_knowbaseitems` $join WHERE $where_1"; $result_1 = $DB->query($query_1); $numrows_1 = $DB->result($result_1,0,0); if ($numrows_1 <= 0) {// not result this fulltext try with alternate search $search1 = array(/* 1 */ '/\\\"/', /* 2 */ "/\+/", /* 3 */ "/\*/", /* 4 */ "/~/", /* 5 */ "//", /* 7 */ "/\(/", /* 8 */ "/\)/", /* 9 */ "/\-/"); $contains = preg_replace($search1,"", $params["contains"]); $where .= " (`glpi_knowbaseitems`.`name` ".Search::makeTextSearch($contains)." OR `glpi_knowbaseitems`.`answer` ".Search::makeTextSearch($contains).")"; } else { $where = $where_1; } } break; case 'browse' : $where .= " (`glpi_knowbaseitems`.`knowbaseitemcategories_id` = '".$params["knowbaseitemcategories_id"]."')"; $order = " ORDER BY `glpi_knowbaseitems`.`name` ASC"; break; } $query = "SELECT DISTINCT `glpi_knowbaseitems`.*, `glpi_knowbaseitemcategories`.`completename` AS category $score FROM `glpi_knowbaseitems` $join LEFT JOIN `glpi_knowbaseitemcategories` ON (`glpi_knowbaseitemcategories`.`id` = `glpi_knowbaseitems`.`knowbaseitemcategories_id`) WHERE $where $order"; return $query; } /** * Print out list kb item * * @param $options $_GET * @param $type string search type : browse / search (default search) **/ static function showList($options, $type='search') { global $DB, $CFG_GLPI; // Default values of parameters $params['faq'] = !Session::haveRight("knowbase","r"); $params["start"] = "0"; $params["knowbaseitemcategories_id"] = "0"; $params["contains"] = ""; $params["target"] = $_SERVER['PHP_SELF']; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $params[$key] = $val; } } $ki = new self(); switch ($type) { case 'myunpublished' : if (!Session::haveRight('knowbase','w') && !Session::haveRight('faq','w')) { return false; } break; case 'allunpublished' : if (!Session::haveRight('knowbase_admin',1)) { return false; } break; default : break; } if (!$params["start"]) { $params["start"] = 0; } $query = self::getListRequest($params, $type); // Get it from database if ($result = $DB->query($query)) { $KbCategory = new KnowbaseItemCategory(); $title = ""; if ($KbCategory->getFromDB($params["knowbaseitemcategories_id"])) { $title = (empty($KbCategory->fields['name']) ?"(".$params['knowbaseitemcategories_id'].")" : $KbCategory->fields['name']); $title = sprintf(__('%1$s: %2$s'), __('Category'), $title); } Session::initNavigateListItems('KnowbaseItem', $title); $numrows = $DB->numrows($result); $list_limit = $_SESSION['glpilist_limit']; $showwriter = in_array($type, array('myunpublished', 'allunpublished', 'allmy')); // Limit the result, if no limit applies, use prior result if (($numrows > $list_limit) && !isset($_GET['export_all'])) { $query_limit = $query ." LIMIT ".intval($params["start"]).", ".intval($list_limit)." "; $result_limit = $DB->query($query_limit); $numrows_limit = $DB->numrows($result_limit); } else { $numrows_limit = $numrows; $result_limit = $result; } if ($numrows_limit > 0) { // Set display type for export if define $output_type = Search::HTML_OUTPUT; if (isset($_GET["display_type"])) { $output_type = $_GET["display_type"]; } // Pager $parameters = "start=".$params["start"]."&knowbaseitemcategories_id=". $params['knowbaseitemcategories_id']."&contains=". $params["contains"]."&is_faq=".$params['faq']; if (isset($options['item_itemtype']) && isset($options['item_items_id'])) { $parameters .= "&item_items_id=".$options['item_items_id']."&item_itemtype=". $options['item_itemtype']; } if ($output_type == Search::HTML_OUTPUT) { Html::printPager($params['start'], $numrows, Toolbox::getItemTypeSearchURL('KnowbaseItem'), $parameters, 'KnowbaseItem'); } $nbcols = 1; // Display List Header echo Search::showHeader($output_type, $numrows_limit+1, $nbcols); $header_num = 1; echo Search::showHeaderItem($output_type, __('Subject'), $header_num); if ($output_type != Search::HTML_OUTPUT) { echo Search::showHeaderItem($output_type, __('Content'), $header_num); } if ($showwriter) { echo Search::showHeaderItem($output_type, __('Writer'), $header_num); } echo Search::showHeaderItem($output_type, __('Category'), $header_num); if (isset($options['item_itemtype']) && isset($options['item_items_id']) && ($output_type == Search::HTML_OUTPUT)) { echo Search::showHeaderItem($output_type, ' ', $header_num); } // Num of the row (1=header_line) $row_num = 1; for ($i=0 ; $i<$numrows_limit ; $i++) { $data = $DB->fetch_assoc($result_limit); Session::addToNavigateListItems('KnowbaseItem', $data["id"]); // Column num $item_num = 1; $row_num++; echo Search::showNewLine($output_type, $i%2); if ($output_type == Search::HTML_OUTPUT) { if (isset($options['item_itemtype']) && isset($options['item_items_id'])) { $href = " href='#' onClick=\"var w = window.open('".$CFG_GLPI["root_doc"]. "/front/popup.php?popup=show_kb&id=".$data['id']."' ,'glpipopup', ". "'height=400, width=1000, top=100, left=100, scrollbars=yes' );". "w.focus();\"" ; } else { $href = " href=\"".$CFG_GLPI['root_doc']."/front/knowbaseitem.form.php?id=". $data["id"]."\" "; } echo Search::showItem($output_type, "
    ". Html::resume_text(Html::clean(Toolbox::unclean_cross_side_scripting_deep($data["answer"])), 600)."
    ", $item_num, $row_num); } else { echo Search::showItem($output_type, $data["name"], $item_num, $row_num); echo Search::showItem($output_type, Html::clean(Toolbox::unclean_cross_side_scripting_deep(html_entity_decode($data["answer"], ENT_QUOTES, "UTF-8"))), $item_num, $row_num); } $showuserlink = 0; if (Session::haveRight('user','r')) { $showuserlink = 1; } if ($showwriter) { echo Search::showItem($output_type, getUserName($data["users_id"], $showuserlink), $item_num, $row_num); } $categ = $data["category"]; if ($output_type == Search::HTML_OUTPUT) { $cathref = $ki->getSearchURL()."?knowbaseitemcategories_id=". $data["knowbaseitemcategories_id"].'&forcetab=Knowbase$2'; $categ = "".$categ.''; } echo Search::showItem($output_type, $categ, $item_num, $row_num); if (isset($options['item_itemtype']) && isset($options['item_items_id']) && ($output_type == Search::HTML_OUTPUT)) { $content = "". __('Use as a solution').""; echo Search::showItem($output_type, $content, $item_num, $row_num); } // End Line echo Search::showEndLine($output_type); } // Display footer if (($output_type == Search::PDF_OUTPUT_LANDSCAPE) || ($output_type == Search::PDF_OUTPUT_PORTRAIT)) { echo Search::showFooter($output_type, Dropdown::getDropdownName("glpi_knowbaseitemcategories", $params['knowbaseitemcategories_id'])); } else { echo Search::showFooter($output_type); } echo "
    "; if ($output_type == Search::HTML_OUTPUT) { Html::printPager($params['start'], $numrows, Toolbox::getItemTypeSearchURL('KnowbaseItem'), $parameters, 'KnowbaseItem'); } } else { echo "
    ".__('No item found')."
    "; } } } /** * Print out list recent or popular kb/faq * * @param $type type : recent / popular / not published * * @return nothing (display table) **/ static function showRecentPopular($type) { global $DB, $CFG_GLPI; $faq = !Session::haveRight("knowbase","r"); if ($type == "recent") { $orderby = "ORDER BY `date` DESC"; $title = __('Recent entries'); } else if ($type == 'lastupdate') { $orderby = "ORDER BY `date_mod` DESC"; $title = __('Last updated entries'); } else { $orderby = "ORDER BY `view` DESC"; $title = __('Most popular questions'); } $faq_limit = ""; // Force all joins for not published to verify no visibility set $join = self::addVisibilityJoins(true); if (Session::getLoginUserID()) { $faq_limit .= "WHERE ".self::addVisibilityRestrict(); } else { // Anonymous access if (Session::isMultiEntitiesMode()) { $faq_limit .= " WHERE (`glpi_entities_knowbaseitems`.`entities_id` = '0' AND `glpi_entities_knowbaseitems`.`is_recursive` = '1')"; } else { $faq_limit .= " WHERE 1"; } } // Only published $faq_limit .= " AND (`glpi_entities_knowbaseitems`.`entities_id` IS NOT NULL OR `glpi_knowbaseitems_profiles`.`profiles_id` IS NOT NULL OR `glpi_groups_knowbaseitems`.`groups_id` IS NOT NULL OR `glpi_knowbaseitems_users`.`users_id` IS NOT NULL)"; if ($faq) { // FAQ $faq_limit .= " AND (`glpi_knowbaseitems`.`is_faq` = '1')"; } $query = "SELECT DISTINCT `glpi_knowbaseitems`.* FROM `glpi_knowbaseitems` $join $faq_limit $orderby LIMIT 10"; $result = $DB->query($query); $number = $DB->numrows($result); if ($number > 0) { echo ""; echo ""; while ($data = $DB->fetch_assoc($result)) { echo ""; } echo "
    ".$title."
    "; echo "". Html::resume_text($data["name"],80)."
    "; } } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab[4]['table'] = 'glpi_knowbaseitemcategories'; $tab[4]['field'] = 'name'; $tab[4]['name'] = __('Category'); $tab[4]['datatype'] = 'dropdown'; $tab[5]['table'] = $this->getTable(); $tab[5]['field'] = 'date'; $tab[5]['name'] = __('Date'); $tab[5]['datatype'] = 'datetime'; $tab[5]['massiveaction'] = false; $tab[6]['table'] = $this->getTable(); $tab[6]['field'] = 'name'; $tab[6]['name'] = __('Subject'); $tab[6]['datatype'] = 'text'; $tab[7]['table'] = $this->getTable(); $tab[7]['field'] = 'answer'; $tab[7]['name'] = __('Content'); $tab[7]['datatype'] = 'text'; $tab[7]['htmltext'] = true; $tab[8]['table'] = $this->getTable(); $tab[8]['field'] = 'is_faq'; $tab[8]['name'] = __('FAQ item'); $tab[8]['datatype'] = 'bool'; $tab[9]['table'] = $this->getTable(); $tab[9]['field'] = 'view'; $tab[9]['name'] = _n('View', 'Views', 2); $tab[9]['datatype'] = 'integer'; $tab[9]['massiveaction'] = false; $tab[19]['table'] = $this->getTable(); $tab[19]['field'] = 'date_mod'; $tab[19]['name'] = __('Last update'); $tab[19]['datatype'] = 'datetime'; $tab[19]['massiveaction'] = false; $tab[70]['table'] = 'glpi_users'; $tab[70]['field'] = 'name'; $tab[70]['name'] = __('User'); $tab[70]['massiveaction'] = false; $tab[70]['datatype'] = 'dropdown'; $tab[70]['right'] = 'all'; $tab[80]['table'] = 'glpi_entities'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = __('Entity'); $tab[80]['massiveaction'] = false; $tab[80]['datatype'] = 'dropdown'; $tab[86]['table'] = $this->getTable(); $tab[86]['field'] = 'is_recursive'; $tab[86]['name'] = __('Child entities'); $tab[86]['datatype'] = 'bool'; return $tab; } /** * Show visibility config for a knowbaseitem * * @since version 0.83 **/ function showVisibility() { global $DB, $CFG_GLPI; $ID = $this->fields['id']; $canedit = $this->can($ID,'w'); echo "
    "; $rand = mt_rand(); $nb = count($this->users) + count($this->groups) + count($this->profiles) + count($this->entities); if ($canedit) { echo "
    "; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
    ".__('Add a target')."
    "; $types = array('Entity', 'Group', 'Profile', 'User'); $addrand = Dropdown::showItemTypes('_type', $types); $params = array('type' => '__VALUE__', 'right' => ($this->getfield('is_faq') ? 'faq' : 'knowbase')); Ajax::updateItemOnSelectEvent("dropdown__type".$addrand,"visibility$rand", $CFG_GLPI["root_doc"]."/ajax/visibility.php", $params); echo ""; echo "
    "; Html::closeForm(); echo "
    "; } echo "
    "; if ($canedit && $nb) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $paramsma = array('num_displayed' => $nb, 'specific_actions' => array('deletevisibility' => _x('button', 'Delete permanently')) ); if ($this->fields['users_id'] != Session::getLoginUserID()) { $paramsma['confirm'] = __('Caution! You are not the author of this element. Delete targets can result in loss of access to that element.'); } Html::showMassiveActions(__CLASS__, $paramsma); } echo ""; echo ""; if ($canedit && $nb) { echo ""; } echo ""; echo ""; echo ""; // Users if (count($this->users)) { foreach ($this->users as $key => $val) { foreach ($val as $data) { echo ""; if ($canedit) { echo ""; } echo ""; echo ""; echo ""; } } } // Groups if (count($this->groups)) { foreach ($this->groups as $key => $val) { foreach ($val as $data) { echo ""; if ($canedit) { echo ""; } echo ""; echo ""; echo ""; } } } // Entity if (count($this->entities)) { foreach ($this->entities as $key => $val) { foreach ($val as $data) { echo ""; if ($canedit) { echo ""; } echo ""; echo ""; echo ""; } } } // Profiles if (count($this->profiles)) { foreach ($this->profiles as $key => $val) { foreach ($val as $data) { echo ""; if ($canedit) { echo ""; } echo ""; echo ""; echo ""; } } } echo "
    "; echo Html::checkAllAsCheckbox('mass'.__CLASS__.$rand); echo "".__('Type').""._n('Recipient', 'Recipients', 2)."
    "; echo ""; echo "".__('User')."".getUserName($data['users_id'])."
    "; echo ""; echo "".__('Group').""; $names = Dropdown::getDropdownName('glpi_groups', $data['groups_id'],1); $groupname = sprintf(__('%1$s %2$s'), $names["name"], Html::showToolTip($names["comment"], array('display' => false))); if ($data['entities_id'] >= 0) { $groupname = sprintf(__('%1$s / %2$s'), $groupname, Dropdown::getDropdownName('glpi_entities', $data['entities_id'])); if ($data['is_recursive']) { $groupname = sprintf(__('%1$s %2$s'), $groupname, "(".__('R').")"); } } echo $groupname; echo "
    "; echo ""; echo "".__('Entity').""; $names = Dropdown::getDropdownName('glpi_entities', $data['entities_id'],1); $entityname = sprintf(__('%1$s %2$s'), $names["name"], Html::showToolTip($names["comment"], array('display' => false))); if ($data['is_recursive']) { $entityname = sprintf(__('%1$s %2$s'), $entityname, "(".__('R').")"); } echo $entityname; echo "
    "; echo ""; echo ""._n('Profile', 'Profiles', 1).""; $names = Dropdown::getDropdownName('glpi_profiles', $data['profiles_id'], 1); $profilename = sprintf(__('%1$s %2$s'), $names["name"], Html::showToolTip($names["comment"], array('display' => false))); if ($data['entities_id'] >= 0) { $profilename = sprintf(__('%1$s / %2$s'), $profilename, Dropdown::getDropdownName('glpi_entities', $data['entities_id'])); if ($data['is_recursive']) { $profilename = sprintf(__('%1$s %2$s'), $profilename, "(".__('R').")"); } } echo $profilename; echo "
    "; if ($canedit && $nb) { $paramsma['ontop'] =false; Html::showMassiveActions(__CLASS__, $paramsma); Html::closeForm(); } echo "
    "; // Add items return true; } } ?> glpi-0.84.3+dfsg.1/inc/knowbaseitem_profile.class.php000066400000000000000000000043521226600447100224230ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class KnowbaseItem_Profile /// since version 0.83 class KnowbaseItem_Profile extends CommonDBRelation { // From CommonDBRelation static public $itemtype_1 = 'KnowbaseItem'; static public $items_id_1 = 'knowbaseitems_id'; static public $itemtype_2 = 'Profile'; static public $items_id_2 = 'profiles_id'; static public $checkItem_2_Rights = self::DONT_CHECK_ITEM_RIGHTS; static public $logs_for_item_2 = false; /** * Get profiles for a knowbaseitem * * @param $knowbaseitems_id ID of the knowbaseitem * * @return array of profiles linked to a knowbaseitem **/ static function getProfiles($knowbaseitems_id) { global $DB; $prof = array(); $query = "SELECT `glpi_knowbaseitems_profiles`.* FROM `glpi_knowbaseitems_profiles` WHERE `knowbaseitems_id` = '$knowbaseitems_id'"; foreach ($DB->request($query) as $data) { $prof[$data['profiles_id']][] = $data; } return $prof; } } ?>glpi-0.84.3+dfsg.1/inc/knowbaseitem_user.class.php000066400000000000000000000043131226600447100217360ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class KnowbaseItem_User /// since version 0.83 class KnowbaseItem_User extends CommonDBRelation { // From CommonDBRelation static public $itemtype_1 = 'KnowbaseItem'; static public $items_id_1 = 'knowbaseitems_id'; static public $itemtype_2 = 'User'; static public $items_id_2 = 'users_id'; static public $checkItem_2_Rights = self::DONT_CHECK_ITEM_RIGHTS; static public $logs_for_item_2 = false; /** * Get users for a knowbaseitem * * @param $knowbaseitems_id ID of the knowbaseitem * * @return array of users linked to a knowbaseitem **/ static function getUsers($knowbaseitems_id) { global $DB; $users = array(); $query = "SELECT `glpi_knowbaseitems_users`.* FROM `glpi_knowbaseitems_users` WHERE `knowbaseitems_id` = '$knowbaseitems_id'"; foreach ($DB->request($query) as $data) { $users[$data['users_id']][] = $data; } return $users; } } ?>glpi-0.84.3+dfsg.1/inc/knowbaseitemcategory.class.php000066400000000000000000000177211226600447100224450ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class KnowbaseItemCategory class KnowbaseItemCategory extends CommonTreeDropdown { // From CommonDBTM public $dohistory = true; static function canCreate() { return Session::haveRight('entity_dropdown', 'w'); } static function canView() { return Session::haveRight('entity_dropdown', 'r'); } static function getTypeName($nb=0) { return _n('Knowledge base category', 'Knowledge base categories', $nb); } /** * Show KB categories * * @param $options $_GET * * @return nothing (display the form) **/ static function showFirstLevel($options) { global $DB, $CFG_GLPI; $faq = !Session::haveRight("knowbase","r"); // Default values of parameters $params["knowbaseitemcategories_id"] = "0"; $params["target"] = $_SERVER['PHP_SELF']; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $params[$key]=$val; } } $faq_limit = ''; $parameters = ''; // Manage search solution if (isset($options['item_itemtype']) && isset($options['item_items_id'])) { $parameters = "&item_items_id=".$options['item_items_id']."&item_itemtype=". $options['item_itemtype']; } if ($faq) { if (!$CFG_GLPI["use_public_faq"] && !Session::haveRight("faq","r")) { return false; } if (Session::getLoginUserID()) { $faq_limit = getEntitiesRestrictRequest("AND", "glpi_knowbaseitemcategories", "", "", true); } else { // Anonymous access if (Session::isMultiEntitiesMode()) { $faq_limit = " AND (`glpi_knowbaseitemcategories`.`entities_id` = '0' AND `glpi_knowbaseitemcategories`.`is_recursive` = '1')"; } } // Get All FAQ categories if (!isset($_SESSION['glpi_faqcategories'])) { $_SESSION['glpi_faqcategories'] = '(0)'; $tmp = array(); $query = "SELECT DISTINCT `glpi_knowbaseitems`.`knowbaseitemcategories_id` FROM `glpi_knowbaseitems` ".KnowbaseItem::addVisibilityJoins()." LEFT JOIN `glpi_knowbaseitemcategories` ON (`glpi_knowbaseitemcategories`.`id` = `glpi_knowbaseitems`.`knowbaseitemcategories_id`) WHERE `glpi_knowbaseitems`.`is_faq` = '1' AND ".KnowbaseItem::addVisibilityRestrict()." $faq_limit"; if ($result = $DB->query($query)) { if ($DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { if (!in_array($data['knowbaseitemcategories_id'], $tmp)) { $tmp[] = $data['knowbaseitemcategories_id']; $tmp = array_merge($tmp, getAncestorsOf('glpi_knowbaseitemcategories', $data['knowbaseitemcategories_id'])); } } } if (count($tmp)) { $_SESSION['glpi_faqcategories'] = "('".implode("','",$tmp)."')"; } } } $query = "SELECT DISTINCT `glpi_knowbaseitemcategories`.* FROM `glpi_knowbaseitemcategories` WHERE `glpi_knowbaseitemcategories`.`id` IN ".$_SESSION['glpi_faqcategories']." AND (`glpi_knowbaseitemcategories`.`knowbaseitemcategories_id` = '".$params["knowbaseitemcategories_id"]."') $faq_limit ORDER BY `name` ASC"; } else { if (!Session::haveRight("knowbase", "r")) { return false; } $faq_limit = getEntitiesRestrictRequest("AND", "glpi_knowbaseitemcategories", "entities_id", $_SESSION['glpiactiveentities'], true); $query = "SELECT * FROM `glpi_knowbaseitemcategories` WHERE `glpi_knowbaseitemcategories`.`knowbaseitemcategories_id` = '".$params["knowbaseitemcategories_id"]."' $faq_limit ORDER BY `name` ASC"; } // Show category if ($result = $DB->query($query)) { echo ""; echo ""; } $ID = $row["id"]; echo ""; } $i++; } } echo "
    "; echo ""; // Display Category if ($params["knowbaseitemcategories_id"]!=0) { $tmpID = $params["knowbaseitemcategories_id"]; $todisplay = ""; while ($tmpID != 0) { $query2 = "SELECT * FROM `glpi_knowbaseitemcategories` WHERE `glpi_knowbaseitemcategories`.`id` = '$tmpID' $faq_limit"; $result2 = $DB->query($query2); if ($DB->numrows($result2) == 1) { $data = $DB->fetch_assoc($result2); $tmpID = $data["knowbaseitemcategories_id"]; $todisplay = "".$data["name"]."". (empty($todisplay)?"":" > "). $todisplay; } else { $tmpID = 0; } } echo " > ".$todisplay; } if ($DB->numrows($result) > 0) { $i = 0; while ($row=$DB->fetch_assoc($result)) { // on affiche les résultats sur trois colonnes if (($i%3) == 0) { echo "
    "; echo ""; echo "". "". $row["name"].""; echo "
    ".Html::resume_text($row['comment'],60)."
    "; if (($i%3) == 2) { echo "
     

    "; } } } ?>glpi-0.84.3+dfsg.1/inc/link.class.php000066400000000000000000000374311226600447100171540ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // CLASSES link class Link extends CommonDBTM { static function getTypeName($nb=0) { return _n('External link', 'External links',$nb); } static function canCreate() { return Session::haveRight('link', 'w'); } static function canView() { return Session::haveRight('link', 'r'); } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (Session::haveRight("link","r")) { if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(_n('Link','Links',2), countElementsInTable('glpi_links_itemtypes', "`itemtype` = '".$item->getType()."'")); } return _n('Link','Links',2); } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { self::showForItem($item); return true; } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('Link_ItemType', $ong, $options); return $ong; } function cleanDBonPurge() { global $DB; $query2 = "DELETE FROM `glpi_links_itemtypes` WHERE `links_id` = '".$this->fields['id']."'"; $DB->query($query2); } /** * Print the link form * * @param $ID integer ID of the item * @param $options array * - target filename : where to go when done. * * @return Nothing (display) **/ function showForm($ID, $options=array()) { $this->initForm($ID, $options); $this->showTabs($options); $this->showFormHeader($options); echo "".__('Valid tags').""; echo "[LOGIN], [ID], [NAME], [LOCATION], [LOCATIONID], [IP], [MAC], [NETWORK], [DOMAIN], [SERIAL], [OTHERSERIAL], [USER], [GROUP]"; echo "".__('Name').""; echo ""; Html::autocompletionTextField($this, "name", array('size' => 84)); echo ""; echo "".__('Link or filename').""; echo ""; Html::autocompletionTextField($this, "link", array('size' => 84)); echo ""; echo "".__('File content').""; echo ""; echo ""; echo ""; $this->showFormButtons($options); $this->addDivForTabs(); return true; } /** * @see CommonDBTM::getSpecificMassiveActions() **/ function getSpecificMassiveActions($checkitem=NULL) { $isadmin = static::canUpdate(); $actions = parent::getSpecificMassiveActions($checkitem); if (Session::haveRight('transfer','r') && Session::isMultiEntitiesMode() && $isadmin) { $actions['add_transfer_list'] = _x('button', 'Add to transfer list'); } return $actions; } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'link'; $tab[3]['name'] = __('Link or filename'); $tab[3]['datatype'] = 'string'; $tab[80]['table'] = 'glpi_entities'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = __('Entity'); $tab[80]['massiveaction'] = false; $tab[80]['datatype'] = 'dropdown'; return $tab; } /** * Generate link * * @param $link string original string content * @param $item CommonDBTM object: item used to make replacements * * @return array of link contents (may have several when item have several IP / MAC cases) **/ static function generateLinkContents($link, CommonDBTM $item) { global $DB; if (strstr($link,"[ID]")) { $link = str_replace("[ID]", $item->fields['id'],$link); } if (strstr($link,"[LOGIN]") && isset($_SESSION["glpiname"])) { $link = str_replace("[LOGIN]", $_SESSION["glpiname"], $link); } if (strstr($link,"[NAME]")) { $link = str_replace("[NAME]", $item->getName(), $link); } if (strstr($link,"[SERIAL]") && $item->isField('serial')) { $link = str_replace("[SERIAL]", $item->getField('serial'), $link); } if (strstr($link,"[OTHERSERIAL]") && $item->isField('otherserial')) { $link=str_replace("[OTHERSERIAL]",$item->getField('otherserial'),$link); } if (strstr($link,"[LOCATIONID]") && $item->isField('locations_id')) { $link = str_replace("[LOCATIONID]", $item->getField('locations_id'), $link); } if (strstr($link,"[LOCATION]") && $item->isField('locations_id')) { $link = str_replace("[LOCATION]", Dropdown::getDropdownName("glpi_locations", $item->getField('locations_id')), $link); } if (strstr($link,"[NETWORK]") && $item->isField('networks_id')) { $link = str_replace("[NETWORK]", Dropdown::getDropdownName("glpi_networks", $item->getField('networks_id')), $link); } if (strstr($link,"[DOMAIN]") && $item->isField('domains_id')) { $link = str_replace("[DOMAIN]", Dropdown::getDropdownName("glpi_domains", $item->getField('domains_id')), $link); } if (strstr($link,"[USER]") && $item->isField('users_id')) { $link = str_replace("[USER]", Dropdown::getDropdownName("glpi_users", $item->getField('users_id')), $link); } if (strstr($link,"[GROUP]") && $item->isField('groups_id')) { $link = str_replace("[GROUP]", Dropdown::getDropdownName("glpi_groups", $item->getField('groups_id')), $link); } $replace_IP = strstr($link,"[IP]"); $replace_MAC = strstr($link,"[MAC]"); if (!$replace_IP && !$replace_MAC) { return array($link); } // Return several links id several IP / MAC $ipmac = array(); if (get_class($item) == 'NetworkEquipment') { if ($replace_IP) { $query2 = "SELECT `glpi_ipaddresses`.`id`, `glpi_ipaddresses`.`name` AS ip FROM `glpi_networknames`, `glpi_ipaddresses` WHERE `glpi_networknames`.`items_id` = '" . $item->getID() . "' AND `glpi_networknames`.`itemtype` = 'NetworkEquipment' AND `glpi_ipaddresses`.`itemtype` = 'NetworkName' AND `glpi_ipaddresses`.`items_id` = `glpi_networknames`.`id`"; foreach ($DB->request($query2) as $data2) { $ipmac['ip'.$data2['id']]['ip'] = $data2["ip"]; $ipmac['ip'.$data2['id']]['mac'] = $item->getField('mac'); } } if ($replace_MAC) { // If there is no entry, then, we must at least define the mac of the item ... if (count($ipmac) == 0) { $ipmac['mac0']['ip'] = ''; $ipmac['mac0']['mac'] = $item->getField('mac'); } } } if ($replace_IP) { $query2 = "SELECT `glpi_ipaddresses`.`id`, `glpi_networkports`.`mac`, `glpi_ipaddresses`.`name` AS ip FROM `glpi_networkports`, `glpi_networknames`, `glpi_ipaddresses` WHERE `glpi_networkports`.`items_id` = '" . $item->getID() . "' AND `glpi_networkports`.`itemtype` = '" . $item->getType() . "' AND `glpi_networknames`.`itemtype` = 'NetworkPort' AND `glpi_networknames`.`items_id` = `glpi_networkports`.`id` AND `glpi_ipaddresses`.`itemtype` = 'NetworkName' AND `glpi_ipaddresses`.`items_id` = `glpi_networknames`.`id`"; foreach ($DB->request($query2) as $data2) { $ipmac['ip'.$data2['id']]['ip'] = $data2["ip"]; $ipmac['ip'.$data2['id']]['mac'] = $data2["mac"]; } } if ($replace_MAC) { $left = ''; $where = ''; if ($replace_IP) { $left = " LEFT JOIN `glpi_networknames` ON (`glpi_networknames`.`items_id` = `glpi_networkports`.`id` AND `glpi_networknames`.`itemtype` = 'NetworkPort')"; $where = " AND `glpi_networknames`.`id` IS NULL"; } $query2 = "SELECT `glpi_networkports`.`id`, `glpi_networkports`.`mac` FROM `glpi_networkports` $left WHERE `glpi_networkports`.`items_id` = '" . $item->getID() . "' AND `glpi_networkports`.`itemtype` = '" . $item->getType() . "' $where GROUP BY `glpi_networkports`.`mac`"; foreach ($DB->request($query2) as $data2) { $ipmac['mac'.$data2['id']]['ip'] = ''; $ipmac['mac'.$data2['id']]['mac'] = $data2["mac"]; } } $links = array(); if (count($ipmac) > 0) { foreach ($ipmac as $key => $val) { $tmplink = $link; $disp = 1; if (strstr($link,"[IP]")) { if (empty($val['ip'])) { $disp = 0; } else { $tmplink = str_replace("[IP]", $val['ip'], $tmplink); } } if (strstr($link,"[MAC]")) { if (empty($val['mac'])) { $disp = 0; } else { $tmplink = str_replace("[MAC]", $val['mac'], $tmplink); } } if ($disp) { $links[$key] = $tmplink; } } } if (count($links)) { return $links; } return array($link); } /** * Show Links for an item * * @param $item CommonDBTM object * @param $withtemplate integer withtemplate param (default '') **/ static function showForItem(CommonDBTM $item, $withtemplate='') { global $DB, $CFG_GLPI; if (!Session::haveRight("link","r")) { return false; } if ($item->isNewID($item->getID())) { return false; } $query = "SELECT `glpi_links`.`id`, `glpi_links`.`link` AS link, `glpi_links`.`name` AS name , `glpi_links`.`data` AS data FROM `glpi_links` INNER JOIN `glpi_links_itemtypes` ON `glpi_links`.`id` = `glpi_links_itemtypes`.`links_id` WHERE `glpi_links_itemtypes`.`itemtype`='".$item->getType()."' " . getEntitiesRestrictRequest(" AND", "glpi_links", "entities_id", $item->getEntityID(), true)." ORDER BY name"; $result = $DB->query($query); echo "
    "; if ($DB->numrows($result) > 0) { echo ""; while ($data = $DB->fetch_assoc($result)) { $name = $data["name"]; if (empty($name)) { $name = $data["link"]; } $names = self::generateLinkContents($name, $item); $file = trim($data["data"]); if (empty($file)) { // Generate links $links = self::generateLinkContents($data['link'], $item); $i = 1; foreach ($links as $key => $link) { $name = (isset($names[$key]) ? $names[$key] : reset($names)); echo ""; $url = $link; echo ""; $i++; } } else { // Generate files $files = self::generateLinkContents($data['link'], $item); $links = self::generateLinkContents($data['data'], $item); $i = 1; foreach ($links as $key => $link) { $name = (isset($names[$key]) ? $names[$key] : reset($names)); if (isset($files[$key])) { // a different name for each file, ex name = foo-[IP].txt $file = $files[$key]; } else { // same name for all files, ex name = foo.txt $file = reset($files); } echo ""; $url = $CFG_GLPI["root_doc"]."/front/link.send.php?lID=".$data['id']. "&itemtype=".$item->getType(). "&id=".$item->getID()."&rank=$key"; echo ""; $i++; } } } echo "
    ".self::getTypeName(2)."
    "; $linkname = sprintf(__('%1$s #%2$s'), $name, $i); $linkname = printf(__('%1$s: %2$s'), $linkname, $link); echo "
    "; $linkname = sprintf(__('%1$s #%2$s'), $name, $i); $linkname = printf(__('%1$s: %2$s'), $linkname, $file); echo "
    "; } else { echo "".self::getTypeName(2).""; echo "".__('No link defined').""; echo "
    "; } } } ?>glpi-0.84.3+dfsg.1/inc/link_itemtype.class.php000066400000000000000000000124401226600447100210650ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class Link_Itemtype extends CommonDBChild { // From CommonDbChild static public $itemtype = 'Link'; static public $items_id = 'links_id'; /** * @since version 0.84 **/ function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } /** * Print the HTML array for device on link * * @param $link : Link * * @return Nothing (display) **/ static function showForLink($link) { global $DB,$CFG_GLPI; $links_id = $link->getField('id'); $canedit = $link->can($links_id, 'w'); $rand = mt_rand(); if (!Session::haveRight("link","r") || !$link->can($links_id, 'r')) { return false; } $query = "SELECT * FROM `glpi_links_itemtypes` WHERE `links_id` = '$links_id' ORDER BY `itemtype`"; $result = $DB->query($query); $types = array(); $used = array(); if ($numrows = $DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $types[$data['id']] = $data; $used[$data['itemtype']] = $data['itemtype']; } } if ($canedit) { echo "
    "; echo ""; echo ""; echo ""; echo ""; echo "
    ".__('Add an item type')."
    "; echo ""; Dropdown::showItemTypes('itemtype', $CFG_GLPI["link_types"], array('used' => $used)); echo ""; echo ""; echo "
    "; Html::closeForm(); echo "
    "; } echo "
    "; if ($canedit && $numrows) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $massiveactionparams = array('num_displayed' => $numrows); Html::showMassiveActions(__CLASS__, $massiveactionparams); } echo ""; echo ""; if ($canedit && $numrows) { echo ""; } echo ""; echo ""; foreach ($types as $data) { $typename = NOT_AVAILABLE; if ($item = getItemForItemtype($data['itemtype'])) { $typename = $item->getTypeName(1); echo ""; if ($canedit) { echo ""; } echo ""; echo ""; } } echo "
    ".Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand)."".__('Type')."
    "; Html::showMassiveActionCheckBox(__CLASS__, $data["id"]); echo "$typename
    "; if ($canedit && $numrows) { $massiveactionparams['ontop'] = false; Html::showMassiveActions(__CLASS__, $massiveactionparams); Html::closeForm(); } echo "
    "; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { switch ($item->getType()) { case 'Link' : if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(__('Associated hardware types'), countElementsInTable($this->getTable(), "links_id = '".$item->getID()."'")); } return __('Associated hardware types'); } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType() == 'Link') { self::showForLink($item); } return true; } } ?> glpi-0.84.3+dfsg.1/inc/location.class.php000066400000000000000000000101051226600447100200140ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Location class class Location extends CommonTreeDropdown { // From CommonDBTM public $dohistory = true; static function canCreate() { return Session::haveRight('entity_dropdown', 'w'); } static function canView() { return Session::haveRight('entity_dropdown', 'r'); } function getAdditionalFields() { return array(array('name' => $this->getForeignKeyField(), 'label' => __('As child of'), 'type' => 'parent', 'list' => false), array('name' => 'building', 'label' => __('Building number'), 'type' => 'text', 'list' => true), array('name' => 'room', 'label' => __('Room number'), 'type' => 'text', 'list' => true)); } static function getTypeName($nb=0) { return _n('Location','Locations',$nb); } static function getSearchOptionsToAdd() { $tab = array(); $tab[3]['table'] = 'glpi_locations'; $tab[3]['field'] = 'completename'; $tab[3]['name'] = __('Location'); $tab[3]['datatype'] = 'dropdown'; $tab[91]['table'] = 'glpi_locations'; $tab[91]['field'] = 'building'; $tab[91]['name'] = __('Building number'); $tab[91]['massiveaction'] = false; $tab[91]['datatype'] = 'string'; $tab[92]['table'] = 'glpi_locations'; $tab[92]['field'] = 'room'; $tab[92]['name'] = __('Room number'); $tab[92]['massiveaction'] = false; $tab[92]['datatype'] = 'string'; $tab[93]['table'] = 'glpi_locations'; $tab[93]['field'] = 'comment'; $tab[93]['name'] = __('Location comments'); $tab[93]['massiveaction'] = false; $tab[93]['datatype'] = 'text'; return $tab; } /** * Get search function for the class * * @return array of search option **/ function getSearchOptions() { $tab = parent::getSearchOptions(); $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'building'; $tab[11]['name'] = __('Building number'); $tab[11]['datatype'] = 'text'; $tab[12]['table'] = $this->getTable(); $tab[12]['field'] = 'room'; $tab[12]['name'] = __('Room number'); $tab[12]['datatype'] = 'text'; return $tab; } function defineTabs($options=array()) { $ong = parent::defineTabs($options); $this->addStandardTab('Netpoint', $ong, $options); return $ong; } function cleanDBonPurge() { Rule::cleanForItemAction($this); Rule::cleanForItemCriteria($this, 'users_locations'); } } ?>glpi-0.84.3+dfsg.1/inc/lock.class.php000066400000000000000000000504031226600447100171410ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * This class manages locks * Lock management is available for objects and link between objects. It relies on the use of * a is_dynamic field, to incidate if item supports lock, and is_deleted field to incidate if the * item or link is locked * By setting is_deleted to 0 again, the item is unlock * * Note : GLPI's core supports locks for objects. It's up to the external inventory tool to manage * locks for fields * * @since version 0.84 **/ class Lock { static function getTypeName($nb=0) { return _n('Lock', 'Locks', $nb); } /** * Display form to unlock fields and links * * @param CommonDBTM $item the source item **/ static function showForItem(CommonDBTM $item) { global $DB; $ID = $item->getID(); $itemtype = $item->getType(); $header = false; //If user doesn't have write right on the item, lock form must not be displayed if (!$item->canCreate()) { return false; } echo "
    "; echo ""; echo "\n"; echo "\n"; echo ""; echo ""; //Use a hook to allow external inventory tools to manage per field lock $results = Plugin::doHookFunction('display_locked_fields', array('item' => $item, 'header' => $header)); $header |= $results['header']; //Special locks for computers only if ($itemtype == 'Computer') { //Locks for items recorded in glpi_computers_items table $types = array('Monitor', 'Peripheral', 'Printer'); foreach ($types as $type) { $params = array('is_dynamic' => 1, 'is_deleted' => 1, 'computers_id' => $ID, 'itemtype' => $type); $params['FIELDS'] = array('id', 'items_id'); $first = true; foreach ($DB->request('glpi_computers_items', $params) as $line) { $tmp = new $type(); $tmp->getFromDB($line['items_id']); $header = true; if ($first) { echo "\n"; $first = false; } echo ""; echo ""; echo "\n"; } } $types = array('ComputerDisk', 'ComputerVirtualMachine'); foreach ($types as $type) { $params = array('is_dynamic' => 1, 'is_deleted' => 1, 'computers_id' => $ID); $params['FIELDS'] = array('id', 'name'); $first = true; foreach ($DB->request(getTableForItemType($type), $params) as $line) { $header = true; if ($first) { echo "\n"; $first = false; } echo ""; echo ""; echo "\n"; } } //Software versions $params = array('is_dynamic' => 1, 'is_deleted' => 1, 'computers_id' => $ID); $first = true; $query = "SELECT `csv`.`id` AS `id`, `sv`.`name` AS `version`, `s`.`name` AS `software` FROM `glpi_computers_softwareversions` AS csv LEFT JOIN `glpi_softwareversions` AS sv ON (`csv`.`softwareversions_id` = `sv`.`id`) LEFT JOIN `glpi_softwares` AS s ON (`sv`.`softwares_id` = `s`.`id`) WHERE `csv`.`is_deleted` = '1' AND `csv`.`is_dynamic` = '1' AND `csv`.`computers_id` = '$ID'"; foreach ($DB->request($query) as $line) { $header = true; if ($first) { echo "\n"; $first = false; } echo ""; echo ""; echo "\n"; } //Software licenses $params = array('is_dynamic' => 1, 'is_deleted' => 1, 'computers_id' => $ID); $first = true; $query = "SELECT `csv`.`id` AS `id`, `sv`.`name` AS `version`, `s`.`name` AS `software` FROM `glpi_computers_softwarelicenses` AS csv LEFT JOIN `glpi_softwarelicenses` AS sv ON (`csv`.`softwarelicenses_id` = `sv`.`id`) LEFT JOIN `glpi_softwares` AS s ON (`sv`.`softwares_id` = `s`.`id`) WHERE `csv`.`is_deleted` = '1' AND `csv`.`is_dynamic` = '1' AND `csv`.`computers_id` = '$ID'"; foreach ($DB->request($query) as $line) { $header = true; if ($first) { echo "". "\n"; $first = false; } echo ""; echo ""; echo "\n"; } } $first = true; $item = new NetworkPort(); $params = array('is_dynamic' => 1, 'is_deleted' => 1, 'items_id' => $ID, 'itemtype' => $itemtype); $params['FIELDS'] = array('id'); foreach ($DB->request('glpi_networkports', $params) as $line) { $item->getFromDB($line['id']); $header = true; if ($first) { echo "\n"; $first = false; } echo ""; echo ""; echo "\n"; } $first = true; $item = new NetworkName(); $params = array('`glpi_networknames`.`is_dynamic`' => 1, '`glpi_networknames`.`is_deleted`' => 1, '`glpi_networknames`.`itemtype`' => 'NetworkPort', '`glpi_networknames`.`items_id`' => '`glpi_networkports`.`id`', '`glpi_networkports`.`items_id`' => $ID, '`glpi_networkports`.`itemtype`' => $itemtype); $params['FIELDS'] = array('glpi_networknames' => 'id'); foreach ($DB->request(array('glpi_networknames', 'glpi_networkports'), $params) as $line) { $item->getFromDB($line['id']); $header = true; if ($first) { echo "\n"; $first = false; } echo ""; echo ""; echo "\n"; } $first = true; $item = new IPAddress(); $params = array('`glpi_ipaddresses`.`is_dynamic`' => 1, '`glpi_ipaddresses`.`is_deleted`' => 1, '`glpi_ipaddresses`.`itemtype`' => 'Networkname', '`glpi_ipaddresses`.`items_id`' => '`glpi_networknames`.`id`', '`glpi_networknames`.`itemtype`' => 'NetworkPort', '`glpi_networknames`.`items_id`' => '`glpi_networkports`.`id`', '`glpi_networkports`.`items_id`' => $ID, '`glpi_networkports`.`itemtype`' => $itemtype); $params['FIELDS'] = array('glpi_ipaddresses' => 'id'); foreach ($DB->request(array('glpi_ipaddresses', 'glpi_networknames', 'glpi_networkports'), $params) as $line) { $item->getFromDB($line['id']); $header = true; if ($first) { echo "\n"; $first = false; } echo ""; echo ""; echo "\n"; } $types = Item_Devices::getDeviceTypes(); $nb = 0; foreach ($types as $old => $type) { $nb += countElementsInTable(getTableForItemType($type), "`items_id`='$ID' AND `itemtype`='$itemtype' AND `is_dynamic`='1' AND `is_deleted`='1'"); } if ($nb) { $header = true; echo "\n"; foreach ($types as $old => $type) { $associated_type = str_replace('Item_', '', $type); $associated_table = getTableForItemType($associated_type); $fk = getForeignKeyFieldForTable($associated_table); $query = "SELECT `i`.`id`, `t`.`designation` AS `name` FROM `".getTableForItemType($type)."` AS i LEFT JOIN `$associated_table` AS t ON (`t`.`id` = `i`.`$fk`) WHERE `itemtype` = '$itemtype' AND `items_id` = '$ID' AND `is_dynamic` = '1' AND `is_deleted` = '1'"; foreach ($DB->request($query) as $data) { echo ""; echo "\n"; } } } if ($header) { echo "
    ".__('Locked items')."
    ".$type::getTypeName(2)."
    "; echo "" . $tmp->getName() . "
    ".$type::getTypeName(2)."
    "; echo "" . $line['name'] . "
    ".Software::getTypeName(2)."
    "; echo "" . $line['software']." ".$line['version'] . "
    ".SoftwareLicense::getTypeName(2)."
    "; echo "" . $line['software']." ".$line['version'] . "
    ".NetworkPort::getTypeName(2)."
    "; echo "" . $item->getName() . "
    ".NetworkName::getTypeName(2)."
    "; echo "" . $item->getName() . "
    ".IPAddress::getTypeName(2)."
    "; echo "" . $item->getName() . "
    "._n('Component', 'Components', 2)."
    "; echo ""; printf(__('%1$s: %2$s'), $associated_type::getTypeName(), $data['name']); echo "
    "; Html::openArrowMassives('lock_form', true); Html::closeArrowMassives(array('unlock' => _sx('button', 'Unlock'))); } else { echo ""; echo "". __('No locked item').""; echo ""; } Html::closeForm(); echo "
    \n"; } /** * @see CommonGLPI::getTabNameForItem() * * @param $item CommonGLPI object * @param $withtemplate (default 0) **/ function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if ($item->isDynamic() && $item->canCreate()) { return Lock::getTypeName(2); } return ''; } /** * @param $item CommonGLPI object * @param $tabnum (default 1) * @param $withtemplate (default 0) **/ static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->isDynamic()) { self::showForItem($item); } return true; } /** * Unlock locked items * * @param $itemtype itemtype of ids to locks * @param $baseitemtype itemtype of the based item * @param $items array of items to unlock **/ static function unlockItems($itemtype, $baseitemtype, $items) { global $DB; $ok = 0; $ko = 0; $infos = self::getLocksQueryInfosByItemType($itemtype, $baseitemtype); if ($item = getItemForItemtype($infos['type'])) { foreach ($items as $id => $value) { if ($value == 1) { $infos['condition'][$infos['field']] = $id; foreach ($DB->request($infos['table'], $infos['condition']) as $data) { // Restore without history if ($item->restore(array('id' => $data['id']))) { $ok++; } else { $ko++; } } } } } return array('ok' => $ok, 'ko' => $ko); } /** * Get massive actions to unlock items * * @param $itemtype source itemtype * * @return an array of actions to be added (empty if no actions to add) **/ static function getUnlockMassiveActions($itemtype) { if (Session::haveRight('computer', 'w') && ($itemtype == 'Computer')) { return array("unlock_Monitor" => __('Unlock monitors'), "unlock_Peripheral" => __('Unlock peripherals'), "unlock_Printer" => __('Unlock printers'), "unlock_SoftwareVersion" => __('Unlock software'), "unlock_NetworkPort" => __('Unlock network ports'), "unlock_NetworkName" => __('Unlock network names'), "unlock_IPAddress" => __('Unlock IP addresses'), "unlock_ComputerDisk" => __('Unlock volumes'), "unlock_Device" => __('Unlock devices'), "unlock_ComputerVirtualMachine" => __('Unlock virtual machines') ); } return array(); } /** * Return itemtype associated with the unlock massive action * * @param action the selected massive action * * @return the itemtype associated **/ static function getItemTypeForMassiveAction($action) { if (preg_match('/unlock_(.*)/', $action, $results)) { $itemtype = $results[1]; if (class_exists($itemtype)) { return $itemtype; } } return false; } /** * Get infos to build an SQL query to get locks fields in a table * * @param $itemtype itemtype of the item to look for locked fields * @param $baseitemtype itemtype of the based item * * @return an array which contains necessary informations to build the SQL query **/ static function getLocksQueryInfosByItemType($itemtype, $baseitemtype) { $condition = array(); $table = false; $field = ''; $type = $itemtype; switch ($itemtype) { case 'Peripheral' : case 'Monitor' : case 'Printer' : case 'Phone' : $condition = array('itemtype' => $itemtype, 'is_dynamic' => 1, 'is_deleted' => 1); $table = 'glpi_computers_items'; $field = 'computers_id'; $type = 'Computer_Item'; break; case 'NetworkPort' : $condition = array('itemtype' => $baseitemtype, 'is_dynamic' => 1, 'is_deleted' => 1); $table = 'glpi_networkports'; $field = 'items_id'; break; case 'NetworkName' : $condition = array('`glpi_networknames`.`is_dynamic`' => 1, '`glpi_networknames`.`is_deleted`' => 1, '`glpi_networknames`.`itemtype`' => 'NetworkPort', '`glpi_networknames`.`items_id`' => '`glpi_networkports`.`id`', '`glpi_networkports`.`itemtype`' => $baseitemtype); $condition['FIELDS'] = array('glpi_networknames' => 'id'); $table = array('glpi_networknames', 'glpi_networkports'); $field = '`glpi_networkports`.`items_id`'; break; case 'IPAddress' : $condition = array('`glpi_ipaddresses`.`is_dynamic`' => 1, '`glpi_ipaddresses`.`is_deleted`' => 1, '`glpi_ipaddresses`.`itemtype`' => 'NetworkName', '`glpi_ipaddresses`.`items_id`' => '`glpi_networknames`.`id`', '`glpi_networknames`.`itemtype`' => 'NetworkPort', '`glpi_networknames`.`items_id`' => '`glpi_networkports`.`id`', '`glpi_networkports`.`itemtype`' => $baseitemtype); $condition['FIELDS'] = array('glpi_ipaddresses' => 'id'); $table = array('glpi_ipaddresses', 'glpi_networknames', 'glpi_networkports'); $field = '`glpi_networkports`.`items_id`'; break; case 'ComputerDisk' : $condition = array('is_dynamic' => 1, 'is_deleted' => 1); $table = 'glpi_computerdisks'; $field = 'computers_id'; break; case 'ComputerVirtualMachine' : $condition = array('is_dynamic' => 1, 'is_deleted' => 1); $table = 'glpi_computervirtualmachines'; $field = 'computers_id'; break; case 'SoftwareVersion' : $condition = array('is_dynamic' => 1, 'is_deleted' => 1); $table = 'glpi_computers_softwareversions'; $field = 'computers_id'; $type = 'Computer_SoftwareVersion'; break; default : // Devices if (preg_match('/^Item\_Device/',$itemtype)) { $condition = array('itemtype' => $baseitemtype, 'is_dynamic' => 1, 'is_deleted' => 1); $table = getTableForItemType($itemtype); $field = 'items_id'; } } return array('condition' => $condition, 'table' => $table, 'field' => $field, 'type' => $type); } } ?> glpi-0.84.3+dfsg.1/inc/log.class.php000066400000000000000000000560361226600447100170020ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // Log class class Log extends CommonDBTM { const HISTORY_ADD_DEVICE = 1; const HISTORY_UPDATE_DEVICE = 2; const HISTORY_DELETE_DEVICE = 3; const HISTORY_INSTALL_SOFTWARE = 4; const HISTORY_UNINSTALL_SOFTWARE = 5; const HISTORY_DISCONNECT_DEVICE = 6; const HISTORY_CONNECT_DEVICE = 7; const HISTORY_LOCK_DEVICE = 8; const HISTORY_UNLOCK_DEVICE = 9; const HISTORY_LOG_SIMPLE_MESSAGE = 12; const HISTORY_DELETE_ITEM = 13; const HISTORY_RESTORE_ITEM = 14; const HISTORY_ADD_RELATION = 15; const HISTORY_DEL_RELATION = 16; const HISTORY_ADD_SUBITEM = 17; const HISTORY_UPDATE_SUBITEM = 18; const HISTORY_DELETE_SUBITEM = 19; const HISTORY_CREATE_ITEM = 20; const HISTORY_UPDATE_RELATION = 21; const HISTORY_LOCK_RELATION = 22; const HISTORY_LOCK_SUBITEM = 23; const HISTORY_UNLOCK_RELATION = 24; const HISTORY_UNLOCK_SUBITEM = 25; const HISTORY_LOCK_ITEM = 26; const HISTORY_UNLOCK_ITEM = 27; // Plugin must use value starting from const HISTORY_PLUGIN = 1000; static function getTypeName($nb=0) { return __('Historical'); } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(self::getTypeName(1), countElementsInTable('glpi_logs', "itemtype = '".$item->getType()."' AND items_id = '".$item->getID()."'")); } return self::getTypeName(1); } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { self::showForItem($item); return true; } /** * Construct history for an item * * @param $item CommonDBTM object * @param $oldvalues array of old values updated * @param $values array of all values of the item * * @return boolean for success (at least 1 log entry added) **/ static function constructHistory(CommonDBTM $item, &$oldvalues, &$values) { if (!count($oldvalues)) { return false; } // needed to have $SEARCHOPTION list($real_type, $real_id) = $item->getLogTypeID(); $searchopt = Search::getOptions($real_type); if (!is_array($searchopt)) { return false; } $result = 0; // type for which getValueToDisplay() could be used (fully tested) $oktype = array('Entity'); foreach ($oldvalues as $key => $oldval) { $changes = array(); // Parsing $SEARCHOPTION to find changed field foreach ($searchopt as $key2 => $val2) { if (!is_array($val2)) { // skip sub-title continue; } // Linkfield or standard field not massive action enable if (($val2['linkfield'] == $key) || (($key == $val2['field']) && ($val2['table'] == $item->getTable()))) { $id_search_option = $key2; // Give ID of the $SEARCHOPTION if ($val2['table'] == $item->getTable()) { $changes = array($id_search_option, addslashes($oldval), $values[$key]); } else { // other cases ; link field -> get data from dropdown if ($val2["table"] != 'glpi_auth_tables') { $changes = array($id_search_option, addslashes(sprintf(__('%1$s (%2$s)'), Dropdown::getDropdownName($val2["table"], $oldval), $oldval)), addslashes(sprintf(__('%1$s (%2$s)'), Dropdown::getDropdownName($val2["table"], $values[$key]), $values[$key]))); } } break; } } if (count($changes)) { $result = self::history($real_id, $real_type, $changes); } } return $result; } // function construct_history /** * Log history * * @param $items_id * @param $itemtype * @param $changes * @param $itemtype_link (default '') * @param $linked_action (default '0') * * @return boolean success **/ static function history ($items_id, $itemtype, $changes, $itemtype_link='', $linked_action='0') { global $DB; $date_mod = $_SESSION["glpi_currenttime"]; if (empty($changes)) { return false; } // create a query to insert history $id_search_option = $changes[0]; $old_value = $changes[1]; $new_value = $changes[2]; if ($uid = Session::getLoginUserID(false)) { if (is_numeric($uid)) { $username = sprintf(__('%1$s (%2$s)'), getUserName($uid), $uid); } else { // For cron management $username = $uid; } } else { $username = ""; } $old_value = $DB->escape(Toolbox::substr(stripslashes($old_value), 0, 180)); $new_value = $DB->escape(Toolbox::substr(stripslashes($new_value), 0, 180)); // Security to be sure that values do not pass over the max length if (Toolbox::strlen($old_value) > 255) { $old_value = Toolbox::substr($old_value,0,250); } if (Toolbox::strlen($new_value) > 255) { $new_value = Toolbox::substr($new_value,0,250); } // Build query $query = "INSERT INTO `glpi_logs` (`items_id`, `itemtype`, `itemtype_link`, `linked_action`, `user_name`, `date_mod`, `id_search_option`, `old_value`, `new_value`) VALUES ('$items_id', '$itemtype', '$itemtype_link', '$linked_action', '".addslashes($username)."', '$date_mod', '$id_search_option', '$old_value', '$new_value')"; if ($DB->query($query)) { return $_SESSION['glpi_maxhistory'] = $DB->insert_id(); } return false; } /** * Show History of an item * * @param $item CommonDBTM object * @param $withtemplate integer withtemplate param (default '') **/ static function showForItem(CommonDBTM $item, $withtemplate='') { global $DB; $itemtype = $item->getType(); $items_id = $item->getField('id'); $SEARCHOPTION = Search::getOptions($itemtype); if (isset($_POST["start"])) { $start = $_POST["start"]; } else { $start = 0; } // Total Number of events $number = countElementsInTable("glpi_logs", "`items_id`='$items_id' AND `itemtype`='$itemtype'"); // No Events in database if ($number < 1) { echo "
    "; echo ""; echo ""; echo "
    ".__('No historical')."
    "; echo "

    "; return; } // Display the pager Html::printAjaxPager(self::getTypeName(1), $start, $number); // Output events echo "
    "; echo ""; echo ""; //TRANS: a noun, modification, change echo ""; foreach (self::getHistoryData($item,$start, $_SESSION['glpilist_limit']) as $data) { if ($data['display_history']) { // show line echo ""; echo "". ""; echo ""; } } echo "
    ".__('ID')."".__('Date')."".__('User')."".__('Field').""._x('name', 'Update')."
    ".$data['id']."".$data['date_mod']."".$data['user_name']."".$data['field']."".$data['change']."
    "; Html::printAjaxPager(self::getTypeName(1), $start, $number); } /** * Retrieve last history Data for an item * * @param $item CommonDBTM object * @param $start integer first line to retrieve (default 0) * @param $limit integer max number of line to retrive (0 for all) (default 0) * @param $sqlfilter string to add an SQL filter (default '') * * @return array of localized log entry (TEXT only, no HTML) **/ static function getHistoryData(CommonDBTM $item, $start=0, $limit=0, $sqlfilter='') { global $DB; $itemtype = $item->getType(); $items_id = $item->getField('id'); $itemtable = $item->getTable(); $SEARCHOPTION = Search::getOptions($itemtype); $query = "SELECT * FROM `glpi_logs` WHERE `items_id` = '$items_id' AND `itemtype` = '$itemtype' "; if ($sqlfilter) { $query .= "AND ($sqlfilter) "; } $query .= "ORDER BY `id` DESC"; if ($limit) { $query .= " LIMIT ".intval($start)."," . intval($limit); } $changes = array(); foreach ($DB->request($query) as $data) { $tmp = array(); $tmp['display_history'] = true; $tmp['id'] = $data["id"]; $tmp['date_mod'] = Html::convDateTime($data["date_mod"]); $tmp['user_name'] = $data["user_name"]; $tmp['field'] = ""; $tmp['change'] = ""; $tmp['datatype'] = ""; // This is an internal device ? if ($data["linked_action"]) { // Yes it is an internal device switch ($data["linked_action"]) { case self::HISTORY_CREATE_ITEM : $tmp['change'] = __('Add the item'); break; case self::HISTORY_DELETE_ITEM : $tmp['change'] = __('Delete the item'); break; case self::HISTORY_LOCK_ITEM : $tmp['change'] = __('Lock the item'); break; case self::HISTORY_UNLOCK_ITEM : $tmp['change'] = __('Unlock the item'); break; case self::HISTORY_RESTORE_ITEM : $tmp['change'] = __('Restore the item'); break; case self::HISTORY_ADD_DEVICE : $tmp['field'] = NOT_AVAILABLE; if ($item2 = getItemForItemtype($data["itemtype_link"])) { $tmp['field'] = $item2->getTypeName(1); } //TRANS: %s is the component name $tmp['change'] = sprintf(__('%1$s: %2$s'), __('Add the component'), $data["new_value"]); break; case self::HISTORY_UPDATE_DEVICE : $tmp['field'] = NOT_AVAILABLE; $change = ''; $linktype_field = explode('#', $data["itemtype_link"]); $linktype = $linktype_field[0]; $field = $linktype_field[1]; $devicetype = $linktype::getDeviceType(); $tmp['field'] = $devicetype; $specif_fields = $linktype::getSpecificities(); if (isset($specif_fields[$field]['short name'])) { $tmp['field'] = $devicetype; $tmp['field'] .= " (".$specif_fields[$field]['short name'].")"; } //TRANS: %1$s is the old_value, %2$s is the new_value $tmp['change'] = sprintf(__('Change the component %1$s: %2$s'), $tmp['field'], sprintf(__('%1$s by %2$s'), $data["old_value"], $data[ "new_value"])); break; case self::HISTORY_DELETE_DEVICE : $tmp['field']=NOT_AVAILABLE; if ($item2 = getItemForItemtype($data["itemtype_link"])) { $tmp['field'] = $item2->getTypeName(1); } //TRANS: %s is the component name $tmp['change'] = sprintf(__('%1$s: %2$s'), __('Delete the component'), $data["old_value"]); break; case self::HISTORY_LOCK_DEVICE : $tmp['field'] = NOT_AVAILABLE; if ($item2 = getItemForItemtype($data["itemtype_link"])) { $tmp['field'] = $item2->getTypeName(1); } //TRANS: %s is the component name $tmp['change'] = sprintf(__('%1$s: %2$s'), __('Lock the component'), $data["old_value"]); break; case self::HISTORY_UNLOCK_DEVICE : $tmp['field'] = NOT_AVAILABLE; if ($item2 = getItemForItemtype($data["itemtype_link"])) { $tmp['field'] = $item2->getTypeName(1); } //TRANS: %s is the component name $tmp['change'] = sprintf(__('%1$s: %2$s'), __('Unlock the component'), $data["new_value"]); break; case self::HISTORY_INSTALL_SOFTWARE : $tmp['field'] = _n('Software', 'Software', 1); //TRANS: %s is the software name $tmp['change'] = sprintf(__('%1$s: %2$s'), __('Install the software'), $data["new_value"]); break; case self::HISTORY_UNINSTALL_SOFTWARE : $tmp['field'] = _n('Software', 'Software', 1); //TRANS: %s is the software name $tmp['change'] = sprintf(__('%1$s: %2$s'), __('Uninstall the software'), $data["old_value"]); break; case self::HISTORY_DISCONNECT_DEVICE : $tmp['field'] = NOT_AVAILABLE; if ($item2 = getItemForItemtype($data["itemtype_link"])) { $tmp['field'] = $item2->getTypeName(1); } //TRANS: %s is the item name $tmp['change'] = sprintf(__('%1$s: %2$s'), __('Disconnect the item'), $data["old_value"]); break; case self::HISTORY_CONNECT_DEVICE : $tmp['field'] = NOT_AVAILABLE; if ($item2 = getItemForItemtype($data["itemtype_link"])) { $tmp['field'] = $item2->getTypeName(1); } //TRANS: %s is the item name $tmp['change'] = sprintf(__('%1$s: %2$s'), __('Connect the item'), $data["new_value"]); break; case self::HISTORY_LOG_SIMPLE_MESSAGE : $tmp['field'] = ""; $tmp['change'] = $data["new_value"]; break; case self::HISTORY_ADD_RELATION : $tmp['field'] = NOT_AVAILABLE; if ($item2 = getItemForItemtype($data["itemtype_link"])) { $tmp['field'] = $item2->getTypeName(1); } $tmp['change'] = sprintf(__('%1$s: %2$s'), __('Add a link with an item'), $data["new_value"]); break; case self::HISTORY_DEL_RELATION : $tmp['field'] = NOT_AVAILABLE; if ($item2 = getItemForItemtype($data["itemtype_link"])) { $tmp['field'] = $item2->getTypeName(1); } $tmp['change'] = sprintf(__('%1$s: %2$s'), __('Delete a link with an item'), $data["old_value"]); break; case self::HISTORY_LOCK_RELATION : $tmp['field'] = NOT_AVAILABLE; if ($item2 = getItemForItemtype($data["itemtype_link"])) { $tmp['field'] = $item2->getTypeName(1); } $tmp['change'] = sprintf(__('%1$s: %2$s'), __('Lock a link with an item'), $data["old_value"]); break; case self::HISTORY_UNLOCK_RELATION : $tmp['field'] = NOT_AVAILABLE; if ($item2 = getItemForItemtype($data["itemtype_link"])) { $tmp['field'] = $item2->getTypeName(1); } $tmp['change'] = sprintf(__('%1$s: %2$s'), __('Unlock a link with an item'), $data["new_value"]); break; case self::HISTORY_ADD_SUBITEM : $tmp['field'] = ''; if ($item2 = getItemForItemtype($data["itemtype_link"])) { $tmp['field'] = $item2->getTypeName(1); } $tmp['change'] = sprintf(__('%1$s: %2$s'), __('Add the item'), sprintf(__('%1$s (%2$s)'), $tmp['field'], $data["new_value"])); break; case self::HISTORY_UPDATE_SUBITEM : $tmp['field'] = ''; if ($item2 = getItemForItemtype($data["itemtype_link"])) { $tmp['field'] = $item2->getTypeName(1); } $tmp['change'] = sprintf(__('%1$s: %2$s'), __('Update the item'), sprintf(__('%1$s (%2$s)'), $tmp['field'], $data["new_value"])); break; case self::HISTORY_DELETE_SUBITEM : $tmp['field'] = ''; if ($item2 = getItemForItemtype($data["itemtype_link"])) { $tmp['field'] = $item2->getTypeName(1); } $tmp['change'] = sprintf(__('%1$s: %2$s'), __('Delete the item'), sprintf(__('%1$s (%2$s)'), $tmp['field'], $data["old_value"])); break; case self::HISTORY_LOCK_SUBITEM : $tmp['field'] = ''; if ($item2 = getItemForItemtype($data["itemtype_link"])) { $tmp['field'] = $item2->getTypeName(1); } $tmp['change'] = sprintf(__('%1$s: %2$s'), __('Lock an item'), sprintf(__('%1$s (%2$s)'), $tmp['field'], $data["old_value"])); break; case self::HISTORY_UNLOCK_SUBITEM : $tmp['field'] = ''; if ($item2 = getItemForItemtype($data["itemtype_link"])) { $tmp['field'] = $item2->getTypeName(1); } $tmp['change'] = sprintf(__('%1$s: %2$s'), __('Unlock an item'), sprintf(__('%1$s (%2$s)'), $tmp['field'], $data["new_value"])); break; default : $fct = array($data['itemtype_link'], 'getHistoryEntry'); if (($data['linked_action'] >= self::HISTORY_PLUGIN) && $data['itemtype_link'] && is_callable($fct)) { $tmp['field'] = $data['itemtype_link']::getTypeName(1); $tmp['change'] = call_user_func($fct, $data); } $tmp['display_history'] = !empty($tmp['change']); } } else { $fieldname = ""; $searchopt = array(); $tablename = ''; // It's not an internal device foreach ($SEARCHOPTION as $key2 => $val2) { if ($key2 == $data["id_search_option"]) { $tmp['field'] = $val2["name"]; $tablename = $val2["table"]; $fieldname = $val2["field"]; $searchopt = $val2; if (isset($val2['datatype'])) { $tmp['datatype'] = $val2["datatype"]; } break; } } if ($itemtable == $tablename) { switch ($tmp['datatype']) { // specific case for text field case 'text' : $tmp['change'] = __('Update of the field'); break; default : $data["old_value"] = $item->getValueToDisplay($searchopt, $data["old_value"]); $data["new_value"] = $item->getValueToDisplay($searchopt, $data["new_value"]); break; } } if (empty($tmp['change'])) { $tmp['change'] = sprintf(__('Change %1$s by %2$s'), $data["old_value"], $data["new_value"]); } } $changes[] = $tmp; } return $changes; } /** * Actions done after the ADD of the item in the database * * @since version 0.83 * * @see CommonDBTM::post_addItem() **/ function post_addItem() { $_SESSION['glpi_maxhistory'] = $this->fields['id']; } } ?>glpi-0.84.3+dfsg.1/inc/mailcollector.class.php000066400000000000000000001541361226600447100210520ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// MailCollector class // Merge with collect GLPI system after big modification in it // modif and debug by INDEPNET Development Team. /* Original class ReceiveMail 1.0 by Mitul Koradia Created: 01-03-2006 * Description: Reciving mail With Attechment * Email: mitulkoradia@gmail.com */ class MailCollector extends CommonDBTM { // Specific one /// working charset of the mail var $charset = ""; /// IMAP / POP connection var $marubox = ''; /// ID of the current message var $mid = -1; /// structure used to store the mail structure var $structure = false; /// structure used to store files attached to a mail var $files; /// Message to add to body to build ticket var $addtobody; /// Number of fetched emails var $fetch_emails = 0; /// Maximum number of emails to fetch : default to 10 var $maxfetch_emails = 10; /// Max size for attached files var $filesize_max = 0; /// Body converted var $body_converted = false; // Destination folder const REFUSED_FOLDER = 'refused'; const ACCEPTED_FOLDER = 'accepted'; public $dohistory = true; static function getTypeName($nb=0) { return _n('Receiver', 'Receivers', $nb); } static function canCreate() { return Session::haveRight('config', 'w'); } static function canView() { return Session::haveRight('config', 'r'); } function post_getEmpty() { global $CFG_GLPI; $this->fields['filesize_max'] = $CFG_GLPI['default_mailcollector_filesize_max']; $this->fields['is_active'] = 1; } /** * @see CommonDBTM::prepareInputForUpdate() **/ function prepareInputForUpdate($input) { if (isset($input["passwd"])) { if (empty($input["passwd"])) { unset($input["passwd"]); } else { $input["passwd"] = Toolbox::encrypt(stripslashes($input["passwd"]), GLPIKEY); } } if (isset($input["_blank_passwd"]) && $input["_blank_passwd"]) { $input['passwd'] = ''; } if (isset($input['mail_server']) && !empty($input['mail_server'])) { $input["host"] = Toolbox::constructMailServerConfig($input); } if (isset($input['name']) && !NotificationMail::isUserAddressValid($input['name'])) { Session::addMessageAfterRedirect(__('Invalid email address'), false, ERROR); } return $input; } /** * @see CommonDBTM::prepareInputForAdd() **/ function prepareInputForAdd($input) { if (isset($input["passwd"])) { if (empty($input["passwd"])) { unset($input["passwd"]); } else { $input["passwd"] = Toolbox::encrypt(stripslashes($input["passwd"]), GLPIKEY); } } if (isset($input['mail_server']) && !empty($input['mail_server'])) { $input["host"] = Toolbox::constructMailServerConfig($input); } if (!NotificationMail::isUserAddressValid($input['name'])) { Session::addMessageAfterRedirect(__('Invalid email address'), false, ERROR); } return $input; } /** * @see CommonGLPI::defineTabs() **/ function defineTabs($options=array()) { $ong = array(); $this->addStandardTab(__CLASS__, $ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } /** * @see CommonGLPI::getTabNameForItem() **/ function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { switch ($item->getType()) { case __CLASS__ : return self::getTypeName(1); } } return ''; } /** * @param $item CommonGLPI object * @param $tabnum (default 1 * @param $withtemplate (default 0) **/ static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { global $CFG_GLPI; if ($item->getType() == __CLASS__) { $item->showGetMessageForm($item->getID()); } return true; } /** * Print the mailgate form * * @param $ID integer Id of the item to print * @param $options array * - target filename : where to go when done. * * @return boolean item found **/ function showForm($ID, $options=array()) { global $CFG_GLPI; $this->initForm($ID, $options); $options['colspan'] = 1; $this->showTabs($options); $this->showFormHeader($options); if (!function_exists('mb_list_encodings') || !function_exists('mb_convert_encoding')) { echo "". "".__('mbstring extension not found. Warning with charsets used.'). ""; } echo "".sprintf(__('%1$s (%2$s)'), __('Name'), __('Email address')). ""; Html::autocompletionTextField($this, "name"); echo ""; if ($this->fields['errors']) { echo "".__('Connection errors').""; echo "".$this->fields['errors'].""; echo ""; } echo "".__('Active').""; Dropdown::showYesNo("is_active", $this->fields["is_active"]); echo ""; $type = Toolbox::showMailServerConfig($this->fields["host"]); echo "".__('Login').""; Html::autocompletionTextField($this, "login"); echo ""; echo "".__('Password').""; echo ""; if ($ID > 0) { echo " ".__('Clear'); } echo ""; if (version_compare(PHP_VERSION, '5.3.2', '>=')) { echo "" . __('Use Kerberos authentication') . ""; echo ""; Dropdown::showYesNo("use_kerberos", $this->fields["use_kerberos"]); echo "\n"; } if ($type != "pop") { echo "" . __('Accepted mail archive folder (optional)') . ""; echo "fields['accepted']."\">"; echo "\n"; echo "" . __('Refused mail archive folder (optional)') . ""; echo "fields['refused']."\">"; echo "\n"; } echo ""; echo " ". __('Maximum size of each file imported by the mails receiver'). ""; self::showMaxFilesize('filesize_max', $this->fields["filesize_max"]); echo ""; echo "" . __('Use mail date, instead of collect one') . ""; echo ""; Dropdown::showYesNo("use_mail_date", $this->fields["use_mail_date"]); echo "\n"; echo "".__('Comments').""; echo ""; if ($ID > 0) { echo "
    "; //TRANS: %s is the datetime of update printf(__('Last update on %s'), Html::convDateTime($this->fields["date_mod"])); } echo ""; $this->showFormButtons($options); $this->addDivForTabs(); return true; } /** * @param $ID **/ function showGetMessageForm($ID) { echo "

    "; echo ""; echo ""; echo ""; echo "
    "; echo ""; echo ""; echo "
    "; Html::closeForm(); echo "
    "; } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'is_active'; $tab[2]['name'] = __('Active'); $tab[2]['datatype'] = 'bool'; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'host'; $tab[3]['name'] = __('Connection string'); $tab[3]['massiveaction'] = false; $tab[3]['datatype'] = 'string'; $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'login'; $tab[4]['name'] = __('Login'); $tab[4]['massiveaction'] = false; $tab[4]['datatype'] = 'string'; $tab[5]['table'] = $this->getTable(); $tab[5]['field'] = 'filesize_max'; $tab[5]['name'] = __('Maximum size of each file imported by the mails receiver'); $tab[5]['datatype'] = 'integer'; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab[19]['table'] = $this->getTable(); $tab[19]['field'] = 'date_mod'; $tab[19]['name'] = __('Last update'); $tab[19]['datatype'] = 'datetime'; $tab[19]['massiveaction'] = false; $tab[20]['table'] = $this->getTable(); $tab[20]['field'] = 'accepted'; $tab[20]['name'] = __('Accepted mail archive folder (optional)'); $tab[20]['datatype'] = 'string'; $tab[21]['table'] = $this->getTable(); $tab[21]['field'] = 'refused'; $tab[21]['name'] = __('Refused mail archive folder (optional)'); $tab[21]['datatype'] = 'string'; $tab[22]['table'] = $this->getTable(); $tab[22]['field'] = 'errors'; $tab[22]['name'] = __('Connection errors'); $tab[22]['datatype'] = 'integer'; return $tab; } /** * @param $emails_ids array * @param $action (default 0) * @param $entity (default 0) **/ function deleteOrImportSeveralEmails($emails_ids=array(), $action=0, $entity=0) { global $DB; $mailbox_id = 0; $query = "SELECT * FROM `glpi_notimportedemails` WHERE `id` IN (".implode(',',$emails_ids).") ORDER BY `mailcollectors_id`"; $todelete = array(); foreach ($DB->request($query) as $data) { $todelete[$data['mailcollectors_id']][$data['messageid']] = $data; } $ticket = new Ticket(); foreach ($todelete as $mailcollector_id => $rejected) { if ($this->getFromDB($mailcollector_id)) { $this->mid = -1; $this->fetch_emails = 0; //Connect to the Mail Box $this->connect(); // Get Total Number of Unread Email in mail box $tot = $this->getTotalMails(); //Total Mails in Inbox Return integer value for($i=1 ; $i<=$tot ; $i++) { $head = $this->getHeaders($i); if (isset($rejected[$head['message_id']])) { if ($action == 1) { $tkt = array(); $tkt = $this->buildTicket($i, array('mailgates_id' => $mailcollector_id, 'play_rules' => false)); $tkt['_users_id_requester'] = $rejected[$head['message_id']]['users_id']; $tkt['entities_id'] = $entity; $ticket->add($tkt); $folder = self::ACCEPTED_FOLDER; } else { $folder = self::REFUSED_FOLDER; } //Delete email if ($this->deleteMails($i, $folder)) { $rejectedmail = new NotImportedEmail(); $rejectedmail->delete(array('id' => $rejected[$head['message_id']]['id'])); } // Unset managed unset($rejected[$head['message_id']]); } } // Email not present in mailbox if (count($rejected)) { $clean = array('<' => '', '>' => ''); foreach ($rejected as $id => $data) { if ($action == 1) { Session::addMessageAfterRedirect(sprintf(__('Email %s not found. Impossible import.'), strtr($id, $clean)), false, ERROR); } else { // Delete data in notimportedemail table $rejectedmail = new NotImportedEmail(); $rejectedmail->delete(array('id' => $data['id'])); } } } imap_expunge($this->marubox); $this->close_mailbox(); } } } /** * Constructor * * @param $mailgateID ID of the mailgate * @param $display display messages in MessageAfterRedirect or just return error (default 0=) * * @return if $display = false return messages result string **/ function collect($mailgateID, $display=0) { global $CFG_GLPI; if ($this->getFromDB($mailgateID)) { $this->mid = -1; $this->fetch_emails = 0; //Connect to the Mail Box $this->connect(); $rejected = new NotImportedEmail(); // Clean from previous collect (from GUI, cron already truncate the table) $rejected->deleteByCriteria(array('mailcollectors_id' => $this->fields['id'])); if ($this->marubox) { // Get Total Number of Unread Email in mail box $tot = $this->getTotalMails(); //Total Mails in Inbox Return integer value $error = 0; $refused = 0; $blacklisted = 0; for ($i=1 ; ($i <= $tot) && ($this->fetch_emails < $this->maxfetch_emails) ; $i++) { $tkt = $this->buildTicket($i, array('mailgates_id' => $mailgateID, 'play_rules' => true)); //Indicates that the mail must be deleted from the mailbox $delete_mail = false; // If entity assigned, or email refused by rule, or no user or supplier associated with the email $user_condition = ($CFG_GLPI["use_anonymous_helpdesk"] ||(isset($tkt['_users_id_requester']) && ($tkt['_users_id_requester'] > 0)) || (isset($tkt['_supplier_email']) && $tkt['_supplier_email'])); $rejinput = array(); $rejinput['mailcollectors_id'] = $mailgateID; $rejinput['from'] = $tkt['_head']['from']; $rejinput['to'] = $tkt['_head']['to']; $rejinput['users_id'] = $tkt['_users_id_requester']; $rejinput['subject'] = $this->textCleaner($tkt['_head']['subject']); $rejinput['messageid'] = $tkt['_head']['message_id']; $rejinput['date'] = $_SESSION["glpi_currenttime"]; // Manage blacklisted emails if (isset($tkt['_blacklisted']) && $tkt['_blacklisted']) { $this->deleteMails($i, self::REFUSED_FOLDER); $blacklisted++; // entities_id set when new ticket / tickets_id when new followup } else if (((isset($tkt['entities_id']) || isset($tkt['tickets_id'])) && $user_condition) || isset($tkt['_refuse_email_no_response']) || isset($tkt['_refuse_email_with_response'])) { if (isset($tkt['_refuse_email_with_response'])) { $this->sendMailRefusedResponse($tkt['_head']['from'], $tkt['name']); $delete_mail = self::REFUSED_FOLDER; $refused++; } else if (isset($tkt['_refuse_email_no_response'])) { $delete_mail = self::REFUSED_FOLDER; $refused++; } else if (isset($tkt['entities_id']) || isset($tkt['tickets_id'])) { // Is a mail responding of an already existing ticket ? if (isset($tkt['tickets_id']) ) { $fup = new TicketFollowup(); if ($fup->add($tkt)) { $delete_mail = self::ACCEPTED_FOLDER; } else { $error++; $rejinput['reason'] = NotImportedEmail::FAILED_INSERT; $rejected->add($rejinput); } } else { // New ticket $track = new Ticket(); if ($track->add($tkt)) { $delete_mail = self::ACCEPTED_FOLDER; } else { $error++; $rejinput['reason'] = NotImportedEmail::FAILED_INSERT; $rejected->add($rejinput); } } } else { // Case never raise $delete_mail = self::REFUSED_FOLDER; $refused++; } //Delete Mail from Mail box if ticket is added successfully if ($delete_mail) { $this->deleteMails($i, $delete_mail); } } else { if (!$tkt['_users_id_requester']) { $rejinput['reason'] = NotImportedEmail::USER_UNKNOWN; } else { $rejinput['reason'] = NotImportedEmail::MATCH_NO_RULE; } $rejected->add($rejinput); } $this->fetch_emails++; } imap_expunge($this->marubox); $this->close_mailbox(); //Close Mail Box //TRANS: %1$d, %2$d, %3$d, %4$d and %5$d are number of messages $msg = sprintf(__('Number of messages: available=%1$d, retrieved=%2$d, refused=%3$d, errors=%4$d, blacklisted=%5$d'), $tot, $this->fetch_emails, $refused, $error, $blacklisted); if ($display) { Session::addMessageAfterRedirect($msg, false, ($error ? ERROR : INFO)); } else { return $msg; } } else { $msg = __('Could not connect to mailgate server'); if ($display) { Session::addMessageAfterRedirect($msg, false, ERROR); } else { return $msg; } } } else { //TRANS: %s is the ID of the mailgate $msg = sprintf(__('Could not find mailgate %d'), $mailgateID); if ($display) { Session::addMessageAfterRedirect($msg, false, ERROR); } else { return $msg; } } } /** function buildTicket - Builds,and returns, the major structure of the ticket to be entered. * * @param $i mail ID * @param $options array of possible options * * @return ticket fields array */ function buildTicket($i, $options=array()) { global $CFG_GLPI; $play_rules = (isset($options['play_rules']) && $options['play_rules']); $head = $this->getHeaders($i); // Get Header Info Return Array Of Headers // **Key Are (subject,to,toOth,toNameOth,from,fromName) $tkt = array(); $tkt['_blacklisted'] = false; // For RuleTickets $tkt['_mailgate'] = $options['mailgates_id']; // Use mail date if it's defined if ($this->fields['use_mail_date']) { $tkt['date'] = $head['date']; } // Detect if it is a mail reply $glpi_message_match = "/GLPI-([0-9]+)\.[0-9]+\.[0-9]+@\w*/"; // Check if email not send by GLPI : if yes -> blacklist if (!isset($head['message_id']) || preg_match($glpi_message_match, $head['message_id'], $match)) { $tkt['_blacklisted'] = true; return $tkt; } // manage blacklist $blacklisted_emails = Blacklist::getEmails(); // Add name of the mailcollector as blacklisted $blacklisted_emails[] = $this->fields['name']; if (Toolbox::inArrayCaseCompare($head['from'], $blacklisted_emails)) { $tkt['_blacklisted'] = true; return $tkt; } // max size = 0 : no import attachments if ($this->fields['filesize_max'] > 0) { if (is_writable(GLPI_DOC_DIR."/_tmp/")) { $_FILES = $this->getAttached($i, GLPI_DOC_DIR."/_tmp/", $this->fields['filesize_max']); } else { //TRANS: %s is a directory Toolbox::logInFile('mailgate', sprintf(__('%s is not writable'), GLPI_DOC_DIR."/_tmp/")); } } // Who is the user ? $tkt['_users_id_requester'] = User::getOrImportByEmail($head['from']); $tkt["_users_id_requester_notif"]['use_notification'] = 1; // Set alternative email if user not found / used if anonymous mail creation is enable if (!$tkt['_users_id_requester']) { $tkt["_users_id_requester_notif"]['alternative_email'] = $head['from']; } // Add to and cc as additional observer if user found if (count($head['ccs'])) { foreach ($head['ccs'] as $cc) { if (($cc != $head['from']) && !Toolbox::inArrayCaseCompare($cc, $blacklisted_emails) // not blacklisted emails && (($tmp = User::getOrImportByEmail($cc)) > 0)) { $tkt['_additional_observers'][] = array('users_id' => $tmp, 'use_notification' => 1); } } } if (count($head['tos'])) { foreach ($head['tos'] as $to) { if (($to != $head['from']) && !Toolbox::inArrayCaseCompare($to, $blacklisted_emails) // not blacklisted emails && (($tmp = User::getOrImportByEmail($to)) > 0)) { $tkt['_additional_observers'][] = array('users_id' => $tmp, 'use_notification' => 1); } } } // Auto_import $tkt['_auto_import'] = 1; // For followup : do not check users_id = login user $tkt['_do_not_check_users_id'] = 1; $body = $this->getBody($i); // Do it before using charset variable $head['subject'] = $this->decodeMimeString($head['subject']); $tkt['_head'] = $head; if (!empty($this->charset) && !$this->body_converted) { $body = Toolbox::encodeInUtf8($body,$this->charset); $this->body_converted = true; } if (!Toolbox::seems_utf8($body)) { $tkt['content'] = Toolbox::encodeInUtf8($body); } else { $tkt['content'] = $body; } // Add message from getAttached if ($this->addtobody) { $tkt['content'] .= $this->addtobody; } // See In-Reply-To field if (isset($head['in_reply_to'])) { if (preg_match($glpi_message_match, $head['in_reply_to'], $match)) { $tkt['tickets_id'] = intval($match[1]); } } // See in References if (!isset($tkt['tickets_id']) && isset($head['references'])) { if (preg_match($glpi_message_match, $head['references'], $match)) { $tkt['tickets_id'] = intval($match[1]); } } // See in title if (!isset($tkt['tickets_id']) && preg_match('/\[.+#(\d+)\]/',$head['subject'],$match)) { $tkt['tickets_id'] = intval($match[1]); } $tkt['_supplier_email'] = false; // Found ticket link if (isset($tkt['tickets_id'])) { // it's a reply to a previous ticket $job = new Ticket(); $tu = new Ticket_User(); $st = new Supplier_Ticket(); $supplier_email = false; // Check if ticket exists and users_id exists in GLPI /// TODO check if users_id have right to add a followup to the ticket if ($job->getFromDB($tkt['tickets_id']) && ($job->fields['status'] != CommonITILObject::CLOSED) && ($CFG_GLPI['use_anonymous_followups'] || ($tkt['_users_id_requester'] > 0) || $tu->isAlternateEmailForITILObject($tkt['tickets_id'], $head['from']) || ($supplier_email = $st->isSupplierEmail($tkt['tickets_id'], $head['from'])) )) { if ($supplier_email) { $tkt['content'] = sprintf(__('From %s'), $head['from'])."\n\n".$tkt['content']; $tkt['_supplier_email'] = true; } $content = explode("\n", $tkt['content']); $tkt['content'] = ""; $first_comment = true; $to_keep = array(); // Move requester to author of followup : $tkt['users_id'] = $tkt['_users_id_requester']; foreach ($content as $ID => $val) { if (isset($val[0]) && ($val[0] == '>')) { // Delete line at the top of the first comment if ($first_comment) { $first_comment = false; // Do not drop line before comment because may be real text // if (isset($to_keep[$ID-1])) { // unset($to_keep[$ID-1]); // } } } else { $to_keep[$ID] = $ID; } } foreach ($to_keep as $ID ) { $tkt['content'] .= $content[$ID]."\n"; } // Do not play rules for followups : WRONG : play rules only for refuse options //$play_rules = false; } else { // => to handle link in Ticket->post_addItem() $tkt['_linkedto'] = $tkt['tickets_id']; unset($tkt['tickets_id']); } } $tkt['name'] = $this->textCleaner($head['subject']); if (!isset($tkt['tickets_id'])) { // Which entity ? //$tkt['entities_id']=$this->fields['entities_id']; //$tkt['Subject']= $head['subject']; // not use for the moment // Medium $tkt['urgency'] = "3"; // No hardware associated $tkt['itemtype'] = ""; // Mail request type } else { // Reopen if needed $tkt['add_reopen'] = 1; } $tkt['requesttypes_id'] = RequestType::getDefault('mail'); $tkt['content'] = Toolbox::clean_cross_side_scripting_deep(Html::clean($tkt['content'])); if ($play_rules) { $rule_options['ticket'] = $tkt; $rule_options['headers'] = $head; $rule_options['mailcollector'] = $options['mailgates_id']; $rule_options['_users_id_requester'] = $tkt['_users_id_requester']; $rulecollection = new RuleMailCollectorCollection(); $output = $rulecollection->processAllRules(array(), array(), $rule_options); // New ticket : compute all if (!isset($tkt['tickets_id'])) { foreach ($output as $key => $value) { $tkt[$key] = $value; } } else { // Followup only copy refuse data $tobecopied = array('_refuse_email_no_response', '_refuse_email_with_response'); foreach ($tobecopied as $val) { if (isset($output[$val])) { $tkt[$val] = $output[$val]; } } } } $tkt = Toolbox::addslashes_deep($tkt); return $tkt; } /** function textCleaner - Strip out unwanted/unprintable characters from the subject. * * @param $text text to clean * * @return clean text **/ function textCleaner($text) { $text = str_replace("=20", "\n", $text); $text = Toolbox::clean_cross_side_scripting_deep($text); return $text; } ///return supported encodings in lowercase. function mb_list_lowerencodings() { $r = mb_list_encodings(); for ($n=sizeOf($r) ; $n-- ; ) { $r[$n] = Toolbox::strtolower($r[$n]); } return $r; } /** * Receive a string with a mail header and returns it decoded to a specified charset. * If the charset specified into a piece of text from header * isn't supported by "mb", the "fallbackCharset" will be used to try to decode it. * * @param $mimeStr mime header string * @param $inputCharset input charset (default 'utf-8') * @param $targetCharset target charset (default 'utf-8') * @param $fallbackCharset charset used if input charset not supported by mb * (default 'iso-8859-1') * * @return decoded string **/ function decodeMimeString($mimeStr, $inputCharset='utf-8', $targetCharset='utf-8', $fallbackCharset='iso-8859-1') { if (function_exists('mb_list_encodings') && function_exists('mb_convert_encoding')) { $encodings = $this->mb_list_lowerencodings(); $inputCharset = Toolbox::strtolower($inputCharset); $targetCharset = Toolbox::strtolower($targetCharset); $fallbackCharset = Toolbox::strtolower($fallbackCharset); $decodedStr = ''; $mimeStrs = imap_mime_header_decode($mimeStr); for ($n=sizeOf($mimeStrs),$i=0 ; $i<$n ; $i++) { $mimeStr = $mimeStrs[$i]; $mimeStr->charset = Toolbox::strtolower($mimeStr->charset); if ((($mimeStr->charset == 'default') && ($inputCharset == $targetCharset)) || ($mimeStr->charset == $targetCharset)) { $decodedStr .= $mimeStr->text; } else { if (in_array($mimeStr->charset, $encodings)) { $this->charset = $mimeStr->charset; } // $decodedStr .= mb_convert_encoding($mimeStr->text, $targetCharset, // (in_array($mimeStr->charset, $encodings) // ? $mimeStr->charset : $fallbackCharset)); // Try not to use fallback charset in order to manage encodings not listed by mbstring $decodedStr .= mb_convert_encoding($mimeStr->text, $targetCharset); } } return $decodedStr; } return $mimeStr; } /** * Connect to the mail box **/ function connect() { if (version_compare(PHP_VERSION, '5.3.2', '<') || $this->fields['use_kerberos']) { $this->marubox = @imap_open($this->fields['host'], $this->fields['login'], Toolbox::decrypt($this->fields['passwd'], GLPIKEY), CL_EXPUNGE, 1); } else { $this->marubox = @imap_open($this->fields['host'], $this->fields['login'], Toolbox::decrypt($this->fields['passwd'], GLPIKEY), CL_EXPUNGE, 1, array('DISABLE_AUTHENTICATOR' => 'GSSAPI')); } // Reset errors if ($this->marubox) { // call this to avoid the mailbox is empty error message if (imap_num_msg($this->marubox) == 0) { $errors = imap_errors(); } if ($this->fields['errors'] > 0) { $this->update(array('id' => $this->getID(), 'errors' => 0)); } } else { $this->update(array('id' => $this->getID(), 'errors' => ($this->fields['errors']+1))); } } /** * get the message structure if not already retrieved * * @param $mid : Message ID. **/ function getStructure ($mid) { if (($mid != $this->mid) || !$this->structure) { $this->structure = imap_fetchstructure($this->marubox,$mid); if ($this->structure) { $this->mid = $mid; } } } /** * @param $mid **/ function getAdditionnalHeaders($mid) { $head = array(); $header = explode("\n", imap_fetchheader($this->marubox, $mid)); if (is_array($header) && count($header)) { foreach ($header as $line) { // is line with additional header? if (preg_match("/^X-/i", $line) || preg_match("/^Auto-Submitted/i", $line) || preg_match("/^Received/i", $line)) { // separate name and value if (preg_match("/^([^:]*): (.*)/i", $line, $arg)) { $key = Toolbox::strtolower($arg[1]); if (!isset($head[$key])) { $head[$key] = ''; } else { $head[$key] .= "\n"; } $head[$key] .= trim($arg[2]); } } } } return $head; } /** * This function is use full to Get Header info from particular mail * * @param $mid = Mail Id of a Mailbox * * @return Return Associative array with following keys * subject => Subject of Mail * to => To Address of that mail * toOth => Other To address of mail * toNameOth => To Name of Mail * from => From address of mail * fromName => Form Name of Mail **/ function getHeaders($mid) { // Get Header info $mail_header = imap_header($this->marubox, $mid); $sender = $mail_header->from[0]; $to = $mail_header->to[0]; $date = date("Y-m-d H:i:s", strtotime($mail_header->date)); $mail_details = array(); if ((Toolbox::strtolower($sender->mailbox) != 'mailer-daemon') && (Toolbox::strtolower($sender->mailbox) != 'postmaster')) { // Construct to and cc arrays $tos = array(); $ccs = array(); if (count($mail_header->to)) { foreach ($mail_header->to as $data) { $tos[] = Toolbox::strtolower($data->mailbox).'@'.$data->host; } } if (isset($mail_header->cc) && count($mail_header->cc)) { foreach ($mail_header->cc as $data) { $ccs[] = Toolbox::strtolower($data->mailbox).'@'.$data->host; } } // secu on subject setting if (!isset($mail_header->subject)) { $mail_header->subject = ''; } $mail_details = array('from' => Toolbox::strtolower($sender->mailbox).'@'.$sender->host, 'subject' => $mail_header->subject, 'to' => Toolbox::strtolower($to->mailbox).'@'.$to->host, 'message_id' => $mail_header->message_id, 'tos' => $tos, 'ccs' => $ccs, 'date' => $date); if (isset($mail_header->references)) { $mail_details['references'] = $mail_header->references; } if (isset($mail_header->in_reply_to)) { $mail_details['in_reply_to'] = $mail_header->in_reply_to; } //Add additional headers in X- foreach ($this->getAdditionnalHeaders($mid) as $header => $value) { $mail_details[$header] = $value; } } return $mail_details; } /** * Get Mime type Internal Private Use * * @param $structure mail structure * * @return mime type **/ function get_mime_type(&$structure) { // DO NOT REORDER IT $primary_mime_type = array("TEXT", "MULTIPART", "MESSAGE", "APPLICATION", "AUDIO", "IMAGE", "VIDEO", "OTHER"); if ($structure->subtype) { return $primary_mime_type[intval($structure->type)] . '/' . $structure->subtype; } return "TEXT/PLAIN"; } /** * Get Part Of Message Internal Private Use * * @param $stream An IMAP stream returned by imap_open * @param $msg_number The message number * @param $mime_type mime type of the mail * @param $structure structure of the mail (false by default) * @param $part_number The part number (false by default) * * @return data of false if error **/ function get_part($stream, $msg_number, $mime_type, $structure=false, $part_number=false) { if ($structure) { if ($mime_type == $this->get_mime_type($structure)) { if (!$part_number) { $part_number = "1"; } $text = imap_fetchbody($stream, $msg_number, $part_number); if ($structure->encoding == 3) { $text = imap_base64($text); } else if ($structure->encoding == 4) { $text = imap_qprint($text); } //else { return $text; } if ($structure->subtype && ($structure->subtype == "HTML")) { $text = str_replace("\r", " ", $text); $text = str_replace("\n", " ", $text); } if (count($structure->parameters)>0) { foreach ($structure->parameters as $param) { if ((strtoupper($param->attribute) == 'CHARSET') && function_exists('mb_convert_encoding') && (strtoupper($param->value) != 'UTF-8')) { $text = mb_convert_encoding($text, 'utf-8',$param->value); $this->body_converted = true; } } } return $text; } if ($structure->type == 1) { /* multipart */ $prefix = ""; reset($structure->parts); while (list($index, $sub_structure) = each($structure->parts)) { if ($part_number) { $prefix = $part_number . '.'; } $data = $this->get_part($stream, $msg_number, $mime_type, $sub_structure, $prefix . ($index + 1)); if ($data) { return $data; } } } } return false; } /** * Used to get total unread mail from that mailbox * * @return an integer (Total Mail) **/ function getTotalMails() {//Get Total Number off Unread Email In Mailbox $headers = imap_headers($this->marubox); return count($headers); } /** * GetAttech($mid,$path) / Prefer use getAttached * Save attached file from mail to given path of a particular location * * @param $mid mail id * @param $path path where to save * * @return String of filename with coma separated like a.gif,pio.jpg etc **/ /* * // FUNCTION NEVER USED function GetAttech($mid, $path) { $struckture = imap_fetchstructure($this->marubox,$mid); $ar = ""; if (isset($struckture->parts) && count($struckture->parts)>0) { foreach ($struckture->parts as $key => $value) { $enc = $struckture->parts[$key]->encoding; if ($struckture->parts[$key]->ifdparameters) { $name = $struckture->parts[$key]->dparameters[0]->value; $message = imap_fetchbody($this->marubox,$mid,$key+1); if ($enc == 0) { $message = imap_8bit($message); } if ($enc == 1) { $message = imap_8bit ($message); } if ($enc == 2) { $message = imap_binary ($message); } if ($enc == 3) { $message = imap_base64 ($message); } if ($enc == 4) { $message = quoted_printable_decode($message); } if ($enc == 5) { $message = $message; } $fp = fopen($path.$name,"w"); fwrite($fp,$message); fclose($fp); $ar = $ar.$name.","; } } } $ar = substr($ar, 0, (strlen($ar)-1)); return $ar; } */ /** * Private function : Recursivly get attached documents * * @param $mid message id * @param $path temporary path * @param $maxsize of document to be retrieved * @param $structure of the message or part * @param $part part for recursive * * Result is stored in $this->files **/ function getRecursiveAttached($mid, $path, $maxsize, $structure, $part="") { if ($structure->type == 1) { // multipart reset($structure->parts); while (list($index, $sub) = each($structure->parts)) { $this->getRecursiveAttached($mid, $path, $maxsize, $sub, ($part ? $part.".".($index+1) : ($index+1))); } } else { $filename = ''; if ($structure->ifdparameters) { // get filename of attachment if present // if there are any dparameters present in this part if (count($structure->dparameters) > 0) { foreach ($structure->dparameters as $dparam) { if ((Toolbox::strtoupper($dparam->attribute) == 'NAME') || (Toolbox::strtoupper($dparam->attribute) == 'FILENAME')) { $filename = $dparam->value; } } } } //if no filename found if (empty($filename) && $structure->ifparameters) { // if there are any parameters present in this part if (count($structure->parameters)>0) { foreach ($structure->parameters as $param) { if ((Toolbox::strtoupper($param->attribute) == 'NAME') || (Toolbox::strtoupper($param->attribute) == 'FILENAME')) { $filename = $param->value; } } } } if (empty($filename) && ($structure->type == 5) && $structure->subtype) { // Embeded image come without filename - generate trivial one $filename = "image_$part.".$structure->subtype; } // if no filename found, ignore this part if (empty($filename)) { return false; } //try to avoid conflict between inline image and attachment $i = 2; while(!empty($this->files['filename']['tmp_name']) && in_array($path.$filename, $this->files['filename']['tmp_name'])) { //replace filename with name_(num).EXT by name_(num+1).EXT $new_filename = preg_replace("/(.*)_([0-9])*(\.[a-zA-Z0-9]*)$/", "$1_".$i."$3", $filename); if ($new_filename !== $filename) { $filename = $new_filename; } else { //the previous regex didn't found _num pattern, so add it with this one $filename = preg_replace("/(.*)(\.[a-zA-Z0-9]*)$/", "$1_".$i."$2", $filename); } $i++; } $filename = $this->decodeMimeString($filename); if ($structure->bytes > $maxsize) { $this->addtobody .= "
    ".sprintf(__('%1$s: %2$s'), __('Too large attached file'), sprintf(__('%1$s (%2$s)'), $filename, Toolbox::getSize($structure->bytes))); return false; } if (!Document::isValidDoc($filename)) { //TRANS: %1$s is the filename and %2$s its mime type $this->addtobody .= "
    ".sprintf(__('%1$s: %2$s'), __('Invalid attached file'), sprintf(__('%1$s (%2$s)'), $filename, $this->get_mime_type($structure))); return false; } if ($message = imap_fetchbody($this->marubox, $mid, $part)) { switch ($structure->encoding) { case 1 : $message = imap_8bit($message); break; case 2 : $message = imap_binary($message); break; case 3 : $message = imap_base64($message); break; case 4 : $message = quoted_printable_decode($message); break; } if (file_put_contents($path.$filename, $message)) { $this->files['filename']['size'][] = $structure->bytes; $this->files['filename']['name'][] = $filename; $this->files['filename']['tmp_name'][] = $path.$filename; $this->files['filename']['type'][] = $this->get_mime_type($structure); $this->files['filename']['error'][] = 0; } } // fetchbody } // Single part } /** * Public function : get attached documents in a mail * * @param $mid message id * @param $path temporary path * @param $maxsize of document to be retrieved * * @return array like $_FILES **/ function getAttached($mid, $path, $maxsize) { $this->getStructure($mid); $this->files = array(); $this->addtobody = ""; $this->getRecursiveAttached($mid, $path, $maxsize, $this->structure); return ($this->files); } /** * Get The actual mail content from this mail * * @param $mid : mail Id **/ function getBody($mid) {// Get Message Body $this->getStructure($mid); $body = $this->get_part($this->marubox, $mid, "TEXT/HTML", $this->structure); if ($body == "") { $body = $this->get_part($this->marubox, $mid, "TEXT/PLAIN", $this->structure); } if ($body == "") { return ""; } return $body; } /** * Delete mail from that mail box * * @param $mid String mail Id * @param $folder String folder to move (delete if empty) (default '') * * @return Boolean **/ function deleteMails($mid, $folder='') { if (!empty($folder) && isset($this->fields[$folder]) && !empty($this->fields[$folder])) { $name = mb_convert_encoding($this->fields[$folder], "UTF7-IMAP","UTF-8"); if (imap_mail_move($this->marubox, $mid, $name)) { return true; } // raise an error and fallback to delete //TRANS: %1$s is the name of the folder, %2$s is the name of the receiver trigger_error(sprintf(__('Invalid configuration for %1$s folder in receiver %2$s'), $folder, $this->getName())); } return imap_delete($this->marubox, $mid); } /** * Close The Mail Box **/ function close_mailbox() { imap_close($this->marubox, CL_EXPUNGE); } /** * @param $name **/ static function cronInfo($name) { return array('description' => __('Retrieve email (Mails receivers)'), 'parameter' => __('Number of emails to retrieve')); } /** * Cron action on mailgate : retrieve mail and create tickets * * @param $task * * @return -1 : done but not finish 1 : done with success **/ static function cronMailgate($task) { global $DB; NotImportedEmail::deleteLog(); $query = "SELECT * FROM `glpi_mailcollectors` WHERE `is_active` = '1'"; if ($result = $DB->query($query)) { $max = $task->fields['param']; if ($DB->numrows($result) > 0) { $mc = new self(); while (($max > 0) && ($data = $DB->fetch_assoc($result))) { $mc->maxfetch_emails = $max; $task->log("Collect mails from ".$data["host"]."\n"); $message = $mc->collect($data["id"]); $task->addVolume($mc->fetch_emails); $task->log("$message\n"); $max -= $mc->fetch_emails; } } if ($max == $task->fields['param']) { return 0; // Nothin to do } else if ($max > 0) { return 1; // done } return -1; // still messages to retrieve } return 0; } /** * @param $width **/ function showSystemInformations($width) { global $CFG_GLPI, $DB; // No need to translate, this part always display in english (for copy/paste to forum) echo "Notifications\n"; echo "
    \n \n";
    
          $msg = 'Way of sending emails: ';
          switch($CFG_GLPI['smtp_mode']) {
             case MAIL_MAIL :
                $msg .= 'PHP';
                break;
    
             case MAIL_SMTP :
                $msg .= 'SMTP';
                break;
    
             case MAIL_SMTPSSL :
                $msg .= 'SMTP+SSL';
                break;
    
             case MAIL_SMTPTLS :
                $msg .= 'SMTP+TLS';
                break;
          }
          if ($CFG_GLPI['smtp_mode'] != MAIL_MAIL) {
             $msg .= " (".(empty($CFG_GLPI['smtp_username']) ? 'anonymous' : $CFG_GLPI['smtp_username']).
                        "@".$CFG_GLPI['smtp_host'].")";
          }
          echo wordwrap($msg."\n", $width, "\n\t\t");
          echo "\n
    "; echo "Mails receivers\n"; echo "
    \n \n";
    
          foreach ($DB->request('glpi_mailcollectors') as $mc) {
             $msg  = "Name: '".$mc['name']."'";
             $msg .= " Active: " .($mc['is_active'] ? "Yes" : "No");
             echo wordwrap($msg."\n", $width, "\n\t\t");
    
             $msg  = "\tServer: '". $mc['host']."'";
             $msg .= " Login: '".$mc['login']."'";
             $msg .= " Password: ".(empty($mc['passwd']) ? "No" : "Yes");
             echo wordwrap($msg."\n", $width, "\n\t\t");
          }
          echo "\n
    "; } /** * @param $to (default '') * @param $subject (default '') **/ function sendMailRefusedResponse($to='', $subject='') { global $CFG_GLPI; $mmail = new NotificationMail(); $mmail->AddCustomHeader("Auto-Submitted: auto-replied"); $mmail->SetFrom($CFG_GLPI["admin_email"], $CFG_GLPI["admin_email_name"]); $mmail->AddAddress($to); // Normalized header, no translation $mmail->Subject = 'Re: ' . $subject; $mmail->Body = __("Your email could not be processed.\nIf the problem persists, contact the administrator"). "\n-- \n".$CFG_GLPI["mailing_signature"]; $mmail->Send(); } function title() { global $CFG_GLPI; $buttons = array(); if (countElementsInTable($this->getTable())) { $buttons["notimportedemail.php"] = __('List of not imported emails'); } $errors = getAllDatasFromTable($this->getTable(), '`errors` > 0'); $message = ''; if (count($errors)) { $servers = array(); foreach ($errors as $data) { $this->getFromDB($data['id']); $servers[] = $this->getLink(); } $message = sprintf(__('Receivers in error: %s'), implode(" ", $servers)); } if (count($buttons)) { Html::displayTitle($CFG_GLPI["root_doc"] . "/pics/users.png", _n('Receiver', 'Receivers', 2), $message, $buttons); } } static function getNumberOfMailCollectors() { global $DB; $query = "SELECT COUNT(*) AS cpt FROM `glpi_mailcollectors`"; $result = $DB->query($query); return $DB->result($result, 0, 'cpt'); } /** * @param $name * @param $value (default 0) **/ static function showMaxFilesize($name, $value=0) { $sizes[0] = __('No import'); for ($index=1 ; $index<100 ; $index++) { $sizes[$index*1048576] = sprintf(__('%s Mio'), $index); } Dropdown::showFromArray($name, $sizes, array('value' => $value)); } function cleanDBonPurge() { // mailcollector for RuleMailCollector, _mailgate for RuleTicket Rule::cleanForItemCriteria($this, 'mailcollector'); Rule::cleanForItemCriteria($this, '_mailgate'); } } ?> glpi-0.84.3+dfsg.1/inc/manufacturer.class.php000066400000000000000000000075001226600447100207050ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Manufacturer /// @todo study if we should integrate getHTMLTableHeader and getHTMLTableCellsForItem ... class Manufacturer extends CommonDropdown { static function getTypeName($nb=0) { return _n('Manufacturer', 'Manufacturers', $nb); } /** * @param $old_name Old name (need to be addslashes) * * @return new addslashes name **/ static function processName($old_name) { if ($old_name == null) { return $old_name; } $rulecollection = new RuleDictionnaryManufacturerCollection(); $output = array(); $output = $rulecollection->processAllRules(array("name" => stripslashes($old_name)), $output, array()); if (isset($output["name"])) { return $output["name"]; } return $old_name; } function cleanDBonPurge() { // Rules use manufacturer intread of manufacturers_id Rule::cleanForItemAction($this, 'manufacturer'); } /** * @since version 0.84 * * @param $itemtype * @param $base HTMLTableBase object * @param $super HTMLTableSuperHeader object (default NULL) * @param $father HTMLTableHeader object (default NULL) * @param $options array **/ static function getHTMLTableHeader($itemtype, HTMLTableBase $base, HTMLTableSuperHeader $super=NULL, HTMLTableHeader $father=NULL, array $options=array()) { $column_name = __CLASS__; if (isset($options['dont_display'][$column_name])) { return; } $base->addHeader($column_name, __('Manufacturer'), $super, $father); } /** * @since version 0.84 * * @param $row HTMLTableRow object (default NULL) * @param $item CommonDBTM object (default NULL) * @param $father HTMLTableCell object (default NULL) * @param $options array **/ static function getHTMLTableCellsForItem(HTMLTableRow $row=NULL, CommonDBTM $item=NULL, HTMLTableCell $father=NULL, array $options = array()) { $column_name = __CLASS__; if (isset($options['dont_display'][$column_name])) { return; } if (!empty($item->fields["manufacturers_id"])) { $row->addCell($row->getHeaderByName($column_name), Dropdown::getDropdownName("glpi_manufacturers", $item->fields["manufacturers_id"]), $father); } } } ?> glpi-0.84.3+dfsg.1/inc/migration.class.php000077500000000000000000000447051226600447100202150ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // class Central class Migration { private $change = array(); protected $version; private $deb; private $lastMessage; private $log_errors = 0; private $current_message_area_id; /** * @param $ver number of new version of GLPI **/ function __construct($ver) { $this->deb = time(); $this->setVersion($ver); } /** * @since version 0.84 * * @param $ver number of new version **/ function setVersion($ver) { $this->flushLogDisplayMessage(); $this->version = $ver; $this->addNewMessageArea("migration_message_$ver"); } /** * @since version 0.84 * * @param $id **/ function addNewMessageArea($id) { $this->current_message_area_id = $id; echo "

    ".__('Work in progress...')."

    "; $this->flushLogDisplayMessage(); } /** * Flush previous display message in log file * * @since version 0.84 **/ function flushLogDisplayMessage() { if (isset($this->lastMessage)) { $tps = Html::timestampToString(time() - $this->lastMessage['time']); $this->log($tps . ' for "' . $this->lastMessage['msg'] . '"', false); unset($this->lastMessage); } } /** * Additional message in global message * * @param $msg text to display **/ function displayMessage($msg) { $now = time(); $tps = Html::timestampToString($now-$this->deb); echo "\n"; $this->flushLogDisplayMessage(); $this->lastMessage = array('time' => time(), 'msg' => $msg); Html::glpi_flush(); } /** * log message for this migration * * @since version 0.84 * * @param $message * @param $warning **/ function log($message, $warning) { if ($warning) { $log_file_name = 'warning_during_migration_to_'.$this->version; } else { $log_file_name = 'migration_to_'.$this->version; } // Do not log if more than 3 log error if ($this->log_errors < 3 && !Toolbox::logInFile($log_file_name, $message . ' @ ', true)) { $this->log_errors++; } } /** * Display a title * * @param $title string **/ function displayTitle($title) { echo "

    ".Html::entities_deep($title)."

    "; } /** * Display a Warning * * @param $msg string * @param $red boolean (false by default) **/ function displayWarning($msg, $red=false) { echo ($red ? "

    " : "

    ") . Html::entities_deep($msg) . ($red ? "

    " : "

    "); $this->log($msg, true); } /** * Define field's format * * @param $type string can be bool, string, integer, date, datatime, text, longtext, * autoincrement, char * @param $default_value string new field's default value, * if a specific default value needs to be used * @param $nodefault bolean (false by default) **/ private function fieldFormat($type, $default_value, $nodefault=false) { $format = ''; switch ($type) { case 'bool' : $format = "TINYINT(1) NOT NULL"; if (!$nodefault) { if (is_null($default_value)) { $format .= " DEFAULT '0'"; } else if (in_array($default_value, array('0', '1'))) { $format .= " DEFAULT '$default_value'"; } else { trigger_error(__('default_value must be 0 or 1'), E_USER_ERROR); } } break; case 'char' : $format = "CHAR(1)"; if (!$nodefault) { if (is_null($default_value)) { $format .= " DEFAULT NULL"; } else { $format .= " NOT NULL DEFAULT '$default_value'"; } } break; case 'string' : $format = "VARCHAR(255) COLLATE utf8_unicode_ci"; if (!$nodefault) { if (is_null($default_value)) { $format .= " DEFAULT NULL"; } else { $format .= " NOT NULL DEFAULT '$default_value'"; } } break; case 'integer' : $format = "INT(11) NOT NULL"; if (!$nodefault) { if (is_null($default_value)) { $format .= " DEFAULT '0'"; } else if (is_numeric($default_value)) { $format .= " DEFAULT '$default_value'"; } else { trigger_error(__('default_value must be numeric'), E_USER_ERROR); } } break; case 'date' : $format = "DATE"; if (!$nodefault) { if (is_null($default_value)) { $format.= " DEFAULT NULL"; } else { $format.= " DEFAULT '$default_value'"; } } break; case 'datetime' : $format = "DATETIME"; if (!$nodefault) { if (is_null($default_value)) { $format.= " DEFAULT NULL"; } else { $format.= " DEFAULT '$default_value'"; } } break; case 'text' : $format = "TEXT COLLATE utf8_unicode_ci"; if (!$nodefault) { if (is_null($default_value)) { $format.= " DEFAULT NULL"; } else { $format.= " NOT NULL DEFAULT '$default_value'"; } } break; case 'longtext' : $format = "LONGTEXT COLLATE utf8_unicode_ci"; if (!$nodefault) { if (is_null($default_value)) { $format .= " DEFAULT NULL"; } else { $format .= " NOT NULL DEFAULT '$default_value'"; } } break; // for plugins case 'autoincrement' : $format = "INT(11) NOT NULL AUTO_INCREMENT"; break; default : // for compatibility with old 0.80 migrations $format = $type; break; } return $format; } /** * Add a new GLPI normalized field * * @param $table string * @param $field string to add * @param $type string (see fieldFormat) * @param $options array * - update : if not empty = value of $field (must be protected) * - condition : if needed * - value : default_value new field's default value, if a specific default value needs to be used * - nodefault : do not define default value (default false) * - comment : comment to be added during field creation * - after : where adding the new field **/ function addField($table, $field, $type, $options=array()) { global $DB; $params['update'] = ''; $params['condition'] = ''; $params['value'] = NULL; $params['nodefault'] = false; $params['comment'] = ''; $params['after'] = ''; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $params[$key] = $val; } } $format = $this->fieldFormat($type, $params['value'], $params['nodefault']); if ($params['comment']) { $params['comment'] = " COMMENT '".addslashes($params['comment'])."'"; } if ($params['after']) { $params['after'] = " AFTER `".$params['after']."`"; } if ($format) { if (!FieldExists($table, $field, false)) { $this->change[$table][] = "ADD `$field` $format ".$params['comment'] ." ". $params['after'].""; if (isset($params['update']) && strlen($params['update'])) { $this->migrationOneTable($table); $query = "UPDATE `$table` SET `$field` = ".$params['update']." ". $params['condition'].""; $DB->queryOrDie($query, $this->version." set $field in $table"); } return true; } return false; } } /** * Modify field for migration * * @param $table string * @param $oldfield string old name of the field * @param $newfield string new name of the field * @param $type string (see fieldFormat) * @param $options array * - default_value new field's default value, if a specific default value needs to be used * - comment comment to be added during field creation * - nodefault : do not define default value (default false) **/ function changeField($table, $oldfield, $newfield, $type, $options=array()) { $params['value'] = NULL; $params['nodefault'] = false; $params['comment'] = ''; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $params[$key] = $val; } } $format = $this->fieldFormat($type, $params['value'], $params['nodefault']); if ($params['comment']) { $params['comment'] = " COMMENT '".addslashes($params['comment'])."'"; } if (FieldExists($table, $oldfield, false)) { // in order the function to be replayed // Drop new field if name changed if (($oldfield != $newfield) && FieldExists($table, $newfield)) { $this->change[$table][] = "DROP `$newfield` "; } if ($format) { $this->change[$table][] = "CHANGE `$oldfield` `$newfield` $format ".$params['comment'].""; } return true; } return false; } /** * Drop field for migration * * @param $table string * @param $field string field to drop **/ function dropField($table, $field) { if (FieldExists($table, $field, false)) { $this->change[$table][] = "DROP `$field`"; } } /** * Drop immediatly a table if it exists * * @param table string **/ function dropTable($table) { global $DB; if (TableExists($table)) { $DB->query("DROP TABLE `$table`"); } } /** * Add index for migration * * @param $table string * @param $fields string or array * @param $indexname string if empty =$fields (default '') * @param $type string index or unique (default 'INDEX') * @param $len integer for field length (default 0) **/ function addKey($table, $fields, $indexname='', $type='INDEX', $len=0) { // si pas de nom d'index, on prend celui du ou des champs if (!$indexname) { if (is_array($fields)) { $indexname = implode($fields, "_"); } else { $indexname = $fields; } } if (!isIndex($table,$indexname)) { if (is_array($fields)) { if ($len) { $fields = "`".implode($fields, "`($len), `")."`($len)"; } else { $fields = "`".implode($fields, "`, `")."`"; } } else if ($len) { $fields = "`$fields`($len)"; } else { $fields = "`$fields`"; } $this->change[$table][] = "ADD $type `$indexname` ($fields)"; } } /** * Drop index for migration * * @param $table string * @param $indexname string **/ function dropKey($table, $indexname) { if (isIndex($table,$indexname)) { $this->change[$table][] = "DROP INDEX `$indexname`"; } } /** * Rename table for migration * * @param $oldtable string * @param $newtable string **/ function renameTable($oldtable, $newtable) { global $DB; if (!TableExists("$newtable") && TableExists("$oldtable")) { $query = "RENAME TABLE `$oldtable` TO `$newtable`"; $DB->queryOrDie($query, $this->version." rename $oldtable"); } } /** * Copy table for migration * * @since version 0.84 * * @param $oldtable string The name of the table already inside the database * @param $newtable string The copy of the old table **/ function copyTable($oldtable, $newtable) { global $DB; if (!TableExists($newtable) && TableExists($oldtable)) { // // Try to do a flush tables if RELOAD privileges available // $query = "FLUSH TABLES `$oldtable`, `$newtable`"; // $DB->query($query); $query = "CREATE TABLE `$newtable` LIKE `$oldtable`"; $DB->queryOrDie($query, $this->version." create $newtable"); $query = "INSERT INTO `$newtable` (SELECT * FROM `$oldtable`)"; $DB->queryOrDie($query, $this->version." copy from $oldtable to $newtable"); } } /** * Insert an entry inside a table * * @since version 0.84 * * @param $table string The table to alter * @param $input array The elements to add inside the table * * @return id of the last item inserted by mysql **/ function insertInTable($table, array $input) { global $DB; if (TableExists("$table") && is_array($input) && (count($input) > 0)) { $fields = array(); $values = array(); foreach ($input as $field => $value) { if (FieldExists($table, $field)) { $fields[] = "`$field`"; $values[] = "'$value'"; } } $query = "INSERT INTO `$table` (" . implode(', ', $fields) . ") VALUES (" .implode(', ', $values) . ")"; $DB->queryOrDie($query, $this->version." insert in $table"); return $DB->insert_id(); } } /** * Execute migration for only one table * * @param $table string **/ function migrationOneTable($table) { global $DB; if (isset($this->change[$table])) { $query = "ALTER TABLE `$table` ".implode($this->change[$table], " ,\n")." "; $this->displayMessage( sprintf(__('Change of the database layout - %s'), $table)); $DB->queryOrDie($query, $this->version." multiple alter in $table"); unset($this->change[$table]); } } /** * Execute global migration **/ function executeMigration() { foreach ($this->change as $table => $tab) { $this->migrationOneTable($table); } // end of global message $this->displayMessage(__('Task completed.')); } /** * Register a new rule * * @param $rule Array of fields of glpi_rules * @param $criteria Array of Array of fields of glpi_rulecriterias * @param $actions Array of Array of fields of glpi_ruleactions * * @since version 0.84 * * @return integer : new rule id **/ function createRule(Array $rule, Array $criteria, Array $actions) { global $DB; // Avoid duplicate - Need to be improved using a rule uuid of other if (countElementsInTable('glpi_rules', "`name`='".$DB->escape($rule['name'])."'")) { return 0; } $rule['comment'] = sprintf(__('Automatically generated by GLPI %s'), $this->version); $rule['description'] = ''; // Compute ranking $sql = "SELECT MAX(`ranking`) AS rank FROM `glpi_rules` WHERE `sub_type` = '".$rule['sub_type']."'"; $result = $DB->query($sql); $ranking = 1; if ($DB->numrows($result) > 0) { $datas = $DB->fetch_assoc($result); $ranking = $datas["rank"] + 1; } // The rule itself $fields = "`ranking`"; $values = "'$ranking'"; foreach ($rule as $field => $value) { $fields .= ", `$field`"; $values .= ", '".$DB->escape($value)."'"; } $sql = "INSERT INTO `glpi_rules` ($fields) VALUES ($values)"; $DB->queryOrDie($sql); $rid = $DB->insert_id(); // The rule criteria foreach ($criteria as $criterion) { $fields = "`rules_id`"; $values = "'$rid'"; foreach ($criterion as $field => $value) { $fields .= ", `$field`"; $values .= ", '".$DB->escape($value)."'"; } $sql = "INSERT INTO `glpi_rulecriterias` ($fields) VALUES ($values)"; $DB->queryOrDie($sql); } // The rule criteria actions foreach ($actions as $action) { $fields = "`rules_id`"; $values = "'$rid'"; foreach ($action as $field => $value) { $fields .= ", `$field`"; $values .= ", '".$DB->escape($value)."'"; } $sql = "INSERT INTO `glpi_ruleactions` ($fields) VALUES ($values)"; $DB->queryOrDie($sql); } } } ?> glpi-0.84.3+dfsg.1/inc/monitor.class.php000066400000000000000000000500051226600447100176760ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // CLASSES Monitors class Monitor extends CommonDBTM { // From CommonDBTM public $dohistory = true; static protected $forward_entity_to = array('Infocom', 'ReservationItem'); /** * Name of the type * * @param $nb string number of item in the type **/ static function getTypeName($nb=0) { return _n('Monitor', 'Monitors', $nb); } static function canCreate() { return Session::haveRight('monitor', 'w'); } static function canView() { return Session::haveRight('monitor', 'r'); } /** * @see CommonDBTM::useDeletedToLockIfDynamic() * * @since version 0.84 **/ function useDeletedToLockIfDynamic() { return false; } /** * @see CommonGLPI::defineTabs() **/ function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('Computer_Item', $ong, $options); $this->addStandardTab('Infocom', $ong, $options); $this->addStandardTab('Contract_Item', $ong, $options); $this->addStandardTab('Document_Item', $ong, $options); $this->addStandardTab('Ticket', $ong, $options); $this->addStandardTab('Item_Problem', $ong, $options); $this->addStandardTab('Link', $ong, $options); $this->addStandardTab('Note', $ong, $options); $this->addStandardTab('Reservation', $ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } /** * @see CommonDBTM::prepareInputForAdd() **/ function prepareInputForAdd($input) { if (isset($input["id"]) && ($input["id"] > 0)) { $input["_oldID"] = $input["id"]; } if (isset($input["size"]) && ($input["size"] == '')) { unset($input["size"]); } unset($input['id']); unset($input['withtemplate']); return $input; } function post_addItem() { global $DB; // Manage add from template if (isset($this->input["_oldID"])) { // ADD Infocoms Infocom::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); // ADD Contract Contract_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); // ADD Documents Document_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); // ADD Computers Computer_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); } } function cleanDBonPurge() { global $DB; $query = "SELECT `id` FROM `glpi_computers_items` WHERE `itemtype` = '".$this->getType()."' AND `items_id` = '".$this->fields['id']."'"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { $conn = new Computer_Item(); while ($data = $DB->fetch_assoc($result)) { $data['_no_auto_action'] = true; $conn->delete($data); } } } $ip = new Item_Problem(); $ip->cleanDBonItemDelete(__CLASS__, $this->fields['id']); } /** * Print the monitor form * * @param $ID integer ID of the item * @param $options array * - target filename : where to go when done. * - withtemplate boolean : template or basic item * * @return boolean item found **/ function showForm($ID, $options=array()) { global $CFG_GLPI; $target = $this->getFormURL(); $withtemplate = $this->initForm($ID, $options); $this->showTabs($options); $this->showFormHeader($options); echo ""; //TRANS: %1$s is a string, %2$s a second one without spaces between them : to change for RTL echo "".sprintf(__('%1$s%2$s'), __('Name'), (isset($options['withtemplate']) && $options['withtemplate']?"*":"")); echo ""; echo ""; $objectName = autoName($this->fields["name"], "name", (isset($options['withtemplate']) && ($options['withtemplate'] == 2)), $this->getType(), $this->fields["entities_id"]); Html::autocompletionTextField($this, "name", array('value' => $objectName)); echo ""; echo "".__('Status').""; echo ""; State::dropdown(array('value' => $this->fields["states_id"])); echo ""; echo ""; echo "".__('Location').""; echo ""; Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"])); echo ""; echo "".__('Type').""; echo ""; MonitorType::dropdown(array('value' => $this->fields["monitortypes_id"])); echo ""; echo ""; echo "".__('Technician in charge of the hardware').""; echo ""; User::dropdown(array('name' => 'users_id_tech', 'value' => $this->fields["users_id_tech"], 'right' => 'own_ticket', 'entity' => $this->fields["entities_id"])); echo ""; echo "".__('Manufacturer').""; echo ""; Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"])); echo ""; echo ""; echo "".__('Group in charge of the hardware').""; echo ""; Group::dropdown(array('name' => 'groups_id_tech', 'value' => $this->fields['groups_id_tech'], 'entity' => $this->fields['entities_id'], 'condition' => '`is_assign`')); echo ""; echo "".__('Model').""; echo ""; MonitorModel::dropdown(array('value' => $this->fields["monitormodels_id"])); echo ""; echo ""; echo "".__('Alternate username number').""; echo ""; Html::autocompletionTextField($this, "contact_num"); echo ""; echo "".__('Serial number').""; echo ""; Html::autocompletionTextField($this, "serial"); echo ""; echo ""; echo "".__('Alternate username').""; echo ""; Html::autocompletionTextField($this, "contact"); echo ""; echo "".sprintf(__('%1$s%2$s'), __('Inventory number'), (isset($options['withtemplate']) && $options['withtemplate']?"*":"")). ""; echo ""; $objectName = autoName($this->fields["otherserial"], "otherserial", (isset($options['withtemplate']) && ($options['withtemplate'] == 2)), $this->getType(), $this->fields["entities_id"]); Html::autocompletionTextField($this, "otherserial", array('value' => $objectName)); echo ""; echo ""; echo "".__('User').""; echo ""; User::dropdown(array('value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all')); echo ""; echo "".__('Management type').""; echo ""; Dropdown::showGlobalSwitch($this->fields["id"], array('withtemplate' => $withtemplate, 'value' => $this->fields["is_global"], 'management_restrict' => $CFG_GLPI["monitors_management_restrict"], 'target' => $target)); echo ""; echo ""; echo "".__('Group').""; echo ""; Group::dropdown(array('value' => $this->fields["groups_id"], 'entity' => $this->fields["entities_id"], 'condition' => '`is_itemgroup`')); echo ""; echo "" . __('Comments').""; echo " "; echo ""; echo ""; echo "".__('Size').""; echo ""; Html::autocompletionTextField($this, "size"); echo "\""; echo ""; echo ""; echo "".('Flags').""; echo ""; // micro? echo ""; // sub-d? echo ""; // dvi? echo ""; // hdmi? echo ""; //Displayport echo ""; echo "
    ".__('Microphone').""; Dropdown::showYesNo("have_micro", $this->fields["have_micro"]); // speakers? echo "".__('Speakers').""; Dropdown::showYesNo("have_speaker", $this->fields["have_speaker"]); echo "
    ".__('Sub-D').""; Dropdown::showYesNo("have_subd", $this->fields["have_subd"]); // bnc? echo "".__('BNC').""; Dropdown::showYesNo("have_bnc", $this->fields["have_bnc"]); echo "
    ".__('DVI').""; Dropdown::showYesNo("have_dvi", $this->fields["have_dvi"]); // pivot ? echo "".__('Pivot').""; Dropdown::showYesNo("have_pivot", $this->fields["have_pivot"]); echo "
    ".__('HDMI').""; Dropdown::showYesNo("have_hdmi", $this->fields["have_hdmi"]); echo "".__('DisplayPort').""; Dropdown::showYesNo("have_displayport", $this->fields["have_displayport"]); echo "
    "; echo ""; echo ""; if ((!isset($options['withtemplate']) || ($options['withtemplate'] == 0)) && !empty($this->fields['template_name'])) { echo ""; printf(__('Created from the template %s'), $this->fields['template_name']); echo ""; } else { echo " "; } echo ""; if (isset($options['withtemplate']) && $options['withtemplate']) { //TRANS: %s is the datetime of insertion printf(__('Created on %s'), Html::convDateTime($_SESSION["glpi_currenttime"])); } else { //TRANS: %s is the datetime of insertion printf(__('Last update on %s'), Html::convDateTime($this->fields["date_mod"])); } echo "\n"; $this->showFormButtons($options); $this->addDivForTabs(); return true; } /** * Return the SQL command to retrieve linked object * * @return a SQL command which return a set of (itemtype, items_id) **/ function getSelectLinkedItem() { return "SELECT 'Computer', `computers_id` FROM `glpi_computers_items` WHERE `itemtype` = '".$this->getType()."' AND `items_id` = '" . $this->fields['id']."'"; } /** * @see CommonDBTM::getSpecificMassiveActions() **/ function getSpecificMassiveActions($checkitem=NULL) { $isadmin = static::canUpdate(); $actions = parent::getSpecificMassiveActions($checkitem); if ($isadmin) { $actions['connect'] = _x('button', 'Connect'); $actions['disconnect'] = _x('button', 'Disconnect'); } if (Session::haveRight('transfer','r') && Session::isMultiEntitiesMode() && $isadmin) { $actions['add_transfer_list'] = _x('button', 'Add to transfer list'); } return $actions; } /** * @see CommonDBTM::showSpecificMassiveActionsParameters() **/ function showSpecificMassiveActionsParameters($input=array()) { switch ($input['action']) { case "connect" : case "disconnect" : $ci = new Computer_Item(); return $ci->showSpecificMassiveActionsParameters($input); default : return parent::showSpecificMassiveActionsParameters($input); } return false; } /** * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "connect" : case "disconnect" : $ci = new Computer_Item(); return $ci->doSpecificMassiveActions($input); default : return parent::doSpecificMassiveActions($input); } return $res; } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab+=Location::getSearchOptionsToAdd(); $tab[4]['table'] = 'glpi_monitortypes'; $tab[4]['field'] = 'name'; $tab[4]['name'] = __('Type'); $tab[4]['datatype'] = 'dropdown'; $tab[40]['table'] = 'glpi_monitormodels'; $tab[40]['field'] = 'name'; $tab[40]['name'] = __('Model'); $tab[40]['datatype'] = 'dropdown'; $tab[31]['table'] = 'glpi_states'; $tab[31]['field'] = 'completename'; $tab[31]['name'] = __('Status'); $tab[31]['datatype'] = 'dropdown'; $tab[5]['table'] = $this->getTable(); $tab[5]['field'] = 'serial'; $tab[5]['name'] = __('Serial number'); $tab[5]['datatype'] = 'string'; $tab[6]['table'] = $this->getTable(); $tab[6]['field'] = 'otherserial'; $tab[6]['name'] = __('Inventory number'); $tab[6]['datatype'] = 'string'; $tab[7]['table'] = $this->getTable(); $tab[7]['field'] = 'contact'; $tab[7]['name'] = __('Alternate username'); $tab[7]['datatype'] = 'string'; $tab[8]['table'] = $this->getTable(); $tab[8]['field'] = 'contact_num'; $tab[8]['name'] = __('Alternate username number'); $tab[8]['datatype'] = 'string'; $tab[70]['table'] = 'glpi_users'; $tab[70]['field'] = 'name'; $tab[70]['name'] = __('User'); $tab[70]['datatype'] = 'dropdown'; $tab[70]['right'] = 'all'; $tab[71]['table'] = 'glpi_groups'; $tab[71]['field'] = 'completename'; $tab[71]['name'] = __('Group'); $tab[71]['condition'] = '`is_itemgroup`'; $tab[71]['datatype'] = 'dropdown'; $tab[19]['table'] = $this->getTable(); $tab[19]['field'] = 'date_mod'; $tab[19]['name'] = __('Last update'); $tab[19]['datatype'] = 'datetime'; $tab[19]['massiveaction'] = false; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab[90]['table'] = $this->getTable(); $tab[90]['field'] = 'notepad'; $tab[90]['name'] = __('Notes'); $tab[90]['massiveaction'] = false; $tab[90]['datatype'] = 'text'; $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'size'; $tab[11]['name'] = __('Size'); $tab[11]['datatype'] = 'number'; $tab[41]['table'] = $this->getTable(); $tab[41]['field'] = 'have_micro'; $tab[41]['name'] = __('Microphone'); $tab[41]['datatype'] = 'bool'; $tab[42]['table'] = $this->getTable(); $tab[42]['field'] = 'have_speaker'; $tab[42]['name'] = __('Speakers'); $tab[42]['datatype'] = 'bool'; $tab[43]['table'] = $this->getTable(); $tab[43]['field'] = 'have_subd'; $tab[43]['name'] = __('Sub-D'); $tab[43]['datatype'] = 'bool'; $tab[44]['table'] = $this->getTable(); $tab[44]['field'] = 'have_bnc'; $tab[44]['name'] = ('BNC'); $tab[44]['datatype'] = 'bool'; $tab[45]['table'] = $this->getTable(); $tab[45]['field'] = 'have_dvi'; $tab[45]['name'] = __('DVI'); $tab[45]['datatype'] = 'bool'; $tab[46]['table'] = $this->getTable(); $tab[46]['field'] = 'have_pivot'; $tab[46]['name'] = __('Pivot'); $tab[46]['datatype'] = 'bool'; $tab[47]['table'] = $this->getTable(); $tab[47]['field'] = 'have_hdmi'; $tab[47]['name'] = __('HDMI'); $tab[47]['datatype'] = 'bool'; $tab[48]['table'] = $this->getTable(); $tab[48]['field'] = 'have_displayport'; $tab[48]['name'] = __('DisplayPort'); $tab[48]['datatype'] = 'bool'; $tab[23]['table'] = 'glpi_manufacturers'; $tab[23]['field'] = 'name'; $tab[23]['name'] = __('Manufacturer'); $tab[24]['table'] = 'glpi_users'; $tab[24]['field'] = 'name'; $tab[24]['linkfield'] = 'users_id_tech'; $tab[24]['name'] = __('Technician in charge of the hardware'); $tab[24]['datatype'] = 'dropdown'; $tab[24]['right'] = 'own_ticket'; $tab[49]['table'] = 'glpi_groups'; $tab[49]['field'] = 'completename'; $tab[49]['linkfield'] = 'groups_id_tech'; $tab[49]['name'] = __('Group in charge of the hardware'); $tab[49]['condition'] = '`is_assign`'; $tab[49]['datatype'] = 'dropdown'; $tab[80]['table'] = 'glpi_entities'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = __('Entity'); $tab[80]['massiveaction'] = false; $tab[80]['datatype'] = 'dropdown'; $tab[82]['table'] = $this->getTable(); $tab[82]['field'] = 'is_global'; $tab[82]['name'] = __('Global management'); $tab[82]['datatype'] = 'bool'; $tab[82]['massiveaction'] = false; return $tab; } } ?>glpi-0.84.3+dfsg.1/inc/monitormodel.class.php000066400000000000000000000026701226600447100207240ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class MonitorModel class MonitorModel extends CommonDropdown { var $additional_fields_for_dictionnary = array('manufacturer'); static function getTypeName($nb=0) { return _n('Monitor model', 'Monitor models', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/monitortype.class.php000066400000000000000000000025571226600447100206110ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class MonitorType class MonitorType extends CommonDropdown { static function getTypeName($nb=0) { return _n('Monitor type', 'Monitor types', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/netpoint.class.php000066400000000000000000000360331226600447100200540ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Netpoint class class Netpoint extends CommonDropdown { // From CommonDBTM public $dohistory = true; function getAdditionalFields() { return array(array('name' => 'locations_id', 'label' => __('Location'), 'type' => 'dropdownValue', 'list' => true)); } static function getTypeName($nb=0) { return _n('Network outlet', 'Network outlets', $nb); } static function canCreate() { return Session::haveRight('entity_dropdown', 'w'); } static function canView() { return Session::haveRight('entity_dropdown', 'r'); } /** * Get search function for the class * * @return array of search option **/ function getSearchOptions() { $tab = parent::getSearchOptions(); $tab += Location::getSearchOptionsToAdd(); $tab[3]['datatype'] = 'itemlink'; return $tab; } /** * Handled Multi add item * * @since version 0.83 (before addMulti) * * @param $input array of values **/ function executeAddMulti(array $input) { $this->check(-1, 'w', $input); for ($i=$input["_from"] ; $i<=$input["_to"] ; $i++) { $input["name"] = $input["_before"].$i.$input["_after"]; $this->add($input); } Event::log(0, "dropdown", 5, "setup", sprintf(__('%1$s adds several netpoints'), $_SESSION["glpiname"])); Ajax::refreshDropdownPopupInMainWindow(); } /** * Print out an HTML ""; Ajax::dropdown($use_ajax,"/ajax/dropdownNetpoint.php",$params,$default,$rand); // Display comment if ($display_comment) { Html::showToolTip($comment); $item = new self(); if ($item->canCreate()) { echo "getFormURL(). "?popup=1&rand=$rand' ,'glpipopup', 'height=400, ". "width=1000, top=100, left=100, scrollbars=yes' );w.focus();\">"; } } return $rand; } /** * check if a netpoint already exists (before import) * * @param $input array of value to import (name, locations_id, entities_id) * * @return the ID of the new (or -1 if not found) **/ function findID(array &$input) { global $DB; if (!empty($input["name"])) { $query = "SELECT `id` FROM `".$this->getTable()."` WHERE `name` = '".$input["name"]."' AND `locations_id` = '".(isset($input["locations_id"]) ?$input["locations_id"]:0)."'". getEntitiesRestrictRequest(' AND ', $this->getTable(), '', $input['entities_id'], $this->maybeRecursive()); // Check twin : if ($result_twin = $DB->query($query) ) { if ($DB->numrows($result_twin) > 0) { return $DB->result($result_twin,0,"id"); } } } return -1; } function post_addItem() { $parent = $this->fields['locations_id']; if ($parent) { $changes[0] = '0'; $changes[1] = ''; $changes[2] = addslashes($this->getNameID()); Log::history($parent, 'Location', $changes, $this->getType(), Log::HISTORY_ADD_SUBITEM); } } function post_deleteFromDB() { $parent = $this->fields['locations_id']; if ($parent) { $changes[0] = '0'; $changes[1] = addslashes($this->getNameID()); $changes[2] = ''; Log::history($parent, 'Location', $changes, $this->getType(), Log::HISTORY_DELETE_SUBITEM); } } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { switch ($item->getType()) { case 'Location' : if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(self::getTypeName(2), countElementsInTable($this->getTable(), "locations_id = '".$item->getID()."'")); } return self::getTypeName(2); } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType() == 'Location') { self::showForLocation($item); } return true; } /** * Print the HTML array of the Netpoint associated to a Location * * @param $item Location * * @return Nothing (display) **/ static function showForLocation($item) { global $DB, $CFG_GLPI; $ID = $item->getField('id'); $netpoint = new self(); $item->check($ID, 'r'); $canedit = $item->can($ID, 'w'); if (isset($_POST["start"])) { $start = $_POST["start"]; } else { $start = 0; } $number = countElementsInTable('glpi_netpoints', "`locations_id`='$ID'"); if ($canedit) { echo "
    "; // Minimal form for quick input. echo ""; echo "
    "; echo ""; echo ""; echo ""; echo "\n"; echo "
    "._n('Network outlet', 'Network outlets', 1)."".__('Name').""; Html::autocompletionTextField($item, "name", array('value' => '')); echo ""; echo ""; echo "
    \n"; Html::closeForm(); // Minimal form for massive input. echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; echo "
    "._n('Network outlet', 'Network outlets', 2)."".__('Name').""; echo " "; Dropdown::showInteger('_from', 0, 0, 400); echo " --> "; Dropdown::showInteger('_to', 0, 0, 400); echo " 
    "; echo ""; echo "
    "; echo "
    \n"; Html::closeForm(); echo "
    "; } echo "
    "; if ($number < 1) { echo ""; echo ""; echo ""; echo "
    ".self::getTypeName(1)."".__('No item found')."
    \n"; } else { Html::printAjaxPager(sprintf(__('Network outlets for %s'), $item->getTreeLink()), $start, $number); if ($canedit) { $rand = mt_rand(); Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $paramsma = array('num_displayed' => $_SESSION['glpilist_limit'], 'specific_actions' => array('purge' => _x('button', 'Delete permanently'))); Html::showMassiveActions(__CLASS__, $paramsma); } echo ""; if ($canedit) { echo ""; } echo ""; // Name echo ""; // Comment echo "\n"; $crit = array('locations_id' => $ID, 'ORDER' => 'name', 'START' => $start, 'LIMIT' => $_SESSION['glpilist_limit']); Session::initNavigateListItems('Netpoint', //TRANS : %1$s is the itemtype name, %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), $item->getTypeName(1), $item->getName())); foreach ($DB->request('glpi_netpoints', $crit) as $data) { Session::addToNavigateListItems('Netpoint',$data["id"]); echo ""; if ($canedit) { echo ""; } echo ""; echo ""; echo "\n"; } echo "
    "; Html::checkAllAsCheckbox('mass'.__CLASS__.$rand); echo "".__('Name')."".__('Comments')."
    ".Html::getMassiveActionCheckBox(__CLASS__, $data["id"])."".$data['name']."".$data['comment']."
    \n"; if ($canedit) { $paramsma['ontop'] = false; Html::showMassiveActions(__CLASS__, $paramsma); Html::closeForm(); } Html::printAjaxPager(sprintf(__('Network outlets for %s'), $item->getTreeLink()), $start, $number); } echo "
    \n"; } /** * @since version 0.84 * * @param $itemtype * @param $base HTMLTableBase object * @param $super HTMLTableSuperHeader object (default NULL * @param $father HTMLTableHeader object (default NULL) * @param $options array **/ static function getHTMLTableHeader($itemtype, HTMLTableBase $base, HTMLTableSuperHeader $super=NULL, HTMLTableHeader $father=NULL, array $options=array()) { $column_name = __CLASS__; if (isset($options['dont_display'][$column_name])) { return; } $base->addHeader($column_name, __('Network outlet'), $super, $father); } /** * @since version 0.84 * * @param $row HTMLTableRow object (default NULL) * @param $item CommonDBTM object (default NULL) * @param $father HTMLTableCell object (default NULL) * @param $options array **/ static function getHTMLTableCellsForItem(HTMLTableRow $row=NULL, CommonDBTM $item=NULL, HTMLTableCell $father=NULL, array $options) { $column_name = __CLASS__; if (isset($options['dont_display'][$column_name])) { return; } $row->addCell($row->getHeaderByName($column_name), Dropdown::getDropdownName("glpi_netpoints", $item->fields["netpoints_id"]), $father); } } ?> glpi-0.84.3+dfsg.1/inc/network.class.php000066400000000000000000000025301226600447100177000ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Network class Network extends CommonDropdown { static function getTypeName($nb=0) { return _n('Network', 'Networks', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/networkalias.class.php000066400000000000000000000406031226600447100207150ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class NetworkAlias /// since version 0.84 class NetworkAlias extends FQDNLabel { var $refresh_page = true; // From CommonDBChild static public $itemtype = 'NetworkName'; static public $items_id = 'networknames_id'; public $dohistory = true; static public $checkParentRights = CommonDBConnexity::HAVE_SAME_RIGHT_ON_ITEM; static function getTypeName($nb=0) { return _n('Network alias', 'Network aliases', $nb); } /** * Get the full name (internet name) of a NetworkName * * @param $ID ID of the NetworkName * * @return its internet name, or empty string if invalid NetworkName **/ static function getInternetNameFromID($ID) { $networkAlias = new self(); if ($networkalias->can($ID, 'r')) return FQDNLabel::getInternetNameFromLabelAndDomainID($this->fields["name"], $this->fields["fqdns_id"]); return ""; } /** * Print the network alias form * * @param $ID integer ID of the item * @param $options array * - target for the Form * - withtemplate template or basic computer * * @return Nothing (display) **/ function showForm ($ID, $options=array()) { // Show only simple form to add / edit $showsimple = false; if (isset($options['parent'])) { $showsimple = true; $options['networknames_id'] = $options['parent']->getID(); } $this->initForm($ID, $options); $recursiveItems = $this->recursivelyGetItems(); if (count($recursiveItems) == 0) { return false; } $lastItem = $recursiveItems[count($recursiveItems) - 1]; if (!$showsimple) { $this->showTabs(); } $options['entities_id'] = $lastItem->getField('entities_id'); $this->showFormHeader($options); echo ""; $this->displayRecursiveItems($recursiveItems, 'Type'); echo " :\n"; if (!($ID > 0)) { echo "\n"; } $this->displayRecursiveItems($recursiveItems, (isset($options['popup']) ? "Name" : "Link")); echo "" . __('Name') . "\n"; Html::autocompletionTextField($this, "name"); echo "\n"; echo ""; echo "".FQDN::getTypeName().""; Dropdown::show(getItemTypeForTable(getTableNameForForeignKeyField("fqdns_id")), array('value' => $this->fields["fqdns_id"], 'name' => 'fqdns_id', 'entity' => $this->getEntityID(), 'displaywith' => array('view'))); echo ""; echo "".__('Comments').""; echo "\n"; echo "\n"; $this->showFormButtons($options); if (!$showsimple) { $this->addDivForTabs(); } return true; } /** * @since version 0.84 * * @param $itemtype * @param $base HTMLTableBase object * @param $super HTMLTableSuperHeader object (default NULL) * @param $father HTMLTableHeader object (default NULL) * @param $options array **/ static function getHTMLTableHeader($itemtype, HTMLTableBase $base, HTMLTableSuperHeader $super=NULL, HTMLTableHeader $father=NULL, array $options=array()) { $column_name = __CLASS__; if (isset($options['dont_display'][$column_name])) { return; } if ($itemtype != 'NetworkName') { return; } $content = self::getTypeName(); if (isset($options['column_links'][$column_name])) { $content = "$content"; } $this_header = $base->addHeader($column_name, $content, $super, $father); $this_header->setItemType('NetworkAlias'); } /** * @since version 0.84 * * @param $row HTMLTableRow object (default NULL) * @param $item CommonDBTM object (default NULL) * @param $father HTMLTableCell object (default NULL) * @param $options array **/ static function getHTMLTableCellsForItem(HTMLTableRow $row=NULL, CommonDBTM $item=NULL, HTMLTableCell $father=NULL, array $options=array()) { global $DB, $CFG_GLPI; if (empty($item)) { if (empty($father)) { return; } $item = $father->getItem(); } if ($item->getType() != 'NetworkName') { return; } $column_name = __CLASS__; if (isset($options['dont_display'][$column_name])) { return; } $header = $row->getGroup()->getHeaderByName('Internet', $column_name); if (!$header) { return; } $canedit = (isset($options['canedit']) && $options['canedit']); $createRow = (isset($options['createRow']) && $options['createRow']); $options['createRow'] = false; $query = "SELECT `id` FROM `glpi_networkaliases` WHERE `networknames_id` = '".$item->getID()."'"; $alias = new self(); foreach ($DB->request($query) as $line) { if ($alias->getFromDB($line["id"])) { if ($createRow) { $row = $row->createRow(); } $content = "".$alias->getInternetName().""; $row->addCell($header, $content, $father, $alias); } } } /** * \brief Show aliases for an item from its form * Beware that the rendering can be different if readden from direct item form (ie : add new * NetworkAlias, remove, ...) or if readden from item of the item (for instance from the computer * form through NetworkPort::ShowForItem and NetworkName::ShowForItem). * * @param $item NetworkName object * @param $withtemplate integer withtemplate param (default 0) **/ static function showForNetworkName(NetworkName $item, $withtemplate=0) { global $DB, $CFG_GLPI; $ID = $item->getID(); if (!$item->can($ID, 'r')) { return false; } $canedit = $item->can($ID, 'w'); $rand = mt_rand(); $query = "SELECT * FROM `glpi_networkaliases` WHERE `networknames_id` = '$ID'"; $result = $DB->query($query); $aliases = array(); if ($number = $DB->numrows($result)) { while ($line = $DB->fetch_assoc($result)) { $aliases[$line["id"]] = $line; } } if ($canedit) { echo "\n
    "; echo ""; echo ""; echo __('Add a network alias')."\n"; echo "
    \n"; } echo "
    "; echo "
    "; if ($canedit && $number) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $massiveactionparams = array('num_displayed' => $number); Html::showMassiveActions(__CLASS__, $massiveactionparams); } echo ""; echo ""; if ($canedit && $number) { echo ""; } echo ""; echo ""; echo ""; echo ""; $used = array(); foreach ($aliases as $data) { $showviewjs = ($canedit ? "style='cursor:pointer' onClick=\"viewEditAlias".$data['id']."$rand();\"" : ''); echo ""; if ($canedit) { echo ""; } $name = $data["name"]; if ($_SESSION["glpiis_ids_visible"] || empty($data["name"])) { $name = sprintf(__('%1$s (%2$s)'), $name, $data["id"]); } echo ""; echo ""; } echo "
    ".Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand)."".__('Name').""._n('Internet domain', 'Internet domains', 1)."".__('Entity')."
    "; Html::showMassiveActionCheckBox(__CLASS__, $data["id"]); echo ""; if ($canedit) { echo "\n\n"; } echo "".$name.""; echo "".Dropdown::getDropdownName("glpi_fqdns", $data["fqdns_id"]); echo "".Dropdown::getDropdownName("glpi_entities", $data["entities_id"]); echo "
    "; if ($canedit && $number) { $massiveactionparams['ontop'] = false; Html::showMassiveActions(__CLASS__, $massiveactionparams); Html::closeForm(); } echo "
    "; } /** * Show the aliases contained by the alias * * @param $item the FQDN owning the aliases * @param $withtemplate integer withtemplate param **/ static function showForFQDN(CommonGLPI $item, $withtemplate) { global $DB; $alias = new self(); $address = new NetworkName(); $item->check($item->getID(), 'r'); $canedit = $item->can($item->getID(), 'w'); if (isset($_POST["start"])) { $start = $_POST["start"]; } else { $start = 0; } if (!empty($_POST["order"])) { $order = $_POST["order"]; } else { $order = "alias"; } $number = countElementsInTable($alias->getTable(), "`fqdns_id`='".$item->getID()."'"); echo "
    "; if ($number < 1) { echo ""; echo ""; echo "
    ".self::getTypeName(1)."".__('No item found')."
    \n"; } else { Html::printAjaxPager(self::getTypeName($number), $start, $number); echo ""; echo ""; // Alias echo ""; echo ""; echo "\n"; Session::initNavigateListItems($item->getType(), //TRANS : %1$s is the itemtype name, %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), self::getTypeName(1), $item->fields['name'])); $query = "SELECT `glpi_networkaliases`.`id` AS alias_id, `glpi_networkaliases`.`name` AS alias, `glpi_networknames`.`id` AS address_id, `glpi_networkaliases`.`comment` AS comment FROM `glpi_networkaliases`, `glpi_networknames` WHERE `glpi_networkaliases`.`fqdns_id` = '".$item->getID()."' AND `glpi_networknames`.`id` = `glpi_networkaliases`.`networknames_id` ORDER BY `$order` LIMIT ".$_SESSION['glpilist_limit']." OFFSET $start"; foreach ($DB->request($query) as $data) { Session::addToNavigateListItems($alias->getType(),$data["alias_id"]); if ($address->getFromDB($data["address_id"])) { echo ""; echo ""; echo ""; echo ""; echo "\n"; } } echo "
    ".self::getTypeName(1). "".__("Computer's name"). "".__('Comments')."
    " . $data['alias']. "".$address->getInternetName(). "".$data['comment']."
    \n"; Html::printAjaxPager(self::getTypeName($number), $start, $number); } echo "
    \n"; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($item->getType()) { case 'NetworkName' : self::showForNetworkName($item, $withtemplate); break; case 'FQDN' : self::showForFQDN($item, $withtemplate); break; } } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if ($item->getID() && $item->can($item->getField('id'),'r')) { if ($_SESSION['glpishow_count_on_tabs']) { switch ($item->getType()) { case 'NetworkName' : $numberElements = countElementsInTable($this->getTable(), "networknames_id='".$item->getID()."'"); break; case 'FQDN' : $numberElements = countElementsInTable($this->getTable(), "fqdns_id='".$item->getID()."'"); } return self::createTabEntry(self::getTypeName(2), $numberElements); } return self::getTypeName(2); } return ''; } function getSearchOptions() { $tab = parent::getSearchOptions(); $tab[12]['table'] = 'glpi_fqdns'; $tab[12]['field'] = 'fqdn'; $tab[12]['name'] = FQDN::getTypeName(1); $tab[12]['datatype'] = 'string'; $tab[20]['table'] = 'glpi_networknames'; $tab[20]['field'] = 'name'; $tab[20]['name'] = NetworkName::getTypeName(1); $tab[20]['massiveaction'] = false; $tab[20]['datatype'] = 'dropdown'; return $tab; } } ?> glpi-0.84.3+dfsg.1/inc/networkequipment.class.php000066400000000000000000000454251226600447100216420ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // CLASSES Networking class NetworkEquipment extends CommonDBTM { // From CommonDBTM public $dohistory = true; static protected $forward_entity_to = array('Infocom', 'NetworkPort', 'ReservationItem'); /** * Name of the type * * @param $nb integer number of item in the type (default 0) **/ static function getTypeName($nb=0) { return _n('Network device', 'Network devices', $nb); } static function canCreate() { return Session::haveRight('networking', 'w'); } static function canView() { return Session::haveRight('networking', 'r'); } /** * @since version 0.84 * * @see CommonDBTM::cleanDBonPurge() **/ function cleanDBonPurge() { $ip = new Item_Problem(); $ip->cleanDBonItemDelete(__CLASS__, $this->fields['id']); } /** * @see CommonDBTM::useDeletedToLockIfDynamic() * * @since version 0.84 **/ function useDeletedToLockIfDynamic() { return false; } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('NetworkPort', $ong, $options); $this->addStandardTab('NetworkName', $ong, $options); $this->addStandardTab('Infocom', $ong, $options); $this->addStandardTab('Contract_Item', $ong, $options); $this->addStandardTab('Document_Item', $ong, $options); $this->addStandardTab('Ticket', $ong, $options); $this->addStandardTab('Item_Problem', $ong, $options); $this->addStandardTab('Link', $ong, $options); $this->addStandardTab('Note', $ong, $options); $this->addStandardTab('Reservation', $ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } function prepareInputForAdd($input) { if (isset($input["id"]) && ($input["id"] > 0)) { $input["_oldID"] = $input["id"]; } unset($input['id']); unset($input['withtemplate']); return $input; } function post_addItem() { global $DB; // Manage add from template if (isset($this->input["_oldID"])) { // ADD Infocoms Infocom::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); // ADD Ports NetworkPort::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); // ADD Contract Contract_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); // ADD Documents Document_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); } } /** * Can I change recursive flag to false * check if there is "linked" object in another entity * * Overloaded from CommonDBTM * * @return booleen **/ function canUnrecurs() { global $DB; $ID = $this->fields['id']; if (($ID < 0) || !$this->fields['is_recursive']) { return true; } if (!parent::canUnrecurs()) { return false; } $entities = "(".$this->fields['entities_id']; foreach (getAncestorsOf("glpi_entities", $this->fields['entities_id']) as $papa) { $entities .= ",$papa"; } $entities .= ")"; // RELATION : networking -> _port -> _wire -> _port -> device // Evaluate connection in the 2 ways for ($tabend=array("networkports_id_1" => "networkports_id_2", "networkports_id_2" => "networkports_id_1") ; list($enda,$endb)=each($tabend) ; ) { $sql = "SELECT `itemtype`, GROUP_CONCAT(DISTINCT `items_id`) AS ids FROM `glpi_networkports_networkports`, `glpi_networkports` WHERE `glpi_networkports_networkports`.`$endb` = `glpi_networkports`.`id` AND `glpi_networkports_networkports`.`$enda` IN (SELECT `id` FROM `glpi_networkports` WHERE `itemtype` = '".$this->getType()."' AND `items_id` = '$ID') GROUP BY `itemtype`"; $res = $DB->query($sql); if ($res) { while ($data = $DB->fetch_assoc($res)) { $itemtable = getTableForItemType($data["itemtype"]); if ($item = getItemForItemtype($data["itemtype"])) { // For each itemtype which are entity dependant if ($item->isEntityAssign()) { if (countElementsInTable($itemtable, "id IN (".$data["ids"].") AND entities_id NOT IN $entities") > 0) { return false; } } } } } } return true; } /** * Print the networking form * * @param $ID integer ID of the item * @param $options array * - target filename : where to go when done. * - withtemplate boolean : template or basic item * *@return boolean item found **/ function showForm($ID, $options=array()) { $this->initForm($ID, $options); $this->showTabs($options); $this->showFormHeader($options); echo ""; //TRANS: %1$s is a string, %2$s a second one without spaces between them : to change for RTL echo "".sprintf(__('%1$s%2$s'),__('Name'), (isset($options['withtemplate']) && $options['withtemplate']?"*":"")). ""; echo ""; $objectName = autoName($this->fields["name"], "name", (isset($options['withtemplate']) && ($options['withtemplate'] == 2)), $this->getType(), $this->fields["entities_id"]); Html::autocompletionTextField($this, "name", array('value' => $objectName)); echo ""; echo "".__('Status').""; echo ""; State::dropdown(array('value' => $this->fields["states_id"])); echo ""; echo ""; echo "".__('Location').""; echo ""; Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"])); echo ""; echo "".__('Type').""; echo ""; NetworkEquipmentType::dropdown(array('value' => $this->fields["networkequipmenttypes_id"])); echo ""; echo ""; echo "".__('Technician in charge of the hardware').""; echo ""; User::dropdown(array('name' => 'users_id_tech', 'value' => $this->fields["users_id_tech"], 'right' => 'own_ticket', 'entity' => $this->fields["entities_id"])); echo ""; echo "".__('Manufacturer').""; echo ""; Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"])); echo ""; echo ""; echo "".__('Group in charge of the hardware').""; echo ""; Group::dropdown(array('name' => 'groups_id_tech', 'value' => $this->fields['groups_id_tech'], 'entity' => $this->fields['entities_id'], 'condition' => '`is_assign`')); echo ""; echo "".__('Model').""; echo ""; NetworkEquipmentModel::dropdown(array('value' => $this->fields["networkequipmentmodels_id"])); echo ""; echo ""; echo "".__('Alternate username number').""; echo ""; Html::autocompletionTextField($this, "contact_num"); echo ""; echo "".__('Serial number').""; echo ""; Html::autocompletionTextField($this, "serial"); echo ""; echo ""; echo "".__('Alternate username').""; echo ""; Html::autocompletionTextField($this, "contact"); echo ""; echo "".sprintf(__('%1$s%2$s'), __('Inventory number'), (isset($options['withtemplate']) && $options['withtemplate']?"*":"")). ""; echo ""; $objectName = autoName($this->fields["otherserial"], "otherserial", (isset($options['withtemplate']) && ($options['withtemplate'] == 2)), $this->getType(), $this->fields["entities_id"]); Html::autocompletionTextField($this, "otherserial", array('value' => $objectName)); echo ""; echo ""; echo "".__('User').""; echo ""; User::dropdown(array('value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all')); echo ""; echo "".__('Network').""; echo ""; Network::dropdown(array('value' => $this->fields["networks_id"])); echo ""; // Display auto inventory informations $rowspan = 6; $inventory_show = false; if (!empty($ID) && $this->fields["is_dynamic"]) { $inventory_show = true; $rowspan -= 3; } echo ""; echo "".__('Group').""; echo ""; Group::dropdown(array('value' => $this->fields["groups_id"], 'entity' => $this->fields["entities_id"], 'condition' => '`is_itemgroup`')); echo ""; echo "".__('Comments').""; echo " "; echo ""; echo "".__('Domain').""; echo ""; Domain::dropdown(array('value' => $this->fields["domains_id"])); echo ""; echo ""; echo "".__('The MAC address and the IP of the equipment are included in an aggregated network port').""; echo "\n"; echo ""; echo ""._n('Firmware', 'Firmwares', 1).""; echo ""; NetworkEquipmentFirmware::dropdown(array('value' => $this->fields["networkequipmentfirmwares_id"])); echo ""; if ($inventory_show) { echo ""; _e('Automatic inventory'); echo ""; echo ""; Plugin::doHook("autoinventory_information", $this); echo ""; } echo ""; echo ""; echo "".sprintf(__('%1$s (%2$s)'),__('Memory'),__('Mio')).""; echo ""; Html::autocompletionTextField($this, "ram"); echo ""; echo ""; echo ""; if ((!isset($options['withtemplate']) || ($options['withtemplate'] == 0)) && !empty($this->fields['template_name'])) { echo ""; printf(__('Created from the template %s'), $this->fields['template_name']); echo ""; } else { echo " "; } echo ""; if (isset($options['withtemplate']) && $options['withtemplate']) { //TRANS: %s is the datetime of insertion printf(__('Created on %s'), Html::convDateTime($_SESSION["glpi_currenttime"])); } else { //TRANS: %s is the datetime of insertion printf(__('Last update on %s'), Html::convDateTime($this->fields["date_mod"])); } echo "\n"; $this->showFormButtons($options); $this->addDivForTabs(); return true; } /** * @see CommonDBTM::getSpecificMassiveActions() **/ function getSpecificMassiveActions($checkitem=NULL) { $isadmin = static::canUpdate(); $actions = parent::getSpecificMassiveActions($checkitem); if (Session::haveRight('transfer','r') && Session::isMultiEntitiesMode() && $isadmin) { $actions['add_transfer_list'] = _x('button', 'Add to transfer list'); } return $actions; } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab += Location::getSearchOptionsToAdd(); $tab[4]['table'] = 'glpi_networkequipmenttypes'; $tab[4]['field'] = 'name'; $tab[4]['name'] = __('Type'); $tab[4]['datatype'] = 'dropdown'; $tab[40]['table'] = 'glpi_networkequipmentmodels'; $tab[40]['field'] = 'name'; $tab[40]['name'] = __('Model'); $tab[40]['datatype'] = 'dropdown'; $tab[31]['table'] = 'glpi_states'; $tab[31]['field'] = 'completename'; $tab[31]['name'] = __('Status'); $tab[31]['datatype'] = 'dropdown'; $tab[5]['table'] = $this->getTable(); $tab[5]['field'] = 'serial'; $tab[5]['name'] = __('Serial number'); $tab[5]['datatype'] = 'string'; $tab[6]['table'] = $this->getTable(); $tab[6]['field'] = 'otherserial'; $tab[6]['name'] = __('Inventory number'); $tab[6]['datatype'] = 'string'; $tab[7]['table'] = $this->getTable(); $tab[7]['field'] = 'contact'; $tab[7]['name'] = __('Alternate username'); $tab[7]['datatype'] = 'string'; $tab[8]['table'] = $this->getTable(); $tab[8]['field'] = 'contact_num'; $tab[8]['name'] = __('Alternate username number'); $tab[8]['datatype'] = 'string'; $tab[70]['table'] = 'glpi_users'; $tab[70]['field'] = 'name'; $tab[70]['name'] = __('User'); $tab[70]['datatype'] = 'dropdown'; $tab[70]['right'] = 'all'; $tab[71]['table'] = 'glpi_groups'; $tab[71]['field'] = 'completename'; $tab[71]['name'] = __('Group'); $tab[71]['datatype'] = 'dropdown'; $tab[71]['condition'] = '`is_itemgroup`'; $tab[19]['table'] = $this->getTable(); $tab[19]['field'] = 'date_mod'; $tab[19]['name'] = __('Last update'); $tab[19]['datatype'] = 'datetime'; $tab[19]['massiveaction'] = false; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab[90]['table'] = $this->getTable(); $tab[90]['field'] = 'notepad'; $tab[90]['name'] = __('Notes'); $tab[90]['massiveaction'] = false; $tab[90]['datatype'] = 'text'; $tab[11]['table'] = 'glpi_networkequipmentfirmwares'; $tab[11]['field'] = 'name'; $tab[11]['name'] = _n('Firmware', 'Firmwares', 1); $tab[11]['datatype'] = 'dropdown'; $tab[14]['table'] = $this->getTable(); $tab[14]['field'] = 'ram'; $tab[14]['name'] = sprintf(__('%1$s (%2$s)'),__('Memory'),__('Mio')); $tab[14]['datatype'] = 'number'; $tab[32]['table'] = 'glpi_networks'; $tab[32]['field'] = 'name'; $tab[32]['name'] = __('Network'); $tab[32]['datatype'] = 'dropdown'; $tab[33]['table'] = 'glpi_domains'; $tab[33]['field'] = 'name'; $tab[33]['name'] = __('Domain'); $tab[33]['datatype'] = 'dropdown'; $tab[23]['table'] = 'glpi_manufacturers'; $tab[23]['field'] = 'name'; $tab[23]['name'] = __('Manufacturer'); $tab[23]['datatype'] = 'dropdown'; $tab[24]['table'] = 'glpi_users'; $tab[24]['field'] = 'name'; $tab[24]['linkfield'] = 'users_id_tech'; $tab[24]['name'] = __('Technician in charge of the hardware'); $tab[24]['datatype'] = 'dropdown'; $tab[24]['right'] = 'own_ticket'; $tab[49]['table'] = 'glpi_groups'; $tab[49]['field'] = 'completename'; $tab[49]['linkfield'] = 'groups_id_tech'; $tab[49]['name'] = __('Group in charge of the hardware'); $tab[49]['condition'] = '`is_assign`'; $tab[49]['datatype'] = 'dropdown'; $tab[80]['table'] = 'glpi_entities'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = __('Entity'); $tab[80]['massiveaction'] = false; $tab[80]['datatype'] = 'dropdown'; $tab[86]['table'] = $this->getTable(); $tab[86]['field'] = 'is_recursive'; $tab[86]['name'] = __('Child entities'); $tab[86]['datatype'] = 'bool'; return $tab; } } ?> glpi-0.84.3+dfsg.1/inc/networkequipmentfirmware.class.php000066400000000000000000000026151226600447100233710ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class NetworkEquipmentFirmware class NetworkEquipmentFirmware extends CommonDropdown { static function getTypeName($nb=0) { return _n('Firmware', 'Firmwares', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/networkequipmentmodel.class.php000066400000000000000000000027541226600447100226610ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class NetworkEquipmentModel class NetworkEquipmentModel extends CommonDropdown { var $additional_fields_for_dictionnary = array('manufacturer'); static function getTypeName($nb=0) { return _n('Networking equipment model', 'Networking equipment models', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/networkequipmenttype.class.php000066400000000000000000000026441226600447100225400ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class NetworkEquipementType class NetworkEquipmentType extends CommonDropdown { static function getTypeName($nb=0) { return _n('Networking equipment type', 'Networking equipment types', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/networkinterface.class.php000066400000000000000000000026071226600447100215660ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class NetworkInterface class NetworkInterface extends CommonDropdown { static function getTypeName($nb=0) { return _n('Network interface', 'Network interfaces', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/networkname.class.php000066400000000000000000000765351226600447100205610ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class NetworkName : represent the internet name of an element. It is compose of the name itself, /// its domain and one or several IP addresses (IPv4 and/or IPv6). /// An address can be affected to an item, or can be "free" to be reuse by another item (for /// instance, in case of maintenance, when you change the network card of a computer, but not its /// network information /// since version 0.84 class NetworkName extends FQDNLabel { // From CommonDBChild static public $itemtype = 'itemtype'; static public $items_id = 'items_id'; public $dohistory = true; static protected $forward_entity_to = array('IPAddress', 'NetworkAlias'); static public $canDeleteOnItemClean = false; static public $checkParentRights = CommonDBConnexity::HAVE_SAME_RIGHT_ON_ITEM; static public $mustBeAttached = false; static function canCreate() { return (Session::haveRight('internet', 'w') && parent::canCreate()); } static function canView() { return (Session::haveRight('internet', 'r') && parent::canView()); } static function canUpdate() { return (Session::haveRight('internet', 'w') && parent::canUpdate()); } static function canDelete() { return (Session::haveRight('internet', 'w') && parent::canDelete()); } static function getTypeName($nb=0) { return _n('Network name', 'Network names', $nb); } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('NetworkAlias', $ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } /** * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case 'unaffect' : foreach ($input["item"] as $key => $val) { if ($val == 1) { if ($this->can($key,'w')) { if (NetworkName::unaffectAddressByID($key)) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } } break; default : return parent::doSpecificMassiveActions($input); } return $res; } /** * Print the network name form * * @param $ID integer ID of the item * @param $options array * - target for the Form * - withtemplate template or basic computer * *@return Nothing (display) **/ function showForm($ID, $options=array()) { global $CFG_GLPI; $this->initForm($ID, $options); $recursiveItems = $this->recursivelyGetItems(); if (count($recursiveItems) != 0) { $lastItem = $recursiveItems[count($recursiveItems) - 1]; $options['entities_id'] = $lastItem->getField('entities_id'); } $this->showTabs(); $this->showFormHeader($options); echo ""; if (count($recursiveItems) > 0) { $this->displayRecursiveItems($recursiveItems, 'Type'); } echo "\n"; if (!($ID > 0)) { echo "\n"; echo "\n"; } $this->displayRecursiveItems($recursiveItems, "Link"); if (count($recursiveItems) > 0) { echo " - "; } echo "\n"; echo ""; echo "" . __('Name') . "\n"; Html::autocompletionTextField($this, "name"); echo "\n"; echo "".FQDN::getTypeName(1).""; Dropdown::show(getItemTypeForTable(getTableNameForForeignKeyField("fqdns_id")), array('value' => $this->fields["fqdns_id"], 'name' => 'fqdns_id', 'entity' => $this->getEntityID(), 'displaywith' => array('view'))); echo "\n\n"; echo ""; echo "".IPAddress::getTypeName(2); IPAddress::showAddChildButtonForItemForm($this, '_ipaddresses'); echo ""; echo ""; IPAddress::showChildsForItemForm($this, '_ipaddresses'); echo "\n"; echo "".__('Comments').""; echo "\n"; echo ""; echo ""; echo "".IPNetwork::getTypeName(2).""; _e('IP network is not included in the database. However, you can see current available networks.'); echo ""; echo " "; IPNetwork::showIPNetworkProperties($this->getEntityID()); echo "\n"; $this->showFormButtons($options); $this->addDivForTabs(); return true; } function getSearchOptions() { $tab = parent::getSearchOptions(); $tab[12]['table'] = 'glpi_fqdns'; $tab[12]['field'] = 'fqdn'; $tab[12]['name'] = FQDN::getTypeName(1); $tab[12]['datatype'] = 'dropdown'; $tab[13]['table'] = 'glpi_ipaddresses'; $tab[13]['field'] = 'name'; $tab[13]['name'] = IPAddress::getTypeName(1); $tab[13]['joinparams'] = array('jointype' => 'itemtype_item'); $tab[13]['forcegroupby'] = true; $tab[13]['massiveaction'] = false; $tab[13]['datatype'] = 'dropdown'; $tab[20]['table'] = $this->getTable(); $tab[20]['field'] = 'itemtype'; $tab[20]['name'] = __('Type'); $tab[20]['datatype'] = 'itemtype'; $tab[20]['massiveaction'] = false; $tab[21]['table'] = $this->getTable(); $tab[21]['field'] = 'items_id'; $tab[21]['name'] = __('ID'); $tab[21]['datatype'] = 'integer'; $tab[21]['massiveaction'] = false; return $tab; } /** * @param $tab array the array to fill * @param $joinparams array * @param $itemtype **/ static function getSearchOptionsToAdd(array &$tab, array $joinparams, $itemtype) { $tab[126]['table'] = 'glpi_ipaddresses'; $tab[126]['field'] = 'name'; $tab[126]['name'] = __('IP'); $tab[126]['forcegroupby'] = true; $tab[126]['massiveaction'] = false; $tab[126]['joinparams'] = array('jointype' => 'itemtype_item', 'condition' => 'AND NOT NEWTABLE.`is_deleted`', 'specific_itemtype' => 'NetworkName', 'beforejoin' => array('table' => 'glpi_networknames', 'joinparams' => $joinparams)); $tab[127]['table'] = 'glpi_networknames'; $tab[127]['field'] = 'name'; $tab[127]['name'] = self::getTypeName(2); $tab[127]['forcegroupby'] = true; $tab[127]['massiveaction'] = false; $tab[127]['joinparams'] = $joinparams; $tab[128]['table'] = 'glpi_networkaliases'; $tab[128]['field'] = 'name'; $tab[128]['name'] = NetworkAlias::getTypeName(2); $tab[128]['forcegroupby'] = true; $tab[128]['massiveaction'] = false; $tab[128]['joinparams'] = array('jointype' => 'child', 'beforejoin' => array('table' => 'glpi_networknames', 'joinparams' => $joinparams)); } /** * \brief Update IPAddress database * Update IPAddress database to remove old IPs and add new ones. **/ function post_workOnItem() { if ((isset($this->input['_ipaddresses'])) && (is_array($this->input['_ipaddresses']))) { $input = array('itemtype' => 'NetworkName', 'items_id' => $this->getID()); foreach ($this->input['_ipaddresses'] as $id => $ip) { $ipaddress = new IPAddress(); $input['name'] = $ip; if ($id < 0) { if (!empty($ip)) { $ipaddress->add($input); } } else { if (!empty($ip)) { $input['id'] = $id; $ipaddress->update($input); unset($input['id']); } else { $ipaddress->delete(array('id' => $id)); } } } } } function post_addItem() { $this->post_workOnItem(); parent::post_addItem(); } function post_updateItem($history=1) { $this->post_workOnItem(); parent::post_updateItem($history); } function cleanDBonPurge() { $alias = new NetworkAlias(); $alias->cleanDBonItemDelete($this->getType(), $this->GetID()); $ipAddress = new IPAddress(); $ipAddress->cleanDBonItemDelete($this->getType(), $this->GetID()); } /** * \brief dettach an address from an item * * The address can be unaffected, and remain "free" * * @param $items_id the id of the item * @param $itemtype the type of the item **/ static function unaffectAddressesOfItem($items_id, $itemtype) { global $DB; $query = "SELECT `id` FROM `glpi_networknames` WHERE `items_id` = '".$items_id."' AND `itemtype` = '".$itemtype."'"; foreach ($DB->request($query) as $networkNameID) { self::unaffectAddressByID($networkNameID['id']); } } /** * \brief dettach an address from an item * * The address can be unaffected, and remain "free" * * @param $networkNameID the id of the NetworkName **/ static function unaffectAddressByID($networkNameID) { return self::affectAddress($networkNameID, 0, ''); } /** * @param $networkNameID * @param $items_id * @param $itemtype **/ static function affectAddress($networkNameID, $items_id, $itemtype) { $networkName = new self(); return $networkName->update(array('id' => $networkNameID, 'items_id' => $items_id, 'itemtype' => $itemtype)); } /** * Get the full name (internet name) of a NetworkName * * @param $ID ID of the NetworkName * * @return its internet name, or empty string if invalid NetworkName **/ static function getInternetNameFromID($ID) { $networkName = new self(); if ($networkName->can($ID, 'r')) { return FQDNLabel::getInternetNameFromLabelAndDomainID($this->fields["name"], $this->fields["fqdns_id"]); } return ""; } /** * @param $networkPortID **/ static function showFormForNetworkPort($networkPortID) { global $DB, $CFG_GLPI; $name = new self(); $number_names = 0; if ($networkPortID > 0) { $query = "SELECT `id` FROM `".$name->getTable()."` WHERE `itemtype` = 'NetworkPort' AND `items_id` = '$networkPortID' AND `is_deleted` = '0'"; $result = $DB->query($query); if ($DB->numrows($result) > 1) { echo "" . __("Several network names available! Go to the tab 'Network Name' to manage them.") . "\n"; return; } switch ($DB->numrows($result)) { case 1 : $nameID = $DB->fetch_assoc($result); $name->getFromDB($nameID['id']); break; case 0 : $name->getEmpty(); break; } } else { $name->getEmpty(); } echo ""; // If the networkname is defined, we must be able to edit it. So we make a link if ($name->getID() > 0) { echo "".self::getTypeName(1).""; echo " \n"; Html::showSimpleForm($name->getFormURL(), 'unaffect', __s('Dissociate'), array('id' => $name->getID()), $CFG_GLPI["root_doc"].'/pics/sub_dropdown.png'); } else { echo self::getTypeName(1); } echo "\n"; echo ""; echo "" . self::getTypeName(1) . "\n"; Html::autocompletionTextField($name, "name", array('name' => 'NetworkName_name')); echo "\n"; echo "".FQDN::getTypeName(1).""; Dropdown::show(getItemTypeForTable(getTableNameForForeignKeyField("fqdns_id")), array('value' => $name->fields["fqdns_id"], 'name' => 'NetworkName_fqdns_id', 'entity' => $name->getEntityID(), 'displaywith' => array('view'))); echo "\n"; echo "\n"; echo "".IPAddress::getTypeName(2); IPAddress::showAddChildButtonForItemForm($name, 'NetworkName__ipaddresses'); echo ""; echo ""; IPAddress::showChildsForItemForm($name, 'NetworkName__ipaddresses'); echo ""; // MoYo : really need to display it here ? // make confure because not updatable // echo "".IPNetwork::getTypeName(2)." "; // Html::showToolTip(__('IP network is not included in the database. However, you can see current available networks.')); // echo ""; // IPNetwork::showIPNetworkProperties($name->getEntityID()); // echo "\n"; echo " "; echo "\n"; } /** * @since version 0.84 * * @param $itemtype * @param $base HTMLTableBase object * @param $super HTMLTableSuperHeader object (default NULL * @param $father HTMLTableHeader object (default NULL) * @param $options array **/ static function getHTMLTableHeader($itemtype, HTMLTableBase $base, HTMLTableSuperHeader $super=NULL, HTMLTableHeader $father=NULL, array $options=array()) { $column_name = __CLASS__; if (isset($options['massiveactionnetworkname']) && $options['massiveactionnetworkname']) { $delete_all_column = $base->addHeader('delete', Html::getCheckAllAsCheckbox('mass'.__CLASS__. $options['rand']), $super, $father); $delete_all_column->setHTMLClass('center'); } if (!isset($options['dont_display'][$column_name])) { $content = self::getTypeName(); if (isset($options['column_links'][$column_name])) { $content = "$content"; } $father = $base->addHeader($column_name, $content, $super, $father); $father->setItemType('NetworkName'); if (isset($options['display_isDynamic']) && ($options['display_isDynamic'])) { $father = $base->addHeader($column_name.'_dynamic', __('Automatic inventory'), $super, $father); } } NetworkAlias::getHTMLTableHeader(__CLASS__, $base, $super, $father, $options); IPAddress::getHTMLTableHeader(__CLASS__, $base, $super, $father, $options); } /** * @since version 0.84 * * @param $row HTMLTableRow object (default NULL) * @param $item CommonDBTM object (default NULL) * @param $father HTMLTableCell object (default NULL) * @param $options array **/ static function getHTMLTableCellsForItem(HTMLTableRow $row=NULL, CommonDBTM $item=NULL, HTMLTableCell $father=NULL, array $options=array()) { global $DB, $CFG_GLPI; $column_name = __CLASS__; if (empty($item)) { if (empty($father)) { return; } $item = $father->getItem(); } switch ($item->getType()) { case 'FQDN' : $JOINS = ""; $ORDER = "`glpi_networknames`.`name`"; if (isset($options['order'])) { switch ($options['order']) { case 'name' : break; case 'ip' : $JOINS = " LEFT JOIN `glpi_ipaddresses` ON (`glpi_ipaddresses`.`items_id` = `glpi_networknames`.`id` AND `glpi_ipaddresses`.`itemtype` = 'NetworkName' AND `glpi_ipaddresses`.`is_deleted` = '0')"; $ORDER = "ISNULL (`glpi_ipaddresses`.`id`), `glpi_ipaddresses`.`binary_3`, `glpi_ipaddresses`.`binary_2`, `glpi_ipaddresses`.`binary_1`, `glpi_ipaddresses`.`binary_0`"; break; case 'alias' : $JOINS = " LEFT JOIN `glpi_networkaliases` ON (`glpi_networkaliases`.`networknames_id` = `glpi_networknames`.`id`)"; $ORDER = "ISNULL(`glpi_networkaliases`.`name`), `glpi_networkaliases`.`name`"; break; } } $query = "SELECT `glpi_networknames`.`id` FROM `glpi_networknames` $JOINS WHERE `glpi_networknames`.`fqdns_id` = '".$item->fields["id"]."' AND `glpi_networknames`.`is_deleted` = '0' ORDER BY $ORDER"; break; case 'NetworkPort' : $query = "SELECT `id` FROM `glpi_networknames` WHERE `itemtype` = '".$item->getType()."' AND `items_id` = '".$item->getID()."' AND `glpi_networknames`.`is_deleted` = '0'"; break; case 'NetworkEquipment' : $query = "SELECT `glpi_networknames`.`id` FROM `glpi_networknames`, `glpi_networkports` WHERE `glpi_networkports`.`itemtype` = '".$item->getType()."' AND `glpi_networkports`.`items_id` ='".$item->getID()."' AND `glpi_networknames`.`itemtype` = 'NetworkPort' AND `glpi_networknames`.`items_id` = `glpi_networkports`.`id` AND `glpi_networknames`.`is_deleted` = '0'"; break; } if (isset($options['SQL_options'])) { $query .= " ".$options['SQL_options']; } $canedit = (isset($options['canedit']) && $options['canedit']); $createRow = (isset($options['createRow']) && $options['createRow']); $options['createRow'] = false; $address = new self(); foreach ($DB->request($query) as $line) { if ($address->getFromDB($line["id"])) { if ($createRow) { $row = $row->createAnotherRow(); } if (isset($options['massiveactionnetworkname']) && $options['massiveactionnetworkname']) { $header = $row->getGroup()->getHeaderByName('Internet', 'delete'); $cell_value = Html::getMassiveActionCheckBox(__CLASS__, $line["id"]); $delete_cell = $row->addCell($header, $cell_value, $father); } $internetName = $address->getInternetName(); if (empty($internetName)) { $internetName = "(".$line["id"].")"; } $content = "".$internetName.""; if (!isset($options['dont_display'][$column_name])) { $header = $row->getGroup()->getHeaderByName('Internet', $column_name); $name_cell = $row->addCell($header, $content, $father, $address); if (isset($options['display_isDynamic']) && ($options['display_isDynamic'])) { $dyn_header = $row->getGroup()->getHeaderByName('Internet', $column_name.'_dynamic'); $dynamic_cell = $row->addCell($dyn_header, Dropdown::getYesNo($address->fields['is_dynamic']), $name_cell); $father_for_children = $dynamic_cell; } else { $father_for_children = $name_cell; } } else { $father_for_children = $father; } NetworkAlias::getHTMLTableCellsForItem($row, $address, $father_for_children, $options); IPAddress::getHTMLTableCellsForItem($row, $address, $father_for_children, $options); } } } /** * \brief Show names for an item from its form * Beware that the rendering can be different if readden from direct item form (ie : add new * NetworkName, remove, ...) or if readden from item of the item (for instance from the computer * form through NetworkPort::ShowForItem). * * @param $item CommonGLPI object * @param $withtemplate integer withtemplate param (default 0) **/ static function showForItem(CommonDBTM $item, $withtemplate=0) { global $DB, $CFG_GLPI; $ID = $item->getID(); if (!$item->can($ID, 'r')) { return false; } $rand = mt_rand(); if (($item->getType() == 'NetworkPort') && $item->canUpdateItem()) { $items_id = $item->getID(); $itemtype = $item->getType(); echo "
    \n"; echo "\n"; echo "\n"; echo ""; echo "\n"; echo "
    ".__('Add a network name')."
    "; echo "\n"; echo "\n"; _e('Not associated'); echo ""; self::dropdown(array('name' => 'addressID', 'condition' => '`items_id`<=0')); echo ""; echo ""; echo ""; echo ""; echo __('Create a new network name').""; echo "
    \n"; Html::closeForm(); echo "
    \n"; } $table_options = array('createRow' => true); if (($item->getType() == 'FQDN') || ($item->getType() == 'NetworkEquipment')) { if (isset($_POST["start"])) { $start = $_POST["start"]; } else { $start = 0; } if (!empty($_POST["order"])) { $table_options['order'] = $_POST["order"]; } else { $table_options['order'] = 'name'; } if ($item->getType() == 'FQDN') { $table_options['column_links'] = array('NetworkName' => 'javascript:reloadTab("order=name");', 'NetworkAlias' => 'javascript:reloadTab("order=alias");', 'IPAddress' => 'javascript:reloadTab("order=ip");'); } $table_options['SQL_options'] = "LIMIT ".$_SESSION['glpilist_limit']." OFFSET $start"; $canedit = false; } else { $canedit = $item->canUpdateItem(); } $table_options['canedit'] = false; $table_options['rand'] = $rand; $table_options['massiveactionnetworkname'] = $canedit; $table = new HTMLTableMain(); $column = $table->addHeader('Internet', self::getTypeName(2)); $t_group = $table->createGroup('Main', ''); self::getHTMLTableHeader(__CLASS__, $t_group, $column, NULL, $table_options); $t_row = $t_group->createRow(); // Reorder the columns for better display $display_table = true; switch ($item->getType()) { case 'NetworkPort' : case 'FQDN' : break; } self::getHTMLTableCellsForItem($t_row, $item, NULL, $table_options); // Do not display table for netwokrport if only one networkname if (($item->getType() == 'NetworkPort') && ($table->getNumberOfRows() <= 1)) { $display_table = false; } if ($display_table) { if ($table->getNumberOfRows() > 0) { $number = $table->getNumberOfRows(); if ($item->getType() == 'FQDN') { $number = min($_SESSION['glpilist_limit'], $table->getNumberOfRows()); Html::printAjaxPager(self::getTypeName(2), $start, self::countForItem($item)); } Session::initNavigateListItems(__CLASS__, //TRANS : %1$s is the itemtype name, // %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), $item->getTypeName(1), $item->getName())); if ($canedit && $number) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $paramsma = array('num_displayed' => $number, 'specific_actions' => array('purge' => _x('button', 'Delete permanently'), 'unaffect' => __('Dissociate'))); Html::showMassiveActions(__CLASS__, $paramsma); } $table->display(array('display_title_for_each_group' => false, 'display_thead' => false, 'display_tfoot' => false)); if ($canedit && $number) { $paramsma['ontop'] = false; Html::showMassiveActions(__CLASS__, $paramsma); Html::closeForm(); } if ($item->getType() == 'FQDN') { Html::printAjaxPager(self::getTypeName(2), $start, self::countForItem($item)); } } else { echo ""; echo "
    ".__('No network name found')."
    "; } } } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($item->getType()) { case 'NetworkPort' : case 'FQDN' : case 'NetworkEquipment' : self::showForItem($item, $withtemplate); break; } } /** * @param $item CommonDBTM object **/ static function countForItem(CommonDBTM $item) { global $DB; switch ($item->getType()) { case 'FQDN' : return countElementsInTable('glpi_networknames', "`fqdns_id` = '".$item->fields["id"]."' AND `is_deleted` = '0'"); case 'NetworkPort' : return countElementsInTable('glpi_networknames', "itemtype = '".$item->getType()."' AND items_id = '".$item->getID()."' AND `is_deleted` = '0'"); case 'NetworkEquipment' : $query = "SELECT DISTINCT COUNT(*) AS cpt FROM `glpi_networknames`, `glpi_networkports` WHERE `glpi_networkports`.`itemtype` = '".$item->getType()."' AND `glpi_networkports`.`items_id` ='".$item->getID()."' AND `glpi_networkports`.`is_deleted` ='0' AND `glpi_networknames`.`itemtype` = 'NetworkPort' AND `glpi_networknames`.`items_id` = `glpi_networkports`.`id` AND `glpi_networknames`.`is_deleted` = '0'"; $result = $DB->query($query); $ligne = $DB->fetch_assoc($result); return $ligne['cpt']; } } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if ($item->getID() && $item->can($item->getField('id'),'r')) { if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(self::getTypeName(2), self::countForItem($item)); } return self::getTypeName(2); } return ''; } } ?> glpi-0.84.3+dfsg.1/inc/networkport.class.php000066400000000000000000001301651226600447100206130ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// NetworkPort class : There is two parts for a given NetworkPort. The first one, generic, only /// contains the link to the item, the name, and the type of network port. All specific /// characteristics are owned by the instanciation of the network port : NetworkPortInstantiation. /// Whenever a port is display (through its form or though item port listing), the NetworkPort class /// load its instantiation from the instantiation database to display the elements. /// Moreover, in NetworkPort form, if there is no more than one NetworkName attached to the current /// port, then, the fields of NetworkName are display. Thus, NetworkPort UI remain similar to 0.83 class NetworkPort extends CommonDBChild { // From CommonDBChild static public $itemtype = 'itemtype'; static public $items_id = 'items_id'; public $dohistory = true; static public $checkParentRights = CommonDBConnexity::HAVE_SAME_RIGHT_ON_ITEM; static protected $forward_entity_to = array('NetworkName'); static function canCreate() { return (Session::haveRight('networking','w') && parent::canCreate()); } static function canView() { return (Session::haveRight('networking','r') && parent::canView()); } /** * @since version 0.84 **/ static function canUpdate() { return (Session::haveRight('networking','w') && parent::canUpdate()); } /** * @since version 0.84 **/ static function canDelete() { return (Session::haveRight('networking','w') && parent::canDelete()); } function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } /** * @since version 0.84 * * @see CommonDBTM::getPreAdditionalInfosForName **/ function getPreAdditionalInfosForName() { if ($item = $this->getItem()) { return $item->getName(); } return ''; } /** * \brief get the list of available network port type. * * @since version 0.84 * * @return array of available type of network ports **/ static function getNetworkPortInstantiations() { global $CFG_GLPI; return $CFG_GLPI['networkport_instantiations']; } static function getNetworkPortInstantiationsWithNames() { $types = self::getNetworkPortInstantiations(); $tab = array(); foreach ($types as $itemtype) { $tab[$itemtype] = call_user_func(array($itemtype, 'getTypeName')); } return $tab; } static function getTypeName($nb=0) { return _n('Network port', 'Network ports', $nb); } /** * \brief get the instantiation of the current NetworkPort * The instantiation rely on the instantiation_type field and the id of the NetworkPort. If the * network port exists, but not its instantiation, then, the instantiation will be empty. * * @since version 0.84 * * @return the instantiation object or false if the type of instantiation is not known **/ function getInstantiation() { if (isset($this->fields['instantiation_type']) && in_array($this->fields['instantiation_type'], self::getNetworkPortInstantiations())) { if ($instantiation = getItemForItemtype($this->fields['instantiation_type'])) { if (!$instantiation->getFromDB($this->getID())) { if (!$instantiation->getEmpty()) { unset($instantiation); return false; } } return $instantiation; } } return false; } /** * Change the instantion type of a NetworkPort : check validity of the new type of * instantiation and that it is not equal to current ones. Update the NetworkPort and delete * the previous instantiation. It is up to the caller to create the new instantiation ! * * @since version 0.84 * * @param $new_instantiation_type the name of the new instaniation type * * @return false on error, true if the previous instantiation is not available (ie.: invalid * instantiation type) or the object of the previous instantiation. **/ function switchInstantiationType($new_instantiation_type) { // First, check if the new instantiation is a valid one ... if (!in_array($new_instantiation_type, self::getNetworkPortInstantiations())) { return false; } // Load the previous instantiation $previousInstantiation = $this->getInstantiation(); // If the previous instantiation is the same than the new one: nothing to do ! if (($previousInstantiation !== false) && ($previousInstantiation->getType() == $new_instantiation_type)) { return $previousInstantiation; } // We update the current NetworkPort $input = $this->fields; $input['instantiation_type'] = $new_instantiation_type; $this->update($input); // Then, we delete the previous instantiation if ($previousInstantiation !== false) { $previousInstantiation->delete($previousInstantiation->fields); return $previousInstantiation; } return true; } /** * \brief split input fields when validating a port * * The form of the NetworkPort can contain the details of the NetworkPortInstantiation as well as * NetworkName elements (if no more than one name is attached to this port). Feilds from both * NetworkPortInstantiation and NetworkName must not be process by the NetworkPort::add or * NetworkPort::update. But they must be kept for adding or updating these elements. This is * done after creating or updating the current port. Otherwise, its ID may not be known (in case * of new port). * To keep the unused fields, we check each field key. If it is owned by NetworkPort (ie : * exists inside the $this->fields array), then they remain inside $input. If they are prefix by * "Networkname_", then they are added to $this->input_for_NetworkName. Else, they are for the * instantiation and added to $this->input_for_instantiation. * * This method must be call before NetworkPort::add or NetworkPort::update in case of NetworkPort * form. Otherwise, the entry of the database may contain wrong values. * * @since version 0.84 * * @param $input * * @see updateDependencies for the update **/ function splitInputForElements($input) { if (isset($this->input_for_instantiation) || isset($this->input_for_NetworkName) || isset($this->input_for_NetworkPortConnect) || !isset($input)) { return; } $this->input_for_instantiation = array(); $this->input_for_NetworkName = array(); $this->input_for_NetworkPortConnect = array(); foreach ($input as $field => $value) { if (array_key_exists($field, $this->fields)) { continue; } if (preg_match('/^NetworkName_/',$field)) { $networkName_field = preg_replace('/^NetworkName_/','',$field); $this->input_for_NetworkName[$networkName_field] = $value; } else if (preg_match('/^NetworkPortConnect_/',$field)) { $networkName_field = preg_replace('/^NetworkPortConnect_/','',$field); $this->input_for_NetworkPortConnect[$networkName_field] = $value; } else { $this->input_for_instantiation[$field] = $value; } unset($input[$field]); } return $input; } /** * \brief update all related elements after adding or updating an element * * splitInputForElements() prepare the data for adding or updating NetworkPortInstantiation and * NetworkName. This method will update NetworkPortInstantiation and NetworkName. I must be call * after NetworkPort::add or NetworkPort::update otherwise, the networkport ID will not be known * and the dependencies won't have a valid items_id field. * * @since version 0.84 * * @param $history (default 1) * * @see splitInputForElements() for preparing the input **/ function updateDependencies($history=1) { $instantiation = $this->getInstantiation(); if (($instantiation !== false) && (count($this->input_for_instantiation) > 0)) { $this->input_for_instantiation['networkports_id'] = $this->getID(); if ($instantiation->isNewID($instantiation->getID())) { $instantiation->add($this->input_for_instantiation, $history); } else { $instantiation->update($this->input_for_instantiation, $history); } } unset($this->input_for_instantiation); if ((count($this->input_for_NetworkName) > 0) && (!isset($_POST['several']))) { // Check to see if the NetworkName is empty $empty_networkName = empty($this->input_for_NetworkName['name']) && empty($this->input_for_NetworkName['fqdns_id']); if (($empty_networkName) && is_array($this->input_for_NetworkName['_ipaddresses'])) { foreach ($this->input_for_NetworkName['_ipaddresses'] as $ip_address) { if (!empty($ip_address)) { $empty_networkName = false; break; } } } $network_name = new NetworkName(); if (isset($this->input_for_NetworkName['id'])) { if ($empty_networkName) { // If the NetworkName is empty, then delete it ! $network_name->delete($this->input_for_NetworkName, $history); } else { // Else, update it $network_name->update($this->input_for_NetworkName, $history); } } else { if (!$empty_networkName) { // Only create a NetworkName if it is not empty $this->input_for_NetworkName['itemtype'] = 'NetworkPort'; $this->input_for_NetworkName['items_id'] = $this->getID(); $network_name->add($this->input_for_NetworkName, $history); } } } unset($this->input_for_NetworkName); if (count($this->input_for_NetworkPortConnect) > 0) { if (isset($this->input_for_NetworkPortConnect['networkports_id_1']) && isset($this->input_for_NetworkPortConnect['networkports_id_2']) && !empty($this->input_for_NetworkPortConnect['networkports_id_2'])) { $nn = new NetworkPort_NetworkPort(); $nn->add($this->input_for_NetworkPortConnect); } } unset($this->input_for_NetworkPortConnect); } function prepareInputForAdd($input) { if (isset($input["logical_number"]) && (strlen($input["logical_number"]) == 0)) { unset($input["logical_number"]); } return parent::prepareInputForAdd($input); } function cleanDBonPurge() { $instantiation = $this->getInstantiation(); if ($instantiation !== false) { $instantiation->cleanDBonItemDelete ($this->getType(), $this->getID()); unset($instantiation); } $nn = new NetworkPort_NetworkPort(); $nn->cleanDBonItemDelete ($this->getType(), $this->getID()); $nv = new NetworkPort_Vlan(); $nv->cleanDBonItemDelete ($this->getType(), $this->getID()); $names = new NetworkName(); $names->cleanDBonItemDelete ($this->getType(), $this->getID()); } /** * Get port opposite port ID if linked item * * @param $ID networking port ID * * @return ID of the NetworkPort found, false if not found **/ function getContact($ID) { $wire = new NetworkPort_NetworkPort(); if ($contact_id = $wire->getOppositeContact($ID)) { return $contact_id; } return false; } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('NetworkName', $ong, $options); $this->addStandardTab('NetworkPort_Vlan', $ong, $options); $this->addStandardTab('Log', $ong, $options); $this->addStandardTab('NetworkPortInstantiation', $ong, $options); $this->addStandardTab('NetworkPort', $ong, $options); return $ong; } /** * Delete All connection of the given network port * * @param $ID ID of the port * * @return true on success **/ function resetConnections($ID) { } /** * Get available display options array * * @since version 0.84 * * @return all the options **/ static function getAvailableDisplayOptions() { $options[__('Global displays')] = array('characteristics' => array('name' => __('Characteristics'), 'default' => true), 'internet' => array('name' => __('Internet information'), 'default' => true), 'dynamic_import' => array('name' => __('Automatic inventory'), 'default' => false)); $options[__('Common options')] = NetworkPortInstantiation::getGlobalInstantiationNetworkPortDisplayOptions(); $options[__('Internet information')] = array('names' => array('name' => NetworkName::getTypeName(2), 'default' => false), 'aliases' => array('name' => NetworkAlias::getTypeName(2), 'default' => false), 'ipaddresses' => array('name' => IPAddress::getTypeName(2), 'default' => true), 'ipnetworks' => array('name' => IPNetwork::getTypeName(2), 'default' => true)); foreach (self::getNetworkPortInstantiations() as $portType) { $portTypeName = $portType::getTypeName(0); $options[$portTypeName] = $portType::getInstantiationNetworkPortDisplayOptions(); } return $options; } /** * Show ports for an item * * @param $item CommonDBTM object * @param $withtemplate integer withtemplate param (default '') **/ static function showForItem(CommonDBTM $item, $withtemplate='') { global $DB, $CFG_GLPI; $rand = mt_rand(); $itemtype = $item->getType(); $items_id = $item->getField('id'); if (!Session::haveRight('networking','r') || !$item->can($items_id, 'r')) { return false; } $netport = new self(); $netport->item = $item; if ($itemtype == 'NetworkPort') { $canedit = false; } else { $canedit = $item->can($items_id, 'w'); } $showmassiveactions = false; if ($withtemplate != 2) { $showmassiveactions = $canedit; } // Show Add Form if ($canedit && (empty($withtemplate) || ($withtemplate != 2))) { echo "\n\n"; echo "\n"; echo "\n"; echo "
    \n"; echo "\n"; echo "\n"; echo "
    \n"; _e('Network port type to be added'); echo " "; $instantiations = array(); foreach (self::getNetworkPortInstantiations() as $inst_type) { if (call_user_func(array($inst_type, 'canCreate'))) { $instantiations[$inst_type] = call_user_func(array($inst_type, 'getTypeName')); } } Dropdown::showFromArray('instantiation_type', $instantiations, array('value' => 'NetworkPortEthernet')); echo ""; _e('Add several ports'); echo " \n"; echo "\n"; echo "
    \n"; Html::closeForm(); } if ($showmassiveactions) { $checkbox_column = true; Html::openMassiveActionsForm('mass'.__CLASS__.$rand); } else { $checkbox_column = false; } $is_active_network_port = false; Session::initNavigateListItems('NetworkPort', //TRANS : %1$s is the itemtype name, // %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), $item->getTypeName(1), $item->getName())); if ($itemtype == 'NetworkPort') { $porttypes = array('NetworkPortAlias', 'NetworkPortAggregate'); } else { $porttypes = self::getNetworkPortInstantiations(); // Manage NetworkportMigration $porttypes[] = ''; } $display_options = self::getDisplayOptions($itemtype); $table = new HTMLTableMain(); $number_port = self::countForItem($item); $table_options = array('canedit' => $canedit, 'display_options' => &$display_options); // Make table name and add the correct show/hide parameters $table_name = sprintf(__('%1$s: %2$d'), self::getTypeName($number_port), $number_port); // Add the link to the popup to display the options ... $table_namelink = self::getDisplayOptionsLink($itemtype); $table_name = sprintf(__('%1$s - %2$s'), $table_name, $table_namelink); $table->setTitle($table_name); $c_main = $table->addHeader('main', self::getTypeName(2)); if (($display_options['dynamic_import']) && ($item->isDynamic())) { $table_options['display_isDynamic'] = true; } else { $table_options['display_isDynamic'] = false; } if ($display_options['characteristics']) { $c_instant = $table->addHeader('Instantiation', __('Characteristics')); $c_instant->setHTMLClass('center'); } if ($display_options['internet']) { $options = array('names' => 'NetworkName', 'aliases' => 'NetworkAlias', 'ipaddresses' => 'IPAddress', 'ipnetworks' => 'IPNetwork'); $table_options['dont_display'] = array(); foreach ($options as $option => $itemtype_for_option) { if (!$display_options[$option]) { $table_options['dont_display'][$itemtype_for_option] = true; } } $c_network = $table->addHeader('Internet', _n(__('Internet information'), __('Internet information'), 2)); $c_network->setHTMLClass('center'); } else { $c_network = NULL; } foreach ($porttypes as $portType) { if (empty($portType)) { $group_name = 'Migration'; $group_title = __('Network ports waiting for manual migration'); } else { $group_name = $portType; $group_title = $portType::getTypeName(2); } $t_group = $table->createGroup($group_name, $group_title); if (($withtemplate != 2) && $canedit) { $c_checkbox = $t_group->addHeader('checkbox', Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand, '__RAND__'), $c_main); } else { $c_checkbox = NULL; } $c_number = $t_group->addHeader('NetworkPort', "#", $c_main); $c_name = $t_group->addHeader("Name", __('Name'), $c_main); $c_name->setItemType('NetworkPort'); $c_name->setHTMLClass('center'); if ($table_options['display_isDynamic']) { $c_dynamic = $t_group->addHeader("Dynamic", __('Automatic inventory'), $c_main); $c_dynamic->setHTMLClass('center'); } if ($display_options['characteristics']) { if (empty($portType)) { NetworkPortMigration::getMigrationInstantiationHTMLTableHeaders($t_group, $c_instant, $c_network, NULL, $table_options); } else { $instantiation = new $portType(); $instantiation->getInstantiationHTMLTableHeaders($t_group, $c_instant, $c_network, NULL, $table_options); unset ($instantiation); } } if ($display_options['internet'] && !$display_options['characteristics']) { NetworkName::getHTMLTableHeader(__CLASS__, $t_group, $c_network, NULL, $table_options); } if ($itemtype == 'NetworkPort') { switch ($portType) { case 'NetworkPortAlias' : $search_table = 'glpi_networkportaliases'; $search_request = "`networkports_id_alias`='$items_id'"; break; case 'NetworkPortAggregate' : $search_table = 'glpi_networkportaggregates'; $search_request = "`networkports_id_list` like '%\"$items_id\"%'"; break; } $query = "SELECT `networkports_id` AS id FROM `$search_table` WHERE $search_request"; } else { $query = "SELECT `id` FROM `glpi_networkports` WHERE `items_id` = '$items_id' AND `itemtype` = '$itemtype' AND `instantiation_type` = '$portType' AND `is_deleted` = '0' ORDER BY `name`, `logical_number`"; } if ($result = $DB->query($query)) { echo "
    "; $number_port = $DB->numrows($result); if ($number_port != 0) { $is_active_network_port = true; $save_canedit = $canedit; if (!empty($portType)) { $name = sprintf(__('%1$s (%2$s)'), self::getTypeName($number_port), call_user_func(array($portType, 'getTypeName'))); $name = sprintf(__('%1$s: %2$s'), $name, $number_port); } else { $name = __('Network ports waiting for manual migration'); $canedit = false; } while ($devid = $DB->fetch_row($result)) { $t_row = $t_group->createRow(); $netport->getFromDB(current($devid)); // No massive action for migration ports if (($withtemplate != 2) && $canedit && !empty($portType)) { $ce_checkbox = $t_row->addCell($c_checkbox, ""); } else { $ce_checkbox = NULL; } $content = ""; // Display link based on default rights if ($save_canedit && ($withtemplate != 2)) { if (!empty($portType)) { $content .= ""; } else { $content .= ""; } } $content .= $netport->fields["logical_number"]; if ($canedit && ($withtemplate != 2)) { $content .= ""; } $content .= ""; $content .= Html::showToolTip($netport->fields['comment'], array('display' => false)); $t_row->addCell($c_number, $content); $value = $netport->fields["name"]; $t_row->addCell($c_name, $value, NULL, $netport); if ($table_options['display_isDynamic']) { $t_row->addCell($c_dynamic, Dropdown::getYesNo($netport->fields['is_dynamic'])); } $instant_cell = NULL; if ($display_options['characteristics']) { $instantiation = $netport->getInstantiation(); if ($instantiation !== false) { $instantiation->getInstantiationHTMLTable($netport, $t_row, NULL, $table_options); unset($instantiation); } } else if ($display_options['internet']) { NetworkName::getHTMLTableCellsForItem($t_row, $netport, NULL, $table_options); } } $canedit = $save_canedit; } echo "
    "; } } if ($is_active_network_port && $showmassiveactions) { $massiveactionparams = array('num_displayed' => $number_port, 'check_itemtype' => $itemtype, 'check_items_id' => $items_id); Html::showMassiveActions('NetworkPort', $massiveactionparams); } $table->display(array('display_thead' => false, 'display_tfoot' => false)); unset($table); if (!$is_active_network_port) { echo ""; echo "
    ".__('No network port found')."
    "; } if ($showmassiveactions) { $massiveactionparams['ontop'] = false; Html::showMassiveActions('NetworkPort', $massiveactionparams); Html::closeForm(); } } function showForm($ID, $options=array()) { global $CFG_GLPI; if (!isset($options['several'])) { $options['several'] = false; } if (!Session::haveRight("networking", "r")) { return false; } $this->initForm($ID, $options); $recursiveItems = $this->recursivelyGetItems(); if (count($recursiveItems) > 0) { $lastItem = $recursiveItems[count($recursiveItems) - 1]; $lastItem_entities_id = $lastItem->getField('entities_id'); } else { $lastItem_entities_id = $_SESSION['glpiactive_entity']; } $this->showTabs(); $options['entities_id'] = $lastItem_entities_id; $this->showFormHeader($options); echo ""; $this->displayRecursiveItems($recursiveItems, 'Type'); echo " :\n"; // Need these to update information echo "\n"; echo "\n"; echo "\n"; $this->displayRecursiveItems($recursiveItems, "Link"); echo "\n"; $colspan = 2; if (!$options['several']) { $colspan ++; } echo "".__('Comments').""; echo ""; echo ""; echo "\n"; if (!$options['several']) { echo "". _n('Port number', 'Ports number', 1) ."\n"; echo ""; Html::autocompletionTextField($this,"logical_number", array('size' => 5)); echo "\n"; } else { echo "". _n('Port number', 'Port numbers', 2) ."\n"; echo ""; echo ""; echo "\n"; echo __('from') . " "; Dropdown::showInteger('from_logical_number', 0, 0, 100); echo " ".__('to') . " "; Dropdown::showInteger('to_logical_number', 0, 0, 100); echo "\n"; } echo "" . __('Name') . "\n"; echo ""; Html::autocompletionTextField($this, "name"); echo "\n"; $instantiation = $this->getInstantiation(); if ($instantiation !== false) { echo "".$instantiation->getTypeName(1)."\n"; $instantiation->showInstantiationForm($this, $options, $recursiveItems); unset($instantiation); } if (!$options['several']) { NetworkName::showFormForNetworkPort($this->getID()); } $this->showFormButtons($options); $this->addDivForTabs(); } /** * @param $itemtype **/ static function getSearchOptionsToAdd($itemtype) { $tab = array(); $tab['network'] = __('Networking'); $joinparams = array('jointype' => 'itemtype_item'); if ($itemtype == 'Computer') { $joinparams['beforejoin'] = array('table' => 'glpi_items_devicenetworkcards', 'joinparams' => array('jointype' => 'itemtype_item', 'specific_itemtype' => 'Computer', 'nolink' => true)); } $tab[21]['table'] = 'glpi_networkports'; $tab[21]['field'] = 'mac'; $tab[21]['name'] = __('MAC address'); $tab[21]['datatype'] = 'mac'; $tab[21]['forcegroupby'] = true; $tab[21]['massiveaction'] = false; $tab[21]['joinparams'] = $joinparams; $tab[87]['table'] = 'glpi_networkports'; $tab[87]['field'] = 'instantiation_type'; $tab[87]['name'] = __('Network port type'); $tab[87]['datatype'] = 'itemtypename'; $tab[87]['itemtype_list'] = 'networkport_instantiations'; $tab[87]['massiveaction'] = false; $tab[87]['joinparams'] = $joinparams; $networkNameJoin = array('jointype' => 'itemtype_item', 'specific_itemtype' => 'NetworkPort', 'condition' => 'AND NOT NEWTABLE.`is_deleted`', 'beforejoin' => array('table' => 'glpi_networkports', 'joinparams' => $joinparams)); NetworkName::getSearchOptionsToAdd($tab, $networkNameJoin, $itemtype); $instantjoin = array('jointype' => 'child', 'beforejoin' => array('table' => 'glpi_networkports', 'joinparams' => $joinparams)); foreach (self::getNetworkPortInstantiations() as $instantiationType) { $instantiationType::getSearchOptionsToAddForInstantiation($tab, $instantjoin, $itemtype); } $netportjoin = array(array('table' => 'glpi_networkports', 'joinparams' => array('jointype' => 'itemtype_item')), array('table' => 'glpi_networkports_vlans', 'joinparams' => array('jointype' => 'child'))); $tab[88]['table'] = 'glpi_vlans'; $tab[88]['field'] = 'name'; $tab[88]['name'] = __('VLAN'); $tab[88]['datatype'] = 'dropdown'; $tab[88]['forcegroupby'] = true; $tab[88]['massiveaction'] = false; $tab[88]['joinparams'] = array('beforejoin' => $netportjoin); return $tab; } /** * @see CommonDBTM::getSpecificMassiveActions() **/ function getSpecificMassiveActions($checkitem=NULL) { $isadmin = $checkitem->canUpdate(); $actions = parent::getSpecificMassiveActions($checkitem); if ($isadmin) { $actions['assign_vlan'] = __('Associate a VLAN'); $actions['unassign_vlan'] = __('Dissociate a VLAN'); $actions['move_port'] = _x('button', 'Move'); } return $actions; } /** * @see CommonDBTM::showSpecificMassiveActionsParameters() **/ function showSpecificMassiveActionsParameters($input=array()) { switch ($input['action']) { case "assign_vlan" : Vlan::dropdown(); echo " ". __('Tagged'). " "; echo " "; return true; case "unassign_vlan" : Vlan::dropdown(); echo " "; return true; case "move_port" : Dropdown::show('NetworkEquipment', array('name' => 'items_id')); echo " "; return true; default : return parent::showSpecificMassiveActionsParameters($input); } return false; } /** * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "assign_vlan" : if (!empty($input["vlans_id"])) { $networkportvlan = new NetworkPort_Vlan(); foreach ($input["item"] as $key => $val) { if ($val == 1) { if ($this->can($key,'w')) { if ($networkportvlan->assignVlan($key, $input["vlans_id"], (isset($input['tagged']) ? '1' : '0'))) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } } } else { $res['ko']++; } break; case "unassign_vlan" : if (!empty($input["vlans_id"])) { $networkportvlan = new NetworkPort_Vlan(); foreach ($input["item"] as $key => $val) { if ($val == 1) { if ($this->can($key,'w')) { if ($networkportvlan->unassignVlan($key, $input["vlans_id"])) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } } } else { $nbko++; } break; // Interest of this massive action ? Replace switch by another : don't re-create manually all ports case "move_port" : if (isset($input["items_id"]) && !empty($input["items_id"])) { foreach ($input["item"] as $key => $val) { if ($val == 1) { if ($this->getFromDB($key)) { $input2 = array(); $input2['id'] = $key; $input2['items_id'] = $input["items_id"]; $input2['itemtype'] = 'NetworkEquipment'; if ($this->can($input2['id'],'w')) { if ($this->update($input2)) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } else { $res['ko']++; } } } } else { $res['ko']++; } break; default : return parent::doSpecificMassiveActions($input); } return $res; } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['type'] = 'text'; $tab[1]['massiveaction'] = false; $tab[1]['datatype'] = 'itemlink'; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'logical_number'; $tab[3]['name'] = __('Port number'); $tab[3]['datatype'] = 'integer'; $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'mac'; $tab[4]['name'] = __('MAC address'); $tab[4]['datatype'] = 'mac'; $tab[5]['table'] = $this->getTable(); $tab[5]['field'] = 'instantiation_type'; $tab[5]['name'] = __('Network port type'); $tab[5]['datatype'] = 'itemtypename'; $tab[5]['itemtype_list'] = 'networkport_instantiations'; $tab[5]['massiveaction'] = false; $tab[9]['table'] = 'glpi_netpoints'; $tab[9]['field'] = 'name'; $tab[9]['name'] = _n('Network outlet', 'Network outlets', 1); $tab[9]['datatype'] = 'dropdown'; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab[20]['table'] = $this->getTable(); $tab[20]['field'] = 'itemtype'; $tab[20]['name'] = __('Type'); $tab[20]['datatype'] = 'itemtype'; $tab[20]['massiveaction'] = false; $tab[21]['table'] = $this->getTable(); $tab[21]['field'] = 'items_id'; $tab[21]['name'] = __('ID'); $tab[21]['datatype'] = 'integer'; $tab[21]['massiveaction'] = false; return $tab; } /** * Clone the current NetworkPort when the item is clone * * @since version 0.84 * * @param $itemtype the type of the item that was clone * @param $old_items_id the id of the item that was clone * @param $new_items_id the id of the item after beeing cloned **/ static function cloneItem($itemtype, $old_items_id, $new_items_id) { global $DB; $np = new self(); // ADD Ports $query = "SELECT `id` FROM `glpi_networkports` WHERE `items_id` = '".$old_items_id."' AND `itemtype` = '".$itemtype."';"; $result = $DB->query($query); if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { $np->getFromDB($data["id"]); unset($np->fields["id"]); $np->fields["items_id"] = $new_items_id; $portid = $np->addToDB(); $instantiation = $np->getInstantiation(); if ($instantiation !== false) { $instantiation->add(array('id' => $portid)); unset($instantiation); } $npv = new NetworkPort_Vlan(); foreach ($DB->request($npv->getTable(), array($npv->items_id_1 => $data["id"])) as $vlan) { $input = array($npv->items_id_1 => $portid, $npv->items_id_2 => $vlan['vlans_id']); if (isset($vlan['tagged'])) { $input['tagged'] = $vlan['tagged']; } $npv->add($input); } } } } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { global $CFG_GLPI; // Can exists on template if (Session::haveRight('networking','r')) { if (in_array($item->getType(), $CFG_GLPI["networkport_types"])) { if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(self::getTypeName(2), self::countForItem($item)); } return (self::getTypeName(2)); } } if ($item->getType() == 'NetworkPort') { $nbAlias = countElementsInTable('glpi_networkportaliases', "`networkports_id_alias` = '".$item->getField('id')."'"); if ($nbAlias > 0) { $aliases = self::createTabEntry(NetworkPortAlias::getTypeName(2), $nbAlias); } else { $aliases = ''; } $nbAggregates = countElementsInTable('glpi_networkportaggregates', "`networkports_id_list` LIKE '%\"".$item->getField('id')."\"%'"); if ($nbAggregates > 0) { $aggregates = self::createTabEntry(NetworkPortAggregate::getTypeName(2), $nbAggregates); } else { $aggregates = ''; } if (!empty($aggregates) && !empty($aliases)) { return $aliases.'/'.$aggregates; } return $aliases.$aggregates; } return ''; } /** * @param CommonDBTM $item **/ static function countForItem(CommonDBTM $item) { return countElementsInTable('glpi_networkports', "`itemtype` = '".$item->getType()."' AND `items_id` ='".$item->getField('id')."' AND `is_deleted` = '0'"); } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { global $CFG_GLPI; if (in_array($item->getType(), $CFG_GLPI["networkport_types"]) || ($item->getType() == 'NetworkPort')) { self::showForItem($item); return true; } } } ?> glpi-0.84.3+dfsg.1/inc/networkport_networkport.class.php000066400000000000000000000054121226600447100232650ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// NetworkPort_NetworkPort class class NetworkPort_NetworkPort extends CommonDBRelation { // From CommonDBRelation static public $itemtype_1 = 'NetworkPort'; static public $items_id_1 = 'networkports_id_1'; static public $itemtype_2 = 'NetworkPort'; static public $items_id_2 = 'networkports_id_2'; static public $log_history_1_add = Log::HISTORY_CONNECT_DEVICE; static public $log_history_2_add = Log::HISTORY_CONNECT_DEVICE; static public $log_history_1_delete = Log::HISTORY_DISCONNECT_DEVICE; static public $log_history_2_delete = Log::HISTORY_DISCONNECT_DEVICE; /** * Retrieve an item from the database * * @param $ID ID of the item to get * * @return true if succeed else false **/ function getFromDBForNetworkPort($ID) { return $this->getFromDBByQuery("WHERE `".$this->getTable()."`.`networkports_id_1` = '$ID' OR `".$this->getTable()."`.`networkports_id_2` = '$ID'"); } /** * Get port opposite port ID * * @param $ID networking port ID * * @return integer ID of opposite port. false if not found **/ function getOppositeContact($ID) { global $DB; if ($this->getFromDBForNetworkPort($ID)) { if ($this->fields['networkports_id_1'] == $ID) { return $this->fields['networkports_id_2']; } if ($this->fields['networkports_id_2'] == $ID) { return $this->fields['networkports_id_1']; } return false; } } } ?> glpi-0.84.3+dfsg.1/inc/networkport_vlan.class.php000066400000000000000000000165571226600447100216430ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class NetworkPort_Vlan extends CommonDBRelation { // From CommonDBRelation static public $itemtype_1 = 'NetworkPort'; static public $items_id_1 = 'networkports_id'; static public $itemtype_2 = 'Vlan'; static public $items_id_2 = 'vlans_id'; static public $checkItem_2_Rights = self::HAVE_VIEW_RIGHT_ON_ITEM; /** * @since version 0.84 **/ function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } /** * Get search function for the class * * @return array of search option **/ function getSearchOptions() { $tab = parent::getSearchOptions(); return $tab; } /** * @param $portID * @param $vlanID **/ function unassignVlan($portID, $vlanID) { $this->getFromDBByQuery("WHERE `networkports_id` = '$portID' AND `vlans_id` = '$vlanID'"); return $this->delete($this->fields); } /** * @param $port * @param $vlan * @param $tagged **/ function assignVlan($port, $vlan, $tagged) { $input = array('networkports_id' => $port, 'vlans_id' => $vlan, 'tagged' => $tagged); return $this->add($input); } /** * @param $port NetworkPort object **/ static function showForNetworkPort(NetworkPort $port) { global $DB, $CFG_GLPI; $ID = $port->getID(); if (!$port->can($ID, 'r')) { return false; } $canedit = $port->can($ID, 'w'); $rand = mt_rand(); $query = "SELECT `glpi_networkports_vlans`.id as assocID, `glpi_networkports_vlans`.tagged , `glpi_vlans`.* FROM `glpi_networkports_vlans` LEFT JOIN `glpi_vlans` ON (`glpi_networkports_vlans`.`vlans_id` = `glpi_vlans`.`id`) WHERE `networkports_id` = '$ID'"; $result = $DB->query($query); $vlans = array(); $used = array(); if ($number = $DB->numrows($result)) { while ($line = $DB->fetch_assoc($result)) { $used[$line["id"]] = $line["id"]; $vlans[$line["assocID"]] = $line; } } if ($canedit) { echo "
    \n"; echo "\n"; echo "\n"; echo ""; echo ""; echo ""; echo ""; echo "\n"; echo "
    ".__('Associate a VLAN')."
    "; echo ""; Vlan::dropdown(array('used' => $used)); echo "".__('Tagged').""; echo "
    \n"; Html::closeForm(); echo "
    \n"; } echo "
    "; if ($canedit && $number) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $massiveactionparams = array('num_displayed' => $number); Html::showMassiveActions(__CLASS__, $massiveactionparams); } echo ""; echo ""; if ($canedit && $number) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; $used = array(); foreach ($vlans as $data) { echo ""; if ($canedit) { echo ""; } $name = $data["name"]; if ($_SESSION["glpiis_ids_visible"] || empty($data["name"])) { $name = sprintf(__('%1$s (%2$s)'), $name, $data["id"]); } echo ""; echo ""; echo ""; echo ""; } echo "
    ".Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand)."".__('Name')."".__('Entity')."".__('Tagged')."".__('ID TAG')."
    "; Html::showMassiveActionCheckBox(__CLASS__, $data["assocID"]); echo " ".$name. ""; echo "".Dropdown::getDropdownName("glpi_entities", $data["entities_id"]); echo "".Dropdown::getYesNo($data["tagged"])."".$data["tag"]."
    "; if ($canedit && $number) { $massiveactionparams['ontop'] = false; Html::showMassiveActions(__CLASS__, $massiveactionparams); Html::closeForm(); } echo "
    "; } /** * @param $portID **/ static function getVlansForNetworkPort($portID) { global $DB; $vlans = array(); $query = "SELECT `vlans_id` FROM `glpi_networkports_vlans` WHERE `networkports_id` = '$portID'"; foreach ($DB->request($query) as $data) { $vlans[$data['vlans_id']] = $data['vlans_id']; } return $vlans; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { switch ($item->getType()) { case 'NetworkPort' : if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(Vlan::getTypeName(), countElementsInTable($this->getTable(), "networkports_id = '".$item->getID()."'")); } return Vlan::getTypeName(); } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType()=='NetworkPort') { self::showForNetworkPort($item); } return true; } } ?> glpi-0.84.3+dfsg.1/inc/networkportaggregate.class.php000066400000000000000000000102401226600447100224510ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// NetworkPortAggregate class : aggregate instantiation of NetworkPort. Aggregate can represent a /// trunk on switch, specific port under that regroup several ethernet ports to manage Ethernet /// Bridging. /// @since 0.84 class NetworkPortAggregate extends NetworkPortInstantiation { static function getTypeName($nb=0) { return __('Aggregation port'); } function prepareInputForAdd($input) { if ((isset($input['networkports_id_list'])) && is_array($input['networkports_id_list'])) { $input['networkports_id_list'] = exportArrayToDB($input['networkports_id_list']); } else { $input['networkports_id_list'] = exportArrayToDB(array()); } return parent::prepareInputForAdd($input); } function prepareInputForUpdate($input) { if ((isset($input['networkports_id_list'])) && is_array($input['networkports_id_list'])) { $input['networkports_id_list'] = exportArrayToDB($input['networkports_id_list']); } else { $input['networkports_id_list'] = exportArrayToDB(array()); } return parent::prepareInputForAdd($input); } function showInstantiationForm(NetworkPort $netport, $options=array(), $recursiveItems) { if (isset($this->fields['networkports_id_list']) && is_string($this->fields['networkports_id_list'])) { $this->fields['networkports_id_list'] = importArrayFromDB($this->fields['networkports_id_list']); } echo ""; $this->showMacField($netport, $options); $this->showNetworkPortSelector($recursiveItems, $this->getType()); echo ""; } /** * @see NetworkPortInstantiation::getInstantiationHTMLTableHeaders **/ function getInstantiationHTMLTableHeaders(HTMLTableGroup $group, HTMLTableSuperHeader $super, HTMLTableSuperHeader $internet_super=NULL, HTMLTableHeader $father=NULL, array $options=array()) { $group->addHeader('Origin', __('Origin port'), $super); parent::getInstantiationHTMLTableHeaders($group, $super, $internet_super, $father, $options); return NULL; } /** * @see NetworkPortInstantiation::getInstantiationHTMLTable() **/ function getInstantiationHTMLTable(NetworkPort $netport, HTMLTableRow $row, HTMLTableCell $father=NULL, array $options=array()) { if (isset($this->fields['networkports_id_list']) && is_string($this->fields['networkports_id_list'])) { $this->fields['networkports_id_list'] = importArrayFromDB($this->fields['networkports_id_list']); } $row->addCell($row->getHeaderByName('Instantiation', 'Origin'), $this->getInstantiationNetworkPortHTMLTable()); parent::getInstantiationHTMLTable($netport, $row, $father, $options); return NULL; } } ?> glpi-0.84.3+dfsg.1/inc/networkportalias.class.php000066400000000000000000000070401226600447100216200ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// NetworkPortAlias class : alias instantiation of NetworkPort. An alias can be use to define VLAN /// tagged ports. It is use in old version of Linux to define several IP addresses to a given port. /// @since 0.84 class NetworkPortAlias extends NetworkPortInstantiation { static function getTypeName($nb=0) { return __('Alias port'); } function prepareInput($input) { // Try to get mac address from the instantiation ... if (!isset($input['mac']) && isset($input['networkports_id_alias'])) { $networkPort = new NetworkPort(); if ($networkPort->getFromDB($input['networkports_id_alias'])) { $input['mac'] = $networkPort->getField('mac'); } } return $input; } function prepareInputForAdd($input) { return parent::prepareInputForAdd($this->prepareInput($input)); } function prepareInputForUpdate($input) { return parent::prepareInputForUpdate($this->prepareInput($input)); } function showInstantiationForm(NetworkPort $netport, $options=array(), $recursiveItems) { echo ""; $this->showMacField($netport, $options); $this->showNetworkPortSelector($recursiveItems, $this->getType()); echo ""; } /** * @see NetworkPortInstantiation::getInstantiationHTMLTableHeaders **/ function getInstantiationHTMLTableHeaders(HTMLTableGroup $group, HTMLTableSuperHeader $super, HTMLTableSuperHeader $internet_super=NULL, HTMLTableHeader $father=NULL, array $options=array()) { $group->addHeader('Origin', __('Origin port'), $super); parent::getInstantiationHTMLTableHeaders($group, $super, $internet_super, $father, $options); return NULL; } /** * @see NetworkPortInstantiation::getInstantiationHTMLTable() **/ function getInstantiationHTMLTable(NetworkPort $netport, HTMLTableRow $row, HTMLTableCell $father=NULL, array $options=array()) { $row->addCell($row->getHeaderByName('Instantiation', 'Origin'), $this->getInstantiationNetworkPortHTMLTable()); parent::getInstantiationHTMLTable($netport, $row, $father, $options); return NULL; } } ?> glpi-0.84.3+dfsg.1/inc/networkportdialup.class.php000066400000000000000000000056231226600447100220120ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// NetworkPortDialup class : dialup instantiation of NetworkPort. A dialup connexion also known as /// point-to-point protocol allows connexion between to sites through specific connexion /// @since 0.84 class NetworkPortDialup extends NetworkPortInstantiation { static function getTypeName($nb=0) { return __('Connection by dial line - Dialup Port'); } /** * @see NetworkPortInstantiation::getInstantiationHTMLTableHeaders **/ function getInstantiationHTMLTableHeaders(HTMLTableGroup $group, HTMLTableSuperHeader $super, HTMLTableSuperHeader $internet_super=NULL, HTMLTableHeader $father=NULL, array $options=array()) { $header = $group->addHeader('Connected', __('Connected to'), $super); parent::getInstantiationHTMLTableHeaders($group, $super, $internet_super, $header, $options); return NULL; } /** * @see NetworkPortInstantiation::getInstantiationHTMLTable() **/ function getInstantiationHTMLTable(NetworkPort $netport, HTMLTableRow $row, HTMLTableCell $father=NULL, array $options=array()) { return parent::getInstantiationHTMLTableWithPeer($netport, $row, $father, $options); } /** * @see NetworkPortInstantiation::showInstantiationForm() **/ function showInstantiationForm(NetworkPort $netport, $options=array(), $recursiveItems) { echo ""; $this->showMacField($netport, $options); echo "".__('Connected to').''; self::showConnection($netport, true); echo ""; echo ""; } } ?> glpi-0.84.3+dfsg.1/inc/networkportethernet.class.php000066400000000000000000000267071226600447100223600ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// NetworkPortEthernet class : Ethernet instantiation of NetworkPort /// @since 0.84 class NetworkPortEthernet extends NetworkPortInstantiation { static function getTypeName($nb=0) { return __('Ethernet port'); } function getNetworkCardInterestingFields() { return array('link.`mac`' => 'mac'); } function prepareInput($input) { if (isset($input['speed']) && ($input['speed'] == 'speed_other_value')) { $speed = self::transformPortSpeed($input['speed_other_value'], false); if ($speed === false) { unset($input['speed']); } else { $input['speed'] = $speed; } } return $input; } function prepareInputForAdd($input) { return parent::prepareInputForAdd($this->prepareInput($input)); } function prepareInputForUpdate($input) { return parent::prepareInputForUpdate($this->prepareInput($input)); } function showInstantiationForm(NetworkPort $netport, $options=array(), $recursiveItems) { if (!$options['several']) { echo ""; $this->showNetpointField($netport, $options, $recursiveItems); $this->showNetworkCardField($netport, $options, $recursiveItems); echo "\n"; } echo ""; echo "" . __('Ethernet port type') . "\n"; Dropdown::showFromArray('type', self::getPortTypeName(), array('value' => $this->fields['type'])); echo ""; echo "" . __('Ethernet port speed') . "\n"; $standard_speeds = self::getPortSpeed(); if (!isset($standard_speeds[$this->fields['speed']]) && !empty($this->fields['speed'])) { $speed = self::transformPortSpeed($this->fields['speed'], true); } else { $speed = true; } Dropdown::showFromArray('speed', $standard_speeds, array('value' => $this->fields['speed'], 'other' => $speed)); echo ""; echo "\n"; echo "\n"; $this->showMacField($netport, $options); echo "".__('Connected to').''; self::showConnection($netport, true); echo ""; echo "\n"; } /** * @see NetworkPortInstantiation::getInstantiationHTMLTableHeaders **/ function getInstantiationHTMLTableHeaders(HTMLTableGroup $group, HTMLTableSuperHeader $super, HTMLTableSuperHeader $internet_super=NULL, HTMLTableHeader $father=NULL, array $options=array()) { $display_options = &$options['display_options']; $header = $group->addHeader('Connected', __('Connected to'), $super); DeviceNetworkCard::getHTMLTableHeader('NetworkPortEthernet', $group, $super, $header, $options); $group->addHeader('speed', __('Ethernet port speed'), $super, $header); $group->addHeader('type', __('Ethernet port type'), $super, $header); Netpoint::getHTMLTableHeader('NetworkPortEthernet', $group, $super, $header, $options); $group->addHeader('Outlet', __('Network outlet'), $super, $header); parent::getInstantiationHTMLTableHeaders($group, $super, $internet_super, $header, $options); return $header; } /** * @see NetworkPortInstantiation::getPeerInstantiationHTMLTable() **/ protected function getPeerInstantiationHTMLTable(NetworkPort $netport, HTMLTableRow $row, HTMLTableCell $father=NULL, array $options=array()) { DeviceNetworkCard::getHTMLTableCellsForItem($row, $this, $father, $options); if (!empty($this->fields['speed'])) { $row->addCell($row->getHeaderByName('Instantiation', 'speed'), self::getPortSpeed($this->fields["speed"]), $father); } if (!empty($this->fields['type'])) { $row->addCell($row->getHeaderByName('Instantiation', 'type'), self::getPortTypeName($this->fields["type"]), $father); } parent::getInstantiationHTMLTable($netport, $row, $father, $options); Netpoint::getHTMLTableCellsForItem($row, $this, $father, $options); } /** * @see NetworkPortInstantiation::getInstantiationHTMLTable() **/ function getInstantiationHTMLTable(NetworkPort $netport, HTMLTableRow $row, HTMLTableCell $father=NULL, array $options=array()) { return parent::getInstantiationHTMLTableWithPeer($netport, $row, $father, $options); } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[10]['table'] = $this->getTable(); $tab[10]['field'] = 'mac'; $tab[10]['datatype'] = 'mac'; $tab[10]['name'] = __('MAC'); $tab[10]['massiveaction'] = false; $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'type'; $tab[11]['name'] = __('Ethernet port type'); $tab[11]['massiveaction'] = false; $tab[11]['datatype'] = 'specific'; $tab[12]['table'] = $this->getTable(); $tab[12]['field'] = 'speed'; $tab[12]['name'] = __('Ethernet port speed'); $tab[12]['massiveaction'] = false; $tab[12]['datatype'] = 'specific'; return $tab; } /** * Get the possible value for Ethernet port type * * @param $val if not set, ask for all values, else for 1 value (default NULL) * * @return array or string **/ static function getPortTypeName($val=NULL) { $tmp[''] = Dropdown::EMPTY_VALUE; $tmp['T'] = __('Twisted pair (RJ-45)'); $tmp['SX'] = __('Multimode fiber'); $tmp['LX'] = __('Single mode fiber'); if (is_null($val)) { return $tmp; } if (isset($tmp[$val])) { return $tmp[$val]; } return NOT_AVAILABLE; } /** * Transform a port speed from string to integerer and vice-versa * * @param $val port speed (integer or string) * @param $to_string (boolean) true if we must transform the speed to string * * @return integer or string (regarding what is requested) **/ static function transformPortSpeed($val, $to_string) { if ($to_string) { if (($val % 1000) == 0) { //TRANS: %d is the speed return sprintf(__('%d Gbit/s'), $val / 1000); } if ((($val % 100) == 0) && ($val > 1000)) { $val /= 100; //TRANS: %f is the speed return sprintf(__('%.1f Gbit/s'), $val / 10); } //TRANS: %d is the speed return sprintf(__('%d Mbit/s'), $val); } else { $val = preg_replace( '/\s+/', '', strtolower($val)); $number = sscanf($val, "%f%s", $speed, $unit); if ($number != 2) { return false; } if (($unit == 'mbit/s') || ($unit == 'mb/s')) { return (int)$speed; } if (($unit == 'gbit/s') || ($unit == 'gb/s')) { return (int)($speed * 1000); } return false; } } /** * Get the possible value for Ethernet port speed * * @param $val if not set, ask for all values, else for 1 value (default NULL) * * @return array or string **/ static function getPortSpeed($val=NULL) { $tmp = array(0 => '', //TRANS: %d is the speed 10 => sprintf(__('%d Mbit/s'),10), 100 => sprintf(__('%d Mbit/s'),100), //TRANS: %d is the speed 1000 => sprintf(__('%d Gbit/s'),1), 10000 => sprintf(__('%d Gbit/s'),10)); if (is_null($val)) { return $tmp; } if (isset($tmp[$val])) { return $tmp[$val]; } return self::transformPortSpeed($val, true); } /** * @param $field * @param $values * @param $options array **/ static function getSpecificValueToDisplay($field, $values, array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } switch ($field) { case 'type': return self::getPortTypeName($values[$field]); case 'speed': return self::getPortSpeed($values[$field]); } return parent::getSpecificValueToDisplay($field, $values, $options); } /** * @param $field * @param $name (default '') * @param $values (defaul '') * @param $options array */ static function getSpecificValueToSelect($field, $name='', $values='', array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'type': $options['value'] = $values[$field]; return Dropdown::showFromArray($name, self::getPortTypeName(), $options); case 'speed': $options['value'] = $values[$field]; return Dropdown::showFromArray($name, self::getPortSpeed(), $options); } return parent::getSpecificValueToSelect($field, $name, $values, $options); } /** * @param $tab array * @param $joinparams array * @param $itemtype **/ static function getSearchOptionsToAddForInstantiation(array &$tab, array $joinparams, $itemtype) { $tab[22]['table'] = 'glpi_netpoints'; $tab[22]['field'] = 'name'; $tab[22]['datatype'] = 'dropdown'; $tab[22]['name'] = __('Network outlet'); $tab[22]['forcegroupby'] = true; $tab[22]['massiveaction'] = false; $tab[22]['joinparams'] = array('jointype' => 'standard', 'beforejoin' => array('table' => 'glpi_networkportethernets', 'joinparams' => $joinparams)); } } ?> glpi-0.84.3+dfsg.1/inc/networkportinstantiation.class.php000066400000000000000000001017271226600447100234220ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// NetworkPortInstantiation class /// Represents the type of a given network port. As such, its ID field is the same one than the ID /// of the network port it instantiates. This class don't have any table associated. It just /// provides usefull and default methods for the instantiations. /// Several kind of instanciations are available for a given port : /// - NetworkPortLocal /// - NetworkPortEthernet /// - NetworkPortWifi /// - NetworkPortAggregate /// - NetworkPortAlias /// @since 0.84 class NetworkPortInstantiation extends CommonDBChild { // From CommonDBTM var $auto_message_on_action = false; // From CommonDBChild static public $itemtype = 'NetworkPort'; static public $items_id = 'networkports_id'; public $dohistory = false; // Instantiation properties public $canHaveVLAN = true; public $canHaveVirtualPort = true; public $haveMAC = true; static function getIndexName() { return 'networkports_id'; } /** * Show the instanciation element for the form of the NetworkPort * By default, just print that there is no parameter for this type of NetworkPort * * @param $netport the port that owns this instantiation * (usefull, for instance to get network port attributs * @param $options array of options given to NetworkPort::showForm * @param $recursiveItems list of the items on which this port is attached **/ function showInstantiationForm(NetworkPort $netport, $options=array(), $recursiveItems) { echo "".__('No options available for this port type.'). ""; } function prepareInput($input) { // Try to get mac address from the instantiation ... if (!empty($input['mac'])) { $input['mac'] = strtolower($input['mac']) ; } return $input; } function prepareInputForAdd($input) { return parent::prepareInputForAdd($this->prepareInput($input)); } function prepareInputForUpdate($input) { return parent::prepareInputForUpdate($this->prepareInput($input)); } /** * Get all the instantiation specific options to display * * @return array containing the options **/ static function getInstantiationNetworkPortDisplayOptions() { return array(); } /** * Get the instantiation specific options to display that applies for all instantiations * * @return array containing the options **/ static function getGlobalInstantiationNetworkPortDisplayOptions() { return array('mac' => array('name' => __('MAC'), 'default' => true), 'vlans' => array('name' => __('VLAN'), 'default' => false), 'virtual_ports' => array('name' => __('Virtual ports'), 'default' => false), 'port_opposite' => array('name' => __('Opposite link'), 'default' => false)); } /** * Get HTMLTable columns headers for a given item type * Beware : the internet informations are "sons" of each instantiation ... * * @param $group HTMLTableGroup object * @param $super HTMLTableSuperHeader object * @param $internet_super HTMLTableSuperHeader object for the internet sub part (default NULL) * @param $father HTMLTableHeader object (default NULL) * @param $options array of possible options: * - 'dont_display' : array of the columns that must not be display * * @return the father group for the Internet Informations ... **/ function getInstantiationHTMLTableHeaders(HTMLTableGroup $group, HTMLTableSuperHeader $super, HTMLTableSuperHeader $internet_super=NULL, HTMLTableHeader $father=NULL, array $options=array()) { $display_options = &$options['display_options']; if (($this->canHaveVirtualPort) && ($display_options['virtual_ports'])) { $father = $group->addHeader('VirtualPorts', ''.__('Virtual ports').'', $super, $father); } if (($this->canHaveVLAN) && ($display_options['vlans'])) { NetworkPort_Vlan::getHTMLTableHeader('NetworkPort', $group, $super, $father, $options); } if (($this->haveMAC) && ($display_options['mac'])) { $group->addHeader('MAC', __('MAC'), $super, $father); } if (($internet_super !== NULL) && ($display_options['internet'])) { NetworkName::getHTMLTableHeader('NetworkPort', $group, $internet_super, $father, $options); } return NULL; } /** * Get HTMLTable row for a given network port and a given extremity when two ports are * existing on a link (NetworkPort_NetworkPort). * * @param $netport NetworkPort object (contains item) * @param $row HTMLTableRow object * @param $father HTMLTableHeader object (default NULL) * @param $options array of possible options: * - 'dont_display' : array of the elements that must not be display * - 'withtemplate' : integer withtemplate param * * @return the father cell for the Internet Informations ... **/ protected function getPeerInstantiationHTMLTable(NetworkPort $netport, HTMLTableRow $row, HTMLTableCell $father=NULL, array $options=array()) { self::getInstantiationHTMLTable($netport, $row, $father, $options); return NULL; } /** * Replacement of NetworkPortInstantiation::getInstantiationHTMLTable() method when two ports * share the same link (NetworkPort_NetworkPort). Used, for instance by Dialup and Ethernet. * * @see NetworkPortInstantiation::getInstantiationHTMLTable() * * @param $netport NetworkPort object (contains item) * @param $row HTMLTableRow object * @param $father HTMLTableHeader object (default NULL) * @param $options array of possible options: * - 'dont_display' : array of the elements that must not be display * - 'withtemplate' : integer withtemplate param * * @return the father cell for the Internet Informations ... **/ function getInstantiationHTMLTableWithPeer(NetworkPort $netport, HTMLTableRow $row, HTMLTableCell $father=NULL, array $options=array()) { $connect_cell_value = array(array('function' => array(__CLASS__, 'showConnection'), 'parameters' => array(clone $netport))); $oppositePort = NetworkPort_NetworkPort::getOpposite($netport); if ($oppositePort !== false) { $opposite_options = $options; $opposite_options['canedit'] = false; $display_options = $options['display_options']; if ($display_options['port_opposite']) { $cell = $row->addCell($row->getHeaderByName('Instantiation', 'Connected'), __('Local network port')); $opposite_cell = $row->addCell($row->getHeaderByName('Instantiation', 'Connected'), $connect_cell_value); $opposite_cell->setAttributForTheRow(array('class' => 'htmltable_upper_separation_cell')); $oppositeInstantiationPort = $oppositePort->getInstantiation(); if ($oppositeInstantiationPort !== false) { $oppositeInstantiationPort->getPeerInstantiationHTMLTable($oppositePort, $row, $opposite_cell, $opposite_options); } } else { $cell = $row->addCell($row->getHeaderByName('Instantiation', 'Connected'), $connect_cell_value); } } else { $cell = $row->addCell($row->getHeaderByName('Instantiation', 'Connected'), $connect_cell_value); } $this->getPeerInstantiationHTMLTable($netport, $row, $cell, $options); return $cell; } /** * Get HTMLTable row for a given item * * @param $netport NetworkPort object (contains item) * @param $row HTMLTableRow object * @param $father HTMLTableHeader object (default NULL) * @param $options array of possible options: * - 'dont_display' : array of the elements that must not be display * - 'withtemplate' : integer withtemplate param * * @return the father cell for the Internet Informations ... **/ function getInstantiationHTMLTable(NetworkPort $netport, HTMLTableRow $row, HTMLTableCell $father=NULL, array $options=array()) { global $DB; $display_options = $options['display_options']; if (($this->canHaveVirtualPort) && ($display_options['virtual_ports'])) { $virtual_header = $row->getHeaderByName('Instantiation', 'VirtualPorts'); $query = "(SELECT `networkports_id` FROM `glpi_networkportaliases` WHERE `networkports_id_alias`='".$netport->getID()."') UNION (SELECT `networkports_id` FROM `glpi_networkportaggregates` WHERE `networkports_id_list` LIKE '%\"".$netport->getID()."\"%')"; $iterator = $DB->request($query); if ($iterator->numrows() > 0) { $new_father = $row->addCell($virtual_header, __('this port'), $father); } else { $new_father = $row->addCell($virtual_header, '', $father); } foreach ($iterator as $networkports_ids) { $virtualPort = new NetworkPort(); if ($virtualPort->getFromDB($networkports_ids['networkports_id'])) { $cell_value = ''.$virtualPort->getLink().''; $virtual_cell = $row->addCell($virtual_header, $cell_value, $father); $virtual_cell->setAttributForTheRow(array('class' => 'htmltable_upper_separation_cell')); if (($this->canHaveVLAN) && ($display_options['vlans'])) { NetworkPort_Vlan::getHTMLTableCellsForItem($row, $virtualPort, $virtual_cell, $options); } if ($display_options['internet']) { NetworkName::getHTMLTableCellsForItem($row, $virtualPort, $virtual_cell, $options); } } unset($virtualPort); } $father = $new_father; } if (($this->canHaveVLAN) && ($display_options['vlans'])) { NetworkPort_Vlan::getHTMLTableCellsForItem($row, $netport, $father, $options); } if (($this->haveMAC) && ($display_options['mac']) && (!empty($netport->fields["mac"]))) { $row->addCell($row->getHeaderByName('Instantiation', 'MAC'), $netport->fields["mac"], $father); } if ($display_options['internet']) { NetworkName::getHTMLTableCellsForItem($row, $netport, $father, $options); } return NULL; } /** * Get all NetworkPort and NetworkEquipments that have a specific MAC address * * @param $mac address to search * @param $wildcard_search boolean true if we search with wildcard (false by default) * * @return (array) each value of the array (corresponding to one NetworkPort) is an array of the * items from the master item to the NetworkPort **/ static function getItemsByMac($mac, $wildcard_search=false) { global $DB; $mac = strtolower($mac); if ($wildcard_search) { $count = 0; $mac = str_replace('*', '%', $mac, $count); if ($count == 0) { $mac = '%'.$mac.'%'; } $relation = "LIKE '$mac'"; } else { $relation = "= '$mac'"; } $macItemWithItems = array(); foreach (array('NetworkPort', 'NetworkEquipment') as $netporttype) { $netport = new $netporttype(); $query = "SELECT `id` FROM `".$netport->getTable()."` WHERE `mac` $relation "; foreach ($DB->request($query) as $element) { if ($netport->getFromDB($element['id'])) { if ($netport instanceof CommonDBChild) { $macItemWithItems[] = array_merge(array_reverse($netport->recursivelyGetItems()), array(clone $netport)); } else { $macItemWithItems[] = array(clone $netport); } } } } return $macItemWithItems; } /** * Get an Object ID by its MAC address (only if one result is found in the entity) * * @param $value the mac address * @param $entity the entity to look for * * @return an array containing the object ID * or an empty array is no value of serverals ID where found **/ static function getUniqueItemByMac($value, $entity) { $macs_with_items = self::getItemsByMac($value); if (count($macs_with_items) == 1) { $mac_with_items = $macs_with_items[0]; $item = $mac_with_items[0]; if ($item->getEntityID() == $entity) { $result = array("id" => $item->getID(), "itemtype" => $item->getType()); unset($macs_with_items); return $result; } } return array(); } /** * In case of NetworkPort attached to a network card, list the fields that must be duplicate * from the network card to the network port (mac address, port type, ...) * * @return an array with SQL field (for instance : device.`type`) => form field (type) **/ function getNetworkCardInterestingFields() { return array(); } /** * Select which network card to attach to the current NetworkPort (for the moment, only ethernet * and wifi ports). Whenever a card is attached, its information (mac, type, ...) are * autmatically set to the required field. * * @param $netport NetworkPort object :the port that owns this instantiation * (usefull, for instance to get network port attributs * @param $options array of options given to NetworkPort::showForm * @param $recursiveItems list of the items on which this port is attached **/ function showNetworkCardField(NetworkPort $netport, $options=array(), $recursiveItems) { global $DB; echo "" . __('Network card') . "\n"; echo ""; if (count($recursiveItems) > 0) { $lastItem = $recursiveItems[count($recursiveItems) - 1]; // Network card association is only available for computers if (($lastItem->getType() == 'Computer') && !$options['several']) { // Query each link to network cards $query = "SELECT link.`id` AS link_id, device.`designation` AS name"; // $deviceFields contains the list of fields to update $deviceFields = array(); foreach ($this->getNetworkCardInterestingFields() as $SQL_field => $form_field) { $deviceFields[] = $form_field; $query .= ", $SQL_field AS $form_field"; } $query .= " FROM `glpi_devicenetworkcards` AS device, `glpi_items_devicenetworkcards` AS link WHERE link.`items_id` = '".$lastItem->getID()."' AND link.`itemtype` = '".$lastItem->getType()."' AND device.`id` = link.`devicenetworkcards_id`"; // TODO : add checking the type of network card ! // Add the javascript to update each field echo "\n\n"; if (count($deviceNames) > 0) { $options = array('value' => $this->fields['items_devicenetworkcards_id'], 'on_change' => 'updateNetworkPortForm(this.options[this.selectedIndex].value)'); Dropdown::showFromArray('items_devicenetworkcards_id', $deviceNames, $options); } else { _e('No network card available'); } } else { _e('Equipment without network card'); } } else { _e('Item not linked to an object'); } echo ""; } /** * Display the MAC field. Used by Ethernet, Wifi, Aggregate and alias NetworkPorts * * @param $netport NetworkPort object : the port that owns this instantiation * (usefull, for instance to get network port attributs * @param $options array of options given to NetworkPort::showForm **/ function showMacField(NetworkPort $netport, $options=array()) { // Show device MAC adresses echo "" . __('MAC') ."\n"; Html::autocompletionTextField($netport, "mac"); echo "\n"; } /** * Display the Netpoint field. Used by Ethernet, and Migration * * @param $netport NetworkPort object :the port that owns this instantiation * (usefull, for instance to get network port attributs * @param $options array of options given to NetworkPort::showForm * @param $recursiveItems list of the items on which this port is attached **/ function showNetpointField(NetworkPort $netport, $options=array(), $recursiveItems) { echo "" . __('Network outlet') . "\n"; echo ""; if (count($recursiveItems) > 0) { $lastItem = $recursiveItems[count($recursiveItems) - 1]; Netpoint::dropdownNetpoint("netpoints_id", $this->fields["netpoints_id"], $lastItem->fields['locations_id'], 1, $lastItem->getEntityID(), $netport->fields["itemtype"]); } else { _e('item not linked to an object'); } echo ""; } /** * \brief display the attached NetworkPort * * NetworkPortAlias and NetworkPortAggregate are based on other physical network ports * (Ethernet or Wifi). This method displays the physical network ports. **/ function getInstantiationNetworkPortHTMLTable() { $netports = array(); // Manage alias if (isset($this->fields['networkports_id_alias'])) { $links_id = $this->fields['networkports_id_alias']; $netport = new NetworkPort(); if ($netport->getFromDB($links_id)) { $netports[] = $netport->getLink(); } } // Manage aggregate if (isset($this->fields['networkports_id_list'])) { $links_id = $this->fields['networkports_id_list']; $netport = new NetworkPort(); foreach ($links_id as $id) { if ($netport->getFromDB($id)) { $netports[] = $netport->getLink(); } } } if (count($netports) > 0) { return implode('
    ', $netports); } return " "; } /** * \brief select which NetworkPort to attach * * NetworkPortAlias and NetworkPortAggregate ara based on other physical network ports * (Ethernet or Wifi). This method Allows us to select which one to select. * * @param $recursiveItems * @param $origin NetworkPortAlias are based on one NetworkPort wherever * NetworkPortAggregate are based on several NetworkPort. **/ function showNetworkPortSelector($recursiveItems, $origin) { global $DB; if (count($recursiveItems) == 0) { return; } $lastItem = $recursiveItems[count($recursiveItems) - 1]; echo "" . __('Origin port') . "\n"; $links_id = array(); $netport_types = array('NetworkPortEthernet', 'NetworkPortWifi'); $selectOptions = array(); $possible_ports = array(); switch ($origin) { case 'NetworkPortAlias' : $possible_ports[-1] = Dropdown::EMPTY_VALUE; $field_name = 'networkports_id_alias'; $selectOptions['multiple'] = false; $selectOptions['on_change'] = 'updateForm(this.options[this.selectedIndex].value)'; $netport_types[] = 'NetworkPortAggregate'; break; case 'NetworkPortAggregate' : $field_name = 'networkports_id_list'; $selectOptions['multiple'] = true; $selectOptions['size'] = 4; $selectOptions['mark_unmark_all'] = true; $netport_types[] = 'NetworkPortAlias'; break; } if (isset($this->fields[$field_name])) { if (is_array($this->fields[$field_name])) { $selectOptions['values'] = $this->fields[$field_name]; } else { $selectOptions['values'] = array($this->fields[$field_name]); } } $macAddresses = array(); foreach ($netport_types as $netport_type) { $instantiationTable = getTableForItemType($netport_type); $query = "SELECT port.`id`, port.`name`, port.`mac` FROM `glpi_networkports` AS port WHERE `items_id` = '".$lastItem->getID()."' AND `itemtype` = '".$lastItem->getType()."' AND `instantiation_type` = '$netport_type' ORDER BY `logical_number`, `name`"; $result = $DB->query($query); if ($DB->numrows($result) > 0) { $array_element_name = call_user_func(array($netport_type, 'getTypeName'), $DB->numrows($result)); $possible_ports[$array_element_name] = array(); while ($portEntry = $DB->fetch_assoc($result)) { $macAddresses[$portEntry['id']] = $portEntry['mac']; if (!empty($portEntry['mac'])) { $portEntry['name'] = sprintf(__('%1$s - %2$s'), $portEntry['name'], $portEntry['mac']); } $possible_ports[$array_element_name][$portEntry['id']] = $portEntry['name']; } } } if (!$selectOptions['multiple']) { echo "\n\n"; } Dropdown::showFromArray($field_name, $possible_ports, $selectOptions); echo "\n"; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if ($item->getType() == "NetworkPort") { $instantiation = $item->getInstantiation(); if ($instantiation !== false) { $log = new Log(); //TRANS: %1$s is a type, %2$s is a table return sprintf(__('%1$s - %2$s'), $instantiation->getTypeName(), $log->getTabNameForItem($instantiation)); } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType() == "NetworkPort") { $instantiation = $item->getInstantiation(); if ($instantiation !== false) { return Log::displayTabContentForItem($instantiation, $tabnum, $withtemplate); } } } /** * @param $tab array * @param $joinparams array * @param $itemtype **/ static function getSearchOptionsToAddForInstantiation(array &$tab, array $joinparams, $itemtype) { } /** * Display a connection of a networking port * * @param $netport to be displayed * @param $edit boolean permit to edit ? (false by default) **/ static function showConnection($netport, $edit=false) { $ID = $netport->fields["id"]; if (empty($ID)) { return false; } $device1 = $netport->getItem(); if (!$device1->can($device1->getID(), 'r')) { return false; } $canedit = $device1->can($device1->fields["id"], 'w'); $relations_id = 0; $oppositePort = NetworkPort_NetworkPort::getOpposite($netport, $relations_id); if ($oppositePort !== false) { $device2 = $oppositePort->getItem(); if ($device2->can($device2->fields["id"], 'r')) { $networklink = $oppositePort->getLink(); $tooltip = Html::showToolTip($oppositePort->fields['comment'], array('display' => false)); $netlink = sprintf(__('%1$s %2$s'), "".$networklink."\n", $tooltip); //TRANS: %1$s and %2$s are links echo " ". sprintf(__('%1$s on %2$s'), $netlink, "".$device2->getLink().""); if ($device1->fields["entities_id"] != $device2->fields["entities_id"]) { echo "
    (". Dropdown::getDropdownName("glpi_entities", $device2->getEntityID()) .")"; } // 'w' on dev1 + 'r' on dev2 OR 'r' on dev1 + 'w' on dev2 if ($canedit || $device2->can($device2->fields["id"], 'w')) { echo " "; Html::showSimpleForm($oppositePort->getFormURL(), 'disconnect', __('Disconnect'), array('id' => $relations_id)); } } else { if (rtrim($oppositePort->fields["name"]) != "") { $netname = $oppositePort->fields["name"]; } else { $netname = __('Without name'); } printf(__('%1$s on %2$s'), "".$netname."", "".$device2->getName().""); echo "
    (" .Dropdown::getDropdownName("glpi_entities", $device2->getEntityID()) .")"; } } else { echo "
    " . __('Not connected.') . "
    "; if ($canedit) { if (!$device1->isTemplate()) { if ($edit) { self::dropdownConnect($ID, array('name' => 'NetworkPortConnect_networkports_id_2', 'entity' => $device1->fields["entities_id"], 'entity_sons' => $device1->isRecursive())); } else { echo "getFormURL()."?id=$ID\">". __('Connect').""; } } else { echo " "; } } } } /** * Make a select box for connected port * * @param $ID ID of the current port to connect * @param $options array of possible options: * - name : string / name of the select (default is networkports_id) * - comments : boolean / is the comments displayed near the dropdown (default true) * - entity : integer or array / restrict to a defined entity or array of entities * (default -1 : no restriction) * - entity_sons : boolean / if entity restrict specified auto select its sons * only available if entity is a single value not an array (default false) * * @return nothing (print out an HTML select box) **/ static function dropdownConnect($ID, $options=array()) { global $CFG_GLPI; $p['name'] = 'networkports_id'; $p['comments'] = 1; $p['entity'] = -1; $p['entity_sons'] = false; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } // Manage entity_sons if (!($p['entity'] < 0) && $p['entity_sons']) { if (is_array($p['entity'])) { echo "entity_sons options is not available with entity option as array"; } else { $p['entity'] = getSonsOf('glpi_entities', $p['entity']); } } $rand = mt_rand(); echo ""; echo ""; $params = array('itemtype' => '__VALUE__', 'entity_restrict' => $p['entity'], 'networkports_id' => $ID, 'comments' => $p['comments'], 'myname' => $p['name'], 'instantiation_type' => get_called_class()); Ajax::updateItemOnSelectEvent("itemtype$rand", "show_".$p['name']."$rand", $CFG_GLPI["root_doc"]. "/ajax/dropdownConnectNetworkPortDeviceType.php", $params); echo " \n"; return $rand; } } ?> glpi-0.84.3+dfsg.1/inc/networkportlocal.class.php000066400000000000000000000030341226600447100216200ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// NetworkPortLocal class : local instantiation of NetworkPort. Among others, loopback /// (ie.: 127.0.0.1) /// @since 0.84 class NetworkPortLocal extends NetworkPortInstantiation { public $canHaveVLAN = false; public $haveMAC = false; static function getTypeName($nb=0) { return __('Local loop port'); } } ?> glpi-0.84.3+dfsg.1/inc/networkportmigration.class.php000066400000000000000000000370431226600447100225260ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// NetworkPortMigration class : class of unknown objects defined inside the NetworkPort before 0.84 /// @since 0.84 class NetworkPortMigration extends CommonDBChild { // From CommonDBChild static public $itemtype = 'itemtype'; static public $items_id = 'items_id'; static public $mustBeAttached = true; static function getTypeName($nb=0) { return __('Network port migration'); } static function canCreate() { return false; } static function canUpdate() { return (Session::haveRight('networking','w') && parent::canUpdate()); } static function canView() { return (Session::haveRight('networking','r') && parent::canView()); } static function canDelete() { return (Session::haveRight('networking','w') && parent::canDelete()); } private function cleanDatabase() { global $DB; $networkport = new NetworkPort(); if ($networkport->getFromDB($this->getID())) { if (!in_array($networkport->fields['instantiation_type'], NetworkPort::getNetworkPortInstantiations())) { $networkport->delete($networkport->fields); } } if (countElementsInTable($this->getTable()) == 0) { $query = "DROP TABLE `".$this->getTable()."`"; $DB->query($query); } } function post_purgeItem() { $this->cleanDatabase(); parent::post_purgeItem(); } function post_deleteItem() { $this->cleanDatabase(); parent::post_deleteItem(); } static function getMotives() { return array( 'unknown_interface_type' => __('Undefined interface'), 'invalid_network' => __('Invalid network (already defined or with invalid addresses)'), 'invalid_gateway' => __('Gateway not include inside the network'), 'invalid_address' => __('Invalid IP address') ); } function showForm($ID, $options=array()) { global $CFG_GLPI, $DB; if (!Session::haveRight("networking", "r")) { return false; } $this->check($ID,'r'); $recursiveItems = $this->recursivelyGetItems(); if (count($recursiveItems) > 0) { $lastItem = $recursiveItems[count($recursiveItems) - 1]; $lastItem_entities_id = $lastItem->getField('entities_id'); } else { $lastItem_entities_id = $_SESSION['glpiactive_entity']; } $options['entities_id'] = $lastItem_entities_id; $this->showFormHeader($options); $options['canedit'] = false; $options['candel'] = false; $number_errors = 0; foreach (self::getMotives() as $key => $name) { if ($this->fields[$key] == 1) { $number_errors ++; } } $motives = self::getMotives(); $interface_cell = "td"; $address_cell = "td"; $network_cell = "td"; $gateway_cell = "td"; $address = new IPAddress(); $netmask = new IPNetmask(); $number_real_errors = 0; if ((!$address->setAddressFromString($this->fields['ip'])) || (!$netmask->setNetmaskFromString($this->fields['netmask'], $address->getVersion()))) { unset ($address); unset ($netmask); } else { $network = new IPNetwork(); $params = array("address" => $address, "netmask" => $netmask); if (isset($this->fields["address"])) { $params["exclude IDs"] = $this->fields["address"]; } if (isset($this->fields["entities_id"])) { $entity = $this->fields["entities_id"]; } else { $entity = -1; } $networkports_ids = IPNetwork::searchNetworks("equals", $params, $entity, false); if (count($networkports_ids) == 0) { unset($network); } else { $network->getFromDB($networkports_ids[0]); } } if ($this->fields['unknown_interface_type'] == 1) { $options['canedit'] = true; $number_real_errors ++; $interface_cell = "th"; echo "". $motives['unknown_interface_type'] ."\n". "" .__('Transform this network port to'); echo ""; Dropdown::showItemTypes('transform_to', NetworkPort::getNetworkPortInstantiations(), array('value' => "NetworkPortEthernet")); echo "\n"; } if ($this->fields['invalid_network'] == 1) { $number_real_errors ++; $network_cell = "th"; $address_cell = "th"; echo "" .$motives['invalid_network'] ."\n"; if (isset($network)) { printf(__('Network port information conflicting with %s'), $network->getLink()); } else { if (!isset($address) || !isset($netmask)) { _e('Invalid address or netmask'); } else { _e('No conflicting network'); } echo " " . __('you may have to add a network').""; } echo "\n"; } if ($this->fields['invalid_gateway'] == 1) { $number_real_errors ++; $gateway_cell = "th"; echo "" . $motives['invalid_gateway'] ."\n"; if (isset($network)) { printf(__('Append a correct gateway to the network %s'), $network->getLink()); } else { printf(__('%1$s: %2$s'), __('Unknown network'), "".__('Add a network')." "); } echo "\n"; } if ($this->fields['invalid_address'] == 1) { $number_real_errors ++; $address_cell = "th"; echo "" .$motives['invalid_address'] ."\n"; $networkPort = new NetworkPort(); if ($networkPort->getFromDB($this->getID())) { $number_real_errors ++; echo "". __('Add a correct IP to the network port') . ""; } else { _e('Unknown network port'); } echo "\n"; } if ($number_real_errors == 0) { echo "" . __('I don\'t understand why this migration error is not deleted.'); echo ""; Html::showSimpleForm($this->getFormURL(), 'delete', __('You can delete this migration error'), array('id' => $this->getID())); echo "\n"; } else { echo "" . __('At all events') . "\n"; echo ""; Html::showSimpleForm($this->getFormURL(), 'delete', __('You can delete this migration error'), array('id' => $this->getID())); echo "\n"; } echo " \n"; echo "" .__('Original network port information') ."". "\n"; echo ""; $this->displayRecursiveItems($recursiveItems, 'Type'); echo "\n"; $this->displayRecursiveItems($recursiveItems, "Link"); echo "\n"; echo "".__('Comments').""; echo "" . $this->fields["comment"] . "\n"; echo "". __('Network address') ."\n"; echo "<$network_cell>" . $this->fields['subnet'] . "\n"; echo "". IPNetmask::getTypeName(1) ."\n"; echo "<$network_cell>" . $this->fields['netmask'] . "\n"; echo "". IPAddress::getTypeName(1) ."\n"; echo "<$address_cell>" . $this->fields['ip'] . "\n"; echo "". __('Gateway') ."\n"; echo "<$gateway_cell>" . $this->fields['gateway'] . "\n"; echo "". __('Network interface') ."<$interface_cell>\n"; if (TableExists('glpi_networkinterfaces')) { $query = "SELECT `name` FROM `glpi_networkinterfaces` WHERE `id`='".$this->fields['networkinterfaces_id']."'"; $result = $DB->query($query); if ($DB->numrows($result) > 0) { $row = $DB->fetch_assoc($result); echo $row['name']; } else { _e('Unknown interface'); } } echo ""; echo "<$interface_cell>"; echo "<$interface_cell>\n"; $this->showFormButtons($options); $this->addDivForTabs(); } /** * @see CommonDBTM::getSpecificMassiveActions() **/ function getSpecificMassiveActions($checkitem=NULL) { $isadmin = static::canUpdate(); $actions = parent::getSpecificMassiveActions($checkitem); if ($isadmin) { $actions['transform_to'] = __('Transform this network port to'); } return $actions; } /** * @see CommonDBTM::showSpecificMassiveActionsParameters() **/ function showSpecificMassiveActionsParameters($input=array()) { switch ($input['action']) { case "transform_to" : Dropdown::showItemTypes('transform_to', NetworkPort::getNetworkPortInstantiations(), array('value' => 'NetworkPortEthernet')); echo "

    "; return true; default : return parent::showSpecificMassiveActionsParameters($input); } return false; } /** * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "transform_to" : if (isset($input["transform_to"]) && !empty($input["transform_to"])) { $networkport = new NetworkPort(); foreach ($input["item"] as $key => $val) { if ($val == 1) { if ($networkport->can($key,'w') && $this->can($key,'d')) { // Don't try to migrate already affected ports if (empty($networkport->fields['instantiation_type'])) { if ($networkport->switchInstantiationType($input['transform_to']) !== false) { $instantiation = $networkport->getInstantiation(); $input2 = $this->fields; $input2['networkports_id'] = $input2['id']; unset($input2['id']); if ($instantiation->add($input2)) { $this->delete(array('id' => $key)); $res['ok']++; } else { $res['ko']++; } } else { $res['ko']++; } } else { $res['ko']++; } } else { $res['noright']++; } } } } else { $res['ko']++; } break; default : return parent::doSpecificMassiveActions($input); } return $res; } function getSearchOptions() { global $CFG_GLPI; $tab = parent::getSearchOptions(); $optionIndex = 10; // From 10 to 14 foreach (self::getMotives() as $motive => $name) { $tab[$optionIndex]['table'] = $this->getTable(); $tab[$optionIndex]['field'] = $motive; $tab[$optionIndex]['name'] = $name; $tab[$optionIndex]['datatype'] = 'bool'; $optionIndex ++; } $tab[20]['table'] = $this->getTable(); $tab[20]['field'] = 'ip'; $tab[20]['datatype'] = 'ip'; $tab[20]['name'] = IPAddress::getTypeName(1); $tab[21]['table'] = $this->getTable(); $tab[21]['field'] = 'netmask'; $tab[21]['datatype'] = 'string'; $tab[21]['name'] = IPNetmask::getTypeName(1); $tab[22]['table'] = $this->getTable(); $tab[22]['field'] = 'subnet'; $tab[22]['datatype'] = 'string'; $tab[22]['name'] = __('Network address'); $tab[23]['table'] = $this->getTable(); $tab[23]['field'] = 'gateway'; $tab[23]['datatype'] = 'string'; $tab[23]['name'] = IPAddress::getTypeName(1); if (TableExists('glpi_networkinterfaces')) { $tab[24]['table'] = 'glpi_networkinterfaces'; $tab[24]['field'] = 'name'; $tab[24]['datatype'] = 'dropdown'; $tab[24]['name'] = __('Network interface'); } return $tab; } /** * @param $group HTMLTableGroup object * @param $super HTMLTableSuperHeader object * @param $options array * @param $internet_super * @param $father **/ static function getMigrationInstantiationHTMLTableHeaders(HTMLTableGroup $group, HTMLTableSuperHeader $super, HTMLTableSuperHeader $internet_super = NULL, HTMLTableHeader $father=NULL, array $options=array()) { // TODO : study to display the correct informations for this undefined NetworkPort return NULL; } } ?> glpi-0.84.3+dfsg.1/inc/networkportwifi.class.php000066400000000000000000000206571226600447100214760ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// NetworkPortWifi class : wifi instantitation of NetworkPort /// @todo : add connection to other wifi networks /// @since 0.84 class NetworkPortWifi extends NetworkPortInstantiation { static function getTypeName($nb=0) { return __('Wifi port'); } function getNetworkCardInterestingFields() { return array('link.`mac`' => 'mac'); } /** * @see NetworkPortInstantiation::showInstantiationForm() **/ function showInstantiationForm(NetworkPort $netport, $options=array(), $recursiveItems) { if (!$options['several']) { echo "\n"; $this->showNetworkCardField($netport, $options, $recursiveItems); echo "" . WifiNetwork::getTypeName(1) . ""; WifiNetwork::dropdown(array('value' => $this->fields["wifinetworks_id"])); echo ""; echo "\n"; echo "\n"; echo "" . __('Wifi mode') . ""; echo ""; Dropdown::showFromArray('mode', WifiNetwork::getWifiCardModes(), array('value' => $this->fields['mode'])); echo "\n"; echo "" . __('Wifi protocol version') . ""; Dropdown::showFromArray('version', WifiNetwork::getWifiCardVersion(), array('value' => $this->fields['version'])); echo "\n"; echo "\n"; echo "\n"; $this->showMacField($netport, $options); echo "\n"; } } /** * @see NetworkPortInstantiation::getInstantiationHTMLTableHeaders **/ function getInstantiationHTMLTableHeaders(HTMLTableGroup $group, HTMLTableSuperHeader $super, HTMLTableSuperHeader $internet_super=NULL, HTMLTableHeader $father=NULL, array $options=array()) { DeviceNetworkCard::getHTMLTableHeader('NetworkPortWifi', $group, $super, NULL, $options); $group->addHeader('ESSID', __('ESSID'), $super); $group->addHeader('Mode', __('Wifi mode'), $super); $group->addHeader('Version', __('Wifi protocol version'), $super); parent::getInstantiationHTMLTableHeaders($group, $super, $internet_super, $father, $options); return NULL; } /** * @see NetworkPortInstantiation::getInstantiationHTMLTable() **/ function getInstantiationHTMLTable(NetworkPort $netport, HTMLTableRow $row, HTMLTableCell $father=NULL, array $options=array()) { DeviceNetworkCard::getHTMLTableCellsForItem($row, $this, NULL, $options); $row->addCell($row->getHeaderByName('Instantiation', 'ESSID'), Dropdown::getDropdownName("glpi_wifinetworks", $this->fields["wifinetworks_id"])); $row->addCell($row->getHeaderByName('Instantiation', 'Mode'), $this->fields['mode']); $row->addCell($row->getHeaderByName('Instantiation', 'Version'), $this->fields['version']); parent::getInstantiationHTMLTable($netport, $row, $father, $options); return NULL; } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[10]['table'] = $this->getTable(); $tab[10]['field'] = 'mac'; $tab[10]['name'] = __('MAC'); $tab[10]['massiveaction'] = false; $tab[10]['datatype'] = 'mac'; $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'mode'; $tab[11]['name'] = __('Wifi mode'); $tab[11]['massiveaction'] = false; $tab[11]['datatype'] = 'specific'; $tab[12]['table'] = $this->getTable(); $tab[12]['field'] = 'version'; $tab[12]['name'] = __('Wifi protocol version'); $tab[12]['massiveaction'] = false; $tab[11]['datatype'] = 'specific'; $tab[13]['table'] = 'glpi_wifinetworks'; $tab[13]['field'] = 'name'; $tab[13]['name'] = WifiNetwork::getTypeName(1); $tab[13]['massiveaction'] = false; $tab[13]['datatype'] = 'dropdown'; return $tab; } /** * @param $field * @param $values * @param $options array **/ static function getSpecificValueToDisplay($field, $values, array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } switch ($field) { case 'mode': $tab = WifiNetwork::getWifiCardModes(); if (isset($tab[$values[$field]])) { return $tab[$values[$field]]; } return NOT_AVAILABLE; case 'version': $tab = WifiNetwork::getWifiCardVersion(); if (isset($tab[$values[$field]])) { return $tab[$values[$field]]; } return NOT_AVAILABLE; } return parent::getSpecificValueToDisplay($field, $values, $options); } /** * @param $field * @param $name (default'') * @param $values (default '') * @param $options array **/ static function getSpecificValueToSelect($field, $name='', $values='', array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'mode': $options['value'] = $values[$field]; return Dropdown::showFromArray($name, WifiNetwork::getWifiCardModes(), $options); case 'version': $options['value'] = $values[$field]; return Dropdown::showFromArray($name, WifiNetwork::getWifiCardVersion(), $options); } return parent::getSpecificValueToSelect($field, $name, $values, $options); } /** * @param $tab array * @param $joinparams array * @param $itemtype **/ static function getSearchOptionsToAddForInstantiation(array &$tab, array $joinparams, $itemtype) { $tab[157]['table'] = 'glpi_wifinetworks'; $tab[157]['field'] = 'name'; $tab[157]['name'] = WifiNetwork::getTypeName(1); $tab[157]['forcegroupby'] = true; $tab[157]['massiveaction'] = false; $tab[157]['joinparams'] = array('jointype' => 'standard', 'beforejoin' => array('table' => 'glpi_networkportwifis', 'joinparams' => $joinparams)); $tab[158]['table'] = 'glpi_wifinetworks'; $tab[158]['field'] = 'essid'; $tab[158]['name'] = __('ESSID'); $tab[158]['forcegroupby'] = true; $tab[158]['massiveaction'] = false; $tab[158]['joinparams'] = array('jointype' => 'standard', 'beforejoin' => array('table' => 'glpi_networkportwifis', 'joinparams' => $joinparams)); } } ?> glpi-0.84.3+dfsg.1/inc/notification.class.php000066400000000000000000000360151226600447100207020ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // Class Notification class Notification extends CommonDBTM { // MAILING TYPE //Notification to a user (sse mailing users type below) const USER_TYPE = 1; //Notification to users of a profile const PROFILE_TYPE = 2; //Notification to a users of a group const GROUP_TYPE = 3; //Notification to the people in charge of the database synchronisation const MAILING_TYPE = 4; //Notification to the supervisor of a group const SUPERVISOR_GROUP_TYPE = 5; //Notification to all user of a group except supervisor const GROUP_WITHOUT_SUPERVISOR_TYPE = 6; // MAILING USERS TYPE //Notification to the GLPI global administrator const GLOBAL_ADMINISTRATOR = 1; //Notification to the technicial who's assign to a ticket const ASSIGN_TECH = 2; //Notification to the owner of the item const AUTHOR = 3; //Notification to the technician previously in charge of the ticket const OLD_TECH_IN_CHARGE = 4; //Notification to the technician in charge of the item const ITEM_TECH_IN_CHARGE = 5; //Notification to the item's user const ITEM_USER = 6; //Notification to the ticket's recipient const RECIPIENT = 7; //Notificartion to the ticket's assigned supplier const SUPPLIER = 8; //Notification to a group of people const ASSIGN_GROUP = 9; //Notification to the supervisor of the ticket's assigned group const SUPERVISOR_ASSIGN_GROUP = 10; //Notification to the entity administrator const ENTITY_ADMINISTRATOR = 11; //Notification to the supervisor of the ticket's requester group const SUPERVISOR_REQUESTER_GROUP = 12; //Notification to the ticket's requester group const REQUESTER_GROUP = 13; //Notification to the ticket validation approver const VALIDATION_APPROVER = 14; //Notification to the ticket validation requester const VALIDATION_REQUESTER = 15; //Notification to the task assign user const TASK_ASSIGN_TECH = 16; //Notification to the task author const TASK_AUTHOR = 17; //Notification to the followup author const FOLLOWUP_AUTHOR = 18; //Notification to the user const USER = 19; //Notification to the ticket's observer group const OBSERVER_GROUP = 20; //Notification to the ticket's observer user const OBSERVER = 21; //Notification to the supervisor of the ticket's observer group const SUPERVISOR_OBSERVER_GROUP = 22; //Notification to the group of technician in charge of the item const ITEM_TECH_GROUP_IN_CHARGE = 23; // Notification to group of people without supervisor const ASSIGN_GROUP_WITHOUT_SUPERVISOR = 24; //Notification to the ticket's requester group without supervisor const REQUESTER_GROUP_WITHOUT_SUPERVISOR = 25; //Notification to the ticket's observer group without supervisor const OBSERVER_GROUP_WITHOUT_SUPERVISOR = 26; // From CommonDBTM public $dohistory = true; static function getTypeName($nb=0) { return _n('Notification', 'Notifications', $nb); } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('NotificationTarget', $ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } function showForm($ID, $options=array()) { global $CFG_GLPI; $this->initForm($ID, $options); $this->showTabs($options); $this->showFormHeader($options); echo "" . __('Name') . ""; echo ""; Html::autocompletionTextField($this, "name"); echo ""; echo "".__('Comments').""; echo ""; echo "" . __('Active') . ""; echo ""; Dropdown::showYesNo('is_active', $this->fields['is_active']); echo ""; echo "" . __('Type') . ""; echo ""; if (Session::haveRight('config', 'w') && ($this->getEntityID() == 0)) { $rand = Dropdown::showItemTypes('itemtype', $CFG_GLPI["notificationtemplates_types"], array('value' => $this->fields['itemtype'])); } else { $rand = Dropdown::showItemTypes('itemtype', array_diff($CFG_GLPI["notificationtemplates_types"], array('Crontask', 'DBConnection', 'User')), array('value' => $this->fields['itemtype'])); } $params = array('itemtype' => '__VALUE__'); Ajax::updateItemOnSelectEvent("dropdown_itemtype$rand", "show_events", $CFG_GLPI["root_doc"]."/ajax/dropdownNotificationEvent.php", $params); Ajax::updateItemOnSelectEvent("dropdown_itemtype$rand", "show_templates", $CFG_GLPI["root_doc"]."/ajax/dropdownNotificationTemplate.php", $params); echo ""; echo "" . __('Notification method') . ""; echo ""; self::dropdownMode(array('value'=>$this->fields['mode'])); echo ""; echo "" . NotificationEvent::getTypeName(1) . ""; echo ""; NotificationEvent::dropdownEvents($this->fields['itemtype'], array('value'=>$this->fields['event'])); echo ""; echo "". NotificationTemplate::getTypeName(1).""; echo ""; NotificationTemplate::dropdownTemplates('notificationtemplates_id', $this->fields['itemtype'], $this->fields['notificationtemplates_id']); echo ""; $this->showFormButtons($options); $this->addDivForTabs(); return true; } /** * @since version 0.84 * * @param $field * @param $values * @param $options array **/ static function getSpecificValueToDisplay($field, $values, array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } switch ($field) { case 'event': if (isset($values['itemtype']) && !empty($values['itemtype'])) { return NotificationEvent::getEventName($values['itemtype'],$values[$field]); } break; case 'mode': return self::getMode($values[$field]); } return parent::getSpecificValueToDisplay($field, $values, $options); } /** * @since version 0.84 * * @param $field * @param $name (default '') * @param $values (default '') * @param $options array **/ static function getSpecificValueToSelect($field, $name='', $values='', array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'event' : if (isset($values['itemtype']) && !empty($values['itemtype'])) { $options['value'] = $values[$field]; $options['name'] = $name; return NotificationEvent::dropdownEvents($values['itemtype'],$options); } break; case 'mode' : $options['value'] = $values[$field]; $options['name'] = $name; return self::dropdownMode($options); } return parent::getSpecificValueToSelect($field, $name, $values, $options); } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'event'; $tab[2]['name'] = _n('Event', 'Events', 1); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'specific'; $tab[2]['additionalfields'] = array('itemtype'); $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'mode'; $tab[3]['name'] = __('Notification method'); $tab[3]['massiveaction'] = false; $tab[3]['datatype'] = 'specific'; $tab[4]['table'] = 'glpi_notificationtemplates'; $tab[4]['field'] = 'name'; $tab[4]['name'] = _n('Notification template', 'Notification templates', 2); $tab[4]['datatype'] = 'itemlink'; $tab[5]['table'] = $this->getTable(); $tab[5]['field'] = 'itemtype'; $tab[5]['name'] = __('Type'); $tab[5]['datatype'] = 'itemtypename'; $tab[5]['itemtype_list'] = 'notificationtemplates_types'; $tab[5]['massiveaction'] = false; $tab[6]['table'] = $this->getTable(); $tab[6]['field'] = 'is_active'; $tab[6]['name'] = __('Active'); $tab[6]['datatype'] = 'bool'; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab[80]['table'] = 'glpi_entities'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = __('Entity'); $tab[80]['massiveaction'] = false; $tab[80]['datatype'] = 'dropdown'; $tab[86]['table'] = $this->getTable(); $tab[86]['field'] = 'is_recursive'; $tab[86]['name'] = __('Child entities'); $tab[86]['datatype'] = 'bool'; return $tab; } static function canCreate() { return Session::haveRight('notification', 'w'); } static function canView() { return Session::haveRight('notification', 'r'); } function canViewItem() { if ((($this->fields['itemtype'] == 'Crontask') || ($this->fields['itemtype'] == 'DBConnection')) && !Session::haveRight('config', 'w')) { return false; } return Session::haveAccessToEntity($this->getEntityID(), $this->isRecursive()); } /** * Is the current user have right to update the current notification ? * * @return boolean **/ function canCreateItem() { if ((($this->fields['itemtype'] == 'Crontask') || ($this->fields['itemtype'] == 'DBConnection')) && !Session::haveRight('config', 'w')) { return false; } return Session::haveAccessToEntity($this->getEntityID()); } /** * Display a dropdown with all the available notification modes * * @param $options array of options **/ static function dropdownMode($options) { $p['name'] = 'mode'; $p['display'] = true; $p['value'] = ''; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } Dropdown::showFromArray($p['name'], self::getModes(), $p); } /** * Get notification method label (email only for the moment) * * @param $mode the mode to use * * @return the mode's label **/ static function getMode($mode) { $tab = self::getModes(); if (isset($tab[$mode])) { return $tab[$mode]; } return NOT_AVAILABLE; } /** * Get notification method label (email only for the moment) * * @since versin 0.84 * * @return the mode's label **/ static function getModes() { return array('mail' => __('Email')); } function cleanDBonPurge() { global $DB; $query = "DELETE FROM `glpi_notificationtargets` WHERE `notifications_id` = '".$this->fields['id']."'"; $DB->query($query); } /** * @param $mailing_options **/ static function send($mailing_options) { $mail = new NotificationMail(); $mail->sendNotification($mailing_options); $mail->ClearAddresses(); } /** * Get the mailing signature for the entity * * @param $entity **/ static function getMailingSignature($entity) { global $DB, $CFG_GLPI; foreach ($DB->request('glpi_entities', array('id' => $entity)) as $data) { if (!empty($data['mailing_signature'])) { return $data['mailing_signature']; } } return $CFG_GLPI['mailing_signature']; } /** * @param $event * @param $itemtype * @param $entity **/ static function getNotificationsByEventAndType($event, $itemtype, $entity) { global $DB; $query = "SELECT `glpi_notifications`.* FROM `glpi_notifications` LEFT JOIN `glpi_entities` ON (`glpi_entities`.`id` = `glpi_notifications`.`entities_id`) WHERE `glpi_notifications`.`itemtype` = '$itemtype' AND `glpi_notifications`.`event` = '$event' ". getEntitiesRestrictRequest("AND", "glpi_notifications", 'entities_id', $entity, true) ." AND `glpi_notifications`.`is_active`='1' ORDER BY `glpi_entities`.`level` DESC"; return $DB->request($query); } } ?> glpi-0.84.3+dfsg.1/inc/notificationevent.class.php000066400000000000000000000205611226600447100217430ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Class which manages notification events **/ class NotificationEvent extends CommonDBTM { static function getTypeName($nb=0) { return _n('Event', 'Events', $nb); } /** * @param $itemtype * @param $options array to pass to showFromArray or $value **/ static function dropdownEvents($itemtype, $options=array()) { $p['name'] = 'event'; $p['display'] = true; $p['value'] = ''; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } $events = array(); $target = NotificationTarget::getInstanceByType($itemtype); if ($target) { $events = $target->getAllEvents(); } $events[''] = Dropdown::EMPTY_VALUE; return Dropdown::showFromArray($p['name'], $events, $p); } /** * retrieve the label for an event * * @since version 0.83 * * @param itemtype string name of the type * @param $event string name of the event * * @return string **/ static function getEventName($itemtype, $event) { $events = array(); $target = NotificationTarget::getInstanceByType($itemtype); if ($target) { $events = $target->getAllEvents(); if (isset($events[$event])) { return $events[$event]; } } return NOT_AVAILABLE; } /** * Raise a notification event event * * @param $event the event raised for the itemtype * @param $item the object which raised the event * @param $options array of options used * @param $label used for debugEvent() (default '') **/ static function raiseEvent($event, $item, $options=array(), $label='') { global $CFG_GLPI; //If notifications are enabled in GLPI's configuration if ($CFG_GLPI["use_mailing"]) { $email_processed = array(); $email_notprocessed = array(); //Get template's information $template = new NotificationTemplate(); $notificationtarget = NotificationTarget::getInstance($item,$event,$options); if (!$notificationtarget) { return false; } $entity = $notificationtarget->getEntity(); //Foreach notification foreach (Notification::getNotificationsByEventAndType($event, $item->getType(), $entity) as $data) { $targets = getAllDatasFromTable('glpi_notificationtargets', 'notifications_id = '.$data['id']); $notificationtarget->clearAddressesList(); //Process more infos (for example for tickets) $notificationtarget->addAdditionnalInfosForTarget(); $template->getFromDB($data['notificationtemplates_id']); $template->resetComputedTemplates(); //Set notification's signature (the one which corresponds to the entity) $template->setSignature(Notification::getMailingSignature($entity)); $notify_me = false; if (Session::isCron()) { // Cron notify me $notify_me = true; } else { // Not cron see my pref $notify_me = $_SESSION['glpinotification_to_myself']; } //Foreach notification targets foreach ($targets as $target) { //Get all users affected by this notification $notificationtarget->getAddressesByTarget($target,$options); foreach ($notificationtarget->getTargets() as $user_email => $users_infos) { if ($label || $notificationtarget->validateSendTo($event, $users_infos, $notify_me)) { //If the user have not yet been notified if (!isset($email_processed[$users_infos['language']][$users_infos['email']])) { //If ther user's language is the same as the template's one if (isset($email_notprocessed[$users_infos['language']] [$users_infos['email']])) { unset($email_notprocessed[$users_infos['language']] [$users_infos['email']]); } if ($tid = $template->getTemplateByLanguage($notificationtarget, $users_infos, $event, $options)) { //Send notification to the user if ($label == '') { Notification::send($template->getDataToSend($notificationtarget, $tid, $users_infos, $options)); } else { $notificationtarget->getFromDB($target['id']); echo "".$label.""; echo "".$notificationtarget->getNameID().""; echo "".sprintf(__('%1$s (%2$s)'), $template->getName(), $users_infos['language']).""; echo "".$users_infos['email'].""; echo ""; } $email_processed[$users_infos['language']][$users_infos['email']] = $users_infos; } else { $email_notprocessed[$users_infos['language']][$users_infos['email']] = $users_infos; } } } } } } } unset($email_processed); unset($email_notprocessed); $template = null; return true; } /** * Display debug information for an object * * @param $item the object * @param $options array **/ static function debugEvent($item, $options=array()) { echo "
    "; echo ""; echo ""; $events = array(); if ($target = NotificationTarget::getInstanceByType(get_class($item))) { $events = $target->getAllEvents(); if (count($events)>0) { echo ""; echo "". ""; foreach ($events as $event => $label) { self::raiseEvent($event, $item, $options, $label); } } else { echo ""; } } echo "
    "._n('Notification', 'Notifications',2). " (".$item->getTypeName(1).")
    ".self::getTypeName(2).''._n('Recipient', 'Recipients', 2).""._n('Notification template', 'Notification templates', 2).""._n('Email', 'Emails', 2)."
    ".__('No item to display')."
    "; } } ?>glpi-0.84.3+dfsg.1/inc/notificationinterface.class.php000066400000000000000000000034171226600447100225630ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Interface to implement for each notification mode */ interface NotificationInterface { /** * Send notifications * * @return must return 0 or 1 **/ function sendNotification(); /** * Check user address * * @param $address the user's address to check * @param $options array with the special options (may be needed) * * @return true or false **/ static function isUserAddressValid($address, $options=array()); /** * Method to test notification **/ static function testNotification(); } ?>glpi-0.84.3+dfsg.1/inc/notificationmail.class.php000066400000000000000000000203311226600447100215370ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } require_once(GLPI_PHPMAILER_DIR . "/class.phpmailer.php"); /** * NotificationMail class extends phpmail and implements the NotificationInterface **/ class NotificationMail extends phpmailer implements NotificationInterface { //! mailing type (new,attrib,followup,finish) var $mailtype = NULL; /** Job class variable - job to be mailed * @see Job */ var $job = NULL; /** User class variable - user who make changes * @see User */ var $user = NULL; /// Is the followupadded private ? var $followupisprivate = NULL; /// Set default variables for all new objects var $WordWrap = 80; /// Defaut charset var $CharSet = "utf-8"; /** * Constructor **/ function __construct() { global $CFG_GLPI; // Comes from config $this->SetLanguage("en", GLPI_PHPMAILER_DIR . "/language/"); if ($CFG_GLPI['smtp_mode'] != MAIL_MAIL) { $this->Mailer = "smtp"; $this->Host = $CFG_GLPI['smtp_host'].':'.$CFG_GLPI['smtp_port']; if ($CFG_GLPI['smtp_username'] != '') { $this->SMTPAuth = true; $this->Username = $CFG_GLPI['smtp_username']; $this->Password = Toolbox::decrypt($CFG_GLPI['smtp_passwd'], GLPIKEY); } if ($CFG_GLPI['smtp_mode'] == MAIL_SMTPSSL) { $this->SMTPSecure = "ssl"; } if ($CFG_GLPI['smtp_mode'] == MAIL_SMTPTLS) { $this->SMTPSecure = "tls"; } } if ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) { $this->do_debug = 3; } } /** * Determine if email is valid * * @param $address email to check * @param $options array of options used (by default 'checkdns'=>false) * - checkdns :check dns entry * * @return boolean * from http://www.linuxjournal.com/article/9585 **/ static function isUserAddressValid($address, $options=array('checkdns'=>false)) { $checkdns = $options['checkdns']; $isValid = true; $atIndex = strrpos($address, "@"); if (is_bool($atIndex) && !$atIndex) { $isValid = false; } else { $domain = substr($address, $atIndex+1); $local = substr($address, 0, $atIndex); $localLen = strlen($local); $domainLen = strlen($domain); if (($localLen < 1) || ($localLen > 64)) { // local part length exceeded $isValid = false; } else if (($domainLen < 1) || ($domainLen > 255)) { // domain part length exceeded $isValid = false; } else if (($local[0] == '.') || ($local[$localLen-1] == '.')) { // local part starts or ends with '.' $isValid = false; } else if (preg_match('/\\.\\./', $local)) { // local part has two consecutive dots $isValid = false; } else if (!preg_match('/^[A-Za-z0-9\\-\\.]+$/', $domain)) { // character not valid in domain part $isValid = false; } else if (preg_match('/\\.\\./', $domain)) { // domain part has two consecutive dots $isValid = false; } else if (!preg_match('/^(\\\\.|[A-Za-z0-9!#%&`_=\\/$\'*+?^{}|~.-])+$/', str_replace("\\\\","",$local))) { // character not valid in local part unless // local part is quoted if (!preg_match('/^"(\\\\"|[^"])+"$/', str_replace("\\\\","",$local))) { $isValid = false; } } if ($checkdns) { if ($isValid && !(checkdnsrr($domain,"MX") || checkdnsrr($domain,"A"))) { // domain not found in DNS $isValid = false; } } else if (!preg_match('/\\./', $domain) || !preg_match("/[a-zA-Z0-9]$/", $domain)) { // domain has no dots or do not end by alphenum char $isValid = false; } } return $isValid; } static function testNotification() { global $CFG_GLPI; $mmail = new self(); $mmail->AddCustomHeader("Auto-Submitted: auto-generated"); // For exchange $mmail->AddCustomHeader("X-Auto-Response-Suppress: OOF, DR, NDR, RN, NRN"); $mmail->SetFrom($CFG_GLPI["admin_email"], $CFG_GLPI["admin_email_name"]); $mmail->AddAddress($CFG_GLPI["admin_email"], $CFG_GLPI["admin_email_name"]); $mmail->Subject = "[GLPI] ".__('Mail test'); $mmail->Body = __('This is a test email.')."\n-- \n".$CFG_GLPI["mailing_signature"]; if (!$mmail->Send()) { Session::addMessageAfterRedirect(__('Failed to send test email to administrator'), false, ERROR); } else { Session::addMessageAfterRedirect(__('Test email sent to administrator')); } } /** * Format the mail sender to send * * @return mail sender email string **/ function getEntityAdminAddress() { global $CFG_GLPI,$DB; $query = "SELECT `admin_email` AS email FROM `glpi_entities` WHERE `id` = '".$this->job->fields["entities_id"]."'"; if ($result = $DB->query($query)) { if ($DB->numrows($result)) { $data = $DB->fetch_assoc($result); if (self::isUserAddressValid($data["email"])) { return $data["email"]; } } } return $CFG_GLPI["admin_email"]; } /** * @param $options array **/ function sendNotification($options=array()) { $mmail = new self(); $mmail->AddCustomHeader("Auto-Submitted: auto-generated"); // For exchange $mmail->AddCustomHeader("X-Auto-Response-Suppress: OOF, DR, NDR, RN, NRN"); $mmail->SetFrom($options['from'], $options['fromname'], false); if ($options['replyto']) { $mmail->AddReplyTo($options['replyto'], $options['replytoname']); } $mmail->Subject = $options['subject']; if (empty($options['content_html'])) { $mmail->isHTML(false); $mmail->Body = $options['content_text']; } else { $mmail->isHTML(true); $mmail->Body = $options['content_html']; $mmail->AltBody = $options['content_text']; } $mmail->AddAddress($options['to'], $options['toname']); if (!empty($options['messageid'])) { $mmail->MessageID = "<".$options['messageid'].">"; } $messageerror = __('Error in sending the email'); if (!$mmail->Send()) { $senderror = true; Session::addMessageAfterRedirect($messageerror."
    ".$mmail->ErrorInfo, true); } else { //TRANS to be written in logs %1$s is the to email / %2$s is the subject of the mail Toolbox::logInFile("mail", sprintf(__('%1$s: %2$s'), sprintf(__('An email was sent to %s'), $options['to']), $options['subject']."\n")); } $mmail->ClearAddresses(); return true; } } ?>glpi-0.84.3+dfsg.1/inc/notificationmailsetting.class.php000066400000000000000000000165621226600447100231500ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * This class manages the mail settings */ class NotificationMailSetting extends CommonDBTM { var $table = 'glpi_configs'; protected $displaylist = false; // Temproray hack for this class in 0.84 static function getTable() { return 'glpi_configs'; } static function getTypeName($nb=0) { return __('Email followups configuration'); } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab(__CLASS__, $ong, $options); return $ong; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { switch ($item->getType()) { case __CLASS__ : $tabs[1] = __('Setup'); return $tabs; } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType() == __CLASS__) { switch ($tabnum) { case 1 : $item->showFormMailServerConfig(); break; } } return true; } /** * Print the mailing config form * * @param $ID integer ID of the item * @param $options array * - target filename : where to go when done. * - tabs integer : ID of the tab to display * * @return Nothing (display) **/ function showForm($ID, $options=array()) { global $CFG_GLPI; if (!Session::haveRight("config", "w")) { return false; } if (!$CFG_GLPI['use_mailing']) { $options['colspan'] = 1; } $this->getFromDB($ID); $this->showTabs($options); $this->addDivForTabs(); return true; } static function canCreate() { return Session::haveRight('config', 'w'); } static function canView() { return Session::haveRight('config', 'r'); } function showFormMailServerConfig() { global $CFG_GLPI; echo ""; echo "
    "; echo ""; echo ""; echo ""; echo ""; if ($CFG_GLPI['use_mailing']) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if (!function_exists('mail')) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; //TRANS: SMTP port echo ""; echo ""; echo ""; echo ""; } else { echo ""; } $options['candel'] = false; if ($CFG_GLPI['use_mailing']) { $options['addbuttons'] = array('test_smtp_send' => __('Send a test email to the administrator')); } $this->showFormButtons($options); } } ?>glpi-0.84.3+dfsg.1/inc/notificationtarget.class.php000066400000000000000000001207431226600447100221130ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // Class NotificationTarget // @since version 0.84 class NotificationTarget extends CommonDBChild { var $prefix = ''; // From CommonDBChild static public $itemtype = 'Notification'; static public $items_id = 'notifications_id'; public $table = 'glpi_notificationtargets'; var $notification_targets = array(); var $notification_targets_labels = array(); var $notificationoptions = 0; // Tags which have data in HTML : do not try to clean them public $html_tags = array(); // Data from the objet which can be used by the template // See https://forge.indepnet.net/projects/5/wiki/NotificationTemplatesTags var $datas = array(); var $tag_descriptions = array(); // From CommonDBTM public $dohistory = true; //Array to store emails by notification var $target = array(); var $entity = ''; //Object which raises the notification event var $obj = null; //Object which is associated with the event var $target_object = null; // array of event name => event label var $events = array(); var $options = array(); var $raiseevent = ''; const TAG_LANGUAGE = 'lang'; const TAG_VALUE = 'tag'; const TAG_FOR_ALL_EVENTS = 0; const ANONYMOUS_USER = 0; const GLPI_USER = 1; const EXTERNAL_USER = 2; /** * @param $entity (default '') * @param $event (default '') * @param $object (default null) * @param $options array **/ function __construct($entity='', $event='', $object=null, $options=array()) { if ($entity === '') { $this->entity = (isset($_SESSION['glpiactive_entity'])?$_SESSION['glpiactive_entity']:0); } else { $this->entity = $entity; } if ($object) { if ($object instanceof CommonDBTM && isset($object->fields['id'])) { // Reread to avoid slashes issue $object->getFromDB($object->fields['id']); } $this->obj = $object; $this->getObjectItem($event); } $this->raiseevent = $event; $this->options = $options; $this->getNotificationTargets($entity); $this->getAdditionalTargets($event); asort($this->notification_targets); } // Temporary hack for this class since 0.84 static function getTable() { return 'glpi_notificationtargets'; } /** * Validate send before doing it (may be overloaded : exemple for private tasks or followups) * * @param $event string notification event * @param $infos array of destination of the notification * @param $notify_me boolean notify me on my action ? * ($infos contains users_id to check if the target is me) * (false by default) * * @return true **/ function validateSendTo($event, array $infos, $notify_me=false) { if (!$notify_me) { if (isset($infos['users_id']) // Check login user and not event launch by crontask && ($infos['users_id'] === Session::getLoginUserID(false))) { return false; } } return true; } /** * @param $event (default '') **/ function getSubjectPrefix($event='') { $perso_tag = trim(Entity::getUsedConfig('notification_subject_tag', $this->getEntity(), '', '')); if (empty($perso_tag)) { $perso_tag = "GLPI"; } return "[$perso_tag] "; } /** * @since version 0.84 * * @return message id for notification **/ function getMessageID() { return ""; } static function getTypeName($nb=0) { return _n('Recipient', 'Recipients', $nb); } /** * Get a notificationtarget class by giving the object which raises the event * * @see CommonDBTM::getName **/ function getName($options=array()) { if (isset($this->notification_targets_labels[$this->getField("type")] [$this->getField("items_id")])) { return $this->notification_targets_labels[$this->getField("type")] [$this->getField("items_id")]; } return NOT_AVAILABLE; } /** * Get a notificationtarget class by giving the object which raises the event * * @param $item the object which raises the event * @param $event the event which will be used (default '') * @param $options array of options * * @return a notificationtarget class or false **/ static function getInstance($item, $event='', $options=array()) { if ($plug = isPluginItemType($item->getType())) { $name = 'Plugin'.$plug['plugin'].'NotificationTarget'.$plug['class']; } else { $name = 'NotificationTarget'.$item->getType(); } $entity = 0; if (class_exists($name)) { //Entity ID exists in the options array if (isset($options['entities_id'])) { $entity = $options['entities_id']; //Item which raises the event contains an entityID } else if ($item->getEntityID() >= 0) { $entity = $item->getEntityID(); } return new $name($entity, $event, $item, $options); } return false; } /** * Get a notificationtarget class by giving an itemtype * * @param $itemtype the itemtype of the object which raises the event * @param $event the event which will be used (default '') * @param $options array of options * * @return a notificationtarget class or false **/ static function getInstanceByType($itemtype, $event='', $options=array()) { if (($itemtype != '') && ($item = getItemForItemtype($itemtype))) { return self::getInstance($item, $event, $options); } return false; } /** * @param $notification Notification object **/ function showForNotification(Notification $notification) { if (!Session::haveRight("notification", "r")) { return false; } echo ""; echo "
    "._n('Notification', 'Notifications',2)."
    " . __('Enable followup via email') . ""; Dropdown::showYesNo("use_mailing", $CFG_GLPI["use_mailing"]); echo "
    " . __('Administrator email') . ""; if (!NotificationMail::isUserAddressValid($CFG_GLPI["admin_email"])) { echo " ".__('Invalid email address').""; } echo "" . __('Administrator name') . ""; echo "
    " . __('Administrator reply-to email (if needed)') . ""; if (!NotificationMail::isUserAddressValid($CFG_GLPI["admin_reply"])) { echo " ".__('Invalid email address').""; } echo " " . __('Response name (if needed)') . ""; echo "
    "; echo "" . __('The PHP mail function is unknown or is not activated on your system.') . "
    ". __('The use of a SMTP is needed.') . "
    " . __('Email signature') . "
    ".__('Mail server')."
    " . __('Way of sending emails') . ""; $mail_methods = array(MAIL_MAIL => __('PHP'), MAIL_SMTP => __('SMTP'), MAIL_SMTPSSL => __('SMTP+SSL'), MAIL_SMTPTLS => __('SMTP+TLS')); Dropdown::showFromArray("smtp_mode", $mail_methods, array('value' => $CFG_GLPI["smtp_mode"])); echo " 
    " . __('SMTP host') . ""; echo "" . __('SMTP login (optional)') . "
    " . __('Port') . ""; echo "" . __('SMTP password (optional)') . ""; echo "
     ".__('Clear'); echo "
    "; echo ""; echo ""; echo ""; echo ""; $this->showNotificationTargets($notification); echo ""; echo "
    " . _n('Recipient', 'Recipients', 2) . "
    "; Html::closeForm(); } /** * Display notification targets * * @param $notification the Notification object **/ function showNotificationTargets(Notification $notification) { global $DB; if ($notification->getField('itemtype') != '') { $notifications_id = $notification->fields['id']; $this->getNotificationTargets($notification->getEntityID()); $canedit = $notification->can($notifications_id,'w'); $options = ""; // Get User mailing $query = "SELECT `glpi_notificationtargets`.`items_id`, `glpi_notificationtargets`.`id` FROM `glpi_notificationtargets` WHERE `glpi_notificationtargets`.`notifications_id` = '$notifications_id' AND `glpi_notificationtargets`.`type` = '" . Notification::USER_TYPE . "' ORDER BY `glpi_notificationtargets`.`items_id`"; foreach ($DB->request($query) as $data) { if (isset($this->notification_targets[Notification::USER_TYPE."_".$data["items_id"]])) { unset($this->notification_targets[Notification::USER_TYPE."_".$data["items_id"]]); } if (isset($this->notification_targets_labels[Notification::USER_TYPE] [$data["items_id"]])) { $name = $this->notification_targets_labels[Notification::USER_TYPE][$data["items_id"]]; } else { $name = " "; } $options .= ""; } // Get Profile mailing $query = "SELECT `glpi_notificationtargets`.`items_id`, `glpi_notificationtargets`.`id`, `glpi_profiles`.`name` AS `prof` FROM `glpi_notificationtargets` LEFT JOIN `glpi_profiles` ON (`glpi_notificationtargets`.`items_id` = `glpi_profiles`.`id`) WHERE `glpi_notificationtargets`.`notifications_id` = '$notifications_id' AND `glpi_notificationtargets`.`type` = '".Notification::PROFILE_TYPE."' ORDER BY `prof`"; foreach ($DB->request($query) as $data) { $options .= ""; if (isset($this->notification_targets[Notification::PROFILE_TYPE."_".$data["items_id"]])) { unset($this->notification_targets[Notification::PROFILE_TYPE."_".$data["items_id"]]); } } // Get Group mailing $query = "SELECT `glpi_notificationtargets`.`items_id`, `glpi_notificationtargets`.`id`, `glpi_groups`.`name` AS `name` FROM `glpi_notificationtargets` LEFT JOIN `glpi_groups` ON (`glpi_notificationtargets`.`items_id` = `glpi_groups`.`id`) WHERE `glpi_notificationtargets`.`notifications_id`='$notifications_id' AND `glpi_notificationtargets`.`type` = '" . Notification::GROUP_TYPE . "' ORDER BY `name`;"; foreach ($DB->request($query) as $data) { //TRANS: %s is the name of the group $options .= ""; if (isset($this->notification_targets[Notification::GROUP_TYPE."_".$data["items_id"]])) { unset($this->notification_targets[Notification::GROUP_TYPE."_".$data["items_id"]]); } } // Get Group mailing $query = "SELECT `glpi_notificationtargets`.`items_id`, `glpi_notificationtargets`.`id`, `glpi_groups`.`name` AS `name` FROM `glpi_notificationtargets` LEFT JOIN `glpi_groups` ON (`glpi_notificationtargets`.`items_id` = `glpi_groups`.`id`) WHERE `glpi_notificationtargets`.`notifications_id`='$notifications_id' AND `glpi_notificationtargets`.`type` = '".Notification::SUPERVISOR_GROUP_TYPE."' ORDER BY `name`;"; foreach ($DB->request($query) as $data) { $options .= ""; if (isset($this->notification_targets[Notification::SUPERVISOR_GROUP_TYPE."_". $data["items_id"]])) { unset($this->notification_targets[Notification::SUPERVISOR_GROUP_TYPE."_". $data["items_id"]]); } } if ($canedit) { echo ""; if (count($this->notification_targets)) { echo ""; } echo ""; if (count($this->notification_targets)) { echo ""; } echo "

    "; if (!empty($options)) { echo ""; } echo ""; } else { echo ""; } if (!empty($options)) { echo ""; } else { echo " "; } echo ""; } } /** * @param $input **/ static function updateTargets($input) { $type = ""; $action = ""; $target = self::getInstanceByType($input['itemtype']); if (isset($input['mailing_add'])) { $action = 'add'; } else { $action = 'delete'; } if (count($input["mailing_to_" . $action]) > 0) { switch ($action) { case "add" : foreach ($input["mailing_to_add"] as $tmp => $val) { list($type, $items_id) = explode("_", $val); $tmp = array(); $tmp['items_id'] = $items_id; $tmp['type'] = $type; $tmp['notifications_id'] = $input['notifications_id']; $target->add($tmp); } break; case "delete" : foreach ($input["mailing_to_delete"] as $tmp => $val) { $tmp = array(); $tmp['id'] = $val; $target->delete($tmp); } break; } } } function addAdditionnalInfosForTarget() { } /** * @param $data * * @return empty array **/ function addAdditionnalUserInfo(array $data) { return array(); } /** * Add new mail with lang to current email array * * @param $data array of data (mail, lang[, id for user]) **/ function addToAddressesList(array $data) { global $CFG_GLPI; // No email set : get default for user if (!isset($data['email']) && isset($data['users_id'])) { $data['email'] = UserEmail::getDefaultForUser($data['users_id']); } $new_mail = trim(Toolbox::strtolower($data['email'])); $new_lang = ''; // Default USER TYPE is ANONYMOUS $notificationoption = array('usertype' => self::ANONYMOUS_USER); if (isset($data['language'])) { $new_lang = trim($data['language']); } $username = ''; if (isset($data['name']) && !empty($data['name'])) { $username = $data['name']; } if (isset($data['users_id']) && ($data['users_id'] > 0)) { $user = new User(); if (!$user->getFromDB($data['users_id']) || ($user->getField('is_deleted') == 1) || ($user->getField('is_active') == 0)) { // unknown, deleted or disabled user return false; } $filt = getEntitiesRestrictRequest('AND', 'glpi_profiles_users', '', $this->getEntity(), true); $prof = Profile_User::getUserProfiles($data['users_id'], $filt); if (!count($prof)) { // No right on the entity of the object return false; } if (empty($username)) { $username = formatUserName(0, $user->getField('name'), $user->getField('realname'), $user->getField('firstname'), 0, 0, true); } // It is a GLPI user : $notificationoption['usertype'] = self::GLPI_USER; if (Auth::isAlternateAuth($user->fields['authtype']) || (($user->fields['authtype'] == Auth::NOT_YET_AUTHENTIFIED) && Auth::isAlternateAuth(Auth::checkAlternateAuthSystems()))) { $notificationoption['usertype'] = self::EXTERNAL_USER; } } // Pass user type as argument ? forced for specific cases if (isset($data['usertype'])) { $notificationoption['usertype'] = $data['usertype']; } $notificationoption = array_merge($this->addAdditionnalUserInfo($data), $notificationoption); if (!empty($new_mail)) { if (NotificationMail::isUserAddressValid($new_mail) && !isset($this->target[$new_mail])) { $param = array('language' => (empty($new_lang) ? $CFG_GLPI["language"] : $new_lang), 'email' => $new_mail, 'additionnaloption' => $notificationoption, 'username' => $username); if (isset($data['users_id']) && $data['users_id']) { $param['users_id'] = $data['users_id']; } $this->target[$new_mail] = $param; } } } /** * @since version 0.84 **/ function getDefaultUserType() { if (Auth::isAlternateAuth(Auth::checkAlternateAuthSystems())) { return self::EXTERNAL_USER; } return self::GLPI_USER; } /** * @since version 0.84 * * @param $usertype * @param $redirect **/ function formatURL($usertype, $redirect) { global $CFG_GLPI; switch ($usertype) { case self::EXTERNAL_USER : return urldecode($CFG_GLPI["url_base"]."/index.php?redirect=$redirect"); case self::ANONYMOUS_USER : // No URL return ''; case self::GLPI_USER : return urldecode($CFG_GLPI["url_base"]."/index.php?redirect=$redirect&noAUTO=1"); } } /** * Get GLPI's global administrator email **/ function getAdminAddress() { global $CFG_GLPI; $this->addToAddressesList(array("email" => $CFG_GLPI["admin_email"], "name" => $CFG_GLPI["admin_email_name"], "language" => $CFG_GLPI["language"], 'usertype' => self::getDefaultUserType())); } /** * Get the email of the item's user **/ function getItemAuthorAddress() { $user = new User(); if ($this->obj->isField('users_id') && $user->getFromDB($this->obj->getField('users_id'))) { $this->addToAddressesList(array('language' => $user->getField('language'), 'users_id' => $user->getField('id'))); } } /** * Get entity admin email **/ function getEntityAdminAddress() { global $DB, $CFG_GLPI; foreach ($DB->request('glpi_entities', array('id' => $this->entity)) as $row) { $data['language'] = $CFG_GLPI['language']; $data['email'] = $row['admin_email']; $data['name'] = $row['admin_email_name']; $data['usertype'] = self::getDefaultUserType(); $this->addToAddressesList($data); } } /** * Get targets for all the users of a group * * @param $manager 0 all users, 1 only supervisors, 2 all users without supervisors * @param $group_id id of the group **/ function getAddressesByGroup($manager, $group_id) { global $DB; // members/managers of the group allowed on object entity // filter group with 'is_assign' (attribute can be unset after notification) $query = $this->getDistinctUserSql()." FROM `glpi_groups_users` INNER JOIN `glpi_users` ON (`glpi_groups_users`.`users_id` = `glpi_users`.`id`) ". $this->getProfileJoinSql()." INNER JOIN `glpi_groups` ON (`glpi_groups_users`.`groups_id` = `glpi_groups`.`id`) WHERE `glpi_groups_users`.`groups_id` = '$group_id' AND `glpi_groups`.`is_notify`"; if ($manager == 1) { $query .= " AND `glpi_groups_users`.`is_manager` "; } else if ($manager == 2) { $query .= " AND NOT `glpi_groups_users`.`is_manager` "; } foreach ($DB->request($query) as $data) { $this->addToAddressesList($data); } } function getDistinctUserSql() { return "SELECT DISTINCT `glpi_users`.`id` AS users_id, `glpi_users`.`language` AS language"; } /** * Return main notification events for the object type * Internal use only => should use getAllEvents * * @return an array which contains : event => event label **/ function getEvents() { return array(); } /** * Return all (GLPI + plugins) notification events for the object type * * @return an array which contains : event => event label **/ function getAllEvents() { $this->events = $this->getEvents(); //If plugin adds new events for an already defined type Plugin::doHook('item_get_events', $this); return $this->events; } /** * @param $target (default '') * @param $label (default '') * @param $type (=Notification::USER_TYPE) **/ function addTarget ($target='', $label='', $type=Notification::USER_TYPE) { $key = $type.'_'.$target; // Value used for sort $this->notification_targets[$key] = $type.'_'.$label; // Displayed value $this->notification_targets_labels[$type][$target] = $label; } function addProfilesToTargets() { global $DB; foreach ($DB->request('glpi_profiles') as $data) { $this->addTarget($data["id"], sprintf(__('%1$s: %2$s'), __('Profile'), $data["name"]), Notification::PROFILE_TYPE); } } /** * @param $entity **/ function addGroupsToTargets($entity) { global $DB; // Filter groups which can be notified and have members (as notifications are sent to members) $query = "SELECT `id`, `name` FROM `glpi_groups`". getEntitiesRestrictRequest(" WHERE", 'glpi_groups', 'entities_id', $entity, true)." AND `is_usergroup` AND `is_notify` ORDER BY `name`"; foreach ($DB->request($query) as $data) { //Add group $this->addTarget($data["id"], sprintf(__('%1$s: %2$s'), __('Group'), $data["name"]), Notification::GROUP_TYPE); //Add group supervisor $this->addTarget($data["id"], sprintf(__('%1$s: %2$s'), __('Manager of group'), $data["name"]), Notification::SUPERVISOR_GROUP_TYPE); //Add group without supervisor $this->addTarget($data["id"], sprintf(__('%1$s: %2$s'), __('Group without manager'), $data["name"]), Notification::GROUP_WITHOUT_SUPERVISOR_TYPE); } } /** * Return all the targets for this notification * Values returned by this method are the ones for the alerts * Can be updated by implementing the getAdditionnalTargets() method * Can be overwitten (like dbconnection) * * @param $entity the entity on which the event is raised **/ function getNotificationTargets($entity) { if (Session::haveRight("config", "w")) { $this->addTarget(Notification::GLOBAL_ADMINISTRATOR, __('Administrator')); } $this->addTarget(Notification::ENTITY_ADMINISTRATOR, __('Entity administrator')); $this->addProfilesToTargets(); $this->addGroupsToTargets($entity); } /** * Allows to add more notification targets * Can be overridden in some case (for example Ticket) * * @param $event specif event to get additional targets (default '') **/ function getAdditionalTargets($event='') { } /** * Get addresses by a method not defined in NotificationTarget (specific to an itemtype) * * @param $data * @param $options **/ function getSpecificTargets($data, $options) { } /** * Get item associated with the object on which the event was raised * * @param $event (default '') * * @return the object associated with the itemtype **/ function getObjectItem($event='') { $this->target_object = $this->obj; } /** * Add user to the notified users list * * @param $field look for user looking for this field in the object * which raises the event * @param $search_in_object search is done in the object ? if not in target object * (false by default) **/ function getUserByField($field, $search_in_object=false) { global $DB; $id = 0; if (!$search_in_object) { $id = $this->obj->getField($field); } else if ($this->target_object) { $id = $this->target_object->getField($field); } if ($id) { //Look for the user by his id $query = $this->getDistinctUserSql()." FROM `glpi_users`". $this->getProfileJoinSql()." WHERE `glpi_users`.`id` = '$id'"; foreach ($DB->request($query) as $data) { //Add the user email and language in the notified users list $this->addToAddressesList($data); } } } /** * Get technician in charge of the item **/ function getItemTechnicianInChargeAddress() { $this->getUserByField('users_id_tech', true); } /** * Get Group of technicians in charge of the item **/ function getItemGroupTechInChargeAddress() { if ($this->target_object) { $id = $this->target_object->getField('groups_id_tech'); if ($id > 0) { $this->getAddressesByGroup(0, $id); } } } /** * Get user owner of the material **/ function getItemOwnerAddress() { $this->getUserByField('users_id', true); } /** * Get users emails by profile * * @param $profiles_id the profile ID to get users emails * * @return nothing **/ function getUsersAddressesByProfile($profiles_id) { global $DB; $query = $this->getDistinctUserSql().", glpi_profiles_users.entities_id AS entity FROM `glpi_users`". $this->getProfileJoinSql()." WHERE `glpi_profiles_users`.`profiles_id` = '".$profiles_id."';"; foreach ($DB->request($query) as $data) { $this->addToAddressesList($data); } } /** * Get admin which sends the notification * * @param $options array * * @return the sender's address **/ function getSender($options=array()) { global $DB, $CFG_GLPI; //If the entity administrator's address is defined, return it foreach ($DB->request('glpi_entities', array('id' => $this->getEntity())) as $data) { if (NotificationMail::isUserAddressValid($data['admin_email'])) { return array('email' => $data['admin_email'], 'name' => $data['admin_email_name']); } } //Entity admin is not defined, return the global admin's address return array('email' => $CFG_GLPI['admin_email'], 'name' => $CFG_GLPI['admin_email_name']); } /** * Get the reply to address * * @param $options array * * @return the reply to address **/ function getReplyTo($options=array()) { global $DB, $CFG_GLPI; //If the entity administrator's address is defined, return it foreach ($DB->request('glpi_entities', array('id' => $this->getEntity())) as $data) { if (NotificationMail::isUserAddressValid($data['admin_reply'])) { return array('email' => $data['admin_reply'], 'name' => $data['admin_reply_name']); } } //Entity admin is not defined, return the global admin's address return array('email' => $CFG_GLPI['admin_reply'], 'name' => $CFG_GLPI['admin_reply_name']); } /** * Get addresses by type of notification * * @param $data * @param $options array **/ function getAddressesByTarget($data, $options=array()) { //Look for all targets whose type is Notification::USER_TYPE switch ($data['type']) { //Notifications for one people case Notification::USER_TYPE : switch ($data['items_id']) { //Send to glpi's global admin (as defined in the mailing configuration) case Notification::GLOBAL_ADMINISTRATOR : $this->getAdminAddress(); break; //Send to the entity's admninistrator case Notification::ENTITY_ADMINISTRATOR : $this->getEntityAdminAddress(); break; //Technician in charge of the ticket case Notification::ITEM_TECH_IN_CHARGE : $this->getItemTechnicianInChargeAddress(); break; //Group of technician in charge of the ticket case Notification::ITEM_TECH_GROUP_IN_CHARGE : $this->getItemGroupTechInChargeAddress(); break; //User who's owner of the material case Notification::ITEM_USER : $this->getItemOwnerAddress(); break; //Send to the author of the ticket case Notification::AUTHOR : $this->getItemAuthorAddress(); break; default : //Maybe a target specific to a type $this->getSpecificTargets($data,$options); } break; //Send to all the users of a group case Notification::GROUP_TYPE : $this->getAddressesByGroup(0, $data['items_id']); break; //Send to all the managers of a group case Notification::SUPERVISOR_GROUP_TYPE : $this->getAddressesByGroup(1, $data['items_id']); break; //Send to all the users of a group without managers case Notification::GROUP_WITHOUT_SUPERVISOR_TYPE : $this->getAddressesByGroup(2, $data['items_id']); break; //Send to all the users of a profile case Notification::PROFILE_TYPE : $this->getUsersAddressesByProfile($data['items_id']); break; default : //Maybe a target specific to a type $this->getSpecificTargets($data,$options); } } /** * Get all data needed for template processing * Provides minimum information for alerts * Can be overridden by each NotificationTartget class if needed * * @param $event * @param $options array **/ function getDatasForTemplate($event, $options=array()) { } function getTargets() { return $this->target; } function getEntity() { return $this->entity; } function clearAddressesList() { $this->target = array(); } function getProfileJoinSql() { return " INNER JOIN `glpi_profiles_users` ON (`glpi_profiles_users`.`users_id` = `glpi_users`.`id` ". getEntitiesRestrictRequest("AND", "glpi_profiles_users", "entities_id", $this->getEntity(), true).")"; } /** * @param $event * @param $options **/ function &getForTemplate($event, $options) { global $CFG_GLPI; $this->datas = array(); $this->addTagToList(array('tag' => 'glpi.url', 'value' => $CFG_GLPI['root_doc'], 'label' => __('URL of the application'))); $this->getDatasForTemplate($event, $options); Plugin::doHook('item_get_datas', $this); return $this->datas; } function getTags() { return $this->tag_descriptions; } /** * @param $options array **/ function addTagToList($options=array()) { $p['tag'] = false; $p['value'] = true; $p['label'] = false; $p['events'] = self::TAG_FOR_ALL_EVENTS; $p['foreach'] = false; $p['lang'] = true; $p['allowed_values'] = array(); foreach ($options as $key => $value) { $p[$key] = $value; } if ($p['tag']) { if (is_array($p['events'])) { $events = $this->getEvents(); $tmp = array(); foreach ($p['events'] as $event) { $tmp[$event] = $events[$event]; } $p['events'] = $tmp; } if ($p['foreach']) { $tag = "##FOREACH".$p['tag']."## ##ENDFOREACH".$p['tag']."##"; $this->tag_descriptions[self::TAG_VALUE][$tag] = $p; } else { if ($p['value']) { $tag = "##".$p['tag']."##"; $this->tag_descriptions[self::TAG_VALUE][$tag] = $p; } if ($p['label']&&$p['lang']) { $tag = "##lang.".$p['tag']."##"; $p['label'] = $p['label']; $this->tag_descriptions[self::TAG_LANGUAGE][$tag] = $p; } } } } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate && Session::haveRight('notification', 'r')) { switch ($item->getType()) { case 'Group' : if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(Notification::getTypeName(2), self::countForGroup($item)); } return Notification::getTypeName(2); case 'Notification' : if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(self::getTypeName(2), countElementsInTable($this->getTable(), "notifications_id = '".$item->getID()."'")); } return self::getTypeName(2); } } return ''; } /** * Count Notification for a group * * @since version 0.83 * * @param $group Group object * * @return integer **/ static function countForGroup(Group $group) { global $DB; $sql = "SELECT COUNT(*)AS cpt FROM `glpi_notificationtargets` INNER JOIN `glpi_notifications` ON (`glpi_notifications`.`id` = `glpi_notificationtargets`.`notifications_id`) WHERE `items_id` = '".$group->getID()."' AND (`type` = '".Notification::SUPERVISOR_GROUP_TYPE."' OR `type` = '".Notification::GROUP_TYPE."') ". getEntitiesRestrictRequest('AND', 'glpi_notifications', '', '', true); $data = $DB->request($sql)->next(); return $data['cpt']; } /** * Display notification registered for a group * * @since version 0.83 * * @param $group Group object * * @return nothing **/ static function showForGroup(Group $group) { global $DB; if (!Session::haveRight("notification", "r")) { return false; } $sql = "SELECT `glpi_notifications`.`id` FROM `glpi_notificationtargets` INNER JOIN `glpi_notifications` ON (`glpi_notifications`.`id` = `glpi_notificationtargets`.`notifications_id`) WHERE `items_id` = '".$group->getID()."' AND (`type` = '".Notification::SUPERVISOR_GROUP_TYPE."' OR `type` = '".Notification::GROUP_TYPE."') ". getEntitiesRestrictRequest('AND', 'glpi_notifications', '', '', true); $req = $DB->request($sql); echo ""; if ($req->numrows()) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $notif = new Notification(); Session::initNavigateListItems('Notification', //TRANS : %1$s is the itemtype name, %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), Group::getTypeName(1), $group->getName())); foreach ($req as $data) { Session::addToNavigateListItems('Notification', $data['id']); if ($notif->getFromDB($data['id'])) { echo "". ""; } } } else { echo ""; } echo "
    ".__('Name')."".Entity::getTypeName(1)."".__('Active')."".__('Type')."".__('Notification method')."".NotificationEvent::getTypeName(1)."".NotificationTemplate::getTypeName(1)."
    ".$notif->getLink(); echo "".Dropdown::getDropdownName('glpi_entities', $notif->getEntityID()); echo "".Dropdown::getYesNo($notif->getField('is_active')).""; $itemtype = $notif->getField('itemtype'); if ($tmp = getItemForItemtype($itemtype)) { echo $tmp->getTypeName(1); } else { echo " "; } echo "".Notification::getMode($notif->getField('mode')); echo "".NotificationEvent::getEventName($itemtype, $notif->getField('event')); echo "".Dropdown::getDropdownName('glpi_notificationtemplates', $notif->getField('notificationtemplates_id')); echo "
    ".__('No item found')."
    "; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType() == 'Group') { self::showForGroup($item); } else if ($item->getType() == 'Notification') { $target = self::getInstanceByType($item->getField('itemtype'), $item->getField('event'), array('entities_id' => $item->getField('entities_id'))); if ($target) { $target->showForNotification($item); } } return true; } } ?> glpi-0.84.3+dfsg.1/inc/notificationtargetcartridgeitem.class.php000066400000000000000000000070011226600447100246460ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // Class NotificationTarget class NotificationTargetCartridgeItem extends NotificationTarget { function getEvents() { return array('alert' => __('Cartridges alarm')); } /** * Get all data needed for template processing * * @param $event * @param $options array **/ function getDatasForTemplate($event, $options=array()) { global $CFG_GLPI; $events = $this->getAllEvents(); $this->datas['##cartridge.entity##'] = Dropdown::getDropdownName('glpi_entities', $options['entities_id']); $this->datas['##cartridge.action##'] = $events[$event]; foreach ($options['items'] as $id => $cartridge) { $tmp = array(); $tmp['##cartridge.item##'] = $cartridge['name']; $tmp['##cartridge.reference##'] = $cartridge['ref']; $tmp['##cartridge.remaining##'] = cartridge::getUnusedNumber($id); $tmp['##cartridge.url##'] = urldecode($CFG_GLPI["url_base"]. "/index.php?redirect=cartridgeitem_".$id); $this->datas['cartridges'][] = $tmp; } $this->getTags(); foreach ($this->tag_descriptions[NotificationTarget::TAG_LANGUAGE] as $tag => $values) { if (!isset($this->datas[$tag])) { $this->datas[$tag] = $values['label']; } } } function getTags() { $tags = array('cartridge.action' => _n('Event', 'Events', 1), 'cartridge.reference' => __('Reference'), 'cartridge.item' => __('Cartridge model'), 'cartridge.remaining' => __('Remaining'), 'cartridge.url' => __('URL'), 'cartridge.entity' => __('Entity')); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true)); } $this->addTagToList(array('tag' => 'cartridges', 'label' => __('Device list'), 'value' => false, 'foreach' => true)); asort($this->tag_descriptions); } } ?> glpi-0.84.3+dfsg.1/inc/notificationtargetcommonitilobject.class.php000066400000000000000000001227021226600447100253720ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } abstract class NotificationTargetCommonITILObject extends NotificationTarget { /** * @param $entity (default '') * @param $event (default '') * @param $object (default null) * @param $options array **/ function __construct($entity='', $event='', $object=null, $options=array()) { parent::__construct($entity, $event, $object, $options); // For compatibility $this->options['sendprivate'] = true; } /** * Add linked users to the notified users list * * @param $type type of linked users **/ function getLinkedUserByType($type) { global $DB, $CFG_GLPI; $userlinktable = getTableForItemType($this->obj->userlinkclass); $fkfield = $this->obj->getForeignKeyField(); //Look for the user by his id $query = $this->getDistinctUserSql().", `$userlinktable`.`use_notification` AS notif, `$userlinktable`.`alternative_email` AS altemail FROM `$userlinktable` LEFT JOIN `glpi_users` ON (`$userlinktable`.`users_id` = `glpi_users`.`id`)". $this->getProfileJoinSql()." WHERE `$userlinktable`.`$fkfield` = '".$this->obj->fields["id"]."' AND `$userlinktable`.`type` = '$type'"; foreach ($DB->request($query) as $data) { //Add the user email and language in the notified users list if ($data['notif']) { $author_email = UserEmail::getDefaultForUser($data['users_id']); $author_lang = $data["language"]; $author_id = $data['users_id']; if (!empty($data['altemail']) && ($data['altemail'] != $author_email) && NotificationMail::isUserAddressValid($data['altemail'])) { $author_email = $data['altemail']; } if (empty($author_lang)) { $author_lang = $CFG_GLPI["language"]; } if (empty($author_id)) { $author_id = -1; } $this->addToAddressesList(array('email' => $author_email, 'language' => $author_lang, 'users_id' => $author_id)); } } // Anonymous user $query = "SELECT `alternative_email` FROM `$userlinktable` WHERE `$userlinktable`.`$fkfield` = '".$this->obj->fields["id"]."' AND `$userlinktable`.`users_id` = 0 AND `$userlinktable`.`use_notification` = 1 AND `$userlinktable`.`type` = '$type'"; foreach ($DB->request($query) as $data) { if (NotificationMail::isUserAddressValid($data['alternative_email'])) { $this->addToAddressesList(array('email' => $data['alternative_email'], 'language' => $CFG_GLPI["language"], 'users_id' => -1)); } } } /** * Add linked group to the notified user list * * @param $type type of linked groups **/ function getLinkedGroupByType($type) { global $DB; $grouplinktable = getTableForItemType($this->obj->grouplinkclass); $fkfield = $this->obj->getForeignKeyField(); //Look for the user by his id $query = "SELECT `groups_id` FROM `$grouplinktable` WHERE `$grouplinktable`.`$fkfield` = '".$this->obj->fields["id"]."' AND `$grouplinktable`.`type` = '$type'"; foreach ($DB->request($query) as $data) { //Add the group in the notified users list $this->getAddressesByGroup(0, $data['groups_id']); } } /** * Add linked group without supervisor to the notified user list * * @param $type type of linked groups **/ function getLinkedGroupWithoutSupervisorByType($type) { global $DB; $grouplinktable = getTableForItemType($this->obj->grouplinkclass); $fkfield = $this->obj->getForeignKeyField(); $query = "SELECT `groups_id` FROM `$grouplinktable` WHERE `$grouplinktable`.`$fkfield` = '".$this->obj->fields["id"]."' AND `$grouplinktable`.`type` = '$type'"; foreach ($DB->request($query) as $data) { //Add the group in the notified users list $this->getAddressesByGroup(2, $data['groups_id']); } } /** * Add linked group supervisor to the notified user list * * @param $type type of linked groups **/ function getLinkedGroupSupervisorByType($type) { global $DB; $grouplinktable = getTableForItemType($this->obj->grouplinkclass); $fkfield = $this->obj->getForeignKeyField(); $query = "SELECT `groups_id` FROM `$grouplinktable` WHERE `$grouplinktable`.`$fkfield` = '".$this->obj->fields["id"]."' AND `$grouplinktable`.`type` = '$type'"; foreach ($DB->request($query) as $data) { //Add the group in the notified users list $this->getAddressesByGroup(1, $data['groups_id']); } } /** * Get the email of the item's user : Overloaded manual address used **/ function getItemAuthorAddress() { $this->getLinkedUserByType(CommonITILActor::REQUESTER); } function getOldAssignTechnicianAddress() { global $CFG_GLPI; if (isset($this->options['_old_user']) && ($this->options['_old_user']['type'] == CommonITILActor::ASSIGN) && $this->options['_old_user']['use_notification']) { $user = new User(); $user->getFromDB($this->options['_old_user']['users_id']); $author_email = UserEmail::getDefaultForUser($user->fields['id']); $author_lang = $user->fields["language"]; $author_id = $user->fields['id']; if (!empty($this->options['_old_user']['alternative_email']) && ($this->options['_old_user']['alternative_email'] != $author_email) && NotificationMail::isUserAddressValid($this->options['_old_user']['alternative_email'])) { $author_email = $this->options['_old_user']['alternative_email']; } if (empty($author_lang)) { $author_lang = $CFG_GLPI["language"]; } if (empty($author_id)) { $author_id = -1; } $this->addToAddressesList(array('email' => $author_email, 'language' => $author_lang, 'users_id' => $author_id)); } } /** * Get recipient **/ function getRecipientAddress() { return $this->getUserByField("users_id_recipient"); } /** * Get supplier related to the ITIL object * * @param $sendprivate (false by default) **/ function getSupplierAddress($sendprivate=false) { global $DB; if (!$sendprivate && $this->obj->countSuppliers(CommonITILActor::ASSIGN)) { $supplierlinktable = getTableForItemType($this->obj->supplierlinkclass); $fkfield = $this->obj->getForeignKeyField(); $query = "SELECT DISTINCT `glpi_suppliers`.`email` AS email, `glpi_suppliers`.`name` AS name FROM `$supplierlinktable` LEFT JOIN `glpi_suppliers` ON (`$supplierlinktable`.`suppliers_id` = `glpi_suppliers`.`id`) WHERE `$supplierlinktable`.`$fkfield` = '".$this->obj->getID()."'"; foreach ($DB->request($query) as $data) { $this->addToAddressesList($data); } } } /** * Get approuver related to the ITIL object validation * * @param $options array **/ function getValidationApproverAddress($options=array()) { global $DB; if (isset($options['validation_id'])) { $validationtable = getTableForItemType($this->obj->getType().'Validation'); $query = $this->getDistinctUserSql()." FROM `$validationtable` LEFT JOIN `glpi_users` ON (`glpi_users`.`id` = `$validationtable`.`users_id_validate`)". $this->getProfileJoinSql()." WHERE `$validationtable`.`id` = '".$options['validation_id']."'"; foreach ($DB->request($query) as $data) { $this->addToAddressesList($data); } } } /** * Get requester related to the ITIL object validation * * @param $options array **/ function getValidationRequesterAddress($options=array()) { global $DB; if (isset($options['validation_id'])) { $validationtable = getTableForItemType($this->obj->getType().'Validation'); $query = $this->getDistinctUserSql()." FROM `$validationtable` LEFT JOIN `glpi_users` ON (`glpi_users`.`id` = `$validationtable`.`users_id`)". $this->getProfileJoinSql()." WHERE `$validationtable`.`id` = '".$options['validation_id']."'"; foreach ($DB->request($query) as $data) { $this->addToAddressesList($data); } } } /** * Get author related to the followup * * @param $options array **/ function getFollowupAuthor($options=array()) { global $DB; if (isset($options['followup_id'])) { $followuptable = getTableForItemType($this->obj->getType().'Followup'); $query = $this->getDistinctUserSql()." FROM `$followuptable` INNER JOIN `glpi_users` ON (`glpi_users`.`id` = `$followuptable`.`users_id`)". $this->getProfileJoinSql()." WHERE `$followuptable`.`id` = '".$options['followup_id']."'"; foreach ($DB->request($query) as $data) { $this->addToAddressesList($data); } } } /** * Get author related to the task * * @param $options array **/ function getTaskAuthor($options=array()) { global $DB; if (isset($options['task_id'])) { $tasktable = getTableForItemType($this->obj->getType().'Task'); $query = $this->getDistinctUserSql()." FROM `$tasktable` INNER JOIN `glpi_users` ON (`glpi_users`.`id` = `$tasktable`.`users_id`)". $this->getProfileJoinSql()." WHERE `$tasktable`.`id` = '".$options['task_id']."'"; foreach ($DB->request($query) as $data) { $this->addToAddressesList($data); } } } /** * Get author related to the task * * @param $options array **/ function getTaskAssignUser($options=array()) { global $DB; if (isset($options['task_id'])) { $tasktable = getTableForItemType($this->obj->getType().'Task'); $query = $this->getDistinctUserSql()." FROM `$tasktable` INNER JOIN `glpi_users` ON (`glpi_users`.`id` = `$tasktable`.`users_id_tech`)". $this->getProfileJoinSql()." WHERE `$tasktable`.`id` = '".$options['task_id']."'"; foreach ($DB->request($query) as $data) { $this->addToAddressesList($data); } } } /** * Get additionnals targets for ITIL objects * * @param $event (default '') **/ function getAdditionalTargets($event='') { if ($event=='update') { $this->addTarget(Notification::OLD_TECH_IN_CHARGE, __('Former technician in charge of the ticket')); } if ($event=='satisfaction') { $this->addTarget(Notification::AUTHOR, __('Requester')); $this->addTarget(Notification::RECIPIENT, __('Writer')); } else if ($event!='alertnotclosed') { $this->addTarget(Notification::RECIPIENT, __('Writer')); $this->addTarget(Notification::SUPPLIER, __('Supplier')); $this->addTarget(Notification::SUPERVISOR_ASSIGN_GROUP, __('Manager of the group in charge of the ticket')); $this->addTarget(Notification::ASSIGN_GROUP_WITHOUT_SUPERVISOR, __('Group in charge of the ticket without manager')); $this->addTarget(Notification::SUPERVISOR_REQUESTER_GROUP, __('Requester group manager')); $this->addTarget(Notification::REQUESTER_GROUP_WITHOUT_SUPERVISOR, __('Requester group without manager')); $this->addTarget(Notification::ITEM_TECH_IN_CHARGE, __('Technician in charge of the hardware')); $this->addTarget(Notification::ITEM_TECH_GROUP_IN_CHARGE, __('Group in charge of the hardware')); $this->addTarget(Notification::ASSIGN_TECH, __('Technician in charge of the ticket')); $this->addTarget(Notification::REQUESTER_GROUP, __('Requester group')); $this->addTarget(Notification::AUTHOR, __('Requester')); $this->addTarget(Notification::ITEM_USER, __('Hardware user')); $this->addTarget(Notification::ASSIGN_GROUP, __('Group in charge of the ticket')); $this->addTarget(Notification::OBSERVER_GROUP, __('Watcher group')); $this->addTarget(Notification::OBSERVER, __('Watcher')); $this->addTarget(Notification::SUPERVISOR_OBSERVER_GROUP,__('Watcher group manager')); $this->addTarget(Notification::OBSERVER_GROUP_WITHOUT_SUPERVISOR, __('Watcher group without manager')); } if (($event == 'validation') || ($event == 'validation_answer')) { $this->addTarget(Notification::VALIDATION_REQUESTER, __('Approval requester')); $this->addTarget(Notification::VALIDATION_APPROVER, __('Approver')); } if (($event == 'update_task') || ($event == 'add_task') || ($event == 'delete_task')) { $this->addTarget(Notification::TASK_ASSIGN_TECH, __('Technician in charge of the task')); $this->addTarget(Notification::TASK_AUTHOR, __('Task author')); } if (($event == 'update_followup') || ($event == 'add_followup') || ($event == 'delete_followup')) { $this->addTarget(Notification::FOLLOWUP_AUTHOR, __('Followup author')); } } /** * Get specifics targets for ITIL objects * * @param $data array * @param $options array **/ function getSpecificTargets($data, $options) { //Look for all targets whose type is Notification::ITEM_USER switch ($data['type']) { case Notification::USER_TYPE : switch ($data['items_id']) { case Notification::ASSIGN_TECH : $this->getLinkedUserByType(CommonITILActor::ASSIGN); break; //Send to the supervisor of group in charge of the ITIL object case Notification::SUPERVISOR_ASSIGN_GROUP : $this->getLinkedGroupSupervisorByType(CommonITILActor::ASSIGN); break; //Notification to the group in charge of the ITIL object without supervisor case Notification::ASSIGN_GROUP_WITHOUT_SUPERVISOR : $this->getLinkedGroupWithoutSupervisorByType(CommonITILActor::ASSIGN); break; //Send to the user who's got the issue case Notification::RECIPIENT : $this->getRecipientAddress(); break; //Send to the supervisor of the requester's group case Notification::SUPERVISOR_REQUESTER_GROUP : $this->getLinkedGroupSupervisorByType(CommonITILActor::REQUESTER); break; //Send to the technician previously in charge of the ITIL object (before reassignation) case Notification::OLD_TECH_IN_CHARGE : $this->getOldAssignTechnicianAddress(); break; //Assign to a supplier case Notification::SUPPLIER : $this->getSupplierAddress($this->options['sendprivate']); break; case Notification::REQUESTER_GROUP : $this->getLinkedGroupByType(CommonITILActor::REQUESTER); break; //Notification to the requester group without supervisor case Notification::REQUESTER_GROUP_WITHOUT_SUPERVISOR : $this->getLinkedGroupWithoutSupervisorByType(CommonITILActor::REQUESTER); break; case Notification::ASSIGN_GROUP : $this->getLinkedGroupByType(CommonITILActor::ASSIGN); break; //Send to the ITIL object validation approver case Notification::VALIDATION_APPROVER : $this->getValidationApproverAddress($options); break; //Send to the ITIL object validation requester case Notification::VALIDATION_REQUESTER : $this->getValidationRequesterAddress($options); break; //Send to the ITIL object followup author case Notification::FOLLOWUP_AUTHOR : $this->getFollowupAuthor($options); break; //Send to the ITIL object followup author case Notification::TASK_AUTHOR : $this->getTaskAuthor($options); break; //Send to the ITIL object followup author case Notification::TASK_ASSIGN_TECH : $this->getTaskAssignUser($options); break; //Notification to the ITIL object's observer group case Notification::OBSERVER_GROUP : $this->getLinkedGroupByType(CommonITILActor::OBSERVER); break; //Notification to the ITIL object's observer user case Notification::OBSERVER : $this->getLinkedUserByType(CommonITILActor::OBSERVER); break; //Notification to the supervisor of the ITIL object's observer group case Notification::SUPERVISOR_OBSERVER_GROUP : $this->getLinkedGroupSupervisorByType(CommonITILActor::OBSERVER); break; //Notification to the observer group without supervisor case Notification::OBSERVER_GROUP_WITHOUT_SUPERVISOR : $this->getLinkedGroupWithoutSupervisorByType(CommonITILActor::OBSERVER); break; } } } /** * Get all data needed for template processing * * @param $event * @param $options array **/ function getDatasForTemplate($event, $options=array()) { global $CFG_GLPI; $events = $this->getAllEvents(); $objettype = strtolower($this->obj->getType()); // Get datas from ITIL objects if ($event != 'alertnotclosed') { $this->datas = $this->getDatasForObject($this->obj, $options); } else { if (isset($options['entities_id']) && isset($options['items'])) { $entity = new Entity(); if ($entity->getFromDB($options['entities_id'])) { $this->datas["##$objettype.entity##"] = $entity->getField('completename'); $this->datas["##$objettype.shortentity##"] = $entity->getField('name'); } if ($item = getItemForItemtype($objettype)) { $objettypes = Toolbox::strtolower(getPlural($objettype)); $items = array(); foreach ($options['items'] as $object) { $item->getFromDB($object['id']); $tmp = $this->getDatasForObject($item, $options, true); $this->datas[$objettypes][] = $tmp; } } } } if (($event == 'validation') && isset($options['validation_status'])) { $this->datas["##$objettype.action##"] //TRANS: %s id of the approval's state = sprintf(__('%1$s - %2$s'), __('Approval'), TicketValidation::getStatus($options['validation_status'])); } else { $this->datas["##$objettype.action##"] = $events[$event]; } $this->getTags(); foreach ($this->tag_descriptions[parent::TAG_LANGUAGE] as $tag => $values) { if (!isset($this->datas[$tag])) { $this->datas[$tag] = $values['label']; } } } /** * @param $item CommonDBTM object * @param $options array * @param $simple (false by default) **/ function getDatasForObject(CommonDBTM $item, array $options, $simple=false) { global $CFG_GLPI, $DB; $objettype = strtolower($item->getType()); $datas["##$objettype.title##"] = $item->getField('name'); $datas["##$objettype.content##"] = $item->getField('content'); $datas["##$objettype.description##"] = $item->getField('content'); $datas["##$objettype.id##"] = sprintf("%07d", $item->getField("id")); $datas["##$objettype.url##"] = $this->formatURL($options['additionnaloption']['usertype'], $objettype."_".$item->getField("id")); $datas["##$objettype.urlapprove##"] = $this->formatURL($options['additionnaloption']['usertype'], $objettype."_".$item->getField("id")."_". $item->getType().'$2'); $entity = new Entity(); if ($entity->getFromDB($this->getEntity())) { $datas["##$objettype.entity##"] = $entity->getField('completename'); $datas["##$objettype.shortentity##"] = $entity->getField('name'); } $datas["##$objettype.storestatus##"] = $item->getField('status'); $datas["##$objettype.status##"] = $item->getStatus($item->getField('status')); $datas["##$objettype.urgency##"] = $item->getUrgencyName($item->getField('urgency')); $datas["##$objettype.impact##"] = $item->getImpactName($item->getField('impact')); $datas["##$objettype.priority##"] = $item->getPriorityName($item->getField('priority')); $datas["##$objettype.time##"] = $item->getActionTime($item->getField('actiontime')); $datas["##$objettype.creationdate##"] = Html::convDateTime($item->getField('date')); $datas["##$objettype.closedate##"] = Html::convDateTime($item->getField('closedate')); $datas["##$objettype.solvedate##"] = Html::convDateTime($item->getField('solvedate')); $datas["##$objettype.duedate##"] = Html::convDateTime($item->getField('due_date')); $datas["##$objettype.category##"] = ''; if ($item->getField('itilcategories_id')) { $datas["##$objettype.category##"] = Dropdown::getDropdownName('glpi_itilcategories', $item->getField('itilcategories_id')); } $datas["##$objettype.authors##"] = ''; $datas['authors'] = array(); if ($item->countUsers(CommonITILActor::REQUESTER)) { $users = array(); foreach ($item->getUsers(CommonITILActor::REQUESTER) as $tmpusr) { $uid = $tmpusr['users_id']; $user_tmp = new User(); if ($uid && $user_tmp->getFromDB($uid)) { $users[] = $user_tmp->getName(); $tmp = array(); $tmp['##author.id##'] = $uid; $tmp['##author.name##'] = $user_tmp->getName(); if ($user_tmp->getField('locations_id')) { $tmp['##author.location##'] = Dropdown::getDropdownName('glpi_locations', $user_tmp->getField('locations_id')); } else { $tmp['##author.location##'] = ''; } if ($user_tmp->getField('usertitles_id')) { $tmp['##author.title##'] = Dropdown::getDropdownName('glpi_usertitles', $user_tmp->getField('usertitles_id')); } else { $tmp['##author.title##'] = ''; } if ($user_tmp->getField('usercategories_id')) { $tmp['##author.category##'] = Dropdown::getDropdownName('glpi_usercategories', $user_tmp->getField('usercategories_id')); } else { $tmp['##author.category##'] = ''; } $tmp['##author.email##'] = $user_tmp->getDefaultEmail(); $tmp['##author.phone##'] = $user_tmp->getField('phone'); $tmp['##author.phone2##'] = $user_tmp->getField('phone2'); $datas['authors'][] = $tmp; } else { // Anonymous users only in xxx.authors, not in authors $users[] = $tmpusr['alternative_email']; } } $datas["##$objettype.authors##"] = implode(', ',$users); } $datas["##$objettype.openbyuser##"] = ''; if ($item->getField('users_id_recipient')) { $user_tmp = new User(); $user_tmp->getFromDB($item->getField('users_id_recipient')); $datas["##$objettype.openbyuser##"] = $user_tmp->getName(); } $datas["##$objettype.lastupdater##"] = ''; if ($item->getField('users_id_lastupdater')) { $user_tmp = new User(); $user_tmp->getFromDB($item->getField('users_id_lastupdater')); $datas["##$objettype.lastupdater##"] = $user_tmp->getName(); } $datas["##$objettype.assigntousers##"] = ''; if ($item->countUsers(CommonITILActor::ASSIGN)) { $users = array(); foreach ($item->getUsers(CommonITILActor::ASSIGN) as $tmp) { $uid = $tmp['users_id']; $user_tmp = new User(); if ($user_tmp->getFromDB($uid)) { $users[$uid] = $user_tmp->getName(); } } $datas["##$objettype.assigntousers##"] = implode(', ',$users); } $datas["##$objettype.assigntosupplier##"] = ''; if ($item->countSuppliers(CommonITILActor::ASSIGN)) { $suppliers = array(); foreach ($item->getSuppliers(CommonITILActor::ASSIGN) as $tmp) { $uid = $tmp['suppliers_id']; $supplier_tmp = new Supplier(); if ($supplier_tmp->getFromDB($uid)) { $suppliers[$uid] = $user_tmp->getName(); } } $datas["##$objettype.assigntosupplier##"] = implode(', ',$suppliers); } $datas["##$objettype.groups##"] = ''; if ($item->countGroups(CommonITILActor::REQUESTER)) { $groups = array(); foreach ($item->getGroups(CommonITILActor::REQUESTER) as $tmp) { $gid = $tmp['groups_id']; $groups[$gid] = Dropdown::getDropdownName('glpi_groups', $gid); } $datas["##$objettype.groups##"] = implode(', ',$groups); } $datas["##$objettype.observergroups##"] = ''; if ($item->countGroups(CommonITILActor::OBSERVER)) { $groups = array(); foreach ($item->getGroups(CommonITILActor::OBSERVER) as $tmp) { $gid = $tmp['groups_id']; $groups[$gid] = Dropdown::getDropdownName('glpi_groups', $gid); } $datas["##$objettype.observergroups##"] = implode(', ',$groups); } $datas["##$objettype.observerusers##"] = ''; if ($item->countUsers(CommonITILActor::OBSERVER)) { $users = array(); foreach ($item->getUsers(CommonITILActor::OBSERVER) as $tmp) { $uid = $tmp['users_id']; $user_tmp = new User(); if ($uid && $user_tmp->getFromDB($uid)) { $users[] = $user_tmp->getName(); } else { $users[] = $tmp['alternative_email']; } } $datas["##$objettype.observerusers##"] = implode(', ',$users); } $datas["##$objettype.assigntogroups##"] = ''; if ($item->countGroups(CommonITILActor::ASSIGN)) { $groups = array(); foreach ($item->getGroups(CommonITILActor::ASSIGN) as $tmp) { $gid = $tmp['groups_id']; $groups[$gid] = Dropdown::getDropdownName('glpi_groups', $gid); } $datas["##$objettype.assigntogroups##"] = implode(', ',$groups); } $datas["##$objettype.solution.type##"]=''; if ($item->getField('solutiontypes_id')) { $datas["##$objettype.solution.type##"] = Dropdown::getDropdownName('glpi_solutiontypes', $item->getField('solutiontypes_id')); } $datas["##$objettype.solution.description##"] = Toolbox::unclean_cross_side_scripting_deep($item->getField('solution')); $datas['log'] = array(); // Use list_limit_max or load the full history ? foreach (Log::getHistoryData($item, 0, $CFG_GLPI['list_limit_max']) as $data) { $tmp = array(); $tmp["##$objettype.log.date##"] = $data['date_mod']; $tmp["##$objettype.log.user##"] = $data['user_name']; $tmp["##$objettype.log.field##"] = $data['field']; $tmp["##$objettype.log.content##"] = $data['change']; $datas['log'][] = $tmp; } $datas["##$objettype.numberoflogs##"] = count($datas['log']); // Get unresolved items $restrict = "`".$item->getTable()."`.`status` NOT IN ('".implode("', '", array_merge($item->getSolvedStatusArray(), $item->getClosedStatusArray()) )."' )"; if ($item->maybeDeleted()) { $restrict .= " AND `".$item->getTable()."`.`is_deleted` = '0' "; } $datas["##$objettype.numberofunresolved##"] = countElementsInTableForEntity($item->getTable(), $this->getEntity(), $restrict); // Document $query = "SELECT `glpi_documents`.* FROM `glpi_documents` LEFT JOIN `glpi_documents_items` ON (`glpi_documents`.`id` = `glpi_documents_items`.`documents_id`) WHERE `glpi_documents_items`.`itemtype` = '$objettype' AND `glpi_documents_items`.`items_id` = '".$item->getField('id')."'"; $datas["documents"] = array(); if ($result = $DB->query($query)) { while ($data = $DB->fetch_assoc($result)) { $tmp = array(); $tmp['##document.id##'] = $data['id']; $tmp['##document.name##'] = $data['name']; $tmp['##document.weblink##'] = $data['link']; $tmp['##document.url##'] = $this->formatURL($options['additionnaloption']['usertype'], "document_".$data['id']); $tmp['##document.heading##'] = Dropdown::getDropdownName('glpi_documentcategories', $data['documentcategories_id']); $tmp['##document.filename##'] = $data['filename']; $datas['documents'][] = $tmp; } } $datas["##$objettype.urldocument##"] = $this->formatURL($options['additionnaloption']['usertype'], $objettype."_".$item->getField("id").'_Document_Item$1'); $datas["##$objettype.numberofdocuments##"] = count($datas['documents']); return $datas; } function getTags() { $itemtype = $this->obj->getType(); $objettype = strtolower($itemtype); //Locales $tags = array($objettype.'.id' => __('ID'), $objettype.'.title' => __('Title'), $objettype.'.url' => __('URL'), $objettype.'.category' => __('Category'), $objettype.'.content' => __('Description'), $objettype.'.description' => sprintf(__('%1$s: %2$s'), __('Ticket'), __('Description')), $objettype.'.status' => __('Status'), $objettype.'.urgency' => __('Urgency'), $objettype.'.impact' => __('Impact'), $objettype.'.priority' => __('Priority'), $objettype.'.time' => __('Total duration'), $objettype.'.creationdate' => __('Opening date'), $objettype.'.closedate' => __('Closing date'), $objettype.'.solvedate' => __('Date of solving'), $objettype.'.duedate' => __('Due date'), $objettype.'.authors' => _n('Requester', 'Requesters', 2), 'author.id' => __('Requester ID'), 'author.name' => __('Requester'), 'author.location' => __('Requester location'), 'author.phone' => __('Phone'), 'author.phone2' => __('Phone 2'), 'author.email' => _n('Email', 'Emails', 1), 'author.title' => _x('person','Title'), 'author.category' => __('Category'), $objettype.'.openbyuser' => __('Writer'), $objettype.'.lastupdater' => __('Last updater'), $objettype.'.assigntousers' => __('Assigned to technicians'), $objettype.'.assigntosupplier' => __('Assigned to a supplier'), $objettype.'.groups' => _n('Requester group', 'Requester groups', 2), $objettype.'.observergroups' => _n('Watcher group', 'Watcher groups', 2), $objettype.'.assigntogroups' => __('Assigned to groups'), $objettype.'.solution.type' => __('Solution type'), $objettype.'.solution.description' => _n('Solution', 'Solutions', 1), $objettype.'.observerusers' => _n('Watcher', 'Watchers', 2), $objettype.'.action' => _n('Event', 'Events', 1), $objettype.'.numberofunresolved' => __('Number of unresolved items'), $objettype.'.numberofdocuments' => _x('quantity', 'Number of documents'), ); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'events' => parent::TAG_FOR_ALL_EVENTS)); } //Foreach global tags $tags = array('log' => __('Historical'), 'authors' => _n('Requester', 'Requesters', 2), 'documents' => _n('Document', 'Documents', 2) ); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => false, 'foreach' => true)); } //Tags with just lang $tags = array($objettype.'.days' => _n('Day', 'Days', 2), $objettype.'.attribution' => __('Assigned to'), $objettype.'.entity' => __('Entity'), $objettype.'.nocategoryassigned' => __('No defined category')); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => false, 'lang' => true)); } //Tags without lang $tags = array($objettype.'.urlapprove' => __('Web link to approval the solution'), $objettype.'.entity' => sprintf(__('%1$s (%2$s)'), __('Entity'), __('Complete name')), $objettype.'.shortentity' => sprintf(__('%1$s (%2$s)'), __('Entity'), __('Name')), $objettype.'.numberoflogs' => sprintf(__('%1$s: %2$s'), __('Historical'), __('Number of items')), $objettype.'.log.date' => sprintf(__('%1$s: %2$s'), __('Historical'), __('Date')), $objettype.'.log.user' => sprintf(__('%1$s: %2$s'), __('Historical'), __('User')), $objettype.'.log.field' => sprintf(__('%1$s: %2$s'), __('Historical'), __('Field')), $objettype.'.log.content' => sprintf(__('%1$s: %2$s'), __('Historical'), _x('name', 'Update')), 'document.url' => sprintf(__('%1$s: %2$s'), __('Document'), __('URL')), 'document.heading' => sprintf(__('%1$s: %2$s'), __('Document'), __('Heading')), 'document.id' => sprintf(__('%1$s: %2$s'), __('Document'), __('ID')), 'document.filename' => sprintf(__('%1$s: %2$s'), __('Document'), __('File')), 'document.weblink' => sprintf(__('%1$s: %2$s'), __('Document'), __('Web Link')), 'document.name' => sprintf(__('%1$s: %2$s'), __('Document'), __('Name')), $objettype.'.urldocument' => sprintf(__('%1$s: %2$s'), _n('Document', 'Documents', 2), __('URL')), ); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'lang' => false)); } //Tickets with a fixed set of values $status = $this->obj->getAllStatusArray(false); $allowed_ticket = array(); foreach ($status as $key => $value) { $allowed_ticket[] = $key; } $tags = array($objettype.'.storestatus' => array('text' => __('Status value in database'), 'allowed_values' => $allowed_ticket)); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label['text'], 'value' => true, 'lang' => false, 'allowed_values' => $label['allowed_values'])); } } } ?> glpi-0.84.3+dfsg.1/inc/notificationtargetconsumableitem.class.php000066400000000000000000000071251226600447100250410ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // Class NotificationTarget class NotificationTargetConsumableItem extends NotificationTarget { function getEvents() { return array('alert' => __('Consumables alarm')); } /** * Get all data needed for template processing * * @param $event * @param $options array **/ function getDatasForTemplate($event, $options=array()) { global $CFG_GLPI; $events = $this->getAllEvents(); $this->datas['##consumable.entity##'] = Dropdown::getDropdownName('glpi_entities', $options['entities_id']); $this->datas['##lang.consumable.entity##'] = __('Entity'); $this->datas['##consumable.action##'] = $events[$event]; foreach ($options['items'] as $id => $consumable) { $tmp = array(); $tmp['##consumable.item##'] = $consumable['name']; $tmp['##consumable.reference##'] = $consumable['ref']; $tmp['##consumable.remaining##'] = Consumable::getUnusedNumber($id); $tmp['##consumable.url##'] = urldecode($CFG_GLPI["url_base"]. "/index.php?redirect=consumableitem_".$id); $this->datas['consumables'][] = $tmp; } $this->getTags(); foreach ($this->tag_descriptions[NotificationTarget::TAG_LANGUAGE] as $tag => $values) { if (!isset($this->datas[$tag])) { $this->datas[$tag] = $values['label']; } } } function getTags() { $tags = array('consumable.action' => _n('Event', 'Events', 1), 'consumable.reference' => __('Reference'), 'consumable.item' => __('Consumable model'), 'consumable.remaining' => __('Remaining'), 'consumable.entity' => __('Entity')); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true)); } $this->addTagToList(array('tag' => 'consumables', 'label' => __('Device list'), 'value' => false, 'foreach' => true)); asort($this->tag_descriptions); } } ?>glpi-0.84.3+dfsg.1/inc/notificationtargetcontract.class.php000066400000000000000000000154711226600447100236520ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // Class NotificationTarget class NotificationTargetContract extends NotificationTarget { function getEvents() { return array('end' => __('End of contract'), 'notice' => __('Notice'), 'periodicity' => __('Periodicity'), 'periodicitynotice' => __('Periodicity notice')); } /** * Get all data needed for template processing * * @param $event * @param $options array **/ function getDatasForTemplate($event, $options=array()) { global $CFG_GLPI; $this->datas['##contract.entity##'] = Dropdown::getDropdownName('glpi_entities', $options['entities_id']); $events = $this->getEvents(); $this->datas['##contract.action##'] = sprintf(__('%1$s - %2$s'), __('Contracts alarm'), $events[$event]); foreach ($options['items'] as $id => $contract) { $tmp = array(); $tmp['##contract.name##'] = $contract['name']; $tmp['##contract.number##'] = $contract['num']; if ($contract['contracttypes_id']) { $tmp['##contract.type##'] = Dropdown::getDropdownName('glpi_contracttypes', $contract['contracttypes_id']); } else { $tmp['##contract.type##'] = ""; } switch ($event) { case 'end': $tmp['##contract.time##'] = Infocom::getWarrantyExpir($contract["begin_date"], $contract["duration"]); break; case 'notice': $tmp['##contract.time##'] = Infocom::getWarrantyExpir($contract["begin_date"], $contract["duration"], $contract["notice"]); break; case 'periodicity': case 'periodicitynotice': if (isset($contract["alert_date"])) { $tmp['##contract.time##'] = Html::convDate($contract["alert_date"]); } else if (isset($options['_debug'])) { $tmp['##contract.time##'] = Html::convDate($_SESSION['glpi_currenttime']); } break; } $tmp['##contract.url##'] = urldecode($CFG_GLPI["url_base"]. "/index.php?redirect=contract_".$id); $tmp['##contract.items.number##'] = 0; $tmp['##contract.items##'] = ''; if (isset($contract['items']) && count($contract['items'])) { $toadd = array(); foreach ($contract['items'] as $itemtype => $item) { if ($type = getItemForItemtype($itemtype)) { $typename = $type->getTypeName(); foreach ($item as $item_data) { $toadd[] = sprintf(__('%1$s - %2$s'),$typename, $item_data['name']); } } } if (count($toadd)) { $tmp["##contract.items##"] = implode(', ',$toadd); } } $this->datas['contracts'][] = $tmp; } switch ($event) { case 'end': $this->datas['##lang.contract.time##'] = __('Contract expired since the'); break; case 'notice': $this->datas['##lang.contract.time##'] = __('Contract with notice since the'); break; case 'periodicity': $this->datas['##lang.contract.time##'] = __('Contract reached the end of a period since the'); break; case 'periodicitynotice': $this->datas['##lang.contract.time##'] = __('Contract with notice for the current period since the'); break; } $this->getTags(); foreach ($this->tag_descriptions[NotificationTarget::TAG_LANGUAGE] as $tag => $values) { if (!isset($this->datas[$tag])) { $this->datas[$tag] = $values['label']; } } } function getTags() { $tags = array('contract.action' => _n('Event', 'Events', 1), 'contract.name' => __('Name'), 'contract.number' => _x('phone', 'Number'), 'contract.items.number' => _x('quantity', 'Number of items'), 'contract.items' => __('Device list'), 'contract.type' => __('Type'), 'contract.entity' => __('Entity'), 'contract.time' => sprintf(__('%1$s / %2$s'), __('Contract expired since the'), __('Contract with notice since the'))); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true)); } //Tags without lang $tags = array('contract.url' => sprintf(__('%1$s: %2$s'), __('Contract'), __('URL'))); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'lang' => false)); } asort($this->tag_descriptions); } } ?>glpi-0.84.3+dfsg.1/inc/notificationtargetcrontask.class.php000066400000000000000000000075211226600447100236560ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // Class NotificationTarget class NotificationTargetCrontask extends NotificationTarget { function getEvents() { return array('alert' => __('Monitoring of automatic actions')); } /** * Get all data needed for template processing * * @param $event * @param $options array **/ function getDatasForTemplate($event, $options=array()) { global $CFG_GLPI; $events = $this->getAllEvents(); $this->datas['##crontask.action##'] = $events[$event]; $cron = new Crontask(); foreach ($options['items'] as $id => $crontask) { $tmp = array(); $tmp['##crontask.name##'] = ''; if ($isplug=isPluginItemType($crontask["itemtype"])) { $tmp['##crontask.name##'] = $isplug["plugin"]." - "; } $tmp['##crontask.name##'] .= $crontask['name']; $tmp['##crontask.description##'] = $cron->getDescription($id); $tmp['##crontask.url##'] = urldecode($CFG_GLPI["url_base"]. "/index.php?redirect=crontask_".$id); $this->datas['crontasks'][] = $tmp; } $this->getTags(); foreach ($this->tag_descriptions[NotificationTarget::TAG_LANGUAGE] as $tag => $values) { if (!isset($this->datas[$tag])) { $this->datas[$tag] = $values['label']; } } } function getTags() { $tags = array('crontask.action' => __('Monitoring of automatic actions'), 'crontask.url' => __('URL'), 'crontask.name' => __('Name'), 'crontask.description' => __('Description')); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true)); } $this->addTagToList(array('tag' => 'crontasks', 'label' => __('Device list'), 'value' => false, 'foreach' => true)); //Tags with just lang $tags = array('crontask.warning' => __('The following automatic actions are in error. They require intervention.')); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => false, 'lang' => true)); } asort($this->tag_descriptions); } } ?> glpi-0.84.3+dfsg.1/inc/notificationtargetdbconnection.class.php000066400000000000000000000065611226600447100245020ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // Class NotificationTarget class NotificationTargetDBConnection extends NotificationTarget { /** * Overwrite the function in NotificationTarget because there's only one target to be notified * * @see NotificationTarget::getNotificationTargets() **/ function getNotificationTargets($entity) { $this->addProfilesToTargets(); $this->addGroupsToTargets($entity); $this->addTarget(Notification::GLOBAL_ADMINISTRATOR, __('Administrator')); } function getEvents() { return array('desynchronization' => __('Desynchronization MySQL replica')); } /** * @param $event * @param $options array **/ function getDatasForTemplate($event, $options=array()) { if ($options['diff'] > 1000000000) { $tmp = __("Can't connect to the database."); } else { $tmp = Html::timestampToString($options['diff'], true); } $this->datas['##dbconnection.delay##'] = $tmp." (".$options['name'].")"; $this->getTags(); foreach ($this->tag_descriptions[NotificationTarget::TAG_LANGUAGE] as $tag => $values) { if (!isset($this->datas[$tag])) { $this->datas[$tag] = $values['label']; } } } function getTags() { $tags = array('dbconnection.delay' => __('Difference between master and slave')); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'lang' => true)); } //Tags with just lang $tags = array('dbconnection.title' => __('Slave database out of sync!'), 'dbconnection.delay' => __('The slave database is desynchronized. The difference is of:')); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => false, 'lang' => true)); } asort($this->tag_descriptions); } } ?>glpi-0.84.3+dfsg.1/inc/notificationtargetfieldunicity.class.php000066400000000000000000000070321226600447100245170ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // Class NotificationTarget class NotificationTargetFieldUnicity extends NotificationTarget { function getEvents() { return array('refuse' => __('Alert on duplicate record')); } /** * Get all data needed for template processing * * @param $event * @param $options array **/ function getDatasForTemplate($event, $options=array()) { //User who tries to add or update an item in DB $action = ($options['action_user'] ?__('Add the item') :__('Update the item')); $this->datas['##unicity.action_type##'] = $action; $this->datas['##unicity.action_user##'] = $options['action_user']; $this->datas['##unicity.message##'] = $options['message']; $this->datas['##unicity.date##'] = Html::convDateTime($options['date']); if ($item = getItemForItemtype($options['itemtype'])) { $this->datas['##unicity.itemtype##'] = $item->getTypeName(1); } $this->datas['##unicity.entity##'] = Dropdown::getDropdownName('glpi_entities', $options['entities_id']); if ($options['refuse']) { $this->datas['##unicity.action##'] = __('Record into the database denied'); } else { $this->datas['##unicity.action##'] = __('Item successfully added but duplicate record on'); } $this->getTags(); foreach ($this->tag_descriptions[NotificationTarget::TAG_LANGUAGE] as $tag => $values) { if (!isset($this->datas[$tag])) { $this->datas[$tag] = $values['label']; } } } function getTags() { $tags = array('unicity.message' => __('Message'), 'unicity.action_user' => __('Doer'), 'unicity.action_type' => __('Intended action'), 'unicity.date' => __('Date'), 'unicity.itemtype' => __('Type'), 'unicity.entity' => __('Entity'), 'unicity.action' => __('Alert on duplicate record')); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true)); } asort($this->tag_descriptions); return $this->tag_descriptions; } } ?>glpi-0.84.3+dfsg.1/inc/notificationtargetinfocom.class.php000066400000000000000000000074371226600447100234720ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // Class NotificationTarget class NotificationTargetInfocom extends NotificationTarget { function getEvents() { return array('alert' => __('Alarms on financial and administrative information')); } /** * Get all data needed for template processing * * @param $event * @param $options array **/ function getDatasForTemplate($event, $options=array()) { global $CFG_GLPI; $events = $this->getAllEvents(); $this->datas['##infocom.entity##'] = Dropdown::getDropdownName('glpi_entities', $options['entities_id']); $this->datas['##infocom.action##'] = $events[$event]; foreach ($options['items'] as $id => $item) { $tmp = array(); if ($obj = getItemForItemtype($item['itemtype'])) { $tmp['##infocom.itemtype##'] = $obj->getTypeName(1); $tmp['##infocom.item##'] = $item['item_name']; $tmp['##infocom.expirationdate##'] = $item['warrantyexpiration']; $tmp['##infocom.url##'] = urldecode($CFG_GLPI["url_base"]. "/index.php?redirect=". strtolower($item['itemtype'])."_". $item['items_id']."_Infocom"); } $this->datas['infocoms'][] = $tmp; } $this->getTags(); foreach ($this->tag_descriptions[NotificationTarget::TAG_LANGUAGE] as $tag => $values) { if (!isset($this->datas[$tag])) { $this->datas[$tag] = $values['label']; } } } function getTags() { $tags = array('infocom.action' => _n('Event', 'Events', 1), 'infocom.itemtype' => __('Item type'), 'infocom.item' => __('Associated item'), 'infocom.expirationdate' => __('Expiration date'), 'infocom.entity' => __('Entity')); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true)); } $this->addTagToList(array('tag' => 'items', 'label' => __('Device list'), 'value' => false, 'foreach' => true)); asort($this->tag_descriptions); } } ?>glpi-0.84.3+dfsg.1/inc/notificationtargetplanningrecall.class.php000066400000000000000000000152471226600447100250270ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // Class NotificationTargetPlanningRecall class NotificationTargetPlanningRecall extends NotificationTarget { function getEvents() { return array('planningrecall' => __('Planning recall')); } /** * @see NotificationTarget::getNotificationTargets() **/ function getNotificationTargets($entity) { $this->addTarget(Notification::AUTHOR, __('Requester')); } /** * @see NotificationTarget::getDatasForTemplate() **/ function getDatasForTemplate($event, $options=array()) { global $CFG_GLPI; $events = $this->getAllEvents(); $this->datas['##recall.action##'] = $events[$event]; $this->datas['##recall.itemtype##'] = $this->target_object->getTypeName(1); $this->datas['##recall.item.URL##'] = ''; // For task show parent link if (($this->target_object instanceof CommonDBChild) || ($this->target_object instanceof CommonITILTask)) { $item2 = $this->target_object->getItem(); $this->datas['##recall.item.url##'] = urldecode($CFG_GLPI["url_base"]."/index.php". "?redirect=".strtolower($item2->getType()). "_".$item2->getID()); } else { $this->datas['##recall.item.url##'] = urldecode($CFG_GLPI["url_base"]."/index.php". "?redirect=". strtolower($this->target_object->getType()). "_".$this->target_object->getID()); } $this->datas['##recall.item.name##'] = ''; if ($this->target_object->isField('name')) { $this->datas['##recall.item.name##'] = $this->target_object->getField('name'); } else { if (($item2 = $this->target_object->getItem()) && $item2->isField('name')) { $this->datas['##recall.item.name##'] = $item2->getField('name'); } } $this->datas['##recall.item.content##'] = ''; if ($this->target_object->isField('content')) { $this->datas['##recall.item.content##'] = $this->target_object->getField('content'); } if ($this->target_object->isField('text')) { $this->datas['##recall.item.content##'] = $this->target_object->getField('text'); } $this->datas['##recall.item.private##'] = ''; if ($this->target_object->isField('is_private')) { $this->datas['##recall.item.private##'] = Dropdown::getYesNo($this->target_object->getField('is_private')); } $this->datas['##recall.item.date_mod##'] = ''; if ($this->target_object->isField('date_mod')) { $this->datas['##recall.item.date_mod##'] = Html::convDateTime($this->target_object->getField('date_mod')); } $this->datas['##recall.item.user##'] = ''; $user_tmp = new User(); if ($user_tmp->getFromDB($this->target_object->getField('users_id'))) { $this->datas['##recall.item.user##'] = $user_tmp->getName(); } $this->datas['##recall.planning.state##'] = ''; if ($this->target_object->isField('state')) { $this->datas['##recall.planning.state##'] = Planning::getState($this->target_object->getField('state')); } $this->datas['##recall.planning.begin##'] = Html::convDateTime($this->target_object->getField('begin')); $this->datas['##recall.planning.end##'] = Html::convDateTime($this->target_object->getField('end')); $this->getTags(); foreach ($this->tag_descriptions[NotificationTarget::TAG_LANGUAGE] as $tag => $values) { if (!isset($this->datas[$tag])) { $this->datas[$tag] = $values['label']; } } } function getTags() { $tags_all = array('recall.action' => _n('Event', 'Events', 1), 'recall.item.user' => __('Writer'), 'recall.item.date_mod' => __('Last update'), 'recall.item.name' => __('Title'), 'recall.item.private' => __('Private'), 'recall.item.content' => __('Description'), 'recall.item.url' => __('URL'), 'recall.itemtype' => __('Item type'), 'recall.planning.begin' => __('Start date'), 'recall.planning.state' => __('Status'), 'recall.planning.end' => __('End date'), ); foreach ($tags_all as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true)); } asort($this->tag_descriptions); } /** * Get item associated with the object on which the event was raised * * @see NotificationTarget::getObjectItem() * * @param $event (default '') * * @return the object associated with the itemtype **/ function getObjectItem($event='') { if ($this->obj) { if (($item = getItemForItemtype($this->obj->getField('itemtype'))) && $item->getFromDB($this->obj->getField('items_id'))) { $this->target_object = $item; } } } } ?>glpi-0.84.3+dfsg.1/inc/notificationtargetproblem.class.php000066400000000000000000000270131226600447100234700ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // Class NotificationTarget class NotificationTargetProblem extends NotificationTargetCommonITILObject { var $private_profiles = array(); public $html_tags = array('##problem.solution.description##'); /** * Get events related to tickets **/ function getEvents() { $events = array('new' => __('New problem'), 'update' => __('Update of a problem'), 'solved' => __('Problem solved'), 'add_task' => __('New task'), 'update_task' => __('Update of a task'), 'delete_task' => __('Deletion of a task'), 'closed' => __('Closure of a problem'), 'delete' => __('Deleting a problem')); asort($events); return $events; } /** * @see NotificationTargetCommonITILObject::getDatasForObject() **/ function getDatasForObject(CommonDBTM $item, array $options, $simple=false) { global $CFG_GLPI; // Common ITIL datas $datas = parent::getDatasForObject($item, $options, $simple); $datas["##problem.impacts##"] = $item->getField('impactcontent'); $datas["##problem.causes##"] = $item->getField('causecontent'); $datas["##problem.symptoms##"] = $item->getField('symptomcontent'); // Complex mode : get tasks if (!$simple) { $restrict = "`problems_id`='".$item->getField('id')."'"; $tickets = getAllDatasFromTable('glpi_problems_tickets', $restrict); $datas['tickets'] = array(); if (count($tickets)) { $ticket = new Ticket(); foreach ($tickets as $data) { if ($ticket->getFromDB($data['tickets_id'])) { $tmp = array(); $tmp['##ticket.id##'] = $data['tickets_id']; $tmp['##ticket.date##'] = $ticket->getField('date'); $tmp['##ticket.title##'] = $ticket->getField('name'); $tmp['##ticket.url##'] = urldecode($CFG_GLPI["url_base"]."/index.php". "?redirect=ticket_".$data['tickets_id']); $tmp['##ticket.content##'] = $ticket->getField('content'); $datas['tickets'][] = $tmp; } } } $datas['##problem.numberoftickets##'] = count($datas['tickets']); $restrict = "`problems_id` = '".$item->getField('id')."' ORDER BY `date` DESC, `id` ASC"; //Task infos $tasks = getAllDatasFromTable('glpi_problemtasks', $restrict); $datas['tasks'] = array(); foreach ($tasks as $task) { $tmp = array(); $tmp['##task.author##'] = Html::clean(getUserName($task['users_id'])); $tmp['##task.category##'] = Dropdown::getDropdownName('glpi_taskcategories', $task['taskcategories_id']); $tmp['##task.date##'] = Html::convDateTime($task['date']); $tmp['##task.description##'] = $task['content']; $tmp['##task.time##'] = Problem::getActionTime($task['actiontime']); $tmp['##task.status##'] = Planning::getState($task['state']); $tmp['##task.user##'] = ""; $tmp['##task.begin##'] = ""; $tmp['##task.end##'] = ""; if (!is_null($task['begin'])) { $tmp['##task.user##'] = Html::clean(getUserName($task['users_id_tech'])); $tmp['##task.begin##'] = Html::convDateTime($task['begin']); $tmp['##task.end##'] = Html::convDateTime($task['end']); } $datas['tasks'][] = $tmp; } $datas['##problem.numberoftasks##'] = count($datas['tasks']); $restrict = "`problems_id` = '".$item->getField('id')."'"; $items = getAllDatasFromTable('glpi_items_problems',$restrict); $datas['items'] = array(); if (count($items)) { foreach ($items as $data) { if ($item2 = getItemForItemtype($data['itemtype'])) { if ($item2->getFromDB($data['items_id'])) { $tmp = array(); $tmp['##item.itemtype##'] = $item2->getTypeName(); $tmp['##item.name##'] = $item2->getField('name'); $tmp['##item.serial##'] = $item2->getField('serial'); $tmp['##item.otherserial##'] = $item2->getField('otherserial'); $tmp['##item.contact##'] = $item2->getField('contact'); $tmp['##item.contactnum##'] = $item2->getField('contactnum'); $tmp['##item.location##'] = ''; $tmp['##item.user##'] = ''; $tmp['##item.group##'] = ''; $tmp['##item.model##'] = ''; //Object location if ($item2->getField('locations_id') != NOT_AVAILABLE) { $tmp['##item.location##'] = Dropdown::getDropdownName('glpi_locations', $item2->getField('locations_id')); } //Object user if ($item2->getField('users_id')) { $user_tmp = new User(); if ($user_tmp->getFromDB($item2->getField('users_id'))) { $tmp['##item.user##'] = $user_tmp->getName(); } } //Object group if ($item2->getField('groups_id')) { $tmp['##item.group##'] = Dropdown::getDropdownName('glpi_groups', $item2->getField('groups_id')); } $modeltable = getSingular($item2->getTable())."models"; $modelfield = getForeignKeyFieldForTable($modeltable); if ($item2->isField($modelfield)) { $tmp['##item.model##'] = $item2->getField($modelfield); } $datas['items'][] = $tmp; } } } } $datas['##problem.numberofitems##'] = count($datas['items']); } return $datas; } function getTags() { parent::getTags(); //Locales $tags = array('task.author' => __('Writer'), 'task.isprivate' => __('Private'), 'task.date' => __('Opening date'), 'task.description' => __('Description'), 'task.category' => __('Category'), 'task.time' => __('Total duration'), 'task.user' => __('By'), 'task.begin' => __('Start date'), 'task.end' => __('End date'), 'task.status' => __('Status'), 'problem.numberoftasks' => _x('quantity', 'Number of tasks'), 'problem.numberoftickets' => _x('quantity', 'Number of tickets'), 'problem.impacts' => __('Impacts'), 'problem.causes' => __('Causes'), 'problem.symptoms' => __('Symptoms'), 'item.name' => __('Associated item'), 'item.serial' => __('Serial number'), 'item.otherserial' => __('Inventory number'), 'item.location' => __('Location'), 'item.model' => __('Model'), 'item.contact' => __('Alternate username'), 'item.contactnumber' => __('Alternate username number'), 'item.user' => __('User'), 'item.group' => __('Group'),); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'events' => NotificationTarget::TAG_FOR_ALL_EVENTS)); } //Foreach global tags $tags = array('tasks' => _n('Task', 'Tasks', 2), 'tickets' => _n('Ticket', 'Tickets', 2), 'items' => _n('Item', 'Items', 2)); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => false, 'foreach' => true)); } //Tags with just lang $tags = array('ticket.tickets' => _n('Ticket', 'Tickets', 2), 'items' => _n('Item', 'Items', 2)); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => false, 'lang' => true)); } //Tags without lang $tags = array('ticket.id' => sprintf(__('%1$s: %2$s'), __('Ticket'), __('ID')), 'ticket.date' => sprintf(__('%1$s: %2$s'), __('Ticket'), __('Date')), 'ticket.url' => sprintf(__('%1$s: %2$s'), __('Ticket'), __('URL')), 'ticket.title' => sprintf(__('%1$s: %2$s'), __('Ticket'), __('Title')), 'ticket.content' => sprintf(__('%1$s: %2$s'), __('Ticket'), __('Description'))); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'lang' => false)); } asort($this->tag_descriptions); } } ?> glpi-0.84.3+dfsg.1/inc/notificationtargetreservation.class.php000066400000000000000000000202031226600447100243630ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // Class NotificationTarget class NotificationTargetReservation extends NotificationTarget { function getEvents() { return array('new' => __('New reservation'), 'update' => __('Update of a reservation'), 'delete' => __('Deletion of a reservation'), 'alert' => __('Reservation expired')); } /** * @see NotificationTarget::getAdditionalTargets() **/ function getAdditionalTargets($event='') { if ($event != 'alert') { $this->addTarget(Notification::ITEM_TECH_IN_CHARGE, __('Technician in charge of the hardware')); $this->addTarget(Notification::ITEM_TECH_GROUP_IN_CHARGE, __('Group in charge of the hardware')); $this->addTarget(Notification::ITEM_USER, __('Hardware user')); $this->addTarget(Notification::AUTHOR, __('Requester')); } } /** * @see NotificationTarget::getDatasForTemplate() **/ function getDatasForTemplate($event, $options=array()) { global $CFG_GLPI; //----------- Reservation infos -------------- // $events = $this->getAllEvents(); $this->datas['##reservation.action##'] = $events[$event]; if ($event != 'alert') { $this->datas['##reservation.user##'] = ""; $user_tmp = new User(); if ($user_tmp->getFromDB($this->obj->getField('users_id'))) { $this->datas['##reservation.user##'] = $user_tmp->getName(); } $this->datas['##reservation.begin##'] = Html::convDateTime($this->obj->getField('begin')); $this->datas['##reservation.end##'] = Html::convDateTime($this->obj->getField('end')); $this->datas['##reservation.comment##'] = $this->obj->getField('comment'); $reservationitem = new ReservationItem(); $reservationitem->getFromDB($this->obj->getField('reservationitems_id')); $itemtype = $reservationitem->getField('itemtype'); if ($item = getItemForItemtype($itemtype)) { $item->getFromDB($reservationitem->getField('items_id')); $this->datas['##reservation.itemtype##'] = $item->getTypeName(1); $this->datas['##reservation.item.name##'] = $item->getField('name'); $this->datas['##reservation.item.entity##'] = Dropdown::getDropdownName('glpi_entities', $item->getField('entities_id')); if ($item->isField('users_id_tech')) { $this->datas['##reservation.item.tech##'] = Dropdown::getDropdownName('glpi_users', $item->getField('users_id_tech')); } $this->datas['##reservation.url##'] = urldecode($CFG_GLPI["url_base"]."/index.php?redirect=". strtolower($itemtype)."_".$reservationitem->getField('id')); } } else { $this->datas['##reservation.entity##'] = Dropdown::getDropdownName('glpi_entities', $options['entities_id']); foreach ($options['items'] as $id => $item) { $tmp = array(); if ($obj = getItemForItemtype($item['itemtype'])) { $tmp['##reservation.itemtype##'] = $obj->getTypeName(1); $tmp['##reservation.item##'] = $item['item_name']; $tmp['##reservation.expirationdate##'] = Html::convDateTime($item['end']); $tmp['##reservation.url##'] = urldecode($CFG_GLPI["url_base"]. "/index.php?redirect=reservation_". $id); } $this->datas['reservations'][] = $tmp; } } $this->getTags(); foreach ($this->tag_descriptions[NotificationTarget::TAG_LANGUAGE] as $tag => $values) { if (!isset($this->datas[$tag])) { $this->datas[$tag] = $values['label']; } } } function getTags() { $tags_all = array('reservation.item' => __('Associated item'), 'reservation.itemtype' => __('Item type'), 'reservation.url' => __('URL'), 'reservation.action' => _n('Event', 'Events', 1)); foreach ($tags_all as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true)); } $tags_except_alert = array('reservation.user' => __('Writer'), 'reservation.begin' => __('Start date'), 'reservation.end' => __('End date'), 'reservation.comment' => __('Comments'), 'reservation.item.entity' => __('Entity'), 'reservation.item.name' => __('Associated item'), 'reservation.item.tech' => __('Technician in charge of the hardware')); foreach ($tags_except_alert as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'events' => array('new', 'update', 'delete'))); } $this->addTagToList(array('tag' => 'items', 'label' => __('Device list'), 'value' => false, 'foreach' => true, 'events' => array('alert'))); $tag_alert = array('reservation.expirationdate' => __('End date'), 'reservation.entity' => __('Entity')); foreach ($tag_alert as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'events' => array('alert'))); } asort($this->tag_descriptions); } /** * Get item associated with the object on which the event was raised * * @param $event (default '') * * @return the object associated with the itemtype **/ function getObjectItem($event='') { if ($this->obj) { $ri = new ReservationItem(); if ($ri->getFromDB($this->obj->getField('reservationitems_id'))) { $itemtype = $ri->getField('itemtype'); if (($itemtype != NOT_AVAILABLE) && ($itemtype != '') && ($item = getItemForItemtype($itemtype))) { $item->getFromDB($ri->getField('items_id')); $this->target_object = $item; } } } } } ?>glpi-0.84.3+dfsg.1/inc/notificationtargetsoftwarelicense.class.php000066400000000000000000000073331226600447100252300ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // Class NotificationTarget class NotificationTargetSoftwareLicense extends NotificationTarget { function getEvents() { return array('alert' => __('Alarms on expired licenses')); } /** * Get all data needed for template processing * * @param $event * @param $options array **/ function getDatasForTemplate($event, $options=array()) { global $CFG_GLPI; $events = $this->getAllEvents(); $this->datas['##license.action##'] = $events[$event]; $this->datas['##license.entity##'] = Dropdown::getDropdownName('glpi_entities', $options['entities_id']); foreach ($options['licenses'] as $id => $license) { $tmp = array(); $tmp['##license.item##'] = $license['softname']; $tmp['##license.name##'] = $license['name']; $tmp['##license.serial##'] = $license['serial']; $tmp['##license.expirationdate##'] = Html::convDate($license["expire"]); $tmp['##license.url##'] = urldecode($CFG_GLPI["url_base"]. "/index.php?redirect=softwarelicense_".$id); $this->datas['licenses'][] = $tmp; } $this->getTags(); foreach ($this->tag_descriptions[NotificationTarget::TAG_LANGUAGE] as $tag => $values) { if (!isset($this->datas[$tag])) { $this->datas[$tag] = $values['label']; } } } function getTags() { $tags = array('license.expirationdate' => __('Expiration date'), 'license.item' => _n('Software', 'Software', 1), 'license.name' => __('Name'), 'license.serial' => __('Serial number'), 'license.entity' => __('Entity'), 'license.url' => __('URL'), 'license.action' => _n('Event', 'Events', 1)); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true)); } $this->addTagToList(array('tag' => 'licenses', 'label' => __('Device list'), 'value' => false, 'foreach' => true)); asort($this->tag_descriptions); } } ?>glpi-0.84.3+dfsg.1/inc/notificationtargetticket.class.php000066400000000000000000001112271226600447100233140ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // Class NotificationTarget class NotificationTargetTicket extends NotificationTargetCommonITILObject { var $private_profiles = array(); public $html_tags = array('##ticket.solution.description##'); /** * @param $entity (default '') * @param $event (default '') * @param $object (default null) * @param $options array */ function __construct($entity='', $event='', $object=null, $options=array()) { parent::__construct($entity, $event, $object, $options); $this->options['sendprivate'] = false; if (isset($options['followup_id'])) { $this->options['sendprivate'] = $options['is_private']; } if (isset($options['task_id'])) { $this->options['sendprivate'] = $options['is_private']; } } /** * @see NotificationTarget::validateSendTo() **/ function validateSendTo($event, array $infos, $notify_me=false) { // Always send notification for satisfaction : if send on ticket closure if ($event != 'satisfaction') { // Check global ones for notification to myself if (!parent::validateSendTo($event, $infos, $notify_me)) { return false; } // Private object and no right to see private items : do not send if ($this->isPrivate() && (!isset($infos['additionnaloption']['show_private']) || !$infos['additionnaloption']['show_private'])) { return false; } } return true; } /** * @param $event (default '') **/ function getSubjectPrefix($event='') { if ($event !='alertnotclosed') { $perso_tag = trim(Entity::getUsedConfig('notification_subject_tag', $this->getEntity(), '', '')); if (empty($perso_tag)) { $perso_tag = 'GLPI'; } return sprintf("[$perso_tag #%07d] ", $this->obj->getField('id')); } return parent::getSubjectPrefix(); } /** * @since version 0.84 * * @return string **/ function getMessageID() { return "GLPI-".$this->obj->getField('id').".".time().".".rand(). "@".php_uname('n'); } function addAdditionnalInfosForTarget() { global $DB; $query = "SELECT `id` FROM `glpi_profiles` WHERE `glpi_profiles`.`show_full_ticket` = '1'"; foreach ($DB->request($query) as $data) { $this->private_profiles[$data['id']] = $data['id']; } } /** * Get item associated with the object on which the event was raised * * @param $event (default '') * * @return the object associated with the itemtype **/ function getObjectItem($event='') { if ($this->obj) { $itemtype = $this->obj->getField('itemtype'); if (($itemtype != NOT_AVAILABLE) && ($itemtype != '') && ($item = getItemForItemtype($itemtype))) { $item->getFromDB($this->obj->getField('items_id')); $this->target_object = $item; } } } /** * @param $data array **/ function addAdditionnalUserInfo(array $data) { global $DB; if (!isset($data['users_id'])) { return array('show_private' => 0); } $query = "SELECT COUNT(*) AS cpt FROM `glpi_profiles_users` WHERE `users_id`='".$data['users_id']."' ". getEntitiesRestrictRequest("AND", "glpi_profiles_users", "entities_id", $this->getEntity(), true)." AND profiles_id IN (".implode(',',$this->private_profiles).")"; $result = $DB->query($query); if ($DB->result($result,0,'cpt')) { return array('show_private' => 1); } return array('show_private' => 0); } /** *Get events related to tickets **/ function getEvents() { $events = array('new' => __('New ticket'), 'update' => __('Update of a ticket'), 'solved' => __('Ticket solved'), 'validation' => __('Validation request'), 'validation_answer' => __('Validation request answer'), 'add_followup' => __("New followup"), 'update_followup' => __('Update of a followup'), 'delete_followup' => __('Deletion of a followup'), 'add_task' => __('New task'), 'update_task' => __('Update of a task'), 'delete_task' => __('Deletion of a task'), 'closed' => __('Closing of the ticket'), 'delete' => __('Deletion of a ticket'), 'alertnotclosed' => __('Not solved tickets'), 'recall' => __('Automatic reminders of SLAs'), 'satisfaction' => __('Satisfaction survey')); asort($events); return $events; } /** * Restrict by profile and by config * to avoid send notification to a user without rights **/ function getProfileJoinSql() { $query = " INNER JOIN `glpi_profiles_users` ON (`glpi_profiles_users`.`users_id` = `glpi_users`.`id` ". getEntitiesRestrictRequest("AND", "glpi_profiles_users", "entities_id", $this->getEntity(), true).")"; if ($this->isPrivate()) { $query .= " INNER JOIN `glpi_profiles` ON (`glpi_profiles`.`id` = `glpi_profiles_users`.`profiles_id` AND `glpi_profiles`.`interface` = 'central' AND `glpi_profiles`.`show_full_ticket` = '1') "; } return $query; } function isPrivate() { if (isset($this->options['sendprivate']) && ($this->options['sendprivate'] == 1)) { return true; } return false; } /** * @see NotificationTargetCommonITILObject::getDatasForObject() **/ function getDatasForObject(CommonDBTM $item, array $options, $simple=false) { global $CFG_GLPI, $DB; // Common ITIL datas $datas = parent::getDatasForObject($item, $options, $simple); // Specific datas $costs = TicketCost::getCostsSummary($item->getField("id")); $datas["##ticket.costfixed##"] = $costs['costfixed']; $datas["##ticket.costmaterial##"] = $costs['costmaterial']; $datas["##ticket.costtime##"] = $costs['costtime']; $datas["##ticket.totalcost##"] = $costs['totalcost']; $datas['##ticket.urlvalidation##'] = $this->formatURL($options['additionnaloption']['usertype'], "ticket_".$item->getField("id")."_TicketValidation$1"); $datas['##ticket.globalvalidation##'] = TicketValidation::getStatus($item->getField('global_validation')); $datas['##ticket.type##'] = Ticket::getTicketTypeName($item->getField('type')); $datas['##ticket.requesttype##'] = Dropdown::getDropdownName('glpi_requesttypes', $item->getField('requesttypes_id')); $autoclose_value = Entity::getUsedConfig('autoclose_delay', $this->getEntity(), '', Entity::CONFIG_NEVER); $datas['##ticket.autoclose##'] = __('Never'); $datas['##lang.ticket.autoclosewarning##'] = ""; if ($autoclose_value > 0) { $datas['##ticket.autoclose##'] = $autoclose_value; $datas['##lang.ticket.autoclosewarning##'] //TRANS: %s is the number of days before auto closing = sprintf(_n('Without a reply, the ticket will be automatically closed after %s day', 'Without a reply, the ticket will be automatically closed after %s days', $autoclose_value), $autoclose_value); } $datas['##ticket.sla##'] = ''; if ($item->getField('slas_id')) { $datas['##ticket.sla##'] = Dropdown::getDropdownName('glpi_slas', $item->getField('slas_id')); } // is ticket deleted $datas['##ticket.isdeleted##'] = Dropdown::getYesNo($item->getField('is_deleted')); //Tags associated with the object linked to the ticket $datas['##ticket.itemtype##'] = ''; $datas['##ticket.item.name##'] = ''; $datas['##ticket.item.serial##'] = ''; $datas['##ticket.item.otherserial##'] = ''; $datas['##ticket.item.location##'] = ''; $datas['##ticket.item.contact'] = ''; $datas['##ticket.item.contactnumber##'] = ''; $datas['##ticket.item.user##'] = ''; $datas['##ticket.item.group##'] = ''; $datas['##ticket.item.model##'] = ''; if (isset($item->fields['itemtype']) && ($hardware = getItemForItemtype($item->fields['itemtype'])) && isset($item->fields["items_id"]) && $hardware->getFromDB($item->fields["items_id"])) { //Object type $datas['##ticket.itemtype##'] = $hardware->getTypeName(); //Object name $datas['##ticket.item.name##'] = $hardware->getField('name'); //Object serial if ($hardware->isField('serial')) { $datas['##ticket.item.serial##'] = $hardware->getField('serial'); } //Object contact if ($hardware->isField('contact')) { $datas['##ticket.item.contact##'] = $hardware->getField('contact'); } //Object contact num if ($hardware->isField('contact_num')) { $datas['##ticket.item.contactnumber##'] = $hardware->getField('contact_num'); } //Object otherserial if ($hardware->isField('otherserial')) { $datas['##ticket.item.otherserial##'] = $hardware->getField('otherserial'); } //Object location if ($hardware->isField('locations_id')) { $datas['##ticket.item.location##'] = Dropdown::getDropdownName('glpi_locations', $hardware->getField('locations_id')); } //Object user if ($hardware->getField('users_id')) { $user_tmp = new User(); if ($user_tmp->getFromDB($hardware->getField('users_id'))) { $datas['##ticket.item.user##'] = $user_tmp->getName(); } } //Object group if ($hardware->getField('groups_id')) { $datas['##ticket.item.group##'] = Dropdown::getDropdownName('glpi_groups', $hardware->getField('groups_id')); } $modeltable = getSingular($hardware->getTable())."models"; $modelfield = getForeignKeyFieldForTable($modeltable); if ($hardware->isField($modelfield)) { $datas['##ticket.item.model##'] = Dropdown::getDropdownName($modeltable, $hardware->getField($modelfield)); } } // Get tasks, followups, log, validation, satisfaction, linked tickets if (!$simple) { // Linked tickets $linked_tickets = Ticket_Ticket::getLinkedTicketsTo($item->getField('id')); $datas['linkedtickets'] = array(); if (count($linked_tickets)) { $linkedticket = new Ticket(); foreach ($linked_tickets as $data) { if ($linkedticket->getFromDB($data['tickets_id'])) { $tmp = array(); $tmp['##linkedticket.id##'] = $data['tickets_id']; $tmp['##linkedticket.link##'] = Ticket_Ticket::getLinkName($data['link']); $tmp['##linkedticket.url##'] = $this->formatURL($options['additionnaloption']['usertype'], "ticket_".$data['tickets_id']); $tmp['##linkedticket.title##'] = $linkedticket->getField('name'); $tmp['##linkedticket.content##'] = $linkedticket->getField('content'); $datas['linkedtickets'][] = $tmp; } } } $datas['##ticket.numberoflinkedtickets##'] = count($datas['linkedtickets']); $restrict = "`tickets_id`='".$item->getField('id')."'"; $problems = getAllDatasFromTable('glpi_problems_tickets',$restrict); $datas['problems'] = array(); if (count($problems)) { $problem = new Problem(); foreach ($problems as $data) { if ($problem->getFromDB($data['problems_id'])) { $tmp = array(); $tmp['##problem.id##'] = $data['problems_id']; $tmp['##problem.date##'] = $problem->getField('date'); $tmp['##problem.title##'] = $problem->getField('name'); $tmp['##problem.url##'] = $this->formatURL($options['additionnaloption']['usertype'], "problem_".$data['problems_id']); $tmp['##problem.content##'] = $problem->getField('content'); $datas['problems'][] = $tmp; } } } $datas['##ticket.numberofproblems##'] = count($datas['problems']); $restrict = "`tickets_id`='".$item->getField('id')."'"; if (!isset($options['additionnaloption']['show_private']) || !$options['additionnaloption']['show_private']) { $restrict .= " AND `is_private` = '0'"; } $restrict .= " ORDER BY `date` DESC, `id` ASC"; //Task infos $tasks = getAllDatasFromTable('glpi_tickettasks',$restrict); $datas['tasks'] = array(); foreach ($tasks as $task) { $tmp = array(); $tmp['##task.isprivate##'] = Dropdown::getYesNo($task['is_private']); $tmp['##task.author##'] = Html::clean(getUserName($task['users_id'])); $tmp['##task.category##'] = Dropdown::getDropdownName('glpi_taskcategories', $task['taskcategories_id']); $tmp['##task.date##'] = Html::convDateTime($task['date']); $tmp['##task.description##'] = $task['content']; $tmp['##task.time##'] = Ticket::getActionTime($task['actiontime']); $tmp['##task.status##'] = Planning::getState($task['state']); $tmp['##task.user##'] = ""; $tmp['##task.begin##'] = ""; $tmp['##task.end##'] = ""; if (!is_null($task['begin'])) { $tmp['##task.user##'] = Html::clean(getUserName($task['users_id_tech'])); $tmp['##task.begin##'] = Html::convDateTime($task['begin']); $tmp['##task.end##'] = Html::convDateTime($task['end']); } $datas['tasks'][] = $tmp; } $datas['##ticket.numberoftasks##'] = count($datas['tasks']); //Followup infos $followups = getAllDatasFromTable('glpi_ticketfollowups',$restrict); $datas['followups'] = array(); foreach ($followups as $followup) { $tmp = array(); $tmp['##followup.isprivate##'] = Dropdown::getYesNo($followup['is_private']); $tmp['##followup.author##'] = Html::clean(getUserName($followup['users_id'])); $tmp['##followup.requesttype##'] = Dropdown::getDropdownName('glpi_requesttypes', $followup['requesttypes_id']); $tmp['##followup.date##'] = Html::convDateTime($followup['date']); $tmp['##followup.description##'] = $followup['content']; $datas['followups'][] = $tmp; } $datas['##ticket.numberoffollowups##'] = count($datas['followups']); //Validation infos $restrict = "`tickets_id`='".$item->getField('id')."'"; if (isset($options['validation_id']) && $options['validation_id']) { $restrict .= " AND `glpi_ticketvalidations`.`id` = '".$options['validation_id']."'"; } $restrict .= " ORDER BY `submission_date` DESC, `id` ASC"; $validations = getAllDatasFromTable('glpi_ticketvalidations',$restrict); $datas['validations'] = array(); foreach ($validations as $validation) { $tmp = array(); $tmp['##validation.submission.title##'] //TRANS: %s is the user name = sprintf(__('An approval request has been submitted by %s'), Html::clean(getUserName($validation['users_id']))); $tmp['##validation.answer.title##'] //TRANS: %s is the user name = sprintf(__('An answer to an an approval request was produced by %s'), Html::clean(getUserName($validation['users_id_validate']))); $tmp['##validation.author##'] = Html::clean(getUserName($validation['users_id'])); $tmp['##validation.status##'] = TicketValidation::getStatus($validation['status']); $tmp['##validation.storestatus##'] = $validation['status']; $tmp['##validation.submissiondate##'] = Html::convDateTime($validation['submission_date']); $tmp['##validation.commentsubmission##'] = $validation['comment_submission']; $tmp['##validation.validationdate##'] = Html::convDateTime($validation['validation_date']); $tmp['##validation.validator##'] = Html::clean(getUserName($validation['users_id_validate'])); $tmp['##validation.commentvalidation##'] = $validation['comment_validation']; $datas['validations'][] = $tmp; } // Ticket Satisfaction $inquest = new TicketSatisfaction(); $datas['##satisfaction.type##'] = ''; $datas['##satisfaction.datebegin##'] = ''; $datas['##satisfaction.dateanswered##'] = ''; $datas['##satisfaction.satisfaction##'] = ''; $datas['##satisfaction.description##'] = ''; if ($inquest->getFromDB($item->getField('id'))) { // internal inquest if ($inquest->fields['type'] == 1) { $datas['##ticket.urlsatisfaction##'] = $this->formatURL($options['additionnaloption']['usertype'], "ticket_".$item->getField("id").'_Ticket$3'); // external inquest } else if ($inquest->fields['type'] == 2) { $datas['##ticket.urlsatisfaction##'] = Entity::generateLinkSatisfaction($item); } $datas['##satisfaction.type##'] = $inquest->getTypeInquestName($inquest->getfield('type')); $datas['##satisfaction.datebegin##'] = Html::convDateTime($inquest->fields['date_begin']); $datas['##satisfaction.dateanswered##'] = Html::convDateTime($inquest->fields['date_answered']); $datas['##satisfaction.satisfaction##'] = $inquest->fields['satisfaction']; $datas['##satisfaction.description##'] = $inquest->fields['comment']; } //costs infos $restrict = "`tickets_id`='".$item->getField('id')."'"; $restrict .= " ORDER BY `begin_date` DESC, `id` ASC"; $costs = getAllDatasFromTable('glpi_ticketcosts',$restrict); $datas['costs'] = array(); foreach ($costs as $cost) { $tmp = array(); $tmp['##cost.name##'] = $cost['name']; $tmp['##cost.comment##'] = $cost['comment']; $tmp['##cost.datebegin##'] = Html::convDate($cost['begin_date']); $tmp['##cost.dateend##'] = Html::convDate($cost['end_date']); $tmp['##cost.time##'] = $item->getActionTime($cost['actiontime']); $tmp['##cost.costtime##'] = Html::formatNumber($cost['cost_time']); $tmp['##cost.costfixed##'] = Html::formatNumber($cost['cost_fixed']); $tmp['##cost.costmaterial##'] = Html::formatNumber($cost['cost_material']); $tmp['##cost.totalcost##'] = TicketCost::computeTotalCost($cost['actiontime'], $cost['cost_time'], $cost['cost_fixed'], $cost['cost_material']); $tmp['##cost.budget##'] = Dropdown::getDropdownName('glpi_budgets', $cost['budgets_id']); $datas['costs'][] = $tmp; } } return $datas; } static function isAuthorMailingActivatedForHelpdesk() { global $DB,$CFG_GLPI; if ($CFG_GLPI['use_mailing']) { $query = "SELECT COUNT(`glpi_notifications`.`id`) FROM `glpi_notifications` INNER JOIN `glpi_notificationtargets` ON (`glpi_notifications`.`id` = `glpi_notificationtargets`.`notifications_id`) WHERE `glpi_notifications`.`itemtype` = 'Ticket' AND `glpi_notifications`.`mode` = 'mail' AND `glpi_notificationtargets`.`type` = '".Notification::USER_TYPE."' AND `glpi_notificationtargets`.`items_id` = '".Notification::AUTHOR."'"; if ($result = $DB->query($query)) { if ($DB->result($result,0,0) > 0) { return true; } } } return false; } function getTags() { parent::getTags(); //Locales $tags = array('ticket.type' => __('Type'), 'ticket.sla' => __('SLA'), 'ticket.requesttype' => __('Request source'), 'ticket.itemtype' => __('Item type'), 'ticket.item.name' => __('Associated item'), 'ticket.item.serial' => __('Serial number'), 'ticket.item.otherserial' => __('Inventory number'), 'ticket.item.location' => __('Location'), 'ticket.item.model' => __('Model'), 'ticket.item.contact' => __('Alternate username'), 'ticket.item.contactnumber' => __('Alternate username number'), 'ticket.item.user' => __('User'), 'ticket.item.group' => __('Group'), 'ticket.costtime' => __('Time cost'), 'ticket.costfixed' => __('Fixed cost'), 'ticket.costmaterial' => __('Material cost'), 'ticket.totalcost' => __('Total cost'), 'ticket.isdeleted' => __('Deleted'), 'task.author' => __('Writer'), 'task.isprivate' => __('Private'), 'task.date' => __('Opening date'), 'task.description' => __('Description'), 'task.category' => __('Category'), 'task.time' => __('Total duration'), 'task.user' => __('By'), 'task.begin' => __('Start date'), 'task.end' => __('End date'), 'task.status' => __('Status'), 'followup.date' => __('Opening date'), 'followup.isprivate' => __('Private'), 'followup.author' => __('Writer'), 'followup.description' => __('Description'), 'followup.requesttype' => __('Request source'), 'ticket.numberoffollowups' => __('Number of followups'), 'ticket.numberoftasks' => _x('quantity', 'Number of tasks'), 'ticket.numberoflinkedtickets' => __('Number of linked tickets'), 'ticket.numberofproblems' => __('Number of problems'), 'ticket.autoclose' => __('Automatic closing of solved tickets after'), 'ticket.globalvalidation' => __('Global approval status'), 'cost.name' => sprintf(__('%1$s: %2$s'), __('Cost'), __('Name')), 'cost.comment' => sprintf(__('%1$s: %2$s'), __('Cost'), __('Comments')), 'cost.datebegin' => sprintf(__('%1$s: %2$s'), __('Cost'), __('Begin date')), 'cost.dateend' => sprintf(__('%1$s: %2$s'), __('Cost'), __('End date')), 'cost.time' => sprintf(__('%1$s: %2$s'), __('Cost'), __('Duration')), 'cost.costtime' => sprintf(__('%1$s: %2$s'), __('Cost'), __('Time cost')), 'cost.costfixed' => sprintf(__('%1$s: %2$s'), __('Cost'), __('Fixed cost')), 'cost.costmaterial' => sprintf(__('%1$s: %2$s'), __('Cost'), __('Material cost')), 'cost.totalcost' => sprintf(__('%1$s: %2$s'), __('Cost'), __('Total cost')), 'cost.budget' => sprintf(__('%1$s: %2$s'), __('Cost'), __('Budget')), ); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'events' => NotificationTarget::TAG_FOR_ALL_EVENTS)); } //Events specific for validation $tags = array('validation.author' => __('Requester'), 'validation.status' => __('Status of the approval request'), 'validation.submissiondate' => sprintf(__('%1$s: %2$s'), __('Request'), __('Date')), 'validation.commentsubmission' => sprintf(__('%1$s: %2$s'), __('Request'), __('Comments')), 'validation.validationdate' => sprintf(__('%1$s: %2$s'), __('Validation'), __('Date')), 'validation.validator' => __('Decision-maker'), 'validation.commentvalidation' => sprintf(__('%1$s: %2$s'), __('Validation'), __('Comments')) ); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'events' => array('validation', 'validation_answer'))); } //Tags without lang for validation $tags = array('validation.submission.title' => __('A validation request has been submitted'), 'validation.answer.title' => __('An answer to a validation request was produced') ); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'lang' => false, 'events' => array('validation', 'validation_answer'))); } // Events for ticket satisfaction $tags = array('satisfaction.datebegin' => __('Creation date of the satisfaction survey'), 'satisfaction.dateanswered' => __('Response date to the satisfaction survey'), 'satisfaction.satisfaction' => __('Satisfaction'), 'satisfaction.description' => __('Comments to the satisfaction survey')); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'events' => array('satisfaction'))); } $tags = array('satisfaction.type' => __('Survey type'),); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'lang' => false, 'events' => array('satisfaction'))); } $tags = array('satisfaction.text' => __('Invitation to fill out the survey')); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => false, 'lang' => true, 'events' => array('satisfaction'))); } //Foreach global tags $tags = array('followups' => _n('Followup', 'Followups', 2), 'tasks' => _n('Task', 'Tasks', 2), 'costs' => _n('Cost', 'Costs', 2), 'validations' => _n('Validation','Validations',2), 'linkedtickets' => _n('Linked ticket', 'Linked tickets', 2), 'problems' => _n('Problem', 'Problems', 2)); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => false, 'foreach' => true)); } //Tags with just lang $tags = array('ticket.linkedtickets' => _n('Linked ticket', 'Linked tickets', 2), 'ticket.problems' => _n('Problem', 'Problems', 2), 'ticket.autoclosewarning' => sprintf(_n('Without a reply, the ticket will be automatically closed after %s day', 'Without a reply, the ticket will be automatically closed after %s days', 2), '?')); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => false, 'lang' => true)); } //Foreach tag for alertnotclosed $this->addTagToList(array('tag' => 'tickets', 'label' => __('Not solved tickets'), 'value' => false, 'foreach' => true, 'events' => array('alertnotclosed'))); //Tags without lang $tags = array('ticket.urlvalidation' => sprintf(__('%1$s: %2$s'), __('Validation request'), __('URL')), 'ticket.urlsatisfaction' => sprintf(__('%1$s: %2$s'), __('Satisfaction'), __('URL')), 'linkedticket.id' => sprintf(__('%1$s: %2$s'), _n('Linked ticket', 'Linked tickets', 1), __('ID')), 'linkedticket.link' => sprintf(__('%1$s: %2$s'), _n('Linked ticket', 'Linked tickets', 1), __('Link')), 'linkedticket.url' => sprintf(__('%1$s: %2$s'), _n('Linked ticket', 'Linked tickets', 1), __('URL')), 'linkedticket.title' => sprintf(__('%1$s: %2$s'), _n('Linked ticket', 'Linked tickets', 1), __('Title')), 'linkedticket.content' => sprintf(__('%1$s: %2$s'), _n('Linked ticket', 'Linked tickets', 1), __('Description')), 'problem.id' => sprintf(__('%1$s: %2$s'), __('Problem'), __('ID')), 'problem.date' => sprintf(__('%1$s: %2$s'), __('Problem'), __('Date')), 'problem.url' => sprintf(__('%1$s: %2$s'), __('Problem'), ('URL')), 'problem.title' => sprintf(__('%1$s: %2$s'), __('Problem'), __('Title')), 'problem.content' => sprintf(__('%1$s: %2$s'), __('Problem'), __('Description')) ); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'lang' => false)); } //Tickets with a fixed set of values $allowed_validation = array(); $status = TicketValidation::getAllStatusArray(false,true); foreach ($status as $key => $value) { $allowed_validation[] = $key; } $tags = array('validation.validationstatus' => array('text' => __('Status value in database'), 'allowed_values' => $allowed_validation)); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label['text'], 'value' => true, 'lang' => false, 'allowed_values' => $label['allowed_values'])); } asort($this->tag_descriptions); } } ?> glpi-0.84.3+dfsg.1/inc/notificationtargetuser.class.php000066400000000000000000000116631226600447100230120ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // Class NotificationTarget class NotificationTargetUser extends NotificationTarget { function getEvents() { return array('passwordforget' => __('Forgotten password?')); } /** * @see NotificationTarget::getNotificationTargets() **/ function getNotificationTargets($entity) { $this->addTarget(Notification::USER, __('User')); } /** * @see NotificationTarget::getSpecificTargets() **/ function getSpecificTargets($data,$options) { //Look for all targets whose type is Notification::ITEM_USER switch ($data['type']) { case Notification::USER_TYPE : switch ($data['items_id']) { case Notification::USER : $usertype = self::GLPI_USER; if ($this->obj->fields['authtype'] != Auth::DB_GLPI) { $usertype = self::EXTERNAL_USER; } // Send to user without any check on profile / entity // Do not set users_id $data = array('name' => $this->obj->getName(), 'email' => $this->obj->getDefaultEmail(), 'language' => $this->obj->getField('language'), 'usertype' => $usertype); $this->addToAddressesList($data); } } } /** * Get all data needed for template processing * * @param $event * @param $options array **/ function getDatasForTemplate($event, $options=array()) { global $CFG_GLPI; $events = $this->getEvents(); $this->datas['##user.name##'] = $this->obj->getField("name"); $this->datas['##user.realname##'] = $this->obj->getField("realname"); $this->datas['##user.firstname##'] = $this->obj->getField("firstname"); $this->datas['##user.token##'] = $this->obj->getField("password_forget_token"); $this->datas['##user.action##'] = $events[$event]; $this->datas['##user.passwordforgeturl##'] = urldecode($CFG_GLPI["url_base"]. "/front/lostpassword.php?password_forget_token=". $this->obj->getField("password_forget_token")); $this->getTags(); foreach ($this->tag_descriptions[NotificationTarget::TAG_LANGUAGE] as $tag => $values) { if (!isset($this->datas[$tag])) { $this->datas[$tag] = $values['label']; } } } function getTags() { $tags = array('user.name' => __('Login'), 'user.realname' => __('Name'), 'user.firstname' => __('First name'), 'user.token' => __('Token'), 'user.passwordforgeturl' => __('URL'), 'user.action' => _n('Event', 'Events', 1)); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true)); } // Only lang $lang = array('passwordforget.information' => __('You have been made a request to reset your account password.'), 'passwordforget.link' => __('Just follow this link (you have one day):')); foreach ($lang as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => false, 'lang' => true)); } asort($this->tag_descriptions); return $this->tag_descriptions; } } ?>glpi-0.84.3+dfsg.1/inc/notificationtemplate.class.php000066400000000000000000000401211226600447100224270ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // Class Notification class NotificationTemplate extends CommonDBTM { // From CommonDBTM public $dohistory = true; //Signature to add to the template public $signature = ''; //Store templates for each language public $templates_by_languages = array(); static function getTypeName($nb=0) { return _n('Notification template', 'Notification templates', $nb); } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('NotificationTemplateTranslation', $ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } static function canCreate() { return Session::haveRight('config', 'w'); } static function canView() { return Session::haveRight('config', 'r'); } /** * Reset already computed templates **/ function resetComputedTemplates() { $this->templates_by_languages = array(); } function showForm($ID, $options=array()) { global $CFG_GLPI; if (!Session::haveRight("config", "w")) { return false; } $spotted = false; if (empty($ID)) { if ($this->getEmpty()) { $spotted = true; } } else { if ($this->getFromDB($ID)) { $spotted = true; } } $this->showTabs($options); $this->showFormHeader($options); echo "" . __('Name') . ""; echo ""; Html::autocompletionTextField($this, "name"); echo ""; echo "" . __('Type') . ""; Dropdown::showItemTypes('itemtype', $CFG_GLPI["notificationtemplates_types"], array('value' => ($this->fields['itemtype'] ?$this->fields['itemtype'] :'Ticket'))); echo ""; echo "".__('Comments').""; echo ""; echo ""; echo ""; echo "".__('CSS').""; echo ""; echo ""; $this->showFormButtons($options); $this->addDivForTabs(); return true; } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'itemtype'; $tab[4]['name'] = __('Type'); $tab[4]['datatype'] = 'itemtypename'; $tab[4]['itemtype_list'] = 'notificationtemplates_types'; $tab[4]['massiveaction'] = false; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; return $tab; } /** * Display templates available for an itemtype * * @param $name the dropdown name * @param $itemtype display templates for this itemtype only * @param $value the dropdown's default value (0 by default) **/ static function dropdownTemplates($name, $itemtype, $value=0) { global $DB; self::dropdown(array('name' => $name, 'value' => $value, 'comment' => 1, 'condition' => "`itemtype`='$itemtype'")); } /** * @param $options **/ function getAdditionnalProcessOption($options) { //Additionnal option can be given for template processing //For the moment, only option to see private tasks & followups is available if (!empty($options) && isset($options['sendprivate'])) { return 1; } return 0; } /** * @param $target NotificationTarget object * @param $user_infos array * @param $event * @param $options array * * @return id of the template in templates_by_languages / false if computation failed **/ function getTemplateByLanguage(NotificationTarget $target, $user_infos=array(), $event, $options=array()) { $lang = array(); $language = $user_infos['language']; if (isset($user_infos['additionnaloption'])) { $additionnaloption = $user_infos['additionnaloption']; } else { $additionnaloption = array(); } $tid = $language; $tid .= serialize($additionnaloption); $tid = sha1($tid); if (!isset($this->templates_by_languages[$tid])) { //Switch to the desired language $start = microtime(true); Session::loadLanguage($language); //If event is raised by a plugin, load it in order to get the language file available if ($plug = isPluginItemType(get_class($target->obj))) { Plugin::loadLang(strtolower($plug['plugin']),$language); } //Get template's language data for in this language $options['additionnaloption'] = $additionnaloption; $data = &$target->getForTemplate($event,$options); $footer_string = sprintf(__('Automatically generated by GLPI %s'), GLPI_VERSION); //Restore default language Session::loadLanguage(); if ($plug = isPluginItemType(get_class($target->obj))) { Plugin::loadLang(strtolower($plug['plugin'])); } if ($template_datas = $this->getByLanguage($language)) { //Template processing // Decode html chars to have clean text $template_datas['content_text'] = Html::entity_decode_deep($template_datas['content_text']); $save_data = $data; $data = Html::entity_decode_deep($data); $template_datas['subject'] = Html::entity_decode_deep($template_datas['subject']); $this->signature = Html::entity_decode_deep($this->signature); $lang['subject'] = $target->getSubjectPrefix($event) . self::process($template_datas['subject'], $data); $lang['content_html'] = ''; //If no html content, then send only in text if (!empty($template_datas['content_html'])) { // Encode in HTML all chars $data_html = Html::entities_deep($data); $data_html = Html::nl2br_deep($data_html); // Restore HTML tags if (count($target->html_tags)) { foreach ($target->html_tags as $tag) { if (isset($save_data[$tag])) { $data_html[$tag] = $save_data[$tag]; } } } $signature_html = Html::entities_deep($this->signature); $signature_html = Html::nl2br_deep($signature_html); $lang['content_html'] = "". " ".Html::entities_deep($lang['subject'])." ".self::process($template_datas['content_html'], $data_html). "

    -- \n
    ".$signature_html. //TRANS %s is the GLPI version "
    $footer_string"; } $lang['content_text'] = Html::clean(self::process($template_datas['content_text'], $data)."\n\n-- \n".$this->signature. "\n".sprintf(__('Automatically generated by GLPI %s'), GLPI_VERSION)); $this->templates_by_languages[$tid] = $lang; } } if (isset($this->templates_by_languages[$tid])) { return $tid; } return false; } /** * @param $string * @param $data **/ static function process($string, $data) { $offset = $new_offset = 0; //Template processed $output = ""; // clean data for strtr foreach ($data as $field=>$value) { if (!is_array($value)) { $cleandata[$field] = $value; } } //Remove all $string = Toolbox::unclean_cross_side_scripting_deep($string); //First of all process the FOREACH tag if (preg_match_all("/##FOREACH[ ]?(FIRST|LAST)?[ ]?([0-9]*)?[ ]?([a-zA-Z-0-9\.]*)##/i", $string, $out)) { foreach ($out[3] as $id => $tag_infos) { $regex = "/".$out[0][$id]."(.*)##ENDFOREACH".$tag_infos."##/Uis"; if (preg_match($regex,$string,$tag_out) && isset($data[$tag_infos]) && is_array($data[$tag_infos])) { $data_lang_foreach = $cleandata; unset($data_lang_foreach[$tag_infos]); //Manage FIRST & LAST statement $foreachvalues = $data[$tag_infos]; if (!empty($foreachvalues)) { if (isset($out[1][$id]) && ($out[1][$id] != '')) { if ($out[1][$id] == 'FIRST') { $foreachvalues = array_reverse($foreachvalues); } if (isset($out[2][$id]) && $out[2][$id]) { $foreachvalues = array_slice($foreachvalues,0,$out[2][$id]); } else { $foreachvalues = array_slice($foreachvalues,0,1); } } } $output_foreach_string = ""; foreach ($foreachvalues as $line) { foreach ($line as $field => $value) { if (!is_array($value)) { $data_lang_foreach[$field] = $value; } } $tmp = self::processIf($tag_out[1], $data_lang_foreach); $output_foreach_string .= strtr($tmp, $data_lang_foreach); } $string = str_replace($tag_out[0],$output_foreach_string, $string); } else { $string = str_replace($tag_out, '', $string); } } } //Now process IF statements $string = self::processIf($string, $cleandata); $string = strtr($string, $cleandata); return $string; } /** * @param $string * @param $data **/ static function processIf($string, $data) { if (preg_match_all("/##IF([a-z\.]*)[=]?(.*?)##/i",$string,$out)) { foreach ($out[1] as $key => $tag_infos) { $if_field = $tag_infos; //Get the field tag value (if one) $regex_if = "/##IF".$if_field."[=]?.*##(.*)##ENDIF".$if_field."##/Uis"; //Get the else tag value (if one) $regex_else = "/##ELSE".$if_field."[=]?.*##(.*)##ENDELSE".$if_field."##/Uis"; if (empty($out[2][$key]) && !strlen($out[2][$key]) ) { // No = : check if ot empty or not null if (isset($data['##'.$if_field.'##']) && $data['##'.$if_field.'##'] != '0' && $data['##'.$if_field.'##'] != '' && $data['##'.$if_field.'##'] != ' ' && !is_null($data['##'.$if_field.'##'])) { $condition_ok = true; } else { $condition_ok = false; } } else { // check exact match if (isset($data['##'.$if_field.'##']) && (Html::entity_decode_deep($data['##'.$if_field.'##']) == Html::entity_decode_deep($out[2][$key]))) { $condition_ok = true; } else { $condition_ok = false; } } // Force only one replacement to permit multiple use of the same condition if ($condition_ok) { // Do IF $string = preg_replace($regex_if, "\\1", $string,1); $string = preg_replace($regex_else, "", $string,1); } else { // Do ELSE $string = preg_replace($regex_if, "", $string,1); $string = preg_replace($regex_else, "\\1", $string,1); } } } return $string; } /** * @param $signature **/ function setSignature($signature) { $this->signature = $signature; } /** * @param $language **/ function getByLanguage($language) { global $DB; $query = "SELECT * FROM `glpi_notificationtemplatetranslations` WHERE `notificationtemplates_id` = '".$this->getField('id')."' AND `language` IN ('$language','') ORDER BY `language` DESC LIMIT 1"; $iterator = $DB->request($query); if ($iterator->numrows()) { return $iterator->next(); } //No template found at all! return false; } /** * @param $target NotificationTarget object * @param $tid string template computed id * @param $user_infos array * @param $options array **/ function getDataToSend(NotificationTarget $target, $tid, array $user_infos, array $options) { $language = $user_infos['language']; $user_email = $user_infos['email']; $user_name = $user_infos['username']; $sender = $target->getSender($options); $replyto = $target->getReplyTo($options); $mailing_options['to'] = $user_email; $mailing_options['toname'] = $user_name; $mailing_options['from'] = $sender['email']; $mailing_options['fromname'] = $sender['name']; $mailing_options['replyto'] = $replyto['email']; $mailing_options['replytoname'] = $replyto['name']; $mailing_options['messageid'] = $target->getMessageID(); $template_data = $this->templates_by_languages[$tid]; $mailing_options['subject'] = $template_data['subject']; $mailing_options['content_html'] = $template_data['content_html']; $mailing_options['content_text'] = $template_data['content_text']; $mailing_options['items_id'] = $target->obj->getField('id'); return $mailing_options; } } ?> glpi-0.84.3+dfsg.1/inc/notificationtemplatetranslation.class.php000066400000000000000000000401431226600447100247120ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // Class Notification class NotificationTemplateTranslation extends CommonDBChild { // From CommonDBChild static public $itemtype = 'NotificationTemplate'; static public $items_id = 'notificationtemplates_id'; public $dohistory = true; static function getTypeName($nb=0) { return _n('Template translation', 'Template translations', $nb); } /** * @since version 0.84 **/ function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } /** * @see CommonDBTM::getName() **/ function getName($options=array()) { global $CFG_GLPI; if ($this->getField('language') != '') { $toadd = $CFG_GLPI['languages'][$this->getField('language')][0]; } else { $toadd = self::getTypeName(1); } return $toadd; } function defineTabs($options=array()) { $ong = array(); $ong['empty'] = $this->getTypeName(1); // History as single tab seems "strange" $this->addStandardTab('Log', $ong, $options); return $ong; } function showForm($ID, $options) { global $DB, $CFG_GLPI; if (!Session::haveRight("config", "w")) { return false; } $notificationtemplates_id = -1; if (isset($options['notificationtemplates_id'])) { $notificationtemplates_id = $options['notificationtemplates_id']; } if ($this->getFromDB($ID)) { $notificationtemplates_id = $this->getField('notificationtemplates_id'); } $this->initForm($ID, $options); $template = new NotificationTemplate(); $template->getFromDB($notificationtemplates_id); Html::initEditorSystem('content_html'); $this->showTabs($options); $this->showFormHeader($options); echo ""; echo "".NotificationTemplate::getTypeName().""; echo "".$template->getField('name').""; echo "". "getField('itemtype')."' ,'glpipopup', 'height=400, width=1000, top=100, ". "left=100, scrollbars=yes' );w.focus();\">".__('Show list of available tags')."". ""; echo ""; echo "" . __('Language') . ""; //Get all used languages $used = self::getAllUsedLanguages($notificationtemplates_id); if ($ID > 0) { if (isset($used[$this->getField('language')])) { unset($used[$this->getField('language')]); } } Dropdown::showLanguages("language", array('display_emptychoice' => true, 'value' => $this->fields['language'], 'used' => $used)); echo ""; echo "" . __('Subject') . ""; echo ""; echo ""; echo ""; echo ""; _e('Email text body'); echo "
    ".__('(leave the field empty for a generation from HTML)'); echo ""; echo ""; echo ""; echo "" ; _e('Email HTML body'); echo ""; echo ""; echo ""; echo ""; $this->showFormButtons($options); $this->addDivForTabs(); return true; } /** * @param $template NotificationTemplate object * @param $options array **/ function showSummary(NotificationTemplate $template, $options=array()) { global $DB, $CFG_GLPI; $nID = $template->getField('id'); $canedit = Session::haveRight("config", "w"); if ($canedit) { echo "
    "; } echo "
    "; Session::initNavigateListItems('NotificationTemplateTranslation', //TRANS : %1$s is the itemtype name, %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), NotificationTemplate::getTypeName(1), $template->getName())); if ($canedit) { $rand = mt_rand(); Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $paramsma = array(); Html::showMassiveActions(__CLASS__, $paramsma); } echo ""; echo ""; if ($canedit) { echo ""; } echo ""; foreach ($DB->request('glpi_notificationtemplatetranslations', array('notificationtemplates_id' => $nID)) as $data) { if ($this->getFromDB($data['id'])) { Session::addToNavigateListItems('NotificationTemplateTranslation',$data['id']); echo ""; if ($canedit) { echo ""; } echo ""; } } echo "
    "; Html::checkAllAsCheckbox('mass'.__CLASS__.$rand); echo "".__('Language')."
    "; Html::showMassiveActionCheckBox(__CLASS__, $data["id"]); echo ""; echo ""; if ($data['language'] != '') { echo $CFG_GLPI['languages'][$data['language']][0]; } else { _e('Default translation'); } echo "
    "; if ($canedit) { $paramsma['ontop'] = false; Html::showMassiveActions(__CLASS__, $paramsma); Html::closeForm(); } echo "
    "; } /** * @param $input array */ static function cleanContentHtml(array $input) { $txt = Html::clean(Toolbox::unclean_cross_side_scripting_deep($input['content_html'])); $txt = trim(html_entity_decode($txt, 0, 'UTF-8')); if (!$txt) { // No HTML (nothing to display) $input['content_html'] = ''; } else if (!$input['content_text']) { // Use cleaned HTML $input['content_text'] = $txt; } return $input; } function prepareInputForAdd($input) { return parent::prepareInputForAdd(self::cleanContentHtml($input)); } function prepareInputForUpdate($input) { return parent::prepareInputForUpdate(self::cleanContentHtml($input)); } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'language'; $tab[1]['name'] = __('Language'); $tab[1]['datatype'] = 'language'; $tab[1]['massiveaction'] = false; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'subject'; $tab[2]['name'] = __('Subject'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'string'; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'content_html'; $tab[3]['name'] = __('Email HTML body'); $tab[3]['datatype'] = 'text'; $tab[3]['htmltext'] = 'true'; $tab[3]['massiveaction'] = false; $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'content_text'; $tab[4]['name'] = __('Email text body'); $tab[4]['datatype'] = 'text'; $tab[4]['massiveaction'] = false; return $tab; } /** * @param $language_id **/ static function getAllUsedLanguages($language_id) { $used_languages = getAllDatasFromTable('glpi_notificationtemplatetranslations', 'notificationtemplates_id='.$language_id); $used = array(); foreach ($used_languages as $used_language) { $used[$used_language['language']] = $used_language['language']; } return $used; } /** * @param $itemtype **/ static function showAvailableTags($itemtype) { $target = NotificationTarget::getInstanceByType($itemtype); $target->getTags(); echo "
    "; echo ""; echo ""; $tags = array(); foreach ($target->tag_descriptions as $tag_type => $infos) { foreach ($infos as $key => $val) { $infos[$key]['type'] = $tag_type; } $tags = array_merge($tags,$infos); } ksort($tags); foreach ($tags as $tag => $values) { if ($values['events'] == NotificationTarget::TAG_FOR_ALL_EVENTS) { $event = __('All'); } else { $event = implode(', ',$values['events']); } $action = ''; if ($values['foreach']) { $action = __('List of values'); } else { $action = __('Single value'); } if (!empty($values['allowed_values'])) { $allowed_values = implode(',',$values['allowed_values']); } else { $allowed_values = ''; } echo "". "". "". "". ""; } echo "
    ".__('Tag')." ".__('Label')." "._n('Event', 'Events', 1)." ".__('Type')." ".__('Possible values')."
    ".$tag.""; if ($values['type'] == NotificationTarget::TAG_LANGUAGE) { printf(__('%1$s: %2$s'), __('Label'), $values['label']); } else { echo $values['label']; } echo "".$event."".$action."".$allowed_values."
    "; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { switch ($item->getType()) { case 'NotificationTemplate' : if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(self::getTypeName(2), countElementsInTable($this->getTable(), "notificationtemplates_id = '".$item->getID()."'")); } return self::getTypeName(2); } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType() == 'NotificationTemplate') { $temp = new self(); $temp->showSummary($item); } return true; } /** * Display debug information for current object * NotificationTemplateTranslation => translation preview * * @since version 0.84 **/ function showDebug() { $template = new NotificationTemplate(); if (!$template->getFromDB($this->fields['notificationtemplates_id'])) { return; } $itemtype = $template->getField('itemtype'); if (!($item = getItemForItemtype($itemtype))) { return; } echo "
    "; echo ""; echo ""; $oktypes = array('CartridgeItem', 'ConsumableItem', 'Contract', 'Crontask', 'Problem', 'Ticket', 'User'); if (!in_array($itemtype, $oktypes)) { // this itemtype doesn't work, need to be fixed echo ""; echo "
    ".__('Preview')."
    ".NOT_AVAILABLE."
    "; return; } // Criteria Form $key = getForeignKeyFieldForItemType($item->getType()); $id = Session::getSavedOption(__CLASS__, $key, 0); $event = Session::getSavedOption(__CLASS__, $key.'_event', ''); echo "".$item->getTypeName(1)." "; $item->dropdown(array('value' => $id, 'on_change' => 'reloadTab("'.$key.'="+this.value)')); echo "".NotificationEvent::getTypeName(1)." "; NotificationEvent::dropdownEvents($item->getType(), array('value' => $event, 'on_change' => 'reloadTab("'.$key.'_event="+this.value)')); echo ""; // Preview if ($event && $item->getFromDB($id)) { $options = array('_debug' => true); // TODO Awfull Hack waiting for https://forge.indepnet.net/issues/3439 $multi = array('alert', 'alertnotclosed', 'end', 'notice', 'periodicity', 'periodicitynotice'); if (in_array($event, $multi)) { // Won't work for Cardridge and Consumable $options['entities_id'] = $item->getEntityID(); $options['items'] = array($item->getID() => $item->fields); } $target = NotificationTarget::getInstance($item, $event, $options); $infos = array('language'=> $_SESSION['glpilanguage']); $template->resetComputedTemplates(); $template->setSignature(Notification::getMailingSignature($_SESSION['glpiactive_entity'])); if ($tid = $template->getTemplateByLanguage($target, $infos, $event, $options)) { $data = $template->templates_by_languages[$tid]; echo "".__('Subject').""; echo "".$data['subject'].""; echo "".__('Email text body').""; echo "".__('Email HTML body').""; echo "".nl2br($data['content_text']).""; echo "".$data['content_html'].""; } } echo "
    "; } } ?> glpi-0.84.3+dfsg.1/inc/notimportedemail.class.php000066400000000000000000000177011226600447100215710ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// LDAP criteria class class NotImportedEmail extends CommonDBTM { const MATCH_NO_RULE = 0; const USER_UNKNOWN = 1; const FAILED_INSERT = 2; function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'delete'; $forbidden[] = 'purge'; $forbidden[] = 'restore'; return $forbidden; } static function canCreate() { return Session::haveRight('config', 'w'); } static function canView() { return Session::haveRight('config', 'w'); } static function getTypeName($nb=0) { return _n('Refused email', 'Refused emails', $nb); } /** * @see CommonDBTM::getSpecificMassiveActions() **/ function getSpecificMassiveActions($checkitem=NULL) { $isadmin = static::canUpdate(); $actions = parent::getSpecificMassiveActions($checkitem); if ($isadmin) { $actions['delete_email'] = __('Delete emails'); $actions['import_email'] = _x('button', 'Import'); } return $actions; } /** * @see CommonDBTM::showSpecificMassiveActionsParameters() **/ function showSpecificMassiveActionsParameters($input=array()) { switch ($input['action']) { case "import_email" : Entity::dropdown(); echo "

    "; return true; default : return parent::showSpecificMassiveActionsParameters($input); } return false; } /** * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case 'delete_email' : case 'import_email' : if (!static::canCreate()) { $res['noright']++; } else { $emails_ids = array(); foreach ($input["item"] as $key => $val) { if ($val == 1) { $emails_ids[$key] = $key; } } if (count($emails_ids)) { $mailcollector = new MailCollector(); if ($input["action"] == 'delete_email') { $mailcollector->deleteOrImportSeveralEmails($emails_ids, 0); } else { $mailcollector->deleteOrImportSeveralEmails($emails_ids, 1, $input['entities_id']); } } $res['ok']++; } break; default : return parent::doSpecificMassiveActions($input); } return $res; } function getSearchOptions() { $tab = array(); $tab[1]['table'] = 'glpi_notimportedemails'; $tab[1]['field'] = 'from'; $tab[1]['name'] = __('From email header'); $tab[1]['massiveaction'] = false; $tab[1]['datatype'] = 'string'; $tab[2]['table'] = 'glpi_notimportedemails'; $tab[2]['field'] = 'to'; $tab[2]['name'] = __('To email header'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'string'; $tab[3]['table'] = 'glpi_notimportedemails'; $tab[3]['field'] = 'subject'; $tab[3]['name'] = __('Subject email header'); $tab[3]['massiveaction'] = false; $tab[3]['datatype'] = 'string'; $tab[4]['table'] = 'glpi_mailcollectors'; $tab[4]['field'] = 'name'; $tab[4]['name'] = __('Mails receiver'); $tab[4]['datatype'] = 'itemlink'; $tab[5]['table'] = 'glpi_notimportedemails'; $tab[5]['field'] = 'messageid'; $tab[5]['name'] = __('Message-ID email header'); $tab[5]['massiveaction'] = false; $tab[5]['datatype'] = 'string'; $tab[6]['table'] = 'glpi_users'; $tab[6]['field'] = 'name'; $tab[6]['name'] = __('Requester'); $tab[6]['datatype'] = 'dropdown'; $tab[6]['right'] = 'all'; $tab[16]['table'] = 'glpi_notimportedemails'; $tab[16]['field'] = 'reason'; $tab[16]['name'] = __('Reason of rejection'); $tab[16]['datatype'] = 'specific'; $tab[16]['massiveaction'] = false; $tab[19]['table'] = 'glpi_notimportedemails'; $tab[19]['field'] = 'date'; $tab[19]['name'] = __('Date'); $tab[19]['datatype'] = 'datetime'; $tab[19]['massiveaction'] = false; return $tab; } static function deleteLog() { global $DB; $query = "TRUNCATE `glpi_notimportedemails`"; $DB->query($query); } /** * @param $reason_id **/ static function getReason($reason_id) { $tab = self::getAllReasons(); if (isset($tab[$reason_id])) { return $tab[$reason_id]; } return NOT_AVAILABLE; } /** * @since versin 0.84 * * Get All possible reasons array **/ static function getAllReasons() { return array(self::MATCH_NO_RULE => __('Unable to affect the email to an entity'), self::USER_UNKNOWN => __('Email not found. Impossible import'), self::FAILED_INSERT => __('Failed operation')); } /** * @since version 0.84 * * @param $field * @param $values * @param $options array **/ static function getSpecificValueToDisplay($field, $values, array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } switch ($field) { case 'reason': return self::getReason($values[$field]); } return parent::getSpecificValueToDisplay($field, $values, $options); } /** * @since version 0.84 * * @param $field * @param $name (default '') * @param $values (default '') * @param $options array **/ static function getSpecificValueToSelect($field, $name='', $values='', array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'reason' : $options['value'] = $values[$field]; return Dropdown::showFromArray($name, self::getAllReasons(), $options); } return parent::getSpecificValueToSelect($field, $name, $values, $options); } } ?> glpi-0.84.3+dfsg.1/inc/operatingsystem.class.php000066400000000000000000000026041226600447100214460ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class OperatingSystem class OperatingSystem extends CommonDropdown { static function getTypeName($nb=0) { return _n('Operating system', 'Operating systems', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/operatingsystemservicepack.class.php000066400000000000000000000026351226600447100236720ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class OperatingSystemServicePack class OperatingSystemServicePack extends CommonDropdown { static function getTypeName($nb=0) { return _n('Service pack', 'Service packs', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/operatingsystemversion.class.php000066400000000000000000000026701226600447100230570ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class OperatingSystemVersion class OperatingSystemVersion extends CommonDropdown { static function getTypeName($nb=0) { return _n('Version of the operating system', 'Versions of the operating systems', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/peripheral.class.php000066400000000000000000000434351226600447100203530ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // CLASS peripheral class Peripheral extends CommonDBTM { // From CommonDBTM public $dohistory = true; static protected $forward_entity_to = array('Infocom', 'NetworkPort', 'ReservationItem'); /** * Name of the type * * @param $nb : number of item in the type **/ static function getTypeName($nb=0) { return _n('Device', 'Devices', $nb); } static function canCreate() { return Session::haveRight('peripheral', 'w'); } static function canView() { return Session::haveRight('peripheral', 'r'); } /** * @see CommonDBTM::useDeletedToLockIfDynamic() * * @since version 0.84 **/ function useDeletedToLockIfDynamic() { return false; } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('Computer_Item', $ong, $options); $this->addStandardTab('NetworkPort', $ong, $options); $this->addStandardTab('Infocom', $ong, $options); $this->addStandardTab('Contract_Item', $ong, $options); $this->addStandardTab('Document_Item', $ong, $options); $this->addStandardTab('Ticket', $ong, $options); $this->addStandardTab('Item_Problem', $ong, $options); $this->addStandardTab('Link', $ong, $options); $this->addStandardTab('Note', $ong, $options); $this->addStandardTab('Reservation', $ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } function prepareInputForAdd($input) { if (isset($input["id"]) && ($input["id"] > 0)) { $input["_oldID"] = $input["id"]; } unset($input['id']); unset($input['withtemplate']); return $input; } function post_addItem() { global $DB, $CFG_GLPI; // Manage add from template if (isset($this->input["_oldID"])) { // ADD Infocoms Infocom::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); // ADD Ports NetworkPort::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); // ADD Contract Contract_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); // ADD Documents Document_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); // ADD Computers Computer_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); } } function cleanDBonPurge() { global $DB; $query = "SELECT `id` FROM `glpi_computers_items` WHERE `itemtype` = '".$this->getType()."' AND `items_id` = '".$this->fields['id']."'"; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { $conn = new Computer_Item(); while ($data = $DB->fetch_assoc($result)) { $data['_no_auto_action'] = true; $conn->delete($data); } } } $ip = new Item_Problem(); $ip->cleanDBonItemDelete(__CLASS__, $this->fields['id']); } /** * Print the peripheral form * * @param $ID integer ID of the item * @param $options array * - target filename : where to go when done. * - withtemplate boolean : template or basic item * * @return boolean item found **/ function showForm($ID, $options=array()) { global $CFG_GLPI; $target = $this->getFormURL(); $withtemplate = $this->initForm($ID, $options); $this->showTabs($options); $this->showFormHeader($options); echo ""; //TRANS: %1$s is a string, %2$s a second one without spaces between them : to change for RTL echo "".sprintf(__('%1$s%2$s'), __('Name'), (isset($options['withtemplate']) && $options['withtemplate']?"*":"")); echo ""; echo ""; $objectName = autoName($this->fields["name"], "name", (isset($options['withtemplate']) && ($options['withtemplate'] == 2)), $this->getType(), $this->fields["entities_id"]); Html::autocompletionTextField($this, "name", array('value' => $objectName)); echo "\n"; echo "".__('Status')."\n"; echo ""; State::dropdown(array('value' => $this->fields["states_id"])); echo "\n"; echo ""; echo "".__('Location')."\n"; echo ""; Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"])); echo "\n"; echo "".__('Type')."\n"; echo ""; PeripheralType::dropdown(array('value' => $this->fields["peripheraltypes_id"])); echo "\n"; echo ""; echo "".__('Technician in charge of the hardware')."\n"; echo ""; User::dropdown(array('name' => 'users_id_tech', 'value' => $this->fields["users_id_tech"], 'right' => 'own_ticket', 'entity' => $this->fields["entities_id"])); echo ""; echo "".__('Manufacturer')."\n"; echo ""; Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"])); echo "\n"; echo ""; echo "".__('Group in charge of the hardware').""; echo ""; Group::dropdown(array('name' => 'groups_id_tech', 'value' => $this->fields['groups_id_tech'], 'entity' => $this->fields['entities_id'], 'condition' => '`is_assign`')); echo ""; echo "".__('Model')."\n"; echo ""; PeripheralModel::dropdown(array('value' => $this->fields["peripheralmodels_id"])); echo "\n"; echo ""; echo "".__('Alternate username number')."\n"; echo ""; Html::autocompletionTextField($this, "contact_num"); echo ""; echo "".__('Serial number')."\n"; echo ""; Html::autocompletionTextField($this, "serial"); echo "\n"; echo ""; echo "".__('Alternate username')."\n"; echo ""; Html::autocompletionTextField($this, "contact"); echo "\n"; echo "".sprintf(__('%1$s%2$s'), __('Inventory number'), ( isset($options['withtemplate']) && $options['withtemplate']?"*":"")). "\n"; echo ""; $objectName = autoName($this->fields["otherserial"], "otherserial", (isset($options['withtemplate']) && ($options['withtemplate'] == 2)), $this->getType(), $this->fields["entities_id"]); Html::autocompletionTextField($this, "otherserial", array('value' => $objectName)); echo "\n"; echo ""; echo "".__('User')."\n"; echo ""; User::dropdown(array('value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all')); echo "\n"; echo "".__('Management type')."\n"; echo ""; Dropdown::showGlobalSwitch($this->fields["id"], array('withtemplate' => $withtemplate, 'value' => $this->fields["is_global"], 'management_restrict' => $CFG_GLPI["peripherals_management_restrict"], 'target' => $target)); echo "\n"; // Display auto inventory informations $rowspan = 3; $inventory_show = false; if (!empty($ID) && $this->fields["is_dynamic"]) { $inventory_show = true; $rowspan -= 1; } echo ""; echo "".__('Group')."\n"; echo ""; Group::dropdown(array('value' => $this->fields["groups_id"], 'entity' => $this->fields["entities_id"], 'condition' => '`is_itemgroup`')); echo "\n"; echo "".__('Comments')."\n"; echo " \n"; echo ""; echo "".__('Brand')."\n"; echo ""; Html::autocompletionTextField($this, "brand"); echo "\n"; echo ""; echo ""; if ((!isset($options['withtemplate']) || ($options['withtemplate'] == 0)) && !empty($this->fields['template_name'])) { echo ""; printf(__('Created from the template %s'), $this->fields['template_name']); echo ""; } else { echo " "; } echo ""; if (isset($options['withtemplate']) && $options['withtemplate']) { //TRANS: %s is the datetime of insertion printf(__('Created on %s'), Html::convDateTime($_SESSION["glpi_currenttime"])); } else { //TRANS: %s is the datetime of insertion printf(__('Last update on %s'), Html::convDateTime($this->fields["date_mod"])); } echo ""; if ($inventory_show) { echo ""; _e('Automatic inventory'); echo ""; echo ""; Plugin::doHook("autoinventory_information", $this); echo ""; } echo "\n"; $this->showFormButtons($options); $this->addDivForTabs(); return true; } /** * Return the SQL command to retrieve linked object * * @return a SQL command which return a set of (itemtype, items_id) **/ function getSelectLinkedItem() { return "SELECT 'Computer', `computers_id` FROM `glpi_computers_items` WHERE `itemtype` = '".$this->getType()."' AND `items_id` = '" . $this->fields['id']."'"; } /** * @see CommonDBTM::getSpecificMassiveActions() **/ function getSpecificMassiveActions($checkitem=NULL) { $isadmin = static::canUpdate(); $actions = parent::getSpecificMassiveActions($checkitem); if ($isadmin) { $actions['connect'] = _x('button', 'Connect'); $actions['disconnect'] = _x('button', 'Disconnect'); } if (Session::haveRight('transfer','r') && Session::isMultiEntitiesMode() && $isadmin) { $actions['add_transfer_list'] = _x('button', 'Add to transfer list'); } return $actions; } /** * @see CommonDBTM::showSpecificMassiveActionsParameters() **/ function showSpecificMassiveActionsParameters($input=array()) { switch ($input['action']) { case "connect" : case "disconnect" : $ci = new Computer_Item(); return $ci->showSpecificMassiveActionsParameters($input); default : return parent::showSpecificMassiveActionsParameters($input); } return false; } /** * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "connect" : case "disconnect" : $ci = new Computer_Item(); return $ci->doSpecificMassiveActions($input); default : return parent::doSpecificMassiveActions($input); } return $res; } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab+=Location::getSearchOptionsToAdd(); $tab[4]['table'] = 'glpi_peripheraltypes'; $tab[4]['field'] = 'name'; $tab[4]['name'] = __('Type'); $tab[4]['datatype'] = 'dropdown'; $tab[40]['table'] = 'glpi_peripheralmodels'; $tab[40]['field'] = 'name'; $tab[40]['name'] = __('Model'); $tab[40]['datatype'] = 'dropdown'; $tab[31]['table'] = 'glpi_states'; $tab[31]['field'] = 'completename'; $tab[31]['name'] = __('Status'); $tab[31]['datatype'] = 'dropdown'; $tab[5]['table'] = $this->getTable(); $tab[5]['field'] = 'serial'; $tab[5]['name'] = __('Serial number'); $tab[5]['datatype'] = 'string'; $tab[6]['table'] = $this->getTable(); $tab[6]['field'] = 'otherserial'; $tab[6]['name'] = __('Inventory number'); $tab[6]['datatype'] = 'string'; $tab[7]['table'] = $this->getTable(); $tab[7]['field'] = 'contact'; $tab[7]['name'] = __('Alternate username'); $tab[7]['datatype'] = 'string'; $tab[8]['table'] = $this->getTable(); $tab[8]['field'] = 'contact_num'; $tab[8]['name'] = __('Alternate username number'); $tab[8]['datatype'] = 'string'; $tab[70]['table'] = 'glpi_users'; $tab[70]['field'] = 'name'; $tab[70]['name'] = __('User'); $tab[70]['datatype'] = 'dropdown'; $tab[70]['right'] = 'all'; $tab[71]['table'] = 'glpi_groups'; $tab[71]['field'] = 'completename'; $tab[71]['name'] = __('Group'); $tab[71]['condition'] = '`is_itemgroup`'; $tab[71]['datatype'] = 'dropdown'; $tab[19]['table'] = $this->getTable(); $tab[19]['field'] = 'date_mod'; $tab[19]['name'] = __('Last update'); $tab[19]['datatype'] = 'datetime'; $tab[19]['massiveaction'] = false; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab[90]['table'] = $this->getTable(); $tab[90]['field'] = 'notepad'; $tab[90]['name'] = __('Notes'); $tab[90]['massiveaction'] = false; $tab[90]['datatype'] = 'text'; $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'brand'; $tab[11]['name'] = __('Brand'); $tab[11]['datatype'] = 'string'; $tab[23]['table'] = 'glpi_manufacturers'; $tab[23]['field'] = 'name'; $tab[23]['name'] = __('Manufacturer'); $tab[23]['datatype'] = 'dropdown'; $tab[24]['table'] = 'glpi_users'; $tab[24]['field'] = 'name'; $tab[24]['linkfield'] = 'users_id_tech'; $tab[24]['name'] = __('Technician in charge of the hardware'); $tab[24]['datatype'] = 'dropdown'; $tab[24]['right'] = 'own_ticket'; $tab[49]['table'] = 'glpi_groups'; $tab[49]['field'] = 'completename'; $tab[49]['linkfield'] = 'groups_id_tech'; $tab[49]['name'] = __('Group in charge of the hardware'); $tab[49]['condition'] = '`is_assign`'; $tab[49]['datatype'] = 'dropdown'; $tab[80]['table'] = 'glpi_entities'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = __('Entity'); $tab[80]['massiveaction'] = false; $tab[80]['datatype'] = 'dropdown'; $tab[82]['table'] = $this->getTable(); $tab[82]['field'] = 'is_global'; $tab[82]['name'] = __('Global management'); $tab[82]['datatype'] = 'bool'; $tab[82]['massiveaction'] = false; return $tab; } } ?>glpi-0.84.3+dfsg.1/inc/peripheralmodel.class.php000066400000000000000000000027071226600447100213710ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class PeripheralModel class PeripheralModel extends CommonDropdown { var $additional_fields_for_dictionnary = array('manufacturer'); static function getTypeName($nb=0) { return _n('Peripheral model', 'Peripheral models', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/peripheraltype.class.php000066400000000000000000000025701226600447100212500ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class PeripheralType class PeripheralType extends CommonDropdown { static function getTypeName($nb=0) { return _n('Devices type', 'Devices types', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/phone.class.php000066400000000000000000000473261226600447100173340ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Phone Class **/ class Phone extends CommonDBTM { // From CommonDBTM public $dohistory = true; static protected $forward_entity_to = array('Infocom', 'NetworkPort', 'ReservationItem'); static function getTypeName($nb=0) { //TRANS: Test of comment for translation (mark : //TRANS) return _n('Phone','Phones',$nb); } static function canCreate() { return Session::haveRight('phone', 'w'); } static function canView() { return Session::haveRight('phone', 'r'); } /** * @see CommonDBTM::useDeletedToLockIfDynamic() * * @since version 0.84 **/ function useDeletedToLockIfDynamic() { return false; } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('Computer_Item', $ong, $options); $this->addStandardTab('NetworkPort', $ong, $options); $this->addStandardTab('Infocom', $ong, $options); $this->addStandardTab('Contract_Item', $ong, $options); $this->addStandardTab('Document_Item', $ong, $options); $this->addStandardTab('Ticket', $ong, $options); $this->addStandardTab('Item_Problem', $ong, $options); $this->addStandardTab('Link', $ong, $options); $this->addStandardTab('Note', $ong, $options); $this->addStandardTab('Reservation', $ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } function prepareInputForAdd($input) { if (isset($input["id"]) && ($input["id"] > 0)) { $input["_oldID"] = $input["id"]; } unset($input['id']); unset($input['withtemplate']); return $input; } function post_addItem() { global $DB, $CFG_GLPI; // Manage add from template if (isset($this->input["_oldID"])) { // ADD Infocoms Infocom::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); // ADD Ports NetworkPort::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); // ADD Contract Contract_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); // ADD Documents Document_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); // ADD Computers Computer_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); } } function cleanDBonPurge() { global $DB; $query = "SELECT `id` FROM `glpi_computers_items` WHERE `itemtype` = '".$this->getType()."' AND `items_id` = '".$this->fields['id']."'"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { $conn = new Computer_Item(); while ($data = $DB->fetch_assoc($result)) { $data['_no_auto_action'] = true; $conn->delete($data); } } } $ip = new Item_Problem(); $ip->cleanDBonItemDelete(__CLASS__, $this->fields['id']); } /** * Print the phone form * * @param $ID integer ID of the item * @param $options array * - target filename : where to go when done. * - withtemplate boolean : template or basic item * * @return boolean item found **/ function showForm($ID, $options=array()) { global $CFG_GLPI; $target = $this->getFormURL(); $withtemplate = $this->initForm($ID, $options); $this->showTabs($options); $this->showFormHeader($options); echo ""; //TRANS: %1$s is a string, %2$s a second one without spaces between them : to change for RTL echo "".sprintf(__('%1$s%2$s'),__('Name'), (isset($options['withtemplate']) && $options['withtemplate']?"*":"")). ""; echo ""; $objectName = autoName($this->fields["name"], "name", (isset($options['withtemplate']) && ($options['withtemplate'] == 2)), $this->getType(), $this->fields["entities_id"]); Html::autocompletionTextField($this, 'name', array('value' => $objectName)); echo ""; echo "".__('Status').""; echo ""; State::dropdown(array('value' => $this->fields["states_id"])); echo "\n"; echo ""; echo "".__('Location').""; echo ""; Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"])); echo ""; echo "".__('Type').""; echo ""; PhoneType::dropdown(array('value' => $this->fields["phonetypes_id"])); echo "\n"; echo ""; echo "".__('Technician in charge of the hardware').""; echo ""; User::dropdown(array('name' => 'users_id_tech', 'value' => $this->fields["users_id_tech"], 'right' => 'own_ticket', 'entity' => $this->fields["entities_id"])); echo ""; echo "".__('Manufacturer').""; echo ""; Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"])); echo "\n"; echo ""; echo "".__('Group in charge of the hardware').""; echo ""; Group::dropdown(array('name' => 'groups_id_tech', 'value' => $this->fields['groups_id_tech'], 'entity' => $this->fields['entities_id'], 'condition' => '`is_assign`')); echo ""; echo "".__('Model').""; echo ""; PhoneModel::dropdown(array('value' => $this->fields["phonemodels_id"])); echo "\n"; echo ""; echo "".__('Alternate username number').""; echo ""; Html::autocompletionTextField($this, "contact_num"); echo ""; echo "".__('Serial number').""; echo ""; Html::autocompletionTextField($this,"serial"); echo "\n"; echo ""; echo "".__('Alternate username').""; Html::autocompletionTextField($this, "contact"); echo ""; echo "".sprintf(__('%1$s%2$s'), __('Inventory number'), (isset($options['withtemplate']) && $options['withtemplate']?"*":"")). ""; echo ""; $objectName = autoName($this->fields["otherserial"], "otherserial", (isset($options['withtemplate']) && ($options['withtemplate'] == 2)), $this->getType(), $this->fields["entities_id"]); Html::autocompletionTextField($this, 'otherserial', array('value' => $objectName)); echo "\n"; echo ""; echo "".__('User').""; echo ""; User::dropdown(array('value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all')); echo ""; echo "".__('Management type').""; echo ""; Dropdown::showGlobalSwitch($this->fields["id"], array('withtemplate' => $withtemplate, 'value' => $this->fields["is_global"], 'management_restrict' => $CFG_GLPI["phones_management_restrict"], 'target' => $target)); echo "\n"; // Display auto inventory informations $rowspan = 7; $inventory_show = false; if (!empty($ID) && $this->fields["is_dynamic"]) { $inventory_show = true; $rowspan -= 2; } echo ""; echo "".__('Group').""; echo ""; Group::dropdown(array('value' => $this->fields["groups_id"], 'entity' => $this->fields["entities_id"], 'condition' => '`is_itemgroup`')); echo ""; echo "".__('Comments').""; echo " \n"; echo ""; echo "".__('Brand').""; echo ""; Html::autocompletionTextField($this,"brand"); echo "\n"; echo ""; echo "".__('Power supply').""; echo ""; PhonePowerSupply::dropdown(array('value' => $this->fields["phonepowersupplies_id"])); echo "\n"; echo ""; echo ""._n('Firmware', 'Firmwares', 1).""; echo ""; Html::autocompletionTextField($this, "firmware"); echo "\n"; echo ""; echo ""._x('quantity', 'Number of lines').""; Html::autocompletionTextField($this, "number_line"); echo "\n"; echo ""; echo "".__('Flags').""; echo ""; // micro? echo "\n"; echo ""; // hp? echo ""; echo "
    ".__('Headset')." "; Dropdown::showYesNo("have_headset", $this->fields["have_headset"]); echo "
    ".__('Speaker')." "; Dropdown::showYesNo("have_hp", $this->fields["have_hp"]); echo "
    \n"; echo ""; if ($inventory_show) { echo ""; _e('Automatic inventory'); echo ""; echo ""; Plugin::doHook("autoinventory_information", $this); echo ""; } echo "\n"; echo ""; echo ""; if ((!isset($options['withtemplate']) || ($options['withtemplate'] == 0)) && !empty($this->fields['template_name'])) { echo ""; printf(__('Created from the template %s'), $this->fields['template_name']); echo ""; } else { echo " "; } echo ""; if (isset($options['withtemplate']) && $options['withtemplate']) { //TRANS: %s is the datetime of insertion printf(__('Created on %s'), Html::convDateTime($_SESSION["glpi_currenttime"])); } else { //TRANS: %s is the datetime of insertion printf(__('Last update on %s'), Html::convDateTime($this->fields["date_mod"])); } echo "\n"; $this->showFormButtons($options); $this->addDivForTabs(); return true; } /** * Return the SQL command to retrieve linked object * * @return a SQL command which return a set of (itemtype, items_id) **/ function getSelectLinkedItem() { return "SELECT 'Computer', `computers_id` FROM `glpi_computers_items` WHERE `itemtype` = '".$this->getType()."' AND `items_id` = '" . $this->fields['id']."'"; } /** * @see CommonDBTM::getSpecificMassiveActions() **/ function getSpecificMassiveActions($checkitem=NULL) { $isadmin = static::canUpdate(); $actions = parent::getSpecificMassiveActions($checkitem); if ($isadmin) { $actions['connect'] = _x('button', 'Connect'); $actions['disconnect'] = _x('button', 'Disconnect'); } if (Session::haveRight('transfer','r') && Session::isMultiEntitiesMode() && $isadmin) { $actions['add_transfer_list'] = _x('button', 'Add to transfer list'); } return $actions; } /** * @see CommonDBTM::showSpecificMassiveActionsParameters() **/ function showSpecificMassiveActionsParameters($input=array()) { switch ($input['action']) { case "connect" : case "disconnect" : $ci = new Computer_Item(); return $ci->showSpecificMassiveActionsParameters($input); default : return parent::showSpecificMassiveActionsParameters($input); } return false; } /** * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "connect" : case "disconnect" : $ci = new Computer_Item(); return $ci->doSpecificMassiveActions($input); default : return parent::doSpecificMassiveActions($input); } return $res; } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab+=Location::getSearchOptionsToAdd(); $tab[4]['table'] = 'glpi_phonetypes'; $tab[4]['field'] = 'name'; $tab[4]['name'] = __('Type'); $tab[4]['datatype'] = 'dropdown'; $tab[40]['table'] = 'glpi_phonemodels'; $tab[40]['field'] = 'name'; $tab[40]['name'] = __('Model'); $tab[40]['datatype'] = 'dropdown'; $tab[31]['table'] = 'glpi_states'; $tab[31]['field'] = 'completename'; $tab[31]['name'] = __('Status'); $tab[31]['datatype'] = 'dropdown'; $tab[5]['table'] = $this->getTable(); $tab[5]['field'] = 'serial'; $tab[5]['name'] = __('Serial Number'); $tab[5]['datatype'] = 'string'; $tab[6]['table'] = $this->getTable(); $tab[6]['field'] = 'otherserial'; $tab[6]['name'] = __('Inventory number'); $tab[6]['datatype'] = 'string'; $tab[7]['table'] = $this->getTable(); $tab[7]['field'] = 'contact'; $tab[7]['name'] = __('Alternate username'); $tab[7]['datatype'] = 'string'; $tab[8]['table'] = $this->getTable(); $tab[8]['field'] = 'contact_num'; $tab[8]['name'] = __('Alternate username number'); $tab[8]['datatype'] = 'string'; $tab[9]['table'] = $this->getTable(); $tab[9]['field'] = 'number_line'; $tab[9]['name'] = _x('quantity', 'Number of lines'); $tab[9]['datatype'] = 'string'; $tab[70]['table'] = 'glpi_users'; $tab[70]['field'] = 'name'; $tab[70]['name'] = __('User'); $tab[70]['datatype'] = 'dropdown'; $tab[70]['right'] = 'all'; $tab[71]['table'] = 'glpi_groups'; $tab[71]['field'] = 'completename'; $tab[71]['name'] = __('Group'); $tab[71]['condition'] = '`is_itemgroup`'; $tab[71]['datatype'] = 'dropdown'; $tab[19]['table'] = $this->getTable(); $tab[19]['field'] = 'date_mod'; $tab[19]['name'] = __('Last update'); $tab[19]['datatype'] = 'datetime'; $tab[19]['massiveaction'] = false; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab[90]['table'] = $this->getTable(); $tab[90]['field'] = 'notepad'; $tab[90]['name'] = __('Notes'); $tab[90]['massiveaction'] = false; $tab[90]['datatype'] = 'text'; $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'brand'; $tab[11]['name'] = __('Brand'); $tab[11]['datatype'] = 'string'; $tab[23]['table'] = 'glpi_manufacturers'; $tab[23]['field'] = 'name'; $tab[23]['name'] = __('Manufacturer'); $tab[23]['datatype'] = 'dropdown'; $tab[32]['table'] = $this->getTable(); $tab[32]['field'] = 'firmware'; $tab[32]['name'] = __('Firmware'); $tab[32]['datatype'] = 'string'; $tab[24]['table'] = 'glpi_users'; $tab[24]['field'] = 'name'; $tab[24]['linkfield'] = 'users_id_tech'; $tab[24]['name'] = __('Technician in charge of the hardware'); $tab[24]['datatype'] = 'dropdown'; $tab[24]['right'] = 'own_ticket'; $tab[49]['table'] = 'glpi_groups'; $tab[49]['field'] = 'completename'; $tab[49]['linkfield'] = 'groups_id_tech'; $tab[49]['name'] = __('Group in charge of the hardware'); $tab[49]['condition'] = '`is_assign`'; $tab[49]['datatype'] = 'dropdown'; $tab[42]['table'] = 'glpi_phonepowersupplies'; $tab[42]['field'] = 'name'; $tab[42]['name'] = __('Power supply'); $tab[42]['datatype'] = 'dropdown'; $tab[43]['table'] = $this->getTable(); $tab[43]['field'] = 'have_headset'; $tab[43]['name'] = __('Headset'); $tab[43]['datatype'] = 'bool'; $tab[44]['table'] = $this->getTable(); $tab[44]['field'] = 'have_hp'; $tab[44]['name'] = __('Speaker'); $tab[44]['datatype'] = 'bool'; $tab[80]['table'] = 'glpi_entities'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = __('Entity'); $tab[80]['massiveaction'] = false; $tab[80]['datatype'] = 'dropdown'; $tab[82]['table'] = $this->getTable(); $tab[82]['field'] = 'is_global'; $tab[82]['name'] = __('Global management'); $tab[82]['datatype'] = 'bool'; $tab[82]['massiveaction'] = false; return $tab; } } ?> glpi-0.84.3+dfsg.1/inc/phonemodel.class.php000066400000000000000000000026561226600447100203520ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class PhoneModel class PhoneModel extends CommonDropdown { var $additional_fields_for_dictionnary = array('manufacturer'); static function getTypeName($nb=0) { return _n('Phone model', 'Phone models', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/phonepowersupply.class.php000066400000000000000000000026241226600447100216560ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class PhonePowerSupply class PhonePowerSupply extends CommonDropdown { static function getTypeName($nb=0) { return _n('Phone power supply type', 'Phone power supply types', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/phonetype.class.php000066400000000000000000000025451226600447100202300ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class PhoneType class PhoneType extends CommonDropdown { static function getTypeName($nb=0) { return _n('Phone type', 'Phone types', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/planning.class.php000066400000000000000000001131261226600447100200210ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // CLASS Planning class Planning extends CommonGLPI { function defineTabs($options=array()) { $ong = array(); $ong['no_all_tab'] = true ; $this->addStandardTab(__CLASS__, $ong, $options); return $ong; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if ($item->getType() == __CLASS__) { $tabs[1] = __('Personal View'); if (Session::haveRight("show_group_planning","1")) { $tabs[2] = __('Group View'); } if (Session::haveRight("show_all_planning","1")) { $tabs[3] = _n('User', 'Users', 2); $tabs[4] = _n('Group', 'Groups', 2); } return $tabs; } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType() == __CLASS__) { switch ($tabnum) { case 1 : // all Planning::showSelectionForm($_POST['type'], $_POST['date'], 'my', 0, $_POST["limititemtype"]); Planning::showPlanning($_SESSION['glpiID'], $_POST["gID"], $_POST["date"], $_POST["type"], $_POST["limititemtype"]); break; case 2 : Planning::showSelectionForm($_POST['type'], $_POST['date'], 'mygroups', 0, $_POST["limititemtype"]); Planning::showPlanning($_SESSION['glpiID'], 'mine', $_POST["date"], $_POST["type"], $_POST["limititemtype"]); break; case 3 : Planning::showSelectionForm($_POST['type'], $_POST['date'], 'users', $_POST["uID"], $_POST["limititemtype"]); Planning::showPlanning($_POST['uID'], 0, $_POST["date"], $_POST["type"], $_POST["limititemtype"]); break; case 4 : Planning::showSelectionForm($_POST['type'], $_POST['date'], 'groups', $_POST["gID"], $_POST["limititemtype"]); Planning::showPlanning(0, $_POST['gID'], $_POST["date"], $_POST["type"], $_POST["limititemtype"]); break; } } return true; } /** * Get planning state name * * @param $value status ID **/ static function getState($value) { switch ($value) { case 0 : return _n('Information', 'Information', 1); case 1 : return __('To do'); case 2 : return __('Done'); } } /** * Dropdown of planning state * * @param $name select name * @param $value default value (default '') * @param $display display of send string ? (true by default) **/ static function dropdownState($name, $value='', $display=true) { $output = ""; if ($display) { echo $output; } else { return $output; } } /** * Check already planned user for a period * * @param $users_id user id * @param $begin begin date * @param $end end date * @param $except array of items which not be into account array * ('Reminder'=>array(1,2,id_of_items)) **/ static function checkAlreadyPlanned($users_id, $begin, $end, $except=array()) { global $CFG_GLPI; $planned = false; $message = ''; foreach ($CFG_GLPI['planning_types'] as $itemtype) { $data = call_user_func(array($itemtype, 'populatePlanning'), array('who' => $users_id, 'who_group' => 0, 'begin' => $begin, 'end' => $end)); if (isPluginItemType($itemtype)) { if (isset($data['items'])) { $data = $data['items']; } else { $data = array(); } } if (count($data) && method_exists($itemtype,'getAlreadyPlannedInformation')) { foreach ($data as $key => $val) { if (!isset($except[$itemtype]) || (is_array($except[$itemtype]) && !in_array($val['id'],$except[$itemtype]))) { $planned = true; $message .= '- '.call_user_func(array($itemtype, 'getAlreadyPlannedInformation'), $val).'
    '; } } } } if ($planned) { Session::addMessageAfterRedirect(__('The user is busy at the selected timeframe.'). '
    '.$message, false, ERROR); } return $planned; } /** * Show the planning selection form * * @param $type planning type : can be day, week, month * @param $date working date * @param $usertype type of planning to view : can be user or group * @param $value ID of the item * @param $limititemtype itemtype only display this itemtype (default '') * * @return Display form **/ static function showSelectionForm($type, $date, $usertype, $value, $limititemtype='') { global $CFG_GLPI; switch ($type) { case "month" : $split = explode("-",$date); $year_next = $split[0]; $month_next = $split[1]+1; if ($month_next > 12) { $year_next++; $month_next -= 12; } $year_prev = $split[0]; $month_prev = $split[1]-1; if ($month_prev == 0) { $year_prev--; $month_prev += 12; } $next = $year_next."-".sprintf("%02u",$month_next)."-".$split[2]; $prev = $year_prev."-".sprintf("%02u",$month_prev)."-".$split[2]; break; default : $time = strtotime($date); $step = 0; switch ($type) { case "week" : $step = WEEK_TIMESTAMP; break; case "day" : $step = DAY_TIMESTAMP; break; } $next = $time+$step+10; $prev = $time-$step; $next = strftime("%Y-%m-%d",$next); $prev = strftime("%Y-%m-%d",$prev); break; } $uID = 0; $gID = 0; switch ($usertype) { case 'my' : $uID = $_SESSION['glpiID']; break; case 'mygroups' : if (!Session::haveRight("show_group_planning","1")) { exit(); } $gID = 'mine'; break; case 'users' : if (!Session::haveRight("show_all_planning","1")) { exit(); } $uID = $value; break; case 'groups' : if (!Session::haveRight("show_all_planning","1")) { exit(); } $gID = $value; break; } echo "
    \n"; echo ""; echo ""; switch ($usertype) { case 'users' : echo ""; break; case 'groups' : echo ""; break; } echo ""; echo ""; echo "\n"; echo "\n"; if ($uID || $gID) { echo "\n"; } echo ""; echo ""; echo "
    "; echo ""; echo "\"".__s('Previous')."\""; echo ""; $rand_user = User::dropdown(array('name' => 'uID', 'value' => $value, 'right' => 'interface', 'all' => 1, 'entity' => $_SESSION["glpiactive_entity"])); echo ""; $rand_group = Group::dropdown(array('value' => $value, 'name' => 'gID', 'entity' => $_SESSION["glpiactive_entity"], 'condition' => '`is_usergroup`')); echo ""; Dropdown::showItemTypes('limititemtype', $CFG_GLPI['planning_types'], array('value' => $limititemtype)); echo ""; Html::showDateFormItem("date", $date, false); echo ''; echo ""; echo ""; echo ""; echo "". "".__('Ical').""; echo "
    "; $url = parse_url($CFG_GLPI["url_base"]); $port = 80; if (isset($url['port'])) { $port = $url['port']; } else if (isset($url['scheme']) && ($url["scheme"] == 'https')) { $port = 443; } echo ""; echo "".__('Webcal').""; echo "
    "; echo ""; echo "\"".__s('Next')."\""; echo "
    "; Html::closeForm(); echo "
    \n"; } /** * Show the availability of a user * * @since version 0.83 * * @param $who ID of the user * @param $begin begin date to check (default '') * @param $end end date to check (default '') * * @return Nothing (display function) **/ static function checkAvailability($who, $begin='', $end='') { global $CFG_GLPI, $DB; if (empty($who)) { return false; } if (empty($begin)) { $begin = date("Y-m-d"); } if (empty($end)) { $end = date("Y-m-d"); } if ($end < $begin) { $end = $begin; } $realbegin = $begin." ".$CFG_GLPI["planning_begin"]; $realend = $end." ".$CFG_GLPI["planning_end"]; // Use get method to check availability echo "
    \n"; echo ""; echo ""; echo ""; echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo ""; echo "
    ".__('Availability')."".getUserName($who)."
    ".__('Start').""; Html::showDateFormItem("begin", $begin, false); echo "".__('End').""; Html::showDateFormItem("end", $end, false); echo ""; echo ""; echo ""; echo "
    "; Html::closeForm(); echo "
    \n"; $params = array('who' => $who, 'who_group' => 0, 'begin' => $realbegin, 'end' => $realend); $interv = array(); foreach ($CFG_GLPI['planning_types'] as $itemtype) { $interv = array_merge($interv, $itemtype::populatePlanning($params)); } // Print Headers echo "
    "; $colnumber = 1; $plan_begin = explode(":",$CFG_GLPI["planning_begin"]); $plan_end = explode(":",$CFG_GLPI["planning_end"]); $begin_hour = intval($plan_begin[0]); $end_hour = intval($plan_end[0]); if ($plan_end[1] != 0) { $end_hour++; } $colsize = floor((100-15)/($end_hour-$begin_hour)); // Print Headers echo ""; for ($i=$begin_hour ; $i<$end_hour ; $i++) { $from = ($i<10?'0':'').$i; // $to = ((($i+1) < 10)?'0':'').($i+1); echo ""; $colnumber += 4; } echo ""; $day_begin = strtotime($realbegin); $day_end = strtotime($realend); for ($time=$day_begin ; $time<$day_end ; $time+=DAY_TIMESTAMP) { $current_day = date('Y-m-d', $time); echo ""; $begin_quarter = $begin_hour*4; $end_quarter = $end_hour*4; for ($i=$begin_quarter ; $i<$end_quarter ; $i++) { $begin_time = date("Y-m-d H:i:s", strtotime($current_day)+($i)*HOUR_TIMESTAMP/4); $end_time = date("Y-m-d H:i:s", strtotime($current_day)+($i+1)*HOUR_TIMESTAMP/4); // Init activity interval $begin_act = $end_time; $end_act = $begin_time; reset($interv); while ($data = current($interv)) { if (($data["begin"] >= $begin_time) && ($data["end"] <= $end_time)) { // In if ($begin_act > $data["begin"]) { $begin_act = $data["begin"]; } if ($end_act < $data["end"]) { $end_act = $data["end"]; } unset($interv[key($interv)]); } else if (($data["begin"] < $begin_time) && ($data["end"] > $end_time)) { // Through $begin_act = $begin_time; $end_act = $end_time; next($interv); } else if (($data["begin"] >= $begin_time) && ($data["begin"] < $end_time)) { // Begin if ($begin_act > $data["begin"]) { $begin_act = $data["begin"]; } $end_act = $end_time; next($interv); } else if (($data["end"] > $begin_time) && ($data["end"] <= $end_time)) { //End $begin_act = $begin_time; if ($end_act < $data["end"]) { $end_act = $data["end"]; } unset($interv[key($interv)]); } else { // Defautl case next($interv); } } if ($begin_act < $end_act) { if (($begin_act <= $begin_time) && ($end_act >= $end_time)) { // Activity in quarter echo ""; } else { // Not all the quarter if ($begin_act <= $begin_time) { echo ""; } else { echo ""; } } } else { // No activity echo ""; } } echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
     ".$from.":00
    ".Html::convDate($current_day)."    
     
    ".__('Caption')."".__('Available')."".__('Unavailable')." 
    "; } /** * Show the planning * * Function name change since version 0.84 show() => showPlanning * * @param $who ID of the user (0 = undefined) * @param $who_group ID of the group of users (0 = undefined) * @param $when Date of the planning to display * @param $type type of planning to display (day, week, month) * @param $limititemtype itemtype limit display to this itemtype (default '') * * @return Nothing (display function) **/ static function showPlanning($who, $who_group, $when, $type, $limititemtype='') { global $CFG_GLPI, $DB; if (!Session::haveRight("show_planning","1") && !Session::haveRight("show_all_planning","1")) { return false; } // Define some constants $date = explode("-",$when); $time = mktime(0, 0, 0, $date[1], $date[2], $date[0]); $daysinweek = Toolbox::getDaysOfWeekArray(); // Check bisextile years list($current_year, $current_month, $current_day) = explode("-", $when); if (($current_year%4) == 0) { $feb = 29; } else { $feb = 28; } $nb_days = array(31, $feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); // Begin of the month $begin_month_day = strftime("%w", mktime(0, 0, 0, $current_month, 1, $current_year)); if ($begin_month_day == 0) { $begin_month_day = 7; } $end_month_day = strftime("%w", mktime(0, 0, 0, $current_month, $nb_days[$current_month-1], $current_year)); // Day of the week $dayofweek = date("w",$time); // Cas du dimanche if ($dayofweek == 0) { $dayofweek = 7; } // Get begin and duration $begin = 0; $end = 0; switch ($type) { case "month" : $begin = strtotime($current_year."-".$current_month."-01 00:00:00"); $end = $begin+DAY_TIMESTAMP*$nb_days[$current_month-1]; break; case "week" : $tbegin = $begin=$time+mktime(0,0,0,0,1,0)-mktime(0,0,0,0,$dayofweek,0); $end = $begin+WEEK_TIMESTAMP; break; case "day" : $add = ""; $begin = $time; $end = $begin+DAY_TIMESTAMP; break; } $begin = date("Y-m-d H:i:s", $begin); $end = date("Y-m-d H:i:s", $end); // Print Headers echo "
    "; // Print Headers echo ""; switch ($type) { case "month" : for ($i=1 ; $i<=7 ; $i++) { echo ""; } break; case "week" : for ($i=1 ; $i<=7 ; $i++, $tbegin+=DAY_TIMESTAMP) { echo ""; } break; case "day" : echo ""; break; } echo "\n"; $params = array('who' => $who, 'who_group' => $who_group, 'begin' => $begin, 'end' => $end); $interv = array(); if (empty($limititemtype)) { foreach ($CFG_GLPI['planning_types'] as $itemtype) { $interv = array_merge($interv, $itemtype::populatePlanning($params)); } } else { $interv = $limititemtype::populatePlanning($params); } // Display Items $tmp = explode(":", $CFG_GLPI["planning_begin"]); $hour_begin = $tmp[0]; $tmp = explode(":", $CFG_GLPI["planning_end"]); $hour_end = $tmp[0]; if ($tmp[1] > 0) { $hour_end++; } switch ($type) { case "week" : for ($hour=$hour_begin ; $hour<=$hour_end ; $hour++) { echo ""; for ($i=1 ; $i<=7 ; $i++) { echo ""; } echo "\n"; } break; case "day" : for ($hour=$hour_begin ; $hour<=$hour_end ; $hour++) { echo ""; $begin_time = date("Y-m-d H:i:s", strtotime($when)+($hour)*HOUR_TIMESTAMP); $end_time = date("Y-m-d H:i:s", strtotime($when)+($hour+1)*HOUR_TIMESTAMP); echo ""; } break; case "month" : echo ""; // Display first day out of the month for ($i=1 ; $i<$begin_month_day ; $i++) { echo ""; } // Print real days if (($current_month < 10) && (strlen($current_month) == 1)) { $current_month = "0".$current_month; } $begin_time = strtotime($begin); $end_time = strtotime($end); for ($time=$begin_time ; $time<$end_time ; $time+=DAY_TIMESTAMP) { // Add 6 hours for midnight problem $day = date("d", $time+6*HOUR_TIMESTAMP); echo ""; // Add break line if ((($day+$begin_month_day)%7) == 1) { echo "\n"; if ($day != $nb_days[$current_month-1]) { echo ""; } } } if ($end_month_day!=0) { for ($i=0 ; $i<7-$end_month_day ; $i++) { echo ""; } } echo ""; break; } echo "
    ".$daysinweek[$i%7]."".$daysinweek[$i%7]." ".date('d', $tbegin)."".$daysinweek[$dayofweek%7]."
    "; echo "".self::displayUsingTwoDigits($hour).":00
    "; // From midnight if ($hour == $hour_begin) { $begin_time = date("Y-m-d H:i:s", strtotime($when)+($i-$dayofweek)*DAY_TIMESTAMP); } else { $begin_time = date("Y-m-d H:i:s", strtotime($when)+($i-$dayofweek)*DAY_TIMESTAMP+$hour*HOUR_TIMESTAMP); } // To midnight if ($hour == $hour_end) { $end_time = date("Y-m-d H:i:s", strtotime($when)+($i-$dayofweek)*DAY_TIMESTAMP+24*HOUR_TIMESTAMP); } else { $end_time = date("Y-m-d H:i:s", strtotime($when)+($i-$dayofweek)*DAY_TIMESTAMP+($hour+1)*HOUR_TIMESTAMP); } reset($interv); while ($data=current($interv)) { $type = ""; if (( $data["begin"]>= $begin_time) && ($data["end"] <= $end_time)) { $type = "in"; } else if (($data["begin"] < $begin_time) && ($data["end"] > $end_time)) { $type = "through"; } else if (($data["begin"] >= $begin_time) && ($data["begin"] < $end_time)) { $type = "begin"; } else if (($data["end"] > $begin_time) && ($data["end"] <= $end_time)) { $type = "end"; } if (empty($type)) { next($interv); } else { self::displayPlanningItem($data,$who,$type); if ($type == "in") { unset($interv[key($interv)]); } else { next($interv); } } } echo "
    "; echo "".self::displayUsingTwoDigits($hour).":00
    "; reset($interv); while ($data=current($interv)) { $type = ""; if (($data["begin"] >= $begin_time) && ($data["end"] <= $end_time)) { $type = "in"; } else if (($data["begin"] < $begin_time) && ($data["end"] > $end_time)) { $type = "through"; } else if (($data["begin"] >= $begin_time) && ($data["begin"] < $end_time)) { $type = "begin"; } else if (($data["end"] > $begin_time) && ($data["end"] <= $end_time)) { $type = "end"; } if (empty($type)) { next($interv); } else { self::displayPlanningItem($data,$who,$type,1); if ($type == "in") { unset($interv[key($interv)]); } else { next($interv); } } } echo "
     "; echo ""; echo ""; echo "
    "; echo "". $day."
    "; $begin_day = date("Y-m-d H:i:s", $time); $end_day = date("Y-m-d H:i:s", $time+DAY_TIMESTAMP); reset($interv); while ($data = current($interv)) { $type = ""; if (($data["begin"] >= $begin_day) && ($data["end"] <= $end_day)) { $type = "in"; } else if (($data["begin"] < $begin_day) && ($data["end"] > $end_day)) { $type = "through"; } else if (($data["begin"] >= $begin_day) && ($data["begin"] < $end_day)) { $type = "begin"; } else if (($data["end"] > $begin_day) && ($data["end"] <= $end_day)) { $type = "end"; } if (empty($type)) { next($interv); } else { self::displayPlanningItem($data, $who,$type); if ($type == "in") { unset($interv[key($interv)]); } else { next($interv); } } } echo "
    "; echo "
     
    "; } /** * Display a Planning Item * * @param $val Array of the item to display * @param $who ID of the user (0 if all) * @param $type position of the item in the time block (in, through, begin or end) * (default '') * @param $complete complete display (more details) (default 0) * * @return Nothing (display function) **/ static function displayPlanningItem(array $val, $who, $type="", $complete=0) { global $CFG_GLPI, $PLUGIN_HOOKS; $color = "#e4e4e4"; if (isset($val["state"])) { switch ($val["state"]) { case 0 : $color = "#efefe7"; // Information break; case 1 : $color = "#fbfbfb"; // To be done break; case 2 : $color = "#e7e7e2"; // Done break; } } echo "
    "; // Plugins case if (isset($val['itemtype']) && !empty($val['itemtype'])) { $val['itemtype']::displayPlanningItem($val, $who, $type, $complete); } echo "

    "; } /** * Display an integer using 2 digits * * @param $time value to display * * @return string return the 2 digits item **/ static private function displayUsingTwoDigits($time) { $time = round($time); if (($time < 10) && (strlen($time) > 0)) { return "0".$time; } return $time; } /** * Show the planning for the central page of a user * * @param $who ID of the user * * @return Nothing (display function) **/ static function showCentral($who) { global $CFG_GLPI; if (!Session::haveRight("show_planning","1") || ($who <= 0)) { return false; } $when = strftime("%Y-%m-%d"); $debut = $when; // Get begin and duration $date = explode("-",$when); $time = mktime(0, 0, 0, $date[1], $date[2], $date[0]); $begin = $time; $end = $begin+DAY_TIMESTAMP; $begin = date("Y-m-d H:i:s", $begin); $end = date("Y-m-d H:i:s", $end); $params = array('who' => $who, 'who_group' => 0, 'begin' => $begin, 'end' => $end); $interv = array(); foreach ($CFG_GLPI['planning_types'] as $itemtype) { $interv = array_merge($interv,$itemtype::populatePlanning($params)); } ksort($interv); echo ""; $type = ''; if (count($interv) > 0) { foreach ($interv as $key => $val) { echo ""; echo "\n"; } } echo "
    "; echo "".__('Your planning'). ""; echo "
    "; if ($val["begin"] < $begin) { $val["begin"] = $begin; } if ($val["end"] > $end) { $val["end"] = $end; } self::displayPlanningItem($val, $who, 'in'); echo "
    "; } //******************************************************************************************************************************* // *********************************** Implementation ICAL *************************************************************** //******************************************************************************************************************************* /** * Generate ical file content * * @param $who user ID * @param $who_group group ID * @param $limititemtype itemtype only display this itemtype (default '') * * @return icalendar string **/ static function generateIcal($who, $who_group, $limititemtype='') { global $CFG_GLPI; if (($who === 0) && ($who_group === 0)) { return false; } include_once (GLPI_ROOT . "/lib/icalcreator/iCalcreator.class.php"); $v = new vcalendar(); if (!empty( $CFG_GLPI["version"])) { $v->setConfig( 'unique_id', "GLPI-Planning-".trim($CFG_GLPI["version"]) ); } else { $v->setConfig( 'unique_id', "GLPI-Planning-UnknownVersion" ); } $tz = date_default_timezone_get(); $v->setConfig( 'TZID', $tz ); $v->setProperty( "method", "PUBLISH" ); $v->setProperty( "version", "2.0" ); $v->setProperty( "X-WR-TIMEZONE", $tz ); $xprops = array( "X-LIC-LOCATION" => $tz ); iCalUtilityFunctions::createTimezone( $v, $tz, $xprops ); $v->setProperty( "x-wr-calname", "GLPI-".$who."-".$who_group ); $v->setProperty( "calscale", "GREGORIAN" ); $interv = array(); $begin = time()-MONTH_TIMESTAMP*12; $end = time()+MONTH_TIMESTAMP*12; $begin = date("Y-m-d H:i:s", $begin); $end = date("Y-m-d H:i:s", $end); $params = array('who' => $who, 'who_group' => $who_group, 'begin' => $begin, 'end' => $end); $interv = array(); if (empty($limititemtype)) { foreach ($CFG_GLPI['planning_types'] as $itemtype) { $interv = array_merge($interv, $itemtype::populatePlanning($params)); } } else { $interv = $limititemtype::populatePlanning($params); } if (count($interv) > 0) { foreach ($interv as $key => $val) { $vevent = new vevent(); //initiate EVENT if (isset($val['itemtype'])) { if (isset($val[getForeignKeyFieldForItemType($val['itemtype'])])) { $vevent->setProperty("uid", $val['itemtype']."#". $val[getForeignKeyFieldForItemType($val['itemtype'])]); } else { $vevent->setProperty("uid", "Other#".$key); } } else { $vevent->setProperty("uid", "Other#".$key); } $vevent->setProperty( "dstamp", $val["begin"] ); $vevent->setProperty( "dtstart", $val["begin"] ); $vevent->setProperty( "dtend", $val["end"] ); if (isset($val["tickets_id"])) { $vevent->setProperty("summary", // TRANS: %1$s is the ticket, %2$s is the title sprintf(__('Ticket #%1$s %2$s'), $val["tickets_id"], $val["name"])); } else if (isset($val["name"])) { $vevent->setProperty( "summary", $val["name"] ); } if (isset($val["content"])) { $text = $val["content"]; // be sure to replace nl by \r\n $text = preg_replace("/]*)?".">/i", "\r\n", $text); $text = Html::clean($text); $vevent->setProperty( "description", $text ); } else if (isset($val["name"])) { $text = $val["name"]; // be sure to replace nl by \r\n $text = preg_replace("/]*)?".">/i", "\r\n", $text); $text = Html::clean($text); $vevent->setProperty( "description", $text ); } if (isset($val["url"])) { $vevent->setProperty("url",$val["url"]); } $v->setComponent( $vevent ); } } $v->sort(); // $v->parse(); return $v->returnCalendar(); } } ?> glpi-0.84.3+dfsg.1/inc/planningrecall.class.php000066400000000000000000000311141226600447100212000ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // Class PlanningRecall // @since version 0.84 class PlanningRecall extends CommonDBChild { // From CommonDBChild static public $itemtype = 'itemtype'; static public $items_id = 'items_id'; static function getTypeName($nb=0) { return _n('Planning reminder', 'Planning reminders', $nb); } static function canCreate() { return true; } function canCreateItem() { return $this->fields['users_id'] == Session::getLoginUserID(); } function cleanDBonPurge() { $class = new Alert(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); } static function isAvailable() { global $CFG_GLPI; // Cache in session if (isset($_SESSION['glpiplanningreminder_isavailable'])) { return $_SESSION['glpiplanningreminder_isavailable']; } $_SESSION['glpiplanningreminder_isavailable'] = 0; if ($CFG_GLPI["use_mailing"]) { $task = new Crontask(); if ($task->getFromDBbyName('PlanningRecall','planningrecall')) { // Only disabled by config if ($task->isDisabled() != 1) { if (Session::haveRight("show_planning", "1") || Session::haveRight("show_all_planning", "1") || Session::haveRight("show_group_planning","1")) { $_SESSION['glpiplanningreminder_isavailable'] = 1; } } } } return $_SESSION['glpiplanningreminder_isavailable']; } /** * Retrieve an item from the database * * @param $itemtype string itemtype to get * @param $items_id integer id of the item * @param $users_id integer id of the user * * @return true if succeed else false **/ function getFromDBForItemAndUser($itemtype, $items_id, $users_id) { return $this->getFromDBByQuery("WHERE `".$this->getTable()."`.`itemtype` = '$itemtype' AND `".$this->getTable()."`.`items_id` = '$items_id' AND `".$this->getTable()."`.`users_id` = '$users_id'"); } /** * @see CommonDBTM::post_updateItem() **/ function post_updateItem($history=1) { $alert = new Alert(); $alert->clear($this->getType(), $this->fields['id'], Alert::ACTION); parent::post_updateItem($history); } /** * Manage recall set * * @param $data array of data to manage **/ static function manageDatas(array $data) { // Check data informations if (!isset($data['itemtype']) || !isset($data['items_id']) || !isset($data['users_id']) || !isset($data['before_time']) || !isset($data['field'])) { return false; } $pr = new self(); // Datas OK : check if recall already exists if ($pr->getFromDBForItemAndUser($data['itemtype'], $data['items_id'], $data['users_id'])) { if ($data['before_time'] != $pr->fields['before_time']) { // Recall exists and is different : update datas and clean alert if ($pr->can($pr->fields['id'],'w')) { if ($item = getItemForItemtype($data['itemtype'])) { if ($item->getFromDB($data['items_id']) && isset($item->fields[$data['field']]) && !empty($item->fields[$data['field']])) { $when = date("Y-m-d H:i:s", strtotime($item->fields[$data['field']]) - $data['before_time']); if ($data['before_time'] >= 0) { $pr->update(array('id' => $pr->fields['id'], 'before_time' => $data['before_time'], 'when' => $when)); } else { $pr->delete(array('id' => $pr->fields['id'])); } } } } } } else { // Recall does not exists : create it if ($pr->can(-1,'w',$data)) { if ($item = getItemForItemtype($data['itemtype'])) { $item->getFromDB($data['items_id']); if ($item->getFromDB($data['items_id']) && isset($item->fields[$data['field']]) && !empty($item->fields[$data['field']])) { $data['when'] = date("Y-m-d H:i:s", strtotime($item->fields[$data['field']]) - $data['before_time']); if ($data['before_time'] >= 0) { $pr->add($data); } } } } } } /** * Update planning recal date when changing begin of planning * * @param $itemtype string itemtype to get * @param $items_id integer id of the item * @param $begin datetime new begin date * * @return true if succeed else false **/ static function managePlanningUpdates($itemtype, $items_id, $begin) { global $DB; $query = "UPDATE `glpi_planningrecalls` SET `when` = DATE_SUB('$begin', INTERVAL `before_time` SECOND) WHERE `itemtype` = '$itemtype' AND `items_id` = '$items_id';"; return $DB->query($query); } /** * Make a select box with recall times * * Mandatory options : itemtype, items_id * * @param $options array of possible options: * - itemtype : string itemtype * - items_id : integer id of the item * - users_id : integer id of the user (if not set used login user) * - value : integer preselected value for before_time * - field : string field used as time mark (default begin) * * @return nothing (print out an HTML select box) / return false if mandatory fields are not ok **/ static function dropdown($options=array()) { global $DB, $CFG_GLPI; // Default values $p['itemtype'] = ''; $p['items_id'] = 0; $p['users_id'] = Session::getLoginUserID(); $p['value'] = Entity::CONFIG_NEVER; $p['field'] = 'begin'; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } if (!($item = getItemForItemtype($p['itemtype']))) { return false; } // Do not check items_id and item get because may be used when creating item (task for example) $pr = new self(); // Get recall for item and user if ($pr->getFromDBForItemAndUser($p['itemtype'], $p['items_id'], $p['users_id'])) { $p['value'] = $pr->fields['before_time']; } $possible_values = array(); $possible_values[Entity::CONFIG_NEVER] = __('None'); $min_values = array(0, 15, 30, 45); foreach ($min_values as $val) { $possible_values[$val*MINUTE_TIMESTAMP] = sprintf(_n('%d minute','%d minutes',$val), $val); } $h_values = array(1, 2, 3, 4, 12); foreach ($h_values as $val) { $possible_values[$val*HOUR_TIMESTAMP] = sprintf(_n('%d hour','%d hours',$val), $val); } $d_values = array(1, 2); foreach ($d_values as $val) { $possible_values[$val*DAY_TIMESTAMP] = sprintf(_n('%d day','%d days',$val), $val); } $w_values = array(1); foreach ($w_values as $val) { $possible_values[$val*7*DAY_TIMESTAMP] = sprintf(_n('%d week','%d weeks',$val), $val); } ksort($possible_values); Dropdown::showFromArray('_planningrecall[before_time]', $possible_values, array('value' => $p['value'])); echo ""; echo ""; echo ""; echo ""; return true; } /** * Dispaly specific form when no edit right * * Mandatory options : itemtype, items_id * * @param $options array of possible options: * - itemtype : string itemtype * - items_id : integer id of the item * - users_id : integer id of the user (if not set used login user) * - value : integer preselected value for before_time * - field : string field used as time mark (default begin) * * @return nothing (print out an HTML select box) / return false if mandatory fields are not ok **/ static function specificForm($options=array()) { global $CFG_GLPI; // Default values $p['itemtype'] = ''; $p['items_id'] = 0; $p['users_id'] = Session::getLoginUserID(); $p['value'] = Entity::CONFIG_NEVER; $p['field'] = 'begin'; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } if (!($item = getItemForItemtype($p['itemtype']))) { return false; } // Do not check items_id and item get because may be used when creating item (task for example) echo ""; self::dropdown($options); echo " "; Html::closeForm(); } /** * Give cron information * * @param $name : task's name * * @return arrray of information **/ static function cronInfo($name) { switch ($name) { case 'planningrecall' : return array('description' => __('Send planning recalls')); } return array(); } /** * Cron action on contracts : alert depending of the config : on notice and expire * * @param $task for log, if NULL display (default NULL) **/ static function cronPlanningRecall($task=NULL) { global $DB, $CFG_GLPI; if (!$CFG_GLPI["use_mailing"]) { return 0; } $cron_status = 0; $query = "SELECT `glpi_planningrecalls`.* FROM `glpi_planningrecalls` LEFT JOIN `glpi_alerts` ON (`glpi_planningrecalls`.`id` = `glpi_alerts`.`items_id` AND `glpi_alerts`.`itemtype` = 'PlanningRecall' AND `glpi_alerts`.`type`='".Alert::ACTION."') WHERE `glpi_planningrecalls`.`when` IS NOT NULL AND `glpi_planningrecalls`.`when` < NOW() AND `glpi_alerts`.`date` IS NULL"; $pr = new self(); foreach ($DB->request($query) as $data) { if ($pr->getFromDB($data['id'])) { if (NotificationEvent::raiseEvent('planningrecall', $pr)) { $cron_status = 1; $task->addVolume(1); $alert = new Alert(); $input["itemtype"] = __CLASS__; $input["type"] = Alert::ACTION; $input["items_id"] = $data['id']; $alert->add($input); } } } return $cron_status; } } ?> glpi-0.84.3+dfsg.1/inc/plugin.class.php000066400000000000000000001235031226600447100175110ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ // Based on cacti plugin system /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class Plugin extends CommonDBTM { // Class constant : Plugin state const ANEW = 0; const ACTIVATED = 1; const NOTINSTALLED = 2; const TOBECONFIGURED = 3; const NOTACTIVATED = 4; const TOBECLEANED = 5; const NOTUPDATED = 6; /** * Retrieve an item from the database using its directory * * @param $dir directory of the plugin * * @return true if succeed else false **/ function getFromDBbyDir($dir) { return $this->getFromDBByQuery("WHERE `".$this->getTable()."`.`directory` = '$dir'"); } /** * Init plugins list reading plugins directory * * @return nothing **/ function init() { $this->checkStates(); $plugins = $this->find('state='.self::ACTIVATED); $_SESSION["glpi_plugins"] = array(); if (count($plugins)) { foreach ($plugins as $ID => $plug) { $_SESSION["glpi_plugins"][$ID] = $plug['directory']; } } } /** * Init a plugin including setup.php file * launching plugin_init_NAME function after checking compatibility * * @param $name Name of hook to use * @param $withhook boolean to load hook functions (false by default) * * @return nothing **/ static function load($name, $withhook=false) { global $LOADED_PLUGINS; if (file_exists(GLPI_ROOT . "/plugins/$name/setup.php")) { include_once(GLPI_ROOT . "/plugins/$name/setup.php"); if (!isset($LOADED_PLUGINS[$name])) { self::loadLang($name); $function = "plugin_init_$name"; if (function_exists($function)) { $function(); $LOADED_PLUGINS[$name] = $name; } } } if ($withhook && file_exists(GLPI_ROOT . "/plugins/$name/hook.php")) { include_once(GLPI_ROOT . "/plugins/$name/hook.php"); } } /** * Load lang file for a plugin * * @param $name Name of hook to use * @param $forcelang force a specific lang (default '') * @param $coretrytoload lang trying to be load from core (default '') * * @return nothing **/ static function loadLang($name, $forcelang='', $coretrytoload='') { // $LANG needed : used when include lang file global $CFG_GLPI, $LANG, $TRANSLATE; // For compatibility for plugins using $LANG $trytoload = 'en_GB'; if (isset($_SESSION['glpilanguage'])) { $trytoload = $_SESSION["glpilanguage"]; } // Force to load a specific lang if (!empty($forcelang)) { $trytoload = $forcelang; } // If not set try default lang file if (empty($trytoload)) { $trytoload = $CFG_GLPI["language"]; } if (empty($coretrytoload)) { $coretrytoload = $trytoload; } $dir = GLPI_ROOT . "/plugins/$name/locales/"; $translation_included = false; // New localisation system if (file_exists($dir.$CFG_GLPI["languages"][$trytoload][1])) { $TRANSLATE->addTranslationFile('gettext', $dir.$CFG_GLPI["languages"][$trytoload][1], $name, $coretrytoload); $translation_included = true; } else if (!empty($CFG_GLPI["language"]) && file_exists($dir.$CFG_GLPI["languages"][$CFG_GLPI["language"]][1])) { $TRANSLATE->addTranslationFile('gettext', $dir.$CFG_GLPI["languages"][$CFG_GLPI["language"]][1], $name, $coretrytoload); $translation_included = true; } else if (file_exists($dir."en_GB.mo")) { $TRANSLATE->addTranslationFile('gettext', $dir."en_GB.mo", $name, $coretrytoload); $translation_included = true; } if (!$translation_included) { if (file_exists($dir.$trytoload.'.php')) { include ($dir.$trytoload.'.php'); } else if (file_exists($dir.$CFG_GLPI["language"].'.php')) { include ($dir.$CFG_GLPI["language"].'.php'); } else if (file_exists($dir . "en_GB.php")) { include ($dir . "en_GB.php"); } else if (file_exists($dir . "fr_FR.php")) { include ($dir . "fr_FR.php"); } } } /** * Check plugins states and detect new plugins **/ function checkStates() { //// Get all plugins // Get all from DBs $pluglist = $this->find("","name, directory"); $db_plugins = array(); if (count($pluglist)) { foreach ($pluglist as $plug) { $db_plugins[$plug['directory']] = $plug['id']; } } // Parse plugin dir $file_plugins = array(); $error_plugins = array(); $dirplug = GLPI_ROOT."/plugins"; $dh = opendir($dirplug); while (false !== ($filename = readdir($dh))) { if (($filename != ".svn") && ($filename != ".") && ($filename != "..") && is_dir($dirplug."/".$filename)) { // Find version if (file_exists($dirplug."/".$filename."/setup.php")) { self::loadLang($filename); include_once($dirplug."/".$filename."/setup.php"); $info = self::getInfo($filename); if (count($info)) { $file_plugins[$filename] = Toolbox::addslashes_deep($info); } } } } // check plugin state foreach ($db_plugins as $plug => $ID) { $install_ok = true; // Check file if (!isset($file_plugins[$plug])) { $this->update(array('id' => $ID, 'state' => self::TOBECLEANED)); $install_ok = false; } else { // Check version if ($file_plugins[$plug]['version'] != $pluglist[$ID]['version']) { $input = $file_plugins[$plug]; $input['id'] = $ID; if ($pluglist[$ID]['version']) { $input['state'] = self::NOTUPDATED; } $this->update($input); $install_ok = false; } } // Check install is ok for activated plugins if ($install_ok && ($pluglist[$ID]['state'] == self::ACTIVATED)) { $usage_ok = true; $function = "plugin_".$plug."_check_prerequisites"; if (function_exists($function)) { if (!$function()) { $usage_ok = false; } } $function = "plugin_".$plug."_check_config"; if (function_exists($function)) { if (!$function()) { $usage_ok = false; } } else { $usage_ok = false; } if (!$usage_ok) { $input = $file_plugins[$plug]; $this->unactivate($ID); } } // Delete plugin for file list if (isset($file_plugins[$plug])) { unset($file_plugins[$plug]); } } if (count($file_plugins)) { foreach ($file_plugins as $plug => $data) { if (isset($data['oldname'])) { $checking = $pluglist; foreach ($checking as $check) { if (isset($check['directory']) && ($check['directory'] == $data['oldname'])) { $data['state'] = self::NOTUPDATED; $this->delete(array('id' => $check['id'])); } } } else { $data['state'] = self::NOTINSTALLED; } $data['directory'] = $plug; $this->add($data); } } } /** * Check if all plugins are CSRF compliant * * @since version 0.83.3 **/ static function isAllPluginsCSRFCompliant() { global $PLUGIN_HOOKS; if (isset($_SESSION['glpi_plugins']) && is_array($_SESSION['glpi_plugins']) && count($_SESSION['glpi_plugins'])) { foreach ($_SESSION['glpi_plugins'] as $plug) { if (!isset($PLUGIN_HOOKS['csrf_compliant'][$plug]) || !$PLUGIN_HOOKS['csrf_compliant'][$plug]) { return false; } } } return true; } /** * List availabled plugins **/ function listPlugins() { global $CFG_GLPI, $PLUGIN_HOOKS; $this->checkStates(); echo "
    "; $pluglist = $this->find("", "name, directory"); $i = 0; $PLUGIN_HOOKS_SAVE = $PLUGIN_HOOKS; echo "\n"; if (!empty($pluglist)) { echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; foreach ($pluglist as $ID => $plug) { if (function_exists("plugin_".$plug['directory']."_check_config")) { // init must not be called for incompatible plugins self::load($plug['directory'], true); } $i++; $class = 'tab_bg_1'; if (($i%2) == 0) { $class = 'tab_bg_2'; } echo ""; echo ""; echo ""; echo ""; $weblink = trim($plug['homepage']); echo ""; // CSRF echo ""; switch ($plug['state']) { case self::ACTIVATED : echo ""; echo ""; break; case self::ANEW : case self::NOTINSTALLED : case self::NOTUPDATED : echo ""; break; case self::TOBECONFIGURED : echo ""; break; case self::NOTACTIVATED : echo ""; break; case self::TOBECLEANED : default : echo ""; break; } echo "\n"; } } else { echo ""; } echo "
    ".__('Plugins list')."
    ".__('Name').""._n('Version', 'Versions',1)."".__('License')."".__('Status').""._n('Author', 'Authors',2)."".__('Website')."".__('CSRF compliant')." 
    "; $name = trim($plug['name']); if (empty($name)) { $plug['name'] = $plug['directory']; } // Only config for install plugins if (in_array($plug['state'], array(self::ACTIVATED, self::TOBECONFIGURED, self::NOTACTIVATED)) && isset($PLUGIN_HOOKS['config_page'][$plug['directory']])) { echo " ".$plug['name'].""; } else { echo $plug['name']; } echo "".$plug['version'].""; if ($plug['license']) { $link = ''; if (file_exists(GLPI_ROOT.'/plugins/'.$plug['directory'].'/LICENSE')) { $link = $CFG_GLPI['root_doc'].'/plugins/'.$plug['directory'].'/LICENSE'; } else if (file_exists(GLPI_ROOT.'/plugins/'.$plug['directory'].'/COPYING.txt')) { $link = $CFG_GLPI['root_doc'].'/plugins/'.$plug['directory'].'/COPYING.txt'; } if ($link) { echo "".$plug['license'].""; } else { echo $plug['license']; } } else { echo " "; } echo ""; switch ($plug['state']) { case self::ANEW : echo _x('plugin', 'New'); break; case self::ACTIVATED : echo _x('plugin', 'Enabled'); break; case self::NOTINSTALLED : echo _x('plugin', 'Not installed'); break; case self::NOTUPDATED : _e('To update'); break; case self::TOBECONFIGURED : echo _x('plugin', 'Installed / not configured'); break; case self::NOTACTIVATED : echo _x('plugin', 'Installed / not activated'); break; case self::TOBECLEANED : default: _e('Error / to clean'); break; } echo "".$plug['author'].""; if (!empty($weblink)) { echo ""; echo "\""."; } else { echo " "; } echo ""; if (isset($PLUGIN_HOOKS['csrf_compliant'][$plug['directory']]) && $PLUGIN_HOOKS['csrf_compliant'][$plug['directory']]) { _e('Yes'); } else { echo ""; _e('No'); echo ""; } echo ""; Html::showSimpleForm(static::getFormURL(), array('action' => 'unactivate'), _x('button','Disable'), array('id' => $ID)); echo ""; if (function_exists("plugin_".$plug['directory']."_uninstall")) { Html::showSimpleForm(static::getFormURL(), array('action' => 'uninstall'), _x('button','Uninstall'), array('id' => $ID)); } else { //TRANS: %s is the list of missing functions echo sprintf(__('%1$s: %2$s'), __('Non-existent function'), "plugin_".$plug['directory']."_uninstall"); } echo ""; if (function_exists("plugin_".$plug['directory']."_install") && function_exists("plugin_".$plug['directory']."_check_config")) { $function = 'plugin_' . $plug['directory'] . '_check_prerequisites'; $do_install = true; if (function_exists($function)) { $do_install = $function(); } if ($plug['state'] == self::NOTUPDATED) { $msg = _x('button', 'Upgrade'); } else { $msg = _x('button', 'Install'); } if ($do_install) { Html::showSimpleForm(static::getFormURL(), array('action' => 'install'), $msg, array('id' => $ID)); } } else { $missing = ''; if (!function_exists("plugin_".$plug['directory']."_install")) { $missing .= "plugin_".$plug['directory']."_install"; } if (!function_exists("plugin_".$plug['directory']."_check_config")) { $missing .= " plugin_".$plug['directory']."_check_config"; } //TRANS: %s is the list of missing functions printf(__('%1$s: %2$s'), __('Non-existent function'), $missing); } echo ""; if (function_exists("plugin_".$plug['directory']."_uninstall")) { if (function_exists("plugin_".$plug['directory']."_check_config")) { Html::showSimpleForm(static::getFormURL(), array('action' => 'uninstall'), _x('button','Uninstall'), array('id' => $ID)); } else { // This is an incompatible plugin (0.71), uninstall fonction could crash echo " "; } } else { printf(__('%1$s: %2$s'), __('Non-existent function'), "plugin_".$plug['directory']."_uninstall"); } echo ""; $function = 'plugin_' . $plug['directory'] . '_check_config'; if (function_exists($function)) { if ($function(true)) { $this->update(array('id' => $ID, 'state' => self::NOTACTIVATED)); Html::redirect($this->getSearchURL()); } } else { printf(__('%1$s: %2$s'), __('Non-existent function'), "plugin_".$plug['directory']."_check_config"); } echo ""; if (function_exists("plugin_".$plug['directory']."_uninstall")) { Html::showSimpleForm(static::getFormURL(), array('action' => 'uninstall'), _x('button','Uninstall'), array('id' => $ID)); } else { printf(__('%1$s: %2$s'), __('Non-existent function'), "plugin_".$plug['directory']."_uninstall"); } echo ""; $function = 'plugin_' . $plug['directory'] . '_check_prerequisites'; if (!isset($PLUGIN_HOOKS['csrf_compliant'][$plug['directory']]) || !$PLUGIN_HOOKS['csrf_compliant'][$plug['directory']]) { _e('Not CSRF compliant'); } else if (function_exists($function) && $function()) { Html::showSimpleForm(static::getFormURL(), array('action' => 'activate'), _x('button','Enable'), array('id' => $ID)); } // Else : reason displayed by the plugin echo ""; if (function_exists("plugin_".$plug['directory']."_uninstall")) { Html::showSimpleForm(static::getFormURL(), array('action' => 'uninstall'), _x('button','Uninstall'), array('id' => $ID)); } else { printf(__('%1$s: %2$s'), __('Non-existent function'), "plugin_".$plug['directory']."_uninstall"); } echo ""; Html::showSimpleForm(static::getFormURL(), array('action' => 'clean'), _x('button','Clean'), array('id' => $ID)); echo "
    ".__('No plugin installed'). "
    "; echo "
    "; echo ""; $PLUGIN_HOOKS = $PLUGIN_HOOKS_SAVE; } /** * uninstall a plugin * * @param $ID ID of the plugin **/ function uninstall($ID) { if ($this->getFromDB($ID)) { CronTask::Unregister($this->fields['directory']); self::load($this->fields['directory'],true); FieldUnicity::deleteForItemtype($this->fields['directory']); // Run the Plugin's Uninstall Function first $function = 'plugin_' . $this->fields['directory'] . '_uninstall'; if (function_exists($function)) { $function(); } $this->update(array('id' => $ID, 'state' => self::NOTINSTALLED, 'version' => '')); $this->removeFromSession($this->fields['directory']); } } /** * install a plugin * * @param $ID ID of the plugin **/ function install($ID) { if ($this->getFromDB($ID)) { self::load($this->fields['directory'],true); $function = 'plugin_' . $this->fields['directory'] . '_install'; $install_ok = false; if (function_exists($function)) { if ($function()) { $function = 'plugin_' . $this->fields['directory'] . '_check_config'; if (function_exists($function)) { if ($function()) { $this->update(array('id' => $ID, 'state' => self::NOTACTIVATED)); } else { $this->update(array('id' => $ID, 'state' => self::TOBECONFIGURED)); } } } } } } /** * activate a plugin * * @param $ID ID of the plugin **/ function activate($ID) { global $PLUGIN_HOOKS; if ($this->getFromDB($ID)) { self::load($this->fields['directory'],true); // No activation if not CSRF compliant if (!isset($PLUGIN_HOOKS['csrf_compliant'][$this->fields['directory']]) || !$PLUGIN_HOOKS['csrf_compliant'][$this->fields['directory']]) { return false; } $function = 'plugin_' . $this->fields['directory'] . '_check_prerequisites'; if (function_exists($function)) { if (!$function()) { return false; } } $function = 'plugin_' . $this->fields['directory'] . '_check_config'; if (function_exists($function)) { if ($function()) { $this->update(array('id' => $ID, 'state' => self::ACTIVATED)); $_SESSION['glpi_plugins'][$ID] = $this->fields['directory']; // Initialize session for the plugin if (isset($PLUGIN_HOOKS['init_session'][$this->fields['directory']]) && is_callable($PLUGIN_HOOKS['init_session'][$this->fields['directory']])) { call_user_func($PLUGIN_HOOKS['init_session'][$this->fields['directory']]); } // Initialize profile for the plugin if (isset($PLUGIN_HOOKS['change_profile'][$this->fields['directory']]) && is_callable($PLUGIN_HOOKS['change_profile'][$this->fields['directory']])) { call_user_func($PLUGIN_HOOKS['change_profile'][$this->fields['directory']]); } } } // exists _check_config } // getFromDB } /** * unactivate a plugin * * @param $ID ID of the plugin **/ function unactivate($ID) { if ($this->getFromDB($ID)) { $this->update(array('id' => $ID, 'state' => self::NOTACTIVATED)); $this->removeFromSession($this->fields['directory']); } } /** * unactivate all activated plugins for update process **/ function unactivateAll() { global $DB; $query = "UPDATE `".$this->getTable()."` SET `state` = ".self::NOTACTIVATED." WHERE `state` = ".self::ACTIVATED; $DB->query($query); $_SESSION['glpi_plugins'] = array(); } /** * clean a plugin * * @param $ID ID of the plugin **/ function clean($ID) { if ($this->getFromDB($ID)) { // Clean crontask after "hard" remove CronTask::Unregister($this->fields['directory']); $this->delete(array('id' => $ID)); $this->removeFromSession($this->fields['directory']); } } /** * is a plugin activated * * @param $plugin plugin directory **/ function isActivated($plugin) { if ($this->getFromDBbyDir($plugin)) { return ($this->fields['state'] == self::ACTIVATED); } } /** * is a plugin installed * * @param $plugin plugin directory **/ function isInstalled($plugin) { if ($this->getFromDBbyDir($plugin)) { return (($this->fields['state'] == self::ACTIVATED) || ($this->fields['state'] == self::TOBECONFIGURED) || ($this->fields['state'] == self::NOTACTIVATED)); } } /** * remove plugin from session variable * * @param $plugin plugin directory **/ function removeFromSession($plugin) { $key = array_search($plugin,$_SESSION['glpi_plugins']); if ($key !== false) { unset($_SESSION['glpi_plugins'][$key]); } } /** * Migrate itemtype from integer (0.72) to string (0.80) * * @param $types array of (num=>name) of type manage by the plugin * @param $glpitables array of GLPI table name used by the plugin * @param $plugtables array of Plugin table name which have an itemtype * * @return nothing **/ static function migrateItemType($types=array(), $glpitables=array(), $plugtables=array()) { global $DB; $typetoname = array(0 => "",// For tickets 1 => "Computer", 2 => "NetworkEquipment", 3 => "Printer", 4 => "Monitor", 5 => "Peripheral", 6 => "Software", 7 => "Contact", 8 => "Supplier", 9 => "Infocom", 10 => "Contract", 11 => "CartridgeItem", 12 => "DocumentType", 13 => "Document", 14 => "KnowbaseItem", 15 => "User", 16 => "Ticket", 17 => "ConsumableItem", 18 => "Consumable", 19 => "Cartridge", 20 => "SoftwareLicense", 21 => "Link", 22 => "State", 23 => "Phone", 24 => "Device", 25 => "Reminder", 26 => "Stat", 27 => "Group", 28 => "Entity", 29 => "ReservationItem", 30 => "AuthMail", 31 => "AuthLDAP", 32 => "OcsServer", 33 => "RegistryKey", 34 => "Profile", 35 => "MailCollector", 36 => "Rule", 37 => "Transfer", 38 => "Bookmark", 39 => "SoftwareVersion", 40 => "Plugin", 41 => "ComputerDisk", 42 => "NetworkPort", 43 => "TicketFollowup", 44 => "Budget"); //Add plugins types $typetoname = self::doHookFunction("migratetypes",$typetoname); foreach ($types as $num => $name) { $typetoname[$num] = $name; foreach ($glpitables as $table) { $query = "UPDATE `$table` SET `itemtype` = '$name' WHERE `itemtype` = '$num'"; $DB->queryOrDie($query, "update itemtype of table $table for $name"); } } if (in_array('glpi_infocoms', $glpitables)) { $entities = getAllDatasFromTable('glpi_entities'); $entities[0] = "Root"; foreach ($types as $num => $name) { $itemtable = getTableForItemType($name); if (!TableExists($itemtable)) { // Just for security, shouldn't append continue; } $do_recursive = false; if (FieldExists($itemtable,'is_recursive')) { $do_recursive = true; } foreach ($entities as $entID => $val) { if ($do_recursive) { // Non recursive ones $query3 = "UPDATE `glpi_infocoms` SET `entities_id` = '$entID', `is_recursive` = '0' WHERE `itemtype` = '$name' AND `items_id` IN (SELECT `id` FROM `$itemtable` WHERE `entities_id` = '$entID' AND `is_recursive` = '0')"; $DB->queryOrDie($query3, "update entities_id and is_recursive=0 in glpi_infocoms for $name"); // Recursive ones $query3 = "UPDATE `glpi_infocoms` SET `entities_id` = '$entID', `is_recursive` = '1' WHERE `itemtype` = '$name' AND `items_id` IN (SELECT `id` FROM `$itemtable` WHERE `entities_id` = '$entID' AND `is_recursive` = '1')"; $DB->queryOrDie($query3, "update entities_id and is_recursive=1 in glpi_infocoms for $name"); } else { $query3 = "UPDATE `glpi_infocoms` SET `entities_id` = '$entID' WHERE `itemtype` = '$name' AND `items_id` IN (SELECT `id` FROM `$itemtable` WHERE `entities_id` = '$entID')"; $DB->queryOrDie($query3, "update entities_id in glpi_infocoms for $name"); } } // each entity } // each plugin type } foreach ($typetoname as $num => $name) { foreach ($plugtables as $table) { $query = "UPDATE `$table` SET `itemtype` = '$name' WHERE `itemtype` = '$num'"; $DB->queryOrDie($query, "update itemtype of table $table for $name"); } } } /** * @param $width **/ function showSystemInformations($width) { // No need to translate, this part always display in english (for copy/paste to forum) echo "\nPlugins list"; echo "
    \n \n";
    
          $plug     = new Plugin();
          $pluglist = $plug->find("","name, directory");
          foreach ($pluglist as $plugin) {
             $msg  = substr(str_pad($plugin['directory'],30),0,20).
                     " Name: ".Toolbox::substr(str_pad($plugin['name'],40),0,30).
                     " Version: ".str_pad($plugin['version'],10).
                     " State: ";
    
             switch ($plugin['state']) {
                case self::ANEW :
                   $msg .=  'New';
                   break;
    
                case self::ACTIVATED :
                   $msg .=  'Enabled';
                   break;
    
                case self::NOTINSTALLED :
                   $msg .=  'Not installed';
                   break;
    
                case self::TOBECONFIGURED :
                   $msg .=  'To be configured';
                   break;
    
                case self::NOTACTIVATED :
                   $msg .=  'Not activated';
                   break;
    
                case self::TOBECLEANED :
                default :
                   $msg .=  'To be cleaned';
                   break;
             }
             echo wordwrap("\t".$msg."\n", $width, "\n\t\t");
          }
          echo "\n
    "; } /** * Define a new class managed by a plugin * * @param $itemtype class name * @param $attrib array of attributes, a hashtable with index in * (classname, typename, reservation_types) * * @return bool **/ static function registerClass($itemtype, $attrib=array()) { global $CFG_GLPI; $plug = isPluginItemType($itemtype); if (!$plug) { return false; } $plugin = strtolower($plug['plugin']); if (isset($attrib['doc_types'])) { $attrib['document_types'] = $attrib['doc_types']; unset($attrib['doc_types']); } if (isset($attrib['helpdesk_types'])) { $attrib['ticket_types'] = $attrib['helpdesk_types']; unset($attrib['helpdesk_types']); } if (isset($attrib['netport_types'])) { $attrib['networkport_types'] = $attrib['netport_types']; unset($attrib['netport_types']); } foreach (array('contract_types', 'directconnect_types', 'document_types', 'helpdesk_visible_types', 'infocom_types', 'linkgroup_tech_types', 'linkgroup_types', 'linkuser_tech_types', 'linkuser_types', 'networkport_instantiations', 'networkport_types', 'notificationtemplates_types', 'planning_types', 'reservation_types', 'rulecollections_types', 'systeminformations_types', 'ticket_types', 'unicity_types') as $att) { if (isset($attrib[$att]) && $attrib[$att]) { array_push($CFG_GLPI[$att], $itemtype); unset($attrib[$att]); } } if (isset($attrib['addtabon'])) { if (!is_array($attrib['addtabon'])) { $attrib['addtabon'] = array($attrib['addtabon']); } foreach ($attrib['addtabon'] as $form) { CommonGLPI::registerStandardTab($form, $itemtype); } } //Manage entity forward from a source itemtype to this itemtype if (isset($attrib['forwardentityfrom'])) { CommonDBTM::addForwardEntity($attrib['forwardentityfrom'], $itemtype); } // Use it for plugin debug // if (count($attrib)) { // foreach ($attrib as $key => $val) { // Toolbox::logInFile('debug',"Attribut $key used by $itemtype no more used for plugins\n"); // } //} return true; } /** * This function executes a hook. * * @param $name Name of hook to fire * @param $param Parameters if needed : if object limit to the itemtype (default NULL) * * @return mixed $data **/ static function doHook ($name, $param=NULL) { global $PLUGIN_HOOKS; if ($param == NULL) { $data = func_get_args(); } else { $data = $param; } // Apply hook only for the item if (($param != NULL) && is_object($param)) { $itemtype = get_class($param); if (isset($PLUGIN_HOOKS[$name]) && is_array($PLUGIN_HOOKS[$name])) { foreach ($PLUGIN_HOOKS[$name] as $plug => $tab) { if (isset($tab[$itemtype])) { if (file_exists(GLPI_ROOT . "/plugins/$plug/hook.php")) { include_once(GLPI_ROOT . "/plugins/$plug/hook.php"); } if (is_callable($tab[$itemtype])) { call_user_func($tab[$itemtype],$data); } } } } } else { // Standard hook call if (isset($PLUGIN_HOOKS[$name]) && is_array($PLUGIN_HOOKS[$name])) { foreach ($PLUGIN_HOOKS[$name] as $plug => $function) { if (file_exists(GLPI_ROOT . "/plugins/$plug/hook.php")) { include_once(GLPI_ROOT . "/plugins/$plug/hook.php"); } if (is_callable($function)) { call_user_func($function,$data); } } } } /* Variable-length argument lists have a slight problem when */ /* passing values by reference. Pity. This is a workaround. */ return $data; } /** * This function executes a hook. * * @param $name Name of hook to fire * @param $parm Parameters (default NULL) * * @return mixed $data **/ static function doHookFunction($name, $parm=NULL) { global $PLUGIN_HOOKS; $ret = $parm; if (isset($PLUGIN_HOOKS[$name]) && is_array($PLUGIN_HOOKS[$name])) { foreach ($PLUGIN_HOOKS[$name] as $plug => $function) { if (file_exists(GLPI_ROOT . "/plugins/$plug/hook.php")) { include_once(GLPI_ROOT . "/plugins/$plug/hook.php"); } if (is_callable($function)) { $ret = call_user_func($function, $ret); } } } /* Variable-length argument lists have a slight problem when */ /* passing values by reference. Pity. This is a workaround. */ return $ret; } /** * This function executes a hook for 1 plugin. * * @param $plugname Name of the plugin * @param $hook function to be called (may be an array for call a class method) * @param $options array of params passed to the function * * @return mixed $data **/ static function doOneHook($plugname, $hook, $options=array()) { $plugname=strtolower($plugname); if (!is_array($hook)) { $hook = "plugin_" . $plugname . "_" . $hook; if (file_exists(GLPI_ROOT . "/plugins/$plugname/hook.php")) { include_once(GLPI_ROOT . "/plugins/$plugname/hook.php"); } } if (is_callable($hook)) { return call_user_func($hook, $options); } } /** * Get dropdowns for plugins * * @return Array containing plugin dropdowns **/ static function getDropdowns() { $dps = array(); if (isset($_SESSION["glpi_plugins"]) && is_array($_SESSION["glpi_plugins"])) { foreach ($_SESSION["glpi_plugins"] as $plug) { $tab = self::doOneHook($plug,'getDropdown'); if (is_array($tab)) { $dps = array_merge($dps, array(self::getInfo($plug, 'name') => $tab)); } } } return $dps; } /** * get information from a plugin * * @param $plugin String name of the plugin * @param $info String wanted info (name, version, ...), NULL for all * * @since version 0.84 * * @return String or Array (when $info is NULL) **/ static function getInfo($plugin, $info=NULL) { $fct = 'plugin_version_'.strtolower($plugin); if (function_exists($fct)) { $res = $fct(); } else { $res = array(); } if (isset($info)) { return (isset($res[$info]) ? $res[$info] : ''); } return $res; } /** * Get database relations for plugins * * @return Array containing plugin database relations **/ static function getDatabaseRelations() { $dps = array(); if (isset($_SESSION["glpi_plugins"]) && is_array($_SESSION["glpi_plugins"])) { foreach ($_SESSION["glpi_plugins"] as $plug) { if (file_exists(GLPI_ROOT . "/plugins/$plug/hook.php")) { include_once(GLPI_ROOT . "/plugins/$plug/hook.php"); } $function2 = "plugin_".$plug."_getDatabaseRelations"; if (function_exists($function2)) { $dps = array_merge_recursive($dps,$function2()); } } } return $dps; } /** * Get additional search options managed by plugins * * @param $itemtype * * @return Array containing plugin search options for given type **/ static function getAddSearchOptions($itemtype) { global $PLUGIN_HOOKS; $sopt = array(); if (isset($_SESSION['glpi_plugins']) && count($_SESSION['glpi_plugins'])) { foreach ($_SESSION['glpi_plugins'] as $plug) { if (file_exists(GLPI_ROOT . "/plugins/$plug/hook.php")) { include_once(GLPI_ROOT . "/plugins/$plug/hook.php"); } $function = "plugin_".$plug."_getAddSearchOptions"; if (function_exists($function)) { $tmp = $function($itemtype); if (count($tmp)) { $sopt += $tmp; } } } } return $sopt; } /** * test is a import plugin is enable * * @return boolean * * @since 0.84 **/ static function haveImport() { global $PLUGIN_HOOKS; return (isset($PLUGIN_HOOKS['import_item']) && count($PLUGIN_HOOKS['import_item'])); } } ?> glpi-0.84.3+dfsg.1/inc/preference.class.php000066400000000000000000000032571226600447100203340ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // class Preference for the current connected User class Preference extends CommonGLPI { static function getTypeName($nb=0) { // Always plural return __('Settings'); } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('User', $ong, $options); $this->addStandardTab('Config', $ong, $options); $this->addStandardTab('DisplayPreference', $ong, $options); $ong['no_all_tab'] = true; return $ong; } } ?> glpi-0.84.3+dfsg.1/inc/printer.class.php000066400000000000000000000700461226600447100177010ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // CLASSES Printers class Printer extends CommonDBTM { // From CommonDBTM public $dohistory = true; static protected $forward_entity_to = array('Infocom', 'NetworkPort', 'ReservationItem'); /** * Name of the type * * @param $nb : number of item in the type **/ static function getTypeName($nb=0) { return _n('Printer', 'Printers', $nb); } static function canCreate() { return Session::haveRight('printer', 'w'); } static function canView() { return Session::haveRight('printer', 'r'); } /** * @see CommonDBTM::useDeletedToLockIfDynamic() * * @since version 0.84 **/ function useDeletedToLockIfDynamic() { return false; } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('Cartridge', $ong, $options); $this->addStandardTab('Computer_Item', $ong, $options); $this->addStandardTab('NetworkPort', $ong, $options); $this->addStandardTab('Infocom', $ong, $options); $this->addStandardTab('Contract_Item', $ong, $options); $this->addStandardTab('Document_Item', $ong, $options); $this->addStandardTab('Ticket', $ong, $options); $this->addStandardTab('Item_Problem', $ong, $options); $this->addStandardTab('Link', $ong, $options); $this->addStandardTab('Note', $ong, $options); $this->addStandardTab('Reservation', $ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } /** * Can I change recusvive flag to false * check if there is "linked" object in another entity * * Overloaded from CommonDBTM * * @return booleen **/ function canUnrecurs() { global $DB, $CFG_GLPI; $ID = $this->fields['id']; if (($ID < 0) || !$this->fields['is_recursive']) { return true; } if (!parent::canUnrecurs()) { return false; } $entities = "(".$this->fields['entities_id']; foreach (getAncestorsOf("glpi_entities",$this->fields['entities_id']) as $papa) { $entities .= ",$papa"; } $entities .= ")"; // RELATION : printers -> _port -> _wire -> _port -> device // Evaluate connection in the 2 ways for ($tabend = array("networkports_id_1" => "networkports_id_2", "networkports_id_2" => "networkports_id_1") ; list($enda, $endb) = each($tabend) ; ) { $sql = "SELECT `itemtype`, GROUP_CONCAT(DISTINCT `items_id`) AS ids FROM `glpi_networkports_networkports`, `glpi_networkports` WHERE `glpi_networkports_networkports`.`$endb` = `glpi_networkports`.`id` AND `glpi_networkports_networkports`.`$enda` IN (SELECT `id` FROM `glpi_networkports` WHERE `itemtype` = '".$this->getType()."' AND `items_id` = '$ID') GROUP BY `itemtype`"; $res = $DB->query($sql); if ($res) { while ($data = $DB->fetch_assoc($res)) { $itemtable = getTableForItemType($data["itemtype"]); if ($item = getItemForItemtype($data["itemtype"])) { // For each itemtype which are entity dependant if ($item->isEntityAssign()) { if (countElementsInTable($itemtable, "`id` IN (".$data["ids"].") AND `entities_id` NOT IN $entities") > 0) { return false; } } } } } } return true; } function prepareInputForAdd($input) { if (isset($input["id"]) && ($input["id"] > 0)) { $input["_oldID"]=$input["id"]; } unset($input['id']); unset($input['withtemplate']); if (isset($input['init_pages_counter'])) { $input['init_pages_counter'] = intval($input['init_pages_counter']); } else { $input['init_pages_counter'] = 0; } if (isset($input['last_pages_counter'])) { $input['last_pages_counter'] = intval($input['last_pages_counter']); } else { $input['last_pages_counter'] = $input['init_pages_counter']; } return $input; } function prepareInputForUpdate($input) { if (isset($input['init_pages_counter'])) { $input['init_pages_counter'] = intval($input['init_pages_counter']); } if (isset($input['last_pages_counter'])) { $input['last_pages_counter'] = intval($input['last_pages_counter']); } return $input; } function post_addItem() { global $DB, $CFG_GLPI; // Manage add from template if (isset($this->input["_oldID"])) { // ADD Infocoms Infocom::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); // ADD Ports NetworkPort::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); // ADD Contract Contract_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); // ADD Documents Document_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); // ADD Computers Computer_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); } } function cleanDBonPurge() { global $DB; $query = "SELECT `id` FROM `glpi_computers_items` WHERE `itemtype` = '".$this->getType()."' AND `items_id` = '".$this->fields['id']."'"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { $conn = new Computer_Item(); while ($data = $DB->fetch_assoc($result)) { $data['_no_auto_action'] = true; $conn->delete($data); } } } $query = "UPDATE `glpi_cartridges` SET `printers_id` = NULL WHERE `printers_id` = '".$this->fields['id']."'"; $result = $DB->query($query); $ip = new Item_Problem(); $ip->cleanDBonItemDelete(__CLASS__, $this->fields['id']); } /** * Print the printer form * * @param $ID integer ID of the item * @param $options array of possible options: * - target filename : where to go when done. * - withtemplate boolean : template or basic item * *@return boolean item found **/ function showForm($ID, $options=array()) { global $CFG_GLPI; $target = $this->getFormURL(); $withtemplate = $this->initForm($ID, $options); $this->showTabs($options); $this->showFormHeader($options); echo ""; //TRANS: %1$s is a string, %2$s a second one without spaces between them : to change for RTL echo "".sprintf(__('%1$s%2$s'), __('Name'), (isset($options['withtemplate']) && $options['withtemplate']?"*":"")). "\n"; echo ""; $objectName = autoName($this->fields["name"], "name", (isset($options['withtemplate']) && ($options['withtemplate'] == 2)), $this->getType(), $this->fields["entities_id"]); Html::autocompletionTextField($this, 'name', array('value' => $objectName)); echo "\n"; echo "".__('Status')."\n"; echo ""; State::dropdown(array('value' => $this->fields["states_id"])); echo "\n"; echo ""; echo "".__('Location')."\n"; echo ""; Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"])); echo "\n"; echo "".__('Type')."\n"; echo ""; PrinterType::dropdown(array('value' => $this->fields["printertypes_id"])); echo "\n"; echo ""; echo "".__('Technician in charge of the hardware')."\n"; echo ""; User::dropdown(array('name' => 'users_id_tech', 'value' => $this->fields["users_id_tech"], 'right' => 'own_ticket', 'entity' => $this->fields["entities_id"])); echo "\n"; echo "".__('Manufacturer')."\n"; echo ""; Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"])); echo "\n"; echo ""; echo "".__('Group in charge of the hardware').""; echo ""; Group::dropdown(array('name' => 'groups_id_tech', 'value' => $this->fields['groups_id_tech'], 'entity' => $this->fields['entities_id'], 'condition' => '`is_assign`')); echo ""; echo "".__('Model')."\n"; echo ""; PrinterModel::dropdown(array('value' => $this->fields["printermodels_id"])); echo "\n"; echo ""; echo "".__('Alternate username number')."\n"; echo ""; Html::autocompletionTextField($this, "contact_num"); echo "\n"; echo "".__('Serial number')."\n"; echo ""; Html::autocompletionTextField($this, "serial"); echo "\n"; echo ""; echo "".__('Alternate username')."\n"; echo ""; Html::autocompletionTextField($this, "contact"); echo "\n"; echo "".sprintf(__('%1$s%2$s'), __('Inventory number'), (isset($options['withtemplate']) && $options['withtemplate']?"*":"")). "\n"; echo ""; $objectName = autoName($this->fields["otherserial"], "otherserial", (isset($options['withtemplate']) && ($options['withtemplate'] == 2)), $this->getType(), $this->fields["entities_id"]); Html::autocompletionTextField($this, 'otherserial', array('value' => $objectName)); echo "\n"; echo ""; echo "".__('User')."\n"; echo ""; User::dropdown(array('value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all')); echo "\n"; echo "".__('Management type').""; echo ""; if ($this->can($ID,'w')) { Dropdown::showGlobalSwitch($this->fields["id"], array('withtemplate' => $withtemplate, 'value' => $this->fields["is_global"], 'management_restrict' => $CFG_GLPI["printers_management_restrict"], 'target' => $target)); } else { Dropdown::showGlobalSwitch($this->fields["id"], array('withtemplate' => $withtemplate, 'value' => $this->fields["is_global"], 'target' => $target)); } echo "\n"; echo ""; echo "".__('Group')."\n"; echo ""; Group::dropdown(array('value' => $this->fields["groups_id"], 'entity' => $this->fields["entities_id"], 'condition' => '`is_itemgroup`')); echo "\n"; echo "".__('Network')."\n"; echo ""; Network::dropdown(array('value' => $this->fields["networks_id"])); echo "\n"; // Display auto inventory informations $rowspan = 6; $inventory_show = false; if (!empty($ID) && $this->fields["is_dynamic"]) { $inventory_show = true; $rowspan -= 2; } echo ""; echo "".__('Domain')."\n"; echo ""; Domain::dropdown(array('value' => $this->fields["domains_id"])); echo ""; echo "".__('Comments')."\n"; echo ""; echo "\n"; echo ""; echo "".__('Memory')."\n"; echo ""; Html::autocompletionTextField($this, "memory_size"); echo "\n"; echo ""; echo "".__('Initial page counter')."\n"; echo ""; Html::autocompletionTextField($this, "init_pages_counter", array('size' => 10)); echo "\n"; echo ""; echo "".__('Current counter of pages')."\n"; echo ""; Html::autocompletionTextField($this, "last_pages_counter", array('size' => 10)); echo "\n"; echo ""; echo ""._n('Port','Ports',2).""; echo "\n"; // serial interface echo ""; // parallel interface? echo ""; // USB interface? echo ""; // ethernet interface? echo ""; // wifi ? echo "
    ".__('Serial').""; Dropdown::showYesNo("have_serial", $this->fields["have_serial"]); echo "".__('Parallel').""; Dropdown::showYesNo("have_parallel", $this->fields["have_parallel"]); echo "
    ".__('USB').""; Dropdown::showYesNo("have_usb", $this->fields["have_usb"]); echo "".__('Ethernet').""; Dropdown::showYesNo("have_ethernet",$this->fields["have_ethernet"]); echo "
    ".__('Wifi').""; Dropdown::showYesNo("have_wifi", $this->fields["have_wifi"]); echo "
    \n"; echo ""; if ($inventory_show) { echo ""; _e('Automatic inventory'); echo ""; echo ""; Plugin::doHook("autoinventory_information", $this); echo ""; } echo ""; echo ""; echo ""; if ((!isset($options['withtemplate']) || ($options['withtemplate'] == 0)) && !empty($this->fields['template_name'])) { echo ""; printf(__('Created from the template %s'), $this->fields['template_name']); echo ""; } else { echo " "; } echo ""; if (isset($options['withtemplate']) && $options['withtemplate']) { //TRANS: %s is the datetime of insertion printf(__('Created on %s'), Html::convDateTime($_SESSION["glpi_currenttime"])); } else { //TRANS: %s is the datetime of insertion printf(__('Last update on %s'), Html::convDateTime($this->fields["date_mod"])); } echo "\n"; $this->showFormButtons($options); $this->addDivForTabs(); return true; } /** * Return the SQL command to retrieve linked object * * @return a SQL command which return a set of (itemtype, items_id) **/ function getSelectLinkedItem() { return "SELECT 'Computer', `computers_id` FROM `glpi_computers_items` WHERE `itemtype` = '".$this->getType()."' AND `items_id` = '" . $this->fields['id']."'"; } /** * @see CommonDBTM::getSpecificMassiveActions() **/ function getSpecificMassiveActions($checkitem=NULL) { $isadmin = static::canUpdate(); $actions = parent::getSpecificMassiveActions($checkitem); if ($isadmin) { $actions['connect'] = _x('button', 'Connect'); $actions['disconnect'] = _x('button', 'Disconnect'); } if (Session::haveRight('transfer','r') && Session::isMultiEntitiesMode() && $isadmin) { $actions['add_transfer_list'] = _x('button', 'Add to transfer list'); } return $actions; } /** * @see CommonDBTM::showSpecificMassiveActionsParameters() **/ function showSpecificMassiveActionsParameters($input=array()) { switch ($input['action']) { case "connect" : case "disconnect" : $ci = new Computer_Item(); return $ci->showSpecificMassiveActionsParameters($input); default : return parent::showSpecificMassiveActionsParameters($input); } return false; } /** * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "connect" : case "disconnect" : $ci = new Computer_Item(); return $ci->doSpecificMassiveActions($input); default : return parent::doSpecificMassiveActions($input); } return $res; } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab += Location::getSearchOptionsToAdd(); $tab[4]['table'] = 'glpi_printertypes'; $tab[4]['field'] = 'name'; $tab[4]['name'] = __('Type'); $tab[4]['datatype'] = 'dropdown'; $tab[40]['table'] = 'glpi_printermodels'; $tab[40]['field'] = 'name'; $tab[40]['name'] = __('Model'); $tab[40]['datatype'] = 'dropdown'; $tab[31]['table'] = 'glpi_states'; $tab[31]['field'] = 'completename'; $tab[31]['name'] = __('Status'); $tab[31]['datatype'] = 'dropdown'; $tab[5]['table'] = $this->getTable(); $tab[5]['field'] = 'serial'; $tab[5]['name'] = __('Serial number'); $tab[5]['datatype'] = 'string'; $tab[6]['table'] = $this->getTable(); $tab[6]['field'] = 'otherserial'; $tab[6]['name'] = __('Inventory number'); $tab[6]['datatype'] = 'string'; $tab[7]['table'] = $this->getTable(); $tab[7]['field'] = 'contact'; $tab[7]['name'] = __('Alternate username'); $tab[7]['datatype'] = 'string'; $tab[8]['table'] = $this->getTable(); $tab[8]['field'] = 'contact_num'; $tab[8]['name'] = __('Alternate username number'); $tab[8]['datatype'] = 'string'; $tab[70]['table'] = 'glpi_users'; $tab[70]['field'] = 'name'; $tab[70]['name'] = __('User'); $tab[70]['datatype'] = 'dropdown'; $tab[70]['right'] = 'all'; $tab[71]['table'] = 'glpi_groups'; $tab[71]['field'] = 'completename'; $tab[71]['name'] = __('Group'); $tab[71]['condition'] = '`is_itemgroup`'; $tab[71]['datatype'] = 'dropdown'; $tab[19]['table'] = $this->getTable(); $tab[19]['field'] = 'date_mod'; $tab[19]['name'] = __('Last update'); $tab[19]['datatype'] = 'datetime'; $tab[19]['massiveaction'] = false; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab[42]['table'] = $this->getTable(); $tab[42]['field'] = 'have_serial'; $tab[42]['name'] = __('Serial'); $tab[42]['datatype'] = 'bool'; $tab[43]['table'] = $this->getTable(); $tab[43]['field'] = 'have_parallel'; $tab[43]['name'] = __('Parallel'); $tab[43]['datatype'] = 'bool'; $tab[44]['table'] = $this->getTable(); $tab[44]['field'] = 'have_usb'; $tab[44]['name'] = __('USB'); $tab[44]['datatype'] = 'bool'; $tab[45]['table'] = $this->getTable(); $tab[45]['field'] = 'have_ethernet'; $tab[45]['name'] = __('Ethernet'); $tab[45]['datatype'] = 'bool'; $tab[46]['table'] = $this->getTable(); $tab[46]['field'] = 'have_wifi'; $tab[46]['name'] = __('Wifi'); $tab[46]['datatype'] = 'bool'; $tab[13]['table'] = $this->getTable(); $tab[13]['field'] = 'memory_size'; $tab[13]['name'] = __('Memory'); $tab[13]['datatype'] = 'string'; $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'init_pages_counter'; $tab[11]['name'] = __('Initial page counter'); $tab[11]['datatype'] = 'number'; $tab[11]['nosearch'] = true; // only display and histo, no index $tab[12]['table'] = $this->getTable(); $tab[12]['field'] = 'last_pages_counter'; $tab[12]['name'] = __('Current counter of pages'); $tab[12]['datatype'] = 'number'; $tab[90]['table'] = $this->getTable(); $tab[90]['field'] = 'notepad'; $tab[90]['name'] = __('Notes'); $tab[90]['massiveaction'] = false; $tab[90]['datatype'] = 'text'; $tab[32]['table'] = 'glpi_networks'; $tab[32]['field'] = 'name'; $tab[32]['name'] = __('Network'); $tab[32]['datatype'] = 'dropdown'; $tab[33]['table'] = 'glpi_domains'; $tab[33]['field'] = 'name'; $tab[33]['name'] = __('Domain'); $tab[33]['datatype'] = 'dropdown'; $tab[23]['table'] = 'glpi_manufacturers'; $tab[23]['field'] = 'name'; $tab[23]['name'] = __('Manufacturer'); $tab[23]['datatype'] = 'dropdown'; $tab[24]['table'] = 'glpi_users'; $tab[24]['field'] = 'name'; $tab[24]['linkfield'] = 'users_id_tech'; $tab[24]['name'] = __('Technician in charge of the hardware'); $tab[24]['datatype'] = 'dropdown'; $tab[24]['right'] = 'own_ticket'; $tab[49]['table'] = 'glpi_groups'; $tab[49]['field'] = 'completename'; $tab[49]['linkfield'] = 'groups_id_tech'; $tab[49]['name'] = __('Group in charge of the hardware'); $tab[49]['condition'] = '`is_assign`'; $tab[49]['datatype'] = 'dropdown'; $tab[80]['table'] = 'glpi_entities'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = __('Entity'); $tab[80]['massiveaction'] = false; $tab[80]['datatype'] = 'dropdown'; $tab[82]['table'] = $this->getTable(); $tab[82]['field'] = 'is_global'; $tab[82]['name'] = __('Global management'); $tab[82]['datatype'] = 'bool'; $tab[82]['massiveaction'] = false; $tab[86]['table'] = $this->getTable(); $tab[86]['field'] = 'is_recursive'; $tab[86]['name'] = __('Child entities'); $tab[86]['datatype'] = 'bool'; return $tab; } /** * Add a printer. If already exist in dustbin restore it * * @param $name the printer's name (need to be addslashes) * @param $manufacturer the software's manufacturer (need to be addslashes) * @param $entity the entity in which the software must be added * @param $comment comment (default '') **/ function addOrRestoreFromTrash($name, $manufacturer, $entity, $comment='') { global $DB; //Look for the software by his name in GLPI for a specific entity $query_search = "SELECT `glpi_printers`.`id`, `glpi_printers`.`is_deleted` FROM `glpi_printers` WHERE `name` = '$name' AND `is_template` = '0' AND `entities_id` = '$entity'"; $result_search = $DB->query($query_search); if ($DB->numrows($result_search) > 0) { //Printer already exists for this entity, get his ID $data = $DB->fetch_assoc($result_search); $ID = $data["id"]; // restore software if ($data['is_deleted']) { $this->removeFromTrash($ID); } } else { $ID = 0; } if (!$ID) { $ID = $this->addPrinter($name, $manufacturer, $entity, $comment); } return $ID; } /** * Create a new printer * * @param $name the printer's name (need to be addslashes) * @param $manufacturer the printer's manufacturer (need to be addslashes) * @param $entity the entity in which the printer must be added * @param $comment (default '') * * @return the printer's ID **/ function addPrinter($name, $manufacturer, $entity, $comment = '') { global $DB, $CFG_GLPI; $manufacturer_id = 0; if ($manufacturer != '') { $manufacturer_id = Dropdown::importExternal('Manufacturer', $manufacturer); } //If there's a printer in a parent entity with the same name and manufacturer $sql = "SELECT `id` FROM `glpi_printers` WHERE `manufacturers_id` = '$manufacturer_id' AND `name` = '$name' " . getEntitiesRestrictRequest('AND', 'glpi_printers', 'entities_id', $entity, true); $res_printer = $DB->query($sql); if ($printer = $DB->fetch_assoc($res_printer)) { $id = $printer["id"]; } else { $input["name"] = $name; $input["manufacturers_id"] = $manufacturer_id; $input["entities_id"] = $entity; $id = $this->add($input); } return $id; } /** * Restore a software from dustbin * * @param $ID the ID of the software to put in dustbin * * @return boolean (success) **/ function removeFromTrash($ID) { return $this->restore(array("id" => $ID)); } } ?>glpi-0.84.3+dfsg.1/inc/printermodel.class.php000066400000000000000000000033541226600447100207200ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class PrinterModel class PrinterModel extends CommonDropdown { var $additional_fields_for_dictionnary = array('manufacturer'); static function getTypeName($nb=0) { return _n('Printer model', 'Printer models', $nb); } function cleanDBonPurge() { global $DB; // Temporary solution to clean wrong updated items $query = "DELETE FROM `glpi_cartridgeitems_printermodels` WHERE `printermodels_id` = '".$this->fields['id']."'"; $result = $DB->query($query); } } ?> glpi-0.84.3+dfsg.1/inc/printertype.class.php000066400000000000000000000025571226600447100206050ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class PrinterType class PrinterType extends CommonDropdown { static function getTypeName($nb=0) { return _n('Printer type', 'Printer types', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/problem.class.php000066400000000000000000002200751226600447100176550ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Problem class class Problem extends CommonITILObject { // From CommonDBTM public $dohistory = true; // From CommonITIL public $userlinkclass = 'Problem_User'; public $grouplinkclass = 'Group_Problem'; public $supplierlinkclass = 'Problem_Supplier'; const MATRIX_FIELD = 'priority_matrix'; const URGENCY_MASK_FIELD = 'urgency_mask'; const IMPACT_MASK_FIELD = 'impact_mask'; const STATUS_MATRIX_FIELD = 'problem_status'; /** * Name of the type * * @param $nb : number of item in the type **/ static function getTypeName($nb=0) { return _n('Problem', 'Problems', $nb); } function canAdminActors() { return Session::haveRight('edit_all_problem', '1'); } function canAssign() { return Session::haveRight('edit_all_problem', '1'); } function canAssignToMe() { return Session::haveRight('edit_all_problem', '1'); } function canSolve() { return (self::isAllowedStatus($this->fields['status'], self::SOLVED) // No edition on closed status && !in_array($this->fields['status'], $this->getClosedStatusArray()) && (Session::haveRight("edit_all_problem","1") || (Session::haveRight('show_my_problem', 1) && ($this->isUser(CommonITILActor::ASSIGN, Session::getLoginUserID()) || (isset($_SESSION["glpigroups"]) && $this->haveAGroup(CommonITILActor::ASSIGN, $_SESSION["glpigroups"])))))); } static function canCreate() { return Session::haveRight('edit_all_problem', '1'); } static function canView() { return (Session::haveRight('show_all_problem', '1') || Session::haveRight('show_my_problem', '1')); } /** * Is the current user have right to show the current problem ? * * @return boolean **/ function canViewItem() { if (!Session::haveAccessToEntity($this->getEntityID(), $this->isRecursive())) { return false; } return (Session::haveRight('show_all_problem', 1) || (Session::haveRight('show_my_problem', 1) && ($this->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID()) || $this->isUser(CommonITILActor::OBSERVER, Session::getLoginUserID()) || (isset($_SESSION["glpigroups"]) && ($this->haveAGroup(CommonITILActor::REQUESTER, $_SESSION["glpigroups"]) || $this->haveAGroup(CommonITILActor::OBSERVER, $_SESSION["glpigroups"]))) || ($this->isUser(CommonITILActor::ASSIGN, Session::getLoginUserID()) || (isset($_SESSION["glpigroups"]) && $this->haveAGroup(CommonITILActor::ASSIGN, $_SESSION["glpigroups"])))))); } /** * Is the current user have right to approve solution of the current problem ? * * @return boolean **/ function canApprove() { return (($this->fields["users_id_recipient"] === Session::getLoginUserID()) || $this->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID()) || (isset($_SESSION["glpigroups"]) && $this->haveAGroup(CommonITILActor::REQUESTER, $_SESSION["glpigroups"]))); } /** * Is the current user have right to create the current problem ? * * @return boolean **/ function canCreateItem() { if (!Session::haveAccessToEntity($this->getEntityID())) { return false; } return Session::haveRight('edit_all_problem', 1); } /** * @since version 0.84 * * @return boolean **/ static function canDelete() { return Session::haveRight('delete_problem', '1'); } /** * Is the current user have right to delete the current problem ? * * @since version 0.84 * * @return boolean **/ function canDeleteItem() { if (!Session::haveAccessToEntity($this->getEntityID())) { return false; } return Session::haveRight('delete_problem', '1'); } function pre_deleteItem() { NotificationEvent::raiseEvent('delete', $this); return true; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (static::canView()) { $nb = 0; switch ($item->getType()) { case 'Change' : if ($_SESSION['glpishow_count_on_tabs']) { $nb = countElementsInTable('glpi_changes_problems', "`changes_id` = '".$item->getID()."'"); } return self::createTabEntry(self::getTypeName(2), $nb); case 'Ticket' : if ($_SESSION['glpishow_count_on_tabs']) { $nb = countElementsInTable('glpi_problems_tickets', "`tickets_id` = '".$item->getID()."'"); } return self::createTabEntry(self::getTypeName(2), $nb); case __CLASS__ : $ong = array (1 => __('Analysis'), 2 => _n('Solution', 'Solutions', 1)); if (Session::haveRight('observe_ticket','1')) { $ong[4] = __('Statistics'); } return $ong; } } switch ($item->getType()) { case __CLASS__ : return array(1 => __('Analysis'), 2 => _n('Solution', 'Solutions', 1), 4 => __('Statistics')); } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($item->getType()) { case 'Change' : Change_Problem::showForChange($item); break; case 'Ticket' : Problem_Ticket::showForTicket($item); break; case __CLASS__ : switch ($tabnum) { case 1 : $item->showAnalysisForm(); break; case 2 : if (!isset($_POST['load_kb_sol'])) { $_POST['load_kb_sol'] = 0; } $item->showSolutionForm($_POST['load_kb_sol']); break; case 4 : $item->showStats(); break; } } return true; } function defineTabs($options=array()) { // show related tickets and changes $ong['empty'] = $this->getTypeName(1); $this->addStandardTab('Ticket', $ong, $options); // $this->addStandardTab('Change', $ong, $options); $this->addStandardTab('ProblemTask', $ong, $options); $this->addStandardTab('Item_Problem', $ong, $options); $this->addStandardTab('Change_Problem', $ong, $options); $this->addStandardTab('Problem_Ticket', $ong, $options); $this->addStandardTab(__CLASS__, $ong, $options); $this->addStandardTab('Document_Item', $ong, $options); $this->addStandardTab('Note', $ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } function cleanDBonPurge() { global $DB; $query1 = "DELETE FROM `glpi_problemtasks` WHERE `problems_id` = '".$this->fields['id']."'"; $DB->query($query1); $pt = new Problem_Ticket(); $pt->cleanDBonItemDelete('Problem', $this->fields['id']); $ip = new Item_Problem(); $ip->cleanDBonItemDelete('Problem', $this->fields['id']); parent::cleanDBonPurge(); } function prepareInputForUpdate($input) { // Get problem : need for comparison // $this->getFromDB($input['id']); $input = parent::prepareInputForUpdate($input); return $input; } function pre_updateInDB() { parent::pre_updateInDB(); } /** * @see CommonDBTM::post_updateItem() **/ function post_updateItem($history=1) { global $CFG_GLPI; $donotif = count($this->updates); if (isset($this->input['_forcenotif'])) { $donotif = true; } if (isset($this->input['_disablenotif'])) { $donotif = false; } if ($donotif && $CFG_GLPI["use_mailing"]) { $mailtype = "update"; if (isset($this->input["status"]) && $this->input["status"] && in_array("status",$this->updates) && in_array($this->input["status"], $this->getSolvedStatusArray())) { $mailtype = "solved"; } if (isset($this->input["status"]) && $this->input["status"] && in_array("status",$this->updates) && in_array($this->input["status"], $this->getClosedStatusArray())) { $mailtype = "closed"; } // Read again problem to be sure that all data are up to date $this->getFromDB($this->fields['id']); NotificationEvent::raiseEvent($mailtype, $this); } /// TODO auto solve tickets ? issue #3605 } function prepareInputForAdd($input) { $input = parent::prepareInputForAdd($input); if (((isset($input["_users_id_assign"]) && ($input["_users_id_assign"] > 0)) || (isset($input["_groups_id_assign"]) && ($input["_groups_id_assign"] > 0)) || (isset($input["_suppliers_id_assign"]) && ($input["_suppliers_id_assign"] > 0))) && (in_array($input['status'], $this->getNewStatusArray()))) { $input["status"] = self::ASSIGNED; } return $input; } function post_addItem() { global $CFG_GLPI; parent::post_addItem(); if (isset($this->input['_tickets_id'])) { $ticket = new Ticket(); if ($ticket->getFromDB($this->input['_tickets_id'])) { $pt = new Problem_Ticket(); $pt->add(array('tickets_id' => $this->input['_tickets_id'], 'problems_id' => $this->fields['id'], '_no_notif' => true)); if (!empty($ticket->fields['itemtype']) && ($ticket->fields['items_id'] > 0)) { $it = new Item_Problem(); $it->add(array('problems_id' => $this->fields['id'], 'itemtype' => $ticket->fields['itemtype'], 'items_id' => $ticket->fields['items_id'], '_no_notif' => true)); } } } // Processing Email if ($CFG_GLPI["use_mailing"]) { // Clean reload of the problem $this->getFromDB($this->fields['id']); $type = "new"; if (isset($this->fields["status"]) && ($this->fields["status"] == self::SOLVED)) { $type = "solved"; } NotificationEvent::raiseEvent($type, $this); } } /** * Get default values to search engine to override **/ static function getDefaultSearchRequest() { $search = array('field' => array(0 => 12), 'searchtype' => array(0 => 'equals'), 'contains' => array(0 => 'notold'), 'sort' => 19, 'order' => 'DESC'); return $search; } /** * @see CommonDBTM::getSpecificMassiveActions() **/ function getSpecificMassiveActions($checkitem=NULL) { $isadmin = static::canUpdate(); $actions = parent::getSpecificMassiveActions($checkitem); if (ProblemTask::canCreate()) { $actions['add_task'] = __('Add a new task'); } if (Session::haveRight("edit_all_problem","1")) { $actions['add_actor'] = __('Add an actor'); } if (Session::haveRight('transfer','r') && Session::isMultiEntitiesMode() && $isadmin) { $actions['add_transfer_list'] = _x('button', 'Add to transfer list'); } return $actions; } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Title'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['searchtype'] = 'contains'; $tab[1]['massiveaction'] = false; $tab[21]['table'] = $this->getTable(); $tab[21]['field'] = 'content'; $tab[21]['name'] = __('Description'); $tab[21]['massiveaction'] = false; $tab[21]['datatype'] = 'text'; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab[12]['table'] = $this->getTable(); $tab[12]['field'] = 'status'; $tab[12]['name'] = __('Status'); $tab[12]['searchtype'] = 'equals'; $tab[12]['datatype'] = 'specific'; $tab[10]['table'] = $this->getTable(); $tab[10]['field'] = 'urgency'; $tab[10]['name'] = __('Urgency'); $tab[10]['searchtype'] = 'equals'; $tab[10]['datatype'] = 'specific'; $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'impact'; $tab[11]['name'] = __('Impact'); $tab[11]['searchtype'] = 'equals'; $tab[11]['datatype'] = 'specific'; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'priority'; $tab[3]['name'] = __('Priority'); $tab[3]['searchtype'] = 'equals'; $tab[3]['datatype'] = 'specific'; $tab[15]['table'] = $this->getTable(); $tab[15]['field'] = 'date'; $tab[15]['name'] = __('Opening date'); $tab[15]['datatype'] = 'datetime'; $tab[15]['massiveaction'] = false; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'closedate'; $tab[16]['name'] = __('Closing date'); $tab[16]['datatype'] = 'datetime'; $tab[16]['massiveaction'] = false; $tab[18]['table'] = $this->getTable(); $tab[18]['field'] = 'due_date'; $tab[18]['name'] = __('Due date'); $tab[18]['datatype'] = 'datetime'; $tab[18]['maybefuture'] = true; $tab[18]['massiveaction'] = false; $tab[17]['table'] = $this->getTable(); $tab[17]['field'] = 'solvedate'; $tab[17]['name'] = __('Resolution date'); $tab[17]['datatype'] = 'datetime'; $tab[17]['massiveaction'] = false; $tab[19]['table'] = $this->getTable(); $tab[19]['field'] = 'date_mod'; $tab[19]['name'] = __('Last update'); $tab[19]['datatype'] = 'datetime'; $tab[19]['massiveaction'] = false; $tab[7]['table'] = 'glpi_itilcategories'; $tab[7]['field'] = 'completename'; $tab[7]['name'] = __('Category'); $tab[7]['datatype'] = 'dropdown'; $tab[80]['table'] = 'glpi_entities'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = __('Entity'); $tab[80]['massiveaction'] = false; $tab[80]['datatype'] = 'dropdown'; $tab[45]['table'] = $this->getTable(); $tab[45]['field'] = 'actiontime'; $tab[45]['name'] = __('Total duration'); $tab[45]['datatype'] = 'timestamp'; $tab[45]['massiveaction'] = false; $tab[45]['nosearch'] = true; $tab[64]['table'] = 'glpi_users'; $tab[64]['field'] = 'name'; $tab[64]['linkfield'] = 'users_id_lastupdater'; $tab[64]['name'] = __('Last edit by'); $tab[64]['massiveaction'] = false; $tab[64]['datatype'] = 'dropdown'; $tab[64]['right'] = 'all'; $tab[65]['table'] = 'glpi_items_problems'; $tab[65]['field'] = 'count'; $tab[65]['name'] = _x('quantity','Number of items'); $tab[65]['forcegroupby'] = true; $tab[65]['usehaving'] = true; $tab[65]['datatype'] = 'number'; $tab[65]['massiveaction'] = false; $tab[65]['joinparams'] = array('jointype' => 'child'); $tab += $this->getSearchOptionsActors(); $tab['analysis'] = __('Analysis'); $tab[60]['table'] = $this->getTable(); $tab[60]['field'] = 'impactcontent'; $tab[60]['name'] = __('Impacts'); $tab[60]['massiveaction'] = false; $tab[60]['datatype'] = 'text'; $tab[61]['table'] = $this->getTable(); $tab[61]['field'] = 'causecontent'; $tab[61]['name'] = __('Causes'); $tab[61]['massiveaction'] = false; $tab[61]['datatype'] = 'text'; $tab[62]['table'] = $this->getTable(); $tab[62]['field'] = 'symptomcontent'; $tab[62]['name'] = __('Symptoms'); $tab[62]['massiveaction'] = false; $tab[62]['datatype'] = 'text'; $tab[90]['table'] = $this->getTable(); $tab[90]['field'] = 'notepad'; $tab[90]['name'] = __('Notes'); $tab[90]['massiveaction'] = false; $tab[90]['datatype'] = 'text'; $tab['task'] = _n('Task', 'Tasks', 2); $tab[26]['table'] = 'glpi_problemtasks'; $tab[26]['field'] = 'content'; $tab[26]['name'] = __('Task description'); $tab[26]['forcegroupby'] = true; $tab[26]['splititems'] = true; $tab[26]['massiveaction'] = false; $tab[26]['joinparams'] = array('jointype' => 'child'); $tab[26]['datatype'] = 'text'; $tab[28]['table'] = 'glpi_problemtasks'; $tab[28]['field'] = 'count'; $tab[28]['name'] = _x('quantity', 'Number of tasks'); $tab[28]['forcegroupby'] = true; $tab[28]['usehaving'] = true; $tab[28]['datatype'] = 'number'; $tab[28]['massiveaction'] = false; $tab[28]['joinparams'] = array('jointype' => 'child'); $tab[20]['table'] = 'glpi_taskcategories'; $tab[20]['field'] = 'name'; $tab[20]['name'] = __('Task category'); $tab[20]['datatype'] = 'dropdown'; $tab[20]['forcegroupby'] = true; $tab[20]['splititems'] = true; $tab[20]['massiveaction'] = false; $tab[20]['joinparams'] = array('beforejoin' => array('table' => 'glpi_problemtasks', 'joinparams' => array('jointype' => 'child'))); $tab[94]['table'] = 'glpi_users'; $tab[94]['field'] = 'name'; $tab[94]['name'] = __('Writer'); $tab[94]['datatype'] = 'itemlink'; $tab[94]['right'] = 'all'; $tab[94]['forcegroupby'] = true; $tab[94]['massiveaction'] = false; $tab[94]['joinparams'] = array('beforejoin' => array('table' => 'glpi_problemtasks', 'joinparams' => array('jointype' => 'child'))); $tab[95]['table'] = 'glpi_users'; $tab[95]['field'] = 'name'; $tab[95]['linkfield'] = 'users_id_tech'; $tab[95]['name'] = __('Technician'); $tab[95]['datatype'] = 'itemlink'; $tab[95]['right'] = 'own_ticket'; $tab[95]['forcegroupby'] = true; $tab[95]['massiveaction'] = false; $tab[95]['joinparams'] = array('beforejoin' => array('table' => 'glpi_problemtasks', 'joinparams' => array('jointype' => 'child'))); $tab[96]['table'] = 'glpi_problemtasks'; $tab[96]['field'] = 'actiontime'; $tab[96]['name'] = __('Duration'); $tab[96]['datatype'] = 'timestamp'; $tab[96]['massiveaction'] = false; $tab[96]['forcegroupby'] = true; $tab[96]['joinparams'] = array('jointype' => 'child'); $tab[97]['table'] = 'glpi_problemtasks'; $tab[97]['field'] = 'date'; $tab[97]['name'] = __('Date'); $tab[97]['datatype'] = 'datetime'; $tab[97]['massiveaction'] = false; $tab[97]['forcegroupby'] = true; $tab[97]['joinparams'] = array('jointype' => 'child'); $tab[33]['table'] = 'glpi_problemtasks'; $tab[33]['field'] = 'state'; $tab[33]['name'] = __('Status'); $tab[33]['datatype'] = 'specific'; $tab[33]['searchtype'] = 'equals'; $tab[33]['searchequalsonfield'] = true; $tab[33]['massiveaction'] = false; $tab[33]['forcegroupby'] = true; $tab[33]['joinparams'] = array('jointype' => 'child'); $tab['solution'] = _n('Solution', 'Solutions', 2); $tab[23]['table'] = 'glpi_solutiontypes'; $tab[23]['field'] = 'name'; $tab[23]['name'] = __('Solution type'); $tab[23]['datatype'] = 'dropdown'; $tab[24]['table'] = $this->getTable(); $tab[24]['field'] = 'solution'; $tab[24]['name'] = _n('Solution', 'Solutions', 1); $tab[24]['datatype'] = 'text'; $tab[24]['htmltext'] = true; $tab[24]['massiveaction'] = false; $tab += $this->getSearchOptionsStats(); $tab['ticket'] = Ticket::getTypeName(2); $tab[141]['table'] = 'glpi_problems_tickets'; $tab[141]['field'] = 'count'; $tab[141]['name'] = _x('quantity', 'Number of tickets'); $tab[141]['forcegroupby'] = true; $tab[141]['usehaving'] = true; $tab[141]['datatype'] = 'number'; $tab[141]['massiveaction'] = false; $tab[141]['joinparams'] = array('jointype' => 'child'); return $tab; } /** * get the problem status list * * @param $withmetaforsearch boolean (false by default) * * @return an array **/ static function getAllStatusArray($withmetaforsearch=false) { // To be overridden by class $tab = array(self::INCOMING => _x('problem', 'New'), self::ACCEPTED => _x('problem', 'Accepted'), self::ASSIGNED => _x('problem', 'Processing (assigned)'), self::PLANNED => _x('problem', 'Processing (planned)'), self::WAITING => __('Pending'), self::SOLVED => _x('problem', 'Solved'), self::OBSERVED => __('Under observation'), self::CLOSED => _x('problem', 'Closed')); if ($withmetaforsearch) { $tab['notold'] = _x('problem', 'Not solved'); $tab['notclosed'] = _x('problem', 'Not closed'); $tab['process'] = __('Processing'); $tab['old'] = _x('problem', 'Solved + Closed'); $tab['all'] = __('All'); } return $tab; } /** * Get the ITIL object closed status list * * @since version 0.83 * * @return an array **/ static function getClosedStatusArray() { // To be overridden by class $tab = array(self::CLOSED); return $tab; } /** * Get the ITIL object solved or observe status list * * @since version 0.83 * * @return an array **/ static function getSolvedStatusArray() { // To be overridden by class $tab = array(self::OBSERVED, self::SOLVED); return $tab; } /** * Get the ITIL object new status list * * @since version 0.83.8 * * @return an array **/ static function getNewStatusArray() { return array(self::INCOMING, self::ACCEPTED); } /** * Get the ITIL object assign, plan or accepted status list * * @since version 0.83 * * @return an array **/ static function getProcessStatusArray() { // To be overridden by class $tab = array(self::ACCEPTED, self::ASSIGNED, self::PLANNED); return $tab; } /** * @since version 0.84 * * @param $start * @param $status (default 'proces) * @param $showgroupproblems (true by default) **/ static function showCentralList($start, $status="process", $showgroupproblems=true) { global $DB, $CFG_GLPI; if (!Session::haveRight("show_all_problem","1") && !Session::haveRight("show_my_problem","1")) { return false; } $search_users_id = " (`glpi_problems_users`.`users_id` = '".Session::getLoginUserID()."' AND `glpi_problems_users`.`type` = '".CommonITILActor::REQUESTER."') "; $search_assign = " (`glpi_problems_users`.`users_id` = '".Session::getLoginUserID()."' AND `glpi_problems_users`.`type` = '".CommonITILActor::ASSIGN."')"; $is_deleted = " `glpi_problems`.`is_deleted` = 0 "; if ($showgroupproblems) { $search_users_id = " 0 = 1 "; $search_assign = " 0 = 1 "; if (count($_SESSION['glpigroups'])) { $groups = implode("','",$_SESSION['glpigroups']); $search_assign = " (`glpi_groups_problems`.`groups_id` IN ('$groups') AND `glpi_groups_problems`.`type` = '".CommonITILActor::ASSIGN."')"; $search_users_id = " (`glpi_groups_problems`.`groups_id` IN ('$groups') AND `glpi_groups_problems`.`type` = '".CommonITILActor::REQUESTER."') "; } } $query = "SELECT DISTINCT `glpi_problems`.`id` FROM `glpi_problems` LEFT JOIN `glpi_problems_users` ON (`glpi_problems`.`id` = `glpi_problems_users`.`problems_id`) LEFT JOIN `glpi_groups_problems` ON (`glpi_problems`.`id` = `glpi_groups_problems`.`problems_id`)"; switch ($status) { case "waiting" : // on affiche les problemes en attente $query .= "WHERE $is_deleted AND ($search_assign) AND `status` = '".self::WAITING."' ". getEntitiesRestrictRequest("AND", "glpi_problems"); break; case "process" : // on affiche les problemes planifiés ou assignés au user $query .= "WHERE $is_deleted AND ($search_assign) AND (`status` IN ('".self::PLANNED."','".self::ASSIGNED."')) ". getEntitiesRestrictRequest("AND", "glpi_problems"); break; default : $query .= "WHERE $is_deleted AND ($search_users_id) AND (`status` IN ('".self::INCOMING."', '".self::ACCEPTED."', '".self::PLANNED."', '".self::ASSIGNED."', '".self::WAITING."')) AND NOT ($search_assign) ". getEntitiesRestrictRequest("AND","glpi_problems"); } $query .= " ORDER BY date_mod DESC"; $result = $DB->query($query); $numrows = $DB->numrows($result); if ($_SESSION['glpidisplay_count_on_home'] > 0) { $query .= " LIMIT ".intval($start).','.intval($_SESSION['glpidisplay_count_on_home']); $result = $DB->query($query); $number = $DB->numrows($result); } else { $number = 0; } if ($numrows > 0) { echo ""; echo ""; if ($number) { echo ""; echo ""; echo ""; for ($i = 0 ; $i < $number ; $i++) { $ID = $DB->result($result, $i, "id"); self::showVeryShort($ID, $forcetab); } } echo "
    "; $options['reset'] = 'reset'; $forcetab = ''; $num = 0; if ($showgroupproblems) { switch ($status) { case "waiting" : foreach ($_SESSION['glpigroups'] as $gID) { $options['field'][$num] = 8; // groups_id_assign $options['searchtype'][$num] = 'equals'; $options['contains'][$num] = $gID; $options['link'][$num] = (($num == 0)?'AND':'OR'); $num++; $options['field'][$num] = 12; // status $options['searchtype'][$num] = 'equals'; $options['contains'][$num] = self::WAITING; $options['link'][$num] = 'AND'; $num++; } echo "". Html::makeTitle(__('Problems on pending status'), $number, $numrows).""; break; case "process" : foreach ($_SESSION['glpigroups'] as $gID) { $options['field'][$num] = 8; // groups_id_assign $options['searchtype'][$num] = 'equals'; $options['contains'][$num] = $gID; $options['link'][$num] = (($num == 0)?'AND':'OR'); $num++; $options['field'][$num] = 12; // status $options['searchtype'][$num] = 'equals'; $options['contains'][$num] = 'process'; $options['link'][$num] = 'AND'; $num++; } echo "". Html::makeTitle(__('Problems to be processed'), $number, $numrows).""; break; default : foreach ($_SESSION['glpigroups'] as $gID) { $options['field'][$num] = 71; // groups_id $options['searchtype'][$num] = 'equals'; $options['contains'][$num] = $gID; $options['link'][$num] = (($num == 0)?'AND':'OR'); $num++; $options['field'][$num] = 12; // status $options['searchtype'][$num] = 'equals'; $options['contains'][$num] = 'process'; $options['link'][$num] = 'AND'; $num++; } echo "". Html::makeTitle(__('Your problems in progress'), $number, $numrows).""; } } else { switch ($status) { case "waiting" : $options['field'][0] = 12; // status $options['searchtype'][0] = 'equals'; $options['contains'][0] = self::WAITING; $options['link'][0] = 'AND'; $options['field'][1] = 5; // users_id_assign $options['searchtype'][1] = 'equals'; $options['contains'][1] = Session::getLoginUserID(); $options['link'][1] = 'AND'; echo "". Html::makeTitle(__('Problems on pending status'), $number, $numrows).""; break; case "process" : $options['field'][0] = 5; // users_id_assign $options['searchtype'][0] = 'equals'; $options['contains'][0] = Session::getLoginUserID(); $options['link'][0] = 'AND'; $options['field'][1] = 12; // status $options['searchtype'][1] = 'equals'; $options['contains'][1] = 'process'; $options['link'][1] = 'AND'; echo "". Html::makeTitle(__('Problems to be processed'), $number, $numrows).""; break; default : $options['field'][0] = 4; // users_id $options['searchtype'][0] = 'equals'; $options['contains'][0] = Session::getLoginUserID(); $options['link'][0] = 'AND'; $options['field'][1] = 12; // status $options['searchtype'][1] = 'equals'; $options['contains'][1] = 'notold'; $options['link'][1] = 'AND'; echo "". Html::makeTitle(__('Your problems in progress'), $number, $numrows).""; } } echo "
    ".__('Requester')."".__('Description')."
    "; } } /** * Get problems count * * @since version 0.84 * * @param $foruser boolean : only for current login user as requester (false by default) **/ static function showCentralCount($foruser=false) { global $DB, $CFG_GLPI; // show a tab with count of jobs in the central and give link if (!Session::haveRight("show_all_problem","1") && !Session::haveRight("show_my_problem",1)) { return false; } if (!Session::haveRight("show_all_problem","1")) { $foruser = true; } $query = "SELECT `status`, COUNT(*) AS COUNT FROM `glpi_problems` "; if ($foruser) { $query .= " LEFT JOIN `glpi_problems_users` ON (`glpi_problems`.`id` = `glpi_problems_users`.`problems_id` AND `glpi_problems_users`.`type` = '".CommonITILActor::REQUESTER."')"; if (isset($_SESSION["glpigroups"]) && count($_SESSION["glpigroups"])) { $query .= " LEFT JOIN `glpi_groups_problems` ON (`glpi_problems`.`id` = `glpi_groups_problems`.`problems_id` AND `glpi_groups_problems`.`type` = '".CommonITILActor::REQUESTER."')"; } } $query .= getEntitiesRestrictRequest("WHERE", "glpi_problems"); if ($foruser) { $query .= " AND (`glpi_problems_users`.`users_id` = '".Session::getLoginUserID()."' "; if (isset($_SESSION["glpigroups"]) && count($_SESSION["glpigroups"])) { $groups = implode("','",$_SESSION['glpigroups']); $query .= " OR `glpi_groups_problems`.`groups_id` IN ('$groups') "; } $query.= ")"; } $query_deleted = $query; $query .= " AND NOT `glpi_problems`.`is_deleted` GROUP BY `status`"; $query_deleted .= " AND `glpi_problems`.`is_deleted` GROUP BY `status`"; $result = $DB->query($query); $result_deleted = $DB->query($query_deleted); $status = array(); foreach (self::getAllStatusArray() as $key => $val) { $status[$key] = 0; } if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { $status[$data["status"]] = $data["COUNT"]; } } $number_deleted = 0; if ($DB->numrows($result_deleted) > 0) { while ($data = $DB->fetch_assoc($result_deleted)) { $number_deleted += $data["COUNT"]; } } $options['field'][0] = 12; $options['searchtype'][0] = 'equals'; $options['contains'][0] = 'process'; $options['link'][0] = 'AND'; $options['reset'] ='reset'; echo ""; echo ""; echo ""; foreach ($status as $key => $val) { $options['contains'][0] = $key; echo ""; echo ""; echo ""; } $options['contains'][0] = 'all'; $options['is_deleted'] = 1; echo ""; echo ""; echo ""; echo "
    "; echo "".__('Problem followup').""; echo "
    "._n('Problem','Problems',2).""._x('quantity', 'Number')."
    ".self::getStatus($key)."$val
    ".__('Deleted')."".$number_deleted."

    "; } /** * @since version 0.84 * * @param $ID * @param $forcetab string name of the tab to force at the display (default '') **/ static function showVeryShort($ID, $forcetab='') { global $CFG_GLPI; // Prints a job in short form // Should be called in a -segment // Print links or not in case of user view // Make new job object and fill it from database, if success, print it $viewusers = Session::haveRight("user", "r"); $problem = new self(); $rand = mt_rand(); if ($problem->getFromDBwithData($ID, 0)) { $bgcolor = $_SESSION["glpipriority_".$problem->fields["priority"]]; // $rand = mt_rand(); echo ""; echo ""; echo ""; echo ""; // Finish Line echo ""; } else { echo ""; echo ""; } } /** * @param $ID * @param $options array **/ function showForm($ID, $options=array()) { global $CFG_GLPI, $DB; if (!static::canView()) { return false; } // In percent $colsize1 = '13'; $colsize2 = '37'; // Set default options if (!$ID) { $values = array('_users_id_requester' => Session::getLoginUserID(), '_users_id_requester_notif' => array('use_notification' => 1, 'alternative_email' => ''), '_groups_id_requester' => 0, '_users_id_assign' => 0, '_users_id_assign_notif' => array('use_notification' => 1, 'alternative_email' => ''), '_groups_id_assign' => 0, '_users_id_observer' => 0, '_users_id_observer_notif' => array('use_notification' => 1, 'alternative_email' => ''), '_groups_id_observer' => 0, '_suppliers_id_assign' => 0, 'priority' => 3, 'urgency' => 3, 'impact' => 3, 'content' => '', 'name' => '', 'entities_id' => $_SESSION['glpiactive_entity'], 'itilcategories_id' => 0); foreach ($values as $key => $val) { if (!isset($options[$key])) { $options[$key] = $val; } } if (isset($options['tickets_id'])) { $ticket = new Ticket(); if ($ticket->getFromDB($options['tickets_id'])) { $options['content'] = $ticket->getField('content'); $options['name'] = $ticket->getField('name'); $options['impact'] = $ticket->getField('impact'); $options['urgency'] = $ticket->getField('urgency'); $options['priority'] = $ticket->getField('priority'); $options['itilcategories_id'] = $ticket->getField('itilcategories_id'); } } } $this->initForm($ID, $options); $showuserlink = 0; if (Session::haveRight('user','r')) { $showuserlink = 1; } $this->showTabs($options); $this->showFormHeader($options); echo ""; echo ""; echo ""; echo ""; echo ""; if ($ID) { echo ""; echo ""; echo ""; } if ($ID && (in_array($this->fields["status"], $this->getSolvedStatusArray()) || in_array($this->fields["status"], $this->getClosedStatusArray()))) { echo ""; echo ""; echo ""; if (in_array($this->fields["status"], $this->getClosedStatusArray())) { echo ""; echo ""; } else { echo ""; } echo ""; } echo "
    ".sprintf(__('%1$s: %2$s'), __('ID'), $problem->fields["id"]).""; if (isset($problem->users[CommonITILActor::REQUESTER]) && count($problem->users[CommonITILActor::REQUESTER])) { foreach ($problem->users[CommonITILActor::REQUESTER] as $d) { if ($d["users_id"] > 0) { $userdata = getUserName($d["users_id"],2); $name = "".$userdata['name'].""; if ($viewusers) { $name = sprintf(__('%1$s %2$s'), $name, Html::showToolTip($userdata["comment"], array('link' => $userdata["link"], 'display' => false))); } echo $name; } else { echo $d['alternative_email']." "; } echo "
    "; } } if (isset($problem->groups[CommonITILActor::REQUESTER]) && count($problem->groups[CommonITILActor::REQUESTER])) { foreach ($problem->groups[CommonITILActor::REQUESTER] as $d) { echo Dropdown::getDropdownName("glpi_groups", $d["groups_id"]); echo "
    "; } } echo "
    "; $link = "fields["name"].""; $link = printf(__('%1$s %2$s'), $link, Html::showToolTip($problem->fields['content'], array('applyto' => 'problem'.$problem->fields["id"].$rand, 'display' => false))); echo "
    ".__('No problem in progress.')."
    ".__('Opening date').""; if (isset($options['tickets_id'])) { echo ""; } $date = $this->fields["date"]; if (!$ID) { $date = date("Y-m-d H:i:s"); } Html::showDateTimeFormItem("date", $date, 1, false); echo "".__('Due date').""; if ($this->fields["due_date"] == 'NULL') { $this->fields["due_date"] = ''; } Html::showDateTimeFormItem("due_date", $this->fields["due_date"], 1, true); echo "
    ".__('By').""; User::dropdown(array('name' => 'users_id_recipient', 'value' => $this->fields["users_id_recipient"], 'entity' => $this->fields["entities_id"], 'right' => 'all')); echo "".__('Last update')."".Html::convDateTime($this->fields["date_mod"])."\n"; if ($this->fields['users_id_lastupdater'] > 0) { printf(__('%1$s: %2$s'), __('By'), getUserName($this->fields["users_id_lastupdater"], $showuserlink)); } echo "
    ".__('Date of solving').""; Html::showDateTimeFormItem("solvedate", $this->fields["solvedate"], 1, false); echo "".__('Closing date').""; Html::showDateTimeFormItem("closedate", $this->fields["closedate"], 1, false); echo " 
    "; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
    ".__('Status').""; self::dropdownStatus(array('value' => $this->fields["status"], 'showtype' => 'allowed')); echo "".__('Urgency').""; // Only change during creation OR when allowed to change priority OR when user is the creator $idurgency = self::dropdownUrgency(array('value' => $this->fields["urgency"])); echo "
    ".__('Category').""; $opt = array('value' => $this->fields["itilcategories_id"], 'entity' => $this->fields["entities_id"], 'condition' => "`is_problem`='1'"); ITILCategory::dropdown($opt); echo "".__('Impact').""; $idimpact = self::dropdownImpact(array('value' => $this->fields["impact"])); echo "
    ".__('Total duration')."".parent::getActionTime($this->fields["actiontime"])."".__('Priority').""; $idpriority = parent::dropdownPriority(array('value' => $this->fields["priority"], 'withmajor' => true)); $idajax = 'change_priority_' . mt_rand(); echo " "; $params = array('urgency' => '__VALUE0__', 'impact' => '__VALUE1__', 'priority' => $idpriority); Ajax::updateItemOnSelectEvent(array($idurgency, $idimpact), $idajax, $CFG_GLPI["root_doc"]."/ajax/priority.php", $params); echo "
    "; $this->showActorsPartForm($ID, $options); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if ($ID) { echo ""; echo ""; echo ""; echo ""; } $options['colspan'] = 2; $this->showFormButtons($options); $this->addDivForTabs(); return true; } /** * Form to add an analysis to a problem **/ function showAnalysisForm() { $this->check($this->getField('id'), 'r'); $canedit = $this->can($this->getField('id'), 'w'); $options = array(); $options['canedit'] = false; $this->showFormHeader($options); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $options['candel'] = false; $options['canedit'] = $canedit; $this->showFormButtons($options); } static function getCommonSelect() { $SELECT = ""; if (count($_SESSION["glpiactiveentities"])>1) { $SELECT .= ", `glpi_entities`.`completename` AS entityname, `glpi_problems`.`entities_id` AS entityID "; } return " DISTINCT `glpi_problems`.*, `glpi_itilcategories`.`completename` AS catname $SELECT"; } static function getCommonLeftJoin() { $FROM = ""; if (count($_SESSION["glpiactiveentities"])>1) { $FROM .= " LEFT JOIN `glpi_entities` ON (`glpi_entities`.`id` = `glpi_problems`.`entities_id`) "; } return " LEFT JOIN `glpi_groups_problems` ON (`glpi_problems`.`id` = `glpi_groups_problems`.`problems_id`) LEFT JOIN `glpi_problems_users` ON (`glpi_problems`.`id` = `glpi_problems_users`.`problems_id`) LEFT JOIN `glpi_itilcategories` ON (`glpi_problems`.`itilcategories_id` = `glpi_itilcategories`.`id`) $FROM"; } /** * @param $output_type (default Search::HTML_OUTPUT) * @param $mass_id id of the form to check all (default '') **/ static function commonListHeader($output_type=Search::HTML_OUTPUT, $mass_id='') { // New Line for Header Items Line echo Search::showNewLine($output_type); // $show_sort if $header_num = 1; $items = array(); $items[(empty($mass_id)?' ':Html::getCheckAllAsCheckbox($mass_id))] = ''; $items[__('Status')] = "glpi_problems.status"; $items[__('Date')] = "glpi_problems.date"; $items[__('Last update')] = "glpi_problems.date_mod"; if (count($_SESSION["glpiactiveentities"])>1) { $items[_n('Entity', 'Entities', 2)] = "glpi_entities.completename"; } $items[__('Priority')] = "glpi_problems.priority"; $items[__('Requester')] = "glpi_problems.users_id"; $items[_x('problem','Assigned')] = "glpi_problems.users_id_assign"; // $items[__('Associated element')] = "glpi_problems.itemtype, glpi_problems.items_id"; $items[__('Category')] = "glpi_itilcategories.completename"; $items[__('Title')] = "glpi_problems.name"; foreach ($items as $key => $val) { $issort = 0; $link = ""; echo Search::showHeaderItem($output_type,$key,$header_num,$link); } // End Line for column headers echo Search::showEndLine($output_type); } /** * @param $id * @param $output_type (default Search::HTML_OUTPUT) * @param $row_num (default 0) * @param $id_for_massaction (default -1) */ static function showShort($id, $output_type=Search::HTML_OUTPUT, $row_num=0, $id_for_massaction=-1) { global $CFG_GLPI; $rand = mt_rand(); /// TODO to be cleaned. Get datas and clean display links // Prints a job in short form // Should be called in a
    ".__('Title').""; $rand = mt_rand(); echo "\n"; echo "
    \n"; if (empty($this->fields["name"])) { _e('Without title'); } else { echo $this->fields["name"]; } echo "
    \n"; echo "
    \n"; if (!$ID) { echo ""; } echo "
    ".__('Description').""; $rand = mt_rand(); echo "\n"; echo "
    \n"; if (!empty($this->fields["content"])) { echo nl2br($this->fields["content"]); } else { _e('Empty description'); } echo "
    \n"; echo "
    \n"; if (!$ID) { echo ""; } echo "
    "; $docnb = Document_Item::countForItem($this); echo "getLinkURL()."&forcetab=Document_Item$1\">"; //TRANS: %d is the document number echo sprintf(_n('%d associated document', '%d associated documents', $docnb), $docnb); echo "
    ".__('Impacts').""; if ($canedit) { echo ""; } else { echo $this->getField('impactcontent'); } echo "
    ".__('Causes').""; if ($canedit) { echo ""; } else { echo $this->getField('causecontent'); } echo "
    ".__('Symptoms').""; if ($canedit) { echo ""; } else { echo $this->getField('symptomcontent'); } echo "
    -segment // Print links or not in case of user view // Make new job object and fill it from database, if success, print it $job = new self(); // If id is specified it will be used as massive aciton id // Used when displaying ticket and wanting to delete a link data if ($id_for_massaction == -1) { $id_for_massaction = $id; } $candelete = Session::haveRight("delete_problem", "1"); $canupdate = Session::haveRight("edit_all_problem", "1"); $showprivate = Session::haveRight("show_all_problem", "1"); $align = "class='center'"; $align_desc = "class='left'"; if ($job->getFromDB($id)) { $item_num = 1; $bgcolor = $_SESSION["glpipriority_".$job->fields["priority"]]; echo Search::showNewLine($output_type,$row_num%2); $check_col = ''; if (($candelete || $canupdate) && ($output_type == Search::HTML_OUTPUT)) { $check_col = Html::getMassiveActionCheckBox(__CLASS__, $id_for_massaction); } echo Search::showItem($output_type, $check_col, $item_num, $row_num, $align); // First column $first_col = sprintf(__('%1$s: %2$s'), __('ID'), $job->fields["id"]); if ($output_type == Search::HTML_OUTPUT) { $first_col .= "
    \"".self::getStatus($job-fields["status"])."\" title=\"". self::getStatus($job->fields["status"])."\">"; } else { $first_col = sprintf(__('%1$s - %2$s'), $first_col, self::getStatus($job->fields["status"])); } echo Search::showItem($output_type, $first_col, $item_num, $row_num, $align); // Second column if ($job->fields['status'] == self::CLOSED) { $second_col = sprintf(__('Closed on %s'), (($output_type == Search::HTML_OUTPUT)?'
    ':''). Html::convDateTime($job->fields['closedate'])); } else if ($job->fields['status'] == self::SOLVED) { $second_col = sprintf(__('Solved on %s'), (($output_type == Search::HTML_OUTPUT)?'
    ':''). Html::convDateTime($job->fields['solvedate'])); } else if ($job->fields['due_date']) { $second_col = sprintf(__('%1$s: %2$s'), __('Due date'), (($output_type == Search::HTML_OUTPUT)?'
    ':''). Html::convDateTime($job->fields['due_date'])); } else { $second_col = sprintf(__('Opened on %s'), (($output_type == Search::HTML_OUTPUT)?'
    ':''). Html::convDateTime($job->fields['date'])); } echo Search::showItem($output_type, $second_col, $item_num, $row_num, $align." width=130"); // Second BIS column $second_col = Html::convDateTime($job->fields["date_mod"]); echo Search::showItem($output_type, $second_col, $item_num, $row_num, $align." width=90"); // Second TER column if (count($_SESSION["glpiactiveentities"]) > 1) { $second_col = Dropdown::getDropdownName('glpi_entities', $job->fields['entities_id']); echo Search::showItem($output_type, $second_col, $item_num, $row_num, $align." width=100"); } // Third Column echo Search::showItem($output_type, "".parent::getPriorityName($job->fields["priority"]). "", $item_num, $row_num, "$align bgcolor='$bgcolor'"); // Fourth Column $fourth_col = ""; if (isset($job->users[CommonITILActor::REQUESTER]) && count($job->users[CommonITILActor::REQUESTER])) { foreach ($job->users[CommonITILActor::REQUESTER] as $d) { $userdata = getUserName($d["users_id"], 2); $fourth_col .= "".$userdata['name'].""; $fourth_col = sprintf(__('%1$s %2$s')."
    ", $fourth_col, Html::showToolTip($userdata["comment"], array('link' => $userdata["link"], 'display' => false))); } } if (isset($job->groups[CommonITILActor::REQUESTER]) && count($job->groups[CommonITILActor::REQUESTER])) { foreach ($job->groups[CommonITILActor::REQUESTER] as $d) { $fourth_col .= Dropdown::getDropdownName("glpi_groups", $d["groups_id"]); $fourth_col .= "
    "; } } echo Search::showItem($output_type, $fourth_col, $item_num, $row_num, $align); // Fifth column $fifth_col = ""; if (isset($job->users[CommonITILActor::ASSIGN]) && count($job->users[CommonITILActor::ASSIGN])) { foreach ($job->users[CommonITILActor::ASSIGN] as $d) { $userdata = getUserName($d["users_id"], 2); $fifth_col .= "".$userdata['name'].""; $fifth_col = sprintf(__('%1$s %2$s')."
    ", $fifth_col, Html::showToolTip($userdata["comment"], array('link' => $userdata["link"], 'display' => false))); } } if (isset($job->groups[CommonITILActor::ASSIGN]) && count($job->groups[CommonITILActor::ASSIGN])) { foreach ($job->groups[CommonITILActor::ASSIGN] as $d) { $fifth_col .= Dropdown::getDropdownName("glpi_groups", $d["groups_id"]); $fifth_col .= "
    "; } } if (isset($job->suppliers[CommonITILActor::ASSIGN]) && count($job->suppliers[CommonITILActor::ASSIGN])) { foreach ($job->suppliers[CommonITILActor::ASSIGN] as $d) { $fifth_col .= Dropdown::getDropdownName("glpi_suppliers", $d["suppliers_id"]); $fifth_col .= "
    "; } } echo Search::showItem($output_type, $fifth_col, $item_num, $row_num, $align); // Sixth Colum // Seventh column echo Search::showItem($output_type, "". Dropdown::getDropdownName('glpi_itilcategories', $job->fields["itilcategories_id"]). "", $item_num, $row_num, $align); // Eigth column $eigth_column = "".$job->fields["name"]." "; // Add link if ($job->canViewItem()) { $eigth_column = "$eigth_column"; if ($output_type == Search::HTML_OUTPUT) { $eigth_column = sprintf(__('%1$s (%2$s)'), $eigth_column, $job->numberOfTasks($showprivate)); } } if ($output_type == Search::HTML_OUTPUT) { $eigth_column = sprintf(__('%1$s %2$s'), $eigth_column, Html::showToolTip($job->fields['content'], array('display' => false, 'applyto' => "ticket".$job->fields["id"]. $rand))); } echo Search::showItem($output_type, $eigth_column, $item_num, $row_num, $align_desc."width='300'"); // Finish Line echo Search::showEndLine($output_type); } else { echo ""; } } /** * Display problems for an item * * Will also display problems of linked items * * @param $item CommonDBTM object * * @return nothing (display a table) **/ static function showListForItem(CommonDBTM $item) { global $DB, $CFG_GLPI; if (!Session::haveRight("show_all_problem","1")) { return false; } if ($item->isNewID($item->getID())) { return false; } $restrict = ''; $order = ''; $options['reset'] = 'reset'; switch ($item->getType()) { case 'User' : $restrict = "(`glpi_problems_users`.`users_id` = '".$item->getID()."' AND `glpi_problems_users`.`type` = ".CommonITILActor::REQUESTER.")"; $order = '`glpi_problems`.`date_mod` DESC'; $options['reset'] = 'reset'; $options['field'][0] = 4; // status $options['searchtype'][0] = 'equals'; $options['contains'][0] = $item->getID(); $options['link'][0] = 'AND'; break; case 'Supplier' : $restrict = "(`glpi_problems_suppliers`.`suppliers_id` = '".$item->getID()."' AND `glpi_problems_suppliers`.`type` = ".CommonITILActor::REQUESTER.")"; $order = '`glpi_problems`.`date_mod` DESC'; $options['field'][0] = 6; $options['searchtype'][0] = 'equals'; $options['contains'][0] = $item->getID(); $options['link'][0] = 'AND'; break; case 'Group' : // Mini search engine if ($item->haveChildren()) { $tree = Session::getSavedOption(__CLASS__, 'tree', 0); echo "
    ".__('No problem in progress.'). "
    "; echo ""; echo "
    ".__('Last problems')."
    "; _e('Child groups'); Dropdown::showYesNo('tree', $tree, -1, array('on_change' => 'reloadTab("start=0&tree="+this.value)')); } else { $tree = 0; } echo "
    "; if ($tree) { $restrict = "IN (".implode(',', getSonsOf('glpi_groups', $item->getID())).")"; } else { $restrict = "='".$item->getID()."'"; } $restrict = "(`glpi_groups_problems`.`groups_id` $restrict AND `glpi_groups_problems`.`type` = ".CommonITILActor::REQUESTER.")"; $order = '`glpi_problems`.`date_mod` DESC'; $options['field'][0] = 71; $options['searchtype'][0] = ($tree ? 'under' : 'equals'); $options['contains'][0] = $item->getID(); $options['link'][0] = 'AND'; break; default : $restrict = "(`items_id` = '".$item->getID()."' AND `itemtype` = '".$item->getType()."')"; $order = '`glpi_problems`.`date_mod` DESC'; // $options['field'][0] = 12; // $options['searchtype'][0] = 'equals'; // $options['contains'][0] = 'all'; // $options['link'][0] = 'AND'; // // $options['itemtype2'][0] = $item->getType(); // $options['field2'][0] = Search::getOptionNumber($item->getType(), 'id'); // $options['searchtype2'][0] = 'equals'; // $options['contains2'][0] = $item->getID(); // $options['link2'][0] = 'AND'; break; } $query = "SELECT ".self::getCommonSelect()." FROM `glpi_problems` LEFT JOIN `glpi_items_problems` ON (`glpi_problems`.`id` = `glpi_items_problems`.`problems_id`) ". self::getCommonLeftJoin()." WHERE $restrict ". getEntitiesRestrictRequest("AND","glpi_problems")." ORDER BY $order LIMIT ".intval($_SESSION['glpilist_limit']); $result = $DB->query($query); $number = $DB->numrows($result); // Ticket for the item echo "
    "; if ($number > 0) { Session::initNavigateListItems('Problem', //TRANS : %1$s is the itemtype name, // %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), $item->getTypeName(1), $item->getName())); if (count($_SESSION["glpiactiveentities"]) > 1) { echo ""; } else { echo ""; } // Ticket list if ($number > 0) { self::commonListHeader(Search::HTML_OUTPUT); while ($data = $DB->fetch_assoc($result)) { Session::addToNavigateListItems('Problem', $data["id"]); self::showShort($data["id"]); } } echo "
    "; } else { echo "
    "; } //TRANS : %d is the number of problems echo sprintf(_n('Last %d problem','Last %d problems',$number), $number); // echo "".__('Show all').""; echo "
    ".__('No problem found.')."
    "; // Tickets for linked items if ($subquery = $item->getSelectLinkedItem()) { $query = "SELECT ".self::getCommonSelect()." FROM `glpi_problems` LEFT JOIN `glpi_items_problems` ON (`glpi_problems`.`id` = `glpi_items_problems`.`problems_id`) ". self::getCommonLeftJoin()." WHERE (`itemtype`,`items_id`) IN (" . $subquery . ")". getEntitiesRestrictRequest(' AND ', 'glpi_problems') . " ORDER BY `glpi_problems`.`date_mod` DESC LIMIT ".intval($_SESSION['glpilist_limit']); $result = $DB->query($query); $number = $DB->numrows($result); echo "
    "; echo ""; if ($number > 0) { self::commonListHeader(Search::HTML_OUTPUT); while ($data = $DB->fetch_assoc($result)) { // Session::addToNavigateListItems(TRACKING_TYPE,$data["id"]); self::showShort($data["id"]); } } else { echo ""; } echo "
    "; _e('Problems on linked items'); echo "
    ".__('No problem found.')."
    "; } // Subquery for linked item } /** * Number of tasks of the problem * * @return followup count **/ function numberOfTasks() { global $DB; // Set number of followups $query = "SELECT COUNT(*) FROM `glpi_problemtasks` WHERE `problems_id` = '".$this->fields["id"]."'"; $result = $DB->query($query); return $DB->result($result, 0, 0); } /** * @since version 0.85 * * @return string */ function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); if (!Session::haveRight('delete_problem', 1)) { $forbidden[] = 'delete'; $forbidden[] = 'purge'; $forbidden[] = 'restore'; } return $forbidden; } } ?> glpi-0.84.3+dfsg.1/inc/problem_supplier.class.php000066400000000000000000000030161226600447100215720ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Class Problem_Supplier * * @since version 0.84 * **/ class Problem_Supplier extends CommonITILActor { // From CommonDBRelation static public $itemtype_1 = 'Problem'; static public $items_id_1 = 'problems_id'; static public $itemtype_2 = 'Supplier'; static public $items_id_2 = 'suppliers_id'; } ?> glpi-0.84.3+dfsg.1/inc/problem_ticket.class.php000066400000000000000000000343531226600447100212220ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class Problem_Ticket extends CommonDBRelation{ // From CommonDBRelation static public $itemtype_1 = 'Problem'; static public $items_id_1 = 'problems_id'; static public $itemtype_2 = 'Ticket'; static public $items_id_2 = 'tickets_id'; /** * @since version 0.84 **/ function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } static function getTypeName($nb=0) { return _n('Link Ticket/Problem','Links Ticket/Problem',$nb); } /** * Get search function for the class * * @return array of search option */ function getSearchOptions() { return parent::getSearchOptions(); } /** * @since version 0.84 **/ function post_addItem() { global $CFG_GLPI; $donotif = $CFG_GLPI["use_mailing"]; if (isset($this->input["_no_notif"]) && $this->input["_no_notif"]) { $donotif = false; } if ($donotif) { $problem = new Problem(); if ($problem->getFromDB($this->input["problems_id"])) { $options = array(); NotificationEvent::raiseEvent("new", $problem, $options); } } parent::post_addItem(); } /** * @since version 0.84 **/ function post_deleteFromDB() { global $CFG_GLPI; $donotif = $CFG_GLPI["use_mailing"]; if (isset($this->input["_no_notif"]) && $this->input["_no_notif"]) { $donotif = false; } if ($donotif) { $problem = new Problem(); if ($problem->getFromDB($this->fields["problems_id"])) { $options = array(); NotificationEvent::raiseEvent("delete", $problem, $options); } } parent::post_deleteFromDB(); } /** * @see CommonDBTM::showSpecificMassiveActionsParameters() * * @since version 0.84 **/ function showSpecificMassiveActionsParameters($input=array()) { switch ($input['action']) { case "solveticket" : $problem = new Problem(); if (isset($input['problems_id']) && $problem->getFromDB($input['problems_id'])) { Ticket::showMassiveSolutionForm($problem->getEntityID()); echo "

    "; return true; } return false; default : return parent::showSpecificMassiveActionsParameters($input); } return false; } /** * @see CommonDBTM::doSpecificMassiveActions() * * @since version 0.84 **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "solveticket" : $ticket = new Ticket(); foreach ($input["item"] as $key => $val) { if ($val == 1) { if ($this->can($key,'r')) { if ($ticket->getFromDB($this->fields['tickets_id']) && $ticket->canSolve()) { $toupdate = array(); $toupdate['id'] = $ticket->getID(); $toupdate['solutiontypes_id'] = $input['solutiontypes_id']; $toupdate['solution'] = $input['solution']; if ($ticket->update($toupdate)) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } else { $res['noright']++; } } } break; default : return parent::doSpecificMassiveActions($input); } return $res; } /** * Show tickets for a problem * * @param $problem Problem object **/ static function showForProblem(Problem $problem) { global $DB, $CFG_GLPI; $ID = $problem->getField('id'); if (!$problem->can($ID,'r')) { return false; } $canedit = $problem->can($ID,'w'); $rand = mt_rand(); $query = "SELECT DISTINCT `glpi_problems_tickets`.`id` AS linkID, `glpi_tickets`.* FROM `glpi_problems_tickets` LEFT JOIN `glpi_tickets` ON (`glpi_problems_tickets`.`tickets_id` = `glpi_tickets`.`id`) WHERE `glpi_problems_tickets`.`problems_id` = '$ID' ORDER BY `glpi_tickets`.`name`"; $result = $DB->query($query); $tickets = array(); $used = array(); if ($numrows = $DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $tickets[$data['id']] = $data; $used[$data['id']] = $data['id']; } } if ($canedit) { echo "
    "; echo ""; echo ""; echo ""; echo ""; echo "
    ".__('Add a ticket')."
    "; echo ""; $condition = "`glpi_tickets`.`status` NOT IN ('".implode("', '", array_merge(Ticket::getSolvedStatusArray(), Ticket::getClosedStatusArray()))."')"; Ticket::dropdown(array('used' => $used, 'entity' => $problem->getEntityID(), 'entity_sons' => $problem->isRecursive(), 'condition' => $condition, 'displaywith' => array('id'))); echo ""; echo ""; echo "
    "; Html::closeForm(); echo "
    "; } echo "
    "; if ($canedit && $numrows) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $massiveactionparams = array('num_displayed' => $numrows, 'specific_actions' => array('purge' => _x('button', 'Delete permanently'), 'solveticket' => __('Solve tickets')), 'extraparams' => array('problems_id' => $problem->getID()), 'width' => 1000, 'height' => 500); Html::showMassiveActions(__CLASS__, $massiveactionparams); } echo ""; echo ""; echo ""; if ($numrows) { Ticket::commonListHeader(Search::HTML_OUTPUT,'mass'.__CLASS__.$rand); Session::initNavigateListItems('Ticket', //TRANS : %1$s is the itemtype name, // %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), Problem::getTypeName(1), $problem->fields["name"])); $i = 0; foreach ($tickets as $data) { Session::addToNavigateListItems('Ticket', $data["id"]); Ticket::showShort($data['id'], false, Search::HTML_OUTPUT, $i, $data['linkID']); $i++; } } echo "
    ".Ticket::getTypeName($numrows)."
    "; if ($canedit && $numrows) { $massiveactionparams['ontop'] = false; Html::showMassiveActions(__CLASS__, $massiveactionparams); Html::closeForm(); } echo "
    "; } /** * Show problems for a ticket * * @param $ticket Ticket object **/ static function showForTicket(Ticket $ticket) { global $DB, $CFG_GLPI; $ID = $ticket->getField('id'); if (!Session::haveRight("show_all_problem", 1) || !$ticket->can($ID,'r')) { // if (!$ticket->can($ID,'r')) { return false; } $canedit = $ticket->can($ID,'w'); $rand = mt_rand(); $query = "SELECT DISTINCT `glpi_problems_tickets`.`id` AS linkID, `glpi_problems`.* FROM `glpi_problems_tickets` LEFT JOIN `glpi_problems` ON (`glpi_problems_tickets`.`problems_id` = `glpi_problems`.`id`) WHERE `glpi_problems_tickets`.`tickets_id` = '$ID' ORDER BY `glpi_problems`.`name`"; $result = $DB->query($query); $problems = array(); $used = array(); if ($numrows = $DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $problems[$data['id']] = $data; $used[$data['id']] = $data['id']; } } if ($canedit) { echo "
    "; echo ""; echo ""; echo ""; echo "
    ".__('Add a problem')."
    "; echo ""; $condition = "`glpi_problems`.`status` NOT IN ('".implode("', '", array_merge(Problem::getSolvedStatusArray(), Problem::getClosedStatusArray()))."')"; Problem::dropdown(array('used' => $used, 'entity' => $ticket->getEntityID(), 'condition' => $condition)); echo ""; echo ""; echo ""; echo ""; _e('Create a problem from this ticket'); echo ""; echo "
    "; Html::closeForm(); echo "
    "; } echo "
    "; if ($canedit && $numrows) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $massiveactionparams = array('num_displayed' => $numrows); Html::showMassiveActions(__CLASS__, $massiveactionparams); } echo ""; echo ""; echo ""; if ($numrows) { Problem::commonListHeader(Search::HTML_OUTPUT,'mass'.__CLASS__.$rand); Session::initNavigateListItems('Problem', //TRANS : %1$s is the itemtype name, // %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), Ticket::getTypeName(1), $ticket->fields["name"])); $i = 0; foreach ($problems as $data) { Session::addToNavigateListItems('Problem', $data["id"]); Problem::showShort($data['id'], Search::HTML_OUTPUT, $i, $data['linkID']); $i++; } } echo "
    ".Problem::getTypeName($numrows)."
    "; if ($canedit && $numrows) { $massiveactionparams['ontop'] = false; Html::showMassiveActions(__CLASS__, $massiveactionparams); Html::closeForm(); } echo "
    "; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (Session::haveRight("show_all_problem","1")) { $nb = 0; switch ($item->getType()) { case 'Ticket' : if ($_SESSION['glpishow_count_on_tabs']) { $nb = countElementsInTable('glpi_problems_tickets', "`tickets_id` = '".$item->getID()."'"); } return self::createTabEntry(self::getTypeName(2), $nb); } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($item->getType()) { case 'Ticket' : self::showForTicket($item); break; } return true; } } ?> glpi-0.84.3+dfsg.1/inc/problem_user.class.php000066400000000000000000000027261226600447100207140ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Problem_User class Problem_User extends CommonITILActor { // From CommonDBRelation static public $itemtype_1 = 'Problem'; static public $items_id_1 = 'problems_id'; static public $itemtype_2 = 'User'; static public $items_id_2 = 'users_id'; } ?> glpi-0.84.3+dfsg.1/inc/problemtask.class.php000066400000000000000000000114751226600447100205420ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class ProblemTask extends CommonITILTask { /** * @since version 0.84 **/ static function getTypeName($nb=0) { return _n('Problem task', 'Problem tasks', $nb); } static function canCreate() { return (Session::haveRight('show_my_problem', '1') || Session::haveRight('edit_all_problem', '1')); } static function canView() { return (Session::haveRight('show_all_problem', 1) || Session::haveRight('show_my_problem', 1)); } static function canUpdate() { return (Session::haveRight('edit_all_problem', 1) || Session::haveRight('show_my_problem', 1)); } function canViewPrivates() { return true; } function canEditAll() { return Session::haveRight('edit_all_problem', 1); } /** * Is the current user have right to show the current task ? * * @return boolean **/ function canViewItem() { return parent::canReadITILItem(); } /** * Is the current user have right to create the current task ? * * @return boolean **/ function canCreateItem() { if (!parent::canReadITILItem()) { return false; } $problem = new Problem(); if ($problem->getFromDB($this->fields['problems_id'])) { return (Session::haveRight("edit_all_problem","1") || (Session::haveRight("show_my_problem","1") && ($problem->isUser(CommonITILActor::ASSIGN, Session::getLoginUserID()) || (isset($_SESSION["glpigroups"]) && $problem->haveAGroup(CommonITILActor::ASSIGN, $_SESSION['glpigroups']))))); } return false; } /** * Is the current user have right to update the current task ? * * @return boolean **/ function canUpdateItem() { if (!parent::canReadITILItem()) { return false; } if (($this->fields["users_id"] != Session::getLoginUserID()) && !Session::haveRight('edit_all_problem',1)) { return false; } return true; } /** * Is the current user have right to delete the current task ? * * @return boolean **/ function canDeleteItem() { return Session::haveRight('delete_problem', '1'); } /** * Populate the planning with planned ticket tasks * * @param $options array of possible options: * - who ID of the user (0 = undefined) * - who_group ID of the group of users (0 = undefined) * - begin Date * - end Date * * @return array of planning item **/ static function populatePlanning($options=array()) { return parent::genericPopulatePlanning('ProblemTask', $options); } /** * Display a Planning Item * * @param $val Array of the item to display * * @return Already planned information **/ static function getAlreadyPlannedInformation($val) { return parent::genericGetAlreadyPlannedInformation('ProblemTask', $val); } /** * Display a Planning Item * * @param $val array of the item to display * @param $who ID of the user (0 if all) * @param $type position of the item in the time block (in, through, begin or end) * (default '') * @param $complete complete display (more details) (default 0) * * @return Nothing (display function) **/ static function displayPlanningItem(array $val, $who, $type="", $complete=0) { return parent::genericDisplayPlanningItem('ProblemTask',$val, $who, $type, $complete); } } ?>glpi-0.84.3+dfsg.1/inc/profile.class.php000066400000000000000000002533061226600447100176600ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Profile class class Profile extends CommonDBTM { // Specific ones /// Helpdesk fields of helpdesk profiles static public $helpdesk_rights = array('add_followups', 'create_ticket', 'create_ticket_on_login', 'create_request_validation', 'create_incident_validation', 'faq', 'group_add_followups', 'helpdesk_hardware', 'helpdesk_item_type', 'observe_ticket', 'password_update', 'reminder_public', 'reservation_helpdesk', 'rssfeed_public', 'show_group_hardware', 'show_group_ticket', 'ticketrecurrent', 'tickettemplates_id', 'ticket_cost', 'update_own_followups', 'validate_incident', 'validate_request'); /// Common fields used for all profiles type static public $common_fields = array('id', 'interface', 'is_default', 'name'); /// Fields not related to a basic right static public $noright_fields = array('comment', /*'change_status',*/ 'date_mod', 'helpdesk_hardware','helpdesk_item_type', 'own_ticket', 'problem_status', 'show_group_hardware', 'show_group_ticket', 'ticket_status'); var $dohistory = true; function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } static function getTypeName($nb=0) { return _n('Profile', 'Profiles', $nb); } static function canCreate() { return Session::haveRight('profile', 'w'); } static function canView() { return Session::haveRight('profile', 'r'); } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab(__CLASS__, $ong, $options); $this->addStandardTab('Profile_User', $ong, $options); $this->addStandardTab('Log',$ong, $options); return $ong; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { switch ($item->getType()) { case __CLASS__ : if ($item->fields['interface'] == 'helpdesk') { $ong[1] = __('Simplified interface'); // Helpdesk } else { $ong[2] = sprintf(__('%1$s/%2$s'), sprintf(__('%1$s/%2$s'),__('Assets'), __('Management')), __('Tools')); $ong[3] = __('Assistance'); $ong[4] = __('Life cycles'); $ong[5] = __('Administration'); $ong[6] = __('Setup'); } return $ong; } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType() == __CLASS__) { $item->cleanProfile(); switch ($tabnum) { case 1 : $item->showFormHelpdesk(); break; case 2 : $item->showFormInventory(); break; case 3 : $item->showFormTracking(); break; case 4 : $item->showFormLifeCycle(); break; case 5 : $item->showFormAdmin(); break; case 6 : $item->showFormSetup(); break; } } return true; } function post_updateItem($history=1) { global $DB; if (in_array('is_default',$this->updates) && ($this->input["is_default"] == 1)) { $query = "UPDATE ". $this->getTable()." SET `is_default` = '0' WHERE `id` <> '".$this->input['id']."'"; $DB->query($query); } } function post_addItem() { global $DB; if (isset($this->fields['is_default']) && ($this->fields["is_default"] == 1)) { $query = "UPDATE ". $this->getTable()." SET `is_default` = '0' WHERE `id` <> '".$this->fields['id']."'"; $DB->query($query); } } function cleanDBonPurge() { global $DB; $query = "DELETE FROM `glpi_profiles_users` WHERE `profiles_id` = '".$this->fields['id']."'"; $DB->query($query); Rule::cleanForItemAction($this); // PROFILES and UNIQUE_PROFILE in RuleMailcollector Rule::cleanForItemCriteria($this, 'PROFILES'); Rule::cleanForItemCriteria($this, 'UNIQUE_PROFILE'); $gki = new KnowbaseItem_Profile(); $gki->cleanDBonItemDelete($this->getType(), $this->fields['id']); $gr = new Profile_Reminder(); $gr->cleanDBonItemDelete($this->getType(), $this->fields['id']); } /** * check right before delete * * @since version 0.84 * * @return boolean **/ function pre_deleteItem() { global $DB; if (($this->fields['profile'] == 'w') && (countElementsInTable($this->getTable(), "`profile` = 'w'") == 1)) { Session::addMessageAfterRedirect(__("This profile is the last with write rights on profiles"), false, ERROR); Session::addMessageAfterRedirect(__("Deletion refused"), false, ERROR); return false; } return true; } function prepareInputForUpdate($input) { // Check for faq if (isset($input["interface"]) && ($input["interface"] == 'helpdesk')) { if (isset($input["faq"]) && ($input["faq"] == 'w')) { $input["faq"] == 'r'; } } if (isset($input["_helpdesk_item_types"])) { if (isset($input["helpdesk_item_type"])) { $input["helpdesk_item_type"] = exportArrayToDB($input["helpdesk_item_type"]); } else { $input["helpdesk_item_type"] = exportArrayToDB(array()); } } if (isset($input["_cycles_ticket"])) { $tab = Ticket::getAllStatusArray(); $cycle = array(); foreach ($tab as $from => $label) { foreach ($tab as $dest => $label) { if (($from != $dest) && ($input["_cycle_ticket"][$from][$dest] == 0)) { $cycle[$from][$dest] = 0; } } } $input["ticket_status"] = exportArrayToDB($cycle); } if (isset($input["_cycles_problem"])) { $tab = Problem::getAllStatusArray(); $cycle = array(); foreach ($tab as $from => $label) { foreach ($tab as $dest => $label) { if (($from != $dest) && ($input["_cycle_problem"][$from][$dest] == 0)) { $cycle[$from][$dest] = 0; } } } $input["problem_status"] = exportArrayToDB($cycle); } // if (isset($input["_cycles_change"])) { // $tab = Change::getAllStatusArray(); // $cycle = array(); // foreach ($tab as $from => $label) { // foreach ($tab as $dest => $label) { // if (($from != $dest) // && ($input["_cycle_change"][$from][$dest] == 0)) { // $cycle[$from][$dest] = 0; // } // } // } // $input["change_status"] = exportArrayToDB($cycle); // } // check if right if the last write profile on Profile object if (($this->fields['profile'] == 'w') && isset($input['profile']) && ($input['profile'] != 'w') && (countElementsInTable($this->getTable(), "`profile` = 'w'") == 1)) { Session::addMessageAfterRedirect(__("This profile is the last with write rights on profiles"), false, ERROR); Session::addMessageAfterRedirect(__("Deletion refused"), false, ERROR); unset($input["profile"]); } return $input; } function prepareInputForAdd($input) { if (isset($input["helpdesk_item_type"])) { $input["helpdesk_item_type"] = exportArrayToDB($input["helpdesk_item_type"]); } return $input; } /** * Unset unused rights for helpdesk **/ function cleanProfile() { if ($this->fields["interface"] == "helpdesk") { foreach ($this->fields as $key=>$val) { if (!in_array($key,self::$common_fields) && !in_array($key,self::$helpdesk_rights)) { unset($this->fields[$key]); } } } // decode array if (isset($this->fields["helpdesk_item_type"]) && !is_array($this->fields["helpdesk_item_type"])) { $this->fields["helpdesk_item_type"] = importArrayFromDB($this->fields["helpdesk_item_type"]); } // Empty/NULL case if (!isset($this->fields["helpdesk_item_type"]) || !is_array($this->fields["helpdesk_item_type"])) { $this->fields["helpdesk_item_type"] = array(); } // Decode status array $fields_to_decode = array('ticket_status','problem_status'/*,'change_status'*/); foreach ($fields_to_decode as $val) { if (isset($this->fields[$val]) && !is_array($this->fields[$val])) { $this->fields[$val] = importArrayFromDB($this->fields[$val]); // Need to be an array not a null value if (is_null($this->fields[$val])) { $this->fields[$val] = array(); } } } } /** * Get SQL restrict request to determine profiles with less rights than the active one * * @param $separator string Separator used at the beginning of the request (default 'AND') * * @return SQL restrict string **/ static function getUnderActiveProfileRetrictRequest($separator="AND") { $query = $separator ." "; // Not logged -> no profile to see if (!isset($_SESSION['glpiactiveprofile'])) { return $query." 0 "; } // Profile right : may modify profile so can attach all profile if (Session::haveRight("profile","w")) { return $query." 1 "; } if ($_SESSION['glpiactiveprofile']['interface']=='central') { $query .= " (`glpi_profiles`.`interface` = 'helpdesk') " ; } $query .= " OR (`glpi_profiles`.`interface` = '".$_SESSION['glpiactiveprofile']['interface']."' "; foreach ($_SESSION['glpiactiveprofile'] as $key => $val) { if (!is_array($val) // Do not include entities field added by login && !in_array($key,self::$common_fields) && !in_array($key,self::$noright_fields) && (($_SESSION['glpiactiveprofile']['interface'] == 'central') || in_array($key,self::$helpdesk_rights))) { switch ($val) { case '0' : $query .= " AND (`glpi_profiles`.`$key` IS NULL OR `glpi_profiles`.`$key` IN ('0', '')) "; break; case '1' : $query .= " AND (`glpi_profiles`.`$key` IS NULL OR `glpi_profiles`.`$key` IN ('0', '1', '')) "; break; case 'r' : $query .= " AND (`glpi_profiles`.`$key` IS NULL OR `glpi_profiles`.`$key` IN ('r', '')) "; break; case 'w' : $query .= " AND (`glpi_profiles`.`$key` IS NULL OR `glpi_profiles`.`$key` IN ('w', 'r', '')) "; break; default : $query .= " AND (`glpi_profiles`.`$key` IS NULL OR `glpi_profiles`.`$key` IN ('0', '')) "; } } } $query .= ")"; return $query; } /** * Is the current user have more right than all profiles in parameters * * @param $IDs array of profile ID to test * * @return boolean true if have more right **/ static function currentUserHaveMoreRightThan($IDs=array()) { global $DB; if (count($IDs) == 0) { // Check all profiles (means more right than all possible profiles) return (countElementsInTable('glpi_profiles') == countElementsInTable('glpi_profiles', self::getUnderActiveProfileRetrictRequest(''))); } $under_profiles = array(); $query = "SELECT * FROM `glpi_profiles` ". self::getUnderActiveProfileRetrictRequest("WHERE"); $result = $DB->query($query); while ($data = $DB->fetch_assoc($result)) { $under_profiles[$data['id']] = $data['id']; } foreach ($IDs as $ID) { if (!isset($under_profiles[$ID])) { return false; } } return true; } function showLegend() { echo "
    "; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "
    "; echo __('Caption')."".__('Global right')."
    ".__('Entity right')."
    \n"; } function post_getEmpty() { $this->fields["interface"] = "helpdesk"; $this->fields["name"] = __('Without name'); } /** * Print the profile form headers * * @param $ID integer : Id of the item to print * @param $options array of possible options * - target filename : where to go when done. * - withtemplate boolean : template or basic item * * @return boolean item found **/ function showForm($ID, $options=array()) { $onfocus = ""; $new = false; $rowspan = 5; if ($ID > 0) { $rowspan++; $this->check($ID,'r'); } else { // Create item $this->check(-1,'w'); $onfocus = "onfocus=\"if (this.value=='".$this->fields["name"]."') this.value='';\""; $new = true; } $rand = mt_rand(); $this->showTabs($options); $this->showFormHeader($options); echo "".__('Name').""; echo "fields["name"]."\" $onfocus>"; echo "".__('Comments').""; echo ""; echo ""; echo ""; echo "".__('Default profile').""; Dropdown::showYesNo("is_default", $this->fields["is_default"]); echo "\n"; echo "".__("Profile's interface").""; echo ""; Dropdown::showFromArray('interface', self::getInterfaces(), array('value'=>$this->fields["interface"])); echo "\n"; echo "".__('Update password').""; Dropdown::showYesNo("password_update", $this->fields["password_update"]); echo "\n"; echo "".__('Ticket creation form on login').""; Dropdown::showYesNo("create_ticket_on_login", $this->fields["create_ticket_on_login"]); echo "\n"; if ($ID > 0) { echo "".__('Last update').""; echo ""; echo ($this->fields["date_mod"] ? Html::convDateTime($this->fields["date_mod"]) : __('Never')); echo ""; } $this->showFormButtons($options); $this->addDivForTabs(); return true; } /** * Print the helpdesk right form for the current profile **/ function showFormHelpdesk() { global $CFG_GLPI; if (!Session::haveRight("profile","r")) { return false; } if ($canedit = Session::haveRight("profile","w")) { echo ""; } echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo "\n"; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; if ($canedit) { echo ""; echo "\n"; echo "
    ".__('Assistance')."
    ".__('Create a ticket').""; Dropdown::showYesNo("create_ticket", $this->fields["create_ticket"]); echo "".__('Add a followup to tickets (requester)').""; Dropdown::showYesNo("add_followups", $this->fields["add_followups"]); echo "
    ".__('Default ticket template').""; // Only root entity ones and recursive $options = array('value' => $this->fields["tickettemplates_id"], 'entity' => 0); if (Session::isMultiEntitiesMode()) { $options['condition'] = '`is_recursive` = 1'; } TicketTemplate::dropdown($options); echo "".__('Add a followup to tickets of associated groups').""; Dropdown::showYesNo("group_add_followups", $this->fields["group_add_followups"]); echo "
    ".__('See public followups and tasks').""; Dropdown::showYesNo("observe_ticket", $this->fields["observe_ticket"]); echo "".__('See tickets created by my groups').""; Dropdown::showYesNo("show_group_ticket", $this->fields["show_group_ticket"]); echo "
    ".__('See hardware of my group(s)').""; Dropdown::showYesNo("show_group_hardware", $this->fields["show_group_hardware"]); echo "".__('Update followups (author)').""; Dropdown::showYesNo("update_own_followups", $this->fields["update_own_followups"]); echo "
    ".__('Link with items for the creation of tickets').""; Dropdown::showFromArray('helpdesk_hardware', self::getHelpdeskHardwareTypes(), array('value' => $this->fields["helpdesk_hardware"])); echo "".__('Associable items to a ticket').""; self::dropdownHelpdeskItemtypes(array('values' => $this->fields["helpdesk_item_type"])); echo "
    ".__('Create a validation request for a request').""; Dropdown::showYesNo("create_request_validation", $this->fields["create_request_validation"]); echo "".__('Create a validation request for an incident').""; Dropdown::showYesNo("create_incident_validation", $this->fields["create_incident_validation"]); echo "
    ".__('Validate a request').""; Dropdown::showYesNo("validate_request", $this->fields["validate_request"]); echo "".__('Validate an incident').""; Dropdown::showYesNo("validate_incident", $this->fields["validate_incident"]); echo "
    ".__('Tools')."
    ".__('FAQ').""; if (($this->fields["interface"] == "helpdesk") && ($this->fields["faq"] == 'w')) { $this->fields["faq"] = 'r'; } self::dropdownRight("faq", array('value' => $this->fields["faq"], 'nowrite' => true)); echo ""._n('Reservation', 'Reservations', 2).""; Dropdown::showYesNo("reservation_helpdesk", $this->fields["reservation_helpdesk"]); echo "
    "._n('Public reminder', 'Public reminders', 2).""; self::dropdownRight("reminder_public", array('value' => $this->fields["reminder_public"], 'nowrite' => true)); echo ""._n('Public RSS feed', 'Public RSS feeds', 2).""; self::dropdownRight("rssfeed_public", array('value' => $this->fields["rssfeed_public"], 'nowrite' => true)); echo "
    "; echo ""; echo ""; echo "
    \n"; Html::closeForm(); } else { echo "\n"; } } /** * Print the Inventory/Management/Toolsd right form for the current profile * * @param $openform boolean open the form (true by default) * @param $closeform boolean close the form (true by default) **/ function showFormInventory($openform=true, $closeform=true) { if (!Session::haveRight("profile","r")) { return false; } if (($canedit=Session::haveRight("profile","w")) && $openform) { echo ""; } echo "
    "; echo ""; // Inventory echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo "\n"; echo ""; // Gestion / Management echo ""; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo "\n"; // Outils / Tools echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; if ($canedit && $closeform) { echo ""; echo "\n"; echo "
    ".__('Assets')."
    "._n('Computer', 'Computers', 2).""; self::dropdownRight("computer", array('value' => $this->fields["computer"])); echo ""._n('Monitor', 'Monitors', 2).""; self::dropdownRight("monitor", array('value' => $this->fields["monitor"])); echo ""._n('Software', 'Software', 2).""; self::dropdownRight("software", array('value' => $this->fields["software"])); echo "
    "._n('Network', 'Networks', 2).""; self::dropdownRight("networking", array('value' => $this->fields["networking"])); echo ""._n('Printer', 'Printers', 2).""; self::dropdownRight("printer", array('value' => $this->fields["printer"])); echo ""._n('Cartridge', 'Cartridges', 2).""; self::dropdownRight("cartridge", array('value' => $this->fields["cartridge"])); echo "
    "._n('Consumable', 'Consumables', 2).""; self::dropdownRight("consumable", array('value' => $this->fields["consumable"])); echo ""._n('Phone', 'Phones', 2).""; self::dropdownRight("phone", array('value' => $this->fields["phone"])); echo ""._n('Device', 'Devices', 2).""; self::dropdownRight("peripheral", array('value' => $this->fields["peripheral"])); echo "
    ".__('Internet').""; self::dropdownRight("internet", array('value' => $this->fields["internet"])); echo " 
    ".__('Management')."
    "._n('Contacts', 'Contacts', 2)." / "._n('Supplier', 'Suppliers', 2).""; self::dropdownRight("contact_enterprise", array('value' => $this->fields["contact_enterprise"])); echo ""._n('Document', 'Documents', 2).""; self::dropdownRight("document", array('value' => $this->fields["document"])); echo ""._n('Contract', 'Contracts', 2).""; self::dropdownRight("contract", array('value' => $this->fields["contract"])); echo "
    ".__('Financial and administratives information').""; self::dropdownRight("infocom", array('value' => $this->fields["infocom"])); echo "".__('Budget').""; self::dropdownRight("budget", array('value' => $this->fields["budget"])); echo "
    ".__('Tools')."
    "._n('Public reminder', 'Public reminders', 2).""; self::dropdownRight("reminder_public", array('value' => $this->fields["reminder_public"])); echo ""._n('Public RSS feed', 'Public RSS feeds', 2).""; self::dropdownRight("rssfeed_public", array('value' => $this->fields["rssfeed_public"])); echo ""._n('Public bookmark', 'Public bookmarks', 2).""; self::dropdownRight("bookmark_public", array('value' => $this->fields["bookmark_public"])); echo "
    ".__('FAQ').""; self::dropdownRight("faq", array('value' => $this->fields["faq"])); echo ""._n('Report', 'Reports', 2).""; self::dropdownRight("reports", array('value' => $this->fields["reports"], 'nowrite' => true)); echo ""._n('Reservation', 'Reservations', 2).""; Dropdown::showYesNo("reservation_helpdesk", $this->fields["reservation_helpdesk"]); echo "
    ".__('Knowledge base').""; self::dropdownRight("knowbase", array('value' => $this->fields["knowbase"])); echo "".__('Knowledge base administration').""; Dropdown::showYesNo("knowbase_admin", $this->fields["knowbase_admin"]); echo "".__('Administration of reservations').""; self::dropdownRight("reservation_central", array('value' => $this->fields["reservation_central"])); echo "
    ".__('Item notes').""; self::dropdownRight("notes", array('value' => $this->fields["notes"])); echo ""; echo "
    "; echo ""; echo ""; echo "
    \n"; Html::closeForm(); } else { echo "\n"; } echo "
    "; } /** * Print the Tracking right form for the current profile * * @param $openform boolean open the form (true by default) * @param $closeform boolean close the form (true by default) **/ function showFormTracking($openform=true, $closeform=true) { global $CFG_GLPI; if (!Session::haveRight("profile","r")) { return false; } if (($canedit = Session::haveRight("profile","w")) && $openform) { echo ""; } echo "
    "; echo ""; // Assistance / Tracking-helpdesk echo "\n"; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo "\n"; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo "\n"; echo "<"; echo "/tr>\n"; echo ""; echo ""; echo "\n"; echo ""; echo "\n"; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n\n"; echo ""; echo ""; echo "\n"; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo "\n"; echo ""; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; // echo ""; // echo ""; // echo ""; // echo ""; // echo "\n"; if ($canedit && $closeform) { echo ""; echo "\n"; echo "
    ".__('Assistance')."
    ".__('Creation')."
    ".__('Create a ticket').""; Dropdown::showYesNo("create_ticket", $this->fields["create_ticket"]); echo "".__('Add a followup to tickets (requester)').""; Dropdown::showYesNo("add_followups", $this->fields["add_followups"]); echo "".__('Add a followup to all tickets').""; Dropdown::showYesNo("global_add_followups", $this->fields["global_add_followups"]); echo "
    ".__('Add a followup to tickets of associated groups').""; Dropdown::showYesNo("group_add_followups", $this->fields["group_add_followups"]); echo "".__('Add a task to all tickets').""; Dropdown::showYesNo("global_add_tasks", $this->fields["global_add_tasks"]); echo "".__('Default ticket template').""; // Only root entity ones and recursive $options = array('value' => $this->fields["tickettemplates_id"], 'entity' => 0); if (Session::isMultiEntitiesMode()) { $options['condition'] = '`is_recursive` = 1'; } TicketTemplate::dropdown($options); echo "
    "._n('Ticket cost', 'Ticket costs', 2).""; self::dropdownRight("ticketcost", array('value' => $this->fields["ticketcost"])); echo ""._n('Ticket template', 'Ticket templates', 2).""; self::dropdownRight("tickettemplate", array('value' => $this->fields["tickettemplate"])); echo "".__('Recurrent tickets').""; self::dropdownRight("ticketrecurrent", array('value' => $this->fields["ticketrecurrent"])); echo "
    "._x('noun','Update')."
    ".__('Update a ticket').""; Dropdown::showYesNo("update_ticket", $this->fields["update_ticket"]); echo "".__('Change the priority').""; Dropdown::showYesNo("update_priority", $this->fields["update_priority"]); echo "".__('Edit all tasks').""; Dropdown::showYesNo("update_tasks", $this->fields["update_tasks"]); echo "
    ".__('Update followups (author)').""; Dropdown::showYesNo("update_own_followups", $this->fields["update_own_followups"]); echo "".__('Update all followups').""; Dropdown::showYesNo("update_followups", $this->fields["update_followups"]); echo "
    ".__('Deletion')."
    ".__("Ticket's deletion").""; Dropdown::showYesNo("delete_ticket", $this->fields["delete_ticket"]); echo "".__('Delete all followups').""; Dropdown::showYesNo("delete_followups", $this->fields["delete_followups"]); echo "".__('Delete all validations').""; Dropdown::showYesNo("delete_validations", $this->fields["delete_validations"]); echo "
    ".__('Approval')."
    ".__('Create a validation request for a request').""; Dropdown::showYesNo("create_request_validation", $this->fields["create_request_validation"]); echo "".__('Create a validation request for an incident').""; Dropdown::showYesNo("create_incident_validation", $this->fields["create_incident_validation"]); echo "
    ".__('Validate a request').""; Dropdown::showYesNo("validate_request", $this->fields["validate_request"]); echo "".__('Validate an incident').""; Dropdown::showYesNo("validate_incident", $this->fields["validate_incident"]); echo "
    ".__('Assignment')."
    ".__('To be in charge of a ticket').""; Dropdown::showYesNo("own_ticket", $this->fields["own_ticket"]); echo "".__('Steal a ticket').""; Dropdown::showYesNo("steal_ticket", $this->fields["steal_ticket"]); echo "".__('Assign a ticket').""; Dropdown::showYesNo("assign_ticket", $this->fields["assign_ticket"]); echo "
    ".__('Association')."
    ".__('See hardware of my groups').""; Dropdown::showYesNo("show_group_hardware", $this->fields["show_group_hardware"]); echo "".__('Link with items for the creation of tickets').""; Dropdown::showFromArray('helpdesk_hardware', self::getHelpdeskHardwareTypes(), array('value' => $this->fields["helpdesk_hardware"])); echo "".__('Associable items to a ticket').""; self::dropdownHelpdeskItemtypes(array('values' => $this->fields["helpdesk_item_type"])); echo "
    ".__('Visibility')."
    ".__('See assigned tickets (personnal + group associated)').""; Dropdown::showYesNo("show_assign_ticket", $this->fields["show_assign_ticket"]); echo "".__('See tickets created by my groups').""; Dropdown::showYesNo("show_group_ticket", $this->fields["show_group_ticket"]); echo "".__('See all tickets').""; Dropdown::showYesNo("show_all_ticket", $this->fields["show_all_ticket"]); echo "
    ".__('See public followups and tasks').""; Dropdown::showYesNo("observe_ticket", $this->fields["observe_ticket"]); echo "".__('See all followups and tasks (public and private)').""; Dropdown::showYesNo("show_full_ticket", $this->fields["show_full_ticket"]); echo "".__('Statistics').""; Dropdown::showYesNo("statistic", $this->fields["statistic"]); echo "
    ".__('See personnal planning').""; Dropdown::showYesNo("show_planning", $this->fields["show_planning"]); echo "".__('See schedule of people in my groups').""; Dropdown::showYesNo("show_group_planning", $this->fields["show_group_planning"]); echo "".__('See all plannings').""; Dropdown::showYesNo("show_all_planning", $this->fields["show_all_planning"]); echo "
    "._n('Problem', 'Problems', 2); echo "
    ".__('See all problems').""; Dropdown::showYesNo("show_all_problem", $this->fields["show_all_problem"]); echo "".__('See problems (author)').""; Dropdown::showYesNo("show_my_problem", $this->fields["show_my_problem"]); echo "".__('Update all problems').""; Dropdown::showYesNo("edit_all_problem", $this->fields["edit_all_problem"]); echo "
    ".__('Delete all problems').""; Dropdown::showYesNo("delete_problem", $this->fields["delete_problem"]); echo ""; echo "
    ".__('Update all changes').""; // Dropdown::showYesNo("edit_all_change", $this->fields["edit_all_change"]); // echo "".__('See all changes').""; // Dropdown::showYesNo("show_all_change", $this->fields["show_all_change"]); // echo "".__('See changes (author)').""; // Dropdown::showYesNo("show_my_change", $this->fields["show_my_change"]); // echo "
    "; echo ""; echo ""; echo "
    \n"; Html::closeForm(); } else { echo "\n"; } echo "
    "; } /** * Print the Life Cycles form for the current profile * * @param $openform boolean open the form (true by default) * @param $closeform boolean close the form (true by default) **/ function showFormLifeCycle($openform=true, $closeform=true) { if (!Session::haveRight("profile","r")) { return false; } if (($canedit = Session::haveRight("profile","w")) && $openform) { echo ""; } echo "
    "; echo ""; $tabstatus = Ticket::getAllStatusArray(); echo ""; //TRANS: \ to split row heading (From) and colums headin (To) for life cycles echo ""; } echo "\n"; foreach ($tabstatus as $from => $label) { echo ""; foreach ($tabstatus as $dest => $label) { echo ""; } echo "\n"; } echo "
    ".__('Life cycle of tickets')."
    ".__("From \ To"); echo ""; foreach ($tabstatus as $label) { echo "$label
    $label"; if ($dest == $from) { echo Dropdown::getYesNo(1); } else { Dropdown::showYesNo("_cycle_ticket[$from][$dest]", (!isset($this->fields['ticket_status'][$from][$dest]) || $this->fields['ticket_status'][$from][$dest])); } echo "
    "; echo ""; $tabstatus = Problem::getAllStatusArray(); echo ""; echo ""; } echo "\n"; foreach ($tabstatus as $from => $label) { echo ""; foreach ($tabstatus as $dest => $label) { echo ""; } echo "\n"; } echo "
    ".__('Life cycle of problems')."
    ".__('From \ To'); echo ""; foreach ($tabstatus as $label) { echo "$label
    $label"; if ($dest == $from) { echo Dropdown::getYesNo(1); } else { Dropdown::showYesNo("_cycle_problem[$from][$dest]", (!isset($this->fields['problem_status'][$from][$dest]) || $this->fields['problem_status'][$from][$dest])); } echo "
    "; echo ""; $tabstatus = Change::getAllStatusArray(); // echo ""; // echo ""; // } // echo "\n"; // // foreach ($tabstatus as $from => $label) { // echo ""; // foreach ($tabstatus as $dest => $label) { // echo ""; // } // echo "\n"; // } if ($canedit && $closeform) { echo ""; echo "\n"; echo "
    ".__('Life cycle of changes')."
    ".__('From \ To'); // echo ""; // foreach ($tabstatus as $label) { // echo "$label
    $label"; // if ($dest == $from) { // echo Dropdown::getYesNo(1); // } else { // Dropdown::showYesNo("_cycle_change[$from][$dest]", // (!isset($this->fields['change_status'][$from][$dest]) // || $this->fields['change_status'][$from][$dest])); // } // echo "
    "; echo ""; echo ""; echo "
    \n"; Html::closeForm(); } else { echo "\n"; } echo "
    "; } /** * Print the central form for a profile * * @param $openform boolean open the form (true by default) * @param $closeform boolean close the form (true by default) **/ function showFormAdmin($openform=true, $closeform=true) { if (!Session::haveRight("profile","r")) { return false; } echo "
    "; if (($canedit = Session::haveRight("profile","w")) && $openform) { echo ""; } echo ""; // Administration echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo ""; echo "\n"; echo "\n"; echo ""; echo ""; //TRANS: software in plural echo ""; echo ""; if ($canedit && $closeform) { echo ""; echo "\n"; echo "
    ".__('Administration')."
    "._n('User', 'Users', 2).""; self::dropdownRight("user", array('value' => $this->fields["user"])); echo ""._n('Group', 'Groups', 2).""; self::dropdownRight("group", array('value' => $this->fields["group"])); echo "".__('Method for user authentication and synchronization').""; self::dropdownRight("user_authtype", array('value' => $this->fields["user_authtype"])); echo "
    "._n('Entity', 'Entities', 2).""; self::dropdownRight("entity", array('value' => $this->fields["entity"])); echo "".__('Transfer').""; self::dropdownRight("transfer", array('value' => $this->fields["transfer"])); echo "".self::getTypeName(2).""; self::dropdownRight("profile", array('value' => $this->fields["profile"])); echo "
    ".__('Maintenance').""; self::dropdownRight("backup", array('value' => $this->fields["backup"], 'noread' => true)); echo ""._n('Log', 'Logs', 2).""; self::dropdownRight("logs", array('value' => $this->fields["logs"], 'nowrite' => true)); echo "".__('Add users from an external source').""; self::dropdownRight("import_externalauth_users", array('value' => $this->fields["import_externalauth_users"], 'noread' => true)); echo "
    "._n('Rule', 'Rules', 2)."
    ".__('Authorizations assignment rules').""; self::dropdownRight("rule_ldap", array('value' => $this->fields["rule_ldap"])); echo "".__('Rules for assigning a computer to an entity').""; self::dropdownRight("rule_import", array('value' => $this->fields["rule_import"])); echo "".__('Rules for assigning a ticket created through a mails receiver').""; self::dropdownRight("rule_mailcollector", array('value' => $this->fields["rule_mailcollector"])); echo "
    ".__('Rules for assigning a category to a software').""; self::dropdownRight("rule_softwarecategories", array('value' => $this->fields["rule_softwarecategories"])); echo "".__('Business rules for tickets').""; self::dropdownRight("rule_ticket", array('value' => $this->fields["rule_ticket"], 'nowrite' => true)); echo "".__('Business rules for tickets (entity)').""; self::dropdownRight("entity_rule_ticket", array('value' => $this->fields["entity_rule_ticket"])); echo"
    "._n('Dictionary', 'Dictionaries', 2)."
    ".__('Dropdowns dictionary').""; self::dropdownRight("rule_dictionnary_dropdown", array('value' => $this->fields["rule_dictionnary_dropdown"])); echo"".__('Software dictionary').""; self::dropdownRight("rule_dictionnary_software", array('value' => $this->fields["rule_dictionnary_software"])); echo "".__('Printers dictionnary').""; self::dropdownRight("rule_dictionnary_printer", array('value' => $this->fields["rule_dictionnary_printer"])); echo "
    "; echo ""; echo ""; echo "
    \n"; Html::closeForm(); } else { echo "\n"; } echo "
    "; $this->showLegend(); } /** * Print the central form for a profile * * @param $openform boolean open the form (true by default) * @param $closeform boolean close the form (true by default) **/ function showFormSetup($openform=true, $closeform=true) { if (!Session::haveRight("profile","r")) { return false; } echo "
    "; if (($canedit = Session::haveRight("profile","w")) && $openform) { echo ""; } echo ""; // Setup echo "\n"; echo ""; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo "\n"; echo ""; echo ""; echo "\n"; if ($canedit && $closeform) { echo ""; echo "\n"; echo "
    ".__('Setup')."
    ".__('General setup').""; self::dropdownRight("config", array('value' => $this->fields["config"], 'noread' => true)); echo "".__('Search result default display').""; self::dropdownRight("search_config_global", array('value' => $this->fields["search_config_global"], 'noread' => true)); echo "".__('Search result user display').""; self::dropdownRight("search_config", array('value' => $this->fields["search_config"], 'noread' => true)); echo "
    "._n('Component', 'Components', 2).""; self::dropdownRight("device", array('value' => $this->fields["device"], 'noread' => true)); echo ""._n('Dropdown', 'Dropdowns', 2).""; self::dropdownRight("dropdown", array('value' => $this->fields["dropdown"])); echo "".__('Entity dropdowns').""; self::dropdownRight("entity_dropdown", array('value' => $this->fields["entity_dropdown"])); echo "
    ".__('Document type').""; self::dropdownRight("typedoc", array('value' => $this->fields["typedoc"])); echo ""._n('External link', 'External links',2).""; self::dropdownRight("link", array('value' => $this->fields["link"])); echo "".__('Check for upgrade').""; self::dropdownRight("check_update", array('value' => $this->fields["check_update"], 'nowrite' => true)); echo "
    "._n('Notification', 'Notifications',2).""; self::dropdownRight("notification", array('value' => $this->fields["notification"])); echo ""._n('Calendar', 'Calendars', 2).""; self::dropdownRight("calendar", array('value' => $this->fields["calendar"])); echo "".__('Assistance').""; self::dropdownRight("entity_helpdesk", array('value' => $this->fields["entity_helpdesk"])); echo "
    ".__('SLA').""; self::dropdownRight("sla", array('value' => $this->fields["sla"])); echo " "; echo "
    "; echo ""; echo ""; echo "
    \n"; Html::closeForm(); } else { echo "\n"; } echo "
    "; $this->showLegend(); } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[19]['table'] = $this->getTable(); $tab[19]['field'] = 'date_mod'; $tab[19]['name'] = __('Last update'); $tab[19]['datatype'] = 'datetime'; $tab[19]['massiveaction'] = false; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'interface'; $tab[2]['name'] = __("Profile's interface"); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'specific'; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'is_default'; $tab[3]['name'] = __('Default profile'); $tab[3]['datatype'] = 'bool'; $tab[3]['massiveaction'] = false; $tab[118]['table'] = $this->getTable(); $tab[118]['field'] = 'create_ticket_on_login'; $tab[118]['name'] = __('Ticket creation form on login'); $tab[118]['datatype'] = 'bool'; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab['inventory'] = __('Assets'); $tab[20]['table'] = $this->getTable(); $tab[20]['field'] = 'computer'; $tab[20]['name'] = _n('Computer', 'Computers', 2); $tab[20]['datatype'] = 'right'; $tab[21]['table'] = $this->getTable(); $tab[21]['field'] = 'monitor'; $tab[21]['name'] = _n('Monitor', 'Monitors', 2); $tab[21]['datatype'] = 'right'; $tab[22]['table'] = $this->getTable(); $tab[22]['field'] = 'software'; $tab[22]['name'] = _n('Software', 'Software', 2); $tab[22]['datatype'] = 'right'; $tab[23]['table'] = $this->getTable(); $tab[23]['field'] = 'networking'; $tab[23]['name'] = _n('Network', 'Networks', 2); $tab[23]['datatype'] = 'right'; $tab[24]['table'] = $this->getTable(); $tab[24]['field'] = 'printer'; $tab[24]['name'] = _n('Printer', 'Printers',2); $tab[24]['datatype'] = 'right'; $tab[25]['table'] = $this->getTable(); $tab[25]['field'] = 'peripheral'; $tab[25]['name'] = _n('Device', 'Devices', 2); $tab[25]['datatype'] = 'right'; $tab[26]['table'] = $this->getTable(); $tab[26]['field'] = 'cartridge'; $tab[26]['name'] = _n('Cartridge', 'Cartridges', 2); $tab[26]['datatype'] = 'right'; $tab[27]['table'] = $this->getTable(); $tab[27]['field'] = 'consumable'; $tab[27]['name'] = _n('Consumable', 'Consumables', 2); $tab[27]['datatype'] = 'right'; $tab[28]['table'] = $this->getTable(); $tab[28]['field'] = 'phone'; $tab[28]['name'] = _n('Phone', 'Phones', 2); $tab[28]['datatype'] = 'right'; $tab[29]['table'] = $this->getTable(); $tab[29]['field'] = 'notes'; $tab[29]['name'] = __('Notes'); $tab[29]['datatype'] = 'right'; $tab[129]['table'] = $this->getTable(); $tab[129]['field'] = 'internet'; $tab[129]['name'] = __('Internet'); $tab[129]['datatype'] = 'right'; $tab['management'] = __('Management'); $tab[30]['table'] = $this->getTable(); $tab[30]['field'] = 'contact_enterprise'; $tab[30]['name'] = __('Contact')." / ".__('Supplier'); $tab[30]['datatype'] = 'right'; $tab[31]['table'] = $this->getTable(); $tab[31]['field'] = 'document'; $tab[31]['name'] = _n('Document', 'Documents', 2); $tab[31]['datatype'] = 'right'; $tab[32]['table'] = $this->getTable(); $tab[32]['field'] = 'contract'; $tab[32]['name'] = _n('Contract', 'Contracts', 2); $tab[32]['datatype'] = 'right'; $tab[33]['table'] = $this->getTable(); $tab[33]['field'] = 'infocom'; $tab[33]['name'] = __('Financial and administratives information'); $tab[33]['datatype'] = 'right'; $tab[101]['table'] = $this->getTable(); $tab[101]['field'] = 'budget'; $tab[101]['name'] = __('Budget'); $tab[101]['datatype'] = 'right'; $tab['tools'] = __('Tools'); $tab[34]['table'] = $this->getTable(); $tab[34]['field'] = 'knowbase'; $tab[34]['name'] = __('Knowledge base'); $tab[34]['datatype'] = 'right'; $tab[35]['table'] = $this->getTable(); $tab[35]['field'] = 'faq'; $tab[35]['name'] = __('FAQ'); $tab[35]['datatype'] = 'right'; $tab[36]['table'] = $this->getTable(); $tab[36]['field'] = 'reservation_helpdesk'; $tab[36]['name'] = _n('Reservation', 'Reservations', 2); $tab[36]['datatype'] = 'bool'; $tab[37]['table'] = $this->getTable(); $tab[37]['field'] = 'reservation_central'; $tab[37]['name'] = __('Administration of reservations'); $tab[37]['datatype'] = 'bool'; $tab[38]['table'] = $this->getTable(); $tab[38]['field'] = 'reports'; $tab[38]['name'] = _n('Report', 'Reports', 2); $tab[38]['datatype'] = 'right'; $tab[38]['nowrite'] = true; $tab['config'] = __('Setup'); $tab[42]['table'] = $this->getTable(); $tab[42]['field'] = 'dropdown'; $tab[42]['name'] = _n('Dropdown', 'Dropdowns', 2); $tab[42]['datatype'] = 'right'; $tab[43]['table'] = $this->getTable(); $tab[43]['field'] = 'entity_dropdown'; $tab[43]['name'] = __('Entity dropdowns'); $tab[43]['datatype'] = 'right'; $tab[44]['table'] = $this->getTable(); $tab[44]['field'] = 'device'; $tab[44]['name'] = _n('Component', 'Components', 2); $tab[44]['datatype'] = 'right'; $tab[44]['noread'] = true; $tab[106]['table'] = $this->getTable(); $tab[106]['field'] = 'notification'; $tab[106]['name'] = _n('Notification', 'Notifications',2); $tab[106]['datatype'] = 'right'; $tab[45]['table'] = $this->getTable(); $tab[45]['field'] = 'typedoc'; $tab[45]['name'] = __('Document type'); $tab[45]['datatype'] = 'right'; $tab[46]['table'] = $this->getTable(); $tab[46]['field'] = 'link'; $tab[46]['name'] = _n('External link', 'External links',2); $tab[46]['datatype'] = 'right'; $tab[47]['table'] = $this->getTable(); $tab[47]['field'] = 'config'; $tab[47]['name'] = __('General setup'); $tab[47]['datatype'] = 'right'; $tab[47]['noread'] = true; $tab[52]['table'] = $this->getTable(); $tab[52]['field'] = 'search_config'; $tab[52]['name'] = __('Search result user display'); $tab[52]['datatype'] = 'right'; $tab[52]['noread'] = true; $tab[53]['table'] = $this->getTable(); $tab[53]['field'] = 'search_config_global'; $tab[53]['name'] = __('Search result default display'); $tab[53]['datatype'] = 'right'; $tab[53]['noread'] = true; $tab[107]['table'] = $this->getTable(); $tab[107]['field'] = 'calendar'; $tab[107]['name'] = _n('Calendar', 'Calendars', 2); $tab[107]['datatype'] = 'right'; $tab['admin'] = __('Administration'); $tab[48]['table'] = $this->getTable(); $tab[48]['field'] = 'rule_ticket'; $tab[48]['name'] = __('Business rules for tickets'); $tab[48]['datatype'] = 'right'; $tab[48]['nowrite'] = true; $tab[105]['table'] = $this->getTable(); $tab[105]['field'] = 'rule_mailcollector'; $tab[105]['name'] = __('Rules for assigning a ticket created through a mails receiver'); $tab[105]['datatype'] = 'right'; $tab[49]['table'] = $this->getTable(); $tab[49]['field'] = 'rule_import'; $tab[49]['name'] = __('Rules for assigning a computer to an entity'); $tab[49]['datatype'] = 'right'; $tab[50]['table'] = $this->getTable(); $tab[50]['field'] = 'rule_ldap'; $tab[50]['name'] = __('Authorizations assignment rules'); $tab[50]['datatype'] = 'right'; $tab[51]['table'] = $this->getTable(); $tab[51]['field'] = 'rule_softwarecategories'; $tab[51]['name'] = __('Rules for assigning a category to a software'); $tab[51]['datatype'] = 'right'; $tab[90]['table'] = $this->getTable(); $tab[90]['field'] = 'rule_dictionnary_software'; $tab[90]['name'] = __('Software dictionary'); $tab[90]['datatype'] = 'right'; $tab[91]['table'] = $this->getTable(); $tab[91]['field'] = 'rule_dictionnary_dropdown'; $tab[91]['name'] =__('Dropdowns dictionary'); $tab[91]['datatype'] = 'right'; $tab[93]['table'] = $this->getTable(); $tab[93]['field'] = 'entity_rule_ticket'; $tab[93]['name'] = __('Business rules for tickets (entity)'); $tab[93]['datatype'] = 'right'; $tab[54]['table'] = $this->getTable(); $tab[54]['field'] = 'check_update'; $tab[54]['name'] = __('Check for upgrade'); $tab[54]['datatype'] = 'right'; $tab[54]['nowrite'] = true; $tab[55]['table'] = $this->getTable(); $tab[55]['field'] = 'profile'; $tab[55]['name'] = self::getTypeName(2); $tab[55]['datatype'] = 'right'; $tab[56]['table'] = $this->getTable(); $tab[56]['field'] = 'user'; $tab[56]['name'] = _n('User', 'Users', 2); $tab[56]['datatype'] = 'right'; $tab[57]['table'] = $this->getTable(); $tab[57]['field'] = 'user_authtype'; $tab[57]['name'] = __('Method for user authentication and synchronization'); $tab[57]['datatype'] = 'right'; $tab[104]['table'] = $this->getTable(); $tab[104]['field'] = 'import_externalauth_users'; $tab[104]['name'] = __('Add users from an external source'); $tab[104]['datatype'] = 'right'; $tab[104]['noread'] = true; $tab[58]['table'] = $this->getTable(); $tab[58]['field'] = 'group'; $tab[58]['name'] = _n('Group', 'Groups', 2); $tab[58]['datatype'] = 'right'; $tab[59]['table'] = $this->getTable(); $tab[59]['field'] = 'entity'; $tab[59]['name'] = _n('Entity', 'Entities', 2); $tab[59]['datatype'] = 'right'; $tab[60]['table'] = $this->getTable(); $tab[60]['field'] = 'transfer'; $tab[60]['name'] = __('Transfer'); $tab[60]['datatype'] = 'right'; $tab[61]['table'] = $this->getTable(); $tab[61]['field'] = 'logs'; $tab[61]['name'] = _n('Log', 'Logs', 2); $tab[61]['datatype'] = 'right'; $tab[61]['nowrite'] = true; $tab[62]['table'] = $this->getTable(); $tab[62]['field'] = 'backup'; $tab[62]['name'] = __('Maintenance'); $tab[62]['datatype'] = 'right'; $tab[62]['noread'] = true; $tab['ticket'] = __('Assistance'); $tab[102]['table'] = $this->getTable(); $tab[102]['field'] = 'create_ticket'; $tab[102]['name'] = __('Create a ticket'); $tab[102]['datatype'] = 'bool'; $tab[108]['table'] = 'glpi_tickettemplates'; $tab[108]['field'] = 'name'; $tab[108]['name'] = __('Default ticket template'); $tab[108]['datatype'] = 'dropdown'; if (Session::isMultiEntitiesMode()) { $tab[108]['condition'] = '`entities_id` = 0 AND `is_recursive` = 1'; } else { $tab[108]['condition'] = '`entities_id` = 0'; } $tab[103]['table'] = $this->getTable(); $tab[103]['field'] = 'tickettemplate'; $tab[103]['name'] = _n('Ticket template', 'Ticket templates', 2); $tab[103]['datatype'] = 'right'; $tab[65]['table'] = $this->getTable(); $tab[65]['field'] = 'delete_ticket'; $tab[65]['name'] = __("Ticket's deletion"); $tab[65]['datatype'] = 'bool'; $tab[66]['table'] = $this->getTable(); $tab[66]['field'] = 'add_followups'; $tab[66]['name'] = __('Add a followup to tickets (requester)'); $tab[66]['datatype'] = 'bool'; $tab[67]['table'] = $this->getTable(); $tab[67]['field'] = 'global_add_followups'; $tab[67]['name'] = __('Add a followup to all tickets'); $tab[67]['datatype'] = 'bool'; $tab[68]['table'] = $this->getTable(); $tab[68]['field'] = 'update_ticket'; $tab[68]['name'] = __('Update a ticket'); $tab[68]['datatype'] = 'bool'; $tab[69]['table'] = $this->getTable(); $tab[69]['field'] = 'own_ticket'; $tab[69]['name'] = __('To be in charge of a ticket'); $tab[69]['datatype'] = 'bool'; $tab[70]['table'] = $this->getTable(); $tab[70]['field'] = 'steal_ticket'; $tab[70]['name'] = __('Steal a ticket'); $tab[70]['datatype'] = 'bool'; $tab[71]['table'] = $this->getTable(); $tab[71]['field'] = 'assign_ticket'; $tab[71]['name'] = __('Assign a ticket'); $tab[71]['datatype'] = 'bool'; $tab[72]['table'] = $this->getTable(); $tab[72]['field'] = 'show_all_ticket'; $tab[72]['name'] = __('See all tickets'); $tab[72]['datatype'] = 'bool'; $tab[73]['table'] = $this->getTable(); $tab[73]['field'] = 'show_assign_ticket'; $tab[73]['name'] = __('See assigned tickets (personnal + group associated)'); $tab[73]['datatype'] = 'bool'; $tab[74]['table'] = $this->getTable(); $tab[74]['field'] = 'show_full_ticket'; $tab[74]['name'] = __('See all followups and tasks (public and private)'); $tab[74]['datatype'] = 'bool'; $tab[75]['table'] = $this->getTable(); $tab[75]['field'] = 'observe_ticket'; $tab[75]['name'] = __('See public followups and tasks'); $tab[75]['datatype'] = 'bool'; $tab[76]['table'] = $this->getTable(); $tab[76]['field'] = 'update_followups'; $tab[76]['name'] = __('Update all followups'); $tab[76]['datatype'] = 'bool'; $tab[77]['table'] = $this->getTable(); $tab[77]['field'] = 'show_planning'; $tab[77]['name'] = __('See personnal planning'); $tab[77]['datatype'] = 'bool'; $tab[78]['table'] = $this->getTable(); $tab[78]['field'] = 'show_group_planning'; $tab[78]['name'] = __('See schedule of people in my groups'); $tab[78]['datatype'] = 'bool'; $tab[79]['table'] = $this->getTable(); $tab[79]['field'] = 'show_all_planning'; $tab[79]['name'] = __('See all plannings'); $tab[79]['datatype'] = 'bool'; $tab[80]['table'] = $this->getTable(); $tab[80]['field'] = 'update_own_followups'; $tab[80]['name'] = __('Update followups (author)'); $tab[80]['datatype'] = 'bool'; $tab[81]['table'] = $this->getTable(); $tab[81]['field'] = 'delete_followups'; $tab[81]['name'] = __('Delete all followups'); $tab[81]['datatype'] = 'bool'; $tab[121]['table'] = $this->getTable(); $tab[121]['field'] = 'delete_validations'; $tab[121]['name'] = __('Delete all validations'); $tab[121]['datatype'] = 'bool'; $tab[85]['table'] = $this->getTable(); $tab[85]['field'] = 'statistic'; $tab[85]['name'] = __('Statistics'); $tab[85]['datatype'] = 'bool'; $tab[119]['table'] = $this->getTable(); $tab[119]['field'] = 'ticketcost'; $tab[119]['name'] = _n('Ticket cost', 'Ticket costs', 2); $tab[119]['datatype'] = 'right'; $tab[86]['table'] = $this->getTable(); $tab[86]['field'] = 'helpdesk_hardware'; $tab[86]['name'] = __('Link with items for the creation of tickets'); $tab[86]['massiveaction'] = false; $tab[86]['datatype'] = 'specific'; $tab[87]['table'] = $this->getTable(); $tab[87]['field'] = 'helpdesk_item_type'; $tab[87]['name'] = __('Associable items to a ticket'); $tab[87]['massiveaction'] = false; $tab[87]['datatype'] = 'specific'; $tab[88]['table'] = $this->getTable(); $tab[88]['field'] = 'show_group_ticket'; $tab[88]['name'] = __('See tickets created by my groups'); $tab[88]['datatype'] = 'bool'; $tab[89]['table'] = $this->getTable(); $tab[89]['field'] = 'show_group_hardware'; $tab[89]['name'] = __('See hardware of my groups'); $tab[89]['datatype'] = 'bool'; $tab[94]['table'] = $this->getTable(); $tab[94]['field'] = 'group_add_followups'; $tab[94]['name'] = __('Add a followup to tickets of associated groups'); $tab[94]['datatype'] = 'bool'; $tab[95]['table'] = $this->getTable(); $tab[95]['field'] = 'global_add_tasks'; $tab[95]['name'] = __('Add a task to all tickets'); $tab[95]['datatype'] = 'bool'; $tab[96]['table'] = $this->getTable(); $tab[96]['field'] = 'update_priority'; $tab[96]['name'] = __('Change the priority'); $tab[96]['datatype'] = 'bool'; $tab[97]['table'] = $this->getTable(); $tab[97]['field'] = 'update_tasks'; $tab[97]['name'] = __('Edit all tasks'); $tab[97]['datatype'] = 'bool'; $tab[98]['table'] = $this->getTable(); $tab[98]['field'] = 'validate_request'; $tab[98]['name'] = __('Validate a request'); $tab[98]['datatype'] = 'bool'; $tab[123]['table'] = $this->getTable(); $tab[123]['field'] = 'validate_incident'; $tab[123]['name'] = __('Validate an incident'); $tab[123]['datatype'] = 'bool'; $tab[99]['table'] = $this->getTable(); $tab[99]['field'] = 'create_request_validation'; $tab[99]['name'] = __('Create a validation request for a request'); $tab[99]['datatype'] = 'bool'; $tab[122]['table'] = $this->getTable(); $tab[122]['field'] = 'create_incident_validation'; $tab[122]['name'] = __('Create a validation request for an incident'); $tab[122]['datatype'] = 'bool'; $tab[100]['table'] = $this->getTable(); $tab[100]['field'] = 'ticket_status'; $tab[100]['name'] = __('Life cycle of tickets'); $tab[100]['nosearch'] = true; $tab[100]['datatype'] = 'text'; $tab[100]['massiveaction'] = false; $tab[110]['table'] = $this->getTable(); $tab[110]['field'] = 'problem_status'; $tab[110]['name'] = __('Life cycle of problems'); $tab[110]['nosearch'] = true; $tab[110]['datatype'] = 'text'; $tab[110]['massiveaction'] = false; $tab[112]['table'] = $this->getTable(); $tab[112]['field'] = 'show_my_problem'; $tab[112]['name'] = __('See problems (author)'); $tab[112]['datatype'] = 'bool'; $tab[113]['table'] = $this->getTable(); $tab[113]['field'] = 'show_all_problem'; $tab[113]['name'] = __('See all problems'); $tab[113]['datatype'] = 'bool'; $tab[114]['table'] = $this->getTable(); $tab[114]['field'] = 'edit_all_problem'; $tab[114]['name'] = __('Update all problems'); $tab[114]['datatype'] = 'bool'; $tab[115]['table'] = $this->getTable(); $tab[115]['field'] = 'delete_problem'; $tab[115]['name'] = __('Delete all problems'); $tab[115]['datatype'] = 'bool'; // $tab[111]['table'] = $this->getTable(); // $tab[111]['field'] = 'change_status'; // $tab[111]['name'] = __('Life cycle of changes'); // $tab[111]['nosearch'] = true; // $tab[111]['datatype'] = 'text'; // $tab[111]['massiveaction'] = false; // // $tab[115]['table'] = $this->getTable(); // $tab[115]['field'] = 'show_my_change'; // $tab[115]['name'] =__('See changes (author)'); // $tab[115]['datatype'] = 'bool'; // // $tab[116]['table'] = $this->getTable(); // $tab[116]['field'] = 'show_all_change'; // $tab[116]['name'] = __('See all changes'); // $tab[116]['datatype'] = 'bool'; // // $tab[117]['table'] = $this->getTable(); // $tab[117]['field'] = 'edit_all_change'; // $tab[117]['name'] = __('Update all changes'); // $tab[117]['datatype'] = 'bool'; $tab['other'] = __('Other'); $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'password_update'; $tab[4]['name'] = __('Update password'); $tab[4]['datatype'] = 'bool'; $tab[63]['table'] = $this->getTable(); $tab[63]['field'] = 'reminder_public'; $tab[63]['name'] = _n('Public reminder', 'Public reminders', 2); $tab[63]['datatype'] = 'right'; $tab[64]['table'] = $this->getTable(); $tab[64]['field'] = 'bookmark_public'; $tab[64]['name'] = _n('Public bookmark', 'Public bookmarks', 2); $tab[64]['datatype'] = 'right'; $tab[120]['table'] = $this->getTable(); $tab[120]['field'] = 'rssfeed_public'; $tab[120]['name'] = _n('Public RSS feed', 'Public RSS feeds', 2); $tab[120]['datatype'] = 'right'; return $tab; } /** * @since version 0.84 * * @param $field * @param $values * @param $options array **/ static function getSpecificValueToDisplay($field, $values, array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } switch ($field) { case 'interface': return self::getInterfaceName($values[$field]); case 'helpdesk_hardware': return self::getHelpdeskHardwareTypeName($values[$field]); case "helpdesk_item_type": $types = explode(',', $values[$field]); $message = array(); foreach ($types as $type) { if ($item = getItemForItemtype($type)) { $message[] = $item->getTypeName(); } } return implode(', ',$message); } return parent::getSpecificValueToDisplay($field, $values, $options); } /** * @since version 0.84 * * @param $field * @param $name (default '') * @param $values (default '') * @param $options array **/ static function getSpecificValueToSelect($field, $name='', $values='', array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'interface' : $options['value'] = $values[$field]; return Dropdown::showFromArray($name, self::getInterfaces(), $options); case 'helpdesk_hardware' : $options['value'] = $values[$field]; return Dropdown::showFromArray($name, self::getHelpdeskHardwareTypes(), $options); case "helpdesk_item_type": $options['values'] = explode(',', $values[$field]); $options['name'] = $name; return self::dropdownHelpdeskItemtypes($options); } return parent::getSpecificValueToSelect($field, $name, $values, $options); } /** * Make a select box for a None Read Write choice * * @param $name select name * @param $value preselected value. * @param $none display none choice ? (default 1) * @param $read display read choice ? (default 1) * @param $write display write choice ? (default 1) * * @return nothing (print out an HTML select box) * \deprecated use dropdownRight instead **/ static function dropdownNoneReadWrite($name, $value, $none=1, $read=1, $write=1) { return self::dropdownRight($name, array('value' => $value, 'nonone' => !$none, 'noread' => !$read, 'nowrite' => !$write)); } /** * Make a select box for a None Read Write choice * * @since version 0.84 * * @param $name select name * @param $options array of possible options: * - value : preselected value. * - nonone : hide none choice ? (default false) * - noread : hide read choice ? (default false) * - nowrite : hide write choice ? (default false) * - display : display or get string (default true) * - rand : specific rand (default is generated one) * * @return nothing (print out an HTML select box) **/ static function dropdownRight($name, $options=array()) { $param['value'] = ''; $param['display'] = true; $param['nonone'] = false; $param['noread'] = false; $param['nowrite'] = false; $param['rand'] = mt_rand(); if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $param[$key] = $val; } } $values = array(); if (!$param['nonone']) { $values['NULL'] = __('No access'); } if (!$param['noread']) { $values['r'] = __('Read'); } if (!$param['nowrite']) { $values['w'] = __('Write'); } return Dropdown::showFromArray($name, $values, array('value' => $param['value'], 'rand' => $param['rand'], 'display' => $param['display'])); } /** * Dropdown profiles which have rights under the active one * * @param $options array of possible options: * - name : string / name of the select (default is profiles_id) * - value : integer / preselected value (default 0) * **/ static function dropdownUnder($options=array()) { global $DB; $p['name'] = 'profiles_id'; $p['value'] = ''; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } $profiles[0] = Dropdown::EMPTY_VALUE; $query = "SELECT * FROM `glpi_profiles` ". self::getUnderActiveProfileRetrictRequest("WHERE")." ORDER BY `name`"; $res = $DB->query($query); //New rule -> get the next free ranking if ($DB->numrows($res)) { while ($data = $DB->fetch_assoc($res)) { $profiles[$data['id']] = $data['name']; } } Dropdown::showFromArray($p['name'], $profiles, array('value' => $p['value'])); } /** * Get the default Profile for new user * * @return integer profiles_id **/ static function getDefault() { global $DB; foreach ($DB->request('glpi_profiles', array('is_default'=>1)) as $data) { return $data['id']; } return 0; } /** * @param $value **/ static function getRightValue($value) { switch ($value) { case '' : return __('No access'); case 'r' : return __('Read'); case 'w' : return __('Write'); default : return ''; } } /** * @since version 0.84 **/ static function getInterfaces() { return array('central' => __('Standard interface'), 'helpdesk' => __('Simplified interface')); } /** * @param $value **/ static function getInterfaceName($value) { $tab = self::getInterfaces(); if (isset($tab[$value])) { return $tab[$value]; } return NOT_AVAILABLE; } /** * @since version 0.84 **/ static function getHelpdeskHardwareTypes() { return array(0 => Dropdown::EMPTY_VALUE, pow(2, Ticket::HELPDESK_MY_HARDWARE) => __('My devices'), pow(2, Ticket::HELPDESK_ALL_HARDWARE) => __('All items'), pow(2, Ticket::HELPDESK_MY_HARDWARE) + pow(2, Ticket::HELPDESK_ALL_HARDWARE) => __('My devices and all items')); } /** * @since version 0.84 * * @param $value **/ static function getHelpdeskHardwareTypeName($value) { $tab = self::getHelpdeskHardwareTypes(); if (isset($tab[$value])) { return $tab[$value]; } return NOT_AVAILABLE; } /** * Dropdown profiles which have rights under the active one * * @since ersin 0.84 * * @param $options array of possible options: * - name : string / name of the select (default is profiles_id) * - values : array of values **/ static function dropdownHelpdeskItemtypes($options) { global $CFG_GLPI; $p['name'] = 'helpdesk_item_type'; $p['values'] = array(); $p['display'] = true; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } $values = array(); foreach ($CFG_GLPI["ticket_types"] as $key => $itemtype) { if ($item = getItemForItemtype($itemtype)) { if (!isPluginItemType($itemtype)) { // No Plugin for the moment $values[$itemtype] = $item->getTypeName(); } } else { unset($CFG_GLPI["ticket_types"][$key]); } } $p['multiple'] = true; $p['size'] = 3; return Dropdown::showFromArray($p['name'], $values, $p); } /** * function to check one right of a user * * @since version 0.84 * * @param $user integer id of the user to check rights * @param $right string right to check * @param $valright integer/string/array value of the rights searched * @param $entity integer id of the entity * * @return boolean */ static function haveUserRight($user, $right, $valright, $entity) { global $DB; $query = "SELECT $right FROM `glpi_profiles` INNER JOIN `glpi_profiles_users` ON (`glpi_profiles`.`id` = `glpi_profiles_users`.`profiles_id`) WHERE `glpi_profiles_users`.`users_id` = '$user' AND $right IN ('$valright') ". getEntitiesRestrictRequest(" AND ", "glpi_profiles_users", '', $entity, true); if ($result = $DB->query($query)) { if ($DB->numrows($result)) { return true; } } return false; } } ?> glpi-0.84.3+dfsg.1/inc/profile_reminder.class.php000066400000000000000000000042641226600447100215420ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Profile_Reminder /// @since version 0.83 class Profile_Reminder extends CommonDBRelation { // From CommonDBRelation static public $itemtype_1 = 'Reminder'; static public $items_id_1 = 'reminders_id'; static public $itemtype_2 = 'Profile'; static public $items_id_2 = 'profiles_id'; static public $checkItem_2_Rights = self::DONT_CHECK_ITEM_RIGHTS; static public $logs_for_item_2 = false; /** * Get profiles for a reminder * * @param $reminders_id ID of the reminder * * @return array of profiles linked to a reminder **/ static function getProfiles($reminders_id) { global $DB; $prof = array(); $query = "SELECT `glpi_profiles_reminders`.* FROM `glpi_profiles_reminders` WHERE `reminders_id` = '$reminders_id'"; foreach ($DB->request($query) as $data) { $prof[$data['profiles_id']][] = $data; } return $prof; } } ?> glpi-0.84.3+dfsg.1/inc/profile_rssfeed.class.php000066400000000000000000000042461226600447100213700ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Profile_RSSFeed /// @since version 0.84 class Profile_RSSFeed extends CommonDBRelation { // From CommonDBRelation static public $itemtype_1 = 'RSSFeed'; static public $items_id_1 = 'rssfeeds_id'; static public $itemtype_2 = 'Profile'; static public $items_id_2 = 'profiles_id'; static public $checkItem_2_Rights = self::DONT_CHECK_ITEM_RIGHTS; static public $logs_for_item_2 = false; /** * Get profiles for a rssfeed * * @param $rssfeeds_id ID of the rssfeed * * @return array of profiles linked to a rssfeed **/ static function getProfiles($rssfeeds_id) { global $DB; $prof = array(); $query = "SELECT `glpi_profiles_rssfeeds`.* FROM `glpi_profiles_rssfeeds` WHERE `rssfeeds_id` = '$rssfeeds_id'"; foreach ($DB->request($query) as $data) { $prof[$data['profiles_id']][] = $data; } return $prof; } } ?> glpi-0.84.3+dfsg.1/inc/profile_user.class.php000066400000000000000000000777701226600447100207270ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Profile_User class class Profile_User extends CommonDBRelation { // From CommonDBTM var $auto_message_on_action = false; // From CommonDBRelation static public $itemtype_1 = 'User'; static public $items_id_1 = 'users_id'; static public $itemtype_2 = 'Profile'; static public $items_id_2 = 'profiles_id'; static public $checkItem_2_Rights = self::DONT_CHECK_ITEM_RIGHTS; // Specific log system static public $logs_for_item_2 = false; static public $logs_for_item_1 = true; static public $log_history_1_add = Log::HISTORY_ADD_SUBITEM; static public $log_history_1_delete = Log::HISTORY_DELETE_SUBITEM; // Manage Entity properties forwarding static public $disableAutoEntityForwarding = true; function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } function maybeRecursive() { // Store is_recursive fields but not really recursive object return false; } // TODO CommonDBConnexity : check in details if we can replace canCreateItem by canRelationItem ... function canCreateItem() { $user = new User(); return $user->can($this->fields['users_id'],'r') && Profile::currentUserHaveMoreRightThan(array($this->fields['profiles_id'] => $this->fields['profiles_id'])) && Session::haveAccessToEntity($this->fields['entities_id']); } function prepareInputForAdd($input) { // TODO: check if the entities should not be inherited from the profile or the user if (!isset($input['entities_id']) || ($input['entities_id'] < 0)) { Session::addMessageAfterRedirect(__('No selected element or badly defined operation'), false, ERROR); return false; } return parent::prepareInputForAdd($input); } /** * Show rights of a user * * @param $user User object **/ static function showForUser(User $user) { global $DB,$CFG_GLPI; $ID = $user->getField('id'); if (!$user->can($ID,'r')) { return false; } $canedit = $user->can($ID,'w'); $strict_entities = self::getUserEntities($ID,false); if (!Session::haveAccessToOneOfEntities($strict_entities) && !Session::isViewAllEntities()) { $canedit = false; } $canshowentity = Session::haveRight("entity","r"); $rand = mt_rand(); if ($canedit) { echo "
    "; echo ""; echo ""; echo ""; echo ""; echo "
    ".__('Add an authorization to a user')."
    "; echo ""; Entity::dropdown(array('entity' => $_SESSION['glpiactiveentities'])); echo "".self::getTypeName(1).""; Profile::dropdownUnder(array('value' => Profile::getDefault())); echo "".__('Recursive').""; Dropdown::showYesNo("is_recursive",0); echo ""; echo ""; echo "
    "; Html::closeForm(); echo "
    "; } $query = "SELECT DISTINCT `glpi_profiles_users`.`id` AS linkID, `glpi_profiles`.`id`, `glpi_profiles`.`name`, `glpi_profiles_users`.`is_recursive`, `glpi_profiles_users`.`is_dynamic`, `glpi_entities`.`completename`, `glpi_profiles_users`.`entities_id` FROM `glpi_profiles_users` LEFT JOIN `glpi_profiles` ON (`glpi_profiles_users`.`profiles_id` = `glpi_profiles`.`id`) LEFT JOIN `glpi_entities` ON (`glpi_profiles_users`.`entities_id` = `glpi_entities`.`id`) WHERE `glpi_profiles_users`.`users_id` = '$ID' ORDER BY `glpi_profiles`.`name`, `glpi_entities`.`completename`"; $result = $DB->query($query); $num = $DB->numrows($result); echo "
    "; Html::openMassiveActionsForm('mass'.__CLASS__.$rand); if ($canedit && $num) { $paramsma = array('num_displayed' => $num); Html::showMassiveActions(__CLASS__, $paramsma); } if ($num > 0) { echo ""; echo ""; if ($canedit) { echo ""; } echo ""; echo ""; while ($data = $DB->fetch_assoc($result)) { echo ""; if ($canedit) { echo ""; } echo ""; if (Session::haveRight('profile', 'r')) { $entname = "". $data["name"].""; } else { $entname = $data["name"]; } if ($data["is_dynamic"] || $data["is_recursive"]) { $entname = sprintf(__('%1$s %2$s'), $entname, "("); if ($data["is_dynamic"]) { //TRANS: letter 'D' for Dynamic $entname = sprintf(__('%1$s%2$s'), $entname, __('D')); } if ($data["is_dynamic"] && $data["is_recursive"]) { $entname = sprintf(__('%1$s%2$s'), $entname, ", "); } if ($data["is_recursive"]) { //TRANS: letter 'R' for Recursive $entname = sprintf(__('%1$s%2$s'), $entname, __('R')); } $entname = sprintf(__('%1$s%2$s'), $entname, ")"); } echo ""; echo ""; } echo "
    "; Html::checkAllAsCheckbox('mass'.__CLASS__.$rand); echo ""._n('Entity', 'Entities', 2)."".sprintf(__('%1$s (%2$s)'), self::getTypeName(2), __('D=Dynamic, R=Recursive')); echo "
    "; if (in_array($data["entities_id"], $_SESSION['glpiactiveentities'])) { Html::showMassiveActionCheckBox(__CLASS__, $data["linkID"]); } else { echo " "; } echo ""; $link = $data["completename"]; if ($_SESSION["glpiis_ids_visible"]) { $link = sprintf(__('%1$s (%2$s)'), $link, $data["entities_id"]); } if ($canshowentity) { echo ""; } echo $link.($canshowentity ? "" : ''); echo "".$entname."
    "; } else { echo ""; echo ""; echo "
    ".__('No item found')."
    \n"; } if ($canedit && $num) { $paramsma['ontop'] = false; Html::showMassiveActions(__CLASS__, $paramsma); } Html::closeForm(); echo "
    "; } /** * Show users of an entity * * @param $entity Entity object **/ static function showForEntity(Entity $entity) { global $DB; $ID = $entity->getField('id'); if (!$entity->can($ID, "r")) { return false; } $canedit = $entity->can($ID,"w"); $canshowuser = Session::haveRight("user", "r"); $nb_per_line = 3; $rand = mt_rand(); if ($canedit) { $headerspan = $nb_per_line*2; } else { $headerspan = $nb_per_line; } if ($canedit) { echo "
    "; echo ""; echo ""; echo ""; echo ""; echo "
    ".__('Add an authorization to a user')."
    ".__('User')." "; echo ""; User::dropdown(array('right' => 'all')); echo "".self::getTypeName(1).""; Profile::dropdownUnder(array('value' => Profile::getDefault())); echo "".__('Recursive').""; Dropdown::showYesNo("is_recursive", 0); echo ""; echo ""; echo "
    "; Html::closeForm(); echo "
    "; } $query = "SELECT DISTINCT `glpi_profiles`.`id`, `glpi_profiles`.`name` FROM `glpi_profiles_users` LEFT JOIN `glpi_profiles` ON (`glpi_profiles_users`.`profiles_id` = `glpi_profiles`.`id`) LEFT JOIN `glpi_users` ON (`glpi_users`.`id` = `glpi_profiles_users`.`users_id`) WHERE `glpi_profiles_users`.`entities_id` = '$ID' AND `glpi_users`.`is_deleted` = '0'"; $result = $DB->query($query); $nb = $DB->numrows($result); echo "
    "; if ($canedit && $nb) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $paramsma = array('specific_actions' => array('purge' => _x('button', 'Delete permanently'))); Html::showMassiveActions(__CLASS__, $paramsma); } echo ""; echo ""; echo ""; if ($nb) { Session::initNavigateListItems('User', //TRANS : %1$s is the itemtype name, %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), Entity::getTypeName(1), $entity->getName())); while ($data = $DB->fetch_assoc($result)) { echo ""; $reduce_header = 0; if ($canedit && $nb) { echo ""; $reduce_header++; } echo ""; echo ""; $query = "SELECT `glpi_users`.*, `glpi_profiles_users`.`id` AS linkID, `glpi_profiles_users`.`is_recursive`, `glpi_profiles_users`.`is_dynamic` FROM `glpi_profiles_users` LEFT JOIN `glpi_users` ON (`glpi_users`.`id` = `glpi_profiles_users`.`users_id`) WHERE `glpi_profiles_users`.`entities_id` = '$ID' AND `glpi_users`.`is_deleted` = '0' AND `glpi_profiles_users`.`profiles_id` = '".$data['id']."' ORDER BY `glpi_profiles_users`.`profiles_id`, `glpi_users`.`name`, `glpi_users`.`realname`, `glpi_users`.`firstname`"; $result2 = $DB->query($query); if ($DB->numrows($result2) > 0) { $i = 0; while ($data2 = $DB->fetch_assoc($result2)) { Session::addToNavigateListItems('User',$data2["id"]); if (($i%$nb_per_line) == 0) { if ($i !=0) { echo ""; } echo ""; } if ($canedit) { echo ""; } $username = formatUserName($data2["id"], $data2["name"], $data2["realname"], $data2["firstname"], $canshowuser); if ($data2["is_dynamic"] || $data2["is_recursive"]) { $username = sprintf(__('%1$s %2$s'), $username, "("); if ($data2["is_dynamic"]) { $username = sprintf(__('%1$s%2$s'), $username, __('D')); } if ($data2["is_dynamic"] && $data2["is_recursive"]) { $username = sprintf(__('%1$s%2$s'), $username, ", "); } if ($data2["is_recursive"]) { $username = sprintf(__('%1$s%2$s'), $username, __('R')); } $username = sprintf(__('%1$s%2$s'), $username, ")"); } echo ""; $i++; } while (($i%$nb_per_line) != 0) { echo ""; if ($canedit) { echo ""; } $i++; } echo ""; echo ""; } else { echo "".__('Item not found').""; } } } echo "
    "; printf(__('%1$s (%2$s)'), _n('User', 'Users', 2), __('D=Dynamic, R=Recursive')); echo "
    "; echo Html::checkAllAsCheckbox("profile".$data['id']."_$rand"); echo ""; printf(__('%1$s: %2$s'), __('Profile'), $data["name"]); echo "
    "; Html::showMassiveActionCheckBox(__CLASS__, $data2["linkID"]); echo "".$username."  
    "; if ($canedit && $nb) { $paramsma['ontop'] = false; Html::showMassiveActions(__CLASS__, $paramsma); Html::closeForm(); } echo "
    "; } /** * Show the User having a profile, in allowed Entity * * @param $prof Profile object **/ static function showForProfile(Profile $prof) { global $DB, $CFG_GLPI; $ID = $prof->fields['id']; $canedit = Session::haveRight("user", "w"); $rand = mt_rand(); if (!$prof->can($ID,'r')) { return false; } $query = "SELECT `glpi_users`.*, `glpi_profiles_users`.`entities_id` AS entity, `glpi_profiles_users`.`id` AS linkID, `glpi_profiles_users`.`is_dynamic`, `glpi_profiles_users`.`is_recursive` FROM `glpi_profiles_users` LEFT JOIN `glpi_entities` ON (`glpi_entities`.`id`=`glpi_profiles_users`.`entities_id`) LEFT JOIN `glpi_users` ON (`glpi_users`.`id` = `glpi_profiles_users`.`users_id`) WHERE `glpi_profiles_users`.`profiles_id` = '$ID' AND `glpi_users`.`is_deleted` = '0' ". getEntitiesRestrictRequest("AND", "glpi_profiles_users", 'entities_id', $_SESSION['glpiactiveentities'], true)." ORDER BY `glpi_entities`.`completename`"; $result = $DB->query($query); $nb = $DB->numrows($result); echo "
    "; if ($canedit && $nb) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $paramsma = array('num_displayed' => $nb); Html::showMassiveActions(__CLASS__, $paramsma); } echo ""; echo "\n"; echo ""; echo "
    ".sprintf(__('%1$s: %2$s'), __('Profile'), $prof->fields["name"])."
    ".sprintf(__('%1$s (%2$s)'), _n('User', 'Users', 2), __('D=Dynamic, R=Recursive'))."
    \n"; echo ""; $i = 0; $nb_per_line = 3; $rand = mt_rand(); // Just to avoid IDE warning $canedit_entity = false; if ($nb) { $temp = -1; while ($data = $DB->fetch_assoc($result)) { if ($data["entity"] != $temp) { while (($i%$nb_per_line) != 0) { if ($canedit_entity) { echo ""; } echo "\n"; $i++; } if ($i != 0) { echo "
      
    "; echo "
    "; echo "\n"; } // New entity $i = 0; $temp = $data["entity"]; $canedit_entity = $canedit && in_array($temp, $_SESSION['glpiactiveentities']); $rand = mt_rand(); echo ""; echo ""; echo ""; echo " "; echo "".Dropdown::getDropdownName('glpi_entities', $data["entity"]). ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; } } else { echo "".__('No user found'). "\n"; } echo ""; if ($canedit && $nb) { $paramsma['ontop'] = false; Html::showMassiveActions(__CLASS__, $paramsma); Html::closeForm(); } echo "\n"; } /** * Get entities for which a user have a right * * @param $user_ID user ID * @param $is_recursive check also using recursive rights (true by default) * @param $default_first user default entity first (false by default) * * @return array of entities ID **/ static function getUserEntities($user_ID, $is_recursive=true, $default_first=false) { global $DB; $query = "SELECT DISTINCT `entities_id`, `is_recursive` FROM `glpi_profiles_users` WHERE `users_id` = '$user_ID'"; $result = $DB->query($query); if ($DB->numrows($result) > 0) { $entities = array(); while ($data = $DB->fetch_assoc($result)) { if ($data['is_recursive'] && $is_recursive) { $tab = getSonsOf('glpi_entities', $data['entities_id']); $entities = array_merge($tab, $entities); } else { $entities[] = $data['entities_id']; } } // Set default user entity at the begin if ($default_first) { $user = new User(); if ($user->getFromDB($user_ID)) { $ent = $user->getField('entities_id'); if (in_array($ent, $entities)) { array_unshift($entities, $ent); } } } return array_unique($entities); } return array(); } /** * Get entities for which a user have a right * * @since version 0.84 * * @param $user_ID integer user ID * @param $right right to check (1 or read or write) * @param $is_recursive check also using recursive rights (true by default) * * @return array of entities ID **/ static function getUserEntitiesForRight($user_ID, $right, $is_recursive=true) { global $DB; $query = "SELECT DISTINCT `glpi_profiles_users`.`entities_id`, `glpi_profiles_users`.`is_recursive` FROM `glpi_profiles_users` INNER JOIN `glpi_profiles` ON (`glpi_profiles_users`.`profiles_id` = `glpi_profiles`.`id`) WHERE `glpi_profiles_users`.`users_id` = '$user_ID' AND `glpi_profiles`.`$right` IN ('1','r','w')"; $result = $DB->query($query); if ($DB->numrows($result) > 0) { $entities = array(); while ($data = $DB->fetch_assoc($result)) { if ($data['is_recursive'] && $is_recursive) { $tab = getSonsOf('glpi_entities', $data['entities_id']); $entities = array_merge($tab, $entities); } else { $entities[] = $data['entities_id']; } } return array_unique($entities); } return array(); } /** * Get user profiles (no entity association, use sqlfilter if needed) * * @param $user_ID user ID * @param $sqlfilter string additional filter (must start with AND) (default '') * * @return array of the IDs of the profiles **/ static function getUserProfiles($user_ID, $sqlfilter='') { global $DB; $query = "SELECT DISTINCT `profiles_id` FROM `glpi_profiles_users` WHERE `users_id` = '$user_ID' $sqlfilter"; $result = $DB->query($query); $profiles = array(); if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { $profiles[$data['profiles_id']] = $data['profiles_id']; } } return $profiles; } /** * retrieve the entities allowed to a user for a profile * * @param $users_id Integer ID of the user * @param $profiles_id Integer ID of the profile * @param $child Boolean when true, include child entity when recursive right * (false by default) * * @return Array of entity ID **/ static function getEntitiesForProfileByUser($users_id, $profiles_id, $child=false) { global $DB; $query = "SELECT `entities_id`, `is_recursive` FROM `glpi_profiles_users` WHERE `users_id` = '$users_id' AND `profiles_id` = '$profiles_id'"; $entities = array(); foreach ($DB->request($query) as $data) { if ($child && $data['is_recursive']) { foreach (getSonsOf('glpi_entities', $data['entities_id']) as $id) { $entities[$id] = $id; } } else { $entities[$data['entities_id']] = $data['entities_id']; } } return $entities; } /** * Get entities for which a user have a right * * @param $user_ID user ID * @param $only_dynamic get only recursive rights (false by default) * * @return array of entities ID **/ static function getForUser($user_ID, $only_dynamic=false) { global $DB; $condition = "`users_id` = '$user_ID'"; if ($only_dynamic) { $condition .= " AND `is_dynamic` = 1"; } return getAllDatasFromTable('glpi_profiles_users', $condition); } /** * @param $user_ID * @param $profile_id **/ static function haveUniqueRight($user_ID, $profile_id) { global $DB; $query = "SELECT COUNT(*) AS cpt FROM `glpi_profiles_users` WHERE `users_id` = '$user_ID' AND `profiles_id` = '$profile_id'"; $result = $DB->query($query); return $DB->result($result, 0, 'cpt'); } /** * @param $user_ID * @param $only_dynamic (false by default) **/ static function deleteRights($user_ID, $only_dynamic=false) { $crit['users_id'] = $user_ID; if ($only_dynamic) { $crit['is_dynamic'] = '1'; } $obj = new self(); $obj->deleteByCriteria($crit); } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'is_dynamic'; $tab[3]['name'] = __('Dynamic'); $tab[3]['datatype'] = 'bool'; $tab[3]['massiveaction'] = false; $tab[4]['table'] = 'glpi_profiles'; $tab[4]['field'] = 'name'; $tab[4]['name'] = self::getTypeName(1); $tab[4]['datatype'] = 'dropdown'; $tab[4]['massiveaction'] = false; $tab[5]['table'] = 'glpi_users'; $tab[5]['field'] = 'name'; $tab[5]['name'] = __('User'); $tab[5]['massiveaction'] = false; $tab[5]['datatype'] = 'dropdown'; $tab[5]['right'] = 'all'; $tab[80]['table'] = 'glpi_entities'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = __('Entity'); $tab[80]['massiveaction'] = true; $tab[80]['datatype'] = 'dropdown'; $tab[86]['table'] = $this->getTable(); $tab[86]['field'] = 'is_recursive'; $tab[86]['name'] = __('Child entities'); $tab[86]['datatype'] = 'bool'; $tab[86]['massiveaction'] = false; return $tab; } static function getTypeName($nb=0) { return _n('Profile', 'Profiles', $nb); } /** * @see CommonDBTM::getName() **/ function getName($options=array()) { $name = sprintf(__('%1$s, %2$s'), Dropdown::getDropdownName('glpi_profiles', $this->fields['profiles_id']), Dropdown::getDropdownName('glpi_entities', $this->fields['entities_id'])); if (isset($this->fields['is_dynamic']) && $this->fields['is_dynamic']) { //TRANS: D for Dynamic $dyn = __('D'); $name = sprintf(__('%1$s, %2$s'), $name, $dyn); } if (isset($this->fields['is_recursive']) && $this->fields['is_recursive']) { //TRANS: R for Recursive $rec = __('R'); $name = sprintf(__('%1$s, %2$s'), $name, $rec); } return $name; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { $nb = 0; switch ($item->getType()) { case 'Entity' : if (Session::haveRight('user', 'r')) { if ($_SESSION['glpishow_count_on_tabs']) { // Keep this ? (only approx. as count deleted users) $nb = countElementsInTable($this->getTable(), "entities_id = '".$item->getID()."'"); } return self::createTabEntry(_n('User', 'Users', 2), $nb); } break; case 'Profile' : if (Session::haveRight('user', 'r')) { if ($_SESSION['glpishow_count_on_tabs']) { // Keep this ? (only approx. as count deleted users) $nb = countElementsInTable($this->getTable(), "profiles_id = '".$item->getID()."'". getEntitiesRestrictRequest('AND', 'glpi_profiles_users', 'entities_id', $_SESSION['glpiactiveentities'], true)); } return self::createTabEntry(_n('User', 'Users', 2), $nb); } break; case 'User' : if ($_SESSION['glpishow_count_on_tabs']) { $nb = countElementsInTable($this->getTable(), "users_id = '".$item->getID()."'"); } return self::createTabEntry(_n('Authorization','Authorizations',2), $nb); } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($item->getType()) { case 'Entity' : self::showForEntity($item); break; case 'Profile' : self::showForProfile($item); break; case 'User' : self::showForUser($item); break; } return true; } } ?> glpi-0.84.3+dfsg.1/inc/relation.constant.php000066400000000000000000001074621226600447100205620ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // _ before the link table name => no clean cache on this relation // Table's names are in alphabetic order - Please respect it /// TODO add new network relations $RELATION = array("glpi_authldaps" => array('glpi_authldapreplicates' => 'authldaps_id', 'glpi_entities' => 'authldaps_id',), "glpi_autoupdatesystems" => array('glpi_computers' => 'autoupdatesystems_id'), "glpi_bookmarks" => array('glpi_bookmarks_users' => 'bookmarks_id'), "glpi_budgets" => array('glpi_infocoms' => 'budgets_id'), "glpi_calendars" => array('_glpi_calendarsegments' => 'calendars_id', '_glpi_calendars_holidays' => 'calendars_id', 'glpi_slas' => 'calendars_id', 'glpi_entities' => 'calendars_id',), "glpi_cartridgeitems" => array('glpi_cartridges' => 'cartridgeitems_id', 'glpi_cartridgeitems_printermodels' => 'cartridgeitems_id'), "glpi_cartridgeitemtypes" => array('glpi_cartridgeitems' => 'cartridgeitemtypes_id'), // "glpi_changes" // => array('glpi_changes_groups' => 'changes_id', // 'glpi_changes_items' => 'changes_id', // 'glpi_changes_problems' => 'changes_id', // 'glpi_changes_suppliers' => 'changes_id', // 'glpi_changes_tickets' => 'changes_id', // 'glpi_changes_users' => 'changes_id', // 'glpi_changetasks' => 'changes_id'), // // "glpi_changetasks" // => array('glpi_changetasks' => 'changetasks_id'), "glpi_computermodels" => array('glpi_computers' => 'computermodels_id'), "glpi_computers" => array('glpi_computers_items' => 'computers_id', 'glpi_computers_softwarelicenses' => 'computers_id', 'glpi_computers_softwareversions' => 'computers_id', 'glpi_computerdisks' => 'computers_id', 'glpi_computervirtualmachines' => 'computers_id'), "glpi_computertypes" => array('glpi_computers' => 'computertypes_id'), "glpi_consumableitems" => array('glpi_consumables' => 'consumableitems_id'), "glpi_consumableitemtypes" => array('glpi_consumableitems' => 'consumableitemtypes_id'), "glpi_contacts" => array('glpi_contacts_suppliers' => 'contacts_id'), "glpi_contacttypes" => array('glpi_contacts' => 'contacttypes_id'), "glpi_contracts" => array('glpi_contracts_items' => 'contracts_id', 'glpi_contracts_suppliers' => 'contracts_id'), "glpi_contracttypes" => array('glpi_contracts' => 'contracttypes_id'), "glpi_devicecases" => array('glpi_items_devicecases' => 'devicecases_id'), "glpi_devicecasetypes" => array('glpi_devicecases' => 'devicecasetypes_id'), "glpi_devicecontrols" => array('glpi_items_devicecontrols' => 'devicecontrols_id'), "glpi_devicedrives" => array('glpi_items_devicedrives' => 'devicedrives_id'), "glpi_devicegraphiccards" => array('glpi_items_devicegraphiccards' => 'devicegraphiccards_id'), "glpi_deviceharddrives" => array('glpi_items_deviceharddrives' => 'deviceharddrives_id'), "glpi_devicememories" => array('glpi_items_devicememories' => 'devicememories_id'), "glpi_devicememorytypes" => array('glpi_devicememories' => 'devicememorytypes_id'), "glpi_devicemotherboards" => array('glpi_items_devicemotherboards' => 'devicemotherboards_id'), "glpi_devicenetworkcards" => array('glpi_items_devicenetworkcards' => 'devicenetworkcards_id'), "glpi_devicepcis" => array('glpi_items_devicepcis' => 'devicepcis_id'), "glpi_devicepowersupplies" => array('glpi_items_devicepowersupplies' => 'devicepowersupplies_id'), "glpi_deviceprocessors" => array('glpi_items_deviceprocessors' => 'deviceprocessors_id'), "glpi_devicesoundcards" => array('glpi_items_devicesoundcards' => 'devicesoundcards_id'), "glpi_documentcategories" => array('glpi_configs' => 'documentcategories_id_forticket', 'glpi_documents' => 'documentcategories_id', 'glpi_documentcategories' => 'documentcategories_id'), "glpi_documents" => array('glpi_documents_items' => 'documents_id'), "glpi_domains" => array('glpi_computers' => 'domains_id', 'glpi_printers' => 'domains_id', 'glpi_networkequipments' => 'domains_id'), "glpi_entities" => array('glpi_bookmarks' => 'entities_id', 'glpi_budgets' => 'entities_id', 'glpi_calendars' => 'entities_id', '_glpi_calendarsegments' => 'entities_id', 'glpi_cartridgeitems' => 'entities_id', '_glpi_cartridges' => 'entities_id', // 'glpi_changes' => 'entities_id', 'glpi_computers' => 'entities_id', '_glpi_computerdisks' => 'entities_id', '_glpi_computervirtualmachines' => 'entities_id', 'glpi_consumableitems' => 'entities_id', '_glpi_consumables' => 'entities_id', 'glpi_contacts' => 'entities_id', 'glpi_contracts' => 'entities_id', 'glpi_documents' => 'entities_id', '_glpi_documents_items' => 'entities_id', '_glpi_entities' => 'entities_id', 'glpi_entities' => 'entities_id_software', 'glpi_entities_knowbaseitems' => 'entities_id', 'glpi_entities_reminders' => 'entities_id', 'glpi_fieldblacklists' => 'entities_id', 'glpi_fieldunicities' => 'entities_id', 'glpi_fqdns' => 'entities_id', 'glpi_groups' => 'entities_id', 'glpi_groups_knowbaseitems' => 'entities_id', 'glpi_groups_reminders' => 'entities_id', 'glpi_holidays' => 'entities_id', '_glpi_infocoms' => 'entities_id', 'glpi_ipaddresses' => 'entities_id', 'glpi_ipnetworks' => 'entities_id', 'glpi_itilcategories' => 'entities_id', 'glpi_knowbaseitemcategories' => 'entities_id', 'glpi_knowbaseitems_profiles' => 'entities_id', 'glpi_links' => 'entities_id', 'glpi_locations' => 'entities_id', 'glpi_monitors' => 'entities_id', 'glpi_netpoints' => 'entities_id', 'glpi_networkaliases' => 'entities_id', 'glpi_networkequipments' => 'entities_id', 'glpi_networknames' => 'entities_id', '_glpi_networkports' => 'entities_id', 'glpi_notifications' => 'entities_id', 'glpi_peripherals' => 'entities_id', 'glpi_phones' => 'entities_id', 'glpi_printers' => 'entities_id', 'glpi_problems' => 'entities_id', 'glpi_profiles_reminders' => 'entities_id', 'glpi_profiles_users' => 'entities_id', '_glpi_reservationitems' => 'entities_id', 'glpi_rules' => 'entities_id', '_glpi_slalevels' => 'entities_id', 'glpi_slas' => 'entities_id', 'glpi_softwarelicenses' => 'entities_id', 'glpi_softwareversions' => 'entities_id', 'glpi_softwares' => 'entities_id', 'glpi_solutiontemplates' => 'entities_id', 'glpi_solutiontypes' => 'entities_id', 'glpi_suppliers' => 'entities_id', 'glpi_taskcategories' => 'entities_id', 'glpi_ticketrecurrents' => 'entities_id', 'glpi_tickettemplates' => 'entities_id', 'glpi_tickets' => 'entities_id', '_glpi_ticketvalidations' => 'entities_id', 'glpi_users' => 'entities_id'), "glpi_filesystems" => array('glpi_computerdisks' => 'filesystems_id'), "glpi_fqdns" => array('glpi_networkaliases' => 'fqdns_id', 'glpi_networknames' => 'fqdns_id'), "glpi_groups" => array('glpi_cartridgeitems' => 'groups_id_tech', // 'glpi_changes_groups' => 'groups_id', 'glpi_computers' => array('groups_id_tech', 'groups_id'), 'glpi_consumableitems' => 'groups_id_tech', 'glpi_groups' => 'groups_id', 'glpi_groups_knowbaseitems' => 'groups_id', 'glpi_groups_problems' => 'groups_id', 'glpi_groups_reminders' => 'groups_id', 'glpi_groups_tickets' => 'groups_id', 'glpi_groups_users' => 'groups_id', 'glpi_itilcategories' => 'groups_id', 'glpi_monitors' => array('groups_id_tech', 'groups_id'), 'glpi_networkequipments' => array('groups_id_tech', 'groups_id'), 'glpi_peripherals' => array('groups_id_tech', 'groups_id'), 'glpi_phones' => array('groups_id_tech', 'groups_id'), 'glpi_printers' => array('groups_id_tech', 'groups_id'), 'glpi_softwares' => array('groups_id_tech', 'groups_id')), "glpi_holidays" => array('glpi_calendars_holidays' => 'holidays_id',), "glpi_interfacetypes" => array('glpi_deviceharddrives' => 'interfacetypes_id', 'glpi_devicedrives' => 'interfacetypes_id', 'glpi_devicegraphiccards' => 'interfacetypes_id', 'glpi_devicecontrols' => 'interfacetypes_id'), "glpi_ipaddresses" => array('glpi_ipaddresses_ipnetworks' => 'ipaddresses_id'), "glpi_ipnetworks" => array('glpi_ipaddresses_ipnetworks' => 'ipnetworks_id', 'glpi_ipnetworks' => 'ipnetworks_id', 'glpi_ipnetworks_vlans' => 'ipnetworks_id'), "glpi_knowbaseitemcategories" => array('glpi_itilcategories' => 'knowbaseitemcategories_id', 'glpi_knowbaseitemcategories' => 'knowbaseitemcategories_id', 'glpi_knowbaseitems' => 'knowbaseitemcategories_id'), "glpi_knowbaseitems" => array('glpi_entities_knowbaseitems' => 'knowbaseitems_id', 'glpi_groups_knowbaseitems' => 'knowbaseitems_id', 'glpi_knowbaseitems_profiles' => 'knowbaseitems_id', 'glpi_knowbaseitems_users' => 'knowbaseitems_id'), "glpi_links" => array('_glpi_links_itemtypes' => 'links_id'), "glpi_locations" => array('glpi_cartridgeitems' => 'locations_id', 'glpi_consumableitems' => 'locations_id', 'glpi_computers' => 'locations_id', 'glpi_locations' => 'locations_id', 'glpi_monitors' => 'locations_id', 'glpi_netpoints' => 'locations_id', 'glpi_networkequipments' => 'locations_id', 'glpi_peripherals' => 'locations_id', 'glpi_phones' => 'locations_id', 'glpi_printers' => 'locations_id', 'glpi_softwares' => 'locations_id', 'glpi_users' => 'locations_id'), "glpi_manufacturers" => array('glpi_cartridgeitems' => 'manufacturers_id', 'glpi_computers' => 'manufacturers_id', 'glpi_consumableitems' => 'manufacturers_id', 'glpi_devicecases' => 'manufacturers_id', 'glpi_devicecontrols' => 'manufacturers_id', 'glpi_devicedrives' => 'manufacturers_id', 'glpi_devicegraphiccards' => 'manufacturers_id', 'glpi_deviceharddrives' => 'manufacturers_id', 'glpi_devicenetworkcards' => 'manufacturers_id', 'glpi_devicemotherboards' => 'manufacturers_id', 'glpi_devicepcis' => 'manufacturers_id', 'glpi_devicepowersupplies' => 'manufacturers_id', 'glpi_deviceprocessors' => 'manufacturers_id', 'glpi_devicememories' => 'manufacturers_id', 'glpi_devicesoundcards' => 'manufacturers_id', 'glpi_monitors' => 'manufacturers_id', 'glpi_networkequipments' => 'manufacturers_id', 'glpi_peripherals' => 'manufacturers_id', 'glpi_phones' => 'manufacturers_id', 'glpi_printers' => 'manufacturers_id', 'glpi_softwares' => 'manufacturers_id'), "glpi_monitormodels" => array('glpi_monitors' => 'monitormodels_id'), "glpi_monitortypes" => array('glpi_monitors' => 'monitortypes_id'), "glpi_netpoints" => array('glpi_networkportethernets' => 'netpoints_id'), "glpi_networkequipmentfirmwares" => array('glpi_networkequipments' =>'networkequipmentfirmwares_id'), "glpi_networkequipmentmodels" => array('glpi_networkequipments' =>'networkequipmentmodels_id'), "glpi_networkequipmenttypes" => array('glpi_networkequipments' => 'networkequipmenttypes_id'), "glpi_networknames" => array('glpi_networkaliases' => 'networknames_id'), "glpi_networkports" => array('glpi_networkportaggregates' => 'networkports_id', 'glpi_networkportaliases' => array('networkports_id', 'networkports_id_alias'), 'glpi_networkportdialups' => 'networkports_id', 'glpi_networkportethernets' => 'networkports_id', 'glpi_networkportlocals' => 'networkports_id', 'glpi_networkports_vlans' => 'networkports_id', 'glpi_networkports_networkports' => array('networkports_id_1', 'networkports_id_2'), 'glpi_networkportwifis' => 'networkports_id'), "glpi_networkportwifis" => array('glpi_networkportwifis' => 'networkportwifis_id'), "glpi_networks" => array('glpi_computers' => 'networks_id', 'glpi_printers' => 'networks_id', 'glpi_networkequipments' => 'networks_id'), "glpi_operatingsystems" => array('glpi_computers' => 'operatingsystems_id', 'glpi_softwareversions' => 'operatingsystems_id'), "glpi_operatingsystemservicepacks" => array('glpi_computers' => 'operatingsystemservicepacks_id'), "glpi_operatingsystemversions" => array('glpi_computers' => 'operatingsystemversions_id'), "glpi_peripheralmodels" => array('glpi_peripherals' =>' peripheralmodels_id'), "glpi_peripheraltypes" => array('glpi_peripherals' => 'peripheraltypes_id'), "glpi_phonemodels" => array('glpi_phones' => 'phonemodels_id'), "glpi_phonepowersupplies" => array('glpi_phones' => 'phonepowersupplies_id'), "glpi_phonetypes" => array('glpi_phones' => 'phonetypes_id'), "glpi_printermodels" => array('glpi_printers' => 'printermodels_id', 'glpi_cartridgeitems_printermodels' => 'printermodels_id'), "glpi_printers" => array('glpi_cartridges' => 'printers_id'), "glpi_printertypes" => array('glpi_printers' => 'printertypes_id'), "glpi_problems" => array( // 'glpi_changes_problems' => 'problems_id', 'glpi_groups_problems' => 'problems_id', 'glpi_items_problems' => 'problems_id', 'glpi_problems_suppliers' => 'problems_id', 'glpi_problems_tickets' => 'problems_id', 'glpi_problems_users' => 'problems_id', 'glpi_problemtasks' => 'problems_id'), "glpi_profiles" => array('glpi_knowbaseitems_profiles' => 'profiles_id', 'glpi_profiles_reminders' => 'profiles_id', 'glpi_profiles_users' => 'profiles_id', 'glpi_users' => 'profiles_id'), "glpi_reminders" => array('glpi_entities_reminders' => 'reminders_id', 'glpi_groups_reminders' => 'reminders_id', 'glpi_profiles_reminders' => 'reminders_id', 'glpi_reminders_users' => 'reminders_id',), "glpi_requesttypes" => array('glpi_ticketfollowups' => 'requesttypes_id', 'glpi_tickets' => 'requesttypes_id', 'glpi_users' => 'default_requesttypes_id', 'glpi_configs' => 'default_requesttypes_id'), "glpi_reservationitems" => array('glpi_reservations' => 'reservationitems_id'), "glpi_rules" => array('glpi_ruleactions' => 'rules_id', 'glpi_rulecriterias' => 'rules_id'), "glpi_slalevels" => array('glpi_slalevelactions' => 'slalevels_id', 'glpi_tickets' => 'slalevels_id', 'glpi_slalevels_tickets' => 'slalevels_id'), "glpi_slas" => array('glpi_slalevels' => 'slas_id', 'glpi_tickets' => 'slas_id'), "glpi_softwarecategories" => array('glpi_softwares' => 'softwarecategories_id', 'glpi_configs' => 'softwarecategories_id_ondelete'), "glpi_softwarelicensetypes" => array('glpi_softwarelicenses' =>'softwarelicensetypes_id'), "glpi_softwareversions" => array('glpi_computers_softwareversions' => 'softwareversions_id', 'glpi_softwarelicenses' => array('softwareversions_id_buy', 'softwareversions_id_use')), "glpi_softwarelicenses" => array('glpi_computers_softwarelicenses' =>'softwarelicenses_id'), "glpi_softwares" => array('glpi_softwarelicenses' => 'softwares_id', 'glpi_softwareversions' => 'softwares_id', 'glpi_softwares' => 'softwares_id'), "glpi_solutiontypes" => array( // 'glpi_changes' => 'solutiontypes_id', 'glpi_problems' => 'solutiontypes_id', 'glpi_tickets' => 'solutiontypes_id', 'glpi_solutiontemplates' => 'solutiontypes_id'), "glpi_states" => array('glpi_computers' => 'states_id', 'glpi_monitors' => 'states_id', 'glpi_networkequipments' => 'states_id', 'glpi_peripherals' => 'states_id', 'glpi_phones' => 'states_id', 'glpi_printers' => 'states_id', 'glpi_softwareversions' => 'states_id', 'glpi_states' => 'states_id'), "glpi_suppliers" => array( // 'glpi_changes_suppliers' => 'suppliers_id', 'glpi_contacts_suppliers' => 'suppliers_id', 'glpi_contracts_suppliers' => 'suppliers_id', 'glpi_infocoms' => 'suppliers_id', 'glpi_problems_suppliers' => 'suppliers_id', 'glpi_suppliers_tickets' => 'suppliers_id',), "glpi_suppliertypes" => array('glpi_suppliers' => 'suppliertypes_id'), "glpi_taskcategories" => array( // 'glpi_changetasks' => 'taskcategories_id', 'glpi_problemtasks' => 'taskcategories_id', 'glpi_taskcategories' => 'taskcategories_id', 'glpi_tickettasks' => 'taskcategories_id'), "glpi_itilcategories" => array( // 'glpi_changes' => 'itilcategories_id', 'glpi_itilcategories' => 'itilcategories_id', 'glpi_tickets' => 'itilcategories_id', 'glpi_problems' => 'itilcategories_id'), "glpi_tickettemplates" => array('glpi_entities' => 'tickettemplates_id', 'glpi_itilcategories' => array('tickettemplates_id_incident', 'tickettemplates_id_demand'), 'glpi_ticketrecurrents' => 'tickettemplates_id', '_glpi_tickettemplatehiddenfields' => 'tickettemplates_id', '_glpi_tickettemplatepredefinedfields' => 'tickettemplates_id', '_glpi_tickettemplatemandatoryfields' => 'tickettemplates_id'), "glpi_tickets" => array('_glpi_documents' => 'tickets_id', // 'glpi_changes_tickets' => 'tickets_id', 'glpi_groups_tickets' => 'tickets_id', 'glpi_problems_tickets' => 'tickets_id', 'glpi_slalevels_tickets' => 'tickets_id', 'glpi_suppliers_tickets' => 'tickets_id', 'glpi_ticketfollowups' => 'tickets_id', 'glpi_ticketsatisfactions' => 'tickets_id', 'glpi_tickettasks' => 'tickets_id', 'glpi_ticketvalidations' => 'tickets_id', 'glpi_tickets_tickets' => array('tickets_id_1', 'tickets_id_2'), 'glpi_tickets_users' => 'tickets_id'), "glpi_solutiontypes" => array( // 'glpi_changes' => 'solutiontypes_id', 'glpi_tickets' => 'solutiontypes_id', 'glpi_solutiontemplates' => 'solutiontypes_id', 'glpi_problems' => 'solutiontypes_id'), "glpi_ssovariables" => array('glpi_configs' => 'ssovariables_id'), "glpi_transfers" => array('glpi_configs' => 'transfers_id_auto'), "glpi_usercategories" => array('glpi_users' => 'usercategories_id'), "glpi_users" => array('glpi_bookmarks' => 'users_id', 'glpi_bookmarks_users' => 'users_id', 'glpi_cartridgeitems' => 'users_id_tech', // 'glpi_changes' => array('users_id_recipient', // 'users_id_lastupdater'), // 'glpi_changes_users' => 'users_id', // 'glpi_changetasks' => array('users_id', 'users_id_tech'), 'glpi_computers' => array('users_id_tech', 'users_id'), 'glpi_consumableitems' => 'users_id_tech', 'glpi_displaypreferences' => 'users_id', 'glpi_documents' => 'users_id', 'glpi_groups_users' => 'users_id', 'glpi_itilcategories' => 'users_id', 'glpi_knowbaseitems' => 'users_id', 'glpi_knowbaseitems_users' => 'users_id', 'glpi_monitors' => array('users_id_tech', 'users_id'), 'glpi_networkequipments' => array('users_id_tech', 'users_id'), 'glpi_notimportedemails' => 'users_id', 'glpi_peripherals' => array('users_id_tech', 'users_id'), 'glpi_phones' => array('users_id_tech', 'users_id'), 'glpi_printers' => array('users_id_tech', 'users_id'), 'glpi_problems' => array('users_id_recipient', 'users_id_lastupdater'), 'glpi_problems_users' => 'users_id', 'glpi_problemtasks' => array('users_id', 'users_id_tech'), 'glpi_profiles_users' => 'users_id', 'glpi_reminders' => 'users_id', 'glpi_reminders_users' => 'users_id', 'glpi_reservations' => 'users_id', 'glpi_softwares' => array('users_id_tech', 'users_id'), 'glpi_ticketfollowups' => 'users_id', 'glpi_tickets' => array('users_id_recipient', 'users_id_lastupdater'), 'glpi_tickets_users' => 'users_id', 'glpi_tickettasks' => array('users_id', 'users_id_tech'), 'glpi_ticketvalidations' => array('users_id', 'users_id_validate'), 'glpi_useremails' => 'users_id'), "glpi_usertitles" => array('glpi_contacts' => 'usertitles_id', 'glpi_users' => 'usertitles_id'), "glpi_vlans" => array('glpi_networkports_vlans' => 'vlans_id'), "glpi_virtualmachinestates" => array('glpi_computervirtualmachines' => 'virtualmachinestates_id'), "glpi_virtualmachinesystems" => array('glpi_computervirtualmachines' => 'virtualmachinesystems_id'), "glpi_virtualmachinetypes" => array('glpi_computervirtualmachines' => 'virtualmachinetypes_id'), "glpi_wifinetworks" => array('glpi_networkportwifis' => 'wifinetworks_id'), // link from devices tables (computers, software, ...) : only used for unrecurs check "_virtual_device" => array('glpi_contracts_items' => array('items_id', 'itemtype'), 'glpi_documents_items' => array('items_id', 'itemtype'), 'glpi_infocoms' => array('items_id', 'itemtype'), // 'glpi_ipaddresses' => array('items_id', 'itemtype'), // 'glpi_networknames' => array('items_id', 'itemtype'), ), ); ?>glpi-0.84.3+dfsg.1/inc/reminder.class.php000066400000000000000000001267501226600447100200270ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Reminder class class Reminder extends CommonDBTM { // For visibility checks protected $users = array(); protected $groups = array(); protected $profiles = array(); protected $entities = array(); static function getTypeName($nb=0) { return _n('Reminder', 'Reminders', $nb); } static function canCreate() { return (Session::haveRight('reminder_public', 'w') || ($_SESSION['glpiactiveprofile']['interface'] != 'helpdesk')); } static function canView() { return (Session::haveRight('reminder_public', 'r') || ($_SESSION['glpiactiveprofile']['interface'] != 'helpdesk')); } function canViewItem() { // Is my reminder or is in visibility return ($this->fields['users_id'] == Session::getLoginUserID() || (Session::haveRight('reminder_public', 'r') && $this->haveVisibilityAccess())); } function canCreateItem() { // Is my reminder return ($this->fields['users_id'] == Session::getLoginUserID()); } function canUpdateItem() { return ($this->fields['users_id'] == Session::getLoginUserID() || (Session::haveRight('reminder_public', 'w') && $this->haveVisibilityAccess())); } function post_getFromDB() { // Users $this->users = Reminder_User::getUsers($this->fields['id']); // Entities $this->entities = Entity_Reminder::getEntities($this->fields['id']); // Group / entities $this->groups = Group_Reminder::getGroups($this->fields['id']); // Profile / entities $this->profiles = Profile_Reminder::getProfiles($this->fields['id']); } /** * @see CommonDBTM::cleanDBonPurge() * * @since version 0.83.1 **/ function cleanDBonPurge() { global $DB; $class = new Reminder_User(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); $class = new Entity_Reminder(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); $class = new Group_Reminder(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); $class = new Profile_Reminder(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); $class = new PlanningRecall(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); } /** * @since version 0.84 * * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "deletevisibility": foreach ($input['item'] as $type => $items) { if (in_array($type, array('Entity_Reminder', 'Group_Reminder', 'Profile_Reminder', 'Reminder_User'))) { $item = new $type(); foreach ($items as $key => $val) { if ($item->can($key,'w')) { if ($item->delete(array('id' => $key))) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } } } break; default : return parent::doSpecificMassiveActions($input); } return $res; } /** * @since version 0.83 **/ function countVisibilities() { return (count($this->entities) + count($this->users) + count($this->groups) + count($this->profiles)); } /** * Is the login user have access to reminder based on visibility configuration * * @return boolean **/ function haveVisibilityAccess() { // No public reminder right : no visibility check if (!Session::haveRight('reminder_public', 'r')) { return false; } // Author if ($this->fields['users_id'] == Session::getLoginUserID()) { return true; } // Users if (isset($this->users[Session::getLoginUserID()])) { return true; } // Groups if (count($this->groups) && isset($_SESSION["glpigroups"]) && count($_SESSION["glpigroups"])) { foreach ($this->groups as $key => $data) { foreach ($data as $group) { if (in_array($group['groups_id'], $_SESSION["glpigroups"])) { // All the group if ($group['entities_id'] < 0) { return true; } // Restrict to entities $entities = array($group['entities_id']); if ($group['is_recursive']) { $entities = getSonsOf('glpi_entities', $group['entities_id']); } if (Session::haveAccessToOneOfEntities($entities, true)) { return true; } } } } } // Entities if (count($this->entities) && isset($_SESSION["glpiactiveentities"]) && count($_SESSION["glpiactiveentities"])) { foreach ($this->entities as $key => $data) { foreach ($data as $entity) { $entities = array($entity['entities_id']); if ($entity['is_recursive']) { $entities = getSonsOf('glpi_entities', $entity['entities_id']); } if (Session::haveAccessToOneOfEntities($entities, true)) { return true; } } } } // Profiles if (count($this->profiles) && isset($_SESSION["glpiactiveprofile"]) && isset($_SESSION["glpiactiveprofile"]['id'])) { if (isset($this->profiles[$_SESSION["glpiactiveprofile"]['id']])) { foreach ($this->profiles[$_SESSION["glpiactiveprofile"]['id']] as $profile) { // All the profile if ($profile['entities_id'] < 0) { return true; } // Restrict to entities $entities = array($profile['entities_id']); if ($profile['is_recursive']) { $entities = getSonsOf('glpi_entities',$profile['entities_id']); } if (Session::haveAccessToOneOfEntities($entities, true)) { return true; } } } } return false; } /** * Return visibility joins to add to SQL * * @param $forceall force all joins (false by default) * * @return string joins to add **/ static function addVisibilityJoins($forceall=false) { if (!Session::haveRight('reminder_public', 'r')) { return ''; } // Users $join = " LEFT JOIN `glpi_reminders_users` ON (`glpi_reminders_users`.`reminders_id` = `glpi_reminders`.`id`) "; // Groups if ($forceall || (isset($_SESSION["glpigroups"]) && count($_SESSION["glpigroups"]))) { $join .= " LEFT JOIN `glpi_groups_reminders` ON (`glpi_groups_reminders`.`reminders_id` = `glpi_reminders`.`id`) "; } // Profiles if ($forceall || (isset($_SESSION["glpiactiveprofile"]) && isset($_SESSION["glpiactiveprofile"]['id']))) { $join .= " LEFT JOIN `glpi_profiles_reminders` ON (`glpi_profiles_reminders`.`reminders_id` = `glpi_reminders`.`id`) "; } // Entities if ($forceall || (isset($_SESSION["glpiactiveentities"]) && count($_SESSION["glpiactiveentities"]))) { $join .= " LEFT JOIN `glpi_entities_reminders` ON (`glpi_entities_reminders`.`reminders_id` = `glpi_reminders`.`id`) "; } return $join; } /** * Return visibility SQL restriction to add * * @return string restrict to add **/ static function addVisibilityRestrict() { $restrict = "`glpi_reminders`.`users_id` = '".Session::getLoginUserID()."' "; if (!Session::haveRight('reminder_public', 'r')) { return $restrict; } // Users $restrict .= " OR `glpi_reminders_users`.`users_id` = '".Session::getLoginUserID()."' "; // Groups if (isset($_SESSION["glpigroups"]) && count($_SESSION["glpigroups"])) { $restrict .= " OR (`glpi_groups_reminders`.`groups_id` IN ('".implode("','",$_SESSION["glpigroups"])."') AND (`glpi_groups_reminders`.`entities_id` < 0 ".getEntitiesRestrictRequest("OR", "glpi_groups_reminders", '', '', true).")) "; } // Profiles if (isset($_SESSION["glpiactiveprofile"]) && isset($_SESSION["glpiactiveprofile"]['id'])) { $restrict .= " OR (`glpi_profiles_reminders`.`profiles_id` = '".$_SESSION["glpiactiveprofile"]['id']."' AND (`glpi_profiles_reminders`.`entities_id` < 0 ".getEntitiesRestrictRequest("OR", "glpi_profiles_reminders", '', '', true).")) "; } // Entities if (isset($_SESSION["glpiactiveentities"]) && count($_SESSION["glpiactiveentities"])) { // Force complete SQL not summary when access to all entities $restrict .= getEntitiesRestrictRequest("OR","glpi_entities_reminders", '', '', true, true); } return '('.$restrict.')'; } function post_addItem() { if (isset($this->fields["begin"]) && !empty($this->fields["begin"])) { Planning::checkAlreadyPlanned($this->fields["users_id"], $this->fields["begin"], $this->fields["end"], array('Reminder' => array($this->fields['id']))); } if (isset($this->input['_planningrecall'])) { $this->input['_planningrecall']['items_id'] = $this->fields['id']; PlanningRecall::manageDatas($this->input['_planningrecall']); } } /** * @see CommonDBTM::post_updateItem() **/ function post_updateItem($history=1) { if (isset($this->fields["begin"]) && !empty($this->fields["begin"])) { Planning::checkAlreadyPlanned($this->fields["users_id"], $this->fields["begin"], $this->fields["end"], array('Reminder' => array($this->fields['id']))); } if (in_array("begin",$this->updates)) { PlanningRecall::managePlanningUpdates($this->getType(), $this->getID(), $this->fields["begin"]); } } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Title'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[1]['forcegroupby'] = true; $tab[2]['table'] = 'glpi_users'; $tab[2]['field'] = 'name'; $tab[2]['name'] = __('Writer'); $tab[2]['datatype'] = 'dropdown'; $tab[2]['massiveaction'] = false; $tab[2]['right'] = 'all'; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'state'; $tab[3]['name'] = __('Status'); $tab[3]['datatype'] = 'specific'; $tab[3]['massiveaction'] = false; $tab[3]['searchtype'] = 'equals'; $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'text'; $tab[4]['name'] = __('Description'); $tab[4]['massiveaction'] = false; $tab[4]['datatype'] = 'text'; $tab[4]['htmltext'] = true; $tab[5]['table'] = $this->getTable(); $tab[5]['field'] = 'begin_view_date'; $tab[5]['name'] = __('Visibility start date'); $tab[5]['datatype'] = 'datetime'; $tab[6]['table'] = $this->getTable(); $tab[6]['field'] = 'end_view_date'; $tab[6]['name'] = __('Visibility end date'); $tab[6]['datatype'] = 'datetime'; $tab[7]['table'] = $this->getTable(); $tab[7]['field'] = 'is_planned'; $tab[7]['name'] = __('Planning'); $tab[7]['datatype'] = 'bool'; $tab[7]['massiveaction'] = false; $tab[8]['table'] = $this->getTable(); $tab[8]['field'] = 'begin'; $tab[8]['name'] = __('Planning start date'); $tab[8]['datatype'] = 'datetime'; $tab[9]['table'] = $this->getTable(); $tab[9]['field'] = 'end'; $tab[9]['name'] = __('Planning end date'); $tab[9]['datatype'] = 'datetime'; $tab[19]['table'] = $this->getTable(); $tab[19]['field'] = 'date_mod'; $tab[19]['name'] = __('Last update'); $tab[19]['datatype'] = 'datetime'; $tab[19]['massiveaction'] = false; return $tab; } /** * @since version 0.84 * * @param $field * @param $values * @param $options array **/ static function getSpecificValueToDisplay($field, $values, array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } switch ($field) { case 'state': return Planning::getState($values[$field]); } return parent::getSpecificValueToDisplay($field, $values, $options); } /** * @since version 0.84 * * @param $field * @param $name (default '') * @param $values (default '') * @param $options array **/ static function getSpecificValueToSelect($field, $name='', $values='', array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'state' : return Planning::dropdownState($name, $values[$field], false); } return parent::getSpecificValueToSelect($field, $name, $values, $options); } /** * @see CommonGLPI::getTabNameForItem() **/ function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (Session::haveRight("reminder_public","r")) { switch ($item->getType()) { case 'Reminder' : if ($item->canUpdate()) { if ($_SESSION['glpishow_count_on_tabs']) { return array(1 => self::createTabEntry(__('Targets'), $item->countVisibilities())); } return array(1 => __('Targets')); } } } return ''; } /** * @see CommonGLPI::defineTabs() **/ function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('Document_Item', $ong, $options); $this->addStandardTab('Reminder', $ong, $options); return $ong; } /** * @param $item CommonGLPI object * @param $tabnum (default 1) * @param $withtemplate (default 0) **/ static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($item->getType()) { case 'Reminder' : $item->showVisibility(); return true; } return false; } /** * @see CommonDBTM::prepareInputForAdd() **/ function prepareInputForAdd($input) { Toolbox::manageBeginAndEndPlanDates($input['plan']); $input["name"] = trim($input["name"]); if (empty($input["name"])) { $input["name"] = __('Without title'); } $input["begin"] = $input["end"] = "NULL"; if (isset($input['plan'])) { if (!empty($input['plan']["begin"]) && !empty($input['plan']["end"]) && ($input['plan']["begin"] < $input['plan']["end"])) { $input['_plan'] = $input['plan']; unset($input['plan']); $input['is_planned'] = 1; $input["begin"] = $input['_plan']["begin"]; $input["end"] = $input['_plan']["end"]; } else { Session::addMessageAfterRedirect( __('Error in entering dates. The starting date is later than the ending date'), false, ERROR); } } // set new date. $input["date"] = $_SESSION["glpi_currenttime"]; return $input; } /** * @see CommonDBTM::prepareInputForUpdate() **/ function prepareInputForUpdate($input) { Toolbox::manageBeginAndEndPlanDates($input['plan']); if (isset($input['_planningrecall'])) { PlanningRecall::manageDatas($input['_planningrecall']); } if (isset($input["name"])) { $input["name"] = trim($input["name"]); if (empty($input["name"])) { $input["name"] = __('Without title'); } } if (isset($input['plan'])) { if (!empty($input['plan']["begin"]) && !empty($input['plan']["end"]) && ($input['plan']["begin"] < $input['plan']["end"])) { $input['_plan'] = $input['plan']; unset($input['plan']); $input['is_planned'] = 1; $input["begin"] = $input['_plan']["begin"]; $input["end"] = $input['_plan']["end"]; } else { Session::addMessageAfterRedirect( __('Error in entering dates. The starting date is later than the ending date'), false, ERROR); } } return $input; } function pre_updateInDB() { // Set new user if initial user have been deleted if (($this->fields['users_id'] == 0) && ($uid = Session::getLoginUserID())) { $this->fields['users_id'] = $uid; $this->updates[] ="users_id"; } } function post_getEmpty() { $this->fields["name"] = __('New note'); $this->fields["users_id"] = Session::getLoginUserID(); } /** * Print the reminder form * * @param $ID integer Id of the item to print * @param $options array of possible options: * - target filename : where to go when done. **/ function showForm($ID, $options=array()) { global $CFG_GLPI; $this->initForm($ID, $options); // Show Reminder or blank form $onfocus = ""; if (!$ID > 0) { // Create item : do getempty before check right to set default values $onfocus="onfocus=\"if (this.value=='".$this->fields['name']."') this.value='';\""; } $canedit = $this->can($ID,'w'); if ($canedit) { Html::initEditorSystem('text'); } $this->showTabs($options); $this->showFormHeader($options); echo "".__('Title').""; echo ""; if ($canedit) { Html::autocompletionTextField($this, "name", array('size' => 80, 'entity' => -1, 'user' => $this->fields["users_id"], 'option' => $onfocus)); } else { echo $this->fields['name']; } echo "\n"; echo "".__('By').""; echo ""; echo getUserName($this->fields["users_id"]); if (!$ID) { echo "\n"; } echo "\n"; echo ""; echo ""._x('reminder', 'Visibility').""; echo ""; echo '
    '; echo __('Begin').''; Html::showDateTimeFormItem("begin_view_date", $this->fields["begin_view_date"], 1, true, $canedit); echo ''.__('End').''; Html::showDateTimeFormItem("end_view_date", $this->fields["end_view_date"], 1, true, $canedit); echo '
    '; echo ""; echo "".__('Status').""; echo ""; if ($canedit) { Planning::dropdownState("state", $this->fields["state"]); } else { echo Planning::getState($this->fields["state"]); } echo "\n"; echo "\n"; echo "".__('Calendar').""; echo ""; if ($canedit) { echo "\n"; } if (!$ID || !$this->fields["is_planned"]) { if (Session::haveRight("show_planning","1") || Session::haveRight("show_group_planning","1") || Session::haveRight("show_all_planning","1")) { echo "
    \n"; echo "".__('Add to schedule').""; } } else { if ($canedit) { echo "
    \n"; echo ""; } //TRANS: %1$s is the begin date, %2$s is the end date printf(__('From %1$s to %2$s'), Html::convDateTime($this->fields["begin"]), Html::convDateTime($this->fields["end"])); if ($canedit) { echo ""; } } if ($canedit) { echo "
    \n"; echo "
    \n
    \n"; } echo ""; if ($ID && $this->fields["is_planned"] && PlanningRecall::isAvailable()) { echo ""._x('Planning','Reminder').""; echo ""; if ($canedit) { PlanningRecall::dropdown(array('itemtype' => 'Reminder', 'items_id' => $ID)); } else { // No edit right : use specific Planning Recall Form PlanningRecall::specificForm(array('itemtype' => 'Reminder', 'items_id' => $ID)); } echo ""; } else { echo ""; } echo "\n"; echo "".__('Description')."". ""; if ($canedit) { echo ""; } else { echo "
    "; echo Toolbox::unclean_html_cross_side_scripting_deep($this->fields["text"]); echo "
    "; } echo "\n"; $this->showFormButtons($options); $this->addDivForTabs(); return true; } /** * Populate the planning with planned reminder * * @param $options array of possible options: * - who ID of the user (0 = undefined) * - who_group ID of the group of users (0 = undefined) * - begin Date * - end Date * * @return array of planning item **/ static function populatePlanning($options=array()) { global $DB, $CFG_GLPI; $interv = array(); if (!isset($options['begin']) || ($options['begin'] == 'NULL') || !isset($options['end']) || ($options['end'] == 'NULL')) { return $interv; } $who = $options['who']; $who_group = $options['who_group']; $begin = $options['begin']; $end = $options['end']; $readpub = $readpriv = ""; $joinstoadd = self::addVisibilityJoins(true); // See public reminder ? if (($who === Session::getLoginUserID()) && Session::haveRight("reminder_public","r")) { $readpub = self::addVisibilityRestrict(); } // See my private reminder ? if (($who_group === "mine") || ($who === Session::getLoginUserID())) { $readpriv = "(`glpi_reminders`.`users_id` = '".Session::getLoginUserID()."')"; } else { if ($who > 0) { $readpriv = "`glpi_reminders`.`users_id` = '$who'"; } if ($who_group > 0) { if (!empty($readpriv)) { $readpriv .= " OR "; } $readpriv .= " `glpi_groups_reminders`.`groups_id` = '$who_group'"; } if (!empty($readpriv)) { $readpriv = '('.$readpriv.')'; } } $ASSIGN = ''; if (!empty($readpub) && !empty($readpriv)) { $ASSIGN = "($readpub OR $readpriv)"; } else if ($readpub) { $ASSIGN = $readpub; } else { $ASSIGN = $readpriv; } if ($ASSIGN) { $query2 = "SELECT DISTINCT `glpi_reminders`.* FROM `glpi_reminders` $joinstoadd WHERE `glpi_reminders`.`is_planned` = '1' AND $ASSIGN AND `begin` < '$end' AND `end` > '$begin' ORDER BY `begin`"; $result2 = $DB->query($query2); if ($DB->numrows($result2) > 0) { for ($i=0 ; $data=$DB->fetch_assoc($result2) ; $i++) { $key = $data["begin"]."$$".$i; $interv[$key]["itemtype"] = 'Reminder'; $interv[$key]["reminders_id"] = $data["id"]; $interv[$key]["id"] = $data["id"]; if (strcmp($begin,$data["begin"]) > 0) { $interv[$key]["begin"] = $begin; } else { $interv[$key]["begin"] = $data["begin"]; } if (strcmp($end,$data["end"]) < 0) { $interv[$key]["end"] = $end; } else { $interv[$key]["end"] = $data["end"]; } $interv[$key]["name"] = Html::resume_text($data["name"], $CFG_GLPI["cut"]); $interv[$key]["text"] = Html::resume_text(Html::clean(Toolbox::unclean_cross_side_scripting_deep($data["text"])), $CFG_GLPI["cut"]); $interv[$key]["users_id"] = $data["users_id"]; $interv[$key]["state"] = $data["state"]; $interv[$key]["state"] = $data["state"]; } } } return $interv; } /** * Display a Planning Item * * @param $val Array of the item to display * * @return Already planned information **/ static function getAlreadyPlannedInformation(array $val) { global $CFG_GLPI; //TRANS: %1$s is the begin date, %2$s is the end date $beginend = sprintf(__('From %1$s to %2$s'), Html::convDateTime($val["begin"]), Html::convDateTime($val["end"])); $out = sprintf(__('%1$s: %2$s'), $beginend, "".Html::resume_text($val["name"],80).""); return $out; } /** * Display a Planning Item * * @param $val array of the item to display * @param $who ID of the user (0 if all) * @param $type position of the item in the time block (in, through, begin or end) * (default '') * @param $complete complete display (more details) (default 0) * * @return Nothing (display function) **/ static function displayPlanningItem(array $val, $who, $type="", $complete=0) { global $CFG_GLPI; $rand = mt_rand(); $users_id = ""; // show users_id reminder $img = "rdv_private.png"; // default icon for reminder if ($val["users_id"] != Session::getLoginUserID()) { $users_id = "
    ".sprintf(__('%1$s: %2$s'), __('By'), getUserName($val["users_id"])); $img = "rdv_public.png"; } echo " "; echo ""; switch ($type) { case "in" : //TRANS: %1$s is the start time of a planned item, %2$s is the end $beginend = sprintf(__('From %1$s to %2$s'), date("H:i",strtotime($val["begin"])), date("H:i",strtotime($val["end"]))); printf(__('%1$s: %2$s'), $beginend, Html::resume_text($val["name"],80)) ; break; case "through" : echo Html::resume_text($val["name"],80); break; case "begin" : $start = sprintf(__('Start at %s'), date("H:i", strtotime($val["begin"]))); printf(__('%1$s: %2$s'), $start, Html::resume_text($val["name"],80)) ; break; case "end" : $end = sprintf(__('End at %s'), date("H:i", strtotime($val["end"]))); printf(__('%1$s: %2$s'), $end, Html::resume_text($val["name"],80)) ; break; } echo $users_id; echo ""; $recall = ''; if (isset($val['reminders_id'])) { $pr = new PlanningRecall(); if ($pr->getFromDBForItemAndUser($val['itemtype'], $val['reminders_id'], Session::getLoginUserID())) { $recall = "
    ".sprintf(__('Recall on %s'), Html::convDateTime($pr->fields['when'])). ""; } } if ($complete) { echo "
    ".Planning::getState($val["state"])."
    "; echo $val["text"].$recall; } else { Html::showToolTip("".Planning::getState($val["state"])."
    ".$val["text"].$recall, array('applyto' => "reminder_".$val["reminders_id"].$rand)); } echo ""; } /** * Show list for central view * * @param $personal boolean : display reminders created by me ? (true by default) * * @return Nothing (display function) **/ static function showListForCentral($personal=true) { global $DB, $CFG_GLPI; $users_id = Session::getLoginUserID(); $today = date('Y-m-d'); $now = date('Y-m-d H:i:s'); $restrict_visibility = " AND (`glpi_reminders`.`begin_view_date` IS NULL OR `glpi_reminders`.`begin_view_date` < '$now') AND (`glpi_reminders`.`end_view_date` IS NULL OR `glpi_reminders`.`end_view_date` > '$now') "; if ($personal) { /// Personal notes only for central view if ($_SESSION['glpiactiveprofile']['interface'] == 'helpdesk') { return false; } $query = "SELECT `glpi_reminders`.* FROM `glpi_reminders` WHERE `glpi_reminders`.`users_id` = '$users_id' AND (`glpi_reminders`.`end` >= '$today' OR `glpi_reminders`.`is_planned` = '0') $restrict_visibility ORDER BY `glpi_reminders`.`name`"; $titre = "". _n('Personal reminder', 'Personal reminders', 2).""; } else { // Show public reminders / not mines : need to have access to public reminders if (!Session::haveRight('reminder_public', 'r')) { return false; } $restrict_user = '1'; // Only personal on central so do not keep it if ($_SESSION['glpiactiveprofile']['interface'] == 'central') { $restrict_user = "`glpi_reminders`.`users_id` <> '$users_id'"; } $query = "SELECT `glpi_reminders`.* FROM `glpi_reminders` ". self::addVisibilityJoins()." WHERE $restrict_user $restrict_visibility AND ".self::addVisibilityRestrict()." ORDER BY `glpi_reminders`.`name`"; if ($_SESSION['glpiactiveprofile']['interface'] != 'helpdesk') { $titre = "". _n('Public reminder', 'Public reminders', 2).""; } else { $titre = _n('Public reminder', 'Public reminders', 2); } } $result = $DB->query($query); $nb = $DB->numrows($result); echo "
    "; echo "\n"; if ($nb) { $rand = mt_rand(); while ($data = $DB->fetch_assoc($result)) { echo "\n"; } } echo "
    $titre"; if (self::canCreate()) { echo ""; echo ""; echo "".__s("; } echo "
    "; $link = "". $data["name"].""; $tooltip = Html::showToolTip(Toolbox::unclean_html_cross_side_scripting_deep($data["text"]), array('applyto' => "content_reminder_".$data["id"].$rand, 'display' => false)); printf(__('%1$s %2$s'), $link, $tooltip); if ($data["is_planned"]) { $tab = explode(" ",$data["begin"]); $date_url = $tab[0]; echo ""; echo ""; echo "\""."; echo ""; } echo "
    \n"; } /** * Show visibility config for a reminder **/ function showVisibility() { global $DB, $CFG_GLPI; $ID = $this->fields['id']; $canedit = Session::haveRight('reminder_public', 'w'); echo "
    "; $rand = mt_rand(); $nb = count($this->users) + count($this->groups) + count($this->profiles) + count($this->entities); if ($canedit) { echo "
    "; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
    ".__('Add a target')."
    "; $types = array('Entity', 'Group', 'Profile', 'User'); $addrand = Dropdown::showItemTypes('_type', $types); $params = array('type' => '__VALUE__', 'right' => 'reminder_public'); Ajax::updateItemOnSelectEvent("dropdown__type".$addrand,"visibility$rand", $CFG_GLPI["root_doc"]."/ajax/visibility.php", $params); echo ""; echo "
    "; Html::closeForm(); echo "
    "; } echo "
    "; if ($canedit && $nb) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $paramsma = array('num_displayed' => $nb, 'specific_actions' => array('deletevisibility' => _x('button', 'Delete permanently')) ); if ($this->fields['users_id'] != Session::getLoginUserID()) { $paramsma['confirm'] = __('Caution! You are not the author of this element. Delete targets can result in loss of access to that element.'); } Html::showMassiveActions(__CLASS__, $paramsma); } echo ""; echo ""; if ($canedit && $nb) { echo ""; } echo ""; echo ""; echo ""; // Users if (count($this->users)) { foreach ($this->users as $key => $val) { foreach ($val as $data) { echo ""; if ($canedit) { echo ""; } echo ""; echo ""; echo ""; } } } // Groups if (count($this->groups)) { foreach ($this->groups as $key => $val) { foreach ($val as $data) { echo ""; if ($canedit) { echo ""; } echo ""; $names = Dropdown::getDropdownName('glpi_groups', $data['groups_id'],1); $entname = sprintf(__('%1$s %2$s'), $names["name"], Html::showToolTip($names["comment"], array('display' => false))); if ($data['entities_id'] >= 0) { $entname = sprintf(__('%1$s / %2$s'), $entname, Dropdown::getDropdownName('glpi_entities', $data['entities_id'])); if ($data['is_recursive']) { //TRANS: R for Recursive sprintf(__('%1$s %2$s'), $entname, "(".__('R').")"); } } echo ""; echo ""; } } } // Entity if (count($this->entities)) { foreach ($this->entities as $key => $val) { foreach ($val as $data) { echo ""; if ($canedit) { echo ""; } echo ""; $names = Dropdown::getDropdownName('glpi_entities', $data['entities_id'],1); $tooltip = Html::showToolTip($names["comment"], array('display' => false)); $entname = sprintf(__('%1$s %2$s'), $names["name"], $tooltip); if ($data['is_recursive']) { $entname = sprintf(__('%1$s %2$s'), $entname, "(".__('R').")"); } echo ""; echo ""; } } } // Profiles if (count($this->profiles)) { foreach ($this->profiles as $key => $val) { foreach ($val as $data) { echo ""; if ($canedit) { echo ""; } echo ""; $names = Dropdown::getDropdownName('glpi_profiles',$data['profiles_id'],1); $tooltip = Html::showToolTip($names["comment"], array('display' => false)); $entname = sprintf(__('%1$s %2$s'), $names["name"], $entname); if ($data['entities_id'] >= 0) { $entname = sprintf(__('%1$s / %2$s'), $entname, Dropdown::getDropdownName('glpi_entities', $data['entities_id'])); if ($data['is_recursive']) { $entname = sprintf(__('%1$s %2$s'), $entname, "(".__('R').")"); } } echo ""; echo ""; } } } echo "
    "; echo Html::checkAllAsCheckbox('mass'.__CLASS__.$rand); echo "".__('Type').""._n('Recipient', 'Recipients', 2)."
    "; echo ""; echo "".__('User')."".getUserName($data['users_id'])."
    "; echo ""; echo "".__('Group')."".$entname."
    "; echo ""; echo "".__('Entity')."".$entname."
    "; echo ""; echo ""._n('Profile', 'Profiles', 1)."".$entname."
    "; if ($canedit && $nb) { $paramsma['ontop'] =false; Html::showMassiveActions(__CLASS__, $paramsma); Html::closeForm(); } echo "
    "; // Add items return true; } } ?> glpi-0.84.3+dfsg.1/inc/reminder_user.class.php000066400000000000000000000042251226600447100210550ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Reminder_User /// @since version 0.83 class Reminder_User extends CommonDBRelation { // From CommonDBRelation static public $itemtype_1 = 'Reminder'; static public $items_id_1 = 'reminders_id'; static public $itemtype_2 = 'User'; static public $items_id_2 = 'users_id'; static public $checkItem_2_Rights = self::DONT_CHECK_ITEM_RIGHTS; static public $logs_for_item_2 = false; /** * Get users for a reminder * * @param $reminders_id ID of the reminder * * @return array of users linked to a reminder **/ static function getUsers($reminders_id) { global $DB; $users = array(); $query = "SELECT `glpi_reminders_users`.* FROM `glpi_reminders_users` WHERE `reminders_id` = '$reminders_id'"; foreach ($DB->request($query) as $data) { $users[$data['users_id']][] = $data; } return $users; } } ?> glpi-0.84.3+dfsg.1/inc/report.class.php000066400000000000000000000375471226600447100175420ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Report class * * @ since version 0.84 **/ class Report { static protected $notable = false; static function getTypeName($nb=0) { return _n('Report', 'Reports', $nb); } /** * Show report title **/ static function title() { global $PLUGIN_HOOKS, $CFG_GLPI; // Report generation // Default Report included $report_list["default"]["name"] = __('Default report'); $report_list["default"]["file"] = "report.default.php"; if (Session::haveRight("contract","r")) { // Rapport ajoute par GLPI V0.2 $report_list["Contrats"]["name"] = __('By contract'); $report_list["Contrats"]["file"] = "report.contract.php"; } if (Session::haveRight("infocom","r")) { $report_list["Par_annee"]["name"] = __('By year'); $report_list["Par_annee"]["file"] = "report.year.php"; $report_list["Infocoms"]["name"] = __('Hardware financial and administrative information'); $report_list["Infocoms"]["file"] = "report.infocom.php"; $report_list["Infocoms2"]["name"] = __('Other financial and administrative information (licenses, cartridges, consumables)'); $report_list["Infocoms2"]["file"] = "report.infocom.conso.php"; } if (Session::haveRight("networking","r")) { $report_list["Rapport prises reseau"]["name"] = __('Network report'); $report_list["Rapport prises reseau"]["file"] = "report.networking.php"; } if (Session::haveRight("reservation_central","r")) { $report_list["reservation"]["name"] = __('Loan'); $report_list["reservation"]["file"] = "report.reservation.php"; } if (Session::haveRight("computer","r") || Session::haveRight("monitor","r") || Session::haveRight("networking","r") || Session::haveRight("peripheral","r") || Session::haveRight("printer","r") || Session::haveRight("phone","r")) { $report_list["state"]["name"] = _n('Status', 'Statuses', 2); $report_list["state"]["file"] = "report.state.php"; } //Affichage du tableau de presentation des stats echo ""; echo ""; echo ""; echo ""; echo "
    ".__('Select the report you want to generate')."
    "; echo ""; echo "
    "; } /** * Show Default Report * * @since version 0.84 **/ static function showDefaultReport() { global $DB; # Title echo "GLPI ".Report::getTypeName(2)."

    "; # 1. Get counts of itemtype $items = array('Computer', 'Printer', 'NetworkEquipment', 'Software', 'Monitor', 'Peripheral', 'Phone'); $linkitems = array('Printer', 'Monitor', 'Peripheral', 'Phone'); echo ""; foreach ($items as $itemtype) { $table_item = getTableForItemType($itemtype); $where = "WHERE `".$table_item."`.`is_deleted` = '0' AND `".$table_item."`.`is_template` = '0' "; $join =""; if (in_array($itemtype, $linkitems)) { $join = "LEFT JOIN `glpi_computers_items` ON (`glpi_computers_items`.`itemtype` = '".$itemtype."' AND `glpi_computers_items`.`items_id` = `".$table_item."`.`id`)"; } $query = "SELECT COUNT(*) FROM `".$table_item."` $join $where ". getEntitiesRestrictRequest("AND",$table_item); $result = $DB->query($query); $number = $DB->result($result,0,0); echo ""; echo ""; } echo ""; # 2. Get some more number data (operating systems per computer) $where = "WHERE `is_deleted` = '0' AND `is_template` = '0' "; $query = "SELECT COUNT(*) AS count, `glpi_operatingsystems`.`name` AS name FROM `glpi_computers` LEFT JOIN `glpi_operatingsystems` ON (`glpi_computers`.`operatingsystems_id` = `glpi_operatingsystems`.`id`) $where ". getEntitiesRestrictRequest("AND","glpi_computers")." GROUP BY `glpi_operatingsystems`.`name`"; $result = $DB->query($query); while ($data=$DB->fetch_assoc($result)) { if (empty($data['name'])) { $data['name'] = Dropdown::EMPTY_VALUE; } echo ""; echo ""; } # Get counts of types $val = array_flip($items); unset($val["Software"]); $items = array_flip($val); foreach ($items as $itemtype) { echo ""; $table_item = getTableForItemType($itemtype); $typeclass = $itemtype."Type"; $type_table = getTableForItemType($typeclass); $typefield = getForeignKeyFieldForTable(getTableForItemType($typeclass)); $where = "WHERE `".$table_item."`.`is_deleted` = '0' AND `".$table_item."`.`is_template` = '0' "; $join =""; if (in_array($itemtype, $linkitems)) { $join = "LEFT JOIN `glpi_computers_items` ON (`glpi_computers_items`.`itemtype` = '".$itemtype."' AND `glpi_computers_items`.`items_id` = `".$table_item."`.`id`)"; } $query = "SELECT COUNT(*) AS count, `".$type_table."`.`name` AS name FROM `".$table_item."` LEFT JOIN `".$type_table."` ON (`".$table_item."`.`".$typefield."` = `".$type_table."`.`id`) $join $where ". getEntitiesRestrictRequest("AND",$table_item)." GROUP BY `".$type_table."`.`name`"; $result = $DB->query($query); while ($data=$DB->fetch_assoc($result)) { if (empty($data['name'])) { $data['name'] = Dropdown:: EMPTY_VALUE; } echo ""; echo ""; } } echo "
    ".$itemtype::getTypeName(2)."$number
    ".__('Operating system')."
    ".$data['name']."".$data['count']."
    ".$itemtype::getTypeName(2)."
    ".$data['name']."".$data['count']."
    "; } /** * @since version 0.84 * * @param $networkport_prefix * @param $networkport_crit * @param $where_crit * @param $order (default '') * @param $field (default '') * @param $extra (default '') **/ static function reportForNetworkInformations($networkport_prefix, $networkport_crit, $where_crit, $order = '', $field = '', $extra = '') { global $DB; // This SQL request matches the NetworkPort, then its NetworkName and IPAddreses. It also // match opposite NetworkPort, then its NetworkName and IPAddresses. // Results are groupes by NetworkPort. Then all IPs are concatenated by comma as separator. $query = "SELECT $field PORT_1.`itemtype` AS itemtype_1, PORT_1.`items_id` AS items_id_1, PORT_1.`id` AS id_1, PORT_1.`name` AS port_1, PORT_1.`mac` AS mac_1, GROUP_CONCAT(ADDR_1.`name` SEPARATOR ',') AS ip_1, PORT_2.`itemtype` AS itemtype_2, PORT_2.`items_id` AS items_id_2, PORT_2.`id` AS id_2, PORT_2.`name` AS port_2, PORT_2.`mac` AS mac_2, GROUP_CONCAT(ADDR_2.`name` SEPARATOR ',') AS ip_2 FROM $networkport_prefix INNER JOIN `glpi_networkports` AS PORT_1 ON ($networkport_crit AND PORT_1.`is_deleted` = 0) LEFT JOIN `glpi_networknames` AS NAME_1 ON (NAME_1.`itemtype` = 'NetworkPort' AND PORT_1.`id` = NAME_1.`items_id` AND NAME_1.`is_deleted` = 0) LEFT JOIN `glpi_ipaddresses` AS ADDR_1 ON (ADDR_1.`itemtype` = 'NetworkName' AND NAME_1.`id` = ADDR_1.`items_id` AND ADDR_1.`is_deleted` = 0) LEFT JOIN `glpi_networkports_networkports` AS LINK ON (LINK.`networkports_id_1` = PORT_1.`id` OR LINK.`networkports_id_2` = PORT_1.`id`) LEFT JOIN `glpi_networkports` AS PORT_2 ON (PORT_2.`id`=IF(LINK.`networkports_id_1`=PORT_1.`id`, LINK.`networkports_id_2`, LINK.`networkports_id_1`)) LEFT JOIN `glpi_networknames` AS NAME_2 ON (NAME_2.`itemtype` = 'NetworkPort' AND PORT_2.`id` = NAME_2.`items_id` AND NAME_2.`is_deleted` = 0) LEFT JOIN `glpi_ipaddresses` AS ADDR_2 ON (ADDR_2.`itemtype` = 'NetworkName' AND NAME_2.`id` = ADDR_2.`items_id` AND ADDR_2.`is_deleted` = 0) WHERE $where_crit GROUP BY PORT_1.`id`"; if (!empty($order)) { $query .= "ORDER BY $order"; } $result = $DB->request($query); if ($result->numrows() > 0) { echo ""; echo ""; if (!empty($extra)) { echo ""; } echo ""; echo ""; echo "\n"; echo ""; if (!empty($extra)) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; foreach ($result as $line) { echo ""; // To ensure that the NetworkEquipment remain the first item, we test its type if ($line['itemtype_2'] == 'NetworkEquipment') { $idx = 2; } else { $idx = 1; } if (!empty($extra)) { echo ""; } $itemtype = $line["itemtype_$idx"]; if (!empty($itemtype)) { echo ""; $item_name = ''; if ($item = getItemForItemtype($itemtype)) { if ($item->getFromDB($line["items_id_$idx"])) { $item_name = $item->getName(); } } echo ""; } else { echo ""; echo ""; } echo ""; echo ""; echo ""; if ($idx == 1) { $idx = 2; } else { $idx = 1; } echo ""; echo ""; echo ""; $itemtype = $line["itemtype_$idx"]; if (!empty($itemtype)) { echo ""; $item_name = ''; if ($item = getItemForItemtype($itemtype)) { if ($item->getFromDB($line["items_id_$idx"])) { $item_name = $item->getName(); } } echo ""; } else { echo ""; echo ""; } echo "\n"; } echo "
     ".__('Device 1')."".__('Device 2')."
    $extra".__('Device type')."".__('Device name')."".NetworkPort::getTypeName(1)."".__('MAC address')."".IPAddress::getTypeName(0)."".NetworkPort::getTypeName(1)."".__('MAC address')."".IPAddress::getTypeName(0)."".__('Device type')."".__('Device name')."
    ".(empty($line['extra']) ? NOT_AVAILABLE : $line['extra'])."".$itemtype::getTypeName(1)."".(empty($item_name) ? NOT_AVAILABLE : $item_name)." ".NOT_AVAILABLE." ".NOT_AVAILABLE." ".(empty($line["port_$idx"]) ? NOT_AVAILABLE : $line["port_$idx"])."".(empty($line["mac_$idx"]) ? NOT_AVAILABLE : $line["mac_$idx"])."".(empty($line["ip_$idx"]) ? NOT_AVAILABLE : $line["ip_$idx"])."".(empty($line["port_$idx"]) ? NOT_AVAILABLE : $line["port_$idx"])."".(empty($line["mac_$idx"]) ? NOT_AVAILABLE : $line["mac_$idx"])."".(empty($line["ip_$idx"]) ? NOT_AVAILABLE : $line["ip_$idx"])."".$itemtype::getTypeName(1)."".(empty($item_name) ? NOT_AVAILABLE : $item_name)." ".NOT_AVAILABLE." ".NOT_AVAILABLE."



    "; } } } ?> glpi-0.84.3+dfsg.1/inc/requesttype.class.php000066400000000000000000000107671226600447100206140ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class RequestType class RequestType extends CommonDropdown { static function getTypeName($nb=0) { return _n('Request source', 'Request sources', $nb); } function getAdditionalFields() { return array(array('name' => 'is_helpdesk_default', 'label' => __('Default for tickets'), 'type' => 'bool'), array('name' => 'is_mail_default', 'label' => __('Default for mail recipients'), 'type' => 'bool')); } function getSearchOptions() { $tab = parent::getSearchOptions(); $tab[14]['table'] = $this->getTable(); $tab[14]['field'] = 'is_helpdesk_default'; $tab[14]['name'] = __('Default for tickets'); $tab[14]['datatype'] = 'bool'; $tab[14]['massiveaction'] = false; $tab[15]['table'] = $this->getTable(); $tab[15]['field'] = 'is_mail_default'; $tab[15]['name'] = __('Default for mail recipients'); $tab[15]['datatype'] = 'bool'; $tab[15]['massiveaction'] = false; return $tab; } function post_addItem() { global $DB; if (isset($this->input["is_helpdesk_default"]) && $this->input["is_helpdesk_default"]) { $query = "UPDATE `".$this->getTable()."` SET `is_helpdesk_default` = '0' WHERE `id` <> '".$this->fields['id']."'"; $DB->query($query); } if (isset($this->input["is_mail_default"]) && $this->input["is_mail_default"]) { $query = "UPDATE `".$this->getTable()."` SET `is_mail_default` = '0' WHERE `id` <> '".$this->fields['id']."'"; $DB->query($query); } } /** * @see CommonDBTM::post_updateItem() **/ function post_updateItem($history=1) { global $DB; if (in_array('is_helpdesk_default',$this->updates)) { if ($this->input["is_helpdesk_default"]) { $query = "UPDATE `".$this->getTable()."` SET `is_helpdesk_default` = '0' WHERE `id` <> '".$this->input['id']."'"; $DB->query($query); } else { Session::addMessageAfterRedirect(__('Be careful: there is no default value'), true); } } if (in_array('is_mail_default',$this->updates)) { if ($this->input["is_mail_default"]) { $query = "UPDATE `".$this->getTable()."` SET `is_mail_default` = '0' WHERE `id` <> '".$this->input['id']."'"; $DB->query($query); } else { Session::addMessageAfterRedirect(__('Be careful: there is no default value'), true); } } } /** * Get the default request type for a given source (mail, helpdesk) * * @param $source string * * @return requesttypes_id **/ static function getDefault($source) { global $DB; if (!in_array($source, array('mail', 'helpdesk'))) { return 0; } foreach ($DB->request('glpi_requesttypes', array('is_'.$source.'_default' => 1)) as $data) { return $data['id']; } return 0; } function cleanDBonPurge() { Rule::cleanForItemCriteria($this); } } ?>glpi-0.84.3+dfsg.1/inc/reservation.class.php000066400000000000000000001301071226600447100205520ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Reservation class class Reservation extends CommonDBChild { // From CommonDBChild static public $itemtype = 'ReservationItem'; static public $items_id = 'reservationitems_id'; static public $checkParentRights = self::HAVE_VIEW_RIGHT_ON_ITEM; /** * @param $nb integer for singular or plural **/ static function getTypeName($nb=0) { return _n('Reservation', 'Reservations', $nb); } /** * @see CommonGLPI::getTabNameForItem() **/ function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate && Session::haveRight("reservation_central", "r")) { return self::getTypeName(2); } return ''; } /** * @param $item CommonGLPI object * @param $tabnum (default1) * @param $withtemplate (default0) **/ static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType() == 'User') { self::showForUser($_POST["id"]); } else { self::showForItem($item); } return true; } function pre_deleteItem() { global $CFG_GLPI; if (isset($this->fields["users_id"]) && (($this->fields["users_id"] === Session::getLoginUserID()) || Session::haveRight("reservation_central", "w"))) { // Processing Email if ($CFG_GLPI["use_mailing"]) { NotificationEvent::raiseEvent("delete",$this); } } return true; } /** * @see CommonDBChild::prepareInputForUpdate() **/ function prepareInputForUpdate($input) { $item = 0; if (isset($input['_item'])) { $item = $_POST['_item']; } // Save fields $oldfields = $this->fields; // Needed for test already planned if (isset($input["begin"])) { $this->fields["begin"] = $input["begin"]; } if (isset ($input["end"])) { $this->fields["end"] = $input["end"]; } if (!$this->test_valid_date()) { $this->displayError("date", $item); return false; } if ($this->is_reserved()) { $this->displayError("is_res", $item); return false; } // Restore fields $this->fields = $oldfields; return parent::prepareInputForUpdate($input); } /** * @see CommonDBTM::post_updateItem() **/ function post_updateItem($history=1) { global $CFG_GLPI; if (count($this->updates) && $CFG_GLPI["use_mailing"]) { NotificationEvent::raiseEvent("update",$this); //$mail = new MailingResa($this,"update"); //$mail->send(); } parent::post_updateItem($history); } /** * @see CommonDBChild::prepareInputForAdd() **/ function prepareInputForAdd($input) { // Error on previous added reservation on several add if (isset($input['_ok']) && !$input['_ok']) { return false; } // set new date. $this->fields["reservationitems_id"] = $input["reservationitems_id"]; $this->fields["begin"] = $input["begin"]; $this->fields["end"] = $input["end"]; if (!$this->test_valid_date()) { $this->displayError("date", $input["reservationitems_id"]); return false; } if ($this->is_reserved()) { $this->displayError("is_res", $input["reservationitems_id"]); return false; } return parent::prepareInputForAdd($input); } function post_addItem() { global $CFG_GLPI; if ($CFG_GLPI["use_mailing"]) { NotificationEvent::raiseEvent("new",$this); } parent::post_addItem(); } // SPECIFIC FUNCTIONS /** * @param $reservationitems_id **/ function getUniqueGroupFor($reservationitems_id) { global $DB; do { $rand = mt_rand(1,mt_getrandmax()); $query = "SELECT COUNT(*) AS CPT FROM `glpi_reservations` WHERE `reservationitems_id` = '$reservationitems_id' AND `group` = '$rand';"; $result = $DB->query($query); $count = $DB->result($result,0,0); } while ($count > 0); return $rand; } /** * Is the item already reserved ? * *@return boolean **/ function is_reserved() { global $DB; if (!isset($this->fields["reservationitems_id"]) || empty($this->fields["reservationitems_id"])) { return true; } // When modify a reservation do not itself take into account $ID_where = ""; if (isset($this->fields["id"])) { $ID_where = " `id` <> '".$this->fields["id"]."' AND "; } $query = "SELECT * FROM `".$this->getTable()."` WHERE $ID_where `reservationitems_id` = '".$this->fields["reservationitems_id"]."' AND '".$this->fields["begin"]."' < `end` AND '".$this->fields["end"]."' > `begin`"; if ($result = $DB->query($query)) { return ($DB->numrows($result) > 0); } return true; } /** * Current dates are valid ? begin before end * *@return boolean **/ function test_valid_date() { return (!empty($this->fields["begin"]) && !empty($this->fields["end"]) && (strtotime($this->fields["begin"]) < strtotime($this->fields["end"]))); } /** * display error message * * @param $type error type : date / is_res / other * @param $ID ID of the item * * @return nothing **/ function displayError($type,$ID) { echo "
    "; switch ($type) { case "date" : _e('Error in entering dates. The starting date is later than the ending date'); break; case "is_res" : _e('The required item is already reserved for this timeframe'); break; default : _e("Unknown error"); } echo "
    ".__('Back to planning').""; echo "
    "; } /** * @since version 0.84 **/ static function canCreate() { return ((Session::haveRight("reservation_helpdesk", "1") || Session::haveRight("reservation_central", "w")) && parent::canCreate()); } /** * @since version 0.84 **/ static function canView() { return ((Session::haveRight("reservation_helpdesk", "1") || Session::haveRight("reservation_central", "r")) && parent::canView()); } /** * @since version 0.84 **/ static function canUpdate() { return ((Session::haveRight("reservation_helpdesk", "1") || Session::haveRight("reservation_central", "w")) && parent::canUpdate()); } /** * @since version 0.84 **/ static function canDelete() { return ((Session::haveRight("reservation_helpdesk", "1") || Session::haveRight("reservation_central", "w")) && parent::canDelete()); } /** * Overload canChildItem to make specific checks * @since version 0.84 **/ function canChildItem($methodItem, $methodNotItem) { // Original user always have right if ($this->fields['users_id'] === Session::getLoginUserID()) { return true; } if (!parent::canChildItem($methodItem, $methodNotItem)) { return false; } $ri = $this->getItem(); if ($ri === false) { return false; } $item = $ri->getItem(); if ($item === false) { return false; } return Session::haveAccessToEntity($item->getEntityID()); } function post_purgeItem() { global $DB; if (isset($this->input['_delete_group']) && $this->input['_delete_group']) { $query = "SELECT * FROM `glpi_reservations` WHERE `reservationitems_id` = '".$this->fields['reservationitems_id']."' AND `group` = '".$this->fields['group']."' "; $rr = clone $this; foreach ($DB->request($query) as $data) { $rr->delete(array('id' => $data['id'])); } } } /** * Show reservation calendar * * @param $ID ID of the reservation item (if empty display all) (default '') **/ static function showCalendar($ID="") { global $CFG_GLPI; if (!Session::haveRight("reservation_helpdesk", "1")) { return false; } if (!isset($_GET["mois_courant"])) { $mois_courant = intval(strftime("%m")); } else { $mois_courant = $_GET["mois_courant"]; } if (!isset($_GET["annee_courante"])) { $annee_courante = strftime("%Y"); } else { $annee_courante = $_GET["annee_courante"]; } $mois_courant = intval($mois_courant); $mois_suivant = $mois_courant+1; $mois_precedent = $mois_courant-1; $annee_suivante = $annee_courante; $annee_precedente = $annee_courante; if ($mois_precedent == 0) { $mois_precedent = 12; $annee_precedente --; } if ($mois_suivant == 13) { $mois_suivant = 1; $annee_suivante ++; } $monthsarray = Toolbox::getMonthsOfYearArray(); $str_suivant = "?reservationitems_id=$ID&mois_courant=$mois_suivant&". "annee_courante=$annee_suivante"; $str_precedent = "?reservationitems_id=$ID&mois_courant=$mois_precedent&". "annee_courante=$annee_precedente"; if (!empty($ID)) { $m = new ReservationItem(); $m->getFromDB($ID); if ((!isset($m->fields['is_active'])) || !$m->fields['is_active']) { echo "
    "; echo ""; echo ""; echo ""; echo ""; echo "
    ".__('Device temporarily unavailable')."
    "; Html::displayBackLink(); echo "
    "; echo "
    "; return false; } $type = $m->fields["itemtype"]; $name = NOT_AVAILABLE; if ($item = getItemForItemtype($m->fields["itemtype"])) { $type = $item->getTypeName(); if ($item->getFromDB($m->fields["items_id"])) { $name = $item->getName(); } $name = sprintf(__('%1$s - %2$s'), $type, $name); } $all = "".__('Show all').""; } else { $type = ""; $name = __('All reservable devices'); $all = " "; } echo "
    "; echo ""; echo "
    "; echo "".$name."
    $all

    \n"; // Check bisextile years if (($annee_courante%4) == 0) { $fev = 29; } else { $fev = 28; } $nb_jour = array(31, $fev, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); // Datas used to put right information in columns $jour_debut_mois = strftime("%w", mktime(0, 0, 0, $mois_courant, 1, $annee_courante)); if ($jour_debut_mois == 0) { $jour_debut_mois = 7; } $jour_fin_mois = strftime("%w", mktime(0, 0, 0, $mois_courant, $nb_jour[$mois_courant-1], $annee_courante)); echo "
    "; echo ""; echo ""; echo "
    "; echo "\"".__s('Previous').".sprintf(__('%1$s %2$s'), $monthsarray[$mois_courant], $annee_courante). ""; echo "\"".__s('Next').
    \n"; // test echo "
    "; echo "
    "; // today date $today = getdate(time()); $mois = $today["mon"]; $annee = $today["year"]; $annee_avant = $annee_courante - 1; $annee_apres = $annee_courante + 1; echo "
    "; echo "
    $annee_avant
    "; for ($i=$mois_courant ; $i<13 ; $i++) { echo ""; } echo "
    $annee_courante
    "; for ($i=1 ; $i<13 ; $i++) { if ($i == $mois_courant) { echo "
    ".$monthsarray[$i]."
    \n"; } else { echo "\n"; } } echo "
    $annee_apres
    \n"; for ($i=1 ; $i<$mois_courant+1 ; $i++) { echo "\n"; } echo "
    "; echo "
    "; echo "
    "; // test echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; echo ""; // Insert blank cell before the first day of the month for ($i=1 ; $i<$jour_debut_mois ; $i++) { echo ""; } // voici le remplissage proprement dit if (($mois_courant < 10) && (strlen($mois_courant) == 1)) { $mois_courant = "0".$mois_courant; } for ($i=1 ; $i<$nb_jour[$mois_courant-1]+1 ; $i++) { if ($i < 10) { $ii = "0".$i; } else { $ii = $i; } echo ""; // il ne faut pas oublie d'aller a la ligne suivante en fin de semaine if ((($i+$jour_debut_mois)%7) == 1) { echo "\n"; if ($i != $nb_jour[$mois_courant-1]) { echo ""; } } } // on recommence pour finir le tableau proprement pour les m�es raisons if ($jour_fin_mois != 0) { for ($i=0 ; $i<7-$jour_fin_mois ; $i++) { echo ""; } } echo "
    ".__('Monday')."".__('Tuesday')."".__('Wednesday')."".__('Thursday')."".__('Friday')."".__('Saturday')."".__('Sunday')."
     "; echo "\n"; if (!empty($ID)) { echo "\n"; } echo "
    "; echo "".$i."
    "; echo ""; echo "\"".
    "; self::displayReservationDay($ID, $annee_courante."-".$mois_courant."-".$ii); echo "
    \n"; echo "
     
    \n"; echo "
    \n"; } /** * Display for reservation * * @param $ID ID of the reservation (empty for create new) * @param $options array of possibles options: * - item reservation items ID for creation process * - date date for creation process **/ function showForm($ID, $options=array()) { global $CFG_GLPI; if (!Session::haveRight("reservation_helpdesk","1")) { return false; } $resa = new self(); if (!empty($ID)) { if (!$resa->getFromDB($ID)) { return false; } if (!$resa->can($ID,"w")) { return false; } // Set item if not set if ((!isset($options['item']) || (count($options['item']) == 0)) && ($itemid = $resa->getField('reservationitems_id'))) { $options['item'][$itemid] = $itemid; } } else { $resa->getEmpty(); $resa->fields["begin"] = $options['date']." 12:00:00"; $resa->fields["end"] = $options['date']." 13:00:00"; } // No item : problem if (!isset($options['item']) || (count($options['item']) == 0)) { return false; } echo "
    "; if (!empty($ID)) { echo ""; } echo ""; echo "\n"; // Add Hardware name $r = new ReservationItem(); echo ""; echo "\n"; if (!Session::haveRight("reservation_central","w") || is_null($item) || !Session::haveAccessToEntity($item->fields["entities_id"])) { echo ""; } else { echo ""; echo "\n"; } echo "\n"; $default_delay = floor((strtotime($resa->fields["end"])-strtotime($resa->fields["begin"])) /$CFG_GLPI['time_step']/MINUTE_TIMESTAMP) *$CFG_GLPI['time_step']*MINUTE_TIMESTAMP; echo "\n"; if (empty($ID)) { echo ""; echo "\n"; } echo ""; echo "\n"; if (empty($ID)) { echo ""; echo "\n"; } else { echo ""; echo "\n"; } echo "
    ".__('Reserve an item')."
    ".__('Item').""; foreach ($options['item'] as $itemID) { $r->getFromDB($itemID); $type = $r->fields["itemtype"]; $name = NOT_AVAILABLE; $item = NULL; if ($item = getItemForItemtype($r->fields["itemtype"])) { $type = $item->getTypeName(); if ($item->getFromDB($r->fields["items_id"])) { $name = $item->getName(); } else { $item = NULL; } } echo "".sprintf(__('%1$s - %2$s'), $type, $name)."
    "; echo ""; } echo "
    ".__('By').""; if (empty($ID)) { User::dropdown(array('value' => Session::getLoginUserID(), 'entity' => $item->getEntityID(), 'right' => 'all')); } else { User::dropdown(array('value' => $resa->fields["users_id"], 'entity' => $item->getEntityID(), 'right' => 'all')); } echo "
    ".__('Start date').""; $rand_begin = Html::showDateTimeFormItem("resa[begin]", $resa->fields["begin"], -1, false); echo "
    ".__('Duration').""; $rand = Dropdown::showTimeStamp("resa[_duration]", array('min' => 0, 'max' => 24*HOUR_TIMESTAMP, 'value' => $default_delay, 'emptylabel' => __('Specify an end date'))); echo "
    "; $params = array('duration' => '__VALUE__', 'end' => $resa->fields["end"], 'name' => "resa[end]"); Ajax::updateItemOnSelectEvent("dropdown_resa[_duration]$rand", "date_end$rand", $CFG_GLPI["root_doc"]."/ajax/planningend.php", $params); if ($default_delay == 0) { $params['duration'] = 0; Ajax::updateItem("date_end$rand", $CFG_GLPI["root_doc"]."/ajax/planningend.php", $params); } Alert::displayLastAlert('Reservation', $ID); echo "
    ".__('Rehearsal').""; echo ""; $params = array('type' => '__VALUE__', 'end' => $resa->fields["end"]); Ajax::updateItemOnSelectEvent("resaperiod$rand", "resaperiodcontent$rand", $CFG_GLPI["root_doc"]."/ajax/resaperiod.php", $params); echo "
    "; // Dropdown::showInteger('periodicity_times', 1, 1, 60); echo "
    ".__('Comments').""; echo "
    "; echo ""; echo "
    "; echo ""; if ($resa->fields["group"] > 0) { echo "
     ". __s('Delete all rehearsals'); } echo "
    "; echo ""; echo "
    "; Html::closeForm(); echo "
    \n"; } /** * compute periodicities for reservation * * @since version 0.84 * * @param $begin begin of the initial reservation * @param $end begin of the initial reservation * @param $options array periodicity parameters : must contain : type (day/week/month), end **/ static function computePeriodicities ($begin, $end, $options=array()) { $toadd = array(); if (isset($options['type']) && isset($options['end'])) { $begin_time = strtotime($begin); $end_time = strtotime($end); $repeat_end = strtotime($options['end'].' 23:59:59'); switch ($options['type']) { case 'day' : $begin_time = strtotime("+1 day",$begin_time); $end_time = strtotime("+1 day",$end_time); while ($begin_time < $repeat_end) { $toadd[date('Y-m-d H:i:s', $begin_time)] = date('Y-m-d H:i:s', $end_time); $begin_time = strtotime("+1 day",$begin_time); $end_time = strtotime("+1 day",$end_time); } break; case 'week' : $dates = array(); // No days set add 1 week if (!isset($options['days'])) { $dates = array(array('begin' => strtotime('+1 week',$begin_time), 'end' => strtotime('+1 week',$end_time))); } else { if (is_array($options['days'])) { $begin_hour = $begin_time- strtotime(date('Y-m-d', $begin_time)); $end_hour = $end_time - strtotime(date('Y-m-d', $end_time)); foreach ($options['days'] as $day => $val) { $dates[] = array('begin' => strtotime("next $day", $begin_time)+$begin_hour, 'end' => strtotime("next $day", $end_time)+$end_hour); } } } foreach ($dates as $key => $val) { $begin_time = $val['begin']; $end_time = $val['end']; while ($begin_time < $repeat_end) { $toadd[date('Y-m-d H:i:s', $begin_time)] = date('Y-m-d H:i:s', $end_time); $begin_time = strtotime('+1 week',$begin_time); $end_time = strtotime('+1 week',$end_time); } } break; case 'month' : if (isset($options['subtype'])) { switch ($options['subtype']) { case 'date': $i=1; $calc_begin_time = strtotime("+$i month", $begin_time); $calc_end_time = strtotime("+$i month", $end_time); while ($calc_begin_time < $repeat_end) { $toadd[date('Y-m-d H:i:s', $calc_begin_time)] = date('Y-m-d H:i:s', $calc_end_time); $i++; $calc_begin_time = strtotime("+$i month", $begin_time); $calc_end_time = strtotime("+$i month", $end_time); } break; case 'day': $dayofweek = date('l',$begin_time); $i = 1; $calc_begin_time = strtotime("+$i month", $begin_time); $calc_end_time = strtotime("+$i month", $end_time); $begin_hour = $begin_time- strtotime(date('Y-m-d', $begin_time)); $end_hour = $end_time - strtotime(date('Y-m-d', $end_time)); $calc_begin_time = strtotime("next $dayofweek", $calc_begin_time) + $begin_hour; $calc_end_time = strtotime("next $dayofweek", $calc_end_time) + $end_hour; while ($calc_begin_time < $repeat_end) { $toadd[date('Y-m-d H:i:s', $calc_begin_time)] = date('Y-m-d H:i:s', $calc_end_time); $i++; $calc_begin_time = strtotime("+$i month", $begin_time); $calc_end_time = strtotime("+$i month", $end_time); $calc_begin_time = strtotime("next $dayofweek", $calc_begin_time) + $begin_hour; $calc_end_time = strtotime("next $dayofweek", $calc_end_time) + $end_hour; } break; } } break; } } return $toadd; } /** * Display for reservation * * @param $ID ID a the reservation item (empty to show all) * @param $date date to display **/ static function displayReservationDay($ID, $date) { global $DB; if (!empty($ID)) { self::displayReservationsForAnItem($ID, $date); } else { $debut = $date." 00:00:00"; $fin = $date." 23:59:59"; $query = "SELECT DISTINCT `glpi_reservationitems`.`id` FROM `glpi_reservationitems` INNER JOIN `glpi_reservations` ON (`glpi_reservationitems`.`id` = `glpi_reservations`.`reservationitems_id`) WHERE `is_active` = '1' AND '".$debut."' < `end` AND '".$fin."' > `begin` ORDER BY `begin`"; $result = $DB->query($query); if ($DB->numrows($result) > 0) { $m = new ReservationItem(); while ($data = $DB->fetch_assoc($result)) { $m->getFromDB($data['id']); if (!($item = getItemForItemtype($m->fields["itemtype"]))) { continue; } if ($item->getFromDB($m->fields["items_id"]) && Session::haveAccessToEntity($item->fields["entities_id"])) { $typename = $item->getTypeName(); if ($m->fields["itemtype"] == 'Peripheral') { if (isset($item->fields["peripheraltypes_id"]) && ($item->fields["peripheraltypes_id"] != 0)) { $typename = Dropdown::getDropdownName("glpi_peripheraltypes", $item->fields["peripheraltypes_id"]); } } list($annee,$mois,$jour) = explode("-",$date); echo ""; echo "". sprintf(__('%1$s - %2$s'), $typename, $item->getName())."\n"; echo ""; self::displayReservationsForAnItem($data['id'], $date); echo "\n"; } } } } } /** * Display a reservation * * @param $ID ID a the reservation item * @param $date date to display **/ static function displayReservationsForAnItem($ID, $date) { global $DB; $users_id = Session::getLoginUserID(); $resa = new self(); $user = new User; list($year, $month, $day) = explode("-", $date); $debut = $date." 00:00:00"; $fin = $date." 23:59:59"; $query = "SELECT * FROM `glpi_reservations` WHERE '".$debut."' < `end` AND '".$fin."' > `begin` AND `reservationitems_id` = '$ID' ORDER BY `begin`"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { echo ""; while ($row = $DB->fetch_assoc($result)) { echo ""; $user->getFromDB($row["users_id"]); $display = ""; if ($debut > $row['begin']) { $heure_debut = "00:00"; } else { $heure_debut = get_hour_from_sql($row['begin']); } if ($fin < $row['end']) { $heure_fin = "24:00"; } else { $heure_fin = get_hour_from_sql($row['end']); } if ((strcmp($heure_debut,"00:00") == 0) && (strcmp($heure_fin,"24:00") == 0)) { $display = __('Day'); } else if (strcmp($heure_debut,"00:00") == 0) { $display = sprintf(__('To %s'), $heure_fin); } else if (strcmp($heure_fin,"24:00") == 0) { $display = sprintf(__('From %s'), $heure_debut); } else { $display = $heure_debut."-".$heure_fin; } $rand = mt_rand(); $modif = $modif_end = ""; if ($resa->can($row['id'],"w")) { $modif = ""; $modif_end = ""; $modif_end .= Html::showToolTip($row["comment"], array('applyto' => "content_".$ID.$rand, 'display' => false)); } echo "\n"; } echo "
    ". $modif."".$display."
    ". formatUserName($user->fields["id"], $user->fields["name"], $user->fields["realname"], $user->fields["firstname"]); echo "
    "; echo $modif_end; echo "
    \n"; } } } /** * Display reservations for an item * * @param $item CommonDBTM object for which the reservation tab need to be displayed * @param $withtemplate withtemplate param (default '') **/ static function showForItem(CommonDBTM $item, $withtemplate='') { global $DB, $CFG_GLPI; $resaID = 0; if (!Session::haveRight("reservation_central", "r")) { return false; } echo "
    "; ReservationItem::showActivationFormForItem($item); $ri = new ReservationItem(); if ($ri->getFromDBbyItem($item->getType(),$item->getID())) { $now = $_SESSION["glpi_currenttime"]; // Print reservation in progress $query = "SELECT * FROM `glpi_reservations` WHERE `end` > '".$now."' AND `reservationitems_id` = '".$ri->fields['id']."' ORDER BY `begin`"; $result = $DB->query($query); echo "\n"; if ($DB->numrows($result) == 0) { echo ""; echo "\n"; } else { echo ""; echo ""; echo ""; echo "\n"; while ($data =$DB->fetch_assoc($result)) { echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; } } echo "
    "; if ($ri->fields["is_active"]) { echo "".__('Current and future reservations').""; } else { _e('Current and future reservations'); } echo "
    ".__('No reservation')."
    ".__('Start date')."".__('End date')."".__('By')."".__('Comments')." 
    ".Html::convDateTime($data["begin"])."".Html::convDateTime($data["end"]).""; echo "".getUserName($data["users_id"])."".nl2br($data["comment"]).""; list($annee, $mois, $jour) = explode("-", $data["begin"]); echo ""; echo "". ""; echo "
    \n"; // Print old reservations $query = "SELECT * FROM `glpi_reservations` WHERE `end` <= '".$now."' AND `reservationitems_id` = '".$ri->fields['id']."' ORDER BY `begin` DESC"; $result = $DB->query($query); echo "
    \n"; if ($DB->numrows($result) == 0) { echo ""; echo "\n"; } else { echo ""; echo ""; echo ""; echo "\n"; while ($data = $DB->fetch_assoc($result)) { echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; } } echo "
    "; if ($ri->fields["is_active"]) { echo "".__('Past reservations').""; } else { _e('Past reservations'); } echo "
    ".__('No reservation')."
    ".__('Start date')."".__('End date')."".__('By')."".__('Comments')." 
    ".Html::convDateTime($data["begin"])."".Html::convDateTime($data["end"]).""; echo "".getUserName($data["users_id"])."".nl2br($data["comment"]).""; list($annee, $mois ,$jour) = explode("-", $data["begin"]); echo ""; echo ""; echo "
    \n"; } echo "
    \n"; } /** * Display reservations for a user * * @param $ID ID a the user **/ static function showForUser($ID) { global $DB, $CFG_GLPI; $resaID = 0; if (!Session::haveRight("reservation_central", "r")) { return false; } echo "
    "; $now = $_SESSION["glpi_currenttime"]; // Print reservation in progress $query = "SELECT * FROM `glpi_reservations` WHERE `end` > '".$now."' AND `users_id` = '$ID' ORDER BY `begin`"; $result = $DB->query($query); $ri = new ReservationItem(); echo ""; echo "\n"; if ($DB->numrows($result) == 0) { echo ""; echo ""; } else { echo ""; echo ""; echo ""; echo ""; echo "\n"; while ($data = $DB->fetch_assoc($result)) { echo ""; echo ""; echo ""; if ($ri->getFromDB($data["reservationitems_id"])) { $link = " "; if ($item = getItemForItemtype($ri->fields['itemtype'])) { if ($item->getFromDB($ri->fields['items_id'])) { $link = $item->getLink(); } } echo ""; } else { echo ""; } echo ""; echo ""; echo "\n"; } } echo "
    ".__('Current and future reservations')."
    ".__('No reservation')."
    ".__('Start date')."".__('End date')."".__('Item')."".__('By')."".__('Comments')." 
    ".Html::convDateTime($data["begin"])."".Html::convDateTime($data["end"])."$link ".getUserName($data["users_id"])."".nl2br($data["comment"]).""; list($annee, $mois, $jour) = explode("-", $data["begin"]); echo ""; echo "
    \n"; // Print old reservations $query = "SELECT * FROM `glpi_reservations` WHERE `end` <= '".$now."' AND `users_id` = '$ID' ORDER BY `begin` DESC"; $result = $DB->query($query); echo "
    "; echo ""; echo "\n"; if ($DB->numrows($result) == 0) { echo ""; echo "\n"; } else { echo ""; echo ""; echo ""; echo ""; echo "\n"; while ($data = $DB->fetch_assoc($result)) { echo ""; echo ""; echo ""; if ($ri->getFromDB($data["reservationitems_id"])) { $link = " "; if ($item = getItemForItemtype($ri->fields['itemtype'])) { if ($item->getFromDB($ri->fields['items_id'])) { $link = $item->getLink(); } } echo ""; } else { echo ""; } echo ""; echo ""; echo "\n"; } } echo "
    ".__('Past reservations')."
    ".__('No reservation')."
    ".__('Start date')."".__('End date')."".__('Item')."".__('By')."".__('Comments')." 
    ".Html::convDateTime($data["begin"])."".Html::convDateTime($data["end"])."$link ".getUserName($data["users_id"])."".nl2br($data["comment"]).""; list($annee, $mois, $jour) = explode("-", $data["begin"]); echo ""; echo ""; echo "
    \n"; } } ?> glpi-0.84.3+dfsg.1/inc/reservationitem.class.php000066400000000000000000000456511226600447100214420ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Reservation item class class ReservationItem extends CommonDBChild { /// From CommonDBChild static public $itemtype = 'itemtype'; static public $items_id = 'items_id'; static public $checkParentRights = self::HAVE_VIEW_RIGHT_ON_ITEM; static function getTypeName($nb=0) { return _n('Reservable item', 'Reservable items',$nb); } /** * @since 0.84 **/ static function canCreate() { return static::canUpdate(); } /** * @since 0.84 **/ static function canView() { return true; } /** * @since 0.84 **/ static function canUpdate() { return Session::haveRight("reservation_central", "w"); } /** * @since 0.84 **/ static function canDelete() { return static::canUpdate(); } // From CommonDBTM /** * Retrieve an item from the database for a specific item * * @param $itemtype type of the item * @param $ID ID of the item * * @return true if succeed else false **/ function getFromDBbyItem($itemtype, $ID) { return $this->getFromDBByQuery("WHERE `".$this->getTable()."`.`itemtype` = '$itemtype' AND `".$this->getTable()."`.`items_id` = '$ID'"); } function cleanDBonPurge() { $class = new Reservation(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); $class = new Alert(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); } /** * @see CommonDBTM::prepareInputForAdd() **/ function prepareInputForAdd($input) { // TODO : I don't understand ! If the reservationitem is not found, then is_active == 1 ? // We should define $mustBeAttached to false, otherwise, any further update will fail // if the ReservationItem is not attached (ie: getFromDBByItem(...) == false) if (!$this->getFromDBbyItem($input['itemtype'], $input['items_id'])) { if (!isset($input['is_active'])) { $input['is_active'] = 1; } return $input; } return false; } function getSearchOptions() { $tab = array(); $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'comment'; $tab[4]['name'] = __('Comments'); $tab[4]['datatype'] = 'text'; $tab[5]['table'] = $this->getTable(); $tab[5]['field'] = 'is_active'; $tab[5]['name'] = __('Active'); $tab[5]['datatype'] = 'bool'; $tab['common'] = __('Characteristics'); $tab[1]['table'] = 'reservation_types'; $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[1]['addobjectparams'] = array('forcetab' => 'Reservation$1'); $tab[2]['table'] = 'reservation_types'; $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $loc = Location::getSearchOptionsToAdd(); // Force massive actions to false foreach ($loc as $key => $val) { $tab[$key] = $val; $tab[$key]['massiveaction'] = false; } $tab[16]['table'] = 'reservation_types'; $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab[16]['massiveaction'] = false; $tab[70]['table'] = 'glpi_users'; $tab[70]['field'] = 'name'; $tab[70]['name'] = __('User'); $tab[70]['datatype'] = 'dropdown'; $tab[70]['right'] = 'all'; $tab[70]['massiveaction'] = false; $tab[71]['table'] = 'glpi_groups'; $tab[71]['field'] = 'completename'; $tab[71]['name'] = __('Group'); $tab[71]['datatype'] = 'dropdown'; $tab[71]['massiveaction'] = false; $tab[19]['table'] = 'reservation_types'; $tab[19]['field'] = 'date_mod'; $tab[19]['name'] = __('Last update'); $tab[19]['datatype'] = 'datetime'; $tab[19]['massiveaction'] = false; $tab[23]['table'] = 'glpi_manufacturers'; $tab[23]['field'] = 'name'; $tab[23]['name'] = __('Manufacturer'); $tab[23]['datatype'] = 'dropdown'; $tab[23]['massiveaction'] = false; $tab[24]['table'] = 'glpi_users'; $tab[24]['field'] = 'name'; $tab[24]['linkfield'] = 'users_id_tech'; $tab[24]['name'] = __('Technician in charge of the hardware'); $tab[24]['datatype'] = 'dropdown'; $tab[24]['right'] = 'interface'; $tab[24]['massiveaction'] = false; $tab[80]['table'] = 'glpi_entities'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = __('Entity'); $tab[80]['massiveaction'] = false; $tab[80]['datatype'] = 'dropdown'; $tab[80]['massiveaction'] = false; return $tab; } /** * @param $item CommonDBTM object **/ static function showActivationFormForItem(CommonDBTM $item) { if (!Session::haveRight("reservation_central","w")) { return false; } if ($item->getID()) { // Recursive type case => need entity right if ($item->isRecursive()) { if (!Session::haveAccessToEntity($item->fields["entities_id"])) { return false; } } } else { return false; } $ri = new self(); echo "
    "; echo ""; echo ""; echo ""; if ($ri->getFromDBbyItem($item->getType(),$item->getID())) { echo ""; } else { echo ""; } echo "
    ".__('Reserve an item')."
    "; //Switch reservation state if ($ri->fields["is_active"]) { Html::showSimpleForm(static::getFormURL(), 'update', __('Make unavailable'), array('id' => $ri->fields['id'], 'is_active' => 0)); } else { Html::showSimpleForm(static::getFormURL(), 'update', __('Make available'), array('id' => $ri->fields['id'], 'is_active' => 1)); } echo ''; Html::showSimpleForm(static::getFormURL(), 'purge', __('Prohibit reservations'), array('id' => $ri->fields['id']),'','', array(__('Are you sure you want to return this non-reservable item?'), __('That will remove all the reservations in progress.'))); echo ""; Html::showSimpleForm(static::getFormURL(), 'add', __('Authorize reservations'), array('items_id' => $item->getID(), 'itemtype' => $item->getType(), 'entities_id' => $item->getEntityID(), 'is_recursive' => $item->isRecursive(),)); echo "
    "; echo "
    "; } function showForm($ID, $options=array()) { if (!Session::haveRight("reservation_central","w")) { return false; } $r = new self(); if ($r->getFromDB($ID)) { $type = $r->fields["itemtype"]; $name = NOT_AVAILABLE; if ($item = getItemForItemtype($r->fields["itemtype"])) { $type = $item->getTypeName(); if ($item->getFromDB($r->fields["items_id"])) { $name = $item->getName(); } } echo "
    "; echo ""; echo ""; echo ""; // Ajouter le nom du materiel echo ""; echo "\n"; echo ""; echo "\n"; echo "\n"; echo "
    ".__s('Modify the comment')."
    ".__('Item')."".sprintf(__('%1$s - %2$s'), $type, $name)."
    ".__('Comments')."
    "; echo ""; echo "
    "; Html::closeForm(); echo "
    "; return true; } return false; } static function showListSimple() { global $DB, $CFG_GLPI; if (!Session::haveRight("reservation_helpdesk","1")) { return false; } $ri = new self(); $ok = false; $showentity = Session::isMultiEntitiesMode(); // GET method passed to form creation echo "
    "; echo ""; echo "\n"; foreach ($CFG_GLPI["reservation_types"] as $itemtype) { if (!($item = getItemForItemtype($itemtype))) { continue; } $itemtable = getTableForItemType($itemtype); $query = "SELECT `glpi_reservationitems`.`id`, `glpi_reservationitems`.`comment`, `$itemtable`.`name` AS name, `$itemtable`.`entities_id` AS entities_id, `glpi_locations`.`completename` AS location, `glpi_reservationitems`.`items_id` AS items_id FROM `glpi_reservationitems` INNER JOIN `$itemtable` ON (`glpi_reservationitems`.`itemtype` = '$itemtype' AND `glpi_reservationitems`.`items_id` = `$itemtable`.`id`) LEFT JOIN `glpi_locations` ON (`$itemtable`.`locations_id` = `glpi_locations`.`id`) WHERE `glpi_reservationitems`.`is_active` = '1' AND `glpi_reservationitems`.`is_deleted` = '0' AND `$itemtable`.`is_deleted` = '0'". getEntitiesRestrictRequest(" AND", $itemtable, '', $_SESSION['glpiactiveentities'], $item->maybeRecursive())." ORDER BY `$itemtable`.`entities_id`, `$itemtable`.`name`"; if ($result = $DB->query($query)) { while ($row = $DB->fetch_assoc($result)) { echo ""; $typename = $item->getTypeName(); if ($itemtype == 'Peripheral') { $item->getFromDB($row['items_id']); if (isset($item->fields["peripheraltypes_id"]) && ($item->fields["peripheraltypes_id"] != 0)) { $typename = Dropdown::getDropdownName("glpi_peripheraltypes", $item->fields["peripheraltypes_id"]); } } echo ""; echo ""; echo ""; if ($showentity) { echo ""; } echo "\n"; $ok = true; } } } if ($ok) { echo "\n"; } echo "
    ".self::getTypeName(1)."
    "; echo "". "". sprintf(__('%1$s - %2$s'), $typename, $row["name"])."".$row["location"]."".nl2br($row["comment"])."".Dropdown::getDropdownName("glpi_entities", $row["entities_id"]). "
    "; echo "
    \n"; echo ""; echo "";// No CSRF token needed echo "
    \n"; } /** * @param $name * * @return an array **/ static function cronInfo($name) { return array('description' => __('Alerts on reservations')); } /** * Cron action on reservation : alert on end of reservations * * @param $task to log, if NULL use display (default NULL) * * @return 0 : nothing to do 1 : done with success **/ static function cronReservation($task=NULL) { global $DB, $CFG_GLPI; if (!$CFG_GLPI["use_mailing"]) { return 0; } $message = array(); $cron_status = 0; $items_infos = array(); $items_messages = array(); foreach (Entity::getEntitiesToNotify('use_reservations_alert') as $entity => $value) { $secs = $value * HOUR_TIMESTAMP; // Reservation already begin and reservation ended in $value hours $query_end = "SELECT `glpi_reservationitems`.*, `glpi_reservations`.`end` AS `end`, `glpi_reservations`.`id` AS `resaid` FROM `glpi_reservations` LEFT JOIN `glpi_alerts` ON (`glpi_reservations`.`id` = `glpi_alerts`.`items_id` AND `glpi_alerts`.`itemtype` = 'Reservation' AND `glpi_alerts`.`type` = '".Alert::END."') LEFT JOIN `glpi_reservationitems` ON (`glpi_reservations`.`reservationitems_id` = `glpi_reservationitems`.`id`) WHERE `glpi_reservationitems`.`entities_id` = '$entity' AND (UNIX_TIMESTAMP(`glpi_reservations`.`end`) - $secs) < UNIX_TIMESTAMP() AND `glpi_reservations`.`begin` < NOW() AND `glpi_alerts`.`date` IS NULL"; foreach ($DB->request($query_end) as $data) { if ($item_resa = getItemForItemtype($data['itemtype'])) { if ($item_resa->getFromDB($data["items_id"])) { $data['item_name'] = $item_resa->getName(); $data['entity'] = $entity; $items_infos[$entity][$data['resaid']] = $data; if (!isset($items_messages[$entity])) { $items_messages[$entity] = __('Device reservations expiring today')."
    "; } $items_messages[$entity] .= sprintf(__('%1$s - %2$s'), $item_resa->getTypeName(), $item_resa->getName())."
    "; } } } } foreach ($items_infos as $entity => $items) { $resitem = new self(); if (NotificationEvent::raiseEvent("alert", new Reservation(), array('entities_id' => $entity, 'items' => $items))) { $message = $items_messages[$entity]; $cron_status = 1; if ($task) { $task->addVolume(1); $task->log(sprintf(__('%1$s: %2$s')."\n", Dropdown::getDropdownName("glpi_entities", $entity), $message)); } else { //TRANS: %1$s is a name, %2$s is text of message Session::addMessageAfterRedirect(sprintf(__('%1$s: %2$s'), Dropdown::getDropdownName("glpi_entities", $entity), $message)); } $alert = new Alert(); $input["itemtype"] = 'Reservation'; $input["type"] = Alert::END; foreach ($items as $resaid => $item) { $input["items_id"] = $resaid; $alert->add($input); unset($alert->fields['id']); } } else { $entityname = Dropdown::getDropdownName('glpi_entities', $entity); //TRANS: %s is entity name $msg = sprintf(__('%1$s: %2$s'), $entityname, __('Send reservation alert failed')); if ($task) { $task->log($msg); } else { Session::addMessageAfterRedirect($msg, false, ERROR); } } } return $cron_status; } /** * Display debug information for reservation of current object **/ function showDebugResa() { $resa = new Reservation(); $resa->fields['id'] = '1'; $resa->fields['reservationitems_id'] = $this->getField('id'); $resa->fields['begin'] = $_SESSION['glpi_currenttime']; $resa->fields['end'] = $_SESSION['glpi_currenttime']; $resa->fields['users_id'] = Session::getLoginUserID(); $resa->fields['comment'] = ''; NotificationEvent::debugEvent($resa); } } ?>glpi-0.84.3+dfsg.1/inc/rssfeed.class.php000066400000000000000000001157521226600447100176550ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // $feed = new SimplePie(); // $feed->set_cache_location('../files/_rss'); // $feed->set_cache_duration(3600); // $feed->set_feed_url('http://linuxfr.org/news.atom'); // $feed->force_feed(true); // // Initialize the whole SimplePie object. Read the feed, process it, parse it, cache it, and // // all that other good stuff. The feed's information will not be available to SimplePie before // // this is called. // $success = $feed->init(); // // // We'll make sure that the right content type and character encoding gets set automatically. // // This function will grab the proper character encoding, as well as set the content type to text/html. // $feed->handle_content_type(); // if ($feed->error()) // { // echo "ERROR"; // } else { // echo $feed->get_title(); // echo $feed->get_link(); // } /// RSSFeed class /// @since version 0.84 class RSSFeed extends CommonDBTM { // For visibility checks protected $users = array(); protected $groups = array(); protected $profiles = array(); protected $entities = array(); static function getTypeName($nb=0) { return _n('RSS feed', 'RSS feeds', $nb); } static function canCreate() { return (Session::haveRight('rssfeed_public', 'w') || ($_SESSION['glpiactiveprofile']['interface'] != 'helpdesk')); } static function canView() { return (Session::haveRight('rssfeed_public', 'r') || ($_SESSION['glpiactiveprofile']['interface'] != 'helpdesk')); } function canViewItem() { // Is my rssfeed or is in visibility return (($this->fields['users_id'] == Session::getLoginUserID()) || (Session::haveRight('rssfeed_public', 'r') && $this->haveVisibilityAccess())); } function canCreateItem() { // Is my rssfeed return ($this->fields['users_id'] == Session::getLoginUserID()); } function canUpdateItem() { return (($this->fields['users_id'] == Session::getLoginUserID()) || (Session::haveRight('rssfeed_public', 'w') && $this->haveVisibilityAccess())); } function post_getFromDB() { // Users $this->users = RSSFeed_User::getUsers($this->fields['id']); // Entities $this->entities = Entity_RSSFeed::getEntities($this->fields['id']); // Group / entities $this->groups = Group_RSSFeed::getGroups($this->fields['id']); // Profile / entities $this->profiles = Profile_RSSFeed::getProfiles($this->fields['id']); } /** * @see CommonDBTM::cleanDBonPurge() **/ function cleanDBonPurge() { $class = new RSSFeed_User(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); $class = new Entity_RSSFeed(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); $class = new Group_RSSFeed(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); $class = new Profile_RSSFeed(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); } /** * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "deletevisibility" : foreach ($input['item'] as $type => $items) { if (in_array($type, array('Entity_RSSFeed', 'Group_RSSFeed', 'Profile_RSSFeed', 'RSSFeed_User'))) { $item = new $type(); foreach ($items as $key => $val) { if ($item->can($key,'w')) { if ($item->delete(array('id' => $key))) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } } } break; default : return parent::doSpecificMassiveActions($input); } return $res; } function countVisibilities() { return (count($this->entities) + count($this->users) + count($this->groups) + count($this->profiles)); } /** * Is the login user have access to rssfeed based on visibility configuration * * @return boolean **/ function haveVisibilityAccess() { // No public rssfeed right : no visibility check if (!Session::haveRight('rssfeed_public', 'r')) { return false; } // Author if ($this->fields['users_id'] == Session::getLoginUserID()) { return true; } // Users if (isset($this->users[Session::getLoginUserID()])) { return true; } // Groups if (count($this->groups) && isset($_SESSION["glpigroups"]) && count($_SESSION["glpigroups"])) { foreach ($this->groups as $key => $data) { foreach ($data as $group) { if (in_array($group['groups_id'], $_SESSION["glpigroups"])) { // All the group if ($group['entities_id'] < 0) { return true; } // Restrict to entities $entities = array($group['entities_id']); if ($group['is_recursive']) { $entities = getSonsOf('glpi_entities', $group['entities_id']); } if (Session::haveAccessToOneOfEntities($entities, true)) { return true; } } } } } // Entities if (count($this->entities) && isset($_SESSION["glpiactiveentities"]) && count($_SESSION["glpiactiveentities"])) { foreach ($this->entities as $key => $data) { foreach ($data as $entity) { $entities = array($entity['entities_id']); if ($entity['is_recursive']) { $entities = getSonsOf('glpi_entities', $entity['entities_id']); } if (Session::haveAccessToOneOfEntities($entities, true)) { return true; } } } } // Profiles if (count($this->profiles) && isset($_SESSION["glpiactiveprofile"]) && isset($_SESSION["glpiactiveprofile"]['id'])) { if (isset($this->profiles[$_SESSION["glpiactiveprofile"]['id']])) { foreach ($this->profiles[$_SESSION["glpiactiveprofile"]['id']] as $profile) { // All the profile if ($profile['entities_id'] < 0) { return true; } // Restrict to entities $entities = array($profile['entities_id']); if ($profile['is_recursive']) { $entities = getSonsOf('glpi_entities',$profile['entities_id']); } if (Session::haveAccessToOneOfEntities($entities, true)) { return true; } } } } return false; } /** * Return visibility joins to add to SQL * * @param $forceall force all joins (false by default) * * @return string joins to add **/ static function addVisibilityJoins($forceall=false) { if (!Session::haveRight('rssfeed_public', 'r')) { return ''; } // Users $join = " LEFT JOIN `glpi_rssfeeds_users` ON (`glpi_rssfeeds_users`.`rssfeeds_id` = `glpi_rssfeeds`.`id`) "; // Groups if ($forceall || (isset($_SESSION["glpigroups"]) && count($_SESSION["glpigroups"]))) { $join .= " LEFT JOIN `glpi_groups_rssfeeds` ON (`glpi_groups_rssfeeds`.`rssfeeds_id` = `glpi_rssfeeds`.`id`) "; } // Profiles if ($forceall || (isset($_SESSION["glpiactiveprofile"]) && isset($_SESSION["glpiactiveprofile"]['id']))) { $join .= " LEFT JOIN `glpi_profiles_rssfeeds` ON (`glpi_profiles_rssfeeds`.`rssfeeds_id` = `glpi_rssfeeds`.`id`) "; } // Entities if ($forceall || (isset($_SESSION["glpiactiveentities"]) && count($_SESSION["glpiactiveentities"]))) { $join .= " LEFT JOIN `glpi_entities_rssfeeds` ON (`glpi_entities_rssfeeds`.`rssfeeds_id` = `glpi_rssfeeds`.`id`) "; } return $join; } /** * Return visibility SQL restriction to add * * @return string restrict to add **/ static function addVisibilityRestrict() { $restrict = "`glpi_rssfeeds`.`users_id` = '".Session::getLoginUserID()."' "; if (!Session::haveRight('rssfeed_public', 'r')) { return $restrict; } // Users $restrict .= " OR `glpi_rssfeeds_users`.`users_id` = '".Session::getLoginUserID()."' "; // Groups if (isset($_SESSION["glpigroups"]) && count($_SESSION["glpigroups"])) { $restrict .= " OR (`glpi_groups_rssfeeds`.`groups_id` IN ('".implode("','",$_SESSION["glpigroups"])."') AND (`glpi_groups_rssfeeds`.`entities_id` < 0 ".getEntitiesRestrictRequest(" OR", "glpi_groups_rssfeeds", '', '', true).")) "; } // Profiles if (isset($_SESSION["glpiactiveprofile"]) && isset($_SESSION["glpiactiveprofile"]['id'])) { $restrict .= " OR (`glpi_profiles_rssfeeds`.`profiles_id` = '".$_SESSION["glpiactiveprofile"]['id']."' AND (`glpi_profiles_rssfeeds`.`entities_id` < 0 ".getEntitiesRestrictRequest(" OR", "glpi_profiles_rssfeeds", '', '', true).")) "; } // Entities if (isset($_SESSION["glpiactiveentities"]) && count($_SESSION["glpiactiveentities"])) { // Force complete SQL not summary when access to all entities $restrict .= getEntitiesRestrictRequest("OR","glpi_entities_rssfeeds", '', '', true, true); } return '('.$restrict.')'; } /** * @param $field * @param $values * @param $options array **/ static function getSpecificValueToDisplay($field, $values, array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } switch ($field) { case 'refresh_rate': return Html::timestampToString($values[$field], false); } return parent::getSpecificValueToDisplay($field, $values, $options); } /** * @param $field * @param $name (default '') * @param $values (default '') * @param $options array **/ static function getSpecificValueToSelect($field, $name='', $values='', array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'refresh_rate' : return Planning::dropdownState($name, $values[$field], false); } return parent::getSpecificValueToSelect($field, $name, $values, $options); } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[1]['forcegroupby'] = true; $tab[2]['table'] = 'glpi_users'; $tab[2]['field'] = 'name'; $tab[2]['name'] = __('Creator'); $tab[2]['datatype'] = 'dropdown'; $tab[2]['massiveaction'] = false; $tab[2]['right'] = 'all'; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'url'; $tab[3]['name'] = __('URL'); $tab[3]['datatype'] = 'string'; $tab[3]['massiveaction'] = false; $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'is_active'; $tab[4]['name'] = __('Active'); $tab[4]['datatype'] = 'bool'; $tab[4]['massiveaction'] = true; $tab[6]['table'] = $this->getTable(); $tab[6]['field'] = 'have_error'; $tab[6]['name'] = __('Error'); $tab[6]['datatype'] = 'bool'; $tab[6]['massiveaction'] = true; $tab[7]['table'] = $this->getTable(); $tab[7]['field'] = 'max_items'; $tab[7]['name'] = __('Number of items displayed'); $tab[7]['datatype'] = 'number'; $tab[7]['min'] = 5; $tab[7]['max'] = 100; $tab[7]['step'] = 5; $tab[7]['toadd'] = array(1); $tab[7]['massiveaction'] = true; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab[5]['table'] = $this->getTable(); $tab[5]['field'] = 'refresh_rate'; $tab[5]['name'] = __('Refresh rate'); $tab[5]['datatype'] = 'timestamp'; $tab[5]['min'] = HOUR_TIMESTAMP; $tab[5]['max'] = DAY_TIMESTAMP; $tab[5]['step'] = HOUR_TIMESTAMP; $tab[5]['toadd'] = array(5*MINUTE_TIMESTAMP, 15*MINUTE_TIMESTAMP, 30*MINUTE_TIMESTAMP, 45*MINUTE_TIMESTAMP); $tab[5]['display_emptychoice'] = false; $tab[5]['massiveaction'] = true; $tab[5]['searchtype'] = 'equals'; $tab[19]['table'] = $this->getTable(); $tab[19]['field'] = 'date_mod'; $tab[19]['name'] = __('Last update'); $tab[19]['datatype'] = 'datetime'; $tab[19]['massiveaction'] = false; return $tab; } /** * @see CommonGLPI::getTabNameForItem() **/ function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (Session::haveRight("rssfeed_public","r")) { switch ($item->getType()) { case 'RSSFeed' : if ($_SESSION['glpishow_count_on_tabs']) { return array(1 => self::getTypeName(1), 2 => self::createTabEntry(__('Targets'), $item->countVisibilities())); } return array(2 => __('Targets')); } } return ''; } /** * @see CommonGLPI::defineTabs() **/ function defineTabs($options=array()) { $ong = array(); $this->addStandardTab(__CLASS__, $ong, $options); return $ong; } /** * @param $item CommonGLPI object * @param $tabnum (default 1) * @param $withtemplate (default 0) **/ static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($item->getType()) { case 'RSSFeed' : switch ($tabnum) { case 1 : $item->showFeedContent(); return true; case 2 : $item->showVisibility(); return true; } } return false; } /** * @see CommonDBTM::prepareInputForAdd() **/ function prepareInputForAdd($input) { if ($feed = self::getRSSFeed($input['url'])) { $input['have_error'] = 0; $input['name'] = addslashes($feed->get_title()); if (empty($input['comment'])) { $input['comment'] = addslashes($feed->get_description()); } } else { $input['have_error'] = 1; $input['name'] = ''; } $input["name"] = trim($input["name"]); if (empty($input["name"])) { $input["name"] = __('Without title'); } return $input; } /** * @see CommonDBTM::prepareInputForAdd() **/ function prepareInputForUpdate($input) { if (empty($input['name']) && isset($input['url']) && ($feed = self::getRSSFeed($input['url']))) { $input['name'] = addslashes($feed->get_title()); if (empty($input['comment'])) { $input['comment'] = addslashes($feed->get_description()); } } return $input; } function pre_updateInDB() { // Set new user if initial user have been deleted if (($this->fields['users_id'] == 0) && ($uid = Session::getLoginUserID())) { $this->fields['users_id'] = $uid; $this->updates[] = "users_id"; } } function post_getEmpty() { $this->fields["name"] = __('New note'); $this->fields["users_id"] = Session::getLoginUserID(); $this->fields["refresh_rate"] = DAY_TIMESTAMP; $this->fields["max_items"] = 20; } /** * Print the rssfeed form * * @param $ID integer Id of the item to print * @param $options array of possible options: * - target filename : where to go when done. **/ function showForm($ID, $options=array()) { global $CFG_GLPI; // Test _rss cache directory. I permission trouble : unable to edit if (Toolbox::testWriteAccessToDirectory(GLPI_RSS_DIR) > 0) { echo "
    "; echo sprintf(__('Check permissions to the directory: %s'), GLPI_RSS_DIR); echo "

    "; _e('Error'); echo "

    "; echo "
    "; return false; } $this->initForm($ID, $options); $canedit = $this->can($ID,'w'); $this->showTabs($options); $this->showFormHeader($options); $rowspan = 4; if (!$this->isNewID($ID)) { // Force getting feed : $feed = self::getRSSFeed($this->fields['url'], $this->fields['refresh_rate']); if (!$feed || $feed->error()) { $this->setError(true); } else { $this->setError(false); } echo ""; echo "".__('Name').""; echo ""; Html::autocompletionTextField($this, "name", array('entity' => -1, 'user' => $this->fields["users_id"])); echo " \n"; } echo "" . __('URL') . ""; echo ""; echo ""; echo ""; echo ""; echo "".__('By').""; echo ""; echo getUserName($this->fields["users_id"]); echo "\n"; echo ""; echo "".__('Comments').""; echo ""; echo ""; echo "\n"; echo ""; echo "".__('Active').""; echo ""; Dropdown::showYesNo('is_active', $this->fields['is_active']); echo "\n"; echo ""; echo "".__('Refresh rate').""; echo ""; Dropdown::showTimeStamp("refresh_rate", array('value' => $this->fields["refresh_rate"], 'min' => HOUR_TIMESTAMP, 'max' => DAY_TIMESTAMP, 'step' => HOUR_TIMESTAMP, 'toadd' => array(5*MINUTE_TIMESTAMP, 15*MINUTE_TIMESTAMP, 30*MINUTE_TIMESTAMP, 45*MINUTE_TIMESTAMP), 'display_emptychoice' => false)); echo "\n"; echo ""; echo "".__('Number of items displayed').""; echo ""; Dropdown::showNumber("max_items", array('value' => $this->fields["max_items"], 'min' => 5, 'max' => 100, 'step' => 5, 'toadd' => array(1), 'display_emptychoice' => false)); echo "\n"; echo ""; echo "".__('Error retrieving RSS feed').""; echo ""; echo Dropdown::getYesNo($this->fields['have_error']); echo ""; if ($this->fields['have_error']) { echo "".__('RSS feeds found'); echo ""; $this->showDiscoveredFeeds(); echo "\n"; } else { echo " "; } echo ""; $this->showFormButtons($options); $this->addDivForTabs(); return true; } /** * Set error field * * @param $error (false by default **/ function setError($error=false) { if (!isset($this->fields['id']) && !isset($this->fields['have_error'])) { return; } // Set error if not set if ($error && !$this->fields['have_error']) { $this->update(array('id' => $this->fields['id'], 'have_error' => 1)); } // Unset error if set if (!$error && $this->fields['have_error']) { $this->update(array('id' => $this->fields['id'], 'have_error' => 0)); } } /** * Show the feed content **/ function showFeedContent() { if (!$this->canViewItem()) { return false; } $feed = self::getRSSFeed($this->fields['url'], $this->fields['refresh_rate']); echo "
    "; if (!$feed || $feed->error()) { _e('Error retrieving RSS feed'); $this->setError(true); } else { $this->setError(false); echo ""; echo ""; foreach ($feed->get_items(0,$this->fields['max_items']) as $item) { $link = $item->get_permalink(); echo ""; } echo "
    ".$feed->get_title()."
    "; echo HTML::convDateTime($item->get_date('Y-m-d H:i:s')); echo ""; if (!is_null($link)) { echo "".$item->get_title().''; } else { $item->get_title(); } echo ""; $rand = mt_rand(); echo ""; echo Html::resume_text(Html::clean(Toolbox::unclean_cross_side_scripting_deep($item->get_content())), 1000); echo ""; Html::showToolTip(Toolbox::unclean_html_cross_side_scripting_deep($item->get_content()), array('applyto' => "rssitem$rand", 'display' => true)); echo "
    "; } echo "
    "; } /** * Show discovered feeds * * @return nothin **/ function showDiscoveredFeeds() { $feed = new SimplePie(); $feed->set_cache_location(GLPI_RSS_DIR); $feed->enable_cache(false); $feed->set_feed_url($this->fields['url']); $feed->init(); $feed->handle_content_type(); if ($feed->error()) { return false; } foreach ($feed->get_all_discovered_feeds() as $f) { $newurl = $f->url; $newfeed = self::getRSSFeed($newurl); if ($newfeed && !$newfeed->error()) { $link = $newfeed->get_permalink(); if (!empty($link)) { echo "".$newfeed->get_title()." "; Html::showSimpleForm($this->getFormURL(),'update', _x('button', 'Use'), array('id' => $this->getID(), 'url' => $newurl)); echo "
    "; } } } } /** * Get a specific RSS feed * * @param $url string/array URL of the feed or array of URL * @param $cache_duration timestamp cache duration (default DAY_TIMESTAMP) * * @return feed object **/ static function getRSSFeed($url, $cache_duration=DAY_TIMESTAMP) { $feed = new SimplePie(); $feed->set_cache_location(GLPI_RSS_DIR); $feed->set_cache_duration($cache_duration); $feed->enable_cache(true); $feed->set_feed_url($url); $feed->force_feed(true); // Initialize the whole SimplePie object. Read the feed, process it, parse it, cache it, and // all that other good stuff. The feed's information will not be available to SimplePie before // this is called. $feed->init(); // We'll make sure that the right content type and character encoding gets set automatically. // This function will grab the proper character encoding, as well as set the content type to text/html. $feed->handle_content_type(); if ($feed->error()) { return false; } return $feed; } /** * Show list for central view * * @param $personal boolean display rssfeeds created by me ? (true by default) * * @return Nothing (display function) **/ static function showListForCentral($personal=true) { global $DB, $CFG_GLPI; $users_id = Session::getLoginUserID(); $today = date('Y-m-d'); $now = date('Y-m-d H:i:s'); if ($personal) { /// Personal notes only for central view if ($_SESSION['glpiactiveprofile']['interface'] == 'helpdesk') { return false; } $query = "SELECT `glpi_rssfeeds`.* FROM `glpi_rssfeeds` WHERE `glpi_rssfeeds`.`users_id` = '$users_id' AND `glpi_rssfeeds`.`is_active` = '1' ORDER BY `glpi_rssfeeds`.`name`"; $titre = "". _n('Personal RSS feed', 'Personal RSS feeds', 2).""; } else { // Show public rssfeeds / not mines : need to have access to public rssfeeds if (!Session::haveRight('rssfeed_public', 'r')) { return false; } $restrict_user = '1'; // Only personal on central so do not keep it if ($_SESSION['glpiactiveprofile']['interface'] == 'central') { $restrict_user = "`glpi_rssfeeds`.`users_id` <> '$users_id'"; } $query = "SELECT `glpi_rssfeeds`.* FROM `glpi_rssfeeds` ". self::addVisibilityJoins()." WHERE $restrict_user AND ".self::addVisibilityRestrict()." ORDER BY `glpi_rssfeeds`.`name`"; if ($_SESSION['glpiactiveprofile']['interface'] != 'helpdesk') { $titre = "". _n('Public RSS feed', 'Public RSS feeds', 2).""; } else { $titre = _n('Public RSS feed', 'Public RSS feeds', 2); } } $result = $DB->query($query); $items = array(); $rssfeed = new self(); if ($nb = $DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { if ($rssfeed->getFromDB($data['id'])) { // Force fetching feeds if ($feed = self::getRSSFeed($data['url'], $data['refresh_rate'])) { // Store feeds in array of feeds $items = array_merge($items, $feed->get_items(0, $data['max_items'])); $rssfeed->setError(false); } else { $rssfeed->setError(true); } } } } echo "
    "; echo "\n"; if ($nb) { usort($items, array('SimplePie', 'sort_items')); foreach ($items as $item) { echo ""; } } echo "
    $titre"; if (self::canCreate()) { echo ""; echo ""; echo "".__s("; } echo "
    "; echo HTML::convDateTime($item->get_date('Y-m-d H:i:s')); echo ""; $link = $item->feed->get_permalink(); if (empty($link)) { echo $item->feed->get_title(); } else { echo "".$item->feed->get_title().''; } $link = $item->get_permalink(); // echo "
    "; // echo $item->get_title(); // echo "
    "; $rand = mt_rand(); echo ""; Html::showToolTip(Toolbox::unclean_html_cross_side_scripting_deep($item->get_content()), array('applyto' => "rssitem$rand", 'display' => true)); echo "
    \n"; } /** * Show visibility config for a rssfeed **/ function showVisibility() { global $DB, $CFG_GLPI; $ID = $this->fields['id']; $canedit = $this->can($ID,'w'); echo "
    "; $rand = mt_rand(); $nb = count($this->users) + count($this->groups) + count($this->profiles) + count($this->entities); if ($canedit) { echo "
    "; echo "
    "; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
    ".__('Add a target')."
    "; $types = array('Entity', 'Group', 'Profile', 'User'); $addrand = Dropdown::showItemTypes('_type', $types); $params = array('type' => '__VALUE__', 'right' => 'rssfeed_public'); Ajax::updateItemOnSelectEvent("dropdown__type".$addrand,"visibility$rand", $CFG_GLPI["root_doc"]."/ajax/visibility.php", $params); echo ""; echo "
    "; Html::closeForm(); echo "
    "; } echo "
    "; if ($canedit && $nb) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $paramsma = array('num_displayed' => $nb, 'specific_actions' => array('deletevisibility' => _x('button', 'Delete permanently'))); if ($this->fields['users_id'] != Session::getLoginUserID()) { $paramsma['confirm'] = __('Caution! You are not the author of this element. Delete targets can result in loss of access to that element.'); } Html::showMassiveActions(__CLASS__, $paramsma); } echo ""; echo ""; if ($canedit && $nb) { echo ""; } echo ""; echo ""; echo ""; // Users if (count($this->users)) { foreach ($this->users as $key => $val) { foreach ($val as $data) { echo ""; if ($canedit) { echo ""; } echo ""; echo ""; echo ""; } } } // Groups if (count($this->groups)) { foreach ($this->groups as $key => $val) { foreach ($val as $data) { echo ""; if ($canedit) { echo ""; } echo ""; $names = Dropdown::getDropdownName('glpi_groups', $data['groups_id'],1); $entname = sprintf(__('%1$s %2$s'), $names["name"], Html::showToolTip($names["comment"], array('display' => false))); if ($data['entities_id'] >= 0) { $entname .= sprintf(__('%1$s / %2$s'), $entname, Dropdown::getDropdownName('glpi_entities', $data['entities_id'])); if ($data['is_recursive']) { //TRANS: R for Recursive $entname .= sprintf(__('%1$s %2$s'), $entname, "(".__('R').")"); } } echo ""; echo ""; } } } // Entity if (count($this->entities)) { foreach ($this->entities as $key => $val) { foreach ($val as $data) { echo ""; if ($canedit) { echo ""; } echo ""; $names = Dropdown::getDropdownName('glpi_entities', $data['entities_id'],1); $tooltip = Html::showToolTip($names["comment"], array('display' => false)); $entname = sprintf(__('%1$s %2$s'), $names["name"], $tooltip); if ($data['is_recursive']) { $entname .= sprintf(__('%1$s %2$s'), $entname, "(".__('R').")"); } echo ""; echo ""; } } } // Profiles if (count($this->profiles)) { foreach ($this->profiles as $key => $val) { foreach ($val as $data) { echo ""; if ($canedit) { echo ""; } echo ""; $names = Dropdown::getDropdownName('glpi_profiles',$data['profiles_id'],1); $tooltip = Html::showToolTip($names["comment"], array('display' => false)); $entname = sprintf(__('%1$s %2$s'), $names["name"], $entname); if ($data['entities_id'] >= 0) { $entname .= sprintf(__('%1$s / %2$s'), $entname, Dropdown::getDropdownName('glpi_entities', $data['entities_id'])); if ($data['is_recursive']) { $entname .= sprintf(__('%1$s %2$s'), $entname, "(".__('R').")"); } } echo ""; echo ""; } } } echo "
    "; echo Html::checkAllAsCheckbox('mass'.__CLASS__.$rand); echo "".__('Type').""._n('Recipient', 'Recipients', 2)."
    "; echo ""; echo "".__('User')."".getUserName($data['users_id'])."
    "; echo ""; echo "".__('Group')."".$entname."
    "; echo ""; echo "".__('Entity')."".$entname."
    "; echo ""; echo ""._n('Profile', 'Profiles', 1)."".$entname."
    "; if ($canedit && $nb) { $paramsma['ontop'] = false; Html::showMassiveActions(__CLASS__, $paramsma); Html::closeForm(); } echo "
    "; // Add items return true; } } ?> glpi-0.84.3+dfsg.1/inc/rssfeed_user.class.php000066400000000000000000000042071226600447100207030ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class RSSFeed_User /// @since version 0.84 class RSSFeed_User extends CommonDBRelation { // From CommonDBRelation static public $itemtype_1 = 'RSSFeed'; static public $items_id_1 = 'rssfeeds_id'; static public $itemtype_2 = 'User'; static public $items_id_2 = 'users_id'; static public $checkItem_2_Rights = self::DONT_CHECK_ITEM_RIGHTS; static public $logs_for_item_2 = false; /** * Get users for a rssfeed * * @param $rssfeeds_id ID of the rssfeed * * @return array of users linked to a rssfeed **/ static function getUsers($rssfeeds_id) { global $DB; $users = array(); $query = "SELECT `glpi_rssfeeds_users`.* FROM `glpi_rssfeeds_users` WHERE `rssfeeds_id` = '$rssfeeds_id'"; foreach ($DB->request($query) as $data) { $users[$data['users_id']][] = $data; } return $users; } } ?> glpi-0.84.3+dfsg.1/inc/rule.class.php000066400000000000000000002340721226600447100171660ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Rule class store all information about a GLPI rule : * - description * - criterias * - actions **/ class Rule extends CommonDBTM { public $dohistory = true; // Specific ones ///Actions affected to this rule var $actions = array(); ///Criterias affected to this rule var $criterias = array(); /// Right needed to use this rule static public $right = 'config'; /// Rules can be sorted ? var $can_sort = false; /// field used to order rules var $orderby = 'ranking'; /// restrict matching to self::AND_MATCHING or self::OR_MATCHING : specify value to activate var $restrict_matching = false; protected $rules_id_field = 'rules_id'; protected $ruleactionclass = 'RuleAction'; protected $rulecriteriaclass = 'RuleCriteria'; var $specific_parameters = false; var $regex_results = array(); var $criterias_results = array(); const RULE_NOT_IN_CACHE = -1; const RULE_WILDCARD = '*'; //Generic rules engine const PATTERN_IS = 0; const PATTERN_IS_NOT = 1; const PATTERN_CONTAIN = 2; const PATTERN_NOT_CONTAIN = 3; const PATTERN_BEGIN = 4; const PATTERN_END = 5; const REGEX_MATCH = 6; const REGEX_NOT_MATCH = 7; const PATTERN_EXISTS = 8; const PATTERN_DOES_NOT_EXISTS = 9; const PATTERN_FIND = 10; // Global criteria const PATTERN_UNDER = 11; const PATTERN_NOT_UNDER = 12; const PATTERN_IS_EMPTY = 30; // Global criteria const AND_MATCHING = "AND"; const OR_MATCHING = "OR"; // Temproray hack for this class static function getTable() { return 'glpi_rules'; } static function getTypeName($nb=0) { return _n('Rule', 'Rules', $nb); } /** * Get correct Rule object for specific rule * @param $rules_id ID of the rule **/ static function getRuleObjectByID($rules_id) { $rule = new self(); if ($rule->getFromDB($rules_id)) { $realrule = new $rule->fields['sub_type'](); return $realrule; } return null; } /** * @since versin 0.84 **/ function getRuleActionClass () { return $this->ruleactionclass; } /** * @since versin 0.84 **/ function getRuleCriteriaClass () { return $this->rulecriteriaclass; } /** * @since versin 0.84 **/ function getRuleIdField () { return $this->rules_id_field; } static function canCreate() { return Session::haveRight(static::$right, 'w'); } static function canView() { return Session::haveRight(static::$right, 'r'); } function isEntityAssign() { return false; } function post_getEmpty() { $this->fields['is_active'] = 0; } /** * Get title used in rule * * @return Title of the rule **/ function getTitle() { return __('Rules management'); } /** * @since version 0.84 * * @return string **/ function getCollectionClassName() { return $this->getType().'Collection'; } /** * @see CommonDBTM::getSpecificMassiveActions() **/ function getSpecificMassiveActions($checkitem=NULL) { $isadmin = static::canUpdate(); $actions = parent::getSpecificMassiveActions($checkitem); $collectiontype = $this->getCollectionClassName(); if ($collection = getItemForItemtype($collectiontype)) { if ($isadmin && ($collection->orderby == "ranking")) { $actions['move_rule'] = __('Move'); } } return $actions; } /** * @see CommonDBTM::showSpecificMassiveActionsParameters() **/ function showSpecificMassiveActionsParameters($input=array()) { switch ($input['action']) { case "move_rule" : echo " "; if (isset($input['entity_restrict'])) { $condition = $input['entity_restrict']; } else { $condition = ""; } Rule::dropdown(array('sub_type' => $input['itemtype'], 'name' => "ranking", 'entity_restrict' => $condition)); echo "

    \n"; return true; default : return parent::showSpecificMassiveActionsParameters($input); } return false; } /** * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "move_rule" : $collectionname = $input['itemtype'].'Collection'; $rulecollection = new $collectionname(); if ($rulecollection->canUpdate()) { foreach ($input["item"] as $key => $val) { if ($this->getFromDB($key)) { if ($rulecollection->moveRule($key, $input['ranking'], $input['move_type'])) { $res['ok']++; } else { $res['ko']++; } } else { $res['ko']++; } } } else { $res['noright']++; } break; default : return parent::doSpecificMassiveActions($input); } return $res; } function getSearchOptions() { $tab = array(); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'ranking'; $tab[3]['name'] = __('Position'); $tab[3]['datatype'] = 'number'; $tab[3]['massiveaction'] = false; $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'description'; $tab[4]['name'] = __('Description'); $tab[4]['datatype'] = 'text'; $tab[5]['table'] = $this->getTable(); $tab[5]['field'] = 'match'; $tab[5]['name'] = __('Logical operator'); $tab[5]['datatype'] = 'specific'; $tab[5]['massiveaction'] = false; $tab[8]['table'] = $this->getTable(); $tab[8]['field'] = 'is_active'; $tab[8]['name'] = __('Active'); $tab[8]['datatype'] = 'bool'; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab[80]['table'] = 'glpi_entities'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = __('Entity'); $tab[80]['massiveaction'] = false; $tab[80]['datatype'] = 'dropdown'; $tab[86]['table'] = $this->getTable(); $tab[86]['field'] = 'is_recursive'; $tab[86]['name'] = __('Child entities'); $tab[86]['datatype'] = 'bool'; $tab[86]['massiveaction'] = false; return $tab; } /** * @param $field * @param $values * @param $options array * * @return string **/ static function getSpecificValueToDisplay($field, $values, array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } switch ($field) { case 'match' : switch ($values[$field]) { case self::AND_MATCHING : return __('and'); case self::OR_MATCHING : return __('or'); default : return NOT_AVAILABLE; } break; } return parent::getSpecificValueToDisplay($field, $values, $options); } /** * @param $field * @param $name (default '') * @param $values (default '') * @param $options array **/ static function getSpecificValueToSelect($field, $name='', $values='', array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'match' : if (isset($values['itemtype']) && !empty($values['itemtype'])) { $options['value'] = $values[$field]; $options['name'] = $name; $rule = new static(); return $rule->dropdownRulesMatch($options); } break; } return parent::getSpecificValueToSelect($field, $name, $values, $options); } /** * Show the rule * * @param $ID ID of the rule * @param $options array of possible options: * - target filename : where to go when done. * - withtemplate boolean : template or basic item * * @return nothing **/ function showForm($ID, $options=array()) { global $CFG_GLPI; if (!$this->isNewID($ID)) { $this->check($ID, 'r'); } else { // Create item $this->checkGlobal('w'); } $canedit = $this->can(static::$right, "w"); $this->showTabs($options); $this->showFormHeader($options); echo ""; echo "".__('Name').""; echo ""; Html::autocompletionTextField($this, "name"); echo ""; echo "".__('Description').""; echo ""; Html::autocompletionTextField($this, "description"); echo "\n"; echo ""; echo "".__('Logical operator').""; echo ""; $this->dropdownRulesMatch(array('value' => $this->fields["match"])); echo ""; echo "".__('Active').""; echo ""; Dropdown::showYesNo("is_active", $this->fields["is_active"]); echo"\n"; echo ""; echo "".__('Comments').""; echo ""; echo ""; if (!$this->isNewID($ID)) { if ($this->fields["date_mod"]) { echo "
    "; printf(__('Last update on %s'), Html::convDateTime($this->fields["date_mod"])); } } echo"\n"; if ($canedit) { echo ""; echo ""; if ($ID > 0) { if ($plugin = isPluginItemType($this->getType())) { $url = $CFG_GLPI["root_doc"]."/plugins/".strtolower($plugin['plugin']); } else { $url = $CFG_GLPI["root_doc"]; } echo ""; echo "getType(). "&rules_id=".$this->fields["id"]."' ,'glpipopup', 'height=400,". "width=1000, top=100, left=100, scrollbars=yes' );w.focus();\">". __('Test').""; echo "\n"; } } $this->showFormButtons($options); $this->addDivForTabs(); return true; } /** * Display a dropdown with all the rule matching * * @since version 0.84 new proto * * @param $options array of parameters **/ function dropdownRulesMatch($options=array()) { $p['name'] = 'match'; $p['value'] = ''; $p['restrict'] = $this->restrict_matching; $p['display'] = true; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } if (!$p['restrict'] || ($p['restrict'] == self::AND_MATCHING)) { $elements[self::AND_MATCHING] = __('and'); } if (!$p['restrict'] || ($p['restrict'] == self::OR_MATCHING)) { $elements[self::OR_MATCHING] = __('or'); } return Dropdown::showFromArray($p['name'], $elements, $p); } /** * Get all criterias for a given rule * * @param $ID the rule_description ID * @param $withcriterias 1 to retrieve all the criterias for a given rule (default 0) * @param $withactions 1 to retrive all the actions for a given rule (default 0) **/ function getRuleWithCriteriasAndActions($ID, $withcriterias=0, $withactions=0) { if ($ID == "") { return $this->getEmpty(); } if ($ret = $this->getFromDB($ID)) { if ($withactions && ($RuleAction = getItemForItemtype($this->ruleactionclass))) { $this->actions = $RuleAction->getRuleActions($ID); } if ($withcriterias && ($RuleCriterias = getItemForItemtype($this->rulecriteriaclass))) { $this->criterias = $RuleCriterias->getRuleCriterias($ID); } return true; } return false; } /** * display title for action form **/ function getTitleAction() { foreach ($this->getActions() as $key => $val) { if (isset($val['force_actions']) && (in_array('regex_result', $val['force_actions']) || in_array('append_regex_result', $val['force_actions']))) { echo ""; echo "\n"; echo "
    ". __('It is possible to affect the result of a regular expression using the string #0'). "

    "; return; } } } /** * Get maximum number of Actions of the Rule (0 = unlimited) * * @return the maximum number of actions **/ function maxActionsCount() { // Unlimited return 0; } /** * Display all rules actions * * @param $rules_id rule ID * @param $options array of options : may be readonly **/ function showActionsList($rules_id, $options=array()) { $rand = mt_rand(); $p['readonly'] = false; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } $canedit = $this->can($rules_id, "w"); $style = "class='tab_cadre_fixe'"; if ($p['readonly']) { $canedit = false; $style = "class='tab_cadre'"; } $this->getTitleAction(); if ($canedit && (($this->maxActionsCount() == 0) || (sizeof($this->actions) < $this->maxActionsCount()))) { echo "\n"; $this->addActionForm($rules_id); Html::closeForm(); } $nb = count($this->actions); echo "
    "; if ($canedit && $nb) { Html::openMassiveActionsForm('mass'.$this->ruleactionclass.$rand); $paramsma = array('num_displayed' => $nb, 'check_itemtype' => get_class($this), 'check_items_id' => $rules_id); Html::showMassiveActions($this->ruleactionclass, $paramsma); } echo ""; echo ""; echo ""; echo ""; if ($canedit && $nb) { echo ""; } echo ""; echo ""; echo ""; echo "\n"; foreach ($this->actions as $action) { $this->showMinimalActionForm($action->fields, $canedit); } echo "
    " . _n('Action','Actions',2) . "
    ".Html::getCheckAllAsCheckbox('mass'.$this->ruleactionclass.$rand).""._n('Field', 'Fields', 2)."".__('Action type')."".__('Value')."
    \n"; if ($canedit && $nb) { $paramsma['ontop'] =false; Html::showMassiveActions($this->ruleactionclass, $paramsma); Html::closeForm(); } echo "
    "; } /** * Display the add action form * * @param $rules_id rule ID **/ function addActionForm($rules_id) { // CFG_GLPI needed by ruleaction.php global $CFG_GLPI; if ($ra = getItemForItemtype($this->ruleactionclass)) { echo "
    "; echo ""; echo ""; echo ""; echo "\n"; echo "\n"; echo "
    " . _n('Action', 'Actions', 1) . "
    "._n('Action', 'Actions', 1) . ""; $rand = $this->dropdownActions(array('used' => $ra->getAlreadyUsedForRuleID($rules_id, $this->getType()))); $params = array('field' => '__VALUE__', 'sub_type' => $this->getType(), $this->rules_id_field => $rules_id); Ajax::updateItemOnSelectEvent("dropdown_field$rand", "action_span", $CFG_GLPI["root_doc"]."/ajax/ruleaction.php", $params); echo "\n"; echo ""; echo ""; echo ""; echo "
    "; } } /** * Display the add criteria form * * @param $rules_id rule ID **/ function addCriteriaForm($rules_id) { // CFG_GLPI needed by rulecriteria.php global $CFG_GLPI; echo "
    "; echo ""; echo ""; echo ""; echo "\n"; echo "\n"; echo "
    " . _n('Criterion', 'Criteria', 1) . "
    "._n('Criterion', 'Criteria', 1) . ""; $rand = $this->dropdownCriteria(); $params = array('criteria' => '__VALUE__', 'rand' => $rand, 'sub_type' => $this->getType()); Ajax::updateItemOnSelectEvent("dropdown_criteria$rand", "criteria_span", $CFG_GLPI["root_doc"]."/ajax/rulecriteria.php", $params); if ($this->specific_parameters) { $itemtype = get_class($this).'Parameter'; echo ""; } echo "\n"; /* $_POST["sub_type"] = $this->getType(); $_POST["criteria"] = $val; include (GLPI_ROOT."/ajax/rulecriteria.php");*/ echo ""; echo ""; echo ""; echo "
    "; } function maybeRecursive() { return false; } /** * Display all rules criterias * * @param $rules_id * @param $options array of options : may be readonly **/ function showCriteriasList($rules_id, $options=array()) { $rand = mt_rand(); $p['readonly'] = false; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } $canedit = $this->can($rules_id, "w"); $style = "class='tab_cadre_fixe'"; if ($p['readonly']) { $canedit = false; $style = "class='tab_cadre'"; } if ($canedit) { echo "\n"; $this->addCriteriaForm($rules_id); Html::closeForm(); } echo "
    "; $nb = sizeof($this->criterias); if ($canedit && $nb) { Html::openMassiveActionsForm('mass'.$this->rulecriteriaclass.$rand); $paramsma = array('num_displayed' => $nb, 'check_itemtype' => get_class($this), 'check_items_id' => $rules_id); Html::showMassiveActions($this->rulecriteriaclass, $paramsma); } echo ""; echo "\n"; echo ""; if ($canedit && $nb) { echo ""; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; foreach ($this->criterias as $criteria) { $this->showMinimalCriteriaForm($criteria->fields, $canedit); } echo "
    ". _n('Criterion', 'Criteria', 2). "
    ".Html::getCheckAllAsCheckbox('mass'.$this->rulecriteriaclass.$rand).""._n('Criterion', 'Criteria', 1)."".__('Condition')."".__('Reason')."
    \n"; if ($canedit && $nb) { $paramsma['ontop'] = false; Html::showMassiveActions($this->rulecriteriaclass, $paramsma); Html::closeForm(); } echo "
    \n"; } /** * Display the dropdown of the criterias for the rule * * @since version 0.84 new proto * * @param $options array of options : may be readonly * * @return the initial value (first) **/ function dropdownCriteria($options=array()) { global $CFG_GLPI; $p['name'] = 'criteria'; $p['display'] = true; $p['value'] = ''; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } $items = array('' => Dropdown::EMPTY_VALUE); $group = array(); $groupname = _n('Criterion', 'Criteria', 2); foreach ($this->getAllCriteria() as $ID => $crit) { // Manage group system if (!is_array($crit)) { if (count($group)) { asort($group); $items[$groupname] = $group; } $group = array(); $groupname = $crit; } else { $group[$ID] = $crit['name']; } } if (count($group)) { asort($group); $items[$groupname] = $group; } return Dropdown::showFromArray($p['name'], $items, $p); } /** * Display the dropdown of the actions for the rule * * @param $options already used actions * * @return the initial value (first non used) **/ function dropdownActions($options=array()) { global $CFG_GLPI; $p['name'] = 'field'; $p['display'] = true; $p['used'] = array(); $p['value'] = ''; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } $actions = $this->getAllActions(); // For each used actions see if several set is available // Force actions to available actions for several foreach ($p['used'] as $key => $ID) { if (isset($actions[$ID]['permitseveral'])) { unset($p['used'][$key]); } } // Complete used array with duplicate items // add duplicates of used items foreach ($p['used'] as $ID) { if (isset($actions[$ID]['duplicatewith'])) { $p['used'][$actions[$ID]['duplicatewith']] = $actions[$ID]['duplicatewith']; } } // Parse for duplicates of already used items foreach ($actions as $ID => $act) { if (isset($actions[$ID]['duplicatewith']) && in_array($actions[$ID]['duplicatewith'], $p['used'])) { $p['used'][$ID] = $ID; } } $items = array('' => Dropdown::EMPTY_VALUE); $value = ''; foreach ($actions as $ID => $act) { $items[$ID] = $act['name']; if (empty($value) && !isset($used[$ID])) { $value = $ID; } } asort($items); return Dropdown::showFromArray($p['name'], $items, $p); } /** * Get a criteria description by his ID * * @param $ID the criteria's ID * * @return the criteria array **/ function getCriteria($ID) { $criterias = $this->getAllCriteria(); if (isset($criterias[$ID])) { return $criterias[$ID]; } return array(); } /** * Get a action description by his ID * * @param $ID the action's ID * * @return the action array **/ function getAction($ID) { $actions = $this->getAllActions(); if (isset($actions[$ID])) { return $actions[$ID]; } return array(); } /** * Get a criteria description by his ID * * @param $ID the criteria's ID * * @return the criteria's description **/ function getCriteriaName($ID) { $criteria = $this->getCriteria($ID); if (isset($criteria['name'])) { return $criteria['name']; } return __('Unavailable')." "; } /** * Get a action description by his ID * * @param $ID the action's ID * * @return the action's description **/ function getActionName($ID) { $action = $this->getAction($ID); if (isset($action['name'])) { return $action['name']; } return " "; } /** * Process the rule * * @param &$input the input data used to check criterias * @param &$output the initial ouput array used to be manipulate by actions * @param &$params parameters for all internal functions * * @return the output array updated by actions. * If rule matched add field _rule_process to return value **/ function process(&$input, &$output, &$params) { if (count($this->criterias)) { $this->regex_results = array(); $this->criterias_results = array(); $input = $this->prepareInputDataForProcess($input, $params); if ($this->checkCriterias($input)) { unset($output["_no_rule_matches"]); $output = $this->executeActions($output, $params); //Hook $hook_params["sub_type"] = $this->getType(); $hook_params["ruleid"] = $this->fields["id"]; $hook_params["input"] = $input; $hook_params["output"] = $output; Plugin::doHook("rule_matched", $hook_params); $output["_rule_process"] = true; } } } /** * Check criterias * * @param $input the input data used to check criterias * * @return boolean if criterias match **/ function checkCriterias($input) { reset($this->criterias); if ($this->fields["match"] == self::AND_MATCHING) { $doactions = true; foreach ($this->criterias as $criteria) { $definition_criteria = $this->getCriteria($criteria->fields['criteria']); if (!isset($definition_criteria['is_global']) || !$definition_criteria['is_global']) { $doactions &= $this->checkCriteria($criteria, $input); if (!$doactions) { break; } } } } else { // OR MATCHING $doactions = false; foreach ($this->criterias as $criteria) { $definition_criteria = $this->getCriteria($criteria->fields['criteria']); if (!isset($definition_criteria['is_global']) || !$definition_criteria['is_global']) { $doactions |= $this->checkCriteria($criteria,$input); if ($doactions) { break; } } } } //If all simple criteria match, and if necessary, check complex criteria if ($doactions) { return $this->findWithGlobalCriteria($input); } return false; } /** * Check criterias * * @param $input the input data used to check criterias * @param &$check_results * * @return boolean if criterias match **/ function testCriterias($input, &$check_results) { reset($this->criterias); foreach ($this->criterias as $criteria) { $result = $this->checkCriteria($criteria,$input); $check_results[$criteria->fields["id"]]["name"] = $criteria->fields["criteria"]; $check_results[$criteria->fields["id"]]["value"] = $criteria->fields["pattern"]; $check_results[$criteria->fields["id"]]["result"] = ((!$result)?0:1); $check_results[$criteria->fields["id"]]["id"] = $criteria->fields["id"]; } } /** * Process a criteria of a rule * * @param &$criteria criteria to check * @param &$input the input data used to check criterias **/ function checkCriteria(&$criteria, &$input) { $partial_regex_result = array(); // Undefine criteria field : set to blank if (!isset($input[$criteria->fields["criteria"]])) { $input[$criteria->fields["criteria"]] = ''; } //If the value is not an array if (!is_array($input[$criteria->fields["criteria"]])) { $value = $this->getCriteriaValue($criteria->fields["criteria"], $criteria->fields["condition"], $input[$criteria->fields["criteria"]]); $res = RuleCriteria::match($criteria, $value, $this->criterias_results, $partial_regex_result); } else { //If the value if, in fact, an array of values // Negative condition : Need to match all condition (never be) if (in_array($criteria->fields["condition"], array(self::PATTERN_IS_NOT, self::PATTERN_NOT_CONTAIN, self::REGEX_NOT_MATCH, self::PATTERN_DOES_NOT_EXISTS))) { $res = true; foreach ($input[$criteria->fields["criteria"]] as $tmp) { $value = $this->getCriteriaValue($criteria->fields["criteria"], $criteria->fields["condition"], $tmp); $res &= RuleCriteria::match($criteria, $value, $this->criterias_results, $partial_regex_result); if (!$res) { break; } } // Positive condition : Need to match one } else { $res = false; foreach ($input[$criteria->fields["criteria"]] as $crit) { $value = $this->getCriteriaValue($criteria->fields["criteria"], $criteria->fields["condition"], $crit); $res |= RuleCriteria::match($criteria, $value, $this->criterias_results, $partial_regex_result); } } } // Found regex on this criteria if (count($partial_regex_result)) { // No regex existing : put found if (!count($this->regex_results)) { $this->regex_results = $partial_regex_result; } else { // Already existing regex : append found values $temp_result = array(); foreach ($partial_regex_result as $new) { foreach ($this->regex_results as $old) { $temp_result[] = array_merge($old,$new); } } $this->regex_results = $temp_result; } } return $res; } /** * @param $input **/ function findWithGlobalCriteria($input) { return true; } /** * Specific prepare input datas for the rule * * @param $input the input data used to check criterias * @param $params parameters * * @return the updated input datas **/ function prepareInputDataForProcess($input, $params) { return $input; } /** * Get all data needed to process rules (core + plugins) * * @since 0.84 * @param $input the input data used to check criterias * @param $params parameters * * @return the updated input datas **/ function prepareAllInputDataForProcess($input, $params) { global $PLUGIN_HOOKS; $input = $this->prepareInputDataForProcess($input, $params); if (isset($PLUGIN_HOOKS['use_rules'])) { foreach ($PLUGIN_HOOKS['use_rules'] as $plugin => $val) { if (is_array($val) && in_array($this->getType(), $val)) { $results = Plugin::doOneHook($plugin, "rulePrepareInputDataForProcess", array('input' => $input, 'params' => $params)); if (is_array($results)) { foreach ($results as $result) { $input[] = $result; } } } } } return $input; } /** * * Execute plugins actions if needed * * @since 0.84 * * @param $action * @param $output rule execution output * @param $params parameters * * @return output parameters array updated */ function executePluginsActions($action, $output, $params) { global $PLUGIN_HOOKS; if (isset($PLUGIN_HOOKS['use_rules'])) { $params['criterias_results'] = $this->criterias_results; $params['rule_itemtype'] = $this->getType(); foreach ($PLUGIN_HOOKS['use_rules'] as $plugin => $val) { if (is_array($val) && in_array($this->getType(), $val)) { $results = Plugin::doOneHook($plugin, "executeActions", array('output' => $output, 'params' => $params, 'action' => $action)); if (is_array($results)) { foreach ($results as $id => $result) { $output[$id] = $result; } } } } } return $output; } /** * Execute the actions as defined in the rule * * @param $output the fields to manipulate * @param $params parameters * * @return the $output array modified **/ function executeActions($output, $params) { if (count($this->actions)) { foreach ($this->actions as $action) { switch ($action->fields["action_type"]) { case "assign" : $output[$action->fields["field"]] = $action->fields["value"]; break; case "append" : $actions = $this->getActions(); $value = $action->fields["value"]; if (isset($actions[$action->fields["field"]]["appendtoarray"]) && isset($actions[$action->fields["field"]]["appendtoarrayfield"])) { $value = $actions[$action->fields["field"]]["appendtoarray"]; $value[$actions[$action->fields["field"]]["appendtoarrayfield"]] = $action->fields["value"]; } $output[$actions[$action->fields["field"]]["appendto"]][] = $value; break; case "regex_result" : case "append_regex_result" : //Regex result : assign value from the regex //Append regex result : append result from a regex if ($action->fields["action_type"] == "append_regex_result") { $res = (isset($params[$action->fields["field"]]) ?$params[$action->fields["field"]]:""); } else { $res = ""; } if (isset($this->regex_results[0])) { $res .= RuleAction::getRegexResultById($action->fields["value"], $this->regex_results[0]); } else { $res .= $action->fields["value"]; } $output[$action->fields["field"]] = $res; break; default: //plugins actions $executeaction = clone $this; $ouput = $executeaction->executePluginsActions($action, $output, $params); break; } } } return $output; } function cleanDBonPurge() { global $DB; // Delete a rule and all associated criterias and actions if (!empty($this->ruleactionclass)) { $sql = "DELETE FROM `".getTableForItemType($this->ruleactionclass)."` WHERE `".$this->rules_id_field."` = '".$this->fields['id']."'"; $DB->query($sql); } if (!empty($this->rulecriteriaclass)) { $sql = "DELETE FROM `".getTableForItemType($this->rulecriteriaclass)."` WHERE `".$this->rules_id_field."` = '".$this->fields['id']."'"; $DB->query($sql); } } /** * Show the minimal form for the rule * * @param $target link to the form page * @param $first is it the first rule ?(false by default) * @param $last is it the last rule ? (false by default) * @param $display_entities display entities / make it read only display (false by default) **/ function showMinimalForm($target, $first=false, $last=false, $display_entities=false) { global $CFG_GLPI; $canedit = Session::haveRight(static::$right, "w") && !$display_entities; echo ""; if ($canedit) { echo ""; Html::showMassiveActionCheckBox(__CLASS__, $this->fields["id"]); echo ""; } else { echo " "; } $link = $this->getLink(); if (!empty($this->fields["comment"])) { $link = sprintf(__('%1$s %2$s'), $link, Html::showToolTip($this->fields["comment"], array('display' => false))); } echo "".$link.""; echo "".$this->fields["description"].""; echo "".Dropdown::getYesNo($this->fields["is_active"]).""; if ($display_entities) { $entname = Dropdown::getDropdownName('glpi_entities', $this->fields['entities_id']); if ($this->maybeRecursive() && $this->fields['is_recursive']) { $entname = sprintf(__('%1$s %2$s'), $entname, "(".__('R').")"); } echo "".$entname.""; } if (!$display_entities) { if ($this->can_sort && !$first && $canedit) { echo ""; Html::showSimpleForm($target, array('action' => 'up'), '', array('type' => $this->fields["sub_type"], 'id' => $this->fields["id"]), $CFG_GLPI["root_doc"]."/pics/deplier_up.png"); echo ""; } else { echo " "; } } if (!$display_entities) { if ($this->can_sort && !$last && $canedit) { echo ""; Html::showSimpleForm($target, array('action' => 'down'), '', array('type' => $this->fields["sub_type"], 'id' => $this->fields["id"]), $CFG_GLPI["root_doc"]."/pics/deplier_down.png"); echo ""; } else { echo " "; } } echo "\n"; } /** * @see CommonDBTM::prepareInputForAdd() **/ function prepareInputForAdd($input) { // Before adding, add the ranking of the new rule $input["ranking"] = $this->getNextRanking(); return $input; } /** * Get the next ranking for a specified rule **/ function getNextRanking() { global $DB; $sql = "SELECT MAX(`ranking`) AS rank FROM `glpi_rules` WHERE `sub_type` = '".$this->getType()."'"; $result = $DB->query($sql); if ($DB->numrows($result) > 0) { $datas = $DB->fetch_assoc($result); return $datas["rank"] + 1; } return 0; } /** * Show the minimal form for the action rule * * @param $fields datas used to display the action * @param $canedit can edit the actions rule ? **/ function showMinimalActionForm($fields, $canedit) { echo ""; if ($canedit) { echo ""; Html::showMassiveActionCheckBox($this->ruleactionclass, $fields["id"]); echo ""; } echo $this->getMinimalActionText($fields); echo "\n"; } /** * Show preview result of a rule * * @param $target where to go if action * @param $input input data array * @param $params params used (see addSpecificParamsForPreview) **/ function showRulePreviewResultsForm($target, $input, $params) { $actions = $this->getAllActions(); $check_results = array(); $output = array(); //Test all criterias, without stopping at the first good one $this->testCriterias($input, $check_results); //Process the rule $this->process($input, $output, $params); if (!$criteria = getItemForItemtype($this->rulecriteriaclass)) { return; } echo "
    "; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; foreach ($check_results as $ID => $criteria_result) { echo ""; $criteria->getFromDB($criteria_result["id"]); echo $this->getMinimalCriteriaText($criteria->fields); if ($criteria->fields['condition'] != self::PATTERN_FIND) { echo "\n"; } else { echo "\n"; } } echo "
    " . __('Result details') . "
    "._n('Criterion', 'Criteria', 1)."".__('Condition')."".__('Reason')."".__('Validation')."
    ".Dropdown::getYesNo($criteria_result["result"])."
    ".Dropdown::EMPTY_VALUE."
    "; $global_result = (isset($output["_rule_process"])?1:0); echo "
    "; echo ""; echo ""; echo ""; echo ""; $output = $this->preProcessPreviewResults($output); foreach ($output as $criteria => $value) { if (isset($actions[$criteria])) { echo ""; echo ""; if (isset($actions[$criteria]['type'])) { $actiontype = $actions[$criteria]['type']; } else { $actiontype =''; } echo "\n"; } } //If a regular expression was used, and matched, display the results if (count($this->regex_results)) { echo ""; echo ""; echo "\n"; } echo "\n"; echo "
    " . __('Rule results') . "
    ".__('Validation').""; echo Dropdown::getYesNo($global_result)."
    ".$actions[$criteria]["name"]."".$this->getActionValue($criteria, $actiontype, $value); echo "
    ".__('Result of the regular expression').""; if (!empty($this->regex_results[0])) { echo ""; echo ""; foreach ($this->regex_results[0] as $key => $value) { echo ""; echo ""; } echo "
    ".__('Key')."".__('Value')."
    $key$value
    "; } echo "
    "; } /** * Show the minimal form for the criteria rule * * @param $fields datas used to display the criteria * @param $canedit can edit the criterias rule ? **/ function showMinimalCriteriaForm($fields, $canedit) { echo ""; if ($canedit) { echo ""; Html::showMassiveActionCheckBox($this->rulecriteriaclass, $fields["id"]); echo ""; } echo $this->getMinimalCriteriaText($fields); echo "\n"; } /** * @param $fields **/ function getMinimalCriteriaText($fields) { $text = "" . $this->getCriteriaName($fields["criteria"]) . ""; $text .= "" . RuleCriteria::getConditionByID($fields["condition"], get_class($this), $fields["criteria"]).""; $text .= "" . $this->getCriteriaDisplayPattern($fields["criteria"], $fields["condition"], $fields["pattern"]) . ""; return $text; } /** * @param $fields **/ function getMinimalActionText($fields) { $text = "" . $this->getActionName($fields["field"]) . ""; $text .= "" . RuleAction::getActionByID($fields["action_type"]) . ""; $text .= "" . $this->getActionValue($fields["field"], $fields['action_type'], $fields["value"]) . ""; return $text; } /** * Return a value associated with a pattern associated to a criteria to display it * * @param $ID the given criteria * @param $condition condition used * @param $pattern the pattern **/ function getCriteriaDisplayPattern($ID, $condition, $pattern) { if (($condition == self::PATTERN_EXISTS) || ($condition == self::PATTERN_DOES_NOT_EXISTS) || ($condition == self::PATTERN_FIND)) { return __('Yes'); } else if (in_array($condition, array(self::PATTERN_IS, self::PATTERN_IS_NOT, self::PATTERN_NOT_UNDER, self::PATTERN_UNDER))) { $crit = $this->getCriteria($ID); if (isset($crit['type'])) { switch ($crit['type']) { case "yesonly" : case "yesno" : return Dropdown::getYesNo($pattern); case "dropdown" : $addentity = Dropdown::getDropdownName($crit["table"], $pattern); if ($this->isEntityAssign()) { $itemtype = getItemTypeForTable($crit["table"]); $item = getItemForItemtype($itemtype); if ($item && $item->getFromDB($pattern) && $item->isEntityAssign()) { $addentity = sprintf(__('%1$s (%2$s)'), $addentity, Dropdown::getDropdownName('glpi_entities', $item->getEntityID())); } } $tmp = $addentity; return (($tmp == ' ') ? NOT_AVAILABLE : $tmp); case "dropdown_users" : return getUserName($pattern); case "dropdown_tracking_itemtype" : if ($item = getItemForItemtype($pattern)) { return $item->getTypeName(1); } if (empty($pattern)) { return __('General'); } break; case "dropdown_status" : return Ticket::getStatus($pattern); case "dropdown_priority" : return Ticket::getPriorityName($pattern); case "dropdown_urgency" : return Ticket::getUrgencyName($pattern); case "dropdown_impact" : return Ticket::getImpactName($pattern); case "dropdown_tickettype" : return Ticket::getTicketTypeName($pattern); } } } if ($result = $this->getAdditionalCriteriaDisplayPattern($ID, $condition, $pattern)) { return $result; } return $pattern; } /** * Used to get specific criteria patterns * * @param $ID the given criteria * @param $condition condition used * @param $pattern the pattern * * @return a value associated with the criteria, or false otherwise **/ function getAdditionalCriteriaDisplayPattern($ID, $condition, $pattern) { return false; } /** * Display item used to select a pattern for a criteria * * @param $name criteria name * @param $ID the given criteria * @param $condition condition used * @param $value the pattern (default '') * @param $test Is to test rule ? (false by default) **/ function displayCriteriaSelectPattern($name, $ID, $condition, $value="", $test=false) { $crit = $this->getCriteria($ID); $display = false; $tested = false; if (isset($crit['type']) && ($test || in_array($condition, array(self::PATTERN_IS, self::PATTERN_IS_NOT, self::PATTERN_NOT_UNDER, self::PATTERN_UNDER)))) { switch ($crit['type']) { case "yesonly" : Dropdown::showYesNo($name, $crit['table'], 0); $display = true; break; case "yesno" : Dropdown::showYesNo($name, $crit['table']); $display = true; break; case "dropdown" : $param = array('name' => $name, 'value' => $value); if (isset($crit['condition'])) { $param['condition'] = $crit['condition']; } Dropdown::show(getItemTypeForTable($crit['table']), $param); $display = true; break; case "dropdown_users" : User::dropdown(array('value' => $value, 'name' => $name, 'right' => 'all')); $display = true; break; case "dropdown_tracking_itemtype" : Dropdown::showItemTypes($name, array_keys(Ticket::getAllTypesForHelpdesk())); $display = true; break; case "dropdown_urgency" : Ticket::dropdownUrgency(array('name' => $name, 'value' => $value)); $display = true; break; case "dropdown_impact" : Ticket::dropdownImpact(array('name' => $name, 'value' => $value)); $display = true; break; case "dropdown_priority" : Ticket::dropdownPriority(array('name' => $name, 'value' => $value)); $display = true; break; case "dropdown_status" : Ticket::dropdownStatus(array('name' => $name, 'value' => $value)); $display = true; break; case "dropdown_tickettype" : Ticket::dropdownType($name, array('value' => $value)); $display = true; break; } $tested = true; } //Not a standard condition if (!$tested) { $display = $this->displayAdditionalRuleCondition($condition, $crit, $name, $value, $test); } if (($condition == self::PATTERN_EXISTS) || ($condition == self::PATTERN_DOES_NOT_EXISTS)) { echo ""; $display = true; } if (!$display && ($rc = getItemForItemtype($this->rulecriteriaclass))) { Html::autocompletionTextField($rc, "pattern", array('name' => $name, 'value' => $value, 'size' => 70)); } } /** * Return a "display" value associated with a pattern associated to a criteria * * @param $ID the given action * @param $type the type of action * @param $value the value **/ function getActionValue($ID, $type, $value) { $action = $this->getAction($ID); if (isset($action['type'])) { switch ($action['type']) { case "dropdown" : if ($type=='fromuser' || $type=='fromitem') { return Dropdown::getYesNo($value); } // $type == assign $tmp = Dropdown::getDropdownName($action["table"], $value); return (($tmp == ' ') ? NOT_AVAILABLE : $tmp); case "dropdown_status" : return Ticket::getStatus($value); case "dropdown_assign" : case "dropdown_users" : case "dropdown_users_validate" : return getUserName($value); case "yesonly" : case "yesno" : return Dropdown::getYesNo($value); case "dropdown_urgency" : return Ticket::getUrgencyName($value); case "dropdown_impact" : return Ticket::getImpactName($value); case "dropdown_priority" : return Ticket::getPriorityName($value); case "dropdown_tickettype" : return Ticket::getTicketTypeName($value); case "dropdown_management" : return Dropdown::getGlobalSwitch($value); default : return $this->displayAdditionRuleActionValue($value); } } return $value; } /** * Return a value associated with a pattern associated to a criteria to display it * * @param $ID the given criteria * @param $condition condition used * @param $value the pattern **/ function getCriteriaValue($ID, $condition, $value) { if (!in_array($condition, array(self::PATTERN_DOES_NOT_EXISTS, self::PATTERN_EXISTS, self::PATTERN_IS, self::PATTERN_IS_NOT, self::PATTERN_NOT_UNDER, self::PATTERN_UNDER))) { $crit = $this->getCriteria($ID); if (isset($crit['type'])) { switch ($crit['type']) { case "dropdown" : $tmp = Dropdown::getDropdownName($crit["table"], $value); // return empty string to be able to check if set if ($tmp == ' ') { return ''; } return $tmp; case "dropdown_assign" : case "dropdown_users" : return getUserName($value); case "yesonly" : case "yesno" : return Dropdown::getYesNo($value); case "dropdown_impact" : return Ticket::getImpactName($value); case "dropdown_urgency" : return Ticket::getUrgencyName($value); case "dropdown_priority" : return Ticket::getPriorityName($value); } } } return $value; } /** * Function used to display type specific criterias during rule's preview * * @param $fields fields values **/ function showSpecificCriteriasForPreview($fields) { } /** * Function used to add specific params before rule processing * * @param $params parameters **/ function addSpecificParamsForPreview($params) { return $params; } /** * Criteria form used to preview rule * * @param $target target of the form * @param $rules_id ID of the rule **/ function showRulePreviewCriteriasForm($target, $rules_id) { global $DB; $criterias = $this->getAllCriteria(); if ($this->getRuleWithCriteriasAndActions($rules_id, 1, 0)) { echo "\n"; echo "
    "; echo ""; echo ""; $type_match = (($this->fields["match"] == self::AND_MATCHING) ?__('and') :__('or')); $already_displayed = array(); $first = true; //Brower all criterias foreach ($this->criterias as $criteria) { //Look for the criteria in the field of already displayed criteria : //if present, don't display it again if (!in_array($criteria->fields["criteria"],$already_displayed)) { $already_displayed[] = $criteria->fields["criteria"]; echo ""; echo ""; $criteria_constants = $criterias[$criteria->fields["criteria"]]; echo ""; echo "\n"; } } $this->showSpecificCriteriasForPreview($_POST); echo "\n"; echo "
    " . _n('Criterion', 'Criteria', 2) . "
    "; if ($first) { echo " "; $first = false; } else { echo $type_match; } echo "".$criteria_constants["name"].""; $value = ""; if (isset($_POST[$criteria->fields["criteria"]])) { $value = $_POST[$criteria->fields["criteria"]]; } $this->displayCriteriaSelectPattern($criteria->fields['criteria'], $criteria->fields['criteria'], $criteria->fields['condition'], $value, true); echo "
    "; echo ""; echo ""; echo ""; echo "
    \n"; Html::closeForm(); } } /** * @param $output **/ function preProcessPreviewResults($output) { global $PLUGIN_HOOKS; if (isset($PLUGIN_HOOKS['use_rules'])) { $params['criterias_results'] = $this->criterias_results; $params['rule_itemtype'] = $this->getType(); foreach ($PLUGIN_HOOKS['use_rules'] as $plugin => $val) { if (is_array($val) && in_array($this->getType(), $val)) { $results = Plugin::doOneHook($plugin, "preProcessRulePreviewResults", array('output' => $output, 'params' => $params)); if (is_array($results)) { foreach ($results as $id => $result) { $output[$id] = $result; } } } } } return $output; } /** * Dropdown rules for a defined sub_type of rule * * @param $options array of possible options: * - name : string / name of the select (default is depending itemtype) * - sub_type : integer / sub_type of rule **/ static function dropdown($options=array()) { global $DB, $CFG_GLPI; $p['sub_type'] = ''; $p['name'] = 'rules_id'; $p['entity_restrict'] = ''; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } if ($p['sub_type'] == '') { return false; } $rand = mt_rand(); $limit_length = $_SESSION["glpidropdown_chars_limit"]; $use_ajax = false; if ($CFG_GLPI["use_ajax"]) { $nb = countElementsInTable("glpi_rules", "`sub_type`='".$p['sub_type']."'"); if ($nb > $CFG_GLPI["ajax_limit_count"]) { $use_ajax = true; } } $params = array('searchText' => '__VALUE__', 'myname' => $p['name'], 'limit' => $limit_length, 'rand' => $rand, 'type' => $p['sub_type'], 'entity_restrict' => $p['entity_restrict']); $default = ""; Ajax::dropdown($use_ajax, "/ajax/dropdownRules.php", $params, $default, $rand); return $rand; } /** * @since version 0.84 **/ function getAllCriteria() { return self::doHookAndMergeResults("getRuleCriteria", $this->getCriterias(), $this->getType()); } function getCriterias() { return array(); } /** * @since version 0.84 */ function getAllActions() { return self::doHookAndMergeResults("getRuleActions", $this->getActions(), $this->getType()); } function getActions() { return array(); } /** * Execute a hook if necessary and merge results * * @since version 0.84 * * @param $hook the hook to execute * @param $params array input parameters * @param $itemtype (default '') * * @return input parameters merged with hook parameters **/ static function doHookAndMergeResults($hook, $params=array(), $itemtype='') { global $PLUGIN_HOOKS; if (empty($itemtype)) { $itemtype = static::getType(); } //Agregate all plugins criteria for this rules engine $toreturn = $params; if (isset($PLUGIN_HOOKS['use_rules'])) { foreach ($PLUGIN_HOOKS['use_rules'] as $plugin => $val) { if (is_array($val) && in_array($itemtype, $val)) { $results = Plugin::doOneHook($plugin, $hook, array('rule_itemtype' => $itemtype, 'values' => $params)); if (is_array($results)) { foreach ($results as $id => $result) { $toreturn[$id] = $result; } } } } } return $toreturn; } /** * @param $sub_type **/ static function getActionsByType($sub_type) { if ($rule = getItemForItemtype($sub_type)) { return $rule->getAllActions(); } return array(); } /** * Return all rules from database * * @param $crit array of criteria (at least, 'field' and 'value') * * @return array of Rule objects **/ function getRulesForCriteria($crit) { global $DB; $rules = array(); /// TODO : not working for SLALevels : no sub_type //Get all the rules whose sub_type is $sub_type and entity is $ID $query = "SELECT `".$this->getTable()."`.`id` FROM `".getTableForItemType($this->ruleactionclass)."`, `".$this->getTable()."` WHERE `".getTableForItemType($this->ruleactionclass)."`.".$this->rules_id_field." = `".$this->getTable()."`.`id` AND `".$this->getTable()."`.`sub_type` = '".get_class($this)."'"; foreach ($crit as $field => $value) { $query .= " AND `".getTableForItemType($this->ruleactionclass)."`.`$field` = '$value'"; } foreach ($DB->request($query) as $rule) { $affect_rule = new Rule(); $affect_rule->getRuleWithCriteriasAndActions($rule["id"], 0, 1); $rules[] = $affect_rule; } return $rules; } /** * @param $ID **/ function showNewRuleForm($ID) { echo ""; echo ""; echo "\n"; echo ""; echo "\n"; echo "
    " . $this->getTitle() . "
    ".__('Name') . ""; Html::autocompletionTextField($this, "name", array('value' => '', 'size' => 33)); echo "".__('Description') . ""; Html::autocompletionTextField($this, "description", array('value' => '', 'size' => 33)); echo "".__('Logical operator') . ""; $this->dropdownRulesMatch(); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
    "; Html::closeForm(); } /** * @param $item **/ function showAndAddRuleForm($item) { $rand = mt_rand(); $canedit = Session::haveRight(static::$right, "w"); if ($canedit && ($item->getType() == 'Entity')) { $this->showNewRuleForm($item->getField('id')); } //Get all rules and actions $crit = array('field' => getForeignKeyFieldForTable($item->getTable()), 'value' => $item->getField('id')); $rules = $this->getRulesForCriteria($crit); $nb = count($rules); echo "
    "; if (!$nb) { echo ""; echo ""; echo "\n"; echo "
    " . __('No item found') . "
    \n"; } else { if ($canedit) { Html::openMassiveActionsForm('mass'.get_called_class().$rand); $paramsma = array('num_displayed' => $nb, 'specific_actions' => array('update' => _x('button', 'Update'), 'purge' => _x('button', 'Delete permanently'))); Html::showMassiveActions(get_called_class(), $paramsma); } echo ""; if ($canedit) { echo ""; } echo ""; echo ""; echo ""; echo "\n"; Session::initNavigateListItems(get_class($this), //TRANS: %1$s is the itemtype name, // %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), $item->getTypeName(1), $item->getName())); foreach ($rules as $rule) { Session::addToNavigateListItems(get_class($this), $rule->fields["id"]); echo ""; if ($canedit) { echo ""; echo ""; } else { echo ""; } echo ""; echo ""; echo "\n"; } echo "
    "; Html::checkAllAsCheckbox('mass'.get_called_class().$rand); echo "" . $this->getTitle() . "" . __('Description') . "" . __('Active') . "
    "; Html::showMassiveActionCheckBox(__CLASS__, $rule->fields["id"]); echo "" .$rule->fields["name"] ."" . $rule->fields["name"] . "" . $rule->fields["description"] . "" . Dropdown::getYesNo($rule->fields["is_active"]) . "
    \n"; if ($canedit) { $paramsma['ontop'] = false; Html::showMassiveActions(get_called_class(), $paramsma); Html::closeForm(); } } echo "
    "; } /** * @see CommonGLPI::defineTabs() **/ function defineTabs($options=array()) { $ong = array(); $this->addStandardTab(__CLASS__, $ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } /** * Add more criteria specific to this type of rule **/ static function addMoreCriteria() { return array(); } /** * Add more actions specific to this type of rule * * @param $value **/ function displayAdditionRuleActionValue($value) { return $value; } /** * @param $condition * @param $criteria * @param $name * @param $value * @param $test (false by default) **/ function displayAdditionalRuleCondition($condition, $criteria, $name, $value, $test=false) { return false; } /** * @param $action array **/ function displayAdditionalRuleAction(array $action) { return false; } /** * Clean Rule with Action or Criteria linked to an item * * @param $item Object * @param $field string name (default is FK to item) * @param $ruleitem object (instance of Rules of SlaLevel) * @param $table string (glpi_ruleactions, glpi_rulescriterias or glpi_slalevelcriterias) * @param $valfield string (value or pattern) * @param $fieldfield string (criteria of field) **/ private static function cleanForItemActionOrCriteria($item, $field, $ruleitem, $table, $valfield, $fieldfield) { global $DB; $fieldid = getForeignKeyFieldForTable($ruleitem->getTable()); if (empty($field)) { $field = getForeignKeyFieldForTable($item->getTable()); } if (isset($item->input['_replace_by']) && ($item->input['_replace_by'] > 0)) { $query = "UPDATE `$table` SET `$valfield` = '".$item->input['_replace_by']."' WHERE `$valfield` = '".$item->getField('id')."' AND `$fieldfield` LIKE '$field'"; $DB->query($query); } else { $query = "SELECT `$fieldid` FROM `$table` WHERE `$valfield` = '".$item->getField('id')."' AND `$fieldfield` LIKE '$field'"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { $input['is_active'] = 0; while ($data = $DB->fetch_assoc($result)) { $input['id'] = $data[$fieldid]; $ruleitem->update($input); } Session::addMessageAfterRedirect(__('Rules using the object have been disabled.'), true); } } } } /** * Clean Rule with Action is assign to an item * * @param $item Object * @param $field string name (default is FK to item) (default '') **/ static function cleanForItemAction($item, $field='') { self::cleanForItemActionOrCriteria($item, $field, new self(), 'glpi_ruleactions', 'value', 'field'); self::cleanForItemActionOrCriteria($item, $field, new SlaLevel(), 'glpi_slalevelactions', 'value', 'field'); } /** * Clean Rule with Criteria on an item * * @param $item Object * @param $field string name (default is FK to item) (default '') **/ static function cleanForItemCriteria($item, $field='') { self::cleanForItemActionOrCriteria($item, $field, new self(), 'glpi_rulecriterias', 'pattern', 'criteria'); } /** * @see CommonGLPI::getTabNameForItem() **/ function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { switch ($item->getType()) { case 'Entity' : if ($_SESSION['glpishow_count_on_tabs']) { $types = array(); $collection = new RuleRightCollection(); if ($collection->canList()) { $types[] = 'RuleRight'; } $collection = new RuleImportEntityCollection(); if ($collection->canList()) { $types[] = 'RuleImportEntity'; } $collection = new RuleMailCollectorCollection(); if ($collection->canList()) { $types[] = 'RuleMailCollector'; } $nb = 0; if (count($types)) { $nb = countElementsInTable(array('glpi_rules', 'glpi_ruleactions'), "`glpi_ruleactions`.`rules_id` = `glpi_rules`.`id` AND `glpi_rules`.`sub_type` IN ('".implode("','",$types)."') AND `glpi_ruleactions`.`field` = 'entities_id' AND `glpi_ruleactions`.`value` = '".$item->getID()."'"); } return self::createTabEntry(self::getTypeName(2), 2); } return $this->getTypeName(2); case 'SLA' : if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(self::getTypeName(2), countElementsInTable('glpi_ruleactions', "`field` = 'slas_id' AND `value` = '".$item->getID()."'")); } return $this->getTypeName(2); default : if ($item instanceof Rule) { return sprintf(__('%1$s / %2$s'), _n('Criterion', 'Criteria', 2), _n('Action', 'Actions', 2)); } } } return ''; } /** * @param $item CommonGLPI object * @param $tabnum (default 1) * @param $withtemplate (default 0) **/ static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType() == 'Entity') { $collection = new RuleRightCollection(); if ($collection->canList()) { $ldaprule = new RuleRight(); $ldaprule->showAndAddRuleForm($item); } $collection = new RuleImportEntityCollection(); if ($collection->canList()) { $importrule = new RuleImportEntity(); $importrule->showAndAddRuleForm($item); } $collection = new RuleMailCollectorCollection(); if ($collection->canList()) { $mailcollector = new RuleMailCollector(); $mailcollector->showAndAddRuleForm($item); } } else if ($item->getType() == 'SLA') { $rule = new RuleTicket(); $rule->showAndAddRuleForm($item); // } else if ($item->getType() == 'SlaLevel') { // $rule = new RuleTicket(); // $item->getRuleWithCriteriasAndActions($item->getID(), 0, 1); // $item->showActionsList($item->getID()); } else if ($item instanceof Rule) { $item->getRuleWithCriteriasAndActions($item->getID(), 1, 1); $item->showCriteriasList($item->getID()); $item->showActionsList($item->getID()); } return true; } } ?> glpi-0.84.3+dfsg.1/inc/ruleaction.class.php000066400000000000000000000411011226600447100203510ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class RuleAction extends CommonDBChild { // From CommonDBChild static public $items_id = 'rules_id'; public $dohistory = true; /** * @since version 0.84 **/ function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } /** * @param $rule_type **/ function __construct($rule_type='Rule') { static::$itemtype = $rule_type; } function post_getFromDB() { // Get correct itemtype if defult one is used if (static::$itemtype == 'Rule') { $rule = new Rule(); if ($rule->getFromDB($this->fields['rules_id'])) { static::$itemtype = $rule->fields['sub_type']; } } } /** * Get title used in rule * * @param $nb integer (default 0) * * @return Title of the rule **/ static function getTypeName($nb=0) { return _n('Action', 'Actions', $nb); } /** * @see CommonDBTM::getName() **/ function getName($options=array()) { if ($rule = getItemForItemtype(static::$itemtype)) { return Html::clean($rule->getMinimalActionText($this->fields)); } return NOT_AVAILABLE; } /** * @since version 0.84 **/ function prepareInputForAdd($input) { if (!isset($input['field']) || empty($input['field'])) { return false; } return parent::prepareInputForAdd($input); } function post_addItem() { parent::post_addItem(); if (isset($this->input['rules_id']) && $realrule = Rule::getRuleObjectByID($this->input['rules_id'])) { $realrule->update(array('id' => $this->input['rules_id'], 'date_mod' => $_SESSION['glpi_currenttime'])); } } function post_purgeItem() { parent::post_purgeItem(); if (isset($this->fields['rules_id']) && $realrule = Rule::getRuleObjectByID($this->fields['rules_id'])) { $realrule->update(array('id' => $this->fields['rules_id'], 'date_mod' => $_SESSION['glpi_currenttime'])); } } function getSearchOptions() { $tab = array(); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'action_type'; $tab[1]['name'] = self::getTypeName(1); $tab[1]['massiveaction'] = false; $tab[1]['datatype'] = 'specific'; $tab[1]['additionalfields'] = array('rules_id'); $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'field'; $tab[2]['name'] = _n('Field', 'Fields', 2); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'specific'; $tab[2]['additionalfields'] = array('rules_id'); $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'value'; $tab[3]['name'] = __('Value'); $tab[3]['massiveaction'] = false; $tab[3]['datatype'] = 'specific'; $tab[3]['additionalfields'] = array('rules_id'); return $tab; } /** * @since version 0.84 * * @param $field * @param $values * @param $options array **/ static function getSpecificValueToDisplay($field, $values, array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } switch ($field) { case 'field' : $generic_rule = new Rule; if (isset($values['rules_id']) && !empty($values['rules_id']) && $generic_rule->getFromDB($values['rules_id'])) { if ($rule = getItemForItemtype($generic_rule->fields["sub_type"])) { return $rule->getAction($values[$field]); } } break; case 'action_type' : return self::getActionByID($values[$field]); case 'value' : if (!isset($values["field"]) || !isset($values["action_type"])) { return NOT_AVAILABLE; } $generic_rule = new Rule; if (isset($values['rules_id']) && !empty($values['rules_id']) && $generic_rule->getFromDB($values['rules_id'])) { if ($rule = getItemForItemtype($generic_rule->fields["sub_type"])) { return $rule->getCriteriaDisplayPattern($values["criteria"], $values["condition"], $values[$field]); } } break; } return parent::getSpecificValueToDisplay($field, $values, $options); } /** * @since version 0.84 * * @param $field * @param $name (default '') * @param $values (default '') * @param $options array **/ static function getSpecificValueToSelect($field, $name='', $values='', array $options=array()) { global $DB; if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'field' : $generic_rule = new Rule; if (isset($values['rules_id']) && !empty($values['rules_id']) && $generic_rule->getFromDB($values['rules_id'])) { if ($rule = getItemForItemtype($generic_rule->fields["sub_type"])) { $options['value'] = $values[$field]; $options['name'] = $name; return $rule->dropdownActions($options); } } break; case 'action_type' : $generic_rule = new Rule; if (isset($values['rules_id']) && !empty($values['rules_id']) && $generic_rule->getFromDB($values['rules_id'])) { return self::dropdownActions($generic_rule->fields["sub_type"], $name, $values[$field], false, false); } break; case 'pattern' : if (!isset($values["field"]) || !isset($values["action_type"])) { return NOT_AVAILABLE; } $generic_rule = new Rule; if (isset($values['rules_id']) && !empty($values['rules_id']) && $generic_rule->getFromDB($values['rules_id'])) { if ($rule = getItemForItemtype($generic_rule->fields["sub_type"])) { /// TODO review it : need to pass display param and others... return $this->displayActionSelectPattern($values); } } break; } return parent::getSpecificValueToSelect($field, $name, $values, $options); } /** * Get all actions for a given rule * * @param $ID the rule_description ID * * @return an array of RuleAction objects **/ function getRuleActions($ID) { global $DB; $sql = "SELECT * FROM `".$this->getTable()."` WHERE `".static::$items_id."` = '$ID' ORDER BY `id`"; $result = $DB->query($sql); $rules_actions = array(); while ($rule = $DB->fetch_assoc($result)) { $tmp = new self(); $tmp->fields = $rule; $rules_actions[] = $tmp; } return $rules_actions; } /** * Add an action * * @param $action action type * @param $ruleid rule ID * @param $field field name * @param $value value **/ function addActionByAttributes($action, $ruleid, $field, $value) { $input["action_type"] = $action; $input["field"] = $field; $input["value"] = $value; $input[static::$items_id] = $ruleid; $this->add($input); } /** * Display a dropdown with all the possible actions * * @param $sub_type * @param $name * @param $value (default '') * @param $already_used (default false) * @param $display (true by default) **/ static function dropdownActions($sub_type, $name, $value='', $already_used=false, $display=true) { if ($rule = getItemForItemtype($sub_type)) { $actions_options = $rule->getAllActions(); $actions = array("assign"); // Manage permit several. if ($already_used) { if (!isset($actions_options[$value]['permitseveral'])) { return false; } $actions = $actions_options[$value]['permitseveral']; } else { if (isset($actions_options[$value]['force_actions'])) { $actions = $actions_options[$value]['force_actions']; } } $elements = array(); foreach ($actions as $action) { $elements[$action] = self::getActionByID($action); } return Dropdown::showFromArray($name, $elements, array('value' => $value, 'display' => $display)); } } static function getActions() { return array('assign' => __('Assign'), 'append' => __('Add'), 'regex_result' => __('Assign the value from regular expression'), 'append_regex_result' => __('Add the result of regular expression'), 'affectbyip' => __('Assign: equipment by IP address'), 'affectbyfqdn' => __('Assign: equipment by name + domain'), 'affectbymac' => __('Assign: equipment by MAC address'), 'compute' => __('Recalculate'), 'send' => __('Send'), 'add_validation' => __('Send'), 'fromuser' => __('Copy from user'), 'fromitem' => __('Copy from item')); } /** * @param $ID **/ static function getActionByID($ID) { $actions = self::getActions(); if (isset($actions[$ID])) { return $actions[$ID]; } return ''; } /** * @param $action * @param $regex_result **/ static function getRegexResultById($action, $regex_result) { $results = array(); if (count($regex_result) > 0) { if (preg_match_all("/#([0-9])/", $action, $results) > 0) { foreach ($results[1] as $result) { $action = str_replace("#$result", (isset($regex_result[$result])?$regex_result[$result]:''), $action); } } } return $action; } /** * @param $rules_id * @param $sub_type **/ function getAlreadyUsedForRuleID($rules_id, $sub_type) { global $DB; if ($rule = getItemForItemtype($sub_type)) { $actions_options = $rule->getAllActions(); $actions = array(); $res = $DB->query("SELECT `field` FROM `".$this->getTable()."` WHERE `".static::$items_id."` = '".$rules_id."'"); while ($action = $DB->fetch_assoc($res)) { if (isset($actions_options[$action["field"]])) { $actions[$action["field"]] = $action["field"]; } } return $actions; } } /** * @param $options array **/ function displayActionSelectPattern($options=array()) { $display = false; switch ($_POST["action_type"]) { //If a regex value is used, then always display an autocompletiontextfield case "regex_result" : case "append_regex_result" : Html::autocompletionTextField($this, "value"); break; case 'fromuser' : case 'fromitem' : Dropdown::showYesNo("value", 0, 0); $display = true; break; default : $actions = Rule::getActionsByType($options["sub_type"]); if (isset($actions[$options["field"]]['type'])) { switch($actions[$options["field"]]['type']) { case "dropdown" : $table = $actions[$options["field"]]['table']; $param = array('name' => "value"); if (isset($actions[$options["field"]]['condition'])) { $param['condition'] = $actions[$options["field"]]['condition']; } Dropdown::show(getItemTypeForTable($table), $param); $display = true; break; case "dropdown_tickettype" : Ticket::dropdownType('value'); $display = true; break; case "dropdown_assign" : User::dropdown(array('name' => 'value', 'right' => 'own_ticket')); $display = true; break; case "dropdown_users" : User::dropdown(array('name' => 'value', 'right' => 'all')); $display = true; break; case "dropdown_urgency" : Ticket::dropdownUrgency(array('name' => 'value')); $display = true; break; case "dropdown_impact" : Ticket::dropdownImpact(array('name' => 'value')); $display = true; break; case "dropdown_priority" : if ($_POST["action_type"] != 'compute') { Ticket::dropdownPriority(array('name' => 'value')); } $display = true; break; case "dropdown_status" : Ticket::dropdownStatus(array('name' => "value")); $display = true; break; case "yesonly" : Dropdown::showYesNo("value",0,0); $display = true; break; case "yesno" : Dropdown::showYesNo("value"); $display = true; break; case "dropdown_management": Dropdown::showGlobalSwitch(0, array('name' => 'value', 'management_restrict' => 2, 'withtemplate' => false)); $display = true; break; case "dropdown_users_validate" : User::dropdown(array('name' => "value", 'right' => array('validate_incident', 'validate_request'))); $display = true; break; default : if ($rule = getItemForItemtype($options["sub_type"])) { $display = $rule->displayAdditionalRuleAction($actions[$options["field"]]); } break; } } if (!$display) { Html::autocompletionTextField($this, "value"); } } } } ?>glpi-0.84.3+dfsg.1/inc/rulecached.class.php000066400000000000000000000071231226600447100203110ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Rule cached class class RuleCached extends Rule { /** * get the cache table name for this rule type * * @return string table name **/ function getCacheTable() { $rulecollection = RuleCollection::getClassByType(get_class($this)); return $rulecollection->cache_table; } /** * Delete cache for a rule * * @param $ID rule ID **/ function deleteCacheByRuleId($ID) { global $DB; $DB->query("DELETE FROM `".$this->getCacheTable()."` WHERE `rules_id` = '$ID'"); } function cleanDBonPurge() { parent::cleanDBonPurge(); $this->deleteCacheByRuleId($this->fields['id']); } /** * @see CommonDBTM::post_updateItem() **/ function post_updateItem($history=1) { // Clean cache in all case (match, active, ranking, add/delete criteria/action) $this->deleteCacheByRuleId($this->input["id"]); } /** * Show cache statis for a current rule * * @param $target where to go **/ function showCacheStatusByRule($target) { global $DB; echo "
    "; echo ""; $rulecollection = RuleCollection::getClassByType($this->getType()); $query = "SELECT * FROM `".$rulecollection->cache_table."` WHERE `".$rulecollection->cache_table."`.`rules_id` = '".$this->fields["id"]."'"; $res_count = $DB->query($query); $this->showCacheRuleHeader(); while ($datas = $DB->fetch_assoc($res_count)) { echo ""; $this->showCacheRuleDetail($datas); echo "\n"; } echo "


    \n"; echo "".__('Cache information')."
    "; } /** * Display Header for cache display **/ function showCacheRuleHeader() { echo "".__('Cache information')."".$this->fields["name"]; echo "\n"; echo "".__('Original value').""; echo "".__('Modified value').""; } /** * Display a cache item * * @param $fields data array **/ function showCacheRuleDetail($fields) { echo "".$fields["old_value"].""; echo "". (($fields["new_value"] != '') ?$fields["new_value"]:__('Unchanged')).""; } } ?> glpi-0.84.3+dfsg.1/inc/rulecachedcollection.class.php000066400000000000000000000172041226600447100223660ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Specific rule collection for dictionnary : got a function initialize rule's caching system **/ class RuleCachedCollection extends RuleCollection { // Specific ones /// Cache table used var $cache_table; /// Cache parameters var $cache_params; /** * Init a cache rule collection * * @param $cache_table cache table used * @param $input_params array input parameters to store (default "name" => "old_value") * @param $output_params array output parameters to store (default "name" => "new_value") * * @return nothing **/ function initCache($cache_table, $input_params=array("name" => "old_value"), $output_params=array("name" => "new_value")) { $this->can_replay_rules = true; $this->stop_on_first_match = true; $this->cache_table = $cache_table; $this->cache_params["input_value"] = $input_params; $this->cache_params["output_value"] = $output_params; } /** * Show the list of rules * * @param $target where to go * * @return nothing **/ function showAdditionalInformationsInForm($target) { global $CFG_GLPI; echo ""; } /** * Process all the rules collection * * @param input array the input data used to check criterias * @param output array the initial ouput array used to be manipulate by actions * @param params array parameters for all internal functions * @param force_no_cache don't write rule's result into cache (for preview mode mainly) * (false by default) * * @return the output array updated by actions **/ function processAllRules($input=array(), $output=array(), $params=array(), $force_no_cache=false) { //If cache enabled : try to get value from the cache $new_values = $this->checkDataInCache($input); if ($new_values != Rule::RULE_NOT_IN_CACHE) { $output["_rule_process"] = true; return Toolbox::addslashes_deep(array_merge($output, $new_values)); } $output = parent::processAllRules($input, $output, $params, $force_no_cache); if (!$force_no_cache && isset($output["_ruleid"])) { $this->insertDataInCache(Toolbox::addslashes_deep($input), $output); unset($output["_ruleid"]); } return $output; } /** * Show cache status by rules **/ function showCacheStatusForRuleType() { global $DB, $CFG_GLPI; echo "
    "; echo ""; $query = "SELECT `name`, `rules_id`, COUNT(`rules_id`) AS cpt FROM `".$this->cache_table."`, `glpi_rules` WHERE `".$this->cache_table."`.`rules_id` = `glpi_rules`.`id` GROUP BY `rules_id` ORDER BY `name`"; $res_count = $DB->query($query); echo "\n"; echo ""; echo "\n"; $total = 0; while ($datas = $DB->fetch_assoc($res_count)) { echo ""; echo "\n"; $total += $datas["cpt"]; } echo "\n"; echo ""; echo ""; echo "
    ".__('Cache information')."".$this->getTitle()."
    ".__('Rule name')."".__('Objects in cache')."
    "; echo "getRuleClassName()."&rules_id=".$datas["rules_id"]."'>".$datas["name"]. "".$datas["cpt"]."
    ".sprintf(__('%1$s (%2$s)'), __('Total'), $DB->numrows($res_count))."".$total."
    \n"; } /** * Check if a data is in cache * * @param input data array to search * * @return boolean : is in cache ? **/ function checkDataInCache($input) { global $DB; $where = ""; $first = true; $input = Toolbox::addslashes_deep($input); foreach ($this->cache_params["input_value"] as $param => $value) { if (isset($input[$param])) { $where .= (!$first?" AND ":"")." `".$value."` = '".$input[$param]."'"; $first = false; } } $sql = "SELECT * FROM `".$this->cache_table."` WHERE ".$where; if ($res_check = $DB->query($sql)) { $output_values = array(); if ($DB->numrows($res_check) > 0) { $data = $DB->fetch_assoc($res_check); foreach ($this->cache_params["output_value"] as $param => $param_value) { if (isset($data[$param_value])) { $output_values[$param] = $data[$param_value]; } } return $output_values; } } return Rule::RULE_NOT_IN_CACHE; } /** * Insert data in cache * * @param input input data array * @param $output output data array **/ function insertDataInCache($input, $output) { global $DB; $old_values = ""; $into_old = ""; foreach ($this->cache_params["input_value"] as $param => $value) { $into_old .= "`".$value."`, "; // Input are slashes protected... $old_values .= "'".$input[$param]."', "; } $into_new = ""; $new_values = ""; foreach ($this->cache_params["output_value"] as $param => $value) { if (!isset($output[$param])) { $output[$param] = ""; } $into_new .= ", `".$value."`"; // Output are not slashes protected... $new_values .= " ,'".$output[$param]."'"; } $sql = "INSERT INTO `".$this->cache_table."` (".$into_old."`rules_id`".$into_new.") VALUES (".$old_values.$output["_ruleid"].$new_values.")"; $DB->query($sql); } } ?> glpi-0.84.3+dfsg.1/inc/rulecollection.class.php000066400000000000000000001065301226600447100212370ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class RuleCollection extends CommonDBTM { /// Rule type public $sub_type; /// process collection stop on first matched rule var $stop_on_first_match = false; /// Right needed to use this rule collection static public $right = "config"; /// field used to order rules var $orderby = "ranking"; /// Processing several rules : use result of the previous one to computer the current one var $use_output_rule_process_as_next_input = false; /// Rule collection can be replay (for dictionnary) var $can_replay_rules = false; /// List of rules of the rule collection var $RuleList = NULL; /// Menu type var $menu_type = "rule"; /// Menu option var $menu_option = ""; var $entity = 0; // Temproray hack for this class static function getTable() { return 'glpi_rules'; } static function canCreate() { return Session::haveRight(static::$right, 'w'); } static function canView() { return Session::haveRight(static::$right, 'r'); } /** * @param $entity (default 0) **/ function setEntity($entity=0) { $this->entity = $entity; } function canList() { return static::canView(); } function isEntityAssign() { return false; } /** * Get Collection Size : retrieve the number of rules * * @param $recursive (true by default) * * @return : number of rules **/ function getCollectionSize($recursive=true) { return countElementsInTable("glpi_rules", "sub_type = '".$this->getRuleClassName()."'". getEntitiesRestrictRequest(" AND", "glpi_rules", "entities_id", $this->entity, $recursive)); } /** * @param $options array **/ function getRuleListQuery($options=array()) { $p['active'] = true; $p['start'] = 0; $p['limit'] = 0; $p['inherited'] = true; $p['childrens'] = false; foreach ($options as $key => $value) { $p[$key] = $value; } if ($p['active']) { $sql_active = " `is_active` = '1'"; } else { $sql_active = "1"; } $sql = "SELECT `glpi_rules`.* FROM `glpi_rules`"; //Select all the rules of a different type if ($this->isRuleRecursive()) { $sql .= " LEFT JOIN `glpi_entities` ON (`glpi_entities`.`id`=`glpi_rules`.`entities_id`) WHERE $sql_active AND `sub_type` = '".$this->getRuleClassName()."' "; if (!$p['childrens']) { $sql .= getEntitiesRestrictRequest(" AND", "glpi_rules", "entities_id", $this->entity, $p['inherited']); } else { $sons = getSonsOf('glpi_entities', $this->entity); $sql .= " AND `glpi_rules`.`entities_id` IN (".implode(',',$sons).")"; } $sql .= " ORDER BY `glpi_entities`.`level` ASC, `".$this->orderby."` ASC"; } else { $sql .= "WHERE $sql_active AND `sub_type` = '".$this->getRuleClassName()."' ORDER BY `".$this->orderby."` ASC"; } if ($p['limit']) { $sql .= " LIMIT ".intval($p['start']).",".intval($p['limit']); } return $sql; } /** * Get Collection Part : retrieve descriptions of a range of rules * * @param $options array of options may be : * - start : first rule (in the result set - default 0) * - limit : max number of rules to retrieve (default 0) * - recursive : boolean get recursive rules * - childirens : boolean get childrens rules **/ function getCollectionPart($options=array()) { global $DB; $p['start'] = 0; $p['limit'] = 0; $p['recursive'] = true; $p['childrens'] = false; foreach ($options as $key => $value) { $p[$key] = $value; } // no need to use SingletonRuleList::getInstance because we read only 1 page $this->RuleList = new SingletonRuleList(); $this->RuleList->list = array(); //Select all the rules of a different type $sql = $this->getRuleListQuery($p); $result = $DB->query($sql); if ($result) { while ($data = $DB->fetch_assoc($result)) { //For each rule, get a Rule object with all the criterias and actions $tempRule = $this->getRuleClass(); $tempRule->fields = $data; $this->RuleList->list[] = $tempRule; } } } /** * Get Collection Datas : retrieve descriptions and rules * * @param $retrieve_criteria Retrieve the criterias of the rules ? (default 0) * @param $retrieve_action Retrieve the action of the rules ? (default 0) **/ function getCollectionDatas($retrieve_criteria=0, $retrieve_action=0) { global $DB; if ($this->RuleList === NULL) { $this->RuleList = SingletonRuleList::getInstance($this->getRuleClassName(), $this->entity); } $need = 1+($retrieve_criteria?2:0)+($retrieve_action?4:0); // check if load required if (($need & $this->RuleList->load) != $need) { //Select all the rules of a different type $sql = $this->getRuleListQuery(); $result = $DB->query($sql); if ($result) { $this->RuleList->list = array(); while ($rule = $DB->fetch_assoc($result)) { //For each rule, get a Rule object with all the criterias and actions $tempRule = $this->getRuleClass(); if ($tempRule->getRuleWithCriteriasAndActions($rule["id"], $retrieve_criteria, $retrieve_action)) { //Add the object to the list of rules $this->RuleList->list[] = $tempRule; } } $this->RuleList->load = $need; } } } function getRuleClassName() { if (preg_match('/(.*)Collection/', get_class($this), $rule_class)) { return $rule_class[1]; } return ""; } /** * Get a instance of the class to manipulate rule of this collection **/ function getRuleClass() { $name = $this->getRuleClassName(); if ($name != '') { return new $name(); } return null; } /** * Is a confirmation needed before replay on DB ? * If needed need to send 'replay_confirm' in POST * * @param $target filename : where to go when done * * @return true if confirmtion is needed, else false **/ function warningBeforeReplayRulesOnExistingDB($target) { return false; } /** * Replay Collection on DB * * @param $offset first row to work on (default 0) * @param $maxtime float max system time to stop working (default 0) * @param $items array containg items to replay. If empty -> all * @param $params array additional parameters if needed * * @return -1 if all rows done, else offset for next run **/ function replayRulesOnExistingDB($offset=0, $maxtime=0, $items=array(), $params=array()) { } /** * Get title used in list of rules * * @return Title of the rule collection **/ function getTitle() { return __('Rules list'); } /** * Indicates if the rule can be affected to an entity or if it's global **/ function isRuleEntityAssigned() { $rule = $this->getRuleClass(); return $rule->isEntityAssign(); } /** * Indicates if the rule can be affected to an entity or if it's global **/ function isRuleRecursive() { $rule = $this->getRuleClass(); return $rule->maybeRecursive(); } function showEngineSummary() { echo ""; echo "
    "; //Display information about the how the rules engine process the rules if ($this->stop_on_first_match) { //The engine stop on the first matched rule echo "".__('The engine stops on the first checked rule.'). "
    "; } else { //The engine process all the rules echo "".__('The engine treats all the rules.')."
    "; } if ($this->use_output_rule_process_as_next_input) { //The engine keep the result of a rule to be processed further echo "". __('The engine passes the result of a rule to the following one.')."
    "; } echo "
    \n"; } /** * Show the list of rules * * @param $target * @param $options array * * @return nothing **/ function showListRules($target, $options=array()) { global $CFG_GLPI; $p['inherited'] = true; $p['childrens'] = false; $p['active'] = false; $rand = mt_rand(); foreach (array('inherited','childrens') as $param) { if (isset($options[$param]) && $this->isRuleRecursive()) { $p[$param] = $options[$param]; } } $rule = $this->getRuleClass(); $display_entities = ($this->isRuleRecursive() && ($p['inherited'] || $p['childrens'])); // Do not know what it is ? $canedit = (Session::haveRight(static::$right, "w") && !$display_entities); $nb = $this->getCollectionSize($p['inherited']); $p['start'] = (isset($options["start"]) ? $options["start"] : 0); if ($p['start'] >= $nb) { $p['start'] = 0; } $p['limit'] = $_SESSION['glpilist_limit']; $this->getCollectionPart($p); Html::printAjaxPager('', $p['start'], $nb); Html::openMassiveActionsForm('mass'.__CLASS__.$rand); echo "\n
    "; if ($canedit && $nb) { $massiveactionparams = array('num_displayed' => min($p['limit'], $nb), 'extraparams' => array('entity_restrict' => $this->entity)); Html::showMassiveActions($this->getRuleClassName(), $massiveactionparams); } echo ""; $colspan = 6; if ($display_entities) { $colspan++; } echo "\n"; echo ""; echo ""; echo ""; echo ""; echo ""; if ($display_entities) { echo "\n"; } if (!$display_entities) { echo ""; } echo "\n"; if (count($this->RuleList->list)) { $ruletype = $this->RuleList->list[0]->getType(); Session::initNavigateListItems($ruletype); } for ($i=$p['start'],$j=0 ; isset($this->RuleList->list[$j]) ; $i++,$j++) { $this->RuleList->list[$j]->showMinimalForm($target, $i==0, $i==$nb-1, $display_entities); Session::addToNavigateListItems($ruletype, $this->RuleList->list[$j]->fields['id']); } if ($nb) { echo ""; echo ""; echo ""; echo ""; echo ""; if ($display_entities) { echo "\n"; } if (!$display_entities) { echo ""; } echo "\n"; } echo "
    " . $this->getTitle() ."
    "; if ($canedit) { Html::checkAllAsCheckbox('mass'.__CLASS__.$rand); } echo "".__('Name')."".__('Description')."".__('Active')."".__('Entity')." 
    "; if ($canedit) { Html::checkAllAsCheckbox('mass'.__CLASS__.$rand); } echo "".__('Name')."".__('Description')."".__('Active')."".__('Entity')." 
    \n"; if ($canedit && $nb) { $massiveactionparams['ontop'] = false; Html::showMassiveActions($this->getRuleClassName(), $massiveactionparams); } echo "
    "; Html::closeForm(); Html::printAjaxPager('', $p['start'], $nb); echo "
    "; if ($plugin = isPluginItemType($this->getType())) { $url = $CFG_GLPI["root_doc"]."/plugins/".strtolower($plugin['plugin']); } else { $url = $CFG_GLPI["root_doc"]; } echo "getRuleClassName(). "&' ,'glpipopup', 'height=400, width=1000, top=100, left=100, scrollbars=yes' );". "w.focus();\">".__('Test rules engine')."
    "; if ($this->can_replay_rules) { echo ""; } echo "
    "; $this->showAdditionalInformationsInForm($target); echo "
    "; } /** * Show the list of rules * * @param $target * * @return nothing **/ function showAdditionalInformationsInForm($target) { } /** * Modify rule's ranking and automatically reorder all rules * * @param $ID the rule ID whose ranking must be modified * @param $action up or down **/ function changeRuleOrder($ID, $action) { global $DB; $sql = "SELECT `ranking` FROM `glpi_rules` WHERE `id` ='$ID'"; if ($result = $DB->query($sql)) { if ($DB->numrows($result) == 1) { $current_rank = $DB->result($result, 0, 0); // Search rules to switch $sql2 = "SELECT `id`, `ranking` FROM `glpi_rules` WHERE `sub_type` = '".$this->getRuleClassName()."'"; switch ($action) { case "up" : $sql2 .= " AND `ranking` < '$current_rank' ORDER BY `ranking` DESC LIMIT 1"; break; case "down" : $sql2 .= " AND `ranking` > '$current_rank' ORDER BY `ranking` ASC LIMIT 1"; break; default : return false; } if ($result2 = $DB->query($sql2)) { if ($DB->numrows($result2) == 1) { list($other_ID,$new_rank) = $DB->fetch_row($result2); $rule = $this->getRuleClass(); return ($rule->update(array('id' => $ID, 'ranking' => $new_rank)) && $rule->update(array('id' => $other_ID, 'ranking' => $current_rank))); } } } return false; } } /** * Update Rule Order when deleting a rule * * @param $ranking rank of the deleted rule * * @return true if all ok **/ function deleteRuleOrder($ranking) { global $DB; $rules = array(); $sql = "UPDATE `glpi_rules` SET `ranking` = `ranking`-1 WHERE `sub_type` ='".$this->getRuleClassName()."' AND `ranking` > '$ranking' "; return $DB->query($sql); } /** * Move a rule in an ordered collection * * @param $ID of the rule to move * @param $ref_ID of the rule position (0 means all, so before all or after all) * @param $type of move : after or before ( default 'after') * * @return true if all ok **/ function moveRule($ID, $ref_ID, $type='after') { global $DB; $ruleDescription = new Rule(); // Get actual ranking of Rule to move $ruleDescription->getFromDB($ID); $old_rank = $ruleDescription->fields["ranking"]; // Compute new ranking if ($ref_ID) { // Move after/before an existing rule $ruleDescription->getFromDB($ref_ID); $rank = $ruleDescription->fields["ranking"]; } else if ($type == "after") { // Move after all $query = "SELECT MAX(`ranking`) AS maxi FROM `glpi_rules` WHERE `sub_type` ='".$this->getRuleClassName()."' "; $result = $DB->query($query); $ligne = $DB->fetch_assoc($result); $rank = $ligne['maxi']; } else { // Move before all $rank = 1; } $rule = $this->getRuleClass(); $result = false; // Move others rules in the collection if ($old_rank < $rank) { if ($type == "before") { $rank--; } // Move back all rules between old and new rank $query = "SELECT `id`, `ranking` FROM `glpi_rules` WHERE `sub_type` ='".$this->getRuleClassName()."' AND `ranking` > '$old_rank' AND `ranking` <= '$rank'"; foreach ($DB->request($query) as $data) { $data['ranking']--; $result = $rule->update($data); } } else if ($old_rank > $rank) { if ($type == "after") { $rank++; } // Move forward all rule between old and new rank $query = "SELECT `id`, `ranking` FROM `glpi_rules` WHERE `sub_type` ='".$this->getRuleClassName()."' AND `ranking` >= '$rank' AND `ranking` < '$old_rank'"; foreach ($DB->request($query) as $data) { $data['ranking']++; $result = $rule->update($data); } } else { // $old_rank == $rank : nothing to do $result = false; } // Move the rule if ($result && ($old_rank != $rank)) { $result = $rule->update(array('id' => $ID, 'ranking' => $rank)); } return ($result ? true : false); } /** * Process all the rules collection * * @param input array the input data used to check criterias (need to be clean slashes) * @param output array the initial ouput array used to be manipulate by actions (need to be clean slashes) * @param params array parameters for all internal functions (need to be clean slashes) * * @return the output array updated by actions (addslashes datas) **/ function processAllRules($input=array() ,$output=array(), $params=array()) { // Get Collection datas $this->getCollectionDatas(1,1); $input = $this->prepareInputDataForProcessWithPlugins($input, $params); $output["_no_rule_matches"] = true; //Store rule type being processed (for plugins) $params['rule_itemtype'] = $this->getRuleClassName(); if (count($this->RuleList->list)) { foreach ($this->RuleList->list as $rule) { //If the rule is active, process it if ($rule->fields["is_active"]) { $output["_rule_process"] = false; $rule->process($input, $output, $params); if ($output["_rule_process"] && $this->stop_on_first_match) { unset($output["_rule_process"]); $output["_ruleid"] = $rule->fields["id"]; return Toolbox::addslashes_deep($output); } } if ($this->use_output_rule_process_as_next_input) { $output = $this->prepareInputDataForProcessWithPlugins($output, $params); $input = $output; } } } return Toolbox::addslashes_deep($output); } /** * Show form displaying results for rule collection preview * * @param $target where to go * @param $values array of data **/ function showRulesEnginePreviewCriteriasForm($target, array $values) { global $DB; $input = $this->prepareInputDataForTestProcess(); if (count($input)) { $rule = $this->getRuleClass(); $criterias = $rule->getAllCriteria(); echo ""; echo "\n
    "; echo ""; echo "\n"; //Brower all criterias foreach ($input as $criteria) { echo ""; if (isset($criterias[$criteria])) { $criteria_constants = $criterias[$criteria]; echo ""; } else { echo ""; } echo "\n"; } $rule->showSpecificCriteriasForPreview($_POST); echo "\n"; echo "
    " . _n('Criterion', 'Criteria', 2) . "
    ".$criteria_constants["name"]."".$criteria.""; $rule->displayCriteriaSelectPattern($criteria, $criteria, Rule::PATTERN_IS, isset($values[$criteria])?$values[$criteria]:''); echo "
    "; echo ""; echo ""; echo "
    "; Html::closeForm(); } else { echo '
    '.__('No element to be tested').'
    '; } return $input; } /** * Test all the rules collection * * @param input array the input data used to check criterias * @param output array the initial ouput array used to be manipulate by actions * @param params array parameters for all internal functions * * @return the output array updated by actions **/ function testAllRules($input=array(), $output=array(), $params=array()) { // Get Collection datas $this->getCollectionDatas(1, 1); $output["_no_rule_matches"] = true; if (count($this->RuleList->list)) { foreach ($this->RuleList->list as $rule) { //If the rule is active, process it if ($rule->fields["is_active"]) { $output["_rule_process"] = false; $output["result"][$rule->fields["id"]]["id"] = $rule->fields["id"]; $rule->process($input, $output, $params); if ($output["_rule_process"] && $this->stop_on_first_match) { unset($output["_rule_process"]); $output["result"][$rule->fields["id"]]["result"] = 1; $output["_ruleid"] = $rule->fields["id"]; return $output; } else if ($output["_rule_process"]) { $output["result"][$rule->fields["id"]]["result"] = 1; } else { $output["result"][$rule->fields["id"]]["result"] = 0; } } else { //Rule is inactive $output["result"][$rule->fields["id"]]["result"] = 2; } if ($this->use_output_rule_process_as_next_input) { $input = $output; } } } return $output; } /** * Prepare input datas for the rules collection * * @param $input the input data used to check criterias * @param $params parameters * * @return the updated input datas **/ function prepareInputDataForProcess($input, $params) { return $input; } /** * Prepare input datas for the rules collection, also using plugins values * * @since version 0.84 * * @param $input the input data used to check criterias * @param $params parameters * * @return the updated input datas **/ function prepareInputDataForProcessWithPlugins($input, $params) { global $PLUGIN_HOOKS; $input = $this->prepareInputDataForProcess($input, $params); if (isset($PLUGIN_HOOKS['use_rules'])) { foreach ($PLUGIN_HOOKS['use_rules'] as $plugin => $val) { if (is_array($val) && in_array($this->getRuleClassName(), $val)) { $results = Plugin::doOneHook($plugin, 'ruleCollectionPrepareInputDataForProcess', array('rule_itemtype' => $this->getRuleClassName(), 'values' => array('input' => $input, 'params' => $params))); if (is_array($results)) { foreach ($results as $id => $result) { $input[$id] = $result; } } } } } return $input; } /** * Prepare input datas for the rules collection * * @return the updated input datas **/ function prepareInputDataForTestProcess() { global $DB; $input = array(); $res = $DB->query("SELECT DISTINCT `glpi_rulecriterias`.`criteria` FROM `glpi_rulecriterias`, `glpi_rules` WHERE `glpi_rules`.`is_active` = '1' AND `glpi_rulecriterias`.`rules_id` = `glpi_rules`.`id` AND `glpi_rules`.`sub_type` = '".$this->getRuleClassName()."'"); while ($data = $DB->fetch_assoc($res)) { $input[] = $data["criteria"]; } return $input; } /** * Show form displaying results for rule engine preview * * @param $target where to go * @param $input array of data **/ function showRulesEnginePreviewResultsForm($target, array $input) { $output = array(); if ($this->use_output_rule_process_as_next_input) { $output = $input; } $output = $this->testAllRules($input, $output, $input); $rule = $this->getRuleClass(); echo "
    "; if (isset($output["result"])) { echo ""; echo "\n"; foreach ($output["result"] as $ID=>$rule_result) { echo ""; $rule->getFromDB($ID); echo ""; echo "\n"; } echo "
    " . __('Result details') . "
    ".$rule->fields["name"].""; switch ($rule_result["result"]) { case 0 : case 1 : echo Dropdown::getYesNo($rule_result["result"]); break; case 2 : _e('Inactive'); break; } echo "
    "; } $output = $this->cleanTestOutputCriterias($output); unset($output["result"]); $global_result = (count($output)?1:0); echo "
    "; $this->showTestResults($rule, $output, $global_result); echo "
    "; } /** * Unset criterias from the rule's ouput results (begins by _) * * @param $output array clean output array to clean * * @return cleaned array **/ function cleanTestOutputCriterias(array $output) { $rule = $this->getRuleClass(); $actions = $rule->getAllActions(); //If output array contains keys begining with _ : drop it foreach ($output as $criteria => $value) { if ($criteria[0] == '_' && !isset($actions[$criteria])) { unset($output[$criteria]); } } return $output; } /** * Show test results for a rule * * @param $rule rule object * @param $output array output data array * @param $global_result boolean global result * * @return cleaned array **/ function showTestResults($rule, array $output, $global_result) { $actions = $rule->getAllActions(); echo ""; echo "\n"; echo ""; echo ""; echo ""; $output = $this->preProcessPreviewResults($output); foreach ($output as $criteria => $value) { if (isset($actions[$criteria])) { echo ""; echo ""; $action_type = (isset($actions[$criteria]['action_type'])?$actions[$criteria]['action_type']:''); echo "\n"; } } echo "
    " . __('Rule results') . "
    ".__('Validation')."".Dropdown::getYesNo($global_result)."
    ".$actions[$criteria]["name"]."".$rule->getActionValue($criteria, $action_type, $value); echo "
    \n"; } /** * @param $output **/ function preProcessPreviewResults($output) { global $PLUGIN_HOOKS; if (isset($PLUGIN_HOOKS['use_rules'])) { $params['rule_itemtype'] = $this->getType(); foreach ($PLUGIN_HOOKS['use_rules'] as $plugin => $val) { if (is_array($val) && in_array($this->getType(), $val)) { $results = Plugin::doOneHook($plugin, "preProcessRuleCollectionPreviewResults", array('output' => $output, 'params' => $params)); if (is_array($results)) { foreach ($results as $id => $result) { $output[$id] = $result; } } } } } return $this->cleanTestOutputCriterias($output); } /** * Print a title if needed which will be displayed above list of rules * * @return nothing (display) **/ function title() { } /** * Get rulecollection classname by giving his itemtype * * @param $itemtype itemtype * @param $check_dictionnary_type check if the itemtype is a dictionnary or not * (false by default) * * @return the rulecollection class or null */ static function getClassByType($itemtype, $check_dictionnary_type=false) { global $CFG_GLPI; if ($plug = isPluginItemType($itemtype)) { $typeclass = 'Plugin'.$plug['plugin'].$plug['class'].'Collection'; } else { if (in_array($itemtype, $CFG_GLPI["dictionnary_types"])) { $typeclass = 'RuleDictionnary'.$itemtype."Collection"; } else { $typeclass = $itemtype."Collection"; } } if (($check_dictionnary_type && in_array($itemtype, $CFG_GLPI["dictionnary_types"])) || !$check_dictionnary_type) { if ($item = getItemForItemtype($typeclass)) { return $item; } return NULL; } } function showInheritedTab() { return false; } function showChildrensTab() { return false; } /** * Get all the fields needed to perform the rule **/ function getFieldsToLookFor() { global $DB; $params = array(); $query = "SELECT DISTINCT `glpi_rulecriterias`.`criteria` AS `criteria` FROM `glpi_rules`, `glpi_rulecriterias` WHERE `glpi_rules`.`sub_type` = '".$this->getRuleClassName()."' AND `glpi_rulecriterias`.`rules_id` = `glpi_rules`.`id` AND `glpi_rules`.`is_active` = '1'"; foreach ($DB->request($query) as $param) { $params[] = Toolbox::strtolower($param["criteria"]); } return $params; } /** * For tabs management : force isNewItem * * @since version 0.83 **/ function isNewItem() { return false; } /** * @see CommonGLPI::defineTabs() **/ function defineTabs($options=array()) { $ong = array(); $this->addStandardTab(__CLASS__, $ong, $options); $ong['no_all_tab'] = true; return $ong; } /** * @see CommonGLPI::getTabNameForItem() **/ function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if ($item instanceof RuleCollection) { $ong = array(); if ($item->showInheritedTab()) { //TRANS: %s is the entity name $ong[1] = sprintf(__('Rules applied: %s'), Dropdown::getDropdownName('glpi_entities', $_SESSION['glpiactive_entity'])); } $title = _n('Rule', 'Rules', 2); if ($item->isRuleRecursive()) { //TRANS: %s is the entity name $title = sprintf(__('Local rules: %s'), Dropdown::getDropdownName('glpi_entities', $_SESSION['glpiactive_entity'])); } $ong[2] = $title; if ($item->showChildrensTab()) { $ong[3] = __('Rules applicable in the sub-entities'); } return $ong; } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item instanceof RuleCollection) { $options = $_POST; switch ($tabnum) { case 1: $options['inherited'] = 1; break; case 2: $options['inherited'] = 0; break; case 3 : $options['inherited'] = 0; $options['childrens'] = 1; break; } if ($item->isRuleEntityAssigned()) { $item->setEntity($_SESSION['glpiactive_entity']); } $item->title(); $item->showEngineSummary(); $item->showListRules($_POST['target'], $options); return true; } return false; } } ?> glpi-0.84.3+dfsg.1/inc/rulecriteria.class.php000066400000000000000000000426401226600447100207070ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Criteria Rule class class RuleCriteria extends CommonDBChild { // From CommonDBChild static public $items_id = 'rules_id'; public $dohistory = true; /** * @since version 0.84 **/ function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } /** * @param $rule_type (default 'Rule) **/ function __construct($rule_type='Rule') { static::$itemtype = $rule_type; } function post_getFromDB() { // Get correct itemtype if defult one is used if (static::$itemtype == 'Rule') { $rule = new Rule(); if ($rule->getFromDB($this->fields['rules_id'])) { static::$itemtype = $rule->fields['sub_type']; } } } /** * Get title used in rule * * @param $nb integer for singular or plural (default 0) * * @return Title of the rule **/ static function getTypeName($nb=0) { return _n('Criterion', 'Criteria', $nb); } /** * @see CommonDBTM::getName() **/ function getName($options=array()) { if ($rule = getItemForItemtype(static::$itemtype)) { return Html::clean($rule->getMinimalCriteriaText($this->fields)); } return NOT_AVAILABLE; } /** * @since version 0.84 **/ function prepareInputForAdd($input) { if (!isset($input['criteria']) || empty($input['criteria'])) { return false; } return parent::prepareInputForAdd($input); } function post_addItem() { parent::post_addItem(); if (isset($this->input['rules_id']) && $realrule = Rule::getRuleObjectByID($this->input['rules_id'])) { $realrule->update(array('id' => $this->input['rules_id'], 'date_mod' => $_SESSION['glpi_currenttime'])); } } function post_purgeItem() { parent::post_purgeItem(); if (isset($this->fields['rules_id']) && $realrule = Rule::getRuleObjectByID($this->fields['rules_id'])) { $realrule->update(array('id' => $this->fields['rules_id'], 'date_mod' => $_SESSION['glpi_currenttime'])); } } function getSearchOptions() { $tab = array(); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'criteria'; $tab[1]['name'] = __('Name'); $tab[1]['massiveaction'] = false; $tab[1]['datatype'] = 'specific'; $tab[1]['additionalfields'] = array('rules_id'); $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'condition'; $tab[2]['name'] = __('Condition'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'specific'; $tab[2]['additionalfields'] = array('rules_id', 'criteria'); $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'pattern'; $tab[3]['name'] = __('Reason'); $tab[3]['massiveaction'] = false; $tab[3]['datatype'] = 'specific'; $tab[3]['additionalfields'] = array('rules_id', 'criteria', 'condition'); return $tab; } /** * @since version 0.84 * * @param $field * @param $values * @param $options array **/ static function getSpecificValueToDisplay($field, $values, array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } switch ($field) { case 'criteria' : $generic_rule = new Rule; if (isset($values['rules_id']) && !empty($values['rules_id']) && $generic_rule->getFromDB($values['rules_id'])) { if ($rule = getItemForItemtype($generic_rule->fields["sub_type"])) { return $rule->getCriteria($values[$field]); } } break; case 'condition' : $generic_rule = new Rule; if (isset($values['rules_id']) && !empty($values['rules_id']) && $generic_rule->getFromDB($values['rules_id'])) { if (isset($values['criteria']) && !empty($values['criteria'])) { $criterion = $values['criteria']; } return $rule->getConditionByID($values[$field], $generic_rule->fields["sub_type"], $criterion); } break; case 'pattern' : if (!isset($values["criteria"]) || !isset($values["condition"])) { return NOT_AVAILABLE; } $generic_rule = new Rule; if (isset($values['rules_id']) && !empty($values['rules_id']) && $generic_rule->getFromDB($values['rules_id'])) { if ($rule = getItemForItemtype($generic_rule->fields["sub_type"])) { return $rule->getCriteriaDisplayPattern($values["criteria"], $values["condition"], $values[$field]); } } break; } return parent::getSpecificValueToDisplay($field, $values, $options); } /** * @since version 0.84 * * @param $field * @param $name (default '') * @param $values (default '') * @param $options array **/ static function getSpecificValueToSelect($field, $name='', $values='', array $options=array()) { global $DB; if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'criteria' : $generic_rule = new Rule; if (isset($values['rules_id']) && !empty($values['rules_id']) && $generic_rule->getFromDB($values['rules_id'])) { if ($rule = getItemForItemtype($generic_rule->fields["sub_type"])) { $options['value'] = $values[$field]; $options['name'] = $name; return $rule->dropdownCriteria($options); } } break; case 'condition' : $generic_rule = new Rule; if (isset($values['rules_id']) && !empty($values['rules_id']) && $generic_rule->getFromDB($values['rules_id'])) { if (isset($values['criteria']) && !empty($values['criteria'])) { $options['criterion'] = $values['criteria']; } $options['value'] = $values[$field]; $options['name'] = $name; return $rule->dropdownConditions($generic_rule->fields["sub_type"], $options); } break; case 'pattern' : if (!isset($values["criteria"]) || !isset($values["condition"])) { return NOT_AVAILABLE; } $generic_rule = new Rule; if (isset($values['rules_id']) && !empty($values['rules_id']) && $generic_rule->getFromDB($values['rules_id'])) { if ($rule = getItemForItemtype($generic_rule->fields["sub_type"])) { /// TODO : manage display param to this function : need to send ot to all under functions $rule->displayCriteriaSelectPattern($name, $values["criteria"], $values["condition"], $values[$field]); } } break; } return parent::getSpecificValueToSelect($field, $name, $values, $options); } /** * Get all criterias for a given rule * * @param $ID the rule_description ID * * @return an array of RuleCriteria objects **/ function getRuleCriterias($ID) { global $DB; $sql = "SELECT * FROM `".$this->getTable()."` WHERE `".static::$items_id."` = '$ID' ORDER BY `id`"; $result = $DB->query($sql); $rules_list = array(); while ($rule = $DB->fetch_assoc($result)) { $tmp = new self(); $tmp->fields = $rule; $rules_list[] = $tmp; } return $rules_list; } /** * Try to match a definied rule * * @param &$criterion RuleCriteria object * @param $field the field to match * @param &$criterias_results * @param &$regex_result * * @return true if the field match the rule, false if it doesn't match **/ static function match(RuleCriteria &$criterion, $field, &$criterias_results, &$regex_result) { $condition = $criterion->fields['condition']; $pattern = $criterion->fields['pattern']; $criteria = $criterion->fields['criteria']; //If pattern is wildcard, don't check the rule and return true //or if the condition is "already present in GLPI" : will be processed later if (($pattern == Rule::RULE_WILDCARD) || ($condition == Rule::PATTERN_FIND)) { return true; } $pattern = trim($pattern); switch ($condition) { case Rule::PATTERN_EXISTS : return (!empty($field)); case Rule::PATTERN_DOES_NOT_EXISTS : return (empty($field)); case Rule::PATTERN_IS : if (is_array($field)) { // Special case (used only by UNIQUE_PROFILE, for now) // $pattern is an ID if (in_array($pattern, $field)) { $criterias_results[$criteria] = $pattern; return true; } } else { //Perform comparison with fields in lower case $field = Toolbox::strtolower($field); $pattern = Toolbox::strtolower($pattern); if ($field == $pattern) { $criterias_results[$criteria] = $pattern; return true; } } return false; case Rule::PATTERN_IS_NOT : //Perform comparison with fields in lower case $field = Toolbox::strtolower($field); $pattern = Toolbox::strtolower($pattern); if ($field != $pattern) { $criterias_results[$criteria] = $pattern; return true; } return false; case Rule::PATTERN_UNDER : $table = getTableNameForForeignKeyField($criteria); $values = getSonsOf($table, $pattern); if (isset($values[$field])) { return true; } return false; case Rule::PATTERN_NOT_UNDER : $table = getTableNameForForeignKeyField($criteria); $values = getSonsOf($table, $pattern); if (isset($values[$field])) { return false; } return true; case Rule::PATTERN_END : $value = "/".$pattern."$/i"; if (preg_match($value, $field) > 0) { $criterias_results[$criteria] = $pattern; return true; } return false; case Rule::PATTERN_BEGIN : if (empty($pattern)) { return false; } $value = mb_stripos($field, $pattern, 0, 'UTF-8'); if (($value !== false) && ($value == 0)) { $criterias_results[$criteria] = $pattern; return true; } return false; case Rule::PATTERN_CONTAIN : if (empty($pattern)) { return false; } $value = mb_stripos($field, $pattern, 0, 'UTF-8'); if (($value !== false) && ($value >= 0)) { $criterias_results[$criteria] = $pattern; return true; } return false; case Rule::PATTERN_NOT_CONTAIN : if (empty($pattern)) { return false; } $value = mb_stripos($field, $pattern, 0, 'UTF-8'); if ($value === false) { $criterias_results[$criteria] = $pattern; return true; } return false; case Rule::REGEX_MATCH : $results = array(); // Permit use < and > $pattern = Toolbox::unclean_cross_side_scripting_deep($pattern); if (preg_match($pattern."i",$field,$results)>0) { // Drop $result[0] : complete match result array_shift($results); // And add to $regex_result array $regex_result[] = $results; $criterias_results[$criteria] = $pattern; return true; } return false; case Rule::REGEX_NOT_MATCH : // Permit use < and > $pattern = Toolbox::unclean_cross_side_scripting_deep($pattern); if (preg_match($pattern."i", $field) == 0) { $criterias_results[$criteria] = $pattern; return true; } return false; case Rule::PATTERN_FIND : case Rule::PATTERN_IS_EMPTY : // Global criteria will be evaluated later return true; } return false; } /** * Return the condition label by giving his ID * * @param $ID condition's ID * @param $itemtype itemtype * @param $criterion (default '') * * @return condition's label **/ static function getConditionByID($ID, $itemtype, $criterion='') { $conditions = self::getConditions($itemtype, $criterion); if (isset($conditions[$ID])) { return $conditions[$ID]; } return ""; } /** * @param $itemtype itemtype * @param $criterion (default '') * * @return array of criteria **/ static function getConditions($itemtype, $criterion='') { $criteria = array(Rule::PATTERN_IS => __('is'), Rule::PATTERN_IS_NOT => __('is not'), Rule::PATTERN_CONTAIN => __('contains'), Rule::PATTERN_NOT_CONTAIN => __('does not contain'), Rule::PATTERN_BEGIN => __('starting with'), Rule::PATTERN_END => __('finished by'), Rule::REGEX_MATCH => __('regular expression matches'), Rule::REGEX_NOT_MATCH => __('regular expression does not match'), Rule::PATTERN_EXISTS => __('exists'), Rule::PATTERN_DOES_NOT_EXISTS => __('does not exist')); $extra_criteria = call_user_func(array($itemtype, 'addMoreCriteria'), $criterion); foreach ($extra_criteria as $key => $value) { $criteria[$key] = $value; } /// Add Under criteria if tree dropdown table used if ($item = getItemForItemtype($itemtype)) { $crit = $item->getCriteria($criterion); if (isset($crit['type']) && ($crit['type'] == 'dropdown')) { $crititemtype = getItemtypeForTable($crit['table']); if (($item = getItemForItemtype($crititemtype)) && $item instanceof CommonTreeDropdown) { $criteria[Rule::PATTERN_UNDER] = __('under'); $criteria[Rule::PATTERN_NOT_UNDER] = __('not under'); } } } return $criteria; } /** * Display a dropdown with all the criterias * * @param $itemtype * @param $params array **/ static function dropdownConditions($itemtype, $params=array()) { $p['name'] = 'condition'; $p['criterion'] = ''; $p['allow_conditions'] = array(); $p['value'] = ''; $p['display'] = true; foreach ($params as $key => $value) { $p[$key] = $value; } $elements = array(); foreach (self::getConditions($itemtype, $p['criterion']) as $pattern => $label) { if (empty($p['allow_conditions']) || (!empty($p['allow_conditions']) && in_array($pattern,$p['allow_conditions']))) { $elements[$pattern] = $label; } } return Dropdown::showFromArray($p['name'], $elements, array('value' => $p['value'])); } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnarycomputermodel.class.php000066400000000000000000000042621226600447100242260ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryComputerModel extends RuleDictionnaryDropdown { /** * Constructor **/ function __construct() { parent::__construct('RuleDictionnaryComputerModel'); } /** * @see Rule::getCriterias() **/ function getCriterias() { static $criterias = array(); if (count($criterias)) { return $criterias; } $criterias['name']['field'] = 'name'; $criterias['name']['name'] = __('Model'); $criterias['name']['table'] ='glpi_computermodels'; $criterias['manufacturer']['field'] = 'name'; $criterias['manufacturer']['name'] = __('Manufacturer'); $criterias['manufacturer']['table'] = 'glpi_manufacturers'; return $criterias; } /** * @see Rule::getActions() **/ function getActions() { $actions = array(); $actions['name']['name'] = __('Model'); $actions['name']['force_actions'] = array('append_regex_result', 'assign', 'regex_result'); return $actions; } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnarycomputermodelcollection.class.php000066400000000000000000000037031226600447100263010ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryComputerModelCollection extends RuleDictionnaryDropdownCollection { // From RuleCollection //public $rule_class_name = 'RuleDictionnaryComputerModel'; public $item_table = "glpi_computermodels"; public $menu_option = "model.computer"; // /** // * Constructor // **/ // function __construct() { // // $this->item_table = "glpi_computermodels"; // //Init cache system values // $this->initCache("glpi_rulecachecomputermodels", array("name" => "old_value", // "manufacturer" => "manufacturer")); // $this->menu_option = "model.computer"; // } /** * @see RuleCollection::getTitle() **/ function getTitle() { return __('Dictionnary of computer models'); } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnarycomputertype.class.php000066400000000000000000000036561226600447100241150ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryComputerType extends RuleDictionnaryDropdown { /** * Constructor **/ function __construct() { parent::__construct('RuleDictionnaryComputerType'); } function getCriterias() { static $criterias = array(); if (count($criterias)) { return $criterias; } $criterias['name']['field'] = 'name'; $criterias['name']['name'] = __('Type'); $criterias['name']['table'] = 'glpi_computertypes'; return $criterias; } /** * @see Rule::getActions() **/ function getActions() { $actions = array(); $actions['name']['name'] = __('Type'); $actions['name']['force_actions'] = array('append_regex_result', 'assign','regex_result'); return $actions; } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnarycomputertypecollection.class.php000066400000000000000000000034611226600447100261630ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryComputerTypeCollection extends RuleDictionnaryDropdownCollection { // From RuleCollection //public $rule_class_name = 'RuleDictionnaryComputerType'; public $item_table = "glpi_computertypes"; public $menu_option = "type.computer"; // /** // * Constructor // **/ // function __construct() { // // $this->item_table = "glpi_computertypes"; // //Init cache system values // $this->initCache("glpi_rulecachecomputertypes"); // $this->menu_option = "type.computer"; // } /** * @see RuleCollection::getTitle() **/ function getTitle() { return __('Dictionnary of computer types'); } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnarydropdown.class.php000066400000000000000000000051361226600447100232040ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryDropdown extends Rule { // From Rule static public $right = 'rule_dictionnary_dropdown'; public $can_sort = true; public $show_cache = false; /** * @see Rule::maxActionsCount() **/ function maxActionsCount() { return 1; } // /** // * @see RuleCached::showCacheRuleHeader() // **/ // function showCacheRuleHeader() { // // if ($this->show_cache) { // echo "".__('Cache information')."".$this->fields["name"]. // ""; // echo "".__('Original value').""; // echo "".__('Manufacturer').""; // echo "".__('Modified value').""; // } else { // parent::showCacheRuleHeader(); // } // } // /** // * @see RuleCached::showCacheRuleDetail() // **/ // function showCacheRuleDetail($fields) { // // if ($this->show_cache) { // echo "".$fields["old_value"].""; // echo "".(($fields["manufacturer"] != '')?$fields["manufacturer"]:''). // ""; // echo "".(($fields["new_value"] != '') ? $fields["new_value"] // : __('Unchanged')).""; // } else { // parent::showCacheRuleDetail($fields); // } // } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnarydropdowncollection.class.php000066400000000000000000000232661226600447100252640ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryDropdownCollection extends RuleCollection { // From RuleCollection // public $rule_class_name = 'RuleDictionnaryDropdown'; static public $right = 'rule_dictionnary_dropdown'; public $menu_type = 'dictionnary'; // Specific ones /// dropdown table public $item_table = ""; /** * @see RuleCollection::replayRulesOnExistingDB() **/ function replayRulesOnExistingDB($offset=0, $maxtime=0, $items=array(), $params=array()) { global $DB; // Model check : need to check using manufacturer extra data so specific function if (strpos($this->item_table,'models')) { return $this->replayRulesOnExistingDBForModel($offset, $maxtime); } if (isCommandLine()) { printf(__('Replay rules on existing database started on %s')."\n", date("r")); } // Get All items $Sql = "SELECT * FROM `".$this->item_table."`"; if ($offset) { $Sql .= " LIMIT ".intval($offset).",999999999"; } $result = $DB->query($Sql); $nb = $DB->numrows($result)+$offset; $i = $offset; if ($result && ($nb > $offset)) { // Step to refresh progressbar $step = (($nb > 20) ? floor($nb/20) : 1); $send = array(); $send["tablename"] = $this->item_table; while ($data = $DB->fetch_assoc($result)) { if (!($i % $step)) { if (isCommandLine()) { //TRANS: %1$s is a row, %2$s is total rows printf(__('Replay rules on existing database: %1$s/%2$s')."\r", $i, $nb); } else { Html::changeProgressBarPosition($i, $nb, "$i / $nb"); } } //Replay Type dictionnary $ID = Dropdown::importExternal(getItemTypeForTable($this->item_table), addslashes($data["name"]), -1, array(), addslashes($data["comment"])); if ($data['id'] != $ID) { $tomove[$data['id']] = $ID; $type = GetItemTypeForTable($this->item_table); if ($dropdown = getItemForItemtype($type)) { $dropdown->delete(array('id' => $data['id'], '_replace_by' => $ID)); } } $i++; if ($maxtime) { $crt = explode(" ", microtime()); if (($crt[0]+$crt[1]) > $maxtime) { break; } } } // end while } if (isCommandLine()) { printf(__('Replay rules on existing database started on %s')."\n", date("r")); } else { Html::changeProgressBarPosition($i, $nb, "$i / $nb"); } return (($i == $nb) ? -1 : $i); } /** * Replay collection rules on an existing DB for model dropdowns * * @param $offset offset used to begin (default 0) * @param $maxtime maximum time of process (reload at the end) (default 0) * * @return -1 on completion else current offset **/ function replayRulesOnExistingDBForModel($offset=0, $maxtime=0) { global $DB; if (isCommandLine()) { printf(__('Replay rules on existing database started on %s')."\n", date("r")); } // Model check : need to check using manufacturer extra data if (strpos($this->item_table,'models') === false) { _e('Error replaying rules'); return false; } $model_table = getPlural(str_replace('models', '', $this->item_table)); $model_field = getForeignKeyFieldForTable($this->item_table); // Need to give manufacturer from item table $Sql = "SELECT DISTINCT `glpi_manufacturers`.`id` AS idmanu, `glpi_manufacturers`.`name` AS manufacturer, `".$this->item_table."`.`id`, `".$this->item_table."`.`name` AS name, `".$this->item_table."`.`comment` FROM `".$this->item_table."`, `$model_table` LEFT JOIN `glpi_manufacturers` ON (`$model_table`.`manufacturers_id` = `glpi_manufacturers`.`id`) WHERE `$model_table`.`$model_field` = `".$this->item_table."`.`id`"; if ($offset) { $Sql .= " LIMIT ".intval($offset).",999999999"; } $result = $DB->query($Sql); $nb = $DB->numrows($result)+$offset; $i = $offset; if ($result && ($nb > $offset)) { // Step to refresh progressbar $step = (($nb > 20) ? floor($nb/20) : 1); $tocheck = array(); while ($data = $DB->fetch_assoc($result)) { if (!($i % $step)) { if (isCommandLine()) { printf(__('Replay rules on existing database: %1$s/%2$s')."\r", $i, $nb); } else { Html::changeProgressBarPosition($i, $nb, "$i / $nb"); } } // Model case if (isset($data["manufacturer"])) { $data["manufacturer"] = Manufacturer::processName(addslashes($data["manufacturer"])); } //Replay Type dictionnary $ID = Dropdown::importExternal(getItemTypeForTable($this->item_table), addslashes($data["name"]), -1, $data, addslashes($data["comment"])); if ($data['id'] != $ID) { $tocheck[$data["id"]][] = $ID; $sql = "UPDATE `$model_table` SET `$model_field` = '$ID' WHERE `$model_field` = '".$data['id']."'"; if (empty($data['idmanu'])) { $sql .= " AND (`manufacturers_id` IS NULL OR `manufacturers_id` = '0')"; } else { $sql .= " AND `manufacturers_id` = '".$data['idmanu']."'"; } $DB->query($sql); } $i++; if ($maxtime) { $crt = explode(" ",microtime()); if (($crt[0]+$crt[1]) > $maxtime) { break; } } } foreach ($tocheck AS $ID => $tab) { $sql = "SELECT COUNT(*) FROM `$model_table` WHERE `$model_field` = '$ID'"; $result = $DB->query($sql); $deletecartmodel = false; // No item left : delete old item if ($result && ($DB->result($result,0,0) == 0)) { $Sql = "DELETE FROM `".$this->item_table."` WHERE `id` = '$ID'"; $resdel = $DB->query($Sql); $deletecartmodel = true; } // Manage cartridge assoc Update items if ($this->getRuleClassName()=='RuleDictionnaryPrinterModel') { $sql = "SELECT * FROM `glpi_cartridgeitems_printermodels` WHERE `printermodels_id` = '$ID'"; if ($result = $DB->query($sql)) { if ($DB->numrows($result)) { // Get compatible cartridge type $carttype = array(); while ($data = $DB->fetch_assoc($result)) { $carttype[] = $data['cartridgeitems_id']; } // Delete cartrodges_assoc if ($deletecartmodel) { $sql = "DELETE FROM `glpi_cartridgeitems_printermodels` WHERE `printermodels_id` = 'id'"; $DB->query($sql); } // Add new assoc $ct = new CartridgeItem(); foreach ($carttype as $cartID) { foreach ($tab as $model) { $ct->addCompatibleType($cartID, $model); } } } } } } // each tocheck } if (isCommandLine()) { printf(__('Replay rules on existing database ended on %s')."\n", date("r")); } else { Html::changeProgressBarPosition($i, $nb, "$i / $nb"); } return ($i==$nb ? -1 : $i); } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnarymanufacturer.class.php000066400000000000000000000037531226600447100240470ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryManufacturer extends RuleDictionnaryDropdown { /** * Constructor **/ function __construct() { parent::__construct('RuleDictionnaryManufacturer'); } /** * @see Rule::getCriterias() **/ function getCriterias() { static $criterias = array(); if (count($criterias)) { return $criterias; } $criterias['name']['field'] = 'name'; $criterias['name']['name'] = __('Manufacturer'); $criterias['name']['table'] = 'glpi_manufacturers'; return $criterias; } /** * @see Rule::getActions() **/ function getActions() { $actions = array(); $actions['name']['name'] = __('Manufacturer'); $actions['name']['force_actions'] = array('append_regex_result', 'assign','regex_result'); return $actions; } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnarymanufacturercollection.class.php000066400000000000000000000034611226600447100261170ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryManufacturerCollection extends RuleDictionnaryDropdownCollection { // From RuleCollection //public $rule_class_name = 'RuleDictionnaryManufacturer'; public $item_table = "glpi_manufacturers"; public $menu_option = "manufacturers"; // /** // * Constructor // **/ // function __construct() { // // $this->item_table = "glpi_manufacturers"; // //Init cache system values // $this->initCache("glpi_rulecachemanufacturers"); // $this->menu_option = "manufacturers"; // } /** * @see RuleCollection::getTitle() **/ function getTitle() { return __('Dictionary of manufacturers'); } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnarymonitormodel.class.php000066400000000000000000000042551226600447100240610ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryMonitorModel extends RuleDictionnaryDropdown { /** * Constructor **/ function __construct() { parent::__construct('RuleDictionnaryMonitorModel'); } /** * @see Rule::getCriterias() **/ function getCriterias() { static $criterias = array(); if (count($criterias)) { return $criterias; } $criterias['name']['field'] = 'name'; $criterias['name']['name'] = __('Model'); $criterias['name']['table'] = 'glpi_monitormodels'; $criterias['manufacturer']['field'] = 'name'; $criterias['manufacturer']['name'] = __('Manufacturer'); $criterias['manufacturer']['table'] = 'glpi_manufacturers'; return $criterias; } /** * @see Rule::getActions() **/ function getActions() { $actions = array(); $actions['name']['name'] = __('Model'); $actions['name']['force_actions'] = array('append_regex_result', 'assign','regex_result'); return $actions; } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnarymonitormodelcollection.class.php000066400000000000000000000035361226600447100261360ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryMonitorModelCollection extends RuleDictionnaryDropdownCollection { public $item_table = "glpi_monitormodels"; public $menu_option = "model.monitor"; // /** // * Constructor // **/ // function __construct() { // // $this->item_table = "glpi_monitormodels"; // //Init cache system values // $this->initCache("glpi_rulecachemonitormodels", array("name" => "old_value", // "manufacturer" => "manufacturer")); // $this->menu_option = "model.monitor"; // } /** * @see RuleCollection::getTitle() **/ function getTitle() { return __('Dictionnary of computer models'); } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnarymonitortype.class.php000066400000000000000000000037311226600447100237400ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryMonitorType extends RuleDictionnaryDropdown { /** * Constructor **/ function __construct() { parent::__construct('RuleDictionnaryMonitorType'); } /** * @see Rule::getCriterias() **/ function getCriterias() { static $criterias = array(); if (count($criterias)) { return $criterias; } $criterias['name']['field'] = 'name'; $criterias['name']['name'] = __('Type'); $criterias['name']['table'] = 'glpi_monitortypes'; return $criterias; } /** * @see Rule::getActions() **/ function getActions() { $actions = array(); $actions['name']['name'] = __('Type'); $actions['name']['force_actions'] = array('append_regex_result', 'assign', 'regex_result'); return $actions; } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnarymonitortypecollection.class.php000066400000000000000000000034511226600447100260130ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryMonitorTypeCollection extends RuleDictionnaryDropdownCollection { // From RuleCollection //public $rule_class_name = 'RuleDictionnaryMonitorType'; public $item_table = "glpi_monitortypes"; public $menu_option = "type.monitor"; // /** // * Constructor // **/ // function __construct() { // // $this->item_table = "glpi_monitortypes"; // //Init cache system values // $this->initCache("glpi_rulecachemonitortypes"); // $this->menu_option = "type.monitor"; // } /** * @see RuleCollection::getTitle() **/ function getTitle() { return __('Dictionnary of monitor types'); } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnarynetworkequipmentmodel.class.php000066400000000000000000000043211226600447100260050ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryNetworkEquipmentModel extends RuleDictionnaryDropdown { /** * Constructor **/ function __construct() { parent::__construct('RuleDictionnaryNetworkEquipmentModel'); } /** * @see Rule::getCriterias() **/ function getCriterias() { static $criterias = array(); if (count($criterias)) { return $criterias; } $criterias['name']['field'] = 'name'; $criterias['name']['name'] = __('Model'); $criterias['name']['table'] = 'glpi_networkequipmentmodels'; $criterias['manufacturer']['field'] = 'name'; $criterias['manufacturer']['name'] = __('Manufacturer'); $criterias['manufacturer']['table'] = 'glpi_manufacturers'; return $criterias; } /** * @see Rule::getActions() **/ function getActions() { $actions = array(); $actions['name']['name'] = __('Model'); $actions['name']['force_actions'] = array('append_regex_result', 'assign', 'regex_result'); return $actions; } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnarynetworkequipmentmodelcollection.class.php000066400000000000000000000037001226600447100300610ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryNetworkEquipmentModelCollection extends RuleDictionnaryDropdownCollection { public $item_table = "glpi_networkequipmentmodels"; public $menu_option = "model.networking"; // /** // * Constructor // **/ // function __construct() { // // $this->item_table = "glpi_networkequipmentmodels"; // $this->initCache("glpi_rulecachenetworkequipmentmodels", // array("name" => "old_value", // "manufacturer" => "manufacturer")); // $this->menu_option = "model.networking"; // //$this->rule_class_name = 'RuleDictionnaryNetworkEquipmentModel'; // } /** * @see RuleCollection::getTitle() **/ function getTitle() { return __('Dictionnary of networking equipment models'); } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnarynetworkequipmenttype.class.php000066400000000000000000000037751226600447100257020ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryNetworkEquipmentType extends RuleDictionnaryDropdown { /** * Constructor **/ function __construct() { parent::__construct('RuleDictionnaryNetworkEquipmentType'); } /** * @see Rule::getCriterias() **/ function getCriterias() { static $criterias = array(); if (count($criterias)) { return $criterias; } $criterias['name']['field'] = 'name'; $criterias['name']['name'] = __('Type'); $criterias['name']['table'] = 'glpi_networkequipmenttypes'; return $criterias; } /** * @see Rule::getActions() **/ function getActions() { $actions = array(); $actions['name']['name'] = __('Type'); $actions['name']['force_actions'] = array('append_regex_result', 'assign', 'regex_result'); return $actions; } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnarynetworkequipmenttypecollection.class.php000066400000000000000000000033531226600447100277460ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryNetworkEquipmentTypeCollection extends RuleDictionnaryDropdownCollection { public $item_table = "glpi_networkequipmenttypes"; public $menu_option = "type.networking"; // /** // * Constructor // **/ // function __construct() { // // $this->item_table = "glpi_networkequipmenttypes"; // $this->initCache("glpi_rulecachenetworkequipmenttypes"); // $this->menu_option = "type.networking"; // } /** * @see RuleCollection::getTitle() **/ function getTitle() { return __('Dictionnary of network equipment types'); } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnaryoperatingsystem.class.php000066400000000000000000000037221226600447100246040ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryOperatingSystem extends RuleDictionnaryDropdown { /** * Constructor **/ function __construct() { parent::__construct('RuleDictionnaryOperatingSystem'); } function getCriterias() { static $criterias = array(); if (count($criterias)) { return $criterias; } $criterias['name']['field'] = 'name'; $criterias['name']['name'] = __('Operating system'); $criterias['name']['table'] = 'glpi_operatingsystems'; return $criterias; } /** * @see Rule::getActions() **/ function getActions() { $actions = array(); $actions['name']['name'] = __('Operating system'); $actions['name']['force_actions'] = array('append_regex_result', 'assign', 'regex_result'); return $actions; } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnaryoperatingsystemcollection.class.php000066400000000000000000000032571226600447100266630ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryOperatingSystemCollection extends RuleDictionnaryDropdownCollection { public $item_table = "glpi_operatingsystems"; public $menu_option = "os"; // /** // * Constructor // **/ // function __construct() { // // $this->item_table = "glpi_operatingsystems"; // $this->initCache("glpi_rulecacheoperatingsystems"); // $this->menu_option = "os"; // } /** * @see RuleCollection::getTitle() **/ function getTitle() { return __('Dictionnary of operating systems'); } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnaryoperatingsystemservicepack.class.php000066400000000000000000000040451226600447100270230ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryOperatingSystemServicePack extends RuleDictionnaryDropdown { /** * Constructor **/ function __construct() { parent::__construct('RuleDictionnaryOperatingSystemServicePack'); } /** * @see Rule::getCriterias() **/ function getCriterias() { static $criterias = array(); if (count($criterias)) { return $criterias; } $criterias['name']['field'] = 'name'; $criterias['name']['name'] = __('Service pack'); $criterias['name']['table'] = 'glpi_operatingsystemservicepacks'; return $criterias; } /** * @see Rule::getActions() **/ function getActions() { $actions = array(); $actions['name']['name'] = __('Service pack'); $actions['name']['force_actions'] = array('append_regex_result', 'assign', 'regex_result'); return $actions; } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnaryoperatingsystemservicepackcollection.class.php000066400000000000000000000033471226600447100311030ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryOperatingSystemServicePackCollection extends RuleDictionnaryDropdownCollection { public $item_table = "glpi_operatingsystemservicepacks"; public $menu_option = "os_sp"; // /** // * Constructor // **/ // function __construct() { // // $this->item_table = "glpi_operatingsystemservicepacks"; // $this->initCache("glpi_rulecacheoperatingsystemservicepacks"); // $this->menu_option = "os_sp"; // } /** * @see RuleCollection::getTitle() **/ function getTitle() { return __('Dictionnary of service packs'); } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnaryoperatingsystemversion.class.php000066400000000000000000000040471226600447100262130ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryOperatingSystemVersion extends RuleDictionnaryDropdown { /** * Constructor **/ function __construct() { parent::__construct('RuleDictionnaryOperatingSystemVersion'); } /** * @see Rule::getCriterias() **/ function getCriterias() { static $criterias = array(); if (count($criterias)) { return $criterias; } $criterias['name']['field'] = 'name'; $criterias['name']['name'] = _n('Version', 'Versions',1); $criterias['name']['table'] = 'glpi_operatingsystemversions'; return $criterias; } /** * @see Rule::getActions() **/ function getActions() { $actions = array(); $actions['name']['name'] = _n('Version', 'Versions',1); $actions['name']['force_actions'] = array('append_regex_result', 'assign', 'regex_result'); return $actions; } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnaryoperatingsystemversioncollection.class.php000066400000000000000000000033531226600447100302660ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryOperatingSystemVersionCollection extends RuleDictionnaryDropdownCollection { public $item_table = "glpi_operatingsystemversions"; public $menu_option = "os_version"; // /** // * Constructor // **/ // function __construct() { // // $this->item_table = "glpi_operatingsystemversions"; // $this->initCache("glpi_rulecacheoperatingsystemversions"); // $this->menu_option = "os_version"; // } /** * @see RuleCollection::getTitle() **/ function getTitle() { return __('Dictionnary of operating system versions'); } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnaryperipheralmodel.class.php000066400000000000000000000042721226600447100245240ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryPeripheralModel extends RuleDictionnaryDropdown { /** * Constructor **/ function __construct() { parent::__construct('RuleDictionnaryPeripheralModel'); } /** * @see Rule::getCriterias() **/ function getCriterias() { static $criterias = array(); if (count($criterias)) { return $criterias; } $criterias['name']['field'] = 'name'; $criterias['name']['name'] = __('Model'); $criterias['name']['table'] = 'glpi_peripheralmodels'; $criterias['manufacturer']['field'] = 'name'; $criterias['manufacturer']['name'] = __('Manufacturer'); $criterias['manufacturer']['table'] = 'glpi_manufacturers'; return $criterias; } /** * @see Rule::getActions() **/ function getActions() { $actions = array(); $actions['name']['name'] = __('Model'); $actions['name']['force_actions'] = array('append_regex_result', 'assign', 'regex_result'); return $actions; } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnaryperipheralmodelcollection.class.php000066400000000000000000000035231226600447100265760ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryPeripheralModelCollection extends RuleDictionnaryDropdownCollection { public $item_table = "glpi_peripheralmodels"; public $menu_option = "model.peripheral"; // /** // * Constructor // **/ // function __construct() { // // $this->item_table = "glpi_peripheralmodels"; // $this->initCache("glpi_rulecacheperipheralmodels", array("name" => "old_value", // "manufacturer" => "manufacturer")); // $this->menu_option = "model.peripheral"; // } /** * @see RuleCollection::getTitle() **/ function getTitle() { return __('Dictionnary of device models'); } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnaryperipheraltype.class.php000066400000000000000000000037451226600447100244110ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryPeripheralType extends RuleDictionnaryDropdown { /** * Constructor **/ function __construct() { parent::__construct('RuleDictionnaryPeripheralType'); } /** * @see Rule::getCriterias() **/ function getCriterias() { static $criterias = array(); if (count($criterias)) { return $criterias; } $criterias['name']['field'] = 'name'; $criterias['name']['name'] = __('Type'); $criterias['name']['table'] = 'glpi_peripheraltypes'; return $criterias; } /** * @see Rule::getActions() **/ function getActions() { $actions = array(); $actions['name']['name'] = __('Type'); $actions['name']['force_actions'] = array('append_regex_result', 'assign', 'regex_result'); return $actions; } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnaryperipheraltypecollection.class.php000066400000000000000000000032761226600447100264640ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryPeripheralTypeCollection extends RuleDictionnaryDropdownCollection { public $item_table = "glpi_peripheraltypes"; public $menu_option = "type.peripheral"; // /** // * Constructor // **/ // function __construct() { // // $this->item_table = "glpi_peripheraltypes"; // $this->initCache("glpi_rulecacheperipheraltypes"); // $this->menu_option = "type.peripheral"; // } /** * @see RuleCollection::getTitle() **/ function getTitle() { return __('Dictionnary of device types'); } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnaryphonemodel.class.php000066400000000000000000000042461226600447100235030ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryPhoneModel extends RuleDictionnaryDropdown { /** * Constructor **/ function __construct() { parent::__construct('RuleDictionnaryPhoneModel'); } /** * @see Rule::getCriterias() **/ function getCriterias() { static $criterias = array(); if (count($criterias)) { return $criterias; } $criterias['name']['field'] = 'name'; $criterias['name']['name'] = __('Model'); $criterias['name']['table'] = 'glpi_phonemodels'; $criterias['manufacturer']['field'] = 'name'; $criterias['manufacturer']['name'] = __('Manufacturer'); $criterias['manufacturer']['table'] = 'glpi_manufacturers'; return $criterias; } /** * @see Rule::getActions() **/ function getActions() { $actions = array(); $actions['name']['name'] = __('Model'); $actions['name']['force_actions'] = array('append_regex_result', 'assign', 'regex_result'); return $actions; } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnaryphonemodelcollection.class.php000066400000000000000000000034471226600447100255610ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryPhoneModelCollection extends RuleDictionnaryDropdownCollection { public $item_table = "glpi_phonemodels"; public $menu_option = "model.phone"; // /** // * Constructor // **/ // function __construct() { // // $this->item_table = "glpi_phonemodels"; // $this->initCache("glpi_rulecachephonemodels", array("name" => "old_value", // "manufacturer" => "manufacturer")); // $this->menu_option = "model.phone"; // } /** * @see RuleCollection::getTitle() **/ function getTitle() { return __('Dictionnary of phone models'); } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnaryphonetype.class.php000066400000000000000000000037211226600447100233610ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryPhoneType extends RuleDictionnaryDropdown { /** * Constructor **/ function __construct() { parent::__construct('RuleDictionnaryPhoneType'); } /** * @see Rule::getCriterias() **/ function getCriterias() { static $criterias = array(); if (count($criterias)) { return $criterias; } $criterias['name']['field'] = 'name'; $criterias['name']['name'] = __('Type'); $criterias['name']['table'] = 'glpi_phonetypes'; return $criterias; } /** * @see Rule::getActions() **/ function getActions() { $actions = array(); $actions['name']['name'] = __('Type'); $actions['name']['force_actions'] = array('append_regex_result', 'assign', 'regex_result'); return $actions; } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnaryphonetypecollection.class.php000066400000000000000000000032321226600447100254320ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryPhoneTypeCollection extends RuleDictionnaryDropdownCollection { public $item_table = "glpi_phonetypes"; public $menu_option = "type.phone"; // /** // * Constructor // **/ // function __construct() { // // $this->item_table = "glpi_phonetypes"; // $this->initCache("glpi_rulecachephonetypes"); // $this->menu_option = "type.phone"; // } /** * @see RuleCollection::getTitle() **/ function getTitle() { return __('Dictionnary of phone types'); } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnaryprinter.class.php000066400000000000000000000117541226600447100230360ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Rule class store all information about a GLPI rule : * - description * - criterias * - actions **/ class RuleDictionnaryPrinter extends Rule { // From Rule static public $right = 'rule_dictionnary_printer'; public $can_sort = true; function getTitle() { return __('Dictionnary of printers'); } /** * @see Rule::maxActionsCount() **/ function maxActionsCount() { return 4; } // /** // * @see RuleCached::showCacheRuleHeader() // **/ // function showCacheRuleHeader() { // // echo "" . __('Cache information') . ""; // echo "" . $this->fields["name"]; // echo ""; // // echo "" . __('Original value') . ""; // echo "" . __('Original manufacturer').""; // echo "" . __('Modified value') . ""; // echo "" . __('Management type') . ""; // echo "" . __('New manufacturer').""; // echo "" . __('To be unaware of import') . ""; // } // // // /** // * @see RuleCached::showCacheRuleDetail() // **/ // function showCacheRuleDetail($fields) { // // echo "" . $fields["old_value"] . ""; // echo "" . $fields["manufacturer"] . ""; // echo "". (($fields["new_value"] != '') ? $fields["new_value"] // : __('Unchanged')).""; // echo "". // (($fields["is_global"] != '') ? Dropdown::getGlobalSwitch($fields["is_global"]) // : __('Unchanged')) . ""; // echo "" . // ((isset($fields["new_manufacturer"]) && ($fields["new_manufacturer"] != '')) // ? Dropdown::getDropdownName("glpi_manufacturers", $fields["new_manufacturer"]) // : __('Unchanged')) . ""; // echo ""; // // if ($fields["ignore_import"] == '') { // echo " "; // } else { // echo Dropdown::getYesNo($fields["ignore_import"]); // } // echo ""; // } /** * @see Rule::getCriterias() **/ function getCriterias() { static $criterias = array(); if (count($criterias)) { return $criterias; } $criterias['name']['field'] = 'name'; $criterias['name']['name'] = __('Name'); $criterias['name']['table'] = 'glpi_printers'; $criterias['manufacturer']['field'] = 'name'; $criterias['manufacturer']['name'] = __('Manufacturer'); $criterias['manufacturer']['table'] = ''; $criterias['comment']['field'] = 'comment'; $criterias['comment']['name'] = __('Comments'); $criterias['comment']['table'] = ''; return $criterias; } /** * @see Rule::getActions() **/ function getActions() { $actions = array(); $actions['name']['name'] = __('Name'); $actions['name']['force_actions'] = array('assign', 'regex_result'); $actions['_ignore_import']['name'] = __('To be unaware of import'); $actions['_ignore_import']['type'] = 'yesonly'; $actions['manufacturer']['name'] = __('Manufacturer'); $actions['manufacturer']['table'] = 'glpi_manufacturers'; $actions['manufacturer']['type'] = 'dropdown'; $actions['is_global']['name'] = __('Management type'); $actions['is_global']['type'] = 'dropdown_management'; return $actions; } } ?>glpi-0.84.3+dfsg.1/inc/ruledictionnaryprintercollection.class.php000066400000000000000000000275751226600447100251220ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class RuleDictionnaryPrinterCollection extends RuleCollection { // From RuleCollection public $stop_on_first_match = true; static public $right = 'rule_dictionnary_printer'; public $menu_type = 'dictionnary'; public $menu_option = 'printer'; // /** // * Constructor // **/ // function __construct() { // // //Init cache system values // $this->initCache("glpi_rulecacheprinters", // array("name" => "old_value", // "manufacturer" => "manufacturer"), // array("name" => "new_value", // "manufacturer" => "new_manufacturer", // "_ignore_import" => "ignore_import", // "is_global" => "is_global")); // } /** * @see RuleCollection::getTitle() **/ function getTitle() { return __('Dictionnary of printers'); } /** * @see RuleCollection::cleanTestOutputCriterias() **/ function cleanTestOutputCriterias(array $output) { //If output array contains keys begining with _ : drop it foreach ($output as $criteria => $value) { if (($criteria[0] == '_') && ($criteria != '_ignore_import')) { unset ($output[$criteria]); } } return $output; } /** * @see RuleCollection::replayRulesOnExistingDB() **/ function replayRulesOnExistingDB($offset=0, $maxtime=0, $items=array(), $params=array()) { global $DB; if (isCommandLine()) { printf(__('Replay rules on existing database started on %s')."\n", date("r")); } $nb = 0; $i = $offset; //Select all the differents software $sql = "SELECT DISTINCT `glpi_printers`.`name`, `glpi_manufacturers`.`name` AS manufacturer, `glpi_printers`.`manufacturers_id` AS manufacturers_id, `glpi_printers`.`comment` AS comment FROM `glpi_printers` LEFT JOIN `glpi_manufacturers` ON (`glpi_manufacturers`.`id` = `glpi_printers`.`manufacturers_id`) "; // Do not replay on dustbin and templates $sql .= "WHERE `glpi_printers`.`is_deleted` = '0' AND `glpi_printers`.`is_template` = '0' "; if ($offset) { $sql .= " LIMIT " . intval($offset) . ",999999999"; } $res = $DB->query($sql); $nb = $DB->numrows($res) + $offset; $step = (($nb > 1000) ? 50 : (($nb > 20) ? floor($DB->numrows($res) / 20) : 1)); while ($input = $DB->fetch_assoc($res)) { if (!($i % $step)) { if (isCommandLine()) { //TRANS: %1$s is a date, %2$s is a row, %3$s is total row, %4$s is memory printf(__('%1$s - replay rules on existing database: %2$s/%3$s (%4$s Mio)')."\n", date("H:i:s"), $i, $nb, round(memory_get_usage() / (1024 * 1024), 2)); } else { Html::changeProgressBarPosition($i, $nb, "$i / $nb"); } } //Replay printer dictionnary rules $res_rule = $this->processAllRules($input, array(), array()); foreach (array('manufacturer', 'is_global', 'name') as $attr) { if (isset($res_rule[$attr]) && ($res_rule[$attr] == '')) { unset($res_rule[$attr]); } } //If the software's name or version has changed if (self::somethingHasChanged($res_rule, $input)) { $IDs = array(); //Find all the printers in the database with the same name and manufacturer $sql = "SELECT `id` FROM `glpi_printers` WHERE `name` = '" . $input["name"] . "' AND `manufacturers_id` = '" . $input["manufacturers_id"] . "'"; $res_printer = $DB->query($sql); if ($DB->numrows($res_printer) > 0) { //Store all the printer's IDs in an array while ($result = $DB->fetch_assoc($res_printer)) { $IDs[] = $result["id"]; } //Replay dictionnary on all the printers $this->replayDictionnaryOnPrintersByID($IDs, $res_rule); } } $i++; if ($maxtime) { $crt = explode(" ", microtime()); if ($crt[0] + $crt[1] > $maxtime) { break; } } } if (isCommandLine()) { printf(__('Replay rules on existing database: %1$s/%2$s')."\n", $i, $nb); } else { Html::changeProgressBarPosition($i, $nb, "$i / $nb"); } if (isCommandLine()) { printf(__('Replay rules on existing database ended on %s')."\n", date("r")); } return (($i == $nb) ? -1 : $i); } /** * @param $res_rule array * @param $input array **/ static function somethingHasChanged(array $res_rule, array $input) { if ((isset($res_rule["name"]) && ($res_rule["name"] != $input["name"])) || (isset($res_rule["manufacturer"]) && ($res_rule["manufacturer"] != '')) || (isset($res_rule['is_global']) && ($res_rule['is_global'] != ''))) { return true; } return false; } /** * Replay dictionnary on several printers * * @param $IDs array of printers IDs to replay * @param $res_rule array of rule results * * @return Query result handler **/ function replayDictionnaryOnPrintersByID(array $IDs, $res_rule=array()) { global $DB; $new_printers = array(); $delete_ids = array(); foreach ($IDs as $ID) { $sql = "SELECT `glpi_printers`.`id`, `glpi_printers`.`name` AS name, `glpi_printers`.`entities_id` AS entities_id, `glpi_printers`.`is_global` AS is_global, `glpi_manufacturers`.`name` AS manufacturer FROM `glpi_printers` LEFT JOIN `glpi_manufacturers` ON (`glpi_printers`.`manufacturers_id` = `glpi_manufacturers`.`id`) WHERE `glpi_printers`.`is_template` = '0' AND `glpi_printers`.`id` = '$ID'"; $res_printer = $DB->query($sql); if ($DB->numrows($res_printer)) { $printer = $DB->fetch_assoc($res_printer); //For each printer $this->replayDictionnaryOnOnePrinter($new_printers, $res_rule, $printer, $delete_ids); } } //Delete printer if needed $this->putOldPrintersInTrash($delete_ids); } /** * @param $IDS array */ function putOldPrintersInTrash($IDS=array()) { $printer = new Printer(); foreach ($IDS as $id) { $printer->delete(array('id' => $id)); } } /** * Replay dictionnary on one printer * * @param &$new_printers array containing new printers already computed * @param $res_rule array of rule results * @param $params array * @param &$printers_ids array containing replay printer need to be dustbined **/ function replayDictionnaryOnOnePrinter(array &$new_printers, array $res_rule, $params=array(), array &$printers_ids) { global $DB; $p['id'] = 0; $p['name'] = ''; $p['manufacturer'] = ''; $p['is_global'] = ''; $p['entity'] = 0; foreach ($params as $key => $value) { $p[$key] = $value; } $input["name"] = $p['name']; $input["manufacturer"] = $p['manufacturer']; if (empty($res_rule)) { $res_rule = $this->processAllRules($input, array(), array()); } $printer = new Printer(); //Printer's name has changed if (isset($res_rule["name"]) && ($res_rule["name"] != $p['name'])) { $manufacturer = ""; if (isset($res_rule["manufacturer"])) { $manufacturer = addslashes(Dropdown::getDropdownName("glpi_manufacturers", $res_rule["manufacturer"])); } else { $manufacturer = addslashes($p['manufacturer']); } //New printer not already present in this entity if (!isset($new_printers[$p['entity']][$res_rule["name"]])) { // create new printer or restore it from dustbin $new_printer_id = $printer->addOrRestoreFromTrash($res_rule["name"], $manufacturer, $p['entity']); $new_printers[$p['entity']][$res_rule["name"]] = $new_printer_id; } else { $new_printer_id = $new_printers[$p['entity']][$res_rule["name"]]; } // Move direct connections $this->moveDirectConnections($p['id'], $new_printer_id); } else { $new_printer_id = $p['id']; $res_rule["id"] = $p['id']; if (isset($res_rule["manufacturer"])) { if ($res_rule["manufacturer"] != '') { $res_rule["manufacturers_id"] = $res_rule["manufacturer"]; } unset($res_rule["manufacturer"]); } $printer->update($res_rule); } // Add to printer to deleted list if ($new_printer_id != $p['id']) { $printers_ids[] = $p['id']; } } /** * Move direct connections from old printer to the new one * * @param $ID the old printer's id * @param $new_printers_id the new printer's id * * @return nothing **/ function moveDirectConnections($ID, $new_printers_id) { global $DB; $computeritem = new Computer_Item(); //For each direct connection of this printer foreach (getAllDatasFromTable("glpi_computers_items", "`itemtype` = 'Printer' AND `items_id` = '$ID'") as $connection) { //Direct connection exists in the target printer ? if (!countElementsInTable("glpi_computers_items", "`itemtype` = 'Printer' AND `items_id` = '$new_printers_id' AND `computers_id`='".$connection["computers_id"]."'")) { //Direct connection doesn't exists in the target printer : move it $computeritem->update(array ('id' => $connection['id'], 'items_id' => $new_printers_id)); } else { //Direct connection already exists in the target printer : delete it $computeritem->delete($connection); } } } } ?>glpi-0.84.3+dfsg.1/inc/ruledictionnaryprintermodel.class.php000066400000000000000000000042551226600447100240550ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryPrinterModel extends RuleDictionnaryDropdown { /** * Constructor **/ function __construct() { parent::__construct('RuleDictionnaryPrinterModel'); } /** * @see Rule::getCriterias() **/ function getCriterias() { static $criterias = array(); if (count($criterias)) { return $criterias; } $criterias['name']['field'] = 'name'; $criterias['name']['name'] = __('Model'); $criterias['name']['table'] = 'glpi_printermodels'; $criterias['manufacturer']['field'] = 'name'; $criterias['manufacturer']['name'] = __('Manufacturer'); $criterias['manufacturer']['table'] = 'glpi_manufacturers'; return $criterias; } /** * @see Rule::getActions() **/ function getActions() { $actions = array(); $actions['name']['name'] = __('Model'); $actions['name']['force_actions'] = array('assign', 'regex_result', 'append_regex_result'); return $actions; } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnaryprintermodelcollection.class.php000066400000000000000000000035341226600447100261300ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryPrinterModelCollection extends RuleDictionnaryDropdownCollection { public $item_table = "glpi_printermodels"; public $menu_option = "model.printer"; // /** // * Constructor // **/ // function __construct() { // // $this->item_table = "glpi_printermodels"; // //Init cache system values // $this->initCache("glpi_rulecacheprintermodels", array("name" => "old_value", // "manufacturer" => "manufacturer")); // $this->menu_option="model.printer"; // } /** * @see RuleCollection::getTitle() **/ function getTitle() { return __('Dictionnary of printer models'); } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnaryprintertype.class.php000066400000000000000000000037311226600447100237340ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryPrinterType extends RuleDictionnaryDropdown { /** * Constructor **/ function __construct() { parent::__construct('RuleDictionnaryPrinterType'); } /** * @see Rule::getCriterias() **/ function getCriterias() { static $criterias = array(); if (count($criterias)) { return $criterias; } $criterias['name']['field'] = 'name'; $criterias['name']['name'] = __('Type'); $criterias['name']['table'] = 'glpi_printertypes'; return $criterias; } /** * @see Rule::getActions() **/ function getActions() { $actions = array(); $actions['name']['name'] = __('Type'); $actions['name']['force_actions'] = array('assign', 'regex_result', 'append_regex_result'); return $actions; } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnaryprintertypecollection.class.php000066400000000000000000000032521226600447100260060ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ class RuleDictionnaryPrinterTypeCollection extends RuleDictionnaryDropdownCollection { public $item_table = "glpi_printertypes"; public $menu_option = "type.printer"; // /** // * Constructor // **/ // function __construct() { // // $this->item_table = "glpi_printertypes"; // $this->initCache("glpi_rulecacheprintertypes"); // $this->menu_option = "type.printer"; // } /** * @see RuleCollection::getTitle() **/ function getTitle() { return __('Dictionnary of printer types'); } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnarysoftware.class.php000066400000000000000000000176371226600447100232130ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Rule class store all information about a GLPI rule : * - description * - criterias * - actions **/ class RuleDictionnarySoftware extends Rule { var $additional_fields_for_dictionnary = array('manufacturer'); // From Rule static public $right = 'rule_dictionnary_software'; public $can_sort = true; /** * @see Rule::getTitle() **/ function getTitle() { //TRANS: plural for software return __('Dictionnary of software'); } /** * @see Rule::maxActionsCount() **/ function maxActionsCount() { return 4; } // /** // * @see RuleCached::showCacheRuleHeader() // **/ // function showCacheRuleHeader() { // // echo "" . __('Cache information') . ""; // echo "" . $this->fields["name"]; // echo ""; // // echo "" . __('Original value') . ""; // echo "" . __('Original entity value').""; // echo "" . __('Original publisher').""; // echo "" . __('Modified value') . ""; // echo "" . _n('Version', 'Versions', 1) . ""; // echo "" . __('New publisher') . ""; // echo "" . __('To be unaware of import') . ""; // echo "" . __('Associable to a ticket') . "\n"; // echo "" . __('Destination entity') . "\n"; // } // // // /** // * @see RuleCached::showCacheRuleDetail() // **/ // function showCacheRuleDetail($fields) { // // echo "" . $fields["old_value"] . ""; // echo "" . Dropdown::getDropdownName("glpi_entities", // $fields["entities_id"]) .""; // echo "" . $fields["manufacturer"] . ""; // echo "".(($fields["new_value"] != '') ? $fields["new_value"] // : __('Unchanged')).""; // echo "". (($fields["version"] != '') ? $fields["version"] // : __('Unchanged')).""; // echo "". // ((isset($fields["new_manufacturer"]) && ($fields["new_manufacturer"] != '')) // ? Dropdown::getDropdownName("glpi_manufacturers", $fields["new_manufacturer"]) // : __('Unchanged')) . ""; // echo ""; // if ($fields["ignore_import"] == '') { // echo " "; // } else { // echo Dropdown::getYesNo($fields["ignore_import"]); // } // echo ""; // echo "". // ((isset($fields["is_helpdesk_visible"]) && ($fields["is_helpdesk_visible"] != '')) // ? Dropdown::getYesNo($fields["is_helpdesk_visible"]) // : __('Unchanged')) . ""; // echo "" . // (isset($fields['new_entities_id']) && strlen($fields['new_entities_id']) // ? getDropdownName('glpi_entities', $fields['new_entities_id']) // : __('Unchanged')) . ""; // } /** * @see Rule::getCriterias() **/ function getCriterias() { static $criterias = array(); if (count($criterias)) { return $criterias; } $criterias['name']['field'] = 'name'; $criterias['name']['name'] = _n('Software', 'Software', 1); $criterias['name']['table'] = 'glpi_softwares'; $criterias['manufacturer']['field'] = 'name'; $criterias['manufacturer']['name'] = __('Publisher'); $criterias['manufacturer']['table'] = 'glpi_manufacturers'; $criterias['entities_id']['field'] = 'completename'; $criterias['entities_id']['name'] = __('Entity'); $criterias['entities_id']['table'] = 'glpi_entities'; $criterias['entities_id']['type'] = 'dropdown'; return $criterias; } /** * @see Rule::getActions() **/ function getActions() { $actions = array(); $actions['name']['name'] = _n('Software', 'Software', 1); $actions['name']['force_actions'] = array('assign', 'regex_result'); $actions['_ignore_import']['name'] = __('To be unaware of import'); $actions['_ignore_import']['type'] = 'yesonly'; $actions['version']['name'] = _n('Version', 'Versions',1); $actions['version']['force_actions'] = array('assign','regex_result', 'append_regex_result'); $actions['manufacturer']['name'] = __('Publisher'); $actions['manufacturer']['table'] = 'glpi_manufacturers'; $actions['manufacturer']['force_actions'] = array('append_regex_result', 'assign','regex_result'); $actions['is_helpdesk_visible']['name'] = __('Associable to a ticket'); $actions['is_helpdesk_visible']['table'] = 'glpi_softwares'; $actions['is_helpdesk_visible']['type'] = 'yesno'; $actions['new_entities_id']['name'] = __('Entity'); $actions['new_entities_id']['table'] = 'glpi_entities'; $actions['new_entities_id']['type'] = 'dropdown'; return $actions; } /** * @see Rule::addSpecificParamsForPreview() **/ function addSpecificParamsForPreview($params) { if (isset($_POST["version"])) { $params["version"] = $_POST["version"]; } return $params; } /** * @see Rule::showSpecificCriteriasForPreview() **/ function showSpecificCriteriasForPreview($fields) { if (isset($this->fields['id'])) { $this->getRuleWithCriteriasAndActions($this->fields['id'],0,1); } //if there's a least one action with type == append_regex_result, then need to display //this field as a criteria foreach ($this->actions as $action) { if ($action->fields["action_type"] == "append_regex_result") { $value = (isset($fields[$action->fields['field']])?$fields[$action->fields['field']]:''); //Get actions for this type of rule $actions = $this->getActions(); //display the additionnal field echo ""; echo "".$this->fields['match'].""; echo "".$actions[$action->fields['field']]['name'].""; echo ""; } } } } ?> glpi-0.84.3+dfsg.1/inc/ruledictionnarysoftwarecollection.class.php000066400000000000000000000447221226600447100252620ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class RuleDictionnarySoftwareCollection extends RuleCollection { // From RuleCollection public $stop_on_first_match = true; static public $right = 'rule_dictionnary_software'; public $menu_type = 'dictionnary'; public $menu_option = 'software'; // /** // * Constructor // **/ // function __construct() { // // //Init cache system values // $this->initCache("glpi_rulecachesoftwares", array("name" => "old_value", // "manufacturer" => "manufacturer", // "entities_id" => "entities_id"), // array("name" => "new_value", // "version" => "version", // "manufacturer" => "new_manufacturer", // "is_helpdesk_visible" => "is_helpdesk_visible", // "_ignore_import" => "ignore_import", // "new_entities_id" => "new_entities_id")); // } /** * @see RuleCollection::getTitle() **/ function getTitle() { //TRANS: software in plural return __('Dictionnary of software'); } /** * @see RuleCollection::cleanTestOutputCriterias() **/ function cleanTestOutputCriterias(array $output) { //If output array contains keys begining with _ : drop it foreach ($output as $criteria => $value) { if (($criteria[0] == '_') && ($criteria != '_ignore_import')) { unset ($output[$criteria]); } } return $output; } /** * @see RuleCollection::warningBeforeReplayRulesOnExistingDB() **/ function warningBeforeReplayRulesOnExistingDB($target) { global $CFG_GLPI; echo "\n"; echo "
    "; echo ""; echo ""; echo "\n"; echo ""; echo "\n"; echo ""; echo "
    " . __('Warning before running rename based on the dictionary rules') . "\n"; echo "
    "; echo "" . __('Warning! This operation can put merged software in the dustbin.
    Sure to notify your users.'). "
    " . __('Manufacturer choice') . "\n"; echo "
    " . __('Replay dictionary rules for manufacturers (----- = All)') . ""; Manufacturer::dropdown(array('name' => 'manufacturer')); echo "
    "; echo ""; echo "
    \n"; echo "
    \n"; Html::closeForm(); return true; } /** * @see RuleCollection::replayRulesOnExistingDB() **/ function replayRulesOnExistingDB($offset=0, $maxtime=0, $items=array(), $params=array()) { global $DB; if (isCommandLine()) { echo "replayRulesOnExistingDB started : " . date("r") . "\n"; } $nb = 0; $i = $offset; if (count($items) == 0) { //Select all the differents software $sql = "SELECT DISTINCT `glpi_softwares`.`name`, `glpi_manufacturers`.`name` AS manufacturer, `glpi_softwares`.`manufacturers_id` AS manufacturers_id, `glpi_softwares`.`entities_id` AS entities_id FROM `glpi_softwares` LEFT JOIN `glpi_manufacturers` ON (`glpi_manufacturers`.`id` = `glpi_softwares`.`manufacturers_id`)"; // Do not replay on dustbin and templates $sql .= "WHERE `glpi_softwares`.`is_deleted` = '0' AND `glpi_softwares`.`is_template` = '0' "; if (isset($params['manufacturer']) && $params['manufacturer']) { $sql .= " AND `manufacturer` = '" . $params['manufacturer'] . "'"; } if ($offset) { $sql .= " LIMIT " . intval($offset) . ",999999999"; } $res = $DB->query($sql); $nb = $DB->numrows($res) + $offset; $step = (($nb > 1000) ? 50 : (($nb > 20) ? floor($DB->numrows($res) / 20) : 1)); while ($input = $DB->fetch_assoc($res)) { if (!($i % $step)) { if (isCommandLine()) { printf(__('%1$s - replay rules on existing database: %2$s/%3$s (%4$s Mio)')."\n", date("H:i:s"), $i, $nb, round(memory_get_usage() / (1024 * 1024), 2)); } else { Html::changeProgressBarPosition($i, $nb, "$i / $nb"); } } //If manufacturer is set, then first run the manufacturer's dictionnary if (isset($input["manufacturer"])) { $input["manufacturer"] = Manufacturer::processName(addslashes($input["manufacturer"])); } //Replay software dictionnary rules $res_rule = $this->processAllRules($input, array(), array()); if ((isset($res_rule["name"]) && ($res_rule["name"] != $input["name"])) || (isset($res_rule["version"]) && ($res_rule["version"] != '')) || (isset($res_rule['new_entities_id']) && ($res_rule['new_entities_id'] != $input['entities_id']))) { $IDs = array(); //Find all the softwares in the database with the same name and manufacturer $sql = "SELECT `id` FROM `glpi_softwares` WHERE `name` = '" . $input["name"] . "' AND `manufacturers_id` = '" . $input["manufacturers_id"] . "'"; $res_soft = $DB->query($sql); if ($DB->numrows($res_soft) > 0) { //Store all the software's IDs in an array while ($result = $DB->fetch_assoc($res_soft)) { $IDs[] = $result["id"]; } //Replay dictionnary on all the softwares $this->replayDictionnaryOnSoftwaresByID($IDs, $res_rule); } } $i++; if ($maxtime) { $crt = explode(" ", microtime()); if (($crt[0] + $crt[1]) > $maxtime) { break; } } } // each distinct software if (isCommandLine()) { printf(__('Replay rules on existing database: %1$s/%2$s')." \n", $i, $nb); } else { Html::changeProgressBarPosition($i, $nb, "$i / $nb"); } } else { $this->replayDictionnaryOnSoftwaresByID($items); return true; } if (isCommandLine()) { printf(__('Replay rules on existing database ended on %s')."\n", date("r")); } return (($i == $nb) ? -1 : $i); } /** * Replay dictionnary on several softwares * * @param $IDs array of software IDs to replay * @param $res_rule array of rule results * * @return Query result handler **/ function replayDictionnaryOnSoftwaresByID(array $IDs, $res_rule=array()) { global $DB; $new_softs = array(); $delete_ids = array(); foreach ($IDs as $ID) { $res_soft = $DB->query("SELECT `gs`.`id`, `gs`.`name` AS name, `gs`.`entities_id` AS entities_id, `gm`.`name` AS manufacturer FROM `glpi_softwares` AS gs LEFT JOIN `glpi_manufacturers` AS gm ON (`gs`.`manufacturers_id` = `gm`.`id`) WHERE `gs`.`is_template` = '0' AND `gs`.`id` = '$ID'"); if ($DB->numrows($res_soft)) { $soft = $DB->fetch_assoc($res_soft); //For each software $this->replayDictionnaryOnOneSoftware($new_softs, $res_rule, $ID, (isset($res_rule['new_entities_id']) ?$res_rule['new_entities_id'] :$soft["entities_id"]), (isset($soft["name"]) ? $soft["name"] : ''), (isset($soft["manufacturer"]) ? $soft["manufacturer"] : ''), $delete_ids); } } //Delete software if needed $this->putOldSoftsInTrash($delete_ids); } /** * Replay dictionnary on one software * * @param &$new_softs array containing new softwares already computed * @param $res_rule array of rule results * @param $ID ID of the software * @param $entity working entity ID * @param $name softwrae name * @param $manufacturer manufacturer name * @param &$soft_ids array containing replay software need to be dustbined **/ function replayDictionnaryOnOneSoftware(array &$new_softs, array $res_rule, $ID, $entity, $name, $manufacturer, array &$soft_ids) { global $DB; $input["name"] = $name; $input["manufacturer"] = $manufacturer; $input["entities_id"] = $entity; if (empty($res_rule)) { $res_rule = $this->processAllRules($input, array(), array()); } $soft = new Software(); if (isset($res_rules['_ignore_import']) && ($res_rules['_ignore_import'] == 1)) { $soft->putInTrash($ID, __('Software deleted by GLPI dictionary rules')); return; } //Software's name has changed or entity if ((isset($res_rule["name"]) && ($res_rule["name"] != $name)) //Entity has changed, and new entity is a parent of the current one || (!isset($res_rule["name"]) && isset($res_rule['new_entities_id']) && in_array($res_rule['new_entities_id'], getAncestorsOf('glpi_entities', $entity)))) { if (isset($res_rule["name"])) { $new_name = $res_rule["name"]; } else { $new_name = addslashes($name); } if (isset($res_rule["manufacturer"]) && $res_rule["manufacturer"]) { $manufacturer = $res_rule["manufacturer"]; } else { $manufacturer = addslashes($manufacturer); } //New software not already present in this entity if (!isset($new_softs[$entity][$new_name])) { // create new software or restore it from dustbin $new_software_id = $soft->addOrRestoreFromTrash($new_name, $manufacturer, $entity, '', true); $new_softs[$entity][$new_name] = $new_software_id; } else { $new_software_id = $new_softs[$entity][$new_name]; } // Move licenses to new software $this->moveLicenses($ID, $new_software_id); } else { $new_software_id = $ID; $res_rule["id"] = $ID; if (isset($res_rule["manufacturer"]) && $res_rule["manufacturer"]) { $res_rule["manufacturers_id"] = Dropdown::importExternal('Manufacturer', $res_rule["manufacturer"]); unset($res_rule["manufacturer"]); } $soft->update($res_rule); } // Add to software to deleted list if ($new_software_id != $ID) { $soft_ids[] = $ID; } //Get all the different versions for a software $result = $DB->query("SELECT * FROM `glpi_softwareversions` WHERE `softwares_id` = '$ID'"); while ($version = $DB->fetch_assoc($result)) { $input["version"] = addslashes($version["name"]); $old_version_name = $input["version"]; if (isset($res_rule["version"]) && $res_rule["version"] != '') { $new_version_name = $res_rule["version"]; } else { $new_version_name = $version["name"]; } if (($ID != $new_software_id) || ($new_version_name != $old_version_name)) { $this->moveVersions($ID, $new_software_id, $version["id"], $old_version_name, $new_version_name, $entity); } } } /** * Delete a list of softwares * * @param $soft_ids array containing replay software need to be dustbined **/ function putOldSoftsInTrash(array $soft_ids) { global $DB; if (count($soft_ids) > 0) { $ids = implode("','", $soft_ids); //Try to delete all the software that are not used anymore // (which means that don't have version associated anymore) $res_countsoftinstall = $DB->query("SELECT `glpi_softwares`.`id`, COUNT(`glpi_softwareversions`.`softwares_id`) AS `cpt` FROM `glpi_softwares` LEFT JOIN `glpi_softwareversions` ON `glpi_softwareversions`.`softwares_id` = `glpi_softwares`.`id` WHERE `glpi_softwares`.`id` IN ('$ids') AND `is_deleted` = '0' GROUP BY `glpi_softwares`.`id` HAVING `cpt` = '0' ORDER BY `cpt`"); $software = new Software(); while ($soft = $DB->fetch_assoc($res_countsoftinstall)) { $software->putInTrash($soft["id"], __('Software deleted by GLPI dictionary rules')); } } } /** * Change software's name, and move versions if needed * * @param $ID old software ID * @param $new_software_id new software ID * @param $version_id version ID to move * @param $old_version old version name * @param $new_version new version name * @param $entity entity ID */ function moveVersions($ID, $new_software_id, $version_id, $old_version, $new_version, $entity) { global $DB; $new_versionID = $this->versionExists($new_software_id, $version_id, $new_version); // Do something if it is not the same version if ($new_versionID != $version_id) { //A version does not exist : update existing one if ($new_versionID == -1) { //Transfer versions from old software to new software for a specific version $DB->query("UPDATE `glpi_softwareversions` SET `name` = '$new_version', `softwares_id` = '$new_software_id' WHERE `id` = '$version_id'"); } else { //Change ID of the version in glpi_computers_softwareversions $DB->query("UPDATE `glpi_computers_softwareversions` SET `softwareversions_id` = '$new_versionID' WHERE `softwareversions_id` = '$version_id'"); // Update licenses version link $DB->query("UPDATE `glpi_softwarelicenses` SET `softwareversions_id_buy` = '$new_versionID' WHERE `softwareversions_id_buy` = '$version_id'"); $DB->query("UPDATE `glpi_softwarelicenses` SET `softwareversions_id_use` = '$new_versionID' WHERE `softwareversions_id_use` = '$version_id'"); //Delete old version $old_version = new SoftwareVersion(); $old_version->delete(array("id" => $version_id)); } } } /** * Move licenses from a software to another * * @param $ID old software ID * @param $new_software_id new software ID **/ function moveLicenses($ID, $new_software_id) { global $DB; //Transfer licenses to new software if needed if ($ID != $new_software_id) { $DB->query("UPDATE `glpi_softwarelicenses` SET `softwares_id` = '$new_software_id' WHERE `softwares_id` = '$ID'"); } } /** * Check if a version exists * * @param $software_id software ID * @param $version_id version ID to search * @param $version version name **/ function versionExists($software_id, $version_id, $version) { global $DB; //Check if the version exists $sql = "SELECT * FROM `glpi_softwareversions` WHERE `softwares_id` = '$software_id' AND `name` = '$version'"; $res_version = $DB->query($sql); return (!$DB->numrows($res_version) ? -1 : $DB->result($res_version, 0, "id")); } } ?>glpi-0.84.3+dfsg.1/inc/ruleimportcomputer.class.php000066400000000000000000000334311226600447100221740ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// OCS Rules class class RuleImportComputer extends Rule { const RULE_ACTION_LINK_OR_IMPORT = 0; const RULE_ACTION_LINK_OR_NO_IMPORT = 1; var $restrict_matching = Rule::AND_MATCHING; // From Rule static public $right = 'rule_import'; public $can_sort = true; static function canCreate() { return Session::haveRight('rule_import', 'w'); } static function canView() { return Session::haveRight('rule_import', 'r'); } function getTitle() { return __('Rules for import and link computers'); } /** * @see Rule::maxActionsCount() **/ function maxActionsCount() { // Unlimited return 1; } function getCriterias() { static $criterias = array(); if (count($criterias)) { return $criterias; } $criterias['entities_id']['table'] = 'glpi_entities'; $criterias['entities_id']['field'] = 'entities_id'; $criterias['entities_id']['name'] = __('Target entity for the computer'); $criterias['entities_id']['linkfield'] = 'entities_id'; $criterias['entities_id']['type'] = 'dropdown'; $criterias['states_id']['table'] = 'glpi_states'; $criterias['states_id']['field'] = 'name'; $criterias['states_id']['name'] = __('Find computers in GLPI having the status'); $criterias['states_id']['linkfield'] = 'state'; $criterias['states_id']['type'] = 'dropdown'; //Means that this criterion can only be used in a global search query $criterias['states_id']['is_global'] = true; $criterias['states_id']['allow_condition'] = array(Rule::PATTERN_IS, Rule::PATTERN_IS_NOT); $criterias['DOMAIN']['name'] = __('Domain'); $criterias['IPSUBNET']['name'] = __('Subnet'); $criterias['MACADDRESS']['name'] = __('MAC address'); $criterias['IPADDRESS']['name'] = __('IP address'); $criterias['name']['name'] = __("Computer's name"); $criterias['name']['allow_condition'] = array(Rule::PATTERN_IS, Rule::PATTERN_IS_NOT, Rule::PATTERN_IS_EMPTY, Rule::PATTERN_FIND); $criterias['DESCRIPTION']['name'] = __('Description'); $criterias['serial']['name'] = __('Serial number'); // Model as Text to allow text criteria (contains, regex, ...) $criterias['model']['name'] = __('Model'); // Manufacturer as Text to allow text criteria (contains, regex, ...) $criterias['manufacturer']['name'] = __('Manufacturer'); return $criterias; } function getActions() { $actions = array(); // TODO OCS /* $actions['_fusion']['name'] = __('OCSNG link'); $actions['_fusion']['type'] = 'fusion_type'; */ $actions['_ignore_import']['name'] = __('To be unaware of import'); $actions['_ignore_import']['type'] = 'yesonly'; return $actions; } static function getRuleActionValues() { return array(self::RULE_ACTION_LINK_OR_IMPORT => __('Link if possible'), self::RULE_ACTION_LINK_OR_NO_IMPORT => __('Link if possible, otherwise imports declined')); } /** * Add more action values specific to this type of rule * * @see Rule::displayAdditionRuleActionValue() * * @param value the value for this action * * @return the label's value or '' **/ function displayAdditionRuleActionValue($value) { $values = self::getRuleActionValues(); if (isset($values[$value])) { return $values[$value]; } return ''; } /** * @param $criteria * @param $name * @param $value **/ function manageSpecificCriteriaValues($criteria, $name, $value) { switch ($criteria['type']) { case "state" : $link_array = array("0" => __('No'), "1" => __('Yes if equal'), "2" => __('Yes if empty')); Dropdown::showFromArray($name, $link_array, array('value' => $value)); } return false; } /** * Add more criteria specific to this type of rule **/ static function addMoreCriteria() { return array(Rule::PATTERN_FIND => __('is already present in GLPI'), Rule::PATTERN_IS_EMPTY => __('is empty in GLPI')); } /** * @see Rule::getAdditionalCriteriaDisplayPattern() **/ function getAdditionalCriteriaDisplayPattern($ID, $condition, $pattern) { if ($condition == Rule::PATTERN_IS_EMPTY) { return __('Yes'); } return false; } /** * @see Rule::displayAdditionalRuleCondition() **/ function displayAdditionalRuleCondition($condition, $criteria, $name, $value, $test=false) { if ($test) { return false; } switch ($condition) { case Rule::PATTERN_FIND : case Rule::PATTERN_IS_EMPTY : Dropdown::showYesNo($name, 0, 0); return true; } return false; } /** * @see Rule::displayAdditionalRuleAction() **/ function displayAdditionalRuleAction(array $action) { switch ($action['type']) { case 'fusion_type' : Dropdown::showFromArray('value', self::getRuleActionValues()); return true; } return false; } /** * @param $ID **/ function getCriteriaByID($ID) { $criteria = array(); foreach ($this->criterias as $criterion) { if ($ID == $criterion->fields['criteria']) { $criteria[] = $criterion; } } return $criteria; } /** * @see Rule::findWithGlobalCriteria() **/ function findWithGlobalCriteria($input) { global $DB, $PLUGIN_HOOKS; $complex_criterias = array(); $sql_where = ''; $sql_from = ''; $continue = true; $global_criteria = array('manufacturer', 'model', 'name', 'serial'); //Add plugin global criteria if (isset($PLUGIN_HOOKS['use_rules'])) { foreach ($PLUGIN_HOOKS['use_rules'] as $plugin => $val) { if (is_array($val) && in_array($this->getType(), $val)) { $global_criteria = Plugin::doOneHook($plugin, "ruleImportComputer_addGlobalCriteria", $global_criteria); } } } foreach ($global_criteria as $criterion) { $criteria = $this->getCriteriaByID($criterion); if (!empty($criteria)) { foreach ($criteria as $crit) { // is a real complex criteria if ($crit->fields["condition"] == Rule::PATTERN_FIND) { if (!isset($input[$criterion]) || ($input[$criterion] == '')) { $continue = false; } else { $complex_criterias[] = $crit; } } } } } foreach ($this->getCriteriaByID('states_id') as $crit) { $complex_criterias[] = $crit; } //If a value is missing, then there's a problem ! if (!$continue) { return false; } //No complex criteria if (empty($complex_criterias)) { return true; } //Build the request to check if the machine exists in GLPI if (is_array($input['entities_id'])) { $where_entity = implode($input['entities_id'],','); } else { $where_entity = $input['entities_id']; } $sql_where = '1'; $sql_from = ''; // TODO : why don't take care of Rule match attribute ? $needport = false; $needip = false; foreach ($complex_criterias as $criteria) { switch ($criteria->fields['criteria']) { case 'name' : if ($criteria->fields['condition'] == Rule::PATTERN_IS_EMPTY) { $sql_where .= " AND (`glpi_computers`.`name`='' OR `glpi_computers`.`name` IS NULL) "; } else { $sql_where .= " AND (`glpi_computers`.`name`='".$input['name']."') "; } break; case 'serial' : $sql_where .= " AND `glpi_computers`.`serial`='".$input["serial"]."'"; break; case 'model' : // search for model, don't create it if not found $options = array('manufacturer' => addslashes($input['manufacturer'])); $mid = Dropdown::importExternal('ComputerModel', addslashes($input['model']), -1, $options, '', false); $sql_where .= " AND `glpi_computers`.`computermodels_id` = '$mid'"; break; case 'manufacturer' : // search for manufacturer, don't create it if not found $mid = Dropdown::importExternal('Manufacturer', addslashes($input['manufacturer']), -1, array(), '', false); $sql_where .= " AND `glpi_computers`.`manufacturers_id` = '$mid'"; break; case 'states_id' : if ($criteria->fields['condition'] == Rule::PATTERN_IS) { $condition = " IN "; } else { $conditin = " NOT IN "; } $sql_where .= " AND `glpi_computers`.`states_id` $condition ('".$criteria->fields['pattern']."')"; break; } } if (isset($PLUGIN_HOOKS['use_rules'])) { foreach ($PLUGIN_HOOKS['use_rules'] as $plugin => $val) { if (is_array($val) && in_array($this->getType(), $val)) { $params = array('where_entity' => $where_entity, 'input' => $input, 'criteria' => $complex_criterias, 'sql_where' => $sql_where, 'sql_from' => $sql_from); $sql_results = Plugin::doOneHook($plugin, "ruleImportComputer_getSqlRestriction", $params); $sql_where = $sql_results['sql_where']; $sql_from = $sql_results['sql_from']; } } } $sql_glpi = "SELECT `glpi_computers`.`id` FROM $sql_from WHERE $sql_where ORDER BY `glpi_computers`.`is_deleted` ASC"; $result_glpi = $DB->query($sql_glpi); if ($DB->numrows($result_glpi) > 0) { while ($data = $DB->fetch_assoc($result_glpi)) { $this->criterias_results['found_computers'][] = $data['id']; } return true; } if (count($this->actions)) { foreach ($this->actions as $action) { if ($action->fields['field'] == '_fusion') { if ($action->fields["value"] == self::RULE_ACTION_LINK_OR_NO_IMPORT) { return true; } } } } return false; } /** * Execute the actions as defined in the rule * * @see Rule::executeActions() * * @param $output the fields to manipulate * @param $params parameters * * @return the $output array modified **/ function executeActions($output, $params) { if (count($this->actions)) { foreach ($this->actions as $action) { $executeaction = clone $this; $ruleoutput = $executeaction->executePluginsActions($action, $output, $params); foreach ($ruleoutput as $key => $value) { $output[$key] = $value; } } } return $output; } /** * Function used to display type specific criterias during rule's preview * * @see Rule::showSpecificCriteriasForPreview() **/ function showSpecificCriteriasForPreview($fields) { $entity_as_criteria = false; foreach ($this->criterias as $criteria) { if ($criteria->fields['criteria'] == 'entities_id') { $entity_as_criteria = true; break; } } if (!$entity_as_criteria) { echo ""; echo "".__('Entity').""; echo ""; Dropdown::show('Entity'); echo ""; } } } ?> glpi-0.84.3+dfsg.1/inc/ruleimportcomputercollection.class.php000066400000000000000000000034231226600447100242460ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Import rules collection class class RuleImportComputerCollection extends RuleCollection { // From RuleCollection public $stop_on_first_match = true; static public $right = 'rule_import'; public $menu_option = 'linkcomputer'; /** * @since version 0.84 * * @return boolean **/ function canList() { global $PLUGIN_HOOKS; if (Plugin::haveImport()) { return static::canView(); } return false; } function getTitle() { return __('Rules for import and link computers'); } } ?> glpi-0.84.3+dfsg.1/inc/ruleimportentity.class.php000066400000000000000000000117371226600447100216570ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// OCS Rules class class RuleImportEntity extends Rule { // From Rule static public $right = 'rule_import'; public $can_sort = true; function getTitle() { return __('Rules for assigning an item to an entity'); } /** * @see Rule::maxActionsCount() **/ function maxActionsCount() { // Unlimited return 2; } /** * @see Rule::executeActions() **/ function executeActions($output, $params) { if (count($this->actions)) { foreach ($this->actions as $action) { switch ($action->fields["action_type"]) { case "assign" : $output[$action->fields["field"]] = $action->fields["value"]; break; case "regex_result" : //Assign entity using the regex's result if ($action->fields["field"] == "_affect_entity_by_tag") { //Get the TAG from the regex's results if (isset($this->regex_results[0])) { $res = RuleAction::getRegexResultById($action->fields["value"], $this->regex_results[0]); } else { $res = $action->fields["value"]; } if ($res != null) { //Get the entity associated with the TAG $target_entity = Entity::getEntityIDByTag($res); if ($target_entity != '') { $output["entities_id"] = $target_entity; } } } break; } } } return $output; } /** * @see Rule::getCriterias() **/ function getCriterias() { static $criterias = array(); if (count($criterias)) { return $criterias; } $criterias['_source']['table'] = ''; $criterias['_source']['field'] = '_source'; $criterias['_source']['name'] = __('Source'); $criterias['_source']['allow_condition'] = array(Rule::PATTERN_IS, Rule::PATTERN_IS_NOT); return $criterias; } /** * @since version 0.84 * * @see Rule::displayAdditionalRuleCondition() **/ function displayAdditionalRuleCondition($condition, $criteria, $name, $value, $test=false) { global $PLUGIN_HOOKS; if ($criteria['field'] == '_source') { $tab = array(); foreach ($PLUGIN_HOOKS['import_item'] as $plug => $types) { $tab[$plug] = Plugin::getInfo($plug, 'name'); } Dropdown::showFromArray($name, $tab); return true; } return false; } /** * @since version 0.84 * * @see Rule::getAdditionalCriteriaDisplayPattern() **/ function getAdditionalCriteriaDisplayPattern($ID, $condition, $pattern) { $crit = $this->getCriteria($ID); if ($crit['field'] == '_source') { $name = Plugin::getInfo($pattern, 'name'); if (empty($name)) { return false; } return $name; } } /** * @see Rule::getActions() **/ function getActions() { $actions = array(); $actions['entities_id']['name'] = __('Entity'); $actions['entities_id']['type'] = 'dropdown'; $actions['entities_id']['table'] = 'glpi_entities'; $actions['locations_id']['name'] = __('Location'); $actions['locations_id']['type'] = 'dropdown'; $actions['locations_id']['table'] = 'glpi_locations'; $actions['_ignore_import']['name'] = __('To be unaware of import'); $actions['_ignore_import']['type'] = 'yesonly'; return $actions; } } ?> glpi-0.84.3+dfsg.1/inc/ruleimportentitycollection.class.php000066400000000000000000000034651226600447100237320ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Import rules collection class class RuleImportEntityCollection extends RuleCollection { // From RuleCollection public $stop_on_first_match = true; static public $right = 'rule_import'; public $menu_option = 'importentity'; /** * @see RuleCollection::canList() **/ function canList() { global $PLUGIN_HOOKS; if (Plugin::haveImport()) { return static::canView(); } return false; } /** * @see RuleCollection::getTitle() **/ function getTitle() { return __('Rules for assigning an item to an entity'); } } ?>glpi-0.84.3+dfsg.1/inc/rulemailcollector.class.php000066400000000000000000000352341226600447100217370ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Rule class for Rights management class RuleMailCollector extends Rule { // From Rule static public $right = 'rule_mailcollector'; public $orderby = "name"; public $can_sort = true; // Temproray hack for this class in 0.84 static function getTable() { return 'glpi_rules'; } static function canCreate() { return Session::haveRight('rule_mailcollector', 'w'); } static function canView() { return Session::haveRight('rule_mailcollector', 'r'); } /** * @see Rule::maxActionsCount() **/ function maxActionsCount() { return 1; } /** * @see Rule::getTitle() **/ function getTitle() { return __('Rules for assigning a ticket created through a mails receiver'); } /** * @see Rule::getCriterias() **/ function getCriterias() { static $criterias = array(); if (count($criterias)) { return $criterias; } $criterias['mailcollector']['field'] = 'name'; $criterias['mailcollector']['name'] = __('Mails receiver'); $criterias['mailcollector']['table'] = 'glpi_mailcollectors'; $criterias['mailcollector']['type'] = 'dropdown'; $criterias['_users_id_requester']['field'] = 'name'; $criterias['_users_id_requester']['name'] = __('Requester'); $criterias['_users_id_requester']['table'] = 'glpi_users'; $criterias['_users_id_requester']['type'] = 'dropdown'; $criterias['subject']['name'] = __('Subject email header'); $criterias['subject']['field'] = 'subject'; $criterias['subject']['table'] = ''; $criterias['subject']['type'] = 'text'; $criterias['content']['name'] = __('Email body'); $criterias['content']['table'] = ''; $criterias['content']['type'] = 'text'; $criterias['from']['name'] = __('From email header'); $criterias['from']['table'] = ''; $criterias['from']['type'] = 'text'; $criterias['to']['name'] = __('To email header'); $criterias['to']['table'] = ''; $criterias['to']['type'] = 'text'; $criterias['in_reply_to']['name'] = __('In-Reply-To email header'); $criterias['in_reply_to']['table'] = ''; $criterias['in_reply_to']['type'] = 'text'; $criterias['x-priority']['name'] = __('X-Priority email header'); $criterias['x-priority']['table'] = ''; $criterias['x-priority']['type'] = 'text'; $criterias['x-auto-response-suppress']['name'] = __('X-Auto-Response-Suppress email header'); $criterias['x-auto-response-suppress']['table'] = ''; $criterias['x-auto-response-suppress']['type'] = 'text'; $criterias['auto-submitted']['name'] = __('Auto-Submitted email header'); $criterias['auto-submitted']['table'] = ''; $criterias['auto-submitted']['type'] = 'text'; /// Renater spam matching : X-UCE-Status = Yes $criterias['x-uce-status']['name'] = __('X-UCE-Status email header'); $criterias['x-uce-status']['table'] = ''; $criterias['x-uce-status']['type'] = 'text'; $criterias['received']['name'] = __('Received email header'); $criterias['received']['table'] = ''; $criterias['received']['type'] = 'text'; $criterias['GROUPS']['table'] = 'glpi_groups'; $criterias['GROUPS']['field'] = 'completename'; $criterias['GROUPS']['name'] = sprintf(__('%1$s: %2$s'),__('User'), __('Group')); $criterias['GROUPS']['linkfield'] = ''; $criterias['GROUPS']['type'] = 'dropdown'; $criterias['GROUPS']['virtual'] = true; $criterias['GROUPS']['id'] = 'groups'; $criterias['KNOWN_DOMAIN']['field'] = 'name'; $criterias['KNOWN_DOMAIN']['name'] = __('Known mail domain'); $criterias['KNOWN_DOMAIN']['table'] = 'glpi_entities'; $criterias['KNOWN_DOMAIN']['type'] = 'yesno'; $criterias['KNOWN_DOMAIN']['virtual'] = true; $criterias['KNOWN_DOMAIN']['id'] = 'entitydatas'; $criterias['KNOWN_DOMAIN']['allow_condition'] = array(Rule::PATTERN_IS); $criterias['PROFILES']['field'] = 'name'; $criterias['PROFILES']['name'] = __('User featuring the profile'); $criterias['PROFILES']['table'] = 'glpi_profiles'; $criterias['PROFILES']['type'] = 'dropdown'; $criterias['PROFILES']['virtual'] = true; $criterias['PROFILES']['id'] = 'profiles'; $criterias['PROFILES']['allow_condition'] = array(Rule::PATTERN_IS); if (Session::isMultiEntitiesMode()) { $criterias['UNIQUE_PROFILE']['field'] = 'name'; $criterias['UNIQUE_PROFILE']['name'] = __('User featuring a single profile'); $criterias['UNIQUE_PROFILE']['table'] = 'glpi_profiles'; $criterias['UNIQUE_PROFILE']['type'] = 'dropdown'; $criterias['UNIQUE_PROFILE']['virtual'] = true; $criterias['UNIQUE_PROFILE']['id'] = 'profiles'; $criterias['UNIQUE_PROFILE']['allow_condition'] = array(Rule::PATTERN_IS); } $criterias['ONE_PROFILE']['field'] = 'name'; $criterias['ONE_PROFILE']['name'] = __('User with a single profile'); $criterias['ONE_PROFILE']['table'] = ''; $criterias['ONE_PROFILE']['type'] = 'yesonly'; $criterias['ONE_PROFILE']['virtual'] = true; $criterias['ONE_PROFILE']['id'] = 'profiles'; $criterias['ONE_PROFILE']['allow_condition'] = array(Rule::PATTERN_IS); return $criterias; } /** * @see Rule::getActions() **/ function getActions() { $actions = array(); $actions['entities_id']['name'] = __('Entity'); $actions['entities_id']['type'] = 'dropdown'; $actions['entities_id']['table'] = 'glpi_entities'; $actions['_affect_entity_by_domain']['name'] = __('Entity from domain'); $actions['_affect_entity_by_domain']['type'] = 'text'; $actions['_affect_entity_by_domain']['force_actions'] = array('regex_result'); $actions['_affect_entity_by_tag']['name'] = __('Entity from TAG'); $actions['_affect_entity_by_tag']['type'] = 'text'; $actions['_affect_entity_by_tag']['force_actions'] = array('regex_result'); $actions['_affect_entity_by_user_entity']['name'] = __("Entity based on user's profile"); $actions['_affect_entity_by_user_entity']['type'] = 'yesonly'; $actions['_affect_entity_by_user_entity']['table'] = ''; $actions['_refuse_email_no_response']['name'] = sprintf(__('%1$s (%2$s)'), __('Reject email'), __('without email response')); $actions['_refuse_email_no_response']['type'] = 'yesonly'; $actions['_refuse_email_no_response']['table'] = ''; $actions['_refuse_email_with_response']['name'] = sprintf(__('%1$s (%2$s)'), __('Reject email'), __('with email response')); $actions['_refuse_email_with_response']['type'] = 'yesonly'; $actions['_refuse_email_with_response']['table'] = ''; return $actions; } /** * @see Rule::executeActions() **/ function executeActions($output,$params) { if (count($this->actions)) { foreach ($this->actions as $action) { switch ($action->fields["action_type"]) { case "assign" : switch ($action->fields["field"]) { default : $output[$action->fields["field"]] = $action->fields["value"]; break; case "_affect_entity_by_user_entity": //3 cases : //1 - rule contains a criteria like : Profil is XXXX // -> in this case, profiles_id is stored in // $this->criterias_results['PROFILES'] (one value possible) //2- rule contains criteria "User has only one profile" // -> in this case, profiles_id is stored in // $this->criterias_results['PROFILES'] (one value possible) (same as 1) //3 -> rule contains only one profile $profile = 0; //Case 2: if (isset($this->criterias_results['ONE_PROFILE'])) { $profile = $this->criterias_results['ONE_PROFILE']; //Case 3 } else if (isset($this->criterias_results['UNIQUE_PROFILE'])) { $profile = $this->criterias_results['UNIQUE_PROFILE']; //Case 1 } else if (isset($this->criterias_results['PROFILES'])) { $profile = $this->criterias_results['PROFILES']; } if ($profile) { $entities = array(); if (isset($params['_users_id_requester'])) { // Not set when testing $entities = Profile_User::getEntitiesForProfileByUser($params['_users_id_requester'], $profile); } //Case 2 : check if there's only one profile for this user if ((isset($this->criterias_results['ONE_PROFILE']) && (count($entities) == 1)) || !isset($this->criterias_results['ONE_PROFILE'])) { if (count($entities) == 1) { //User has right on only one entity $output['entities_id'] = array_pop($entities); } else if (isset($this->criterias_results['UNIQUE_PROFILE'])) { $output['entities_id'] = array_pop($entities); } else { //Rights on more than one entity : get the user's prefered entity if (isset($params['_users_id_requester'])) { // Not set when testing $user = new User(); $user->getFromDB($params['_users_id_requester']); $tmpid = $user->getField('entities_id'); // Retrieve all the entities (pref could be set on a child) $entities = Profile_User::getEntitiesForProfileByUser($params['_users_id_requester'], $profile, true); // If an entity is defined in user's preferences, // and this entity allowed for this profile, use this one // else do not set the rule as matched if (in_array($tmpid, $entities)) { $output['entities_id'] = $user->fields['entities_id']; } } } } } } break; case "regex_result" : foreach ($this->regex_results as $regex_result) { $entity_found = -1; $res = RuleAction::getRegexResultById($action->fields["value"], $regex_result); if ($res != null) { switch ($action->fields["field"]) { case "_affect_entity_by_domain" : $entity_found = Entity::getEntityIDByDomain($res); break; case "_affect_entity_by_tag" : $entity_found = Entity::getEntityIDByTag($res); break; } //If an entity was found if ($entity_found > -1) { $output['entities_id'] = $entity_found; break; } } } // switch (field) break; } } } return $output; } } ?> glpi-0.84.3+dfsg.1/inc/rulemailcollectorcollection.class.php000066400000000000000000000107411226600447100240070ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Collector Rules collection class class RuleMailCollectorCollection extends RuleCollection { // From RuleCollection public $stop_on_first_match = true; static public $right = 'rule_mailcollector'; public $menu_option = 'mailcollector'; function getTitle() { return __('Rules for assigning a ticket created through a mails receiver'); } /** * @see RuleCollection::prepareInputDataForProcess() **/ function prepareInputDataForProcess($input, $params) { $input['mailcollector'] = $params['mailcollector']; $input['_users_id_requester'] = $params['_users_id_requester']; $fields = $this->getFieldsToLookFor(); //Add needed ticket datas for rules processing if (isset($params['ticket']) && is_array($params['ticket'])) { foreach ($params['ticket'] as $key => $value) { if (in_array($key,$fields) && !isset($input[$key])) { $input[$key] = $value; } } } //Add needed headers for rules processing if (isset($params['headers']) && is_array($params['headers'])) { foreach ($params['headers'] as $key => $value) { if (in_array($key,$fields) && !isset($input[$key])) { $input[$key] = $value; } } } //Add all user's groups if (in_array('groups',$fields)) { foreach (Group_User::getUserGroups($input['_users_id_requester']) as $group) { $input['GROUPS'][] = $group['id']; } } //Add all user's profiles if (in_array('profiles',$fields)) { foreach (Profile_User::getForUser($input['_users_id_requester']) as $profile) { $input['PROFILES'][$profile['profiles_id']] = $profile['profiles_id']; } } //If the criteria is "user has only one time the profile xxx" if (in_array('unique_profile',$fields)) { //Get all profiles $profiles = Profile_User::getForUser($input['_users_id_requester']); foreach ($profiles as $profile) { if (Profile_User::haveUniqueRight($input['_users_id_requester'], $profile['profiles_id'])) { $input['UNIQUE_PROFILE'][$profile['profiles_id']] = $profile['profiles_id']; } } } //Store the number of profiles of which the user belongs to if (in_array('one_profile',$fields)) { $profiles = Profile_User::getForUser($input['_users_id_requester']); if (count($profiles) == 1) { $tmp = array_pop($profiles); $input['ONE_PROFILE'] = $tmp['profiles_id']; } } //Store the number of profiles of which the user belongs to if (in_array('known_domain',$fields)) { if (preg_match("/@(.*)/",$input['from'],$results)) { if (Entity::getEntityIDByDomain($results[1]) != -1) { $input['KNOWN_DOMAIN'] = 1; } else { $input['KNOWN_DOMAIN'] = 0; } } } return $input; } /** * @see RuleCollection::canList() **/ function canList() { return static::canView() && Toolbox::canUseImapPop() && MailCollector::getNumberOfMailCollectors(); } } ?> glpi-0.84.3+dfsg.1/inc/ruleright.class.php000066400000000000000000000332511226600447100202200ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Rule class for Rights management class RuleRight extends Rule { // From Rule static public $right = 'rule_ldap'; public $orderby = "name"; public $specific_parameters = true; // Temproray hack for this class in 0.84 static function getTable() { return 'glpi_rules'; } static function canCreate() { return Session::haveRight('rule_ldap', 'w'); } static function canView() { return Session::haveRight('rule_ldap', 'r'); } /** * @see Rule::maxActionsCount() **/ function maxActionsCount() { // Unlimited return 4; } /** * @see Rule::showNewRuleForm() **/ function showNewRuleForm($ID) { echo ""; echo ""; echo "\n"; echo ""; echo "\n"; echo ""; echo "\n"; echo "
    " .__('Authorizations assignment rules') . "
    ".__('Name') . ""; Html::autocompletionTextField($this, "name", array('value' => '', 'size' => 33)); echo ''.__('Description') . ""; Html::autocompletionTextField($this, "description", array('value' => '', 'size' => 33)); echo "".__('Logical operator') . ""; $this->dropdownRulesMatch(); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
    "._n('Profile', 'Profiles', 1) . ""; Profile::dropdown(); echo "".__('Recursive') . ""; Dropdown::showYesNo("is_recursive",0); echo "
    "; Html::closeForm(); } /** * Execute the actions as defined in the rule * * @see Rule::executeActions() * * @param $output the result of the actions * @param $params the parameters * * @return the fields modified **/ function executeActions($output, $params) { global $CFG_GLPI; $entity = ''; $right = ''; $is_recursive = 0; $continue = true; $output_src = $output; if (count($this->actions)) { $entity = array(); foreach ($this->actions as $action) { switch ($action->fields["action_type"]) { case "assign" : switch ($action->fields["field"]) { case "entities_id" : $entity[] = $action->fields["value"]; break; case "profiles_id" : $right = $action->fields["value"]; break; case "is_recursive" : $is_recursive = $action->fields["value"]; break; case "is_active" : $output["is_active"] = $action->fields["value"]; break; case "_ignore_user_import" : $continue = false; $output_src["_stop_import"] = true; break; } // switch (field) break; case "regex_result" : switch ($action->fields["field"]) { case "_affect_entity_by_dn" : case "_affect_entity_by_tag" : case "_affect_entity_by_domain" : case "_affect_entity_by_completename" : foreach ($this->regex_results as $regex_result) { $res = RuleAction::getRegexResultById($action->fields["value"], $regex_result); if ($res != null) { switch ($action->fields["field"]) { case "_affect_entity_by_dn" : $entity_found = Entity::getEntityIDByDN($res); break; case "_affect_entity_by_tag" : $entity_found = Entity::getEntityIDByTag($res); break; case "_affect_entity_by_domain" : $entity_found = Entity::getEntityIDByDomain($res); break; case "_affect_entity_by_completename" : $res = Toolbox::unclean_cross_side_scripting_deep($res); $entity_found = Entity::getEntityIDByCompletename($res); break; default: $entity_found = -1; break; } //If an entity was found if ($entity_found > -1) { $entity[] = $entity_found; } } } if (!count($entity)) { //Not entity assigned : action processing must be stopped for this rule $continue = false; } break; } // switch (field) break; } // switch (action_type) } // foreach (action) } // count (actions) if ($continue) { //Nothing to be returned by the function : //Store in session the entity and/or right if (count($entity)) { if ($right != '') { foreach ($entity as $entID) { $output["_ldap_rules"]["rules_entities_rights"][] = array($entID, $right, $is_recursive); } } else { foreach ($entity as $entID) { $output["_ldap_rules"]["rules_entities"][] = array($entID, $is_recursive); } } } else if ($right != '') { $output["_ldap_rules"]["rules_rights"][] = $right; } return $output; } return $output_src; } function getTitle() { return __('Automatic user assignment'); } /** * @see Rule::getCriterias() **/ function getCriterias() { static $criterias = array(); if (!count($criterias)) { $criterias['common'] = __('Global criteria'); $criterias['LDAP_SERVER']['table'] = 'glpi_authldaps'; $criterias['LDAP_SERVER']['field'] = 'name'; $criterias['LDAP_SERVER']['name'] = __('LDAP directory'); $criterias['LDAP_SERVER']['linkfield'] = ''; $criterias['LDAP_SERVER']['type'] = 'dropdown'; $criterias['LDAP_SERVER']['virtual'] = true; $criterias['LDAP_SERVER']['id'] = 'ldap_server'; $criterias['MAIL_SERVER']['table'] = 'glpi_authmails'; $criterias['MAIL_SERVER']['field'] = 'name'; $criterias['MAIL_SERVER']['name'] = __('Email server'); $criterias['MAIL_SERVER']['linkfield'] = ''; $criterias['MAIL_SERVER']['type'] = 'dropdown'; $criterias['MAIL_SERVER']['virtual'] = true; $criterias['MAIL_SERVER']['id'] = 'mail_server'; $criterias['MAIL_EMAIL']['table'] = ''; $criterias['MAIL_EMAIL']['field'] = ''; $criterias['MAIL_EMAIL']['name'] = _n('Email', 'Emails', 1); $criterias['MAIL_EMAIL']['linkfield'] = ''; $criterias['MAIL_EMAIL']['virtual'] = true; $criterias['MAIL_EMAIL']['id'] = 'mail_email'; $criterias['LOGIN']['table'] = ''; $criterias['LOGIN']['field'] = ''; $criterias['LOGIN']['name'] = __('Login'); $criterias['LOGIN']['linkfield'] = ''; $criterias['LOGIN']['virtual'] = true; $criterias['LOGIN']['id'] = 'login'; $criterias['GROUPS']['table'] = 'glpi_groups'; $criterias['GROUPS']['field'] = 'completename'; $criterias['GROUPS']['name'] = __('Imported group from an LDAP directory'); $criterias['GROUPS']['linkfield'] = ''; $criterias['GROUPS']['type'] = 'dropdown'; $criterias['GROUPS']['virtual'] = true; $criterias['GROUPS']['id'] = 'groups'; //Dynamically add all the ldap criterias to the current list of rule's criterias $this->addSpecificCriteriasToArray($criterias); } return $criterias; } /** * @see Rule::getActions() **/ function getActions() { $actions = array(); $actions['entities_id']['name'] = __('Entity'); $actions['entities_id']['type'] = 'dropdown'; $actions['entities_id']['table'] = 'glpi_entities'; $actions['_affect_entity_by_dn']['name'] = __('Entity based on LDAP information'); $actions['_affect_entity_by_dn']['type'] = 'text'; $actions['_affect_entity_by_dn']['force_actions'] = array('regex_result'); $actions['_affect_entity_by_dn']['duplicatewith'] = 'entities_id'; $actions['_affect_entity_by_tag']['name'] = __('Entity from TAG'); $actions['_affect_entity_by_tag']['type'] = 'text'; $actions['_affect_entity_by_tag']['force_actions'] = array('regex_result'); $actions['_affect_entity_by_tag']['duplicatewith'] = 'entities_id'; $actions['_affect_entity_by_domain']['name'] = __('Entity from mail domain'); $actions['_affect_entity_by_domain']['type'] = 'text'; $actions['_affect_entity_by_domain']['force_actions'] = array('regex_result'); $actions['_affect_entity_by_domain']['duplicatewith'] = 'entities_id'; $actions['_affect_entity_by_completename']['name'] = __('Entity from complete name'); $actions['_affect_entity_by_completename']['type'] = 'text'; $actions['_affect_entity_by_completename']['force_actions'] = array('regex_result'); $actions['_affect_entity_by_completename']['duplicatewith'] = 'entities_id'; $actions['profiles_id']['name'] = _n('Profile', 'Profiles', 2); $actions['profiles_id']['type'] = 'dropdown'; $actions['profiles_id']['table'] = 'glpi_profiles'; $actions['is_recursive']['name'] = __('Recursive'); $actions['is_recursive']['type'] = 'yesno'; $actions['is_recursive']['table'] = ''; $actions['is_active']['name'] = __('Active'); $actions['is_active']['type'] = 'yesno'; $actions['is_active']['table'] = ''; $actions['_ignore_user_import']['name'] = __('To be unaware of import'); $actions['_ignore_user_import']['type'] = 'yesonly'; $actions['_ignore_user_import']['table'] = ''; return $actions; } /** * Get all ldap rules criterias from the DB and add them into the RULES_CRITERIAS * * @param &$criterias **/ function addSpecificCriteriasToArray(&$criterias) { $criterias['ldap'] = __('LDAP criteria'); foreach (getAllDatasFromTable('glpi_rulerightparameters', '', true) as $datas ) { $criterias[$datas["value"]]['name'] = $datas["name"]; $criterias[$datas["value"]]['field'] = $datas["value"]; $criterias[$datas["value"]]['linkfield'] = ''; $criterias[$datas["value"]]['table'] = ''; } } } ?> glpi-0.84.3+dfsg.1/inc/rulerightcollection.class.php000066400000000000000000000233051226600447100222730ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Rule collection class for Rights management class RuleRightCollection extends RuleCollection { // From RuleCollection public $stop_on_first_match = false; static public $right = 'rule_ldap'; public $orderby = "name"; public $menu_option = 'right'; // Specific ones /// Array containing results : entity + right var $rules_entity_rights = array(); /// Array containing results : only entity var $rules_entity = array(); /// Array containing results : only right var $rules_rights = array(); function getTitle() { return __('Authorizations assignment rules'); } /** * @see RuleCollection::cleanTestOutputCriterias() */ function cleanTestOutputCriterias(array $output) { if (isset($output["_rule_process"])) { unset($output["_rule_process"]); } return $output; } /** * @see RuleCollection::showTestResults() */ function showTestResults($rule, array $output, $global_result) { $actions = $rule->getActions(); echo "" . __('Rule results') . ""; echo ""; echo "".__('Validation')."". "".Dropdown::getYesNo($global_result).""; if (isset($output["_ldap_rules"]["rules_entities"])) { echo ""; echo "".__('Entities assignment').""; foreach ($output["_ldap_rules"]["rules_entities"] as $entities) { foreach ($entities as $entity) { $this->displayActionByName("entity", $entity[0]); if (isset($entity[1])) { $this->displayActionByName("recursive", $entity[1]); } } } } if (isset($output["_ldap_rules"]["rules_rights"])) { echo ""; echo "".__('Rights assignment').""; foreach ($output["_ldap_rules"]["rules_rights"] as $val) { $this->displayActionByName("profile", $val[0]); } } if (isset($output["_ldap_rules"]["rules_entities_rights"])) { echo ""; echo "".__('Rights and entities assignment').""; foreach ($output["_ldap_rules"]["rules_entities_rights"] as $val) { if (is_array($val[0])) { foreach ($val[0] as $tmp) { $this->displayActionByName("entity", $tmp); } } else { $this->displayActionByName("entity", $val[0]); } if (isset($val[1])) { $this->displayActionByName("profile", $val[1]); } if (isset($val[2])) { $this->displayActionByName("is_recursive",$val[2]); } } } if (isset($output["_ldap_rules"])) { unset($output["_ldap_rules"]); } foreach ($output as $criteria => $value) { if (isset($actions[$criteria])) { // ignore _* fields echo ""; echo "".$actions[$criteria]["name"].""; echo "".$rule->getActionValue($criteria, $actions[$criteria]['action_type'], $value); echo "\n"; } } echo ""; } /** * Display action using its name * * @param $name action name * @param $value default value **/ function displayActionByName($name, $value) { echo ""; switch ($name) { case "entity" : echo "".__('Entity')." \n"; echo "".Dropdown::getDropdownName("glpi_entities", $value).""; break; case "profile" : echo ""._n('Profile', 'Profiles', 2)." \n"; echo "".Dropdown::getDropdownName("glpi_profiles", $value).""; break; case "is_recursive" : echo "".__('Recursive')." \n"; echo "".Dropdown::getYesNo($value).""; break; } echo ""; } /** * Get all the fields needed to perform the rule * * @see RuleCollection::getFieldsToLookFor() **/ function getFieldsToLookFor() { global $DB; $params = array(); $sql = "SELECT DISTINCT `value` FROM `glpi_rules`, `glpi_rulecriterias`, `glpi_rulerightparameters` WHERE `glpi_rules`.`sub_type` = 'RuleRight' AND `glpi_rulecriterias`.`rules_id` = `glpi_rules`.`id` AND `glpi_rulecriterias`.`criteria` = `glpi_rulerightparameters`.`value`"; $result = $DB->query($sql); while ($param = $DB->fetch_assoc($result)) { //Dn is alwsays retreived from ldap : don't need to ask for it ! if ($param["value"] != "dn") { $params[] = Toolbox::strtolower($param["value"]); } } return $params; } /** * Get the attributes needed for processing the rules * * @see RuleCollection::prepareInputDataForProcess() * * @param $input input datas * @param $params extra parameters given * * @return an array of attributes **/ function prepareInputDataForProcess($input, $params) { $rule_parameters = array(); //LDAP type method if ($params["type"] == "LDAP") { //Get all the field to retrieve to be able to process rule matching $rule_fields = $this->getFieldsToLookFor(); //Get all the datas we need from ldap to process the rules $sz = @ldap_read($params["connection"], $params["userdn"], "objectClass=*", $rule_fields); $rule_input = AuthLDAP::get_entries_clean($params["connection"], $sz); if (count($rule_input)) { if (isset($input)) { $groups = $input; } else { $groups = array(); } $rule_input = $rule_input[0]; //Get all the ldap fields $fields = $this->getFieldsForQuery(); foreach ($fields as $field) { switch(Toolbox::strtoupper($field)) { case "LDAP_SERVER" : $rule_parameters["LDAP_SERVER"] = $params["ldap_server"]; break; case "GROUPS" : foreach ($groups as $group) { $rule_parameters["GROUPS"][] = $group; } break; default : if (isset($rule_input[$field])) { if (!is_array($rule_input[$field])) { $rule_parameters[$field] = $rule_input[$field]; } else { if (count($rule_input[$field])) { foreach ($rule_input[$field] as $key => $val) { if ($key !== 'count') { $rule_parameters[$field][] = $val; } } } } } } } return $rule_parameters; } return $rule_input; } else if ($params["type"] == "SSO") { $rule_parameters["MAIL_EMAIL"] = $params["email"]; $rule_parameters["LOGIN"] = $params["login"]; return $rule_parameters; } //IMAP/POP login method $rule_parameters["MAIL_SERVER"] = $params["mail_server"]; $rule_parameters["MAIL_EMAIL"] = $params["email"]; return $rule_parameters; } /** * Get the list of fields to be retreived to process rules **/ function getFieldsForQuery() { $rule = new RuleRight(); $criterias = $rule->getCriterias(); $fields = array(); foreach ($criterias as $criteria) { if (!is_array($criteria)) { continue; } if (isset($criteria['virtual']) && $criteria['virtual']) { $fields[] = $criteria['id']; } else { $fields[] = $criteria['field']; } } return $fields; } } ?> glpi-0.84.3+dfsg.1/inc/rulerightparameter.class.php000066400000000000000000000047721226600447100221270ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// LDAP criteria class class RuleRightParameter extends CommonDropdown { var $refresh_page = true; /** * @see CommonDBTM::prepareInputForAdd() **/ function prepareInputForAdd($input) { //LDAP parameters MUST be in lower case //because the are retieved in lower case from the directory $input["value"] = Toolbox::strtolower($input["value"]); return $input; } static function canCreate() { return Session::haveRight('rule_ldap', 'w'); } static function canView() { return Session::haveRight('rule_ldap', 'r'); } function getAdditionalFields() { return array(array('name' => 'value', 'label' => _n('Criterion', 'Criteria', 1), 'type' => 'text', 'list' => false)); } /** * Get search function for the class * * @return array of search option **/ function getSearchOptions() { $tab = parent::getSearchOptions(); $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'value'; $tab[11]['name'] = _n('Criterion', 'Criteria', 1); $tab[11]['datatype'] = 'string'; return $tab; } static function getTypeName($nb=0) { return _n('LDAP criterion', 'LDAP criteria', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/rulesoftwarecategory.class.php000066400000000000000000000052571226600447100225000ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Rule class store all information about a GLPI rule : * - description * - criterias * - actions * **/ class RuleSoftwareCategory extends Rule { // From Rule static public $right = 'rule_softwarecategories'; public $can_sort = true; function getTitle() { return __('Rules for assigning a category to software'); } /** * @see Rule::maxActionsCount() **/ function maxActionsCount() { return 1; } function getCriterias() { static $criterias = array(); if (count($criterias)) { return $criterias; } $criterias['name']['field'] = 'name'; $criterias['name']['name'] = _n('Software', 'Software', 2); $criterias['name']['table'] = 'glpi_softwares'; $criterias['manufacturer']['field'] = 'name'; $criterias['manufacturer']['name'] = __('Publisher'); $criterias['manufacturer']['table'] = 'glpi_manufacturers'; $criterias['comment']['field'] = 'comment'; $criterias['comment']['name'] = __('Comments'); $criterias['comment']['table'] = 'glpi_softwares'; return $criterias; } function getActions() { $actions = array(); $actions['softwarecategories_id']['name'] = __('Category'); $actions['softwarecategories_id']['type'] = 'dropdown'; $actions['softwarecategories_id']['table'] = 'glpi_softwarecategories'; return $actions; } } ?> glpi-0.84.3+dfsg.1/inc/rulesoftwarecategorycollection.class.php000066400000000000000000000044101226600447100245420ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class RuleSoftwareCategoryCollection extends RuleCollection { // From RuleCollection public $stop_on_first_match = true; static public $right = 'rule_softwarecategories'; public $menu_option = 'softwarecategories'; function getTitle() { return __('Rules for assigning a category to software'); } /** * Get the attributes needed for processing the rules * * @see RuleCollection::prepareInputDataForProcess() * * @param $input input data * @param $software software data array * * @return an array of attributes **/ function prepareInputDataForProcess($input, $software) { $params["name"] = $software["name"]; if (isset($software["comment"])) { $params["comment"] = $software["comment"]; } if (isset($software["manufacturers_id"])) { $params["manufacturer"] = Dropdown::getDropdownName("glpi_manufacturers", $software["manufacturers_id"]); } return $params; } } ?> glpi-0.84.3+dfsg.1/inc/ruleticket.class.php000066400000000000000000000546321226600447100203740ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class RuleTicket extends Rule { // From Rule static public $right = 'entity_rule_ticket'; public $can_sort = true; function getTitle() { return __('Business rules for tickets'); } static function canCreate() { return Session::haveRight('entity_rule_ticket', 'w'); } static function canView() { return Session::haveRight('entity_rule_ticket', 'r'); } function maybeRecursive() { return true; } function isEntityAssign() { return true; } function canUnrecurs() { return true; } function maxActionsCount() { return count($this->getActions()); } /** * display title for action form **/ function getTitleAction() { parent::getTitleAction(); $showwarning = false; if (isset($this->actions)) { foreach ($this->actions as $key => $val) { if (isset($val->fields['field'])) { if (in_array($val->fields['field'], array('impact', 'urgency'))) { $showwarning = true; } } } } if ($showwarning) { echo ""; echo "\n"; echo "
    ". __('Urgency or impact used in actions, think to add Prioriy: recompute action if needed.'). "

    "; } } /** * @param $params **/ function addSpecificParamsForPreview($params) { if (!isset($params["entities_id"])) { $params["entities_id"] = $_SESSION["glpiactive_entity"]; } return $params; } /** * Function used to display type specific criterias during rule's preview * * @param $fields fields values **/ function showSpecificCriteriasForPreview($fields) { $entity_as_criteria = false; foreach ($this->criterias as $criteria) { if ($criteria->fields['criteria'] == 'entities_id') { $entity_as_criteria = true; break; } } if (!$entity_as_criteria) { echo ""; } } /** * @param $output * @param $params **/ function executeActions($output,$params) { if (count($this->actions)) { foreach ($this->actions as $action) { switch ($action->fields["action_type"]) { case "send" : $ticket = new Ticket(); if ($ticket->getFromDB($output['id'])) { NotificationEvent::raiseEvent('recall', $ticket); } break; case "add_validation" : if (isset($output['_add_validation']) && !is_array($output['_add_validation'])) { $output['_add_validation'] = array($output['_add_validation']); } switch ($action->fields['field']) { case 'users_id_validate_requester_supervisor' : $output['_add_validation'][] = 'requester_supervisor'; break; case 'users_id_validate_assign_supervisor' : $output['_add_validation'][] = 'assign_supervisor'; break; default : $output['_add_validation'][] = $action->fields["value"]; break; } break; case "assign" : $output[$action->fields["field"]] = $action->fields["value"]; break; case "append" : $actions = $this->getActions(); $value = $action->fields["value"]; if (isset($actions[$action->fields["field"]]["appendtoarray"]) && isset($actions[$action->fields["field"]]["appendtoarrayfield"])) { $value = $actions[$action->fields["field"]]["appendtoarray"]; $value[$actions[$action->fields["field"]]["appendtoarrayfield"]] = $action->fields["value"]; } $output[$actions[$action->fields["field"]]["appendto"]][] = $value; break; case 'fromuser' : if ($action->fields['field'] == 'locations_id') { $output['locations_id'] = $output['users_locations']; } break; case 'fromitem' : if ($action->fields['field'] == 'locations_id') { $output['locations_id'] = $output['items_locations']; } break; case 'compute' : // Value could be not set (from test) $urgency = (isset($output['urgency'])?$output['urgency']:3); $impact = (isset($output['impact'])?$output['impact']:3); // Apply priority_matrix from config $output['priority'] = Ticket::computePriority($urgency, $impact); break; case "affectbyip" : case "affectbyfqdn" : case "affectbymac" : if (!isset($output["entities_id"])) { $output["entities_id"] = $params["entities_id"]; } if (isset($this->regex_results[0])) { $regexvalue = RuleAction::getRegexResultById($action->fields["value"], $this->regex_results[0]); } else { $regexvalue = $action->fields["value"]; } /// TODO : check, because, previous version also propose deleted and template items switch ($action->fields["action_type"]) { case "affectbyip" : $result = IPAddress::getUniqueItemByIPAddress($regexvalue, $output["entities_id"]); break; case "affectbyfqdn" : $result= FQDNLabel::getUniqueItemByFQDN($regexvalue, $output["entities_id"]); break; case "affectbymac" : $result = NetworkPortInstantiation::getUniqueItemByMac($regexvalue, $output["entities_id"]); break; default: $result = array(); } if (!empty($result)) { $output["itemtype"] = $result["itemtype"]; $output["items_id"] = $result["id"]; } break; } } } return $output; } /** * @param $output **/ function preProcessPreviewResults($output) { $output = parent::preProcessPreviewResults($output); return Ticket::showPreviewAssignAction($output); } function getCriterias() { static $criterias = array(); if (count($criterias)) { return $criterias; } $criterias['name']['table'] = 'glpi_tickets'; $criterias['name']['field'] = 'name'; $criterias['name']['name'] = __('Title'); $criterias['name']['linkfield'] = 'name'; $criterias['content']['table'] = 'glpi_tickets'; $criterias['content']['field'] = 'content'; $criterias['content']['name'] = __('Description'); $criterias['content']['linkfield'] = 'content'; $criterias['itilcategories_id']['table'] = 'glpi_itilcategories'; $criterias['itilcategories_id']['field'] = 'name'; $criterias['itilcategories_id']['name'] = __('Category'); $criterias['itilcategories_id']['linkfield'] = 'itilcategories_id'; $criterias['itilcategories_id']['type'] = 'dropdown'; $criterias['type']['table'] = 'glpi_tickets'; $criterias['type']['field'] = 'type'; $criterias['type']['name'] = __('Type'); $criterias['type']['linkfield'] = 'type'; $criterias['type']['type'] = 'dropdown_tickettype'; $criterias['_users_id_requester']['table'] = 'glpi_users'; $criterias['_users_id_requester']['field'] = 'name'; $criterias['_users_id_requester']['name'] = __('Requester'); $criterias['_users_id_requester']['linkfield'] = '_users_id_requester'; $criterias['_users_id_requester']['type'] = 'dropdown_users'; $criterias['users_locations']['table'] = 'glpi_locations'; $criterias['users_locations']['field'] = 'completename'; $criterias['users_locations']['name'] = __('Requester location'); $criterias['users_locations']['linkfield'] = 'users_locations'; $criterias['users_locations']['type'] = 'dropdown'; $criterias['items_locations']['table'] = 'glpi_locations'; $criterias['items_locations']['field'] = 'completename'; $criterias['items_locations']['name'] = __('Item location'); $criterias['items_locations']['linkfield'] = 'items_locations'; $criterias['items_locations']['type'] = 'dropdown'; $criterias['locations_id']['table'] = 'glpi_locations'; $criterias['locations_id']['field'] = 'completename'; $criterias['locations_id']['name'] = __('Ticket location'); $criterias['locations_id']['linkfield'] = 'locations_id'; $criterias['locations_id']['type'] = 'dropdown'; $criterias['_groups_id_requester']['table'] = 'glpi_groups'; $criterias['_groups_id_requester']['field'] = 'completename'; $criterias['_groups_id_requester']['name'] = __('Requester group'); $criterias['_groups_id_requester']['linkfield'] = '_groups_id_requester'; $criterias['_groups_id_requester']['type'] = 'dropdown'; $criterias['_users_id_assign']['table'] = 'glpi_users'; $criterias['_users_id_assign']['field'] = 'name'; $criterias['_users_id_assign']['name'] = __('Technician'); $criterias['_users_id_assign']['linkfield'] = '_users_id_assign'; $criterias['_users_id_assign']['type'] = 'dropdown_users'; $criterias['_groups_id_assign']['table'] = 'glpi_groups'; $criterias['_groups_id_assign']['field'] = 'completename'; $criterias['_groups_id_assign']['name'] = __('Technician group'); $criterias['_groups_id_assign']['linkfield'] = '_groups_id_assign'; $criterias['_groups_id_assign']['type'] = 'dropdown'; $criterias['_groups_id_assign']['condition'] = '`is_assign`'; $criterias['_suppliers_id_assign']['table'] = 'glpi_suppliers'; $criterias['_suppliers_id_assign']['field'] = 'name'; $criterias['_suppliers_id_assign']['name'] = __('Assigned to a supplier'); $criterias['_suppliers_id_assign']['linkfield'] = '_suppliers_id_assign'; $criterias['_suppliers_id_assign']['type'] = 'dropdown'; $criterias['_users_id_observer']['table'] = 'glpi_users'; $criterias['_users_id_observer']['field'] = 'name'; $criterias['_users_id_observer']['name'] = __('Watcher'); $criterias['_users_id_observer']['linkfield'] = '_users_id_observer'; $criterias['_users_id_observer']['type'] = 'dropdown_users'; $criterias['_groups_id_observer']['table'] = 'glpi_groups'; $criterias['_groups_id_observer']['field'] = 'completename'; $criterias['_groups_id_observer']['name'] = __('Watcher group'); $criterias['_groups_id_observer']['linkfield'] = '_groups_id_observer'; $criterias['_groups_id_observer']['type'] = 'dropdown'; $criterias['requesttypes_id']['table'] = 'glpi_requesttypes'; $criterias['requesttypes_id']['field'] = 'name'; $criterias['requesttypes_id']['name'] = __('Request source'); $criterias['requesttypes_id']['linkfield'] = 'requesttypes_id'; $criterias['requesttypes_id']['type'] = 'dropdown'; $criterias['itemtype']['table'] = 'glpi_tickets'; $criterias['itemtype']['field'] = 'itemtype'; $criterias['itemtype']['name'] = __('Item type'); $criterias['itemtype']['linkfield'] = 'itemtype'; $criterias['itemtype']['type'] = 'dropdown_tracking_itemtype'; $criterias['entities_id']['table'] = 'glpi_entities'; $criterias['entities_id']['field'] = 'name'; $criterias['entities_id']['name'] = __('Entity'); $criterias['entities_id']['linkfield'] = 'entities_id'; $criterias['entities_id']['type'] = 'dropdown'; $criterias['urgency']['name'] = __('Urgency'); $criterias['urgency']['type'] = 'dropdown_urgency'; $criterias['impact']['name'] = __('Impact'); $criterias['impact']['type'] = 'dropdown_impact'; $criterias['priority']['name'] = __('Priority'); $criterias['priority']['type'] = 'dropdown_priority'; $criterias['_mailgate']['table'] = 'glpi_mailcollectors'; $criterias['_mailgate']['field'] = 'name'; $criterias['_mailgate']['name'] = __('Mails receiver'); $criterias['_mailgate']['linkfield'] = '_mailgate'; $criterias['_mailgate']['type'] = 'dropdown'; $criterias['_x-priority']['name'] = __('X-Priority email header'); $criterias['_x-priority']['table'] = ''; $criterias['_x-priority']['type'] = 'text'; return $criterias; } function getActions() { $actions = array(); $actions['itilcategories_id']['name'] = __('Category'); $actions['itilcategories_id']['type'] = 'dropdown'; $actions['itilcategories_id']['table'] = 'glpi_itilcategories'; $actions['type']['name'] = __('Type'); $actions['type']['table'] = 'glpi_tickets'; $actions['type']['type'] = 'dropdown_tickettype'; $actions['_users_id_requester']['name'] = __('Requester'); $actions['_users_id_requester']['type'] = 'dropdown_users'; $actions['_users_id_requester']['force_actions'] = array('assign', 'append'); $actions['_users_id_requester']['permitseveral'] = array('append'); $actions['_users_id_requester']['appendto'] = '_additional_requesters'; $actions['_users_id_requester']['appendtoarray'] = array('use_notification' => 1); $actions['_users_id_requester']['appendtoarrayfield'] = 'users_id'; $actions['_groups_id_requester']['name'] = __('Requester group'); $actions['_groups_id_requester']['type'] = 'dropdown'; $actions['_groups_id_requester']['table'] = 'glpi_groups'; $actions['_groups_id_requester']['force_actions'] = array('assign', 'append'); $actions['_groups_id_requester']['permitseveral'] = array('append'); $actions['_groups_id_requester']['appendto'] = '_additional_groups_requesters'; $actions['_users_id_assign']['name'] = __('Technician'); $actions['_users_id_assign']['type'] = 'dropdown_assign'; $actions['_users_id_assign']['force_actions'] = array('assign', 'append'); $actions['_users_id_assign']['permitseveral'] = array('append'); $actions['_users_id_assign']['appendto'] = '_additional_assigns'; $actions['_users_id_assign']['appendtoarray'] = array('use_notification' => 1); $actions['_users_id_assign']['appendtoarrayfield'] = 'users_id'; $actions['_groups_id_assign']['table'] = 'glpi_groups'; $actions['_groups_id_assign']['name'] = __('Technician group'); $actions['_groups_id_assign']['type'] = 'dropdown'; $actions['_groups_id_assign']['condition'] = '`is_assign`'; $actions['_groups_id_assign']['force_actions'] = array('assign', 'append'); $actions['_groups_id_assign']['permitseveral'] = array('append'); $actions['_groups_id_assign']['appendto'] = '_additional_groups_assigns'; $actions['_suppliers_id_assign']['table'] = 'glpi_suppliers'; $actions['_suppliers_id_assign']['name'] = __('Assigned to a supplier'); $actions['_suppliers_id_assign']['type'] = 'dropdown'; $actions['_suppliers_id_assign']['force_actions'] = array('assign', 'append'); $actions['_suppliers_id_assign']['permitseveral'] = array('append'); $actions['_suppliers_id_assign']['appendto'] = '_additional_suppliers_assigns'; $actions['_users_id_observer']['name'] = __('Watcher'); $actions['_users_id_observer']['type'] = 'dropdown_users'; $actions['_users_id_observer']['force_actions'] = array('assign', 'append'); $actions['_users_id_observer']['permitseveral'] = array('append'); $actions['_users_id_observer']['appendto'] = '_additional_observers'; $actions['_users_id_observer']['appendtoarray'] = array('use_notification' => 1); $actions['_users_id_observer']['appendtoarrayfield'] = 'users_id'; $actions['_groups_id_observer']['table'] = 'glpi_groups'; $actions['_groups_id_observer']['name'] = __('Watcher group'); $actions['_groups_id_observer']['type'] = 'dropdown'; $actions['_groups_id_observer']['force_actions'] = array('assign', 'append'); $actions['_groups_id_observer']['permitseveral'] = array('append'); $actions['_groups_id_observer']['appendto'] = '_additional_groups_observers'; $actions['urgency']['name'] = __('Urgency'); $actions['urgency']['type'] = 'dropdown_urgency'; $actions['impact']['name'] = __('Impact'); $actions['impact']['type'] = 'dropdown_impact'; $actions['priority']['name'] = __('Priority'); $actions['priority']['type'] = 'dropdown_priority'; $actions['priority']['force_actions'] = array('assign', 'compute'); $actions['status']['name'] = __('Status'); $actions['status']['type'] = 'dropdown_status'; $actions['affectobject']['name'] = __('Associated element'); $actions['affectobject']['type'] = 'text'; $actions['affectobject']['force_actions'] = array('affectbyip', 'affectbyfqdn', 'affectbymac'); $actions['slas_id']['table'] = 'glpi_slas'; $actions['slas_id']['name'] = __('SLA'); $actions['slas_id']['type'] = 'dropdown'; $actions['users_id_validate']['name'] = __('Send an approval request'); $actions['users_id_validate']['type'] = 'dropdown_users_validate'; $actions['users_id_validate']['force_actions'] = array('add_validation'); $actions['users_id_validate_requester_supervisor']['name'] = __('Approval request to requester group supervisor'); $actions['users_id_validate_requester_supervisor']['type'] = 'yesno'; $actions['users_id_validate_requester_supervisor']['force_actions'] = array('add_validation'); $actions['users_id_validate_assign_supervisor']['name'] = __('Approval request to technician group supervisor'); $actions['users_id_validate_assign_supervisor']['type'] = 'yesno'; $actions['users_id_validate_assign_supervisor']['force_actions'] = array('add_validation'); $actions['locations_id']['name'] = __('Location'); $actions['locations_id']['type'] = 'dropdown'; $actions['locations_id']['table'] = 'glpi_locations'; $actions['locations_id']['force_actions'] = array('assign', 'fromuser', 'fromitem'); return $actions; } } ?>glpi-0.84.3+dfsg.1/inc/ruleticketcollection.class.php000066400000000000000000000055461226600447100224500ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class RuleTicketCollection extends RuleCollection { // From RuleCollection static public $right = 'entity_rule_ticket'; public $use_output_rule_process_as_next_input = true; public $menu_option = 'ticket'; /** * @param $entity (default 0) **/ function __construct($entity=0) { $this->entity = $entity; } /** * @since version 0.84 **/ static function canView() { return (Session::haveRight('entity_rule_ticket', 'r') || Session::haveRight('rule_ticket', 'r')); } function canList() { return static::canView(); } function getTitle() { return __('Business rules for tickets'); } /** * @see RuleCollection::preProcessPreviewResults() **/ function preProcessPreviewResults($output) { $output = parent::preProcessPreviewResults($output); return Ticket::showPreviewAssignAction($output); } /** * @see RuleCollection::showInheritedTab() **/ function showInheritedTab() { return (Session::haveRight('rule_ticket','r') && ($this->entity)); } /** * @see RuleCollection::showChildrensTab() **/ function showChildrensTab() { return (Session::haveRight('entity_rule_ticket','r') && (count($_SESSION['glpiactiveentities']) > 1)); } /** * @see RuleCollection::prepareInputDataForProcess() **/ function prepareInputDataForProcess($input, $params) { // Pass x-priority header if exists if (isset($input['_head']['x-priority'])) { $input['_x-priority'] = $input['_head']['x-priority']; } return $input; } } ?>glpi-0.84.3+dfsg.1/inc/search.class.php000066400000000000000000007473751226600447100175030ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Generic class for Search Engine class Search { // Default number of items displayed in global search const GLOBAL_DISPLAY_COUNT = 10; // EXPORT TYPE const GLOBAL_SEARCH = -1; const HTML_OUTPUT = 0; const SYLK_OUTPUT = 1; const PDF_OUTPUT_LANDSCAPE = 2; const CSV_OUTPUT = 3; const PDF_OUTPUT_PORTRAIT = 4; /** * Display search engine for an type * * @param $itemtype item type to manage * * @return nothing **/ static function show($itemtype) { self::manageGetValues($itemtype); self::showGenericSearch($itemtype, $_GET); self::showList($itemtype, $_GET); } /** * Generic Search and list function * * Build the query, make the search and list items after a search. * * @param $itemtype item type * @param $params array of parameters may include field, contains, searchtype, sort, order, * start, deleted, link, link2, contains2, field2, itemtype2, searchtype2 * * @return Nothing (display) **/ static function showList($itemtype, array $params) { global $DB, $CFG_GLPI; // Instanciate an object to access method $item = NULL; if ($itemtype != 'AllAssets') { $item = getItemForItemtype($itemtype); } // Default values of parameters $p['link'] = array();// $p['field'] = array();// $p['contains'] = array();// $p['searchtype'] = array();// $p['sort'] = '1'; // $p['order'] = 'ASC';// $p['start'] = 0;// $p['is_deleted'] = 0; $p['export_all'] = 0; $p['link2'] = '';// $p['contains2'] = '';// $p['field2'] = '';// $p['itemtype2'] = ''; $p['searchtype2'] = ''; foreach ($params as $key => $val) { $p[$key] = $val; } if ($p['export_all']) { $p['start'] = 0; } if (in_array('all', $p['field']) && !$CFG_GLPI['allow_search_all']) { Html::displayRightError(); } if (in_array('view', $p['field']) && !$CFG_GLPI['allow_search_view']) { Html::displayRightError(); } // Manage defautll seachtype value : for bookmark compatibility if (count($p['contains'])) { foreach ($p['contains'] as $key => $val) { if (!isset($p['searchtype'][$key])) { $p['searchtype'][$key] = 'contains'; } } } if (is_array($p['contains2']) && count($p['contains2'])) { foreach ($p['contains2'] as $key => $val) { if (!isset($p['searchtype2'][$key])) { $p['searchtype2'][$key] = 'contains'; } } } $target = Toolbox::getItemTypeSearchURL($itemtype); $limitsearchopt = self::getCleanedOptions($itemtype); $blacklist_tables = array(); if (isset($CFG_GLPI['union_search_type'][$itemtype])) { $itemtable = $CFG_GLPI['union_search_type'][$itemtype]; $blacklist_tables[] = getTableForItemType($itemtype); } else { $itemtable = getTableForItemType($itemtype); } $LIST_LIMIT = $_SESSION['glpilist_limit']; // Set display type for export if define $output_type = self::HTML_OUTPUT; if (isset($_GET['display_type'])) { $output_type = $_GET['display_type']; // Limit to 10 element if ($_GET['display_type'] == self::GLOBAL_SEARCH) { $LIST_LIMIT = self::GLOBAL_DISPLAY_COUNT; } } // hack for AllAssets if (isset($CFG_GLPI['union_search_type'][$itemtype])) { $entity_restrict = true; } else { $entity_restrict = $item->isEntityAssign(); } $metanames = array(); // Get the items to display $toview = self::addDefaultToView($itemtype); // Add items to display depending of personal prefs $displaypref = DisplayPreference::getForTypeUser($itemtype, Session::getLoginUserID()); if (count($displaypref)) { foreach ($displaypref as $val) { array_push($toview,$val); } } // Add searched items if (count($p['field']) >0) { foreach ($p['field'] as $key => $val) { if (!in_array($val, $toview) && ($val != 'all') && ($val != 'view')) { array_push($toview, $val); } } } // Add order item if (!in_array($p['sort'],$toview)) { array_push($toview, $p['sort']); } // Special case for Ticket : put ID in front if ($itemtype == 'Ticket') { array_unshift($toview, 2); } // Clean toview array $toview = array_unique($toview); foreach ($toview as $key => $val) { if (!isset($limitsearchopt[$val])) { unset($toview[$key]); } } $toview_count = count($toview); // Construct the request //// 1 - SELECT // request currentuser for SQL supervision, not displayed $SELECT = "SELECT '".Toolbox::addslashes_deep($_SESSION['glpiname'])."' AS currentuser, ".self::addDefaultSelect($itemtype); // Add select for all toview item foreach ($toview as $key => $val) { $SELECT .= self::addSelect($itemtype, $val, $key, 0); } //// 2 - FROM AND LEFT JOIN // Set reference table $FROM = " FROM `$itemtable`"; // Init already linked tables array in order not to link a table several times $already_link_tables = array(); // Put reference table array_push($already_link_tables, $itemtable); // Add default join $COMMONLEFTJOIN = self::addDefaultJoin($itemtype, $itemtable, $already_link_tables); $FROM .= $COMMONLEFTJOIN; $searchopt = array(); $searchopt[$itemtype] = &self::getOptions($itemtype); // Add all table for toview items foreach ($toview as $key => $val) { if (!in_array($searchopt[$itemtype][$val]["table"], $blacklist_tables)) { $FROM .= self::addLeftJoin($itemtype, $itemtable, $already_link_tables, $searchopt[$itemtype][$val]["table"], $searchopt[$itemtype][$val]["linkfield"], 0, 0, $searchopt[$itemtype][$val]["joinparams"]); } } // Search all case : if (in_array("all", $p['field'])) { foreach ($searchopt[$itemtype] as $key => $val) { // Do not search on Group Name if (is_array($val)) { if (!in_array($searchopt[$itemtype][$key]["table"], $blacklist_tables)) { $FROM .= self::addLeftJoin($itemtype, $itemtable, $already_link_tables, $searchopt[$itemtype][$key]["table"], $searchopt[$itemtype][$key]["linkfield"], 0, 0, $searchopt[$itemtype][$key]["joinparams"]); } } } } //// 3 - WHERE // default string $COMMONWHERE = self::addDefaultWhere($itemtype); $first = empty($COMMONWHERE); // Add deleted if item have it if ($item && $item->maybeDeleted()) { $LINK = " AND " ; if ($first) { $LINK = " "; $first = false; } $COMMONWHERE .= $LINK."`$itemtable`.`is_deleted` = '".$p['is_deleted']."' "; } // Remove template items if ($item && $item->maybeTemplate()) { $LINK = " AND " ; if ($first) { $LINK = " "; $first = false; } $COMMONWHERE .= $LINK."`$itemtable`.`is_template` = '0' "; } // Add Restrict to current entities if ($entity_restrict) { $LINK = " AND " ; if ($first) { $LINK = " "; $first = false; } if ($itemtype == 'Entity') { $COMMONWHERE .= getEntitiesRestrictRequest($LINK, $itemtable, 'id', '', true); } else if (isset($CFG_GLPI["union_search_type"][$itemtype])) { // Will be replace below in Union/Recursivity Hack $COMMONWHERE .= $LINK." ENTITYRESTRICT "; } else { $COMMONWHERE .= getEntitiesRestrictRequest($LINK, $itemtable, '', '', $item->maybeRecursive()); } } $WHERE = ""; $HAVING = ""; // Add search conditions // If there is search items if (($_SESSION["glpisearchcount"][$itemtype] > 0) && (count($p['contains']) > 0)) { for ($key=0 ; $key<$_SESSION["glpisearchcount"][$itemtype] ; $key++) { // if real search (strlen >0) and not all and view search if (isset($p['contains'][$key]) && (strlen($p['contains'][$key]) > 0)) { // common search if (($p['field'][$key] != "all") && ($p['field'][$key] != "view")) { $LINK = " "; $NOT = 0; $tmplink = ""; if (is_array($p['link']) && isset($p['link'][$key])) { if (strstr($p['link'][$key],"NOT")) { $tmplink = " ".str_replace(" NOT","",$p['link'][$key]); $NOT = 1; } else { $tmplink = " ".$p['link'][$key]; } } else { $tmplink = " AND "; } if (isset($searchopt[$itemtype][$p['field'][$key]]["usehaving"])) { // Manage Link if not first item if (!empty($HAVING)) { $LINK = $tmplink; } // Find key $item_num = array_search($p['field'][$key], $toview); $HAVING .= self::addHaving($LINK, $NOT,$itemtype, $p['field'][$key], $p['searchtype'][$key], $p['contains'][$key], 0, $item_num); } else { // Manage Link if not first item if (!empty($WHERE)) { $LINK = $tmplink; } $WHERE .= self::addWhere($LINK, $NOT, $itemtype, $p['field'][$key], $p['searchtype'][$key], $p['contains'][$key]); } // view and all search } else { $LINK = " OR "; $NOT = 0; $globallink = " AND "; if (is_array($p['link']) && isset($p['link'][$key])) { switch ($p['link'][$key]) { case "AND" : $LINK = " OR "; $globallink = " AND "; break; case "AND NOT" : $LINK = " AND "; $NOT = 1; $globallink = " AND "; break; case "OR" : $LINK = " OR "; $globallink = " OR "; break; case "OR NOT" : $LINK = " AND "; $NOT = 1; $globallink = " OR "; break; } } else { $tmplink =" AND "; } // Manage Link if not first item if (!empty($WHERE)) { $WHERE .= $globallink; } $WHERE .= " ( "; $first2 = true; $items = array(); if ($p['field'][$key] == "all") { $items = $searchopt[$itemtype]; } else { // toview case : populate toview foreach ($toview as $key2 => $val2) { $items[$val2] = $searchopt[$itemtype][$val2]; } } foreach ($items as $key2 => $val2) { if (isset($val2['nosearch']) && $val2['nosearch']) { continue; } if (is_array($val2)) { // Add Where clause if not to be done in HAVING CLAUSE if (!isset($val2["usehaving"])) { $tmplink = $LINK; if ($first2) { $tmplink = " "; $first2 = false; } $WHERE .= self::addWhere($tmplink, $NOT, $itemtype, $key2, $p['searchtype'][$key], $p['contains'][$key]); } } } $WHERE .= " ) "; } } } } //// 4 - ORDER $ORDER = " ORDER BY `id` "; foreach ($toview as $key => $val) { if ($p['sort'] == $val) { $ORDER = self::addOrderBy($itemtype, $p['sort'], $p['order'], $key); } } //// 5 - META SEARCH // Preprocessing if (($_SESSION["glpisearchcount2"][$itemtype] > 0) && is_array($p['itemtype2'])) { // a - SELECT for ($i=0 ; $i<$_SESSION["glpisearchcount2"][$itemtype] ; $i++) { if (isset($p['itemtype2'][$i]) && !empty($p['itemtype2'][$i]) && isset($p['contains2'][$i]) && (strlen($p['contains2'][$i]) > 0)) { $SELECT .= self::addSelect($p['itemtype2'][$i], $p['field2'][$i], $i, 1, $p['itemtype2'][$i]); } } // b - ADD LEFT JOIN // Already link meta table in order not to linked a table several times $already_link_tables2 = array(); // Link reference tables for ($i=0 ; $i<$_SESSION["glpisearchcount2"][$itemtype] ; $i++) { if (isset($p['itemtype2'][$i]) && !empty($p['itemtype2'][$i]) && isset($p['contains2'][$i]) && (strlen($p['contains2'][$i]) > 0)) { if (!in_array(getTableForItemType($p['itemtype2'][$i]), $already_link_tables2)) { $FROM .= self::addMetaLeftJoin($itemtype, $p['itemtype2'][$i], $already_link_tables2, (($p['contains2'][$i] == "NULL") || (strstr($p['link2'][$i], "NOT")))); } } } // Link items tables for ($i=0 ; $i<$_SESSION["glpisearchcount2"][$itemtype] ; $i++) { if (isset($p['itemtype2'][$i]) && !empty($p['itemtype2'][$i]) && isset($p['contains2'][$i]) && (strlen($p['contains2'][$i]) > 0)) { if (!isset($searchopt[$p['itemtype2'][$i]])) { $searchopt[$p['itemtype2'][$i]] = &self::getOptions($p['itemtype2'][$i]); } if (!in_array($searchopt[$p['itemtype2'][$i]][$p['field2'][$i]]["table"]."_".$p['itemtype2'][$i], $already_link_tables2)) { $FROM .= self::addLeftJoin($p['itemtype2'][$i], getTableForItemType($p['itemtype2'][$i]), $already_link_tables2, $searchopt[$p['itemtype2'][$i]][$p['field2'][$i]]["table"], $searchopt[$p['itemtype2'][$i]][$p['field2'][$i]]["linkfield"], 1, $p['itemtype2'][$i], $searchopt[$p['itemtype2'][$i]][$p['field2'][$i]]["joinparams"]); } } } } //// 6 - Add item ID // Add ID to the select if (!empty($itemtable)) { $SELECT .= "`$itemtable`.`id` AS id "; } //// 7 - Manage GROUP BY $GROUPBY = ""; // Meta Search / Search All / Count tickets if (($_SESSION["glpisearchcount2"][$itemtype] > 0) || !empty($HAVING) || in_array('all', $p['field'])) { $GROUPBY = " GROUP BY `$itemtable`.`id`"; } if (empty($GROUPBY)) { foreach ($toview as $key2 => $val2) { if (!empty($GROUPBY)) { break; } if (isset($searchopt[$itemtype][$val2]["forcegroupby"])) { $GROUPBY = " GROUP BY `$itemtable`.`id`"; } } } // Specific search for others item linked (META search) if (is_array($p['itemtype2'])) { for ($key=0 ; $key<$_SESSION["glpisearchcount2"][$itemtype] ; $key++) { if (isset($p['itemtype2'][$key]) && !empty($p['itemtype2'][$key]) && isset($p['contains2'][$key]) && (strlen($p['contains2'][$key]) > 0)) { $LINK = ""; // For AND NOT statement need to take into account all the group by items if (strstr($p['link2'][$key],"AND NOT") || isset($searchopt[$p['itemtype2'][$key]][$p['field2'][$key]]["usehaving"])) { $NOT = 0; if (strstr($p['link2'][$key],"NOT")) { $tmplink = " ".str_replace(" NOT","",$p['link2'][$key]); $NOT = 1; } else { $tmplink = " ".$p['link2'][$key]; } if (!empty($HAVING)) { $LINK = $tmplink; } $HAVING .= self::addHaving($LINK, $NOT, $p['itemtype2'][$key], $p['field2'][$key], $p['searchtype2'][$key], $p['contains2'][$key], 1, $key); } else { // Meta Where Search $LINK = " "; $NOT = 0; // Manage Link if not first item if (is_array($p['link2']) && isset($p['link2'][$key]) && strstr($p['link2'][$key],"NOT")) { $tmplink = " ".str_replace(" NOT", "", $p['link2'][$key]); $NOT = 1; } else if (is_array($p['link2']) && isset($p['link2'][$key])) { $tmplink = " ".$p['link2'][$key]; } else { $tmplink = " AND "; } if (!empty($WHERE)) { $LINK = $tmplink; } $WHERE .= self::addWhere($LINK, $NOT, $p['itemtype2'][$key], $p['field2'][$key], $p['searchtype2'][$key], $p['contains2'][$key], 1); } } } } // Use a ReadOnly connection if available and configured to be used $DBread = DBConnection::getReadConnection(); // If no research limit research to display item and compute number of item using simple request $nosearch = true; for ($i=0 ; $i<$_SESSION["glpisearchcount"][$itemtype] ; $i++) { if (isset($p['contains'][$i]) && (strlen($p['contains'][$i]) > 0)) { $nosearch = false; } } if ($_SESSION["glpisearchcount2"][$itemtype] > 0) { $nosearch = false; } $LIMIT = ""; $numrows = 0; //No search : count number of items using a simple count(ID) request and LIMIT search if ($nosearch) { $LIMIT = " LIMIT ".$p['start'].", ".$LIST_LIMIT; // Force group by for all the type -> need to count only on table ID if (!isset($searchopt[$itemtype][1]['forcegroupby'])) { $count = "count(*)"; } else { $count = "count(DISTINCT `$itemtable`.`id`)"; } // request currentuser for SQL supervision, not displayed $query_num = "SELECT $count, '".Toolbox::addslashes_deep($_SESSION['glpiname'])."' AS currentuser FROM `$itemtable`". $COMMONLEFTJOIN; $first = true; if (!empty($COMMONWHERE)) { $LINK = " AND " ; if ($first) { $LINK = " WHERE "; $first = false; } $query_num .= $LINK.$COMMONWHERE; } // Union Search : if (isset($CFG_GLPI["union_search_type"][$itemtype])) { $tmpquery = $query_num; $numrows = 0; foreach ($CFG_GLPI[$CFG_GLPI["union_search_type"][$itemtype]] as $ctype) { $ctable = getTableForItemType($ctype); if (($citem = getItemForItemtype($ctype)) && $citem->canView()) { // State case if ($itemtype == 'AllAssets') { $query_num = str_replace($CFG_GLPI["union_search_type"][$itemtype], $ctable, $tmpquery); $query_num = str_replace($itemtype, $ctype, $query_num); $query_num .= " AND `$ctable`.`id` IS NOT NULL "; // Add deleted if item have it if ($citem && $citem->maybeDeleted()) { $query_num .= " AND `$ctable`.`is_deleted` = '0' "; } // Remove template items if ($citem && $citem->maybeTemplate()) { $query_num .= " AND `$ctable`.`is_template` = '0' "; } } else {// Ref table case $reftable = getTableForItemType($itemtype); if ($item && $item->maybeDeleted()) { $tmpquery = str_replace("`".$CFG_GLPI["union_search_type"][$itemtype]."`.`is_deleted`", "`$reftable`.`is_deleted`", $tmpquery); } $replace = "FROM `$reftable` INNER JOIN `$ctable` ON (`$reftable`.`items_id` =`$ctable`.`id` AND `$reftable`.`itemtype` = '$ctype')"; $query_num = str_replace("FROM `".$CFG_GLPI["union_search_type"][$itemtype]."`", $replace, $tmpquery); $query_num = str_replace($CFG_GLPI["union_search_type"][$itemtype], $ctable, $query_num); } $query_num = str_replace("ENTITYRESTRICT", getEntitiesRestrictRequest('', $ctable, '', '', $citem->maybeRecursive()), $query_num); $result_num = $DBread->query($query_num); $numrows += $DBread->result($result_num, 0, 0); } } } else { $result_num = $DBread->query($query_num); $numrows = $DBread->result($result_num,0,0); } } // If export_all reset LIMIT condition if ($p['export_all']) { $LIMIT = ""; } if (!empty($WHERE) || !empty($COMMONWHERE)) { if (!empty($COMMONWHERE)) { $WHERE = ' WHERE '.$COMMONWHERE.(!empty($WHERE)?' AND ( '.$WHERE.' )':''); } else { $WHERE = ' WHERE '.$WHERE.' '; } $first = false; } if (!empty($HAVING)) { $HAVING = ' HAVING '.$HAVING; } // Create QUERY if (isset($CFG_GLPI["union_search_type"][$itemtype])) { $first = true; $QUERY = ""; foreach ($CFG_GLPI[$CFG_GLPI["union_search_type"][$itemtype]] as $ctype) { $ctable = getTableForItemType($ctype); if (($citem = getItemForItemtype($ctype)) && $citem->canView()) { if ($first) { $first = false; } else { $QUERY .= " UNION "; } $tmpquery = ""; // AllAssets case if ($itemtype == 'AllAssets') { $tmpquery = $SELECT.", '$ctype' AS TYPE ". $FROM. $WHERE; if ($itemtype == 'AllAssets') { $tmpquery .= " AND `$ctable`.`id` IS NOT NULL "; } // Add deleted if item have it if ($citem && $citem->maybeDeleted()) { $tmpquery .= " AND `$ctable`.`is_deleted` = '0' "; } // Remove template items if ($citem && $citem->maybeTemplate()) { $tmpquery .= " AND `$ctable`.`is_template` = '0' "; } $tmpquery.= $GROUPBY. $HAVING; $tmpquery = str_replace($CFG_GLPI["union_search_type"][$itemtype], $ctable, $tmpquery); $tmpquery = str_replace($itemtype, $ctype, $tmpquery); } else {// Ref table case $reftable = getTableForItemType($itemtype); $tmpquery = $SELECT.", '$ctype' AS TYPE, `$reftable`.`id` AS refID, "." `$ctable`.`entities_id` AS ENTITY ". $FROM. $WHERE; if ($item->maybeDeleted()) { $tmpquery = str_replace("`".$CFG_GLPI["union_search_type"][$itemtype]."`.`is_deleted`", "`$reftable`.`is_deleted`", $tmpquery); } $replace = "FROM `$reftable`"." INNER JOIN `$ctable`"." ON (`$reftable`.`items_id`=`$ctable`.`id`"." AND `$reftable`.`itemtype` = '$ctype')"; $tmpquery = str_replace("FROM `".$CFG_GLPI["union_search_type"][$itemtype]."`", $replace, $tmpquery); $tmpquery = str_replace($CFG_GLPI["union_search_type"][$itemtype], $ctable, $tmpquery); } $tmpquery = str_replace("ENTITYRESTRICT", getEntitiesRestrictRequest('', $ctable, '', '', $citem->maybeRecursive()), $tmpquery); // SOFTWARE HACK if ($ctype == 'Software') { $tmpquery = str_replace("glpi_softwares.serial", "''", $tmpquery); $tmpquery = str_replace("glpi_softwares.otherserial", "''", $tmpquery); } $QUERY .= $tmpquery; } } if (empty($QUERY)) { echo self::showError($output_type); return; } $QUERY .= str_replace($CFG_GLPI["union_search_type"][$itemtype].".", "", $ORDER) . $LIMIT; } else { $QUERY = $SELECT. $FROM. $WHERE. $GROUPBY. $HAVING. $ORDER. $LIMIT; } $DBread->query("SET SESSION group_concat_max_len = 4096;"); $result = $DBread->query($QUERY); /// Check group concat limit : if warning : increase limit if ($result2 = $DBread->query('SHOW WARNINGS')) { if ($DBread->numrows($result2) > 0) { $data = $DBread->fetch_assoc($result2); if ($data['Code'] == 1260) { $DBread->query("SET SESSION group_concat_max_len = 4194304;"); $result = $DBread->query($QUERY); } } } // Get it from database and DISPLAY if ($result) { // if real search or complete export : get numrows from request if (!$nosearch || $p['export_all']) { $numrows = $DBread->numrows($result); } // Contruct Pager parameters $globallinkto = self::getArrayUrlLink("field", $p['field']). self::getArrayUrlLink("link", $p['link']). self::getArrayUrlLink("contains", $p['contains']). self::getArrayUrlLink("searchtype", $p['searchtype']). self::getArrayUrlLink("field2", $p['field2']). self::getArrayUrlLink("contains2", $p['contains2']). self::getArrayUrlLink("itemtype2", $p['itemtype2']). self::getArrayUrlLink("searchtype2", $p['searchtype2']). self::getArrayUrlLink("link2", $p['link2']); $parameters = "sort=".$p['sort']."&order=".$p['order'].$globallinkto; // Not more used : clean pages : try to comment it /* $tmp=explode('?',$target,2); if (count($tmp)>1) { $target = $tmp[0]; $parameters = $tmp[1].'&'.$parameters; } */ if ($output_type == self::GLOBAL_SEARCH) { if ($item = getItemForItemtype($itemtype)) { echo "

    ".$item->getTypeName(); // More items if ($numrows > ($p['start'] + self::GLOBAL_DISPLAY_COUNT)) { echo " ".__('All').""; } echo "

    \n"; } else { return false; } } // If the begin of the view is before the number of items if ($p['start'] < $numrows) { // Display pager only for HTML if ($output_type == self::HTML_OUTPUT) { // For plugin add new parameter if available if ($plug = isPluginItemType($itemtype)) { $function = 'plugin_'.$plug['plugin'].'_addParamFordynamicReport'; if (function_exists($function)) { $out = $function($itemtype); if (is_array($out) && count($out)) { foreach ($out as $key => $val) { if (is_array($val)) { $parameters .= self::getArrayUrlLink($key, $val); } else { $parameters .= "&$key=$val"; } } } } } $search_config = ""; if (Session::haveRight("search_config","w") || Session::haveRight("search_config_global","w")) { // Ajax::createModalWindow('searchconfig_window', // $CFG_GLPI['root_doc']."/ajax/searchconfig.php?itemtype=$itemtype", // array('title' => __('Select default items to show'), // 'width' => '1000')); // $tmp = " class='pointer' onClick=\"searchconfig_window.show()\""; $tmp = " class='pointer' onClick=\"var w = window.open('".$CFG_GLPI["root_doc"]. "/front/popup.php?popup=search_config&itemtype=$itemtype' ,'glpipopup', ". "'height=400, width=1000, top=100, left=100, scrollbars=yes'); w.focus();\""; $search_config = "\"".__s('Select"; } Html::printPager($p['start'], $numrows, $target, $parameters, $itemtype, 0, $search_config); } // Define begin and end var for loop // Search case $begin_display = $p['start']; $end_display = min($numrows, $p['start']+$LIST_LIMIT); // No search Case if ($nosearch) { $begin_display = 0; $end_display = min($numrows-$p['start'], $LIST_LIMIT); } // Export All case if ($p['export_all']) { $begin_display = 0; $end_display = $numrows; } // Form to massive actions $isadmin = ($item && $item->canUpdate()); if (!$isadmin && in_array($itemtype, $CFG_GLPI["infocom_types"])) { $isadmin = (Infocom::canUpdate() || Infocom::canCreate()); } $showmassiveactions = false; if ($itemtype != 'AllAssets') { $showmassiveactions = count($item->getAllMassiveActions($p['is_deleted'])); if ($showmassiveactions && ($output_type == self::HTML_OUTPUT)) { Html::openMassiveActionsForm('massform'.$itemtype); $massiveactionparams = array('num_displayed' => $end_display-$begin_display, 'fixed' => false, 'is_deleted' => $p['is_deleted']); Html::showMassiveActions($itemtype, $massiveactionparams); } } // Compute number of columns to display // Add toview elements $nbcols = $toview_count; $already_printed = array(); // Add meta search elements if real search (strlen>0) or only NOT search if (($_SESSION["glpisearchcount2"][$itemtype] > 0) && is_array($p['itemtype2'])) { for ($i=0 ; $i<$_SESSION["glpisearchcount2"][$itemtype] ; $i++) { if (isset($p['itemtype2'][$i]) && !empty($p['itemtype2'][$i]) && isset($p['contains2'][$i]) && (strlen($p['contains2'][$i]) > 0) && (!isset($p['link2'][$i]) || !strstr($p['link2'][$i],"NOT"))) { if (!isset($already_printed[$p['itemtype2'][$i].$p['field2'][$i]])) { $nbcols++; $already_printed[$p['itemtype2'][$i].$p['field2'][$i]] = 1; } } } } if ($output_type == self::HTML_OUTPUT) { // HTML display - massive modif $nbcols++; } // Display List Header echo self::showHeader($output_type, $end_display-$begin_display+1, $nbcols); // New Line for Header Items Line $headers_line = ''; $headers_line_top = ''; $headers_line_bottom = ''; echo self::showNewLine($output_type); $header_num = 1; if (($output_type == self::HTML_OUTPUT) && $showmassiveactions) { // HTML display - massive modif $headers_line_top .= self::showHeaderItem($output_type, Html::getCheckAllAsCheckbox('massform'.$itemtype), $header_num, "", 0, $p['order']); $headers_line_bottom .= self::showHeaderItem($output_type, Html::getCheckAllAsCheckbox('massform'.$itemtype), $header_num, "", 0, $p['order']); } // Display column Headers for toview items foreach ($toview as $key => $val) { $linkto = ''; if (!isset($searchopt[$itemtype][$val]['nosort']) || !$searchopt[$itemtype][$val]['nosort']) { $linkto = "$target?itemtype=$itemtype&sort=".$val."&order=". (($p['order'] == "ASC") ?"DESC":"ASC")."&start=".$p['start']. $globallinkto; } $headers_line .= self::showHeaderItem($output_type, $searchopt[$itemtype][$val]["name"], $header_num, $linkto, ($p['sort'] == $val), $p['order']); } // Display columns Headers for meta items $already_printed = array(); if (($_SESSION["glpisearchcount2"][$itemtype] > 0) && is_array($p['itemtype2'])) { for ($i=0 ; $i<$_SESSION["glpisearchcount2"][$itemtype] ; $i++) { if (isset($p['itemtype2'][$i]) && !empty($p['itemtype2'][$i]) && isset($p['contains2'][$i]) && (strlen($p['contains2'][$i]) > 0)) { if (!isset($already_printed[$p['itemtype2'][$i].$p['field2'][$i]])) { if (!isset($metanames[$p['itemtype2'][$i]])) { if ($metaitem = getItemForItemtype($p['itemtype2'][$i])) { $metanames[$p['itemtype2'][$i]] = $metaitem->getTypeName(); } } $headers_line .= self::showHeaderItem($output_type, sprintf(__('%1$s - %2$s'), $metanames[$p['itemtype2'][$i]], $searchopt[$p['itemtype2'][$i]][$p['field2'][$i]]["name"]), $header_num); $already_printed[$p['itemtype2'][$i].$p['field2'][$i]] = 1; } } } } // Add specific column Header if ($itemtype == 'CartridgeItem') { $headers_line .= self::showHeaderItem($output_type, _n('Cartridge','Cartridges',2), $header_num); } if ($itemtype == 'ConsumableItem') { $headers_line .= self::showHeaderItem($output_type, _n('Consumable','Consumables',2), $header_num); } if (isset($CFG_GLPI["union_search_type"][$itemtype])) { $headers_line .= self::showHeaderItem($output_type, __('Item type'), $header_num); } if (($itemtype == 'ReservationItem') && ($output_type == self::HTML_OUTPUT)) { $headers_line .= self::showHeaderItem($output_type, " ", $header_num); } // End Line for column headers $headers_line .= self::showEndLine($output_type); $headers_line_top .= $headers_line; $headers_line_bottom .= $headers_line; echo $headers_line_top; // if real search seek to begin of items to display (because of complete search) if (!$nosearch) { $DBread->data_seek($result, $p['start']); } // Define begin and end var for loop // Search case $i = $begin_display; // Init list of items displayed if ($output_type == self::HTML_OUTPUT) { Session::initNavigateListItems($itemtype); } // Num of the row (1=header_line) $row_num = 1; $massiveaction_field = 'id'; if (isset($CFG_GLPI["union_search_type"][$itemtype])) { $massiveaction_field = 'refID'; } // Display Loop while (($i < $numrows) && ($i < $end_display)) { // Column num $item_num = 1; // Get data and increment loop variables $data = $DBread->fetch_assoc($result); $i++; $row_num++; // New line echo self::showNewLine($output_type, ($i%2), $p['is_deleted']); // Add item in item list Session::addToNavigateListItems($itemtype, $data["id"]); if (($output_type == self::HTML_OUTPUT) && $showmassiveactions) { // HTML display - massive modif $tmpcheck = ""; if (($itemtype == 'Entity') && !in_array($data["id"], $_SESSION["glpiactiveentities"])) { $tmpcheck = " "; } else if ($item->maybeRecursive() && !in_array($data["entities_id"], $_SESSION["glpiactiveentities"])) { $tmpcheck = " "; } else { $tmpcheck = Html::getMassiveActionCheckBox($itemtype, $data[$massiveaction_field]); } echo self::showItem($output_type, $tmpcheck, $item_num, $row_num, "width='10'"); } // Print other toview items foreach ($toview as $key => $val) { echo self::showItem($output_type, self::giveItem($itemtype, $val, $data, $key), $item_num, $row_num, self::displayConfigItem($itemtype, $val, $data, $key)); } // Print Meta Item $already_printed = array(); if (($_SESSION["glpisearchcount2"][$itemtype] > 0) && is_array($p['itemtype2'])) { for ($j=0 ; $j<$_SESSION["glpisearchcount2"][$itemtype] ; $j++) { if (isset($p['itemtype2'][$j]) && !empty($p['itemtype2'][$j]) && isset($p['contains2'][$j]) && (strlen($p['contains2'][$j]) >0)) { if (!isset($already_printed[$p['itemtype2'][$j].$p['field2'][$j]])) { // General case if (strpos($data["META_$j"],"$$$$") === false) { $out = self::giveItem($p['itemtype2'][$j], $p['field2'][$j], $data, $j, 1); echo self::showItem($output_type, $out, $item_num, $row_num); // Case of GROUP_CONCAT item : split item and multilline display } else { $split = explode("$$$$", $data["META_$j"]); $count_display = 0; $out = ""; $unit = ""; $separate = '
    '; if (isset($searchopt[$p['itemtype2'][$j]][$p['field2'][$j]]['splititems']) && $searchopt[$p['itemtype2'][$j]][$p['field2'][$j]]['splititems']) { $separate = '
    '; } if (isset($searchopt[$p['itemtype2'][$j]][$p['field2'][$j]]['unit'])) { $unit = $searchopt[$p['itemtype2'][$j]][$p['field2'][$j]]['unit']; } for ($k=0 ; $k"; $out .= Dropdown::getValueWithUnit($split2[0],$unit); $linkout = $out; if ($_SESSION["glpiis_ids_visible"] || empty($split2[0])) { $linkout = sprintf(__('%1$s (%2$s)'), $linkout, $split2[1]); } $out = $linkout.""; } else { $out .= Dropdown::getValueWithUnit($split2[0],$unit); } } else { $out .= Dropdown::getValueWithUnit($split[$k],$unit); } } } echo self::showItem($output_type, $out, $item_num, $row_num); } $already_printed[$p['itemtype2'][$j].$p['field2'][$j]] = 1; } } } } // Specific column display if ($itemtype == 'CartridgeItem') { echo self::showItem($output_type, Cartridge::getCount($data["id"], $data["ALARM"], $output_type != self::HTML_OUTPUT), $item_num, $row_num); } if ($itemtype == 'ConsumableItem') { echo self::showItem($output_type, Consumable::getCount($data["id"], $data["ALARM"], $output_type != self::HTML_OUTPUT), $item_num, $row_num); } if (isset($CFG_GLPI["union_search_type"][$itemtype])) { $typename = $data["TYPE"]; if ($itemtmp = getItemForItemtype($data["TYPE"])) { $typename = $itemtmp->getTypeName(); } echo self::showItem($output_type, $typename, $item_num, $row_num); } if (($itemtype == 'ReservationItem') && ($output_type == self::HTML_OUTPUT)) { if ($data["ACTIVE"]) { echo self::showItem($output_type, "". "", $item_num, $row_num, "class='center'"); } else { echo self::showItem($output_type, " ", $item_num, $row_num); } } // End Line echo self::showEndLine($output_type); } $title = ""; // Create title if (($output_type == self::PDF_OUTPUT_LANDSCAPE) || ($output_type == self::PDF_OUTPUT_PORTRAIT)) { if (($_SESSION["glpisearchcount"][$itemtype] > 0) && (count($p['contains']) > 0)) { for ($key=0 ; $key<$_SESSION["glpisearchcount"][$itemtype] ; $key++) { $titlecontain = ''; if (strlen($p['contains'][$key]) > 0) { if (isset($p["link"][$key])) { $titlecontain = " ".$p["link"][$key]." "; } switch ($p['field'][$key]) { case "all" : $titlecontain = sprintf(__('%1$s %2$s'), $titlecontain, __('All')); break; case "view" : $titlecontain = sprintf(__('%1$s %2$s'), $titlecontain, __('Items seen')); break; default : $titlecontain = sprintf(__('%1$s %2$s'), $titlecontain, $searchopt[$itemtype][$p['field'][$key]]["name"]); } switch ($p['searchtype'][$key]) { case "equals" : if (in_array($searchopt[$itemtype][$p['field'][$key]]["field"], array('name', 'completename'))) { $titlecontain = sprintf(__('%1$s = %2$s'), $titlecontain, Dropdown::getDropdownName($searchopt[$itemtype][$p['field'][$key]]["table"], $p['contains'][$key])); } else { $titlecontain = sprintf(__('%1$s = %2$s'), $titlecontain, $p['contains'][$key]); } break; case "notequals" : if (in_array($searchopt[$itemtype][$p['field'][$key]]["field"], array('name', 'completename'))) { $titlecontain = sprintf(__('%1$s <> %2$s'), $titlecontain, Dropdown::getDropdownName($searchopt[$itemtype][$p['field'][$key]]["table"], $p['contains'][$key])); } else { $titlecontain = sprintf(__('%1$s <> %2$s'), $titlecontain, $p['contains'][$key]); } break; case "lessthan" : $titlecontain = sprintf(__('%1$s < %2$s'), $titlecontain, $p['contains'][$key]); break; case "morethan" : $titlecontain = sprintf(__('%1$s > %2$s'), $titlecontain, $p['contains'][$key]); break; case "contains" : $titlecontain = sprintf(__('%1$s = %2$s'), $titlecontain, '%'.$p['contains'][$key].'%'); break; case "under" : $titlecontain = sprintf(__('%1$s %2$s'), $titlecontain, sprintf(__('%1$s %2$s'), __('under'), Dropdown::getDropdownName($searchopt[$itemtype][$p['field'][$key]]["table"], $p['contains'][$key]))); break; case "notunder" : $titlecontain = sprintf(__('%1$s %2$s'), $titlecontain, sprintf(__('%1$s %2$s'), __('not under'), Dropdown::getDropdownName($searchopt[$itemtype][$p['field'][$key]]["table"], $p['contains'][$key]))); break; default : $titlecontain = sprintf(__('%1$s = %2$s'), $titlecontain, $p['contains'][$key]); break; } } $title .= $titlecontain; } } if (($_SESSION["glpisearchcount2"][$itemtype] > 0) && (count($p['contains2']) > 0)) { for ($key=0 ; $key<$_SESSION["glpisearchcount2"][$itemtype] ; $key++) { $titlecontain2 = ''; if (strlen($p['contains2'][$key]) > 0) { if (isset($p['link2'][$key])) { $titlecontain2 = sprintf(__('%1$s %2$s'), $titlecontain2, $p['link2'][$key]); } $titlecontain2 = sprintf(__('%1$s %2$s'), $titlecontain2, sprintf(__('%1$s / %2$s'), $metanames[$p['itemtype2'][$key]], $searchopt[$p['itemtype2'][$key]][$p['field2'][$key]]["name"])); switch ($p['searchtype2'][$key]) { case "equals" : if (in_array($searchopt[$p['itemtype2'][$key]][$p['field2'][$key]]["field"], array('name', 'completename'))) { $titlecontain2 = sprintf(__('%1$s = %2$s'), $titlecontain2, Dropdown::getDropdownName($searchopt[$p['itemtype2'][$key]][$p['field2'][$key]]["table"], $p['contains2'][$key])); } else { $titlecontain2 = sprintf(__('%1$s = %2$s'), $titlecontain2, $p['contains2'][$key]); } break; case "notequals" : if (in_array($searchopt[$p['itemtype2'][$key]][$p['field2'][$key]]["field"], array('name', 'completename'))) { $titlecontain2 = sprintf(__('%1$s <> %2$s'), $titlecontain2, Dropdown::getDropdownName($searchopt[$p['itemtype2'][$key]][$p['field2'][$key]]["table"], $p['contains2'][$key])); } else { $titlecontain2 = sprintf(__('%1$s <> %2$s'), $titlecontain2, $p['contains2'][$key]); } break; case "lessthan" : $titlecontain2 = sprintf(__('%1$s < %2$s'), $titlecontain2, $p['contains2'][$key]); break; case "morethan" : $titlecontain2 = sprintf(__('%1$s > %2$s'), $titlecontain2, $p['contains2'][$key]); break; case "contains" : $titlecontain2 = sprintf(__('%1$s = %2$s'), $titlecontain2, '%'.$p['contains2'][$key].'%'); break; case "under" : $titlecontain2 = sprintf(__('%1$s %2$s'), $titlecontain2, sprintf(__('%1$s %2$s'), __('under'), Dropdown::getDropdownName($searchopt[$p['itemtype2'][$key]][$p['field2'][$key]]["table"], $p['contains2'][$key]))); break; case "notunder" : $titlecontain2 = sprintf(__('%1$s %2$s'), $titlecontain2, sprintf(__('%1$s %2$s'), __('not under'), Dropdown::getDropdownName($searchopt[$p['itemtype2'][$key]][$p['field2'][$key]]["table"], $p['contains2'][$key]))); break; default : $titlecontain2 = sprintf(__('%1$s = %2$s'), $titlecontain2, $p['contains2'][$key]); break; } } $title .= $titlecontain2; } } } if ($output_type == self::HTML_OUTPUT) { echo $headers_line_bottom; } // Display footer echo self::showFooter($output_type, $title); // Delete selected item if ($output_type == self::HTML_OUTPUT) { if ($showmassiveactions) { $massiveactionparams['ontop'] = false; Html::showMassiveActions($itemtype, $massiveactionparams); // End form for delete item Html::closeForm(); } else { echo "
    "; } } if ($output_type == self::HTML_OUTPUT) { // In case of HTML display Html::printPager($p['start'], $numrows, $target, $parameters, '', 0, $search_config); } } else { echo self::showError($output_type); } } else { echo $DBread->error(); } } /** * Get meta types available for search engine * * @param $itemtype type to display the form * * @return Array of available itemtype **/ static function getMetaItemtypeAvailable ($itemtype) { // Display meta search items $linked = array(); // Define meta search items to linked switch ($itemtype) { case 'Computer' : $linked = array('Monitor', 'Peripheral', 'Phone', 'Printer', 'Software'); break; case 'Ticket' : if (Session::haveRight("show_all_ticket","1")) { $linked = array_keys(Ticket::getAllTypesForHelpdesk()); } break; case 'Printer' : case 'Monitor' : case 'Peripheral' : case 'Software' : case 'Phone' : $linked = array('Computer'); break; } return $linked; } /** * Print generic search form * * @param $itemtype type to display the form * @param $params array of parameters may include field, contains, sort, is_deleted, link, * link2, contains2, field2, type2 * * @return nothing (displays) **/ static function showGenericSearch($itemtype, array $params) { global $CFG_GLPI; // Default values of parameters $p['link'] = array();// $p['field'] = array(); $p['contains'] = array(); $p['searchtype'] = array(); $p['sort'] = ''; $p['is_deleted'] = 0; $p['link2'] = '';// $p['contains2'] = ''; $p['field2'] = ''; $p['itemtype2'] = ''; $p['searchtype2'] = ''; foreach ($params as $key => $val) { $p[$key] = $val; } $options = self::getCleanedOptions($itemtype); $target = Toolbox::getItemTypeSearchURL($itemtype); // Instanciate an object to access method $item = NULL; if ($itemtype != 'AllAssets') { $item = getItemForItemtype($itemtype); } $linked = self::getMetaItemtypeAvailable($itemtype); echo ""; echo "
    "; echo ""; echo ""; if (($_SESSION["glpisearchcount"][$itemtype] + $_SESSION["glpisearchcount2"][$itemtype]) > 1) { echo ""; } echo "\n"; echo ""; echo "
    "; echo ""; echo ""; echo ""; echo ""; // Display normal search parameters for ($i=0 ; $i<$_SESSION["glpisearchcount"][$itemtype] ; $i++) { echo "\n"; } $metanames = array(); if (is_array($linked) && (count($linked) > 0)) { for ($i=0 ; $i<$_SESSION["glpisearchcount2"][$itemtype] ; $i++) { echo "\n"; } } echo "
    "; // First line display add / delete images for normal and meta search items if ($i == 0) { echo ""; echo ""; echo "+    "; if ($_SESSION["glpisearchcount"][$itemtype] > 1) { echo ""; echo ""; echo "-    "; } if (is_array($linked) && (count($linked) > 0)) { echo ""; echo ""; echo "+    "; if ($_SESSION["glpisearchcount2"][$itemtype] > 0) { echo ""; echo ""; echo "-    "; } } $itemtable = getTableForItemType($itemtype); if ($item && $item->maybeDeleted()) { echo ""; echo " \""."; echo '  '; } } // Display link item if ($i > 0) { echo " "; } $selected = $first = ''; // display select box to define search item echo "\n"; echo ""; echo "
    \n"; $used_itemtype = $itemtype; // Force Computer itemtype for AllAssets to permit to show specific items if ($itemtype == 'AllAssets') { $used_itemtype = 'Computer'; } $_POST['itemtype'] = $used_itemtype; $_POST['num'] = $i; $_POST['field'] = $selected; $_POST['searchtype'] = (is_array($p['searchtype']) && isset($p['searchtype'][$i])?$p['searchtype'][$i]:"" ); $_POST['value'] = (is_array($p['contains']) && isset($p['contains'][$i])?stripslashes($p['contains'][$i]):"" ); include (GLPI_ROOT."/ajax/searchoption.php"); echo "
    \n"; $params = array('field' => '__VALUE__', 'itemtype' => $used_itemtype, 'num' => $i, 'value' => $_POST["value"], 'searchtype' => $_POST["searchtype"]); Ajax::updateItemOnSelectEvent("Search$itemtype$i", "SearchSpan$itemtype$i", $CFG_GLPI["root_doc"]."/ajax/searchoption.php", $params); echo "
    "; $rand = mt_rand(); echo "
    "; // Display link item (not for the first item) echo " "; // Display select of the linked item type available echo " "; echo ""; // Ajax script for display search met& item echo " \n"; $params = array('itemtype' => '__VALUE__', 'num' => $i, 'field' => (is_array($p['field2']) && isset($p['field2'][$i])?$p['field2'][$i]:""), 'value' => (is_array($p['contains2']) && isset($p['contains2'][$i])?$p['contains2'][$i]:""), 'searchtype2' => (is_array($p['searchtype2']) && isset($p['searchtype2'][$i])?$p['searchtype2'][$i]:"")); Ajax::updateItemOnSelectEvent("itemtype2_".$itemtype."_".$i."_$rand", "show_".$itemtype."_".$i."_$rand", $CFG_GLPI["root_doc"]."/ajax/updateMetaSearch.php", $params); if (is_array($p['itemtype2']) && isset($p['itemtype2'][$i]) && !empty($p['itemtype2'][$i])) { $params['itemtype'] = $p['itemtype2'][$i]; Ajax::updateItem("show_".$itemtype."_".$i."_$rand", $CFG_GLPI["root_doc"]."/ajax/updateMetaSearch.php", $params); echo "\n"; } echo "
    "; echo "
    \n"; echo "
    "; echo ""; // Display sort selection /* echo "\n"; */ // Display deleted selection echo ""; // Display submit button echo "
    ".__('sorted by'); echo "  "; echo "
    "; echo ""; echo ""; Bookmark::showSaveButton(Bookmark::SEARCH, $itemtype); echo ""; echo "  \"".__s('Blank')."\""; echo "
    \n"; echo "
    \n"; // For dropdown echo ""; // Reset to start when submit new search echo ""; echo "
    "; Html::closeForm(); } /** * Generic Function to add GROUP BY to a request * * @param $LINK link to use * @param $NOT is is a negative search ? * @param $itemtype item type * @param $ID ID of the item to search * @param $searchtype search type ('contains' or 'equals') * @param $val value search * @param $meta is it a meta item ? * @param $num item number * * @return select string **/ static function addHaving($LINK, $NOT, $itemtype, $ID, $searchtype, $val, $meta, $num) { $searchopt = &self::getOptions($itemtype); $table = $searchopt[$ID]["table"]; $field = $searchopt[$ID]["field"]; $NAME = "ITEM_"; if ($meta) { $NAME = "META_"; } // Plugin can override core definition for its type if ($plug = isPluginItemType($itemtype)) { $function = 'plugin_'.$plug['plugin'].'_addHaving'; if (function_exists($function)) { $out = $function($LINK, $NOT, $itemtype, $ID, $val, $num); if (!empty($out)) { return $out; } } } //// Default cases // Link with plugin tables if (preg_match("/^glpi_plugin_([a-z0-9]+)/", $table, $matches)) { if (count($matches) == 2) { $plug = $matches[1]; $function = 'plugin_'.$plug.'_addHaving'; if (function_exists($function)) { $out = $function($LINK, $NOT, $itemtype, $ID, $val, $num); if (!empty($out)) { return $out; } } } } // Preformat items if (isset($searchopt[$ID]["datatype"])) { switch ($searchopt[$ID]["datatype"]) { case "number" : case "decimal" : case "timestamp" : $search = array("/\</","/\>/"); $replace = array("<",">"); $val = preg_replace($search, $replace, $val); if (preg_match("/([<>])([=]*)[[:space:]]*([0-9]+)/",$val,$regs)) { if ($NOT) { if ($regs[1] == '<') { $regs[1] = '>'; } else { $regs[1] = '<'; } } $regs[1] .= $regs[2]; return " $LINK (`$NAME$num` ".$regs[1]." ".$regs[3]." ) "; } if (is_numeric($val)) { if (isset($searchopt[$ID]["width"])) { if (!$NOT) { return " $LINK (`$NAME$num` < ".(intval($val) + $searchopt[$ID]["width"])." AND `$NAME$num` > ".(intval($val) - $searchopt[$ID]["width"]).") "; } return " $LINK (`$NAME$num` > ".(intval($val) + $searchopt[$ID]["width"])." OR `$NAME$num` < ".(intval($val) - $searchopt[$ID]["width"])." ) "; } // Exact search if (!$NOT) { return " $LINK (`$NAME$num` = ".(intval($val)).") "; } return " $LINK (`$NAME$num` <> ".(intval($val)).") "; } break; } } /* $ADD=""; if (($NOT && $val!="NULL") || $val=='^$') { $ADD = " OR `$NAME$num` IS NULL"; } return " $LINK (`$NAME$num`".self::makeTextSearch($val,$NOT)." $ADD ) "; */ return self::makeTextCriteria("`$NAME$num`",$val,$NOT,$LINK); } /** * Generic Function to add ORDER BY to a request * * @param $itemtype ID of the device type * @param $ID field to add * @param $order order define * @param $key item number (default 0) * * @return select string * **/ static function addOrderBy($itemtype, $ID, $order, $key=0) { global $CFG_GLPI; // Security test for order if ($order != "ASC") { $order = "DESC"; } $searchopt = &self::getOptions($itemtype); $table = $searchopt[$ID]["table"]; $field = $searchopt[$ID]["field"]; $addtable = ''; if (($table != getTableForItemType($itemtype)) && ($searchopt[$ID]["linkfield"] != getForeignKeyFieldForTable($table))) { $addtable .= "_".$searchopt[$ID]["linkfield"]; } if (isset($searchopt[$ID]['joinparams'])) { $complexjoin = self::computeComplexJoinID($searchopt[$ID]['joinparams']); if (!empty($complexjoin)) { $addtable .= "_".$complexjoin; } } if (isset($CFG_GLPI["union_search_type"][$itemtype])) { return " ORDER BY ITEM_$key $order "; } // Plugin can override core definition for its type if ($plug = isPluginItemType($itemtype)) { $function = 'plugin_'.$plug['plugin'].'_addOrderBy'; if (function_exists($function)) { $out = $function($itemtype, $ID, $order, $key); if (!empty($out)) { return $out; } } } switch($table.".".$field) { case "glpi_auth_tables.name" : $user_searchopt = self::getOptions('User'); return " ORDER BY `glpi_users`.`authtype` $order, `glpi_authldaps".$addtable."_". self::computeComplexJoinID($user_searchopt[30]['joinparams'])."`.`name` $order, `glpi_authmails".$addtable."_". self::computeComplexJoinID($user_searchopt[31]['joinparams'])."`.`name` $order "; case "glpi_users.name" : if ($itemtype!='User') { return " ORDER BY ".$table.$addtable.".`realname` $order, ".$table.$addtable.".`firstname` $order, ".$table.$addtable.".`name` $order"; } return " ORDER BY `".$table."`.`name` $order"; case "glpi_networkequipments.ip" : case "glpi_ipaddresses.name" : return " ORDER BY INET_ATON($table$addtable.$field) $order "; } //// Default cases // Link with plugin tables if (preg_match("/^glpi_plugin_([a-z0-9]+)/", $table, $matches)) { if (count($matches) == 2) { $plug = $matches[1]; $function = 'plugin_'.$plug.'_addOrderBy'; if (function_exists($function)) { $out = $function($itemtype, $ID, $order, $key); if (!empty($out)) { return $out; } } } } // Preformat items if (isset($searchopt[$ID]["datatype"])) { switch ($searchopt[$ID]["datatype"]) { case "date_delay" : $interval = "MONTH"; if (isset($searchopt[$ID]['delayunit'])) { $interval = $searchopt[$ID]['delayunit']; } $add_minus = ''; if (isset($searchopt[$ID]["datafields"][3])) { $add_minus = "- `$table$addtable`.`".$searchopt[$ID]["datafields"][3]."`"; } return " ORDER BY ADDDATE(`$table$addtable`.`".$searchopt[$ID]["datafields"][1]."`, INTERVAL (`$table$addtable`.`".$searchopt[$ID]["datafields"][2]. "` $add_minus) $interval) $order "; } } //return " ORDER BY $table.$field $order "; return " ORDER BY ITEM_$key $order "; } /** * Generic Function to add default columns to view * * @param $itemtype device type * * @return select string **/ static function addDefaultToView($itemtype) { global $CFG_GLPI; $toview = array(); $item = NULL; if ($itemtype != 'AllAssets') { $item = getItemForItemtype($itemtype); } // Add first element (name) array_push($toview, 1); // Add entity view : if (Session::isMultiEntitiesMode() && (isset($CFG_GLPI["union_search_type"][$itemtype]) || ($item && $item->maybeRecursive()) || (count($_SESSION["glpiactiveentities"]) > 1))) { array_push($toview, 80); } return $toview; } /** * Generic Function to add default select to a request * * @param $itemtype device type * * @return select string **/ static function addDefaultSelect($itemtype) { $itemtable = getTableForItemType($itemtype); $item = NULL; $mayberecursive = false; if ($itemtype != 'AllAssets') { $item = getItemForItemtype($itemtype); $mayberecursive = $item->maybeRecursive(); } $ret = ""; switch ($itemtype) { case 'ReservationItem' : $ret = "`glpi_reservationitems`.`is_active` AS ACTIVE, "; break; case 'CartridgeItem' : $ret = "`glpi_cartridgeitems`.`alarm_threshold` AS ALARM, "; break; case 'ConsumableItem' : $ret = "`glpi_consumableitems`.`alarm_threshold` AS ALARM, "; break; case 'FieldUnicity' : $ret = "`glpi_fieldunicities`.`itemtype` AS ITEMTYPE,"; break; default : // Plugin can override core definition for its type if ($plug = isPluginItemType($itemtype)) { $function = 'plugin_'.$plug['plugin'].'_addDefaultSelect'; if (function_exists($function)) { $ret = $function($itemtype); } } } if ($itemtable == 'glpi_entities') { $ret .= "`$itemtable`.`id` AS entities_id, '1' AS is_recursive, "; } else if ($mayberecursive) { $ret .= "`$itemtable`.`entities_id`, `$itemtable`.`is_recursive`, "; } return $ret; } /** * Generic Function to add select to a request * * @param $itemtype item type * @param $ID ID of the item to add * @param $num item num in the reque (default 0) * @param $meta boolean is a meta * @param $meta_type meta type table ID (default 0) * * @return select string **/ static function addSelect($itemtype, $ID, $num, $meta=0, $meta_type=0) { global $CFG_GLPI; $searchopt = &self::getOptions($itemtype); $table = $searchopt[$ID]["table"]; $field = $searchopt[$ID]["field"]; $addtable = ""; $NAME = "ITEM"; $complexjoin = ''; if (isset($searchopt[$ID]['joinparams'])) { $complexjoin = self::computeComplexJoinID($searchopt[$ID]['joinparams']); } if (((($table != getTableForItemType($itemtype)) && (!isset($CFG_GLPI["union_search_type"][$itemtype]) || ($CFG_GLPI["union_search_type"][$itemtype] != $table))) || !empty($complexjoin)) && ($searchopt[$ID]["linkfield"] != getForeignKeyFieldForTable($table))) { $addtable .= "_".$searchopt[$ID]["linkfield"]; } if (!empty($complexjoin)) { $addtable .= "_".$complexjoin; } if ($meta) { $NAME = "META"; if (getTableForItemType($meta_type)!=$table) { $addtable .= "_".$meta_type; } } // Plugin can override core definition for its type if ($plug = isPluginItemType($itemtype)) { $function = 'plugin_'.$plug['plugin'].'_addSelect'; if (function_exists($function)) { $out = $function($itemtype,$ID,$num); if (!empty($out)) { return $out; } } } $ADDITONALFIELDS = ''; if (isset($searchopt[$ID]["additionalfields"]) && count($searchopt[$ID]["additionalfields"])) { foreach ($searchopt[$ID]["additionalfields"] as $key) { $ADDITONALFIELDS .= "`$table$addtable`.`$key` AS ".$NAME."_".$num."_$key, "; } } switch ($table.".".$field) { case "glpi_tickets.due_date" : return " `$table$addtable`.`$field` AS ".$NAME."_$num, `$table$addtable`.`status` AS ".$NAME."_".$num."_2, $ADDITONALFIELDS"; case "glpi_tickets.is_late" : return " IF(`$table$addtable`.`due_date` IS NOT NULL AND (`$table$addtable`.`solvedate` > `$table$addtable`.`due_date` OR (`$table$addtable`.`solvedate` IS NULL AND `$table$addtable`.`due_date` < NOW())), 1, 0) AS ".$NAME."_$num, $ADDITONALFIELDS"; case "glpi_contacts.completename" : // Contact for display in the enterprise item if ($_SESSION["glpinames_format"] == User::FIRSTNAME_BEFORE) { $name1 = 'firstname'; $name2 = 'name'; } else { $name1 = 'name'; $name2 = 'firstname'; } return " GROUP_CONCAT(DISTINCT CONCAT(`$table$addtable`.`$name1`, ' ', `$table$addtable`.`$name2`, '$$', `$table$addtable`.`id`) SEPARATOR '$$$$') AS ".$NAME."_$num, $ADDITONALFIELDS"; case "glpi_users.name" : if ($itemtype != 'User') { if ((isset($searchopt[$ID]["forcegroupby"]) && $searchopt[$ID]["forcegroupby"])) { $addaltemail = ""; if ((($itemtype == 'Ticket') || ($itemtype == 'Problem')) && isset($searchopt[$ID]['joinparams']['beforejoin']['table']) && (($searchopt[$ID]['joinparams']['beforejoin']['table'] == 'glpi_tickets_users') || ($searchopt[$ID]['joinparams']['beforejoin']['table'] == 'glpi_problems_users'))) { // For tickets_users $ticket_user_table = $searchopt[$ID]['joinparams']['beforejoin']['table']. "_".self::computeComplexJoinID($searchopt[$ID]['joinparams']['beforejoin']['joinparams']); $addaltemail = "GROUP_CONCAT(DISTINCT CONCAT(`$ticket_user_table`.`users_id`, ' ', `$ticket_user_table`.`alternative_email`) SEPARATOR '$$$$') AS ".$NAME."_".$num."_2, "; } return " GROUP_CONCAT(DISTINCT `$table$addtable`.`id` SEPARATOR '$$$$') AS ".$NAME."_".$num.", $addaltemail $ADDITONALFIELDS"; } return " `$table$addtable`.`$field` AS ".$NAME."_$num, `$table$addtable`.`realname` AS ".$NAME."_".$num."_2, `$table$addtable`.`id` AS ".$NAME."_".$num."_3, `$table$addtable`.`firstname` AS ".$NAME."_".$num."_4, $ADDITONALFIELDS"; } break; case "glpi_groups.name" : if (($itemtype != 'Group') && ($itemtype != 'User')) { if ($meta || (isset($searchopt[$ID]["forcegroupby"]) && $searchopt[$ID]["forcegroupby"])) { return " GROUP_CONCAT(DISTINCT CONCAT(`$table$addtable`.`$field`,'$$', `$table$addtable`.`id`) SEPARATOR '$$$$') AS ".$NAME."_$num, "; } return " `$table$addtable`.`$field` AS ".$NAME."_$num, $ADDITONALFIELDS"; } break; case "glpi_softwarelicenses.number" : return " FLOOR(SUM(`$table$addtable`.`$field`) * COUNT(DISTINCT `$table$addtable`.`id`) / COUNT(`$table$addtable`.`id`)) AS ".$NAME."_".$num.", MIN(`$table$addtable`.`$field`) AS ".$NAME."_".$num."_2, $ADDITONALFIELDS"; case "glpi_documents_items.count" : return " COUNT(DISTINCT `glpi_documents_items`.`id`) AS ".$NAME."_".$num.", $ADDITONALFIELDS"; case "glpi_contracts_items.count" : return " COUNT(DISTINCT `glpi_contracts_items`.`id`) AS ".$NAME."_".$num.", $ADDITONALFIELDS"; case "glpi_contractcosts.totalcost" : return " SUM(`glpi_contractcosts$addtable`.`cost`) / COUNT(`glpi_contractcosts$addtable`.`id`) * COUNT(DISTINCT `glpi_contractcosts$addtable`.`id`) AS ".$NAME."_".$num.", $ADDITONALFIELDS"; case "glpi_computers_softwareversions.count" : return " COUNT(DISTINCT `glpi_computers_softwareversions$addtable`.`id`) AS ".$NAME."_".$num.", $ADDITONALFIELDS"; case "glpi_items_deviceharddrives.capacity" : if ($itemtype != 'DeviceHardDrive') { return " SUM(`glpi_items_deviceharddrives`.`capacity`) / COUNT(`glpi_items_deviceharddrives`.`id`) * COUNT(DISTINCT `glpi_items_deviceharddrives`.`id`) AS ".$NAME."_".$num.", $ADDITONALFIELDS"; } break; case "glpi_items_devicememories.size" : if ($itemtype != 'DeviceMemory') { return " SUM(`glpi_items_devicememories`.`size`) / COUNT(`glpi_items_devicememories`.`id`) * COUNT(DISTINCT `glpi_items_devicememories`.`id`) AS ".$NAME."_".$num.", $ADDITONALFIELDS"; } break; case "glpi_items_deviceprocessors.frequency" : if ($itemtype != 'DeviceProcessor') { return " SUM(`glpi_items_deviceprocessors`.`frequency`) / COUNT(`glpi_items_deviceprocessors`.`id`) AS ".$NAME."_".$num.", $ADDITONALFIELDS"; } break; case "glpi_problems.count" : case "glpi_problemtasks.count" : case "glpi_tickets.count" : case "glpi_ticketfollowups.count" : case "glpi_tickettasks.count" : case "glpi_tickets_tickets.count" : case "glpi_items_problems.count" : case "glpi_problems_tickets.count" : return " COUNT(DISTINCT `$table$addtable`.`id`) AS ".$NAME."_".$num.", $ADDITONALFIELDS"; case "glpi_ticketcosts.cost_time" : case "glpi_ticketcosts.cost_fixed" : case "glpi_ticketcosts.cost_material" : return " SUM(`glpi_ticketcosts$addtable`.`$field`) / COUNT(`glpi_ticketcosts$addtable`.`id`) * COUNT(DISTINCT `glpi_ticketcosts$addtable`.`id`) AS ".$NAME."_".$num.", $ADDITONALFIELDS"; case "glpi_ticketcosts.totalcost" : return " SUM(`glpi_ticketcosts$addtable`.`actiontime` * `glpi_ticketcosts$addtable`.`cost_time`/".HOUR_TIMESTAMP." + `glpi_ticketcosts$addtable`.`cost_fixed` + `glpi_ticketcosts$addtable`.`cost_material`) / COUNT(`glpi_ticketcosts$addtable`.`id`) * COUNT(DISTINCT `glpi_ticketcosts$addtable`.`id`) AS ".$NAME."_".$num.", $ADDITONALFIELDS"; case "glpi_tickets_tickets.tickets_id_1" : return " GROUP_CONCAT(`$table$addtable`.`tickets_id_1` SEPARATOR '$$$$') AS ".$NAME."_$num, GROUP_CONCAT(`$table$addtable`.`tickets_id_2` SEPARATOR '$$$$') AS ".$NAME."_".$num."_2, $ADDITONALFIELDS"; case "glpi_networkports.mac" : $port = " GROUP_CONCAT(`$table$addtable`.`$field` SEPARATOR '$$$$') AS ".$NAME."_$num, "; if ($itemtype == 'Computer') { $port .= " GROUP_CONCAT(`glpi_items_devicenetworkcards`.`mac` SEPARATOR '$$$$') AS ".$NAME."_".$num."_2, "; } return $port.$ADDITONALFIELDS; case "glpi_profiles.name" : if (($itemtype == 'User') && ($ID == 20)) { return " GROUP_CONCAT(`$table$addtable`.`$field` SEPARATOR '$$$$') AS ".$NAME."_$num, GROUP_CONCAT(`glpi_profiles_users`.`entities_id` SEPARATOR '$$$$') AS ".$NAME."_".$num."_2, GROUP_CONCAT(`glpi_profiles_users`.`is_recursive` SEPARATOR '$$$$') AS ".$NAME."_".$num."_3, $ADDITONALFIELDS"; } break; case "glpi_entities.completename" : if (($itemtype == 'User') && ($ID == 80)) { return " GROUP_CONCAT(`$table$addtable`.`completename` SEPARATOR '$$$$') AS ".$NAME."_$num, GROUP_CONCAT(`glpi_profiles_users`.`profiles_id` SEPARATOR '$$$$') AS ".$NAME."_".$num."_2, GROUP_CONCAT(`glpi_profiles_users`.`is_recursive` SEPARATOR '$$$$') AS ".$NAME."_".$num."_3, $ADDITONALFIELDS"; } break; case "glpi_auth_tables.name": $user_searchopt = self::getOptions('User'); return " `glpi_users`.`authtype` AS ".$NAME."_".$num.", `glpi_users`.`auths_id` AS ".$NAME."_".$num."_2, `glpi_authldaps".$addtable."_". self::computeComplexJoinID($user_searchopt[30]['joinparams'])."`.`$field` AS ".$NAME."_".$num."_3, `glpi_authmails".$addtable."_". self::computeComplexJoinID($user_searchopt[31]['joinparams'])."`.`$field` AS ".$NAME."_".$num."_4, $ADDITONALFIELDS"; case "glpi_softwarelicenses.name" : case "glpi_softwareversions.name" : if ($meta) { return " GROUP_CONCAT(DISTINCT CONCAT(`glpi_softwares`.`name`, ' - ', `$table$addtable`.`$field`, '$$', `$table$addtable`.`id`) SEPARATOR '$$$$') AS ".$NAME."_".$num.", $ADDITONALFIELDS"; } break; case "glpi_softwarelicenses.serial" : case "glpi_softwarelicenses.otherserial" : case "glpi_softwarelicenses.comment" : case "glpi_softwareversions.comment" : if ($meta) { return " GROUP_CONCAT(DISTINCT CONCAT(`glpi_softwares`.`name`, ' - ', `$table$addtable`.`$field`,'$$', `$table$addtable`.`id`) SEPARATOR '$$$$') AS ".$NAME."_".$num.", $ADDITONALFIELDS"; } return " GROUP_CONCAT(DISTINCT CONCAT(`$table$addtable`.`name`, ' - ', `$table$addtable`.`$field`, '$$', `$table$addtable`.`id`) SEPARATOR '$$$$') AS ".$NAME."_".$num.", $ADDITONALFIELDS"; case "glpi_states.name" : if ($meta && ($meta_type == 'Software')) { return " GROUP_CONCAT(DISTINCT CONCAT(`glpi_softwares`.`name`, ' - ', `glpi_softwareversions$addtable`.`name`, ' - ', `$table$addtable`.`$field`, '$$', `$table$addtable`.`id`) SEPARATOR '$$$$') AS ".$NAME."_".$num.", $ADDITONALFIELDS"; } else if ($itemtype == 'Software') { return " GROUP_CONCAT(DISTINCT CONCAT(`glpi_softwareversions`.`name`, ' - ', `$table$addtable`.`$field`,'$$', `$table$addtable`.`id`) SEPARATOR '$$$$') AS ".$NAME."_".$num.", $ADDITONALFIELDS"; } break; case 'glpi_crontasks.description' : return " `glpi_crontasks`.`name` AS ".$NAME."_".$num.", $ADDITONALFIELDS"; case 'glpi_notifications.event' : return " `glpi_notifications`.`itemtype` AS `itemtype`, `glpi_notifications`.`event` AS ".$NAME."_".$num.", $ADDITONALFIELDS"; case 'glpi_tickets.name' : if (isset($searchopt[$ID]['forcegroupby']) && $searchopt[$ID]['forcegroupby']) { return " GROUP_CONCAT(DISTINCT CONCAT(`$table$addtable`.`$field`,'$$', `$table$addtable`.`id`) SEPARATOR '$$$$') AS ".$NAME."_".$num.", $ADDITONALFIELDS"; } return " `$table$addtable`.`$field` AS ".$NAME."_$num, `$table$addtable`.`id` AS ".$NAME."_".$num."_2, `$table$addtable`.`content` AS ".$NAME."_".$num."_3, `$table$addtable`.`status` AS ".$NAME."_".$num."_4, $ADDITONALFIELDS"; case 'glpi_tickets.items_id': return " `$table$addtable`.`$field` AS ".$NAME."_$num, `$table$addtable`.`itemtype` AS ".$NAME."_".$num."_2, $ADDITONALFIELDS"; } //// Default cases // Link with plugin tables if (preg_match("/^glpi_plugin_([a-z0-9]+)/", $table, $matches)) { if (count($matches) == 2) { $plug = $matches[1]; $function = 'plugin_'.$plug.'_addSelect'; if (function_exists($function)) { $out = $function($itemtype, $ID, $num); if (!empty($out)) { return $out; } } } } $tocompute = "`$table$addtable`.`$field`"; $tocomputeid = "`$table$addtable`.`id`"; if (isset($searchopt[$ID]["computation"])) { $tocompute = $searchopt[$ID]["computation"]; $tocompute = str_replace("TABLE", "`$table$addtable`", $tocompute); } // Preformat items if (isset($searchopt[$ID]["datatype"])) { switch ($searchopt[$ID]["datatype"]) { case "date_delay" : $interval = "MONTH"; if (isset($searchopt[$ID]['delayunit'])) { $interval = $searchopt[$ID]['delayunit']; } $add_minus = ''; if (isset($searchopt[$ID]["datafields"][3])) { $add_minus = "-`$table$addtable`.`".$searchopt[$ID]["datafields"][3]."`"; } if ($meta || (isset($searchopt[$ID]["forcegroupby"]) && $searchopt[$ID]["forcegroupby"])) { return " GROUP_CONCAT(DISTINCT ADDDATE(`$table$addtable`.`". $searchopt[$ID]["datafields"][1]."`, INTERVAL (`$table$addtable`.`". $searchopt[$ID]["datafields"][2]. "` $add_minus) $interval) SEPARATOR '$$$$') AS ".$NAME."_$num, $ADDITONALFIELDS"; } return "ADDDATE(`$table$addtable`.`".$searchopt[$ID]["datafields"][1]."`, INTERVAL (`$table$addtable`.`".$searchopt[$ID]["datafields"][2]. "` $add_minus) $interval) AS ".$NAME."_$num, $ADDITONALFIELDS"; case "itemlink" : if ($meta || (isset($searchopt[$ID]["forcegroupby"]) && $searchopt[$ID]["forcegroupby"])) { return " GROUP_CONCAT(DISTINCT CONCAT(`$table$addtable`.`$field`, '$$' , `$table$addtable`.`id`) SEPARATOR '$$$$') AS ".$NAME."_$num, $ADDITONALFIELDS"; } return " $tocompute AS ".$NAME."_$num, `$table$addtable`.`id` AS ".$NAME."_".$num."_2, $ADDITONALFIELDS"; } } // Default case if ($meta || (isset($searchopt[$ID]["forcegroupby"]) && $searchopt[$ID]["forcegroupby"])) { return " GROUP_CONCAT(DISTINCT CONCAT($tocompute,'$$',$tocomputeid) SEPARATOR '$$$$') AS ".$NAME."_$num, $ADDITONALFIELDS"; } return "$tocompute AS ".$NAME."_$num, $ADDITONALFIELDS"; } /** * Generic Function to add default where to a request * * @param $itemtype device type * * @return select string **/ static function addDefaultWhere($itemtype) { global $CFG_GLPI; switch ($itemtype) { case 'Reminder' : return Reminder::addVisibilityRestrict(); case 'Notification' : if (!Session::haveRight('config','w')) { return " `glpi_notifications`.`itemtype` NOT IN ('Crontask', 'DBConnection') "; } break; // No link case 'User' : // View all entities if (Session::isViewAllEntities()) { return ""; } return getEntitiesRestrictRequest("","glpi_profiles_users"); case 'Ticket' : // Same structure in addDefaultJoin $condition = ''; if (!Session::haveRight("show_all_ticket","1")) { $searchopt = &self::getOptions($itemtype); $requester_table = '`glpi_tickets_users_'. self::computeComplexJoinID($searchopt[4]['joinparams']['beforejoin']['joinparams']).'`'; $requestergroup_table = '`glpi_groups_tickets_'. self::computeComplexJoinID($searchopt[71]['joinparams']['beforejoin']['joinparams']).'`'; $assign_table = '`glpi_tickets_users_'. self::computeComplexJoinID($searchopt[5]['joinparams']['beforejoin']['joinparams']).'`'; $assigngroup_table = '`glpi_groups_tickets_'. self::computeComplexJoinID($searchopt[8]['joinparams']['beforejoin']['joinparams']).'`'; $observer_table = '`glpi_tickets_users_'. self::computeComplexJoinID($searchopt[66]['joinparams']['beforejoin']['joinparams']).'`'; $observergroup_table = '`glpi_groups_tickets_'. self::computeComplexJoinID($searchopt[65]['joinparams']['beforejoin']['joinparams']).'`'; $condition = "("; $condition .= " $requester_table.users_id = '".Session::getLoginUserID()."' OR $observer_table.users_id = '".Session::getLoginUserID()."' OR `glpi_tickets`.`users_id_recipient` = '".Session::getLoginUserID()."' "; if (Session::haveRight("show_group_ticket",1)) { if (count($_SESSION['glpigroups'])) { $condition .= " OR $requestergroup_table.`groups_id` IN ('".implode("','",$_SESSION['glpigroups'])."')"; $condition .= " OR $observergroup_table.`groups_id` IN ('".implode("','",$_SESSION['glpigroups'])."')"; } } if (Session::haveRight("own_ticket","1")) {// Can own ticket : show assign to me $condition .= " OR $assign_table.users_id = '".Session::getLoginUserID()."' "; } if (Session::haveRight("show_assign_ticket","1")) { // show mine + assign to me $condition .=" OR $assign_table.`users_id` = '".Session::getLoginUserID()."'"; if (count($_SESSION['glpigroups'])) { $condition .= " OR $assigngroup_table.`groups_id` IN ('".implode("','",$_SESSION['glpigroups'])."')"; } if (Session::haveRight('assign_ticket',1)) { $condition .= " OR `glpi_tickets`.`status`='".CommonITILObject::INCOMING."'"; } } if (Session::haveRight('validate_incident', 1) || Session::haveRight('validate_request', 1)) { $condition .= " OR `glpi_ticketvalidations`.`users_id_validate` = '".Session::getLoginUserID()."'"; } $condition .= ") "; } return $condition; default : // Plugin can override core definition for its type if ($plug = isPluginItemType($itemtype)) { $function = 'plugin_'.$plug['plugin'].'_addDefaultWhere'; if (function_exists($function)) { $out = $function($itemtype); if (!empty($out)) { return $out; } } } return ""; } } /** * Generic Function to add where to a request * * @param $link link string * @param $nott is it a negative search ? * @param $itemtype item type * @param $ID ID of the item to search * @param $searchtype searchtype used (equals or contains) * @param $val item num in the request * @param $meta is a meta search (meta=2 in search.class.php) (default 0) * * @return select string **/ static function addWhere($link, $nott, $itemtype, $ID, $searchtype, $val, $meta=0) { $searchopt = &self::getOptions($itemtype); $table = $searchopt[$ID]["table"]; $field = $searchopt[$ID]["field"]; $inittable = $table; $addtable = ''; if ($table != 'asset_types' && ($table != getTableForItemType($itemtype)) && ($searchopt[$ID]["linkfield"] != getForeignKeyFieldForTable($table))) { $addtable = "_".$searchopt[$ID]["linkfield"]; $table .= $addtable; } if (isset($searchopt[$ID]['joinparams'])) { $complexjoin = self::computeComplexJoinID($searchopt[$ID]['joinparams']); if (!empty($complexjoin)) { $table .= "_".$complexjoin; } } if ($meta && (getTableForItemType($itemtype) != $table)) { $table .= "_".$itemtype; } // Hack to allow search by ID on every sub-table if (preg_match('/^\$\$\$\$([0-9]+)$/',$val,$regs)) { return $link." (`$table`.`id` ".($nott?"<>":"=").$regs[1]." ". (($regs[1] == 0)?" OR `$table`.`id` IS NULL":'').") "; } // Preparse value if (isset($searchopt[$ID]["datatype"])) { switch ($searchopt[$ID]["datatype"]) { case "datetime" : case "date" : case "date_delay" : $force_day = true; if ($searchopt[$ID]["datatype"] == 'datetime') { $force_day = false; } if (strstr($val,'BEGIN') || strstr($val,'LAST')) { $force_day = true; } $val = Html::computeGenericDateTimeSearch($val, $force_day); break; } } switch ($searchtype) { case "contains" : $SEARCH = self::makeTextSearch($val, $nott); break; case "equals" : if ($nott) { $SEARCH = " <> '$val'"; } else { $SEARCH = " = '$val'"; } break; case "notequals" : if ($nott) { $SEARCH = " = '$val'"; } else { $SEARCH = " <> '$val'"; } break; case "under" : if ($nott) { $SEARCH = " NOT IN ('".implode("','",getSonsOf($inittable, $val))."')"; } else { $SEARCH = " IN ('".implode("','",getSonsOf($inittable, $val))."')"; } break; case "notunder" : if ($nott) { $SEARCH = " IN ('".implode("','",getSonsOf($inittable, $val))."')"; } else { $SEARCH = " NOT IN ('".implode("','",getSonsOf($inittable, $val))."')"; } break; } // Plugin can override core definition for its type if ($plug = isPluginItemType($itemtype)) { $function = 'plugin_'.$plug['plugin'].'_addWhere'; if (function_exists($function)) { $out = $function($link,$nott,$itemtype,$ID,$val); if (!empty($out)) { return $out; } } } switch ($inittable.".".$field) { // case "glpi_users_validation.name" : case "glpi_users.name" : if ($itemtype == 'User') { // glpi_users case / not link table if (in_array($searchtype, array('equals', 'notequals'))) { return " $link `$table`.`id`".$SEARCH; } return self::makeTextCriteria("`$table`.`$field`", $val, $nott, $link); } if ($_SESSION["glpinames_format"] == User::FIRSTNAME_BEFORE) { $name1 = 'firstname'; $name2 = 'realname'; } else { $name1 = 'realname'; $name2 = 'firstname'; } if (in_array($searchtype, array('equals', 'notequals'))) { return " $link (`$table`.`id`".$SEARCH. (($val == 0)?" OR `$table`.`id` IS NULL":'').') '; } $toadd = ''; $tmplink = 'OR'; if ($nott) { $tmplink = 'AND'; } if (($itemtype == 'Ticket') || ($itemtype == 'Problem')) { if (isset($searchopt[$ID]["joinparams"]["beforejoin"]["table"]) && isset($searchopt[$ID]["joinparams"]["beforejoin"]["joinparams"]) && (($searchopt[$ID]["joinparams"]["beforejoin"]["table"] == 'glpi_tickets_users') || ($searchopt[$ID]["joinparams"]["beforejoin"]["table"] == 'glpi_problems_users'))) { $bj = $searchopt[$ID]["joinparams"]["beforejoin"]; $linktable = $bj['table'].'_'.self::computeComplexJoinID($bj['joinparams']); //$toadd = "`$linktable`.`alternative_email` $SEARCH $tmplink "; $toadd = self::makeTextCriteria("`$linktable`.`alternative_email`", $val, $nott, $tmplink); } } $toadd2 = ''; if ($nott && ($val != 'NULL') && ($val != 'null')) { $toadd2 = " OR `$table`.`$field` IS NULL"; } return $link." (((`$table`.`$name1` $SEARCH $tmplink `$table`.`$name2` $SEARCH $tmplink `$table`.`$field` $SEARCH $tmplink CONCAT(`$table`.`$name1`, ' ', `$table`.`$name2`) $SEARCH ) $toadd2) $toadd)"; // case "glpi_groups.name" : // $linkfield = ""; // if (in_array($searchtype, array('equals', 'notequals'))) { // return " $link (`$table`.`id`".$SEARCH. // ($val==0?" OR `$table`.`id` IS NULL":'').') '; // } // return self::makeTextCriteria("`$table`.`$field`", $val, $nott, $link); case "glpi_networkports.mac" : if ($itemtype == 'Computer') { return "$link (".self::makeTextCriteria("`glpi_items_devicenetworkcards`.`mac`", $val, $nott,''). self::makeTextCriteria("`$table`.`$field`", $val ,$nott, 'OR').")"; } return self::makeTextCriteria("`$table`.`$field`", $val, $nott, $link); case "glpi_infocoms.sink_type" : $ADD = ""; if ($nott && ($val != 'NULL') && ($val != 'null')) { $ADD = " OR `$table`.`$field` IS NULL"; } if (stristr($val,Infocom::getAmortTypeName(1))) { $val = 1; } else if (stristr($val,Infocom::getAmortTypeName(2))) { $val = 2; } if (is_int($val) && ($val > 0)) { if ($nott) { return $link." (`$table`.`$field` <> '$val' ". $ADD." ) "; } return $link." (`$table`.`$field` = '$val' ". $ADD." ) "; } break; case "glpi_contacts.completename" : if (in_array($searchtype, array('equals', 'notequals'))) { return " $link `$table`.`id`".$SEARCH; } if ($_SESSION["glpinames_format"] == User::FIRSTNAME_BEFORE) { $name1 = 'firstname'; $name2 = 'name'; } else { $name1 = 'name'; $name2 = 'firstname'; } $tmplink = 'OR'; if ($nott) { $tmplink = 'AND'; } return $link." (`$table`.`$name1` $SEARCH $tmplink `$table`.`$name2` $SEARCH $tmplink CONCAT(`$table`.`$name1`,' ',`$table`.`$name2`) $SEARCH) "; case "glpi_auth_tables.name" : $user_searchopt = self::getOptions('User'); $tmplink = 'OR'; if ($nott) { $tmplink = 'AND'; } return $link." (`glpi_authmails".$addtable."_". self::computeComplexJoinID($user_searchopt[31]['joinparams'])."`.`name` $SEARCH $tmplink `glpi_authldaps".$addtable."_". self::computeComplexJoinID($user_searchopt[30]['joinparams'])."`.`name` $SEARCH ) "; case "glpi_contracts.renewal" : $valid = Contract::getContractRenewalIDByName($val); if ($valid > 0) { return $link." `$table`.`$field`"."="."'$valid'"; } return ""; case "glpi_profiles.interface" : if (stristr(Profile::getInterfaceName('central'),$val)) { return $link." `$table`.`$field`='central'"; } if (stristr(Profile::getInterfaceName('helpdesk'),$val)) { return $link." `$table`.`$field`='helpdesk'"; } return ""; case "glpi_ipaddresses.name" : $search = array("/\</","/\>/"); $replace = array("<",">"); $val = preg_replace($search, $replace, $val); if (preg_match("/^\s*([<>])([=]*)[[:space:]]*([0-9\.]+)/",$val,$regs)) { if ($nott) { if ($regs[1] == '<') { $regs[1] = '>'; } else { $regs[1] = '<'; } } $regs[1] .= $regs[2]; return $link." (INET_ATON(`$table`.`$field`) ".$regs[1]." INET_ATON('".$regs[3]."')) "; } // return self::makeTextCriteria("`$table`.`$field`", $val, $nott, $link); break; case "glpi_tickets.status" : case "glpi_problems.status" : case "glpi_changes.status" : if ($val == 'all') { return ""; } $tocheck = array(); if ($item = getItemForItemtype($itemtype)) { switch ($val) { case 'process' : $tocheck = $item->getProcessStatusArray(); break; case 'notclosed' : $tocheck = $item->getAllStatusArray(); foreach ($item->getClosedStatusArray() as $status) { if (isset($tocheck[$status])) { unset($tocheck[$status]); } } $tocheck = array_keys($tocheck); break; case 'old' : $tocheck = array_merge($item->getSolvedStatusArray(), $item->getClosedStatusArray()); break; case 'notold' : $tocheck = $item->getAllStatusArray(); foreach ($item->getSolvedStatusArray() as $status) { if (isset($tocheck[$status])) { unset($tocheck[$status]); } } foreach ($item->getClosedStatusArray() as $status) { if (isset($tocheck[$status])) { unset($tocheck[$status]); } } $tocheck = array_keys($tocheck); break; } } if (count($tocheck) == 0) { $tocheck = array($val); } if (count($tocheck)) { if ($nott) { return $link." `$table`.`$field` NOT IN ('".implode("','",$tocheck)."')"; } return $link." `$table`.`$field` IN ('".implode("','",$tocheck)."')"; } break; case "glpi_tickets_tickets.tickets_id_1" : $tmplink = 'OR'; $compare = '='; if ($nott) { $tmplink = 'AND'; $compare = '<>'; } $toadd2 = ''; if ($nott && ($val != 'NULL') && ($val != 'null')) { $toadd2 = " OR `$table`.`$field` IS NULL"; } return $link." (((`$table`.`tickets_id_1` $compare '$val' $tmplink `$table`.`tickets_id_2` $compare '$val') AND `glpi_tickets`.`id` <> '$val') $toadd2)"; case "glpi_tickets.priority" : case "glpi_tickets.impact" : case "glpi_tickets.urgency" : case "glpi_projects.priority" : case "glpi_projects.impact" : case "glpi_projects.urgency" : if (is_numeric($val)) { if ($val > 0) { return $link." `$table`.`$field` = '$val'"; } if ($val < 0) { return $link." `$table`.`$field` >= '".abs($val)."'"; } // Show all return $link." `$table`.`$field` >= '0' "; } return ""; case "glpi_tickets.global_validation" : case "glpi_ticketvalidations.status" : $tocheck = array('none' => array('none'), 'waiting' => array('waiting'), 'rejected' => array('rejected'), 'accepted' => array('accepted'), 'can' => array('none', 'accepted'), 'all' => array('none', 'waiting', 'rejected', 'accepted')); if (isset($tocheck[$val])) { foreach ($tocheck[$val] as $key => $nval) { $tocheck[$val][$key] = " `$table`.`$field` = '$nval' "; } return $link.'('.implode(' OR ', $tocheck[$val]).')'; } if ($val == 'all') { return ""; } break; case "glpi_ticketsatisfactions.type" : return $link." `$table`.`$field` = '$val' "; case "glpi_tickets.is_late" : return " $link IF(`$table$addtable`.`due_date` IS NOT NULL AND (`$table$addtable`.`solvedate` > `$table$addtable`.`due_date` OR (`$table$addtable`.`solvedate` IS NULL AND `$table$addtable`.`due_date` < NOW())), 1, 0) $SEARCH "; } //// Default cases // Link with plugin tables if (preg_match("/^glpi_plugin_([a-z0-9]+)/", $inittable, $matches)) { if (count($matches) == 2) { $plug = $matches[1]; $function = 'plugin_'.$plug.'_addWhere'; if (function_exists($function)) { $out = $function($link, $nott, $itemtype, $ID, $val); if (!empty($out)) { return $out; } } } } $tocompute = "`$table`.`$field`"; if (isset($searchopt[$ID]["computation"])) { $tocompute = $searchopt[$ID]["computation"]; $tocompute = str_replace("TABLE", "`$table`", $tocompute); } // Preformat items if (isset($searchopt[$ID]["datatype"])) { switch ($searchopt[$ID]["datatype"]) { case "itemtypename" : if (in_array($searchtype, array('equals', 'notequals'))) { return " $link (`$table`.`$field`".$SEARCH.') '; } break; case "itemlink" : if (in_array($searchtype, array('equals', 'notequals'))) { return " $link (`$table`.`id`".$SEARCH.') '; } break; case "datetime" : case "date" : case "date_delay" : if ($searchopt[$ID]["datatype"] == 'datetime') { // Specific search for datetime if (in_array($searchtype, array('equals', 'notequals'))) { $val = preg_replace("/:00$/",'',$val); $val = '^'.$val; if ($searchtype == 'notequals') { $nott = !$nott; } return self::makeTextCriteria("`$table`.`$field`", $val, $nott, $link); } } if ($searchtype == 'lessthan') { $val = '<'.$val; } if ($searchtype == 'morethan') { $val = '>'.$val; } if ($searchtype) { $date_computation = $tocompute; } $search_unit = ' MONTH '; if (isset($searchopt[$ID]['searchunit'])) { $search_unit = $searchopt[$ID]['searchunit']; } if ($searchopt[$ID]["datatype"]=="date_delay") { $delay_unit = ' MONTH '; if (isset($searchopt[$ID]['delayunit'])) { $delay_unit = $searchopt[$ID]['delayunit']; } $add_minus = ''; if (isset($searchopt[$ID]["datafields"][3])) { $add_minus = "-`$table`.`".$searchopt[$ID]["datafields"][3]."`"; } $date_computation = "ADDDATE(`$table`.".$searchopt[$ID]["datafields"][1].", INTERVAL (`$table`.".$searchopt[$ID]["datafields"][2]." $add_minus) $delay_unit)"; } if (in_array($searchtype, array('equals', 'notequals'))) { return " $link ($date_computation ".$SEARCH.') '; } $search = array("/\</","/\>/"); $replace = array("<",">"); $val = preg_replace($search,$replace,$val); if (preg_match("/^\s*([<>=]+)(.*)/",$val,$regs)) { if (is_numeric($regs[2])) { return $link." $date_computation ".$regs[1]." ADDDATE(NOW(), INTERVAL ".$regs[2]." $search_unit) "; } // ELSE Reformat date if needed $regs[2] = preg_replace('@(\d{1,2})(-|/)(\d{1,2})(-|/)(\d{4})@','\5-\3-\1', $regs[2]); if (preg_match('/[0-9]{2,4}-[0-9]{1,2}-[0-9]{1,2}/', $regs[2])) { return $link." $date_computation ".$regs[1]." '".$regs[2]."'"; } return ""; } // ELSE standard search // Date format modification if needed $val = preg_replace('@(\d{1,2})(-|/)(\d{1,2})(-|/)(\d{4})@','\5-\3-\1', $val); return self::makeTextCriteria($date_computation, $val, $nott, $link); case "right" : if (($val == 'NULL') || ($val == 'null')) { return $link." $tocompute IS ".($nott?'NOT':'')." NULL "; } return $link." $tocompute = '$val' "; case "bool" : if (!is_numeric($val)) { if (strcasecmp($val,__('No')) == 0) { $val = 0; } else if (strcasecmp($val,__('Yes')) == 0) { $val = 1; } } // No break here : use number comparaison case case "number" : case "decimal" : case "timestamp" : $search = array("/\</", "/\>/"); $replace = array("<", ">"); $val = preg_replace($search, $replace, $val); if (preg_match("/([<>])([=]*)[[:space:]]*([0-9]+)/", $val, $regs)) { if ($nott) { if ($regs[1] == '<') { $regs[1] = '>'; } else { $regs[1] = '<'; } } $regs[1] .= $regs[2]; return $link." ($tocompute ".$regs[1]." ".$regs[3].") "; } if (is_numeric($val)) { if (isset($searchopt[$ID]["width"])) { $ADD = ""; if ($nott && ($val != 'NULL') && ($val != 'null')) { $ADD = " OR $tocompute IS NULL"; } if ($nott) { return $link." ($tocompute < ".(intval($val) - $searchopt[$ID]["width"])." OR $tocompute > ".(intval($val) + $searchopt[$ID]["width"])." $ADD) "; } return $link." (($tocompute >= ".(intval($val) - $searchopt[$ID]["width"])." AND $tocompute <= ".(intval($val) + $searchopt[$ID]["width"]).") $ADD) "; } if (!$nott) { return " $link ($tocompute = ".(intval($val)).") "; } return " $link ($tocompute <> ".(intval($val)).") "; } break; } } // Default case if (in_array($searchtype, array('equals', 'notequals','under', 'notunder'))) { if ((!isset($searchopt[$ID]['searchequalsonfield']) || !$searchopt[$ID]['searchequalsonfield']) && (($table != getTableForItemType($itemtype)) || ($itemtype == 'AllAssets'))) { $out = " $link (`$table`.`id`".$SEARCH; } else { $out = " $link (`$table`.`$field`".$SEARCH; } if ($searchtype == 'notequals') { $nott = !$nott; } // Add NULL if $val = 0 and not negative search // Or negative search on real value if ((!$nott && ($val == 0)) || ($nott && ($val != 0))) { $out .= " OR `$table`.`id` IS NULL"; } $out .= ')'; return $out; } return self::makeTextCriteria($tocompute,$val,$nott,$link); } /** * Generic Function to add Default left join to a request * * @param $itemtype reference ID * @param $ref_table reference table * @param &$already_link_tables array of tables already joined * * @return Left join string **/ static function addDefaultJoin($itemtype, $ref_table, array &$already_link_tables) { switch ($itemtype) { // No link case 'User' : return self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_profiles_users", "profiles_users_id", 0, 0, array('jointype' => 'child')); case 'Reminder' : return Reminder::addVisibilityJoins(); /* $out = self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_reminders_users", "reminders_users_id", 0, 0, array('jointype' => 'child')); $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_groups_reminders", "groups_reminders_id", 0, 0, array('jointype' => 'child')); $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_entities_reminders", "entities_reminders_id", 0, 0, array('jointype' => 'child')); $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_profiles_reminders", "profiles_reminders_id", 0, 0, array('jointype' => 'child')); return $out; */ case 'Ticket' : // Same structure in addDefaultWhere $out = ''; if (!Session::haveRight("show_all_ticket","1")) { $searchopt = &self::getOptions($itemtype); // $requester_table = '`glpi_tickets_users_'.self::computeComplexJoinID($searchopt[4]['joinparams']['beforejoin']['joinparams']).'`'; // $requestergroup_table = '`glpi_groups_tickets_'.self::computeComplexJoinID($searchopt[71]['joinparams']['beforejoin']['joinparams']).'`'; // $assign_table = '`glpi_tickets_users_'.self::computeComplexJoinID($searchopt[5]['joinparams']['beforejoin']['joinparams']).'`'; // $assigngroup_table = '`glpi_groups_tickets_'.self::computeComplexJoinID($searchopt[8]['joinparams']['beforejoin']['joinparams']).'`'; // $observer_table = '`glpi_tickets_users_'.self::computeComplexJoinID($searchopt[66]['joinparams']['beforejoin']['joinparams']).'`'; // $observergroup_table = '`glpi_groups_tickets_'.self::computeComplexJoinID($searchopt[65]['joinparams']['beforejoin']['joinparams']).'`'; // show mine : requester $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_tickets_users", "tickets_users_id", 0, 0, $searchopt[4]['joinparams']['beforejoin']['joinparams']); if (Session::haveRight("show_group_ticket",1)) { if (count($_SESSION['glpigroups'])) { $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_groups_tickets", "groups_tickets_id", 0, 0, $searchopt[71]['joinparams']['beforejoin']['joinparams']); } } // show mine : observer $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_tickets_users", "tickets_users_id", 0, 0, $searchopt[66]['joinparams']['beforejoin']['joinparams']); if (count($_SESSION['glpigroups'])) { $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_groups_tickets", "groups_tickets_id", 0, 0, $searchopt[65]['joinparams']['beforejoin']['joinparams']); } if (Session::haveRight("own_ticket","1")) { // Can own ticket : show assign to me $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_tickets_users", "tickets_users_id", 0, 0, $searchopt[5]['joinparams']['beforejoin']['joinparams']); } if (Session::haveRight("show_assign_ticket","1")) { // show mine + assign to me $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_tickets_users", "tickets_users_id", 0, 0, $searchopt[5]['joinparams']['beforejoin']['joinparams']); if (count($_SESSION['glpigroups'])) { $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_groups_tickets", "groups_tickets_id", 0, 0, $searchopt[8]['joinparams']['beforejoin']['joinparams']); } } if (Session::haveRight('validate_incident', 1) || Session::haveRight('validate_request', 1)) { $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_ticketvalidations", "ticketvalidations_id", 0, 0, $searchopt[58]['joinparams']['beforejoin']['joinparams']); } } return $out; default : // Plugin can override core definition for its type if ($plug = isPluginItemType($itemtype)) { $function = 'plugin_'.$plug['plugin'].'_addDefaultJoin'; if (function_exists($function)) { $out = $function($itemtype, $ref_table, $already_link_tables); if (!empty($out)) { return $out; } } } return ""; } } /** * Generic Function to add left join to a request * * @param $itemtype item type * @param $ref_table reference table * @param $already_link_tables array of tables already joined * @param $new_table new table to join * @param $linkfield linkfield for LeftJoin * @param $meta is it a meta item ? (default 0) * @param $meta_type meta type table (default 0) * @param $joinparams array join parameters (condition / joinbefore...) * * @return Left join string **/ static function addLeftJoin($itemtype, $ref_table, array &$already_link_tables, $new_table, $linkfield, $meta=0, $meta_type=0, $joinparams=array()) { global $CFG_GLPI; // Rename table for meta left join $AS = ""; $nt = $new_table; $cleannt = $nt; // Multiple link possibilies case // if ($new_table=="glpi_users" // || $new_table=="glpi_groups" // || $new_table=="glpi_users_validation") { if (!empty($linkfield) && ($linkfield != getForeignKeyFieldForTable($new_table))) { $nt .= "_".$linkfield; $AS = " AS ".$nt; } $complexjoin = self::computeComplexJoinID($joinparams); if (!empty($complexjoin)) { $nt .= "_".$complexjoin; $AS = " AS ".$nt; } // } $addmetanum = ""; $rt = $ref_table; $cleanrt = $rt; if ($meta) { $addmetanum = "_".$meta_type; $AS = " AS $nt$addmetanum"; $nt = $nt.$addmetanum; } // Auto link if (($ref_table == $new_table) && empty($complexjoin)) { return ""; } // Do not take into account standard linkfield $tocheck = $nt.".".$linkfield; if ($linkfield == getForeignKeyFieldForTable($new_table)) { $tocheck = $nt; } // echo '->'.$tocheck.'
    '; if (in_array($tocheck,$already_link_tables)) { return ""; } array_push($already_link_tables, $tocheck); // echo "DONE
    "; $specific_leftjoin = ''; // Plugin can override core definition for its type if ($plug = isPluginItemType($itemtype)) { $function = 'plugin_'.$plug['plugin'].'_addLeftJoin'; if (function_exists($function)) { $specific_leftjoin = $function($itemtype, $ref_table, $new_table, $linkfield, $already_link_tables); } } // Link with plugin tables : need to know left join structure if (empty($specific_leftjoin) && preg_match("/^glpi_plugin_([a-z0-9]+)/", $new_table, $matches)) { if (count($matches) == 2) { $function = 'plugin_'.$matches[1].'_addLeftJoin'; if (function_exists($function)) { $specific_leftjoin = $function($itemtype, $ref_table, $new_table, $linkfield, $already_link_tables); } } } if (!empty($linkfield)) { $before = ''; // Html::printCleanArray($joinparams); if (isset($joinparams['beforejoin']) && is_array($joinparams['beforejoin']) ) { if (isset($joinparams['beforejoin']['table'])) { $joinparams['beforejoin'] = array($joinparams['beforejoin']); } foreach ($joinparams['beforejoin'] as $tab) { if (isset($tab['table'])) { $intertable = $tab['table']; if (isset($tab['linkfield'])) { $interlinkfield = $tab['linkfield']; } else { $interlinkfield = getForeignKeyFieldForTable($intertable); } $interjoinparams = array(); if (isset($tab['joinparams'])) { $interjoinparams = $tab['joinparams']; } // echo "BEFORE "; $before .= self::addLeftJoin($itemtype, $rt, $already_link_tables, $intertable, $interlinkfield, $meta, $meta_type, $interjoinparams); // echo "END BEFORE ".'
    '; } // No direct link with the previous joins if (!isset($tab['joinparams']['nolink']) || !$tab['joinparams']['nolink']) { $cleanrt = $intertable; $complexjoin = self::computeComplexJoinID($interjoinparams); if (!empty($complexjoin)) { $intertable .= "_".$complexjoin; } $rt = $intertable.$addmetanum; } } } $addcondition = ''; if (isset($joinparams['condition'])) { $from = array("`REFTABLE`", "REFTABLE", "`NEWTABLE`", "NEWTABLE"); $to = array("`$rt`", "`$rt`", "`$nt`", "`$nt`"); $addcondition = str_replace($from, $to, $joinparams['condition']); $addcondition = $addcondition." "; } if (!isset($joinparams['jointype'])) { $joinparams['jointype'] = 'standard'; } if (empty($specific_leftjoin)) { switch ($new_table) { // No link case "glpi_auth_tables" : $user_searchopt = self::getOptions('User'); $specific_leftjoin = self::addLeftJoin($itemtype, $rt, $already_link_tables, "glpi_authldaps", 'auths_id', 0, 0, $user_searchopt[30]['joinparams']); $specific_leftjoin .= self::addLeftJoin($itemtype, $rt, $already_link_tables, "glpi_authmails", 'auths_id', 0, 0, $user_searchopt[31]['joinparams']); break; } } if (empty($specific_leftjoin)) { switch ($joinparams['jointype']) { case 'child' : $linkfield = getForeignKeyFieldForTable($cleanrt); if (isset($joinparams['linkfield'])) { $linkfield = $joinparams['linkfield']; } // Child join $specific_leftjoin = " LEFT JOIN `$new_table` $AS ON (`$rt`.`id` = `$nt`.`$linkfield` $addcondition)"; break; case 'item_item' : // Item_Item join $specific_leftjoin = " LEFT JOIN `$new_table` $AS ON ((`$rt`.`id` = `$nt`.`".getForeignKeyFieldForTable($cleanrt)."_1` OR `$rt`.`id` = `$nt`.`".getForeignKeyFieldForTable($cleanrt)."_2`) $addcondition)"; break; case 'item_item_revert' : // Item_Item join reverting previous item_item $specific_leftjoin = " LEFT JOIN `$new_table` $AS ON ((`$nt`.`id` = `$rt`.`".getForeignKeyFieldForTable($cleannt)."_1` OR `$nt`.`id` = `$rt`.`".getForeignKeyFieldForTable($cleannt)."_2`) $addcondition)"; break; case "itemtype_item" : $used_itemtype = $itemtype; if (isset($joinparams['specific_itemtype']) && !empty($joinparams['specific_itemtype'])) { $used_itemtype = $joinparams['specific_itemtype']; } // Itemtype join $specific_leftjoin = " LEFT JOIN `$new_table` $AS ON (`$rt`.`id` = `$nt`.`items_id` AND `$nt`.`itemtype` = '$used_itemtype' $addcondition) "; break; default : // Standard join $specific_leftjoin = "LEFT JOIN `$new_table` $AS ON (`$rt`.`$linkfield` = `$nt`.`id` $addcondition)"; break; } } // echo $before.$specific_leftjoin.'
    '; return $before.$specific_leftjoin; } // return ''; } /** * Generic Function to add left join for meta items * * @param $from_type reference item type ID * @param $to_type item type to add * @param $already_link_tables2 array of tables already joined * @param $nullornott Used LEFT JOIN (null generation) * or INNER JOIN for strict join * * @return Meta Left join string **/ static function addMetaLeftJoin($from_type, $to_type, array &$already_link_tables2, $nullornott) { $LINK = " INNER JOIN "; if ($nullornott) { $LINK = " LEFT JOIN "; } switch ($from_type) { case 'Ticket' : $totable = getTableForItemType($to_type); array_push($already_link_tables2,$totable); return " $LINK `$totable` ON (`$totable`.`id` = `glpi_tickets`.`items_id` AND `glpi_tickets`.`itemtype` = '$to_type')"; case 'Computer' : switch ($to_type) { case 'Printer' : array_push($already_link_tables2, getTableForItemType($to_type)); array_push($already_link_tables2, "glpi_computers_items_$to_type"); return " $LINK `glpi_computers_items` AS glpi_computers_items_$to_type ON (`glpi_computers_items_$to_type`.`computers_id` = `glpi_computers`.`id` AND `glpi_computers_items_$to_type`.`itemtype` = '$to_type') $LINK `glpi_printers` ON (`glpi_computers_items_$to_type`.`items_id` = `glpi_printers`.`id`) "; case 'Monitor' : array_push($already_link_tables2, getTableForItemType($to_type)); array_push($already_link_tables2, "glpi_computers_items_$to_type"); return " $LINK `glpi_computers_items` AS glpi_computers_items_$to_type ON (`glpi_computers_items_$to_type`.`computers_id` = `glpi_computers`.`id` AND `glpi_computers_items_$to_type`.`itemtype` = '$to_type') $LINK `glpi_monitors` ON (`glpi_computers_items_$to_type`.`items_id` = `glpi_monitors`.`id`) "; case 'Peripheral' : array_push($already_link_tables2, getTableForItemType($to_type)); array_push($already_link_tables2, "glpi_computers_items_$to_type"); return " $LINK `glpi_computers_items` AS glpi_computers_items_$to_type ON (`glpi_computers_items_$to_type`.`computers_id` = `glpi_computers`.`id` AND `glpi_computers_items_$to_type`.`itemtype` = '$to_type') $LINK `glpi_peripherals` ON (`glpi_computers_items_$to_type`.`items_id` = `glpi_peripherals`.`id`) "; case 'Phone' : array_push($already_link_tables2,getTableForItemType($to_type)); array_push($already_link_tables2, "glpi_computers_items_$to_type"); return " $LINK `glpi_computers_items` AS glpi_computers_items_$to_type ON (`glpi_computers_items_$to_type`.`computers_id` = `glpi_computers`.`id` AND `glpi_computers_items_$to_type`.`itemtype` = '$to_type') $LINK `glpi_phones` ON (`glpi_computers_items_$to_type`.`items_id` = `glpi_phones`.`id`) "; case 'Software' : /// TODO: link licenses via installed software OR by affected/computers_id ??? array_push($already_link_tables2,getTableForItemType($to_type)); array_push($already_link_tables2,"glpi_softwareversions_$to_type"); array_push($already_link_tables2,"glpi_softwarelicenses_$to_type"); return " $LINK `glpi_computers_softwareversions` AS glpi_computers_softwareversions_$to_type ON (`glpi_computers_softwareversions_$to_type`.`computers_id` = `glpi_computers`.`id`) $LINK `glpi_softwareversions` AS glpi_softwareversions_$to_type ON (`glpi_computers_softwareversions_$to_type`.`softwareversions_id` = `glpi_softwareversions_$to_type`.`id`) $LINK `glpi_softwares` ON (`glpi_softwareversions_$to_type`.`softwares_id` = `glpi_softwares`.`id`) LEFT JOIN `glpi_softwarelicenses` AS glpi_softwarelicenses_$to_type ON (`glpi_softwares`.`id` = `glpi_softwarelicenses_$to_type`.`softwares_id`". getEntitiesRestrictRequest(' AND', "glpi_softwarelicenses_$to_type", '', '', true).") "; } break; case 'Monitor' : switch ($to_type) { case 'Computer' : array_push($already_link_tables2, getTableForItemType($to_type)); array_push($already_link_tables2, "glpi_computers_items_$to_type"); return " $LINK `glpi_computers_items` AS glpi_computers_items_$to_type ON (`glpi_computers_items_$to_type`.`items_id` = `glpi_monitors`.`id` AND `glpi_computers_items_$to_type`.`itemtype` = '$from_type') $LINK `glpi_computers` ON (`glpi_computers_items_$to_type`.`computers_id` = `glpi_computers`.`id`) "; } break; case 'Printer' : switch ($to_type) { case 'Computer' : array_push($already_link_tables2, getTableForItemType($to_type)); array_push($already_link_tables2, "glpi_computers_items_$to_type"); return " $LINK `glpi_computers_items` AS glpi_computers_items_$to_type ON (`glpi_computers_items_$to_type`.`items_id` = `glpi_printers`.`id` AND `glpi_computers_items_$to_type`.`itemtype` = '$from_type') $LINK `glpi_computers` ON (`glpi_computers_items_$to_type`.`computers_id` = `glpi_computers`.`id` ". getEntitiesRestrictRequest("AND", 'glpi_computers').") "; } break; case 'Peripheral' : switch ($to_type) { case 'Computer' : array_push($already_link_tables2,getTableForItemType($to_type)); array_push($already_link_tables2, "glpi_computers_items_$to_type"); return " $LINK `glpi_computers_items` AS glpi_computers_items_$to_type ON (`glpi_computers_items_$to_type`.`items_id` = `glpi_peripherals`.`id` AND `glpi_computers_items_$to_type`.`itemtype` = '$from_type') $LINK `glpi_computers` ON (`glpi_computers_items_$to_type`.`computers_id` = `glpi_computers`.`id`) "; } break; case 'Phone' : switch ($to_type) { case 'Computer' : array_push($already_link_tables2,getTableForItemType($to_type)); array_push($already_link_tables2, "glpi_computers_items_$to_type"); return " $LINK `glpi_computers_items` AS glpi_computers_items_$to_type ON (`glpi_computers_items_$to_type`.`items_id` = `glpi_phones`.`id` AND `glpi_computers_items_$to_type`.`itemtype` = '$from_type') $LINK `glpi_computers` ON (`glpi_computers_items_$to_type`.`computers_id` = `glpi_computers.id`) "; } break; case 'Software' : switch ($to_type) { case 'Computer' : array_push($already_link_tables2,getTableForItemType($to_type)); array_push($already_link_tables2,"glpi_softwareversions_$to_type"); array_push($already_link_tables2,"glpi_softwareversions_$to_type"); return " $LINK `glpi_softwareversions` AS glpi_softwareversions_$to_type ON (`glpi_softwareversions_$to_type`.`softwares_id` = `glpi_softwares`.`id`) $LINK `glpi_computers_softwareversions` AS glpi_computers_softwareversions_$to_type ON (`glpi_computers_softwareversions_$to_type`.`softwareversions_id` = `glpi_softwareversions_$to_type`.`id`) $LINK `glpi_computers` ON (`glpi_computers_softwareversions_$to_type`.`computers_id` = `glpi_computers`.`id` ". getEntitiesRestrictRequest("AND", 'glpi_computers').") "; } break; } } /** * Generic Function to display Items * * @param $itemtype item type * @param $ID ID of the SEARCH_OPTION item * @param $data array retrieved data array * @param $num number of the displayed item (default 0) * * @return string to print **/ static function displayConfigItem($itemtype, $ID, $data=array(), $num=0) { $searchopt = &self::getOptions($itemtype); $NAME = "ITEM_"; $table = $searchopt[$ID]["table"]; $field = $searchopt[$ID]["field"]; // Plugin can override core definition for its type if ($plug = isPluginItemType($itemtype)) { $function = 'plugin_'.$plug['plugin'].'_displayConfigItem'; if (function_exists($function)) { $out = $function($itemtype, $ID, $data, $num); if (!empty($out)) { return $out; } } } switch ($table.".".$field) { // case "glpi_computers.date_mod" : // case "glpi_printers.date_mod" : // case "glpi_networkequipments.date_mod" : // case "glpi_peripherals.date_mod" : // case "glpi_phones.date_mod" : // case "glpi_softwares.date_mod" : // case "glpi_monitors.date_mod" : // case "glpi_documents.date_mod" : // case "glpi_users.last_login" : // case "glpi_users.date_mod" : // return " class='center'"; case "glpi_tickets.priority" : case "glpi_problems.priority" : return " style=\"background-color:".$_SESSION["glpipriority_".$data[$NAME.$num]].";\" "; case "glpi_tickets.due_date" : if (($ID <> 151) && !empty($data[$NAME.$num]) && ($data[$NAME.$num.'_2'] != CommonITILObject::WAITING) && ($data[$NAME.$num] < $_SESSION['glpi_currenttime'])) { return " class='tab_bg_2_2' "; } default : return ""; } } /** * Generic Function to display Items * * @param $itemtype item type * @param $ID ID of the SEARCH_OPTION item * @param $data array containing data results * @param $num item num in the request * @param $meta is a meta item ? (default 0) * @param $addobjectparams array added parameters for union search * * @return string to print **/ static function giveItem($itemtype, $ID, array $data, $num, $meta=0, array $addobjectparams=array()) { global $CFG_GLPI; $showuserlink = 0; if (Session::haveRight('user','r')) { $showuserlink = 1; } $searchopt = &self::getOptions($itemtype); if (isset($CFG_GLPI["union_search_type"][$itemtype]) && ($CFG_GLPI["union_search_type"][$itemtype] == $searchopt[$ID]["table"])) { if (isset($searchopt[$ID]['addobjectparams']) && $searchopt[$ID]['addobjectparams']) { return self::giveItem($data["TYPE"], $ID, $data, $num, $meta, $searchopt[$ID]['addobjectparams']); } return self::giveItem($data["TYPE"], $ID, $data, $num, $meta); } if (count($addobjectparams)) { $searchopt[$ID] = array_merge($searchopt[$ID], $addobjectparams); } // Plugin can override core definition for its type if ($plug = isPluginItemType($itemtype)) { $function = 'plugin_'.$plug['plugin'].'_giveItem'; if (function_exists($function)) { $out = $function($itemtype, $ID, $data, $num); if (!empty($out)) { return $out; } } } $NAME = "ITEM_"; if ($meta) { $NAME = "META_"; } $table = $searchopt[$ID]["table"]; $field = $searchopt[$ID]["field"]; $linkfield = $searchopt[$ID]["linkfield"]; /// TODO try to clean all specific cases using SpecificToDisplay switch ($table.'.'.$field) { case "glpi_users.name" : // USER search case if (($itemtype != 'User') && isset($searchopt[$ID]["forcegroupby"]) && $searchopt[$ID]["forcegroupby"]) { $out = ""; $split = explode("$$$$",$data[$NAME.$num]); $count_display = 0; $added = array(); for ($k=0 ; $k 0) { if ($count_display) { $out .= "
    "; } $count_display++; if ($itemtype == 'Ticket') { $userdata = getUserName($split[$k],2); $tooltip = ""; if (Session::haveRight('user','r')) { $tooltip = Html::showToolTip($userdata["comment"], array('link' => $userdata["link"], 'display' => false)); } $out .= sprintf(__('%1$s %2$s'), $userdata['name'], $tooltip); } else { $out .= getUserName($split[$k], $showuserlink); } } } // Manage alternative_email for tickets_users if (($itemtype == 'Ticket') && isset($data[$NAME.$num.'_2'])) { $split = explode("$$$$",$data[$NAME.$num.'_2']); for ($k=0 ; $k".$split2[1].""; } } } return $out; } if ($itemtype != 'User') { $toadd = ''; if (($itemtype == 'Ticket') && ($data[$NAME.$num."_3"] > 0)) { $userdata = getUserName($data[$NAME.$num."_3"], 2); $toadd = Html::showToolTip($userdata["comment"], array('link' => $userdata["link"], 'display' => false)); } if (Session::haveRight('user','r')) { $usernameformat = formatUserName($data[$NAME.$num."_3"], $data[$NAME.$num], $data[$NAME.$num."_2"], $data[$NAME.$num."_4"], 1); } else { $usernameformat = formatUserName($data[$NAME.$num."_3"], $data[$NAME.$num], $data[$NAME.$num."_2"], $data[$NAME.$num."_4"], 0); } return sprintf(__('%1$s %2$s'), $usernameformat, $toadd); } break; case "glpi_profiles.interface" : return Profile::getInterfaceName($data[$NAME.$num]); case "glpi_profiles.name" : if (($itemtype == 'User') && ($ID == 20)) { $out = ""; $split = explode("$$$$",$data[$NAME.$num]); $split2 = explode("$$$$",$data[$NAME.$num."_2"]); $split3 = explode("$$$$",$data[$NAME.$num."_3"]); $count_display = 0; $added = array(); for ($k=0 ; $k 0) { $text = sprintf(__('%1$s - %2$s'), $split[$k], Dropdown::getDropdownName('glpi_entities', $split2[$k])); if ($split3[$k]) { $text = sprintf(__('%1$s %2$s'), $text, "(".__('R').")"); } if (!in_array($text,$added)) { if ($count_display) { $out .= "
    "; } $count_display++; $out .= $text; $added[] = $text; } } } return $out; } break; case "glpi_entities.completename" : if ($itemtype == 'User') { $out = ""; $split = explode("$$$$",$data[$NAME.$num]); $split2 = explode("$$$$",$data[$NAME.$num."_2"]); $split3 = explode("$$$$",$data[$NAME.$num."_3"]); $added = array(); $count_display = 0; for ($k=0 ; $k 0) { $text = sprintf(__('%1$s - %2$s'), $split[$k], Dropdown::getDropdownName('glpi_profiles', $split2[$k])); if ($split3[$k]) { $text = sprintf(__('%1$s %2$s'), $text, "(".__('R').")"); } if (!in_array($text,$added)) { if ($count_display) { $out .= "
    "; } $count_display++; $out .= $text; $added[] = $text; } } } return $out; } break; case "glpi_documenttypes.icon" : if (!empty($data[$NAME.$num])) { return ""; } return " "; case "glpi_documents.filename" : $doc = new Document(); if ($doc->getFromDB($data['id'])) { return $doc->getDownloadLink(); } return NOT_AVAILABLE; case "glpi_deviceharddrives.specificity" : case "glpi_devicememories.specificity" : case "glpi_deviceprocessors.specificity" : return $data[$NAME.$num]; case "glpi_networkports.mac" : $out = ""; if ($itemtype == 'Computer') { $displayed = array(); if (!empty($data[$NAME.$num."_2"])) { $split = explode("$$$$",$data[$NAME.$num."_2"]); $count_display = 0; for ($k=0 ; $k 0) && !in_array($lowstr, $displayed)) { if ($count_display) { $out .= "
    "; } $count_display++; $out .= $split[$k]; $displayed[] = $lowstr; } } if (!empty($data[$NAME.$num])) { $out .= "
    "; } } if (!empty($data[$NAME.$num])) { $split = explode("$$$$",$data[$NAME.$num]); $count_display = 0; for ($k=0 ; $k 0) && !in_array($lowstr, $displayed)) { if ($count_display) { $out .= "
    "; } $count_display++; $out .= $split[$k]; $displayed[] = $lowstr; } } } return $out; } break; case "glpi_contracts.duration" : case "glpi_contracts.notice" : case "glpi_contracts.periodicity" : case "glpi_contracts.billing" : if (!empty($data[$NAME.$num])) { $split = explode('$$$$', $data[$NAME.$num]); $output = ""; foreach ($split as $duration) { $output .= (empty($output)?'':'
    ') . sprintf(_n('%d month', '%d months', $duration), $duration); } return $output; } return " "; case "glpi_contracts.renewal" : return Contract::getContractRenewalName($data[$NAME.$num]); // case "glpi_infocoms.sink_time" : // if (!empty($data[$NAME.$num])) { // $split = explode("$$$$", $data[$NAME.$num]); // $out = ''; // foreach ($split as $val) { // $out .= (empty($out)?'':'
    '); // if ($val > 0) { // //TRANS: %d is a number of years // $out .= sprintf(_n('%d year', '%d years', $val), $val); // } // } // return $out; // } // return " "; // // case "glpi_infocoms.warranty_duration" : // if (!empty($data[$NAME.$num])) { // $split = explode("$$$$", $data[$NAME.$num]); // $out = ''; // foreach ($split as $val) { // $out .= (empty($out)?'':'
    '); // if ($val > 0) { // $out .= sprintf(_n('%d month', '%d months', $val), $val); // } // if ($val < 0) { // $out .= __('Lifelong'); // } // } // return $out; // } // return " "; case "glpi_infocoms.sink_type" : $split = explode("$$$$", $data[$NAME.$num]); $out = ''; foreach ($split as $val) { $out .= (empty($out)?'':'
    ').Infocom::getAmortTypeName($val); } return $out; case "glpi_infocoms.alert" : if ($data[$NAME.$num] == pow(2,Alert::END)) { return __s('Warranty expiration date'); } return ""; case "glpi_contracts.alert" : switch ($data[$NAME.$num]) { case pow(2,Alert::END) : return __('End'); case pow(2,Alert::NOTICE) : return __('Notice'); case pow(2,Alert::END) + pow(2,Alert::NOTICE) : return __('End + Notice'); } return ""; case "glpi_tickets_tickets.tickets_id_1" : $out = ""; $split = explode("$$$$",$data[$NAME.$num]); $split2 = explode("$$$$",$data[$NAME.$num."_2"]); $displayed = array(); for ($k=0 ; $k 0) && !isset($displayed[$linkid])) { $text = ""; $text .= Dropdown::getDropdownName('glpi_tickets', $linkid).""; if (count($displayed)) { $out .= "
    "; } $displayed[$linkid] = $linkid; $out .= $text; } } return $out; case "glpi_problems.count" : if (($data[$NAME.$num] > 0) && Session::haveRight("show_all_problem","1")) { if ($itemtype == 'ITILCategory') { $options['field'][0] = 7; $options['searchtype'][0] = 'equals'; $options['contains'][0] = $data['id']; $options['link'][0] = 'AND'; } $options['reset'] = 'reset'; $out = ""; $out .= $data[$NAME.$num].""; } else { $out = $data[$NAME.$num]; } return $out; case "glpi_tickets.count" : if (($data[$NAME.$num] > 0) && Session::haveRight("show_all_ticket","1")) { if ($itemtype == 'User') { $options['field'][0] = 4; $options['searchtype'][0] = 'equals'; $options['contains'][0] = $data['id']; $options['link'][0] = 'AND'; $options['field'][1] = 22; $options['searchtype'][1] = 'equals'; $options['contains'][1] = $data['id']; $options['link'][1] = 'OR'; $options['field'][2] = 5; $options['searchtype'][2] = 'equals'; $options['contains'][2] = $data['id']; $options['link'][2] = 'OR'; } else if ($itemtype == 'ITILCategory') { $options['field'][0] = 7; $options['searchtype'][0] = 'equals'; $options['contains'][0] = $data['id']; $options['link'][0] = 'AND'; } else { $options['field'][0] = 12; $options['searchtype'][0] = 'equals'; $options['contains'][0] = 'all'; $options['link'][0] = 'AND'; $options['itemtype2'][0] = $itemtype; $options['field2'][0] = self::getOptionNumber($itemtype, 'name'); $options['searchtype2'][0] = 'equals'; $options['contains2'][0] = $data['id']; $options['link2'][0] = 'AND'; } $options['reset'] = 'reset'; $out = ""; $out .= $data[$NAME.$num].""; } else { $out = $data[$NAME.$num]; } return $out; case "glpi_tickets.due_date" : // Due date + progress if ($ID == 151) { $out = Html::convDate($data[$NAME.$num]); // No due date in waiting status if ($data[$NAME.$num.'_2'] == CommonITILObject::WAITING) { return ''; } if (empty($data[$NAME.$num])) { return ''; } if (($data[$NAME.$num.'_2'] == Ticket::SOLVED) || ($data[$NAME.$num.'_2'] == Ticket::CLOSED)) { return $data[$NAME.$num]; } $ticket = new Ticket(); $ticket->getFromDB($data['ITEM_0']); $percentage = 0; $totaltime = 0; $currenttime = 0; if ($ticket->fields['slas_id'] != 0) { // Have SLA $sla = new SLA(); $sla->getFromDB($ticket->fields['slas_id']); $currenttime = $sla->getActiveTimeBetween($ticket->fields['date'], date('Y-m-d H:i:s')); $totaltime = $sla->getActiveTimeBetween($ticket->fields['date'], $data[$NAME.$num]); } else { $calendars_id = Entity::getUsedConfig('calendars_id', $ticket->fields['entities_id']); if ($calendars_id != 0) { // Ticket entity have calendar $calendar = new Calendar(); $calendar->getFromDB($calendars_id); $currenttime = $calendar->getActiveTimeBetween($ticket->fields['date'], date('Y-m-d H:i:s')); $totaltime = $calendar->getActiveTimeBetween($ticket->fields['date'], $data[$NAME.$num]); } else { // No calendar $currenttime = strtotime(date('Y-m-d H:i:s')) - strtotime($ticket->fields['date']); $totaltime = strtotime($data[$NAME.$num]) - strtotime($ticket->fields['date']); } } if ($totaltime != 0) { $percentage = round((100 * $currenttime) / $totaltime); } else { // Total time is null : no active time $percentage = 100; } if ($percentage > 100) { $percentage = 100; } $percentage_text = $percentage; if ($_SESSION['glpiduedatewarning_unit'] == '%') { $less_warn_limit = $_SESSION['glpiduedatewarning_less']; $less_warn = (100 - $percentage); } else if ($_SESSION['glpiduedatewarning_unit'] == 'hours') { $less_warn_limit = $_SESSION['glpiduedatewarning_less'] * HOUR_TIMESTAMP; $less_warn = ($totaltime - $currenttime); } else if ($_SESSION['glpiduedatewarning_unit'] == 'days') { $less_warn_limit = $_SESSION['glpiduedatewarning_less'] * DAY_TIMESTAMP; $less_warn = ($totaltime - $currenttime); } if ($_SESSION['glpiduedatecritical_unit'] == '%') { $less_crit_limit = $_SESSION['glpiduedatecritical_less']; $less_crit = (100 - $percentage); } else if ($_SESSION['glpiduedatecritical_unit'] == 'hours') { $less_crit_limit = $_SESSION['glpiduedatecritical_less'] * HOUR_TIMESTAMP; $less_crit = ($totaltime - $currenttime); } else if ($_SESSION['glpiduedatecritical_unit'] == 'days') { $less_crit_limit = $_SESSION['glpiduedatecritical_less'] * DAY_TIMESTAMP; $less_crit = ($totaltime - $currenttime); } $color = $_SESSION['glpiduedateok_color']; if ($less_crit < $less_crit_limit) { $color = $_SESSION['glpiduedatecritical_color']; } else if ($less_warn < $less_warn_limit) { $color = $_SESSION['glpiduedatewarning_color']; } //Calculate bar progress $out .= "
    "; $out .= "
     ".$percentage_text."%
    "; $out .= "
    "; $out .= "
    "; return $out; } break; case "glpi_softwarelicenses.number" : if ($data[$NAME.$num."_2"] == -1) { return __('Unlimited'); } if (empty($data[$NAME.$num])) { return 0; } return $data[$NAME.$num]; case "glpi_auth_tables.name" : return Auth::getMethodName($data[$NAME.$num], $data[$NAME.$num."_2"], 1, $data[$NAME.$num."_3"].$data[$NAME.$num."_4"]); case "glpi_reservationitems.comment" : if (empty($data[$NAME.$num])) { return "".__('None').""; } return "".Html::resume_text($data[$NAME.$num]).""; case 'glpi_notifications.mode' : return Notification::getMode($data[$NAME.$num]); case 'glpi_notifications.event' : $item = NotificationTarget::getInstanceByType($data['itemtype']); if ($item) { $events = $item->getAllEvents(); if (isset($events[$data[$NAME.$num]])) { return $events[$data[$NAME.$num]]; } } return ''; case 'glpi_reminders.state' : return Planning::getState($data[$NAME.$num]); case 'glpi_crontasks.description' : $tmp = new CronTask(); return $tmp->getDescription($data['id']); case 'glpi_crontasks.state' : return CronTask::getStateName($data[$NAME.$num]); case 'glpi_crontasks.mode' : return CronTask::getModeName($data[$NAME.$num]); case 'glpi_crontasks.itemtype' : if ($plug = isPluginItemType($data[$NAME.$num])) { return $plug['plugin']; } return ''; case 'glpi_changes.status': $status = Change::getStatus($data[$NAME.$num]); return "\"$status\" $status"; case 'glpi_problems.status': $status = Problem::getStatus($data[$NAME.$num]); return "\"$status\" $status"; case 'glpi_tickets.status': $status = Ticket::getStatus($data[$NAME.$num]); return "\"$status\" $status"; case 'glpi_tickets.items_id' : if (!empty($data[$NAME.$num."_2"]) && ($item = getItemForItemtype($data[$NAME.$num."_2"]))) { if ($item->getFromDB($data[$NAME.$num])) { return $item->getLink(array('comments' => true)); } } return ' '; case 'glpi_tickets.name' : if (isset($searchopt[$ID]['forcegroupby']) && $searchopt[$ID]['forcegroupby']) { $split = explode("$$$$",$data[$NAME.$num]); $out = ''; $link = Toolbox::getItemTypeFormURL('Ticket'); foreach ($split as $val) { if (!empty($val)) { $split2 = self::explodeWithID("$$", $val); $out .= ""; $name = $split2[0]; if ($_SESSION["glpiis_ids_visible"] || empty($split2[0])) { $name = sprintf(__('%1$s (%2$s)'), $name, $split2[1]); } $out .= $name."
    "; } } return $out; } $link = Toolbox::getItemTypeFormURL('Ticket'); $out = ""; $name = $data[$NAME.$num]; if ($_SESSION["glpiis_ids_visible"] || empty($data[$NAME.$num])) { $name = sprintf(__('%1$s (%2$s)'), $name, $data[$NAME.$num."_2"]); } $out .= $name.""; $out = sprintf(__('%1$s %2$s'), $out, Html::showToolTip(nl2br($data[$NAME.$num."_3"]), array('applyto' => 'ticket'.$data[$NAME.$num."_2"], 'display' => false))); return $out; case 'glpi_ticketvalidations.status' : $split = explode("$$$$",$data[$NAME.$num]); $out = ''; foreach ($split as $val) { if (!empty($val)) { $split2 = self::explodeWithID("$$", $val); $status = TicketValidation::getStatus($split2[0]); $bgcolor = TicketValidation::getStatusColor($split2[0]); $out .= (empty($out)?'':'
    '). "
    ".$status.'
    '; } } return $out; case 'glpi_ticketsatisfactions.type' : return TicketSatisfaction::getTypeInquestName($data[$NAME.$num]); case 'glpi_ticketsatisfactions.satisfaction' : return TicketSatisfaction::displaySatisfaction($data[$NAME.$num]); case 'glpi_notimportedemails.reason' : return NotImportedEmail::getReason($data[$NAME.$num]); case 'glpi_notimportedemails.messageid' : $clean = array('<' => '', '>' => ''); return strtr($data[$NAME.$num], $clean); } //// Default case // Link with plugin tables : need to know left join structure if (preg_match("/^glpi_plugin_([a-z0-9]+)/", $table.'.'.$field, $matches)) { if (count($matches) == 2) { $plug = $matches[1]; $function = 'plugin_'.$plug.'_giveItem'; if (function_exists($function)) { $out = $function($itemtype,$ID,$data,$num); if (!empty($out)) { return $out; } } } } $unit = ''; if (isset($searchopt[$ID]['unit'])) { $unit = $searchopt[$ID]['unit']; } /// TODO try to use getvalueToDisplay instead of redefine display system // Preformat items if (isset($searchopt[$ID]["datatype"])) { switch ($searchopt[$ID]["datatype"]) { case "itemlink" : $linkitemtype = getItemTypeForTable($searchopt[$ID]["table"]); if (isset($data[$NAME.$num."_2"]) && strlen($data[$NAME.$num."_2"])) { $link = Toolbox::getItemTypeFormURL($linkitemtype); $out = ""; $name = Dropdown::getValueWithUnit($data[$NAME.$num],$unit); if ($_SESSION["glpiis_ids_visible"] || empty($data[$NAME.$num])) { $name = sprintf(__('%1$s (%2$s)'), $name, $data[$NAME.$num."_2"]); } $out .= $name.""; return $out; } $out = ""; $split = explode("$$$$", $data[$NAME.$num]); $count_display = 0; $separate = '
    '; if (isset($searchopt[$ID]['splititems']) && $searchopt[$ID]['splititems']) { $separate = '
    '; } for ($k=0 ; $k 0) { $split2 = self::explodeWithID("$$", $split[$k]); if (isset($split2[1]) && ($split2[1] > 0)) { if ($count_display) { $out .= $separate; } $count_display++; $page = Toolbox::getItemTypeFormURL($linkitemtype); $page .= (strpos($page,'?') ? '&id' : '?id'); $name = Dropdown::getValueWithUnit($split2[0],$unit); if ($_SESSION["glpiis_ids_visible"] || empty($split2[0])) { $name = sprintf(__('%1$s (%2$s)'), $name, $split2[1]); } $out .= "".$name.""; } } } return $out; case "text" : $separate = '
    '; if (isset($searchopt[$ID]['splititems']) && $searchopt[$ID]['splititems']) { $separate = '
    '; } $split = explode("$$$$", $data[$NAME.$num]); $out = ''; $count_display = 0; foreach ($split as $val) { if (strlen(trim($val)) > 0) { $split2 = self::explodeWithID("$$", $val); if ($count_display) { $out .= $separate; } $count_display++; if (isset($searchopt[$ID]['htmltext']) && $searchopt[$ID]['htmltext']) { $out .= Html::clean(Toolbox::unclean_cross_side_scripting_deep(nl2br($split2[0]))); } else { $out .= nl2br($split2[0]); } } } return $out; case "date" : case "date_delay" : $split = explode("$$$$", $data[$NAME.$num]); $out = ''; foreach ($split as $val) { $out .= (empty($out)?'':'
    ').Html::convDate($val); } return $out; case "datetime" : $split = explode("$$$$", $data[$NAME.$num]); $out = ''; foreach ($split as $val) { $out .= (empty($out)?'':'
    ').Html::convDateTime($val); } return $out; case "timestamp" : $withseconds = false; if (isset($searchopt[$ID]['withseconds'])) { $withseconds = $searchopt[$ID]['withseconds']; } $withdays = true; if (isset($searchopt[$ID]['withdays'])) { $withdays = $searchopt[$ID]['withdays']; } $split = explode("$$$$", $data[$NAME.$num]); $out = ''; foreach ($split as $val) { $out .= (empty($out)?'':'
    ').Html::timestampToString($val,$withseconds, $withdays); } return $out; case "email" : $split = explode('$$$$', $data[$NAME.$num]); $out = ''; $count_display = 0; foreach ($split as $val) { $split2 = self::explodeWithID("$$", $val); if ($count_display) { $out .= "
    "; } $count_display++; if (!empty($val)) { $out .= (empty($out)?'':'
    '); $out .= "$split2[0]"; } } return (empty($out) ? " " : $out); case "weblink" : $orig_link = trim($data[$NAME.$num]); if (!empty($orig_link)) { // strip begin of link $link = preg_replace('/https?:\/\/(www[^\.]*\.)?/','',$orig_link); $link = preg_replace('/\/$/', '', $link); if (Toolbox::strlen($link)>$CFG_GLPI["url_maxlength"]) { $link = Toolbox::substr($link, 0, $CFG_GLPI["url_maxlength"])."..."; } return "$link"; } return " "; case "number" : if (isset($searchopt[$ID]['forcegroupby']) && $searchopt[$ID]['forcegroupby']) { $out = ""; $split = explode("$$$$", $data[$NAME.$num]); $count_display = 0; for ($k=0 ; $k 0) { $split2 = self::explodeWithID("$$", $split[$k]); if ($count_display) { $out .= "
    "; } $count_display++; if (isset($searchopt[$ID]['toadd']) && isset($searchopt[$ID]['toadd'][$split2[0]])) { $out .= $searchopt[$ID]['toadd'][$split2[0]]; } else { $number = str_replace(' ', ' ', Html::formatNumber($split2[0], false,0)); $out .= Dropdown::getValueWithUnit($number, $unit); } } } return $out; } if (isset($searchopt[$ID]['toadd']) && isset($searchopt[$ID]['toadd'][$data[$NAME.$num]])) { return $searchopt[$ID]['toadd'][$data[$NAME.$num]]; } else { $number = str_replace(' ', ' ', Html::formatNumber($data[$NAME.$num], false, 0)); return Dropdown::getValueWithUnit($number, $unit); } case "decimal" : if (isset($searchopt[$ID]['forcegroupby']) && $searchopt[$ID]['forcegroupby']) { $out = ""; $split = explode("$$$$" ,$data[$NAME.$num]); $count_display = 0; for ($k=0 ; $k 0) { $split2 = self::explodeWithID("$$", $split[$k]); if ($count_display) { $out .= "
    "; } $count_display++; if (isset($searchopt[$ID]['toadd']) && isset($searchopt[$ID]['toadd'][$split2[0]])) { $out .= $searchopt[$ID]['toadd'][$split2[0]]; } else { $number = str_replace(' ', ' ', Html::formatNumber($split2[0])); $out .= Dropdown::getValueWithUnit($number, $unit); } } } return $out; } $number = str_replace(' ', ' ', Html::formatNumber($data[$NAME.$num])); return Dropdown::getValueWithUnit($number, $unit); case "bool" : if (isset($searchopt[$ID]['forcegroupby']) && $searchopt[$ID]['forcegroupby']) { $out = ""; $split = explode("$$$$", $data[$NAME.$num]); $count_display = 0; for ($k=0 ; $k 0) { $split2 = self::explodeWithID("$$", $split[$k]); if ($count_display) { $out .= "
    "; } $count_display++; $out .= Dropdown::getValueWithUnit(Dropdown::getYesNo($split2[0]),$unit); } } return $out; } return Dropdown::getValueWithUnit(Dropdown::getYesNo($data[$NAME.$num]),$unit); case "right": return Profile::getRightValue($data[$NAME.$num]); case "itemtypename": if ($obj = getItemForItemtype($data[$NAME.$num])) { return $obj->getTypeName(); } return ""; case "language": if (isset($CFG_GLPI['languages'][$data[$NAME.$num]])) { return $CFG_GLPI['languages'][$data[$NAME.$num]][0]; } return __('Default value'); } } // Manage items with need group by / group_concat if (isset($searchopt[$ID]['forcegroupby']) && $searchopt[$ID]['forcegroupby']) { $out = ""; $split = explode("$$$$", $data[$NAME.$num]); $count_display = 0; $separate = '
    '; if (isset($searchopt[$ID]['splititems']) && $searchopt[$ID]['splititems']) { $separate = '
    '; } for ($k=0 ; $k 0) { if ($count_display) { $out .= $separate; } $withoutid = self::explodeWithID("$$", $split[$k]); $count_display++; // Get specific display if available $itemtype = getItemTypeForTable($table); if ($item = getItemForItemtype($itemtype)) { $tmpdata = array($field => $withoutid[0]); $specific = $item->getSpecificValueToDisplay($field, $tmpdata, array('html' => true)); } if (!empty($specific)) { $out .= $specific; } else { $out .= Dropdown::getValueWithUnit($withoutid[0], $unit); } } } return $out; } // Get specific display if available $itemtype = getItemTypeForTable($table); if ($item = getItemForItemtype($itemtype)) { $tmpdata = array($field => $data[$NAME.$num]); if (isset($searchopt[$ID]['additionalfields']) && count($searchopt[$ID]['additionalfields'])) { foreach ($searchopt[$ID]['additionalfields'] as $key) { $tmpdata[$key] = $data[$NAME.$num.'_'.$key]; } } $specific = $item->getSpecificValueToDisplay($field, $tmpdata, array('html' => true)); if (!empty($specific)) { return $specific; } } // Manage auto CONCAT id $split = self::explodeWithID('$$', $data[$NAME.$num]); $split[0] = trim($split[0]); if (isset($searchopt[$ID]['toadd']) && isset($searchopt[$ID]['toadd'][$split[0]])) { return $searchopt[$ID]['toadd'][$split[0]]; } // Empty is 0 or empty if (empty($split[0])&& isset($searchopt[$ID]['emptylabel'])) { return $searchopt[$ID]['emptylabel']; } return Dropdown::getValueWithUnit($split[0], $unit); } /** * Reset save searches * * @return nothing **/ static function resetSaveSearch() { unset($_SESSION['glpisearch']); $_SESSION['glpisearch'] = array(); unset($_SESSION['glpisearchcount']); $_SESSION['glpisearchcount'] = array(); unset($_SESSION['glpisearchcount2']); $_SESSION['glpisearchcount2'] = array(); } /** * Completion of the URL $_GET values with the $_SESSION values or define default values * * @param $itemtype item type to manage * @param $usesession Use datas save in session (true by default) * @param $forcebookmark force trying to load parameters from default bookmark: * used for global search (false by default) * * @return nothing **/ static function manageGetValues($itemtype, $usesession=true, $forcebookmark=false) { global $_GET, $DB; $redirect = false; if (isset($_GET["add_search_count"]) && $_GET["add_search_count"]) { $_SESSION["glpisearchcount"][$itemtype]++; Html::redirect(str_replace("add_search_count=1&", "", $_SERVER['REQUEST_URI'])); } if (isset($_GET["delete_search_count"]) && $_GET["delete_search_count"]) { if ($_SESSION["glpisearchcount"][$itemtype] > 1) { $_SESSION["glpisearchcount"][$itemtype]--; } Html::redirect(str_replace("delete_search_count=1&", "", $_SERVER['REQUEST_URI'])); } if (isset($_GET["add_search_count2"]) && $_GET["add_search_count2"]) { $_SESSION["glpisearchcount2"][$itemtype]++; Html::redirect(str_replace("add_search_count2=1&", "", $_SERVER['REQUEST_URI'])); } if (isset($_GET["delete_search_count2"]) && $_GET["delete_search_count2"]) { if ($_SESSION["glpisearchcount2"][$itemtype] >= 1) { $_SESSION["glpisearchcount2"][$itemtype]--; } Html::redirect(str_replace("delete_search_count2=1&", "", $_SERVER['REQUEST_URI'])); } $default_values = array(); $default_values["start"] = 0; $default_values["order"] = "ASC"; $default_values["is_deleted"] = 0; $default_values["distinct"] = "N"; $default_values["link"] = array(); $default_values["field"] = array(); $default_values["contains"] = array(0 => ""); $default_values["searchtype"] = array(0 => "contains"); $default_values["link2"] = array(); $default_values["field2"] = array(0 => "view"); $default_values["contains2"] = array(0 => ""); $default_values["itemtype2"] = ""; $default_values["searchtype2"] = ""; $default_values["sort"] = 1; if (($itemtype != 'AllAssets') && class_exists($itemtype) && method_exists($itemtype,'getDefaultSearchRequest')) { $default_values = array_merge($default_values, call_user_func(array($itemtype, 'getDefaultSearchRequest'))); } // First view of the page or force bookmark : try to load a bookmark if ($forcebookmark || ($usesession && !isset($_GET["reset"]) && !isset($_SESSION['glpisearch'][$itemtype]))) { $query = "SELECT `bookmarks_id` FROM `glpi_bookmarks_users` WHERE `users_id`='".Session::getLoginUserID()."' AND `itemtype` = '$itemtype'"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { $IDtoload = $DB->result($result, 0, 0); // Set session variable $_SESSION['glpisearch'][$itemtype] = array(); // Load bookmark on main window $bookmark = new Bookmark(); // Only get datas for bookmarks if ($forcebookmark) { $_GET = $bookmark->getParameters($IDtoload); } else { $bookmark->load($IDtoload, false); } } } } if ($usesession && isset($_GET["reset"])) { if (isset($_SESSION['glpisearch'][$itemtype])) { unset($_SESSION['glpisearch'][$itemtype]); } if (isset($_SESSION['glpisearchcount'][$itemtype])) { unset($_SESSION['glpisearchcount'][$itemtype]); } if (isset($_SESSION['glpisearchcount2'][$itemtype])) { unset($_SESSION['glpisearchcount2'][$itemtype]); } // Bookmark use if (isset($_GET["glpisearchcount"])) { $_SESSION["glpisearchcount"][$itemtype] = $_GET["glpisearchcount"]; } else if (isset($_GET["field"])) { $_SESSION["glpisearchcount"][$itemtype] = count($_GET["field"]); } // Bookmark use if (isset($_GET["glpisearchcount2"])) { $_SESSION["glpisearchcount2"][$itemtype] = $_GET["glpisearchcount2"]; } else if (isset($_GET["field2"])) { $_SESSION["glpisearchcount2"][$itemtype] = count($_GET["field2"]); } } if (is_array($_GET) && $usesession) { foreach ($_GET as $key => $val) { $_SESSION['glpisearch'][$itemtype][$key] = $val; } } foreach ($default_values as $key => $val) { if (!isset($_GET[$key])) { if ($usesession && isset($_SESSION['glpisearch'][$itemtype][$key])) { $_GET[$key] = $_SESSION['glpisearch'][$itemtype][$key]; } else { $_GET[$key] = $val; $_SESSION['glpisearch'][$itemtype][$key] = $val; } } } if (!isset($_SESSION["glpisearchcount"][$itemtype])) { if (isset($_GET["glpisearchcount"])) { $_SESSION["glpisearchcount"][$itemtype] = $_GET["glpisearchcount"]; } else { $_SESSION["glpisearchcount"][$itemtype] = 1; } } if (!isset($_SESSION["glpisearchcount2"][$itemtype])) { // Set in URL for bookmark if (isset($_GET["glpisearchcount2"])) { $_SESSION["glpisearchcount2"][$itemtype] = $_GET["glpisearchcount2"]; } else { $_SESSION["glpisearchcount2"][$itemtype] = 0; } } // Html::printCleanArray($_GET); } /** * Clean search options depending of user active profile * * @param $itemtype item type to manage * @param $action action which is used to manupulate searchoption (r/w) * (default 'r') * @param $withplugins boolean get plugins options (true by default) * * @return clean $SEARCH_OPTION array **/ static function getCleanedOptions($itemtype, $action='r', $withplugins=true) { global $CFG_GLPI; $options = &self::getOptions($itemtype, $withplugins); $todel = array(); if (!Session::haveRight('infocom',$action) && in_array($itemtype,$CFG_GLPI["infocom_types"])) { $itemstodel = Infocom::getSearchOptionsToAdd($itemtype); $todel = array_merge($todel, array_keys($itemstodel)); } if (!Session::haveRight('contract',$action) && in_array($itemtype, $CFG_GLPI["contract_types"])) { $itemstodel = Contract::getSearchOptionsToAdd(); $todel = array_merge($todel, array_keys($itemstodel)); } if (!Session::haveRight('document',$action) && in_array($itemtype, $CFG_GLPI["document_types"])) { $itemstodel = Document::getSearchOptionsToAdd(); $todel = array_merge($todel, array_keys($itemstodel)); } // do not show priority if you don't have right in profile If (($itemtype == 'Ticket') && ($action == 'w') && !Session::haveRight('update_priority', 1)) { $todel[] = 3; } if ($itemtype == 'Computer') { if (!Session::haveRight('networking', $action)) { $itemstodel = NetworkPort::getSearchOptionsToAdd($itemtype); $todel = array_merge($todel, array_keys($itemstodel)); } } if (!Session::haveRight('notes', $action)) { $todel[] = 90; } if (count($todel)) { foreach ($todel as $ID) { if (isset($options[$ID])) { unset($options[$ID]); } } } return $options; } /** * * Get an option number in the SEARCH_OPTION array * * @param $itemtype * @param $field name * * @return integer **/ static function getOptionNumber($itemtype, $field) { $table = getTableForItemType($itemtype); $opts = &self::getOptions($itemtype); foreach ($opts as $num => $opt) { if (is_array($opt) && ($opt['table'] == $table) && ($opt['field'] == $field)) { return $num; } } return 0; } /** * Get the SEARCH_OPTION array * * @param $itemtype * @param $withplugins boolean get search options from plugins (true by default) * * @return the reference to array of search options for the given item type **/ static function &getOptions($itemtype, $withplugins=true) { global $CFG_GLPI; static $search = array(); if (!isset($search[$itemtype])) { // standard type first switch ($itemtype) { case 'Internet' : $search[$itemtype]['common'] = __('Characteristics'); $search[$itemtype][1]['table'] = 'networkport_types'; $search[$itemtype][1]['field'] = 'name'; $search[$itemtype][1]['name'] = __('Name'); $search[$itemtype][1]['datatype'] = 'itemlink'; $search[$itemtype][1]['searchtype'] = 'contains'; $search[$itemtype][2]['table'] = 'networkport_types'; $search[$itemtype][2]['field'] = 'id'; $search[$itemtype][2]['name'] = __('ID'); $search[$itemtype][2]['searchtype'] = 'contains'; $search[$itemtype][31]['table'] = 'glpi_states'; $search[$itemtype][31]['field'] = 'completename'; $search[$itemtype][31]['name'] = __('Status'); $search[$itemtype] += NetworkPort::getSearchOptionsToAdd('networkport_types'); break; case 'AllAssets' : $search[$itemtype]['common'] = __('Characteristics'); $search[$itemtype][1]['table'] = 'asset_types'; $search[$itemtype][1]['field'] = 'name'; $search[$itemtype][1]['name'] = __('Name'); $search[$itemtype][1]['datatype'] = 'itemlink'; $search[$itemtype][1]['searchtype'] = 'contains'; $search[$itemtype][2]['table'] = 'asset_types'; $search[$itemtype][2]['field'] = 'id'; $search[$itemtype][2]['name'] = __('ID'); $search[$itemtype][2]['searchtype'] = 'contains'; $search[$itemtype][31]['table'] = 'glpi_states'; $search[$itemtype][31]['field'] = 'completename'; $search[$itemtype][31]['name'] = __('Status'); $search[$itemtype] += Location::getSearchOptionsToAdd(); $search[$itemtype][5]['table'] = 'asset_types'; $search[$itemtype][5]['field'] = 'serial'; $search[$itemtype][5]['name'] = __('Serial number'); $search[$itemtype][6]['table'] = 'asset_types'; $search[$itemtype][6]['field'] = 'otherserial'; $search[$itemtype][6]['name'] = __('Inventory number'); $search[$itemtype][16]['table'] = 'asset_types'; $search[$itemtype][16]['field'] = 'comment'; $search[$itemtype][16]['name'] = __('Comments'); $search[$itemtype][16]['datatype'] = 'text'; $search[$itemtype][70]['table'] = 'glpi_users'; $search[$itemtype][70]['field'] = 'name'; $search[$itemtype][70]['name'] = __('User'); $search[$itemtype][7]['table'] = 'asset_types'; $search[$itemtype][7]['field'] = 'contact'; $search[$itemtype][7]['name'] = __('Alternate username'); $search[$itemtype][7]['datatype'] = 'string'; $search[$itemtype][8]['table'] = 'asset_types'; $search[$itemtype][8]['field'] = 'contact_num'; $search[$itemtype][8]['name'] = __('Alternate username number'); $search[$itemtype][8]['datatype'] = 'string'; $search[$itemtype][71]['table'] = 'glpi_groups'; $search[$itemtype][71]['field'] = 'completename'; $search[$itemtype][71]['name'] = __('Group'); $search[$itemtype][19]['table'] = 'asset_types'; $search[$itemtype][19]['field'] = 'date_mod'; $search[$itemtype][19]['name'] = __('Last update'); $search[$itemtype][19]['datatype'] = 'datetime'; $search[$itemtype][19]['massiveaction'] = false; $search[$itemtype][23]['table'] = 'glpi_manufacturers'; $search[$itemtype][23]['field'] = 'name'; $search[$itemtype][23]['name'] = __('Manufacturer'); $search[$itemtype][24]['table'] = 'glpi_users'; $search[$itemtype][24]['field'] = 'name'; $search[$itemtype][24]['linkfield'] = 'users_id_tech'; $search[$itemtype][24]['name'] = __('Technician in charge of the hardware'); $search[$itemtype][80]['table'] = 'glpi_entities'; $search[$itemtype][80]['field'] = 'completename'; $search[$itemtype][80]['name'] = __('Entity'); break; default : if ($item = getItemForItemtype($itemtype)) { $search[$itemtype] = $item->getSearchOptions(); } break; } if (Session::getLoginUserID() && in_array($itemtype, $CFG_GLPI["ticket_types"])) { $search[$itemtype]['tracking'] = __('Assistance'); $search[$itemtype][60]['table'] = 'glpi_tickets'; $search[$itemtype][60]['linkfield'] = 'items_id'; $search[$itemtype][60]['field'] = 'count'; $search[$itemtype][60]['name'] = _x('quantity', 'Number of tickets'); $search[$itemtype][60]['forcegroupby'] = true; $search[$itemtype][60]['usehaving'] = true; $search[$itemtype][60]['datatype'] = 'number'; $search[$itemtype][60]['massiveaction'] = false; $search[$itemtype][60]['joinparams'] = array('jointype' => "itemtype_item", 'condition' => getEntitiesRestrictRequest('AND', 'NEWTABLE')); $search[$itemtype][140]['table'] = 'glpi_problems'; $search[$itemtype][140]['field'] = 'count'; $search[$itemtype][140]['name'] = __('Number of problems'); $search[$itemtype][140]['forcegroupby'] = true; $search[$itemtype][140]['usehaving'] = true; $search[$itemtype][140]['datatype'] = 'number'; $search[$itemtype][140]['massiveaction'] = false; $search[$itemtype][140]['joinparams'] = array('beforejoin' => array('table' => 'glpi_items_problems', 'joinparams' => array('jointype' => 'itemtype_item')), 'condition' => getEntitiesRestrictRequest('AND', 'NEWTABLE')); } if (in_array($itemtype, $CFG_GLPI["networkport_types"]) || ($itemtype == 'AllAssets')) { $search[$itemtype] += NetworkPort::getSearchOptionsToAdd($itemtype); } if (in_array($itemtype, $CFG_GLPI["contract_types"]) || ($itemtype == 'AllAssets')) { $search[$itemtype] += Contract::getSearchOptionsToAdd(); } if (in_array($itemtype, $CFG_GLPI["document_types"]) || ($itemtype == 'AllAssets')) { $search[$itemtype] += Document::getSearchOptionsToAdd(); } if (in_array($itemtype, $CFG_GLPI["infocom_types"]) || ($itemtype == 'AllAssets')) { $search[$itemtype] += Infocom::getSearchOptionsToAdd($itemtype); } if ($withplugins) { // Search options added by plugins $plugsearch = Plugin::getAddSearchOptions($itemtype); if (count($plugsearch)) { $search[$itemtype] += array('plugins' => __('Plugins')); $search[$itemtype] += $plugsearch; } } // Complete linkfield if not define if (!isset($item)) { // Special union type $itemtable = $CFG_GLPI['union_search_type'][$itemtype]; } else { $itemtable = $item->getTable(); } foreach ($search[$itemtype] as $key => $val) { if (!is_array($val)) { // skip sub-menu continue; } // Compatibility before 0.80 : Force massive action to false if linkfield is empty : if (isset($val['linkfield']) && empty($val['linkfield'])) { $search[$itemtype][$key]['massiveaction'] = false; } // Set default linkfield if (!isset($val['linkfield']) || empty($val['linkfield'])) { if ((strcmp($itemtable,$val['table']) == 0) && (!isset($val['joinparams']) || (count($val['joinparams']) == 0))) { $search[$itemtype][$key]['linkfield'] = $val['field']; } else { $search[$itemtype][$key]['linkfield'] = getForeignKeyFieldForTable($val['table']); } } // Set default datatype // if (!isset($val['datatype']) || empty($val['datatype'])) { // if ((strcmp($itemtable,$val['table']) != 0) // && ($val['field'] == 'name' || $val['field'] == 'completename')) { // $search[$itemtype][$key]['datatype'] = 'dropdown'; // } else { // $search[$itemtype][$key]['datatype'] = 'string'; // } // } // Add default joinparams if (!isset($val['joinparams'])) { $search[$itemtype][$key]['joinparams'] = array(); } } } return $search[$itemtype]; } /** * Convert an array to be add in url * * @param $name name of array * @param $array string/array to be added * * @return string to add **/ static function getArrayUrlLink($name, $array) { $out = ""; if (is_array($array) && count($array)>0) { foreach ($array as $key => $val) { $out .= "&".$name."[$key]=".urlencode(stripslashes($val)); } } return $out; } /** * Is the search item related to infocoms * * @param $itemtype item type * @param $searchID ID of the element in $SEARCHOPTION * * @return boolean **/ static function isInfocomOption($itemtype, $searchID) { global $CFG_GLPI; return (((($searchID >= 25) && ($searchID <= 28)) || (($searchID >= 37) && ($searchID <= 38)) || (($searchID >= 50) && ($searchID <= 59)) || (($searchID >= 120) && ($searchID <= 125))) && in_array($itemtype, $CFG_GLPI["infocom_types"])); } /** * @param $itemtype * @param $field_num **/ static function getActionsFor($itemtype, $field_num) { $searchopt = &self::getOptions($itemtype); $actions = array('contains' => __('contains'), 'searchopt' => array()); if (isset($searchopt[$field_num])) { $actions['searchopt'] = $searchopt[$field_num]; // Force search type if (isset($actions['searchopt']['searchtype'])) { // Reset search option $actions = array(); $actions['searchopt'] = $searchopt[$field_num]; if (!is_array($actions['searchopt']['searchtype'])) { $actions['searchopt']['searchtype'] = array($actions['searchopt']['searchtype']); } foreach ($actions['searchopt']['searchtype'] as $searchtype) { switch ($searchtype) { case "equals" : $actions['equals'] = __('is'); break; case "notequals" : $actions['notequals'] = __('is not'); break; case "contains" : $actions['contains'] = __('contains'); break; case "under" : $actions['under'] = __('under'); break; case "notunder" : $actions['notunder'] = __('not under'); break; case "lessthan" : $actions['lessthan'] = __('before'); break; case "morethan" : $actions['morethan'] = __('after'); break; } } return $actions; } if (isset($searchopt[$field_num]['datatype'])) { switch ($searchopt[$field_num]['datatype']) { case 'number' : $opt = array('contains' => __('contains'), 'equals' => __('is'), 'notequals' => __('is not'), 'searchopt' => $searchopt[$field_num]); // No is / isnot if no limits defined if (!isset($searchopt[$field_num]['min']) && !isset($searchopt[$field_num]['max'])) { unset($opt['equals']); unset($opt['notequals']); } return $opt; case 'bool' : return array('equals' => __('is'), 'notequals' => __('is not'), 'contains' => __('contains'), 'searchopt' => $searchopt[$field_num]); case 'right' : return array('equals' => __('is'), 'notequals' => __('is not'), 'searchopt' => $searchopt[$field_num]); case 'itemtypename' : return array('equals' => __('is'), 'notequals' => __('is not'), 'searchopt' => $searchopt[$field_num]); case 'date' : case 'datetime' : case 'date_delay' : return array('equals' => __('is'), 'notequals' => __('is not'), 'lessthan' => __('before'), 'morethan' => __('after'), 'contains' => __('contains'), 'searchopt' => $searchopt[$field_num]); } } // switch ($searchopt[$field_num]['table']) { // case 'glpi_users_validation' : // return array('equals' => __('is'), // 'notequals' => __('is not'), // 'searchopt' => $searchopt[$field_num]); // } switch ($searchopt[$field_num]['field']) { case 'id' : return array('equals' => __('is'), 'notequals' => __('is not'), 'searchopt' => $searchopt[$field_num]); case 'name' : case 'completename' : $actions = array('contains' => __('contains'), 'equals' => __('is'), 'notequals' => __('is not'), 'searchopt' => $searchopt[$field_num]); // Specific case of TreeDropdown : add under $itemtype_linked = getItemTypeForTable($searchopt[$field_num]['table']); if ($itemlinked = getItemForItemtype($itemtype_linked)) { if ($itemlinked instanceof CommonTreeDropdown) { $actions['under'] = __('under'); $actions['notunder'] = __('not under'); } return $actions; } } } return $actions; } /** * Print generic Header Column * * @param $type display type (0=HTML, 1=Sylk,2=PDF,3=CSV) * @param $value value to display * @param &$num column number * @param $linkto link display element (HTML specific) (default '') * @param $issort is the sort column ? (default 0) * @param $order order type ASC or DESC (defaut '') * @param $options string options to add (default '') * * @return string to display **/ static function showHeaderItem($type, $value, &$num, $linkto="", $issort=0, $order="", $options="") { global $CFG_GLPI; $out = ""; switch ($type) { case self::PDF_OUTPUT_LANDSCAPE : //pdf case self::PDF_OUTPUT_PORTRAIT : global $PDF_HEADER; $PDF_HEADER[$num] = Toolbox::decodeFromUtf8(Html::clean($value), 'windows-1252'); break; case self::SYLK_OUTPUT : //sylk global $SYLK_HEADER,$SYLK_SIZE; $SYLK_HEADER[$num] = self::sylk_clean($value); $SYLK_SIZE[$num] = Toolbox::strlen($SYLK_HEADER[$num]); break; case self::CSV_OUTPUT : //CSV $out = "\"".self::csv_clean($value)."\"".$_SESSION["glpicsv_delimiter"]; break; default : $out = ""; if ($issort) { if ($order=="DESC") { $out .= ""; } else { $out .= ""; } } if (!empty($linkto)) { $out .= ""; } $out .= $value; if (!empty($linkto)) { $out .= ""; } $out .= "\n"; } $num++; return $out; } /** * Print generic normal Item Cell * * @param $type display type (0=HTML, 1=Sylk,2=PDF,3=CSV) * @param $value value to display * @param &$num column number * @param $row row number * @param $extraparam extra parameters for display (default '') * *@return string to display **/ static function showItem($type, $value, &$num, $row, $extraparam='') { $out = ""; switch ($type) { case self::PDF_OUTPUT_LANDSCAPE : //pdf case self::PDF_OUTPUT_PORTRAIT : global $PDF_ARRAY,$PDF_HEADER; $value = Html::weblink_extract($value); $PDF_ARRAY[$row][$num] = Toolbox::decodeFromUtf8(Html::clean($value), 'windows-1252'); break; case self::SYLK_OUTPUT : //sylk global $SYLK_ARRAY,$SYLK_HEADER,$SYLK_SIZE; $value = Html::weblink_extract($value); $SYLK_ARRAY[$row][$num] = self::sylk_clean($value); $SYLK_SIZE[$num] = max($SYLK_SIZE[$num], Toolbox::strlen($SYLK_ARRAY[$row][$num])); break; case self::CSV_OUTPUT : //csv $value = Html::weblink_extract($value); $out = "\"".self::csv_clean($value)."\"".$_SESSION["glpicsv_delimiter"]; break; default : //TODO supprimer valign pour mettre class mais conflit avec $extraparam $out = ""; /* if (!preg_match('/
    /',$value)) { $values = preg_split("/
    /i",$value); $line_delimiter = '
    '; } else { $values = preg_split("/
    /i",$value); $line_delimiter = '
    '; } $limitto = 20; if (count($values) > $limitto) { for ( $i=0 ; $i<$limitto ; $i++) { $out .= $values[$i].$line_delimiter; } $rand=mt_rand(); $out .= "... "; $out .= Html::showToolTip($value,array('display' => false, 'autoclose' => false)); } else {*/ $out .= $value; // } $out .= "\n"; } $num++; return $out; } /** * Print generic error * * @param $type display type (0=HTML, 1=Sylk,2=PDF,3=CSV) * * @return string to display **/ static function showError($type) { $out = ""; switch ($type) { case self::PDF_OUTPUT_LANDSCAPE : //pdf case self::PDF_OUTPUT_PORTRAIT : case self::SYLK_OUTPUT : //sylk case self::CSV_OUTPUT : //csv break; default : $out = "
    ".__('No item found')."
    \n"; } return $out; } /** * Print generic footer * * @param $type display type (0=HTML, 1=Sylk,2=PDF,3=CSV) * @param $title title of file : used for PDF (default '') * * @return string to display **/ static function showFooter($type, $title="") { $out = ""; switch ($type) { case self::PDF_OUTPUT_LANDSCAPE : //pdf global $PDF_HEADER,$PDF_ARRAY; $pdf = new Cezpdf('a4','landscape'); $pdf->selectFont(GLPI_ROOT."/lib/ezpdf/fonts/Helvetica.afm"); $nb = count($PDF_ARRAY); $tmptxt = sprintf(_n('%s item', '%s items', $nb), $nb); $pdf->ezStartPageNumbers(750, 10, 10, 'left', "GLPI PDF export - ".Html::convDate(date("Y-m-d")). " - ".Toolbox::decodeFromUtf8($tmptxt, 'windows-1252'). " - {PAGENUM}/{TOTALPAGENUM}"); $options = array('fontSize' => 8, 'colGap' => 2, 'maxWidth' => 800, 'titleFontSize' => 8); $pdf->ezTable($PDF_ARRAY, $PDF_HEADER, Toolbox::decodeFromUtf8($title, 'windows-1252'), $options); $pdf->ezStream(); break; case self::PDF_OUTPUT_PORTRAIT : //pdf global $PDF_HEADER,$PDF_ARRAY; $pdf = new Cezpdf('a4','portrait'); $pdf->selectFont(GLPI_ROOT."/lib/ezpdf/fonts/Helvetica.afm"); $nb = count($PDF_ARRAY); $tmptxt = sprintf(_n('%s item', '%s items', $nb), $nb); $pdf->ezStartPageNumbers(550, 10, 10, 'left', "GLPI PDF export - ".Html::convDate(date("Y-m-d")). " - ".Toolbox::decodeFromUtf8($tmptxt, 'windows-1252'). " - {PAGENUM}/{TOTALPAGENUM}"); $options = array('fontSize' => 8, 'colGap' => 2, 'maxWidth' => 565, 'titleFontSize' => 8); $pdf->ezTable($PDF_ARRAY, $PDF_HEADER, Toolbox::decodeFromUtf8($title, 'windows-1252'), $options); $pdf->ezStream(); break; case self::SYLK_OUTPUT : //sylk global $SYLK_HEADER,$SYLK_ARRAY,$SYLK_SIZE; // largeurs des colonnes foreach ($SYLK_SIZE as $num => $val) { $out .= "F;W".$num." ".$num." ".min(50,$val)."\n"; } $out .= "\n"; // Header foreach ($SYLK_HEADER as $num => $val) { $out .= "F;SDM4;FG0C;".($num == 1 ? "Y1;" : "")."X$num\n"; $out .= "C;N;K\"".self::sylk_clean($val)."\"\n"; $out .= "\n"; } // Datas foreach ($SYLK_ARRAY as $row => $tab) { foreach ($tab as $num => $val) { $out .= "F;P3;FG0L;".($num == 1 ? "Y".$row.";" : "")."X$num\n"; $out .= "C;N;K\"".self::sylk_clean($val)."\"\n"; } } $out.= "E\n"; break; case self::CSV_OUTPUT : //csv break; default : $out = "
    \n"; } return $out; } /** * Print generic footer * * @param $type display type (0=HTML, 1=Sylk,2=PDF,3=CSV) * @param $rows number of rows * @param $cols number of columns * @param $fixed used tab_cadre_fixe table for HTML export ? (default 0) * * @return string to display **/ static function showHeader($type, $rows, $cols, $fixed=0) { $out = ""; switch ($type) { case self::PDF_OUTPUT_LANDSCAPE : //pdf case self::PDF_OUTPUT_PORTRAIT : global $PDF_ARRAY, $PDF_HEADER; $PDF_ARRAY = array(); $PDF_HEADER = array(); break; case self::SYLK_OUTPUT : // Sylk global $SYLK_ARRAY, $SYLK_HEADER, $SYLK_SIZE; $SYLK_ARRAY = array(); $SYLK_HEADER = array(); $SYLK_SIZE = array(); // entetes HTTP header("Expires: Mon, 26 Nov 1962 00:00:00 GMT"); header('Pragma: private'); /// IE BUG + SSL header('Cache-control: private, must-revalidate'); /// IE BUG + SSL header("Content-disposition: filename=glpi.slk"); header('Content-type: application/octetstream'); // entete du fichier echo "ID;PGLPI_EXPORT\n"; // ID;Pappli echo "\n"; // formats echo "P;PGeneral\n"; echo "P;P#,##0.00\n"; // P;Pformat_1 (reels) echo "P;P#,##0\n"; // P;Pformat_2 (entiers) echo "P;P@\n"; // P;Pformat_3 (textes) echo "\n"; // polices echo "P;EArial;M200\n"; echo "P;EArial;M200\n"; echo "P;EArial;M200\n"; echo "P;FArial;M200;SB\n"; echo "\n"; // nb lignes * nb colonnes echo "B;Y".$rows; echo ";X".$cols."\n"; // B;Yligmax;Xcolmax echo "\n"; break; case self::CSV_OUTPUT : // csv header("Expires: Mon, 26 Nov 1962 00:00:00 GMT"); header('Pragma: private'); /// IE BUG + SSL header('Cache-control: private, must-revalidate'); /// IE BUG + SSL header("Content-disposition: filename=glpi.csv"); header('Content-type: application/octetstream'); break; default : if ($fixed) { $out = "
    \n"; } else { $out = "
    \n"; } } return $out; } /** * Print generic new line * * @param $type display type (0=HTML, 1=Sylk,2=PDF,3=CSV) * @param $odd is it a new odd line ? (false by default) * @param $is_deleted is it a deleted search ? (false by default) * * @return string to display **/ static function showNewLine($type, $odd=false, $is_deleted=false) { $out = ""; switch ($type) { case self::PDF_OUTPUT_LANDSCAPE : //pdf case self::PDF_OUTPUT_PORTRAIT : case self::SYLK_OUTPUT : //sylk case self::CSV_OUTPUT : //csv break; default : $class = " class='tab_bg_2".($is_deleted?'_2':'')."' "; if ($odd) { $class = " class='tab_bg_1".($is_deleted?'_2':'')."' "; } $out = ""; } return $out; } /** * Print generic end line * * @param $type display type (0=HTML, 1=Sylk,2=PDF,3=CSV) * * @return string to display **/ static function showEndLine($type) { $out = ""; switch ($type) { case self::PDF_OUTPUT_LANDSCAPE : //pdf case self::PDF_OUTPUT_PORTRAIT : case self::SYLK_OUTPUT : //sylk break; case self::CSV_OUTPUT : //csv $out = "\n"; break; default : $out = ""; } return $out; } /** * @param $joinparams array */ static function computeComplexJoinID(array $joinparams) { $complexjoin = ''; // Html::printCleanArray($joinparams); if (isset($joinparams['condition'])) { $complexjoin .= $joinparams['condition']; } // For jointype == child if (isset($joinparams['jointype']) && ($joinparams['jointype'] == 'child') && isset($joinparams['linkfield'])) { $complexjoin .= $joinparams['linkfield']; } if (isset($joinparams['beforejoin'])) { if (isset($joinparams['beforejoin']['table'])) { $joinparams['beforejoin'] = array($joinparams['beforejoin']); } foreach ($joinparams['beforejoin'] as $tab) { if (isset($tab['table'])) { $complexjoin .= $tab['table']; } if (isset($tab['joinparams']) && isset($tab['joinparams']['condition'])) { $complexjoin .= $tab['joinparams']['condition']; } } } if (!empty($complexjoin)) { $complexjoin = md5($complexjoin); } return $complexjoin; } /** * Clean display value for csv export * * @param $value string value * * @return clean value **/ static function csv_clean($value) { if (Toolbox::get_magic_quotes_runtime()) { $value = stripslashes($value); } $value = str_replace("\"", "''", $value); $value = Html::clean($value); return $value; } /** * Clean display value for sylk export * * @param $value string value * * @return clean value **/ static function sylk_clean($value) { if (Toolbox::get_magic_quotes_runtime()) { $value = stripslashes($value); } $value = preg_replace('/\x0A/', ' ', $value); $value = preg_replace('/\x0D/', NULL, $value); $value = str_replace("\"", "''", $value); $value = str_replace(';', ';;', $value); $value = Html::clean($value); return $value; } /** * Create SQL search condition * * @param $field name (should be ` protected) * @param $val string value to search * @param $not boolean is a negative search ? (false by default) * @param $link with previous criteria (default 'AND') * * @return search SQL string **/ static function makeTextCriteria ($field, $val, $not=false, $link='AND') { $sql = $field . self::makeTextSearch($val, $not); if (($not && ($val != 'NULL') && ($val != 'null') && ($val != '^$')) // Not something ||(!$not && ($val == '^$'))) { // Empty $sql = "($sql OR $field IS NULL)"; } return " $link $sql "; } /** * Create SQL search condition * * @param $val string value to search * @param $not boolean is a negative search ? (false by default) * * @return search string **/ static function makeTextSearch($val, $not=false) { $NOT = ""; if ($not) { $NOT = "NOT"; } // Unclean to permit < and > search $val = Toolbox::unclean_cross_side_scripting_deep($val); if (($val == 'NULL') || ($val == 'null')) { $SEARCH = " IS $NOT NULL "; } else { $begin = 0; $end = 0; if (($length = strlen($val)) > 0) { if (($val[0] == '^')) { $begin = 1; } if ($val[$length-1] == '$') { $end = 1; } } if ($begin || $end) { // no Toolbox::substr, to be consistent with strlen result $val = substr($val, $begin, $length-$end-$begin); } $SEARCH = " $NOT LIKE '".(!$begin?"%":"").$val.(!$end?"%":"")."' "; } return $SEARCH; } /** * @since version 0.84 * * @param $pattern * @param $subject **/ static function explodeWithID($pattern, $subject) { $tab = explode($pattern, $subject); if (isset($tab[1]) && !is_numeric($tab[1])) { // Report $ to tab[0] if (preg_match('/^(\\$*)(.*)/',$tab[1],$matchs)) { if (isset($matchs[2]) && is_numeric($matchs[2])) { $tab[1] = $matchs[2]; $tab[0] .= $matchs[1]; } } } return $tab; } } ?> glpi-0.84.3+dfsg.1/inc/session.class.php000066400000000000000000001101441226600447100176730ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // class Session class Session { // GLPI MODE const NORMAL_MODE = 0; const TRANSLATION_MODE = 1; // no more used const DEBUG_MODE = 2; /** * Destroy the current session * * @return nothing **/ static function destroy() { self::start(); // Unset all of the session variables. session_unset(); // destroy may cause problems (no login / back to login page) $_SESSION = array(); // write_close may cause troubles (no login / back to login page) } /** * Init session for the user is defined * * @param $auth Auth object to init session * * @return nothing **/ static function init(Auth $auth) { global $CFG_GLPI; if ($auth->auth_succeded) { // Restart GLPi session : complete destroy to prevent lost datas $tosave = array('glpi_plugins', 'glpicookietest', 'phpCAS', 'glpicsrftokens'); $save = array(); foreach ($tosave as $t) { if (isset($_SESSION[$t])) { $save[$t] = $_SESSION[$t]; } } self::destroy(); self::start(); $_SESSION = $save; // Define default time $_SESSION["glpi_currenttime"] = date("Y-m-d H:i:s"); // Normal mode for this request $_SESSION["glpi_use_mode"] = self::NORMAL_MODE; // Check ID exists and load complete user from DB (plugins...) if (isset($auth->user->fields['id']) && $auth->user->getFromDB($auth->user->fields['id'])) { if (!$auth->user->fields['is_deleted'] && $auth->user->fields['is_active']) { $_SESSION["glpiID"] = $auth->user->fields['id']; $_SESSION["glpiname"] = $auth->user->fields['name']; $_SESSION["glpirealname"] = $auth->user->fields['realname']; $_SESSION["glpifirstname"] = $auth->user->fields['firstname']; $_SESSION["glpidefault_entity"] = $auth->user->fields['entities_id']; $_SESSION["glpiusers_idisation"] = true; $_SESSION["glpiextauth"] = $auth->extauth; $_SESSION["glpiauthtype"] = $auth->user->fields['authtype']; $_SESSION["glpisearchcount"] = array(); $_SESSION["glpisearchcount2"] = array(); $_SESSION["glpiroot"] = $CFG_GLPI["root_doc"]; $_SESSION["glpi_use_mode"] = $auth->user->fields['use_mode']; $_SESSION["glpicrontimer"] = time(); // Default tab // $_SESSION['glpi_tab']=1; $_SESSION['glpi_tabs'] = array(); $auth->user->computePreferences(); foreach ($CFG_GLPI['user_pref_field'] as $field) { if (isset($auth->user->fields[$field])) { $_SESSION["glpi$field"] = $auth->user->fields[$field]; } } // Do it here : do not reset on each page, cause export issue if ($_SESSION["glpilist_limit"] > $CFG_GLPI['list_limit_max']) { $_SESSION["glpilist_limit"] = $CFG_GLPI['list_limit_max']; } // Init not set value for language if (empty($_SESSION["glpilanguage"])) { $_SESSION["glpilanguage"] = $CFG_GLPI['language']; } self::loadLanguage(); // glpiprofiles -> other available profile with link to the associated entities Plugin::doHook("init_session"); self::initEntityProfiles(self::getLoginUserID()); // Use default profile if exist if (isset($_SESSION['glpiprofiles'][$auth->user->fields['profiles_id']])) { self::changeProfile($auth->user->fields['profiles_id']); } else { // Else use first self::changeProfile(key($_SESSION['glpiprofiles'])); } if (!isset($_SESSION["glpiactiveprofile"]["interface"])) { $auth->auth_succeded = false; $auth->addToError(__("You don't have right to connect")); } } else { $auth->auth_succeded = false; $auth->addToError(__("You don't have access to this application because your account was deactivated or removed")); } } else { $auth->auth_succeded = false; $auth->addToError(__("You don't have right to connect")); } } } /** * Set the directory where are store the session file **/ static function setPath() { if (ini_get("session.save_handler") == "files") { session_save_path(GLPI_SESSION_DIR); } } /** * Start the GLPI php session **/ static function start() { if (!session_id()) { @session_start(); } // Define current time for sync of action timing $_SESSION["glpi_currenttime"] = date("Y-m-d H:i:s"); } /** * @since version 0.84 **/ function getRootEntityName() { if (isset($_SESSION['glpirootentityname'])) { return $_SESSION['glpirootentityname']; } $entity = new Entity(); if ($entity->getFromDB(0)) { $_SESSION['glpirootentityname'] = $entity->fields['name']; } else { $_SESSION['glpirootentityname'] = 'No root entity / DB troubles'; } return $_SESSION['glpirootentityname']; } /** * Is GLPI used in multi-entities mode ? * * @return boolean **/ static function isMultiEntitiesMode() { if (!isset($_SESSION['glpi_multientitiesmode'])) { if (countElementsInTable("glpi_entities") > 1) { $_SESSION['glpi_multientitiesmode'] = 1; } else { $_SESSION['glpi_multientitiesmode'] = 0; } } return $_SESSION['glpi_multientitiesmode']; } /** * Is the user have right to see all entities ? * * @return boolean **/ Static function isViewAllEntities() { // Command line can see all entities return (isCommandLine() || ((countElementsInTable("glpi_entities")) == count($_SESSION["glpiactiveentities"]))); } /** Add an item to the navigate through search results list * * @param $itemtype device type * @param $ID ID of the item **/ static function addToNavigateListItems($itemtype, $ID) { $_SESSION['glpilistitems'][$itemtype][] = $ID; } /** Initialise a list of items to use navigate through search results * * @param $itemtype device type * @param $title list title (default '') **/ static function initNavigateListItems($itemtype, $title="") { if (empty($title)) { $title = __('List'); } $url = ''; if (!isset($_SERVER['REQUEST_URI']) || (strpos($_SERVER['REQUEST_URI'],"tabs") > 0)) { if (isset($_SERVER['HTTP_REFERER'])) { $url = $_SERVER['HTTP_REFERER']; } } else { $url = $_SERVER['REQUEST_URI']; } $_SESSION['glpilisttitle'][$itemtype] = $title; $_SESSION['glpilistitems'][$itemtype] = array(); $_SESSION['glpilisturl'][$itemtype] = $url; } /** * Change active entity to the $ID one. Update glpiactiveentities session variable. * Reload groups related to this entity. * * @param $ID ID of the new active entity ("all"=>load all possible entities) * (default 'all') * @param $is_recursive also display sub entities of the active entity ? (false by default) * * @return Nothing **/ static function changeActiveEntities($ID="all", $is_recursive=false) { $newentities = array(); $newroots = array(); if (isset($_SESSION['glpiactiveprofile'])) { if ($ID == "all") { $ancestors = array(); foreach ($_SESSION['glpiactiveprofile']['entities'] as $key => $val) { $ancestors = array_unique(array_merge(getAncestorsOf("glpi_entities", $val['id']), $ancestors)); $newroots[$val['id']] = $val['is_recursive']; $newentities[$val['id']] = $val['id']; if ($val['is_recursive']) { $entities = getSonsOf("glpi_entities", $val['id']); if (count($entities)) { foreach ($entities as $key2 => $val2) { $newentities[$key2] = $key2; } } } } } else { /// Check entity validity $ancestors = getAncestorsOf("glpi_entities", $ID); $ok = false; foreach ($_SESSION['glpiactiveprofile']['entities'] as $key => $val) { if (($val['id'] == $ID) || in_array($val['id'], $ancestors)) { // Not recursive or recursive and root entity is recursive if (!$is_recursive || $val['is_recursive']) { $ok = true; } } } if (!$ok) { return false; } $newroots[$ID] = $is_recursive; $newentities[$ID] = $ID; if ($is_recursive) { $entities = getSonsOf("glpi_entities", $ID); if (count($entities)) { foreach ($entities as $key2 => $val2) { $newentities[$key2] = $key2; } } } } } if (count($newentities) > 0) { $_SESSION['glpiactiveentities'] = $newentities; $_SESSION['glpiactiveentities_string'] = "'".implode("', '", $newentities)."'"; $active = reset($newentities); $_SESSION['glpiparententities'] = $ancestors; $_SESSION['glpiparententities_string'] = implode("', '" ,$ancestors); if (!empty($_SESSION['glpiparententities_string'])) { $_SESSION['glpiparententities_string'] = "'".$_SESSION['glpiparententities_string']."'"; } // Active entity loading $_SESSION["glpiactive_entity"] = $active; $_SESSION["glpiactive_entity_recursive"] = $is_recursive; $_SESSION["glpiactive_entity_name"] = Dropdown::getDropdownName("glpi_entities", $active); $_SESSION["glpiactive_entity_shortname"] = getTreeLeafValueName("glpi_entities", $active); if ($is_recursive || $ID=="all") { //TRANS: %s is the entity name $_SESSION["glpiactive_entity_name"] = sprintf(__('%1$s (%2$s)'), $_SESSION["glpiactive_entity_name"], __('tree structure')); $_SESSION["glpiactive_entity_shortname"] = sprintf(__('%1$s (%2$s)'), $_SESSION["glpiactive_entity_shortname"], __('tree structure')); } if (countElementsInTable('glpi_entities') < count($_SESSION['glpiactiveentities'])) { $_SESSION['glpishowallentities'] = 1; } else { $_SESSION['glpishowallentities'] = 0; } // Clean session variable to search system if (isset($_SESSION['glpisearch']) && count($_SESSION['glpisearch'])) { foreach ($_SESSION['glpisearch'] as $itemtype => $tab) { if (isset($tab['start']) && ($tab['start'] > 0)) { $_SESSION['glpisearch'][$itemtype]['start'] = 0; } } } self::loadGroups(); Plugin::doHook("change_entity"); return true; } return false; } /** * Change active profile to the $ID one. Update glpiactiveprofile session variable. * * @param $ID : ID of the new profile * * @return Nothing **/ static function changeProfile($ID) { if (isset($_SESSION['glpiprofiles'][$ID]) && count($_SESSION['glpiprofiles'][$ID]['entities'])) { $profile = new Profile(); if ($profile->getFromDB($ID)) { $profile->cleanProfile(); $data = $profile->fields; $data['entities'] = $_SESSION['glpiprofiles'][$ID]['entities']; $_SESSION['glpiactiveprofile'] = $data; $_SESSION['glpiactiveentities'] = array(); Search::resetSaveSearch(); $active_entity_done = false; // Try to load default entity if it is a root entity foreach ($data['entities'] as $key => $val) { if ($val['id'] == $_SESSION["glpidefault_entity"]) { if (self::changeActiveEntities($val['id'],$val['is_recursive'])) { $active_entity_done = true; } } } if (!$active_entity_done) { // Try to load default entity if (!self::changeActiveEntities($_SESSION["glpidefault_entity"], true)) { // Load all entities self::changeActiveEntities("all"); } } Plugin::doHook("change_profile"); } } // Clean specific datas if (isset($_SESSION['glpi_faqcategories'])) { unset($_SESSION['glpi_faqcategories']); } } /** * Set the entities session variable. Load all entities from DB * * @param $userID : ID of the user * * @return Nothing **/ static function initEntityProfiles($userID) { global $DB; $query = "SELECT DISTINCT `glpi_profiles`.* FROM `glpi_profiles_users` INNER JOIN `glpi_profiles` ON (`glpi_profiles_users`.`profiles_id` = `glpi_profiles`.`id`) WHERE `glpi_profiles_users`.`users_id` = ' $userID' ORDER BY `glpi_profiles`.`name`"; $result = $DB->query($query); $_SESSION['glpiprofiles'] = array(); if ($DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $_SESSION['glpiprofiles'][$data['id']]['name'] = $data['name']; } foreach ($_SESSION['glpiprofiles'] as $key => $tab) { $query2 = "SELECT `glpi_profiles_users`.`entities_id` AS eID, `glpi_profiles_users`.`id` AS kID, `glpi_profiles_users`.`is_recursive`, `glpi_entities`.* FROM `glpi_profiles_users` LEFT JOIN `glpi_entities` ON (`glpi_profiles_users`.`entities_id` = `glpi_entities`.`id`) WHERE `glpi_profiles_users`.`profiles_id` = '$key' AND `glpi_profiles_users`.`users_id` = '$userID' ORDER BY `glpi_entities`.`completename`"; $result2 = $DB->query($query2); if ($DB->numrows($result2)) { while ($data = $DB->fetch_assoc($result2)) { // Do not override existing entity if define as recursive if (!isset($_SESSION['glpiprofiles'][$key]['entities'][$data['eID']]) || $data['is_recursive']) { $_SESSION['glpiprofiles'][$key]['entities'][$data['eID']]['id'] = $data['eID']; $_SESSION['glpiprofiles'][$key]['entities'][$data['eID']]['name'] = $data['name']; $_SESSION['glpiprofiles'][$key]['entities'][$data['eID']]['is_recursive'] = $data['is_recursive']; } } } } } } /** * Load groups where I am in the active entity. * * @return Nothing **/ static function loadGroups() { global $DB; $_SESSION["glpigroups"] = array(); $query_gp = "SELECT `glpi_groups_users`.`groups_id` FROM `glpi_groups_users` LEFT JOIN `glpi_groups` ON (`glpi_groups_users`.`groups_id` = `glpi_groups`.`id`) WHERE `glpi_groups_users`.`users_id`='" . self::getLoginUserID() . "' " . getEntitiesRestrictRequest(" AND ","glpi_groups","entities_id", $_SESSION['glpiactiveentities'],true); $result_gp = $DB->query($query_gp); if ($DB->numrows($result_gp)) { while ($data = $DB->fetch_assoc($result_gp)) { $_SESSION["glpigroups"][] = $data["groups_id"]; } } } /** * Include the good language dict. * * Get the default language from current user in $_SESSION["glpilanguage"]. * And load the dict that correspond. * * @param $forcelang Force to load a specific lang (default '') * * @return nothing (make an include) **/ static function loadLanguage($forcelang='') { global $LANG, $CFG_GLPI, $TRANSLATE; $file = ""; if (!isset($_SESSION["glpilanguage"])) { if (isset($CFG_GLPI["language"])) { // Default config in GLPI >= 0.72 $_SESSION["glpilanguage"] = $CFG_GLPI["language"]; } else if (isset($CFG_GLPI["default_language"])) { // Default config in GLPI < 0.72 : keep it for upgrade process $_SESSION["glpilanguage"] = $CFG_GLPI["default_language"]; } else { $_SESSION["glpilanguage"] = "en_GB"; } } $trytoload = $_SESSION["glpilanguage"]; // Force to load a specific lang if (!empty($forcelang)) { $trytoload = $forcelang; } // If not set try default lang file if (empty($trytoload)) { $trytoload = $CFG_GLPI["language"]; } if (isset($CFG_GLPI["languages"][$trytoload])) { $newfile = "/locales/" . $CFG_GLPI["languages"][$trytoload][1]; } if (empty($newfile) || !is_file(GLPI_ROOT . $newfile)) { $newfile = "/locales/en_GB.mo"; } $TRANSLATE = new Zend\I18n\Translator\Translator; try { $cache = Zend\Cache\StorageFactory::factory(array('adapter' => 'apc')); $TRANSLATE->setCache($cache); } catch (Zend\Cache\Exception\ExtensionNotLoadedException $e) { // ignore when APC not available // toolbox::logDebug($e->getMessage()); } $TRANSLATE->addTranslationFile('gettext', GLPI_ROOT.$newfile, 'glpi', $trytoload); // Test APC version, if is enable with special check for cli // if (version_compare(phpversion('apc'), '3.1.6') >= 0 // && ini_get('apc.enabled') // && (!isCommandLine() || ini_get('apc.enable_cli'))) { // Try from APC cache //// $key = "glpi".sha1_file(GLPI_ROOT.$newfile); // Use content to detect changes // $cache = Zend\Cache\StorageFactory::factory(array('adapter' => 'apc', // 'plugins' => array('exception_handler' // => array('throw_exceptions' // => false)))); // $TRANSLATE->setCache($cache); // $TRANSLATE->addTranslationFile('gettext', GLPI_ROOT.$newfile, 'glpi', $trytoload); // // } else if (function_exists('xcache_get') && !isCommandLine()) { // Try from XCache // // TODO : use xcache adapter of Zend when available (2.1) // // see http://framework.zend.com/issues/browse/ZF2-543 // $key = "glpi".sha1_file(GLPI_ROOT.$newfile); // Use content to detect changes // if (@xcache_isset($key)) { // $TRANSLATE = unserialize(xcache_get($key)); // } // if (!$TRANSLATE) { // $TRANSLATE = new Zend\I18n\Translator\Translator; // $TRANSLATE->addTranslationFile('gettext', GLPI_ROOT.$newfile, 'glpi', $trytoload); // } // $tmp = xcache_set($key, serialize($TRANSLATE)); // } else { // $TRANSLATE = new Zend\I18n\Translator\Translator; // $TRANSLATE->addTranslationFile('gettext', GLPI_ROOT.$newfile, 'glpi', $trytoload); // } // Load plugin dicts if (isset($_SESSION['glpi_plugins']) && is_array($_SESSION['glpi_plugins'])) { if (count($_SESSION['glpi_plugins'])) { foreach ($_SESSION['glpi_plugins'] as $plug) { Plugin::loadLang($plug, $forcelang, $trytoload); } } } // TRANSLATION_MODE deleted : maybe find another solution ? // Debug display lang element with item // if ($_SESSION['glpi_use_mode'] == Session::TRANSLATION_MODE && $CFG_GLPI["debug_lang"]) { // foreach ($LANG as $module => $tab) { // foreach ($tab as $num => $val) { // $LANG[$module][$num] = "".$LANG[$module][$num]. // "/$module/$num"; // } // } // } $TRANSLATE->setLocale($trytoload); return $trytoload; } /** * Detect cron mode or interactive * * @since version 0.84 * * @return Boolean **/ static function isCron() { return (isset($_SESSION["glpicronuserrunning"]) && (isCommandLine() || strpos($_SERVER['PHP_SELF'], 'cron.php') || strpos($_SERVER['PHP_SELF'], 'crontask.form.php'))); } /** * Get the Login User ID or return cron user ID for cron jobs * * @param $force_human boolean force human / do not return cron user (false by default) * * @return false if user is not logged in * @return int or string : int for user id, string for cron jobs **/ static function getLoginUserID($force_human=true) { if (!$force_human && self::isCron()) { // Check cron jobs return $_SESSION["glpicronuserrunning"]; } if (isset($_SESSION["glpiID"])) { return $_SESSION["glpiID"]; } return false; } /** * Check if I have access to the central interface * * @return Nothing : display error if not permit **/ static function checkCentralAccess() { global $CFG_GLPI; if (!isset($_SESSION["glpiactiveprofile"]) || ($_SESSION["glpiactiveprofile"]["interface"] != "central")) { // Gestion timeout session if (!self::getLoginUserID()) { Html::redirect($CFG_GLPI["root_doc"] . "/index.php"); exit (); } Html::displayRightError(); } } /** * Check if I have the right to access to the FAQ (profile or anonymous FAQ) * * @return Nothing : display error if not permit **/ static function checkFaqAccess() { global $CFG_GLPI; if (($CFG_GLPI["use_public_faq"] == 0) && !self::haveRight("faq", "r")) { Html::displayRightError(); } } /** * Check if I have access to the helpdesk interface * * @return Nothing : display error if not permit **/ static function checkHelpdeskAccess() { global $CFG_GLPI; if (!isset($_SESSION["glpiactiveprofile"]) || ($_SESSION["glpiactiveprofile"]["interface"] != "helpdesk")) { // Gestion timeout session if (!self::getLoginUserID()) { Html::redirect($CFG_GLPI["root_doc"] . "/index.php"); exit (); } Html::displayRightError(); } } /** * Check if I am logged in * * @return Nothing : display error if not permit **/ static function checkLoginUser() { global $CFG_GLPI; if (!isset($_SESSION["glpiname"])) { // Gestion timeout session if (!Session::getLoginUserID()) { Html::redirect($CFG_GLPI["root_doc"] . "/index.php"); exit (); } Html::displayRightError(); } } /** * Check if I have the right $right to module $module (conpare to session variable) * * @param $module Module to check * @param $right Right to check * * @return Nothing : display error if not permit **/ static function checkRight($module, $right) { global $CFG_GLPI; if (!self::haveRight($module, $right)) { // Gestion timeout session if (!self::getLoginUserID()) { Html::redirect($CFG_GLPI["root_doc"] . "/index.php"); exit (); } Html::displayRightError(); } } /** * Check if I have one of the right specified * * @param $modules array of modules where keys are modules and value are right * * @return Nothing : display error if not permit **/ static function checkSeveralRightsOr($modules) { global $CFG_GLPI; $valid = false; if (count($modules)) { foreach ($modules as $mod => $right) { // Itemtype if (preg_match('/[A-Z]/', $mod[0])) { if ($item = getItemForItemtype($mod)) { if ($item->canGlobal($right)) { $valid = true; } } } else if (self::haveRight($mod, $right)) { $valid = true; } } } if (!$valid) { // Gestion timeout session if (!self::getLoginUserID()) { Html::redirect($CFG_GLPI["root_doc"] . "/index.php"); exit (); } Html::displayRightError(); } } /** * Check if you could access to ALL the entities of an list * * @param $tab : list ID of entities * * @return Boolean : **/ static function haveAccessToAllOfEntities($tab) { if (is_array($tab) && count($tab)) { foreach ($tab as $val) { if (!self::haveAccessToEntity($val)) { return false; } } } return true; } /** * Check if you could access (read) to the entity of id = $ID * * @param $ID ID of the entity * @param $is_recursive boolean if recursive item (default 0) * * @return Boolean : read access to entity **/ static function haveAccessToEntity($ID, $is_recursive=0) { // Quick response when passing wrong ID : default value of getEntityID is -1 if ($ID < 0) { return false; } if (!isset($_SESSION['glpiactiveentities'])) { return false; } if (!$is_recursive) { return in_array($ID, $_SESSION['glpiactiveentities']); } if (in_array($ID, $_SESSION['glpiactiveentities'])) { return true; } /// Recursive object foreach ($_SESSION['glpiactiveentities'] as $ent) { if (in_array($ID, getAncestorsOf("glpi_entities", $ent))) { return true; } } return false; } /** * Check if you could access to one entity of an list * * @param $tab list ID of entities * @param $is_recursive boolean if recursive item (default 0) * * @return Boolean : **/ static function haveAccessToOneOfEntities($tab, $is_recursive=0) { if (is_array($tab) && count($tab)) { foreach ($tab as $val) { if (self::haveAccessToEntity($val, $is_recursive)) { return true; } } } return false; } /** * Check if you could create recursive object in the entity of id = $ID * * @param $ID : ID of the entity * * @return Boolean : **/ static function haveRecursiveAccessToEntity($ID) { // Right by profile foreach ($_SESSION['glpiactiveprofile']['entities'] as $key => $val) { if ($val['id'] == $ID) { return $val['is_recursive']; } } // Right is from a recursive profile if (isset($_SESSION['glpiactiveentities'])) { return in_array($ID, $_SESSION['glpiactiveentities']); } return false; } /** * Have I the right $right to module $module (conpare to session variable) * * @param $module Module to check * @param $right Right to check * * @return Boolean : session variable have more than the right specified for the module **/ static function haveRight($module, $right) { global $DB; //If GLPI is using the slave DB -> read only mode if ($DB->isSlave() && ($right == "w")) { return false; } $matches = array("" => array("", "r", "w"), // ne doit pas arriver normalement "r" => array("r", "w"), "w" => array("w"), "1" => array("1"), "0" => array("0", "1")); // ne doit pas arriver non plus if (isset($_SESSION["glpiactiveprofile"][$module]) && in_array($_SESSION["glpiactiveprofile"][$module], $matches[$right])) { return true; } return false; } /** * Get active Tab for an itemtype * * @param $itemtype item type * * @return nothing **/ static function getActiveTab($itemtype) { if (isset($_SESSION['glpi_tabs'][strtolower($itemtype)])) { return $_SESSION['glpi_tabs'][strtolower($itemtype)]; } return ""; } /** * Add a message to be displayed after redirect * * @param $msg Message to add * @param $check_once Check if the message is not already added (false by default) * @param $message_type Message type (INFO, ERROR) (default INFO) * @param $reset Clear previous added message (false by default) **/ static function addMessageAfterRedirect($msg, $check_once=false, $message_type=INFO, $reset=false) { if (!empty($msg)) { if (self::isCron()) { // We are in cron mode // Do not display message in user interface, but record error if ($message_type == ERROR) { Toolbox::logInFile('cron', $msg."\n"); } } else { if ($reset) { $_SESSION["MESSAGE_AFTER_REDIRECT"] = ''; } $toadd = ""; if ($check_once) { if (strstr($_SESSION["MESSAGE_AFTER_REDIRECT"], $msg) === false) { $toadd = $msg.'
    '; } } else { $toadd = $msg.'
    '; } if (!empty($toadd)) { switch ($message_type) { case ERROR : $_SESSION["MESSAGE_AFTER_REDIRECT"] .= "

    $toadd

    "; break; default: // INFO $_SESSION["MESSAGE_AFTER_REDIRECT"] .= "

    $toadd

    "; } } } } } /** * Force active Tab for an itemtype * * @param $itemtype item type * @param $tab ID of the tab **/ static function setActiveTab($itemtype, $tab) { $_SESSION['glpi_tabs'][strtolower($itemtype)] = $tab; } /** * Get a saved option from request or session * if get from request, save it * * @since version 0.83 * * @param $itemtype string name of itemtype * @param $name string name of the option * @param $defvalue mixed default value for option * * @return Mixed value of the option **/ static function getSavedOption($itemtype, $name, $defvalue) { if (isset($_REQUEST[$name])) { return $_SESSION['glpi_saved'][$itemtype][$name] = $_REQUEST[$name]; } if (isset($_SESSION['glpi_saved'][$itemtype][$name])) { return $_SESSION['glpi_saved'][$itemtype][$name]; } return $defvalue; } /** * Is the current account read-only * * @since version 0.83 * * @return Boolean **/ static function isReadOnlyAccount() { foreach ($_SESSION['glpiactiveprofile'] as $name => $val) { if (is_string($val) && ($name != 'search_config') && ($val == 'w')) { return false; } } return true; } /** * Get new CSRF token * * @since version 0.83.3 * * @return string new generated token **/ static public function getNewCSRFToken() { global $CURRENTCSRFTOKEN; if (empty($CURRENTCSRFTOKEN)) { $CURRENTCSRFTOKEN = md5(uniqid(rand(), TRUE)); } if (!isset($_SESSION['glpicsrftokens'])) { $_SESSION['glpicsrftokens'] = array(); } $_SESSION['glpicsrftokens'][$CURRENTCSRFTOKEN] = time() + GLPI_CSRF_EXPIRES; return $CURRENTCSRFTOKEN; } /** * Clean expires CSRF tokens * * @since version 0.83.3 * * @return nothing **/ static public function cleanCSRFTokens() { $now = time(); if (isset($_SESSION['glpicsrftokens']) && is_array($_SESSION['glpicsrftokens'])) { if (count($_SESSION['glpicsrftokens'])) { foreach ($_SESSION['glpicsrftokens'] as $token => $expires) { if ($expires < $now) { unset($_SESSION['glpicsrftokens'][$token]); } } $overflow = count($_SESSION['glpicsrftokens']) - GLPI_CSRF_MAX_TOKENS; if ($overflow > 0) { $_SESSION['glpicsrftokens'] = array_slice($_SESSION['glpicsrftokens'], $overflow + 1, null, true); } } } } /** * Validate that the page has a CSRF token in the POST data * and that the token is legit/not expired. If the token is valid * it will be removed from the list of valid tokens. * * @since version 0.83.3 * * @param $data array $_POST datas * * @return boolean Valid csrf token. **/ static public function validateCSRF($data) { if (!isset($data['_glpi_csrf_token'])) { Session::cleanCSRFTokens(); return false; } $requestToken = $data['_glpi_csrf_token']; if (isset($_SESSION['glpicsrftokens'][$requestToken]) && ($_SESSION['glpicsrftokens'][$requestToken] >= time())) { unset($_SESSION['glpicsrftokens'][$requestToken]); Session::cleanCSRFTokens(); return true; } Session::cleanCSRFTokens(); return false; } /** * Check CSRF data * * @since version 0.84.2 * * @param $data array $_POST datas * * @return nothing : display error if not permit **/ static public function checkCSRF($data) { if (GLPI_USE_CSRF_CHECK && (!Session::validateCSRF($data))) { Html::displayErrorAndDie(__("The action you have requested is not allowed."), true); } } } ?>glpi-0.84.3+dfsg.1/inc/singletonrulelist.class.php000066400000000000000000000034571226600447100220060ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class SingletonRuleList { /// Items list var $list = array(); /// Items loaded ? var $load = 0; /** * get a unique instance of a SingletonRuleList for a type of RuleCollection * * @param $type type of the Rule listed * @param $entity entity where the rule Rule is processed * * @return unique instance of an object **/ public static function &getInstance($type, $entity) { static $instances = array(); if (!isset($instances[$type][$entity])) { $instances[$type][$entity] = new self(); } return $instances[$type][$entity]; } } ?>glpi-0.84.3+dfsg.1/inc/sla.class.php000077500000000000000000000277431226600447100170060ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class SLA class SLA extends CommonDBTM { // From CommonDBTM var $dohistory = true; static protected $forward_entity_to = array('SLALevel'); static function getTypeName($nb=0) { // Acronymous, no plural return __('SLA'); } static function canCreate() { return Session::haveRight('sla', 'w'); } static function canView() { return Session::haveRight('sla', 'r'); } /** * Define calendar of the ticket using the SLA when using this calendar as sla-s calendar * * @param $calendars_id calendars_id of the ticket **/ function setTicketCalendar($calendars_id) { if ($this->fields['calendars_id'] == -1 ) { $this->fields['calendars_id'] = $calendars_id; } } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('SlaLevel', $ong, $options); $this->addStandardTab('Rule', $ong, $options); $this->addStandardTab('Ticket', $ong, $options); return $ong; } function post_getEmpty() { $this->fields['resolution_time'] = DAY_TIMESTAMP; } function cleanDBonPurge() { global $DB; // Clean sla_levels $query = "SELECT `id` FROM `glpi_slalevels` WHERE `slas_id` = '".$this->fields['id']."'"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { $slalevel = new SlaLevel(); while ($data = $DB->fetch_assoc($result)) { $slalevel->delete($data); } } } // Update tickets : clean SLA $query = "SELECT `id` FROM `glpi_tickets` WHERE `slas_id` = '".$this->fields['id']."'"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { $ticket = new Ticket(); while ($data = $DB->fetch_assoc($result)) { $ticket->deleteSLA($data['id']); } } } Rule::cleanForItemAction($this); } /** * Print the sla form * * @param $ID integer ID of the item * @param $options array of possible options: * - target filename : where to go when done. * - withtemplate boolean : template or basic item * *@return boolean item found **/ function showForm($ID, $options=array()) { $rowspan = 3; if ($ID > 0) { $rowspan = 4; } $this->initForm($ID, $options); $this->showTabs($options); $this->showFormHeader($options); echo ""; echo ""; echo ""; echo ""; if ($ID > 0) { echo ""; echo ""; echo ""; } echo ""; echo ""; echo ""; echo ""; $this->showFormButtons($options); $this->addDivForTabs(); return true; } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab[4]['table'] = 'glpi_calendars'; $tab[4]['field'] = 'name'; $tab[4]['name'] = __('Calendar'); $tab[4]['datatype'] = 'dropdown'; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab[80]['table'] = 'glpi_entities'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = __('Entity'); $tab[80]['massiveaction'] = false; $tab[80]['datatype'] = 'dropdown'; $tab[86]['table'] = $this->getTable(); $tab[86]['field'] = 'is_recursive'; $tab[86]['name'] = __('Child entities'); $tab[86]['datatype'] = 'bool'; return $tab; } /** * Get due date based on a sla * * @param $start_date datetime start date * @param $additional_delay integer additional delay to add or substract (for waiting time) * (default 0) * * @return due date time (NULL if sla not exists) **/ function computeDueDate($start_date, $additional_delay=0) { if (isset($this->fields['id'])) { // Based on a calendar if ($this->fields['calendars_id'] > 0) { $cal = new Calendar(); $work_in_days = ($this->fields['resolution_time'] >= DAY_TIMESTAMP); if ($cal->getFromDB($this->fields['calendars_id'])) { return $cal->computeEndDate($start_date, $this->fields['resolution_time']+$additional_delay, $work_in_days); } } // No calendar defined or invalid calendar $starttime = strtotime($start_date); $endtime = $starttime+$this->fields['resolution_time']+$additional_delay; return date('Y-m-d H:i:s',$endtime); } return NULL; } /** * Get execution date of a sla level * * @param $start_date datetime start date * @param $slalevels_id integer sla level id * @param $additional_delay integer additional delay to add or substract (for waiting time) * (default 0) * * @return execution date time (NULL if sla not exists) **/ function computeExecutionDate($start_date, $slalevels_id, $additional_delay=0) { if (isset($this->fields['id'])) { $slalevel = new SlaLevel(); if ($slalevel->getFromDB($slalevels_id)) { // sla level exists if ($slalevel->fields['slas_id'] == $this->fields['id']) { // correct sla level $work_in_days = ($this->fields['resolution_time'] >= DAY_TIMESTAMP); $delay = $this->fields['resolution_time']+$slalevel->fields['execution_time'] +$additional_delay; // Based on a calendar if ($this->fields['calendars_id'] > 0) { $cal = new Calendar(); if ($cal->getFromDB($this->fields['calendars_id'])) { return $cal->computeEndDate($start_date, $delay, $work_in_days); } } // No calendar defined or invalid calendar $starttime = strtotime($start_date); $endtime = $starttime+$delay; return date('Y-m-d H:i:s',$endtime); } } } return NULL; } /** * Get active time between to date time for the active calendar * * @param $start datetime begin * @param $end datetime end * * @return timestamp of delay **/ function getActiveTimeBetween($start, $end) { if ($end < $start) { return 0; } if (isset($this->fields['id'])) { $slalevel = new SlaLevel(); $cal = new Calendar(); $work_in_days = ($this->fields['resolution_time'] >= DAY_TIMESTAMP); // Based on a calendar if ($this->fields['calendars_id'] > 0) { if ($cal->getFromDB($this->fields['calendars_id'])) { return $cal->getActiveTimeBetween($start, $end, $work_in_days); } } else { // No calendar $timestart = strtotime($start); $timeend = strtotime($end); return ($timeend-$timestart); } } return 0; } /** * Add a level to do for a ticket * * @param $ticket Ticket object * * @return execution date time (NULL if sla not exists) **/ function addLevelToDo(Ticket $ticket) { if ($ticket->fields["slalevels_id"]>0) { $toadd = array(); $toadd['date'] = $this->computeExecutionDate($ticket->fields['date'], $ticket->fields['slalevels_id'], $ticket->fields['sla_waiting_duration']); $toadd['slalevels_id'] = $ticket->fields["slalevels_id"]; $toadd['tickets_id'] = $ticket->fields["id"]; $slalevelticket = new SlaLevel_Ticket(); $slalevelticket->add($toadd); } } /** * Add a level to do for a ticket * * @param $ticket Ticket object * * @return execution date time (NULL if sla not exists) **/ static function deleteLevelsToDo(Ticket $ticket) { global $DB; if ($ticket->fields["slalevels_id"] > 0) { $query = "SELECT * FROM `glpi_slalevels_tickets` WHERE `tickets_id` = '".$ticket->fields["id"]."'"; $slalevelticket = new SlaLevel_Ticket(); foreach ($DB->request($query) as $data) { $slalevelticket->delete(array('id' => $data['id'])); } } } } ?> glpi-0.84.3+dfsg.1/inc/slalevel.class.php000077500000000000000000000364251226600447100200330ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class SLA class SlaLevel extends RuleTicket { protected $rules_id_field = 'slalevels_id'; protected $ruleactionclass = 'SlaLevelAction'; // No criteria protected $rulecriteriaclass = 'SlaLevelCriteria'; static public $right = 'sla'; /** * Constructor **/ function __construct() { // Override in order not to use glpi_rules table. } // Temporary hack for this class in 0.84 static function getTable() { return 'glpi_slalevels'; } /** * @since version 0.84 **/ function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } static function getTypeName($nb=0) { return _n('Escalation level', 'Escalation levels', $nb); } function cleanDBonPurge() { global $DB; parent::cleanDBOnPurge(); $sql = "DELETE FROM `glpi_slalevels_tickets` WHERE `".$this->rules_id_field."` = '".$this->fields['id']."'"; $DB->query($sql); } /** * @param $sla SLA object **/ function showForSLA(SLA $sla) { global $DB; $ID = $sla->getField('id'); if (!$sla->can($ID, 'r')) { return false; } $canedit = $sla->can($ID,'w'); $rand = mt_rand(); if ($canedit) { echo "
    "; echo ""; echo "
    ".__('Name').""; Html::autocompletionTextField($this, "name", array('value' => $this->fields["name"])); echo "".__('Comments')." "; echo "
    ".__('Last update')."".($this->fields["date_mod"] ? Html::convDateTime($this->fields["date_mod"]) : __('Never')); echo "
    ".__('Calendar').""; Calendar::dropdown(array('value' => $this->fields["calendars_id"], 'emptylabel' => __('24/7'), 'toadd' => array('-1' => __('Calendar of the ticket')))); echo "
    ".__('Maximum time to solve').""; $possible_values = array(); for ($i=10 ; $i<60 ; $i+=10) { $possible_values[$i*MINUTE_TIMESTAMP] = sprintf(_n('%d minutes','%d minutes',$i),$i); } for ($i=1 ; $i<24 ; $i++) { $possible_values[$i*HOUR_TIMESTAMP] = sprintf(_n('%d hour','%d hours',$i),$i); } for ($i=1 ; $i<30 ; $i++) { $possible_values[$i*DAY_TIMESTAMP] = sprintf(_n('%d day','%d days',$i),$i); } Dropdown::showFromArray('resolution_time', $possible_values, array('value' => $this->fields["resolution_time"])); echo "
    "; echo ""; echo ""; echo "
    ".__('Add an escalation level')."
    ".__('Name').""; echo ""; echo ""; echo ""; echo ""; echo "".__('Execution').""; self::dropdownExecutionTime('execution_time', array('max_time' => $sla->fields['resolution_time'], 'used' => self::getAlreadyUsedExecutionTime($sla->fields['id']))); echo "".__('Active').""; Dropdown::showYesNo("is_active", 1); echo ""; echo ""; echo "
    "; Html::closeForm(); echo "
    "; } $query = "SELECT * FROM `glpi_slalevels` WHERE `slas_id` = '$ID' ORDER BY `execution_time`"; $result = $DB->query($query); $numrows = $DB->numrows($result); echo "
    "; if ($canedit && $numrows) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $massiveactionparams = array('num_displayed' => $numrows); Html::showMassiveActions(__CLASS__, $massiveactionparams); } echo ""; echo ""; if ($canedit && $numrows) { echo ""; } echo ""; echo ""; echo ""; echo ""; Session::initNavigateListItems('SlaLevel', //TRANS: %1$s is the itemtype name, %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), SLA::getTypeName(1), $sla->getName())); while ($data = $DB->fetch_assoc($result)) { Session::addToNavigateListItems('SlaLevel', $data["id"]); echo ""; if ($canedit) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
    ".Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand)."".__('Name')."".__('Execution')."".__('Active')."
    ".Html::getMassiveActionCheckBox(__CLASS__, $data["id"]).""; if ($canedit) { echo ""; } echo $data["name"]; if (empty($data["name"])) { echo "(".$data['id'].")"; } if ($canedit) { echo ""; } echo "".(($data["execution_time"] <> 0) ?Html::timestampToString($data["execution_time"], false) :__('Due date'))."".Dropdown::getYesNo($data["is_active"])."
    "; $this->getRuleWithCriteriasAndActions($data['id'],1,1); $this->showCriteriasList($data["id"], array('readonly' => true)); echo ""; $this->showActionsList($data["id"], array('readonly' => true)); echo "
    "; if ($canedit && $numrows) { $massiveactionparams['ontop'] = false; Html::showMassiveActions(__CLASS__, $massiveactionparams); Html::closeForm(); } echo "
    "; } function getActions() { $actions = parent::getActions(); unset($actions['slas_id']); $actions['recall']['name'] = __('Automatic reminders of SLA'); $actions['recall']['type'] = 'yesonly'; $actions['recall']['force_actions'] = array('send'); // Only append actors $actions['_users_id_requester']['force_actions'] = array('append'); $actions['_groups_id_requester']['force_actions'] = array('append'); $actions['_users_id_assign']['force_actions'] = array('append'); $actions['_groups_id_assign']['force_actions'] = array('append'); $actions['_suppliers_id_assign']['force_actions'] = array('append'); $actions['_users_id_observer']['force_actions'] = array('append'); $actions['_groups_id_observer']['force_actions'] = array('append'); return $actions; } /** * @since version 0.84 * * @see RuleTicket::getCriterias() **/ function getCriterias() { $actions = parent::getActions(); unset($actions['slas_id']); // Could not be used as criteria unset($actions['users_id_validate_requester_supervisor']); unset($actions['users_id_validate_assign_supervisor']); unset($actions['affectobject']); unset($actions['groups_id_validate']); unset($actions['users_id_validate']); $actions['status']['name'] = __('Status'); $actions['status']['type'] = 'dropdown_status'; return $actions; } /** * Show the rule * * @param $ID ID of the rule * @param $options array of possible options * * @return nothing **/ function showForm($ID, $options=array()) { $canedit = $this->can(static::$right,"w"); $this->initForm($ID, $options); $this->showTabs($options); $this->showFormHeader($options); echo ""; echo "".__('Name').""; echo ""; Html::autocompletionTextField($this, "name"); echo ""; echo "".__('Active').""; echo ""; Dropdown::showYesNo("is_active", $this->fields["is_active"]); echo"\n"; $sla = new SLA(); $sla->getFromDB($this->fields['slas_id']); echo ""; echo "".SLA::getTypeName(1).""; echo "".$sla->getLink().""; echo "".__('Execution').""; echo ""; self::dropdownExecutionTime('execution_time', array('max_time' => $sla->fields['resolution_time'], 'used' => self::getAlreadyUsedExecutionTime($sla->fields['id']), 'value' => $this->fields['execution_time'])); echo "\n"; echo ""; echo "".__('Logical operator').""; echo ""; $this->dropdownRulesMatch(array('value' => $this->fields["match"])); echo ""; echo " "; $this->showFormButtons($options); $this->addDivForTabs(); } /** * Dropdown execution time for SLA * * @param $name string name of the select * @param $options array of possible options: * - value : default value * - max_time : max time to use * - used : already used values * * @return nothing **/ static function dropdownExecutionTime($name, $options=array()) { $p['value'] = ''; $p['max_time'] = 4*DAY_TIMESTAMP; $p['used'] = array(); if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } // Display default value; if (($key = array_search($p['value'], $p['used'])) !== false) { unset($p['used'][$key]); } $possible_values = array(); for ($i=10 ; $i<60 ; $i+=10) { if (!in_array($i*MINUTE_TIMESTAMP,$p['used'])) { $possible_values[$i*MINUTE_TIMESTAMP] = sprintf(_n('+ %d minute','+ %d minutes',$i), $i); } if (!in_array(-$i*MINUTE_TIMESTAMP,$p['used'])) { if ($p['max_time'] >= $i*MINUTE_TIMESTAMP) { $possible_values[-$i*MINUTE_TIMESTAMP] = sprintf(_n('- %d minute','- %d minutes',$i), $i); } } } for ($i=1 ; $i<24 ; $i++) { if (!in_array($i*HOUR_TIMESTAMP,$p['used'])) { $possible_values[$i*HOUR_TIMESTAMP] = sprintf(_n('+ %d hour','+ %d hours',$i), $i); } if (!in_array(-$i*HOUR_TIMESTAMP,$p['used'])) { if ($p['max_time'] >= $i*HOUR_TIMESTAMP) { $possible_values[-$i*HOUR_TIMESTAMP] = sprintf(_n('- %d hour','- %d hours',$i), $i); } } } for ($i=1 ; $i<30 ; $i++) { if (!in_array($i*DAY_TIMESTAMP,$p['used'])) { $possible_values[$i*DAY_TIMESTAMP] = sprintf(_n('+ %d day','+ %d days',$i), $i); } if (!in_array(-$i*DAY_TIMESTAMP,$p['used'])) { if ($p['max_time'] >= $i*DAY_TIMESTAMP) { $possible_values[-$i*DAY_TIMESTAMP] = sprintf(_n('- %d day','- %d days',$i), $i); } } } if (!in_array(0,$p['used'])) { $possible_values[0] = __('Due date'); } ksort($possible_values); Dropdown::showFromArray($name, $possible_values, array('value' => $p['value'])); } /** * Get already used execution time for a SLA * * @param $slas_id integer id of the SLA * * @return array of already used execution times **/ static function getAlreadyUsedExecutionTime($slas_id) { global $DB; $result = array(); $query = "SELECT DISTINCT `execution_time` FROM `glpi_slalevels` WHERE `slas_id` = '$slas_id';"; foreach ($DB->request($query) as $data) { $result[$data['execution_time']] = $data['execution_time']; } return $result; } /** * Get first level for a SLA * * @param $slas_id integer id of the SLA * * @return id of the sla level : 0 if not exists **/ static function getFirstSlaLevel($slas_id) { global $DB; $query = "SELECT `id` FROM `glpi_slalevels` WHERE `slas_id` = '$slas_id' AND `is_active` = 1 ORDER BY `execution_time` ASC LIMIT 1;"; if ($result = $DB->query($query)) { if ($DB->numrows($result)) { return $DB->result($result,0,0); } } return 0; } /** * Get next level for a SLA * * @param $slas_id integer id of the SLA * @param $slalevels_id integer id of the current SLA level * * @return id of the sla level : 0 if not exists **/ static function getNextSlaLevel($slas_id, $slalevels_id) { global $DB; $query = "SELECT `execution_time` FROM `glpi_slalevels` WHERE `id` = '$slalevels_id';"; if ($result = $DB->query($query)) { if ($DB->numrows($result)) { $execution_time = $DB->result($result,0,0); $query = "SELECT `id` FROM `glpi_slalevels` WHERE `slas_id` = '$slas_id' AND `id` <> '$slalevels_id' AND `execution_time` > '$execution_time' AND `is_active` = 1 ORDER BY `execution_time` ASC LIMIT 1 ;"; if ($result = $DB->query($query)) { if ($DB->numrows($result)) { return $DB->result($result,0,0); } } } } return 0; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { switch ($item->getType()) { case 'SLA' : if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(self::getTypeName(2), countElementsInTable($this->getTable(), "`slas_id` = '".$item->getID()."'")); } return self::getTypeName(2); } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType() == 'SLA') { $slalevel = new self(); $slalevel->showForSLA($item); } return true; } } ?> glpi-0.84.3+dfsg.1/inc/slalevel_ticket.class.php000077500000000000000000000132221226600447100213640ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class SLA class SlaLevel_Ticket extends CommonDBTM { /** * Retrieve an item from the database * * @param $ID ID of the item to get * * @return true if succeed else false **/ function getFromDBForTicket($ID) { return $this->getFromDBByQuery("WHERE `".$this->getTable()."`.`tickets_id` = '$ID'"); } /** * Delete entries for a ticket * * @param $tickets_id Ticket ID * * @return nothing **/ static function deleteForTicket($tickets_id) { global $DB; $query1 = "DELETE FROM `glpi_slalevels_tickets` WHERE `tickets_id` = '$tickets_id'"; $DB->query($query1); } /** * Give cron information * * @param $name : task's name * * @return arrray of information **/ static function cronInfo($name) { switch ($name) { case 'slaticket' : return array('description' => __('Automatic actions of SLA')); } return array(); } /** * Cron for ticket's automatic close * * @param $task : CronTask object * * @return integer (0 : nothing done - 1 : done) **/ static function cronSlaTicket(CronTask $task) { global $DB; $tot = 0; $query = "SELECT * FROM `glpi_slalevels_tickets` WHERE `glpi_slalevels_tickets`.`date` < NOW()"; foreach ($DB->request($query) as $data) { $tot++; self::doLevelForTicket($data); } $task->setVolume($tot); return ($tot > 0); } /** * Do a specific SLAlevel for a ticket * * @param $data array data of an entry of slalevels_tickets * * @return nothing **/ static function doLevelForTicket(array $data) { $ticket = new Ticket(); $slalevelticket = new self(); if ($ticket->getFromDB($data['tickets_id'])) { $slalevel = new SlaLevel(); $sla = new SLA(); // Check if sla datas are OK if (($ticket->fields['slas_id'] > 0) && ($ticket->fields['slalevels_id'] == $data['slalevels_id'])) { if ($ticket->fields['status'] == CommonITILObject::CLOSED) { // Drop line when status is closed $slalevelticket->delete(array('id' => $data['id'])); } else if ($ticket->fields['status'] != CommonITILObject::SOLVED) { // If status = solved : keep the line in case of solution not validated $input['id'] = $ticket->getID(); $input['_auto_update'] = true; if ($slalevel->getRuleWithCriteriasAndActions($data['slalevels_id'], 1, 1) && $sla->getFromDB($ticket->fields['slas_id'])) { $doit = true; if (count($slalevel->criterias)) { $doit = $slalevel->checkCriterias($ticket->fields); } // Process rules if ($doit) { $input = $slalevel->executeActions($input, array()); } } // Put next level in todo list $next = $slalevel->getNextSlaLevel($ticket->fields['slas_id'], $ticket->fields['slalevels_id']); $input['slalevels_id'] = $next; $ticket->update($input); $sla->addLevelToDo($ticket); // Action done : drop the line $slalevelticket->delete(array('id' => $data['id'])); } } else { // Drop line $slalevelticket->delete(array('id' => $data['id'])); } } else { // Drop line $slalevelticket->delete(array('id' => $data['id'])); } } /** * Replay all task needed for a specific ticket * * @param $tickets_id Ticket ID * * @return nothing **/ static function replayForTicket($tickets_id) { global $DB; $query = "SELECT * FROM `glpi_slalevels_tickets` WHERE `glpi_slalevels_tickets`.`date` < NOW() AND `tickets_id` = '$tickets_id'"; $number = 0; do { if ($result = $DB->query($query)) { $number = $DB->numrows($result); if ($number == 1) { $data = $DB->fetch_assoc($result); self::doLevelForTicket($data); } } } while ($number == 1); } } ?>glpi-0.84.3+dfsg.1/inc/slalevelaction.class.php000077500000000000000000000027771226600447100212340ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class SlaLevelAction class SlaLevelAction extends RuleAction { static public $itemtype = 'SlaLevel'; static public $items_id = 'slalevels_id'; public $dohistory = true; /** * Constructor **/ function __construct() { // Override in order not to use glpi_rules table. } } ?> glpi-0.84.3+dfsg.1/inc/slalevelcriteria.class.php000066400000000000000000000030441226600447100215420ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.84 */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class SlaLevelCriteria class SlaLevelCriteria extends RuleCriteria { static public $itemtype = 'SlaLevel'; static public $items_id = 'slalevels_id'; public $dohistory = true; /** * Constructor **/ function __construct() { // Override in order not to use glpi_rules table. } } ?> glpi-0.84.3+dfsg.1/inc/software.class.php000066400000000000000000001114061226600447100200440ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Software class class Software extends CommonDBTM { // From CommonDBTM public $dohistory = true; static protected $forward_entity_to = array('Infocom', 'ReservationItem', 'SoftwareVersion'); static function getTypeName($nb=0) { return _n('Software', 'Software', $nb); } static function canCreate() { return Session::haveRight('software', 'w'); } static function canView() { return Session::haveRight('software', 'r'); } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { switch ($item->getType()) { case __CLASS__ : if ($item->isRecursive() && $item->can($item->fields['id'],'w')) { return __('Merging'); } break; } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType() == __CLASS__) { $item->showMergeCandidates(); } return true; } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('SoftwareVersion', $ong, $options); $this->addStandardTab('SoftwareLicense', $ong, $options); $this->addStandardTab('Computer_SoftwareVersion', $ong, $options); $this->addStandardTab('Infocom', $ong, $options); $this->addStandardTab('Contract_Item', $ong, $options); $this->addStandardTab('Document_Item', $ong, $options); $this->addStandardTab('Ticket', $ong, $options); $this->addStandardTab('Item_Problem', $ong, $options); $this->addStandardTab('Link', $ong, $options); $this->addStandardTab('Note', $ong, $options); $this->addStandardTab('Reservation', $ong, $options); $this->addStandardTab('Log', $ong, $options); $this->addStandardTab(__CLASS__, $ong, $options); return $ong; } function prepareInputForUpdate($input) { if (isset($input['is_update']) && !$input['is_update']) { $input['softwares_id'] = 0; } return $input; } function prepareInputForAdd($input) { if (isset($input['is_update']) && !$input['is_update']) { $input['softwares_id'] = 0; } if (isset($input["id"]) && ($input["id"] > 0)) { $input["_oldID"] = $input["id"]; } unset($input['id']); unset($input['withtemplate']); //If category was not set by user (when manually adding a user) if (!isset($input["softwarecategories_id"]) || !$input["softwarecategories_id"]) { $softcatrule = new RuleSoftwareCategoryCollection(); $result = $softcatrule->processAllRules(null,null,Toolbox::stripslashes_deep($input)); if (!empty($result) && isset($result["softwarecategories_id"])) { $input["softwarecategories_id"] = $result["softwarecategories_id"]; } else { $input["softwarecategories_id"] = 0; } } return $input; } function post_addItem() { global $DB, $CFG_GLPI; // Manage add from template if (isset($this->input["_oldID"])) { // ADD Infocoms Infocom::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); // ADD Contract Contract_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); // ADD Documents Document_Item::cloneItem($this->getType(), $this->input["_oldID"], $this->fields['id']); } } function cleanDBonPurge() { global $DB; // Delete all licenses $query2 = "SELECT `id` FROM `glpi_softwarelicenses` WHERE `softwares_id` = '".$this->fields['id']."'"; if ($result2 = $DB->query($query2)) { if ($DB->numrows($result2)) { $lic = new SoftwareLicense(); while ($data = $DB->fetch_assoc($result2)) { $lic->delete(array("id" => $data["id"])); } } } $version = new SoftwareVersion(); $version->cleanDBonItemDelete(__CLASS__, $this->fields['id']); $ip = new Item_Problem(); $ip->cleanDBonItemDelete(__CLASS__, $this->fields['id']); } /** * Print the Software form * * @param $ID integer ID of the item * @param $options array of possible options: * - target filename : where to go when done. * - withtemplate boolean : template or basic item * *@return boolean item found **/ function showForm($ID, $options=array()) { $this->initForm($ID, $options); $this->showTabs($options); $this->showFormHeader($options); $canedit = $this->can($ID,'w'); echo ""; echo "" . __('Name') . ""; echo ""; Html::autocompletionTextField($this, "name"); echo ""; echo "" . __('Publisher').""; Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"])); echo "\n"; echo ""; echo "" . __('Location') . ""; Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"])); echo ""; echo "" . __('Category') . ""; SoftwareCategory::dropdown(array('value' => $this->fields["softwarecategories_id"])); echo "\n"; echo ""; echo "" . __('Technician in charge of the hardware') . ""; User::dropdown(array('name' => 'users_id_tech', 'value' => $this->fields["users_id_tech"], 'right' => 'own_ticket', 'entity' => $this->fields["entities_id"])); echo ""; echo "" . __('Associable to a ticket') . ""; Dropdown::showYesNo('is_helpdesk_visible', $this->fields['is_helpdesk_visible']); echo "\n"; echo ""; echo "".__('Group in charge of the hardware').""; echo ""; Group::dropdown(array('name' => 'groups_id_tech', 'value' => $this->fields['groups_id_tech'], 'entity' => $this->fields['entities_id'], 'condition' => '`is_assign`')); echo ""; echo "".__('Comments') . ""; echo ""; echo ""; echo "\n"; echo ""; echo "" . __('User') . ""; echo ""; User::dropdown(array('value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all')); echo "\n"; echo ""; echo "" . __('Group') . ""; Group::dropdown(array('value' => $this->fields["groups_id"], 'entity' => $this->fields["entities_id"], 'condition' => '`is_itemgroup`')); echo "\n"; echo ""; echo ""; if ((!isset($options['withtemplate']) || ($options['withtemplate'] == 0)) && !empty($this->fields['template_name'])) { echo ""; printf(__('Created from the template %s'), $this->fields['template_name']); echo ""; } else { echo " "; } echo ""; if (isset($options['withtemplate']) && $options['withtemplate']) { //TRANS: %s is the datetime of insertion printf(__('Created on %s'), Html::convDateTime($_SESSION["glpi_currenttime"])); } else { //TRANS: %s is the datetime of insertion printf(__('Last update on %s'), Html::convDateTime($this->fields["date_mod"])); } echo "\n"; // UPDATE echo ""; //TRANS: a noun, (ex : this software is an upgrade of..) echo "" . __('Upgrade') . ""; Dropdown::showYesNo("is_update", $this->fields['is_update']); echo " " . __('from') . " "; Software::dropdown(array('value' => $this->fields["softwares_id"])); echo "\n"; $this->showFormButtons($options); $this->addDivForTabs(); return true; } function getEmpty() { global $CFG_GLPI; parent::getEmpty(); $this->fields["is_helpdesk_visible"] = $CFG_GLPI["default_software_helpdesk_visible"]; } /** * @see CommonDBTM::getSpecificMassiveActions() **/ function getSpecificMassiveActions($checkitem=NULL) { $isadmin = static::canUpdate(); $actions = parent::getSpecificMassiveActions($checkitem); if ($isadmin && (countElementsInTable("glpi_rules", "sub_type='RuleSoftwareCategory'") > 0)) { $actions['compute_software_category'] = __('Recalculate the category'); } if (Session::haveRight("rule_dictionnary_software","w") && (countElementsInTable("glpi_rules", "sub_type='RuleDictionnarySoftware'") > 0)) { $actions['replay_dictionnary'] = __('Replay the dictionary rules'); } if (Session::haveRight('transfer','r') && Session::isMultiEntitiesMode() && $isadmin) { $actions['add_transfer_list'] = _x('button', 'Add to transfer list'); } return $actions; } /** * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "mergesoftware": if (isset($input["id"]) && isset($input["item"]) && is_array($input["item"]) && count($input["item"])) { if ($this->can($_POST["id"],'w')) { if ($this->merge($_POST["item"])) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } else { $res['ko']++; } break; case "compute_software_category" : $softcatrule = new RuleSoftwareCategoryCollection(); foreach ($input["item"] as $key => $val) { if ($val == 1) { $params = array(); //Get software name and manufacturer if ($this->can($key,'w')) { $params["name"] = $this->fields["name"]; $params["manufacturers_id"] = $this->fields["manufacturers_id"]; $params["comment"] = $this->fields["comment"]; $output = array(); $output = $softcatrule->processAllRules(null, $output, $params); //Process rules if (isset($output['softwarecategories_id']) && $this->update(array('id' => $key, 'softwarecategories_id' => $output['softwarecategories_id']))) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } } break; case "replay_dictionnary" : $softdictionnayrule = new RuleDictionnarySoftwareCollection(); $ids = array(); foreach ($input["item"] as $key => $val) { if ($val == 1) { if ($this->can($key,'w')) { $ids[] = $key; } else { $res['noright']++; } } } if ($softdictionnayrule->replayRulesOnExistingDB(0, 0, $ids)>0) { $res['ok'] += count($ids); } else { $res['ko'] += count($ids); } break; default : return parent::doSpecificMassiveActions($input); } return $res; } function getSearchOptions() { // Only use for History (not by search Engine) $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab+=Location::getSearchOptionsToAdd(); $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab[90]['table'] = $this->getTable(); $tab[90]['field'] = 'notepad'; $tab[90]['name'] = __('Notes'); $tab[90]['massiveaction'] = false; $tab[90]['datatype'] = 'text'; $tab[62]['table'] = 'glpi_softwarecategories'; $tab[62]['field'] = 'name'; $tab[62]['name'] = __('Category'); $tab[62]['datatype'] = 'dropdown'; $tab[19]['table'] = $this->getTable(); $tab[19]['field'] = 'date_mod'; $tab[19]['name'] = __('Last update'); $tab[19]['datatype'] = 'datetime'; $tab[19]['massiveaction'] = false; $tab[23]['table'] = 'glpi_manufacturers'; $tab[23]['field'] = 'name'; $tab[23]['name'] = __('Publisher'); $tab[23]['datatype'] = 'dropdown'; $tab[24]['table'] = 'glpi_users'; $tab[24]['field'] = 'name'; $tab[24]['linkfield'] = 'users_id_tech'; $tab[24]['name'] = __('Technician in charge of the hardware'); $tab[24]['datatype'] = 'dropdown'; $tab[24]['right'] = 'own_ticket'; $tab[49]['table'] = 'glpi_groups'; $tab[49]['field'] = 'completename'; $tab[49]['linkfield'] = 'groups_id_tech'; $tab[49]['name'] = __('Group in charge of the hardware'); $tab[49]['condition'] = '`is_assign`'; $tab[49]['datatype'] = 'dropdown'; $tab[70]['table'] = 'glpi_users'; $tab[70]['field'] = 'name'; $tab[70]['name'] = __('User'); $tab[70]['datatype'] = 'dropdown'; $tab[70]['right'] = 'all'; $tab[71]['table'] = 'glpi_groups'; $tab[71]['field'] = 'completename'; $tab[71]['name'] = __('Group'); $tab[71]['condition'] = '`is_itemgroup`'; $tab[71]['datatype'] = 'dropdown'; $tab[61]['table'] = $this->getTable(); $tab[61]['field'] = 'is_helpdesk_visible'; $tab[61]['name'] = __('Associable to a ticket'); $tab[61]['datatype'] = 'bool'; $tab[80]['table'] = 'glpi_entities'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = __('Entity'); $tab[80]['massiveaction'] = false; $tab[80]['datatype'] = 'dropdown'; $tab[72]['table'] = 'glpi_computers_softwareversions'; $tab[72]['field'] = 'count'; $tab[72]['name'] = __('Number of installations'); $tab[72]['forcegroupby'] = true; $tab[72]['usehaving'] = true; $tab[72]['datatype'] = 'number'; $tab[72]['nometa'] = true; $tab[72]['massiveaction'] = false; if (Session::getLoginUserID()) { $tab[72]['joinparams'] = array('jointype' => 'child', 'condition' => "AND NEWTABLE.`is_deleted_computer` = '0' AND NEWTABLE.`is_template_computer` = '0' ".getEntitiesRestrictRequest('AND', 'NEWTABLE'), 'beforejoin' => array('table' => 'glpi_softwareversions', 'joinparams' => array('jointype' => 'child'))); } $tab[86]['table'] = $this->getTable(); $tab[86]['field'] = 'is_recursive'; $tab[86]['name'] = __('Child entities'); $tab[86]['datatype'] = 'bool'; $tab[86]['massiveaction'] = false; $tab['versions'] = _n('Version', 'Versions',2); $tab[5]['table'] = 'glpi_softwareversions'; $tab[5]['field'] = 'name'; $tab[5]['name'] = __('Version name'); $tab[5]['forcegroupby'] = true; $tab[5]['massiveaction'] = false; $tab[5]['joinparams'] = array('jointype' => 'child'); $tab[5]['datatype'] = 'dropdown'; $tab[31]['table'] = 'glpi_states'; $tab[31]['field'] = 'completename'; $tab[31]['name'] = __('Status'); $tab[31]['datatype'] = 'dropdown'; $tab[31]['forcegroupby'] = true; $tab[31]['massiveaction'] = false; $tab[31]['joinparams'] = array('beforejoin' => array('table' => 'glpi_softwareversions', 'joinparams' => array('jointype' => 'child'))); $tab[170]['table'] = 'glpi_softwareversions'; $tab[170]['field'] = 'comment'; $tab[170]['name'] = __('Version comments'); $tab[170]['forcegroupby'] = true; $tab[170]['datatype'] = 'text'; $tab[170]['massiveaction'] = false; $tab[170]['joinparams'] = array('jointype' => 'child'); $tab[4]['table'] = 'glpi_operatingsystems'; $tab[4]['field'] = 'name'; $tab[4]['datatype'] = 'dropdown'; $tab[4]['name'] = __('Operating system'); $tab[4]['forcegroupby'] = true; $tab[4]['joinparams'] = array('beforejoin' => array('table' => 'glpi_softwareversions', 'joinparams' => array('jointype' => 'child'))); $tab['license'] = _n('License', 'Licenses', 2); $licjoin = array(); $licjoinexpire = array(); if (!Session::isCron()) { // no filter for cron $licjoin = array('jointype' => 'child', 'condition' => getEntitiesRestrictRequest(' AND', "NEWTABLE", '', '', true)); $licjoinexpire = array('jointype' => 'child', 'condition' => getEntitiesRestrictRequest(' AND', "NEWTABLE", '', '', true). " AND (NEWTABLE.`expire` IS NULL OR NEWTABLE.`expire` > NOW())"); } $tab[160]['table'] = 'glpi_softwarelicenses'; $tab[160]['field'] = 'name'; $tab[160]['name'] = __('License name'); $tab[160]['datatype'] = 'dropdown'; $tab[160]['forcegroupby'] = true; $tab[160]['massiveaction'] = false; $tab[160]['joinparams'] = $licjoinexpire; $tab[161]['table'] = 'glpi_softwarelicenses'; $tab[161]['field'] = 'serial'; $tab[161]['datatype'] = 'string'; $tab[161]['name'] = __('License serial number'); $tab[161]['forcegroupby'] = true; $tab[161]['massiveaction'] = false; $tab[161]['joinparams'] = $licjoinexpire; $tab[162]['table'] = 'glpi_softwarelicenses'; $tab[162]['field'] = 'otherserial'; $tab[162]['datatype'] = 'string'; $tab[162]['name'] = __('License inventory number'); $tab[162]['forcegroupby'] = true; $tab[162]['massiveaction'] = false; $tab[162]['joinparams'] = $licjoinexpire; $tab[163]['table'] = 'glpi_softwarelicenses'; $tab[163]['field'] = 'number'; $tab[163]['name'] = __('Number of licenses'); $tab[163]['forcegroupby'] = true; $tab[163]['usehaving'] = true; $tab[163]['datatype'] = 'number'; $tab[163]['massiveaction'] = false; $tab[163]['joinparams'] = $licjoinexpire; $tab[164]['table'] = 'glpi_softwarelicensetypes'; $tab[164]['field'] = 'name'; $tab[164]['datatype'] = 'dropdown'; $tab[164]['name'] = __('License types'); $tab[164]['forcegroupby'] = true; $tab[164]['massiveaction'] = false; $tab[164]['joinparams'] = array('beforejoin' => array('table' => 'glpi_softwarelicenses', 'joinparams' => $licjoinexpire)); $tab[165]['table'] = 'glpi_softwarelicenses'; $tab[165]['field'] = 'comment'; $tab[165]['name'] = __('License comments'); $tab[165]['forcegroupby'] = true; $tab[165]['datatype'] = 'text'; $tab[165]['massiveaction'] = false; $tab[165]['joinparams'] = $licjoinexpire; $tab[166]['table'] = 'glpi_softwarelicenses'; $tab[166]['field'] = 'expire'; $tab[166]['name'] = __('Expiration'); $tab[166]['forcegroupby'] = true; $tab[166]['datatype'] = 'date'; $tab[166]['massiveaction'] = false; $tab[166]['joinparams'] = $licjoinexpire; return $tab; } /** * Make a select box for software to install * * @param $myname select name * @param $entity_restrict restrict to a defined entity * @param $massiveaction is it a massiveaction select ? (default 0) * * @return nothing (print out an HTML select box) **/ static function dropdownSoftwareToInstall($myname, $entity_restrict, $massiveaction=0) { global $CFG_GLPI; $rand = mt_rand(); $use_ajax = false; if ($CFG_GLPI["use_ajax"]) { if (countElementsInTableForEntity("glpi_softwares", $entity_restrict) > $CFG_GLPI["ajax_limit_count"]) { $use_ajax = true; } } $params = array('searchText' => '__VALUE__', 'myname' => $myname, 'entity_restrict' => $entity_restrict); $default = ""; Ajax::dropdown($use_ajax, "/ajax/dropdownSelectSoftware.php", $params, $default, $rand); return $rand; } /** * Make a select box for license software to associate * * @param $myname select name * @param $entity_restrict restrict to a defined entity * @param $massiveaction is it a massiveaction select ? (default 0) * * @return nothing (print out an HTML select box) **/ static function dropdownLicenseToInstall($myname, $entity_restrict, $massiveaction=0) { global $CFG_GLPI; $rand = mt_rand(); $use_ajax = false; if ($CFG_GLPI["use_ajax"]) { if (countElementsInTableForEntity("glpi_softwarelicenses", $entity_restrict) > $CFG_GLPI["ajax_limit_count"]) { $use_ajax = true; } } $params = array('searchText' => '__VALUE__', 'myname' => $myname, 'entity_restrict' => $entity_restrict); $default = ""; Ajax::dropdown($use_ajax, "/ajax/dropdownSelectSoftwareLicense.php", $params, $default, $rand); return $rand; } /** * Create a new software * * @param name the software's name (need to be addslashes) * @param manufacturer_id id of the software's manufacturer * @param entity the entity in which the software must be added * @param comment (default '') * @param is_recursive boolean must the software be recursive (false by default) * @param is_helpdesk_visible show in helpdesk, default : from config (false by default) * * @return the software's ID **/ function addSoftware($name, $manufacturer_id, $entity, $comment='', $is_recursive=false, $is_helpdesk_visible=NULL) { global $DB, $CFG_GLPI; $input["name"] = $name; $input["manufacturers_id"] = $manufacturer_id; $input["entities_id"] = $entity; $input["is_recursive"] = ($is_recursive ? 1 : 0); // No comment if (is_null($is_helpdesk_visible)) { $input["is_helpdesk_visible"] = $CFG_GLPI["default_software_helpdesk_visible"]; } else { $input["is_helpdesk_visible"] = $is_helpdesk_visible; } //Process software's category rules $softcatrule = new RuleSoftwareCategoryCollection(); $result = $softcatrule->processAllRules(null, null, Toolbox::stripslashes_deep($input)); if (!empty($result) && isset($result["softwarecategories_id"])) { $input["softwarecategories_id"] = $result["softwarecategories_id"]; } else { $input["softwarecategories_id"] = 0; } return $this->add($input); } /** * Add a software. If already exist in dustbin restore it * * @param name the software's name * @param manufacturer the software's manufacturer * @param entity the entity in which the software must be added * @param comment comment (default '') * @param is_recursive boolean must the software be recursive (false by default) * @param is_helpdesk_visible show in helpdesk, default = config value (false by default) */ function addOrRestoreFromTrash($name, $manufacturer, $entity, $comment='', $is_recursive=false, $is_helpdesk_visible=NULL) { global $DB; //Look for the software by his name in GLPI for a specific entity $manufacturer_id = 0; if ($manufacturer != '') { $manufacturer_id = Dropdown::import('Manufacturer', array('name' => $manufacturer)); } $query_search = "SELECT `glpi_softwares`.`id`, `glpi_softwares`.`is_deleted` FROM `glpi_softwares` WHERE `name` = '$name' AND `manufacturers_id` = '$manufacturer_id' AND `is_template` = '0' ". getEntitiesRestrictRequest('AND', 'glpi_softwares', 'entities_id', $entity,true); $result_search = $DB->query($query_search); if ($DB->numrows($result_search) > 0) { //Software already exists for this entity, get his ID $data = $DB->fetch_assoc($result_search); $ID = $data["id"]; // restore software if ($data['is_deleted']) { $this->removeFromTrash($ID); } } else { $ID = 0; } if (!$ID) { $ID = $this->addSoftware($name, $manufacturer_id, $entity, $comment, $is_recursive, $is_helpdesk_visible); } return $ID; } /** * Put software in dustbin because it's been removed by GLPI software dictionnary * * @param $ID the ID of the software to put in dustbin * @param $comment the comment to add to the already existing software's comment (default '') * * @return boolean (success) **/ function putInTrash($ID, $comment='') { global $CFG_GLPI; $this->getFromDB($ID); $input["id"] = $ID; $input["is_deleted"] = 1; //change category of the software on deletion (if defined in glpi_configs) if (isset($CFG_GLPI["softwarecategories_id_ondelete"]) && ($CFG_GLPI["softwarecategories_id_ondelete"] != 0)) { $input["softwarecategories_id"] = $CFG_GLPI["softwarecategories_id_ondelete"]; } //Add dictionnary comment to the current comment $input["comment"] = (($this->fields["comment"] != '') ? "\n" : '') . $comment; return $this->update($input); } /** * Restore a software from dustbin * * @param $ID the ID of the software to put in dustbin * * @return boolean (success) **/ function removeFromTrash($ID) { $res = $this->restore(array("id" => $ID)); $softcatrule = new RuleSoftwareCategoryCollection(); $result = $softcatrule->processAllRules(null, null, $this->fields); if (!empty($result) && isset($result['softwarecategories_id']) && ($result['softwarecategories_id'] != $this->fields['softwarecategories_id'])) { $this->update(array('id' => $ID, 'softwarecategories_id' => $result['softwarecategories_id'])); } return $res; } /** * Show softwares candidates to be merged with the current * * @return nothing **/ function showMergeCandidates() { global $DB, $CFG_GLPI; $ID = $this->getField('id'); $this->check($ID,"w"); $rand = mt_rand(); echo "
    "; $sql = "SELECT `glpi_softwares`.`id`, `glpi_softwares`.`name`, `glpi_entities`.`completename` AS entity FROM `glpi_softwares` LEFT JOIN `glpi_entities` ON (`glpi_softwares`.`entities_id` = `glpi_entities`.`id`) WHERE (`glpi_softwares`.`id` != '$ID' AND `glpi_softwares`.`name` = '".addslashes($this->fields["name"])."' AND `glpi_softwares`.`is_deleted` = '0' AND `glpi_softwares`.`is_template` = '0' " . getEntitiesRestrictRequest('AND', 'glpi_softwares','entities_id', getSonsOf("glpi_entities", $this->fields["entities_id"]), false).") ORDER BY `entity`"; $req = $DB->request($sql); if ($nb = $req->numrows()) { $link = Toolbox::getItemTypeFormURL('Software'); Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $paramsma = array('num_displayed' => $nb, 'specific_actions' => array('mergesoftware' => __('Merge')) ); Html::showMassiveActions(__CLASS__, $paramsma); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; foreach ($req as $data) { echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; } echo "
    "; echo Html::checkAllAsCheckbox('mass'.__CLASS__.$rand); echo "".__('Name')."".__('Entity').""._n('Installation', 'Installations', 2).""._n('License', 'Licenses', 2)."
    ".Html::getMassiveActionCheckBox(__CLASS__, $data["id"])."".$data["name"]."".$data["entity"]."".Computer_SoftwareVersion::countForSoftware($data["id"])."".SoftwareLicense::countForSoftware($data["id"])."
    \n"; echo ""; $paramsma['ontop'] =false; Html::showMassiveActions(__CLASS__, $paramsma); Html::closeForm(); } else { _e('No item found'); } echo "
    "; } /** * Merge softwares with current * * @param $item array of software ID to be merged * * @return boolean about success **/ function merge($item) { global $DB; $ID = $this->getField('id'); echo "
    "; echo ""; echo "
    ".__('Merging')."
    "; Html::createProgressBar(__('Work in progress...')); echo "
    \n"; $item = array_keys($item); // Search for software version $req = $DB->request("glpi_softwareversions", array("softwares_id" => $item)); $i = 0; if ($nb = $req->numrows()) { foreach ($req as $from) { $found = false; foreach ($DB->request("glpi_softwareversions", array("softwares_id" => $ID, "name" => $from["name"])) as $dest) { // Update version ID on License $sql = "UPDATE `glpi_softwarelicenses` SET `softwareversions_id_buy` = '".$dest["id"]."' WHERE `softwareversions_id_buy` = '".$from["id"]."'"; $DB->query($sql); $sql = "UPDATE `glpi_softwarelicenses` SET `softwareversions_id_use` = '".$dest["id"]."' WHERE `softwareversions_id_use` = '".$from["id"]."'"; $DB->query($sql); // Move installation to existing version in destination software $sql = "UPDATE `glpi_computers_softwareversions` SET `softwareversions_id` = '".$dest["id"]."' WHERE `softwareversions_id` = '".$from["id"]."'"; $found = $DB->query($sql); } if ($found) { // Installation has be moved, delete the source version $sql = "DELETE FROM `glpi_softwareversions` WHERE `id` = '".$from["id"]."'"; } else { // Move version to destination software $sql = "UPDATE `glpi_softwareversions` SET `softwares_id` = '$ID', `entities_id` = '".$this->getField('entities_id')."' WHERE `id` = '".$from["id"]."'"; } if ($DB->query($sql)) { $i++; } Html::changeProgressBarPosition($i, $nb+1); } } // Move software license $sql = "UPDATE `glpi_softwarelicenses` SET `softwares_id` = '$ID' WHERE `softwares_id` IN ('".implode("','",$item)."')"; if ($DB->query($sql)) { $i++; } if ($i == ($nb+1)) { //error_log ("All merge operations ok."); $soft = new self(); foreach ($item as $old) { $soft->putInTrash($old, __('Software deleted after merging')); } } Html::changeProgressBarPosition($i, $nb+1, __('Task completed.')); return $i == ($nb+1); } } ?> glpi-0.84.3+dfsg.1/inc/softwarecategory.class.php000066400000000000000000000027251226600447100216050ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class SoftwareCategory class SoftwareCategory extends CommonDropdown { static function getTypeName($nb=0) { return _n('Software category','Software categories', $nb); } function cleanDBonPurge() { Rule::cleanForItemAction($this); } } ?> glpi-0.84.3+dfsg.1/inc/softwarelicense.class.php000066400000000000000000000700011226600447100214020ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// License class class SoftwareLicense extends CommonDBTM { // From CommonDBTM public $dohistory = true; static protected $forward_entity_to = array('Infocom'); static function getTypeName($nb=0) { return _n('License', 'Licenses', $nb); } static function canCreate() { return Session::haveRight('software', 'w'); } static function canView() { return Session::haveRight('software', 'r'); } function pre_updateInDB() { // Clean end alert if expire is after old one if (isset($this->oldvalues['expire']) && ($this->oldvalues['expire'] < $this->fields['expire'])) { $alert = new Alert(); $alert->clear($this->getType(), $this->fields['id'], Alert::END); } } function prepareInputForAdd($input) { // Unset to set to default using mysql default value if (empty($input['expire'])) { unset ($input['expire']); } return $input; } /** * @since version 0.84 **/ function cleanDBonPurge() { $csl = new Computer_SoftwareLicense(); $csl->cleanDBonItemDelete('SoftwareLicense', $this->fields['id']); $class = new Alert(); $class->cleanDBonItemDelete($this->getType(), $this->fields['id']); } function post_addItem() { global $CFG_GLPI; $itemtype = 'Software'; $dupid = $this->fields["softwares_id"]; if (isset($this->input["_duplicate_license"])) { $itemtype = 'SoftwareLicense'; $dupid = $this->input["_duplicate_license"]; } // Add infocoms if exists for the licence Infocom::cloneItem('Software', $dupid, $this->fields['id'], $this->getType()); } /** * @since version 0.84 * * @see CommonDBTM::getPreAdditionalInfosForName **/ function getPreAdditionalInfosForName() { $soft = new Software(); if ($soft->getFromDB($this->fields['softwares_id'])) { return $soft->getName(); } return ''; } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('Computer_SoftwareLicense', $ong, $options); $this->addStandardTab('Infocom', $ong, $options); $this->addStandardTab('Contract_Item', $ong, $options); $this->addStandardTab('Document_Item', $ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } /** * Print the Software / license form * * @param $ID integer Id of the version or the template to print * @param $options array of possible options: * - target form target * - softwares_id ID of the software for add process * * @return true if displayed false if item not found or not right to display **/ function showForm($ID, $options=array()) { global $CFG_GLPI; $softwares_id = -1; if (isset($options['softwares_id'])) { $softwares_id = $options['softwares_id']; } if (!Session::haveRight("software","w")) { return false; } if ($ID < 0) { // Create item $this->fields['softwares_id'] = $softwares_id; $this->fields['number'] = 1; $soft = new Software(); if ($soft->getFromDB($softwares_id) && in_array($_SESSION['glpiactive_entity'], getAncestorsOf('glpi_entities', $soft->getEntityID()))) { $options['entities_id'] = $soft->getEntityID(); } } $this->initForm($ID, $options); $this->showTabs($options); $this->showFormHeader($options); echo ""; echo "".Software::getTypeName(1).""; echo ""; if ($ID > 0) { $softwares_id = $this->fields["softwares_id"]; } else { echo ""; } echo "". Dropdown::getDropdownName("glpi_softwares", $softwares_id).""; echo ""; echo "".__('Type').""; echo ""; SoftwareLicenseType::dropdown(array('value' => $this->fields["softwarelicensetypes_id"])); echo "\n"; echo ""; echo "".__('Name').""; echo ""; Html::autocompletionTextField($this,"name"); echo ""; echo "".__('Serial number').""; echo ""; Html::autocompletionTextField($this,"serial"); echo "\n"; echo ""; echo "".__('Purchase version').""; echo ""; SoftwareVersion::dropdown(array('name' => "softwareversions_id_buy", 'softwares_id' => $this->fields["softwares_id"], 'value' => $this->fields["softwareversions_id_buy"])); echo ""; echo "".__('Inventory number').""; echo ""; Html::autocompletionTextField($this,"otherserial"); echo "\n"; echo ""; echo "".__('Version in use').""; echo ""; SoftwareVersion::dropdown(array('name' => "softwareversions_id_use", 'softwares_id' => $this->fields["softwares_id"], 'value' => $this->fields["softwareversions_id_use"])); echo ""; echo "".__('Comments').""; echo ""; echo ""; echo "\n"; echo ""; echo ""._x('quantity', 'Number').""; echo ""; Dropdown::showInteger("number", $this->fields["number"], 1, 1000, 1, array(-1 => __('Unlimited'))); echo "\n"; echo ""; echo "".__('Expiration').""; echo ""; Html::showDateFormItem('expire', $this->fields["expire"]); Alert::displayLastAlert('SoftwareLicense', $ID); echo "\n"; if ($ID > 0) { echo ""; echo "".__('Last update').""; echo "".($this->fields["date_mod"] ? Html::convDateTime($this->fields["date_mod"]) : __('Never')); echo ""; } $this->showFormButtons($options); $this->addDivForTabs(); return true; } /** * Is the license may be recursive * * @return boolean **/ function maybeRecursive () { $soft = new Software(); if (isset($this->fields["softwares_id"]) && $soft->getFromDB($this->fields["softwares_id"])) { return $soft->isRecursive(); } return false; } /** * @see CommonDBTM::getSpecificMassiveActions() **/ function getSpecificMassiveActions($checkitem=NULL) { $isadmin = static::canUpdate(); $actions = parent::getSpecificMassiveActions($checkitem); if (Session::haveRight('transfer','r') && Session::isMultiEntitiesMode() && $isadmin) { $actions['add_transfer_list'] = _x('button', 'Add to transfer list'); } return $actions; } function getSearchOptions() { // Only use for History (not by search Engine) $tab = array(); $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'name'; $tab[2]['name'] = __('Name'); $tab[2]['datatype'] = 'itemlink'; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'serial'; $tab[3]['name'] = __('Serial number'); $tab[3]['datatype'] = 'string'; $tab[162]['table'] = $this->getTable(); $tab[162]['field'] = 'otherserial'; $tab[162]['name'] = __('Inventory number'); $tab[162]['massiveaction'] = false; $tab[162]['datatype'] = 'string'; $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'number'; $tab[4]['name'] = _x('quantity', 'Number'); $tab[4]['datatype'] = 'number'; $tab[4]['max'] = 100; $tab[4]['toadd'] = array(-1 => __('Unlimited')); $tab[5]['table'] = 'glpi_softwarelicensetypes'; $tab[5]['field'] = 'name'; $tab[5]['name'] = __('Type'); $tab[5]['datatype'] = 'dropdown'; $tab[6]['table'] = 'glpi_softwareversions'; $tab[6]['field'] = 'name'; $tab[6]['linkfield'] = 'softwareversions_id_buy'; $tab[6]['name'] = __('Purchase version'); $tab[6]['datatype'] = 'dropdown'; $tab[6]['displaywith'] = array('states_id'); $tab[7]['table'] = 'glpi_softwareversions'; $tab[7]['field'] = 'name'; $tab[7]['linkfield'] = 'softwareversions_id_use'; $tab[7]['name'] = __('Version in use'); $tab[7]['datatype'] = 'dropdown'; $tab[7]['displaywith'] = array('states_id'); $tab[8]['table'] = $this->getTable(); $tab[8]['field'] = 'expire'; $tab[8]['name'] = __('Expiration'); $tab[8]['datatype'] = 'date'; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; return $tab; } /** * Give cron information * * @param $name : task's name * * @return arrray of information **/ static function cronInfo($name) { return array('description' => __('Send alarms on expired licenses')); } /** * Cron action on softwares : alert on expired licences * * @param $task to log, if NULL display (default NULL) * * @return 0 : nothing to do 1 : done with success **/ static function cronSoftware($task=NULL) { global $DB, $CFG_GLPI; $cron_status = 1; if (!$CFG_GLPI['use_mailing']) { return 0; } $message = array(); $items_notice = array(); $items_end = array(); foreach (Entity::getEntitiesToNotify('use_licenses_alert') as $entity => $value) { $before = Entity::getUsedConfig('send_licenses_alert_before_delay', $entity); // Check licenses $query = "SELECT `glpi_softwarelicenses`.*, `glpi_softwares`.`name` AS softname FROM `glpi_softwarelicenses` INNER JOIN `glpi_softwares` ON (`glpi_softwarelicenses`.`softwares_id` = `glpi_softwares`.`id`) LEFT JOIN `glpi_alerts` ON (`glpi_softwarelicenses`.`id` = `glpi_alerts`.`items_id` AND `glpi_alerts`.`itemtype` = 'SoftwareLicense' AND `glpi_alerts`.`type` = '".Alert::END."') WHERE `glpi_alerts`.`date` IS NULL AND `glpi_softwarelicenses`.`expire` IS NOT NULL AND DATEDIFF(`glpi_softwarelicenses`.`expire`, CURDATE()) < '$before' AND `glpi_softwares`.`is_template` = '0' AND `glpi_softwares`.`is_deleted` = '0' AND `glpi_softwares`.`entities_id` = '".$entity."'"; $message = ""; $items = array(); foreach ($DB->request($query) as $license) { $name = $license['softname'].' - '.$license['name'].' - '.$license['serial']; //TRANS: %1$s the license name, %2$s is the expiration date $message .= sprintf(__('License %1$s expired on %2$s'), Html::convDate($license["expire"]), $name)."
    \n"; $items[$license['id']] = $license; } if (!empty($items)) { $alert = new Alert(); $options['entities_id'] = $entity; $options['licenses'] = $items; if (NotificationEvent::raiseEvent('alert', new self(), $options)) { $entityname = Dropdown::getDropdownName("glpi_entities", $entity); if ($task) { //TRANS: %1$s is the entity, %2$s is the message $task->log(sprintf(__('%1$s: %2$s')."\n", $entityname, $message)); $task->addVolume(1); } else { Session::addMessageAfterRedirect(sprintf(__('%1$s: %2$s'), $entityname, $message)); } $input["type"] = Alert::END; $input["itemtype"] = 'SoftwareLicense'; // add alerts foreach ($items as $ID => $consumable) { $input["items_id"] = $ID; $alert->add($input); unset($alert->fields['id']); } } else { $entityname = Dropdown::getDropdownName('glpi_entities', $entity); //TRANS: %s is entity name $msg = sprintf(__('%1$s: %2$s'), $entityname, __('Send licenses alert failed')); if ($task) { $task->log($msg); } else { Session::addMessageAfterRedirect($msg, false, ERROR); } } } } return $cron_status; } /** * Get number of bought licenses of a version * * @param $softwareversions_id version ID * @param $entity to search for licenses in (default = all active entities) * (default '') * * @return number of installations */ static function countForVersion($softwareversions_id, $entity='') { global $DB; $query = "SELECT COUNT(*) FROM `glpi_softwarelicenses` WHERE `softwareversions_id_buy` = '$softwareversions_id' " . getEntitiesRestrictRequest('AND', 'glpi_softwarelicenses', '', $entity); $result = $DB->query($query); if ($DB->numrows($result) != 0) { return $DB->result($result, 0, 0); } return 0; } /** * Get number of licensesof a software * * @param $softwares_id software ID * * @return number of licenses **/ static function countForSoftware($softwares_id) { global $DB; $query = "SELECT `id` FROM `glpi_softwarelicenses` WHERE `softwares_id` = '$softwares_id' AND `number` = '-1' " . getEntitiesRestrictRequest('AND', 'glpi_softwarelicenses', '', '', true); $result = $DB->query($query); if ($DB->numrows($result)) { // At least 1 unlimited license, means unlimited return -1; } $query = "SELECT SUM(`number`) FROM `glpi_softwarelicenses` WHERE `softwares_id` = '$softwares_id' AND `number` > '0' " . getEntitiesRestrictRequest('AND', 'glpi_softwarelicenses', '', '', true); $result = $DB->query($query); $nb = $DB->result($result,0,0); return ($nb ? $nb : 0); } /** * Show Licenses of a software * * @param $software Software object * * @return nothing **/ static function showForSoftware(Software $software) { global $DB, $CFG_GLPI; $softwares_id = $software->getField('id'); $license = new self(); $computer = new Computer(); if (!$software->can($softwares_id,"r")) { return false; } if (isset($_POST["start"])) { $start = $_POST["start"]; } else { $start = 0; } if (isset($_POST["order"]) && ($_POST["order"] == "DESC")) { $order = "DESC"; } else { $order = "ASC"; } if (isset($_POST["sort"]) && !empty($_POST["sort"])) { $sort = "`".$_POST["sort"]."`"; } else { $sort = "`entity` $order, `name`"; } // Righ type is enough. Can add a License on a software we have Read access $canedit = Session::haveRight("software", "w"); $showmassiveactions = $canedit; // Total Number of events $number = countElementsInTable("glpi_softwarelicenses", "glpi_softwarelicenses.softwares_id = $softwares_id " . getEntitiesRestrictRequest('AND', 'glpi_softwarelicenses', '', '', true)); echo "
    "; Session::initNavigateListItems('SoftwareLicense', //TRANS : %1$s is the itemtype name, %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), Software::getTypeName(1), $software->getName())); if ($number < 1) { echo ""; echo "\n"; if ($canedit) { echo "\n"; } echo "
    ".__('No item found')."
    "; echo "". _sx('button', 'Add a license').""; echo "
    \n"; return; } // Display the pager Html::printAjaxPager(self::getTypeName(2), $start, $number); $rand = mt_rand(); $query = "SELECT `glpi_softwarelicenses`.*, `buyvers`.`name` AS buyname, `usevers`.`name` AS usename, `glpi_entities`.`completename` AS entity, `glpi_softwarelicensetypes`.`name` AS typename FROM `glpi_softwarelicenses` LEFT JOIN `glpi_softwareversions` AS buyvers ON (`buyvers`.`id` = `glpi_softwarelicenses`.`softwareversions_id_buy`) LEFT JOIN `glpi_softwareversions` AS usevers ON (`usevers`.`id` = `glpi_softwarelicenses`.`softwareversions_id_use`) LEFT JOIN `glpi_entities` ON (`glpi_entities`.`id` = `glpi_softwarelicenses`.`entities_id`) LEFT JOIN `glpi_softwarelicensetypes` ON (`glpi_softwarelicensetypes`.`id` = `glpi_softwarelicenses`.`softwarelicensetypes_id`) WHERE (`glpi_softwarelicenses`.`softwares_id` = '$softwares_id') " . getEntitiesRestrictRequest('AND', 'glpi_softwarelicenses', '', '', true) ." ORDER BY $sort $order LIMIT ".intval($start)."," . intval($_SESSION['glpilist_limit']); if ($result = $DB->query($query)) { if ($num_displayed = $DB->numrows($result)) { if ($showmassiveactions) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $massiveactionparams = array('num_displayed' => $num_displayed, 'extraparams' => array('options' => array('condition' => "`glpi_softwareversions`.`softwares_id` = $softwares_id"))); Html::showMassiveActions(__CLASS__, $massiveactionparams); } $sort_img = ""; echo ""; echo ""; echo ""; if ($software->isRecursive()) { // Ereg to search entity in string for match default order echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $tot_assoc = 0; for ($tot=0 ; $data=$DB->fetch_assoc($result) ; ) { Session::addToNavigateListItems('SoftwareLicense', $data['id']); $expired = true; if (is_null($data['expire']) || ($data['expire'] > date('Y-m-d'))) { $expired = false; } echo ""; if ($license->can($data['id'], "w")) { echo ""; } else { echo ""; } echo ""; if ($software->isRecursive()) { echo ""; } echo ""; echo ""; $nb_assoc = Computer_SoftwareLicense::countForLicense($data['id']); $tot_assoc += $nb_assoc; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if ($data['number'] < 0) { // One illimited license, total is illimited $tot = -1; } else if ($tot >= 0) { // Expire license not count if (!$expired) { // Not illimited, add the current number $tot += $data['number']; } } } echo ""; echo ""; echo ""; echo ""; echo ""; echo "
    "; Html::checkAllAsCheckbox('mass'.__CLASS__.$rand); echo "".(($sort == "`name`") ?$sort_img:""). "".__('Name')."".(strstr($sort,"entity")?$sort_img:""). "".__('Entity')."".(( $sort== "`serial`") ?$sort_img:""). "".__('Serial number'). "".(($sort == "`number`") ?$sort_img:""). ""._x('quantity', 'Number'). "".__('Affected computers')."".(($sort == "`typename`") ?$sort_img:""). "".__('Type')."".(($sort == "`buyname`") ?$sort_img:""). "".__('Purchase version'). "".(($sort == "`usename`") ?$sort_img:""). "".__('Version in use'). "".(($sort == "`expire`") ?$sort_img:""). "".__('Expiration'). "
    ".Html::getMassiveActionCheckBox(__CLASS__, $data["id"])." ".$data['name']. (empty($data['name']) ?"(".$data['id'].")" :"")."".$data['entity']."".$data['serial']."". (($data['number'] > 0) ?$data['number']:__('Unlimited'))."".$nb_assoc."".$data['typename']."".$data['buyname']."".$data['usename']."".Html::convDate($data['expire'])."
    ".__('Total')."".(($tot > 0)?$tot."":__('Unlimited')). "".$tot_assoc.""; if ($canedit) { echo "". _sx('button', 'Add a license').""; } echo "
    \n"; if ($showmassiveactions) { $massiveactionparams['ontop'] = false; Html::showMassiveActions(__CLASS__, $massiveactionparams); Html::closeForm(); } } else { _e('No item found'); } } Html::printAjaxPager(self::getTypeName(2), $start, $number); echo "
    "; } /** * Display debug information for current object **/ function showDebug() { $license = array('softname' => '', 'name' => '', 'serial' => '', 'expire' => ''); $options['entities_id'] = $this->getEntityID(); $options['licenses'] = array($license); NotificationEvent::debugEvent($this, $options); } /** * Get fields to display in the unicity error message * * @return an array which contains field => label */ function getUnicityFieldsToDisplayInErrorMessage() { return array('id' => __('ID'), 'serial' => __('Serial number'), 'entities_id' => __('Entity'), 'softwares_id' => _n('Software', 'Software', 1)); } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { switch ($item->getType()) { case 'Software' : if ($_SESSION['glpishow_count_on_tabs']) { $count = self::countForSoftware($item->getID()); return self::createTabEntry(self::getTypeName(2), (($count >= 0) ? $count : '∞')); } return self::getTypeName(2); } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType()=='Software') { self::showForSoftware($item); } return true; } } ?> glpi-0.84.3+dfsg.1/inc/softwarelicensetype.class.php000066400000000000000000000026071226600447100223130ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class SoftwareLicenseType class SoftwareLicenseType extends CommonDropdown { static function getTypeName($nb=0) { return _n('License type', 'License types', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/softwareversion.class.php000066400000000000000000000252201226600447100214500ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Version class class SoftwareVersion extends CommonDBChild { // From CommonDBTM public $dohistory = true; // From CommonDBChild static public $itemtype = 'Software'; static public $items_id = 'softwares_id'; static function getTypeName($nb=0) { return _n('Version', 'Versions', $nb); } function cleanDBonPurge() { global $DB; $csv = new Computer_SoftwareVersion(); $csv->cleanDBonItemDelete(__CLASS__, $this->fields['id']); } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('Computer_SoftwareVersion',$ong, $options); $this->addStandardTab('Log',$ong, $options); return $ong; } /** * @since version 0.84 * * @see CommonDBTM::getPreAdditionalInfosForName **/ function getPreAdditionalInfosForName() { $soft = new Software(); if ($soft->getFromDB($this->fields['softwares_id'])) { return $soft->getName(); } return ''; } /** * Print the Software / version form * * @param $ID integer Id of the version or the template to print * @param $options array of possible options: * - target form target * - softwares_id ID of the software for add process * * @return true if displayed false if item not found or not right to display * **/ function showForm($ID, $options=array()) { global $CFG_GLPI; if (!Session::haveRight("software","r")) { return false; } if ($ID > 0) { $this->check($ID,'r'); $softwares_id = $this->fields['softwares_id']; } else { $softwares_id = $options['softwares_id']; $this->check(-1, 'w', $options); } $this->showTabs($options); $this->showFormHeader($options); echo ""._n('Software', 'Software', 2).""; echo ""; if ($this->isNewID($ID)) { echo ""; } echo "". Dropdown::getDropdownName("glpi_softwares", $softwares_id).""; echo ""; echo "".__('Comments').""; echo ""; echo "\n"; echo "".__('Name').""; echo ""; Html::autocompletionTextField($this,"name"); echo "\n"; echo "" . __('Operating system') . ""; OperatingSystem::dropdown(array('value' => $this->fields["operatingsystems_id"])); echo "\n"; echo "" . __('Status') . ""; State::dropdown(array('value' => $this->fields["states_id"])); echo "\n"; // Only count softwareversions_id_buy (don't care of softwareversions_id_use if no installation) if ((SoftwareLicense::countForVersion($ID) > 0) || (Computer_SoftwareVersion::countForVersion($ID) > 0)) { $options['candel'] = false; } $this->showFormButtons($options); $this->addDivForTabs(); return true; } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'name'; $tab[2]['name'] = __('Name'); $tab[2]['datatype'] = 'string'; $tab[4]['table'] = 'glpi_operatingsystems'; $tab[4]['field'] = 'name'; $tab[4]['name'] = __('Operating system'); $tab[4]['datatype'] = 'dropdown'; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab[31]['table'] = 'glpi_states'; $tab[31]['field'] = 'completename'; $tab[31]['name'] = __('Status'); $tab[31]['datatype'] = 'dropdown'; return $tab; } /** * Make a select box for software to install * * @param $options array of possible options: * - name : string / name of the select (default is softwareversions_id) * - softwares_id : integer / ID of the software * - value : integer / value of the selected version * - used : array / already used items * * @return nothing (print out an HTML select box) **/ static function dropdown($options=array()) { global $CFG_GLPI; //$softwares_id,$value=0 $p['softwares_id'] = 0; $p['value'] = 0; $p['name'] = 'softwareversions_id'; $p['used'] = array(); if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } $rand = mt_rand(); $params = array('softwares_id' => $p['softwares_id'], 'myname' => $p['name'], 'value' => $p['value'], 'used' => $p['used']); $default = ""; Ajax::dropdown(false,"/ajax/dropdownInstallVersion.php", $params, $default, $rand); return $rand; } /** * Show Versions of a software * * @param $soft Software object * * @return nothing **/ static function showForSoftware(Software $soft) { global $DB, $CFG_GLPI; $softwares_id = $soft->getField('id'); if (!$soft->can($softwares_id,'r')) { return false; } $canedit = $soft->can($softwares_id,"w"); echo "
    "; $query = "SELECT `glpi_softwareversions`.*, `glpi_states`.`name` AS sname FROM `glpi_softwareversions` LEFT JOIN `glpi_states` ON (`glpi_states`.`id` = `glpi_softwareversions`.`states_id`) WHERE `softwares_id` = '$softwares_id' ORDER BY `name`"; Session::initNavigateListItems('SoftwareVersion', //TRANS : %1$s is the itemtype name, // %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), Software::getTypeName(1), $soft->getName())); if ($result = $DB->query($query)) { if ($DB->numrows($result)) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; for ($tot=$nb=0 ; $data=$DB->fetch_assoc($result) ; $tot+=$nb) { Session::addToNavigateListItems('SoftwareVersion',$data['id']); $nb = Computer_SoftwareVersion::countForVersion($data['id']); echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; } echo ""; echo ""; echo "
    ".self::getTypeName(2)."".__('Status')."".__('Operating system').""._n('Installation', 'Installations', 2)."".__('Comments')."
    "; echo $data['name'].(empty($data['name'])?"(".$data['id'].")":"")."".$data['sname']."".Dropdown::getDropdownName('glpi_operatingsystems', $data['operatingsystems_id']); echo "$nb".$data['comment']."
    ".__('Total')."$tot"; if ($canedit) { echo "". _x('button', 'Add a version').""; } echo "
    \n"; } else { echo ""; echo ""; if ($canedit) { echo ""; } echo "
    ".__('No item found')."
    "; echo "". _x('button', 'Add a version')."
    \n"; } } echo "
    "; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { switch ($item->getType()) { case 'Software' : if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(self::getTypeName(2), countElementsInTable($this->getTable(), "softwares_id = '".$item->getID()."'")); } return self::getTypeName(2); } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType() == 'Software') { self::showForSoftware($item); } return true; } } ?> glpi-0.84.3+dfsg.1/inc/solutiontemplate.class.php000066400000000000000000000062771226600447100216330ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class SolutionTemplate class SolutionTemplate extends CommonDropdown { // From CommonDBTM public $dohistory = true; static function getTypeName($nb=0) { return _n('Solution template', 'Solution templates', $nb); } static function canCreate() { return Session::haveRight('entity_dropdown', 'w'); } static function canView() { return Session::haveRight('entity_dropdown', 'r'); } function getAdditionalFields() { return array(array('name' => 'solutiontypes_id', 'label' => __('Solution type'), 'type' => 'dropdownValue', 'list' => true), array('name' => 'content', 'label' => __('Content'), 'type' => 'tinymce')); } /** * @since version 0.83 **/ function getSearchOptions() { $tab = parent::getSearchOptions(); $tab[4]['name'] = __('Content'); $tab[4]['field'] = 'content'; $tab[4]['table'] = $this->getTable(); $tab[4]['datatype'] = 'text'; $tab[4]['htmltext'] = true; $tab[3]['name'] = __('Solution type'); $tab[3]['field'] = 'name'; $tab[3]['table'] = getTableForItemType('SolutionType'); $tab[3]['datatype'] = 'dropdown'; return $tab; } /** * @see CommonDropdown::displaySpecificTypeField() **/ function displaySpecificTypeField($ID, $field=array()) { switch ($field['type']) { case 'tinymce' : // Display empty field echo " "; // And a new line to have a complete display echo ""; $rand = mt_rand(); Html::initEditorSystem($field['name'].$rand); echo ""; break; } } } ?>glpi-0.84.3+dfsg.1/inc/solutiontype.class.php000066400000000000000000000025641226600447100207740ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// SolutionType class class SolutionType extends CommonDropdown { static function getTypeName($nb=0) { return _n('Solution type', 'Solution types', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/ssovariable.class.php000066400000000000000000000032311226600447100205200ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * @since version 0.84 **/ class SsoVariable extends CommonDropdown { var $refresh_page = true; static function canCreate() { return Session::haveRight('config', 'w'); } static function canView() { return Session::haveRight('config', 'r'); } static function getTypeName($nb=0) { return _n('Field storage of the login in the HTTP request', 'Fields storage of the login in the HTTP request', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/stat.class.php000066400000000000000000002004221226600447100171620ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Stat class **/ class Stat { /** * @param $itemtype * @param $date1 * @param $date2 * @param $type * @param $parent (default 0) **/ static function getItems($itemtype, $date1, $date2, $type, $parent=0) { global $CFG_GLPI, $DB; if (!$item = getItemForItemtype($itemtype)) { return; } $val = array(); $cond = ''; switch ($type) { case "technicien" : $val = $item->getUsedTechBetween($date1, $date2); break; case "technicien_followup" : $val = $item->getUsedTechTaskBetween($date1, $date2); break; case "suppliers_id_assign" : $val = $item->getUsedSupplierBetween($date1, $date2); break; case "user" : $val = $item->getUsedAuthorBetween($date1, $date2); break; case "users_id_recipient" : $val = $item->getUsedRecipientBetween($date1, $date2); break; case 'group_tree' : case 'groups_tree_assign' : // Get all groups $query = "SELECT `id`, `name` FROM `glpi_groups`". getEntitiesRestrictRequest(" WHERE", "glpi_groups", '', '', true)." AND (`id` = $parent OR `groups_id` = '$parent') AND ".(($type == 'group_tree') ? '`is_requester`' : '`is_assign`')." ORDER BY `completename`"; $result = $DB->query($query); $val = array(); if ($DB->numrows($result) >= 1) { while ($line = $DB->fetch_assoc($result)) { $tmp['id'] = $line["id"]; $tmp['link'] = $line["name"]; $val[] = $tmp; } } break; case "itilcategories_tree" : $cond = "AND (`id` = '$parent' OR `itilcategories_id` = '$parent')"; // nobreak case "itilcategories_id" : // Get all ticket categories for tree merge management $query = "SELECT DISTINCT `glpi_itilcategories`.`id`, `glpi_itilcategories`.`".($cond?'name':'completename')."` AS category FROM `glpi_itilcategories`". getEntitiesRestrictRequest(" WHERE", "glpi_itilcategories", '', '', true)." $cond ORDER BY `completename`"; $result = $DB->query($query); $val = array(); if ($DB->numrows($result) >= 1) { while ($line = $DB->fetch_assoc($result)) { $tmp['id'] = $line["id"]; $tmp['link'] = $line["category"]; $val[] = $tmp; } } break; case 'locations_tree' : $cond = "AND (`id` = '$parent' OR `locations_id` = '$parent')"; // nobreak case 'locations_id' : // Get all locations for tree merge management $query = "SELECT DISTINCT `glpi_locations`.`id`, `glpi_locations`.`".($cond?'name':'completename')."` AS location FROM `glpi_locations`". getEntitiesRestrictRequest(' WHERE', 'glpi_locations', '', '', true)." $cond ORDER BY `completename`"; $result = $DB->query($query); $val = array(); if ($DB->numrows($result) >= 1) { while ($line = $DB->fetch_assoc($result)) { $tmp['id'] = $line['id']; $tmp['link'] = $line['location']; $val[] = $tmp; } } break; case "type" : $types = $item->getTypes(); $val = array(); foreach ($types as $id => $v) { $tmp['id'] = $id; $tmp['link'] = $v; $val[] = $tmp; } break; case "group" : $val = $item->getUsedGroupBetween($date1, $date2); break; case "groups_id_assign" : $val = $item->getUsedAssignGroupBetween($date1, $date2); break; case "priority" : $val = $item->getUsedPriorityBetween($date1, $date2); break; case "urgency" : $val = $item->getUsedUrgencyBetween($date1, $date2); break; case "impact" : $val = $item->getUsedImpactBetween($date1, $date2); break; case "requesttypes_id" : $val = $item->getUsedRequestTypeBetween($date1, $date2); break; case "solutiontypes_id" : $val = $item->getUsedSolutionTypeBetween($date1, $date2); break; case "usertitles_id" : $val = $item->getUsedUserTitleOrTypeBetween($date1, $date2, true); break; case "usercategories_id" : $val = $item->getUsedUserTitleOrTypeBetween($date1, $date2, false); break; // DEVICE CASE default : if (($item = getItemForItemtype($type)) && ($item instanceof CommonDevice)) { $device_table = $item->getTable(); //select devices IDs (table row) $query = "SELECT `id`, `designation` FROM `".$device_table."` ORDER BY `designation`"; $result = $DB->query($query); if ($DB->numrows($result) >= 1) { $i = 0; while ($line = $DB->fetch_assoc($result)) { $val[$i]['id'] = $line['id']; $val[$i]['link'] = $line['designation']; $i++; } } } else { // Dropdown case for computers $field = "name"; $table = getTableFOrItemType($type); if (($item = getItemForItemtype($type)) && ($item instanceof CommonTreeDropdown)) { $field = "completename"; } $where = ''; $order = " ORDER BY `$field`"; if ($item->isEntityAssign()) { $where = getEntitiesRestrictRequest(" WHERE",$table); $order = " ORDER BY `entities_id`, `$field`"; } $query = "SELECT * FROM `$table` $where $order"; $val = array(); $result = $DB->query($query); if ($DB->numrows($result) > 0) { while ($line = $DB->fetch_assoc($result)) { $tmp['id'] = $line["id"]; $tmp['link'] = $line[$field]; $val[] = $tmp; } } } } return $val; } /** * @param $itemtype * @param $type * @param $date1 * @param $date2 * @param $start * @param $value array * @param $value2 (default '') **/ static function getDatas($itemtype, $type, $date1, $date2, $start, array $value, $value2="") { $export_data = array(); if (is_array($value)) { $end_display = $start+$_SESSION['glpilist_limit']; $numrows = count($value); for ($i=$start ; $i< $numrows && $i<($end_display) ; $i++) { //le nombre d'intervention - the number of intervention $opened = self::constructEntryValues($itemtype, "inter_total", $date1, $date2, $type, $value[$i]["id"], $value2); $nb_opened = array_sum($opened); $export_data['opened'][$value[$i]['link']] = $nb_opened; //le nombre d'intervention resolues - the number of solved intervention $solved = self::constructEntryValues($itemtype, "inter_solved", $date1, $date2, $type, $value[$i]["id"], $value2); $nb_solved = array_sum($solved); $export_data['solved'][$value[$i]['link']] = $nb_solved; //le nombre d'intervention resolues - the number of solved late intervention $late = self::constructEntryValues($itemtype, "inter_solved_late", $date1, $date2, $type, $value[$i]["id"], $value2); $nb_late = array_sum($late); $export_data['late'][$value[$i]['link']] = $nb_late; //le nombre d'intervention closes - the number of closed intervention $closed = self::constructEntryValues($itemtype, "inter_closed", $date1, $date2, $type, $value[$i]["id"], $value2); $nb_closed = array_sum($closed); $export_data['closed'][$value[$i]['link']] = $nb_closed; if ($itemtype == 'Ticket') { //open satisfaction $opensatisfaction = self::constructEntryValues($itemtype, "inter_opensatisfaction", $date1, $date2, $type, $value[$i]["id"], $value2); $nb_opensatisfaction = array_sum($opensatisfaction); $export_data['opensatisfaction'][$value[$i]['link']] = $nb_opensatisfaction; } //answer satisfaction // $answersatisfaction = self::constructEntryValues("inter_answersatisfaction", // $date1, $date2, $type, // $value[$i]["id"], $value2); // $nb_answersatisfaction = array_sum($answersatisfaction); // $export_data['opensatisfaction'][$value[$i]['link']] = $nb_answersatisfaction; } } return $export_data; } /** * @param $itemtype * @param $type * @param $date1 * @param $date2 * @param $start * @param $value array * @param $value2 (default '') **/ static function show($itemtype, $type, $date1, $date2, $start, array $value, $value2="") { global $CFG_GLPI; // Set display type for export if define $output_type = Search::HTML_OUTPUT; if (isset($_GET["display_type"])) { $output_type = $_GET["display_type"]; } if ($output_type == Search::HTML_OUTPUT) { // HTML display echo "
    "; } if (is_array($value)) { $end_display = $start+$_SESSION['glpilist_limit']; $numrows = count($value); if (isset($_GET['export_all'])) { $start = 0; $end_display = $numrows; } $nbcols = 8; if ($output_type != Search::HTML_OUTPUT) { // not HTML display $nbcols--; } echo Search::showHeader($output_type, $end_display-$start+1, $nbcols); $subname = ''; switch ($type) { case 'group_tree' : case 'groups_tree_assign' : $subname = Dropdown::getDropdownName('glpi_groups', $value2); break; case 'itilcategories_tree' : $subname = Dropdown::getDropdownName('glpi_itilcategories', $value2); break; case 'locations_tree' : $subname = Dropdown::getDropdownName('glpi_locations', $value2); break; } if ($output_type == Search::HTML_OUTPUT) { // HTML display echo Search::showNewLine($output_type); $header_num = 1; if (($output_type == Search::HTML_OUTPUT) && strstr($type, '_tree') && $value2) { // HTML display $link = $_SERVER['PHP_SELF']. "?date1=$date1&date2=$date2&itemtype=$itemtype&type=$type". "&value2=0"; $link = "".__('Back').""; echo Search::showHeaderItem($output_type, $link, $header_num); } else { echo Search::showHeaderItem($output_type, " ", $header_num); } echo Search::showHeaderItem($output_type, '', $header_num); echo Search::showHeaderItem($output_type, _x('quantity', 'Number'), $header_num, '', 0, '', "colspan='4'"); if ($itemtype =='Ticket') { echo Search::showHeaderItem($output_type, __('Satisfaction'), $header_num, '', 0, '', "colspan='3'"); } echo Search::showHeaderItem($output_type, __('Average time'), $header_num, '', 0, '', $itemtype =='Ticket'?"colspan='3'":"colspan='2'"); echo Search::showHeaderItem($output_type, __('Real duration of treatment of the ticket'), $header_num, '', 0, '', "colspan='2'"); } echo Search::showNewLine($output_type); $header_num = 1; echo Search::showHeaderItem($output_type, $subname, $header_num); if ($output_type == Search::HTML_OUTPUT) { // HTML display echo Search::showHeaderItem($output_type, "", $header_num); } if ($output_type != Search::HTML_OUTPUT) { echo Search::showHeaderItem($output_type, __('Number of opened tickets'), $header_num); echo Search::showHeaderItem($output_type, __('Number of solved tickets'), $header_num); echo Search::showHeaderItem($output_type, __('Number of late tickets'), $header_num); echo Search::showHeaderItem($output_type, __('Number of closed tickets'), $header_num); } else { echo Search::showHeaderItem($output_type, __('Opened'), $header_num); echo Search::showHeaderItem($output_type, __('Solved'), $header_num); echo Search::showHeaderItem($output_type, __('Late'), $header_num); echo Search::showHeaderItem($output_type, __('Closed'), $header_num); } if ($itemtype =='Ticket') { if ($output_type != Search::HTML_OUTPUT) { echo Search::showHeaderItem($output_type, __('Number of opened satisfaction survey'), $header_num); echo Search::showHeaderItem($output_type, __('Number of answered satisfaction survey'), $header_num); echo Search::showHeaderItem($output_type, __('Average satisfaction'), $header_num); } else { echo Search::showHeaderItem($output_type, __('Opened'), $header_num); echo Search::showHeaderItem($output_type, __('Answered'), $header_num); echo Search::showHeaderItem($output_type, __('Average'), $header_num); } } if ($output_type != Search::HTML_OUTPUT) { if ($itemtype =='Ticket') { echo Search::showHeaderItem($output_type, __('Average time to take into account'), $header_num); } echo Search::showHeaderItem($output_type, __('Average time to resolution'), $header_num); echo Search::showHeaderItem($output_type, __('Average time to closure'), $header_num); } else { if ($itemtype =='Ticket') { echo Search::showHeaderItem($output_type, __('Take into account'), $header_num); } echo Search::showHeaderItem($output_type, __('Resolution'), $header_num); echo Search::showHeaderItem($output_type, __('Closure'), $header_num); } if ($output_type != Search::HTML_OUTPUT) { echo Search::showHeaderItem($output_type, __('Average real duration of treatment of the ticket'), $header_num); echo Search::showHeaderItem($output_type, __('Total real duration of treatment of the ticket'), $header_num); } else { echo Search::showHeaderItem($output_type, __('Average'), $header_num); echo Search::showHeaderItem($output_type, __('Total'), $header_num); } // End Line for column headers echo Search::showEndLine($output_type); $row_num = 1; for ($i=$start ; ($i<$numrows) && ($i<$end_display) ; $i++) { $row_num ++; $item_num = 1; echo Search::showNewLine($output_type, $i%2); if (($output_type == Search::HTML_OUTPUT) && strstr($type, '_tree') && ($value[$i]['id'] != $value2)) { // HTML display $link = $_SERVER['PHP_SELF']. "?date1=$date1&date2=$date2&itemtype=$itemtype&type=$type". "&value2=".$value[$i]['id']; $link = "".$value[$i]['link'].""; echo Search::showItem($output_type, $link, $item_num, $row_num); } else { echo Search::showItem($output_type, $value[$i]['link'], $item_num, $row_num); } if ($output_type == Search::HTML_OUTPUT) { // HTML display $link = ""; if ($value[$i]['id'] > 0) { $link = "". "". ""; } echo Search::showItem($output_type, $link, $item_num, $row_num); } //le nombre d'intervention - the number of intervention $opened = self::constructEntryValues($itemtype, "inter_total", $date1, $date2, $type, $value[$i]["id"], $value2); $nb_opened = array_sum($opened); echo Search::showItem($output_type, $nb_opened, $item_num, $row_num); //le nombre d'intervention resolues - the number of solved intervention $solved = self::constructEntryValues($itemtype, "inter_solved", $date1, $date2, $type, $value[$i]["id"], $value2); $nb_solved = array_sum($solved); // if (($nb_opened > 0) // && ($nb_solved > 0)) { // //TRANS: %2$d is the percentage. %% to display % // $nb_solved = sprintf(__('%1$s (%2$d%%)'), $nb_solved, // round($nb_solved*100/$nb_opened)); // } echo Search::showItem($output_type, $nb_solved, $item_num, $row_num); //le nombre d'intervention resolues - the number of solved intervention $solved_late = self::constructEntryValues($itemtype, "inter_solved_late", $date1, $date2, $type, $value[$i]["id"], $value2); $nb_solved_late = array_sum($solved_late); // if (($nb_solved > 0) // && ($nb_solved_late > 0)) { // $nb_solved_late = sprintf(__('%1$s (%2$d%%)'), $nb_solved_late, // round($nb_solved_late*100/$nb_solved)); // } echo Search::showItem($output_type, $nb_solved_late, $item_num, $row_num); //le nombre d'intervention closes - the number of closed intervention $closed = self::constructEntryValues($itemtype, "inter_closed", $date1, $date2, $type, $value[$i]["id"], $value2); $nb_closed = array_sum($closed); // if (($nb_opened > 0) // && ($nb_closed > 0)) { // $nb_closed = sprintf(__('%1$s (%2$d%%)'), $nb_closed, // round($nb_closed*100/$nb_opened)); // } echo Search::showItem($output_type, $nb_closed, $item_num, $row_num); if ($itemtype =='Ticket') { //Satisfaction open $opensatisfaction = self::constructEntryValues($itemtype, "inter_opensatisfaction", $date1, $date2, $type, $value[$i]["id"], $value2); $nb_opensatisfaction = array_sum($opensatisfaction); // if ($nb_opensatisfaction > 0) { // $nb_opensatisfaction = sprintf(__('%1$s (%2$d%%)'), $nb_opensatisfaction, // round($nb_opensatisfaction*100/$nb_closed)); // } echo Search::showItem($output_type, $nb_opensatisfaction, $item_num, $row_num); //Satisfaction answer $answersatisfaction = self::constructEntryValues($itemtype, "inter_answersatisfaction", $date1, $date2, $type, $value[$i]["id"], $value2); $nb_answersatisfaction = array_sum($answersatisfaction); // if ($nb_answersatisfaction > 0) { // $nb_answersatisfaction = sprintf(__('%1$s (%2$d%%)'), $nb_answersatisfaction, // round($nb_answersatisfaction*100/$nb_opensatisfaction)); // } echo Search::showItem($output_type, $nb_answersatisfaction, $item_num, $row_num); //Satisfaction rate $satisfaction = self::constructEntryValues($itemtype, "inter_avgsatisfaction", $date1, $date2, $type, $value[$i]["id"], $value2); foreach ($satisfaction as $key2 => $val2) { $satisfaction[$key2] *= $answersatisfaction[$key2]; } if ($nb_answersatisfaction > 0) { $avgsatisfaction = round(array_sum($satisfaction)/$nb_answersatisfaction,1); $avgsatisfaction = TicketSatisfaction::displaySatisfaction($avgsatisfaction); } else { $avgsatisfaction = ' '; } echo Search::showItem($output_type, $avgsatisfaction, $item_num, $row_num); //Le temps moyen de prise en compte du ticket - The average time to take a ticket into account $data = self::constructEntryValues($itemtype, "inter_avgtakeaccount", $date1, $date2, $type, $value[$i]["id"], $value2); foreach ($data as $key2 => $val2) { $data[$key2] *= $solved[$key2]; } if ($nb_solved > 0) { $timedisplay = array_sum($data)/$nb_solved; } else { $timedisplay = 0; } if (($output_type == Search::HTML_OUTPUT) || ($output_type == Search::PDF_OUTPUT_LANDSCAPE) || ($output_type == Search::PDF_OUTPUT_PORTRAIT)) { $timedisplay = Html::timestampToString($timedisplay, 0, false); } echo Search::showItem($output_type, $timedisplay, $item_num, $row_num); } //Le temps moyen de resolution - The average time to resolv $data = self::constructEntryValues($itemtype, "inter_avgsolvedtime", $date1, $date2, $type, $value[$i]["id"], $value2); foreach ($data as $key2 => $val2) { $data[$key2] = round($data[$key2]*$solved[$key2]); } if ($nb_solved > 0) { $timedisplay = array_sum($data)/$nb_solved; } else { $timedisplay = 0; } if (($output_type == Search::HTML_OUTPUT) || ($output_type == Search::PDF_OUTPUT_LANDSCAPE) || ($output_type == Search::PDF_OUTPUT_PORTRAIT)) { $timedisplay = Html::timestampToString($timedisplay, 0, false); } echo Search::showItem($output_type, $timedisplay, $item_num, $row_num); //Le temps moyen de cloture - The average time to close $data = self::constructEntryValues($itemtype, "inter_avgclosedtime", $date1, $date2, $type, $value[$i]["id"], $value2); foreach ($data as $key2 => $val2) { $data[$key2] = round($data[$key2]*$solved[$key2]); } if ($nb_closed > 0) { $timedisplay = array_sum($data)/$nb_closed; } else { $timedisplay = 0; } if (($output_type == Search::HTML_OUTPUT) || ($output_type == Search::PDF_OUTPUT_LANDSCAPE) || ($output_type == Search::PDF_OUTPUT_PORTRAIT)) { $timedisplay = Html::timestampToString($timedisplay, 0, false); } echo Search::showItem($output_type, $timedisplay, $item_num, $row_num); //Le temps moyen de l'intervention reelle - The average actiontime to resolv $data = self::constructEntryValues($itemtype, "inter_avgactiontime", $date1, $date2, $type, $value[$i]["id"], $value2); foreach ($data as $key2 => $val2) { if (isset($solved[$key2])) { $data[$key2] *= $solved[$key2]; } else { $data[$key2] *= 0; } } $total_actiontime = array_sum($data); if ($nb_solved > 0) { $timedisplay = $total_actiontime/$nb_solved; } else { $timedisplay = 0; } if (($output_type == Search::HTML_OUTPUT) || ($output_type == Search::PDF_OUTPUT_LANDSCAPE) || ($output_type == Search::PDF_OUTPUT_PORTRAIT)) { $timedisplay = Html::timestampToString($timedisplay, 0, false); } echo Search::showItem($output_type, $timedisplay, $item_num, $row_num); //Le temps total de l'intervention reelle - The total actiontime to resolv $timedisplay = $total_actiontime; if (($output_type == Search::HTML_OUTPUT) || ($output_type == Search::PDF_OUTPUT_LANDSCAPE) || ($output_type == Search::PDF_OUTPUT_PORTRAIT)) { $timedisplay = Html::timestampToString($timedisplay, 0, false); } echo Search::showItem($output_type, $timedisplay, $item_num, $row_num); echo Search::showEndLine($output_type); } // Display footer echo Search::showFooter($output_type); } else { _e('No statistics are available'); } if ($output_type == Search::HTML_OUTPUT) { // HTML display echo "
    "; } } /** * @param $itemtype * @param $type * @param $begin (default '') * @param $end (default '') * @param $param (default '') * @param $value (default '') * @param $value2 (default '') */ static function constructEntryValues($itemtype, $type, $begin="", $end="", $param="", $value="", $value2="") { global $DB; if (!$item = getItemForItemtype($itemtype)) { return; } $table = $item->getTable(); $fkfield = $item->getForeignKeyField(); if (!($userlinkclass = getItemForItemtype($item->userlinkclass))) { return; } $userlinktable = $userlinkclass->getTable(); if (!$grouplinkclass = getItemForItemtype($item->grouplinkclass)) { return; } $grouplinktable = $grouplinkclass->getTable(); if (!($supplierlinkclass = getItemForItemtype($item->supplierlinkclass))) { return; } $supplierlinktable = $supplierlinkclass->getTable(); $tasktable = getTableForItemType($item->getType().'Task'); $closed_status = $item->getClosedStatusArray(); $solved_status = array_merge($closed_status,$item->getSolvedStatusArray()); $query = ""; $WHERE = "WHERE NOT `$table`.`is_deleted` ". getEntitiesRestrictRequest("AND", $table); $LEFTJOIN = ""; $LEFTJOINUSER = "LEFT JOIN `$userlinktable` ON (`$userlinktable`.`$fkfield` = `$table`.`id`)"; $LEFTJOINGROUP = "LEFT JOIN `$grouplinktable` ON (`$grouplinktable`.`$fkfield` = `$table`.`id`)"; $LEFTJOINSUPPLIER = "LEFT JOIN `$supplierlinktable` ON (`$supplierlinktable`.`$fkfield` = `$table`.`id`)"; switch ($param) { case "technicien" : $LEFTJOIN = $LEFTJOINUSER; $WHERE .= " AND (`$userlinktable`.`users_id` = '$value' AND `$userlinktable`.`type`='".CommonITILActor::ASSIGN."')"; break; case "technicien_followup" : $WHERE .= " AND `$tasktable`.`users_id` = '$value'"; $LEFTJOIN = " LEFT JOIN `$tasktable` ON (`$tasktable`.`$fkfield` = `$table`.`id`)"; break; case "user" : $LEFTJOIN = $LEFTJOINUSER; $WHERE .= " AND (`$userlinktable`.`users_id` = '$value' AND `$userlinktable`.`type` ='".CommonITILActor::REQUESTER."')"; break; case "usertitles_id" : $LEFTJOIN = $LEFTJOINUSER; $LEFTJOIN .= " LEFT JOIN `glpi_users` ON (`glpi_users`.`id` = `$userlinktable`.`users_id`)"; $WHERE .= " AND (`glpi_users`.`usertitles_id` = '$value' AND `$userlinktable`.`type` = '".CommonITILActor::REQUESTER."')"; break; case "usercategories_id" : $LEFTJOIN = $LEFTJOINUSER; $LEFTJOIN .= " LEFT JOIN `glpi_users` ON (`glpi_users`.`id` = `$userlinktable`.`users_id`)"; $WHERE .= " AND (`glpi_users`.`usercategories_id` = '$value' AND `$userlinktable`.`type` = '".CommonITILActor::REQUESTER."')"; break; case "itilcategories_tree" : if ($value == $value2) { $categories = array($value); } else { $categories = getSonsOf("glpi_itilcategories", $value); } $condition = implode("','",$categories); $WHERE .= " AND `$table`.`itilcategories_id` IN ('$condition')"; break; case 'locations_tree' : if ($value == $value2) { $categories = array($value); } else { $categories = getSonsOf('glpi_locations', $value); } $condition = implode("','",$categories); $WHERE .= " AND `$table`.`locations_id` IN ('$condition')"; break; case 'group_tree' : case 'groups_tree_assign' : $grptype = (($param == 'group_tree') ? CommonITILActor::REQUESTER : CommonITILActor::ASSIGN); if ($value == $value2) { $groups = array($value); } else { $groups = getSonsOf("glpi_groups", $value); } $condition = implode("','",$groups); $LEFTJOIN = $LEFTJOINGROUP; $WHERE .= " AND (`$grouplinktable`.`groups_id` IN ('$condition') AND `$grouplinktable`.`type` = '$grptype')"; break; case "group" : $LEFTJOIN = $LEFTJOINGROUP; $WHERE .= " AND (`$grouplinktable`.`groups_id` = '$value' AND `$grouplinktable`.`type` = '".CommonITILActor::REQUESTER."')"; break; case "groups_id_assign" : $LEFTJOIN = $LEFTJOINGROUP; $WHERE .= " AND (`$grouplinktable`.`groups_id` = '$value' AND `$grouplinktable`.`type` = '".CommonITILActor::ASSIGN."')"; break; case "suppliers_id_assign" : $LEFTJOIN = $LEFTJOINSUPPLIER; $WHERE .= " AND (`$supplierlinktable`.`suppliers_id` = '$value' AND `$supplierlinktable`.`type` = '".CommonITILActor::ASSIGN."')"; break; case "requesttypes_id" : case "solutiontypes_id" : case "urgency" : case "impact" : case "priority" : case "users_id_recipient" : case "type" : case "itilcategories_id" : case 'locations_id' : $WHERE .= " AND `$table`.`$param` = '$value'"; break; case "device": $devtable = getTableForItemType('Computer_'.$value2); $fkname = getForeignKeyFieldForTable(getTableForItemType($value2)); //select computers IDs that are using this device; $LEFTJOIN = " INNER JOIN `glpi_computers` ON (`glpi_computers`.`id` = `$table`.`items_id` AND `$table`.`itemtype` = 'Computer') INNER JOIN `$devtable` ON (`glpi_computers`.`id` = `$devtable`.`computers_id` AND `$devtable`.`$fkname` = '$value')"; $WHERE .= " AND `glpi_computers`.`is_template` <> '1' "; break; case "comp_champ" : $ftable = getTableForItemType($value2); $champ = getForeignKeyFieldForTable($ftable); $LEFTJOIN = " INNER JOIN `glpi_computers` ON (`glpi_computers`.`id` = `$table`.`items_id` AND `$table`.`itemtype` = 'Computer')"; $WHERE .= " AND `glpi_computers`.`$champ` = '$value' AND `glpi_computers`.`is_template` <> '1'"; break; } switch($type) { case "inter_total" : $WHERE .= " AND ".getDateRequest("`$table`.`date`", $begin, $end); $query = "SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(`$table`.`date`),'%Y-%m') AS date_unix, COUNT(`$table`.`id`) AS total_visites FROM `$table` $LEFTJOIN $WHERE GROUP BY date_unix ORDER BY `$table`.`date`"; break; case "inter_solved" : $WHERE .= " AND `$table`.`status` IN ('".implode("','",$solved_status)."') AND `$table`.`solvedate` IS NOT NULL AND ".getDateRequest("`$table`.`solvedate`", $begin, $end); $query = "SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(`$table`.`solvedate`),'%Y-%m') AS date_unix, COUNT(`$table`.`id`) AS total_visites FROM `$table` $LEFTJOIN $WHERE GROUP BY date_unix ORDER BY `$table`.`solvedate`"; break; case "inter_solved_late" : $WHERE .= " AND `$table`.`status` IN ('".implode("','",$solved_status)."') AND `$table`.`solvedate` IS NOT NULL AND `$table`.`due_date` IS NOT NULL AND ".getDateRequest("`$table`.`solvedate`", $begin, $end)." AND `$table`.`solvedate` > `$table`.`due_date`"; $query = "SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(`$table`.`solvedate`),'%Y-%m') AS date_unix, COUNT(`$table`.`id`) AS total_visites FROM `$table` $LEFTJOIN $WHERE GROUP BY date_unix ORDER BY `$table`.`solvedate`"; break; case "inter_closed" : $WHERE .= " AND `$table`.`status` IN ('".implode("','",$closed_status)."') AND `$table`.`closedate` IS NOT NULL AND ".getDateRequest("`$table`.`closedate`", $begin, $end); $query = "SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(`$table`.`closedate`),'%Y-%m') AS date_unix, COUNT(`$table`.`id`) AS total_visites FROM `$table` $LEFTJOIN $WHERE GROUP BY date_unix ORDER BY `$table`.`closedate`"; break; case "inter_avgsolvedtime" : $WHERE .= " AND `$table`.`status` IN ('".implode("','",$solved_status)."') AND `$table`.`solvedate` IS NOT NULL AND ".getDateRequest("`$table`.`solvedate`", $begin, $end); $query = "SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(`$table`.`solvedate`),'%Y-%m') AS date_unix, AVG(solve_delay_stat) AS total_visites FROM `$table` $LEFTJOIN $WHERE GROUP BY date_unix ORDER BY `$table`.`solvedate`"; break; case "inter_avgclosedtime" : $WHERE .= " AND `$table`.`status` IN ('".implode("','",$closed_status)."') AND `$table`.`closedate` IS NOT NULL AND ".getDateRequest("`$table`.`closedate`", $begin, $end); $query = "SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(`$table`.`closedate`),'%Y-%m') AS date_unix, AVG(close_delay_stat) AS total_visites FROM `$table` $LEFTJOIN $WHERE GROUP BY date_unix ORDER BY `$table`.`closedate`"; break; case "inter_avgactiontime" : if ($param == "technicien_followup") { $actiontime_table = $tasktable; } else { $actiontime_table = $table; } $WHERE .= " AND `$actiontime_table`.`actiontime` > '0' AND ".getDateRequest("`$table`.`solvedate`", $begin, $end); $query = "SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(`$table`.`solvedate`),'%Y-%m') AS date_unix, AVG(`$actiontime_table`.`actiontime`) AS total_visites FROM `$table` $LEFTJOIN $WHERE GROUP BY date_unix ORDER BY `$table`.`solvedate`"; break; case "inter_avgtakeaccount" : $WHERE .= " AND `$table`.`status` IN ('".implode("','",$solved_status)."') AND `$table`.`solvedate` IS NOT NULL AND ".getDateRequest("`$table`.`solvedate`", $begin, $end); $query = "SELECT `$table`.`id`, FROM_UNIXTIME(UNIX_TIMESTAMP(`$table`.`solvedate`),'%Y-%m') AS date_unix, AVG(`$table`.`takeintoaccount_delay_stat`) AS total_visites FROM `$table` $LEFTJOIN $WHERE GROUP BY date_unix ORDER BY `$table`.`solvedate`"; break; case "inter_opensatisfaction" : $WHERE .= " AND `$table`.`status` IN ('".implode("','",$closed_status)."') AND `$table`.`closedate` IS NOT NULL AND ".getDateRequest("`$table`.`closedate`", $begin, $end); $query = "SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(`$table`.`closedate`),'%Y-%m') AS date_unix, COUNT(`$table`.`id`) AS total_visites FROM `$table` INNER JOIN `glpi_ticketsatisfactions` ON (`$table`.`id` = `glpi_ticketsatisfactions`.`tickets_id`) $LEFTJOIN $WHERE GROUP BY date_unix ORDER BY `$table`.`closedate`"; break; case "inter_answersatisfaction" : $WHERE .= " AND `$table`.`status` IN ('".implode("','",$closed_status)."') AND `$table`.`closedate` IS NOT NULL AND `glpi_ticketsatisfactions`.`date_answered` IS NOT NULL AND ".getDateRequest("`$table`.`closedate`", $begin, $end); $query = "SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(`$table`.`closedate`),'%Y-%m') AS date_unix, COUNT(`$table`.`id`) AS total_visites FROM `$table` INNER JOIN `glpi_ticketsatisfactions` ON (`$table`.`id` = `glpi_ticketsatisfactions`.`tickets_id`) $LEFTJOIN $WHERE GROUP BY date_unix ORDER BY `$table`.`closedate`"; break; case "inter_avgsatisfaction" : $WHERE .= " AND `glpi_ticketsatisfactions`.`date_answered` IS NOT NULL AND `$table`.`status` IN ('".implode("','",$closed_status)."') AND `$table`.`closedate` IS NOT NULL AND ".getDateRequest("`$table`.`closedate`", $begin, $end); $query = "SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(`$table`.`closedate`),'%Y-%m') AS date_unix, AVG(`glpi_ticketsatisfactions`.`satisfaction`) AS total_visites FROM `$table` INNER JOIN `glpi_ticketsatisfactions` ON (`$table`.`id` = `glpi_ticketsatisfactions`.`tickets_id`) $LEFTJOIN $WHERE GROUP BY date_unix ORDER BY `$table`.`closedate`"; break; } $entrees = array(); $count = array(); if (empty($query)) { return array(); } $result = $DB->query($query); if ($result && ($DB->numrows($result) > 0)) { while ($row = $DB->fetch_assoc($result)) { $date = $row['date_unix']; //$visites = round($row['total_visites']); $entrees["$date"] = $row['total_visites']; } } // Remplissage de $entrees pour les mois ou il n'y a rien // $min=-1; // $max=0; // if (count($entrees)==0) { // return $entrees; // } // foreach ($entrees as $key => $val) { // $time=strtotime($key."-01"); // if ($min>$time || $min<0) { // $min=$time; // } // if ($max<$time) { // $max=$time; // } // } $end_time = strtotime(date("Y-m",strtotime($end))."-01"); $begin_time = strtotime(date("Y-m",strtotime($begin))."-01"); // if ($max<$end_time) { // $max=$end_time; // } // if ($min>$begin_time) { // $min=$begin_time; // } $current = $begin_time; while ($current <= $end_time) { $curentry = date("Y-m",$current); if (!isset($entrees["$curentry"])) { $entrees["$curentry"] = 0; } $month = date("m",$current); $year = date("Y",$current); $current = mktime(0,0,0,intval($month)+1,1,intval($year)); } ksort($entrees); return $entrees; } /** Get groups assigned to tickets between 2 dates * * @param $entrees array containing data to displayed * @param $options array of possible options: * - title string title displayed (default empty) * - showtotal boolean show total in title (default false) * - width integer width of the graph (default 700) * - height integer height of the graph (default 300) * - unit integer height of the graph (default empty) * - type integer height of the graph (default line) : line bar stack pie * - csv boolean export to CSV (default true) * - datatype string datatype (count or average / default is count) * * @return array contains the distinct groups assigned to a tickets **/ static function showGraph(array $entrees, $options=array()) { global $CFG_GLPI; if ($uid = Session::getLoginUserID(false)) { if (!isset($_SESSION['glpigraphtype'])) { $_SESSION['glpigraphtype'] = $CFG_GLPI['default_graphtype']; } $param['showtotal'] = false; $param['title'] = ''; $param['width'] = 900; $param['height'] = 300; $param['unit'] = ''; $param['type'] = 'line'; $param['csv'] = true; $param['datatype'] = 'count'; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $param[$key] = $val; } } // Clean data if (is_array($entrees) && count($entrees)) { foreach ($entrees as $key => $val) { if (!is_array($val) || (count($val) == 0)) { unset($entrees[$key]); } } } if (!is_array($entrees) || (count($entrees) == 0)) { if (!empty($param['title'])) { echo "
    ".$param['title']."
    ".__('No item to display')."
    "; } return false; } echo "
    "; echo "
    "; switch ($param['type']) { case 'pie' : // Check datas : sum must be > 0 reset($entrees); $sum = array_sum(current($entrees)); while (($sum == 0) && ($data = next($entrees))) { $sum += array_sum($data); } if ($sum == 0) { echo "
    "; return false; } $graph = new ezcGraphPieChart(); $graph->palette = new GraphPalette(); $graph->options->font->maxFontSize = 15; $graph->title->background = '#EEEEEC'; $graph->renderer = new ezcGraphRenderer3d(); $graph->renderer->options->pieChartHeight = 20; $graph->renderer->options->moveOut = .2; $graph->renderer->options->pieChartOffset = 63; $graph->renderer->options->pieChartGleam = .3; $graph->renderer->options->pieChartGleamColor = '#FFFFFF'; $graph->renderer->options->pieChartGleamBorder = 2; $graph->renderer->options->pieChartShadowSize = 5; $graph->renderer->options->pieChartShadowColor = '#BABDB6'; if (count($entrees) == 1) { $graph->legend = false; } break; case 'bar' : case 'stack' : $graph = new ezcGraphBarChart(); $graph->options->fillLines = 210; $graph->xAxis->axisLabelRenderer = new ezcGraphAxisRotatedBoxedLabelRenderer(); $graph->xAxis->axisLabelRenderer->angle = 45; $graph->xAxis->axisSpace = .2; $graph->yAxis->min = 0; $graph->palette = new GraphPalette(); $graph->options->font->maxFontSize = 15; $graph->title->background = '#EEEEEC'; $graph->renderer = new ezcGraphRenderer3d(); $graph->renderer->options->legendSymbolGleam = .5; $graph->renderer->options->barChartGleam = .5; if ($param['type'] == 'stack') { $graph->options->stackBars = true; } $max = 0; $valtmp = array(); foreach ($entrees as $key => $val) { foreach ($val as $key2 => $val2) { $valtmp[$key2] = $val2; } } $graph->xAxis->labelCount = count($valtmp); break; case 'line' : // No break default case default : $graph = new ezcGraphLineChart(); $graph->options->fillLines = 210; $graph->xAxis->axisLabelRenderer = new ezcGraphAxisRotatedLabelRenderer(); $graph->xAxis->axisLabelRenderer->angle = 45; $graph->xAxis->axisSpace = .2; $graph->yAxis->min = 0; $graph->palette = new GraphPalette(); $graph->options->font->maxFontSize = 15; $graph->title->background = '#EEEEEC'; $graph->renderer = new ezcGraphRenderer3d(); $graph->renderer->options->legendSymbolGleam = .5; $graph->renderer->options->barChartGleam = .5; $graph->renderer->options->depth = 0.07; break; } if (!empty($param['title'])) { $posttoadd = ""; if (!empty($param['unit'])) { $posttoadd = $param['unit']; } // Add to title if (count($entrees) == 1) { if ($param['showtotal'] == 1) { reset($entrees); $param['title'] = sprintf(__('%1$s - %2$s'), $param['title'], round(array_sum(current($entrees)), 2)); } $param['title'] = sprintf(__('%1$s - %2$s'), $param['title'], $posttoadd); } else { // add sum to legend and unit to title $param['title'] = sprintf(__('%1$s - %2$s'), $param['title'], $posttoadd); // Cannot display totals of already average values if (($param['showtotal'] == 1) && ($param['datatype'] != 'average')) { $entree_tmp = $entrees; $entrees = array(); foreach ($entree_tmp as $key => $data) { $sum = round(array_sum($data)); $entrees[$key." ($sum)"] = $data; } } } $graph->title = $param['title']; } switch ($_SESSION['glpigraphtype']) { case "png" : $extension = "png"; $graph->driver = new ezcGraphGdDriver(); $graph->options->font = GLPI_FONT_FREESANS; break; default : $extension = "svg"; break; } $filename = $uid.'_'.mt_rand(); $csvfilename = $filename.'.csv'; $filename .= '.'.$extension; foreach ($entrees as $label => $data) { $graph->data[$label] = new ezcGraphArrayDataSet($data); $graph->data[$label]->symbol = ezcGraph::NO_SYMBOL; } switch ($_SESSION['glpigraphtype']) { case "png" : $graph->render($param['width'], $param['height'], GLPI_GRAPH_DIR.'/'.$filename); echo ""; break; default : $graph->render($param['width'], $param['height'], GLPI_GRAPH_DIR.'/'.$filename); echo " __('You need a browser capeable of SVG to display this image.') "; break; } // Render CSV if ($param['csv']) { if ($fp = fopen(GLPI_GRAPH_DIR.'/'.$csvfilename, 'w')) { // reformat datas $values = array(); $labels = array(); $row_num = 0; foreach ($entrees as $label => $data) { $labels[$row_num] = $label; if (is_array($data) && count($data)) { foreach ($data as $key => $val) { if (!isset($values[$key])) { $values[$key] = array(); } if ($param['datatype'] == 'average') { $val = round($val,2); } $values[$key][$row_num] = $val; } } $row_num++; } ksort($values); // Print labels fwrite($fp, $_SESSION["glpicsv_delimiter"]); foreach ($labels as $val) { fwrite($fp, $val.$_SESSION["glpicsv_delimiter"]); } fwrite($fp, "\n"); foreach ($values as $key => $data) { fwrite($fp, $key.$_SESSION["glpicsv_delimiter"]); foreach ($data as $value) { fwrite($fp, $value.$_SESSION["glpicsv_delimiter"]); } fwrite($fp,"\n"); } fclose($fp); } } echo "
    "; echo "
    "; $graphtype = ''; if ($_SESSION['glpigraphtype'] != 'svg') { $graphtype = "". __('SVG').""; } if ($_SESSION['glpigraphtype'] != 'png') { $graphtype = "". __('PNG').""; } if ($param['csv']) { $graphtype = sprintf(__('%1$s / %2$s'), $graphtype, "".__('CSV').""); } echo $graphtype; echo "
    "; echo ''; } } /** * @param $target * @param $date1 * @param $date2 * @param $start **/ static function showItems($target, $date1, $date2, $start) { global $DB, $CFG_GLPI; $view_entities = Session::isMultiEntitiesMode(); if ($view_entities) { $entities = getAllDatasFromTable('glpi_entities'); } $output_type = Search::HTML_OUTPUT; if (isset($_GET["display_type"])) { $output_type = $_GET["display_type"]; } if (empty($date2)) { $date2 = date("Y-m-d"); } $date2 .= " 23:59:59"; // 1 an par defaut if (empty($date1)) { $date1 = date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y")-1)); } $date1 .= " 00:00:00"; $query = "SELECT `itemtype`, `items_id`, COUNT(*) AS NB FROM `glpi_tickets` WHERE `date` <= '$date2' AND `date` >= '$date1' ". getEntitiesRestrictRequest("AND","glpi_tickets")." AND `itemtype` <> '' AND `items_id` > 0 GROUP BY `itemtype`, `items_id` ORDER BY NB DESC"; $result = $DB->query($query); $numrows = $DB->numrows($result); if ($numrows > 0) { if ($output_type == Search::HTML_OUTPUT) { Html::printPager($start, $numrows, $target, "date1=".$date1."&date2=".$date2. "&type=hardwares&start=$start", 'Stat'); echo "
    "; } $end_display = $start+$_SESSION['glpilist_limit']; if (isset($_GET['export_all'])) { $end_display = $numrows; } echo Search::showHeader($output_type, $end_display-$start+1, 2, 1); $header_num = 1; echo Search::showNewLine($output_type); echo Search::showHeaderItem($output_type, __('Associated element'), $header_num); if ($view_entities) { echo Search::showHeaderItem($output_type, __('Entity'), $header_num); } echo Search::showHeaderItem($output_type, __('Number of tickets'), $header_num); echo Search::showEndLine($output_type); $DB->data_seek($result, $start); $i = $start; if (isset($_GET['export_all'])) { $start = 0; } for ($i=$start ; ($i<$numrows) && ($i<$end_display) ; $i++) { $item_num = 1; // Get data and increment loop variables $data = $DB->fetch_assoc($result); if (!($item = getItemForItemtype($data["itemtype"]))) { continue; } if ($item->getFromDB($data["items_id"])) { echo Search::showNewLine($output_type, $i%2); echo Search::showItem($output_type, sprintf(__('%1$s - %2$s'), $item->getTypeName(), $item->getLink()), $item_num, $i-$start+1, "class='center'"." ".($item->isDeleted()?" class='deleted' " :"")); if ($view_entities) { $ent = $item->getEntityID(); $ent = $entities[$ent]['completename']; echo Search::showItem($output_type, $ent, $item_num, $i-$start+1, "class='center'"." ".($item->isDeleted()?" class='deleted' " :"")); } echo Search::showItem($output_type, $data["NB"], $item_num, $i-$start+1, "class='center'"." ".($item->isDeleted()?" class='deleted' " :"")); } } echo Search::showFooter($output_type); if ($output_type == Search::HTML_OUTPUT) { echo "
    "; } } } /** * @since version 0.84 **/ static function title() { global $PLUGIN_HOOKS, $CFG_GLPI; $show_problem = Session::haveRight("edit_all_problem", "1") || Session::haveRight("show_all_problem", "1"); $opt_list["Ticket"] = __('Tickets'); $stat_list["Ticket"]["Ticket_Global"]["name"] = __('Global'); $stat_list["Ticket"]["Ticket_Global"]["file"] = "stat.global.php?itemtype=Ticket"; $stat_list["Ticket"]["Ticket_Ticket"]["name"] = __('By ticket'); $stat_list["Ticket"]["Ticket_Ticket"]["file"] = "stat.tracking.php?itemtype=Ticket"; $stat_list["Ticket"]["Ticket_Location"]["name"] = __('By hardware characteristics'); $stat_list["Ticket"]["Ticket_Location"]["file"] = "stat.location.php?itemtype=Ticket"; $stat_list["Ticket"]["Ticket_Item"]["name"] = __('By hardware'); $stat_list["Ticket"]["Ticket_Item"]["file"] = "stat.item.php"; if ($show_problem) { $opt_list["Problem"] = _n('Problem', 'Problems', 2); $stat_list["Problem"]["Problem_Global"]["name"] = __('Global'); $stat_list["Problem"]["Problem_Global"]["file"] = "stat.global.php?itemtype=Problem"; $stat_list["Problem"]["Problem_Problem"]["name"] = __('By problem'); $stat_list["Problem"]["Problem_Problem"]["file"] = "stat.tracking.php?itemtype=Problem"; } //Affichage du tableau de presentation des stats echo ""; echo ""; echo ""; echo ""; echo "
    ".__('Select statistics to be displayed')."
    "; echo ""; echo "
    "; } } ?> glpi-0.84.3+dfsg.1/inc/state.class.php000066400000000000000000000136701226600447100173360ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class State class State extends CommonTreeDropdown { static function getTypeName($nb=0) { return _n('Status of items', 'Statuses of items', $nb); } /** * Dropdown of states for behaviour config * * @param $name select name * @param $lib string to add for -1 value (default '') * @param $value default value (default 0) **/ static function dropdownBehaviour($name, $lib="", $value=0) { global $DB; $elements = array("0" => __('Keep status')); if ($lib) { $elements["-1"] = $lib; } $queryStateList = "SELECT `id`, `name` FROM `glpi_states` ORDER BY `name`"; $result = $DB->query($queryStateList); if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { $elements[$data["id"]] = sprintf(__('Set status: %s'), $data["name"]); } } Dropdown::showFromArray($name, $elements, array('value' => $value)); } static function showSummary() { global $DB, $CFG_GLPI; $state_type = $CFG_GLPI["state_types"]; $states = array(); foreach ($state_type as $key=>$itemtype) { if ($item = getItemForItemtype($itemtype)) { if (!$item->canView()) { unset($state_type[$key]); } else { $table = getTableForItemType($itemtype); $query = "SELECT `states_id`, COUNT(*) AS cpt FROM `$table` ". getEntitiesRestrictRequest("WHERE",$table)." AND `is_deleted` = '0' AND `is_template` = '0' GROUP BY `states_id`"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { $states[$data["states_id"]][$itemtype] = $data["cpt"]; } } } } } } if (count($states)) { // Produce headline echo "
    "; // Type echo ""; foreach ($state_type as $key => $itemtype) { if ($item = getItemForItemtype($itemtype)) { echo ""; $total[$itemtype] = 0; } else { unset($state_type[$key]); } } echo ""; echo ""; $query = "SELECT * FROM `glpi_states` ORDER BY `completename`"; $result = $DB->query($query); // No state $tot = 0; echo ""; foreach ($state_type as $itemtype) { echo ""; } echo ""; while ($data = $DB->fetch_assoc($result)) { $tot = 0; echo ""; foreach ($state_type as $itemtype) { echo ""; } echo ""; echo ""; } echo ""; $tot = 0; foreach ($state_type as $itemtype) { echo ""; $tot += $total[$itemtype]; } echo ""; echo "
    ".__('Status')."".$item->getTypeName(2)."".__('Total')."
    ---"; if (isset($states[0][$itemtype])) { echo $states[0][$itemtype]; $total[$itemtype] += $states[0][$itemtype]; $tot += $states[0][$itemtype]; } else { echo " "; } echo "$tot
    "; echo "".$data["completename"].""; if (isset($states[$data["id"]][$itemtype])) { echo $states[$data["id"]][$itemtype]; $total[$itemtype] += $states[$data["id"]][$itemtype]; $tot += $states[$data["id"]][$itemtype]; } else { echo " "; } echo "$tot
    ".__('Total')."".$total[$itemtype]."$tot
    "; } else { echo "
    ".__('No item found')."
    "; } } function cleanDBonPurge() { Rule::cleanForItemCriteria($this); } } ?> glpi-0.84.3+dfsg.1/inc/supplier.class.php000066400000000000000000000445231226600447100200620ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Supplier class (suppliers) */ class Supplier extends CommonDBTM { // From CommonDBTM public $dohistory = true; /** * Name of the type * * @param $nb : number of item in the type **/ static function getTypeName($nb=0) { return _n('Supplier', 'Suppliers', $nb); } static function canCreate() { return Session::haveRight('contact_enterprise', 'w'); } static function canView() { return Session::haveRight('contact_enterprise', 'r'); } function cleanDBonPurge() { global $DB; $supplierjob = new Supplier_Ticket(); $supplierjob->cleanDBonItemDelete($this->getType(), $this->fields['id']); $cs = new Contract_Supplier(); $cs->cleanDBonItemDelete($this->getType(), $this->fields['id']); $cs = new Contact_Supplier(); $cs->cleanDBonItemDelete($this->getType(), $this->fields['id']); // Ticket rules use suppliers_id_assign Rule::cleanForItemAction($this, 'suppliers_id%'); } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('Contact_Supplier', $ong, $options); $this->addStandardTab('Contract_Supplier', $ong, $options); $this->addStandardTab('Infocom', $ong, $options); $this->addStandardTab('Document_Item', $ong, $options); $this->addStandardTab('Ticket', $ong, $options); $this->addStandardTab('Link', $ong, $options); $this->addStandardTab('Note', $ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } /** * Print the enterprise form * * @param $ID Integer : Id of the computer or the template to print * @param $options array * - target form target * - withtemplate boolean : template or basic item * *@return Nothing (display) **/ function showForm($ID, $options=array()) { $this->initForm($ID, $options); $this->showTabs($options); $this->showFormHeader($options); echo ""; echo "".__('Name').""; echo ""; Html::autocompletionTextField($this, "name"); echo ""; echo "".__('Third party type').""; echo ""; SupplierType::dropdown(array('value' => $this->fields["suppliertypes_id"])); echo ""; echo ""; echo "". __('Phone').""; echo ""; Html::autocompletionTextField($this, "phonenumber"); echo ""; echo "".__('Comments').""; echo ""; echo ""; echo ""; echo ""; echo "".__('Fax').""; echo ""; Html::autocompletionTextField($this, "fax"); echo ""; echo ""; echo "".__('Website').""; echo ""; Html::autocompletionTextField($this, "website"); echo ""; echo ""; echo ""._n('Email', 'Emails', 1).""; echo ""; Html::autocompletionTextField($this, "email"); echo ""; echo ""; echo "".__('Address').""; echo ""; echo ""; echo ""; echo ""; echo "".__('Postal code').""; echo ""; Html::autocompletionTextField($this, "postcode", array('size' => 10)); echo "  ". __('City'). " "; Html::autocompletionTextField($this, "town", array('size' => 23)); echo ""; echo ""; echo "".__('State').""; echo ""; Html::autocompletionTextField($this, "state"); echo ""; echo ""; echo "".__('Country').""; echo ""; Html::autocompletionTextField($this, "country"); echo ""; $this->showFormButtons($options); $this->addDivForTabs(); return true; } /** * @see CommonDBTM::getSpecificMassiveActions() **/ function getSpecificMassiveActions($checkitem=NULL) { $isadmin = static::canUpdate(); $actions = parent::getSpecificMassiveActions($checkitem); if ($isadmin) { $actions['add_contact_supplier'] = _x('button', 'Add a contact'); } if (Session::haveRight('transfer','r') && Session::isMultiEntitiesMode() && $isadmin) { $actions['add_transfer_list'] = _x('button', 'Add to transfer list'); } return $actions; } /** * @see CommonDBTM::showSpecificMassiveActionsParameters() **/ function showSpecificMassiveActionsParameters($input=array()) { switch ($input['action']) { case "add_contact_supplier" : $contactsupplier = new Contact_Supplier(); return $contactsupplier->showSpecificMassiveActionsParameters($input); default : return parent::showSpecificMassiveActionsParameters($input); } return false; } /** * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "add_contact_supplier" : $contactsupplier = new Contact_Supplier(); return $contactsupplier->doSpecificMassiveActions($input); default : return parent::doSpecificMassiveActions($input); } return false; } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'address'; $tab[3]['name'] = __('Address'); $tab[3]['datatype'] = 'text'; $tab[10]['table'] = $this->getTable(); $tab[10]['field'] = 'fax'; $tab[10]['name'] = __('Fax'); $tab[10]['datatype'] = 'string'; $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'town'; $tab[11]['name'] = __('City'); $tab[11]['datatype'] = 'string'; $tab[14]['table'] = $this->getTable(); $tab[14]['field'] = 'postcode'; $tab[14]['name'] = __('Postal code'); $tab[14]['datatype'] = 'string'; $tab[12]['table'] = $this->getTable(); $tab[12]['field'] = 'state'; $tab[12]['name'] = __('State'); $tab[12]['datatype'] = 'string'; $tab[13]['table'] = $this->getTable(); $tab[13]['field'] = 'country'; $tab[13]['name'] = __('Country'); $tab[13]['datatype'] = 'string'; $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'website'; $tab[4]['name'] = __('Website'); $tab[4]['datatype'] = 'weblink'; $tab[5]['table'] = $this->getTable(); $tab[5]['field'] = 'phonenumber'; $tab[5]['name'] = __('Phone'); $tab[5]['datatype'] = 'string'; $tab[6]['table'] = $this->getTable(); $tab[6]['field'] = 'email'; $tab[6]['name'] = _n('Email', 'Emails', 1); $tab[6]['datatype'] = 'email'; $tab[9]['table'] = 'glpi_suppliertypes'; $tab[9]['field'] = 'name'; $tab[9]['name'] = __('Third party type'); $tab[9]['datatype'] = 'dropdown'; $tab[8]['table'] = 'glpi_contacts'; $tab[8]['field'] = 'completename'; $tab[8]['name'] = _n('Associated contact', 'Associated contacts', 2); $tab[8]['forcegroupby'] = true; $tab[8]['datatype'] = 'itemlink'; $tab[8]['massiveaction'] = false; $tab[8]['joinparams'] = array('beforejoin' => array('table' => 'glpi_contacts_suppliers', 'joinparams' => array('jointype' => 'child'))); $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab[90]['table'] = $this->getTable(); $tab[90]['field'] = 'notepad'; $tab[90]['name'] = __('Notes'); $tab[90]['massiveaction'] = false; $tab[90]['datatype'] = 'text'; $tab[80]['table'] = 'glpi_entities'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = __('Entity'); $tab[80]['massiveaction'] = false; $tab[80]['datatype'] = 'dropdown'; $tab[86]['table'] = $this->getTable(); $tab[86]['field'] = 'is_recursive'; $tab[86]['name'] = __('Child entities'); $tab[86]['datatype'] = 'bool'; $tab[29]['table'] = 'glpi_contracts'; $tab[29]['field'] = 'name'; $tab[29]['name'] = _n('Associated contract', 'Associated contracts', 2); $tab[29]['forcegroupby'] = true; $tab[29]['datatype'] = 'itemlink'; $tab[29]['massiveaction'] = false; $tab[29]['joinparams'] = array('beforejoin' => array('table' => 'glpi_contracts_suppliers', 'joinparams' => array('jointype' => 'child'))); return $tab; } /** * Get links for an enterprise (website / edit) * * @param $withname boolean : also display name ? (false by default) **/ function getLinks($withname=false) { global $CFG_GLPI; $ret = '    '; if ($withname) { $ret .= $this->fields["name"]; $ret .= "  "; } if (!empty($this->fields['website'])) { $ret .= " \"".  "; } if ($this->can($this->fields['id'],'r')) { $ret .= " \""."; } return $ret; } /** * Print the HTML array for infocoms linked * *@return Nothing (display) * **/ function showInfocoms() { global $DB, $CFG_GLPI; $instID = $this->fields['id']; if (!$this->can($instID,'r')) { return false; } $query = "SELECT DISTINCT `itemtype` FROM `glpi_infocoms` WHERE `suppliers_id` = '$instID' AND `itemtype` NOT IN ('ConsumableItem', 'CartridgeItem', 'Software') ORDER BY `itemtype`"; $result = $DB->query($query); $number = $DB->numrows($result); echo "
    "; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $num = 0; for ($i=0 ; $i < $number ; $i++) { $itemtype = $DB->result($result, $i, "itemtype"); if (!($item = getItemForItemtype($itemtype))) { continue; } if ($item->canView()) { $linktype = $itemtype; $linkfield = 'id'; $itemtable = getTableForItemType($itemtype); $query = "SELECT `glpi_infocoms`.`entities_id`, `name`, `$itemtable`.* FROM `glpi_infocoms` INNER JOIN `$itemtable` ON (`$itemtable`.`id` = `glpi_infocoms`.`items_id`) "; // Set $linktype for entity restriction AND link to search engine if ($itemtype == 'Cartridge') { $query .= "INNER JOIN `glpi_cartridgeitems` ON (`glpi_cartridgeitems`.`id`=`glpi_cartridges`.`cartridgeitems_id`) "; $linktype = 'CartridgeItem'; $linkfield = 'cartridgeitems_id'; } if ($itemtype == 'Consumable' ) { $query .= "INNER JOIN `glpi_consumableitems` ON (`glpi_consumableitems`.`id`=`glpi_consumables`.`consumableitems_id`) "; $linktype = 'ConsumableItem'; $linkfield = 'consumableitems_id'; } $linktable = getTableForItemType($linktype); $query .= "WHERE `glpi_infocoms`.`itemtype` = '$itemtype' AND `glpi_infocoms`.`suppliers_id` = '$instID'". getEntitiesRestrictRequest(" AND", $linktable) ." ORDER BY `glpi_infocoms`.`entities_id`, `$linktable`.`name`"; $result_linked = $DB->query($query); $nb = $DB->numrows($result_linked); // Set $linktype for link to search engine pnly if (($itemtype == 'SoftwareLicense') && ($nb > $_SESSION['glpilist_limit'])) { $linktype = 'Software'; $linkfield = 'softwares_id'; } if ($nb > $_SESSION['glpilist_limit']) { echo ""; $title = $item->getTypeName($nb); if ($nb > 0) { $title = sprintf(__('%1$s: %2$s'), $title, $nb); } echo ""; echo ""; echo ""; } else if ($nb) { for ($prem=true ; $data=$DB->fetch_assoc($result_linked) ; $prem=false) { $name = $data["name"]; if ($_SESSION["glpiis_ids_visible"] || empty($data["name"])) { $name = sprintf(__('%1$s (%2$s)'), $name, $data["id"]); } $link = Toolbox::getItemTypeFormURL($linktype); $name = "".$name.""; echo ""; if ($prem) { $title = $item->getTypeName($nb); if ($nb > 0) { $title = sprintf(__('%1$s: %2$s'), $title, $nb); } echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; } } $num += $nb; } } echo ""; echo ""; echo " "; echo "
    "; Html::printPagerForm(); echo ""; if ($DB->numrows($result) == 0) { _e('No associated item'); } else { echo _n('Associated item', 'Associated items', $DB->numrows($result)); } echo "
    ".__('Type')."".__('Entity')."".__('Name')."".__('Serial number')."".__('Inventory number')."
    ".$title.""; echo "" . __('Device list')."--
    ".$title."".Dropdown::getDropdownName("glpi_entities", $data["entities_id"]).""; echo $name."". (isset($data["serial"])?"".$data["serial"]."":"-")."". (isset($data["otherserial"])? "".$data["otherserial"]."" :"-")."
    ".(($num > 0) ? sprintf(__('%1$s = %2$s'), __('Total'), $num) : " ")." 
    "; } } ?> glpi-0.84.3+dfsg.1/inc/supplier_ticket.class.php000066400000000000000000000041111226600447100214120ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Class Supplier_Ticket * * @since version 0.84 * **/ class Supplier_Ticket extends CommonITILActor { // From CommonDBRelation static public $itemtype_1 = 'Ticket'; static public $items_id_1 = 'tickets_id'; static public $itemtype_2 = 'Supplier'; static public $items_id_2 = 'suppliers_id'; /** * @param $items_id * @param $email **/ function isSupplierEmail($items_id, $email) { global $DB; $query = "SELECT * FROM `".$this->getTable()."` LEFT JOIN `glpi_suppliers` ON (`".$this->getTable()."`.`suppliers_id` = `glpi_suppliers`.`id`) WHERE `".$this->getTable()."`.`tickets_id` = '".$items_id."' AND `glpi_suppliers`.`email` = '$email'"; foreach ($DB->request($query) as $data) { return true; } return false; } } ?> glpi-0.84.3+dfsg.1/inc/suppliertype.class.php000066400000000000000000000025721226600447100207620ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class SupplierType class SupplierType extends CommonDropdown { static function getTypeName($nb=0) { return _n('Third party type', 'Third party types', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/taskcategory.class.php000066400000000000000000000031541226600447100207120ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// TaskCategory class class TaskCategory extends CommonTreeDropdown { // From CommonDBTM public $dohistory = true; static function getTypeName($nb=0) { return _n('Tasks category','Tasks categories', $nb); } static function canCreate() { return Session::haveRight('entity_dropdown','w'); } static function canView() { return Session::haveRight('entity_dropdown','r'); } } ?>glpi-0.84.3+dfsg.1/inc/ticket.class.php000066400000000000000000007267301226600447100175110ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Tracking class class Ticket extends CommonITILObject { // From CommonDBTM public $dohistory = true; static protected $forward_entity_to = array('TicketValidation', 'TicketCost'); // From CommonITIL public $userlinkclass = 'Ticket_User'; public $grouplinkclass = 'Group_Ticket'; public $supplierlinkclass = 'Supplier_Ticket'; protected $userentity_oncreate = true; const MATRIX_FIELD = 'priority_matrix'; const URGENCY_MASK_FIELD = 'urgency_mask'; const IMPACT_MASK_FIELD = 'impact_mask'; const STATUS_MATRIX_FIELD = 'ticket_status'; // HELPDESK LINK HARDWARE DEFINITION : CHECKSUM SYSTEM : BOTH=1*2^0+1*2^1=3 const HELPDESK_MY_HARDWARE = 0; const HELPDESK_ALL_HARDWARE = 1; // Specific ones /// Hardware datas used by getFromDBwithData var $hardwaredatas = NULL; /// Is a hardware found in getHardwareData / getFromDBwithData : hardware link to the job var $computerfound = 0; // Request type const INCIDENT_TYPE = 1; // Demand type const DEMAND_TYPE = 2; function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); if (!Session::haveRight('update_ticket', 1)) { $forbidden[] = 'update'; } if (!Session::haveRight('delete_ticket', 1)) { $forbidden[] = 'delete'; $forbidden[] = 'purge'; $forbidden[] = 'restore'; } return $forbidden; } /** * Name of the type * * @param $nb : number of item in the type (default 0) **/ static function getTypeName($nb=0) { return _n('Ticket','Tickets',$nb); } function canAdminActors() { return Session::haveRight('update_ticket', 1); } function canAssign() { return Session::haveRight('assign_ticket', 1); } function canAssignToMe() { return (Session::haveRight("steal_ticket","1") || (Session::haveRight("own_ticket","1") && ($this->countUsers(CommonITILActor::ASSIGN) == 0))); } static function canCreate() { return Session::haveRight('create_ticket', 1); } static function canUpdate() { return (Session::haveRight('update_ticket', 1) || Session::haveRight('create_ticket', 1) || Session::haveRight('assign_ticket', 1) || Session::haveRight('own_ticket', 1) || Session::haveRight('steal_ticket', 1)); } static function canView() { if (isset($_SESSION['glpiactiveprofile']['interface']) && $_SESSION['glpiactiveprofile']['interface'] == 'helpdesk') { return true; } return (Session::haveRight("show_all_ticket","1") || Session::haveRight('create_ticket','1') || Session::haveRight('update_ticket','1') || Session::haveRight('show_all_ticket','1') || Session::haveRight("show_assign_ticket",'1') || Session::haveRight("own_ticket",'1') || Session::haveRight('validate_request','1') || Session::haveRight('validate_incident','1') || Session::haveRight("show_group_ticket",'1')); } /** * Is the current user have right to show the current ticket ? * * @return boolean **/ function canViewItem() { if (!Session::haveAccessToEntity($this->getEntityID())) { return false; } return (Session::haveRight("show_all_ticket","1") || ($this->fields["users_id_recipient"] === Session::getLoginUserID()) || $this->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID()) || $this->isUser(CommonITILActor::OBSERVER, Session::getLoginUserID()) || (Session::haveRight("show_group_ticket",'1') && isset($_SESSION["glpigroups"]) && ($this->haveAGroup(CommonITILActor::REQUESTER, $_SESSION["glpigroups"]) || $this->haveAGroup(CommonITILActor::OBSERVER, $_SESSION["glpigroups"]))) || (Session::haveRight("show_assign_ticket",'1') && ($this->isUser(CommonITILActor::ASSIGN, Session::getLoginUserID()) || (isset($_SESSION["glpigroups"]) && $this->haveAGroup(CommonITILActor::ASSIGN, $_SESSION["glpigroups"])) || (Session::haveRight('assign_ticket',1) && ($this->fields["status"] == self::INCOMING)))) || ((Session::haveRight('validate_incident','1') || Session::haveRight('validate_request','1')) && TicketValidation::canValidate($this->fields["id"]))); } /** * Is the current user have right to solve the current ticket ? * * @return boolean **/ function canSolve() { return ((Session::haveRight("update_ticket","1") || $this->isUser(CommonITILActor::ASSIGN, Session::getLoginUserID()) || (isset($_SESSION["glpigroups"]) && $this->haveAGroup(CommonITILActor::ASSIGN, $_SESSION["glpigroups"]))) && self::isAllowedStatus($this->fields['status'], self::SOLVED) // No edition on closed status && !in_array($this->fields['status'], $this->getClosedStatusArray())); } /** * Is the current user have right to approve solution of the current ticket ? * * @return boolean **/ function canApprove() { return (($this->fields["users_id_recipient"] === Session::getLoginUserID()) || $this->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID()) || (isset($_SESSION["glpigroups"]) && $this->haveAGroup(CommonITILActor::REQUESTER, $_SESSION["glpigroups"]))); } /** * @see CommonDBTM::canMassiveAction() **/ function canMassiveAction($action, $field, $value) { switch ($action) { case 'update' : switch ($field) { case 'status' : if (!self::isAllowedStatus($this->fields['status'], $value)) { return false; } break; } break; } return true; } /** * Get Datas to be added for SLA add * * @param $slas_id SLA id * @param $entities_id entity ID of the ticket * @param $date begin date of the ticket * * @return array of datas to add in ticket **/ function getDatasToAddSLA($slas_id, $entities_id, $date) { $calendars_id = Entity::getUsedConfig('calendars_id', $entities_id); $data = array(); $sla = new SLA(); if ($sla->getFromDB($slas_id)) { $sla->setTicketCalendar($calendars_id); // Get first SLA Level $data["slalevels_id"] = SlaLevel::getFirstSlaLevel($slas_id); // Compute due_date $data['due_date'] = $sla->computeDueDate($date); $data['sla_waiting_duration'] = 0; } else { $data["slalevels_id"] = 0; $data["slas_id"] = 0; $data['sla_waiting_duration'] = 0; } return $data; } /** * Delete SLA for the ticket * * @param $id ID of the ticket * * @return boolean **/ function deleteSLA($id) { global $DB; $input['slas_id'] = 0; $input['slalevels_id'] = 0; $input['sla_waiting_duration'] = 0; $input['id'] = $id; SlaLevel_Ticket::deleteForTicket($id); return $this->update($input); } /** * Is the current user have right to create the current ticket ? * * @return boolean **/ function canCreateItem() { if (!Session::haveAccessToEntity($this->getEntityID())) { return false; } return Session::haveRight('create_ticket', '1'); } /** * Is the current user have right to update the current ticket ? * * @return boolean **/ function canUpdateItem() { if (!Session::haveAccessToEntity($this->getEntityID())) { return false; } if (($this->numberOfFollowups() == 0) && ($this->numberOfTasks() == 0) && ($this->isUser(CommonITILActor::REQUESTER,Session::getLoginUserID()) || ($this->fields["users_id_recipient"] === Session::getLoginUserID()))) { return true; } return static::canUpdate(); } /** * Is the current user have right to delete the current ticket ? * * @return boolean **/ function canDeleteItem() { if (!Session::haveAccessToEntity($this->getEntityID())) { return false; } // user can delete his ticket if no action on it if (($this->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID()) || ($this->fields["users_id_recipient"] === Session::getLoginUserID())) && ($this->numberOfFollowups() == 0) && ($this->numberOfTasks() == 0) && ($this->fields["date"] == $this->fields["date_mod"])) { return true; } return Session::haveRight('delete_ticket', '1'); } /** * @see CommonITILObject::getDefaultActor() **/ function getDefaultActor($type) { if ($type == CommonITILActor::ASSIGN) { if (Session::haveRight("own_ticket","1") && $_SESSION['glpiset_default_tech']) { return Session::getLoginUserID(); } } return 0; } /** * @see CommonITILObject::getDefaultActorRightSearch() **/ function getDefaultActorRightSearch($type) { $right = "all"; if ($type == CommonITILActor::ASSIGN) { $right = "own_ticket"; if (!Session::haveRight("assign_ticket","1")) { $right = 'id'; } } return $right; } function pre_deleteItem() { NotificationEvent::raiseEvent('delete',$this); return true; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (static::canView()) { $nb = 0; $title = self::getTypeName(2); if ($_SESSION['glpishow_count_on_tabs']) { switch ($item->getType()) { case 'Change' : $nb = countElementsInTable('glpi_changes_tickets', "`changes_id` = '".$item->getID()."'"); break; case 'Problem' : $nb = countElementsInTable('glpi_problems_tickets', "`problems_id` = '".$item->getID()."'"); break; case 'User' : $nb = countElementsInTable('glpi_tickets_users', "`users_id` = '".$item->getID()."' AND `type` = ".CommonITILActor::REQUESTER); $title = __('Created tickets'); break; case 'Supplier' : $nb = countElementsInTable('glpi_suppliers_tickets', "`suppliers_id` = '".$item->getID()."'"); break; case 'SLA' : $nb = countElementsInTable('glpi_tickets', "`slas_id` = '".$item->getID()."'"); break; case 'Group' : $nb = countElementsInTable('glpi_groups_tickets', "`groups_id` = '".$item->getID()."' AND `type` = ".CommonITILActor::REQUESTER); $title = __('Created tickets'); break; default : // Direct one $nb = countElementsInTable('glpi_tickets', " `itemtype` = '".$item->getType()."' AND `items_id` = '".$item->getID()."'"); // Linked items if ($subquery = $item->getSelectLinkedItem()) { $nb += countElementsInTable('glpi_tickets', "(`itemtype`,`items_id`) IN (" . $subquery . ")"); } break; } } // glpishow_count_on_tabs // Not for Ticket class if ($item->getType() != __CLASS__) { return self::createTabEntry($title, $nb); } } // show_all_ticket right check // Not check show_all_ticket for Ticket itself switch ($item->getType()) { case __CLASS__ : $ong = array(); $ong[2] = _n('Solution', 'Solutions', 1); // enquete si statut clos if ($item->fields['status'] == self::CLOSED) { $satisfaction = new TicketSatisfaction(); if ($satisfaction->getFromDB($item->getID())) { $ong[3] = __('Satisfaction'); } } if (Session::haveRight('observe_ticket','1')) { $ong[4] = __('Statistics'); } return $ong; // default : // return _n('Ticket','Tickets',2); } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($item->getType()) { case 'Change' : Change_Ticket::showForChange($item); break; case 'Problem' : Problem_Ticket::showForProblem($item); break; case __CLASS__ : switch ($tabnum) { case 2 : if (!isset($_POST['load_kb_sol'])) { $_POST['load_kb_sol'] = 0; } $item->showSolutionForm($_POST['load_kb_sol']); if ($item->canApprove()) { $fup = new TicketFollowup(); $fup->showApprobationForm($item); } break; case 3 : $satisfaction = new TicketSatisfaction(); if (($item->fields['status'] == self::CLOSED) && $satisfaction->getFromDB($_POST["id"])) { $satisfaction->showSatisfactionForm($item); } else { echo "

    ".__('No generated survey')."

    "; } break; case 4 : $item->showStats(); break; } break; case 'Group' : case 'SLA' : default : self::showListForItem($item); } return true; } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('TicketFollowup',$ong, $options); $this->addStandardTab('TicketValidation', $ong, $options); $this->addStandardTab('TicketTask', $ong, $options); $this->addStandardTab(__CLASS__, $ong, $options); $this->addStandardTab('TicketCost', $ong, $options); $this->addStandardTab('Document_Item', $ong, $options); $this->addStandardTab('Problem', $ong, $options); // $this->addStandardTab('Change', $ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } /** * Retrieve data of the hardware linked to the ticket if exists * * @return nothing : set computerfound to 1 if founded **/ function getAdditionalDatas() { if ($this->fields["itemtype"] && ($item = getItemForItemtype($this->fields["itemtype"]))) { if ($item->getFromDB($this->fields["items_id"])) { $this->hardwaredatas=$item; } } else { $this->hardwaredatas = NULL; } } function cleanDBonPurge() { global $DB; $query1 = "DELETE FROM `glpi_tickettasks` WHERE `tickets_id` = '".$this->fields['id']."'"; $DB->query($query1); $query1 = "DELETE FROM `glpi_ticketfollowups` WHERE `tickets_id` = '".$this->fields['id']."'"; $DB->query($query1); $ts = new TicketValidation(); $ts->cleanDBonItemDelete($this->getType(), $this->fields['id']); $query1 = "DELETE FROM `glpi_ticketsatisfactions` WHERE `tickets_id` = '".$this->fields['id']."'"; $DB->query($query1); $pt = new Problem_Ticket(); $pt->cleanDBonItemDelete('Ticket', $this->fields['id']); $ts = new TicketCost(); $ts->cleanDBonItemDelete($this->getType(), $this->fields['id']); SlaLevel_Ticket::deleteForTicket($this->getID()); $query1 = "DELETE FROM `glpi_tickets_tickets` WHERE `tickets_id_1` = '".$this->fields['id']."' OR `tickets_id_2` = '".$this->fields['id']."'"; $DB->query($query1); parent::cleanDBonPurge(); } function prepareInputForUpdate($input) { global $CFG_GLPI; // Get ticket : need for comparison $this->getFromDB($input['id']); // automatic recalculate if user changes urgence or technician change impact if (isset($input['urgency']) && isset($input['impact']) && (($input['urgency'] != $this->fields['urgency']) || $input['impact'] != $this->fields['impact']) && !isset($input['priority'])) { $input['priority'] = self::computePriority($input['urgency'], $input['impact']); } // Security checks if (!Session::isCron() && !Session::haveRight("assign_ticket","1")) { if (isset($input["_itil_assign"]) && isset($input['_itil_assign']['_type']) && ($input['_itil_assign']['_type'] == 'user')) { // must own_ticket to grab a non assign ticket if ($this->countUsers(CommonITILActor::ASSIGN) == 0) { if ((!Session::haveRight("steal_ticket","1") && !Session::haveRight("own_ticket","1")) || !isset($input["_itil_assign"]['users_id']) || ($input["_itil_assign"]['users_id'] != Session::getLoginUserID())) { unset($input["_itil_assign"]); } } else { // Can not steal or can steal and not assign to me if (!Session::haveRight("steal_ticket","1") || !isset($input["_itil_assign"]['users_id']) || ($input["_itil_assign"]['users_id'] != Session::getLoginUserID())) { unset($input["_itil_assign"]); } } } // No supplier assign if (isset($input["_itil_assign"]) && isset($input['_itil_assign']['_type']) && ($input['_itil_assign']['_type'] == 'supplier')) { unset($input["_itil_assign"]); } // No group if (isset($input["_itil_assign"]) && isset($input['_itil_assign']['_type']) && ($input['_itil_assign']['_type'] == 'group')) { unset($input["_itil_assign"]); } } $check_allowed_fields_for_template = false; if (!Session::isCron() && !Session::haveRight("update_ticket","1")) { $allowed_fields = array('id'); $check_allowed_fields_for_template = true; if ($this->canApprove() && isset($input["status"])) { $allowed_fields[] = 'status'; } // for post-only with validate right or validation created by rules if (TicketValidation::canValidate($this->fields['id']) || TicketValidation::canCreate() || isset($input["_rule_process"])) { $allowed_fields[] = 'global_validation'; } // Manage assign and steal right if (Session::haveRight('assign_ticket',1) || Session::haveRight('steal_ticket',1)) { $allowed_fields[] = '_itil_assign'; } // Can only update initial fields if no followup or task already added if (($this->numberOfFollowups() == 0) && ($this->numberOfTasks() == 0) && $this->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID())) { $allowed_fields[] = 'content'; $allowed_fields[] = 'urgency'; $allowed_fields[] = 'priority'; // automatic recalculate if user changes urgence $allowed_fields[] = 'itilcategories_id'; $allowed_fields[] = 'itemtype'; $allowed_fields[] = 'items_id'; $allowed_fields[] = 'name'; } if ($this->canSolve()) { $allowed_fields[] = 'solutiontypes_id'; $allowed_fields[] = 'solution'; } foreach ($allowed_fields as $field) { if (isset($input[$field])) { $ret[$field] = $input[$field]; } } $input = $ret; } //// check mandatory fields // First get ticket template associated : entity and type/category if (isset($input['entities_id'])) { $entid = $input['entities_id']; } else { $entid = $this->fields['entities_id']; } if (isset($input['type'])) { $type = $input['type']; } else { $type = $this->fields['type']; } if (isset($input['itilcategories_id'])) { $categid = $input['itilcategories_id']; } else { $categid = $this->fields['itilcategories_id']; } $tt = $this->getTicketTemplateToUse(0, $type, $categid, $entid); if (count($tt->mandatory)) { $mandatory_missing = array(); $fieldsname = $tt->getAllowedFieldsNames(true); foreach ($tt->mandatory as $key => $val) { if ((!$check_allowed_fields_for_template || in_array($key,$allowed_fields)) && (isset($input[$key]) && (empty($input[$key]) || ($input[$key] == 'NULL')) // Take only into account already set items : do not block old tickets && (!empty($this->fields[$key])) )) { $mandatory_missing[$key] = $fieldsname[$val]; } } if (count($mandatory_missing)) { //TRANS: %s are the fields concerned $message = sprintf(__('Mandatory fields are not filled. Please correct: %s'), implode(", ",$mandatory_missing)); Session::addMessageAfterRedirect($message, false, ERROR); return false; } } // Manage fields from auto update : map rule actions to standard ones if (isset($input['_auto_update'])) { if (isset($input['_users_id_assign'])) { $input['_itil_assign']['_type'] = 'user'; $input['_itil_assign']['users_id'] = $input['_users_id_assign']; } if (isset($input['_groups_id_assign'])) { $input['_itil_assign']['_type'] = 'group'; $input['_itil_assign']['groups_id'] = $input['_groups_id_assign']; } if (isset($input['_suppliers_id_assign'])) { $input['_itil_assign']['_type'] = 'supplier'; $input['_itil_assign']['suppliers_id'] = $input['_suppliers_id_assign']; } if (isset($input['_users_id_requester'])) { $input['_itil_requester']['_type'] = 'user'; $input['_itil_requester']['users_id'] = $input['_users_id_requester']; } if (isset($input['_groups_id_requester'])) { $input['_itil_requester']['_type'] = 'group'; $input['_itil_requester']['groups_id'] = $input['_groups_id_requester']; } if (isset($input['_users_id_observer'])) { $input['_itil_observer']['_type'] = 'user'; $input['_itil_observer']['users_id'] = $input['_users_id_observer']; } if (isset($input['_groups_id_observer'])) { $input['_itil_observer']['_type'] = 'group'; $input['_itil_observer']['groups_id'] = $input['_groups_id_observer']; } } if (isset($input['_link'])) { $ticket_ticket = new Ticket_Ticket(); if (!empty($input['_link']['tickets_id_2'])) { if ($ticket_ticket->can(-1, 'w', $input['_link'])) { if ($ticket_ticket->add($input['_link'])) { $input['_forcenotif'] = true; } } else { Session::addMessageAfterRedirect(__('Unknown ticket'), false, ERROR); } } } if (isset($input["items_id"]) && ($input["items_id"] >= 0) && isset($input["itemtype"])) { if (isset($this->fields['groups_id']) && ($this->fields['groups_id'] == 0) && (!isset($input['groups_id']) || ($input['groups_id'] == 0))) { if ($input["itemtype"] && ($item = getItemForItemtype($input["itemtype"]))) { $item->getFromDB($input["items_id"]); if ($item->isField('groups_id')) { $input["groups_id"] = $item->getField('groups_id'); } } } } else if (isset($input["itemtype"]) && empty($input["itemtype"])) { $input["items_id"] = 0; } else { unset($input["items_id"]); unset($input["itemtype"]); } //Action for send_validation rule if (isset($this->input["_add_validation"]) && ($this->input["_add_validation"] > 0)) { $validation = new TicketValidation(); // if auto_update, tranfert it for validation if (isset($this->input['_auto_update'])) { $values['_auto_update'] = $this->input['_auto_update']; } $values['tickets_id'] = $this->input['id']; $values['users_id_validate'] = $this->input["_add_validation"]; if (Session::isCron() || $validation->can(-1, 'w', $values)) { // cron or allowed user $validation->add($values); Event::log($this->fields['id'], "ticket", 4, "tracking", sprintf(__('%1$s updates the item %2$s'), (is_numeric(Session::getLoginUserID(false))?$_SESSION["glpiname"] :'cron'), $this->fields['id'])); } } if (isset($this->input["slas_id"]) && ($this->input["slas_id"] > 0) && ($this->fields['slas_id'] == 0)) { $date = $this->fields['date']; /// Use updated date if also done if (isset($this->input["date"])) { $date = $this->input["date"]; } // Get datas to initialize SLA and set it $sla_data = $this->getDatasToAddSLA($this->input["slas_id"], $this->fields['entities_id'], $date); if (count($sla_data)) { foreach ($sla_data as $key => $val) { $input[$key] = $val; } } } $input = parent::prepareInputForUpdate($input); return $input; } function pre_updateInDB() { // takeintoaccount : // - update done by someone who have update right // see also updatedatemod used by ticketfollowup updates if (($this->fields['takeintoaccount_delay_stat'] == 0) && (Session::haveRight("global_add_tasks", "1") || Session::haveRight("global_add_followups", "1") || $this->isUser(CommonITILActor::ASSIGN, Session::getLoginUserID()) || (isset($_SESSION["glpigroups"]) && $this->haveAGroup(CommonITILActor::ASSIGN, $_SESSION['glpigroups'])))) { $this->updates[] = "takeintoaccount_delay_stat"; $this->fields['takeintoaccount_delay_stat'] = $this->computeTakeIntoAccountDelayStat(); } parent::pre_updateInDB(); } /// Compute take into account stat of the current ticket function computeTakeIntoAccountDelayStat() { if (isset($this->fields['id']) && !empty($this->fields['date'])) { $calendars_id = Entity::getUsedConfig('calendars_id', $this->fields['entities_id']); $calendar = new Calendar(); // Using calendar if (($calendars_id > 0) && $calendar->getFromDB($calendars_id)) { return max(0, $calendar->getActiveTimeBetween($this->fields['date'], $_SESSION["glpi_currenttime"])); } // Not calendar defined return max(0, strtotime($_SESSION["glpi_currenttime"])-strtotime($this->fields['date'])); } return 0; } function post_updateItem($history=1) { global $CFG_GLPI; $donotif = count($this->updates); if (isset($this->input['_forcenotif'])) { $donotif = true; } // Manage SLA Level : add actions if (in_array("slas_id", $this->updates) && ($this->fields["slas_id"] > 0)) { // Add First Level $calendars_id = Entity::getUsedConfig('calendars_id', $this->fields['entities_id']); $sla = new SLA(); if ($sla->getFromDB($this->fields["slas_id"])) { $sla->setTicketCalendar($calendars_id); // Add first level in working table if ($this->fields["slalevels_id"] > 0) { $sla->addLevelToDo($this); } } SlaLevel_Ticket::replayForTicket($this->getID()); } if (count($this->updates)) { // Update Ticket Tco if (in_array("actiontime", $this->updates) || in_array("cost_time", $this->updates) || in_array("cost_fixed", $this->updates) || in_array("cost_material", $this->updates)) { if ($this->fields["itemtype"] && ($item = getItemForItemtype($this->fields["itemtype"]))) { if ($item->getFromDB($this->fields["items_id"])) { $newinput = array(); $newinput['id'] = $this->fields["items_id"]; $newinput['ticket_tco'] = self::computeTco($item); $item->update($newinput); } } } // Setting a solution type means the ticket is solved if ((in_array("solutiontypes_id", $this->updates) || in_array("solution", $this->updates)) && (in_array($this->input["status"], $this->getSolvedStatusArray()) || in_array($this->input["status"], $this->getClosedStatusArray()))) { // auto close case Ticket_Ticket::manageLinkedTicketsOnSolved($this->fields['id']); } // Clean content to mail $this->fields["content"] = stripslashes($this->fields["content"]); $donotif = true; } if (isset($this->input['_disablenotif'])) { $donotif = false; } if ($donotif && $CFG_GLPI["use_mailing"]) { $mailtype = "update"; if (isset($this->input["status"]) && $this->input["status"] && in_array("status", $this->updates) && in_array($this->input["status"], $this->getSolvedStatusArray())) { $mailtype = "solved"; } if (isset($this->input["status"]) && $this->input["status"] && in_array("status",$this->updates) && in_array($this->input["status"], $this->getClosedStatusArray())) { $mailtype = "closed"; } // Read again ticket to be sure that all data are up to date $this->getFromDB($this->fields['id']); NotificationEvent::raiseEvent($mailtype, $this); } // inquest created immediatly if delay = O $inquest = new TicketSatisfaction(); $rate = Entity::getUsedConfig('inquest_config', $this->fields['entities_id'], 'inquest_rate'); $delay = Entity::getUsedConfig('inquest_config', $this->fields['entities_id'], 'inquest_delay'); $type = Entity::getUsedConfig('inquest_config', $this->fields['entities_id']); $max_closedate = $this->fields['closedate']; if (in_array("status",$this->updates) && in_array($this->input["status"], $this->getClosedStatusArray()) && ($delay == 0) && ($rate > 0) && (mt_rand(1,100) <= $rate)) { $inquest->add(array('tickets_id' => $this->fields['id'], 'date_begin' => $_SESSION["glpi_currenttime"], 'entities_id' => $this->fields['entities_id'], 'type' => $type, 'max_closedate' => $max_closedate)); } } function prepareInputForAdd($input) { global $CFG_GLPI; // save value before clean; $title = ltrim($input['name']); // Standard clean datas $input = parent::prepareInputForAdd($input); // Do not check mandatory on auto import (mailgates) if (!isset($input['_auto_import'])) { if (isset($input['_tickettemplates_id']) && $input['_tickettemplates_id']) { $tt = new TicketTemplate(); if ($tt->getFromDBWithDatas($input['_tickettemplates_id'])) { if (count($tt->mandatory)) { $mandatory_missing = array(); $fieldsname = $tt->getAllowedFieldsNames(true); foreach ($tt->mandatory as $key => $val) { // for title if mandatory (restore initial value) if ($key == 'name') { $input['name'] = $title; } // Check only defined values : Not defined not in form if (isset($input[$key])) { // If content is also predefined need to be different from predefined value if (($key == 'content') && isset($tt->predefined['content'])) { // Clean new lines to be fix encoding if (strcmp(preg_replace("/\r?\n/", "", Html::cleanPostForTextArea($input[$key])), preg_replace("/\r?\n/", "", $tt->predefined['content'])) == 0) { $mandatory_missing[$key] = $fieldsname[$val]; } } if (empty($input[$key]) || ($input[$key] == 'NULL')) { $mandatory_missing[$key] = $fieldsname[$val]; } } // For due_date : check also slas_id if ($key == 'due_date' && isset($input['slas_id']) && ($input['slas_id'] > 0) && isset($mandatory_missing['due_date'])) { unset($mandatory_missing['due_date']); } } if (count($mandatory_missing)) { //TRANS: %s are the fields concerned $message = sprintf(__('Mandatory fields are not filled. Please correct: %s'), implode(", ",$mandatory_missing)); Session::addMessageAfterRedirect($message, false, ERROR); return false; } } } } } if (!isset($input["requesttypes_id"])) { $input["requesttypes_id"] = RequestType::getDefault('helpdesk'); } if (!isset($input['global_validation'])) { $input['global_validation'] = 'none'; } // Set additional default dropdown $dropdown_fields = array('items_id', 'items_locations', 'users_locations'); foreach ($dropdown_fields as $field ) { if (!isset($input[$field])) { $input[$field] = 0; } } if (!isset($input['itemtype']) || !($input['items_id'] > 0)) { $input['itemtype'] = ''; } $item = NULL; if (($input["items_id"] > 0) && !empty($input["itemtype"])) { if ($item = getItemForItemtype($input["itemtype"])) { if ($item->getFromDB($input["items_id"])) { if ($item->isField('locations_id')) { $input['items_locations'] = $item->fields['locations_id']; } } else { $item = NULL; } } } // Business Rules do not override manual SLA $manual_slas_id = 0; if (isset($input['slas_id']) && ($input['slas_id'] > 0)) { $manual_slas_id = $input['slas_id']; } // Process Business Rules $rules = new RuleTicketCollection($input['entities_id']); // Set unset variables with are needed $user = new User(); if (isset($input["_users_id_requester"]) && $user->getFromDB($input["_users_id_requester"])) { $input['users_locations'] = $user->fields['locations_id']; $tmprequester = $input["_users_id_requester"]; } else { $tmprequester = 0; } // Clean new lines before passing to rules if (isset($input["content"])) { $input["content"] = preg_replace('/\\\\r\\\\n/',"\n",$input['content']); $input["content"] = preg_replace('/\\\\n/',"\n",$input['content']); } $input = $rules->processAllRules(Toolbox::stripslashes_deep($input), Toolbox::stripslashes_deep($input), array('recursive' => true)); // Recompute default values based on values computed by rules $input = $this->computeDefaultValuesForAdd($input); if (isset($input['_users_id_requester']) && ($input['_users_id_requester'] != $tmprequester)) { // if requester set by rule, clear address from mailcollector unset($input['_users_id_requester_notif']); } // Restore slas_id if ($manual_slas_id > 0) { $input['slas_id'] = $manual_slas_id; } // Manage auto assign $auto_assign_mode = Entity::getUsedConfig('auto_assign_mode', $input['entities_id']); switch ($auto_assign_mode) { case Entity::CONFIG_NEVER : break; case Entity::AUTO_ASSIGN_HARDWARE_CATEGORY : if ($item != NULL) { // Auto assign tech from item if ((!isset($input['_users_id_assign']) || ($input['_users_id_assign'] == 0)) && $item->isField('users_id_tech')) { $input['_users_id_assign'] = $item->getField('users_id_tech'); } // Auto assign group from item if ((!isset($input['_groups_id_assign']) || ($input['_groups_id_assign'] == 0)) && $item->isField('groups_id_tech')) { $input['_groups_id_assign'] = $item->getField('groups_id_tech'); } } // Auto assign tech/group from Category if (($input['itilcategories_id'] > 0) && ((!isset($input['_users_id_assign']) || !$input['_users_id_assign']) || (!isset($input['_groups_id_assign']) || !$input['_groups_id_assign']))) { $cat = new ITILCategory(); $cat->getFromDB($input['itilcategories_id']); if ((!isset($input['_users_id_assign']) || !$input['_users_id_assign']) && $cat->isField('users_id')) { $input['_users_id_assign'] = $cat->getField('users_id'); } if ((!isset($input['_groups_id_assign']) || !$input['_groups_id_assign']) && $cat->isField('groups_id')) { $input['_groups_id_assign'] = $cat->getField('groups_id'); } } break; case Entity::AUTO_ASSIGN_CATEGORY_HARDWARE : // Auto assign tech/group from Category if (($input['itilcategories_id'] > 0) && ((!isset($input['_users_id_assign']) || !$input['_users_id_assign']) || (!isset($input['_groups_id_assign']) || !$input['_groups_id_assign']))) { $cat = new ITILCategory(); $cat->getFromDB($input['itilcategories_id']); if ((!isset($input['_users_id_assign']) || !$input['_users_id_assign']) && $cat->isField('users_id')) { $input['_users_id_assign'] = $cat->getField('users_id'); } if ((!isset($input['_groups_id_assign']) || !$input['_groups_id_assign']) && $cat->isField('groups_id')) { $input['_groups_id_assign'] = $cat->getField('groups_id'); } } if ($item != NULL) { // Auto assign tech from item if ((!isset($input['_users_id_assign']) || ($input['_users_id_assign'] == 0)) && $item->isField('users_id_tech')) { $input['_users_id_assign'] = $item->getField('users_id_tech'); } // Auto assign group from item if ((!isset($input['_groups_id_assign']) || ($input['_groups_id_assign'] == 0)) && $item->isField('groups_id_tech')) { $input['_groups_id_assign'] = $item->getField('groups_id_tech'); } } break; } // Replay setting auto assign if set in rules engine or by auto_assign_mode if (((isset($input["_users_id_assign"]) && ($input["_users_id_assign"] > 0)) || (isset($input["_groups_id_assign"]) && ($input["_groups_id_assign"] > 0)) || (isset($input["_suppliers_id_assign"]) && ($input["_suppliers_id_assign"] > 0))) && (in_array($input['status'], $this->getNewStatusArray()))) { $input["status"] = self::ASSIGNED; } //// Manage SLA assignment // Manual SLA defined : reset due date // No manual SLA and due date defined : reset auto SLA if (($manual_slas_id == 0) && isset($input["due_date"]) && ($input['due_date'] != 'NULL')) { // Valid due date if ($input['due_date'] > $input['date']) { if (isset($input["slas_id"])) { unset($input["slas_id"]); } } else { // Unset due date unset($input["due_date"]); } } if (isset($input["slas_id"]) && ($input["slas_id"] > 0)) { // Get datas to initialize SLA and set it $sla_data = $this->getDatasToAddSLA($input["slas_id"], $input['entities_id'], $input['date']); if (count($sla_data)) { foreach ($sla_data as $key => $val) { $input[$key] = $val; } } } // auto set type if not set if (!isset($input["type"])) { $input['type'] = Entity::getUsedConfig('tickettype', $input['entities_id'], '', Ticket::INCIDENT_TYPE); } return $input; } function post_addItem() { global $CFG_GLPI; // Log this event $username = 'anonymous'; if (isset($_SESSION["glpiname"])) { $username = $_SESSION["glpiname"]; } Event::log($this->fields['id'], "ticket", 4, "tracking", sprintf(__('%1$s adds the item %2$s'), $username, $this->fields['id'])); if (isset($this->input["_followup"]) && is_array($this->input["_followup"]) && (strlen($this->input["_followup"]['content']) > 0)) { $fup = new TicketFollowup(); $type = "new"; if (isset($this->fields["status"]) && ($this->fields["status"] == self::SOLVED)) { $type = "solved"; } $toadd = array("type" => $type, "tickets_id" => $this->fields['id']); if (isset($this->input["_followup"]['content']) && (strlen($this->input["_followup"]['content']) > 0)) { $toadd["content"] = $this->input["_followup"]['content']; } if (isset($this->input["_followup"]['is_private'])) { $toadd["is_private"] = $this->input["_followup"]['is_private']; } $toadd['_no_notif'] = true; $fup->add($toadd); } if ((isset($this->input["plan"]) && count($this->input["plan"])) || (isset($this->input["actiontime"]) && ($this->input["actiontime"] > 0))) { $task = new TicketTask(); $type = "new"; if (isset($this->fields["status"]) && ($this->fields["status"] == self::SOLVED)) { $type = "solved"; } $toadd = array("type" => $type, "tickets_id" => $this->fields['id'], "actiontime" => $this->input["actiontime"]); if (isset($this->input["plan"]) && count($this->input["plan"])) { $toadd["plan"] = $this->input["plan"]; } if (isset($_SESSION['glpitask_private'])) { $toadd['is_private'] = $_SESSION['glpitask_private']; } $toadd['_no_notif'] = true; $task->add($toadd); } $ticket_ticket = new Ticket_Ticket(); // From interface if (isset($this->input['_link'])) { $this->input['_link']['tickets_id_1'] = $this->fields['id']; // message if ticket's ID doesn't exist if (!empty($this->input['_link']['tickets_id_2'])) { if ($ticket_ticket->can(-1, 'w', $this->input['_link'])) { $ticket_ticket->add($this->input['_link']); } else { Session::addMessageAfterRedirect(__('Unknown ticket'), false, ERROR); } } } // From mailcollector : do not check rights if (isset($this->input["_linkedto"])) { $input2['tickets_id_1'] = $this->fields['id']; $input2['tickets_id_2'] = $this->input["_linkedto"]; $input2['link'] = Ticket_Ticket::LINK_TO; $ticket_ticket->add($input2); } // Manage SLA Level : add actions if (isset($this->input["slas_id"]) && ($this->input["slas_id"] > 0) && isset($this->input["slalevels_id"]) && ($this->input["slalevels_id"] > 0)) { $calendars_id = Entity::getUsedConfig('calendars_id', $this->fields['entities_id']); $sla = new SLA(); if ($sla->getFromDB($this->input["slas_id"])) { $sla->setTicketCalendar($calendars_id); // Add first level in working table if ($this->input["slalevels_id"] > 0) { $sla->addLevelToDo($this); } // Replay action in case of open date is set before now } SlaLevel_Ticket::replayForTicket($this->getID()); } parent::post_addItem(); //Action for send_validation rule if (isset($this->input["_add_validation"])) { $validations_to_send = array(); if (!is_array($this->input["_add_validation"])) { $this->input["_add_validation"] = array($this->input["_add_validation"]); } foreach ($this->input["_add_validation"] as $validation) { switch ($validation) { case 'requester_supervisor' : if (isset($this->input['_groups_id_requester']) && $this->input['_groups_id_requester']) { $users = Group_User::getGroupUsers($this->input['_groups_id_requester'], "is_manager='1'"); foreach ($users as $data) { $validations_to_send[] = $data['id']; } } break; case 'assign_supervisor' : if (isset($this->input['_groups_id_assign']) && $this->input['_groups_id_assign']) { $users = Group_User::getGroupUsers($this->input['_groups_id_assign'], "is_manager='1'"); foreach ($users as $data) { $validations_to_send[] = $data['id']; } } break; default : $validations_to_send[] = $validation; } } // Keep only one $validations_to_send = array_unique($validations_to_send); $validation = new TicketValidation(); foreach ($validations_to_send as $users_id) { if ($users_id > 0) { $values = array(); $values['tickets_id'] = $this->fields['id']; $values['users_id_validate'] = $users_id; $values['_ticket_add'] = true; // to know update by rules if (isset($this->input["_rule_process"])) { $values['_rule_process'] = $this->input["_rule_process"]; } // if auto_import, tranfert it for validation if (isset($this->input['_auto_import'])) { $values['_auto_import'] = $this->input['_auto_import']; } // Cron or rule process of hability to do if (Session::isCron() || isset($this->input["_auto_import"]) || isset($this->input["_rule_process"]) || $validation->can(-1, 'w', $values)) { // cron or allowed user $validation->add($values); Event::log($this->fields['id'], "ticket", 4, "tracking", sprintf(__('%1$s updates the item %2$s'), $_SESSION["glpiname"], $this->fields['id'])); } } } } // Processing Email if ($CFG_GLPI["use_mailing"]) { // Clean reload of the ticket $this->getFromDB($this->fields['id']); $type = "new"; if (isset($this->fields["status"]) && ($this->fields["status"] == self::SOLVED)) { $type = "solved"; } NotificationEvent::raiseEvent($type, $this); } if (isset($_SESSION['glpiis_ids_visible']) && !$_SESSION['glpiis_ids_visible']) { Session::addMessageAfterRedirect(sprintf(__('%1$s (%2$s)'), __('Your ticket has been registered, its treatment is in progress.'), sprintf(__('%1$s: %2$s'), __('Ticket'), "". $this->fields['id'].""))); } } // SPECIFIC FUNCTIONS /** * Number of followups of the ticket * * @param $with_private boolean : true : all followups / false : only public ones (default 1) * * @return followup count **/ function numberOfFollowups($with_private=1) { global $DB; $RESTRICT = ""; if ($with_private!=1) { $RESTRICT = " AND `is_private` = '0'"; } // Set number of followups $query = "SELECT COUNT(*) FROM `glpi_ticketfollowups` WHERE `tickets_id` = '".$this->fields["id"]."' $RESTRICT"; $result = $DB->query($query); return $DB->result($result, 0, 0); } /** * Number of tasks of the ticket * * @param $with_private boolean : true : all ticket / false : only public ones (default 1) * * @return followup count **/ function numberOfTasks($with_private=1) { global $DB; $RESTRICT = ""; if ($with_private!=1) { $RESTRICT = " AND `is_private` = '0'"; } // Set number of followups $query = "SELECT COUNT(*) FROM `glpi_tickettasks` WHERE `tickets_id` = '".$this->fields["id"]."' $RESTRICT"; $result = $DB->query($query); return $DB->result($result, 0, 0); } /** * Get active or solved tickets for an hardware last X days * * @since version 0.83 * * @param $itemtype string Item type * @param $items_id integer ID of the Item * @param $days integer day number * * @return integer **/ function getActiveOrSolvedLastDaysTicketsForItem($itemtype, $items_id, $days) { global $DB; $result = array(); $query = "SELECT * FROM `".$this->getTable()."` WHERE `".$this->getTable()."`.`itemtype` = '$itemtype' AND `".$this->getTable()."`.`items_id` = '$items_id' AND (`".$this->getTable()."`.`status` NOT IN ('".implode("', '", array_merge($this->getSolvedStatusArray(), $this->getClosedStatusArray()) )."') OR (`".$this->getTable()."`.`solvedate` IS NOT NULL AND ADDDATE(`".$this->getTable()."`.`solvedate`, INTERVAL $days DAY) > NOW()))"; foreach ($DB->request($query) as $tick) { $result[$tick['id']] = $tick['name']; } return $result; } /** * Count active tickets for an hardware * * @since version 0.83 * * @param $itemtype string Item type * @param $items_id integer ID of the Item * * @return integer **/ function countActiveTicketsForItem($itemtype, $items_id) { return countElementsInTable($this->getTable(), "`".$this->getTable()."`.`itemtype` = '$itemtype' AND `".$this->getTable()."`.`items_id` = '$items_id' AND `".$this->getTable()."`.`status` NOT IN ('".implode("', '", array_merge($this->getSolvedStatusArray(), $this->getClosedStatusArray()) )."')"); } /** * Count solved tickets for an hardware last X days * * @since version 0.83 * * @param $itemtype string Item type * @param $items_id integer ID of the Item * @param $days integer day number * * @return integer **/ function countSolvedTicketsForItemLastDays($itemtype, $items_id, $days) { return countElementsInTable($this->getTable(), "`".$this->getTable()."`.`itemtype` = '$itemtype' AND `".$this->getTable()."`.`items_id` = '$items_id' AND `".$this->getTable()."`.`solvedate` IS NOT NULL AND ADDDATE(`".$this->getTable()."`.`solvedate`, INTERVAL $days DAY) > NOW() AND `".$this->getTable()."`.`status` IN ('".implode("', '", array_merge($this->getSolvedStatusArray(), $this->getClosedStatusArray()) )."')"); } /** * Update date mod of the ticket * * @since version 0.83.3 new proto * * @param $ID ID of the ticket * @param $no_stat_computation boolean do not cumpute take into account stat (false by default) * @param $users_id_lastupdater integer to force last_update id (default 0 = not used) **/ function updateDateMod($ID, $no_stat_computation=false, $users_id_lastupdater=0) { global $DB; if ($this->getFromDB($ID)) { if (!$no_stat_computation && (Session::haveRight("global_add_tasks", "1") || Session::haveRight("global_add_followups", "1") || $this->isUser(CommonITILActor::ASSIGN, Session::getLoginUserID()) || (isset($_SESSION["glpigroups"]) && $this->haveAGroup(CommonITILActor::ASSIGN, $_SESSION['glpigroups'])))) { if ($this->fields['takeintoaccount_delay_stat'] == 0) { return $this->update(array('id' => $ID, 'takeintoaccount_delay_stat' => $this->computeTakeIntoAccountDelayStat(), '_disablenotif' => true)); } } parent::updateDateMod($ID, $no_stat_computation, $users_id_lastupdater); } } /** * Overloaded from commonDBTM * * @since version 0.83 * * @param $type itemtype of object to add * * @return rights **/ function canAddItem($type) { if (($type == 'Document') && ($this->getField('status') == self::CLOSED)) { return false; } return parent::canAddItem($type); } /** * Is the current user have right to add followups to the current ticket ? * * @return boolean **/ function canAddFollowups() { return ((Session::haveRight("add_followups","1") && ($this->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID()) || ($this->fields["users_id_recipient"] === Session::getLoginUserID()))) || Session::haveRight("global_add_followups","1") || (Session::haveRight("group_add_followups","1") && isset($_SESSION["glpigroups"]) && $this->haveAGroup(CommonITILActor::REQUESTER, $_SESSION['glpigroups'])) || $this->isUser(CommonITILActor::ASSIGN, Session::getLoginUserID()) || (isset($_SESSION["glpigroups"]) && $this->haveAGroup(CommonITILActor::ASSIGN, $_SESSION['glpigroups']))); } /** * Get default values to search engine to override **/ static function getDefaultSearchRequest() { $search = array('field' => array(0 => 12), 'searchtype' => array(0 => 'equals'), 'contains' => array(0 => 'notclosed'), 'sort' => 19, 'order' => 'DESC'); if (Session::haveRight('show_all_ticket', 1)) { $search['contains'] = array(0 => 'notold'); } return $search; } /** * @see CommonDBTM::getSpecificMassiveActions() **/ function getSpecificMassiveActions($checkitem=NULL) { $isadmin = static::canUpdate(); $actions = parent::getSpecificMassiveActions($checkitem); if (TicketFollowup::canCreate() && ($_SESSION['glpiactiveprofile']['interface'] == 'central')) { $actions['add_followup'] = __('Add a new followup'); } if (TicketTask::canCreate()) { $actions['add_task'] = __('Add a new task'); } if (TicketValidation::canCreate()) { $actions['submit_validation'] = __('Approval request'); } if (Session::haveRight("update_ticket","1")) { $actions['add_actor'] = __('Add an actor'); $actions['link_ticket'] = _x('button', 'Link tickets'); } if (Session::haveRight('transfer','r') && Session::isMultiEntitiesMode() && Session::haveRight("update_ticket","1")) { $actions['add_transfer_list'] = _x('button', 'Add to transfer list'); } return $actions; } /** * @see CommonDBTM::showSpecificMassiveActionsParameters() **/ function showSpecificMassiveActionsParameters($input=array()) { switch ($input['action']) { case "add_followup" : TicketFollowup::showFormMassiveAction(); return true; case "link_ticket" : $rand = Ticket_Ticket::dropdownLinks('link'); printf(__('%1$s: %2$s'), __('Ticket'), __('ID')); echo " \n"; echo "

    "; return true; case "submit_validation" : TicketValidation::showFormMassiveAction(); return true; default : return parent::showSpecificMassiveActionsParameters($input); } return false; } /** * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "link_ticket" : if (isset($input['link']) && isset($input['tickets_id_1'])) { if ($this->getFromDB($input['tickets_id_1'])) { foreach ($input["item"] as $key => $val) { if ($val == 1) { $input2 = array(); $input2['id'] = $input['tickets_id_1']; $input2['_link']['tickets_id_1'] = $input['tickets_id_1']; $input2['_link']['link'] = $input['link']; $input2['_link']['tickets_id_2'] = $key; if ($this->can($input['tickets_id_1'],'w')) { if ($this->update($input2)) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } } } } break; case "submit_validation" : $valid = new TicketValidation(); foreach ($input["item"] as $key => $val) { if ($val == 1) { $input2 = array('tickets_id' => $key, 'users_id_validate' => $input['users_id_validate'], 'comment_submission' => $input['comment_submission']); if ($valid->can(-1,'w',$input2)) { if ($valid->add($input2)) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } } break; case "add_followup" : $fup = new TicketFollowup(); foreach ($input["item"] as $key => $val) { if ($val == 1) { $input2 = array('tickets_id' => $key, 'is_private' => $input['is_private'], 'requesttypes_id' => $input['requesttypes_id'], 'content' => $input['content']); if ($fup->can(-1,'w',$input2)) { if ($fup->add($input2)) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } } break; default : return parent::doSpecificMassiveActions($input); } return $res; } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Title'); $tab[1]['searchtype'] = 'contains'; $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[21]['table'] = $this->getTable(); $tab[21]['field'] = 'content'; $tab[21]['name'] = __('Description'); $tab[21]['massiveaction'] = false; $tab[21]['datatype'] = 'text'; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab[12]['table'] = $this->getTable(); $tab[12]['field'] = 'status'; $tab[12]['name'] = __('Status'); $tab[12]['searchtype'] = 'equals'; $tab[12]['datatype'] = 'specific'; $tab[14]['table'] = $this->getTable(); $tab[14]['field'] = 'type'; $tab[14]['name'] = __('Type'); $tab[14]['searchtype'] = 'equals'; $tab[14]['datatype'] = 'specific'; $tab[10]['table'] = $this->getTable(); $tab[10]['field'] = 'urgency'; $tab[10]['name'] = __('Urgency'); $tab[10]['searchtype'] = 'equals'; $tab[10]['datatype'] = 'specific'; $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'impact'; $tab[11]['name'] = __('Impact'); $tab[11]['searchtype'] = 'equals'; $tab[11]['datatype'] = 'specific'; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'priority'; $tab[3]['name'] = __('Priority'); $tab[3]['searchtype'] = 'equals'; $tab[3]['datatype'] = 'specific'; $tab[15]['table'] = $this->getTable(); $tab[15]['field'] = 'date'; $tab[15]['name'] = __('Opening date'); $tab[15]['datatype'] = 'datetime'; $tab[15]['massiveaction'] = false; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'closedate'; $tab[16]['name'] = __('Closing date'); $tab[16]['datatype'] = 'datetime'; $tab[16]['massiveaction'] = false; $tab[18]['table'] = $this->getTable(); $tab[18]['field'] = 'due_date'; $tab[18]['name'] = __('Due date'); $tab[18]['datatype'] = 'datetime'; $tab[18]['maybefuture'] = true; $tab[18]['massiveaction'] = false; $tab[151]['table'] = $this->getTable(); $tab[151]['field'] = 'due_date'; $tab[151]['name'] = __('Due date + Progress'); $tab[151]['massiveaction'] = false; $tab[151]['nosearch'] = true; $tab[82]['table'] = $this->getTable(); $tab[82]['field'] = 'is_late'; $tab[82]['name'] = __('Late'); $tab[82]['datatype'] = 'bool'; $tab[82]['massiveaction'] = false; $tab[17]['table'] = $this->getTable(); $tab[17]['field'] = 'solvedate'; $tab[17]['name'] = __('Resolution date'); $tab[17]['datatype'] = 'datetime'; $tab[17]['massiveaction'] = false; $tab[19]['table'] = $this->getTable(); $tab[19]['field'] = 'date_mod'; $tab[19]['name'] = __('Last update'); $tab[19]['datatype'] = 'datetime'; $tab[19]['massiveaction'] = false; $tab[7]['table'] = 'glpi_itilcategories'; $tab[7]['field'] = 'completename'; $tab[7]['name'] = __('Category'); $tab[7]['datatype'] = 'dropdown'; if (!Session::isCron() // no filter for cron && isset($_SESSION['glpiactiveprofile']['interface']) && $_SESSION['glpiactiveprofile']['interface'] == 'helpdesk') { $tab[7]['condition'] = "`is_helpdeskvisible`='1'"; } $tab[13]['table'] = $this->getTable(); $tab[13]['field'] = 'items_id'; $tab[13]['name'] = __('Associated element'); $tab[13]['datatype'] = 'specific'; $tab[13]['nosearch'] = true; $tab[13]['nosort'] = true; $tab[13]['massiveaction'] = false; $tab[13]['additionalfields'] = array('itemtype'); $tab[131]['table'] = $this->getTable(); $tab[131]['field'] = 'itemtype'; $tab[131]['name'] = __('Associated item type'); $tab[131]['datatype'] = 'itemtypename'; $tab[131]['itemtype_list'] = 'ticket_types'; $tab[131]['nosort'] = true; $tab[131]['massiveaction'] = false; $tab[9]['table'] = 'glpi_requesttypes'; $tab[9]['field'] = 'name'; $tab[9]['name'] = __('Request source'); $tab[9]['datatype'] = 'dropdown'; // Can't use Location::getSearchOptionsToAdd because id conflicts $tab[83]['table'] = 'glpi_locations'; $tab[83]['field'] = 'completename'; $tab[83]['name'] = __('Location'); $tab[83]['datatype'] = 'dropdown'; $tab[80]['table'] = 'glpi_entities'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = __('Entity'); $tab[80]['massiveaction'] = false; $tab[80]['datatype'] = 'dropdown'; $tab[45]['table'] = $this->getTable(); $tab[45]['field'] = 'actiontime'; $tab[45]['name'] = __('Total duration'); $tab[45]['datatype'] = 'timestamp'; $tab[45]['withdays'] = false; $tab[45]['massiveaction'] = false; $tab[45]['nosearch'] = true; $tab[64]['table'] = 'glpi_users'; $tab[64]['field'] = 'name'; $tab[64]['linkfield'] = 'users_id_lastupdater'; $tab[64]['name'] = __('Last updater'); $tab[64]['massiveaction'] = false; $tab[64]['datatype'] = 'dropdown'; $tab[64]['right'] = 'all'; $tab += $this->getSearchOptionsActors(); $tab['sla'] = __('SLA'); $tab[30]['table'] = 'glpi_slas'; $tab[30]['field'] = 'name'; $tab[30]['name'] = __('SLA'); $tab[30]['massiveaction'] = false; $tab[30]['datatype'] = 'dropdown'; $tab[32]['table'] = 'glpi_slalevels'; $tab[32]['field'] = 'name'; $tab[32]['name'] = __('Escalation level'); $tab[32]['massiveaction'] = false; $tab[32]['datatype'] = 'dropdown'; $tab['validation'] = __('Approval'); $tab[52]['table'] = $this->getTable(); $tab[52]['field'] = 'global_validation'; $tab[52]['name'] = __('Approval'); $tab[52]['searchtype'] = 'equals'; $tab[52]['datatype'] = 'specific'; $tab[53]['table'] = 'glpi_ticketvalidations'; $tab[53]['field'] = 'comment_submission'; $tab[53]['name'] = sprintf(__('%1$s: %2$s'), __('Request'), __('Comments')); $tab[53]['datatype'] = 'text'; $tab[53]['forcegroupby'] = true; $tab[53]['massiveaction'] = false; $tab[53]['joinparams'] = array('jointype' => 'child'); $tab[54]['table'] = 'glpi_ticketvalidations'; $tab[54]['field'] = 'comment_validation'; $tab[54]['name'] = sprintf(__('%1$s: %2$s'), __('Approval'), __('Comments')); $tab[54]['datatype'] = 'text'; $tab[54]['forcegroupby'] = true; $tab[54]['massiveaction'] = false; $tab[54]['joinparams'] = array('jointype' => 'child'); $tab[55]['table'] = 'glpi_ticketvalidations'; $tab[55]['field'] = 'status'; $tab[55]['datatype'] = 'specific'; $tab[55]['name'] = sprintf(__('%1$s: %2$s'), __('Approval'), __('Status')); $tab[55]['searchtype'] = 'equals'; $tab[55]['forcegroupby'] = true; $tab[55]['massiveaction'] = false; $tab[55]['joinparams'] = array('jointype' => 'child'); $tab[56]['table'] = 'glpi_ticketvalidations'; $tab[56]['field'] = 'submission_date'; $tab[56]['name'] = sprintf(__('%1$s: %2$s'), __('Request'), __('Date')); $tab[56]['datatype'] = 'datetime'; $tab[56]['forcegroupby'] = true; $tab[56]['massiveaction'] = false; $tab[56]['joinparams'] = array('jointype' => 'child'); $tab[57]['table'] = 'glpi_ticketvalidations'; $tab[57]['field'] = 'validation_date'; $tab[57]['name'] = sprintf(__('%1$s: %2$s'), __('Approval'), __('Date')); $tab[57]['datatype'] = 'datetime'; $tab[57]['forcegroupby'] = true; $tab[57]['massiveaction'] = false; $tab[57]['joinparams'] = array('jointype' => 'child'); $tab[58]['table'] = 'glpi_users'; $tab[58]['field'] = 'name'; $tab[58]['name'] = __('Requester'); $tab[58]['datatype'] = 'itemlink'; $tab[58]['right'] = array('create_incident_validation', 'create_request_validation'); $tab[58]['forcegroupby'] = true; $tab[58]['massiveaction'] = false; $tab[58]['joinparams'] = array('beforejoin' => array('table' => 'glpi_ticketvalidations', 'joinparams' => array('jointype' => 'child'))); $tab[59]['table'] = 'glpi_users'; $tab[59]['field'] = 'name'; $tab[59]['linkfield'] = 'users_id_validate'; $tab[59]['name'] = __('Approver'); $tab[59]['datatype'] = 'itemlink'; $tab[59]['right'] = array('validate_request', 'validate_incident'); $tab[59]['forcegroupby'] = true; $tab[59]['massiveaction'] = false; $tab[59]['joinparams'] = array('beforejoin' => array('table' => 'glpi_ticketvalidations', 'joinparams' => array('jointype' => 'child'))); $tab['satisfaction'] = __('Satisfaction survey'); $tab[31]['table'] = 'glpi_ticketsatisfactions'; $tab[31]['field'] = 'type'; $tab[31]['name'] = __('Type'); $tab[31]['massiveaction'] = false; $tab[31]['searchtype'] = 'equals'; $tab[31]['joinparams'] = array('jointype' => 'child'); $tab[31]['datatype'] = 'specific'; $tab[60]['table'] = 'glpi_ticketsatisfactions'; $tab[60]['field'] = 'date_begin'; $tab[60]['name'] = __('Creation date'); $tab[60]['datatype'] = 'datetime'; $tab[60]['massiveaction'] = false; $tab[60]['joinparams'] = array('jointype' => 'child'); $tab[61]['table'] = 'glpi_ticketsatisfactions'; $tab[61]['field'] = 'date_answered'; $tab[61]['name'] = __('Response date'); $tab[61]['datatype'] = 'datetime'; $tab[61]['massiveaction'] = false; $tab[61]['joinparams'] = array('jointype' => 'child'); $tab[62]['table'] = 'glpi_ticketsatisfactions'; $tab[62]['field'] = 'satisfaction'; $tab[62]['name'] = __('Satisfaction'); $tab[62]['datatype'] = 'number'; $tab[62]['massiveaction'] = false; $tab[62]['joinparams'] = array('jointype' => 'child'); $tab[63]['table'] = 'glpi_ticketsatisfactions'; $tab[63]['field'] = 'comment'; $tab[63]['name'] = __('Comments'); $tab[63]['datatype'] = 'text'; $tab[63]['massiveaction'] = false; $tab[63]['joinparams'] = array('jointype' => 'child'); $tab['followup'] = _n('Followup', 'Followups', 2); $followup_condition = ''; if (!Session::haveRight('show_full_ticket', 1)) { $followup_condition = "AND (`NEWTABLE`.`is_private` = '0' OR `NEWTABLE`.`users_id` = '".Session::getLoginUserID()."')"; } $tab[25]['table'] = 'glpi_ticketfollowups'; $tab[25]['field'] = 'content'; $tab[25]['name'] = __('Description'); $tab[25]['forcegroupby'] = true; $tab[25]['splititems'] = true; $tab[25]['massiveaction'] = false; $tab[25]['joinparams'] = array('jointype' => 'child', 'condition' => $followup_condition); $tab[25]['datatype'] = 'text'; $tab[27]['table'] = 'glpi_ticketfollowups'; $tab[27]['field'] = 'count'; $tab[27]['name'] = __('Number of followups'); $tab[27]['forcegroupby'] = true; $tab[27]['usehaving'] = true; $tab[27]['datatype'] = 'number'; $tab[27]['massiveaction'] = false; $tab[27]['joinparams'] = array('jointype' => 'child', 'condition' => $followup_condition); $tab[29]['table'] = 'glpi_requesttypes'; $tab[29]['field'] = 'name'; $tab[29]['name'] = __('Request source'); $tab[29]['datatype'] = 'dropdown'; $tab[29]['forcegroupby'] = true; $tab[29]['massiveaction'] = false; $tab[29]['joinparams'] = array('beforejoin' => array('table' => 'glpi_ticketfollowups', 'joinparams' => array('jointype' => 'child', 'condition' => $followup_condition))); $tab[91]['table'] = 'glpi_ticketfollowups'; $tab[91]['field'] = 'is_private'; $tab[91]['name'] = __('Private followup'); $tab[91]['datatype'] = 'bool'; $tab[91]['forcegroupby'] = true; $tab[91]['splititems'] = true; $tab[91]['massiveaction'] = false; $tab[91]['joinparams'] = array('jointype' => 'child', 'condition' => $followup_condition); $tab[93]['table'] = 'glpi_users'; $tab[93]['field'] = 'name'; $tab[93]['name'] = __('Writer'); $tab[93]['datatype'] = 'itemlink'; $tab[93]['right'] = 'all'; $tab[93]['forcegroupby'] = true; $tab[93]['massiveaction'] = false; $tab[93]['joinparams'] = array('beforejoin' => array('table' => 'glpi_ticketfollowups', 'joinparams' => array('jointype' => 'child', 'condition' => $followup_condition))); $tab += $this->getSearchOptionsStats(); $tab[150]['table'] = $this->getTable(); $tab[150]['field'] = 'takeintoaccount_delay_stat'; $tab[150]['name'] = __('Take into account time'); $tab[150]['datatype'] = 'timestamp'; $tab[150]['forcegroupby'] = true; $tab[150]['massiveaction'] = false; if (Session::haveRight("show_all_ticket","1") || Session::haveRight("show_assign_ticket","1") || Session::haveRight("own_ticket","1")) { $tab['linktickets'] = _n('Linked ticket', 'Linked tickets', 2); $tab[40]['table'] = 'glpi_tickets_tickets'; $tab[40]['field'] = 'tickets_id_1'; $tab[40]['name'] = __('All linked tickets'); $tab[40]['massiveaction'] = false; $tab[40]['searchtype'] = 'equals'; $tab[40]['joinparams'] = array('jointype' => 'item_item'); $tab[47]['table'] = 'glpi_tickets_tickets'; $tab[47]['field'] = 'tickets_id_1'; $tab[47]['name'] = __('Duplicated tickets'); $tab[47]['massiveaction'] = false; $tab[47]['searchtype'] = 'equals'; $tab[47]['joinparams'] = array('jointype' => 'item_item', 'condition' => "AND NEWTABLE.`link` = ". Ticket_Ticket::DUPLICATE_WITH); $tab[41]['table'] = 'glpi_tickets_tickets'; $tab[41]['field'] = 'count'; $tab[41]['name'] = __('Number of all linked tickets'); $tab[41]['massiveaction'] = false; $tab[41]['datatype'] = 'number'; $tab[41]['usehaving'] = true; $tab[41]['joinparams'] = array('jointype' => 'item_item'); $tab[46]['table'] = 'glpi_tickets_tickets'; $tab[46]['field'] = 'count'; $tab[46]['name'] = __('Number of duplicated tickets'); $tab[46]['massiveaction'] = false; $tab[46]['datatype'] = 'number'; $tab[46]['usehaving'] = true; $tab[46]['joinparams'] = array('jointype' => 'item_item', 'condition' => "AND NEWTABLE.`link` = ". Ticket_Ticket::DUPLICATE_WITH); $tab['task'] = _n('Task', 'Tasks', 2); $tab[26]['table'] = 'glpi_tickettasks'; $tab[26]['field'] = 'content'; $tab[26]['name'] = __('Description'); $tab[26]['datatype'] = 'text'; $tab[26]['forcegroupby'] = true; $tab[26]['splititems'] = true; $tab[26]['massiveaction'] = false; $tab[26]['joinparams'] = array('jointype' => 'child'); $tab[28]['table'] = 'glpi_tickettasks'; $tab[28]['field'] = 'count'; $tab[28]['name'] = _x('quantity', 'Number of tasks'); $tab[28]['forcegroupby'] = true; $tab[28]['usehaving'] = true; $tab[28]['datatype'] = 'number'; $tab[28]['massiveaction'] = false; $tab[28]['joinparams'] = array('jointype' => 'child'); $tab[20]['table'] = 'glpi_taskcategories'; $tab[20]['field'] = 'name'; $tab[20]['datatype'] = 'dropdown'; $tab[20]['name'] = __('Task category'); $tab[20]['forcegroupby'] = true; $tab[20]['splititems'] = true; $tab[20]['massiveaction'] = false; $tab[20]['joinparams'] = array('beforejoin' => array('table' => 'glpi_tickettasks', 'joinparams' => array('jointype' => 'child'))); $tab[92]['table'] = 'glpi_tickettasks'; $tab[92]['field'] = 'is_private'; $tab[92]['name'] = __('Private task'); $tab[92]['datatype'] = 'bool'; $tab[92]['forcegroupby'] = true; $tab[92]['splititems'] = true; $tab[92]['massiveaction'] = false; $tab[92]['joinparams'] = array('jointype' => 'child'); $tab[94]['table'] = 'glpi_users'; $tab[94]['field'] = 'name'; $tab[94]['name'] = __('Writer'); $tab[94]['datatype'] = 'itemlink'; $tab[94]['right'] = 'all'; $tab[94]['forcegroupby'] = true; $tab[94]['massiveaction'] = false; $tab[94]['joinparams'] = array('beforejoin' => array('table' => 'glpi_tickettasks', 'joinparams' => array('jointype' => 'child'))); $tab[95]['table'] = 'glpi_users'; $tab[95]['field'] = 'name'; $tab[95]['linkfield'] = 'users_id_tech'; $tab[95]['name'] = __('Technician'); $tab[95]['datatype'] = 'itemlink'; $tab[95]['right'] = 'own_ticket'; $tab[95]['forcegroupby'] = true; $tab[95]['massiveaction'] = false; $tab[95]['joinparams'] = array('beforejoin' => array('table' => 'glpi_tickettasks', 'joinparams' => array('jointype' => 'child'))); $tab[96]['table'] = 'glpi_tickettasks'; $tab[96]['field'] = 'actiontime'; $tab[96]['name'] = __('Duration'); $tab[96]['datatype'] = 'timestamp'; $tab[96]['massiveaction'] = false; $tab[96]['forcegroupby'] = true; $tab[96]['joinparams'] = array('jointype' => 'child'); $tab[97]['table'] = 'glpi_tickettasks'; $tab[97]['field'] = 'date'; $tab[97]['name'] = __('Date'); $tab[97]['datatype'] = 'datetime'; $tab[97]['massiveaction'] = false; $tab[97]['forcegroupby'] = true; $tab[97]['joinparams'] = array('jointype' => 'child'); $tab[33]['table'] = 'glpi_tickettasks'; $tab[33]['field'] = 'state'; $tab[33]['name'] = __('Status'); $tab[33]['datatype'] = 'specific'; $tab[33]['searchtype'] = 'equals'; $tab[33]['searchequalsonfield'] = true; $tab[33]['massiveaction'] = false; $tab[33]['forcegroupby'] = true; $tab[33]['joinparams'] = array('jointype' => 'child'); $tab['solution'] = _n('Solution', 'Solutions', 1); $tab[23]['table'] = 'glpi_solutiontypes'; $tab[23]['field'] = 'name'; $tab[23]['name'] = __('Solution type'); $tab[23]['datatype'] = 'dropdown'; $tab[24]['table'] = $this->getTable(); $tab[24]['field'] = 'solution'; $tab[24]['name'] = _n('Solution', 'Solutions', 1); $tab[24]['datatype'] = 'text'; $tab[24]['htmltext'] = true; $tab[24]['massiveaction'] = false; $tab['cost'] = __('Cost'); $tab[48]['table'] = 'glpi_ticketcosts'; $tab[48]['field'] = 'totalcost'; $tab[48]['name'] = __('Total cost'); $tab[48]['datatype'] = 'decimal'; $tab[48]['forcegroupby'] = true; $tab[48]['usehaving'] = true; $tab[48]['massiveaction'] = false; $tab[48]['joinparams'] = array('jointype' => 'child'); $tab[42]['table'] = 'glpi_ticketcosts'; $tab[42]['field'] = 'cost_time'; $tab[42]['name'] = __('Time cost'); $tab[42]['datatype'] = 'decimal'; $tab[42]['forcegroupby'] = true; $tab[42]['massiveaction'] = false; $tab[42]['joinparams'] = array('jointype' => 'child'); $tab[49]['table'] = 'glpi_ticketcosts'; $tab[49]['field'] = 'actiontime'; $tab[49]['name'] = sprintf(__('%1$s - %2$s'), __('Cost'), __('Duration')); $tab[49]['datatype'] = 'timestamp'; $tab[49]['forcegroupby'] = true; $tab[49]['massiveaction'] = false; $tab[49]['joinparams'] = array('jointype' => 'child'); $tab[43]['table'] = 'glpi_ticketcosts'; $tab[43]['field'] = 'cost_fixed'; $tab[43]['name'] = __('Fixed cost'); $tab[43]['datatype'] = 'decimal'; $tab[43]['forcegroupby'] = true; $tab[43]['massiveaction'] = false; $tab[43]['joinparams'] = array('jointype' => 'child'); $tab[44]['table'] = 'glpi_ticketcosts'; $tab[44]['field'] = 'cost_material'; $tab[44]['name'] = __('Material cost'); $tab[44]['datatype'] = 'decimal'; $tab[44]['forcegroupby'] = true; $tab[44]['massiveaction'] = false; $tab[44]['joinparams'] = array('jointype' => 'child'); $tab['problem'] = Problem::getTypeName(2); $tab[141]['table'] = 'glpi_problems_tickets'; $tab[141]['field'] = 'count'; $tab[141]['name'] = __('Number of problems'); $tab[141]['forcegroupby'] = true; $tab[141]['usehaving'] = true; $tab[141]['datatype'] = 'number'; $tab[141]['massiveaction'] = false; $tab[141]['joinparams'] = array('jointype' => 'child'); } // Filter search fields for helpdesk if (!Session::isCron() // no filter for cron && (!isset($_SESSION['glpiactiveprofile']['interface']) || ($_SESSION['glpiactiveprofile']['interface'] == 'helpdesk'))) { $tokeep = array('common', 'requester'); if (Session::haveRight('validate_request',1) || Session::haveRight('validate_incident',1) || Session::haveRight('create_incident_validation',1) || Session::haveRight('create_request_validation',1)) { $tokeep[] = 'validation'; } $keep = false; foreach ($tab as $key => $val) { if (!is_array($val)) { $keep = in_array($key, $tokeep); } if (!$keep) { if (is_array($val)) { $tab[$key]['nosearch'] = true; } } } // last updater no search $tab[64]['nosearch'] = true; } return $tab; } /** * @since version 0.84 * * @param $field * @param $values * @param $options array **/ static function getSpecificValueToDisplay($field, $values, array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } switch ($field) { case 'global_validation' : return TicketValidation::getStatus($values[$field]); case 'type': return self::getTicketTypeName($values[$field]); case 'items_id': if (isset($values['itemtype'])) { if (isset($options['comments']) && $options['comments']) { $tmp = Dropdown::getDropdownName(getTableForItemtype($values['itemtype']), $values[$field], 1); return sprintf(__('%1$s %2$s'), $tmp['name'], Html::showToolTip($tmp['comment'], array('display' => false))); } return Dropdown::getDropdownName(getTableForItemtype($values['itemtype']), $values[$field]); } break; } return parent::getSpecificValueToDisplay($field, $values, $options); } /** * @since version 0.84 * * @param $field * @param $name (default '') * @param $values (default '') * @param $options array * * @return string **/ static function getSpecificValueToSelect($field, $name='', $values='', array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'items_id' : if (isset($values['itemtype']) && !empty($values['itemtype'])) { $options['name'] = $name; $options['value'] = $values[$field]; return Dropdown::show($values['itemtype'], $options); } break; case 'type': $options['value'] = $values[$field]; return self::dropdownType($name, $options); case 'global_validation' : $options['global'] = true; $options['value'] = $values[$field]; return TicketValidation::dropdownStatus($name, $options); } return parent::getSpecificValueToSelect($field, $name, $values, $options); } /** * Dropdown of ticket type * * @param $name select name * @param $options array of options: * - value : integer / preselected value (default 0) * - toadd : array / array of specific values to add at the begining * - on_change : string / value to transmit to "onChange" * - display : boolean / display or get string (default true) * * @return string id of the select **/ static function dropdownType($name, $options=array()) { $params['value'] = 0; $params['toadd'] = array(); $params['on_change'] = ''; $params['display'] = true; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $params[$key] = $val; } } $items = array(); if (count($params['toadd']) > 0) { $items = $params['toadd']; } $items += self::getTypes(); return Dropdown::showFromArray($name, $items, $params); } /** * Get ticket types * * @return array of types **/ static function getTypes() { $options[self::INCIDENT_TYPE] = __('Incident'); $options[self::DEMAND_TYPE] = __('Request'); return $options; } /** * Get ticket type Name * * @param $value type ID **/ static function getTicketTypeName($value) { switch ($value) { case self::INCIDENT_TYPE : return __('Incident'); case self::DEMAND_TYPE : return __('Request'); default : // Return $value if not defined return $value; } } /** * get the Ticket status list * * @param $withmetaforsearch boolean (false by default) * * @return an array **/ static function getAllStatusArray($withmetaforsearch=false) { // To be overridden by class $tab = array(self::INCOMING => _x('ticket', 'New'), self::ASSIGNED => __('Processing (assigned)'), self::PLANNED => __('Processing (planned)'), self::WAITING => __('Pending'), self::SOLVED => __('Solved'), self::CLOSED => __('Closed')); if ($withmetaforsearch) { $tab['notold'] = __('Not solved'); $tab['notclosed'] = __('Not closed'); $tab['process'] = __('Processing'); $tab['old'] = __('Solved + Closed'); $tab['all'] = __('All'); } return $tab; } /** * Get the ITIL object closed status list * * @since version 0.83 * * @return an array **/ static function getClosedStatusArray() { return array(self::CLOSED); } /** * Get the ITIL object solved status list * * @since version 0.83 * * @return an array **/ static function getSolvedStatusArray() { return array(self::SOLVED); } /** * Get the ITIL object new status list * * @since version 0.83.8 * * @return an array **/ static function getNewStatusArray() { return array(self::INCOMING); } /** * Get the ITIL object assign or plan status list * * @since version 0.83 * * @return an array **/ static function getProcessStatusArray() { return array(self::ASSIGNED, self::PLANNED); } /** * Make a select box for Ticket my devices * * @param $userID User ID for my device section (default 0) * @param $entity_restrict restrict to a specific entity (default -1) * @param $itemtype of selected item (default 0) * @param $items_id of selected item (default 0) * * @return nothing (print out an HTML select box) **/ static function dropdownMyDevices($userID=0, $entity_restrict=-1, $itemtype=0, $items_id=0) { global $DB, $CFG_GLPI; if ($userID == 0) { $userID = Session::getLoginUserID(); } $rand = mt_rand(); $already_add = array(); if ($_SESSION["glpiactiveprofile"]["helpdesk_hardware"]&pow(2, self::HELPDESK_MY_HARDWARE)) { $my_devices = ""; $my_item = $itemtype.'_'.$items_id; // My items foreach ($CFG_GLPI["linkuser_types"] as $itemtype) { if (($item = getItemForItemtype($itemtype)) && parent::isPossibleToAssignType($itemtype)) { $itemtable = getTableForItemType($itemtype); $query = "SELECT * FROM `$itemtable` WHERE `users_id` = '$userID'"; if ($item->maybeDeleted()) { $query .= " AND `is_deleted` = '0' "; } if ($item->maybeTemplate()) { $query .= " AND `is_template` = '0' "; } if (in_array($itemtype,$CFG_GLPI["helpdesk_visible_types"])) { $query .= " AND `is_helpdesk_visible` = '1' "; } $query .= getEntitiesRestrictRequest("AND",$itemtable,"",$entity_restrict, $item->maybeRecursive())." ORDER BY `name` "; $result = $DB->query($query); $nb = $DB->numrows($result); if ($DB->numrows($result) > 0) { $type_name = $item->getTypeName($nb); while ($data = $DB->fetch_assoc($result)) { $output = $data["name"]; if (empty($output) || $_SESSION["glpiis_ids_visible"]) { $output = sprintf(__('%1$s (%2$s)'), $output, $data['id']); } $output = sprintf(__('%1$s - %2$s'), $type_name, $output); if ($itemtype != 'Software') { if (!empty($data['serial'])) { $output = sprintf(__('%1$s - %2$s'), $output, $data['serial']); } if (!empty($data['otherserial'])) { $output = sprintf(__('%1$s - %2$s'), $output, $data['otherserial']); } } $my_devices .= ""; $already_add[$itemtype][] = $data["id"]; } } } } if (!empty($my_devices)) { $my_devices = "".$my_devices.""; } // My group items if (Session::haveRight("show_group_hardware","1")) { $group_where = ""; $query = "SELECT `glpi_groups_users`.`groups_id`, `glpi_groups`.`name` FROM `glpi_groups_users` LEFT JOIN `glpi_groups` ON (`glpi_groups`.`id` = `glpi_groups_users`.`groups_id`) WHERE `glpi_groups_users`.`users_id` = '$userID' ". getEntitiesRestrictRequest("AND", "glpi_groups", "", $entity_restrict, true); $result = $DB->query($query); $first = true; if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { if ($first) { $first = false; } else { $group_where .= " OR "; } $a_groups = getAncestorsOf("glpi_groups", $data["groups_id"]); $a_groups[$data["groups_id"]] = $data["groups_id"]; $group_where .= " `groups_id` IN (".implode(',', $a_groups).") "; } $tmp_device = ""; foreach ($CFG_GLPI["linkgroup_types"] as $itemtype) { if (($item = getItemForItemtype($itemtype)) && parent::isPossibleToAssignType($itemtype)) { $itemtable = getTableForItemType($itemtype); $query = "SELECT * FROM `$itemtable` WHERE ($group_where) ". getEntitiesRestrictRequest("AND", $itemtable, "", $entity_restrict, $item->maybeRecursive()); if ($item->maybeDeleted()) { $query .= " AND `is_deleted` = '0' "; } if ($item->maybeTemplate()) { $query .= " AND `is_template` = '0' "; } $result = $DB->query($query); if ($DB->numrows($result) > 0) { $type_name = $item->getTypeName(); if (!isset($already_add[$itemtype])) { $already_add[$itemtype] = array(); } while ($data = $DB->fetch_assoc($result)) { if (!in_array($data["id"], $already_add[$itemtype])) { $output = ''; if (isset($data["name"])) { $output = $data["name"]; } if (empty($output) || $_SESSION["glpiis_ids_visible"]) { $output = sprintf(__('%1$s (%2$s)'), $output, $data['id']); } $output = sprintf(__('%1$s - %2$s'), $type_name, $output); if (isset($data['serial'])) { $output = sprintf(__('%1$s - %2$s'), $output, $data['serial']); } if (isset($data['otherserial'])) { $output = sprintf(__('%1$s - %2$s'), $output, $data['otherserial']); } $tmp_device .= ""; $already_add[$itemtype][] = $data["id"]; } } } } } if (!empty($tmp_device)) { $my_devices .= "". $tmp_device.""; } } } // Get linked items to computers if (isset($already_add['Computer']) && count($already_add['Computer'])) { $search_computer = " XXXX IN (".implode(',',$already_add['Computer']).') '; $tmp_device = ""; // Direct Connection $types = array('Monitor', 'Peripheral', 'Phone', 'Printer'); foreach ($types as $itemtype) { if (in_array($itemtype,$_SESSION["glpiactiveprofile"]["helpdesk_item_type"]) && ($item = getItemForItemtype($itemtype))) { $itemtable = getTableForItemType($itemtype); if (!isset($already_add[$itemtype])) { $already_add[$itemtype] = array(); } $query = "SELECT DISTINCT `$itemtable`.* FROM `glpi_computers_items` LEFT JOIN `$itemtable` ON (`glpi_computers_items`.`items_id` = `$itemtable`.`id`) WHERE `glpi_computers_items`.`itemtype` = '$itemtype' AND ".str_replace("XXXX","`glpi_computers_items`.`computers_id`", $search_computer); if ($item->maybeDeleted()) { $query .= " AND `$itemtable`.`is_deleted` = '0' "; } if ($item->maybeTemplate()) { $query .= " AND `$itemtable`.`is_template` = '0' "; } $query .= getEntitiesRestrictRequest("AND",$itemtable,"",$entity_restrict)." ORDER BY `$itemtable`.`name`"; $result = $DB->query($query); if ($DB->numrows($result) > 0) { $type_name = $item->getTypeName(); while ($data = $DB->fetch_assoc($result)) { if (!in_array($data["id"],$already_add[$itemtype])) { $output = $data["name"]; if (empty($output) || $_SESSION["glpiis_ids_visible"]) { $output = sprintf(__('%1$s (%2$s)'), $output, $data['id']); } $output = sprintf(__('%1$s - %2$s'), $type_name, $output); if ($itemtype != 'Software') { $output = sprintf(__('%1$s - %2$s'), $output, $data['otherserial']); } $tmp_device .= ""; $already_add[$itemtype][] = $data["id"]; } } } } } if (!empty($tmp_device)) { $my_devices .= "".$tmp_device. ""; } // Software if (in_array('Software', $_SESSION["glpiactiveprofile"]["helpdesk_item_type"])) { $query = "SELECT DISTINCT `glpi_softwareversions`.`name` AS version, `glpi_softwares`.`name` AS name, `glpi_softwares`.`id` FROM `glpi_computers_softwareversions`, `glpi_softwares`, `glpi_softwareversions` WHERE `glpi_computers_softwareversions`.`softwareversions_id` = `glpi_softwareversions`.`id` AND `glpi_softwareversions`.`softwares_id` = `glpi_softwares`.`id` AND ".str_replace("XXXX", "`glpi_computers_softwareversions`.`computers_id`", $search_computer)." AND `glpi_softwares`.`is_helpdesk_visible` = '1' ". getEntitiesRestrictRequest("AND","glpi_softwares","", $entity_restrict)." ORDER BY `glpi_softwares`.`name`"; $result = $DB->query($query); if ($DB->numrows($result) > 0) { $tmp_device = ""; $item = new Software(); $type_name = $item->getTypeName(); if (!isset($already_add['Software'])) { $already_add['Software'] = array(); } while ($data = $DB->fetch_assoc($result)) { if (!in_array($data["id"], $already_add['Software'])) { $output = sprintf(__('%1$s - %2$s'), $type_name, $data["name"]); $output = sprintf(__('%1$s (%2$s)'), $output, sprintf(__('%1$s: %2$s'), __('version'), $data["version"])); if ($_SESSION["glpiis_ids_visible"]) { $output = sprintf(__('%1$s (%2$s)'), $output, $data["id"]); } $tmp_device .= ""; $already_add['Software'][] = $data["id"]; } } if (!empty($tmp_device)) { $my_devices .= ""; $my_devices .= $tmp_device.""; } } } } echo "
    "; echo "
    "; // Auto update summary of active or just solved tickets $params = array('my_items' => '__VALUE__'); Ajax::updateItemOnSelectEvent("my_items","item_ticket_selection_information", $CFG_GLPI["root_doc"]."/ajax/ticketiteminformation.php", $params); } } /** * Make a select box for Tracking All Devices * * @param $myname select name * @param $itemtype preselected value.for item type * @param $items_id preselected value for item ID (default 0) * @param $admin is an admin access ? (default 0) * @param $users_id user ID used to display my devices (default 0 * @param $entity_restrict Restrict to a defined entity (default -1) * * @return nothing (print out an HTML select box) **/ static function dropdownAllDevices($myname, $itemtype, $items_id=0, $admin=0, $users_id=0, $entity_restrict=-1) { global $CFG_GLPI, $DB; $rand = mt_rand(); if ($_SESSION["glpiactiveprofile"]["helpdesk_hardware"] == 0) { echo ""; echo ""; } else { echo "
    "; if ($_SESSION["glpiactiveprofile"]["helpdesk_hardware"]&pow(2, self::HELPDESK_ALL_HARDWARE)) { // Display a message if view my hardware if ($users_id && $_SESSION["glpiactiveprofile"]["helpdesk_hardware"]&pow(2, self::HELPDESK_MY_HARDWARE)) { echo __('Or complete search')." "; } $types = parent::getAllTypesForHelpdesk(); echo ""; $params = array('itemtype' => '__VALUE__', 'entity_restrict' => $entity_restrict, 'admin' => $admin, 'myname' => "items_id",); Ajax::updateItemOnSelectEvent("search_$myname$rand","results_$myname$rand", $CFG_GLPI["root_doc"]. "/ajax/dropdownTrackingDeviceType.php", $params); echo "\n"; // Display default value if itemtype is displayed if ($found_type && $itemtype) { if (($item = getItemForItemtype($itemtype)) && $items_id) { if ($item->getFromDB($items_id)) { echo ""; } } else { $params['itemtype'] = $itemtype; echo "'; } } echo "\n"; } echo "
    "; } return $rand; } /** * Calculate Ticket TCO for an item * *@param $item CommonDBTM object of the item * *@return float **/ static function computeTco(CommonDBTM $item) { global $DB; $totalcost = 0; $query = "SELECT `glpi_ticketcosts`.* FROM `glpi_tickets`, `glpi_ticketcosts` WHERE `glpi_ticketcosts`.`tickets_id` = `glpi_tickets`.`id` AND `glpi_tickets`.`itemtype` = '".get_class($item)."' AND `glpi_tickets`.`items_id` = '".$item->getField('id')."' AND (`glpi_ticketcosts`.`cost_time` > '0' OR `glpi_ticketcosts`.`cost_fixed` > '0' OR `glpi_ticketcosts`.`cost_material` > '0')"; $result = $DB->query($query); $i = 0; if ($DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $totalcost += TicketCost::computeTotalCost($data["actiontime"], $data["cost_time"], $data["cost_fixed"], $data["cost_material"]); } } return $totalcost; } /** * Print the helpdesk form * * @param $ID integer ID of the user who want to display the Helpdesk * @param $ticket_template boolean ticket template for preview : false if not used for preview * (false by default) * * @return nothing (print the helpdesk) **/ function showFormHelpdesk($ID, $ticket_template=false) { global $DB, $CFG_GLPI; if (!Session::haveRight("create_ticket","1")) { return false; } if (!$ticket_template && (Session::haveRight('validate_incident',1) || Session::haveRight('validate_request',1))) { $opt = array(); $opt['reset'] = 'reset'; $opt['field'][0] = 55; // validation status $opt['searchtype'][0] = 'equals'; $opt['contains'][0] = 'waiting'; $opt['link'][0] = 'AND'; $opt['field'][1] = 59; // validation aprobator $opt['searchtype'][1] = 'equals'; $opt['contains'][1] = Session::getLoginUserID(); $opt['link'][1] = 'AND'; $url_validate = $CFG_GLPI["root_doc"]."/front/ticket.php?".Toolbox::append_params($opt, '&'); if (TicketValidation::getNumberTicketsToValidate(Session::getLoginUserID()) > 0) { echo "". __('Tickets awaiting approval')."

    "; } } $query = "SELECT `realname`, `firstname`, `name` FROM `glpi_users` WHERE `id` = '$ID'"; $result = $DB->query($query); $email = UserEmail::getDefaultForUser($ID); // Set default values... $default_values = array('_users_id_requester_notif' => array('use_notification' => (($email == "")?0:1)), 'nodelegate' => 1, '_users_id_requester' => 0, 'name' => '', 'content' => '', 'itilcategories_id' => 0, 'locations_id' => 0, 'urgency' => 3, 'itemtype' => '', 'items_id' => 0, 'entities_id' => $_SESSION['glpiactive_entity'], 'plan' => array(), 'global_validation' => 'none', 'due_date' => 'NULL', 'slas_id' => 0, '_add_validation' => 0, 'type' => Entity::getUsedConfig('tickettype', $_SESSION['glpiactive_entity'], '', Ticket::INCIDENT_TYPE), '_right' => "id"); // Get default values from posted values on reload form if (!$ticket_template) { if (isset($_POST)) { $values = Html::cleanPostForTextArea($_POST); } } // Restore saved value or override with page parameter $saved = $this->restoreInput(); foreach ($default_values as $name => $value) { if (!isset($values[$name])) { if (isset($saved[$name])) { $values[$name] = $saved[$name]; } else { $values[$name] = $value; } } } if (!$ticket_template) { echo ""; } $delegating = User::getDelegateGroupsForUser($values['entities_id']); if (count($delegating)) { echo "
    "; echo ""; echo ""; echo "
    ".__('This ticket concerns me')." "; $rand = Dropdown::showYesNo("nodelegate", $values['nodelegate']); $params = array ('nodelegate' => '__VALUE__', 'rand' => $rand, 'right' => "delegate", '_users_id_requester' => $values['_users_id_requester'], '_users_id_requester_notif' => $values['_users_id_requester_notif'], 'use_notification' => $values['_users_id_requester_notif']['use_notification'], 'entity_restrict' => $_SESSION["glpiactive_entity"]); Ajax::UpdateItemOnSelectEvent("dropdown_nodelegate".$rand, "show_result".$rand, $CFG_GLPI["root_doc"]."/ajax/dropdownDelegationUsers.php", $params); if ($CFG_GLPI['use_check_pref'] && $values['nodelegate']) { echo "".__('Check your personnal information'); } echo "
    "; echo "
    "; $self = new self(); if ($values["_users_id_requester"] == 0) { $values['_users_id_requester'] = Session::getLoginUserID(); } else { $values['_right'] = "delegate"; } $self->showActorAddFormOnCreate(CommonITILActor::REQUESTER, $values); echo "
    "; if ($CFG_GLPI['use_check_pref'] && $values['nodelegate']) { echo "
    "; User::showPersonalInformation(Session::getLoginUserID()); } echo "
    "; echo ""; } else { // User as requester $values['_users_id_requester'] = Session::getLoginUserID(); if ($CFG_GLPI['use_check_pref']) { echo "
    "; echo ""; echo ""; echo "
    ".__('Check your personnal information')."
    "; User::showPersonalInformation(Session::getLoginUserID()); echo "
    "; } } echo ""; echo ""; // Load ticket template if available : $tt = $this->getTicketTemplateToUse($ticket_template, $values['type'], $values['itilcategories_id'], $_SESSION["glpiactive_entity"]); // Predefined fields from template : reset them if (isset($values['_predefined_fields'])) { $values['_predefined_fields'] = Toolbox::decodeArrayFromInput($values['_predefined_fields']); } else { $values['_predefined_fields'] = array(); } // Store predefined fields to be able not to take into account on change template $predefined_fields = array(); if (isset($tt->predefined) && count($tt->predefined)) { foreach ($tt->predefined as $predeffield => $predefvalue) { if (isset($values[$predeffield]) && isset($default_values[$predeffield])) { // Is always default value : not set // Set if already predefined field // Set if ticket template change if (($values[$predeffield] == $default_values[$predeffield]) || (isset($values['_predefined_fields'][$predeffield]) && ($values[$predeffield] == $values['_predefined_fields'][$predeffield])) || (isset($values['_tickettemplates_id']) && ($values['_tickettemplates_id'] != $tt->getID()))) { $values[$predeffield] = $predefvalue; $predefined_fields[$predeffield] = $predefvalue; } } else { // Not defined options set as hidden field echo ""; } } } else { // No template load : reset predefined values if (count($values['_predefined_fields'])) { foreach ($values['_predefined_fields'] as $predeffield => $predefvalue) { if ($values[$predeffield] == $predefvalue) { $values[$predeffield] = $default_values[$predeffield]; } } } } if (($CFG_GLPI['urgency_mask'] == (1<<3)) || $tt->isHiddenField('urgency')) { // Dont show dropdown if only 1 value enabled or field is hidden echo ""; } // Display predefined fields if hidden if ($tt->isHiddenField('itemtype')) { echo ""; echo ""; } if ($tt->isHiddenField('locations_id')) { echo ""; } echo ""; echo "
    "; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if ($CFG_GLPI['urgency_mask'] != (1<<3)) { if (!$tt->isHiddenField('urgency')) { echo ""; echo ""; echo ""; } } if (empty($delegating) && NotificationTargetTicket::isAuthorMailingActivatedForHelpdesk()) { echo ""; echo ""; echo ""; } if ($_SESSION["glpiactiveprofile"]["helpdesk_hardware"] != 0) { if (!$tt->isHiddenField('itemtype')) { echo ""; echo ""; echo ""; } } if (!$tt->isHiddenField('locations_id')) { echo ""; } if (!$tt->isHiddenField('name') || $tt->isPredefinedField('name')) { echo ""; echo ""; echo ""; } if (!$tt->isHiddenField('content') || $tt->isPredefinedField('content')) { echo ""; echo ""; echo ""; } echo ""; echo ""; echo ""; if (!$ticket_template) { echo ""; echo ""; } echo "
    ".__('Describe the incident or request').""; if (Session::isMultiEntitiesMode()) { echo "(".Dropdown::getDropdownName("glpi_entities", $_SESSION["glpiactive_entity"]).")"; } echo "
    ".sprintf(__('%1$s%2$s'), __('Type'), $tt->getMandatoryMark('type')).""; self::dropdownType('type', array('value' => $values['type'], 'on_change' => 'submit()')); echo "
    ".sprintf(__('%1$s%2$s'), __('Category'), $tt->getMandatoryMark('itilcategories_id')).""; $condition = "`is_helpdeskvisible`='1'"; switch ($values['type']) { case self::DEMAND_TYPE : $condition .= " AND `is_request`='1'"; break; default: // self::INCIDENT_TYPE : $condition .= " AND `is_incident`='1'"; } $opt = array('value' => $values['itilcategories_id'], 'condition' => $condition, 'on_change' => 'submit()'); if ($values['itilcategories_id'] && $tt->isMandatoryField("itilcategories_id")) { $opt['display_emptychoice'] = false; } ITILCategory::dropdown($opt); echo "
    ".sprintf(__('%1$s%2$s'), __('Urgency'), $tt->getMandatoryMark('urgency')). ""; self::dropdownUrgency(array('value' => $values["urgency"])); echo "
    ".__('Inform me about the actions taken').""; if ($values["_users_id_requester"] == 0) { $values['_users_id_requester'] = Session::getLoginUserID(); } $_POST['value'] = $values['_users_id_requester']; $_POST['field'] = '_users_id_requester_notif'; $_POST['use_notification'] = $values['_users_id_requester_notif']['use_notification']; include (GLPI_ROOT."/ajax/uemailUpdate.php"); echo "
    ".sprintf(__('%1$s%2$s'), __('Hardware type'), $tt->getMandatoryMark('itemtype')).""; self::dropdownMyDevices($values['_users_id_requester'], $_SESSION["glpiactive_entity"], $values['itemtype'], $values['items_id']); self::dropdownAllDevices("itemtype", $values['itemtype'], $values['items_id'], 0, $values['_users_id_requester'], $_SESSION["glpiactive_entity"]); echo ""; echo "
    "; printf(__('%1$s%2$s'), __('Location'), $tt->getMandatoryMark('locations_id')); echo ""; Location::dropdown(array('value' => $values["locations_id"])); echo "
    ".sprintf(__('%1$s%2$s'), __('Title'), $tt->getMandatoryMark('name'))."
    ".sprintf(__('%1$s%2$s'), __('Description'), $tt->getMandatoryMark('content')). ""; echo "
    ".sprintf(__('%1$s (%2$s)'), __('File'), Document::getMaxUploadSize()); echo "".
             __s("; echo " "; self::showDocumentAddButton(60); echo "
    "; echo "
    "; if ($tt->isField('id') && ($tt->fields['id'] > 0)) { echo ""; echo ""; } echo ""; echo "
    "; if (!$ticket_template) { Html::closeForm(); } } /** * @since version 0.83 * * @param $entity integer entities_id usefull is function called by cron (default 0) **/ static function getDefaultValues($entity=0) { global $CFG_GLPI; if (is_numeric(Session::getLoginUserID(false))) { $users_id_requester = Session::getLoginUserID(); // No default requester if own ticket right = tech and update_ticket right to update requester if (Session::haveRight('own_ticket',1) && Session::haveRight('update_ticket',1)) { $users_id_requester = 0; } $entity = $_SESSION['glpiactive_entity']; $requesttype = $_SESSION['glpidefault_requesttypes_id']; } else { $users_id_requester = 0; $requesttype = $CFG_GLPI['default_requesttypes_id']; } $type = Entity::getUsedConfig('tickettype', $entity, '', Ticket::INCIDENT_TYPE); // Set default values... return array('_users_id_requester' => $users_id_requester, '_users_id_requester_notif' => array('use_notification' => 1, 'alternative_email' => ''), '_groups_id_requester' => 0, '_users_id_assign' => 0, '_users_id_assign_notif' => array('use_notification' => 1, 'alternative_email' => ''), '_groups_id_assign' => 0, '_users_id_observer' => 0, '_users_id_observer_notif' => array('use_notification' => 1, 'alternative_email' => ''), '_groups_id_observer' => 0, '_link' => array('tickets_id_2' => '', 'link' => ''), '_suppliers_id_assign' => 0, 'name' => '', 'content' => '', 'itilcategories_id' => 0, 'urgency' => 3, 'impact' => 3, 'priority' => self::computePriority(3, 3), 'requesttypes_id' => $requesttype, 'actiontime' => 0, 'date' => $_SESSION["glpi_currenttime"], 'entities_id' => $entity, 'status' => self::INCOMING, 'followup' => array(), 'itemtype' => '', 'items_id' => 0, 'locations_id' => 0, 'plan' => array(), 'global_validation' => 'none', 'due_date' => 'NULL', 'slas_id' => 0, '_add_validation' => 0, 'type' => $type); } /** * Get ticket template to use * Use force_template first, then try on template define for type and category * then use default template of active profile of connected user and then use default entity one * * @param $force_template integer tickettemplate_id to used (case of preview for example) * (default 0) * @param $type integer type of the ticket (default 0) * @param $itilcategories_id integer ticket category (default 0) * @param $entities_id integer (default -1) * * @since version 0.84 * * @return ticket template object **/ function getTicketTemplateToUse($force_template=0, $type=0, $itilcategories_id=0, $entities_id=-1) { // Load ticket template if available : $tt = new TicketTemplate(); $template_loaded = false; if ($force_template) { // with type and categ if ($tt->getFromDBWithDatas($force_template, true)) { $template_loaded = true; } } if (!$template_loaded && $type && $itilcategories_id) { $categ = new ITILCategory(); if ($categ->getFromDB($itilcategories_id)) { $field = ''; switch ($type) { case self::INCIDENT_TYPE : $field = 'tickettemplates_id_incident'; break; case self::DEMAND_TYPE : $field = 'tickettemplates_id_demand'; break; } if (!empty($field) && $categ->fields[$field]) { // without type and categ if ($tt->getFromDBWithDatas($categ->fields[$field], false)) { $template_loaded = true; } } } } // If template loaded from type and category do not check after if ($template_loaded) { return $tt; } if (!$template_loaded) { // load default profile one if not already loaded if (isset($_SESSION['glpiactiveprofile']['tickettemplates_id']) && $_SESSION['glpiactiveprofile']['tickettemplates_id']) { // with type and categ if ($tt->getFromDBWithDatas($_SESSION['glpiactiveprofile']['tickettemplates_id'], true)) { $template_loaded = true; } } } if (!$template_loaded && ($entities_id >= 0)) { // load default entity one if not already loaded if ($template_id = Entity::getUsedConfig('tickettemplates_id', $entities_id)) { // with type and categ if ($tt->getFromDBWithDatas($template_id, true)) { $template_loaded = true; } } } // Check if profile / entity set type and category and try to load template for these values if ($template_loaded) { // template loaded for profile or entity $newtype = $type; $newitilcategories_id = $itilcategories_id; // Get predefined values for ticket template if (isset($tt->predefined['itilcategories_id']) && $tt->predefined['itilcategories_id']){ $newitilcategories_id = $tt->predefined['itilcategories_id']; } if (isset($tt->predefined['type']) && $tt->predefined['type']){ $newtype = $tt->predefined['type']; } if ($newtype && $newitilcategories_id) { $categ = new ITILCategory(); if ($categ->getFromDB($newitilcategories_id)) { $field = ''; switch ($newtype) { case self::INCIDENT_TYPE : $field = 'tickettemplates_id_incident'; break; case self::DEMAND_TYPE : $field = 'tickettemplates_id_demand'; break; } if (!empty($field) && $categ->fields[$field]) { // without type and categ if ($tt->getFromDBWithDatas($categ->fields[$field], false)) { $template_loaded = true; } } } } } return $tt; } function showForm($ID, $options=array()) { global $DB, $CFG_GLPI; $default_values = self::getDefaultValues(); // Get default values from posted values on reload form if (!isset($options['template_preview'])) { if (isset($_POST)) { $values = Html::cleanPostForTextArea($_POST); } } // Restore saved value or override with page parameter $saved = $this->restoreInput(); foreach ($default_values as $name => $value) { if (!isset($values[$name])) { if (isset($saved[$name])) { $values[$name] = $saved[$name]; } else { $values[$name] = $value; } } } // Default check if ($ID > 0) { $this->check($ID,'r'); } else { // Create item $this->check(-1,'w',$values); } if (!$ID) { $this->userentities = array(); if ($values["_users_id_requester"]) { //Get all the user's entities $all_entities = Profile_User::getUserEntities($values["_users_id_requester"], true, true); //For each user's entity, check if the technician which creates the ticket have access to it foreach ($all_entities as $tmp => $ID_entity) { if (Session::haveAccessToEntity($ID_entity)) { $this->userentities[] = $ID_entity; } } } $this->countentitiesforuser = count($this->userentities); if (($this->countentitiesforuser > 0) && !in_array($this->fields["entities_id"], $this->userentities)) { // If entity is not in the list of user's entities, // then use as default value the first value of the user's entites list $this->fields["entities_id"] = $this->userentities[0]; // Pass to values $values['entities_id'] = $this->userentities[0]; } } if ($values['type'] <= 0) { $values['type'] = Entity::getUsedConfig('tickettype', $values['entities_id'], '', Ticket::INCIDENT_TYPE); } if (!isset($options['template_preview'])) { $options['template_preview'] = 0; } // Load ticket template if available : if ($ID) { $tt = $this->getTicketTemplateToUse($options['template_preview'], $this->fields['type'], $this->fields['itilcategories_id'], $this->fields['entities_id']); } else { $tt = $this->getTicketTemplateToUse($options['template_preview'], $values['type'], $values['itilcategories_id'], $values['entities_id']); } // Predefined fields from template : reset them if (isset($values['_predefined_fields'])) { $values['_predefined_fields'] = Toolbox::decodeArrayFromInput($values['_predefined_fields']); } else { $values['_predefined_fields'] = array(); } // Store predefined fields to be able not to take into account on change template // Only manage predefined values on ticket creation $predefined_fields = array(); if (!$ID) { if (isset($tt->predefined) && count($tt->predefined)) { foreach ($tt->predefined as $predeffield => $predefvalue) { if (isset($default_values[$predeffield])) { // Is always default value : not set // Set if already predefined field // Set if ticket template change if (($values[$predeffield] == $default_values[$predeffield]) || (isset($values['_predefined_fields'][$predeffield]) && ($values[$predeffield] == $values['_predefined_fields'][$predeffield])) || (isset($values['_tickettemplates_id']) && ($values['_tickettemplates_id'] != $tt->getID()))) { // Load template data $values[$predeffield] = $predefvalue; $this->fields[$predeffield] = $predefvalue; $predefined_fields[$predeffield] = $predefvalue; } } } } else { // No template load : reset predefined values if (count($values['_predefined_fields'])) { foreach ($values['_predefined_fields'] as $predeffield => $predefvalue) { if ($values[$predeffield] == $predefvalue) { $values[$predeffield] = $default_values[$predeffield]; } } } } } // Put ticket template on $values for actors $values['_tickettemplate'] = $tt; $canupdate = Session::haveRight('update_ticket', '1'); $canpriority = Session::haveRight('update_priority', '1'); $canstatus = $canupdate; if (in_array($this->fields['status'], $this->getClosedStatusArray())) { $canupdate = false; // No update for actors $values['_noupdate'] = true; } $showuserlink = 0; if (Session::haveRight('user','r')) { $showuserlink = 1; } if (!$options['template_preview']) { $this->showTabs($options); } else { // Add all values to fields of tickets for template preview foreach ($values as $key => $val) { if (!isset($this->fields[$key])) { $this->fields[$key] = $val; } } } // In percent $colsize1 = '13'; $colsize2 = '29'; $colsize3 = '13'; $colsize4 = '45'; $canupdate_descr = $canupdate || (($this->fields['status'] == self::INCOMING) && $this->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID()) && ($this->numberOfFollowups() == 0) && ($this->numberOfTasks() == 0)); if (!$options['template_preview']) { echo ""; } echo "
    "; echo ""; // Optional line $ismultientities = Session::isMultiEntitiesMode(); echo ""; echo ""; echo ""; echo ""; echo ""; // SLA echo ""; echo ""; if ($ID) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } if ($ID && (in_array($this->fields["status"], $this->getSolvedStatusArray()) || in_array($this->fields["status"], $this->getClosedStatusArray()))) { echo ""; echo ""; echo ""; if (in_array($this->fields["status"], $this->getClosedStatusArray())) { echo ""; echo ""; } else { echo ""; } echo ""; } if ($ID) { echo "
    "; if ($ID) { $text = sprintf(__('%1$s - %2$s'), $this->getTypeName(1), sprintf(__('%1$s: %2$s'), __('ID'), $ID)); if ($ismultientities) { $text = sprintf(__('%1$s (%2$s)'), $text, Dropdown::getDropdownName('glpi_entities', $this->fields['entities_id'])); } echo $text; } else { if ($ismultientities) { printf(__('The ticket will be added in the entity %s'), Dropdown::getDropdownName("glpi_entities", $this->fields['entities_id'])); } else { _e('New ticket'); } } echo "
    "; echo $tt->getBeginHiddenFieldText('date'); if (!$ID) { printf(__('%1$s%2$s'), __('Opening date'), $tt->getMandatoryMark('date')); } else { _e('Opening date'); } echo $tt->getEndHiddenFieldText('date'); echo ""; echo $tt->getBeginHiddenFieldValue('date'); $date = $this->fields["date"]; if ($canupdate) { Html::showDateTimeFormItem("date", $date, 1, false); } else { echo Html::convDateTime($date); } echo $tt->getEndHiddenFieldValue('date', $this); echo "".$tt->getBeginHiddenFieldText('due_date'); if (!$ID) { printf(__('%1$s%2$s'), __('Due date'), $tt->getMandatoryMark('due_date')); } else { _e('Due date'); } echo $tt->getEndHiddenFieldText('due_date'); echo ""; if ($ID) { if ($this->fields["slas_id"] > 0) { echo ""; echo ""; echo "
    "; echo Html::convDateTime($this->fields["due_date"]); echo "".__('SLA').""; echo Dropdown::getDropdownName("glpi_slas", $this->fields["slas_id"]); $commentsla = ""; $slalevel = new SlaLevel(); if ($slalevel->getFromDB($this->fields['slalevels_id'])) { $commentsla .= ''. sprintf(__('%1$s: %2$s'), __('Escalation level'), $slalevel->getName()).'
    '; } $nextaction = new SlaLevel_Ticket(); if ($nextaction->getFromDBForTicket($this->fields["id"])) { $commentsla .= ''. sprintf(__('Next escalation: %s'), Html::convDateTime($nextaction->fields['date'])).''; if ($slalevel->getFromDB($nextaction->fields['slalevels_id'])) { $commentsla .= ''. sprintf(__('%1$s: %2$s'), __('Escalation level'), $slalevel->getName()).''; } } $slaoptions = array(); if (Session::haveRight('config', 'r')) { $slaoptions['link'] = Toolbox::getItemTypeFormURL('SLA'). "?id=".$this->fields["slas_id"]; } Html::showToolTip($commentsla,$slaoptions); if ($canupdate) { echo " "; } echo "
    "; } else { echo ""; if ($canupdate) { echo ""; } echo "
    "; echo $tt->getBeginHiddenFieldValue('due_date'); if ($canupdate) { Html::showDateTimeFormItem("due_date", $this->fields["due_date"], 1, true); } else { echo Html::convDateTime($this->fields["due_date"]); } echo $tt->getEndHiddenFieldValue('due_date',$this); echo ""; echo $tt->getBeginHiddenFieldText('slas_id'); echo ""; echo "".__('Assign a SLA').''; echo ""; echo ""; echo $tt->getEndHiddenFieldText('slas_id'); echo "
    "; } } else { // New Ticket echo ""; if ($canupdate) { echo ""; echo ""; } echo "
    "; if ($this->fields["due_date"] == 'NULL') { $this->fields["due_date"]=''; } echo $tt->getBeginHiddenFieldValue('due_date'); Html::showDateTimeFormItem("due_date", $this->fields["due_date"], 1, false, $canupdate); echo $tt->getEndHiddenFieldValue('due_date',$this); echo "".$tt->getBeginHiddenFieldText('slas_id'); printf(__('%1$s%2$s'), __('SLA'), $tt->getMandatoryMark('slas_id')); echo $tt->getEndHiddenFieldText('slas_id')."".$tt->getBeginHiddenFieldValue('slas_id'); Sla::dropdown(array('entity' => $this->fields["entities_id"], 'value' => $this->fields["slas_id"])); echo $tt->getEndHiddenFieldValue('slas_id',$this); echo "
    "; } echo "
    ".__('By').""; if ($canupdate) { User::dropdown(array('name' => 'users_id_recipient', 'value' => $this->fields["users_id_recipient"], 'entity' => $this->fields["entities_id"], 'right' => 'all')); } else { echo getUserName($this->fields["users_id_recipient"], $showuserlink); } echo "".__('Last update').""; if ($this->fields['users_id_lastupdater'] > 0) { //TRANS: %1$s is the update date, %2$s is the last updater name printf(__('%1$s by %2$s'), Html::convDateTime($this->fields["date_mod"]), getUserName($this->fields["users_id_lastupdater"], $showuserlink)); } echo "
    ".__('Resolution date').""; Html::showDateTimeFormItem("solvedate", $this->fields["solvedate"], 1, false, $canupdate); echo "".__('Close date').""; Html::showDateTimeFormItem("closedate", $this->fields["closedate"], 1, false, $canupdate); echo " 
    "; echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if (!$ID) { echo "
    ".sprintf(__('%1$s%2$s'), __('Type'), $tt->getMandatoryMark('type')).""; // Permit to set type when creating ticket without update right if ($canupdate || !$ID) { $opt = array('value' => $this->fields["type"]); /// Auto submit to load template if (!$ID) { $opt['on_change'] = 'submit()'; } $rand = self::dropdownType('type', $opt); if ($ID) { $params = array('type' => '__VALUE__', 'entity_restrict' => $this->fields['entities_id'], 'value' => $this->fields['itilcategories_id'], 'currenttype' => $this->fields['type']); Ajax::updateItemOnSelectEvent("dropdown_type$rand", "show_category_by_type", $CFG_GLPI["root_doc"]."/ajax/dropdownTicketCategories.php", $params); } } else { echo self::getTicketTypeName($this->fields["type"]); } echo "".sprintf(__('%1$s%2$s'), __('Category'), $tt->getMandatoryMark('itilcategories_id')).""; // Permit to set category when creating ticket without update right if ($canupdate || !$ID || $canupdate_descr) { $opt = array('value' => $this->fields["itilcategories_id"], 'entity' => $this->fields["entities_id"]); if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") { $opt['condition'] = "`is_helpdeskvisible`='1' AND "; } else { $opt['condition'] = ''; } /// Auto submit to load template if (!$ID) { $opt['on_change'] = 'submit()'; } /// if category mandatory, no empty choice /// no empty choice is default value set on ticket creation, else yes if (($ID || $values['itilcategories_id']) && $tt->isMandatoryField("itilcategories_id") && ($this->fields["itilcategories_id"] > 0)) { $opt['display_emptychoice'] = false; } switch ($this->fields["type"]) { case self::INCIDENT_TYPE : $opt['condition'] .= "`is_incident`='1'"; break; case self::DEMAND_TYPE : $opt['condition'] .= "`is_request`='1'"; break; default : break; } echo ""; ITILCategory::dropdown($opt); echo ""; } else { echo Dropdown::getDropdownName("glpi_itilcategories", $this->fields["itilcategories_id"]); } echo "
    "; $this->showActorsPartForm($ID, $values); echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; // Display validation state echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; // Need comment right to add a followup with the actiontime if (!$ID && Session::haveRight("global_add_followups","1")) { echo ""; echo ""; } else { echo ""; } echo ""; echo ""; echo "
    ".$tt->getBeginHiddenFieldText('status'); printf(__('%1$s%2$s'), __('Status'), $tt->getMandatoryMark('status')); echo $tt->getEndHiddenFieldText('status').""; echo $tt->getBeginHiddenFieldValue('status'); if ($canstatus) { self::dropdownStatus(array('value' => $this->fields["status"], 'showtype' => 'allowed')); } else { echo self::getStatus($this->fields["status"]); } echo $tt->getEndHiddenFieldValue('status',$this); echo "".$tt->getBeginHiddenFieldText('requesttypes_id'); printf(__('%1$s%2$s'), __('Request source'), $tt->getMandatoryMark('requesttypes_id')); echo $tt->getEndHiddenFieldText('requesttypes_id').""; echo $tt->getBeginHiddenFieldValue('requesttypes_id'); if ($canupdate) { RequestType::dropdown(array('value' => $this->fields["requesttypes_id"])); } else { echo Dropdown::getDropdownName('glpi_requesttypes', $this->fields["requesttypes_id"]); } echo $tt->getEndHiddenFieldValue('requesttypes_id',$this); echo "
    ".$tt->getBeginHiddenFieldText('urgency'); printf(__('%1$s%2$s'), __('Urgency'), $tt->getMandatoryMark('urgency')); echo $tt->getEndHiddenFieldText('urgency').""; if (($canupdate && $canpriority) || !$ID || $canupdate_descr) { // Only change during creation OR when allowed to change priority OR when user is the creator echo $tt->getBeginHiddenFieldValue('urgency'); $idurgency = self::dropdownUrgency(array('value' => $this->fields["urgency"])); echo $tt->getEndHiddenFieldValue('urgency', $this); } else { $idurgency = "value_urgency".mt_rand(); echo ""; echo parent::getUrgencyName($this->fields["urgency"]); } echo ""; if (!$ID) { echo $tt->getBeginHiddenFieldText('_add_validation'); printf(__('%1$s%2$s'), __('Approval request'), $tt->getMandatoryMark('_add_validation')); echo $tt->getEndHiddenFieldText('_add_validation'); } else { echo $tt->getBeginHiddenFieldText('global_validation'); _e('Approval'); echo $tt->getEndHiddenFieldText('global_validation'); } echo ""; if (!$ID) { echo $tt->getBeginHiddenFieldValue('_add_validation'); $validation_right = ''; if (($values['type'] == self::INCIDENT_TYPE) && Session::haveRight('create_incident_validation', 1)) { $validation_right = 'validate_incident'; } if (($values['type'] == self::DEMAND_TYPE) && Session::haveRight('create_request_validation', 1)) { $validation_right = 'validate_request'; } if (!empty($validation_right)) { User::dropdown(array('name' => "_add_validation", 'entity' => $this->fields['entities_id'], 'right' => $validation_right, 'value' => $values['_add_validation'])); } echo $tt->getEndHiddenFieldValue('_add_validation',$this); if ($tt->isPredefinedField('global_validation')) { echo ""; } } else { echo $tt->getBeginHiddenFieldValue('global_validation'); if ($canupdate) { TicketValidation::dropdownStatus('global_validation', array('global' => true, 'value' => $this->fields['global_validation'])); } else { echo TicketValidation::getStatus($this->fields['global_validation']); } echo $tt->getEndHiddenFieldValue('global_validation',$this); } echo "
    ".$tt->getBeginHiddenFieldText('impact'); printf(__('%1$s%2$s'), __('Impact'), $tt->getMandatoryMark('impact')); echo $tt->getEndHiddenFieldText('impact').""; echo $tt->getBeginHiddenFieldValue('impact'); if ($canupdate) { $idimpact = self::dropdownImpact(array('value' => $this->fields["impact"])); } else { $idimpact = "value_impact".mt_rand(); echo ""; echo parent::getImpactName($this->fields["impact"]); } echo $tt->getEndHiddenFieldValue('impact',$this); echo "".$tt->getBeginHiddenFieldText('itemtype'); printf(__('%1$s%2$s'), __('Associated element'), $tt->getMandatoryMark('itemtype')); if ($ID && $canupdate) { echo " ".__s("; } echo $tt->getEndHiddenFieldText('itemtype'); echo ""; echo $tt->getBeginHiddenFieldValue('itemtype'); // Select hardware on creation or if have update right if ($canupdate || !$ID || $canupdate_descr) { if ($ID) { if ($this->fields['itemtype'] && ($item = getItemForItemtype($this->fields['itemtype'])) && $this->fields["items_id"]) { if ($item->can($this->fields["items_id"],'r')) { printf(__('%1$s - %2$s'), $item->getTypeName(), $item->getLink(array('comments' => true))); } else { printf(__('%1$s - %2$s'), $item->getTypeName(), $item->getNameID()); } } } $dev_user_id = 0; $dev_itemtype = $this->fields["itemtype"]; $dev_items_id = $this->fields["items_id"]; if (!$ID) { $dev_user_id = $values['_users_id_requester']; $dev_itemtype = $values["itemtype"]; $dev_items_id = $values["items_id"]; } else if (isset($this->users[CommonITILActor::REQUESTER]) && (count($this->users[CommonITILActor::REQUESTER]) == 1)) { foreach ($this->users[CommonITILActor::REQUESTER] as $user_id_single) { $dev_user_id = $user_id_single['users_id']; } } if ($ID) { echo ""; } echo ""; } else { if ($ID && $this->fields['itemtype'] && ($item = getItemForItemtype($this->fields['itemtype']))) { if ($item->can($this->fields["items_id"],'r')) { printf(__('%1$s - %2$s'), $item->getTypeName(), $item->getLink(array('comments' => true))); } else { printf(__('%1$s - %2$s'), $item->getTypeName(), $item->getNameID()); } } else { _e('General'); } } echo $tt->getEndHiddenFieldValue('itemtype',$this); echo "
    ".sprintf(__('%1$s%2$s'), __('Priority'), $tt->getMandatoryMark('priority')).""; $idajax = 'change_priority_' . mt_rand(); if ($canupdate && $canpriority && !$tt->isHiddenField('priority')) { $idpriority = parent::dropdownPriority(array('value' => $this->fields["priority"], 'withmajor' => true)); echo " "; } else { $idpriority = 0; echo "".parent::getPriorityName($this->fields["priority"]).""; } if ($canupdate || $canupdate_descr) { $params = array('urgency' => '__VALUE0__', 'impact' => '__VALUE1__', 'priority' => $idpriority); Ajax::updateItemOnSelectEvent(array($idurgency, $idimpact), $idajax, $CFG_GLPI["root_doc"]."/ajax/priority.php", $params); } echo "
    ".$tt->getBeginHiddenFieldText('actiontime'); printf(__('%1$s%2$s'), __('Total duration'), $tt->getMandatoryMark('actiontime')); echo $tt->getEndHiddenFieldText('actiontime').""; echo $tt->getBeginHiddenFieldValue('actiontime'); Dropdown::showTimeStamp('actiontime', array('value' => $values['actiontime'], 'addfirstminutes' => true)); echo $tt->getEndHiddenFieldValue('actiontime',$this); echo "".$tt->getBeginHiddenFieldText('locations_id'); printf(__('%1$s%2$s'), __('Location'), $tt->getMandatoryMark('locations_id')); echo $tt->getEndHiddenFieldText('locations_id').""; echo $tt->getBeginHiddenFieldValue('locations_id'); if ($canupdate) { Location::dropdown(array('value' => $this->fields['locations_id'], 'entity' => $this->fields['entities_id'])); } else { echo Dropdown::getDropdownName('glpi_locations', $this->fields["locations_id"]); } echo $tt->getEndHiddenFieldValue('locations_id', $this); echo "
    "; if ($ID) { $this->showActorsPartForm($ID, $values); } $view_linked_tickets = ($ID || $canupdate); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; // Permit to add doc when creating a ticket if (!$ID) { echo ""; echo ""; } else { echo ""; } if ($view_linked_tickets) { echo "'; echo ""; } else { echo ""; } echo ""; if ((!$ID || $canupdate || $canupdate_descr || Session::haveRight("assign_ticket","1") || Session::haveRight("steal_ticket","1")) && !$options['template_preview']) { echo ""; if ($ID) { if (Session::haveRight('delete_ticket',1)) { echo ""; } else { echo ""; } echo ""; } } else { echo "
    ".$tt->getBeginHiddenFieldText('name'); printf(__('%1$s%2$s'), __('Title'), $tt->getMandatoryMark('name')); echo $tt->getEndHiddenFieldText('name').""; if (!$ID || $canupdate_descr) { echo $tt->getBeginHiddenFieldValue('name'); $rand = mt_rand(); echo "\n"; echo "
    \n"; if (empty($this->fields["name"])) { _e('Without title'); } else { echo $this->fields["name"]; } echo "
    \n"; echo "
    \n"; echo "
    \n"; if (!$ID) { echo ""; } echo $tt->getEndHiddenFieldValue('name', $this); } else { if (empty($this->fields["name"])) { _e('Without title'); } else { echo $this->fields["name"]; } } echo "
    ".$tt->getBeginHiddenFieldText('content'); printf(__('%1$s%2$s'), __('Description'), $tt->getMandatoryMark('content')); echo $tt->getEndHiddenFieldText('content').""; if (!$ID || $canupdate_descr) { // Admin =oui on autorise la modification de la description echo $tt->getBeginHiddenFieldValue('content'); $rand = mt_rand(); echo "\n"; echo "
    \n"; if (!empty($this->fields["content"])) { echo nl2br($this->fields["content"]); } else { _e('Empty description'); } echo "
    \n"; echo "
    \n"; if (!$ID) { echo ""; } echo $tt->getEndHiddenFieldValue('content', $this); } else { echo nl2br($this->fields["content"]); } echo "
    ".sprintf(__('File (%s)'), Document::getMaxUploadSize()); echo "\""."; echo " "; self::showDocumentAddButton(); echo ""; echo "
    "; $docnb = Document_Item::countForItem($this); echo "getLinkURL()."&forcetab=Document_Item$1\">"; //TRANS: %d is the document number echo sprintf(_n('%d associated document', '%d associated documents', $docnb), $docnb); echo "". _n('Linked ticket', 'Linked tickets', 2); $rand_linked_ticket = mt_rand(); if ($canupdate) { echo " "; echo "\"".__s('Add')."\""; } echo '"; if ($canupdate) { echo ""; if (isset($values["_link"]) && !empty($values["_link"]['tickets_id_2'])) { echo ""; } } Ticket_Ticket::displayLinkedTicketsTo($ID); echo "
    "; if ($this->fields["is_deleted"] == 1) { echo ""; if ($this->fields["is_deleted"] == 1) { echo ""; } else { echo ""; echo ""; } echo ""; } else { echo ""; echo ""; if ($tt->isField('id') && ($tt->fields['id'] > 0)) { echo ""; echo ""; } } } echo "
    "; echo ""; echo "
    "; if (!$options['template_preview']) { Html::closeForm(); $this->addDivForTabs(); } return true; } /** * @param $size (default 25) **/ static function showDocumentAddButton($size=25) { global $CFG_GLPI; echo ""; echo "\"".'); nbfiles++; if (nbfiles==maxfiles) { Ext.get('addfilebutton').hide(); } }\" class='pointer' src='".$CFG_GLPI["root_doc"]."/pics/add_dropdown.png'>"; } /** * @param $start * @param $status (default ''process) * @param $showgrouptickets (true by default) */ static function showCentralList($start, $status="process", $showgrouptickets=true) { global $DB, $CFG_GLPI; if (!Session::haveRight("show_all_ticket","1") && !Session::haveRight("show_assign_ticket","1") && !Session::haveRight("create_ticket","1") && !Session::haveRight("validate_incident","1") && !Session::haveRight("validate_request","1")) { return false; } $search_users_id = " (`glpi_tickets_users`.`users_id` = '".Session::getLoginUserID()."' AND `glpi_tickets_users`.`type` = '".CommonITILActor::REQUESTER."') "; $search_assign = " (`glpi_tickets_users`.`users_id` = '".Session::getLoginUserID()."' AND `glpi_tickets_users`.`type` = '".CommonITILActor::ASSIGN."')"; $search_observer = " (`glpi_tickets_users`.`users_id` = '".Session::getLoginUserID()."' AND `glpi_tickets_users`.`type` = '".CommonITILActor::OBSERVER."')"; $is_deleted = " `glpi_tickets`.`is_deleted` = 0 "; if ($showgrouptickets) { $search_users_id = " 0 = 1 "; $search_assign = " 0 = 1 "; if (count($_SESSION['glpigroups'])) { $groups = implode("','",$_SESSION['glpigroups']); $search_assign = " (`glpi_groups_tickets`.`groups_id` IN ('$groups') AND `glpi_groups_tickets`.`type` = '".CommonITILActor::ASSIGN."')"; if (Session::haveRight("show_group_ticket",1)) { $search_users_id = " (`glpi_groups_tickets`.`groups_id` IN ('$groups') AND `glpi_groups_tickets`.`type` = '".CommonITILActor::REQUESTER."') "; } if (Session::haveRight("show_group_ticket",1)) { $search_observer = " (`glpi_groups_tickets`.`groups_id` IN ('$groups') AND `glpi_groups_tickets`.`type` = '".CommonITILActor::OBSERVER."') "; } } } $query = "SELECT DISTINCT `glpi_tickets`.`id` FROM `glpi_tickets` LEFT JOIN `glpi_tickets_users` ON (`glpi_tickets`.`id` = `glpi_tickets_users`.`tickets_id`) LEFT JOIN `glpi_groups_tickets` ON (`glpi_tickets`.`id` = `glpi_groups_tickets`.`tickets_id`)"; switch ($status) { case "waiting" : // on affiche les tickets en attente $query .= "WHERE $is_deleted AND ($search_assign) AND `status` = '".self::WAITING."' ". getEntitiesRestrictRequest("AND", "glpi_tickets"); break; case "process" : // on affiche les tickets planifiés ou assignés au user $query .= "WHERE $is_deleted AND ( $search_assign ) AND (`status` IN ('".implode("','", self::getProcessStatusArray())."')) ". getEntitiesRestrictRequest("AND", "glpi_tickets"); break; case "toapprove" : // on affiche les tickets planifiés ou assignés au user $query .= "WHERE $is_deleted AND (`status` = '".self::SOLVED."') AND ($search_users_id"; if (!$showgrouptickets) { $query .= " OR `glpi_tickets`.users_id_recipient = '".Session::getLoginUserID()."' "; } $query .= ")". getEntitiesRestrictRequest("AND", "glpi_tickets"); break; case "tovalidate" : // on affiche les tickets à valider $query .= " LEFT JOIN `glpi_ticketvalidations` ON (`glpi_tickets`.`id` = `glpi_ticketvalidations`.`tickets_id`) WHERE $is_deleted AND `users_id_validate` = '".Session::getLoginUserID()."' AND `glpi_ticketvalidations`.`status` = 'waiting' AND (`glpi_tickets`.`status` NOT IN ('".self::CLOSED."', '".self::SOLVED."')) ". getEntitiesRestrictRequest("AND", "glpi_tickets"); break; case "rejected" : // on affiche les tickets rejetés $query .= "WHERE $is_deleted AND ($search_assign) AND `status` <> '".self::CLOSED."' AND `global_validation` = 'rejected' ". getEntitiesRestrictRequest("AND", "glpi_tickets"); break; case "observed" : $query .= "WHERE $is_deleted AND ($search_observer) AND (`status` IN ('".self::INCOMING."', '".self::PLANNED."', '".self::ASSIGNED."', '".self::WAITING."')) AND NOT ( $search_assign ) AND NOT ( $search_users_id ) ". getEntitiesRestrictRequest("AND","glpi_tickets"); break; case "requestbyself" : // on affiche les tickets demandés le user qui sont planifiés ou assignés // à quelqu'un d'autre (exclut les self-tickets) default : $query .= "WHERE $is_deleted AND ($search_users_id) AND (`status` IN ('".self::INCOMING."', '".self::PLANNED."', '".self::ASSIGNED."', '".self::WAITING."')) AND NOT ( $search_assign ) ". getEntitiesRestrictRequest("AND","glpi_tickets"); } $query .= " ORDER BY date_mod DESC"; $result = $DB->query($query); $numrows = $DB->numrows($result); if ($_SESSION['glpidisplay_count_on_home'] > 0) { $query .= " LIMIT ".intval($start).','.intval($_SESSION['glpidisplay_count_on_home']); $result = $DB->query($query); $number = $DB->numrows($result); } else { $number = 0; } if ($numrows > 0) { echo ""; echo ""; if ($number) { echo ""; echo ""; echo ""; echo ""; for ($i = 0 ; $i < $number ; $i++) { $ID = $DB->result($result, $i, "id"); self::showVeryShort($ID, $forcetab); } } echo "
    "; $options['reset'] = 'reset'; $forcetab = ''; $num = 0; if ($showgrouptickets) { switch ($status) { case "toapprove" : foreach ($_SESSION['glpigroups'] as $gID) { $options['field'][$num] = 71; // groups_id $options['searchtype'][$num] = 'equals'; $options['contains'][$num] = $gID; $options['link'][$num] = (($num == 0)?'AND':'OR'); $num++; $options['field'][$num] = 12; // status $options['searchtype'][$num] = 'equals'; $options['contains'][$num] = self::SOLVED; $options['link'][$num] = 'AND'; $num++; $forcetab = 'Ticket$2'; } echo "". Html::makeTitle(__('Your tickets to close'), $number, $numrows).""; break; case "waiting" : foreach ($_SESSION['glpigroups'] as $gID) { $options['field'][$num] = 8; // groups_id_assign $options['searchtype'][$num] = 'equals'; $options['contains'][$num] = $gID; $options['link'][$num] = (($num == 0)?'AND':'OR'); $num++; $options['field'][$num] = 12; // status $options['searchtype'][$num] = 'equals'; $options['contains'][$num] = self::WAITING; $options['link'][$num] = 'AND'; $num++; } echo "". Html::makeTitle(__('Tickets on pending status'), $number, $numrows).""; break; case "process" : foreach ($_SESSION['glpigroups'] as $gID) { $options['field'][$num] = 8; // groups_id_assign $options['searchtype'][$num] = 'equals'; $options['contains'][$num] = $gID; $options['link'][$num] = (($num == 0)?'AND':'OR'); $num++; $options['field'][$num] = 12; // status $options['searchtype'][$num] = 'equals'; $options['contains'][$num] = 'process'; $options['link'][$num] = 'AND'; $num++; } echo "". Html::makeTitle(__('Tickets to be processed'), $number, $numrows).""; break; case "observed": foreach ($_SESSION['glpigroups'] as $gID) { $options['field'][$num] = 65; // groups_id $options['searchtype'][$num] = 'equals'; $options['contains'][$num] = $gID; $options['link'][$num] = (($num == 0)?'AND':'OR'); $num++; $options['field'][$num] = 12; // status $options['searchtype'][$num] = 'equals'; $options['contains'][$num] = 'notold'; $options['link'][$num] = 'AND'; $num++; } echo "". Html::makeTitle(__('Your observed tickets'), $number, $numrows).""; break; case "requestbyself" : default : foreach ($_SESSION['glpigroups'] as $gID) { $options['field'][$num] = 71; // groups_id $options['searchtype'][$num] = 'equals'; $options['contains'][$num] = $gID; $options['link'][$num] = (($num == 0)?'AND':'OR'); $num++; $options['field'][$num] = 12; // status $options['searchtype'][$num] = 'equals'; $options['contains'][$num] = 'notold'; $options['link'][$num] = 'AND'; $num++; } echo "". Html::makeTitle(__('Your tickets in progress'), $number, $numrows).""; } } else { switch ($status) { case "waiting" : $options['field'][0] = 12; // status $options['searchtype'][0] = 'equals'; $options['contains'][0] = self::WAITING; $options['link'][0] = 'AND'; $options['field'][1] = 5; // users_id_assign $options['searchtype'][1] = 'equals'; $options['contains'][1] = Session::getLoginUserID(); $options['link'][1] = 'AND'; echo "". Html::makeTitle(__('Tickets on pending status'), $number, $numrows).""; break; case "process" : $options['field'][0] = 5; // users_id_assign $options['searchtype'][0] = 'equals'; $options['contains'][0] = Session::getLoginUserID(); $options['link'][0] = 'AND'; $options['field'][1] = 12; // status $options['searchtype'][1] = 'equals'; $options['contains'][1] = 'process'; $options['link'][1] = 'AND'; echo "". Html::makeTitle(__('Tickets to be processed'), $number, $numrows).""; break; case "tovalidate" : $options['field'][0] = 55; // validation status $options['searchtype'][0] = 'equals'; $options['contains'][0] = 'waiting'; $options['link'][0] = 'AND'; $options['field'][1] = 59; // validation aprobator $options['searchtype'][1] = 'equals'; $options['contains'][1] = Session::getLoginUserID(); $options['link'][1] = 'AND'; $options['field'][2] = 12; // validation aprobator $options['searchtype'][2] = 'equals'; $options['contains'][2] = 'old'; $options['link'][2] = 'AND NOT'; $forcetab = 'TicketValidation$1'; echo "". Html::makeTitle(__('Your tickets to validate'), $number, $numrows).""; break; case "rejected" : $options['field'][0] = 52; // validation status $options['searchtype'][0] = 'equals'; $options['contains'][0] = 'rejected'; $options['link'][0] = 'AND'; $options['field'][1] = 5; // assign user $options['searchtype'][1] = 'equals'; $options['contains'][1] = Session::getLoginUserID(); $options['link'][1] = 'AND'; echo "". Html::makeTitle(__('Your rejected tickets'), $number, $numrows).""; break; case "toapprove" : $options['field'][0] = 12; // status $options['searchtype'][0] = 'equals'; $options['contains'][0] = self::SOLVED; $options['link'][0] = 'AND'; $options['field'][1] = 4; // users_id_assign $options['searchtype'][1] = 'equals'; $options['contains'][1] = Session::getLoginUserID(); $options['link'][1] = 'AND'; $options['field'][2] = 22; // users_id_recipient $options['searchtype'][2] = 'equals'; $options['contains'][2] = Session::getLoginUserID(); $options['link'][2] = 'OR'; $options['field'][3] = 12; // status $options['searchtype'][3] = 'equals'; $options['contains'][3] = self::SOLVED; $options['link'][3] = 'AND'; $forcetab = 'Ticket$2'; echo "". Html::makeTitle(__('Your tickets to close'), $number, $numrows).""; break; case "observed" : $options['field'][0] = 66; // users_id $options['searchtype'][0] = 'equals'; $options['contains'][0] = Session::getLoginUserID(); $options['link'][0] = 'AND'; $options['field'][1] = 12; // status $options['searchtype'][1] = 'equals'; $options['contains'][1] = 'notold'; $options['link'][1] = 'AND'; echo "". Html::makeTitle(__('Your observed tickets'), $number, $numrows).""; break; case "requestbyself" : default : $options['field'][0] = 4; // users_id $options['searchtype'][0] = 'equals'; $options['contains'][0] = Session::getLoginUserID(); $options['link'][0] = 'AND'; $options['field'][1] = 12; // status $options['searchtype'][1] = 'equals'; $options['contains'][1] = 'notold'; $options['link'][1] = 'AND'; echo "". Html::makeTitle(__('Your tickets in progress'), $number, $numrows).""; } } echo "
    ".__('Requester')."".__('Associated element')."".__('Description')."
    "; } } /** * Get tickets count * * @param $foruser boolean : only for current login user as requester (false by default) **/ static function showCentralCount($foruser=false) { global $DB, $CFG_GLPI; // show a tab with count of jobs in the central and give link if (!Session::haveRight("show_all_ticket","1") && !Session::haveRight("create_ticket",1)) { return false; } if (!Session::haveRight("show_all_ticket","1")) { $foruser = true; } $query = "SELECT `status`, COUNT(*) AS COUNT FROM `glpi_tickets` "; if ($foruser) { $query .= " LEFT JOIN `glpi_tickets_users` ON (`glpi_tickets`.`id` = `glpi_tickets_users`.`tickets_id` AND `glpi_tickets_users`.`type` = '".CommonITILActor::REQUESTER."')"; if (Session::haveRight("show_group_ticket",'1') && isset($_SESSION["glpigroups"]) && count($_SESSION["glpigroups"])) { $query .= " LEFT JOIN `glpi_groups_tickets` ON (`glpi_tickets`.`id` = `glpi_groups_tickets`.`tickets_id` AND `glpi_groups_tickets`.`type` = '".CommonITILActor::REQUESTER."')"; } } $query .= getEntitiesRestrictRequest("WHERE", "glpi_tickets"); if ($foruser) { $query .= " AND (`glpi_tickets_users`.`users_id` = '".Session::getLoginUserID()."' "; if (Session::haveRight("show_group_ticket",'1') && isset($_SESSION["glpigroups"]) && count($_SESSION["glpigroups"])) { $groups = implode("','",$_SESSION['glpigroups']); $query .= " OR `glpi_groups_tickets`.`groups_id` IN ('$groups') "; } $query.= ")"; } $query_deleted = $query; $query .= " AND NOT `glpi_tickets`.`is_deleted` GROUP BY `status`"; $query_deleted .= " AND `glpi_tickets`.`is_deleted` GROUP BY `status`"; $result = $DB->query($query); $result_deleted = $DB->query($query_deleted); $status = array(); foreach (self::getAllStatusArray() as $key => $val) { $status[$key] = 0; } if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { $status[$data["status"]] = $data["COUNT"]; } } $number_deleted = 0; if ($DB->numrows($result_deleted) > 0) { while ($data = $DB->fetch_assoc($result_deleted)) { $number_deleted += $data["COUNT"]; } } $options['field'][0] = 12; $options['searchtype'][0] = 'equals'; $options['contains'][0] = 'process'; $options['link'][0] = 'AND'; $options['reset'] ='reset'; echo ""; echo ""; echo ""; foreach ($status as $key => $val) { $options['contains'][0] = $key; echo ""; echo ""; echo ""; } $options['contains'][0] = 'all'; $options['is_deleted'] = 1; echo ""; echo ""; echo ""; echo "
    "; if ($_SESSION["glpiactiveprofile"]["interface"] != "central") { echo "". __('Create a ticket')." \"".__s('Add')."\""; } else { echo "".__('Ticket followup').""; } echo "
    "._n('Ticket','Tickets',2).""._x('quantity', 'Number')."
    ".self::getStatus($key)."$val
    ".__('Deleted')."".$number_deleted."

    "; } static function showCentralNewList() { global $DB, $CFG_GLPI; if (!Session::haveRight("show_all_ticket","1")) { return false; } $query = "SELECT ".self::getCommonSelect()." FROM `glpi_tickets` ".self::getCommonLeftJoin()." WHERE `status` = '".self::INCOMING."' ". getEntitiesRestrictRequest("AND","glpi_tickets")." AND NOT `is_deleted` ORDER BY `glpi_tickets`.`date_mod` DESC LIMIT ".intval($_SESSION['glpilist_limit']); $result = $DB->query($query); $number = $DB->numrows($result); if ($number > 0) { Session::initNavigateListItems('Ticket'); $options['field'][0] = 12; $options['searchtype'][0] = 'equals'; $options['contains'][0] = self::INCOMING; $options['link'][0] = 'AND'; $options['reset'] ='reset'; echo "
    "; //TRANS: %d is the number of new tickets echo ""; self::commonListHeader(Search::HTML_OUTPUT); while ($data = $DB->fetch_assoc($result)) { Session::addToNavigateListItems('Ticket',$data["id"]); self::showShort($data["id"], 0); } echo "
    ".sprintf(_n('%d new ticket','%d new tickets', $number), $number); echo "".__('Show all').""; echo "
    "; } else { echo "
    "; echo ""; echo ""; echo "
    ".__('No ticket found.')."
    "; echo "

    "; } } /** * @param $output_type (default 'Search::HTML_OUTPUT') * @param $mass_id id of the form to check all (default '') */ static function commonListHeader($output_type=Search::HTML_OUTPUT, $mass_id='') { // New Line for Header Items Line echo Search::showNewLine($output_type); // $show_sort if $header_num = 1; $items = array(); $items[(empty($mass_id)?' ':Html::getCheckAllAsCheckbox($mass_id))] = ''; $items[__('Status')] = "glpi_tickets.status"; $items[__('Date')] = "glpi_tickets.date"; $items[__('Last update')] = "glpi_tickets.date_mod"; if (count($_SESSION["glpiactiveentities"]) > 1) { $items[_n('Entity', 'Entities', 2)] = "glpi_entities.completename"; } $items[__('Priority')] = "glpi_tickets.priority"; $items[__('Requester')] = "glpi_tickets.users_id"; $items[__('Assigned')] = "glpi_tickets.users_id_assign"; $items[__('Associated element')] = "glpi_tickets.itemtype, glpi_tickets.items_id"; $items[__('Category')] = "glpi_itilcategories.completename"; $items[__('Title')] = "glpi_tickets.name"; foreach ($items as $key => $val) { $issort = 0; $link = ""; echo Search::showHeaderItem($output_type,$key,$header_num,$link); } // End Line for column headers echo Search::showEndLine($output_type); } /** * Display tickets for an item * * Will also display tickets of linked items * * @param $item CommonDBTM object * * @return nothing (display a table) **/ static function showListForItem(CommonDBTM $item) { global $DB, $CFG_GLPI; if (!Session::haveRight("show_all_ticket","1")) { return false; } if ($item->isNewID($item->getID())) { return false; } $restrict = ''; $order = ''; $options['reset'] = 'reset'; switch ($item->getType()) { case 'User' : $restrict = "(`glpi_tickets_users`.`users_id` = '".$item->getID()."' ". " AND `glpi_tickets_users`.`type` = ".CommonITILActor::REQUESTER.")"; $order = '`glpi_tickets`.`date_mod` DESC'; $options['reset'] = 'reset'; $options['field'][0] = 4; // status $options['searchtype'][0] = 'equals'; $options['contains'][0] = $item->getID(); $options['link'][0] = 'AND'; break; case 'SLA' : $restrict = "(`slas_id` = '".$item->getID()."')"; $order = '`glpi_tickets`.`due_date` DESC'; $options['field'][0] = 30; $options['searchtype'][0] = 'equals'; $options['contains'][0] = $item->getID(); $options['link'][0] = 'AND'; break; case 'Supplier' : $restrict = "(`glpi_suppliers_tickets`.`suppliers_id` = '".$item->getID()."' ". " AND `glpi_suppliers_tickets`.`type` = ".CommonITILActor::ASSIGN.")"; $order = '`glpi_tickets`.`date_mod` DESC'; $options['field'][0] = 6; $options['searchtype'][0] = 'equals'; $options['contains'][0] = $item->getID(); $options['link'][0] = 'AND'; break; case 'Group' : // Mini search engine if ($item->haveChildren()) { $tree = Session::getSavedOption(__CLASS__, 'tree', 0); echo ""; echo ""; echo "
    ".__('Last tickets')."
    "; echo __('Child groups')." "; Dropdown::showYesNo('tree', $tree, -1, array('on_change' => 'reloadTab("start=0&tree="+this.value)')); } else { $tree = 0; } echo "
    "; if ($tree) { $restrict = "IN (".implode(',', getSonsOf('glpi_groups', $item->getID())).")"; } else { $restrict = "='".$item->getID()."'"; } $restrict = "(`glpi_groups_tickets`.`groups_id` $restrict AND `glpi_groups_tickets`.`type` = ".CommonITILActor::REQUESTER.")"; $order = '`glpi_tickets`.`date_mod` DESC'; $options['field'][0] = 71; $options['searchtype'][0] = ($tree ? 'under' : 'equals'); $options['contains'][0] = $item->getID(); $options['link'][0] = 'AND'; break; default : $restrict = "(`items_id` = '".$item->getID()."' AND `itemtype` = '".$item->getType()."')"; $order = '`glpi_tickets`.`date_mod` DESC'; $options['field'][0] = 12; $options['searchtype'][0] = 'equals'; $options['contains'][0] = 'all'; $options['link'][0] = 'AND'; $options['itemtype2'][0] = $item->getType(); $options['field2'][0] = Search::getOptionNumber($item->getType(), 'id'); $options['searchtype2'][0] = 'equals'; $options['contains2'][0] = $item->getID(); $options['link2'][0] = 'AND'; break; } $query = "SELECT ".self::getCommonSelect()." FROM `glpi_tickets` ".self::getCommonLeftJoin()." WHERE $restrict ". getEntitiesRestrictRequest("AND","glpi_tickets")." ORDER BY $order LIMIT ".intval($_SESSION['glpilist_limit']); $result = $DB->query($query); $number = $DB->numrows($result); // Ticket for the item echo "
    "; // Link to open a new ticket if ($item->getID() && Ticket::isPossibleToAssignType($item->getType()) && Session::haveRight('create_ticket', 1)) { Html::showSimpleForm($CFG_GLPI["root_doc"]."/front/ticket.form.php", '_add_fromitem', __('New ticket for this item...'), array('itemtype' => $item->getType(), 'items_id' => $item->getID())); } echo ""; if ($number > 0) { Session::initNavigateListItems('Ticket', //TRANS : %1$s is the itemtype name, %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), $item->getTypeName(1), $item->getName())); echo ""; } else { echo ""; } if ($item->getID() && ($item->getType() == 'User') && Session::haveRight('create_ticket', 1)) { echo ""; } // Ticket list if ($number > 0) { self::commonListHeader(Search::HTML_OUTPUT); while ($data = $DB->fetch_assoc($result)) { Session::addToNavigateListItems('Ticket',$data["id"]); self::showShort($data["id"], 0); } } echo "
    "; $title = sprintf(_n('Last %d ticket', 'Last %d tickets', $number), $number); $link = "".__('Show all').""; $title = printf(__('%1$s (%2$s)'), $title, $link); echo "
    ".__('No ticket found.')."
    "; Html::showSimpleForm($CFG_GLPI["root_doc"]."/front/ticket.form.php", '_add_fromitem', __('New ticket for this item...'), array('_users_id_requester' => $item->getID())); echo "
    "; // Tickets for linked items if ($subquery = $item->getSelectLinkedItem()) { $query = "SELECT ".self::getCommonSelect()." FROM `glpi_tickets` ".self::getCommonLeftJoin()." WHERE (`itemtype`,`items_id`) IN (" . $subquery . ")". getEntitiesRestrictRequest(' AND ', 'glpi_tickets') . " ORDER BY `glpi_tickets`.`date_mod` DESC LIMIT ".intval($_SESSION['glpilist_limit']); $result = $DB->query($query); $number = $DB->numrows($result); echo "
    "; echo ""; if ($number > 0) { self::commonListHeader(Search::HTML_OUTPUT); while ($data = $DB->fetch_assoc($result)) { // Session::addToNavigateListItems(TRACKING_TYPE,$data["id"]); self::showShort($data["id"], 0); } } else { echo ""; } echo "
    "; echo _n('Ticket on linked items', 'Tickets on linked items', $number); echo "
    ".__('No ticket found.')."
    "; } // Subquery for linked item } /** * Display a line for a ticket * * @param $id Integer ID of the ticket * @param $followups Boolean show followup columns * @param $output_type Integer type of output (default Search::HTML_OUTPUT) * @param $row_num Integer row number (default 0) * @param $id_for_massaction Integer default 0 means no massive action (default 0) * */ static function showShort($id, $followups, $output_type=Search::HTML_OUTPUT, $row_num=0, $id_for_massaction=0) { global $CFG_GLPI; $rand = mt_rand(); /// TODO to be cleaned. Get datas and clean display links // Prints a job in short form // Should be called in a -segment // Print links or not in case of user view // Make new job object and fill it from database, if success, print it $job = new self(); $candelete = Session::haveRight("delete_ticket", "1"); $canupdate = Session::haveRight("update_ticket", "1"); $showprivate = Session::haveRight("show_full_ticket", "1"); $align = "class='center"; $align_desc = "class='left"; if ($followups) { $align .= " top'"; $align_desc .= " top'"; } else { $align .= "'"; $align_desc .= "'"; } if ($job->getFromDB($id)) { $item_num = 1; $bgcolor = $_SESSION["glpipriority_".$job->fields["priority"]]; echo Search::showNewLine($output_type,$row_num%2); $check_col = ''; if (($candelete || $canupdate) && ($output_type == Search::HTML_OUTPUT) && $id_for_massaction) { $check_col = Html::getMassiveActionCheckBox(__CLASS__, $id_for_massaction); } echo Search::showItem($output_type, $check_col, $item_num, $row_num, $align); // First column $first_col = sprintf(__('%1$s: %2$s'), __('ID'), $job->fields["id"]); if ($output_type == Search::HTML_OUTPUT) { $first_col .= "
    \"".self::getStatus($job-fields["status"])."\" title=\"". self::getStatus($job->fields["status"])."\">"; } else { $first_col = sprintf(__('%1$s - %2$s'), $first_col, self::getStatus($job->fields["status"])); } echo Search::showItem($output_type, $first_col, $item_num, $row_num, $align); // Second column if ($job->fields['status'] == self::CLOSED) { $second_col = sprintf(__('Closed on %s'), ($output_type == Search::HTML_OUTPUT?'
    ':''). Html::convDateTime($job->fields['closedate'])); } else if ($job->fields['status'] == self::SOLVED) { $second_col = sprintf(__('Solved on %s'), ($output_type == Search::HTML_OUTPUT?'
    ':''). Html::convDateTime($job->fields['solvedate'])); } else if ($job->fields['begin_waiting_date']) { $second_col = sprintf(__('Put on hold on %s'), ($output_type == Search::HTML_OUTPUT?'
    ':''). Html::convDateTime($job->fields['begin_waiting_date'])); } else if ($job->fields['due_date']) { $second_col = sprintf(__('%1$s: %2$s'), __('Due date'), ($output_type == Search::HTML_OUTPUT?'
    ':''). Html::convDateTime($job->fields['due_date'])); } else { $second_col = sprintf(__('Opened on %s'), ($output_type == Search::HTML_OUTPUT?'
    ':''). Html::convDateTime($job->fields['date'])); } echo Search::showItem($output_type, $second_col, $item_num, $row_num, $align." width=130"); // Second BIS column $second_col = Html::convDateTime($job->fields["date_mod"]); echo Search::showItem($output_type, $second_col, $item_num, $row_num, $align." width=90"); // Second TER column if (count($_SESSION["glpiactiveentities"]) > 1) { $second_col = Dropdown::getDropdownName('glpi_entities', $job->fields['entities_id']); echo Search::showItem($output_type, $second_col, $item_num, $row_num, $align." width=100"); } // Third Column echo Search::showItem($output_type, "".parent::getPriorityName($job->fields["priority"]). "", $item_num, $row_num, "$align bgcolor='$bgcolor'"); // Fourth Column $fourth_col = ""; if (isset($job->users[CommonITILActor::REQUESTER]) && count($job->users[CommonITILActor::REQUESTER])) { foreach ($job->users[CommonITILActor::REQUESTER] as $d) { $userdata = getUserName($d["users_id"], 2); $fourth_col .= sprintf(__('%1$s %2$s'), "".$userdata['name']."", Html::showToolTip($userdata["comment"], array('link' => $userdata["link"], 'display' => false))); $fourth_col .= "
    "; } } if (isset($job->groups[CommonITILActor::REQUESTER]) && count($job->groups[CommonITILActor::REQUESTER])) { foreach ($job->groups[CommonITILActor::REQUESTER] as $d) { $fourth_col .= Dropdown::getDropdownName("glpi_groups", $d["groups_id"]); $fourth_col .= "
    "; } } echo Search::showItem($output_type, $fourth_col, $item_num, $row_num, $align); // Fifth column $fifth_col = ""; if (isset($job->users[CommonITILActor::ASSIGN]) && count($job->users[CommonITILActor::ASSIGN])) { foreach ($job->users[CommonITILActor::ASSIGN] as $d) { $userdata = getUserName($d["users_id"], 2); $fifth_col .= sprintf(__('%1$s %2$s'), "".$userdata['name']."", Html::showToolTip($userdata["comment"], array('link' => $userdata["link"], 'display' => false))); $fifth_col .= "
    "; } } if (isset($job->groups[CommonITILActor::ASSIGN]) && count($job->groups[CommonITILActor::ASSIGN])) { foreach ($job->groups[CommonITILActor::ASSIGN] as $d) { $fifth_col .= Dropdown::getDropdownName("glpi_groups", $d["groups_id"]); $fifth_col .= "
    "; } } if (isset($job->suppliers[CommonITILActor::ASSIGN]) && count($job->suppliers[CommonITILActor::ASSIGN])) { foreach ($job->suppliers[CommonITILActor::ASSIGN] as $d) { $fifth_col .= Dropdown::getDropdownName("glpi_suppliers", $d["suppliers_id"]); $fifth_col .= "
    "; } } echo Search::showItem($output_type, $fifth_col, $item_num, $row_num, $align); // Sixth Colum $sixth_col = ""; $is_deleted = false; if (!empty($job->fields["itemtype"]) && ($job->fields["items_id"] > 0)) { if ($item = getItemForItemtype($job->fields["itemtype"])) { if ($item->getFromDB($job->fields["items_id"])) { $is_deleted = $item->isDeleted(); $sixth_col .= $item->getTypeName(); $sixth_col .= "
    "; if ($item->canView()) { $sixth_col .= $item->getLink(array('linkoption' => $output_type==Search::HTML_OUTPUT)); } else { $sixth_col .= $item->getNameID(); } $sixth_col .= ""; } } } else if (empty($job->fields["itemtype"])) { $sixth_col = __('General'); } echo Search::showItem($output_type, $sixth_col, $item_num, $row_num, ($is_deleted?" class='center deleted' ":$align)); // Seventh column echo Search::showItem($output_type, "". Dropdown::getDropdownName('glpi_itilcategories', $job->fields["itilcategories_id"]). "", $item_num, $row_num, $align); // Eigth column $eigth_column = "".$job->fields["name"]." "; // Add link if ($job->canViewItem()) { $eigth_column = "$eigth_column"; if ($followups && ($output_type == Search::HTML_OUTPUT)) { $eigth_column .= TicketFollowup::showShortForTicket($job->fields["id"]); } else { $eigth_column = sprintf(__('%1$s (%2$s)'), $eigth_column, sprintf(__('%1$s - %2$s'), $job->numberOfFollowups($showprivate), $job->numberOfTasks($showprivate))); } } if ($output_type == Search::HTML_OUTPUT) { $eigth_column = sprintf(__('%1$s %2$s'), $eigth_column, Html::showToolTip($job->fields['content'], array('display' => false, 'applyto' => "ticket".$job->fields["id"]. $rand))); } echo Search::showItem($output_type, $eigth_column, $item_num, $row_num, $align_desc."width='300'"); // Finish Line echo Search::showEndLine($output_type); } else { echo ""; echo ""; } } /** * @param $ID * @param $forcetab string name of the tab to force at the display (default '') **/ static function showVeryShort($ID, $forcetab='') { global $CFG_GLPI; // Prints a job in short form // Should be called in a
    ".__('No ticket in progress.')."
    -segment // Print links or not in case of user view // Make new job object and fill it from database, if success, print it $showprivate = Session::haveRight("show_full_ticket", 1); $job = new self(); $rand = mt_rand(); if ($job->getFromDBwithData($ID, 0)) { $bgcolor = $_SESSION["glpipriority_".$job->fields["priority"]]; // $rand = mt_rand(); echo ""; echo ""; echo ""; if ($job->hardwaredatas && $job->hardwaredatas->canView()) { echo ""; } else if ($job->hardwaredatas) { echo ""; } else { echo ""; } echo ""; // Finish Line echo ""; } else { echo ""; echo ""; } } static function getCommonSelect() { $SELECT = ""; if (count($_SESSION["glpiactiveentities"])>1) { $SELECT .= ", `glpi_entities`.`completename` AS entityname, `glpi_tickets`.`entities_id` AS entityID "; } return " DISTINCT `glpi_tickets`.*, `glpi_itilcategories`.`completename` AS catname $SELECT"; } static function getCommonLeftJoin() { $FROM = ""; if (count($_SESSION["glpiactiveentities"])>1) { $FROM .= " LEFT JOIN `glpi_entities` ON (`glpi_entities`.`id` = `glpi_tickets`.`entities_id`) "; } return " LEFT JOIN `glpi_groups_tickets` ON (`glpi_tickets`.`id` = `glpi_groups_tickets`.`tickets_id`) LEFT JOIN `glpi_tickets_users` ON (`glpi_tickets`.`id` = `glpi_tickets_users`.`tickets_id`) LEFT JOIN `glpi_suppliers_tickets` ON (`glpi_tickets`.`id` = `glpi_suppliers_tickets`.`tickets_id`) LEFT JOIN `glpi_itilcategories` ON (`glpi_tickets`.`itilcategories_id` = `glpi_itilcategories`.`id`) $FROM"; } /** * @param $output **/ static function showPreviewAssignAction($output) { //If ticket is assign to an object, display this information first if (isset($output["entities_id"]) && isset($output["items_id"]) && isset($output["itemtype"])) { if ($item = getItemForItemtype($output["itemtype"])) { if ($item->getFromDB($output["items_id"])) { echo ""; echo ""; echo ""; echo ""; } } unset($output["items_id"]); unset($output["itemtype"]); } unset($output["entities_id"]); return $output; } /** * Give cron information * * @param $name : task's name * * @return arrray of information **/ static function cronInfo($name) { switch ($name) { case 'closeticket' : return array('description' => __('Automatic tickets closing')); case 'alertnotclosed' : return array('description' => __('Not solved tickets')); case 'createinquest' : return array('description' => __('Generation of satisfaction surveys')); } return array(); } /** * Cron for ticket's automatic close * * @param $task : crontask object * * @return integer (0 : nothing done - 1 : done) **/ static function cronCloseTicket($task) { global $DB; $ticket = new self(); // Recherche des entités $tot = 0; foreach (Entity::getEntitiesToNotify('autoclose_delay') as $entity => $delay) { if ($delay >= 0) { $query = "SELECT * FROM `glpi_tickets` WHERE `entities_id` = '".$entity."' AND `status` = '".self::SOLVED."' AND `is_deleted` = 0"; if ($delay > 0) { $query .= " AND ADDDATE(`solvedate`, INTERVAL ".$delay." DAY) < CURDATE()"; } $nb = 0; foreach ($DB->request($query) as $tick) { $ticket->update(array('id' => $tick['id'], 'status' => self::CLOSED, '_auto_update' => true)); $nb++; } if ($nb) { $tot += $nb; $task->addVolume($nb); $task->log(Dropdown::getDropdownName('glpi_entities', $entity)." : $nb"); } } } return ($tot > 0); } /** * Cron for alert old tickets which are not solved * * @param $task : crontask object * * @return integer (0 : nothing done - 1 : done) **/ static function cronAlertNotClosed($task) { global $DB, $CFG_GLPI; if (!$CFG_GLPI["use_mailing"]) { return 0; } // Recherche des entités $tot = 0; foreach (Entity::getEntitiesToNotify('notclosed_delay') as $entity => $value) { $query = "SELECT `glpi_tickets`.* FROM `glpi_tickets` WHERE `glpi_tickets`.`entities_id` = '".$entity."' AND `glpi_tickets`.`is_deleted` = 0 AND `glpi_tickets`.`status` IN ('".self::INCOMING."', '".self::ASSIGNED."', '".self::PLANNED."', '".self::WAITING."') AND `glpi_tickets`.`closedate` IS NULL AND ADDDATE(`glpi_tickets`.`date`, INTERVAL ".$value." DAY) < NOW()"; $tickets = array(); foreach ($DB->request($query) as $tick) { $tickets[] = $tick; } if (!empty($tickets)) { if (NotificationEvent::raiseEvent('alertnotclosed', new self(), array('items' => $tickets, 'entities_id' => $entity))) { $tot += count($tickets); $task->addVolume(count($tickets)); $task->log(sprintf(__('%1$s: %2$s'), Dropdown::getDropdownName('glpi_entities', $entity), count($tickets))); } } } return ($tot > 0); } /** * Cron for ticketsatisfaction's automatic generated * * @param $task : crontask object * * @return integer (0 : nothing done - 1 : done) **/ static function cronCreateInquest($task) { global $DB; $conf = new Entity(); $inquest = new TicketSatisfaction(); $tot = 0; $maxentity = array(); $tabentities = array(); $rate = Entity::getUsedConfig('inquest_config', 0, 'inquest_rate'); if ($rate > 0) { $tabentities[0] = $rate; } foreach ($DB->request('glpi_entities') as $entity) { $rate = Entity::getUsedConfig('inquest_config', $entity['id'], 'inquest_rate'); $parent = Entity::getUsedConfig('inquest_config', $entity['id'], 'entities_id'); if ($rate > 0) { $tabentities[$entity['id']] = $rate; } } foreach ($tabentities as $entity => $rate) { $parent = Entity::getUsedConfig('inquest_config', $entity, 'entities_id'); $delay = Entity::getUsedConfig('inquest_config', $entity, 'inquest_delay'); $type = Entity::getUsedConfig('inquest_config', $entity); $max_closedate = Entity::getUsedConfig('inquest_config', $entity, 'max_closedate'); $query = "SELECT `glpi_tickets`.`id`, `glpi_tickets`.`closedate`, `glpi_tickets`.`entities_id` FROM `glpi_tickets` LEFT JOIN `glpi_ticketsatisfactions` ON `glpi_ticketsatisfactions`.`tickets_id` = `glpi_tickets`.`id` WHERE `glpi_tickets`.`entities_id` = '$entity' AND `glpi_tickets`.`is_deleted` = 0 AND `glpi_tickets`.`status` = '".self::CLOSED."' AND `glpi_tickets`.`closedate` > '$max_closedate' AND ADDDATE(`glpi_tickets`.`closedate`, INTERVAL $delay DAY)<=NOW() AND `glpi_ticketsatisfactions`.`id` IS NULL ORDER BY `closedate` ASC"; $nb = 0; $max_closedate = ''; foreach ($DB->request($query) as $tick) { $max_closedate = $tick['closedate']; if (mt_rand(1,100) <= $rate) { if ($inquest->add(array('tickets_id' => $tick['id'], 'date_begin' => $_SESSION["glpi_currenttime"], 'entities_id' => $tick['entities_id'], 'type' => $type))) { $nb++; } } } // conservation de toutes les max_closedate des entites filles if (!empty($max_closedate) && (!isset($maxentity[$parent]) || ($max_closedate > $maxentity[$parent]))) { $maxentity[$parent] = $max_closedate; } if ($nb) { $tot += $nb; $task->addVolume($nb); $task->log(sprintf(__('%1$s: %2$s'), Dropdown::getDropdownName('glpi_entities', $entity), $nb)); } } // Sauvegarde du max_closedate pour ne pas tester les même tickets 2 fois foreach ($maxentity as $parent => $maxdate) { $conf->getFromDB($parent); $conf->update(array('id' => $conf->fields['id'], // 'entities_id' => $parent, 'max_closedate' => $maxdate)); } return ($tot > 0); } /** * Display debug information for current object **/ function showDebug() { NotificationEvent::debugEvent($this); } } ?> glpi-0.84.3+dfsg.1/inc/ticket_ticket.class.php000066400000000000000000000166211226600447100210430ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Ticket links class Ticket_Ticket extends CommonDBRelation { // From CommonDBRelation static public $itemtype_1 = 'Ticket'; static public $items_id_1 = 'tickets_id_1'; static public $itemtype_2 = 'Ticket'; static public $items_id_2 = 'tickets_id_2'; static public $check_entity_coherency = false; static public $checkItem_2_Rights = self::HAVE_VIEW_RIGHT_ON_ITEM ; // Ticket links const LINK_TO = 1; const DUPLICATE_WITH = 2; /** * Get linked tickets to a ticket * * @param $ID ID of the ticket id * * @return array of linked tickets array(id=>linktype) **/ static function getLinkedTicketsTo ($ID) { global $DB; // Make new database object and fill variables if (empty($ID)) { return false; } $sql = "SELECT * FROM `glpi_tickets_tickets` WHERE `tickets_id_1` = '$ID' OR `tickets_id_2` = '$ID'"; $tickets = array(); foreach ($DB->request($sql) as $data) { if ($data['tickets_id_1'] != $ID) { $tickets[$data['id']] = array('link' => $data['link'], 'tickets_id' => $data['tickets_id_1']); } else { $tickets[$data['id']] = array('link' => $data['link'], 'tickets_id' => $data['tickets_id_2']); } } ksort($tickets); return $tickets; } /** * Display linked tickets to a ticket * * @param $ID ID of the ticket id * * @return nothing display **/ static function displayLinkedTicketsTo ($ID) { global $DB, $CFG_GLPI; $tickets = self::getLinkedTicketsTo($ID); $canupdate = Session::haveRight('update_ticket', '1'); $ticket = new Ticket(); if (is_array($tickets) && count($tickets)) { foreach ($tickets as $linkID => $data) { if ($ticket->getFromDB($data['tickets_id'])) { $icons = "\"".Ticket::getStatus($ticket-fields["status"])."\" title=\"". Ticket::getStatus($ticket->fields["status"])."\">"; if ($canupdate) { $icons .= ' '.Html::getSimpleForm(static::getFormURL(), 'delete', _x('button', 'Delete permanently'), array('id' => $linkID, 'tickets_id' => $ID), $CFG_GLPI["root_doc"]."/pics/delete.png"); } $text = sprintf(__('%1$s %2$s'), self::getLinkName($data['link']), $ticket->getLink()); printf(__('%1$s %2$s'), $text, $icons); } echo '
    '; } } } /** * Dropdown for links between tickets * * @param $myname select name * @param $value default value (default self::LINK_TO) **/ static function dropdownLinks($myname, $value=self::LINK_TO) { $tmp[self::LINK_TO] = __('Linked to'); $tmp[self::DUPLICATE_WITH] = __('Duplicates'); Dropdown::showFromArray($myname, $tmp, array('value' => $value)); } /** * Get Link Name * * @param $value default value **/ static function getLinkName($value) { $tmp[self::LINK_TO] = __('Linked to'); $tmp[self::DUPLICATE_WITH] = __('Duplicates'); if (isset($tmp[$value])) { return $tmp[$value]; } return NOT_AVAILABLE; } function prepareInputForAdd($input) { // Clean values $input['tickets_id_1'] = Toolbox::cleanInteger($input['tickets_id_1']); $input['tickets_id_2'] = Toolbox::cleanInteger($input['tickets_id_2']); // Check of existance of rights on both Ticket(s) is done by the parent if ($input['tickets_id_2'] == $input['tickets_id_1']) { return false; } if (!isset($input['link'])) { $input['link'] = self::LINK_TO; } // No multiple links $tickets = self::getLinkedTicketsTo($input['tickets_id_1']); if (count($tickets)) { foreach ($tickets as $key => $t) { if ($t['tickets_id'] == $input['tickets_id_2']) { // Delete old simple link if (($input['link'] == self::DUPLICATE_WITH) && ($t['link'] == self::LINK_TO)) { $tt = new Ticket_Ticket(); $tt->delete(array("id" => $key)); } else { // No duplicate link return false; } } } } return parent::prepareInputForAdd($input); } function post_deleteFromDB() { $t = new Ticket(); $t->updateDateMod($this->fields['tickets_id_1']); $t->updateDateMod($this->fields['tickets_id_2']); parent::post_deleteFromDB(); } function post_addItem() { $t = new Ticket(); $t->updateDateMod($this->fields['tickets_id_1']); $t->updateDateMod($this->fields['tickets_id_2']); parent::post_addItem(); } /** * Affect the same solution for duplicates tickets * * @param $ID ID of the ticket id * * @return nothing do the change **/ static function manageLinkedTicketsOnSolved($ID) { $ticket = new Ticket(); if ($ticket->getfromDB($ID)) { $input['solution'] = addslashes($ticket->fields['solution']); $input['solutiontypes_id'] = addslashes($ticket->fields['solutiontypes_id']); $tickets = self::getLinkedTicketsTo($ID); if (count($tickets)) { foreach ($tickets as $data) { $input['id'] = $data['tickets_id']; if ($ticket->can($input['id'],'w') && ($data['link'] == self::DUPLICATE_WITH) && ($ticket->fields['status'] != CommonITILObject::SOLVED) && ($ticket->fields['status'] != CommonITILObject::CLOSED)) { $ticket->update($input); } } } } } } ?> glpi-0.84.3+dfsg.1/inc/ticket_user.class.php000066400000000000000000000027211226600447100205320ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Ticket_User class Ticket_User extends CommonITILActor { // From CommonDBRelation static public $itemtype_1 = 'Ticket'; static public $items_id_1 = 'tickets_id'; static public $itemtype_2 = 'User'; static public $items_id_2 = 'users_id'; } ?> glpi-0.84.3+dfsg.1/inc/ticketcost.class.php000066400000000000000000000416431226600447100203730ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// TicketCost class /// since version 0.84 class TicketCost extends CommonDBChild { // From CommonDBChild static public $itemtype = 'Ticket'; static public $items_id = 'tickets_id'; public $dohistory = true; static function getTypeName($nb=0) { return _n('Cost', 'Costs', $nb); } static function canCreate() { return (Session::haveRight('ticketcost','w') && parent::canCreate()); } static function canView() { return (Session::haveRight('ticketcost','r') && parent::canView()); } /** * @since version 0.84 **/ static function canUpdate() { return (Session::haveRight('ticketcost','w') && parent::canUpdate()); } /** * @since version 0.84 **/ static function canDelete() { return (Session::haveRight('ticketcost','w') && parent::canDelete()); } /** * @see CommonDBChild::prepareInputForAdd() **/ function prepareInputForAdd($input) { if (empty($input['end_date']) || ($input['end_date'] == 'NULL') || ($input['end_date'] < $input['begin_date'])) { $input['end_date'] = $input['begin_date']; } return parent::prepareInputForAdd($input); } /** * @see CommonDBTM::prepareInputForUpdate() **/ function prepareInputForUpdate($input) { if (empty($input['end_date']) || ($input['end_date'] == 'NULL') || ($input['end_date'] < $input['begin_date'])) { $input['end_date'] = $input['begin_date']; } return parent::prepareInputForUpdate($input); } /** * @see CommonGLPI::getTabNameForItem() **/ function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { // can exists for template if (($item->getType() == 'Ticket') && Session::haveRight("ticketcost","r")) { if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(self::getTypeName(2), countElementsInTable('glpi_ticketcosts', "tickets_id = '".$item->getID()."'")); } return self::getTypeName(2); } return ''; } /** * @param $item CommonGLPI object * @param $tabnum (default 1) * @param $withtemplate (default 0) **/ static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { self::showForTicket($item, $withtemplate); return true; } /** * Init cost for creation based on previous cost **/ function initBasedOnPrevious() { $ticket = new Ticket(); if (!isset($this->fields['tickets_id']) || !$ticket->getFromDB($this->fields['tickets_id'])) { return false; } // Set actiontime to $this->fields['actiontime'] = max(0, $ticket->fields['actiontime'] - $this->getTotalActionTimeForTicket($this->fields['tickets_id'])); $lastdata = $this->getLastCostForTicket($this->fields['tickets_id']); if (isset($lastdata['end_date'])) { $this->fields['begin_date'] = $lastdata['end_date']; } if (isset($lastdata['cost_time'])) { $this->fields['cost_time'] = $lastdata['cost_time']; } if (isset($lastdata['cost_fixed'])) { $this->fields['cost_fixed'] = $lastdata['cost_fixed']; } if (isset($lastdata['budgets_id'])) { $this->fields['budgets_id'] = $lastdata['budgets_id']; } if (isset($lastdata['name'])) { $this->fields['name'] = $lastdata['name']; } } /** * Get total actiNULL 11400 0.0000 0.0000 0.0000 on time used on costs for a ticket * * @param $tickets_id integer ID of the ticket **/ function getTotalActionTimeForTicket($tickets_id) { global $DB; $query = "SELECT SUM(`actiontime`) FROM `".$this->getTable()."` WHERE `tickets_id` = '$tickets_id'"; if ($result = $DB->query($query)) { return $DB->result($result, 0, 0); } return 0; } /** * Get last datas for a ticket * * @param $tickets_id integer ID of the ticket **/ function getLastCostForTicket($tickets_id) { global $DB; $query = "SELECT * FROM `".$this->getTable()."` WHERE `tickets_id` = '$tickets_id' ORDER BY 'end_date' DESC, `id` DESC"; if ($result = $DB->query($query)) { return $DB->fetch_assoc($result); } return array(); } /** * Print the ticket cost form * * @param $ID integer ID of the item * @param $options array options used **/ function showForm($ID, $options=array()) { if (isset($options['parent']) && !empty($options['parent'])) { $ticket = $options['parent']; } if ($ID > 0) { $this->check($ID,'r'); } else { // Create item $options['tickets_id'] = $ticket->getField('id'); $this->check(-1,'w',$options); $this->initBasedOnPrevious(); } if ($ID > 0) { $tickets_id = $this->fields["tickets_id"]; } else { $tickets_id = $options['parent']->fields["id"]; } $ticket = new Ticket(); if (!$ticket->getFromDB($tickets_id)) { return false; } $this->showFormHeader($options); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $rowspan = 4; echo ""; echo "\n"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $this->showFormButtons($options); return true; } /** * Print the ticket costs * * @param $ticket Ticket object * @param $withtemplate boolean Template or basic item (default '') * * @return Nothing (call to classes members) **/ static function showForTicket(Ticket $ticket, $withtemplate='') { global $DB, $CFG_GLPI; $ID = $ticket->fields['id']; if (!$ticket->getFromDB($ID) || !$ticket->can($ID, "r") || !Session::haveRight('ticketcost', 'r')) { return false; } $canedit = Session::haveRight('ticketcost', 'w'); echo "
    "; $query = "SELECT * FROM `glpi_ticketcosts` WHERE `tickets_id` = '$ID' ORDER BY `begin_date`"; $rand = mt_rand(); if ($canedit) { echo "
    \n"; echo "\n"; echo "\n"; } if ($result = $DB->query($query)) { echo "
    ".sprintf(__('%1$s: %2$s'), __('ID'), $job->fields["id"]).""; if (isset($job->users[CommonITILActor::REQUESTER]) && count($job->users[CommonITILActor::REQUESTER])) { foreach ($job->users[CommonITILActor::REQUESTER] as $d) { if ($d["users_id"] > 0) { $userdata = getUserName($d["users_id"],2); $name = "".$userdata['name'].""; $name = sprintf(__('%1$s %2$s'), $name, Html::showToolTip($userdata["comment"], array('link' => $userdata["link"], 'display' => false))); echo $name; } else { echo $d['alternative_email']." "; } echo "
    "; } } if (isset($job->groups[CommonITILActor::REQUESTER]) && count($job->groups[CommonITILActor::REQUESTER])) { foreach ($job->groups[CommonITILActor::REQUESTER] as $d) { echo Dropdown::getDropdownName("glpi_groups", $d["groups_id"]); echo "
    "; } } echo "
    "; echo $job->hardwaredatas->getTypeName()."
    "; echo "".$job->hardwaredatas->getLink().""; echo "
    ".$job->hardwaredatas->getTypeName()."
    ". $job->hardwaredatas->getNameID()."
    ".__('General').""; $link = "getNameID().""; $link = sprintf(__('%1$s (%2$s)'), $link, sprintf(__('%1$s - %2$s'), $job->numberOfFollowups($showprivate), $job->numberOfTasks($showprivate))); $link = printf(__('%1$s %2$s'), $link, Html::showToolTip($job->fields['content'], array('applyto' => 'ticket'.$job->fields["id"].$rand, 'display' => false))); echo "
    ".__('No ticket in progress.')."
    ".__('Assign equipment')."".$item->getLink(array('comments' => true))."
    ".__('Name').""; echo ""; Html::autocompletionTextField($this,'name'); echo "".__('Begin date').""; Html::showDateFormItem("begin_date", $this->fields['begin_date']); echo "
    ".__('Duration').""; Dropdown::showTimeStamp('actiontime', array('value' => $this->fields['actiontime'], 'addfirstminutes' => true)); echo "".__('End date').""; Html::showDateFormItem("end_date", $this->fields['end_date']); echo "
    ".__('Time cost').""; echo ""; echo "".__('Comments').""; echo ""; echo "
    ".__('Fixed cost').""; echo ""; echo "
    ".__('Material cost').""; echo ""; echo "
    ".__('Budget').""; Budget::dropdown(array('value' => $this->fields["budgets_id"], 'entity' => $this->fields["entities_id"])); echo "
    "; echo ""; echo ""; echo ""; echo ""; if ($DB->numrows($result)) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; Session::initNavigateListItems(__CLASS__, //TRANS : %1$s is the itemtype name, // %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), Ticket::getTypeName(1), $ticket->getName())); $total = 0; $total_time = 0; $total_costtime = 0; $total_fixed = 0; $total_material = 0; while ($data = $DB->fetch_assoc($result)) { echo ""; $name = (empty($data['name'])? sprintf(__('%1$s (%2$s)'), $data['name'], $data['id']) : $data['name']); echo ""; echo ""; echo ""; echo ""; echo ""; $total_time += $data['actiontime']; echo ""; $total_costtime += ($data['actiontime']*$data['cost_time']/HOUR_TIMESTAMP); echo ""; $total_fixed += $data['cost_fixed']; echo ""; $total_material += $data['cost_material']; $cost = self::computeTotalCost($data['actiontime'], $data['cost_time'], $data['cost_fixed'], $data['cost_material']); echo ""; $total += $cost; echo ""; Session::addToNavigateListItems(__CLASS__, $data['id']); } echo "'; echo ""; echo ""; echo "'; echo "'; echo "'; } else { echo ""; } echo "
    ".self::getTypeName($DB->numrows($result))."".__('Ticket duration')."".CommonITILObject::getActionTime($ticket->fields['actiontime'])."
    ".__('Name')."".__('Begin date')."".__('End date')."".__('Budget')."".__('Duration')."".__('Time cost')."".__('Fixed cost')."".__('Material cost')."".__('Total cost')."
    "; printf(__('%1$s %2$s'), $name, Html::showToolTip($data['comment'], array('display' => false))); if ($canedit) { echo "\n\n"; } echo "".Html::convDate($data['begin_date'])."".Html::convDate($data['end_date'])."".Dropdown::getDropdownName('glpi_budgets', $data['budgets_id'])."".CommonITILObject::getActionTime($data['actiontime'])."".Html::formatNumber($data['cost_time'])."".Html::formatNumber($data['cost_fixed'])."".Html::formatNumber($data['cost_material'])."".Html::formatNumber($cost)."
    ".__('Total').'".CommonITILObject::getActionTime($total_time)."".Html::formatNumber($total_costtime)."".Html::formatNumber($total_fixed).'".Html::formatNumber($total_material).'".Html::formatNumber($total).'
    ".__('No item found')."
    "; } echo "
    "; } /** * Get costs summary values * * @param $ID integer ID of the ticket * @since version 0.84.3 * @return array of costs and actiontime **/ static function getCostsSummary($ID) { global $DB; $query = "SELECT * FROM `glpi_ticketcosts` WHERE `tickets_id` = '$ID' ORDER BY `begin_date`"; $tab = array('totalcost' => 0, 'actiontime' => 0, 'costfixed' => 0, 'costtime' => 0, 'costmaterial' => 0 ); foreach ($DB->request($query) as $data) { $tab['actiontime'] += $data['actiontime']; $tab['costfixed'] += $data['cost_fixed']; $tab['costmaterial'] += $data['cost_material']; $tab['costtime'] += ($data['actiontime']*$data['cost_time']/HOUR_TIMESTAMP); $tab['totalcost'] += self::computeTotalCost($data['actiontime'], $data['cost_time'], $data['cost_fixed'], $data['cost_material']); } foreach ($tab as $key => $val) { $tab[$key] = Html::formatNumber($val); } return $tab; } /** * Computer total cost of a ticket * * @param $actiontime float ticket actiontime * @param $cost_time float ticket time cost * @param $cost_fixed float ticket fixed cost * @param $cost_material float ticket material cost * @param $edit boolean used for edit of computation ? (true by default) * * @return total cost formatted string **/ static function computeTotalCost($actiontime, $cost_time, $cost_fixed, $cost_material, $edit=true) { return Html::formatNumber(($actiontime*$cost_time/HOUR_TIMESTAMP)+$cost_fixed+$cost_material, $edit); } } ?> glpi-0.84.3+dfsg.1/inc/ticketfollowup.class.php000066400000000000000000000616701226600447100212740ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// TicketFollowup class /// TODO extends it from CommonDBChild class TicketFollowup extends CommonDBTM { // From CommonDBTM public $auto_message_on_action = false; /** * Name of the type * * @param $nb : number of item in the type **/ static function getTypeName($nb=0) { return _n('Followup', 'Followups', $nb); } static function canCreate() { return (Session::haveRight('global_add_followups', 1) || Session::haveRight('add_followups', 1) || Session::haveRight('own_ticket', 1)); } static function canView() { return (Session::haveRight('observe_ticket', 1) || Session::haveRight('show_full_ticket', 1) || Session::haveRight('own_ticket', 1)); } static function canDelete() { return (Session::haveRight('delete_followups', 1)); } /** * Is the current user have right to delete the current followup ? * * @return boolean **/ function canDeleteItem() { $ticket = new Ticket(); if (!$ticket->can($this->getField('tickets_id'),'r')) { return false; } if (Session::haveRight('delete_followups',1)) { return true; } return false; } /** * Is the current user have right to show the current followup ? * * @return boolean **/ function canViewItem() { $ticket = new Ticket(); if (!$ticket->can($this->getField('tickets_id'),'r')) { return false; } if (Session::haveRight('show_full_ticket', 1)) { return true; } if (!$this->fields['is_private'] && Session::haveRight('observe_ticket',1)) { return true; } if ($this->fields["users_id"] === Session::getLoginUserID()) { return true; } return false; } /** * Is the current user have right to create the current followup ? * * @return boolean **/ function canCreateItem() { $ticket = new Ticket(); if (!$ticket->can($this->getField('tickets_id'),'r')) { return false; } return $ticket->canAddFollowups(); } /** * Is the current user have right to update the current followup ? * * @return boolean **/ function canUpdateItem() { if (($this->fields["users_id"] != Session::getLoginUserID()) && !Session::haveRight('update_followups',1)) { return false; } $ticket = new Ticket(); if (!$ticket->can($this->getField('tickets_id'),'r')) { return false; } if (($this->fields["users_id"] === Session::getLoginUserID()) && Session::haveRight('update_own_followups',1)) { return true; } // Only the technician return (Session::haveRight("update_followups","1") || $ticket->isUser(CommonITILActor::ASSIGN, Session::getLoginUserID()) || (isset($_SESSION["glpigroups"]) && $ticket->haveAGroup(CommonITILActor::ASSIGN, $_SESSION['glpigroups']))); } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if ($item->getType() == 'Ticket') { if (Session::haveRight('observe_ticket','1')) { if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(self::getTypeName(2), countElementsInTable('glpi_ticketfollowups', "`tickets_id` = '".$item->getID()."'")); } return self::getTypeName(2); } } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { $fup = new self(); $fup->showSummary($item); return true; } function post_getEmpty() { if (isset($_SESSION['glpifollowup_private']) && $_SESSION['glpifollowup_private']) { $this->fields['is_private'] = 1; } if (isset($_SESSION["glpiname"])) { $this->fields['requesttypes_id'] = RequestType::getDefault('helpdesk'); } } function post_deleteFromDB() { $job = new Ticket(); $job->getFromDB($this->fields["tickets_id"]); $job->updateDateMod($this->fields["tickets_id"]); // Add log entry in the ticket $changes[0] = 0; $changes[1] = ''; $changes[2] = $this->fields['id']; Log::history($this->getField('tickets_id'), 'Ticket', $changes, $this->getType(), Log::HISTORY_DELETE_SUBITEM); $options = array('followup_id' => $this->fields["id"], // Force is_private with data / not available 'is_private' => $this->fields['is_private']); NotificationEvent::raiseEvent('delete_followup', $job, $options); } function prepareInputForUpdate($input) { if ($uid = Session::getLoginUserID()) { $input["users_id"] = $uid; } return $input; } function post_updateItem($history=1) { global $CFG_GLPI; $job = new Ticket(); $mailsend = false; if ($job->getFromDB($this->fields["tickets_id"])) { $job->updateDateMod($this->fields["tickets_id"]); if (count($this->updates)) { if ($CFG_GLPI["use_mailing"] && (in_array("content",$this->updates) || isset($this->input['_need_send_mail']))) { $options = array('followup_id' => $this->fields["id"], 'is_private' => $this->fields['is_private']); NotificationEvent::raiseEvent("update_followup", $job, $options); } } // Add log entry in the ticket $changes[0] = 0; $changes[1] = ''; $changes[2] = $this->fields['id']; Log::history($this->getField('tickets_id'), 'Ticket', $changes, $this->getType(), Log::HISTORY_UPDATE_SUBITEM); } } function prepareInputForAdd($input) { // $input["_isadmin"] = Session::haveRight("global_add_followups","1"); $input["_job"] = new Ticket(); if (!$input["_job"]->getFromDB($input["tickets_id"])) { return false; } // Manage File attached (from mailgate) $docadded = $input["_job"]->addFiles($input["tickets_id"]); if (count($docadded) > 0) { $input['content'] .= "\n"; foreach ($docadded as $name) { //TRANS: %s is tha document name $input['content'] .= "\n".sprintf(__('Added document: %s'), $name); } } // Pass old assign From Ticket in case of assign change // if (isset($input["_old_assign"])) { // $input["_job"]->fields["_old_assign"] = $input["_old_assign"]; // } // if (!isset($input["type"])) { // $input["type"] = "followup"; // } // $input["_type"] = $input["type"]; // unset($input["type"]); $input['_close'] = 0; unset($input["add"]); if (!isset($input["users_id"])) { $input["users_id"] = 0; if ($uid = Session::getLoginUserID()) { $input["users_id"] = $uid; } } // if ($input["_isadmin"] && $input["_type"]!="update") { if (isset($input["add_close"])) { $input['_close'] = 1; } unset($input["add_close"]); if (!isset($input["is_private"])) { $input['is_private'] = 0; } if (isset($input["add_reopen"])) { if ($input["content"] == '') { Session::addMessageAfterRedirect(__('If you reject the solution, you must specify a reason'), false, ERROR); return false; } $input['_reopen'] = 1; } unset($input["add_reopen"]); // } $input["date"] = $_SESSION["glpi_currenttime"]; return $input; } function post_addItem() { global $CFG_GLPI; $donotif = $CFG_GLPI["use_mailing"]; if (isset($this->input["_no_notif"]) && $this->input["_no_notif"]) { $donotif = false; } $this->input["_job"]->updateDateMod($this->input["tickets_id"], false, $this->input["users_id"]); if (isset($this->input["_close"]) && $this->input["_close"] && ($this->input["_job"]->fields["status"] == CommonITILObject::SOLVED)) { $update['id'] = $this->input["_job"]->fields['id']; $update['status'] = CommonITILObject::CLOSED; $update['closedate'] = $_SESSION["glpi_currenttime"]; // Use update method for history $this->input["_job"]->update($update); $donotif = false; // Done for ticket update (new status) } if (isset($this->input["_reopen"]) && $this->input["_reopen"] && in_array($this->input["_job"]->fields["status"], array(CommonITILObject::SOLVED, CommonITILObject::WAITING))) { if (($this->input["_job"]->countUsers(CommonITILActor::ASSIGN) > 0) || ($this->input["_job"]->countGroups(CommonITILActor::ASSIGN) > 0) || ($this->input["_job"]->countSuppliers(CommonITILActor::ASSIGN) > 0)) { $update['status'] = CommonITILObject::ASSIGNED; } else { $update['status'] = CommonITILObject::INCOMING; } $update['id'] = $this->input["_job"]->fields['id']; // Use update method for history $this->input["_job"]->update($update); $donotif = false; // Done for ticket update (new status) } if ($donotif) { $options = array('followup_id' => $this->fields["id"], 'is_private' => $this->fields['is_private']); NotificationEvent::raiseEvent("add_followup", $this->input["_job"], $options); } // Add log entry in the ticket $changes[0] = 0; $changes[1] = ''; $changes[2] = $this->fields['id']; Log::history($this->getField('tickets_id'), 'Ticket', $changes, $this->getType(), Log::HISTORY_ADD_SUBITEM); } // SPECIFIC FUNCTIONS /** * Get the users_id name of the followup * * @param $link insert link ? (default 0) * *@return string of the users_id name **/ //TODO function never used function getAuthorName($link=0) { return getUserName($this->fields["users_id"], $link); } /** * @see CommonDBTM::getName() **/ function getName($options=array()) { $p['comments'] = false; if (is_array($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } if (!isset($this->fields['requesttypes_id'])) { return NOT_AVAILABLE; } if ($this->fields['requesttypes_id']) { $name = Dropdown::getDropdownName('glpi_requesttypes', $this->fields['requesttypes_id']); } else { $name = $this->getTypeName(); } if ($p['comments']) { $name = sprintf(__('%1$s (%2$s)'), $name, sprintf(__('%1$s - %2$s'), Html::convDateTime($this->fields['date']), sprintf(__('%1$s - %2$s'), getUserName($this->fields['users_id']), ($this->fields['is_private'] ? __('Private') : __('Public'))))); } return $name; } /** * @param $ticket Tichet object * @param $rand * @param $showprivate **/ function showInTicketSumnary(Ticket $ticket, $rand, $showprivate) { global $DB, $CFG_GLPI; $canedit = $this->can($this->fields['id'],'w') || $this->can($this->fields['id'],'d'); echo "fields['id']. $this->fields['id']."$rand();\"" : '') . " id='viewfollowup" . $this->fields['tickets_id'] . $this->fields["id"] . "$rand'>"; $name = $this->getTypeName(); if ($this->fields['requesttypes_id']) { $name = sprintf(__('%1$s - %2$s'), $name, Dropdown::getDropdownName('glpi_requesttypes', $this->fields['requesttypes_id'])); } echo "".$name.""; echo ""; if ($canedit) { echo "\n\n"; } echo Html::convDateTime($this->fields["date"]) . ""; echo "" . nl2br($this->fields["content"]) . ""; echo "" . getUserName($this->fields["users_id"]) . ""; if ($showprivate) { echo "".Dropdown::getYesNo($this->fields["is_private"]).""; } echo "\n"; } /** * Form for Followup on Massive action **/ static function showFormMassiveAction() { echo " ".__('Source of followup')." "; RequestType::dropdown(array('value' => RequestType::getDefault('helpdesk'))); echo "
    ".__('Description')." "; echo " "; echo ""; echo ""; } /** form for Followup * *@param $ID integer : Id of the followup *@param $options array of possible options: * - ticket Object : the ticket **/ function showForm($ID, $options=array()) { global $DB, $CFG_GLPI; if (isset($options['parent']) && !empty($options['parent'])) { $ticket = $options['parent']; } if ($ID > 0) { $this->check($ID,'r'); } else { // Create item $options['tickets_id'] = $ticket->getField('id'); $this->check(-1,'w',$options); } $tech = (Session::haveRight("global_add_followups", "1") || $ticket->isUser(CommonITILActor::ASSIGN, Session::getLoginUserID()) || (isset($_SESSION["glpigroups"]) && $ticket->haveAGroup(CommonITILActor::ASSIGN, $_SESSION['glpigroups']))); if ($tech) { $this->showFormHeader($options); echo ""; echo "".__('Description').""; echo ""; echo ""; if ($this->fields["date"]) { echo "".__('Date').""; echo "".Html::convDateTime($this->fields["date"]); } else { echo " "; } echo ""; echo "\n"; echo ""; echo "".__('Source of followup').""; RequestType::dropdown(array('value' => $this->fields["requesttypes_id"])); echo "\n"; echo ""; echo "".__('Private').""; Dropdown::showYesNo('is_private', $this->fields["is_private"]); echo ""; $this->showFormButtons($options); } else { $options['colspan'] = 1; $this->showFormHeader($options); echo ""; echo "".__('Description').""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $this->showFormButtons($options); } return true; } /** * Show the current ticketfollowup summary * * @param $ticket Ticket object **/ function showSummary($ticket) { global $DB, $CFG_GLPI; if (!Session::haveRight("observe_ticket", "1") && !Session::haveRight("show_full_ticket", "1")) { return false; } $tID = $ticket->fields['id']; // Display existing Followups $showprivate = Session::haveRight("show_full_ticket", "1"); $caneditall = Session::haveRight("update_followups", "1"); $tmp = array('tickets_id' => $tID); $canadd = $this->can(-1, 'w', $tmp); $RESTRICT = ""; if (!$showprivate) { $RESTRICT = " AND (`is_private` = '0' OR `users_id` ='" . Session::getLoginUserID() . "') "; } $query = "SELECT `id`, `date` FROM `glpi_ticketfollowups` WHERE `tickets_id` = '$tID' $RESTRICT ORDER BY `date` DESC"; $result = $DB->query($query); $rand = mt_rand(); if ($caneditall || $canadd) { echo "
    \n"; } if ($canadd) { echo "\n"; if (($ticket->fields["status"] != CommonITILObject::SOLVED) && ($ticket->fields["status"] != CommonITILObject::CLOSED)) { echo "\n"; } } if ($DB->numrows($result) == 0) { echo ""; echo "
    " . __('No followup for this ticket.')."
    "; } else { echo ""; echo ""; echo "";//""; echo ""; if ($showprivate) { echo ""; } echo "\n"; while ($data = $DB->fetch_assoc($result)) { if ($this->getFromDB($data['id'])) { $this->showInTicketSumnary($ticket, $rand, $showprivate); } } echo "
    ".__('Type')."" . __('Date') . "" . __('Description') . "" . __('Duration') . "" . __('Writer') . "" . __('Private') . "
    "; } } /** * @param $ID integer ID of the ticket **/ static function showShortForTicket($ID) { global $DB, $CFG_GLPI; // Print Followups for a job $showprivate = Session::haveRight("show_full_ticket", "1"); $showuserlink = 0; if (Session::haveRight('user','r')) { $showuserlink = 1; } $RESTRICT = ""; if (!$showprivate) { $RESTRICT = " AND (`is_private` = '0' OR `users_id` ='".Session::getLoginUserID()."') "; } // Get Number of Followups $query = "SELECT * FROM `glpi_ticketfollowups` WHERE `tickets_id` = '$ID' $RESTRICT ORDER BY `date` DESC"; $result = $DB->query($query); $out = ""; if ($DB->numrows($result) > 0) { $out .= "
    \n \n"; while ($data = $DB->fetch_assoc($result)) { $out .= ""; } $out .= "
    ".__('Date')."".__('Requester')." ".__('Description')."
    ".Html::convDateTime($data["date"])." ".getUserName($data["users_id"], $showuserlink)." ".Html::resume_text($data["content"], $CFG_GLPI["cut"])."
    "; } return $out; } /** form for soluce's approbation * * @param $ticket Object : the ticket **/ function showApprobationForm($ticket) { global $DB, $CFG_GLPI; $input = array('tickets_id' => $ticket->getField('id')); if (($ticket->fields["status"] == CommonITILObject::SOLVED) && $ticket->canApprove() && $ticket->isAllowedStatus($ticket->fields['status'], Ticket::CLOSED)) { echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; echo ""; echo "\n"; echo "\n"; echo "
    ". __('Approval of the solution')."
    ".__('Comments')."
    (".__('Optional when approved').")
    "; echo ""; echo ""; echo ""; echo "
    \n"; echo ""; echo "\n"; echo ""; echo "
    "; Html::closeForm(); } return true; } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'content'; $tab[1]['name'] = __('Description'); $tab[1]['datatype'] = 'text'; $tab[2]['table'] = 'glpi_requesttypes'; $tab[2]['field'] = 'name'; $tab[2]['name'] = __('Request source'); $tab[2]['forcegroupby'] = true; $tab[2]['datatype'] = 'dropdown'; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'date'; $tab[3]['name'] = __('Date'); $tab[3]['datatype'] = 'datetime'; $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'is_private'; $tab[4]['name'] = __('Private'); $tab[4]['datatype'] = 'bool'; $tab[5]['table'] = 'glpi_users'; $tab[5]['field'] = 'name'; $tab[5]['name'] = __('User'); $tab[5]['datatype'] = 'dropdown'; $tab[5]['right'] = 'all'; return $tab; } } ?> glpi-0.84.3+dfsg.1/inc/ticketrecurrent.class.php000066400000000000000000000400331226600447100214240ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Ticket Recurrent class /// since version 0.83 class TicketRecurrent extends CommonDropdown { // From CommonDBTM public $dohistory = true; // From CommonDropdown public $first_level_menu = "maintain"; public $second_level_menu = "ticketrecurrent"; public $display_dropdowntitle = false; static function getTypeName($nb=0) { return __('Recurrent tickets'); } static function canCreate() { return Session::haveRight('ticketrecurrent', 'w'); } static function canView() { return Session::haveRight('ticketrecurrent', 'r'); } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($item->getType()) { case 'TicketRecurrent' : switch ($tabnum) { case 1 : $item->showInfos(); return true; } break; } return false; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (Session::haveRight("tickettemplate","r")) { switch ($item->getType()) { case 'TicketRecurrent' : $ong[1] = self::getTypeName(2); return $ong; } } return ''; } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('TicketRecurrent', $ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } function prepareInputForAdd($input) { $input['next_creation_date'] = $this->computeNextCreationDate($input['begin_date'], $input['end_date'], $input['periodicity'], $input['create_before'], $input['calendars_id']); return $input; } function prepareInputForUpdate($input) { if (isset($input['begin_date']) && isset($input['periodicity']) && isset($input['create_before'])) { $input['next_creation_date'] = $this->computeNextCreationDate($input['begin_date'], $input['end_date'], $input['periodicity'], $input['create_before'], $input['calendars_id']); } return $input; } /** * Return Additional Fileds for this type **/ function getAdditionalFields() { return array(array('name' => 'is_active', 'label' => __('Active'), 'type' => 'bool', 'list' => false), array('name' => 'tickettemplates_id', 'label' => _n('Ticket template', 'Ticket templates', 1), 'type' => 'dropdownValue', 'list' => true), array('name' => 'begin_date', 'label' => __('Start date'), 'type' => 'datetime', 'list' => false), array('name' => 'end_date', 'label' => __('End date'), 'type' => 'datetime', 'list' => false), array('name' => 'periodicity', 'label' => __('Periodicity'), 'type' => 'specific_timestamp', 'min' => DAY_TIMESTAMP, 'step' => DAY_TIMESTAMP, 'max' => 2*MONTH_TIMESTAMP), array('name' => 'create_before', 'label' => __('Preliminary creation'), 'type' => 'timestamp', 'max' => 7*DAY_TIMESTAMP, 'step' => HOUR_TIMESTAMP), array('name' => 'calendars_id', 'label' => _n('Calendar', 'Calendars', 1), 'type' => 'dropdownValue', 'list' => true), ); } /** * @since version 0.83.1 * * @see CommonDropdown::displaySpecificTypeField() **/ function displaySpecificTypeField($ID, $field=array()) { switch ($field['name']) { case 'periodicity' : $possible_values = array(); for ($i=1 ; $i<24 ; $i++) { $possible_values[$i*HOUR_TIMESTAMP] = sprintf(_n('%d hour','%d hours',$i), $i); } for ($i=1 ; $i<=30 ; $i++) { $possible_values[$i*DAY_TIMESTAMP] = sprintf(_n('%d day','%d days',$i), $i); } for ($i=1 ; $i<12 ; $i++) { $possible_values[$i.'MONTH'] = sprintf(_n('%d month','%d months',$i), $i); } for ($i=1 ; $i<5 ; $i++) { $possible_values[$i.'YEAR'] = sprintf(_n('%d year','%d years',$i), $i); } Dropdown::showFromArray($field['name'], $possible_values, array('value' => $this->fields[$field['name']])); break; } } /** * @since version 0.84 * * @param $field * @param $values * @param $options array **/ static function getSpecificValueToDisplay($field, $values, array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } switch ($field) { case 'periodicity' : if (preg_match('/([0-9]+)MONTH/',$values[$field], $matches)) { return sprintf(_n('%d month','%d months',$matches[1]), $matches[1]); } if (preg_match('/([0-9]+)YEAR/',$values[$field], $matches)) { return sprintf(_n('%d year','%d years',$matches[1]), $matches[1]); } return Html::timestampToString($values[$field], false); break; } return parent::getSpecificValueToDisplay($field, $values, $options); } /** * Get search function for the class * * @return array of search option **/ function getSearchOptions() { $tab = parent::getSearchOptions(); $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'is_active'; $tab[11]['name'] = __('Active'); $tab[11]['datatype'] = 'bool'; $tab[12]['table'] = 'glpi_tickettemplates'; $tab[12]['field'] = 'name'; $tab[12]['name'] = _n('Ticket template', 'Ticket templates', 1); $tab[12]['datatype'] = 'itemlink'; $tab[13]['table'] = $this->getTable(); $tab[13]['field'] = 'begin_date'; $tab[13]['name'] = __('Start date'); $tab[13]['datatype'] = 'datetime'; $tab[17]['table'] = $this->getTable(); $tab[17]['field'] = 'end_date'; $tab[17]['name'] = __('End date'); $tab[17]['datatype'] = 'datetime'; $tab[15]['table'] = $this->getTable(); $tab[15]['field'] = 'periodicity'; $tab[15]['name'] = __('Periodicity'); $tab[15]['datatype'] = 'specific'; $tab[14]['table'] = $this->getTable(); $tab[14]['field'] = 'create_before'; $tab[14]['name'] = __('Preliminary creation'); $tab[14]['datatype'] = 'timestamp'; $tab[16]['table'] = 'glpi_calendars'; $tab[16]['field'] = 'name'; $tab[16]['name'] = _n('Calendar', 'Calendars', 1); $tab[16]['datatype'] = 'itemlink'; return $tab; } /** * Show next creation date * * @return nothing only display **/ function showInfos() { if (!is_null($this->fields['next_creation_date'])) { echo "
    "; //TRANS: %s is the date of next creation echo sprintf(__('Next creation on %s'), Html::convDateTime($this->fields['next_creation_date'])); echo "
    "; } } /** * Compute next creation date of a ticket * * New parameter in version 0.84 : $calendars_id * * @param $begin_date datetime Begin date of the recurrent ticket * @param $end_date datetime End date of the recurrent ticket * @param $periodicity timestamp Periodicity of creation * @param $create_before timestamp Create before specific timestamp * @param $calendars_id integer ID of the calendar to used * * @return datetime next creation date **/ function computeNextCreationDate($begin_date, $end_date, $periodicity, $create_before, $calendars_id) { if (empty($begin_date) || $begin_date = 'NULL') { return 'NULL'; } if (!empty($end_date) && ($end_date <> 'NULL')) { if (strtotime($end_date) < time()) { return 'NULL'; } } $check = true; if (preg_match('/([0-9]+)MONTH/',$periodicity) || preg_match('/([0-9]+)YEAR/',$periodicity)) { $check = false; } if ($check && ($create_before > $periodicity)) { Session::addMessageAfterRedirect(__('Invalid frequency. It must be greater than the preliminary creation.'), false, ERROR); return 'NULL'; } if ($periodicity <> 0) { // Standard time computation $timestart = strtotime($begin_date) - $create_before; $now = time(); if ($now > $timestart) { $value = $periodicity; $step = "second"; if (preg_match('/([0-9]+)MONTH/',$periodicity, $matches)) { $value = $matches[1]; $step = 'MONTH'; } if (preg_match('/([0-9]+)YEAR/',$periodicity, $matches)) { $value = $matches[1]; $step = 'YEAR'; } while ($timestart < $now) { $timestart = strtotime("+ $value $step",$timestart); } } // Time start over end date if (!empty($end_date) && ($end_date <> 'NULL')) { if ($timestart > strtotime($end_date)) { return 'NULL'; } } $calendar = new Calendar(); if ($calendars_id && $calendar->getFromDB($calendars_id)) { $durations = $calendar->getDurationsCache(); if (array_sum($durations) > 0) { // working days exists while (!$calendar->isAWorkingDay($timestart)) { $timestart = strtotime("+ 1 day",$timestart); } } } return date("Y-m-d H:i:s", $timestart); } return 'NULL'; } /** * Give cron information * * @param $name : task's name * * @return arrray of information **/ static function cronInfo($name) { switch ($name) { case 'ticketrecurrent' : return array('description' => self::getTypeName(2)); } return array(); } /** * Cron for ticket's automatic close * * @param $task : crontask object * * @return integer (0 : nothing done - 1 : done) **/ static function cronTicketRecurrent($task) { global $DB; $tot = 0; $query = "SELECT * FROM `glpi_ticketrecurrents` WHERE `glpi_ticketrecurrents`.`next_creation_date` < NOW() AND `glpi_ticketrecurrents`.`is_active` = 1 AND (`glpi_ticketrecurrents`.`end_date` IS NULL OR `glpi_ticketrecurrents`.`end_date` > NOW())"; foreach ($DB->request($query) as $data) { if (self::createTicket($data)) { $tot++; } else { //TRANS: %s is a name $task->log(sprintf(__('Failed to create recurrent ticket %s'), $data['name'])); } } $task->setVolume($tot); return ($tot > 0); } /** * Create a ticket based on ticket recurrent infos * * @param $data array data of a entry of glpi_ticketrecurrents * * @return boolean **/ static function createTicket($data) { $result = false; $tt = new TicketTemplate(); // Create ticket based on ticket template and entity information of ticketrecurrent if ($tt->getFromDB($data['tickettemplates_id'])) { // Get default values for ticket $input = Ticket::getDefaultValues($data['entities_id']); // Apply tickettemplates predefined values $ttp = new TicketTemplatePredefinedField(); $predefined = $ttp->getPredefinedFields($data['tickettemplates_id'], true); if (count($predefined)) { foreach ($predefined as $predeffield => $predefvalue) { $input[$predeffield] = $predefvalue; } } // Set date to creation date $createtime = strtotime($data['next_creation_date']) + $data['create_before']; $input['date'] = date('Y-m-d H:i:s', $createtime); // Compute due_date if predefined based on create date if (isset($predefined['due_date'])) { $input['due_date'] = Html::computeGenericDateTimeSearch($predefined['due_date'], false, $createtime); } // Set entity $input['entities_id'] = $data['entities_id']; $input['_auto_import'] = true; $ticket = new Ticket(); $input = Toolbox::addslashes_deep($input); if ($tid = $ticket->add($input)) { $msg = sprintf(__('Ticket %d successfully created'), $tid); $result = true; } else { $msg = __('Ticket creation failed (check mandatory fields)'); } } else { $msg = __('Ticket creation failed (no template)'); } $changes[0] = 0; $changes[1] = ''; $changes[2] = addslashes($msg); Log::history($data['id'], __CLASS__, $changes, '', Log::HISTORY_LOG_SIMPLE_MESSAGE); // Compute next creation date $tr = new self(); if ($tr->getFromDB($data['id'])) { $input = array(); $input['id'] = $data['id']; $input['next_creation_date'] = $tr->computeNextCreationDate($data['begin_date'], $data['end_date'], $data['periodicity'], $data['create_before'], $data['calendars_id']); $tr->update($input); } return $result; } } ?>glpi-0.84.3+dfsg.1/inc/ticketsatisfaction.class.php000066400000000000000000000171251226600447100221100ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class TicketSatisfaction extends CommonDBTM { public $dohistory = true; public $history_blacklist = array('date_answered'); static function getTypeName($nb=0) { return __('Satisfaction'); } /** * for use showFormHeader **/ static function getIndexName() { return 'tickets_id'; } function getLogTypeID() { return array('Ticket', $this->fields['tickets_id']); } static function canUpdate() { return (Session::haveRight('create_ticket', 1)); } /** * Is the current user have right to update the current satisfaction * * @return boolean **/ function canUpdateItem() { $ticket = new Ticket(); if (!$ticket->getFromDB($this->fields['tickets_id'])) { return false; } // you can't change if your answer > 12h if (!is_null($this->fields['date_answered']) && ((strtotime("now") - strtotime($this->fields['date_answered'])) > (12*HOUR_TIMESTAMP))) { return false; } if ($ticket->isUser(CommonITILActor::REQUESTER,Session::getLoginUserID()) || ($ticket->fields["users_id_recipient"] === Session::getLoginUserID()) || (isset($_SESSION["glpigroups"]) && $ticket->haveAGroup(CommonITILActor::REQUESTER, $_SESSION["glpigroups"]))) { return true; } return false; } /** * form for satisfaction * * @param $ticket Object : the ticket **/ function showSatisfactionForm($ticket) { $tid = $ticket->fields['id']; $options = array(); $options['colspan'] = 1; // for external inquest => link if ($this->fields["type"] == 2) { $url = Entity::generateLinkSatisfaction($ticket); echo ""; // for internal inquest => form } else { $this->showFormHeader($options); // Set default satisfaction to 3 if not set if (is_null($this->fields["satisfaction"])) { $this->fields["satisfaction"] = 3; } echo ""; echo "".__('Satisfaction with the resolution of the ticket').""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "".__('Comments').""; echo ""; echo ""; echo "\n"; if ($this->fields["date_answered"] > 0) { echo ""; echo "".__('Response date to the satisfaction survey').""; echo Html::convDateTime($this->fields["date_answered"])."\n"; } $options['candel'] = false; $this->showFormButtons($options); } } function prepareInputForUpdate($input) { global $CFG_GLPI; if ($input['satisfaction'] >= 0) { $input["date_answered"] = $_SESSION["glpi_currenttime"]; } return $input; } function post_addItem() { global $CFG_GLPI; if ($CFG_GLPI["use_mailing"]) { $ticket = new Ticket(); if ($ticket->getFromDB($this->fields['tickets_id'])) { NotificationEvent::raiseEvent("satisfaction", $ticket); } } } /** * display satisfaction value * * @param $value decimal between 0 and 5 **/ static function displaySatisfaction($value) { if ($value < 0) { $value = 0; } if ($value > 5) { $value = 5; } $out = '
    '; $out .= '
    '; $out .= '
    '; $out .= "
    "; // display for export $out .= ''; $out .= '
    '; return $out; } /** * Get name of inquest type * * @param $value status ID **/ static function getTypeInquestName($value) { switch ($value) { case 1 : return __('Internal survey'); case 2 : return __('External survey'); default : // Get value if not defined return $value; } } /** * @since version 0.84 * * @param $field * @param $values * @param $options array **/ static function getSpecificValueToDisplay($field, $values, array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } switch ($field) { case 'type': return self::getTypeInquestName($values[$field]); } return parent::getSpecificValueToDisplay($field, $values, $options); } /** * @since version 0.84 * * @param $field * @param $name (default '') * @param $values (default '') * @param $options array **/ static function getSpecificValueToSelect($field, $name='', $values='', array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'type' : $options['value'] = $values[$field]; $typeinquest = array(1 => __('Internal survey'), 2 => __('External survey')); return Dropdown::showFromArray($name, $typeinquest, $options); } return parent::getSpecificValueToSelect($field, $name, $values, $options); } } ?> glpi-0.84.3+dfsg.1/inc/tickettask.class.php000066400000000000000000000122141226600447100203550ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class TicketTask extends CommonITILTask { /** * @since version 0.84 **/ static function getTypeName($nb=0) { return _n('Ticket task', 'Ticket tasks', $nb); } static function canCreate() { return (Session::haveRight('global_add_tasks', 1) || Session::haveRight('own_ticket', 1)); } static function canView() { return (Session::haveRight('observe_ticket', 1) || Session::haveRight('show_full_ticket', 1) || Session::haveRight('own_ticket', 1)); } static function canUpdate() { return (Session::haveRight('global_add_tasks', 1) || Session::haveRight('own_ticket', 1) || Session::haveRight('update_tasks', 1) ); } function canViewPrivates() { return Session::haveRight('show_full_ticket', 1); } function canEditAll() { return Session::haveRight('update_tasks', 1); } /** * Is the current user have right to show the current task ? * * @return boolean **/ function canViewItem() { if (!parent::canReadITILItem()) { return false; } if (Session::haveRight('show_full_ticket', 1)) { return true; } if (!$this->fields['is_private'] && Session::haveRight('observe_ticket',1)) { return true; } if ($this->fields["users_id"] === Session::getLoginUserID()) { return true; } return false; } /** * Is the current user have right to create the current task ? * * @return boolean **/ function canCreateItem() { if (!parent::canReadITILItem()) { return false; } $ticket = new Ticket(); if ($ticket->getFromDB($this->fields['tickets_id'])) { return (Session::haveRight("global_add_tasks","1") || $ticket->isUser(CommonITILActor::ASSIGN, Session::getLoginUserID()) || (isset($_SESSION["glpigroups"]) && $ticket->haveAGroup(CommonITILActor::ASSIGN, $_SESSION['glpigroups']))); } return false; } /** * Is the current user have right to update the current task ? * * @return boolean **/ function canUpdateItem() { if (!parent::canReadITILItem()) { return false; } if (($this->fields["users_id"] != Session::getLoginUserID()) && !Session::haveRight('update_tasks',1)) { return false; } return true; } /** * Is the current user have right to delete the current task ? * * @return boolean **/ function canDeleteItem() { return $this->canUpdateItem(); } /** * Populate the planning with planned ticket tasks * * @param $options array of possible options: * - who ID of the user (0 = undefined) * - who_group ID of the group of users (0 = undefined) * - begin Date * - end Date * * @return array of planning item **/ static function populatePlanning($options=array()) { return parent::genericPopulatePlanning('TicketTask',$options); } /** * Display a Planning Item * * @param $val array of the item to display * * @return Already planned information **/ static function getAlreadyPlannedInformation($val) { return parent::genericGetAlreadyPlannedInformation('TicketTask',$val); } /** * Display a Planning Item * * @param $val array of the item to display * @param $who integer ID of the user (0 if all) * @param $type position of the item in the time block * (in, through, begin or end) (default '') * @param $complete complete display (more details) (default 0) * * @return Nothing (display function) **/ static function displayPlanningItem(array $val, $who, $type="", $complete=0) { return parent::genericDisplayPlanningItem('TicketTask',$val, $who, $type, $complete); } } ?>glpi-0.84.3+dfsg.1/inc/tickettemplate.class.php000066400000000000000000000417751226600447100212440ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Ticket Template class /// since version 0.83 class TicketTemplate extends CommonDropdown { // From CommonDBTM public $dohistory = true; // From CommonDropdown public $first_level_menu = "maintain"; public $second_level_menu = "ticket"; public $third_level_menu = "TicketTemplate"; public $display_dropdowntitle = false; // Specific fields /// Mandatory Fields var $mandatory = array(); /// Hidden fields var $hidden = array(); /// Predefined fields var $predefined = array(); /** * Retrieve an item from the database with additional datas * * @since version 0.83 * * @param $ID integer ID of the item to get * @param $withtypeandcategory boolean with type and category (true by default) * * @return true if succeed else false **/ function getFromDBWithDatas($ID, $withtypeandcategory=true) { global $DB; if ($this->getFromDB($ID)) { $ticket = new Ticket(); $tth = new TicketTemplateHiddenField(); $this->hidden = $tth->getHiddenFields($ID, $withtypeandcategory); // Force items_id if itemtype is defined if (isset($this->hidden['itemtype']) && !isset($this->hidden['items_id'])) { $this->hidden['items_id'] = $ticket->getSearchOptionIDByField('field', 'items_id', 'glpi_tickets'); } // Always get all mandatory fields $ttm = new TicketTemplateMandatoryField(); $this->mandatory = $ttm->getMandatoryFields($ID); // Force items_id if itemtype is defined if (isset($this->mandatory['itemtype']) && !isset($this->mandatory['items_id'])) { $this->mandatory['items_id'] = $ticket->getSearchOptionIDByField('field', 'items_id', 'glpi_tickets'); } $ttp = new TicketTemplatePredefinedField(); $this->predefined = $ttp->getPredefinedFields($ID, $withtypeandcategory); // Compute due_date if (isset($this->predefined['due_date'])) { $this->predefined['due_date'] = Html::computeGenericDateTimeSearch($this->predefined['due_date'], false); } // Compute date if (isset($this->predefined['date'])) { $this->predefined['date'] = Html::computeGenericDateTimeSearch($this->predefined['date'], false); } return true; } return false; } static function getTypeName($nb=0) { return _n('Ticket template', 'Ticket templates', $nb); } static function canCreate() { return Session::haveRight('tickettemplate', 'w'); } static function canView() { return Session::haveRight('tickettemplate', 'r'); } /** * @param $withtypeandcategory (default 0) * @param $with_items_id (default 1) **/ static function getAllowedFields($withtypeandcategory=0, $with_items_id=1) { static $allowed_fields = array(); // For integer value for index if ($withtypeandcategory) { $withtypeandcategory = 1; } else { $withtypeandcategory = 0; } if ($with_items_id) { $with_items_id = 1; } else { $with_items_id = 0; } if (!isset($allowed_fields[$withtypeandcategory][$with_items_id])) { $ticket = new Ticket(); // SearchOption ID => name used for options $allowed_fields[$withtypeandcategory][$with_items_id] = array($ticket->getSearchOptionIDByField('field', 'name', 'glpi_tickets') => 'name', $ticket->getSearchOptionIDByField('field', 'content', 'glpi_tickets') => 'content', $ticket->getSearchOptionIDByField('field', 'status', 'glpi_tickets') => 'status', $ticket->getSearchOptionIDByField('field', 'urgency', 'glpi_tickets') => 'urgency', $ticket->getSearchOptionIDByField('field', 'impact', 'glpi_tickets') => 'impact', $ticket->getSearchOptionIDByField('field', 'priority', 'glpi_tickets') => 'priority', $ticket->getSearchOptionIDByField('field', 'name', 'glpi_requesttypes') => 'requesttypes_id', $ticket->getSearchOptionIDByField('field', 'completename', 'glpi_locations') => 'locations_id', $ticket->getSearchOptionIDByField('field', 'name', 'glpi_slas') => 'slas_id', $ticket->getSearchOptionIDByField('field', 'due_date', 'glpi_tickets') => 'due_date', $ticket->getSearchOptionIDByField('field', 'date', 'glpi_tickets') => 'date', $ticket->getSearchOptionIDByField('field', 'actiontime', 'glpi_tickets') => 'actiontime', $ticket->getSearchOptionIDByField('field', 'itemtype', 'glpi_tickets') => 'itemtype', $ticket->getSearchOptionIDByField('field', 'global_validation', 'glpi_tickets') => 'global_validation', 4 => '_users_id_requester', 71 => '_groups_id_requester', 5 => '_users_id_assign', 8 => '_groups_id_assign', $ticket->getSearchOptionIDByField('field', 'name', 'glpi_suppliers') => '_suppliers_id_assign', 66 => '_users_id_observer', 65 => '_groups_id_observer', ); if ($withtypeandcategory) { $allowed_fields[$withtypeandcategory][$with_items_id] [$ticket->getSearchOptionIDByField('field', 'completename', 'glpi_itilcategories')] = 'itilcategories_id'; $allowed_fields[$withtypeandcategory][$with_items_id] [$ticket->getSearchOptionIDByField('field', 'type', 'glpi_tickets')] = 'type'; } if ($with_items_id) { $allowed_fields[$withtypeandcategory][$with_items_id] [$ticket->getSearchOptionIDByField('field', 'items_id', 'glpi_tickets')] = 'items_id'; } // Add validation request $allowed_fields[$withtypeandcategory][$with_items_id][-2] = '_add_validation'; } return $allowed_fields[$withtypeandcategory][$with_items_id]; /// TODO ADD : linked tickets ? : array passed. How to manage it ? store array in DB + add hidden searchOption ? } /** * @param $withtypeandcategory (default 0) * @param $with_items_id (default 1) **/ function getAllowedFieldsNames($withtypeandcategory=0, $with_items_id=1) { $searchOption = Search::getOptions('Ticket'); $tab = $this->getAllowedFields($withtypeandcategory, $with_items_id); foreach ($tab as $ID => $shortname) { switch ($ID) { case -2 : $tab[-2] = __('Approval request'); break; default : if (isset($searchOption[$ID]['name'])) { $tab[$ID] = $searchOption[$ID]['name']; } } } return $tab; } /** * àsince version 0.84 **/ function getSimplifiedInterfaceFields() { $ticket = new Ticket(); $fields = array($ticket->getSearchOptionIDByField('field', 'name', 'glpi_tickets'), $ticket->getSearchOptionIDByField('field', 'content', 'glpi_tickets'), $ticket->getSearchOptionIDByField('field', 'urgency', 'glpi_tickets'), $ticket->getSearchOptionIDByField('field', 'completename', 'glpi_locations'), $ticket->getSearchOptionIDByField('field', 'itemtype', 'glpi_tickets'), $ticket->getSearchOptionIDByField('field', 'completename', 'glpi_itilcategories'), $ticket->getSearchOptionIDByField('field', 'type', 'glpi_tickets'), $ticket->getSearchOptionIDByField('field', 'items_id', 'glpi_tickets')); return $fields; } function defineTabs($options=array()) { $ong = array(); $ong['empty'] = $this->getTypeName(1); $this->addStandardTab('TicketTemplateMandatoryField', $ong, $options); $this->addStandardTab('TicketTemplatePredefinedField', $ong, $options); $this->addStandardTab('TicketTemplateHiddenField', $ong, $options); $this->addStandardTab('TicketTemplate', $ong, $options); $this->addStandardTab('ITILCategory', $ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($item->getType()) { case 'TicketTemplate' : switch ($tabnum) { case 1 : $item->showCentralPreview($item); return true; case 2 : $item->showHelpdeskPreview($item); return true; } break; } return false; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (Session::haveRight("tickettemplate","r")) { switch ($item->getType()) { case 'TicketTemplate' : $ong[1] = __('Standard interface'); $ong[2] = __('Simplified interface'); return $ong; } } return ''; } /** * Get search function for the class * * @return array of search option **/ function getSearchOptions() { return parent::getSearchOptions(); } /** * Get mandatory mark if field is mandatory * * @since version 0.83 * * @param $field string field * @param $force boolean force display based on global config (false by default) * * @return string to display **/ function getMandatoryMark($field, $force=false) { if ($force || $this->isMandatoryField($field)) { return "*"; } return ''; } /** * Get hidden field begin enclosure for text * * @since version 0.83 * * @param $field string field * * @return string to display **/ function getBeginHiddenFieldText($field) { if ($this->isHiddenField($field) && !$this->isPredefinedField($field)) { return ""; } return ''; } /** * Get hidden field begin enclosure for value * * @since version 0.83 * * @param $field string field * * @return string to display **/ function getBeginHiddenFieldValue($field) { if ($this->isHiddenField($field)) { return ""; if ($ticket && isset($ticket->fields[$field])) { $output .= "fields[$field]."\">"; } if ($this->isPredefinedField($field) && !is_null($ticket)) { if ($num = array_search($field, $this->getAllowedFields())) { $display_options = array('comments' => true, 'html' => true); $output .= $ticket->getValueToDisplay($num, $ticket->fields, $display_options); /// Display items_id if ($field == 'itemtype') { $output .= "fields['items_id']."\">"; if ($num = array_search('items_id',$this->getAllowedFields())) { $output = sprintf(__('%1$s - %2$s'), $output, $ticket->getValueToDisplay($num, $ticket->fields, $display_options)); } } } } } return $output; } /** * Is it an hidden field ? * * @since version 0.83 * * @param $field string field * * @return bool **/ function isHiddenField($field) { if (isset($this->hidden[$field])) { return true; } return false; } /** * Is it an predefined field ? * * @since version 0.83 * * @param $field string field * * @return bool **/ function isPredefinedField($field) { if (isset($this->predefined[$field])) { return true; } return false; } /** * Is it an mandatory field ? * * @since version 0.83 * * @param $field string field * * @return bool **/ function isMandatoryField($field) { if (isset($this->mandatory[$field])) { return true; } return false; } /** * Print preview for Ticket template * * @since version 0.83 * * @param $tt TicketTemplate object * * @return Nothing (call to classes members) **/ static function showCentralPreview(TicketTemplate $tt) { if (!$tt->getID()) { return false; } if ($tt->getFromDBWithDatas($tt->getID())) { $ticket = new Ticket(); $ticket->showForm(0, array('template_preview' => $tt->getID())); } } /** * Print preview for Ticket template * * @param $tt TicketTemplate object * * @return Nothing (call to classes members) **/ static function showHelpdeskPreview(TicketTemplate $tt) { if (!$tt->getID()) { return false; } if ($tt->getFromDBWithDatas($tt->getID())) { $ticket = new Ticket(); $ticket->showFormHelpdesk(Session::getLoginUserID(), $tt->getID()); } } } ?> glpi-0.84.3+dfsg.1/inc/tickettemplatehiddenfield.class.php000066400000000000000000000202651226600447100234130ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Hidden fields for ticket template class /// since version 0.83 class TicketTemplateHiddenField extends CommonDBChild { // From CommonDBChild static public $itemtype = 'TicketTemplate'; static public $items_id = 'tickettemplates_id'; public $dohistory = true; /** * @since version 0.84 **/ function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } static function getTypeName($nb=0) { return _n('Hidden field', 'Hidden fields', $nb); } /** * @see CommonDBTM::getName() * * @since version 0.84 **/ function getName($options=array()) { $tt = new TicketTemplate(); $fields = $tt->getAllowedFieldsNames(true); if (isset($fields[$this->fields["num"]])) { return $fields[$this->fields["num"]]; } return NOT_AVAILABLE; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { // can exists for template if (($item->getType() == 'TicketTemplate') && Session::haveRight("tickettemplate","r")) { if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(self::getTypeName(2), countElementsInTable($this->getTable(), "`tickettemplates_id` = '".$item->getID()."'")); } return self::getTypeName(2); } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { self::showForTicketTemplate($item, $withtemplate); return true; } function post_purgeItem() { global $DB; parent::post_purgeItem(); $ticket = new Ticket(); $itemtype_id = $ticket->getSearchOptionIDByField('field', 'itemtype', 'glpi_tickets'); $items_id_id = $ticket->getSearchOptionIDByField('field', 'items_id', 'glpi_tickets'); // Try to delete itemtype -> delete items_id if ($this->fields['num'] == $itemtype_id) { $query = "SELECT `id` FROM `".$this->getTable()."` WHERE `".static::$items_id."` = '".$this->fields['tickettemplates_id']."' AND `num` = '$items_id_id'"; if ($result = $DB->query($query)) { if ($DB->numrows($result)) { $a = new self(); $a->delete(array('id'=>$DB->result($result,0,0))); } } } } /** * Get hidden fields for a template * * @since version 0.83 * * @param $ID integer the template ID * @param $withtypeandcategory boolean with type and category (false by default) * * @return an array of hidden fields **/ function getHiddenFields($ID, $withtypeandcategory=false) { global $DB; $sql = "SELECT * FROM `".$this->getTable()."` WHERE `".static::$items_id."` = '$ID' ORDER BY `id`"; $result = $DB->query($sql); $tt = new TicketTemplate(); $allowed_fields = $tt->getAllowedFields($withtypeandcategory, true); $fields = array(); while ($rule = $DB->fetch_assoc($result)) { if (isset($allowed_fields[$rule['num']])) { $fields[$allowed_fields[$rule['num']]] = $rule['num']; } } return $fields; } /** * Print the hidden fields * * @since version 0.83 * * @param $tt Ticket Template * @param $withtemplate boolean Template or basic item (default '') * * @return Nothing (call to classes members) **/ static function showForTicketTemplate(TicketTemplate $tt, $withtemplate='') { global $DB; $ID = $tt->fields['id']; if (!$tt->getFromDB($ID) || !$tt->can($ID, "r")) { return false; } $ttm = new self(); $used = $ttm->getHiddenFields($ID); $canedit = $tt->can($ID, "w"); $fields = $tt->getAllowedFieldsNames(false, isset($used['itemtype'])); $rand = mt_rand(); $query = "SELECT `glpi_tickettemplatehiddenfields`.* FROM `glpi_tickettemplatehiddenfields` WHERE (`tickettemplates_id` = '$ID')"; if ($result = $DB->query($query)) { $hiddenfields = array(); $used = array(); if ($numrows = $DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $hiddenfields[$data['id']] = $data; $used[$data['num']] = $data['num']; } } if ($canedit) { echo "
    "; echo ""; echo ""; echo ""; echo ""; echo "
    ".__('Add a hidden field')."
    "; echo ""; Dropdown::showFromArray('num', $fields, array('used'=> $used)); echo ""; echo " "; echo "
    "; Html::closeForm(); echo "
    "; } echo "
    "; if ($canedit && $numrows) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $massiveactionparams = array('num_displayed' => $numrows); Html::showMassiveActions(__CLASS__, $massiveactionparams); } echo ""; echo ""; if ($numrows) { echo ""; if ($canedit) { echo ""; } echo ""; echo ""; foreach ($hiddenfields as $data) { echo ""; if ($canedit) { echo ""; } echo ""; echo ""; } } else { echo ""; } echo "
    "; echo self::getTypeName($DB->numrows($result)); echo "
    ".Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand)."".__('Name')."
    ".Html::getMassiveActionCheckBox(__CLASS__, $data["id"])."".$fields[$data['num']]."
    ".__('No item found')."
    "; if ($canedit && $numrows) { $massiveactionparams['ontop'] = false; Html::showMassiveActions(__CLASS__, $massiveactionparams); Html::closeForm(); } echo "
    "; } } } ?> glpi-0.84.3+dfsg.1/inc/tickettemplatemandatoryfield.class.php000066400000000000000000000222531226600447100241550ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Mandatory fields for ticket template class /// since version 0.83 class TicketTemplateMandatoryField extends CommonDBChild { // From CommonDBChild static public $itemtype = 'TicketTemplate'; static public $items_id = 'tickettemplates_id'; public $dohistory = true; static function getTypeName($nb=0) { return _n('Mandatory field', 'Mandatory fields', $nb); } /** * @since version 0.84 **/ function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } /** * @see CommonDBTM::getName() * * @since version 0.84 **/ function getName($options=array()) { $tt = new TicketTemplate(); $fields = $tt->getAllowedFieldsNames(true); if (isset($fields[$this->fields["num"]])) { return $fields[$this->fields["num"]]; } return NOT_AVAILABLE; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { // can exists for template if (($item->getType() == 'TicketTemplate') && Session::haveRight("tickettemplate","r")) { if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(self::getTypeName(2), countElementsInTable($this->getTable(), "`tickettemplates_id` = '".$item->getID()."'")); } return self::getTypeName(2); } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { self::showForTicketTemplate($item, $withtemplate); return true; } function post_purgeItem() { global $DB; parent::post_purgeItem(); $ticket = new Ticket(); $itemtype_id = $ticket->getSearchOptionIDByField('field', 'itemtype', 'glpi_tickets'); $items_id_id = $ticket->getSearchOptionIDByField('field', 'items_id', 'glpi_tickets'); // Try to delete itemtype -> delete items_id if ($this->fields['num'] == $itemtype_id) { $query = "SELECT `id` FROM `".$this->getTable()."` WHERE `".static::$items_id."` = '".$this->fields['tickettemplates_id']."' AND `num` = '$items_id_id'"; if ($result = $DB->query($query)) { if ($DB->numrows($result)) { $a = new self(); $a->delete(array('id' => $DB->result($result,0,0))); } } } } /** * Get mandatory fields for a template * * @since version 0.83 * * @param $ID integer the template ID * @param $withtypeandcategory boolean with type and category (true by default) * * @return an array of mandatory fields **/ function getMandatoryFields($ID, $withtypeandcategory=true) { global $DB; $sql = "SELECT * FROM `".$this->getTable()."` WHERE `".static::$items_id."` = '$ID' ORDER BY `id`"; $result = $DB->query($sql); $tt = new TicketTemplate(); $allowed_fields = $tt->getAllowedFields($withtypeandcategory, true); $fields = array(); while ($rule = $DB->fetch_assoc($result)) { if (isset($allowed_fields[$rule['num']])) { $fields[$allowed_fields[$rule['num']]] = $rule['num']; } } return $fields; } /** * Print the mandatory fields * * @since version 0.83 * * @param $tt Ticket Template * @param $withtemplate boolean Template or basic item (default '') * * @return Nothing (call to classes members) **/ static function showForTicketTemplate(TicketTemplate $tt, $withtemplate='') { global $DB; $ID = $tt->fields['id']; if (!$tt->getFromDB($ID) || !$tt->can($ID, "r")) { return false; } $canedit = $tt->can($ID, "w"); $ttm = new self(); $used = $ttm->getMandatoryFields($ID); $fields = $tt->getAllowedFieldsNames(true, isset($used['itemtype'])); $simplified_fields = $tt->getSimplifiedInterfaceFields(); $both_interfaces = sprintf(__('%1$s + %2$s'), __('Simplified interface'), __ ('Standard interface')); $rand = mt_rand(); $query = "SELECT `glpi_tickettemplatemandatoryfields`.* FROM `glpi_tickettemplatemandatoryfields` WHERE (`tickettemplates_id` = '$ID')"; if ($result = $DB->query($query)) { $mandatoryfields = array(); $used = array(); if ($numrows = $DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $mandatoryfields[$data['id']] = $data; $used[$data['num']] = $data['num']; } } if ($canedit) { echo "
    "; echo ""; echo ""; echo ""; echo ""; echo "
    ".__('Add a mandatory field')."
    "; echo ""; $select_fields = $fields; foreach ($select_fields as $key => $val) { if (in_array($key, $simplified_fields)) { $select_fields[$key] = sprintf(__('%1$s (%2$s)'), $val, $both_interfaces); } else { $select_fields[$key] = sprintf(__('%1$s (%2$s)'), $val, __('Standard interface')); } } Dropdown::showFromArray('num', $select_fields, array('used' => $used)); echo ""; echo " "; echo "
    "; Html::closeForm(); echo "
    "; } echo "
    "; if ($canedit && $numrows) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $massiveactionparams = array('num_displayed' => $numrows); Html::showMassiveActions(__CLASS__, $massiveactionparams); } echo ""; echo ""; if ($numrows) { echo ""; if ($canedit) { echo ""; } echo ""; echo ""; echo ""; foreach ($mandatoryfields as $data) { echo ""; if ($canedit) { echo ""; } echo ""; echo ""; echo ""; } } else { echo ""; } echo "
    "; echo self::getTypeName($DB->numrows($result)); echo "
    ".Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand)."".__('Name')."".__("Profile's interface")."
    ".Html::getMassiveActionCheckBox(__CLASS__, $data["id"])."".$fields[$data['num']].""; if (in_array($data['num'], $simplified_fields)) { echo $both_interfaces; } else { _e('Standard interface'); } echo "
    ".__('No item found')."
    "; if ($canedit && $numrows) { $massiveactionparams['ontop'] = false; Html::showMassiveActions(__CLASS__, $massiveactionparams); Html::closeForm(); } echo "
    "; } } } ?> glpi-0.84.3+dfsg.1/inc/tickettemplatepredefinedfield.class.php000066400000000000000000000263061226600447100242670ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Predefined fields for ticket template class /// since version 0.83 class TicketTemplatePredefinedField extends CommonDBChild { // From CommonDBChild static public $itemtype = 'TicketTemplate'; static public $items_id = 'tickettemplates_id'; public $dohistory = true; /** * @since version 0.84 **/ function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } static function getTypeName($nb=0) { return _n('Predefined field', 'Predefined fields', $nb); } /** * @see CommonDBTM::getName() * * @since version 0.84 **/ function getName($options=array()) { $tt = new TicketTemplate(); $fields = $tt->getAllowedFieldsNames(true); if (isset($fields[$this->fields["num"]])) { return $fields[$this->fields["num"]]; } return NOT_AVAILABLE; } function prepareInputForAdd($input) { // Use massiveaction system to manage add system. // Need to update data : value not set but if (!isset($input['value'])) { if (isset($input['field']) && isset($input[$input['field']])) { $input['value'] = $input[$input['field']]; unset($input[$input['field']]); unset($input['field']); } } return parent::prepareInputForAdd($input); } function post_purgeItem() { global $DB; parent::post_purgeItem(); $ticket = new Ticket(); $itemtype_id = $ticket->getSearchOptionIDByField('field', 'itemtype', 'glpi_tickets'); $items_id_id = $ticket->getSearchOptionIDByField('field', 'items_id', 'glpi_tickets'); // Try to delete itemtype -> delete items_id if ($this->fields['num'] == $itemtype_id) { $query = "SELECT `id` FROM `".$this->getTable()."` WHERE `".static::$items_id."` = '".$this->fields['tickettemplates_id']."' AND `num` = '$items_id_id'"; if ($result = $DB->query($query)) { if ($DB->numrows($result)) { $a = new self(); $a->delete(array('id'=>$DB->result($result,0,0))); } } } } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { // can exists for template if (($item->getType() == 'TicketTemplate') && Session::haveRight("tickettemplate","r")) { if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry(self::getTypeName(2), countElementsInTable($this->getTable(), "`tickettemplates_id` = '".$item->getID()."'")); } return self::getTypeName(2); } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { self::showForTicketTemplate($item, $withtemplate); return true; } /** * Get predefined fields for a template * * @since version 0.83 * * @param $ID integer the template ID * @param $withtypeandcategory boolean with type and category (false by default) * * @return an array of predefined fields **/ function getPredefinedFields($ID, $withtypeandcategory=false) { global $DB; $sql = "SELECT * FROM `".$this->getTable()."` WHERE `".static::$items_id."` = '$ID' ORDER BY `id`"; $result = $DB->query($sql); $tt = new TicketTemplate(); $allowed_fields = $tt->getAllowedFields($withtypeandcategory, true); $fields = array(); while ($rule = $DB->fetch_assoc($result)) { if (isset($allowed_fields[$rule['num']])) { $fields[$allowed_fields[$rule['num']]] = $rule['value']; } } return $fields; } /** * Print the predefined fields * * @since version 0.83 * * @param $tt Ticket Template * @param $withtemplate boolean Template or basic item (default '') * * @return Nothing (call to classes members) **/ static function showForTicketTemplate(TicketTemplate $tt, $withtemplate='') { global $DB, $CFG_GLPI; $ID = $tt->fields['id']; if (!$tt->getFromDB($ID) || !$tt->can($ID, "r")) { return false; } $canedit = $tt->can($ID, "w"); $ttp = new self(); $used_fields = $ttp->getPredefinedFields($ID, true); $itemtype_used = ''; if (isset($used_fields['itemtype'])) { $itemtype_used = $used_fields['itemtype']; } $fields = $tt->getAllowedFieldsNames(true, isset($used_fields['itemtype'])); $searchOption = Search::getOptions('Ticket'); $ticket = new Ticket(); $rand = mt_rand(); $query = "SELECT `glpi_tickettemplatepredefinedfields`.* FROM `glpi_tickettemplatepredefinedfields` WHERE (`tickettemplates_id` = '$ID') ORDER BY 'id'"; $display_datas = array('itemtype' => $itemtype_used); $display_options = array('relative_dates' => true, 'comments' => true, 'html' => true); if ($result = $DB->query($query)) { $predeffields = array(); $used = array(); if ($numrows = $DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $predeffields[$data['id']] = $data; $used[$data['num']] = $data['num']; } } if ($canedit) { echo "
    "; echo ""; echo ""; echo ""; echo ""; echo "
    ".__('Add a predefined field')."
    "; echo ""; $display_fields[-1] = Dropdown::EMPTY_VALUE; $display_fields += $fields; // Force validation request as used $used[-2] = -2; $rand_dp = Dropdown::showFromArray('num', $display_fields, array('used' => $used, 'toadd')); echo ""; $paramsmassaction = array('id_field' => '__VALUE__', 'itemtype' => 'Ticket', 'additionalvalues' => array('itemtype' => $itemtype_used), 'inline' => true, 'submitname' => _sx('button', 'Add'), 'options' => array('relative_dates' => 1, 'with_time' => 1, 'with_days' => 0, 'with_specific_date' => 0, 'itemlink_as_string' => 1, 'entity' => $tt->getEntityID())); Ajax::updateItemOnSelectEvent("dropdown_num".$rand_dp, "show_massiveaction_field", $CFG_GLPI["root_doc"]."/ajax/dropdownMassiveActionField.php", $paramsmassaction); echo ""; echo " \n"; echo "
    "; Html::closeForm(); echo "
    "; } echo "
    "; if ($canedit && $numrows) { Html::openMassiveActionsForm('mass'.__CLASS__.$rand); $massiveactionparams = array('num_displayed' => $numrows); Html::showMassiveActions(__CLASS__, $massiveactionparams); } echo ""; echo ""; if ($numrows) { echo ""; if ($canedit) { echo ""; } echo ""; echo ""; echo ""; foreach ($predeffields as $data) { if (!isset($fields[$data['num']])) { // could happen when itemtype removed and items_id present continue; } echo ""; if ($canedit) { echo ""; } echo ""; echo ""; echo ""; } } else { echo ""; } echo "
    "; echo self::getTypeName($DB->numrows($result)); echo "
    ".Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand)."".__('Name')."".__('Value')."
    ".Html::getMassiveActionCheckBox(__CLASS__, $data["id"])."".$fields[$data['num']].""; $display_datas[$searchOption[$data['num']]['field']] = $data['value']; echo $ticket->getValueToDisplay($searchOption[$data['num']], $display_datas, $display_options); echo "
    ".__('No item found')."
    "; if ($canedit && $numrows) { $massiveactionparams['ontop'] = false; Html::showMassiveActions(__CLASS__, $massiveactionparams); Html::closeForm(); } echo "
    "; } } } ?> glpi-0.84.3+dfsg.1/inc/ticketvalidation.class.php000066400000000000000000000721711226600447100215550ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * TicketValidation class */ class TicketValidation extends CommonDBChild { // From CommonDBTM public $auto_message_on_action = false; // From CommonDBChild static public $itemtype = 'Ticket'; static public $items_id = 'tickets_id'; static public $log_history_add = Log::HISTORY_LOG_SIMPLE_MESSAGE; static public $log_history_update = Log::HISTORY_LOG_SIMPLE_MESSAGE; static public $log_history_delete = Log::HISTORY_LOG_SIMPLE_MESSAGE; function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } static function getTypeName($nb=0) { return _n('Approval', 'Approvals', $nb); } static function canCreate() { return (Session::haveRight('create_request_validation', 1) || Session::haveRight('create_incident_validation', 1)); } static function canView() { return (Session::haveRight('create_request_validation', 1) || Session::haveRight('create_incident_validation', 1) || Session::haveRight('validate_request', 1) || Session::haveRight('validate_incident', 1)); } static function canUpdate() { return (Session::haveRight('create_request_validation', 1) || Session::haveRight('create_incident_validation', 1) || Session::haveRight('validate_request', 1) || Session::haveRight('validate_incident', 1)); } static function canDelete() { return (Session::haveRight('create_request_validation', 1) || Session::haveRight('create_incident_validation', 1)); } /** * Is the current user have right to delete the current validation ? * * @since version 0.84 * * @return boolean **/ function canDeleteItem() { If (($this->fields["users_id"] == Session::getLoginUserID()) || Session::haveRight('delete_validations', 1)) { return true; } return false; } /** * Is the current user have right to update the current validation ? * * @return boolean */ function canUpdateItem() { if (!Session::haveRight('create_request_validation', 1) && !Session::haveRight('create_incident_validation', 1) && ($this->fields["users_id_validate"] != Session::getLoginUserID())) { return false; } return true; } /** * @param $tickets_id **/ static function canValidate($tickets_id) { global $DB; $query = "SELECT `users_id_validate` FROM `glpi_ticketvalidations` WHERE `tickets_id` = '$tickets_id' AND users_id_validate = '".Session::getLoginUserID()."'"; $result = $DB->query($query); if ($DB->numrows($result)) { return true; } return false; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { $hidetab = false; // Hide if no rights on validations if (!Session::haveRight('create_incident_validation','1') && !Session::haveRight('create_request_validation','1') && !Session::haveRight('validate_request','1') && !Session::haveRight('validate_incident','1')) { $hidetab = true; } // No right to create and no validation for current object if (!$hidetab && !Session::haveRight('create_incident_validation','1') && !Session::haveRight('create_request_validation','1') && !self::canValidate($item->getID())) { $hidetab = true; } if (!$hidetab) { if ($_SESSION['glpishow_count_on_tabs']) { $restrict = "`tickets_id` = '".$item->getID()."'"; // No rights for create only count asign ones if (!Session::haveRight('create_request_validation','1') && !Session::haveRight('create_incident_validation','1')) { $restrict .= " AND `users_id_validate` = '".Session::getLoginUserID()."' "; } return self::createTabEntry(self::getTypeName(2), countElementsInTable('glpi_ticketvalidations', $restrict)); } return self::getTypeName(2); } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { $validation = new self(); $validation->showSummary($item); return true; } function post_getEmpty() { $this->fields["users_id"] = Session::getLoginUserID(); $this->fields["status"] = 'waiting'; } function prepareInputForAdd($input) { // if ($job->fields["status"] == CommonITILObject::SOLVED // || $job->fields["status"] == CommonITILObject::CLOSED) { // return false; // } $input["users_id"] = 0; // Only set requester on manual action if (!isset($input['_auto_import']) && !isset($input['_auto_update']) && !Session::isCron()) { $input["users_id"] = Session::getLoginUserID(); } $input["submission_date"] = $_SESSION["glpi_currenttime"]; $input["status"] = 'waiting'; return parent::prepareInputForAdd($input); } function post_addItem() { global $CFG_GLPI; $job = new Ticket(); $mailsend = false; if ($job->getFromDB($this->fields["tickets_id"])) { // Set global validation to waiting if (($job->fields['global_validation'] == 'accepted') || ($job->fields['global_validation'] == 'none')) { $input['id'] = $this->fields["tickets_id"]; $input['global_validation'] = 'waiting'; // to fix lastupdater if (isset($this->input['_auto_update'])) { $input['_auto_update'] = $this->input['_auto_update']; } // to know update by rules if (isset($this->input["_rule_process"])) { $input['_rule_process'] = $this->input["_rule_process"]; } // No update ticket notif on ticket add if (isset($this->input["_ticket_add"])) { $input['_disablenotif'] = true; } $job->update($input); } if ($CFG_GLPI["use_mailing"]) { $options = array('validation_id' => $this->fields["id"], 'validation_status' => $this->fields["status"]); $mailsend = NotificationEvent::raiseEvent('validation',$job,$options); } if ($mailsend) { $user = new User(); $user->getFromDB($this->fields["users_id_validate"]); $email = $user->getDefaultEmail(); if (!empty($email)) { //TRANS: %s is the user name Session::addMessageAfterRedirect(sprintf(__('Approval request send to %s'), $user->getName())); } else { Session::addMessageAfterRedirect(sprintf(__('The selected user (%s) has no valid email address. The request has been created, without email confirmation.'), $user->getName()), false, ERROR); } } } parent::post_addItem(); } function prepareInputForUpdate($input) { $job = new Ticket(); $forbid_fields = array(); if ($this->fields["users_id_validate"] == Session::getLoginUserID()) { if (($input["status"] == "rejected") && (!isset($input["comment_validation"]) || ($input["comment_validation"] == ''))) { Session::addMessageAfterRedirect(__('If approval is denied, specify a reason.'), false, ERROR); return false; } if ($input["status"] == "waiting") { // $input["comment_validation"] = ''; $input["validation_date"] = 'NULL'; } else { $input["validation_date"] = $_SESSION["glpi_currenttime"]; } $forbid_fields = array('entities_id', 'users_id', 'tickets_id', 'users_id_validate', 'comment_submission', 'submission_date'); } else if (Session::haveRight('create_incident_validation',1) || Session::haveRight('create_request_validation',1)) { // Update validation request $forbid_fields = array('entities_id', 'tickets_id', 'status', 'comment_validation', 'validation_date'); } if (count($forbid_fields)) { foreach ($forbid_fields as $key => $val) { if (isset($input[$key])) { unset($input[$key]); } } } return parent::prepareInputForUpdate($input); } function post_updateItem($history=1) { global $CFG_GLPI; $job = new Ticket(); $donotif = $CFG_GLPI["use_mailing"]; if (isset($this->input['_disablenotif'])) { $donotif = false; } if ($job->getFromDB($this->fields["tickets_id"])) { if (count($this->updates) && $donotif) { $options = array('validation_id' => $this->fields["id"], 'validation_status' => $this->fields["status"]); NotificationEvent::raiseEvent('validation_answer', $job, $options); } // Set global validation to accepted to define one if (($job->fields['global_validation'] == 'waiting') || (self::getNumberValidationForTicket($this->fields["tickets_id"]) == 1) || self::isAllValidationsHaveSameStatusForTicket($this->fields["tickets_id"])) { $input['id'] = $this->fields["tickets_id"]; $input['global_validation'] = $this->fields["status"]; $job->update($input); } } parent::post_updateItem($history); } /** * @since version 0.84 * * @see CommonDBConnexity::getHistoryChangeWhenUpdateField **/ function getHistoryChangeWhenUpdateField($field) { if ($field == 'status') { $username = getUserName($this->fields["users_id_validate"]); $result = array('0', '', ''); if ($this->fields["status"] == 'accepted') { //TRANS: %s is the username $result[2] = sprintf(__('Approval granted by %s'), $username); } else { //TRANS: %s is the username $result[2] = sprintf(__('Update the approval request to %s'), $username); } return $result; } return false; } /** * @since version 0.84 * * @see CommonDBChild::getHistoryNameForItem **/ function getHistoryNameForItem(CommonDBTM $item, $case) { $username = getUserName($this->fields["users_id_validate"]); switch ($case) { case 'add': return sprintf(__('Approval request send to %s'), $username); case 'delete': return sprintf(__('Cancel the approval request to %s'), $username); } return ''; } /** * get the Ticket validation status list * * @param $withmetaforsearch boolean (false by default) * @param $global boolean (true for global status, with "no validation" option) * (false by default) * * @return an array **/ static function getAllStatusArray($withmetaforsearch=false, $global=false) { $tab = array('waiting' => __('Waiting for approval'), 'rejected' => __('Refused'), 'accepted' => __('Granted')); if ($global) { $tab['none'] = __('Not subject to approval'); if ($withmetaforsearch) { $tab['can'] = __('Granted + Not subject to approval'); } } if ($withmetaforsearch) { $tab['all'] = __('All'); } return $tab; } /** * Dropdown of validation status * * @param $name select name * @param $options array of possible options: * - value : default value (default waiting) * - all : boolean display all (default false) * - global : for global validation (default false) * - display : boolean display or get string ? (default true) * * @return nothing (display) **/ static function dropdownStatus($name, $options=array()) { $p['value'] = 'waiting'; $p['global'] = false; $p['all'] = false; $p['display'] = true; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } $tab = self::getAllStatusArray($p['all'], $p['global']); $output = ""; if ($p['display']) { echo $output; return true; } return $output; } /** * Get Ticket validation status Name * * @param $value status ID **/ static function getStatus($value) { $tab = self::getAllStatusArray(true, true); // Return $value if not define return (isset($tab[$value]) ? $tab[$value] : $value); } /** * Get Ticket validation status Color * * @param $value status ID **/ static function getStatusColor($value) { switch ($value) { case "waiting" : $style = "#FFC65D"; break; case "rejected" : $style = "#cf9b9b"; break; case "accepted" : $style = "#9BA563"; break; default : $style = "#cf9b9b"; } return $style; } /** * All validations requests for a ticket have the same status ? * * @param $tickets_id integer ticket ID **/ static function isAllValidationsHaveSameStatusForTicket($tickets_id) { global $DB; $query = "SELECT DISTINCT `status` FROM `glpi_ticketvalidations` WHERE `tickets_id` = '$tickets_id'"; $result = $DB->query($query); return ($DB->numrows($result) == 1); } /** * Get Ticket validation demands count * * @param $tickets_id integer ticket ID **/ static function getNumberValidationForTicket($tickets_id) { global $DB; $query = "SELECT COUNT(`id`) AS 'total' FROM `glpi_ticketvalidations` WHERE `tickets_id` = '$tickets_id'"; $result = $DB->query($query); if ($DB->numrows($result)) { return $DB->result($result, 0, "total"); } return false; } /** * Get Ticket validation demands count for a user * * @param $users_id integer User ID **/ static function getNumberTicketsToValidate($users_id) { global $DB; $query = "SELECT COUNT(`id`) AS 'total' FROM `glpi_ticketvalidations` WHERE `users_id_validate` = '$users_id' AND `status` = 'waiting'"; $result = $DB->query($query); if ($DB->numrows($result)) { return $DB->result($result, 0, "total"); } return false; } /** * Get the number of validations attached to a ticket having a specified status * * @param $tickets_id integer ticket ID * @param $status status **/ static function getTicketStatusNumber($tickets_id, $status) { global $DB; $query = "SELECT COUNT(`status`) AS 'total' FROM `glpi_ticketvalidations` WHERE `tickets_id` = '$tickets_id' AND `status` = '".$status."'"; $result = $DB->query($query); if ($DB->numrows($result)) { return $DB->result($result, 0, "total"); } return false; } /** * Form for Followup on Massive action **/ static function showFormMassiveAction() { echo " ".__('Approver')." "; User::dropdown(array('name' => 'users_id_validate', 'entity' => $_SESSION["glpiactive_entity"], 'right' => array('validate_request', 'validate_incident'))); echo "
    ".__('Comments')." "; echo " "; echo ""; } /** * Print the validation list into ticket * * @param $ticket class **/ function showSummary($ticket) { global $DB, $CFG_GLPI; if (!Session::haveRight('validate_request',1) && !Session::haveRight('validate_incident',1) && !Session::haveRight('create_incident_validation',1) && !Session::haveRight('create_request_validation',1)) { return false; } $tID = $ticket->fields['id']; $tmp = array('tickets_id' => $tID); $canadd = $this->can(-1,'w',$tmp); $rand = mt_rand(); echo "
    \n"; if ($canadd) { echo "\n"; if (($ticket->fields["status"] != CommonITILObject::SOLVED) && ($ticket->fields["status"] != CommonITILObject::CLOSED)) { echo "
    \n"; } } $query = "SELECT * FROM `".$this->getTable()."` WHERE `tickets_id` = '".$ticket->getField('id')."'"; if (!$canadd) { $query .= " AND `users_id_validate` = '".Session::getLoginUserID()."' "; } $query .= " ORDER BY submission_date DESC"; $result = $DB->query($query); $number = $DB->numrows($result); if ($number) { $colonnes = array(_x('item', 'State'), sprintf(__('%1$s: %2$s'), __('Request'), __('Date')), __('Approval requester'), sprintf(__('%1$s: %2$s'), __('Request'), __('Comments')), __('Approval date'), __('Approver'), sprintf(__('%1$s: %2$s'), __('Approval'), __('Comments'))); $nb_colonnes = count($colonnes); echo ""; echo ""; echo ""; foreach ($colonnes as $colonne) { echo ""; } echo ""; Session::initNavigateListItems('TicketValidation', //TRANS : %1$s is the itemtype name, %2$s is the name of the item (used for headings of a list) sprintf(__('%1$s = %2$s'), $ticket->getTypeName(1), $ticket->fields["name"])); while ($row = $DB->fetch_assoc($result)) { $canedit = $this->can($row["id"],'w'); Session::addToNavigateListItems('TicketValidation', $row["id"]); $bgcolor = $this->getStatusColor($row['status']); $status = $this->getStatus($row['status']); echo "fields['id']. $row["id"]."$rand();\"" : '') . " id='viewfollowup" . $this->fields['tickets_id'] . $row["id"] . "$rand'>"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
    ".__('Approvals for the ticket')."
    ".$colonne."
    "; if ($canedit) { echo "\n\n"; } echo "
    ".$status."
    ". Html::convDateTime($row["submission_date"])."".getUserName($row["users_id"])."".$row["comment_submission"]."".Html::convDateTime($row["validation_date"])."".getUserName($row["users_id_validate"])."".$row["comment_validation"]."
    "; } else { echo "
    ".__('No item found')."
    "; } } /** * Print the validation form * * @param $ID integer ID of the item * @param $options array options used * **/ function showForm($ID, $options=array()) { if ($ID > 0) { $this->check($ID,'w'); } else { $options['tickets_id'] = $options['parent']->fields["id"]; $this->check(-1,'w', $options); } // No update validation is answer set $validation_admin = (($this->fields["users_id"] == Session::getLoginUserID()) && static::canCreate() && ($this->fields['status'] == 'waiting')); $validator = ($this->fields["users_id_validate"] == Session::getLoginUserID()); $options['colspan'] = 1; $this->showFormHeader($options); if ($validation_admin) { $ticket = new Ticket(); $ticket->getFromDB($this->fields['tickets_id']); $validation_right = ''; if ($ticket->fields['type'] == Ticket::DEMAND_TYPE) { $validation_right = 'validate_request'; } else { $validation_right = 'validate_incident'; } echo ""; echo "".__('Approval requester').""; echo ""; echo ""; echo getUserName($this->fields["users_id"]); echo ""; echo "".__('Approver').""; echo ""; User::dropdown(array('name' => "users_id_validate", 'entity' => $this->getEntityID(), 'right' => $validation_right, 'value' => $this->fields["users_id_validate"])); echo ""; echo ""; echo "".__('Comments').""; echo ""; } else { echo ""; echo "".__('Approval requester').""; echo "".getUserName($this->fields["users_id"]).""; echo "".__('Approver').""; echo "".getUserName($this->fields["users_id_validate"]).""; echo ""; echo "".__('Comments').""; echo "". $this->fields["comment_submission"]. ""; } if ($ID > 0) { echo " "; if ($validator) { echo ""; echo "".__('Status of the approval request').""; echo ""; self::dropdownStatus("status", array('value' => $this->fields["status"])); echo ""; echo ""; echo "".__('Approval comments')."
    (".__('Optional when approved').")"; echo ""; echo ""; } else { echo ""; echo "".__('Status of the approval request').""; echo "". self::getStatus($this->fields["status"]).""; echo ""; echo "".__('Comments').""; echo "".$this->fields["comment_validation"].""; } } $this->showFormButtons($options); return true; } function getSearchOptions() { $tab = array(); $tab['common'] = __('Approval'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'comment_submission'; $tab[1]['name'] = __('Request comments'); $tab[1]['datatype'] = 'text'; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'comment_validation'; $tab[2]['name'] = __('Approval comments'); $tab[2]['datatype'] = 'text'; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'status'; $tab[3]['name'] = __('Status'); $tab[3]['searchtype'] = 'equals'; $tab[3]['datatype'] = 'specific'; $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'submission_date'; $tab[4]['name'] = __('Request date'); $tab[4]['datatype'] = 'datetime'; $tab[5]['table'] = $this->getTable(); $tab[5]['field'] = 'validation_date'; $tab[5]['name'] = __('Approval date'); $tab[5]['datatype'] = 'datetime'; $tab[6]['table'] = 'glpi_users'; $tab[6]['field'] = 'name'; $tab[6]['name'] = __('Approval requester'); $tab[6]['datatype'] = 'itemlink'; $tab[6]['right'] = array('create_incident_validation', 'create_request_validation'); $tab[7]['table'] = 'glpi_users'; $tab[7]['field'] = 'name'; $tab[7]['linkfield'] = 'users_id_validate'; $tab[7]['name'] = __('Approver'); $tab[7]['datatype'] = 'itemlink'; $tab[7]['right'] = array('validate_request', 'validate_incident'); return $tab; } /** * @since version 0.84 * * @param $field * @param $values * @param $options array **/ static function getSpecificValueToDisplay($field, $values, array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } switch ($field) { case 'status': return self::getStatus($values[$field]); } return parent::getSpecificValueToDisplay($field, $values, $options); } /** * @since version 0.84 * * @param $field * @param $name (default '') * @param $values (default '') * @param $options array **/ static function getSpecificValueToSelect($field, $name='', $values='', array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'status' : $options['value'] = $values[$field]; return self::dropdownStatus($name, $options); } return parent::getSpecificValueToSelect($field, $name, $values, $options); } } ?>glpi-0.84.3+dfsg.1/inc/timer.class.php000066400000000000000000000033771226600447100173410ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Timer class for debug */ class Timer { //! Timer value var $timer=0; //! Start the Timer function start () { $this->timer = microtime(true); return true; } /** * Get the current time of the timer * * @param $decimals number of decimal of the result (default 3) * * @return time past from start **/ function getTime ($decimals=3) { // $decimals will set the number of decimals you want for your milliseconds. return number_format(microtime(true) - $this->timer, $decimals, '.', ' '); } } ?> glpi-0.84.3+dfsg.1/inc/toolbox.class.php000066400000000000000000002124221226600447100177000ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // class Toolbox class Toolbox { /** * Wrapper for get_magic_quotes_runtime * * @since version 0.83 * * @return boolean **/ static function get_magic_quotes_runtime() { // Deprecated function(8192): Function get_magic_quotes_runtime() is deprecated if (PHP_VERSION_ID < 50400) { return get_magic_quotes_runtime(); } return 0; } /** * Wrapper for get_magic_quotes_gpc * * @since version 0.83 * * @return boolean **/ static function get_magic_quotes_gpc() { // Deprecated function(8192): Function get_magic_quotes_gpc() is deprecated if (PHP_VERSION_ID < 50400) { return get_magic_quotes_gpc(); } return 0; } /** * Wrapper for max_input_vars * * @since version 0.84 * * @return integer **/ static function get_max_input_vars() { $max = ini_get('max_input_vars'); // Security limit since PHP 5.3.9 if (!$max) { $max = ini_get('suhosin.post.max_vars'); // Security limit from Suhosin } return $max; } /** * Convert first caracter in upper * * @since version 0.83 * * @param $str string to change * * @return string changed **/ static function ucfirst($str) { if ($str{0} >= "\xc3") { return (($str{1} >= "\xa0") ? ($str{0}.chr(ord($str{1})-32)) : ($str{0}.$str{1})).substr($str,2); } return ucfirst($str); } /** * to underline shortcut letter * * @since version 0.83 * * @param $str string from dico * @param $shortcut letter of shortcut * * @return string **/ static function shortcut($str, $shortcut) { $pos = self::strpos(self::strtolower($str), $shortcut); if ($pos !== false) { return self::substr($str, 0, $pos). "". self::substr($str, $pos,1)."". self::substr($str, $pos+1); } return $str; } /** * substr function for utf8 string * * @param $str string string * @param $tofound string string to found * @param $offset integer The search offset. If it is not specified, 0 is used. * (default 0) * * @return substring **/ static function strpos($str, $tofound, $offset=0) { return mb_strpos($str, $tofound, $offset, "UTF-8"); } /** * Replace str_pad() * who bug with utf8 * * @param $input string input string * @param $pad_length integer padding length * @param $pad_string string padding string (default '') * @param $pad_type integer padding type (default STR_PAD_RIGHT) * * @return string **/ static function str_pad($input, $pad_length, $pad_string=" ", $pad_type=STR_PAD_RIGHT) { $diff = (strlen($input) - self::strlen($input)); return str_pad($input, $pad_length+$diff, $pad_string, $pad_type); } /** * strlen function for utf8 string * * @param $str string * * @return length of the string **/ static function strlen($str) { return mb_strlen($str, "UTF-8"); } /** * substr function for utf8 string * * @param $str string * @param $start integer start of the result substring * @param $length integer The maximum length of the returned string if > 0 (default -1) * * @return substring **/ static function substr($str, $start, $length=-1) { if ($length == -1) { $length = self::strlen($str)-$start; } return mb_substr($str, $start, $length, "UTF-8"); } /** * strtolower function for utf8 string * * @param $str string * * @return lower case string **/ static function strtolower($str) { return mb_strtolower($str, "UTF-8"); } /** * strtoupper function for utf8 string * * @param $str string * * @return upper case string **/ static function strtoupper($str) { return mb_strtoupper($str, "UTF-8"); } /** * Is a string seems to be UTF-8 one ? * * @param $str string string to analyze * * @return boolean **/ static function seems_utf8($str) { return mb_check_encoding($str, "UTF-8"); } /** * Encode string to UTF-8 * * @param $string string string to convert * @param $from_charset string original charset (if 'auto' try to autodetect) * (default "ISO-8859-1") * * @return utf8 string **/ static function encodeInUtf8($string, $from_charset="ISO-8859-1") { if (strcmp($from_charset,"auto") == 0) { $from_charset = mb_detect_encoding($string); } return mb_convert_encoding($string, "UTF-8", $from_charset); } /** * Decode string from UTF-8 to specified charset * * @param $string string string to convert * @param $to_charset string destination charset (default "ISO-8859-1") * * @return converted string **/ static function decodeFromUtf8($string, $to_charset="ISO-8859-1") { return mb_convert_encoding($string, $to_charset, "UTF-8"); } /** * Encrypt a string * * @param $string string to encrypt * @param $key string key used to encrypt * * @return encrypted string **/ static function encrypt($string, $key) { $result = ''; for($i=0 ; $i'); $out = array('<', '>'); $value = is_array($value) ? array_map(array(__CLASS__, 'clean_cross_side_scripting_deep'), $value) : (is_null($value) ? NULL : (is_resource($value) ? $value : str_replace($in,$out,$value))); return $value; } /** * Invert fonction from clean_cross_side_scripting_deep * * @param $value array or string item to unclean from clean_cross_side_scripting_deep * * @return unclean item * * @see clean_cross_side_scripting_deep **/ static function unclean_cross_side_scripting_deep($value) { $in = array('<', '>'); $out = array('<', '>'); $value = is_array($value) ? array_map(array(__CLASS__, 'unclean_cross_side_scripting_deep'), $value) : (is_null($value) ? NULL : (is_resource($value) ? $value : str_replace($out,$in,$value))); return $value; } /** * Invert fonction from clean_cross_side_scripting_deep to display HTML striping XSS code * * @since version 0.83.3 * * @param $value array or string: item to unclean from clean_cross_side_scripting_deep * * @return unclean item * * @see clean_cross_side_scripting_deep **/ static function unclean_html_cross_side_scripting_deep($value) { $in = array('<', '>'); $out = array('<', '>'); $value = is_array($value) ? array_map(array(__CLASS__, 'unclean_html_cross_side_scripting_deep'), $value) : (is_null($value) ? NULL : (is_resource($value) ? $value : str_replace($out,$in,$value))); include_once(GLPI_HTMLAWED); // revert unclean inside
          $count = preg_match_all('/(]*>)(.*?)(<\/pre>)/is', $value, $matches);
          for ($i = 0; $i < $count; ++$i) {
             $complete       = $matches[0][$i];
             $cleaned        = self::clean_cross_side_scripting_deep($matches[2][$i]);
             $cleancomplete  = $matches[1][$i].$cleaned.$matches[3][$i];;
             $value          = str_replace($complete, $cleancomplete, $value);
          }
    
          $config             = array('safe'=>1);
          $config["elements"] = "*+iframe";
          $value              = htmLawed($value, $config);
    
          return $value;
       }
    
    
       /**
        * Log in 'php-errors' all args
       **/
       static function logDebug() {
          static $tps = 0;
    
          $msg = "";
          foreach (func_get_args() as $arg) {
             if (is_array($arg) || is_object($arg)) {
                $msg .= ' ' . print_r($arg, true);
             } else if (is_null($arg)) {
                $msg .= ' NULL';
             } else if (is_bool($arg)) {
                $msg .= ' '.($arg ? 'true' : 'false');
             } else {
                $msg .= ' ' . $arg;
             }
          }
    
          if ($tps && function_exists('memory_get_usage')) {
             $msg .= ' ('.number_format(microtime(true)-$tps,3).'", '.
                     number_format(memory_get_usage()/1024/1024,2).'Mio)';
          }
    
          $tps = microtime(true);
          self::logInFile('php-errors', $msg."\n",true);
       }
    
    
       /**
        * Log a message in log file
        *
        * @param $name   string   name of the log file
        * @param $text   string   text to log
        * @param $force  boolean  force log in file not seeing use_log_in_files config (false by default)
       **/
       static function logInFile($name, $text, $force=false) {
          global $CFG_GLPI;
    
          $user = '';
          if (function_exists('Session::getLoginUserID')) {
             $user = " [".Session::getLoginUserID().'@'.php_uname('n')."]";
          }
    
          $ok = true;
          if ((isset($CFG_GLPI["use_log_in_files"]) && $CFG_GLPI["use_log_in_files"])
              || $force) {
             $ok = error_log(date("Y-m-d H:i:s")."$user\n".$text, 3, GLPI_LOG_DIR."/".$name.".log");
          }
    
          if (isset($_SESSION['glpi_use_mode'])
              && ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE)
              && isCommandLine()) {
             fwrite(STDERR, $text);
          }
          return $ok;
       }
    
    
       /**
        * Specific error handler in Normal mode
        *
        * @param $errno     integer  level of the error raised.
        * @param $errmsg    string   error message.
        * @param $filename  string   filename that the error was raised in.
        * @param $linenum   integer  line number the error was raised at.
        * @param $vars      array    that points to the active symbol table at the point the error occurred.
       **/
       static function userErrorHandlerNormal($errno, $errmsg, $filename, $linenum, $vars) {
    
          // Date et heure de l'erreur
          $errortype = array(E_ERROR           => 'Error',
                             E_WARNING         => 'Warning',
                             E_PARSE           => 'Parsing Error',
                             E_NOTICE          => 'Notice',
                             E_CORE_ERROR      => 'Core Error',
                             E_CORE_WARNING    => 'Core Warning',
                             E_COMPILE_ERROR   => 'Compile Error',
                             E_COMPILE_WARNING => 'Compile Warning',
                             E_USER_ERROR      => 'User Error',
                             E_USER_WARNING    => 'User Warning',
                             E_USER_NOTICE     => 'User Notice',
                             E_STRICT          => 'Runtime Notice',
                             // Need php 5.2.0
                             4096 /*E_RECOVERABLE_ERROR*/  => 'Catchable Fatal Error',
                             // Need php 5.3.0
                             8192 /* E_DEPRECATED */       => 'Deprecated function',
                             16384 /* E_USER_DEPRECATED */ => 'User deprecated function');
          // Les niveaux qui seront enregistrés
          $user_errors = array(E_USER_ERROR, E_USER_NOTICE, E_USER_WARNING);
    
          $err = $errortype[$errno] . "($errno): $errmsg\n";
          if (in_array($errno, $user_errors)) {
             $err .= "Variables:".wddx_serialize_value($vars, "Variables")."\n";
          }
    
          if (function_exists("debug_backtrace")) {
             $err   .= "Backtrace :\n";
             $traces = debug_backtrace();
             foreach ($traces as $trace) {
                if (isset($trace["file"]) && isset($trace["line"])) {
                   $err .= $trace["file"] . ":" . $trace["line"] . "\t\t"
                           . (isset($trace["class"]) ? $trace["class"] : "")
                           . (isset($trace["type"]) ? $trace["type"] : "")
                           . (isset($trace["function"]) ? $trace["function"]."()" : ""). "\n";
                }
             }
    
          } else {
             $err .= "Script: $filename, Line: $linenum\n" ;
          }
    
          // sauvegarde de l'erreur, et mail si c'est critique
          self::logInFile("php-errors", $err."\n");
    
          return $errortype[$errno];
       }
    
    
       /**
        * Specific error handler in Debug mode
        *
        * @param $errno     integer  level of the error raised.
        * @param $errmsg    string   error message.
        * @param $filename  string   filename that the error was raised in.
        * @param $linenum   integer  line number the error was raised at.
        * @param $vars      array    that points to the active symbol table at the point the error occurred.
       **/
       static function userErrorHandlerDebug($errno, $errmsg, $filename, $linenum, $vars) {
    
          // For file record
          $type = self::userErrorHandlerNormal($errno, $errmsg, $filename, $linenum, $vars);
    
          // Display
          if (!isCommandLine()) {
             echo '
    '. 'PHP '.$type.': '; echo $errmsg.' in '.$filename.' at line '.$linenum.'
    '; } else { echo 'PHP '.$type.': '.$errmsg.' in '.$filename.' at line '.$linenum."\n"; } } /** * Switch error mode for GLPI * * @param $mode Integer from Session::*_MODE (default NULL) * @param $debug_sql Boolean (default NULL) * @param $debug_vars Boolean (default NULL) * @param $log_in_files Boolean (default NULL) * * @since version 0.84 **/ static function setDebugMode($mode=NULL, $debug_sql=NULL, $debug_vars=NULL, $log_in_files=NULL) { global $CFG_GLPI; if (isset($mode)) { $_SESSION['glpi_use_mode'] = $mode; } if (isset($debug_sql)) { $CFG_GLPI['debug_sql'] = $debug_sql; } if (isset($debug_vars)) { $CFG_GLPI['debug_vars'] = $debug_vars; } if (isset($log_in_files)) { $CFG_GLPI['use_log_in_files'] = $log_in_files; } // If debug mode activated : display some information if ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) { // display_errors only need for for E_ERROR, E_PARSE, ... which cannot be catched // Recommended development settings ini_set('display_errors', 'On'); error_reporting(E_ALL | E_STRICT); set_error_handler(array('Toolbox','userErrorHandlerDebug')); } else { // Recommended production settings ini_set('display_errors', 'Off'); error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT); set_error_handler(array('Toolbox', 'userErrorHandlerNormal')); } } /** * Send a file (not a document) to the navigator * See Document->send(); * * @param $file string: storage filename * @param $filename string: file title * * @return nothing **/ static function sendFile($file, $filename) { // Test securite : document in DOC_DIR $tmpfile = str_replace(GLPI_DOC_DIR, "", $file); if (strstr($tmpfile,"../") || strstr($tmpfile,"..\\")) { Event::log($file, "sendFile", 1, "security", $_SESSION["glpiname"]." try to get a non standard file."); die("Security attack!!!"); } if (!file_exists($file)) { die("Error file $file does not exist"); } $splitter = explode("/", $file); $mime = "application/octetstream"; if (preg_match('/\.(...)$/', $file, $regs)) { switch ($regs[1]) { case "sql" : $mime = "text/x-sql"; break; case "xml" : $mime = "text/xml"; break; case "csv" : $mime = "text/csv"; break; case "svg" : $mime = "image/svg+xml"; break; case "png" : $mime = "image/png"; break; } } // Now send the file with header() magic header("Expires: Mon, 26 Nov 1962 00:00:00 GMT"); header('Pragma: private'); /// IE BUG + SSL header('Cache-control: private, must-revalidate'); /// IE BUG + SSL header("Content-disposition: filename=\"$filename\""); header("Content-type: ".$mime); readfile($file) or die ("Error opening file $file"); } /** * Add slash for variable & array * * @param $value array or string: value to add slashes (array or string) * * @return addslashes value **/ static function addslashes_deep($value) { global $DB; $value = is_array($value) ? array_map(array(__CLASS__, 'addslashes_deep'), $value) : (is_null($value) ? NULL : (is_resource($value) ? $value : $DB->escape($value))); return $value; } /** * Strip slash for variable & array * * @param $value array or string: item to stripslashes (array or string) * * @return stripslashes item **/ static function stripslashes_deep($value) { $value = is_array($value) ? array_map(array(__CLASS__, 'stripslashes_deep'), $value) : (is_null($value) ? NULL : (is_resource($value) ? $value :stripslashes($value))); return $value; } /** Converts an array of parameters into a query string to be appended to a URL. * * @param $array array parameters to append to the query string. * @param $separator separator may be defined as & to display purpose * (default '&') * @param $parent This should be left blank (it is used internally by the function). * (default '') * * @return string : Query string to append to a URL. **/ static function append_params($array, $separator='&', $parent='') { $params = array(); foreach ($array as $k => $v) { if (is_array($v)) { $params[] = self::append_params($v, $separator, (empty($parent) ? rawurlencode($k) : $parent .'['.rawurlencode($k).']')); } else { $params[] = (!empty($parent) ? $parent . '[' . rawurlencode($k) . ']' : rawurlencode($k)) . '=' . rawurlencode($v); } } return implode($separator, $params); } /** * Compute PHP memory_limit * * @return memory limit **/ static function getMemoryLimit() { $mem = ini_get("memory_limit"); preg_match("/([-0-9]+)([KMG]*)/", $mem, $matches); $mem = ""; // no K M or G if (isset($matches[1])) { $mem = $matches[1]; if (isset($matches[2])) { switch ($matches[2]) { case "G" : $mem *= 1024; // nobreak; case "M" : $mem *= 1024; // nobreak; case "K" : $mem *= 1024; // nobreak; } } } return $mem; } /** * Check is current memory_limit is enough for GLPI * * @since version 0.83 * * @return 0 if PHP not compiled with memory_limit support * 1 no memory limit (memory_limit = -1) * 2 insufficient memory for GLPI * 3 enough memory for GLPI **/ static function checkMemoryLimit() { $mem = self::getMemoryLimit(); if ($mem == "") { return 0; } if ($mem == "-1") { return 1; } if ($mem < (64*1024*1024)) { return 2; } return 3; } /** * Common Checks needed to use GLPI * * @return 2 : creation error 1 : delete error 0: OK **/ static function commonCheckForUseGLPI() { global $CFG_GLPI; $error = 0; // Title echo "".__('Test done')."".__('Results').""; // Parser test echo "".__('Testing PHP Parser').""; // PHP Version - exclude PHP3, PHP 4 and zend.ze1 compatibility if (version_compare(PHP_VERSION, '5.3.0') >= 0) { // PHP > 5.3 ok, now check PHP zend.ze1_compatibility_mode if (ini_get("zend.ze1_compatibility_mode") == 1) { $error = 2; echo " ". __('GLPI is not compatible with the option zend.ze1_compatibility_mode = On.'). ""; } else { echo "\""."; } } else { // PHP <5 $error = 2; echo " ". __('You must install at least PHP 5.3.0.').""; } echo ""; // Check for mysql extension ni php echo "".__('MySQL Improved extension test').""; if (class_exists("mysqli")) { echo "\""."; } else { echo ""; echo "". __('You must install the MySQL Improved extension for PHP.').""; $error = 2; } echo ""; // session test echo "".__('Sessions test').""; // check whether session are enabled at all!! if (!extension_loaded('session')) { $error = 2; echo "".__('Your parser PHP is not installed with sessions support!'). ""; } else if ((isset($_SESSION["Test_session_GLPI"]) && ($_SESSION["Test_session_GLPI"] == 1)) // From install || isset($_SESSION["glpi_currenttime"])) { // From Update echo "\""."; } else if ($error != 2) { echo ""; echo "". __('Make sure that sessions support has been activated in your php.ini').""; $error = 1; } echo ""; //Test for session auto_start if (ini_get('session.auto_start')==1) { echo "".__('Test session auto start').""; echo ""; echo "". __('session.auto_start is activated. See .htaccess file in the GLPI root for more information.'). ""; $error = 2; } //Test for option session use trans_id loaded or not. echo "".__('Test if Session_use_trans_sid is used').""; if (isset($_POST[session_name()]) || isset($_GET[session_name()])) { echo ""; echo "". __('You must desactivate the Session_use_trans_id option in your php.ini').""; $error = 2; } else { echo "\""."; } echo ""; //Test for sybase extension loaded or not. echo "".__('magic_quotes_sybase extension test').""; if (ini_get('magic_quotes_sybase')) { echo ""; echo "". __('GLPI does not work with the magic_quotes_sybase option. Please turn it off and retry'). ""; $error = 2; } else { echo "\""."; } echo ""; //Test for ctype extension loaded or not (forhtmlawed) echo "".__('Test ctype functions').""; if (!function_exists('ctype_digit')) { echo "". __("GLPI can't work correctly without the ctype functions").">"; $error = 2; } else { echo "\""."; } echo ""; //Test for json_encode function. echo "".__('Test json functions').""; if (!function_exists('json_encode') || !function_exists('json_decode')) { echo "". __("GLPI can't work correctly without the json_encode and json_decode functions"). ">"; $error = 2; } else { echo "\""."; } echo ""; //Test for mbstring extension. echo "".__('Mbstring extension test').""; if (!extension_loaded('mbstring')) { echo "". __('Mbstring extension of your parser PHP is not installed').">"; $error = 2; } else { echo "\""."; } echo ""; // memory test echo "".__('Allocated memory test').""; //Get memory limit $mem = self::getMemoryLimit(); switch (self::checkMemoryLimit()) { case 0 : // memory_limit not compiled -> no memory limit case 1 : // memory_limit compiled and unlimited echo "\""."; break; case 2: //Insufficient memory $showmem = $mem/1048576; echo "". sprintf(__('%1$s: %2$s'), __('Allocated memory'), sprintf(__('%1$s %2$s'), $showmem, __('Mio'))). "". "
    ".__('A minimum of 64MB is commonly required for GLPI.'). "
    ".__('Try increasing the memory_limit parameter in the php.ini file.'). ""; $error = 2; break; case 3: //Got enough memory, going to the next step echo "\"". 64Mio - Perfect!')."\" title=\"". __s('Allocated memory > 64Mio - Perfect!')."\">"; break; } echo ""; $suberr = Config::checkWriteAccessToDirs(); if ($suberr > $error) { $error = $suberr; } $suberr = self::checkSELinux(); if ($suberr > $error) { $error = $suberr; } return $error; } /** * Check SELinux configuration * * @since version 0.84 * * @return integer 0: OK, 1:Warning, 2:Error **/ static function checkSELinux() { global $CFG_GLPI; if ((DIRECTORY_SEPARATOR != '/') || !file_exists('/usr/sbin/getenforce')) { // This is not a SELinux system return 0; } $mode = exec("/usr/sbin/getenforce"); //TRANS: %s is mode name (Permissive, Enforcing of Disabled) $msg = sprintf(__('SELinux mode is %s'), $mode); echo "$msg"; // All modes should be ok echo "$mode"; if (!strcasecmp($mode, 'Disabled')) { // Other test are not useful return 0; } $err = 0; // No need to check file context as checkWriteAccessToDirs will show issues // Enforcing mode will block some feature (notif, ...) // Permissive mode will write lot of stuff in audit.log $bools = array('httpd_can_network_connect', 'httpd_can_network_connect_db', 'httpd_can_sendmail'); foreach ($bools as $bool) { $state = exec('/usr/sbin/getsebool '.$bool); //TRANS: %s is an option name $msg = sprintf(__('SELinux boolean configuration for %s'), $state); echo "$msg"; if (substr($state, -2) == 'on') { echo "$state". ""; } else { echo "$state". ""; $err = 1; } echo ""; } return $err; } /** * Get the filesize of a complete directory (from php.net) * * @param $path string: directory or file to get size * * @return size of the $path **/ static function filesizeDirectory($path) { if (!is_dir($path)) { return filesize($path); } if ($handle = opendir($path)) { $size = 0; while (false !== ($file = readdir($handle))) { if (($file != '.') && ($file != '..')) { $size += filesize($path.'/'.$file); $size += self::filesizeDirectory($path.'/'.$file); } } closedir($handle); return $size; } } /** Format a size passing a size in octet * * @param $size integer: Size in octet * * @return formatted size **/ static function getSize($size) { //TRANS: list of unit (o for octet) $bytes = array(__('o'), __('Kio'), __('Mio'), __('Gio'), __('Tio')); foreach ($bytes as $val) { if ($size > 1024) { $size = $size / 1024; } else { break; } } //TRANS: %1$s is a number maybe float or string and %2$s the unit return sprintf(__('%1$s %2$s'), round($size, 2), $val); } /** * Delete a directory and file contains in it * * @param $dir string: directory to delete **/ static function deleteDir($dir) { if (file_exists($dir)) { chmod($dir, 0777); if (is_dir($dir)) { $id_dir = opendir($dir); while (($element = readdir($id_dir)) !== false) { if (($element != ".") && ($element != "..")) { if (is_dir($dir."/".$element)) { self::deleteDir($dir."/".$element); } else { unlink($dir."/".$element); } } } closedir($id_dir); rmdir($dir); } else { // Delete file unlink($dir); } } } /** * Check if new version is available * * @param $auto boolean: check done autically ? (if not display result) * (true by default) * @param $messageafterredirect boolean: use message after redirect instead of display * (false by default) * * @return string explaining the result **/ static function checkNewVersionAvailable($auto=true, $messageafterredirect=false) { global $CFG_GLPI; if (!$auto && !Session::haveRight("check_update","r")) { return false; } if (!$auto && !$messageafterredirect) { echo "
    "; } $error = ""; $latest_version = self::getURLContent("http://glpi-project.org/latest_version", $error); if (strlen(trim($latest_version)) == 0) { if (!$auto) { if ($messageafterredirect) { Session::addMessageAfterRedirect($error, true, ERROR); } else { echo "
    $error
    "; } } else { return $error; } } else { $splitted = explode(".", trim($CFG_GLPI["version"])); if ($splitted[0] < 10) { $splitted[0] .= "0"; } if ($splitted[1] < 10) { $splitted[1] .= "0"; } $cur_version = ($splitted[0]*10000) + ($splitted[1]*100); if (isset($splitted[2])) { if ($splitted[2] < 10) { $splitted[2] .= "0"; } $cur_version += $splitted[2]; } $splitted = explode(".", trim($latest_version)); if ($splitted[0] < 10) { $splitted[0] .= "0"; } if ($splitted[1] < 10) { $splitted[1] .= "0"; } $lat_version = ($splitted[0]*10000) + ($splitted[1]*100); if (isset($splitted[2])) { if ($splitted[2] < 10) { $splitted[2] .= "0"; } $lat_version += $splitted[2]; } if ($cur_version < $lat_version) { $config_object = new Config(); $input["id"] = 1; $input["founded_new_version"] = $latest_version; $config_object->update($input); if (!$auto) { if ($messageafterredirect) { Session::addMessageAfterRedirect(sprintf(__('A new version is available: %s.'), $latest_version)); Session::addMessageAfterRedirect(__('You will find it on the GLPI-PROJECT.org site.')); } else { echo "
    ".sprintf(__('A new version is available: %s.'), $latest_version)."
    "; echo "
    ".__('You will find it on the GLPI-PROJECT.org site.'). "
    "; } } else { if ($messageafterredirect) { Session::addMessageAfterRedirect(sprintf(__('A new version is available: %s.'), $latest_version)); } else { return sprintf(__('A new version is available: %s.'), $latest_version); } } } else { if (!$auto) { if ($messageafterredirect) { Session::addMessageAfterRedirect(__('You have the latest available version')); } else { echo "
    ".__('You have the latest available version')."
    "; } } else { if ($messageafterredirect) { Session::addMessageAfterRedirect(__('You have the latest available version')); } else { return __('You have the latest available version'); } } } } return 1; } /** * Determine if Imap/Pop is usable checking extension existence * * @return boolean **/ static function canUseImapPop() { return extension_loaded('imap'); } /** * Determine if Ldap is usable checking ldap extension existence * * @return boolean **/ static function canUseLdap() { return extension_loaded('ldap'); } /** * Check Write Access to a directory * * @param $dir string: directory to check * * @return 2 : creation error 1 : delete error 0: OK **/ static function testWriteAccessToDirectory($dir) { $rand = rand(); // Check directory creation which can be denied by SElinux $sdir = sprintf("%s/test_glpi_%08x", $dir, $rand); if (!mkdir($sdir)) { return 4; } if (!rmdir($sdir)) { return 3; } // Check file creation $path = sprintf("%s/test_glpi_%08x.txt", $dir, $rand); $fp = fopen($path, 'w'); if (empty($fp)) { return 2; } $fw = fwrite($fp, "This file was created for testing reasons. "); fclose($fp); $delete = unlink($path); if (!$delete) { return 1; } return 0; } /** * Get form URL for itemtype * * @param $itemtype string item type * @param $full path or relative one (true by default) * * return string itemtype Form URL **/ static function getItemTypeFormURL($itemtype, $full=true) { global $CFG_GLPI; $dir = ($full ? $CFG_GLPI['root_doc'] : ''); if ($plug = isPluginItemType($itemtype)) { $dir .= "/plugins/".strtolower($plug['plugin']); $item = strtolower($plug['class']); } else { // Standard case $item = strtolower($itemtype); } return "$dir/front/$item.form.php"; } /** * Get search URL for itemtype * * @param $itemtype string item type * @param $full path or relative one (true by default) * * return string itemtype search URL **/ static function getItemTypeSearchURL($itemtype, $full=true) { global $CFG_GLPI; $dir = ($full ? $CFG_GLPI['root_doc'] : ''); if ($plug = isPluginItemType($itemtype)) { $dir .= "/plugins/".strtolower($plug['plugin']); $item = strtolower($plug['class']); } else { // Standard case if ($itemtype == 'Cartridge') { $itemtype = 'CartridgeItem'; } if ($itemtype == 'Consumable') { $itemtype = 'ConsumableItem'; } $item = strtolower($itemtype); } return "$dir/front/$item.php"; } /** * Get ajax tabs url for itemtype * * @param $itemtype string item type * @param $full path or relative one (true by default) * * return string itemtype tabs URL **/ static function getItemTypeTabsURL($itemtype, $full=true) { global $CFG_GLPI; $filename = "/ajax/common.tabs.php"; /// To keep for plugins /// TODO drop also for plugins. /// MoYo : test to drop it : plugin dev ? // if ($plug = isPluginItemType($itemtype)) { // $dir = "/plugins/".strtolower($plug['plugin']); // $item = strtolower($plug['class']); // $tempname = $dir."/ajax/$item.tabs.php"; // if (file_exists(GLPI_ROOT.$tempname)) { // $filename = $tempname; // } // } return ($full ? $CFG_GLPI['root_doc'] : '').$filename; } /** * Get a random string * * @param $length integer: length of the random string * * @return random string **/ static function getRandomString($length) { $alphabet = "1234567890abcdefghijklmnopqrstuvwxyz"; $rndstring = ""; for ($a=0 ; $a<=$length ; $a++) { $b = rand(0, strlen($alphabet) - 1); $rndstring .= $alphabet[$b]; } return $rndstring; } /** * Split timestamp in time units * * @param $time integer: timestamp * * @return string **/ static function getTimestampTimeUnits($time) { $time = round(abs($time)); $out['second'] = 0; $out['minute'] = 0; $out['hour'] = 0; $out['day'] = 0; $out['second'] = $time%MINUTE_TIMESTAMP; $time -= $out['second']; if ($time > 0) { $out['minute'] = ($time%HOUR_TIMESTAMP)/MINUTE_TIMESTAMP; $time -= $out['minute']*MINUTE_TIMESTAMP; if ($time > 0) { $out['hour'] = ($time%DAY_TIMESTAMP)/HOUR_TIMESTAMP; $time -= $out['hour']*HOUR_TIMESTAMP; if ($time > 0) { $out['day'] = $time/DAY_TIMESTAMP; } } } return $out; } /** * Get a web page. Use proxy if configured * * @param $url string to retrieve * @param $msgerr string set if problem encountered (default NULL) * @param $rec integer internal use only Must be 0 (default 0) * * @return content of the page (or empty) **/ static function getURLContent ($url, &$msgerr=NULL, $rec=0) { global $CFG_GLPI; $content = ""; $taburl = parse_url($url); // Connection directe if (empty($CFG_GLPI["proxy_name"])) { $hostscheme = ''; $defaultport = 80; // Manage standard HTTPS port : scheme detection or port 443 if ((isset($taburl["scheme"]) && $taburl["scheme"]=='https') || (isset($taburl["port"]) && $taburl["port"]=='443')) { $hostscheme = 'ssl://'; $defaultport = 443; } if ($fp = @fsockopen($hostscheme.$taburl["host"], (isset($taburl["port"]) ? $taburl["port"] : $defaultport), $errno, $errstr, 1)) { if (isset($taburl["path"]) && ($taburl["path"] != '/')) { $toget = $taburl["path"]; if (isset($taburl["query"])) { $toget .= '?'.$taburl["query"]; } // retrieve path + args $request = "GET $toget HTTP/1.1\r\n"; } else { $request = "GET / HTTP/1.1\r\n"; } $request .= "Host: ".$taburl["host"]."\r\n"; } else { if (isset($msgerr)) { //TRANS: %s is the error string $msgerr = sprintf(__('Connection failed. If you use a proxy, please configure it. (%s)'), $errstr); } return ""; } } else { // Connection using proxy $fp = fsockopen($CFG_GLPI["proxy_name"], $CFG_GLPI["proxy_port"], $errno, $errstr, 1); if ($fp) { $request = "GET $url HTTP/1.1\r\n"; $request .= "Host: ".$taburl["host"]."\r\n"; if (!empty($CFG_GLPI["proxy_user"])) { $request .= "Proxy-Authorization: Basic " . base64_encode ($CFG_GLPI["proxy_user"].":". self::decrypt($CFG_GLPI["proxy_passwd"], GLPIKEY)) . "\r\n"; } } else { if (isset($msgerr)) { //TRANS: %s is the error string $msgerr = sprintf(__('Failed to connect to the proxy server (%s)'), $errstr); } return ""; } } $request .= "User-Agent: GLPI/".trim($CFG_GLPI["version"])."\r\n"; $request .= "Connection: Close\r\n\r\n"; fwrite($fp, $request); $header = true ; $redir = false; $errstr = ""; while (!feof($fp)) { if ($buf = fgets($fp, 1024)) { if ($header) { if (strlen(trim($buf)) == 0) { // Empty line = end of header $header = false; } else if ($redir && preg_match("/^Location: (.*)$/", $buf, $rep)) { if ($rec < 9) { $desturl = trim($rep[1]); $taburl2 = parse_url($desturl); if (isset($taburl2['host'])) { // Redirect to another host return (self::getURLContent($desturl, $errstr, $rec+1)); } // redirect to same host return (self::getURLContent((isset($taburl['scheme'])?$taburl['scheme']:'http'). "://".$taburl['host']. (isset($taburl['port'])?':'.$taburl['port']:''). $desturl, $errstr, $rec+1)); } $errstr = "Too deep"; break; } else if (preg_match("/^HTTP.*200.*OK/", $buf)) { // HTTP 200 = OK } else if (preg_match("/^HTTP.*302/", $buf)) { // HTTP 302 = Moved Temporarily $redir = true; } else if (preg_match("/^HTTP/", $buf)) { // Other HTTP status = error $errstr = trim($buf); break; } } else { // Body $content .= $buf; } } } // eof fclose($fp); if (empty($content) && isset($msgerr)) { if (empty($errstr)) { $msgerr = __('No data available on the web site'); } else { //TRANS: %s is the error string $msgerr = sprintf(__('Impossible to connect to site (%s)'),$errstr); } } return $content; } /** * @param $need * @param $tab **/ static function key_exists_deep($need, $tab) { foreach ($tab as $key => $value) { if ($need == $key) { return true; } if (is_array($value) && self::key_exists_deep($need, $value)) { return true; } } return false; } /** * Manage planning posted datas (must have begin + duration or end) * Compute end if duration is set * * @param $data array data to process * * @return processed datas **/ static function manageBeginAndEndPlanDates(&$data) { if (!isset($data['end'])) { if (isset($data['begin']) && isset($data['_duration'])) { $begin_timestamp = strtotime($data['begin']); $data['end'] = date("Y-m-d H:i:s", $begin_timestamp+$data['_duration']); unset($data['_duration']); } } } /** * Manage login redirection * * @param $where string: where to redirect ? **/ static function manageRedirect($where) { global $CFG_GLPI, $PLUGIN_HOOKS; if (!empty($where)) { $data = explode("_", $where); if ((count($data) >= 2) && isset($_SESSION["glpiactiveprofile"]["interface"]) && !empty($_SESSION["glpiactiveprofile"]["interface"])) { $forcetab = ''; if (isset($data[2])) { $forcetab = 'forcetab='.$data[2]; } // Plugin tab if (isset($data[3])) { $forcetab .= '_'.$data[3]; } switch ($_SESSION["glpiactiveprofile"]["interface"]) { case "helpdesk" : switch ($data[0]) { case "plugin" : $plugin = $data[1]; $valid = false; if (isset($PLUGIN_HOOKS['redirect_page'][$plugin]) && !empty($PLUGIN_HOOKS['redirect_page'][$plugin])) { // Simple redirect if (!is_array($PLUGIN_HOOKS['redirect_page'][$plugin])) { if (isset($data[2]) && ($data[2] > 0)) { $valid = true; $id = $data[2]; $page = $PLUGIN_HOOKS['redirect_page'][$plugin]; } $forcetabnum = 3 ; } else { // Complex redirect if (isset($data[2]) && !empty($data[2]) && isset($data[3]) && ($data[3] > 0) && isset($PLUGIN_HOOKS['redirect_page'][$plugin][$data[2]]) && !empty($PLUGIN_HOOKS['redirect_page'][$plugin][$data[2]])) { $valid = true; $id = $data[3]; $page = $PLUGIN_HOOKS['redirect_page'][$plugin][$data[2]]; } $forcetabnum = 4 ; } } if (isset($data[$forcetabnum])) { $forcetab = 'forcetab='.$data[$forcetabnum]; } if ($valid) { Html::redirect($CFG_GLPI["root_doc"]. "/plugins/$plugin/$page?id=$id&$forcetab"); } else { Html::redirect($CFG_GLPI["root_doc"]. "/front/helpdesk.public.php?$forcetab"); } break; // Use for compatibility with old name case "tracking" : case "ticket" : // Check entity if (($item = getItemForItemtype($data[0])) && $item->isEntityAssign()) { if ($item->getFromDB($data[1])) { if (!Session::haveAccessToEntity($item->getEntityID())) { Session::changeActiveEntities($item->getEntityID(),1); } } } Html::redirect($CFG_GLPI["root_doc"]."/front/ticket.form.php?id=".$data[1]. "&$forcetab"); break; case "preference" : Html::redirect($CFG_GLPI["root_doc"]."/front/preference.php?$forcetab"); break; default : Html::redirect($CFG_GLPI["root_doc"]."/front/helpdesk.public.php?$forcetab"); break; } break; case "central" : switch ($data[0]) { case "plugin" : $plugin = $data[1]; $valid = false; if (isset($PLUGIN_HOOKS['redirect_page'][$plugin]) && !empty($PLUGIN_HOOKS['redirect_page'][$plugin])) { // Simple redirect if (!is_array($PLUGIN_HOOKS['redirect_page'][$plugin])) { if (isset($data[2]) && ($data[2] > 0)) { $valid = true; $id = $data[2]; $page = $PLUGIN_HOOKS['redirect_page'][$plugin]; } $forcetabnum = 3 ; } else { // Complex redirect if (isset($data[2]) && !empty($data[2]) && isset($data[3]) && ($data[3] > 0) && isset($PLUGIN_HOOKS['redirect_page'][$plugin][$data[2]]) && !empty($PLUGIN_HOOKS['redirect_page'][$plugin][$data[2]])) { $valid = true; $id = $data[3]; $page = $PLUGIN_HOOKS['redirect_page'][$plugin][$data[2]]; } $forcetabnum = 4 ; } } if (isset($data[$forcetabnum])) { $forcetab = 'forcetab='.$data[$forcetabnum]; } if ($valid) { Html::redirect($CFG_GLPI["root_doc"]. "/plugins/$plugin/$page?id=$id&$forcetab"); } else { Html::redirect($CFG_GLPI["root_doc"]."/front/central.php?$forcetab"); } break; case "preference" : Html::redirect($CFG_GLPI["root_doc"]."/front/preference.php?$forcetab"); break; // Use for compatibility with old name // no break case "tracking" : $data[0] = "ticket"; default : if (!empty($data[0] )&& ($data[1] > 0)) { // Check entity if (($item = getItemForItemtype($data[0])) && $item->isEntityAssign()) { if ($item->getFromDB($data[1])) { if (!Session::haveAccessToEntity($item->getEntityID())) { Session::changeActiveEntities($item->getEntityID(),1); } } } Html::redirect($CFG_GLPI["root_doc"]."/front/".$data[0].".form.php?id=". $data[1]."&$forcetab"); } else { Html::redirect($CFG_GLPI["root_doc"]."/front/central.php?$forcetab"); } break; } break; } } } } /** * Convert a value in byte, kbyte, megabyte etc... * * @param $val string: config value (like 10k, 5M) * * @return $val **/ static function return_bytes_from_ini_vars($val) { $val = trim($val); $last = self::strtolower($val{strlen($val)-1}); switch($last) { // Le modifieur 'G' est disponible depuis PHP 5.1.0 case 'g' : $val *= 1024; // no break; case 'm' : $val *= 1024; // no break; case 'k' : $val *= 1024; // no break; } return $val; } /** * Parse imap open connect string * * @since version 0.84 * * @param $value string: connect string * @param $forceport boolean: force compute port if not set (false by default) * * @return array of parsed arguments (address, port, mailbox, type, ssl, tls, validate-cert * norsh, secure and debug) : options are empty if not set * and options have boolean values if set **/ static function parseMailServerConnectString($value, $forceport=false) { $tab = array(); if (strstr($value,":")) { $tab['address'] = str_replace("{", "", preg_replace("/:.*/", "", $value)); $tab['port'] = preg_replace("/.*:/", "", preg_replace("/\/.*/", "", $value)); } else { if (strstr($value,"/")) { $tab['address'] = str_replace("{", "", preg_replace("/\/.*/", "", $value)); } else { $tab['address'] = str_replace("{", "", preg_replace("/}.*/", "", $value)); } $tab['port'] = ""; } $tab['mailbox'] = preg_replace("/.*}/", "", $value); $tab['type'] = ''; if (strstr($value,"/imap")) { $tab['type'] = 'imap'; } else if (strstr($value,"/pop")) { $tab['type'] = 'pop'; } $tab['ssl'] = false; if (strstr($value,"/ssl")) { $tab['ssl'] = true; } if ($forceport && empty($tab['port'])) { if ($tab['type'] == 'pop') { if ($tab['ssl']) { $tab['port'] = 110; } else { $tab['port'] = 995; } } if ($tab['type'] = 'imap') { if ($tab['ssl']) { $tab['port'] = 993; } else { $tab['port'] = 143; } } } $tab['tls'] = ''; if (strstr($value,"/tls")) { $tab['tls'] = true; } if (strstr($value,"/notls")) { $tab['tls'] = false; } $tab['validate-cert'] = ''; if (strstr($value,"/validate-cert")) { $tab['validate-cert'] = true; } if (strstr($value,"/novalidate-cert")) { $tab['validate-cert'] = false; } $tab['norsh'] = ''; if (strstr($value,"/norsh")) { $tab['norsh'] = true; } $tab['secure'] = ''; if (strstr($value,"/secure")) { $tab['secure'] = true; } $tab['debug'] = ''; if (strstr($value,"/debug")) { $tab['debug'] = true; } return $tab; } /** * Display a mail server configuration form * * @param $value String host connect string ex * {localhost:993/imap/ssl}INBOX * * @return String type of the server (imap/pop) **/ static function showMailServerConfig($value) { if (!Session::haveRight("config", "w")) { return false; } $tab = Toolbox::parseMailServerConnectString($value); echo "" . __('Server') . ""; echo ""; echo "\n"; echo "" . __('Connection options') . ""; echo " "; echo " "; echo " "; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo ""; echo "\n"; echo "". __('Incoming mail folder (optional, often INBOX)').""; echo ""; echo "\n"; //TRANS: for mail connection system echo "" . __('Port (optional)') . ""; echo "\n"; if (empty($value)) { $value = " "; } //TRANS: for mail connection system echo "" . __('Connection string') . ""; echo "$value\n"; return $tab['type']; } /** * @param $input **/ static function constructMailServerConfig($input) { $out = ""; if (isset($input['mail_server']) && !empty($input['mail_server'])) { $out .= "{" . $input['mail_server']; } else { return $out; } if (isset($input['server_port']) && !empty($input['server_port'])) { $out .= ":" . $input['server_port']; } if (isset($input['server_type'])) { $out .= $input['server_type']; } if (isset($input['server_ssl'])) { $out .= $input['server_ssl']; } if (isset($input['server_cert']) && (!empty($input['server_ssl']) || !empty($input['server_tls']))) { $out .= $input['server_cert']; } if (isset($input['server_tls'])) { $out .= $input['server_tls']; } if (isset($input['server_rsh'])) { $out .= $input['server_rsh']; } if (isset($input['server_secure'])) { $out .= $input['server_secure']; } if (isset($input['server_debug'])) { $out .= $input['server_debug']; } $out .= "}"; if (isset($input['server_mailbox'])) { $out .= $input['server_mailbox']; } return $out; } static function getDaysOfWeekArray() { $tab[0] = __("Sunday"); $tab[1] = __("Monday"); $tab[2] = __("Tuesday"); $tab[3] = __("Wednesday"); $tab[4] = __("Thursday"); $tab[5] = __("Friday"); $tab[6] = __("Saturday"); return $tab; } static function getMonthsOfYearArray() { $tab[1] = __("January"); $tab[2] = __("February"); $tab[3] = __("March"); $tab[4] = __("April"); $tab[5] = __("May"); $tab[6] = __("June"); $tab[7] = __("July"); $tab[8] = __("August"); $tab[9] = __("September"); $tab[10] = __("October"); $tab[11] = __("November"); $tab[12] = __("December"); return $tab; } /** * Do a in_array search comparing string using strcasecmp * * @since version 0.84 * * @param $string string to search * @param $datas array to search to search * * @return boolean : string founded ? **/ static function inArrayCaseCompare($string, $datas=array()) { if (count($datas)) { foreach ($datas as $tocheck) { if (strcasecmp($string, $tocheck) == 0) { return true; } } } return false; } /** * Clean integer value (strip all chars not - and spaces ) * * @since versin 0.83.5 * * @param $integer string integer string * * @return clean integer **/ static function cleanInteger($integer) { return preg_replace("/[^0-9-]/", "", $integer); } /** * Clean decimal value (strip all chars not - and spaces ) * * @since versin 0.83.5 * * @param $decimal string float string * * @return clean integer **/ static function cleanDecimal($decimal) { return preg_replace("/[^0-9\.-]/", "", $decimal); } /** * Save a configuration file * * @since version 0.84 * * @param $name string config file name * @param $content string config file content * * @return boolean **/ function writeConfig($name, $content) { $name = GLPI_CONFIG_DIR . '/'.$name; $fp = fopen($name, 'wt'); if ($fp) { $fw = fwrite($fp, $content); fclose($fp); if (function_exists('opcache_invalidate')) { /* Invalidate Zend OPcache to ensure saved version used */ opcache_invalidate($name, true); } return ($fw>0); } return false; } /** * Prepare array passed on an input form * * @param $value array: passed array * @since version 0.83.91 * @return string encoded array **/ static function prepareArrayForInput($value) { return base64_encode(json_encode($value)); } /** * Decode array passed on an input form * * @param $value string: encoded value * @since version 0.83.91 * @return string decoded array **/ static function decodeArrayFromInput($value) { if ($dec = base64_decode($value)) { if ($ret = json_decode($dec,true)) { return $ret; } } return array(); } /** * Check valid referer accessing GLPI * * @since version 0.84.2 * * @return nothing : display error if not permit **/ static function checkValidReferer() { global $CFG_GLPI; if (!isset($_SERVER['HTTP_REFERER']) || !is_array($url = parse_url($_SERVER['HTTP_REFERER'])) || !isset($url['host']) || (($url['host'] != $_SERVER['SERVER_NAME']) && (!isset($_SERVER['HTTP_X_FORWARDED_SERVER']) || ($url['host'] != $_SERVER['HTTP_X_FORWARDED_SERVER']))) || !isset($url['path']) || (!empty($CFG_GLPI['root_doc']) && strpos($url['path'], $CFG_GLPI['root_doc']) !== 0)) { Html::displayErrorAndDie(__("The action you have requested is not allowed. Reload previous page before doing action again."), true); } } } ?> glpi-0.84.3+dfsg.1/inc/transfer.class.php000066400000000000000000003737541226600447100200560ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class Transfer extends CommonDBTM { // Specific ones /// Already transfer item var $already_transfer = array(); /// Items simulate to move - non recursive item or recursive item not visible in destination entity var $needtobe_transfer = array(); /// Items simulate to move - recursive item visible in destination entity var $noneedtobe_transfer = array(); /// Search in need to be transfer items var $item_search = array(); /// Search in need to be exclude from transfer var $item_recurs = array(); /// Options used to transfer var $options = array(); /// Destination entity id var $to = -1; /// type of initial item transfered var $inittype = 0; /// item types which have infocoms var $DEVICES_TYPES = array('DeviceCase', 'DeviceControl', 'DeviceDrive', 'DeviceGraphicCard', 'DeviceHardDrive', 'DeviceMemory', 'DeviceMotherboard', 'DeviceNetworkCard', 'DevicePci', 'DevicePowerSupply', 'DeviceProcessor', 'DeviceSoundCard'); static function canCreate() { return Session::haveRight('transfer', 'w'); } static function canView() { return Session::haveRight('transfer', 'r'); } function getSearchOptions() { $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[19]['table'] = $this->getTable(); $tab[19]['field'] = 'date_mod'; $tab[19]['name'] = __('Last update'); $tab[19]['datatype'] = 'datetime'; $tab[19]['massiveaction'] = false; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; return $tab; } /** * Transfer items * *@param $items items to transfer *@param $to entity destination ID *@param $options options used to transfer **/ function moveItems($items, $to, $options) { global $CFG_GLPI; // unset mailing $CFG_GLPI["use_mailing"] = 0; $this->options = array('keep_ticket' => 0, 'keep_networklink' => 0, 'keep_reservation' => 0, 'keep_history' => 0, 'keep_device' => 0, 'keep_infocom' => 0, 'keep_dc_monitor' => 0, 'clean_dc_monitor' => 0, 'keep_dc_phone' => 0, 'clean_dc_phone' => 0, 'keep_dc_peripheral' => 0, 'clean_dc_peripheral' => 0, 'keep_dc_printer' => 0, 'clean_dc_printer' => 0, 'keep_supplier' => 0, 'clean_supplier' => 0, 'keep_contact' => 0, 'clean_contact' => 0, 'keep_contract' => 0, 'clean_contract' => 0, 'keep_disk' => 0, 'keep_software' => 0, 'clean_software' => 0, 'keep_document' => 0, 'clean_document' => 0, 'keep_cartridgeitem' => 0, 'clean_cartridgeitem' => 0, 'keep_cartridge' => 0, 'keep_consumable' => 0); if ($to >= 0) { // Store to $this->to = $to; // Store options if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $this->options[$key] = $val; } } // Simulate transfers To know which items need to be transfer $this->simulateTransfer($items); //Html::printCleanArray($this->needtobe_transfer); // Software first (to avoid copy during computer transfer) $this->inittype = 'Software'; if (isset($items['Software']) && count($items['Software'])) { foreach ($items['Software'] as $ID) { $this->transferItem('Software', $ID, $ID); } } // Computer before all other items $this->inittype = 'Computer'; if (isset($items['Computer']) && count($items['Computer'])) { foreach ($items['Computer'] as $ID) { $this->transferItem('Computer', $ID, $ID); } } // Inventory Items : MONITOR.... $INVENTORY_TYPES = array('CartridgeItem', 'ConsumableItem', 'Monitor', 'NetworkEquipment', 'Peripheral', 'Phone', 'Printer', 'SoftwareLicense', ); foreach ($INVENTORY_TYPES as $itemtype) { $this->inittype = $itemtype; if (isset($items[$itemtype]) && count($items[$itemtype])) { foreach ($items[$itemtype] as $ID) { $this->transferItem($itemtype, $ID, $ID); } } } // Clean unused $this->cleanSoftwareVersions(); // Management Items $MANAGEMENT_TYPES = array('Contact', 'Contract', 'Document', 'Supplier'); foreach ($MANAGEMENT_TYPES as $itemtype) { $this->inittype = $itemtype; if (isset($items[$itemtype]) && count($items[$itemtype])) { foreach ($items[$itemtype] as $ID) { $this->transferItem($itemtype, $ID, $ID); } } } // Tickets $OTHER_TYPES = array('Group', 'Link', 'Ticket', 'Problem'); foreach ($OTHER_TYPES as $itemtype) { $this->inittype = $itemtype; if (isset($items[$itemtype]) && count($items[$itemtype])) { foreach ($items[$itemtype] as $ID) { $this->transferItem($itemtype, $ID, $ID); } } } } // $to >= 0 } /** * Add an item in the needtobe_transfer list * * @param $itemtype of the item * @param $ID of the item **/ function addToBeTransfer($itemtype, $ID) { if (!isset($this->needtobe_transfer[$itemtype])) { $this->needtobe_transfer[$itemtype] = array(); } // Can't be in both list (in fact, always false) if (isset($this->noneedtobe_transfer[$itemtype][$ID])) { unset($this->noneedtobe_transfer[$itemtype][$ID]); } $this->needtobe_transfer[$itemtype][$ID] = $ID; } /** * Add an item in the noneedtobe_transfer list * * @param $itemtype of the item * @param $ID of the item **/ function addNotToBeTransfer($itemtype, $ID) { if (!isset($this->noneedtobe_transfer[$itemtype])) { $this->noneedtobe_transfer[$itemtype] = array(); } // Can't be in both list (in fact, always true) if (!isset($this->needtobe_transfer[$itemtype][$ID])) { $this->noneedtobe_transfer[$itemtype][$ID] = $ID; } } /** * simulate the transfer to know which items need to be transfer * * @param $items Array of the items to transfer **/ function simulateTransfer($items) { global $DB, $CFG_GLPI; // Init types : $types = array('CartridgeItem', 'Computer', 'ConsumableItem', 'Contact', 'Contract', 'Document', 'Link', 'Monitor', 'NetworkEquipment', 'Peripheral', 'Phone', 'Printer', 'Problem', 'Software', 'SoftwareLicense', 'SoftwareVersion', 'Supplier', 'Ticket'); foreach ($types as $t) { if (!isset($this->needtobe_transfer[$t])) { $this->needtobe_transfer[$t] = array(); } if (!isset($this->noneedtobe_transfer[$t])) { $this->noneedtobe_transfer[$t] = array(); } $this->item_search[$t] = $this->createSearchConditionUsingArray($this->needtobe_transfer[$t]); $this->item_recurs[$t] = $this->createSearchConditionUsingArray($this->noneedtobe_transfer[$t]); } $to_entity_ancestors = getAncestorsOf("glpi_entities", $this->to); // Copy items to needtobe_transfer foreach ($items as $key => $tab) { if (count($tab)) { foreach ($tab as $ID) { $this->addToBeTransfer($key,$ID); } } } // Computer first $this->item_search['Computer'] = $this->createSearchConditionUsingArray($this->needtobe_transfer['Computer']); // DIRECT CONNECTIONS $DC_CONNECT = array(); if ($this->options['keep_dc_monitor']) { $DC_CONNECT[] = 'Monitor'; } if ($this->options['keep_dc_phone']) { $DC_CONNECT[] = 'Phone'; } if ($this->options['keep_dc_peripheral']) { $DC_CONNECT[] = 'Peripheral'; } if ($this->options['keep_dc_printer']) { $DC_CONNECT[] = 'Printer'; } if (count($DC_CONNECT) && (count($this->needtobe_transfer['Computer']) > 0)) { foreach ($DC_CONNECT as $itemtype) { $itemtable = getTableForItemType($itemtype); // Clean DB / Search unexisting links and force disconnect $query = "SELECT `glpi_computers_items`.`id` FROM `glpi_computers_items` LEFT JOIN `$itemtable` ON (`glpi_computers_items`.`items_id` = `$itemtable`.`id` ) WHERE `glpi_computers_items`.`itemtype` = '$itemtype' AND `$itemtable`.`id` IS NULL"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { $conn = new Computer_Item(); $conn->delete(array('id' => $data['id'], '_no_history' => true, '_no_auto_action'=> true)); } } } if (!($item = getItemForItemtype($itemtype))) { continue; } $query = "SELECT DISTINCT `items_id` FROM `glpi_computers_items` WHERE `itemtype` = '$itemtype' AND `computers_id` IN ".$this->item_search['Computer']; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { if ($item->getFromDB($data['items_id']) && $item->isRecursive() && in_array($item->getEntityID(), $to_entity_ancestors)) { $this->addNotToBeTransfer($itemtype, $data['items_id']); } else { $this->addToBeTransfer($itemtype, $data['items_id']); } } } } $this->item_search[$itemtype] = $this->createSearchConditionUsingArray($this->needtobe_transfer[$itemtype]); if ($item->maybeRecursive()) { $this->item_recurs[$itemtype] = $this->createSearchConditionUsingArray($this->noneedtobe_transfer[$itemtype]); } } } // End of direct connections // License / Software : keep / delete + clean unused / keep unused if ($this->options['keep_software']) { // Clean DB $query = "SELECT `glpi_computers_softwareversions`.`id` FROM `glpi_computers_softwareversions` LEFT JOIN `glpi_computers` ON (`glpi_computers_softwareversions`.`computers_id` = `glpi_computers`.`id`) WHERE `glpi_computers`.`id` IS NULL"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { $query = "DELETE FROM `glpi_computers_softwareversions` WHERE `id` = '".$data['id']."'"; $DB->query($query); } } } // Clean DB $query = "SELECT `glpi_computers_softwareversions`.`id` FROM `glpi_computers_softwareversions` LEFT JOIN `glpi_softwareversions` ON (`glpi_computers_softwareversions`.`softwareversions_id` = `glpi_softwareversions`.`id`) WHERE `glpi_softwareversions`.`id` IS NULL"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { $query = "DELETE FROM `glpi_computers_softwareversions` WHERE `id` = '".$data['id']."'"; $DB->query($query); } } } // Clean DB $query = "SELECT `glpi_softwareversions`.`id` FROM `glpi_softwareversions` LEFT JOIN `glpi_softwares` ON (`glpi_softwares`.`id` = `glpi_softwareversions`.`softwares_id`) WHERE `glpi_softwares`.`id` IS NULL"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { $query = "DELETE FROM `glpi_softwareversions` WHERE `id` = '".$data['id']."'"; $DB->query($query); } } } $query = "SELECT `glpi_softwares`.`id`, `glpi_softwares`.`entities_id`, `glpi_softwares`.`is_recursive`, `glpi_softwareversions`.`id` AS vID FROM `glpi_computers_softwareversions` INNER JOIN `glpi_softwareversions` ON (`glpi_computers_softwareversions`.`softwareversions_id` = `glpi_softwareversions`.`id`) INNER JOIN `glpi_softwares` ON (`glpi_softwares`.`id` = `glpi_softwareversions`.`softwares_id`) WHERE `glpi_computers_softwareversions`.`computers_id` IN ".$this->item_search['Computer']; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { if ($data['is_recursive'] && in_array($data['entities_id'], $to_entity_ancestors)) { $this->addNotToBeTransfer('SoftwareVersion', $data['vID']); } else { $this->addToBeTransfer('SoftwareVersion', $data['vID']); } } } } } // Software: From user choice only $this->item_search['Software'] = $this->createSearchConditionUsingArray($this->needtobe_transfer['Software']); $this->item_recurs['Software'] = $this->createSearchConditionUsingArray($this->noneedtobe_transfer['Software']); // Move license of software // TODO : should we transfer "affected license" ? $query = "SELECT `id`, `softwareversions_id_buy`, `softwareversions_id_use` FROM `glpi_softwarelicenses` WHERE `softwares_id` IN ".$this->item_search['Software']; foreach ($DB->request($query) AS $lic) { $this->addToBeTransfer('SoftwareLicense', $lic['id']); // Force version transfer (remove from item_recurs) if ($lic['softwareversions_id_buy'] > 0) { $this->addToBeTransfer('SoftwareVersion', $lic['softwareversions_id_buy']); } if ($lic['softwareversions_id_use'] > 0) { $this->addToBeTransfer('SoftwareVersion', $lic['softwareversions_id_use']); } } // Licenses: from softwares and computers (affected) $this->item_search['SoftwareLicense'] = $this->createSearchConditionUsingArray($this->needtobe_transfer['SoftwareLicense']); $this->item_recurs['SoftwareLicense'] = $this->createSearchConditionUsingArray($this->noneedtobe_transfer['SoftwareLicense']); // Versions: from affected licenses and installed versions $this->item_search['SoftwareVersion'] = $this->createSearchConditionUsingArray($this->needtobe_transfer['SoftwareVersion']); $this->item_recurs['SoftwareVersion'] = $this->createSearchConditionUsingArray($this->noneedtobe_transfer['SoftwareVersion']); $this->item_search['NetworkEquipment'] = $this->createSearchConditionUsingArray($this->needtobe_transfer['NetworkEquipment']); // Tickets if ($this->options['keep_ticket']) { foreach ($CFG_GLPI["ticket_types"] as $itemtype) { if (isset($this->item_search[$itemtype])) { $query = "SELECT DISTINCT `id` FROM `glpi_tickets` WHERE `itemtype` = '$itemtype' AND `items_id` IN ".$this->item_search[$itemtype]; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { $this->addToBeTransfer('Ticket', $data['id']); } } } } } } $this->item_search['Ticket'] = $this->createSearchConditionUsingArray($this->needtobe_transfer['Ticket']); // Contract : keep / delete + clean unused / keep unused if ($this->options['keep_contract']) { foreach ($CFG_GLPI["contract_types"] as $itemtype) { if (isset($this->item_search[$itemtype])) { $itemtable = getTableForItemType($itemtype); // Clean DB $query = "SELECT `glpi_contracts_items`.`id` FROM `glpi_contracts_items` LEFT JOIN `$itemtable` ON (`glpi_contracts_items`.`items_id` = `$itemtable`.`id`) WHERE `glpi_contracts_items`.`itemtype` = '$itemtype' AND `$itemtable`.`id` IS NULL"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { $query = "DELETE FROM `glpi_contracts_items` WHERE `id` = '".$data['id']."'"; $DB->query($query); } } } // Clean DB $query = "SELECT `glpi_contracts_items`.`id` FROM `glpi_contracts_items` LEFT JOIN `glpi_contracts` ON (`glpi_contracts_items`.`contracts_id` = `glpi_contracts`.`id`) WHERE `glpi_contracts`.`id` IS NULL"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { $query = "DELETE FROM `glpi_contracts_items` WHERE `id` = '".$data['id']."'"; $DB->query($query); } } } $query = "SELECT `contracts_id`, `glpi_contracts`.`entities_id`, `glpi_contracts`.`is_recursive` FROM `glpi_contracts_items` LEFT JOIN `glpi_contracts` ON (`glpi_contracts_items`.`contracts_id` = `glpi_contracts`.`id`) WHERE `glpi_contracts_items`.`itemtype` = '$itemtype' AND `glpi_contracts_items`.`items_id` IN ".$this->item_search[$itemtype]; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { if ($data['is_recursive'] && in_array($data['entities_id'], $to_entity_ancestors)) { $this->addNotToBeTransfer('Contract', $data['contracts_id']); } else { $this->addToBeTransfer('Contract', $data['contracts_id']); } } } } } } } $this->item_search['Contract'] = $this->createSearchConditionUsingArray($this->needtobe_transfer['Contract']); $this->item_recurs['Contract'] = $this->createSearchConditionUsingArray($this->noneedtobe_transfer['Contract']); // Supplier (depending of item link) / Contract - infocoms : keep / delete + clean unused / keep unused if ($this->options['keep_supplier']) { // Clean DB $query = "SELECT `glpi_contracts_suppliers`.`id` FROM `glpi_contracts_suppliers` LEFT JOIN `glpi_contracts` ON (`glpi_contracts_suppliers`.`contracts_id` = `glpi_contracts`.`id`) WHERE `glpi_contracts`.`id` IS NULL"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { $query = "DELETE FROM `glpi_contracts_suppliers` WHERE `id` = '".$data['id']."'"; $DB->query($query); } } } // Clean DB $query = "SELECT `glpi_contracts_suppliers`.`id` FROM `glpi_contracts_suppliers` LEFT JOIN `glpi_suppliers` ON (`glpi_contracts_suppliers`.`suppliers_id` = `glpi_suppliers`.`id`) WHERE `glpi_suppliers`.`id` IS NULL"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { $query = "DELETE FROM `glpi_contracts_suppliers` WHERE `id` = '".$data['id']."'"; $DB->query($query); } } } // Supplier Contract $query = "SELECT DISTINCT `suppliers_id`, `glpi_suppliers`.`is_recursive`, `glpi_suppliers`.`entities_id` FROM `glpi_contracts_suppliers` LEFT JOIN `glpi_suppliers` ON (`glpi_suppliers`.`id` = `glpi_contracts_suppliers`.`suppliers_id`) WHERE `contracts_id` IN ".$this->item_search['Contract']; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { if ($data['is_recursive'] && in_array($data['entities_id'], $to_entity_ancestors)) { $this->addNotToBeTransfer('Supplier', $data['suppliers_id']); } else { $this->addToBeTransfer('Supplier', $data['suppliers_id']); } } } } // Ticket Supplier $query = "SELECT DISTINCT `glpi_suppliers_tickets`.`suppliers_id`, `glpi_suppliers`.`is_recursive`, `glpi_suppliers`.`entities_id` FROM `glpi_tickets` LEFT JOIN `glpi_suppliers_tickets` ON (`glpi_suppliers_tickets`.`tickets_id` = `glpi_tickets`.`id`) LEFT JOIN `glpi_suppliers` ON (`glpi_suppliers`.`id` = `glpi_suppliers_tickets`.`suppliers_id`) WHERE `glpi_suppliers_tickets`.`suppliers_id` > '0' AND `glpi_tickets`.`id` IN ".$this->item_search['Ticket']; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { if ($data['is_recursive'] && in_array($data['entities_id'], $to_entity_ancestors)) { $this->addNotToBeTransfer('Supplier', $data['suppliers_id']); } else { $this->addToBeTransfer('Supplier', $data['suppliers_id']); } } } } // Problem Supplier $query = "SELECT DISTINCT `glpi_problems_suppliers`.`suppliers_id`, `glpi_suppliers`.`is_recursive`, `glpi_suppliers`.`entities_id` FROM `glpi_problems` LEFT JOIN `glpi_problems_suppliers` ON (`glpi_problems_suppliers`.`problems_id` = `glpi_problems`.`id`) LEFT JOIN `glpi_suppliers` ON (`glpi_suppliers`.`id` = `glpi_problems_suppliers`.`suppliers_id`) WHERE `glpi_problems_suppliers`.`suppliers_id` > '0' AND `glpi_problems`.`id` IN ".$this->item_search['Problem']; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { if ($data['is_recursive'] && in_array($data['entities_id'], $to_entity_ancestors)) { $this->addNotToBeTransfer('Supplier', $data['suppliers_id']); } else { $this->addToBeTransfer('Supplier', $data['suppliers_id']); } } } } // Supplier infocoms if ($this->options['keep_infocom']) { foreach ($CFG_GLPI["infocom_types"] as $itemtype) { if (isset($this->item_search[$itemtype])) { $itemtable = getTableForItemType($itemtype); // Clean DB $query = "SELECT `glpi_infocoms`.`id` FROM `glpi_infocoms` LEFT JOIN `$itemtable` ON (`glpi_infocoms`.`items_id` = `$itemtable`.`id`) WHERE `glpi_infocoms`.`itemtype` = '$itemtype' AND `$itemtable`.`id` IS NULL"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { $query = "DELETE FROM `glpi_infocoms` WHERE `id` = '".$data['id']."'"; $DB->query($query); } } } $query = "SELECT DISTINCT `suppliers_id`, `glpi_suppliers`.`is_recursive`, `glpi_suppliers`.`entities_id` FROM `glpi_infocoms` LEFT JOIN `glpi_suppliers` ON (`glpi_suppliers`.`id` = `glpi_infocoms`.`suppliers_id`) WHERE `suppliers_id` > '0' AND `itemtype` = '$itemtype' AND `items_id` IN ".$this->item_search[$itemtype]; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { if ($data['is_recursive'] && in_array($data['entities_id'], $to_entity_ancestors)) { $this->addNotToBeTransfer('Supplier', $data['suppliers_id']); } else { $this->addToBeTransfer('Supplier', $data['suppliers_id']); } } } } } } } } $this->item_search['Supplier'] = $this->createSearchConditionUsingArray($this->needtobe_transfer['Supplier']); $this->item_recurs['Supplier'] = $this->createSearchConditionUsingArray($this->noneedtobe_transfer['Supplier']); // Contact / Supplier : keep / delete + clean unused / keep unused if ($this->options['keep_contact']) { // Clean DB $query = "SELECT `glpi_contacts_suppliers`.`id` FROM `glpi_contacts_suppliers` LEFT JOIN `glpi_contacts` ON (`glpi_contacts_suppliers`.`contacts_id` = `glpi_contacts`.`id`) WHERE `glpi_contacts`.`id` IS NULL"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { $query = "DELETE FROM `glpi_contacts_suppliers` WHERE `id` = '".$data['id']."'"; $DB->query($query); } } } // Clean DB $query = "SELECT `glpi_contacts_suppliers`.`id` FROM `glpi_contacts_suppliers` LEFT JOIN `glpi_suppliers` ON (`glpi_contacts_suppliers`.`suppliers_id` = `glpi_suppliers`.`id`) WHERE `glpi_suppliers`.`id` IS NULL"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { $query = "DELETE FROM `glpi_contacts_suppliers` WHERE `id` = '".$data['id']."'"; $DB->query($query); } } } // Supplier Contact $query = "SELECT DISTINCT `contacts_id`, `glpi_contacts`.`is_recursive`, `glpi_contacts`.`entities_id` FROM `glpi_contacts_suppliers` LEFT JOIN `glpi_contacts` ON (`glpi_contacts`.`id` = `glpi_contacts_suppliers`.`contacts_id`) WHERE `suppliers_id` IN ".$this->item_search['Supplier']; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { if ($data['is_recursive'] && in_array($data['entities_id'], $to_entity_ancestors)) { $this->addNotToBeTransfer('Contact', $data['contacts_id']); } else { $this->addToBeTransfer('Contact', $data['contacts_id']); } } } } } $this->item_search['Contact'] = $this->createSearchConditionUsingArray($this->needtobe_transfer['Contact']); $this->item_recurs['Contact'] = $this->createSearchConditionUsingArray($this->noneedtobe_transfer['Contact']); // Document : keep / delete + clean unused / keep unused if ($this->options['keep_document']) { foreach ($CFG_GLPI["document_types"] as $itemtype) { if (isset($this->item_search[$itemtype])) { $itemtable = getTableForItemType($itemtype); // Clean DB $query = "SELECT `glpi_documents_items`.`id` FROM `glpi_documents_items` LEFT JOIN `$itemtable` ON (`glpi_documents_items`.`items_id` = `$itemtable`.`id`) WHERE `glpi_documents_items`.`itemtype` = '$itemtype' AND `$itemtable`.`id` IS NULL"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { $query = "DELETE FROM `glpi_documents_items` WHERE `id` = '".$data['id']."'"; $DB->query($query); } } } $query = "SELECT `documents_id`, `glpi_documents`.`is_recursive`, `glpi_documents`.`entities_id` FROM `glpi_documents_items` LEFT JOIN `glpi_documents` ON (`glpi_documents`.`id` = `glpi_documents_items`.`documents_id`) WHERE `itemtype` = '$itemtype' AND `items_id` IN ".$this->item_search[$itemtype]; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { if ($data['is_recursive'] && in_array($data['entities_id'], $to_entity_ancestors)) { $this->addNotToBeTransfer('Document', $data['documents_id']); } else { $this->addToBeTransfer('Document', $data['documents_id']); } } } } } } } $this->item_search['Document'] = $this->createSearchConditionUsingArray($this->needtobe_transfer['Document']); $this->item_recurs['Document'] = $this->createSearchConditionUsingArray($this->noneedtobe_transfer['Document']); // printer -> cartridges : keep / delete + clean if ($this->options['keep_cartridgeitem']) { if (isset($this->item_search['Printer'])) { $query = "SELECT `cartridgeitems_id` FROM `glpi_cartridges` WHERE `printers_id` IN ".$this->item_search['Printer']; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { $this->addToBeTransfer('CartridgeItem',$data['cartridgeitems_id']); } } } } } $this->item_search['CartridgeItem'] = $this->createSearchConditionUsingArray($this->needtobe_transfer['CartridgeItem']); // Init all item_search if not defined foreach ($types as $itemtype) { if (!isset($this->item_search[$itemtype])) { $this->item_search[$itemtype] = "(-1)"; } } } /** * Create IN condition for SQL requests based on a array if ID * * @param $array array of ID * * @return string of the IN condition **/ function createSearchConditionUsingArray($array) { if (is_array($array) && count($array)) { return "('".implode("','",$array)."')"; } return "(-1)"; } /** * transfer an item to another item (may be the same) in the new entity * * @param $itemtype item type to transfer * @param $ID ID of the item to transfer * @param $newID new ID of the ite * * Transfer item to a new Item if $ID==$newID : only update entities_id field : * $ID!=$new ID -> copy datas (like template system) * @return nothing (diplays) **/ function transferItem($itemtype, $ID, $newID) { global $CFG_GLPI, $DB; if (!($item = getItemForItemtype($itemtype))) { return; } // Is already transfer ? if (!isset($this->already_transfer[$itemtype][$ID])) { // Check computer exists ? if ($item->getFromDB($newID)) { // Network connection ? keep connected / keep_disconnected / delete if (in_array($itemtype, array('Computer', 'Monitor', 'NetworkEquipment', 'Peripheral', 'Phone', 'Printer'))) { $this->transferNetworkLink($itemtype, $ID, $newID); } // Device : keep / delete : network case : delete if net connection delete in import case if (in_array($itemtype, array('Computer'))) { $this->transferDevices($itemtype, $ID); } // Reservation : keep / delete if (in_array($itemtype, $CFG_GLPI["reservation_types"])) { $this->transferReservations($itemtype, $ID, $newID); } // History : keep / delete $this->transferHistory($itemtype, $ID, $newID); // Ticket : delete / keep and clean ref / keep and move $this->transferTickets($itemtype, $ID, $newID); // Infocoms : keep / delete if (in_array($itemtype, $CFG_GLPI["infocom_types"])) { $this->transferInfocoms($itemtype, $ID, $newID); } if ($itemtype == 'Software') { $this->transferSoftwareLicensesAndVersions($ID); } if ($itemtype == 'Computer') { // Monitor Direct Connect : keep / delete + clean unused / keep unused $this->transferDirectConnection($itemtype, $ID, 'Monitor'); // Peripheral Direct Connect : keep / delete + clean unused / keep unused $this->transferDirectConnection($itemtype, $ID, 'Peripheral'); // Phone Direct Connect : keep / delete + clean unused / keep unused $this->transferDirectConnection($itemtype, $ID, 'Phone'); // Printer Direct Connect : keep / delete + clean unused / keep unused $this->transferDirectConnection($itemtype, $ID, 'Printer'); // License / Software : keep / delete + clean unused / keep unused $this->transferComputerSoftwares($ID); // Computer Disks : delete them or not ? $this->transferComputerDisks($ID); } // Computer Direct Connect : delete link if it is the initial transfer item (no recursion) if (($this->inittype == $itemtype) && in_array($itemtype, array('Monitor', 'Phone', 'Peripheral', 'Printer'))) { $this->deleteDirectConnection($itemtype, $ID); } // Contract : keep / delete + clean unused / keep unused if (in_array($itemtype,$CFG_GLPI["contract_types"])) { $this->transferContracts($itemtype, $ID, $newID); } // Contact / Supplier : keep / delete + clean unused / keep unused if ($itemtype == 'Supplier') { $this->transferSupplierContacts($ID, $newID); } // Document : keep / delete + clean unused / keep unused if (in_array($itemtype, $CFG_GLPI["document_types"])) { $this->transferDocuments($itemtype, $ID, $newID); } // Transfer compatible printers if ($itemtype == 'CartridgeItem') { $this->transferCompatiblePrinters($ID, $newID); } // Cartridges and cartridges items linked to printer if ($itemtype == 'Printer') { $this->transferPrinterCartridges($ID, $newID); } // Transfer Item $input = array('id' => $newID, 'entities_id' => $this->to); // Manage Location dropdown if (isset($item->fields['locations_id'])) { $input['locations_id'] = $this->transferDropdownLocation($item->fields['locations_id']); } if ($itemtype == 'Ticket') { $input2 = $this->transferTicketAdditionalInformations($item->fields); $input = array_merge($input, $input2); $this->transferTaskCategory($itemtype, $ID, $newID); $this->transferLinkedSuppliers($itemtype, $ID, $newID); } if ($itemtype == 'Problem') { $input2 = $this->transferTicketAdditionalInformations($item->fields); $input = array_merge($input, $input2); $this->transferTaskCategory($itemtype, $ID, $newID); $this->transferLinkedSuppliers($itemtype, $ID, $newID); } $item->update($input); $this->addToAlreadyTransfer($itemtype,$ID,$newID); Plugin::doHook("item_transfer", array('type' => $itemtype, 'id' => $ID, 'newID' => $newID, 'entities_id' => $this->to)); } } } /** * Add an item to already transfer array * * @param $itemtype item type * @param $ID item original ID * @param $newID item new ID **/ function addToAlreadyTransfer($itemtype,$ID,$newID) { if (!isset($this->already_transfer[$itemtype])) { $this->already_transfer[$itemtype] = array(); } $this->already_transfer[$itemtype][$ID]=$newID; } /** * Transfer location * * @param $locID location ID * * @return new location ID **/ function transferDropdownLocation($locID) { global $DB; if ($locID > 0) { if (isset($this->already_transfer['locations_id'][$locID])) { return $this->already_transfer['locations_id'][$locID]; } // else // Not already transfer // Search init item $location = new Location(); if ($location->getFromDB($locID)) { $data = Toolbox::addslashes_deep($location->fields); $input['entities_id'] = $this->to; $input['completename'] = $data['completename']; $newID = $location->findID($input); if ($newID < 0) { $newID = $location->import($input); } $this->addToAlreadyTransfer('locations_id', $locID, $newID); return $newID; } } return 0; } /** * Transfer netpoint * * @param $netpoints_id netpoint ID * * @return new netpoint ID **/ function transferDropdownNetpoint($netpoints_id) { global $DB; if ($netpoints_id > 0) { if (isset($this->already_transfer['netpoints_id'][$netpoints_id])) { return $this->already_transfer['netpoints_id'][$netpoints_id]; } // else // Not already transfer // Search init item $netpoint = new Netpoint(); if ($netpoint->getFromDB($netpoints_id)) { $data = Toolbox::addslashes_deep($netpoint->fields); $locID = $this->transferDropdownLocation($netpoint->fields['locations_id']); // Search if the locations_id already exists in the destination entity $query = "SELECT `id` FROM `glpi_netpoints` WHERE `entities_id` = '".$this->to."' AND `name` = '".$netpoint->fields['name']."' AND `locations_id` = '$locID'"; if ($result_search = $DB->query($query)) { // Found : -> use it if ($DB->numrows($result_search) > 0) { $newID = $DB->result($result_search,0,'id'); $this->addToAlreadyTransfer('netpoints_id', $netpoints_id, $newID); return $newID; } } // Not found : // add item $newID = $netpoint->add(array('name' => $data['name'], 'comment' => $data['comment'], 'entities_id' => $this->to, 'locations_id' => $locID)); $this->addToAlreadyTransfer('netpoints_id', $netpoints_id, $newID); return $newID; } } return 0; } /** * Transfer cartridges of a printer * * @param $ID original ID of the printer * @param $newID new ID of the printer **/ function transferPrinterCartridges($ID, $newID) { global $DB; // Get cartrdiges linked $query = "SELECT * FROM `glpi_cartridges` WHERE `glpi_cartridges`.`printers_id` = '$ID'"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { $cart = new Cartridge(); $carttype = new CartridgeItem(); while ($data = $DB->fetch_assoc($result)) { $need_clean_process = false; // Foreach cartridges // if keep if ($this->options['keep_cartridgeitem']) { $newcartID =- 1; $newcarttypeID = -1; // 1 - Search carttype destination ? // Already transfer carttype : if (isset($this->already_transfer['CartridgeItem'][$data['cartridgeitems_id']])) { $newcarttypeID = $this->already_transfer['CartridgeItem'][$data['cartridgeitems_id']]; } else { // Not already transfer cartype $query = "SELECT COUNT(*) AS cpt FROM `glpi_cartridges` WHERE `glpi_cartridges`.`cartridgeitems_id` = '".$data['cartridgeitems_id']."' AND `glpi_cartridges`.`printers_id` > '0' AND `glpi_cartridges`.`printers_id` NOT IN ".$this->item_search['Printer']; $result_search = $DB->query($query); // Is the carttype will be completly transfer ? if ($DB->result($result_search, 0, 'cpt') == 0) { // Yes : transfer $need_clean_process = false; $this->transferItem('CartridgeItem', $data['cartridgeitems_id'], $data['cartridgeitems_id']); $newcarttypeID = $data['cartridgeitems_id']; } else { // No : copy carttype $need_clean_process = true; $carttype->getFromDB($data['cartridgeitems_id']); // Is existing carttype in the destination entity ? $query = "SELECT * FROM `glpi_cartridgeitems` WHERE `entities_id` = '".$this->to."' AND `name` = '".addslashes($carttype->fields['name'])."'"; if ($result_search = $DB->query($query)) { if ($DB->numrows($result_search) > 0) { $newcarttypeID = $DB->result($result_search,0,'id'); } } // Not found -> transfer copy if ($newcarttypeID < 0) { // 1 - create new item unset($carttype->fields['id']); $input = $carttype->fields; $input['entities_id'] = $this->to; unset($carttype->fields); $newcarttypeID = $carttype->add(toolbox::addslashes_deep($input)); // 2 - transfer as copy $this->transferItem('CartridgeItem', $data['cartridgeitems_id'], $newcarttypeID); } // Founded -> use to link : nothing to do } } // Update cartridge if needed if (($newcarttypeID > 0) && ($newcarttypeID != $data['cartridgeitems_id'])) { $cart->update(array('id' => $data['id'], 'cartridgeitems_id' => $newcarttypeID)); } } else { // Do not keep // If same printer : delete cartridges if ($ID == $newID) { $del_query = "DELETE FROM `glpi_cartridges` WHERE `printers_id` = '$ID'"; $DB->query($del_query); } $need_clean_process = true; } // CLean process if ($need_clean_process && $this->options['clean_cartridgeitem']) { // Clean carttype $query2 = "SELECT COUNT(*) AS cpt FROM `glpi_cartridges` WHERE `cartridgeitems_id` = '" . $data['cartridgeitems_id'] . "'"; $result2 = $DB->query($query2); if ($DB->result($result2, 0, 'cpt') == 0) { if ($this->options['clean_cartridgeitem'] == 1) { // delete $carttype->delete(array('id' => $data['cartridgeitems_id'])); } if ($this->options['clean_cartridgeitem'] == 2) { // purge $carttype->delete(array('id' => $data['cartridgeitems_id']),1); } } } } } } } /** * Copy (if needed) One software to the destination entity * * @param $ID of the software * * @return $ID of the new software (could be the same) **/ function copySingleSoftware($ID) { global $DB; if (isset($this->already_transfer['Software'][$ID])) { return $this->already_transfer['Software'][$ID]; } $soft = new Software(); if ($soft->getFromDB($ID)) { if ($soft->fields['is_recursive'] && in_array($soft->fields['entities_id'], getAncestorsOf("glpi_entities", $this->to))) { // no need to copy $newsoftID = $ID; } else { $query = "SELECT * FROM `glpi_softwares` WHERE `entities_id` = ".$this->to." AND `name` = '".addslashes($soft->fields['name'])."'"; if ($data = $DB->request($query)->next()) { $newsoftID = $data["id"]; } else { // create new item (don't check if move possible => clean needed) unset($soft->fields['id']); $input = $soft->fields; $input['entities_id'] = $this->to; unset($soft->fields); $newsoftID = $soft->add(toolbox::addslashes_deep($input)); } } $this->addToAlreadyTransfer('Software', $ID, $newsoftID); return $newsoftID; } return -1; } /** * Copy (if needed) One softwareversion to the Dest Entity * * @param $ID of the version * * @return $ID of the new version (could be the same) **/ function copySingleVersion($ID) { global $DB; if (isset($this->already_transfer['SoftwareVersion'][$ID])) { return $this->already_transfer['SoftwareVersion'][$ID]; } $vers = new SoftwareVersion(); if ($vers->getFromDB($ID)) { $newsoftID = $this->copySingleSoftware($vers->fields['softwares_id']); if ($newsoftID == $vers->fields['softwares_id']) { // no need to copy $newversID = $ID; } else { $query = "SELECT `id` FROM `glpi_softwareversions` WHERE `softwares_id` = $newsoftID AND `name` = '".addslashes($vers->fields['name'])."'"; if ($data = $DB->request($query)->next()) { $newversID = $data["id"]; } else { // create new item (don't check if move possible => clean needed) unset($vers->fields['id']); $input = $vers->fields; $vers->fields = array(); // entities_id and is_recursive from new software are set in prepareInputForAdd $input['softwares_id'] = $newsoftID; $newversID = $vers->add(toolbox::addslashes_deep($input)); } } $this->addToAlreadyTransfer('SoftwareVersion', $ID, $newversID); return $newversID; } return -1; } /** * Transfer disks of a computer * * @param $ID ID of the computer **/ function transferComputerDisks($ID) { if (!$this->options['keep_disk']) { $disk = new ComputerDisk(); $disk->cleanDBonItemDelete('Computer', $ID); } } /** * Transfer softwares of a computer * * @param $ID ID of the computer **/ function transferComputerSoftwares($ID) { global $DB; // Get Installed version $query = "SELECT * FROM `glpi_computers_softwareversions` WHERE `computers_id` = '$ID' AND `softwareversions_id` NOT IN ".$this->item_recurs['SoftwareVersion']; foreach ($DB->request($query) AS $data) { if ($this->options['keep_software']) { $newversID = $this->copySingleVersion($data['softwareversions_id']); if (($newversID > 0) && ($newversID != $data['softwareversions_id'])) { $query = "UPDATE `glpi_computers_softwareversions` SET `softwareversions_id` = '$newversID' WHERE `id` = ".$data['id']; $DB->query($query); } } else { // Do not keep // Delete inst software for computer $del_query = "DELETE FROM `glpi_computers_softwareversions` WHERE `id` = ".$data['id']; $DB->query($del_query); } } // each installed version // Affected licenses if ($this->options['keep_software']) { $query = "SELECT `id` FROM `glpi_computers_softwarelicenses` WHERE `computers_id` = '$ID'"; foreach ($DB->request($query) AS $data) { $this->transferAffectedLicense($data['id']); } } else { $query = "DELETE FROM `glpi_computers_softwarelicenses` WHERE `computers_id` = '$ID'"; $DB->query($query); } } /** * Transfer affected licenses to a computer * * @param $ID ID of the License **/ function transferAffectedLicense($ID) { global $DB; $computer_softwarelicense = new Computer_SoftwareLicense(); $license = new SoftwareLicense(); if ($computer_softwarelicense->getFromDB($ID)) { if ($license->getFromDB($computer_softwarelicense->getField('softwarelicenses_id'))) { //// Update current : decrement number by 1 if valid if ($license->getField('number') > 1) { $license->update(array('id' => $license->getID(), 'number' => ($license->getField('number')-1))); } else if ($license->getField('number') == 1) { // Drop license $license->delete(array('id' => $license->getID())); } // Create new license : need to transfer softwre and versions before $input = array(); $newsoftID = $this->copySingleSoftware($license->fields['softwares_id']); if ($newsoftID > 0) { //// If license already exists : increment number by one $query = "SELECT * FROM `glpi_softwarelicenses` WHERE `softwares_id` = '$newsoftID' AND `name` = '".addslashes($license->fields['name'])."' AND `serial` = '".addslashes($license->fields['serial'])."'"; $newlicID = -1; if ($result = $DB->query($query)) { //// If exists : increment number by 1 if ($DB->numrows($result) > 0) { $data = $DB->fetch_assoc($result); $newlicID = $data['id']; $license->update(array('id' => $data['id'], 'number' => $data['number']+1)); } else { //// If not exists : create with number = 1 $input = $license->fields; foreach (array('softwareversions_id_buy', 'softwareversions_id_use') as $field) { if ($license->fields[$field] > 0) { $newversID = $this->copySingleVersion($license->fields[$field]); if (($newversID > 0) && ($newversID != $license->fields[$field])) { $input[$field] = $newversID; } } } unset($input['id']); $input['number'] = 1; $input['entities_id'] = $this->to; $input['softwares_id'] = $newsoftID; $newlicID = $license->add(toolbox::addslashes_deep($input)); } } if ($newlicID > 0) { $input = array('id' => $ID, 'softwarelicenses_id' => $newlicID); $computer_softwarelicense->update($input); } } } } // getFromDB } /** * Transfer License and Version of a Software * * @param $ID ID of the Software **/ function transferSoftwareLicensesAndVersions($ID) { global $DB; $query = "SELECT `id` FROM `glpi_softwarelicenses` WHERE `softwares_id` = '$ID'"; foreach ($DB->request($query) AS $data) { $this->transferItem('SoftwareLicense', $data['id'], $data['id']); } $query = "SELECT `id` FROM `glpi_softwareversions` WHERE `softwares_id` = '$ID'"; foreach ($DB->request($query) AS $data) { // Just Store the info. $this->addToAlreadyTransfer('SoftwareVersion', $data['id'], $data['id']); } } function cleanSoftwareVersions() { if (!isset($this->already_transfer['SoftwareVersion'])) { return; } $vers = new SoftwareVersion(); foreach ($this->already_transfer['SoftwareVersion'] AS $old => $new) { if ((countElementsInTable("glpi_softwarelicenses", "softwareversions_id_buy=$old") == 0) && (countElementsInTable("glpi_softwarelicenses", "softwareversions_id_use=$old") == 0) && (countElementsInTable("glpi_computers_softwareversions", "softwareversions_id=$old") == 0)) { $vers->delete(array('id' => $old)); } } } function cleanSoftwares() { if (!isset($this->already_transfer['Software'])) { return; } $soft = new Software(); foreach ($this->already_transfer['Software'] AS $old => $new) { if ((countElementsInTable("glpi_softwarelicenses", "softwares_id=$old") == 0) && (countElementsInTable("glpi_softwareversions", "softwares_id=$old") == 0)) { if ($this->options['clean_software'] == 1) { // delete $soft->delete(array('id' => $old), 0); } else if ($this->options['clean_software'] == 2) { // purge $soft->delete(array('id' => $old),1); } } } } /** * Transfer contracts * * @param $itemtype original type of transfered item * @param $ID original ID of the contract * @param $newID new ID of the contract **/ function transferContracts($itemtype, $ID, $newID) { global $DB; $need_clean_process = false; // if keep if ($this->options['keep_contract']) { $contract = new Contract(); // Get contracts for the item $query = "SELECT * FROM `glpi_contracts_items` WHERE `items_id` = '$ID' AND `itemtype` = '$itemtype' AND `contracts_id` NOT IN ".$this->item_recurs['Contract']; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { // Foreach get item while ($data = $DB->fetch_assoc($result)) { $need_clean_process = false; $item_ID = $data['contracts_id']; $newcontractID = -1; // is already transfer ? if (isset($this->already_transfer['Contract'][$item_ID])) { $newcontractID = $this->already_transfer['Contract'][$item_ID]; if ($newcontractID != $item_ID) { $need_clean_process = true; } } else { // No // Can be transfer without copy ? = all linked items need to be transfer (so not copy) $canbetransfer = true; $query = "SELECT DISTINCT `itemtype` FROM `glpi_contracts_items` WHERE `contracts_id` = '$item_ID'"; if ($result_type = $DB->query($query)) { if ($DB->numrows($result_type) > 0) { while (($data_type = $DB->fetch_assoc($result_type)) && $canbetransfer) { $dtype = $data_type['itemtype']; if (isset($this->item_search[$dtype])) { // No items to transfer -> exists links $query_search = "SELECT COUNT(*) AS cpt FROM `glpi_contracts_items` WHERE `contracts_id` = '$item_ID' AND `itemtype` = '$dtype' AND `items_id` NOT IN ".$this->item_search[$dtype]; $result_search = $DB->query($query_search); if ($DB->result($result_search, 0, 'cpt') > 0) { $canbetransfer = false; } } else { $canbetransfer = false; } } } } // Yes : transfer if ($canbetransfer) { $this->transferItem('Contract', $item_ID, $item_ID); $newcontractID = $item_ID; } else { $need_clean_process = true; $contract->getFromDB($item_ID); // No : search contract $query = "SELECT * FROM `glpi_contracts` WHERE `entities_id` = '".$this->to."' AND `name` = '".addslashes($contract->fields['name'])."'"; if ($result_search = $DB->query($query)) { if ($DB->numrows($result_search) > 0) { $newcontractID = $DB->result($result_search, 0, 'id'); $this->addToAlreadyTransfer('Contract', $item_ID, $newcontractID); } } // found : use it // not found : copy contract if ($newcontractID < 0) { // 1 - create new item unset($contract->fields['id']); $input = $contract->fields; $input['entities_id'] = $this->to; unset($contract->fields); $newcontractID = $contract->add(toolbox::addslashes_deep($input)); // 2 - transfer as copy $this->transferItem('Contract', $item_ID, $newcontractID); } } } // Update links if ($ID == $newID) { if ($item_ID != $newcontractID) { $query = "UPDATE `glpi_contracts_items` SET `contracts_id` = '$newcontractID' WHERE `id` = '".$data['id']."'"; $DB->query($query); } // Same Item -> update links } else { // Copy Item -> copy links if ($item_ID != $newcontractID) { $query = "INSERT INTO `glpi_contracts_items` (`contracts_id`, `items_id`, `itemtype`) VALUES ('$newcontractID', '$newID', '$itemtype')"; $DB->query($query); } else { // same contract for new item update link $query = "UPDATE `glpi_contracts_items` SET `items_id` = '$newID' WHERE `id` = '".$data['id']."'"; $DB->query($query); } } // If clean and unused -> if ($need_clean_process && $this->options['clean_contract']) { $query = "SELECT COUNT(*) AS cpt FROM `glpi_contracts_items` WHERE `contracts_id` = '$item_ID'"; if ($result_remaining = $DB->query($query)) { if ($DB->result($result_remaining, 0, 'cpt') == 0) { if ($this->options['clean_contract'] == 1) { $contract->delete(array('id' => $item_ID)); } if ($this->options['clean_contract']==2) { // purge $contract->delete(array('id' => $item_ID), 1); } } } } } } } } else {// else unlink $query = "DELETE FROM `glpi_contracts_items` WHERE `items_id` = '$ID' AND `itemtype` = '$itemtype'"; $DB->query($query); } } /** * Transfer documents * * @param $itemtype original type of transfered item * @param $ID original ID of the document * @param $newID new ID of the document **/ function transferDocuments($itemtype, $ID, $newID) { global $DB; $need_clean_process = false; // if keep if ($this->options['keep_document']) { $document = new Document(); // Get contracts for the item $query = "SELECT * FROM `glpi_documents_items` WHERE `items_id` = '$ID' AND `itemtype` = '$itemtype' AND `documents_id` NOT IN ".$this->item_recurs['Document']; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { // Foreach get item while ($data = $DB->fetch_assoc($result)) { $need_clean_process = false; $item_ID = $data['documents_id']; $newdocID = -1; // is already transfer ? if (isset($this->already_transfer['Document'][$item_ID])) { $newdocID = $this->already_transfer['Document'][$item_ID]; if ($newdocID != $item_ID) { $need_clean_process = true; } } else { // No // Can be transfer without copy ? = all linked items need to be transfer (so not copy) $canbetransfer = true; $query = "SELECT DISTINCT `itemtype` FROM `glpi_documents_items` WHERE `documents_id` = '$item_ID'"; if ($result_type = $DB->query($query)) { if ($DB->numrows($result_type) >0) { while (($data_type = $DB->fetch_assoc($result_type)) && $canbetransfer) { $dtype = $data_type['itemtype']; if (isset($this->item_search[$dtype])) { // No items to transfer -> exists links $query_search = "SELECT COUNT(*) AS cpt FROM `glpi_documents_items` WHERE `documents_id` = '$item_ID' AND `itemtype` = '$dtype' AND `items_id` NOT IN ".$this->item_search[$dtype]; // contacts, contracts, and enterprises are linked as device. if (isset($this->item_recurs[$dtype])) { $query_search .= " AND `items_id` NOT IN ".$this->item_recurs[$dtype]; } $result_search = $DB->query($query_search); if ($DB->result($result_search, 0, 'cpt') > 0) { $canbetransfer = false; } } } } } // Yes : transfer if ($canbetransfer) { $this->transferItem('Document', $item_ID, $item_ID); $newdocID = $item_ID; } else { $need_clean_process = true; $document->getFromDB($item_ID); // No : search contract $query = "SELECT * FROM `glpi_documents` WHERE `entities_id` = '".$this->to."' AND `name` = '".addslashes($document->fields['name'])."'"; if ($result_search = $DB->query($query)) { if ($DB->numrows($result_search) > 0) { $newdocID = $DB->result($result_search,0,'id'); $this->addToAlreadyTransfer('Document', $item_ID, $newdocID); } } // found : use it // not found : copy doc if ($newdocID < 0) { // 1 - create new item unset($document->fields['id']); $input = $document->fields; // Not set new entity Do by transferItem unset($document->fields); $newdocID = $document->add(toolbox::addslashes_deep($input)); // 2 - transfer as copy $this->transferItem('Document', $item_ID, $newdocID); } } } // Update links if ($ID == $newID) { if ($item_ID != $newdocID) { $query = "UPDATE `glpi_documents_items` SET `documents_id` = '$newdocID' WHERE `id` = '".$data['id']."'"; $DB->query($query); } // Same Item -> update links } else { // Copy Item -> copy links if ($item_ID != $newdocID) { $query = "INSERT INTO `glpi_documents_items` (`documents_id`, `items_id`, `itemtype`) VALUES ('$newdocID','$newID','$itemtype')"; $DB->query($query); } else { // same doc for new item update link $query = "UPDATE `glpi_documents_items` SET `items_id` = '$newID' WHERE `id` = '".$data['id']."'"; $DB->query($query); } } // If clean and unused -> if ($need_clean_process && $this->options['clean_document']) { $query = "SELECT COUNT(*) AS cpt FROM `glpi_documents_items` WHERE `documents_id` = '$item_ID'"; if ($result_remaining = $DB->query($query)) { if ($DB->result($result_remaining,0,'cpt') == 0) { if ($this->options['clean_document'] == 1) { $document->delete(array('id' => $item_ID)); } if ($this->options['clean_document'] == 2) { // purge $document->delete(array('id' => $item_ID), 1); } } } } } } } } else {// else unlink $query = "DELETE FROM `glpi_documents_items` WHERE `items_id` = '$ID' AND `itemtype` = '$itemtype'"; $DB->query($query); } } /** * Delete direct connection for a linked item * * @param $itemtype original type of transfered item * @param $ID ID of the item * @param $link_type type of the linked items to transfer **/ function transferDirectConnection($itemtype ,$ID, $link_type) { global $DB; // Only same Item case : no duplication of computers // Default : delete $keep = 0; $clean = 0; switch ($link_type) { case 'Printer' : $keep = $this->options['keep_dc_printer']; $clean = $this->options['clean_dc_printer']; break; case 'Monitor' : $keep = $this->options['keep_dc_monitor']; $clean = $this->options['clean_dc_monitor']; break; case 'Peripheral' : $keep = $this->options['keep_dc_peripheral']; $clean = $this->options['clean_dc_peripheral']; break; case 'Phone' : $keep = $this->options['keep_dc_phone']; $clean = $this->options['clean_dc_phone']; break; } if (!($link_item = getItemForItemtype($link_type))) { continue; } // Get connections $query = "SELECT * FROM `glpi_computers_items` WHERE `computers_id` = '$ID' AND `itemtype` = '".$link_type."'"; if ($link_item->maybeRecursive()) { $query .= " AND `items_id` NOT IN ".$this->item_recurs[$link_type]; } if ($result = $DB->query($query)) { if ($DB->numrows($result) != 0) { // Foreach get item while ($data = $DB->fetch_assoc($result)) { $item_ID = $data['items_id']; if ($link_item->getFromDB($item_ID)) { // If global : if ($link_item->fields['is_global'] == 1) { $need_clean_process = false; // if keep if ($keep) { $newID = -1; // Is already transfer ? if (isset($this->already_transfer[$link_type][$item_ID])) { $newID = $this->already_transfer[$link_type][$item_ID]; // Already transfer as a copy : need clean process if ($newID != $item_ID) { $need_clean_process = true; } } else { // Not yet tranfer // Can be managed like a non global one ? // = all linked computers need to be transfer (so not copy) $query = "SELECT COUNT(*) AS cpt FROM `glpi_computers_items` WHERE `itemtype` = '".$link_type."' AND `items_id` = '$item_ID' AND `computers_id` NOT IN ".$this->item_search['Computer']; $result_search = $DB->query($query); // All linked computers need to be transfer -> use unique transfer system if ($DB->result($result_search, 0, 'cpt') == 0) { $need_clean_process = false; $this->transferItem($link_type, $item_ID, $item_ID); $newID = $item_ID; } else { // else Transfer by Copy $need_clean_process = true; // Is existing global item in the destination entity ? $query = "SELECT * FROM `".getTableForItemType($link_type)."` WHERE `is_global` = '1' AND `entities_id` = '".$this->to."' AND `name` = '".addslashes($link_item->getField('name'))."'"; if ($result_search = $DB->query($query)) { if ($DB->numrows($result_search) > 0) { $newID = $DB->result($result_search, 0, 'id'); $this->addToAlreadyTransfer($link_type, $item_ID, $newID); } } // Not found -> transfer copy if ($newID <0) { // 1 - create new item unset($link_item->fields['id']); $input = $link_item->fields; $input['entities_id'] = $this->to; unset($link_item->fields); $newID = $link_item->add(toolbox::addslashes_deep($input)); // 2 - transfer as copy $this->transferItem($link_type,$item_ID,$newID); } // Founded -> use to link : nothing to do } } // Finish updated link if needed if (($newID > 0) && ($newID != $item_ID)) { $query = "UPDATE `glpi_computers_items` SET `items_id` = '$newID' WHERE `id` = '".$data['id']."' "; $DB->query($query); } } else { // Else delete link // Call Disconnect for global device (no disconnect behavior, but history ) $conn = new Computer_Item(); $conn->delete(array('id' => $data['id'], '_no_auto_action' => true)); $need_clean_process = true; } // If clean and not linked dc -> delete if ($need_clean_process && $clean) { $query = "SELECT COUNT(*) AS cpt FROM `glpi_computers_items` WHERE `items_id` = '$item_ID' AND `itemtype` = '".$link_type."'"; if ($result_dc = $DB->query($query)) { if ($DB->result($result_dc, 0, 'cpt') == 0) { if ($clean == 1) { $link_item->delete(array('id' => $item_ID)); } if ($clean == 2) { // purge $link_item->delete(array('id' => $item_ID), 1); } } } } } else { // If unique : //if keep -> transfer list else unlink if ($keep) { $this->transferItem($link_type, $item_ID, $item_ID); } else { // Else delete link (apply disconnect behavior) $conn = new Computer_Item(); $conn->delete(array('id' => $data['id'])); //if clean -> delete if ($clean == 1) { $link_item->delete(array('id' => $item_ID)); } else if ($clean == 2) { // purge $link_item->delete(array('id' => $item_ID), 1); } } } } else { // Unexisting item / Force disconnect $conn = new Computer_Item(); $conn->delete(array('id' => $data['id'], '_no_history' => true, '_no_auto_action'=> true)); } } } } } /** * Delete direct connection for a linked item * * @param $itemtype item type * @param $ID ID of the item **/ function deleteDirectConnection($itemtype, $ID) { global $DB; // Delete Direct connection to computers for item type $query = "SELECT * FROM `glpi_computers_items` WHERE `items_id` = '$ID' AND `itemtype` = '$itemtype'"; $result = $DB->query($query); } /** * Transfer tickets * * @param $itemtype type of transfered item * @param $ID original ID of the ticket * @param $newID new ID of the ticket **/ function transferTickets($itemtype, $ID, $newID) { global $DB; $job = new Ticket(); $query = "SELECT * FROM `glpi_tickets` WHERE `items_id` = '$ID' AND `itemtype` = '$itemtype'"; if ($result = $DB->query($query)) { if ($DB->numrows($result) != 0) { switch ($this->options['keep_ticket']) { // Transfer case 2 : // Same Item / Copy Item -> update entity while ($data = $DB->fetch_assoc($result)) { $input = $this->transferTicketAdditionalInformations($data); $input['id'] = $data['id']; $input['entities_id'] = $this->to; $input['items_id'] = $newID; $input['itemtype'] = $itemtype; $job->update($input); $this->addToAlreadyTransfer('Ticket', $data['id'], $data['id']); $this->transferTaskCategory('Ticket', $input['id'], $input['id']); } break; // Clean ref : keep ticket but clean link case 1 : // Same Item / Copy Item : keep and clean ref while ($data = $DB->fetch_assoc($result)) { $job->update(array('id' => $data['id'], 'itemtype' => 0, 'items_id' => 0)); $this->addToAlreadyTransfer('Ticket', $data['id'], $data['id']); } break; // Delete case 0 : // Same item -> delete if ($ID == $newID) { while ($data = $DB->fetch_assoc($result)) { $job->delete(array('id' => $data['id'])); } } // Copy Item : nothing to do break; } } } } /** * Transfer suppliers for specified tickets or problems * * @since version 0.84 * * @param $itemtype itemtype : Problem / Ticket * @param $ID original ticket ID * @param $newID new ticket ID **/ function transferLinkedSuppliers($itemtype, $ID, $newID) { global $DB; switch ($itemtype) { case 'Ticket' : $table = 'glpi_suppliers_tickets'; $field = 'tickets_id'; $link = new Supplier_Ticket(); break; case 'Problem' : $table = 'glpi_problems_suppliers'; $field = 'problems_id'; $link = new Problem_Supplier(); break; } $query = "SELECT * FROM `$table` WHERE `$field` = '$ID'"; if ($result = $DB->query($query)) { if ($DB->numrows($result) != 0) { while ($data = $DB->fetch_assoc($result)) { $input = array(); if ($data['suppliers_id'] > 0) { $supplier = new Supplier(); if ($supplier->getFromDB($data['suppliers_id'])) { $newID = -1; $query = "SELECT * FROM `glpi_suppliers` WHERE `entities_id` = '".$this->to."' AND `name` = '".addslashes($supplier->fields['name'])."'"; if ($result_search = $DB->query($query)) { if ($DB->numrows($result_search) > 0) { $newID = $DB->result($result_search,0,'id'); } } if ($newID < 0) { // 1 - create new item unset($supplier->fields['id']); $input = $supplier->fields; $input['entities_id'] = $this->to; // Not set new entity Do by transferItem unset($supplier->fields); $newID = $supplier->add(toolbox::addslashes_deep($input)); } $input2['id'] = $data['id']; $input2[$field] = $ID; $input2['suppliers_id'] = $newID; $link->update($input2); } } } } } } /** * Transfer task categories for specified tickets * * @since version 0.83 * * @param $itemtype itemtype : Problem / Ticket * @param $ID original ticket ID * @param $newID new ticket ID **/ function transferTaskCategory($itemtype, $ID, $newID) { global $DB; switch ($itemtype) { case 'Ticket' : $table = 'glpi_tickettasks'; $field = 'tickets_id'; $task = new TicketTask(); break; case 'Problem' : $table = 'glpi_problemtasks'; $field = 'problems_id'; $task = new ProblemTask(); break; } $query = "SELECT * FROM `$table` WHERE `$field` = '$ID'"; if ($result = $DB->query($query)) { if ($DB->numrows($result) != 0) { while ($data = $DB->fetch_assoc($result)) { $input = array(); if ($data['taskcategories_id'] > 0) { $categ = new TaskCategory(); if ($categ->getFromDB($data['taskcategories_id'])) { $inputcat['entities_id'] = $this->to; $inputcat['completename'] = addslashes($categ->fields['completename']); $catid = $categ->findID($inputcat); if ($catid < 0) { $catid = $categ->import($inputcat); } $input['id'] = $data['id']; $input[$field] = $ID; $input['taskcategories_id'] = $catid; $task->update($input); } } } } } } /** * Transfer ticket/problem infos * * @param $data ticket data fields **/ function transferTicketAdditionalInformations($data) { $input = array(); $suppliers_id_assign = 0; // if ($data['suppliers_id_assign'] > 0) { // $suppliers_id_assign = $this->transferSingleSupplier($data['suppliers_id_assign']); // } // Transfer ticket category $catid = 0; if ($data['itilcategories_id'] > 0) { $categ = new ITILCategory(); if ($categ->getFromDB($data['itilcategories_id'])) { $inputcat['entities_id'] = $this->to; $inputcat['completename'] = addslashes($categ->fields['completename']); $catid = $categ->findID($inputcat); if ($catid < 0) { $catid = $categ->import($inputcat); } } } $input['itilcategories_id'] = $catid; return $input; } /** * Transfer history * * @param $itemtype original type of transfered item * @param $ID original ID of the history * @param $newID new ID of the history **/ function transferHistory($itemtype, $ID, $newID) { global $DB; switch ($this->options['keep_history']) { // delete case 0 : // Same item -> delete if ($ID == $newID) { $query = "DELETE FROM `glpi_logs` WHERE `itemtype` = '$itemtype' AND `items_id` = '$ID'"; $result = $DB->query($query); } // Copy -> nothing to do break; // Keep history default : // Copy -> Copy datas if ($ID != $newID) { $query = "SELECT * FROM `glpi_logs` WHERE `itemtype` = '$itemtype' AND `items_id` = '$ID'"; $result = $DB->query($query); if ($result = $DB->query($query)) { if ($DB->numrows($result) != 0) { while ($data = $DB->fetch_assoc($result)) { $data = Toolbox::addslashes_deep($data); $query = "INSERT INTO `glpi_logs` (`items_id`, `itemtype`, `itemtype_link`, `linked_action`, `user_name`, `date_mod`, `id_search_option`, `old_value`, `new_value`) VALUES ('$newID', '$itemtype', '".$data['itemtype_link']."', '".$data['linked_action']."', '". $data['user_name']."', '".$data['date_mod']."', '".$data['id_search_option']."', '".$data['old_value']."', '".$data['new_value']."')"; $DB->query($query); } } } } // Same item -> nothing to do break; } } /** * Transfer compatible printers for a cartridge type * * @param $ID original ID of the cartridge type * @param $newID new ID of the cartridge type **/ function transferCompatiblePrinters($ID, $newID) { global $DB; if ($ID != $newID) { $query = "SELECT * FROM `glpi_cartridgeitems_printermodels` WHERE `cartridgeitems_id` = '$ID'"; if ($result = $DB->query($query)) { if ($DB->numrows($result) != 0) { $cartitem = new CartridgeItem(); while ($data = $DB->fetch_assoc($result)) { $data = Toolbox::addslashes_deep($data); $cartitem->addCompatibleType($newID, $data["printermodels_id"]); } } } } } /** * Transfer infocoms of an item * * @param $itemtype type of the item to transfer * @param $ID original ID of the item * @param $newID new ID of the item **/ function transferInfocoms($itemtype, $ID, $newID) { global $DB; $ic = new Infocom(); if ($ic->getFromDBforDevice($itemtype,$ID)) { switch ($this->options['keep_infocom']) { // delete case 0 : // Same item -> delete if ($ID == $newID) { $query = "DELETE FROM `glpi_infocoms` WHERE `itemtype` = '$itemtype' AND `items_id` = '$ID'"; $result = $DB->query($query); } // Copy : nothing to do break; // Keep default : // transfer enterprise $suppliers_id = 0; if ($ic->fields['suppliers_id'] > 0) { $suppliers_id = $this->transferSingleSupplier($ic->fields['suppliers_id']); } // Copy : copy infocoms if ($ID != $newID) { // Copy items $input = $ic->fields; $input['items_id'] = $newID; $input['suppliers_id'] = $suppliers_id; unset($input['id']); unset($ic->fields); $ic->add(toolbox::addslashes_deep($input)); } else { // Same Item : manage only enterprise move // Update enterprise if (($suppliers_id > 0) && ($suppliers_id != $ic->fields['suppliers_id'])) { $ic->update(array('id' => $ic->fields['id'], 'suppliers_id' => $suppliers_id)); } } break; } } } /** * Transfer an enterprise * * @param $ID ID of the enterprise **/ function transferSingleSupplier($ID) { global $DB, $CFG_GLPI; // TODO clean system : needed ? $ent = new Supplier(); if ($this->options['keep_supplier'] && $ent->getFromDB($ID)) { if (isset($this->noneedtobe_transfer['Supplier'][$ID])) { // recursive enterprise return $ID; } if (isset($this->already_transfer['Supplier'][$ID])) { // Already transfer return $this->already_transfer['Supplier'][$ID]; } $newID = -1; // Not already transfer $links_remaining = 0; // All linked items need to be transfer so transfer enterprise ? // Search for contract $query = "SELECT COUNT(*) AS cpt FROM `glpi_contracts_suppliers` WHERE `suppliers_id` = '$ID' AND `contracts_id` NOT IN ".$this->item_search['Contract']; $result_search = $DB->query($query); $links_remaining = $DB->result($result_search, 0, 'cpt'); if ($links_remaining == 0) { // Search for infocoms if ($this->options['keep_infocom']) { foreach ($CFG_GLPI["infocom_types"] as $itemtype) { if (isset($this->item_search[$itemtype])) { $query = "SELECT COUNT(*) AS cpt FROM `glpi_infocoms` WHERE `suppliers_id` = '$ID' AND `itemtype` = '$itemtype' AND `items_id` NOT IN ".$this->item_search[$itemtype]; if ($result_search = $DB->query($query)) { $links_remaining += $DB->result($result_search, 0,' cpt'); } } } } } // All linked items need to be transfer -> use unique transfer system if ($links_remaining == 0) { $this->transferItem('Supplier', $ID, $ID); $newID = $ID; } else { // else Transfer by Copy // Is existing item in the destination entity ? $query = "SELECT * FROM `glpi_suppliers` WHERE `entities_id` = '".$this->to."' AND `name` = '".addslashes($ent->fields['name'])."'"; if ($result_search = $DB->query($query)) { if ($DB->numrows($result_search) > 0) { $newID = $DB->result($result_search, 0, 'id'); $this->addToAlreadyTransfer('Supplier', $ID, $newID); } } // Not found -> transfer copy if ($newID < 0) { // 1 - create new item unset($ent->fields['id']); $input = $ent->fields; $input['entities_id'] = $this->to; unset($ent->fields); $newID = $ent->add(toolbox::addslashes_deep($input)); // 2 - transfer as copy $this->transferItem('Supplier',$ID,$newID); } // Founded -> use to link : nothing to do } return $newID; } return 0; } /** * Transfer contacts of an enterprise * * @param $ID original ID of the enterprise * @param $newID new ID of the enterprise **/ function transferSupplierContacts($ID, $newID) { global $DB; $need_clean_process = false; // if keep if ($this->options['keep_contact']) { $contact = new Contact(); // Get contracts for the item $query = "SELECT * FROM `glpi_contacts_suppliers` WHERE `suppliers_id` = '$ID' AND `contacts_id` NOT IN " . $this->item_recurs['Contact']; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { // Foreach get item while ($data = $DB->fetch_assoc($result)) { $need_clean_process = false; $item_ID = $data['contacts_id']; $newcontactID = -1; // is already transfer ? if (isset($this->already_transfer['Contact'][$item_ID])) { $newcontactID = $this->already_transfer['Contact'][$item_ID]; if ($newcontactID != $item_ID) { $need_clean_process = true; } } else { $canbetransfer = true; // Transfer enterprise : is the contact used for another enterprise ? if ($ID == $newID) { $query_search = "SELECT COUNT(*) AS cpt FROM `glpi_contacts_suppliers` WHERE `contacts_id` = '$item_ID' AND `suppliers_id` NOT IN ".$this->item_search['Supplier'] ." AND `suppliers_id` NOT IN ".$this->item_recurs['Supplier']; $result_search = $DB->query($query_search); if ($DB->result($result_search, 0, 'cpt') > 0) { $canbetransfer = false; } } // Yes : transfer if ($canbetransfer) { $this->transferItem('Contact',$item_ID,$item_ID); $newcontactID = $item_ID; } else { $need_clean_process = true; $contact->getFromDB($item_ID); // No : search contract $query = "SELECT * FROM `glpi_contacts` WHERE `entities_id` = '".$this->to."' AND `name` = '".addslashes($contact->fields['name'])."' AND `firstname` = '".addslashes($contact->fields['firstname'])."'"; if ($result_search = $DB->query($query)) { if ($DB->numrows($result_search) > 0) { $newcontactID = $DB->result($result_search, 0, 'id'); $this->addToAlreadyTransfer('Contact', $item_ID, $newcontactID); } } // found : use it // not found : copy contract if ($newcontactID < 0) { // 1 - create new item unset($contact->fields['id']); $input = $contact->fields; $input['entities_id'] = $this->to; unset($contact->fields); $newcontactID = $contact->add(toolbox::addslashes_deep($input)); // 2 - transfer as copy $this->transferItem('Contact',$item_ID,$newcontactID); } } } // Update links if ($ID == $newID) { if ($item_ID != $newcontactID) { $query = "UPDATE `glpi_contacts_suppliers` SET `contacts_id` = '$newcontactID' WHERE `id` = '".$data['id']."'"; $DB->query($query); } // Same Item -> update links } else { // Copy Item -> copy links if ($item_ID != $newcontactID) { $query = "INSERT INTO `glpi_contacts_suppliers` (`contacts_id`, `suppliers_id`) VALUES ('$newcontactID','$newID')"; $DB->query($query); } else { // transfer contact but copy enterprise : update link $query = "UPDATE `glpi_contacts_suppliers` SET `suppliers_id` = '$newID' WHERE `id` = '".$data['id']."'"; $DB->query($query); } } // If clean and unused -> if ($need_clean_process && $this->options['clean_contact']) { $query = "SELECT COUNT(*) AS cpt FROM `glpi_contacts_suppliers` WHERE `contacts_id` = '$item_ID'"; if ($result_remaining = $DB->query($query)) { if ($DB->result($result_remaining,0,'cpt') == 0) { if ($this->options['clean_contact'] == 1) { $contact->delete(array('id' => $item_ID)); } if ($this->options['clean_contact'] == 2) { // purge $contact->delete(array('id' => $item_ID), 1); } } } } } } } } else {// else unlink $query = "DELETE FROM `glpi_contacts_suppliers` WHERE `suppliers_id` = '$ID'"; $DB->query($query); } } /** * Transfer reservations of an item * * @param $itemtype original type of transfered item * @param $ID original ID of the item * @param $newID new ID of the item **/ function transferReservations($itemtype, $ID, $newID) { global $DB; $ri = new ReservationItem(); if ($ri->getFromDBbyItem($itemtype,$ID)) { switch ($this->options['keep_reservation']) { // delete case 0 : // Same item -> delete if ($ID == $newID) { $ri->delete(array('id' => $ri->fields['id'])); } // Copy : nothing to do break; // Keep default : // Copy : set item as reservable if ($ID != $newID) { $input['itemtype'] = $itemtype; $input['items_id'] = $newID; $input['is_active'] = $ri->fields['is_active']; unset($ri->fields); $ri->add(toolbox::addslashes_deep($input)); } // Same item -> nothing to do break; } } } /** * Transfer devices of a computer * * @param $itemtype original type of transfered item * @param $ID ID of the computer **/ function transferDevices($itemtype, $ID) { global $DB; // Only same case because no duplication of computers switch ($this->options['keep_device']) { // delete devices case 0 : foreach ($this->DEVICES_TYPES as $type) { $table = getTableForItemType('Item_'.$type); $query = "DELETE FROM `$table` WHERE `itemtype` = '$itemtype' AND `items_id` = '$ID'"; $result = $DB->query($query); } // Keep devices default : // Same item -> nothing to do break; } } /** * Transfer network links * * @param $itemtype original type of transfered item * @param $ID original ID of the item * @param $newID new ID of the item **/ function transferNetworkLink($itemtype, $ID, $newID) { global $DB; /// TODO manage with new network system $np = new NetworkPort(); $nn = new NetworkPort_NetworkPort(); $query = "SELECT `glpi_networkports`.*, `glpi_networkportethernets`.`netpoints_id` FROM `glpi_networkports` LEFT JOIN `glpi_networkportethernets` ON (`glpi_networkports`.`id` = `glpi_networkportethernets`.`networkports_id`) WHERE `glpi_networkports`.`items_id` = '$ID' AND `glpi_networkports`.`itemtype` = '$itemtype'"; if ($result = $DB->query($query)) { if ($DB->numrows($result) != 0) { switch ($this->options['keep_networklink']) { // Delete netport case 0 : // Not a copy -> delete if ($ID == $newID) { while ($data = $DB->fetch_assoc($result)) { $np->delete(array('id' => $data['id'])); } } // Copy -> do nothing break; // Disconnect case 1 : // Not a copy -> disconnect if ($ID == $newID) { while ($data = $DB->fetch_assoc($result)) { if ($nn->getFromDBForNetworkPort($data['id'])) { $nn->delete($data); } if ($data['netpoints_id']) { $netpointID = $this->transferDropdownNetpoint($data['netpoints_id']); $input['id'] = $data['id']; $input['netpoints_id'] = $netpointID; $np->update($input); } } } else { // Copy -> copy netports while ($data = $DB->fetch_assoc($result)) { $data = Toolbox::addslashes_deep($data); unset($data['id']); $data['items_id'] = $newID; $data['netpoints_id'] = $this->transferDropdownNetpoint($data['netpoints_id']); unset($np->fields); $np->add(toolbox::addslashes_deep($data)); } } break; // Keep network links default : // Copy -> Copy netpoints (do not keep links) if ($ID != $newID) { while ($data = $DB->fetch_assoc($result)) { unset($data['id']); $data['items_id'] = $newID; $data['netpoints_id'] = $this->transferDropdownNetpoint($data['netpoints_id']); unset($np->fields); $np->add(toolbox::addslashes_deep($data)); } } else { while ($data = $DB->fetch_assoc($result)) { // Not a copy -> only update netpoint if ($data['netpoints_id']) { $netpointID = $this->transferDropdownNetpoint($data['netpoints_id']); $input['id'] = $data['id']; $input['netpoints_id'] = $netpointID; $np->update($input); } } } } } } } /** * Print the transfer form * * @param $ID integer : Id of the contact to print * @param $options array * - target filename : where to go when done. * - withtemplate boolean : template or basic item * * @return boolean item found **/ function showForm($ID, $options=array()) { global $CFG_GLPI; $edit_form = true; if (!strpos($_SERVER['PHP_SELF'],"transfer.form.php")) { $edit_form = false; } $this->initForm($ID, $options); $params = array(); if (!Session::haveRight("transfer","w")) { $params['readonly'] = true; } if ($edit_form) { $this->showTabs($options); $this->showFormHeader($options); } else { echo ""; echo "
    "; echo ""; echo ""; } if ($edit_form) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } $keep = array(0 => _x('button', 'Delete permanently'), 1 => __('Preserve')); $clean = array(0 => __('Preserve'), 1 => _x('button', 'Put in dustbin'), 2 => _x('button', 'Delete permanently')); echo ""; echo ""; if (!$edit_form) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if ($edit_form) { $this->showFormButtons($options); $this->addDivForTabs(); } else { echo "
    "; echo "
    "; Entity::dropdown(array('name' => 'to_entity')); echo " 
    "; echo "
    ".__('Name').""; Html::autocompletionTextField($this, "name"); echo "".__('Comments')." "; echo "
    ".__('Last update')."".($this->fields["date_mod"] ? Html::convDateTime($this->fields["date_mod"]) : __('Never')); echo "
    ".__('Historical').""; $params['value'] = $this->fields['keep_history']; Dropdown::showFromArray('keep_history', $keep,$params); echo " 
    ".__('Assets')."
    "._n('Network port', 'Network ports', 2).""; $options = array(0 => _x('button', 'Delete permanently'), 1 => __('Disconnect') , 2 => __('Keep') ); $params['value'] = $this->fields['keep_networklink']; Dropdown::showFromArray('keep_networklink',$options,$params); echo ""._n('Ticket', 'Tickets', 2).""; $options = array(0 => _x('button', 'Delete permanently'), 1 => __('Disconnect') , 2 => __('Keep') ); $params['value'] = $this->fields['keep_ticket']; Dropdown::showFromArray('keep_ticket',$options,$params); echo "
    ".__('Software of computers').""; $params['value'] = $this->fields['keep_software']; Dropdown::showFromArray('keep_software', $keep,$params); echo "".__('If software are no longer used').""; $params['value'] = $this->fields['clean_software']; Dropdown::showFromArray('clean_software', $clean,$params); echo "
    "._n('Reservation', 'Reservations', 2).""; $params['value'] = $this->fields['keep_reservation']; Dropdown::showFromArray('keep_reservation',$keep, $params); echo "".__('Components of computers').""; $params['value'] = $this->fields['keep_device']; Dropdown::showFromArray('keep_device',$keep, $params); echo "
    ".__('Links between printers and cartridge types and cartridges'); echo ""; $params['value'] = $this->fields['keep_cartridgeitem']; Dropdown::showFromArray('keep_cartridgeitem', $keep, $params); echo "".__('If the cartridge types are no longer used').""; $params['value'] = $this->fields['clean_cartridgeitem']; Dropdown::showFromArray('clean_cartridgeitem', $clean, $params); echo "
    ".__('Links between cartridge types and cartridges').""; $params['value'] = $this->fields['keep_cartridge']; Dropdown::showFromArray('keep_cartridge', $keep, $params); echo "".__('Financial and administrative information').""; $params['value'] = $this->fields['keep_infocom']; Dropdown::showFromArray('keep_infocom', $keep, $params); echo "
    ".__('Links between consumable types and consumables').""; $params['value'] = $this->fields['keep_consumable']; Dropdown::showFromArray('keep_consumable', $keep, $params); echo "".__('Links between computers and volumes').""; $params['value'] = $this->fields['keep_disk']; Dropdown::showFromArray('keep_disk', $keep, $params); echo "
    ".__('Direct connections')."
    "._n('Monitor', 'Monitors', 2).""; $params['value'] = $this->fields['keep_dc_monitor']; Dropdown::showFromArray('keep_dc_monitor', $keep, $params); echo "".__('If monitors are no longer used').""; $params['value'] = $this->fields['clean_dc_monitor']; Dropdown::showFromArray('clean_dc_monitor', $clean, $params); echo "
    "._n('Printer', 'Printers', 2).""; $params['value'] = $this->fields['keep_dc_printer']; Dropdown::showFromArray('keep_dc_printer', $keep, $params); echo "".__('If printers are no longer used').""; $params['value'] = $this->fields['clean_dc_printer']; Dropdown::showFromArray('clean_dc_printer', $clean, $params); echo "
    "._n('Device', 'Devices', 2).""; $params['value'] = $this->fields['keep_dc_peripheral']; Dropdown::showFromArray('keep_dc_peripheral', $keep, $params); echo "".__('If devices are no longer used').""; $params['value'] = $this->fields['clean_dc_peripheral']; Dropdown::showFromArray('clean_dc_peripheral', $clean, $params); echo "
    "._n('Phone', 'Phones', 2).""; $params['value'] = $this->fields['keep_dc_phone']; Dropdown::showFromArray('keep_dc_phone', $keep, $params); echo "".__('If phones are no longer used').""; $params['value'] = $this->fields['clean_dc_phone']; Dropdown::showFromArray('clean_dc_phone', $clean, $params); echo "
    ".__('Management')."
    "._n('Supplier', 'Suppliers', 2).""; $params['value'] = $this->fields['keep_supplier']; Dropdown::showFromArray('keep_supplier', $keep, $params); echo "".__('If suppliers are no longer used').""; $params['value'] = $this->fields['clean_supplier']; Dropdown::showFromArray('clean_supplier', $clean, $params); echo "
    ".__('Links between suppliers and contacts')." :"; $params['value'] = $this->fields['keep_contact']; Dropdown::showFromArray('keep_contact', $keep, $params); echo "".__('If contacts are no longer used').""; $params['value'] = $this->fields['clean_contact']; Dropdown::showFromArray('clean_contact', $clean, $params); echo "
    "._n('Document', 'Documents', 2).""; $params['value'] = $this->fields['keep_document']; Dropdown::showFromArray('keep_document', $keep, $params); echo "".__('If documents are no longer used').""; $params['value'] = $this->fields['clean_document']; Dropdown::showFromArray('clean_document', $clean, $params); echo "
    "._n('Contract', 'Contracts', 2).""; $params['value'] = $this->fields['keep_contract']; Dropdown::showFromArray('keep_contract', $keep, $params); echo "".__('If contracts are no longer used').""; $params['value'] = $this->fields['clean_contract']; Dropdown::showFromArray('clean_contract', $clean, $params); echo "
    "; Html::closeForm(); } } /// Display items to transfers function showTransferList() { global $DB, $CFG_GLPI; if (isset($_SESSION['glpitransfer_list']) && count($_SESSION['glpitransfer_list'])) { echo "
    ". __('You can continue to add elements to be transferred or execute the transfer now'); echo "
    ".__('Think of making a backup before transferring items.')."
    "; echo ""; echo ''; echo "'; echo '
    '.__('Items to transfer').''.__('Transfer mode')." "; $rand = Transfer::dropdown(array('name' => 'id', 'comments' => false, 'toupdate' => array('value_fieldname' => 'id', 'to_update' => "transfer_form", 'url' => $CFG_GLPI["root_doc"]. "/ajax/transfers.php"))); echo '
    "; foreach ($_SESSION['glpitransfer_list'] as $itemtype => $tab) { if (count($tab)) { $table = getTableForItemType($itemtype); $query = "SELECT `$table`.`id`, `$table`.`name`, `glpi_entities`.`completename` AS locname, `glpi_entities`.`id` AS entID FROM `$table` LEFT JOIN `glpi_entities` ON (`$table`.`entities_id` = `glpi_entities`.`id`) WHERE `$table`.`id` IN ".$this->createSearchConditionUsingArray($tab)." ORDER BY locname, `$table`.`name`"; $entID = -1; if (!($item = getItemForItemtype($itemtype))) { continue; } if ($result = $DB->query($query)) { if ($DB->numrows($result)) { echo '

    '.$item->getTypeName().'

    '; while ($data = $DB->fetch_assoc($result)) { if ($entID != $data['entID']) { if ($entID != -1) { echo '
    '; } $entID = $data['entID']; echo "".$data['locname']."
    "; } echo ($data['name'] ? $data['name'] : "(".$data['id'].")")."
    "; } } } } } echo "
    "; if (countElementsInTable('glpi_transfers') == 0) { _e('No item found'); } else { $params = array('id' => '__VALUE__'); Ajax::updateItemOnSelectEvent("dropdown_id$rand", "transfer_form", $CFG_GLPI["root_doc"]."/ajax/transfers.php", $params); } echo "

    "; Html::showSimpleForm($CFG_GLPI["root_doc"]."/front/transfer.action.php", 'clear', __('To empty the list of elements to be transferred')); echo "
    "; echo '
    '; } else { _e('No selected element or badly defined operation'); } } } ?> glpi-0.84.3+dfsg.1/inc/user.class.php000066400000000000000000004010671226600447100171750ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ // And Marco Gaiarin for ldap features if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } class User extends CommonDBTM { // From CommonDBTM public $dohistory = true; public $history_blacklist = array('date_mod', 'date_sync', 'last_login'); // NAME FIRSTNAME ORDER TYPE const REALNAME_BEFORE = 0; const FIRSTNAME_BEFORE = 1; static function getTypeName($nb=0) { return _n('User','Users',$nb); } static function canCreate() { return Session::haveRight('user', 'w'); } static function canUpdate() { return Session::haveRight('user', 'w'); } static function canDelete() { return Session::haveRight('user', 'w'); } static function canView() { return Session::haveRight('user', 'r'); } function canViewItem() { $entities = Profile_User::getUserEntities($this->fields['id'], true); if (Session::isViewAllEntities() || Session::haveAccessToOneOfEntities($entities)) { return true; } return false; } function canCreateItem() { // Will be created from form, with selected entity/profile if (isset($this->input['_profiles_id']) && ($this->input['_profiles_id'] > 0) && Profile::currentUserHaveMoreRightThan(array($this->input['_profiles_id'])) && isset($this->input['_entities_id']) && Session::haveAccessToEntity($this->input['_entities_id'])) { return true; } // Will be created with default value if (Session::haveAccessToEntity(0) // Access to root entity (required when no default profile) || (Profile::getDefault() > 0)) { return true; } return false; } function canUpdateItem() { $entities = Profile_User::getUserEntities($this->fields['id'], false); if (Session::isViewAllEntities() || Session::haveAccessToOneOfEntities($entities)) { return true; } return false; } function canDeleteItem() { $entities = Profile_User::getUserEntities($this->fields['id'], true); if (Session::isViewAllEntities() || Session::haveAccessToAllOfEntities($entities)) { return true; } return false; } function isEntityAssign() { // glpi_users.entities_id is only a pref. return false; } /** * Compute preferences for the current user mixing config and user data **/ function computePreferences() { global $CFG_GLPI; if (isset($this->fields['id'])) { foreach ($CFG_GLPI['user_pref_field'] as $f) { if (is_null($this->fields[$f])) { $this->fields[$f] = $CFG_GLPI[$f]; } } } /// Specific case for show_count_on_tabs : global config can forbid if ($CFG_GLPI['show_count_on_tabs'] == -1) { $this->fields['show_count_on_tabs'] = 0; } } /** * Load minimal session for user * * @param $entities_id : entity to use * @param $is_recursive : load recursive entity * * @since version 0.83.7 **/ function loadMinimalSession($entities_id, $is_recursive) { global $CFG_GLPI; if (isset($this->fields['id']) && !isset($_SESSION["glpiID"])) { Session::destroy(); Session::start(); $_SESSION["glpiID"] = $this->fields['id']; $_SESSION["glpi_use_mode"] = Session::NORMAL_MODE; $_SESSION["glpiactive_entity"] = $entities_id; $_SESSION["glpiactive_entity_recursive"] = $is_recursive; if ($is_recursive) { $entities = getSonsOf("glpi_entities", $entities_id); } else { $entities = array($entities_id); } $_SESSION['glpiactiveentities'] = $entities; $_SESSION['glpiactiveentities_string'] = "'".implode("', '", $entities)."'"; $this->computePreferences(); foreach ($CFG_GLPI['user_pref_field'] as $field) { if (isset($this->fields[$field])) { $_SESSION["glpi$field"] = $this->fields[$field]; } } Session::loadGroups(); Session::loadLanguage(); } } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { switch ($item->getType()) { case __CLASS__ : $ong = array(); $ong[1] = __('Used items'); $ong[2] = __('Managed items'); return $ong; case 'Preference' : return __('Main'); } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { global $CFG_GLPI; switch ($item->getType()) { case __CLASS__ : $item->showItems($tabnum==2); return true; case 'Preference' : $user = new self(); $user->showMyForm($CFG_GLPI['root_doc']."/front/preference.php", Session::getLoginUserID()); return true; } return false; } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('Profile_User', $ong, $options); $this->addStandardTab('Group_User', $ong, $options); $this->addStandardTab('Config', $ong, $options); $this->addStandardTab(__CLASS__, $ong, $options); $this->addStandardTab('Ticket', $ong, $options); $this->addStandardTab('Document_Item', $ong, $options); $this->addStandardTab('Reservation', $ong, $options); $this->addStandardTab('Auth', $ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } function post_getEmpty() { global $CFG_GLPI; $this->fields["is_active"] = 1; if (isset($CFG_GLPI["language"])) { $this->fields['language'] = $CFG_GLPI["language"]; } else { $this->fields['language'] = "en_GB"; } } function pre_deleteItem() { global $DB; $entities = Profile_User::getUserEntities($this->fields["id"]); $view_all = Session::isViewAllEntities(); // Have right on all entities ? $all = true; if (!$view_all) { foreach ($entities as $ent) { if (!Session::haveAccessToEntity($ent)) { $all = false; } } } if ($all) { // Mark as deleted return true; } // only delete profile foreach ($entities as $ent) { if (Session::haveAccessToEntity($ent)) { $all = false; $query = "DELETE FROM `glpi_profiles_users` WHERE `users_id` = '".$this->fields["id"]."' AND `entities_id` = '$ent'"; $DB->query($query); } return false; } } function cleanDBonMarkDeleted() { } function cleanDBonPurge() { global $DB; $query = "DELETE FROM `glpi_profiles_users` WHERE `users_id` = '".$this->fields['id']."'"; $DB->query($query); if ($this->fields['id'] > 0) { // Security $query = "DELETE FROM `glpi_displaypreferences` WHERE `users_id` = '".$this->fields['id']."'"; $DB->query($query); $query = "DELETE FROM `glpi_bookmarks_users` WHERE `users_id` = '".$this->fields['id']."'"; $DB->query($query); } // Delete own reminders $query = "DELETE FROM `glpi_reminders` WHERE `users_id` = '".$this->fields['id']."'"; $DB->query($query); // Delete private bookmark $query = "DELETE FROM `glpi_bookmarks` WHERE `users_id` = '".$this->fields['id']."' AND `is_private` = '1'"; $DB->query($query); // Set no user to public bookmark $query = "UPDATE `glpi_bookmarks` SET `users_id` = '0' WHERE `users_id` = '".$this->fields['id']."'"; $DB->query($query); // Set no user to consumables $query = "UPDATE `glpi_consumables` SET `items_id` = '0' WHERE `items_id` = '".$this->fields['id']."' AND `itemtype` = 'User'"; $DB->query($query); $gu = new Group_User(); $gu->cleanDBonItemDelete($this->getType(), $this->fields['id']); $tu = new Ticket_User(); $tu->cleanDBonItemDelete($this->getType(), $this->fields['id']); $pu = new Problem_User(); $pu->cleanDBonItemDelete($this->getType(), $this->fields['id']); $kiu = new KnowbaseItem_User(); $kiu->cleanDBonItemDelete($this->getType(), $this->fields['id']); $ru = new Reminder_User(); $ru->cleanDBonItemDelete($this->getType(), $this->fields['id']); $ue = new UserEmail(); $ue->deleteByCriteria(array('users_id' => $this->fields['id'])); // Ticket rules use various _users_id_* Rule::cleanForItemAction($this, '_users_id%'); Rule::cleanForItemCriteria($this, '_users_id%'); } /** * Retrieve an item from the database using its login * * @param $name login of the user * * @return true if succeed else false **/ function getFromDBbyName($name) { return $this->getFromDBByQuery("WHERE `".$this->getTable()."`.`name` = '$name'"); } /** * Retrieve an item from the database using it's dn * * @since version 0.84 * * @param $user_dn dn of the user * * @return true if succeed else false **/ function getFromDBbyDn($user_dn) { return $this->getFromDBByQuery("WHERE `".$this->getTable()."`.`user_dn` = '$user_dn'"); } /** * Retrieve an item from the database using its email * * @param $email string user email * @param $condition string add condition * * @return true if succeed else false **/ function getFromDBbyEmail($email, $condition) { $request = "LEFT JOIN `glpi_useremails` ON (`glpi_useremails`.`users_id` = `".$this->getTable()."`.`id`) WHERE `glpi_useremails`.`email` = '$email'"; if (!empty($condition)) { $request .= " AND $condition"; } return $this->getFromDBByQuery($request); } /** * Get the default email of the user * * @return default user email **/ function getDefaultEmail() { if (!isset($this->fields['id'])) { return ''; } return UserEmail::getDefaultForUser($this->fields['id']); } /** * Get all emails of the user * * @return array of emails **/ function getAllEmails() { if (!isset($this->fields['id'])) { return ''; } return UserEmail::getAllForUser($this->fields['id']); } /** * Is the email set to the current user * * @param $email * * @return boolean is an email of the user **/ function isEmail($email) { if (!isset($this->fields['id'])) { return false; } return UserEmail::isEmailForUser($this->fields['id'], $email); } /** * Retrieve an item from the database using its personal token * * @param $token user token * * @return true if succeed else false **/ function getFromDBbyToken($token) { return $this->getFromDBByQuery("WHERE `".$this->getTable()."`.`personal_token` = '$token'"); } function prepareInputForAdd($input) { global $DB; if (isset($input['_stop_import'])) { return false; } // Check if user does not exists $query = "SELECT * FROM `".$this->getTable()."` WHERE `name` = '".$input['name']."'"; $result = $DB->query($query); if ($DB->numrows($result) > 0) { Session::addMessageAfterRedirect(__('Unable to add. The user already exists.'), false, ERROR); return false; } if (isset($input["password2"])) { if (empty($input["password"])) { unset ($input["password"]); } else { if ($input["password"] == $input["password2"]) { if (Config::validatePassword($input["password"])) { $input["password"] = sha1(Toolbox::unclean_cross_side_scripting_deep(stripslashes($input["password"]))); } else { unset($input["password"]); } unset($input["password2"]); } else { Session::addMessageAfterRedirect(__('Error: the two passwords do not match'), false, ERROR); return false; } } } if (isset($input["_extauth"])) { $input["password"] = ""; } // Force DB default values : not really needed if (!isset($input["is_active"])) { $input["is_active"] = 1; } if (!isset($input["is_deleted"])) { $input["is_deleted"] = 0; } if (!isset($input["entities_id"])) { $input["entities_id"] = 0; } if (!isset($input["profiles_id"])) { $input["profiles_id"] = 0; } if (!isset($input["authtype"])) { $input["authtype"] = 0; } return $input; } function post_addItem() { // add emails (use _useremails set from UI, not _emails set from LDAP) if (isset($this->input['_useremails']) && count($this->input['_useremails'])) { $useremail = new UserEmail(); foreach ($this->input['_useremails'] as $id => $email) { $email = trim($email); $email_input = array('email' => $email, 'users_id' => $this->getID()); if (isset($this->input['_default_email']) && ($this->input['_default_email'] == $id)) { $email_input['is_default'] = 1; } else { $email_input['is_default'] = 0; } $useremail->add($email_input); } } $this->syncLdapGroups(); $this->syncDynamicEmails(); $rulesplayed = $this->applyRightRules(); // Add default profile if (!$rulesplayed) { $affectation = array(); if (isset($this->input['_profiles_id']) && $this->input['_profiles_id']) { $profile = $this->input['_profiles_id']; // Choosen in form, so not dynamic $affectation['is_dynamic'] = 0; } else { $profile = Profile::getDefault(); // Default right as dynamic. If dynamic rights are set it will disappear. $affectation['is_dynamic'] = 1; } if ($profile) { if (isset($this->input["_entities_id"])) { // entities_id (user's pref) always set in prepareInputForAdd // use _entities_id for default right $affectation["entities_id"] = $this->input["_entities_id"]; } else if (isset($_SESSION['glpiactive_entity'])) { $affectation["entities_id"] = $_SESSION['glpiactive_entity']; } else { $affectation["entities_id"] = 0; } if (isset($this->input["_is_recursive"])) { $affectation["is_recursive"] = $this->input["_is_recursive"]; } else { $affectation["is_recursive"] = 0; } $affectation["profiles_id"] = $profile; $affectation["users_id"] = $this->fields["id"]; $right = new Profile_User(); $right->add($affectation); } } } function prepareInputForUpdate($input) { global $CFG_GLPI; if (isset($input["password2"])) { // Empty : do not update if (empty($input["password"])) { unset($input["password"]); } else { if ($input["password"] == $input["password2"]) { // Check right : my password of user with lesser rights if (isset($input['id']) && Config::validatePassword($input["password"]) && (($input['id'] == Session::getLoginUserID()) || $this->currentUserHaveMoreRightThan($input['id']) || (($input['password_forget_token'] == $this->fields['password_forget_token']) // Permit to change password with token and email && (abs(strtotime($_SESSION["glpi_currenttime"]) -strtotime($this->fields['password_forget_token_date'])) < DAY_TIMESTAMP) && $this->isEmail($input['email'])))) { $input["password"] = sha1(Toolbox::unclean_cross_side_scripting_deep(stripslashes($input["password"]))); } else { unset($input["password"]); } unset($input["password2"]); } else { Session::addMessageAfterRedirect(__('Error: the two passwords do not match'), false, ERROR); return false; } } } else if (isset($input["password"])) { // From login unset($input["password"]); } // Update User in the database if (!isset($input["id"]) && isset($input["name"])) { if ($this->getFromDBbyName($input["name"])) { $input["id"] = $this->fields["id"]; } } if (isset($input["entities_id"]) && (Session::getLoginUserID() === $input['id'])) { $_SESSION["glpidefault_entity"] = $input["entities_id"]; } // Security on default profile update if (isset($input['profiles_id'])) { if (!in_array($input['profiles_id'], Profile_User::getUserProfiles($input['id']))) { unset($input['profiles_id']); } } // Security on default entity update if (isset($input['entities_id'])) { if (!in_array($input['entities_id'], Profile_User::getUserEntities($input['id']))) { unset($input['entities_id']); } } if (isset($input['_reset_personal_token'])) { $input['personal_token'] = self::getUniquePersonalToken(); $input['personal_token_date'] = $_SESSION['glpi_currenttime']; } // Manage preferences fields if (Session::getLoginUserID() === $input['id']) { if (isset($input['use_mode']) && ($_SESSION['glpi_use_mode'] != $input['use_mode'])) { $_SESSION['glpi_use_mode'] = $input['use_mode']; //Session::loadLanguage(); } } foreach ($CFG_GLPI['user_pref_field'] as $f) { if (isset($input[$f])) { if (Session::getLoginUserID() === $input['id']) { if ($_SESSION["glpi$f"] != $input[$f]) { $_SESSION["glpi$f"] = $input[$f]; } } if ($input[$f] == $CFG_GLPI[$f]) { $input[$f] = "NULL"; } } } return $input; } function post_updateItem($history=1) { // Update emails (use _useremails set from UI, not _emails set from LDAP) if (isset($this->input['_useremails']) && count($this->input['_useremails'])) { $useremail = new UserEmail(); foreach ($this->input['_useremails'] as $id => $email) { $email = trim($email); // existing email if ($id > 0) { $params = array('id' => $id); // empty email : delete if (strlen($email) == 0) { $useremail->delete($params); } else { // Update email $params['email'] = $email; if ($this->input['_default_email'] == $id) { $params['is_default'] = 1; } $useremail->update($params); } } else { // New email $email_input = array('email' => $email, 'users_id' => $this->getID()); if (isset($this->input['_default_email']) && ($this->input['_default_email'] == $id)) { $email_input['is_default'] = 1; } else { $email_input['is_default'] = 0; } $useremail->add($email_input); } } } $this->syncLdapGroups(); $this->syncDynamicEmails(); $this->applyRightRules(); } // SPECIFIC FUNCTIONS /** * Apply rules to determine dynamic rights of the user * * @return boolean : true if we play the Rule Engine **/ function applyRightRules() { global $DB; $return = false; if ((isset($this->fields['_ruleright_process']) || isset($this->input['_ruleright_process'])) // Add after a getFromLDAP && isset($this->fields["authtype"]) && (($this->fields["authtype"] == Auth::LDAP) || ($this->fields["authtype"] == Auth::MAIL) || Auth::isAlternateAuth($this->fields["authtype"]))) { $dynamic_profiles = Profile_User::getForUser($this->fields["id"], true); if (isset($this->fields["id"]) && ($this->fields["id"] > 0) && isset($this->input["_ldap_rules"]) && count($this->input["_ldap_rules"])) { //and add/update/delete only if it's necessary ! if (isset($this->input["_ldap_rules"]["rules_entities_rights"])) { $entities_rules = $this->input["_ldap_rules"]["rules_entities_rights"]; } else { $entities_rules = array(); } if (isset($this->input["_ldap_rules"]["rules_entities"])) { $entities = $this->input["_ldap_rules"]["rules_entities"]; } else { $entities = array(); } if (isset($this->input["_ldap_rules"]["rules_rights"])) { $rights = $this->input["_ldap_rules"]["rules_rights"]; } else { $rights = array(); } $retrieved_dynamic_profiles = array(); //For each affectation -> write it in DB foreach ($entities_rules as $entity) { //Multiple entities assignation if (is_array($entity[0])) { foreach ($entity[0] as $tmp => $ent) { $affectation['entities_id'] = $ent; $affectation['profiles_id'] = $entity[1]; $affectation['is_recursive'] = $entity[2]; $affectation['users_id'] = $this->fields['id']; $affectation['is_dynamic'] = 1; $retrieved_dynamic_profiles[] = $affectation; } } else { $affectation['entities_id'] = $entity[0]; $affectation['profiles_id'] = $entity[1]; $affectation['is_recursive'] = $entity[2]; $affectation['users_id'] = $this->fields['id']; $affectation['is_dynamic'] = 1; $retrieved_dynamic_profiles[] = $affectation; } } if ((count($entities) > 0) && (count($rights) == 0)) { if ($def_prof = Profile::getDefault()) { $rights[] = $def_prof; } } if ((count($rights) > 0) && (count($entities) > 0)) { foreach ($rights as $right) { foreach ($entities as $entity) { $affectation['entities_id'] = $entity[0]; $affectation['profiles_id'] = $right; $affectation['users_id'] = $this->fields['id']; $affectation['is_recursive'] = $entity[1]; $affectation['is_dynamic'] = 1; $retrieved_dynamic_profiles[] = $affectation; } } } // Compare retrived profiles to existing ones : clean arrays to do purge and add if (count($retrieved_dynamic_profiles)) { foreach ($retrieved_dynamic_profiles as $keyretr => $retr_profile) { $found = false; foreach ($dynamic_profiles as $keydb => $db_profile) { // Found existing profile : unset values in array if (!$found && ($db_profile['entities_id'] == $retr_profile['entities_id']) && ($db_profile['profiles_id'] == $retr_profile['profiles_id']) && ($db_profile['is_recursive'] == $retr_profile['is_recursive'])) { unset($retrieved_dynamic_profiles[$keyretr]); unset($dynamic_profiles[$keydb]); } } } } // Add new dynamic profiles if (count($retrieved_dynamic_profiles)) { $right = new Profile_User(); foreach ($retrieved_dynamic_profiles as $keyretr => $retr_profile) { $right->add($retr_profile); } } //Unset all the temporary tables unset($this->input["_ldap_rules"]); $return = true; } // Delete old dynamic profiles if (count($dynamic_profiles)) { $right = new Profile_User(); foreach ($dynamic_profiles as $keydb => $db_profile) { $right->delete($db_profile); } } } return $return; } /** * Synchronise LDAP group of the user **/ function syncLdapGroups() { global $DB; // input["_groups"] not set when update from user.form or preference if (isset($this->fields["authtype"]) && isset($this->input["_groups"]) && (($this->fields["authtype"] == Auth::LDAP) || Auth::isAlternateAuth($this->fields['authtype']))) { if (isset($this->fields["id"]) && ($this->fields["id"] > 0)) { $authtype = Auth::getMethodsByID($this->fields["authtype"], $this->fields["auths_id"]); if (count($authtype)) { // Clean groups $this->input["_groups"] = array_unique ($this->input["_groups"]); // Delete not available groups like to LDAP $query = "SELECT `glpi_groups_users`.`id`, `glpi_groups_users`.`groups_id`, `glpi_groups_users`.`is_dynamic` FROM `glpi_groups_users` LEFT JOIN `glpi_groups` ON (`glpi_groups`.`id` = `glpi_groups_users`.`groups_id`) WHERE `glpi_groups_users`.`users_id` = '" . $this->fields["id"] . "'"; $result = $DB->query($query); $groupuser = new Group_User(); if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { if (in_array($data["groups_id"], $this->input["_groups"])) { // Delete found item in order not to add it again unset($this->input["_groups"][array_search($data["groups_id"], $this->input["_groups"])]); } else if ($data['is_dynamic']) { $groupuser->delete(array('id' => $data["id"])); } } } //If the user needs to be added to one group or more if (count($this->input["_groups"]) > 0) { foreach ($this->input["_groups"] as $group) { $groupuser->add(array('users_id' => $this->fields["id"], 'groups_id' => $group, 'is_dynamic' => 1)); } unset ($this->input["_groups"]); } } } } } /** * Synchronise Dynamics emails of the user * * Use _emails (set from getFromLDAP), not _usermails set from UI **/ function syncDynamicEmails() { global $DB; // input["_emails"] not set when update from user.form or preference if (isset($this->fields["authtype"]) && isset($this->input["_emails"]) && (($this->fields["authtype"] == Auth::LDAP) || Auth::isAlternateAuth($this->fields['authtype']) || ($this->fields["authtype"] == Auth::MAIL))) { if (isset($this->fields["id"]) && ($this->fields["id"] > 0)) { $authtype = Auth::getMethodsByID($this->fields["authtype"], $this->fields["auths_id"]); if (count($authtype) || $this->fields["authtype"] == Auth::EXTERNAL) { // Clean emails $this->input["_emails"] = array_unique ($this->input["_emails"]); // Delete not available groups like to LDAP $query = "SELECT `glpi_useremails`.`id`, `glpi_useremails`.`users_id`, `glpi_useremails`.`email`, `glpi_useremails`.`is_dynamic` FROM `glpi_useremails` WHERE `glpi_useremails`.`users_id` = '" . $this->fields["id"] . "'"; $result = $DB->query($query); $useremail = new UserEmail(); if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { $i = array_search($data["email"], $this->input["_emails"]); if ($i !== false) { // Delete found item in order not to add it again unset($this->input["_emails"][$i]); } else if ($data['is_dynamic']) { // Delete not found email $useremail->delete(array('id' => $data["id"])); } } } //If the email need to be added if (count($this->input["_emails"]) > 0) { foreach ($this->input["_emails"] as $email) { $useremail->add(array('users_id' => $this->fields["id"], 'email' => $email, 'is_dynamic' => 1)); } unset ($this->input["_emails"]); } } } } } /** * @see CommonDBTM::getName() **/ function getName($options=array()) { if (isset($this->fields["id"]) && ($this->fields["id"] > 0)) { return formatUserName($this->fields["id"], $this->fields["name"], (isset($this->fields["realname"]) ? $this->fields["realname"] : ''), (isset($this->fields["firstname"]) ? $this->fields["firstname"] : '')); } return NOT_AVAILABLE; } /** * Function that try to load from LDAP the user membership * by searching in the attribute of the User * * @param $ldap_connection ldap connection descriptor * @param $ldap_method LDAP method * @param $userdn Basedn of the user * @param $login User login * * @return String : basedn of the user / false if not founded **/ private function getFromLDAPGroupVirtual($ldap_connection, $ldap_method, $userdn, $login) { global $DB; // Search in DB the ldap_field we need to search for in LDAP $query = "SELECT DISTINCT `ldap_field` FROM `glpi_groups` WHERE `ldap_field` != '' ORDER BY `ldap_field`"; $group_fields = array(); foreach ($DB->request($query) as $data) { $group_fields[] = Toolbox::strtolower($data["ldap_field"]); } if (count($group_fields)) { //Need to sort the array because edirectory don't like it! sort($group_fields); // If the groups must be retrieve from the ldap user object $sr = @ ldap_read($ldap_connection, $userdn, "objectClass=*", $group_fields); $v = AuthLDAP::get_entries_clean($ldap_connection, $sr); for ($i=0 ; $i 0)) { $query = "SELECT `id` FROM `glpi_groups` WHERE `ldap_group_dn` IN ('".implode("', '", Toolbox::addslashes_deep($v[$i]['ou']))."')"; foreach ($DB->request($query) as $group) { $this->fields["_groups"][] = $group['id']; } } // searching with ldap_field='OU' and ldap_value is also possible $v[$i]['ou']['count'] = count($v[$i]['ou']); } // For each attribute retrieve from LDAP, search in the DB foreach ($group_fields as $field) { if (isset($v[$i][$field]) && isset($v[$i][$field]['count']) && ($v[$i][$field]['count'] > 0)) { unset($v[$i][$field]['count']); $query = "SELECT `id` FROM `glpi_groups` WHERE `ldap_field` = '$field' AND `ldap_value` IN ('".implode("', '", Toolbox::addslashes_deep($v[$i][$field]))."')"; foreach ($DB->request($query) as $group) { $this->fields["_groups"][] = $group['id']; } } } } // for each ldapresult } // count($group_fields) } /** * Function that try to load from LDAP the user membership * by searching in the attribute of the Groups * * @param $ldap_connection ldap connection descriptor * @param $ldap_method LDAP method * @param $userdn Basedn of the user * @param $login User login * * @return nothing : false if not applicable **/ private function getFromLDAPGroupDiscret($ldap_connection, $ldap_method, $userdn, $login) { global $DB; // No group_member_field : unable to get group if (empty($ldap_method["group_member_field"])) { return false; } if ($ldap_method["use_dn"]) { $user_tmp = $userdn; } else { //Don't add $ldap_method["login_field"]."=", because sometimes it may not work (for example with posixGroup) $user_tmp = $login; } $v = $this->ldap_get_user_groups($ldap_connection, $ldap_method["basedn"], $user_tmp, $ldap_method["group_condition"], $ldap_method["group_member_field"], $ldap_method["use_dn"], $ldap_method["login_field"]); foreach ($v as $result) { if (isset($result[$ldap_method["group_member_field"]]) && is_array($result[$ldap_method["group_member_field"]]) && (count($result[$ldap_method["group_member_field"]]) > 0)) { $query = "SELECT `id` FROM `glpi_groups` WHERE `ldap_group_dn` IN ('".implode("', '", Toolbox::addslashes_deep($result[$ldap_method["group_member_field"]]))."')"; foreach ($DB->request($query) as $group) { $this->fields["_groups"][] = $group['id']; } } } return true; } /** * Function that try to load from LDAP the user information... * * @param $ldap_connection ldap connection descriptor * @param $ldap_method LDAP method * @param $userdn Basedn of the user * @param $login User Login * @param $import boolean true for import, false for update (true by default) * * @return boolean : true if found / false if not founded **/ function getFromLDAP($ldap_connection, $ldap_method, $userdn, $login, $import=true) { global $DB, $CFG_GLPI; // we prevent some delay... if (empty($ldap_method["host"])) { return false; } if ($ldap_connection) { //Set all the search fields $this->fields['password'] = ""; $fields = AuthLDAP::getSyncFields($ldap_method); //Hook to allow plugin to request more attributes from ldap $fields = Plugin::doHookFunction("retrieve_more_field_from_ldap", $fields); $fields = array_filter($fields); $f = array_values($fields); $sr = @ ldap_read($ldap_connection, $userdn, "objectClass=*", $f); $v = AuthLDAP::get_entries_clean($ldap_connection, $sr); if (!is_array($v) || ( count($v) == 0) || empty($v[0][$fields['name']][0])) { return false; } //Store user's dn $this->fields['user_dn'] = addslashes($userdn); //Store date_sync $this->fields['date_sync'] = $_SESSION['glpi_currenttime']; // Empty array to ensure than syncDynamicEmails will be done $this->fields["_emails"] = array(); foreach ($fields as $k => $e) { if (empty($v[0][$e][0])) { switch ($k) { case "language" : // Not set value : managed but user class break; case "usertitles_id" : case "usercategories_id" : $this->fields[$k] = 0; break; default : $this->fields[$k] = ""; } } else { switch ($k) { case "email1" : case "email2" : case "email3" : case "email4" : // Manage multivaluable fields if (!empty($v[0][$e])) { foreach ($v[0][$e] as $km => $m) { if (!preg_match('/count/',$km)) { $this->fields["_emails"][] = addslashes($m); } } // Only get them once if duplicated $this->fields["_emails"] = array_unique($this->fields["_emails"]); } break; case "language" : $language = Config::getLanguage($v[0][$e][0]); if ($language != '') { $this->fields[$k] = $language; } break; case "usertitles_id" : $this->fields[$k] = Dropdown::importExternal('UserTitle', addslashes($v[0][$e][0])); break; case "usercategories_id" : $this->fields[$k] = Dropdown::importExternal('UserCategory', addslashes($v[0][$e][0])); break; default : if (!empty($v[0][$e][0])) { $this->fields[$k] = addslashes($v[0][$e][0]); } else { $this->fields[$k] = ""; } } } } // Empty array to ensure than syncLdapGroups will be done $this->fields["_groups"] = array(); ///The groups are retrieved by looking into an ldap user object if (($ldap_method["group_search_type"] == 0) || ($ldap_method["group_search_type"] == 2)) { $this->getFromLDAPGroupVirtual($ldap_connection, $ldap_method, $userdn, $login); } ///The groups are retrived by looking into an ldap group object if (($ldap_method["group_search_type"] == 1) || ($ldap_method["group_search_type"] == 2)) { $this->getFromLDAPGroupDiscret($ldap_connection, $ldap_method, $userdn, $login); } ///Only process rules if working on the master database if (!$DB->isSlave()) { //Instanciate the affectation's rule $rule = new RuleRightCollection(); //Process affectation rules : //we don't care about the function's return because all //the datas are stored in session temporary if (isset($this->fields["_groups"])) { $groups = $this->fields["_groups"]; } else { $groups = array(); } $this->fields = $rule->processAllRules($groups, Toolbox::stripslashes_deep($this->fields), array('type' => 'LDAP', 'ldap_server' => $ldap_method["id"], 'connection' => $ldap_connection, 'userdn' => $userdn)); $this->fields['_ruleright_process'] = true; //If rule action is ignore import if ($import && isset($this->fields["_stop_import"])) { return false; } //or no rights found & do not import users with no rights if ($import && !$CFG_GLPI["use_noright_users_add"]) { $ok = false; if (isset($this->fields["_ldap_rules"]) && count($this->fields["_ldap_rules"])) { if (isset($this->fields["_ldap_rules"]["rules_entities_rights"]) && count($this->fields["_ldap_rules"]["rules_entities_rights"])) { $ok = true; } if (!$ok) { $entity_count = 0; $right_count = 0; if (Profile::getDefault()) { $right_count++; } if (isset($this->fields["_ldap_rules"]["rules_entities"])) { $entity_count += count($this->fields["_ldap_rules"]["rules_entities"]); } if (isset($this->input["_ldap_rules"]["rules_rights"])) { $right_count += count($this->fields["_ldap_rules"]["rules_rights"]); } if ($entity_count && $right_count) { $ok = true; } } } if (!$ok) { $this->fields["_stop_import"] = true; return false; } } // Add ldap result to data send to the hook $this->fields['_ldap_result'] = $v; $this->fields['_ldap_conn'] = $ldap_connection; //Hook to retrieve more information for ldap $this->fields = Plugin::doHookFunction("retrieve_more_data_from_ldap", $this->fields); unset($this->fields['_ldap_result']); } return true; } return false; } // getFromLDAP() /** * Get all groups a user belongs to * * @param $ds ldap connection * @param $ldap_base_dn Basedn used * @param $user_dn Basedn of the user * @param $group_condition group search condition * @param $group_member_field group field member in a user object * @param $use_dn boolean search dn of user ($login_field=$user_dn) in group_member_field * @param $login_field string user login field * * @return String : basedn of the user / false if not founded **/ function ldap_get_user_groups($ds, $ldap_base_dn, $user_dn, $group_condition, $group_member_field, $use_dn, $login_field) { $groups = array(); $listgroups = array(); //User dn may contain ( or ), need to espace it! $user_dn = str_replace(array("(", ")", "\,", "\+"), array("\(", "\)", "\\\,", "\\\+"), $user_dn); //Only retrive cn and member attributes from groups $attrs = array('dn'); if (!$use_dn) { $filter = "(& $group_condition (|($group_member_field=$user_dn) ($group_member_field=$login_field=$user_dn)))"; } else { $filter = "(& $group_condition ($group_member_field=$user_dn))"; } //Perform the search $sr = ldap_search($ds, $ldap_base_dn, $filter, $attrs); //Get the result of the search as an array $info = AuthLDAP::get_entries_clean($ds, $sr); //Browse all the groups for ($i = 0 ; $i < count($info) ; $i++) { //Get the cn of the group and add it to the list of groups if (isset($info[$i]["dn"]) && ($info[$i]["dn"] != '')) { $listgroups[$i] = $info[$i]["dn"]; } } //Create an array with the list of groups of the user $groups[0][$group_member_field] = $listgroups; //Return the groups of the user return $groups; } /** * Function that try to load from IMAP the user information... * * @param $mail_method mail method description array * @param $name login of the user **/ function getFromIMAP($mail_method, $name) { global $DB; // we prevent some delay.. if (empty($mail_method["host"])) { return false; } // some defaults... $this->fields['password'] = ""; // Empty array to ensure than syncDynamicEmails will be done $this->fields["_emails"] = array(); $email = ''; if (strpos($name,"@")) { $email = $name; } else { $email = $name . "@" . $mail_method["host"]; } $this->fields["_emails"][] = $email; $this->fields['name'] = $name; //Store date_sync $this->fields['date_sync'] = $_SESSION['glpi_currenttime']; if (!$DB->isSlave()) { //Instanciate the affectation's rule $rule = new RuleRightCollection(); //Process affectation rules : //we don't care about the function's return because all the datas are stored in session temporary if (isset($this->fields["_groups"])) { $groups = $this->fields["_groups"]; } else { $groups = array(); } $this->fields = $rule->processAllRules($groups, Toolbox::stripslashes_deep($this->fields), array('type' => 'MAIL', 'mail_server' => $mail_method["id"], 'email' => $email)); $this->fields['_ruleright_process'] = true; } return true; } // getFromIMAP() /** * Function that try to load from the SSO server the user information... * * @since version 0.84 **/ function getFromSSO() { global $DB, $CFG_GLPI; $a_field = array(); foreach ($CFG_GLPI as $key=>$value) { if (!is_array($value) && !empty($value) && strstr($key, "_ssofield")) { $key = str_replace('_ssofield', '', $key); $a_field[$key] = $value; } } if (count($a_field) == 0) { return true; } $this->fields['_ruleright_process'] = true; foreach ($a_field as $field=>$value) { if (!isset($_SERVER[$value]) || empty($_SERVER[$value])) { switch ($field) { case "title" : $this->fields['usertitles_id'] = 0; break; case "category" : $this->fields['usercategories_id'] = 0; break; default : $this->fields[$field] = ""; } } else { switch ($field) { case "email1" : case "email2" : case "email3" : case "email4" : // Manage multivaluable fields if (!preg_match('/count/',$_SERVER[$value])) { $this->fields["_emails"][] = addslashes($_SERVER[$value]); } // Only get them once if duplicated $this->fields["_emails"] = array_unique($this->fields["_emails"]); break; case "language" : $language = Config::getLanguage($_SERVER[$value]); if ($language != '') { $this->fields[$field] = $language; } break; case "title" : $this->fields['usertitles_id'] = Dropdown::importExternal('UserTitle', addslashes($_SERVER[$value])); break; case "category" : $this->fields['usercategories_id'] = Dropdown::importExternal('UserCategory', addslashes($_SERVER[$value])); break; default : $this->fields[$field] = $_SERVER[$value]; break; } } } ///Only process rules if working on the master database if (!$DB->isSlave()) { //Instanciate the affectation's rule $rule = new RuleRightCollection(); $this->fields = $rule->processAllRules(array(), Toolbox::stripslashes_deep($this->fields), array('type' => 'SSO', 'email' => $this->fields["_emails"], 'login' => $this->fields["name"])); //If rule action is ignore import if (isset($this->fields["_stop_import"])) { return false; } } return true; } /** * Blank passwords field of a user in the DB * needed for external auth users **/ function blankPassword() { global $DB; if (!empty($this->fields["name"])) { $query = "UPDATE `".$this->getTable()."` SET `password` = '' WHERE `name` = '" . $this->fields["name"] . "'"; $DB->query($query); } } /** * Print a good title for user pages * * @return nothing (display) **/ function title() { global $CFG_GLPI; $buttons = array(); $title = self::getTypeName(2); if (static::canCreate()) { $buttons["user.form.php"] = __('Add user...'); $title = ""; if (Auth::useAuthExt()) { // This requires write access because don't use entity config. $buttons["user.form.php?new=1&ext_auth=1"] = __('... From an external source'); } } if (Session::haveRight("import_externalauth_users", "w")) { if (AuthLdap::useAuthLdap()) { $buttons["ldap.php"] = __('LDAP directory link'); } } Html::displayTitle($CFG_GLPI["root_doc"] . "/pics/users.png", self::getTypeName(2), $title, $buttons); } /** * Is the specified user have more right than the current one ? * * @param $ID integer : Id of the user * * @return boolean : true if currrent user have the same right or more right **/ function currentUserHaveMoreRightThan($ID) { $user_prof = Profile_User::getUserProfiles($ID); return Profile::currentUserHaveMoreRightThan($user_prof); } /** * Print the user form * * @param $ID integer : Id of the user * @param $options array * - target form target * - withtemplate boolean : template or basic item * * @return boolean : user found **/ function showForm($ID, $options=array()) { global $CFG_GLPI; // Affiche un formulaire User if (($ID != Session::getLoginUserID()) && !Session::haveRight("user", "r")) { return false; } $this->initForm($ID, $options); if ($ID) { $caneditpassword = $this->currentUserHaveMoreRightThan($ID); } else { // can edit on creation form $caneditpassword = true; } $extauth = !(($this->fields["authtype"] == Auth::DB_GLPI) || (($this->fields["authtype"] == Auth::NOT_YET_AUTHENTIFIED) && !empty($this->fields["password"]))); $this->showTabs($options); $this->showFormHeader($options); echo ""; echo "" . __('Login') . ""; // si on est dans le cas d'un ajout , cet input ne doit plus etre hidden if ($this->fields["name"] == "") { echo "fields["name"] . "\">"; // si on est dans le cas d'un modif on affiche la modif du login si ce n'est pas une auth externe } else { if (!empty($this->fields["password"]) || ($this->fields["authtype"] == Auth::DB_GLPI)) { echo ""; echo "fields["name"] . "\">"; } else { echo "" . $this->fields["name"]; echo "fields["name"] . "\">"; } echo ""; } //do some rights verification if (Session::haveRight("user", "w") && (!$extauth || empty($ID)) && $caneditpassword) { echo "" . __('Password').""; echo ""; echo ""; } else { echo " "; } echo ""; echo "" . __('Surname') . ""; Html::autocompletionTextField($this,"realname"); echo ""; //do some rights verification if (Session::haveRight("user", "w") && (!$extauth || empty($ID)) && $caneditpassword) { echo "" . __('Password confirmation') . ""; echo ""; echo ""; } else { echo " "; } echo ""; echo "" . __('First name') . ""; Html::autocompletionTextField($this, "firstname"); echo ""; if (Session::haveRight("user", "w") && (!$extauth || empty($ID)) && $caneditpassword) { echo "".__('Password security policy').""; echo ""; Config::displayPasswordSecurityChecks(); echo ""; } else { echo " "; } echo ""; echo ""; echo "" . _n('Email','Emails',2); UserEmail::showAddEmailButton($this); echo ""; UserEmail::showForUser($this); echo ""; //Authentications information : auth method used and server used //don't display is creation of a new user' if (!empty($ID)) { if (Session::haveRight("user_authtype", "r")) { echo "" . __('Authentication') . ""; echo Auth::getMethodName($this->fields["authtype"], $this->fields["auths_id"]); if (!empty($this->fields["date_sync"])) { //TRANS: %s is the date of last sync echo '
    '.sprintf(__('Last synchronization on %s'), HTML::convDateTime($this->fields["date_sync"])); } if (!empty($this->fields["user_dn"])) { //TRANS: %s is the user dn echo '
    '.sprintf(__('%1$s: %2$s'), __('User DN'), $this->fields["user_dn"]); } echo ""; } else { echo " "; } } else { echo ""; } echo ""; echo ""; echo "" . __('Phone') . ""; Html::autocompletionTextField($this, "phone"); echo ""; echo "".__('Active').""; Dropdown::showYesNo('is_active',$this->fields['is_active']); echo ""; echo ""; echo "" . __('Mobile phone') . ""; Html::autocompletionTextField($this, "mobile"); echo ""; echo "" . __('Category') . ""; UserCategory::dropdown(array('value' => $this->fields["usercategories_id"])); echo ""; echo ""; echo "" . __('Phone 2') . ""; Html::autocompletionTextField($this, "phone2"); echo ""; echo "" . __('Comments') . ""; echo ""; echo ""; echo ""; echo "" . __('Administrative number') . ""; Html::autocompletionTextField($this, "registration_number"); echo ""; echo "" . _x('person','Title') . " :"; UserTitle::dropdown(array('value' => $this->fields["usertitles_id"])); echo ""; echo "" . __('Location') . ""; if (!empty($ID)) { $entities = Profile_User::getUserEntities($ID, true); if (count($entities) > 0) { Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $entities)); } else { echo " "; } } else { if (!Session::isMultiEntitiesMode()) { // Display all locations : only one entity Location::dropdown(array('value' => $this->fields["locations_id"])); } else { echo " "; } } echo ""; if (empty($ID)) { echo ""; echo "" . __('Profile') . ""; Profile::dropdownUnder(array('name' => '_profiles_id', 'value' => Profile::getDefault())); echo "" . __('Entity') . ""; Entity::dropdown(array('name' => '_entities_id', 'display_emptychoice' => false, 'entity' => $_SESSION['glpiactiveentities'])); echo ""; } else { if ($caneditpassword) { echo ""; echo "" . __('Default profile') . ""; $options[0] = Dropdown::EMPTY_VALUE; $options += Dropdown::getDropdownArrayNames('glpi_profiles', Profile_User::getUserProfiles($this->fields['id'])); Dropdown::showFromArray("profiles_id", $options, array('value' => $this->fields["profiles_id"])); echo "" . __('Default entity') . ""; $entities = Profile_User::getUserEntities($this->fields['id'],1); Entity::dropdown(array('value' => $this->fields["entities_id"], 'entity' => $entities)); echo ""; } echo ""; echo "" ; //TRANS: %s is the date printf(__('Last update on %s'), HTML::convDateTime($this->fields["date_mod"])); echo "
    "; printf(__('Last login on %s'), HTML::convDateTime($this->fields["last_login"])); echo ""; if ($ID > 0) { echo "". __('Vcard').""; } echo ""; } $this->showFormButtons($options); $this->addDivForTabs(); return true; } /** Print the user personnal information for check * * @param $userid Interger ID of the user * * @since version 0.84 **/ static function showPersonalInformation($userid) { global $CFG_GLPI; $user = new self(); if (!$user->can($userid,'r') && ($userid != Session::getLoginUserID())) { return false; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
    "; _e('Name'); echo ""; echo getUserName($userid); echo ""; _e('Phone'); echo ""; echo $user->getField('phone'); echo "
    "; _e('Phone 2'); echo ""; echo $user->getField('phone2'); echo ""; _e('Mobile phone'); echo ""; echo $user->getField('mobile'); echo "
    "; _e('Location'); echo ""; echo Dropdown::getDropdownName('glpi_locations', $user->getField('locations_id')); echo ""; if ($userid == Session::getLoginUserID()) { echo "". __('Edit').""; } else { echo " "; } echo "
    "; } /** * Print the user preference form * * @param $target form target * @param $ID integer Id of the user * * @return boolean : user found **/ function showMyForm($target, $ID) { global $CFG_GLPI, $PLUGIN_HOOKS; // Affiche un formulaire User if (($ID != Session::getLoginUserID()) && !$this->currentUserHaveMoreRightThan($ID)) { return false; } if ($this->getFromDB($ID)) { $authtype = $this->getAuthMethodsByID(); $extauth = !(($this->fields["authtype"] == Auth::DB_GLPI) || (($this->fields["authtype"] == Auth::NOT_YET_AUTHENTIFIED) && !empty($this->fields["password"]))); // No autocopletion : $save_autocompletion = $CFG_GLPI["use_ajax_autocompletion"]; $CFG_GLPI["use_ajax_autocompletion"] = false; echo "
    "; echo ""; echo ""; echo ""; echo ""; //do some rights verification if (!$extauth && Session::haveRight("password_update", "1")) { echo ""; echo ""; } else { echo ""; } echo ""; if (!$extauth && Session::haveRight("password_update", "1")) { echo ""; echo ""; } else { echo ""; } echo ""; if (!$extauth && Session::haveRight("password_update", "1")) { echo ""; echo ""; } else { echo ""; echo ""; if (!GLPI_DEMO_MODE) { echo ""; echo ""; if (count($_SESSION['glpiprofiles']) >1) { echo ""; echo ""; $entities = Profile_User::getUserEntities($this->fields['id'], 1); if (!GLPI_DEMO_MODE && (count($_SESSION['glpiactiveentities']) > 1)) { echo ""; echo ""; echo ""; echo "
    ".sprintf(__('%1$s: %2$s'), __('Login'), $this->fields["name"]); echo ""; echo ""; echo "
    " . __('Surname') . ""; if ($extauth && isset($authtype['realname_field']) && !empty($authtype['realname_field'])) { echo $this->fields["realname"]; } else { Html::autocompletionTextField($this, "realname"); } echo "" . __('Password') . ""; echo "
    " . __('First name') . ""; if ($extauth && isset($authtype['firstname_field']) && !empty($authtype['firstname_field'])) { echo $this->fields["firstname"]; } else { Html::autocompletionTextField($this, "firstname"); } echo "" . __('Password confirmation') . ""; echo "
    " . _n('Email', 'Emails',2); UserEmail::showAddEmailButton($this); echo ""; UserEmail::showForUser($this); echo "".__('Password security policy').""; Config::displayPasswordSecurityChecks(); echo ""; } echo "
    " . __('Mobile phone') . " :"; if ($extauth && isset($authtype['mobile_field']) && !empty($authtype['mobile_field'])) { echo $this->fields["mobile"]; } else { Html::autocompletionTextField($this, "mobile"); } echo "" . __('Language') . ""; // Use session variable because field in table may be null if same of the global config Dropdown::showLanguages("language", array('value' => $_SESSION["glpilanguage"])); } else { echo " "; } echo "
    " . __('Phone') . ""; if ($extauth && isset($authtype['phone_field']) && !empty($authtype['phone_field'])) { echo $this->fields["phone"]; } else { Html::autocompletionTextField($this, "phone"); } echo "" . __('Default profile') . ""; $options = array(0 => Dropdown::EMPTY_VALUE); $options += Dropdown::getDropdownArrayNames('glpi_profiles', Profile_User::getUserProfiles($this->fields['id'])); Dropdown::showFromArray("profiles_id", $options, array('value' => $this->fields["profiles_id"])); } else { echo " "; } echo "
    " . __('Phone 2') . ""; if ($extauth && isset($authtype['phone2_field']) && !empty($authtype['phone2_field'])) { echo $this->fields["phone2"]; } else { Html::autocompletionTextField($this, "phone2"); } echo "" . __('Default entity') . ""; Entity::dropdown(array('value' => $this->fields['entities_id'], 'entity' => $entities)); } else { echo " "; } echo "
    " . __('Location') . ""; $entities = Profile_User::getUserEntities($ID, true); Location::dropdown(array('value' => $this->fields['locations_id'], 'entity' => $entities)); if (Session::haveRight("config", "w")) { echo "" . __('Use GLPI in mode') . ""; $modes[Session::NORMAL_MODE] = __('Normal'); //$modes[Session::TRANSLATION_MODE] = __('Translation'); $modes[Session::DEBUG_MODE] = __('Debug'); Dropdown::showFromArray('use_mode', $modes, array('value' => $this->fields["use_mode"])); } else { echo " "; } echo "
    "; echo ""; echo "
    "; Html::closeForm(); echo "
    "; $CFG_GLPI["use_ajax_autocompletion"] = $save_autocompletion; return true; } return false; } /** * Get all the authentication method parameters for the current user **/ function getAuthMethodsByID() { return Auth::getMethodsByID($this->fields["authtype"], $this->fields["auths_id"]); } function pre_updateInDB() { global $DB; if (($key = array_search('name',$this->updates)) !== false) { /// Check if user does not exists $query = "SELECT * FROM `".$this->getTable()."` WHERE `name` = '".$this->input['name']."' AND `id` <> '".$this->input['id']."';"; $result = $DB->query($query); if ($DB->numrows($result) > 0) { //To display a message $this->fields['name'] = $this->oldvalues['name']; unset($this->updates[$key]); unset($this->oldvalues['name']); Session::addMessageAfterRedirect(__('Unable to update login. A user already exists.'), false, ERROR); } } /// Security system except for login update if (Session::getLoginUserID() && !Session::haveRight("user", "w") && !strpos($_SERVER['PHP_SELF'], "login.php")) { if (Session::getLoginUserID() === $this->input['id']) { if (isset($this->fields["authtype"])) { // extauth ldap case if ($_SESSION["glpiextauth"] && (($this->fields["authtype"] == Auth::LDAP) || Auth::isAlternateAuth($this->fields["authtype"]))) { $authtype = Auth::getMethodsByID($this->fields["authtype"], $this->fields["auths_id"]); if (count($authtype)) { $fields = AuthLDAP::getSyncFields($authtype); foreach ($fields as $key => $val) { if (!empty($val) && (($key2 = array_search($key, $this->updates)) !== false)) { unset ($this->updates[$key2]); unset($this->oldvalues[$key]); } } } } if (($key = array_search("is_active",$this->updates)) !== false) { unset ($this->updates[$key]); unset($this->oldvalues['is_active']); } if (($key = array_search("comment",$this->updates)) !== false) { unset ($this->updates[$key]); unset($this->oldvalues['comment']); } } } } } /** * @see CommonDBTM::getSpecificMassiveActions() **/ function getSpecificMassiveActions($checkitem=NULL) { $isadmin = static::canUpdate(); $actions = parent::getSpecificMassiveActions($checkitem); if ($isadmin) { $actions['add_user_group'] = __('Associate to a group'); $actions['add_userprofile'] = __('Associate to a profile'); } if (Session::haveRight("user_authtype","w")) { $actions['change_authtype'] = _x('button', 'Change the authentication method'); $actions['force_user_ldap_update'] = __('Force synchronization'); } return $actions; } /** * @see CommonDBTM::showSpecificMassiveActionsParameters() **/ function showSpecificMassiveActionsParameters($input=array()) { global $CFG_GLPI; switch ($input['action']) { case "change_authtype" : $rand = Auth::dropdown(array('name' => 'authtype')); $paramsmassaction = array('authtype' => '__VALUE__'); Ajax::updateItemOnSelectEvent("dropdown_authtype$rand", "show_massiveaction_field", $CFG_GLPI["root_doc"]. "/ajax/dropdownMassiveActionAuthMethods.php", $paramsmassaction); echo "

    "; echo ""; echo "
    \n"; return true; case "add_user_group" : $gu = new Group_User(); return $gu->showSpecificMassiveActionsParameters($input); case "add_userprofile" : Entity::dropdown(array('entity' => $_SESSION['glpiactiveentities'])); echo ". "._n('Profile', 'Profiles', 1)." "; Profile::dropdownUnder(); echo ". ".__('Recursive')." "; Dropdown::showYesNo("is_recursive", 0); echo "

    "; return true; default : return parent::showSpecificMassiveActionsParameters($input); } return false; } /** * @see CommonDBTM::doSpecificMassiveActions() **/ function doSpecificMassiveActions($input=array()) { $res = array('ok' => 0, 'ko' => 0, 'noright' => 0); switch ($input['action']) { case "add_user_group" : $gu = new Group_User(); return $gu->doSpecificMassiveActions($input); case "force_user_ldap_update" : if (Session::haveRight("user", "w")) { $ids = array(); foreach ($input["item"] as $key => $val) { if ($val == 1) { if ($this->getFromDB($key)) { if (($this->fields["authtype"] == Auth::LDAP) || ($this->fields["authtype"] == Auth::EXTERNAL)) { if (AuthLdap::ldapImportUserByServerId(array('method' => AuthLDAP::IDENTIFIER_LOGIN, 'value' => $this->fields["name"]), 1, $this->fields["auths_id"])) { $res['ok']++; } else { $res['ko']++; } } } else { $res['ko']++; } } } } else { $res['noright']++; } break; case "change_authtype" : if (!isset($input["authtype"]) || !isset($input["auths_id"])) { return false; } if (Session::haveRight("user_authtype","w")) { $ids = array(); foreach ($input["item"] as $key => $val) { if ($val == 1) { $ids[] = $key; } } if (User::changeAuthMethod($ids, $input["authtype"], $input["auths_id"])) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } break; case "add_userprofile" : $right = new Profile_User(); if (isset($input['profiles_id']) && ($input['profiles_id'] > 0) && isset($input['entities_id']) && ($input['entities_id'] >= 0)) { $input2 = array(); $input2['entities_id'] = $input['entities_id']; $input2['profiles_id'] = $input['profiles_id']; $input2['is_recursive'] = $input['is_recursive']; foreach ($input["item"] as $key => $val) { if ($val == 1) { $input2['users_id'] = $key; if ($right->can(-1,'w',$input2)) { if ($right->add($input2)) { $res['ok']++; } else { $res['ko']++; } } else { $res['noright']++; } } } } break; default : return parent::doSpecificMassiveActions($input); } return $res; } function getSearchOptions() { // forcegroup by on name set force group by for all items $tab = array(); $tab['common'] = __('Characteristics'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Login'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['forcegroupby'] = true; $tab[1]['massiveaction'] = false; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['massiveaction'] = false; $tab[2]['datatype'] = 'number'; $tab[34]['table'] = $this->getTable(); $tab[34]['field'] = 'realname'; $tab[34]['name'] = __('Surname'); $tab[34]['datatype'] = 'string'; $tab[9]['table'] = $this->getTable(); $tab[9]['field'] = 'firstname'; $tab[9]['name'] = __('First name'); $tab[9]['datatype'] = 'string'; $tab[5]['table'] = 'glpi_useremails'; $tab[5]['field'] = 'email'; $tab[5]['name'] = _n('Email', 'Emails',2); $tab[5]['datatype'] = 'email'; $tab[5]['joinparams'] = array('jointype'=>'child'); $tab[5]['forcegroupby'] = true; $tab[5]['massiveaction'] = false; $tab += Location::getSearchOptionsToAdd(); $tab[8]['table'] = $this->getTable(); $tab[8]['field'] = 'is_active'; $tab[8]['name'] = __('Active'); $tab[8]['datatype'] = 'bool'; $tab[6]['table'] = $this->getTable(); $tab[6]['field'] = 'phone'; $tab[6]['name'] = __('Phone'); $tab[6]['datatype'] = 'string'; $tab[10]['table'] = $this->getTable(); $tab[10]['field'] = 'phone2'; $tab[10]['name'] = __('Phone 2'); $tab[10]['datatype'] = 'string'; $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'mobile'; $tab[11]['name'] = __('Mobile phone'); $tab[11]['datatype'] = 'string'; $tab[13]['table'] = 'glpi_groups'; $tab[13]['field'] = 'completename'; $tab[13]['name'] = _n('Group','Groups',2); $tab[13]['forcegroupby'] = true; $tab[13]['datatype'] = 'itemlink'; $tab[13]['massiveaction'] = false; $tab[13]['joinparams'] = array('beforejoin' => array('table' => 'glpi_groups_users', 'joinparams' => array('jointype'=>'child'))); $tab[14]['table'] = $this->getTable(); $tab[14]['field'] = 'last_login'; $tab[14]['name'] = __('Last login'); $tab[14]['datatype'] = 'datetime'; $tab[14]['massiveaction'] = false; $tab[15]['table'] = 'glpi_users'; $tab[15]['field'] = 'authtype'; $tab[15]['name'] = __('Authentication'); $tab[15]['massiveaction'] = false; $tab[15]['datatype'] = 'specific'; $tab[15]['searchtype'] = 'equals'; $tab[15]['additionalfields'] = array('auths_id'); $tab[30]['table'] = 'glpi_authldaps'; $tab[30]['field'] = 'name'; $tab[30]['linkfield'] = 'auths_id'; $tab[30]['name'] = __('LDAP directory for authentication'); $tab[30]['massiveaction'] = false; $tab[30]['joinparams'] = array('condition' => "AND REFTABLE.`authtype` = ".Auth::LDAP); $tab[30]['datatype'] = 'dropdown'; $tab[31]['table'] = 'glpi_authmails'; $tab[31]['field'] = 'name'; $tab[31]['linkfield'] = 'auths_id'; $tab[31]['name'] = __('Email server for authentication'); $tab[31]['massiveaction'] = false; $tab[31]['joinparams'] = array('condition' => "AND REFTABLE.`authtype` = ".Auth::MAIL); $tab[31]['datatype'] = 'dropdown'; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; $tab[17]['table'] = $this->getTable(); $tab[17]['field'] = 'language'; $tab[17]['name'] = __('Language'); $tab[17]['datatype'] = 'language'; $tab[17]['display_emptychoice'] = true; $tab[17]['emptylabel'] = __('Default value'); $tab[19]['table'] = $this->getTable(); $tab[19]['field'] = 'date_mod'; $tab[19]['name'] = __('Last update'); $tab[19]['datatype'] = 'datetime'; $tab[19]['massiveaction'] = false; $tab[20]['table'] = 'glpi_profiles'; $tab[20]['field'] = 'name'; $tab[20]['name'] = sprintf(__('%1$s (%2$s)'), _n('Profile', 'Profiles', 2), _n('Entity', 'Entities', 1)); $tab[20]['forcegroupby'] = true; $tab[20]['massiveaction'] = false; $tab[20]['datatype'] = 'dropdown'; $tab[20]['joinparams'] = array('beforejoin' => array('table' => 'glpi_profiles_users', 'joinparams' => array('jointype' => 'child'))); $tab[21]['table'] = $this->getTable(); $tab[21]['field'] = 'user_dn'; $tab[21]['name'] = __('User DN'); $tab[21]['massiveaction'] = false; $tab[21]['datatype'] = 'string'; $tab[22]['table'] = $this->getTable(); $tab[22]['field'] = 'registration_number'; $tab[22]['name'] = __('Administrative number'); $tab[22]['datatype'] = 'string'; $tab[23]['table'] = $this->getTable(); $tab[23]['field'] = 'date_sync'; $tab[23]['datatype'] = 'datetime'; $tab[23]['name'] = __('Last synchronization'); $tab[23]['massiveaction'] = false; $tab[80]['table'] = 'glpi_entities'; $tab[80]['linkfield'] = 'entities_id'; $tab[80]['field'] = 'completename'; $tab[80]['name'] = sprintf(__('%1$s (%2$s)'), _n('Entity', 'Entities', 2), _n('Profile', 'Profiles', 1)); $tab[80]['forcegroupby'] = true; $tab[80]['datatype'] = 'dropdown'; $tab[80]['massiveaction'] = false; $tab[80]['joinparams'] = array('beforejoin' => array('table' => 'glpi_profiles_users', 'joinparams' => array('jointype' => 'child'))); $tab[81]['table'] = 'glpi_usertitles'; $tab[81]['field'] = 'name'; $tab[81]['name'] = _x('person','Title'); $tab[81]['datatype'] = 'dropdown'; $tab[82]['table'] = 'glpi_usercategories'; $tab[82]['field'] = 'name'; $tab[82]['name'] = __('Category'); $tab[82]['datatype'] = 'dropdown'; $tab[79]['table'] = 'glpi_profiles'; $tab[79]['field'] = 'name'; $tab[79]['name'] = __('Default profile'); $tab[79]['datatype'] = 'dropdown'; $tab[77]['table'] = 'glpi_entities'; $tab[77]['field'] = 'name'; $tab[77]['massiveaction'] = true; $tab[77]['name'] = __('Default entity'); $tab[77]['datatype'] = 'dropdown'; $tab[60]['table'] = 'glpi_tickets'; $tab[60]['field'] = 'count'; $tab[60]['name'] = __('Number of tickets as requester'); $tab[60]['forcegroupby'] = true; $tab[60]['usehaving'] = true; $tab[60]['datatype'] = 'number'; $tab[60]['massiveaction'] = false; $tab[60]['joinparams'] = array('beforejoin' => array('table' => 'glpi_tickets_users', 'joinparams' => array('jointype' => 'child', 'condition' => 'AND NEWTABLE.`type` = '.CommonITILActor::REQUESTER))); $tab[61]['table'] = 'glpi_tickets'; $tab[61]['field'] = 'count'; $tab[61]['name'] = __('Number of written tickets'); $tab[61]['forcegroupby'] = true; $tab[61]['usehaving'] = true; $tab[61]['datatype'] = 'number'; $tab[61]['massiveaction'] = false; $tab[61]['joinparams'] = array('jointype' => 'child', 'linkfield' => 'users_id_recipient'); return $tab; } /** * @since ersion 0.84 * * @param $field * @param $values * @param $options array **/ static function getSpecificValueToDisplay($field, $values, array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } switch ($field) { case 'authtype': $auths_id = 0; if (isset($values['auths_id']) && !empty($values['auths_id'])) { $auths_id = $values['auths_id']; } return Auth::getMethodName($values[$field], $auths_id); } return parent::getSpecificValueToDisplay($field, $values, $options); } /** * @since version 0.84 * * @param $field * @param $name (default '') * @param $values (defaut '') * @param $options array **/ static function getSpecificValueToSelect($field, $name='', $values='', array $options=array()) { if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'authtype' : $options['name'] = $name; $options['value'] = $values[$field]; return Auth::dropdown($options); } return parent::getSpecificValueToSelect($field, $name, $values, $options); } /** * Get all groups where the current user have delegating * * @since version 0.83 * * @param $entities_id ID of the entity to restrict (default '') * * @return array of groups id **/ static function getDelegateGroupsForUser($entities_id='') { global $DB; $query = "SELECT DISTINCT `glpi_groups_users`.`groups_id` FROM `glpi_groups_users` INNER JOIN `glpi_groups` ON (`glpi_groups_users`.`groups_id` = `glpi_groups`.`id`) WHERE `glpi_groups_users`.`users_id` = '".Session::getLoginUserID()."' AND `glpi_groups_users`.`is_userdelegate` = '1' ". getEntitiesRestrictRequest("AND","glpi_groups",'',$entities_id,1); $groups = array(); foreach ($DB->request($query) as $data) { $groups[$data['groups_id']] = $data['groups_id']; } return $groups; } /** * Execute the query to select box with all glpi users where select key = name * * Internaly used by showGroup_Users, dropdownUsers and ajax/dropdownUsers.php * * @param $count true if execute an count(*) (true by default) * @param $right limit user who have specific right (default 'all') * @param $entity_restrict Restrict to a defined entity (default -1) * @param $value default value (default 0) * @param $used array Already used items ID: not to display in dropdown * @param $search pattern (default '') * * @return mysql result set. **/ static function getSqlSearchResult ($count=true, $right="all", $entity_restrict=-1, $value=0, $used=array(), $search='') { global $DB, $CFG_GLPI; // No entity define : use active ones if ($entity_restrict < 0) { $entity_restrict = $_SESSION["glpiactiveentities"]; } $joinprofile = false; switch ($right) { case "interface" : $joinprofile = true; $where = " `glpi_profiles`.`interface` = 'central' ". getEntitiesRestrictRequest("AND", "glpi_profiles_users", '', $entity_restrict, 1); break; case "id" : $where = " `glpi_users`.`id` = '".Session::getLoginUserID()."' "; break; case "delegate" : $groups = self::getDelegateGroupsForUser($entity_restrict); $users = array(); if (count($groups)) { $query = "SELECT `glpi_users`.`id` FROM `glpi_groups_users` LEFT JOIN `glpi_users` ON (`glpi_users`.`id` = `glpi_groups_users`.`users_id`) WHERE `glpi_groups_users`.`groups_id` IN ('".implode("','",$groups)."') AND `glpi_groups_users`.`users_id` <> '".Session::getLoginUserID()."'"; $result = $DB->query($query); if ($DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $users[$data["id"]] = $data["id"]; } } } // Add me to users list for central if ($_SESSION['glpiactiveprofile']['interface'] == 'central') { $users[Session::getLoginUserID()] = Session::getLoginUserID(); } if (count($users)) { $where = " `glpi_users`.`id` IN ('".implode("','",$users)."')"; } else { $where = '0'; } break; case "all" : $where = " `glpi_users`.`id` > '1' ". getEntitiesRestrictRequest("AND","glpi_profiles_users",'',$entity_restrict,1); break; default : $joinprofile = true; if (!is_array($right)) { $right = array($right); } $forcecentral = true; $where = array(); foreach ($right as $r) { // Check read or active for rights $where[] = " (`glpi_profiles`.`".$r."` IN ('1', 'r', 'w') ". getEntitiesRestrictRequest("AND", "glpi_profiles_users", '', $entity_restrict, 1).") "; if (in_array($r, Profile::$helpdesk_rights)) { $forcecentral = false; } } $where = '('.implode(' OR ', $where); if ($forcecentral) { $where .= " AND `glpi_profiles`.`interface` = 'central' "; } $where .= ')'; } $where .= " AND `glpi_users`.`is_deleted` = '0' AND `glpi_users`.`is_active` = '1' "; if ((is_numeric($value) && $value) || count($used)) { $where .= " AND `glpi_users`.`id` NOT IN ("; if (is_numeric($value)) { $first = false; $where .= $value; } else { $first = true; } foreach ($used as $val) { if ($first) { $first = false; } else { $where .= ","; } $where .= $val; } $where .= ")"; } if ($count) { $query = "SELECT COUNT(DISTINCT `glpi_users`.`id` ) AS CPT FROM `glpi_users` "; } else { $query = "SELECT DISTINCT `glpi_users`.* FROM `glpi_users` "; } $query .= " LEFT JOIN `glpi_useremails` ON (`glpi_users`.`id` = `glpi_useremails`.`users_id`) LEFT JOIN `glpi_profiles_users` ON (`glpi_users`.`id` = `glpi_profiles_users`.`users_id`)"; if ($joinprofile) { $query .= " LEFT JOIN `glpi_profiles` ON (`glpi_profiles`.`id` = `glpi_profiles_users`.`profiles_id`) "; } if ($count) { $query .= " WHERE $where "; } else { if ((strlen($search) > 0) && ($search != $CFG_GLPI["ajax_wildcard"])) { $where .= " AND (`glpi_users`.`name` ".Search::makeTextSearch($search)." OR `glpi_users`.`realname` ".Search::makeTextSearch($search)." OR `glpi_users`.`firstname` ".Search::makeTextSearch($search)." OR `glpi_users`.`phone` ".Search::makeTextSearch($search)." OR `glpi_useremails`.`email` ".Search::makeTextSearch($search)." OR CONCAT(`glpi_users`.`realname`,' ',`glpi_users`.`firstname`) ". Search::makeTextSearch($search).")"; } $query .= " WHERE $where "; if ($_SESSION["glpinames_format"] == self::FIRSTNAME_BEFORE) { $query.=" ORDER BY `glpi_users`.`firstname`, `glpi_users`.`realname`, `glpi_users`.`name` "; } else { $query.=" ORDER BY `glpi_users`.`realname`, `glpi_users`.`firstname`, `glpi_users`.`name` "; } if ($search != $CFG_GLPI["ajax_wildcard"]) { $query .= " LIMIT 0,".$CFG_GLPI["dropdown_max"]; } } return $DB->query($query); } /** * Make a select box with all glpi users where select key = name * * @param $options array of possible options: * - name : string / name of the select (default is users_id) * - value * - right : string / limit user who have specific right : * id -> only current user (default case); * interface -> central ; * all -> all users ; * specific right like show_all_ticket, create_ticket.... (is array passed one of all passed right is needed) * - comments : boolean / is the comments displayed near the dropdown (default true) * - entity : integer or array / restrict to a defined entity or array of entities * (default -1 : no restriction) * - entity_sons : boolean / if entity restrict specified auto select its sons * only available if entity is a single value not an array(default false) * - all : Nobody or All display for none selected * all=0 (default) -> Nobody * all=1 -> All * all=-1-> nothing * - rand : integer / already computed rand value * - toupdate : array / Update a specific item on select change on dropdown * (need value_fieldname, to_update, url * (see Ajax::updateItemOnSelectEvent for information) * and may have moreparams) * - used : array / Already used items ID: not to display in dropdown (default empty) * - ldap_import * - on_change : string / value to transmit to "onChange" * - display : boolean / display or get string (default true) * * @return rand value if displayed / string if not **/ static function dropdown($options=array()) { global $DB, $CFG_GLPI; // Default values $p['name'] = 'users_id'; $p['value'] = ''; $p['right'] = 'id'; $p['all'] = 0; $p['on_change'] = ''; $p['comments'] = 1; $p['entity'] = -1; $p['entity_sons'] = false; $p['used'] = array(); $p['ldap_import'] = false; $p['toupdate'] = ''; $p['rand'] = mt_rand(); $p['display'] = true; if (is_array($options) && count($options)) { foreach ($options as $key => $val) { $p[$key] = $val; } } $output = ''; if (!($p['entity'] < 0) && $p['entity_sons']) { if (is_array($p['entity'])) { $output .= "entity_sons options is not available with array of entity"; } else { $p['entity'] = getSonsOf('glpi_entities',$p['entity']); } } // Make a select box with all glpi users $use_ajax = false; if ($CFG_GLPI["use_ajax"]) { $res = self::getSqlSearchResult (true, $p['right'], $p['entity'], $p['value'], $p['used']); $nb = ($res ? $DB->result($res,0,"CPT") : 0); if ($nb > $CFG_GLPI["ajax_limit_count"]) { $use_ajax = true; } } $user = getUserName($p['value'], 2); $default_display = ""; $view_users = (Session::haveRight("user", "r")); $params = array('searchText' => '__VALUE__', 'value' => $p['value'], 'myname' => $p['name'], 'all' => $p['all'], 'right' => $p['right'], 'comment' => $p['comments'], 'rand' => $p['rand'], 'on_change' => $p['on_change'], 'entity_restrict' => $p['entity'], 'used' => $p['used'], 'update_item' => $p['toupdate'],); if ($view_users) { $params['update_link'] = $view_users; } $default = ""; if (!empty($p['value']) && ($p['value'] > 0)) { $default = $default_display; } else { $default = ""; } else { $default.= "\n"; } } $output .= Ajax::dropdown($use_ajax, "/ajax/dropdownUsers.php", $params, $default, $p['rand'], false); // Display comment if ($p['comments']) { if (!$view_users) { $user["link"] = ''; } else if (empty($user["link"])) { $user["link"] = $CFG_GLPI['root_doc']."/front/user.php"; } $output .= Html::showToolTip($user["comment"], array('contentid' => "comment_".$p['name'].$p['rand'], 'display' => false, 'link' => $user["link"], 'linkid' => "comment_link_".$p["name"].$p['rand'])); } if (Session::haveRight('import_externalauth_users','w') && $p['ldap_import'] && Entity::isEntityDirectoryConfigured($_SESSION['glpiactive_entity'])) { $output .= ""; } if ($p['display']) { echo $output; return $p['rand']; } return $output; } /** * Simple add user form for external auth **/ static function showAddExtAuthForm() { if (!Session::haveRight("import_externalauth_users","w")) { return false; } echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo ""; echo ""; echo ""; echo ""; echo "\n"; echo "
    ".__('Automatically add a user of an external source')."
    ".__('Login')."
    \n"; echo "\n"; echo "
    \n"; echo "\n"; echo "
    "; Html::closeForm(); echo "
    \n"; } /** * @param $IDs array * @param $authtype (default 1) * @param $server (default -1) * * @return boolean **/ static function changeAuthMethod($IDs=array(), $authtype=1 ,$server=-1) { global $DB; if (!Session::haveRight("user_authtype","w")) { return false; } if (!empty($IDs) && in_array($authtype, array(Auth::DB_GLPI, Auth::LDAP, Auth::MAIL, Auth::EXTERNAL))) { $where = implode("','",$IDs); $query = "UPDATE `glpi_users` SET `authtype` = '$authtype', `auths_id` = '$server', `password` = '' WHERE `id` IN ('$where')"; if ($DB->query($query)) { foreach ($IDs as $ID) { $changes[0] = 0; $changes[1] = ''; $changes[2] = addslashes(sprintf(__('%1$s: %2$s'), __('Update authentification method to'), Auth::getMethodName($authtype, $server))); Log::history($ID, __CLASS__, $changes, '', Log::HISTORY_LOG_SIMPLE_MESSAGE); } return true; } } return false; } /** * Generate vcard for the current user **/ function generateVcard() { include_once (GLPI_ROOT . "/lib/vcardclass/classes-vcard.php"); // build the Vcard $vcard = new vCard(); if (!empty($this->fields["realname"]) || !empty($this->fields["firstname"])) { $vcard->setName($this->fields["realname"], $this->fields["firstname"], "", ""); } else { $vcard->setName($this->fields["name"], "", "", ""); } $vcard->setPhoneNumber($this->fields["phone"], "PREF;WORK;VOICE"); $vcard->setPhoneNumber($this->fields["phone2"], "HOME;VOICE"); $vcard->setPhoneNumber($this->fields["mobile"], "WORK;CELL"); $vcard->setEmail($this->getDefaultEmail()); $vcard->setNote($this->fields["comment"]); // send the VCard $output = $vcard->getVCard(); $filename = $vcard->getFileName(); // "xxx xxx.vcf" @Header("Content-Disposition: attachment; filename=\"$filename\""); @Header("Content-Length: ".Toolbox::strlen($output)); @Header("Connection: close"); @Header("content-type: text/x-vcard; charset=UTF-8"); echo $output; } /** * Show items of the current user * * @param $tech **/ function showItems($tech) { global $DB, $CFG_GLPI; $ID = $this->getField('id'); if ($tech) { $type_user = $CFG_GLPI['linkuser_tech_types']; $type_group = $CFG_GLPI['linkgroup_tech_types']; $field_user = 'users_id_tech'; $field_group = 'groups_id_tech'; } else { $type_user = $CFG_GLPI['linkuser_types']; $type_group = $CFG_GLPI['linkgroup_types']; $field_user = 'users_id'; $field_group = 'groups_id'; } $group_where = ""; $groups = array(); $query = "SELECT `glpi_groups_users`.`groups_id`, `glpi_groups`.`name` FROM `glpi_groups_users` LEFT JOIN `glpi_groups` ON (`glpi_groups`.`id` = `glpi_groups_users`.`groups_id`) WHERE `glpi_groups_users`.`users_id` = '$ID'"; $result = $DB->query($query); $number = $DB->numrows($result); if ($number > 0) { $first = true; while ($data = $DB->fetch_assoc($result)) { if ($first) { $first = false; } else { $group_where .= " OR "; } $group_where .= " `".$field_group."` = '".$data["groups_id"]."' "; $groups[$data["groups_id"]] = $data["name"]; } } echo "
    "; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; foreach ($type_user as $itemtype) { if (!($item = getItemForItemtype($itemtype))) { continue; } if ($item->canView()) { $itemtable = getTableForItemType($itemtype); $query = "SELECT * FROM `$itemtable` WHERE `".$field_user."` = '$ID'"; if ($item->maybeTemplate()) { $query .= " AND `is_template` = '0' "; } if ($item->maybeDeleted()) { $query .= " AND `is_deleted` = '0' "; } $result = $DB->query($query); $type_name = $item->getTypeName(); if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { $cansee = $item->can($data["id"],"r"); $link = $data["name"]; if ($cansee) { $link_item = Toolbox::getItemTypeFormURL($itemtype); if ($_SESSION["glpiis_ids_visible"] || empty($link)) { $link = sprintf(__('%1$s (%2$s)'), $link, $data["id"]); } $link = "".$link.""; } $linktype = ""; if ($data[$field_user] == $ID) { $linktype = self::getTypeName(1); } echo ""; echo ""; echo ""; echo ""; } } } } echo "
    ".__('Type')."".__('Entity')."".__('Name')."".__('Serial number')."".__('Inventory number')."".__('Status')." 
    $type_name".Dropdown::getDropdownName("glpi_entities", $data["entities_id"])."$link"; if (isset($data["serial"]) && !empty($data["serial"])) { echo $data["serial"]; } else { echo ' '; } echo ""; if (isset($data["otherserial"]) && !empty($data["otherserial"])) { echo $data["otherserial"]; } else { echo ' '; } echo ""; if (isset($data["states_id"])) { echo Dropdown::getDropdownName("glpi_states", $data['states_id']); } else { echo ' '; } echo "$linktype
    "; if (!empty($group_where)) { echo "
    ". "". "". "". "". "". "". ""; foreach ($type_group as $itemtype) { if (!($item = getItemForItemtype($itemtype))) { continue; } if ($item->canView()) { $itemtable = getTableForItemType($itemtype); $query = "SELECT * FROM `$itemtable` WHERE $group_where"; if ($item->maybeTemplate()) { $query .= " AND `is_template` = '0' "; } if ($item->maybeDeleted()) { $query .= " AND `is_deleted` = '0' "; } $result = $DB->query($query); $type_name = $item->getTypeName(); if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { $cansee = $item->can($data["id"],"r"); $link = $data["name"]; if ($cansee) { $link_item = Toolbox::getItemTypeFormURL($itemtype); if ($_SESSION["glpiis_ids_visible"] || empty($link)) { $link = sprintf(__('%1$s (%2$s)'), $link, $data["id"]); } $link = "".$link.""; } $linktype = ""; if (isset($groups[$data[$field_group]])) { $linktype = sprintf(__('%1$s = %2$s'), _n('Group','Groups',1), $groups[$data[$field_group]]); } echo ""; echo ""; echo ""; } } } } echo "
    ".__('Type')."".__('Entity')."".__('Name')."".__('Serial number')."".__('Inventory number')."".__('Status')." 
    $type_name".Dropdown::getDropdownName("glpi_entities", $data["entities_id"]); echo "$link"; if (isset($data["serial"]) && !empty($data["serial"])) { echo $data["serial"]; } else { echo ' '; } echo ""; if (isset($data["otherserial"]) && !empty($data["otherserial"])) { echo $data["otherserial"]; } else { echo ' '; } echo ""; if (isset($data["states_id"])) { echo Dropdown::getDropdownName("glpi_states",$data['states_id']); } else { echo ' '; } echo "$linktype
    "; } } /** * @param $email (default '') **/ static function getOrImportByEmail($email='') { global $DB, $CFG_GLPI; $query = "SELECT `users_id` as id FROM `glpi_useremails` LEFT JOIN `glpi_users` ON (`glpi_users`.`id` = `glpi_useremails`.`users_id`) WHERE `glpi_useremails`.`email` = '$email' ORDER BY `glpi_users`.`is_active` DESC"; $result = $DB->query($query); //User still exists in DB if ($result && $DB->numrows($result)) { return $DB->result($result, 0, "id"); } else { if ($CFG_GLPI["is_users_auto_add"]) { //Get all ldap servers with email field configured $ldaps = AuthLdap::getServersWithImportByEmailActive(); //Try to find the user by his email on each ldap server foreach ($ldaps as $ldap) { $params['method'] = AuthLdap::IDENTIFIER_EMAIL; $params['value'] = $email; $res = AuthLdap::ldapImportUserByServerId($params, AuthLdap::ACTION_IMPORT, $ldap); if (isset($res['id'])) { return $res['id']; } } } } return 0; } /** * @param $users_id **/ static function manageDeletedUserInLdap($users_id) { global $CFG_GLPI; //User is present in DB but not in the directory : it's been deleted in LDAP $tmp['id'] = $users_id; $myuser = new User(); switch ($CFG_GLPI['user_deleted_ldap']) { //DO nothing default : case 0 : break; //Put user in dustbin case 1 : $myuser->delete($tmp); break; //Delete all user dynamic habilitations and groups case 2 : Profile_User::deleteRights($users_id, true); Group_User::deleteGroups($users_id, true); break; //Deactivate the user case 3 : $tmp['is_active'] = 0; $myuser->update($tmp); break; } $changes[0] = '0'; $changes[1] = ''; $changes[2] = __('Deleted user in LDAP directory'); Log::history($users_id, 'User', $changes, 0, Log::HISTORY_LOG_SIMPLE_MESSAGE); } /** * @param $login **/ static function getIdByName($login) { self::getIdByField('name', $login); } /** * @since version 0.84 * * @param $field * @param $login **/ static function getIdByField($field, $login) { global $DB; $query = "SELECT `id` FROM `glpi_users` WHERE `$field` = '".addslashes($login)."'"; $result = $DB->query($query); if ($DB->numrows($result) == 1) { return $DB->result($result, 0, 'id'); } return false; } /** * Show form for password recovery * * @param $token **/ static function showPasswordForgetChangeForm($token) { global $CFG_GLPI, $DB; // Verif token. $token_ok = false; $query = "SELECT * FROM `glpi_users` WHERE `password_forget_token` = '$token' AND NOW() < ADDDATE(`password_forget_token_date`, INTERVAL 1 DAY)"; if ($result = $DB->query($query)) { if ($DB->numrows($result) == 1) { $token_ok = true; } } echo "
    "; if ($token_ok) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
    " . __('Forgotten password?')."
    ". __('Please confirm your email address and enter your new password.'). "
    " . _n('Email', 'Emails', 1)."
    " . __('Password').""; echo "
    " . __('Password confirmation').""; echo "
    ".__('Password security policy').""; Config::displayPasswordSecurityChecks(); echo "
    "; echo ""; echo ""; echo "
    "; Html::closeForm(); } else { _e('Your password reset request has expired or is invalid. Please renew it.'); } echo "
    "; } /** * Show form for password recovery **/ static function showPasswordForgetRequestForm() { global $CFG_GLPI; echo "
    "; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
    " . __('Forgotten password?')."
    " . __('Please enter your email address. An email will be sent to you and you will be able to choose a new password.'). "
    "; echo "
    "; Html::closeForm(); echo "
    "; } /** * @param $input **/ function updateForgottenPassword($input) { global $CFG_GLPI; echo "
    "; if ($this->getFromDBbyEmail($input['email'], "`glpi_users`.`is_active` AND NOT `glpi_users`.`is_deleted`")) { if (($this->fields["authtype"] == Auth::DB_GLPI) || !Auth::useAuthExt()) { if (($input['password_forget_token'] == $this->fields['password_forget_token']) && (abs(strtotime($_SESSION["glpi_currenttime"]) -strtotime($this->fields['password_forget_token_date'])) < DAY_TIMESTAMP)) { $input['id'] = $this->fields['id']; if (Config::validatePassword($input["password"]) && $this->update($input)) { _e('Reset password successful.'); // $input2['password_forget_token'] = ''; $input2['password_forget_token_date'] = NULL; $input2['id'] = $this->fields['id']; $this->update($input2); } else { // Force display on error Html::displayMessageAfterRedirect(); } } else { _e('Your password reset request has expired or is invalid. Please renew it.'); } } else { _e("The authentication method configuration doesn't allow you to change your password."); } } else { _e('Email address not found.'); } echo "
    "; echo "".__('Back').""; echo "
    "; } /** * Send password recovery for a user. * * @param $email email of the user * * @return nothing : send email or display error message **/ function forgetPassword($email) { global $CFG_GLPI; echo "
    "; if ($this->getFromDBbyEmail($email, "`glpi_users`.`is_active` AND NOT `glpi_users`.`is_deleted`")) { // Send token if auth DB or not external auth defined if (($this->fields["authtype"] == Auth::DB_GLPI) || !Auth::useAuthExt()) { if (NotificationMail::isUserAddressValid($email)) { $input['password_forget_token'] = sha1(Toolbox::getRandomString(30)); $input['password_forget_token_date'] = $_SESSION["glpi_currenttime"]; $input['id'] = $this->fields['id']; $this->update($input); // Notication on root entity (glpi_users.entities_id is only a pref) NotificationEvent::raiseEvent('passwordforget', $this, array('entities_id' => 0)); _e('An email has been sent to your email address. The email contains information for reset your password.'); } else { _e('Invalid email address'); } } else { _e("The authentication method configuration doesn't allow you to change your password."); } } else { _e('Email address not found.'); } echo "
    "; echo "".__s('Back').""; echo "
    "; } /** * Display information from LDAP server for user **/ private function showLdapDebug() { if ($this->fields['authtype'] != Auth::LDAP) { return false; } echo "
    "; echo ""; echo ""; echo ""; echo "\n"; if ($this->fields['user_dn']) { echo "\n"; } echo "
    ".__('LDAP directory')."
    ".__('User DN')."".$this->fields['user_dn']."
    ".__('User information').""; $config_ldap = new AuthLDAP(); $ds = false; if ($config_ldap->getFromDB($this->fields['auths_id'])) { $ds = $config_ldap->connect(); } if ($ds) { $info = AuthLdap::getUserByDn($ds, $this->fields['user_dn'], array('*', 'createTimeStamp', 'modifyTimestamp')); if (is_array($info)) { Html::printCleanArray($info); } else { _e('No item to display'); } } else { _e('Connection failed'); } echo "
    "; } /** * Display debug information for current object **/ function showDebug() { NotificationEvent::debugEvent($this); $this->showLdapDebug(); } /** * Get fields to display in the unicity error message * * @return an aray which contains field => label **/ function getUnicityFieldsToDisplayInErrorMessage() { return array('id' => __('ID'), 'entities_id' => __('Entity')); } function getUnallowedFieldsForUnicity() { return array_merge(parent::getUnallowedFieldsForUnicity(), array('auths_id', 'date_sync', 'entities_id', 'last_login', 'profiles_id')); } /** * Get personal token checking that it is unique * * @return string personal token **/ static function getUniquePersonalToken() { global $DB; $ok = false; do { $key = Toolbox::getRandomString(40); $query = "SELECT COUNT(*) FROM `glpi_users` WHERE `personal_token` = '$key'"; $result = $DB->query($query); if ($DB->result($result,0,0) == 0) { return $key; } } while (!$ok); } /** * Get personal token of a user. If not exists generate it. * * @param $ID user ID * * @return string personal token **/ static function getPersonalToken($ID) { global $DB; $user = new self(); if ($user->getFromDB($ID)) { if (!empty($user->fields['personal_token'])) { return $user->fields['personal_token']; } $token = self::getUniquePersonalToken(); $user->update(array('id' => $user->getID(), 'personal_token' => $token, 'personal_token_date' => $_SESSION['glpi_currenttime'])); return $user->fields['personal_token']; } return false; } static function checkDefaultPasswords() { $passwords = array('glpi' => 'glpi', 'tech' => 'tech', 'normal' => 'normal', 'post-only' => 'postonly'); $default_password_set = array(); foreach ($passwords as $login => $password) { if (countElementsInTable("glpi_users", "`name`='$login' " . "AND (`password` = SHA1('$password') " . "OR `password` = MD5('$password')) AND `is_active` = '1'")) { $default_password_set[] = $login; } } return $default_password_set; } } ?> glpi-0.84.3+dfsg.1/inc/usercategory.class.php000066400000000000000000000025631226600447100207310ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class UserCategory class UserCategory extends CommonDropdown { static function getTypeName($nb=0) { return _n('User category', 'User categories',$nb); } } ?> glpi-0.84.3+dfsg.1/inc/useremail.class.php000066400000000000000000000165531226600447100202070ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * UserEmail class **/ class UserEmail extends CommonDBChild { // From CommonDBTM public $auto_message_on_action = false; // From CommonDBChild static public $itemtype = 'User'; static public $items_id = 'users_id'; public $dohistory = true; static function getTypeName($nb=0) { return _n('Email', 'Emails', $nb); } /** * Get default email for user. If no default email get first one * * @param $users_id user ID * * @return default email, empty if no email set **/ static function getDefaultForUser($users_id) { global $DB; // Get default one foreach ($DB->request("glpi_useremails", "`users_id` = '$users_id' AND `is_default` = '1'") as $data) { return $data['email']; } // Get first if not default set foreach ($DB->request("glpi_useremails", "`users_id` = '$users_id' AND `is_default` = '0'") as $data) { return $data['email']; } return ''; } /** * Get all emails for user. * * @param $users_id user ID * * @return array of emails **/ static function getAllForUser($users_id) { global $DB; $emails = array(); // Get default one foreach ($DB->request("glpi_useremails", "`users_id` = '$users_id'") as $data) { $emails[] = $data['email']; } return $emails; } /** * is an email of the user * * @param $users_id user ID * @param $email string email to check user ID * * @return boolean is this email set for the user ? **/ static function isEmailForUser($users_id, $email) { global $DB; foreach ($DB->request("glpi_useremails", "`users_id` = '$users_id' AND `email` = '$email'") as $data) { return true; } return false; } /** * @since version 0.84 * * @param $field_name * @param $child_count_js_var * * @return string **/ static function getJSCodeToAddForItemChild($field_name, $child_count_js_var) { return " " . ""; } /** * @since version 0.84 * * @param $canedit * @param $field_name **/ function showChildForItemForm($canedit, $field_name) { if ($this->isNewID($this->getID())) { $value = ''; } else { $value = $this->fields['email']; } echo "fields['is_default']) { echo " checked"; } echo "> "; if (!$canedit || $this->fields['is_dynamic']) { echo ""; printf(__('%1$s %2$s'), $value, "(". __('D').")"); } else { echo ""; } } /** * Show emails of a user * * @param $user User object * * @return nothing **/ static function showForUser(User $user) { $users_id = $user->getID(); if (!$user->can($users_id,'r') && ($users_id != Session::getLoginUserID())) { return false; } $canedit = ($user->can($users_id,"w") || ($users_id == Session::getLoginUserID())); parent::showChildsForItemForm($user, '_useremails', $canedit); } /** * @param $user **/ static function showAddEmailButton(User $user) { $users_id = $user->getID(); if (!$user->can($users_id,'r') && ($users_id != Session::getLoginUserID())) { return false; } $canedit = ($user->can($users_id,"w") || ($users_id == Session::getLoginUserID())); parent::showAddChildButtonForItemForm($user, '_useremails'); return; } function prepareInputForAdd($input) { // Check email validity if (!isset($input['email']) || empty($input['email'])) { return false; } // First email is default if (countElementsInTable($this->getTable(), "`users_id` = '".$input['users_id']."'") == 0) { $input['is_default'] = 1; } return parent::prepareInputForAdd($input); } /** * @since version 0.84 * * @see CommonDBTM::getNameField * * @return string **/ static function getNameField() { return 'email'; } function post_updateItem($history=1) { global $DB; // if default is set : unsed others for the users if (in_array('is_default', $this->updates) && ($this->input["is_default"] == 1)) { $query = "UPDATE ". $this->getTable()." SET `is_default` = '0' WHERE `id` <> '".$this->input['id']."' AND `users_id` = '".$this->fields['users_id']."'"; $DB->query($query); } parent::post_updateItem($history); } function post_addItem() { global $DB; // if default is set : unset others for the users if (isset($this->fields['is_default']) && ($this->fields["is_default"] == 1)) { $query = "UPDATE ". $this->getTable()." SET `is_default` = '0' WHERE `id` <> '".$this->fields['id']."' AND `users_id` = '".$this->fields['users_id']."'"; $DB->query($query); } parent::post_addItem(); } function post_deleteFromDB() { global $DB; // if default is set : set default to another one if ($this->fields["is_default"] == 1) { $query = "UPDATE `". $this->getTable()."` SET `is_default` = '1' WHERE `id` <> '".$this->fields['id']."' AND `users_id` = '".$this->fields['users_id']."' LIMIT 1"; $DB->query($query); } parent::post_deleteFromDB(); } } ?>glpi-0.84.3+dfsg.1/inc/usertitle.class.php000066400000000000000000000025441226600447100202340ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class UserTitle class UserTitle extends CommonDropdown { static function getTypeName($nb=0) { return _n('User title', 'Users titles',$nb); } } ?> glpi-0.84.3+dfsg.1/inc/virtualmachinestate.class.php000066400000000000000000000026351226600447100222710ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Filesystem class VirtualMachineState extends CommonDropdown { static function getTypeName($nb=0) { return _n('State of the virtual machine', 'States of the virtual machine', $nb); } } ?>glpi-0.84.3+dfsg.1/inc/virtualmachinesystem.class.php000066400000000000000000000026171226600447100224750ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Filesystem class VirtualMachineSystem extends CommonDropdown { static function getTypeName($nb=0) { return _n('Virtualization model', 'Virtualization models', $nb); } } ?>glpi-0.84.3+dfsg.1/inc/virtualmachinetype.class.php000066400000000000000000000026151226600447100221300ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Filesystem class VirtualMachineType extends CommonDropdown { static function getTypeName($nb=0) { return _n('Virtualization system', 'Virtualization systems', $nb); } } ?>glpi-0.84.3+dfsg.1/inc/vlan.class.php000066400000000000000000000116341226600447100171540ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class Vlan class Vlan extends CommonDropdown { public $dohistory = true; static function getTypeName($nb=0) { // Acronymous, no plural return __('VLAN'); } function getAdditionalFields() { return array(array('name' => 'tag', 'label' => __('ID TAG'), 'type' => '', 'list' => true)); } function displaySpecificTypeField($ID, $field=array()) { if ($field['name'] == 'tag') { Dropdown::showInteger('tag', $this->fields['tag'], 1, (pow(2,12) - 2)); } } /** * Get search function for the class * * @return array of search option **/ function getSearchOptions() { $tab = parent::getSearchOptions(); $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'tag'; $tab[11]['name'] = __('ID TAG'); $tab[11]['datatype'] = 'number'; return $tab; } function cleanDBonPurge() { global $DB; $link = new NetworkPort_Vlan(); $link->cleanDBonItemDelete($this->getType(), $this->getID()); $link = new IPNetwork_Vlan(); $link->cleanDBonItemDelete($this->getType(), $this->getID()); return true; } /** * @since version 0.84 * * @param $itemtype * @param $base HTMLTableBase object * @param $super HTMLTableSuperHeader object (default NULL * @param $father HTMLTableHeader object (default NULL) * @param $options array **/ static function getHTMLTableHeader($itemtype, HTMLTableBase $base, HTMLTableSuperHeader $super=NULL, HTMLTableHeader $father=NULL, array $options=array()) { $column_name = __CLASS__; if (isset($options['dont_display'][$column_name])) { return; } if ($itemtype == 'NetworkPort_Vlan') { $base->addHeader($column_name, self::getTypeName(), $super, $father); } } /** * @since version 0.84 * * @param $row HTMLTableRow object (default NULL) * @param $item CommonDBTM object (default NULL) * @param $father HTMLTableCell object (default NULL) * @param $options array **/ static function getHTMLTableCellsForItem(HTMLTableRow $row=NULL, CommonDBTM $item=NULL, HTMLTableCell $father=NULL, array $options=array()) { global $DB, $CFG_GLPI; $column_name = __CLASS__; if (isset($options['dont_display'][$column_name])) { return; } if (empty($item)) { if (empty($father)) { return; } $item = $father->getItem(); } $canedit = (isset($options['canedit']) && $options['canedit']); if ($item->getType() == 'NetworkPort_Vlan') { if (isset($item->fields["tagged"]) && ($item->fields["tagged"] == 1)) { $tagged_msg = __('Tagged'); } else { $tagged_msg = __('Untagged'); } $vlan = new self(); if ($vlan->getFromDB($options['items_id'])) { $content = sprintf(__('%1$s - %2$s'), $vlan->getName(), $tagged_msg); $content .= Html::showToolTip(sprintf(__('%1$s: %2$s'), __('ID TAG'), $vlan->fields['tag'])."
    ". sprintf(__('%1$s: %2$s'), __('Comments'), $vlan->fields['comment']), array('display' => false)); $this_cell = $row->addCell($row->getHeaderByName($column_name), $content, $father); } } } } ?> glpi-0.84.3+dfsg.1/inc/wifinetwork.class.php000066400000000000000000000073201226600447100205610ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// Class WifiNetwork /// since version 0.84 class WifiNetwork extends CommonDropdown { public $dohistory = true; static function getWifiCardVersion() { return array('' => '', 'a' => 'a', 'a/b' => 'a/b', 'a/b/g' => 'a/b/g', 'a/b/g/n' => 'a/b/g/n', 'a/b/g/n/y' => 'a/b/g/n/y'); } static function getWifiCardModes() { return array('' => Dropdown::EMPTY_VALUE, 'ad-hoc' => __('Ad-hoc'), 'managed' => __('Managed'), 'master' => __('Master'), 'repeater' => __('Repeater'), 'secondary' => __('Secondary'), 'monitor' => __('Monitor'), 'auto' => __('Automatic')); } static function getWifiNetworkModes() { return array('' => Dropdown::EMPTY_VALUE, 'infrastructure' => __('Infrastructure (with access point)'), 'ad-hoc' => __('Ad-hoc (without access point)')); } static function canCreate() { return Session::haveRight('internet', 'w'); } static function canView() { return Session::haveRight('internet', 'r'); } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab('NetworkPort',$ong, $options); return $ong; } function getAdditionalFields() { return array(array('name' => 'essid', 'label' => __('ESSID'), 'type' => 'text', 'list' => true), array('name' => 'mode', 'label' => __('Wifi network type'), 'type' => 'wifi_mode', 'list' => true)); } function displaySpecificTypeField($ID, $field=array()) { if ($field['type'] == 'wifi_mode') { Dropdown::showFromArray($field['name'], self::getWifiNetworkModes(), array('value' => $this->fields[$field['name']])); } } function getSearchOptions() { $tab = parent::getSearchOptions(); $tab[10]['table'] = $this->getTable(); $tab[10]['field'] = 'essid'; $tab[10]['name'] = __('ESSID'); $tab[10]['datatype'] = 'string'; return $tab; } static function getTypeName($nb=0) { return _n('Wifi network', 'Wifi networks', $nb); } } ?> glpi-0.84.3+dfsg.1/inc/xhprof.class.php000066400000000000000000000057741226600447100175320ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * class XHProf * * @since version 0.84 * * Il you need to "profile" some part of code * * Install the pecl/xhprof extension * * Add XHPROF_PATH and XHPROF_URL in config/config_path.php (if needed) * * Before the code * $prof = new XHProf("something useful"); * * If the code contains an exit() or a redirect() you must also call (before) * unset($prof); * * php-errors.log will give you the URL of the result. */ class XHProf { // this can be overloaded in config/config_path.php const XHPROF_PATH = '/usr/share/xhprof/xhprof_lib'; const XHPROF_URL = '/xhprof'; static private $run = false; /** * @param $msg (default '') **/ function __construct($msg='') { $this->start($msg); } function __destruct() { $this->stop(); } /** * @param $msg (default '') **/ function start($msg='') { if (!self::$run && function_exists('xhprof_enable')) { xhprof_enable(); if (class_exists('Toolbox')) { Toolbox::logDebug("Start profiling with XHProf", $msg); } self::$run = true; } } function stop() { if (self::$run) { $data = xhprof_disable(); $incl = (defined('XHPROF_PATH') ? XHPROF_PATH : self::XHPROF_PATH); include_once $incl.'/utils/xhprof_lib.php'; include_once $incl.'/utils/xhprof_runs.php'; $runs = new XHProfRuns_Default(); $id = $runs->save_run($data, 'glpi'); $url = (defined('XHPROF_URL') ? XHPROF_URL : self::XHPROF_URL); $host = (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost'); $link = "http://".$host."$url/index.php?run=$id&source=glpi"; Toolbox::logDebug("Stop profiling with XHProf, result URL", $link); self::$run = false; } } } ?>glpi-0.84.3+dfsg.1/inc/xml.class.php000066400000000000000000000134621226600447100170150ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ // ---------------------------------------------------------------------- // Based on the original file: //* Author : Roberto B. * //* E-Mail : roberto.butti@libero.it * //* Version : 1.0.3 * // Purpose of file: // ---------------------------------------------------------------------- if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /// XML class class XML { /// Array of SQL requests to export var $SqlString = ""; /// 1 there is a problem !!! var $IsError = 0; /// If there is an error, this string explains it var $ErrorString = "NO errors ;)"; /// Which format do you want your XML ? var $Type = 1; ///path where the file will be saved. var $FilePath; // HERE I explain $Type /* For Example : 1 (default) each value are in a tag called data value field1 row1 value field2 row1 value field3 row1 value field1 row2 value field2 row2 value field3 row2 2 each value is in a tag called dataN , where N is a position of field value field1 row1 value field2 row1 value field3 row1 value field1 row2 value field2 row2 value field3 row2 3 each value is in a tag called with the name of field value field1 row1 value field2 row1 value field3 row1 value field1 row2 value field2 row2 value field3 row2 4 each value is in a tag with an attributes called fieldname with the name of field value field1 row1 value field1 row1 value field1 row1 value field1 row2 value field1 row2 value field1 row2 */ /** * Do XML export **/ function DoXML() { global $DB; $fp = fopen($this->FilePath,'wb'); fputs($fp, "\n"); fputs($fp, "\n"); foreach ($this->SqlString as $strqry) { if ($strqry == "") { $this->IsError = 1; $this->ErrorString = "Error the query can't be a null string"; return -1; } $result = $DB->query($strqry); if ($result == FALSE) { $this->IsError = 1; $this->ErrorString = "Error in SQL Query: ".$strqry; return -1; } // OK... let's create XML ;) fputs($fp, " \n"); $i = 0; $FieldsVector = array(); while ($i < $DB->num_fields ($result)) { $name = $DB->field_name($result,$i); fputs($fp, " ".$name."\n"); $FieldsVector[] = $name; $i++; } fputs($fp, " \n"); // And NOW the Data ... fputs($fp, " \n"); while ($row = $DB->fetch_row($result)) { fputs($fp, " \n"); for ($j=0 ; $j<$i ; $j++) { $FieldName = ""; // Name of TAG $Attributes = ""; switch ($this->Type) { case 1 : $FieldName = "data"; break; case 2 : $FieldName = "data".$j; break; case 3 : $FieldName = $FieldsVector[$j]; break; case 4 : $FieldName = "data"; $Attributes = " fieldname=\"".$FieldsVector[$j]."\""; } fputs($fp, " <".$FieldName.$Attributes.">". Toolbox::encodeInUtf8(htmlspecialchars($row[$j]))."\n"); } fputs($fp, " \n"); } fputs($fp, " \n"); $DB->free_result($result); } fputs($fp, ""); //OK free ... ;) fclose($fp); } // End Function : DoXML } // Fine Class XML ?>glpi-0.84.3+dfsg.1/index.php000066400000000000000000000142551226600447100154500ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ // Check PHP version not to have trouble if (version_compare(PHP_VERSION, "5.3.0") < 0) { die("PHP >= 5.3.0 required"); } define('DO_NOT_CHECK_HTTP_REFERER', 1); // If config_db doesn't exist -> start installation define('GLPI_ROOT', dirname(__FILE__)); include (GLPI_ROOT . "/config/based_config.php"); if (!file_exists(GLPI_CONFIG_DIR . "/config_db.php")) { include_once (GLPI_ROOT . "/inc/autoload.function.php"); Html::redirect("install/install.php"); die(); } else { $TRY_OLD_CONFIG_FIRST = true; include (GLPI_ROOT . "/inc/includes.php"); $_SESSION["glpicookietest"] = 'testcookie'; // For compatibility reason if (isset($_GET["noCAS"])) { $_GET["noAUTO"] = $_GET["noCAS"]; } Auth::checkAlternateAuthSystems(true, isset($_GET["redirect"])?$_GET["redirect"]:""); // Send UTF8 Headers header("Content-Type: text/html; charset=UTF-8"); // Start the page echo ''."\n"; echo ''; echo ''.__('GLPI - Authentication').''."\n"; echo ''."\n"; echo ''."\n"; echo ''; // Appel CSS echo ''; // surcharge CSS hack for IE echo ""; // echo ""; echo ""; echo ""; echo "
    "; echo "
    "; echo "
    "; echo nl2br(Toolbox::unclean_html_cross_side_scripting_deep($CFG_GLPI['text_login'])); echo "
    "; echo "
    "; echo ""; // Other CAS if (isset($_GET["noAUTO"])) { echo ""; } // redirect to ticket if (isset($_GET["redirect"])) { Toolbox::manageRedirect($_GET["redirect"]); echo ''; } echo "
    "; echo ''.__('Authentication').''; echo '
    '; echo ''; echo '
    '; echo '
    '; echo ''; echo ''. '
    '; echo "
    "; echo '

    '; echo ''; echo '

    '; if ($CFG_GLPI["use_mailing"] && countElementsInTable('glpi_notifications', "`itemtype`='User' AND `event`='passwordforget' AND `is_active`=1")) { echo ''; } Html::closeForm(); echo ""; echo "
    "; // end login box echo "
    "; echo ""; if (isset($_GET['error'])) { switch ($_GET['error']) { case 1 : // cookie error _e('You must accept cookies to reach this application'); break; case 2 : // GLPI_SESSION_DIR not writable _e('Checking write permissions for session files'); echo "
    ".GLPI_SESSION_DIR; break; } } echo "
    "; echo "
    "; // end contenu login // Display FAQ is enable if ($CFG_GLPI["use_public_faq"]) { echo ''; } if (GLPI_DEMO_MODE) { echo "
    "; Event::getCountLogin(); echo "
    "; } echo ""; } // call cron if (!GLPI_DEMO_MODE) { CronTask::callCronForce(); } echo ""; ?> glpi-0.84.3+dfsg.1/install/000077500000000000000000000000001226600447100152675ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/install/index.php000066400000000000000000000021411226600447100171050ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ ?> glpi-0.84.3+dfsg.1/install/install.php000066400000000000000000000521331226600447100174520ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ define('GLPI_ROOT', realpath('..')); include_once (GLPI_ROOT . "/inc/autoload.function.php"); include_once (GLPI_ROOT . "/inc/db.function.php"); Config::detectRootDoc(); //Print a correct Html header for application function header_html($etape) { // Send UTF8 Headers header("Content-Type: text/html; charset=UTF-8"); echo ""; echo ""; echo ""; echo ""; echo " "; echo " "; echo " "; echo ""; echo ""; echo "Setup GLPI"; // CSS echo ""; echo ""; echo ""; echo "
    "; echo "
    "; echo "
    "; echo "

    GLPI SETUP

    "; echo "

    ". $etape ."

    "; } //Display a great footer. function footer_html() { echo "
    "; } // choose language function choose_language() { echo ""; echo "

    "; Dropdown::showLanguages("language", array('value' => "en_GB")); echo "

    "; echo ""; echo "

    "; echo "

    "; Html::closeForm(); } function acceptLicense() { echo "
    "; echo ""; echo "
    ". __('Unofficial translations are also available').""; echo ""; echo "

    "; echo "

    "; echo "
    "; echo ""; echo " "; echo "

    "; Html::closeForm(); echo "
    "; } //confirm install form function step0() { echo "

    ".__('Installation or update of GLPI')."

    "; echo "

    ".__s("Choose 'Install' for a completely new installation of GLPI.")."

    "; echo "

    ".__s("Select 'Upgrade' to update your version of GLPI from an earlier version")."

    "; echo ""; echo ""; echo "

    "; echo "

    "; Html::closeForm(); echo ""; echo ""; echo "

    "; echo "

    "; Html::closeForm(); } //Step 1 checking some compatibilty issue and some write tests. function step1($update) { global $CFG_GLPI; $error = 0; echo "

    ".__s('Checking of the compatibility of your environment with the execution of GLPI'). "

    "; echo ""; $error = Toolbox::commonCheckForUseGLPI(); echo "
    "; switch ($error) { case 0 : echo ""; echo ""; echo ""; echo "

    "; echo ""; echo "

    "; Html::closeForm(); break; case 1 : echo "

    ".__('Do you want to continue?')."

    "; echo "
    "; echo ""; echo ""; echo ""; echo ""; Html::closeForm(); echo "  "; echo ""; echo ""; echo ""; echo ""; echo ""; Html::closeForm(); echo "
    "; break; case 2 : echo "

    ".__('Do you want to continue?')."

    "; echo ""; echo ""; echo "

    "; echo ""; echo "

    "; Html::closeForm(); break; } } //step 2 import mysql settings. function step2($update) { echo "

    ".__('Database connection setup')."

    "; echo ""; echo ""; echo "
    ".__('Database connection parameters').""; echo "

    "; echo "

    "; echo "

    "; echo "

    "; echo "

    "; echo "

    "; echo ""; echo "

    "; Html::closeForm(); } //step 3 test mysql settings and select database. function step3($host, $user, $password, $update) { error_reporting(16); echo "

    ".__('Test of the connection at the database')."

    "; $link = new mysqli($host, $user, $password); if (($link->connect_error) || empty($host) || empty($user)) { echo "

    ".__("Can't connect to the database")."\n
    ". sprintf(__('The server answered: %s'), $link->connect_error)."

    "; if (empty($host) || empty($user)) { echo "

    ".__('The server or/and user field is empty')."

    "; } echo ""; echo ""; echo ""; echo "

    "; Html::closeForm(); } else { $_SESSION['db_access'] = array('host' => $host, 'user' => $user, 'password' => $password); echo "

    ".__('Database connection successful')."

    "; if ($update == "no") { echo "

    ".__('Please select a database:')."

    "; echo ""; $DB_list = $link->query("SHOW DATABASES"); while ($row = $DB_list->fetch_array()) { if (!in_array($row['Database'],array("information_schema", "mysql", "performance_schema") )) { echo "

    "; echo $row['Database'].".

    "; } } echo "

    "; _e('Create a new database or use an existing one:'); echo " 

    "; /* echo ""; echo ""; echo ""; */ echo ""; echo "

    "; $link->close(); Html::closeForm(); } else if ($update == "yes") { echo "

    ".__('Please select the database to update:')."

    "; echo ""; $DB_list = $link->query("SHOW DATABASES"); while ($row = $DB_list->fetch_array()) { echo "

    "; echo $row['Database'].".

    "; } /* echo ""; echo ""; echo ""; */ echo ""; echo "

    "; $link->close(); Html::closeForm(); } } } //Step 4 Create and fill database. function step4 ($databasename, $newdatabasename) { $host = $_SESSION['db_access']['host']; $user = $_SESSION['db_access']['user']; $password = $_SESSION['db_access']['password']; //display the form to return to the previous step. echo "

    ".__('Initialization of the database')."

    "; function prev_form($host, $user, $password) { echo "
    "; echo ""; echo ""; echo " "; echo ""; echo ""; echo "

    "; Html::closeForm(); } //Display the form to go to the next page function next_form() { echo "
    "; echo ""; echo "

    "; Html::closeForm(); } //Fill the database function fill_db() { global $CFG_GLPI; //include_once (GLPI_ROOT . "/inc/dbmysql.class.php"); include_once (GLPI_CONFIG_DIR . "/config_db.php"); $DB = new DB(); if (!$DB->runFile(GLPI_ROOT ."/install/mysql/glpi-0.84.1-empty.sql")) { echo "Errors occurred inserting default database"; } // update default language $query = "UPDATE `glpi_configs` SET `language` = '".$_SESSION["glpilanguage"]."'"; $DB->queryOrDie($query, "4203"); $query = "UPDATE `glpi_users` SET `language` = NULL"; $DB->queryOrDie($query, "4203"); } $link = new mysqli($host, $user, $password); $databasename = $link->real_escape_string($databasename); $newdatabasename = $link->real_escape_string($newdatabasename); if (!empty($databasename)) { // use db already created $DB_selected = $link->select_db($databasename); if (!$DB_selected) { _e('Impossible to use the database:'); echo "
    ".sprintf(__('The server answered: %s'), $link->error); prev_form($host, $user, $password); } else { if (create_conn_file($host,$user,$password,$databasename)) { fill_db(); echo "

    ".__('OK - database was initialized')."

    "; next_form(); } else { // can't create config_db file echo "

    ".__('Impossible to write the database setup file')."

    "; prev_form($host, $user, $password); } } } else if (!empty($newdatabasename)) { // create new db // Try to connect if ($link->select_db($newdatabasename)) { echo "

    ".__('Database created')."

    "; if (create_conn_file($host,$user,$password,$newdatabasename)) { fill_db(); echo "

    ".__('OK - database was initialized')."

    "; next_form(); } else { // can't create config_db file echo "

    ".__('Impossible to write the database setup file')."

    "; prev_form($host, $user, $password); } } else { // try to create the DB if ($link->query("CREATE DATABASE IF NOT EXISTS `".$newdatabasename."`")) { echo "

    ".__('Database created')."

    "; if ($link->select_db($newdatabasename) && create_conn_file($host,$user,$password,$newdatabasename)) { fill_db(); echo "

    ".__('OK - database was initialized')."

    "; next_form(); } else { // can't create config_db file echo "

    ".__('Impossible to write the database setup file')."

    "; prev_form($host, $user, $password); } } else { // can't create database echo __('Error in creating database!'); echo "
    ".sprintf(__('The server answered: %s'), $link->error); prev_form($host, $user, $password); } } } else { // no db selected echo "

    ".__("You didn't select a database!"). "

    "; //prev_form(); prev_form($host, $user, $password); } $link->close(); } // finish installation function step7() { global $CFG_GLPI; require_once (GLPI_ROOT . "/inc/dbmysql.class.php"); require_once (GLPI_CONFIG_DIR . "/config_db.php"); $DB = new DB(); $query = "UPDATE `glpi_configs` SET `url_base` = '".$DB->escape(str_replace("/install/install.php", "", $_SERVER['HTTP_REFERER']))."' WHERE `id` = '1'"; $DB->query($query); echo "

    ".__('The installation is finished')."

    "; echo "

    ".__('Default logins / passwords are:')."

    "; echo "

    • ".__('glpi/glpi for the administrator account')."
    • "; echo "
    • ".__('tech/tech for the technician account')."
    • "; echo "
    • ".__('normal/normal for the normal account')."
    • "; echo "
    • ".__('post-only/postonly for the postonly account')."

    "; echo "

    ".__('You can delete or modify these accounts as well as the initial data.')."

    "; echo "

    ".__('Use GLPI'); echo "

    "; } //Create the file config_db.php // an fill it with user connections info. function create_conn_file($host, $user, $password, $DBname) { global $CFG_GLPI; $DB_str = ""; return Toolbox::writeConfig('config_db.php', $DB_str); } function update1($DBname) { $host = $_SESSION['db_access']['host']; $user = $_SESSION['db_access']['user']; $password = $_SESSION['db_access']['password']; if (create_conn_file($host,$user,$password,$DBname) && !empty($DBname)) { $from_install = true; include(GLPI_ROOT ."/install/update.php"); } else { // can't create config_db file _e("Can't create the database connection file, please verify file permissions."); echo "

    ".__('Do you want to continue?')."

    "; echo ""; echo ""; echo "

    "; echo ""; echo "

    "; Html::closeForm(); } } //------------Start of install script--------------------------- // Use default session dir if not writable if (is_writable(GLPI_SESSION_DIR)) { Session::setPath(); } Session::start(); error_reporting(0); // we want to check system before affraid the user. if (isset($_POST["language"])) { $_SESSION["glpilanguage"] = $_POST["language"]; } Session::loadLanguage(); function checkConfigFile() { if (file_exists(GLPI_CONFIG_DIR . "/config_db.php")) { Html::redirect($CFG_GLPI['root_doc'] ."/index.php"); die(); } } if (!isset($_POST["install"])) { $_SESSION = array(); checkConfigFile(); header_html("Select your language"); choose_language(); } else { // Check valid Referer : Toolbox::checkValidReferer(); // Check CSRF: ensure nobody strap first page that checks if config file exists ... Session::checkCSRF($_POST); // DB clean if (isset($_POST["db_pass"])) { $_POST["db_pass"] = stripslashes($_POST["db_pass"]); $_POST["db_pass"] = rawurldecode($_POST["db_pass"]); $_POST["db_pass"] = stripslashes($_POST["db_pass"]); } switch ($_POST["install"]) { case "lang_select" : // lang ok, go accept licence checkConfigFile(); header_html(__('License')); acceptLicense(); break; case "License" : // licence ok, go choose installation or Update checkConfigFile(); header_html(__('Beginning of the installation')); step0(); break; case "Etape_0" : // choice ok , go check system checkConfigFile(); //TRANS %s is step number header_html(sprintf(__('Step %d'), 0)); $_SESSION["Test_session_GLPI"] = 1; step1($_POST["update"]); break; case "Etape_1" : // check ok, go import mysql settings. checkConfigFile(); // check system ok, we can use specific parameters for debug Toolbox::setDebugMode(Session::DEBUG_MODE, 0, 0, 1); header_html(sprintf(__('Step %d'), 1)); step2($_POST["update"]); break; case "Etape_2" : // mysql settings ok, go test mysql settings and select database. checkConfigFile(); header_html(sprintf(__('Step %d'), 2)); step3($_POST["db_host"],$_POST["db_user"],$_POST["db_pass"],$_POST["update"]); break; case "Etape_3" : // Create and fill database checkConfigFile(); header_html(sprintf(__('Step %d'), 3)); if (empty($_POST["databasename"])) { $_POST["databasename"] = ""; } if (empty($_POST["newdatabasename"])) { $_POST["newdatabasename"] = ""; } step4($_POST["databasename"], $_POST["newdatabasename"]); break; case "Etape_4" : // finish installation header_html(sprintf(__('Step %d'), 4)); step7(); break; case "update_1" : if (empty($_POST["databasename"])) { $_POST["databasename"] = ""; } update1($_POST["databasename"]); break; } } footer_html(); ?> glpi-0.84.3+dfsg.1/install/mysql/000077500000000000000000000000001226600447100164345ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/install/mysql/.htaccess000066400000000000000000000000151226600447100202260ustar00rootroot00000000000000deny from allglpi-0.84.3+dfsg.1/install/mysql/glpi-0.84.1-empty.sql000066400000000000000000010226131226600447100217770ustar00rootroot00000000000000#GLPI Dump database on 2013-09-03 09:47 ### Dump table glpi_alerts DROP TABLE IF EXISTS `glpi_alerts`; CREATE TABLE `glpi_alerts` ( `id` int(11) NOT NULL AUTO_INCREMENT, `itemtype` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `items_id` int(11) NOT NULL DEFAULT '0', `type` int(11) NOT NULL DEFAULT '0' COMMENT 'see define.php ALERT_* constant', `date` datetime NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`itemtype`,`items_id`,`type`), KEY `type` (`type`), KEY `date` (`date`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_authldapreplicates DROP TABLE IF EXISTS `glpi_authldapreplicates`; CREATE TABLE `glpi_authldapreplicates` ( `id` int(11) NOT NULL AUTO_INCREMENT, `authldaps_id` int(11) NOT NULL DEFAULT '0', `host` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `port` int(11) NOT NULL DEFAULT '389', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `authldaps_id` (`authldaps_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_authldaps DROP TABLE IF EXISTS `glpi_authldaps`; CREATE TABLE `glpi_authldaps` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `host` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `basedn` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `rootdn` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `port` int(11) NOT NULL DEFAULT '389', `condition` text COLLATE utf8_unicode_ci, `login_field` varchar(255) COLLATE utf8_unicode_ci DEFAULT 'uid', `use_tls` tinyint(1) NOT NULL DEFAULT '0', `group_field` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `group_condition` text COLLATE utf8_unicode_ci, `group_search_type` int(11) NOT NULL DEFAULT '0', `group_member_field` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `email1_field` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `realname_field` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `firstname_field` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `phone_field` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `phone2_field` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `mobile_field` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment_field` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `use_dn` tinyint(1) NOT NULL DEFAULT '1', `time_offset` int(11) NOT NULL DEFAULT '0' COMMENT 'in seconds', `deref_option` int(11) NOT NULL DEFAULT '0', `title_field` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `category_field` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `language_field` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `entity_field` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `entity_condition` text COLLATE utf8_unicode_ci, `date_mod` datetime DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `is_default` tinyint(1) NOT NULL DEFAULT '0', `is_active` tinyint(1) NOT NULL DEFAULT '0', `rootdn_passwd` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `registration_number_field` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `email2_field` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `email3_field` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `email4_field` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `pagesize` int(11) NOT NULL DEFAULT '0', `ldap_maxlimit` int(11) NOT NULL DEFAULT '0', `can_support_pagesize` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `date_mod` (`date_mod`), KEY `is_default` (`is_default`), KEY `is_active` (`is_active`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_authmails DROP TABLE IF EXISTS `glpi_authmails`; CREATE TABLE `glpi_authmails` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `connect_string` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `host` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `date_mod` datetime DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `is_active` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `date_mod` (`date_mod`), KEY `is_active` (`is_active`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_autoupdatesystems DROP TABLE IF EXISTS `glpi_autoupdatesystems`; CREATE TABLE `glpi_autoupdatesystems` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_blacklists DROP TABLE IF EXISTS `glpi_blacklists`; CREATE TABLE `glpi_blacklists` ( `id` int(11) NOT NULL AUTO_INCREMENT, `type` int(11) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `type` (`type`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `glpi_blacklists` VALUES ('1','1','empty IP','',NULL); INSERT INTO `glpi_blacklists` VALUES ('2','1','localhost','127.0.0.1',NULL); INSERT INTO `glpi_blacklists` VALUES ('3','1','zero IP','0.0.0.0',NULL); INSERT INTO `glpi_blacklists` VALUES ('4','2','empty MAC','',NULL); ### Dump table glpi_bookmarks DROP TABLE IF EXISTS `glpi_bookmarks`; CREATE TABLE `glpi_bookmarks` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `type` int(11) NOT NULL DEFAULT '0' COMMENT 'see define.php BOOKMARK_* constant', `itemtype` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `users_id` int(11) NOT NULL DEFAULT '0', `is_private` tinyint(1) NOT NULL DEFAULT '1', `entities_id` int(11) NOT NULL DEFAULT '-1', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `path` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `query` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `type` (`type`), KEY `itemtype` (`itemtype`), KEY `entities_id` (`entities_id`), KEY `users_id` (`users_id`), KEY `is_private` (`is_private`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_bookmarks_users DROP TABLE IF EXISTS `glpi_bookmarks_users`; CREATE TABLE `glpi_bookmarks_users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `users_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `bookmarks_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`users_id`,`itemtype`), KEY `bookmarks_id` (`bookmarks_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_budgets DROP TABLE IF EXISTS `glpi_budgets`; CREATE TABLE `glpi_budgets` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `begin_date` date DEFAULT NULL, `end_date` date DEFAULT NULL, `value` decimal(20,4) NOT NULL DEFAULT '0.0000', `is_template` tinyint(1) NOT NULL DEFAULT '0', `template_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `date_mod` datetime DEFAULT NULL, `notepad` longtext COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`), KEY `is_recursive` (`is_recursive`), KEY `entities_id` (`entities_id`), KEY `is_deleted` (`is_deleted`), KEY `begin_date` (`begin_date`), KEY `is_template` (`is_template`), KEY `date_mod` (`date_mod`), KEY `end_date` (`end_date`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_calendars DROP TABLE IF EXISTS `glpi_calendars`; CREATE TABLE `glpi_calendars` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, `date_mod` datetime DEFAULT NULL, `cache_duration` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`), KEY `date_mod` (`date_mod`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `glpi_calendars` VALUES ('1','Default','0','1','Default calendar',NULL,'[0,43200,43200,43200,43200,43200,0]'); ### Dump table glpi_calendars_holidays DROP TABLE IF EXISTS `glpi_calendars_holidays`; CREATE TABLE `glpi_calendars_holidays` ( `id` int(11) NOT NULL AUTO_INCREMENT, `calendars_id` int(11) NOT NULL DEFAULT '0', `holidays_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`calendars_id`,`holidays_id`), KEY `holidays_id` (`holidays_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_calendarsegments DROP TABLE IF EXISTS `glpi_calendarsegments`; CREATE TABLE `glpi_calendarsegments` ( `id` int(11) NOT NULL AUTO_INCREMENT, `calendars_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `day` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'numer of the day based on date(w)', `begin` time DEFAULT NULL, `end` time DEFAULT NULL, PRIMARY KEY (`id`), KEY `calendars_id` (`calendars_id`), KEY `day` (`day`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `glpi_calendarsegments` VALUES ('1','1','0','0','1','08:00:00','20:00:00'); INSERT INTO `glpi_calendarsegments` VALUES ('2','1','0','0','2','08:00:00','20:00:00'); INSERT INTO `glpi_calendarsegments` VALUES ('3','1','0','0','3','08:00:00','20:00:00'); INSERT INTO `glpi_calendarsegments` VALUES ('4','1','0','0','4','08:00:00','20:00:00'); INSERT INTO `glpi_calendarsegments` VALUES ('5','1','0','0','5','08:00:00','20:00:00'); ### Dump table glpi_cartridgeitems DROP TABLE IF EXISTS `glpi_cartridgeitems`; CREATE TABLE `glpi_cartridgeitems` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `ref` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `locations_id` int(11) NOT NULL DEFAULT '0', `cartridgeitemtypes_id` int(11) NOT NULL DEFAULT '0', `manufacturers_id` int(11) NOT NULL DEFAULT '0', `users_id_tech` int(11) NOT NULL DEFAULT '0', `groups_id_tech` int(11) NOT NULL DEFAULT '0', `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, `alarm_threshold` int(11) NOT NULL DEFAULT '10', `notepad` longtext COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`), KEY `entities_id` (`entities_id`), KEY `manufacturers_id` (`manufacturers_id`), KEY `locations_id` (`locations_id`), KEY `users_id_tech` (`users_id_tech`), KEY `cartridgeitemtypes_id` (`cartridgeitemtypes_id`), KEY `is_deleted` (`is_deleted`), KEY `alarm_threshold` (`alarm_threshold`), KEY `groups_id_tech` (`groups_id_tech`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_cartridgeitems_printermodels DROP TABLE IF EXISTS `glpi_cartridgeitems_printermodels`; CREATE TABLE `glpi_cartridgeitems_printermodels` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cartridgeitems_id` int(11) NOT NULL DEFAULT '0', `printermodels_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`printermodels_id`,`cartridgeitems_id`), KEY `cartridgeitems_id` (`cartridgeitems_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_cartridgeitemtypes DROP TABLE IF EXISTS `glpi_cartridgeitemtypes`; CREATE TABLE `glpi_cartridgeitemtypes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_cartridges DROP TABLE IF EXISTS `glpi_cartridges`; CREATE TABLE `glpi_cartridges` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `cartridgeitems_id` int(11) NOT NULL DEFAULT '0', `printers_id` int(11) NOT NULL DEFAULT '0', `date_in` date DEFAULT NULL, `date_use` date DEFAULT NULL, `date_out` date DEFAULT NULL, `pages` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `cartridgeitems_id` (`cartridgeitems_id`), KEY `printers_id` (`printers_id`), KEY `entities_id` (`entities_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_computerdisks DROP TABLE IF EXISTS `glpi_computerdisks`; CREATE TABLE `glpi_computerdisks` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `computers_id` int(11) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `device` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `mountpoint` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `filesystems_id` int(11) NOT NULL DEFAULT '0', `totalsize` int(11) NOT NULL DEFAULT '0', `freesize` int(11) NOT NULL DEFAULT '0', `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `name` (`name`), KEY `device` (`device`), KEY `mountpoint` (`mountpoint`), KEY `totalsize` (`totalsize`), KEY `freesize` (`freesize`), KEY `computers_id` (`computers_id`), KEY `filesystems_id` (`filesystems_id`), KEY `entities_id` (`entities_id`), KEY `is_deleted` (`is_deleted`), KEY `is_dynamic` (`is_dynamic`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_computermodels DROP TABLE IF EXISTS `glpi_computermodels`; CREATE TABLE `glpi_computermodels` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_computers DROP TABLE IF EXISTS `glpi_computers`; CREATE TABLE `glpi_computers` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `serial` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `otherserial` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `contact` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `contact_num` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `users_id_tech` int(11) NOT NULL DEFAULT '0', `groups_id_tech` int(11) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, `date_mod` datetime DEFAULT NULL, `operatingsystems_id` int(11) NOT NULL DEFAULT '0', `operatingsystemversions_id` int(11) NOT NULL DEFAULT '0', `operatingsystemservicepacks_id` int(11) NOT NULL DEFAULT '0', `os_license_number` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `os_licenseid` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `autoupdatesystems_id` int(11) NOT NULL DEFAULT '0', `locations_id` int(11) NOT NULL DEFAULT '0', `domains_id` int(11) NOT NULL DEFAULT '0', `networks_id` int(11) NOT NULL DEFAULT '0', `computermodels_id` int(11) NOT NULL DEFAULT '0', `computertypes_id` int(11) NOT NULL DEFAULT '0', `is_template` tinyint(1) NOT NULL DEFAULT '0', `template_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `manufacturers_id` int(11) NOT NULL DEFAULT '0', `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `notepad` longtext COLLATE utf8_unicode_ci, `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', `users_id` int(11) NOT NULL DEFAULT '0', `groups_id` int(11) NOT NULL DEFAULT '0', `states_id` int(11) NOT NULL DEFAULT '0', `ticket_tco` decimal(20,4) DEFAULT '0.0000', `uuid` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `date_mod` (`date_mod`), KEY `name` (`name`), KEY `is_template` (`is_template`), KEY `autoupdatesystems_id` (`autoupdatesystems_id`), KEY `domains_id` (`domains_id`), KEY `entities_id` (`entities_id`), KEY `manufacturers_id` (`manufacturers_id`), KEY `groups_id` (`groups_id`), KEY `users_id` (`users_id`), KEY `locations_id` (`locations_id`), KEY `computermodels_id` (`computermodels_id`), KEY `networks_id` (`networks_id`), KEY `operatingsystems_id` (`operatingsystems_id`), KEY `operatingsystemservicepacks_id` (`operatingsystemservicepacks_id`), KEY `operatingsystemversions_id` (`operatingsystemversions_id`), KEY `states_id` (`states_id`), KEY `users_id_tech` (`users_id_tech`), KEY `computertypes_id` (`computertypes_id`), KEY `is_deleted` (`is_deleted`), KEY `groups_id_tech` (`groups_id_tech`), KEY `is_dynamic` (`is_dynamic`), KEY `serial` (`serial`), KEY `otherserial` (`otherserial`), KEY `uuid` (`uuid`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_computers_items DROP TABLE IF EXISTS `glpi_computers_items`; CREATE TABLE `glpi_computers_items` ( `id` int(11) NOT NULL AUTO_INCREMENT, `items_id` int(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to various table, according to itemtype (ID)', `computers_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `computers_id` (`computers_id`), KEY `item` (`itemtype`,`items_id`), KEY `is_deleted` (`is_deleted`), KEY `is_dynamic` (`is_dynamic`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_computers_softwarelicenses DROP TABLE IF EXISTS `glpi_computers_softwarelicenses`; CREATE TABLE `glpi_computers_softwarelicenses` ( `id` int(11) NOT NULL AUTO_INCREMENT, `computers_id` int(11) NOT NULL DEFAULT '0', `softwarelicenses_id` int(11) NOT NULL DEFAULT '0', `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`computers_id`,`softwarelicenses_id`), KEY `computers_id` (`computers_id`), KEY `softwarelicenses_id` (`softwarelicenses_id`), KEY `is_deleted` (`is_deleted`), KEY `is_dynamic` (`is_dynamic`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_computers_softwareversions DROP TABLE IF EXISTS `glpi_computers_softwareversions`; CREATE TABLE `glpi_computers_softwareversions` ( `id` int(11) NOT NULL AUTO_INCREMENT, `computers_id` int(11) NOT NULL DEFAULT '0', `softwareversions_id` int(11) NOT NULL DEFAULT '0', `is_deleted_computer` tinyint(1) NOT NULL DEFAULT '0', `is_template_computer` tinyint(1) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '0', `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`computers_id`,`softwareversions_id`), KEY `softwareversions_id` (`softwareversions_id`), KEY `computers_info` (`entities_id`,`is_template_computer`,`is_deleted_computer`), KEY `is_template` (`is_template_computer`), KEY `is_deleted` (`is_deleted_computer`), KEY `is_dynamic` (`is_dynamic`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_computertypes DROP TABLE IF EXISTS `glpi_computertypes`; CREATE TABLE `glpi_computertypes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_computervirtualmachines DROP TABLE IF EXISTS `glpi_computervirtualmachines`; CREATE TABLE `glpi_computervirtualmachines` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `computers_id` int(11) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `virtualmachinestates_id` int(11) NOT NULL DEFAULT '0', `virtualmachinesystems_id` int(11) NOT NULL DEFAULT '0', `virtualmachinetypes_id` int(11) NOT NULL DEFAULT '0', `uuid` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `vcpu` int(11) NOT NULL DEFAULT '0', `ram` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `computers_id` (`computers_id`), KEY `entities_id` (`entities_id`), KEY `name` (`name`), KEY `virtualmachinestates_id` (`virtualmachinestates_id`), KEY `virtualmachinesystems_id` (`virtualmachinesystems_id`), KEY `vcpu` (`vcpu`), KEY `ram` (`ram`), KEY `is_deleted` (`is_deleted`), KEY `is_dynamic` (`is_dynamic`), KEY `uuid` (`uuid`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_configs DROP TABLE IF EXISTS `glpi_configs`; CREATE TABLE `glpi_configs` ( `id` int(11) NOT NULL AUTO_INCREMENT, `show_jobs_at_login` tinyint(1) NOT NULL DEFAULT '0', `cut` int(11) NOT NULL DEFAULT '255', `list_limit` int(11) NOT NULL DEFAULT '20', `list_limit_max` int(11) NOT NULL DEFAULT '50', `url_maxlength` int(11) NOT NULL DEFAULT '30', `version` char(10) COLLATE utf8_unicode_ci DEFAULT NULL, `event_loglevel` int(11) NOT NULL DEFAULT '5', `use_mailing` tinyint(1) NOT NULL DEFAULT '0', `admin_email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `admin_email_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `admin_reply` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `admin_reply_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `mailing_signature` text COLLATE utf8_unicode_ci, `use_anonymous_helpdesk` tinyint(1) NOT NULL DEFAULT '0', `use_anonymous_followups` tinyint(1) NOT NULL DEFAULT '0', `language` char(10) COLLATE utf8_unicode_ci DEFAULT 'en_GB' COMMENT 'see define.php CFG_GLPI[language] array', `priority_1` char(20) COLLATE utf8_unicode_ci DEFAULT '#fff2f2', `priority_2` char(20) COLLATE utf8_unicode_ci DEFAULT '#ffe0e0', `priority_3` char(20) COLLATE utf8_unicode_ci DEFAULT '#ffcece', `priority_4` char(20) COLLATE utf8_unicode_ci DEFAULT '#ffbfbf', `priority_5` char(20) COLLATE utf8_unicode_ci DEFAULT '#ffadad', `priority_6` char(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '#ff5555', `date_tax` date NOT NULL DEFAULT '2005-12-31', `cas_host` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `cas_port` int(11) NOT NULL DEFAULT '443', `cas_uri` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `cas_logout` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `existing_auth_server_field_clean_domain` tinyint(1) NOT NULL DEFAULT '0', `planning_begin` time NOT NULL DEFAULT '08:00:00', `planning_end` time NOT NULL DEFAULT '20:00:00', `utf8_conv` int(11) NOT NULL DEFAULT '0', `use_public_faq` tinyint(1) NOT NULL DEFAULT '0', `url_base` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `show_link_in_mail` tinyint(1) NOT NULL DEFAULT '0', `text_login` text COLLATE utf8_unicode_ci, `founded_new_version` char(10) COLLATE utf8_unicode_ci DEFAULT NULL, `dropdown_max` int(11) NOT NULL DEFAULT '100', `ajax_wildcard` char(1) COLLATE utf8_unicode_ci DEFAULT '*', `use_ajax` tinyint(1) NOT NULL DEFAULT '0', `ajax_min_textsearch_load` int(11) NOT NULL DEFAULT '0', `ajax_buffertime_load` int(11) NOT NULL DEFAULT '0', `ajax_limit_count` int(11) NOT NULL DEFAULT '50', `use_ajax_autocompletion` tinyint(1) NOT NULL DEFAULT '1', `is_users_auto_add` tinyint(1) NOT NULL DEFAULT '1', `date_format` int(11) NOT NULL DEFAULT '0', `number_format` int(11) NOT NULL DEFAULT '0', `csv_delimiter` char(1) COLLATE utf8_unicode_ci NOT NULL, `is_ids_visible` tinyint(1) NOT NULL DEFAULT '0', `dropdown_chars_limit` int(11) NOT NULL DEFAULT '50', `smtp_mode` int(11) NOT NULL DEFAULT '0' COMMENT 'see define.php MAIL_* constant', `smtp_host` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `smtp_port` int(11) NOT NULL DEFAULT '25', `smtp_username` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `proxy_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `proxy_port` int(11) NOT NULL DEFAULT '8080', `proxy_user` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `add_followup_on_update_ticket` tinyint(1) NOT NULL DEFAULT '1', `keep_tickets_on_delete` tinyint(1) NOT NULL DEFAULT '1', `time_step` int(11) DEFAULT '5', `decimal_number` int(11) DEFAULT '2', `helpdesk_doc_url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `central_doc_url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `documentcategories_id_forticket` int(11) NOT NULL DEFAULT '0' COMMENT 'default category for documents added with a ticket', `monitors_management_restrict` int(11) NOT NULL DEFAULT '2', `phones_management_restrict` int(11) NOT NULL DEFAULT '2', `peripherals_management_restrict` int(11) NOT NULL DEFAULT '2', `printers_management_restrict` int(11) NOT NULL DEFAULT '2', `use_log_in_files` tinyint(1) NOT NULL DEFAULT '0', `time_offset` int(11) NOT NULL DEFAULT '0' COMMENT 'in seconds', `is_contact_autoupdate` tinyint(1) NOT NULL DEFAULT '1', `is_user_autoupdate` tinyint(1) NOT NULL DEFAULT '1', `is_group_autoupdate` tinyint(1) NOT NULL DEFAULT '1', `is_location_autoupdate` tinyint(1) NOT NULL DEFAULT '1', `state_autoupdate_mode` int(11) NOT NULL DEFAULT '0', `is_contact_autoclean` tinyint(1) NOT NULL DEFAULT '0', `is_user_autoclean` tinyint(1) NOT NULL DEFAULT '0', `is_group_autoclean` tinyint(1) NOT NULL DEFAULT '0', `is_location_autoclean` tinyint(1) NOT NULL DEFAULT '0', `state_autoclean_mode` int(11) NOT NULL DEFAULT '0', `use_flat_dropdowntree` tinyint(1) NOT NULL DEFAULT '0', `use_autoname_by_entity` tinyint(1) NOT NULL DEFAULT '1', `is_categorized_soft_expanded` tinyint(1) NOT NULL DEFAULT '1', `is_not_categorized_soft_expanded` tinyint(1) NOT NULL DEFAULT '1', `softwarecategories_id_ondelete` int(11) NOT NULL DEFAULT '0' COMMENT 'category applyed when a software is deleted', `x509_email_field` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `x509_cn_restrict` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `x509_o_restrict` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `x509_ou_restrict` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `default_mailcollector_filesize_max` int(11) NOT NULL DEFAULT '2097152', `followup_private` tinyint(1) NOT NULL DEFAULT '0', `task_private` tinyint(1) NOT NULL DEFAULT '0', `default_software_helpdesk_visible` tinyint(1) NOT NULL DEFAULT '1', `names_format` int(11) NOT NULL DEFAULT '0' COMMENT 'see *NAME_BEFORE constant in define.php', `default_graphtype` char(3) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'svg', `default_requesttypes_id` int(11) NOT NULL DEFAULT '1', `use_noright_users_add` tinyint(1) NOT NULL DEFAULT '1', `cron_limit` tinyint(4) NOT NULL DEFAULT '1' COMMENT 'Number of tasks execute by external cron', `priority_matrix` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'json encoded array for Urgence / Impact to Protority', `urgency_mask` int(11) NOT NULL DEFAULT '62', `impact_mask` int(11) NOT NULL DEFAULT '62', `user_deleted_ldap` tinyint(1) NOT NULL DEFAULT '0', `auto_create_infocoms` tinyint(1) NOT NULL DEFAULT '0', `use_slave_for_search` tinyint(1) NOT NULL DEFAULT '0', `proxy_passwd` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `smtp_passwd` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `transfers_id_auto` int(11) NOT NULL DEFAULT '0', `show_count_on_tabs` tinyint(1) NOT NULL DEFAULT '1', `refresh_ticket_list` int(11) NOT NULL DEFAULT '0', `set_default_tech` tinyint(1) NOT NULL DEFAULT '1', `allow_search_view` int(11) NOT NULL DEFAULT '2', `allow_search_all` tinyint(1) NOT NULL DEFAULT '1', `allow_search_global` tinyint(1) NOT NULL DEFAULT '1', `display_count_on_home` int(11) NOT NULL DEFAULT '5', `use_password_security` tinyint(1) NOT NULL DEFAULT '0', `password_min_length` int(11) NOT NULL DEFAULT '8', `password_need_number` tinyint(1) NOT NULL DEFAULT '1', `password_need_letter` tinyint(1) NOT NULL DEFAULT '1', `password_need_caps` tinyint(1) NOT NULL DEFAULT '1', `password_need_symbol` tinyint(1) NOT NULL DEFAULT '1', `use_check_pref` tinyint(1) NOT NULL DEFAULT '0', `notification_to_myself` tinyint(1) NOT NULL DEFAULT '1', `duedateok_color` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '#06ff00', `duedatewarning_color` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '#ffb800', `duedatecritical_color` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '#ff0000', `duedatewarning_less` int(11) NOT NULL DEFAULT '20', `duedatecritical_less` int(11) NOT NULL DEFAULT '5', `duedatewarning_unit` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '%', `duedatecritical_unit` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '%', `realname_ssofield` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `firstname_ssofield` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `email1_ssofield` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `email2_ssofield` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `email3_ssofield` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `email4_ssofield` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `phone_ssofield` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `phone2_ssofield` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `mobile_ssofield` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment_ssofield` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `title_ssofield` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `category_ssofield` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `language_ssofield` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `entity_ssofield` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `registration_number_ssofield` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `ssovariables_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `glpi_configs` VALUES ('1','0','250','15','50','30',' 0.84.3','5','0','admsys@localhost',NULL,NULL,NULL,'SIGNATURE','0','0','fr_FR','#fff2f2','#ffe0e0','#ffcece','#ffbfbf','#ffadad','#ff5555','2005-12-31','','443','',NULL,'0','08:00:00','20:00:00','1','0','http://localhost/glpi/','0','','','100','*','0','0','0','50','1','1','0','0',';','0','50','0',NULL,'25',NULL,NULL,'8080',NULL,'1','0','5','2',NULL,NULL,'0','2','2','2','2','1','0','1','1','1','1','0','0','0','0','0','0','0','1','1','1','1',NULL,NULL,NULL,NULL,'2097152','0','0','1','0','svg','1','1','1','{\"1\":{\"1\":1,\"2\":1,\"3\":2,\"4\":2,\"5\":2},\"2\":{\"1\":1,\"2\":2,\"3\":2,\"4\":3,\"5\":3},\"3\":{\"1\":2,\"2\":2,\"3\":3,\"4\":4,\"5\":4},\"4\":{\"1\":2,\"2\":3,\"3\":4,\"4\":4,\"5\":5},\"5\":{\"1\":2,\"2\":3,\"3\":4,\"4\":5,\"5\":5}}','62','62','0','0','0',NULL,NULL,'0','1','0','1','2','1','1','5','0','8','1','1','1','1','0','1','#06ff00','#ffb800','#ff0000','20','5','%','%',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0'); ### Dump table glpi_consumableitems DROP TABLE IF EXISTS `glpi_consumableitems`; CREATE TABLE `glpi_consumableitems` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `ref` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `locations_id` int(11) NOT NULL DEFAULT '0', `consumableitemtypes_id` int(11) NOT NULL DEFAULT '0', `manufacturers_id` int(11) NOT NULL DEFAULT '0', `users_id_tech` int(11) NOT NULL DEFAULT '0', `groups_id_tech` int(11) NOT NULL DEFAULT '0', `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, `alarm_threshold` int(11) NOT NULL DEFAULT '10', `notepad` longtext COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`), KEY `entities_id` (`entities_id`), KEY `manufacturers_id` (`manufacturers_id`), KEY `locations_id` (`locations_id`), KEY `users_id_tech` (`users_id_tech`), KEY `consumableitemtypes_id` (`consumableitemtypes_id`), KEY `is_deleted` (`is_deleted`), KEY `alarm_threshold` (`alarm_threshold`), KEY `groups_id_tech` (`groups_id_tech`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_consumableitemtypes DROP TABLE IF EXISTS `glpi_consumableitemtypes`; CREATE TABLE `glpi_consumableitemtypes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_consumables DROP TABLE IF EXISTS `glpi_consumables`; CREATE TABLE `glpi_consumables` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `consumableitems_id` int(11) NOT NULL DEFAULT '0', `date_in` date DEFAULT NULL, `date_out` date DEFAULT NULL, `itemtype` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `items_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `date_in` (`date_in`), KEY `date_out` (`date_out`), KEY `consumableitems_id` (`consumableitems_id`), KEY `entities_id` (`entities_id`), KEY `item` (`itemtype`,`items_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_contacts DROP TABLE IF EXISTS `glpi_contacts`; CREATE TABLE `glpi_contacts` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `firstname` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `phone` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `phone2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `mobile` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `fax` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `contacttypes_id` int(11) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `notepad` longtext COLLATE utf8_unicode_ci, `usertitles_id` int(11) NOT NULL DEFAULT '0', `address` text COLLATE utf8_unicode_ci, `postcode` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `town` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `state` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `country` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `name` (`name`), KEY `entities_id` (`entities_id`), KEY `contacttypes_id` (`contacttypes_id`), KEY `is_deleted` (`is_deleted`), KEY `usertitles_id` (`usertitles_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_contacts_suppliers DROP TABLE IF EXISTS `glpi_contacts_suppliers`; CREATE TABLE `glpi_contacts_suppliers` ( `id` int(11) NOT NULL AUTO_INCREMENT, `suppliers_id` int(11) NOT NULL DEFAULT '0', `contacts_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`suppliers_id`,`contacts_id`), KEY `contacts_id` (`contacts_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_contacttypes DROP TABLE IF EXISTS `glpi_contacttypes`; CREATE TABLE `glpi_contacttypes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_contractcosts DROP TABLE IF EXISTS `glpi_contractcosts`; CREATE TABLE `glpi_contractcosts` ( `id` int(11) NOT NULL AUTO_INCREMENT, `contracts_id` int(11) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `begin_date` date DEFAULT NULL, `end_date` date DEFAULT NULL, `cost` decimal(20,4) NOT NULL DEFAULT '0.0000', `budgets_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `name` (`name`), KEY `contracts_id` (`contracts_id`), KEY `begin_date` (`begin_date`), KEY `end_date` (`end_date`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`), KEY `budgets_id` (`budgets_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_contracts DROP TABLE IF EXISTS `glpi_contracts`; CREATE TABLE `glpi_contracts` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `num` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `contracttypes_id` int(11) NOT NULL DEFAULT '0', `begin_date` date DEFAULT NULL, `duration` int(11) NOT NULL DEFAULT '0', `notice` int(11) NOT NULL DEFAULT '0', `periodicity` int(11) NOT NULL DEFAULT '0', `billing` int(11) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, `accounting_number` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `week_begin_hour` time NOT NULL DEFAULT '00:00:00', `week_end_hour` time NOT NULL DEFAULT '00:00:00', `saturday_begin_hour` time NOT NULL DEFAULT '00:00:00', `saturday_end_hour` time NOT NULL DEFAULT '00:00:00', `use_saturday` tinyint(1) NOT NULL DEFAULT '0', `monday_begin_hour` time NOT NULL DEFAULT '00:00:00', `monday_end_hour` time NOT NULL DEFAULT '00:00:00', `use_monday` tinyint(1) NOT NULL DEFAULT '0', `max_links_allowed` int(11) NOT NULL DEFAULT '0', `notepad` longtext COLLATE utf8_unicode_ci, `alert` int(11) NOT NULL DEFAULT '0', `renewal` int(11) NOT NULL DEFAULT '0', `template_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `is_template` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `begin_date` (`begin_date`), KEY `name` (`name`), KEY `contracttypes_id` (`contracttypes_id`), KEY `entities_id` (`entities_id`), KEY `is_deleted` (`is_deleted`), KEY `use_monday` (`use_monday`), KEY `use_saturday` (`use_saturday`), KEY `alert` (`alert`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_contracts_items DROP TABLE IF EXISTS `glpi_contracts_items`; CREATE TABLE `glpi_contracts_items` ( `id` int(11) NOT NULL AUTO_INCREMENT, `contracts_id` int(11) NOT NULL DEFAULT '0', `items_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(100) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`contracts_id`,`itemtype`,`items_id`), KEY `FK_device` (`items_id`,`itemtype`), KEY `item` (`itemtype`,`items_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_contracts_suppliers DROP TABLE IF EXISTS `glpi_contracts_suppliers`; CREATE TABLE `glpi_contracts_suppliers` ( `id` int(11) NOT NULL AUTO_INCREMENT, `suppliers_id` int(11) NOT NULL DEFAULT '0', `contracts_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`suppliers_id`,`contracts_id`), KEY `contracts_id` (`contracts_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_contracttypes DROP TABLE IF EXISTS `glpi_contracttypes`; CREATE TABLE `glpi_contracttypes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_crontasklogs DROP TABLE IF EXISTS `glpi_crontasklogs`; CREATE TABLE `glpi_crontasklogs` ( `id` int(11) NOT NULL AUTO_INCREMENT, `crontasks_id` int(11) NOT NULL, `crontasklogs_id` int(11) NOT NULL COMMENT 'id of ''start'' event', `date` datetime NOT NULL, `state` int(11) NOT NULL COMMENT '0:start, 1:run, 2:stop', `elapsed` float NOT NULL COMMENT 'time elapsed since start', `volume` int(11) NOT NULL COMMENT 'for statistics', `content` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'message', PRIMARY KEY (`id`), KEY `date` (`date`), KEY `crontasks_id` (`crontasks_id`), KEY `crontasklogs_id_state` (`crontasklogs_id`,`state`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_crontasks DROP TABLE IF EXISTS `glpi_crontasks`; CREATE TABLE `glpi_crontasks` ( `id` int(11) NOT NULL AUTO_INCREMENT, `itemtype` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `name` varchar(150) COLLATE utf8_unicode_ci NOT NULL COMMENT 'task name', `frequency` int(11) NOT NULL COMMENT 'second between launch', `param` int(11) DEFAULT NULL COMMENT 'task specify parameter', `state` int(11) NOT NULL DEFAULT '1' COMMENT '0:disabled, 1:waiting, 2:running', `mode` int(11) NOT NULL DEFAULT '1' COMMENT '1:internal, 2:external', `allowmode` int(11) NOT NULL DEFAULT '3' COMMENT '1:internal, 2:external, 3:both', `hourmin` int(11) NOT NULL DEFAULT '0', `hourmax` int(11) NOT NULL DEFAULT '24', `logs_lifetime` int(11) NOT NULL DEFAULT '30' COMMENT 'number of days', `lastrun` datetime DEFAULT NULL COMMENT 'last run date', `lastcode` int(11) DEFAULT NULL COMMENT 'last run return code', `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`itemtype`,`name`), KEY `mode` (`mode`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Task run by internal / external cron.'; INSERT INTO `glpi_crontasks` VALUES ('2','CartridgeItem','cartridge','86400','10','0','1','3','0','24','30',NULL,NULL,NULL); INSERT INTO `glpi_crontasks` VALUES ('3','ConsumableItem','consumable','86400','10','0','1','3','0','24','30',NULL,NULL,NULL); INSERT INTO `glpi_crontasks` VALUES ('4','SoftwareLicense','software','86400',NULL,'0','1','3','0','24','30',NULL,NULL,NULL); INSERT INTO `glpi_crontasks` VALUES ('5','Contract','contract','86400',NULL,'1','1','3','0','24','30','2010-05-06 09:31:02',NULL,NULL); INSERT INTO `glpi_crontasks` VALUES ('6','InfoCom','infocom','86400',NULL,'1','1','3','0','24','30','2011-01-18 11:40:43',NULL,NULL); INSERT INTO `glpi_crontasks` VALUES ('7','CronTask','logs','86400','30','0','1','3','0','24','30',NULL,NULL,NULL); INSERT INTO `glpi_crontasks` VALUES ('8','CronTask','optimize','604800',NULL,'1','1','3','0','24','30','2011-03-04 11:35:21',NULL,NULL); INSERT INTO `glpi_crontasks` VALUES ('9','MailCollector','mailgate','600','10','1','1','3','0','24','30','2011-06-28 11:34:37',NULL,NULL); INSERT INTO `glpi_crontasks` VALUES ('10','DBconnection','checkdbreplicate','300',NULL,'0','1','3','0','24','30',NULL,NULL,NULL); INSERT INTO `glpi_crontasks` VALUES ('11','CronTask','checkupdate','604800',NULL,'0','1','3','0','24','30',NULL,NULL,NULL); INSERT INTO `glpi_crontasks` VALUES ('12','CronTask','session','86400',NULL,'1','1','3','0','24','30','2011-08-30 08:22:27',NULL,NULL); INSERT INTO `glpi_crontasks` VALUES ('13','CronTask','graph','3600',NULL,'1','1','3','0','24','30','2011-12-06 09:48:42',NULL,NULL); INSERT INTO `glpi_crontasks` VALUES ('14','ReservationItem','reservation','3600',NULL,'1','1','3','0','24','30','2012-04-05 20:31:57',NULL,NULL); INSERT INTO `glpi_crontasks` VALUES ('15','Ticket','closeticket','43200',NULL,'1','1','3','0','24','30','2013-05-28 09:51:00',NULL,NULL); INSERT INTO `glpi_crontasks` VALUES ('16','Ticket','alertnotclosed','43200',NULL,'1','1','3','0','24','30','2013-09-03 09:47:00',NULL,NULL); INSERT INTO `glpi_crontasks` VALUES ('17','SlaLevel_Ticket','slaticket','300',NULL,'1','1','3','0','24','30',NULL,NULL,NULL); INSERT INTO `glpi_crontasks` VALUES ('18','Ticket','createinquest','86400',NULL,'1','1','3','0','24','30',NULL,NULL,NULL); INSERT INTO `glpi_crontasks` VALUES ('19','Crontask','watcher','86400',NULL,'1','1','3','0','24','30',NULL,NULL,NULL); INSERT INTO `glpi_crontasks` VALUES ('20','TicketRecurrent','ticketrecurrent','3600',NULL,'1','1','3','0','24','30',NULL,NULL,NULL); INSERT INTO `glpi_crontasks` VALUES ('21','PlanningRecall','planningrecall','300',NULL,'1','1','3','0','24','30',NULL,NULL,NULL); ### Dump table glpi_devicecases DROP TABLE IF EXISTS `glpi_devicecases`; CREATE TABLE `glpi_devicecases` ( `id` int(11) NOT NULL AUTO_INCREMENT, `designation` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `devicecasetypes_id` int(11) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, `manufacturers_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `designation` (`designation`), KEY `manufacturers_id` (`manufacturers_id`), KEY `devicecasetypes_id` (`devicecasetypes_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_devicecasetypes DROP TABLE IF EXISTS `glpi_devicecasetypes`; CREATE TABLE `glpi_devicecasetypes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_devicecontrols DROP TABLE IF EXISTS `glpi_devicecontrols`; CREATE TABLE `glpi_devicecontrols` ( `id` int(11) NOT NULL AUTO_INCREMENT, `designation` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `is_raid` tinyint(1) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, `manufacturers_id` int(11) NOT NULL DEFAULT '0', `interfacetypes_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `designation` (`designation`), KEY `manufacturers_id` (`manufacturers_id`), KEY `interfacetypes_id` (`interfacetypes_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_devicedrives DROP TABLE IF EXISTS `glpi_devicedrives`; CREATE TABLE `glpi_devicedrives` ( `id` int(11) NOT NULL AUTO_INCREMENT, `designation` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `is_writer` tinyint(1) NOT NULL DEFAULT '1', `speed` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `manufacturers_id` int(11) NOT NULL DEFAULT '0', `interfacetypes_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `designation` (`designation`), KEY `manufacturers_id` (`manufacturers_id`), KEY `interfacetypes_id` (`interfacetypes_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_devicegraphiccards DROP TABLE IF EXISTS `glpi_devicegraphiccards`; CREATE TABLE `glpi_devicegraphiccards` ( `id` int(11) NOT NULL AUTO_INCREMENT, `designation` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `interfacetypes_id` int(11) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, `manufacturers_id` int(11) NOT NULL DEFAULT '0', `memory_default` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `designation` (`designation`), KEY `manufacturers_id` (`manufacturers_id`), KEY `interfacetypes_id` (`interfacetypes_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_deviceharddrives DROP TABLE IF EXISTS `glpi_deviceharddrives`; CREATE TABLE `glpi_deviceharddrives` ( `id` int(11) NOT NULL AUTO_INCREMENT, `designation` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `rpm` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `interfacetypes_id` int(11) NOT NULL DEFAULT '0', `cache` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `manufacturers_id` int(11) NOT NULL DEFAULT '0', `capacity_default` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `designation` (`designation`), KEY `manufacturers_id` (`manufacturers_id`), KEY `interfacetypes_id` (`interfacetypes_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_devicememories DROP TABLE IF EXISTS `glpi_devicememories`; CREATE TABLE `glpi_devicememories` ( `id` int(11) NOT NULL AUTO_INCREMENT, `designation` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `frequence` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `manufacturers_id` int(11) NOT NULL DEFAULT '0', `size_default` int(11) NOT NULL DEFAULT '0', `devicememorytypes_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `designation` (`designation`), KEY `manufacturers_id` (`manufacturers_id`), KEY `devicememorytypes_id` (`devicememorytypes_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_devicememorytypes DROP TABLE IF EXISTS `glpi_devicememorytypes`; CREATE TABLE `glpi_devicememorytypes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `glpi_devicememorytypes` VALUES ('1','EDO',NULL); INSERT INTO `glpi_devicememorytypes` VALUES ('2','DDR',NULL); INSERT INTO `glpi_devicememorytypes` VALUES ('3','SDRAM',NULL); INSERT INTO `glpi_devicememorytypes` VALUES ('4','SDRAM-2',NULL); ### Dump table glpi_devicemotherboards DROP TABLE IF EXISTS `glpi_devicemotherboards`; CREATE TABLE `glpi_devicemotherboards` ( `id` int(11) NOT NULL AUTO_INCREMENT, `designation` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `chipset` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `manufacturers_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `designation` (`designation`), KEY `manufacturers_id` (`manufacturers_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_devicenetworkcards DROP TABLE IF EXISTS `glpi_devicenetworkcards`; CREATE TABLE `glpi_devicenetworkcards` ( `id` int(11) NOT NULL AUTO_INCREMENT, `designation` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `bandwidth` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `manufacturers_id` int(11) NOT NULL DEFAULT '0', `mac_default` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `designation` (`designation`), KEY `manufacturers_id` (`manufacturers_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_devicepcis DROP TABLE IF EXISTS `glpi_devicepcis`; CREATE TABLE `glpi_devicepcis` ( `id` int(11) NOT NULL AUTO_INCREMENT, `designation` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `manufacturers_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `designation` (`designation`), KEY `manufacturers_id` (`manufacturers_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_devicepowersupplies DROP TABLE IF EXISTS `glpi_devicepowersupplies`; CREATE TABLE `glpi_devicepowersupplies` ( `id` int(11) NOT NULL AUTO_INCREMENT, `designation` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `power` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `is_atx` tinyint(1) NOT NULL DEFAULT '1', `comment` text COLLATE utf8_unicode_ci, `manufacturers_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `designation` (`designation`), KEY `manufacturers_id` (`manufacturers_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_deviceprocessors DROP TABLE IF EXISTS `glpi_deviceprocessors`; CREATE TABLE `glpi_deviceprocessors` ( `id` int(11) NOT NULL AUTO_INCREMENT, `designation` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `frequence` int(11) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, `manufacturers_id` int(11) NOT NULL DEFAULT '0', `frequency_default` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `designation` (`designation`), KEY `manufacturers_id` (`manufacturers_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_devicesoundcards DROP TABLE IF EXISTS `glpi_devicesoundcards`; CREATE TABLE `glpi_devicesoundcards` ( `id` int(11) NOT NULL AUTO_INCREMENT, `designation` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `type` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `manufacturers_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `designation` (`designation`), KEY `manufacturers_id` (`manufacturers_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_displaypreferences DROP TABLE IF EXISTS `glpi_displaypreferences`; CREATE TABLE `glpi_displaypreferences` ( `id` int(11) NOT NULL AUTO_INCREMENT, `itemtype` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `num` int(11) NOT NULL DEFAULT '0', `rank` int(11) NOT NULL DEFAULT '0', `users_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`users_id`,`itemtype`,`num`), KEY `rank` (`rank`), KEY `num` (`num`), KEY `itemtype` (`itemtype`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `glpi_displaypreferences` VALUES ('32','Computer','4','4','0'); INSERT INTO `glpi_displaypreferences` VALUES ('34','Computer','45','6','0'); INSERT INTO `glpi_displaypreferences` VALUES ('33','Computer','40','5','0'); INSERT INTO `glpi_displaypreferences` VALUES ('31','Computer','5','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('30','Computer','23','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('86','DocumentType','3','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('49','Monitor','31','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('50','Monitor','23','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('51','Monitor','3','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('52','Monitor','4','4','0'); INSERT INTO `glpi_displaypreferences` VALUES ('44','Printer','31','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('38','NetworkEquipment','31','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('39','NetworkEquipment','23','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('45','Printer','23','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('46','Printer','3','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('63','Software','4','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('62','Software','5','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('61','Software','23','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('83','CartridgeItem','4','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('82','CartridgeItem','34','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('57','Peripheral','3','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('56','Peripheral','23','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('55','Peripheral','31','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('29','Computer','31','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('35','Computer','3','7','0'); INSERT INTO `glpi_displaypreferences` VALUES ('36','Computer','19','8','0'); INSERT INTO `glpi_displaypreferences` VALUES ('37','Computer','17','9','0'); INSERT INTO `glpi_displaypreferences` VALUES ('40','NetworkEquipment','3','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('41','NetworkEquipment','4','4','0'); INSERT INTO `glpi_displaypreferences` VALUES ('42','NetworkEquipment','11','6','0'); INSERT INTO `glpi_displaypreferences` VALUES ('43','NetworkEquipment','19','7','0'); INSERT INTO `glpi_displaypreferences` VALUES ('47','Printer','4','4','0'); INSERT INTO `glpi_displaypreferences` VALUES ('48','Printer','19','6','0'); INSERT INTO `glpi_displaypreferences` VALUES ('53','Monitor','19','6','0'); INSERT INTO `glpi_displaypreferences` VALUES ('54','Monitor','7','7','0'); INSERT INTO `glpi_displaypreferences` VALUES ('58','Peripheral','4','4','0'); INSERT INTO `glpi_displaypreferences` VALUES ('59','Peripheral','19','6','0'); INSERT INTO `glpi_displaypreferences` VALUES ('60','Peripheral','7','7','0'); INSERT INTO `glpi_displaypreferences` VALUES ('64','Contact','3','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('65','Contact','4','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('66','Contact','5','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('67','Contact','6','4','0'); INSERT INTO `glpi_displaypreferences` VALUES ('68','Contact','9','5','0'); INSERT INTO `glpi_displaypreferences` VALUES ('69','Supplier','9','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('70','Supplier','3','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('71','Supplier','4','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('72','Supplier','5','4','0'); INSERT INTO `glpi_displaypreferences` VALUES ('73','Supplier','10','5','0'); INSERT INTO `glpi_displaypreferences` VALUES ('74','Supplier','6','6','0'); INSERT INTO `glpi_displaypreferences` VALUES ('75','Contract','4','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('76','Contract','3','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('77','Contract','5','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('78','Contract','6','4','0'); INSERT INTO `glpi_displaypreferences` VALUES ('79','Contract','7','5','0'); INSERT INTO `glpi_displaypreferences` VALUES ('80','Contract','11','6','0'); INSERT INTO `glpi_displaypreferences` VALUES ('84','CartridgeItem','23','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('85','CartridgeItem','3','4','0'); INSERT INTO `glpi_displaypreferences` VALUES ('88','DocumentType','6','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('89','DocumentType','4','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('90','DocumentType','5','4','0'); INSERT INTO `glpi_displaypreferences` VALUES ('91','Document','3','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('92','Document','4','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('93','Document','7','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('94','Document','5','4','0'); INSERT INTO `glpi_displaypreferences` VALUES ('95','Document','16','5','0'); INSERT INTO `glpi_displaypreferences` VALUES ('96','User','34','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('98','User','5','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('99','User','6','4','0'); INSERT INTO `glpi_displaypreferences` VALUES ('100','User','3','5','0'); INSERT INTO `glpi_displaypreferences` VALUES ('101','ConsumableItem','34','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('102','ConsumableItem','4','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('103','ConsumableItem','23','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('104','ConsumableItem','3','4','0'); INSERT INTO `glpi_displaypreferences` VALUES ('105','NetworkEquipment','40','5','0'); INSERT INTO `glpi_displaypreferences` VALUES ('106','Printer','40','5','0'); INSERT INTO `glpi_displaypreferences` VALUES ('107','Monitor','40','5','0'); INSERT INTO `glpi_displaypreferences` VALUES ('108','Peripheral','40','5','0'); INSERT INTO `glpi_displaypreferences` VALUES ('109','User','8','6','0'); INSERT INTO `glpi_displaypreferences` VALUES ('110','Phone','31','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('111','Phone','23','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('112','Phone','3','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('113','Phone','4','4','0'); INSERT INTO `glpi_displaypreferences` VALUES ('114','Phone','40','5','0'); INSERT INTO `glpi_displaypreferences` VALUES ('115','Phone','19','6','0'); INSERT INTO `glpi_displaypreferences` VALUES ('116','Phone','7','7','0'); INSERT INTO `glpi_displaypreferences` VALUES ('117','Group','16','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('118','AllAssets','31','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('119','ReservationItem','4','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('120','ReservationItem','3','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('125','Budget','3','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('122','Software','72','4','0'); INSERT INTO `glpi_displaypreferences` VALUES ('123','Software','163','5','0'); INSERT INTO `glpi_displaypreferences` VALUES ('124','Budget','5','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('126','Budget','4','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('127','Budget','19','4','0'); INSERT INTO `glpi_displaypreferences` VALUES ('128','Crontask','8','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('129','Crontask','3','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('130','Crontask','4','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('131','Crontask','7','4','0'); INSERT INTO `glpi_displaypreferences` VALUES ('132','RequestType','14','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('133','RequestType','15','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('134','NotificationTemplate','4','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('135','NotificationTemplate','16','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('136','Notification','5','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('137','Notification','6','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('138','Notification','2','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('139','Notification','4','4','0'); INSERT INTO `glpi_displaypreferences` VALUES ('140','Notification','80','5','0'); INSERT INTO `glpi_displaypreferences` VALUES ('141','Notification','86','6','0'); INSERT INTO `glpi_displaypreferences` VALUES ('142','MailCollector','2','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('143','MailCollector','19','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('144','AuthLDAP','3','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('145','AuthLDAP','19','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('146','AuthMail','3','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('147','AuthMail','19','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('210','IPNetwork','14','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('209','WifiNetwork','10','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('150','Profile','2','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('151','Profile','3','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('152','Profile','19','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('153','Transfer','19','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('154','TicketValidation','3','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('155','TicketValidation','2','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('156','TicketValidation','8','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('157','TicketValidation','4','4','0'); INSERT INTO `glpi_displaypreferences` VALUES ('158','TicketValidation','9','5','0'); INSERT INTO `glpi_displaypreferences` VALUES ('159','TicketValidation','7','6','0'); INSERT INTO `glpi_displaypreferences` VALUES ('160','NotImportedEmail','2','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('161','NotImportedEmail','5','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('162','NotImportedEmail','4','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('163','NotImportedEmail','6','4','0'); INSERT INTO `glpi_displaypreferences` VALUES ('164','NotImportedEmail','16','5','0'); INSERT INTO `glpi_displaypreferences` VALUES ('165','NotImportedEmail','19','6','0'); INSERT INTO `glpi_displaypreferences` VALUES ('166','RuleRightParameter','11','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('167','Ticket','12','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('168','Ticket','19','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('169','Ticket','15','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('170','Ticket','3','4','0'); INSERT INTO `glpi_displaypreferences` VALUES ('171','Ticket','4','5','0'); INSERT INTO `glpi_displaypreferences` VALUES ('172','Ticket','5','6','0'); INSERT INTO `glpi_displaypreferences` VALUES ('173','Ticket','7','7','0'); INSERT INTO `glpi_displaypreferences` VALUES ('174','Calendar','19','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('175','Holiday','11','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('176','Holiday','12','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('177','Holiday','13','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('178','SLA','4','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('179','Ticket','18','8','0'); INSERT INTO `glpi_displaypreferences` VALUES ('180','AuthLdap','30','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('181','AuthMail','6','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('208','FQDN','11','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('183','FieldUnicity','1','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('184','FieldUnicity','80','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('185','FieldUnicity','4','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('186','FieldUnicity','3','4','0'); INSERT INTO `glpi_displaypreferences` VALUES ('187','FieldUnicity','86','5','0'); INSERT INTO `glpi_displaypreferences` VALUES ('188','FieldUnicity','30','6','0'); INSERT INTO `glpi_displaypreferences` VALUES ('189','Problem','21','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('190','Problem','12','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('191','Problem','19','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('192','Problem','15','4','0'); INSERT INTO `glpi_displaypreferences` VALUES ('193','Problem','3','5','0'); INSERT INTO `glpi_displaypreferences` VALUES ('194','Problem','7','6','0'); INSERT INTO `glpi_displaypreferences` VALUES ('195','Problem','18','7','0'); INSERT INTO `glpi_displaypreferences` VALUES ('196','Vlan','11','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('197','TicketRecurrent','11','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('198','TicketRecurrent','12','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('199','TicketRecurrent','13','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('200','TicketRecurrent','15','4','0'); INSERT INTO `glpi_displaypreferences` VALUES ('201','TicketRecurrent','14','5','0'); INSERT INTO `glpi_displaypreferences` VALUES ('202','Reminder','2','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('203','Reminder','3','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('204','Reminder','4','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('205','Reminder','5','4','0'); INSERT INTO `glpi_displaypreferences` VALUES ('206','Reminder','6','5','0'); INSERT INTO `glpi_displaypreferences` VALUES ('207','Reminder','7','6','0'); INSERT INTO `glpi_displaypreferences` VALUES ('211','IPNetwork','10','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('212','IPNetwork','11','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('213','IPNetwork','12','4','0'); INSERT INTO `glpi_displaypreferences` VALUES ('214','IPNetwork','13','5','0'); INSERT INTO `glpi_displaypreferences` VALUES ('215','NetworkName','12','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('216','NetworkName','13','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('217','RSSFeed','2','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('218','RSSFeed','4','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('219','RSSFeed','5','3','0'); INSERT INTO `glpi_displaypreferences` VALUES ('220','RSSFeed','19','4','0'); INSERT INTO `glpi_displaypreferences` VALUES ('221','RSSFeed','6','5','0'); INSERT INTO `glpi_displaypreferences` VALUES ('222','RSSFeed','7','6','0'); INSERT INTO `glpi_displaypreferences` VALUES ('223','Blacklist','12','1','0'); INSERT INTO `glpi_displaypreferences` VALUES ('224','Blacklist','11','2','0'); INSERT INTO `glpi_displaypreferences` VALUES ('225','ReservationItem','5','3','0'); ### Dump table glpi_documentcategories DROP TABLE IF EXISTS `glpi_documentcategories`; CREATE TABLE `glpi_documentcategories` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `documentcategories_id` int(11) NOT NULL DEFAULT '0', `completename` text COLLATE utf8_unicode_ci, `level` int(11) NOT NULL DEFAULT '0', `ancestors_cache` longtext COLLATE utf8_unicode_ci, `sons_cache` longtext COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`), KEY `unicity` (`documentcategories_id`,`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_documents DROP TABLE IF EXISTS `glpi_documents`; CREATE TABLE `glpi_documents` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `filename` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'for display and transfert', `filepath` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'file storage path', `documentcategories_id` int(11) NOT NULL DEFAULT '0', `mime` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `date_mod` datetime DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `link` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `notepad` longtext COLLATE utf8_unicode_ci, `users_id` int(11) NOT NULL DEFAULT '0', `tickets_id` int(11) NOT NULL DEFAULT '0', `sha1sum` char(40) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `date_mod` (`date_mod`), KEY `name` (`name`), KEY `entities_id` (`entities_id`), KEY `tickets_id` (`tickets_id`), KEY `users_id` (`users_id`), KEY `documentcategories_id` (`documentcategories_id`), KEY `is_deleted` (`is_deleted`), KEY `sha1sum` (`sha1sum`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_documents_items DROP TABLE IF EXISTS `glpi_documents_items`; CREATE TABLE `glpi_documents_items` ( `id` int(11) NOT NULL AUTO_INCREMENT, `documents_id` int(11) NOT NULL DEFAULT '0', `items_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `date_mod` datetime DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`documents_id`,`itemtype`,`items_id`), KEY `item` (`itemtype`,`items_id`,`entities_id`,`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_documenttypes DROP TABLE IF EXISTS `glpi_documenttypes`; CREATE TABLE `glpi_documenttypes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `ext` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `icon` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `mime` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `is_uploadable` tinyint(1) NOT NULL DEFAULT '1', `date_mod` datetime DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`ext`), KEY `name` (`name`), KEY `is_uploadable` (`is_uploadable`), KEY `date_mod` (`date_mod`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `glpi_documenttypes` VALUES ('1','JPEG','jpg','jpg-dist.png','','1','2004-12-13 19:47:21',NULL); INSERT INTO `glpi_documenttypes` VALUES ('2','PNG','png','png-dist.png','','1','2004-12-13 19:47:21',NULL); INSERT INTO `glpi_documenttypes` VALUES ('3','GIF','gif','gif-dist.png','','1','2004-12-13 19:47:21',NULL); INSERT INTO `glpi_documenttypes` VALUES ('4','BMP','bmp','bmp-dist.png','','1','2004-12-13 19:47:21',NULL); INSERT INTO `glpi_documenttypes` VALUES ('5','Photoshop','psd','psd-dist.png','','1','2004-12-13 19:47:21',NULL); INSERT INTO `glpi_documenttypes` VALUES ('6','TIFF','tif','tif-dist.png','','1','2004-12-13 19:47:21',NULL); INSERT INTO `glpi_documenttypes` VALUES ('7','AIFF','aiff','aiff-dist.png','','1','2004-12-13 19:47:21',NULL); INSERT INTO `glpi_documenttypes` VALUES ('8','Windows Media','asf','asf-dist.png','','1','2004-12-13 19:47:21',NULL); INSERT INTO `glpi_documenttypes` VALUES ('9','Windows Media','avi','avi-dist.png','','1','2004-12-13 19:47:21',NULL); INSERT INTO `glpi_documenttypes` VALUES ('44','C source','c','c-dist.png','','1','2011-12-06 09:48:34',NULL); INSERT INTO `glpi_documenttypes` VALUES ('27','RealAudio','rm','rm-dist.png','','1','2004-12-13 19:47:21',NULL); INSERT INTO `glpi_documenttypes` VALUES ('16','Midi','mid','mid-dist.png','','1','2004-12-13 19:47:21',NULL); INSERT INTO `glpi_documenttypes` VALUES ('17','QuickTime','mov','mov-dist.png','','1','2004-12-13 19:47:21',NULL); INSERT INTO `glpi_documenttypes` VALUES ('18','MP3','mp3','mp3-dist.png','','1','2004-12-13 19:47:21',NULL); INSERT INTO `glpi_documenttypes` VALUES ('19','MPEG','mpg','mpg-dist.png','','1','2004-12-13 19:47:21',NULL); INSERT INTO `glpi_documenttypes` VALUES ('20','Ogg Vorbis','ogg','ogg-dist.png','','1','2004-12-13 19:47:21',NULL); INSERT INTO `glpi_documenttypes` VALUES ('24','QuickTime','qt','qt-dist.png','','1','2004-12-13 19:47:21',NULL); INSERT INTO `glpi_documenttypes` VALUES ('10','BZip','bz2','bz2-dist.png','','1','2004-12-13 19:47:21',NULL); INSERT INTO `glpi_documenttypes` VALUES ('25','RealAudio','ra','ra-dist.png','','1','2004-12-13 19:47:21',NULL); INSERT INTO `glpi_documenttypes` VALUES ('26','RealAudio','ram','ram-dist.png','','1','2004-12-13 19:47:21',NULL); INSERT INTO `glpi_documenttypes` VALUES ('11','Word','doc','doc-dist.png','','1','2004-12-13 19:47:21',NULL); INSERT INTO `glpi_documenttypes` VALUES ('12','DjVu','djvu','','','1','2004-12-13 19:47:21',NULL); INSERT INTO `glpi_documenttypes` VALUES ('42','MNG','mng','','','1','2004-12-13 19:47:22',NULL); INSERT INTO `glpi_documenttypes` VALUES ('13','PostScript','eps','ps-dist.png','','1','2004-12-13 19:47:21',NULL); INSERT INTO `glpi_documenttypes` VALUES ('14','GZ','gz','gz-dist.png','','1','2004-12-13 19:47:21',NULL); INSERT INTO `glpi_documenttypes` VALUES ('37','WAV','wav','wav-dist.png','','1','2004-12-13 19:47:22',NULL); INSERT INTO `glpi_documenttypes` VALUES ('15','HTML','html','html-dist.png','','1','2004-12-13 19:47:21',NULL); INSERT INTO `glpi_documenttypes` VALUES ('34','Flash','swf','swf-dist.png','','1','2011-12-06 09:48:34',NULL); INSERT INTO `glpi_documenttypes` VALUES ('21','PDF','pdf','pdf-dist.png','','1','2004-12-13 19:47:21',NULL); INSERT INTO `glpi_documenttypes` VALUES ('22','PowerPoint','ppt','ppt-dist.png','','1','2004-12-13 19:47:21',NULL); INSERT INTO `glpi_documenttypes` VALUES ('23','PostScript','ps','ps-dist.png','','1','2004-12-13 19:47:21',NULL); INSERT INTO `glpi_documenttypes` VALUES ('40','Windows Media','wmv','wmv-dist.png','','1','2011-12-06 09:48:34',NULL); INSERT INTO `glpi_documenttypes` VALUES ('28','RTF','rtf','rtf-dist.png','','1','2004-12-13 19:47:21',NULL); INSERT INTO `glpi_documenttypes` VALUES ('29','StarOffice','sdd','sdd-dist.png','','1','2004-12-13 19:47:22',NULL); INSERT INTO `glpi_documenttypes` VALUES ('30','StarOffice','sdw','sdw-dist.png','','1','2004-12-13 19:47:22',NULL); INSERT INTO `glpi_documenttypes` VALUES ('31','Stuffit','sit','sit-dist.png','','1','2004-12-13 19:47:22',NULL); INSERT INTO `glpi_documenttypes` VALUES ('43','Adobe Illustrator','ai','ai-dist.png','','1','2004-12-13 19:47:22',NULL); INSERT INTO `glpi_documenttypes` VALUES ('32','OpenOffice Impress','sxi','sxi-dist.png','','1','2004-12-13 19:47:22',NULL); INSERT INTO `glpi_documenttypes` VALUES ('33','OpenOffice','sxw','sxw-dist.png','','1','2004-12-13 19:47:22',NULL); INSERT INTO `glpi_documenttypes` VALUES ('46','DVI','dvi','dvi-dist.png','','1','2004-12-13 19:47:22',NULL); INSERT INTO `glpi_documenttypes` VALUES ('35','TGZ','tgz','tgz-dist.png','','1','2004-12-13 19:47:22',NULL); INSERT INTO `glpi_documenttypes` VALUES ('36','texte','txt','txt-dist.png','','1','2004-12-13 19:47:22',NULL); INSERT INTO `glpi_documenttypes` VALUES ('49','RedHat/Mandrake/SuSE','rpm','rpm-dist.png','','1','2004-12-13 19:47:22',NULL); INSERT INTO `glpi_documenttypes` VALUES ('38','Excel','xls','xls-dist.png','','1','2004-12-13 19:47:22',NULL); INSERT INTO `glpi_documenttypes` VALUES ('39','XML','xml','xml-dist.png','','1','2004-12-13 19:47:22',NULL); INSERT INTO `glpi_documenttypes` VALUES ('41','Zip','zip','zip-dist.png','','1','2011-12-06 09:48:34',NULL); INSERT INTO `glpi_documenttypes` VALUES ('45','Debian','deb','deb-dist.png','','1','2004-12-13 19:47:22',NULL); INSERT INTO `glpi_documenttypes` VALUES ('47','C header','h','h-dist.png','','1','2011-12-06 09:48:34',NULL); INSERT INTO `glpi_documenttypes` VALUES ('48','Pascal','pas','pas-dist.png','','1','2011-12-06 09:48:34',NULL); INSERT INTO `glpi_documenttypes` VALUES ('50','OpenOffice Calc','sxc','sxc-dist.png','','1','2004-12-13 19:47:22',NULL); INSERT INTO `glpi_documenttypes` VALUES ('51','LaTeX','tex','tex-dist.png','','1','2004-12-13 19:47:22',NULL); INSERT INTO `glpi_documenttypes` VALUES ('52','GIMP multi-layer','xcf','xcf-dist.png','','1','2004-12-13 19:47:22',NULL); INSERT INTO `glpi_documenttypes` VALUES ('53','JPEG','jpeg','jpg-dist.png','','1','2005-03-07 22:23:17',NULL); INSERT INTO `glpi_documenttypes` VALUES ('54','Oasis Open Office Writer','odt','odt-dist.png','','1','2006-01-21 17:41:13',NULL); INSERT INTO `glpi_documenttypes` VALUES ('55','Oasis Open Office Calc','ods','ods-dist.png','','1','2006-01-21 17:41:31',NULL); INSERT INTO `glpi_documenttypes` VALUES ('56','Oasis Open Office Impress','odp','odp-dist.png','','1','2006-01-21 17:42:54',NULL); INSERT INTO `glpi_documenttypes` VALUES ('57','Oasis Open Office Impress Template','otp','odp-dist.png','','1','2006-01-21 17:43:58',NULL); INSERT INTO `glpi_documenttypes` VALUES ('58','Oasis Open Office Writer Template','ott','odt-dist.png','','1','2006-01-21 17:44:41',NULL); INSERT INTO `glpi_documenttypes` VALUES ('59','Oasis Open Office Calc Template','ots','ods-dist.png','','1','2006-01-21 17:45:30',NULL); INSERT INTO `glpi_documenttypes` VALUES ('60','Oasis Open Office Math','odf','odf-dist.png','','1','2006-01-21 17:48:05',NULL); INSERT INTO `glpi_documenttypes` VALUES ('61','Oasis Open Office Draw','odg','odg-dist.png','','1','2006-01-21 17:48:31',NULL); INSERT INTO `glpi_documenttypes` VALUES ('62','Oasis Open Office Draw Template','otg','odg-dist.png','','1','2006-01-21 17:49:46',NULL); INSERT INTO `glpi_documenttypes` VALUES ('63','Oasis Open Office Base','odb','odb-dist.png','','1','2006-01-21 18:03:34',NULL); INSERT INTO `glpi_documenttypes` VALUES ('64','Oasis Open Office HTML','oth','oth-dist.png','','1','2006-01-21 18:05:27',NULL); INSERT INTO `glpi_documenttypes` VALUES ('65','Oasis Open Office Writer Master','odm','odm-dist.png','','1','2006-01-21 18:06:34',NULL); INSERT INTO `glpi_documenttypes` VALUES ('66','Oasis Open Office Chart','odc','','','1','2006-01-21 18:07:48',NULL); INSERT INTO `glpi_documenttypes` VALUES ('67','Oasis Open Office Image','odi','','','1','2006-01-21 18:08:18',NULL); INSERT INTO `glpi_documenttypes` VALUES ('68','Word XML','docx','doc-dist.png',NULL,'1','2011-01-18 11:40:42',NULL); INSERT INTO `glpi_documenttypes` VALUES ('69','Excel XML','xlsx','xls-dist.png',NULL,'1','2011-01-18 11:40:42',NULL); INSERT INTO `glpi_documenttypes` VALUES ('70','PowerPoint XML','pptx','ppt-dist.png',NULL,'1','2011-01-18 11:40:42',NULL); INSERT INTO `glpi_documenttypes` VALUES ('71','Comma-Separated Values','csv','csv-dist.png',NULL,'1','2011-12-06 09:48:34',NULL); INSERT INTO `glpi_documenttypes` VALUES ('72','Scalable Vector Graphics','svg','svg-dist.png',NULL,'1','2011-12-06 09:48:34',NULL); ### Dump table glpi_domains DROP TABLE IF EXISTS `glpi_domains`; CREATE TABLE `glpi_domains` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_entities DROP TABLE IF EXISTS `glpi_entities`; CREATE TABLE `glpi_entities` ( `id` int(11) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `entities_id` int(11) NOT NULL DEFAULT '0', `completename` text COLLATE utf8_unicode_ci, `comment` text COLLATE utf8_unicode_ci, `level` int(11) NOT NULL DEFAULT '0', `sons_cache` longtext COLLATE utf8_unicode_ci, `ancestors_cache` longtext COLLATE utf8_unicode_ci, `address` text COLLATE utf8_unicode_ci, `postcode` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `town` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `state` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `country` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `website` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `phonenumber` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `fax` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `admin_email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `admin_email_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `admin_reply` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `admin_reply_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `notification_subject_tag` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `notepad` longtext COLLATE utf8_unicode_ci, `ldap_dn` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `tag` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `authldaps_id` int(11) NOT NULL DEFAULT '0', `mail_domain` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `entity_ldapfilter` text COLLATE utf8_unicode_ci, `mailing_signature` text COLLATE utf8_unicode_ci, `cartridges_alert_repeat` int(11) NOT NULL DEFAULT '-2', `consumables_alert_repeat` int(11) NOT NULL DEFAULT '-2', `use_licenses_alert` int(11) NOT NULL DEFAULT '-2', `send_licenses_alert_before_delay` int(11) NOT NULL DEFAULT '-2', `use_contracts_alert` int(11) NOT NULL DEFAULT '-2', `send_contracts_alert_before_delay` int(11) NOT NULL DEFAULT '-2', `use_infocoms_alert` int(11) NOT NULL DEFAULT '-2', `send_infocoms_alert_before_delay` int(11) NOT NULL DEFAULT '-2', `use_reservations_alert` int(11) NOT NULL DEFAULT '-2', `autoclose_delay` int(11) NOT NULL DEFAULT '-2', `notclosed_delay` int(11) NOT NULL DEFAULT '-2', `calendars_id` int(11) NOT NULL DEFAULT '-2', `auto_assign_mode` int(11) NOT NULL DEFAULT '-2', `tickettype` int(11) NOT NULL DEFAULT '-2', `max_closedate` datetime DEFAULT NULL, `inquest_config` int(11) NOT NULL DEFAULT '-2', `inquest_rate` int(11) NOT NULL DEFAULT '0', `inquest_delay` int(11) NOT NULL DEFAULT '-10', `inquest_URL` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `autofill_warranty_date` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '-2', `autofill_use_date` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '-2', `autofill_buy_date` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '-2', `autofill_delivery_date` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '-2', `autofill_order_date` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '-2', `tickettemplates_id` int(11) NOT NULL DEFAULT '-2', `entities_id_software` int(11) NOT NULL DEFAULT '-2', `default_contract_alert` int(11) NOT NULL DEFAULT '-2', `default_infocom_alert` int(11) NOT NULL DEFAULT '-2', `default_cartridges_alarm_threshold` int(11) NOT NULL DEFAULT '-2', `default_consumables_alarm_threshold` int(11) NOT NULL DEFAULT '-2', PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`entities_id`,`name`), KEY `entities_id` (`entities_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `glpi_entities` VALUES ('0','Entité racine','-1','Entité racine',NULL,'1',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0',NULL,NULL,NULL,'0','0','0','0','0','0','0','0','0','-1','0','0','-10','1',NULL,'1','0','0',NULL,'0','0','0','0','0','1','-10','0','0','10','10'); ### Dump table glpi_entities_knowbaseitems DROP TABLE IF EXISTS `glpi_entities_knowbaseitems`; CREATE TABLE `glpi_entities_knowbaseitems` ( `id` int(11) NOT NULL AUTO_INCREMENT, `knowbaseitems_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `knowbaseitems_id` (`knowbaseitems_id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_entities_reminders DROP TABLE IF EXISTS `glpi_entities_reminders`; CREATE TABLE `glpi_entities_reminders` ( `id` int(11) NOT NULL AUTO_INCREMENT, `reminders_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `reminders_id` (`reminders_id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_entities_rssfeeds DROP TABLE IF EXISTS `glpi_entities_rssfeeds`; CREATE TABLE `glpi_entities_rssfeeds` ( `id` int(11) NOT NULL AUTO_INCREMENT, `rssfeeds_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `rssfeeds_id` (`rssfeeds_id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_events DROP TABLE IF EXISTS `glpi_events`; CREATE TABLE `glpi_events` ( `id` int(11) NOT NULL AUTO_INCREMENT, `items_id` int(11) NOT NULL DEFAULT '0', `type` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `date` datetime DEFAULT NULL, `service` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `level` int(11) NOT NULL DEFAULT '0', `message` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `date` (`date`), KEY `level` (`level`), KEY `item` (`type`,`items_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_fieldblacklists DROP TABLE IF EXISTS `glpi_fieldblacklists`; CREATE TABLE `glpi_fieldblacklists` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `field` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `value` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `itemtype` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_fieldunicities DROP TABLE IF EXISTS `glpi_fieldunicities`; CREATE TABLE `glpi_fieldunicities` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `itemtype` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `entities_id` int(11) NOT NULL DEFAULT '-1', `fields` text COLLATE utf8_unicode_ci, `is_active` tinyint(1) NOT NULL DEFAULT '0', `action_refuse` tinyint(1) NOT NULL DEFAULT '0', `action_notify` tinyint(1) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Stores field unicity criterias'; ### Dump table glpi_filesystems DROP TABLE IF EXISTS `glpi_filesystems`; CREATE TABLE `glpi_filesystems` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `glpi_filesystems` VALUES ('1','ext',NULL); INSERT INTO `glpi_filesystems` VALUES ('2','ext2',NULL); INSERT INTO `glpi_filesystems` VALUES ('3','ext3',NULL); INSERT INTO `glpi_filesystems` VALUES ('4','ext4',NULL); INSERT INTO `glpi_filesystems` VALUES ('5','FAT',NULL); INSERT INTO `glpi_filesystems` VALUES ('6','FAT32',NULL); INSERT INTO `glpi_filesystems` VALUES ('7','VFAT',NULL); INSERT INTO `glpi_filesystems` VALUES ('8','HFS',NULL); INSERT INTO `glpi_filesystems` VALUES ('9','HPFS',NULL); INSERT INTO `glpi_filesystems` VALUES ('10','HTFS',NULL); INSERT INTO `glpi_filesystems` VALUES ('11','JFS',NULL); INSERT INTO `glpi_filesystems` VALUES ('12','JFS2',NULL); INSERT INTO `glpi_filesystems` VALUES ('13','NFS',NULL); INSERT INTO `glpi_filesystems` VALUES ('14','NTFS',NULL); INSERT INTO `glpi_filesystems` VALUES ('15','ReiserFS',NULL); INSERT INTO `glpi_filesystems` VALUES ('16','SMBFS',NULL); INSERT INTO `glpi_filesystems` VALUES ('17','UDF',NULL); INSERT INTO `glpi_filesystems` VALUES ('18','UFS',NULL); INSERT INTO `glpi_filesystems` VALUES ('19','XFS',NULL); INSERT INTO `glpi_filesystems` VALUES ('20','ZFS',NULL); ### Dump table glpi_fqdns DROP TABLE IF EXISTS `glpi_fqdns`; CREATE TABLE `glpi_fqdns` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `fqdn` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `entities_id` (`entities_id`), KEY `name` (`name`), KEY `fqdn` (`fqdn`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_groups DROP TABLE IF EXISTS `glpi_groups`; CREATE TABLE `glpi_groups` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `ldap_field` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `ldap_value` text COLLATE utf8_unicode_ci, `ldap_group_dn` text COLLATE utf8_unicode_ci, `date_mod` datetime DEFAULT NULL, `groups_id` int(11) NOT NULL DEFAULT '0', `completename` text COLLATE utf8_unicode_ci, `level` int(11) NOT NULL DEFAULT '0', `ancestors_cache` longtext COLLATE utf8_unicode_ci, `sons_cache` longtext COLLATE utf8_unicode_ci, `is_requester` tinyint(1) NOT NULL DEFAULT '1', `is_assign` tinyint(1) NOT NULL DEFAULT '1', `is_notify` tinyint(1) NOT NULL DEFAULT '1', `is_itemgroup` tinyint(1) NOT NULL DEFAULT '1', `is_usergroup` tinyint(1) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), KEY `name` (`name`), KEY `ldap_field` (`ldap_field`), KEY `entities_id` (`entities_id`), KEY `date_mod` (`date_mod`), KEY `ldap_value` (`ldap_value`(200)), KEY `ldap_group_dn` (`ldap_group_dn`(200)), KEY `groups_id` (`groups_id`), KEY `is_requester` (`is_requester`), KEY `is_assign` (`is_assign`), KEY `is_notify` (`is_notify`), KEY `is_itemgroup` (`is_itemgroup`), KEY `is_usergroup` (`is_usergroup`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_groups_knowbaseitems DROP TABLE IF EXISTS `glpi_groups_knowbaseitems`; CREATE TABLE `glpi_groups_knowbaseitems` ( `id` int(11) NOT NULL AUTO_INCREMENT, `knowbaseitems_id` int(11) NOT NULL DEFAULT '0', `groups_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '-1', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `knowbaseitems_id` (`knowbaseitems_id`), KEY `groups_id` (`groups_id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_groups_problems DROP TABLE IF EXISTS `glpi_groups_problems`; CREATE TABLE `glpi_groups_problems` ( `id` int(11) NOT NULL AUTO_INCREMENT, `problems_id` int(11) NOT NULL DEFAULT '0', `groups_id` int(11) NOT NULL DEFAULT '0', `type` int(11) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`problems_id`,`type`,`groups_id`), KEY `group` (`groups_id`,`type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_groups_reminders DROP TABLE IF EXISTS `glpi_groups_reminders`; CREATE TABLE `glpi_groups_reminders` ( `id` int(11) NOT NULL AUTO_INCREMENT, `reminders_id` int(11) NOT NULL DEFAULT '0', `groups_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '-1', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `reminders_id` (`reminders_id`), KEY `groups_id` (`groups_id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_groups_rssfeeds DROP TABLE IF EXISTS `glpi_groups_rssfeeds`; CREATE TABLE `glpi_groups_rssfeeds` ( `id` int(11) NOT NULL AUTO_INCREMENT, `rssfeeds_id` int(11) NOT NULL DEFAULT '0', `groups_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '-1', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `rssfeeds_id` (`rssfeeds_id`), KEY `groups_id` (`groups_id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_groups_tickets DROP TABLE IF EXISTS `glpi_groups_tickets`; CREATE TABLE `glpi_groups_tickets` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tickets_id` int(11) NOT NULL DEFAULT '0', `groups_id` int(11) NOT NULL DEFAULT '0', `type` int(11) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`tickets_id`,`type`,`groups_id`), KEY `group` (`groups_id`,`type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_groups_users DROP TABLE IF EXISTS `glpi_groups_users`; CREATE TABLE `glpi_groups_users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `users_id` int(11) NOT NULL DEFAULT '0', `groups_id` int(11) NOT NULL DEFAULT '0', `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', `is_manager` tinyint(1) NOT NULL DEFAULT '0', `is_userdelegate` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`users_id`,`groups_id`), KEY `groups_id` (`groups_id`), KEY `is_manager` (`is_manager`), KEY `is_userdelegate` (`is_userdelegate`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_holidays DROP TABLE IF EXISTS `glpi_holidays`; CREATE TABLE `glpi_holidays` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, `begin_date` date DEFAULT NULL, `end_date` date DEFAULT NULL, `is_perpetual` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `name` (`name`), KEY `begin_date` (`begin_date`), KEY `end_date` (`end_date`), KEY `is_perpetual` (`is_perpetual`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_infocoms DROP TABLE IF EXISTS `glpi_infocoms`; CREATE TABLE `glpi_infocoms` ( `id` int(11) NOT NULL AUTO_INCREMENT, `items_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `buy_date` date DEFAULT NULL, `use_date` date DEFAULT NULL, `warranty_duration` int(11) NOT NULL DEFAULT '0', `warranty_info` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `suppliers_id` int(11) NOT NULL DEFAULT '0', `order_number` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `delivery_number` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `immo_number` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `value` decimal(20,4) NOT NULL DEFAULT '0.0000', `warranty_value` decimal(20,4) NOT NULL DEFAULT '0.0000', `sink_time` int(11) NOT NULL DEFAULT '0', `sink_type` int(11) NOT NULL DEFAULT '0', `sink_coeff` float NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, `bill` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `budgets_id` int(11) NOT NULL DEFAULT '0', `alert` int(11) NOT NULL DEFAULT '0', `order_date` date DEFAULT NULL, `delivery_date` date DEFAULT NULL, `inventory_date` date DEFAULT NULL, `warranty_date` date DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`itemtype`,`items_id`), KEY `buy_date` (`buy_date`), KEY `alert` (`alert`), KEY `budgets_id` (`budgets_id`), KEY `suppliers_id` (`suppliers_id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_interfacetypes DROP TABLE IF EXISTS `glpi_interfacetypes`; CREATE TABLE `glpi_interfacetypes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `glpi_interfacetypes` VALUES ('1','IDE',NULL); INSERT INTO `glpi_interfacetypes` VALUES ('2','SATA',NULL); INSERT INTO `glpi_interfacetypes` VALUES ('3','SCSI',NULL); INSERT INTO `glpi_interfacetypes` VALUES ('4','USB',NULL); INSERT INTO `glpi_interfacetypes` VALUES ('5','AGP',''); INSERT INTO `glpi_interfacetypes` VALUES ('6','PCI',''); INSERT INTO `glpi_interfacetypes` VALUES ('7','PCIe',''); INSERT INTO `glpi_interfacetypes` VALUES ('8','PCI-X',''); ### Dump table glpi_ipaddresses DROP TABLE IF EXISTS `glpi_ipaddresses`; CREATE TABLE `glpi_ipaddresses` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `items_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `version` tinyint(3) unsigned DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `binary_0` int(10) unsigned NOT NULL DEFAULT '0', `binary_1` int(10) unsigned NOT NULL DEFAULT '0', `binary_2` int(10) unsigned NOT NULL DEFAULT '0', `binary_3` int(10) unsigned NOT NULL DEFAULT '0', `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `entities_id` (`entities_id`), KEY `textual` (`name`), KEY `binary` (`binary_0`,`binary_1`,`binary_2`,`binary_3`), KEY `item` (`itemtype`,`items_id`), KEY `is_deleted` (`is_deleted`), KEY `is_dynamic` (`is_dynamic`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_ipaddresses_ipnetworks DROP TABLE IF EXISTS `glpi_ipaddresses_ipnetworks`; CREATE TABLE `glpi_ipaddresses_ipnetworks` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ipaddresses_id` int(11) NOT NULL DEFAULT '0', `ipnetworks_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`ipaddresses_id`,`ipnetworks_id`), KEY `ipnetworks_id` (`ipnetworks_id`), KEY `ipaddresses_id` (`ipaddresses_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_ipnetworks DROP TABLE IF EXISTS `glpi_ipnetworks`; CREATE TABLE `glpi_ipnetworks` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `ipnetworks_id` int(11) NOT NULL DEFAULT '0', `completename` text COLLATE utf8_unicode_ci, `level` int(11) NOT NULL DEFAULT '0', `ancestors_cache` longtext COLLATE utf8_unicode_ci, `sons_cache` longtext COLLATE utf8_unicode_ci, `addressable` tinyint(1) NOT NULL DEFAULT '0', `version` tinyint(3) unsigned DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `address` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL, `address_0` int(10) unsigned NOT NULL DEFAULT '0', `address_1` int(10) unsigned NOT NULL DEFAULT '0', `address_2` int(10) unsigned NOT NULL DEFAULT '0', `address_3` int(10) unsigned NOT NULL DEFAULT '0', `netmask` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL, `netmask_0` int(10) unsigned NOT NULL DEFAULT '0', `netmask_1` int(10) unsigned NOT NULL DEFAULT '0', `netmask_2` int(10) unsigned NOT NULL DEFAULT '0', `netmask_3` int(10) unsigned NOT NULL DEFAULT '0', `gateway` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL, `gateway_0` int(10) unsigned NOT NULL DEFAULT '0', `gateway_1` int(10) unsigned NOT NULL DEFAULT '0', `gateway_2` int(10) unsigned NOT NULL DEFAULT '0', `gateway_3` int(10) unsigned NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `network_definition` (`entities_id`,`address`,`netmask`), KEY `address` (`address_0`,`address_1`,`address_2`,`address_3`), KEY `netmask` (`netmask_0`,`netmask_1`,`netmask_2`,`netmask_3`), KEY `gateway` (`gateway_0`,`gateway_1`,`gateway_2`,`gateway_3`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_ipnetworks_vlans DROP TABLE IF EXISTS `glpi_ipnetworks_vlans`; CREATE TABLE `glpi_ipnetworks_vlans` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ipnetworks_id` int(11) NOT NULL DEFAULT '0', `vlans_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `link` (`ipnetworks_id`,`vlans_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_items_devicecases DROP TABLE IF EXISTS `glpi_items_devicecases`; CREATE TABLE `glpi_items_devicecases` ( `id` int(11) NOT NULL AUTO_INCREMENT, `items_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `devicecases_id` int(11) NOT NULL DEFAULT '0', `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `computers_id` (`items_id`), KEY `devicecases_id` (`devicecases_id`), KEY `is_deleted` (`is_deleted`), KEY `is_dynamic` (`is_dynamic`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_items_devicecontrols DROP TABLE IF EXISTS `glpi_items_devicecontrols`; CREATE TABLE `glpi_items_devicecontrols` ( `id` int(11) NOT NULL AUTO_INCREMENT, `items_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `devicecontrols_id` int(11) NOT NULL DEFAULT '0', `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `computers_id` (`items_id`), KEY `devicecontrols_id` (`devicecontrols_id`), KEY `is_deleted` (`is_deleted`), KEY `is_dynamic` (`is_dynamic`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_items_devicedrives DROP TABLE IF EXISTS `glpi_items_devicedrives`; CREATE TABLE `glpi_items_devicedrives` ( `id` int(11) NOT NULL AUTO_INCREMENT, `items_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `devicedrives_id` int(11) NOT NULL DEFAULT '0', `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `computers_id` (`items_id`), KEY `devicedrives_id` (`devicedrives_id`), KEY `is_deleted` (`is_deleted`), KEY `is_dynamic` (`is_dynamic`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_items_devicegraphiccards DROP TABLE IF EXISTS `glpi_items_devicegraphiccards`; CREATE TABLE `glpi_items_devicegraphiccards` ( `id` int(11) NOT NULL AUTO_INCREMENT, `items_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `devicegraphiccards_id` int(11) NOT NULL DEFAULT '0', `memory` int(11) NOT NULL DEFAULT '0', `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `computers_id` (`items_id`), KEY `devicegraphiccards_id` (`devicegraphiccards_id`), KEY `specificity` (`memory`), KEY `is_deleted` (`is_deleted`), KEY `is_dynamic` (`is_dynamic`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_items_deviceharddrives DROP TABLE IF EXISTS `glpi_items_deviceharddrives`; CREATE TABLE `glpi_items_deviceharddrives` ( `id` int(11) NOT NULL AUTO_INCREMENT, `items_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `deviceharddrives_id` int(11) NOT NULL DEFAULT '0', `capacity` int(11) NOT NULL DEFAULT '0', `serial` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `computers_id` (`items_id`), KEY `deviceharddrives_id` (`deviceharddrives_id`), KEY `specificity` (`capacity`), KEY `is_deleted` (`is_deleted`), KEY `is_dynamic` (`is_dynamic`), KEY `serial` (`serial`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_items_devicememories DROP TABLE IF EXISTS `glpi_items_devicememories`; CREATE TABLE `glpi_items_devicememories` ( `id` int(11) NOT NULL AUTO_INCREMENT, `items_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `devicememories_id` int(11) NOT NULL DEFAULT '0', `size` int(11) NOT NULL DEFAULT '0', `serial` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `computers_id` (`items_id`), KEY `devicememories_id` (`devicememories_id`), KEY `specificity` (`size`), KEY `is_deleted` (`is_deleted`), KEY `is_dynamic` (`is_dynamic`), KEY `serial` (`serial`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_items_devicemotherboards DROP TABLE IF EXISTS `glpi_items_devicemotherboards`; CREATE TABLE `glpi_items_devicemotherboards` ( `id` int(11) NOT NULL AUTO_INCREMENT, `items_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `devicemotherboards_id` int(11) NOT NULL DEFAULT '0', `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `computers_id` (`items_id`), KEY `devicemotherboards_id` (`devicemotherboards_id`), KEY `is_deleted` (`is_deleted`), KEY `is_dynamic` (`is_dynamic`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_items_devicenetworkcards DROP TABLE IF EXISTS `glpi_items_devicenetworkcards`; CREATE TABLE `glpi_items_devicenetworkcards` ( `id` int(11) NOT NULL AUTO_INCREMENT, `items_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `devicenetworkcards_id` int(11) NOT NULL DEFAULT '0', `mac` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `computers_id` (`items_id`), KEY `devicenetworkcards_id` (`devicenetworkcards_id`), KEY `specificity` (`mac`), KEY `is_deleted` (`is_deleted`), KEY `is_dynamic` (`is_dynamic`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_items_devicepcis DROP TABLE IF EXISTS `glpi_items_devicepcis`; CREATE TABLE `glpi_items_devicepcis` ( `id` int(11) NOT NULL AUTO_INCREMENT, `items_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `devicepcis_id` int(11) NOT NULL DEFAULT '0', `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `computers_id` (`items_id`), KEY `devicepcis_id` (`devicepcis_id`), KEY `is_deleted` (`is_deleted`), KEY `is_dynamic` (`is_dynamic`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_items_devicepowersupplies DROP TABLE IF EXISTS `glpi_items_devicepowersupplies`; CREATE TABLE `glpi_items_devicepowersupplies` ( `id` int(11) NOT NULL AUTO_INCREMENT, `items_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `devicepowersupplies_id` int(11) NOT NULL DEFAULT '0', `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `computers_id` (`items_id`), KEY `devicepowersupplies_id` (`devicepowersupplies_id`), KEY `is_deleted` (`is_deleted`), KEY `is_dynamic` (`is_dynamic`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_items_deviceprocessors DROP TABLE IF EXISTS `glpi_items_deviceprocessors`; CREATE TABLE `glpi_items_deviceprocessors` ( `id` int(11) NOT NULL AUTO_INCREMENT, `items_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `deviceprocessors_id` int(11) NOT NULL DEFAULT '0', `frequency` int(11) NOT NULL DEFAULT '0', `serial` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `computers_id` (`items_id`), KEY `deviceprocessors_id` (`deviceprocessors_id`), KEY `specificity` (`frequency`), KEY `is_deleted` (`is_deleted`), KEY `is_dynamic` (`is_dynamic`), KEY `serial` (`serial`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_items_devicesoundcards DROP TABLE IF EXISTS `glpi_items_devicesoundcards`; CREATE TABLE `glpi_items_devicesoundcards` ( `id` int(11) NOT NULL AUTO_INCREMENT, `items_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `devicesoundcards_id` int(11) NOT NULL DEFAULT '0', `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `computers_id` (`items_id`), KEY `devicesoundcards_id` (`devicesoundcards_id`), KEY `is_deleted` (`is_deleted`), KEY `is_dynamic` (`is_dynamic`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_items_problems DROP TABLE IF EXISTS `glpi_items_problems`; CREATE TABLE `glpi_items_problems` ( `id` int(11) NOT NULL AUTO_INCREMENT, `problems_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `items_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`problems_id`,`itemtype`,`items_id`), KEY `item` (`itemtype`,`items_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_itilcategories DROP TABLE IF EXISTS `glpi_itilcategories`; CREATE TABLE `glpi_itilcategories` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `itilcategories_id` int(11) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `completename` text COLLATE utf8_unicode_ci, `comment` text COLLATE utf8_unicode_ci, `level` int(11) NOT NULL DEFAULT '0', `knowbaseitemcategories_id` int(11) NOT NULL DEFAULT '0', `users_id` int(11) NOT NULL DEFAULT '0', `groups_id` int(11) NOT NULL DEFAULT '0', `ancestors_cache` longtext COLLATE utf8_unicode_ci, `sons_cache` longtext COLLATE utf8_unicode_ci, `is_helpdeskvisible` tinyint(1) NOT NULL DEFAULT '1', `tickettemplates_id_incident` int(11) NOT NULL DEFAULT '0', `tickettemplates_id_demand` int(11) NOT NULL DEFAULT '0', `is_incident` int(11) NOT NULL DEFAULT '1', `is_request` int(11) NOT NULL DEFAULT '1', `is_problem` int(11) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), KEY `name` (`name`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`), KEY `knowbaseitemcategories_id` (`knowbaseitemcategories_id`), KEY `users_id` (`users_id`), KEY `groups_id` (`groups_id`), KEY `is_helpdeskvisible` (`is_helpdeskvisible`), KEY `itilcategories_id` (`itilcategories_id`), KEY `tickettemplates_id_incident` (`tickettemplates_id_incident`), KEY `tickettemplates_id_demand` (`tickettemplates_id_demand`), KEY `is_incident` (`is_incident`), KEY `is_request` (`is_request`), KEY `is_problem` (`is_problem`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_knowbaseitemcategories DROP TABLE IF EXISTS `glpi_knowbaseitemcategories`; CREATE TABLE `glpi_knowbaseitemcategories` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `knowbaseitemcategories_id` int(11) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `completename` text COLLATE utf8_unicode_ci, `comment` text COLLATE utf8_unicode_ci, `level` int(11) NOT NULL DEFAULT '0', `sons_cache` longtext COLLATE utf8_unicode_ci, `ancestors_cache` longtext COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`entities_id`,`knowbaseitemcategories_id`,`name`), KEY `name` (`name`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_knowbaseitems DROP TABLE IF EXISTS `glpi_knowbaseitems`; CREATE TABLE `glpi_knowbaseitems` ( `id` int(11) NOT NULL AUTO_INCREMENT, `knowbaseitemcategories_id` int(11) NOT NULL DEFAULT '0', `name` text COLLATE utf8_unicode_ci, `answer` longtext COLLATE utf8_unicode_ci, `is_faq` tinyint(1) NOT NULL DEFAULT '0', `users_id` int(11) NOT NULL DEFAULT '0', `view` int(11) NOT NULL DEFAULT '0', `date` datetime DEFAULT NULL, `date_mod` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `users_id` (`users_id`), KEY `knowbaseitemcategories_id` (`knowbaseitemcategories_id`), KEY `is_faq` (`is_faq`), KEY `date_mod` (`date_mod`), FULLTEXT KEY `fulltext` (`name`,`answer`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_knowbaseitems_profiles DROP TABLE IF EXISTS `glpi_knowbaseitems_profiles`; CREATE TABLE `glpi_knowbaseitems_profiles` ( `id` int(11) NOT NULL AUTO_INCREMENT, `knowbaseitems_id` int(11) NOT NULL DEFAULT '0', `profiles_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '-1', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `knowbaseitems_id` (`knowbaseitems_id`), KEY `profiles_id` (`profiles_id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_knowbaseitems_users DROP TABLE IF EXISTS `glpi_knowbaseitems_users`; CREATE TABLE `glpi_knowbaseitems_users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `knowbaseitems_id` int(11) NOT NULL DEFAULT '0', `users_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `knowbaseitems_id` (`knowbaseitems_id`), KEY `users_id` (`users_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_links DROP TABLE IF EXISTS `glpi_links`; CREATE TABLE `glpi_links` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '1', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `link` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `data` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `entities_id` (`entities_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_links_itemtypes DROP TABLE IF EXISTS `glpi_links_itemtypes`; CREATE TABLE `glpi_links_itemtypes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `links_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(100) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`itemtype`,`links_id`), KEY `links_id` (`links_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_locations DROP TABLE IF EXISTS `glpi_locations`; CREATE TABLE `glpi_locations` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `locations_id` int(11) NOT NULL DEFAULT '0', `completename` text COLLATE utf8_unicode_ci, `comment` text COLLATE utf8_unicode_ci, `level` int(11) NOT NULL DEFAULT '0', `ancestors_cache` longtext COLLATE utf8_unicode_ci, `sons_cache` longtext COLLATE utf8_unicode_ci, `building` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `room` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`entities_id`,`locations_id`,`name`), KEY `locations_id` (`locations_id`), KEY `name` (`name`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_logs DROP TABLE IF EXISTS `glpi_logs`; CREATE TABLE `glpi_logs` ( `id` int(11) NOT NULL AUTO_INCREMENT, `itemtype` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `items_id` int(11) NOT NULL DEFAULT '0', `itemtype_link` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `linked_action` int(11) NOT NULL DEFAULT '0' COMMENT 'see define.php HISTORY_* constant', `user_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `date_mod` datetime DEFAULT NULL, `id_search_option` int(11) NOT NULL DEFAULT '0' COMMENT 'see search.constant.php for value', `old_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `new_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `date_mod` (`date_mod`), KEY `itemtype_link` (`itemtype_link`), KEY `item` (`itemtype`,`items_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_mailcollectors DROP TABLE IF EXISTS `glpi_mailcollectors`; CREATE TABLE `glpi_mailcollectors` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `host` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `login` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `filesize_max` int(11) NOT NULL DEFAULT '2097152', `is_active` tinyint(1) NOT NULL DEFAULT '1', `date_mod` datetime DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `passwd` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `accepted` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `refused` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `use_kerberos` tinyint(1) NOT NULL DEFAULT '0', `errors` int(11) NOT NULL DEFAULT '0', `use_mail_date` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `is_active` (`is_active`), KEY `date_mod` (`date_mod`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_manufacturers DROP TABLE IF EXISTS `glpi_manufacturers`; CREATE TABLE `glpi_manufacturers` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_monitormodels DROP TABLE IF EXISTS `glpi_monitormodels`; CREATE TABLE `glpi_monitormodels` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_monitors DROP TABLE IF EXISTS `glpi_monitors`; CREATE TABLE `glpi_monitors` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `date_mod` datetime DEFAULT NULL, `contact` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `contact_num` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `users_id_tech` int(11) NOT NULL DEFAULT '0', `groups_id_tech` int(11) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, `serial` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `otherserial` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `size` int(11) NOT NULL DEFAULT '0', `have_micro` tinyint(1) NOT NULL DEFAULT '0', `have_speaker` tinyint(1) NOT NULL DEFAULT '0', `have_subd` tinyint(1) NOT NULL DEFAULT '0', `have_bnc` tinyint(1) NOT NULL DEFAULT '0', `have_dvi` tinyint(1) NOT NULL DEFAULT '0', `have_pivot` tinyint(1) NOT NULL DEFAULT '0', `have_hdmi` tinyint(1) NOT NULL DEFAULT '0', `have_displayport` tinyint(1) NOT NULL DEFAULT '0', `locations_id` int(11) NOT NULL DEFAULT '0', `monitortypes_id` int(11) NOT NULL DEFAULT '0', `monitormodels_id` int(11) NOT NULL DEFAULT '0', `manufacturers_id` int(11) NOT NULL DEFAULT '0', `is_global` tinyint(1) NOT NULL DEFAULT '0', `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `is_template` tinyint(1) NOT NULL DEFAULT '0', `template_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `notepad` longtext COLLATE utf8_unicode_ci, `users_id` int(11) NOT NULL DEFAULT '0', `groups_id` int(11) NOT NULL DEFAULT '0', `states_id` int(11) NOT NULL DEFAULT '0', `ticket_tco` decimal(20,4) DEFAULT '0.0000', `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `name` (`name`), KEY `is_template` (`is_template`), KEY `is_global` (`is_global`), KEY `entities_id` (`entities_id`), KEY `manufacturers_id` (`manufacturers_id`), KEY `groups_id` (`groups_id`), KEY `users_id` (`users_id`), KEY `locations_id` (`locations_id`), KEY `monitormodels_id` (`monitormodels_id`), KEY `states_id` (`states_id`), KEY `users_id_tech` (`users_id_tech`), KEY `monitortypes_id` (`monitortypes_id`), KEY `is_deleted` (`is_deleted`), KEY `groups_id_tech` (`groups_id_tech`), KEY `is_dynamic` (`is_dynamic`), KEY `serial` (`serial`), KEY `otherserial` (`otherserial`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_monitortypes DROP TABLE IF EXISTS `glpi_monitortypes`; CREATE TABLE `glpi_monitortypes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_netpoints DROP TABLE IF EXISTS `glpi_netpoints`; CREATE TABLE `glpi_netpoints` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `locations_id` int(11) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`), KEY `complete` (`entities_id`,`locations_id`,`name`), KEY `location_name` (`locations_id`,`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_networkaliases DROP TABLE IF EXISTS `glpi_networkaliases`; CREATE TABLE `glpi_networkaliases` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `networknames_id` int(11) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `fqdns_id` int(11) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `entities_id` (`entities_id`), KEY `name` (`name`), KEY `networknames_id` (`networknames_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_networkequipmentfirmwares DROP TABLE IF EXISTS `glpi_networkequipmentfirmwares`; CREATE TABLE `glpi_networkequipmentfirmwares` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_networkequipmentmodels DROP TABLE IF EXISTS `glpi_networkequipmentmodels`; CREATE TABLE `glpi_networkequipmentmodels` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_networkequipments DROP TABLE IF EXISTS `glpi_networkequipments`; CREATE TABLE `glpi_networkequipments` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `ram` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `serial` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `otherserial` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `contact` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `contact_num` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `users_id_tech` int(11) NOT NULL DEFAULT '0', `groups_id_tech` int(11) NOT NULL DEFAULT '0', `date_mod` datetime DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `locations_id` int(11) NOT NULL DEFAULT '0', `domains_id` int(11) NOT NULL DEFAULT '0', `networks_id` int(11) NOT NULL DEFAULT '0', `networkequipmenttypes_id` int(11) NOT NULL DEFAULT '0', `networkequipmentmodels_id` int(11) NOT NULL DEFAULT '0', `networkequipmentfirmwares_id` int(11) NOT NULL DEFAULT '0', `manufacturers_id` int(11) NOT NULL DEFAULT '0', `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `is_template` tinyint(1) NOT NULL DEFAULT '0', `template_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `notepad` longtext COLLATE utf8_unicode_ci, `users_id` int(11) NOT NULL DEFAULT '0', `groups_id` int(11) NOT NULL DEFAULT '0', `states_id` int(11) NOT NULL DEFAULT '0', `ticket_tco` decimal(20,4) DEFAULT '0.0000', `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `name` (`name`), KEY `is_template` (`is_template`), KEY `domains_id` (`domains_id`), KEY `networkequipmentfirmwares_id` (`networkequipmentfirmwares_id`), KEY `entities_id` (`entities_id`), KEY `manufacturers_id` (`manufacturers_id`), KEY `groups_id` (`groups_id`), KEY `users_id` (`users_id`), KEY `locations_id` (`locations_id`), KEY `networkequipmentmodels_id` (`networkequipmentmodels_id`), KEY `networks_id` (`networks_id`), KEY `states_id` (`states_id`), KEY `users_id_tech` (`users_id_tech`), KEY `networkequipmenttypes_id` (`networkequipmenttypes_id`), KEY `is_deleted` (`is_deleted`), KEY `date_mod` (`date_mod`), KEY `groups_id_tech` (`groups_id_tech`), KEY `is_dynamic` (`is_dynamic`), KEY `serial` (`serial`), KEY `otherserial` (`otherserial`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_networkequipmenttypes DROP TABLE IF EXISTS `glpi_networkequipmenttypes`; CREATE TABLE `glpi_networkequipmenttypes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_networkinterfaces DROP TABLE IF EXISTS `glpi_networkinterfaces`; CREATE TABLE `glpi_networkinterfaces` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_networknames DROP TABLE IF EXISTS `glpi_networknames`; CREATE TABLE `glpi_networknames` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `items_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `fqdns_id` int(11) NOT NULL DEFAULT '0', `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `entities_id` (`entities_id`), KEY `FQDN` (`name`,`fqdns_id`), KEY `name` (`name`), KEY `item` (`itemtype`,`items_id`), KEY `fqdns_id` (`fqdns_id`), KEY `is_deleted` (`is_deleted`), KEY `is_dynamic` (`is_dynamic`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_networkportaggregates DROP TABLE IF EXISTS `glpi_networkportaggregates`; CREATE TABLE `glpi_networkportaggregates` ( `id` int(11) NOT NULL AUTO_INCREMENT, `networkports_id` int(11) NOT NULL DEFAULT '0', `networkports_id_list` text COLLATE utf8_unicode_ci COMMENT 'array of associated networkports_id', PRIMARY KEY (`id`), UNIQUE KEY `networkports_id` (`networkports_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_networkportaliases DROP TABLE IF EXISTS `glpi_networkportaliases`; CREATE TABLE `glpi_networkportaliases` ( `id` int(11) NOT NULL AUTO_INCREMENT, `networkports_id` int(11) NOT NULL DEFAULT '0', `networkports_id_alias` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `networkports_id` (`networkports_id`), KEY `networkports_id_alias` (`networkports_id_alias`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_networkportdialups DROP TABLE IF EXISTS `glpi_networkportdialups`; CREATE TABLE `glpi_networkportdialups` ( `id` int(11) NOT NULL AUTO_INCREMENT, `networkports_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `networkports_id` (`networkports_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_networkportethernets DROP TABLE IF EXISTS `glpi_networkportethernets`; CREATE TABLE `glpi_networkportethernets` ( `id` int(11) NOT NULL AUTO_INCREMENT, `networkports_id` int(11) NOT NULL DEFAULT '0', `items_devicenetworkcards_id` int(11) NOT NULL DEFAULT '0', `netpoints_id` int(11) NOT NULL DEFAULT '0', `type` varchar(10) COLLATE utf8_unicode_ci DEFAULT '' COMMENT 'T, LX, SX', `speed` int(11) NOT NULL DEFAULT '10' COMMENT 'Mbit/s: 10, 100, 1000, 10000', PRIMARY KEY (`id`), UNIQUE KEY `networkports_id` (`networkports_id`), KEY `card` (`items_devicenetworkcards_id`), KEY `netpoint` (`netpoints_id`), KEY `type` (`type`), KEY `speed` (`speed`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_networkportlocals DROP TABLE IF EXISTS `glpi_networkportlocals`; CREATE TABLE `glpi_networkportlocals` ( `id` int(11) NOT NULL AUTO_INCREMENT, `networkports_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `networkports_id` (`networkports_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_networkports DROP TABLE IF EXISTS `glpi_networkports`; CREATE TABLE `glpi_networkports` ( `id` int(11) NOT NULL AUTO_INCREMENT, `items_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `logical_number` int(11) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `instantiation_type` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `mac` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `on_device` (`items_id`,`itemtype`), KEY `item` (`itemtype`,`items_id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`), KEY `mac` (`mac`), KEY `is_deleted` (`is_deleted`), KEY `is_dynamic` (`is_dynamic`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_networkports_networkports DROP TABLE IF EXISTS `glpi_networkports_networkports`; CREATE TABLE `glpi_networkports_networkports` ( `id` int(11) NOT NULL AUTO_INCREMENT, `networkports_id_1` int(11) NOT NULL DEFAULT '0', `networkports_id_2` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`networkports_id_1`,`networkports_id_2`), KEY `networkports_id_2` (`networkports_id_2`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_networkports_vlans DROP TABLE IF EXISTS `glpi_networkports_vlans`; CREATE TABLE `glpi_networkports_vlans` ( `id` int(11) NOT NULL AUTO_INCREMENT, `networkports_id` int(11) NOT NULL DEFAULT '0', `vlans_id` int(11) NOT NULL DEFAULT '0', `tagged` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`networkports_id`,`vlans_id`), KEY `vlans_id` (`vlans_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_networkportwifis DROP TABLE IF EXISTS `glpi_networkportwifis`; CREATE TABLE `glpi_networkportwifis` ( `id` int(11) NOT NULL AUTO_INCREMENT, `networkports_id` int(11) NOT NULL DEFAULT '0', `items_devicenetworkcards_id` int(11) NOT NULL DEFAULT '0', `wifinetworks_id` int(11) NOT NULL DEFAULT '0', `networkportwifis_id` int(11) NOT NULL DEFAULT '0' COMMENT 'only usefull in case of Managed node', `version` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'a, a/b, a/b/g, a/b/g/n, a/b/g/n/y', `mode` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'ad-hoc, managed, master, repeater, secondary, monitor, auto', PRIMARY KEY (`id`), UNIQUE KEY `networkports_id` (`networkports_id`), KEY `card` (`items_devicenetworkcards_id`), KEY `essid` (`wifinetworks_id`), KEY `version` (`version`), KEY `mode` (`mode`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_networks DROP TABLE IF EXISTS `glpi_networks`; CREATE TABLE `glpi_networks` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_notifications DROP TABLE IF EXISTS `glpi_notifications`; CREATE TABLE `glpi_notifications` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `entities_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `event` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `mode` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `notificationtemplates_id` int(11) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `is_active` tinyint(1) NOT NULL DEFAULT '0', `date_mod` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `name` (`name`), KEY `itemtype` (`itemtype`), KEY `entities_id` (`entities_id`), KEY `is_active` (`is_active`), KEY `date_mod` (`date_mod`), KEY `is_recursive` (`is_recursive`), KEY `notificationtemplates_id` (`notificationtemplates_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `glpi_notifications` VALUES ('1','Alert Tickets not closed','0','Ticket','alertnotclosed','mail','6','','1','1','2010-02-16 16:41:39'); INSERT INTO `glpi_notifications` VALUES ('2','New Ticket','0','Ticket','new','mail','4','','1','1','2010-02-16 16:41:39'); INSERT INTO `glpi_notifications` VALUES ('3','Update Ticket','0','Ticket','update','mail','4','','1','1','2010-02-16 16:41:39'); INSERT INTO `glpi_notifications` VALUES ('4','Close Ticket','0','Ticket','closed','mail','4','','1','1','2010-02-16 16:41:39'); INSERT INTO `glpi_notifications` VALUES ('5','Add Followup','0','Ticket','add_followup','mail','4','','1','1','2010-02-16 16:41:39'); INSERT INTO `glpi_notifications` VALUES ('6','Add Task','0','Ticket','add_task','mail','4','','1','1','2010-02-16 16:41:39'); INSERT INTO `glpi_notifications` VALUES ('7','Update Followup','0','Ticket','update_followup','mail','4','','1','1','2010-02-16 16:41:39'); INSERT INTO `glpi_notifications` VALUES ('8','Update Task','0','Ticket','update_task','mail','4','','1','1','2010-02-16 16:41:39'); INSERT INTO `glpi_notifications` VALUES ('9','Delete Followup','0','Ticket','delete_followup','mail','4','','1','1','2010-02-16 16:41:39'); INSERT INTO `glpi_notifications` VALUES ('10','Delete Task','0','Ticket','delete_task','mail','4','','1','1','2010-02-16 16:41:39'); INSERT INTO `glpi_notifications` VALUES ('11','Resolve ticket','0','Ticket','solved','mail','4','','1','1','2010-02-16 16:41:39'); INSERT INTO `glpi_notifications` VALUES ('12','Ticket Validation','0','Ticket','validation','mail','7','','1','1','2010-02-16 16:41:39'); INSERT INTO `glpi_notifications` VALUES ('13','New Reservation','0','Reservation','new','mail','2','','1','1','2010-02-16 16:41:39'); INSERT INTO `glpi_notifications` VALUES ('14','Update Reservation','0','Reservation','update','mail','2','','1','1','2010-02-16 16:41:39'); INSERT INTO `glpi_notifications` VALUES ('15','Delete Reservation','0','Reservation','delete','mail','2','','1','1','2010-02-16 16:41:39'); INSERT INTO `glpi_notifications` VALUES ('16','Alert Reservation','0','Reservation','alert','mail','3','','1','1','2010-02-16 16:41:39'); INSERT INTO `glpi_notifications` VALUES ('17','Contract Notice','0','Contract','notice','mail','12','','1','1','2010-02-16 16:41:39'); INSERT INTO `glpi_notifications` VALUES ('18','Contract End','0','Contract','end','mail','12','','1','1','2010-02-16 16:41:39'); INSERT INTO `glpi_notifications` VALUES ('19','MySQL Synchronization','0','DBConnection','desynchronization','mail','1','','1','1','2010-02-16 16:41:39'); INSERT INTO `glpi_notifications` VALUES ('20','Cartridges','0','CartridgeItem','alert','mail','8','','1','1','2010-02-16 16:41:39'); INSERT INTO `glpi_notifications` VALUES ('21','Consumables','0','ConsumableItem','alert','mail','9','','1','1','2010-02-16 16:41:39'); INSERT INTO `glpi_notifications` VALUES ('22','Infocoms','0','Infocom','alert','mail','10','','1','1','2010-02-16 16:41:39'); INSERT INTO `glpi_notifications` VALUES ('23','Software Licenses','0','SoftwareLicense','alert','mail','11','','1','1','2010-02-16 16:41:39'); INSERT INTO `glpi_notifications` VALUES ('24','Ticket Recall','0','Ticket','recall','mail','4','','1','1','2011-03-04 11:35:13'); INSERT INTO `glpi_notifications` VALUES ('25','Password Forget','0','User','passwordforget','mail','13','','1','1','2011-03-04 11:35:13'); INSERT INTO `glpi_notifications` VALUES ('26','Ticket Satisfaction','0','Ticket','satisfaction','mail','14','','1','1','2011-03-04 11:35:15'); INSERT INTO `glpi_notifications` VALUES ('27','Item not unique','0','FieldUnicity','refuse','mail','15','','1','1','2011-03-04 11:35:16'); INSERT INTO `glpi_notifications` VALUES ('28','Crontask Watcher','0','Crontask','alert','mail','16','','1','1','2011-03-04 11:35:16'); INSERT INTO `glpi_notifications` VALUES ('29','New Problem','0','Problem','new','mail','17','','1','1','2011-12-06 09:48:33'); INSERT INTO `glpi_notifications` VALUES ('30','Update Problem','0','Problem','update','mail','17','','1','1','2011-12-06 09:48:33'); INSERT INTO `glpi_notifications` VALUES ('31','Resolve Problem','0','Problem','solved','mail','17','','1','1','2011-12-06 09:48:33'); INSERT INTO `glpi_notifications` VALUES ('32','Add Task','0','Problem','add_task','mail','17','','1','1','2011-12-06 09:48:33'); INSERT INTO `glpi_notifications` VALUES ('33','Update Task','0','Problem','update_task','mail','17','','1','1','2011-12-06 09:48:33'); INSERT INTO `glpi_notifications` VALUES ('34','Delete Task','0','Problem','delete_task','mail','17','','1','1','2011-12-06 09:48:33'); INSERT INTO `glpi_notifications` VALUES ('35','Close Problem','0','Problem','closed','mail','17','','1','1','2011-12-06 09:48:33'); INSERT INTO `glpi_notifications` VALUES ('36','Delete Problem','0','Problem','delete','mail','17','','1','1','2011-12-06 09:48:33'); INSERT INTO `glpi_notifications` VALUES ('37','Ticket Validation Answer','0','Ticket','validation_answer','mail','7','','1','1','2013-05-28 09:50:42'); INSERT INTO `glpi_notifications` VALUES ('38','Contract End Periodicity','0','Contract','periodicity','mail','12','','1','1','2013-05-28 09:50:42'); INSERT INTO `glpi_notifications` VALUES ('39','Contract Notice Periodicity','0','Contract','periodicitynotice','mail','12','','1','1','2013-05-28 09:50:42'); INSERT INTO `glpi_notifications` VALUES ('40','Planning recall','0','PlanningRecall','planningrecall','mail','18','','1','1','2013-05-28 09:50:43'); INSERT INTO `glpi_notifications` VALUES ('41','Delete Ticket','0','Ticket','delete','mail','4','','1','1','2013-05-28 09:50:44'); ### Dump table glpi_notificationtargets DROP TABLE IF EXISTS `glpi_notificationtargets`; CREATE TABLE `glpi_notificationtargets` ( `id` int(11) NOT NULL AUTO_INCREMENT, `items_id` int(11) NOT NULL DEFAULT '0', `type` int(11) NOT NULL DEFAULT '0', `notifications_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `items` (`type`,`items_id`), KEY `notifications_id` (`notifications_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `glpi_notificationtargets` VALUES ('1','3','1','13'); INSERT INTO `glpi_notificationtargets` VALUES ('2','1','1','13'); INSERT INTO `glpi_notificationtargets` VALUES ('3','3','2','2'); INSERT INTO `glpi_notificationtargets` VALUES ('4','1','1','2'); INSERT INTO `glpi_notificationtargets` VALUES ('5','1','1','3'); INSERT INTO `glpi_notificationtargets` VALUES ('6','1','1','5'); INSERT INTO `glpi_notificationtargets` VALUES ('7','1','1','4'); INSERT INTO `glpi_notificationtargets` VALUES ('8','2','1','3'); INSERT INTO `glpi_notificationtargets` VALUES ('9','4','1','3'); INSERT INTO `glpi_notificationtargets` VALUES ('10','3','1','2'); INSERT INTO `glpi_notificationtargets` VALUES ('11','3','1','3'); INSERT INTO `glpi_notificationtargets` VALUES ('12','3','1','5'); INSERT INTO `glpi_notificationtargets` VALUES ('13','3','1','4'); INSERT INTO `glpi_notificationtargets` VALUES ('14','1','1','19'); INSERT INTO `glpi_notificationtargets` VALUES ('15','14','1','12'); INSERT INTO `glpi_notificationtargets` VALUES ('16','3','1','14'); INSERT INTO `glpi_notificationtargets` VALUES ('17','1','1','14'); INSERT INTO `glpi_notificationtargets` VALUES ('18','3','1','15'); INSERT INTO `glpi_notificationtargets` VALUES ('19','1','1','15'); INSERT INTO `glpi_notificationtargets` VALUES ('20','1','1','6'); INSERT INTO `glpi_notificationtargets` VALUES ('21','3','1','6'); INSERT INTO `glpi_notificationtargets` VALUES ('22','1','1','7'); INSERT INTO `glpi_notificationtargets` VALUES ('23','3','1','7'); INSERT INTO `glpi_notificationtargets` VALUES ('24','1','1','8'); INSERT INTO `glpi_notificationtargets` VALUES ('25','3','1','8'); INSERT INTO `glpi_notificationtargets` VALUES ('26','1','1','9'); INSERT INTO `glpi_notificationtargets` VALUES ('27','3','1','9'); INSERT INTO `glpi_notificationtargets` VALUES ('28','1','1','10'); INSERT INTO `glpi_notificationtargets` VALUES ('29','3','1','10'); INSERT INTO `glpi_notificationtargets` VALUES ('30','1','1','11'); INSERT INTO `glpi_notificationtargets` VALUES ('31','3','1','11'); INSERT INTO `glpi_notificationtargets` VALUES ('32','19','1','25'); INSERT INTO `glpi_notificationtargets` VALUES ('33','3','1','26'); INSERT INTO `glpi_notificationtargets` VALUES ('34','21','1','2'); INSERT INTO `glpi_notificationtargets` VALUES ('35','21','1','3'); INSERT INTO `glpi_notificationtargets` VALUES ('36','21','1','5'); INSERT INTO `glpi_notificationtargets` VALUES ('37','21','1','4'); INSERT INTO `glpi_notificationtargets` VALUES ('38','21','1','6'); INSERT INTO `glpi_notificationtargets` VALUES ('39','21','1','7'); INSERT INTO `glpi_notificationtargets` VALUES ('40','21','1','8'); INSERT INTO `glpi_notificationtargets` VALUES ('41','21','1','9'); INSERT INTO `glpi_notificationtargets` VALUES ('42','21','1','10'); INSERT INTO `glpi_notificationtargets` VALUES ('43','21','1','11'); INSERT INTO `glpi_notificationtargets` VALUES ('75','1','1','41'); INSERT INTO `glpi_notificationtargets` VALUES ('46','1','1','28'); INSERT INTO `glpi_notificationtargets` VALUES ('47','3','1','29'); INSERT INTO `glpi_notificationtargets` VALUES ('48','1','1','29'); INSERT INTO `glpi_notificationtargets` VALUES ('49','21','1','29'); INSERT INTO `glpi_notificationtargets` VALUES ('50','2','1','30'); INSERT INTO `glpi_notificationtargets` VALUES ('51','4','1','30'); INSERT INTO `glpi_notificationtargets` VALUES ('52','3','1','30'); INSERT INTO `glpi_notificationtargets` VALUES ('53','1','1','30'); INSERT INTO `glpi_notificationtargets` VALUES ('54','21','1','30'); INSERT INTO `glpi_notificationtargets` VALUES ('55','3','1','31'); INSERT INTO `glpi_notificationtargets` VALUES ('56','1','1','31'); INSERT INTO `glpi_notificationtargets` VALUES ('57','21','1','31'); INSERT INTO `glpi_notificationtargets` VALUES ('58','3','1','32'); INSERT INTO `glpi_notificationtargets` VALUES ('59','1','1','32'); INSERT INTO `glpi_notificationtargets` VALUES ('60','21','1','32'); INSERT INTO `glpi_notificationtargets` VALUES ('61','3','1','33'); INSERT INTO `glpi_notificationtargets` VALUES ('62','1','1','33'); INSERT INTO `glpi_notificationtargets` VALUES ('63','21','1','33'); INSERT INTO `glpi_notificationtargets` VALUES ('64','3','1','34'); INSERT INTO `glpi_notificationtargets` VALUES ('65','1','1','34'); INSERT INTO `glpi_notificationtargets` VALUES ('66','21','1','34'); INSERT INTO `glpi_notificationtargets` VALUES ('67','3','1','35'); INSERT INTO `glpi_notificationtargets` VALUES ('68','1','1','35'); INSERT INTO `glpi_notificationtargets` VALUES ('69','21','1','35'); INSERT INTO `glpi_notificationtargets` VALUES ('70','3','1','36'); INSERT INTO `glpi_notificationtargets` VALUES ('71','1','1','36'); INSERT INTO `glpi_notificationtargets` VALUES ('72','21','1','36'); INSERT INTO `glpi_notificationtargets` VALUES ('73','14','1','37'); INSERT INTO `glpi_notificationtargets` VALUES ('74','3','1','40'); ### Dump table glpi_notificationtemplates DROP TABLE IF EXISTS `glpi_notificationtemplates`; CREATE TABLE `glpi_notificationtemplates` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `itemtype` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `date_mod` datetime DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `css` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `itemtype` (`itemtype`), KEY `date_mod` (`date_mod`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `glpi_notificationtemplates` VALUES ('1','MySQL Synchronization','DBConnection','2010-02-01 15:51:46','',NULL); INSERT INTO `glpi_notificationtemplates` VALUES ('2','Reservations','Reservation','2010-02-03 14:03:45','',NULL); INSERT INTO `glpi_notificationtemplates` VALUES ('3','Alert Reservation','Reservation','2010-02-03 14:03:45','',NULL); INSERT INTO `glpi_notificationtemplates` VALUES ('4','Tickets','Ticket','2010-02-07 21:39:15','',NULL); INSERT INTO `glpi_notificationtemplates` VALUES ('5','Tickets (Simple)','Ticket','2010-02-07 21:39:15','',NULL); INSERT INTO `glpi_notificationtemplates` VALUES ('6','Alert Tickets not closed','Ticket','2010-02-07 21:39:15','',NULL); INSERT INTO `glpi_notificationtemplates` VALUES ('7','Tickets Validation','Ticket','2010-02-26 21:39:15','',NULL); INSERT INTO `glpi_notificationtemplates` VALUES ('8','Cartridges','CartridgeItem','2010-02-16 13:17:24','',NULL); INSERT INTO `glpi_notificationtemplates` VALUES ('9','Consumables','ConsumableItem','2010-02-16 13:17:38','',NULL); INSERT INTO `glpi_notificationtemplates` VALUES ('10','Infocoms','Infocom','2010-02-16 13:17:55','',NULL); INSERT INTO `glpi_notificationtemplates` VALUES ('11','Licenses','SoftwareLicense','2010-02-16 13:18:12','',NULL); INSERT INTO `glpi_notificationtemplates` VALUES ('12','Contracts','Contract','2010-02-16 13:18:12','',NULL); INSERT INTO `glpi_notificationtemplates` VALUES ('13','Password Forget','User','2011-03-04 11:35:13',NULL,NULL); INSERT INTO `glpi_notificationtemplates` VALUES ('14','Ticket Satisfaction','Ticket','2011-03-04 11:35:15',NULL,NULL); INSERT INTO `glpi_notificationtemplates` VALUES ('15','Item not unique','FieldUnicity','2011-03-04 11:35:16',NULL,NULL); INSERT INTO `glpi_notificationtemplates` VALUES ('16','Crontask','Crontask','2011-03-04 11:35:16',NULL,NULL); INSERT INTO `glpi_notificationtemplates` VALUES ('17','Problems','Problem','2011-12-06 09:48:33',NULL,NULL); INSERT INTO `glpi_notificationtemplates` VALUES ('18','Planning recall','PlanningRecall','2013-05-28 09:50:43',NULL,NULL); ### Dump table glpi_notificationtemplatetranslations DROP TABLE IF EXISTS `glpi_notificationtemplatetranslations`; CREATE TABLE `glpi_notificationtemplatetranslations` ( `id` int(11) NOT NULL AUTO_INCREMENT, `notificationtemplates_id` int(11) NOT NULL DEFAULT '0', `language` char(5) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `subject` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `content_text` text COLLATE utf8_unicode_ci, `content_html` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `notificationtemplates_id` (`notificationtemplates_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `glpi_notificationtemplatetranslations` VALUES ('1','1','','##lang.dbconnection.title##','##lang.dbconnection.delay## : ##dbconnection.delay## ','<p>##lang.dbconnection.delay## : ##dbconnection.delay##</p>'); INSERT INTO `glpi_notificationtemplatetranslations` VALUES ('2','2','','##reservation.action##','====================================================================== ##lang.reservation.user##: ##reservation.user## ##lang.reservation.item.name##: ##reservation.itemtype## - ##reservation.item.name## ##IFreservation.tech## ##lang.reservation.tech## ##reservation.tech## ##ENDIFreservation.tech## ##lang.reservation.begin##: ##reservation.begin## ##lang.reservation.end##: ##reservation.end## ##lang.reservation.comment##: ##reservation.comment## ====================================================================== ','<!-- description{ color: inherit; background: #ebebeb;border-style: solid;border-color: #8d8d8d; border-width: 0px 1px 1px 0px; } --> <p><span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\">##lang.reservation.user##:</span>##reservation.user##<br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\">##lang.reservation.item.name##:</span>##reservation.itemtype## - ##reservation.item.name##<br />##IFreservation.tech## ##lang.reservation.tech## ##reservation.tech####ENDIFreservation.tech##<br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\">##lang.reservation.begin##:</span> ##reservation.begin##<br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\">##lang.reservation.end##:</span>##reservation.end##<br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\">##lang.reservation.comment##:</span> ##reservation.comment##</p>'); INSERT INTO `glpi_notificationtemplatetranslations` VALUES ('3','3','','##reservation.action## ##reservation.entity##','##lang.reservation.entity## : ##reservation.entity## ##FOREACHreservations## ##lang.reservation.itemtype## : ##reservation.itemtype## ##lang.reservation.item## : ##reservation.item## ##reservation.url## ##ENDFOREACHreservations##','<p>##lang.reservation.entity## : ##reservation.entity## <br /> <br /> ##FOREACHreservations## <br />##lang.reservation.itemtype## : ##reservation.itemtype##<br /> ##lang.reservation.item## : ##reservation.item##<br /> <br /> <a href=\"##reservation.url##\"> ##reservation.url##</a><br /> ##ENDFOREACHreservations##</p>'); INSERT INTO `glpi_notificationtemplatetranslations` VALUES ('4','4','','##ticket.action## ##ticket.title##',' ##IFticket.storestatus=5## ##lang.ticket.url## : ##ticket.urlapprove## ##lang.ticket.autoclosewarning## ##lang.ticket.solvedate## : ##ticket.solvedate## ##lang.ticket.solution.type## : ##ticket.solution.type## ##lang.ticket.solution.description## : ##ticket.solution.description## ##ENDIFticket.storestatus## ##ELSEticket.storestatus## ##lang.ticket.url## : ##ticket.url## ##ENDELSEticket.storestatus## ##lang.ticket.description## ##lang.ticket.title## : ##ticket.title## ##lang.ticket.authors## : ##IFticket.authors## ##ticket.authors## ##ENDIFticket.authors## ##ELSEticket.authors##--##ENDELSEticket.authors## ##lang.ticket.creationdate## : ##ticket.creationdate## ##lang.ticket.closedate## : ##ticket.closedate## ##lang.ticket.requesttype## : ##ticket.requesttype## ##IFticket.itemtype## ##lang.ticket.item.name## : ##ticket.itemtype## - ##ticket.item.name## ##IFticket.item.model## - ##ticket.item.model## ##ENDIFticket.item.model## ##IFticket.item.serial## - ##ticket.item.serial## ##ENDIFticket.item.serial## ##IFticket.item.otherserial## -##ticket.item.otherserial## ##ENDIFticket.item.otherserial## ##ENDIFticket.itemtype## ##IFticket.assigntousers## ##lang.ticket.assigntousers## : ##ticket.assigntousers## ##ENDIFticket.assigntousers## ##lang.ticket.status## : ##ticket.status## ##IFticket.assigntogroups## ##lang.ticket.assigntogroups## : ##ticket.assigntogroups## ##ENDIFticket.assigntogroups## ##lang.ticket.urgency## : ##ticket.urgency## ##lang.ticket.impact## : ##ticket.impact## ##lang.ticket.priority## : ##ticket.priority## ##IFticket.user.email## ##lang.ticket.user.email## : ##ticket.user.email ##ENDIFticket.user.email## ##IFticket.category## ##lang.ticket.category## : ##ticket.category## ##ENDIFticket.category## ##ELSEticket.category## ##lang.ticket.nocategoryassigned## ##ENDELSEticket.category## ##lang.ticket.content## : ##ticket.content## ##IFticket.storestatus=6## ##lang.ticket.solvedate## : ##ticket.solvedate## ##lang.ticket.solution.type## : ##ticket.solution.type## ##lang.ticket.solution.description## : ##ticket.solution.description## ##ENDIFticket.storestatus## ##lang.ticket.numberoffollowups## : ##ticket.numberoffollowups## ##FOREACHfollowups## [##followup.date##] ##lang.followup.isprivate## : ##followup.isprivate## ##lang.followup.author## ##followup.author## ##lang.followup.description## ##followup.description## ##lang.followup.date## ##followup.date## ##lang.followup.requesttype## ##followup.requesttype## ##ENDFOREACHfollowups## ##lang.ticket.numberoftasks## : ##ticket.numberoftasks## ##FOREACHtasks## [##task.date##] ##lang.task.isprivate## : ##task.isprivate## ##lang.task.author## ##task.author## ##lang.task.description## ##task.description## ##lang.task.time## ##task.time## ##lang.task.category## ##task.category## ##ENDFOREACHtasks##','
    ##IFticket.storestatus=5##
    ##lang.ticket.url## : ##ticket.urlapprove##  
    ##lang.ticket.autoclosewarning##
    ##lang.ticket.solvedate## : ##ticket.solvedate##
    ##lang.ticket.solution.type## : ##ticket.solution.type##
    ##lang.ticket.solution.description## : ##ticket.solution.description## ##ENDIFticket.storestatus##
    ##ELSEticket.storestatus## ##lang.ticket.url## : ##ticket.url## ##ENDELSEticket.storestatus##

    ##lang.ticket.description##

    ##lang.ticket.title## :##ticket.title##
    ##lang.ticket.authors## :##IFticket.authors## ##ticket.authors## ##ENDIFticket.authors## ##ELSEticket.authors##--##ENDELSEticket.authors##
    ##lang.ticket.creationdate## :##ticket.creationdate##
    ##lang.ticket.closedate## :##ticket.closedate##
    ##lang.ticket.requesttype## :##ticket.requesttype##
    ##IFticket.itemtype## ##lang.ticket.item.name## : ##ticket.itemtype## - ##ticket.item.name## ##IFticket.item.model## - ##ticket.item.model## ##ENDIFticket.item.model## ##IFticket.item.serial## -##ticket.item.serial## ##ENDIFticket.item.serial##  ##IFticket.item.otherserial## -##ticket.item.otherserial## ##ENDIFticket.item.otherserial## ##ENDIFticket.itemtype##
    ##IFticket.assigntousers## ##lang.ticket.assigntousers## : ##ticket.assigntousers## ##ENDIFticket.assigntousers##
    ##lang.ticket.status##  : ##ticket.status##
    ##IFticket.assigntogroups## ##lang.ticket.assigntogroups## : ##ticket.assigntogroups## ##ENDIFticket.assigntogroups##
    ##lang.ticket.urgency## : ##ticket.urgency##
    ##lang.ticket.impact## : ##ticket.impact##
    ##lang.ticket.priority## : ##ticket.priority##
    ##IFticket.user.email## ##lang.ticket.user.email## : ##ticket.user.email ##ENDIFticket.user.email##
    ##IFticket.category####lang.ticket.category##  :##ticket.category## ##ENDIFticket.category## ##ELSEticket.category## ##lang.ticket.nocategoryassigned## ##ENDELSEticket.category##
    ##lang.ticket.content## : ##ticket.content##


    ##IFticket.storestatus=6##
    ##lang.ticket.solvedate## : ##ticket.solvedate##
    ##lang.ticket.solution.type## : ##ticket.solution.type##
    ##lang.ticket.solution.description## : ##ticket.solution.description##
    ##ENDIFticket.storestatus##

    ##lang.ticket.numberoffollowups## : ##ticket.numberoffollowups##

    ##FOREACHfollowups##


    [##followup.date##] ##lang.followup.isprivate## : ##followup.isprivate##
    ##lang.followup.author## ##followup.author##
    ##lang.followup.description## ##followup.description##
    ##lang.followup.date## ##followup.date##
    ##lang.followup.requesttype## ##followup.requesttype##

    ##ENDFOREACHfollowups##

    ##lang.ticket.numberoftasks## : ##ticket.numberoftasks##

    ##FOREACHtasks##


    [##task.date##] ##lang.task.isprivate## : ##task.isprivate##
    ##lang.task.author## ##task.author##
    ##lang.task.description## ##task.description##
    ##lang.task.time## ##task.time##
    ##lang.task.category## ##task.category##

    ##ENDFOREACHtasks##

    '); INSERT INTO `glpi_notificationtemplatetranslations` VALUES ('5','12','','##contract.action## ##contract.entity##','##lang.contract.entity## : ##contract.entity## ##FOREACHcontracts## ##lang.contract.name## : ##contract.name## ##lang.contract.number## : ##contract.number## ##lang.contract.time## : ##contract.time## ##IFcontract.type####lang.contract.type## : ##contract.type####ENDIFcontract.type## ##contract.url## ##ENDFOREACHcontracts##','<p>##lang.contract.entity## : ##contract.entity##<br /> <br />##FOREACHcontracts##<br />##lang.contract.name## : ##contract.name##<br /> ##lang.contract.number## : ##contract.number##<br /> ##lang.contract.time## : ##contract.time##<br /> ##IFcontract.type####lang.contract.type## : ##contract.type## ##ENDIFcontract.type##<br /> <a href=\"##contract.url##\"> ##contract.url##</a><br /> ##ENDFOREACHcontracts##</p>'); INSERT INTO `glpi_notificationtemplatetranslations` VALUES ('6','5','','##ticket.action## ##ticket.title##','##lang.ticket.url## : ##ticket.url## ##lang.ticket.description## ##lang.ticket.title##  :##ticket.title## ##lang.ticket.authors##  :##IFticket.authors## ##ticket.authors## ##ENDIFticket.authors## ##ELSEticket.authors##--##ENDELSEticket.authors##   ##IFticket.category## ##lang.ticket.category##  :##ticket.category## ##ENDIFticket.category## ##ELSEticket.category## ##lang.ticket.nocategoryassigned## ##ENDELSEticket.category## ##lang.ticket.content##  : ##ticket.content## ##IFticket.itemtype## ##lang.ticket.item.name##  : ##ticket.itemtype## - ##ticket.item.name## ##ENDIFticket.itemtype##','<div>##lang.ticket.url## : <a href=\"##ticket.url##\"> ##ticket.url##</a></div> <div class=\"description b\"> ##lang.ticket.description##</div> <p><span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.ticket.title##</span> :##ticket.title## <br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.ticket.authors##</span> ##IFticket.authors## ##ticket.authors## ##ENDIFticket.authors## ##ELSEticket.authors##--##ENDELSEticket.authors## <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\">  ;</span><br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> </span> ##IFticket.category##<span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.ticket.category## </span> :##ticket.category## ##ENDIFticket.category## ##ELSEticket.category## ##lang.ticket.nocategoryassigned## ##ENDELSEticket.category## <br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.ticket.content##</span> : ##ticket.content##<br />##IFticket.itemtype## <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.ticket.item.name##</span> : ##ticket.itemtype## - ##ticket.item.name## ##ENDIFticket.itemtype##</p>'); INSERT INTO `glpi_notificationtemplatetranslations` VALUES ('15','15','','##lang.unicity.action##','##lang.unicity.entity## : ##unicity.entity## ##lang.unicity.itemtype## : ##unicity.itemtype## ##lang.unicity.message## : ##unicity.message## ##lang.unicity.action_user## : ##unicity.action_user## ##lang.unicity.action_type## : ##unicity.action_type## ##lang.unicity.date## : ##unicity.date##','<p>##lang.unicity.entity## : ##unicity.entity##</p> <p>##lang.unicity.itemtype## : ##unicity.itemtype##</p> <p>##lang.unicity.message## : ##unicity.message##</p> <p>##lang.unicity.action_user## : ##unicity.action_user##</p> <p>##lang.unicity.action_type## : ##unicity.action_type##</p> <p>##lang.unicity.date## : ##unicity.date##</p>'); INSERT INTO `glpi_notificationtemplatetranslations` VALUES ('7','7','','##ticket.action## ##ticket.title##','##FOREACHvalidations## ##IFvalidation.storestatus=4## ##validation.submission.title## ##lang.validation.commentsubmission## : ##validation.commentsubmission## ##ENDIFvalidation.storestatus## ##ELSEvalidation.storestatus## ##validation.answer.title## ##ENDELSEvalidation.storestatus## ##lang.ticket.url## : ##ticket.urlvalidation## ##IFvalidation.status## ##lang.validation.status## : ##validation.status## ##ENDIFvalidation.status## ##IFvalidation.commentvalidation## ##lang.validation.commentvalidation## : ##validation.commentvalidation## ##ENDIFvalidation.commentvalidation## ##ENDFOREACHvalidations##','<div>##FOREACHvalidations##</div> <p>##IFvalidation.storestatus=4##</p> <div>##validation.submission.title##</div> <div>##lang.validation.commentsubmission## : ##validation.commentsubmission##</div> <div>##ENDIFvalidation.storestatus##</div> <div>##ELSEvalidation.storestatus## ##validation.answer.title## ##ENDELSEvalidation.storestatus##</div> <div></div> <div> <div>##lang.ticket.url## : <a href=\"##ticket.urlvalidation##\"> ##ticket.urlvalidation## </a></div> </div> <p>##IFvalidation.status## ##lang.validation.status## : ##validation.status## ##ENDIFvalidation.status## <br /> ##IFvalidation.commentvalidation##<br /> ##lang.validation.commentvalidation## :   ##validation.commentvalidation##<br /> ##ENDIFvalidation.commentvalidation## <br />##ENDFOREACHvalidations##</p>'); INSERT INTO `glpi_notificationtemplatetranslations` VALUES ('8','6','','##ticket.action## ##ticket.entity##','##lang.ticket.entity## : ##ticket.entity## ##FOREACHtickets## ##lang.ticket.title## : ##ticket.title## ##lang.ticket.status## : ##ticket.status## ##ticket.url## ##ENDFOREACHtickets##','<table class=\"tab_cadre\" border=\"1\" cellspacing=\"2\" cellpadding=\"3\"> <tbody> <tr> <td style=\"text-align: left;\" width=\"auto\" bgcolor=\"#cccccc\"><span style=\"font-size: 11px; text-align: left;\">##lang.ticket.authors##</span></td> <td style=\"text-align: left;\" width=\"auto\" bgcolor=\"#cccccc\"><span style=\"font-size: 11px; text-align: left;\">##lang.ticket.title##</span></td> <td style=\"text-align: left;\" width=\"auto\" bgcolor=\"#cccccc\"><span style=\"font-size: 11px; text-align: left;\">##lang.ticket.priority##</span></td> <td style=\"text-align: left;\" width=\"auto\" bgcolor=\"#cccccc\"><span style=\"font-size: 11px; text-align: left;\">##lang.ticket.status##</span></td> <td style=\"text-align: left;\" width=\"auto\" bgcolor=\"#cccccc\"><span style=\"font-size: 11px; text-align: left;\">##lang.ticket.attribution##</span></td> <td style=\"text-align: left;\" width=\"auto\" bgcolor=\"#cccccc\"><span style=\"font-size: 11px; text-align: left;\">##lang.ticket.creationdate##</span></td> <td style=\"text-align: left;\" width=\"auto\" bgcolor=\"#cccccc\"><span style=\"font-size: 11px; text-align: left;\">##lang.ticket.content##</span></td> </tr> ##FOREACHtickets## <tr> <td width=\"auto\"><span style=\"font-size: 11px; text-align: left;\">##ticket.authors##</span></td> <td width=\"auto\"><span style=\"font-size: 11px; text-align: left;\"><a href=\"##ticket.url##\">##ticket.title##</a></span></td> <td width=\"auto\"><span style=\"font-size: 11px; text-align: left;\">##ticket.priority##</span></td> <td width=\"auto\"><span style=\"font-size: 11px; text-align: left;\">##ticket.status##</span></td> <td width=\"auto\"><span style=\"font-size: 11px; text-align: left;\">##IFticket.assigntousers####ticket.assigntousers##<br />##ENDIFticket.assigntousers####IFticket.assigntogroups##<br />##ticket.assigntogroups## ##ENDIFticket.assigntogroups####IFticket.assigntosupplier##<br />##ticket.assigntosupplier## ##ENDIFticket.assigntosupplier##</span></td> <td width=\"auto\"><span style=\"font-size: 11px; text-align: left;\">##ticket.creationdate##</span></td> <td width=\"auto\"><span style=\"font-size: 11px; text-align: left;\">##ticket.content##</span></td> </tr> ##ENDFOREACHtickets## </tbody> </table>'); INSERT INTO `glpi_notificationtemplatetranslations` VALUES ('9','9','','##consumable.action## ##consumable.entity##','##lang.consumable.entity## : ##consumable.entity## ##FOREACHconsumables## ##lang.consumable.item## : ##consumable.item## ##lang.consumable.reference## : ##consumable.reference## ##lang.consumable.remaining## : ##consumable.remaining## ##consumable.url## ##ENDFOREACHconsumables##','<p> ##lang.consumable.entity## : ##consumable.entity## <br /> <br />##FOREACHconsumables## <br />##lang.consumable.item## : ##consumable.item##<br /> <br />##lang.consumable.reference## : ##consumable.reference##<br /> ##lang.consumable.remaining## : ##consumable.remaining##<br /> <a href=\"##consumable.url##\"> ##consumable.url##</a><br /> ##ENDFOREACHconsumables##</p>'); INSERT INTO `glpi_notificationtemplatetranslations` VALUES ('10','8','','##cartridge.action## ##cartridge.entity##','##lang.cartridge.entity## : ##cartridge.entity## ##FOREACHcartridges## ##lang.cartridge.item## : ##cartridge.item## ##lang.cartridge.reference## : ##cartridge.reference## ##lang.cartridge.remaining## : ##cartridge.remaining## ##cartridge.url## ##ENDFOREACHcartridges##','<p>##lang.cartridge.entity## : ##cartridge.entity## <br /> <br />##FOREACHcartridges## <br />##lang.cartridge.item## : ##cartridge.item##<br /> <br /> ##lang.cartridge.reference## : ##cartridge.reference##<br /> ##lang.cartridge.remaining## : ##cartridge.remaining##<br /> <a href=\"##cartridge.url##\"> ##cartridge.url##</a><br /> ##ENDFOREACHcartridges##</p>'); INSERT INTO `glpi_notificationtemplatetranslations` VALUES ('11','10','','##infocom.action## ##infocom.entity##','##lang.infocom.entity## : ##infocom.entity## ##FOREACHinfocoms## ##lang.infocom.itemtype## : ##infocom.itemtype## ##lang.infocom.item## : ##infocom.item## ##lang.infocom.expirationdate## : ##infocom.expirationdate## ##infocom.url## ##ENDFOREACHinfocoms##','<p>##lang.infocom.entity## : ##infocom.entity## <br /> <br />##FOREACHinfocoms## <br />##lang.infocom.itemtype## : ##infocom.itemtype##<br /> ##lang.infocom.item## : ##infocom.item##<br /> <br /> ##lang.infocom.expirationdate## : ##infocom.expirationdate## <br /> <a href=\"##infocom.url##\"> ##infocom.url##</a><br /> ##ENDFOREACHinfocoms##</p>'); INSERT INTO `glpi_notificationtemplatetranslations` VALUES ('12','11','','##license.action## ##license.entity##','##lang.license.entity## : ##license.entity## ##FOREACHlicenses## ##lang.license.item## : ##license.item## ##lang.license.serial## : ##license.serial## ##lang.license.expirationdate## : ##license.expirationdate## ##license.url## ##ENDFOREACHlicenses##','<p> ##lang.license.entity## : ##license.entity##<br /> ##FOREACHlicenses## <br />##lang.license.item## : ##license.item##<br /> ##lang.license.serial## : ##license.serial##<br /> ##lang.license.expirationdate## : ##license.expirationdate## <br /> <a href=\"##license.url##\"> ##license.url## </a><br /> ##ENDFOREACHlicenses##</p>'); INSERT INTO `glpi_notificationtemplatetranslations` VALUES ('13','13','','##user.action##','##user.realname## ##user.firstname## ##lang.passwordforget.information## ##lang.passwordforget.link## ##user.passwordforgeturl##','<p><strong>##user.realname## ##user.firstname##</strong></p> <p>##lang.passwordforget.information##</p> <p>##lang.passwordforget.link## <a title=\"##user.passwordforgeturl##\" href=\"##user.passwordforgeturl##\">##user.passwordforgeturl##</a></p>'); INSERT INTO `glpi_notificationtemplatetranslations` VALUES ('14','14','','##ticket.action## ##ticket.title##','##lang.ticket.title## : ##ticket.title## ##lang.ticket.closedate## : ##ticket.closedate## ##lang.satisfaction.text## ##ticket.urlsatisfaction##','<p>##lang.ticket.title## : ##ticket.title##</p> <p>##lang.ticket.closedate## : ##ticket.closedate##</p> <p>##lang.satisfaction.text## <a href=\"##ticket.urlsatisfaction##\">##ticket.urlsatisfaction##</a></p>'); INSERT INTO `glpi_notificationtemplatetranslations` VALUES ('16','16','','##crontask.action##','##lang.crontask.warning## ##FOREACHcrontasks## ##crontask.name## : ##crontask.description## ##ENDFOREACHcrontasks##','<p>##lang.crontask.warning##</p> <p>##FOREACHcrontasks## <br /><a href=\"##crontask.url##\">##crontask.name##</a> : ##crontask.description##<br /> <br />##ENDFOREACHcrontasks##</p>'); INSERT INTO `glpi_notificationtemplatetranslations` VALUES ('17','17','','##problem.action## ##problem.title##','##IFproblem.storestatus=5## ##lang.problem.url## : ##problem.urlapprove## ##lang.problem.solvedate## : ##problem.solvedate## ##lang.problem.solution.type## : ##problem.solution.type## ##lang.problem.solution.description## : ##problem.solution.description## ##ENDIFproblem.storestatus## ##ELSEproblem.storestatus## ##lang.problem.url## : ##problem.url## ##ENDELSEproblem.storestatus## ##lang.problem.description## ##lang.problem.title##  :##problem.title## ##lang.problem.authors##  :##IFproblem.authors## ##problem.authors## ##ENDIFproblem.authors## ##ELSEproblem.authors##--##ENDELSEproblem.authors## ##lang.problem.creationdate##  :##problem.creationdate## ##IFproblem.assigntousers## ##lang.problem.assigntousers##  : ##problem.assigntousers## ##ENDIFproblem.assigntousers## ##lang.problem.status##  : ##problem.status## ##IFproblem.assigntogroups## ##lang.problem.assigntogroups##  : ##problem.assigntogroups## ##ENDIFproblem.assigntogroups## ##lang.problem.urgency##  : ##problem.urgency## ##lang.problem.impact##  : ##problem.impact## ##lang.problem.priority## : ##problem.priority## ##IFproblem.category## ##lang.problem.category##  :##problem.category## ##ENDIFproblem.category## ##ELSEproblem.category## ##lang.problem.nocategoryassigned## ##ENDELSEproblem.category## ##lang.problem.content##  : ##problem.content## ##IFproblem.storestatus=6## ##lang.problem.solvedate## : ##problem.solvedate## ##lang.problem.solution.type## : ##problem.solution.type## ##lang.problem.solution.description## : ##problem.solution.description## ##ENDIFproblem.storestatus## ##lang.problem.numberoftickets## : ##problem.numberoftickets## ##FOREACHtickets## [##ticket.date##] ##lang.problem.title## : ##ticket.title## ##lang.problem.content## ##ticket.content## ##ENDFOREACHtickets## ##lang.problem.numberoftasks## : ##problem.numberoftasks## ##FOREACHtasks## [##task.date##] ##lang.task.author## ##task.author## ##lang.task.description## ##task.description## ##lang.task.time## ##task.time## ##lang.task.category## ##task.category## ##ENDFOREACHtasks## ','<p>##IFproblem.storestatus=5##</p> <div>##lang.problem.url## : <a href=\"##problem.urlapprove##\">##problem.urlapprove##</a></div> <div><span style=\"color: #888888;\"><strong><span style=\"text-decoration: underline;\">##lang.problem.solvedate##</span></strong></span> : ##problem.solvedate##<br /><span style=\"text-decoration: underline; color: #888888;\"><strong>##lang.problem.solution.type##</strong></span> : ##problem.solution.type##<br /><span style=\"text-decoration: underline; color: #888888;\"><strong>##lang.problem.solution.description##</strong></span> : ##problem.solution.description## ##ENDIFproblem.storestatus##</div> <div>##ELSEproblem.storestatus## ##lang.problem.url## : <a href=\"##problem.url##\">##problem.url##</a> ##ENDELSEproblem.storestatus##</div> <p class=\"description b\"><strong>##lang.problem.description##</strong></p> <p><span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.problem.title##</span> :##problem.title## <br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.problem.authors##</span> :##IFproblem.authors## ##problem.authors## ##ENDIFproblem.authors## ##ELSEproblem.authors##--##ENDELSEproblem.authors## <br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.problem.creationdate##</span> :##problem.creationdate## <br /> ##IFproblem.assigntousers## <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.problem.assigntousers##</span> : ##problem.assigntousers## ##ENDIFproblem.assigntousers##<br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\">##lang.problem.status## </span> : ##problem.status##<br /> ##IFproblem.assigntogroups## <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.problem.assigntogroups##</span> : ##problem.assigntogroups## ##ENDIFproblem.assigntogroups##<br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.problem.urgency##</span> : ##problem.urgency##<br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.problem.impact##</span> : ##problem.impact##<br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.problem.priority##</span> : ##problem.priority## <br />##IFproblem.category##<span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\">##lang.problem.category## </span> :##problem.category## ##ENDIFproblem.category## ##ELSEproblem.category## ##lang.problem.nocategoryassigned## ##ENDELSEproblem.category## <br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.problem.content##</span> : ##problem.content##</p> <p>##IFproblem.storestatus=6##<br /><span style=\"text-decoration: underline;\"><strong><span style=\"color: #888888;\">##lang.problem.solvedate##</span></strong></span> : ##problem.solvedate##<br /><span style=\"color: #888888;\"><strong><span style=\"text-decoration: underline;\">##lang.problem.solution.type##</span></strong></span> : ##problem.solution.type##<br /><span style=\"text-decoration: underline; color: #888888;\"><strong>##lang.problem.solution.description##</strong></span> : ##problem.solution.description##<br />##ENDIFproblem.storestatus##</p> <div class=\"description b\">##lang.problem.numberoftickets## : ##problem.numberoftickets##</div> <p>##FOREACHtickets##</p> <div><strong> [##ticket.date##] <em>##lang.problem.title## : <a href=\"##ticket.url##\">##ticket.title## </a></em></strong><br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> </span><span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\">##lang.problem.content## </span> ##ticket.content## <p>##ENDFOREACHtickets##</p> <div class=\"description b\">##lang.problem.numberoftasks## : ##problem.numberoftasks##</div> <p>##FOREACHtasks##</p> <div class=\"description b\"><strong>[##task.date##] </strong><br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.task.author##</span> ##task.author##<br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.task.description##</span> ##task.description##<br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.task.time##</span> ##task.time##<br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.task.category##</span> ##task.category##</div> <p>##ENDFOREACHtasks##</p> </div>'); INSERT INTO `glpi_notificationtemplatetranslations` VALUES ('18','18','','##recall.action##: ##recall.item.name##','##recall.action##: ##recall.item.name## ##recall.item.content## ##lang.recall.planning.begin##: ##recall.planning.begin## ##lang.recall.planning.end##: ##recall.planning.end## ##lang.recall.planning.state##: ##recall.planning.state## ##lang.recall.item.private##: ##recall.item.private##','<p>##recall.action##: <a href=\"##recall.item.url##\">##recall.item.name##</a></p> <p>##recall.item.content##</p> <p>##lang.recall.planning.begin##: ##recall.planning.begin##<br />##lang.recall.planning.end##: ##recall.planning.end##<br />##lang.recall.planning.state##: ##recall.planning.state##<br />##lang.recall.item.private##: ##recall.item.private##<br /><br /></p> <p><br /><br /></p>'); ### Dump table glpi_notimportedemails DROP TABLE IF EXISTS `glpi_notimportedemails`; CREATE TABLE `glpi_notimportedemails` ( `id` int(11) NOT NULL AUTO_INCREMENT, `from` varchar(255) NOT NULL, `to` varchar(255) NOT NULL, `mailcollectors_id` int(11) NOT NULL DEFAULT '0', `date` datetime NOT NULL, `subject` text, `messageid` varchar(255) NOT NULL, `reason` int(11) NOT NULL DEFAULT '0', `users_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `users_id` (`users_id`), KEY `mailcollectors_id` (`mailcollectors_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; ### Dump table glpi_operatingsystems DROP TABLE IF EXISTS `glpi_operatingsystems`; CREATE TABLE `glpi_operatingsystems` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_operatingsystemservicepacks DROP TABLE IF EXISTS `glpi_operatingsystemservicepacks`; CREATE TABLE `glpi_operatingsystemservicepacks` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_operatingsystemversions DROP TABLE IF EXISTS `glpi_operatingsystemversions`; CREATE TABLE `glpi_operatingsystemversions` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_peripheralmodels DROP TABLE IF EXISTS `glpi_peripheralmodels`; CREATE TABLE `glpi_peripheralmodels` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_peripherals DROP TABLE IF EXISTS `glpi_peripherals`; CREATE TABLE `glpi_peripherals` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `date_mod` datetime DEFAULT NULL, `contact` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `contact_num` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `users_id_tech` int(11) NOT NULL DEFAULT '0', `groups_id_tech` int(11) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, `serial` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `otherserial` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `locations_id` int(11) NOT NULL DEFAULT '0', `peripheraltypes_id` int(11) NOT NULL DEFAULT '0', `peripheralmodels_id` int(11) NOT NULL DEFAULT '0', `brand` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `manufacturers_id` int(11) NOT NULL DEFAULT '0', `is_global` tinyint(1) NOT NULL DEFAULT '0', `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `is_template` tinyint(1) NOT NULL DEFAULT '0', `template_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `notepad` longtext COLLATE utf8_unicode_ci, `users_id` int(11) NOT NULL DEFAULT '0', `groups_id` int(11) NOT NULL DEFAULT '0', `states_id` int(11) NOT NULL DEFAULT '0', `ticket_tco` decimal(20,4) DEFAULT '0.0000', `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `name` (`name`), KEY `is_template` (`is_template`), KEY `is_global` (`is_global`), KEY `entities_id` (`entities_id`), KEY `manufacturers_id` (`manufacturers_id`), KEY `groups_id` (`groups_id`), KEY `users_id` (`users_id`), KEY `locations_id` (`locations_id`), KEY `peripheralmodels_id` (`peripheralmodels_id`), KEY `states_id` (`states_id`), KEY `users_id_tech` (`users_id_tech`), KEY `peripheraltypes_id` (`peripheraltypes_id`), KEY `is_deleted` (`is_deleted`), KEY `date_mod` (`date_mod`), KEY `groups_id_tech` (`groups_id_tech`), KEY `is_dynamic` (`is_dynamic`), KEY `serial` (`serial`), KEY `otherserial` (`otherserial`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_peripheraltypes DROP TABLE IF EXISTS `glpi_peripheraltypes`; CREATE TABLE `glpi_peripheraltypes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_phonemodels DROP TABLE IF EXISTS `glpi_phonemodels`; CREATE TABLE `glpi_phonemodels` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_phonepowersupplies DROP TABLE IF EXISTS `glpi_phonepowersupplies`; CREATE TABLE `glpi_phonepowersupplies` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_phones DROP TABLE IF EXISTS `glpi_phones`; CREATE TABLE `glpi_phones` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `date_mod` datetime DEFAULT NULL, `contact` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `contact_num` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `users_id_tech` int(11) NOT NULL DEFAULT '0', `groups_id_tech` int(11) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, `serial` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `otherserial` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `firmware` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `locations_id` int(11) NOT NULL DEFAULT '0', `phonetypes_id` int(11) NOT NULL DEFAULT '0', `phonemodels_id` int(11) NOT NULL DEFAULT '0', `brand` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `phonepowersupplies_id` int(11) NOT NULL DEFAULT '0', `number_line` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `have_headset` tinyint(1) NOT NULL DEFAULT '0', `have_hp` tinyint(1) NOT NULL DEFAULT '0', `manufacturers_id` int(11) NOT NULL DEFAULT '0', `is_global` tinyint(1) NOT NULL DEFAULT '0', `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `is_template` tinyint(1) NOT NULL DEFAULT '0', `template_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `notepad` longtext COLLATE utf8_unicode_ci, `users_id` int(11) NOT NULL DEFAULT '0', `groups_id` int(11) NOT NULL DEFAULT '0', `states_id` int(11) NOT NULL DEFAULT '0', `ticket_tco` decimal(20,4) DEFAULT '0.0000', `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `name` (`name`), KEY `is_template` (`is_template`), KEY `is_global` (`is_global`), KEY `entities_id` (`entities_id`), KEY `manufacturers_id` (`manufacturers_id`), KEY `groups_id` (`groups_id`), KEY `users_id` (`users_id`), KEY `locations_id` (`locations_id`), KEY `phonemodels_id` (`phonemodels_id`), KEY `phonepowersupplies_id` (`phonepowersupplies_id`), KEY `states_id` (`states_id`), KEY `users_id_tech` (`users_id_tech`), KEY `phonetypes_id` (`phonetypes_id`), KEY `is_deleted` (`is_deleted`), KEY `date_mod` (`date_mod`), KEY `groups_id_tech` (`groups_id_tech`), KEY `is_dynamic` (`is_dynamic`), KEY `serial` (`serial`), KEY `otherserial` (`otherserial`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_phonetypes DROP TABLE IF EXISTS `glpi_phonetypes`; CREATE TABLE `glpi_phonetypes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_planningrecalls DROP TABLE IF EXISTS `glpi_planningrecalls`; CREATE TABLE `glpi_planningrecalls` ( `id` int(11) NOT NULL AUTO_INCREMENT, `items_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `users_id` int(11) NOT NULL DEFAULT '0', `before_time` int(11) NOT NULL DEFAULT '-10', `when` datetime DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`itemtype`,`items_id`,`users_id`), KEY `users_id` (`users_id`), KEY `before_time` (`before_time`), KEY `when` (`when`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_plugins DROP TABLE IF EXISTS `glpi_plugins`; CREATE TABLE `glpi_plugins` ( `id` int(11) NOT NULL AUTO_INCREMENT, `directory` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `version` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `state` int(11) NOT NULL DEFAULT '0' COMMENT 'see define.php PLUGIN_* constant', `author` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `homepage` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `license` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`directory`), KEY `state` (`state`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_printermodels DROP TABLE IF EXISTS `glpi_printermodels`; CREATE TABLE `glpi_printermodels` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_printers DROP TABLE IF EXISTS `glpi_printers`; CREATE TABLE `glpi_printers` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `date_mod` datetime DEFAULT NULL, `contact` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `contact_num` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `users_id_tech` int(11) NOT NULL DEFAULT '0', `groups_id_tech` int(11) NOT NULL DEFAULT '0', `serial` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `otherserial` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `have_serial` tinyint(1) NOT NULL DEFAULT '0', `have_parallel` tinyint(1) NOT NULL DEFAULT '0', `have_usb` tinyint(1) NOT NULL DEFAULT '0', `have_wifi` tinyint(1) NOT NULL DEFAULT '0', `have_ethernet` tinyint(1) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, `memory_size` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `locations_id` int(11) NOT NULL DEFAULT '0', `domains_id` int(11) NOT NULL DEFAULT '0', `networks_id` int(11) NOT NULL DEFAULT '0', `printertypes_id` int(11) NOT NULL DEFAULT '0', `printermodels_id` int(11) NOT NULL DEFAULT '0', `manufacturers_id` int(11) NOT NULL DEFAULT '0', `is_global` tinyint(1) NOT NULL DEFAULT '0', `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `is_template` tinyint(1) NOT NULL DEFAULT '0', `template_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `init_pages_counter` int(11) NOT NULL DEFAULT '0', `last_pages_counter` int(11) NOT NULL DEFAULT '0', `notepad` longtext COLLATE utf8_unicode_ci, `users_id` int(11) NOT NULL DEFAULT '0', `groups_id` int(11) NOT NULL DEFAULT '0', `states_id` int(11) NOT NULL DEFAULT '0', `ticket_tco` decimal(20,4) DEFAULT '0.0000', `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `name` (`name`), KEY `is_template` (`is_template`), KEY `is_global` (`is_global`), KEY `domains_id` (`domains_id`), KEY `entities_id` (`entities_id`), KEY `manufacturers_id` (`manufacturers_id`), KEY `groups_id` (`groups_id`), KEY `users_id` (`users_id`), KEY `locations_id` (`locations_id`), KEY `printermodels_id` (`printermodels_id`), KEY `networks_id` (`networks_id`), KEY `states_id` (`states_id`), KEY `users_id_tech` (`users_id_tech`), KEY `printertypes_id` (`printertypes_id`), KEY `is_deleted` (`is_deleted`), KEY `date_mod` (`date_mod`), KEY `groups_id_tech` (`groups_id_tech`), KEY `last_pages_counter` (`last_pages_counter`), KEY `is_dynamic` (`is_dynamic`), KEY `serial` (`serial`), KEY `otherserial` (`otherserial`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_printertypes DROP TABLE IF EXISTS `glpi_printertypes`; CREATE TABLE `glpi_printertypes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_problems DROP TABLE IF EXISTS `glpi_problems`; CREATE TABLE `glpi_problems` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `status` int(11) NOT NULL DEFAULT '1', `content` longtext COLLATE utf8_unicode_ci, `date_mod` datetime DEFAULT NULL, `date` datetime DEFAULT NULL, `solvedate` datetime DEFAULT NULL, `closedate` datetime DEFAULT NULL, `due_date` datetime DEFAULT NULL, `users_id_recipient` int(11) NOT NULL DEFAULT '0', `users_id_lastupdater` int(11) NOT NULL DEFAULT '0', `urgency` int(11) NOT NULL DEFAULT '1', `impact` int(11) NOT NULL DEFAULT '1', `priority` int(11) NOT NULL DEFAULT '1', `itilcategories_id` int(11) NOT NULL DEFAULT '0', `impactcontent` longtext COLLATE utf8_unicode_ci, `causecontent` longtext COLLATE utf8_unicode_ci, `symptomcontent` longtext COLLATE utf8_unicode_ci, `solutiontypes_id` int(11) NOT NULL DEFAULT '0', `solution` text COLLATE utf8_unicode_ci, `actiontime` int(11) NOT NULL DEFAULT '0', `begin_waiting_date` datetime DEFAULT NULL, `waiting_duration` int(11) NOT NULL DEFAULT '0', `close_delay_stat` int(11) NOT NULL DEFAULT '0', `solve_delay_stat` int(11) NOT NULL DEFAULT '0', `notepad` longtext COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`), KEY `is_deleted` (`is_deleted`), KEY `date` (`date`), KEY `closedate` (`closedate`), KEY `status` (`status`), KEY `priority` (`priority`), KEY `date_mod` (`date_mod`), KEY `itilcategories_id` (`itilcategories_id`), KEY `users_id_recipient` (`users_id_recipient`), KEY `solvedate` (`solvedate`), KEY `solutiontypes_id` (`solutiontypes_id`), KEY `urgency` (`urgency`), KEY `impact` (`impact`), KEY `due_date` (`due_date`), KEY `users_id_lastupdater` (`users_id_lastupdater`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_problems_suppliers DROP TABLE IF EXISTS `glpi_problems_suppliers`; CREATE TABLE `glpi_problems_suppliers` ( `id` int(11) NOT NULL AUTO_INCREMENT, `problems_id` int(11) NOT NULL DEFAULT '0', `suppliers_id` int(11) NOT NULL DEFAULT '0', `type` int(11) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`problems_id`,`type`,`suppliers_id`), KEY `group` (`suppliers_id`,`type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_problems_tickets DROP TABLE IF EXISTS `glpi_problems_tickets`; CREATE TABLE `glpi_problems_tickets` ( `id` int(11) NOT NULL AUTO_INCREMENT, `problems_id` int(11) NOT NULL DEFAULT '0', `tickets_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`problems_id`,`tickets_id`), KEY `tickets_id` (`tickets_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_problems_users DROP TABLE IF EXISTS `glpi_problems_users`; CREATE TABLE `glpi_problems_users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `problems_id` int(11) NOT NULL DEFAULT '0', `users_id` int(11) NOT NULL DEFAULT '0', `type` int(11) NOT NULL DEFAULT '1', `use_notification` tinyint(1) NOT NULL DEFAULT '0', `alternative_email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`problems_id`,`type`,`users_id`,`alternative_email`), KEY `user` (`users_id`,`type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_problemtasks DROP TABLE IF EXISTS `glpi_problemtasks`; CREATE TABLE `glpi_problemtasks` ( `id` int(11) NOT NULL AUTO_INCREMENT, `problems_id` int(11) NOT NULL DEFAULT '0', `taskcategories_id` int(11) NOT NULL DEFAULT '0', `date` datetime DEFAULT NULL, `begin` datetime DEFAULT NULL, `end` datetime DEFAULT NULL, `users_id` int(11) NOT NULL DEFAULT '0', `users_id_tech` int(11) NOT NULL DEFAULT '0', `content` longtext COLLATE utf8_unicode_ci, `actiontime` int(11) NOT NULL DEFAULT '0', `state` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `problems_id` (`problems_id`), KEY `users_id` (`users_id`), KEY `users_id_tech` (`users_id_tech`), KEY `date` (`date`), KEY `begin` (`begin`), KEY `end` (`end`), KEY `state` (`state`), KEY `taskcategories_id` (`taskcategories_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_profiles DROP TABLE IF EXISTS `glpi_profiles`; CREATE TABLE `glpi_profiles` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `interface` varchar(255) COLLATE utf8_unicode_ci DEFAULT 'helpdesk', `is_default` tinyint(1) NOT NULL DEFAULT '0', `computer` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `monitor` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `software` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `networking` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `internet` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `printer` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `peripheral` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `cartridge` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `consumable` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `phone` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `notes` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `contact_enterprise` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `document` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `contract` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `infocom` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `knowbase` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `knowbase_admin` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `faq` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `reservation_helpdesk` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `reservation_central` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `reports` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `dropdown` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `entity_dropdown` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `device` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `typedoc` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `link` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `config` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `rule_ticket` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `entity_rule_ticket` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `rule_import` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `rule_ldap` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `rule_softwarecategories` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `search_config` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `search_config_global` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `check_update` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `profile` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `user` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `user_authtype` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `group` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `entity` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `transfer` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `logs` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `reminder_public` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `rssfeed_public` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `bookmark_public` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `backup` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `create_ticket` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `delete_ticket` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `add_followups` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `group_add_followups` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `global_add_followups` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `global_add_tasks` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `update_ticket` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `update_priority` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `own_ticket` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `steal_ticket` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `assign_ticket` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `show_all_ticket` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `show_assign_ticket` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `show_full_ticket` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `observe_ticket` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `update_followups` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `update_tasks` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `show_planning` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `show_group_planning` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `show_all_planning` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `statistic` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `password_update` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `helpdesk_hardware` int(11) NOT NULL DEFAULT '0', `helpdesk_item_type` text COLLATE utf8_unicode_ci, `ticket_status` text COLLATE utf8_unicode_ci COMMENT 'json encoded array of from/dest allowed status change', `show_group_ticket` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `show_group_hardware` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `rule_dictionnary_software` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `rule_dictionnary_dropdown` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `budget` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `import_externalauth_users` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `notification` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `rule_mailcollector` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `date_mod` datetime DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `validate_request` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `create_request_validation` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `calendar` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `sla` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `rule_dictionnary_printer` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `update_own_followups` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `delete_followups` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `entity_helpdesk` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `show_my_problem` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `show_all_problem` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `edit_all_problem` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `delete_problem` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `problem_status` text COLLATE utf8_unicode_ci COMMENT 'json encoded array of from/dest allowed status change', `create_ticket_on_login` tinyint(1) NOT NULL DEFAULT '0', `tickettemplate` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `ticketrecurrent` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `ticketcost` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `validate_incident` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `create_incident_validation` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `delete_validations` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `tickettemplates_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `interface` (`interface`), KEY `is_default` (`is_default`), KEY `date_mod` (`date_mod`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `glpi_profiles` VALUES ('1','Self-Service','helpdesk','1',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'r','1',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'r','r',NULL,NULL,'1',NULL,'1',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'1',NULL,NULL,NULL,NULL,NULL,NULL,'1','1','[\"Computer\",\"Monitor\",\"NetworkEquipment\",\"Peripheral\",\"Phone\",\"Printer\",\"Software\"]','[]','0','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'[]','0',NULL,NULL,'r',NULL,NULL,NULL,'0'); INSERT INTO `glpi_profiles` VALUES ('2','Observer','central','0','r','r','r','r','r','r','r','r','r','r','r','r','r','r','r','r',NULL,'r','1','r','r',NULL,NULL,NULL,'r','r',NULL,NULL,NULL,NULL,NULL,NULL,'w',NULL,'r',NULL,'r','r','r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'1','1','1','0','0','0','0','0','1','0','0','1','1','0','1','0','0','1','0','0','1','1','1','[\"Computer\",\"Monitor\",\"NetworkEquipment\",\"Peripheral\",\"Phone\",\"Printer\",\"Software\"]','[]','0','0',NULL,NULL,'r',NULL,NULL,NULL,NULL,NULL,'1','1',NULL,NULL,NULL,NULL,'0',NULL,'1','1',NULL,NULL,'[]','0',NULL,NULL,'r','1','1','1','0'); INSERT INTO `glpi_profiles` VALUES ('3','Admin','central','0','w','w','w','w','w','w','w','w','w','w','w','w','w','w','w','w',NULL,'w','1','w','r','w','w','w','w','w',NULL,NULL,NULL,NULL,NULL,NULL,'w','w','r','r','w','w','w',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','3','[\"Computer\",\"Monitor\",\"NetworkEquipment\",\"Peripheral\",\"Phone\",\"Printer\",\"Software\"]','[]','0','0',NULL,NULL,'w','w',NULL,NULL,NULL,NULL,'1','1','w',NULL,NULL,'1','1',NULL,'1','1','1','1','[]','0',NULL,NULL,'w','1','1','1','0'); INSERT INTO `glpi_profiles` VALUES ('4','Super-Admin','central','0','w','w','w','w','w','w','w','w','w','w','w','w','w','w','w','w','1','w','1','w','r','w','w','w','w','w','w','r','w','w','w','w','w','w','r','w','w','w','w','w','w','r','w','w','w','w','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','3','[\"Computer\",\"Monitor\",\"NetworkEquipment\",\"Peripheral\",\"Phone\",\"Printer\",\"Software\"]','[]','0','0','w','w','w','w','w','w',NULL,NULL,'1','1','w','w','w','1','1','w','1','1','1','1','[]','0','w','w','w','1','1','1','0'); INSERT INTO `glpi_profiles` VALUES ('5','Hotliner','central','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'1',NULL,'1',NULL,'1',NULL,'1',NULL,NULL,NULL,'1','1',NULL,'1','1',NULL,NULL,'1',NULL,NULL,'1','1','3','[\"Computer\",\"Monitor\",\"NetworkEquipment\",\"Peripheral\",\"Phone\",\"Printer\",\"Software\"]','[]',NULL,NULL,NULL,NULL,NULL,'w',NULL,NULL,NULL,NULL,NULL,'1',NULL,NULL,NULL,'1',NULL,NULL,NULL,'1',NULL,NULL,'[]','1','r',NULL,'w',NULL,'1',NULL,'0'); INSERT INTO `glpi_profiles` VALUES ('6','Technician','central','0','w','w','w','w','w','w','w','w','w','w','w',NULL,'w',NULL,NULL,'w',NULL,'w','1','w','r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'w',NULL,'r','r','r',NULL,'w','w',NULL,NULL,'1',NULL,'1',NULL,'1','1','1',NULL,'1',NULL,NULL,'1','1','1','1','1','1','1',NULL,NULL,'1','1','3','[\"Computer\",\"Monitor\",\"NetworkEquipment\",\"Peripheral\",\"Phone\",\"Printer\",\"Software\"]','[]',NULL,NULL,NULL,NULL,NULL,'w',NULL,NULL,NULL,NULL,NULL,'1',NULL,'r',NULL,'1',NULL,NULL,'1','1',NULL,NULL,'[]','0','r','r','w',NULL,'1',NULL,'0'); INSERT INTO `glpi_profiles` VALUES ('7','Supervisor','central','0','w','w','w','w','w','w','w','w','w','w','w',NULL,'w',NULL,NULL,'w',NULL,'w','1','w','r',NULL,'w',NULL,NULL,NULL,NULL,'r','w',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'w',NULL,'r','r','r','r','w','w',NULL,NULL,'1','1','1',NULL,'1','1','1','1','1','1','1','1','1','1','1','1','1','1',NULL,'1','1','1','3','[\"Computer\",\"Monitor\",\"NetworkEquipment\",\"Peripheral\",\"Phone\",\"Printer\",\"Software\"]','[]',NULL,NULL,NULL,NULL,NULL,'w',NULL,'w',NULL,NULL,'1','1','w','w',NULL,'1','1',NULL,'1','1','1','1','[]','0','w','w','w','1','1','1','0'); ### Dump table glpi_profiles_reminders DROP TABLE IF EXISTS `glpi_profiles_reminders`; CREATE TABLE `glpi_profiles_reminders` ( `id` int(11) NOT NULL AUTO_INCREMENT, `reminders_id` int(11) NOT NULL DEFAULT '0', `profiles_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '-1', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `reminders_id` (`reminders_id`), KEY `profiles_id` (`profiles_id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_profiles_rssfeeds DROP TABLE IF EXISTS `glpi_profiles_rssfeeds`; CREATE TABLE `glpi_profiles_rssfeeds` ( `id` int(11) NOT NULL AUTO_INCREMENT, `rssfeeds_id` int(11) NOT NULL DEFAULT '0', `profiles_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '-1', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `rssfeeds_id` (`rssfeeds_id`), KEY `profiles_id` (`profiles_id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_profiles_users DROP TABLE IF EXISTS `glpi_profiles_users`; CREATE TABLE `glpi_profiles_users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `users_id` int(11) NOT NULL DEFAULT '0', `profiles_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '1', `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `entities_id` (`entities_id`), KEY `profiles_id` (`profiles_id`), KEY `users_id` (`users_id`), KEY `is_recursive` (`is_recursive`), KEY `is_dynamic` (`is_dynamic`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `glpi_profiles_users` VALUES ('2','2','4','0','1','0'); INSERT INTO `glpi_profiles_users` VALUES ('3','3','1','0','1','0'); INSERT INTO `glpi_profiles_users` VALUES ('4','4','6','0','1','0'); INSERT INTO `glpi_profiles_users` VALUES ('5','5','2','0','1','0'); ### Dump table glpi_reminders DROP TABLE IF EXISTS `glpi_reminders`; CREATE TABLE `glpi_reminders` ( `id` int(11) NOT NULL AUTO_INCREMENT, `date` datetime DEFAULT NULL, `users_id` int(11) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `text` text COLLATE utf8_unicode_ci, `begin` datetime DEFAULT NULL, `end` datetime DEFAULT NULL, `is_planned` tinyint(1) NOT NULL DEFAULT '0', `date_mod` datetime DEFAULT NULL, `state` int(11) NOT NULL DEFAULT '0', `begin_view_date` datetime DEFAULT NULL, `end_view_date` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `date` (`date`), KEY `begin` (`begin`), KEY `end` (`end`), KEY `users_id` (`users_id`), KEY `is_planned` (`is_planned`), KEY `state` (`state`), KEY `date_mod` (`date_mod`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_reminders_users DROP TABLE IF EXISTS `glpi_reminders_users`; CREATE TABLE `glpi_reminders_users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `reminders_id` int(11) NOT NULL DEFAULT '0', `users_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `reminders_id` (`reminders_id`), KEY `users_id` (`users_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_requesttypes DROP TABLE IF EXISTS `glpi_requesttypes`; CREATE TABLE `glpi_requesttypes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `is_helpdesk_default` tinyint(1) NOT NULL DEFAULT '0', `is_mail_default` tinyint(1) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`), KEY `is_helpdesk_default` (`is_helpdesk_default`), KEY `is_mail_default` (`is_mail_default`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `glpi_requesttypes` VALUES ('1','Helpdesk','1','0',NULL); INSERT INTO `glpi_requesttypes` VALUES ('2','E-Mail','0','1',NULL); INSERT INTO `glpi_requesttypes` VALUES ('3','Phone','0','0',NULL); INSERT INTO `glpi_requesttypes` VALUES ('4','Direct','0','0',NULL); INSERT INTO `glpi_requesttypes` VALUES ('5','Written','0','0',NULL); INSERT INTO `glpi_requesttypes` VALUES ('6','Other','0','0',NULL); ### Dump table glpi_reservationitems DROP TABLE IF EXISTS `glpi_reservationitems`; CREATE TABLE `glpi_reservationitems` ( `id` int(11) NOT NULL AUTO_INCREMENT, `itemtype` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `items_id` int(11) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, `is_active` tinyint(1) NOT NULL DEFAULT '1', `is_deleted` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `is_active` (`is_active`), KEY `item` (`itemtype`,`items_id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`), KEY `is_deleted` (`is_deleted`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_reservations DROP TABLE IF EXISTS `glpi_reservations`; CREATE TABLE `glpi_reservations` ( `id` int(11) NOT NULL AUTO_INCREMENT, `reservationitems_id` int(11) NOT NULL DEFAULT '0', `begin` datetime DEFAULT NULL, `end` datetime DEFAULT NULL, `users_id` int(11) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, `group` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `begin` (`begin`), KEY `end` (`end`), KEY `reservationitems_id` (`reservationitems_id`), KEY `users_id` (`users_id`), KEY `resagroup` (`reservationitems_id`,`group`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_rssfeeds DROP TABLE IF EXISTS `glpi_rssfeeds`; CREATE TABLE `glpi_rssfeeds` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `users_id` int(11) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, `url` text COLLATE utf8_unicode_ci, `refresh_rate` int(11) NOT NULL DEFAULT '86400', `max_items` int(11) NOT NULL DEFAULT '20', `have_error` tinyint(1) NOT NULL DEFAULT '0', `is_active` tinyint(1) NOT NULL DEFAULT '0', `date_mod` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `name` (`name`), KEY `users_id` (`users_id`), KEY `date_mod` (`date_mod`), KEY `have_error` (`have_error`), KEY `is_active` (`is_active`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_rssfeeds_users DROP TABLE IF EXISTS `glpi_rssfeeds_users`; CREATE TABLE `glpi_rssfeeds_users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `rssfeeds_id` int(11) NOT NULL DEFAULT '0', `users_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `rssfeeds_id` (`rssfeeds_id`), KEY `users_id` (`users_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_ruleactions DROP TABLE IF EXISTS `glpi_ruleactions`; CREATE TABLE `glpi_ruleactions` ( `id` int(11) NOT NULL AUTO_INCREMENT, `rules_id` int(11) NOT NULL DEFAULT '0', `action_type` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'VALUE IN (assign, regex_result, append_regex_result, affectbyip, affectbyfqdn, affectbymac)', `field` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `rules_id` (`rules_id`), KEY `field_value` (`field`(50),`value`(50)) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `glpi_ruleactions` VALUES ('6','6','fromitem','locations_id','1'); INSERT INTO `glpi_ruleactions` VALUES ('2','2','assign','entities_id','0'); INSERT INTO `glpi_ruleactions` VALUES ('3','3','assign','entities_id','0'); INSERT INTO `glpi_ruleactions` VALUES ('4','4','assign','_refuse_email_no_response','1'); INSERT INTO `glpi_ruleactions` VALUES ('5','5','assign','_refuse_email_no_response','1'); INSERT INTO `glpi_ruleactions` VALUES ('7','7','fromuser','locations_id','1'); ### Dump table glpi_rulecachecomputermodels DROP TABLE IF EXISTS `glpi_rulecachecomputermodels`; CREATE TABLE `glpi_rulecachecomputermodels` ( `id` int(11) NOT NULL AUTO_INCREMENT, `old_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `rules_id` int(11) NOT NULL DEFAULT '0', `new_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `manufacturer` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `old_value` (`old_value`), KEY `rules_id` (`rules_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_rulecachecomputertypes DROP TABLE IF EXISTS `glpi_rulecachecomputertypes`; CREATE TABLE `glpi_rulecachecomputertypes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `old_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `rules_id` int(11) NOT NULL DEFAULT '0', `new_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `old_value` (`old_value`), KEY `rules_id` (`rules_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_rulecachemanufacturers DROP TABLE IF EXISTS `glpi_rulecachemanufacturers`; CREATE TABLE `glpi_rulecachemanufacturers` ( `id` int(11) NOT NULL AUTO_INCREMENT, `old_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `rules_id` int(11) NOT NULL DEFAULT '0', `new_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `old_value` (`old_value`), KEY `rules_id` (`rules_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_rulecachemonitormodels DROP TABLE IF EXISTS `glpi_rulecachemonitormodels`; CREATE TABLE `glpi_rulecachemonitormodels` ( `id` int(11) NOT NULL AUTO_INCREMENT, `old_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `rules_id` int(11) NOT NULL DEFAULT '0', `new_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `manufacturer` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `old_value` (`old_value`), KEY `rules_id` (`rules_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_rulecachemonitortypes DROP TABLE IF EXISTS `glpi_rulecachemonitortypes`; CREATE TABLE `glpi_rulecachemonitortypes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `old_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `rules_id` int(11) NOT NULL DEFAULT '0', `new_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `old_value` (`old_value`), KEY `rules_id` (`rules_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_rulecachenetworkequipmentmodels DROP TABLE IF EXISTS `glpi_rulecachenetworkequipmentmodels`; CREATE TABLE `glpi_rulecachenetworkequipmentmodels` ( `id` int(11) NOT NULL AUTO_INCREMENT, `old_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `rules_id` int(11) NOT NULL DEFAULT '0', `new_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `manufacturer` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `old_value` (`old_value`), KEY `rules_id` (`rules_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_rulecachenetworkequipmenttypes DROP TABLE IF EXISTS `glpi_rulecachenetworkequipmenttypes`; CREATE TABLE `glpi_rulecachenetworkequipmenttypes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `old_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `rules_id` int(11) NOT NULL DEFAULT '0', `new_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `old_value` (`old_value`), KEY `rules_id` (`rules_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_rulecacheoperatingsystems DROP TABLE IF EXISTS `glpi_rulecacheoperatingsystems`; CREATE TABLE `glpi_rulecacheoperatingsystems` ( `id` int(11) NOT NULL AUTO_INCREMENT, `old_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `rules_id` int(11) NOT NULL DEFAULT '0', `new_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `old_value` (`old_value`), KEY `rules_id` (`rules_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_rulecacheoperatingsystemservicepacks DROP TABLE IF EXISTS `glpi_rulecacheoperatingsystemservicepacks`; CREATE TABLE `glpi_rulecacheoperatingsystemservicepacks` ( `id` int(11) NOT NULL AUTO_INCREMENT, `old_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `rules_id` int(11) NOT NULL DEFAULT '0', `new_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `old_value` (`old_value`), KEY `rules_id` (`rules_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_rulecacheoperatingsystemversions DROP TABLE IF EXISTS `glpi_rulecacheoperatingsystemversions`; CREATE TABLE `glpi_rulecacheoperatingsystemversions` ( `id` int(11) NOT NULL AUTO_INCREMENT, `old_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `rules_id` int(11) NOT NULL DEFAULT '0', `new_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `old_value` (`old_value`), KEY `rules_id` (`rules_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_rulecacheperipheralmodels DROP TABLE IF EXISTS `glpi_rulecacheperipheralmodels`; CREATE TABLE `glpi_rulecacheperipheralmodels` ( `id` int(11) NOT NULL AUTO_INCREMENT, `old_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `rules_id` int(11) NOT NULL DEFAULT '0', `new_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `manufacturer` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `old_value` (`old_value`), KEY `rules_id` (`rules_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_rulecacheperipheraltypes DROP TABLE IF EXISTS `glpi_rulecacheperipheraltypes`; CREATE TABLE `glpi_rulecacheperipheraltypes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `old_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `rules_id` int(11) NOT NULL DEFAULT '0', `new_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `old_value` (`old_value`), KEY `rules_id` (`rules_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_rulecachephonemodels DROP TABLE IF EXISTS `glpi_rulecachephonemodels`; CREATE TABLE `glpi_rulecachephonemodels` ( `id` int(11) NOT NULL AUTO_INCREMENT, `old_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `rules_id` int(11) NOT NULL DEFAULT '0', `new_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `manufacturer` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `old_value` (`old_value`), KEY `rules_id` (`rules_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_rulecachephonetypes DROP TABLE IF EXISTS `glpi_rulecachephonetypes`; CREATE TABLE `glpi_rulecachephonetypes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `old_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `rules_id` int(11) NOT NULL DEFAULT '0', `new_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `old_value` (`old_value`), KEY `rules_id` (`rules_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_rulecacheprintermodels DROP TABLE IF EXISTS `glpi_rulecacheprintermodels`; CREATE TABLE `glpi_rulecacheprintermodels` ( `id` int(11) NOT NULL AUTO_INCREMENT, `old_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `rules_id` int(11) NOT NULL DEFAULT '0', `new_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `manufacturer` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `old_value` (`old_value`), KEY `rules_id` (`rules_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_rulecacheprinters DROP TABLE IF EXISTS `glpi_rulecacheprinters`; CREATE TABLE `glpi_rulecacheprinters` ( `id` int(11) NOT NULL AUTO_INCREMENT, `old_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `manufacturer` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `rules_id` int(11) NOT NULL DEFAULT '0', `new_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `new_manufacturer` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `ignore_import` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `is_global` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `old_value` (`old_value`), KEY `rules_id` (`rules_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_rulecacheprintertypes DROP TABLE IF EXISTS `glpi_rulecacheprintertypes`; CREATE TABLE `glpi_rulecacheprintertypes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `old_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `rules_id` int(11) NOT NULL DEFAULT '0', `new_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `old_value` (`old_value`), KEY `rules_id` (`rules_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_rulecachesoftwares DROP TABLE IF EXISTS `glpi_rulecachesoftwares`; CREATE TABLE `glpi_rulecachesoftwares` ( `id` int(11) NOT NULL AUTO_INCREMENT, `old_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `manufacturer` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `rules_id` int(11) NOT NULL DEFAULT '0', `new_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `version` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `new_manufacturer` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `ignore_import` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `is_helpdesk_visible` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `entities_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `new_entities_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `old_value` (`old_value`), KEY `rules_id` (`rules_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_rulecriterias DROP TABLE IF EXISTS `glpi_rulecriterias`; CREATE TABLE `glpi_rulecriterias` ( `id` int(11) NOT NULL AUTO_INCREMENT, `rules_id` int(11) NOT NULL DEFAULT '0', `criteria` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `condition` int(11) NOT NULL DEFAULT '0' COMMENT 'see define.php PATTERN_* and REGEX_* constant', `pattern` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `rules_id` (`rules_id`), KEY `condition` (`condition`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `glpi_rulecriterias` VALUES ('9','6','locations_id','9','1'); INSERT INTO `glpi_rulecriterias` VALUES ('2','2','uid','0','*'); INSERT INTO `glpi_rulecriterias` VALUES ('3','2','samaccountname','0','*'); INSERT INTO `glpi_rulecriterias` VALUES ('4','2','MAIL_EMAIL','0','*'); INSERT INTO `glpi_rulecriterias` VALUES ('5','3','subject','6','/.*/'); INSERT INTO `glpi_rulecriterias` VALUES ('6','4','x-auto-response-suppress','6','/\\S+/'); INSERT INTO `glpi_rulecriterias` VALUES ('7','5','auto-submitted','6','/\\S+/'); INSERT INTO `glpi_rulecriterias` VALUES ('8','5','auto-submitted','1','no'); INSERT INTO `glpi_rulecriterias` VALUES ('10','6','items_locations','8','1'); INSERT INTO `glpi_rulecriterias` VALUES ('11','7','locations_id','9','1'); INSERT INTO `glpi_rulecriterias` VALUES ('12','7','users_locations','8','1'); ### Dump table glpi_rulerightparameters DROP TABLE IF EXISTS `glpi_rulerightparameters`; CREATE TABLE `glpi_rulerightparameters` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `glpi_rulerightparameters` VALUES ('1','(LDAP)Organization','o',''); INSERT INTO `glpi_rulerightparameters` VALUES ('2','(LDAP)Common Name','cn',''); INSERT INTO `glpi_rulerightparameters` VALUES ('3','(LDAP)Department Number','departmentnumber',''); INSERT INTO `glpi_rulerightparameters` VALUES ('4','(LDAP)Email','mail',''); INSERT INTO `glpi_rulerightparameters` VALUES ('5','Object Class','objectclass',''); INSERT INTO `glpi_rulerightparameters` VALUES ('6','(LDAP)User ID','uid',''); INSERT INTO `glpi_rulerightparameters` VALUES ('7','(LDAP)Telephone Number','phone',''); INSERT INTO `glpi_rulerightparameters` VALUES ('8','(LDAP)Employee Number','employeenumber',''); INSERT INTO `glpi_rulerightparameters` VALUES ('9','(LDAP)Manager','manager',''); INSERT INTO `glpi_rulerightparameters` VALUES ('10','(LDAP)DistinguishedName','dn',''); INSERT INTO `glpi_rulerightparameters` VALUES ('12','(AD)User ID','samaccountname',''); INSERT INTO `glpi_rulerightparameters` VALUES ('13','(LDAP) Title','title',''); INSERT INTO `glpi_rulerightparameters` VALUES ('14','(LDAP) MemberOf','memberof',''); ### Dump table glpi_rules DROP TABLE IF EXISTS `glpi_rules`; CREATE TABLE `glpi_rules` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `sub_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `ranking` int(11) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `description` text COLLATE utf8_unicode_ci, `match` char(10) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'see define.php *_MATCHING constant', `is_active` tinyint(1) NOT NULL DEFAULT '1', `comment` text COLLATE utf8_unicode_ci, `date_mod` datetime DEFAULT NULL, `is_recursive` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `entities_id` (`entities_id`), KEY `is_active` (`is_active`), KEY `sub_type` (`sub_type`), KEY `date_mod` (`date_mod`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `glpi_rules` VALUES ('2','0','RuleRight','1','Root','','OR','1',NULL,NULL,'0'); INSERT INTO `glpi_rules` VALUES ('3','0','RuleMailCollector','3','Root','','OR','1',NULL,NULL,'0'); INSERT INTO `glpi_rules` VALUES ('4','0','RuleMailCollector','1','Auto-Reply X-Auto-Response-Suppress','Exclude Auto-Reply emails using X-Auto-Response-Suppress header','AND','1',NULL,'2011-01-18 11:40:42','1'); INSERT INTO `glpi_rules` VALUES ('5','0','RuleMailCollector','2','Auto-Reply Auto-Submitted','Exclude Auto-Reply emails using Auto-Submitted header','AND','1',NULL,'2011-01-18 11:40:42','1'); INSERT INTO `glpi_rules` VALUES ('6','0','RuleTicket','1','Ticket location from item','','AND','0','Généré automatiquement par GLPI 0.84',NULL,'1'); INSERT INTO `glpi_rules` VALUES ('7','0','RuleTicket','2','Ticket location from user','','AND','0','Généré automatiquement par GLPI 0.84',NULL,'1'); ### Dump table glpi_slalevelactions DROP TABLE IF EXISTS `glpi_slalevelactions`; CREATE TABLE `glpi_slalevelactions` ( `id` int(11) NOT NULL AUTO_INCREMENT, `slalevels_id` int(11) NOT NULL DEFAULT '0', `action_type` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `field` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `slalevels_id` (`slalevels_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_slalevelcriterias DROP TABLE IF EXISTS `glpi_slalevelcriterias`; CREATE TABLE `glpi_slalevelcriterias` ( `id` int(11) NOT NULL AUTO_INCREMENT, `slalevels_id` int(11) NOT NULL DEFAULT '0', `criteria` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `condition` int(11) NOT NULL DEFAULT '0' COMMENT 'see define.php PATTERN_* and REGEX_* constant', `pattern` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `slalevels_id` (`slalevels_id`), KEY `condition` (`condition`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_slalevels DROP TABLE IF EXISTS `glpi_slalevels`; CREATE TABLE `glpi_slalevels` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `slas_id` int(11) NOT NULL DEFAULT '0', `execution_time` int(11) NOT NULL, `is_active` tinyint(1) NOT NULL DEFAULT '1', `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `match` char(10) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'see define.php *_MATCHING constant', PRIMARY KEY (`id`), KEY `name` (`name`), KEY `is_active` (`is_active`), KEY `slas_id` (`slas_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_slalevels_tickets DROP TABLE IF EXISTS `glpi_slalevels_tickets`; CREATE TABLE `glpi_slalevels_tickets` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tickets_id` int(11) NOT NULL DEFAULT '0', `slalevels_id` int(11) NOT NULL DEFAULT '0', `date` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `tickets_id` (`tickets_id`), KEY `slalevels_id` (`slalevels_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_slas DROP TABLE IF EXISTS `glpi_slas`; CREATE TABLE `glpi_slas` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, `resolution_time` int(11) NOT NULL, `calendars_id` int(11) NOT NULL DEFAULT '0', `date_mod` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `name` (`name`), KEY `calendars_id` (`calendars_id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`), KEY `date_mod` (`date_mod`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_softwarecategories DROP TABLE IF EXISTS `glpi_softwarecategories`; CREATE TABLE `glpi_softwarecategories` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `glpi_softwarecategories` VALUES ('1','FUSION',NULL); ### Dump table glpi_softwarelicenses DROP TABLE IF EXISTS `glpi_softwarelicenses`; CREATE TABLE `glpi_softwarelicenses` ( `id` int(11) NOT NULL AUTO_INCREMENT, `softwares_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `number` int(11) NOT NULL DEFAULT '0', `softwarelicensetypes_id` int(11) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `serial` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `otherserial` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `softwareversions_id_buy` int(11) NOT NULL DEFAULT '0', `softwareversions_id_use` int(11) NOT NULL DEFAULT '0', `expire` date DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `date_mod` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `name` (`name`), KEY `serial` (`serial`), KEY `otherserial` (`otherserial`), KEY `expire` (`expire`), KEY `softwareversions_id_buy` (`softwareversions_id_buy`), KEY `entities_id` (`entities_id`), KEY `softwarelicensetypes_id` (`softwarelicensetypes_id`), KEY `softwareversions_id_use` (`softwareversions_id_use`), KEY `date_mod` (`date_mod`), KEY `softwares_id_expire` (`softwares_id`,`expire`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_softwarelicensetypes DROP TABLE IF EXISTS `glpi_softwarelicensetypes`; CREATE TABLE `glpi_softwarelicensetypes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `glpi_softwarelicensetypes` VALUES ('1','OEM',''); ### Dump table glpi_softwares DROP TABLE IF EXISTS `glpi_softwares`; CREATE TABLE `glpi_softwares` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `locations_id` int(11) NOT NULL DEFAULT '0', `users_id_tech` int(11) NOT NULL DEFAULT '0', `groups_id_tech` int(11) NOT NULL DEFAULT '0', `is_update` tinyint(1) NOT NULL DEFAULT '0', `softwares_id` int(11) NOT NULL DEFAULT '0', `manufacturers_id` int(11) NOT NULL DEFAULT '0', `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `is_template` tinyint(1) NOT NULL DEFAULT '0', `template_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `date_mod` datetime DEFAULT NULL, `notepad` longtext COLLATE utf8_unicode_ci, `users_id` int(11) NOT NULL DEFAULT '0', `groups_id` int(11) NOT NULL DEFAULT '0', `ticket_tco` decimal(20,4) DEFAULT '0.0000', `is_helpdesk_visible` tinyint(1) NOT NULL DEFAULT '1', `softwarecategories_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `date_mod` (`date_mod`), KEY `name` (`name`), KEY `is_template` (`is_template`), KEY `is_update` (`is_update`), KEY `softwarecategories_id` (`softwarecategories_id`), KEY `entities_id` (`entities_id`), KEY `manufacturers_id` (`manufacturers_id`), KEY `groups_id` (`groups_id`), KEY `users_id` (`users_id`), KEY `locations_id` (`locations_id`), KEY `users_id_tech` (`users_id_tech`), KEY `softwares_id` (`softwares_id`), KEY `is_deleted` (`is_deleted`), KEY `is_helpdesk_visible` (`is_helpdesk_visible`), KEY `groups_id_tech` (`groups_id_tech`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_softwareversions DROP TABLE IF EXISTS `glpi_softwareversions`; CREATE TABLE `glpi_softwareversions` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `softwares_id` int(11) NOT NULL DEFAULT '0', `states_id` int(11) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `operatingsystems_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `name` (`name`), KEY `softwares_id` (`softwares_id`), KEY `states_id` (`states_id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`), KEY `operatingsystems_id` (`operatingsystems_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_solutiontemplates DROP TABLE IF EXISTS `glpi_solutiontemplates`; CREATE TABLE `glpi_solutiontemplates` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `content` text COLLATE utf8_unicode_ci, `solutiontypes_id` int(11) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`), KEY `is_recursive` (`is_recursive`), KEY `solutiontypes_id` (`solutiontypes_id`), KEY `entities_id` (`entities_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_solutiontypes DROP TABLE IF EXISTS `glpi_solutiontypes`; CREATE TABLE `glpi_solutiontypes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), KEY `name` (`name`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_ssovariables DROP TABLE IF EXISTS `glpi_ssovariables`; CREATE TABLE `glpi_ssovariables` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `glpi_ssovariables` VALUES ('1','HTTP_AUTH_USER',''); INSERT INTO `glpi_ssovariables` VALUES ('2','REMOTE_USER',''); INSERT INTO `glpi_ssovariables` VALUES ('3','PHP_AUTH_USER',''); INSERT INTO `glpi_ssovariables` VALUES ('4','USERNAME',''); INSERT INTO `glpi_ssovariables` VALUES ('5','REDIRECT_REMOTE_USER',''); INSERT INTO `glpi_ssovariables` VALUES ('6','HTTP_REMOTE_USER',''); ### Dump table glpi_states DROP TABLE IF EXISTS `glpi_states`; CREATE TABLE `glpi_states` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `states_id` int(11) NOT NULL DEFAULT '0', `completename` text COLLATE utf8_unicode_ci, `level` int(11) NOT NULL DEFAULT '0', `ancestors_cache` longtext COLLATE utf8_unicode_ci, `sons_cache` longtext COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`), KEY `unicity` (`states_id`,`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_suppliers DROP TABLE IF EXISTS `glpi_suppliers`; CREATE TABLE `glpi_suppliers` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `suppliertypes_id` int(11) NOT NULL DEFAULT '0', `address` text COLLATE utf8_unicode_ci, `postcode` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `town` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `state` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `country` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `website` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `phonenumber` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `fax` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `notepad` longtext COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`), KEY `entities_id` (`entities_id`), KEY `suppliertypes_id` (`suppliertypes_id`), KEY `is_deleted` (`is_deleted`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_suppliers_tickets DROP TABLE IF EXISTS `glpi_suppliers_tickets`; CREATE TABLE `glpi_suppliers_tickets` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tickets_id` int(11) NOT NULL DEFAULT '0', `suppliers_id` int(11) NOT NULL DEFAULT '0', `type` int(11) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`tickets_id`,`type`,`suppliers_id`), KEY `group` (`suppliers_id`,`type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_suppliertypes DROP TABLE IF EXISTS `glpi_suppliertypes`; CREATE TABLE `glpi_suppliertypes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_taskcategories DROP TABLE IF EXISTS `glpi_taskcategories`; CREATE TABLE `glpi_taskcategories` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `taskcategories_id` int(11) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `completename` text COLLATE utf8_unicode_ci, `comment` text COLLATE utf8_unicode_ci, `level` int(11) NOT NULL DEFAULT '0', `ancestors_cache` longtext COLLATE utf8_unicode_ci, `sons_cache` longtext COLLATE utf8_unicode_ci, `is_helpdeskvisible` tinyint(1) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), KEY `name` (`name`), KEY `taskcategories_id` (`taskcategories_id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`), KEY `is_helpdeskvisible` (`is_helpdeskvisible`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_ticketcosts DROP TABLE IF EXISTS `glpi_ticketcosts`; CREATE TABLE `glpi_ticketcosts` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tickets_id` int(11) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `begin_date` date DEFAULT NULL, `end_date` date DEFAULT NULL, `actiontime` int(11) NOT NULL DEFAULT '0', `cost_time` decimal(20,4) NOT NULL DEFAULT '0.0000', `cost_fixed` decimal(20,4) NOT NULL DEFAULT '0.0000', `cost_material` decimal(20,4) NOT NULL DEFAULT '0.0000', `budgets_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `name` (`name`), KEY `tickets_id` (`tickets_id`), KEY `begin_date` (`begin_date`), KEY `end_date` (`end_date`), KEY `entities_id` (`entities_id`), KEY `budgets_id` (`budgets_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_ticketfollowups DROP TABLE IF EXISTS `glpi_ticketfollowups`; CREATE TABLE `glpi_ticketfollowups` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tickets_id` int(11) NOT NULL DEFAULT '0', `date` datetime DEFAULT NULL, `users_id` int(11) NOT NULL DEFAULT '0', `content` longtext COLLATE utf8_unicode_ci, `is_private` tinyint(1) NOT NULL DEFAULT '0', `requesttypes_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `date` (`date`), KEY `users_id` (`users_id`), KEY `tickets_id` (`tickets_id`), KEY `is_private` (`is_private`), KEY `requesttypes_id` (`requesttypes_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_ticketrecurrents DROP TABLE IF EXISTS `glpi_ticketrecurrents`; CREATE TABLE `glpi_ticketrecurrents` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `is_active` tinyint(1) NOT NULL DEFAULT '0', `tickettemplates_id` int(11) NOT NULL DEFAULT '0', `begin_date` datetime DEFAULT NULL, `periodicity` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `create_before` int(11) NOT NULL DEFAULT '0', `next_creation_date` datetime DEFAULT NULL, `calendars_id` int(11) NOT NULL DEFAULT '0', `end_date` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`), KEY `is_active` (`is_active`), KEY `tickettemplates_id` (`tickettemplates_id`), KEY `next_creation_date` (`next_creation_date`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_tickets DROP TABLE IF EXISTS `glpi_tickets`; CREATE TABLE `glpi_tickets` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `date` datetime DEFAULT NULL, `closedate` datetime DEFAULT NULL, `solvedate` datetime DEFAULT NULL, `date_mod` datetime DEFAULT NULL, `users_id_lastupdater` int(11) NOT NULL DEFAULT '0', `status` int(11) NOT NULL DEFAULT '1', `users_id_recipient` int(11) NOT NULL DEFAULT '0', `requesttypes_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `items_id` int(11) NOT NULL DEFAULT '0', `content` longtext COLLATE utf8_unicode_ci, `urgency` int(11) NOT NULL DEFAULT '1', `impact` int(11) NOT NULL DEFAULT '1', `priority` int(11) NOT NULL DEFAULT '1', `itilcategories_id` int(11) NOT NULL DEFAULT '0', `type` int(11) NOT NULL DEFAULT '1', `solutiontypes_id` int(11) NOT NULL DEFAULT '0', `solution` text COLLATE utf8_unicode_ci, `global_validation` varchar(255) COLLATE utf8_unicode_ci DEFAULT 'none', `slas_id` int(11) NOT NULL DEFAULT '0', `slalevels_id` int(11) NOT NULL DEFAULT '0', `due_date` datetime DEFAULT NULL, `begin_waiting_date` datetime DEFAULT NULL, `sla_waiting_duration` int(11) NOT NULL DEFAULT '0', `waiting_duration` int(11) NOT NULL DEFAULT '0', `close_delay_stat` int(11) NOT NULL DEFAULT '0', `solve_delay_stat` int(11) NOT NULL DEFAULT '0', `takeintoaccount_delay_stat` int(11) NOT NULL DEFAULT '0', `actiontime` int(11) NOT NULL DEFAULT '0', `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `locations_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `date` (`date`), KEY `closedate` (`closedate`), KEY `status` (`status`), KEY `priority` (`priority`), KEY `request_type` (`requesttypes_id`), KEY `date_mod` (`date_mod`), KEY `entities_id` (`entities_id`), KEY `users_id_recipient` (`users_id_recipient`), KEY `item` (`itemtype`,`items_id`), KEY `solvedate` (`solvedate`), KEY `urgency` (`urgency`), KEY `impact` (`impact`), KEY `global_validation` (`global_validation`), KEY `slas_id` (`slas_id`), KEY `slalevels_id` (`slalevels_id`), KEY `due_date` (`due_date`), KEY `users_id_lastupdater` (`users_id_lastupdater`), KEY `type` (`type`), KEY `solutiontypes_id` (`solutiontypes_id`), KEY `itilcategories_id` (`itilcategories_id`), KEY `is_deleted` (`is_deleted`), KEY `name` (`name`), KEY `locations_id` (`locations_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_tickets_tickets DROP TABLE IF EXISTS `glpi_tickets_tickets`; CREATE TABLE `glpi_tickets_tickets` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tickets_id_1` int(11) NOT NULL DEFAULT '0', `tickets_id_2` int(11) NOT NULL DEFAULT '0', `link` int(11) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), KEY `unicity` (`tickets_id_1`,`tickets_id_2`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_tickets_users DROP TABLE IF EXISTS `glpi_tickets_users`; CREATE TABLE `glpi_tickets_users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tickets_id` int(11) NOT NULL DEFAULT '0', `users_id` int(11) NOT NULL DEFAULT '0', `type` int(11) NOT NULL DEFAULT '1', `use_notification` tinyint(1) NOT NULL DEFAULT '1', `alternative_email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`tickets_id`,`type`,`users_id`,`alternative_email`), KEY `user` (`users_id`,`type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_ticketsatisfactions DROP TABLE IF EXISTS `glpi_ticketsatisfactions`; CREATE TABLE `glpi_ticketsatisfactions` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tickets_id` int(11) NOT NULL DEFAULT '0', `type` int(11) NOT NULL DEFAULT '1', `date_begin` datetime DEFAULT NULL, `date_answered` datetime DEFAULT NULL, `satisfaction` int(11) DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), UNIQUE KEY `tickets_id` (`tickets_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_tickettasks DROP TABLE IF EXISTS `glpi_tickettasks`; CREATE TABLE `glpi_tickettasks` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tickets_id` int(11) NOT NULL DEFAULT '0', `taskcategories_id` int(11) NOT NULL DEFAULT '0', `date` datetime DEFAULT NULL, `users_id` int(11) NOT NULL DEFAULT '0', `content` longtext COLLATE utf8_unicode_ci, `is_private` tinyint(1) NOT NULL DEFAULT '0', `actiontime` int(11) NOT NULL DEFAULT '0', `begin` datetime DEFAULT NULL, `end` datetime DEFAULT NULL, `state` int(11) NOT NULL DEFAULT '1', `users_id_tech` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `date` (`date`), KEY `users_id` (`users_id`), KEY `tickets_id` (`tickets_id`), KEY `is_private` (`is_private`), KEY `taskcategories_id` (`taskcategories_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_tickettemplatehiddenfields DROP TABLE IF EXISTS `glpi_tickettemplatehiddenfields`; CREATE TABLE `glpi_tickettemplatehiddenfields` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tickettemplates_id` int(11) NOT NULL DEFAULT '0', `num` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `unicity` (`tickettemplates_id`,`num`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_tickettemplatemandatoryfields DROP TABLE IF EXISTS `glpi_tickettemplatemandatoryfields`; CREATE TABLE `glpi_tickettemplatemandatoryfields` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tickettemplates_id` int(11) NOT NULL DEFAULT '0', `num` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `unicity` (`tickettemplates_id`,`num`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `glpi_tickettemplatemandatoryfields` VALUES ('1','1','21'); ### Dump table glpi_tickettemplatepredefinedfields DROP TABLE IF EXISTS `glpi_tickettemplatepredefinedfields`; CREATE TABLE `glpi_tickettemplatepredefinedfields` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tickettemplates_id` int(11) NOT NULL DEFAULT '0', `num` int(11) NOT NULL DEFAULT '0', `value` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `unicity` (`tickettemplates_id`,`num`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_tickettemplates DROP TABLE IF EXISTS `glpi_tickettemplates`; CREATE TABLE `glpi_tickettemplates` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `glpi_tickettemplates` VALUES ('1','Default','0','1',NULL); ### Dump table glpi_ticketvalidations DROP TABLE IF EXISTS `glpi_ticketvalidations`; CREATE TABLE `glpi_ticketvalidations` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `users_id` int(11) NOT NULL DEFAULT '0', `tickets_id` int(11) NOT NULL DEFAULT '0', `users_id_validate` int(11) NOT NULL DEFAULT '0', `comment_submission` text COLLATE utf8_unicode_ci, `comment_validation` text COLLATE utf8_unicode_ci, `status` varchar(255) COLLATE utf8_unicode_ci DEFAULT 'waiting', `submission_date` datetime DEFAULT NULL, `validation_date` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `entities_id` (`entities_id`), KEY `users_id` (`users_id`), KEY `users_id_validate` (`users_id_validate`), KEY `tickets_id` (`tickets_id`), KEY `submission_date` (`submission_date`), KEY `validation_date` (`validation_date`), KEY `status` (`status`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_transfers DROP TABLE IF EXISTS `glpi_transfers`; CREATE TABLE `glpi_transfers` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `keep_ticket` int(11) NOT NULL DEFAULT '0', `keep_networklink` int(11) NOT NULL DEFAULT '0', `keep_reservation` int(11) NOT NULL DEFAULT '0', `keep_history` int(11) NOT NULL DEFAULT '0', `keep_device` int(11) NOT NULL DEFAULT '0', `keep_infocom` int(11) NOT NULL DEFAULT '0', `keep_dc_monitor` int(11) NOT NULL DEFAULT '0', `clean_dc_monitor` int(11) NOT NULL DEFAULT '0', `keep_dc_phone` int(11) NOT NULL DEFAULT '0', `clean_dc_phone` int(11) NOT NULL DEFAULT '0', `keep_dc_peripheral` int(11) NOT NULL DEFAULT '0', `clean_dc_peripheral` int(11) NOT NULL DEFAULT '0', `keep_dc_printer` int(11) NOT NULL DEFAULT '0', `clean_dc_printer` int(11) NOT NULL DEFAULT '0', `keep_supplier` int(11) NOT NULL DEFAULT '0', `clean_supplier` int(11) NOT NULL DEFAULT '0', `keep_contact` int(11) NOT NULL DEFAULT '0', `clean_contact` int(11) NOT NULL DEFAULT '0', `keep_contract` int(11) NOT NULL DEFAULT '0', `clean_contract` int(11) NOT NULL DEFAULT '0', `keep_software` int(11) NOT NULL DEFAULT '0', `clean_software` int(11) NOT NULL DEFAULT '0', `keep_document` int(11) NOT NULL DEFAULT '0', `clean_document` int(11) NOT NULL DEFAULT '0', `keep_cartridgeitem` int(11) NOT NULL DEFAULT '0', `clean_cartridgeitem` int(11) NOT NULL DEFAULT '0', `keep_cartridge` int(11) NOT NULL DEFAULT '0', `keep_consumable` int(11) NOT NULL DEFAULT '0', `date_mod` datetime DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `keep_disk` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `date_mod` (`date_mod`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `glpi_transfers` VALUES ('1','complete','2','2','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1',NULL,NULL,'1'); ### Dump table glpi_usercategories DROP TABLE IF EXISTS `glpi_usercategories`; CREATE TABLE `glpi_usercategories` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_useremails DROP TABLE IF EXISTS `glpi_useremails`; CREATE TABLE `glpi_useremails` ( `id` int(11) NOT NULL AUTO_INCREMENT, `users_id` int(11) NOT NULL DEFAULT '0', `is_default` tinyint(1) NOT NULL DEFAULT '0', `is_dynamic` tinyint(1) NOT NULL DEFAULT '0', `email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`users_id`,`email`), KEY `email` (`email`), KEY `is_default` (`is_default`), KEY `is_dynamic` (`is_dynamic`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_users DROP TABLE IF EXISTS `glpi_users`; CREATE TABLE `glpi_users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `password` char(40) COLLATE utf8_unicode_ci DEFAULT NULL, `phone` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `phone2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `mobile` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `realname` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `firstname` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `locations_id` int(11) NOT NULL DEFAULT '0', `language` char(10) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'see define.php CFG_GLPI[language] array', `use_mode` int(11) NOT NULL DEFAULT '0', `list_limit` int(11) DEFAULT NULL, `is_active` tinyint(1) NOT NULL DEFAULT '1', `comment` text COLLATE utf8_unicode_ci, `auths_id` int(11) NOT NULL DEFAULT '0', `authtype` int(11) NOT NULL DEFAULT '0', `last_login` datetime DEFAULT NULL, `date_mod` datetime DEFAULT NULL, `date_sync` datetime DEFAULT NULL, `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `profiles_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '0', `usertitles_id` int(11) NOT NULL DEFAULT '0', `usercategories_id` int(11) NOT NULL DEFAULT '0', `date_format` int(11) DEFAULT NULL, `number_format` int(11) DEFAULT NULL, `names_format` int(11) DEFAULT NULL, `csv_delimiter` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `is_ids_visible` tinyint(1) DEFAULT NULL, `dropdown_chars_limit` int(11) DEFAULT NULL, `use_flat_dropdowntree` tinyint(1) DEFAULT NULL, `show_jobs_at_login` tinyint(1) DEFAULT NULL, `priority_1` char(20) COLLATE utf8_unicode_ci DEFAULT NULL, `priority_2` char(20) COLLATE utf8_unicode_ci DEFAULT NULL, `priority_3` char(20) COLLATE utf8_unicode_ci DEFAULT NULL, `priority_4` char(20) COLLATE utf8_unicode_ci DEFAULT NULL, `priority_5` char(20) COLLATE utf8_unicode_ci DEFAULT NULL, `priority_6` char(20) COLLATE utf8_unicode_ci DEFAULT NULL, `is_categorized_soft_expanded` tinyint(1) DEFAULT NULL, `is_not_categorized_soft_expanded` tinyint(1) DEFAULT NULL, `followup_private` tinyint(1) DEFAULT NULL, `task_private` tinyint(1) DEFAULT NULL, `default_requesttypes_id` int(11) DEFAULT NULL, `password_forget_token` char(40) COLLATE utf8_unicode_ci DEFAULT NULL, `password_forget_token_date` datetime DEFAULT NULL, `user_dn` text COLLATE utf8_unicode_ci, `registration_number` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `show_count_on_tabs` tinyint(1) DEFAULT NULL, `refresh_ticket_list` int(11) DEFAULT NULL, `set_default_tech` tinyint(1) DEFAULT NULL, `personal_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `personal_token_date` datetime DEFAULT NULL, `display_count_on_home` int(11) DEFAULT NULL, `notification_to_myself` tinyint(1) DEFAULT NULL, `duedateok_color` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `duedatewarning_color` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `duedatecritical_color` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `duedatewarning_less` int(11) DEFAULT NULL, `duedatecritical_less` int(11) DEFAULT NULL, `duedatewarning_unit` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `duedatecritical_unit` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `display_options` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`name`), KEY `firstname` (`firstname`), KEY `realname` (`realname`), KEY `entities_id` (`entities_id`), KEY `profiles_id` (`profiles_id`), KEY `locations_id` (`locations_id`), KEY `usertitles_id` (`usertitles_id`), KEY `usercategories_id` (`usercategories_id`), KEY `is_deleted` (`is_deleted`), KEY `is_active` (`is_active`), KEY `date_mod` (`date_mod`), KEY `authitem` (`authtype`,`auths_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `glpi_users` VALUES ('2','glpi','0915bd0a5c6e56d8f38ca2b390857d4949073f41','','','','',NULL,'0',NULL,'0','20','1',NULL,'0','1','2013-09-03 09:47:52','2010-05-06 09:31:04',NULL,'0','0','0','0','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); INSERT INTO `glpi_users` VALUES ('3','post-only','3177926a7314de24680a9938aaa97703','','','','',NULL,'0','en_GB','0','20','1',NULL,'0','0',NULL,NULL,NULL,'0','0','0','0','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); INSERT INTO `glpi_users` VALUES ('4','tech','d9f9133fb120cd6096870bc2b496805b','','','','',NULL,'0','fr_FR','0','20','1',NULL,'0','0',NULL,NULL,NULL,'0','0','0','0','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); INSERT INTO `glpi_users` VALUES ('5','normal','fea087517c26fadd409bd4b9dc642555','','','','',NULL,'0','en_GB','0','20','1',NULL,'0','0',NULL,NULL,NULL,'0','0','0','0','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); ### Dump table glpi_usertitles DROP TABLE IF EXISTS `glpi_usertitles`; CREATE TABLE `glpi_usertitles` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_virtualmachinestates DROP TABLE IF EXISTS `glpi_virtualmachinestates`; CREATE TABLE `glpi_virtualmachinestates` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `comment` text COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_virtualmachinesystems DROP TABLE IF EXISTS `glpi_virtualmachinesystems`; CREATE TABLE `glpi_virtualmachinesystems` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `comment` text COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_virtualmachinetypes DROP TABLE IF EXISTS `glpi_virtualmachinetypes`; CREATE TABLE `glpi_virtualmachinetypes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `comment` text COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_vlans DROP TABLE IF EXISTS `glpi_vlans`; CREATE TABLE `glpi_vlans` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `tag` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `name` (`name`), KEY `entities_id` (`entities_id`), KEY `tag` (`tag`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ### Dump table glpi_wifinetworks DROP TABLE IF EXISTS `glpi_wifinetworks`; CREATE TABLE `glpi_wifinetworks` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `essid` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `mode` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'ad-hoc, access_point', `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `entities_id` (`entities_id`), KEY `essid` (`essid`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; glpi-0.84.3+dfsg.1/install/update.php000066400000000000000000000713751226600447100172770ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { define('GLPI_ROOT', realpath('..')); } include_once (GLPI_ROOT . "/inc/autoload.function.php"); include_once (GLPI_ROOT . "/inc/db.function.php"); include_once (GLPI_CONFIG_DIR . "/config_db.php"); Config::detectRootDoc(); // Old itemtype for compatibility define("GENERAL_TYPE", 0); define("COMPUTER_TYPE", 1); define("NETWORKING_TYPE", 2); define("PRINTER_TYPE", 3); define("MONITOR_TYPE", 4); define("PERIPHERAL_TYPE", 5); define("SOFTWARE_TYPE", 6); define("CONTACT_TYPE", 7); define("ENTERPRISE_TYPE", 8); define("INFOCOM_TYPE", 9); define("CONTRACT_TYPE", 10); define("CARTRIDGEITEM_TYPE", 11); define("TYPEDOC_TYPE", 12); define("DOCUMENT_TYPE", 13); define("KNOWBASE_TYPE", 14); define("USER_TYPE", 15); define("TRACKING_TYPE", 16); define("CONSUMABLEITEM_TYPE", 17); define("CONSUMABLE_TYPE", 18); define("CARTRIDGE_TYPE", 19); define("SOFTWARELICENSE_TYPE",20); define("LINK_TYPE", 21); define("STATE_TYPE", 22); define("PHONE_TYPE", 23); define("DEVICE_TYPE", 24); define("REMINDER_TYPE", 25); define("STAT_TYPE", 26); define("GROUP_TYPE", 27); define("ENTITY_TYPE", 28); define("RESERVATION_TYPE", 29); define("AUTHMAIL_TYPE", 30); define("AUTHLDAP_TYPE", 31); define("OCSNG_TYPE", 32); define("REGISTRY_TYPE", 33); define("PROFILE_TYPE", 34); define("MAILGATE_TYPE", 35); define("RULE_TYPE", 36); define("TRANSFER_TYPE", 37); define("BOOKMARK_TYPE", 38); define("SOFTWAREVERSION_TYPE",39); define("PLUGIN_TYPE", 40); define("COMPUTERDISK_TYPE", 41); define("NETWORKING_PORT_TYPE",42); define("FOLLOWUP_TYPE", 43); define("BUDGET_TYPE", 44); // Old devicetype for compatibility define("MOBOARD_DEVICE", 1); define("PROCESSOR_DEVICE", 2); define("RAM_DEVICE", 3); define("HDD_DEVICE", 4); define("NETWORK_DEVICE", 5); define("DRIVE_DEVICE", 6); define("CONTROL_DEVICE", 7); define("GFX_DEVICE", 8); define("SND_DEVICE", 9); define("PCI_DEVICE", 10); define("CASE_DEVICE", 11); define("POWER_DEVICE", 12); // Use default session dir if not writable if (is_writable(GLPI_SESSION_DIR)) { Session::setPath(); } // Init debug variable // Only show errors Toolbox::setDebugMode(Session::DEBUG_MODE, 0, 0, 1); $DB = new DB(); /* ----------------------------------------------------------------- */ /*---------------------------------------------------------------------*/ /** * To be conserved to migrations before 0.80 * since 0.80, migration is a new class **/ function displayMigrationMessage ($id, $msg="") { static $created = 0; static $deb; if ($created != $id) { if (empty($msg)) { $msg = __('Work in progress...'); } echo "

    $msg

    "; $created = $id; $deb = time(); } else { if (empty($msg)) { $msg = __('Task completed.'); } $fin = time(); $tps = Html::timestampToString($fin-$deb); echo "\n"; } Html::glpi_flush(); } /** * Add a dropdown if not exists (used by pre 0.78 update script) * Only use for simple dropdown (no entity and not tree) * * @param $table string table name * @param $name string name of the imported dropdown * * @return integer (ID of the existing/new dropdown) **/ function update_importDropdown ($table, $name) { global $DB; $query = "SELECT `ID` FROM `".$table."` WHERE `name` = '".addslashes($name)."'"; if ($result = $DB->query($query) ) { if ($DB->numrows($result) > 0) { return $DB->result($result,0,"ID"); } } $query = "INSERT INTO `".$table."` (`name`) VALUES ('".addslashes($name)."')"; if ($result = $DB->query($query)) { return $DB->insert_id(); } return 0; } /** * Display the form of content update (addslashes compatibility (V0.4)) * * @return nothing (displays) */ function showContentUpdateForm() { echo "
    "; echo "

    ".__('Update successful, your database is up to date')."

    "; echo "

    ".__('You must now proceed to updating your database content')."

    "; echo "

    "; echo "".__('Continue?').""; } ///// FONCTION POUR UPDATE LOCATION function validate_new_location() { global $DB; $query = " DROP TABLE `glpi_dropdown_locations`"; $DB->query($query); $query = " ALTER TABLE `glpi_dropdown_locations_new` RENAME `glpi_dropdown_locations`"; $DB->query($query); } function display_new_locations() { global $DB; $MAX_LEVEL = 10; $SELECT_ALL = ""; $FROM_ALL = ""; $ORDER_ALL = ""; for ($i=1 ; $i<=$MAX_LEVEL ; $i++) { $SELECT_ALL .= " , location$i.`name` AS NAME$i , location$i.`parentID` AS PARENT$i "; $FROM_ALL .= " LEFT JOIN `glpi_dropdown_locations_new` AS location$i ON location".($i-1).".`ID` = location$i.`parentID` "; $ORDER_ALL .= " , NAME$i"; } $query = "SELECT location0.`name` AS NAME0, location0.`parentID` AS PARENT0 $SELECT_ALL FROM `glpi_dropdown_locations_new` AS location0 $FROM_ALL WHERE location0.`parentID` = '0' ORDER BY NAME0 $ORDER_ALL"; $result = $DB->query($query); $data_old = array(); echo ""; for ($i=0 ; $i<=$MAX_LEVEL ; $i++) { echo ""; } echo ""; while ($data = $DB->fetch_assoc($result)) { echo ""; for ($i=0 ; $i<=$MAX_LEVEL ; $i++) { if (!isset($data_old["NAME$i"]) || ($data_old["PARENT$i"] != $data["PARENT$i"]) || ($data_old["NAME$i"] != $data["NAME$i"])) { $name = $data["NAME$i"]; if (isset($data["NAME".($i+1)]) && !empty($data["NAME".($i+1)])) { $arrow = "--->"; } else { $arrow = ""; } } else { $name = ""; $arrow = ""; } echo ""; echo ""; } echo ""; $data_old=$data; } $DB->free_result($result); echo "
    $i 
    ".$name."$arrow
    "; } function display_old_locations() { global $DB; $query = "SELECT * FROM `glpi_dropdown_locations` ORDER BY `name`"; $result = $DB->query($query); while ($data = $DB->fetch_assoc($result)) { echo "".$data['name']." - "; } $DB->free_result($result); } function location_create_new($split_char, $add_first) { global $DB; $query_auto_inc = "ALTER TABLE `glpi_dropdown_locations_new` CHANGE `ID` `ID` INT(11) NOT NULL"; $result_auto_inc = $DB->query($query_auto_inc); $query = "SELECT MAX(`ID`) AS MAX FROM `glpi_dropdown_locations`"; $result = $DB->query($query); $new_ID = $DB->result($result, 0, "MAX"); $new_ID++; $query = "SELECT * FROM `glpi_dropdown_locations`"; $result = $DB->query($query); $query_clear_new = "TRUNCATE TABLE `glpi_dropdown_locations_new`"; $result_clear_new = $DB->query($query_clear_new); if (!empty($add_first)) { $root_ID = $new_ID; $new_ID++; $query_insert = "INSERT INTO `glpi_dropdown_locations_new` VALUES ('$root_ID', '".addslashes($add_first)."', 0, '')"; $result_insert = $DB->query($query_insert); } else { $root_ID = 0; } while ($data = $DB->fetch_assoc($result)) { if (!empty($split_char)) { $splitter = explode($split_char, $data['name']); } else { $splitter = array($data['name']); } $up_ID = $root_ID; for ($i=0 ; $iquery($query_search); if ($DB->numrows($result_search)==1) { // Found $up_ID = $DB->result($result_search,0,"ID"); } else { // Not FOUND -> INSERT $query_insert = "INSERT INTO `glpi_dropdown_locations_new` VALUES ('$new_ID', '".addslashes($splitter[$i])."', '$up_ID', '')"; $result_insert = $DB->query($query_insert); $up_ID = $new_ID++; } } // Ajout du dernier $query_insert = "INSERT INTO `glpi_dropdown_locations_new` VALUES ('".$data["ID"]."', '".addslashes($splitter[count($splitter)-1])."', '$up_ID', '')"; $result_insert=$DB->query($query_insert); } $DB->free_result($result); $query_auto_inc = "ALTER TABLE `glpi_dropdown_locations_new` CHANGE `ID` `ID` INT(11) NOT NULL AUTO_INCREMENT"; $result_auto_inc = $DB->query($query_auto_inc); } ///// FIN FONCTIONS POUR UPDATE LOCATION function showLocationUpdateForm() { global $DB, $CFG_GLPI; if ((TableExists ("glpi_dropdown_locations") && FieldExists("glpi_dropdown_locations", "parentID", false)) || (TableExists ("glpi_locations") && FieldExists("glpi_locations", "locations_id", false))) { updateTreeDropdown(); return true; } if (!isset($_POST['root'])) { $_POST['root'] = ''; } if (!isset($_POST['car_sep'])) { $_POST['car_sep'] = ''; } if (!TableExists("glpi_dropdown_locations_new")) { $query = " CREATE TABLE `glpi_dropdown_locations_new` ( `ID` INT NOT NULL auto_increment, `name` VARCHAR(255) NOT NULL , `parentID` INT NOT NULL , `comments` TEXT NULL , PRIMARY KEY (`ID`), UNIQUE KEY (`name`,`parentID`), KEY(`parentID`)) TYPE=MyISAM"; $DB->queryOrDie($query, "LOCATION"); } if (!isset($_POST["validate_location"])) { echo "

    "; echo "

    ".__('Locations update')."

    "; echo "

    ".__('The new structure is hierarchical')."

    "; echo "

    ".__('Provide a delimiter in order to automate the new hierarchy generation.')."
    "; echo __('You can also specify a root location which will include all the generated locations.'); echo "

    "; echo ""; echo "

    ".__('Delimiter')." ". "

    "; echo "

    ".__('Root location').' '. "

    "; echo ""; echo ""; Html::closeForm(); echo "
    "; } if (isset($_POST["new_location"])) { location_create_new($_POST['car_sep'], $_POST['root']); echo "

    ".__('Actual locations')." :

    "; display_old_locations(); echo "

    ".__('New hierarchy')." :

    "; display_new_locations(); echo "

    ".__("This is the new hierarchy. If it's complete approve it.")."

    "; echo "
    "; echo ""; echo ""; echo ""; echo "
    "; Html::closeForm(); } else if (isset($_POST["validate_location"])) { validate_new_location(); updateTreeDropdown(); return true; } else { display_old_locations(); } exit(); } //test la connection a la base de donn�. function test_connect() { global $DB; if ($DB->error == 0) { return true; } return false; } //Change table2 from varchar to ID+varchar and update table1.chps with depends function changeVarcharToID($table1, $table2, $chps) { global $DB; if (!FieldExists($table2, "ID", false)) { $query = " ALTER TABLE `$table2` ADD `ID` INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST"; $DB->queryOrDie($query); } $query = "ALTER TABLE `$table1` ADD `temp` INT"; $DB->queryOrDie($query); $query = "SELECT `$table1`.`ID` AS row1, `$table2`.`ID` AS row2 FROM `$table1`, `$table2` WHERE `$table2`.`name` = `$table1`.`$chps`"; $result = $DB->queryOrDie($query); while ($line = $DB->fetch_assoc($result)) { $query = "UPDATE `$table1` SET `temp` = ". $line["row2"] ." WHERE `ID` = '". $line["row1"] ."'"; $DB->queryOrDie($query); } $DB->free_result($result); $query = "ALTER TABLE `$table1` DROP `$chps`"; $DB->queryOrDie($query); $query = "ALTER TABLE `$table1` CHANGE `temp` `$chps` INT"; $DB->queryOrDie($query); } //update database up to 0.31 function updateDbUpTo031() { global $DB, $migration; $ret = array(); // Before 0.31 if (!TableExists("glpi_config") && !TableExists("glpi_configs")) { $query = "CREATE TABLE `glpi_config` ( `ID` int(11) NOT NULL auto_increment, `num_of_events` varchar(200) NOT NULL default '', `jobs_at_login` varchar(200) NOT NULL default '', `sendexpire` varchar(200) NOT NULL default '', `cut` varchar(200) NOT NULL default '', `expire_events` varchar(200) NOT NULL default '', `list_limit` varchar(200) NOT NULL default '', `version` varchar(200) NOT NULL default '', `logotxt` varchar(200) NOT NULL default '', `root_doc` varchar(200) NOT NULL default '', `event_loglevel` varchar(200) NOT NULL default '', `mailing` varchar(200) NOT NULL default '', `imap_auth_server` varchar(200) NOT NULL default '', `imap_host` varchar(200) NOT NULL default '', `ldap_host` varchar(200) NOT NULL default '', `ldap_basedn` varchar(200) NOT NULL default '', `ldap_rootdn` varchar(200) NOT NULL default '', `ldap_pass` varchar(200) NOT NULL default '', `admin_email` varchar(200) NOT NULL default '', `mailing_signature` varchar(200) NOT NULL default '', `mailing_new_admin` varchar(200) NOT NULL default '', `mailing_followup_admin` varchar(200) NOT NULL default '', `mailing_finish_admin` varchar(200) NOT NULL default '', `mailing_new_all_admin` varchar(200) NOT NULL default '', `mailing_followup_all_admin` varchar(200) NOT NULL default '', `mailing_finish_all_admin` varchar(200) NOT NULL default '', `mailing_new_all_normal` varchar(200) NOT NULL default '', `mailing_followup_all_normal` varchar(200) NOT NULL default '', `mailing_finish_all_normal` varchar(200) NOT NULL default '', `mailing_new_attrib` varchar(200) NOT NULL default '', `mailing_followup_attrib` varchar(200) NOT NULL default '', `mailing_finish_attrib` varchar(200) NOT NULL default '', `mailing_new_user` varchar(200) NOT NULL default '', `mailing_followup_user` varchar(200) NOT NULL default '', `mailing_finish_user` varchar(200) NOT NULL default '', `ldap_field_name` varchar(200) NOT NULL default '', `ldap_field_email` varchar(200) NOT NULL default '', `ldap_field_location` varchar(200) NOT NULL default '', `ldap_field_realname` varchar(200) NOT NULL default '', `ldap_field_phone` varchar(200) NOT NULL default '', PRIMARY KEY (`ID`) ) TYPE=MyISAM AUTO_INCREMENT=2 "; $DB->queryOrDie($query); $query = "INSERT INTO `glpi_config` VALUES (1, '10', '1', '1', '80', '30', '15', ' 0.31', 'GLPI powered by indepnet', '/glpi', '5', '0', '', '', '', '', '', '', 'admsys@xxxxx.fr', 'SIGNATURE', '1', '1', '1', '1', '0', '0', '0', '0', '0', '0', '0', '0','1', '1', '1', 'uid', 'mail', 'physicaldeliveryofficename', 'cn', 'telephonenumber')"; $DB->queryOrDie($query); echo "

    Version > 0.31

    "; } // Save if problem with session during update $glpilanguage = $_SESSION["glpilanguage"]; // < 0.78 if (TableExists("glpi_config")) { // Get current version // Use language from session, even if sometime not reliable $query = "SELECT `version`, '$glpilanguage' FROM `glpi_config`"; } else { // >= 0.78 // Get current version and language $query = "SELECT `version`, `language` FROM `glpi_configs`"; } $result = $DB->queryOrDie($query, "get current version"); $current_version = trim($DB->result($result,0,0)); $glpilanguage = trim($DB->result($result,0,1)); // To prevent problem of execution time ini_set("max_execution_time", "0"); $migration = new Migration($current_version); switch ($current_version) { case "0.31" : include("update_031_04.php"); update031to04(); case "0.4" : case "0.41" : include("update_04_042.php"); update04to042(); case "0.42" : showLocationUpdateForm(); include("update_042_05.php"); update042to05(); case "0.5" : include("update_05_051.php"); update05to051(); case "0.51" : case "0.51a" : include("update_051_06.php"); update051to06(); case "0.6" : include("update_06_065.php"); update06to065(); case "0.65" : include("update_065_068.php"); update065to068(); case "0.68" : include("update_068_0681.php"); update068to0681(); case "0.68.1" : case "0.68.2" : case "0.68.3" : // Force update content if (showLocationUpdateForm()) { $query = "UPDATE `glpi_config` SET `version` = ' 0.68.3x'"; $DB->queryOrDie($query, "0.68.3"); showContentUpdateForm(); exit(); } case "0.68.3x": // Special version for replay upgrade process from here include("update_0681_07.php"); update0681to07(); case "0.7" : case "0.70.1" : case "0.70.2" : include("update_07_071.php"); update07to071(); case "0.71" : case "0.71.1" : include("update_071_0712.php"); update071to0712(); case "0.71.2" : include("update_0712_0713.php"); update0712to0713(); case "0.71.3" : case "0.71.4" : case "0.71.5" : case "0.71.6" : include("update_0713_072.php"); update0713to072(); case "0.72" : include("update_072_0721.php"); update072to0721(); case "0.72.1" : include("update_0721_0722.php"); update0721to0722(); case "0.72.2" : case "0.72.21" : include("update_0722_0723.php"); update0722to0723(); case "0.72.3" : case "0.72.4" : include("update_0723_078.php"); update0723to078(); case "0.78" : include("update_078_0781.php"); update078to0781(); case "0.78.1" : include("update_0781_0782.php"); update0781to0782(); case "0.78.2": case "0.78.3": case "0.78.4": case "0.78.5": include("update_0782_080.php"); update0782to080(); case "0.80" : include("update_080_0801.php"); update080to0801(); case "0.80.1" : case "0.80.2" : include("update_0801_0803.php"); update0801to0803(); case "0.80.3" : case "0.80.4" : case "0.80.5" : case "0.80.6" : case "0.80.61" : case "0.80.7" : include("update_0803_083.php"); update0803to083(); case "0.83" : include("update_083_0831.php"); update083to0831(); case "0.83.1" : case "0.83.2" : include("update_0831_0833.php"); update0831to0833(); case "0.83.3" : case "0.83.31" : case "0.83.4" : case "0.83.5" : case "0.83.6" : case "0.83.7" : case "0.83.8" : case "0.83.9" : case "0.83.91" : include("update_0831_084.php"); update0831to084(); case "0.84" : include("update_084_0841.php"); update084to0841(); case "0.84.1" : case "0.84.2" : include("update_0841_0843.php"); update0841to0843(); case "0.84.3" : break; default : include("update_031_04.php"); update031to04(); include("update_04_042.php"); update04to042(); showLocationUpdateForm(); include("update_042_05.php"); update042to05(); include("update_05_051.php"); update05to051(); include("update_051_06.php"); update051to06(); include("update_06_065.php"); update06to065(); include("update_065_068.php"); update065to068(); include("update_068_0681.php"); update068to0681(); // Force update content $query = "UPDATE `glpi_config` SET `version` = ' 0.68.3x'"; $DB->queryOrDie($query, "0.68.3"); showContentUpdateForm(); exit(); } // Update version number and default langage and new version_founded ---- LEAVE AT THE END $query = "UPDATE `glpi_configs` SET `version` = ' 0.84.3', `language` = '".$glpilanguage."', `founded_new_version` = ''"; $DB->queryOrDie($query); // Update process desactivate all plugins $plugin = new Plugin(); $plugin->unactivateAll(); DBmysql::optimize_tables($migration); return $ret; } function updateTreeDropdown() { global $DB; // Update Tree dropdown if (TableExists("glpi_dropdown_locations") && !FieldExists("glpi_dropdown_locations", "completename", false)) { $query = "ALTER TABLE `glpi_dropdown_locations` ADD `completename` TEXT NOT NULL "; $DB->queryOrDie($query, "0.6 add completename in dropdown_locations"); } if (TableExists("glpi_dropdown_kbcategories") && !FieldExists("glpi_dropdown_kbcategories", "completename", false)) { $query = "ALTER TABLE `glpi_dropdown_kbcategories` ADD `completename` TEXT NOT NULL "; $DB->queryOrDie($query, "0.6 add completename in dropdown_kbcategories"); } if (TableExists("glpi_locations") && !FieldExists("glpi_locations", "completename", false)) { $query = "ALTER TABLE `glpi_locations` ADD `completename` TEXT NOT NULL "; $DB->queryOrDie($query, "0.6 add completename in glpi_locations"); } if (TableExists("glpi_knowbaseitemcategories") && !FieldExists("glpi_knowbaseitemcategories", "completename", false)) { $query = "ALTER TABLE `glpi_knowbaseitemcategories` ADD `completename` TEXT NOT NULL "; $DB->queryOrDie($query, "0.6 add completename in glpi_knowbaseitemcategories"); } } //Debut du script $HEADER_LOADED = true; Session::start(); Session::loadLanguage(); // Send UTF8 Headers header("Content-Type: text/html; charset=UTF-8"); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "Setup GLPI"; // CSS echo ""; echo ""; echo ""; echo "
    "; echo "
    "; echo "
    "; echo "

    GLPI SETUP

    "; echo "

    ".__('Upgrade')."

    "; // step 1 avec bouton de confirmation if (empty($_POST["continuer"]) && empty($_POST["from_update"])) { if (empty($from_install) && !isset($_POST["from_update"])) { echo "
    "; echo "

    ".__('Impossible to accomplish an update by this way!').""; echo "

    "; echo "".__('Go back to GLPI')."

    "; echo "

    "; } else { echo "
    "; echo "

    ".sprintf(__('Caution! You will update the GLPI database named: %s'),$DB->dbdefault) ."

    "; echo ""; echo ""; Html::closeForm(); echo "
    "; } // Step 2 } else { if (test_connect()) { echo "

    ".__('Database connection successful')."

    "; if (!isset($_POST["update_location"])) { $current_verison = "0.31"; $config_table = "glpi_config"; if (TableExists("glpi_configs")) { $config_table = "glpi_configs"; } // Find 2 tables to manage databases before 0.78 if (!TableExists($config_table)) { include("update_to_031.php"); updateDbTo031(); $tab = updateDbUpTo031(); } else { // Get current version $query = "SELECT `version` FROM `$config_table`"; $result = $DB->queryOrDie($query, "get current version"); $current_version = trim($DB->result($result, 0, 0)); $tab = updateDbUpTo031(); } echo "
    "; if (!empty($tab) && $tab["adminchange"]) { echo "

    ". __("All users having administrators rights have have been updated to 'super-admin' rights with the creation of his new user type.") ."

    "; } if (showLocationUpdateForm()) { switch ($current_version) { case "0.31" : case "0.4" : case "0.41" : case "0.42" : case "0.5" : case "0.51" : case "0.51a" : case "0.6" : case "0.65" : case "0.68" : case "0.68.1" : case "0.68.2" : case "0.68.3" : showContentUpdateForm(); break; default : echo "".__('Use GLPI').""; } } echo "
    "; } } else { echo "

    "; echo __("Connection to database failed, verify the connection parameters included in config_db.php file")."

    "; } } echo "
    "; ?> glpi-0.84.3+dfsg.1/install/update_031_04.php000066400000000000000000000473751226600447100201700ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /** * Test if there is a user with superadmin rights * * * @returns boolean true if its ok, elsewhere false. **/ function superAdminExists() { global $DB; $query = "SELECT `type`, `password` FROM `glpi_users`"; $result = $DB->query($query); $var1 = false; while ($line = $DB->fetch_array($result)) { if ($line["type"] == "super-admin" && !empty($line["password"])) { $var1 = true; } } return $var1; } /// Update from 0.31 to 0.4 function update031to04() { global $DB; //0.4 Prefixage des tables : echo "

    Version 0.4

    "; if (!TableExists("glpi_computers")) { $query = "ALTER TABLE `computers` RENAME `glpi_computers`"; $DB->queryOrDie($query); $query = "ALTER TABLE `connect_wire` RENAME `glpi_connect_wire`"; $DB->queryOrDie($query); $query = "ALTER TABLE `dropdown_gfxcard` RENAME `glpi_dropdown_gfxcard`"; $DB->queryOrDie($query); $query = "ALTER TABLE `dropdown_hdtype` RENAME `glpi_dropdown_hdtype`"; $DB->queryOrDie($query); $query = "ALTER TABLE `dropdown_iface` RENAME `glpi_dropdown_iface`"; $DB->queryOrDie($query); $query = "ALTER TABLE `dropdown_locations` RENAME `glpi_dropdown_locations`"; $DB->queryOrDie($query); $query = "ALTER TABLE `dropdown_moboard` RENAME `glpi_dropdown_moboard`"; $DB->queryOrDie($query); $query = "ALTER TABLE `dropdown_network` RENAME `glpi_dropdown_network`"; $DB->queryOrDie($query); $query = "ALTER TABLE `dropdown_os` RENAME `glpi_dropdown_os`"; $DB->queryOrDie($query); $query = "ALTER TABLE `dropdown_processor` RENAME `glpi_dropdown_processor`"; $DB->queryOrDie($query); $query = "ALTER TABLE `dropdown_ram` RENAME `glpi_dropdown_ram`"; $DB->queryOrDie($query); $query = "ALTER TABLE `dropdown_sndcard` RENAME `glpi_dropdown_sndcard`"; $DB->queryOrDie($query); $query = "ALTER TABLE `event_log` RENAME `glpi_event_log`"; $DB->queryOrDie($query); $query = "ALTER TABLE `followups` RENAME `glpi_followups`"; $DB->queryOrDie($query); $query = "ALTER TABLE `inst_software` RENAME `glpi_inst_software`"; $DB->queryOrDie($query); $query = "ALTER TABLE `licenses` RENAME `glpi_licenses`"; $DB->queryOrDie($query); $query = "ALTER TABLE `monitors` RENAME `glpi_monitors`"; $DB->queryOrDie($query); $query = "ALTER TABLE `networking` RENAME `glpi_networking`"; $DB->queryOrDie($query); $query = "ALTER TABLE `networking_ports` RENAME `glpi_networking_ports`"; $DB->queryOrDie($query); $query = "ALTER TABLE `networking_wire` RENAME `glpi_networking_wire`"; $DB->queryOrDie($query); if (TableExists("prefs") && !TableExists("glpi_prefs")) { $query = "ALTER TABLE `prefs` RENAME `glpi_prefs`"; $DB->queryOrDie($query); } $query = "ALTER TABLE `printers` RENAME `glpi_printers`"; $DB->queryOrDie($query); $query = "ALTER TABLE `software` RENAME `glpi_software`"; $DB->queryOrDie($query); $query = "ALTER TABLE `templates` RENAME `glpi_templates`"; $DB->queryOrDie($query); $query = "ALTER TABLE `tracking` RENAME `glpi_tracking`"; $DB->queryOrDie($query); $query = "ALTER TABLE `type_computers` RENAME `glpi_type_computers`"; $DB->queryOrDie($query); $query = "ALTER TABLE `type_monitors` RENAME `glpi_type_monitors`"; $DB->queryOrDie($query); $query = "ALTER TABLE `type_networking` RENAME `glpi_type_networking`"; $DB->queryOrDie($query); $query = "ALTER TABLE `type_printers` RENAME `glpi_type_printers`"; $DB->queryOrDie($query); $query = "ALTER TABLE `users` RENAME `glpi_users`"; $DB->queryOrDie($query); } //Ajout d'un champs ID dans la table users if (!FieldExists("glpi_users", "ID", false)) { $query = "ALTER TABLE `glpi_users` DROP PRIMARY KEY"; $DB->queryOrDie($query); $query = "ALTER TABLE `glpi_users` ADD UNIQUE (`name`)"; $DB->queryOrDie($query); $query = "ALTER TABLE `glpi_users` ADD INDEX (`name`)"; $DB->queryOrDie($query); $query = " ALTER TABLE `glpi_users` ADD `ID` INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST"; $DB->queryOrDie($query); } //Mise a jour des ID pour les tables dropdown et type //cles primaires sur les tables dropdown et type, et mise a jour des champs lies if (!FieldExists("glpi_dropdown_os", "ID", false)) { changeVarcharToID("glpi_computers", "glpi_dropdown_os", "os"); changeVarcharToID("glpi_computers", "glpi_dropdown_hdtype", "hdtype"); changeVarcharToID("glpi_computers", "glpi_dropdown_sndcard", "sndcard"); changeVarcharToID("glpi_computers", "glpi_dropdown_moboard", "moboard"); changeVarcharToID("glpi_computers", "glpi_dropdown_gfxcard", "gfxcard"); changeVarcharToID("glpi_computers", "glpi_dropdown_network", "network"); changeVarcharToID("glpi_computers", "glpi_dropdown_ram", "ramtype"); changeVarcharToID("glpi_computers", "glpi_dropdown_locations", "location"); changeVarcharToID("glpi_computers", "glpi_dropdown_processor", "processor"); changeVarcharToID("glpi_computers", "glpi_type_computers", "type"); changeVarcharToID("glpi_monitors", "glpi_dropdown_locations", "location"); changeVarcharToID("glpi_monitors", "glpi_type_monitors", "type"); changeVarcharToID("glpi_networking", "glpi_dropdown_locations", "location"); changeVarcharToID("glpi_networking", "glpi_type_networking", "type"); changeVarcharToID("glpi_networking_ports", "glpi_dropdown_iface", "iface"); changeVarcharToID("glpi_printers", "glpi_dropdown_locations", "location"); changeVarcharToID("glpi_printers", "glpi_type_printers", "type"); changeVarcharToID("glpi_software", "glpi_dropdown_locations", "location"); changeVarcharToID("glpi_software", "glpi_dropdown_os", "platform"); changeVarcharToID("glpi_templates", "glpi_dropdown_os", "os"); changeVarcharToID("glpi_templates", "glpi_dropdown_hdtype", "hdtype"); changeVarcharToID("glpi_templates", "glpi_dropdown_sndcard", "sndcard"); changeVarcharToID("glpi_templates", "glpi_dropdown_moboard", "moboard"); changeVarcharToID("glpi_templates", "glpi_dropdown_gfxcard", "gfxcard"); changeVarcharToID("glpi_templates", "glpi_dropdown_network", "network"); changeVarcharToID("glpi_templates", "glpi_dropdown_ram", "ramtype"); changeVarcharToID("glpi_templates", "glpi_dropdown_locations", "location"); changeVarcharToID("glpi_templates", "glpi_dropdown_processor", "processor"); changeVarcharToID("glpi_templates", "glpi_type_computers", "type"); changeVarcharToID("glpi_users", "glpi_dropdown_locations", "location"); } if (!TableExists("glpi_type_peripherals")) { $query = "CREATE TABLE `glpi_type_peripherals` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255), PRIMARY KEY (`ID`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0A"); } if (!TableExists("glpi_peripherals")) { $query = "CREATE TABLE `glpi_peripherals` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', `date_mod` datetime NOT NULL default '0000-00-00 00:00:00', `contact` varchar(255) NOT NULL default '', `contact_num` varchar(255) NOT NULL default '', `comments` text NOT NULL, `serial` varchar(255) NOT NULL default '', `otherserial` varchar(255) NOT NULL default '', `date_fin_garantie` date default NULL, `achat_date` date NOT NULL default '0000-00-00', `maintenance` int(2) default '0', `location` int(11) NOT NULL default '0', `type` int(11) NOT NULL default '0', `brand` varchar(255) NOT NULL default '', PRIMARY KEY (`ID`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0"); } if (TableExists("glpi_prefs") && !FieldExists("glpi_prefs", "ID", false)) { $query = "ALTER TABLE `glpi_prefs` DROP PRIMARY KEY"; $DB->queryOrDie($query, "1"); $query = "ALTER TABLE `glpi_prefs` ADD `ID` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY"; $DB->queryOrDie($query, "3"); } if (!FieldExists("glpi_config", "ID", false)) { $query = "ALTER TABLE `glpi_config` CHANGE `config_id` `ID` INT(11) NOT NULL AUTO_INCREMENT"; $DB->queryOrDie($query, "4"); } if (!isIndex("glpi_computers", "location")) { $query = "ALTER TABLE `glpi_computers` ADD INDEX (`location`)"; $DB->queryOrDie($query, "5"); } if (!isIndex("glpi_computers", "os")) { $query = "ALTER TABLE `glpi_computers` ADD INDEX (`os`)"; $DB->queryOrDie($query, "6"); } if (!isIndex("glpi_computers", "type")) { $query = "ALTER TABLE `glpi_computers` ADD INDEX (`type`)"; $DB->queryOrDie($query, "7"); } if (!isIndex("glpi_followups", "tracking")) { $query = "ALTER TABLE `glpi_followups` ADD INDEX (`tracking`)"; $DB->queryOrDie($query, "12"); } if (!isIndex("glpi_networking", "location")) { $query = "ALTER TABLE `glpi_networking` ADD INDEX (`location`)"; $DB->queryOrDie($query, "13"); } if (!isIndex("glpi_networking_ports", "on_device")) { $query = "ALTER TABLE `glpi_networking_ports` ADD INDEX (`on_device` , `device_type`)"; $DB->queryOrDie($query, "14"); } if (!isIndex("glpi_peripherals", "type")) { $query = "ALTER TABLE `glpi_peripherals` ADD INDEX (`type`)"; $DB->queryOrDie($query, "14"); } if (!isIndex("glpi_peripherals", "location")) { $query = "ALTER TABLE `glpi_peripherals` ADD INDEX (`location`)"; $DB->queryOrDie($query, "15"); } if (!isIndex("glpi_printers", "location")) { $query = "ALTER TABLE `glpi_printers` ADD INDEX (`location`)"; $DB->queryOrDie($query, "16"); } if (!isIndex("glpi_tracking", "computer")) { $query = "ALTER TABLE `glpi_tracking` ADD INDEX (`computer`)"; $DB->queryOrDie($query, "17"); } if (!isIndex("glpi_tracking", "author")) { $query = "ALTER TABLE `glpi_tracking` ADD INDEX (`author`)"; $DB->queryOrDie($query, "18"); } if (!isIndex("glpi_tracking", "assign")) { $query = "ALTER TABLE `glpi_tracking` ADD INDEX (`assign`)"; $DB->queryOrDie($query, "19"); } if (!isIndex("glpi_tracking", "date")) { $query = "ALTER TABLE `glpi_tracking` ADD INDEX (`date`)"; $DB->queryOrDie($query, "20"); } if (!isIndex("glpi_tracking", "closedate")) { $query = "ALTER TABLE `glpi_tracking` ADD INDEX (`closedate`)"; $DB->queryOrDie($query, "21"); } if (!isIndex("glpi_tracking", "status")) { $query = "ALTER TABLE `glpi_tracking` ADD INDEX (`status`)"; $DB->queryOrDie($query, "22"); } if (!TableExists("glpi_dropdown_firmware")) { $query = "CREATE TABLE `glpi_dropdown_firmware` ( `ID` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL, PRIMARY KEY (`ID`))"; $DB->queryOrDie($query, "23"); } if (!FieldExists("glpi_networking","firmware", false)) { $query = "ALTER TABLE `glpi_networking` ADD `firmware` INT(11)"; $DB->queryOrDie($query, "24"); } if (!FieldExists("glpi_tracking","realtime", false)) { $query = "ALTER TABLE `glpi_tracking` ADD `realtime` FLOAT NOT NULL"; $DB->queryOrDie($query, "25"); } if (!FieldExists("glpi_printers","flags_usb", false)) { $query = "ALTER TABLE `glpi_printers` ADD `flags_usb` TINYINT DEFAULT '0' NOT NULL AFTER `flags_par`"; $DB->queryOrDie($query, "26"); } if (!FieldExists("glpi_licenses","expire", false)) { $query = "ALTER TABLE `glpi_licenses` ADD `expire` date default NULL"; $DB->queryOrDie($query, "27"); } if (!isIndex("glpi_licenses", "sID")) { $query = "ALTER TABLE `glpi_licenses` ADD INDEX (`sID`) "; $DB->queryOrDie($query, "32"); } if (!isIndex("glpi_followups", "author")) { $query = "ALTER TABLE `glpi_followups` ADD INDEX (`author`) "; $DB->queryOrDie($query, "33"); } if (!isIndex("glpi_monitors", "type")) { $query = "ALTER TABLE `glpi_monitors` ADD INDEX (`type`) "; $DB->queryOrDie($query, "34"); } if (!isIndex("glpi_monitors", "location")) { $query = "ALTER TABLE `glpi_monitors` ADD INDEX (`location`) "; $DB->queryOrDie($query, "35"); } if (!isIndex("glpi_monitors", "type")) { $query = "ALTER TABLE `glpi_monitors` ADD INDEX (`type`)"; $DB->queryOrDie($query, "37"); } if (!isIndex("glpi_networking", "type")) { $query = "ALTER TABLE `glpi_networking` ADD INDEX (`type`)"; $DB->queryOrDie($query, "38"); } if (!isIndex("glpi_networking", "firmware")) { $query = "ALTER TABLE `glpi_networking` ADD INDEX (`firmware`)"; $DB->queryOrDie($query, "39"); } if (!isIndex("glpi_printers", "type")) { $query = "ALTER TABLE `glpi_printers` ADD INDEX (`type`)"; $DB->queryOrDie($query, "42"); } if (!isIndex("glpi_software", "platform")) { $query = "ALTER TABLE `glpi_software` ADD INDEX (`platform`)"; $DB->queryOrDie($query, "44"); } if (!isIndex("glpi_software", "location")) { $query = "ALTER TABLE `glpi_software` ADD INDEX (`location`) "; $DB->queryOrDie($query, "45"); } if (!TableExists("glpi_dropdown_netpoint")) { $query = " CREATE TABLE `glpi_dropdown_netpoint` ( `ID` INT NOT NULL AUTO_INCREMENT , `location` INT NOT NULL , `name` VARCHAR(255) NOT NULL , PRIMARY KEY (`ID`))"; $DB->queryOrDie($query, "46"); } if (!isIndex("glpi_dropdown_netpoint", "location")) { $query = "ALTER TABLE `glpi_dropdown_netpoint` ADD INDEX (`location`) "; $DB->queryOrDie($query, "47"); } if (!FieldExists("glpi_networking_ports","netpoint", false)) { $query = "ALTER TABLE `glpi_networking_ports` ADD `netpoint` INT default NULL"; $DB->queryOrDie($query, "27"); } if (!isIndex("glpi_networking_ports", "netpoint")) { $query = "ALTER TABLE `glpi_networking_ports` ADD INDEX (`netpoint`) "; $DB->queryOrDie($query, "47"); } if (!isIndex("glpi_networking_wire", "end1")) { $query = "ALTER TABLE `glpi_networking_wire` ADD INDEX (`end1`) "; $DB->queryOrDie($query, "40"); // Clean Table $query = "SELECT * FROM `glpi_networking_wire` ORDER BY `end1`, `end2`"; $result = $DB->query($query); $curend1 = -1; $curend2 = -1; while ($line = $DB->fetch_array($result)) { if ($curend1==$line['end1'] && $curend2==$line['end2']) { $q2 = "DELETE FROM `glpi_networking_wire` WHERE `ID` = '".$line['ID']."' LIMIT 1"; $DB->query($q2); } else { $curend1 = $line['end1']; $curend2 = $line['end2'];} } $DB->free_result($result); $query = "ALTER TABLE `glpi_networking_wire` ADD UNIQUE end1_1 (`end1`,`end2`)"; $DB->queryOrDie($query, "477"); } if (!isIndex("glpi_networking_wire", "end2")) { $query = "ALTER TABLE `glpi_networking_wire` ADD INDEX (`end2`) "; $DB->queryOrDie($query, "41"); } if (!isIndex("glpi_connect_wire", "end1")) { $query = "ALTER TABLE `glpi_connect_wire` ADD INDEX (`end1`) "; $DB->queryOrDie($query, "40"); // Clean Table $query = "SELECT * FROM `glpi_connect_wire` ORDER BY `type`, `end1`, `end2`"; $result = $DB->query($query); $curend1 = -1; $curend2 = -1; $curtype = -1; while ($line = $DB->fetch_array($result)) { if ($curend1==$line['end1'] && $curend2==$line['end2'] && $curtype==$line['type']) { $q2 = "DELETE FROM `glpi_connect_wire` WHERE `ID`='".$line['ID']."' LIMIT 1"; $DB->query($q2); } else { $curend1 = $line['end1']; $curend2 = $line['end2']; $curtype = $line['type'];} } $DB->free_result($result); $query = "ALTER TABLE `glpi_connect_wire` ADD UNIQUE end1_1 (`end1`,`end2`,`type`) "; $DB->queryOrDie($query, "478"); } if (!isIndex("glpi_connect_wire", "end2")) { $query = "ALTER TABLE `glpi_connect_wire` ADD INDEX (`end2`) "; $DB->queryOrDie($query, "40"); } if (!isIndex("glpi_connect_wire", "type")) { $query = "ALTER TABLE `glpi_connect_wire` ADD INDEX (`type`)"; $DB->queryOrDie($query, "40"); } if (!FieldExists("glpi_config","ldap_condition", false)) { $query = "ALTER TABLE `glpi_config` ADD `ldap_condition` VARCHAR(255) NOT NULL DEFAULT ''"; $DB->queryOrDie($query, "48"); } $query = "ALTER TABLE `glpi_users` CHANGE `type` `type` ENUM('normal', 'admin', 'post-only', 'super-admin') DEFAULT 'normal' NOT NULL"; $DB->queryOrDie($query, "49"); $ret["adminchange"] = false; //All "admin" users have to be set as "super-admin" if (!superAdminExists()) { $query = "UPDATE `glpi_users` SET `type` = 'super-admin' WHERE `type` = 'admin'"; $DB->queryOrDie($query, "49"); if ($DB->affected_rows() != 0) { $ret["adminchange"] = true; } } if (!FieldExists("glpi_users","password_md5", false)) { $query = "ALTER TABLE `glpi_users` ADD `password_md5` VARCHAR(80) NOT NULL AFTER `password`"; $DB->queryOrDie($query, "glpi_users.Password_md5"); } if (!FieldExists("glpi_config","permit_helpdesk", false)) { $query = "ALTER TABLE `glpi_config` ADD `permit_helpdesk` VARCHAR(200) NOT NULL"; $DB->queryOrDie($query, "glpi_config_permit_helpdesk"); } } ?> glpi-0.84.3+dfsg.1/install/update_042_05.php000066400000000000000000001721331226600447100201620ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /// Update from 0.42 to 0.5 function update042to05() { global $DB; echo "

    Version 0.5

    "; // Augmentation taille itemtype $query = "ALTER TABLE `glpi_event_log` CHANGE `itemtype` `itemtype` VARCHAR(20) NOT NULL"; $DB->queryOrDie($query, "4204"); // Correction des itemtype tronque $query = "UPDATE `glpi_event_log` SET `itemtype` = 'reservation' WHERE `itemtype` = 'reservatio'"; $DB->queryOrDie($query, "4204"); /*******************************GLPI 0.5***********************************************/ //pass all templates to computers if (!FieldExists("glpi_computers","is_template", false)) { $query = "ALTER TABLE `glpi_computers` ADD `is_template` ENUM('0','1') DEFAULT '0' NOT NULL "; $DB->queryOrDie($query, "0.5 alter computers add is_template"); $query = "ALTER TABLE `glpi_computers` ADD `tplname` VARCHAR(200) DEFAULT NULL "; $DB->queryOrDie($query, "0.5 alter computers add tplname"); $query = "SELECT * FROM `glpi_templates`"; $result = $DB->query($query); while ($line = $DB->fetch_array($result)) { $line = Toolbox::addslashes_deep($line); $query2 = "INSERT INTO `glpi_computers` (`name`, `osver`, `processor_speed`, `serial`, `otherserial`, `ram`, `hdspace`, `contact`, `contact_num`, `comments`, `achat_date`, `date_fin_garantie`, `maintenance`, `os`, `hdtype`, `sndcard`, `moboard`, `gfxcard`, `network`, `ramtype`, `location`, `processor`, `type`, `is_template`, `tplname`)"; if (empty($line["location"])) { $line["location"] = 0; } $query2 .= " VALUES ('".$line["name"]."', '".$line["osver"]."', '".$line["processor_speed"]."', '".$line["serial"]."', '".$line["otherserial"]."', '".$line["ram"]."', '".$line ["hdspace"]."', '".$line["contact"]."', '".$line["contact_num"]."', '".$line["comments"]."', '".$line["achat_date"]."', '".$line["date_fin_garantie"]."', '".$line["maintenance"]."', '".$line["os"]."', '".$line["hdtype"]."', '".$line["sndcard"]."', '".$line["moboard"]."', '".$line["gfxcard"]."', '".$line["network"]."', '".$line["ramtype"]."', '".$line["location"]."', '".$line["processor"]."', '".$line["type"]."', '1', '".$line["templname"]."')"; $DB->queryOrDie($query2, "0.5-convert template 2 computers"); } $DB->free_result($result); $query = "DROP TABLE `glpi_templates`"; $DB->queryOrDie($query, "0.5 drop table templates"); $query = "SELECT `ID` FROM `glpi_computers` WHERE `tplname` = 'Blank Template'"; $result = $DB->query($query); if ($DB->numrows($result)==0) { $query = "INSERT INTO `glpi_computers` (`is_template`, `tplname`, `name`, `comment`, `contact`, `contact_num`, `serial`, `otherserial`) VALUES ('1', 'Blank Template', '', '', '', '', '', '')"; $DB->queryOrDie($query, "0.5 add blank template"); } $DB->free_result($result); } //New internal peripherals ( devices ) config if (!TableExists("glpi_computer_device")) { $query = "CREATE TABLE `glpi_computer_device` ( `ID` int(11) NOT NULL auto_increment, `specificity` varchar(250) NOT NULL default '', `device_type` tinyint(4) NOT NULL default '0', `FK_device` int(11) NOT NULL default '0', `FK_computers` int(11) NOT NULL default '0', PRIMARY KEY (`ID`), KEY (`device_type`), KEY (`device_type`,`FK_device`), KEY (`FK_computers`) ) TYPE=MyISAM;"; $DB->queryOrDie($query, "0.5 CREATE TABLE `glpi_computer_device`"); } if (!TableExists("glpi_device_gfxcard")) { $query = "CREATE TABLE `glpi_device_gfxcard` ( `ID` int(11) NOT NULL auto_increment, `designation` varchar(120) NOT NULL default '', `ram` varchar(10) NOT NULL default '', `interface` enum('AGP','PCI','PCI-X','Other') NOT NULL default 'AGP', `comment` text NOT NULL, `FK_glpi_enterprise` int(11) NOT NULL default '0', `specif_default` VARCHAR(250) NOT NULL, PRIMARY KEY (`ID`), KEY (`FK_glpi_enterprise`) ) TYPE=MyISAM;"; $DB->queryOrDie($query, "0.5 create table `glpi_device_gfxcard`"); compDpd2Device(GFX_DEVICE,"gfxcard","gfxcard","gfxcard"); } if (!TableExists("glpi_device_hdd")) { $query = "CREATE TABLE `glpi_device_hdd` ( `ID` int(11) NOT NULL auto_increment, `designation` varchar(100) NOT NULL default '', `rpm` varchar(20) NOT NULL default '', `interface` enum('IDE','SATA','SCSI') NOT NULL default 'IDE', `cache` varchar(20) NOT NULL default '', `comment` text NOT NULL, `FK_glpi_enterprise` int(11) NOT NULL default '0', `specif_default` VARCHAR(250) NOT NULL, PRIMARY KEY (`ID`), KEY (`FK_glpi_enterprise`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.5 CREATE TABLE `glpi_device_hdtype`"); compDpd2Device(HDD_DEVICE,"hdd","hdtype","hdtype","hdspace"); } if (!TableExists("glpi_device_iface")) { $query = "CREATE TABLE `glpi_device_iface` ( `ID` int(11) NOT NULL auto_increment, `designation` varchar(120) NOT NULL default '', `bandwidth` varchar(20) NOT NULL default '', `comment` text NOT NULL, `FK_glpi_enterprise` int(11) NOT NULL default '0', `specif_default` VARCHAR(250) NOT NULL, PRIMARY KEY (`ID`), KEY (`FK_glpi_enterprise`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.5- CREATE TABLE `glpi_device_iface`"); compDpd2Device(NETWORK_DEVICE,"iface","network","network"); } if (!TableExists("glpi_device_moboard")) { $query = "CREATE TABLE `glpi_device_moboard` ( `ID` int(11) NOT NULL auto_increment, `designation` varchar(100) NOT NULL default '', `chipset` varchar(120) NOT NULL default '', `comment` text NOT NULL, `FK_glpi_enterprise` int(11) NOT NULL default '0', `specif_default` VARCHAR(250) NOT NULL, PRIMARY KEY (`ID`), KEY (`FK_glpi_enterprise`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.5 CREATE TABLE `glpi_device_moboard`"); compDpd2Device(MOBOARD_DEVICE,"moboard","moboard","moboard"); } if (!TableExists("glpi_device_processor")) { $query = "CREATE TABLE `glpi_device_processor` ( `ID` int(11) NOT NULL auto_increment, `designation` varchar(120) NOT NULL default '', `frequence` int(11) NOT NULL default '0', `comment` text NOT NULL, `FK_glpi_enterprise` int(11) NOT NULL default '0', `specif_default` VARCHAR(250) NOT NULL, PRIMARY KEY (`ID`), KEY (`FK_glpi_enterprise`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.5 CREATE TABLE `glpi_device_processor`"); compDpd2Device(PROCESSOR_DEVICE,"processor","processor","processor","processor_speed"); } if (!TableExists("glpi_device_ram")) { $query = "CREATE TABLE `glpi_device_ram` ( `ID` int(11) NOT NULL auto_increment, `designation` varchar(100) NOT NULL default '', `type` enum('EDO','DDR','SDRAM','SDRAM-2') NOT NULL default 'EDO', `frequence` varchar(8) NOT NULL default '', `comment` text NOT NULL, `FK_glpi_enterprise` int(11) NOT NULL default '0', `specif_default` VARCHAR(250) NOT NULL, PRIMARY KEY (`ID`), KEY (`FK_glpi_enterprise`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.5 CREATE TABLE `glpi_device_ram`"); compDpd2Device(RAM_DEVICE,"ram","ram","ramtype","ram"); } if (!TableExists("glpi_device_sndcard")) { $query = "CREATE TABLE `glpi_device_sndcard` ( `ID` int(11) NOT NULL auto_increment, `designation` varchar(120) NOT NULL default '', `type` varchar(100) NOT NULL default '', `comment` text NOT NULL, `FK_glpi_enterprise` int(11) NOT NULL default '0', `specif_default` VARCHAR(250) NOT NULL, PRIMARY KEY (`ID`), KEY (`FK_glpi_enterprise`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.5 CREATE TABLE `glpi_device_sndcard"); compDpd2Device(SND_DEVICE,"sndcard","sndcard","sndcard"); } if (!TableExists("glpi_device_power")) { $query = "CREATE TABLE glpi_device_power ( `ID` int(11) NOT NULL auto_increment, `designation` VARCHAR(255) NOT NULL default '', `power` VARCHAR(20) NOT NULL default '', `atx` enum('Y','N') NOT NULL default 'Y', `comment` text NOT NULL, `FK_glpi_enterprise` int(11) NOT NULL default '0', `specif_default` VARCHAR(250) NOT NULL, PRIMARY KEY (`ID`), KEY FK_glpi_enterprise (`FK_glpi_enterprise`) ) TYPE=MyISAM"; $DB->queryOrDie($query); } if (!TableExists("glpi_device_case")) { $query = "CREATE TABLE glpi_device_case( `ID` int(11) NOT NULL AUTO_INCREMENT , `designation` VARCHAR(255) NOT NULL default '', `format` enum('Grand', 'Moyen', 'Micro') NOT NULL default 'Moyen', `comment` text NOT NULL , `FK_glpi_enterprise` int(11) NOT NULL default '0', `specif_default` VARCHAR(250) NOT NULL, PRIMARY KEY (`ID`) , KEY FK_glpi_enterprise(`FK_glpi_enterprise`) ) TYPE = MyISAM"; $DB->queryOrDie($query); } if (!TableExists("glpi_device_drive")) { $query = "CREATE TABLE `glpi_device_drive` ( `ID` INT NOT NULL AUTO_INCREMENT , `designation` VARCHAR(255) NOT NULL , `is_writer` ENUM('Y', 'N') DEFAULT 'Y' NOT NULL , `speed` VARCHAR(30) NOT NULL , `interface` ENUM('IDE', 'SATA', 'SCSI') NOT NULL , `comment` TEXT NOT NULL , `FK_glpi_enterprise` INT NOT NULL , `specif_default` VARCHAR(250) NOT NULL, KEY FK_glpi_enterprise(`FK_glpi_enterprise`), PRIMARY KEY (`ID`) ) TYPE=MyISAM"; $DB->queryOrDie($query); } if (!TableExists("glpi_device_pci")) { $query = "CREATE TABLE glpi_device_pci ( `ID` int(11) NOT NULL auto_increment, `designation` VARCHAR(255) NOT NULL default '', `comment` text NOT NULL, `FK_glpi_enterprise` int(11) NOT NULL default '0', `specif_default` VARCHAR(250) NOT NULL, PRIMARY KEY (`ID`), KEY FK_glpi_enterprise (`FK_glpi_enterprise`) ) TYPE=MyISAM"; $DB->queryOrDie($query); } if (!TableExists("glpi_device_control")) { $query = "CREATE TABLE glpi_device_control ( `ID` int(11) NOT NULL auto_increment, `designation` VARCHAR(255) NOT NULL default '', `interface` enum('IDE','SATA','SCSI','USB') NOT NULL default 'IDE', `raid` enum('Y','N') NOT NULL default 'Y', `comment` text NOT NULL, `FK_glpi_enterprise` int(11) NOT NULL default '0', `specif_default` VARCHAR(250) NOT NULL, PRIMARY KEY (`ID`), KEY FK_glpi_enterprise (`FK_glpi_enterprise`) ) TYPE=MyISAM"; $DB->queryOrDie($query); } // END new internal devices. if (!TableExists("glpi_enterprises")) { $query = "CREATE TABLE `glpi_enterprises` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(50) NOT NULL default '', `type` int(11) NOT NULL default '0', `address` text NOT NULL, `website` varchar(100) NOT NULL default '', `phonenumber` varchar(20) NOT NULL default '', `comments` text NOT NULL, `deleted` enum('Y','N') NOT NULL default 'N', PRIMARY KEY (`ID`), KEY `deleted` (`deleted`), KEY `type` (`type`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.5 CREATE TABLE `glpi_enterprise"); } /// Base connaissance if (!TableExists("glpi_dropdown_kbcategories")) { $query = "CREATE TABLE `glpi_dropdown_kbcategories` ( `ID` int(11) NOT NULL auto_increment, `parentID` int(11) NOT NULL default '0', `name` varchar(255) NOT NULL, PRIMARY KEY (`ID`), KEY (`parentID`), UNIQUE KEY (`parentID`, `name`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.5 CREATE TABLE `glpi_dropdown_kbcategories"); $query = "CREATE TABLE `glpi_kbitems` ( `ID` int(11) NOT NULL auto_increment, `categoryID` int(11) NOT NULL default '0', `question` text NOT NULL, `answer` text NOT NULL, `faq` enum('yes','no') NOT NULL default 'no', PRIMARY KEY (`ID`), KEY (`categoryID`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.5 CREATE TABLE `glpi_kbitems"); } // Comment reservation if (!FieldExists("glpi_reservation_resa","comment", false)) { $query = "ALTER TABLE `glpi_reservation_resa` ADD `comment` VARCHAR(255) NOT NULL "; $DB->queryOrDie($query, "0.5 alter reservation add comment"); } // Tracking categorie if (!TableExists("glpi_dropdown_tracking_category")) { $query = "CREATE TABLE `glpi_dropdown_tracking_category` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) default NULL, PRIMARY KEY (`ID`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.5 CREATE TABLE `glpi_dropdown_tracking_category"); } if (!FieldExists("glpi_tracking","category", false)) { $query= "ALTER TABLE `glpi_tracking` ADD `category` INT(11) "; $DB->queryOrDie($query, "0.5 alter tracking add categorie"); } // Nouvelle gestion des software et licenses if (!FieldExists("glpi_licenses","oem", false)) { $query = "ALTER TABLE `glpi_licenses` ADD `oem` ENUM('N', 'Y') DEFAULT 'N' NOT NULL , ADD `oem_computer` INT(11) NOT NULL, ADD `buy` ENUM('Y', 'N') DEFAULT 'Y' NOT NULL"; $DB->queryOrDie($query, "0.5 alter licenses add oem + buy"); $query = "ALTER TABLE `glpi_software` ADD `is_update` ENUM('N', 'Y') DEFAULT 'N' NOT NULL , ADD `update_software` INT(11) NOT NULL DEFAULT '-1'"; $DB->queryOrDie($query, "0.5 alter software add update"); } // Couleur pour les priorites if (!FieldExists("glpi_config","priority_1", false)) { $query = "ALTER TABLE `glpi_config` ADD `priority_1` VARCHAR(200) DEFAULT '#fff2f2' NOT NULL, ADD `priority_2` VARCHAR(200) DEFAULT '#ffe0e0' NOT NULL, ADD `priority_3` VARCHAR(200) DEFAULT '#ffcece' NOT NULL, ADD `priority_4` VARCHAR(200) DEFAULT '#ffbfbf' NOT NULL, ADD `priority_5` VARCHAR(200) DEFAULT '#ffadad' NOT NULL "; $DB->queryOrDie($query, "0.5 alter config add priority_X"); } // Gestion des cartouches if (!TableExists("glpi_cartridges")) { $query = "CREATE TABLE `glpi_cartridges` ( `ID` int(11) NOT NULL auto_increment, `FK_glpi_cartridges_type` int(11) NOT NULL default '0', `FK_glpi_printers` int(11) NOT NULL default '0', `date_in` date default NULL, `date_use` date default NULL, `date_out` date default NULL, `pages` int(11) NOT NULL default '0', PRIMARY KEY (`ID`), KEY (`FK_glpi_cartridges_type`), KEY (`FK_glpi_printers`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.5 CREATE TABLE glpi_cartridges"); $query = "CREATE TABLE `glpi_cartridges_type` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', `ref` varchar(255) NOT NULL default '', `location` int(11) NOT NULL default '0', `type` tinyint(4) NOT NULL default '0', `FK_glpi_enterprise` int(11) NOT NULL default '0', `tech_num` int(11) default '0', `deleted` enum('Y','N') NOT NULL default 'N', `comments` text NOT NULL, PRIMARY KEY (`ID`), KEY (`FK_glpi_enterprise`), KEY (`tech_num`), KEY (`deleted`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.5 CREATE TABLE glpi_cartridges_type"); $query = "CREATE TABLE `glpi_cartridges_assoc` ( `ID` int(11) NOT NULL auto_increment, `FK_glpi_cartridges_type` int(11) NOT NULL default '0', `FK_glpi_type_printer` int(11) NOT NULL default '0', PRIMARY KEY (`ID`), UNIQUE KEY `FK_glpi_type_printer` (`FK_glpi_type_printer`,`FK_glpi_cartridges_type`), KEY (`FK_glpi_cartridges_type`), KEY (`FK_glpi_type_printer`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.5 CREATE TABLE glpi_cartridges_assoc"); } //// DEBUT INSERTION PARTIE GESTION if (!TableExists("glpi_contracts")) { $query = "CREATE TABLE `glpi_contacts` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', `phone` varchar(30) NOT NULL default '', `phone2` varchar(30) NOT NULL default '', `fax` varchar(30) NOT NULL default '', `email` varchar(255) NOT NULL default '', `type` tinyint(4) NOT NULL default '1', `comments` text NOT NULL, `deleted` enum('Y','N') NOT NULL default 'N', PRIMARY KEY (`ID`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.5 CREATE TABLE glpi_contact"); $query = "CREATE TABLE `glpi_dropdown_enttype` ( `ID` INT NOT NULL AUTO_INCREMENT , `name` VARCHAR(255) NOT NULL , PRIMARY KEY (`ID`) )"; $DB->queryOrDie($query, "23"); $query = "CREATE TABLE `glpi_contact_enterprise` ( `ID` int(11) NOT NULL auto_increment, `FK_enterprise` int(11) NOT NULL default '0', `FK_contact` int(11) NOT NULL default '0', PRIMARY KEY (`ID`), UNIQUE KEY `FK_enterprise` (`FK_enterprise`,`FK_contact`), KEY (`FK_enterprise`), KEY (`FK_contact`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.5 CREATE TABLE glpi_contact_enterprise"); $query = "CREATE TABLE `glpi_contracts` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', `num` varchar(255) NOT NULL default '', `cost` float NOT NULL default '0', `contract_type` int(11) NOT NULL default '0', `begin_date` date default NULL, `duration` tinyint(4) NOT NULL default '0', `notice` tinyint(4) NOT NULL default '0', `periodicity` tinyint(4) NOT NULL default '0', `facturation` tinyint(4) NOT NULL default '0', `bill_type` int(11) NOT NULL default '0', `comments` text NOT NULL, `compta_num` varchar(255) NOT NULL default '', `deleted` enum('Y','N') NOT NULL default 'N', `week_begin_hour` time NOT NULL default '00:00:00', `week_end_hour` time NOT NULL default '00:00:00', `saturday_begin_hour` time NOT NULL default '00:00:00', `saturday_end_hour` time NOT NULL default '00:00:00', `saturday` enum('Y','N') NOT NULL default 'N', `monday_begin_hour` time NOT NULL default '00:00:00', `monday_end_hour` time NOT NULL default '00:00:00', `monday` enum('Y','N') NOT NULL default 'N', PRIMARY KEY (`ID`), KEY `contract_type` (`contract_type`), KEY `begin_date` (`begin_date`), KEY `bill_type` (`bill_type`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.5 CREATE TABLE glpi_contract"); $query = "CREATE TABLE `glpi_contract_device` ( `ID` int(11) NOT NULL auto_increment, `FK_contract` int(11) NOT NULL default '0', `FK_device` int(11) NOT NULL default '0', `device_type` tinyint(4) NOT NULL default '0', PRIMARY KEY (`ID`), UNIQUE KEY `FK_contract` (`FK_contract`,`FK_device`,`device_type`), KEY (`FK_contract`), KEY (`FK_device`,`device_type`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.5 CREATE TABLE glpi_contract_device"); $query = "CREATE TABLE `glpi_contract_enterprise` ( `ID` int(11) NOT NULL auto_increment, `FK_enterprise` int(11) NOT NULL default '0', `FK_contract` int(11) NOT NULL default '0', PRIMARY KEY (`ID`), UNIQUE KEY `FK_enterprise` (`FK_enterprise`,`FK_contract`), KEY (`FK_enterprise`), KEY (`FK_contract`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.5 CREATE TABLE glpi_contrat_enterprise"); $query = "CREATE TABLE `glpi_infocoms` ( `ID` int(11) NOT NULL auto_increment, `FK_device` int(11) NOT NULL default '0', `device_type` tinyint(4) NOT NULL default '0', `buy_date` date NOT NULL default '0000-00-00', `use_date` date NOT NULL default '0000-00-00', `warranty_duration` tinyint(4) NOT NULL default '0', `warranty_info` varchar(255) NOT NULL default '', `FK_enterprise` int(11) default NULL, `num_commande` varchar(50) NOT NULL default '', `bon_livraison` varchar(50) NOT NULL default '', `num_immo` varchar(50) NOT NULL default '', `value` float NOT NULL default '0', `warranty_value` float default NULL, `amort_time` tinyint(4) NOT NULL default '0', `amort_type` varchar(20) NOT NULL default '', `amort_coeff` float NOT NULL default '0', `comments` text NOT NULL, PRIMARY KEY (`ID`), UNIQUE KEY `FK_device` (`FK_device`,`device_type`), KEY `FK_enterprise` (`FK_enterprise`), KEY `buy_date` (`buy_date`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.5 CREATE TABLE glpi_infocom"); ///// Move warranty infos from item to infocoms. // Update Warranty Infos updateWarrantyInfos("glpi_computers", COMPUTER_TYPE); updateWarrantyInfos("glpi_printers", PRINTER_TYPE); updateWarrantyInfos("glpi_networking", NETWORKING_TYPE); updateWarrantyInfos("glpi_monitors", MONITOR_TYPE); updateWarrantyInfos("glpi_peripherals", PERIPHERAL_TYPE); // Update Maintenance Infos if (isMaintenanceUsed()) { $query = "INSERT INTO `glpi_contracts` VALUES (1, 'Maintenance', '', '0', 5, '2005-01-01', 120, 0, 0, 0, 0, '', '', 'N', '00:00:00', '00:00:00', '00:00:00', '00:00:00', 'N', '00:00:00', '00:00:00', 'N')"; $result = $DB->queryOrDie($query, "0.5 insert_init for update maintenace"); if ($result) { $query = "SELECT `ID` FROM `glpi_contracts`"; $result = $DB->queryOrDie($query, "0.5 select_init for update maintenace"); if ($result) { $data = $DB->fetch_array($result); $IDcontract = $data["ID"]; updateMaintenanceInfos("glpi_computers", COMPUTER_TYPE, $IDcontract); updateMaintenanceInfos("glpi_printers", PRINTER_TYPE, $IDcontract); updateMaintenanceInfos("glpi_networking", NETWORKING_TYPE, $IDcontract); updateMaintenanceInfos("glpi_monitors", MONITOR_TYPE, $IDcontract); updateMaintenanceInfos("glpi_peripherals", PERIPHERAL_TYPE, $IDcontract); } } } else { dropMaintenanceField(); } } //// FIN INSERTION PARTIE GESTION // Merge de l'OS et de la version if (FieldExists("glpi_computers","osver", false)) { // Recuperation des couples existants $query = "SELECT DISTINCT `glpi_computers`.`os` AS ID , `glpi_computers`.`osver` AS VERS, `glpi_dropdown_os`.`name` AS NAME FROM `glpi_computers` LEFT JOIN `glpi_dropdown_os` ON `glpi_dropdown_os`.`ID` = `glpi_computers`.`os` ORDER BY `glpi_computers`.`os`, `glpi_computers`.`osver`"; $result = $DB->queryOrDie($query, "0.5 select for update OS"); $valeur = array(); $curros = -1; $currvers = "-------------------------"; while ($data=$DB->fetch_array($result)) { // Nouvel OS -> update de l'element de dropdown if ($data["ID"]!=$curros) { $curros = $data["ID"]; if (!empty($data["VERS"])) { $query_update = "UPDATE `glpi_dropdown_os` SET `name` = '".$data["NAME"]." - ".$data["VERS"]."' WHERE `ID` = '".$data["ID"]."'"; $DB->queryOrDie($query_update, "0.5 update for update OS"); } } else { // OS deja mis a jour -> creation d'un nouvel OS et mise a jour des elements $newname = $data["NAME"]." - ".$data["VERS"]; $query_insert = "INSERT INTO `glpi_dropdown_os` (`name`) VALUES ('$newname')"; $DB->queryOrDie($query_insert, "0.5 insert for update OS"); $query_select = "SELECT `ID` FROM `glpi_dropdown_os` WHERE `name` = '$newname'"; $res = $DB->queryOrDie($query_select, "0.5 select for update OS"); if ($DB->numrows($res)==1) { $query_update = "UPDATE `glpi_computers` SET `os` . ='".$DB->result($res,0,"ID")."' WHERE `os` = '".$data["ID"]."' AND `osver` = '".$data["VERS"]."'"; $DB->queryOrDie($query_update, "0.5 update2 for update OS"); } } } $DB->free_result($result); $query_alter = "ALTER TABLE `glpi_computers` DROP `osver` "; $DB->queryOrDie($query_alter, "0.5 alter for update OS"); } // Ajout Fabriquant computer if (!FieldExists("glpi_computers","FK_glpi_enterprise", false)) { $query = "ALTER TABLE `glpi_computers` ADD `FK_glpi_enterprise` INT(11) DEFAULT '0' NOT NULL "; $DB->queryOrDie($query, "0.5 add field manufacturer"); $query = "ALTER TABLE `glpi_computers` ADD INDEX (`FK_glpi_enterprise`)" ; $DB->queryOrDie($query, "0.5 alter field manufacturer"); } // Ajout Fabriquant printer if (!FieldExists("glpi_printers","FK_glpi_enterprise", false)) { $query = "ALTER TABLE `glpi_printers` ADD `FK_glpi_enterprise` INT(11) DEFAULT '0' NOT NULL "; $DB->queryOrDie($query, "0.5 add field manufacturer"); $query = "ALTER TABLE `glpi_printers` ADD INDEX (`FK_glpi_enterprise`)" ; $DB->queryOrDie($query, "0.5 alter field manufacturer"); } // Ajout Fabriquant networking if (!FieldExists("glpi_networking","FK_glpi_enterprise", false)) { $query = "ALTER TABLE `glpi_networking` ADD `FK_glpi_enterprise` INT(11) DEFAULT '0' NOT NULL "; $DB->queryOrDie($query, "0.5 add field manufacturer"); $query = "ALTER TABLE `glpi_networking` ADD INDEX (`FK_glpi_enterprise`)" ; $DB->queryOrDie($query, "0.5 alter field manufacturer"); } // Ajout Fabriquant monitor if (!FieldExists("glpi_monitors","FK_glpi_enterprise", false)) { $query = "ALTER TABLE `glpi_monitors` ADD `FK_glpi_enterprise` INT(11) DEFAULT '0' NOT NULL "; $DB->queryOrDie($query, "0.5 add field manufacturer"); $query = "ALTER TABLE `glpi_monitors` ADD INDEX (`FK_glpi_enterprise`)" ; $DB->queryOrDie($query, "0.5 alter field manufacturer"); } // Ajout Fabriquant software if (!FieldExists("glpi_software","FK_glpi_enterprise", false)) { $query = "ALTER TABLE `glpi_software` ADD `FK_glpi_enterprise` INT(11) DEFAULT '0' NOT NULL "; $DB->queryOrDie($query, "0.5 add field manufacturer"); $query = "ALTER TABLE `glpi_software` ADD INDEX (`FK_glpi_enterprise`)" ; $DB->queryOrDie($query, "0.5 alter field manufacturer"); } // Ajout Fabriquant peripheral if (!FieldExists("glpi_peripherals","FK_glpi_enterprise", false)) { $query = "ALTER TABLE `glpi_peripherals` ADD `FK_glpi_enterprise` INT(11) DEFAULT '0' NOT NULL "; $DB->queryOrDie($query, "0.5 add field manufacturer"); $query = "ALTER TABLE `glpi_peripherals` ADD INDEX (`FK_glpi_enterprise`)" ; $DB->queryOrDie($query, "0.5 alter field manufacturer"); } // Ajout deleted peripheral if (!FieldExists("glpi_peripherals","deleted", false)) { $query = "ALTER TABLE `glpi_peripherals` ADD `deleted` ENUM('Y', 'N') DEFAULT 'N' NOT NULL "; $DB->queryOrDie($query, "0.5 add field deleted"); $query = "ALTER TABLE `glpi_peripherals` ADD INDEX (`deleted`)" ; $DB->queryOrDie($query, "0.5 alter field deleted"); } // Ajout deleted software if (!FieldExists("glpi_software","deleted", false)) { $query = "ALTER TABLE `glpi_software` ADD `deleted` ENUM('Y', 'N') DEFAULT 'N' NOT NULL "; $DB->queryOrDie($query, "0.5 add field deleted"); $query = "ALTER TABLE `glpi_software` ADD INDEX (`deleted`)" ; $DB->queryOrDie($query, "0.5 alter field deleted"); } // Ajout deleted monitor if (!FieldExists("glpi_monitors","deleted", false)) { $query = "ALTER TABLE `glpi_monitors` ADD `deleted` ENUM('Y', 'N') DEFAULT 'N' NOT NULL "; $DB->queryOrDie($query, "0.5 add field deleted"); $query = "ALTER TABLE `glpi_monitors` ADD INDEX (`deleted`)" ; $DB->queryOrDie($query, "0.5 alter field deleted"); } // Ajout deleted networking if (!FieldExists("glpi_networking","deleted", false)) { $query = "ALTER TABLE `glpi_networking` ADD `deleted` ENUM('Y', 'N') DEFAULT 'N' NOT NULL "; $DB->queryOrDie($query, "0.5 add field deleted"); $query = "ALTER TABLE `glpi_networking` ADD INDEX (`deleted`)" ; $DB->queryOrDie($query, "0.5 alter field deleted"); } // Ajout deleted printer if (!FieldExists("glpi_printers","deleted", false)) { $query = "ALTER TABLE `glpi_printers` ADD `deleted` ENUM('Y', 'N') DEFAULT 'N' NOT NULL "; $DB->queryOrDie($query, "0.5 add field deleted"); $query = "ALTER TABLE `glpi_printers` ADD INDEX (`deleted`)" ; $DB->queryOrDie($query, "0.5 alter field deleted"); } // Ajout deleted computer if (!FieldExists("glpi_computers","deleted", false)) { $query = "ALTER TABLE `glpi_computers` ADD `deleted` ENUM('Y', 'N') DEFAULT 'N' NOT NULL "; $DB->queryOrDie($query, "0.5 add field deleted"); $query = "ALTER TABLE `glpi_computers` ADD INDEX (`deleted`)" ; $DB->queryOrDie($query, "0.5 alter field deleted"); } // Ajout template peripheral if (!FieldExists("glpi_peripherals","is_template", false)) { $query = "ALTER TABLE `glpi_peripherals` ADD `is_template` ENUM('0', '1') DEFAULT '0' NOT NULL , ADD `tplname` VARCHAR(255) "; $DB->queryOrDie($query, "0.5 add field deleted"); $query = "INSERT INTO `glpi_peripherals` (`is_template`, `tplname`, `name`, `contact`, `contact_num`, `comments`, `serial`, `otherserial`, `brand`) VALUES ('1', 'Blank Template', '', '', '', '', '', '', '')"; $DB->queryOrDie($query, "0.5 add blank template"); $query = "ALTER TABLE `glpi_peripherals` ADD INDEX (`is_template`)" ; $DB->queryOrDie($query, "0.5 alter field is_template"); } // Ajout template software if (!FieldExists("glpi_software","is_template", false)) { $query = "ALTER TABLE `glpi_software` ADD `is_template` ENUM('0', '1') DEFAULT '0' NOT NULL , ADD `tplname` VARCHAR(255) "; $DB->queryOrDie($query, "0.5 add field deleted"); $query = "INSERT INTO `glpi_software` (`is_template`, `tplname`, `name`, `comments`, `version`) VALUES ('1', 'Blank Template', '', '', '')"; $DB->queryOrDie($query, "0.5 add blank template"); $query = "ALTER TABLE `glpi_software` ADD INDEX (`is_template`)" ; $DB->queryOrDie($query, "0.5 alter field is_template"); } // Ajout template monitor if (!FieldExists("glpi_monitors","is_template", false)) { $query = "ALTER TABLE `glpi_monitors` ADD `is_template` ENUM('0', '1') DEFAULT '0' NOT NULL , ADD `tplname` VARCHAR(255) "; $DB->queryOrDie($query, "0.5 add field deleted"); $query = "INSERT INTO `glpi_monitors` (`is_template`, `tplname`, `name`, `contact`, `contact_num`, `comments`, `serial`, `otherserial`) VALUES ('1', 'Blank Template', '', '', '', '', '', '')"; $DB->queryOrDie($query, "0.5 add blank template"); $query = "ALTER TABLE `glpi_monitors` ADD INDEX (`is_template`)" ; $DB->queryOrDie($query, "0.5 alter field is_template"); } if (!isIndex("glpi_computers", "is_template")) { $query = "ALTER TABLE `glpi_computers` ADD INDEX (`is_template`) "; $DB->queryOrDie($query, "5"); } // Ajout template networking if (!FieldExists("glpi_networking","is_template", false)) { $query = "ALTER TABLE `glpi_networking` ADD `is_template` ENUM('0', '1') DEFAULT '0' NOT NULL , ADD `tplname` VARCHAR(255) "; $DB->queryOrDie($query, "0.5 add field deleted"); $query = "INSERT INTO `glpi_networking` (`is_template`, `tplname`, `name`, `contact`, `contact_num`, `comments`, `ram`, `otherserial`, `serial`) VALUES ('1', 'Blank Template', '', '', '', '', '', '', '')"; $DB->queryOrDie($query, "0.5 add blank template"); $query = "ALTER TABLE `glpi_networking` ADD INDEX (`is_template`)" ; $DB->queryOrDie($query, "0.5 alter field is_template"); } // Ajout template printer if (!FieldExists("glpi_printers","is_template", false)) { $query = "ALTER TABLE `glpi_printers` ADD `is_template` ENUM('0', '1') DEFAULT '0' NOT NULL , ADD `tplname` VARCHAR(255) "; $DB->queryOrDie($query, "0.5 add field deleted"); $query = "INSERT INTO `glpi_printers` (`is_template`, `tplname`, `name`, `contact`, `contact_num`, `comments`, `serial`, `otherserial`, `ramSize`) VALUES ('1', 'Blank Template', '', '', '', '', '', '', '')"; $DB->queryOrDie($query, "0.5 add blank template"); $query = "ALTER TABLE `glpi_printers` ADD INDEX (`is_template`)" ; $DB->queryOrDie($query, "0.5 alter field is_template"); } // Ajout date_mod if (!FieldExists("glpi_printers","date_mod", false)) { $query = "ALTER TABLE `glpi_printers` ADD `date_mod` DATETIME DEFAULT NULL"; $DB->queryOrDie($query); $query = "ALTER TABLE `glpi_printers` ADD INDEX (`date_mod`)" ; $DB->queryOrDie($query, "0.5 alter field date_mod"); } if (!isIndex("glpi_computers", "date_mod")) { $query = "ALTER TABLE `glpi_computers` ADD INDEX (`date_mod`) "; $DB->queryOrDie($query, "5"); } // Ajout date_mod if (!FieldExists("glpi_monitors","date_mod", false)) { $query = "ALTER TABLE `glpi_monitors` ADD `date_mod` DATETIME DEFAULT NULL"; $DB->queryOrDie($query); $query = "ALTER TABLE `glpi_monitors` ADD INDEX (`date_mod`)" ; $DB->queryOrDie($query, "0.5 alter field date_mod"); } // Ajout date_mod if (!FieldExists("glpi_software","date_mod", false)) { $query = "ALTER TABLE `glpi_software` ADD `date_mod` DATETIME DEFAULT NULL"; $DB->queryOrDie($query); $query = "ALTER TABLE `glpi_software` ADD INDEX (`date_mod`)" ; $DB->queryOrDie($query, "0.5 alter field date_mod"); } // Ajout date_mod if (!FieldExists("glpi_networking","date_mod", false)) { $query = "ALTER TABLE `glpi_networking` ADD `date_mod` DATETIME DEFAULT NULL"; $DB->queryOrDie($query); $query = "ALTER TABLE `glpi_networking` ADD INDEX (`date_mod`)" ; $DB->queryOrDie($query, "0.5 alter field date_mod"); } // Ajout tech_num if (!FieldExists("glpi_computers","tech_num", false)) { $query = "ALTER TABLE `glpi_computers` ADD `tech_num` int(11) NOT NULL default '0' AFTER `contact_num`"; $DB->queryOrDie($query); $query = "ALTER TABLE `glpi_computers` ADD INDEX (`tech_num`)" ; $DB->queryOrDie($query, "0.5 alter field tech_num"); } // Ajout tech_num if (!FieldExists("glpi_networking","tech_num", false)) { $query = "ALTER TABLE `glpi_networking` ADD `tech_num` int(11) NOT NULL default '0' AFTER `contact_num`"; $DB->queryOrDie($query); $query = "ALTER TABLE `glpi_networking` ADD INDEX (`tech_num`)" ; $DB->queryOrDie($query, "0.5 alter field tech_num"); } // Ajout tech_num if (!FieldExists("glpi_printers","tech_num", false)) { $query = "ALTER TABLE `glpi_printers` ADD `tech_num` int(11) NOT NULL default '0' AFTER `contact_num`"; $DB->queryOrDie($query); $query = "ALTER TABLE `glpi_printers` ADD INDEX (`tech_num`)" ; $DB->queryOrDie($query, "0.5 alter field tech_num"); } // Ajout tech_num if (!FieldExists("glpi_monitors","tech_num", false)) { $query = "ALTER TABLE `glpi_monitors` ADD `tech_num` int(11) NOT NULL default '0' AFTER `contact_num`"; $DB->queryOrDie($query); $query = "ALTER TABLE `glpi_monitors` ADD INDEX (`tech_num`)" ; $DB->queryOrDie($query, "0.5 alter field tech_num"); } // Ajout tech_num if (!FieldExists("glpi_software","tech_num", false)) { $query = "ALTER TABLE `glpi_software` ADD `tech_num` int(11) NOT NULL default '0' AFTER `location`"; $DB->queryOrDie($query); $query = "ALTER TABLE `glpi_software` ADD INDEX (`tech_num`)" ; $DB->queryOrDie($query, "0.5 alter field tech_num"); } // Ajout tech_num if (!FieldExists("glpi_peripherals","tech_num", false)) { $query = "ALTER TABLE `glpi_peripherals` ADD `tech_num` int(11) NOT NULL default '0' AFTER `contact_num`"; $DB->queryOrDie($query); $query = "ALTER TABLE `glpi_peripherals` ADD INDEX (`tech_num`)" ; $DB->queryOrDie($query, "0.5 alter field tech_num"); } // Ajout tech_num if (!FieldExists("glpi_software","tech_num", false)) { $query = "ALTER TABLE `glpi_software` ADD `tech_num` int(11) NOT NULL default '0'"; $DB->queryOrDie($query); $query = "ALTER TABLE `glpi_software` ADD INDEX (`tech_num`)" ; $DB->queryOrDie($query, "0.5 alter field tech_num"); } // Ajout tech_num if (!TableExists("glpi_type_docs")) { $query = "CREATE TABLE glpi_type_docs ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', `ext` varchar(10) NOT NULL default '', `icon` varchar(255) NOT NULL default '', `mime` varchar(100) NOT NULL default '', `upload` enum('Y','N') NOT NULL default 'Y', `date_mod` datetime default NULL, PRIMARY KEY (`ID`), UNIQUE KEY `extension` (`ext`), KEY (`upload`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "Error creating table typedoc"); $query = "INSERT INTO `glpi_type_docs` (`ID`, `name`, `ext`, `icon`, `mime`, `upload`, `date_mod`) VALUES (1, 'JPEG', 'jpg', 'jpg-dist.png', '', 'Y', '2004-12-13 19:47:21'), (2, 'PNG', 'png', 'png-dist.png', '', 'Y', '2004-12-13 19:47:21'), (3, 'GIF', 'gif', 'gif-dist.png', '', 'Y', '2004-12-13 19:47:21'), (4, 'BMP', 'bmp', 'bmp-dist.png', '', 'Y', '2004-12-13 19:47:21'), (5, 'Photoshop', 'psd', 'psd-dist.png', '', 'Y', '2004-12-13 19:47:21'), (6, 'TIFF', 'tif', 'tif-dist.png', '', 'Y', '2004-12-13 19:47:21'), (7, 'AIFF', 'aiff', 'aiff-dist.png', '', 'Y', '2004-12-13 19:47:21'), (8, 'Windows Media', 'asf', 'asf-dist.png', '', 'Y', '2004-12-13 19:47:21'), (9, 'Windows Media', 'avi', 'avi-dist.png', '', 'Y', '2004-12-13 19:47:21'), (44, 'C source', 'c', '', '', 'Y', '2004-12-13 19:47:22'), (27, 'RealAudio', 'rm', 'rm-dist.png', '', 'Y', '2004-12-13 19:47:21'), (16, 'Midi', 'mid', 'mid-dist.png', '', 'Y', '2004-12-13 19:47:21'), (17, 'QuickTime', 'mov', 'mov-dist.png', '', 'Y', '2004-12-13 19:47:21'), (18, 'MP3', 'mp3', 'mp3-dist.png', '', 'Y', '2004-12-13 19:47:21'), (19, 'MPEG', 'mpg', 'mpg-dist.png', '', 'Y', '2004-12-13 19:47:21'), (20, 'Ogg Vorbis', 'ogg', 'ogg-dist.png', '', 'Y', '2004-12-13 19:47:21'), (24, 'QuickTime', 'qt', 'qt-dist.png', '', 'Y', '2004-12-13 19:47:21'), (10, 'BZip', 'bz2', 'bz2-dist.png', '', 'Y', '2004-12-13 19:47:21'), (25, 'RealAudio', 'ra', 'ra-dist.png', '', 'Y', '2004-12-13 19:47:21'), (26, 'RealAudio', 'ram', 'ram-dist.png', '', 'Y', '2004-12-13 19:47:21'), (11, 'Word', 'doc', 'doc-dist.png', '', 'Y', '2004-12-13 19:47:21'), (12, 'DjVu', 'djvu', '', '', 'Y', '2004-12-13 19:47:21'), (42, 'MNG', 'mng', '', '', 'Y', '2004-12-13 19:47:22'), (13, 'PostScript', 'eps', 'ps-dist.png', '', 'Y', '2004-12-13 19:47:21'), (14, 'GZ', 'gz', 'gz-dist.png', '', 'Y', '2004-12-13 19:47:21'), (37, 'WAV', 'wav', 'wav-dist.png', '', 'Y', '2004-12-13 19:47:22'), (15, 'HTML', 'html', 'html-dist.png', '', 'Y', '2004-12-13 19:47:21'), (34, 'Flash', 'swf', '', '', 'Y', '2004-12-13 19:47:22'), (21, 'PDF', 'pdf', 'pdf-dist.png', '', 'Y', '2004-12-13 19:47:21'), (22, 'PowerPoint', 'ppt', 'ppt-dist.png', '', 'Y', '2004-12-13 19:47:21'), (23, 'PostScript', 'ps', 'ps-dist.png', '', 'Y', '2004-12-13 19:47:21'), (40, 'Windows Media', 'wmv', '', '', 'Y', '2004-12-13 19:47:22'), (28, 'RTF', 'rtf', 'rtf-dist.png', '', 'Y', '2004-12-13 19:47:21'), (29, 'StarOffice', 'sdd', 'sdd-dist.png', '', 'Y', '2004-12-13 19:47:22'), (30, 'StarOffice', 'sdw', 'sdw-dist.png', '', 'Y', '2004-12-13 19:47:22'), (31, 'Stuffit', 'sit', 'sit-dist.png', '', 'Y', '2004-12-13 19:47:22'), (43, 'Adobe Illustrator', 'ai', 'ai-dist.png', '', 'Y', '2004-12-13 19:47:22'), (32, 'OpenOffice Impress', 'sxi', 'sxi-dist.png', '', 'Y', '2004-12-13 19:47:22'), (33, 'OpenOffice', 'sxw', 'sxw-dist.png', '', 'Y', '2004-12-13 19:47:22'), (46, 'DVI', 'dvi', 'dvi-dist.png', '', 'Y', '2004-12-13 19:47:22'), (35, 'TGZ', 'tgz', 'tgz-dist.png', '', 'Y', '2004-12-13 19:47:22'), (36, 'texte', 'txt', 'txt-dist.png', '', 'Y', '2004-12-13 19:47:22'), (49, 'RedHat/Mandrake/SuSE', 'rpm', 'rpm-dist.png', '', 'Y', '2004-12-13 19:47:22'), (38, 'Excel', 'xls', 'xls-dist.png', '', 'Y', '2004-12-13 19:47:22'), (39, 'XML', 'xml', 'xml-dist.png', '', 'Y', '2004-12-13 19:47:22'), (41, 'Zip', 'zip', 'zip-dist.png', '', 'Y', '2004-12-13 19:47:22'), (45, 'Debian', 'deb', 'deb-dist.png', '', 'Y', '2004-12-13 19:47:22'), (47, 'C header', 'h', '', '', 'Y', '2004-12-13 19:47:22'), (48, 'Pascal', 'pas', '', '', 'Y', '2004-12-13 19:47:22'), (50, 'OpenOffice Calc', 'sxc', 'sxc-dist.png', '', 'Y', '2004-12-13 19:47:22'), (51, 'LaTeX', 'tex', 'tex-dist.png', '', 'Y', '2004-12-13 19:47:22'), (52, 'GIMP multi-layer', 'xcf', 'xcf-dist.png', '', 'Y', '2004-12-13 19:47:22'), (53, 'JPEG', 'jpeg', 'jpg-dist.png', '', 'Y', '2005-03-07 22:23:17')"; $DB->queryOrDie($query, "Error inserting elements in table typedoc"); } if (!TableExists("glpi_docs")) { $query = "CREATE TABLE `glpi_docs` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', `filename` varchar(255) NOT NULL default '', `rubrique` int(11) NOT NULL default '0', `mime` varchar(30) NOT NULL default '', `date_mod` datetime NOT NULL default '0000-00-00 00:00:00', `comment` text NOT NULL, `deleted` enum('Y','N') NOT NULL default 'N', PRIMARY KEY (`ID`), KEY `rubrique` (`rubrique`), KEY `deleted` (`deleted`), KEY `date_mod` (`date_mod`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "Error creating table docs"); } if (!TableExists("glpi_doc_device")) { $query = "CREATE TABLE `glpi_doc_device` ( `ID` int(11) NOT NULL auto_increment, `FK_doc` int(11) NOT NULL default '0', `FK_device` int(11) NOT NULL default '0', `device_type` tinyint(4) NOT NULL default '0', PRIMARY KEY (`ID`), UNIQUE KEY `FK_doc` (`FK_doc`,`FK_device`,`device_type`), KEY FK_`doc_2` (`FK_doc`), KEY FK_`device` (`FK_device`,`device_type`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "Error creating table docs"); } if (!TableExists("glpi_dropdown_rubdocs")) { $query = "CREATE TABLE `glpi_dropdown_rubdocs` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) default NULL, PRIMARY KEY (`ID`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "Error creating table docs"); } if (!isIndex("glpi_contacts", "deleted")) { $query = "ALTER TABLE `glpi_contacts` ADD INDEX `deleted` (`deleted`) "; $DB->queryOrDie($query, "0.5 alter field deleted"); } if (!isIndex("glpi_contacts", "type")) { $query = "ALTER TABLE `glpi_contacts` ADD INDEX `type` (`type`) "; $DB->queryOrDie($query, "0.5 alter field type"); } if (!isIndex("glpi_event_log", "itemtype")) { $query = "ALTER TABLE `glpi_event_log` ADD INDEX (`itemtype`) "; $DB->queryOrDie($query, "0.5 alter field itemtype"); } if (!isIndex("glpi_followups", "date")) { $query = "ALTER TABLE `glpi_followups` ADD INDEX (`date`) "; $DB->queryOrDie($query, "0.5 alter field date"); } if (!isIndex("glpi_tracking", "category")) { $query = "ALTER TABLE `glpi_tracking` ADD INDEX (`category`) "; $DB->queryOrDie($query, "0.5 alter field category"); } if (!FieldExists("glpi_config","date_fiscale", false)) { $query = "ALTER TABLE `glpi_config` ADD `date_fiscale` date NOT NULL default '2005-12-31'"; $DB->queryOrDie($query, "0.5 add field date_fiscale"); } if (!FieldExists("glpi_networking","ifmac", false)) { $query = "ALTER TABLE `glpi_networking` ADD `ifmac` char(30) NOT NULL default ''"; $DB->queryOrDie($query, "0.5 add field ifmac"); } if (!FieldExists("glpi_networking","ifaddr", false)) { $query = "ALTER TABLE `glpi_networking` ADD `ifaddr` char(30) NOT NULL default ''"; $DB->queryOrDie($query, "0.5 add field ifaddr"); } if (!TableExists("glpi_repair_item")) { $query = "CREATE TABLE `glpi_repair_item` ( `ID` int(11) NOT NULL auto_increment, `device_type` tinyint(4) NOT NULL default '0', `id_device` int(11) NOT NULL default '0', PRIMARY KEY (`ID`), KEY `device_type` (`device_type`), KEY `device_type_2` (`device_type`,`id_device`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.5 create glpirepair_item table"); } if (TableExists("glpi_prefs")&&!FieldExists("glpi_prefs","username", false)) { if (isIndex("glpi_prefs", "user")) { $query = " ALTER TABLE `glpi_prefs` DROP INDEX `user`"; $DB->queryOrDie($query, "0.5 drop key user"); } $query = " ALTER TABLE `glpi_prefs` CHANGE `user` `username` VARCHAR(80) NOT NULL"; $DB->queryOrDie($query, "0.5 change user to username"); $query = "ALTER TABLE `glpi_prefs` ADD UNIQUE (`username`) "; $DB->queryOrDie($query, "0.5 alter field username"); } //Mise a jour 0.5 verification des prefs pour chaque user. if (TableExists("glpi_prefs")) { $query = "SELECT `ID`, `name` FROM `glpi_users`"; $query2 = "SELECT `ID`, `username` FROM `glpi_prefs`"; $result = $DB->query($query); $result2 = $DB->query($query2); if ($DB->numrows($result) != $DB->numrows($result2)) { $users = array(); $i = 0; while ($line = $DB->fetch_array($result2)) { $prefs[$i] = $line["username"]; $i++; } while ($line = $DB->fetch_array($result)) { if (!in_array($line["name"],$prefs)) { $query_insert = "INSERT INTO `glpi_prefs` (`username` , `tracking_order` , `language`) VALUES ('".$line["name"]."', 'no', 'english')"; $DB->queryOrDie($query_insert, "glpi maj prefs"); } } } $DB->free_result($result); $DB->free_result($result2); } } /// Update to 0.5 : date difference used for update function date_diff050($from, $to) { $from = strtotime($from); $to = strtotime($to); if ($from > $to) { $t = $to; $to = $from; $from = $t; } $year1 = date("Y", $from); $year2 = date("Y", $to); $month1 = date("n", $from); $month2 = date("n", $to); if ($month2 < $month1) { $month2 += 12; $year2 --; } $months = $month2 - $month1; $years = $year2 - $year1; return (12*$years+$months); } /** Update to 0.5 : Update maintenance information * @param $table table name * @param $type item type * @param $ID item ID **/ function updateMaintenanceInfos($table, $type, $ID) { global $DB; $elements = array(); $query = "SELECT `ID` FROM `$table` WHERE `maintenance` = '1'"; $result = $DB->query($query); while ($data=$DB->fetch_array($result)) { $query_insert = "INSERT INTO `glpi_contract_device` (`FK_contract`, `FK_device` ,`device_type`) VALUES ('$ID', '".$data["ID"]."', '$type')"; $result_insert = $DB->queryOrDie($query_insert, "0.5 insert for update maintenance"); } $DB->free_result($result); $query_drop = "ALTER TABLE `$table` DROP `maintenance`"; $result_drop = $DB->queryOrDie($query_drop, "0.5 drop for update maintenance"); } /** Update to 0.5 : Update warranty information * @param $table table name * @param $type item type **/ function updateWarrantyInfos($table, $type) { global $DB; $elements = array(); $query = "SELECT `ID`, `achat_date`, `date_fin_garantie` FROM `$table` ORDER BY `achat_date`, `date_fin_garantie`"; $result = $DB->queryOrDie($query, "0.5 select for update warranty"); while ($data=$DB->fetch_array($result)) { if (($data['achat_date']!="0000-00-00" && !empty($data['achat_date'])) ||($data['date_fin_garantie']!="0000-00-00" && !empty($data['date_fin_garantie']))) { $IDitem = $data['ID']; if ($data['achat_date']=="0000-00-00" && !empty($data['achat_date'])) { $achat_date = date("Y-m-d"); } else { $achat_date = $data['achat_date']; } $duration = 0; if ($data['date_fin_garantie']!="0000-00-00" && !empty($data['date_fin_garantie'])) { $duration = round(date_diff050($achat_date, $data['date_fin_garantie']), 2); } $query_insert = "INSERT INTO `glpi_infocoms` (`device_type`, `FK_device`, `buy_date`, `warranty_duration`, `comments`) VALUES ('$type', '$IDitem', '".$achat_date."', '$duration', '')"; $result_insert = $DB->queryOrDie($query_insert, "0.5 insert for update warranty"); } } $DB->free_result($result); $query_drop = "ALTER TABLE `$table` DROP `achat_date`"; $result_drop = $DB->queryOrDie($query_drop, "0.5 drop1 for update warranty"); $query_drop = "ALTER TABLE `$table` DROP `date_fin_garantie`"; $result_drop = $DB->queryOrDie($query_drop, "0.5 drop2 for update warranty"); } /// Update to 0.5 :Is maintenance used ? function isMaintenanceUsed() { global $DB; $tables = array("glpi_computers", "glpi_monitors", "glpi_networking", "glpi_peripherals", "glpi_printers"); foreach ($tables as $key => $table) { $query = "SELECT `ID` FROM `$table` WHERE `maintenance` = '1'"; $result = $DB->queryOrDie($query, "0.5 find for update maintenance"); if ($DB->numrows($result)>0) { return true; } } return false; } /// Update to 0.5 :drop maintenance field ? function dropMaintenanceField() { global $DB; $tables = array("glpi_computers", "glpi_monitors", "glpi_networking", "glpi_peripherals", "glpi_printers"); foreach ($tables as $key => $table) { $query = "ALTER TABLE `$table` DROP `maintenance`"; $result = $DB->queryOrDie($query, "0.5 alter for update maintenance"); } } /** * Update to 0.5 : Get data from old dropdowns to new devices * * This function assure to keep clean data and integrity, during the change from * computers-dropdown to computers devices. Then delete the unused old elements. * * @param $devtype integer the devtype number * @param $devname string the device table name (end of the name (glpi_device_thisparam)) * @param $dpdname string the dropdown table name (end of the name (glpi_dropdown_thisparam)) * @param $compDpdName string the name of the dropdown foreign key on glpi_computers (eg : hdtype, processor) * @param $specif string the name of the dropdown value entry on glpi_computer (eg : hdspace, processor_speed) optionnal argument. * * @return nothing if everything is good, else display mysql query and error. */ function compDpd2Device($devtype, $devname, $dpdname, $compDpdName, $specif='') { global $DB; $query = "SELECT * FROM `glpi_dropdown_".$dpdname."`"; $result = $DB->query($query); while ($lndropd = $DB->fetch_array($result)) { $query2 = "INSERT INTO `glpi_device_".$devname."` (`designation`, `comment`, `specif_default`) VALUES ('".addslashes($lndropd["name"])."', '', '')"; $DB->queryOrDie($query2, "unable to transfer ".$dpdname." to ".$devname." "); $devid = $DB->insert_id(); $query3 = "SELECT * FROM `glpi_computers` WHERE `".$compDpdName."` = '".$lndropd["ID"]."'"; $result3 = $DB->query($query3); while ($lncomp = $DB->fetch_array($result3)) { $query4 = "INSERT INTO `glpi_computer_device` (`device_type`, `FK_device`, `FK_computers`) VALUES ('$devtype', '".$devid."', '".$lncomp["ID"]."')"; if (!empty($specif)) { $queryspecif = "SELECT `".$specif."` FROM `glpi_computers` WHERE `ID` = '".$lncomp["ID"]."'"; if ($resultspecif = $DB->query($queryspecif)) { $query4 = "INSERT INTO `glpi_computer_device` (`specificity`, `device_type`, `FK_device`, `FK_computers`) VALUES ('".$DB->result($resultspecif,0,$specif)."', '$devtype', '".$devid."', '".$lncomp["ID"]."')"; } } $DB->queryOrDie($query4, "unable to migrate from ".$dpdname." to ".$devname." for item computer:".$lncomp["ID"]); } } $DB->free_result($result); //Delete unused elements (dropdown on the computer table, dropdown table and specif) $query = "ALTER TABLE `glpi_computers` DROP `".$compDpdName."`"; $DB->queryOrDie($query); $query = "DROP TABLE `glpi_dropdown_".$dpdname."`"; $DB->queryOrDie($query); if (!empty($specif)) { $query = "ALTER TABLE `glpi_computers` DROP `".$specif."`"; $DB->queryOrDie($query); } } ?> glpi-0.84.3+dfsg.1/install/update_04_042.php000066400000000000000000000055651226600447100201650ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /// Update from 0.4 and 0.41 to 0.42 function update04to042() { global $DB; echo "

    Version 0.42

    "; if (!TableExists("glpi_reservation_item")) { $query = "CREATE TABLE `glpi_reservation_item` ( `ID` int(11) NOT NULL auto_increment, `device_type` tinyint(4) NOT NULL default '0', `id_device` int(11) NOT NULL default '0', `comments` text NOT NULL, PRIMARY KEY (`ID`), KEY `device_type` (`device_type`) )"; $DB->queryOrDie($query, "4201"); } if (!TableExists("glpi_reservation_resa")) { $query = "CREATE TABLE `glpi_reservation_resa` ( `ID` bigint(20) NOT NULL auto_increment, `id_item` int(11) NOT NULL default '0', `begin` datetime NOT NULL default '0000-00-00 00:00:00', `end` datetime NOT NULL default '0000-00-00 00:00:00', `id_user` int(11) NOT NULL default '0', PRIMARY KEY (`ID`), KEY `id_item` (`id_item`), KEY `id_user` (`id_user`), KEY `begin` (`begin`), KEY `end` (`end`) )"; $DB->queryOrDie($query, "4202"); } if (!FieldExists("glpi_tracking","device_type", false)) { $query = "ALTER TABLE `glpi_tracking` ADD `device_type` INT DEFAULT '1' NOT NULL AFTER `assign` "; $DB->queryOrDie($query, "4203"); } // Ajout language par defaut if (!FieldExists("glpi_config","default_language", false)) { $query = "ALTER TABLE `glpi_config` ADD `default_language` VARCHAR(255) DEFAULT 'english' NOT NULL "; $DB->queryOrDie($query, "4204"); } } ?> glpi-0.84.3+dfsg.1/install/update_051_06.php000066400000000000000000000664631226600447100201730ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /// Update from 0.51x to 0.6 function update051to06() { global $DB; echo "

    Version 0.6

    "; /*******************************GLPI 0.6***********************************************/ $query = "UPDATE `glpi_tracking` SET `category` = '0' WHERE `category` IS NULL"; $DB->queryOrDie($query, "0.6 prepare for alter category tracking"); $query = "ALTER TABLE `glpi_tracking` CHANGE `category` `category` INT(11) DEFAULT '0' NOT NULL"; $DB->queryOrDie($query, "0.6 alter category tracking"); // state pour les template if (!FieldExists("glpi_state_item","is_template", false)) { $query = "ALTER TABLE `glpi_state_item` ADD `is_template` ENUM('0', '1') DEFAULT '0' NOT NULL "; $DB->queryOrDie($query, "0.6 add is_template in state_item"); } if (!TableExists("glpi_dropdown_cartridge_type")) { $query = "CREATE TABLE `glpi_dropdown_cartridge_type` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', PRIMARY KEY (`ID`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.6 add table dropdown_cartridge_type"); $query = "INSERT INTO `glpi_dropdown_cartridge_type` (`name`) VALUES ('Ink-Jet')"; $DB->queryOrDie($query, "0.6 add entries to dropdown_cartridge_type"); $query = "INSERT INTO `glpi_dropdown_cartridge_type` (`name`) VALUES ('Toner')"; $DB->queryOrDie($query, "0.6 add entries to dropdown_cartridge_type"); $query = "INSERT INTO `glpi_dropdown_cartridge_type` (`name`) VALUES ('Ribbon')"; $DB->queryOrDie($query, "0.6 add entries to dropdown_cartridge_type"); } // specific alarm pour les cartouches if (!FieldExists("glpi_cartridges_type","alarm", false)) { $query = "ALTER TABLE `glpi_cartridges_type` ADD `alarm` TINYINT DEFAULT '10' NOT NULL "; $DB->queryOrDie($query, "0.6 add alarm in cartridges_type"); } // email for enterprises if (!FieldExists("glpi_enterprises","email", false)) { $query = "ALTER TABLE `glpi_enterprises` ADD `email` VARCHAR(255) NOT NULL"; $DB->queryOrDie($query, "0.6 add email in enterprises"); } // ldap_port for config if (!FieldExists("glpi_config","ldap_port", false)) { $query = "ALTER TABLE `glpi_config` ADD `ldap_port` VARCHAR(10) DEFAULT '389' NOT NULL AFTER `ID` "; $DB->queryOrDie($query, "0.6 add ldap_port in config"); } // CAS configuration if (!FieldExists("glpi_config","cas_host", false)) { $query = "ALTER TABLE `glpi_config` ADD `cas_host` VARCHAR(255) NOT NULL , ADD `cas_port` VARCHAR(255) NOT NULL , ADD `cas_uri` VARCHAR(255) NOT NULL "; $DB->queryOrDie($query, "0.6 add cas config in config"); } // Limit Item for contracts and correct template bug if (!FieldExists("glpi_contracts","device_countmax", false)) { $query = "ALTER TABLE `glpi_contracts` ADD `device_countmax` INT DEFAULT '0' NOT NULL "; $DB->queryOrDie($query, "0.6 add device_countmax in contracts"); } if (!FieldExists("glpi_contract_device","is_template", false)) { $query = "ALTER TABLE `glpi_contract_device` ADD `is_template` ENUM('0', '1') DEFAULT '0' NOT NULL "; $DB->queryOrDie($query, "0.6 add is_template in contract_device"); } if (!FieldExists("glpi_doc_device","is_template", false)) { $query = "ALTER TABLE `glpi_doc_device` ADD `is_template` ENUM('0', '1') DEFAULT '0' NOT NULL "; $DB->queryOrDie($query, "0.6 add is_template in doc_device"); $query = "ALTER TABLE `glpi_doc_device` ADD INDEX (`is_template`) "; $DB->queryOrDie($query, "0.6 alter is_template in doc_device"); } // Contract Type to dropdown if (!TableExists("glpi_dropdown_contract_type")) { $query = "CREATE TABLE `glpi_dropdown_contract_type` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', PRIMARY KEY (`ID`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.6 add table dropdown_contract_type"); $query = "INSERT INTO `glpi_dropdown_contract_type` (`name`) VALUES ('".__('Loan')."')"; $DB->queryOrDie($query, "0.6 add entries to dropdown_contract_type"); $query = "INSERT INTO `glpi_dropdown_contract_type` (`name`) VALUES ('".__('Renting')."')"; $DB->queryOrDie($query, "0.6 add entries to dropdown_contract_type"); $query = "INSERT INTO `glpi_dropdown_contract_type` (`name`) VALUES ('".__('Leasing')."')"; $DB->queryOrDie($query, "0.6 add entries to dropdown_contract_type"); $query = "INSERT INTO `glpi_dropdown_contract_type` (`name`) VALUES ('".__('Insurance')."')"; $DB->queryOrDie($query, "0.6 add entries to dropdown_contract_type"); $query = "INSERT INTO `glpi_dropdown_contract_type` (`name`) VALUES ('".__('Hardware support')."')"; $DB->queryOrDie($query, "0.6 add entries to dropdown_contract_type"); $query = "INSERT INTO `glpi_dropdown_contract_type` (`name`) VALUES ('".__('Software support')."')"; $DB->queryOrDie($query, "0.6 add entries to dropdown_contract_type"); $query = "INSERT INTO `glpi_dropdown_contract_type` (`name`) VALUES ('".__('Service provided')."')"; $DB->queryOrDie($query, "0.6 add entries to dropdown_contract_type"); } //// Update author and assign from tracking / followups if (!FieldExists("glpi_tracking","assign_type", false)) { // Create assin_type field $query = "ALTER TABLE `glpi_tracking` ADD `assign_type` TINYINT DEFAULT '0' NOT NULL AFTER `assign` "; $DB->queryOrDie($query, "0.6 add assign_type in tracking"); $users = array(); // Load All users $query = "SELECT `ID`, `name` FROM `glpi_users`"; $result = $DB->query($query); while ($line = $DB->fetch_array($result)) { $users[$line["name"]] = $line["ID"]; } $DB->free_result($result); // Update authors tracking $query = "UPDATE `glpi_tracking` SET `author` = '0' WHERE `author` IS NULL"; $DB->queryOrDie($query, "0.6 prepare for alter category tracking"); // Load tracking authors tables $authors = array(); $query = "SELECT `ID`, `author` FROM `glpi_tracking`"; $result = $DB->query($query); while ($line = $DB->fetch_array($result)) { $authors[$line["ID"]] = $line["author"]; } $DB->free_result($result); if (count($authors)>0) { foreach ($authors as $ID => $val) { if (isset($users[$val])) { $query = "UPDATE `glpi_tracking` SET `author` = '".$users[$val]."' WHERE `ID` = '$ID'"; $DB->query($query); } } } unset($authors); $query = "ALTER TABLE `glpi_tracking` CHANGE `author` `author` INT(11) DEFAULT '0' NOT NULL"; $DB->queryOrDie($query, "0.6 alter author in tracking"); $assign = array(); // Load tracking assign tables $query = "SELECT `ID`, `assign` FROM `glpi_tracking`"; $result = $DB->query($query); while ($line = $DB->fetch_array($result)) { $assign[$line["ID"]] = $line["assign"]; } $DB->free_result($result); if (count($assign)>0) { foreach ($assign as $ID => $val) { if (isset($users[$val])) { $query = "UPDATE `glpi_tracking` SET `assign` = '".$users[$val]."', `assign_type` = '".USER_TYPE."' WHERE `ID` = '$ID'"; $DB->query($query); } } } unset($assign); // Update assign tracking $query = "ALTER TABLE `glpi_tracking` CHANGE `assign` `assign` INT(11) DEFAULT '0' NOT NULL"; $DB->queryOrDie($query, "0.6 alter assign in tracking"); $authors = array(); // Load followup authors tables $query = "SELECT `ID`, `author` FROM `glpi_followups`"; $result = $DB->query($query); while ($line = $DB->fetch_array($result)) { $authors[$line["ID"]] = $line["author"]; } $DB->free_result($result); if (count($authors)>0) { foreach ($authors as $ID => $val) { if (isset($users[$val])) { $query = "UPDATE `glpi_followups` SET `author` = '".$users[$val]."' WHERE `ID` = '$ID'"; $DB->query($query); } } } unset($authors); // Update authors tracking $query = "ALTER TABLE `glpi_followups` CHANGE `author` `author` INT(11) DEFAULT '0' NOT NULL"; $DB->queryOrDie($query, "0.6 alter author in followups"); // Update Enterprise Tracking $query = "SELECT `computer`, `ID` FROM `glpi_tracking` WHERE `device_type` = '".ENTERPRISE_TYPE."'"; $result = $DB->query($query); if ($DB->numrows($result)>0) { while ($line = $DB->fetch_array($result)) { $query = "UPDATE `glpi_tracking` SET `assign` = '".$line["computer"]."', `assign_type` = '".ENTERPRISE_TYPE."', `device_type` = '0', `computer` = '0' WHERE `ID` = '".$line["ID"]."'"; $DB->query($query); } } $DB->free_result($result); } // Add planning feature if (!TableExists("glpi_tracking_planning")) { $query = "CREATE TABLE `glpi_tracking_planning` ( `ID` bigint(20) NOT NULL auto_increment, `id_tracking` int(11) NOT NULL default '0', `id_assign` int(11) NOT NULL default '0', `begin` datetime NOT NULL default '0000-00-00 00:00:00', `end` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`ID`), KEY `id_tracking` (`id_tracking`), KEY `begin` (`begin`), KEY `end` (`end`) ) TYPE=MyISAM "; $DB->queryOrDie($query, "0.6 add table glpi_tracking_planning"); } if (!FieldExists("glpi_config","planning_begin", false)) { $query = "ALTER TABLE `glpi_config` ADD `planning_begin` TIME DEFAULT '08:00:00' NOT NULL"; $DB->queryOrDie($query, "0.6 add planning begin in config"); } if (!FieldExists("glpi_config","planning_end", false)) { $query = "ALTER TABLE `glpi_config` ADD `planning_end` TIME DEFAULT '20:00:00' NOT NULL"; $DB->queryOrDie($query, "0.6 add planning end in config"); } // Merge glpi_users and glpi_prefs if (!FieldExists("glpi_users","language", false)) { // Create fields $query = "ALTER TABLE `glpi_users` ADD `tracking_order` ENUM('yes', 'no') DEFAULT 'no' NOT NULL "; $DB->queryOrDie($query, "0.6 add tracking_order in users"); $query = "ALTER TABLE `glpi_users` ADD `language` VARCHAR(255) NOT NULL DEFAULT 'english'"; $DB->queryOrDie($query, "0.6 add language in users"); // Move data $query = "SELECT * FROM `glpi_prefs`"; $result = $DB->query($query); if ($DB->numrows($result)>0) { while ($data=$DB->fetch_array($result)) { $query2 = "UPDATE `glpi_users` SET `language` = '".$data['language']."', `tracking_order` = '".$data['tracking_order']."' WHERE `name` = '".$data['username']."'"; $DB->queryOrDie($query2, "0.6 move pref to users"); } } $DB->free_result($result); // Drop glpi_prefs $query = "DROP TABLE `glpi_prefs`"; $DB->queryOrDie($query, "0.6 drop glpi_prefs"); } // Create glpi_dropdown_ram_type if (!TableExists("glpi_dropdown_ram_type")) { $query = "CREATE TABLE `glpi_dropdown_ram_type` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', PRIMARY KEY (`ID`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.6 add table glpi_dropdown_ram_type"); $query = "ALTER TABLE `glpi_device_ram` ADD `new_type` INT(11) DEFAULT '0' NOT NULL "; $DB->queryOrDie($query, "0.6 create new type field for glpi_device_ram"); $query = "INSERT INTO `glpi_dropdown_ram_type` (`name`) VALUES ('EDO')"; $DB->queryOrDie($query, "0.6 insert value in glpi_dropdown_ram"); $query = "INSERT INTO `glpi_dropdown_ram_type` (`name`) VALUES ('DDR')"; $DB->queryOrDie($query, "0.6 insert value in glpi_dropdown_ram"); $query = "INSERT INTO `glpi_dropdown_ram_type` (`name`) VALUES ('SDRAM')"; $DB->queryOrDie($query, "0.6 insert value in glpi_dropdown_ram"); $query = "INSERT INTO `glpi_dropdown_ram_type` (`name`) VALUES ('SDRAM-2')"; $DB->queryOrDie($query, "0.6 insert value in glpi_dropdown_ram"); // Get values $query = "SELECT * FROM `glpi_dropdown_ram_type`"; $result = $DB->query($query); $val = array(); while ($data=$DB->fetch_array($result)) { $val[$data['name']] = $data['ID']; } $DB->free_result($result); // Update glpi_device_ram $query = "SELECT * FROM `glpi_device_ram`"; $result = $DB->query($query); if ($DB->numrows($result)>0) { while ($data=$DB->fetch_array($result)) { $query2 = "UPDATE `glpi_device_ram` SET `new_type` = '".$val[$data['type']]."' WHERE `ID` = '".$data['ID']."'"; $DB->query($query2); } } $DB->free_result($result); // ALTER glpi_device_ram $query = "ALTER TABLE `glpi_device_ram` DROP `type`"; $DB->queryOrDie($query, "0.6 drop type in glpi_dropdown_ram"); $query = "ALTER TABLE `glpi_device_ram` CHANGE `new_type` `type` INT(11) DEFAULT '0' NOT NULL "; $DB->queryOrDie($query, "0.6 rename new_type in glpi_dropdown_ram"); } // Create external links if (!TableExists("glpi_links")) { $query = "CREATE TABLE `glpi_links` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', PRIMARY KEY (`ID`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.6 add table glpi_links"); } if (!TableExists("glpi_links_device")) { $query = "CREATE TABLE `glpi_links_device` ( `ID` int(11) NOT NULL auto_increment, `FK_links` int(11) NOT NULL default '0', `device_type` int(11) NOT NULL default '0', PRIMARY KEY (`ID`), KEY `device_type` (`device_type`), KEY `FK_links` (`FK_links`), UNIQUE `device_type_2` (`device_type`,`FK_links`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.6 add table glpi_links_device"); } // Initial count page for printer if (!FieldExists("glpi_printers","initial_pages", false)) { $query = "ALTER TABLE `glpi_printers` ADD `initial_pages` VARCHAR(30) DEFAULT '0' NOT NULL "; $DB->queryOrDie($query, "0.6 add initial_pages in printers"); } // Auto assign intervention if (!FieldExists("glpi_config","auto_assign", false)) { $query = "ALTER TABLE `glpi_config` ADD `auto_assign` ENUM('0', '1') DEFAULT '0' NOT NULL "; $DB->queryOrDie($query, "0.6 add auto_assign in config"); } // Create glpi_dropdown_network if (!TableExists("glpi_dropdown_network")) { $query = "CREATE TABLE `glpi_dropdown_network` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', PRIMARY KEY (`ID`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.6 add table glpi_dropdown_network"); } if (!FieldExists("glpi_computers","network", false)) { $query = "ALTER TABLE `glpi_computers` ADD `network` INT(11) DEFAULT '0' NOT NULL AFTER `location` "; $DB->queryOrDie($query, "0.6 a network in computers"); } if (!FieldExists("glpi_printers","network", false)) { $query = "ALTER TABLE `glpi_printers` ADD `network` INT(11) DEFAULT '0' NOT NULL AFTER `location` "; $DB->queryOrDie($query, "0.6 add network in printers"); } if (!FieldExists("glpi_networking","network", false)) { $query = "ALTER TABLE `glpi_networking` ADD `network` INT(11) DEFAULT '0' NOT NULL AFTER `location` "; $DB->queryOrDie($query, "0.6 a network in networking"); } // Create glpi_dropdown_domain if (!TableExists("glpi_dropdown_domain")) { $query = "CREATE TABLE `glpi_dropdown_domain` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', PRIMARY KEY (`ID`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.6 add table glpi_dropdown_domain"); } if (!FieldExists("glpi_computers","domain", false)) { $query = "ALTER TABLE `glpi_computers` ADD `domain` INT(11) DEFAULT '0' NOT NULL AFTER `location` "; $DB->queryOrDie($query, "0.6 a domain in computers"); } if (!FieldExists("glpi_printers","domain", false)) { $query = "ALTER TABLE `glpi_printers` ADD `domain` INT(11) DEFAULT '0' NOT NULL AFTER `location` "; $DB->queryOrDie($query, "0.6 a domain in printers"); } if (!FieldExists("glpi_networking","domain", false)) { $query = "ALTER TABLE `glpi_networking` ADD `domain` INT(11) DEFAULT '0' NOT NULL AFTER `location` "; $DB->queryOrDie($query, "0.6 a domain in networking"); } // Create glpi_dropdown_vlan if (!TableExists("glpi_dropdown_vlan")) { $query = "CREATE TABLE `glpi_dropdown_vlan` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', PRIMARY KEY (`ID`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.6 add table glpi_dropdown_vlan"); } if (!TableExists("glpi_networking_vlan")) { $query = "CREATE TABLE `glpi_networking_vlan` ( `ID` int(11) NOT NULL auto_increment, `FK_port` int(11) NOT NULL default '0', `FK_vlan` int(11) NOT NULL default '0', PRIMARY KEY (`ID`), KEY `FK_port` (`FK_port`), KEY `FK_vlan` (`FK_vlan`), UNIQUE `FK_port_2` (`FK_port`,`FK_vlan`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.6 add table glpi_networking_vlan"); } // Global Peripherals if (!FieldExists("glpi_peripherals","is_global", false)) { $query = "ALTER TABLE `glpi_peripherals` ADD `is_global` ENUM('0', '1') DEFAULT '0' NOT NULL AFTER `FK_glpi_enterprise` "; $DB->queryOrDie($query, "0.6 add is_global in peripherals"); } // Global Monitors if (!FieldExists("glpi_monitors","is_global", false)) { $query = "ALTER TABLE `glpi_monitors` ADD `is_global` ENUM('0', '1') DEFAULT '0' NOT NULL AFTER `FK_glpi_enterprise` "; $DB->queryOrDie($query, "0.6 add is_global in peripherals"); } // Mailing Resa if (!FieldExists("glpi_config","mailing_resa_admin", false)) { $query = "ALTER TABLE `glpi_config` ADD `mailing_resa_admin` VARCHAR(200) NOT NULL DEFAULT '1' AFTER `admin_email` "; $DB->queryOrDie($query, "0.6 add mailing_resa_admin in config"); } if (!FieldExists("glpi_config","mailing_resa_user", false)) { $query = "ALTER TABLE `glpi_config` ADD `mailing_resa_user` VARCHAR(200) NOT NULL DEFAULT '1' AFTER `admin_email` "; $DB->queryOrDie($query, "0.6 add mailing_resa_user in config"); } if (!FieldExists("glpi_config","mailing_resa_all_admin", false)) { $query = "ALTER TABLE `glpi_config` ADD `mailing_resa_all_admin` VARCHAR(200) NOT NULL DEFAULT '0' AFTER `admin_email`"; $DB->queryOrDie($query, "0.6 add mailing_resa_all_admin in config"); } // Modele ordinateurs if (!TableExists("glpi_dropdown_model")) { // model=type pour faciliter la gestion en post mise a jour : // y a plus qu'a deleter les elements non voulu // cela conviendra a tout le monde en fonction de l'utilisation du champ type $query = "ALTER TABLE `glpi_type_computers` RENAME `glpi_dropdown_model` ;"; $DB->queryOrDie($query, "0.6 rename table glpi_type_computers"); $query = "CREATE TABLE `glpi_type_computers` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', PRIMARY KEY (`ID`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.6 add table glpi_type_computers"); // copie model dans type $query = "SELECT * FROM `glpi_dropdown_model`"; $result = $DB->query($query); if ($DB->numrows($result)>0) { while ($data=$DB->fetch_array($result)) { $query = "INSERT INTO `glpi_type_computers` (`ID`, `name`) VALUES ('".$data['ID']."', '".addslashes($data['name'])."')"; $DB->queryOrDie($query, "0.6 insert value in glpi_type_computers"); } } $DB->free_result($result); $query = "INSERT INTO `glpi_type_computers` (`name`) VALUES ('Server')"; $DB->queryOrDie($query, "0.6 insert value in glpi_type_computers"); $serverid = $DB->insert_id(); // Type -> modele $query = "ALTER TABLE `glpi_computers` CHANGE `type` `model` INT(11) DEFAULT NULL "; $DB->queryOrDie($query, "0.6 add model in computers"); $query = "ALTER TABLE `glpi_computers` ADD `type` INT(11) DEFAULT NULL AFTER `model` "; $DB->queryOrDie($query, "0.6 add model in computers"); // Update server values and drop flags_server $query = "UPDATE `glpi_computers` SET `type` = '$serverid' WHERE `flags_server` = '1'"; $DB->queryOrDie($query, "0.6 update type of computers"); $query = "ALTER TABLE `glpi_computers` DROP `flags_server`;"; $DB->queryOrDie($query, "0.6 drop type in glpi_dropdown_ram"); } if (!TableExists("glpi_consumables_type")) { $query = "CREATE TABLE `glpi_consumables_type` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', `ref` varchar(255) NOT NULL default '', `location` int(11) NOT NULL default '0', `type` tinyint(4) NOT NULL default '0', `FK_glpi_enterprise` int(11) NOT NULL default '0', `tech_num` int(11) default '0', `deleted` enum('Y','N') NOT NULL default 'N', `comments` text NOT NULL, `alarm` tinyint(4) NOT NULL default '10', PRIMARY KEY (`ID`), KEY `FK_glpi_enterprise` (`FK_glpi_enterprise`), KEY `tech_num` (`tech_num`), KEY `deleted` (`deleted`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.6 add table glpi_consumables_type"); $query = "CREATE TABLE `glpi_consumables` ( `ID` int(11) NOT NULL auto_increment, `FK_glpi_consumables_type` int(11) default NULL, `date_in` date default NULL, `date_out` date default NULL, PRIMARY KEY (`ID`), KEY `FK_glpi_cartridges_type` (`FK_glpi_consumables_type`), KEY `date_in` (`date_in`), KEY `date_out` (`date_out`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.6 add table glpi_consumables"); $query = "CREATE TABLE `glpi_dropdown_consumable_type` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', PRIMARY KEY (`ID`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.6 add table glpi_dropdown_consumable_type"); } // HDD connect type if (!TableExists("glpi_dropdown_hdd_type")) { $query = "CREATE TABLE `glpi_dropdown_hdd_type` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', PRIMARY KEY (`ID`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.6 add table glpi_dropdown_hdd_type"); $query = "INSERT INTO `glpi_dropdown_hdd_type` (`name`) VALUES ('IDE')"; $DB->queryOrDie($query, "0.6 insert value in glpi_dropdown_hdd_type"); $query = "INSERT INTO `glpi_dropdown_hdd_type` (`name`) VALUES ('SATA')"; $DB->queryOrDie($query, "0.6 insert value in glpi_dropdown_hdd_type"); $query = "INSERT INTO `glpi_dropdown_hdd_type` (`name`) VALUES ('SCSI')"; $DB->queryOrDie($query, "0.6 insert value in glpi_dropdown_hdd_type"); // Insertion des enum dans l'ordre - le alter garde donc les bonne valeurs $query = "ALTER TABLE `glpi_device_hdd` CHANGE `interface` `interface` INT(11) DEFAULT '0' NOT NULL"; $DB->queryOrDie($query, "0.6 alter interface of glpi_device_hdd"); } } ?> glpi-0.84.3+dfsg.1/install/update_05_051.php000066400000000000000000000072531226600447100201620ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /// Update from 0.5 to 0.51 function update05to051() { global $DB; echo "

    Version 0.51

    "; /*******************************GLPI 0.51***********************************************/ if (!FieldExists("glpi_infocoms","facture", false)) { $query = "ALTER TABLE `glpi_infocoms` ADD `facture` char(255) NOT NULL default ''"; $DB->queryOrDie($query, "0.51 add field facture"); } if (!FieldExists("glpi_enterprises","fax", false)) { $query = "ALTER TABLE `glpi_enterprises` ADD `fax` char(255) NOT NULL default ''"; $DB->queryOrDie($query, "0.51 add field fax"); } if (!FieldExists("glpi_docs","link", false)) { $query = "ALTER TABLE `glpi_docs` ADD `link` char(255) NOT NULL default ''"; $DB->queryOrDie($query, "0.51 add field fax"); } if (!TableExists("glpi_dropdown_contact_type")) { $query = "CREATE TABLE `glpi_dropdown_contact_type` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', PRIMARY KEY (`ID`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.51 add table dropdown_contact_type"); $query = "INSERT INTO `glpi_dropdown_contact_type` (`name`) VALUES ('".__('Technician')."')"; $DB->queryOrDie($query, "0.51 add entries to dropdown_contact_type"); $query = "INSERT INTO `glpi_dropdown_contact_type` (`name`) VALUES ('".__('Commercial')."')"; $DB->queryOrDie($query, "0.51 add entries to dropdown_contact_type"); } if (!FieldExists("glpi_config","cartridges_alarm", false)) { $query = "ALTER TABLE `glpi_config` ADD `cartridges_alarm` int(11) NOT NULL default '10'"; $DB->queryOrDie($query, "0.51 add field cartridges_alarm"); } if (!TableExists("glpi_state_item")) { $query = "ALTER TABLE `glpi_repair_item` RENAME `glpi_state_item`"; $DB->queryOrDie($query, "0.51 alter glpi_state_item table name"); $query = "ALTER TABLE `glpi_state_item` ADD `state` INT DEFAULT '1'"; $DB->queryOrDie($query, "0.51 add state field"); } if (!TableExists("glpi_dropdown_state")) { $query = "CREATE TABLE `glpi_dropdown_state` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) default NULL, PRIMARY KEY (`ID`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.51 add state field"); } } ?> glpi-0.84.3+dfsg.1/install/update_065_068.php000066400000000000000000001274151226600447100202630ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /// Update from 0.65 to 0.68 function update065to068() { global $DB; if (!TableExists("glpi_profiles")) { $query = "CREATE TABLE `glpi_profiles` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) default NULL, `interface` varchar(50) NOT NULL default 'helpdesk', `is_default` enum('0','1') NOT NULL default '0', `computer` char(1) default NULL, `monitor` char(1) default NULL, `software` char(1) default NULL, `networking` char(1) default NULL, `printer` char(1) default NULL, `peripheral` char(1) default NULL, `cartridge` char(1) default NULL, `consumable` char(1) default NULL, `phone` char(1) default NULL, `notes` char(1) default NULL, `contact_enterprise` char(1) default NULL, `document` char(1) default NULL, `contract_infocom` char(1) default NULL, `knowbase` char(1) default NULL, `faq` char(1) default NULL, `reservation_helpdesk` char(1) default NULL, `reservation_central` char(1) default NULL, `reports` char(1) default NULL, `ocsng` char(1) default NULL, `dropdown` char(1) default NULL, `device` char(1) default NULL, `typedoc` char(1) default NULL, `link` char(1) default NULL, `config` char(1) default NULL, `search_config` char(1) default NULL, `update` char(1) default NULL, `profile` char(1) default NULL, `user` char(1) default NULL, `group` char(1) default NULL, `logs` char(1) default NULL, `reminder_public` char(1) default NULL, `backup` char(1) default NULL, `create_ticket` char(1) default NULL, `delete_ticket` char(1) default NULL, `comment_ticket` char(1) default NULL, `comment_all_ticket` char(1) default NULL, `update_ticket` char(1) default NULL, `own_ticket` char(1) default NULL, `steal_ticket` char(1) default NULL, `assign_ticket` char(1) default NULL, `show_ticket` char(1) default NULL, `show_full_ticket` char(1) default NULL, `observe_ticket` char(1) default NULL, `show_planning` char(1) default NULL, `show_all_planning` char(1) default NULL, `statistic` char(1) default NULL, `password_update` char(1) default NULL, `helpdesk_hardware` tinyint(2) NOT NULL DEFAULT '0', `helpdesk_hardware_type` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`ID`), KEY `interface` (`interface`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.68 add profiles"); $helpdesk_link_type = array(COMPUTER_TYPE, MONITOR_TYPE, NETWORKING_TYPE, PERIPHERAL_TYPE, PHONE_TYPE,PRINTER_TYPE); $checksum = 0; foreach ($helpdesk_link_type as $val) { $checksum += pow(2,$val); } $query = "INSERT INTO `glpi_profiles` VALUES (1, 'post-only', 'helpdesk', '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'r', '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '1', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, '1', '1', '$checksum')"; $DB->queryOrDie($query, "0.68 add post-only profile"); $query = "INSERT INTO `glpi_profiles` VALUES (2, 'normal', 'central', '0', 'r', 'r', 'r', 'r', 'r', 'r', 'r', 'r', 'r', 'r', 'r', 'r', 'r', 'r', 'r', '1', 'r', 'r', NULL, NULL, NULL, 'r', 'r', NULL, NULL, 'r', NULL, 'r', 'r', NULL, NULL, NULL, '1', '1', '1', '0', '0', '1', '0', '0', '1', '0', '1', '1', '0', '1', '1', '1', '$checksum')"; $DB->queryOrDie($query, "0.68 add normal profile"); $query = "INSERT INTO `glpi_profiles` VALUES (3, 'admin', 'central', '0', 'w', 'w', 'w', 'w', 'w', 'w', 'w', 'w', 'w', 'w', 'w', 'w', 'w', 'w', 'w', '1', 'w', 'r', 'w', 'w', 'w', 'w', 'w', NULL, 'w', 'r', 'r', 'w', 'w', NULL, NULL, NULL, '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '3', '$checksum')"; $DB->queryOrDie($query, "0.68 add admin profile"); $query = "INSERT INTO `glpi_profiles` VALUES (4, 'super-admin', 'central', '0', 'w', 'w', 'w', 'w', 'w', 'w', 'w', 'w', 'w', 'w', 'w', 'w', 'w', 'w', 'w', '1', 'w', 'r', 'w', 'w', 'w', 'w', 'w', 'w', 'w', 'r', 'w', 'w', 'w', 'r', 'w', 'w', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '3', '$checksum')"; $DB->queryOrDie($query, "0.68 add super-admin profile"); } if (FieldExists("glpi_config","post_only_followup", false)) { $query = "SELECT `post_only_followup` FROM `glpi_config` WHERE `ID` = '1' "; $result = $DB->query($query); if ($DB->result($result,0,0)) { $query = "UPDATE `glpi_profiles` SET `comment_ticket` = '1'"; $DB->queryOrDie($query, "0.68 update default glpi_profiles"); } $query = "ALTER TABLE `glpi_config` DROP `post_only_followup`"; $DB->queryOrDie($query, "0.68 drop post_only_followup in glpi_config"); } $profiles = array("post-only" => 1, "normal" => 2, "admin" => 3, "super-admin" => 4); if (!TableExists("glpi_users_profiles")) { $query = "CREATE TABLE `glpi_users_profiles` ( `ID` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `FK_users` INT NOT NULL DEFAULT '0', `FK_profiles` INT NOT NULL DEFAULT '0', KEY `FK_users` (`FK_users`), KEY `FK_profiles` (`FK_profiles`), UNIQUE `FK_users_profiles` (`FK_users`,`FK_profiles`) ) TYPE = MYISAM"; $DB->queryOrDie($query, "0.68 create users_profiles table"); $query = "SELECT `ID`, `type` FROM `glpi_users`"; $result = $DB->query($query); if ($DB->numrows($result)) { while ($data=$DB->fetch_array($result)) { $query2 = "INSERT INTO `glpi_users_profiles` (`FK_users`, `FK_profiles`) VALUES ('".$data['ID']."', '".$profiles[$data['type']]."')"; $DB->queryOrDie($query2, "0.68 insert new users_profiles"); } } $query = "ALTER TABLE `glpi_users` DROP `type`, DROP `can_assign_job`"; $DB->queryOrDie($query, "0.68 drop type and can_assign_job from users"); } if (!TableExists("glpi_mailing")) { $query = "CREATE TABLE `glpi_mailing` ( `ID` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `type` varchar(255) default NULL, `FK_item` INT NOT NULL DEFAULT '0', `item_type` INT NOT NULL DEFAULT '0', KEY `type` (`type`), KEY `FK_item` (`FK_item`), KEY `item_type` (`item_type`), KEY `items` (`item_type`,`FK_item`), UNIQUE `mailings` (`type`,`FK_item`,`item_type`) ) TYPE = MYISAM"; $DB->queryOrDie($query, "0.68 create mailing table"); $query = "SELECT * FROM `glpi_config` WHERE `ID` = '1'"; $result = $DB->query($query); if ($result) { $data = $DB->fetch_assoc($result); if ($data["mailing_resa_all_admin"]) { $query2 = "INSERT INTO `glpi_mailing` (`type`, `FK_item`, `item_type`) VALUES ('resa', '".$profiles["admin"]."', '".Notification::PROFILE_TYPE."')"; $DB->queryOrDie($query2, "0.68 populate mailing resa all admin"); } if ($data["mailing_resa_user"]) { $query2 = "INSERT INTO `glpi_mailing` (`type`, `FK_item`, `item_type`) VALUES ('resa', '".Notification::AUTHOR."', '".Notification::USER_TYPE."')"; $DB->queryOrDie($query2, "0.68 populate mailing resa all admin"); } if ($data["mailing_resa_admin"]) { $query2 = "INSERT INTO `glpi_mailing` (`type`, `FK_item`, `item_type`) VALUES ('resa', '".Notification::GLOBAL_ADMINISTRATOR."', '".Notification::USER_TYPE."')"; $DB->queryOrDie($query2, "0.68 populate mailing resa all admin"); } if ($data["mailing_new_all_admin"]) { $query2 = "INSERT INTO `glpi_mailing` (`type`, `FK_item`, `item_type`) VALUES ('new', '".$profiles["admin"]."', '".Notification::PROFILE_TYPE."')"; $DB->queryOrDie($query2, "0.68 populate mailing new all admin"); } if ($data["mailing_update_all_admin"]) { $query2 = "INSERT INTO `glpi_mailing` (`type`, `FK_item`, `item_type`) VALUES ('update', '".$profiles["admin"]."', '".Notification::PROFILE_TYPE."')"; $DB->queryOrDie($query2, "0.68 populate mailing update all admin"); } if ($data["mailing_followup_all_admin"]) { $query2 = "INSERT INTO `glpi_mailing` (`type`, `FK_item`, `item_type`) VALUES ('followup', '".$profiles["admin"]."', '".Notification::PROFILE_TYPE."')"; $DB->queryOrDie($query2, "0.68 populate mailing followup all admin"); } if ($data["mailing_finish_all_admin"]) { $query2 = "INSERT INTO `glpi_mailing` (`type`, `FK_item`, `item_type`) VALUES ('finish', '".$profiles["admin"]."', '".Notification::PROFILE_TYPE."')"; $DB->queryOrDie($query2, "0.68 populate mailing finish all admin"); } if ($data["mailing_new_all_normal"]) { $query2 = "INSERT INTO `glpi_mailing` (`type`, `FK_item`, `item_type`) VALUES ('new', '".$profiles["normal"]."', '".Notification::PROFILE_TYPE."')"; $DB->queryOrDie($query2, "0.68 populate mailing new all normal"); } if ($data["mailing_update_all_normal"]) { $query2 = "INSERT INTO `glpi_mailing` (`type`, `FK_item`, `item_type`) VALUES ('update', '".$profiles["normal"]."', '".Notification::PROFILE_TYPE."')"; $DB->queryOrDie($query2, "0.68 populate mailing update all normal"); } if ($data["mailing_followup_all_normal"]) { $query2 = "INSERT INTO `glpi_mailing` (`type`, `FK_item`, `item_type`) VALUES ('followup', '".$profiles["normal"]."', '".Notification::PROFILE_TYPE."')"; $DB->queryOrDie($query2, "0.68 populate mailing followup all normal"); } if ($data["mailing_finish_all_normal"]) { $query2 = "INSERT INTO `glpi_mailing` (`type`, `FK_item`, `item_type`) VALUES ('finish', '".$profiles["normal"]."', '".Notification::PROFILE_TYPE."')"; $DB->queryOrDie($query2, "0.68 populate mailing finish all normal"); } if ($data["mailing_new_admin"]) { $query2 = "INSERT INTO `glpi_mailing` (`type`, `FK_item`, `item_type`) VALUES ('new', '".Notification::GLOBAL_ADMINISTRATOR."', '".Notification::USER_TYPE."')"; $DB->queryOrDie($query2, "0.68 populate mailing new admin"); } if ($data["mailing_update_admin"]) { $query2 = "INSERT INTO `glpi_mailing` (`type`, `FK_item`, `item_type`) VALUES ('update', '".Notification::GLOBAL_ADMINISTRATOR."', '".Notification::USER_TYPE."')"; $DB->queryOrDie($query2, "0.68 populate mailing update admin"); } if ($data["mailing_followup_admin"]) { $query2 = "INSERT INTO `glpi_mailing` (`type`, `FK_item`, `item_type`) VALUES ('followup', '".Notification::GLOBAL_ADMINISTRATOR."', '".Notification::USER_TYPE."')"; $DB->queryOrDie($query2, "0.68 populate mailing followup admin"); } if ($data["mailing_finish_admin"]) { $query2 = "INSERT INTO `glpi_mailing` (`type`, `FK_item`, `item_type`) VALUES ('finish', '".Notification::GLOBAL_ADMINISTRATOR."', '".Notification::USER_TYPE."')"; $DB->queryOrDie($query2, "0.68 populate mailing finish admin"); } if ($data["mailing_new_attrib"]) { $query2 = "INSERT INTO `glpi_mailing` (`type`, `FK_item`, `item_type`) VALUES ('new', '".Notification::ASSIGN_TECH."', '".Notification::USER_TYPE."')"; $DB->queryOrDie($query2, "0.68 populate mailing new attrib"); } if ($data["mailing_update_attrib"]) { $query2 = "INSERT INTO `glpi_mailing` (`type`, `FK_item`, `item_type`) VALUES ('update', '".Notification::ASSIGN_TECH."', '".Notification::USER_TYPE."')"; $DB->queryOrDie($query2, "0.68 populate mailing update attrib"); } if ($data["mailing_followup_attrib"]) { $query2 = "INSERT INTO `glpi_mailing` (`type`, `FK_item`, `item_type`) VALUES ('followup', '".Notification::ASSIGN_TECH."', '".Notification::USER_TYPE."')"; $DB->queryOrDie($query2, "0.68 populate mailing followup attrib"); } if ($data["mailing_finish_attrib"]) { $query2 = "INSERT INTO `glpi_mailing` (`type`, `FK_item`, `item_type`) VALUES ('finish', '".Notification::ASSIGN_TECH."', '".Notification::USER_TYPE."')"; $DB->queryOrDie($query2, "0.68 populate mailing finish attrib"); } if ($data["mailing_attrib_attrib"]) { $query2 = "INSERT INTO `glpi_mailing` (`type`, `FK_item`, `item_type`) VALUES ('update', '".Notification::OLD_TECH_IN_CHARGE."', '".Notification::USER_TYPE."')"; $DB->queryOrDie($query2, "0.68 populate mailing finish attrib"); } if ($data["mailing_new_user"]) { $query2 = "INSERT INTO `glpi_mailing` (`type`, `FK_item`, `item_type`) VALUES ('new', '".Notification::AUTHOR."', '".Notification::USER_TYPE."')"; $DB->queryOrDie($query2, "0.68 populate mailing new user"); } if ($data["mailing_update_user"]) { $query2 = "INSERT INTO `glpi_mailing` (`type`, `FK_item`, `item_type`) VALUES ('update', '".Notification::AUTHOR."', '".Notification::USER_TYPE."')"; $DB->queryOrDie($query2, "0.68 populate mailing update user"); } if ($data["mailing_followup_user"]) { $query2 = "INSERT INTO `glpi_mailing` (`type`, `FK_item`, `item_type`) VALUES ('followup', '".Notification::AUTHOR."', '".Notification::USER_TYPE."')"; $DB->queryOrDie($query2, "0.68 populate mailing followup user"); } if ($data["mailing_finish_user"]) { $query2 = "INSERT INTO `glpi_mailing` (`type`, `FK_item`, `item_type`) VALUES ('finish', '".Notification::AUTHOR."', '".Notification::USER_TYPE."')"; $DB->queryOrDie($query2, "0.68 populate mailing finish user"); } } $query = " ALTER TABLE `glpi_config` DROP `mailing_resa_all_admin`, DROP `mailing_resa_user`, DROP `mailing_resa_admin`, DROP `mailing_new_admin`, DROP `mailing_update_admin`, DROP `mailing_followup_admin`, DROP `mailing_finish_admin`, DROP `mailing_new_all_admin`, DROP `mailing_update_all_admin`, DROP `mailing_followup_all_admin`, DROP `mailing_finish_all_admin`, DROP `mailing_new_all_normal`, DROP `mailing_update_all_normal`, DROP `mailing_followup_all_normal`, DROP `mailing_finish_all_normal`, DROP `mailing_new_attrib`, DROP `mailing_update_attrib`, DROP `mailing_followup_attrib`, DROP `mailing_finish_attrib`, DROP `mailing_new_user`, DROP `mailing_update_user`, DROP `mailing_followup_user`, DROP `mailing_finish_user`, DROP `mailing_attrib_attrib`"; $DB->queryOrDie($query, "0.68 delete mailing config from config"); } // Convert old content of knowbase in HTML And add new fields if (TableExists("glpi_kbitems")) { if (!FieldExists("glpi_kbitems","author", false)) { // convert $query = "SELECT * FROM `glpi_kbitems` "; $result = $DB->query($query); if ($DB->numrows($result)>0) { while ($line = $DB->fetch_array($result)) { $query = "UPDATE `glpi_kbitems` SET `answer` = '".addslashes(rembo($line["answer"]))."' WHERE `ID` = '".$line["ID"]."'"; $DB->queryOrDie($query, "0.68 convert knowbase to xhtml"); } $DB->free_result($result); } // add new fields $query = "ALTER TABLE `glpi_kbitems` ADD `author` INT( 11 ) NOT NULL DEFAULT '0' AFTER `faq`, ADD `view` INT( 11 ) NOT NULL DEFAULT '0' AFTER `author`, ADD `date` DATETIME NULL DEFAULT NULL AFTER `view`, ADD `date_mod` DATETIME NULL DEFAULT NULL AFTER `date`"; $DB->queryOrDie($query, "0.68 add fields in knowbase"); } } // fin convert // Add Level To Dropdown $dropdowntree_tables = array("glpi_dropdown_kbcategories", "glpi_dropdown_locations"); foreach ($dropdowntree_tables as $t) { if (!FieldExists($t,"level", false)) { $query = "ALTER TABLE `$t` ADD `level` INT(11)"; $DB->queryOrDie($query, "0.68 add level to $t"); } } if (FieldExists("glpi_config","root_doc", false)) { $query = "ALTER TABLE `glpi_config` DROP `root_doc`"; $DB->queryOrDie($query, "0.68 drop root_doc"); } // add smtp config if (!FieldExists("glpi_config","smtp_mode", false)) { $query = "ALTER TABLE `glpi_config` ADD `smtp_mode` tinyint(4) DEFAULT '0' NOT NULL, ADD `smtp_host` varchar(255), ADD `smtp_port` int(11) DEFAULT '25' NOT NULL, ADD `smtp_username` varchar(255), ADD `smtp_password` varchar(255)"; $DB->queryOrDie($query, "0.68 add smtp config"); } $map_lang = array("french" => "fr_FR", "english" => "en_GB", "deutsch" => "de_DE", "italian" => "it_IT", "castillano" => "es_ES", "portugese" => "pt_PT", "dutch" => "nl_NL", "hungarian" => "hu_HU", "polish" => "po_PO", "rumanian" => "ro_RO", "russian" => "ru_RU"); foreach ($map_lang as $old => $new) { $query = "UPDATE `glpi_users` SET `language` = '$new' WHERE `language` = '$old'"; $DB->queryOrDie($query, "0.68 update $new lang user setting"); } $query = "SELECT `default_language` FROM `glpi_config` WHERE `ID` = '1'"; $result = $DB->query($query); $def_lang = $DB->result($result,0,0); if (isset($map_lang[$def_lang])) { $query = "UPDATE `glpi_config` SET `default_language` = '".$map_lang[$def_lang]."' WHERE `ID` = '1'"; $DB->queryOrDie($query, "0.68 update default_language in config"); } // Improve link management if (!FieldExists("glpi_links","link", false)) { $query = "ALTER TABLE `glpi_links` CHANGE `name` `link` VARCHAR( 255 ) NULL DEFAULT NULL "; $DB->queryOrDie($query, "0.68 rename name in link"); $query = "ALTER TABLE `glpi_links` ADD `name` VARCHAR( 255 ) NULL AFTER `ID`"; $DB->queryOrDie($query, "0.68 add name in link"); $query = "UPDATE `glpi_links` SET `name` = `link`"; $DB->queryOrDie($query, "0.68 init name field in link"); } if (FieldExists("glpi_config","ldap_field_name", false)) { $query = "UPDATE `glpi_config` SET `ldap_login` = `ldap_field_name` "; $DB->query($query); $query = "ALTER TABLE `glpi_config` DROP `ldap_field_name` "; $DB->queryOrDie($query, "0.68 drop ldap_field_name in config"); } // Security user Helpdesk $query = "UPDATE `glpi_users` SET `password` = '', `active` = '0' WHERE `name` = 'Helpdesk'"; $DB->queryOrDie($query, "0.68 security update for user Helpdesk"); if (!FieldExists("glpi_ocs_config","import_general_name", false)) { $query = "ALTER TABLE `glpi_ocs_config` ADD `import_general_name` INT( 2 ) NOT NULL DEFAULT '0' AFTER `import_printer`"; $DB->queryOrDie($query, "0.68 add import_name in ocs_config"); } // Clean default values for devices if (FieldExists("glpi_device_drive","speed", false)) { $query = "ALTER TABLE `glpi_device_drive` CHANGE `speed` `speed` VARCHAR( 255 ) NULL "; $DB->queryOrDie($query, "0.68 alter speed in device_drive"); } if (FieldExists("glpi_device_gfxcard","ram", false)) { $query = "ALTER TABLE `glpi_device_gfxcard` CHANGE `ram` `ram` VARCHAR( 255 ) NULL "; $DB->queryOrDie($query, "0.68 alter ram in device_gfxcard"); } if (FieldExists("glpi_device_hdd","rpm", false)) { $query = "ALTER TABLE `glpi_device_hdd` CHANGE `rpm` `rpm` VARCHAR( 255 ) NULL, CHANGE `cache` `cache` VARCHAR( 255 ) NULL "; $DB->queryOrDie($query, "0.68 alter rpm and cache in device_hdd"); } if (FieldExists("glpi_device_iface","bandwidth", false)) { $query = "ALTER TABLE `glpi_device_iface` CHANGE `bandwidth` `bandwidth` VARCHAR( 255 ) NULL "; $DB->queryOrDie($query, "0.68 alter bandwidth in device_iface"); } if (FieldExists("glpi_device_moboard","chipset", false)) { $query = "ALTER TABLE `glpi_device_moboard` CHANGE `chipset` `chipset` VARCHAR( 255 ) NULL "; $DB->queryOrDie($query, "0.68 alter chipset in device_moboard"); } if (FieldExists("glpi_device_drive","speed", false)) { $query = "ALTER TABLE `glpi_device_drive` CHANGE `speed` `speed` VARCHAR( 255 ) NULL "; $DB->queryOrDie($query, "0.68 alter speed in device_drive"); } if (FieldExists("glpi_device_power","power", false)) { $query = "ALTER TABLE `glpi_device_power` CHANGE `power` `power` VARCHAR( 255 ) NULL "; $DB->queryOrDie($query, "0.68 alter power in device_power"); } if (FieldExists("glpi_device_ram","frequence", false)) { $query = "ALTER TABLE `glpi_device_ram` CHANGE `frequence` `frequence` VARCHAR( 255 ) NULL "; $DB->queryOrDie($query, "0.68 alter frequence in device_ram"); } if (FieldExists("glpi_device_sndcard","type", false)) { $query = "ALTER TABLE `glpi_device_sndcard` CHANGE `type` `type` VARCHAR( 255 ) NULL "; $DB->queryOrDie($query, "0.68 alter type in device_sndcard"); } if (!FieldExists("glpi_display","FK_users", false)) { $query = "ALTER TABLE `glpi_display` ADD `FK_users` INT NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.68 alter display add FK_users"); $query = "ALTER TABLE `glpi_display` DROP INDEX `type_2`, ADD UNIQUE `type_2` (`type`, `num`, `FK_users`)"; $DB->queryOrDie($query, "0.68 alter display update unique key"); } // Proxy configuration if (!FieldExists("glpi_config","proxy_name", false)) { $query = "ALTER TABLE `glpi_config` ADD `proxy_name` VARCHAR( 255 ) NULL, ADD `proxy_port` VARCHAR( 255 ) DEFAULT '8080' NOT NULL, ADD `proxy_user` VARCHAR( 255 ) NULL, ADD `proxy_password` VARCHAR( 255 ) NULL"; $DB->queryOrDie($query, "0.68 add proxy fields to glpi_config"); } // Log update with followups if (!FieldExists("glpi_config","followup_on_update_ticket", false)) { $query = "ALTER TABLE `glpi_config` ADD `followup_on_update_ticket` tinyint(4) DEFAULT '1' NOT NULL"; $DB->queryOrDie($query, "0.68 add followup_on_update_ticket to glpi_config"); } // Ticket Category -> Tree mode if (!FieldExists("glpi_dropdown_tracking_category","completename", false)) { $query = "ALTER TABLE glpi_dropdown_tracking_category ADD `parentID` INT NOT NULL DEFAULT '0' AFTER `ID`, ADD `completename` TEXT NULL AFTER `name`, ADD `level` INT NULL AFTER `comments` "; $DB->queryOrDie($query, "0.68 glpi_dropdown_tracking_category to dropdown tree"); } // User to Document if (!FieldExists("glpi_docs","FK_users", false)) { $query = "ALTER TABLE `glpi_docs` ADD `FK_users` int DEFAULT '0' NOT NULL, ADD `FK_tracking` int DEFAULT '0' NOT NULL"; $DB->queryOrDie($query, "0.68 add FK_users to docs"); } // Import Ocs TAG if (!FieldExists("glpi_ocs_config","import_tag_field", false)) { $query = "ALTER TABLE `glpi_ocs_config` ADD `import_tag_field` varchar( 255 ) NULL"; $DB->queryOrDie($query, "0.68 add import_tag_field to ocs_config"); } // Use ocs soft dict if (!FieldExists("glpi_ocs_config","use_soft_dict", false)) { $query = "ALTER TABLE `glpi_ocs_config` ADD `use_soft_dict` char( 1 ) DEFAULT '1'"; $DB->queryOrDie($query, "0.68 add use_soft_dict to ocs_config"); } // Link user and group to hardware $new_link = array("computers", "monitors", "networking", "peripherals", "phones", "printers", "software"); foreach ($new_link as $table) { if (!FieldExists("glpi_$table","FK_users", false)) { $query = "ALTER TABLE `glpi_$table` ADD `FK_users` INT(11) DEFAULT '0', ADD `FK_groups` INT(11) DEFAULT '0'"; $DB->queryOrDie($query, "0.65 add link user group field in $table"); if ($table != "software") { // Update using name field of users $query2 = "SELECT `glpi_users`.`ID` AS USER, `glpi_$table`.`ID` AS ID FROM `glpi_$table` LEFT JOIN `glpi_users` ON (`glpi_$table`.`contact` = `glpi_users`.`name` AND `glpi_$table`.`contact` <> '') WHERE `glpi_users`.`ID` IS NOT NULL"; $result2 = $DB->query($query2); if ($DB->numrows($result2)>0) { while ($data=$DB->fetch_assoc($result2)) { $query3 = "UPDATE `glpi_$table` SET `FK_users` = '".$data["USER"]."' WHERE `ID` = '".$data["ID"]."'"; $DB->query($query3); } } // Update using realname field of users $query2 = "SELECT `glpi_users`.`ID` AS USER, `glpi_$table`.`ID` AS ID FROM `glpi_$table` LEFT JOIN `glpi_users` ON (`glpi_$table`.`contact` = `glpi_users`.`realname` AND `glpi_$table`.`contact` <> '') WHERE `glpi_users`.`ID` IS NOT NULL AND `glpi_$table`.`FK_users` ='0' "; $result2 = $DB->query($query2); if ($DB->numrows($result2)>0) { while ($data=$DB->fetch_assoc($result2)) { $query3 = "UPDATE `glpi_$table` SET `FK_users` = '".$data["USER"]."' WHERE `ID` = '".$data["ID"]."'"; $DB->query($query3); } } } } } //// Group management // Manage old plugin table if (TableExists("glpi_groups") && FieldExists("glpi_groups","extend", false)) { $query = "ALTER TABLE `glpi_groups` RENAME `glpi_plugin_droits_groups`"; $DB->queryOrDie($query, "0.68 rename plugin groups table"); } if (!TableExists("glpi_groups")) { $query = "CREATE TABLE `glpi_groups` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) default NULL, `comments` text, `ldap_field` varchar(255) default NULL, `ldap_value` varchar(255) default NULL, PRIMARY KEY (`ID`), KEY `name` (`name`), KEY `ldap_field` (`ldap_field`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.68 add groups"); $query = "INSERT INTO `glpi_display` (`type`, `num`, `rank`, `FK_users`) VALUES ('".GROUP_TYPE."', '16', '1', '0')"; $DB->queryOrDie($query, "0.68 add groups search config"); } if (!TableExists("glpi_users_groups")) { $query = "CREATE TABLE `glpi_users_groups` ( `ID` int(11) NOT NULL auto_increment, `FK_users` int(11) default '0', `FK_groups` int(11) default '0', PRIMARY KEY (`ID`), UNIQUE KEY `FK_users` (`FK_users`,`FK_groups`), KEY `FK_users_2` (`FK_users`), KEY `FK_groups` (`FK_groups`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.68 add users_groups"); } if (!FieldExists("glpi_config","ldap_field_group", false)) { $query = "ALTER TABLE `glpi_config` ADD `ldap_field_group` varchar(255) NULL"; $DB->queryOrDie($query, "0.68 add ldap_field_group in config"); } if (!FieldExists("glpi_tracking","request_type", false)) { $query = "ALTER TABLE `glpi_tracking` ADD `request_type` tinyint(2) DEFAULT '0' AFTER `author`"; $DB->queryOrDie($query, "0.68 add request_type in tracking"); } // History update for software if (FieldExists("glpi_history","device_internal_action", false)) { $query = "ALTER TABLE `glpi_history` CHANGE `device_internal_action` `linked_action` TINYINT( 4 ) NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.68 alater glpi_history"); } if (!TableExists("glpi_alerts")) { $query = "CREATE TABLE `glpi_alerts` ( `ID` int(11) NOT NULL auto_increment, `device_type` int(11) default '0', `FK_device` int(11) default '0', `type` int(11) default '0', `date` timestamp NULL default CURRENT_TIMESTAMP, PRIMARY KEY (`ID`), UNIQUE KEY `alert` (`device_type`,`FK_device`,`type`), KEY `item` (`device_type`,`FK_device`), KEY `device_type` (`device_type`), KEY `FK_device` (`FK_device`), KEY `type` (`type`), KEY `date` (`date`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.68 add alerts"); } if (!FieldExists("glpi_contracts","alert", false)) { $query = "ALTER TABLE `glpi_contracts` ADD `alert` tinyint(2) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.68 add alert in contracts"); } if (!FieldExists("glpi_infocoms","alert", false)) { $query = "ALTER TABLE `glpi_infocoms` ADD `alert` tinyint(2) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.68 add alert in infocoms"); } if (!FieldExists("glpi_config","contract_alerts", false)) { $query = "ALTER TABLE `glpi_config` ADD `contract_alerts` tinyint(2) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.68 add contract_alerts in config"); } if (!FieldExists("glpi_config","infocom_alerts", false)) { $query = "ALTER TABLE `glpi_config` ADD `infocom_alerts` tinyint(2) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.68 add infocom_alerts in config"); } if (!FieldExists("glpi_tracking","FK_group", false)) { $query = "ALTER TABLE `glpi_tracking` ADD `FK_group` int(11) NOT NULL DEFAULT '0' AFTER `author`"; $DB->queryOrDie($query, "0.68 add FK_group in tracking"); } if (!FieldExists("glpi_config","cartridges_alert", false)) { $query = "ALTER TABLE `glpi_config` ADD `cartridges_alert` int(11) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.68 add cartridges_alert in config"); } if (!FieldExists("glpi_config","consumables_alert", false)) { $query = "ALTER TABLE `glpi_config` ADD `consumables_alert` int(11) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.68 add consumables_alert in config"); } if (!FieldExists("glpi_contacts","firstname", false)) { $que = "ALTER TABLE `glpi_contacts` ADD `firstname` varchar(255) DEFAULT '' AFTER `name`"; $DB->queryOrDie($query, "0.68 add firstname in contacts"); } if (!FieldExists("glpi_contacts","mobile", false)) { $query = "ALTER TABLE `glpi_contacts` ADD `mobile` varchar(255) DEFAULT '' AFTER `phone2`"; $DB->queryOrDie($query, "0.68 add mobile in contacts"); } if (!FieldExists("glpi_enterprises","country", false)) { $query = "ALTER TABLE `glpi_enterprises` ADD `country` varchar(255) DEFAULT '' AFTER `address`"; $DB->queryOrDie($query, "0.68 add country in enterprises"); } if (!FieldExists("glpi_enterprises","state", false)) { $query = "ALTER TABLE `glpi_enterprises` ADD `state` varchar(255) DEFAULT '' AFTER `address`"; $DB->queryOrDie($query, "0.68 add state in enterprises"); } if (!FieldExists("glpi_enterprises","town", false)) { $query = "ALTER TABLE `glpi_enterprises` ADD `town` varchar(255) DEFAULT '' AFTER `address`"; $DB->queryOrDie($query, "0.68 add town in enterprises"); } if (!FieldExists("glpi_enterprises","postcode", false)) { $query = "ALTER TABLE `glpi_enterprises` ADD `postcode` varchar(255) DEFAULT '' AFTER `address`"; $DB->queryOrDie($query, "0.68 add postcode in enterprises"); } if (!FieldExists("glpi_contracts","renewal", false)) { $query = "ALTER TABLE `glpi_contracts` ADD `renewal` tinyint(2) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.68 add renewal in contracts"); } // Update contract periodicity and facturation $values = array("4" => "6", "5" => "12", "6" => "24"); foreach ($values as $key => $val) { $query = "UPDATE `glpi_contracts` SET `periodicity` = '$val' WHERE `periodicity` = '$key'"; $DB->queryOrDie($query, "0.68 update contract periodicity value"); $query = "UPDATE `glpi_contracts` SET `facturation` = '$val' WHERE `facturation` = '$key'"; $DB->queryOrDie($query, "0.68 update contract facturation value"); } // Add user fields if (!FieldExists("glpi_users","mobile", false)) { $query = "ALTER TABLE `glpi_users` ADD `mobile` varchar(255) DEFAULT '' AFTER `phone`"; $DB->queryOrDie($query, "0.68 add mobile in users"); } if (!FieldExists("glpi_users","phone2", false)) { $query = "ALTER TABLE `glpi_users` ADD `phone2` varchar(255) DEFAULT '' AFTER `phone`"; $DB->queryOrDie($query, "0.68 add phone2 in users"); } if (!FieldExists("glpi_users","firstname", false)) { $query = "ALTER TABLE `glpi_users` ADD `firstname` varchar(255) DEFAULT '' AFTER `realname`"; $DB->queryOrDie($query, "0.68 add firstname in users"); } if (!FieldExists("glpi_users","comments", false)) { $query = "ALTER TABLE `glpi_users` ADD `comments` TEXT"; $DB->queryOrDie($query, "0.68 add comments in users"); } if (!FieldExists("glpi_config","ldap_field_firstname", false)) { $query = "ALTER TABLE `glpi_config` ADD `ldap_field_firstname` varchar(200) DEFAULT 'givenname' AFTER `ldap_field_realname`"; $DB->queryOrDie($query, "0.68 add ldap_field_firstname in config"); } if (!FieldExists("glpi_config","ldap_field_mobile", false)) { $query = "ALTER TABLE `glpi_config` ADD `ldap_field_mobile` varchar(200) DEFAULT 'mobile' AFTER `ldap_field_phone`"; $DB->queryOrDie($query, "0.68 add ldap_mobile in config"); } if (!FieldExists("glpi_config","ldap_field_phone2", false)) { $query = "ALTER TABLE `glpi_config` ADD `ldap_field_phone2` varchar(200) DEFAULT 'homephone' AFTER `ldap_field_phone`"; $DB->queryOrDie($query, "0.68 add ldap_field_phone2 in config"); } } // fin 0.68 ##################################################################################### /** * NOT USED IN CORE - Used for update process - Replace bbcode in text by html tag * used in update_065_068.php * * @param $string string: initial string * * @return formatted string **/ function rembo($string) { // Adapte de PunBB //Copyright (C) Rickard Andersson (rickard@punbb.org) // If the message contains a code tag we have to split it up // (text within [code][/code] shouldn't be touched) if (strpos($string, '[code]') !== false && strpos($string, '[/code]') !== false) { list($inside, $outside) = split_text($string, '[code]', '[/code]'); $outside = array_map('trim', $outside); $string = implode('<">', $outside); } $pattern = array('#\[b\](.*?)\[/b\]#s', '#\[i\](.*?)\[/i\]#s', '#\[u\](.*?)\[/u\]#s', '#\[s\](.*?)\[/s\]#s', '#\[c\](.*?)\[/c\]#s', '#\[g\](.*?)\[/g\]#s', '#\[email\](.*?)\[/email\]#', '#\[email=(.*?)\](.*?)\[/email\]#', '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s'); $replace = array('$1', '$1', '$1', '$1', '
    $1
    ', '$1', '$1', '$2', '$2'); // This thing takes a while! :) $string = preg_replace($pattern, $replace, $string); $string = clicurl($string); $string = autop($string); // If we split up the message before we have to concatenate it together again (code tags) if (isset($inside)) { $outside = explode('<">', $string); $string = ''; $num_tokens = count($outside); for ($i = 0 ; $i < $num_tokens ; ++$i) { $string .= $outside[$i]; if (isset($inside[$i])) { $string .= '

    ' . '
    Code:

    '.
                           trim($inside[$i]).'
    '; } } } return $string; } /** * Rend une url cliquable htp/https/ftp meme avec une variable Get * * @param $chaine * * @return $string **/ function clicurl($chaine) { $text = preg_replace("`((?:https?|ftp)://\S+)(\s|\z)`", '$1$2', $chaine); return $text; } /** * Met en "ordre" une chaine avant affichage * Remplace trés AVANTAGEUSEMENT nl2br * * @param $pee * @param $br * * @return $string **/ function autop($pee, $br=1) { // Thanks to Matthew Mullenweg $pee = preg_replace("/(\r\n|\n|\r)/", "\n", $pee); // cross-platform newlines $pee = preg_replace("/\n\n+/", "\n\n", $pee); // take care of duplicates $pee = preg_replace('/\n?(.+?)(\n\n|\z)/s', "

    $1

    \n", $pee); // make paragraphs, including one at the end if ($br) { $pee = preg_replace('|(?)\s*\n|', "
    \n", $pee); // optionally make line breaks } return $pee; } /** * Split the message into tokens ($inside contains all text inside $start and $end, and $outside contains all text outside) * * @param $text * @param $start * @param $end * * @return array **/ function split_text($text, $start, $end) { // Adapté de PunBB //Copyright (C) Rickard Andersson (rickard@punbb.org) $tokens = explode($start, $text); $outside[] = $tokens[0]; $num_tokens = count($tokens); for ($i=1 ; $i<$num_tokens ; ++$i) { $temp = explode($end, $tokens[$i]); $inside[] = $temp[0]; $outside[] = $temp[1]; } return array($inside, $outside); } ?> glpi-0.84.3+dfsg.1/install/update_0681_07.php000066400000000000000000002423161226600447100202560ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /// Update from 0.68.1 to 0.7 function update0681to07() { global $DB, $CFG_GLPI; $DB->query("SET NAMES 'latin1'"); // Improve user table : if (!isIndex("glpi_users", "firstname")) { $query = "ALTER TABLE `glpi_users` ADD INDEX (`firstname`)"; $DB->queryOrDie($query, "0.7 alter users add index on firstname"); } if (!isIndex("glpi_users", "realname")) { $query = "ALTER TABLE `glpi_users` ADD INDEX (`realname`)"; $DB->queryOrDie($query, "0.7 alter users add index on realname"); } // Decimal problem if (FieldExists("glpi_infocoms", "value", false)) { $query = "ALTER TABLE `glpi_infocoms` CHANGE `value` `value` DECIMAL( 20, 4 ) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.7 alter value in glpi_infocoms"); } if (FieldExists("glpi_infocoms", "warranty_value", false)) { $query = "ALTER TABLE `glpi_infocoms` CHANGE warranty_value warranty_value DECIMAL( 20, 4 ) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.7 alter warranty_value in glpi_infocoms"); } if (FieldExists("glpi_tracking", "cost_time", false)) { $query = "ALTER TABLE `glpi_tracking` CHANGE cost_time cost_time DECIMAL( 20, 4 ) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.7 alter cost_time in glpi_tracking"); } if (FieldExists("glpi_tracking", "cost_fixed", false)) { $query = "ALTER TABLE `glpi_tracking` CHANGE cost_fixed cost_fixed DECIMAL( 20, 4 ) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.7 alter cost_fixed in glpi_tracking"); } if (FieldExists("glpi_tracking", "cost_material", false)) { $query = "ALTER TABLE `glpi_tracking` CHANGE cost_material cost_material DECIMAL( 20, 4 ) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.7 alter cost_material in glpi_tracking"); } if (!FieldExists("glpi_config", "decimal_number", false)) { $query = "ALTER TABLE `glpi_config` ADD `decimal_number` INT DEFAULT '2'"; $DB->queryOrDie($query, "0.7 add decimal_number in glpi_config"); } $CFG_GLPI["decimal_number"] = 2; if (!FieldExists("glpi_config", "cas_logout", false)) { $query = "ALTER TABLE `glpi_config` ADD `cas_logout` VARCHAR( 255 ) NULL AFTER `cas_uri`"; $DB->queryOrDie($query, "0.7 add cas_logout in glpi_config"); } if (!isIndex("glpi_computer_device", "specificity")) { $query = "ALTER TABLE `glpi_computer_device` ADD INDEX (`specificity`)"; $DB->queryOrDie($query, "0.7 add index specificity in glpi_computer_device"); } if (!FieldExists("glpi_docs", "comments", false)) { $query = "ALTER TABLE `glpi_docs` CHANGE `comment` `comments` TEXT DEFAULT NULL "; $DB->queryOrDie($query, "0.7 alter docs.comment to be comments"); } // Update polish langage file $query = "UPDATE `glpi_users` SET `language` = 'pl_PL' WHERE `language` = 'po_PO'"; $DB->queryOrDie($query, "0.7 update polish lang file"); // Add show_group_hardware if (!FieldExists("glpi_profiles", "show_group_hardware", false)) { $query = "ALTER TABLE `glpi_profiles` ADD `show_group_hardware` CHAR(1) NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.7 alter glpi_profiles add show_group_hardware"); $query = "UPDATE `glpi_profiles` SET `show_group_hardware` = `show_group_ticket`"; $DB->queryOrDie($query, "0.7 alter glpi_profiles add show_group_hardware"); } // Clean doc association if (FieldExists("glpi_doc_device", "is_template", false)) { $query = "ALTER TABLE `glpi_doc_device` DROP `is_template`"; $DB->queryOrDie($query, "0.7 delete is_template from glpi_doc_device"); } // Clean contract association if (FieldExists("glpi_contract_device", "is_template", false)) { $query = "ALTER TABLE `glpi_contract_device` DROP `is_template`"; $DB->queryOrDie($query, "0.7 delete is_template from glpi_contract_device"); } //// ENTITY MANAGEMENT if (!TableExists("glpi_entities")) { $query = "CREATE TABLE `glpi_entities` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL, `parentID` int(11) NOT NULL default '0', `completename` text NOT NULL, `comments` text, `level` int(11) default NULL, PRIMARY KEY (`ID`), UNIQUE KEY `name` (`name`,`parentID`), KEY `parentID` (`parentID`) ) ENGINE=MyISAM"; $DB->queryOrDie($query, "0.7 create glpi_entities"); } if (!TableExists("glpi_entities_data")) { $query = "CREATE TABLE `glpi_entities_data` ( `ID` int(11) NOT NULL auto_increment, `FK_entities` int(11) NOT NULL default '0', `address` text, `postcode` varchar(255) default NULL, `town` varchar(255) default NULL, `state` varchar(255) default NULL, `country` varchar(255) default NULL, `website` varchar(200) default NULL, `phonenumber` varchar(200) default NULL, `fax` varchar(255) default NULL, `email` varchar(255) default NULL, `notes` longtext, PRIMARY KEY (`ID`), UNIQUE KEY `FK_entities` (`FK_entities`) ) ENGINE=MyISAM"; $DB->queryOrDie($query, "0.7 create glpi_entities_data"); } // Add default profile to all users without any profile $query = "SELECT `ID` FROM `glpi_profiles` WHERE `is_default` = '1'"; if ($result=$DB->query($query)) { if ($DB->numrows($result)>0) { $IDprof = $DB->result($result,0,0); $query = "SELECT `glpi_users`.`ID` FROM `glpi_users` LEFT JOIN `glpi_users_profiles` ON (`glpi_users_profiles`.`FK_users` = `glpi_users`.`ID`) WHERE `glpi_users_profiles`.`ID` IS NULL"; if ($result=$DB->query($query)) { if ($DB->numrows($result)>0) { while ($data=$DB->fetch_assoc($result)) { $query = "INSERT INTO `glpi_users_profiles` (`FK_users`, `FK_profiles`) VALUES ('".$data['ID']."', '$IDprof') "; $DB->query($query); } } } } } if (!FieldExists("glpi_users_profiles", "FK_entities", false)) { // Clean Datas $query = "DELETE FROM `glpi_users_profiles` WHERE `FK_users` = '0'"; $DB->queryOrDie($query, "0.7 clean datas of glpi_users_profiles"); $query = " ALTER TABLE `glpi_users_profiles` ADD `FK_entities` INT NOT NULL DEFAULT '0', ADD `recursive` SMALLINT NOT NULL DEFAULT '1', ADD `dynamic` SMALLINT NOT NULL DEFAULT '0' "; $DB->queryOrDie($query, "0.7 alter glpi_users_profiles"); } // Correct for clean active field for beta users if (FieldExists("glpi_users_profiles", "active", false)) { $query = "ALTER TABLE `glpi_users_profiles` DROP `active` "; $DB->queryOrDie($query, "0.7 clean active field for beta of glpi_users_profiles"); } if (!FieldExists("glpi_users", "active", false)) { $query = "ALTER TABLE `glpi_users` ADD `active` INT(2) NOT NULL DEFAULT '1' "; $DB->queryOrDie($query, "0.7 add active field for beta of glpi_users"); if (!isIndex("glpi_users", "active")) { $query = "ALTER TABLE `glpi_users` ADD INDEX (`active`)"; $DB->queryOrDie($query, "0.7 add index active in glpi_users"); } } // Add entity tags to tables $tables = array("glpi_cartridges_type", "glpi_computers", "glpi_consumables_type", "glpi_contacts", "glpi_contracts", "glpi_docs", "glpi_dropdown_locations", "glpi_dropdown_netpoint", "glpi_enterprises", "glpi_groups", "glpi_monitors", "glpi_networking", "glpi_peripherals", "glpi_phones", "glpi_printers", "glpi_reminder", "glpi_software", "glpi_tracking"); // "glpi_kbitems","glpi_dropdown_kbcategories", -> easier to manage // "glpi_followups" -> always link to tracking ? // "glpi_licenses" -> always link to software ? // "glpi_infocoms" -> always link to item ? PB on reports stats ? // "glpi_links" -> global items easier to manage // "glpi_reservation_item", "glpi_state_item" -> always link to item ? but info maybe needed foreach ($tables as $tbl) { if (!FieldExists($tbl, "FK_entities", false)) { $query = "ALTER TABLE `$tbl` ADD `FK_entities` INT NOT NULL DEFAULT '0' AFTER `ID`"; $DB->queryOrDie($query, "0.7 add FK_entities in $tbl"); } if (!isIndex($tbl, "FK_entities")) { $query = "ALTER TABLE `$tbl` ADD INDEX (`FK_entities`)"; $DB->queryOrDie($query, "0.7 add index FK_entities in $tbl"); } } // Regenerate Indexes : $tables = array( "glpi_dropdown_locations" ); foreach ($tables as $tbl) { if (isIndex($tbl, "name")) { $query = "ALTER TABLE `$tbl` DROP INDEX `name`"; $DB->queryOrDie($query, "0.7 drop index name in $tbl"); } if (isIndex($tbl, "parentID_2")) { $query = "ALTER TABLE `$tbl` DROP INDEX `parentID_2`"; $DB->queryOrDie($query, "0.7 drop index name in $tbl"); } $query = "ALTER TABLE `$tbl` ADD UNIQUE(`name`,`parentID`,`FK_entities`)"; $DB->queryOrDie($query, "0.7 add index name in $tbl"); } if (isIndex("glpi_users_profiles", "FK_users_profiles")) { $query = "ALTER TABLE `glpi_users_profiles` DROP INDEX `FK_users_profiles`"; $DB->queryOrDie($query, "0.7 drop index FK_users_profiles in glpi_users_profiles"); } if (!isIndex("glpi_users_profiles", "FK_entities")) { $query = "ALTER TABLE `glpi_users_profiles` ADD INDEX (`FK_entities`)"; $DB->queryOrDie($query, "0.7 add index FK_entities in glpi_users_profiles"); } if (!isIndex("glpi_users_profiles", "recursive")) { $query = "ALTER TABLE `glpi_users_profiles` ADD INDEX (`recursive`)"; $DB->queryOrDie($query, "0.7 add index recursive in glpi_users_profiles"); } //// MULTIAUTH MANAGEMENT if (!TableExists("glpi_auth_ldap")) { $query = "CREATE TABLE `glpi_auth_ldap` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL, `ldap_host` varchar(255) default NULL, `ldap_basedn` varchar(255) default NULL, `ldap_rootdn` varchar(255) default NULL, `ldap_pass` varchar(255) default NULL, `ldap_port` varchar(255) NOT NULL default '389', `ldap_condition` varchar(255) default NULL, `ldap_login` varchar(255) NOT NULL default 'uid', `ldap_use_tls` varchar(255) NOT NULL default '0', `ldap_field_group` varchar(255) default NULL, `ldap_group_condition` varchar(255) default NULL, `ldap_search_for_groups` int NOT NULL default '0', `ldap_field_group_member` varchar(255) default NULL, `ldap_field_email` varchar(255) default NULL, `ldap_field_realname` varchar(255) default NULL, `ldap_field_firstname` varchar(255) default NULL, `ldap_field_phone` varchar(255) default NULL, `ldap_field_phone2` varchar(255) default NULL, `ldap_field_mobile` varchar(255) default NULL, `ldap_field_comments` TEXT default NULL, PRIMARY KEY (`ID`) ) ENGINE=MyISAM"; $DB->queryOrDie($query, "0.7 create glpi_auth_ldap"); $query = "SELECT * FROM `glpi_config` WHERE `ID` = '1'"; $result = $DB->query($query); $config = $DB->fetch_array($result); if (!empty($config["ldap_host"])) { //Transfer ldap information into the new table $query = "INSERT INTO `glpi_auth_ldap` VALUES (NULL, '".$config["ldap_host"]."', '".$config["ldap_host"]."', '".$config["ldap_basedn"]."', '".$config["ldap_rootdn"]."', '".$config["ldap_pass"]."', ".$config["ldap_port"].", '".$config["ldap_condition"]."', '".$config["ldap_login"]."', '".$config["ldap_use_tls"]."', '".$config["ldap_field_group"]."', '".$config["ldap_condition"]."', ".$config["ldap_search_for_groups"].", '".$config["ldap_field_group_member"]."', '".$config["ldap_field_email"]."', '".$config["ldap_field_realname"]."', '".$config["ldap_field_firstname"]."', '".$config["ldap_field_phone"]."', '".$config["ldap_field_phone2"]."', '".$config["ldap_field_mobile"]."', NULL)"; $DB->queryOrDie($query, "0.7 transfert of ldap parameters into glpi_auth_ldap"); } $query = "ALTER TABLE `glpi_config` DROP `ldap_field_email`, DROP `ldap_port`, DROP `ldap_host`, DROP `ldap_basedn`, DROP `ldap_rootdn`, DROP `ldap_pass`, DROP `ldap_field_location`, DROP `ldap_field_realname`, DROP `ldap_field_firstname`, DROP `ldap_field_phone`, DROP `ldap_field_phone2`, DROP `ldap_field_mobile`, DROP `ldap_condition`, DROP `ldap_login`, DROP `ldap_use_tls`, DROP `ldap_field_group`, DROP `ldap_group_condition`, DROP `ldap_search_for_groups`, DROP `ldap_field_group_member`"; $DB->queryOrDie($query, "0.7 drop ldap fields from glpi_config"); } if (!FieldExists("glpi_users", "id_auth", false)) { $query = "ALTER TABLE `glpi_users` ADD `id_auth` INT NOT NULL DEFAULT '-1', ADD `auth_method` INT NOT NULL DEFAULT '-1', ADD `last_login` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', ADD `date_mod` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'"; $DB->queryOrDie($query, "0.7 add auth_method & id_method in glpi_users"); } if (!TableExists("glpi_auth_mail")) { $query = "CREATE TABLE `glpi_auth_mail` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL, `imap_auth_server` varchar(200) default NULL, `imap_host` varchar(200) default NULL, PRIMARY KEY (`ID`) ) ENGINE=MyISAM"; $DB->queryOrDie($query, "0.7 create glpi_auth_mail"); $query = "select * from glpi_config WHERE ID=1"; $result = $DB->query($query); $config = $DB->fetch_array($result); if (!empty($config["imap_host"])) { //Transfer ldap information into the new table $query = "INSERT INTO `glpi_auth_mail` VALUES (NULL, '".$config["imap_host"]."', '".$config["imap_auth_server"]."', '".$config["imap_host"]."')"; $DB->queryOrDie($query, "0.7 transfert of mail parameters into glpi_auth_mail"); } $query = "ALTER TABLE `glpi_config` DROP `imap_auth_server`, DROP `imap_host`"; $DB->queryOrDie($query, "0.7 drop mail fields from glpi_config"); } // Clean state_item -> add a field from tables if (TableExists("glpi_state_item")) { $state_type = array(SOFTWARE_TYPE => 'glpi_software', COMPUTER_TYPE => 'glpi_computers', PRINTER_TYPE => 'glpi_printers', MONITOR_TYPE => 'glpi_monitors', PERIPHERAL_TYPE => 'glpi_peripherals', NETWORKING_TYPE => 'glpi_networking', PHONE_TYPE => 'glpi_phones'); foreach ($state_type as $type => $table) { if (!FieldExists($table, "state", false)) { $query = "ALTER TABLE `$table` ADD `state` INT NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.7 add state field to $table"); $query2 = "SELECT * FROM `glpi_state_item` WHERE `device_type` = '$type'"; $result = $DB->query($query2); if ($DB->numrows($result)) { while ($data = $DB->fetch_array($result)) { $query3 = "UPDATE `$table` SET `state` = '". $data["state"]."' WHERE `ID` = '".$data["id_device"]."'"; $DB->queryOrDie($query3, "0.7 update state field value to $table"); } } } } $query = "DROP TABLE `glpi_state_item` "; $DB->queryOrDie($query, "0.7 drop table state_item"); $query = "INSERT INTO `glpi_display` (`type`, `num`, `rank`, `FK_users`) VALUES (22, 31, 1, 0)"; $DB->queryOrDie($query, "0.7 add default search for states"); // Add for reservation $query = "INSERT INTO `glpi_display` (`type`, `num`, `rank`, `FK_users`) VALUES ( 29, 4, 1, 0)"; $DB->queryOrDie($query, "0.7 add defaul search for reservation"); $query = "INSERT INTO `glpi_display` (`type`, `num`, `rank`, `FK_users`) VALUES ( 29, 3, 2, 0)"; $DB->queryOrDie($query, "0.7 add defaul search for reservation"); } // Add ticket_tco for hardwares $tco_tbl = array(SOFTWARE_TYPE => 'glpi_software', COMPUTER_TYPE => 'glpi_computers', PRINTER_TYPE => 'glpi_printers', MONITOR_TYPE => 'glpi_monitors', PERIPHERAL_TYPE => 'glpi_peripherals', NETWORKING_TYPE => 'glpi_networking', PHONE_TYPE => 'glpi_phones'); foreach ($tco_tbl as $type => $table) { if (!FieldExists($table, "ticket_tco", false)) { $query = "ALTER TABLE `$table` ADD `ticket_tco` DECIMAL( 20, 4 ) DEFAULT '0.0000'"; $DB->queryOrDie($query, "0.7 alter $table add ticket_tco"); // Update values $query = "SELECT DISTINCT `device_type`, `computer` FROM `glpi_tracking` WHERE `device_type` = '$type' AND (`cost_time` > 0 OR `cost_fixed` > 0 OR `cost_material` > 0)"; $result = $DB->queryOrDie($query, "0.7 update ticket_tco"); if ($DB->numrows($result)) { while ($data = $DB->fetch_array($result)) { $query2 = "UPDATE `$table` SET `ticket_tco` = '".computeTicketTco($type, $data["computer"])."' WHERE `ID` = '".$data["computer"]."'"; $DB->queryOrDie($query2, "0.7 update ticket_tco"); } } } } if (!FieldExists("glpi_software", "helpdesk_visible", false)) { $query = "ALTER TABLE `glpi_software` ADD `helpdesk_visible` INT NOT NULL default '1'"; $DB->queryOrDie($query, "0.7 add helpdesk_visible in glpi_software"); } if (!TableExists("glpi_dropdown_manufacturer")) { $query = "CREATE TABLE `glpi_dropdown_manufacturer` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL, `comments` text, PRIMARY KEY (`ID`), KEY `name` (`name`) ) ENGINE=MyISAM"; $DB->queryOrDie($query, "0.7 add dropdown_manufacturer table"); } if (countElementsInTable("glpi_dropdown_manufacturer")==0) { // Fill table $query = "SELECT * FROM `glpi_enterprises` ORDER BY `ID`"; if ($result = $DB->query($query)) { if ($DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $data = Toolbox::addslashes_deep($data); $comments = ""; if (!empty($data['address'])) { if (!empty($comments)) { $comments .= "\n"; } $comments .= sprintf(__('%1$s: %2$s'), __('Address'), $data['address']); } if (!empty($data['postcode']) || !empty($data['town'])) { if (!empty($comments)) { $comments = sprintf(__('%1$s %2$s', $comments, __('Address')))."\n"; } //TRANS: %1$s is postcode, %2$s is town $comments .= sprintf(__('%1$s %2$s'), $data['postcode'], $data['town']); } if (!empty($data['state']) || !empty($data['country'])) { if (!empty($comments)) { $comments = sprintf(__('%1$s %2$s', $comments, __('Address')))."\n"; } //TRANS: %1$s is country, %2$s is state $comments .= sprintf(__('%1$s %2$s'), $data['country'], $data['state']); } if (!empty($data['website'])) { if (!empty($comments)) { $comments .= "\n"; } $comments .= sprintf(__('%1$s: %2$s'), __('Website'), $data['website']); } if (!empty($data['phonenumber'])) { if (!empty($comments)) { $comments .= "\n"; } $comments .= sprintf(__('%1$s: %2$s'), __('Phone'), $data['phonenumber']); } if (!empty($data['fax'])) { if (!empty($comments)) { $comments .= "\n"; } $comments .= sprintf(__('%1$s: %2$s'), __('Fax'), $data['fax']); } if (!empty($data['email'])) { if (!empty($comments)) { $comments .= "\n"; } $comments .= sprintf(__('%1$s: %2$s'), __('Email'), $data['email']); } if (!empty($data['comments'])) { if (!empty($comments)) { $comments .= "\n"; } $comments .= $data['comments']; } if (!empty($data['notes'])) { if (!empty($comments)) { $comments .= "\n"; } $comments .= $data['notes']; } $query2 = "INSERT INTO `glpi_dropdown_manufacturer` (ID, name, comments) VALUES ('".$data['ID'] . "', '".$data['name']."', '".$comments."')"; $DB->queryOrDie($query2, "0.7 add manufacturer item"); } } } } if (isIndex("glpi_ocs_link", "ocs_id_2")) { $query = "ALTER TABLE `glpi_ocs_link` DROP INDEX `ocs_id_2` "; $DB->queryOrDie($query, "0.7 alter ocs_link clean index ocs_id"); } if (isIndex("glpi_ocs_link", "ocs_id")) { $query = "ALTER TABLE `glpi_ocs_link` DROP INDEX `ocs_id` "; $DB->queryOrDie($query, "0.7 alter ocs_link clean index ocs_id"); } if (!FieldExists("glpi_ocs_link", "ocs_server_id", false)) { $query = "ALTER TABLE `glpi_ocs_link` ADD `ocs_server_id` int(11) NOT NULL"; $DB->queryOrDie($query, "0.7 add ocs_server_id in glpi_ocs_link"); $query = "UPDATE `glpi_ocs_link` SET `ocs_server_id` = '1'"; $DB->queryOrDie($query, "0.7 update ocs_server_id=1 in glpi_ocs_link"); } if (!isIndex("glpi_ocs_link", "ocs_server_id")) { // Clean duplicates $query = "SELECT COUNT(*) AS CPT, `ocs_id` FROM `glpi_ocs_link` GROUP BY `ocs_id` HAVING CPT > 1"; if ($result=$DB->query($query)) { if ($DB->numrows($result)>0) { while ($data=$DB->fetch_array($result)) { // Skip first $query = "SELECT `ID` FROM `glpi_ocs_link` WHERE `ocs_id` = '".$data['ocs_id']."' ORDER BY `last_update` DESC LIMIT 1,99999"; if ($result2=$DB->query($query)) { if ($DB->numrows($result2)) { while ($data2=$DB->fetch_array($result2)) { $query = "DELETE FROM `glpi_ocs_link` WHERE `ID` ='".$data2['ID']."'"; $DB->queryOrDie($query, "0.7 clean to update ocs_server_id=1 in glpi_ocs_link"); } } } } } } $query = "ALTER TABLE `glpi_ocs_link` ADD UNIQUE `ocs_server_id` (`ocs_server_id`, `ocs_id`)"; $DB->queryOrDie($query, "0.7 alter ocs_link add index ocs_server_id"); } if (!isIndex("glpi_ocs_link", "`ocs_deviceid`")) { $query = "ALTER TABLE `glpi_ocs_link` ADD INDEX (`ocs_deviceid`)"; $DB->queryOrDie($query, "0.7 alter ocs_link add index ocs_deviceid"); } if (!FieldExists("glpi_ocs_config", "tplname", false)) { $query = "ALTER TABLE `glpi_ocs_config` ADD `name` varchar(200) default NULL AFTER `ID`, ADD `is_template` enum('0','1') NOT NULL default '0', ADD `tplname` varchar(200) default NULL, ADD `date_mod` datetime default NULL"; $DB->queryOrDie($query, "0.7 add name, is_template, tplname, date_mod in glpi_ocs_link"); $query = "UPDATE `glpi_ocs_config` SET `name` = `ocs_db_host`"; $DB->queryOrDie($query, "0.7 add name in glpi_ocs_config"); } if (!FieldExists("glpi_ocs_config", "import_registry", false)) { $query = "ALTER TABLE `glpi_ocs_config` ADD `import_registry` INT NOT NULL default '0' AFTER `import_device_modems`"; $DB->queryOrDie($query, "0.7 add import_registry in glpi_ocs_config"); } if (FieldExists("glpi_ocs_config", "import_tag_field", false)) { $query = "ALTER TABLE `glpi_ocs_config` DROP `import_tag_field`"; $DB->queryOrDie($query, "0.7 drop import_tag_field in glpi_ocs_config"); } if (!FieldExists("glpi_ocs_config", "import_software_licensetype", false)) { $query = "ALTER TABLE `glpi_ocs_config` ADD `import_software_licensetype` VARCHAR(255) DEFAULT 'global' AFTER `import_software`"; $DB->queryOrDie($query, "0.7 add import_software_licensetype in glpi_ocs_config"); } if (!FieldExists("glpi_ocs_config", "import_software_buy", false)) { $query = "ALTER TABLE `glpi_ocs_config` ADD `import_software_buy` INT NOT NULL DEFAULT '1' AFTER `import_software`"; $DB->queryOrDie($query, "0.7 add import_software_buy in glpi_ocs_config"); } if (!TableExists("glpi_registry")) { $query = "CREATE TABLE `glpi_registry` ( `ID` int(10) NOT NULL auto_increment, `computer_id` int(10) NOT NULL DEFAULT '0', `registry_hive` varchar(45) NOT NULL, `registry_path` varchar(255) NOT NULL, `registry_value` varchar(255) NOT NULL, PRIMARY KEY (`ID`), KEY `computer_id` (`computer_id`) ) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8"; $DB->queryOrDie($query, "0.7 add glpi_registry table"); } if (!FieldExists("glpi_ocs_link", "import_ip", false)) { $query = "ALTER TABLE `glpi_ocs_link` ADD COLUMN `import_ip` LONGTEXT"; $DB->queryOrDie($query, "0.7 add import_ip in glpi_ocs_link"); } //// Enum clean // Enum 0-1 $enum01 = array(); $template_tables = array("glpi_computers", "glpi_networking", "glpi_printers", "glpi_monitors", "glpi_peripherals", "glpi_software", "glpi_phones", "glpi_ocs_config"); foreach ($template_tables as $table) { if (!isset($enum01[$table])) { $enum01[$table] = array (); } $enum01[$table][] = "is_template"; } $enum01["glpi_config"][] = "auto_assign"; $enum01["glpi_config"][] = "public_faq"; $enum01["glpi_config"][] = "url_in_mail"; $enum01["glpi_profiles"][] = "is_default"; $enum01["glpi_monitors"][] = "is_global"; $enum01["glpi_peripherals"][] = "is_global"; $enum01["glpi_phones"][] = "is_global"; $enum01["glpi_printers"][] = "is_global"; $enum01["glpi_reminder"][] = "rv"; $enum01["glpi_contract_device"][] = "is_template"; $enum01["glpi_doc_device"][] = "is_template"; foreach ($enum01 as $table => $fields) { foreach ($fields as $key => $field) { if (FieldExists($table, $field, false)) { $query = "ALTER TABLE `$table` ADD `tmp_convert_enum` SMALLINT NOT NULL DEFAULT '0' AFTER `$field` "; $DB->queryOrDie($query, "0.7 alter $table add new field tmp_convert_enum"); $query = "UPDATE `$table` SET `tmp_convert_enum` = '1' WHERE `$field` = '1'"; $DB->queryOrDie($query, "0.7 update $table to set correct values to alod enum01 $field"); $query = "UPDATE `$table` SET `tmp_convert_enum` = '0' WHERE `$field` = '0'"; $DB->queryOrDie($query, "0.7 update $table to set correct values to alod enum01 $field"); $query = "ALTER TABLE `$table` DROP `$field` "; $DB->queryOrDie($query, "0.7 alter $table drop tmp enum field"); $query = "ALTER TABLE `$table` CHANGE `tmp_convert_enum` `$field` SMALLINT NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.7 alter $table move enum $field to tmp field"); if ($table != "glpi_config" && $table != "glpi_profiles") { $query = "ALTER TABLE `$table` ADD KEY (`$field`)"; $DB->queryOrDie($query, "0.7 alter $table add deleted key"); } } } } $enumYN["N"]["glpi_contracts"][] = "monday"; // N $enumYN["N"]["glpi_contracts"][] = "saturday"; // N $enumYN["Y"]["glpi_device_drive"][] = "is_writer"; // Y $enumYN["N"]["glpi_device_control"][] = "raid"; // Y -> N $enumYN["Y"]["glpi_device_power"][] = "atx"; // Y $enumYN["N"]["glpi_licenses"][] = "oem"; // N $enumYN["Y"]["glpi_licenses"][] = "buy"; // Y $enumYN["N"]["glpi_software"][] = "is_update"; // N $enumYN["Y"]["glpi_type_docs"][] = "upload"; // Y $deleted_tables = array("glpi_computers", "glpi_networking", "glpi_printers", "glpi_monitors", "glpi_peripherals", "glpi_software", "glpi_cartridges_type", "glpi_contracts", "glpi_contacts", "glpi_enterprises", "glpi_docs", "glpi_phones", "glpi_consumables_type" ); foreach ($deleted_tables as $table) { if (!isset($enum01[$table])) { $enum01[$table] = array (); } $enumYN["N"][$table][] = "deleted"; } foreach ($enumYN as $default => $tmptbl) { foreach ($tmptbl as $table => $fields) { foreach ($fields as $key => $field) { if (FieldExists($table, $field, false)) { $newdef = 0; if ($default == "Y") { $newdef = 1; } $query = "ALTER TABLE `$table` ADD `tmp_convert_enum` SMALLINT NOT NULL DEFAULT '$newdef' AFTER `$field` "; $DB->queryOrDie($query, "0.7 alter $table add new field tmp_convert_enum"); $query = "UPDATE `$table` SET `tmp_convert_enum` = '1' WHERE `$field` = 'Y'"; $DB->queryOrDie($query, "0.7 update $table to set correct values to alod enum01 $field"); $query = "UPDATE `$table` SET `tmp_convert_enum` = '0' WHERE `$field` = 'N'"; $DB->queryOrDie($query, "0.7 update $table to set correct values to alod enum01 $field"); $query = "ALTER TABLE `$table` DROP `$field` "; $DB->queryOrDie($query, "0.7 alter $table drop tmp enum field"); $query = "ALTER TABLE `$table` CHANGE `tmp_convert_enum` `$field` SMALLINT NOT NULL DEFAULT '$newdef'"; $DB->queryOrDie($query, "0.7 alter $table move enum $field to tmp field"); if ($field == "deleted" || $table == "glpi_licenses" || $table == "glpi_software" || $table == "glpi_type_docs") { $query = "ALTER TABLE `$table` ADD KEY (`$field`)"; $DB->queryOrDie($query, "0.7 alter $table add deleted key"); } } } } } if (FieldExists("glpi_tracking", "is_group", false)) { $query = "ALTER TABLE `glpi_tracking` DROP `is_group`"; $DB->queryOrDie($query, "0.7 drop is_group from tracking"); } $enumYesNo["glpi_kbitems"][] = "faq"; $enumYesNo["glpi_tracking"][] = "emailupdates"; $enumYesNo["glpi_users"][] = "tracking_order"; foreach ($enumYesNo as $table => $fields) { foreach ($fields as $key => $field) { if (FieldExists($table, $field, false)) { $query = "ALTER TABLE `$table` ADD `tmp_convert_enum` SMALLINT NOT NULL DEFAULT '0' AFTER `$field` "; $DB->queryOrDie($query, "0.7 alter $table add new field tmp_convert_enum"); $query = "UPDATE `$table` SET `tmp_convert_enum` = '1' WHERE `$field` = 'yes'"; $DB->queryOrDie($query, "0.7 update $table to set correct values to alod enum01 $field"); $query = "UPDATE `$table` SET `tmp_convert_enum` = '0' WHERE `$field` = 'no'"; $DB->queryOrDie($query, "0.7 update $table to set correct values to alod enum01 $field"); $query = "ALTER TABLE `$table` DROP `$field` "; $DB->queryOrDie($query, "0.7 alter $table drop tmp enum field"); $query = "ALTER TABLE `$table` CHANGE `tmp_convert_enum` `$field` SMALLINT NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.7 alter $table move enum $field to tmp field"); if ($table == "glpi_kbitems") { $query = "ALTER TABLE `$table` ADD KEY (`$field`)"; $DB->queryOrDie($query, "0.7 alter $table add deleted key"); } } } } // Reste enum : glpi_tracking.status et glpi_device_gfxcard.interface if (FieldExists("glpi_tracking", "status", false)) { $query = "ALTER TABLE `glpi_tracking` CHANGE `status` `status` VARCHAR( 255 ) DEFAULT 'new'"; $DB->queryOrDie($query, "0.7 alter status from tracking"); } if (FieldExists("glpi_device_gfxcard", "interface", false)) { $query = "ALTER TABLE `glpi_device_gfxcard` CHANGE `interface` `interface` VARCHAR( 255 ) NULL DEFAULT 'PCI-X'"; $DB->queryOrDie($query, "0.7 alter interface from glpi_device_gfxcard"); } if (!TableExists("glpi_rules_actions")) { $query = "CREATE TABLE `glpi_rules_actions` ( `ID` int(11) NOT NULL auto_increment, `FK_rules` int(11) NOT NULL DEFAULT '0', `action_type` varchar(255) NOT NULL, `field` varchar(255) NOT NULL, `value` varchar(255) NOT NULL, PRIMARY KEY (`ID`), KEY `FK_rules` (`FK_rules`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8"; $DB->queryOrDie($query, "0.7 add table glpi_rules_descriptions"); } if (!TableExists("glpi_rules_criterias")) { $query = "CREATE TABLE `glpi_rules_criterias` ( `ID` int(11) NOT NULL auto_increment, `FK_rules` int(11) NOT NULL DEFAULT '0', `criteria` varchar(255) NOT NULL, `condition` smallint(4) NOT NULL DEFAULT '0', `pattern` varchar(255) NOT NULL, PRIMARY KEY (`ID`), KEY `FK_rules` (`FK_rules`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8"; $DB->queryOrDie($query, "0.7 add table glpi_rules_criterias"); } if (!TableExists("glpi_rules_descriptions")) { $query = "CREATE TABLE `glpi_rules_descriptions` ( `ID` int(11) NOT NULL auto_increment, `FK_entities` int(11) NOT NULL default '-1', `rule_type` smallint(4) NOT NULL DEFAULT '0', `ranking` int(11) NOT NULL DEFAULT '0', `name` varchar(255) NOT NULL, `description` text NOT NULL, `match` varchar(255) NOT NULL, PRIMARY KEY (`ID`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8"; $DB->queryOrDie($query, "0.7 add table glpi_rules_actions"); } if (!FieldExists("glpi_config", "use_cache", false)) { $query = "ALTER TABLE `glpi_config` ADD `use_cache` SMALLINT NOT NULL DEFAULT '1' AFTER `debug`"; $DB->queryOrDie($query, "0.7 alter config add use_cache"); } if (TableExists("glpi_rules_descriptions")) { //If no rule exists, then create a default one $query = "SELECT `ID` FROM `glpi_rules_descriptions`"; $result = $DB->query($query); if ($DB->numrows($result) ==0) { //Insert rule to affect machines in the Root entity $query = "INSERT INTO `glpi_rules_descriptions` (`FK_entities`, `rule_type`, `ranking`, `name`, `description`, `match`) VALUES (-1, 0, 0, 'Root', '', 'AND')"; $DB->queryOrDie($query, "0.7 add default ocs affectation rule"); $query = "SELECT `ID` FROM `glpi_rules_descriptions` WHERE `name` = 'Root' AND `rule_type` = '0'"; $result = $DB->query($query); //Get the defaut rule's ID $datas = $DB->fetch_array($result); $query = "INSERT INTO `glpi_rules_criterias` (`FK_rules`, `criteria`, `condition`, `pattern`) VALUES (".$datas["ID"].", 'TAG', 0, '*')"; $DB->queryOrDie($query, "0.7 add default ocs criterias"); $query = "INSERT INTO `glpi_rules_actions` (`FK_rules`, `action_type`, `field`, `value`) VALUES (".$datas["ID"].", 'assign', 'FK_entities', '0')"; $DB->queryOrDie($query, "0.7 add default ocs actions"); //Insert rule to affect users from LDAP to the root entity $query = "INSERT INTO `glpi_rules_descriptions` (`FK_entities`, `rule_type`, `ranking`, `name`, `description`, `match`) VALUES (-1, 1, 1, 'Root', '', 'OR')"; $DB->queryOrDie($query, "0.7 add default right affectation rule"); $query = "SELECT `ID` FROM `glpi_rules_descriptions` WHERE `name` = 'Root' AND `rule_type` = '1'"; $result = $DB->query($query); //Get the defaut rule's ID $datas = $DB->fetch_array($result); //Criterias $query = "INSERT INTO `glpi_rules_criterias` (`FK_rules`, `criteria`, `condition`, `pattern`) VALUES (".$datas["ID"].", 'uid', 0, '*')"; $DB->queryOrDie($query, "0.7 add default right criterias"); $query = "INSERT INTO `glpi_rules_criterias` (`FK_rules`, `criteria`, `condition`, `pattern`) VALUES (".$datas["ID"].", 'samaccountname', 0, '*')"; $DB->queryOrDie($query, "0.7 add default right criterias"); $query = "INSERT INTO `glpi_rules_criterias` (`FK_rules`, `criteria`, `condition`, `pattern`) VALUES (".$datas["ID"].", 'MAIL_EMAIL', 0, '*')"; $DB->queryOrDie($query, "0.7 add default right criterias"); //Action $query = "INSERT INTO `glpi_rules_actions` (`FK_rules`, `action_type`, `field`, `value`) VALUES (".$datas["ID"].", 'assign', 'FK_entities', '0')"; $DB->queryOrDie($query, "0.7 add default right actions"); } } if (!TableExists("glpi_ocs_admin_link")) { $query = "CREATE TABLE `glpi_ocs_admin_link` ( `ID` int(10) unsigned NOT NULL auto_increment, `glpi_column` varchar(255) NULL, `ocs_column` varchar(255) NULL, `ocs_server_id` int(11) NOT NULL, PRIMARY KEY (`ID`) ) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8"; $DB->queryOrDie($query, "0.7 add table glpi_ocs_admin_link"); } // Add title to tracking if (!FieldExists("glpi_tracking", "name", false)) { $query = "ALTER TABLE `glpi_tracking` ADD `name` varchar(255) NULL AFTER `FK_entities`"; $DB->queryOrDie($query, "0.7 alter tracking add name"); $query = "UPDATE `glpi_tracking` SET `name` = SUBSTRING(REPLACE(contents,'\n',' '),1,50)"; $DB->queryOrDie($query, "0.7 update title of glpi_tracking"); } if (FieldExists("glpi_reminder", "title", false)) { $query = "ALTER TABLE `glpi_reminder` CHANGE `title` `title` VARCHAR( 255 ) NULL DEFAULT NULL "; $DB->queryOrDie($query, "0.7 alter title in glpi_reminder"); } if (!TableExists("glpi_rules_ldap_parameters")) { $query = "CREATE TABLE `glpi_rules_ldap_parameters` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL, `value` varchar(255) NOT NULL, `rule_type` smallint(6) NOT NULL default '1', PRIMARY KEY (`ID`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8"; $DB->queryOrDie($query, "0.7 add table glpi_rules_ldap_parameters"); $query = "INSERT INTO `glpi_rules_ldap_parameters` (`ID`, `name`, `value`, `rule_type`) VALUES (1, '(LDAP)Organization', 'o', 1), (2, '(LDAP)Common Name', 'cn', 1), (3, '(LDAP)Department Number', 'departmentnumber', 1), (4, '(LDAP)Email', 'mail', 1), (5, 'Object Class', 'objectclass', 1), (6, '(LDAP)User ID', 'uid', 1), (7, '(LDAP)Telephone Number', 'phone', 1), (8, '(LDAP)Employee Number', 'employeenumber', 1), (9, '(LDAP)Manager', 'manager', 1), (10, '(LDAP)DistinguishedName', 'dn', 1), (11, '(AD)DistinguishedName', 'distinguishedname', 1), (12, '(AD)User ID', 'samaccountname', 1)"; $DB->queryOrDie($query, "0.7 add standard values to glpi_rules_ldap_parameters"); } if (!FieldExists("glpi_config", "helpdeskhelp_url", false)) { $query = "ALTER TABLE `glpi_config` ADD `helpdeskhelp_url` VARCHAR( 255 ) NULL DEFAULT NULL "; $DB->queryOrDie($query, "0.7 add helpdeskhelp_url in glpi_config"); } if (!FieldExists("glpi_config", "centralhelp_url", false)) { $query = "ALTER TABLE `glpi_config` ADD `centralhelp_url` VARCHAR( 255 ) NULL DEFAULT NULL "; $DB->queryOrDie($query, "0.7 add centralhelp_url in glpi_config"); } if (!FieldExists("glpi_config", "default_rubdoc_tracking", false)) { $query = "ALTER TABLE `glpi_config` ADD `default_rubdoc_tracking` int(11) default '0' "; $DB->queryOrDie($query, "0.7 add default_rubdoc_tracking in glpi_config"); } if (!FieldExists("glpi_users", "deleted", false)) { $query = "ALTER TABLE `glpi_users` ADD `deleted` SMALLINT NOT NULL DEFAULT 0 "; $DB->queryOrDie($query, "0.7 add deleted in glpi_users"); $query = "ALTER TABLE `glpi_users` ADD KEY (`deleted`)"; $DB->queryOrDie($query, "0.7 add key deleted in glpi_users"); } if (!FieldExists("glpi_reservation_item", "active", false)) { $query = "ALTER TABLE `glpi_reservation_item` ADD `active` smallint(6) NOT NULL default '1' "; $DB->queryOrDie($query, "0.7 add active in glpi_reservation_item"); } if (!FieldExists("glpi_tracking_planning", "state", false)) { $query = "ALTER TABLE `glpi_tracking_planning` ADD `state` smallint(6) NOT NULL default '1' "; $DB->queryOrDie($query, "0.7 add state in glpi_tracking_planning"); $query = "UPDATE `glpi_tracking_planning` SET `state` = '2' WHERE `end` < NOW()"; $DB->queryOrDie($query, "0.7 update values of state in glpi_tracking_planning"); } if (!FieldExists("glpi_reminder", "state", false)) { $query = "ALTER TABLE `glpi_reminder` ADD `state` smallint(6) NOT NULL default '0' "; $DB->queryOrDie($query, "0.7 add state in glpi_reminder"); } if (!FieldExists("glpi_tracking", "recipient", false)) { $query = "ALTER TABLE `glpi_tracking` ADD `recipient` INT NOT NULL DEFAULT '0' AFTER `author` "; $DB->queryOrDie($query, "0.7 add recipient in glpi_tracking"); $query = "UPDATE `glpi_tracking` SET `recipient` = `author`"; $DB->queryOrDie($query, "0.7 update recipient in glpi_tracking"); } if (!isIndex("glpi_tracking","recipient")) { $query = "ALTER TABLE `glpi_tracking` ADD INDEX (`recipient`) "; $DB->queryOrDie($query, "0.7 add recipient index in glpi_tracking"); } if (!FieldExists("glpi_ocs_config", "deconnection_behavior", false)) { $query = "ALTER TABLE `glpi_ocs_config` ADD COLUMN `deconnection_behavior` VARCHAR(45)"; $DB->queryOrDie($query, "0.7 add state in glpi_reminder"); } // Rights if (!FieldExists("glpi_profiles", "search_config_global", false)) { $query = "ALTER TABLE `glpi_profiles` ADD COLUMN `search_config_global` char(1) default NULL AFTER `search_config`"; $DB->queryOrDie($query, "0.7 add search_config_global in glpi_profiles"); $query = "UPDATE `glpi_profiles` SET `search_config_global` = `search_config`"; $DB->queryOrDie($query, "0.7 update search_config_global values in glpi_profiles"); $query = "UPDATE `glpi_profiles` SET `search_config` = 'w' WHERE `interface` = 'central'"; $DB->queryOrDie($query, "0.7 update search_confi values in glpi_profiles"); } if (!FieldExists("glpi_profiles", "entity", false)) { $query = "ALTER TABLE `glpi_profiles` ADD COLUMN `entity` char(1) default NULL AFTER `group`"; $DB->queryOrDie($query, "0.7 add entity in glpi_profiles"); $query = "UPDATE `glpi_profiles` SET `entity` = `config`"; $DB->queryOrDie($query, "0.7 update entity values in glpi_profiles"); } if (!FieldExists("glpi_profiles", "entity_dropdown", false)) { $query = "ALTER TABLE `glpi_profiles` ADD COLUMN `entity_dropdown` char(1) default NULL AFTER `dropdown`"; $DB->queryOrDie($query, "0.7 add entity_dropdown in glpi_profiles"); $query = "UPDATE `glpi_profiles` SET `entity_dropdown` = `dropdown`"; $DB->queryOrDie($query, "0.7 update entity_dropdown values in glpi_profiles"); } if (!FieldExists("glpi_profiles", "sync_ocsng", false)) { $query = "ALTER TABLE `glpi_profiles` ADD COLUMN `sync_ocsng` char(1) default NULL AFTER `ocsng`"; $DB->queryOrDie($query, "0.7 add sync_ocsng in glpi_profiles"); $query = "UPDATE `glpi_profiles` SET `sync_ocsng` = `ocsng`"; $DB->queryOrDie($query, "0.7 update sync_ocsng values in glpi_profiles"); } if (!FieldExists("glpi_profiles", "view_ocsng", false)) { $query = "ALTER TABLE `glpi_profiles` ADD COLUMN `view_ocsng` char(1) default NULL AFTER `ocsng`"; $DB->queryOrDie($query, "0.7 add view_ocsng in glpi_profiles"); $query = "UPDATE `glpi_profiles` SET `view_ocsng` = 'r' WHERE `interface` = 'central'"; $DB->queryOrDie($query, "0.7 update view_ocsng values in glpi_profiles"); } if (!FieldExists("glpi_profiles", "rule_ldap", false)) { $query = "ALTER TABLE `glpi_profiles` ADD COLUMN `rule_ldap` char(1) default NULL AFTER `config`"; $DB->queryOrDie($query, "0.7 add rule_ldap in glpi_profiles"); $query = "UPDATE `glpi_profiles` SET `rule_ldap` = `config`"; $DB->queryOrDie($query, "0.7 update rule_ldap values in glpi_profiles"); } if (!FieldExists("glpi_profiles", "rule_ocs", false)) { $query = "ALTER TABLE `glpi_profiles` ADD COLUMN `rule_ocs` char(1) default NULL AFTER `config`"; $DB->queryOrDie($query, "0.7 add rule_ocs in glpi_profiles"); $query = "UPDATE `glpi_profiles` SET `rule_ocs` = `config`"; $DB->queryOrDie($query, "0.7 update rule_ocs values in glpi_profiles"); } if (!FieldExists("glpi_profiles", "rule_tracking", false)) { $query = "ALTER TABLE `glpi_profiles` ADD COLUMN `rule_tracking` char(1) default NULL AFTER `config`"; $DB->queryOrDie($query, "0.7 add rule_tracking in glpi_profiles"); $query = "UPDATE `glpi_profiles` SET `rule_tracking` = `config`"; $DB->queryOrDie($query, "0.7 update rule_tracking values in glpi_profiles"); } if (!FieldExists("glpi_profiles", "update_followups", false)) { $query = "ALTER TABLE `glpi_profiles` ADD COLUMN `update_followups` char(1) default NULL AFTER `observe_ticket`"; $DB->queryOrDie($query, "0.7 add update_followups in glpi_profiles"); $query = "UPDATE `glpi_profiles` SET `update_followups` = `show_full_ticket`"; $DB->queryOrDie($query, "0.7 update update_followups values in glpi_profiles"); } //Software version's modifications //First add the version field to the licenses table if (!FieldExists("glpi_licenses", "version", false)) { $query = "ALTER TABLE `glpi_licenses` ADD COLUMN `version` varchar(255) default NULL AFTER `sID`"; $DB->queryOrDie($query, "0.7 add version in glpi_licenses"); $sql = "SELECT `ID`, `version` FROM `glpi_software`"; $result = $DB->query($sql); if ($DB->numrows($result)>0) { while ($soft = $DB->fetch_array($result)) { $sql = "UPDATE `glpi_licenses` SET `version` = '".$soft["version"]."' WHERE `sID` = ".$soft["ID"]; $DB->query($sql); } } } if (FieldExists("glpi_software", "version", false)) { $query = "ALTER TABLE `glpi_software` DROP `version`"; $DB->queryOrDie($query, "0.7 delete version in glpi_software"); } // CLean multiple free / global licenses $query = "SELECT count(*)AS CPT, `glpi_licenses`.* FROM `glpi_licenses` WHERE `serial` = 'global' OR `serial` = 'free' GROUP BY `sID`, `serial`, `expire`, `buy` HAVING CPT > 1"; $result = $DB->queryOrDie($query, "0.7 check multiple free global licenses"); if ($DB->numrows($result)) { while ($data=$DB->fetch_array($result)) { // Get licenses AND installations if ($data['expire']=="") { $expire_search = " AND `glpi_licenses`.`expire` IS NULL"; } else { $expire_search = " AND `glpi_licenses`.`expireÈ = '".$data['expire']."'"; } $query = "SELECT `glpi_licenses`.`ID` FROM `glpi_licenses` WHERE `serial` ='".$data['serial']."' AND `sID` ='".$data['sID']."' $expire_search AND `buy` ='".$data['buy']."'"; $result2 = $DB->query($query); if ($DB->numrows($result2)) { $licIDs = array(); while ($data2=$DB->fetch_array($result2)) { $licIDs[] = $data2['ID']; } if (count($licIDs)>1) { $refID = array_pop($licIDs); $query = "UPDATE `glpi_inst_software` SET `license` = '$refID' WHERE `license` IN ("; $first = true; foreach ($licIDs as $id) { if ($first) { $first = false; } else { $query .= ", "; } $query .= "'$id'"; $query_del = "DELETE FROM `glpi_licenses` WHERE `ID` = '$id'"; $DB->query($query_del); } $query .= ")"; $DB->query($query); } } } } // Clean multiple reservation item $query = "SELECT count(*) AS CPT, `glpi_reservation_item`.* FROM `glpi_reservation_item` GROUP BY `device_type`, `id_device` HAVING CPT > 1"; $result = $DB->queryOrDie($query, "0.7 check multiple free global licenses"); if ($DB->numrows($result)) { while ($data=$DB->fetch_array($result)) { $refID = $data['ID']; // Get duplicates $query2 = "SELECT * FROM `glpi_reservation_item` WHERE `device_type` = '".$data['device_type']."' AND `id_device` = '".$data['id_device']."' AND `ID` <> '$refID'"; $result2 = $DB->query($query2); if ($DB->numrows($result2)) { while ($data2=$DB->fetch_array($result2)) { // Update réservations $query = "UPDATE `glpi_reservation_resa` SET `id_item` = '$refID' WHERE `id_item` = '".$data2['ID']."'"; $DB->query($query); // Delete Reservation Item $query = "DELETE FROM `glpi_reservation_item` WHERE `ID` = '".$data2['ID']."'"; $DB->query($query); } } } } if (!FieldExists("glpi_networking_ports", "netmask", false)) { $query = "ALTER TABLE `glpi_networking_ports` ADD COLUMN `netmask` VARCHAR( 255 ) NULL DEFAULT NULL"; $DB->queryOrDie($query, "0.7 add netmask in glpi_networking_ports"); } if (!FieldExists("glpi_networking_ports", "gateway", false)) { $query = "ALTER TABLE `glpi_networking_ports` ADD COLUMN `gateway` VARCHAR( 255 ) NULL DEFAULT NULL"; $DB->queryOrDie($query, "0.7 add gateway in glpi_networking_ports"); } if (!FieldExists("glpi_networking_ports", "subnet", false)) { $query = "ALTER TABLE `glpi_networking_ports` ADD COLUMN subnet VARCHAR( 255 ) NULL DEFAULT NULL"; $DB->queryOrDie($query, "0.7 add subnet in glpi_networking_ports"); } if (FieldExists("glpi_networking_ports", "name", false)) { $query = "ALTER TABLE `glpi_networking_ports` CHANGE `name` `name` VARCHAR( 255 ) NULL DEFAULT NULL, CHANGE `ifaddr` `ifaddr` VARCHAR( 255 ) NULL DEFAULT NULL, CHANGE `ifmac` `ifmac` VARCHAR( 255 ) NULL DEFAULT NULL "; $DB->queryOrDie($query, "0.7 alter networking_ports fields"); } // mailgate if (!TableExists("glpi_mailgate")) { $query = "CREATE TABLE `glpi_mailgate` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) collate utf8_unicode_ci default NULL, `FK_entities` int(11) NOT NULL default '0', `host` varchar(255) collate utf8_unicode_ci NOT NULL, `login` varchar(255) collate utf8_unicode_ci NOT NULL, `password` varchar(255) collate utf8_unicode_ci NOT NULL, PRIMARY KEY (`ID`) ) ENGINE=MyISAM"; $DB->queryOrDie($query, "0.7 add glpi_mailgate"); $query = "INSERT INTO `glpi_display` (`type`, `num`, `rank`, `FK_users`) VALUES (35, 80, 1, 0)"; $DB->queryOrDie($query, "0.7 add glpi_mailgate display values"); } if (!FieldExists("glpi_computers", "os_license_number", false)) { $query = "ALTER TABLE `glpi_computers` ADD COLUMN `os_license_number` VARCHAR( 255 ) NULL DEFAULT NULL AFTER os_sp"; $DB->queryOrDie($query, "0.7 alter glpi_computers field " . __('Serial of the operating system')); } if (!FieldExists("glpi_computers", "os_license_id", false)) { $query = "ALTER TABLE `glpi_computers` ADD COLUMN `os_license_id` VARCHAR( 255 ) NULL DEFAULT NULL AFTER os_license_number"; $DB->queryOrDie($query, "0.7 alter glpi_computers field " . __('Product ID of the operating system')); } if (!FieldExists("glpi_ocs_config", "import_os_serial", false)) { $query = "ALTER TABLE `glpi_ocs_config` ADD `import_os_serial` INT( 2 ) NULL AFTER `import_registry`"; $DB->queryOrDie($query, "0.7 alter glpi_computers field import_ocs_serial"); } if (!FieldExists("glpi_auth_ldap", "use_dn", false)) { $query = "ALTER TABLE `glpi_auth_ldap` ADD `use_dn` INT( 1 ) NOT NULL DEFAULT '1'"; $DB->queryOrDie($query, "0.7 alter glpi_computers field use_dn " . $DB->error()); } if (!FieldExists("glpi_config", "monitors_management_restrict", false)) { $query = "ALTER TABLE `glpi_config` ADD `monitors_management_restrict` INT( 1 ) NOT NULL DEFAULT '2'"; $DB->queryOrDie($query, "0.7 alter glpi_computers field monitors_management_restrict " . $DB->error()); } if (!FieldExists("glpi_config", "phones_management_restrict", false)) { $query = "ALTER TABLE `glpi_config` ADD `phones_management_restrict` INT( 1 ) NOT NULL DEFAULT '2'"; $DB->queryOrDie($query, "0.7 alter glpi_computers field phones_management_restrict " . $DB->error()); } if (!FieldExists("glpi_config", "peripherals_management_restrict", false)) { $query = "ALTER TABLE `glpi_config` ADD `peripherals_management_restrict` INT( 1 ) NOT NULL DEFAULT '2'"; $DB->queryOrDie($query, "0.7 alter glpi_computers field peripherals_management_restrict " . $DB->error()); } if (!FieldExists("glpi_config", "printers_management_restrict", false)) { $query = "ALTER TABLE `glpi_config` ADD `printers_management_restrict` INT( 1 ) NOT NULL DEFAULT '2'"; $DB->queryOrDie($query, "0.7 alter glpi_computers field printers_management_restrict " . $DB->error()); } if (!FieldExists("glpi_config", "licenses_management_restrict", false)) { $query = "ALTER TABLE `glpi_config` ADD `licenses_management_restrict` INT( 1 ) NOT NULL DEFAULT '2'"; $DB->queryOrDie($query, "0.7 alter glpi_computers field licenses_management_restrict " . $DB->error()); } if (!FieldExists("glpi_config", "license_deglobalisation", false)) { $query = "ALTER TABLE `glpi_config` ADD `license_deglobalisation` INT( 1 ) NOT NULL DEFAULT '1'"; $DB->queryOrDie($query, "0.7 alter glpi_computers field license_deglobalisation " . $DB->error()); } if (!FieldExists("glpi_registry", "registry_ocs_name", false)) { $query = "ALTER TABLE `glpi_registry` ADD COLUMN `registry_ocs_name` char(255) NOT NULL default ''"; $DB->queryOrDie($query, "0.7 add registry_ocs_name in glpi_registry"); } if (!FieldExists("glpi_config", "use_errorlog", false)) { $query = "ALTER TABLE `glpi_config` ADD COLUMN `use_errorlog` INT( 1 ) NOT NULL default 0"; $DB->queryOrDie($query, "0.7 add use_errorlog in glpi_config"); } if (!FieldExists("glpi_config", "glpi_timezone", false)) { $query = "ALTER TABLE `glpi_config` ADD COLUMN `glpi_timezone` VARCHAR( 4 ) NOT NULL default 0"; $DB->queryOrDie($query, "0.7 add glpi_timezone in glpi_config"); } if (!FieldExists("glpi_auth_ldap", "timezone", false)) { $query = "ALTER TABLE `glpi_auth_ldap` ADD COLUMN `timezone` VARCHAR( 4 ) NOT NULL default 0"; $DB->queryOrDie($query, "0.7 add timezone in glpi_auth_ldap"); } if (!FieldExists("glpi_ocs_config","glpi_link_enabled", false)) { $query = "ALTER TABLE `glpi_ocs_config` ADD COLUMN `glpi_link_enabled` int(1) NOT NULL, ADD COLUMN `link_ip` int(1) NOT NULL, ADD COLUMN `link_name` int(1) NOT NULL, ADD COLUMN `link_mac_address` int(1) NOT NULL, ADD COLUMN `link_serial` int(1) NOT NULL, ADD COLUMN `link_if_status` int(11) NOT NULL default '0'"; $DB->queryOrDie($query, "0.7 add glpi_link fields in glpi_ocs_config"); } $intnull = array("glpi_alerts" => array("device_type", "FK_device", "type"), "glpi_cartridges_type" => array("tech_num"), "glpi_computers" => array("FK_users", "FK_groups"), "glpi_consumables_type" => array("tech_num"), "glpi_contacts" => array("type"), "glpi_device_case" => array("type"), "glpi_device_control" => array("interface"), "glpi_device_drive" => array("interface"), "glpi_dropdown_kbcategories" => array("level"), "glpi_dropdown_locations" => array("level"), "glpi_dropdown_tracking_category" => array("level"), "glpi_entities" => array("level"), "glpi_infocoms" => array("FK_enterprise", "budget"), "glpi_monitors" => array("type", "model", "FK_users", "FK_groups"), "glpi_networking" => array("type", "model", "firmware", "FK_users", "FK_groups"), "glpi_networking_ports" => array("iface", "netpoint"), "glpi_ocs_link" => array("ocs_server_id"), "glpi_peripherals" => array("model", "FK_users", "FK_groups"), "glpi_phones" => array("model", "FK_users", "FK_groups"), "glpi_printers" => array("type", "model", "FK_users", "FK_groups"), "glpi_software" => array("location", "platform", "FK_users", "FK_groups"), "glpi_tracking" => array("computer"), "glpi_users_groups" => array("FK_users", "FK_groups")); foreach ($intnull as $table => $fields) { foreach ($fields as $field) { if (FieldExists($table, $field, false)) { $query = "UPDATE `$table` SET `$field` = '0' WHERE `$field` IS NULL"; $DB->queryOrDie($query, "0.7 update datas in $table for NULL values ".$DB->error()); $query = "ALTER TABLE `$table` CHANGE `$field` `$field` INT NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.7 alter $field in $table " . $DB->error()); } else { // Error field does not exists : correct it $query = "ALTER TABLE `$table` ADD COLUMN `$field` INT NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.7 add $field in $table " . $DB->error()); } } } // Clean history $query = "DELETE FROM `glpi_history` WHERE `linked_action` = 0 AND `device_internal_type` = 0 AND `old_value` = `new_value` AND `old_value` IS NOT NULL AND `old_value` != ''"; $DB->queryOrDie($query, "0.7 clean glpi_history " . $DB->error()); $query = "DELETE FROM `glpi_display` WHERE `type` = ".USER_TYPE." AND (`num` = 4)"; $DB->queryOrDie($query, "0.7 clean glpi_display for glpi_users " . $DB->error()); // Add fields to block auto updates on linked items if (!FieldExists("glpi_config", "autoupdate_link_contact", false)) { $query = "ALTER TABLE `glpi_config` ADD COLUMN `autoupdate_link_contact` smallint(6) NOT NULL default '1'"; $DB->queryOrDie($query, "0.7 add autoupdate_link_contact in glpi_config"); } if (!FieldExists("glpi_config", "autoupdate_link_user", false)) { $query = "ALTER TABLE `glpi_config` ADD COLUMN `autoupdate_link_user` smallint(6) NOT NULL default '1'"; $DB->queryOrDie($query, "0.7 add autoupdate_link_user in glpi_config"); } if (!FieldExists("glpi_config", "autoupdate_link_group", false)) { $query = "ALTER TABLE `glpi_config` ADD COLUMN `autoupdate_link_group` smallint(6) NOT NULL default '1'"; $DB->queryOrDie($query, "0.7 add autoupdate_link_group in glpi_config"); } if (!FieldExists("glpi_config", "autoupdate_link_location", false)) { $query = "ALTER TABLE `glpi_config` ADD COLUMN `autoupdate_link_location` smallint(6) NOT NULL default '1'"; $DB->queryOrDie($query, "0.7 add autoupdate_link_location in glpi_config"); } // Flat dropdowntree if (!FieldExists("glpi_config", "flat_dropdowntree", false)) { $query = "ALTER TABLE `glpi_config` ADD COLUMN `flat_dropdowntree` smallint(6) NOT NULL default '0'"; $DB->queryOrDie($query, "0.7 add flat_dropdowntree in glpi_config"); } if (FieldExists("glpi_config", "mailing_signature", false)) { $query = "ALTER TABLE `glpi_config` CHANGE `mailing_signature` `mailing_signature` TEXT NULL "; $DB->queryOrDie($query, "0.7 alter mailing signature in glpi_config"); } //Software categories if (!TableExists("glpi_dropdown_software_category")) { $query = "CREATE TABLE `glpi_dropdown_software_category` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) default NULL, `comments` text, PRIMARY KEY (`ID`) ) ENGINE=MyISAM "; $DB->queryOrDie($query, "0.7 add table glpi_dropdown_software_category"); } if (!FieldExists("glpi_profiles", "rule_softwarecategories", false)) { $query = "ALTER TABLE `glpi_profiles` ADD COLUMN `rule_softwarecategories` char(1) default NULL AFTER `rule_ldap`"; $DB->queryOrDie($query, "0.7 add rule_softwarecategories in glpi_profiles"); $query = "UPDATE `glpi_profiles` SET `rule_softwarecategories` = `config`"; $DB->queryOrDie($query, "0.7 update rule_softwarecategories values in glpi_profiles"); } if (!FieldExists("glpi_software", "category", false)) { $query = "ALTER TABLE `glpi_software` ADD `category` INT( 11 ) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.7 alter category in glpi_software"); } if (!FieldExists("glpi_ocs_config", "import_monitor_comments", false)) { $query = "ALTER TABLE `glpi_ocs_config` ADD `import_monitor_comments` INT( 2 ) NOT NULL DEFAULT '0' AFTER `import_ip`"; $DB->queryOrDie($query, "0.7 alter import_monitor_comments in glpi_ocs_config"); } if (!FieldExists("glpi_ocs_config", "import_software_comments", false)) { $query = "ALTER TABLE `glpi_ocs_config` ADD `import_software_comments` INT NOT NULL DEFAULT '0' AFTER `import_monitor_comments`"; $DB->queryOrDie($query, "0.7 alter import_software_comments in glpi_ocs_config"); } if (FieldExists("glpi_device_gfxcard", "ram", false)) { //Update gfxcard memory management $query = "UPDATE `glpi_device_gfxcard` SET `specif_default` = `ram`"; $DB->queryOrDie($query, "0.7 glpi_device_gfxcard"); $query="ALTER TABLE `glpi_device_gfxcard` DROP `ram`"; $DB->queryOrDie($query, "0.7 delete 'ram' field from glpi_device_gfxcard"); } if (FieldExists("glpi_config", "list_limit", false)) { //Update gfxcard memory management $query = "ALTER TABLE `glpi_config` CHANGE `list_limit` `list_limit` INT NULL DEFAULT '20'"; $DB->queryOrDie($query, "0.7 alter list_limit in config"); } if (!FieldExists("glpi_config", "list_limit_max", false)) { //Update gfxcard memory management $query = "ALTER TABLE `glpi_config` ADD `list_limit_max` INT NOT NULL DEFAULT '50' AFTER `list_limit` "; $DB->queryOrDie($query, "0.7 add list_limit_max in config"); } if (!FieldExists("glpi_users", "list_limit", false)) { //Update gfxcard memory management $query = "ALTER TABLE `glpi_users` ADD `list_limit` INT NOT NULL DEFAULT '20' AFTER `language`"; $DB->queryOrDie($query, "0.7 add list_limit_max in users"); } if (!FieldExists("glpi_config", "autoname_entity", false)) { $query = "ALTER TABLE `glpi_config` ADD `autoname_entity` smallint(6) NOT NULL default '1' "; $DB->queryOrDie($query, "0.7 add autoname_entity in glpi_config"); } if (!FieldExists("glpi_profiles", "rule_tracking", false)) { $query = "ALTER TABLE `glpi_profiles` ADD COLUMN `rule_tracking` char(1) default NULL AFTER `config`"; $DB->queryOrDie($query, "0.7 add rule_tracking in glpi_profiles"); $query = "UPDATE `glpi_profiles` SET `rule_tracking` = `config`"; $DB->queryOrDie($query, "0.7 update rule_tracking values in glpi_profiles"); } if (FieldExists("glpi_profiles", "show_ticket", false)) { $query = "ALTER TABLE `glpi_profiles` CHANGE `show_ticket` `show_all_ticket` CHAR( 1 ) DEFAULT NULL "; $DB->queryOrDie($query, "0.7 rename show_ticket to show_all_ticket in glpi_profiles"); } if (!FieldExists("glpi_profiles", "show_assign_ticket", false)) { $query = "ALTER TABLE `glpi_profiles` ADD COLUMN `show_assign_ticket` char(1) default NULL AFTER `show_all_ticket`"; $DB->queryOrDie($query, "0.7 add show_assign_ticket in glpi_profiles"); $query = "UPDATE `glpi_profiles` SET `show_assign_ticket` = `show_all_ticket`"; $DB->queryOrDie($query, "0.7 update show_assign_ticket values in glpi_profiles"); } if (!FieldExists("glpi_tracking", "assign_group", false)) { $query = "ALTER TABLE `glpi_tracking` ADD `assign_group` INT NOT NULL DEFAULT '0' AFTER `assign_ent`"; $DB->queryOrDie($query, "0.7 add assign_group in tracking"); $query = "ALTER TABLE `glpi_tracking` ADD INDEX (`assign_group`)"; $DB->queryOrDie($query, "0.7 add index on assign_group in tracking"); } if (!FieldExists("glpi_config", "expand_soft_categorized", false)) { $query = "ALTER TABLE `glpi_config` ADD `expand_soft_categorized` int(1) NOT NULL DEFAULT '1'"; $DB->queryOrDie($query, "0.7 add expand_soft_categorized in glpi_config"); } if (!FieldExists("glpi_config", "expand_soft_not_categorized", false)) { $query = "ALTER TABLE `glpi_config` ADD `expand_soft_not_categorized` int(1) NOT NULL DEFAULT '1'"; $DB->queryOrDie($query, "0.7 add expand_soft_not_categorized in glpi_config"); } $LINK_ID_TABLE = array(1 => "glpi_computers", 2 => "glpi_networking", 3 => "glpi_printers", 4 => "glpi_monitors", 5 => "glpi_peripherals", 6 => "glpi_software", 7 => "glpi_contacts", 8 => "glpi_enterprises", 9 => "glpi_infocoms", 10 => "glpi_contracts", 11 => "glpi_cartridges_type", 12 => "glpi_type_docs", 13 => "glpi_docs", 14 => "glpi_kbitems", 15 => "glpi_users", 16 => "glpi_tracking", 17 => "glpi_consumables_type", 18 => "glpi_consumables", 19 => "glpi_cartridges", 20 => "glpi_softwarelicenses", 21 => "glpi_links", 23 => "glpi_phones", 25 => "glpi_reminder", 27 => "glpi_groups", 28 => "glpi_entities", 29 => "glpi_reservation_item", 32 => "glpi_ocs_config", 33 => "glpi_registry", 34 => "glpi_profiles", 35 => "glpi_mailgate", 36 => "glpi_rules_descriptions", 37 => "glpi_transfers", 39 => "glpi_softwareversions", 41 => "glpi_computerdisks", 42 => "glpi_networking_ports", 43 => "glpi_followups"); // Clean history $query = "SELECT DISTINCT `device_type` FROM `glpi_history`"; if ($result=$DB->query($query)) { if ($DB->numrows($result)>0) { while ($data=$DB->fetch_array($result)) { $query2 = "DELETE FROM `glpi_history` WHERE `glpi_history`.`device_type` = '".$data['device_type']."' AND `glpi_history`.`FK_glpi_device` NOT IN (SELECT `ID` FROM `".$LINK_ID_TABLE[$data['device_type']]."`)"; $DB->query($query2); } } } if (!TableExists("glpi_transfers")) { $query = "CREATE TABLE `glpi_transfers` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL, `keep_tickets` tinyint(4) NOT NULL default '0', `keep_networklinks` tinyint(4) NOT NULL default '0', `keep_reservations` tinyint(4) NOT NULL default '0', `keep_history` tinyint(4) NOT NULL default '0', `keep_devices` tinyint(4) NOT NULL default '0', `keep_infocoms` tinyint(4) NOT NULL default '0', `keep_dc_monitor` tinyint(4) NOT NULL default '0', `clean_dc_monitor` tinyint(4) NOT NULL default '0', `keep_dc_phone` tinyint(4) NOT NULL default '0', `clean_dc_phone` tinyint(4) NOT NULL default '0', `keep_dc_peripheral` tinyint(4) NOT NULL default '0', `clean_dc_peripheral` tinyint(4) NOT NULL default '0', `keep_dc_printer` tinyint(4) NOT NULL default '0', `clean_dc_printer` tinyint(4) NOT NULL default '0', `keep_enterprises` tinyint(4) NOT NULL default '0', `clean_enterprises` tinyint(4) NOT NULL default '0', `keep_contacts` tinyint(4) NOT NULL default '0', `clean_contacts` tinyint(4) NOT NULL default '0', `keep_contracts` tinyint(4) NOT NULL default '0', `clean_contracts` tinyint(4) NOT NULL default '0', `keep_softwares` tinyint(4) NOT NULL default '0', `clean_softwares` tinyint(4) NOT NULL default '0', `keep_documents` tinyint(4) NOT NULL default '0', `clean_documents` tinyint(4) NOT NULL default '0', `keep_cartridges_type` tinyint(4) NOT NULL default '0', `clean_cartridges_type` tinyint(4) NOT NULL default '0', `keep_cartridges` tinyint(4) NOT NULL default '0', `keep_consumables` tinyint(4) NOT NULL default '0', PRIMARY KEY (`ID`) ) ENGINE=MyISAM"; $DB->queryOrDie($query, "0.7 add glpi_transfers"); $query = "INSERT INTO `glpi_transfers` VALUES ('1', 'complete', '2', '2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1')"; $DB->queryOrDie($query, "0.7 insert transfer default values"); } if (!FieldExists("glpi_profiles", "transfer", false)) { $query = "ALTER TABLE `glpi_profiles` ADD COLUMN `transfer` char(1) default NULL AFTER `entity`"; $DB->queryOrDie($query, "0.7 add transfer in glpi_profiles"); $query = "UPDATE `glpi_profiles` SET `transfer` = `entity`"; $DB->queryOrDie($query, "0.7 update transfer values in glpi_profiles"); } // Need for update from SVN version if (!FieldExists("glpi_users", "location", false)) { $query = "ALTER TABLE `glpi_users` ADD `location` int(11) NOT NULL DEFAULT 0"; $DB->queryOrDie($query, "0.7 add location in users if not present for compatibility"); } if (!FieldExists("glpi_ocs_config", "ocs_url", false)) { $query = "ALTER TABLE `glpi_ocs_config` ADD `ocs_url` VARCHAR( 255 ) NOT NULL"; $DB->queryOrDie($query, "0.7 add ocs_url in glpi_ocs_config if not present for compatibility"); } if (!FieldExists("glpi_ocs_link", "ocs_agent_version", false)) { $query = "ALTER TABLE `glpi_ocs_link` ADD `ocs_agent_version` VARCHAR( 255 ) default NULL"; $DB->queryOrDie($query, "0.7 add ocs_agent_version in glpi_ocs_link if not present for compatibility"); } if (!isIndex("glpi_history", "date_mod")) { $query = "ALTER TABLE `glpi_history` ADD INDEX (`date_mod`)"; $DB->queryOrDie($query, "0.7 alter history add index on date_mod"); } } // fin 0.7 ##################################################################################### //######### Function comming from old tracking.function.php which is now deleted since GLPI 0.72 //######### Theses functionS were used during the migration process function computeTicketTco($item_type,$item) { global $DB; $totalcost = 0; $query = "SELECT * FROM `glpi_tracking` WHERE (`device_type` = '$item_type' AND `computer` = '$item') AND (`cost_time` > 0 OR `cost_fixed` > 0 OR `cost_material` > 0)"; $result = $DB->query($query); $i = 0; if ($DB->numrows($result)) { while ($data=$DB->fetch_array($result)) { $totalcost += trackingTotalCost($data["realtime"], $data["cost_time"], $data["cost_fixed"], $data["cost_material"]); } } return $totalcost; } /** Computer total cost of a ticket * * @param $realtime float : ticket realtime * @param $cost_time float : ticket time cost * @param $cost_fixed float : ticket fixed cost * @param $cost_material float : ticket material cost * * @return total cost formatted string **/ function trackingTotalCost($realtime, $cost_time, $cost_fixed, $cost_material) { return Html::formatNumber(($realtime*$cost_time)+$cost_fixed+$cost_material,true); } ?> glpi-0.84.3+dfsg.1/install/update_068_0681.php000066400000000000000000000657631226600447100203560ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /** * DB class to connect to a OCS server * **/ class DBocs extends DBmysql { function DBocs() { global $db,$cfg_glpi; if ($cfg_glpi["ocs_mode"]){ $query = "SELECT * FROM `glpi_ocs_config`"; $result = $db->query($query); $this->dbhost = $db->result($result,0,"ocs_db_host"); $this->dbuser = $db->result($result,0,"ocs_db_user"); $this->dbpassword = $db->result($result,0,"ocs_db_passwd"); $this->dbdefault = $db->result($result,0,"ocs_db_name"); if (!($this->dbh = new mysqli($this->dbhost, $this->dbuser, $this->dbpassword))) { $this->error = 1; } if (!$this->dbh->select_db($this->dbdefault)) { $this->error = 1; } } } } /// Update from 0.68 to 0.68.1 function update068to0681() { global $DB, $CFG_GLPI; if (TableExists("glpi_repair_item")) { $query = "DROP TABLE `glpi_repair_item`"; $DB->queryOrDie($query, "0.68.1 drop glpi_repair_item"); } $tables = array("computers", "monitors", "networking", "peripherals", "phones", "printers"); foreach ($tables as $tbl) { if (isIndex("glpi_".$tbl, "type")) { $query = "ALTER TABLE `glpi_$tbl` DROP INDEX `type`"; $DB->queryOrDie($query, "0.68.1 drop index type glpi_$tbl"); } if (isIndex("glpi_".$tbl, "type_2")) { $query = "ALTER TABLE `glpi_$tbl` DROP INDEX `type_2`"; $DB->queryOrDie($query, "0.68.1 drop index type_2 glpi_$tbl"); } if (isIndex("glpi_".$tbl, "model")) { $query = "ALTER TABLE `glpi_$tbl` DROP INDEX `model`"; $DB->queryOrDie($query, "0.68.1 drop index model glpi_$tbl"); } if (!isIndex("glpi_".$tbl, "type")) { $query = "ALTER TABLE `glpi_$tbl` ADD INDEX (`type`)"; $DB->queryOrDie($query, "0.68.1 add index type glpi_$tbl"); } if (!isIndex("glpi_".$tbl, "model")) { $query = "ALTER TABLE `glpi_$tbl` ADD INDEX (`model`)"; $DB->queryOrDie($query, "0.68.1 add index model glpi_$tbl"); } if (!isIndex("glpi_".$tbl, "FK_groups")) { $query = "ALTER TABLE `glpi_$tbl` ADD INDEX (`FK_groups`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_$tbl.FK_groups"); } if (!isIndex("glpi_".$tbl, "FK_users")) { $query = "ALTER TABLE `glpi_$tbl` ADD INDEX ( `FK_users` )"; $DB->queryOrDie($query, "0.68.1 add index on glpi_$tbl.FK_users"); } } if (!isIndex("glpi_software", "FK_groups")) { $query = "ALTER TABLE `glpi_software` ADD INDEX (`FK_groups`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_software.FK_groups"); } if (!isIndex("glpi_software", "FK_users")) { $query = "ALTER TABLE `glpi_software` ADD INDEX ( `FK_users` )"; $DB->queryOrDie($query, "0.68.1 add index on glpi_software.FK_users"); } if (!isIndex("glpi_cartridges_type", "location")) { $query = "ALTER TABLE `glpi_cartridges_type` ADD INDEX (`location`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_cartridges_type.location"); } if (FieldExists("glpi_cartridges_type", "type", false)) { $query = "ALTER TABLE `glpi_cartridges_type` CHANGE `type` `type` INT NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.68.1 alter glpi_cartridges_type.type"); } if (!isIndex("glpi_cartridges_type", "type")) { $query = "ALTER TABLE `glpi_cartridges_type` ADD INDEX (`type`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_cartridges_type.type"); } if (!isIndex("glpi_cartridges_type", "alarm")) { $query = "ALTER TABLE `glpi_cartridges_type` ADD INDEX (`alarm`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_cartridges_type.alarm"); } if (!isIndex("glpi_computers", "os_sp")) { $query = "ALTER TABLE `glpi_computers` ADD INDEX (`os_sp`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_computers.os_sp"); } if (!isIndex("glpi_computers", "os_version")) { $query = "ALTER TABLE `glpi_computers` ADD INDEX (`os_version`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_computers.os_version"); } if (!isIndex("glpi_computers", "network")) { $query = "ALTER TABLE `glpi_computers` ADD INDEX (`network`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_computers.network"); } if (!isIndex("glpi_computers", "domain")) { $query = "ALTER TABLE `glpi_computers` ADD INDEX (`domain`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_computers.domain"); } if (!isIndex("glpi_computers", "auto_update")) { $query = "ALTER TABLE `glpi_computers` ADD INDEX (`auto_update`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_computers.auto_update"); } if (!isIndex("glpi_computers", "ocs_import")) { $query = "ALTER TABLE `glpi_computers` ADD INDEX (`ocs_import`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_computers.ocs_import"); } if (!isIndex("glpi_consumables", "id_user")) { $query = "ALTER TABLE `glpi_consumables` ADD INDEX (`id_user`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_consumables.id_user"); } if (!isIndex("glpi_consumables_type", "location")) { $query = "ALTER TABLE `glpi_consumables_type` ADD INDEX (`location`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_consumables_type.location"); } if (!isIndex("glpi_consumables_type", "type")) { $query = "ALTER TABLE `glpi_consumables_type` ADD INDEX (`type`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_consumables_type.type"); } if (!isIndex("glpi_consumables_type", "alarm")) { $query = "ALTER TABLE `glpi_consumables_type` ADD INDEX (`alarm`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_consumables_type.alarm"); } if (FieldExists("glpi_contacts", "type", false)) { $query = "ALTER TABLE `glpi_contacts` CHANGE `type` `type` INT( 11 ) NULL "; $DB->queryOrDie($query, "0.68.1 alter glpi_contacts.type"); } if (!isIndex("glpi_contract_device", "device_type")) { $query = "ALTER TABLE `glpi_contract_device` ADD INDEX (`device_type`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_contract_device.device_type"); } if (!isIndex("glpi_contract_device", "is_template")) { $query = "ALTER TABLE `glpi_contract_device` ADD INDEX (`is_template`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_contract_device.is_template"); } if (!isIndex("glpi_device_hdd", "interface")) { $query = "ALTER TABLE `glpi_device_hdd` ADD INDEX (`interface`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_device_hdd.interface"); } if (!isIndex("glpi_device_ram", "type")) { $query = "ALTER TABLE `glpi_device_ram` ADD INDEX (`type`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_device_ram.type"); } if (!isIndex("glpi_display", "FK_users")) { $query = "ALTER TABLE `glpi_display` ADD INDEX (`FK_users`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_display.FK_users"); } if (!isIndex("glpi_docs", "FK_users")) { $query = "ALTER TABLE `glpi_docs` ADD INDEX (`FK_users`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_docs.FK_users"); } if (!isIndex("glpi_docs", "FK_tracking")) { $query = "ALTER TABLE `glpi_docs` ADD INDEX (`FK_tracking`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_docs.FK_tracking"); } if (!isIndex("glpi_doc_device", "device_type")) { $query = "ALTER TABLE `glpi_doc_device` ADD INDEX (`device_type`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_doc_device.device_type"); } if (!isIndex("glpi_dropdown_tracking_category", "parentID")) { $query = "ALTER TABLE `glpi_dropdown_tracking_category` ADD INDEX (`parentID`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_dropdown_tracking_category.parentID"); } if (!isIndex("glpi_history", "device_type")) { $query = "ALTER TABLE `glpi_history` ADD INDEX (`device_type`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_history.device_type"); } if (!isIndex("glpi_history", "device_internal_type")) { $query = "ALTER TABLE `glpi_history` ADD INDEX (`device_internal_type`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_history.device_internal_type"); } if (!isIndex("glpi_infocoms", "budget")) { $query = "ALTER TABLE `glpi_infocoms` ADD INDEX (`budget`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_infocoms.budget"); } if (!isIndex("glpi_infocoms", "alert")) { $query = "ALTER TABLE `glpi_infocoms` ADD INDEX (`alert`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_infocoms.alert"); } if (!isIndex("glpi_kbitems", "author")) { $query = "ALTER TABLE `glpi_kbitems` ADD INDEX (`author`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_kbitems.author"); } if (!isIndex("glpi_kbitems", "faq")) { $query = "ALTER TABLE `glpi_kbitems` ADD INDEX (`faq`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_kbitems.faq"); } if (!isIndex("glpi_licenses", "oem_computer")) { $query = "ALTER TABLE `glpi_licenses` ADD INDEX (`oem_computer`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_licenses.oem_computer"); } if (!isIndex("glpi_licenses", "oem")) { $query = "ALTER TABLE `glpi_licenses` ADD INDEX (`oem`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_licenses.oem"); } if (!isIndex("glpi_licenses", "buy")) { $query = "ALTER TABLE `glpi_licenses` ADD INDEX (`buy`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_licenses.buy"); } if (!isIndex("glpi_licenses", "serial")) { $query = "ALTER TABLE `glpi_licenses` ADD INDEX (`serial`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_licenses.serial"); } if (!isIndex("glpi_licenses", "expire")) { $query = "ALTER TABLE `glpi_licenses` ADD INDEX (`expire`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_licenses.expire"); } if (!isIndex("glpi_networking", "network")) { $query = "ALTER TABLE `glpi_networking` ADD INDEX (`network`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_networking.network"); } if (!isIndex("glpi_networking", "domain")) { $query = "ALTER TABLE `glpi_networking` ADD INDEX (`domain`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_networking.domain"); } if (!isIndex("glpi_networking_ports", "iface")) { $query = "ALTER TABLE `glpi_networking_ports` ADD INDEX (`iface`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_networking_ports.iface"); } if (FieldExists("glpi_phones", "power", false)) { $query = "ALTER TABLE `glpi_phones` CHANGE `power` `power` INT NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.68.1 alter glpi_phones.power"); } if (!isIndex("glpi_phones", "power")) { $query = "ALTER TABLE `glpi_phones` ADD INDEX (`power`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_phones.power"); } if (!isIndex("glpi_reminder", "begin")) { $query = "ALTER TABLE `glpi_reminder` ADD INDEX (`begin`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_reminder.begin"); } if (!isIndex("glpi_reminder", "end")) { $query = "ALTER TABLE `glpi_reminder` ADD INDEX (`end`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_reminder.end"); } if (!isIndex("glpi_software", "update_software")) { $query = "ALTER TABLE `glpi_software` ADD INDEX (`update_software`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_software.update_software"); } if (!isIndex("glpi_state_item", "state")) { $query = "ALTER TABLE `glpi_state_item` ADD INDEX (`state`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_state_item.state"); } if (!isIndex("glpi_tracking", "FK_group")) { $query = "ALTER TABLE `glpi_tracking` ADD INDEX (`FK_group`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_tracking.FK_group"); } if (!isIndex("glpi_tracking", "assign_ent")) { $query = "ALTER TABLE `glpi_tracking` ADD INDEX (`assign_ent`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_tracking.assign_ent"); } if (!isIndex("glpi_tracking", "device_type")) { $query = "ALTER TABLE `glpi_tracking` ADD INDEX (`device_type`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_tracking.device_type"); } if (!isIndex("glpi_tracking", "priority")) { $query = "ALTER TABLE `glpi_tracking` ADD INDEX (`priority`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_tracking.priority"); } if (!isIndex("glpi_tracking", "request_type")) { $query = "ALTER TABLE `glpi_tracking` ADD INDEX (`request_type`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_tracking.request_type"); } if (!isIndex("glpi_users", "location")) { $query = "ALTER TABLE `glpi_users` ADD INDEX (`location`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_users.location"); } if (!isIndex("glpi_printers", "network")) { $query = "ALTER TABLE `glpi_printers` ADD INDEX (`network`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_printers.network"); } if (!isIndex("glpi_printers", "domain")) { $query = "ALTER TABLE `glpi_printers` ADD INDEX (`domain`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_printers.domain"); } if (FieldExists("glpi_device_case", "format", false)) { $query = "ALTER TABLE `glpi_device_case` CHANGE `format` `format` ENUM('Grand', 'Moyen', 'Micro', 'Slim', '') NULL DEFAULT 'Moyen'"; $DB->queryOrDie($query, "0.68.1 alter glpi_device_case.format"); } if (FieldExists("glpi_device_gfxcard", "interface", false)) { $query = "ALTER TABLE `glpi_device_gfxcard` CHANGE `interface` `interface` ENUM('AGP', 'PCI', 'PCI-X', 'Other', '') NULL DEFAULT 'AGP'"; $DB->queryOrDie($query, "0.68.1 alter glpi_device_gfxcard.interface"); } // Add default values in GLPI_DROPDOWN_HDD_TYPE // Rename glpi_dropdown HDD_TYPE -> INTERFACE if (!TableExists("glpi_dropdown_interface")) { $query = "ALTER TABLE `glpi_dropdown_hdd_type` RENAME `glpi_dropdown_interface` "; $DB->queryOrDie($query, "0.68.1 alter dropdown_hdd_type -> dropdown_interface"); $values = array("SATA", "IDE", "SCSI", "USB"); $interfaces = array(); foreach ($values as $val) { $query = "SELECT * FROM `glpi_dropdown_interface` WHERE `name` LIKE '$val'"; $result = $DB->query($query); if ($DB->numrows($result)==1) { $row = $DB->fetch_array($result); $interfaces[$val] = $row["ID"]; } else { $query = "INSERT INTO `glpi_dropdown_interface` (`name`) VALUES ('$val');"; $DB->query($query); $interfaces[$val] = $DB->insert_id(); } } // ALTER TABLES $query = "ALTER TABLE `glpi_device_control` CHANGE `interface` `interface2` ENUM('IDE', 'SATA', 'SCSI', 'USB') NOT NULL DEFAULT 'IDE'"; $DB->queryOrDie($query, "0.68.1 alter device_control"); $query = "ALTER TABLE `glpi_device_drive` CHANGE `interface` `interface2` ENUM('IDE', 'SATA', 'SCSI') NOT NULL DEFAULT 'IDE'"; $DB->queryOrDie($query, "0.68.1 alter device_drive"); $query = "ALTER TABLE `glpi_device_control` ADD `interface` INT NULL "; $DB->queryOrDie($query, "0.68.1 alter device_control"); $query = "ALTER TABLE `glpi_device_drive` ADD `interface` INT NULL "; $DB->queryOrDie($query, "0.68.1 alter device_drive"); foreach ($interfaces as $name => $ID) { $query = "UPDATE `glpi_device_drive` SET `interface` = '$ID' WHERE `interface2` = '$name'"; $DB->queryOrDie($query, "0.68.1 update data device_drive"); $query = "UPDATE `glpi_device_control` SET `interface` = '$ID' WHERE `interface2` = '$name'"; $DB->queryOrDie($query, "0.68.1 update data device_control"); } // DROP TABLES $query = "ALTER TABLE `glpi_device_control` DROP `interface2`"; $DB->queryOrDie($query, "0.68.1 drop interface2 device_drive"); $query = "ALTER TABLE `glpi_device_drive` DROP `interface2`"; $DB->queryOrDie($query, "0.68.1 drop interface2 device_drive"); // ADD INDEX $query = "ALTER TABLE `glpi_device_drive` ADD INDEX (`interface`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_device_drive.interface"); $query = "ALTER TABLE `glpi_device_control` ADD INDEX (`interface`)"; $DB->queryOrDie($query, "0.68.1 add index on glpi_device_drive.interface"); } if (FieldExists("glpi_profiles", "update", false)) { $query = "ALTER TABLE `glpi_profiles` CHANGE `update` `check_update` CHAR( 1 ) NULL DEFAULT NULL"; $DB->queryOrDie($query, "0.68.1 alter glpi_profiles.update"); } if (FieldExists("glpi_config", "last_update_check", false)) { $query = "ALTER TABLE `glpi_config` DROP `last_update_check`"; $DB->queryOrDie($query, "0.68.1 drop glpi_config.last_update_check"); } if (!FieldExists("glpi_config", "keep_tracking_on_delete", false)) { $query = "ALTER TABLE `glpi_config` ADD `keep_tracking_on_delete` INT DEFAULT '1'"; $DB->queryOrDie($query, "0.68.1 drop glpi_config.keep_tracking_on_delete"); } if (!FieldExists("glpi_config", "show_admin_doc", false)) { $query = "ALTER TABLE `glpi_config` ADD `show_admin_doc` INT DEFAULT '0' "; $DB->queryOrDie($query, "0.68.1 drop glpi_config.show_admin_doc"); } if (!FieldExists("glpi_config", "time_step", false)) { $query = "ALTER TABLE `glpi_config` ADD `time_step` INT DEFAULT '5' "; $DB->queryOrDie($query, "0.68.1 drop glpi_config.time_step"); } $query = "UPDATE `glpi_config` SET `time_step` = '5', `show_admin_doc` = '0', `keep_tracking_on_delete` = '0'"; $DB->queryOrDie($query, "0.68.1 update glpi_config data"); if (!FieldExists("glpi_ocs_config", "cron_sync_number", false)) { $query = "ALTER TABLE `glpi_ocs_config` ADD `cron_sync_number` INT DEFAULT '1' "; $DB->queryOrDie($query, "0.68.1 drop glpi_ocs_config.cron_sync_number"); } if (!FieldExists("glpi_profiles", "show_group_ticket", false)) { $query = "ALTER TABLE `glpi_profiles` ADD `show_group_ticket` char(1) DEFAULT '0' "; $DB->queryOrDie($query, "0.68.1 drop glpi_profiles.show_group_ticket"); } if (!FieldExists("glpi_config", "ldap_group_condition", false)) { $query = "ALTER TABLE `glpi_config` ADD `ldap_group_condition` VARCHAR( 255 ) NULL , ADD `ldap_search_for_groups` TINYINT NOT NULL DEFAULT '0', ADD `ldap_field_group_member` VARCHAR( 255 ) NULL "; $DB->queryOrDie($query, "0.68.1 add glpi_config.ldap_*_groups"); } if (!FieldExists("glpi_groups", "ldap_group_dn", false)) { $query = "ALTER TABLE `glpi_groups` ADD `ldap_group_dn` VARCHAR( 255 ) NULL "; $DB->queryOrDie($query, "0.68.1 add glpi_groups.ldap_group_dn"); } if (!FieldExists("glpi_ocs_link", "ocs_deviceid", false)) { $query = "ALTER TABLE `glpi_ocs_link` CHANGE `ocs_id` `ocs_deviceid` VARCHAR( 255 ) NOT NULL "; $DB->queryOrDie($query, "0.68.1 add glpi_ocs_link.ocs_deviceid"); } if (!FieldExists("glpi_ocs_link", "ocs_id", false)) { $query = "ALTER TABLE `glpi_ocs_link` ADD `ocs_id` INT NOT NULL DEFAULT '0' AFTER `glpi_id` "; $DB->queryOrDie($query, "0.68.1 add glpi_ocs_link.ocs_id"); } if (!FieldExists("glpi_ocs_link", "last_ocs_update", false)) { $query = "ALTER TABLE `glpi_ocs_link` ADD `last_ocs_update` DATETIME NULL AFTER `last_update` "; $DB->queryOrDie($query, "0.68.1 add glpi_ocs_link.last_ocs_update"); } if (countElementsInTable("glpi_ocs_link")) { $CFG_GLPI["ocs_mode"] = 1; $DBocs = new DBocs(1); // Get datas to update $query = "SELECT * FROM `glpi_ocs_link`"; $result_glpi = $DB->query($query); while ($data_glpi = $DB->fetch_array($result_glpi)) { // Get ocs information $query_ocs = "SELECT * FROM `hardware` WHERE `DEVICEID` = '".$data_glpi["ocs_deviceid"]."' LIMIT 1"; $result_ocs = $DBocs->queryOrDie($query_ocs, "0.68.1 get ocs infos"); if ($result_ocs && $DBocs->numrows($result_ocs)) { $data_ocs = $DBocs->fetch_array($result_ocs); $query_update = "UPDATE `glpi_ocs_link` SET `ocs_id` = '".$data_ocs["ID"]."', `last_ocs_update` = '".$data_ocs["LASTDATE"]."' WHERE `ID` = '".$data_glpi["ID"]."'"; $DB->queryOrDie($query_update, "0.68.1 update ocs infos"); } } } if (!TableExists("glpi_dropdown_case_type")) { $query = "CREATE TABLE `glpi_dropdown_case_type` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL, `comments` text, PRIMARY KEY (`ID`), KEY `name` (`name`) ) ENGINE=MyISAM;"; $DB->queryOrDie($query, "0.68.1 add table dropdown_case_type"); // ajout du champs type $query = "ALTER TABLE `glpi_device_case` ADD `type` INT(11) default NULL AFTER `designation` "; $DB->queryOrDie($query, "0.68.1 add glpi_device_case.type"); // Ajout des entrees dans la table dropdown_case_type $query = "INSERT INTO `glpi_dropdown_case_type` (`ID` , `name` , `comments`) VALUES ('1' , 'Grand', NULL)"; $DB->queryOrDie($query, "0.68.1 glpi_device_case"); $query = "INSERT INTO `glpi_dropdown_case_type` (`ID` , `name` , `comments`) VALUES ('2' , 'Moyen', NULL)"; $DB->queryOrDie($query, "0.68.1 glpi_device_case"); $query = "INSERT INTO `glpi_dropdown_case_type` (`ID` , `name` , `comments`) VALUES ('3' , 'Micro', NULL)"; $DB->queryOrDie($query, "0.68.1 glpi_device_case"); // Mapping format enum / type $query = "UPDATE `glpi_device_case` SET `type` = '1' WHERE `format` = 'Grand'"; $DB->queryOrDie($query, "0.68.1 glpi_device_case"); $query = "UPDATE `glpi_device_case` SET `type` = '2' WHERE `format` = 'Moyen'"; $DB->queryOrDie($query, "0.68.1 glpi_device_case"); $query = "UPDATE `glpi_device_case` SET `type` = '3' WHERE `format` = 'Micro'"; $DB->queryOrDie($query, "0.68.1 glpi_device_case"); // Supression du champ format $query = "ALTER TABLE `glpi_device_case` DROP `format`"; $DB->queryOrDie($query, "0.68.1 drop format from glpi_device_case"); } // Clean state datas if (TableExists("glpi_state_item")) { $query = "SELECT COUNT(*) AS CPT, `device_type`, `id_device` FROM `glpi_state_item` GROUP BY `device_type`, `id_device` HAVING CPT > 1"; $result = $DB->query($query); if ($DB->numrows($result)) { while ($data = $DB->fetch_array($result)) { $query2 = "DELETE FROM `glpi_state_item` WHERE `device_type` = '".$data["device_type"]."' AND `id_device` = '".$data["id_device"]."' LIMIT ".($data["CPT"]-1).""; $DB->queryOrDie($query2, "0.68.1 clean glpi_state_item"); } } if (isIndex("glpi_state_item", "device_type")) { $query = "ALTER TABLE `glpi_state_item` DROP INDEX `device_type` "; $DB->queryOrDie($query,"0.68.1 drop index glpi_state_item"); } if (isIndex("glpi_state_item", "device_type2")) { $query = "ALTER TABLE `glpi_state_item` DROP INDEX `device_type2` "; $DB->queryOrDie($query, "0.68.1 drop index glpi_state_item"); } $query = "ALTER TABLE `glpi_state_item` ADD INDEX (`device_type`) "; $DB->queryOrDie($query, "0.68.1 add index glpi_state_item"); $query = "ALTER TABLE `glpi_state_item` ADD UNIQUE (`device_type`, `id_device`) "; $DB->queryOrDie($query, "0.68.1 add unique glpi_state_item"); } } // fin 0.68 ##################################################################################### ?>glpi-0.84.3+dfsg.1/install/update_06_065.php000066400000000000000000001636011226600447100201700ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /// Update from 0.6 to 0.65 function update06to065() { global $DB; echo "

    Version 0.65

    "; if (!isIndex("glpi_networking_ports", "on_device_2")) { $query = "ALTER TABLE `glpi_networking_ports` ADD INDEX (`on_device`) "; $DB->queryOrDie($query, "0.65"); } if (!isIndex("glpi_networking_ports", "device_type")) { $query = "ALTER TABLE `glpi_networking_ports` ADD INDEX (`device_type`) "; $DB->queryOrDie($query, "0.65"); } if (!isIndex("glpi_computer_device", "FK_device")) { $query = "ALTER TABLE `glpi_computer_device` ADD INDEX (`FK_device`) "; $DB->queryOrDie($query, "0.65"); } // Field for public FAQ if (!FieldExists("glpi_config","public_faq", false)) { $query = "ALTER TABLE `glpi_config` ADD `public_faq` ENUM( '0', '1' ) NOT NULL AFTER `auto_assign` "; $DB->queryOrDie($query, "0.65 add public_faq in config"); } // Optimize amort_type field if (FieldExists("glpi_infocoms","amort_type", false)) { $query2 = "UPDATE `glpi_infocoms` SET `amort_type` = '0' WHERE `amort_type` = ''"; $DB->queryOrDie($query2, "0.65 update amort_type='' in tracking"); $query = "ALTER TABLE `glpi_infocoms` CHANGE `amort_type` `amort_type` tinyint(4) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.65 alter amort_type in infocoms"); } if (!TableExists("glpi_display")) { $query = "CREATE TABLE `glpi_display` ( `ID` int(11) NOT NULL auto_increment, `type` smallint(6) NOT NULL default '0', `num` smallint(6) NOT NULL default '0', `rank` smallint(6) NOT NULL default '0', PRIMARY KEY (`ID`), UNIQUE KEY `type_2` (`type`, `num`), KEY `type` (`type`), KEY `rank` (`rank`), KEY `num` (`num`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.65 add glpi_display table"); // TEMPORARY : ADD ITEMS TO DISPLAY TABLE : TO DEL OR TO $query = "INSERT INTO `glpi_display` VALUES (32, 1, 4, 4), (34, 1, 6, 6), (33, 1, 5, 5), (31, 1, 8, 3), (30, 1, 23, 2), (86, 12, 3, 1), (49, 4, 31, 1), (50, 4, 23, 2), (51, 4, 3, 3), (52, 4, 4, 4), (44, 3, 31, 1), (38, 2, 31, 1), (39, 2, 23, 2), (45, 3, 23, 2), (46, 3, 3, 3), (63, 6, 4, 3), (62, 6, 5, 2), (61, 6, 23, 1), (83, 11, 4, 2), (82, 11, 3, 1), (57, 5, 3, 3), (56, 5, 23, 2), (55, 5, 31, 1), (29, 1, 31, 1), (35, 1, 3, 7), (36, 1, 19, 8), (37, 1, 17, 9), (40, 2, 3, 3), (41, 2, 4, 4), (42, 2, 11, 6), (43, 2, 9, 7), (47, 3, 4, 4), (48, 3, 9, 6), (53, 4, 9, 6), (54, 4, 7, 7), (58, 5, 4, 4), (59, 5, 9, 6), (60, 5, 7, 7), (64, 7, 3, 1), (65, 7, 4, 2), (66, 7, 5, 3), (67, 7, 6, 4), (68, 7, 9, 5), (69, 8, 9, 1), (70, 8, 3, 2), (71, 8, 4, 3), (72, 8, 5, 4), (73, 8, 10, 5), (74, 8, 6, 6), (75, 10, 4, 1), (76, 10, 3, 2), (77, 10, 5, 3), (78, 10, 6, 4), (79, 10, 7, 5), (80, 10, 11, 6), (84, 11, 5, 3), (85, 11, 6, 4), (88, 12, 6, 2), (89, 12, 4, 3), (90, 12, 5, 4), (91, 13, 3, 1), (92, 13, 4, 2), (93, 13, 7, 3), (94, 13, 5, 4), (95, 13, 6, 5), (96, 15, 3, 1), (97, 15, 4, 2), (98, 15, 5, 3), (99, 15, 6, 4), (100, 15, 7, 5), (101, 17, 3, 1), (102, 17, 4, 2), (103, 17, 5, 3), (104, 17, 6, 4), (105, 2, 40, 5), (106, 3, 40, 5), (107, 4, 40, 5), (108, 5, 40, 5), (109, 15, 8, 6), (110, 23, 31, 1), (111, 23, 23, 2), (112, 23, 3, 3), (113, 23, 4, 4), (114, 23, 40, 5), (115, 23, 9, 6), (116, 23, 7, 7)"; $DB->query($query); } if (!FieldExists("glpi_config","ldap_login", false)) { $query = "ALTER TABLE `glpi_config` ADD `ldap_login` VARCHAR( 200 ) NOT NULL DEFAULT 'uid' AFTER `ldap_condition`"; $DB->queryOrDie($query, "0.65 add url in config"); } if (!FieldExists("glpi_config","url_base", false)) { $query = "ALTER TABLE `glpi_config` ADD `url_base` VARCHAR( 255 ) NOT NULL "; $DB->queryOrDie($query, "0.65 add url in config"); $query = "ALTER TABLE `glpi_config` ADD `url_in_mail` ENUM( '0', '1' ) NOT NULL "; $DB->queryOrDie($query, "0.65 add url_in_mail in config"); $query = "UPDATE `glpi_config` SET `url_base` = '".str_replace("/install.php", "", $_SERVER['HTTP_REFERER'])."' WHERE `ID` = '1'"; $DB->queryOrDie($query, " url"); } if (!FieldExists("glpi_config","text_login", false)) { $query = "ALTER TABLE `glpi_config` ADD `text_login` TEXT NOT NULL "; $DB->queryOrDie($query, "0.65 add text_login in config"); } if (!FieldExists("glpi_config","auto_update_check", false)) { $query = "ALTER TABLE `glpi_config` ADD `auto_update_check` SMALLINT DEFAULT '0' NOT NULL , ADD `last_update_check` DATE DEFAULT '".date("Y-m-d")."' NOT NULL, ADD `founded_new_version` VARCHAR( 10 ) NOT NULL "; $DB->queryOrDie($query, "0.65 add auto_login_check in config"); } //// Tracking if (FieldExists("glpi_tracking","status", false)) { $already_done = false; if ($result = $DB->query("show fields from glpi_tracking")) { while ($data=$DB->fetch_array($result)) { if ($data["Field"]=="status" && strstr($data["Type"],"done")) { $already_done = true; } } } if (!$already_done) { $query = "ALTER TABLE `glpi_tracking` CHANGE `status` `status` ENUM('new', 'old', 'old_done', 'assign', 'plan', 'old_notdone', 'waiting') DEFAULT 'new' NOT NULL"; $DB->queryOrDie($query, "0.65 alter status in tracking"); $query2 = "UPDATE `glpi_tracking` SET `status` = 'old_done' WHERE `status` <> 'new'"; $DB->queryOrDie($query2, "0.65 update status=old in tracking"); $query3 = "UPDATE `glpi_tracking` SET `status` = 'assign' WHERE `status` = 'new' AND `assign` <> '0'"; $DB->queryOrDie($query3, "0.65 update status=assign in tracking"); $query4 = "ALTER TABLE `glpi_tracking` CHANGE `status` `status` ENUM('new', 'old_done', 'assign', 'plan', 'old_notdone', 'waiting') DEFAULT 'new' NOT NULL"; $DB->queryOrDie($query4, "0.65 alter status in tracking"); } } if (!isIndex("glpi_tracking_planning","id_assign")) { $query = "ALTER TABLE `glpi_tracking_planning` ADD INDEX ( `id_assign` ) "; $DB->queryOrDie($query, "0.65 add index for id_assign in tracking_planning"); } if (FieldExists("glpi_tracking","emailupdates", false)) { $query2 = " UPDATE `glpi_tracking` SET `emailupdates` = 'no' WHERE `emailupdates` = ''"; $DB->queryOrDie($query2, "0.65 update emailupdate='' in tracking"); $query = "ALTER TABLE `glpi_tracking` CHANGE `emailupdates` `emailupdates` ENUM('yes', 'no') DEFAULT 'no' NOT NULL"; $DB->queryOrDie($query, "0.65 alter emailupdates in tracking"); } if (!FieldExists("glpi_followups","private", false)) { $query = "ALTER TABLE `glpi_followups` ADD `private` INT( 1 ) DEFAULT '0' NOT NULL"; $DB->queryOrDie($query, "0.65 add private in followups"); } if (!FieldExists("glpi_followups","realtime", false)) { $query = "ALTER TABLE `glpi_followups` ADD `realtime` FLOAT DEFAULT '0' NOT NULL "; $DB->queryOrDie($query, "0.65 add realtime in followups"); } if (!FieldExists("glpi_config","mailing_attrib_attrib", false)) { $query = "ALTER TABLE `glpi_config` ADD `mailing_attrib_attrib` tinyint(4) NOT NULL DEFAULT '1' AFTER `mailing_finish_user`"; $DB->queryOrDie($query, "0.65 add mailing_attrib_attrib in config"); } if (!FieldExists("glpi_tracking_planning","id_followup", false)) { $query = "ALTER TABLE `glpi_tracking_planning` ADD `id_followup` INT DEFAULT '0' NOT NULL AFTER `id_tracking` "; $DB->queryOrDie($query, "0.65 add id_followup in tracking_planning"); $query = "ALTER TABLE `glpi_tracking_planning` ADD INDEX (`id_followup`)"; $DB->queryOrDie($query, "0.65 add index for id_followup in tracking_planning"); //// Move Planned item to followup // Get super-admin ID $suid = 0; $query0 = "SELECT `ID` FROM `glpi_users` WHERE `type` = 'super-admin'"; $result0 = $DB->query($query0); if ($DB->numrows($result0)>0) { $suid = $DB->result($result0, 0, 0); } $DB->free_result($result0); $query = "SELECT * FROM `glpi_tracking_planning` ORDER BY `id_tracking`"; $result = $DB->query($query); $used_followups = array(); if ($DB->numrows($result)>0) { while ($data=$DB->fetch_array($result)) { $found = -1; // Is a followup existing ? $query2 = "SELECT * FROM `glpi_followups` WHERE `tracking` = '".$data["id_tracking"]."'"; $result2 = $DB->query($query2); if ($DB->numrows($result2)>0) { while ($found<0 && $data2=$DB->fetch_array($result2)) { if (!in_array($data2['ID'],$used_followups)) { $found = $data2['ID']; } } } $DB->free_result($result2); // Followup not founded if ($found<0) { $query3 = "INSERT INTO `glpi_followups` (`tracking`, `date`, `author`, `contents`) VALUES ('".$data["id_tracking"]."', '".date("Y-m-d")."', '$suid', 'Automatic Added followup for compatibility problem in update')"; $DB->query($query3); $found = $DB->insert_id(); } array_push($used_followups, $found); $query4 = "UPDATE `glpi_tracking_planning` SET `id_followup` = '$found' WHERE `ID` ='".$data['ID']."'"; $DB->query($query4); } } unset($used_followups); $DB->free_result($result); $query = "ALTER TABLE `glpi_tracking_planning` DROP `id_tracking` "; $DB->queryOrDie($query, "0.65 add index for id_followup in tracking_planning"); } if (!FieldExists("glpi_config","use_ajax", false)) { $query = "ALTER TABLE `glpi_config` ADD `dropdown_max` INT DEFAULT '100' NOT NULL , ADD `ajax_wildcard` CHAR( 1 ) DEFAULT '*' NOT NULL , ADD `use_ajax` SMALLINT DEFAULT '0' NOT NULL , ADD `ajax_limit_count` INT DEFAULT '50' NOT NULL "; $DB->queryOrDie($query, "0.65 add ajax fields in config"); } if (!FieldExists("glpi_config","ajax_autocompletion", false)) { $query = "ALTER TABLE `glpi_config` ADD `ajax_autocompletion` SMALLINT DEFAULT '1' NOT NULL "; $DB->queryOrDie($query, "0.65 add ajax_autocompletion field in config"); } if (!FieldExists("glpi_config","auto_add_users", false)) { $query = "ALTER TABLE `glpi_config` ADD `auto_add_users` SMALLINT DEFAULT '1' NOT NULL "; $DB->queryOrDie($query, "0.65 add auto_add_users field in config"); } if (!FieldExists("glpi_config","dateformat", false)) { $query = "ALTER TABLE `glpi_config` ADD `dateformat` SMALLINT DEFAULT '0' NOT NULL "; $DB->queryOrDie($query, "0.65 add dateformat field in config"); } if (FieldExists("glpi_software","version", false)) { $query = "ALTER TABLE `glpi_software` CHANGE `version` `version` VARCHAR( 200 ) NOT NULL"; $DB->queryOrDie($query, "0.65 alter version field in software"); } if (!FieldExists("glpi_config","nextprev_item", false)) { $query = "ALTER TABLE `glpi_config` ADD `nextprev_item` VARCHAR( 200 ) DEFAULT 'name' NOT NULL "; $DB->queryOrDie($query, "0.65 add nextprev_item field in config"); } if (!FieldExists("glpi_config","view_ID", false)) { $query = "ALTER TABLE `glpi_config` ADD `view_ID` SMALLINT DEFAULT '0' NOT NULL "; $DB->queryOrDie($query, "0.65 add nextprev_item field in config"); } if (FieldExists("glpi_infocoms","comments", false)) { $query = "ALTER TABLE `glpi_infocoms` CHANGE `comments` `comments` TEXT"; $DB->queryOrDie($query, "0.65 alter comments in glpi_infocoms"); } $new_model = array("monitors", "networking", "peripherals", "printers"); foreach ($new_model as $model) { if (!TableExists("glpi_dropdown_model_$model")) { // model=type pour faciliter la gestion en post mise �jour : ya plus qu'a deleter les elements non voulu // cela conviendra a tout le monde en fonction de l'utilisation du champ type $query = "CREATE TABLE `glpi_dropdown_model_$model` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', PRIMARY KEY (`ID`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.65 add table glpi_dropdown_model_$model"); // copie type dans model $query = "SELECT * FROM `glpi_type_$model`"; $result = $DB->query($query); if ($DB->numrows($result)>0) { while ($data=$DB->fetch_array($result)) { $query = "INSERT INTO `glpi_dropdown_model_$model` (`ID`, `name`) VALUES ('".$data['ID']."', '".addslashes($data['name'])."')"; $DB->queryOrDie($query, "0.65 insert value in glpi_dropdown_model_$model"); } } $DB->free_result($result); } if (!FieldExists("glpi_$model","model", false)) { $query = "ALTER TABLE `glpi_$model` ADD `model` INT(11) DEFAULT NULL AFTER `type` "; $DB->queryOrDie($query, "0.6 add model in $model"); $query = "UPDATE `glpi_$model` SET `model` = `type` "; $DB->queryOrDie($query, "0.6 add model in $model"); } } // Update pour les cartouches compatibles : type -> model if (FieldExists("glpi_cartridges_assoc","FK_glpi_type_printer", false)) { $query = "ALTER TABLE `glpi_cartridges_assoc` CHANGE `FK_glpi_type_printer` `FK_glpi_dropdown_model_printers` INT( 11 ) DEFAULT '0' NOT NULL "; $DB->queryOrDie($query, "0.65 alter FK_glpi_type_printer field in cartridges_assoc"); } if (!FieldExists("glpi_links","data", false)) { $query = "ALTER TABLE `glpi_links` ADD `data` TEXT NOT NULL "; $DB->queryOrDie($query, "0.65 create data in links"); } if (!TableExists("glpi_dropdown_auto_update")) { $query = "CREATE TABLE `glpi_dropdown_auto_update` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', PRIMARY KEY (`ID`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.65 add table glpi_dropdown_auto_update"); } if (!FieldExists("glpi_computers","auto_update", false)) { $query = "ALTER TABLE `glpi_computers` ADD `auto_update` INT DEFAULT '0' NOT NULL AFTER `os` "; $DB->queryOrDie($query, "0.65 alter computers add auto_update"); } // Update specificity of computer_device $query = "SELECT `glpi_computer_device`.`ID` AS ID, `glpi_device_processor`.`specif_default` AS SPECIF FROM `glpi_computer_device` LEFT JOIN `glpi_device_processor` ON (`glpi_computer_device`.`FK_device` = `glpi_device_processor`.`ID` AND `glpi_computer_device`.`device_type` = '".PROCESSOR_DEVICE."') WHERE `glpi_computer_device`.`specificity` =''"; $result = $DB->query($query); if ($DB->numrows($result)>0) { while ($data=$DB->fetch_assoc($result)) { $query2 = "UPDATE `glpi_computer_device` SET `specificity` = '".$data["SPECIF"]."' WHERE `ID` = '".$data["ID"]."'"; $DB->query($query2); } } $query = "SELECT `glpi_computer_device`.`ID` AS ID, `glpi_device_ram`.`specif_default` AS SPECIF FROM `glpi_computer_device` LEFT JOIN `glpi_device_ram` ON (`glpi_computer_device`.`FK_device` = `glpi_device_ram`.`ID` AND `glpi_computer_device`.`device_type` = '".RAM_DEVICE."') WHERE `glpi_computer_device`.`specificity` =''"; $result = $DB->query($query); if ($DB->numrows($result)>0) { while ($data=$DB->fetch_assoc($result)) { $query2 = "UPDATE `glpi_computer_device` SET `specificity` = '".$data["SPECIF"]."' WHERE `ID` = '".$data["ID"]."'"; $DB->query($query2); } } $query = "SELECT `glpi_computer_device`.`ID` AS ID, `glpi_device_hdd`.`specif_default` AS SPECIF FROM `glpi_computer_device` LEFT JOIN `glpi_device_hdd` ON (`glpi_computer_device`.`FK_device` = `glpi_device_hdd`.`ID` AND `glpi_computer_device`.`device_type` = '".HDD_DEVICE."') WHERE `glpi_computer_device`.`specificity` =''"; $result = $DB->query($query); if ($DB->numrows($result)>0) { while ($data=$DB->fetch_assoc($result)) { $query2 = "UPDATE `glpi_computer_device` SET `specificity` = '".$data["SPECIF"]."' WHERE `ID` = '".$data["ID"]."'"; $DB->query($query2); } } $query = "SELECT `glpi_computer_device`.`ID` as ID, `glpi_device_iface`.`specif_default` AS SPECIF FROM `glpi_computer_device` LEFT JOIN `glpi_device_iface` ON (`glpi_computer_device`.`FK_device` = `glpi_device_iface`.`ID` AND `glpi_computer_device`.`device_type` = '".NETWORK_DEVICE."') WHERE `glpi_computer_device`.`specificity` =''"; $result = $DB->query($query); if ($DB->numrows($result)>0) { while ($data=$DB->fetch_assoc($result)) { $query2 = "UPDATE `glpi_computer_device` SET `specificity` = '".$data["SPECIF"]."' WHERE `ID` = '".$data["ID"]."'"; $DB->query($query2); } } // add field notes in tables $new_notes = array("cartridges_type", "computers", "consumables_type", "contacts", "contracts", "docs", "enterprises", "monitors", "networking", "peripherals", "printers", "software"); foreach ($new_notes as $notes) { if (!FieldExists("glpi_$notes","notes", false)) { $query = "ALTER TABLE `glpi_$notes` ADD `notes` LONGTEXT NULL "; $DB->queryOrDie($query, "0.65 add notes field in table"); } } if (!FieldExists("glpi_users","active", false)) { $query = "ALTER TABLE `glpi_users` ADD `active` INT( 2 ) DEFAULT '1' NOT NULL "; $DB->queryOrDie($query, "0.65 add active in users"); } if (TableExists("glpi_type_docs")) { $query = "SELECT * FROM `glpi_type_docs` WHERE `ext` IN ('odt', 'ods', 'odp', 'otp', 'ott', 'ots', 'odf', 'odg', 'otg', 'odb', 'oth', 'odm', 'odc', 'odi')"; $result = $DB->query($query); if ($DB->numrows($result)==0) { $query2 = "INSERT INTO `glpi_type_docs` (`name`, `ext`, `icon`, `mime`, `upload`, `date_mod`) VALUES ('Oasis Open Office Writer', 'odt', 'odt-dist.png', '', 'Y', '2006-01-21 17:41:13'), ('Oasis Open Office Calc', 'ods', 'ods-dist.png', '', 'Y', '2006-01-21 17:41:31'), ('Oasis Open Office Impress', 'odp', 'odp-dist.png', '', 'Y', '2006-01-21 17:42:54'), ('Oasis Open Office Impress Template', 'otp', 'odp-dist.png', '', 'Y', '2006-01-21 17:43:58'), ('Oasis Open Office Writer Template', 'ott', 'odt-dist.png', '', 'Y', '2006-01-21 17:44:41'), ('Oasis Open Office Calc Template', 'ots', 'ods-dist.png', '', 'Y', '2006-01-21 17:45:30'), ('Oasis Open Office Math', 'odf', 'odf-dist.png', '', 'Y', '2006-01-21 17:48:05'), ('Oasis Open Office Draw', 'odg', 'odg-dist.png', '', 'Y', '2006-01-21 17:48:31'), ('Oasis Open Office Draw Template', 'otg', 'odg-dist.png', '', 'Y', '2006-01-21 17:49:46'), ('Oasis Open Office Base', 'odb', 'odb-dist.png', '', 'Y', '2006-01-21 18:03:34'), ('Oasis Open Office HTML', 'oth', 'oth-dist.png', '', 'Y', '2006-01-21 18:05:27'), ('Oasis Open Office Writer Master', 'odm', 'odm-dist.png', '', 'Y', '2006-01-21 18:06:34'), ('Oasis Open Office Chart', 'odc', '', '', 'Y', '2006-01-21 18:07:48'), ('Oasis Open Office Image', 'odi', '', '', 'Y', '2006-01-21 18:08:18')"; $DB->queryOrDie($query2, "0.65 add new type docs"); } } ///// BEGIN MySQL Compatibility if (FieldExists("glpi_infocoms","warranty_value", false)) { $query2 = "UPDATE `glpi_infocoms` SET `warranty_value` = '0' WHERE `warranty_value` IS NULL"; $DB->queryOrDie($query2, "0.65 update warranty_value='' in tracking"); $query = "ALTER TABLE `glpi_infocoms` CHANGE `warranty_info` `warranty_info` VARCHAR( 255 ) NULL DEFAULT NULL, CHANGE `warranty_value` `warranty_value` FLOAT NOT NULL DEFAULT '0', CHANGE `num_commande` `num_commande` VARCHAR( 200 ) NULL DEFAULT NULL, CHANGE `bon_livraison` `bon_livraison` VARCHAR( 200 ) NULL DEFAULT NULL, CHANGE `facture` `facture` VARCHAR( 200 ) NULL DEFAULT NULL, CHANGE `num_immo` `num_immo` VARCHAR( 200 ) NULL DEFAULT NULL"; $DB->queryOrDie($query, "0.65 alter various fields in infocoms"); } if (FieldExists("glpi_reservation_item","comments", false)) { $query = "ALTER TABLE `glpi_reservation_item` CHANGE `comments` `comments` TEXT NULL "; $DB->queryOrDie($query, "0.65 alter comments in glpi_reservation_item"); } if (FieldExists("glpi_cartridges_type","comments", false)) { $query = "ALTER TABLE `glpi_cartridges_type` CHANGE `name` `name` VARCHAR( 255 ) NULL DEFAULT NULL, CHANGE `ref` `ref` VARCHAR( 255 ) NULL DEFAULT NULL , CHANGE `comments` `comments` TEXT NULL DEFAULT NULL "; $DB->queryOrDie($query, "0.65 alter various fields in cartridges_type"); } if (FieldExists("glpi_computer_device","specificity", false)) { $query = "ALTER TABLE `glpi_computer_device` CHANGE `specificity` `specificity` VARCHAR( 250 ) NULL "; $DB->queryOrDie($query, "0.65 alter specificity in glpi_computer_device"); } $inv_table = array("computers", "monitors", "networking", "peripherals", "printers"); foreach ($inv_table as $table) { if (FieldExists("glpi_$table","comments", false)) { $query = "UPDATE `glpi_$table` SET `location` = '0' WHERE `location` IS NULL"; $DB->queryOrDie($query, "0.65 prepare data fro alter various fields in $table"); $query = "ALTER TABLE `glpi_$table` CHANGE `name` `name` VARCHAR( 200 ) NULL , CHANGE `serial` `serial` VARCHAR( 200 ) NULL , CHANGE `otherserial` `otherserial` VARCHAR( 200 ) NULL , CHANGE `contact` `contact` VARCHAR( 200 ) NULL , CHANGE `contact_num` `contact_num` VARCHAR( 200 ) NULL , CHANGE `location` `location` INT( 11 ) NOT NULL DEFAULT '0', CHANGE `comments` `comments` TEXT NULL "; $DB->queryOrDie($query, "0.65 alter various fields in $table"); } } if (FieldExists("glpi_computers","os", false)) { $query = "UPDATE `glpi_computers` SET `model` = '0' WHERE `model` IS NULL"; $DB->queryOrDie($query, "0.65 prepare model for alter computers"); $query = "UPDATE `glpi_computers` SET `type` = '0' WHERE `type` IS NULL"; $DB->queryOrDie($query, "0.65 prepare type for alter computers"); $query = "ALTER TABLE `glpi_computers` CHANGE `os` `os` INT( 11 ) NOT NULL DEFAULT '0', CHANGE `model` `model` INT( 11 ) NOT NULL DEFAULT '0', CHANGE `type` `type` INT( 11 ) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.65 alter various fields in computers"); } if (FieldExists("glpi_networking","ram", false)) { $query = "ALTER TABLE `glpi_networking` CHANGE `ram` `ram` VARCHAR( 200 ) NULL, CHANGE `ifmac` `ifmac` VARCHAR( 200 ) NULL , CHANGE `ifaddr` `ifaddr` VARCHAR( 200 ) NULL"; $DB->queryOrDie($query, "0.65 alter 2 various fields in networking"); } if (FieldExists("glpi_peripherals","brand", false)) { $query = "ALTER TABLE `glpi_peripherals` CHANGE `brand` `brand` VARCHAR( 200 ) NULL "; $DB->queryOrDie($query, "0.65 alter 2 various fields in peripherals"); } if (FieldExists("glpi_printers","ramSize", false)) { $query = "ALTER TABLE `glpi_printers` CHANGE `ramSize` `ramSize` VARCHAR( 200 ) NULL "; $DB->queryOrDie($query, "0.65 alter 2 various fields in printers"); } if (FieldExists("glpi_consumables_type","comments", false)) { $query = "ALTER TABLE `glpi_consumables_type` CHANGE `name` `name` VARCHAR( 255 ) NULL, CHANGE `ref` `ref` VARCHAR( 255 ) NULL, CHANGE `comments` `comments` TEXT NULL "; $DB->queryOrDie($query, "0.65 alter various fields in consumables_type"); } if (FieldExists("glpi_contacts","comments", false)) { $query = "ALTER TABLE `glpi_contacts` CHANGE `name` `name` VARCHAR( 255 ) NULL, CHANGE `phone` `phone` VARCHAR( 200 ) NULL, CHANGE `phone2` `phone2` VARCHAR( 200 ) NULL, CHANGE `fax` `fax` VARCHAR( 200 ) NULL, CHANGE `email` `email` VARCHAR( 255 ) NULL, CHANGE `comments` `comments` TEXT NULL "; $DB->queryOrDie($query, "0.65 alter various fields in contacts"); } if (FieldExists("glpi_contracts","comments", false)) { $query = "ALTER TABLE `glpi_contracts` CHANGE `name` `name` VARCHAR( 255 ) NULL, CHANGE `num` `num` VARCHAR( 255 ) NULL, CHANGE `comments` `comments` TEXT NULL, CHANGE `compta_num` `compta_num` VARCHAR( 255 ) NULL "; $DB->queryOrDie($query, "0.65 alter various fields in contracts"); } $device = array("case", "control", "drive", "gfxcard", "hdd", "iface", "moboard", "power", "pci", "processor", "ram", "sndcard"); foreach ($device as $dev) { if (FieldExists("glpi_device_$dev","comment", false)) { $query = "ALTER TABLE `glpi_device_$dev` CHANGE `designation` `designation` VARCHAR( 255 ) NULL, CHANGE `comment` `comment` TEXT NULL, CHANGE `specif_default` `specif_default` VARCHAR( 250 ) NULL "; $DB->queryOrDie($query, "0.65 alter various fields in device_$dev"); } if (!isIndex("glpi_device_$dev","designation")) { $query = "ALTER TABLE `glpi_device_$dev` ADD INDEX (`designation`)"; $DB->queryOrDie($query, "0.65 alter various fields in device_$dev"); } } if (FieldExists("glpi_docs","comment", false)) { $query = "ALTER TABLE `glpi_docs` CHANGE `name` `name` VARCHAR( 255 ) NULL, CHANGE `filename` `filename` VARCHAR( 255 ) NULL, CHANGE `mime` `mime` VARCHAR( 30 ) NULL, CHANGE `comment` `comment` TEXT NULL, CHANGE `link` `link` VARCHAR( 255 ) NULL"; $DB->queryOrDie($query, "0.65 alter various fields in docs"); } if (FieldExists("glpi_enterprises","comments", false)) { $query = "ALTER TABLE `glpi_enterprises` CHANGE `name` `name` VARCHAR( 200 ) NULL, CHANGE `address` `address` TEXT NULL, CHANGE `website` `website` VARCHAR( 200 ) NULL, CHANGE `phonenumber` `phonenumber` VARCHAR( 200 ) NULL, CHANGE `comments` `comments` TEXT NULL, CHANGE `fax` `fax` VARCHAR( 255 ) NULL, CHANGE `email` `email` VARCHAR( 255 ) NULL"; $DB->queryOrDie($query, "0.65 alter various fields in enterprises"); } if (FieldExists("glpi_event_log","message", false)) { $query = "ALTER TABLE `glpi_event_log` CHANGE `itemtype` `itemtype` VARCHAR( 200 ) NULL, CHANGE `service` `service` VARCHAR( 200 ) NULL, CHANGE `message` `message` TEXT NULL"; $DB->queryOrDie($query, "0.65 alter various fields in event_log"); } if (FieldExists("glpi_kbitems","question", false)) { $query = "ALTER TABLE `glpi_kbitems` CHANGE `question` `question` TEXT NULL, CHANGE `answer` `answer` TEXT NULL "; $DB->queryOrDie($query, "0.65 alter various fields in kbitems"); } if (FieldExists("glpi_licenses","serial", false)) { $query = "ALTER TABLE `glpi_licenses` CHANGE `serial` `serial` VARCHAR( 255 ) NULL"; $DB->queryOrDie($query, "0.65 alter serial in licenses"); } if (FieldExists("glpi_links","data", false)) { $query = "ALTER TABLE `glpi_links` CHANGE `name` `name` VARCHAR( 255 ) NULL, CHANGE `data` `data` TEXT NULL"; $DB->queryOrDie($query, "0.65 alter various fields in links"); } if (FieldExists("glpi_networking_ports","ifmac", false)) { $query = "ALTER TABLE `glpi_networking_ports` CHANGE `name` `name` CHAR( 200 ) NULL, CHANGE `ifaddr` `ifaddr` CHAR( 200 ) NULL, CHANGE `ifmac` `ifmac` CHAR( 200 ) NULL"; $DB->queryOrDie($query, "0.65 alter various fields in networking_ports"); } if (FieldExists("glpi_reservation_resa","comment", false)) { $query = "ALTER TABLE `glpi_reservation_resa` CHANGE `comment` `comment` TEXT NULL"; $DB->queryOrDie($query, "0.65 alter comment in reservation_resa"); } if (FieldExists("glpi_software","version", false)) { $query = "ALTER TABLE `glpi_software` CHANGE `name` `name` VARCHAR( 200 ) NULL, CHANGE `version` `version` VARCHAR( 200 ) NULL "; $DB->queryOrDie($query, "0.65 alter various fields in software"); } if (FieldExists("glpi_type_docs","name", false)) { $query = "ALTER TABLE `glpi_type_docs` CHANGE `name` `name` VARCHAR( 255 ) NULL, CHANGE `ext` `ext` VARCHAR( 10 ) NULL, CHANGE `icon` `icon` VARCHAR( 255 ) NULL, CHANGE `mime` `mime` VARCHAR( 100 ) NULL "; $DB->queryOrDie($query, "0.65 alter various fields in type_docs"); } if (FieldExists("glpi_users","language", false)) { $query = "ALTER TABLE `glpi_users` CHANGE `name` `name` VARCHAR( 80 ) NULL, CHANGE `password` `password` VARCHAR( 80 ) NULL, CHANGE `password_md5` `password_md5` VARCHAR( 80 ) NULL, CHANGE `email` `email` VARCHAR( 200 ) NULL, CHANGE `realname` `realname` VARCHAR( 255 ) NULL, CHANGE `language` `language` VARCHAR( 255 ) NULL"; $DB->queryOrDie($query, "0.65 alter various fields in users"); } if (FieldExists("glpi_config","cut", false)) { $query = "ALTER TABLE `glpi_config` CHANGE `num_of_events` `num_of_events` VARCHAR( 200 ) NULL, CHANGE `jobs_at_login` `jobs_at_login` VARCHAR( 200 ) NULL, CHANGE `sendexpire` `sendexpire` VARCHAR( 200 ) NULL, CHANGE `cut` `cut` VARCHAR( 200 ) NULL, CHANGE `expire_events` `expire_events` VARCHAR( 200 ) NULL, CHANGE `list_limit` `list_limit` VARCHAR( 200 ) NULL, CHANGE `version` `version` VARCHAR( 200 ) NULL, CHANGE `logotxt` `logotxt` VARCHAR( 200 ) NULL, CHANGE `root_doc` `root_doc` VARCHAR( 200 ) NULL, CHANGE `event_loglevel` `event_loglevel` VARCHAR( 200 ) NULL, CHANGE `mailing` `mailing` VARCHAR( 200 ) NULL, CHANGE `imap_auth_server` `imap_auth_server` VARCHAR( 200 ) NULL, CHANGE `imap_host` `imap_host` VARCHAR( 200 ) NULL, CHANGE `ldap_host` `ldap_host` VARCHAR( 200 ) NULL, CHANGE `ldap_basedn` `ldap_basedn` VARCHAR( 200 ) NULL, CHANGE `ldap_rootdn` `ldap_rootdn` VARCHAR( 200 ) NULL, CHANGE `ldap_pass` `ldap_pass` VARCHAR( 200 ) NULL, CHANGE `admin_email` `admin_email` VARCHAR( 200 ) NULL, CHANGE `mailing_signature` `mailing_signature` VARCHAR( 200 ) NOT NULL DEFAULT '--', CHANGE `mailing_new_admin` `mailing_new_admin` tinyint(4) NOT NULL DEFAULT '1', CHANGE `mailing_followup_admin` `mailing_followup_admin` tinyint(4) NOT NULL DEFAULT '1', CHANGE `mailing_finish_admin` `mailing_finish_admin` tinyint(4) NOT NULL DEFAULT '1', CHANGE `mailing_new_all_admin` `mailing_new_all_admin` tinyint(4) NOT NULL DEFAULT '0', CHANGE `mailing_followup_all_admin` `mailing_followup_all_admin` tinyint(4) NOT NULL DEFAULT '0', CHANGE `mailing_finish_all_admin` `mailing_finish_all_admin` tinyint(4) NOT NULL DEFAULT '0', CHANGE `mailing_new_all_normal` `mailing_new_all_normal` tinyint(4) NOT NULL DEFAULT '0', CHANGE `mailing_followup_all_normal` `mailing_followup_all_normal` tinyint(4) NOT NULL DEFAULT '0', CHANGE `mailing_finish_all_normal` `mailing_finish_all_normal` tinyint(4) NOT NULL DEFAULT '0', CHANGE `mailing_new_attrib` `mailing_new_attrib` tinyint(4) NOT NULL DEFAULT '1', CHANGE `mailing_followup_attrib` `mailing_followup_attrib` tinyint(4) NOT NULL DEFAULT '1', CHANGE `mailing_finish_attrib` `mailing_finish_attrib` tinyint(4) NOT NULL DEFAULT '1', CHANGE `mailing_new_user` `mailing_new_user` tinyint(4) NOT NULL DEFAULT '1', CHANGE `mailing_followup_user` `mailing_followup_user` tinyint(4) NOT NULL DEFAULT '1', CHANGE `mailing_finish_user` `mailing_finish_user` tinyint(4) NOT NULL DEFAULT '1', CHANGE `mailing_resa_all_admin` `mailing_resa_all_admin` tinyint(4) NOT NULL DEFAULT '0', CHANGE `mailing_resa_user` `mailing_resa_user` tinyint(4) NOT NULL DEFAULT '1', CHANGE `mailing_resa_admin` `mailing_resa_admin` tinyint(4) NOT NULL DEFAULT '1', CHANGE `ldap_field_name` `ldap_field_name` VARCHAR( 200 ) NULL, CHANGE `ldap_field_email` `ldap_field_email` VARCHAR( 200 ) NULL, CHANGE `ldap_field_location` `ldap_field_location` VARCHAR( 200 ) NULL, CHANGE `ldap_field_realname` `ldap_field_realname` VARCHAR( 200 ) NULL, CHANGE `ldap_field_phone` `ldap_field_phone` VARCHAR( 200 ) NULL, CHANGE `ldap_condition` `ldap_condition` VARCHAR( 255 ) NULL, CHANGE `permit_helpdesk` `permit_helpdesk` VARCHAR( 200 ) NULL, CHANGE `cas_host` `cas_host` VARCHAR( 255 ) NULL, CHANGE `cas_port` `cas_port` VARCHAR( 255 ) NULL, CHANGE `cas_uri` `cas_uri` VARCHAR( 255 ) NULL, CHANGE `url_base` `url_base` VARCHAR( 255 ) NULL, CHANGE `text_login` `text_login` TEXT NULL, CHANGE `founded_new_version` `founded_new_version` VARCHAR( 10 ) NULL "; $DB->queryOrDie($query, "0.65 alter various fields in config"); } ///// END MySQL Compatibility if (!FieldExists("glpi_config","dropdown_limit", false)) { $query = "ALTER TABLE `glpi_config` ADD `dropdown_limit` INT( 11 ) DEFAULT '50' NOT NULL "; $DB->queryOrDie($query, "0.65 add dropdown_limit in config"); } if (FieldExists("glpi_consumables_type","type", false)) { $query = "ALTER TABLE `glpi_consumables_type` CHANGE `type` `type` INT( 11 ) NOT NULL DEFAULT '0', CHANGE `alarm` `alarm` INT( 11 ) NOT NULL DEFAULT '10'"; $DB->queryOrDie($query, "0.65 alter type and alarm in consumables_type"); } if (!FieldExists("glpi_config","post_only_followup", false)) { $query = "ALTER TABLE `glpi_config` ADD `post_only_followup` tinyint( 4 ) DEFAULT '1' NOT NULL "; $DB->queryOrDie($query, "0.65 add dropdown_limit in config"); } if (!FieldExists("glpi_monitors","flags_dvi", false)) { $query = "ALTER TABLE `glpi_monitors` ADD `flags_dvi` tinyint( 4 ) DEFAULT '0' NOT NULL AFTER `flags_bnc`"; $DB->queryOrDie($query, "0.65 add dropdown_limit in config"); } if (!TableExists("glpi_history")) { $query = "CREATE TABLE `glpi_history` ( `ID` int(11) NOT NULL auto_increment, `FK_glpi_device` int(11) NOT NULL default '0', `device_type` tinyint(4) NOT NULL default '0', `device_internal_type` int(11) default '0', `device_internal_action` tinyint(4) default '0', `user_name` varchar(200) default NULL, `date_mod` datetime default NULL, `id_search_option` int(11) NOT NULL default '0', `old_value` varchar(255) default NULL, `new_value` varchar(255) default NULL, PRIMARY KEY (`ID`), KEY `FK_glpi_device` (`FK_glpi_device`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.65 add glpi_history table"); } if (FieldExists("glpi_tracking","assign_type", false)) { $query = "ALTER TABLE `glpi_tracking` ADD `assign_ent` INT NOT NULL DEFAULT '0' AFTER `assign` "; $DB->queryOrDie($query, "0.65 add assign_ent in tracking"); $query = "UPDATE `glpi_tracking` SET `assign_ent` = `assign` WHERE `assign_type` = '".ENTERPRISE_TYPE."'"; $DB->queryOrDie($query, "0.65 update assign_ent in tracking"); $query = "UPDATE `glpi_tracking` SET `assign` = 0 WHERE `assign_type` = '".ENTERPRISE_TYPE."'"; $DB->queryOrDie($query, "0.65 update assign_ent in tracking"); $query = "ALTER TABLE `glpi_tracking` DROP `assign_type`"; $DB->queryOrDie($query, "0.65 drop assign_type in tracking"); } if (!FieldExists("glpi_config","mailing_update_admin", false)) { $query = "ALTER TABLE `glpi_config` ADD `mailing_update_admin` tinyint(4) NOT NULL DEFAULT '1' AFTER `mailing_new_admin`"; $DB->queryOrDie($query, "0.65 add mailing_update_admin in config"); } if (!FieldExists("glpi_config","mailing_update_all_admin", false)) { $query = "ALTER TABLE `glpi_config` ADD `mailing_update_all_admin` tinyint(4) NOT NULL DEFAULT '0' AFTER `mailing_new_all_admin`"; $DB->queryOrDie($query, "0.65 add mailing_update_all_admin in config"); } if (!FieldExists("glpi_config","mailing_update_all_normal", false)) { $query = "ALTER TABLE `glpi_config` ADD `mailing_update_all_normal` tinyint(4) NOT NULL DEFAULT '0' AFTER `mailing_new_all_normal`"; $DB->queryOrDie($query, "0.65 add mailing_update_all_normal in config"); } if (!FieldExists("glpi_config","mailing_update_attrib", false)) { $query = "ALTER TABLE `glpi_config` ADD `mailing_update_attrib` tinyint(4) NOT NULL DEFAULT '1' AFTER `mailing_new_attrib`"; $DB->queryOrDie($query, "0.65 add mailing_update_attrib in config"); } if (!FieldExists("glpi_config","mailing_update_user", false)) { $query = "ALTER TABLE `glpi_config` ADD `mailing_update_user` tinyint(4) NOT NULL DEFAULT '1' AFTER `mailing_new_user`"; $DB->queryOrDie($query, "0.65 add mailing_update_user in config"); } if (!FieldExists("glpi_config","ldap_use_tls", false)) { $query = "ALTER TABLE `glpi_config` ADD `ldap_use_tls` VARCHAR( 200 ) NOT NULL DEFAULT '0' AFTER `ldap_login` "; $DB->queryOrDie($query, "0.65 add ldap_use_tls in config"); } if (FieldExists("glpi_config","cut", false)) { // juste pour affichage identique sur toutes les versions. $query = "UPDATE `glpi_config` SET `cut` = '255' WHERE `ID` = 1"; $DB->queryOrDie($query, "0.65 update Cut in config"); } if (!FieldExists("glpi_licenses","comments", false)) { $query = "ALTER TABLE `glpi_licenses` ADD `comments` TEXT NULL "; $DB->queryOrDie($query, "0.65 add comments in licenses"); } ///////////// MODE OCS // Delete plugin table if (TableExists("glpi_ocs_link") && !FieldExists("glpi_ocs_link","import_device", false)) { $query = "DROP TABLE `glpi_ocs_link`"; $DB->queryOrDie($query, "0.65 MODE OCS drop plugin ocs_link"); } if (TableExists("glpi_ocs_config") && !FieldExists("glpi_ocs_config","checksum", false)) { $query = "DROP TABLE `glpi_ocs_config`"; $DB->queryOrDie($query, "0.65 MODE OCS drop plugin ocs_config"); } if (!TableExists("glpi_ocs_link")) { $query = "CREATE TABLE `glpi_ocs_link` ( `ID` int(11) NOT NULL auto_increment, `glpi_id` int(11) NOT NULL default '0', `ocs_id` varchar(255) NOT NULL default '', `auto_update` int(2) NOT NULL default '1', `last_update` datetime NOT NULL default '0000-00-00 00:00:00', `computer_update` LONGTEXT NULL, `import_device` LONGTEXT NULL, `import_software` LONGTEXT NULL, `import_monitor` LONGTEXT NULL, `import_peripheral` LONGTEXT NULL, `import_printers` LONGTEXT NULL, PRIMARY KEY (`ID`), UNIQUE KEY `ocs_id_2` (`ocs_id`), KEY `ocs_id` (`ocs_id`), KEY `glpi_id` (`glpi_id`), KEY `auto_update` (`auto_update`), KEY `last_update` (`last_update`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.65 MODE OCS creation ocs_link"); } if (!TableExists("glpi_ocs_config")) { $query = "CREATE TABLE `glpi_ocs_config` ( `ID` int(11) NOT NULL auto_increment, `ocs_db_user` varchar(255) NOT NULL default '', `ocs_db_passwd` varchar(255) NOT NULL default '', `ocs_db_host` varchar(255) NOT NULL default '', `ocs_db_name` varchar(255) NOT NULL default '', `checksum` int(11) NOT NULL default '0', `import_periph` int(2) NOT NULL default '0', `import_monitor` int(2) NOT NULL default '0', `import_software` int(2) NOT NULL default '0', `import_printer` int(2) NOT NULL default '0', `import_general_os` int(2) NOT NULL default '0', `import_general_serial` int(2) NOT NULL default '0', `import_general_model` int(2) NOT NULL default '0', `import_general_enterprise` int(2) NOT NULL default '0', `import_general_type` int(2) NOT NULL default '0', `import_general_domain` int(2) NOT NULL default '0', `import_general_contact` int(2) NOT NULL default '0', `import_general_comments` int(2) NOT NULL default '0', `import_device_processor` int(2) NOT NULL default '0', `import_device_memory` int(2) NOT NULL default '0', `import_device_hdd` int(2) NOT NULL default '0', `import_device_iface` int(2) NOT NULL default '0', `import_device_gfxcard` int(2) NOT NULL default '0', `import_device_sound` int(2) NOT NULL default '0', `import_device_drives` int(2) NOT NULL default '0', `import_device_ports` int(2) NOT NULL default '0', `import_device_modems` int(2) NOT NULL default '0', `import_ip` int(2) NOT NULL default '0', `default_state` int(11) NOT NULL default '0', `tag_limit` varchar(255) NOT NULL default '', PRIMARY KEY (`ID`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.65 MODE OCS creation ocs_config"); $query = "INSERT INTO `glpi_ocs_config` VALUES (1, 'ocs', 'ocs', 'localhost', 'ocsweb', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '')"; $DB->queryOrDie($query, "0.65 MODE OCS add default config"); } if (!FieldExists("glpi_computers","ocs_import", false)) { $query = "ALTER TABLE `glpi_computers` ADD `ocs_import` TINYINT NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.65 MODE OCS add default config"); } if (!FieldExists("glpi_config","ocs_mode", false)) { $query = "ALTER TABLE `glpi_config` ADD `ocs_mode` TINYINT NOT NULL DEFAULT '0' "; $DB->queryOrDie($query, "0.65 MODE OCS add ocs_mode in config"); } ///////////// FIN MODE OCS if (!TableExists("glpi_dropdown_budget")) { $query = "CREATE TABLE `glpi_dropdown_budget` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`ID`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.65 add dropdown_budget"); } if (!FieldExists("glpi_infocoms","budget", false)) { $query = "ALTER TABLE `glpi_infocoms` ADD `budget` INT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.65 add budget in infocoms"); } if (!FieldExists("glpi_tracking","cost_time", false)) { $query = "ALTER TABLE `glpi_tracking` ADD `cost_time` FLOAT NOT NULL DEFAULT '0', ADD `cost_fixed` FLOAT NOT NULL DEFAULT '0', ADD `cost_material` FLOAT NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.65 add cost fields in tracking"); } // Global Printers if (!FieldExists("glpi_printers","is_global", false)) { $query = "ALTER TABLE `glpi_printers` ADD `is_global` ENUM('0', '1') DEFAULT '0' NOT NULL AFTER `FK_glpi_enterprise`"; $DB->queryOrDie($query, "0.6 add is_global in printers"); } if (!FieldExists("glpi_config","debug", false)) { $query = "ALTER TABLE `glpi_config` ADD `debug` int(2) NOT NULL default '0' "; $DB->queryOrDie($query, "0.65 add debug in config"); } if (!TableExists("glpi_dropdown_os_version")) { $query = "CREATE TABLE `glpi_dropdown_os_version` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', PRIMARY KEY (`ID`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.65 add dropdown_os_version"); } if (!TableExists("glpi_dropdown_os_sp")) { $query = "CREATE TABLE `glpi_dropdown_os_sp` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', PRIMARY KEY (`ID`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.65 add dropdown_os_sp"); } if (!FieldExists("glpi_computers","os_version", false)) { $query = "ALTER TABLE `glpi_computers` ADD `os_version` INT NOT NULL DEFAULT '0' AFTER `os`, ADD `os_sp` INT NOT NULL DEFAULT '0' AFTER `os_version` "; $DB->queryOrDie($query, "0.65 add os_version os_sp in computers"); } // ADD INDEX $tbl = array("cartridges_type", "computers", "consumables_type", "contacts", "contracts", "docs", "enterprises", "monitors", "networking", "peripherals", "printers", "software", "users"); foreach ($tbl as $t) { if (!isIndex("glpi_$t","name")) { $query = "ALTER TABLE `glpi_$t` ADD INDEX (`name`) "; $DB->queryOrDie($query, "0.65 add index in name field $t"); } } $result = $DB->list_tables(); while ($line = $DB->fetch_array($result)) { if (strstr($line[0],"glpi_dropdown") || strstr($line[0],"glpi_type")) { if (!isIndex($line[0],"name")) { $query = "ALTER TABLE `".$line[0]."` ADD INDEX (`name`) "; $DB->queryOrDie($query, "0.65 add index in name field ".$line[0].""); } } } if (!isIndex("glpi_reservation_item","device_type_2")) { $query = "ALTER TABLE `glpi_reservation_item` ADD INDEX `device_type_2` (`device_type`, `id_device`) "; $DB->queryOrDie($query, "0.65 add index in reservation_item ".$line[0].""); } if (!TableExists("glpi_dropdown_model_phones")) { $query = "CREATE TABLE `glpi_dropdown_model_phones` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', PRIMARY KEY (`ID`), KEY `name` (`name`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.65 add dropdown_model_phones"); } if (!TableExists("glpi_type_phones")) { $query = "CREATE TABLE `glpi_type_phones` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', PRIMARY KEY (`ID`), KEY `name` (`name`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.65 add type_phones"); } if (!TableExists("glpi_dropdown_phone_power")) { $query = "CREATE TABLE `glpi_dropdown_phone_power` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', PRIMARY KEY (`ID`), KEY `name` (`name`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.65 add dropdown_phone_power"); } if (!TableExists("glpi_phones")) { $query = "CREATE TABLE `glpi_phones` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) default NULL, `date_mod` datetime NOT NULL default '0000-00-00 00:00:00', `contact` varchar(255) default NULL, `contact_num` varchar(255) default NULL, `tech_num` int(11) NOT NULL default '0', `comments` text, `serial` varchar(255) default NULL, `otherserial` varchar(255) default NULL, `firmware` varchar(255) default NULL, `location` int(11) NOT NULL default '0', `type` int(11) NOT NULL default '0', `model` int(11) default NULL, `brand` varchar(255) default NULL, `power` tinyint(4) NOT NULL default '0', `number_line` varchar(255) NOT NULL default '', `flags_casque` tinyint(4) NOT NULL default '0', `flags_hp` tinyint(4) NOT NULL default '0', `FK_glpi_enterprise` int(11) NOT NULL default '0', `is_global` enum('0','1') NOT NULL default '0', `deleted` enum('Y','N') NOT NULL default 'N', `is_template` enum('0','1') NOT NULL default '0', `tplname` varchar(255) default NULL, `notes` longtext, PRIMARY KEY (`ID`), KEY `type` (`type`), KEY `name` (`name`), KEY `location` (`location`), KEY `FK_glpi_enterprise` (`FK_glpi_enterprise`), KEY `deleted` (`deleted`), KEY `is_template` (`is_template`), KEY `tech_num` (`tech_num`) ) TYPE=MyISAM"; $DB->queryOrDie($query, "0.65 add phones"); $query = "INSERT INTO `glpi_phones` VALUES (1, NULL, '0000-00-00 00:00:00', NULL, NULL, 0, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, 0, '', 0, 0, 0, '0', 'N', '1', 'Blank Template', NULL)"; $DB->queryOrDie($query, "0.65 blank template in phones"); } if (!TableExists("glpi_reminder")) { $query = "CREATE TABLE `glpi_reminder` ( `ID` int(11) NOT NULL auto_increment, `date` datetime default NULL, `author` int(11) NOT NULL default '0', `title` text, `text` text, `type` varchar(50) NOT NULL default 'private', `begin` datetime default NULL, `end` datetime default NULL, `rv` enum('0','1') NOT NULL default '0', `date_mod` datetime default NULL, PRIMARY KEY (`ID`), KEY `date` (`date`), KEY `author` (`author`), KEY `rv` (`rv`), KEY `type` (`type`) ) TYPE=MyISAM "; $DB->queryOrDie($query, "0.65 add reminder"); } $result = $DB->list_tables(); while ($line = $DB->fetch_array($result)) { if (strstr($line[0],"glpi_dropdown") || strstr($line[0],"glpi_type")) { if ($line[0] != "glpi_type_docs") { if (!FieldExists($line[0],"comments", false)) { $query = "ALTER TABLE `".$line[0]."` ADD `comments` TEXT NULL "; $DB->queryOrDie($query, "0.65 add comments field in ".$line[0].""); } } } } if (!FieldExists("glpi_consumables","id_user", false)) { $query = "ALTER TABLE `glpi_consumables` ADD `id_user` INT NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.65 add id_user field in consumables"); } } // fin 0.65 ?> glpi-0.84.3+dfsg.1/install/update_0712_0713.php000066400000000000000000000053461226600447100204150ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /// Update from 0.71.2 to 0.71.3 function update0712to0713() { global $DB, $CFG_GLPI; if (!FieldExists("glpi_rule_cache_software", "ignore_ocs_import", false)) { $query = "ALTER TABLE `glpi_rule_cache_software` ADD `ignore_ocs_import` VARCHAR( 255 ) NULL "; $DB->queryOrDie($query, "0.71.3 add ignore_ocs_import field in dictionnary cache"); } // Update to longtext for fields which may be very long if (FieldExists("glpi_kbitems", "answer", false)) { if (isIndex("glpi_kbitems","fulltext")) { // to avoid pb in altering column answer $query = "ALTER TABLE `glpi_kbitems` DROP INDEX `fulltext`"; $DB->queryOrDie($query, "0.71.3 alter kbitem drop index Fulltext"); } // field question : only to change latin1 to utf-8 if not done in update 0.68.3 to 0.71 // before creating index fulltext based on 2 fields (perhaps both are not in same encoding) $query = "ALTER TABLE `glpi_kbitems` CHANGE `question` `question` TEXT, CHANGE `answer` `answer` LONGTEXT NULL DEFAULT NULL "; $DB->queryOrDie($query, "0.71.3 alter kbitem answer field to longtext"); $query = "ALTER TABLE `glpi_kbitems` ADD FULLTEXT `fulltext` (`question`,`answer`)"; $DB->queryOrDie($query, "0.71.3 alter kbitem re-add index Fulltext"); } if (FieldExists("glpi_tracking", "contents", false)) { $query = "ALTER TABLE `glpi_tracking` CHANGE `contents` `contents` LONGTEXT NULL DEFAULT NULL "; $DB->queryOrDie($query, "0.71.3 alter tracking contents field to longtext"); } } ?> glpi-0.84.3+dfsg.1/install/update_0713_072.php000066400000000000000000001574631226600447100203440ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /// Update from 0.71.2 to 0.72 function update0713to072() { global $DB, $CFG_GLPI; //TRANS: %s is the number of new version echo "

    ".sprintf(__('Update to %s'), '0.72')."

    "; displayMigrationMessage("072"); // Start if (!FieldExists("glpi_networking", "recursive", false)) { $query = "ALTER TABLE `glpi_networking` ADD `recursive` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `FK_entities`"; $DB->queryOrDie($query, "0.72 add recursive in glpi_networking"); } if (!FieldExists("glpi_printers", "recursive", false)) { $query = "ALTER TABLE `glpi_printers` ADD `recursive` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `FK_entities`"; $DB->queryOrDie($query, "0.72 add recursive in glpi_printers"); } if (!FieldExists("glpi_links", "FK_entities", false)) { $query = "ALTER TABLE `glpi_links` ADD `FK_entities` INT( 11 ) NOT NULL DEFAULT '0' AFTER `ID`"; $DB->queryOrDie($query, "0.72 add FK_entities in glpi_links"); } if (!FieldExists("glpi_links", "recursive", false)) { $query = "ALTER TABLE `glpi_links` ADD `recursive` INT( 1 ) NOT NULL DEFAULT '1' AFTER `FK_entities`"; $DB->queryOrDie($query, "0.72 add recursive in glpi_links"); } // Clean datetime fields $date_fields = array('glpi_docs.date_mod', 'glpi_event_log.date', 'glpi_monitors.date_mod', 'glpi_networking.date_mod', 'glpi_ocs_link.last_update', 'glpi_peripherals.date_mod', 'glpi_phones.date_mod', 'glpi_printers.date_mod', 'glpi_reservation_resa.begin', 'glpi_reservation_resa.end', 'glpi_tracking.closedate', 'glpi_tracking_planning.begin', 'glpi_tracking_planning.end', 'glpi_users.last_login', 'glpi_users.date_mod'); foreach ($date_fields as $tablefield) { displayMigrationMessage("072", "Date format (1) ($tablefield)"); list($table,$field) = explode('.', $tablefield); if (FieldExists($table, $field, false)) { $query = "ALTER TABLE `$table` CHANGE `$field` `$field` DATETIME NULL"; $DB->queryOrDie($query, "0.72 alter $field in $table"); } } $date_fields[] = "glpi_computers.date_mod"; $date_fields[] = "glpi_followups.date"; $date_fields[] = "glpi_history.date_mod"; $date_fields[] = "glpi_kbitems.date"; $date_fields[] = "glpi_kbitems.date_mod"; $date_fields[] = "glpi_ocs_config.date_mod"; $date_fields[] = "glpi_ocs_link.last_ocs_update"; $date_fields[] = "glpi_reminder.date"; $date_fields[] = "glpi_reminder.begin"; $date_fields[] = "glpi_reminder.end"; $date_fields[] = "glpi_reminder.date_mod"; $date_fields[] = "glpi_software.date_mod"; $date_fields[] = "glpi_tracking.date"; $date_fields[] = "glpi_tracking.date_mod"; $date_fields[] = "glpi_type_docs.date_mod"; foreach ($date_fields as $tablefield) { displayMigrationMessage("072", "Date format (2) ($tablefield)"); list($table,$field) = explode('.', $tablefield); if (FieldExists($table, $field, false)) { $query = "UPDATE `$table` SET `$field` = NULL WHERE `$field` = '0000-00-00 00:00:00'"; $DB->queryOrDie($query, "0.72 update data of $field in $table"); } } // Clean date fields $date_fields = array('glpi_infocoms.buy_date', 'glpi_infocoms.use_date'); foreach ($date_fields as $tablefield) { list($table,$field) = explode('.', $tablefield); if (FieldExists($table, $field, false)) { $query = "ALTER TABLE `$table` CHANGE `$field` `$field` DATE NULL"; $DB->queryOrDie($query, "0.72 alter $field in $table"); } } $date_fields[] = "glpi_cartridges.date_in"; $date_fields[] = "glpi_cartridges.date_use"; $date_fields[] = "glpi_cartridges.date_out"; $date_fields[] = "glpi_consumables.date_in"; $date_fields[] = "glpi_consumables.date_out"; $date_fields[] = "glpi_contracts.begin_date"; $date_fields[] = "glpi_licenses.expire"; foreach ($date_fields as $tablefield) { list($table,$field) = explode('.', $tablefield); if (FieldExists($table, $field, false)) { $query = "UPDATE `$table` SET `$field` = NULL WHERE `$field` = '0000-00-00'"; $DB->queryOrDie($query, "0.72 update data of $field in $table"); } } // Software Updates displayMigrationMessage("072", _n('Software', 'Software', 2)); // Make software recursive if (!FieldExists("glpi_software", "recursive", false)) { $query = "ALTER TABLE `glpi_software` ADD `recursive` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `FK_entities`"; $DB->queryOrDie($query, "0.72 add recursive in glpi_software"); } if (!FieldExists("glpi_inst_software", "vID", false)) { $query = "ALTER TABLE `glpi_inst_software` CHANGE `license` `vID` INT( 11 ) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.72 alter inst_software rename license to vID"); } if (TableExists("glpi_softwarelicenses")) { if (TableExists("glpi_softwarelicenses_backup")) { $query = "DROP TABLE `glpi_softwarelicenses_backup`"; $DB->queryOrDie($query, "0.72 drop backup table glpi_softwarelicenses_backup"); } $query = "RENAME TABLE `glpi_softwarelicenses` TO `glpi_softwarelicenses_backup`"; $DB->queryOrDie($query, "0.72 backup table glpi_softwareversions"); echo "

    glpi_softwarelicenses table already exists. A backup have been done to glpi_softwarelicenses_backup.

    You can delete it if you have no need of it.

    "; } // Create licenses if (!TableExists("glpi_softwarelicenses")) { $query = "CREATE TABLE `glpi_softwarelicenses` ( `ID` int(11) NOT NULL auto_increment, `sID` int(11) NOT NULL default '0', `FK_entities` int(11) NOT NULL default '0', `recursive` tinyint(1) NOT NULL DEFAULT '0', `number` int(11) NOT NULL default '0', `type` int(11) NOT NULL default '0', `name` varchar(255) NULL default NULL, `serial` varchar(255) NULL default NULL, `otherserial` varchar(255) NULL default NULL, `buy_version` int(11) NOT NULL default '0', `use_version` int(11) NOT NULL default '0', `expire` date default NULL, `FK_computers` int(11) NOT NULL default '0', `comments` text, PRIMARY KEY (`ID`), KEY `name` (`name`), KEY `type` (`type`), KEY `sID` (`sID`), KEY `FK_entities` (`FK_entities`), KEY `buy_version` (`buy_version`), KEY `use_version` (`use_version`), KEY `FK_computers` (`FK_computers`), KEY `serial` (`serial`), KEY `otherserial` (`otherserial`), KEY `expire` (`expire`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.72 create glpi_softwarelicenses"); } if (TableExists("glpi_softwareversions")) { if (TableExists("glpi_softwareversions_backup")) { $query = "DROP TABLE `glpi_softwareversions_backup`"; $DB->queryOrDie($query, "0.72 drop backup table glpi_softwareversions_backup"); } $query = "RENAME TABLE `glpi_softwareversions` TO `glpi_softwareversions_backup`"; $DB->queryOrDie($query, "0.72 backup table glpi_softwareversions"); echo "

    glpi_softwareversions table already exists. A backup have been done to glpi_softwareversions_backup.

    You can delete it if you have no need of it.

    "; } if (!TableExists("glpi_softwareversions")) { $query = "CREATE TABLE `glpi_softwareversions` ( `ID` int(11) NOT NULL auto_increment, `sID` int(11) NOT NULL default '0', `state` int(11) NOT NULL default '0', `name` varchar(255) NULL default NULL, `comments` text, PRIMARY KEY (`ID`), KEY `sID` (`sID`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.72 create glpi_softwareversions"); } if (TableExists("glpi_licenses")) { // Update Infocoms to device_type 9999 $query = "UPDATE `glpi_infocoms` SET `device_type` = '9999' WHERE `device_type` = '".SOFTWARELICENSE_TYPE."'"; $DB->queryOrDie($query, "0.72 prepare infocoms for update softwares"); // Foreach software $query_softs = "SELECT * FROM `glpi_software` ORDER BY `FK_entities`"; if ($result_softs = $DB->query($query_softs)) { $nbsoft = $DB->numrows($result_softs); $step = round($nbsoft/100); if (!$step) { $step = 1; } if ($step > 500) { $step = 500; } for ($numsoft=0 ; $soft=$DB->fetch_assoc($result_softs) ; $numsoft++) { // To avoid navigator timeout on by DB if (!($numsoft % $step)) { displayMigrationMessage("072 ", "Licenses : $numsoft / $nbsoft"); } // oldstate present if migration run more than once if (isset($soft["oldstate"])) { $soft["state"] = $soft["oldstate"]; } // Foreach lics $query_versions = "SELECT `glpi_licenses`.*, `glpi_infocoms`.`ID` AS infocomID FROM `glpi_licenses` LEFT JOIN `glpi_infocoms` ON (`glpi_infocoms`.`device_type` = '9999' AND `glpi_infocoms`.`FK_device` = `glpi_licenses`.`ID`) WHERE `sID` = '".$soft['ID']."' ORDER BY `ID`"; if ($result_vers = $DB->query($query_versions)) { if ($DB->numrows($result_vers)>0) { while ($vers = $DB->fetch_assoc($result_vers)) { $install_count = 0; $vers_ID = $vers['ID']; // init : count installations $query_count = "SELECT COUNT(*) FROM `glpi_inst_software` WHERE `vID` = '".$vers['ID']."'"; if ($result_count=$DB->query($query_count)) { $install_count = $DB->result($result_count,0,0); $DB->free_result($result_count); } // 1 - Is version already exists ? $query_search_version = "SELECT * FROM `glpi_softwareversions` WHERE `sID` = '".$soft['ID']."' AND `name` = '".$vers['version']."'"; if ($result_searchvers = $DB->query($query_search_version)) { // Version already exists : update inst_software if ($DB->numrows($result_searchvers)==1) { $found_vers = $DB->fetch_assoc($result_searchvers); $vers_ID = $found_vers['ID']; $query = "UPDATE `glpi_inst_software` SET `vID` = '".$found_vers['ID']."' WHERE `vID` = '".$vers['ID']."'"; $DB->query($query); } else { // Re Create new entry $query = "INSERT INTO `glpi_softwareversions` SELECT `ID`, `sID`, '".$soft["state"]."', `version`,'' FROM `glpi_licenses` WHERE `ID` = '".$vers_ID."'"; $DB->query($query); // Transfert History for this version $findstr = " (v. ".$vers['version'].")"; // Log event format in 0.71 $findlen = Toolbox::strlen($findstr); $DB->query("UPDATE `glpi_history` SET `FK_glpi_device` = '".$vers_ID."', `device_type` = '". SOFTWAREVERSION_TYPE."' WHERE `FK_glpi_device` = '".$soft['ID']."' AND `device_type` = '". SOFTWARE_TYPE."' AND ((`linked_action` = '".Log::HISTORY_INSTALL_SOFTWARE."' AND RIGHT(new_value, $findlen) = '$findstr') OR (`linked_action` = '".Log::HISTORY_UNINSTALL_SOFTWARE."' AND RIGHT(old_value, $findlen) = '$findstr'))"); } $DB->free_result($result_searchvers); } // 2 - Create glpi_licenses if ($vers['buy'] // Buy license || (!empty($vers['serial']) && !in_array($vers['serial'], array('free','global'))) // Non global / free serial || !empty($vers['comments']) // With comments || !empty($vers['expire']) // with an expire date || $vers['oem_computer'] > 0 // oem license || !empty($vers['infocomID'])) { // with and infocoms $found_lic = -1; // No infocoms try to find already exists license if (empty($vers['infocomID'])) { $query_search_lic = "SELECT `ID` FROM `glpi_softwarelicenses` WHERE `buy_version` = '$vers_ID' AND `serial` = '".$vers['serial']."' AND `FK_computers` = '".$vers['oem_computer']."' AND `comments` = '".$vers['comments']."'"; if (empty($vers['expire'])) { $query .= " AND `expire` IS NULL"; } else { $query .= " AND `expire` = '".$vers['expire']."'"; } if ($result_searchlic = $DB->query($query_search_lic)) { if ($DB->numrows($result_searchlic)>0) { $found_lic = $DB->result($result_searchlic,0,0); $DB->free_result($result_searchlic); } } } if ($install_count == 0) { $install_count = 1; // license exists so count 1 } // Found license : merge with found one if ($found_lic > 0) { $query = "UPDATE `glpi_softwarelicenses` SET `number` = `number`+1 WHERE `ID` = '$found_lic'"; $DB->query($query); } else { // Create new license if (empty($vers['expire'])) { $vers['expire'] = 'NULL'; } else { $vers['expire'] = "'".$vers['expire']."'"; } $query = "INSERT INTO `glpi_softwarelicenses` (`sID` ,`FK_entities`, `number` ,`type` ,`name` , `serial` ,`buy_version`, `use_version`, `expire`, `FK_computers` , `comments`) VALUES ('".$soft['ID']."', '".$soft["FK_entities"]."', $install_count, 0, '".$vers['serial']."', '".addslashes($vers['serial'])."' , '$vers_ID', '$vers_ID', ".$vers['expire'].", '".$vers['oem_computer']."', '".addslashes($vers['comments'])."')"; if ($DB->query($query)) { $lic_ID = $DB->insert_id(); // Update infocoms link if (!empty($vers['infocomID'])) { $query = "UPDATE `glpi_infocoms` SET `device_type` = '".SOFTWARELICENSE_TYPE."', `FK_device` = '$lic_ID' WHERE `device_type` = '9999' AND `FK_device` = '".$vers['ID']."'"; $DB->query($query); } } } // Create licence } // Buy licence } // Each license } // while $DB->free_result($result_vers); } // Clean History for this software (old versions no more installed) $DB->query("DELETE FROM `glpi_history` WHERE `FK_glpi_device` = '".$soft['ID']."' AND `device_type` = '". SOFTWARE_TYPE."' AND (`linked_action` = '".Log::HISTORY_INSTALL_SOFTWARE."' OR `linked_action` = '".Log::HISTORY_UNINSTALL_SOFTWARE."')"); } // For } // Each Software $query = "DROP TABLE `glpi_licenses`"; $DB->queryOrDie($query, "0.72 drop table glpi_licenses"); // Drop alerts on licenses : 2 = Alert::END $query = "DELETE FROM `glpi_alerts` WHERE `glpi_alerts`.`device_type` = '".SOFTWARELICENSE_TYPE."' AND `glpi_alerts`.`type` = '2'"; $DB->queryOrDie($query, "0.72 clean alerts for licenses infocoms"); } // TableExists("glpi_licenses") // Change software search pref $query = "SELECT DISTINCT `FK_users` FROM `glpi_display` WHERE `type` = '".SOFTWARE_TYPE."'"; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { while ($data = $DB->fetch_assoc($result)) { $query = "SELECT max(`rank`) FROM `glpi_display` WHERE `FK_users` = '".$data['FK_users']."' AND `type` = '".SOFTWARE_TYPE."'"; $result = $DB->query($query); $rank = $DB->result($result,0,0); $rank++; $query = "SELECT * FROM `glpi_display` WHERE `FK_users` = '".$data['FK_users']."' AND `num` = '72' AND `type` = '".SOFTWARE_TYPE."'"; if ($result2=$DB->query($query)) { if ($DB->numrows($result2)==0) { $query = "INSERT INTO `glpi_display` (`type` ,`num` ,`rank` , `FK_users`) VALUES ('".SOFTWARE_TYPE."', '72', '".$rank++."', '".$data['FK_users']."')"; $DB->query($query); } } $query = "SELECT * FROM `glpi_display` WHERE `FK_users` = '".$data['FK_users']."' AND `num` = '163' AND `type` = '".SOFTWARE_TYPE."'"; if ($result2=$DB->query($query)) { if ($DB->numrows($result2) == 0) { $query = "INSERT INTO `glpi_display` (`type` ,`num` ,`rank` , `FK_users`) VALUES ('".SOFTWARE_TYPE."', '163', '".$rank++."', '".$data['FK_users']."');"; $DB->query($query); } } } } } displayMigrationMessage("072", _n('Software', 'Software', 2)); // If migration run more than once if (!FieldExists("glpi_softwareversions", "state", false)) { $query = "ALTER TABLE `glpi_softwareversions` ADD `state` INT NOT NULL DEFAULT '0' AFTER `sID`"; $DB->queryOrDie($query, "0.72 add state to softwareversion table"); } // To allow migration to be run more than once if (FieldExists("glpi_software", "state", false)) { $query = "ALTER TABLE `glpi_software` CHANGE `state` `oldstate` INT( 11 ) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.72 change state to to oldtsate in softwareversion table"); } if (!TableExists("glpi_dropdown_licensetypes")) { $query = "CREATE TABLE `glpi_dropdown_licensetypes` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NULL default NULL, `comments` text, PRIMARY KEY (`ID`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.72 create glpi_dropdown_licensetypes table"); $input["tablename"] = "glpi_dropdown_licensetypes"; $input["value"] = "OEM"; $input['type'] = "first"; $input["comment"] = ""; $input["entities_id"] = -1; $query = "INSERT INTO `glpi_dropdown_licensetypes` (`name`) VALUES ('OEM')"; if ($result = $DB->query($query)) { $oemtype = $DB->insert_id(); $query = "UPDATE `glpi_softwarelicenses` SET `type` = '$oemtype' WHERE `FK_computers` > '0'"; $DB->queryOrDie($query, "0.72 affect OEM as licensetype"); } } displayMigrationMessage("072", _n('User', 'Users', 2)); if (!FieldExists("glpi_groups", "recursive", false)) { $query = "ALTER TABLE `glpi_groups` ADD `recursive` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `FK_entities`"; $DB->queryOrDie($query, "0.72 add recursive in glpi_groups"); } if (!FieldExists("glpi_auth_ldap", "ldap_field_title", false)) { $query = "ALTER TABLE `glpi_auth_ldap` ADD `ldap_field_title` VARCHAR( 255 ) DEFAULT NULL "; $DB->queryOrDie($query, "0.72 add ldap_field_title in glpi_auth_ldap"); } //Add user title retrieval from LDAP if (!TableExists("glpi_dropdown_user_titles")) { $query = "CREATE TABLE `glpi_dropdown_user_titles` ( `ID` int( 11 ) NOT NULL AUTO_INCREMENT , `name` varchar( 255 ) NULL default NULL , `comments` text , PRIMARY KEY ( `ID` ) , KEY `name` (`name`) ) ENGINE = MYISAM DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci"; $DB->queryOrDie($query, "0.72 create glpi_dropdown_user_titles table"); } if (!FieldExists("glpi_users", "title", false)) { $query = "ALTER TABLE `glpi_users` ADD `title` INT( 11 ) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.72 add title in glpi_users"); } if (!isIndex("glpi_users", "title")) { $query = " ALTER TABLE `glpi_users` ADD INDEX `title` (`title`)"; $DB->queryOrDie($query, "0.72 add index on title in glpi_users"); } if (!FieldExists("glpi_auth_ldap", "ldap_field_type", false)) { $query = "ALTER TABLE `glpi_auth_ldap` ADD `ldap_field_type` VARCHAR( 255 ) DEFAULT NULL"; $DB->queryOrDie($query, "0.72 add ldap_field_title in glpi_auth_ldap"); } //Add user type retrieval from LDAP if (!TableExists("glpi_dropdown_user_types")) { $query = "CREATE TABLE `glpi_dropdown_user_types` ( `ID` int( 11 ) NOT NULL AUTO_INCREMENT, `name` varchar( 255 ) NULL default NULL, `comments` text, PRIMARY KEY (`ID`), KEY `name` (`name`) ) ENGINE = MYISAM DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci"; $DB->queryOrDie($query, "0.72 create glpi_dropdown_user_types table"); } if (!FieldExists("glpi_users", "type", false)) { $query = "ALTER TABLE `glpi_users` ADD `type` INT( 11 ) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.72 add type in glpi_users"); } if (!isIndex("glpi_users", "type")) { $query = " ALTER TABLE `glpi_users` ADD INDEX `type` (`type`)"; $DB->queryOrDie($query, "0.72 add index on type in glpi_users"); } if (!isIndex("glpi_users", "active")) { $query = " ALTER TABLE `glpi_users` ADD INDEX `active` (`active`)"; $DB->queryOrDie($query, "0.72 add index on active in glpi_users"); } if (!FieldExists("glpi_auth_ldap", "ldap_field_language", false)) { $query = "ALTER TABLE `glpi_auth_ldap` ADD `ldap_field_language` VARCHAR( 255 ) NULL DEFAULT NULL "; $DB->queryOrDie($query, "0.72 add ldap_field_language in glpi_auth_ldap"); } if (!FieldExists("glpi_ocs_config", "tag_exclude", false)) { $query = "ALTER TABLE `glpi_ocs_config` ADD `tag_exclude` VARCHAR( 255 ) NULL AFTER `tag_limit`"; $DB->queryOrDie($query, "0.72 add tag_exclude in glpi_ocs_config"); } if (!FieldExists("glpi_config", "cache_max_size", false)) { $query = "ALTER TABLE `glpi_config` ADD `cache_max_size` INT( 11 ) NOT NULL DEFAULT '20' AFTER `use_cache`"; $DB->queryOrDie($query, "0.72 add cache_max_size in glpi_config"); } displayMigrationMessage("072", _n('Volume', 'Volumes', 2)); if (!TableExists("glpi_dropdown_filesystems")) { $query = "CREATE TABLE `glpi_dropdown_filesystems` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) NULL default NULL, `comments` text , PRIMARY KEY (`ID`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.72 create glpi_dropdown_filesystems table"); $fstype = array('ext', 'ext2', 'ext3', 'ext4', 'FAT', 'FAT32', 'VFAT', 'HFS', 'HPFS', 'HTFS', 'JFS', 'JFS2', 'NFS', 'NTFS', 'ReiserFS', 'SMBFS', 'UDF', 'UFS', 'XFS', 'ZFS'); foreach ($fstype as $fs) { $query = "INSERT INTO `glpi_dropdown_filesystems` (`name`) VALUES ('$fs')"; $DB->queryOrDie($query, "0.72 add filesystems type"); } } if (!TableExists("glpi_computerdisks")) { $query = "CREATE TABLE `glpi_computerdisks` ( `ID` int(11) NOT NULL auto_increment, `FK_computers` int(11) NOT NULL default 0, `name` varchar(255) NULL default NULL, `device` varchar(255) NULL default NULL, `mountpoint` varchar(255) NULL default NULL, `FK_filesystems` int(11) NOT NULL default 0, `totalsize` int(11) NOT NULL default 0, `freesize` int(11) NOT NULL default 0, PRIMARY KEY (`ID`), KEY `name` (`name`), KEY `FK_filesystems` (`FK_filesystems`), KEY `FK_computers` (`FK_computers`), KEY `device` (`device`), KEY `mountpoint` (`mountpoint`), KEY `totalsize` (`totalsize`), KEY `freesize` (`freesize`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.72 create glpi_computerfilesystems table"); } if (!FieldExists("glpi_ocs_config", "import_disk", false)) { $query = "ALTER TABLE `glpi_ocs_config` ADD `import_disk` INT( 2 ) NOT NULL DEFAULT '0' AFTER `import_ip`"; $DB->queryOrDie($query, "0.72 add import_disk in glpi_ocs_config"); } if (!FieldExists("glpi_ocs_link", "import_disk", false)) { $query = "ALTER TABLE `glpi_ocs_link` ADD `import_disk` LONGTEXT NULL AFTER `import_device`"; $DB->queryOrDie($query, "0.72 add import_device in glpi_ocs_link"); } // Clean software ocs if (FieldExists("glpi_ocs_config", "import_software_buy", false)) { $query = " ALTER TABLE `glpi_ocs_config` DROP `import_software_buy`"; $DB->queryOrDie($query, "0.72 drop import_software_buy in glpi_ocs_config"); } if (FieldExists("glpi_ocs_config", "import_software_licensetype", false)) { $query = " ALTER TABLE `glpi_ocs_config` DROP `import_software_licensetype`"; $DB->queryOrDie($query, "0.72 drop import_software_licensetype in glpi_ocs_config"); } //// Clean interface use for GFX card // Insert default values update_importDropdown("glpi_dropdown_interface", "AGP"); update_importDropdown("glpi_dropdown_interface", "PCI"); update_importDropdown("glpi_dropdown_interface", "PCIe"); update_importDropdown("glpi_dropdown_interface", "PCI-X"); if (!FieldExists("glpi_device_gfxcard", "FK_interface", false)) { $query = "ALTER TABLE `glpi_device_gfxcard` ADD `FK_interface` INT NOT NULL DEFAULT '0' AFTER `interface` "; $DB->queryOrDie($query, "0.72 alter glpi_device_gfxcard add new field interface"); // Get all data from interface_old / Insert in glpi_dropdown_interface if needed $query = "SELECT DISTINCT `interface` AS OLDNAME FROM `glpi_device_gfxcard`"; if ($result=$DB->query($query)) { if ($DB->numrows($result)>0) { while ($data=$DB->fetch_assoc($result)) { $data = Toolbox::addslashes_deep($data); // Update datas if ($newID=update_importDropdown("glpi_dropdown_interface", $data['OLDNAME'])) { $query2 = "UPDATE `glpi_device_gfxcard` SET `FK_interface` = '$newID' WHERE `interface` = '".$data['OLDNAME']."'"; $DB->queryOrDie($query2, "0.72 update glpi_device_gfxcard set new interface value"); } } } } $query = "ALTER TABLE `glpi_device_gfxcard` DROP `interface` "; $DB->queryOrDie($query, "0.72 alter $table drop tmp enum field"); } if (!FieldExists("glpi_config","existing_auth_server_field_clean_domain", false)) { $query = "ALTER TABLE `glpi_config` ADD `existing_auth_server_field_clean_domain` SMALLINT NOT NULL DEFAULT '0' AFTER `existing_auth_server_field`"; $DB->queryOrDie($query, "0.72 alter config add existing_auth_server_field_clean_domain"); } if (FieldExists("glpi_profiles","contract_infocom", false)) { $query = "ALTER TABLE `glpi_profiles` CHANGE `contract_infocom` `contract` CHAR( 1 ) NULL DEFAULT NULL "; $DB->queryOrDie($query, "0.72 alter profiles rename contract_infocom to contract"); $query = "ALTER TABLE `glpi_profiles` ADD `infocom` CHAR( 1 ) NULL DEFAULT NULL AFTER `contract`"; $DB->queryOrDie($query, "0.72 alter profiles create infocom"); $query = "UPDATE `glpi_profiles` SET `infocom` = `contract`"; $DB->queryOrDie($query, "0.72 update data for infocom in profiles"); } // Debug mode in user pref to allow debug in production environment if (FieldExists("glpi_config","debug", false)) { $query = "ALTER TABLE `glpi_config` DROP `debug`"; $DB->queryOrDie($query, "0.72 drop debug mode in config"); } if (!FieldExists("glpi_users","use_mode", false)) { $query = "ALTER TABLE `glpi_users` ADD `use_mode` SMALLINT NOT NULL DEFAULT '0' AFTER `language`"; $DB->queryOrDie($query, "0.72 create use_mode in glpi_users"); } // Default bookmark as default view if (!TableExists("glpi_display_default")) { $query = "CREATE TABLE IF NOT EXISTS `glpi_display_default` ( `ID` int(11) NOT NULL auto_increment, `FK_users` int(11) NOT NULL, `device_type` int(11) NOT NULL, `FK_bookmark` int(11) NOT NULL, PRIMARY KEY (`ID`), UNIQUE KEY `FK_users` (`FK_users`,`device_type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.72 create table glpi_display_default"); } // Correct cost contract data type if (FieldExists("glpi_contracts","cost", false)) { $query=" ALTER TABLE `glpi_contracts` CHANGE `cost` `cost` DECIMAL( 20, 4 ) NOT NULL DEFAULT '0.0000'"; $DB->queryOrDie($query, "0.72 alter contract cost data type"); } // Plugins table if (!TableExists("glpi_plugins")) { $query = "CREATE TABLE IF NOT EXISTS `glpi_plugins` ( `ID` int(11) NOT NULL auto_increment, `directory` varchar(255) NOT NULL, `name` varchar(255) NOT NULL, `version` varchar(255) NOT NULL, `state` tinyint(4) NOT NULL default '0', `author` varchar(255) NULL default NULL, `homepage` varchar(255) NULL default NULL, PRIMARY KEY (`ID`), UNIQUE KEY `name` (`directory`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.72 create table glpi_plugins"); } //// CORRECT glpi_config field type if (FieldExists("glpi_config","num_of_events", false)) { $query = "ALTER TABLE `glpi_config` CHANGE `num_of_events` `num_of_events` INT( 11 ) NOT NULL DEFAULT '10'"; $DB->queryOrDie($query, "0.72 alter config num_of_events"); } if (FieldExists("glpi_config","jobs_at_login", false)) { $query = "ALTER TABLE `glpi_config` CHANGE `jobs_at_login` `jobs_at_login` SMALLINT( 6 ) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.72 alter config jobs_at_login"); } if (FieldExists("glpi_config","cut", false)) { $query = "UPDATE `glpi_config` SET `cut` = ROUND(`cut`/50)*50"; $DB->queryOrDie($query, "0.72 update config cut value to prepare update"); $query = "ALTER TABLE `glpi_config` CHANGE `cut` `cut` INT( 11 ) NOT NULL DEFAULT '255'"; $DB->queryOrDie($query, "0.72 alter config cut"); } if (FieldExists("glpi_config","list_limit", false)) { $query = "ALTER TABLE `glpi_config` CHANGE `list_limit` `list_limit` INT( 11 ) NOT NULL DEFAULT '20'"; $DB->queryOrDie($query, "0.72 alter config list_limit"); } if (FieldExists("glpi_config","expire_events", false)) { $query = "ALTER TABLE `glpi_config` CHANGE `expire_events` `expire_events` INT( 11 ) NOT NULL DEFAULT '30'"; $DB->queryOrDie($query, "0.72 alter config expire_events"); } if (FieldExists("glpi_config","event_loglevel", false)) { $query = "ALTER TABLE `glpi_config` CHANGE `event_loglevel` `event_loglevel` SMALLINT( 6 ) NOT NULL DEFAULT '5'"; $DB->queryOrDie($query, "0.72 alter config event_loglevel"); } if (FieldExists("glpi_config","permit_helpdesk", false)) { $query = "UPDATE `glpi_config` SET `permit_helpdesk` = '0' WHERE `permit_helpdesk` = ''"; $DB->queryOrDie($query, "0.72 update config permit_helpdesk value to prepare update"); $query = "ALTER TABLE `glpi_config` CHANGE `permit_helpdesk` `permit_helpdesk` SMALLINT NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.72 alter config permit_helpdesk"); } if (!FieldExists("glpi_config","language", false)) { $query = "ALTER TABLE `glpi_config` CHANGE `default_language` `language` VARCHAR( 255 ) NULL DEFAULT 'en_GB'"; $DB->queryOrDie($query, "0.72 alter config default_language"); } if (!FieldExists("glpi_config","tracking_order", false)) { $query = "ALTER TABLE `glpi_config` ADD `tracking_order` SMALLINT NOT NULL default '0'"; $DB->queryOrDie($query, "0.72 alter config add tracking_order"); } if (!FieldExists("glpi_users","dateformat", false)) { $query = "ALTER TABLE `glpi_users` ADD `dateformat` SMALLINT NULL DEFAULT NULL"; $DB->queryOrDie($query, "0.72 add dateformat in users"); } if (FieldExists("glpi_users","list_limit", false)) { $query = "ALTER TABLE `glpi_users` CHANGE `list_limit` `list_limit` INT( 11 ) NULL DEFAULT NULL"; $DB->queryOrDie($query, "0.72 alter list_limit in users"); } if (FieldExists("glpi_users","tracking_order", false)) { $query = "ALTER TABLE `glpi_users` CHANGE `tracking_order` `tracking_order` SMALLINT( 6 ) NULL DEFAULT NULL"; $DB->queryOrDie($query, "0.72 alter tracking_order in users"); } if (!FieldExists("glpi_users","numberformat", false)) { $query = "ALTER TABLE `glpi_users` ADD `numberformat` SMALLINT NULL DEFAULT NULL"; $DB->queryOrDie($query, "0.72 add numberformat in users"); } if (!FieldExists("glpi_users","view_ID", false)) { $query = "ALTER TABLE `glpi_users` ADD `view_ID` SMALLINT NULL DEFAULT NULL"; $DB->queryOrDie($query, "0.72 add view_ID in users"); } if (!FieldExists("glpi_users","dropdown_limit", false)) { $query = "ALTER TABLE `glpi_users` ADD `dropdown_limit` INT NULL DEFAULT NULL"; $DB->queryOrDie($query, "0.72 add dropdown_limit in users"); } if (!FieldExists("glpi_users","flat_dropdowntree", false)) { $query = "ALTER TABLE `glpi_users` ADD `flat_dropdowntree` SMALLINT NULL DEFAULT NULL"; $DB->queryOrDie($query, "0.72 add flat_dropdowntree in users"); } if (!FieldExists("glpi_users","num_of_events", false)) { $query = "ALTER TABLE `glpi_users` ADD `num_of_events` INT NULL DEFAULT NULL"; $DB->queryOrDie($query, "0.72 add num_of_events in users"); } if (!FieldExists("glpi_users","nextprev_item", false)) { $query = "ALTER TABLE `glpi_users` ADD `nextprev_item` VARCHAR( 255 ) NULL DEFAULT NULL"; $DB->queryOrDie($query, "0.72 add nextprev_item in users"); } if (!FieldExists("glpi_users","jobs_at_login", false)) { $query = "ALTER TABLE `glpi_users` ADD `jobs_at_login` SMALLINT NULL DEFAULT NULL"; $DB->queryOrDie($query, "0.72 add jobs_at_login in users"); } if (!FieldExists("glpi_users","priority_1", false)) { $query = "ALTER TABLE `glpi_users` ADD `priority_1` VARCHAR( 255 ) NULL DEFAULT NULL, ADD `priority_2` VARCHAR( 255 ) NULL DEFAULT NULL, ADD `priority_3` VARCHAR( 255 ) NULL DEFAULT NULL, ADD `priority_4` VARCHAR( 255 ) NULL DEFAULT NULL, ADD `priority_5` VARCHAR( 255 ) NULL DEFAULT NULL"; $DB->queryOrDie($query, "0.72 add priority_X in users"); } if (!FieldExists("glpi_users","expand_soft_categorized", false)) { $query = "ALTER TABLE `glpi_users` ADD `expand_soft_categorized` INT( 1 ) NULL DEFAULT NULL"; $DB->queryOrDie($query, "0.72 add expand_soft_categorized in users"); } if (!FieldExists("glpi_users","expand_soft_not_categorized", false)) { $query = "ALTER TABLE `glpi_users` ADD `expand_soft_not_categorized` INT( 1 ) NULL DEFAULT NULL"; $DB->queryOrDie($query, "0.72 add expand_soft_not_categorized in users"); } if (!FieldExists("glpi_users","followup_private", false)) { $query = "ALTER TABLE `glpi_users` ADD `followup_private` SMALLINT NULL DEFAULT NULL"; $DB->queryOrDie($query, "0.72 add followup_private in users"); } if (!FieldExists("glpi_config","followup_private", false)) { $query = "ALTER TABLE `glpi_config` ADD `followup_private` SMALLINT NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.72 add followup_private in config"); } // INDEX key order change if (isIndex("glpi_contract_device", "FK_contract")) { $query = "ALTER TABLE `glpi_contract_device` DROP INDEX `FK_contract`"; $DB->queryOrDie($query, "0.72 drop index FK_contract on glpi_contract_device"); } if (!isIndex("glpi_contract_device", "FK_contract_device")) { $query = "ALTER TABLE `glpi_contract_device` ADD UNIQUE INDEX `FK_contract_device` (`FK_contract` , `device_type`, `FK_device` )"; $DB->queryOrDie($query, "0.72 add index FK_contract_device in glpi_contract_device"); } if (isIndex("glpi_doc_device", "FK_doc")) { $query = "ALTER TABLE `glpi_doc_device` DROP INDEX `FK_doc`"; $DB->queryOrDie($query, "0.72 drop index FK_doc on glpi_doc_device"); } if (!isIndex("glpi_doc_device", "FK_doc_device")) { $query = "ALTER TABLE `glpi_doc_device` ADD UNIQUE INDEX `FK_doc_device` (`FK_doc` , `device_type`, `FK_device` )"; $DB->queryOrDie($query, "0.72 add index FK_doc_device in glpi_doc_device"); } //(AD) DistinguishedName criteria is wrong. DN in AD is not distinguishedName but DN. $query = "SELECT `ID` FROM `glpi_rules_ldap_parameters` WHERE `value` = 'distinguishedname'"; $result = $DB->query($query); //If (AD) DistinguishedName criteria is still present if ($DB->numrows($result) == 1) { $query = "SELECT COUNT(`ID`) AS cpt FROM `glpi_rules_criterias` WHERE `criteria` = 'distinguishedname'"; $result = $DB->query($query); if ($DB->result($result,0,"cpt") > 0) { echo "
    "; echo "LDAP Criteria (AD)Distinguishedname must be removed.
    ". "As it is used in one or more LDAP rules, you need to remove it manually
    "; echo "

    "; } else { //Delete If (AD) DistinguishedName criteria $query = "DELETE FROM `glpi_rules_ldap_parameters` WHERE `value` = 'distinguishedname'"; $result = $DB->query($query); } } //// Clean DB if (isIndex("glpi_alerts", "item") && isIndex("glpi_alerts", "alert")) { $query = "ALTER TABLE `glpi_alerts` DROP INDEX `item`"; $DB->queryOrDie($query, "0.72 drop item index on glpi_alerts"); } if (isIndex("glpi_alerts", "device_type") && isIndex("glpi_alerts", "alert")) { $query = "ALTER TABLE `glpi_alerts` DROP INDEX `device_type`"; $DB->queryOrDie($query, "0.72 drop device_type index on glpi_alerts"); } if (isIndex("glpi_cartridges_assoc", "FK_glpi_type_printer_2") && isIndex("glpi_cartridges_assoc", "FK_glpi_type_printer")) { $query = "ALTER TABLE `glpi_cartridges_assoc` DROP INDEX `FK_glpi_type_printer_2`"; $DB->queryOrDie($query, "0.72 drop FK_glpi_type_printer_2 index on glpi_cartridges_assoc"); } if (isIndex("glpi_computer_device", "device_type") && isIndex("glpi_computer_device", "device_type_2")) { $query = "ALTER TABLE `glpi_computer_device` DROP INDEX `device_type`"; $DB->queryOrDie($query, "0.72 drop device_type index on glpi_computer_device"); $query = "ALTER TABLE `glpi_computer_device` DROP INDEX `device_type_2`, ADD INDEX `device_type` (`device_type` , `FK_device`) "; $DB->queryOrDie($query, "0.72 rename device_type_2 index on glpi_computer_device"); } if (isIndex("glpi_connect_wire", "end1") && isIndex("glpi_connect_wire", "end1_1")) { $query = "ALTER TABLE `glpi_connect_wire` DROP INDEX `end1`"; $DB->queryOrDie($query, "0.72 drop end1 index on glpi_connect_wire"); $query = "ALTER TABLE `glpi_connect_wire` DROP INDEX `end1_1`, ADD UNIQUE `connect` (`end1` , `end2` , `type`)"; $DB->queryOrDie($query, "0.72 rename end1_1 index on glpi_connect_wire"); } if (isIndex("glpi_contract_enterprise", "FK_enterprise") && isIndex("glpi_contract_enterprise", "FK_enterprise_2")) { $query = "ALTER TABLE `glpi_contract_enterprise` DROP INDEX `FK_enterprise_2`"; $DB->queryOrDie($query, "0.72 drop FK_enterprise_2 index on glpi_contract_enterprise"); } if (isIndex("glpi_contact_enterprise", "FK_enterprise") && isIndex("glpi_contact_enterprise", "FK_enterprise_2")) { $query = "ALTER TABLE `glpi_contact_enterprise` DROP INDEX `FK_enterprise_2`"; $DB->queryOrDie($query, "0.72 drop FK_enterprise_2 index on glpi_contact_enterprise"); } if (isIndex("glpi_contract_device", "FK_contract_2") && isIndex("glpi_contract_device", "FK_contract_device")) { $query = "ALTER TABLE `glpi_contract_device` DROP INDEX `FK_contract_2`"; $DB->queryOrDie($query, "0.72 drop FK_contract_2 index on glpi_contract_device"); } if (isIndex("glpi_display", "type") && isIndex("glpi_display", "type_2")) { $query = "ALTER TABLE `glpi_display` DROP INDEX `type`"; $DB->queryOrDie($query, "0.72 drop type index on glpi_display"); $query = "ALTER TABLE `glpi_display` DROP INDEX `type_2`, ADD UNIQUE `display` (`type` , `num` , `FK_users`)"; $DB->queryOrDie($query, "0.72 rename type_2 index on glpi_display"); } if (isIndex("glpi_doc_device", "FK_doc_2") && isIndex("glpi_doc_device", "FK_doc_device")) { $query = "ALTER TABLE `glpi_doc_device` DROP INDEX `FK_doc_2`"; $DB->queryOrDie($query, "0.72 drop FK_doc_2 index on glpi_doc_device"); } if (isIndex("glpi_links_device", "device_type") && isIndex("glpi_links_device", "device_type_2")) { $query = "ALTER TABLE `glpi_links_device` DROP INDEX `device_type`"; $DB->queryOrDie($query, "0.72 drop device_type index on glpi_links_device"); $query = "ALTER TABLE `glpi_links_device` DROP INDEX `device_type_2`, ADD UNIQUE `link` (`device_type` , `FK_links`)"; $DB->queryOrDie($query, "0.72 rename device_type_2 index on glpi_links_device"); } if (isIndex("glpi_mailing", "item_type") && isIndex("glpi_mailing", "items")) { $query = "ALTER TABLE `glpi_mailing` DROP INDEX `item_type`"; $DB->queryOrDie($query, "0.72 drop item_type index on glpi_mailing"); } if (isIndex("glpi_mailing", "type") && isIndex("glpi_mailing", "mailings")) { $query = "ALTER TABLE `glpi_mailing` DROP INDEX `type`"; $DB->queryOrDie($query, "0.72 drop type index on glpi_mailing"); } if (isIndex("glpi_networking_ports", "on_device_2") && isIndex("glpi_networking_ports", "on_device")) { $query = "ALTER TABLE `glpi_networking_ports` DROP INDEX `on_device_2`"; $DB->queryOrDie($query, "0.72 drop on_device_2 index on glpi_networking_ports"); } if (isIndex("glpi_networking_vlan", "FK_port") && isIndex("glpi_networking_vlan", "FK_port_2")) { $query = "ALTER TABLE `glpi_networking_vlan` DROP INDEX `FK_port`"; $DB->queryOrDie($query, "0.72 drop FK_port index on glpi_networking_vlan"); $query = "ALTER TABLE `glpi_networking_vlan` DROP INDEX `FK_port_2`, ADD UNIQUE `portvlan` (`FK_port`, `FK_vlan`)"; $DB->queryOrDie($query, "0.72 rename FK_port_2 index on glpi_networking_vlan"); } if (isIndex("glpi_networking_wire", "end1") && isIndex("glpi_networking_wire", "end1_1")) { $query = "ALTER TABLE `glpi_networking_wire` DROP INDEX `end1`"; $DB->queryOrDie($query, "0.72 drop end1 index on glpi_networking_wire"); $query = "ALTER TABLE `glpi_networking_wire` DROP INDEX `end1_1`, ADD UNIQUE `netwire` (`end1`, `end2`)"; $DB->queryOrDie($query, "0.72 rename end1_1 index on glpi_networking_wire"); } if (isIndex("glpi_reservation_item", "device_type") && isIndex("glpi_reservation_item", "device_type_2")) { $query = "ALTER TABLE `glpi_reservation_item` DROP INDEX `device_type`"; $DB->queryOrDie($query, "0.72 drop device_type index on glpi_reservation_item"); $query = "ALTER TABLE `glpi_reservation_item` DROP INDEX `device_type_2`, ADD INDEX `reservationitem` (`device_type`, `id_device`)"; $DB->queryOrDie($query, "0.72 rename device_type_2 index on glpi_reservation_item"); } if (isIndex("glpi_users_groups", "FK_users") && isIndex("glpi_users_groups", "FK_users_2")) { $query = "ALTER TABLE `glpi_users_groups` DROP INDEX `FK_users_2`"; $DB->queryOrDie($query, "0.72 drop FK_users_2 index on glpi_users_groups"); $query = "ALTER TABLE `glpi_users_groups` DROP INDEX `FK_users`, ADD UNIQUE `usergroup` (`FK_users`, `FK_groups`)"; $DB->queryOrDie($query, "0.72 rename FK_users index on glpi_users_groups"); } if (!FieldExists("glpi_config","software_helpdesk_visible", false)) { $query = " ALTER TABLE `glpi_config` ADD `software_helpdesk_visible` INT(1) NOT NULL DEFAULT '1'"; $DB->queryOrDie($query, "0.72 add software_helpdesk_visible in config"); } if (!FieldExists("glpi_entities_data","ldap_dn", false)) { $query = "ALTER TABLE `glpi_entities_data` ADD `ldap_dn` VARCHAR( 255 ) NULL"; $DB->queryOrDie($query, "0.72 add ldap_dn in config"); } if (!FieldExists("glpi_entities_data","tag", false)) { $query = "ALTER TABLE `glpi_entities_data` ADD `tag` VARCHAR( 255 ) NULL"; $DB->queryOrDie($query, "0.72 add tag in config"); } if (FieldExists("glpi_rules_ldap_parameters","rule_type", false)) { $query = "ALTER TABLE `glpi_rules_ldap_parameters` CHANGE `rule_type` `sub_type` SMALLINT( 6 ) NOT NULL DEFAULT '1'"; $DB->queryOrDie($query, "0.72 rename rule_type to sub_type in glpi_rules_ldap_parameters"); } if (FieldExists("glpi_rules_descriptions","rule_type", false)) { $query = "ALTER TABLE `glpi_rules_descriptions` CHANGE `rule_type` `sub_type` SMALLINT( 4 ) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.72 rename rule_type to sub_type in glpi_rules_descriptions"); } //Add title criteria $result = $DB->query("SELECT COUNT(*) AS cpt FROM `glpi_rules_ldap_parameters` WHERE `value` = 'title' AND `sub_type` = '1'"); if (!$DB->result($result,0,"cpt")) { $DB->query("INSERT INTO `glpi_rules_ldap_parameters` (`ID` ,`name` ,`value` ,`sub_type`) VALUES (NULL , '(LDAP) Title', 'title', '1')"); } // Duplicate index with PRIMARY if (isIndex("glpi_monitors", "ID")) { $query = "ALTER TABLE `glpi_monitors` DROP INDEX `ID`"; $DB->queryOrDie($query, "0.72 drop ID index on glpi_monitors"); } if (FieldExists("glpi_ocs_config","is_template", false)) { $query = "DELETE FROM `glpi_ocs_config` WHERE `is_template` = '1'"; $DB->queryOrDie($query, "0.72 delete templates in glpi_ocs_config"); $query = "ALTER TABLE `glpi_ocs_config` DROP `is_template`"; $DB->queryOrDie($query, "0.72 drop is_template in glpi_ocs_config"); } if (FieldExists("glpi_ocs_config","tplname", false)) { $query = "ALTER TABLE `glpi_ocs_config` DROP `tplname`"; $DB->queryOrDie($query, "0.72 drop tplname in glpi_ocs_config"); } if (FieldExists("glpi_ocs_config","date_mod", false)) { $query = "ALTER TABLE `glpi_ocs_config` DROP `date_mod`"; $DB->queryOrDie($query, "0.72 drop date_mod in glpi_ocs_config"); } if (FieldExists("glpi_ocs_config","glpi_link_enabled", false)) { $query = "ALTER TABLE `glpi_ocs_config` CHANGE `glpi_link_enabled` `glpi_link_enabled` INT(1) NOT NULL DEFAULT '0' "; $DB->queryOrDie($query, "0.72 alter glpi_link_enabled in glpi_ocs_config"); } if (FieldExists("glpi_ocs_config","link_ip", false)) { $query = "ALTER TABLE `glpi_ocs_config` CHANGE `link_ip` `link_ip` INT( 1 ) NOT NULL DEFAULT '0' "; $DB->queryOrDie($query, "0.72 alter link_ip in glpi_ocs_config"); } if (FieldExists("glpi_ocs_config","link_name", false)) { $query = "ALTER TABLE `glpi_ocs_config` CHANGE `link_name` `link_name` INT (1) NOT NULL DEFAULT '0' "; $DB->queryOrDie($query, "0.72 alter link_name in glpi_ocs_config"); } if (FieldExists("glpi_ocs_config","link_mac_address", false)) { $query = "ALTER TABLE `glpi_ocs_config` CHANGE `link_mac_address` `link_mac_address` INT( 1 ) NOT NULL DEFAULT '0' "; $DB->queryOrDie($query, "0.72 alter link_mac_address in glpi_ocs_config"); } if (FieldExists("glpi_ocs_config","link_serial", false)) { $query = "ALTER TABLE `glpi_ocs_config` CHANGE `link_serial` `link_serial` INT( 1 ) NOT NULL DEFAULT '0' "; $DB->queryOrDie($query, "0.72 alter link_serial in glpi_ocs_config"); } if (!FieldExists("glpi_config","name_display_order", false)) { $query = "ALTER TABLE `glpi_config` ADD `name_display_order` TINYINT NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.72 add name_display_order in glpi_config"); } // Display "Work ended." message - Keep this as the last action. displayMigrationMessage("072"); // End } // fin 0.72 ##################################################################################### ?> glpi-0.84.3+dfsg.1/install/update_071_0712.php000066400000000000000000000032431226600447100203240ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /// Update from 0.71 to 0.71.2 function update071to0712() { global $DB, $CFG_GLPI; $query = "UPDATE `glpi_display` SET `num` = 120 WHERE `num` = 121"; $DB->queryOrDie($query, "0.71.2 Update display index in view item"); $query = "UPDATE `glpi_rules_actions` SET `field` = '_ignore_ocs_import' WHERE `action_type` = 'ignore'"; $DB->queryOrDie($query, "0.71.2 Update ignore field for soft dict"); } // fin 0.71 ##################################################################################### ?> glpi-0.84.3+dfsg.1/install/update_0721_0722.php000066400000000000000000000150111226600447100204030ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /// Update from 0.72.1 to 0.72.2 function update0721to0722() { global $DB, $CFG_GLPI; //TRANS: %s is the number of new version echo "

    ".sprintf(__('Update to %s'), '0.72.2')."

    "; displayMigrationMessage("0722"); // Start // Delete state from reservation search $query = "DELETE FROM `glpi_display` WHERE `type` = ".RESERVATION_TYPE." AND `num` = 31"; $DB->queryOrDie($query, "0.72.2 delete search of state from reservations"); // Clean licences alerts $query = "DELETE FROM `glpi_alerts` WHERE `device_type` = '".SOFTWARELICENSE_TYPE."'"; $DB->queryOrDie($query, "0.72.2 delete search of state from reservations"); //// Correct search.constant numbers $updates = array(); // location : $updates[] = array('type' => CARTRIDGEITEM_TYPE, 'from' => 3, 'to' => 34); $updates[] = array('type' => CARTRIDGEITEM_TYPE, 'from' => 6, 'to' => 3); $updates[] = array('type' => CONSUMABLEITEM_TYPE, 'from' => 3, 'to' => 34); $updates[] = array('type' => CONSUMABLEITEM_TYPE, 'from' => 6, 'to' => 3); $updates[] = array('type' => USER_TYPE, 'from' => 3, 'to' => 34); $updates[] = array('type' => USER_TYPE, 'from' => 7, 'to' => 3); // serial / otherserial $updates[] = array('type' => COMPUTER_TYPE, 'from' => 40, 'to' => 46); $updates[] = array('type' => COMPUTER_TYPE, 'from' => 5, 'to' => 40); $updates[] = array('type' => COMPUTER_TYPE, 'from' => 8, 'to' => 5); $updates[] = array('type' => COMPUTER_TYPE, 'from' => 6, 'to' => 45); $updates[] = array('type' => COMPUTER_TYPE, 'from' => 9, 'to' => 6); $updates[] = array('type' => STATE_TYPE, 'from' => 9, 'to' => 6); $updates[] = array('type' => STATE_TYPE, 'from' => 8, 'to' => 5); // Manufacturer $updates[] = array('type' => CONSUMABLEITEM_TYPE, 'from' => 5, 'to' => 23); $updates[] = array('type' => CARTRIDGEITEM_TYPE, 'from' => 5, 'to' => 23); // tech_num $updates[] = array('type' => CONSUMABLEITEM_TYPE, 'from' => 7, 'to' => 24); $updates[] = array('type' => CARTRIDGEITEM_TYPE, 'from' => 7, 'to' => 24); // date_mod $updates[] = array('type' => NETWORKING_TYPE, 'from' => 9, 'to' => 19); $updates[] = array('type' => PRINTER_TYPE, 'from' => 9, 'to' => 19); $updates[] = array('type' => MONITOR_TYPE, 'from' => 9, 'to' => 19); $updates[] = array('type' => PERIPHERAL_TYPE, 'from' => 9, 'to' => 19); $updates[] = array('type' => SOFTWARE_TYPE, 'from' => 9, 'to' => 19); $updates[] = array('type' => PHONE_TYPE, 'from' => 9, 'to' => 19); // comments $updates[] = array('type' => NETWORKING_TYPE, 'from' => 10, 'to' => 16); $updates[] = array('type' => PRINTER_TYPE, 'from' => 10, 'to' => 16); $updates[] = array('type' => MONITOR_TYPE, 'from' => 10, 'to' => 16); $updates[] = array('type' => PERIPHERAL_TYPE, 'from' => 10, 'to' => 16); $updates[] = array('type' => SOFTWARE_TYPE, 'from' => 6, 'to' => 16); $updates[] = array('type' => CONTACT_TYPE, 'from' => 7, 'to' => 16); $updates[] = array('type' => ENTERPRISE_TYPE, 'from' => 7, 'to' => 16); $updates[] = array('type' => CARTRIDGEITEM_TYPE, 'from' => 10, 'to' => 16); $updates[] = array('type' => DOCUMENT_TYPE, 'from' => 6, 'to' => 16); $updates[] = array('type' => USER_TYPE, 'from' => 12, 'to' => 16); $updates[] = array('type' => PHONE_TYPE, 'from' => 10, 'to' => 16); foreach ($updates as $data) { $query = "UPDATE `glpi_display` SET `num` = ".$data['to']." WHERE `num` = ".$data['from']." AND `type` = '".$data['type']."'"; $DB->queryOrDie($query, "0.72.2 reorder search.constant"); } // Display "Work ended." message - Keep this as the last action. displayMigrationMessage("0722"); // End } // fin 0.72.2 ?> glpi-0.84.3+dfsg.1/install/update_0722_0723.php000066400000000000000000000116511226600447100204130ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /// Update from 0.72.2 to 0.72.3 function update0722to0723() { global $DB, $CFG_GLPI; //TRANS: %s is the number of new version echo "

    ".sprintf(__('Update to %s'), '0.72.3')."

    "; displayMigrationMessage("0723"); // Start //// Correct search.constant numbers : problem in previous update $updates = array(); // serial / otherserial $updates[] = array('type' => STATE_TYPE, 'from' => 9, 'to' => 6); $updates[] = array('type' => STATE_TYPE, 'from' => 8, 'to' => 5); foreach ($updates as $data) { $query = "UPDATE `glpi_display` SET `num` = ".$data['to']." WHERE `num` = ".$data['from']." AND `type` = '".$data['type']."'"; $DB->queryOrDie($query, "0.72.3 reorder search.constant"); } $LINK_ID_TABLE = array(1 => "glpi_computers", 2 => "glpi_networking", 3 => "glpi_printers", 4 => "glpi_monitors", 5 => "glpi_peripherals", 6 => "glpi_software", 7 => "glpi_contacts", 8 => "glpi_enterprises", 9 => "glpi_infocoms", 10 => "glpi_contracts", 11 => "glpi_cartridges_type", 12 => "glpi_type_docs", 13 => "glpi_docs", 14 => "glpi_kbitems", 15 => "glpi_users", 16 => "glpi_tracking", 17 => "glpi_consumables_type", 18 => "glpi_consumables", 19 => "glpi_cartridges", 20 => "glpi_softwarelicenses", 21 => "glpi_links", 23 => "glpi_phones", 25 => "glpi_reminder", 27 => "glpi_groups", 28 => "glpi_entities", 29 => "glpi_reservation_item", 32 => "glpi_ocs_config", 33 => "glpi_registry", 34 => "glpi_profiles", 35 => "glpi_mailgate", 36 => "glpi_rules_descriptions", 37 => "glpi_transfers", 39 => "glpi_softwareversions", 41 => "glpi_computerdisks", 42 => "glpi_networking_ports", 43 => "glpi_followups"); $query = "SELECT DISTINCT `device_type` FROM `glpi_doc_device`"; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { while ($data = $DB->fetch_assoc($result)) { if (isset($LINK_ID_TABLE[$data['device_type']])) { $table = $LINK_ID_TABLE[$data['device_type']]; $query2 = "DELETE FROM `glpi_doc_device` WHERE `device_type` = ".$data['device_type']." AND `FK_device` NOT IN (SELECT `ID` FROM `$table`)"; $DB->queryOrDie($query2, "0.72.3 clean doc_device table"); } } } } if (FieldExists("glpi_auth_ldap", "ldap_group_condition", false)) { $query = "ALTER TABLE `glpi_auth_ldap` CHANGE `ldap_group_condition` `ldap_group_condition` TEXT NULL DEFAULT NULL"; $DB->queryOrDie($query, "0.72.3 alter ldap_group_condition in glpi_auth_ldap"); } // Display "Work ended." message - Keep this as the last action. displayMigrationMessage("0723"); // End } // fin 0.72.3 ?> glpi-0.84.3+dfsg.1/install/update_0723_078.php000066400000000000000000011373621226600447100203500ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /** * Update from 0.72.3 to 0.78 * * @return bool for success (will die for most error) **/ function update0723to078() { global $DB, $migration; $updateresult = true; //TRANS: %s is the number of new version $migration->displayTitle(sprintf(__('Update to %s'), '0.78')); $migration->setVersion('0.78'); //TRANS: %s is 'Clean DB : rename tables' $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'Clean DB : rename tables')); $changes = array(); $glpi_tables = array('glpi_alerts' => 'glpi_alerts', 'glpi_auth_ldap' => 'glpi_authldaps', 'glpi_auth_ldap_replicate' => 'glpi_authldapreplicates', 'glpi_auth_mail' => 'glpi_authmails', 'glpi_dropdown_auto_update' => 'glpi_autoupdatesystems', 'glpi_bookmark' => 'glpi_bookmarks', 'glpi_display_default' => 'glpi_bookmarks_users', 'glpi_dropdown_budget' => 'glpi_budgets', 'glpi_cartridges' => 'glpi_cartridges', 'glpi_cartridges_type' => 'glpi_cartridgeitems', 'glpi_cartridges_assoc' => 'glpi_cartridges_printermodels', 'glpi_dropdown_cartridge_type' => 'glpi_cartridgeitemtypes', 'glpi_computers' => 'glpi_computers', 'glpi_computerdisks' => 'glpi_computerdisks', 'glpi_dropdown_model' => 'glpi_computermodels', 'glpi_type_computers' => 'glpi_computertypes', 'glpi_connect_wire' => 'glpi_computers_items', 'glpi_inst_software' => 'glpi_computers_softwareversions', 'glpi_config' => 'glpi_configs', 'glpi_consumables' => 'glpi_consumables', 'glpi_consumables_type' => 'glpi_consumableitems', 'glpi_dropdown_consumable_type' => 'glpi_consumableitemtypes', 'glpi_contact_enterprise' => 'glpi_contacts_suppliers', 'glpi_contacts' => 'glpi_contacts', 'glpi_dropdown_contact_type' => 'glpi_contacttypes', 'glpi_contracts' => 'glpi_contracts', 'glpi_dropdown_contract_type' => 'glpi_contracttypes', 'glpi_contract_device' => 'glpi_contracts_items', 'glpi_contract_enterprise' => 'glpi_contracts_suppliers', 'glpi_device_case' => 'glpi_devicecases', 'glpi_dropdown_case_type' => 'glpi_devicecasetypes', 'glpi_device_control' => 'glpi_devicecontrols', 'glpi_device_drive' => 'glpi_devicedrives', 'glpi_device_gfxcard' => 'glpi_devicegraphiccards', 'glpi_device_hdd' => 'glpi_deviceharddrives', 'glpi_device_iface' => 'glpi_devicenetworkcards', 'glpi_device_moboard' => 'glpi_devicemotherboards', 'glpi_device_pci' => 'glpi_devicepcis', 'glpi_device_power' => 'glpi_devicepowersupplies', 'glpi_device_processor' => 'glpi_deviceprocessors', 'glpi_device_ram' => 'glpi_devicememories', 'glpi_dropdown_ram_type' => 'glpi_devicememorytypes', 'glpi_device_sndcard' => 'glpi_devicesoundcards', 'glpi_display' => 'glpi_displaypreferences', 'glpi_docs' => 'glpi_documents', 'glpi_dropdown_rubdocs' => 'glpi_documentcategories', 'glpi_type_docs' => 'glpi_documenttypes', 'glpi_doc_device' => 'glpi_documents_items', 'glpi_dropdown_domain' => 'glpi_domains', 'glpi_entities' => 'glpi_entities', 'glpi_entities_data' => 'glpi_entitydatas', 'glpi_event_log' => 'glpi_events', 'glpi_dropdown_filesystems' => 'glpi_filesystems', 'glpi_groups' => 'glpi_groups', 'glpi_users_groups' => 'glpi_groups_users', 'glpi_infocoms' => 'glpi_infocoms', 'glpi_dropdown_interface' => 'glpi_interfacetypes', 'glpi_kbitems' => 'glpi_knowbaseitems', 'glpi_dropdown_kbcategories' => 'glpi_knowbaseitemcategories', 'glpi_links' => 'glpi_links', 'glpi_links_device' => 'glpi_links_itemtypes', 'glpi_dropdown_locations' => 'glpi_locations', 'glpi_history' => 'glpi_logs', 'glpi_mailgate' => 'glpi_mailcollectors', 'glpi_mailing' => 'glpi_mailingsettings', 'glpi_dropdown_manufacturer' => 'glpi_manufacturers', 'glpi_monitors' => 'glpi_monitors', 'glpi_dropdown_model_monitors' => 'glpi_monitormodels', 'glpi_type_monitors' => 'glpi_monitortypes', 'glpi_dropdown_netpoint' => 'glpi_netpoints', 'glpi_networking' => 'glpi_networkequipments', 'glpi_dropdown_firmware' => 'glpi_networkequipmentfirmwares', 'glpi_dropdown_model_networking' => 'glpi_networkequipmentmodels', 'glpi_type_networking' => 'glpi_networkequipmenttypes', 'glpi_dropdown_iface' => 'glpi_networkinterfaces', 'glpi_networking_ports' => 'glpi_networkports', 'glpi_networking_vlan' => 'glpi_networkports_vlans', 'glpi_networking_wire' => 'glpi_networkports_networkports', 'glpi_dropdown_network' => 'glpi_networks', 'glpi_ocs_admin_link' => 'glpi_ocsadmininfoslinks', 'glpi_ocs_link' => 'glpi_ocslinks', 'glpi_ocs_config' => 'glpi_ocsservers', 'glpi_dropdown_os' => 'glpi_operatingsystems', 'glpi_dropdown_os_sp' => 'glpi_operatingsystemservicepacks', 'glpi_dropdown_os_version' => 'glpi_operatingsystemversions', 'glpi_peripherals' => 'glpi_peripherals', 'glpi_dropdown_model_peripherals' => 'glpi_peripheralmodels', 'glpi_type_peripherals' => 'glpi_peripheraltypes', 'glpi_phones' => 'glpi_phones', 'glpi_dropdown_model_phones' => 'glpi_phonemodels', 'glpi_dropdown_phone_power' => 'glpi_phonepowersupplies', 'glpi_type_phones' => 'glpi_phonetypes', 'glpi_plugins' => 'glpi_plugins', 'glpi_printers' => 'glpi_printers', 'glpi_dropdown_model_printers' => 'glpi_printermodels', 'glpi_type_printers' => 'glpi_printertypes', 'glpi_profiles' => 'glpi_profiles', 'glpi_users_profiles' => 'glpi_profiles_users', 'glpi_registry' => 'glpi_registrykeys', 'glpi_reminder' => 'glpi_reminders', 'glpi_reservation_resa' => 'glpi_reservations', 'glpi_reservation_item' => 'glpi_reservationitems', 'glpi_rules_descriptions' => 'glpi_rules', 'glpi_rules_actions' => 'glpi_ruleactions', 'glpi_rule_cache_model_computer' => 'glpi_rulecachecomputermodels', 'glpi_rule_cache_type_computer' => 'glpi_rulecachecomputertypes', 'glpi_rule_cache_manufacturer' => 'glpi_rulecachemanufacturers', 'glpi_rule_cache_model_monitor' => 'glpi_rulecachemonitormodels', 'glpi_rule_cache_type_monitor' => 'glpi_rulecachemonitortypes', 'glpi_rule_cache_model_networking' => 'glpi_rulecachenetworkequipmentmodels', 'glpi_rule_cache_type_networking' => 'glpi_rulecachenetworkequipmenttypes', 'glpi_rule_cache_os' => 'glpi_rulecacheoperatingsystems', 'glpi_rule_cache_os_sp' => 'glpi_rulecacheoperatingsystemservicepacks', 'glpi_rule_cache_os_version' => 'glpi_rulecacheoperatingsystemversions', 'glpi_rule_cache_model_peripheral' => 'glpi_rulecacheperipheralmodels', 'glpi_rule_cache_type_peripheral' => 'glpi_rulecacheperipheraltypes', 'glpi_rule_cache_model_phone' => 'glpi_rulecachephonemodels', 'glpi_rule_cache_type_phone' => 'glpi_rulecachephonetypes', 'glpi_rule_cache_model_printer' => 'glpi_rulecacheprintermodels', 'glpi_rule_cache_type_printer' => 'glpi_rulecacheprintertypes', 'glpi_rule_cache_software' => 'glpi_rulecachesoftwares', 'glpi_rules_criterias' => 'glpi_rulecriterias', 'glpi_rules_ldap_parameters' => 'glpi_rulerightparameters', 'glpi_software' => 'glpi_softwares', 'glpi_dropdown_software_category' => 'glpi_softwarecategories', 'glpi_softwarelicenses' => 'glpi_softwarelicenses', 'glpi_dropdown_licensetypes' => 'glpi_softwarelicensetypes', 'glpi_softwareversions' => 'glpi_softwareversions', 'glpi_dropdown_state' => 'glpi_states', 'glpi_enterprises' => 'glpi_suppliers', 'glpi_dropdown_enttype' => 'glpi_suppliertypes', 'glpi_tracking' => 'glpi_tickets', 'glpi_dropdown_tracking_category' => 'glpi_ticketcategories', 'glpi_followups' => 'glpi_ticketfollowups', 'glpi_tracking_planning' => 'glpi_ticketplannings', 'glpi_transfers' => 'glpi_transfers', 'glpi_users' => 'glpi_users', 'glpi_dropdown_user_titles' => 'glpi_usertitles', 'glpi_dropdown_user_types' => 'glpi_usercategories', 'glpi_dropdown_vlan' => 'glpi_vlans'); $backup_tables = false; foreach ($glpi_tables as $original_table => $new_table) { if (strcmp($original_table,$new_table)!=0) { // Original table exists ? if (TableExists($original_table)) { // rename new tables if exists ? if (TableExists($new_table)) { if (TableExists("backup_$new_table")) { $query = "DROP TABLE `backup_".$new_table."`"; $DB->queryOrDie($query, "0.78 drop backup table backup_$new_table"); } $migration->displayWarning("$new_table table already exists. ". "A backup have been done to backup_$new_table."); $backup_tables=true; $query = "RENAME TABLE `$new_table` TO `backup_$new_table`"; $DB->queryOrDie($query, "0.78 backup table $new_table"); } // rename original table $query = "RENAME TABLE `$original_table` TO `$new_table`"; $DB->queryOrDie($query, "0.78 rename $original_table to $new_table"); } } if (FieldExists($new_table,'ID', false)) { // ALTER ID -> id $changes[$new_table][] = "CHANGE `ID` `id` INT( 11 ) NOT NULL AUTO_INCREMENT"; } } if ($backup_tables) { $migration->displayWarning("You can delete backup tables if you have no need of them.", true); } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'Clean DB: rename foreign keys')); $foreignkeys = array('assign' => array(array('to' => 'users_id_assign', 'tables' => array('glpi_tickets'))), 'assign_group' => array(array('to' => 'groups_id_assign', 'tables' => array('glpi_tickets'))), 'assign_ent' => array(array('to' => 'suppliers_id_assign', 'tables' => array('glpi_tickets'))), 'auth_method' => array(array('to' => 'authtype', 'noindex' => array('glpi_users'), 'tables' => array('glpi_users'))), 'author' => array(array('to' => 'users_id', 'tables' => array('glpi_ticketfollowups', 'glpi_knowbaseitems', 'glpi_tickets'))), 'auto_update' => array(array('to' => 'autoupdatesystems_id', 'tables' => array('glpi_computers'))), 'budget' => array(array('to' => 'budgets_id', 'tables' => array('glpi_infocoms'))), 'buy_version' => array(array('to' => 'softwareversions_id_buy', 'tables' => array('glpi_softwarelicenses'))), 'category' => array(array('to' => 'ticketcategories_id', 'tables' => array('glpi_tickets')), array('to' => 'softwarecategories_id', 'tables' => array('glpi_softwares'))), 'categoryID' => array(array('to' => 'knowbaseitemcategories_id', 'tables' => array('glpi_knowbaseitems'))), 'category_on_software_delete' => array(array('to' => 'softwarecategories_id_ondelete', 'noindex' => array('glpi_configs'), 'tables' => array('glpi_configs'), 'comments' => array('glpi_configs' =>'category applyed when a software is deleted'))), 'cID' => array(array('to' => 'computers_id', 'tables' => array('glpi_computers_softwareversions'))), 'computer' => array(array('to' => 'items_id', 'noindex' => array('glpi_tickets'), 'tables' => array('glpi_tickets'))), 'computer_id' => array(array('to' => 'computers_id', 'tables' => array('glpi_registrykeys'))), 'contract_type' => array(array('to' => 'contracttypes_id', 'tables' => array('glpi_contracts'))), 'default_rubdoc_tracking' => array(array('to' => 'documentcategories_id_forticket', 'noindex' => array('glpi_configs'), 'tables' => array('glpi_configs'), 'comments' => array('glpi_configs' =>'default category for documents added with a ticket'))), 'default_state' => array(array('to' => 'states_id_default', 'noindex' => array('glpi_ocsservers'), 'tables' => array('glpi_ocsservers'))), 'device_type' => array(array('to' => 'itemtype', 'noindex' => array('glpi_alerts', 'glpi_contracts_items', 'glpi_bookmarks_users', 'glpi_documents_items', 'glpi_infocoms', 'glpi_links_itemtypes', 'glpi_networkports', 'glpi_reservationitems', 'glpi_tickets'), 'tables' => array('glpi_alerts', 'glpi_contracts_items', 'glpi_documents_items', 'glpi_infocoms', 'glpi_bookmarks', 'glpi_bookmarks_users', 'glpi_links_itemtypes', 'glpi_networkports', 'glpi_reservationitems', 'glpi_tickets'))), 'domain' => array(array('to' => 'domains_id', 'tables' => array('glpi_computers', 'glpi_networkequipments', 'glpi_printers'))), 'end1' => array(array('to' => 'items_id', 'noindex' => array('glpi_computers_items'), 'tables' => array('glpi_computers_items'), 'comments' => array('glpi_computers_items' =>'RELATION to various table, according to itemtype (ID)')), array('to' => 'networkports_id_1', 'noindex' => array('glpi_networkports_networkports'), 'tables' => array('glpi_networkports_networkports'))), 'end2' => array(array('to' => 'computers_id', 'tables' => array('glpi_computers_items')), array('to' => 'networkports_id_2', 'tables' => array('glpi_networkports_networkports'))), 'extra_ldap_server' => array(array('to' => 'authldaps_id_extra', 'noindex' => array('glpi_configs'), 'tables' => array('glpi_configs'), 'comments' => array('glpi_configs'=>'extra server'))), 'firmware' => array(array('to' => 'networkequipmentfirmwares_id', 'tables' => array('glpi_networkequipments'))), 'FK_bookmark' => array(array('to' => 'bookmarks_id', 'tables' => array('glpi_bookmarks_users'))), 'FK_computers' => array(array('to' => 'computers_id', 'tables' => array('glpi_computerdisks', 'glpi_softwarelicenses'))), 'FK_contact' => array(array('to' => 'contacts_id', 'tables' => array('glpi_contacts_suppliers'))), 'FK_contract' => array(array('to' => 'contracts_id', 'noindex' => array('glpi_contracts_items'), 'tables' => array('glpi_contracts_suppliers', 'glpi_contracts_items'))), 'FK_device' => array(array('to' => 'items_id', 'noindex' => array('glpi_alerts', 'glpi_contracts_items', 'glpi_documents_items', 'glpi_infocoms'), 'tables' => array('glpi_alerts', 'glpi_contracts_items', 'glpi_documents_items', 'glpi_infocoms'))), 'FK_doc' => array(array('to' => 'documents_id', 'noindex' => array('glpi_documents_items'), 'tables' => array('glpi_documents_items'))), 'FK_enterprise' => array(array('to' => 'suppliers_id', 'noindex' => array('glpi_contacts_suppliers', 'glpi_contracts_suppliers'), 'tables' => array('glpi_contacts_suppliers', 'glpi_contracts_suppliers', 'glpi_infocoms'))), 'FK_entities' => array(array('to' => 'entities_id', 'noindex' => array('glpi_locations', 'glpi_netpoints', 'glpi_entitydatas',), 'tables' => array('glpi_bookmarks', 'glpi_cartridgeitems', 'glpi_computers', 'glpi_consumableitems', 'glpi_contacts', 'glpi_contracts', 'glpi_documents', 'glpi_locations', 'glpi_netpoints', 'glpi_suppliers', 'glpi_entitydatas', 'glpi_groups', 'glpi_knowbaseitems', 'glpi_links', 'glpi_mailcollectors', 'glpi_monitors', 'glpi_networkequipments', 'glpi_peripherals', 'glpi_phones' ,'glpi_printers', 'glpi_reminders', 'glpi_rules', 'glpi_softwares', 'glpi_softwarelicenses', 'glpi_tickets', 'glpi_users', 'glpi_profiles_users'), 'default' => array('glpi_bookmarks' => "-1"))), 'FK_filesystems' => array(array('to' => 'filesystems_id', 'tables' => array('glpi_computerdisks'))), 'FK_glpi_cartridges_type' => array(array('to' => 'cartridgeitems_id', 'tables' => array('glpi_cartridges', 'glpi_cartridges_printermodels'))), 'FK_glpi_consumables_type' => array(array('to' => 'consumableitems_id', 'noindex' => array(''), 'tables' => array('glpi_consumables'))), 'FK_glpi_dropdown_model_printers' => array(array('to' => 'printermodels_id', 'noindex' => array('glpi_cartridges_printermodels'), 'tables' => array('glpi_cartridges_printermodels'))), 'FK_glpi_enterprise' => array(array('to' => 'manufacturers_id', 'tables' => array('glpi_cartridgeitems', 'glpi_computers', 'glpi_consumableitems', 'glpi_devicecases', 'glpi_devicecontrols', 'glpi_devicedrives', 'glpi_devicegraphiccards', 'glpi_deviceharddrives', 'glpi_devicenetworkcards', 'glpi_devicemotherboards', 'glpi_devicepcis', 'glpi_devicepowersupplies', 'glpi_deviceprocessors', 'glpi_devicememories', 'glpi_devicesoundcards', 'glpi_monitors', 'glpi_networkequipments', 'glpi_peripherals', 'glpi_phones', 'glpi_printers', 'glpi_softwares'))), 'FK_glpi_printers' => array(array('to' => 'printers_id', 'tables' => array('glpi_cartridges'))), 'FK_group' => array(array('to' => 'groups_id', 'tables' => array('glpi_tickets'))), 'FK_groups' => array(array('to' => 'groups_id', 'tables' => array('glpi_computers', 'glpi_monitors', 'glpi_networkequipments', 'glpi_peripherals', 'glpi_phones', 'glpi_printers', 'glpi_softwares', 'glpi_groups_users'))), 'FK_interface' => array(array('to' => 'interfacetypes_id', 'tables' => array('glpi_devicegraphiccards'))), 'FK_item' => array(array('to' => 'items_id', 'noindex' => array('glpi_mailingsettings'), 'tables' => array('glpi_mailingsettings'))), 'FK_links' => array(array('to' => 'links_id', 'tables' => array('glpi_links_itemtypes'))), 'FK_port' => array(array('to' => 'networkports_id', 'noindex' => array('glpi_networkports_vlans'), 'tables' => array('glpi_networkports_vlans'))), 'FK_profiles' => array(array('to' => 'profiles_id', 'tables' => array('glpi_profiles_users', 'glpi_users'))), 'FK_rules' => array(array('to' => 'rules_id', 'tables' => array('glpi_rulecriterias', 'glpi_ruleactions'))), 'FK_tracking' => array(array('to' => 'tickets_id', 'tables' => array('glpi_documents'))), 'FK_users' => array(array('to' => 'users_id', 'noindex' => array('glpi_displaypreferences', 'glpi_bookmarks_users', 'glpi_groups_users'), 'tables' => array('glpi_bookmarks', 'glpi_displaypreferences', 'glpi_documents', 'glpi_groups', 'glpi_reminders', 'glpi_bookmarks_users', 'glpi_groups_users', 'glpi_profiles_users', 'glpi_computers', 'glpi_monitors', 'glpi_networkequipments', 'glpi_peripherals', 'glpi_phones', 'glpi_printers', 'glpi_softwares'))), 'FK_vlan' => array(array('to' => 'vlans_id', 'tables' => array('glpi_networkports_vlans'))), 'glpi_id' => array(array('to' => 'computers_id', 'tables' => array('glpi_ocslinks'))), 'id_assign' => array(array('to' => 'users_id', 'tables' => array('glpi_ticketplannings'))), 'id_auth' => array(array('to' => 'auths_id', 'noindex' => array('glpi_users'), 'tables' => array('glpi_users'))), 'id_device' => array(array('to' => 'items_id', 'noindex' => array('glpi_reservationitems'), 'tables' => array('glpi_reservationitems'))), 'id_followup' => array(array('to' => 'ticketfollowups_id', 'tables' => array('glpi_ticketplannings'))), 'id_item' => array(array('to' => 'reservationitems_id', 'tables' => array('glpi_reservations'))), 'id_user' => array(array('to' => 'users_id', 'tables' => array('glpi_consumables', 'glpi_reservations'))), 'iface' => array(array('to' => 'networkinterfaces_id', 'tables' => array('glpi_networkports'))), 'interface' => array(array('to' => 'interfacetypes_id', 'tables' => array('glpi_devicecontrols', 'glpi_deviceharddrives', 'glpi_devicedrives'))), 'item' => array(array('to' => 'items_id', 'noindex' => array('glpi_events'), 'tables' => array('glpi_events'))), 'link_if_status' => array(array('to' => 'states_id_linkif', 'noindex' => array('glpi_ocsservers'), 'tables' => array('glpi_ocsservers'))), 'location' => array(array('to' => 'locations_id', 'noindex' => array('glpi_netpoints'), 'tables' => array('glpi_cartridgeitems', 'glpi_computers', 'glpi_consumableitems', 'glpi_netpoints', 'glpi_monitors', 'glpi_networkequipments', 'glpi_peripherals', 'glpi_phones', 'glpi_printers', 'glpi_users', 'glpi_softwares'))), 'model' => array(array('to' => 'computermodels_id', 'tables' => array('glpi_computers')), array('to' => 'monitormodels_id', 'tables' => array('glpi_monitors')), array('to' => 'networkequipmentmodels_id', 'tables' => array('glpi_networkequipments')), array('to' => 'peripheralmodels_id', 'tables' => array('glpi_peripherals')), array('to' => 'phonemodels_id', 'tables' => array('glpi_phones')), array('to' => 'printermodels_id', 'tables' => array('glpi_printers'))), 'netpoint' => array(array('to' => 'netpoints_id', 'tables' => array('glpi_networkports'))), 'network' => array(array('to' => 'networks_id', 'tables' => array('glpi_computers', 'glpi_networkequipments', 'glpi_printers'))), 'ocs_id' => array(array('to' => 'ocsid', 'noindex' => array('glpi_ocslinks'), 'tables' => array('glpi_ocslinks'))), 'ocs_server_id' => array(array('to' => 'ocsservers_id', 'noindex' => array('glpi_ocslinks'), 'tables' => array('glpi_ocsadmininfoslinks', 'glpi_ocslinks'))), 'on_device' => array(array('to' => 'items_id', 'noindex' => array('glpi_networkports'), 'tables' => array('glpi_networkports'))), 'os' => array(array('to' => 'operatingsystems_id', 'tables' => array('glpi_computers'))), 'os_sp' => array(array('to' => 'operatingsystemservicepacks_id', 'tables' => array('glpi_computers'))), 'os_version' => array(array('to' => 'operatingsystemversions_id', 'tables' => array('glpi_computers'))), 'parentID' => array(array('to' => 'knowbaseitemcategories_id', 'noindex' => array('glpi_knowbaseitemcategories'), 'tables' => array('glpi_knowbaseitemcategories')), array('to' => 'locations_id', 'tables' => array('glpi_locations')), array('to' => 'ticketcategories_id', 'tables' => array('glpi_ticketcategories')), array('to' => 'entities_id', 'tables' => array('glpi_entities'))), 'platform' => array(array('to' => 'operatingsystems_id', 'tables' => array('glpi_softwares'))), 'power' => array(array('to' => 'phonepowersupplies_id', 'tables' => array('glpi_phones'))), 'recipient' => array(array('to' => 'users_id_recipient', 'tables' => array('glpi_tickets'))), 'rubrique' => array(array('to' => 'documentcategories_id', 'tables' => array('glpi_documents'))), 'rule_id' => array(array('to' => 'rules_id', 'tables' => array('glpi_rulecachemanufacturers', 'glpi_rulecachecomputermodels', 'glpi_rulecachemonitormodels', 'glpi_rulecachenetworkequipmentmodels', 'glpi_rulecacheperipheralmodels', 'glpi_rulecachephonemodels', 'glpi_rulecacheprintermodels', 'glpi_rulecacheoperatingsystems', 'glpi_rulecacheoperatingsystemservicepacks', 'glpi_rulecacheoperatingsystemversions', 'glpi_rulecachesoftwares', 'glpi_rulecachecomputertypes', 'glpi_rulecachemonitortypes', 'glpi_rulecachenetworkequipmenttypes', 'glpi_rulecacheperipheraltypes', 'glpi_rulecachephonetypes', 'glpi_rulecacheprintertypes'))), 'server_id' => array(array('to' => 'authldaps_id', 'tables' => array('glpi_authldapreplicates'))), 'sID' => array(array('to' => 'softwares_id', 'tables' => array('glpi_softwarelicenses', 'glpi_softwareversions'))), 'state' => array(array('to' => 'states_id', 'tables' => array('glpi_computers', 'glpi_monitors', 'glpi_networkequipments', 'glpi_peripherals', 'glpi_phones', 'glpi_printers', 'glpi_softwareversions'))), 'tech_num' => array(array('to' => 'users_id_tech', 'tables' => array('glpi_cartridgeitems', 'glpi_computers', 'glpi_consumableitems', 'glpi_monitors', 'glpi_networkequipments', 'glpi_peripherals', 'glpi_phones', 'glpi_printers', 'glpi_softwares'))), 'title' => array(array('to' => 'usertitles_id', 'tables' => array('glpi_users'))), 'tracking' => array(array('to' => 'tickets_id', 'tables' => array('glpi_ticketfollowups'))), 'type' => array(array('to' => 'cartridgeitemtypes_id', 'tables' => array('glpi_cartridgeitems')), array('to' => 'computertypes_id', 'tables' => array('glpi_computers')), array('to' => 'consumableitemtypes_id', 'tables' => array('glpi_consumableitems')), array('to' => 'contacttypes_id', 'tables' => array('glpi_contacts')), array('to' => 'devicecasetypes_id', 'tables' => array('glpi_devicecases')), array('to' => 'devicememorytypes_id', 'tables' => array('glpi_devicememories')), array('to' => 'suppliertypes_id', 'tables' => array('glpi_suppliers')), array('to' => 'monitortypes_id', 'tables' => array('glpi_monitors')), array('to' => 'networkequipmenttypes_id', 'tables' => array('glpi_networkequipments')), array('to' => 'peripheraltypes_id', 'tables' => array('glpi_peripherals')), array('to' => 'phonetypes_id', 'tables' => array('glpi_phones')), array('to' => 'printertypes_id', 'tables' => array('glpi_printers')), array('to' => 'softwarelicensetypes_id', 'tables' => array('glpi_softwarelicenses')), array('to' => 'usercategories_id', 'tables' => array('glpi_users')), array('to' => 'itemtype', 'noindex' => array('glpi_computers_items'), 'tables' => array('glpi_computers_items', 'glpi_displaypreferences'))), 'update_software' => array(array('to' => 'softwares_id', 'tables' => array('glpi_softwares'))), 'use_version' => array(array('to' => 'softwareversions_id_use', 'tables' => array('glpi_softwarelicenses'))), 'vID' => array(array('to' => 'softwareversions_id', 'tables' => array('glpi_computers_softwareversions')))); foreach ($foreignkeys as $oldname => $newnames) { foreach ($newnames as $tab) { $newname = $tab['to']; foreach ($tab['tables'] as $table) { $doindex = true; if (isset($tab['noindex']) && in_array($table,$tab['noindex'])) { $doindex = false; } // Rename field if (FieldExists($table, $oldname, false)) { $addcomment = ''; if (isset($tab['comments']) && isset($tab['comments'][$table])) { $addcomment = " COMMENT '".$tab['comments'][$table]."' "; } $default_value = 0; if (isset($tab['default']) && isset($tab['default'][$table])) { $default_value = $tab['default'][$table]; } // Manage NULL fields $query = "UPDATE `$table` SET `$oldname` = '$default_value' WHERE `$oldname` IS NULL "; $DB->queryOrDie($query, "0.78 prepare datas for update $oldname to $newname in $table"); $changes[$table][] = "CHANGE COLUMN `$oldname` `$newname` INT( 11 ) NOT NULL DEFAULT '$default_value' $addcomment"; } else { $updateresult = false; $migration->displayWarning("Error: $table.$oldname does not exist.", true); } // If do index : delete old one / create new one if ($doindex) { if (!isIndex($table, $newname)) { $changes[$table][] = "ADD INDEX `$newname` (`$newname`)"; } if ($oldname!=$newname && isIndex($table, $oldname)) { $changes[$table][]="DROP INDEX `$oldname`"; } } } } } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'Clean DB: rename bool values')); $boolfields = array('glpi_authldaps' => array(array('from' => 'ldap_use_tls', 'to' => 'use_tls', 'default' => 0, 'noindex '=> true), array('from' => 'use_dn', 'to' => 'use_dn', 'default' => 1, 'noindex' => true)), 'glpi_bookmarks' => array(array('from' => 'private', 'to' => 'is_private', 'default' => 1 ), array('from' => 'recursive', 'to' => 'is_recursive', 'default' => 0)), 'glpi_cartridgeitems' => array(array('from' => 'deleted', 'to' => 'is_deleted', 'default' => 0)), 'glpi_computers' => array(array('from' => 'is_template', 'to' => 'is_template', 'default' => 0), array('from' => 'deleted', 'to' => 'is_deleted', 'default' => 0), array('from' => 'ocs_import', 'to' => 'is_ocs_import', 'default' => 0)), 'glpi_configs' => array(array('from' => 'jobs_at_login', 'to' => 'show_jobs_at_login', 'default' => 0, 'noindex' => true), array('from' => 'mailing', 'to' => 'use_mailing', 'default' => 0, 'noindex' => true), array('from' => 'permit_helpdesk', 'to' => 'use_anonymous_helpdesk', 'default' => 0, 'noindex' => true), array('from' => 'existing_auth_server_field_clean_domain', 'to' => 'existing_auth_server_field_clean_domain', 'default' => 0, 'noindex' => true), array('from' => 'auto_assign', 'to' => 'use_auto_assign_to_tech', 'default' => 0, 'noindex' => true), array('from' => 'public_faq', 'to' => 'use_public_faq', 'default' => 0, 'noindex' => true), array('from' => 'url_in_mail', 'to' => 'show_link_in_mail', 'default' => 0, 'noindex' => true), array('from' => 'use_ajax', 'to' => 'use_ajax', 'default' => 0, 'noindex' => true), array('from' => 'ajax_autocompletion', 'to' => 'use_ajax_autocompletion', 'default' => 1, 'noindex' => true), array('from' => 'auto_add_users', 'to' => 'is_users_auto_add', 'default' => 1, 'noindex' => true), array('from' => 'view_ID', 'to' => 'is_ids_visible', 'default' => 0, 'noindex' => true), array('from' => 'ocs_mode', 'to' => 'use_ocs_mode', 'default' => 0, 'noindex' => true), array('from' => 'followup_on_update_ticket', 'to' => 'add_followup_on_update_ticket', 'default' => 1, 'noindex' => true), array('from' => 'licenses_alert', 'to' => 'use_licenses_alert', 'default' => 0, 'noindex' => true), array('from' => 'keep_tracking_on_delete', 'to' => 'keep_tickets_on_delete', 'default' => 1, 'noindex' => true), array('from' => 'use_errorlog', 'to' => 'use_log_in_files', 'default' => 0, 'noindex '=> true), array('from' => 'autoupdate_link_contact', 'to' => 'is_contact_autoupdate', 'default' => 1, 'noindex' => true), array('from' => 'autoupdate_link_user', 'to' => 'is_user_autoupdate', 'default' => 1, 'noindex' => true), array('from' => 'autoupdate_link_group', 'to' => 'is_group_autoupdate', 'default' => 1, 'noindex '=> true),// array('from' => 'autoupdate_link_location', 'to' => 'is_location_autoupdate', 'default' => 1, 'noindex' => true), array('from' => 'autoclean_link_contact', 'to' => 'is_contact_autoclean', 'default' => 0, 'noindex' => true), array('from' => 'autoclean_link_user', 'to' => 'is_user_autoclean', 'default' => 0, 'noindex' => true), array('from' => 'autoclean_link_group', 'to' => 'is_group_autoclean', 'default' => 0, 'noindex' => true), array('from' => 'autoclean_link_location', 'to' => 'is_location_autoclean', 'default' => 0, 'noindex' => true), array('from' => 'flat_dropdowntree', 'to' => 'use_flat_dropdowntree', 'default' => 0, 'noindex' => true), array('from' => 'autoname_entity', 'to' => 'use_autoname_by_entity', 'default' => 1, 'noindex' => true), array('from' => 'expand_soft_categorized', 'to' => 'is_categorized_soft_expanded', 'default' => 1, 'noindex' => true), array('from' => 'expand_soft_not_categorized', 'to' => 'is_not_categorized_soft_expanded', 'default' => 1, 'noindex' => true), array('from' => 'ticket_title_mandatory', 'to' => 'is_ticket_title_mandatory', 'default' => 0, 'noindex' => true), array('from' => 'ticket_content_mandatory', 'to' => 'is_ticket_content_mandatory', 'default' => 1, 'noindex' => true), array('from' => 'ticket_category_mandatory', 'to' => 'is_ticket_category_mandatory', 'default' => 0, 'noindex' => true), array('from' => 'followup_private', 'to' => 'followup_private', 'default' => 0, 'noindex' => true), array('from' => 'software_helpdesk_visible', 'to' => 'default_software_helpdesk_visible', 'default' => 1, 'noindex' => true)), 'glpi_consumableitems' => array(array('from' => 'deleted', 'to' => 'is_deleted', 'default' => 0)), 'glpi_contacts' => array(array('from' => 'recursive', 'to' => 'is_recursive', 'default' => 0, 'noindex' => true), array('from' => 'deleted', 'to' => 'is_deleted', 'default' => 0)), 'glpi_contracts' => array(array('from' => 'recursive', 'to' => 'is_recursive', 'default' => 0, 'noindex' => true), array('from' => 'deleted', 'to' => 'is_deleted', 'default' => 0), array('from' => 'monday', 'to' => 'use_monday', 'default' => 0), array('from' => 'saturday', 'to' => 'use_saturday', 'default' => 0)), 'glpi_devicecontrols' => array(array('from' => 'raid', 'to' => 'is_raid', 'default' => 0, 'noindex' => true)), 'glpi_devicedrives' => array(array('from' => 'is_writer', 'to' => 'is_writer', 'default' => 1, 'noindex' => true)), 'glpi_devicepowersupplies' => array(array('from' => 'atx', 'to' => 'is_atx', 'default' => 1, 'noindex' => true)), 'glpi_documents' => array(array('from' => 'recursive', 'to' => 'is_recursive', 'default' => 0, 'noindex' => true), array('from' => 'deleted', 'to' => 'is_deleted', 'default' => 0)), 'glpi_documenttypes' => array(array('from' => 'upload', 'to' => 'is_uploadable', 'default' => 1)), 'glpi_groups' => array(array('from' => 'recursive', 'to' => 'is_recursive', 'default' => 0, 'noindex' => true)), 'glpi_knowbaseitems' => array(array('from' => 'recursive', 'to' => 'is_recursive', 'default' => 1, 'noindex' => true), array('from' => 'faq', 'to' => 'is_faq', 'default' => 0) ), 'glpi_links' => array(array('from' => 'recursive', 'to' => 'is_recursive', 'default' => 1, 'noindex' => true)), 'glpi_monitors' => array(array('from' => 'deleted', 'to' => 'is_deleted', 'default' => 0), array('from' => 'is_template', 'to' => 'is_template', 'default' => 0, 'noindex' => true), array('from' => 'is_global', 'to' => 'is_global', 'default' => 0, 'noindex' => true), array('from' => 'flags_micro', 'to' => 'have_micro', 'default' => 0, 'noindex' => true), array('from' => 'flags_speaker', 'to' => 'have_speaker', 'default' => 0, 'noindex' => true), array('from' => 'flags_subd', 'to' => 'have_subd', 'default' => 0, 'noindex' => true), array('from' => 'flags_bnc', 'to' => 'have_bnc', 'default' => 0, 'noindex' => true), array('from' => 'flags_dvi', 'to' => 'have_dvi', 'default' => 0, 'noindex' => true), array('from' => 'flags_pivot', 'to' => 'have_pivot', 'default' => 0, 'noindex' => true)), 'glpi_networkequipments' => array(array('from' => 'recursive', 'to' => 'is_recursive', 'default' => 0, 'noindex' => true), array('from' => 'deleted', 'to' => 'is_deleted', 'default' => 0), array('from' => 'is_template', 'to' => 'is_template', 'default' => 0, 'noindex' => true)), 'glpi_ocslinks' => array(array('from' => 'auto_update', 'to' => 'use_auto_update', 'default' => 1)), 'glpi_ocsservers' => array(array('from' => 'import_periph', 'to' => 'import_periph', 'default' => 0, 'noindex' => true), array('from' => 'import_monitor', 'to' => 'import_monitor', 'default' => 0, 'noindex' => true), array('from' => 'import_software', 'to' => 'import_software', 'default' => 0, 'noindex' => true), array('from' => 'import_printer', 'to' => 'import_printer', 'default' => 0, 'noindex' => true), array('from' => 'import_general_name', 'to' => 'import_general_name', 'default' => 0, 'noindex' => true), array('from' => 'import_general_os', 'to' => 'import_general_os', 'default' => 0, 'noindex' => true), array('from' => 'import_general_serial', 'to' => 'import_general_serial', 'default' => 0, 'noindex' => true), array('from' => 'import_general_model', 'to' => 'import_general_model', 'default' => 0, 'noindex' => true), array('from' => 'import_general_enterprise', 'to' => 'import_general_manufacturer', 'default' => 0, 'noindex' => true), array('from' => 'import_general_type', 'to' => 'import_general_type', 'default' => 0, 'noindex' => true), array('from' => 'import_general_domain', 'to' => 'import_general_domain', 'default' => 0, 'noindex' => true), array('from' => 'import_general_contact', 'to' => 'import_general_contact', 'default' => 0, 'noindex' => true), array('from' => 'import_general_comments', 'to' => 'import_general_comment', 'default' => 0, 'noindex' => true), array('from' => 'import_device_processor', 'to' => 'import_device_processor', 'default' => 0, 'noindex' => true), array('from' => 'import_device_memory', 'to' => 'import_device_memory', 'default' => 0, 'noindex' => true), array('from' => 'import_device_hdd', 'to' => 'import_device_hdd', 'default' => 0, 'noindex' => true), array('from' => 'import_device_iface', 'to' => 'import_device_iface', 'default' => 0, 'noindex' => true), array('from' => 'import_device_gfxcard', 'to' => 'import_device_gfxcard', 'default' => 0, 'noindex' => true), array('from' => 'import_device_sound', 'to' => 'import_device_sound', 'default' => 0, 'noindex' => true), array('from' => 'import_device_drives', 'to' => 'import_device_drive', 'default' => 0, 'noindex' => true), array('from' => 'import_device_ports', 'to' => 'import_device_port', 'default' => 0, 'noindex' => true), array('from' => 'import_device_modems', 'to' => 'import_device_modem', 'default' => 0, 'noindex' => true), array('from' => 'import_registry', 'to' => 'import_registry', 'default' => 0, 'noindex' => true), array('from' => 'import_os_serial', 'to' => 'import_os_serial', 'default' => 0, 'noindex' => true), array('from' => 'import_ip', 'to' => 'import_ip', 'default' => 0, 'noindex' => true), array('from' => 'import_disk', 'to' => 'import_disk', 'default' => 0, 'noindex' => true), array('from' => 'import_monitor_comments', 'to' => 'import_monitor_comment', 'default' => 0, 'noindex' => true), array('from' => 'glpi_link_enabled', 'to' => 'is_glpi_link_enabled', 'default' => 0, 'noindex' => true), array('from' => 'link_ip', 'to' => 'use_ip_to_link', 'default' => 0, 'noindex' => true), array('from' => 'link_name', 'to' => 'use_name_to_link', 'default' => 0, 'noindex' => true), array('from' => 'link_mac_address', 'to' => 'use_mac_to_link', 'default' => 0, 'noindex' => true), array('from' => 'link_serial', 'to' => 'use_serial_to_link', 'default' => 0, 'noindex' => true), array('from' => 'use_soft_dict', 'to' => 'use_soft_dict', 'default' => 0, 'noindex' => true)), 'glpi_peripherals' => array(array('from' => 'deleted', 'to' => 'is_deleted', 'default' => 0), array('from' => 'is_template', 'to' => 'is_template', 'default' => 0, 'noindex' => true), array('from' => 'is_global', 'to' => 'is_global', 'default' => 0, 'noindex' => true)), 'glpi_phones' => array(array('from' => 'deleted', 'to' => 'is_deleted', 'default' => 0), array('from' => 'is_template', 'to' => 'is_template', 'default' => 0, 'noindex' => true), array('from' => 'is_global', 'to' => 'is_global', 'default' => 0, 'noindex' => true), array('from' => 'flags_hp', 'to' => 'have_hp', 'default' => 0, 'noindex' => true), array('from' => 'flags_casque', 'to' => 'have_headset', 'default' => 0, 'noindex' => true)), 'glpi_printers' => array(array('from' => 'recursive', 'to' => 'is_recursive', 'default' => 0, 'noindex' => true), array('from' => 'deleted', 'to' => 'is_deleted', 'default' => 0), array('from' => 'is_template', 'to' => 'is_template', 'default' => 0, 'noindex' => true), array('from' => 'is_global', 'to' => 'is_global', 'default' => 0, 'noindex' => true), array('from' => 'flags_usb', 'to' => 'have_usb', 'default' => 0, 'noindex' => true), array('from' => 'flags_par', 'to' => 'have_parallel', 'default' => 0, 'noindex' => true), array('from' => 'flags_serial', 'to' => 'have_serial', 'default' => 0, 'noindex' => true)), 'glpi_profiles_users' => array(array('from' => 'recursive', 'to' => 'is_recursive', 'default' => 1), array('from' => 'dynamic', 'to' => 'is_dynamic', 'default' => 0)), 'glpi_profiles' => array(array('from' => 'is_default', 'to' => 'is_default', 'default' => 0)), 'glpi_reminders' => array(array('from' => 'private', 'to' => 'is_private', 'default' => 1), array('from' => 'recursive', 'to' => 'is_recursive', 'default' => 0), array('from' => 'rv', 'to' => 'is_planned', 'default' => 0)), 'glpi_reservationitems' => array(array('from' => 'active', 'to' => 'is_active', 'default' => 1)), 'glpi_rules' => array(array('from' => 'active', 'to' => 'is_active', 'default' => 1)), 'glpi_suppliers' => array(array('from' => 'recursive', 'to' => 'is_recursive', 'default' => 0, 'noindex' => true), array('from' => 'deleted', 'to' => 'is_deleted', 'default' => 0)), 'glpi_softwares' => array(array('from' => 'recursive', 'to' => 'is_recursive', 'default' => 0, 'noindex' => true), array('from' => 'deleted', 'to' => 'is_deleted', 'default' => 0), array('from' => 'helpdesk_visible', 'to' => 'is_helpdesk_visible', 'default' => 1), array('from' => 'is_template', 'to' => 'is_template', 'default' => 0, 'noindex' => true), array('from' => 'is_update', 'to' => 'is_update', 'default' => 0, 'noindex' => true)), 'glpi_softwarelicenses' => array(array('from' => 'recursive', 'to' => 'is_recursive', 'default' => 0, 'noindex' => true)), 'glpi_tickets' => array(array('from' => 'emailupdates', 'to' => 'use_email_notification', 'default' => 0, 'noindex' => true)), 'glpi_ticketfollowups' => array(array('from' => 'private', 'to' => 'is_private', 'default' => 0)), 'glpi_users' => array(array('from' => 'deleted', 'to' => 'is_deleted', 'default' => 0), array('from' => 'active', 'to' => 'is_active', 'default' => 1), array('from' => 'jobs_at_login', 'to' => 'show_jobs_at_login', 'default' => NULL, 'maybenull' => true, 'noindex' => true), array('from' => 'followup_private', 'to' => 'followup_private', 'default' => NULL, 'maybenull' => true, 'noindex' => true), array('from' => 'expand_soft_categorized', 'to' => 'is_categorized_soft_expanded', 'default' => NULL, 'maybenull' => true, 'noindex' => true), array('from' => 'expand_soft_not_categorized', 'to' => 'is_not_categorized_soft_expanded', 'default' => NULL, 'maybenull' => true, 'noindex' => true), array('from' => 'flat_dropdowntree', 'to' => 'use_flat_dropdowntree', 'default' => NULL, 'maybenull' => true, 'noindex' => true), array('from' => 'view_ID', 'to' => 'is_ids_visible', 'default' => NULL, 'maybenull' => true, 'noindex' => true))); foreach ($boolfields as $table => $tab) { foreach ($tab as $update) { $newname = $update['to']; $oldname = $update['from']; $doindex = true; if (isset($update['noindex']) && $update['noindex']) { $doindex = false; } // Rename field if (FieldExists($table, $oldname, false)) { $NULL = "NOT NULL"; if (isset($update['maybenull']) && $update['maybenull']) { $NULL = "NULL"; // Manage not zero values $query = "UPDATE `$table` SET `$oldname` = 1 WHERE `$oldname` <> 0 AND `$oldname` IS NOT NULL"; $DB->queryOrDie($query, "0.78 prepare datas for update $oldname to $newname in $table"); } else { // Manage NULL fields $query = "UPDATE `$table` SET `$oldname` = 0 WHERE `$oldname` IS NULL"; $DB->queryOrDie($query, "0.78 prepare datas for update $oldname to $newname in $table"); // Manage not zero values $query = "UPDATE `$table` SET `$oldname` = 1 WHERE `$oldname` <> 0"; $DB->queryOrDie($query, "0.78 prepare datas for update $oldname to $newname in $table"); } $default = "DEFAULT NULL"; if (isset($update['default']) && !is_null($update['default'])) { $default = "DEFAULT ".$update['default']; } $changes[$table][] = "CHANGE `$oldname` `$newname` TINYINT( 1 ) $NULL $default"; } else { $updateresult = false; $migration->displayWarning("Error: $table.$oldname does not exist.", true); } // If do index : delete old one / create new one if ($doindex) { if (!isIndex($table, $newname)) { $changes[$table][] = "ADD INDEX `$newname` (`$newname`)"; } if ($newname!=$oldname && isIndex($table, $oldname)) { $changes[$table][] = "DROP INDEX `$oldname`"; } } } } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'Clean DB: update text fields')); $textfields = array('comments' => array('to' => 'comment', 'tables' => array('glpi_cartridgeitems', 'glpi_computers', 'glpi_consumableitems', 'glpi_contacts', 'glpi_contracts', 'glpi_documents', 'glpi_autoupdatesystems', 'glpi_budgets', 'glpi_cartridgeitemtypes', 'glpi_devicecasetypes', 'glpi_consumableitemtypes', 'glpi_contacttypes', 'glpi_contracttypes', 'glpi_domains', 'glpi_suppliertypes', 'glpi_filesystems', 'glpi_networkequipmentfirmwares', 'glpi_networkinterfaces', 'glpi_interfacetypes', 'glpi_knowbaseitemcategories', 'glpi_softwarelicensetypes', 'glpi_locations', 'glpi_manufacturers', 'glpi_computermodels', 'glpi_monitormodels', 'glpi_networkequipmentmodels', 'glpi_peripheralmodels', 'glpi_phonemodels', 'glpi_printermodels', 'glpi_netpoints', 'glpi_networks', 'glpi_operatingsystems', 'glpi_operatingsystemservicepacks', 'glpi_operatingsystemversions', 'glpi_phonepowersupplies', 'glpi_devicememorytypes', 'glpi_documentcategories', 'glpi_softwarecategories', 'glpi_states', 'glpi_ticketcategories', 'glpi_usertitles', 'glpi_usercategories', 'glpi_vlans', 'glpi_suppliers', 'glpi_entities', 'glpi_groups', 'glpi_infocoms', 'glpi_monitors', 'glpi_phones', 'glpi_printers', 'glpi_peripherals', 'glpi_networkequipments', 'glpi_reservationitems', 'glpi_rules','glpi_softwares', 'glpi_softwarelicenses', 'glpi_softwareversions', 'glpi_computertypes', 'glpi_monitortypes', 'glpi_networkequipmenttypes', 'glpi_peripheraltypes', 'glpi_phonetypes', 'glpi_printertypes', 'glpi_users')), 'notes' => array('to' => 'notepad', 'long' => true, 'tables' => array('glpi_cartridgeitems', 'glpi_computers', 'glpi_consumableitems', 'glpi_contacts', 'glpi_contracts', 'glpi_documents', 'glpi_suppliers', 'glpi_entitydatas', 'glpi_printers', 'glpi_monitors', 'glpi_phones', 'glpi_peripherals', 'glpi_networkequipments', 'glpi_softwares')), 'ldap_condition' => array('to' => 'condition', 'tables' => array('glpi_authldaps')), 'import_printers' => array('to' => 'import_printer','long'=>true, 'tables' => array('glpi_ocslinks')), 'contents' => array('to' => 'content','long'=>true, 'tables' => array('glpi_tickets','glpi_ticketfollowups'))); foreach ($textfields as $oldname => $tab) { $newname = $tab['to']; $type = "TEXT"; if (isset($tab['long']) && $tab['long']) { $type = "LONGTEXT"; } foreach ($tab['tables'] as $table) { // Rename field if (FieldExists($table, $oldname, false)) { $query = "ALTER TABLE `$table` CHANGE `$oldname` `$newname` $type NULL DEFAULT NULL "; $DB->queryOrDie($query, "0.78 rename $oldname to $newname in $table"); } else { $updateresult = false; $migration->displayWarning("Error: $table.$oldname does not exist.", true); } } } $varcharfields = array('glpi_authldaps' => array(array('from' => 'ldap_host', 'to' => 'host', 'noindex' => true), array('from' => 'ldap_basedn', 'to' => 'basedn', 'noindex' => true), array('from' => 'ldap_rootdn', 'to' => 'rootdn', 'noindex' => true), array('from' => 'ldap_pass', 'to' => 'rootdn_password', 'noindex' => true), array('from' => 'ldap_login', 'to' => 'login_field', 'default' => 'uid', 'noindex' => true), array('from' => 'ldap_field_group', 'to' => 'group_field', 'noindex' => true), array('from' => 'ldap_group_condition', 'to' => 'group_condition', 'noindex' => true), array('from' => 'ldap_field_group_member', 'to' => 'group_member_field', 'noindex' => true), array('from' => 'ldap_field_email', 'to' => 'email_field', 'noindex' => true), array('from' => 'ldap_field_realname', 'to' => 'realname_field', 'noindex' => true), array('from' => 'ldap_field_firstname', 'to' => 'firstname_field', 'noindex' => true), array('from' => 'ldap_field_phone', 'to' => 'phone_field', 'noindex' => true), array('from' => 'ldap_field_phone2', 'to' => 'phone2_field', 'noindex' => true), array('from' => 'ldap_field_mobile', 'to' => 'mobile_field', 'noindex' => true), array('from' => 'ldap_field_comments', 'to' => 'comment_field', 'noindex' => true), array('from' => 'ldap_field_title', 'to' => 'title_field', 'noindex' => true), array('from' => 'ldap_field_type', 'to' => 'category_field', 'noindex' => true), array('from' => 'ldap_field_language', 'to' => 'language_field', 'noindex' => true)), 'glpi_authldapreplicates' => array(array('from' => 'ldap_host', 'to' => 'host', 'noindex' => true)), 'glpi_authmails' => array(array('from' => 'imap_auth_server', 'to' => 'connect_string', 'noindex' => true), array('from' => 'imap_host', 'to' => 'host', 'noindex' => true)), 'glpi_computers' => array(array('from' => 'os_license_id', 'to' => 'os_licenseid', 'noindex' => true), array('from' => 'tplname', 'to' => 'template_name', 'noindex' => true)), 'glpi_configs' => array(array('from' => 'helpdeskhelp_url', 'to' => 'helpdesk_doc_url', 'noindex' => true), array('from' => 'centralhelp_url', 'to' => 'central_doc_url', 'noindex' => true)), 'glpi_contracts' => array(array('from' => 'compta_num', 'to' => 'accounting_number', 'noindex' => true)), 'glpi_events' => array(array('from' => 'itemtype', 'to' => 'type', 'noindex' => true)), 'glpi_infocoms' => array(array('from' => 'num_commande', 'to' => 'order_number', 'noindex' => true), array('from' => 'bon_livraison', 'to' => 'delivery_number', 'noindex' => true), array('from' => 'num_immo', 'to' => 'immo_number', 'noindex' => true), array('from' => 'facture', 'to' => 'bill', 'noindex' => true)), 'glpi_monitors' => array(array('from' => 'tplname', 'to' => 'template_name', 'noindex' => true)), 'glpi_networkequipments' => array(array('from' => 'tplname', 'to' => 'template_name', 'noindex' => true), array('from' => 'ifmac', 'to' => 'mac', 'noindex' => true), array('from' => 'ifaddr', 'to' => 'ip', 'noindex' => true)), 'glpi_networkports' => array(array('from' => 'ifmac', 'to' => 'mac', 'noindex' => true), array('from' => 'ifaddr', 'to' => 'ip', 'noindex' => true)), 'glpi_peripherals' => array(array('from' => 'tplname', 'to' => 'template_name', 'noindex' => true)), 'glpi_phones' => array(array('from' => 'tplname', 'to' => 'template_name', 'noindex' => true)), 'glpi_printers' => array(array('from' => 'tplname', 'to' => 'template_name', 'noindex' => true), array('from' => 'ramSize', 'to' => 'memory_size', 'noindex' => true)), 'glpi_registrykeys' => array(array('from' => 'registry_hive', 'to' => 'hive', 'noindex' => true), array('from' => 'registry_path', 'to' => 'path', 'noindex' => true), array('from' => 'registry_value', 'to' => 'value', 'noindex' => true), array('from' => 'registry_ocs_name', 'to' => 'ocs_name', 'noindex' => true)), 'glpi_softwares' => array(array('from' => 'tplname', 'to' => 'template_name', 'noindex' => true)), 'glpi_tickets' => array(array('from' => 'uemail', 'to' => 'user_email', 'noindex' => true))); foreach ($varcharfields as $table => $tab) { foreach ($tab as $update) { $newname = $update['to']; $oldname = $update['from']; $doindex = true; if (isset($update['noindex']) && $update['noindex']) { $doindex = false; } $default = "DEFAULT NULL"; if (isset($update['default']) && !is_null($update['default'])) { $default = "DEFAULT '".$update['default']."'"; } // Rename field if (FieldExists($table, $oldname, false)) { $query = "ALTER TABLE `$table` CHANGE `$oldname` `$newname` VARCHAR( 255 ) NULL $default "; $DB->queryOrDie($query, "0.78 rename $oldname to $newname in $table"); } else { $updateresult = false; $migration->displayWarning("Error: $table.$oldname does not exist."); } // If do index : delete old one / create new one if ($doindex) { if (!isIndex($table, $newname)) { $changes[$table][] = "ADD INDEX `$newname` (`$newname`)"; } if ($newname!=$oldname && isIndex($table, $oldname)) { $changes[$table][] = "DROP INDEX `$oldname`"; } } } } $charfields = array('glpi_profiles' => array(array('from' => 'user_auth_method', 'to' => 'user_authtype', 'length' => 1, 'default' => NULL, 'noindex' => true), array('from' => 'rule_tracking', 'to' => 'rule_ticket', 'length' => 1, 'default' => NULL, 'noindex' => true), array('from' => 'rule_softwarecategories', 'to' => 'rule_softwarecategories', 'length' => 1, 'default' => NULL, 'noindex' => true), array('from' => 'rule_dictionnary_software', 'to' => 'rule_dictionnary_software', 'length' => 1, 'default' => NULL, 'noindex' => true), array('from' => 'rule_dictionnary_dropdown', 'to' => 'rule_dictionnary_dropdown', 'length' => 1, 'default' => NULL, 'noindex' => true)), 'glpi_configs' => array(array('from' => 'version', 'to' => 'version', 'length' => 10, 'default' => NULL, 'noindex' => true), array('from' => 'version', 'to' => 'version', 'length' => 10, 'default' => NULL, 'noindex' => true), array('from' => 'language', 'to' => 'language', 'length' => 10, 'default' => 'en_GB', 'noindex' => true, 'comments' =>'see define.php CFG_GLPI[language] array'), array('from' => 'priority_1', 'to' => 'priority_1', 'length' => 20, 'default' => '#fff2f2', 'noindex' => true), array('from' => 'priority_2', 'to' => 'priority_2', 'length' => 20, 'default' => '#ffe0e0', 'noindex' => true), array('from' => 'priority_3', 'to' => 'priority_3', 'length' => 20, 'default' => '#ffcece', 'noindex' => true), array('from' => 'priority_4', 'to' => 'priority_4', 'length' => 20, 'default' => '#ffbfbf', 'noindex' => true), array('from' => 'priority_5', 'to' => 'priority_5', 'length' => 20, 'default' => '#ffadad', 'noindex' => true), array('from' => 'founded_new_version', 'to' => 'founded_new_version', 'length' => 10, 'default' => NULL, 'noindex' => true)), 'glpi_rules' => array(array('from' => 'match', 'to' => 'match', 'length' => 10, 'default' => NULL, 'noindex' => true, 'comments' => 'see define.php *_MATCHING constant')), 'glpi_users' => array(array('from' => 'language', 'to' => 'language', 'length' => 10, 'default' => NULL, 'noindex' => true, 'comments' => 'see define.php CFG_GLPI[language] array'), array('from' => 'priority_1', 'to' => 'priority_1', 'length' => 20, 'default' => NULL, 'noindex' => true), array('from' => 'priority_2', 'to' => 'priority_2', 'length' => 20, 'default' => NULL, 'noindex' => true), array('from' => 'priority_3', 'to' => 'priority_3', 'length' => 20, 'default' => NULL, 'noindex' => true), array('from' => 'priority_4', 'to' => 'priority_4', 'length' => 20, 'default' => NULL, 'noindex' => true), array('from' => 'priority_5', 'to' => 'priority_5', 'length' => 20, 'default' => NULL, 'noindex' => true))); foreach ($charfields as $table => $tab) { foreach ($tab as $update) { $newname = $update['to']; $oldname = $update['from']; $length = $update['length']; $doindex = true; if (isset($update['noindex']) && $update['noindex']) { $doindex = false; } $default = "DEFAULT NULL"; if (isset($update['default']) && !is_null($update['default'])) { $default = "DEFAULT '".$update['default']."'"; } $addcomment = ""; if (isset($update['comments']) ) { $addcomment = "COMMENT '".$update['comments']."'"; } // Rename field if (FieldExists($table, $oldname, false)) { $query = "ALTER TABLE `$table` CHANGE `$oldname` `$newname` CHAR( $length ) NULL $default $addcomment "; $DB->queryOrDie($query, "0.78 rename $oldname to $newname in $table"); } else { $updateresult = false; $migration->displayWarning("Error: $table.$oldname does not exist.", true); } // If do index : delete old one / create new one if ($doindex) { if (!isIndex($table, $newname)) { $changes[$table][] = "ADD INDEX `$newname` (`$newname`)"; } if ($oldname!=$newname && isIndex($table, $oldname)) { $changes[$table][] = "DROP INDEX `$oldname`"; } } } } $intfields = array('glpi_authldaps' => array(array('from' => 'ldap_port', 'to' => 'port', 'default' => 389, 'noindex' => true, 'checkdatas' => true), array('from' => 'ldap_search_for_groups', 'to' => 'group_search_type', 'default' => 0, 'noindex' => true), array('from' => 'ldap_opt_deref', 'to' => 'deref_option', 'default' => 0, 'noindex' => true), array('from' => 'timezone', 'to' => 'time_offset', 'default' => 0, 'noindex' => true, 'comments' => 'in seconds')), 'glpi_authldapreplicates' => array(array('from' => 'ldap_port', 'to' => 'port', 'default' => 389, 'noindex' => true, 'checkdatas' => true)), 'glpi_bookmarks' => array(array('from' => 'type', 'to' => 'type', 'default' => 0, 'noindex' => true, 'comments' => 'see define.php BOOKMARK_* constant')), 'glpi_cartridgeitems' => array(array('from' => 'alarm', 'to' => 'alarm_threshold', 'default' => 10)), 'glpi_configs' => array(array('from' => 'glpi_timezone', 'to' => 'time_offset', 'default' => 0, 'noindex' => true, 'comments' => 'in seconds'), array('from' => 'cartridges_alarm', 'to' => 'default_alarm_threshold', 'default' => 10, 'noindex' => true), array('from' => 'event_loglevel', 'to' => 'event_loglevel', 'default' => 5, 'noindex' => true), array('from' => 'cas_port', 'to' => 'cas_port', 'default' => 443, 'noindex' => true, 'checkdatas' => true), array('from' => 'auto_update_check', 'to' => 'auto_update_check', 'default' => 0, 'noindex' => true), array('from' => 'dateformat', 'to' => 'date_format', 'default' => 0, 'noindex' => true), array('from' => 'numberformat', 'to' => 'number_format', 'default' => 0, 'noindex' => true), array('from' => 'proxy_port', 'to' => 'proxy_port', 'default' => 8080, 'noindex' => true, 'checkdatas' => true), array('from' => 'contract_alerts', 'to' => 'default_contract_alert', 'default' => 0, 'noindex' => true), array('from' => 'infocom_alerts', 'to' => 'default_infocom_alert', 'default' => 0, 'noindex' => true), array('from' => 'cartridges_alert', 'to' => 'cartridges_alert_repeat', 'default' => 0, 'noindex' => true, 'comments' => 'in seconds'), array('from' => 'consumables_alert', 'to' => 'consumables_alert_repeat', 'default' => 0, 'noindex' => true, 'comments' => 'in seconds'), array('from' => 'monitors_management_restrict', 'to' => 'monitors_management_restrict', 'default' => 2, 'noindex' => true), array('from' => 'phones_management_restrict', 'to' => 'phones_management_restrict', 'default' => 2, 'noindex' => true), array('from' => 'peripherals_management_restrict', 'to' => 'peripherals_management_restrict', 'default' => 2, 'noindex' => true), array('from' => 'printers_management_restrict', 'to' => 'printers_management_restrict', 'default' => 2, 'noindex' => true), array('from' => 'autoupdate_link_state', 'to' => 'state_autoupdate_mode', 'default' => 0, 'noindex' => true), array('from' => 'autoclean_link_state', 'to' => 'state_autoclean_mode', 'default' => 0, 'noindex' => true), array('from' => 'name_display_order', 'to' => 'names_format', 'default' => 0, 'noindex' => true, 'comments' => 'see *NAME_BEFORE constant in define.php'), array('from' => 'dropdown_limit', 'to' => 'dropdown_chars_limit', 'default' => 50, 'noindex' => true), array('from' => 'smtp_mode', 'to' => 'smtp_mode', 'default' => 0, 'noindex' => true, 'comments' => 'see define.php MAIL_* constant'), array('from' => 'mailgate_filesize_max', 'to' => 'default_mailcollector_filesize_max', 'default' => 2097152, 'noindex' => true)), 'glpi_consumableitems' => array(array('from' => 'alarm', 'to' => 'alarm_threshold', 'default' => 10)), 'glpi_contracts' => array(array('from' => 'duration', 'to' => 'duration', 'default' => 0, 'noindex' => true), array('from' => 'notice', 'to' => 'notice', 'default' => 0, 'noindex' => true), array('from' => 'periodicity', 'to' => 'periodicity', 'default' => 0, 'noindex' => true), array('from' => 'facturation', 'to' => 'billing', 'default' => 0, 'noindex' => true), array('from' => 'device_countmax', 'to' => 'max_links_allowed', 'default' => 0, 'noindex' => true), array('from' => 'alert', 'to' => 'alert', 'default' => 0), array('from' => 'renewal', 'to' => 'renewal', 'default' => 0, 'noindex' => true)), 'glpi_displaypreferences' => array(array('from' => 'num', 'to' => 'num', 'default' => 0), array('from' => 'rank', 'to' => 'rank', 'default' => 0)), 'glpi_events' => array(array('from' => 'level', 'to' => 'level', 'default' => 0)), 'glpi_infocoms' => array(array('from' => 'warranty_duration', 'to' => 'warranty_duration', 'default' => 0, 'noindex' => true), array('from' => 'amort_time', 'to' => 'sink_time', 'default' => 0, 'noindex' => true), array('from' => 'amort_type', 'to' => 'sink_type', 'default' => 0, 'noindex' => true), array('from' => 'alert', 'to' => 'alert', 'default' => 0)), 'glpi_mailingsettings' => array(array('from' => 'item_type', 'to' => 'mailingtype', 'default' => 0, 'noindex' => true, 'comments' => 'see define.php *_MAILING_TYPE constant')),// 'glpi_monitors' => array(array('from' => 'size', 'to' => 'size', 'default' => 0, 'noindex' => true)), 'glpi_printers' => array(array('from' => 'initial_pages', 'to' => 'init_pages_counter', 'default' => 0, 'noindex' => true, 'checkdatas' => true)), 'glpi_profiles' => array(array('from' => 'helpdesk_hardware', 'to' => 'helpdesk_hardware', 'default' => 0, 'noindex' => true)), 'glpi_plugins' => array(array('from' => 'state', 'to' => 'state', 'default' => 0, 'comments' => 'see define.php PLUGIN_* constant')),// 'glpi_reminders' => array(array('from' => 'state', 'to' => 'state', 'default' => 0)), 'glpi_ticketplannings' => array(array('from' => 'state', 'to' => 'state', 'default' => 1)), 'glpi_rulecriterias' => array(array('from' => 'condition', 'to' => 'condition', 'default' => 0, 'comments' => 'see define.php PATTERN_* and REGEX_* constant')),// 'glpi_rules' => array(array('from' => 'sub_type', 'to' => 'sub_type', 'default' => 0, 'comments' => 'see define.php RULE_* constant')),// 'glpi_tickets' => array(array('from' => 'request_type', 'to' => 'request_type', 'default' => 0, 'noindex' => true), array('from' => 'priority', 'to' => 'priority', 'default' => 1, 'noindex' => true)), 'glpi_transfers' => array(array('from' => 'keep_tickets', 'to' => 'keep_ticket', 'default' => 0, 'noindex' => true), array('from' => 'keep_networklinks', 'to' => 'keep_networklink', 'default' => 0, 'noindex' => true), array('from' => 'keep_reservations', 'to' => 'keep_reservation', 'default' => 0, 'noindex' => true), array('from' => 'keep_history', 'to' => 'keep_history', 'default' => 0, 'noindex' => true), array('from' => 'keep_devices', 'to' => 'keep_device', 'default' => 0, 'noindex' => true), array('from' => 'keep_infocoms', 'to' => 'keep_infocom', 'default' => 0, 'noindex' => true), array('from' => 'keep_dc_monitor', 'to' => 'keep_dc_monitor', 'default' => 0, 'noindex' => true), array('from' => 'clean_dc_monitor', 'to' => 'clean_dc_monitor', 'default' => 0, 'noindex' => true), array('from' => 'keep_dc_phone', 'to' => 'keep_dc_phone', 'default' => 0, 'noindex' => true), array('from' => 'clean_dc_phone', 'to' => 'clean_dc_phone', 'default' => 0, 'noindex' => true), array('from' => 'keep_dc_peripheral', 'to' => 'keep_dc_peripheral', 'default' => 0, 'noindex' => true), array('from' => 'clean_dc_peripheral', 'to' => 'clean_dc_peripheral', 'default' => 0, 'noindex' => true), array('from' => 'keep_dc_printer', 'to' => 'keep_dc_printer', 'default' => 0, 'noindex' => true), array('from' => 'clean_dc_printer', 'to' => 'clean_dc_printer', 'default' => 0, 'noindex' => true), array('from' => 'keep_enterprises', 'to' => 'keep_supplier', 'default' => 0, 'noindex' => true), array('from' => 'clean_enterprises', 'to' => 'clean_supplier', 'default' => 0, 'noindex' => true), array('from' => 'keep_contacts', 'to' => 'keep_contact', 'default' => 0, 'noindex' => true), array('from' => 'clean_contacts', 'to' => 'clean_contact', 'default' => 0, 'noindex' => true), array('from' => 'keep_contracts', 'to' => 'keep_contract', 'default' => 0, 'noindex' => true), array('from' => 'clean_contracts', 'to' => 'clean_contract', 'default' => 0, 'noindex' => true), array('from' => 'keep_softwares', 'to' => 'keep_software', 'default' => 0, 'noindex' => true), array('from' => 'clean_softwares', 'to' => 'clean_software', 'default' => 0, 'noindex' => true), array('from' => 'keep_documents', 'to' => 'keep_document', 'default' => 0, 'noindex' => true), array('from' => 'clean_documents', 'to' => 'clean_document', 'default' => 0, 'noindex' => true), array('from' => 'keep_cartridges_type', 'to' => 'keep_cartridgeitem', 'default' => 0, 'noindex' => true), array('from' => 'clean_cartridges_type', 'to' => 'clean_cartridgeitem', 'default' => 0, 'noindex' => true), array('from' => 'keep_cartridges', 'to' => 'keep_cartridge', 'default' => 0, 'noindex' => true), array('from' => 'keep_consumables', 'to' => 'keep_consumable', 'default' => 0, 'noindex' => true)), 'glpi_users' => array(array('from' => 'dateformat', 'to' => 'date_format', 'default' => NULL, 'noindex' => true, 'maybenull' => true), array('from' => 'numberformat', 'to' => 'number_format', 'default' => NULL, 'noindex' => true, 'maybenull' => true), array('from' => 'use_mode', 'to' => 'use_mode', 'default' => 0, 'noindex' => true), array('from' => 'dropdown_limit', 'to' => 'dropdown_chars_limit', 'default' => NULL, 'maybenull' => true, 'noindex' => true))); foreach ($intfields as $table => $tab) { foreach ($tab as $update) { $newname = $update['to']; $oldname = $update['from']; $doindex = true; if (isset($update['noindex']) && $update['noindex']) { $doindex = false; } $default = "DEFAULT NULL"; if (isset($update['default']) && !is_null($update['default'])) { $default = "DEFAULT ".$update['default'].""; } $NULL = "NOT NULL"; if (isset($update['maybenull']) && $update['maybenull']) { $NULL = "NULL"; } $check_datas=false; if (isset($update['checkdatas']) ) { $check_datas=$update['checkdatas']; } $addcomment = ""; if (isset($update['comments']) ) { $addcomment = "COMMENT '".$update['comments']."'"; } // Rename field if (FieldExists($table, $oldname, false)) { if ($check_datas) { $query = "SELECT `id`, `$oldname` FROM `$table`"; if ($result=$DB->query($query)) { if ($DB->numrows($result)>0) { while ($data = $DB->fetch_assoc($result)) { if (empty($data[$oldname]) && isset($update['default'])) { $data[$oldname] = $update['default']; } $query = "UPDATE `$table` SET `$oldname` = '".intval($data[$oldname])."' WHERE `id` = ".$data['id'].""; $DB->query($query); } } } } $changes[$table][] = "CHANGE `$oldname` `$newname` INT( 11 ) $NULL $default $addcomment"; } else { $updateresult = false; $migration->displayWarning("Error: $table.$oldname does not exist.", true); } // If do index : delete old one / create new one if ($doindex) { if (!isIndex($table, $newname)) { $changes[$table][] = "ADD INDEX `$newname` (`$newname`)"; } if ($newname!=$oldname && isIndex($table, $oldname)) { $changes[$table][] = "DROP INDEX `$oldname`"; } } } } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'Clean DB: others field changes')); if (FieldExists('glpi_alerts', 'date', false)) { $changes['glpi_alerts'][] = "CHANGE `date` `date` DATETIME NOT NULL"; } if (FieldExists('glpi_configs', 'date_fiscale', false)) { $changes['glpi_configs'][] = "CHANGE `date_fiscale` `date_tax` DATE NOT NULL DEFAULT '2005-12-31'"; } if (FieldExists('glpi_configs', 'sendexpire', false)) { $changes['glpi_configs'][] = "DROP `sendexpire`"; } if (FieldExists('glpi_configs', 'show_admin_doc', false)) { $changes['glpi_configs'][] = "DROP `show_admin_doc`"; } if (FieldExists('glpi_configs', 'licenses_management_restrict', false)) { $changes['glpi_configs'][] = "DROP `licenses_management_restrict`"; } if (FieldExists('glpi_configs', 'nextprev_item', false)) { $changes['glpi_configs'][] = "DROP `nextprev_item`"; } if (FieldExists('glpi_configs', 'logotxt', false)) { $changes['glpi_configs'][] = "DROP `logotxt`"; } if (FieldExists('glpi_configs', 'num_of_events', false)) { $changes['glpi_configs'][] = "DROP `num_of_events`"; } if (FieldExists('glpi_configs', 'tracking_order', false)) { $changes['glpi_configs'][] = "DROP `tracking_order`"; } if (FieldExists('glpi_contracts', 'bill_type', false)) { $changes['glpi_contracts'][] = "DROP `bill_type`"; } if (FieldExists('glpi_infocoms', 'amort_coeff', false)) { $changes['glpi_infocoms'][] = "CHANGE `amort_coeff` `sink_coeff` FLOAT NOT NULL DEFAULT '0'"; } if (FieldExists('glpi_ocsservers', 'import_software_comments', false)) { $changes['glpi_ocsservers'][] = "DROP `import_software_comments`"; } if (FieldExists('glpi_users', 'nextprev_item', false)) { $changes['glpi_users'][] = "DROP `nextprev_item`"; } if (FieldExists('glpi_users', 'num_of_events', false)) { $changes['glpi_users'][] = "DROP `num_of_events`"; } if (FieldExists('glpi_users', 'tracking_order', false)) { $changes['glpi_users'][] = "DROP `tracking_order`"; } if (FieldExists('glpi_rulerightparameters', 'sub_type', false)) { $changes['glpi_rulerightparameters'][] = "DROP `sub_type`"; } if (FieldExists('glpi_softwares', 'oldstate', false)) { $changes['glpi_softwares'][] = "DROP `oldstate`"; } if (FieldExists('glpi_users', 'password', false)) { $changes['glpi_users'][] = "DROP `password`"; } if (FieldExists('glpi_users', 'password_md5', false)) { $changes['glpi_users'][] = "CHANGE `password_md5` `password` CHAR( 40 ) NULL DEFAULT NULL"; } if (!FieldExists('glpi_mailcollectors', 'filesize_max', false)) { $changes['glpi_mailcollectors'][] = "ADD `filesize_max` INT(11) NOT NULL DEFAULT 2097152"; } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'Clean DB: index management')); if (!isIndex('glpi_alerts', 'unicity')) { $changes['glpi_alerts'][] = "ADD UNIQUE `unicity` (`itemtype`, `items_id`, `type`)"; } if (!isIndex('glpi_cartridges_printermodels', 'unicity')) { $changes['glpi_cartridges_printermodels'][] = "ADD UNIQUE `unicity` (`printermodels_id`, `cartridgeitems_id`)"; } if (!isIndex('glpi_computers_items', 'unicity')) { $changes['glpi_computers_items'][] = "ADD UNIQUE `unicity` (`itemtype`, `items_id`, `computers_id`)"; } if (!isIndex('glpi_contacts_suppliers', 'unicity')) { $changes['glpi_contacts_suppliers'][] = "ADD UNIQUE `unicity` (`suppliers_id`, `contacts_id`)"; } if (!isIndex('glpi_contracts_items', 'unicity')) { $changes['glpi_contracts_items'][] = "ADD UNIQUE `unicity` (`contracts_id`, `itemtype`, `items_id`)"; } if (!isIndex('glpi_contracts_items', 'item')) { $changes['glpi_contracts_items'][] = "ADD INDEX `item` (`itemtype`, `items_id`)"; } if (!isIndex('glpi_contracts_suppliers', 'unicity')) { $changes['glpi_contracts_suppliers'][] = "ADD UNIQUE `unicity` (`suppliers_id`, `contracts_id`)"; } if (!isIndex('glpi_displaypreferences', 'unicity')) { $changes['glpi_displaypreferences'][] = "ADD UNIQUE `unicity` (`users_id`, `itemtype`, `num`)"; } if (!isIndex('glpi_bookmarks_users', 'unicity')) { $changes['glpi_bookmarks_users'][] = "ADD UNIQUE `unicity` (`users_id`, `itemtype`)"; } if (!isIndex('glpi_documents_items', 'unicity')) { $changes['glpi_documents_items'][] = "ADD UNIQUE `unicity` (`documents_id`, `itemtype`, `items_id`)"; } if (!isIndex('glpi_documents_items', 'item')) { $changes['glpi_documents_items'][] = "ADD INDEX `item` (`itemtype`, `items_id`)"; } if (!isIndex('glpi_knowbaseitemcategories', 'unicity')) { $changes['glpi_knowbaseitemcategories'][] = "ADD UNIQUE `unicity` (`knowbaseitemcategories_id`, `name`)"; } if (!isIndex('glpi_locations', 'unicity')) { $changes['glpi_locations'][] = "ADD UNIQUE `unicity` (`entities_id`, `locations_id`, `name`)"; } if (isIndex('glpi_locations', 'name')) { $changes['glpi_locations'][] = "DROP INDEX `name` "; } if (!isIndex('glpi_netpoints', 'complete')) { $changes['glpi_netpoints'][] = "ADD INDEX `complete` (`entities_id`, `locations_id`, `name`)"; } if (!isIndex('glpi_netpoints', 'location_name')) { $changes['glpi_netpoints'][] = "ADD INDEX `location_name` (`locations_id`, `name`)"; } if (!isIndex('glpi_entities', 'unicity')) { $changes['glpi_entities'][] = "ADD UNIQUE `unicity` (`entities_id`, `name`)"; } if (!isIndex('glpi_entitydatas', 'unicity')) { $changes['glpi_entitydatas'][] = "ADD UNIQUE `unicity` (`entities_id`)"; } if (!isIndex('glpi_events', 'item')) { $changes['glpi_events'][] = "ADD INDEX `item` (`type`, `items_id`)"; } if (!isIndex('glpi_infocoms', 'unicity')) { $changes['glpi_infocoms'][] = "ADD UNIQUE `unicity` (`itemtype`, `items_id`)"; } if (!isIndex('glpi_knowbaseitems', 'date_mod')) { $changes['glpi_knowbaseitems'][] = "ADD INDEX `date_mod` (`date_mod`)"; } if (!isIndex('glpi_networkequipments', 'date_mod')) { $changes['glpi_networkequipments'][] = "ADD INDEX `date_mod` (`date_mod`)"; } if (!isIndex('glpi_links_itemtypes', 'unicity')) { $changes['glpi_links_itemtypes'][] = "ADD UNIQUE `unicity` (`itemtype`, `links_id`)"; } if (!isIndex('glpi_mailingsettings', 'unicity')) { $changes['glpi_mailingsettings'][] = "ADD UNIQUE `unicity` (`type`, `items_id`, `mailingtype`)"; } if (!isIndex('glpi_networkports', 'item')) { $changes['glpi_networkports'][] = "ADD INDEX `item` (`itemtype`, `items_id`)"; } if (!isIndex('glpi_networkports_vlans', 'unicity')) { $changes['glpi_networkports_vlans'][] = "ADD UNIQUE `unicity` (`networkports_id`, `vlans_id`)"; } if (!isIndex('glpi_networkports_networkports', 'unicity')) { $changes['glpi_networkports_networkports'][] = "ADD UNIQUE `unicity` (`networkports_id_1`, `networkports_id_2`)"; } if (!isIndex('glpi_ocslinks', 'unicity')) { $changes['glpi_ocslinks'][] = "ADD UNIQUE `unicity` (`ocsservers_id`, `ocsid`)"; } if (!isIndex('glpi_peripherals', 'date_mod')) { $changes['glpi_peripherals'][] = "ADD INDEX `date_mod` (`date_mod`)"; } if (!isIndex('glpi_phones', 'date_mod')) { $changes['glpi_phones'][] = "ADD INDEX `date_mod` (`date_mod`)"; } if (!isIndex('glpi_plugins', 'unicity')) { $changes['glpi_plugins'][] = "ADD UNIQUE `unicity` (`directory`)"; } if (!isIndex('glpi_printers', 'date_mod')) { $changes['glpi_printers'][] = "ADD INDEX `date_mod` (`date_mod`)"; } if (!isIndex('glpi_reminders', 'date_mod')) { $changes['glpi_reminders'][] = "ADD INDEX `date_mod` (`date_mod`)"; } if (!isIndex('glpi_reservationitems', 'item')) { $changes['glpi_reservationitems'][] = "ADD INDEX `item` (`itemtype`, `items_id`)"; } if (!isIndex('glpi_tickets', 'item')) { $changes['glpi_tickets'][] = "ADD INDEX `item` (`itemtype`, `items_id`)"; } if (!isIndex('glpi_documenttypes', 'date_mod')) { $changes['glpi_documenttypes'][] = "ADD INDEX `date_mod` (`date_mod`)"; } if (!isIndex('glpi_documenttypes', 'unicity')) { $changes['glpi_documenttypes'][] = "ADD UNIQUE `unicity` (`ext`)"; } if (!isIndex('glpi_users', 'unicity')) { $changes['glpi_users'][] = "ADD UNIQUE `unicity` (`name`)"; } if (!isIndex('glpi_users', 'date_mod')) { $changes['glpi_users'][] = "ADD INDEX `date_mod` (`date_mod`)"; } if (!isIndex('glpi_users', 'authitem')) { $changes['glpi_users'][] = "ADD INDEX `authitem` (`authtype`, `auths_id`)"; } if (!isIndex('glpi_groups_users', 'unicity')) { $changes['glpi_groups_users'][] = "ADD UNIQUE `unicity` (`users_id`, `groups_id`)"; } $indextodrop = array('glpi_alerts' => array('alert', 'FK_device'), 'glpi_cartridges_printermodels' => array('FK_glpi_type_printer'), 'glpi_computers_items' => array('connect', 'type', 'end1', 'end1_2'), 'glpi_consumables' => array('FK_glpi_cartridges_type'), 'glpi_contacts_suppliers' => array('FK_enterprise'), 'glpi_contracts_items' => array('FK_contract_device', 'device_type'), 'glpi_contracts_suppliers' => array('FK_enterprise'), 'glpi_displaypreferences' => array('display', 'FK_users'), 'glpi_bookmarks_users' => array('FK_users'), 'glpi_documents_items' => array('FK_doc_device', 'device_type', 'FK_device'), 'glpi_knowbaseitemcategories' => array('parentID_2', 'parentID'), 'glpi_locations' => array('FK_entities'), 'glpi_netpoints' => array('FK_entities', 'location'), 'glpi_entities' => array('name'/*,'parentID'*/), 'glpi_entitydatas' => array('FK_entities'), 'glpi_events' => array('comp', 'itemtype'), 'glpi_infocoms' => array('FK_device'), 'glpi_computers_softwareversions' => array('sID'), 'glpi_links_itemtypes' => array('link'), 'glpi_mailingsettings' => array('mailings', 'FK_item'), 'glpi_networkports' => array('device_type'), 'glpi_networkports_vlans' => array('portvlan'), 'glpi_networkports_networkports' => array('netwire', 'end1', 'end1_2'), 'glpi_ocslinks' => array('ocs_server_id'), 'glpi_plugins' => array('name'), 'glpi_reservationitems' => array('reservationitem'), 'glpi_tickets' => array('computer', 'device_type'), 'glpi_documenttypes' => array('extension'), 'glpi_users' => array('name'), 'glpi_groups_users' => array('usergroup')); foreach ($indextodrop as $table => $tab) { foreach ($tab as $indexname) { if (isIndex($table, $indexname)) { $changes[$table][] = "DROP INDEX `$indexname`"; } } } foreach ($changes as $table => $tab) { $migration->displayMessage(sprintf(__('Change of the database layout - %s'), $table)); $query = "ALTER TABLE `$table` ".implode($tab," ,\n").";"; $DB->queryOrDie($query, "0.78 multiple alter in $table"); } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'Update itemtype fields')); // Convert itemtype to Class names $typetoname = array(GENERAL_TYPE => "",// For tickets COMPUTER_TYPE => "Computer", NETWORKING_TYPE => "NetworkEquipment", PRINTER_TYPE => "Printer", MONITOR_TYPE => "Monitor", PERIPHERAL_TYPE => "Peripheral", SOFTWARE_TYPE => "Software", CONTACT_TYPE => "Contact", ENTERPRISE_TYPE => "Supplier", INFOCOM_TYPE => "Infocom", CONTRACT_TYPE => "Contract", CARTRIDGEITEM_TYPE => "CartridgeItem", TYPEDOC_TYPE => "DocumentType", DOCUMENT_TYPE => "Document", KNOWBASE_TYPE => "KnowbaseItem", USER_TYPE => "User", TRACKING_TYPE => "Ticket", CONSUMABLEITEM_TYPE => "ConsumableItem", CONSUMABLE_TYPE => "Consumable", CARTRIDGE_TYPE => "Cartridge", SOFTWARELICENSE_TYPE => "SoftwareLicense", LINK_TYPE => "Link", STATE_TYPE => "States", PHONE_TYPE => "Phone", DEVICE_TYPE => "Device", REMINDER_TYPE => "Reminder", STAT_TYPE => "Stat", GROUP_TYPE => "Group", ENTITY_TYPE => "Entity", RESERVATION_TYPE => "ReservationItem", AUTHMAIL_TYPE => "AuthMail", AUTHLDAP_TYPE => "AuthLDAP", OCSNG_TYPE => "OcsServer", REGISTRY_TYPE => "RegistryKey", PROFILE_TYPE => "Profile", MAILGATE_TYPE => "MailCollector", RULE_TYPE => "Rule", TRANSFER_TYPE => "Transfer", BOOKMARK_TYPE => "Bookmark", SOFTWAREVERSION_TYPE => "SoftwareVersion", PLUGIN_TYPE => "Plugin", COMPUTERDISK_TYPE => "ComputerDisk", NETWORKING_PORT_TYPE => "NetworkPort", FOLLOWUP_TYPE => "TicketFollowup", BUDGET_TYPE => "Budget"); // End is not used in 0.72.x $devtypetoname = array(MOBOARD_DEVICE => 'DeviceMotherboard', PROCESSOR_DEVICE => 'DeviceProcessor', RAM_DEVICE => 'DeviceMemory', HDD_DEVICE => 'DeviceHardDrive', NETWORK_DEVICE => 'DeviceNetworkCard', DRIVE_DEVICE => 'DeviceDrive', CONTROL_DEVICE => 'DeviceControl', GFX_DEVICE => 'DeviceGraphicCard', SND_DEVICE => 'DeviceSoundCard', PCI_DEVICE => 'DevicePci', CASE_DEVICE => 'DeviceCase', POWER_DEVICE => 'DevicePowerSupply'); $itemtype_tables = array("glpi_alerts", "glpi_bookmarks", "glpi_bookmarks_users", "glpi_computers_items", "glpi_contracts_items", "glpi_displaypreferences", "glpi_documents_items", "glpi_infocoms", "glpi_links_itemtypes", "glpi_networkports", "glpi_reservationitems", "glpi_tickets"); foreach ($itemtype_tables as $table) { $migration->displayMessage(sprintf(__('Data migration - %s'), "$table")); // Updating data // Alter itemtype field $query = "ALTER TABLE `$table` CHANGE `itemtype` `itemtype` VARCHAR( 100 ) NOT NULL"; $DB->queryOrDie($query, "0.78 alter itemtype of table $table"); // Update values foreach ($typetoname as $key => $val) { $query = "UPDATE `$table` SET `itemtype` = '$val' WHERE `itemtype` = '$key'"; $DB->queryOrDie($query, "0.78 update itemtype of table $table for $val"); } } if (FieldExists('glpi_logs', 'device_type', false)) { // History migration, handled separatly for optimization $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'glpi_logs - 1')); $query = "ALTER TABLE `glpi_logs` CHANGE `ID` `id` INT( 11 ) NOT NULL AUTO_INCREMENT, ADD `itemtype` VARCHAR(100) NOT NULL DEFAULT '' AFTER `device_type`, ADD `items_id` INT( 11 ) NOT NULL DEFAULT '0' AFTER `itemtype`, ADD `itemtype_link` VARCHAR(100) NOT NULL DEFAULT '' AFTER `device_internal_type`, CHANGE `linked_action` `linked_action` INT( 11 ) NOT NULL DEFAULT '0' COMMENT 'see define.php HISTORY_* constant'"; $DB->queryOrDie($query, "0.78 add item* fields to table glpi_logs"); // Update values $migration->displayMessage(sprintf(__('Data migration - %s'), 'glpi_logs')); // Copy data $query = "UPDATE `glpi_logs` SET `itemtype` = `device_type`, `items_id` = `FK_glpi_device`, `itemtype_link` = `device_internal_type`"; $DB->queryOrDie($query, "0.78 update glpi_logs default values"); foreach ($typetoname as $key => $val) { $query = "UPDATE `glpi_logs` SET `itemtype` = '$val' WHERE `device_type` = '$key'"; $DB->queryOrDie($query, "0.78 update itemtype of table glpi_logs for $val"); $query = "UPDATE `glpi_logs` SET `itemtype_link` = '$val' WHERE `device_internal_type` = '$key' AND `linked_action` IN (".Log::HISTORY_ADD_RELATION.", ".Log::HISTORY_DEL_RELATION.", ".Log::HISTORY_DISCONNECT_DEVICE.", ".Log::HISTORY_CONNECT_DEVICE.")"; $DB->queryOrDie($query, "0.78 update itemtype of table glpi_logs for $val"); } foreach ($devtypetoname as $key => $val) { $query = "UPDATE `glpi_logs` SET `itemtype_link` = '$val' WHERE `device_internal_type` = '$key' AND `linked_action` IN (".Log::HISTORY_ADD_DEVICE.", ".Log::HISTORY_UPDATE_DEVICE.", ".Log::HISTORY_DELETE_DEVICE.")"; $DB->queryOrDie($query, "0.78 update itemtype of table glpi_logs for $val"); } // Clean link $query = "UPDATE `glpi_logs` SET `itemtype_link` = '' WHERE `itemtype_link` = '0'"; $DB->queryOrDie($query, "0.78 update itemtype of table glpi_logs"); $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'glpi_logs - 2')); $query = "ALTER TABLE `glpi_logs` DROP `device_type`, DROP `FK_glpi_device`, DROP `device_internal_type`, ADD INDEX `itemtype_link` (`itemtype_link`), ADD INDEX `item` (`itemtype`,`items_id`)"; $DB->queryOrDie($query, "0.78 drop device* fields to table glpi_logs"); } // Update glpi_profiles item_type $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'Clean DB: post actions after renaming')); if (!isIndex('glpi_locations', 'name')) { $query = " ALTER TABLE `glpi_locations` ADD INDEX `name` (`name`)"; $DB->queryOrDie($query, "0.78 add name index in glpi_locations"); } // Update values of mailcollectors $query = "SELECT `default_mailcollector_filesize_max` FROM `glpi_configs` WHERE `id` = 1"; if ($result=$DB->query($query)) { if ($DB->numrows($result)>0) { $query = "UPDATE `glpi_mailcollectors` SET `filesize_max` = '".$DB->result($result,0,0)."';"; $DB->query($query); } } // For compatiblity with updates from past versions regenerateTreeCompleteName("glpi_locations"); regenerateTreeCompleteName("glpi_knowbaseitemcategories"); regenerateTreeCompleteName("glpi_ticketcategories"); // Update timezone values if (FieldExists('glpi_configs', 'time_offset', false)) { $query = "UPDATE `glpi_configs` SET `time_offset` = `time_offset`*3600"; $DB->queryOrDie($query, "0.78 update time_offset value in glpi_configs"); } if (FieldExists('glpi_authldaps', 'time_offset', false)) { $query = "UPDATE `glpi_authldaps` SET `time_offset` = `time_offset`*3600"; $DB->queryOrDie($query, "0.78 update time_offset value in glpi_authldaps"); } // Change defaults store values : if (FieldExists('glpi_softwares', 'sofwtares_id', false)) { $query = "UPDATE `glpi_softwares` SET `sofwtares_id` = 0 WHERE `sofwtares_id` < 0"; $DB->queryOrDie($query, "0.78 update default value of sofwtares_id in glpi_softwares"); } if (FieldExists('glpi_users', 'authtype', false)) { $query = "UPDATE `glpi_users` SET `authtype` = 0 WHERE `authtype` < 0"; $DB->queryOrDie($query, "0.78 update default value of authtype in glpi_users"); } if (FieldExists('glpi_users', 'auths_id', false)) { $query = "UPDATE `glpi_users` SET `auths_id` = 0 WHERE `auths_id` < 0"; $DB->queryOrDie($query, "0.78 update default value of auths_id in glpi_users"); } // Update glpi_ocsadmininfoslinks table for new field name if (FieldExists('glpi_ocsadmininfoslinks', 'glpi_column', false)) { $query = "UPDATE `glpi_ocsadmininfoslinks` SET `glpi_column` = 'locations_id' WHERE `glpi_column` = 'location'"; $DB->queryOrDie($query, "0.78 update value of glpi_column in glpi_ocsadmininfoslinks"); $query = "UPDATE `glpi_ocsadmininfoslinks` SET `glpi_column` = 'networks_id' WHERE `glpi_column` = 'network'"; $DB->queryOrDie($query, "0.78 update value of glpi_column in glpi_ocsadmininfoslinks"); $query = "UPDATE `glpi_ocsadmininfoslinks` SET `glpi_column` = 'groups_id' WHERE `glpi_column` = 'FK_groups'"; $DB->queryOrDie($query, "0.78 update value of glpi_column in glpi_ocsadmininfoslinks"); } // Update bookmarks for new columns fields if (FieldExists('glpi_bookmarks', 'is_private', false)) { $query = "UPDATE `glpi_bookmarks` SET `entities_id` = -1 WHERE `is_private` = 1"; $DB->queryOrDie($query, "0.78 update value of entities_id in glpi_bookmarks"); } if (FieldExists('glpi_reminders', 'is_private', false)) { $query = "UPDATE `glpi_reminders` SET `entities_id` = -1 WHERE `is_private` = 1"; $DB->queryOrDie($query, "0.78 update value of entities_id in glpi_reminders"); } // Update bookmarks for new columns fields if (FieldExists('glpi_bookmarks', 'query', false)) { // All search $olds = array("deleted"); $news = array("is_deleted"); foreach ($olds as $key => $val) { $olds[$key] = "/&$val=/"; } foreach ($news as $key => $val) { $news[$key] = "/&$val=/"; } // Manage meta search foreach ($typetoname as $key => $val) { $olds[$key] = "/&type2\[(\d+)\]=$key/"; $news[$key] = "&itemtype2[\\1]=$val"; } $query = "SELECT `id`, `query` FROM `glpi_bookmarks` WHERE `type` = ".Bookmark::SEARCH." "; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { while ($data = $DB->fetch_assoc($result)) { $query2 = "UPDATE `glpi_bookmarks` SET `query` = '".addslashes(preg_replace($olds, $news, $data['query']))."' WHERE `id` = ".$data['id'].""; $DB->queryOrDie($query2, "0.78 update all bookmarks"); } } } // Update bookmarks due to FHS change $query2 = "UPDATE `glpi_bookmarks` SET `path` = 'front/documenttype.php' WHERE `path` = 'front/typedoc.php'"; $DB->queryOrDie($query2, "0.78 update typedoc bookmarks"); $query2 = "UPDATE `glpi_bookmarks` SET `path` = 'front/consumableitem.php' WHERE `path` = 'front/consumable.php'"; $DB->queryOrDie($query2, "0.78 update consumable bookmarks"); $query2 = "UPDATE `glpi_bookmarks` SET `path` = 'front/cartridgeitem.php' WHERE `path` = 'front/cartridge.php'"; $DB->queryOrDie($query2, "0.78 update cartridge bookmarks"); $query2 = "UPDATE `glpi_bookmarks` SET `path` = 'front/ticket.php' WHERE `path` = 'front/tracking.php'"; $DB->queryOrDie($query2, "0.78 update ticket bookmarks"); $query2 = "UPDATE `glpi_bookmarks` SET `path` = 'front/mailcollector.php' WHERE `path` = 'front/mailgate.php'"; $DB->queryOrDie($query2, "0.78 update mailcollector bookmarks"); $query2 = "UPDATE `glpi_bookmarks` SET `path` = 'front/ocsserver.php' WHERE `path` = 'front/setup.ocsng.php'"; $DB->queryOrDie($query2, "0.78 update ocsserver bookmarks"); $query2 = "UPDATE `glpi_bookmarks` SET `path` = 'front/supplier.php' WHERE `path` = 'front/enterprise.php'"; $DB->queryOrDie($query2, "0.78 update supplier bookmarks"); $query2 = "UPDATE `glpi_bookmarks` SET `path` = 'front/networkequipment.php' WHERE `path` = 'front/networking.php'"; $DB->queryOrDie($query2, "0.78 update networkequipment bookmarks"); $query2 = "UPDATE `glpi_bookmarks` SET `path` = 'front/states.php' WHERE `path` = 'front/state.php'"; $DB->queryOrDie($query2, "0.78 update states bookmarks"); } //// Upgrade rules datas $changes = array(); // For Rule::RULE_AFFECT_RIGHTS $changes[1] = array('FK_entities' => 'entities_id', 'FK_profiles' => 'profiles_id', 'recursive' => 'is_recursive', 'active' => 'is_active'); // For Rule::RULE_DICTIONNARY_SOFTWARE $changes[4] = array('helpdesk_visible '=> 'is_helpdesk_visible'); // For Rule::RULE_OCS_AFFECT_COMPUTER $changes[0] = array('FK_entities' => 'entities_id'); // For Rule::RULE_SOFTWARE_CATEGORY $changes[3] = array('category' => 'softwarecategories_id', 'comment' => 'comment'); // For Rule::RULE_TRACKING_AUTO_ACTION $changes[2] = array('category' => 'ticketcategories_id', 'author' => 'users_id', 'author_location' => 'users_locations', 'FK_group' => 'groups_id', 'assign' => 'users_id_assign', 'assign_group' => 'groups_id_assign', 'device_type' => 'itemtype', 'FK_entities' => 'entities_id', 'contents' => 'content', 'request_type' => 'requesttypes_id'); $DB->query("SET SESSION group_concat_max_len = 9999999;"); foreach ($changes as $ruletype => $tab) { // Get rules $query = "SELECT GROUP_CONCAT(`id`) FROM `glpi_rules` WHERE `sub_type` = ".$ruletype." GROUP BY `sub_type`"; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { // Get rule string $rules=$DB->result($result,0,0); // Update actions foreach ($tab as $old => $new) { $query = "UPDATE `glpi_ruleactions` SET `field` = '$new' WHERE `field` = '$old' AND `rules_id` IN ($rules);"; $DB->queryOrDie($query, "0.78 update datas for rules actions"); } // Update criterias foreach ($tab as $old => $new) { $query = "UPDATE `glpi_rulecriterias` SET `criteria` = '$new' WHERE `criteria` = '$old' AND `rules_id` IN ($rules);"; $DB->queryOrDie($query, "0.78 update datas for rules criterias"); } } } } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'glpi_rulecachesoftwares')); $query = "ALTER TABLE `glpi_rules` CHANGE `sub_type` `sub_type` VARCHAR( 255 ) NOT NULL DEFAULT ''"; $DB->queryOrDie($query, "0.78 change subtype from INT(11) to VARCHAR(255) in glpi_rules"); $subtypes = array (0 => 'RuleOcs', 1 => 'RuleRight', 2 => 'RuleTicket', 3 => 'RuleSoftwareCategory', 4 => 'RuleDictionnarySoftware', 5 => 'RuleDictionnaryManufacturer', 6 => 'RuleDictionnaryComputerModel', 7 => 'RuleDictionnaryComputerType', 8 => 'RuleDictionnaryMonitorModel', 9 => 'RuleDictionnaryMonitorType', 10 => 'RuleDictionnaryPrinterModel', 11 => 'RuleDictionnaryPrinterType', 12 => 'RuleDictionnaryPhoneModel', 13 => 'RuleDictionnaryPhoneType', 14 => 'RuleDictionnaryPeripheralModel', 15 => 'RuleDictionnaryPeripheralType', 16 => 'RuleDictionnaryNetworkEquipmentModel', 17 => 'RuleDictionnaryNetworkEquipmentType', 18 => 'RuleDictionnaryOperatingSystem', 19 => 'RuleDictionnaryOperatingSystemServicePack', 20 => 'RuleDictionnaryOperatingSystemVersion', 21 => 'RuleMailCollector'); foreach ($subtypes as $old_subtype => $new_subtype) { $query = "UPDATE `glpi_rules` SET `sub_type` = '$new_subtype' WHERE `sub_type` = '$old_subtype'"; $DB->queryOrDie($query, "0.78 change sub_type $old_subtype in $new_subtype in glpi_rules"); } $DB->queryOrDie($query, "0.78 update itemtypes in business rules"); //Update business rules itemtypes foreach ($typetoname as $key => $val) { if ($key != GENERAL_TYPE) { $query = "UPDATE `glpi_rulecriterias` SET `pattern` = '$val' WHERE `pattern` = '$key' AND `criteria` = 'itemtype'"; $DB->queryOrDie($query, "0.78 update itemtype for business rules for $val"); } } if (FieldExists("glpi_rulecachesoftwares","ignore_ocs_import", false)) { $query = "ALTER TABLE `glpi_rulecachesoftwares` CHANGE `ignore_ocs_import` `ignore_ocs_import` CHAR( 1 ) NULL DEFAULT NULL "; $DB->queryOrDie($query, "0.78 alter table glpi_rulecachesoftwares"); } if (!FieldExists("glpi_rulecachesoftwares","is_helpdesk_visible", false)) { $query = "ALTER TABLE `glpi_rulecachesoftwares` ADD `is_helpdesk_visible` CHAR( 1 ) NULL "; $DB->queryOrDie($query, "0.78 add is_helpdesk_visible in glpi_rulecachesoftwares"); } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'glpi_entities')); if (!FieldExists("glpi_entities","sons_cache", false)) { $query = "ALTER TABLE `glpi_entities` ADD `sons_cache` LONGTEXT NULL ; "; $DB->queryOrDie($query, "0.78 add sons_cache field in glpi_entities"); } if (!FieldExists("glpi_entities","ancestors_cache", false)) { $query = "ALTER TABLE `glpi_entities` ADD `ancestors_cache` LONGTEXT NULL ; "; $DB->queryOrDie($query, "0.78 add ancestors_cache field in glpi_entities"); } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'glpi_configs')); if (!FieldExists("glpi_configs","default_graphtype", false)) { $query = "ALTER TABLE `glpi_configs` ADD `default_graphtype` char( 3 ) NOT NULL DEFAULT 'svg'"; $DB->queryOrDie($query, "0.78 add default_graphtype in glpi_configs"); } if (FieldExists('glpi_configs', 'license_deglobalisation', false)) { $query = "ALTER TABLE `glpi_configs` DROP `license_deglobalisation`;"; $DB->queryOrDie($query, "0.78 alter clean glpi_configs table"); } if (FieldExists("glpi_configs","use_cache", false)) { $query = "ALTER TABLE `glpi_configs` DROP `use_cache`;"; $DB->queryOrDie($query, "0.78 drop use_cache in glpi_configs"); } if (FieldExists("glpi_configs","cache_max_size", false)) { $query = "ALTER TABLE `glpi_configs` DROP `cache_max_size`;"; $DB->queryOrDie($query, "0.78 drop cache_max_size in glpi_configs"); } if (!FieldExists("glpi_configs","default_request_type", false)) { $query = "ALTER TABLE `glpi_configs` ADD `default_request_type` INT( 11 ) NOT NULL DEFAULT 1"; $DB->queryOrDie($query, "0.78 add default_request_type in glpi_configs"); } if (!FieldExists("glpi_users","default_request_type", false)) { $query = "ALTER TABLE `glpi_users` ADD `default_request_type` INT( 11 ) NULL"; $DB->queryOrDie($query, "0.78 add default_request_type in glpi_users"); } if (!FieldExists("glpi_configs","use_noright_users_add", false)) { $query = "ALTER TABLE `glpi_configs` ADD `use_noright_users_add` tinyint( 1 ) NOT NULL DEFAULT '1'"; $DB->queryOrDie($query, "0.78 add use_noright_users_add in glpi_configs"); } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'glpi_budgets')); if (!FieldExists("glpi_profiles","budget", false)) { $query = "ALTER TABLE `glpi_profiles` ADD `budget` CHAR( 1 ) NULL "; $DB->queryOrDie($query, "0.78 add budget in glpi_profiles"); $query = "UPDATE `glpi_profiles` SET `budget` = `infocom`"; $DB->queryOrDie($query, "0.78 update default budget rights"); } if (!FieldExists("glpi_budgets","is_recursive", false)) { $query = "ALTER TABLE `glpi_budgets` ADD `is_recursive` tinyint(1) NOT NULL DEFAULT '0' AFTER `name`, ADD INDEX `is_recursive` (`is_recursive`)"; $DB->queryOrDie($query, "0.78 add is_recursive field in glpi_budgets"); // budgets in 0.72 were global $query = "UPDATE `glpi_budgets` SET `is_recursive` = '1';"; $DB->queryOrDie($query, "0.78 set is_recursive to true in glpi_budgets"); } if (!FieldExists("glpi_budgets","entities_id", false)) { $query = "ALTER TABLE `glpi_budgets` ADD `entities_id` int(11) NOT NULL default '0' AFTER `name`, ADD INDEX `entities_id` (`entities_id`);"; $DB->queryOrDie($query, "0.78 add entities_id field in glpi_budgets"); } if (!FieldExists("glpi_budgets","is_deleted", false)) { $query = "ALTER TABLE `glpi_budgets` ADD `is_deleted` tinyint(1) NOT NULL DEFAULT '0', ADD INDEX `is_deleted` (`is_deleted`)"; $DB->queryOrDie($query, "0.78 add is_deleted field in glpi_budgets"); } if (!FieldExists("glpi_budgets","begin_date", false)) { $query = "ALTER TABLE `glpi_budgets` ADD `begin_date` DATE NULL, ADD INDEX `begin_date` (`begin_date`)"; $DB->queryOrDie($query, "0.78 add begin_date field in glpi_budgets"); } if (!FieldExists("glpi_budgets","end_date", false)) { $query = "ALTER TABLE `glpi_budgets` ADD `end_date` DATE NULL, ADD INDEX `end_date` (`begin_date`)"; $DB->queryOrDie($query, "0.78 add end_date field in glpi_budgets"); } if (!FieldExists("glpi_budgets","value", false)) { $query = "ALTER TABLE `glpi_budgets` ADD `value` DECIMAL( 20, 4 ) NOT NULL default '0.0000'"; $DB->queryOrDie($query, "0.78 add value field in glpi_budgets"); } if (!FieldExists("glpi_budgets","is_template", false)) { $query = "ALTER TABLE `glpi_budgets` ADD `is_template` tinyint(1) NOT NULL default '0', ADD INDEX `is_template` (`is_template`);"; $DB->queryOrDie($query, "0.78 add is_template field in glpi_budgets"); } if (!FieldExists("glpi_budgets","template_name", false)) { $query = "ALTER TABLE `glpi_budgets` ADD `template_name` varchar(255) default NULL"; $DB->queryOrDie($query, "0.78 add template_name field in glpi_budgets"); } if (!FieldExists("glpi_budgets","date_mod", false)) { $query = "ALTER TABLE `glpi_budgets` ADD `date_mod` DATETIME NULL, ADD INDEX `date_mod` (`date_mod`)"; $DB->queryOrDie($query, "0.78 add date_mod field in glpi_budgets"); } if (!FieldExists("glpi_budgets","notepad", false)) { $query = "ALTER TABLE `glpi_budgets` ADD `notepad` LONGTEXT NULL collate utf8_unicode_ci"; $DB->queryOrDie($query, "0.78 add notepad field in glpi_budgets"); } // Change budget search pref : date_mod $ADDTODISPLAYPREF['Budget']=array(2,3,4,19); $migration->displayMessage(sprintf(__('Change of the database layout - %s'), __('Automatic action'))); if (!TableExists('glpi_crontasks')) { $query = "CREATE TABLE `glpi_crontasks` ( `id` int(11) NOT NULL AUTO_INCREMENT, `itemtype` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `name` varchar(150) COLLATE utf8_unicode_ci NOT NULL COMMENT 'task name', `frequency` int(11) NOT NULL COMMENT 'second between launch', `param` int(11) DEFAULT NULL COMMENT 'task specify parameter', `state` int(11) NOT NULL DEFAULT '1' COMMENT '0:disabled, 1:waiting, 2:running', `mode` int(11) NOT NULL DEFAULT '1' COMMENT '1:internal, 2:external', `allowmode` int(11) NOT NULL DEFAULT '3' COMMENT '1:internal, 2:external, 3:both', `hourmin` int(11) NOT NULL DEFAULT '0', `hourmax` int(11) NOT NULL DEFAULT '24', `logs_lifetime` int(11) NOT NULL DEFAULT '30' COMMENT 'number of days', `lastrun` datetime DEFAULT NULL COMMENT 'last run date', `lastcode` int(11) DEFAULT NULL COMMENT 'last run return code', `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`itemtype`,`name`), KEY `mode` (`mode`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Task run by internal / external cron.';"; $DB->queryOrDie($query, "0.78 create glpi_crontasks"); $query = "INSERT INTO `glpi_crontasks` (`itemtype`, `name`, `frequency`, `param`, `state`, `mode`, `allowmode`, `hourmin`, `hourmax`, `logs_lifetime`, `lastrun`, `lastcode`, `comment`) VALUES ('OcsServer', 'ocsng', 300, NULL, 1, 1, 3, 0, 24, 30, NULL, NULL, NULL), ('CartridgeItem', 'cartridge', 86400, 10, 0, 1, 3, 0, 24, 30, NULL, NULL, NULL), ('ConsumableItem', 'consumable', 86400, 10, 0, 1, 3, 0, 24, 30, NULL, NULL, NULL), ('SoftwareLicense', 'software', 86400, NULL, 0, 1, 3, 0, 24, 30, NULL, NULL, NULL), ('Contract', 'contract', 86400, NULL, 1, 1, 3, 0, 24, 30, NULL, NULL, NULL), ('InfoCom', 'infocom', 86400, NULL, 1, 1, 3, 0, 24, 30, NULL, NULL, NULL), ('CronTask', 'logs', 86400, 10, 1, 1, 3, 0, 24, 30, NULL, NULL, NULL), ('CronTask', 'optimize', 604800, NULL, 1, 1, 3, 0, 24, 30, NULL, NULL, NULL), ('MailCollector', 'mailgate', 600, 10, 1, 1, 3, 0, 24, 30, NULL, NULL, NULL), ('DBconnection', 'checkdbreplicate', 300, NULL, 0, 1, 3, 0, 24, 30, NULL, NULL, NULL), ('CronTask', 'checkupdate', 604800, NULL, 0, 1, 3, 0, 24, 30, NULL, NULL, NULL), ('CronTask', 'session', 86400, NULL, 1, 1, 3, 0, 24, 30, NULL, NULL, NULL), ('CronTask', 'graph', 3600, NULL, 1, 1, 3, 0, 24, 30, NULL, NULL, NULL), ('ReservationItem', 'reservation', 3600, NULL, 1, 1, 3, 0, 24, 30, NULL, NULL, NULL), ('Ticket', 'closeticket', '43200', NULL, '1', '1', '3', '0', '24', '30', NULL, NULL, NULL), ('Ticket', 'alertnotclosed', '43200', NULL, '1', '1', '3', '0', '24', '30', NULL, NULL, NULL)"; $DB->queryOrDie($query, "0.78 populate glpi_crontasks"); } $ADDTODISPLAYPREF['Crontask'] = array(8, 3, 4, 7); if (!TableExists('glpi_crontasklogs')) { $query = "CREATE TABLE `glpi_crontasklogs` ( `id` int(11) NOT NULL AUTO_INCREMENT, `crontasks_id` int(11) NOT NULL, `crontasklogs_id` int(11) NOT NULL COMMENT 'id of ''start'' event', `date` datetime NOT NULL, `state` int(11) NOT NULL COMMENT '0:start, 1:run, 2:stop', `elapsed` float NOT NULL COMMENT 'time elapsed since start', `volume` int(11) NOT NULL COMMENT 'for statistics', `content` varchar(255) COLLATE utf8_unicode_ci NULL COMMENT 'message', PRIMARY KEY (`id`), KEY `date` (`date`), KEY `crontasks_id` (`crontasks_id`), KEY `crontasklogs_id_state` (`crontasklogs_id`,`state`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;"; $DB->queryOrDie($query, "0.78 create glpi_crontasklogs"); } // Retrieve core task lastrun date $tasks = array('ocsng', 'cartridge', 'consumable', 'software', 'contract', 'infocom', 'logs', 'optimize', 'mailgate', 'DBConnection', 'check_update', 'session'); foreach ($tasks as $task) { $lock=GLPI_CRON_DIR. '/' . $task . '.lock'; if (is_readable($lock) && $stat=stat($lock)) { $DB->query("UPDATE `glpi_crontasks` SET `lastrun` = '".date('Y-m-d H:i:s',$stat['mtime'])."' WHERE `name` = '$task'"); unlink($lock); } } // Clean plugin lock foreach (glob(GLPI_CRON_DIR. '/*.lock') as $lock) { unlink($lock); } // disable ocsng cron if not activate if (FieldExists('glpi_configs','use_ocs_mode', false)) { $query = "SELECT `use_ocs_mode` FROM `glpi_configs` WHERE `id` = 1"; if ($result=$DB->query($query)) { if ($DB->numrows($result)>0) { $value = $DB->result($result,0,0); if ($value==0) { $query = "UPDATE `glpi_crontasks` SET `state`='0' WHERE `name` = 'ocsng'"; $DB->query($query); } } } } // Move glpi_config.expire_events to glpi_crontasks.param if (FieldExists('glpi_configs','expire_events', false)) { $query = "SELECT `expire_events` FROM `glpi_configs` WHERE `id` = 1"; if ($result=$DB->query($query)) { if ($DB->numrows($result)>0) { $value = $DB->result($result,0,0); if ($value>0) { $query = "UPDATE `glpi_crontasks` SET `state` = '1', `param` = '$value' WHERE `name` = 'logs'"; } else { $query = "UPDATE `glpi_crontasks` SET `state` = '0' WHERE `name` = 'logs'"; } $DB->query($query); } } $query = "ALTER TABLE `glpi_configs` DROP `expire_events`"; $DB->queryOrDie($query, "0.78 drop expire_events in glpi_configs"); } // Move glpi_config.auto_update_check to glpi_crontasks.state if (FieldExists('glpi_configs','auto_update_check', false)) { $query = "SELECT `auto_update_check` FROM `glpi_configs` WHERE `id` = 1"; if ($result=$DB->query($query)) { if ($DB->numrows($result)>0) { $value = $DB->result($result,0,0); if ($value>0) { $value *= DAY_TIMESTAMP; $query = "UPDATE `glpi_crontasks` SET `state` = '1', `frequency` = '$value' WHERE `name` = 'check_update'"; } else { $query = "UPDATE `glpi_crontasks` SET `state` = '0' WHERE `name` = 'logs'"; } $DB->query($query); } } $query = "ALTER TABLE `glpi_configs` DROP `auto_update_check`"; $DB->queryOrDie($query, "0.78 drop auto_update_check in check_update"); } if (FieldExists('glpi_configs','dbreplicate_maxdelay', false)) { $query = "SELECT `dbreplicate_maxdelay` FROM `glpi_configs` WHERE `id` = 1"; if ($result=$DB->query($query)) { if ($DB->numrows($result)>0) { $value = $DB->result($result,0,0); $value = intval($value/60); $query = "UPDATE `glpi_crontasks` SET `state` = '1', `frequency` = '$value' WHERE `name` = 'check_dbreplicate'"; $DB->query($query); } } $query = "ALTER TABLE `glpi_configs` DROP `dbreplicate_maxdelay`"; $DB->queryOrDie($query, "0.78 drop dbreplicate_maxdelay in check_update"); } if (FieldExists('glpi_configs','dbreplicate_notify_desynchronization', false)) { $query = "ALTER TABLE `glpi_configs` DROP `dbreplicate_notify_desynchronization`"; $DB->queryOrDie($query, "0.78 drop dbreplicate_notify_desynchronization in check_update"); } if (!FieldExists('glpi_configs','cron_limit', false)) { $query = "ALTER TABLE `glpi_configs` ADD `cron_limit` TINYINT NOT NULL DEFAULT '1' COMMENT 'Number of tasks execute by external cron'"; $DB->queryOrDie($query, "0.78 add cron_limit in glpi_configs"); } if (!FieldExists('glpi_documents','sha1sum', false)) { $query = "ALTER TABLE `glpi_documents` ADD `sha1sum` CHAR(40) NULL DEFAULT NULL , ADD INDEX `sha1sum` (`sha1sum`)"; $DB->queryOrDie($query, "0.78 add sha1sum in glpi_documents"); } if (FieldExists('glpi_documents','filename', false)) { $query = "ALTER TABLE `glpi_documents` CHANGE `filename` `filename` VARCHAR( 255 ) NULL DEFAULT NULL COMMENT 'for display and transfert'"; $DB->queryOrDie($query, "0.78 alter filename in glpi_documents"); } if (!FieldExists('glpi_documents','filepath', false)) { $query = "ALTER TABLE `glpi_documents` ADD `filepath` VARCHAR( 255 ) NULL COMMENT 'file storage path' AFTER `filename`"; $DB->queryOrDie($query, "0.78 add filepath in glpi_documents"); $query = "UPDATE `glpi_documents` SET `filepath` = `filename`"; $DB->queryOrDie($query, "0.78 set value of filepath in glpi_documents"); } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'Category of tickets')); if (!FieldExists('glpi_tickets','solvedate', false)) { $query = "ALTER TABLE `glpi_tickets` ADD `solvedate` datetime default NULL AFTER `closedate`, ADD INDEX `solvedate` (`solvedate`)"; $DB->queryOrDie($query, "0.78 add solvedate to glpi_tickets"); $query = "UPDATE `glpi_tickets` SET `solvedate` = `closedate`"; $DB->queryOrDie($query, "0.78 update solvedate values in glpi_tickets"); } if (!FieldExists('glpi_ticketcategories','entities_id', false)) { $query = "ALTER TABLE `glpi_ticketcategories` ADD `entities_id` INT NOT NULL DEFAULT '0' AFTER `id`, ADD `is_recursive` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `entities_id`, ADD INDEX `entities_id` (`entities_id`), ADD INDEX `is_recursive` (`is_recursive`)"; $DB->queryOrDie($query, "0.78 add entities_id,is_recursive in glpi_ticketcategories "); // Set existing categories recursive global $query = "UPDATE `glpi_ticketcategories` SET `is_recursive` = '1'"; $DB->queryOrDie($query, "0.78 set value of is_recursive in glpi_ticketcategories"); } if (!FieldExists('glpi_ticketcategories','knowbaseitemcategories_id', false)) { $query = "ALTER TABLE `glpi_ticketcategories` ADD `knowbaseitemcategories_id` INT NOT NULL DEFAULT '0', ADD INDEX `knowbaseitemcategories_id` ( `knowbaseitemcategories_id` )"; $DB->queryOrDie($query, "0.78 add knowbaseitemcategories_id in glpi_ticketcategories"); } if (!FieldExists('glpi_ticketcategories','users_id', false)) { $query = "ALTER TABLE `glpi_ticketcategories` ADD `users_id` INT NOT NULL DEFAULT '0', ADD INDEX `users_id` ( `users_id` ) "; $DB->queryOrDie($query, "0.78 add users_id in glpi_ticketcategories"); } if (!FieldExists('glpi_ticketcategories','groups_id', false)) { $query = "ALTER TABLE `glpi_ticketcategories` ADD `groups_id` INT NOT NULL DEFAULT '0', ADD INDEX `groups_id` ( `groups_id` ) "; $DB->queryOrDie($query, "0.78 add groups_id in glpi_ticketcategories"); } if (!FieldExists('glpi_ticketcategories','ancestors_cache', false)) { $query = "ALTER TABLE `glpi_ticketcategories` ADD `ancestors_cache` LONGTEXT NULL, ADD `sons_cache` LONGTEXT NULL"; $DB->queryOrDie($query, "0.78 add cache in glpi_ticketcategories"); } if (!FieldExists('glpi_ticketcategories','is_helpdeskvisible', false)) { $query = "ALTER TABLE `glpi_ticketcategories` ADD `is_helpdeskvisible` TINYINT( 1 ) NOT NULL DEFAULT '1', ADD INDEX `is_helpdeskvisible` (`is_helpdeskvisible`)"; $DB->queryOrDie($query, "0.78 add cache in glpi_ticketcategories"); } // change item type management for helpdesk if (FieldExists('glpi_profiles','helpdesk_hardware_type', false)) { $query = "ALTER TABLE `glpi_profiles` ADD `helpdesk_item_type` TEXT NULL DEFAULT NULL AFTER `helpdesk_hardware_type`"; $DB->queryOrDie($query, "0.78 add helpdesk_item_type in glpi_profiles"); $query = "SELECT `id`, `helpdesk_hardware_type` FROM `glpi_profiles`"; if ($result=$DB->query($query)) { if ($DB->numrows($result)>0) { while ($data=$DB->fetch_assoc($result)) { $types = $data['helpdesk_hardware_type']; $CFG_GLPI["ticket_types"] = array(COMPUTER_TYPE, NETWORKING_TYPE, PRINTER_TYPE, MONITOR_TYPE, PERIPHERAL_TYPE, SOFTWARE_TYPE, PHONE_TYPE); $tostore = array(); foreach ($CFG_GLPI["ticket_types"] as $itemtype) { if (pow(2,$itemtype)&$types) { $tostore[] = $typetoname[$itemtype]; } } $query = "UPDATE `glpi_profiles` SET `helpdesk_item_type` = '".exportArrayToDB($tostore)."' WHERE `id` = '".$data['id']."'"; $DB->queryOrDie($query, "0.78 populate helpdesk_item_type"); } } } $query = "ALTER TABLE `glpi_profiles` DROP `helpdesk_hardware_type`;"; $DB->queryOrDie($query, "0.78 drop helpdesk_hardware_type in glpi_profiles"); } if (!FieldExists('glpi_profiles','helpdesk_status', false)) { $query = "ALTER TABLE `glpi_profiles` ADD `helpdesk_status` TEXT NULL COMMENT 'json encoded array of from/dest allowed status change' AFTER `helpdesk_item_type`"; $DB->queryOrDie($query, "0.78 add helpdesk_status in glpi_profiles"); } if (!FieldExists('glpi_profiles','update_priority', false)) { $query = "ALTER TABLE `glpi_profiles` ADD `update_priority` CHAR( 1 ) NULL DEFAULT NULL AFTER `update_ticket`"; $DB->queryOrDie($query, "0.78 add update_priority in glpi_profiles"); $query = "UPDATE `glpi_profiles` SET `update_priority` = `update_ticket`"; $DB->queryOrDie($query, "0.78 set update_priority in glpi_profiles"); } if (FieldExists('glpi_profiles','comment_ticket', false)) { $query = "ALTER TABLE `glpi_profiles` CHANGE `comment_ticket` `add_followups` CHAR(1) NULL DEFAULT NULL"; $DB->queryOrDie($query, "0.78 add add_followups in glpi_profiles"); } if (FieldExists('glpi_profiles','comment_all_ticket', false)) { $query = "ALTER TABLE `glpi_profiles` CHANGE `comment_all_ticket` `global_add_followups` CHAR(1) NULL DEFAULT NULL"; $DB->queryOrDie($query, "0.78 add add_followups in glpi_profiles"); } if (!FieldExists('glpi_profiles','update_tasks', false)) { $query = "ALTER TABLE `glpi_profiles` ADD `global_add_tasks` CHAR( 1 ) NULL AFTER `global_add_followups`, ADD `update_tasks` CHAR( 1 ) NULL AFTER `update_followups`"; $DB->queryOrDie($query, "0.78 add global_add_tasks, update_tasks in glpi_profiles"); $query = "UPDATE `glpi_profiles` SET `update_tasks` = `update_followups`, `global_add_tasks` = `global_add_followups`"; $DB->queryOrDie($query, "0.78 set update_tasks, global_add_tasks in glpi_profiles"); } if (!TableExists('glpi_taskcategories')) { $query = "CREATE TABLE `glpi_taskcategories` ( `id` int(11) NOT NULL auto_increment, `entities_id` int(11) NOT NULL default '0', `is_recursive` tinyint(1) NOT NULL default '0', `taskcategories_id` int(11) NOT NULL default '0', `name` varchar(255) default NULL, `completename` text, `comment` text, `level` int(11) NOT NULL default '0', `ancestors_cache` longtext, `sons_cache` longtext, `is_helpdeskvisible` tinyint(1) NOT NULL default '1', PRIMARY KEY (`id`), KEY `name` (`name`), KEY `taskcategories_id` (`taskcategories_id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`), KEY `is_helpdeskvisible` (`is_helpdeskvisible`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.78 create glpi_taskcategories"); } if (!TableExists('glpi_ticketsolutiontypes')) { $query = "CREATE TABLE `glpi_ticketsolutiontypes` ( `id` int(11) NOT NULL auto_increment, `name` varchar(255) default NULL, `comment` text, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.78 create glpi_ticketsolutiontypes"); // Populate only required for migration of ticket status $query = "INSERT INTO `glpi_ticketsolutiontypes` (`id` ,`name` ,`comment`) VALUES ('1', 'Closed (solved)', NULL), ('2', 'Closed (not solved)', NULL)"; $DB->queryOrDie($query, "0.78 populate glpi_ticketsolutiontypes"); } if (!FieldExists('glpi_tickets', 'solution', false)) { $query = "ALTER TABLE `glpi_tickets` ADD `ticketsolutiontypes_id` INT( 11 ) NOT NULL DEFAULT '0', ADD `solution` TEXT NULL"; $DB->queryOrDie($query, "0.78 create glpi_ticketsolutions"); $query = "ALTER TABLE `glpi_tickets` ADD INDEX `ticketsolutiontypes_id` ( `ticketsolutiontypes_id` ) "; $DB->queryOrDie($query, "0.78 add key for glpi_ticketsolutions"); // Move old status "old_done"", "old_notdone" as solution // and change to new "solved" / "closed" status $query = "UPDATE `glpi_tickets` SET `ticketsolutiontypes_id` = '2', `status` = 'closed' WHERE `status` = 'old_done'"; $DB->queryOrDie($query, "0.78 migration of glpi_tickets status"); $query = "UPDATE `glpi_tickets` SET `ticketsolutiontypes_id` = '1', `status` = 'closed' WHERE `status` = 'old_notdone'"; $DB->queryOrDie($query, "0.78 migration of glpi_tickets status"); } if (!FieldExists('glpi_documenttypes','comment', false)) { $query = "ALTER TABLE `glpi_documenttypes` ADD `comment` TEXT NULL "; $DB->queryOrDie($query, "0.78 add comment in glpi_documenttypes"); } if (!FieldExists('glpi_locations','is_recursive', false)) { $query = "ALTER TABLE `glpi_locations` ADD `is_recursive` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `entities_id`, ADD `ancestors_cache` LONGTEXT NULL, ADD `sons_cache` LONGTEXT NULL, ADD INDEX `is_recursive` (`is_recursive`)"; $DB->queryOrDie($query, "0.78 add recursive, cache in glpi_locations"); } if (!FieldExists('glpi_locations','building', false)) { $query = "ALTER TABLE `glpi_locations` ADD `building` VARCHAR( 255 ) NULL , ADD `room` VARCHAR( 255 ) NULL "; $DB->queryOrDie($query, "0.78 add building, room in glpi_locations"); } if (!TableExists('glpi_requesttypes')) { $query="CREATE TABLE `glpi_requesttypes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `is_helpdesk_default` tinyint(1) NOT NULL DEFAULT '0', `is_mail_default` tinyint(1) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`), KEY `is_helpdesk_default` (`is_helpdesk_default`), KEY `is_mail_default` (`is_mail_default`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.78 create glpi_requesttypes"); $DB->query("INSERT INTO `glpi_requesttypes` VALUES(1, '".addslashes(__('Simplified interface'))."', 1, 0, NULL)"); $DB->query("INSERT INTO `glpi_requesttypes` VALUES(2, '".addslashes(__('Email'))."', 0, 1, NULL)"); $DB->query("INSERT INTO `glpi_requesttypes` VALUES(3, '".addslashes(__('Phone'))."', 0, 0, NULL)"); $DB->query("INSERT INTO `glpi_requesttypes` VALUES(4, '".addslashes(__('Direct'))."', 0, 0, NULL)"); $DB->query("INSERT INTO `glpi_requesttypes` VALUES(5, '".addslashes(__('Written'))."', 0, 0, NULL)"); $DB->query("INSERT INTO `glpi_requesttypes` VALUES(6, '".addslashes(__('Other'))."', 0, 0, NULL)"); } // Add default display $ADDTODISPLAYPREF['RequestType'] = array(14, 15); if (FieldExists('glpi_tickets','request_type', false)) { $query = "ALTER TABLE `glpi_tickets` CHANGE `request_type` `requesttypes_id` INT( 11 ) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.78 change requesttypes_id in glpi_tickets"); } if (FieldExists('glpi_configs','default_request_type', false)) { $query = "ALTER TABLE `glpi_configs` CHANGE `default_request_type` `default_requesttypes_id` INT( 11 ) NOT NULL DEFAULT '1'"; $DB->queryOrDie($query, "0.78 change requesttypes_id in glpi_configs"); } if (FieldExists('glpi_users','default_request_type', false)) { $query = "ALTER TABLE `glpi_users` CHANGE `default_request_type` `default_requesttypes_id` INT( 11 ) NULL DEFAULT NULL"; $DB->queryOrDie($query, "0.78 change requesttypes_id in glpi_users"); } if (!FieldExists('glpi_groups','date_mod', false)) { $query = "ALTER TABLE `glpi_groups` ADD `date_mod` DATETIME NULL, ADD INDEX `date_mod` (`date_mod`)"; $DB->queryOrDie($query, "0.78 add date_mod to glpi_groups"); } if (!FieldExists("glpi_configs","priority_matrix", false)) { $query = "ALTER TABLE `glpi_configs` ADD `priority_matrix` VARCHAR( 255 ) NULL COMMENT 'json encoded array for Urgence / Impact to Protority'"; $DB->queryOrDie($query, "0.78 add priority_matrix in glpi_configs"); $matrix = array(1 => array(1 => 1, 2 => 1, 3 => 2, 4 => 2, 4 => 2, 5 => 2), 2 => array(1 => 1, 2 => 2, 3 => 2, 4 => 3, 4 => 3, 5 => 3), 3 => array(1 => 2, 2 => 2, 3 => 3, 4 => 4, 4 => 4, 5 => 4), 4 => array(1 => 2, 2 => 3, 3 => 4, 4 => 4, 4 => 4, 5 => 5), 5 => array(1 => 2, 2 => 3, 3 => 4, 4 => 5, 4 => 5, 5 => 5)); $matrix = exportArrayToDB($matrix); $query = "UPDATE `glpi_configs` SET `priority_matrix` = '$matrix' WHERE `id` = '1'"; $DB->queryOrDie($query, "0.78 set default priority_matrix in glpi_configs"); } if (!FieldExists("glpi_configs","urgency_mask", false)) { $query = "ALTER TABLE `glpi_configs` ADD `urgency_mask` INT( 11 ) NOT NULL DEFAULT '62', ADD `impact_mask` INT( 11 ) NOT NULL DEFAULT '62'"; $DB->queryOrDie($query, "0.78 add urgency/impact_mask in glpi_configs"); } if (!FieldExists("glpi_users","priority_6", false)) { $query = "ALTER TABLE `glpi_users` ADD `priority_6` CHAR( 20 ) NULL DEFAULT NULL AFTER `priority_5`"; $DB->queryOrDie($query, "0.78 add priority_6 in glpi_users"); } if (!FieldExists("glpi_configs","priority_6", false)) { $query = "ALTER TABLE `glpi_configs` ADD `priority_6` CHAR( 20 ) NOT NULL DEFAULT '#ff5555' AFTER `priority_5`"; $DB->queryOrDie($query, "0.78 add priority_6 in glpi_configs"); } if (!FieldExists('glpi_tickets','urgency', false)) { $query = "ALTER TABLE `glpi_tickets` ADD `urgency` INT NOT NULL DEFAULT '1' AFTER `content`, ADD `impact` INT NOT NULL DEFAULT '1' AFTER `urgency`, ADD INDEX `urgency` (`urgency`), ADD INDEX `impact` (`impact`)"; $DB->queryOrDie($query, "0.78 add urgency, impact to glpi_tickets"); // set default trivial values for Impact and Urgence $query = "UPDATE `glpi_tickets` SET `urgency` = `priority`, `impact` = `priority`"; $DB->queryOrDie($query, "0.78 set urgency, impact in glpi_tickets"); // Replace 'priority' (user choice un 0.72) by 'urgency' as criteria // Don't change "action" which is the result of user+tech evaluation. $query = "UPDATE `glpi_rulecriterias` SET `criteria`='urgency' WHERE `criteria`='priority' AND `rules_id` IN (SELECT `id` FROM `glpi_rules` WHERE `sub_type` = 'RuleTicket')"; $DB->queryOrDie($query, "0.78 fix priority/urgency in business rules"); } if (!TableExists('glpi_tickettasks')) { $query = "CREATE TABLE `glpi_tickettasks` ( `id` int(11) NOT NULL auto_increment, `tickets_id` int(11) NOT NULL default '0', `taskcategories_id` int(11) NOT NULL default '0', `date` datetime default NULL, `users_id` int(11) NOT NULL default '0', `content` longtext collate utf8_unicode_ci, `is_private` tinyint(1) NOT NULL default '0', `realtime` float NOT NULL default '0', PRIMARY KEY (`id`), KEY `date` (`date`), KEY `users_id` (`users_id`), KEY `tickets_id` (`tickets_id`), KEY `is_private` (`is_private`), KEY `taskcategories_id` (`taskcategories_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.78 create glpi_tickettasks"); // Required for migration from ticketfollowups to tickettasks - planned followups $query = "INSERT INTO `glpi_tickettasks` (`id`, `tickets_id`, `date`, `users_id`, `content`, `is_private`, `realtime`) SELECT `glpi_ticketfollowups`.`id`, `glpi_ticketfollowups`.`tickets_id`, `glpi_ticketfollowups`.`date`, `glpi_ticketfollowups`.`users_id`, `glpi_ticketfollowups`.`content`, `glpi_ticketfollowups`.`is_private`, `glpi_ticketfollowups`.`realtime` FROM `glpi_ticketfollowups` INNER JOIN `glpi_ticketplannings` ON (`glpi_ticketplannings`.`ticketfollowups_id` = `glpi_ticketfollowups`.`id`)"; $DB->queryOrDie($query, "0.78 populate glpi_tickettasks"); // delete from ticketfollowups - planned followups, previously copied $query = "DELETE FROM `glpi_ticketfollowups` WHERE `glpi_ticketfollowups`.`id` IN (SELECT `glpi_ticketplannings`.`ticketfollowups_id` FROM `glpi_ticketplannings`)"; $DB->queryOrDie($query, "0.78 delete from glpi_ticketfollowups"); // Required for migration from ticketfollowups to tickettasks - followups with a duration $query = "INSERT INTO `glpi_tickettasks` (`id`, `tickets_id`, `date`, `users_id`, `content`, `is_private`, `realtime`) SELECT `glpi_ticketfollowups`.`id`, `glpi_ticketfollowups`.`tickets_id`, `glpi_ticketfollowups`.`date`, `glpi_ticketfollowups`.`users_id`, `glpi_ticketfollowups`.`content`, `glpi_ticketfollowups`.`is_private`, `glpi_ticketfollowups`.`realtime` FROM `glpi_ticketfollowups` WHERE `realtime`>0"; $DB->queryOrDie($query, "0.78 populate glpi_tickettasks"); // delete from ticketfollowups - followups with duration, previously copied $query = "DELETE FROM `glpi_ticketfollowups` WHERE `realtime` > 0"; $DB->queryOrDie($query, "0.78 delete from glpi_ticketfollowups"); // ticketplannings is for tickettasks $query = "ALTER TABLE `glpi_ticketplannings` CHANGE `ticketfollowups_id` `tickettasks_id` int(11) NOT NULL default '0'"; $DB->queryOrDie($query, "0.78 alter glpi_ticketplannings"); // add requesttype for glpi_ticketfollowups $query = "ALTER TABLE `glpi_ticketfollowups` DROP `realtime`, ADD `requesttypes_id` int(11) NOT NULL default '0', ADD INDEX `requesttypes_id` (`requesttypes_id`)"; $DB->queryOrDie($query, "0.78 alter glpi_ticketplannings"); } // Migrate devices if (TableExists('glpi_computer_device')) { $migration->displayMessage(sprintf(__('Change of the database layout - %s'), _n('Component', 'Components', 2))); foreach ($devtypetoname as $key => $itemtype) { $migration->displayMessage(sprintf(__('Change of the database layout - %s'), $itemtype)); $linktype = "Computer_$itemtype"; $linktable = getTableForItemType($linktype); $itemtable = getTableForItemType($itemtype); $fkname = getForeignKeyFieldForTable($itemtable); $withspecifity = array(MOBOARD_DEVICE => false, PROCESSOR_DEVICE => 'int', RAM_DEVICE => 'int', HDD_DEVICE => 'int', NETWORK_DEVICE => 'varchar', DRIVE_DEVICE => false, CONTROL_DEVICE => false, GFX_DEVICE => 'int', SND_DEVICE => false, PCI_DEVICE => false, CASE_DEVICE => false, POWER_DEVICE => false); if (FieldExists($itemtable,'specif_default', false)) { // Convert default specifity if ($withspecifity[$key]) { // Convert data to int if ($withspecifity[$key] == 'int') { // clean non integer values $query = "UPDATE `$itemtable` SET `specif_default` = 0 WHERE `specif_default` NOT REGEXP '^[0-9]*$' OR `specif_default` = '' OR `specif_default` IS NULL"; $DB->queryOrDie($query, "0.78 update specif_default in $itemtable"); $query = "ALTER TABLE `$itemtable` CHANGE `specif_default` `specif_default` INT(11) NOT NULL"; $DB->queryOrDie($query, "0.78 alter specif_default in $itemtable"); } } else { // Drop default specificity $query = "ALTER TABLE `$itemtable` DROP `specif_default`"; $DB->queryOrDie($query, "0.78 drop specif_default in $itemtable"); } } if (!TableExists($linktable)) { // create table $query = "CREATE TABLE `$linktable` ( `id` int(11) NOT NULL auto_increment, `computers_id` int(11) NOT NULL default '0', `$fkname` int(11) NOT NULL default '0',"; if ($withspecifity[$key]) { if ($withspecifity[$key] == 'int') { $query .= "`specificity` int(11) NOT NULL,"; } else { $query .= "`specificity` varchar(255) collate utf8_unicode_ci default NULL,"; } } $query .= "PRIMARY KEY (`id`), KEY `computers_id` (`computers_id`), KEY `$fkname` (`$fkname`)"; if ($withspecifity[$key]) { $query .= ",KEY `specificity` (`specificity`)"; } $query .= ") ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"; $DB->queryOrDie($query, "0.78 create $linktable"); // Update data before copy if ($withspecifity[$key]) { // Convert data to int if ($withspecifity[$key] == 'int') { // clean non integer values $query = "UPDATE `glpi_computer_device` SET `specificity` = 0 WHERE device_type = $key AND `specificity` NOT REGEXP '^[0-9]*$' OR `specificity` = ''"; $DB->queryOrDie($query, "0.78 update specificity in glpi_computer_device for $itemtype"); } } // copy datas to new table : keep id for ocs sync $query = "INSERT INTO `$linktable` (`id`, `computers_id`, `$fkname` ".($withspecifity[$key]?", `specificity`":'').") SELECT `ID`, `FK_computers`, `FK_device` ".($withspecifity[$key]?", specificity":'')." FROM `glpi_computer_device` WHERE `device_type` = $key"; $DB->queryOrDie($query, "0.78 populate $linktable"); } } // Drop computer_device_table $query = "DROP TABLE `glpi_computer_device`"; $DB->queryOrDie($query, "0.78 drop glpi_computer_device"); } if (!FieldExists('glpi_users','task_private', false)) { $query = "ALTER TABLE `glpi_users` ADD `task_private` TINYINT(1) DEFAULT NULL AFTER `followup_private`"; $DB->queryOrDie($query, "0.78 add task_private to glpi_users"); } if (!FieldExists('glpi_configs','task_private', false)) { $query = "ALTER TABLE `glpi_configs` ADD `task_private` TINYINT(1) NOT NULL DEFAULT '0' AFTER `followup_private`"; $DB->queryOrDie($query, "0.78 add task_private to glpi_users"); } if (!FieldExists('glpi_rules','date_mod', false)) { $query = "ALTER TABLE `glpi_rules` ADD `date_mod` DATETIME NULL, ADD INDEX `date_mod` (`date_mod`)"; $DB->queryOrDie($query, "0.78 add date_mod to glpi_rules"); } if (!FieldExists('glpi_authldaps','entity_field', false)) { $query = "ALTER TABLE `glpi_authldaps` ADD `entity_field` VARCHAR( 255 ) DEFAULT NULL"; $DB->queryOrDie($query, "0.78 add entity_field to glpi_authldaps"); } if (!FieldExists('glpi_authldaps','entity_condition', false)) { $query = "ALTER TABLE `glpi_authldaps` ADD `entity_condition` TEXT NULL collate utf8_unicode_ci"; $DB->queryOrDie($query, "0.78 add entity_condition to glpi_authldaps"); } if (!FieldExists('glpi_entitydatas','ldapservers_id', false)) { $query = "ALTER TABLE `glpi_entitydatas` ADD `ldapservers_id` INT( 11 ) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.78 add ldapservers_id to glpi_entitydatas"); } if (!FieldExists('glpi_entitydatas','mail_domain', false)) { $query = "ALTER TABLE `glpi_entitydatas` ADD `mail_domain` VARCHAR( 255 ) DEFAULT NULL"; $DB->queryOrDie($query, "0.78 add mail_domain to glpi_entitydatas"); } if (!FieldExists('glpi_entitydatas','entity_ldapfilter', false)) { $query = "ALTER TABLE `glpi_entitydatas` ADD `entity_ldapfilter` TEXT NULL collate utf8_unicode_ci"; $DB->queryOrDie($query, "0.78 add entity_ldapfilter to glpi_entitydatas"); } if (!FieldExists('glpi_profiles','import_externalauth_users', false)) { $query = "ALTER TABLE `glpi_profiles` ADD `import_externalauth_users` CHAR( 1 ) NULL"; $DB->queryOrDie($query, "0.78 add import_externalauth_users in glpi_profiles"); $query = "UPDATE `glpi_profiles` SET `import_externalauth_users` = 'w' WHERE `user` ='w'"; $DB->queryOrDie($query, "0.78 add import_externalauth_users right users which are able to write users"); } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'Notifications')); $templates = array(); if (!TableExists('glpi_notificationtemplates')) { $query = "CREATE TABLE `glpi_notificationtemplates` ( `id` INT( 11 ) NOT NULL AUTO_INCREMENT , `name` VARCHAR( 255 ) default NULL , `itemtype` VARCHAR( 100 ) NOT NULL, `date_mod` DATETIME DEFAULT NULL , `comment` text collate utf8_unicode_ci, PRIMARY KEY ( `ID` ), KEY `itemtype` (`itemtype`), KEY `date_mod` (`date_mod`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.78 create glpi_notificationtemplates"); $queries['DBConnection'] = "INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'MySQL Synchronization', 'DBConnection', NOW(),'');"; $queries['Reservation'] = "INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Reservations', 'Reservation', NOW(),'');"; $queries['Reservation2'] = "INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert Reservation', 'Reservation', NOW(),'');"; $queries['Ticket'] = "INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Tickets', 'Ticket', NOW(),'');"; $queries['Ticket2'] = "INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Tickets (Simple)', 'Ticket', NOW(),'');"; $queries['Ticket3'] = "INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Alert Tickets not closed', 'Ticket', NOW(),'');"; $queries['TicketValidation'] = "INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Tickets Validation', 'Ticket', NOW(),'');"; $queries['Cartridge'] = "INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Cartridges', 'Cartridge', NOW(),'');"; $queries['Consumable'] = "INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Consumables', 'Consumable', NOW(),'');"; $queries['Infocom'] = "INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Infocoms', 'Infocom', NOW(),'');"; $queries['SoftwareLicense'] = "INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Licenses', 'SoftwareLicense', NOW(),'');"; $queries['Contract'] = "INSERT INTO `glpi_notificationtemplates` VALUES(NULL, 'Contracts', 'Contract', NOW(),'');"; foreach ($queries as $itemtype => $query) { $DB->queryOrDie($query, "0.78 insert notification template for $itemtype"); $templates[$itemtype] = $DB->insert_id(); } $ADDTODISPLAYPREF['NotificationTemplate']=array(4,16); //There was a problem with GLPI < 0.78 : smtp_port field wans'nt used : migrate it $query = "SELECT `smtp_host` FROM `glpi_configs` WHERE `id` = '1'"; $result = $DB->query($query); $host = $DB->result($result,0,'smtp_host'); $results = array(); preg_match("/(.*):([0-9]*)/",$host,$results); if (!empty($results)) { $query = "UPDATE `glpi_configs` SET `smtp_host` = '".$results[1]."' , `smtp_port` = '".$results[2]."' WHERE `id` = '1'"; $DB->query($query); } } if (!TableExists('glpi_notificationtemplatetranslations')) { $query = "CREATE TABLE `glpi_notificationtemplatetranslations` ( `id` INT( 11 ) NOT NULL AUTO_INCREMENT , `notificationtemplates_id` INT( 11 ) NOT NULL DEFAULT '0', `language` CHAR ( 5 ) NOT NULL DEFAULT '', `subject` VARCHAR( 255 ) NOT NULL , `content_text` TEXT NULL , `content_html` TEXT NULL , PRIMARY KEY ( `id` ), KEY `notificationtemplates_id` (`notificationtemplates_id`) )ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.78 create glpi_notificationtemplatetranslations"); $queries = array(); $queries['DBConnection'] = "INSERT INTO `glpi_notificationtemplatetranslations` VALUES(NULL, ".$templates['DBConnection'].", '','##lang.dbconnection.title##', '##lang.dbconnection.delay## : ##dbconnection.delay##\r\n', '<p>##lang.dbconnection.delay## : ##dbconnection.delay##</p>');"; $content_text_reservation="======================================================================\r\n". "##lang.reservation.user##: ##reservation.user##\r\n". "##lang.reservation.item.name##: ##reservation.itemtype## - ##reservation.item.name##\r\n". "##IFreservation.tech## ##lang.reservation.tech## ##reservation.tech## ##ENDIFreservation.tech##\r\n". "##lang.reservation.begin##: ##reservation.begin##\r\n". "##lang.reservation.end##: ##reservation.end##\r\n". "##lang.reservation.comment##: ##reservation.comment##\r\n". "======================================================================\r\n"; $content_html_reservation = "<!-- description{ color: inherit; background: #ebebeb;". "border-style: solid;border-color: #8d8d8d; border-width: 0px 1px 1px 0px; }". " -->\r\n<p><span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\">". "##lang.reservation.user##:</span>##reservation.user##". "<br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\">". "##lang.reservation.item.name##:</span>". "##reservation.itemtype## - ##reservation.item.name##<br />". "##IFreservation.tech## ##lang.reservation.tech## ##reservation.tech##". "##ENDIFreservation.tech##<br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\">". "##lang.reservation.begin##:</span> ##reservation.begin##". "<br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\">". "##lang.reservation.end##:</span>". "##reservation.end##<br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\">". "##lang.reservation.comment##:</span> ##reservation.comment##". "</p>"; $queries['Reservation'] = "INSERT INTO `glpi_notificationtemplatetranslations` VALUES(NULL, ".$templates['Reservation'].", '', '##reservation.action##', '$content_text_reservation', '$content_html_reservation')"; $queries['Reservation2'] = "INSERT INTO `glpi_notificationtemplatetranslations` VALUES(NULL, ".$templates['Reservation2'].", '', '##reservation.action## ##reservation.entity##', '##lang.reservation.entity## : ##reservation.entity## \r\n \r\n##FOREACHreservations## \r\n##lang.reservation.itemtype## : ##reservation.itemtype##\r\n ##lang.reservation.item## : ##reservation.item##\r\n \r\n ##reservation.url## \r\n ##ENDFOREACHreservations##', '<p>##lang.reservation.entity## : ##reservation.entity## <br /> <br /> ##FOREACHreservations## <br />##lang.reservation.itemtype## : ##reservation.itemtype##<br /> ##lang.reservation.item## : ##reservation.item##<br /> <br /> <a href=\"##reservation.url##\"> ##reservation.url##</a><br /> ##ENDFOREACHreservations##</p>');"; $queries['Ticket'] = "INSERT INTO `glpi_notificationtemplatetranslations` VALUES(NULL, '".$templates['Ticket']."', '', '##ticket.action## ##ticket.title##', ' ##IFticket.storestatus=solved## ##lang.ticket.url## : ##ticket.urlapprove## ##lang.ticket.autoclosewarning## ##lang.ticket.solvedate## : ##ticket.solvedate## ##lang.ticket.solution.type## : ##ticket.solution.type## ##lang.ticket.solution.description## : ##ticket.solution.description## ##ENDIFticket.storestatus## ##ELSEticket.storestatus## ##lang.ticket.url## : ##ticket.url## ##ENDELSEticket.storestatus## ##lang.ticket.description## ##lang.ticket.title## : ##ticket.title## ##lang.ticket.author.name## : ##IFticket.author.name## ##ticket.author.name## ##ENDIFticket.author.name## ##ELSEticket.author.name##--##ENDELSEticket.author.name## ##lang.ticket.creationdate## : ##ticket.creationdate## ##lang.ticket.closedate## : ##ticket.closedate## ##lang.ticket.requesttype## : ##ticket.requesttype## ##IFticket.itemtype## ##lang.ticket.item.name## : ##ticket.itemtype## - ##ticket.item.name## ##IFticket.item.model## - ##ticket.item.model## ##ENDIFticket.item.model## ##IFticket.item.serial## - ##ticket.item.serial## ##ENDIFticket.item.serial## ##IFticket.item.otherserial## -##ticket.item.otherserial## ##ENDIFticket.item.otherserial## ##ENDIFticket.itemtype## ##IFticket.assigntouser## ##lang.ticket.assigntouser## : ##ticket.assigntouser## ##ENDIFticket.assigntouser## ##lang.ticket.status## : ##ticket.status## ##IFticket.assigntogroup## ##lang.ticket.assigntogroup## : ##ticket.assigntogroup## ##ENDIFticket.assigntogroup## ##lang.ticket.urgency## : ##ticket.urgency## ##lang.ticket.impact## : ##ticket.impact## ##lang.ticket.priority## : ##ticket.priority## ##IFticket.user.email## ##lang.ticket.user.email## : ##ticket.user.email ##ENDIFticket.user.email## ##IFticket.category## ##lang.ticket.category## : ##ticket.category## ##ENDIFticket.category## ##ELSEticket.category## ##lang.ticket.nocategoryassigned## ##ENDELSEticket.category## ##lang.ticket.content## : ##ticket.content## ##IFticket.storestatus=closed## ##lang.ticket.solvedate## : ##ticket.solvedate## ##lang.ticket.solution.type## : ##ticket.solution.type## ##lang.ticket.solution.description## : ##ticket.solution.description## ##ENDIFticket.storestatus## ##lang.ticket.numberoffollowups## : ##ticket.numberoffollowups## ##FOREACHfollowups## [##followup.date##] ##lang.followup.isprivate## : ##followup.isprivate## ##lang.followup.author## ##followup.author## ##lang.followup.description## ##followup.description## ##lang.followup.date## ##followup.date## ##lang.followup.requesttype## ##followup.requesttype## ##ENDFOREACHfollowups## ##lang.ticket.numberoftasks## : ##ticket.numberoftasks## ##FOREACHtasks## [##task.date##] ##lang.task.isprivate## : ##task.isprivate## ##lang.task.author## ##task.author## ##lang.task.description## ##task.description## ##lang.task.time## ##task.time## ##lang.task.category## ##task.category## ##ENDFOREACHtasks##', '
    ##IFticket.storestatus=solved##
    ##lang.ticket.url## : ##ticket.urlapprove##  
    ##lang.ticket.autoclosewarning##
    ##lang.ticket.solvedate## : ##ticket.solvedate##
    ##lang.ticket.solution.type## : ##ticket.solution.type##
    ##lang.ticket.solution.description## : ##ticket.solution.description## ##ENDIFticket.storestatus##
    ##ELSEticket.storestatus## ##lang.ticket.url## : ##ticket.url## ##ENDELSEticket.storestatus##
    ##lang.ticket.description##

    ##lang.ticket.title## :##ticket.title##
    ##lang.ticket.author.name## :##IFticket.author.name## ##ticket.author.name## ##ENDIFticket.author.name## ##ELSEticket.author.name##--##ENDELSEticket.author.name##
    ##lang.ticket.creationdate## :##ticket.creationdate##
    ##lang.ticket.closedate## :##ticket.closedate##
    ##lang.ticket.requesttype## :##ticket.requesttype##
    ##IFticket.itemtype## ##lang.ticket.item.name## : ##ticket.itemtype## - ##ticket.item.name## ##IFticket.item.model## - ##ticket.item.model## ##ENDIFticket.item.model## ##IFticket.item.serial## -##ticket.item.serial## ##ENDIFticket.item.serial##  ##IFticket.item.otherserial## -##ticket.item.otherserial## ##ENDIFticket.item.otherserial## ##ENDIFticket.itemtype##
    ##IFticket.assigntouser## ##lang.ticket.assigntouser## : ##ticket.assigntouser## ##ENDIFticket.assigntouser##
    ##lang.ticket.status##  : ##ticket.status##
    ##IFticket.assigntogroup## ##lang.ticket.assigntogroup## : ##ticket.assigntogroup## ##ENDIFticket.assigntogroup##
    ##lang.ticket.urgency## : ##ticket.urgency##
    ##lang.ticket.impact## : ##ticket.impact##
    ##lang.ticket.priority## : ##ticket.priority##
    ##IFticket.user.email## ##lang.ticket.user.email## : ##ticket.user.email ##ENDIFticket.user.email##
    ##IFticket.category####lang.ticket.category##  :##ticket.category## ##ENDIFticket.category## ##ELSEticket.category## ##lang.ticket.nocategoryassigned## ##ENDELSEticket.category##
    ##lang.ticket.content## : ##ticket.content##


    ##IFticket.storestatus=closed##
    ##lang.ticket.solvedate## : ##ticket.solvedate##
    ##lang.ticket.solution.type## : ##ticket.solution.type##
    ##lang.ticket.solution.description## : ##ticket.solution.description##
    ##ENDIFticket.storestatus##

    ##lang.ticket.numberoffollowups## : ##ticket.numberoffollowups##

    ##FOREACHfollowups##


    [##followup.date##] ##lang.followup.isprivate## : ##followup.isprivate##
    ##lang.followup.author## ##followup.author##
    ##lang.followup.description## ##followup.description##
    ##lang.followup.date## ##followup.date##
    ##lang.followup.requesttype## ##followup.requesttype##

    ##ENDFOREACHfollowups##

    ##lang.ticket.numberoftasks## : ##ticket.numberoftasks##

    ##FOREACHtasks##


    [##task.date##] ##lang.task.isprivate## : ##task.isprivate##
    ##lang.task.author## ##task.author##
    ##lang.task.description## ##task.description##
    ##lang.task.time## ##task.time##
    ##lang.task.category## ##task.category##

    ##ENDFOREACHtasks##

    ');"; $queries['Contract'] = "INSERT INTO `glpi_notificationtemplatetranslations` VALUES(NULL, ".$templates['Contract'].", '', '##contract.action## ##contract.entity##', '##lang.contract.entity## : ##contract.entity##\r\n". "\r\n##FOREACHcontracts##\r\n". "##lang.contract.name## : ##contract.name##\r\n". "##lang.contract.number## : ##contract.number##\r\n". "##lang.contract.time## : ##contract.time##\r\n". "##IFcontract.type####lang.contract.type## : ##contract.type##". "##ENDIFcontract.type##\r\n". "##contract.url##\r\n". "##ENDFOREACHcontracts##', '<p>##lang.contract.entity## : ##contract.entity##<br /> <br />##FOREACHcontracts##<br />##lang.contract.name## : ##contract.name##<br /> ##lang.contract.number## : ##contract.number##<br /> ##lang.contract.time## : ##contract.time##<br /> ##IFcontract.type####lang.contract.type## : ##contract.type## ##ENDIFcontract.type##<br /> <a href=\"##contract.url##\"> ##contract.url##</a><br /> ##ENDFOREACHcontracts##</p>');"; $queries['Ticket2'] = "INSERT INTO `glpi_notificationtemplatetranslations` VALUES(NULL, ".$templates['Ticket2'].", '', '##ticket.action## ##ticket.title##', '##lang.ticket.url## : ##ticket.url## \r\n ##lang.ticket.description## \r\n\n ##lang.ticket.title##  :##ticket.title## \n ##lang.ticket.author.name##  :##IFticket.author.name## ##ticket.author.name## ##ENDIFticket.author.name## ##ELSEticket.author.name##--##ENDELSEticket.author.name##   \n ##IFticket.category## ##lang.ticket.category##  :##ticket.category## ##ENDIFticket.category## ##ELSEticket.category## ##lang.ticket.nocategoryassigned## ##ENDELSEticket.category##\n ##lang.ticket.content##  : ##ticket.content##\n##IFticket.itemtype## ##lang.ticket.item.name##  : ##ticket.itemtype## - ##ticket.item.name## ##ENDIFticket.itemtype##', '<div>##lang.ticket.url## : <a href=\"##ticket.url##\"> ##ticket.url##</a></div>\r\n<div class=\"description b\"> ##lang.ticket.description##</div>\r\n<p><span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.ticket.title##</span> :##ticket.title## <br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.ticket.author.name##</span> ##IFticket.author.name## ##ticket.author.name## ##ENDIFticket.author.name## ##ELSEticket.author.name##--##ENDELSEticket.author.name## <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\">  ;</span><br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> </span> ##IFticket.category##<span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.ticket.category## </span> :##ticket.category## ##ENDIFticket.category## ##ELSEticket.category## ##lang.ticket.nocategoryassigned## ##ENDELSEticket.category## <br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.ticket.content##</span> : ##ticket.content##<br />##IFticket.itemtype## <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.ticket.item.name##</span> : ##ticket.itemtype## - ##ticket.item.name## ##ENDIFticket.itemtype##</p>');"; $queries['TicketValidation'] = "INSERT INTO `glpi_notificationtemplatetranslations` VALUES(NULL, ".$templates['TicketValidation'].", '', '##ticket.action## ##ticket.title##', '##FOREACHvalidations## ##IFvalidation.storestatus=waiting## ##validation.submission.title## ##lang.validation.commentsubmission## : ##validation.commentsubmission## ##ENDIFvalidation.storestatus## ##ELSEvalidation.storestatus## ##validation.answer.title## ##ENDELSEvalidation.storestatus## ##lang.ticket.url## : ##ticket.urlvalidation## ##IFvalidation.status## ##lang.validation.validationstatus## ##ENDIFvalidation.status## ##IFvalidation.commentvalidation## ##lang.validation.commentvalidation## : ##validation.commentvalidation## ##ENDIFvalidation.commentvalidation## ##ENDFOREACHvalidations##', '<div>##FOREACHvalidations##</div> <p>##IFvalidation.storestatus=waiting##</p> <div>##validation.submission.title##</div> <div>##lang.validation.commentsubmission## : ##validation.commentsubmission##</div> <div>##ENDIFvalidation.storestatus##</div> <div>##ELSEvalidation.storestatus## ##validation.answer.title## ##ENDELSEvalidation.storestatus##</div> <div></div> <div> <div>##lang.ticket.url## : <a href=\"##ticket.urlvalidation##\"> ##ticket.urlvalidation## </a></div> </div> <p>##IFvalidation.status## ##lang.validation.validationstatus## ##ENDIFvalidation.status## <br /> ##IFvalidation.commentvalidation##<br /> ##lang.validation.commentvalidation## :   ##validation.commentvalidation##<br /> ##ENDIFvalidation.commentvalidation## <br />##ENDFOREACHvalidations##</p>');"; $queries['Ticket3'] = "INSERT INTO `glpi_notificationtemplatetranslations` VALUES(NULL, ".$templates['Ticket3'].", '', '##ticket.action## ##ticket.entity##', '##lang.ticket.entity## : ##ticket.entity##\n \n##FOREACHtickets##\n ##lang.ticket.title## : ##ticket.title##\n ##lang.ticket.status## : ##ticket.status##\n ##ticket.url## \n ##ENDFOREACHtickets##', '<table class=\"tab_cadre\" border=\"1\" cellspacing=\"2\" cellpadding=\"3\"> <tbody> <tr> <td style=\"text-align: left;\" width=\"auto\" bgcolor=\"#cccccc\"><span style=\"font-size: 11px; text-align: left;\">##lang.ticket.author.name##</span></td> <td style=\"text-align: left;\" width=\"auto\" bgcolor=\"#cccccc\"><span style=\"font-size: 11px; text-align: left;\">##lang.ticket.title##</span></td> <td style=\"text-align: left;\" width=\"auto\" bgcolor=\"#cccccc\"><span style=\"font-size: 11px; text-align: left;\">##lang.ticket.priority##</span></td> <td style=\"text-align: left;\" width=\"auto\" bgcolor=\"#cccccc\"><span style=\"font-size: 11px; text-align: left;\">##lang.ticket.status##</span></td> <td style=\"text-align: left;\" width=\"auto\" bgcolor=\"#cccccc\"><span style=\"font-size: 11px; text-align: left;\">##lang.ticket.attribution##</span></td> <td style=\"text-align: left;\" width=\"auto\" bgcolor=\"#cccccc\"><span style=\"font-size: 11px; text-align: left;\">##lang.ticket.creationdate##</span></td> <td style=\"text-align: left;\" width=\"auto\" bgcolor=\"#cccccc\"><span style=\"font-size: 11px; text-align: left;\">##lang.ticket.content##</span></td> </tr> ##FOREACHtickets## <tr> <td width=\"auto\"><span style=\"font-size: 11px; text-align: left;\">##ticket.author.name##</span></td> <td width=\"auto\"><span style=\"font-size: 11px; text-align: left;\"><a href=\"##ticket.url##\">##ticket.title##</a></span></td> <td width=\"auto\"><span style=\"font-size: 11px; text-align: left;\">##ticket.priority##</span></td> <td width=\"auto\"><span style=\"font-size: 11px; text-align: left;\">##ticket.status##</span></td> <td width=\"auto\"><span style=\"font-size: 11px; text-align: left;\">##IFticket.assigntouser####ticket.assigntouser##<br />##ENDIFticket.assigntouser####IFticket.assigntogroup##<br />##ticket.assigntogroup## ##ENDIFticket.assigntogroup####IFticket.assigntosupplier##<br />##ticket.assigntosupplier## ##ENDIFticket.assigntosupplier##</span></td> <td width=\"auto\"><span style=\"font-size: 11px; text-align: left;\">##ticket.creationdate##</span></td> <td width=\"auto\"><span style=\"font-size: 11px; text-align: left;\">##ticket.content##</span></td> </tr> ##ENDFOREACHtickets## </tbody> </table>');"; $queries['Consumable'] = "INSERT INTO `glpi_notificationtemplatetranslations` VALUES(NULL, ".$templates['Consumable'].", '', '##consumable.action## ##consumable.entity##', '##lang.consumable.entity## : ##consumable.entity##\n \n ##FOREACHconsumables##\n##lang.consumable.item## : ##consumable.item##\n \n ##lang.consumable.reference## : ##consumable.reference##\n ##lang.consumable.remaining## : ##consumable.remaining##\n ##consumable.url## \n ##ENDFOREACHconsumables##', '<p> ##lang.consumable.entity## : ##consumable.entity## <br /> <br />##FOREACHconsumables## <br />##lang.consumable.item## : ##consumable.item##<br /> <br />##lang.consumable.reference## : ##consumable.reference##<br /> ##lang.consumable.remaining## : ##consumable.remaining##<br /> <a href=\"##consumable.url##\"> ##consumable.url##</a><br /> ##ENDFOREACHconsumables##</p>');"; $queries['Cartridge'] = "INSERT INTO `glpi_notificationtemplatetranslations` VALUES(NULL, ".$templates['Cartridge'].", '', '##cartridge.action## ##cartridge.entity##', '##lang.cartridge.entity## : ##cartridge.entity##\n \n ##FOREACHcartridges##\n##lang.cartridge.item## : ##cartridge.item##\n \n ##lang.cartridge.reference## : ##cartridge.reference##\n ##lang.cartridge.remaining## : ##cartridge.remaining##\n ##cartridge.url## \n ##ENDFOREACHcartridges##', '<p>##lang.cartridge.entity## :##cartridge.entity## <br /> <br />##FOREACHcartridges## <br />##lang.cartridge.item## : ##cartridge.item##<br /> <br /> ##lang.cartridge.reference## : ##cartridge.reference##<br /> ##lang.cartridge.remaining## : ##cartridge.remaining##<br /> <a href=\"##cartridge.url##\"> ##cartridge.url##</a><br /> ##ENDFOREACHcartridges##</p>');"; $queries['Infocom'] = "INSERT INTO `glpi_notificationtemplatetranslations` VALUES(NULL, ".$templates['Infocom'].", '', '##infocom.action## ##infocom.entity##', '##lang.infocom.entity## : ##infocom.entity## \n \n ##FOREACHinfocoms## \n ##lang.infocom.itemtype## : ##infocom.itemtype##\n ##lang.infocom.item## : ##infocom.item##\n \n ##lang.infocom.expirationdate## : ##infocom.expirationdate##\n ##infocom.url## \n ##ENDFOREACHinfocoms##', '<p>##lang.infocom.entity## : ##infocom.entity## <br /> <br />##FOREACHinfocoms## <br />##lang.infocom.itemtype## : ##infocom.itemtype##<br /> ##lang.infocom.item## : ##infocom.item##<br /> <br /> ##lang.infocom.expirationdate## : ##infocom.expirationdate## <br /> <a href=\"##infocom.url##\"> ##infocom.url##</a><br /> ##ENDFOREACHinfocoms##</p>');"; $queries['SoftwareLicense'] = "INSERT INTO `glpi_notificationtemplatetranslations` VALUES(NULL, ".$templates['SoftwareLicense'].", '', '##license.action## ##license.entity##', '##lang.license.entity## : ##license.entity##\r\n ##FOREACHlicenses## \r\n ##lang.license.item## : ##license.item##\r\n ##lang.license.serial## : ##license.serial##\r\n ##lang.license.expirationdate## : ##license.expirationdate##\r\n ##license.url## \r\n ##ENDFOREACHlicenses##', '<p> ##lang.license.entity## : ##license.entity##<br /> ##FOREACHlicenses## <br />##lang.license.item## : ##license.item##<br /> ##lang.license.serial## : ##license.serial##<br /> ##lang.license.expirationdate## : ##license.expirationdate## <br /> <a href=\"##license.url##\"> ##license.url## </a><br /> ##ENDFOREACHlicenses##</p>');"; foreach ($queries as $itemtype => $query) { $DB->queryOrDie($query, "0.78 insert notification template default translation for $itemtype"); } unset($queries); } $notifications = array(); if (!TableExists('glpi_notifications')) { $query = "CREATE TABLE `glpi_notifications` ( `id` INT( 11 ) NOT NULL AUTO_INCREMENT , `name` VARCHAR( 255 ) DEFAULT NULL , `entities_id` INT( 11 ) NOT NULL DEFAULT '0', `itemtype` VARCHAR( 100 ) NOT NULL , `event` VARCHAR( 255 ) NOT NULL , `mode` VARCHAR( 255 ) NOT NULL , `notificationtemplates_id` INT( 11 ) NOT NULL DEFAULT '0', `comment` TEXT DEFAULT NULL , `is_recursive` TINYINT( 1 ) NOT NULL DEFAULT '0', `is_active` TINYINT( 1 ) NOT NULL DEFAULT '0', `date_mod` DATETIME DEFAULT NULL , PRIMARY KEY ( `id` ), KEY `name` (`name`), KEY `itemtype` (`itemtype`), KEY `entities_id` (`entities_id`), KEY `is_active` (`is_active`), KEY `date_mod` (`date_mod`), KEY `is_recursive` (`is_recursive`), KEY `notificationtemplates_id` (`notificationtemplates_id`) ) ENGINE = MYISAM CHARSET utf8 COLLATE utf8_unicode_ci;"; $DB->queryOrDie($query, "0.78 create glpi_notifications"); $queries = array(); $queries[] = "INSERT INTO `glpi_notifications` VALUES (NULL, 'Alert Tickets not closed', 0, 'Ticket', 'alertnotclosed', 'mail',".$templates['Ticket3'].", '', 1, 1, NOW())"; $queries[] = "INSERT INTO `glpi_notifications` VALUES (NULL, 'New Ticket', 0, 'Ticket', 'new', 'mail', ".$templates['Ticket'].", '', 1, 1, NOW())"; $queries[] = "INSERT INTO `glpi_notifications` VALUES (NULL, 'Update Ticket', 0, 'Ticket', 'update', 'mail', ".$templates['Ticket'].", '', 1, 1, NOW())"; $queries[] = "INSERT INTO `glpi_notifications` VALUES (NULL, 'Close Ticket', 0, 'Ticket', 'closed', 'mail', ".$templates['Ticket'].", '', 1, 1, NOW())"; $queries[] = "INSERT INTO `glpi_notifications` VALUES (NULL, 'Add Followup', 0, 'Ticket', 'add_followup', 'mail', ".$templates['Ticket'].", '', 1, 1, NOW())"; $queries[] = "INSERT INTO `glpi_notifications` VALUES (NULL, 'Add Task', 0, 'Ticket', 'add_task', 'mail', ".$templates['Ticket'].", '', 1, 1, NOW())"; $queries[] = "INSERT INTO `glpi_notifications` VALUES (NULL, 'Update Followup', 0, 'Ticket', 'update_followup', 'mail', ".$templates['Ticket'].", '', 1, 1, NOW())"; $queries[] = "INSERT INTO `glpi_notifications` VALUES (NULL, 'Update Task', 0, 'Ticket', 'update_task', 'mail', ".$templates['Ticket'].", '', 1, 1, NOW())"; $queries[] = "INSERT INTO `glpi_notifications` VALUES (NULL, 'Delete Followup', 0, 'Ticket', 'delete_followup', 'mail', ".$templates['Ticket'].", '', 1, 1, NOW())"; $queries[] = "INSERT INTO `glpi_notifications` VALUES (NULL, 'Delete Task', 0, 'Ticket', 'delete_task', 'mail', ".$templates['Ticket'].", '', 1, 1, NOW())"; $queries[] = "INSERT INTO `glpi_notifications` VALUES (NULL, 'Resolve ticket', 0, 'Ticket', 'solved', 'mail', ".$templates['Ticket'].", '', 1, 1, NOW())"; $queries[] = "INSERT INTO `glpi_notifications` VALUES (NULL, 'Ticket Validation', 0, 'Ticket', 'validation', 'mail', ".$templates['TicketValidation'].", '', 1, 1, NOW())"; $queries[] = "INSERT INTO `glpi_notifications` VALUES (NULL, 'New Reservation', 0, 'Reservation', 'new', 'mail', ".$templates['Reservation'].", '', 1, 1, NOW())"; $queries[] = "INSERT INTO `glpi_notifications` VALUES (NULL, 'Update Reservation', 0, 'Reservation', 'update', 'mail', ".$templates['Reservation'].", '', 1, 1, NOW())"; $queries[] = "INSERT INTO `glpi_notifications` VALUES (NULL, 'Delete Reservation', 0, 'Reservation', 'delete', 'mail', ".$templates['Reservation'].", '', 1, 1, NOW())"; $queries[] = "INSERT INTO `glpi_notifications` VALUES (NULL, 'Alert Reservation', 0, 'Reservation', 'alert', 'mail', ".$templates['Reservation2'].", '', 1, 1, NOW())"; $queries[] = "INSERT INTO `glpi_notifications` VALUES (NULL, 'Contract Notice', 0, 'Contract', 'notice', 'mail', ".$templates['Contract'].", '', 1, 1, NOW())"; $queries[] = "INSERT INTO `glpi_notifications` VALUES (NULL, 'Contract End', 0, 'Contract', 'end', 'mail', ".$templates['Contract'].", '', 1, 1, NOW())"; $queries[] = "INSERT INTO `glpi_notifications` VALUES (NULL, 'MySQL Synchronization', 0, 'DBConnection', 'desynchronization', 'mail',".$templates['DBConnection'].", '', 1, 1, NOW())"; $queries[] = "INSERT INTO `glpi_notifications` VALUES (NULL, 'Cartridges', 0, 'Cartridge', 'alert', 'mail', ".$templates['Cartridge'].", '', 1, 1, NOW())"; $queries[] = "INSERT INTO `glpi_notifications` VALUES (NULL, 'Consumables', 0, 'Consumable', 'alert', 'mail', ".$templates['Consumable'].", '', 1, 1, NOW())"; $queries[] = "INSERT INTO `glpi_notifications` VALUES (NULL, 'Infocoms', 0, 'Infocom', 'alert', 'mail', ".$templates['Infocom'].", '', 1, 1, NOW())"; $queries[] = "INSERT INTO `glpi_notifications` VALUES (NULL, 'Software Licenses', 0, 'SoftwareLicense', 'alert', 'mail', ".$templates['SoftwareLicense'].", '', 1, 1, NOW())"; foreach ($queries as $query) { $DB->queryOrDie($query, "0.78 insert notification"); } $ADDTODISPLAYPREF['Notification'] = array(5, 6, 2, 4, 80, 86); unset($queries); } if (!TableExists('glpi_notificationtargets') && TableExists('glpi_mailingsettings')) { $query = "RENAME TABLE `glpi_mailingsettings` TO `glpi_notificationtargets`;"; $DB->queryOrDie($query, "0.78 rename table glpi_mailingsettings in glpi_notificationtargets"); $query = "ALTER TABLE `glpi_notificationtargets` ADD `notifications_id` INT( 11 ) NOT NULL DEFAULT '0', ADD INDEX `notifications_id` (`notifications_id`)"; $DB->queryOrDie($query, "0.78 add field notifications_id to glpi_notificationtargets"); $query = "ALTER TABLE `glpi_notificationtargets` CHANGE `type` `oldtype` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL"; $DB->queryOrDie($query, "0.78 change field type in oldtype"); $query = "ALTER TABLE `glpi_notificationtargets` CHANGE `mailingtype` `type` INT( 11 ) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.78 change field mailingtype in type"); $fields = array ('new' => array('itemtype' => 'Ticket', 'newaction' => 'new'), 'update' => array('itemtype' => 'Ticket', 'newaction' => 'update'), 'finish' => array('itemtype' => 'Ticket', 'newaction' => 'closed'), 'resa' => array('itemtype' => 'Reservation', 'newaction' => 'new'), 'followup' => array('itemtype' => 'Ticket', 'newaction' => 'add_followup'), 'alertconsumable' => array('itemtype' => 'Consumable', 'newaction' => 'alert'), 'alertcartridge' => array('itemtype' => 'Cartridge', 'newaction' => 'alert'), 'alertlicense' => array('itemtype' => 'SoftwareLicense', 'newaction' => 'alert'), 'alertinfocom' => array('itemtype' => 'Infocom', 'newaction' => 'alert'), 'alertcontract' => array('itemtype' => 'Contract', 'newaction' => 'end')); $query = "SELECT `oldtype` FROM `glpi_notificationtargets` GROUP BY `oldtype`"; foreach ($DB->request($query) as $data) { $infos = $fields[$data['oldtype']]; $query_type = "SELECT `id` FROM `glpi_notifications` WHERE `itemtype`='".$infos['itemtype']."' AND `event`='".$infos['newaction']."'"; $result = $DB->queryOrDie($query_type, "0.78 get notificationtargets_id"); if ($DB->numrows($result)) { $id = $DB->result($result,0,'id'); $query_update = "UPDATE `glpi_notificationtargets` SET `notifications_id` = '$id' WHERE `oldtype` = '".$data['oldtype']."'"; $DB->queryOrDie($query_update, "0.78 set notificationtargets_id"); } } $query ="ALTER TABLE `glpi_notificationtargets` DROP INDEX `unicity` "; $DB->queryOrDie($query, "0.78 drop index unicity from glpi_notificationtargets"); $query = "ALTER TABLE `glpi_notificationtargets` DROP `oldtype`"; $DB->queryOrDie($query, "0.78 drop field oldtype in glpi_notificationtargets"); //Add administrator as target for MySQL Synchronization notification $query_type = "SELECT `id` FROM `glpi_notifications` WHERE `itemtype` = 'DBConnection'"; $result = $DB->queryOrDie($query_type, "0.78 get notificationtargets_id"); if ($DB->numrows($result)) { $id = $DB->result($result,0,'id'); $query = "INSERT INTO `glpi_notificationtargets` (`id`, `notifications_id`, `type`, `items_id`) VALUES (NULL, ".$id.", 1, 1)"; $DB->queryOrDie($query, "0.78 add target for dbsynchronization"); } //Add validator as target for Ticket Validation $query_type = "SELECT `id` FROM `glpi_notifications` WHERE `itemtype` = 'Ticket' AND `event` = 'validation'"; $result = $DB->queryOrDie($query_type, "0.78 get notificationtargets_id"); if ($DB->numrows($result)) { $id = $DB->result($result,0,'id'); $query = "INSERT INTO `glpi_notificationtargets` (`id`, `notifications_id`, `type`, `items_id`) VALUES (NULL, ".$id.", 1, 14);"; $DB->queryOrDie($query, "0.78 add target for Ticket Validation"); } //Manage Reservation update & delete $query_type = "SELECT `id` FROM `glpi_notifications` WHERE `itemtype` = 'Reservation' AND `event` IN ('update', 'delete')"; foreach ($DB->request($query_type) as $data_resa) { $query_targets = "SELECT `glpi_notificationtargets` . * FROM `glpi_notifications` , `glpi_notificationtargets` WHERE `glpi_notifications`.`itemtype` = 'Reservation' AND `glpi_notifications`.`event` = 'new' AND `glpi_notificationtargets`.notifications_id = `glpi_notifications`.id"; foreach ($DB->request($query_targets) as $data_targets) { $query_insert = "INSERT INTO `glpi_notificationtargets` (`id`, `notifications_id`, `type`, `items_id`) VALUES (NULL, ".$data_resa['id'].", ".$data_targets['type'].", ".$data_targets['items_id'].");"; $DB->queryOrDie($query_insert, "0.78 add target for reservations"); } } //Manage contract notice $query_type = "SELECT `id` FROM `glpi_notifications` WHERE `itemtype` = 'Contract' AND `event` = 'notice'"; foreach ($DB->request($query_type) as $data_contract) { $query_targets = "SELECT `glpi_notificationtargets`.* FROM `glpi_notifications` , `glpi_notificationtargets` WHERE `glpi_notifications`.`itemtype` = 'Contract' AND `glpi_notifications`.`event` = 'end' AND `glpi_notificationtargets`.notifications_id = `glpi_notifications`.id"; foreach ($DB->request($query_targets) as $data_targets) { $query_insert = "INSERT INTO `glpi_notificationtargets` (`id`, `notifications_id`, `type`, `items_id`) VALUES (NULL, ".$data_contract['id'].", ".$data_targets['type'].", ".$data_targets['items_id'].")"; $DB->queryOrDie($query_insert, "0.78 add target for contract"); } } //Manage ticket tasks & followups $query_type = "SELECT `id` FROM `glpi_notifications` WHERE `itemtype`='Ticket' AND `event` IN ('add_task', 'update_task', 'update_followup', 'delete_task', 'delete_followup')"; foreach ($DB->request($query_type) as $data_ticket) { $query_targets = "SELECT `glpi_notificationtargets`.* FROM `glpi_notifications` , `glpi_notificationtargets` WHERE `glpi_notifications`.`itemtype` = 'Ticket' AND `glpi_notifications`.`event` = 'add_followup' AND `glpi_notificationtargets`.notifications_id = `glpi_notifications`.id"; foreach ($DB->request($query_targets) as $data_targets) { $query_insert = "INSERT INTO `glpi_notificationtargets` (`id`, `notifications_id`, `type`, `items_id`) VALUES (NULL, ".$data_ticket['id'].", ".$data_targets['type'].", ".$data_targets['items_id'].");"; $DB->queryOrDie($query_insert, "0.78 add target for tickets"); } } //Manage ticket solved $query_type = "SELECT `id` FROM `glpi_notifications` WHERE `itemtype` = 'Ticket' AND `event` = 'solved'"; foreach ($DB->request($query_type) as $data_ticket) { $query_targets = "SELECT `glpi_notificationtargets`.* FROM `glpi_notifications` , `glpi_notificationtargets` WHERE `glpi_notifications`.`itemtype` = 'Ticket' AND `glpi_notifications`.`event` = 'closed' AND `glpi_notificationtargets`.notifications_id = `glpi_notifications`.id"; foreach ($DB->request($query_targets) as $data_targets) { $query_insert = "INSERT INTO `glpi_notificationtargets` (`id`, `notifications_id`, `type`, `items_id`) VALUES (NULL, ".$data_ticket['id']. ", ".$data_targets['type'].", ".$data_targets['items_id'].")"; $DB->queryOrDie($query_insert, "0.78 add target for tickets action solved"); } } } if (!FieldExists('glpi_profiles','notification', false)) { $query = "ALTER TABLE `glpi_profiles` ADD `notification` CHAR( 1 ) NULL"; $DB->queryOrDie($query, "0.78 add notification in glpi_profiles"); $query = "UPDATE `glpi_profiles` SET `notification` = 'w' WHERE `config` ='w'"; $DB->queryOrDie($query, "0.78 add notification write right user which have config right"); } if (!FieldExists('glpi_entitydatas','mailing_signature', false)) { $query = "ALTER TABLE `glpi_entitydatas` ADD `mailing_signature` TEXT DEFAULT NULL , ADD `cartridges_alert_repeat` INT( 11 ) NOT NULL DEFAULT '-1', ADD `consumables_alert_repeat` INT( 11 ) NOT NULL DEFAULT '-1', ADD `use_licenses_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', ADD `use_contracts_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', ADD `use_infocoms_alert` TINYINT( 1 ) NOT NULL DEFAULT '-1', ADD `use_reservations_alert` INT( 11 ) NOT NULL DEFAULT '-1', ADD `autoclose_delay` INT( 11 ) NOT NULL DEFAULT '-1', ADD `notclosed_delay` INT( 11 ) NOT NULL DEFAULT '-1'"; $DB->queryOrDie($query, "0.78 add notifications fields in glpi_entitydatas"); } if (!FieldExists('glpi_configs','use_reservations_alert', false)) { $query = "ALTER TABLE `glpi_configs` ADD `use_infocoms_alert` TINYINT( 1 ) NOT NULL DEFAULT '0', ADD `use_contracts_alert` TINYINT( 1 ) NOT NULL DEFAULT '0', ADD `use_reservations_alert` TINYINT( 1 ) NOT NULL DEFAULT '0', ADD `autoclose_delay` INT( 11 ) NOT NULL DEFAULT '0', ADD `notclosed_delay` INT( 11 ) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.78 add notifications fields in glpi_configs"); } if (TableExists('glpi_mailingsettings')) { $query = "DROP TABLE `glpi_mailingsettings`;"; $DB->queryOrDie($query, "0.78 drop table glpi_mailingsettings"); } $tables = array('glpi_infocoms' => __('Financial and administrative information'), 'glpi_reservationitems' => _n('Reservation', 'Reservations', 2), 'glpi_networkports' => _n('Network port', 'Network ports', 2)); foreach ($tables as $table => $label) { // Migrate infocoms entity information if (!FieldExists($table,'entities_id', false)) { $migration->displayMessage(sprintf(__('Change of the database layout - %s'), $label)); $query = "ALTER TABLE `$table` ADD `entities_id` int(11) NOT NULL DEFAULT 0 AFTER `itemtype`, ADD `is_recursive` tinyint(1) NOT NULL DEFAULT 0 AFTER `entities_id`, ADD INDEX `entities_id` ( `entities_id` ), ADD INDEX `is_recursive` (`is_recursive`)"; $DB->queryOrDie($query, "0.78 add entities_id and is_recursive in $table"); $entities = getAllDatasFromTable('glpi_entities'); $entities[0] = "Root"; $query = "SELECT DISTINCT `itemtype` FROM `$table`"; if ($result=$DB->query($query)) { if ($DB->numrows($result)>0) { while ($data = $DB->fetch_assoc($result)) { $migration->displayMessage(sprintf(__('Change of the database layout - %s'), sprintf(__('%1$s - %2$s'), $label, $data['itemtype']))); $itemtable = getTableForItemType($data['itemtype']); // ajout d'un contrôle pour voir si la table existe ( cas migration plugin non fait) if (!TableExists($itemtable)) { $migration->displayWarning("*** Skip : no table $itemtable ***", true); continue; } $do_recursive = false; if (FieldExists($itemtable,'is_recursive', false)) { $do_recursive = true; } // This is duplicated in Plugin::migrateItemType() for plugin object foreach ($entities as $entID => $val) { if ($do_recursive) { // Non recursive ones $query3 = "UPDATE `$table` SET `entities_id` = $entID, `is_recursive` = 0 WHERE `itemtype` = '".$data['itemtype']."' AND `items_id` IN (SELECT `id` FROM `$itemtable` WHERE `entities_id` = $entID AND `is_recursive` = 0)"; $DB->queryOrDie($query3, "0.78 update entities_id and is_recursive=0 in $table for ". $data['itemtype']); // Recursive ones $query3 = "UPDATE `$table` SET `entities_id` = $entID, `is_recursive` = 1 WHERE `itemtype` = '".$data['itemtype']."' AND `items_id` IN (SELECT `id` FROM `$itemtable` WHERE `entities_id` = $entID AND `is_recursive` = 1)"; $DB->queryOrDie($query3, "0.78 update entities_id and is_recursive=1 in $table for ". $data['itemtype']); } else { $query3 = "UPDATE `$table` SET `entities_id` = $entID WHERE `itemtype` = '".$data['itemtype']."' AND `items_id` IN (SELECT `id` FROM `$itemtable` WHERE `entities_id` = $entID)"; $DB->queryOrDie($query3, "0.78 update entities_id in $table for ".$data['itemtype']); } } } } } } } // Migrate consumable and cartridge and computerdisks entity information $items = array('glpi_cartridges' => 'glpi_cartridgeitems', 'glpi_consumables' => 'glpi_consumableitems', 'glpi_computerdisks' => 'glpi_computers'); foreach ($items as $linkitem => $sourceitem) { if (!FieldExists($linkitem,'entities_id', false)) { $migration->displayMessage(sprintf(__('Change of the database layout - %s'), $linkitem)); $query = "ALTER TABLE `$linkitem` ADD `entities_id` int(11) NOT NULL DEFAULT 0 AFTER `id`, ADD INDEX `entities_id` ( `entities_id` )"; $DB->queryOrDie($query, "0.78 add entities_id in $linkitem"); $entities = getAllDatasFromTable('glpi_entities'); $entities[0] = "Root"; foreach ($entities as $entID => $val) { $query3 = "UPDATE `$linkitem` SET `entities_id` = '$entID' WHERE ".getForeignKeyFieldForTable($sourceitem)." IN (SELECT `id` FROM `$sourceitem` WHERE `entities_id` = '$entID' )"; $DB->queryOrDie($query3, "0.78 update entities_id in $linkitem"); } } } // Migrate softwareversions entity information if (!FieldExists('glpi_softwareversions','entities_id', false)) { $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'glpi_softwareversions')); $query = "ALTER TABLE `glpi_softwareversions` ADD `entities_id` int(11) NOT NULL DEFAULT 0 AFTER `id`, ADD INDEX `entities_id` ( `entities_id` ), ADD `is_recursive` tinyint(1) NOT NULL DEFAULT 0 AFTER `entities_id`, ADD INDEX `is_recursive` ( `is_recursive` )"; $DB->queryOrDie($query, "0.78 add entities_id in glpi_softwareversion"); $entities = getAllDatasFromTable('glpi_entities'); $entities[0] = "Root"; foreach ($entities as $entID => $val) { // Non recursive ones $query3 = "UPDATE `glpi_softwareversions` SET `entities_id` = $entID, `is_recursive` = 0 WHERE `softwares_id` IN (SELECT `id` FROM `glpi_softwares` WHERE `entities_id` = $entID AND `is_recursive` = 0)"; $DB->queryOrDie($query3, "0.78 update entities_id and is_recursive=0 in glpi_softwareversions"); // Recursive ones $query3 = "UPDATE `glpi_softwareversions` SET `entities_id` = $entID, `is_recursive` = 1 WHERE `softwares_id` IN (SELECT `id` FROM `glpi_softwares` WHERE `entities_id` = $entID AND `is_recursive` = 1)"; $DB->queryOrDie($query3, "0.78 update entities_id and is_recursive=1 in glpi_softwareversions"); } } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'glpi_mailcollectors')); if (!FieldExists("glpi_mailcollectors", "is_active", false)) { $query = "ALTER TABLE `glpi_mailcollectors` ADD `is_active` tinyint( 1 ) NOT NULL DEFAULT '1', ADD INDEX `is_active` (`is_active`) "; $DB->queryOrDie($query, "0.78 add is_active in glpi_mailcollectors"); } if (!FieldExists('glpi_mailcollectors','date_mod', false)) { $query = "ALTER TABLE `glpi_mailcollectors` ADD `date_mod` DATETIME NULL, ADD INDEX `date_mod` (`date_mod`)"; $DB->queryOrDie($query, "0.78 add date_mod to glpi_mailcollectors"); } if (!FieldExists('glpi_mailcollectors','comment', false)) { $query = "ALTER TABLE `glpi_mailcollectors` ADD `comment` text collate utf8_unicode_ci"; $DB->queryOrDie($query, "0.78 add comment to glpi_mailcollectors"); } if (!FieldExists('glpi_profiles','rule_mailcollector', false)) { $query = "ALTER TABLE `glpi_profiles` ADD `rule_mailcollector` CHAR( 1 ) NULL "; $DB->queryOrDie($query, "0.78 add rule_mailcollector to glpi_profiles"); $query = "UPDATE `glpi_profiles` SET `rule_mailcollector` = `rule_ticket`"; $DB->queryOrDie($query, "0.78 set default rule_mailcollector same as rule_ticket"); } // Change search pref : add active / date_mod $ADDTODISPLAYPREF['MailCollector'] = array(2, 19); $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'glpi_authldaps')); if (!FieldExists('glpi_authldaps','date_mod', false)) { $query = "ALTER TABLE `glpi_authldaps` ADD `date_mod` DATETIME NULL, ADD INDEX `date_mod` (`date_mod`)"; $DB->queryOrDie($query, "0.78 add date_mod to glpi_authldaps"); } if (!FieldExists('glpi_authldaps','comment', false)) { $query = "ALTER TABLE `glpi_authldaps` ADD `comment` text collate utf8_unicode_ci"; $DB->queryOrDie($query, "0.78 add comment to glpi_authldaps"); } // Change search pref : host, date_mod $ADDTODISPLAYPREF['AuthLDAP'] = array(3, 19); $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'glpi_authldaps')); if (!FieldExists('glpi_authmails','date_mod', false)) { $query = "ALTER TABLE `glpi_authmails` ADD `date_mod` DATETIME NULL, ADD INDEX `date_mod` (`date_mod`)"; $DB->queryOrDie($query, "0.78 add date_mod to glpi_authmails"); } if (!FieldExists('glpi_authmails','comment', false)) { $query = "ALTER TABLE `glpi_authmails` ADD `comment` text collate utf8_unicode_ci"; $DB->queryOrDie($query, "0.78 add comment to glpi_authmails"); } // Change search pref : host, date_mod $ADDTODISPLAYPREF['AuthMail'] = array(3, 19); $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'glpi_ocsservers')); if (!FieldExists('glpi_ocsservers','date_mod', false)) { $query = "ALTER TABLE `glpi_ocsservers` ADD `date_mod` DATETIME NULL, ADD INDEX `date_mod` (`date_mod`)"; $DB->queryOrDie($query, "0.78 add date_mod to glpi_ocsservers"); } if (!FieldExists('glpi_ocsservers','comment', false)) { $query = "ALTER TABLE `glpi_ocsservers` ADD `comment` text collate utf8_unicode_ci"; $DB->queryOrDie($query, "0.78 add comment to glpi_ocsservers"); } // Change search pref : date_mod / host $ADDTODISPLAYPREF['OcsServer'] = array(3, 19); $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'glpi_profiles')); if (!FieldExists('glpi_profiles','date_mod', false)) { $query = "ALTER TABLE `glpi_profiles` ADD `date_mod` DATETIME NULL, ADD INDEX `date_mod` (`date_mod`)"; $DB->queryOrDie($query, "0.78 add date_mod to glpi_profiles"); } if (!FieldExists('glpi_profiles','comment', false)) { $query = "ALTER TABLE `glpi_profiles` ADD `comment` text collate utf8_unicode_ci"; $DB->queryOrDie($query, "0.78 add comment to glpi_profiles"); } // Change search pref : date_mod / host $ADDTODISPLAYPREF['Profile'] = array(2, 3, 19); $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'glpi_printers')); if (!FieldExists('glpi_printers','have_ethernet', false)) { $query = "ALTER TABLE `glpi_printers` ADD `have_ethernet` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `have_usb`"; $DB->queryOrDie($query, "0.78 add have_ethernet to glpi_printers"); } if (!FieldExists('glpi_printers','have_wifi', false)) { $query = "ALTER TABLE `glpi_printers` ADD `have_wifi` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `have_usb`"; $DB->queryOrDie($query, "0.78 add have_wifi to glpi_printers"); } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'glpi_profiles')); if (!FieldExists('glpi_transfers','date_mod', false)) { $query = "ALTER TABLE `glpi_transfers` ADD `date_mod` DATETIME NULL, ADD INDEX `date_mod` (`date_mod`)"; $DB->queryOrDie($query, "0.78 add date_mod to glpi_transfers"); } if (!FieldExists('glpi_transfers','comment', false)) { $query = "ALTER TABLE `glpi_transfers` ADD `comment` text collate utf8_unicode_ci"; $DB->queryOrDie($query, "0.78 add comment to glpi_transfers"); } // Change search pref : date_mod $ADDTODISPLAYPREF['Transfer']=array(19); // Convert events $migration->displayMessage(sprintf(__('Data migration - %s'), 'glpi_events')); $convert_types = array('tracking' => 'ticket', 'networking' => 'networkequipment', 'knowbase' => 'knowbaseitem', 'typedocs' => 'documenttype', 'mailgate' => 'mailcollector'); foreach ($convert_types as $from =>$to) { $query2 = "UPDATE `glpi_events` SET `type` = '$to' WHERE `type` = '$from'"; $DB->queryOrDie($query2, "0.78 update events data"); } $migration->displayMessage(sprintf(__('Data migration - %s'), 'ticket bookmarks')); $query = "SELECT * FROM `glpi_bookmarks` WHERE `itemtype` = 'Ticket' AND `type` = '".Bookmark::SEARCH."'"; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { while ($data = $DB->fetch_assoc($result)) { $num = 0; $num2 = 0; $options = array(); parse_str($data["query"], $options); $newoptions = array(); foreach ($options as $key => $val) { switch ($key) { case "status" : $newoptions['field'][$num] = 12; $newoptions['searchtype'][$num] = 'equals'; $newoptions['link'][$num] = 'AND'; if ($val=='old_done' || $val=='old_notdone') { $newoptions['contains'][$num] = 'closed'; } else { $newoptions['contains'][$num] = $val; } $num++; break; case "priority" : if ($val!=0) { $newoptions['field'][$num] = 3; $newoptions['searchtype'][$num] = 'equals'; $newoptions['contains'][$num] = $val; $newoptions['link'][$num] = 'AND'; $num++; } break; case "category" : if ($val>0) { $newoptions['field'][$num] = 7; $newoptions['searchtype'][$num] = 'equals'; $newoptions['contains'][$num] = $val; $newoptions['link'][$num] = 'AND'; $num++; } break; case "request_type" : if ($val>0) { $newoptions['field'][$num] = 9; $newoptions['searchtype'][$num] = 'equals'; $newoptions['contains'][$num] = $val; $newoptions['link'][$num] = 'AND'; $num++; } break; case "type" : if ($val>0 && isset($data['item']) && $data['item']>0) { $newoptions['itemtype2'][$num2] = $typetoname[$val]; $newoptions['field2'][$num2] = 1; $newoptions['searchtype2'][$num2] = 'equals'; $newoptions['contains2'][$num2] = $data['item']; $newoptions['link2'][$num2] = 'AND'; $num2++; } break; case "author" : if ($val>0) { $newoptions['field'][$num] = 4; $newoptions['searchtype'][$num] = 'equals'; $newoptions['contains'][$num] = $val; $newoptions['link'][$num] = 'AND'; $num++; } break; case "group" : if ($val>0) { $newoptions['field'][$num] = 71; $newoptions['searchtype'][$num] = 'equals'; $newoptions['contains'][$num] = $val; $newoptions['link'][$num] = 'AND'; $num++; } break; case "assign" : if ($val>0) { $newoptions['field'][$num] = 5; $newoptions['searchtype'][$num] = 'equals'; $newoptions['contains'][$num] = $val; $newoptions['link'][$num] = 'AND'; $num++; } break; case "assign_group" : if ($val>0) { $newoptions['field'][$num] = 8; $newoptions['searchtype'][$num] = 'equals'; $newoptions['contains'][$num] = $val; $newoptions['link'][$num] = 'AND'; $num++; } break; case "assign_ent" : if ($val>0) { $newoptions['field'][$num] = 6; $newoptions['searchtype'][$num] = 'equals'; $newoptions['contains'][$num] = $val; $newoptions['link'][$num] = 'AND'; $num++; } break; case "recipient" : if ($val>0) { $newoptions['field'][$num] = 22; $newoptions['searchtype'][$num] = 'equals'; $newoptions['contains'][$num] = $val; $newoptions['link'][$num] = 'AND'; $num++; } break; case "date1" : // begin from if (strlen($val)>0 && $val!='NULL') { $newoptions['field'][$num] = 15; $newoptions['searchtype'][$num] = 'contains'; $newoptions['contains'][$num] = '>='.$val; $newoptions['link'][$num] = 'AND'; $num++; } break; case "date2" : // begin to if (strlen($val)>0 && $val!='NULL') { $newoptions['field'][$num] = 15; $newoptions['searchtype'][$num] = 'contains'; $newoptions['contains'][$num] = '<='.$val; $newoptions['link'][$num] = 'AND'; $num++; } break; case "enddate1" : // end from if (strlen($val)>0 && $val!='NULL') { $newoptions['field'][$num] = 16; $newoptions['searchtype'][$num] = 'contains'; $newoptions['contains'][$num] = '>='.$val; $newoptions['link'][$num] = 'AND'; $num++; } break; case "enddate2" : // end to if (strlen($val)>0 && $val!='NULL') { $newoptions['field'][$num] = 16; $newoptions['searchtype'][$num] = 'contains'; $newoptions['contains'][$num] = '<='.$val; $newoptions['link'][$num] = 'AND'; $num++; } break; case "datemod1" : // mod from if (strlen($val)>0 && $val!='NULL') { $newoptions['field'][$num] = 19; $newoptions['searchtype'][$num] = 'contains'; $newoptions['contains'][$num] = '>='.$val; $newoptions['link'][$num] = 'AND'; $num++; } break; case "datemod2" : // mod to if (strlen($val)>0 && $val!='NULL') { $newoptions['field'][$num] = 19; $newoptions['searchtype'][$num] = 'contains'; $newoptions['contains'][$num] = '<='.$val; $newoptions['link'][$num] = 'AND'; $num++; } break; case "tosearch" : if (isset($data['search'])) { $search=trim($data['search']); if (strlen($search) > 0) { $first=false; if (strstr($data['search'],'name')) { $newoptions['field'][$num] = 1; $newoptions['searchtype'][$num] = 'contains'; $newoptions['contains'][$num] = $val; $newoptions['link'][$num] = ($first?'AND':'OR'); $first=false; $num++; } if (strstr($data['search'],'contents')) { $newoptions['field'][$num] = 21; $newoptions['searchtype'][$num] = 'contains'; $newoptions['contains'][$num] = $val; $newoptions['link'][$num] = ($first?'AND':'OR'); $first=false; $num++; } if (strstr($data['search'],'followup')) { $newoptions['field'][$num] = 25; $newoptions['searchtype'][$num] = 'contains'; $newoptions['contains'][$num] = $val; $newoptions['link'][$num] = ($first?'AND':'OR'); $first=false; $num++; } if (strstr($data['search'],'ID')) { $newoptions['field'][$num] = 2; $newoptions['searchtype'][$num] = 'contains'; $newoptions['contains'][$num] = $val; $newoptions['link'][$num] = 'AND'; $first=false; $num++; } } } break; } } if ($num>0 || $num2 >0) { $newoptions['glpisearchcount']=$num; $newoptions['glpisearchcount2']=$num2; $newoptions['itemtype']='Ticket'; $query2 = "UPDATE `glpi_bookmarks` SET `query` = '".addslashes(Toolbox::append_params($newoptions))."' WHERE `id` = '".$data['id']."'"; $DB->queryOrDie($query2, "0.78 update ticket bookmarks"); } else { $query2 = "DELETE FROM `glpi_bookmarks` WHERE `id` = '".$data['id']."'"; $DB->queryOrDie($query2, "0.78 delete ticket bookmarks : cannot convert"); } // Lost paramaters //only_computers=1&contains=dddd&field=moboard.designation& } } } if (!TableExists('glpi_ticketvalidations')) { $query = "CREATE TABLE `glpi_ticketvalidations` ( `id` int(11) NOT NULL auto_increment, `entities_id` int(11) NOT NULL default '0', `users_id` int(11) NOT NULL default '0', `tickets_id` int(11) NOT NULL default '0', `users_id_validate` int(11) NOT NULL default '0', `comment_submission` text collate utf8_unicode_ci, `comment_validation` text collate utf8_unicode_ci, `status` varchar(255) collate utf8_unicode_ci default 'waiting', `submission_date` datetime default NULL, `validation_date` datetime default NULL, PRIMARY KEY (`id`), KEY `entities_id` (`entities_id`), KEY `users_id` (`users_id`), KEY `users_id_validate` (`users_id_validate`), KEY `tickets_id` (`tickets_id`), KEY `submission_date` (`submission_date`), KEY `validation_date` (`validation_date`), KEY `status` (`status`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.78 create glpi_ticketvalidations"); $ADDTODISPLAYPREF['TicketValidation'] = array(3, 2, 8, 4, 9, 7); } if (!FieldExists('glpi_tickets','global_validation', false)) { $query = "ALTER TABLE `glpi_tickets` ADD `global_validation` varchar(255) collate utf8_unicode_ci default 'accepted', ADD INDEX `global_validation` (`global_validation`)"; $DB->queryOrDie($query, "0.78 add global_validation to glpi_tickets"); } if (!FieldExists('glpi_profiles','validate_ticket', false)) { $query = "ALTER TABLE `glpi_profiles` ADD `validate_ticket` char(1) collate utf8_unicode_ci default NULL"; $DB->queryOrDie($query, "0.78 add validate_ticket to glpi_profiles"); $query = "UPDATE `glpi_profiles` SET `validate_ticket` = '1' WHERE `interface` = 'central' "; $DB->queryOrDie($query, "0.78 add validate_ticket write right to super-admin and admin profiles"); $query = "ALTER TABLE `glpi_profiles` ADD `create_validation` char(1) collate utf8_unicode_ci default NULL"; $DB->queryOrDie($query, "0.78 add create_validation to glpi_profiles"); $query = "UPDATE `glpi_profiles` SET `create_validation` = `own_ticket`"; $DB->queryOrDie($query, "0.78 add create_validation right if can own ticket"); } if (FieldExists('glpi_mailcollectors','entities_id', false)) { $ranking = 1; // No mailcollector : set a default rule if (countElementsInTable('glpi_mailcollectors') == 0) { $query = "INSERT INTO `glpi_rules` VALUES (NULL, -1, 'RuleMailCollector', $ranking, 'Root', '', 'OR', 1, NULL, NULL)"; $DB->queryOrDie($query, "0.78 error inserting new default maigate rule"); if ($newID = $DB->insert_id()) { $query = "INSERT INTO `glpi_rulecriterias` VALUES (NULL, $newID, 'subject', 6, '/.*/')"; $DB->queryOrDie($query, "0.78 error getting new criteria for rule"); $query = "INSERT INTO `glpi_ruleactions` VALUES (NULL, $newID, 'assign', 'entities_id', '0')"; $DB->queryOrDie($query, "0.78 error getting new action for rule"); } } else { foreach (getAllDatasFromTable('glpi_mailcollectors') as $collector) { $query = "INSERT INTO `glpi_rules` VALUES (NULL, -1, 'RuleMailCollector', $ranking, '".$collector['name']."', '', 'AND', 1, NULL, NULL)"; $DB->queryOrDie($query, "0.78 error inserting new maigate rule ".$collector['name']); if ($newID = $DB->insert_id()) { $query = "INSERT INTO `glpi_rulecriterias` VALUES (NULL, $newID, 'mailcollector', 0, '".$collector['id']."')"; $DB->queryOrDie($query, "0.78 error getting new criteria for rule ".$collector['name']); $query = "INSERT INTO `glpi_ruleactions` VALUES (NULL, $newID, 'assign', 'entities_id', '".$collector['entities_id']."')"; $DB->queryOrDie($query, "0.78 error getting new action for rule ".$collector['name']); } $ranking++; } } $query = "ALTER TABLE `glpi_mailcollectors` DROP INDEX `entities_id` "; $DB->queryOrDie($query, "0.78 drop index entities_id from glpi_mailcollectors"); $query = "ALTER TABLE `glpi_mailcollectors` DROP `entities_id` "; $DB->queryOrDie($query, "0.78 drop entities_id from glpi_mailcollectors"); $query = "DELETE FROM `glpi_displaypreferences` WHERE `itemtype` = 'MailCollector' AND `num` = '80'"; $DB->queryOrDie($query, "0.78 drop entities_id from collectors display preferences"); } if (!TableExists('glpi_notimportedemails')) { $query = "CREATE TABLE `glpi_notimportedemails` ( `id` int(11) NOT NULL AUTO_INCREMENT, `from` varchar(255) NOT NULL, `to` varchar(255) NOT NULL, `mailcollectors_id` int(11) NOT NULL DEFAULT '0', `date` datetime NOT NULL, `subject` text, `messageid` varchar(255) NOT NULL, `reason` int(11) NOT NULL DEFAULT '0', `users_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `users_id` (`users_id`), KEY `mailcollectors_id` (`mailcollectors_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;"; $DB->queryOrDie($query, "0.78 add table glpi_notimportedemails"); $ADDTODISPLAYPREF['NotImportedEmail'] = array(2, 5, 4, 6, 16, 19); } if (!FieldExists("glpi_profiles","entity_rule_ticket", false)) { $query = "ALTER TABLE `glpi_profiles` ADD `entity_rule_ticket` CHAR( 1 ) NULL AFTER `rule_ticket`"; $DB->queryOrDie($query, "0.78 add entity_rule_ldap in glpi_profiles"); $query = "UPDATE `glpi_profiles` SET `entity_rule_ticket` = `rule_ticket`"; $DB->queryOrDie($query, "0.78 update default entity_rule_ticket rights"); $query = "UPDATE `glpi_profiles` SET `rule_ticket` = 'r' WHERE `rule_ticket` = 'w'"; $DB->queryOrDie($query, "0.78 update rule_ticket rights"); } if (!FieldExists('glpi_authldaps','is_default', false)) { $query = "ALTER TABLE `glpi_authldaps` ADD `is_default` TINYINT( 1 ) NOT NULL DEFAULT '0', ADD INDEX `is_default` (`is_default`)"; $DB->queryOrDie($query, "0.78 add is_default to glpi_authldaps"); $query = "SELECT COUNT(*) AS cpt FROM `glpi_authldaps`"; $result = $DB->query($query); $number_servers = $DB->result($result,0,'cpt'); if ($number_servers >= 1) { //If only one server defined if ($number_servers==1) { $query = "SELECT `id` FROM `glpi_authldaps`"; $result = $DB->query($query); $ldapservers_id = $DB->result($result,0,'id'); } //If more than one server defined, get the most used else { $query = "SELECT `auths_id`, COUNT(`auths_id`) AS cpt FROM `glpi_users` WHERE `authtype` = '3' GROUP BY `auths_id` ORDER BY `cpt` DESC"; $result = $DB->query($query); $ldapservers_id = $DB->result($result,0,'auths_id'); } $query = "UPDATE `glpi_authldaps` SET `is_default` = '1' WHERE `id` = '".$ldapservers_id."'"; $DB->queryOrDie($query, "0.78 set default directory"); } } if (TableExists('glpi_rulerightparameters')) { $query = "ALTER TABLE `glpi_rulerightparameters` ADD `comment` TEXT NOT NULL "; $DB->queryOrDie($query, "0.78 add comment to glpi_rulerightparameters"); $ADDTODISPLAYPREF['RuleRightParameter']=array(11); } if (!FieldExists('glpi_rules','is_recursive', false)) { $query = "ALTER TABLE `glpi_rules` ADD `is_recursive` TINYINT( 1 ) NOT NULL DEFAULT '0', ADD INDEX `is_recursive` (`is_recursive`)"; $DB->queryOrDie($query, "0.78 add is_recursive to glpi_rules"); $query = "UPDATE `glpi_rules` SET `entities_id` = '0' WHERE `entities_id` = '-1'"; $DB->queryOrDie($query, "0.78 set entities_id to 0 where value is -1 in glpi_rules"); $query = "UPDATE `glpi_rules` SET `is_recursive`='1' WHERE `sub_type` = 'RuleTicket'"; $DB->queryOrDie($query, "0.78 set is_recursive to 1 for RuleTicket in glpi_rules"); } if (!FieldExists('glpi_configs','user_deleted_ldap', false)) { $query = "ALTER TABLE `glpi_configs` ADD `user_deleted_ldap` TINYINT( 1 ) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.78 add user_deleted_ldap to glpi_configs"); } if (!FieldExists("glpi_profiles","group_add_followup", false)) { $query = "ALTER TABLE `glpi_profiles` ADD `group_add_followups` CHAR(1) NULL AFTER `add_followups`"; $DB->queryOrDie($query, "0.78 add budget in glpi_profiles"); $query = "UPDATE `glpi_profiles` SET `group_add_followups`=`global_add_followups`"; $DB->queryOrDie($query, "0.78 update default budget rights"); } if (!FieldExists("glpi_groups_users","is_dynamic", false)) { $query = "ALTER TABLE `glpi_groups_users` ADD `is_dynamic` TINYINT( 1 ) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.78 add is_dynamic in glpi_groups_users"); //If group comes from an LDAP directory, then update users belonging to it //by setting is_dynamic to 1 $query ="UPDATE `glpi_groups_users` SET `is_dynamic`='1' WHERE groups_id IN (SELECT `id` FROM `glpi_groups` WHERE (`ldap_group_dn` IS NOT NULL AND `ldap_group_dn` <> '') OR ((`ldap_field` IS NOT NULL AND `ldap_field` <> '') AND (`ldap_value` IS NOT NULL AND `ldap_value` <> '')))"; $DB->queryOrDie($query, "0.78 update is_dynamic in glpi_groups_users"); } $migration->displayMessage(sprintf(__('Data migration - %s'), 'glpi_displaypreferences')); // Add search values for tickets $ADDTODISPLAYPREF['Ticket'] = array(12, 19, 15, 3, 4, 5, 7); foreach ($ADDTODISPLAYPREF as $type => $tab) { $query = "SELECT DISTINCT `users_id` FROM `glpi_displaypreferences` WHERE `itemtype` = '$type'"; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { while ($data = $DB->fetch_assoc($result)) { $query = "SELECT max(`rank`) FROM `glpi_displaypreferences` WHERE `users_id` = '".$data['users_id']."' AND `itemtype` = '$type'"; $result = $DB->query($query); $rank = $DB->result($result,0,0); $rank ++; foreach ($tab as $newval) { $query = "SELECT * FROM `glpi_displaypreferences` WHERE `users_id` = '".$data['users_id']."' AND `num` = '$newval' AND `itemtype` = '$type'"; if ($result2=$DB->query($query)) { if ($DB->numrows($result2)==0) { $query = "INSERT INTO `glpi_displaypreferences` (`itemtype` ,`num` ,`rank` ,`users_id`) VALUES ('$type', '$newval', '".$rank++."', '".$data['users_id']."')"; $DB->query($query); } } } } } else { // Add for default user $rank = 1; foreach ($tab as $newval) { $query = "INSERT INTO `glpi_displaypreferences` (`itemtype` ,`num` ,`rank` ,`users_id`) VALUES ('$type', '$newval', '".$rank++."', '0')"; $DB->query($query); } } } } // must always be at the end (only for end message) $migration->executeMigration(); return $updateresult; } ?> glpi-0.84.3+dfsg.1/install/update_072_0721.php000066400000000000000000000042721226600447100203300ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /// Update from 0.72 to 0.72.1 function update072to0721() { global $DB, $CFG_GLPI; //TRANS: %s is the number of new version echo "

    ".sprintf(__('Update to %s'), '0.72.1')."

    "; displayMigrationMessage("0721"); // Start if (!isIndex("glpi_groups", "ldap_group_dn")) { $query = "ALTER TABLE `glpi_groups` ADD INDEX `ldap_group_dn` ( `ldap_group_dn` );"; $DB->query($query, "0.72.1 add index on ldap_group_dn in glpi_groups"); } if (!isIndex("glpi_groups", "ldap_value")) { $query = "ALTER TABLE `glpi_groups` ADD INDEX `ldap_value` ( `ldap_value` );"; $DB->query($query, "0.72.1 add index on ldap_value in glpi_groups"); } if (!isIndex('glpi_tracking', 'date_mod')) { $query=" ALTER TABLE `glpi_tracking` ADD INDEX `date_mod` (`date_mod`) "; $DB->query($query, "0.72.1 add date_mod index in glpi_tracking"); } // Display "Work ended." message - Keep this as the last action. displayMigrationMessage("0721"); // End } // fin 0.72.1 ##################################################################################### ?> glpi-0.84.3+dfsg.1/install/update_0781_0782.php000066400000000000000000000212421226600447100204220ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /** * Update from 0.78.1 to 0.78.2 * * @return bool for success (will die for most error) */ function update0781to0782($output='HTML') { global $DB, $migration; $updateresult = true; //TRANS: %s is the number of new version $migration->displayTitle(sprintf(__('Update to %s'), '0.78.2')); $migration->setVersion('0.78.2'); $migration->displayMessage(__('Data migration')); // Updating schema /// Add document types $types = array('docx' => array('name' => 'Word XML', 'icon' => 'doc-dist.png'), 'xlsx' => array('name' => 'Excel XML', 'icon' => 'xls-dist.png'), 'pptx' => array('name' => 'PowerPoint XML', 'icon' => 'ppt-dist.png')); foreach ($types as $ext => $data) { $query = "SELECT * FROM `glpi_documenttypes` WHERE `ext` = '$ext'"; if ($result=$DB->query($query)) { if ($DB->numrows($result) == 0) { $query = "INSERT INTO `glpi_documenttypes` (`name`, `ext`, `icon`, `is_uploadable`, `date_mod`) VALUES ('".$data['name']."', '$ext', '".$data['icon']."', '1', NOW())"; $DB->queryOrDie($query, "0.78.2 add document type $ext"); } } } // Drop nl_be langage $query = "UPDATE `glpi_configs` SET `language` = 'nl_NL' WHERE `language` = 'nl_BE';"; $DB->queryOrDie($query, "0.78.2 drop nl_be langage"); $query = "UPDATE `glpi_users` SET `language` = 'nl_NL' WHERE `language` = 'nl_BE';"; $DB->queryOrDie($query, "0.78.2 drop nl_be langage"); // CLean sl_SL $query = "UPDATE `glpi_configs` SET `language` = 'sl_SI' WHERE `language` = 'sl_SL';"; $DB->queryOrDie($query, "0.78.2 clean sl_SL langage"); $query = "UPDATE `glpi_users` SET `language` = 'sl_SI' WHERE `language` = 'sl_SL';"; $DB->queryOrDie($query, "0.78.2 clean sl_SL langage"); if (isIndex('glpi_computers_items', 'unicity')) { $query = "ALTER TABLE `glpi_computers_items` DROP INDEX `unicity`"; $DB->queryOrDie($query, "0.78.2 drop unicity index for glpi_computers_items"); $query = "ALTER TABLE `glpi_computers_items` ADD INDEX `item` ( `itemtype` , `items_id` ) "; $DB->queryOrDie($query, "0.78.2 add index for glpi_computers_items"); } // For Rule::RULE_TRACKING_AUTO_ACTION $changes['RuleMailCollector'] = array('X-Priority' => 'x-priority'); $DB->query("SET SESSION group_concat_max_len = 9999999;"); foreach ($changes as $ruletype => $tab) { // Get rules $query = "SELECT GROUP_CONCAT(`id`) FROM `glpi_rules` WHERE `sub_type` = '".$ruletype."' GROUP BY `sub_type`"; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { // Get rule string $rules = $DB->result($result,0,0); // Update actions foreach ($tab as $old => $new) { $query = "UPDATE `glpi_ruleactions` SET `field` = '$new' WHERE `field` = '$old' AND `rules_id` IN ($rules)"; $DB->queryOrDie($query, "0.78.2 update datas for rules actions"); } // Update criterias foreach ($tab as $old => $new) { $query = "UPDATE `glpi_rulecriterias` SET `criteria` = '$new' WHERE `criteria` = '$old' AND `rules_id` IN ($rules)"; $DB->queryOrDie($query, "0.78.2 update datas for rules criterias"); } } } } // Reorder ranking : start with 1 $query = "SELECT DISTINCT `sub_type` FROM `glpi_rules` WHERE ranking = '0'"; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { while ($data = $DB->fetch_assoc($result)) { $query = "UPDATE `glpi_rules` SET `ranking` = ranking +1 WHERE `sub_type` = '".$data['sub_type']."';"; $DB->queryOrDie($query, "0.78.2 reorder rule ranking for ".$data['sub_type']); } } } // Check existing rule if (countElementsInTable('glpi_rulecriterias', "`criteria` IN ('auto-submitted','x-auto-response-suppress')") == 0 ) { /// Reorder ranking $query = "UPDATE `glpi_rules` SET `ranking` = ranking +2 WHERE `sub_type` = 'RuleMailCollector';"; $DB->queryOrDie($query, "0.78.2 reorder rule ranking for RuleMailCollector"); /// Insert new rule $query = "INSERT INTO `glpi_rules` (`entities_id`, `sub_type`, `ranking`, `name`, `description`, `match`, `is_active`, `date_mod`, `is_recursive`) VALUES ('0', 'RuleMailCollector', '1', 'Auto-Reply X-Auto-Response-Suppress', 'Exclude Auto-Reply emails using X-Auto-Response-Suppress header', 'AND', 0, NOW(), 1)"; $DB->queryOrDie($query, "0.78.2 add new rule RuleMailCollector"); $rule_id = $DB->insert_id(); /// Insert criteria and action $query = "INSERT INTO `glpi_rulecriterias` (`rules_id`, `criteria`, `condition`, `pattern`) VALUES ('$rule_id', 'x-auto-response-suppress', '6', '/\\\\S+/')"; $DB->queryOrDie($query, "0.78.2 add new criteria RuleMailCollector"); $query = "INSERT INTO `glpi_ruleactions` (`rules_id`, `action_type`, `field`, `value`) VALUES ('$rule_id', 'assign', '_refuse_email_no_response', '1')"; $DB->queryOrDie($query, "0.78.2 add new action RuleMailCollector"); /// Insert new rule $query = "INSERT INTO `glpi_rules` (`entities_id`, `sub_type`, `ranking`, `name`, `description`, `match`, `is_active`, `date_mod`, `is_recursive`) VALUES ('0', 'RuleMailCollector', '2', 'Auto-Reply Auto-Submitted', 'Exclude Auto-Reply emails using Auto-Submitted header', 'AND', 0, NOW(), 1)"; $DB->queryOrDie($query, "0.78.2 add new rule RuleMailCollector"); $rule_id = $DB->insert_id(); /// Insert criteria and action $query = "INSERT INTO `glpi_rulecriterias` (`rules_id`, `criteria`, `condition`, `pattern`) VALUES ('$rule_id', 'auto-submitted', '6', '/\\\\S+/')"; $DB->queryOrDie($query, "0.78.2 add new criteria RuleMailCollector"); $query = "INSERT INTO `glpi_rulecriterias` (`rules_id`, `criteria`, `condition`, `pattern`) VALUES ('$rule_id', 'auto-submitted', '1', 'no')"; $DB->queryOrDie($query, "0.78.2 add new criteria RuleMailCollector"); $query = "INSERT INTO `glpi_ruleactions` (`rules_id`, `action_type`, `field`, `value`) VALUES ('$rule_id', 'assign', '_refuse_email_no_response', '1')"; $DB->queryOrDie($query, "0.78.2 add new action RuleMailCollector"); } if (!FieldExists('glpi_ocsservers','ocs_db_utf8', false)) { $query = "ALTER TABLE `glpi_ocsservers` ADD `ocs_db_utf8` tinyint(1) NOT NULL default '0' AFTER `ocs_db_name`"; $DB->queryOrDie($query, "0.78.2 add ocs_db_utf8 in glpi_ocsservers"); } // must always be at the end (only for end message) $migration->executeMigration(); return $updateresult; } ?> glpi-0.84.3+dfsg.1/install/update_0782_080.php000077500000000000000000002220441226600447100203400ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /** * Update from 0.78.2 to 0.80 * * @return bool for success (will die for most error) **/ function update0782to080() { global $DB,$migration; $updateresult = true; $ADDTODISPLAYPREF = array(); //TRANS: %s is the number of new version $migration->displayTitle(sprintf(__('Update to %s'), '0.80')); $migration->setVersion('0.80'); $backup_tables = false; $newtables = array('glpi_calendars', 'glpi_calendars_holidays', 'glpi_calendarsegments', 'glpi_computervirtualmachines', 'glpi_computers_softwarelicenses', 'glpi_fieldblacklists', 'glpi_fieldunicities', 'glpi_groups_tickets', 'glpi_holidays', 'glpi_rulecacheprinters', 'glpi_slas', 'glpi_slalevels', 'glpi_slalevels_tickets', 'glpi_slalevelactions', 'glpi_tickets_tickets', 'glpi_tickets_users', 'glpi_ticketsatisfactions', 'glpi_ticketsolutiontemplates', 'glpi_virtualmachinestates', 'glpi_virtualmachinesystems', 'glpi_virtualmachinetypes'); foreach ($newtables as $new_table) { // rename new tables if exists ? if (TableExists($new_table)) { if (TableExists("backup_$new_table")) { $query = "DROP TABLE `backup_".$new_table."`"; $DB->queryOrDie($query, "0.80 drop backup table backup_$new_table"); } $migration->displayWarning("$new_table table already exists. ". "A backup have been done to backup_$new_table."); $backup_tables = true; $query = $migration->renameTable("$new_table", "backup_$new_table"); } } if ($backup_tables) { $migration->displayWarning("You can delete backup tables if you have no need of them.", true); } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'Calendar')); // Updating schema $default_calendar_id = 0; if (!TableExists('glpi_calendars')) { $query = "CREATE TABLE `glpi_calendars` ( `id` int(11) NOT NULL auto_increment, `name` varchar(255) default NULL, `entities_id` int(11) NOT NULL default '0', `is_recursive` tinyint(1) NOT NULL default '0', `comment` TEXT DEFAULT NULL , `date_mod` DATETIME DEFAULT NULL , `cache_duration` TEXT DEFAULT NULL , PRIMARY KEY (`id`), KEY `name` (`name`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`), KEY `date_mod` (`date_mod`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.80 create glpi_calendars"); $ADDTODISPLAYPREF['Calendar'] = array(19); // Create default calendar : use existing config planning_begin _end $query = "INSERT INTO `glpi_calendars` (`name`, `entities_id`, `is_recursive`, `comment`) VALUES ('Default', 0, 1, 'Default calendar');"; $DB->queryOrDie($query, "0.80 add default glpi_calendars"); $default_calendar_id = $DB->insert_id(); } if (!TableExists('glpi_calendarsegments')) { $query = "CREATE TABLE `glpi_calendarsegments` ( `id` int(11) NOT NULL auto_increment, `calendars_id` int(11) NOT NULL default '0', `entities_id` int(11) NOT NULL default '0', `is_recursive` tinyint(1) NOT NULL default '0', `day` tinyint(1) NOT NULL default '1' COMMENT 'numer of the day based on date(w)', `begin` time DEFAULT NULL, `end` time DEFAULT NULL, PRIMARY KEY (`id`), KEY `calendars_id` (`calendars_id`), KEY `day` (`day`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.80 create glpi_calendarsegments"); // add defautl days : from monday to friday if ($default_calendar_id>0) { $query = "SELECT `planning_begin`, `planning_end` FROM `glpi_configs` WHERE `id` = '1'"; if ($result = $DB->query($query)) { $begin = $DB->result($result, 0, 'planning_begin'); $end = $DB->result($result, 0, 'planning_end'); if ($begin < $end) { for ($i=1 ; $i<6 ; $i++) { $query = "INSERT INTO `glpi_calendarsegments` (`calendars_id`, `day`, `begin`, `end`) VALUES ($default_calendar_id, $i, '$begin', '$end')"; $DB->queryOrDie($query, "0.80 add default glpi_calendarsegments"); } } } // Update calendar $calendar = new Calendar(); if ($calendar->getFromDB($default_calendar_id)) { $query = "UPDATE `glpi_calendars` SET `cache_duration` = '".exportArrayToDB($calendar->getDaysDurations())."' WHERE `id` = '$default_calendar_id'"; $DB->queryOrDie($query, "0.80 update default calendar cache"); } } } // Holidays : wrong management : may be a group of several days : will be easy to managed holidays if (!TableExists('glpi_holidays')) { $query = "CREATE TABLE `glpi_holidays` ( `id` int(11) NOT NULL auto_increment, `name` varchar(255) default NULL, `entities_id` int(11) NOT NULL default '0', `is_recursive` tinyint(1) NOT NULL default '0', `comment` TEXT DEFAULT NULL , `begin_date` date default NULL, `end_date` date default NULL, `is_perpetual` tinyint(1) NOT NULL default '0', PRIMARY KEY (`id`), KEY `name` (`name`), KEY `begin_date` (`begin_date`), KEY `end_date` (`end_date`), KEY `is_perpetual` (`is_perpetual`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.80 create glpi_holidays"); $ADDTODISPLAYPREF['Holiday'] = array(11, 12, 13); } if (!TableExists('glpi_calendars_holidays')) { $query = "CREATE TABLE `glpi_calendars_holidays` ( `id` int(11) NOT NULL auto_increment, `calendars_id` int(11) NOT NULL default '0', `holidays_id` int(11) NOT NULL default '0', PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`calendars_id`,`holidays_id`), KEY `holidays_id` (`holidays_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.80 create glpi_calendars_holidays"); } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'SLA')); // Updating schema if (!TableExists('glpi_slas')) { $query = "CREATE TABLE `glpi_slas` ( `id` int(11) NOT NULL auto_increment, `name` varchar(255) default NULL, `entities_id` int(11) NOT NULL default '0', `is_recursive` tinyint(1) NOT NULL default '0', `comment` TEXT DEFAULT NULL , `resolution_time` int(11) NOT NULL, `calendars_id` int(11) NOT NULL default '0', `date_mod` datetime default NULL, PRIMARY KEY (`id`), KEY `name` (`name`), KEY `calendars_id` (`calendars_id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`), KEY `date_mod` (`date_mod`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.80 create glpi_slas"); $ADDTODISPLAYPREF['SLA'] = array(4); // Get first Ticket template $query = "SELECT `id` FROM `glpi_notificationtemplates` WHERE `itemtype` LIKE 'Ticket%' ORDER BY `id` ASC"; if ($result=$DB->query($query)) { if ($DB->numrows($result)>0) { $query = "INSERT INTO `glpi_notifications` (`name`, `entities_id`, `itemtype`, `event`, `mode`, `notificationtemplates_id`, `comment`, `is_recursive`, `is_active`, `date_mod`) VALUES ('Ticket Recall', 0, 'Ticket', 'recall', 'mail', ".$DB->result($result,0,0).", '', 1, 1, NOW());"; $DB->queryOrDie($query, "0.80 insert notification"); } } } if (!TableExists('glpi_slalevels')) { $query = "CREATE TABLE `glpi_slalevels` ( `id` int(11) NOT NULL auto_increment, `name` varchar(255) collate utf8_unicode_ci default NULL, `slas_id` int(11) NOT NULL default '0', `execution_time` int(11) NOT NULL, `is_active` tinyint(1) NOT NULL default '1', PRIMARY KEY (`id`), KEY `name` (`name`), KEY `is_active` (`is_active`), KEY `slas_id` (`slas_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.80 create glpi_slalevels"); } if (!TableExists('glpi_slalevelactions')) { $query = "CREATE TABLE `glpi_slalevelactions` ( `id` int(11) NOT NULL auto_increment, `slalevels_id` int(11) NOT NULL default '0', `action_type` varchar(255) collate utf8_unicode_ci default NULL, `field` varchar(255) collate utf8_unicode_ci default NULL, `value` varchar(255) collate utf8_unicode_ci default NULL, PRIMARY KEY (`id`), KEY `slalevels_id` (`slalevels_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ;"; $DB->queryOrDie($query, "0.80 create glpi_slalevelactions"); } $migration->addField("glpi_profiles", "calendar", "CHAR( 1 ) NULL", array('update' => "`entity_dropdown`")); $migration->addField("glpi_profiles", "sla", "CHAR( 1 ) NULL", array('update' => "`entity_rule_ticket`")); $migration->addField("glpi_tickets", "slas_id", "INT( 11 ) NOT NULL DEFAULT 0"); $migration->addKey("glpi_tickets", "slas_id"); $migration->addField("glpi_tickets", "slalevels_id", "INT( 11 ) NOT NULL DEFAULT 0"); $migration->addKey("glpi_tickets", "slalevels_id"); if ($migration->addField("glpi_tickets", "due_date", "datetime default NULL")) { $ADDTODISPLAYPREF['Ticket'] = array(18); } $migration->addKey("glpi_tickets", "due_date"); $migration->addField("glpi_tickets", "begin_waiting_date", "datetime default NULL"); $migration->addField("glpi_tickets", "sla_waiting_duration", "INT( 11 ) NOT NULL DEFAULT 0"); if (!TableExists('glpi_slalevels_tickets')) { $query = "CREATE TABLE `glpi_slalevels_tickets` ( `id` int(11) NOT NULL auto_increment, `tickets_id` int(11) NOT NULL default '0', `slalevels_id` int(11) NOT NULL default '0', `date` datetime default NULL, PRIMARY KEY (`id`), KEY `tickets_id` (`tickets_id`), KEY `slalevels_id` (`slalevels_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ;"; $DB->queryOrDie($query, "0.80 create glpi_slalevels_tickets"); } if (!countElementsInTable('glpi_crontasks', "`itemtype`='SlaLevel_Ticket' AND `name`='slaticket'")) { $query = "INSERT INTO `glpi_crontasks` (`itemtype`, `name`, `frequency`, `param`, `state`, `mode`, `allowmode`, `hourmin`, `hourmax`, `logs_lifetime`, `lastrun`, `lastcode`, `comment`) VALUES ('SlaLevel_Ticket', 'slaticket', 300, NULL, 1, 1, 3, 0, 24, 30, NULL, NULL, NULL)"; $DB->queryOrDie($query, "0.80 populate glpi_crontasks for slaticket"); } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'PasswordForget')); // Updating schema $migration->addField("glpi_users", "token", "char( 40 ) NULL DEFAULT ''"); $migration->addField("glpi_users", "tokendate", "datetime NULL DEFAULT NULL"); $query = "SELECT * FROM `glpi_notificationtemplates` WHERE `name` = 'Password Forget'"; if ($result=$DB->query($query)) { if ($DB->numrows($result)==0) { $query = "INSERT INTO `glpi_notificationtemplates` (`name`, `itemtype`, `date_mod`) VALUES ('Password Forget', 'User', NOW())"; $DB->queryOrDie($query, "0.80 add password forget notification"); $notid = $DB->insert_id(); $query = "INSERT INTO `glpi_notificationtemplatetranslations` (`notificationtemplates_id`, `language`, `subject`, `content_text`, `content_html`) VALUES ($notid, '', '##user.action##', '##user.realname## ##user.firstname## ##lang.passwordforget.information## ##lang.passwordforget.link## ##user.passwordforgeturl##', '<p><strong>##user.realname## ##user.firstname##</strong></p> <p>##lang.passwordforget.information##</p> <p>##lang.passwordforget.link## <a title=\"##user.passwordforgeturl##\" href=\"##user.passwordforgeturl##\">##user.passwordforgeturl##</a></p>')"; $DB->queryOrDie($query, "0.80 add password forget notification translation"); $query = "INSERT INTO `glpi_notifications` (`name`, `entities_id`, `itemtype`, `event`, `mode`, `notificationtemplates_id`, `comment`, `is_recursive`, `is_active`, `date_mod`) VALUES ('Password Forget', 0, 'User', 'passwordforget', 'mail', $notid, '', 1, 1, NOW())"; $DB->queryOrDie($query, "0.80 add password forget notification"); $notifid = $DB->insert_id(); $query = "INSERT INTO `glpi_notificationtargets` (`id`, `notifications_id`, `type`, `items_id`) VALUES (NULL, $notifid, 1, 19);"; $DB->queryOrDie($query, "0.80 add password forget notification target"); } } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'Ticket')); // Updating schema $migration->addField("glpi_tickets", "ticket_waiting_duration", "INT( 11 ) NOT NULL DEFAULT 0"); $migration->addField("glpi_entitydatas", "calendars_id", "INT( 11 ) NOT NULL DEFAULT 0"); $migration->addField("glpi_tickets", "close_delay_stat", "INT( 11 ) NOT NULL DEFAULT 0", array('update' => "(UNIX_TIMESTAMP(`glpi_tickets`.`closedate`) - UNIX_TIMESTAMP(`glpi_tickets`.`date`))", 'condition' => " WHERE `glpi_tickets`.`status` = 'closed' AND `glpi_tickets`.`date` IS NOT NULL AND `glpi_tickets`.`closedate` IS NOT NULL AND `glpi_tickets`.`closedate` > `glpi_tickets`.`date`")); $migration->addField("glpi_tickets", "solve_delay_stat", "INT( 11 ) NOT NULL DEFAULT 0", array('update' => "(UNIX_TIMESTAMP(`glpi_tickets`.`solvedate`) - UNIX_TIMESTAMP(`glpi_tickets`.`date`))", 'condition' =>" WHERE (`glpi_tickets`.`status` = 'closed' OR `glpi_tickets`.`status` = 'solved') AND `glpi_tickets`.`date` IS NOT NULL AND `glpi_tickets`.`solvedate` IS NOT NULL AND `glpi_tickets`.`solvedate` > `glpi_tickets`.`date`")); if ($migration->addField("glpi_tickets", "takeintoaccount_delay_stat", "INT( 11 ) NOT NULL DEFAULT 0")) { $migration->migrationOneTable('glpi_tickets'); // Manage stat computation for existing tickets // Solved tickets $query = "SELECT `glpi_tickets`.`id` AS ID, MIN(UNIX_TIMESTAMP(`glpi_tickets`.`solvedate`) - UNIX_TIMESTAMP(`glpi_tickets`.`date`)) AS OPEN, MIN(UNIX_TIMESTAMP(`glpi_ticketfollowups`.`date`) - UNIX_TIMESTAMP(`glpi_tickets`.`date`)) AS FIRST, MIN(UNIX_TIMESTAMP(`glpi_tickettasks`.`date`) - UNIX_TIMESTAMP(`glpi_tickets`.`date`)) AS FIRST2 FROM `glpi_tickets` LEFT JOIN `glpi_ticketfollowups` ON (`glpi_ticketfollowups`.`tickets_id` = `glpi_tickets`.`id`) LEFT JOIN `glpi_tickettasks` ON (`glpi_tickettasks`.`tickets_id` = `glpi_tickets`.`id`) WHERE (`glpi_tickets`.`status` = 'closed' OR `glpi_tickets`.`status` = 'solved') AND `glpi_tickets`.`solvedate` IS NOT NULL GROUP BY `glpi_tickets`.`id`"; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { while ($data = $DB->fetch_assoc($result)) { $firstactiontime = min($data['OPEN'], $data['FIRST'], $data['FIRST2']); $firstactiontime = max(0, $firstactiontime); $query2 = "UPDATE `glpi_tickets` SET `takeintoaccount_delay_stat` = '$firstactiontime' WHERE `id` = '".$data['ID']."'"; $DB->queryOrDie($query2, "0.80 update takeintoaccount_delay_stat values for #". $data['ID']); } } } // Not solved tickets $query = "SELECT `glpi_tickets`.`id` AS ID, MIN(UNIX_TIMESTAMP(`glpi_ticketfollowups`.`date`) - UNIX_TIMESTAMP(`glpi_tickets`.`date`)) AS FIRST, MIN(UNIX_TIMESTAMP(`glpi_tickettasks`.`date`) - UNIX_TIMESTAMP(`glpi_tickets`.`date`)) AS FIRST2 FROM `glpi_tickets` LEFT JOIN `glpi_ticketfollowups` ON (`glpi_ticketfollowups`.`tickets_id` = `glpi_tickets`.`id`) LEFT JOIN `glpi_tickettasks` ON (`glpi_tickettasks`.`tickets_id` = `glpi_tickets`.`id`) WHERE (`glpi_tickets`.`status` <> 'closed' AND `glpi_tickets`.`status` <> 'solved') OR `glpi_tickets`.`solvedate` IS NULL GROUP BY `glpi_tickets`.`id`"; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { while ($data = $DB->fetch_assoc($result)) { $firstactiontime = min($data['FIRST'], $data['FIRST2']); $firstactiontime = max(0, $firstactiontime); $query2 = "UPDATE `glpi_tickets` SET `takeintoaccount_delay_stat` = '$firstactiontime' WHERE `id` = '".$data['ID']."'"; $DB->queryOrDie($query2, "0.80 update takeintoaccount_delay_stat values for #".$data['ID']); } } } } // Put realtime in seconds $migration->addField("glpi_tickets", "actiontime", "INT( 11 ) NOT NULL DEFAULT 0", array('update' => "ROUND(realtime * 3600)")); $migration->dropField("glpi_tickets", "realtime"); $migration->addField("glpi_tickettasks", "actiontime", "INT( 11 ) NOT NULL DEFAULT 0", array('update' => "ROUND(realtime * 3600)")); $migration->dropField("glpi_tickettasks", "realtime"); $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'Software')); // Updating schema if ($migration->addField("glpi_softwareversions", "operatingsystems_id", "INT( 11 ) NOT NULL DEFAULT '0'")) { $migration->addKey("glpi_softwareversions", "operatingsystems_id"); $migration->migrationOneTable('glpi_softwareversions'); $query = "UPDATE `glpi_softwareversions`, (SELECT `id`, `operatingsystems_id` FROM `glpi_softwares`) AS SOFT SET `glpi_softwareversions`.`operatingsystems_id` = `SOFT`.`operatingsystems_id` WHERE `glpi_softwareversions`.`softwares_id` = `SOFT`.`id` "; $DB->queryOrDie($query, "0.80 transfer operatingsystems_id from glpi_softwares to glpi_softwareversions"); $migration->dropField("glpi_softwares", "operatingsystems_id"); } if (!isIndex("glpi_computers_softwareversions","unicity")) { // clean datas $query = "SELECT `computers_id`, `softwareversions_id`, COUNT(*) AS CPT FROM `glpi_computers_softwareversions` GROUP BY `computers_id`, `softwareversions_id` HAVING CPT > 1"; if ($result = $DB->query($query)) { if ($DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $query2 = "SELECT `id` FROM `glpi_computers_softwareversions` WHERE `computers_id` = '".$data['computers_id']."' AND `softwareversions_id` = '".$data['softwareversions_id']."' LIMIT 1"; if ($result2= $DB->query($query2)) { if ($DB->numrows($result2)) { $keep_id=$DB->result($result2,0,0); $query3 = "DELETE FROM `glpi_computers_softwareversions` WHERE `computers_id` = '".$data['computers_id']."' AND `softwareversions_id` = '".$data['softwareversions_id']."' AND `id` <> $keep_id"; $DB->queryOrDie($query3, "0.80 clean glpi_computers_softwareversions"); } } } } } $migration->addKey("glpi_computers_softwareversions", array('computers_id', 'softwareversions_id'), 'unicity', "UNIQUE"); } $migration->dropKey("glpi_computers_softwareversions", "computers_id"); // For real count : copy template and deleted information $migration->addField("glpi_computers_softwareversions", "is_deleted", "tinyint(1) NOT NULL DEFAULT 0"); // Gain de temps pour les beta-testeurs if ($migration->addField("glpi_computers_softwareversions", "is_template", "tinyint(1) NOT NULL DEFAULT 0")) { $migration->migrationOneTable('glpi_computers_softwareversions'); // Update datas $query = "SELECT DISTINCT `computers_id` FROM `glpi_computers_softwareversions`"; if ($result = $DB->query($query)) { if ($DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $comp = new Computer(); if ($comp->getFromDB($data['computers_id'])) { $query = "UPDATE `glpi_computers_softwareversions` SET `is_template` = '".$comp->getField('is_template')."', `is_deleted` = '".$comp->getField('is_deleted')."' WHERE `computers_id` = '".$data['computers_id']."';"; $DB->query($query); } } } } } if (!TableExists("glpi_computers_softwarelicenses")) { $query = "CREATE TABLE `glpi_computers_softwarelicenses` ( `id` int(11) NOT NULL auto_increment, `computers_id` int(11) NOT NULL default '0', `softwarelicenses_id` int(11) NOT NULL default '0', PRIMARY KEY (`id`), KEY `computers_id` (`computers_id`), KEY `softwarelicenses_id` (`softwarelicenses_id`), UNIQUE `unicity` ( `computers_id` , `softwarelicenses_id` ) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.80 create glpi_computers_softwarelicenses"); } if (FieldExists("glpi_softwarelicenses","computers_id", false)) { $query = "SELECT * FROM `glpi_softwarelicenses` WHERE `computers_id` > 0 AND `computers_id` IS NOT NULL"; if ($result = $DB->query($query)) { if ($DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $query = "INSERT INTO `glpi_computers_softwarelicenses` (`computers_id`, `softwarelicenses_id`) VALUES ('".$data['computers_id']."','".$data['id']."')"; $DB->queryOrDie($query, "0.80 migrate data to computers_softwarelicenses table"); } } } $migration->dropField("glpi_softwarelicenses", "computers_id"); } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'Common')); // Updating schema $migration->addField("glpi_softwarelicenses", "date_mod", "DATETIME NULL"); $migration->addKey("glpi_softwarelicenses", "date_mod"); $migration->renameTable("glpi_cartridges_printermodels", "glpi_cartridgeitems_printermodels"); $migration->addField("glpi_monitors", "have_hdmi", "tinyint(1) NOT NULL DEFAULT 0 AFTER `have_pivot`"); $migration->addField("glpi_monitors", "have_displayport", "tinyint(1) NOT NULL DEFAULT 0 AFTER `have_hdmi`"); $migration->dropField("glpi_configs", "dbreplicate_email"); $migration->addField("glpi_configs", "auto_create_infocoms", "tinyint(1) NOT NULL DEFAULT 0"); $migration->addField("glpi_configs", "csv_delimiter", "CHAR( 1 ) NOT NULL AFTER `number_format`", array('update' => "';'")); $migration->addField("glpi_users", "csv_delimiter", "CHAR( 1 ) NULL AFTER `number_format`"); $migration->addField("glpi_users", "names_format", "INT( 11 ) NULL DEFAULT NULL AFTER `number_format`"); // drop car fait sur mauvais champ $migration->dropKey("glpi_budgets", "end_date"); $migration->migrationOneTable("glpi_budgets"); $migration->addKey("glpi_budgets", "end_date"); $migration->addField("glpi_authldaps", "is_active", "TINYINT( 1 ) NOT NULL DEFAULT '0'", array('update' => "'1'")); $ADDTODISPLAYPREF['AuthLdap'] = array(30); $migration->addField("glpi_authmails", "is_active", "TINYINT( 1 ) NOT NULL DEFAULT '0'", array('update' => "'1'")); $ADDTODISPLAYPREF['AuthMail'] = array(6); $migration->addField("glpi_ocsservers", "is_active", "TINYINT( 1 ) NOT NULL DEFAULT '0'", array('update' => "'1'")); $ADDTODISPLAYPREF['OcsServer'] = array(6); $migration->changeField("glpi_configs", "use_auto_assign_to_tech", "auto_assign_mode", "INT( 11 ) NOT NULL DEFAULT '1'"); $migration->addField("glpi_entitydatas", "auto_assign_mode", "INT( 11 ) NOT NULL DEFAULT '-1'"); $migration->changeField("glpi_entitydatas", "ldapservers_id", "authldaps_id", "INT( 11 ) NOT NULL DEFAULT '0'"); $migration->addField("glpi_users", "user_dn", "TEXT DEFAULT NULL"); $migration->addField("glpi_tickets", "users_id_lastupdater", "INT( 11 ) NOT NULL DEFAULT 0 AFTER `date_mod`"); $migration->addKey("glpi_tickets", "users_id_lastupdater"); $migration->addField("glpi_tickets", "type", "INT( 11 ) NOT NULL DEFAULT 1 AFTER `ticketcategories_id`"); $migration->addKey("glpi_tickets", "type"); $migration->addField("glpi_entitydatas", "tickettype", "INT( 11 ) NOT NULL DEFAULT 0"); // Link between tickets if (!TableExists('glpi_tickets_tickets')) { $query = "CREATE TABLE `glpi_tickets_tickets` ( `id` int(11) NOT NULL auto_increment, `tickets_id_1` int(11) NOT NULL default '0', `tickets_id_2` int(11) NOT NULL default '0', `link` int(11) NOT NULL default '1', PRIMARY KEY (`id`), KEY `unicity` (`tickets_id_1`,`tickets_id_2`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.80 create glpi_tickets_tickets"); } //inquest if (!TableExists('glpi_ticketsatisfactions')) { $query = "CREATE TABLE `glpi_ticketsatisfactions` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tickets_id` int(11) NOT NULL DEFAULT '0', `type` int(11) NOT NULL DEFAULT '1', `date_begin` DATETIME NULL , `date_answered` DATETIME NULL , `satisfaction` INT(11) NULL , `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), UNIQUE KEY `tickets_id` (`tickets_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.80 create glpi_ticketsatisfactions"); } // config inquest by entity $migration->addField("glpi_entitydatas", "max_closedate", "DATETIME NULL"); if (!countElementsInTable('glpi_crontasks', "`itemtype`='Ticket' AND `name`='createinquest'")) { $query = "INSERT INTO `glpi_crontasks` (`itemtype`, `name`, `frequency`, `param`, `state`, `mode`, `allowmode`, `hourmin`, `hourmax`, `logs_lifetime`, `lastrun`, `lastcode`, `comment`) VALUES ('Ticket', 'createinquest', 86400, NULL, 1, 1, 3, 0, 24, 30, NULL, NULL, NULL)"; $DB->queryOrDie($query, "0.80 populate glpi_crontasks for ticketsatisfaction"); } $migration->addField("glpi_entitydatas", "inquest_config", "INT(11) NOT NULL DEFAULT '0'"); $migration->addField("glpi_entitydatas", "inquest_rate", "INT(11) NOT NULL DEFAULT '-1'"); $migration->addField("glpi_entitydatas", "inquest_delay", "INT(11) NOT NULL DEFAULT '-1'"); $migration->addField("glpi_entitydatas", "inquest_URL", "VARCHAR( 255 ) NULL"); $migration->addField("glpi_networkports", "comment", "TEXT COLLATE utf8_unicode_ci"); $migration->addField("glpi_profiles", "rule_dictionnary_printer", "CHAR( 1 ) NULL", array('update' => "`rule_dictionnary_software`")); $query = "SELECT * FROM `glpi_notificationtemplates` WHERE `name` = 'Ticket Satisfaction'"; if ($result=$DB->query($query)) { if ($DB->numrows($result)==0) { $query = "INSERT INTO `glpi_notificationtemplates` (`name`, `itemtype`, `date_mod`) VALUES ('Ticket Satisfaction', 'Ticket', NOW())"; $DB->queryOrDie($query, "0.80 add ticket satisfaction notification"); $notid = $DB->insert_id(); $query = "INSERT INTO `glpi_notificationtemplatetranslations` (`notificationtemplates_id`, `language`, `subject`, `content_text`, `content_html`) VALUES ($notid, '', '##ticket.action## ##ticket.title##', '##lang.ticket.title## : ##ticket.title## ##lang.ticket.closedate## : ##ticket.closedate## ##lang.satisfaction.text## ##ticket.urlsatisfaction##', '<p>##lang.ticket.title## : ##ticket.title##</p> <p>##lang.ticket.closedate## : ##ticket.closedate##</p> <p>##lang.satisfaction.text## <a href=\"##ticket.urlsatisfaction##\">##ticket.urlsatisfaction##</a></p>')"; $DB->queryOrDie($query, "0.80 add ticket satisfaction notification translation"); $query = "INSERT INTO `glpi_notifications` (`name`, `entities_id`, `itemtype`, `event`, `mode`, `notificationtemplates_id`, `comment`, `is_recursive`, `is_active`, `date_mod`) VALUES ('Ticket Satisfaction', 0, 'Ticket', 'satisfaction', 'mail', $notid, '', 1, 1, NOW())"; $DB->queryOrDie($query, "0.80 add ticket satisfaction notification"); $notifid = $DB->insert_id(); // $query = "INSERT INTO `glpi_notificationtargets` // (`id`, `notifications_id`, `type`, `items_id`) // VALUES (NULL, $notifid, 1, 3)"; // $DB->queryOrDie($query, "0.80 add ticket satisfaction notification target"); } } //New infocom dates $migration->addField("glpi_infocoms", "order_date", "DATE NULL"); $migration->addField("glpi_infocoms", "delivery_date", "DATE NULL"); $migration->addField("glpi_infocoms", "inventory_date", "DATE NULL"); $migration->addField("glpi_infocoms", "warranty_date", "DATE NULL", array('update' => "`buy_date`")); if (!TableExists('glpi_rulecacheprinters')) { $query = "CREATE TABLE `glpi_rulecacheprinters` ( `id` int(11) NOT NULL AUTO_INCREMENT, `old_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `manufacturer` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `rules_id` int(11) NOT NULL DEFAULT '0', `new_value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `new_manufacturer` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `ignore_ocs_import` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `is_global` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `old_value` (`old_value`), KEY `rules_id` (`rules_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.80 add table glpi_rulecacheprinters"); } $migration->addField("glpi_configs", "use_slave_for_search", "tinyint( 1 ) NOT NULL DEFAULT '0'"); $migration->addField("glpi_configs", "admin_email_name", "varchar( 255 ) collate utf8_unicode_ci default NULL AFTER `admin_email`"); $migration->addField("glpi_configs", "admin_reply_name", "varchar( 255 ) collate utf8_unicode_ci default NULL AFTER `admin_reply`"); $migration->addField("glpi_entitydatas", "admin_email_name", "varchar( 255 ) collate utf8_unicode_ci default NULL AFTER `admin_email`"); $migration->addField("glpi_entitydatas", "admin_reply_name", "varchar( 255 ) collate utf8_unicode_ci default NULL AFTER `admin_reply`"); $migration->addField("glpi_notificationtemplates", "css", "text COLLATE utf8_unicode_ci"); $migration->addField("glpi_configs", "url_maxlength", "int(11) NOT NULL DEFAULT '30' AFTER `list_limit_max`"); $migration->displayMessage(sprintf(__('Data migration - %s'), 'Multi user group for tickets')); if (!TableExists('glpi_groups_tickets')) { $query = "CREATE TABLE `glpi_groups_tickets` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tickets_id` int(11) NOT NULL DEFAULT '0', `groups_id` int(11) NOT NULL DEFAULT '0', `type` int(11) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), KEY `unicity` (`tickets_id`,`type`,`groups_id`), KEY `group` (`groups_id`,`type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.80 add table glpi_groups_tickets"); $query = "SELECT `id`, `groups_id`, `groups_id_assign` FROM `glpi_tickets`"; if ($result = $DB->query($query)) { if ($DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { if ($data['groups_id']>0) { $query = "INSERT INTO `glpi_groups_tickets` (`tickets_id`, `groups_id`, `type`) VALUES ('".$data['id']."', '".$data['groups_id']."', '".CommonITILActor::REQUESTER."')"; $DB->queryOrDie($query, "0.80 migrate data to glpi_groups_tickets table"); } if ($data['groups_id_assign']>0) { $query = "INSERT INTO `glpi_groups_tickets` (`tickets_id`, `groups_id`, `type`) VALUES ('".$data['id']."', '".$data['groups_id_assign']."', '".CommonITILActor::ASSIGN."')"; $DB->queryOrDie($query, "0.80 migrate data to glpi_groups_tickets table"); } } } } $migration->dropField('glpi_tickets', 'groups_id'); $migration->dropField('glpi_tickets', 'groups_id_assign'); // Migrate templates $from = array('ticket.group##', 'ticket.assigntogroup##', 'ticket.assigntouser##', 'ticket.author.name##', 'ticket.author##'); $to = array('ticket.groups##', 'ticket.assigntogroups##', 'ticket.assigntousers##', 'ticket.authors##', 'author.id##'); $query = "SELECT `glpi_notificationtemplatetranslations`.* FROM `glpi_notificationtemplatetranslations` INNER JOIN `glpi_notificationtemplates` ON (`glpi_notificationtemplates`.`id` = `glpi_notificationtemplatetranslations`.`notificationtemplates_id`) WHERE `glpi_notificationtemplates`.`itemtype` = 'Ticket'"; if ($result=$DB->query($query)) { if ($DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $query = "UPDATE `glpi_notificationtemplatetranslations` SET `subject` = '".addslashes(str_replace($from,$to,$data['subject']))."', `content_text` = '".addslashes(str_replace($from,$to, $data['content_text']))."', `content_html` = '".addslashes(str_replace($from,$to, $data['content_html']))."' WHERE `id` = ".$data['id'].""; $DB->queryOrDie($query, "0.80 fix tags usage for multi users"); } } } } if (!TableExists('glpi_tickets_users')) { $query = "CREATE TABLE `glpi_tickets_users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tickets_id` int(11) NOT NULL DEFAULT '0', `users_id` int(11) NOT NULL DEFAULT '0', `type` int(11) NOT NULL DEFAULT '1', `use_notification` tinyint(1) NOT NULL DEFAULT '0', `alternative_email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `tickets_id` (`tickets_id`), KEY `user` (`users_id`,`type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.80 add table glpi_tickets_users"); $query = "SELECT `glpi_tickets`.`id`, `glpi_tickets`.`users_id_assign`, `glpi_tickets`.`users_id`, `glpi_tickets`.`use_email_notification`, `glpi_tickets`.`user_email`, `glpi_users`.`email` AS EMAIL FROM `glpi_tickets` LEFT JOIN `glpi_users` ON (`glpi_users`.`id` = `glpi_tickets`.`users_id`)"; if ($result = $DB->query($query)) { if ($DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { if ($data['users_id_assign']>0) { $query = "INSERT INTO `glpi_tickets_users` (`tickets_id`, `users_id`, `type`, `use_notification`) VALUES ('".$data['id']."', '".$data['users_id_assign']."', '".CommonITILActor::ASSIGN."', '1')"; $DB->queryOrDie($query, "0.80 migrate data to glpi_tickets_users table"); } if ($data['users_id']>0 || ($data['use_email_notification'] && !empty($data['user_email']))) { $user_id = 0; if ($data['users_id']>0) { $user_id = $data['users_id']; } $user_email = ''; if (strcasecmp($data['user_email'],$data['EMAIL'])!= 0) { $user_email = addslashes($data['user_email']); } $query = "INSERT INTO `glpi_tickets_users` (`tickets_id`, `users_id`,`type`, `use_notification`, `alternative_email`) VALUES ('".$data['id']."', '$user_id', '".CommonITILActor::REQUESTER."', '".$data['use_email_notification']."', '$user_email')"; $DB->queryOrDie($query, "0.80 migrate data to glpi_tickets_users table"); } } } } $migration->dropField('glpi_tickets', 'users_id'); $migration->dropField('glpi_tickets', 'users_id_assign'); $migration->dropField('glpi_tickets', 'use_email_notification'); $migration->dropField('glpi_tickets', 'user_email'); // ADD observer when requester is set : 3>21 / 13>20 / 12 >22 $fromto = array(3 => 21, // USER 13 => 20, // GROUP 12 => 22); // GROUP_SUPERVISOR foreach ($fromto as $from => $to) { $query = "SELECT * FROM `glpi_notificationtargets` INNER JOIN `glpi_notifications` ON (`glpi_notifications`.`id` = `glpi_notificationtargets`.`notifications_id`) WHERE `glpi_notifications`.`itemtype` = 'Ticket' AND `glpi_notificationtargets`.`type` = '1' AND `glpi_notificationtargets`.`items_id` = '$from'"; if ($result=$DB->query($query)) { if ($DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $query = "INSERT INTO `glpi_notificationtargets` (`items_id` ,`type` ,`notifications_id`) VALUES ('$to', '1', '".$data['notifications_id']."')"; $DB->queryOrDie($query, "0.80 insert default notif for observer"); } } } } } $migration->displayMessage(sprintf(__('Data migration - %s'),'passwords encryption')); if ($migration->addField('glpi_configs', 'proxy_passwd', 'varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL')) { $migration->migrationOneTable('glpi_configs'); $query = "SELECT `proxy_password` FROM `glpi_configs` WHERE `id` = '1'"; if ($result=$DB->query($query)) { if ($DB->numrows($result)>0) { $value = $DB->result($result,0,0); if (!empty($value)) { $query = "UPDATE `glpi_configs` SET `proxy_passwd` = '".addslashes(Toolbox::encrypt($value,GLPIKEY))."' WHERE `id` = '1' "; $DB->queryOrDie($query, "0.80 update proxy_passwd in glpi_configs"); } } } $migration->dropField('glpi_configs', 'proxy_password'); } if ($migration->addField('glpi_configs', 'smtp_passwd', 'varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL')) { $migration->migrationOneTable('glpi_configs'); $query = "SELECT `smtp_password` FROM `glpi_configs` WHERE `id` = '1'"; if ($result=$DB->query($query)) { if ($DB->numrows($result)>0) { $value = $DB->result($result,0,0); if (!empty($value)) { $query = "UPDATE `glpi_configs` SET `smtp_passwd` = '".addslashes(Toolbox::encrypt($value,GLPIKEY))."' WHERE `id` = '1' "; $DB->queryOrDie($query, "0.80 update smtp_passwd in glpi_configs"); } } } $migration->dropField('glpi_configs', 'smtp_password'); } if ($migration->addField('glpi_authldaps', 'rootdn_passwd', 'varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL')) { $migration->migrationOneTable('glpi_authldaps'); $query = "SELECT * FROM `glpi_authldaps` WHERE `rootdn_password` IS NOT NULL AND `rootdn_password` <> ''"; if ($result = $DB->query($query)) { if ($DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { if (!empty($data['rootdn_password'])) { $query = "UPDATE `glpi_authldaps` SET `rootdn_passwd` = '".addslashes(Toolbox::encrypt($data['rootdn_password'], GLPIKEY))."' WHERE `id` = '".$data['id']."' "; $DB->queryOrDie($query, "0.80 update rootdn_passwd in glpi_authldaps"); } } } } $migration->dropField('glpi_authldaps', 'rootdn_password'); } //Add date config management fields $migration->addField("glpi_entitydatas", "autofill_warranty_date", "varchar(255) COLLATE utf8_unicode_ci DEFAULT '-1'", array('update' => "'0'", 'condition' => " WHERE `entities_id` = '0'")); $migration->addField("glpi_entitydatas", "autofill_use_date", "varchar(255) COLLATE utf8_unicode_ci DEFAULT '-1'", array('update' => "'0'", 'condition' => " WHERE `entities_id` = '0'")); $migration->addField("glpi_entitydatas", "autofill_buy_date", "varchar(255) COLLATE utf8_unicode_ci DEFAULT '-1'", array('update' => "'0'", 'condition' => " WHERE `entities_id` = '0'")); $migration->addField("glpi_entitydatas", "autofill_delivery_date", "varchar(255) COLLATE utf8_unicode_ci DEFAULT '-1'", array('update' => "'0'", 'condition' => " WHERE `entities_id` = '0'")); $migration->addField("glpi_entitydatas", "autofill_order_date", "varchar(255) COLLATE utf8_unicode_ci DEFAULT '-1'", array('update' => "'0'", 'condition' => " WHERE `entities_id` = '0'")); if (!TableExists('glpi_fieldunicities')) { $query = "CREATE TABLE `glpi_fieldunicities` ( `id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , `name` VARCHAR( 255 ) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `is_recursive` TINYINT( 1 ) NOT NULL DEFAULT '0', `itemtype` VARCHAR( 255 ) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `entities_id` INT( 11 ) NOT NULL DEFAULT '-1', `fields` VARCHAR( 255 ) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `is_active` TINYINT( 1 ) NOT NULL DEFAULT '0', `action_refuse` TINYINT( 1 ) NOT NULL DEFAULT '0', `action_notify` TINYINT( 1 ) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci ) ENGINE=MYISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT = 'Stores field unicity criterias'"; $DB->queryOrDie($query, "0.80 add table glpi_fieldunicities"); $ADDTODISPLAYPREF['FieldUnicity'] = array(1, 80, 4, 3, 86, 30); } $query = "SELECT * FROM `glpi_notificationtemplates` WHERE `name` = 'Item not unique'"; if ($result=$DB->query($query)) { if ($DB->numrows($result)==0) { $query = "INSERT INTO `glpi_notificationtemplates` (`name`, `itemtype`, `date_mod`) VALUES ('Item not unique', 'FieldUnicity', NOW())"; $DB->queryOrDie($query, "0.80 add item not unique notification"); $notid = $DB->insert_id(); $query = "INSERT INTO `glpi_notificationtemplatetranslations` " . "VALUES(NULL, $notid, '', '##lang.unicity.action##', " . "'##lang.unicity.entity## : ##unicity.entity## \r\n\n" . "##lang.unicity.itemtype## : ##unicity.itemtype## \r\n\n" . "##lang.unicity.message## : ##unicity.message## \r\n\n" . "##lang.unicity.action_user## : ##unicity.action_user## \r\n\n" . "##lang.unicity.action_type## : ##unicity.action_type## \r\n\n" . "##lang.unicity.date## : ##unicity.date##'," . "'<p>##lang.unicity.entity## : ##unicity.entity##</p>\r\n<p>" . "##lang.unicity.itemtype## : ##unicity.itemtype##</p>\r\n<p>" . "##lang.unicity.message## : ##unicity.message##</p>\r\n<p>" . "##lang.unicity.action_user## : ##unicity.action_user##</p>\r\n<p>" . "##lang.unicity.action_type## : ##unicity.action_type##</p>\r\n<p>" . "##lang.unicity.date## : ##unicity.date##</p>');"; $DB->queryOrDie($query, "0.80 add item not unique notification translation"); $query = "INSERT INTO `glpi_notifications` (`name`, `entities_id`, `itemtype`, `event`, `mode`, `notificationtemplates_id`, `comment`, `is_recursive`, `is_active`, `date_mod`) VALUES ('Item not unique', 0, 'FieldUnicity', 'refuse', 'mail', $notid, '', 1, 1, NOW())"; $DB->queryOrDie($query, "0.80 add computer not unique notification"); $notifid = $DB->insert_id(); // $query = "INSERT INTO `glpi_notificationtargets` // (`notifications_id`, `type`, `items_id`) // VALUES ($notifid, 1, 19);"; // $DB->queryOrDie($query, "0.80 add computer not unique notification target"); } } if (!TableExists("glpi_fieldblacklists")) { $query = "CREATE TABLE `glpi_fieldblacklists` ( `id` INT (11) NOT NULL AUTO_INCREMENT, `name` VARCHAR (255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `field` VARCHAR (255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `value` VARCHAR (255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `itemtype` VARCHAR (255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `entities_id` INT (11) NOT NULL DEFAULT '0', `is_recursive` TINYINT (1) NOT NULL DEFAULT '0', `comment` TEXT COLLATE utf8_unicode_ci, PRIMARY KEY (id), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.80 add table glpi_fieldblacklists"); } if ($migration->addField('glpi_mailcollectors', 'passwd', 'varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL')) { $migration->migrationOneTable('glpi_mailcollectors'); $query = "SELECT * FROM `glpi_mailcollectors` WHERE `password` IS NOT NULL AND `password` <> ''"; if ($result = $DB->query($query)) { if ($DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { if (!empty($data['password'])) { $query = "UPDATE `glpi_mailcollectors` SET `passwd` = '".addslashes(Toolbox::encrypt($data['password'], GLPIKEY))."' WHERE `id`= '".$data['id']."' "; $DB->queryOrDie($query, "0.80 update passwd in glpi_mailcollectors"); } } } } $migration->dropField('glpi_mailcollectors', 'password'); } $migration->displayMessage(sprintf(__('Data migration - %s'), 'rule ticket migration')); $changes['RuleTicket'] = array('users_id' => '_users_id_requester', 'groups_id' => '_groups_id_requester', 'users_id_assign' => '_users_id_assign', 'groups_id_assign' => '_groups_id_assign'); // For Rule::RULE_TRACKING_AUTO_ACTION $changes['RuleMailCollector'] = array('username' => '_users_id_requester'); $DB->query("SET SESSION group_concat_max_len = 4194304;"); foreach ($changes as $ruletype => $tab) { // Get rules $query = "SELECT GROUP_CONCAT(`id`) FROM `glpi_rules` WHERE `sub_type` = '".$ruletype."' GROUP BY `sub_type`"; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { // Get rule string $rules = $DB->result($result,0,0); // Update actions foreach ($tab as $old => $new) { $query = "UPDATE `glpi_ruleactions` SET `field` = '$new' WHERE `field` = '$old' AND `rules_id` IN ($rules)"; $DB->queryOrDie($query, "0.80 update datas for rules actions"); } // Update criterias foreach ($tab as $old => $new) { $query = "UPDATE `glpi_rulecriterias` SET `criteria` = '$new' WHERE `criteria` = '$old' AND `rules_id` IN ($rules)"; $DB->queryOrDie($query, "0.80 update datas for rules criterias"); } } } } // Add watcher crontask if (!countElementsInTable('glpi_crontasks', "`itemtype`='Crontask' AND `name`='watcher'")) { $query = "INSERT INTO `glpi_crontasks` (`itemtype`, `name`, `frequency`, `param`, `state`, `mode`, `allowmode`, `hourmin`, `hourmax`, `logs_lifetime`, `lastrun`, `lastcode`, `comment`) VALUES ('Crontask', 'watcher', 86400, NULL, 1, 1, 3, 0, 24, 30, NULL, NULL, NULL);"; $DB->queryOrDie($query, "0.80 populate glpi_crontasks for watcher"); } $query = "SELECT * FROM `glpi_notificationtemplates` WHERE `name` = 'Crontask'"; if ($result=$DB->query($query)) { if ($DB->numrows($result)==0) { $query = "INSERT INTO `glpi_notificationtemplates` (`name`, `itemtype`, `date_mod`) VALUES ('Crontask', 'Crontask', NOW())"; $DB->queryOrDie($query, "0.80 add crontask watcher notification"); $notid = $DB->insert_id(); $query = "INSERT INTO `glpi_notificationtemplatetranslations` VALUES (NULL, $notid, '', '##crontask.action##', '##lang.crontask.warning## \r\n\n##FOREACHcrontasks## \n ##crontask.name## : ##crontask.description##\n \n##ENDFOREACHcrontasks##', '<p>##lang.crontask.warning##</p>\r\n<p>##FOREACHcrontasks## <br /><a href=\"##crontask.url##\">##crontask.name##</a> : ##crontask.description##<br /> <br />##ENDFOREACHcrontasks##</p>')"; $DB->queryOrDie($query, "0.80 add crontask notification translation"); $query = "INSERT INTO `glpi_notifications` VALUES (NULL, 'Crontask Watcher', 0, 'Crontask', 'alert', 'mail', $notid, '', 1, 1, NOW())"; $DB->queryOrDie($query, "0.80 add crontask notification"); $notifid = $DB->insert_id(); $query = "INSERT INTO `glpi_notificationtargets` (`id`, `notifications_id`, `type`, `items_id`) VALUES (NULL, $notifid, 1, 1)"; $DB->queryOrDie($query, "0.80 add crontask notification target to global admin"); } } /* OCS-NG new clean links features */ if ($migration->addField('glpi_ocslinks', 'entities_id','int(11) NOT NULL DEFAULT \'0\'')) { $migration->migrationOneTable("glpi_ocslinks"); $query = "SELECT `glpi_ocslinks`.`computers_id`, `glpi_computers`.`entities_id` FROM `glpi_ocslinks` INNER JOIN `glpi_computers` ON (`glpi_computers`.`id` = `glpi_ocslinks`.`computers_id`)"; if ($result=$DB->query($query)) { if ($DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $query = "UPDATE `glpi_ocslinks` SET `entities_id` = '" . $data['entities_id'] . "' WHERE `computers_id` = '" . $data['computers_id'] . "'"; $DB->queryOrDie($query, "0.80 copy entities_id from computers to ocslinks "); } } } } $migration->addField("glpi_profiles", "clean_ocsng", "char(1) COLLATE utf8_unicode_ci DEFAULT NULL", array('update' => "`sync_ocsng`")); /* END - OCS-NG new clean links features */ $migration->addField("glpi_transfers", "keep_disk", "int( 11 ) NOT NULL DEFAULT 0", array('update' => "'1'")); if ($migration->addField("glpi_reminders", "is_helpdesk_visible", "tinyint( 1 ) NOT NULL DEFAULT 0")) { $query = "UPDATE `glpi_profiles` SET `reminder_public` = 'r' WHERE `interface` = 'helpdesk';"; $DB->queryOrDie($query, "0.80 default set of reminder view for helpdesk users"); } if (!TableExists('glpi_ticketsolutiontemplates')) { $query = "CREATE TABLE `glpi_ticketsolutiontemplates` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `content` text COLLATE utf8_unicode_ci, `ticketsolutiontypes_id` int(11) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`entities_id`,`name`), KEY `name` (`name`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.80 create glpi_ticketsolutiontemplates"); } // Fix templates tags $updates = array('Ticket' => array('from' => array('##lang.validation.validationstatus##'), 'to' => array('##lang.validation.status## : ##validation.status##'))); foreach ($updates as $itemtype => $changes) { $query = "SELECT `glpi_notificationtemplatetranslations`.* FROM `glpi_notificationtemplatetranslations` INNER JOIN `glpi_notificationtemplates` ON (`glpi_notificationtemplates`.`id` = `glpi_notificationtemplatetranslations`.`notificationtemplates_id`) WHERE `glpi_notificationtemplates`.`itemtype` = '$itemtype'"; if ($result=$DB->query($query)) { if ($DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $query = "UPDATE `glpi_notificationtemplatetranslations` SET `subject` = '".addslashes( str_replace($changes['from'],$changes['to'], $data['subject']))."', `content_text` = '".addslashes( str_replace($changes['from'],$changes['to'], $data['content_text']))."', `content_html` = '".addslashes( str_replace($changes['from'],$changes['to'], $data['content_html']))."' WHERE `id` = '".$data['id']."'"; $DB->queryOrDie($query, "0.80 fix template tag usage for $itemtype"); } } } } $migration->addField('glpi_profiles', 'update_own_followups', 'char(1) COLLATE utf8_unicode_ci DEFAULT NULL', array('update' => '1', 'condition' => " WHERE `update_followups` = 1")); $migration->addField('glpi_profiles', 'delete_followups', 'char(1) COLLATE utf8_unicode_ci DEFAULT NULL', array('update' => '`update_followups`')); $migration->addField('glpi_ocsservers', 'deleted_behavior', "VARCHAR( 255 ) NOT NULL DEFAULT '1'"); //User registration number $migration->addField('glpi_users', 'registration_number', 'VARCHAR( 255 ) COLLATE utf8_unicode_ci DEFAULT NULL'); $migration->addField('glpi_authldaps', 'registration_number_field', 'VARCHAR( 255 ) COLLATE utf8_unicode_ci DEFAULT NULL'); $migration->addField("glpi_users", "date_sync", "datetime default NULL AFTER `date_mod`", array('update' => "`date_mod`", 'condition' => " WHERE `auths_id` > 0")); //Migrate OCS computers link from static config to rules engine if (FieldExists('glpi_ocsservers','is_glpi_link_enabled', false)) { $ocs_servers = getAllDatasFromTable('glpi_ocsservers'); $ranking = 1; foreach ($ocs_servers as $ocs_server) { if ($ocs_server['is_glpi_link_enabled']) { $query = "INSERT INTO `glpi_rules` (`entities_id`, `sub_type`, `ranking`, `name`, `description`, `match`, `is_active`, `date_mod`, `is_recursive`) VALUES ('0', 'RuleImportComputer', '$ranking', '".$ocs_server['name']."', '', 'AND', 1, NOW(), 1)"; $DB->queryOrDie($query, "0.80 add new rule RuleImportComputer"); $rule_id = $DB->insert_id(); $query = "INSERT INTO `glpi_rulecriterias` (`rules_id`, `criteria`, `condition`, `pattern`) VALUES ('$rule_id', 'ocsservers_id', '0', '".$ocs_server['id']."')"; $DB->queryOrDie($query, "0.80 add new criteria RuleImportComputer"); if ($ocs_server['states_id_linkif']) { $query = "INSERT INTO `glpi_rulecriterias` (`rules_id`, `criteria`, `condition`, `pattern`) VALUES ('$rule_id', 'states_id', '0', '".$ocs_server['states_id_linkif']."')"; $DB->queryOrDie($query, "0.80 add new criteria RuleImportComputer"); } $simple_criteria = array('use_ip_to_link' => 'IPADDRESS', 'use_mac_to_link' => 'MACADDRESS', 'use_serial_to_link' => 'serial'); foreach ($simple_criteria as $field => $value) { $tmpcriteria = array(); if ($ocs_server[$field]) { $query = "INSERT INTO `glpi_rulecriterias` (`rules_id`, `criteria`, `condition`, `pattern`) VALUES ('$rule_id', '$value', '10', '1')"; $DB->queryOrDie($query, "0.80 add new criteria RuleImportComputer"); } } $tmpcriteria = array(); $query = "INSERT INTO `glpi_rulecriterias` (`rules_id`, `criteria`, `condition`, `pattern`)"; switch ($ocs_server['use_name_to_link']) { case 1 : $query .= "VALUES ('$rule_id', 'name', '10', '1')"; $DB->query($query); break; case 2: $query .= "VALUES ('$rule_id', 'name', '30', '1')"; $DB->query($query); break; } $query = "INSERT INTO `glpi_ruleactions` (`rules_id`, `action_type`, `field`, `value`) VALUES ('$rule_id', 'assign', '_fusion', '0')"; $DB->queryOrDie($query, "0.80 add new action RuleImportComputer"); $ranking++; } } $todrop = array('is_glpi_link_enabled', 'states_id_linkif', 'use_ip_to_link', 'use_mac_to_link', 'use_name_to_link', 'use_serial_to_link'); foreach ($todrop as $field) { $migration->dropField('glpi_ocsservers', $field); } } /* New automatic transfert feature */ $migration->addField('glpi_configs', 'transfers_id_auto', 'int(11) NOT NULL DEFAULT 0'); $migration->addField('glpi_ocslinks','tag', 'varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL'); /* END - New automatic transfert feature */ $migration->addField('glpi_profiles', 'entity_helpdesk', 'char(1) COLLATE utf8_unicode_ci DEFAULT NULL', array('update' => '`notification`')); $migration->addField('glpi_computers', 'uuid', 'varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL'); $migration->addField('glpi_ocsservers', 'import_vms', 'TINYINT(1) NOT NULL DEFAULT 0'); $migration->addField('glpi_ocsservers', 'import_general_uuid', 'TINYINT(1) NOT NULL DEFAULT 0'); $migration->addField('glpi_ocslinks', 'import_vm', 'LONGTEXT COLLATE utf8_unicode_ci DEFAULT NULL'); if (!TableExists('glpi_virtualmachinetypes')) { $query = "CREATE TABLE `glpi_virtualmachinetypes` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL DEFAULT '', `comment` TEXT NOT NULL, PRIMARY KEY (`id`) ) ENGINE = MYISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.80 add new table glpi_virtualmachinetypes"); } if (!TableExists('glpi_virtualmachinesystems')) { $query = "CREATE TABLE `glpi_virtualmachinesystems` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL DEFAULT '', `comment` TEXT NOT NULL, PRIMARY KEY (`id`) ) ENGINE = MYISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.80 add new table glpi_virtualmachinesystems"); } if (!TableExists('glpi_virtualmachinestates')) { $query = "CREATE TABLE `glpi_virtualmachinestates` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL DEFAULT '', `comment` TEXT NOT NULL, PRIMARY KEY (`id`) ) ENGINE = MYISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.80 add new table glpi_virtualmachinestates"); } if (!TableExists('glpi_computervirtualmachines')) { $query = "CREATE TABLE `glpi_computervirtualmachines` ( `id` INT NOT NULL AUTO_INCREMENT, `entities_id` INT(11) NOT NULL DEFAULT '0', `computers_id` INT(11) NOT NULL DEFAULT '0', `name` VARCHAR(255) NOT NULL DEFAULT '', `virtualmachinestates_id` INT(11) NOT NULL DEFAULT '0', `virtualmachinesystems_id` INT(11) NOT NULL DEFAULT '0', `virtualmachinetypes_id` INT(11) NOT NULL DEFAULT '0', `uuid` VARCHAR(255) NOT NULL DEFAULT '', `vcpu` INT(11) NOT NULL DEFAULT '0', `ram` VARCHAR(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) ENGINE = MYISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.80 add new table glpi_computervirtualmachines"); } // Clean ticket validations $query = "DELETE FROM `glpi_ticketvalidations` WHERE `glpi_ticketvalidations`.`tickets_id` NOT IN (SELECT `glpi_tickets`.`id` FROM `glpi_tickets`)"; $DB->queryOrDie($query, "0.80 clean glpi_ticketvalidations"); // Keep it at the end $migration->displayMessage(sprintf(__('Data migration - %s'), 'glpi_displaypreferences')); foreach ($ADDTODISPLAYPREF as $type => $tab) { $query = "SELECT DISTINCT users_id FROM `glpi_displaypreferences` WHERE `itemtype` = '$type'"; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { while ($data = $DB->fetch_assoc($result)) { $query = "SELECT MAX(`rank`) FROM `glpi_displaypreferences` WHERE `users_id` = '".$data['users_id']."' AND `itemtype` = '$type'"; $result = $DB->query($query); $rank = $DB->result($result,0,0); $rank++; foreach ($tab as $newval) { $query = "SELECT * FROM `glpi_displaypreferences` WHERE `users_id` = '".$data['users_id']."' AND `num` = '$newval' AND `itemtype` = '$type'"; if ($result2=$DB->query($query)) { if ($DB->numrows($result2)==0) { $query = "INSERT INTO `glpi_displaypreferences` (`itemtype` ,`num` ,`rank` ,`users_id`) VALUES ('$type', '$newval', '".$rank++."', '".$data['users_id']."')"; $DB->query($query); } } } } } else { // Add for default user $rank = 1; foreach ($tab as $newval) { $query = "INSERT INTO `glpi_displaypreferences` (`itemtype` ,`num` ,`rank` ,`users_id`) VALUES ('$type', '$newval', '".$rank++."', '0')"; $DB->query($query); } } } } // Change value of autoclose ticket $query = "UPDATE `glpi_configs` SET `autoclose_delay` = '-1' WHERE `id` = '1' AND `autoclose_delay` = '0'"; $DB->queryOrDie($query, "0.80 change autoclose ticket in glpi_configs"); $query = "UPDATE `glpi_entitydatas` SET `autoclose_delay` = '-2' WHERE `autoclose_delay` = '-1'"; $DB->queryOrDie($query, "0.80 change autoclose ticket in glpi_entitydatas for inherit"); $query = "UPDATE `glpi_entitydatas` SET `autoclose_delay` = '-1' WHERE `autoclose_delay` = '0'"; $DB->queryOrDie($query, "0.80 change autoclose ticket in glpi_entitydatas for not active"); // must always be at the end $migration->executeMigration(); return $updateresult; } ?> glpi-0.84.3+dfsg.1/install/update_078_0781.php000066400000000000000000000130651226600447100203440ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /** * Update from 0.78 to 0.78.1 * * @return bool for success (will die for most error) */ function update078to0781() { global $DB, $migration; $updateresult = true; $migration->displayTitle(sprintf(__('Update to %s'), '0.78.1')); $migration->setVersion('0.78.1'); //TRANS: %s is 'Clean reservation entity link' $migration->displayMessage(sprintf(__('Data migration - %s'), 'Clean reservation entity link')); // Updating schema $entities=getAllDatasFromTable('glpi_entities'); $entities[0]="Root"; $query = "SELECT DISTINCT `itemtype` FROM `glpi_reservationitems`"; if ($result=$DB->query($query)) { if ($DB->numrows($result)>0) { while ($data = $DB->fetch_assoc($result)) { $itemtable=getTableForItemType($data['itemtype']); // ajout d'un contrôle pour voir si la table existe ( cas migration plugin non fait) if (!TableExists($itemtable)) { $migration->displayWarning("*** Skip : no table $itemtable ***", true); continue; } $do_recursive = false; if (FieldExists($itemtable,'is_recursive', false)) { $do_recursive=true; } foreach ($entities as $entID => $val) { if ($do_recursive) { // Non recursive ones $query3="UPDATE `glpi_reservationitems` SET `entities_id`=$entID, `is_recursive`=0 WHERE `itemtype`='".$data['itemtype']."' AND `items_id` IN (SELECT `id` FROM `$itemtable` WHERE `entities_id`=$entID AND `is_recursive`=0)"; $DB->queryOrDie($query3, "0.78.1 update entities_id and is_recursive=0 in glpi_reservationitems for ".$data['itemtype']); // Recursive ones $query3="UPDATE `glpi_reservationitems` SET `entities_id`=$entID, `is_recursive`=1 WHERE `itemtype`='".$data['itemtype']."' AND `items_id` IN (SELECT `id` FROM `$itemtable` WHERE `entities_id`=$entID AND `is_recursive`=1)"; $DB->queryOrDie($query3, "0.78.1 update entities_id and is_recursive=1 in glpi_reservationitems for ".$data['itemtype']); } else { $query3="UPDATE `glpi_reservationitems` SET `entities_id`=$entID WHERE `itemtype`='".$data['itemtype']."' AND `items_id` IN (SELECT `id` FROM `$itemtable` WHERE `entities_id`=$entID)"; $DB->queryOrDie($query3, "0.78.1 update entities_id in glpi_reservationitems for ".$data['itemtype']); } } } } } $query = "ALTER TABLE `glpi_tickets` CHANGE `global_validation` `global_validation` VARCHAR(255) DEFAULT 'none'"; $DB->query($query) or die("0.78.1 change ticket global_validation default state"); $query = "UPDATE `glpi_tickets` SET `global_validation`='none' WHERE `id` NOT IN (SELECT DISTINCT `tickets_id` FROM `glpi_ticketvalidations`)"; $DB->query($query) or die("0.78.1 update ticket global_validation state"); if (!FieldExists('glpi_knowbaseitemcategories','entities_id', false)) { $query = "ALTER TABLE `glpi_knowbaseitemcategories` ADD `entities_id` INT NOT NULL DEFAULT '0' AFTER `id`, ADD `is_recursive` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `entities_id`, ADD INDEX `entities_id` (`entities_id`),ADD INDEX `is_recursive` (`is_recursive`)"; $DB->queryOrDie($query, "0.78.1 add entities_id,is_recursive in glpi_knowbaseitemcategories"); // Set existing categories recursive global $query = "UPDATE `glpi_knowbaseitemcategories` SET `is_recursive` = '1'"; $DB->queryOrDie($query, "0.78.1 set value of is_recursive in glpi_knowbaseitemcategories"); $query = "ALTER TABLE `glpi_knowbaseitemcategories` DROP INDEX `unicity` , ADD UNIQUE `unicity` ( `entities_id`, `knowbaseitemcategories_id` , `name` ) "; $DB->queryOrDie($query, "0.78.1 update unicity index on glpi_knowbaseitemcategories"); } // must always be at the end (only for end message) $migration->executeMigration(); return $updateresult; } ?> glpi-0.84.3+dfsg.1/install/update_07_071.php000066400000000000000000000570451226600447100201720ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /// Update from 0.7 to 0.71 function update07to071() { global $DB, $CFG_GLPI; if (!FieldExists("glpi_profiles", "rule_dictionnary_software", false)) { $query = "ALTER TABLE `glpi_profiles` ADD `rule_dictionnary_software` VARCHAR( 1 ) NULL DEFAULT NULL"; $DB->queryOrDie($query, "0.71 add rule_dictionnary_software in glpi_profiles if not present for compatibility"); $query = "UPDATE `glpi_profiles` SET `rule_dictionnary_software` = `rule_softwarecategories`"; $DB->queryOrDie($query, "0.71 update value of rule_dictionnary_software right"); } if (!FieldExists("glpi_profiles", "rule_dictionnary_dropdown", false)) { $query = "ALTER TABLE `glpi_profiles` ADD `rule_dictionnary_dropdown` VARCHAR( 1 ) NULL DEFAULT NULL"; $DB->queryOrDie($query, "0.71 add rule_dictionnary_dropdown in glpi_profiles"); $query = "UPDATE `glpi_profiles` SET `rule_dictionnary_dropdown` = `rule_dictionnary_software`"; $DB->queryOrDie($query, "0.71 update value of rule_dictionnary_dropdown"); } $cache_tables = array("glpi_rule_cache_manufacturer", "glpi_rule_cache_model_computer", "glpi_rule_cache_model_monitor", "glpi_rule_cache_model_printer", "glpi_rule_cache_model_peripheral", "glpi_rule_cache_model_phone", "glpi_rule_cache_model_networking", "glpi_rule_cache_type_computer", "glpi_rule_cache_type_monitor", "glpi_rule_cache_type_printer", "glpi_rule_cache_type_peripheral", "glpi_rule_cache_type_phone", "glpi_rule_cache_type_networking", "glpi_rule_cache_software", "glpi_rule_cache_os", "glpi_rule_cache_os_sp", "glpi_rule_cache_os_version"); foreach ($cache_tables as $cache_table) { if (!TableExists($cache_table)) { $query = "CREATE TABLE `".$cache_table."` ( `ID` INT( 11 ) NOT NULL auto_increment , `old_value` VARCHAR( 255 ) NULL default NULL , `rule_id` INT( 11 ) NOT NULL DEFAULT '0', `new_value` VARCHAR( 255 ) NULL default NULL , PRIMARY KEY ( `ID` ), KEY `rule_id` (`rule_id`), KEY `old_value` (`old_value`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.71 add table ".$cache_table.""); } } //Add the field version espacially for the software's cache if (!FieldExists("glpi_rule_cache_software", "version", false)) { $query = "ALTER TABLE `glpi_rule_cache_software` ADD `version` VARCHAR( 255 ) DEFAULT NULL "; $DB->queryOrDie($query, "0.71 add version in glpi_rule_cache_software if not present"); } if (!FieldExists("glpi_rule_cache_software", "manufacturer", false)) { $query = "ALTER TABLE `glpi_rule_cache_software` ADD `manufacturer` VARCHAR( 255 ) NOT NULL AFTER `old_value` "; $DB->queryOrDie($query, "0.71 add manufacturer in glpi_rule_cache_software if not present"); } if (!FieldExists("glpi_rule_cache_software", "new_manufacturer", false)) { $query = "ALTER TABLE `glpi_rule_cache_software` ADD `new_manufacturer` VARCHAR( 255 ) NOT NULL AFTER `version` "; $DB->queryOrDie($query, "0.71 add new_manufacturer in glpi_rule_cache_software if not present"); } $model_cache_tables = array("glpi_rule_cache_model_computer", "glpi_rule_cache_model_monitor", "glpi_rule_cache_model_printer", "glpi_rule_cache_model_peripheral", "glpi_rule_cache_model_phone", "glpi_rule_cache_model_networking"); foreach ($model_cache_tables as $model_cache_table) { if (!FieldExists($model_cache_table, "manufacturer", false)) { $query = "ALTER TABLE `".$model_cache_table."` ADD `manufacturer` VARCHAR( 255 ) DEFAULT NULL "; $DB->queryOrDie($query, "0.71 add manufacturer in ".$model_cache_table." if not present"); } } if (!FieldExists("glpi_rules_descriptions", "active", false)) { $query = "ALTER TABLE `glpi_rules_descriptions` ADD `active` INT( 1 ) NOT NULL DEFAULT '1'"; $DB->queryOrDie($query, "0.71 add active in glpi_rules_descriptions if not present"); } if (!TableExists("glpi_auth_ldap_replicate")) { $query = "CREATE TABLE IF NOT EXISTS `glpi_auth_ldap_replicate` ( `ID` int(11) NOT NULL auto_increment, `server_id` int(11) NOT NULL default '0', `ldap_host` varchar(255) NULL default NULL, `ldap_port` int(11) NOT NULL default '389', `name` varchar(255) NULL default NULL, PRIMARY KEY (`ID`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.71 add table glpi_auth_ldap_replicate"); } if (!FieldExists("glpi_config","dbreplicate_notify_desynchronization", false)) { $query = "ALTER TABLE `glpi_config` ADD `dbreplicate_notify_desynchronization` SMALLINT NOT NULL DEFAULT '0', ADD `dbreplicate_email` VARCHAR( 255 ) NULL , ADD `dbreplicate_maxdelay` INT NOT NULL DEFAULT '3600'"; $DB->queryOrDie($query, "0.71 alter config add config for dbreplicate notif"); } if (FieldExists("glpi_reminder", "author", false)) { $query = "ALTER TABLE `glpi_reminder` CHANGE `author` `FK_users` INT( 11 ) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.71 rename author in glpi_reminder"); if (isIndex("glpi_reminder", "author")) { $query = "ALTER TABLE `glpi_reminder` DROP INDEX `author`"; $DB->queryOrDie($query, "0.7 drop index author on glpi_reminder"); } $query = " ALTER TABLE `glpi_reminder` ADD INDEX `FK_users` (`FK_users`) "; $DB->queryOrDie($query, "0.71 ad index FK_users in glpi_reminder"); } if (!FieldExists("glpi_reminder", "recursive", false)) { $query = "ALTER TABLE `glpi_reminder` ADD `recursive` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `type`"; $DB->queryOrDie($query, "0.71 add recursive in glpi_reminder"); $query = "ALTER TABLE `glpi_reminder` ADD INDEX `recursive` (`recursive`) "; $DB->queryOrDie($query, "0.71 add recursive index in glpi_reminder"); } if (!FieldExists("glpi_reminder", "private", false)) { $query = "ALTER TABLE `glpi_reminder` ADD `private` TINYINT( 1 ) NOT NULL DEFAULT '1' AFTER `type`"; $DB->queryOrDie($query, "0.71 add private in glpi_reminder"); $query = "UPDATE `glpi_reminder` SET `private` = '0' WHERE `type` = 'public' "; $DB->queryOrDie($query, "0.71 update private field in glpi_reminder"); $query = "ALTER TABLE `glpi_reminder` ADD INDEX `private` (`private`) "; $DB->queryOrDie($query, "0.71 add private index in glpi_reminder"); // Drop type $query = "ALTER TABLE `glpi_reminder` DROP `type`"; $DB->queryOrDie($query, "0.71 drop type in glpi_reminder"); } if (FieldExists("glpi_reminder", "title", false)) { $query = "ALTER TABLE `glpi_reminder` CHANGE `title` `name` VARCHAR( 255 ) NULL DEFAULT NULL "; $DB->queryOrDie($query, "0.71 alter title to namein glpi_reminder"); } if (!isIndex("glpi_ocs_link", "last_ocs_update")) { $query = "ALTER TABLE `glpi_ocs_link` ADD INDEX `last_ocs_update` (`ocs_server_id`, `last_ocs_update`)"; $DB->queryOrDie($query, "0.7 alter ocs_link add index on last_ocs_update"); } if (!FieldExists("glpi_contacts", "recursive", false)) { $query = "ALTER TABLE `glpi_contacts` ADD `recursive` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `FK_entities`"; $DB->queryOrDie($query, "0.71 add recursive in glpi_contacts"); } if (!FieldExists("glpi_contracts", "recursive", false)) { $query = "ALTER TABLE `glpi_contracts` ADD `recursive` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `FK_entities`"; $DB->queryOrDie($query, "0.71 add recursive in glpi_contracts"); } if (!FieldExists("glpi_enterprises", "recursive", false)) { $query = "ALTER TABLE `glpi_enterprises` ADD `recursive` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `FK_entities`"; $DB->queryOrDie($query, "0.71 add recursive in glpi_enterprises"); } if (!FieldExists("glpi_docs", "recursive", false)) { $query = "ALTER TABLE `glpi_docs` ADD `recursive` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `FK_entities`"; $DB->queryOrDie($query, "0.71 add recursive in glpi_docs"); } if (!FieldExists("glpi_monitors", "flags_pivot", false)) { $query = "ALTER TABLE `glpi_monitors` ADD `flags_pivot` SMALLINT( 6 ) NOT NULL DEFAULT 0 AFTER `flags_dvi`"; $DB->queryOrDie($query, "0.71 add flags_pivot in glpi_monitors"); } if (!FieldExists("glpi_kbitems", "FK_entities", false)) { $query = "ALTER TABLE `glpi_kbitems` ADD `FK_entities` INT(11) NOT NULL DEFAULT 0 AFTER `ID`"; $DB->queryOrDie($query, "0.71 add FK_entities in glpi_kbitems"); } if (!FieldExists("glpi_kbitems", "recursive", false)) { // Default 1 for migration. All articles become "global" (root + recursive) $query = "ALTER TABLE `glpi_kbitems` ADD `recursive` TINYINT(1) NOT NULL DEFAULT 1 AFTER `FK_entities`"; $DB->queryOrDie($query, "0.71 add recursive in glpi_kbitems"); } if (!isIndex("glpi_kbitems", "FK_entities")) { $query = "ALTER TABLE `glpi_kbitems` ADD INDEX `FK_entities` (`FK_entities`)"; $DB->queryOrDie($query, "0.7 alter ocs_link add index on last_ocs_update"); } if (!FieldExists("glpi_config", "category_on_software_delete", false)) { $query = "ALTER TABLE `glpi_config` ADD `category_on_software_delete` INT( 11 ) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.71 add category_on_software_delete in glpi_config"); //Create a software category for softwares to be deleted by the dictionnary $result = $DB->query("SELECT `ID` FROM `glpi_dropdown_software_category` WHERE `name` = 'FUSION'"); if (!$DB->numrows($result)) { $DB->query("INSERT INTO `glpi_dropdown_software_category` SET `name` = 'FUSION'"); $result = $DB->query("SELECT `ID` FROM `glpi_dropdown_software_category` WHERE `name` = 'FUSION'"); } $cat_id = $DB->result($result, 0, "ID"); $DB->query("UPDATE `glpi_config` SET `category_on_software_delete` = '".$cat_id."'"); } $query = "DELETE FROM `glpi_display` WHERE `num` = '121'"; $DB->queryOrDie($query, "0.71 clean glpi_display for end_warranty infocoms"); // Delete helpdesk injector user $query = "DELETE FROM `glpi_users` WHERE `ID` = '1'"; $DB->queryOrDie($query, "0.71 delete helpdesk injector user"); // Delete helpdesk injector user $query = "DELETE FROM `glpi_users_profiles` WHERE `FK_users` = '1'"; $DB->queryOrDie($query, "0.71 delete helpdesk injector user profile"); // change default device type for tracking if (FieldExists("glpi_tracking", "device_type", false)) { $query = "ALTER TABLE `glpi_tracking` CHANGE `device_type` `device_type` INT( 11 ) NOT NULL DEFAULT '0' "; $DB->queryOrDie($query, "0.71 alter device_type from glpi_tracking"); } // Change ldap condition field bigger if (FieldExists("glpi_auth_ldap", "ldap_condition", false)) { $query = "ALTER TABLE `glpi_auth_ldap` CHANGE `ldap_condition` `ldap_condition` TEXT NULL DEFAULT NULL"; $DB->queryOrDie($query, "0.71 alter change ldap_condition field to be bigger"); } // Add date_mod to glpi_tracking if (!FieldExists("glpi_tracking", "date_mod", false)) { $query = "ALTER TABLE `glpi_tracking` ADD `date_mod` DATETIME NULL DEFAULT NULL AFTER `closedate` "; $DB->queryOrDie($query, "0.71 alter glpi_tracking add date_mod"); $query = "UPDATE `glpi_tracking` SET `date_mod` = `date`"; $DB->queryOrDie($query, "0.71 alter glpi_tracking update date_mod value to creation date"); } // Add number format if (!FieldExists("glpi_config", "numberformat", false)) { $query = "ALTER TABLE `glpi_config` ADD `numberformat` SMALLINT NOT NULL DEFAULT '0' AFTER `dateformat` "; $DB->queryOrDie($query, "0.71 alter config add numberformat"); } // Add group supervisor if (!FieldExists("glpi_groups", "FK_users", false)) { $query = "ALTER TABLE `glpi_groups` ADD `FK_users` INT NOT NULL DEFAULT '0' AFTER `comments` "; $DB->queryOrDie($query, "0.71 alter groups add FK_users supervisor"); } // Add group supervisor if (!FieldExists("glpi_entities_data", "admin_email", false)) { $query = "ALTER TABLE `glpi_entities_data` ADD `admin_email` VARCHAR( 255 ) NULL AFTER `email`"; $DB->queryOrDie($query, "0.71 alter entities_data add admin_email"); } // Add cas ldap server link if (!FieldExists("glpi_config", "extra_ldap_server", false)) { $query = "ALTER TABLE `glpi_config` ADD `extra_ldap_server` INT NOT NULL DEFAULT '1' AFTER `cas_logout`"; $DB->queryOrDie($query, "0.71 alter config add extra_ldap_server"); } // Add x509 email field definition if (!FieldExists("glpi_config", "x509_email_field", false)) { $query = "ALTER TABLE `glpi_config` ADD `x509_email_field` VARCHAR( 255 ) NULL"; $DB->queryOrDie($query, "0.71 alter config add x509_email_field"); } // Add x509 email field definition if (!FieldExists("glpi_config", "existing_auth_server_field", false)) { $query = "ALTER TABLE `glpi_config` ADD `existing_auth_server_field` VARCHAR( 255 ) NULL AFTER `extra_ldap_server`"; $DB->queryOrDie($query, "0.71 alter config add existing_auth_server_field"); } // update cas auth field from 0 -> 5 $query = "UPDATE `glpi_users` SET `auth_method` = '5' WHERE `auth_method` = '0'"; $DB->queryOrDie($query, "0.71 update auth method for CAS"); if (!TableExists("glpi_bookmark")) { $query = "CREATE TABLE IF NOT EXISTS `glpi_bookmark` ( `ID` int(11) NOT NULL auto_increment, `name` varchar(255) default NULL, `type` int(11) NOT NULL default '0', `device_type` int(11) NOT NULL default '0', `FK_users` int(11) NOT NULL default '0', `private` smallint(6) NOT NULL default '1', `FK_entities` int(11) NOT NULL default '-1', `recursive` smallint(6) NOT NULL default '0', `path` varchar(255) default NULL, `query` text, PRIMARY KEY (`ID`), KEY `FK_users` (`FK_users`), KEY `private` (`private`), KEY `device_type` (`device_type`), KEY `recursive` (`recursive`), KEY `FK_entities` (`FK_entities`), KEY `type` (`type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.71 add table glpi_bookmark"); } if (!FieldExists("glpi_profiles", "show_group_planning", false)) { $query = "ALTER TABLE `glpi_profiles` ADD `show_group_planning` CHAR( 1 ) NULL AFTER `show_planning` "; $DB->queryOrDie($query, "0.71 add show_group_planning in glpi_profiles"); $query = "UPDATE `glpi_profiles` SET `show_group_planning` = `show_all_planning`"; $DB->queryOrDie($query, "0.71 update value of show_group_planning right"); } if (!FieldExists("glpi_users", "FK_profiles", false)) { $query = "ALTER TABLE `glpi_users` ADD `FK_profiles` INT NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.71 add default profile to user"); } if (!FieldExists("glpi_users", "FK_entities", false)) { $query = "ALTER TABLE `glpi_users` ADD `FK_entities` INT NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.71 add default entity to user"); } if (!FieldExists("glpi_auth_ldap", "ldap_opt_deref", false)) { $query = "ALTER TABLE `glpi_auth_ldap` ADD `ldap_opt_deref` INT (1) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.71 add ldap_opt_deref to glpi_auth_ldap"); } //ticket opening restrictions if (!FieldExists("glpi_config", "ticket_title_mandatory", false)) { $query = "ALTER TABLE `glpi_config` ADD `ticket_title_mandatory` INT (1) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.71 add ticket_title_mandatory to glpi_config"); } if (!FieldExists("glpi_config", "ticket_content_mandatory", false)) { $query = "ALTER TABLE `glpi_config` ADD `ticket_content_mandatory` INT (1) NOT NULL DEFAULT '1'"; $DB->queryOrDie($query, "0.71 add ticket_content_mandatory to glpi_config"); } if (!FieldExists("glpi_config", "ticket_category_mandatory", false)) { $query = "ALTER TABLE `glpi_config` ADD `ticket_category_mandatory` INT (1) NOT NULL DEFAULT '0'"; $DB->queryOrDie($query, "0.71 add ticket_category_mandatory to glpi_config"); } // Add alerts on licenses if (!FieldExists("glpi_config", "licenses_alert", false)) { $query = "ALTER TABLE `glpi_config` ADD `licenses_alert` SMALLINT NOT NULL DEFAULT '0' AFTER `infocom_alerts`"; $DB->queryOrDie($query, "0.71 add licenses_alert to glpi_config"); } if (!FieldExists("glpi_config", "autoclean_link_contact", false)) { $query = "ALTER TABLE `glpi_config` ADD `autoclean_link_contact` smallint(6) NOT NULL DEFAULT '0' AFTER `autoupdate_link_location`, ADD `autoclean_link_user` smallint(6) NOT NULL DEFAULT '0' AFTER `autoclean_link_contact`, ADD `autoclean_link_group` smallint(6) NOT NULL DEFAULT '0' AFTER `autoclean_link_user`, ADD `autoclean_link_location` smallint(6) NOT NULL DEFAULT '0' AFTER `autoclean_link_group`"; $DB->queryOrDie($query, "0.71 add autoclean_link_* to glpi_config"); } if (!FieldExists("glpi_config", "autoupdate_link_state", false)) { $query = "ALTER TABLE `glpi_config` ADD `autoupdate_link_state` smallint(6) NOT NULL DEFAULT '0' AFTER `autoupdate_link_location`, ADD `autoclean_link_state` smallint(6) NOT NULL DEFAULT '0' AFTER `autoclean_link_location`"; $DB->queryOrDie($query, "0.71 add autoclean_link_state to glpi_config"); $query = "UPDATE `glpi_ocs_config` SET `deconnection_behavior` = '' WHERE `deconnection_behavior` != 'trash' AND `deconnection_behavior` != 'delete'"; $DB->query($query); } if (!FieldExists("glpi_profiles", "bookmark_public", false)) { $query = "ALTER TABLE `glpi_profiles` ADD `bookmark_public` CHAR( 1 ) AFTER `reminder_public`"; $DB->queryOrDie($query, "0.71 add bookmark_public to glpi_profiles"); $query = "UPDATE `glpi_profiles` SET `bookmark_public` = `reminder_public`"; $DB->queryOrDie($query, "0.71 init bookmark_public value in glpi_profiles"); } if (!FieldExists("glpi_config", "admin_reply", false)) { $query = "ALTER TABLE `glpi_config` ADD `admin_reply` VARCHAR( 255 ) NULL AFTER `admin_email`"; $DB->queryOrDie($query, "0.71 add admin_reply to glpi_config"); } if (!FieldExists("glpi_config", "mailgate_filesize_max", false)) { $query = "ALTER TABLE `glpi_config` ADD `mailgate_filesize_max` int(11) NOT NULL DEFAULT ".(2*1024*1024)." AFTER `ticket_category_mandatory`"; $DB->queryOrDie($query, "0.71 add mailgate_filesize_max to glpi_config"); } if (!FieldExists("glpi_entities_data", "admin_reply", false)) { $query = "ALTER TABLE `glpi_entities_data` ADD `admin_reply` VARCHAR( 255 ) NULL AFTER `admin_email` "; $DB->queryOrDie($query, "0.71 add admin_reply to glpi_entities_data"); } if (!isIndex("glpi_kbitems", "fulltext")) { $query = "ALTER TABLE `glpi_kbitems` ADD FULLTEXT `fulltext` (`question`, `answer`)"; $DB->queryOrDie($query, "0.71 add fulltext index glpi_kbitems"); } if (!FieldExists("glpi_profiles", "user_auth_method", false)) { $query = "ALTER TABLE `glpi_profiles` ADD `user_auth_method` CHAR( 1 ) NULL DEFAULT NULL AFTER `user`"; $DB->queryOrDie($query, "0.71 add user_auth_method to glpi_profiles"); $query = "UPDATE `glpi_profiles` SET `user_auth_method` = `user`"; $DB->queryOrDie($query, "0.71 init user_auth_method value in glpi_profiles"); } if (isIndex("glpi_printers", "id")) { $query = "ALTER TABLE `glpi_printers` DROP INDEX `id`"; $DB->queryOrDie($query, "0.71 drop id index in glpi_printers"); } if (isIndex("glpi_users", "name_2")) { $query = "ALTER TABLE `glpi_users` DROP INDEX `name_2`"; $DB->queryOrDie($query, "0.71 drop name_2 index in glpi_users"); } if (!FieldExists("glpi_rules_descriptions","comments", false)) { $query = "ALTER TABLE `glpi_rules_descriptions` ADD `comments` TEXT NULL DEFAULT NULL"; $DB->queryOrDie($query, "0.71 add comments to glpi_rules_descriptions"); } } // fin 0.71 ##################################################################################### ?>glpi-0.84.3+dfsg.1/install/update_0801_0803.php000066400000000000000000000035511226600447100204100ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /** * Update from 0.80.1 to 0.80.3 * * @return bool for success (will die for most error) **/ function update0801to0803() { global $DB, $migration; $updateresult = true; $ADDTODISPLAYPREF = array(); //TRANS: %s is the number of new version $migration->displayTitle(sprintf(__('Update to %s'), '0.80.3')); $migration->setVersion('0.80.3'); $migration->changeField("glpi_fieldunicities", 'fields', 'fields', "text"); $migration->dropKey('glpi_ocslinks', 'unicity'); $migration->migrationOneTable('glpi_ocslinks'); $migration->addKey("glpi_ocslinks", array('ocsid', 'ocsservers_id'), "unicity", "UNIQUE"); // must always be at the end $migration->executeMigration(); return $updateresult; } ?> glpi-0.84.3+dfsg.1/install/update_0803_083.php000077500000000000000000002625251226600447100203450ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /** * Update from 0.80.3 to 0.83 * * @return bool for success (will die for most error) **/ function update0803to083() { global $DB, $migration; $updateresult = true; $ADDTODISPLAYPREF = array(); //TRANS: %s is the number of new version $migration->displayTitle(sprintf(__('Update to %s'), '0.83')); $migration->setVersion('0.83'); $backup_tables = false; $newtables = array('glpi_entities_knowbaseitems', 'glpi_entities_reminders', 'glpi_groups_problems', 'glpi_groups_knowbaseitems', 'glpi_groups_reminders', 'glpi_knowbaseitems_profiles', 'glpi_knowbaseitems_users', 'glpi_items_problems', 'glpi_problems', 'glpi_problemtasks', 'glpi_problems_ticket', 'glpi_problems_users', 'glpi_profiles_reminders', 'glpi_reminders_users', 'glpi_ticketrecurrents', 'glpi_tickettemplates', 'glpi_tickettemplatehiddenfields', 'glpi_tickettemplatemandatoryfields', 'glpi_tickettemplatepredefinedfields', 'glpi_useremails'); foreach ($newtables as $new_table) { // rename new tables if exists ? if (TableExists($new_table)) { $migration->dropTable("backup_$new_table"); $migration->displayWarning("$new_table table already exists. ". "A backup have been done to backup_$new_table."); $backup_tables = true; $query = $migration->renameTable("$new_table", "backup_$new_table"); } } if ($backup_tables) { $migration->displayWarning("You can delete backup tables if you have no need of them.", true); } //TRANS: %s is the table or item implied $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'Problems')); // Clean ticket validations : already done in 0.80 $query = "DELETE FROM `glpi_ticketvalidations` WHERE `glpi_ticketvalidations`.`tickets_id` NOT IN (SELECT `glpi_tickets`.`id` FROM `glpi_tickets`)"; $DB->queryOrDie($query, "0.83 clean glpi_ticketvalidations"); // Problems management if (!TableExists('glpi_problems')) { $query = "CREATE TABLE `glpi_problems` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `status` varchar(255) DEFAULT NULL, `content` longtext DEFAULT NULL, `date_mod` DATETIME DEFAULT NULL, `date` DATETIME DEFAULT NULL, `solvedate` DATETIME DEFAULT NULL, `closedate` DATETIME DEFAULT NULL, `due_date` DATETIME DEFAULT NULL, `users_id_recipient` int(11) NOT NULL DEFAULT '0', `users_id_lastupdater` int(11) NOT NULL DEFAULT '0', `suppliers_id_assign` int(11) NOT NULL DEFAULT '0', `urgency` int(11) NOT NULL DEFAULT '1', `impact` int(11) NOT NULL DEFAULT '1', `priority` int(11) NOT NULL DEFAULT '1', `itilcategories_id` int(11) NOT NULL DEFAULT '0', `impactcontent` longtext DEFAULT NULL, `causecontent` longtext DEFAULT NULL, `symptomcontent` longtext DEFAULT NULL, `solutiontypes_id` int(11) NOT NULL DEFAULT '0', `solution` text COLLATE utf8_unicode_ci, `actiontime` int(11) NOT NULL DEFAULT '0', `begin_waiting_date` datetime DEFAULT NULL, `waiting_duration` int(11) NOT NULL DEFAULT '0', `close_delay_stat` int(11) NOT NULL DEFAULT '0', `solve_delay_stat` int(11) NOT NULL DEFAULT '0', `notepad` LONGTEXT NULL, PRIMARY KEY (`id`), KEY `name` (`name`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`), KEY `is_deleted` (`is_deleted`), KEY `date` (`date`), KEY `closedate` (`closedate`), KEY `status` (`status`(1)), KEY `priority` (`priority`), KEY `date_mod` (`date_mod`), KEY `suppliers_id_assign` (`suppliers_id_assign`), KEY `itilcategories_id` (`itilcategories_id`), KEY `users_id_recipient` (`users_id_recipient`), KEY `solvedate` (`solvedate`), KEY `solutiontypes_id` (`solutiontypes_id`), KEY `urgency` (`urgency`), KEY `impact` (`impact`), KEY `due_date` (`due_date`), KEY `users_id_lastupdater` (`users_id_lastupdater`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.83 create glpi_problems"); $ADDTODISPLAYPREF['Problem'] = array(21,12,19,15,3,7,18); } if (FieldExists('glpi_tickets', 'ticket_waiting_duration', false)) { $migration->changeField('glpi_tickets', 'ticket_waiting_duration', 'waiting_duration', 'integer'); } if (!TableExists('glpi_problems_users')) { $query = "CREATE TABLE `glpi_problems_users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `problems_id` int(11) NOT NULL DEFAULT '0', `users_id` int(11) NOT NULL DEFAULT '0', `type` int(11) NOT NULL DEFAULT '1', `use_notification` tinyint(1) NOT NULL DEFAULT '0', `alternative_email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`problems_id`,`type`,`users_id`,`alternative_email`), KEY `user` (`users_id`,`type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.83 add table glpi_problems_users"); } if (!TableExists('glpi_groups_problems')) { $query = "CREATE TABLE `glpi_groups_problems` ( `id` int(11) NOT NULL AUTO_INCREMENT, `problems_id` int(11) NOT NULL DEFAULT '0', `groups_id` int(11) NOT NULL DEFAULT '0', `type` int(11) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`problems_id`,`type`,`groups_id`), KEY `group` (`groups_id`,`type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.83 add table glpi_groups_problems"); } if (!TableExists('glpi_items_problems')) { $query = "CREATE TABLE `glpi_items_problems` ( `id` int(11) NOT NULL AUTO_INCREMENT, `problems_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(100) default NULL, `items_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`problems_id`,`itemtype`,`items_id`), KEY `item` (`itemtype`,`items_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.83 add table glpi_items_problems"); } if (!TableExists('glpi_problems_tickets')) { $query = "CREATE TABLE `glpi_problems_tickets` ( `id` int(11) NOT NULL AUTO_INCREMENT, `problems_id` int(11) NOT NULL DEFAULT '0', `tickets_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`problems_id`,`tickets_id`), KEY `tickets_id` (`tickets_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.83 add table glpi_problems_tickets"); } if (!TableExists('glpi_problemtasks')) { $query = "CREATE TABLE `glpi_problemtasks` ( `id` int(11) NOT NULL AUTO_INCREMENT, `problems_id` int(11) NOT NULL DEFAULT '0', `taskcategories_id` int(11) NOT NULL DEFAULT '0', `date` datetime DEFAULT NULL, `begin` datetime DEFAULT NULL, `end` datetime DEFAULT NULL, `users_id` int(11) NOT NULL DEFAULT '0', `users_id_tech` int(11) NOT NULL DEFAULT '0', `content` longtext COLLATE utf8_unicode_ci, `actiontime` int(11) NOT NULL DEFAULT '0', `state` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `problems_id` (`problems_id`), KEY `users_id` (`users_id`), KEY `users_id_tech` (`users_id_tech`), KEY `date` (`date`), KEY `begin` (`begin`), KEY `end` (`end`), KEY `state` (`state`), KEY `taskcategories_id` (taskcategories_id) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.83 add table glpi_problemtasks"); } $migration->addField("glpi_profiles", "show_my_problem", "char", array('update' => "1", 'condition' => " WHERE `own_ticket` = 1")); $migration->addField("glpi_profiles", "show_all_problem", "char", array('update' => "1", 'condition' => " WHERE `show_all_ticket` = 1")); $migration->addField("glpi_profiles", "edit_all_problem", "char", array('update' => "1", 'condition' => " WHERE `update_ticket` = 1")); $migration->changeField("glpi_profiles", 'helpdesk_status', 'ticket_status', "text", array('comment' => "json encoded array of from/dest allowed status change")); $migration->addField('glpi_profiles', 'problem_status', "text", array('comment' => "json encoded array of from/dest allowed status change")); $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'Changes')); $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'TicketPlanning')); // Merge tickettasks and ticket planning if (TableExists('glpi_ticketplannings')) { $migration->addField("glpi_tickettasks", "begin", "datetime"); $migration->addField("glpi_tickettasks", "end", "datetime"); $migration->addField("glpi_tickettasks", "state", "integer", array('value' => '1')); $migration->addField("glpi_tickettasks", "users_id_tech", "integer"); $migration->migrationOneTable('glpi_tickettasks'); // migrate DATA $task = new TicketTask(); foreach ($DB->request('glpi_ticketplannings') as $data) { if ($task->getFromDB($data['tickettasks_id'])) { $query = "UPDATE `glpi_tickettasks` SET `begin` = ".((($data['begin'] == 'NULL') || is_null($data['begin'])) ?'NULL':"'".$data['begin']."'").", `end` = ".((($data['end'] == 'NULL') || is_null($data['end'])) ?'NULL':"'".$data['end']."'").", `users_id_tech` = '".$data['users_id']."', `state` = '".$data['state']."' WHERE `id` = '".$data['tickettasks_id']."'"; $DB->queryOrDie($query, "0.83 migrate planning to glpi_tickettasks"); } } $migration->dropTable("glpi_ticketplannings"); $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'Notification')); // Migrate templates $from = array('task.planning.user##', 'task.planning.begin##', 'task.planning.end##', 'task.planning.status##',); $to = array('task.user##', 'task.begin##', 'task.end##', 'task.status##',); $query = "SELECT `glpi_notificationtemplatetranslations`.* FROM `glpi_notificationtemplatetranslations` INNER JOIN `glpi_notificationtemplates` ON (`glpi_notificationtemplates`.`id` = `glpi_notificationtemplatetranslations`.`notificationtemplates_id`) WHERE `glpi_notificationtemplates`.`itemtype` = 'Ticket'"; if ($result=$DB->query($query)) { if ($DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $query = "UPDATE `glpi_notificationtemplatetranslations` SET `subject` = '".addslashes(str_replace($from,$to,$data['subject']))."', `content_text` = '".addslashes(str_replace($from,$to, $data['content_text']))."', `content_html` = '".addslashes(str_replace($from,$to, $data['content_html']))."' WHERE `id` = ".$data['id'].""; $DB->queryOrDie($query, "0.83 fix tags usage for multi users"); } } } } $query = "SELECT * FROM `glpi_notificationtemplates` WHERE `name` = 'Problems'"; if ($result=$DB->query($query)) { if ($DB->numrows($result)==0) { $query = "INSERT INTO `glpi_notificationtemplates` (`name`, `itemtype`, `date_mod`) VALUES ('Problems', 'Problem', NOW())"; $DB->queryOrDie($query, "0.83 add problem notification"); $notid = $DB->insert_id(); $query = "INSERT INTO `glpi_notificationtemplatetranslations` (`notificationtemplates_id`, `language`, `subject`, `content_text`, `content_html`) VALUES ($notid, '', '##problem.action## ##problem.title##', '##IFproblem.storestatus=solved## ##lang.problem.url## : ##problem.urlapprove## ##lang.problem.solvedate## : ##problem.solvedate## ##lang.problem.solution.type## : ##problem.solution.type## ##lang.problem.solution.description## : ##problem.solution.description## ##ENDIFproblem.storestatus## ##ELSEproblem.storestatus## ##lang.problem.url## : ##problem.url## ##ENDELSEproblem.storestatus## ##lang.problem.description## ##lang.problem.title##  :##problem.title## ##lang.problem.authors##  :##IFproblem.authors## ##problem.authors## ##ENDIFproblem.authors## ##ELSEproblem.authors##--##ENDELSEproblem.authors## ##lang.problem.creationdate##  :##problem.creationdate## ##IFproblem.assigntousers## ##lang.problem.assigntousers##  : ##problem.assigntousers## ##ENDIFproblem.assigntousers## ##lang.problem.status##  : ##problem.status## ##IFproblem.assigntogroups## ##lang.problem.assigntogroups##  : ##problem.assigntogroups## ##ENDIFproblem.assigntogroups## ##lang.problem.urgency##  : ##problem.urgency## ##lang.problem.impact##  : ##problem.impact## ##lang.problem.priority## : ##problem.priority## ##IFproblem.category## ##lang.problem.category##  :##problem.category## ##ENDIFproblem.category## ##ELSEproblem.category## ##lang.problem.nocategoryassigned## ##ENDELSEproblem.category## ##lang.problem.content##  : ##problem.content## ##IFproblem.storestatus=closed## ##lang.problem.solvedate## : ##problem.solvedate## ##lang.problem.solution.type## : ##problem.solution.type## ##lang.problem.solution.description## : ##problem.solution.description## ##ENDIFproblem.storestatus## ##lang.problem.numberoftickets## : ##problem.numberoftickets## ##FOREACHtickets## [##ticket.date##] ##lang.problem.title## : ##ticket.title## ##lang.problem.content## ##ticket.content## ##ENDFOREACHtickets## ##lang.problem.numberoftasks## : ##problem.numberoftasks## ##FOREACHtasks## [##task.date##] ##lang.task.author## ##task.author## ##lang.task.description## ##task.description## ##lang.task.time## ##task.time## ##lang.task.category## ##task.category## ##ENDFOREACHtasks## ', '<p>##IFproblem.storestatus=solved##</p> <div>##lang.problem.url## : <a href=\"##problem.urlapprove##\">##problem.urlapprove##</a></div> <div><span style=\"color: #888888;\"><strong><span style=\"text-decoration: underline;\">##lang.problem.solvedate##</span></strong></span> : ##problem.solvedate##<br /><span style=\"text-decoration: underline; color: #888888;\"><strong>##lang.problem.solution.type##</strong></span> : ##problem.solution.type##<br /><span style=\"text-decoration: underline; color: #888888;\"><strong>##lang.problem.solution.description##</strong></span> : ##problem.solution.description## ##ENDIFproblem.storestatus##</div> <div>##ELSEproblem.storestatus## ##lang.problem.url## : <a href=\"##problem.url##\">##problem.url##</a> ##ENDELSEproblem.storestatus##</div> <p class=\"description b\"><strong>##lang.problem.description##</strong></p> <p><span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.problem.title##</span> :##problem.title## <br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.problem.authors##</span> :##IFproblem.authors## ##problem.authors## ##ENDIFproblem.authors## ##ELSEproblem.authors##--##ENDELSEproblem.authors## <br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.problem.creationdate##</span> :##problem.creationdate## <br /> ##IFproblem.assigntousers## <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.problem.assigntousers##</span> : ##problem.assigntousers## ##ENDIFproblem.assigntousers##<br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\">##lang.problem.status## </span> : ##problem.status##<br /> ##IFproblem.assigntogroups## <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.problem.assigntogroups##</span> : ##problem.assigntogroups## ##ENDIFproblem.assigntogroups##<br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.problem.urgency##</span> : ##problem.urgency##<br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.problem.impact##</span> : ##problem.impact##<br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.problem.priority##</span> : ##problem.priority## <br />##IFproblem.category##<span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\">##lang.problem.category## </span> :##problem.category## ##ENDIFproblem.category## ##ELSEproblem.category## ##lang.problem.nocategoryassigned## ##ENDELSEproblem.category## <br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.problem.content##</span> : ##problem.content##</p> <p>##IFproblem.storestatus=closed##<br /><span style=\"text-decoration: underline;\"><strong><span style=\"color: #888888;\">##lang.problem.solvedate##</span></strong></span> : ##problem.solvedate##<br /><span style=\"color: #888888;\"><strong><span style=\"text-decoration: underline;\">##lang.problem.solution.type##</span></strong></span> : ##problem.solution.type##<br /><span style=\"text-decoration: underline; color: #888888;\"><strong>##lang.problem.solution.description##</strong></span> : ##problem.solution.description##<br />##ENDIFproblem.storestatus##</p> <div class=\"description b\">##lang.problem.numberoftickets## : ##problem.numberoftickets##</div> <p>##FOREACHtickets##</p> <div><strong> [##ticket.date##] <em>##lang.problem.title## : <a href=\"##ticket.url##\">##ticket.title## </a></em></strong><br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> </span><span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\">##lang.problem.content## </span> ##ticket.content## <p>##ENDFOREACHtickets##</p> <div class=\"description b\">##lang.problem.numberoftasks## : ##problem.numberoftasks##</div> <p>##FOREACHtasks##</p> <div class=\"description b\"><strong>[##task.date##] </strong><br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.task.author##</span> ##task.author##<br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.task.description##</span> ##task.description##<br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.task.time##</span> ##task.time##<br /> <span style=\"color: #8b8c8f; font-weight: bold; text-decoration: underline;\"> ##lang.task.category##</span> ##task.category##</div> <p>##ENDFOREACHtasks##</p> </div>')"; $DB->queryOrDie($query, "0.83 add problem notification translation"); $notifications = array('new' => array(), 'update' => array(Notification::ASSIGN_TECH, Notification::OLD_TECH_IN_CHARGE), 'solved' => array(), 'add_task' => array(), 'update_task' => array(), 'delete_task' => array(), 'closed' => array(), 'delete' => array()); $notif_names = array('new' => 'New Problem', 'update' => 'Update Problem', 'solved' => 'Resolve Problem', 'add_task' => 'Add Task', 'update_task' => 'Update Task', 'delete_task' => 'Delete Task', 'closed' => 'Close Problem', 'delete' => 'Delete Problem'); foreach ($notifications as $key => $val) { $notifications[$key][] = Notification::AUTHOR; $notifications[$key][] = Notification::GLOBAL_ADMINISTRATOR; $notifications[$key][] = Notification::OBSERVER; } foreach ($notifications as $type => $targets) { $query = "INSERT INTO `glpi_notifications` (`name`, `entities_id`, `itemtype`, `event`, `mode`, `notificationtemplates_id`, `comment`, `is_recursive`, `is_active`, `date_mod`) VALUES ('".$notif_names[$type]."', 0, 'Problem', '$type', 'mail', $notid, '', 1, 1, NOW())"; $DB->queryOrDie($query, "0.83 add problem $type notification"); $notifid = $DB->insert_id(); foreach ($targets as $target) { $query = "INSERT INTO `glpi_notificationtargets` (`id`, `notifications_id`, `type`, `items_id`) VALUES (NULL, $notifid, ".Notification::USER_TYPE.", $target);"; $DB->queryOrDie($query, "0.83 add problem $type notification target"); } } } } $migration->displayMessage(sprintf(__('Data migration - %s'), 'Clean Vlans')); // Clean `glpi_networkports_vlans` datas (`networkports_id` whithout networkports) $query = "DELETE FROM `glpi_networkports_vlans` WHERE `networkports_id` NOT IN (SELECT `id` FROM `glpi_networkports`)"; $DB->queryOrDie($query, "0.83 clean networkports_vlans datas"); $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'Rename Solution objects')); // rename glpi_ticketsolutiontypes to glpi_solutiontypes $migration->renameTable('glpi_ticketsolutiontypes', 'glpi_solutiontypes'); // rename glpi_ticketsolutiontemplates to glpi_solutiontemplates $migration->renameTable('glpi_ticketsolutiontemplates', 'glpi_solutiontemplates'); $migration->changeField('glpi_tickets', 'ticketsolutiontypes_id', 'solutiontypes_id', 'integer'); $migration->changeField('glpi_solutiontemplates', 'ticketsolutiontypes_id', 'solutiontypes_id', 'integer'); $migration->changeField('glpi_tickets_users', 'use_notification', 'use_notification', 'bool', array('value' => '1')); // to have correct name of key $migration->dropKey('glpi_tickets', 'ticketsolutiontypes_id'); $migration->migrationOneTable('glpi_tickets'); $migration->addKey('glpi_tickets', 'solutiontypes_id'); $migration->dropKey('glpi_solutiontemplates', 'ticketsolutiontypes_id'); $migration->migrationOneTable('glpi_solutiontemplates'); $migration->addKey('glpi_solutiontemplates', 'solutiontypes_id'); $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'Rename Category objects')); $migration->renameTable('glpi_ticketcategories','glpi_itilcategories'); $migration->dropKey('glpi_itilcategories', 'ticketcategories_id'); $migration->changeField('glpi_itilcategories', 'ticketcategories_id', 'itilcategories_id', 'integer'); $migration->migrationOneTable('glpi_itilcategories'); $migration->addKey('glpi_itilcategories', 'itilcategories_id'); $migration->dropKey('glpi_tickets', 'ticketcategories_id'); $migration->changeField('glpi_tickets', 'ticketcategories_id', 'itilcategories_id', 'integer'); $migration->migrationOneTable('glpi_tickets'); $migration->addKey('glpi_tickets', 'itilcategories_id'); // Update Itemtype datas in tables $itemtype_tables = array("glpi_bookmarks", "glpi_bookmarks_users", "glpi_displaypreferences"); $typestochange = array ('TicketSolutionTemplate' => 'SolutionTemplate', 'TicketSolutionType' => 'SolutionType', 'TicketCategory' => 'ITILCategory',); foreach ($itemtype_tables as $table) { foreach ($typestochange as $key => $val) { $query = "UPDATE `$table` SET `itemtype` = '$val' WHERE `itemtype` = '$key'"; $DB->queryOrDie($query, "0.83 update itemtype of table $table for $val"); } } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'Add various fields')); $migration->addField("glpi_states", 'states_id', "integer"); $migration->addField("glpi_states", 'completename', "text"); $migration->addField("glpi_states", 'level', "integer"); $migration->addField("glpi_states", 'ancestors_cache', "longtext"); $migration->addField("glpi_states", 'sons_cache', "longtext"); $migration->migrationOneTable('glpi_states'); $migration->addKey("glpi_states", array('states_id','name'), 'unicity'); regenerateTreeCompleteName("glpi_states"); $migration->addField("glpi_knowbaseitemcategories", 'ancestors_cache', "longtext"); $migration->addField("glpi_knowbaseitemcategories", 'sons_cache', "longtext"); $migration->changeField("glpi_authldaps", 'group_condition', 'group_condition', "text"); $migration->dropKey("glpi_groups", 'ldap_value'); $migration->changeField("glpi_groups", 'ldap_value', 'ldap_value', "text"); $migration->dropKey("glpi_groups", 'ldap_group_dn'); $migration->changeField("glpi_groups", 'ldap_group_dn', 'ldap_group_dn', "text"); $migration->addField("glpi_groups", 'groups_id', "integer"); $migration->addField("glpi_groups", 'completename', "text"); $migration->addField("glpi_groups", 'level', "integer"); $migration->addField("glpi_groups", 'ancestors_cache', "longtext"); $migration->addField("glpi_groups", 'sons_cache', "longtext"); $migration->migrationOneTable('glpi_groups'); $migration->addKey("glpi_groups", 'ldap_value', '', 'INDEX', 200); $migration->addKey("glpi_groups", 'ldap_group_dn', '', 'INDEX', 200); $migration->addKey("glpi_groups", 'groups_id'); regenerateTreeCompleteName("glpi_groups"); $migration->addField("glpi_entitydatas", 'notification_subject_tag', "string", array('after' => 'admin_reply_name')); $migration->addField("glpi_vlans", 'tag', "integer"); $ADDTODISPLAYPREF['Vlan'] = array(11); $migration->addField("glpi_profiles", 'create_ticket_on_login', "bool"); $migration->addField("glpi_reminders", 'begin_view_date', "datetime"); $migration->addField("glpi_reminders", 'end_view_date', "datetime"); // only to change latin1 to utf-8 if not done in update 0.68.3 to 0.71 // because there is an index fulltext based on 2 fields (perhaps both are not in same encoding) $migration->changeField("glpi_knowbaseitems", 'answer', 'answer', "longtext"); $migration->changeField("glpi_knowbaseitems", 'question', 'name', "text"); $migration->addField("glpi_configs", "ajax_min_textsearch_load", "integer", array('after' => 'use_ajax')); $migration->addField("glpi_configs", "use_anonymous_followups", "bool", array('after' => 'use_anonymous_helpdesk')); $migration->addField("glpi_configs", "show_count_on_tabs", "bool", array('value' => '1')); $migration->addField("glpi_users", "show_count_on_tabs", "tinyint(1) NULL DEFAULT NULL"); $migration->addField("glpi_configs", "refresh_ticket_list", "integer"); $migration->addField("glpi_users", "refresh_ticket_list", "int(11) NULL DEFAULT NULL"); $migration->addField("glpi_configs", "set_default_tech", "bool", array('value' => '1')); $migration->addField("glpi_users", "set_default_tech", "tinyint(1) NULL DEFAULT NULL"); $migration->addField("glpi_reservations", "group", "integer"); $migration->addKey("glpi_reservations", array('reservationitems_id', 'group'), "resagroup"); /// Add document types $types = array('csv' => array('name' => 'Comma-Separated Values', 'icon' => 'csv-dist.png'), 'svg' => array('name' => 'Scalable Vector Graphics', 'icon' => 'svg-dist.png'),); foreach ($types as $ext => $data) { $query = "SELECT * FROM `glpi_documenttypes` WHERE `ext` = '$ext'"; if ($result=$DB->query($query)) { if ($DB->numrows($result) == 0) { $query = "INSERT INTO `glpi_documenttypes` (`name`, `ext`, `icon`, `is_uploadable`, `date_mod`) VALUES ('".$data['name']."', '$ext', '".$data['icon']."', '1', NOW())"; $DB->queryOrDie($query, "0.83 add document type $ext"); } } } /// Update icons $types = array('c' => 'c-dist.png', 'h' => 'h-dist.png', 'swf' => 'swf-dist.png', 'pas' => 'pas-dist.png', 'wmv' => 'wmv-dist.png', 'zip' => 'zip-dist.png',); foreach ($types as $ext => $icon) { $query = "SELECT `id` FROM `glpi_documenttypes` WHERE `ext` = '$ext'"; if ($result=$DB->query($query)) { if ($DB->numrows($result) == 1) { $query = "UPDATE `glpi_documenttypes` SET `icon` = '$icon', `date_mod` = NOW() WHERE `id` = '".$DB->result($result,0,0)."'"; $DB->queryOrDie($query, "0.83 update icon for doc type $ext"); } } } /// add missing indexes for fields $migration->addKey("glpi_authldaps", "is_active"); $migration->addKey("glpi_authmails", "is_active"); $migration->addKey("glpi_ocsservers", "is_active"); $migration->changeField("glpi_users", 'token','password_forget_token', "char(40) NULL DEFAULT NULL"); $migration->changeField("glpi_users", 'tokendate','password_forget_token_date', "datetime"); $migration->addField("glpi_users", "personal_token", 'string'); $migration->addField("glpi_users", "personal_token_date", "datetime"); $migration->addField("glpi_tickets", "is_deleted", "bool"); $migration->addKey("glpi_tickets", "is_deleted"); $migration->addField("glpi_contracts", "template_name", 'string'); $migration->addField("glpi_contracts", "is_template", 'bool'); $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'Give consumable to groups')); if ($migration->addField("glpi_consumables", "itemtype", "VARCHAR(100) DEFAULT NULL", array("after" => "date_out", "update" => "'User'"))) { $migration->dropKey("glpi_consumables", 'users_id'); $migration->changeField("glpi_consumables", 'users_id', 'items_id', 'integer'); $migration->addKey("glpi_consumables", array('itemtype','items_id'),'item'); } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'Several emails for users')); // Several email per users if (!TableExists('glpi_useremails')) { $query = "CREATE TABLE `glpi_useremails` ( `id` int(11) NOT NULL AUTO_INCREMENT, `users_id` int(11) NOT NULL DEFAULT '0', `is_default` TINYINT( 1 ) NOT NULL DEFAULT 0, `is_dynamic` TINYINT( 1 ) NOT NULL DEFAULT 0, `email` varchar( 255 ) NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`users_id`,`email`), KEY `email` (`email`), KEY `is_default` (`is_default`), KEY `is_dynamic` (`is_dynamic`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.83 add table glpi_useremails"); } // Manage migration : populate is_default=1 // and is_dynamic depending of authldap config / authtype / auths_id if (FieldExists("glpi_users", 'email', false)) { $query = "SELECT * FROM `glpi_users` WHERE `email` <> '' AND `email` IS NOT NULL"; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { while ($data = $DB->fetch_assoc($result)) { $is_dynamic = 0; $ldap_servers = array(); // manage is_dynamic : if ($data['authtype'] == Auth::MAIL) { $is_dynamic = 1; } else if ((Auth::isAlternateAuth($data["authtype"]) && $data['auths_id'] >0) || $data['authtype'] == Auth::LDAP) { if (!isset($ldap_servers[$data['auths_id']])) { $ldap_servers[$data['auths_id']] = 0; $ldap = new AuthLDAP(); if ($ldap->getFromDB($data['auths_id'])) { if (!empty($ldap->fields['email_field'])) { $ldap_servers[$data['auths_id']] = 1; } } } $is_dynamic = $ldap_servers[$data['auths_id']]; } $query2 = "INSERT INTO `glpi_useremails` (`users_id`, `is_default`, `is_dynamic`, `email`) VALUES ('".$data['id']."','1','$is_dynamic','".addslashes($data['email'])."')"; $DB->queryOrDie($query2, "0.83 move emails to glpi_useremails"); } } } // Drop email field from glpi_users $migration->dropField("glpi_users", 'email'); } // check unicity for users email : unset rule and display warning foreach ($DB->request("glpi_fieldunicities", "`itemtype` = 'User' AND `fields` LIKE '%email%'") as $data) { $query = "UPDATE `glpi_fieldunicities` SET `is_active` = '0' WHERE `id` = '".$data['id']."'"; $DB->query($query); echo "

    A unicity check use email for users. "; echo "Due to new feature permit several email per users, this rule have been disabled.

    "; } // multiple manager in groups $migration->changeField("glpi_authldaps", 'email_field', 'email1_field', 'string'); $migration->addField("glpi_authldaps", 'email2_field','string'); $migration->addField("glpi_authldaps", 'email3_field','string'); $migration->addField("glpi_authldaps", 'email4_field','string'); $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'Multiple managers for groups')); /// migration : multiple group managers $migration->addField("glpi_groups_users", "is_manager", 'bool'); $migration->addKey("glpi_groups_users", "is_manager"); $migration->migrationOneTable('glpi_groups_users'); if (FieldExists("glpi_groups", 'users_id', false)) { $query = "SELECT * FROM `glpi_groups` WHERE `users_id` > 0"; $user = new User(); if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { while ($data = $DB->fetch_assoc($result)) { if ($user->getFromDB($data['users_id'])) { $query = "SELECT `id` FROM `glpi_groups_users` WHERE `groups_id` = '".$data['id']."' AND `users_id` = '".$data['users_id']."'"; if ($result2 = $DB->query($query)) { // add manager to groups_users setting if not present if ($DB->numrows($result2)==0) { $query2 = "INSERT INTO`glpi_groups_users` (`users_id`, `groups_id`, `is_manager`) VALUES ('".$data['users_id']."' ,'".$data['id']."', '1')"; $DB->queryOrDie($query2, "0.83 insert manager of groups"); } else { // Update user as manager if presnet in groups_users $query2 = "UPDATE `glpi_groups_users` SET `is_manager` = '1' WHERE `groups_id` = '".$data['id']."' AND `users_id` = '".$data['users_id']."'"; $DB->queryOrDie($query2, "0.83 set manager of groups"); } } } } } } // Drop field glpi_groups $migration->dropField("glpi_groups", 'users_id'); } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'Add entities information on document links')); if ($migration->addField("glpi_documents_items", "entities_id", "integer")) { $migration->addField("glpi_documents_items", "is_recursive", "bool"); $migration->migrationOneTable('glpi_documents_items'); $query_doc_i = "UPDATE `glpi_documents_items` as `doc_i` INNER JOIN `glpi_documents` as `doc` ON `doc`.`id` = `doc_i`.`documents_id` SET `doc_i`.`entities_id` = `doc`.`entities_id`, `doc_i`.`is_recursive` = `doc`.`is_recursive`"; $DB->queryOrDie($query_doc_i, "0.83 update entities_id and is_recursive in glpi_documents_items"); /// create index for search count on tab $migration->dropKey("glpi_documents_items", "item"); $migration->migrationOneTable('glpi_documents_items'); $migration->addKey("glpi_documents_items", array('itemtype', 'items_id', 'entities_id', 'is_recursive'), 'item'); } $migration->displayMessage(sprintf(__('Data migration - %s'), 'RuleTicket')); $changes['RuleTicket'] = array('ticketcategories_id' => 'itilcategories_id'); $DB->query("SET SESSION group_concat_max_len = 4194304;"); foreach ($changes as $ruletype => $tab) { // Get rules $query = "SELECT GROUP_CONCAT(`id`) FROM `glpi_rules` WHERE `sub_type` = '".$ruletype."' GROUP BY `sub_type`"; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { // Get rule string $rules = $DB->result($result,0,0); // Update actions foreach ($tab as $old => $new) { $query = "UPDATE `glpi_ruleactions` SET `field` = '$new' WHERE `field` = '$old' AND `rules_id` IN ($rules)"; $DB->queryOrDie($query, "0.83 update datas for rules actions"); } // Update criterias foreach ($tab as $old => $new) { $query = "UPDATE `glpi_rulecriterias` SET `criteria` = '$new' WHERE `criteria` = '$old' AND `rules_id` IN ($rules)"; $DB->queryOrDie($query, "0.83 update datas for rules criterias"); } } } } $migration->displayMessage(sprintf(__('Data migration - %s'),'Ticket templates')); $default_ticket_template = 0; if (!TableExists('glpi_tickettemplates')) { $query = "CREATE TABLE `glpi_tickettemplates` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar( 255 ) NULL DEFAULT NULL, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` TINYINT( 1 ) NOT NULL DEFAULT 0, `comment` TEXT DEFAULT NULL, PRIMARY KEY (`id`), KEY `name` (`name`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.83 add table glpi_tickettemplates"); $query = "INSERT INTO `glpi_tickettemplates` (`name`, `is_recursive`) VALUES ('Default', 1)"; $DB->queryOrDie($query, "0.83 add default ticket template"); $default_ticket_template = $DB->insert_id(); } $migration->addField('glpi_itilcategories', 'tickettemplates_id_incident', "integer"); $migration->addKey('glpi_itilcategories', 'tickettemplates_id_incident'); $migration->addField('glpi_itilcategories', 'tickettemplates_id_demand', "integer"); $migration->addKey('glpi_itilcategories', 'tickettemplates_id_demand'); $migration->addField('glpi_itilcategories', 'is_incident', "integer", array('value' => 1)); $migration->addKey('glpi_itilcategories', 'is_incident'); $migration->addField('glpi_itilcategories', 'is_request', "integer", array('value' => 1)); $migration->addKey('glpi_itilcategories', 'is_request'); $migration->addField('glpi_itilcategories', 'is_problem', "integer", array('value' => 1)); $migration->addKey('glpi_itilcategories', 'is_problem'); if (!TableExists('glpi_tickettemplatehiddenfields')) { $query = "CREATE TABLE `glpi_tickettemplatehiddenfields` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tickettemplates_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` TINYINT( 1 ) NOT NULL DEFAULT 0, `num` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`), KEY `unicity` (`tickettemplates_id`,`num`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.83 add table glpi_tickettemplatehiddenfields"); } if (!TableExists('glpi_tickettemplatepredefinedfields')) { $query = "CREATE TABLE `glpi_tickettemplatepredefinedfields` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tickettemplates_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` TINYINT( 1 ) NOT NULL DEFAULT 0, `num` int(11) NOT NULL DEFAULT '0', `value` TEXT DEFAULT NULL, PRIMARY KEY (`id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`), KEY `unicity` (`tickettemplates_id`,`num`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.83 add table glpi_tickettemplatepredefinedfields"); } if (!TableExists('glpi_tickettemplatemandatoryfields')) { $query = "CREATE TABLE `glpi_tickettemplatemandatoryfields` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tickettemplates_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` TINYINT( 1 ) NOT NULL DEFAULT 0, `num` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`), KEY `unicity` (`tickettemplates_id`,`num`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.83 add table glpi_tickettemplatemandatoryfields"); /// Add mandatory fields to default template if ($default_ticket_template > 0) { foreach ($DB->request('glpi_configs') as $data) { if (isset($data['is_ticket_title_mandatory']) && $data['is_ticket_title_mandatory']) { $query = "INSERT INTO `glpi_tickettemplatemandatoryfields` (`tickettemplates_id`, `num`) VALUES ('$default_ticket_template', 1)"; $DB->queryOrDie($query, "0.83 add mandatory field for default ticket template"); } if (isset($data['is_ticket_content_mandatory']) && $data['is_ticket_content_mandatory']) { $query = "INSERT INTO `glpi_tickettemplatemandatoryfields` (`tickettemplates_id`, `num`) VALUES ('$default_ticket_template', 21)"; $DB->queryOrDie($query, "0.83 add mandatory field for default ticket template"); } if (isset($data['is_ticket_category_mandatory']) && $data['is_ticket_category_mandatory']) { $query = "INSERT INTO `glpi_tickettemplatemandatoryfields` (`tickettemplates_id`, `num`) VALUES ('$default_ticket_template', 7)"; $DB->queryOrDie($query, "0.83 add mandatory field for default ticket template"); } } // Update itil categories $migration->migrationOneTable('glpi_itilcategories'); $query = "UPDATE `glpi_itilcategories` SET `tickettemplates_id_incident` = '$default_ticket_template', `tickettemplates_id_demand` = '$default_ticket_template'"; $DB->queryOrDie($query, "0.83 update default templates used by itil categories"); } } // Drop global mandatory config $migration->dropField('glpi_configs', 'is_ticket_title_mandatory'); $migration->dropField('glpi_configs', 'is_ticket_content_mandatory'); $migration->dropField('glpi_configs', 'is_ticket_category_mandatory'); $migration->addField('glpi_profiles', 'tickettemplate', "char", array('update' => '`sla`')); $migration->addField("glpi_entitydatas", "tickettemplates_id", 'integer', array('value' => '-2')); $migration->displayMessage(sprintf(__('Data migration - %s'), 'Tech Groups on items')); // Group of technicians in charge of Helpdesk items $migration->addField('glpi_computers', 'groups_id_tech', "integer", array('after' => "users_id_tech")); $migration->addKey('glpi_computers', 'groups_id_tech'); $migration->addField('glpi_monitors', 'groups_id_tech', "integer", array('after' => "users_id_tech")); $migration->addKey('glpi_monitors', 'groups_id_tech'); $migration->addField('glpi_networkequipments', 'groups_id_tech', "integer", array('after' => "users_id_tech")); $migration->addKey('glpi_networkequipments', 'groups_id_tech'); $migration->addField('glpi_peripherals', 'groups_id_tech', "integer", array('after' => "users_id_tech")); $migration->addKey('glpi_peripherals', 'groups_id_tech'); $migration->addField('glpi_phones', 'groups_id_tech', "integer", array('after' => "users_id_tech")); $migration->addKey('glpi_phones', 'groups_id_tech'); $migration->addField('glpi_printers', 'groups_id_tech', "integer", array('after' => "users_id_tech")); $migration->addKey('glpi_printers', 'groups_id_tech'); $migration->addField('glpi_softwares', 'groups_id_tech', "integer", array('after' => "users_id_tech")); $migration->addKey('glpi_softwares', 'groups_id_tech'); $migration->addField('glpi_cartridgeitems', 'groups_id_tech', "integer", array('after' => "users_id_tech")); $migration->addKey('glpi_cartridgeitems', 'groups_id_tech'); $migration->addField('glpi_consumableitems', 'groups_id_tech', "integer", array('after' => "users_id_tech")); $migration->addKey('glpi_consumableitems', 'groups_id_tech'); $migration->addField('glpi_printers', 'last_pages_counter', 'integer', array('after' => 'init_pages_counter')); $migration->addKey('glpi_printers', 'last_pages_counter'); $migration->displayMessage(sprintf(__('Data migration - %s'),'various cleaning DB')); // Clean ticket satisfactions $query = "DELETE FROM `glpi_ticketsatisfactions` WHERE `glpi_ticketsatisfactions`.`tickets_id` NOT IN (SELECT `glpi_tickets`.`id` FROM `glpi_tickets`)"; $DB->queryOrDie($query, "0.83 clean glpi_ticketsatisfactions"); // Clean unused slalevels $query = "DELETE FROM `glpi_slalevels_tickets` WHERE (`glpi_slalevels_tickets`.`tickets_id`, `glpi_slalevels_tickets`.`slalevels_id`) NOT IN (SELECT `glpi_tickets`.`id`, `glpi_tickets`.`slalevels_id` FROM `glpi_tickets`)"; $DB->queryOrDie($query, "0.83 clean glpi_slalevels_tickets"); $migration->displayMessage(sprintf(__('Data migration - %s'), 'recurrent tickets')); if (!TableExists('glpi_ticketrecurrents')) { $query = "CREATE TABLE `glpi_ticketrecurrents` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar( 255 ) NULL DEFAULT NULL, `comment` TEXT DEFAULT NULL, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` TINYINT( 1 ) NOT NULL DEFAULT 0, `is_active` TINYINT( 1 ) NOT NULL DEFAULT 0, `tickettemplates_id` int(11) NOT NULL DEFAULT '0', `begin_date` datetime DEFAULT NULL, `periodicity` int(11) NOT NULL DEFAULT '0', `create_before` int(11) NOT NULL DEFAULT '0', `next_creation_date` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`), KEY `is_active` (`is_active`), KEY `tickettemplates_id` (`tickettemplates_id`), KEY `next_creation_date` (`next_creation_date`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.83 add table glpi_ticketrecurrents"); $ADDTODISPLAYPREF['TicketRecurrent'] = array(11, 12, 13, 15, 14); } if (!countElementsInTable('glpi_crontasks', "`itemtype`='TicketRecurrent' AND `name`='ticketrecurrent'")) { $query = "INSERT INTO `glpi_crontasks` (`itemtype`, `name`, `frequency`, `param`, `state`, `mode`, `allowmode`, `hourmin`, `hourmax`, `logs_lifetime`, `lastrun`, `lastcode`, `comment`) VALUES ('TicketRecurrent', 'ticketrecurrent', 3600, NULL, 1, 1, 3, 0, 24, 30, NULL, NULL, NULL)"; $DB->queryOrDie($query, "0.83 populate glpi_crontasks for ticketrecurrent"); } $migration->addField('glpi_profiles', 'ticketrecurrent', "char", array('update' => '`sla`')); $migration->displayMessage(sprintf(__('Data migration - %s'), 'various fields add')); // Ticket delegation $migration->addField('glpi_groups_users', 'is_userdelegate', 'bool'); $migration->addKey('glpi_groups_users', 'is_userdelegate'); //Software dictionnary update $migration->addField("glpi_rulecachesoftwares", "entities_id", "string"); $migration->addField("glpi_rulecachesoftwares", "new_entities_id", "string"); $migration->addField("glpi_entitydatas", "entities_id_software", 'integer', array('value' => '-2')); // Groups perm $migration->addField('glpi_groups', 'is_requester', 'bool', array('value' => '1')); $migration->addField('glpi_groups', 'is_assign', 'bool', array('value' => '1')); $migration->addField('glpi_groups', 'is_notify', 'bool', array('value' => '1')); $migration->addField('glpi_groups', 'is_itemgroup', 'bool', array('value' => '1')); $migration->addField('glpi_groups', 'is_usergroup', 'bool', array('value' => '1')); $migration->addKey('glpi_groups', 'is_requester'); $migration->addKey('glpi_groups', 'is_assign'); $migration->addKey('glpi_groups', 'is_notify'); $migration->addKey('glpi_groups', 'is_itemgroup'); $migration->addKey('glpi_groups', 'is_usergroup'); // Ticket solution by entity $migration->addfield('glpi_solutiontypes', 'entities_id', 'integer'); $migration->addfield('glpi_solutiontypes', 'is_recursive', 'bool', array('value' => '1')); $migration->addKey('glpi_solutiontypes', 'entities_id'); $migration->addKey('glpi_solutiontypes', 'is_recursive'); // Fix solution template index $migration->dropKey('glpi_solutiontemplates', 'unicity'); $migration->addKey('glpi_solutiontemplates', 'entities_id'); // New index for count on tab $migration->addKey('glpi_ruleactions', array('field', 'value'), '', 'INDEX', 50); $migration->displayMessage(sprintf(__('Data migration - %s'), 'Create new default profiles')); $profiles = array('hotliner' => array('name' => 'Hotliner', 'interface' => 'central', 'user' => 'r', 'import_externalauth_users' => 'w', 'create_ticket' => '1', 'assign_ticket' => '1', 'global_add_followups' => '1', 'add_followups' => '1', 'update_ticket' => '1', 'observe_ticket' => '1', 'show_all_ticket' => '1', 'show_full_ticket' => '1', 'show_all_problem' => '1', 'show_planning' => '1', 'statistic' => '1', 'tickettemplate' => 'r', 'password_update' => '1', 'helpdesk_hardware' => '3', 'helpdesk_item_type' => addslashes('["Computer", "Monitor", "NetworkEquipment",' . '"Peripheral", "Phone", "Printer",' . '"Software"]'), 'create_validation' => '1', 'update_own_followups' => '1', 'create_ticket_on_login' => '1'), 'technician' => array('name' => 'Technician', 'interface' => 'central', 'password_update' => '1', 'computer' => 'w', 'monitor' => 'w', 'software' => 'w', 'networking' => 'w', 'printer' => 'w', 'peripheral' => 'w', 'cartridge' => 'w', 'consumable' => 'w', 'phone' => 'w', 'notes' => 'w', 'document' => 'w', 'knowbase' => 'w', 'faq' => 'w', 'reservation_helpdesk' => '1', 'reservation_central' => 'w', 'reports' => 'r', 'view_ocsng' => 'r', 'sync_ocsng' => 'w', 'user' => 'w', 'group' => 'r', 'entity' => 'r', 'transfer' => 'r', 'reminder_public' => 'w', 'create_ticket' => '1', 'add_followups' => '1', 'global_add_followups' => '1', 'global_add_tasks' => '1', 'update_ticket' => '1', 'own_ticket' => '1', 'show_all_ticket' => '1', 'show_assign_ticket' => '1', 'show_full_ticket' => '1', 'observe_ticket' => '1', 'update_followups' => '1', 'update_tasks' => '1', 'show_planning' => '1', 'statistic' => '1', 'helpdesk_hardware' => '3', 'helpdesk_item_type' => addslashes('["Computer", "Monitor", "NetworkEquipment",' . '"Peripheral", "Phone", "Printer",' . '"Software"]'), 'import_externalauth_users' => 'w', 'create_validation' => '1', 'sla' => 'r', 'update_own_followups' => '1', 'show_my_problem' => '1', 'show_all_problem' => '1', 'tickettemplate' => 'r', 'ticketrecurrent' => 'r'), 'supervisor' => array('name' => 'Supervisor', 'interface' => 'central', 'password_update' => '1', 'computer' => 'w', 'monitor' => 'w', 'software' => 'w', 'networking' => 'w', 'printer' => 'w', 'peripheral' => 'w', 'cartridge' => 'w', 'consumable' => 'w', 'phone' => 'w', 'notes' => 'w', 'document' => 'w', 'knowbase' => 'w', 'faq' => 'w', 'reservation_helpdesk' => '1', 'reservation_central' => 'w', 'reports' => 'r', 'view_ocsng' => 'r', 'sync_ocsng' => 'w', 'entity_dropdown' => 'w', 'rule_ticket' => 'r', 'entity_rule_ticket' => 'w', 'user' => 'w', 'group' => 'r', 'entity' => 'r', 'transfer' => 'r', 'logs' => 'r', 'reminder_public' => 'w', 'create_ticket' => '1', 'delete_ticket' => '1', 'add_followups' => '1', 'global_add_followups' => '1', 'global_add_tasks' => '1', 'update_ticket' => '1', 'update_priority' => '1', 'own_ticket' => '1', 'steal_ticket' => '1', 'assign_ticket' => '1', 'show_all_ticket' => '1', 'show_assign_ticket' => '1', 'show_full_ticket' => '1', 'observe_ticket' => '1', 'update_followups' => '1', 'update_tasks' => '1', 'show_planning' => '1', 'show_all_planning' => '1', 'statistic' => '1', 'helpdesk_hardware' => '3', 'helpdesk_item_type' => addslashes('["Computer", "Monitor", "NetworkEquipment",' . '"Peripheral", "Phone", "Printer",' . '"Software"]'), 'import_externalauth_users' => 'w', 'rule_mailcollector' => 'w', 'validate_ticket' => '1', 'create_validation' => '1', 'calendar' => 'w', 'sla' => 'w', 'update_own_followups' => '1', 'delete_followups' => '1', 'show_my_problem' => '1', 'show_all_problem' => '1', 'edit_all_problem' => '1', 'tickettemplate' => 'w', 'ticketrecurrent' => 'w') ); foreach ($profiles as $profile => $data) { $query = "INSERT INTO `glpi_profiles` (`".implode("`, `",array_keys($data))."`) VALUES ('".implode("', '",$data)."')"; $DB->queryOrDie($query, "0.83 create new profile $profile"); } $migration->displayMessage(sprintf(__('Data migration - %s'),'Reminder visibility')); if (!TableExists('glpi_reminders_users')) { $query = "CREATE TABLE `glpi_reminders_users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `reminders_id` int(11) NOT NULL DEFAULT '0', `users_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `reminders_id` (`reminders_id`), KEY `users_id` (`users_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.83 add table glpi_reminders_users"); } if (!TableExists('glpi_groups_reminders')) { $query = "CREATE TABLE `glpi_groups_reminders` ( `id` int(11) NOT NULL AUTO_INCREMENT, `reminders_id` int(11) NOT NULL DEFAULT '0', `groups_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '-1', `is_recursive` TINYINT( 1 ) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `reminders_id` (`reminders_id`), KEY `groups_id` (`groups_id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.83 add table glpi_groups_reminders"); } if (!TableExists('glpi_profiles_reminders')) { $query = "CREATE TABLE `glpi_profiles_reminders` ( `id` int(11) NOT NULL AUTO_INCREMENT, `reminders_id` int(11) NOT NULL DEFAULT '0', `profiles_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '-1', `is_recursive` TINYINT( 1 ) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `reminders_id` (`reminders_id`), KEY `profiles_id` (`profiles_id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.83 add table glpi_profiles_reminders"); } if (!TableExists('glpi_entities_reminders')) { $query = "CREATE TABLE `glpi_entities_reminders` ( `id` int(11) NOT NULL AUTO_INCREMENT, `reminders_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` TINYINT( 1 ) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `reminders_id` (`reminders_id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.83 add table glpi_entities_reminders"); } /// Migrate datas for is_helpdesk_visible : add all helpdesk profiles / drop field is_helpdesk_visible if (FieldExists("glpi_reminders", 'is_helpdesk_visible', false)) { $query = "SELECT `id` FROM `glpi_reminders` WHERE `is_helpdesk_visible` = 1"; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { // Grab helpdesk profiles $helpdesk_profiles = array(); foreach ($DB->request("glpi_profiles", "`interface` = 'helpdesk' AND `reminder_public` = 'r'") as $data2) { $helpdesk_profiles[$data2['id']] = $data2['id']; } if (count($helpdesk_profiles)) { while ($data = $DB->fetch_assoc($result)) { foreach ($helpdesk_profiles as $pid) { $query = "INSERT INTO `glpi_profiles_reminders` (`reminders_id`, `profiles_id`) VALUES ('".$data['id']."', '$pid');"; $DB->queryOrDie($query, "0.83 migrate data for is_helpdesk_visible drop on glpi_reminders"); } } } } } $migration->dropField("glpi_reminders", 'is_helpdesk_visible'); } // Migrate datas for entities + drop fields : is_private / entities_id / is_recursive if (FieldExists("glpi_reminders", 'is_private', false)) { $query = "SELECT * FROM `glpi_reminders` WHERE `is_private` = 0"; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { while ($data = $DB->fetch_assoc($result)) { $query = "INSERT INTO `glpi_entities_reminders` (`reminders_id`, `entities_id`, `is_recursive`) VALUES ('".$data['id']."', '".$data['entities_id']."', '".$data['is_recursive']."');"; $DB->queryOrDie($query, "0.83 migrate data for public reminders"); } } } $migration->dropField("glpi_reminders", 'is_private'); $migration->dropField("glpi_reminders", 'entities_id'); $migration->dropField("glpi_reminders", 'is_recursive'); } $ADDTODISPLAYPREF['Reminder'] = array(2,3,4,5,6,7); $migration->displayMessage(sprintf(__('Data migration - %s'), 'KnowbaseItem visibility')); if (!TableExists('glpi_knowbaseitems_users')) { $query = "CREATE TABLE `glpi_knowbaseitems_users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `knowbaseitems_id` int(11) NOT NULL DEFAULT '0', `users_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `knowbaseitems_id` (`knowbaseitems_id`), KEY `users_id` (`users_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.83 add table glpi_knowbaseitems_users"); } if (!TableExists('glpi_groups_knowbaseitems')) { $query = "CREATE TABLE `glpi_groups_knowbaseitems` ( `id` int(11) NOT NULL AUTO_INCREMENT, `knowbaseitems_id` int(11) NOT NULL DEFAULT '0', `groups_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '-1', `is_recursive` TINYINT( 1 ) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `knowbaseitems_id` (`knowbaseitems_id`), KEY `groups_id` (`groups_id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.83 add table glpi_groups_knowbaseitems"); } if (!TableExists('glpi_knowbaseitems_profiles')) { $query = "CREATE TABLE `glpi_knowbaseitems_profiles` ( `id` int(11) NOT NULL AUTO_INCREMENT, `knowbaseitems_id` int(11) NOT NULL DEFAULT '0', `profiles_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '-1', `is_recursive` TINYINT( 1 ) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `knowbaseitems_id` (`knowbaseitems_id`), KEY `profiles_id` (`profiles_id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.83 add table glpi_knowbaseitems_profiles"); } if (!TableExists('glpi_entities_knowbaseitems')) { $query = "CREATE TABLE `glpi_entities_knowbaseitems` ( `id` int(11) NOT NULL AUTO_INCREMENT, `knowbaseitems_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` TINYINT( 1 ) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `knowbaseitems_id` (`knowbaseitems_id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.83 add table glpi_entities_knowbaseitems"); } /// Migrate datas for entities_id / is_recursive if (FieldExists("glpi_knowbaseitems", 'entities_id', false)) { $query = "SELECT * FROM `glpi_knowbaseitems`"; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { while ($data = $DB->fetch_assoc($result)) { $query = "INSERT INTO `glpi_entities_knowbaseitems` (`knowbaseitems_id`, `entities_id`, `is_recursive`) VALUES ('".$data['id']."', '".$data['entities_id']."', '".$data['is_recursive']."');"; $DB->queryOrDie($query, "0.83 migrate data for entities on glpi_entities_knowbaseitems"); } } } $migration->dropField("glpi_knowbaseitems", 'entities_id'); $migration->dropField("glpi_knowbaseitems", 'is_recursive'); } // Plugins $migration->addField('glpi_plugins', 'license', 'string'); $migration->migrationOneTable('glpi_entitydatas'); $restore_root_entity_value = false; // create root entity if not exist with old default values if (countElementsInTable('glpi_entitydatas', 'entities_id=0') == 0) { $query = "INSERT INTO `glpi_entitydatas` (`entities_id`, `entities_id_software`, `autofill_order_date`, `autofill_delivery_date`, `autofill_buy_date`, `autofill_use_date`, `autofill_warranty_date`, `inquest_config`, `inquest_rate`, `inquest_delay`, `tickettype`, `calendars_id`, `tickettemplates_id`, `autoclose_delay`, `auto_assign_mode`, `cartridges_alert_repeat`, `consumables_alert_repeat`, `use_licenses_alert`, `use_infocoms_alert`, `notclosed_delay`, `use_contracts_alert`, `use_reservations_alert`) VALUES (0, -10, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, '$default_ticket_template', -1, -1, -1, -1, -1, -1, -1, -1, -1)"; // -1 to keep config value - see 1647 $DB->queryOrDie($query, "0.83 add entities_id 0 in glpi_entitydatas"); $restore_root_entity_value = true; } else { $query = "UPDATE `glpi_entitydatas` SET `tickettemplates_id` = '$default_ticket_template' WHERE `entities_id` = 0 AND `tickettemplates_id` = -2"; $DB->queryOrDie($query, "0.83 update tickettemplates_id for root entity in glpi_entitydatas"); $query = "UPDATE `glpi_entitydatas` SET `entities_id_software` = -10 WHERE `entities_id` = 0 AND `entities_id_software` = -2"; $DB->queryOrDie($query, "0.83 update entities_id_software for root entity in glpi_entitydatas"); // For root entity already exists in entitydatas in 0.78 $query = "UPDATE `glpi_entitydatas` SET `tickettype` = 1 WHERE `entities_id` = 0 AND `tickettype` = 0"; $DB->queryOrDie($query, "0.83 update tickettype for root entity in glpi_entitydatas"); $query = "UPDATE `glpi_entitydatas` SET `inquest_config` = 1 WHERE `entities_id` = 0 AND `inquest_config` = 0"; $DB->queryOrDie($query, "0.83 update inquest_config for root entity in glpi_entitydatas "); $query = "UPDATE `glpi_entitydatas` SET `inquest_rate` = 0 WHERE `entities_id` = 0 AND `inquest_rate` = '-1'"; $DB->queryOrDie($query, "0.83 update inquest_rate for root entity in glpi_entitydatas "); $query = "UPDATE `glpi_entitydatas` SET `inquest_delay` = 0 WHERE `entities_id` = 0 AND `inquest_delay` = '-1'"; $DB->queryOrDie($query, "0.83 update inquest_delay for root entity in glpi_entitydatas "); } // migration to new values for inherit parent (0 => -2) $field0 = array('calendars_id', 'tickettype', 'inquest_config'); foreach ($field0 as $field_0) { if (FieldExists("glpi_entitydatas", $field_0, false) ) { $query = "UPDATE `glpi_entitydatas` SET `$field_0` = '-2' WHERE `$field_0` = '0' AND `entities_id` > 0"; $DB->queryOrDie($query, "0.83 new value for inherit parent 0 in glpi_entitydatas"); } } // new default value $migration->changeField("glpi_entitydatas", "calendars_id", "calendars_id", "int(11) NOT NULL DEFAULT '-2'"); $migration->changeField("glpi_entitydatas", "tickettype", "tickettype", "int(11) NOT NULL DEFAULT '-2'"); $migration->changeField("glpi_entitydatas", "inquest_config", "inquest_config", "int(11) NOT NULL DEFAULT '-2'"); $migration->changeField("glpi_entitydatas", "inquest_rate", "inquest_rate", "int(11) NOT NULL DEFAULT '0'"); $migration->changeField("glpi_entitydatas", "inquest_delay", "inquest_delay", "int(11) NOT NULL DEFAULT '-10'"); // migration to new values for inherit parent (-1 => -2) $fieldparent = array('autofill_buy_date', 'autofill_delivery_date', 'autofill_warranty_date', 'autofill_order_date', 'autofill_use_date'); foreach ($fieldparent as $field_parent) { if (FieldExists("glpi_entitydatas", $field_parent, false)) { $query = "UPDATE `glpi_entitydatas` SET `$field_parent` = '-2' WHERE `$field_parent` = '-1'"; $DB->queryOrDie($query, "0.83 new value for inherit parent -1 in glpi_entitydatas"); } } // new default value $migration->changeField("glpi_entitydatas", "autofill_buy_date", "autofill_buy_date", 'string', array('value' => '-2')); $migration->changeField("glpi_entitydatas", "autofill_delivery_date", "autofill_delivery_date", 'string', array('value' => '-2')); $migration->changeField("glpi_entitydatas", "autofill_warranty_date", "autofill_warranty_date", 'string', array('value' => '-2')); $migration->changeField("glpi_entitydatas", "autofill_order_date", "autofill_order_date", 'string', array('value' => '-2')); $migration->changeField("glpi_entitydatas", "autofill_use_date", "autofill_use_date", 'string', array('value' => '-2')); // migration to new values for inherit config $fieldconfig = array('auto_assign_mode', 'autoclose_delay', 'cartridges_alert_repeat', 'consumables_alert_repeat', 'notclosed_delay', 'use_contracts_alert', 'use_infocoms_alert', 'use_licenses_alert', 'use_reservations_alert'); $query = "SELECT * FROM `glpi_configs`"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { if ($data = $DB->fetch_assoc($result)) { foreach ($fieldconfig as $field_config) { if (FieldExists("glpi_entitydatas", $field_config, false) && FieldExists("glpi_configs", $field_config, false)) { // value of general config $query = "UPDATE `glpi_entitydatas` SET `$field_config` = '".$data[$field_config]."' WHERE `$field_config` = -1"; $DB->queryOrDie($query, "0.83 migrate data from config to glpi_entitydatas"); $migration->changeField("glpi_entitydatas", "$field_config", "$field_config", "int(11) NOT NULL DEFAULT '-2'"); $migration->dropField("glpi_configs", $field_config); } } if (FieldExists("glpi_entitydatas", "auto_assign_mode", false)) { // new value for never $query = "UPDATE `glpi_entitydatas` SET `auto_assign_mode` = -10 WHERE `auto_assign_mode` = 0"; $DB->queryOrDie($query, "0.83 change value Never in glpi_entitydatas for auto_assign_mode"); } } } } // value of config in each entity $fieldconfig = array('default_contract_alert', 'default_infocom_alert', 'default_alarm_threshold'); $query = "SELECT * FROM `glpi_configs`"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { if ($data = $DB->fetch_assoc($result)) { foreach ($fieldconfig as $field_config) { if (FieldExists("glpi_configs", $field_config, false) && !FieldExists("glpi_entitydatas", $field_config, false)) { // add config fields in entitydatas $migration-> addField("glpi_entitydatas", $field_config, 'integer', array('update' => $data[$field_config], 'value' => ($field_config == "default_alarm_threshold" ? 10 : 0))); $migration->dropField("glpi_configs", $field_config); } } } } } if ($restore_root_entity_value) { $query = "UPDATE `glpi_entitydatas` SET `calendars_id` = 0 WHERE `entities_id` = 0;"; $DB->queryOrDie($query, "0.83 restore root entity default value"); } $migration->addKey('glpi_computervirtualmachines', 'computers_id'); $migration->addKey('glpi_computervirtualmachines', 'entities_id'); $migration->addKey('glpi_computervirtualmachines', 'name'); $migration->addKey('glpi_computervirtualmachines', 'virtualmachinestates_id'); $migration->addKey('glpi_computervirtualmachines', 'virtualmachinesystems_id'); $migration->addKey('glpi_computervirtualmachines', 'vcpu'); $migration->addKey('glpi_computervirtualmachines', 'ram'); // $ADDTODISPLAYPREF['KnowbaseItem'] = array(2,3,4,5,6,7); $renametables = array('TicketSolutionType' => 'SolutionType', 'TicketSolutionTemplate' => 'SolutionTemplate', 'TicketCategory' => 'ITILCategory'); $itemtype_tables = array("glpi_bookmarks" => 'itemtype', "glpi_bookmarks_users" => 'itemtype', "glpi_displaypreferences" => 'itemtype', "glpi_logs" => 'itemtype', "glpi_events" => 'type',); foreach ($itemtype_tables as $table => $field) { foreach ($renametables as $key => $val) { $query = "UPDATE `$table` SET `$field` = '".$val."' WHERE `$field` = '".$key."'"; $DB->queryOrDie($query, "0.83 update itemtype of table $table for $val"); } } // ************ Keep it at the end ************** $migration->displayMessage(sprintf(__('Data migration - %s'),'glpi_displaypreferences')); // Change is_recursive index $query = ("UPDATE `glpi_displaypreferences` SET `num` = '86' WHERE `itemtype` = 'Group' AND `num` = '6'"); $DB->query($query); foreach ($ADDTODISPLAYPREF as $type => $tab) { $query = "SELECT DISTINCT `users_id` FROM `glpi_displaypreferences` WHERE `itemtype` = '$type'"; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { while ($data = $DB->fetch_assoc($result)) { $query = "SELECT MAX(`rank`) FROM `glpi_displaypreferences` WHERE `users_id` = '".$data['users_id']."' AND `itemtype` = '$type'"; $result = $DB->query($query); $rank = $DB->result($result,0,0); $rank++; foreach ($tab as $newval) { $query = "SELECT * FROM `glpi_displaypreferences` WHERE `users_id` = '".$data['users_id']."' AND `num` = '$newval' AND `itemtype` = '$type'"; if ($result2=$DB->query($query)) { if ($DB->numrows($result2)==0) { $query = "INSERT INTO `glpi_displaypreferences` (`itemtype` ,`num` ,`rank` ,`users_id`) VALUES ('$type', '$newval', '".$rank++."', '".$data['users_id']."')"; $DB->query($query); } } } } } else { // Add for default user $rank = 1; foreach ($tab as $newval) { $query = "INSERT INTO `glpi_displaypreferences` (`itemtype` ,`num` ,`rank` ,`users_id`) VALUES ('$type', '$newval', '".$rank++."', '0')"; $DB->query($query); } } } } // must always be at the end $migration->executeMigration(); return $updateresult; } ?> glpi-0.84.3+dfsg.1/install/update_080_0801.php000066400000000000000000000137761226600447100203370ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /** * Update from 0.80 to 0.80.1 * * @return bool for success (will die for most error) **/ function update080to0801() { global $DB, $migration; $updateresult = true; $ADDTODISPLAYPREF = array(); //TRANS: %s is the number of new version $migration->displayTitle(sprintf(__('Update to %s'), '0.80.1')); $migration->setVersion('0.80.1'); // Clean duplicates $query = "SELECT COUNT(*) AS CPT, `tickets_id`, `type`, `groups_id` FROM `glpi_groups_tickets` GROUP BY `tickets_id`, `type`, `groups_id` HAVING CPT > 1"; if ($result=$DB->query($query)) { if ($DB->numrows($result)>0) { while ($data=$DB->fetch_array($result)) { // Skip first $query = "SELECT `id` FROM `glpi_groups_tickets` WHERE `tickets_id` = '".$data['tickets_id']."' AND `type` = '".$data['type']."' AND `groups_id` = '".$data['groups_id']."' ORDER BY `id` DESC LIMIT 1,99999"; if ($result2=$DB->query($query)) { if ($DB->numrows($result2)) { while ($data2=$DB->fetch_array($result2)) { $query = "DELETE FROM `glpi_groups_tickets` WHERE `id` ='".$data2['id']."'"; $DB->queryOrDie($query, "0.80.1 clean to update glpi_groups_tickets"); } } } } } } $migration->dropKey('glpi_groups_tickets', 'unicity'); $migration->migrationOneTable('glpi_groups_tickets'); $migration->addKey("glpi_groups_tickets", array('tickets_id', 'type','groups_id'), "unicity", "UNIQUE"); // Clean duplicates $query = "SELECT COUNT(*) AS CPT, `tickets_id`, `type`, `users_id`, `alternative_email` FROM `glpi_tickets_users` GROUP BY `tickets_id`, `type`, `users_id`, `alternative_email` HAVING CPT > 1"; if ($result=$DB->query($query)) { if ($DB->numrows($result)>0) { while ($data=$DB->fetch_array($result)) { // Skip first $query = "SELECT `id` FROM `glpi_tickets_users` WHERE `tickets_id` = '".$data['tickets_id']."' AND `type` = '".$data['type']."' AND `users_id` = '".$data['users_id']."' AND `alternative_email` = '".$data['alternative_email']."' ORDER BY `id` DESC LIMIT 1,99999"; if ($result2=$DB->query($query)) { if ($DB->numrows($result2)) { while ($data2=$DB->fetch_array($result2)) { $query = "DELETE FROM `glpi_tickets_users` WHERE `id` ='".$data2['id']."'"; $DB->queryOrDie($query, "0.80.1 clean to update glpi_tickets_users"); } } } } } } $migration->dropKey('glpi_tickets_users', 'tickets_id'); $migration->migrationOneTable('glpi_tickets_users'); $migration->addKey("glpi_tickets_users", array('tickets_id', 'type','users_id','alternative_email'), "unicity", "UNIQUE"); $migration->addField("glpi_ocsservers", "ocs_version", "VARCHAR( 255 ) NULL"); if ($migration->addField("glpi_slalevels", "entities_id", "INT( 11 ) NOT NULL DEFAULT 0")) { $migration->addField("glpi_slalevels", "is_recursive", "TINYINT( 1 ) NOT NULL DEFAULT 0"); $migration->migrationOneTable('glpi_slalevels'); $entities = getAllDatasFromTable('glpi_entities'); $entities[0] = "Root"; foreach ($entities as $entID => $val) { // Non recursive ones $query3 = "UPDATE `glpi_slalevels` SET `entities_id` = $entID, `is_recursive` = 0 WHERE `slas_id` IN (SELECT `id` FROM `glpi_slas` WHERE `entities_id` = $entID AND `is_recursive` = 0)"; $DB->queryOrDie($query3, "0.80.1 update entities_id and is_recursive=0 in glpi_slalevels"); // Recursive ones $query3 = "UPDATE `glpi_slalevels` SET `entities_id` = $entID, `is_recursive` = 1 WHERE `slas_id` IN (SELECT `id` FROM `glpi_slas` WHERE `entities_id` = $entID AND `is_recursive` = 1)"; $DB->queryOrDie($query3, "0.80.1 update entities_id and is_recursive=1 in glpi_slalevels"); } } // must always be at the end $migration->executeMigration(); return $updateresult; } ?> glpi-0.84.3+dfsg.1/install/update_0831_0833.php000066400000000000000000000113541226600447100204160ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /** * Update from 0.83.1 to 0.83.3 * * @return bool for success (will die for most error) **/ function update0831to0833() { global $DB, $migration; $updateresult = true; $ADDTODISPLAYPREF = array(); $migration->displayTitle(sprintf(__('Update to %s'), '0.83.3')); $migration->setVersion('0.83.3'); $backup_tables = false; $newtables = array(); foreach ($newtables as $new_table) { // rename new tables if exists ? if (TableExists($new_table)) { $migration->dropTable("backup_$new_table"); $migration->displayWarning("$new_table table already exists. ". "A backup have been done to backup_$new_table."); $backup_tables = true; $query = $migration->renameTable("$new_table", "backup_$new_table"); } } if ($backup_tables) { $migration->displayWarning("You can delete backup tables if you have no need of them.", true); } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'Compute entities information on document links')); // Updating schema $query_doc_i = "UPDATE `glpi_documents_items` as `doc_i` INNER JOIN `glpi_documents` as `doc` ON `doc`.`id` = `doc_i`.`documents_id` SET `doc_i`.`entities_id` = `doc`.`entities_id`, `doc_i`.`is_recursive` = `doc`.`is_recursive`"; $DB->queryOrDie($query_doc_i, "0.83 update entities_id and is_recursive in glpi_documents_items"); // ************ Keep it at the end ************** $migration->displayMessage('Migration of glpi_displaypreferences'); foreach ($ADDTODISPLAYPREF as $type => $tab) { $query = "SELECT DISTINCT `users_id` FROM `glpi_displaypreferences` WHERE `itemtype` = '$type'"; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { while ($data = $DB->fetch_assoc($result)) { $query = "SELECT MAX(`rank`) FROM `glpi_displaypreferences` WHERE `users_id` = '".$data['users_id']."' AND `itemtype` = '$type'"; $result = $DB->query($query); $rank = $DB->result($result,0,0); $rank++; foreach ($tab as $newval) { $query = "SELECT * FROM `glpi_displaypreferences` WHERE `users_id` = '".$data['users_id']."' AND `num` = '$newval' AND `itemtype` = '$type'"; if ($result2=$DB->query($query)) { if ($DB->numrows($result2)==0) { $query = "INSERT INTO `glpi_displaypreferences` (`itemtype` ,`num` ,`rank` ,`users_id`) VALUES ('$type', '$newval', '".$rank++."', '".$data['users_id']."')"; $DB->query($query); } } } } } else { // Add for default user $rank = 1; foreach ($tab as $newval) { $query = "INSERT INTO `glpi_displaypreferences` (`itemtype` ,`num` ,`rank` ,`users_id`) VALUES ('$type', '$newval', '".$rank++."', '0')"; $DB->query($query); } } } } // must always be at the end $migration->executeMigration(); return $updateresult; } ?> glpi-0.84.3+dfsg.1/install/update_0831_084.php000066400000000000000000003445431226600447100203450ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /** * Update from 0.83.1 to 0.84 * * @return bool for success (will die for most error) **/ function update0831to084() { global $DB, $migration; $updateresult = true; $ADDTODISPLAYPREF = array(); //TRANS: %s is the number of new version $migration->displayTitle(sprintf(__('Update to %s'), '0.84')); $migration->setVersion('0.84'); // Add the internet field and copy rights from networking $migration->addField('glpi_profiles', 'internet', 'char', array('after' => 'networking', 'update' => '`networking`')); $backup_tables = false; $newtables = array(/*'glpi_changes', 'glpi_changes_groups', 'glpi_changes_items', 'glpi_changes_problems', 'glpi_changes_suppliers', 'glpi_changes_tickets', 'glpi_changes_users', 'glpi_changetasks',*/ 'glpi_contractcosts', 'glpi_entities_rssfeeds', 'glpi_groups_rssfeeds', 'glpi_problems_suppliers', 'glpi_profiles_rssfeeds', 'glpi_rssfeeds_users', 'glpi_rssfeeds', 'glpi_suppliers_tickets', 'glpi_ticketcosts'); foreach ($newtables as $new_table) { // rename new tables if exists ? if (TableExists($new_table)) { $migration->dropTable("backup_$new_table"); $migration->displayWarning("$new_table table already exists. ". "A backup have been done to backup_$new_table."); $backup_tables = true; $query = $migration->renameTable("$new_table", "backup_$new_table"); } } if ($backup_tables) { $migration->displayWarning("You can delete backup tables if you have no need of them.", true); } updateNetworkFramework($ADDTODISPLAYPREF); $migration->addField('glpi_mailcollectors', 'accepted', 'string'); $migration->addField('glpi_mailcollectors', 'refused', 'string'); $migration->addField('glpi_mailcollectors', 'use_kerberos', 'bool', array('value' => 0)); $migration->addField("glpi_mailcollectors", 'errors', "integer"); $migration->addField("glpi_mailcollectors", 'use_mail_date', "bool", array('value' => 0)); // Password security $migration->addField('glpi_configs', 'use_password_security', 'bool'); $migration->addField('glpi_configs', 'password_min_length', 'integer', array('value' => 8)); $migration->addField('glpi_configs', 'password_need_number', 'bool', array('value' => 1)); $migration->addField('glpi_configs', 'password_need_letter', 'bool', array('value' => 1)); $migration->addField('glpi_configs', 'password_need_caps', 'bool', array('value' => 1)); $migration->addField('glpi_configs', 'password_need_symbol', 'bool', array('value' => 1)); $migration->addField('glpi_configs', 'use_check_pref', 'bool'); // Ajax buffer time $migration->addField('glpi_configs', 'ajax_buffertime_load', 'integer', array('value' => 0, 'after' => 'ajax_min_textsearch_load')); // Clean display prefs $query = "UPDATE `glpi_displaypreferences` SET `num` = 160 WHERE `itemtype` = 'Software' AND `num` = 7"; $DB->query($query); // Update bookmarks from States to AllAssets foreach ($DB->request("glpi_bookmarks", "`itemtype` = 'States'") as $data) { $query = str_replace('itemtype=States','itemtype=AllAssets',$data['query']); $query = "UPDATE `glpi_bookmarks` SET query = '".addslashes($query)."' WHERE `id` = '".$data['id']."'"; $DB->query($query); } $query = "UPDATE `glpi_bookmarks` SET `itemtype` = 'AllAssets', `path` = 'front/allassets.php' WHERE `itemtype` = 'States'"; $DB->query($query); $query = "UPDATE `glpi_displaypreferences` SET `itemtype` = 'AllAssets' WHERE `itemtype` = 'States'"; $DB->query($query); if (TableExists('glpi_networkportmigrations')) { $migration->displayWarning("You should have a look at the \"migration cleaner\" tool !", true); $migration->displayWarning("With it, you should re-create the networks topologies and the links between the networks and the addresses", true); } $lang_to_update = array('ca_CA' => 'ca_ES', 'dk_DK' => 'da_DK', 'ee_ET' => 'et_EE', 'el_EL' => 'el_GR', 'he_HE' => 'he_IL', 'no_NB' => 'nb_NO', 'no_NN' => 'nn_NO', 'ua_UA' => 'uk_UA',); foreach ($lang_to_update as $old => $new) { $query = "UPDATE `glpi_configs` SET `language` = '$new' WHERE `language` = '$old';"; $DB->queryOrDie($query, "0.84 language in config $old to $new"); $query = "UPDATE `glpi_users` SET `language` = '$new' WHERE `language` = '$old';"; $DB->queryOrDie($query, "0.84 language in users $old to $new"); } $migration->displayMessage(sprintf(__('Data migration - %s'), 'tickets and problems status')); $status = array ('new' => CommonITILObject::INCOMING, 'assign' => CommonITILObject::ASSIGNED, 'plan' => CommonITILObject::PLANNED, 'waiting' => CommonITILObject::WAITING, 'solved' => CommonITILObject::SOLVED, 'closed' => CommonITILObject::CLOSED, 'accepted' => CommonITILObject::ACCEPTED, 'observe' => CommonITILObject::OBSERVED, 'evaluation' => CommonITILObject::EVALUATION, 'approbation' => CommonITILObject::APPROVAL, 'test' => CommonITILObject::TEST, 'qualification' => CommonITILObject::QUALIFICATION); // Update field in tables foreach (array('glpi_tickets', 'glpi_problems') as $table) { // Migrate datas foreach ($status as $old => $new) { $query = "UPDATE `$table` SET `status` = '$new' WHERE `status` = '$old'"; $DB->queryOrDie($query, "0.84 status in $table $old to $new"); } $migration->changeField($table, 'status', 'status', 'integer', array('value' => CommonITILObject::INCOMING)); } // Migrate templates $query = "SELECT `glpi_notificationtemplatetranslations`.* FROM `glpi_notificationtemplatetranslations` INNER JOIN `glpi_notificationtemplates` ON (`glpi_notificationtemplates`.`id` = `glpi_notificationtemplatetranslations`.`notificationtemplates_id`) WHERE `glpi_notificationtemplatetranslations`.`content_text` LIKE '%storestatus=%' OR `glpi_notificationtemplatetranslations`.`content_html` LIKE '%storestatus=%' OR `glpi_notificationtemplatetranslations`.`subject` LIKE '%storestatus=%'"; if ($result=$DB->query($query)) { if ($DB->numrows($result)) { while ($data = $DB->fetch_assoc($result)) { $subject = $data['subject']; $text = $data['content_text']; $html = $data['content_html']; foreach ($status as $old => $new) { $subject = str_replace("storestatus=$old","storestatus=$new",$subject); $text = str_replace("storestatus=$old","storestatus=$new",$text); $html = str_replace("storestatus=$old","storestatus=$new",$html); } $query = "UPDATE `glpi_notificationtemplatetranslations` SET `subject` = '".addslashes($subject)."', `content_text` = '".addslashes($text)."', `content_html` = '".addslashes($html)."' WHERE `id` = ".$data['id'].""; $DB->queryOrDie($query, "0.84 fix tags usage for storestatus"); } } } // Update Rules $changes = array(); $changes['RuleTicket'] = 'status'; $DB->query("SET SESSION group_concat_max_len = 4194304;"); foreach ($changes as $ruletype => $field) { // Get rules $query = "SELECT GROUP_CONCAT(`id`) FROM `glpi_rules` WHERE `sub_type` = '".$ruletype."' GROUP BY `sub_type`"; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { // Get rule string $rules = $DB->result($result,0,0); // Update actions foreach ($status as $old => $new) { $query = "UPDATE `glpi_ruleactions` SET `value` = '$new' WHERE `field` = '$field' AND `value` = '$old' AND `rules_id` IN ($rules)"; $DB->queryOrDie($query, "0.84 update datas for rules actions"); } } } } // Update glpi_profiles : ticket_status foreach ($DB->request('glpi_profiles') as $data) { $fields_to_decode = array('ticket_status','problem_status'); foreach ($fields_to_decode as $field) { $tab = importArrayFromDB($data[$field]); if (is_array($tab)) { $newtab = array(); foreach ($tab as $key => $values) { foreach ($values as $key2 => $val2) { $newtab[$status[$key]][$status[$key2]] = $val2; } } $query = "UPDATE `glpi_profiles` SET `$field` = '".addslashes(exportArrayToDB($newtab))."' WHERE `id` = '".$data['id']."'"; $DB->queryOrDie($query, "0.84 migrate $field of glpi_profiles"); } } } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'Merge entity and entitydatas')); if (TableExists('glpi_entitydatas')) { $migration->changeField('glpi_entities', 'id', 'id', 'integer'); $migration->migrationOneTable('glpi_entities'); // pour que la procedure soit re-entrante if (countElementsInTable("glpi_entities", "id=0") < 1) { // Create root entity $query = "INSERT INTO `glpi_entities` (`id`, `name`, `completename`, `entities_id`, `level`) VALUES (0,'".addslashes(__('Root entity'))."', '".addslashes(__('Root entity'))."', '-1', '1');"; $DB->queryOrDie($query, '0.84 insert root entity into glpi_entities'); } // $newID = $DB->insert_id(); // $query = "UPDATE `glpi_entities` // SET `id` = '0' // WHERE `id` = '$newID'"; // $DB->queryOrDie($query, '0.84 be sure that id of the root entity if 0 in glpi_entities'); $migration->addField("glpi_entities", 'address', "text"); $migration->addField("glpi_entities", 'postcode', "string"); $migration->addField("glpi_entities", 'town', "string"); $migration->addField("glpi_entities", 'state', "string"); $migration->addField("glpi_entities", 'country', "string"); $migration->addField("glpi_entities", 'website', "string"); $migration->addField("glpi_entities", 'phonenumber', "string"); $migration->addField("glpi_entities", 'fax', "string"); $migration->addField("glpi_entities", 'email', "string"); $migration->addField("glpi_entities", 'admin_email', "string"); $migration->addField("glpi_entities", 'admin_email_name', "string"); $migration->addField("glpi_entities", 'admin_reply', "string"); $migration->addField("glpi_entities", 'admin_reply_name', "string"); $migration->addField("glpi_entities", 'notification_subject_tag', "string"); $migration->addField("glpi_entities", 'notepad', "longtext"); $migration->addField("glpi_entities", 'ldap_dn', "string"); $migration->addField("glpi_entities", 'tag', "string"); $migration->addField("glpi_entities", 'authldaps_id', "integer"); $migration->addField("glpi_entities", 'mail_domain', "string"); $migration->addField("glpi_entities", 'entity_ldapfilter', "text"); $migration->addField("glpi_entities", 'mailing_signature', "text"); $migration->addField("glpi_entities", 'cartridges_alert_repeat', "integer", array('value' => -2)); $migration->addField("glpi_entities", 'consumables_alert_repeat', "integer", array('value' => -2)); $migration->addField("glpi_entities", 'use_licenses_alert', "integer", array('value' => -2)); $migration->addField("glpi_entities", 'use_contracts_alert', "integer", array('value' => -2)); $migration->addField("glpi_entities", 'use_infocoms_alert', "integer", array('value' => -2)); $migration->addField("glpi_entities", 'use_reservations_alert', "integer", array('value' => -2)); $migration->addField("glpi_entities", 'autoclose_delay', "integer", array('value' => -2)); $migration->addField("glpi_entities", 'notclosed_delay', "integer", array('value' => -2)); $migration->addField("glpi_entities", 'calendars_id', "integer", array('value' => -2)); $migration->addField("glpi_entities", 'auto_assign_mode', "integer", array('value' => -2)); $migration->addField("glpi_entities", 'tickettype', "integer", array('value' => -2)); $migration->addField("glpi_entities", 'max_closedate', "datetime"); $migration->addField("glpi_entities", 'inquest_config', "integer", array('value' => -2)); $migration->addField("glpi_entities", 'inquest_rate', "integer"); $migration->addField("glpi_entities", 'inquest_delay', "integer", array('value' => -10)); $migration->addField("glpi_entities", 'inquest_URL', "string"); $migration->addField("glpi_entities", 'autofill_warranty_date', "string", array('value' => -2)); $migration->addField("glpi_entities", 'autofill_use_date', "string", array('value' => -2)); $migration->addField("glpi_entities", 'autofill_buy_date', "string", array('value' => -2)); $migration->addField("glpi_entities", 'autofill_delivery_date', "string", array('value' => -2)); $migration->addField("glpi_entities", 'autofill_order_date', "string", array('value' => -2)); $migration->addField("glpi_entities", 'tickettemplates_id', "integer", array('value' => -2)); $migration->addField("glpi_entities", 'entities_id_software', "integer", array('value' => -2)); $migration->addField("glpi_entities", 'default_contract_alert', "integer", array('value' => -2)); $migration->addField("glpi_entities", 'default_infocom_alert', "integer", array('value' => -2)); $migration->addField("glpi_entities", 'default_alarm_threshold', "integer", array('value' => -2)); $migration->migrationOneTable('glpi_entities'); $fields = array('address', 'postcode', 'town', 'state', 'country', 'website', 'phonenumber', 'fax', 'email', 'admin_email', 'admin_email_name', 'admin_reply', 'admin_reply_name', 'notification_subject_tag', 'notepad', 'ldap_dn', 'tag', 'authldaps_id', 'mail_domain', 'entity_ldapfilter', 'mailing_signature', 'cartridges_alert_repeat', 'consumables_alert_repeat', 'use_licenses_alert', 'use_contracts_alert', 'use_infocoms_alert', 'use_reservations_alert', 'autoclose_delay', 'notclosed_delay', 'calendars_id', 'auto_assign_mode', 'tickettype', 'max_closedate', 'inquest_config', 'inquest_rate', 'inquest_delay', 'inquest_URL', 'autofill_warranty_date', 'autofill_use_date', 'autofill_buy_date', 'autofill_delivery_date', 'autofill_order_date', 'tickettemplates_id', 'entities_id_software', 'default_contract_alert', 'default_infocom_alert', 'default_alarm_threshold'); $entity = new Entity(); foreach ($DB->request('glpi_entitydatas') as $data) { if ($entity->getFromDB($data['entities_id'])) { $update_fields = array(); foreach ($fields as $field) { if (is_null($data[$field])) { $update_fields[] = "`$field` = NULL"; } else { $update_fields[] = "`$field` = '".addslashes($data[$field])."'"; } } $query = "UPDATE `glpi_entities` SET ".implode(',',$update_fields)." WHERE `id` = '".$data['entities_id']."'"; $DB->queryOrDie($query, "0.84 transfer datas from glpi_entitydatas to glpi_entities"); } else { $migration->displayMessage('Entity ID '.$data['entities_id'].' does not exist'); } } $migration->dropTable('glpi_entitydatas'); } regenerateTreeCompleteName("glpi_entities"); $migration->displayMessage(sprintf(__('Data migration - %s'), 'copy entity information to computers_softwareversions')); if ($migration->addField("glpi_computers_softwareversions", "entities_id", "integer")) { $migration->migrationOneTable('glpi_computers_softwareversions'); $query3 = "UPDATE `glpi_computers_softwareversions` LEFT JOIN `glpi_computers` ON `computers_id`=`glpi_computers`.`id` SET `glpi_computers_softwareversions`.`entities_id` = `glpi_computers`.`entities_id`"; $DB->queryOrDie($query3, "0.84 update entities_id in glpi_computers_softwareversions"); /// create index for search count on tab $migration->addKey("glpi_computers_softwareversions", array('entities_id', 'is_template', 'is_deleted'), 'computers_info'); $migration->addKey("glpi_computers_softwareversions", 'is_template'); $migration->addKey("glpi_computers_softwareversions", 'is_deleted'); } /// create new index for search $migration->addKey("glpi_softwarelicenses", array('softwares_id', 'expire'), 'softwares_id_expire'); $migration->dropKey("glpi_softwarelicenses", 'softwares_id'); $migration->displayMessage(sprintf(__('Data migration - %s'), 'create validation_answer notification')); // Check if notifications already exists if (countElementsInTable('glpi_notifications', "`itemtype` = 'Ticket' AND `event` = 'validation_answer'")==0) { // No notifications duplicate all $query = "SELECT * FROM `glpi_notifications` WHERE `itemtype` = 'Ticket' AND `event` = 'validation'"; foreach ($DB->request($query) as $notif) { $query = "INSERT INTO `glpi_notifications` (`name`, `entities_id`, `itemtype`, `event`, `mode`, `notificationtemplates_id`, `comment`, `is_recursive`, `is_active`, `date_mod`) VALUES ('".addslashes($notif['name'])." Answer', '".$notif['entities_id']."', 'Ticket', 'validation_answer', '".$notif['mode']."', '".$notif['notificationtemplates_id']."', '".addslashes($notif['comment'])."', '".$notif['is_recursive']."', '".$notif['is_active']."', NOW());"; $DB->queryOrDie($query, "0.84 insert validation_answer notification"); $newID = $DB->insert_id(); $query2 = "SELECT * FROM `glpi_notificationtargets` WHERE `notifications_id` = '".$notif['id']."'"; foreach ($DB->request($query2) as $target) { $query = "INSERT INTO `glpi_notificationtargets` (`notifications_id`, `type`, `items_id`) VALUES ($newID, '".$target['type']."', '".$target['items_id']."')"; $DB->queryOrDie($query, "0.84 insert targets for validation_answer notification"); } } } $migration->displayMessage(sprintf(__('Data migration - %s'), 'create contracts notification')); $from_to = array('end' => 'periodicity', 'notice' => 'periodicitynotice'); foreach ($from_to as $from => $to) { // Check if notifications already exists if (countElementsInTable('glpi_notifications', "`itemtype` = 'Contract' AND `event` = '$to'")==0) { // No notifications duplicate all $query = "SELECT * FROM `glpi_notifications` WHERE `itemtype` = 'Contract' AND `event` = '$from'"; foreach ($DB->request($query) as $notif) { $query = "INSERT INTO `glpi_notifications` (`name`, `entities_id`, `itemtype`, `event`, `mode`, `notificationtemplates_id`, `comment`, `is_recursive`, `is_active`, `date_mod`) VALUES ('".addslashes($notif['name'])." Periodicity', '".$notif['entities_id']."', 'Contract', '$to', '".$notif['mode']."', '".$notif['notificationtemplates_id']."', '".addslashes($notif['comment'])."', '".$notif['is_recursive']."', '".$notif['is_active']."', NOW());"; $DB->queryOrDie($query, "0.84 insert contract ".$to." notification"); $newID = $DB->insert_id(); $query2 = "SELECT * FROM `glpi_notificationtargets` WHERE `notifications_id` = '".$notif['id']."'"; foreach ($DB->request($query2) as $target) { $query = "INSERT INTO `glpi_notificationtargets` (`notifications_id`, `type`, `items_id`) VALUES ('".$newID."', '".$target['type']."', '".$target['items_id']."')"; $DB->queryOrDie($query, "0.84 insert targets for ĉontract ".$to." notification"); } } } } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'contract and ticket costs')); if (!TableExists('glpi_contractcosts')) { $query = "CREATE TABLE `glpi_contractcosts` ( `id` int(11) NOT NULL AUTO_INCREMENT, `contracts_id` int(11) NOT NULL DEFAULT '0', `name` varchar(255) DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `begin_date` date DEFAULT NULL, `end_date` date DEFAULT NULL, `cost` decimal(20,4) NOT NULL DEFAULT '0.0000', `budgets_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `name` (`name`), KEY `contracts_id` (`contracts_id`), KEY `begin_date` (`begin_date`), KEY `end_date` (`end_date`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`), KEY `budgets_id` (`budgets_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.84 add table glpi_contractcosts"); $migration->migrationOneTable('glpi_contractcosts'); foreach ($DB->request('glpi_contracts',"`cost` > 0") as $data) { $begin_to_add = "NULL"; $end_to_add = "NULL"; if (!is_null($data['begin_date'])) { $begin_to_add = "'".$data['begin_date']."'"; if ($data['duration']) { $end_to_add = "'".date("Y-m-d",strtotime($data['begin_date']. "+".$data['duration']." month"))."'"; } else { $end_to_add = "'".$data['begin_date']."'"; } } $query = "INSERT INTO `glpi_contractcosts` (`contracts_id`, `name`, `begin_date`, `end_date`, `cost`, `entities_id`, `is_recursive`) VALUES ('".$data['id']."', 'Cost', $begin_to_add, $end_to_add, '".$data['cost']."', '".$data['entities_id']."', '".$data['is_recursive']."')"; $DB->queryOrDie($query, '0.84 move contracts costs'); } $migration->dropField('glpi_contracts', 'cost'); } if (!TableExists('glpi_ticketcosts')) { $query = "CREATE TABLE `glpi_ticketcosts` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tickets_id` int(11) NOT NULL DEFAULT '0', `name` varchar(255) DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `begin_date` date DEFAULT NULL, `end_date` date DEFAULT NULL, `actiontime` int(11) NOT NULL DEFAULT '0', `cost_time` decimal(20,4) NOT NULL DEFAULT '0.0000', `cost_fixed` decimal(20,4) NOT NULL DEFAULT '0.0000', `cost_material` decimal(20,4) NOT NULL DEFAULT '0.0000', `budgets_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `name` (`name`), KEY `tickets_id` (`tickets_id`), KEY `begin_date` (`begin_date`), KEY `end_date` (`end_date`), KEY `entities_id` (`entities_id`), KEY `budgets_id` (`budgets_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.84 add table glpi_ticketcosts"); $migration->migrationOneTable('glpi_ticketcosts'); foreach ($DB->request('glpi_tickets',"`cost_time` > 0 OR `cost_fixed` > 0 OR `cost_material` > 0") as $data) { $begin_to_add = "NULL"; $end_to_add = "NULL"; if (!is_null($data['date'])) { $begin_to_add = "'".$data['date']."'"; if (!is_null($data['solvedate'])) { $end_to_add = "'".$data['solvedate']."'"; } else { $end_to_add = "'".$data['date']."'"; } } $query = "INSERT INTO `glpi_ticketcosts` (`tickets_id`, `name`, `begin_date`, `end_date`, `cost_time`,`cost_fixed`, `cost_material`, `entities_id`, `actiontime`) VALUES ('".$data['id']."', 'Cost', $begin_to_add, $end_to_add, '".$data['cost_time']."','".$data['cost_fixed']."', '".$data['cost_material']."', '".$data['entities_id']."', '".$data['actiontime']."')"; $DB->queryOrDie($query, '0.84 move tickets costs'); } $migration->dropField('glpi_tickets', 'cost_time'); $migration->dropField('glpi_tickets', 'cost_fixed'); $migration->dropField('glpi_tickets', 'cost_material'); } $migration->addField("glpi_profiles", "ticketcost", "char", array('update' => "'w'", 'condition' => " WHERE `update_ticket` = 1")); // Set default to r as before $query = "UPDATE `glpi_profiles` SET `ticketcost` = 'r' WHERE `ticketcost` IS NULL"; $DB->queryOrDie($query, "0.84 set ticketcost in glpi_profiles"); $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'rss flows')); if (!TableExists('glpi_rssfeeds')) { $query = "CREATE TABLE `glpi_rssfeeds` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `users_id` int(11) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, `url` text COLLATE utf8_unicode_ci, `refresh_rate` int(11) NOT NULL DEFAULT '86400', `max_items` int(11) NOT NULL DEFAULT '20', `have_error` TINYINT( 1 ) NOT NULL DEFAULT 0, `is_active` TINYINT( 1 ) NOT NULL DEFAULT 0, `date_mod` DATETIME DEFAULT NULL, PRIMARY KEY (`id`), KEY `name` (`name`), KEY `users_id` (`users_id`), KEY `date_mod` (`date_mod`), KEY `have_error` (`have_error`), KEY `is_active` (`is_active`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.84 add table glpi_rssfeeds"); $ADDTODISPLAYPREF['RSSFeed'] = array(2,4,5,19,6,7); } if (!TableExists('glpi_rssfeeds_users')) { $query = "CREATE TABLE `glpi_rssfeeds_users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `rssfeeds_id` int(11) NOT NULL DEFAULT '0', `users_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `rssfeeds_id` (`rssfeeds_id`), KEY `users_id` (`users_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.84 add table glpi_rssfeeds_users"); } if (!TableExists('glpi_groups_rssfeeds')) { $query = "CREATE TABLE `glpi_groups_rssfeeds` ( `id` int(11) NOT NULL AUTO_INCREMENT, `rssfeeds_id` int(11) NOT NULL DEFAULT '0', `groups_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '-1', `is_recursive` TINYINT( 1 ) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `rssfeeds_id` (`rssfeeds_id`), KEY `groups_id` (`groups_id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.84 add table glpi_groups_rssfeeds"); } if (!TableExists('glpi_profiles_rssfeeds')) { $query = "CREATE TABLE `glpi_profiles_rssfeeds` ( `id` int(11) NOT NULL AUTO_INCREMENT, `rssfeeds_id` int(11) NOT NULL DEFAULT '0', `profiles_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '-1', `is_recursive` TINYINT( 1 ) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `rssfeeds_id` (`rssfeeds_id`), KEY `profiles_id` (`profiles_id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.84 add table glpi_profiles_rssfeeds"); } if (!TableExists('glpi_entities_rssfeeds')) { $query = "CREATE TABLE `glpi_entities_rssfeeds` ( `id` int(11) NOT NULL AUTO_INCREMENT, `rssfeeds_id` int(11) NOT NULL DEFAULT '0', `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` TINYINT( 1 ) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `rssfeeds_id` (`rssfeeds_id`), KEY `entities_id` (`entities_id`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.84 add table glpi_entities_rssfeeds"); } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'planning recalls')); if (!TableExists('glpi_planningrecalls')) { $query = "CREATE TABLE `glpi_planningrecalls` ( `id` int(11) NOT NULL AUTO_INCREMENT, `items_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `users_id` int(11) NOT NULL DEFAULT '0', `before_time` int(11) NOT NULL DEFAULT '-10', `when` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `users_id` (`users_id`), KEY `before_time` (`before_time`), KEY `when` (`when`), UNIQUE KEY `unicity` (`itemtype`,`items_id`, `users_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.84 add table glpi_planningrecalls"); } $query = "SELECT * FROM `glpi_notificationtemplates` WHERE `itemtype` = 'PlanningRecall'"; if ($result=$DB->query($query)) { if ($DB->numrows($result)==0) { $query = "INSERT INTO `glpi_notificationtemplates` (`name`, `itemtype`, `date_mod`) VALUES ('Planning recall', 'PlanningRecall', NOW())"; $DB->queryOrDie($query, "0.84 add planning recall notification"); $notid = $DB->insert_id(); $query = "INSERT INTO `glpi_notificationtemplatetranslations` (`notificationtemplates_id`, `language`, `subject`, `content_text`, `content_html`) VALUES ($notid, '', '##recall.action##: ##recall.item.name##', '##recall.action##: ##recall.item.name## ##recall.item.content## ##lang.recall.planning.begin##: ##recall.planning.begin## ##lang.recall.planning.end##: ##recall.planning.end## ##lang.recall.planning.state##: ##recall.planning.state## ##lang.recall.item.private##: ##recall.item.private##', '<p>##recall.action##: <a href=\"##recall.item.url##\">##recall.item.name##</a></p> <p>##recall.item.content##</p> <p>##lang.recall.planning.begin##: ##recall.planning.begin##<br />##lang.recall.planning.end##: ##recall.planning.end##<br />##lang.recall.planning.state##: ##recall.planning.state##<br />##lang.recall.item.private##: ##recall.item.private##<br /><br /></p> <p><br /><br /></p>')"; $DB->queryOrDie($query, "0.84 add planning recall notification translation"); $query = "INSERT INTO `glpi_notifications` (`name`, `entities_id`, `itemtype`, `event`, `mode`, `notificationtemplates_id`, `comment`, `is_recursive`, `is_active`, `date_mod`) VALUES ('Planning recall', 0, 'PlanningRecall', 'planningrecall', 'mail', $notid, '', 1, 1, NOW())"; $DB->queryOrDie($query, "0.84 add planning recall notification"); $notifid = $DB->insert_id(); $query = "INSERT INTO `glpi_notificationtargets` (`id`, `notifications_id`, `type`, `items_id`) VALUES (NULL, $notifid, ".Notification::USER_TYPE.", ".Notification::AUTHOR.");"; $DB->queryOrDie($query, "0.84 add planning recall notification target"); } } if (!countElementsInTable('glpi_crontasks', "`itemtype`='PlanningRecall' AND `name`='planningrecall'")) { $query = "INSERT INTO `glpi_crontasks` (`itemtype`, `name`, `frequency`, `param`, `state`, `mode`, `allowmode`, `hourmin`, `hourmax`, `logs_lifetime`, `lastrun`, `lastcode`, `comment`) VALUES ('PlanningRecall', 'planningrecall', 300, NULL, 1, 1, 3, 0, 24, 30, NULL, NULL, NULL)"; $DB->queryOrDie($query, "0.84 populate glpi_crontasks for planningrecall"); } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'various fields')); $migration->changeField('glpi_entities', 'default_alarm_threshold', 'default_cartridges_alarm_threshold', 'integer', array('value' => -2)); $migration->migrationOneTable('glpi_entities'); $migration->addField("glpi_entities", 'default_consumables_alarm_threshold', "integer", array('value' => -2, 'update' => 'default_cartridges_alarm_threshold')); $migration->migrationOneTable('glpi_entities'); // move -1 to Entity::CONFIG_NEVER $query = 'UPDATE `glpi_entities` SET `default_consumables_alarm_threshold` = -10 WHERE `default_consumables_alarm_threshold` = -1'; $DB->query($query); $query = 'UPDATE `glpi_entities` SET `default_cartridges_alarm_threshold` = -10 WHERE `default_cartridges_alarm_threshold` = -1'; $DB->query($query); $migration->addField("glpi_entities", 'send_contracts_alert_before_delay', "integer", array('value' => -2, 'after' => 'use_contracts_alert', 'update' => '0', // No delay for root entity 'condition' => 'WHERE `id`=0')); $migration->addField("glpi_entities", 'send_infocoms_alert_before_delay', "integer", array('value' => -2, 'after' => 'use_infocoms_alert', 'update' => '0', // No delay for root entity 'condition' => 'WHERE `id`=0')); $migration->addField("glpi_entities", 'send_licenses_alert_before_delay', "integer", array('value' => -2, 'after' => 'use_licenses_alert', 'update' => '0', // No delay for root entity 'condition' => 'WHERE `id`=0')); $migration->addField("glpi_configs", "notification_to_myself", "bool", array('value' => 1)); $migration->addField("glpi_configs", 'duedateok_color', "string", array('value' => '#06ff00')); $migration->addField("glpi_configs", 'duedatewarning_color', "string", array('value' => '#ffb800')); $migration->addField("glpi_configs", 'duedatecritical_color', "string", array('value' => '#ff0000')); $migration->addField("glpi_configs", 'duedatewarning_less', "integer", array('value' => 20)); $migration->addField("glpi_configs", 'duedatecritical_less',"integer", array('value' => 5)); $migration->addField("glpi_configs", 'duedatewarning_unit', "string", array('value' => '%')); $migration->addField("glpi_configs", 'duedatecritical_unit', "string", array('value' => '%')); $migration->addField("glpi_configs", "realname_ssofield", "string"); $migration->addField("glpi_configs", "firstname_ssofield", "string"); $migration->addField("glpi_configs", "email1_ssofield", "string"); $migration->addField("glpi_configs", "email2_ssofield", "string"); $migration->addField("glpi_configs", "email3_ssofield", "string"); $migration->addField("glpi_configs", "email4_ssofield", "string"); $migration->addField("glpi_configs", "phone_ssofield", "string"); $migration->addField("glpi_configs", "phone2_ssofield", "string"); $migration->addField("glpi_configs", "mobile_ssofield", "string"); $migration->addField("glpi_configs", "comment_ssofield", "string"); $migration->addField("glpi_configs", "title_ssofield", "string"); $migration->addField("glpi_configs", "category_ssofield", "string"); $migration->addField("glpi_configs", "language_ssofield", "string"); $migration->addField("glpi_configs", "entity_ssofield", "string"); $migration->addField("glpi_configs", "registration_number_ssofield", "string"); $migration->addField("glpi_users", "notification_to_myself", "tinyint(1) DEFAULT NULL"); $migration->addField("glpi_users", 'duedateok_color', "string"); $migration->addField("glpi_users", 'duedatewarning_color', "string"); $migration->addField("glpi_users", 'duedatecritical_color', "string"); $migration->addField("glpi_users", 'duedatewarning_less', "int(11) DEFAULT NULL"); $migration->addField("glpi_users", 'duedatecritical_less', "int(11) DEFAULT NULL"); $migration->addField("glpi_users", 'duedatewarning_unit', "string"); $migration->addField("glpi_users", 'duedatecritical_unit', "string"); $migration->addField("glpi_users", 'display_options', "text"); $migration->addField("glpi_reservationitems", "is_deleted", "bool"); $migration->addKey("glpi_reservationitems", "is_deleted"); $migration->addField("glpi_documentcategories", 'documentcategories_id', "integer"); $migration->addField("glpi_documentcategories", 'completename', "text"); $migration->addField("glpi_documentcategories", 'level', "integer"); $migration->addField("glpi_documentcategories", 'ancestors_cache', "longtext"); $migration->addField("glpi_documentcategories", 'sons_cache', "longtext"); $migration->migrationOneTable('glpi_documentcategories'); $migration->addKey("glpi_documentcategories", array('documentcategories_id','name'), 'unicity'); regenerateTreeCompleteName("glpi_documentcategories"); $migration->addField("glpi_contacts", 'usertitles_id', "integer"); $migration->addKey("glpi_contacts", 'usertitles_id'); $migration->addField("glpi_contacts", 'address', "text"); $migration->addField("glpi_contacts", 'postcode', "string"); $migration->addField("glpi_contacts", 'town', "string"); $migration->addField("glpi_contacts", 'state', "string"); $migration->addField("glpi_contacts", 'country', "string"); $migration->addField("glpi_configs", 'x509_ou_restrict', "string", array('after' => 'x509_email_field')); $migration->addField("glpi_configs", 'x509_o_restrict', "string", array('after' => 'x509_email_field')); $migration->addField("glpi_configs", 'x509_cn_restrict', "string", array('after' => 'x509_email_field')); if (!TableExists('glpi_slalevelcriterias')) { $query = "CREATE TABLE `glpi_slalevelcriterias` ( `id` int(11) NOT NULL AUTO_INCREMENT, `slalevels_id` int(11) NOT NULL DEFAULT '0', `criteria` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `condition` int(11) NOT NULL DEFAULT '0' COMMENT 'see define.php PATTERN_* and REGEX_* constant', `pattern` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `slalevels_id` (`slalevels_id`), KEY `condition` (`condition`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.84 create glpi_slalevelcriterias"); } $migration->addField("glpi_slalevels", 'match', "CHAR(10) DEFAULT NULL COMMENT 'see define.php *_MATCHING constant'"); $query = "UPDATE `glpi_slalevelactions` SET `action_type` = 'append' WHERE `action_type` = 'assign' AND `field` IN ('_users_id_requester', '_groups_id_requester', '_users_id_assign', '_groups_id_assign', '_suppliers_id_assign', '_users_id_observer', '_groups_id_observer');"; $DB->queryOrDie($query, "0.84 update data for SLA actors add"); // Clean observer as recipient of satisfaction survey $query = "DELETE FROM `glpi_notificationtargets` WHERE `glpi_notificationtargets`.`type` = '".Notification::USER_TYPE."' AND `glpi_notificationtargets`.`items_id` = '".Notification::OBSERVER."' AND `notifications_id` IN (SELECT `glpi_notifications`.`id` FROM `glpi_notifications` WHERE `glpi_notifications`.`itemtype` = 'Ticket' AND `glpi_notifications`.`event` = 'satisfaction')"; $DB->queryOrDie($query, "0.84 clean targets for satisfaction notification"); // Clean user as recipient of item not unique $query = "DELETE FROM `glpi_notificationtargets` WHERE `glpi_notificationtargets`.`type` = '".Notification::USER_TYPE."' AND `glpi_notificationtargets`.`items_id` = '".Notification::USER."' AND `notifications_id` IN (SELECT `glpi_notifications`.`id` FROM `glpi_notifications` WHERE `glpi_notifications`.`itemtype` = 'FieldUnicity' AND `glpi_notifications`.`event` = 'refuse')"; $DB->queryOrDie($query, "0.84 clean targets for fieldunicity notification"); if (!TableExists('glpi_blacklists')) { $query = "CREATE TABLE `glpi_blacklists` ( `id` int(11) NOT NULL AUTO_INCREMENT, `type` int(11) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `type` (`type`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.84 create glpi_blacklists"); $ADDTODISPLAYPREF['Blacklist'] = array(12,11); $toinsert = array(Blacklist::IP => array('empty IP' => '', 'localhost' => '127.0.0.1', 'zero IP' => '0.0.0.0'), Blacklist::MAC => array('empty MAC' => '')); foreach ($toinsert as $type => $datas) { if (count($datas)) { foreach ($datas as $name => $value) { $query = "INSERT INTO `glpi_blacklists` (`type`,`name`,`value`) VALUES ('$type','".addslashes($name)."','".addslashes($value)."')"; $DB->queryOrDie($query, "0.84 insert datas to glpi_blacklists"); } } } } $query = "SELECT `id` FROM `glpi_rulerightparameters` WHERE `name` = '(LDAP) MemberOf'"; $result = $DB->query($query); if (!$DB->numrows($result)) { $query = "INSERT INTO `glpi_rulerightparameters` VALUES (NULL, '(LDAP) MemberOf', 'memberof', '')"; $DB->queryOrDie($query, "0.84 insert (LDAP) MemberOf in glpi_rulerightparameters"); } if (!TableExists('glpi_ssovariables')) { $query = "CREATE TABLE `glpi_ssovariables` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.84 create glpi_ssovariables"); $query = "INSERT INTO `glpi_ssovariables` (`id`, `name`, `comment`) VALUES (1, 'HTTP_AUTH_USER', ''), (2, 'REMOTE_USER', ''), (3, 'PHP_AUTH_USER', ''), (4, 'USERNAME', ''), (5, 'REDIRECT_REMOTE_USER', ''), (6, 'HTTP_REMOTE_USER', '')"; $DB->queryOrDie($query, "0.84 add values from glpi_ssovariables"); } if ($migration->addField('glpi_configs', 'ssovariables_id', 'integer')) { $migration->migrationOneTable('glpi_configs'); //Get configuration $query = "SELECT `existing_auth_server_field` FROM `glpi_configs`"; $result = $DB->query($query); $existing_auth_server_field = $DB->result($result, 0, "existing_auth_server_field"); if ($existing_auth_server_field) { //Get dropdown value for existing_auth_server_field $query = "SELECT `id` FROM `glpi_ssovariables` WHERE `name` = '$existing_auth_server_field'"; $result = $DB->query($query); //Update config if ($DB->numrows($result) > 0) { $query = "UPDATE `glpi_configs` SET `ssovariables_id` = '".$DB->result($result, 0, "id")."'"; $DB->queryOrDie($query, "0.84 update glpi_configs"); } //Drop old field } } $migration->dropField('glpi_configs', 'existing_auth_server_field'); //Remove field to specify an ldap server for SSO users : don't need it anymore $migration->dropField('glpi_configs', 'authldaps_id_extra'); // Clean uneeded logs $cleancondition = array(); $cleancondition['reminder_kb'] = "`itemtype` IN ('Entity', 'User', 'Profile', 'Group') AND `itemtype_link` IN ('Reminder', 'Knowbase')"; foreach ($cleancondition as $name => $condition) { $query = "DELETE FROM `glpi_logs` WHERE $condition"; $DB->queryOrDie($query, "0.84 clean logs for $name"); } //Remove OCS tables from GLPI's core $migration->renameTable('glpi_ocsadmininfoslinks', 'ocs_glpi_ocsadmininfoslinks'); $migration->renameTable('glpi_ocslinks', 'ocs_glpi_ocslinks'); $migration->renameTable('glpi_ocsservers', 'ocs_glpi_ocsservers'); $migration->renameTable('glpi_registrykeys', 'ocs_glpi_registrykeys'); // Migrate RuleOcs to RuleImportEntity $query = "UPDATE `glpi_rules` SET `sub_type` = 'RuleImportEntity' WHERE `sub_type` = 'RuleOcs'"; $DB->queryOrDie($query, "0.84 update datas for old OCS rules"); $migration->copyTable('glpi_rules', 'ocs_glpi_rules'); $migration->copyTable('glpi_ruleactions', 'ocs_glpi_ruleactions'); $migration->copyTable('glpi_rulecriterias', 'ocs_glpi_rulecriterias'); // Delete OCS rules $DB->query("SET SESSION group_concat_max_len = 4194304;"); $query = "SELECT GROUP_CONCAT(`id`) FROM `glpi_rules` WHERE `sub_type` = 'RuleImportEntity' GROUP BY `sub_type`"; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { // Get rule string $rules = $DB->result($result,0,0); $query = "DELETE FROM `glpi_ruleactions` WHERE `rules_id` IN ($rules)"; $DB->queryOrDie($query, "0.84 clean RuleImportEntity datas"); $query = "DELETE FROM `glpi_rulecriterias` WHERE `rules_id` IN ($rules)"; $DB->queryOrDie($query, "0.84 clean RuleImportEntity datas"); $query = "DELETE FROM `glpi_rules` WHERE `id` IN ($rules)"; $DB->queryOrDie($query, "0.84 clean RuleImportEntity datas"); } } // copy table to keep value of fields deleted after $migration->copyTable('glpi_profiles', 'ocs_glpi_profiles'); $migration->dropField('glpi_profiles', 'ocsng'); $migration->dropField('glpi_profiles', 'sync_ocsng'); $migration->dropField('glpi_profiles', 'view_ocsng'); $migration->dropField('glpi_profiles', 'clean_ocsng'); $migration->changeField('glpi_profiles', 'rule_ocs', 'rule_import', 'char'); $migration->changeField('glpi_rulecacheprinters', 'ignore_ocs_import', 'ignore_import', 'char'); $migration->changeField('glpi_rulecachesoftwares', 'ignore_ocs_import', 'ignore_import', 'char'); $migration->dropField('glpi_configs', 'use_ocs_mode'); // clean crontask $migration->copyTable('glpi_crontasks', 'ocs_glpi_crontasks'); $query = "DELETE FROM `glpi_crontasks` WHERE `itemtype` = 'OcsServer'"; $DB->queryOrDie($query, "0.84 delete OcsServer in crontasks"); // clean displaypreferences $migration->copyTable('glpi_displaypreferences', 'ocs_glpi_displaypreferences'); $query = "DELETE FROM `glpi_displaypreferences` WHERE `itemtype` = 'OcsServer'"; $DB->queryOrDie($query, "0.84 delete OcsServer in displaypreferences"); // Give history entries to plugin $query = "UPDATE `glpi_logs` SET `linked_action` = `linked_action`+1000, `itemtype_link` = 'PluginOcsinventoryngOcslink' WHERE `linked_action` IN (8,9,10,11)"; $DB->queryOrDie($query, "0.84 update OCS links in history"); $migration->displayWarning("You can delete ocs_* tables if you use OCS mode ONLY AFTER ocsinventoryng plugin installation.", true); $migration->displayWarning("You can delete ocs_* tables if you do not use OCS synchronisation.", true); $migration->addField('glpi_authldaps', 'pagesize', 'integer'); $migration->addField('glpi_authldaps', 'ldap_maxlimit', 'integer'); $migration->addField('glpi_authldaps', 'can_support_pagesize', 'bool'); // Add delete ticket notification if (countElementsInTable("glpi_notifications", "`itemtype` = 'Ticket' AND `event` = 'delete'") == 0) { // Get first template for tickets : $notid = 0; $query = "SELECT MIN(id) AS id FROM `glpi_notificationtemplates` WHERE `itemtype` = 'Ticket'"; if ($result = $DB->query($query)) { if ($DB->numrows($result) == 1) { $notid = $DB->result($result,0,0); } } if ($notid > 0) { $notifications = array('delete' => array(Notification::GLOBAL_ADMINISTRATOR)); $notif_names = array('delete' => 'Delete Ticket'); foreach ($notifications as $type => $targets) { $query = "INSERT INTO `glpi_notifications` (`name`, `entities_id`, `itemtype`, `event`, `mode`, `notificationtemplates_id`, `comment`, `is_recursive`, `is_active`, `date_mod`) VALUES ('".$notif_names[$type]."', 0, 'Ticket', '$type', 'mail', $notid, '', 1, 1, NOW())"; $DB->queryOrDie($query, "0.83 add problem $type notification"); $notifid = $DB->insert_id(); foreach ($targets as $target) { $query = "INSERT INTO `glpi_notificationtargets` (`id`, `notifications_id`, `type`, `items_id`) VALUES (NULL, $notifid, ".Notification::USER_TYPE.", $target);"; $DB->queryOrDie($query, "0.83 add problem $type notification target"); } } } } // Add multiple suppliers for itil objects if (!TableExists('glpi_problems_suppliers')) { $query = "CREATE TABLE `glpi_problems_suppliers` ( `id` int(11) NOT NULL AUTO_INCREMENT, `problems_id` int(11) NOT NULL DEFAULT '0', `suppliers_id` int(11) NOT NULL DEFAULT '0', `type` int(11) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`problems_id`,`type`,`suppliers_id`), KEY `group` (`suppliers_id`,`type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.84 add table glpi_problems_suppliers"); $migration->migrationOneTable('glpi_problems_suppliers'); foreach ($DB->request('glpi_problems',"`suppliers_id_assign` > 0") as $data) { $query = "INSERT INTO `glpi_problems_suppliers` (`suppliers_id`, `type`, `problems_id`) VALUES ('".$data['suppliers_id_assign']."', '".CommonITILActor::ASSIGN."', '".$data['id']."')"; $DB->query($query); } $migration->dropField('glpi_problems', 'suppliers_id_assign'); } if (!TableExists('glpi_suppliers_tickets')) { $query = "CREATE TABLE `glpi_suppliers_tickets` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tickets_id` int(11) NOT NULL DEFAULT '0', `suppliers_id` int(11) NOT NULL DEFAULT '0', `type` int(11) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`tickets_id`,`type`,`suppliers_id`), KEY `group` (`suppliers_id`,`type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.84 add table glpi_suppliers_tickets"); $migration->migrationOneTable('glpi_suppliers_tickets'); foreach ($DB->request('glpi_tickets',"`suppliers_id_assign` > 0") as $data) { $query = "INSERT INTO `glpi_suppliers_tickets` (`suppliers_id`, `type`, `tickets_id`) VALUES ('".$data['suppliers_id_assign']."', '".CommonITILActor::ASSIGN."', '".$data['id']."')"; $DB->query($query); } $migration->dropField('glpi_tickets', 'suppliers_id_assign'); } $migration->addField('glpi_tickets', 'locations_id', 'integer'); $migration->addKey('glpi_tickets', 'locations_id'); $migration->displayMessage(sprintf(__('Data migration - %s'), 'RuleTicket')); $changes = array(); $changes['RuleTicket'] = array('suppliers_id_assign' => '_suppliers_id_assign'); $changes['RuleDictionnarySoftware'] = array('_ignore_ocs_import' => '_ignore_import'); $changes['RuleImportEntity'] = array('_ignore_ocs_import' => '_ignore_import'); $changes['RuleDictionnaryPrinter'] = array('_ignore_ocs_import' => '_ignore_import'); $DB->query("SET SESSION group_concat_max_len = 4194304;"); foreach ($changes as $ruletype => $tab) { // Get rules $query = "SELECT GROUP_CONCAT(`id`) FROM `glpi_rules` WHERE `sub_type` = '".$ruletype."' GROUP BY `sub_type`"; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { // Get rule string $rules = $DB->result($result,0,0); // Update actions foreach ($tab as $old => $new) { $query = "UPDATE `glpi_ruleactions` SET `field` = '$new' WHERE `field` = '$old' AND `rules_id` IN ($rules)"; $DB->queryOrDie($query, "0.84 update datas for rules actions"); } // Update criterias foreach ($tab as $old => $new) { $query = "UPDATE `glpi_rulecriterias` SET `criteria` = '$new' WHERE `criteria` = '$old' AND `rules_id` IN ($rules)"; $DB->queryOrDie($query, "0.84 update datas for rules criterias"); } } } } // change ruleaction for manufacturer (id to name) $query = "SELECT `glpi_ruleactions` .`id` AS id, `sub_type`, `glpi_manufacturers`.`name` AS newvalue FROM `glpi_rules` INNER JOIN `glpi_ruleactions` ON (`glpi_rules`.`id` = `glpi_ruleactions`.`rules_id` AND `field` = 'Manufacturer') LEFT JOIN `glpi_manufacturers` ON `glpi_manufacturers`.`id` = `glpi_ruleactions`.`value` WHERE `sub_type` = 'RuleDictionnarySoftware'"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { // Update manufacturer $query = "UPDATE `glpi_ruleactions` SET `value` = '".$data['newvalue']."' WHERE `id` = ". $data['id']; $DB->queryOrDie($query, "0.84 update value of manufacturer for rules actions"); } } } // Move ticketrecurrent values to correct ones $migration->changeField('glpi_ticketrecurrents', 'periodicity', 'periodicity', 'string'); $migration->addField('glpi_ticketrecurrents', 'calendars_id', 'integer'); $migration->addField('glpi_ticketrecurrents', 'end_date', 'datetime'); $migration->migrationOneTable('glpi_ticketrecurrents'); foreach ($DB->request('glpi_ticketrecurrents',"`periodicity` >= ".MONTH_TIMESTAMP) as $data) { $periodicity = $data['periodicity'] ; if (is_numeric($periodicity)) { if ($periodicity >= 365*DAY_TIMESTAMP) { $periodicity = round($periodicity/(365*DAY_TIMESTAMP)).'YEAR'; } else { $periodicity = round($periodicity/(MONTH_TIMESTAMP)).'MONTH'; } $query = "UPDATE `glpi_ticketrecurrents` SET `periodicity` = '$periodicity' WHERE `id` = '".$data['id']."'"; $DB->query($query); } } $query = "UPDATE `glpi_notifications` SET `itemtype` = 'CartridgeItem' WHERE `itemtype` = 'Cartridge'"; $DB->queryOrDie($query, "0.83 update glpi_notifications for Cartridge"); $query = "UPDATE `glpi_notificationtemplates` SET `itemtype` = 'CartridgeItem' WHERE `itemtype` = 'Cartridge'"; $DB->queryOrDie($query, "0.83 update glpi_notificationtemplates for Cartridge"); $query = "UPDATE `glpi_notifications` SET `itemtype` = 'ConsumableItem' WHERE `itemtype` = 'Consumable'"; $DB->queryOrDie($query, "0.83 update glpi_notifications for Consumable"); $query = "UPDATE `glpi_notificationtemplates` SET `itemtype` = 'ConsumableItem' WHERE `itemtype` = 'Consumable'"; $DB->queryOrDie($query, "0.83 update glpi_notificationtemplates for Consumable"); $migration->createRule(array('sub_type' => 'RuleTicket', 'entities_id' => 0, 'is_recursive' => 1, 'is_active' => 0, 'match' => 'AND', 'name' => 'Ticket location from item'), array(array('criteria' => 'locations_id', 'condition' => Rule::PATTERN_DOES_NOT_EXISTS, 'pattern' => 1), array('criteria' => 'items_locations', 'condition' => Rule::PATTERN_EXISTS, 'pattern' => 1)), array(array('field' => 'locations_id', 'action_type' => 'fromitem', 'value' => 1))); $migration->createRule(array('sub_type' => 'RuleTicket', 'entities_id' => 0, 'is_recursive' => 1, 'is_active' => 0, 'match' => 'AND', 'name' => 'Ticket location from user'), array(array('criteria' => 'locations_id', 'condition' => Rule::PATTERN_DOES_NOT_EXISTS, 'pattern' => 1), array('criteria' => 'users_locations', 'condition' => Rule::PATTERN_EXISTS, 'pattern' => 1)), array(array('field' => 'locations_id', 'action_type' => 'fromuser', 'value' => 1))); // Change begin_date id for budget $query = ("UPDATE `glpi_displaypreferences` SET `num` = '5' WHERE `itemtype` = 'Budget' AND `num` = '2'"); $DB->query($query); migrateComputerDevice('DeviceProcessor', 'frequency', 'integer', array('serial' => 'string')); migrateComputerDevice('DeviceMemory', 'size', 'integer', array('serial' => 'string')); migrateComputerDevice('DeviceHardDrive', 'capacity', 'integer', array('serial' => 'string')); migrateComputerDevice('DeviceGraphicCard', 'memory', 'integer'); migrateComputerDevice('DeviceNetworkCard', 'mac', 'string'); migrateComputerDevice('DeviceSoundCard'); migrateComputerDevice('DeviceMotherBoard'); migrateComputerDevice('DeviceDrive'); migrateComputerDevice('DeviceControl'); migrateComputerDevice('DevicePci'); migrateComputerDevice('DeviceCase'); migrateComputerDevice('DevicePowerSupply'); $migration->migrationOneTable('glpi_computers_softwareversions'); //Rename fields in glpi_computers_softwareversions with inaproprious signification $migration->changeField('glpi_computers_softwareversions', 'is_deleted', 'is_deleted_computer', 'bool'); $migration->changeField('glpi_computers_softwareversions', 'is_template', 'is_template_computer', 'bool'); $migration->migrationOneTable('glpi_computers_softwareversions'); $types = array('glpi_computers_items', 'glpi_computervirtualmachines', 'glpi_computers_softwareversions', 'glpi_computerdisks', 'glpi_networkports', 'glpi_computers_softwarelicenses', 'glpi_networknames', 'glpi_ipaddresses'); foreach (Item_Devices::getDeviceTypes() as $id => $type) { $types[] = getTableForItemType($type); } //Add is_deleted for relations foreach ($types as $table) { if ($migration->addField($table, 'is_deleted', 'bool', array('value' => 0))) { $migration->migrationOneTable($table); $migration->addKey($table, 'is_deleted'); } } ///For computers, rename is is_ocs_import to is_dynamic $migration->changeField('glpi_computers', 'is_ocs_import', 'is_dynamic', 'bool'); $migration->migrationOneTable('glpi_computers'); $migration->dropKey("glpi_computers", 'is_ocs_import'); $migration->addKey("glpi_computers", 'is_dynamic'); //Add field is_dynamic $types = array_merge($types, array('glpi_printers', 'glpi_phones', 'glpi_peripherals', 'glpi_networkequipments', 'glpi_networkports', 'glpi_monitors', 'glpi_networknames', 'glpi_ipaddresses')); foreach ($types as $table) { if ($migration->addField($table, 'is_dynamic', 'bool')) { $migration->migrationOneTable($table); $migration->addKey($table, 'is_dynamic'); } } $ADDTODISPLAYPREF['ReservationItem'] = array(5); // split validation rights in both $migration->changeField('glpi_profiles', 'validate_ticket', 'validate_request', 'char'); $migration->changeField('glpi_profiles', 'create_validation', 'create_request_validation', 'char'); $migration->migrationOneTable('glpi_profiles'); $migration->addField('glpi_profiles', 'validate_incident', 'char', array('update' => 'validate_request')); $migration->addField('glpi_profiles', 'create_incident_validation', 'char', array('update' => 'create_request_validation')); // add rights to delete all validation $migration->addField('glpi_profiles', 'delete_validations', 'char', array('update' => 'delete_ticket')); // add rights to manage public rssfeed $migration->addField('glpi_profiles', 'rssfeed_public', 'char', array('update' => 'reminder_public', 'after' => 'reminder_public')); // add ticket templates $migration->addField('glpi_profiles', 'tickettemplates_id', 'integer'); // Drop not needed fields $migration->dropField('glpi_tickettemplatepredefinedfields', 'entities_id'); $migration->dropField('glpi_tickettemplatepredefinedfields', 'is_recursive'); $migration->dropField('glpi_tickettemplatemandatoryfields', 'entities_id'); $migration->dropField('glpi_tickettemplatemandatoryfields', 'is_recursive'); $migration->dropField('glpi_tickettemplatehiddenfields', 'entities_id'); $migration->dropField('glpi_tickettemplatehiddenfields', 'is_recursive'); // Clean unlinked calendar segments and holidays $query = "DELETE FROM `glpi_calendars_holidays` WHERE `glpi_calendars_holidays`.`calendars_id` NOT IN (SELECT `glpi_calendars`.`id` FROM `glpi_calendars`)"; $DB->queryOrDie($query, "0.84 clean glpi_calendars_holidays"); $query = "DELETE FROM `glpi_calendarsegments` WHERE `glpi_calendarsegments`.`calendars_id` NOT IN (SELECT `glpi_calendars`.`id` FROM `glpi_calendars`)"; $DB->queryOrDie($query, "0.84 clean glpi_calendarsegments"); // Add keys for serial, otherserial and uuid $newindexes = array('serial' => array('glpi_computers', 'glpi_items_deviceharddrives', 'glpi_items_devicememories', 'glpi_items_deviceprocessors', 'glpi_monitors', 'glpi_networkequipments', 'glpi_peripherals', 'glpi_phones', 'glpi_printers'), 'otherserial' => array('glpi_computers', 'glpi_monitors', 'glpi_networkequipments', 'glpi_peripherals', 'glpi_phones', 'glpi_printers'), 'uuid' => array('glpi_computers', 'glpi_computervirtualmachines')); foreach ($newindexes as $field => $tables) { foreach ($tables as $table) { $migration->addKey($table, $field); } } // Clean unlinked ticket_problem $query = "DELETE FROM `glpi_problems_tickets` WHERE `glpi_problems_tickets`.`tickets_id` NOT IN (SELECT `glpi_tickets`.`id` FROM `glpi_tickets`)"; $DB->queryOrDie($query, "0.84 clean glpi_problems_tickets"); $query = "DELETE FROM `glpi_problems_tickets` WHERE `glpi_problems_tickets`.`problems_id` NOT IN (SELECT `glpi_problems`.`id` FROM `glpi_problems`)"; $DB->queryOrDie($query, "0.84 clean glpi_problems_tickets"); // Clean unlinked softwarelicense_computer $query = "DELETE FROM `glpi_computers_softwarelicenses` WHERE `glpi_computers_softwarelicenses`.`softwarelicenses_id` NOT IN (SELECT `glpi_softwarelicenses`.`id` FROM `glpi_softwarelicenses`)"; $DB->queryOrDie($query, "0.84 clean glpi_computers_softwarelicenses"); $query = "DELETE FROM `glpi_computers_softwarelicenses` WHERE `glpi_computers_softwarelicenses`.`computers_id` NOT IN (SELECT `glpi_computers`.`id` FROM `glpi_computers`)"; $DB->queryOrDie($query, "0.84 clean glpi_computers_softwarelicenses"); // Clean unlinked items_problems $query = "DELETE FROM `glpi_items_problems` WHERE `glpi_items_problems`.`problems_id` NOT IN (SELECT `glpi_problems`.`id` FROM `glpi_problems`)"; $DB->queryOrDie($query, "0.84 clean glpi_items_problems"); $toclean = array('Computer', 'Monitor', 'NetworkEquipment', 'Peripheral', 'Phone', 'Printer', 'Software'); foreach ($toclean as $type) { $query = "DELETE FROM `glpi_items_problems` WHERE `glpi_items_problems`.`itemtype` = '$type' AND `glpi_items_problems`.`items_id` NOT IN (SELECT `".getTableForItemType($type)."`.`id` FROM `".getTableForItemType($type)."`)"; $DB->queryOrDie($query, "0.84 clean glpi_items_problems"); } // ************ Keep it at the end ************** //TRANS: %s is the table or item to migrate $migration->displayMessage(sprintf(__('Data migration - %s'), 'glpi_displaypreferences')); foreach ($ADDTODISPLAYPREF as $type => $tab) { $query = "SELECT DISTINCT `users_id` FROM `glpi_displaypreferences` WHERE `itemtype` = '$type'"; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { while ($data = $DB->fetch_assoc($result)) { $query = "SELECT MAX(`rank`) FROM `glpi_displaypreferences` WHERE `users_id` = '".$data['users_id']."' AND `itemtype` = '$type'"; $result = $DB->query($query); $rank = $DB->result($result,0,0); $rank++; foreach ($tab as $newval) { $query = "SELECT * FROM `glpi_displaypreferences` WHERE `users_id` = '".$data['users_id']."' AND `num` = '$newval' AND `itemtype` = '$type'"; if ($result2=$DB->query($query)) { if ($DB->numrows($result2)==0) { $query = "INSERT INTO `glpi_displaypreferences` (`itemtype` ,`num` ,`rank` ,`users_id`) VALUES ('$type', '$newval', '".$rank++."', '".$data['users_id']."')"; $DB->query($query); } } } } } else { // Add for default user $rank = 1; foreach ($tab as $newval) { $query = "INSERT INTO `glpi_displaypreferences` (`itemtype` ,`num` ,`rank` ,`users_id`) VALUES ('$type', '$newval', '".$rank++."', '0')"; $DB->query($query); } } } } // must always be at the end $migration->executeMigration(); return $updateresult; } /** * @param $origin * @param $id * @param $itemtype * @param $items_id * @param $error **/ function logNetworkPortError($origin, $id, $itemtype, $items_id, $error) { global $migration; $migration->log($origin." - NetworkPort[".$id."]=".$itemtype."[".$items_id ."]: ".$error, true); } /** * @param $itemtype * @param $items_id * @param $main_items_id * @param $main_itemtype * @param $entities_id * @param $IP **/ function createNetworkNameFromItem($itemtype, $items_id, $main_items_id, $main_itemtype, $entities_id, $IP) { global $migration; // Using gethostbyaddr() allows us to define its reald internet name according to its IP. // But each gethostbyaddr() may reach several milliseconds. With very large number of // Networkports or NetworkeEquipment, the migration may take several minutes or hours ... //$computerName = gethostbyaddr($IP); $computerName = $IP; if ($computerName != $IP) { $position = strpos($computerName, "."); $name = substr($computerName, 0, $position); $domain = substr($computerName, $position + 1); $query = "SELECT `id` FROM `glpi_fqdns` WHERE `fqdn` = '$domain'"; $result = $DB->query($query); if ($DB->numrows($result) == 1) { $data = $DB->fetch_assoc($result); $domainID = $data['id']; } } else { $name = "migration-".str_replace('.','-',$computerName); $domainID = 0; } $IPaddress = new IPAddress(); if ($IPaddress->setAddressFromString($IP)) { $input = array('name' => $name, 'fqdns_id' => $domainID, 'entities_id' => $entities_id, 'items_id' => $items_id, 'itemtype' => $itemtype); $networknames_id = $migration->insertInTable('glpi_networknames', $input); $input = $IPaddress->setArrayFromAddress(array('entities_id' => $entities_id, 'itemtype' => 'NetworkName', 'items_id' => $networknames_id), "version", "name", "binary"); $migration->insertInTable($IPaddress->getTable(), $input); } else { // Don't add the NetworkName if the address is not valid addNetworkPortMigrationError($items_id, 'invalid_address'); logNetworkPortError('invalid IP address', $items_id, $main_itemtype, $main_items_id, "$IP"); } unset($IPaddress); } /** * @param $port * @param $fields * @param $setNetworkCard **/ function updateNetworkPortInstantiation($port, $fields, $setNetworkCard) { global $DB, $migration; $query = "SELECT `origin_glpi_networkports`.`name`, `origin_glpi_networkports`.`id`, `origin_glpi_networkports`.`mac`, "; $addleftjoin = ''; $manage_netinterface = false; if ($port instanceof NetworkPortEthernet) { $addleftjoin = "LEFT JOIN `glpi_networkinterfaces` ON (`origin_glpi_networkports`.`networkinterfaces_id` = `glpi_networkinterfaces` .`id`)"; $query .= "`glpi_networkinterfaces`.`name` AS networkinterface, "; $manage_netinterface = true; } foreach ($fields as $SQL_field => $field) { $query .= "$SQL_field AS $field, "; } $query .= "`origin_glpi_networkports`.`itemtype`, `origin_glpi_networkports`.`items_id` FROM `origin_glpi_networkports` $addleftjoin WHERE `origin_glpi_networkports`.`id` IN (SELECT `id` FROM `glpi_networkports` WHERE `instantiation_type` = '".$port->getType()."')"; foreach ($DB->request($query) as $portInformation) { $input = array('networkports_id' => $portInformation['id']); if ($manage_netinterface) { if (preg_match('/TX/i', $portInformation['networkinterface'])) { $input['type'] = 'T'; } if (preg_match('/SX/i', $portInformation['networkinterface'])) { $input['type'] = 'SX'; } if (preg_match('/LX/i', $portInformation['networkinterface'])) { $input['type'] = 'LX'; } unset($portInformation['networkinterface']); } foreach ($fields as $field) { $input[$field] = $portInformation[$field]; } if (($setNetworkCard) && ($portInformation['itemtype'] == 'Computer')) { $query = "SELECT link.`id` AS link_id, device.`designation` AS name FROM `glpi_devicenetworkcards` as device, `glpi_computers_devicenetworkcards` as link WHERE link.`computers_id` = ".$portInformation['items_id']." AND device.`id` = link.`devicenetworkcards_id` AND link.`specificity` = '".$portInformation['mac']."'"; $result = $DB->query($query); if ($DB->numrows($result) > 0) { $set_first = ($DB->numrows($result) == 1); while ($link = $DB->fetch_assoc($result)) { if ($set_first || ($link['name'] == $portInformation['name'])) { $input['items_devicenetworkcards_id'] = $link['link_id']; break; } } } } $migration->insertInTable($port->getTable(), $input); } } /** * @param $networkports_id * @param $motive **/ function addNetworkPortMigrationError($networkports_id, $motive) { global $DB; if (countElementsInTable("glpi_networkportmigrations", "`id` = '$networkports_id'") == 0) { $query = "INSERT INTO `glpi_networkportmigrations` (SELECT *" . str_repeat(', 0', count(NetworkPortMigration::getMotives())) ." FROM `origin_glpi_networkports` WHERE `id` = '$networkports_id')"; $DB->queryOrDie($query, "0.84 error on copy of network port during migration"); } $query = "UPDATE `glpi_networkportmigrations` SET `$motive` = '1' WHERE `id`='$networkports_id'"; $DB->queryOrDie($query, "0.84 append of motive to migration of network port error"); } /** * Update all Network Organisation * * @param $ADDTODISPLAYPREF **/ function updateNetworkFramework(&$ADDTODISPLAYPREF) { global $DB, $migration; $ADDTODISPLAYPREF['FQDN'] = array(11); $ADDTODISPLAYPREF['WifiNetwork'] = array(10); $ADDTODISPLAYPREF['NetworkPortMigration'] = array(); $ADDTODISPLAYPREF['IPNetwork'] = array(14, 10, 11, 12, 13); $ADDTODISPLAYPREF['NetworkName'] = array(12, 13); $optionIndex = 10; foreach (NetworkPortMigration::getMotives() as $key => $name) { $ADDTODISPLAYPREF['NetworkPortMigration'][] = $optionIndex ++; } $migration->displayMessage(sprintf(__('Data migration - %s'), 'Network framework')); $originTables = array(); foreach (array('glpi_networkports', 'glpi_networkequipments') as $table) { $originTables[$table] = 'origin_'.$table; } if (!TableExists('origin_glpi_networkequipments')) { // remove of mac field from glpi_networkequipments is done at the end of migration // framework process if (!FieldExists('glpi_networkequipments', 'mac')) { // Nothing to be done : migration of NetworkPort already OK ! // But don't add display preference for NetworkPortMigration if none exists if (!TableExists('glpi_networkportmigrations')) { unset($ADDTODISPLAYPREF['NetworkPortMigration']); } $migration->displayWarning('Network Framework already migrated: nothing to be done !', false); return; } foreach ($originTables as $table => $originTable) { if (!TableExists($originTable) && TableExists($table)) { $migration->copyTable($table, $originTable); $migration->displayWarning("To be safe, we are working on $originTable. ". "It is a copy of $table", false); } } } // Remove all tables created by any previous migration $new_network_ports = array('glpi_fqdns', 'glpi_ipaddresses', 'glpi_ipaddresses_ipnetworks', 'glpi_ipnetworks', 'glpi_networkaliases', 'glpi_networknames', 'glpi_networkportaggregates', 'glpi_networkportdialups', 'glpi_networkportethernets', 'glpi_networkportlocals', 'glpi_networkportmigrations', 'glpi_networkportwifis', 'glpi_wifinetworks'); foreach ($new_network_ports as $table) { $migration->dropTable($table); } // Create the glpi_networkportmigrations that is a copy of origin_glpi_networkports $query = "CREATE TABLE `glpi_networkportmigrations` LIKE `origin_glpi_networkports`"; $DB->queryOrDie($query, "0.84 create glpi_networkportmigrations"); // And add the error motive fields foreach (NetworkPortMigration::getMotives() as $key => $name) { $migration->addField('glpi_networkportmigrations', $key, 'bool'); } $migration->migrationOneTable('glpi_networkportmigrations'); $migration->displayMessage(sprintf(__('Data migration - %s'), 'glpi_fqdns')); // Adding FQDN table if (!TableExists('glpi_fqdns')) { $query = "CREATE TABLE `glpi_fqdns` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `fqdn` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `entities_id` (`entities_id`), KEY `name` (`name`), KEY `fqdn` (`fqdn`), KEY `is_recursive` (`is_recursive`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.84 create glpi_fqdns"); $fqdn = new FQDN(); // Then, populate it from domains (beware that "domains" can be FQDNs and Windows workgroups) $query = "SELECT DISTINCT LOWER(`name`) AS name, `comment` FROM `glpi_domains`"; foreach ($DB->request($query) as $domain) { $domainName = $domain['name']; // We ensure that domains have at least 1 dote to be sure it is not a Windows workgroup if ((strpos($domainName, '.') !== false) && (FQDN::checkFQDN($domainName))) { $migration->insertInTable($fqdn->getTable(), array('entities_id' => 0, 'name' => $domainName, 'fqdn' => $domainName, 'comment' => $domain['comment'])); } } } $migration->displayMessage(sprintf(__('Data migration - %s'), 'glpi_ipaddresses')); // Adding IPAddress table if (!TableExists('glpi_ipaddresses')) { $query = "CREATE TABLE `glpi_ipaddresses` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `items_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `version` tinyint unsigned DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `binary_0` int unsigned NOT NULL DEFAULT '0', `binary_1` int unsigned NOT NULL DEFAULT '0', `binary_2` int unsigned NOT NULL DEFAULT '0', `binary_3` int unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `entities_id` (`entities_id`), KEY `textual` (`name`), KEY `binary` (`binary_0`, `binary_1`, `binary_2`, `binary_3`), KEY `item` (`itemtype`, `items_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.84 create glpi_ipaddresses"); } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'glpi_wifinetworks')); // Adding WifiNetwork table if (!TableExists('glpi_wifinetworks')) { $query = "CREATE TABLE `glpi_wifinetworks` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `essid` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `mode` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'ad-hoc, access_point', `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `entities_id` (`entities_id`), KEY `essid` (`essid`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.84 create glpi_wifinetworks"); } $migration->displayMessage(sprintf(__('Data migration - %s'), "glpi_ipnetworks")); // Adding IPNetwork table if (!TableExists('glpi_ipnetworks')) { $query = "CREATE TABLE `glpi_ipnetworks` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `is_recursive` tinyint(1) NOT NULL DEFAULT '0', `ipnetworks_id` int(11) NOT NULL DEFAULT '0', `completename` text COLLATE utf8_unicode_ci, `level` int(11) NOT NULL DEFAULT '0', `ancestors_cache` longtext COLLATE utf8_unicode_ci, `sons_cache` longtext COLLATE utf8_unicode_ci, `addressable` tinyint(1) NOT NULL DEFAULT '0', `version` tinyint unsigned DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `address` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL, `address_0` int unsigned NOT NULL DEFAULT '0', `address_1` int unsigned NOT NULL DEFAULT '0', `address_2` int unsigned NOT NULL DEFAULT '0', `address_3` int unsigned NOT NULL DEFAULT '0', `netmask` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL, `netmask_0` int unsigned NOT NULL DEFAULT '0', `netmask_1` int unsigned NOT NULL DEFAULT '0', `netmask_2` int unsigned NOT NULL DEFAULT '0', `netmask_3` int unsigned NOT NULL DEFAULT '0', `gateway` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL, `gateway_0` int unsigned NOT NULL DEFAULT '0', `gateway_1` int unsigned NOT NULL DEFAULT '0', `gateway_2` int unsigned NOT NULL DEFAULT '0', `gateway_3` int unsigned NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `network_definition` (`entities_id`,`address`,`netmask`), KEY `address` (`address_0`, `address_1`, `address_2`, `address_3`), KEY `netmask` (`netmask_0`, `netmask_1`, `netmask_2`, `netmask_3`), KEY `gateway` (`gateway_0`, `gateway_1`, `gateway_2`, `gateway_3`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.84 create glpi_ipnetworks"); // Retrieve all the networks from the current network ports and add them to the IPNetworks $query = "SELECT DISTINCTROW INET_NTOA(INET_ATON(`ip`)&INET_ATON(`netmask`)) AS address, `netmask`, `gateway`, `entities_id` FROM `origin_glpi_networkports` ORDER BY `gateway` DESC"; $address = new IPAddress(); $netmask = new IPNetmask(); $gateway = new IPAddress(); $network = new IPNetwork(); foreach ($DB->request($query) as $entry) { $address = $entry['address']; $netmask = $entry['netmask']; $gateway = $entry['gateway']; $entities_id = $entry['entities_id']; if ((empty($address)) || ($address == '0.0.0.0') || (empty($netmask)) || ($netmask == '0.0.0.0') || ($netmask == '255.255.255.255')) { continue; } if ($gateway == '0.0.0.0') { $gateway = ''; } $networkDefinition = "$address/$netmask"; $networkName = $networkDefinition . (empty($gateway) ? "" : " - ".$gateway); $input = array('entities_id' => $entities_id, 'name' => $networkName, 'network' => $networkDefinition, 'gateway' => $gateway, 'ipnetworks_id' => 0, 'addressable' => 1, 'completename' => $networkName, 'level' => 1); $preparedInput = $network->prepareInput($input); if (is_array($preparedInput['input'])) { $input = $preparedInput['input']; if (isset($preparedInput['error'])) { $query = "SELECT id, items_id, itemtype FROM origin_glpi_networkports WHERE INET_NTOA(INET_ATON(`ip`)&INET_ATON(`netmask`)) = '$address' AND `netmask` = '$netmask' AND `gateway` = '$gateway' AND `entities_id` = '$entities_id'"; $result = $DB->query($query); foreach ($DB->request($query) as $data) { addNetworkPortMigrationError($data['id'], 'invalid_gateway'); logNetworkPortError('network warning', $data['id'], $data['itemtype'], $data['items_id'], $preparedInput['error']); } } $migration->insertInTable($network->getTable(), $input); } else if (isset($preparedInput['error'])) { $query = "SELECT id, items_id, itemtype FROM origin_glpi_networkports WHERE INET_NTOA(INET_ATON(`ip`)&INET_ATON(`netmask`)) = '".$entry['address']."' AND `netmask` = '$netmask' AND `gateway` = '$gateway' AND `entities_id` = '$entities_id'"; $result = $DB->query($query); foreach ($DB->request($query) as $data) { addNetworkPortMigrationError($data['id'], 'invalid_network'); logNetworkPortError('network error', $data['id'], $data['itemtype'], $data['items_id'], $preparedInput['error']); } } } } $migration->displayMessage(sprintf(__('Data migration - %s'), "glpi_ipnetworks_vlans")); // Adding IPNetwork table if (!TableExists('glpi_ipnetworks_vlans')) { $query = "CREATE TABLE `glpi_ipnetworks_vlans` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ipnetworks_id` int(11) NOT NULL DEFAULT '0', `vlans_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `link` (`ipnetworks_id`, `vlans_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"; $DB->queryOrDie($query, "0.84 create glpi_ipnetworks_vlans"); } $migration->displayMessage(sprintf(__('Data migration - %s'), "glpi_networknames")); // Adding NetworkName table if (!TableExists('glpi_networknames')) { $query = "CREATE TABLE `glpi_networknames` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `items_id` int(11) NOT NULL DEFAULT '0', `itemtype` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8_unicode_ci, `fqdns_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `entities_id` (`entities_id`), KEY `FQDN` (`name`,`fqdns_id`), KEY `name` (`name`), KEY `item` (`itemtype`, `items_id`), KEY `fqdns_id` (`fqdns_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.84 create glpi_networknames"); // Retrieve all the networks from the current network ports and add them to the IPNetworks $query = "SELECT `ip`, `id`, `entities_id`, `itemtype`, `items_id` FROM `origin_glpi_networkports` WHERE `ip` <> ''"; foreach ($DB->request($query) as $entry) { if (empty($entry["ip"])) { continue; } createNetworkNameFromItem('NetworkPort', $entry['id'], $entry['items_id'], $entry['itemtype'], $entry['entities_id'], $entry["ip"]); } } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), "glpi_networkaliases")); // Adding NetworkAlias table if (!TableExists('glpi_networkaliases')) { $query = "CREATE TABLE `glpi_networkaliases` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entities_id` int(11) NOT NULL DEFAULT '0', `networknames_id` int(11) NOT NULL DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `fqdns_id` int(11) NOT NULL DEFAULT '0', `comment` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), KEY `entities_id` (`entities_id`), KEY `name` (`name`), KEY `networknames_id` (`networknames_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.84 create glpi_networkaliases"); } $migration->displayMessage(sprintf(__('Data migration - %s'), "glpi_ipaddresses_ipnetworks")); // Adding IPAddress_IPNetwork table if (!TableExists('glpi_ipaddresses_ipnetworks')) { $query = "CREATE TABLE `glpi_ipaddresses_ipnetworks` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ipaddresses_id` int(11) NOT NULL DEFAULT '0', `ipnetworks_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `unicity` (`ipaddresses_id`,`ipnetworks_id`), KEY `ipnetworks_id` (`ipnetworks_id`), KEY `ipaddresses_id` (`ipaddresses_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"; $DB->queryOrDie($query, "0.84 create glpi_ipaddresses_ipnetworks"); } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), "glpi_networkinterfaces")); // Update NetworkPorts $migration->addField('glpi_networkports', 'instantiation_type', 'string', array('after' => 'name', 'update' => "'NetworkPortEthernet'")); $migration->displayMessage(sprintf(__('Data migration - %s'), "glpi_networkports")); // Retrieve all the networks from the current network ports and add them to the IPNetwork $query = "SELECT * FROM `glpi_networkinterfaces`"; foreach ($DB->request($query) as $entry) { $instantiation_type = ""; switch ($entry['name']) { case 'Local' : $instantiation_type = "NetworkPortLocal"; break; case 'Ethernet' : $instantiation_type = "NetworkPortEthernet"; break; case 'Wifi' : $instantiation_type = "NetworkPortWifi"; break; case 'Dialup' : $instantiation_type = "NetworkPortDialup"; break; default: if (preg_match('/TX/i', $entry['name']) || preg_match('/SX/i', $entry['name']) || preg_match('/Ethernet/i', $entry['name'])) { $instantiation_type = "NetworkPortEthernet"; } break; } // In case of unknown Interface Type, we should have to set instantiation_type to '' // Thus we should be able to convert it later to correct type (ethernet, wifi, loopback ...) if (!empty($instantiation_type)) { $query = "UPDATE `glpi_networkports` SET `instantiation_type` = '$instantiation_type' WHERE `id` IN (SELECT `id` FROM `origin_glpi_networkports` WHERE `networkinterfaces_id` = '".$entry['id']."')"; $DB->queryOrDie($query, "0.84 update instantiation_type field of glpi_networkports"); // Clear $instantiation_type for next check inside the loop unset($instantiation_type); } } foreach (array('ip', 'gateway', 'netmask', 'netpoints_id', 'networkinterfaces_id', 'subnet') as $field) { $migration->dropField('glpi_networkports', $field); } foreach (array('ip', 'mac') as $field) { $migration->dropField('glpi_networkequipments', $field); } $migration->displayMessage(sprintf(__('Data migration - %s'), 'Index mac field and transform address mac to lower')); $query = "UPDATE `glpi_networkports` SET `mac` = LOWER(`mac`)"; $DB->queryOrDie($query, "0.84 transforme MAC to lower case"); $migration->addKey('glpi_networkports', 'mac'); $migration->displayMessage(sprintf(__('Data migration - %s'), 'Update migration of interfaces errors')); $query = "SELECT id FROM `glpi_networkports` WHERE `instantiation_type` = ''"; foreach ($DB->request($query) as $networkPortID) { addNetworkPortMigrationError($networkPortID['id'], 'unknown_interface_type'); } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), "glpi_networkportethernets")); // Adding NetworkPortEthernet table if (!TableExists('glpi_networkportethernets')) { $query = "CREATE TABLE `glpi_networkportethernets` ( `id` int(11) NOT NULL AUTO_INCREMENT, `networkports_id` int(11) NOT NULL DEFAULT '0', `items_devicenetworkcards_id` int(11) NOT NULL DEFAULT '0', `netpoints_id` int(11) NOT NULL DEFAULT '0', `type` varchar(10) COLLATE utf8_unicode_ci DEFAULT '' COMMENT 'T, LX, SX', `speed` int(11) NOT NULL DEFAULT '10' COMMENT 'Mbit/s: 10, 100, 1000, 10000', PRIMARY KEY (`id`), UNIQUE KEY `networkports_id` (`networkports_id`), KEY `card` (`items_devicenetworkcards_id`), KEY `netpoint` (`netpoints_id`), KEY `type` (`type`), KEY `speed` (`speed`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.84 create glpi_networkportethernets"); $port = new NetworkPortEthernet(); updateNetworkPortInstantiation($port, array('`netpoints_id`' => 'netpoints_id'), true); } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), "glpi_networkportwifis")); // Adding NetworkPortWifi table if (!TableExists('glpi_networkportwifis')) { $query = "CREATE TABLE `glpi_networkportwifis` ( `id` int(11) NOT NULL AUTO_INCREMENT, `networkports_id` int(11) NOT NULL DEFAULT '0', `items_devicenetworkcards_id` int(11) NOT NULL DEFAULT '0', `wifinetworks_id` int(11) NOT NULL DEFAULT '0', `networkportwifis_id` int(11) NOT NULL DEFAULT '0' COMMENT 'only usefull in case of Managed node', `version` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'a, a/b, a/b/g, a/b/g/n, a/b/g/n/y', `mode` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'ad-hoc, managed, master, repeater, secondary, monitor, auto', PRIMARY KEY (`id`), UNIQUE KEY `networkports_id` (`networkports_id`), KEY `card` (`items_devicenetworkcards_id`), KEY `essid` (`wifinetworks_id`), KEY `version` (`version`), KEY `mode` (`mode`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.84 create glpi_networkportwifis"); $port = new NetworkPortWifi(); updateNetworkPortInstantiation($port, array(), true); } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), "glpi_networkportlocals")); // Adding NetworkPortLocal table if (!TableExists('glpi_networkportlocals')) { $query = "CREATE TABLE `glpi_networkportlocals` ( `id` int(11) NOT NULL AUTO_INCREMENT, `networkports_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `networkports_id` (`networkports_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.84 create glpi_networkportlocals"); $port = new NetworkPortLocal(); updateNetworkPortInstantiation($port, array(), false); } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), "glpi_networkportdialups")); // Adding NetworkPortDialup table if (!TableExists('glpi_networkportdialups')) { $query = "CREATE TABLE `glpi_networkportdialups` ( `id` int(11) NOT NULL AUTO_INCREMENT, `networkports_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `networkports_id` (`networkports_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.84 create glpi_networkportdialups"); $port = new NetworkPortDialup(); updateNetworkPortInstantiation($port, array(), true); } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), "glpi_networkportaggregates")); // Adding NetworkPortAggregate table if (!TableExists('glpi_networkportaggregates')) { $query = "CREATE TABLE `glpi_networkportaggregates` ( `id` int(11) NOT NULL AUTO_INCREMENT, `networkports_id` int(11) NOT NULL DEFAULT '0', `networkports_id_list` TEXT DEFAULT NULL COMMENT 'array of associated networkports_id', PRIMARY KEY (`id`), UNIQUE KEY `networkports_id` (`networkports_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.84 create glpi_networkportaggregates"); // Transform NetworkEquipment local MAC address as a networkport that aggregates all ports $query = "SELECT * FROM `origin_glpi_networkequipments` WHERE `mac` != '' OR `ip` != ''"; $port_input = array('itemtype' => 'NetworkEquipment', 'logical_number' => '0', 'name' => 'management', 'instantiation_type' => 'NetworkPortAggregate'); foreach ($DB->request($query) as $equipment) { $networkequipments_id = $equipment['id']; $query = "SELECT `id`, `ip`, `mac` FROM `origin_glpi_networkports` WHERE `itemtype` = 'NetworkEquipment' AND `items_id` = '$networkequipments_id' AND (`ip` = '".$equipment['ip']."' OR `mac` = '".$equipment['mac']."')"; $both = array(); $mac = array(); $ip = array(); foreach ($DB->request($query) as $ports) { if ($ports['ip'] == $equipment['ip']) { if ($ports['mac'] == $equipment['mac']) { $both[] = $ports['id']; } else { $ip[] = $ports['id']; } } else { $mac[] = $ports['id']; } } if (count($both) != 1) { // Only add a NetworkPort if there is 0 or more than one element ! $port_input['items_id'] = $networkequipments_id; $port_input['entities_id'] = $equipment['entities_id']; $port_input['is_recursive'] = $equipment['is_recursive']; $port_input['mac'] = strtolower ($equipment['mac']); $networkports_id = $migration->insertInTable('glpi_networkports', $port_input); $aggregate_input = array(); $aggregate_input['networkports_id'] = $networkports_id; $aggregate_input['networkports_id_list'] = exportArrayToDB($both); $migration->insertInTable('glpi_networkportaggregates', $aggregate_input); createNetworkNameFromItem('NetworkPort', $networkports_id, $equipment['id'], 'NetworkEquipment', $equipment['entities_id'], $equipment['ip']); foreach ($both as $aggregated_networkports_id) { $query = "DELETE FROM `glpi_networknames` WHERE `itemtype` = 'NetworkPort' AND `items_id` = '$aggregated_networkports_id'"; $DB->query($query); $query = "UPDATE `glpi_networkports` SET `mac` = '' WHERE `id` = '$aggregated_networkports_id'"; $DB->query($query); } } } } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), "glpi_networkportaliases")); // Adding NetworkPortAlias table if (!TableExists('glpi_networkportaliases')) { $query = "CREATE TABLE `glpi_networkportaliases` ( `id` int(11) NOT NULL AUTO_INCREMENT, `networkports_id` int(11) NOT NULL DEFAULT '0', `networkports_id_alias` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `networkports_id` (`networkports_id`), KEY `networkports_id_alias` (`networkports_id_alias`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; $DB->queryOrDie($query, "0.84 create glpi_networkportaliases"); // New element, so, we don't need to create items } $migration->addField('glpi_networkports_vlans', 'tagged', 'bool', array('value' => '0')); $migration->addField('glpi_vlans', 'entities_id', 'integer', array('value' => '0', 'after' => 'id')); $migration->addKey('glpi_vlans', 'entities_id'); $migration->addField('glpi_vlans', 'is_recursive', 'bool', array('value' => '0', 'after' => 'entities_id', 'update' => '1')); $migration->addKey('glpi_vlans', 'tag'); $migration->displayMessage(sprintf(__('Data migration - %s'), 'Update connections between IPAddress and IPNetwork')); // Here, we are sure that there is only IPv4 addresses. So, the SQL requests are simplified $query = "SELECT `id`, `address_3`, `netmask_3` FROM `glpi_ipnetworks`"; if ($network_result = $DB->query($query)) { unset($query); while ($ipnetwork_row = $DB->fetch_assoc($network_result)) { $ipnetworks_id = $ipnetwork_row['id']; $netmask = floatval($ipnetwork_row['netmask_3']); $address = floatval($ipnetwork_row['address_3']) & $netmask; $query = "SELECT `id` FROM `glpi_ipaddresses` WHERE (`glpi_ipaddresses`.`binary_3` & '$netmask') = $address AND `glpi_ipaddresses`.`version` = '4' GROUP BY `items_id`"; if ($ipaddress_result = $DB->query($query)) { unset($query); while ($link = $DB->fetch_assoc($ipaddress_result)) { $query = "INSERT INTO `glpi_ipaddresses_ipnetworks` (`ipaddresses_id`, `ipnetworks_id`) VALUES ('".$link['id']."', '$ipnetworks_id')"; $DB->query($query); unset($query); } } } } $migration->displayMessage(sprintf(__('Change of the database layout - %s'), 'Drop table glpi_networkportmigrations if empty')); if (countElementsInTable("glpi_networkportmigrations") == 0) { $migration->dropTable("glpi_networkportmigrations"); $migration->dropTable("glpi_networkportinterfaces"); unset($ADDTODISPLAYPREF['NetworkPortMigration']); } // We migrate glpi_networkequipments: mac field presence is used to check if framework has // already been migrated $migration->migrationOneTable('glpi_networkequipments'); foreach ($originTables as $table) { $migration->dropTable($table); } } /** * @param $deviceType * @param $new_specif (default NULL) * @param $new_specif_type (default NULL) * @param $other_specif array */ function migrateComputerDevice($deviceType, $new_specif=NULL, $new_specif_type=NULL, array $other_specif=array()) { global $DB, $migration; $table = getTableForItemType('Item_'.$deviceType); $device_table = getTableForItemType($deviceType); $migration->renameTable(getTableForItemType('Computer_'.$deviceType), $table); $migration->changeField($table, 'computers_id', 'items_id', 'integer', array('value' => 0)); $migration->addField($table, 'itemtype', 'string', array('after' => 'items_id', 'update' => "'Computer'")); if (!empty($new_specif) && !empty($new_specif_type)) { $migration->changeField($table, 'specificity', $new_specif, $new_specif_type); $migration->changeField($device_table, 'specif_default', $new_specif.'_default', $new_specif_type); // Update the log ... $query = "UPDATE `glpi_logs` SET `itemtype_link` = 'Item_".$deviceType."#".$new_specif."' WHERE `itemtype_link` = '$deviceType'"; $DB->queryOrDie($query, "0.84 adapt glpi_logs to new item_devices"); } foreach ($other_specif as $field => $format) { $migration->addField($table, $field, $format); } $migration->migrationOneTable($table); } ?>glpi-0.84.3+dfsg.1/install/update_083_0831.php000066400000000000000000000116261226600447100203350ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /** * Update from 0.83 to 0.83.1 * * @return bool for success (will die for most error) **/ function update083to0831() { global $DB, $migration; $updateresult = true; $ADDTODISPLAYPREF = array(); $migration->displayTitle(sprintf(__('Update to %s'), '0.83.1')); $migration->setVersion('0.83.1'); $backup_tables = false; $newtables = array(); foreach ($newtables as $new_table) { // rename new tables if exists ? if (TableExists($new_table)) { $migration->dropTable("backup_$new_table"); $migration->displayWarning("$new_table table already exists. ". "A backup have been done to backup_$new_table."); $backup_tables = true; $query = $migration->renameTable("$new_table", "backup_$new_table"); } } if ($backup_tables) { $migration->displayWarning("You can delete backup tables if you have no need of them.", true); } $migration->addField('glpi_configs', 'allow_search_view', 'integer', array('value' => 2)); $migration->addField('glpi_configs', 'allow_search_all', 'bool', array('value' => 1)); $migration->addField('glpi_configs', 'allow_search_global', 'bool', array('value' => 1)); $migration->addKey('glpi_tickets', 'name'); $migration->addField("glpi_profiles", "knowbase_admin", "char", array('after' => "knowbase", 'update' => "1", 'condition' => " WHERE `config` = 'w'")); $migration->addField("glpi_configs", "display_count_on_home", "integer", array('value' => 5)); $migration->addField("glpi_users", "display_count_on_home", "int(11) NULL DEFAULT NULL"); // ************ Keep it at the end ************** $migration->displayMessage('Migration of glpi_displaypreferences'); foreach ($ADDTODISPLAYPREF as $type => $tab) { $query = "SELECT DISTINCT `users_id` FROM `glpi_displaypreferences` WHERE `itemtype` = '$type'"; if ($result = $DB->query($query)) { if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { $query = "SELECT MAX(`rank`) FROM `glpi_displaypreferences` WHERE `users_id` = '".$data['users_id']."' AND `itemtype` = '$type'"; $result = $DB->query($query); $rank = $DB->result($result,0,0); $rank++; foreach ($tab as $newval) { $query = "SELECT * FROM `glpi_displaypreferences` WHERE `users_id` = '".$data['users_id']."' AND `num` = '$newval' AND `itemtype` = '$type'"; if ($result2 = $DB->query($query)) { if ($DB->numrows($result2) == 0) { $query = "INSERT INTO `glpi_displaypreferences` (`itemtype` ,`num` ,`rank` ,`users_id`) VALUES ('$type', '$newval', '".$rank++."', '".$data['users_id']."')"; $DB->query($query); } } } } } else { // Add for default user $rank = 1; foreach ($tab as $newval) { $query = "INSERT INTO `glpi_displaypreferences` (`itemtype` ,`num` ,`rank` ,`users_id`) VALUES ('$type', '$newval', '".$rank++."', '0')"; $DB->query($query); } } } } // must always be at the end $migration->executeMigration(); return $updateresult; } ?> glpi-0.84.3+dfsg.1/install/update_0841_0843.php000066400000000000000000000171121226600447100204160ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /** * Update from 0.84.1 to 0.84.3 * * @return bool for success (will die for most error) **/ function update0841to0843() { global $DB, $migration; $updateresult = true; $ADDTODISPLAYPREF = array(); //TRANS: %s is the number of new version $migration->displayTitle(sprintf(__('Update to %s'), '0.84.3')); $migration->setVersion('0.84.3'); $backup_tables = false; $newtables = array(); foreach ($newtables as $new_table) { // rename new tables if exists ? if (TableExists($new_table)) { $migration->dropTable("backup_$new_table"); $migration->displayWarning("$new_table table already exists. ". "A backup have been done to backup_$new_table."); $backup_tables = true; $query = $migration->renameTable("$new_table", "backup_$new_table"); } } if ($backup_tables) { $migration->displayWarning("You can delete backup tables if you have no need of them.", true); } // Upgrade ticket bookmarks and clean _glpi_csrf_token $status = array ('new' => CommonITILObject::INCOMING, 'assign' => CommonITILObject::ASSIGNED, 'plan' => CommonITILObject::PLANNED, 'waiting' => CommonITILObject::WAITING, 'solved' => CommonITILObject::SOLVED, 'closed' => CommonITILObject::CLOSED, 'accepted' => CommonITILObject::ACCEPTED, 'observe' => CommonITILObject::OBSERVED, 'evaluation' => CommonITILObject::EVALUATION, 'approbation' => CommonITILObject::APPROVAL, 'test' => CommonITILObject::TEST, 'qualification' => CommonITILObject::QUALIFICATION); $query = "SELECT * FROM `glpi_bookmarks`"; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { while ($data = $DB->fetch_assoc($result)) { $num = 0; $num2 = 0; $options = array(); parse_str($data["query"], $options); // unset _glpi_csrf_token if (isset($options['_glpi_csrf_token'])) { unset($options['_glpi_csrf_token']); } if (isset($options['field'])) { // update ticket statuses if (($data['itemtype'] = 'Ticket' || $data['itemtype'] = 'Problem') && $data['type'] == Bookmark::SEARCH) { foreach ($options['field'] as $key => $val) { if ($val == 12 && isset($options['contains'][$key])) { if (isset($status[$options['contains'][$key]])) { $options['contains'][$key] = $status[$options['contains'][$key]]; } } } } // Fix computer / allassets bookmarks : 17 -> 7 / 18 -> 8 / 7 -> 17 if (($data['itemtype'] = 'Computer' || $data['itemtype'] = 'AllAssets') && $data['type'] == Bookmark::SEARCH) { foreach ($options['field'] as $key => $val) { switch ($val) { case 17 : if (isset($options['contains'][$key])) { $options['field'][$key] = 7; } break; case 18 : if (isset($options['contains'][$key])) { $options['field'][$key] = 8; } break; case 7 : if (isset($options['contains'][$key])) { $options['field'][$key] = 17; } break; } } } } $query2 = "UPDATE `glpi_bookmarks` SET `query` = '".addslashes(Toolbox::append_params($options))."' WHERE `id` = '".$data['id']."'"; $DB->queryOrDie($query2, "0.84.3 update bookmarks"); } } } // ************ Keep it at the end ************** //TRANS: %s is the table or item to migrate $migration->displayMessage(sprintf(__('Data migration - %s'), 'glpi_displaypreferences')); foreach ($ADDTODISPLAYPREF as $type => $tab) { $query = "SELECT DISTINCT `users_id` FROM `glpi_displaypreferences` WHERE `itemtype` = '$type'"; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { while ($data = $DB->fetch_assoc($result)) { $query = "SELECT MAX(`rank`) FROM `glpi_displaypreferences` WHERE `users_id` = '".$data['users_id']."' AND `itemtype` = '$type'"; $result = $DB->query($query); $rank = $DB->result($result,0,0); $rank++; foreach ($tab as $newval) { $query = "SELECT * FROM `glpi_displaypreferences` WHERE `users_id` = '".$data['users_id']."' AND `num` = '$newval' AND `itemtype` = '$type'"; if ($result2=$DB->query($query)) { if ($DB->numrows($result2)==0) { $query = "INSERT INTO `glpi_displaypreferences` (`itemtype` ,`num` ,`rank` ,`users_id`) VALUES ('$type', '$newval', '".$rank++."', '".$data['users_id']."')"; $DB->query($query); } } } } } else { // Add for default user $rank = 1; foreach ($tab as $newval) { $query = "INSERT INTO `glpi_displaypreferences` (`itemtype` ,`num` ,`rank` ,`users_id`) VALUES ('$type', '$newval', '".$rank++."', '0')"; $DB->query($query); } } } } // must always be at the end $migration->executeMigration(); return $updateresult; } ?>glpi-0.84.3+dfsg.1/install/update_084_0841.php000066400000000000000000000146621226600447100203420ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ /** * Update from 0.84 to 0.84.1 * * @return bool for success (will die for most error) **/ function update084to0841() { global $DB, $migration; $updateresult = true; $ADDTODISPLAYPREF = array(); //TRANS: %s is the number of new version $migration->displayTitle(sprintf(__('Update to %s'), '0.84.1')); $migration->setVersion('0.84.1'); $backup_tables = false; $newtables = array(); foreach ($newtables as $new_table) { // rename new tables if exists ? if (TableExists($new_table)) { $migration->dropTable("backup_$new_table"); $migration->displayWarning("$new_table table already exists. ". "A backup have been done to backup_$new_table."); $backup_tables = true; $query = $migration->renameTable("$new_table", "backup_$new_table"); } } if ($backup_tables) { $migration->displayWarning("You can delete backup tables if you have no need of them.", true); } // Convert html fields from numeric encoding to raw encoding $fields_to_clean = array('glpi_knowbaseitems' => 'answer', 'glpi_tickets' => 'solution', 'glpi_problems' => 'solution', 'glpi_reminders' => 'text', 'glpi_solutiontemplates' => 'content', 'glpi_notificationtemplatetranslations' => 'content_text'); foreach ($fields_to_clean as $table => $field) { foreach ($DB->request($table) as $data) { $text = Toolbox::unclean_html_cross_side_scripting_deep($data[$field]); $text = html_entity_decode($text,ENT_NOQUOTES,'UTF-8'); $text = addslashes($text); $text = Toolbox::clean_cross_side_scripting_deep($text); $query = "UPDATE `$table` SET `$field` = '$text' WHERE `id` = '".$data['id']."';"; $DB->queryOrDie($query, "0.84.1 fix encoding of html field : $table.$field"); } } // Add date_mod to document_item $migration->addField('glpi_documents_items', 'date_mod', 'datetime'); $migration->migrationOneTable('glpi_documents_items'); $query_doc_i = "UPDATE `glpi_documents_items` as `doc_i` INNER JOIN `glpi_documents` as `doc` ON `doc`.`id` = `doc_i`.`documents_id` SET `doc_i`.`date_mod` = `doc`.`date_mod`"; $DB->queryOrDie($query_doc_i, "0.84.1 update date_mod in glpi_documents_items"); // correct entities_id in documents_items $query_doc_i = "UPDATE `glpi_documents_items` as `doc_i` INNER JOIN `glpi_documents` as `doc` ON `doc`.`id` = `doc_i`.`documents_id` SET `doc_i`.`entities_id` = `doc`.`entities_id`, `doc_i`.`is_recursive` = `doc`.`is_recursive`"; $DB->queryOrDie($query_doc_i, "0.84.1 change entities_id in documents_items"); // add delet_problem $migration->addField('glpi_profiles', 'delete_problem', 'char', array('after' => 'edit_all_problem', 'update' => 'edit_all_problem')); // ************ Keep it at the end ************** //TRANS: %s is the table or item to migrate $migration->displayMessage(sprintf(__('Data migration - %s'), 'glpi_displaypreferences')); foreach ($ADDTODISPLAYPREF as $type => $tab) { $query = "SELECT DISTINCT `users_id` FROM `glpi_displaypreferences` WHERE `itemtype` = '$type'"; if ($result = $DB->query($query)) { if ($DB->numrows($result)>0) { while ($data = $DB->fetch_assoc($result)) { $query = "SELECT MAX(`rank`) FROM `glpi_displaypreferences` WHERE `users_id` = '".$data['users_id']."' AND `itemtype` = '$type'"; $result = $DB->query($query); $rank = $DB->result($result,0,0); $rank++; foreach ($tab as $newval) { $query = "SELECT * FROM `glpi_displaypreferences` WHERE `users_id` = '".$data['users_id']."' AND `num` = '$newval' AND `itemtype` = '$type'"; if ($result2=$DB->query($query)) { if ($DB->numrows($result2)==0) { $query = "INSERT INTO `glpi_displaypreferences` (`itemtype` ,`num` ,`rank` ,`users_id`) VALUES ('$type', '$newval', '".$rank++."', '".$data['users_id']."')"; $DB->query($query); } } } } } else { // Add for default user $rank = 1; foreach ($tab as $newval) { $query = "INSERT INTO `glpi_displaypreferences` (`itemtype` ,`num` ,`rank` ,`users_id`) VALUES ('$type', '$newval', '".$rank++."', '0')"; $DB->query($query); } } } } // must always be at the end $migration->executeMigration(); return $updateresult; } ?>glpi-0.84.3+dfsg.1/install/update_content.php000066400000000000000000000263711226600447100210250ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ //#################### INCLUDE & SESSIONS ############################ define('GLPI_ROOT', realpath('..')); // Do not include config.php so set root_doc $CFG_GLPI['root_doc'] = '..'; include_once (GLPI_ROOT . "/config/define.php"); include_once (GLPI_ROOT . "/inc/autoload.function.php"); include_once (GLPI_ROOT . "/inc/db.function.php"); include_once (GLPI_ROOT . "/config/based_config.php"); include_once (GLPI_CONFIG_DIR . "/config_db.php"); Session::setPath(); Session::start(); // Init debug variable Toolbox::setDebugMode(Session::DEBUG_MODE, 0, 0, 1); //################################ Functions ################################ $max_time = min(get_cfg_var("max_execution_time"), get_cfg_var("max_input_time")); if ($max_time>5) { $defaulttimeout = $max_time-2; $defaultrowlimit = 1; } else { $defaulttimeout = 1; $defaultrowlimit = 1; } $DB = new DB(); function init_time() { global $TPSDEB, $TPSCOUR; list ($usec, $sec) = explode(" ", microtime()); $TPSDEB = $sec; $TPSCOUR = 0; } function current_time() { global $TPSDEB,$TPSCOUR; list ($usec, $sec) = explode(" ", microtime()); $TPSFIN = $sec; if (round($TPSFIN-$TPSDEB,1)>=$TPSCOUR+1) {//une seconde de plus $TPSCOUR = round($TPSFIN-$TPSDEB, 1); } } function get_update_content($DB, $table, $from, $limit, $conv_utf8) { $content = ""; $DB->query("SET NAMES latin1"); $result = $DB->query("SELECT * FROM `$table` LIMIT $from, $limit"); if ($result) { while ($row = $DB->fetch_assoc($result)) { if (isset($row["id"])) { $insert = "UPDATE `$table` SET "; foreach ($row as $key => $val) { $insert .= " `".$key."` = "; if (!isset($val)) { $insert .= "NULL,"; } else if ($val != "") { if ($conv_utf8) { // Gestion users AD qui sont deja en UTF8 if ($table!="glpi_users" || !Toolbox::seems_utf8($val)) { $val = Toolbox::encodeInUtf8($val); } } $insert .= "'".addslashes($val)."',"; } else { $insert .= "'',"; } } $insert = preg_replace("/,$/","",$insert); $insert .=" WHERE `id` = '".$row["id"]."' "; $insert .= ";\n"; $content .= $insert; } } } return $content; } function UpdateContent($DB, $duree, $rowlimit, $conv_utf8, $complete_utf8) { global $TPSCOUR, $offsettable, $offsetrow, $cpt; // $dumpFile, fichier source // $database, nom de la base de données cible // $mysqlUser, login pouyr la connexion au serveur MySql // $mysqlPassword, mot de passe // $histMySql, nom de la machine serveur MySQl // $duree=timeout pour changement de page (-1 = aucun) $result = $DB->list_tables(); $numtab = 0; while ($t=$DB->fetch_row($result)) { $tables[$numtab] = $t[0]; $numtab++; } for ( ; $offsettable<$numtab ; $offsettable++) { // Dump de la structyre table if ($offsetrow==-1) { if ($complete_utf8) { $DB->query("ALTER TABLE `".$tables[$offsettable]."` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci"); $data = $DB->list_fields($tables[$offsettable]); foreach ($data as $key =>$val) { if (preg_match("/^char/i", $val["Type"])) { $default = "NULL"; if (!empty($val["Default"]) && !is_null($val["Default"])) { $default = "'".$val["Default"]."'"; } $DB->query("ALTER TABLE `".$tables[$offsettable]."` CHANGE `".$val["Field"]."` `".$val["Field"]."` ".$val["Type"]." CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT $default"); } else if (preg_match("/^varchar/i", $val["Type"])) { $default = "NULL"; if (!empty($val["Default"]) && !is_null($val["Default"])) { $default = "'".$val["Default"]."'"; } $DB->query("ALTER TABLE `".$tables[$offsettable]."` CHANGE `".$val["Field"]."` `".$val["Field"]."` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT $default"); } else if (preg_match("/^longtext/i", $val["Type"])) { $DB->query("ALTER TABLE `".$tables[$offsettable]."` CHANGE `".$val["Field"]."` `".$val["Field"]."` LONGTEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL"); } else if (preg_match("/^text/i", $val["Type"])) { $DB->query("ALTER TABLE `".$tables[$offsettable]."` CHANGE `".$val["Field"]."` `".$val["Field"]."` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL"); } } } $offsetrow++; $cpt++; } current_time(); if ($duree>0 && $TPSCOUR>=$duree) {//on atteint la fin du temps imparti return TRUE; } $fin = 0; while (!$fin) { $todump = get_update_content($DB, $tables[$offsettable], $offsetrow, $rowlimit, $conv_utf8); $rowtodump = substr_count($todump, "UPDATE "); if ($rowtodump>0) { $DB->query("SET NAMES utf8"); $result = $DB->query($todump); $cpt += $rowtodump; $offsetrow += $rowlimit; if ($rowtodump<$rowlimit) { $fin = 1; } current_time(); if ($duree>0 && $TPSCOUR>=$duree) {//on atteint la fin du temps imparti return TRUE; } } else { $fin = 1; $offsetrow = -1; } } if ($fin) { $offsetrow = -1; } current_time(); if ($duree>0 && $TPSCOUR>=$duree) {//on atteint la fin du temps imparti return TRUE; } } if ($DB->error()) { echo "
    "; printf(__("Mysql error starting from %s"),"[$formattedQuery]"); echo "
    ".$DB->error()."
    "; } $offsettable = -1; return TRUE; } //########################### Script start ################################ Session::loadLanguage(); // Send UTF8 Headers header("Content-Type: text/html; charset=UTF-8"); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "Setup GLPI"; // CSS echo ""; echo ""; echo ""; echo "
    "; echo "
    "; echo "
    "; echo "

    GLPI SETUP

    "; //end style and co // #################" UPDATE CONTENT ################################# $time_file = date("Y-m-d-h-i"); $cur_time = date("Y-m-d H:i"); init_time(); //initialise le temps //debut de fichier if (!isset($_GET["offsettable"])) { $offsettable = 0; } else { $offsettable = $_GET["offsettable"]; } //debut de fichier if (!isset($_GET["offsetrow"])) { $offsetrow = -1; } else { $offsetrow = $_GET["offsetrow"]; } //timeout de 5 secondes par defaut, -1 pour utiliser sans timeout if (!isset($_GET["duree"])) { $duree = $defaulttimeout; } else { $duree = $_GET["duree"]; } //Limite de lignes a dumper a chaque fois if (!isset($_GET["rowlimit"])) { $rowlimit = $defaultrowlimit; } else { $rowlimit = $_GET["rowlimit"]; } $tab = $DB->list_tables(); $tot = $DB->numrows($tab); if (isset($offsettable)) { if ($offsettable>=0) { $percent = min(100,round(100*$offsettable/$tot,0)); } else { $percent = 100; } } else { $percent = 0; } $conv_utf8 = false; $complete_utf8 = true; $config_table = "glpi_config"; if (TableExists("glpi_configs")) { $config_table = "glpi_configs"; } if (!FieldExists($config_table,"utf8_conv", false)) { $conv_utf8 = true; } else { $query = "SELECT `utf8_conv` FROM `$config_table` WHERE `id` = '1'"; $result = $DB->query($query); $data = $DB->fetch_assoc($result); if ($data["utf8_conv"]) { $complete_utf8 = false; } } if ($offsettable>=0 && $complete_utf8) { if ($percent >= 0) { Html::displayProgressBar(400, $percent); echo "
    "; Html::glpi_flush(); } if (UpdateContent($DB,$duree,$rowlimit,$conv_utf8,$complete_utf8)) { echo "
    ". __('Automatic redirection, else click').""; echo ""; Html::glpi_flush(); exit; } } else { echo "

    ".__('Use GLPI')."

    "; echo ""; } if ($conv_utf8) { $query = "ALTER TABLE `$config_table` ADD `utf8_conv` INT( 11 ) DEFAULT '0' NOT NULL"; $DB->queryOrDie($query, " 0.6 add utf8_conv to $config_table"); } if ($complete_utf8) { $DB->query("ALTER DATABASE `".$DB->dbdefault."` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci"); $DB->query("UPDATE `$config_table` SET `utf8_conv` = '1' WHERE `id` = '1'"); } ?> glpi-0.84.3+dfsg.1/install/update_to_031.php000066400000000000000000000064431226600447100203560ustar00rootroot00000000000000. -------------------------------------------------------------------------- */ /** @file * @brief */ ///update the database to the 0.31 version function updateDbTo031() { global $DB; //amSize ramSize $query = "ALTER TABLE `users` DROP `can_assign_job`"; $DB->queryOrDie($query); $query = "ALTER TABLE `users` ADD `can_assign_job enum('yes','no')` NOT NULL DEFAULT 'no'"; $DB->queryOrDie($query); $query = "UPDATE `users` SET `can_assign_job` = 'yes' WHERE `type` = 'admin'"; $DB->queryOrDie($query); echo "

    Version 0.2 & <

    "; //Version 0.21 ajout du champ ramSize a la table printers si non existant. if (!FieldExists("printers", "ramSize", false)) { $query = "ALTER TABLE `printers` ADD `ramSize` varchar(6) NOT NULL default ''"; $DB->queryOrDie($query); } echo "

    Version 0.21

    "; //Version 0.3 //Ajout de NOT NULL et des valeurs par defaut. $query = "ALTER TABLE `computers` MODIFY `achat_date` `date` NOT NULL default '0000-00-00'"; $DB->queryOrDie($query); $query = "ALTER TABLE `computers` MODIFY `date_fin_garantie` `date` NOT NULL default '0000-00-00'"; $query = "ALTER TABLE `monitors` MODIFY `achat_date` `date` NOT NULL default '0000-00-00'"; $DB->queryOrDie($query); $query = "ALTER TABLE `monitors` MODIFY `date_fin_garantie` `date` NOT NULL default '0000-00-00'"; $query = "ALTER TABLE `networking` MODIFY `achat_date` `date` NOT NULL default '0000-00-00'"; $DB->queryOrDie($query); $query = "ALTER TABLE `networking` MODIFY `date_fin_garantie` `date` NOT NULL default '0000-00-00'"; $query = "ALTER TABLE `printers` MODIFY `achat_date` `date` NOT NULL default '0000-00-00'"; $DB->queryOrDie($query); $query = "ALTER TABLE `printers` MODIFY `date_fin_garantie` `date` NOT NULL default '0000-00-00'"; $query = "ALTER TABLE `templates` MODIFY `achat_date` `date` NOT NULL default '0000-00-00'"; $DB->queryOrDie($query); $query = "ALTER TABLE `templates` MODIFY `date_fin_garantie` `date` NOT NULL default '0000-00-00'"; echo "

    Version 0.3

    "; } ?>glpi-0.84.3+dfsg.1/lib/000077500000000000000000000000001226600447100143675ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/Zend/000077500000000000000000000000001226600447100152675ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/Zend/Cache/000077500000000000000000000000001226600447100162725ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/Zend/Cache/Exception/000077500000000000000000000000001226600447100202305ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/Zend/Cache/Exception/BadMethodCallException.php000066400000000000000000000010111226600447100252340ustar00rootroot00000000000000options = $options; return $this; } /** * Get all pattern options * * @return PatternOptions */ public function getOptions() { if (null === $this->options) { $this->setOptions(new PatternOptions()); } return $this->options; } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Pattern/CallbackCache.php000066400000000000000000000142101226600447100230360ustar00rootroot00000000000000getStorage()) { throw new Exception\InvalidArgumentException("Missing option 'storage'"); } return $this; } /** * Call the specified callback or get the result from cache * * @param callable $callback A valid callback * @param array $args Callback arguments * @return mixed Result * @throws Exception\RuntimeException if invalid cached data * @throws \Exception */ public function call($callback, array $args = array()) { $options = $this->getOptions(); $storage = $options->getStorage(); $success = null; $key = $this->generateCallbackKey($callback, $args); $result = $storage->getItem($key, $success); if ($success) { if (!isset($result[0])) { throw new Exception\RuntimeException("Invalid cached data for key '{$key}'"); } echo isset($result[1]) ? $result[1] : ''; return $result[0]; } $cacheOutput = $options->getCacheOutput(); if ($cacheOutput) { ob_start(); ob_implicit_flush(false); } // TODO: do not cache on errors using [set|restore]_error_handler try { if ($args) { $ret = call_user_func_array($callback, $args); } else { $ret = call_user_func($callback); } } catch (\Exception $e) { if ($cacheOutput) { ob_end_flush(); } throw $e; } if ($cacheOutput) { $data = array($ret, ob_get_flush()); } else { $data = array($ret); } $storage->setItem($key, $data); return $ret; } /** * function call handler * * @param string $function Function name to call * @param array $args Function arguments * @return mixed * @throws Exception\RuntimeException * @throws \Exception */ public function __call($function, array $args) { return $this->call($function, $args); } /** * Generate a unique key in base of a key representing the callback part * and a key representing the arguments part. * * @param callable $callback A valid callback * @param array $args Callback arguments * @return string * @throws Exception\RuntimeException * @throws Exception\InvalidArgumentException */ public function generateKey($callback, array $args = array()) { return $this->generateCallbackKey($callback, $args); } /** * Generate a unique key in base of a key representing the callback part * and a key representing the arguments part. * * @param callable $callback A valid callback * @param array $args Callback arguments * @throws Exception\RuntimeException if callback not serializable * @throws Exception\InvalidArgumentException if invalid callback * @return string */ protected function generateCallbackKey($callback, array $args) { if (!is_callable($callback, false, $callbackKey)) { throw new Exception\InvalidArgumentException('Invalid callback'); } // functions, methods and classnames are case-insensitive $callbackKey = strtolower($callbackKey); // generate a unique key of object callbacks if (is_object($callback)) { // Closures & __invoke $object = $callback; } elseif (isset($callback[0])) { // array($object, 'method') $object = $callback[0]; } if (isset($object)) { ErrorHandler::start(); try { $serializedObject = serialize($object); } catch (\Exception $e) { ErrorHandler::stop(); throw new Exception\RuntimeException( "Can't serialize callback: see previous exception", 0, $e ); } $error = ErrorHandler::stop(); if (!$serializedObject) { throw new Exception\RuntimeException(sprintf( 'Cannot serialize callback%s', ($error ? ': ' . $error->getMessage() : '') ), 0, $error); } $callbackKey.= $serializedObject; } return md5($callbackKey) . $this->generateArgumentsKey($args); } /** * Generate a unique key of the argument part. * * @param array $args * @throws Exception\RuntimeException * @return string */ protected function generateArgumentsKey(array $args) { if (!$args) { return ''; } ErrorHandler::start(); try { $serializedArgs = serialize(array_values($args)); } catch (\Exception $e) { ErrorHandler::stop(); throw new Exception\RuntimeException( "Can't serialize arguments: see previous exception" , 0, $e); } $error = ErrorHandler::stop(); if (!$serializedArgs) { throw new Exception\RuntimeException(sprintf( 'Cannot serialize arguments%s', ($error ? ': ' . $error->getMessage() : '') ), 0, $error); } return md5($serializedArgs); } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Pattern/CaptureCache.php000066400000000000000000000257551226600447100227650ustar00rootroot00000000000000detectPageId(); } $that = $this; ob_start(function ($content) use ($that, $pageId) { $that->set($content, $pageId); // http://php.net/manual/function.ob-start.php // -> If output_callback returns FALSE original input is sent to the browser. return false; }); ob_implicit_flush(false); } /** * Write content to page identity * * @param string $content * @param null|string $pageId * @throws Exception\LogicException */ public function set($content, $pageId = null) { $publicDir = $this->getOptions()->getPublicDir(); if ($publicDir === null) { throw new Exception\LogicException("Option 'public_dir' no set"); } if ($pageId === null) { $pageId = $this->detectPageId(); } $path = $this->pageId2Path($pageId); $file = $path . \DIRECTORY_SEPARATOR . $this->pageId2Filename($pageId); $this->createDirectoryStructure($publicDir . \DIRECTORY_SEPARATOR . $path); $this->putFileContent($publicDir . \DIRECTORY_SEPARATOR . $file, $content); } /** * Get from cache * * @param null|string $pageId * @return bool|string * @throws Exception\LogicException * @throws Exception\RuntimeException */ public function get($pageId = null) { $publicDir = $this->getOptions()->getPublicDir(); if ($publicDir === null) { throw new Exception\LogicException("Option 'public_dir' no set"); } if ($pageId === null) { $pageId = $this->detectPageId(); } $file = $publicDir . \DIRECTORY_SEPARATOR . $this->pageId2Path($pageId) . \DIRECTORY_SEPARATOR . $this->pageId2Filename($pageId); if (file_exists($file)) { ErrorHandler::start(); $content = file_get_contents($file); $error = ErrorHandler::stop(); if ($content === false) { throw new Exception\RuntimeException( "Failed to read cached pageId '{$pageId}'", 0, $error ); } return $content; } } /** * Checks if a cache with given id exists * * @param null|string $pageId * @throws Exception\LogicException * @return boolean */ public function has($pageId = null) { $publicDir = $this->getOptions()->getPublicDir(); if ($publicDir === null) { throw new Exception\LogicException("Option 'public_dir' no set"); } if ($pageId === null) { $pageId = $this->detectPageId(); } $file = $publicDir . \DIRECTORY_SEPARATOR . $this->pageId2Path($pageId) . \DIRECTORY_SEPARATOR . $this->pageId2Filename($pageId); return file_exists($file); } /** * Remove from cache * * @param null|string $pageId * @throws Exception\LogicException * @throws Exception\RuntimeException * @return boolean */ public function remove($pageId = null) { $publicDir = $this->getOptions()->getPublicDir(); if ($publicDir === null) { throw new Exception\LogicException("Option 'public_dir' no set"); } if ($pageId === null) { $pageId = $this->detectPageId(); } $file = $publicDir . \DIRECTORY_SEPARATOR . $this->pageId2Path($pageId) . \DIRECTORY_SEPARATOR . $this->pageId2Filename($pageId); if (file_exists($file)) { ErrorHandler::start(); $res = unlink($file); $err = ErrorHandler::stop(); if (!$res) { throw new Exception\RuntimeException( "Failed to remove cached pageId '{$pageId}'", 0, $err ); } return true; } return false; } /** * Clear cached pages matching glob pattern * * @param string $pattern * @throws Exception\LogicException */ public function clearByGlob($pattern = '**') { $publicDir = $this->getOptions()->getPublicDir(); if ($publicDir === null) { throw new Exception\LogicException("Option 'public_dir' no set"); } $it = new \GlobIterator( $publicDir . '/' . $pattern, \GlobIterator::CURRENT_AS_SELF | \GlobIterator::SKIP_DOTS | \GlobIterator::UNIX_PATHS ); foreach ($it as $pathname => $entry) { if ($entry->isFile()) { unlink($pathname); } } } /** * Determine the page to save from the request * * @throws Exception\RuntimeException * @return string */ protected function detectPageId() { if (!isset($_SERVER['REQUEST_URI'])) { throw new Exception\RuntimeException("Can't auto-detect current page identity"); } return $_SERVER['REQUEST_URI']; } /** * Get filename for page id * * @param string $pageId * @return string */ protected function pageId2Filename($pageId) { if (substr($pageId, -1) === '/') { return $this->getOptions()->getIndexFilename(); } return basename($pageId); } /** * Get path for page id * * @param string $pageId * @return string */ protected function pageId2Path($pageId) { if (substr($pageId, -1) == '/') { $path = rtrim($pageId, '/'); } else { $path = dirname($pageId); } // convert requested "/" to the valid local directory separator if ('/' != \DIRECTORY_SEPARATOR) { $path = str_replace('/', \DIRECTORY_SEPARATOR, $path); } return $path; } /** * Write content to a file * * @param string $file File complete path * @param string $data Data to write * @return void * @throws Exception\RuntimeException */ protected function putFileContent($file, $data) { $options = $this->getOptions(); $locking = $options->getFileLocking(); $perm = $options->getFilePermission(); $umask = $options->getUmask(); if ($umask !== false && $perm !== false) { $perm = $perm & ~$umask; } ErrorHandler::start(); $umask = ($umask !== false) ? umask($umask) : false; $rs = file_put_contents($file, $data, $locking ? \LOCK_EX : 0); if ($umask) { umask($umask); } if ($rs === false) { $err = ErrorHandler::stop(); throw new Exception\RuntimeException( "Error writing file '{$file}'", 0, $err ); } if ($perm !== false && !chmod($file, $perm)) { $oct = decoct($perm); $err = ErrorHandler::stop(); throw new Exception\RuntimeException("chmod('{$file}', 0{$oct}) failed", 0, $err); } ErrorHandler::stop(); } /** * Creates directory if not already done. * * @param string $pathname * @return void * @throws Exception\RuntimeException */ protected function createDirectoryStructure($pathname) { // Directory structure already exists if (file_exists($pathname)) { return; } $options = $this->getOptions(); $perm = $options->getDirPermission(); $umask = $options->getUmask(); if ($umask !== false && $perm !== false) { $perm = $perm & ~$umask; } ErrorHandler::start(); if ($perm === false) { // build-in mkdir function is enough $umask = ($umask !== false) ? umask($umask) : false; $res = mkdir($pathname, ($perm !== false) ? $perm : 0777, true); if ($umask !== false) { umask($umask); } if (!$res) { $oct = ($perm === false) ? '777' : decoct($perm); $err = ErrorHandler::stop(); throw new Exception\RuntimeException( "mkdir('{$pathname}', 0{$oct}, true) failed", 0, $err ); } if ($perm !== false && !chmod($pathname, $perm)) { $oct = decoct($perm); $err = ErrorHandler::stop(); throw new Exception\RuntimeException( "chmod('{$pathname}', 0{$oct}) failed", 0, $err ); } } else { // build-in mkdir function sets permission together with current umask // which doesn't work well on multo threaded webservers // -> create directories one by one and set permissions // find existing path and missing path parts $parts = array(); $path = $pathname; while (!file_exists($path)) { array_unshift($parts, basename($path)); $nextPath = dirname($path); if ($nextPath === $path) { break; } $path = $nextPath; } // make all missing path parts foreach ($parts as $part) { $path.= \DIRECTORY_SEPARATOR . $part; // create a single directory, set and reset umask immediately $umask = ($umask !== false) ? umask($umask) : false; $res = mkdir($path, ($perm === false) ? 0777 : $perm, false); if ($umask !== false) { umask($umask); } if (!$res) { $oct = ($perm === false) ? '777' : decoct($perm); $err = ErrorHandler::stop(); throw new Exception\RuntimeException( "mkdir('{$path}', 0{$oct}, false) failed" ); } if ($perm !== false && !chmod($path, $perm)) { $oct = decoct($perm); $err = ErrorHandler::stop(); throw new Exception\RuntimeException( "chmod('{$path}', 0{$oct}) failed" ); } } } ErrorHandler::stop(); } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Pattern/ClassCache.php000066400000000000000000000111261226600447100224120ustar00rootroot00000000000000getClass()) { throw new Exception\InvalidArgumentException("Missing option 'class'"); } elseif (!$options->getStorage()) { throw new Exception\InvalidArgumentException("Missing option 'storage'"); } return $this; } /** * Call and cache a class method * * @param string $method Method name to call * @param array $args Method arguments * @return mixed * @throws Exception\RuntimeException * @throws \Exception */ public function call($method, array $args = array()) { $options = $this->getOptions(); $classname = $options->getClass(); $method = strtolower($method); $callback = $classname . '::' . $method; $cache = $options->getCacheByDefault(); if ($cache) { $cache = !in_array($method, $options->getClassNonCacheMethods()); } else { $cache = in_array($method, $options->getClassCacheMethods()); } if (!$cache) { if ($args) { return call_user_func_array($callback, $args); } else { return $classname::$method(); } } return parent::call($callback, $args); } /** * Generate a unique key in base of a key representing the callback part * and a key representing the arguments part. * * @param string $method The method * @param array $args Callback arguments * @return string * @throws Exception\RuntimeException */ public function generateKey($method, array $args = array()) { return $this->generateCallbackKey( $this->getOptions()->getClass() . '::' . $method, $args ); } /** * Generate a unique key in base of a key representing the callback part * and a key representing the arguments part. * * @param callable $callback A valid callback * @param array $args Callback arguments * @return string * @throws Exception\RuntimeException */ protected function generateCallbackKey($callback, array $args) { $callbackKey = md5(strtolower($callback)); $argumentKey = $this->generateArgumentsKey($args); return $callbackKey . $argumentKey; } /** * Calling a method of the entity. * * @param string $method Method name to call * @param array $args Method arguments * @return mixed * @throws Exception\RuntimeException * @throws \Exception */ public function __call($method, array $args) { return $this->call($method, $args); } /** * Set a static property * * @param string $name * @param mixed $value * @return void * @see http://php.net/manual/language.oop5.overloading.php#language.oop5.overloading.members */ public function __set($name, $value) { $class = $this->getOptions()->getClass(); $class::$name = $value; } /** * Get a static property * * @param string $name * @return mixed * @see http://php.net/manual/language.oop5.overloading.php#language.oop5.overloading.members */ public function __get($name) { $class = $this->getOptions()->getClass(); return $class::$name; } /** * Is a static property exists. * * @param string $name * @return bool */ public function __isset($name) { $class = $this->getOptions()->getClass(); return isset($class::$name); } /** * Unset a static property * * @param string $name * @return void */ public function __unset($name) { $class = $this->getOptions()->getClass(); unset($class::$name); } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Pattern/ObjectCache.php000066400000000000000000000217531226600447100225620ustar00rootroot00000000000000getObject()) { throw new Exception\InvalidArgumentException("Missing option 'object'"); } elseif (!$options->getStorage()) { throw new Exception\InvalidArgumentException("Missing option 'storage'"); } } /** * Call and cache a class method * * @param string $method Method name to call * @param array $args Method arguments * @return mixed * @throws Exception\RuntimeException * @throws \Exception */ public function call($method, array $args = array()) { $options = $this->getOptions(); $object = $options->getObject(); $method = strtolower($method); // handle magic methods switch ($method) { case '__set': $property = array_shift($args); $value = array_shift($args); $object->{$property} = $value; if (!$options->getObjectCacheMagicProperties() || property_exists($object, $property) ) { // no caching if property isn't magic // or caching magic properties is disabled return; } // remove cached __get and __isset $removeKeys = null; if (method_exists($object, '__get')) { $removeKeys[] = $this->generateKey('__get', array($property)); } if (method_exists($object, '__isset')) { $removeKeys[] = $this->generateKey('__isset', array($property)); } if ($removeKeys) { $options->getStorage()->removeItems($removeKeys); } return; case '__get': $property = array_shift($args); if (!$options->getObjectCacheMagicProperties() || property_exists($object, $property) ) { // no caching if property isn't magic // or caching magic properties is disabled return $object->{$property}; } array_unshift($args, $property); return parent::call(array($object, '__get'), $args); case '__isset': $property = array_shift($args); if (!$options->getObjectCacheMagicProperties() || property_exists($object, $property) ) { // no caching if property isn't magic // or caching magic properties is disabled return isset($object->{$property}); } return parent::call(array($object, '__isset'), array($property)); case '__unset': $property = array_shift($args); unset($object->{$property}); if (!$options->getObjectCacheMagicProperties() || property_exists($object, $property) ) { // no caching if property isn't magic // or caching magic properties is disabled return; } // remove previous cached __get and __isset calls $removeKeys = null; if (method_exists($object, '__get')) { $removeKeys[] = $this->generateKey('__get', array($property)); } if (method_exists($object, '__isset')) { $removeKeys[] = $this->generateKey('__isset', array($property)); } if ($removeKeys) { $options->getStorage()->removeItems($removeKeys); } return; } $cache = $options->getCacheByDefault(); if ($cache) { $cache = !in_array($method, $options->getObjectNonCacheMethods()); } else { $cache = in_array($method, $options->getObjectCacheMethods()); } if (!$cache) { if ($args) { return call_user_func_array(array($object, $method), $args); } return $object->{$method}(); } return parent::call(array($object, $method), $args); } /** * Generate a unique key in base of a key representing the callback part * and a key representing the arguments part. * * @param string $method The method * @param array $args Callback arguments * @return string * @throws Exception\RuntimeException */ public function generateKey($method, array $args = array()) { return $this->generateCallbackKey( array($this->getOptions()->getObject(), $method), $args ); } /** * Generate a unique key in base of a key representing the callback part * and a key representing the arguments part. * * @param callable $callback A valid callback * @param array $args Callback arguments * @return string * @throws Exception\RuntimeException */ protected function generateCallbackKey($callback, array $args = array()) { $callbackKey = md5($this->getOptions()->getObjectKey() . '::' . strtolower($callback[1])); $argumentKey = $this->generateArgumentsKey($args); return $callbackKey . $argumentKey; } /** * Class method call handler * * @param string $method Method name to call * @param array $args Method arguments * @return mixed * @throws Exception\RuntimeException * @throws \Exception */ public function __call($method, array $args) { return $this->call($method, $args); } /** * Writing data to properties. * * NOTE: * Magic properties will be cached too if the option cacheMagicProperties * is enabled and the property doesn't exist in real. If so it calls __set * and removes cached data of previous __get and __isset calls. * * @param string $name * @param mixed $value * @return void * @see http://php.net/manual/language.oop5.overloading.php#language.oop5.overloading.members */ public function __set($name, $value) { return $this->call('__set', array($name, $value)); } /** * Reading data from properties. * * NOTE: * Magic properties will be cached too if the option cacheMagicProperties * is enabled and the property doesn't exist in real. If so it calls __get. * * @param string $name * @return mixed * @see http://php.net/manual/language.oop5.overloading.php#language.oop5.overloading.members */ public function __get($name) { return $this->call('__get', array($name)); } /** * Checking existing properties. * * NOTE: * Magic properties will be cached too if the option cacheMagicProperties * is enabled and the property doesn't exist in real. If so it calls __get. * * @param string $name * @return bool * @see http://php.net/manual/language.oop5.overloading.php#language.oop5.overloading.members */ public function __isset($name) { return $this->call('__isset', array($name)); } /** * Unseting a property. * * NOTE: * Magic properties will be cached too if the option cacheMagicProperties * is enabled and the property doesn't exist in real. If so it removes * previous cached __isset and __get calls. * * @param string $name * @return void * @see http://php.net/manual/language.oop5.overloading.php#language.oop5.overloading.members */ public function __unset($name) { return $this->call('__unset', array($name)); } /** * Handle casting to string * * @return string * @see http://php.net/manual/language.oop5.magic.php#language.oop5.magic.tostring */ public function __toString() { return $this->call('__toString'); } /** * Handle invoke calls * * @return mixed * @see http://php.net/manual/language.oop5.magic.php#language.oop5.magic.invoke */ public function __invoke() { return $this->call('__invoke', func_get_args()); } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Pattern/OutputCache.php000066400000000000000000000050331226600447100226450ustar00rootroot00000000000000getStorage()) { throw new Exception\InvalidArgumentException("Missing option 'storage'"); } return $this; } /** * if there is a cached item with the given key display it's data and return true * else start buffering output until end() is called or the script ends. * * @param string $key Key * @throws Exception\MissingKeyException if key is missing * @return boolean */ public function start($key) { if (($key = (string) $key) === '') { throw new Exception\MissingKeyException('Missing key to read/write output from cache'); } $success = null; $data = $this->getOptions()->getStorage()->getItem($key, $success); if ($success) { echo $data; return true; } ob_start(); ob_implicit_flush(false); $this->keyStack[] = $key; return false; } /** * Stops buffering output, write buffered data to cache using the given key on start() * and displays the buffer. * * @throws Exception\RuntimeException if output cache not started or buffering not active * @return boolean TRUE on success, FALSE on failure writing to cache */ public function end() { $key = array_pop($this->keyStack); if ($key === null) { throw new Exception\RuntimeException('Output cache not started'); } $output = ob_get_flush(); if ($output === false) { throw new Exception\RuntimeException('Output buffering not active'); } return $this->getOptions()->getStorage()->setItem($key, $output); } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Pattern/PatternInterface.php000066400000000000000000000013721226600447100236610ustar00rootroot00000000000000filePermission = false; $this->dirPermission = false; } parent::__construct($options); } /** * Set flag indicating whether or not to cache by default * * Used by: * - ClassCache * - ObjectCache * * @param bool $cacheByDefault * @return PatternOptions */ public function setCacheByDefault($cacheByDefault) { $this->cacheByDefault = $cacheByDefault; return $this; } /** * Do we cache by default? * * Used by: * - ClassCache * - ObjectCache * * @return bool */ public function getCacheByDefault() { return $this->cacheByDefault; } /** * Set whether or not to cache output * * Used by: * - CallbackCache * - ClassCache * - ObjectCache * * @param bool $cacheOutput * @return PatternOptions */ public function setCacheOutput($cacheOutput) { $this->cacheOutput = (bool) $cacheOutput; return $this; } /** * Will we cache output? * * Used by: * - CallbackCache * - ClassCache * - ObjectCache * * @return bool */ public function getCacheOutput() { return $this->cacheOutput; } /** * Set class name * * Used by: * - ClassCache * * @param string $class * @throws Exception\InvalidArgumentException * @return PatternOptions */ public function setClass($class) { if (!is_string($class)) { throw new Exception\InvalidArgumentException('Invalid classname provided; must be a string'); } $this->class = $class; return $this; } /** * Get class name * * Used by: * - ClassCache * * @return null|string */ public function getClass() { return $this->class; } /** * Set list of method return values to cache * * Used by: * - ClassCache * * @param array $classCacheMethods * @return PatternOptions */ public function setClassCacheMethods(array $classCacheMethods) { $this->classCacheMethods = $this->recursiveStrtolower($classCacheMethods); return $this; } /** * Get list of methods from which to cache return values * * Used by: * - ClassCache * * @return array */ public function getClassCacheMethods() { return $this->classCacheMethods; } /** * Set list of method return values NOT to cache * * Used by: * - ClassCache * * @param array $classNonCacheMethods * @return PatternOptions */ public function setClassNonCacheMethods(array $classNonCacheMethods) { $this->classNonCacheMethods = $this->recursiveStrtolower($classNonCacheMethods); return $this; } /** * Get list of methods from which NOT to cache return values * * Used by: * - ClassCache * * @return array */ public function getClassNonCacheMethods() { return $this->classNonCacheMethods; } /** * Set directory permission * * @param false|int $dirPermission * @throws Exception\InvalidArgumentException * @return PatternOptions */ public function setDirPermission($dirPermission) { if ($dirPermission !== false) { if (is_string($dirPermission)) { $dirPermission = octdec($dirPermission); } else { $dirPermission = (int) $dirPermission; } // validate if (($dirPermission & 0700) != 0700) { throw new Exception\InvalidArgumentException( 'Invalid directory permission: need permission to execute, read and write by owner' ); } } $this->dirPermission = $dirPermission; return $this; } /** * Gets directory permission * * @return false|int */ public function getDirPermission() { return $this->dirPermission; } /** * Set umask * * Used by: * - CaptureCache * * @param false|int $umask * @throws Exception\InvalidArgumentException * @return PatternOptions */ public function setUmask($umask) { if ($umask !== false) { if (is_string($umask)) { $umask = octdec($umask); } else { $umask = (int) $umask; } // validate if ($umask & 0700) { throw new Exception\InvalidArgumentException( 'Invalid umask: need permission to execute, read and write by owner' ); } // normalize $umask = $umask & 0777; } $this->umask = $umask; return $this; } /** * Get umask * * Used by: * - CaptureCache * * @return false|int */ public function getUmask() { return $this->umask; } /** * Set whether or not file locking should be used * * Used by: * - CaptureCache * * @param bool $fileLocking * @return PatternOptions */ public function setFileLocking($fileLocking) { $this->fileLocking = (bool) $fileLocking; return $this; } /** * Is file locking enabled? * * Used by: * - CaptureCache * * @return bool */ public function getFileLocking() { return $this->fileLocking; } /** * Set file permission * * @param false|int $filePermission * @throws Exception\InvalidArgumentException * @return PatternOptions */ public function setFilePermission($filePermission) { if ($filePermission !== false) { if (is_string($filePermission)) { $filePermission = octdec($filePermission); } else { $filePermission = (int) $filePermission; } // validate if (($filePermission & 0600) != 0600) { throw new Exception\InvalidArgumentException( 'Invalid file permission: need permission to read and write by owner' ); } elseif ($filePermission & 0111) { throw new Exception\InvalidArgumentException( "Invalid file permission: Files shoudn't be executable" ); } } $this->filePermission = $filePermission; return $this; } /** * Gets file permission * * @return false|int */ public function getFilePermission() { return $this->filePermission; } /** * Set value for index filename * * @param string $indexFilename * @return PatternOptions */ public function setIndexFilename($indexFilename) { $this->indexFilename = (string) $indexFilename; return $this; } /** * Get value for index filename * * @return string */ public function getIndexFilename() { return $this->indexFilename; } /** * Set object to cache * * @param mixed $object * @throws Exception\InvalidArgumentException * @return $this */ public function setObject($object) { if (!is_object($object)) { throw new Exception\InvalidArgumentException(sprintf( '%s expects an object; received "%s"', __METHOD__, gettype($object) )); } $this->object = $object; return $this; } /** * Get object to cache * * @return null|object */ public function getObject() { return $this->object; } /** * Set flag indicating whether or not to cache magic properties * * Used by: * - ObjectCache * * @param bool $objectCacheMagicProperties * @return PatternOptions */ public function setObjectCacheMagicProperties($objectCacheMagicProperties) { $this->objectCacheMagicProperties = (bool) $objectCacheMagicProperties; return $this; } /** * Should we cache magic properties? * * Used by: * - ObjectCache * * @return bool */ public function getObjectCacheMagicProperties() { return $this->objectCacheMagicProperties; } /** * Set list of object methods for which to cache return values * * @param array $objectCacheMethods * @return PatternOptions * @throws Exception\InvalidArgumentException */ public function setObjectCacheMethods(array $objectCacheMethods) { $this->objectCacheMethods = $this->normalizeObjectMethods($objectCacheMethods); return $this; } /** * Get list of object methods for which to cache return values * * @return array */ public function getObjectCacheMethods() { return $this->objectCacheMethods; } /** * Set the object key part. * * Used to generate a callback key in order to speed up key generation. * * Used by: * - ObjectCache * * @param mixed $objectKey * @return $this */ public function setObjectKey($objectKey) { if ($objectKey !== null) { $this->objectKey = (string) $objectKey; } else { $this->objectKey = null; } return $this; } /** * Get object key * * Used by: * - ObjectCache * * @return mixed */ public function getObjectKey() { if (!$this->objectKey) { return get_class($this->getObject()); } return $this->objectKey; } /** * Set list of object methods for which NOT to cache return values * * @param array $objectNonCacheMethods * @return PatternOptions * @throws Exception\InvalidArgumentException */ public function setObjectNonCacheMethods(array $objectNonCacheMethods) { $this->objectNonCacheMethods = $this->normalizeObjectMethods($objectNonCacheMethods); return $this; } /** * Get list of object methods for which NOT to cache return values * * @return array */ public function getObjectNonCacheMethods() { return $this->objectNonCacheMethods; } /** * Set location of public directory * * Used by: * - CaptureCache * * @param string $publicDir * @throws Exception\InvalidArgumentException * @return PatternOptions */ public function setPublicDir($publicDir) { $publicDir = (string) $publicDir; if (!is_dir($publicDir)) { throw new Exception\InvalidArgumentException( "Public directory '{$publicDir}' not found or not a directory" ); } elseif (!is_writable($publicDir)) { throw new Exception\InvalidArgumentException( "Public directory '{$publicDir}' not writable" ); } elseif (!is_readable($publicDir)) { throw new Exception\InvalidArgumentException( "Public directory '{$publicDir}' not readable" ); } $this->publicDir = rtrim(realpath($publicDir), \DIRECTORY_SEPARATOR); return $this; } /** * Get location of public directory * * Used by: * - CaptureCache * * @return null|string */ public function getPublicDir() { return $this->publicDir; } /** * Set storage adapter * * Required for the following Pattern classes: * - CallbackCache * - ClassCache * - ObjectCache * - OutputCache * * @param string|array|Storage $storage * @return PatternOptions */ public function setStorage($storage) { $this->storage = $this->storageFactory($storage); return $this; } /** * Get storage adapter * * Used by: * - CallbackCache * - ClassCache * - ObjectCache * - OutputCache * * @return null|Storage */ public function getStorage() { return $this->storage; } /** * Recursively apply strtolower on all values of an array, and return as a * list of unique values * * @param array $array * @return array */ protected function recursiveStrtolower(array $array) { return array_values(array_unique(array_map('strtolower', $array))); } /** * Normalize object methods * * Recursively casts values to lowercase, then determines if any are in a * list of methods not handled, raising an exception if so. * * @param array $methods * @return array * @throws Exception\InvalidArgumentException */ protected function normalizeObjectMethods(array $methods) { $methods = $this->recursiveStrtolower($methods); $intersect = array_intersect(array('__set', '__get', '__unset', '__isset'), $methods); if (!empty($intersect)) { throw new Exception\InvalidArgumentException( "Magic properties are handled by option 'cache_magic_properties'" ); } return $methods; } /** * Create a storage object from a given specification * * @param array|string|Storage $storage * @throws Exception\InvalidArgumentException * @return Storage */ protected function storageFactory($storage) { if (is_array($storage)) { $storage = StorageFactory::factory($storage); } elseif (is_string($storage)) { $storage = StorageFactory::adapterFactory($storage); } elseif (!($storage instanceof Storage)) { throw new Exception\InvalidArgumentException( 'The storage must be an instanceof Zend\Cache\Storage\StorageInterface ' . 'or an array passed to Zend\Cache\Storage::factory ' . 'or simply the name of the storage adapter' ); } return $storage; } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/PatternFactory.php000066400000000000000000000050601226600447100217510ustar00rootroot00000000000000setOptions($options); return $patternName; } $pattern = static::getPluginManager()->get($patternName); $pattern->setOptions($options); return $pattern; } /** * Get the pattern plugin manager * * @return PatternPluginManager */ public static function getPluginManager() { if (static::$plugins === null) { static::$plugins = new PatternPluginManager(); } return static::$plugins; } /** * Set the pattern plugin manager * * @param PatternPluginManager $plugins * @return void */ public static function setPluginManager(PatternPluginManager $plugins) { static::$plugins = $plugins; } /** * Reset pattern plugin manager to default * * @return void */ public static function resetPluginManager() { static::$plugins = null; } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/PatternPluginManager.php000066400000000000000000000036761226600447100231060ustar00rootroot00000000000000 'Zend\Cache\Pattern\CallbackCache', 'capture' => 'Zend\Cache\Pattern\CaptureCache', 'class' => 'Zend\Cache\Pattern\ClassCache', 'object' => 'Zend\Cache\Pattern\ObjectCache', 'output' => 'Zend\Cache\Pattern\OutputCache', 'page' => 'Zend\Cache\Pattern\PageCache', ); /** * Don't share by default * * @var array */ protected $shareByDefault = false; /** * Validate the plugin * * Checks that the pattern adapter loaded is an instance of Pattern\PatternInterface. * * @param mixed $plugin * @return void * @throws Exception\RuntimeException if invalid */ public function validatePlugin($plugin) { if ($plugin instanceof Pattern\PatternInterface) { // we're okay return; } throw new Exception\RuntimeException(sprintf( 'Plugin of type %s is invalid; must implement %s\Pattern\PatternInterface', (is_object($plugin) ? get_class($plugin) : gettype($plugin)), __NAMESPACE__ )); } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/000077500000000000000000000000001226600447100176765ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/Adapter/000077500000000000000000000000001226600447100212565ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/Adapter/AbstractAdapter.php000066400000000000000000001305571226600447100250460ustar00rootroot00000000000000setOptions($options); } } /** * Destructor * * detach all registered plugins to free * event handles of event manager * * @return void */ public function __destruct() { foreach ($this->getPluginRegistry() as $plugin) { $this->removePlugin($plugin); } if ($this->eventHandles) { $events = $this->getEventManager(); foreach ($this->eventHandles as $handle) { $events->detach($handle); } } } /* configuration */ /** * Set options. * * @param array|Traversable|AdapterOptions $options * @return AbstractAdapter * @see getOptions() */ public function setOptions($options) { if ($this->options !== $options) { if (!$options instanceof AdapterOptions) { $options = new AdapterOptions($options); } if ($this->options) { $this->options->setAdapter(null); } $options->setAdapter($this); $this->options = $options; $event = new Event('option', $this, new ArrayObject($options->toArray())); $this->getEventManager()->trigger($event); } return $this; } /** * Get options. * * @return AdapterOptions * @see setOptions() */ public function getOptions() { if (!$this->options) { $this->setOptions(new AdapterOptions()); } return $this->options; } /** * Enable/Disable caching. * * Alias of setWritable and setReadable. * * @see setWritable() * @see setReadable() * @param boolean $flag * @return AbstractAdapter */ public function setCaching($flag) { $flag = (bool) $flag; $options = $this->getOptions(); $options->setWritable($flag); $options->setReadable($flag); return $this; } /** * Get caching enabled. * * Alias of getWritable and getReadable. * * @see getWritable() * @see getReadable() * @return boolean */ public function getCaching() { $options = $this->getOptions(); return ($options->getWritable() && $options->getReadable()); } /* Event/Plugin handling */ /** * Get the event manager * * @return EventManagerInterface */ public function getEventManager() { if ($this->events === null) { $this->events = new EventManager(array(__CLASS__, get_called_class())); } return $this->events; } /** * Trigger an pre event and return the event response collection * * @param string $eventName * @param ArrayObject $args * @return \Zend\EventManager\ResponseCollection All handler return values */ protected function triggerPre($eventName, ArrayObject $args) { return $this->getEventManager()->trigger(new Event($eventName . '.pre', $this, $args)); } /** * Triggers the PostEvent and return the result value. * * @param string $eventName * @param ArrayObject $args * @param mixed $result * @return mixed */ protected function triggerPost($eventName, ArrayObject $args, & $result) { $postEvent = new PostEvent($eventName . '.post', $this, $args, $result); $eventRs = $this->getEventManager()->trigger($postEvent); if ($eventRs->stopped()) { return $eventRs->last(); } return $postEvent->getResult(); } /** * Trigger an exception event * * If the ExceptionEvent has the flag "throwException" enabled throw the * exception after trigger else return the result. * * @param string $eventName * @param ArrayObject $args * @param mixed $result * @param \Exception $exception * @throws Exception\ExceptionInterface * @return mixed */ protected function triggerException($eventName, ArrayObject $args, & $result, \Exception $exception) { $exceptionEvent = new ExceptionEvent($eventName . '.exception', $this, $args, $result, $exception); $eventRs = $this->getEventManager()->trigger($exceptionEvent); if ($exceptionEvent->getThrowException()) { throw $exceptionEvent->getException(); } if ($eventRs->stopped()) { return $eventRs->last(); } return $exceptionEvent->getResult(); } /** * Check if a plugin is registered * * @param Plugin\PluginInterface $plugin * @return boolean */ public function hasPlugin(Plugin\PluginInterface $plugin) { $registry = $this->getPluginRegistry(); return $registry->contains($plugin); } /** * Register a plugin * * @param Plugin\PluginInterface $plugin * @param int $priority * @return AbstractAdapter Fluent interface * @throws Exception\LogicException */ public function addPlugin(Plugin\PluginInterface $plugin, $priority = 1) { $registry = $this->getPluginRegistry(); if ($registry->contains($plugin)) { throw new Exception\LogicException(sprintf( 'Plugin of type "%s" already registered', get_class($plugin) )); } $plugin->attach($this->getEventManager(), $priority); $registry->attach($plugin); return $this; } /** * Unregister an already registered plugin * * @param Plugin\PluginInterface $plugin * @return AbstractAdapter Fluent interface * @throws Exception\LogicException */ public function removePlugin(Plugin\PluginInterface $plugin) { $registry = $this->getPluginRegistry(); if ($registry->contains($plugin)) { $plugin->detach($this->getEventManager()); $registry->detach($plugin); } return $this; } /** * Return registry of plugins * * @return SplObjectStorage */ public function getPluginRegistry() { if (!$this->pluginRegistry instanceof SplObjectStorage) { $this->pluginRegistry = new SplObjectStorage(); } return $this->pluginRegistry; } /* reading */ /** * Get an item. * * @param string $key * @param boolean $success * @param mixed $casToken * @return mixed Data on success, null on failure * @throws Exception\ExceptionInterface * * @triggers getItem.pre(PreEvent) * @triggers getItem.post(PostEvent) * @triggers getItem.exception(ExceptionEvent) */ public function getItem($key, & $success = null, & $casToken = null) { if (!$this->getOptions()->getReadable()) { $success = false; return null; } $this->normalizeKey($key); $argn = func_num_args(); $args = array( 'key' => & $key, ); if ($argn > 1) { $args['success'] = & $success; } if ($argn > 2) { $args['casToken'] = & $casToken; } $args = new ArrayObject($args); try { $eventRs = $this->triggerPre(__FUNCTION__, $args); if ($eventRs->stopped()) { return $eventRs->last(); } if ($args->offsetExists('success') && $args->offsetExists('casToken')) { $result = $this->internalGetItem($args['key'], $args['success'], $args['casToken']); } elseif ($args->offsetExists('success')) { $result = $this->internalGetItem($args['key'], $args['success']); } else { $result = $this->internalGetItem($args['key']); } return $this->triggerPost(__FUNCTION__, $args, $result); } catch (\Exception $e) { $result = false; return $this->triggerException(__FUNCTION__, $args, $result, $e); } } /** * Internal method to get an item. * * @param string $normalizedKey * @param boolean $success * @param mixed $casToken * @return mixed Data on success, null on failure * @throws Exception\ExceptionInterface */ abstract protected function internalGetItem(& $normalizedKey, & $success = null, & $casToken = null); /** * Get multiple items. * * @param array $keys * @return array Associative array of keys and values * @throws Exception\ExceptionInterface * * @triggers getItems.pre(PreEvent) * @triggers getItems.post(PostEvent) * @triggers getItems.exception(ExceptionEvent) */ public function getItems(array $keys) { if (!$this->getOptions()->getReadable()) { return array(); } $this->normalizeKeys($keys); $args = new ArrayObject(array( 'keys' => & $keys, )); try { $eventRs = $this->triggerPre(__FUNCTION__, $args); if ($eventRs->stopped()) { return $eventRs->last(); } $result = $this->internalGetItems($args['keys']); return $this->triggerPost(__FUNCTION__, $args, $result); } catch (\Exception $e) { $result = array(); return $this->triggerException(__FUNCTION__, $args, $result, $e); } } /** * Internal method to get multiple items. * * @param array $normalizedKeys * @return array Associative array of keys and values * @throws Exception\ExceptionInterface */ protected function internalGetItems(array & $normalizedKeys) { $success = null; $result = array(); foreach ($normalizedKeys as $normalizedKey) { $value = $this->internalGetItem($normalizedKey, $success); if ($success) { $result[$normalizedKey] = $value; } } return $result; } /** * Test if an item exists. * * @param string $key * @return boolean * @throws Exception\ExceptionInterface * * @triggers hasItem.pre(PreEvent) * @triggers hasItem.post(PostEvent) * @triggers hasItem.exception(ExceptionEvent) */ public function hasItem($key) { if (!$this->getOptions()->getReadable()) { return false; } $this->normalizeKey($key); $args = new ArrayObject(array( 'key' => & $key, )); try { $eventRs = $this->triggerPre(__FUNCTION__, $args); if ($eventRs->stopped()) { return $eventRs->last(); } $result = $this->internalHasItem($args['key']); return $this->triggerPost(__FUNCTION__, $args, $result); } catch (\Exception $e) { $result = false; return $this->triggerException(__FUNCTION__, $args, $result, $e); } } /** * Internal method to test if an item exists. * * @param string $normalizedKey * @return boolean * @throws Exception\ExceptionInterface */ protected function internalHasItem(& $normalizedKey) { $success = null; $this->internalGetItem($normalizedKey, $success); return $success; } /** * Test multiple items. * * @param array $keys * @return array Array of found keys * @throws Exception\ExceptionInterface * * @triggers hasItems.pre(PreEvent) * @triggers hasItems.post(PostEvent) * @triggers hasItems.exception(ExceptionEvent) */ public function hasItems(array $keys) { if (!$this->getOptions()->getReadable()) { return array(); } $this->normalizeKeys($keys); $args = new ArrayObject(array( 'keys' => & $keys, )); try { $eventRs = $this->triggerPre(__FUNCTION__, $args); if ($eventRs->stopped()) { return $eventRs->last(); } $result = $this->internalHasItems($args['keys']); return $this->triggerPost(__FUNCTION__, $args, $result); } catch (\Exception $e) { $result = array(); return $this->triggerException(__FUNCTION__, $args, $result, $e); } } /** * Internal method to test multiple items. * * @param array $normalizedKeys * @return array Array of found keys * @throws Exception\ExceptionInterface */ protected function internalHasItems(array & $normalizedKeys) { $result = array(); foreach ($normalizedKeys as $normalizedKey) { if ($this->internalHasItem($normalizedKey)) { $result[] = $normalizedKey; } } return $result; } /** * Get metadata of an item. * * @param string $key * @return array|boolean Metadata on success, false on failure * @throws Exception\ExceptionInterface * * @triggers getMetadata.pre(PreEvent) * @triggers getMetadata.post(PostEvent) * @triggers getMetadata.exception(ExceptionEvent) */ public function getMetadata($key) { if (!$this->getOptions()->getReadable()) { return false; } $this->normalizeKey($key); $args = new ArrayObject(array( 'key' => & $key, )); try { $eventRs = $this->triggerPre(__FUNCTION__, $args); if ($eventRs->stopped()) { return $eventRs->last(); } $result = $this->internalGetMetadata($args['key']); return $this->triggerPost(__FUNCTION__, $args, $result); } catch (\Exception $e) { $result = false; return $this->triggerException(__FUNCTION__, $args, $result, $e); } } /** * Internal method to get metadata of an item. * * @param string $normalizedKey * @return array|boolean Metadata on success, false on failure * @throws Exception\ExceptionInterface */ protected function internalGetMetadata(& $normalizedKey) { if (!$this->internalHasItem($normalizedKey)) { return false; } return array(); } /** * Get multiple metadata * * @param array $keys * @return array Associative array of keys and metadata * @throws Exception\ExceptionInterface * * @triggers getMetadatas.pre(PreEvent) * @triggers getMetadatas.post(PostEvent) * @triggers getMetadatas.exception(ExceptionEvent) */ public function getMetadatas(array $keys) { if (!$this->getOptions()->getReadable()) { return array(); } $this->normalizeKeys($keys); $args = new ArrayObject(array( 'keys' => & $keys, )); try { $eventRs = $this->triggerPre(__FUNCTION__, $args); if ($eventRs->stopped()) { return $eventRs->last(); } $result = $this->internalGetMetadatas($args['keys']); return $this->triggerPost(__FUNCTION__, $args, $result); } catch (\Exception $e) { $result = array(); return $this->triggerException(__FUNCTION__, $args, $result, $e); } } /** * Internal method to get multiple metadata * * @param array $normalizedKeys * @return array Associative array of keys and metadata * @throws Exception\ExceptionInterface */ protected function internalGetMetadatas(array & $normalizedKeys) { $result = array(); foreach ($normalizedKeys as $normalizedKey) { $metadata = $this->internalGetMetadata($normalizedKey); if ($metadata !== false) { $result[$normalizedKey] = $metadata; } } return $result; } /* writing */ /** * Store an item. * * @param string $key * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface * * @triggers setItem.pre(PreEvent) * @triggers setItem.post(PostEvent) * @triggers setItem.exception(ExceptionEvent) */ public function setItem($key, $value) { if (!$this->getOptions()->getWritable()) { return false; } $this->normalizeKey($key); $args = new ArrayObject(array( 'key' => & $key, 'value' => & $value, )); try { $eventRs = $this->triggerPre(__FUNCTION__, $args); if ($eventRs->stopped()) { return $eventRs->last(); } $result = $this->internalSetItem($args['key'], $args['value']); return $this->triggerPost(__FUNCTION__, $args, $result); } catch (\Exception $e) { $result = false; return $this->triggerException(__FUNCTION__, $args, $result, $e); } } /** * Internal method to store an item. * * @param string $normalizedKey * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface */ abstract protected function internalSetItem(& $normalizedKey, & $value); /** * Store multiple items. * * @param array $keyValuePairs * @return array Array of not stored keys * @throws Exception\ExceptionInterface * * @triggers setItems.pre(PreEvent) * @triggers setItems.post(PostEvent) * @triggers setItems.exception(ExceptionEvent) */ public function setItems(array $keyValuePairs) { if (!$this->getOptions()->getWritable()) { return array_keys($keyValuePairs); } $this->normalizeKeyValuePairs($keyValuePairs); $args = new ArrayObject(array( 'keyValuePairs' => & $keyValuePairs, )); try { $eventRs = $this->triggerPre(__FUNCTION__, $args); if ($eventRs->stopped()) { return $eventRs->last(); } $result = $this->internalSetItems($args['keyValuePairs']); return $this->triggerPost(__FUNCTION__, $args, $result); } catch (\Exception $e) { $result = array_keys($keyValuePairs); return $this->triggerException(__FUNCTION__, $args, $result, $e); } } /** * Internal method to store multiple items. * * @param array $normalizedKeyValuePairs * @return array Array of not stored keys * @throws Exception\ExceptionInterface */ protected function internalSetItems(array & $normalizedKeyValuePairs) { $failedKeys = array(); foreach ($normalizedKeyValuePairs as $normalizedKey => $value) { if (!$this->internalSetItem($normalizedKey, $value)) { $failedKeys[] = $normalizedKey; } } return $failedKeys; } /** * Add an item. * * @param string $key * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface * * @triggers addItem.pre(PreEvent) * @triggers addItem.post(PostEvent) * @triggers addItem.exception(ExceptionEvent) */ public function addItem($key, $value) { if (!$this->getOptions()->getWritable()) { return false; } $this->normalizeKey($key); $args = new ArrayObject(array( 'key' => & $key, 'value' => & $value, )); try { $eventRs = $this->triggerPre(__FUNCTION__, $args); if ($eventRs->stopped()) { return $eventRs->last(); } $result = $this->internalAddItem($args['key'], $args['value']); return $this->triggerPost(__FUNCTION__, $args, $result); } catch (\Exception $e) { $result = false; return $this->triggerException(__FUNCTION__, $args, $result, $e); } } /** * Internal method to add an item. * * @param string $normalizedKey * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface */ protected function internalAddItem(& $normalizedKey, & $value) { if ($this->internalHasItem($normalizedKey)) { return false; } return $this->internalSetItem($normalizedKey, $value); } /** * Add multiple items. * * @param array $keyValuePairs * @return array Array of not stored keys * @throws Exception\ExceptionInterface * * @triggers addItems.pre(PreEvent) * @triggers addItems.post(PostEvent) * @triggers addItems.exception(ExceptionEvent) */ public function addItems(array $keyValuePairs) { if (!$this->getOptions()->getWritable()) { return array_keys($keyValuePairs); } $this->normalizeKeyValuePairs($keyValuePairs); $args = new ArrayObject(array( 'keyValuePairs' => & $keyValuePairs, )); try { $eventRs = $this->triggerPre(__FUNCTION__, $args); if ($eventRs->stopped()) { return $eventRs->last(); } $result = $this->internalAddItems($args['keyValuePairs']); return $this->triggerPost(__FUNCTION__, $args, $result); } catch (\Exception $e) { $result = array_keys($keyValuePairs); return $this->triggerException(__FUNCTION__, $args, $result, $e); } } /** * Internal method to add multiple items. * * @param array $normalizedKeyValuePairs * @return array Array of not stored keys * @throws Exception\ExceptionInterface */ protected function internalAddItems(array & $normalizedKeyValuePairs) { $result = array(); foreach ($normalizedKeyValuePairs as $normalizedKey => $value) { if (!$this->internalAddItem($normalizedKey, $value)) { $result[] = $normalizedKey; } } return $result; } /** * Replace an existing item. * * @param string $key * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface * * @triggers replaceItem.pre(PreEvent) * @triggers replaceItem.post(PostEvent) * @triggers replaceItem.exception(ExceptionEvent) */ public function replaceItem($key, $value) { if (!$this->getOptions()->getWritable()) { return false; } $this->normalizeKey($key); $args = new ArrayObject(array( 'key' => & $key, 'value' => & $value, )); try { $eventRs = $this->triggerPre(__FUNCTION__, $args); if ($eventRs->stopped()) { return $eventRs->last(); } $result = $this->internalReplaceItem($args['key'], $args['value']); return $this->triggerPost(__FUNCTION__, $args, $result); } catch (\Exception $e) { $result = false; return $this->triggerException(__FUNCTION__, $args, $result, $e); } } /** * Internal method to replace an existing item. * * @param string $normalizedKey * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface */ protected function internalReplaceItem(& $normalizedKey, & $value) { if (!$this->internalhasItem($normalizedKey)) { return false; } return $this->internalSetItem($normalizedKey, $value); } /** * Replace multiple existing items. * * @param array $keyValuePairs * @return array Array of not stored keys * @throws Exception\ExceptionInterface * * @triggers replaceItems.pre(PreEvent) * @triggers replaceItems.post(PostEvent) * @triggers replaceItems.exception(ExceptionEvent) */ public function replaceItems(array $keyValuePairs) { if (!$this->getOptions()->getWritable()) { return array_keys($keyValuePairs); } $this->normalizeKeyValuePairs($keyValuePairs); $args = new ArrayObject(array( 'keyValuePairs' => & $keyValuePairs, )); try { $eventRs = $this->triggerPre(__FUNCTION__, $args); if ($eventRs->stopped()) { return $eventRs->last(); } $result = $this->internalReplaceItems($args['keyValuePairs']); return $this->triggerPost(__FUNCTION__, $args, $result); } catch (\Exception $e) { $result = array_keys($keyValuePairs); return $this->triggerException(__FUNCTION__, $args, $result, $e); } } /** * Internal method to replace multiple existing items. * * @param array $normalizedKeyValuePairs * @return array Array of not stored keys * @throws Exception\ExceptionInterface */ protected function internalReplaceItems(array & $normalizedKeyValuePairs) { $result = array(); foreach ($normalizedKeyValuePairs as $normalizedKey => $value) { if (!$this->internalReplaceItem($normalizedKey, $value)) { $result[] = $normalizedKey; } } return $result; } /** * Set an item only if token matches * * It uses the token received from getItem() to check if the item has * changed before overwriting it. * * @param mixed $token * @param string $key * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface * @see getItem() * @see setItem() */ public function checkAndSetItem($token, $key, $value) { if (!$this->getOptions()->getWritable()) { return false; } $this->normalizeKey($key); $args = new ArrayObject(array( 'token' => & $token, 'key' => & $key, 'value' => & $value, )); try { $eventRs = $this->triggerPre(__FUNCTION__, $args); if ($eventRs->stopped()) { return $eventRs->last(); } $result = $this->internalCheckAndSetItem($args['token'], $args['key'], $args['value']); return $this->triggerPost(__FUNCTION__, $args, $result); } catch (\Exception $e) { $result = false; return $this->triggerException(__FUNCTION__, $args, $result, $e); } } /** * Internal method to set an item only if token matches * * @param mixed $token * @param string $normalizedKey * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface * @see getItem() * @see setItem() */ protected function internalCheckAndSetItem(& $token, & $normalizedKey, & $value) { $oldValue = $this->internalGetItem($normalizedKey); if ($oldValue !== $token) { return false; } return $this->internalSetItem($normalizedKey, $value); } /** * Reset lifetime of an item * * @param string $key * @return boolean * @throws Exception\ExceptionInterface * * @triggers touchItem.pre(PreEvent) * @triggers touchItem.post(PostEvent) * @triggers touchItem.exception(ExceptionEvent) */ public function touchItem($key) { if (!$this->getOptions()->getWritable()) { return false; } $this->normalizeKey($key); $args = new ArrayObject(array( 'key' => & $key, )); try { $eventRs = $this->triggerPre(__FUNCTION__, $args); if ($eventRs->stopped()) { return $eventRs->last(); } $result = $this->internalTouchItem($args['key']); return $this->triggerPost(__FUNCTION__, $args, $result); } catch (\Exception $e) { $result = false; return $this->triggerException(__FUNCTION__, $args, $result, $e); } } /** * Internal method to reset lifetime of an item * * @param string $normalizedKey * @return boolean * @throws Exception\ExceptionInterface */ protected function internalTouchItem(& $normalizedKey) { $success = null; $value = $this->internalGetItem($normalizedKey, $success); if (!$success) { return false; } return $this->internalReplaceItem($normalizedKey, $value); } /** * Reset lifetime of multiple items. * * @param array $keys * @return array Array of not updated keys * @throws Exception\ExceptionInterface * * @triggers touchItems.pre(PreEvent) * @triggers touchItems.post(PostEvent) * @triggers touchItems.exception(ExceptionEvent) */ public function touchItems(array $keys) { if (!$this->getOptions()->getWritable()) { return $keys; } $this->normalizeKeys($keys); $args = new ArrayObject(array( 'keys' => & $keys, )); try { $eventRs = $this->triggerPre(__FUNCTION__, $args); if ($eventRs->stopped()) { return $eventRs->last(); } $result = $this->internalTouchItems($args['keys']); return $this->triggerPost(__FUNCTION__, $args, $result); } catch (\Exception $e) { return $this->triggerException(__FUNCTION__, $args, $keys, $e); } } /** * Internal method to reset lifetime of multiple items. * * @param array $normalizedKeys * @return array Array of not updated keys * @throws Exception\ExceptionInterface */ protected function internalTouchItems(array & $normalizedKeys) { $result = array(); foreach ($normalizedKeys as $normalizedKey) { if (!$this->internalTouchItem($normalizedKey)) { $result[] = $normalizedKey; } } return $result; } /** * Remove an item. * * @param string $key * @return boolean * @throws Exception\ExceptionInterface * * @triggers removeItem.pre(PreEvent) * @triggers removeItem.post(PostEvent) * @triggers removeItem.exception(ExceptionEvent) */ public function removeItem($key) { if (!$this->getOptions()->getWritable()) { return false; } $this->normalizeKey($key); $args = new ArrayObject(array( 'key' => & $key, )); try { $eventRs = $this->triggerPre(__FUNCTION__, $args); if ($eventRs->stopped()) { return $eventRs->last(); } $result = $this->internalRemoveItem($args['key']); return $this->triggerPost(__FUNCTION__, $args, $result); } catch (\Exception $e) { $result = false; return $this->triggerException(__FUNCTION__, $args, $result, $e); } } /** * Internal method to remove an item. * * @param string $normalizedKey * @return boolean * @throws Exception\ExceptionInterface */ abstract protected function internalRemoveItem(& $normalizedKey); /** * Remove multiple items. * * @param array $keys * @return array Array of not removed keys * @throws Exception\ExceptionInterface * * @triggers removeItems.pre(PreEvent) * @triggers removeItems.post(PostEvent) * @triggers removeItems.exception(ExceptionEvent) */ public function removeItems(array $keys) { if (!$this->getOptions()->getWritable()) { return $keys; } $this->normalizeKeys($keys); $args = new ArrayObject(array( 'keys' => & $keys, )); try { $eventRs = $this->triggerPre(__FUNCTION__, $args); if ($eventRs->stopped()) { return $eventRs->last(); } $result = $this->internalRemoveItems($args['keys']); return $this->triggerPost(__FUNCTION__, $args, $result); } catch (\Exception $e) { return $this->triggerException(__FUNCTION__, $args, $keys, $e); } } /** * Internal method to remove multiple items. * * @param array $normalizedKeys * @return array Array of not removed keys * @throws Exception\ExceptionInterface */ protected function internalRemoveItems(array & $normalizedKeys) { $result = array(); foreach ($normalizedKeys as $normalizedKey) { if (!$this->internalRemoveItem($normalizedKey)) { $result[] = $normalizedKey; } } return $result; } /** * Increment an item. * * @param string $key * @param int $value * @return int|boolean The new value on success, false on failure * @throws Exception\ExceptionInterface * * @triggers incrementItem.pre(PreEvent) * @triggers incrementItem.post(PostEvent) * @triggers incrementItem.exception(ExceptionEvent) */ public function incrementItem($key, $value) { if (!$this->getOptions()->getWritable()) { return false; } $this->normalizeKey($key); $args = new ArrayObject(array( 'key' => & $key, 'value' => & $value, )); try { $eventRs = $this->triggerPre(__FUNCTION__, $args); if ($eventRs->stopped()) { return $eventRs->last(); } $result = $this->internalIncrementItem($args['key'], $args['value']); return $this->triggerPost(__FUNCTION__, $args, $result); } catch (\Exception $e) { $result = false; return $this->triggerException(__FUNCTION__, $args, $result, $e); } } /** * Internal method to increment an item. * * @param string $normalizedKey * @param int $value * @return int|boolean The new value on success, false on failure * @throws Exception\ExceptionInterface */ protected function internalIncrementItem(& $normalizedKey, & $value) { $success = null; $value = (int) $value; $get = (int) $this->internalGetItem($normalizedKey, $success); $newValue = $get + $value; if ($success) { $this->internalReplaceItem($normalizedKey, $newValue); } else { $this->internalAddItem($normalizedKey, $newValue); } return $newValue; } /** * Increment multiple items. * * @param array $keyValuePairs * @return array Associative array of keys and new values * @throws Exception\ExceptionInterface * * @triggers incrementItems.pre(PreEvent) * @triggers incrementItems.post(PostEvent) * @triggers incrementItems.exception(ExceptionEvent) */ public function incrementItems(array $keyValuePairs) { if (!$this->getOptions()->getWritable()) { return array(); } $this->normalizeKeyValuePairs($keyValuePairs); $args = new ArrayObject(array( 'keyValuePairs' => & $keyValuePairs, )); try { $eventRs = $this->triggerPre(__FUNCTION__, $args); if ($eventRs->stopped()) { return $eventRs->last(); } $result = $this->internalIncrementItems($args['keyValuePairs']); return $this->triggerPost(__FUNCTION__, $args, $result); } catch (\Exception $e) { $result = array(); return $this->triggerException(__FUNCTION__, $args, $result, $e); } } /** * Internal method to increment multiple items. * * @param array $normalizedKeyValuePairs * @return array Associative array of keys and new values * @throws Exception\ExceptionInterface */ protected function internalIncrementItems(array & $normalizedKeyValuePairs) { $result = array(); foreach ($normalizedKeyValuePairs as $normalizedKey => $value) { $newValue = $this->internalIncrementItem($normalizedKey, $value); if ($newValue !== false) { $result[$normalizedKey] = $newValue; } } return $result; } /** * Decrement an item. * * @param string $key * @param int $value * @return int|boolean The new value on success, false on failure * @throws Exception\ExceptionInterface * * @triggers decrementItem.pre(PreEvent) * @triggers decrementItem.post(PostEvent) * @triggers decrementItem.exception(ExceptionEvent) */ public function decrementItem($key, $value) { if (!$this->getOptions()->getWritable()) { return false; } $this->normalizeKey($key); $args = new ArrayObject(array( 'key' => & $key, 'value' => & $value, )); try { $eventRs = $this->triggerPre(__FUNCTION__, $args); if ($eventRs->stopped()) { return $eventRs->last(); } $result = $this->internalDecrementItem($args['key'], $args['value']); return $this->triggerPost(__FUNCTION__, $args, $result); } catch (\Exception $e) { $result = false; return $this->triggerException(__FUNCTION__, $args, $result, $e); } } /** * Internal method to decrement an item. * * @param string $normalizedKey * @param int $value * @return int|boolean The new value on success, false on failure * @throws Exception\ExceptionInterface */ protected function internalDecrementItem(& $normalizedKey, & $value) { $success = null; $value = (int) $value; $get = (int) $this->internalGetItem($normalizedKey, $success); $newValue = $get - $value; if ($success) { $this->internalReplaceItem($normalizedKey, $newValue); } else { $this->internalAddItem($normalizedKey, $newValue); } return $newValue; } /** * Decrement multiple items. * * @param array $keyValuePairs * @return array Associative array of keys and new values * @throws Exception\ExceptionInterface * * @triggers incrementItems.pre(PreEvent) * @triggers incrementItems.post(PostEvent) * @triggers incrementItems.exception(ExceptionEvent) */ public function decrementItems(array $keyValuePairs) { if (!$this->getOptions()->getWritable()) { return array(); } $this->normalizeKeyValuePairs($keyValuePairs); $args = new ArrayObject(array( 'keyValuePairs' => & $keyValuePairs, )); try { $eventRs = $this->triggerPre(__FUNCTION__, $args); if ($eventRs->stopped()) { return $eventRs->last(); } $result = $this->internalDecrementItems($args['keyValuePairs']); return $this->triggerPost(__FUNCTION__, $args, $result); } catch (\Exception $e) { $result = array(); return $this->triggerException(__FUNCTION__, $args, $result, $e); } } /** * Internal method to decrement multiple items. * * @param array $normalizedKeyValuePairs * @return array Associative array of keys and new values * @throws Exception\ExceptionInterface */ protected function internalDecrementItems(array & $normalizedKeyValuePairs) { $result = array(); foreach ($normalizedKeyValuePairs as $normalizedKey => $value) { $newValue = $this->decrementItem($normalizedKey, $value); if ($newValue !== false) { $result[$normalizedKey] = $newValue; } } return $result; } /* status */ /** * Get capabilities of this adapter * * @return Capabilities * @triggers getCapabilities.pre(PreEvent) * @triggers getCapabilities.post(PostEvent) * @triggers getCapabilities.exception(ExceptionEvent) */ public function getCapabilities() { $args = new ArrayObject(); try { $eventRs = $this->triggerPre(__FUNCTION__, $args); if ($eventRs->stopped()) { return $eventRs->last(); } $result = $this->internalGetCapabilities(); return $this->triggerPost(__FUNCTION__, $args, $result); } catch (\Exception $e) { $result = false; return $this->triggerException(__FUNCTION__, $args, $result, $e); } } /** * Internal method to get capabilities of this adapter * * @return Capabilities */ protected function internalGetCapabilities() { if ($this->capabilities === null) { $this->capabilityMarker = new stdClass(); $this->capabilities = new Capabilities($this, $this->capabilityMarker); } return $this->capabilities; } /* internal */ /** * Validates and normalizes a key * * @param string $key * @return void * @throws Exception\InvalidArgumentException On an invalid key */ protected function normalizeKey(& $key) { $key = (string) $key; if ($key === '') { throw new Exception\InvalidArgumentException( "An empty key isn't allowed" ); } elseif (($p = $this->getOptions()->getKeyPattern()) && !preg_match($p, $key)) { throw new Exception\InvalidArgumentException( "The key '{$key}' doesn't match agains pattern '{$p}'" ); } } /** * Validates and normalizes multiple keys * * @param array $keys * @return void * @throws Exception\InvalidArgumentException On an invalid key */ protected function normalizeKeys(array & $keys) { if (!$keys) { throw new Exception\InvalidArgumentException( "An empty list of keys isn't allowed" ); } array_walk($keys, array($this, 'normalizeKey')); $keys = array_values(array_unique($keys)); } /** * Validates and normalizes an array of key-value pairs * * @param array $keyValuePairs * @return void * @throws Exception\InvalidArgumentException On an invalid key */ protected function normalizeKeyValuePairs(array & $keyValuePairs) { $normalizedKeyValuePairs = array(); foreach ($keyValuePairs as $key => $value) { $this->normalizeKey($key); $normalizedKeyValuePairs[$key] = $value; } $keyValuePairs = $normalizedKeyValuePairs; } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/Adapter/AbstractZendServer.php000066400000000000000000000172061226600447100255500ustar00rootroot00000000000000getOptions()->getNamespace() . self::NAMESPACE_SEPARATOR; $internalKey = $prefix . $normalizedKey; $result = $this->zdcFetch($internalKey); if ($result === false) { $success = false; $result = null; } else { $success = true; $casToken = $result; } return $result; } /** * Internal method to get multiple items. * * @param array $normalizedKeys * @return array Associative array of keys and values * @throws Exception\ExceptionInterface */ protected function internalGetItems(array & $normalizedKeys) { $prefix = $this->getOptions()->getNamespace() . self::NAMESPACE_SEPARATOR; $prefixL = strlen($prefix); $internalKeys = array(); foreach ($normalizedKeys as $normalizedKey) { $internalKeys[] = $prefix . $normalizedKey; } $fetch = $this->zdcFetchMulti($internalKeys); $result = array(); foreach ($fetch as $k => & $v) { $result[ substr($k, $prefixL) ] = $v; } return $result; } /** * Internal method to test if an item exists. * * @param string $normalizedKey * @return boolean * @throws Exception\ExceptionInterface */ protected function internalHasItem(& $normalizedKey) { $prefix = $this->getOptions()->getNamespace() . self::NAMESPACE_SEPARATOR; return ($this->zdcFetch($prefix . $normalizedKey) !== false); } /** * Internal method to test multiple items. * * @param array $normalizedKeys * @return array Array of found keys * @throws Exception\ExceptionInterface */ protected function internalHasItems(array & $normalizedKeys) { $prefix = $this->getOptions()->getNamespace() . self::NAMESPACE_SEPARATOR; $prefixL = strlen($prefix); $internalKeys = array(); foreach ($normalizedKeys as $normalizedKey) { $internalKeys[] = $prefix . $normalizedKey; } $fetch = $this->zdcFetchMulti($internalKeys); $result = array(); foreach ($fetch as $internalKey => & $value) { $result[] = substr($internalKey, $prefixL); } return $result; } /** * Get metadata for multiple items * * @param array $normalizedKeys * @return array Associative array of keys and metadata * * @triggers getMetadatas.pre(PreEvent) * @triggers getMetadatas.post(PostEvent) * @triggers getMetadatas.exception(ExceptionEvent) */ protected function internalGetMetadatas(array & $normalizedKeys) { $prefix = $this->getOptions()->getNamespace() . self::NAMESPACE_SEPARATOR; $prefixL = strlen($prefix); $internalKeys = array(); foreach ($normalizedKeys as $normalizedKey) { $internalKeys[] = $prefix . $normalizedKey; } $fetch = $this->zdcFetchMulti($internalKeys); $result = array(); foreach ($fetch as $internalKey => $value) { $result[ substr($internalKey, $prefixL) ] = array(); } return $result; } /* writing */ /** * Internal method to store an item. * * @param string $normalizedKey * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface */ protected function internalSetItem(& $normalizedKey, & $value) { $options = $this->getOptions(); $internalKey = $options->getNamespace() . self::NAMESPACE_SEPARATOR . $normalizedKey; $this->zdcStore($internalKey, $value, $options->getTtl()); return true; } /** * Internal method to remove an item. * * @param string $normalizedKey * @return boolean * @throws Exception\ExceptionInterface */ protected function internalRemoveItem(& $normalizedKey) { $internalKey = $this->getOptions()->getNamespace() . self::NAMESPACE_SEPARATOR . $normalizedKey; return $this->zdcDelete($internalKey); } /* status */ /** * Internal method to get capabilities of this adapter * * @return Capabilities */ protected function internalGetCapabilities() { if ($this->capabilities === null) { $this->capabilityMarker = new stdClass(); $this->capabilities = new Capabilities( $this, $this->capabilityMarker, array( 'supportedDatatypes' => array( 'NULL' => true, 'boolean' => true, 'integer' => true, 'double' => true, 'string' => true, 'array' => true, 'object' => 'object', 'resource' => false, ), 'supportedMetadata' => array(), 'maxTtl' => 0, 'staticTtl' => true, 'ttlPrecision' => 1, 'useRequestTime' => false, 'expiredRead' => false, 'maxKeyLength' => 0, 'namespaceIsPrefix' => true, 'namespaceSeparator' => self::NAMESPACE_SEPARATOR, ) ); } return $this->capabilities; } /* internal wrapper of zend_[disk|shm]_cache_* functions */ /** * Store data into Zend Data Cache (zdc) * * @param string $internalKey * @param mixed $value * @param int $ttl * @return void * @throws Exception\RuntimeException */ abstract protected function zdcStore($internalKey, $value, $ttl); /** * Fetch a single item from Zend Data Cache (zdc) * * @param string $internalKey * @return mixed The stored value or FALSE if item wasn't found * @throws Exception\RuntimeException */ abstract protected function zdcFetch($internalKey); /** * Fetch multiple items from Zend Data Cache (zdc) * * @param array $internalKeys * @return array All found items * @throws Exception\RuntimeException */ abstract protected function zdcFetchMulti(array $internalKeys); /** * Delete data from Zend Data Cache (zdc) * * @param string $internalKey * @return boolean * @throws Exception\RuntimeException */ abstract protected function zdcDelete($internalKey); } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/Adapter/AdapterOptions.php000066400000000000000000000140471226600447100247310ustar00rootroot00000000000000adapter = $adapter; return $this; } /** * Set key pattern * * @param null|string $keyPattern * @throws Exception\InvalidArgumentException * @return AdapterOptions */ public function setKeyPattern($keyPattern) { $keyPattern = (string) $keyPattern; if ($this->keyPattern !== $keyPattern) { // validate pattern if ($keyPattern !== '') { ErrorHandler::start(E_WARNING); $result = preg_match($keyPattern, ''); $error = ErrorHandler::stop(); if ($result === false) { throw new Exception\InvalidArgumentException(sprintf( 'Invalid pattern "%s"%s', $keyPattern, ($error ? ': ' . $error->getMessage() : '') ), 0, $error); } } $this->triggerOptionEvent('key_pattern', $keyPattern); $this->keyPattern = $keyPattern; } return $this; } /** * Get key pattern * * @return string */ public function getKeyPattern() { return $this->keyPattern; } /** * Set namespace. * * @param string $namespace * @return AdapterOptions */ public function setNamespace($namespace) { $namespace = (string) $namespace; if ($this->namespace !== $namespace) { $this->triggerOptionEvent('namespace', $namespace); $this->namespace = $namespace; } return $this; } /** * Get namespace * * @return string */ public function getNamespace() { return $this->namespace; } /** * Enable/Disable reading data from cache. * * @param boolean $readable * @return AbstractAdapter */ public function setReadable($readable) { $readable = (bool) $readable; if ($this->readable !== $readable) { $this->triggerOptionEvent('readable', $readable); $this->readable = $readable; } return $this; } /** * If reading data from cache enabled. * * @return boolean */ public function getReadable() { return $this->readable; } /** * Set time to live. * * @param int|float $ttl * @return AdapterOptions */ public function setTtl($ttl) { $this->normalizeTtl($ttl); if ($this->ttl !== $ttl) { $this->triggerOptionEvent('ttl', $ttl); $this->ttl = $ttl; } return $this; } /** * Get time to live. * * @return float */ public function getTtl() { return $this->ttl; } /** * Enable/Disable writing data to cache. * * @param boolean $writable * @return AdapterOptions */ public function setWritable($writable) { $writable = (bool) $writable; if ($this->writable !== $writable) { $this->triggerOptionEvent('writable', $writable); $this->writable = $writable; } return $this; } /** * If writing data to cache enabled. * * @return boolean */ public function getWritable() { return $this->writable; } /** * Triggers an option event if this options instance has a connection to * an adapter implements EventsCapableInterface. * * @param string $optionName * @param mixed $optionValue * @return void */ protected function triggerOptionEvent($optionName, $optionValue) { if ($this->adapter instanceof EventsCapableInterface) { $event = new Event('option', $this->adapter, new ArrayObject(array($optionName => $optionValue))); $this->adapter->getEventManager()->trigger($event); } } /** * Validates and normalize a TTL. * * @param int|float $ttl * @throws Exception\InvalidArgumentException * @return void */ protected function normalizeTtl(&$ttl) { if (!is_int($ttl)) { $ttl = (float) $ttl; // convert to int if possible if ($ttl === (float) (int) $ttl) { $ttl = (int) $ttl; } } if ($ttl < 0) { throw new Exception\InvalidArgumentException("TTL can't be negative"); } } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/Adapter/Apc.php000066400000000000000000000506661226600447100225070ustar00rootroot00000000000000 0) { throw new Exception\ExtensionNotLoadedException("Missing ext/apc >= 3.1.6"); } $enabled = ini_get('apc.enabled'); if (PHP_SAPI == 'cli') { $enabled = $enabled && (bool) ini_get('apc.enable_cli'); } if (!$enabled) { throw new Exception\ExtensionNotLoadedException( "ext/apc is disabled - see 'apc.enabled' and 'apc.enable_cli'" ); } parent::__construct($options); } /* options */ /** * Set options. * * @param array|Traversable|ApcOptions $options * @return Apc * @see getOptions() */ public function setOptions($options) { if (!$options instanceof ApcOptions) { $options = new ApcOptions($options); } return parent::setOptions($options); } /** * Get options. * * @return ApcOptions * @see setOptions() */ public function getOptions() { if (!$this->options) { $this->setOptions(new ApcOptions()); } return $this->options; } /* TotalSpaceCapableInterface */ /** * Get total space in bytes * * @return int|float */ public function getTotalSpace() { if ($this->totalSpace !== null) { $smaInfo = apc_sma_info(true); $this->totalSpace = $smaInfo['num_seg'] * $smaInfo['seg_size']; } return $this->totalSpace; } /* AvailableSpaceCapableInterface */ /** * Get available space in bytes * * @return int|float */ public function getAvailableSpace() { $smaInfo = apc_sma_info(true); return $smaInfo['avail_mem']; } /* IterableInterface */ /** * Get the storage iterator * * @return ApcIterator */ public function getIterator() { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $pattern = '/^' . preg_quote($prefix, '/') . '/'; $baseIt = new BaseApcIterator('user', $pattern, 0, 1, \APC_LIST_ACTIVE); return new ApcIterator($this, $baseIt, $prefix); } /* FlushableInterface */ /** * Flush the whole storage * * @return boolean */ public function flush() { return apc_clear_cache('user'); } /* ClearByNamespaceInterface */ /** * Remove items by given namespace * * @param string $namespace * @return boolean */ public function clearByNamespace($namespace) { $options = $this->getOptions(); $prefix = $namespace . $options->getNamespaceSeparator(); $pattern = '/^' . preg_quote($prefix, '/') . '+/'; return apc_delete(new BaseApcIterator('user', $pattern, 0, 1, \APC_LIST_ACTIVE)); } /* ClearByPrefixInterface */ /** * Remove items matching given prefix * * @param string $prefix * @return boolean */ public function clearByPrefix($prefix) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator() . $prefix; $pattern = '/^' . preg_quote($prefix, '/') . '+/'; return apc_delete(new BaseApcIterator('user', $pattern, 0, 1, \APC_LIST_ACTIVE)); } /* reading */ /** * Internal method to get an item. * * @param string $normalizedKey * @param boolean $success * @param mixed $casToken * @return mixed Data on success, null on failure * @throws Exception\ExceptionInterface */ protected function internalGetItem(& $normalizedKey, & $success = null, & $casToken = null) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $internalKey = $prefix . $normalizedKey; $result = apc_fetch($internalKey, $success); if (!$success) { return null; } $casToken = $result; return $result; } /** * Internal method to get multiple items. * * @param array $normalizedKeys * @return array Associative array of keys and values * @throws Exception\ExceptionInterface */ protected function internalGetItems(array & $normalizedKeys) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $internalKeys = array(); foreach ($normalizedKeys as $normalizedKey) { $internalKeys[] = $prefix . $normalizedKey; } $fetch = apc_fetch($internalKeys); // remove namespace prefix $prefixL = strlen($prefix); $result = array(); foreach ($fetch as $internalKey => & $value) { $result[ substr($internalKey, $prefixL) ] = $value; } return $result; } /** * Internal method to test if an item exists. * * @param string $normalizedKey * @return boolean * @throws Exception\ExceptionInterface */ protected function internalHasItem(& $normalizedKey) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); return apc_exists($prefix . $normalizedKey); } /** * Internal method to test multiple items. * * @param array $normalizedKeys * @return array Array of found keys * @throws Exception\ExceptionInterface */ protected function internalHasItems(array & $normalizedKeys) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $internalKeys = array(); foreach ($normalizedKeys as $normalizedKey) { $internalKeys[] = $prefix . $normalizedKey; } $exists = apc_exists($internalKeys); $result = array(); $prefixL = strlen($prefix); foreach ($exists as $internalKey => $bool) { if ($bool === true) { $result[] = substr($internalKey, $prefixL); } } return $result; } /** * Get metadata of an item. * * @param string $normalizedKey * @return array|boolean Metadata on success, false on failure * @throws Exception\ExceptionInterface */ protected function internalGetMetadata(& $normalizedKey) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $internalKey = $prefix . $normalizedKey; // @see http://pecl.php.net/bugs/bug.php?id=22564 if (!apc_exists($internalKey)) { $metadata = false; } else { $format = \APC_ITER_ALL ^ \APC_ITER_VALUE ^ \APC_ITER_TYPE ^ \APC_ITER_REFCOUNT; $regexp = '/^' . preg_quote($internalKey, '/') . '$/'; $it = new BaseApcIterator('user', $regexp, $format, 100, \APC_LIST_ACTIVE); $metadata = $it->current(); } if (!$metadata) { return false; } $this->normalizeMetadata($metadata); return $metadata; } /** * Get metadata of multiple items * * @param array $normalizedKeys * @return array Associative array of keys and metadata * * @triggers getMetadatas.pre(PreEvent) * @triggers getMetadatas.post(PostEvent) * @triggers getMetadatas.exception(ExceptionEvent) */ protected function internalGetMetadatas(array & $normalizedKeys) { $keysRegExp = array(); foreach ($normalizedKeys as $normalizedKey) { $keysRegExp[] = preg_quote($normalizedKey, '/'); } $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $regexp = '/^' . preg_quote($prefix, '/') . '(' . implode('|', $keysRegExp) . ')' . '$/'; $format = \APC_ITER_ALL ^ \APC_ITER_VALUE ^ \APC_ITER_TYPE ^ \APC_ITER_REFCOUNT; $it = new BaseApcIterator('user', $regexp, $format, 100, \APC_LIST_ACTIVE); $result = array(); $prefixL = strlen($prefix); foreach ($it as $internalKey => $metadata) { // @see http://pecl.php.net/bugs/bug.php?id=22564 if (!apc_exists($internalKey)) { continue; } $this->normalizeMetadata($metadata); $result[ substr($internalKey, $prefixL) ] = & $metadata; } return $result; } /* writing */ /** * Internal method to store an item. * * @param string $normalizedKey * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface */ protected function internalSetItem(& $normalizedKey, & $value) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $internalKey = $prefix . $normalizedKey; $ttl = $options->getTtl(); if (!apc_store($internalKey, $value, $ttl)) { $type = is_object($value) ? get_class($value) : gettype($value); throw new Exception\RuntimeException( "apc_store('{$internalKey}', <{$type}>, {$ttl}) failed" ); } return true; } /** * Internal method to store multiple items. * * @param array $normalizedKeyValuePairs * @return array Array of not stored keys * @throws Exception\ExceptionInterface */ protected function internalSetItems(array & $normalizedKeyValuePairs) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $internalKeyValuePairs = array(); foreach ($normalizedKeyValuePairs as $normalizedKey => &$value) { $internalKey = $prefix . $normalizedKey; $internalKeyValuePairs[$internalKey] = &$value; } $failedKeys = apc_store($internalKeyValuePairs, null, $options->getTtl()); $failedKeys = array_keys($failedKeys); // remove prefix $prefixL = strlen($prefix); foreach ($failedKeys as & $key) { $key = substr($key, $prefixL); } return $failedKeys; } /** * Add an item. * * @param string $normalizedKey * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface */ protected function internalAddItem(& $normalizedKey, & $value) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $internalKey = $prefix . $normalizedKey; $ttl = $options->getTtl(); if (!apc_add($internalKey, $value, $ttl)) { if (apc_exists($internalKey)) { return false; } $type = is_object($value) ? get_class($value) : gettype($value); throw new Exception\RuntimeException( "apc_add('{$internalKey}', <{$type}>, {$ttl}) failed" ); } return true; } /** * Internal method to add multiple items. * * @param array $normalizedKeyValuePairs * @return array Array of not stored keys * @throws Exception\ExceptionInterface */ protected function internalAddItems(array & $normalizedKeyValuePairs) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $internalKeyValuePairs = array(); foreach ($normalizedKeyValuePairs as $normalizedKey => $value) { $internalKey = $prefix . $normalizedKey; $internalKeyValuePairs[$internalKey] = $value; } $failedKeys = apc_add($internalKeyValuePairs, null, $options->getTtl()); $failedKeys = array_keys($failedKeys); // remove prefix $prefixL = strlen($prefix); foreach ($failedKeys as & $key) { $key = substr($key, $prefixL); } return $failedKeys; } /** * Internal method to replace an existing item. * * @param string $normalizedKey * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface */ protected function internalReplaceItem(& $normalizedKey, & $value) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $internalKey = $prefix . $normalizedKey; $ttl = $options->getTtl(); if (!apc_exists($internalKey)) { return false; } if (!apc_store($internalKey, $value, $ttl)) { $type = is_object($value) ? get_class($value) : gettype($value); throw new Exception\RuntimeException( "apc_store('{$internalKey}', <{$type}>, {$ttl}) failed" ); } return true; } /** * Internal method to remove an item. * * @param string $normalizedKey * @return boolean * @throws Exception\ExceptionInterface */ protected function internalRemoveItem(& $normalizedKey) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $internalKey = $prefix . $normalizedKey; return apc_delete($internalKey); } /** * Internal method to remove multiple items. * * @param array $normalizedKeys * @return array Array of not removed keys * @throws Exception\ExceptionInterface */ protected function internalRemoveItems(array & $normalizedKeys) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $internalKeys = array(); foreach ($normalizedKeys as $normalizedKey) { $internalKeys[] = $prefix . $normalizedKey; } $failedKeys = apc_delete($internalKeys); // remove prefix $prefixL = strlen($prefix); foreach ($failedKeys as & $key) { $key = substr($key, $prefixL); } return $failedKeys; } /** * Internal method to increment an item. * * @param string $normalizedKey * @param int $value * @return int|boolean The new value on success, false on failure * @throws Exception\ExceptionInterface */ protected function internalIncrementItem(& $normalizedKey, & $value) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $internalKey = $prefix . $normalizedKey; $ttl = $options->getTtl(); $value = (int) $value; $newValue = apc_inc($internalKey, $value); // initial value if ($newValue === false) { $ttl = $options->getTtl(); $newValue = $value; if (!apc_add($internalKey, $newValue, $ttl)) { throw new Exception\RuntimeException( "apc_add('{$internalKey}', {$newValue}, {$ttl}) failed" ); } } return $newValue; } /** * Internal method to decrement an item. * * @param string $normalizedKey * @param int $value * @return int|boolean The new value on success, false on failure * @throws Exception\ExceptionInterface */ protected function internalDecrementItem(& $normalizedKey, & $value) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $internalKey = $prefix . $normalizedKey; $value = (int) $value; $newValue = apc_dec($internalKey, $value); // initial value if ($newValue === false) { $ttl = $options->getTtl(); $newValue = -$value; if (!apc_add($internalKey, $newValue, $ttl)) { throw new Exception\RuntimeException( "apc_add('{$internalKey}', {$newValue}, {$ttl}) failed" ); } } return $newValue; } /* status */ /** * Internal method to get capabilities of this adapter * * @return Capabilities */ protected function internalGetCapabilities() { if ($this->capabilities === null) { $marker = new stdClass(); $capabilities = new Capabilities( $this, $marker, array( 'supportedDatatypes' => array( 'NULL' => true, 'boolean' => true, 'integer' => true, 'double' => true, 'string' => true, 'array' => true, 'object' => 'object', 'resource' => false, ), 'supportedMetadata' => array( 'internal_key', 'atime', 'ctime', 'mtime', 'rtime', 'size', 'hits', 'ttl', ), 'minTtl' => 1, 'maxTtl' => 0, 'staticTtl' => true, 'ttlPrecision' => 1, 'useRequestTime' => (bool) ini_get('apc.use_request_time'), 'expiredRead' => false, 'maxKeyLength' => 5182, 'namespaceIsPrefix' => true, 'namespaceSeparator' => $this->getOptions()->getNamespaceSeparator(), ) ); // update namespace separator on change option $this->getEventManager()->attach('option', function ($event) use ($capabilities, $marker) { $params = $event->getParams(); if (isset($params['namespace_separator'])) { $capabilities->setNamespaceSeparator($marker, $params['namespace_separator']); } }); $this->capabilities = $capabilities; $this->capabilityMarker = $marker; } return $this->capabilities; } /* internal */ /** * Normalize metadata to work with APC * * @param array $metadata * @return void */ protected function normalizeMetadata(array & $metadata) { $metadata['internal_key'] = $metadata['key']; $metadata['ctime'] = $metadata['creation_time']; $metadata['atime'] = $metadata['access_time']; $metadata['rtime'] = $metadata['deletion_time']; $metadata['size'] = $metadata['mem_size']; $metadata['hits'] = $metadata['num_hits']; unset( $metadata['key'], $metadata['creation_time'], $metadata['access_time'], $metadata['deletion_time'], $metadata['mem_size'], $metadata['num_hits'] ); } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/Adapter/ApcIterator.php000066400000000000000000000063131226600447100242070ustar00rootroot00000000000000storage = $storage; $this->baseIterator = $baseIterator; $this->prefixLength = strlen($prefix); } /** * Get storage instance * * @return Apc */ public function getStorage() { return $this->storage; } /** * Get iterator mode * * @return int Value of IteratorInterface::CURRENT_AS_* */ public function getMode() { return $this->mode; } /** * Set iterator mode * * @param int $mode * @return ApcIterator Fluent interface */ public function setMode($mode) { $this->mode = (int) $mode; return $this; } /* Iterator */ /** * Get current key, value or metadata. * * @return mixed */ public function current() { if ($this->mode == IteratorInterface::CURRENT_AS_SELF) { return $this; } $key = $this->key(); if ($this->mode == IteratorInterface::CURRENT_AS_VALUE) { return $this->storage->getItem($key); } elseif ($this->mode == IteratorInterface::CURRENT_AS_METADATA) { return $this->storage->getMetadata($key); } return $key; } /** * Get current key * * @return string */ public function key() { $key = $this->baseIterator->key(); // remove namespace prefix return substr($key, $this->prefixLength); } /** * Move forward to next element * * @return void */ public function next() { $this->baseIterator->next(); } /** * Checks if current position is valid * * @return boolean */ public function valid() { return $this->baseIterator->valid(); } /** * Rewind the Iterator to the first element. * * @return void */ public function rewind() { return $this->baseIterator->rewind(); } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/Adapter/ApcOptions.php000066400000000000000000000023401226600447100240450ustar00rootroot00000000000000triggerOptionEvent('namespace_separator', $namespaceSeparator); $this->namespaceSeparator = $namespaceSeparator; return $this; } /** * Get namespace separator * * @return string */ public function getNamespaceSeparator() { return $this->namespaceSeparator; } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/Adapter/Dba.php000066400000000000000000000342441226600447100224640ustar00rootroot00000000000000_close(); parent::__destruct(); } /* options */ /** * Set options. * * @param array|Traversable|DbaOptions $options * @return Apc * @see getOptions() */ public function setOptions($options) { if (!$options instanceof DbaOptions) { $options = new DbaOptions($options); } return parent::setOptions($options); } /** * Get options. * * @return DbaOptions * @see setOptions() */ public function getOptions() { if (!$this->options) { $this->setOptions(new DbaOptions()); } return $this->options; } /* TotalSpaceCapableInterface */ /** * Get total space in bytes * * @return int|float */ public function getTotalSpace() { if ($this->totalSpace === null) { $pathname = $this->getOptions()->getPathname(); if ($pathname === '') { throw new Exception\LogicException('No pathname to database file'); } ErrorHandler::start(); $total = disk_total_space(dirname($pathname)); $error = ErrorHandler::stop(); if ($total === false) { throw new Exception\RuntimeException("Can't detect total space of '{$pathname}'", 0, $error); } $this->totalSpace = $total; // clean total space buffer on change pathname $events = $this->getEventManager(); $handle = null; $totalSpace = & $this->totalSpace; $callback = function ($event) use (& $events, & $handle, & $totalSpace) { $params = $event->getParams(); if (isset($params['pathname'])) { $totalSpace = null; $events->detach($handle); } }; $handle = $events->attach('option', $callback); } return $this->totalSpace; } /* AvailableSpaceCapableInterface */ /** * Get available space in bytes * * @return int|float */ public function getAvailableSpace() { $pathname = $this->getOptions()->getPathname(); if ($pathname === '') { throw new Exception\LogicException('No pathname to database file'); } ErrorHandler::start(); $avail = disk_free_space(dirname($pathname)); $error = ErrorHandler::stop(); if ($avail === false) { throw new Exception\RuntimeException("Can't detect free space of '{$pathname}'", 0, $error); } return $avail; } /* FlushableInterface */ /** * Flush the whole storage * * @return boolean */ public function flush() { $pathname = $this->getOptions()->getPathname(); if ($pathname === '') { throw new Exception\LogicException('No pathname to database file'); } if (file_exists($pathname)) { // close the dba file before delete // and reopen (create) on next use $this->_close(); ErrorHandler::start(); $result = unlink($pathname); $error = ErrorHandler::stop(); if (!$result) { throw new Exception\RuntimeException("unlink('{$pathname}') failed", 0, $error); } } return true; } /* ClearByNamespaceInterface */ /** * Remove items by given namespace * * @param string $namespace * @return boolean */ public function clearByNamespace($namespace) { $prefix = $namespace . $this->getOptions()->getNamespaceSeparator(); $prefixl = strlen($prefix); $result = true; $this->_open(); do { // Workaround for PHP-Bug #62491 & #62492 $recheck = false; $internalKey = dba_firstkey($this->handle); while ($internalKey !== false && $internalKey !== null) { if (substr($internalKey, 0, $prefixl) === $prefix) { $result = dba_delete($internalKey, $this->handle) && $result; } $internalKey = dba_nextkey($this->handle); } } while ($recheck); return $result; } /* ClearByPrefixInterface */ /** * Remove items matching given prefix * * @param string $prefix * @return boolean */ public function clearByPrefix($prefix) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator() . $prefix; $prefixl = strlen($prefix); $result = true; $this->_open(); do { // Workaround for PHP-Bug #62491 & #62492 $recheck = false; $internalKey = dba_firstkey($this->handle); while ($internalKey !== false && $internalKey !== null) { if (substr($internalKey, 0, $prefixl) === $prefix) { $result = dba_delete($internalKey, $this->handle) && $result; $recheck = true; } $internalKey = dba_nextkey($this->handle); } } while ($recheck); return $result; } /* IterableInterface */ /** * Get the storage iterator * * @return ApcIterator */ public function getIterator() { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); return new DbaIterator($this, $this->handle, $prefix); } /* OptimizableInterface */ /** * Optimize the storage * * @return boolean * @return Exception\RuntimeException */ public function optimize() { $this->_open(); if (!dba_optimize($this->handle)) { throw new Exception\RuntimeException('dba_optimize failed'); } return true; } /* reading */ /** * Internal method to get an item. * * @param string $normalizedKey * @param boolean $success * @param mixed $casToken * @return mixed Data on success, null on failure * @throws Exception\ExceptionInterface */ protected function internalGetItem(& $normalizedKey, & $success = null, & $casToken = null) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $internalKey = $prefix . $normalizedKey; $this->_open(); $value = dba_fetch($internalKey, $this->handle); if ($value === false) { $success = false; return null; } $success = true; $casToken = $value; return $value; } /** * Internal method to test if an item exists. * * @param string $normalizedKey * @return boolean * @throws Exception\ExceptionInterface */ protected function internalHasItem(& $normalizedKey) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $internalKey = $prefix . $normalizedKey; $this->_open(); return dba_exists($internalKey, $this->handle); } /* writing */ /** * Internal method to store an item. * * @param string $normalizedKey * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface */ protected function internalSetItem(& $normalizedKey, & $value) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $internalKey = $prefix . $normalizedKey; $this->_open(); if (!dba_replace($internalKey, $value, $this->handle)) { throw new Exception\RuntimeException("dba_replace('{$internalKey}', ...) failed"); } return true; } /** * Add an item. * * @param string $normalizedKey * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface */ protected function internalAddItem(& $normalizedKey, & $value) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $internalKey = $prefix . $normalizedKey; $this->_open(); // Workaround for PHP-Bug #54242 & #62489 if (dba_exists($internalKey, $this->handle)) { return false; } // Workaround for PHP-Bug #54242 & #62489 // dba_insert returns true if key already exists ErrorHandler::start(); $result = dba_insert($internalKey, $value, $this->handle); $error = ErrorHandler::stop(); if (!$result || $error) { return false; } return true; } /** * Internal method to remove an item. * * @param string $normalizedKey * @return boolean * @throws Exception\ExceptionInterface */ protected function internalRemoveItem(& $normalizedKey) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $internalKey = $prefix . $normalizedKey; $this->_open(); // Workaround for PHP-Bug #62490 if (!dba_exists($internalKey, $this->handle)) { return false; } return dba_delete($internalKey, $this->handle); } /* status */ /** * Internal method to get capabilities of this adapter * * @return Capabilities */ protected function internalGetCapabilities() { if ($this->capabilities === null) { $marker = new stdClass(); $capabilities = new Capabilities( $this, $marker, array( 'supportedDatatypes' => array( 'NULL' => 'string', 'boolean' => 'string', 'integer' => 'string', 'double' => 'string', 'string' => true, 'array' => false, 'object' => false, 'resource' => false, ), 'minTtl' => 0, 'supportedMetadata' => array(), 'maxKeyLength' => 0, // TODO: maxKeyLength ???? 'namespaceIsPrefix' => true, 'namespaceSeparator' => $this->getOptions()->getNamespaceSeparator(), ) ); // update namespace separator on change option $this->getEventManager()->attach('option', function ($event) use ($capabilities, $marker) { $params = $event->getParams(); if (isset($params['namespace_separator'])) { $capabilities->setNamespaceSeparator($marker, $params['namespace_separator']); } }); $this->capabilities = $capabilities; $this->capabilityMarker = $marker; } return $this->capabilities; } /** * Open the database if not already done. * * @return void * @throws Exception\LogicException * @throws Exception\RuntimeException */ protected function _open() { if (!$this->handle) { $options = $this->getOptions(); $pathname = $options->getPathname(); $mode = $options->getMode(); $handler = $options->getHandler(); if ($pathname === '') { throw new Exception\LogicException('No pathname to database file'); } ErrorHandler::start(); $dba = dba_open($pathname, $mode, $handler); $err = ErrorHandler::stop(); if (!$dba) { throw new Exception\RuntimeException( "dba_open('{$pathname}', '{$mode}', '{$handler}') failed", 0, $err ); } $this->handle = $dba; } } /** * Close database file if opened * * @return void */ protected function _close() { if ($this->handle) { ErrorHandler::start(E_NOTICE); dba_close($this->handle); ErrorHandler::stop(); $this->handle = null; } } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/Adapter/DbaIterator.php000066400000000000000000000102611226600447100241670ustar00rootroot00000000000000storage = $storage; $this->handle = $handle; $this->prefixLength = strlen($prefix); $this->rewind(); } /** * Get storage instance * * @return Dba */ public function getStorage() { return $this->storage; } /** * Get iterator mode * * @return int Value of IteratorInterface::CURRENT_AS_* */ public function getMode() { return $this->mode; } /** * Set iterator mode * * @param int $mode * @return ApcIterator Fluent interface */ public function setMode($mode) { $this->mode = (int) $mode; return $this; } /* Iterator */ /** * Get current key, value or metadata. * * @return mixed * @throws Exception\RuntimeException */ public function current() { if ($this->mode == IteratorInterface::CURRENT_AS_SELF) { return $this; } $key = $this->key(); if ($this->mode == IteratorInterface::CURRENT_AS_VALUE) { return $this->storage->getItem($key); } elseif ($this->mode == IteratorInterface::CURRENT_AS_METADATA) { return $this->storage->getMetadata($key); } return $key; } /** * Get current key * * @return string * @throws Exception\RuntimeException */ public function key() { if ($this->currentInternalKey === false) { throw new Exception\RuntimeException("Iterater is on an invalid state"); } // remove namespace prefix return substr($this->currentInternalKey, $this->prefixLength); } /** * Move forward to next element * * @return void * @throws Exception\RuntimeException */ public function next() { if ($this->currentInternalKey === false) { throw new Exception\RuntimeException("Iterater is on an invalid state"); } $this->currentInternalKey = dba_nextkey($this->handle); // Workaround for PHP-Bug #62492 if ($this->currentInternalKey === null) { $this->currentInternalKey = false; } } /** * Checks if current position is valid * * @return boolean */ public function valid() { return ($this->currentInternalKey !== false); } /** * Rewind the Iterator to the first element. * * @return void * @throws Exception\RuntimeException */ public function rewind() { if ($this->currentInternalKey === false) { throw new Exception\RuntimeException("Iterator is on an invalid state"); } $this->currentInternalKey = dba_firstkey($this->handle); // Workaround for PHP-Bug #62492 if ($this->currentInternalKey === null) { $this->currentInternalKey = false; } } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/Adapter/DbaOptions.php000066400000000000000000000055671226600447100240460ustar00rootroot00000000000000triggerOptionEvent('namespace_separator', $namespaceSeparator); $this->namespaceSeparator = $namespaceSeparator; return $this; } /** * Get namespace separator * * @return string */ public function getNamespaceSeparator() { return $this->namespaceSeparator; } /** * Set pathname to database file * * @param string $pathname * @return DbaOptions */ public function setPathname($pathname) { $this->pathname = (string) $pathname; $this->triggerOptionEvent('pathname', $pathname); return $this; } /** * Get pathname to database file * * @return string */ public function getPathname() { return $this->pathname; } /** * * * @param string $mode * @return \Zend\Cache\Storage\Adapter\DbaOptions */ public function setMode($mode) { $this->mode = (string) $mode; $this->triggerOptionEvent('mode', $mode); return $this; } public function getMode() { return $this->mode; } public function setHandler($handler) { $handler = (string) $handler; if (!function_exists('dba_handlers') || !in_array($handler, dba_handlers())) { throw new Exception\ExtensionNotLoadedException("DBA-Handler '{$handler}' not supported"); } $this->triggerOptionEvent('handler', $handler); $this->handler = $handler; return $this; } public function getHandler() { return $this->handler; } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/Adapter/Filesystem.php000066400000000000000000001332171226600447100241220ustar00rootroot00000000000000options) { $this->setOptions(new FilesystemOptions()); } return $this->options; } /* FlushableInterface */ /** * Flush the whole storage * * @throws Exception\RuntimeException * @return boolean */ public function flush() { $flags = GlobIterator::SKIP_DOTS | GlobIterator::CURRENT_AS_PATHNAME; $dir = $this->getOptions()->getCacheDir(); $clearFolder = null; $clearFolder = function ($dir) use (& $clearFolder, $flags) { $it = new GlobIterator($dir . \DIRECTORY_SEPARATOR . '*', $flags); foreach ($it as $pathname) { if ($it->isDir()) { $clearFolder($pathname); rmdir($pathname); } else { unlink($pathname); } } }; ErrorHandler::start(); $clearFolder($dir); $error = ErrorHandler::stop(); if ($error) { throw new Exception\RuntimeException("Flushing directory '{$dir}' failed", 0, $error); } return true; } /* ClearExpiredInterface */ /** * Remove expired items * * @return boolean */ public function clearExpired() { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $flags = GlobIterator::SKIP_DOTS | GlobIterator::CURRENT_AS_FILEINFO; $path = $options->getCacheDir() . str_repeat(\DIRECTORY_SEPARATOR . $prefix . '*', $options->getDirLevel()) . \DIRECTORY_SEPARATOR . $prefix . '*.dat'; $glob = new GlobIterator($path, $flags); $time = time(); $ttl = $options->getTtl(); ErrorHandler::start(); foreach ($glob as $entry) { $mtime = $entry->getMTime(); if ($time >= $mtime + $ttl) { $pathname = $entry->getPathname(); unlink($pathname); $tagPathname = substr($pathname, 0, -4) . '.tag'; if (file_exists($tagPathname)) { unlink($tagPathname); } } } $error = ErrorHandler::stop(); if ($error) { throw new Exception\RuntimeException("Failed to clear expired items", 0, $error); } return true; } /* ClearByNamespaceInterface */ /** * Remove items by given namespace * * @param string $namespace * @throws Exception\RuntimeException * @return boolean */ public function clearByNamespace($namespace) { $options = $this->getOptions(); $nsPrefix = $namespace . $options->getNamespaceSeparator(); $flags = GlobIterator::SKIP_DOTS | GlobIterator::CURRENT_AS_PATHNAME; $path = $options->getCacheDir() . str_repeat(\DIRECTORY_SEPARATOR . $nsPrefix . '*', $options->getDirLevel()) . \DIRECTORY_SEPARATOR . $nsPrefix . '*'; $glob = new GlobIterator($path, $flags); ErrorHandler::start(); foreach ($glob as $pathname) { unlink($pathname); } $error = ErrorHandler::stop(); if ($error) { throw new Exception\RuntimeException("Failed to remove file '{$pathname}'", 0, $error); } return true; } /* ClearByPrefixInterface */ /** * Remove items matching given prefix * * @param string $prefix * @throws Exception\RuntimeException * @return boolean */ public function clearByPrefix($prefix) { $options = $this->getOptions(); $nsPrefix = $options->getNamespace() . $options->getNamespaceSeparator(); $flags = GlobIterator::SKIP_DOTS | GlobIterator::CURRENT_AS_PATHNAME; $path = $options->getCacheDir() . str_repeat(\DIRECTORY_SEPARATOR . $nsPrefix . '*', $options->getDirLevel()) . \DIRECTORY_SEPARATOR . $nsPrefix . $prefix . '*'; $glob = new GlobIterator($path, $flags); ErrorHandler::start(); foreach ($glob as $pathname) { unlink($pathname); } $error = ErrorHandler::stop(); if ($error) { throw new Exception\RuntimeException("Failed to remove file '{$pathname}'", 0, $error); } return true; } /* TaggableInterface */ /** * Set tags to an item by given key. * An empty array will remove all tags. * * @param string $key * @param string[] $tags * @return boolean */ public function setTags($key, array $tags) { $this->normalizeKey($key); if (!$this->internalHasItem($key)) { return false; } $filespec = $this->getFileSpec($key); if (!$tags) { $this->unlink($filespec . '.tag'); return true; } $this->putFileContent($filespec . '.tag', implode("\n", $tags)); return true; } /** * Get tags of an item by given key * * @param string $key * @return string[]|FALSE */ public function getTags($key) { $this->normalizeKey($key); if (!$this->internalHasItem($key)) { return false; } $filespec = $this->getFileSpec($key); $tags = array(); if (file_exists($filespec . '.tag')) { $tags = explode("\n", $this->getFileContent($filespec . '.tag')); } return $tags; } /** * Remove items matching given tags. * * If $disjunction only one of the given tags must match * else all given tags must match. * * @param string[] $tags * @param boolean $disjunction * @return boolean */ public function clearByTags(array $tags, $disjunction = false) { if (!$tags) { return true; } $tagCount = count($tags); $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $flags = GlobIterator::SKIP_DOTS | GlobIterator::CURRENT_AS_PATHNAME; $path = $options->getCacheDir() . str_repeat(\DIRECTORY_SEPARATOR . $prefix . '*', $options->getDirLevel()) . \DIRECTORY_SEPARATOR . $prefix . '*.tag'; $glob = new GlobIterator($path, $flags); foreach ($glob as $pathname) { $diff = array_diff($tags, explode("\n", $this->getFileContent($pathname))); $rem = false; if ($disjunction && count($diff) < $tagCount) { $rem = true; } elseif (!$disjunction && !$diff) { $rem = true; } if ($rem) { unlink($pathname); $datPathname = substr($pathname, 0, -4) . '.dat'; if (file_exists($datPathname)) { unlink($datPathname); } } } return true; } /* IterableInterface */ /** * Get the storage iterator * * @return FilesystemIterator */ public function getIterator() { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $path = $options->getCacheDir() . str_repeat(\DIRECTORY_SEPARATOR . $prefix . '*', $options->getDirLevel()) . \DIRECTORY_SEPARATOR . $prefix . '*.dat'; return new FilesystemIterator($this, $path, $prefix); } /* OptimizableInterface */ /** * Optimize the storage * * @return boolean * @return Exception\RuntimeException */ public function optimize() { $baseOptions = $this->getOptions(); if ($baseOptions->getDirLevel()) { // removes only empty directories $this->rmDir( $baseOptions->getCacheDir(), $baseOptions->getNamespace() . $baseOptions->getNamespaceSeparator() ); } return true; } /* TotalSpaceCapableInterface */ /** * Get total space in bytes * * @throws Exception\RuntimeException * @return int|float */ public function getTotalSpace() { if ($this->totalSpace === null) { $path = $this->getOptions()->getCacheDir(); ErrorHandler::start(); $total = disk_total_space($path); $error = ErrorHandler::stop(); if ($total === false) { throw new Exception\RuntimeException("Can't detect total space of '{$path}'", 0, $error); } $this->totalSpace = $total; // clean total space buffer on change cache_dir $events = $this->getEventManager(); $handle = null; $totalSpace = & $this->totalSpace; $callback = function ($event) use (& $events, & $handle, & $totalSpace) { $params = $event->getParams(); if (isset($params['cache_dir'])) { $totalSpace = null; $events->detach($handle); } }; $handle = $events->attach('option', $callback); } return $this->totalSpace; } /* AvailableSpaceCapableInterface */ /** * Get available space in bytes * * @throws Exception\RuntimeException * @return int|float */ public function getAvailableSpace() { $path = $this->getOptions()->getCacheDir(); ErrorHandler::start(); $avail = disk_free_space($path); $error = ErrorHandler::stop(); if ($avail === false) { throw new Exception\RuntimeException("Can't detect free space of '{$path}'", 0, $error); } return $avail; } /* reading */ /** * Get an item. * * @param string $key * @param boolean $success * @param mixed $casToken * @return mixed Data on success, null on failure * @throws Exception\ExceptionInterface * * @triggers getItem.pre(PreEvent) * @triggers getItem.post(PostEvent) * @triggers getItem.exception(ExceptionEvent) */ public function getItem($key, & $success = null, & $casToken = null) { $options = $this->getOptions(); if ($options->getReadable() && $options->getClearStatCache()) { clearstatcache(); } $argn = func_num_args(); if ($argn > 2) { return parent::getItem($key, $success, $casToken); } elseif ($argn > 1) { return parent::getItem($key, $success); } else { return parent::getItem($key); } } /** * Get multiple items. * * @param array $keys * @return array Associative array of keys and values * @throws Exception\ExceptionInterface * * @triggers getItems.pre(PreEvent) * @triggers getItems.post(PostEvent) * @triggers getItems.exception(ExceptionEvent) */ public function getItems(array $keys) { $options = $this->getOptions(); if ($options->getReadable() && $options->getClearStatCache()) { clearstatcache(); } return parent::getItems($keys); } /** * Internal method to get an item. * * @param string $normalizedKey * @param boolean $success * @param mixed $casToken * @return mixed Data on success, null on failure * @throws Exception\ExceptionInterface */ protected function internalGetItem(& $normalizedKey, & $success = null, & $casToken = null) { if (!$this->internalHasItem($normalizedKey)) { $success = false; return null; } try { $filespec = $this->getFileSpec($normalizedKey); $data = $this->getFileContent($filespec . '.dat'); // use filemtime + filesize as CAS token if (func_num_args() > 2) { $casToken = filemtime($filespec . '.dat') . filesize($filespec . '.dat'); } $success = true; return $data; } catch (BaseException $e) { $success = false; throw $e; } } /** * Internal method to get multiple items. * * @param array $normalizedKeys * @return array Associative array of keys and values * @throws Exception\ExceptionInterface */ protected function internalGetItems(array & $normalizedKeys) { $options = $this->getOptions(); $keys = $normalizedKeys; // Don't change argument passed by reference $result = array(); while ($keys) { // LOCK_NB if more than one items have to read $nonBlocking = count($keys) > 1; $wouldblock = null; // read items foreach ($keys as $i => $key) { if (!$this->internalHasItem($key)) { unset($keys[$i]); continue; } $filespec = $this->getFileSpec($key); $data = $this->getFileContent($filespec . '.dat', $nonBlocking, $wouldblock); if ($nonBlocking && $wouldblock) { continue; } else { unset($keys[$i]); } $result[$key] = $data; } // TODO: Don't check ttl after first iteration // $options['ttl'] = 0; } return $result; } /** * Test if an item exists. * * @param string $key * @return boolean * @throws Exception\ExceptionInterface * * @triggers hasItem.pre(PreEvent) * @triggers hasItem.post(PostEvent) * @triggers hasItem.exception(ExceptionEvent) */ public function hasItem($key) { $options = $this->getOptions(); if ($options->getReadable() && $options->getClearStatCache()) { clearstatcache(); } return parent::hasItem($key); } /** * Test multiple items. * * @param array $keys * @return array Array of found keys * @throws Exception\ExceptionInterface * * @triggers hasItems.pre(PreEvent) * @triggers hasItems.post(PostEvent) * @triggers hasItems.exception(ExceptionEvent) */ public function hasItems(array $keys) { $options = $this->getOptions(); if ($options->getReadable() && $options->getClearStatCache()) { clearstatcache(); } return parent::hasItems($keys); } /** * Internal method to test if an item exists. * * @param string $normalizedKey * @return boolean * @throws Exception\ExceptionInterface */ protected function internalHasItem(& $normalizedKey) { $file = $this->getFileSpec($normalizedKey) . '.dat'; if (!file_exists($file)) { return false; } $ttl = $this->getOptions()->getTtl(); if ($ttl) { ErrorHandler::start(); $mtime = filemtime($file); $error = ErrorHandler::stop(); if (!$mtime) { throw new Exception\RuntimeException( "Error getting mtime of file '{$file}'", 0, $error ); } if (time() >= ($mtime + $ttl)) { return false; } } return true; } /** * Get metadata * * @param string $key * @return array|boolean Metadata on success, false on failure */ public function getMetadata($key) { $options = $this->getOptions(); if ($options->getReadable() && $options->getClearStatCache()) { clearstatcache(); } return parent::getMetadata($key); } /** * Get metadatas * * @param array $keys * @param array $options * @return array Associative array of keys and metadata */ public function getMetadatas(array $keys, array $options = array()) { $options = $this->getOptions(); if ($options->getReadable() && $options->getClearStatCache()) { clearstatcache(); } return parent::getMetadatas($keys); } /** * Get info by key * * @param string $normalizedKey * @return array|boolean Metadata on success, false on failure */ protected function internalGetMetadata(& $normalizedKey) { if (!$this->internalHasItem($normalizedKey)) { return false; } $options = $this->getOptions(); $filespec = $this->getFileSpec($normalizedKey); $file = $filespec . '.dat'; $metadata = array( 'filespec' => $filespec, 'mtime' => filemtime($file) ); if (!$options->getNoCtime()) { $metadata['ctime'] = filectime($file); } if (!$options->getNoAtime()) { $metadata['atime'] = fileatime($file); } return $metadata; } /** * Internal method to get multiple metadata * * @param array $normalizedKeys * @return array Associative array of keys and metadata * @throws Exception\ExceptionInterface */ protected function internalGetMetadatas(array & $normalizedKeys) { $options = $this->getOptions(); $result = array(); foreach ($normalizedKeys as $normalizedKey) { $filespec = $this->getFileSpec($normalizedKey); $file = $filespec . '.dat'; $metadata = array( 'filespec' => $filespec, 'mtime' => filemtime($file), ); if (!$options->getNoCtime()) { $metadata['ctime'] = filectime($file); } if (!$options->getNoAtime()) { $metadata['atime'] = fileatime($file); } $result[$normalizedKey] = $metadata; } return $result; } /* writing */ /** * Store an item. * * @param string $key * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface * * @triggers setItem.pre(PreEvent) * @triggers setItem.post(PostEvent) * @triggers setItem.exception(ExceptionEvent) */ public function setItem($key, $value) { $options = $this->getOptions(); if ($options->getWritable() && $options->getClearStatCache()) { clearstatcache(); } return parent::setItem($key, $value); } /** * Store multiple items. * * @param array $keyValuePairs * @return array Array of not stored keys * @throws Exception\ExceptionInterface * * @triggers setItems.pre(PreEvent) * @triggers setItems.post(PostEvent) * @triggers setItems.exception(ExceptionEvent) */ public function setItems(array $keyValuePairs) { $options = $this->getOptions(); if ($options->getWritable() && $options->getClearStatCache()) { clearstatcache(); } return parent::setItems($keyValuePairs); } /** * Add an item. * * @param string $key * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface * * @triggers addItem.pre(PreEvent) * @triggers addItem.post(PostEvent) * @triggers addItem.exception(ExceptionEvent) */ public function addItem($key, $value) { $options = $this->getOptions(); if ($options->getWritable() && $options->getClearStatCache()) { clearstatcache(); } return parent::addItem($key, $value); } /** * Add multiple items. * * @param array $keyValuePairs * @return boolean * @throws Exception\ExceptionInterface * * @triggers addItems.pre(PreEvent) * @triggers addItems.post(PostEvent) * @triggers addItems.exception(ExceptionEvent) */ public function addItems(array $keyValuePairs) { $options = $this->getOptions(); if ($options->getWritable() && $options->getClearStatCache()) { clearstatcache(); } return parent::addItems($keyValuePairs); } /** * Replace an existing item. * * @param string $key * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface * * @triggers replaceItem.pre(PreEvent) * @triggers replaceItem.post(PostEvent) * @triggers replaceItem.exception(ExceptionEvent) */ public function replaceItem($key, $value) { $options = $this->getOptions(); if ($options->getWritable() && $options->getClearStatCache()) { clearstatcache(); } return parent::replaceItem($key, $value); } /** * Replace multiple existing items. * * @param array $keyValuePairs * @return boolean * @throws Exception\ExceptionInterface * * @triggers replaceItems.pre(PreEvent) * @triggers replaceItems.post(PostEvent) * @triggers replaceItems.exception(ExceptionEvent) */ public function replaceItems(array $keyValuePairs) { $options = $this->getOptions(); if ($options->getWritable() && $options->getClearStatCache()) { clearstatcache(); } return parent::replaceItems($keyValuePairs); } /** * Internal method to store an item. * * @param string $normalizedKey * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface */ protected function internalSetItem(& $normalizedKey, & $value) { $filespec = $this->getFileSpec($normalizedKey); $this->prepareDirectoryStructure($filespec); $this->putFileContent($filespec . '.dat', $value); $this->unlink($filespec . '.tag'); return true; } /** * Internal method to store multiple items. * * @param array $normalizedKeyValuePairs * @return array Array of not stored keys * @throws Exception\ExceptionInterface */ protected function internalSetItems(array & $normalizedKeyValuePairs) { $oldUmask = null; // create an associated array of files and contents to write $contents = array(); foreach ($normalizedKeyValuePairs as $key => & $value) { $filespec = $this->getFileSpec($key); $this->prepareDirectoryStructure($filespec); // *.dat file $contents[$filespec . '.dat'] = & $value; // *.tag file $this->unlink($filespec . '.tag'); } // write to disk while ($contents) { $nonBlocking = count($contents) > 1; $wouldblock = null; foreach ($contents as $file => & $content) { $this->putFileContent($file, $content, $nonBlocking, $wouldblock); if (!$nonBlocking || !$wouldblock) { unset($contents[$file]); } } } // return OK return array(); } /** * Set an item only if token matches * * It uses the token received from getItem() to check if the item has * changed before overwriting it. * * @param mixed $token * @param string $key * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface * @see getItem() * @see setItem() */ public function checkAndSetItem($token, $key, $value) { $options = $this->getOptions(); if ($options->getWritable() && $options->getClearStatCache()) { clearstatcache(); } return parent::checkAndSetItem($token, $key, $value); } /** * Internal method to set an item only if token matches * * @param mixed $token * @param string $normalizedKey * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface * @see getItem() * @see setItem() */ protected function internalCheckAndSetItem(& $token, & $normalizedKey, & $value) { if (!$this->internalHasItem($normalizedKey)) { return false; } // use filemtime + filesize as CAS token $file = $this->getFileSpec($normalizedKey) . '.dat'; $check = filemtime($file) . filesize($file); if ($token !== $check) { return false; } return $this->internalSetItem($normalizedKey, $value); } /** * Reset lifetime of an item * * @param string $key * @return boolean * @throws Exception\ExceptionInterface * * @triggers touchItem.pre(PreEvent) * @triggers touchItem.post(PostEvent) * @triggers touchItem.exception(ExceptionEvent) */ public function touchItem($key) { $options = $this->getOptions(); if ($options->getWritable() && $options->getClearStatCache()) { clearstatcache(); } return parent::touchItem($key); } /** * Reset lifetime of multiple items. * * @param array $keys * @return array Array of not updated keys * @throws Exception\ExceptionInterface * * @triggers touchItems.pre(PreEvent) * @triggers touchItems.post(PostEvent) * @triggers touchItems.exception(ExceptionEvent) */ public function touchItems(array $keys) { $options = $this->getOptions(); if ($options->getWritable() && $options->getClearStatCache()) { clearstatcache(); } return parent::touchItems($keys); } /** * Internal method to reset lifetime of an item * * @param string $normalizedKey * @return boolean * @throws Exception\ExceptionInterface */ protected function internalTouchItem(& $normalizedKey) { if (!$this->internalHasItem($normalizedKey)) { return false; } $filespec = $this->getFileSpec($normalizedKey); ErrorHandler::start(); $touch = touch($filespec . '.dat'); $error = ErrorHandler::stop(); if (!$touch) { throw new Exception\RuntimeException( "Error touching file '{$filespec}.dat'", 0, $error ); } return true; } /** * Remove an item. * * @param string $key * @return boolean * @throws Exception\ExceptionInterface * * @triggers removeItem.pre(PreEvent) * @triggers removeItem.post(PostEvent) * @triggers removeItem.exception(ExceptionEvent) */ public function removeItem($key) { $options = $this->getOptions(); if ($options->getWritable() && $options->getClearStatCache()) { clearstatcache(); } return parent::removeItem($key); } /** * Remove multiple items. * * @param array $keys * @return array Array of not removed keys * @throws Exception\ExceptionInterface * * @triggers removeItems.pre(PreEvent) * @triggers removeItems.post(PostEvent) * @triggers removeItems.exception(ExceptionEvent) */ public function removeItems(array $keys) { $options = $this->getOptions(); if ($options->getWritable() && $options->getClearStatCache()) { clearstatcache(); } return parent::removeItems($keys); } /** * Internal method to remove an item. * * @param string $normalizedKey * @return boolean * @throws Exception\ExceptionInterface */ protected function internalRemoveItem(& $normalizedKey) { $filespec = $this->getFileSpec($normalizedKey); if (!file_exists($filespec . '.dat')) { return false; } else { $this->unlink($filespec . '.dat'); $this->unlink($filespec . '.tag'); } return true; } /* status */ /** * Internal method to get capabilities of this adapter * * @return Capabilities */ protected function internalGetCapabilities() { if ($this->capabilities === null) { $marker = new stdClass(); $options = $this->getOptions(); // detect metadata $metadata = array('mtime', 'filespec'); if (!$options->getNoAtime()) { $metadata[] = 'atime'; } if (!$options->getNoCtime()) { $metadata[] = 'ctime'; } $capabilities = new Capabilities( $this, $marker, array( 'supportedDatatypes' => array( 'NULL' => 'string', 'boolean' => 'string', 'integer' => 'string', 'double' => 'string', 'string' => true, 'array' => false, 'object' => false, 'resource' => false, ), 'supportedMetadata' => $metadata, 'minTtl' => 1, 'maxTtl' => 0, 'staticTtl' => false, 'ttlPrecision' => 1, 'expiredRead' => true, 'maxKeyLength' => 251, // 255 - strlen(.dat | .tag) 'namespaceIsPrefix' => true, 'namespaceSeparator' => $options->getNamespaceSeparator(), ) ); // update capabilities on change options $this->getEventManager()->attach('option', function ($event) use ($capabilities, $marker) { $params = $event->getParams(); if (isset($params['namespace_separator'])) { $capabilities->setNamespaceSeparator($marker, $params['namespace_separator']); } if (isset($params['no_atime']) || isset($params['no_ctime'])) { $metadata = $capabilities->getSupportedMetadata(); if (isset($params['no_atime']) && !$params['no_atime']) { $metadata[] = 'atime'; } elseif (isset($params['no_atime']) && ($index = array_search('atime', $metadata)) !== false) { unset($metadata[$index]); } if (isset($params['no_ctime']) && !$params['no_ctime']) { $metadata[] = 'ctime'; } elseif (isset($params['no_ctime']) && ($index = array_search('ctime', $metadata)) !== false) { unset($metadata[$index]); } $capabilities->setSupportedMetadata($marker, $metadata); } }); $this->capabilityMarker = $marker; $this->capabilities = $capabilities; } return $this->capabilities; } /* internal */ /** * Removes directories recursive by namespace * * @param string $dir Directory to delete * @param string $prefix Namespace + Separator * @return bool */ protected function rmDir($dir, $prefix) { $glob = glob( $dir . \DIRECTORY_SEPARATOR . $prefix . '*', \GLOB_ONLYDIR | \GLOB_NOESCAPE | \GLOB_NOSORT ); if (!$glob) { // On some systems glob returns false even on empty result return true; } $ret = true; foreach ($glob as $subdir) { // skip removing current directory if removing of sub-directory failed if ($this->rmDir($subdir, $prefix)) { // ignore not empty directories ErrorHandler::start(); $ret = rmdir($subdir) && $ret; ErrorHandler::stop(); } else { $ret = false; } } return $ret; } /** * Get file spec of the given key and namespace * * @param string $normalizedKey * @return string */ protected function getFileSpec($normalizedKey) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $path = $options->getCacheDir() . \DIRECTORY_SEPARATOR; $level = $options->getDirLevel(); $fileSpecId = $path . $prefix . $normalizedKey . '/' . $level; if ($this->lastFileSpecId !== $fileSpecId) { if ($level > 0) { // create up to 256 directories per directory level $hash = md5($normalizedKey); for ($i = 0, $max = ($level * 2); $i < $max; $i+= 2) { $path .= $prefix . $hash[$i] . $hash[$i+1] . \DIRECTORY_SEPARATOR; } } $this->lastFileSpecId = $fileSpecId; $this->lastFileSpec = $path . $prefix . $normalizedKey; } return $this->lastFileSpec; } /** * Read info file * * @param string $file * @param boolean $nonBlocking Don't block script if file is locked * @param boolean $wouldblock The optional argument is set to TRUE if the lock would block * @return array|boolean The info array or false if file wasn't found * @throws Exception\RuntimeException */ protected function readInfoFile($file, $nonBlocking = false, & $wouldblock = null) { if (!file_exists($file)) { return false; } $content = $this->getFileContent($file, $nonBlocking, $wouldblock); if ($nonBlocking && $wouldblock) { return false; } ErrorHandler::start(); $ifo = unserialize($content); $err = ErrorHandler::stop(); if (!is_array($ifo)) { throw new Exception\RuntimeException( "Corrupted info file '{$file}'", 0, $err ); } return $ifo; } /** * Read a complete file * * @param string $file File complete path * @param boolean $nonBlocking Don't block script if file is locked * @param boolean $wouldblock The optional argument is set to TRUE if the lock would block * @return string * @throws Exception\RuntimeException */ protected function getFileContent($file, $nonBlocking = false, & $wouldblock = null) { $locking = $this->getOptions()->getFileLocking(); $wouldblock = null; ErrorHandler::start(); // if file locking enabled -> file_get_contents can't be used if ($locking) { $fp = fopen($file, 'rb'); if ($fp === false) { $err = ErrorHandler::stop(); throw new Exception\RuntimeException( "Error opening file '{$file}'", 0, $err ); } if ($nonBlocking) { $lock = flock($fp, \LOCK_SH | \LOCK_NB, $wouldblock); if ($wouldblock) { fclose($fp); ErrorHandler::stop(); return; } } else { $lock = flock($fp, \LOCK_SH); } if (!$lock) { fclose($fp); $err = ErrorHandler::stop(); throw new Exception\RuntimeException( "Error locking file '{$file}'", 0, $err ); } $res = stream_get_contents($fp); if ($res === false) { flock($fp, \LOCK_UN); fclose($fp); $err = ErrorHandler::stop(); throw new Exception\RuntimeException( 'Error getting stream contents', 0, $err ); } flock($fp, \LOCK_UN); fclose($fp); // if file locking disabled -> file_get_contents can be used } else { $res = file_get_contents($file, false); if ($res === false) { $err = ErrorHandler::stop(); throw new Exception\RuntimeException( "Error getting file contents for file '{$file}'", 0, $err ); } } ErrorHandler::stop(); return $res; } /** * Prepares a directory structure for the given file(spec) * using the configured directory level. * * @param string $file * @return void * @throws Exception\RuntimeException */ protected function prepareDirectoryStructure($file) { $options = $this->getOptions(); $level = $options->getDirLevel(); // Directory structure is required only if directory level > 0 if (!$level) { return; } // Directory structure already exists $pathname = dirname($file); if (file_exists($pathname)) { return; } $perm = $options->getDirPermission(); $umask = $options->getUmask(); if ($umask !== false && $perm !== false) { $perm = $perm & ~$umask; } ErrorHandler::start(); if ($perm === false || $level == 1) { // build-in mkdir function is enough $umask = ($umask !== false) ? umask($umask) : false; $res = mkdir($pathname, ($perm !== false) ? $perm : 0777, true); if ($umask !== false) { umask($umask); } if (!$res) { $oct = ($perm === false) ? '777' : decoct($perm); $err = ErrorHandler::stop(); throw new Exception\RuntimeException( "mkdir('{$pathname}', 0{$oct}, true) failed", 0, $err ); } if ($perm !== false && !chmod($pathname, $perm)) { $oct = decoct($perm); $err = ErrorHandler::stop(); throw new Exception\RuntimeException( "chmod('{$pathname}', 0{$oct}) failed", 0, $err ); } } else { // build-in mkdir function sets permission together with current umask // which doesn't work well on multo threaded webservers // -> create directories one by one and set permissions // find existing path and missing path parts $parts = array(); $path = $pathname; while (!file_exists($path)) { array_unshift($parts, basename($path)); $nextPath = dirname($path); if ($nextPath === $path) { break; } $path = $nextPath; } // make all missing path parts foreach ($parts as $part) { $path.= \DIRECTORY_SEPARATOR . $part; // create a single directory, set and reset umask immediately $umask = ($umask !== false) ? umask($umask) : false; $res = mkdir($path, ($perm === false) ? 0777 : $perm, false); if ($umask !== false) { umask($umask); } if (!$res) { $oct = ($perm === false) ? '777' : decoct($perm); $err = ErrorHandler::stop(); throw new Exception\RuntimeException( "mkdir('{$path}', 0{$oct}, false) failed" ); } if ($perm !== false && !chmod($path, $perm)) { $oct = decoct($perm); $err = ErrorHandler::stop(); throw new Exception\RuntimeException( "chmod('{$path}', 0{$oct}) failed" ); } } } ErrorHandler::stop(); } /** * Write content to a file * * @param string $file File complete path * @param string $data Data to write * @param boolean $nonBlocking Don't block script if file is locked * @param boolean $wouldblock The optional argument is set to TRUE if the lock would block * @return void * @throws Exception\RuntimeException */ protected function putFileContent($file, $data, $nonBlocking = false, & $wouldblock = null) { $options = $this->getOptions(); $locking = $options->getFileLocking(); $nonBlocking = $locking && $nonBlocking; $wouldblock = null; $umask = $options->getUmask(); $perm = $options->getFilePermission(); if ($umask !== false && $perm !== false) { $perm = $perm & ~$umask; } ErrorHandler::start(); // if locking and non blocking is enabled -> file_put_contents can't used if ($locking && $nonBlocking) { $umask = ($umask !== false) ? umask($umask) : false; $fp = fopen($file, 'cb'); if ($umask) { umask($umask); } if (!$fp) { $err = ErrorHandler::stop(); throw new Exception\RuntimeException( "Error opening file '{$file}'", 0, $err ); } if ($perm !== false && !chmod($file, $perm)) { fclose($fp); $oct = decoct($perm); $err = ErrorHandler::stop(); throw new Exception\RuntimeException("chmod('{$file}', 0{$oct}) failed", 0, $err); } if (!flock($fp, \LOCK_EX | \LOCK_NB, $wouldblock)) { fclose($fp); $err = ErrorHandler::stop(); if ($wouldblock) { return; } else { throw new Exception\RuntimeException("Error locking file '{$file}'", 0, $err); } } if (!fwrite($fp, $data)) { flock($fp, \LOCK_UN); fclose($fp); $err = ErrorHandler::stop(); throw new Exception\RuntimeException("Error writing file '{$file}'", 0, $err); } if (!ftruncate($fp, strlen($data))) { flock($fp, \LOCK_UN); fclose($fp); $err = ErrorHandler::stop(); throw new Exception\RuntimeException("Error truncating file '{$file}'", 0, $err); } flock($fp, \LOCK_UN); fclose($fp); // else -> file_put_contents can be used } else { $flags = 0; if ($locking) { $flags = $flags | \LOCK_EX; } $umask = ($umask !== false) ? umask($umask) : false; $rs = file_put_contents($file, $data, $flags); if ($umask) { umask($umask); } if ($rs === false) { $err = ErrorHandler::stop(); throw new Exception\RuntimeException( "Error writing file '{$file}'", 0, $err ); } if ($perm !== false && !chmod($file, $perm)) { $oct = decoct($perm); $err = ErrorHandler::stop(); throw new Exception\RuntimeException("chmod('{$file}', 0{$oct}) failed", 0, $err); } } ErrorHandler::stop(); } /** * Unlink a file * * @param string $file * @return void * @throw RuntimeException */ protected function unlink($file) { ErrorHandler::start(); $res = unlink($file); $err = ErrorHandler::stop(); // only throw exception if file still exists after deleting if (!$res && file_exists($file)) { throw new Exception\RuntimeException( "Error unlinking file '{$file}'; file still exists", 0, $err ); } } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/Adapter/FilesystemIterator.php000066400000000000000000000072401226600447100256300ustar00rootroot00000000000000storage = $storage; $this->globIterator = new GlobIterator($path, GlobIterator::KEY_AS_FILENAME); $this->prefix = $prefix; $this->prefixLength = strlen($prefix); } /** * Get storage instance * * @return Filesystem */ public function getStorage() { return $this->storage; } /** * Get iterator mode * * @return int Value of IteratorInterface::CURRENT_AS_* */ public function getMode() { return $this->mode; } /** * Set iterator mode * * @param int $mode * @return ApcIterator Fluent interface */ public function setMode($mode) { $this->mode = (int) $mode; return $this; } /* Iterator */ /** * Get current key, value or metadata. * * @return mixed */ public function current() { if ($this->mode == IteratorInterface::CURRENT_AS_SELF) { return $this; } $key = $this->key(); if ($this->mode == IteratorInterface::CURRENT_AS_VALUE) { return $this->storage->getItem($key); } elseif ($this->mode == IteratorInterface::CURRENT_AS_METADATA) { return $this->storage->getMetadata($key); } return $key; } /** * Get current key * * @return string */ public function key() { $filename = $this->globIterator->key(); // return without namespace prefix and file suffix return substr($filename, $this->prefixLength, -4); } /** * Move forward to next element * * @return void */ public function next() { $this->globIterator->next(); } /** * Checks if current position is valid * * @return boolean */ public function valid() { try { return $this->globIterator->valid(); } catch (\LogicException $e) { // @link https://bugs.php.net/bug.php?id=55701 // GlobIterator throws LogicException with message // 'The parent constructor was not called: the object is in an invalid state' return false; } } /** * Rewind the Iterator to the first element. * * @return void */ public function rewind() { return $this->globIterator->rewind(); } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/Adapter/FilesystemOptions.php000066400000000000000000000261601226600447100254740ustar00rootroot00000000000000filePermission = false; $this->dirPermission = false; } parent::__construct($options); } /** * Set cache dir * * @param string $cacheDir * @return FilesystemOptions * @throws Exception\InvalidArgumentException */ public function setCacheDir($cacheDir) { if ($cacheDir !== null) { if (!is_dir($cacheDir)) { throw new Exception\InvalidArgumentException( "Cache directory '{$cacheDir}' not found or not a directory" ); } elseif (!is_writable($cacheDir)) { throw new Exception\InvalidArgumentException( "Cache directory '{$cacheDir}' not writable" ); } elseif (!is_readable($cacheDir)) { throw new Exception\InvalidArgumentException( "Cache directory '{$cacheDir}' not readable" ); } $cacheDir = rtrim(realpath($cacheDir), \DIRECTORY_SEPARATOR); } else { $cacheDir = sys_get_temp_dir(); } $this->triggerOptionEvent('cache_dir', $cacheDir); $this->cacheDir = $cacheDir; return $this; } /** * Get cache dir * * @return null|string */ public function getCacheDir() { if ($this->cacheDir === null) { $this->setCacheDir(null); } return $this->cacheDir; } /** * Set clear stat cache * * @param bool $clearStatCache * @return FilesystemOptions */ public function setClearStatCache($clearStatCache) { $clearStatCache = (bool) $clearStatCache; $this->triggerOptionEvent('clear_stat_cache', $clearStatCache); $this->clearStatCache = $clearStatCache; return $this; } /** * Get clear stat cache * * @return bool */ public function getClearStatCache() { return $this->clearStatCache; } /** * Set dir level * * @param int $dirLevel * @return FilesystemOptions * @throws Exception\InvalidArgumentException */ public function setDirLevel($dirLevel) { $dirLevel = (int) $dirLevel; if ($dirLevel < 0 || $dirLevel > 16) { throw new Exception\InvalidArgumentException( "Directory level '{$dirLevel}' must be between 0 and 16" ); } $this->triggerOptionEvent('dir_level', $dirLevel); $this->dirLevel = $dirLevel; return $this; } /** * Get dir level * * @return int */ public function getDirLevel() { return $this->dirLevel; } /** * Set permission to create directories on unix systems * * @param false|string|int $dirPermission FALSE to disable explicit permission or an octal number * @return FilesystemOptions * @see setUmask * @see setFilePermission * @link http://php.net/manual/function.chmod.php */ public function setDirPermission($dirPermission) { if ($dirPermission !== false) { if (is_string($dirPermission)) { $dirPermission = octdec($dirPermission); } else { $dirPermission = (int) $dirPermission; } // validate if (($dirPermission & 0700) != 0700) { throw new Exception\InvalidArgumentException( 'Invalid directory permission: need permission to execute, read and write by owner' ); } } if ($this->dirPermission !== $dirPermission) { $this->triggerOptionEvent('dir_permission', $dirPermission); $this->dirPermission = $dirPermission; } return $this; } /** * Get permission to create directories on unix systems * * @return false|int */ public function getDirPermission() { return $this->dirPermission; } /** * Set file locking * * @param bool $fileLocking * @return FilesystemOptions */ public function setFileLocking($fileLocking) { $fileLocking = (bool) $fileLocking; $this->triggerOptionEvent('file_locking', $fileLocking); $this->fileLocking = $fileLocking; return $this; } /** * Get file locking * * @return bool */ public function getFileLocking() { return $this->fileLocking; } /** * Set permission to create files on unix systems * * @param false|string|int $filePermission FALSE to disable explicit permission or an octal number * @return FilesystemOptions * @see setUmask * @see setDirPermission * @link http://php.net/manual/function.chmod.php */ public function setFilePermission($filePermission) { if ($filePermission !== false) { if (is_string($filePermission)) { $filePermission = octdec($filePermission); } else { $filePermission = (int) $filePermission; } // validate if (($filePermission & 0600) != 0600) { throw new Exception\InvalidArgumentException( 'Invalid file permission: need permission to read and write by owner' ); } elseif ($filePermission & 0111) { throw new Exception\InvalidArgumentException( "Invalid file permission: Cache files shoudn't be executable" ); } } if ($this->filePermission !== $filePermission) { $this->triggerOptionEvent('file_permission', $filePermission); $this->filePermission = $filePermission; } return $this; } /** * Get permission to create files on unix systems * * @return false|int */ public function getFilePermission() { return $this->filePermission; } /** * Set namespace separator * * @param string $namespaceSeparator * @return FilesystemOptions */ public function setNamespaceSeparator($namespaceSeparator) { $namespaceSeparator = (string) $namespaceSeparator; $this->triggerOptionEvent('namespace_separator', $namespaceSeparator); $this->namespaceSeparator = $namespaceSeparator; return $this; } /** * Get namespace separator * * @return string */ public function getNamespaceSeparator() { return $this->namespaceSeparator; } /** * Set no atime * * @param bool $noAtime * @return FilesystemOptions */ public function setNoAtime($noAtime) { $noAtime = (bool) $noAtime; $this->triggerOptionEvent('no_atime', $noAtime); $this->noAtime = $noAtime; return $this; } /** * Get no atime * * @return bool */ public function getNoAtime() { return $this->noAtime; } /** * Set no ctime * * @param bool $noCtime * @return FilesystemOptions */ public function setNoCtime($noCtime) { $noCtime = (bool) $noCtime; $this->triggerOptionEvent('no_ctime', $noCtime); $this->noCtime = $noCtime; return $this; } /** * Get no ctime * * @return bool */ public function getNoCtime() { return $this->noCtime; } /** * Set the umask to create files and directories on unix systems * * Note: On multithreaded webservers it's better to explicit set file and dir permission. * * @param false|string|int $umask FALSE to disable umask or an octal number * @return FilesystemOptions * @see setFilePermission * @see setDirPermission * @link http://php.net/manual/function.umask.php * @link http://en.wikipedia.org/wiki/Umask */ public function setUmask($umask) { if ($umask !== false) { if (is_string($umask)) { $umask = octdec($umask); } else { $umask = (int) $umask; } // validate if ($umask & 0700) { throw new Exception\InvalidArgumentException( 'Invalid umask: need permission to execute, read and write by owner' ); } // normalize $umask = $umask & 0777; } if ($this->umask !== $umask) { $this->triggerOptionEvent('umask', $umask); $this->umask = $umask; } return $this; } /** * Get the umask to create files and directories on unix systems * * @return false|int */ public function getUmask() { return $this->umask; } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/Adapter/KeyListIterator.php000066400000000000000000000063651226600447100250770ustar00rootroot00000000000000storage = $storage; $this->keys = $keys; $this->count = count($keys); } /** * Get storage instance * * @return StorageInterface */ public function getStorage() { return $this->storage; } /** * Get iterator mode * * @return int Value of IteratorInterface::CURRENT_AS_* */ public function getMode() { return $this->mode; } /** * Set iterator mode * * @param int $mode * @return KeyListIterator Fluent interface */ public function setMode($mode) { $this->mode = (int) $mode; return $this; } /** * Get current key, value or metadata. * * @return mixed */ public function current() { if ($this->mode == IteratorInterface::CURRENT_AS_SELF) { return $this; } $key = $this->key(); if ($this->mode == IteratorInterface::CURRENT_AS_METADATA) { return $this->storage->getMetadata($key); } elseif ($this->mode == IteratorInterface::CURRENT_AS_VALUE) { return $this->storage->getItem($key); } return $key; } /** * Get current key * * @return string */ public function key() { return $this->keys[$this->position]; } /** * Checks if current position is valid * * @return boolean */ public function valid() { return $this->position < $this->count; } /** * Move forward to next element * * @return void */ public function next() { $this->position++; } /** * Rewind the Iterator to the first element. * * @return void */ public function rewind() { $this->position = 0; } /** * Count number of items * * @return int */ public function count() { return $this->count(); } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/Adapter/Memcached.php000066400000000000000000000442531226600447100236450ustar00rootroot00000000000000= 1.0.0'); } parent::__construct($options); } /** * Initialize the internal memcached resource * * @return MemcachedResource */ protected function getMemcachedResource() { if ($this->memcachedResource) { return $this->memcachedResource; } $options = $this->getOptions(); // use a configured resource or a new one $memcached = $options->getMemcachedResource() ?: new MemcachedResource(); // init lib options if (static::$extMemcachedMajorVersion > 1) { $memcached->setOptions($options->getLibOptions()); } else { foreach ($options->getLibOptions() as $k => $v) { $memcached->setOption($k, $v); } } $memcached->setOption(MemcachedResource::OPT_PREFIX_KEY, $options->getNamespace()); // Allow updating namespace $this->getEventManager()->attach('option', function ($event) use ($memcached) { $params = $event->getParams(); if (!isset($params['namespace'])) { // Cannot set lib options after initialization return; } $memcached->setOption(MemcachedResource::OPT_PREFIX_KEY, $params['namespace']); }); // init servers $servers = $options->getServers(); if ($servers) { $memcached->addServers($servers); } // use the initialized resource $this->memcachedResource = $memcached; return $this->memcachedResource; } /* options */ /** * Set options. * * @param array|Traversable|MemcachedOptions $options * @return Memcached * @see getOptions() */ public function setOptions($options) { if (!$options instanceof MemcachedOptions) { $options = new MemcachedOptions($options); } return parent::setOptions($options); } /** * Get options. * * @return MemcachedOptions * @see setOptions() */ public function getOptions() { if (!$this->options) { $this->setOptions(new MemcachedOptions()); } return $this->options; } /* FlushableInterface */ /** * Flush the whole storage * * @return boolean */ public function flush() { $memc = $this->getMemcachedResource(); if (!$memc->flush()) { throw $this->getExceptionByResultCode($memc->getResultCode()); } return true; } /* TotalSpaceCapableInterface */ /** * Get total space in bytes * * @return int|float */ public function getTotalSpace() { $memc = $this->getMemcachedResource(); $stats = $memc->getStats(); if ($stats === false) { throw new Exception\RuntimeException($memc->getResultMessage()); } $mem = array_pop($stats); return $mem['limit_maxbytes']; } /* AvailableSpaceCapableInterface */ /** * Get available space in bytes * * @return int|float */ public function getAvailableSpace() { $memc = $this->getMemcachedResource(); $stats = $memc->getStats(); if ($stats === false) { throw new Exception\RuntimeException($memc->getResultMessage()); } $mem = array_pop($stats); return $mem['limit_maxbytes'] - $mem['bytes']; } /* reading */ /** * Internal method to get an item. * * @param string $normalizedKey * @param boolean $success * @param mixed $casToken * @return mixed Data on success, null on failure * @throws Exception\ExceptionInterface */ protected function internalGetItem(& $normalizedKey, & $success = null, & $casToken = null) { $memc = $this->getMemcachedResource(); if (func_num_args() > 2) { $result = $memc->get($normalizedKey, null, $casToken); } else { $result = $memc->get($normalizedKey); } $success = true; if ($result === false || $result === null) { $rsCode = $memc->getResultCode(); if ($rsCode == MemcachedResource::RES_NOTFOUND) { $result = null; $success = false; } elseif ($rsCode) { $success = false; throw $this->getExceptionByResultCode($rsCode); } } return $result; } /** * Internal method to get multiple items. * * @param array $normalizedKeys * @return array Associative array of keys and values * @throws Exception\ExceptionInterface */ protected function internalGetItems(array & $normalizedKeys) { $memc = $this->getMemcachedResource(); $result = $memc->getMulti($normalizedKeys); if ($result === false) { throw $this->getExceptionByResultCode($memc->getResultCode()); } return $result; } /** * Internal method to test if an item exists. * * @param string $normalizedKey * @return boolean * @throws Exception\ExceptionInterface */ protected function internalHasItem(& $normalizedKey) { $memc = $this->getMemcachedResource(); $value = $memc->get($normalizedKey); if ($value === false || $value === null) { $rsCode = $memc->getResultCode(); if ($rsCode == MemcachedResource::RES_SUCCESS) { return true; } elseif ($rsCode == MemcachedResource::RES_NOTFOUND) { return false; } else { throw $this->getExceptionByResultCode($rsCode); } } return true; } /** * Internal method to test multiple items. * * @param array $normalizedKeys * @return array Array of found keys * @throws Exception\ExceptionInterface */ protected function internalHasItems(array & $normalizedKeys) { $memc = $this->getMemcachedResource(); $result = $memc->getMulti($normalizedKeys); if ($result === false) { throw $this->getExceptionByResultCode($memc->getResultCode()); } return array_keys($result); } /** * Get metadata of multiple items * * @param array $normalizedKeys * @return array Associative array of keys and metadata * @throws Exception\ExceptionInterface */ protected function internalGetMetadatas(array & $normalizedKeys) { $memc = $this->getMemcachedResource(); $result = $memc->getMulti($normalizedKeys); if ($result === false) { throw $this->getExceptionByResultCode($memc->getResultCode()); } foreach ($result as & $value) { $value = array(); } return $result; } /* writing */ /** * Internal method to store an item. * * @param string $normalizedKey * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface */ protected function internalSetItem(& $normalizedKey, & $value) { $memc = $this->getMemcachedResource(); $expiration = $this->expirationTime(); if (!$memc->set($normalizedKey, $value, $expiration)) { throw $this->getExceptionByResultCode($memc->getResultCode()); } return true; } /** * Internal method to store multiple items. * * @param array $normalizedKeyValuePairs * @return array Array of not stored keys * @throws Exception\ExceptionInterface */ protected function internalSetItems(array & $normalizedKeyValuePairs) { $memc = $this->getMemcachedResource(); $expiration = $this->expirationTime(); if (!$memc->setMulti($normalizedKeyValuePairs, $expiration)) { throw $this->getExceptionByResultCode($memc->getResultCode()); } return array(); } /** * Add an item. * * @param string $normalizedKey * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface */ protected function internalAddItem(& $normalizedKey, & $value) { $memc = $this->getMemcachedResource(); $expiration = $this->expirationTime(); if (!$memc->add($normalizedKey, $value, $expiration)) { if ($memc->getResultCode() == MemcachedResource::RES_NOTSTORED) { return false; } throw $this->getExceptionByResultCode($memc->getResultCode()); } return true; } /** * Internal method to replace an existing item. * * @param string $normalizedKey * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface */ protected function internalReplaceItem(& $normalizedKey, & $value) { $memc = $this->getMemcachedResource(); $expiration = $this->expirationTime(); if (!$memc->replace($normalizedKey, $value, $expiration)) { $rsCode = $memc->getResultCode(); if ($rsCode == MemcachedResource::RES_NOTSTORED) { return false; } throw $this->getExceptionByResultCode($rsCode); } return true; } /** * Internal method to set an item only if token matches * * @param mixed $token * @param string $normalizedKey * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface * @see getItem() * @see setItem() */ protected function internalCheckAndSetItem(& $token, & $normalizedKey, & $value) { $memc = $this->getMemcachedResource(); $expiration = $this->expirationTime(); $result = $memc->cas($token, $normalizedKey, $value, $expiration); if ($result === false) { $rsCode = $memc->getResultCode(); if ($rsCode !== 0 && $rsCode != MemcachedResource::RES_DATA_EXISTS) { throw $this->getExceptionByResultCode($rsCode); } } return $result; } /** * Internal method to remove an item. * * @param string $normalizedKey * @return boolean * @throws Exception\ExceptionInterface */ protected function internalRemoveItem(& $normalizedKey) { $memc = $this->getMemcachedResource(); $result = $memc->delete($normalizedKey); if ($result === false) { $rsCode = $memc->getResultCode(); if ($rsCode == MemcachedResource::RES_NOTFOUND) { return false; } elseif ($rsCode != MemcachedResource::RES_SUCCESS) { throw $this->getExceptionByResultCode($rsCode); } } return true; } /** * Internal method to remove multiple items. * * @param array $normalizedKeys * @return array Array of not removed keys * @throws Exception\ExceptionInterface */ protected function internalRemoveItems(array & $normalizedKeys) { // support for removing multiple items at once has been added in ext/memcached-2.0.0 if (static::$extMemcachedMajorVersion < 2) { return parent::internalRemoveItems($normalizedKeys); } $memc = $this->getMemcachedResource(); $rsCodes = $memc->deleteMulti($normalizedKeys); $missingKeys = array(); foreach ($rsCodes as $key => $rsCode) { if ($rsCode !== true && $rsCode != MemcachedResource::RES_SUCCESS) { if ($rsCode != MemcachedResource::RES_NOTFOUND) { throw $this->getExceptionByResultCode($rsCode); } $missingKeys[] = $key; } } return $missingKeys; } /** * Internal method to increment an item. * * @param string $normalizedKey * @param int $value * @return int|boolean The new value on success, false on failure * @throws Exception\ExceptionInterface */ protected function internalIncrementItem(& $normalizedKey, & $value) { $memc = $this->getMemcachedResource(); $value = (int) $value; $newValue = $memc->increment($normalizedKey, $value); if ($newValue === false) { $rsCode = $memc->getResultCode(); // initial value if ($rsCode == MemcachedResource::RES_NOTFOUND) { $newValue = $value; $memc->add($normalizedKey, $newValue, $this->expirationTime()); $rsCode = $memc->getResultCode(); } if ($rsCode) { throw $this->getExceptionByResultCode($rsCode); } } return $newValue; } /** * Internal method to decrement an item. * * @param string $normalizedKey * @param int $value * @return int|boolean The new value on success, false on failure * @throws Exception\ExceptionInterface */ protected function internalDecrementItem(& $normalizedKey, & $value) { $memc = $this->getMemcachedResource(); $value = (int)$value; $newValue = $memc->decrement($normalizedKey, $value); if ($newValue === false) { $rsCode = $memc->getResultCode(); // initial value if ($rsCode == MemcachedResource::RES_NOTFOUND) { $newValue = -$value; $memc->add($normalizedKey, $newValue, $this->expirationTime()); $rsCode = $memc->getResultCode(); } if ($rsCode) { throw $this->getExceptionByResultCode($rsCode); } } return $newValue; } /* status */ /** * Internal method to get capabilities of this adapter * * @return Capabilities */ protected function internalGetCapabilities() { if ($this->capabilities === null) { $this->capabilityMarker = new stdClass(); $this->capabilities = new Capabilities( $this, $this->capabilityMarker, array( 'supportedDatatypes' => array( 'NULL' => true, 'boolean' => true, 'integer' => true, 'double' => true, 'string' => true, 'array' => true, 'object' => 'object', 'resource' => false, ), 'supportedMetadata' => array(), 'minTtl' => 1, 'maxTtl' => 0, 'staticTtl' => true, 'ttlPrecision' => 1, 'useRequestTime' => false, 'expiredRead' => false, 'maxKeyLength' => 255, 'namespaceIsPrefix' => true, ) ); } return $this->capabilities; } /* internal */ /** * Get expiration time by ttl * * Some storage commands involve sending an expiration value (relative to * an item or to an operation requested by the client) to the server. In * all such cases, the actual value sent may either be Unix time (number of * seconds since January 1, 1970, as an integer), or a number of seconds * starting from current time. In the latter case, this number of seconds * may not exceed 60*60*24*30 (number of seconds in 30 days); if the * expiration value is larger than that, the server will consider it to be * real Unix time value rather than an offset from current time. * * @return int */ protected function expirationTime() { $ttl = $this->getOptions()->getTtl(); if ($ttl > 2592000) { return time() + $ttl; } return $ttl; } /** * Generate exception based of memcached result code * * @param int $code * @return Exception\RuntimeException * @throws Exception\InvalidArgumentException On success code */ protected function getExceptionByResultCode($code) { switch ($code) { case MemcachedResource::RES_SUCCESS: throw new Exception\InvalidArgumentException( "The result code '{$code}' (SUCCESS) isn't an error" ); default: return new Exception\RuntimeException($this->getMemcachedResource()->getResultMessage()); } } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/Adapter/MemcachedOptions.php000066400000000000000000000204641226600447100252170ustar00rootroot00000000000000 '127.0.0.1', 'port' => 11211, 'weight' => 0, ), ); /** * List of Libmemcached options to set on initialize * * @var array */ protected $libOptions = array(); /** * Set namespace. * * The option Memcached::OPT_PREFIX_KEY will be used as the namespace. * It can't be longer than 128 characters. * * @see AdapterOptions::setNamespace() * @see MemcachedOptions::setPrefixKey() */ public function setNamespace($namespace) { $namespace = (string) $namespace; if (128 < strlen($namespace)) { throw new Exception\InvalidArgumentException(sprintf( '%s expects a prefix key of no longer than 128 characters', __METHOD__ )); } return parent::setNamespace($namespace); } /** * A memcached resource to share * * @param null|MemcachedResource $memcachedResource * @return MemcachedOptions */ public function setMemcachedResource(MemcachedResource $memcachedResource = null) { if ($this->memcachedResource !== $memcachedResource) { $this->triggerOptionEvent('memcached_resource', $memcachedResource); $this->memcachedResource = $memcachedResource; } return $this; } /** * Get memcached resource to share * * @return null|MemcachedResource */ public function getMemcachedResource() { return $this->memcachedResource; } /** * Add a server to the list * * @param string $host * @param int $port * @param int $weight * @return MemcachedOptions */ public function addServer($host, $port = 11211, $weight = 0) { $new = array( 'host' => $host, 'port' => $port, 'weight' => $weight ); foreach ($this->servers as $server) { $diff = array_diff($new, $server); if (empty($diff)) { // Done -- server is already present return $this; } } $this->servers[] = $new; return $this; } /** * Set a list of memcached servers to add on initialize * * @param string|array $servers list of servers * @return MemcachedOptions * @throws Exception\InvalidArgumentException */ public function setServers($servers) { if (!is_array($servers)) { return $this->setServers(explode(',', $servers)); } $this->servers = array(); foreach ($servers as $server) { // default values $host = null; $port = 11211; $weight = 1; if (!is_array($server) && !is_string($server)) { throw new Exception\InvalidArgumentException('Invalid server specification provided; must be an array or string'); } // parse a single server from an array if (is_array($server)) { if (!isset($server[0]) && !isset($server['host'])) { throw new Exception\InvalidArgumentException("Invalid list of servers given"); } // array(array([, [, ]])[, ...]) if (isset($server[0])) { $host = (string) $server[0]; $port = isset($server[1]) ? (int) $server[1] : $port; $weight = isset($server[2]) ? (int) $server[2] : $weight; } // array(array('host' => [, 'port' => [, 'weight' => ]])[, ...]) if (!isset($server[0]) && isset($server['host'])) { $host = (string)$server['host']; $port = isset($server['port']) ? (int) $server['port'] : $port; $weight = isset($server['weight']) ? (int) $server['weight'] : $weight; } } // parse a single server from a string if (!is_array($server)) { $server = trim($server); if (strpos($server, '://') === false) { $server = 'tcp://' . $server; } $server = parse_url($server); if (!$server) { throw new Exception\InvalidArgumentException("Invalid list of servers given"); } $host = $server['host']; $port = isset($server['port']) ? (int)$server['port'] : $port; if (isset($server['query'])) { $query = null; parse_str($server['query'], $query); if (isset($query['weight'])) { $weight = (int)$query['weight']; } } } if (!$host) { throw new Exception\InvalidArgumentException('The list of servers must contain a host value.'); } $this->addServer($host, $port, $weight); } return $this; } /** * Get Servers * * @return array */ public function getServers() { return $this->servers; } /** * Set libmemcached options * * @param array $libOptions * @return MemcachedOptions * @link http://php.net/manual/memcached.constants.php */ public function setLibOptions(array $libOptions) { $normalizedOptions = array(); foreach ($libOptions as $key => $value) { $this->normalizeLibOptionKey($key); $normalizedOptions[$key] = $value; } $this->triggerOptionEvent('lib_options', $normalizedOptions); $this->libOptions = array_diff_key($this->libOptions, $normalizedOptions) + $normalizedOptions; return $this; } /** * Set libmemcached option * * @param string|int $key * @param mixed $value * @return MemcachedOptions * @link http://php.net/manual/memcached.constants.php */ public function setLibOption($key, $value) { $this->normalizeLibOptionKey($key); $this->triggerOptionEvent('lib_options', array($key, $value)); $this->libOptions[$key] = $value; return $this; } /** * Get libmemcached options * * @return array * @link http://php.net/manual/memcached.constants.php */ public function getLibOptions() { return $this->libOptions; } /** * Get libmemcached option * * @param string|int $key * @return mixed * @link http://php.net/manual/memcached.constants.php */ public function getLibOption($key) { $this->normalizeLibOptionKey($key); if (isset($this->libOptions[$key])) { return $this->libOptions[$key]; } return null; } /** * Normalize libmemcached option name into it's constant value * * @param string|int $key * @throws Exception\InvalidArgumentException */ protected function normalizeLibOptionKey(& $key) { if (is_string($key)) { $const = 'Memcached::OPT_' . str_replace(array(' ', '-'), '_', strtoupper($key)); if (!defined($const)) { throw new Exception\InvalidArgumentException("Unknown libmemcached option '{$key}' ({$const})"); } $key = constant($const); } else { $key = (int) $key; } } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/Adapter/Memory.php000066400000000000000000000463661226600447100232560ustar00rootroot00000000000000 => array( * => array( * 0 => * 1 => * ['tags' => ] * ) * ) * ) * * @var array */ protected $data = array(); /** * Set options. * * @param array|\Traversable|MemoryOptions $options * @return Memory * @see getOptions() */ public function setOptions($options) { if (!$options instanceof MemoryOptions) { $options = new MemoryOptions($options); } return parent::setOptions($options); } /** * Get options. * * @return MemoryOptions * @see setOptions() */ public function getOptions() { if (!$this->options) { $this->setOptions(new MemoryOptions()); } return $this->options; } /* TotalSpaceCapableInterface */ /** * Get total space in bytes * * @return int|float */ public function getTotalSpace() { return $this->getOptions()->getMemoryLimit(); } /* AvailableSpaceCapableInterface */ /** * Get available space in bytes * * @return int|float */ public function getAvailableSpace() { $total = $this->getOptions()->getMemoryLimit(); $avail = $total - (float) memory_get_usage(true); return ($avail > 0) ? $avail : 0; } /* IterableInterface */ /** * Get the storage iterator * * @return KeyListIterator */ public function getIterator() { $ns = $this->getOptions()->getNamespace(); $keys = array(); if (isset($this->data[$ns])) { foreach ($this->data[$ns] as $key => & $tmp) { if ($this->internalHasItem($key)) { $keys[] = $key; } } } return new KeyListIterator($this, $keys); } /* FlushableInterface */ /** * Flush the whole storage * * @return boolean */ public function flush() { $this->data = array(); return true; } /* ClearExpiredInterface */ /** * Remove expired items * * @return boolean */ public function clearExpired() { $ttl = $this->getOptions()->getTtl(); if ($ttl <= 0) { return true; } $ns = $this->getOptions()->getNamespace(); if (!isset($this->data[$ns])) { return true; } $data = & $this->data[$ns]; foreach ($data as $key => & $item) { if (microtime(true) >= $data[$key][1] + $ttl) { unset($data[$key]); } } return true; } /* ClearByPrefixInterface */ /** * Remove items matching given prefix * * @param string $prefix * @return boolean */ public function clearByPrefix($prefix) { $ns = $this->getOptions()->getNamespace(); if (!isset($this->data[$ns])) { return true; } $prefixL = strlen($prefix); $data = & $this->data[$ns]; foreach ($data as $key => & $item) { if (substr($key, 0, $prefixL) === $prefix) { unset($data[$key]); } } return true; } /* TaggableInterface */ /** * Set tags to an item by given key. * An empty array will remove all tags. * * @param string $key * @param string[] $tags * @return boolean */ public function setTags($key, array $tags) { $ns = $this->getOptions()->getNamespace(); if (!$this->data[$ns]) { return false; } $data = & $this->data[$ns]; if (isset($data[$key])) { $data[$key]['tags'] = $tags; return true; } return false; } /** * Get tags of an item by given key * * @param string $key * @return string[]|FALSE */ public function getTags($key) { $ns = $this->getOptions()->getNamespace(); if (!$this->data[$ns]) { return false; } $data = & $this->data[$ns]; if (!isset($data[$key])) { return false; } return isset($data[$key]['tags']) ? $data[$key]['tags'] : array(); } /** * Remove items matching given tags. * * If $disjunction only one of the given tags must match * else all given tags must match. * * @param string[] $tags * @param boolean $disjunction * @return boolean */ public function clearByTags(array $tags, $disjunction = false) { $ns = $this->getOptions()->getNamespace(); if (!$this->data[$ns]) { return true; } $tagCount = count($tags); $data = & $this->data[$ns]; foreach ($data as $key => & $item) { if (isset($item['tags'])) { $diff = array_diff($tags, $item['tags']); if (($disjunction && count($diff) < $tagCount) || (!$disjunction && !$diff)) { unset($data[$key]); } } } return true; } /* reading */ /** * Internal method to get an item. * * @param string $normalizedKey * @param boolean $success * @param mixed $casToken * @return mixed Data on success, null on failure * @throws Exception\ExceptionInterface */ protected function internalGetItem(& $normalizedKey, & $success = null, & $casToken = null) { $options = $this->getOptions(); $ns = $options->getNamespace(); $success = isset($this->data[$ns][$normalizedKey]); if ($success) { $data = & $this->data[$ns][$normalizedKey]; $ttl = $options->getTtl(); if ($ttl && microtime(true) >= ($data[1] + $ttl) ) { $success = false; } } if (!$success) { return null; } $casToken = $data[0]; return $data[0]; } /** * Internal method to get multiple items. * * @param array $normalizedKeys * @return array Associative array of keys and values * @throws Exception\ExceptionInterface */ protected function internalGetItems(array & $normalizedKeys) { $options = $this->getOptions(); $ns = $options->getNamespace(); if (!isset($this->data[$ns])) { return array(); } $data = & $this->data[$ns]; $ttl = $options->getTtl(); $now = microtime(true); $result = array(); foreach ($normalizedKeys as $normalizedKey) { if (isset($data[$normalizedKey])) { if (!$ttl || $now < ($data[$normalizedKey][1] + $ttl) ) { $result[$normalizedKey] = $data[$normalizedKey][0]; } } } return $result; } /** * Internal method to test if an item exists. * * @param string $normalizedKey * @return boolean */ protected function internalHasItem(& $normalizedKey) { $options = $this->getOptions(); $ns = $options->getNamespace(); if (!isset($this->data[$ns][$normalizedKey])) { return false; } // check if expired $ttl = $options->getTtl(); if ($ttl && microtime(true) >= ($this->data[$ns][$normalizedKey][1] + $ttl) ) { return false; } return true; } /** * Internal method to test multiple items. * * @param array $normalizedKeys * @return array Array of found keys */ protected function internalHasItems(array & $normalizedKeys) { $options = $this->getOptions(); $ns = $options->getNamespace(); if (!isset($this->data[$ns])) { return array(); } $data = & $this->data[$ns]; $ttl = $options->getTtl(); $now = microtime(true); $result = array(); foreach ($normalizedKeys as $normalizedKey) { if (isset($data[$normalizedKey])) { if (!$ttl || $now < ($data[$normalizedKey][1] + $ttl) ) { $result[] = $normalizedKey; } } } return $result; } /** * Get metadata of an item. * * @param string $normalizedKey * @return array|boolean Metadata on success, false on failure * @throws Exception\ExceptionInterface * * @triggers getMetadata.pre(PreEvent) * @triggers getMetadata.post(PostEvent) * @triggers getMetadata.exception(ExceptionEvent) */ protected function internalGetMetadata(& $normalizedKey) { if (!$this->internalHasItem($normalizedKey)) { return false; } $ns = $this->getOptions()->getNamespace(); return array( 'mtime' => $this->data[$ns][$normalizedKey][1], ); } /* writing */ /** * Internal method to store an item. * * @param string $normalizedKey * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface */ protected function internalSetItem(& $normalizedKey, & $value) { $options = $this->getOptions(); if (!$this->hasAvailableSpace()) { $memoryLimit = $options->getMemoryLimit(); throw new Exception\OutOfSpaceException( "Memory usage exceeds limit ({$memoryLimit})." ); } $ns = $options->getNamespace(); $this->data[$ns][$normalizedKey] = array($value, microtime(true)); return true; } /** * Internal method to store multiple items. * * @param array $normalizedKeyValuePairs * @return array Array of not stored keys * @throws Exception\ExceptionInterface */ protected function internalSetItems(array & $normalizedKeyValuePairs) { $options = $this->getOptions(); if (!$this->hasAvailableSpace()) { $memoryLimit = $options->getMemoryLimit(); throw new Exception\OutOfSpaceException( "Memory usage exceeds limit ({$memoryLimit})." ); } $ns = $options->getNamespace(); if (!isset($this->data[$ns])) { $this->data[$ns] = array(); } $data = & $this->data[$ns]; $now = microtime(true); foreach ($normalizedKeyValuePairs as $normalizedKey => $value) { $data[$normalizedKey] = array($value, $now); } return array(); } /** * Add an item. * * @param string $normalizedKey * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface */ protected function internalAddItem(& $normalizedKey, & $value) { $options = $this->getOptions(); if (!$this->hasAvailableSpace()) { $memoryLimit = $options->getMemoryLimit(); throw new Exception\OutOfSpaceException( "Memory usage exceeds limit ({$memoryLimit})." ); } $ns = $options->getNamespace(); if (isset($this->data[$ns][$normalizedKey])) { return false; } $this->data[$ns][$normalizedKey] = array($value, microtime(true)); return true; } /** * Internal method to add multiple items. * * @param array $normalizedKeyValuePairs * @return array Array of not stored keys * @throws Exception\ExceptionInterface */ protected function internalAddItems(array & $normalizedKeyValuePairs) { $options = $this->getOptions(); if (!$this->hasAvailableSpace()) { $memoryLimit = $options->getMemoryLimit(); throw new Exception\OutOfSpaceException( "Memory usage exceeds limit ({$memoryLimit})." ); } $ns = $options->getNamespace(); if (!isset($this->data[$ns])) { $this->data[$ns] = array(); } $result = array(); $data = & $this->data[$ns]; $now = microtime(true); foreach ($normalizedKeyValuePairs as $normalizedKey => $value) { if (isset($data[$normalizedKey])) { $result[] = $normalizedKey; } else { $data[$normalizedKey] = array($value, $now); } } return $result; } /** * Internal method to replace an existing item. * * @param string $normalizedKey * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface */ protected function internalReplaceItem(& $normalizedKey, & $value) { $ns = $this->getOptions()->getNamespace(); if (!isset($this->data[$ns][$normalizedKey])) { return false; } $this->data[$ns][$normalizedKey] = array($value, microtime(true)); return true; } /** * Internal method to replace multiple existing items. * * @param array $normalizedKeyValuePairs * @return array Array of not stored keys * @throws Exception\ExceptionInterface */ protected function internalReplaceItems(array & $normalizedKeyValuePairs) { $ns = $this->getOptions()->getNamespace(); if (!isset($this->data[$ns])) { return array_keys($normalizedKeyValuePairs); } $result = array(); $data = & $this->data[$ns]; foreach ($normalizedKeyValuePairs as $normalizedKey => $value) { if (!isset($data[$normalizedKey])) { $result[] = $normalizedKey; } else { $data[$normalizedKey] = array($value, microtime(true)); } } return $result; } /** * Internal method to reset lifetime of an item * * @param string $normalizedKey * @return boolean * @throws Exception\ExceptionInterface */ protected function internalTouchItem(& $normalizedKey) { $ns = $this->getOptions()->getNamespace(); if (!isset($this->data[$ns][$normalizedKey])) { return false; } $this->data[$ns][$normalizedKey][1] = microtime(true); return true; } /** * Internal method to remove an item. * * @param string $normalizedKey * @return boolean * @throws Exception\ExceptionInterface */ protected function internalRemoveItem(& $normalizedKey) { $ns = $this->getOptions()->getNamespace(); if (!isset($this->data[$ns][$normalizedKey])) { return false; } unset($this->data[$ns][$normalizedKey]); // remove empty namespace if (!$this->data[$ns]) { unset($this->data[$ns]); } return true; } /** * Internal method to increment an item. * * @param string $normalizedKey * @param int $value * @return int|boolean The new value on success, false on failure * @throws Exception\ExceptionInterface */ protected function internalIncrementItem(& $normalizedKey, & $value) { $ns = $this->getOptions()->getNamespace(); $data = & $this->data[$ns]; if (isset($data[$normalizedKey])) { $data[$normalizedKey][0]+= $value; $data[$normalizedKey][1] = microtime(true); $newValue = $data[$normalizedKey][0]; } else { // initial value $newValue = $value; $data[$normalizedKey] = array($newValue, microtime(true)); } return $newValue; } /** * Internal method to decrement an item. * * @param string $normalizedKey * @param int $value * @return int|boolean The new value on success, false on failure * @throws Exception\ExceptionInterface */ protected function internalDecrementItem(& $normalizedKey, & $value) { $ns = $this->getOptions()->getNamespace(); $data = & $this->data[$ns]; if (isset($data[$normalizedKey])) { $data[$normalizedKey][0]-= $value; $data[$normalizedKey][1] = microtime(true); $newValue = $data[$normalizedKey][0]; } else { // initial value $newValue = -$value; $data[$normalizedKey] = array($newValue, microtime(true)); } return $newValue; } /* status */ /** * Internal method to get capabilities of this adapter * * @return Capabilities */ protected function internalGetCapabilities() { if ($this->capabilities === null) { $this->capabilityMarker = new stdClass(); $this->capabilities = new Capabilities( $this, $this->capabilityMarker, array( 'supportedDatatypes' => array( 'NULL' => true, 'boolean' => true, 'integer' => true, 'double' => true, 'string' => true, 'array' => true, 'object' => true, 'resource' => true, ), 'supportedMetadata' => array('mtime'), 'minTtl' => 1, 'maxTtl' => PHP_INT_MAX, 'staticTtl' => false, 'ttlPrecision' => 0.05, 'expiredRead' => true, 'maxKeyLength' => 0, 'namespaceIsPrefix' => false, 'namespaceSeparator' => '', ) ); } return $this->capabilities; } /* internal */ /** * Has space available to store items? * * @return boolean */ protected function hasAvailableSpace() { $total = $this->getOptions()->getMemoryLimit(); // check memory limit disabled if ($total <= 0) { return true; } $free = $total - (float) memory_get_usage(true); return ($free > 0); } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/Adapter/MemoryOptions.php000066400000000000000000000061121226600447100246130ustar00rootroot00000000000000normalizeMemoryLimit($memoryLimit); if ($this->memoryLimit != $memoryLimit) { $this->triggerOptionEvent('memory_limit', $memoryLimit); $this->memoryLimit = $memoryLimit; } return $this; } /** * Get memory limit * * If the used memory of PHP exceeds this limit an OutOfSpaceException * will be thrown. * * @return int */ public function getMemoryLimit() { if ($this->memoryLimit === null) { // By default use half of PHP's memory limit if possible $memoryLimit = $this->normalizeMemoryLimit(ini_get('memory_limit')); if ($memoryLimit >= 0) { $this->memoryLimit = (int) ($memoryLimit / 2); } else { // disable memory limit $this->memoryLimit = 0; } } return $this->memoryLimit; } /** * Normalized a given value of memory limit into the number of bytes * * @param string|int $value * @throws Exception\InvalidArgumentException * @return int */ protected function normalizeMemoryLimit($value) { if (is_numeric($value)) { return (int) $value; } if (!preg_match('/(\-?\d+)\s*(\w*)/', ini_get('memory_limit'), $matches)) { throw new Exception\InvalidArgumentException("Invalid memory limit '{$value}'"); } $value = (int)$matches[1]; if ($value <= 0) { return 0; } switch (strtoupper($matches[2])) { case 'G': $value*= 1024; // Break intentionally omitted case 'M': $value*= 1024; // Break intentionally omitted case 'K': $value*= 1024; // Break intentionally omitted } return $value; } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/Adapter/WinCache.php000066400000000000000000000357251226600447100234640ustar00rootroot00000000000000options) { $this->setOptions(new WinCacheOptions()); } return $this->options; } /* TotalSpaceCapableInterface */ /** * Get total space in bytes * * @return int|float */ public function getTotalSpace() { $mem = wincache_ucache_meminfo(); return $mem['memory_total']; } /* AvailableSpaceCapableInterface */ /** * Get available space in bytes * * @return int|float */ public function getAvailableSpace() { $mem = wincache_ucache_meminfo(); return $mem['memory_free']; } /* FlushableInterface */ /** * Flush the whole storage * * @return boolean */ public function flush() { return wincache_ucache_clear(); } /* reading */ /** * Internal method to get an item. * * @param string $normalizedKey * @param boolean $success * @param mixed $casToken * @return mixed Data on success, null on failure * @throws Exception\ExceptionInterface */ protected function internalGetItem(& $normalizedKey, & $success = null, & $casToken = null) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $internalKey = $prefix . $normalizedKey; $result = wincache_ucache_get($internalKey, $success); if ($success) { $casToken = $result; } return $result; } /** * Internal method to get multiple items. * * @param array $normalizedKeys * @return array Associative array of keys and values * @throws Exception\ExceptionInterface */ protected function internalGetItems(array & $normalizedKeys) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $internalKeys = array(); foreach ($normalizedKeys as $normalizedKey) { $internalKeys[] = $prefix . $normalizedKey; } $fetch = wincache_ucache_get($internalKeys); // remove namespace prefix $prefixL = strlen($prefix); $result = array(); foreach ($fetch as $internalKey => & $value) { $result[ substr($internalKey, $prefixL) ] = & $value; } return $result; } /** * Internal method to test if an item exists. * * @param string $normalizedKey * @return boolean * @throws Exception\ExceptionInterface */ protected function internalHasItem(& $normalizedKey) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); return wincache_ucache_exists($prefix . $normalizedKey); } /** * Get metadata of an item. * * @param string $normalizedKey * @return array|boolean Metadata on success, false on failure * @throws Exception\ExceptionInterface */ protected function internalGetMetadata(& $normalizedKey) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $internalKey = $prefix . $normalizedKey; $info = wincache_ucache_info(true, $internalKey); if (isset($info['ucache_entries'][1])) { $metadata = $info['ucache_entries'][1]; $this->normalizeMetadata($metadata); return $metadata; } else { return false; } } /* writing */ /** * Internal method to store an item. * * @param string $normalizedKey * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface */ protected function internalSetItem(& $normalizedKey, & $value) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $internalKey = $prefix . $normalizedKey; $ttl = $options->getTtl(); if (!wincache_ucache_set($internalKey, $value, $ttl)) { $type = is_object($value) ? get_class($value) : gettype($value); throw new Exception\RuntimeException( "wincache_ucache_set('{$internalKey}', <{$type}>, {$ttl}) failed" ); } return true; } /** * Internal method to store multiple items. * * @param array $normalizedKeyValuePairs * @return array Array of not stored keys * @throws Exception\ExceptionInterface */ protected function internalSetItems(array & $normalizedKeyValuePairs) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $prefixL = strlen($prefix); $internalKeyValuePairs = array(); foreach ($normalizedKeyValuePairs as $normalizedKey => $value) { $internalKey = $prefix . $normalizedKey; $internalKeyValuePairs[$internalKey] = $value; } $result = wincache_ucache_set($internalKeyValuePairs, null, $options->getTtl()); // remove key prefic foreach ($result as & $key) { $key = substr($key, $prefixL); } return $result; } /** * Add an item. * * @param string $normalizedKey * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface */ protected function internalAddItem(& $normalizedKey, & $value) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $internalKey = $prefix . $normalizedKey; $ttl = $options->getTtl(); if (!wincache_ucache_add($internalKey, $value, $ttl)) { $type = is_object($value) ? get_class($value) : gettype($value); throw new Exception\RuntimeException( "wincache_ucache_add('{$internalKey}', <{$type}>, {$ttl}) failed" ); } return true; } /** * Internal method to add multiple items. * * @param array $normalizedKeyValuePairs * @return array Array of not stored keys * @throws Exception\ExceptionInterface */ protected function internalAddItems(array & $normalizedKeyValuePairs) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $prefixL = strlen($prefix); $internalKeyValuePairs = array(); foreach ($normalizedKeyValuePairs as $normalizedKey => $value) { $internalKey = $prefix . $normalizedKey; $internalKeyValuePairs[$internalKey] = $value; } $result = wincache_ucache_add($internalKeyValuePairs, null, $options->getTtl()); // remove key prefic foreach ($result as & $key) { $key = substr($key, $prefixL); } return $result; } /** * Internal method to replace an existing item. * * @param string $normalizedKey * @param mixed $value * @return boolean * @throws Exception\ExceptionInterface */ protected function internalReplaceItem(& $normalizedKey, & $value) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $internalKey = $prefix . $normalizedKey; if (!wincache_ucache_exists($internalKey)) { return false; } $ttl = $options->getTtl(); if (!wincache_ucache_set($internalKey, $value, $ttl)) { $type = is_object($value) ? get_class($value) : gettype($value); throw new Exception\RuntimeException( "wincache_ucache_set('{$internalKey}', <{$type}>, {$ttl}) failed" ); } return true; } /** * Internal method to remove an item. * * @param string $normalizedKey * @return boolean * @throws Exception\ExceptionInterface */ protected function internalRemoveItem(& $normalizedKey) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $internalKey = $prefix . $normalizedKey; return wincache_ucache_delete($internalKey); } /** * Internal method to remove multiple items. * * @param array $normalizedKeys * @return array Array of not removed keys * @throws Exception\ExceptionInterface */ protected function internalRemoveItems(array & $normalizedKeys) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $internalKeys = array(); foreach ($normalizedKeys as $normalizedKey) { $internalKeys[] = $prefix . $normalizedKey; } $result = wincache_ucache_delete($internalKeys); if ($result === false) { return $normalizedKeys; } elseif ($result) { // remove key prefix $prefixL = strlen($prefix); foreach ($result as & $key) { $key = substr($key, $prefixL); } } return $result; } /** * Internal method to increment an item. * * @param string $normalizedKey * @param int $value * @return int|boolean The new value on success, false on failure * @throws Exception\ExceptionInterface */ protected function internalIncrementItem(& $normalizedKey, & $value) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $internalKey = $prefix . $normalizedKey; return wincache_ucache_inc($internalKey, (int) $value); } /** * Internal method to decrement an item. * * @param string $normalizedKey * @param int $value * @return int|boolean The new value on success, false on failure * @throws Exception\ExceptionInterface */ protected function internalDecrementItem(& $normalizedKey, & $value) { $options = $this->getOptions(); $prefix = $options->getNamespace() . $options->getNamespaceSeparator(); $internalKey = $prefix . $normalizedKey; return wincache_ucache_dec($internalKey, (int) $value); } /* status */ /** * Internal method to get capabilities of this adapter * * @return Capabilities */ protected function internalGetCapabilities() { if ($this->capabilities === null) { $marker = new stdClass(); $capabilities = new Capabilities( $this, $marker, array( 'supportedDatatypes' => array( 'NULL' => true, 'boolean' => true, 'integer' => true, 'double' => true, 'string' => true, 'array' => true, 'object' => 'object', 'resource' => false, ), 'supportedMetadata' => array( 'internal_key', 'ttl', 'hits', 'size' ), 'minTtl' => 1, 'maxTtl' => 0, 'staticTtl' => true, 'ttlPrecision' => 1, 'useRequestTime' => false, 'expiredRead' => false, 'namespaceIsPrefix' => true, 'namespaceSeparator' => $this->getOptions()->getNamespaceSeparator(), ) ); // update namespace separator on change option $this->getEventManager()->attach('option', function ($event) use ($capabilities, $marker) { $params = $event->getParams(); if (isset($params['namespace_separator'])) { $capabilities->setNamespaceSeparator($marker, $params['namespace_separator']); } }); $this->capabilities = $capabilities; $this->capabilityMarker = $marker; } return $this->capabilities; } /* internal */ /** * Normalize metadata to work with WinCache * * @param array $metadata * @return void */ protected function normalizeMetadata(array & $metadata) { $metadata['internal_key'] = $metadata['key_name']; $metadata['hits'] = $metadata['hitcount']; $metadata['ttl'] = $metadata['ttl_seconds']; $metadata['size'] = $metadata['value_size']; unset( $metadata['key_name'], $metadata['hitcount'], $metadata['ttl_seconds'], $metadata['value_size'] ); } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/Adapter/WinCacheOptions.php000066400000000000000000000023531226600447100250270ustar00rootroot00000000000000triggerOptionEvent('namespace_separator', $namespaceSeparator); $this->namespaceSeparator = $namespaceSeparator; return $this; } /** * Get namespace separator * * @return string */ public function getNamespaceSeparator() { return $this->namespaceSeparator; } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/Adapter/ZendServerDisk.php000066400000000000000000000114471226600447100247000ustar00rootroot00000000000000totalSpace !== null) { $path = $this->getOptions()->getCacheDir(); ErrorHandler::start(); $total = disk_total_space($path); $error = ErrorHandler::stop(); if ($total === false) { throw new Exception\RuntimeException("Can't detect total space of '{$path}'", 0, $error); } } return $this->totalSpace; } /* AvailableSpaceCapableInterface */ /** * Get available space in bytes * * @throws Exception\RuntimeException * @return int|float */ public function getAvailableSpace() { $path = $this->getOptions()->getCacheDir(); ErrorHandler::start(); $avail = disk_free_space($path); $error = ErrorHandler::stop(); if ($avail === false) { throw new Exception\RuntimeException("Can't detect free space of '{$path}'", 0, $error); } return $avail; } /* internal */ /** * Store data into Zend Data Disk Cache * * @param string $internalKey * @param mixed $value * @param int $ttl * @return void * @throws Exception\RuntimeException */ protected function zdcStore($internalKey, $value, $ttl) { if (!zend_disk_cache_store($internalKey, $value, $ttl)) { $valueType = gettype($value); throw new Exception\RuntimeException( "zend_disk_cache_store($internalKey, <{$valueType}>, {$ttl}) failed" ); } } /** * Fetch a single item from Zend Data Disk Cache * * @param string $internalKey * @return mixed The stored value or FALSE if item wasn't found * @throws Exception\RuntimeException */ protected function zdcFetch($internalKey) { return zend_disk_cache_fetch((string) $internalKey); } /** * Fetch multiple items from Zend Data Disk Cache * * @param array $internalKeys * @return array All found items * @throws Exception\RuntimeException */ protected function zdcFetchMulti(array $internalKeys) { $items = zend_disk_cache_fetch($internalKeys); if ($items === false) { throw new Exception\RuntimeException("zend_disk_cache_fetch() failed"); } return $items; } /** * Delete data from Zend Data Disk Cache * * @param string $internalKey * @return boolean * @throws Exception\RuntimeException */ protected function zdcDelete($internalKey) { return zend_disk_cache_delete($internalKey); } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/Adapter/ZendServerShm.php000066400000000000000000000072031226600447100245300ustar00rootroot00000000000000, {$ttl}) failed" ); } } /** * Fetch a single item from Zend Data SHM Cache * * @param string $internalKey * @return mixed The stored value or FALSE if item wasn't found * @throws Exception\RuntimeException */ protected function zdcFetch($internalKey) { return zend_shm_cache_fetch((string) $internalKey); } /** * Fetch multiple items from Zend Data SHM Cache * * @param array $internalKeys * @return array All found items * @throws Exception\RuntimeException */ protected function zdcFetchMulti(array $internalKeys) { $items = zend_shm_cache_fetch($internalKeys); if ($items === false) { throw new Exception\RuntimeException("zend_shm_cache_fetch() failed"); } return $items; } /** * Delete data from Zend Data SHM Cache * * @param string $internalKey * @return boolean * @throws Exception\RuntimeException */ protected function zdcDelete($internalKey) { return zend_shm_cache_delete($internalKey); } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/AdapterPluginManager.php000066400000000000000000000042321226600447100244420ustar00rootroot00000000000000 'Zend\Cache\Storage\Adapter\Apc', 'filesystem' => 'Zend\Cache\Storage\Adapter\Filesystem', 'memcached' => 'Zend\Cache\Storage\Adapter\Memcached', 'memory' => 'Zend\Cache\Storage\Adapter\Memory', 'dba' => 'Zend\Cache\Storage\Adapter\Dba', 'wincache' => 'Zend\Cache\Storage\Adapter\WinCache', 'zendserverdisk' => 'Zend\Cache\Storage\Adapter\ZendServerDisk', 'zendservershm' => 'Zend\Cache\Storage\Adapter\ZendServerShm', ); /** * Do not share by default * * @var array */ protected $shareByDefault = false; /** * Validate the plugin * * Checks that the adapter loaded is an instance of StorageInterface. * * @param mixed $plugin * @return void * @throws Exception\RuntimeException if invalid */ public function validatePlugin($plugin) { if ($plugin instanceof StorageInterface) { // we're okay return; } throw new Exception\RuntimeException(sprintf( 'Plugin of type %s is invalid; must implement %s\StorageInterface', (is_object($plugin) ? get_class($plugin) : gettype($plugin)), __NAMESPACE__ )); } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/AvailableSpaceCapableInterface.php000066400000000000000000000011451226600447100263350ustar00rootroot00000000000000storage = $storage; $this->marker = $marker; $this->baseCapabilities = $baseCapabilities; foreach ($capabilities as $name => $value) { $this->setCapability($marker, $name, $value); } } /** * Get the storage adapter * * @return StorageInterface */ public function getAdapter() { return $this->storage; } /** * Get supported datatypes * * @return array */ public function getSupportedDatatypes() { return $this->getCapability('supportedDatatypes', array( 'NULL' => false, 'boolean' => false, 'integer' => false, 'double' => false, 'string' => true, 'array' => false, 'object' => false, 'resource' => false, )); } /** * Set supported datatypes * * @param stdClass $marker * @param array $datatypes * @throws Exception\InvalidArgumentException * @return Capabilities Fluent interface */ public function setSupportedDatatypes(stdClass $marker, array $datatypes) { $allTypes = array( 'array', 'boolean', 'double', 'integer', 'NULL', 'object', 'resource', 'string', ); // check/normalize datatype values foreach ($datatypes as $type => &$toType) { if (!in_array($type, $allTypes)) { throw new Exception\InvalidArgumentException("Unknown datatype '{$type}'"); } if (is_string($toType)) { $toType = strtolower($toType); if (!in_array($toType, $allTypes)) { throw new Exception\InvalidArgumentException("Unknown datatype '{$toType}'"); } } else { $toType = (bool) $toType; } } // add missing datatypes as not supported $missingTypes = array_diff($allTypes, array_keys($datatypes)); foreach ($missingTypes as $type) { $datatypes[$type] = false; } return $this->setCapability($marker, 'supportedDatatypes', $datatypes); } /** * Get supported metadata * * @return array */ public function getSupportedMetadata() { return $this->getCapability('supportedMetadata', array()); } /** * Set supported metadata * * @param stdClass $marker * @param string[] $metadata * @throws Exception\InvalidArgumentException * @return Capabilities Fluent interface */ public function setSupportedMetadata(stdClass $marker, array $metadata) { foreach ($metadata as $name) { if (!is_string($name)) { throw new Exception\InvalidArgumentException('$metadata must be an array of strings'); } } return $this->setCapability($marker, 'supportedMetadata', $metadata); } /** * Get minimum supported time-to-live * * @return int 0 means items never expire */ public function getMinTtl() { return $this->getCapability('minTtl', 0); } /** * Set minimum supported time-to-live * * @param stdClass $marker * @param int $minTtl * @throws Exception\InvalidArgumentException * @return Capabilities Fluent interface */ public function setMinTtl(stdClass $marker, $minTtl) { $minTtl = (int) $minTtl; if ($minTtl < 0) { throw new Exception\InvalidArgumentException('$minTtl must be greater or equal 0'); } return $this->setCapability($marker, 'minTtl', $minTtl); } /** * Get maximum supported time-to-live * * @return int 0 means infinite */ public function getMaxTtl() { return $this->getCapability('maxTtl', 0); } /** * Set maximum supported time-to-live * * @param stdClass $marker * @param int $maxTtl * @throws Exception\InvalidArgumentException * @return Capabilities Fluent interface */ public function setMaxTtl(stdClass $marker, $maxTtl) { $maxTtl = (int) $maxTtl; if ($maxTtl < 0) { throw new Exception\InvalidArgumentException('$maxTtl must be greater or equal 0'); } return $this->setCapability($marker, 'maxTtl', $maxTtl); } /** * Is the time-to-live handled static (on write) * or dynamic (on read) * * @return boolean */ public function getStaticTtl() { return $this->getCapability('staticTtl', false); } /** * Set if the time-to-live handled static (on write) or dynamic (on read) * * @param stdClass $marker * @param boolean $flag * @return Capabilities Fluent interface */ public function setStaticTtl(stdClass $marker, $flag) { return $this->setCapability($marker, 'staticTtl', (bool)$flag); } /** * Get time-to-live precision * * @return float */ public function getTtlPrecision() { return $this->getCapability('ttlPrecision', 1); } /** * Set time-to-live precision * * @param stdClass $marker * @param float $ttlPrecision * @throws Exception\InvalidArgumentException * @return Capabilities Fluent interface */ public function setTtlPrecision(stdClass $marker, $ttlPrecision) { $ttlPrecision = (float) $ttlPrecision; if ($ttlPrecision <= 0) { throw new Exception\InvalidArgumentException('$ttlPrecision must be greater than 0'); } return $this->setCapability($marker, 'ttlPrecision', $ttlPrecision); } /** * Get use request time * * @return boolean */ public function getUseRequestTime() { return $this->getCapability('useRequestTime', false); } /** * Set use request time * * @param stdClass $marker * @param boolean $flag * @return Capabilities Fluent interface */ public function setUseRequestTime(stdClass $marker, $flag) { return $this->setCapability($marker, 'useRequestTime', (bool)$flag); } /** * Get if expired items are readable * * @return boolean */ public function getExpiredRead() { return $this->getCapability('expiredRead', false); } /** * Set if expired items are readable * * @param stdClass $marker * @param boolean $flag * @return Capabilities Fluent interface */ public function setExpiredRead(stdClass $marker, $flag) { return $this->setCapability($marker, 'expiredRead', (bool)$flag); } /** * Get maximum key lenth * * @return int -1 means unknown, 0 means infinite */ public function getMaxKeyLength() { return $this->getCapability('maxKeyLength', -1); } /** * Set maximum key length * * @param stdClass $marker * @param int $maxKeyLength * @throws Exception\InvalidArgumentException * @return Capabilities Fluent interface */ public function setMaxKeyLength(stdClass $marker, $maxKeyLength) { $maxKeyLength = (int) $maxKeyLength; if ($maxKeyLength < -1) { throw new Exception\InvalidArgumentException('$maxKeyLength must be greater or equal than -1'); } return $this->setCapability($marker, 'maxKeyLength', $maxKeyLength); } /** * Get if namespace support is implemented as prefix * * @return boolean */ public function getNamespaceIsPrefix() { return $this->getCapability('namespaceIsPrefix', true); } /** * Set if namespace support is implemented as prefix * * @param stdClass $marker * @param boolean $flag * @return Capabilities Fluent interface */ public function setNamespaceIsPrefix(stdClass $marker, $flag) { return $this->setCapability($marker, 'namespaceIsPrefix', (bool)$flag); } /** * Get namespace separator if namespace is implemented as prefix * * @return string */ public function getNamespaceSeparator() { return $this->getCapability('namespaceSeparator', ''); } /** * Set the namespace separator if namespace is implemented as prefix * * @param stdClass $marker * @param string $separator * @return Capabilities Fluent interface */ public function setNamespaceSeparator(stdClass $marker, $separator) { return $this->setCapability($marker, 'namespaceSeparator', (string) $separator); } /** * Get a capability * * @param string $property * @param mixed $default * @return mixed */ protected function getCapability($property, $default = null) { if ($this->$property !== null) { return $this->$property; } elseif ($this->baseCapabilities) { $getMethod = 'get' . $property; return $this->baseCapabilities->$getMethod(); } return $default; } /** * Change a capability * * @param stdClass $marker * @param string $property * @param mixed $value * @return Capabilities Fluent interface * @throws Exception\InvalidArgumentException */ protected function setCapability(stdClass $marker, $property, $value) { if ($this->marker !== $marker) { throw new Exception\InvalidArgumentException('Invalid marker'); } if ($this->$property !== $value) { $this->$property = $value; // trigger event if ($this->storage instanceof EventsCapableInterface) { $this->storage->getEventManager()->trigger('capability', $this->storage, new ArrayObject(array( $property => $value ))); } } return $this; } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/ClearByNamespaceInterface.php000066400000000000000000000012121226600447100253620ustar00rootroot00000000000000setStorage($target); } /** * Alias of setTarget * * @param StorageInterface $storage * @return Event * @see Zend\EventManager\Event::setTarget() */ public function setStorage(StorageInterface $storage) { $this->target = $storage; return $this; } /** * Alias of getTarget * * @return StorageInterface */ public function getStorage() { return $this->getTarget(); } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/ExceptionEvent.php000066400000000000000000000040741226600447100233540ustar00rootroot00000000000000setException($exception); } /** * Set the exception to be thrown * * @param Exception $exception * @return ExceptionEvent */ public function setException(Exception $exception) { $this->exception = $exception; return $this; } /** * Get the exception to be thrown * * @return Exception */ public function getException() { return $this->exception; } /** * Throw the exception or use the result * * @param boolean $flag * @return ExceptionEvent */ public function setThrowException($flag) { $this->throwException = (bool) $flag; return $this; } /** * Throw the exception or use the result * * @return boolean */ public function getThrowException() { return $this->throwException; } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/FlushableInterface.php000066400000000000000000000011061226600447100241330ustar00rootroot00000000000000options = $options; return $this; } /** * Get all pattern options * * @return PluginOptions */ public function getOptions() { if (null === $this->options) { $this->setOptions(new PluginOptions()); } return $this->options; } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/Plugin/ClearExpiredByFactor.php000066400000000000000000000054071226600447100256540ustar00rootroot00000000000000handles[$index])) { throw new Exception\LogicException('Plugin already attached'); } $handles = array(); $this->handles[$index] = & $handles; $callback = array($this, 'clearExpiredByFactor'); $handles[] = $events->attach('setItem.post', $callback, $priority); $handles[] = $events->attach('setItems.post', $callback, $priority); $handles[] = $events->attach('addItem.post', $callback, $priority); $handles[] = $events->attach('addItems.post', $callback, $priority); return $this; } /** * Detach * * @param EventManagerInterface $events * @return ClearExpiredByFactor * @throws Exception\LogicException */ public function detach(EventManagerInterface $events) { $index = spl_object_hash($events); if (!isset($this->handles[$index])) { throw new Exception\LogicException('Plugin not attached'); } // detach all handles of this index foreach ($this->handles[$index] as $handle) { $events->detach($handle); } // remove all detached handles unset($this->handles[$index]); return $this; } /** * Clear expired items by factor after writing new item(s) * * @param PostEvent $event * @return void */ public function clearExpiredByFactor(PostEvent $event) { $storage = $event->getStorage(); if (!($storage instanceof ClearExpiredInterface)) { return; } $factor = $this->getOptions()->getClearingFactor(); if ($factor && mt_rand(1, $factor) == 1) { $storage->clearExpired(); } } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/Plugin/ExceptionHandler.php000066400000000000000000000101641226600447100251030ustar00rootroot00000000000000handles[$index])) { throw new Exception\LogicException('Plugin already attached'); } $callback = array($this, 'onException'); $handles = array(); $this->handles[$index] = & $handles; // read $handles[] = $events->attach('getItem.exception', $callback, $priority); $handles[] = $events->attach('getItems.exception', $callback, $priority); $handles[] = $events->attach('hasItem.exception', $callback, $priority); $handles[] = $events->attach('hasItems.exception', $callback, $priority); $handles[] = $events->attach('getMetadata.exception', $callback, $priority); $handles[] = $events->attach('getMetadatas.exception', $callback, $priority); // write $handles[] = $events->attach('setItem.exception', $callback, $priority); $handles[] = $events->attach('setItems.exception', $callback, $priority); $handles[] = $events->attach('addItem.exception', $callback, $priority); $handles[] = $events->attach('addItems.exception', $callback, $priority); $handles[] = $events->attach('replaceItem.exception', $callback, $priority); $handles[] = $events->attach('replaceItems.exception', $callback, $priority); $handles[] = $events->attach('touchItem.exception', $callback, $priority); $handles[] = $events->attach('touchItems.exception', $callback, $priority); $handles[] = $events->attach('removeItem.exception', $callback, $priority); $handles[] = $events->attach('removeItems.exception', $callback, $priority); $handles[] = $events->attach('checkAndSetItem.exception', $callback, $priority); // increment / decrement item(s) $handles[] = $events->attach('incrementItem.exception', $callback, $priority); $handles[] = $events->attach('incrementItems.exception', $callback, $priority); $handles[] = $events->attach('decrementItem.exception', $callback, $priority); $handles[] = $events->attach('decrementItems.exception', $callback, $priority); return $this; } /** * Detach * * @param EventManagerInterface $events * @return ExceptionHandler * @throws Exception\LogicException */ public function detach(EventManagerInterface $events) { $index = spl_object_hash($events); if (!isset($this->handles[$index])) { throw new Exception\LogicException('Plugin not attached'); } // detach all handles of this index foreach ($this->handles[$index] as $handle) { $events->detach($handle); } // remove all detached handles unset($this->handles[$index]); return $this; } /** * On exception * * @param ExceptionEvent $event * @return void */ public function onException(ExceptionEvent $event) { $options = $this->getOptions(); $callback = $options->getExceptionCallback(); if ($callback) { call_user_func($callback, $event->getException()); } $event->setThrowException($options->getThrowExceptions()); } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/Plugin/IgnoreUserAbort.php000066400000000000000000000137741226600447100247330ustar00rootroot00000000000000handles[$index])) { throw new Exception\LogicException('Plugin already attached'); } $handles = array(); $this->handles[$index] = & $handles; $cbOnBefore = array($this, 'onBefore'); $cbOnAfter = array($this, 'onAfter'); $handles[] = $events->attach('setItem.pre', $cbOnBefore, $priority); $handles[] = $events->attach('setItem.post', $cbOnAfter, $priority); $handles[] = $events->attach('setItem.exception', $cbOnAfter, $priority); $handles[] = $events->attach('setItems.pre', $cbOnBefore, $priority); $handles[] = $events->attach('setItems.post', $cbOnAfter, $priority); $handles[] = $events->attach('setItems.exception', $cbOnAfter, $priority); $handles[] = $events->attach('addItem.pre', $cbOnBefore, $priority); $handles[] = $events->attach('addItem.post', $cbOnAfter, $priority); $handles[] = $events->attach('addItem.exception', $cbOnAfter, $priority); $handles[] = $events->attach('addItems.pre', $cbOnBefore, $priority); $handles[] = $events->attach('addItems.post', $cbOnAfter, $priority); $handles[] = $events->attach('addItems.exception', $cbOnAfter, $priority); $handles[] = $events->attach('replaceItem.pre', $cbOnBefore, $priority); $handles[] = $events->attach('replaceItem.post', $cbOnAfter, $priority); $handles[] = $events->attach('replaceItem.exception', $cbOnAfter, $priority); $handles[] = $events->attach('replaceItems.pre', $cbOnBefore, $priority); $handles[] = $events->attach('replaceItems.post', $cbOnAfter, $priority); $handles[] = $events->attach('replaceItems.exception', $cbOnAfter, $priority); $handles[] = $events->attach('checkAndSetItem.pre', $cbOnBefore, $priority); $handles[] = $events->attach('checkAndSetItem.post', $cbOnAfter, $priority); $handles[] = $events->attach('checkAndSetItem.exception', $cbOnAfter, $priority); // increment / decrement item(s) $handles[] = $events->attach('incrementItem.pre', $cbOnBefore, $priority); $handles[] = $events->attach('incrementItem.post', $cbOnAfter, $priority); $handles[] = $events->attach('incrementItem.exception', $cbOnAfter, $priority); $handles[] = $events->attach('incrementItems.pre', $cbOnBefore, $priority); $handles[] = $events->attach('incrementItems.post', $cbOnAfter, $priority); $handles[] = $events->attach('incrementItems.exception', $cbOnAfter, $priority); $handles[] = $events->attach('decrementItem.pre', $cbOnBefore, $priority); $handles[] = $events->attach('decrementItem.post', $cbOnAfter, $priority); $handles[] = $events->attach('decrementItem.exception', $cbOnAfter, $priority); $handles[] = $events->attach('decrementItems.pre', $cbOnBefore, $priority); $handles[] = $events->attach('decrementItems.post', $cbOnAfter, $priority); $handles[] = $events->attach('decrementItems.exception', $cbOnAfter, $priority); return $this; } /** * Detach * * @param EventManagerInterface $events * @return Serializer * @throws Exception\LogicException */ public function detach(EventManagerInterface $events) { $index = spl_object_hash($events); if (!isset($this->handles[$index])) { throw new Exception\LogicException('Plugin not attached'); } // detach all handles of this index foreach ($this->handles[$index] as $handle) { $events->detach($handle); } // remove all detached handles unset($this->handles[$index]); return $this; } /** * Activate ignore_user_abort if not already done * and save the target who activated it. * * @param Event $event * @return void */ public function onBefore(Event $event) { if ($this->activatedTarget === null && !ignore_user_abort(true)) { $this->activatedTarget = $event->getTarget(); } } /** * Reset ignore_user_abort if it's activated and if it's the same target * who activated it. * * If exit_on_abort is enabled and the connection has been aborted * exit the script. * * @param Event $event * @return void */ public function onAfter(Event $event) { if ($this->activatedTarget === $event->getTarget()) { // exit if connection aborted if ($this->getOptions()->getExitOnAbort() && connection_aborted()) { exit; } // reset ignore_user_abort ignore_user_abort(false); // remove activated target $this->activatedTarget = null; } } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/Plugin/OptimizeByFactor.php000066400000000000000000000051141226600447100251000ustar00rootroot00000000000000handles[$index])) { throw new Exception\LogicException('Plugin already attached'); } $handles = array(); $this->handles[$index] = & $handles; $callback = array($this, 'optimizeByFactor'); $handles[] = $events->attach('removeItem.post', $callback, $priority); $handles[] = $events->attach('removeItems.post', $callback, $priority); return $this; } /** * Detach * * @param EventManagerInterface $events * @return OptimizeByFactor * @throws Exception\LogicException */ public function detach(EventManagerInterface $events) { $index = spl_object_hash($events); if (!isset($this->handles[$index])) { throw new Exception\LogicException('Plugin not attached'); } // detach all handles of this index foreach ($this->handles[$index] as $handle) { $events->detach($handle); } // remove all detached handles unset($this->handles[$index]); return $this; } /** * Optimize by factor on a success _RESULT_ * * @param PostEvent $event * @return void */ public function optimizeByFactor(PostEvent $event) { $storage = $event->getStorage(); if (!($storage instanceof OptimizableInterface)) { return; } $factor = $this->getOptions()->getOptimizingFactor(); if ($factor && mt_rand(1, $factor) == 1) { $storage->optimize(); } } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/Plugin/PluginInterface.php000066400000000000000000000015161226600447100247270ustar00rootroot00000000000000clearingFactor = $this->normalizeFactor($clearingFactor); return $this; } /** * Get automatic clearing factor * * Used by: * - ClearExpiredByFactor * * @return int */ public function getClearingFactor() { return $this->clearingFactor; } /** * Set callback to call on intercepted exception * * Used by: * - ExceptionHandler * * @param callable $exceptionCallback * @throws Exception\InvalidArgumentException * @return PluginOptions */ public function setExceptionCallback($exceptionCallback) { if ($exceptionCallback !== null && !is_callable($exceptionCallback, true)) { throw new Exception\InvalidArgumentException('Not a valid callback'); } $this->exceptionCallback = $exceptionCallback; return $this; } /** * Get callback to call on intercepted exception * * Used by: * - ExceptionHandler * * @return null|callable */ public function getExceptionCallback() { return $this->exceptionCallback; } /** * Exit if connection aborted and ignore_user_abort is disabled. * * @param boolean $exitOnAbort * @return PluginOptions */ public function setExitOnAbort($exitOnAbort) { $this->exitOnAbort = (bool) $exitOnAbort; return $this; } /** * Exit if connection aborted and ignore_user_abort is disabled. * * @return boolean */ public function getExitOnAbort() { return $this->exitOnAbort; } /** * Set automatic optimizing factor * * Used by: * - OptimizeByFactor * * @param int $optimizingFactor * @return PluginOptions */ public function setOptimizingFactor($optimizingFactor) { $this->optimizingFactor = $this->normalizeFactor($optimizingFactor); return $this; } /** * Set automatic optimizing factor * * Used by: * - OptimizeByFactor * * @return int */ public function getOptimizingFactor() { return $this->optimizingFactor; } /** * Set serializer * * Used by: * - Serializer * * @param string|SerializerAdapter $serializer * @throws Exception\InvalidArgumentException * @return Serializer */ public function setSerializer($serializer) { if (!is_string($serializer) && !$serializer instanceof SerializerAdapter) { throw new Exception\InvalidArgumentException(sprintf( '%s expects either a string serializer name or Zend\Serializer\Adapter\AdapterInterface instance; ' . 'received "%s"', __METHOD__, (is_object($serializer) ? get_class($serializer) : gettype($serializer)) )); } $this->serializer = $serializer; return $this; } /** * Get serializer * * Used by: * - Serializer * * @return SerializerAdapter */ public function getSerializer() { if (!$this->serializer instanceof SerializerAdapter) { // use default serializer if (!$this->serializer) { $this->setSerializer(SerializerFactory::getDefaultAdapter()); // instantiate by class name + serializer_options } else { $options = $this->getSerializerOptions(); $this->setSerializer(SerializerFactory::factory($this->serializer, $options)); } } return $this->serializer; } /** * Set configuration options for instantiating a serializer adapter * * Used by: * - Serializer * * @param mixed $serializerOptions * @return PluginOptions */ public function setSerializerOptions($serializerOptions) { $this->serializerOptions = $serializerOptions; return $this; } /** * Get configuration options for instantiating a serializer adapter * * Used by: * - Serializer * * @return array */ public function getSerializerOptions() { return $this->serializerOptions; } /** * Set flag indicating we should re-throw exceptions * * Used by: * - ExceptionHandler * * @param bool $throwExceptions * @return PluginOptions */ public function setThrowExceptions($throwExceptions) { $this->throwExceptions = (bool) $throwExceptions; return $this; } /** * Should we re-throw exceptions? * * Used by: * - ExceptionHandler * * @return bool */ public function getThrowExceptions() { return $this->throwExceptions; } /** * Normalize a factor * * Cast to int and ensure we have a value greater than zero. * * @param int $factor * @return int * @throws Exception\InvalidArgumentException */ protected function normalizeFactor($factor) { $factor = (int) $factor; if ($factor < 0) { throw new Exception\InvalidArgumentException( "Invalid factor '{$factor}': must be greater or equal 0" ); } return $factor; } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/Plugin/Serializer.php000066400000000000000000000222501226600447100237570ustar00rootroot00000000000000handles[$index])) { throw new Exception\LogicException('Plugin already attached'); } $handles = array(); $this->handles[$index] = & $handles; // The higher the priority the sooner the plugin will be called on pre events // but the later it will be called on post events. $prePriority = $priority; $postPriority = -$priority; // read $handles[] = $events->attach('getItem.post', array($this, 'onReadItemPost'), $postPriority); $handles[] = $events->attach('getItems.post', array($this, 'onReadItemsPost'), $postPriority); // write $handles[] = $events->attach('setItem.pre', array($this, 'onWriteItemPre'), $prePriority); $handles[] = $events->attach('setItems.pre', array($this, 'onWriteItemsPre'), $prePriority); $handles[] = $events->attach('addItem.pre', array($this, 'onWriteItemPre'), $prePriority); $handles[] = $events->attach('addItems.pre', array($this, 'onWriteItemsPre'), $prePriority); $handles[] = $events->attach('replaceItem.pre', array($this, 'onWriteItemPre'), $prePriority); $handles[] = $events->attach('replaceItems.pre', array($this, 'onWriteItemsPre'), $prePriority); $handles[] = $events->attach('checkAndSetItem.pre', array($this, 'onWriteItemPre'), $prePriority); // increment / decrement item(s) $handles[] = $events->attach('incrementItem.pre', array($this, 'onIncrementItemPre'), $prePriority); $handles[] = $events->attach('incrementItems.pre', array($this, 'onIncrementItemsPre'), $prePriority); $handles[] = $events->attach('decrementItem.pre', array($this, 'onDecrementItemPre'), $prePriority); $handles[] = $events->attach('decrementItems.pre', array($this, 'onDecrementItemsPre'), $prePriority); // overwrite capabilities $handles[] = $events->attach('getCapabilities.post', array($this, 'onGetCapabilitiesPost'), $postPriority); return $this; } /** * Detach * * @param EventManagerInterface $events * @return Serializer * @throws Exception\LogicException */ public function detach(EventManagerInterface $events) { $index = spl_object_hash($events); if (!isset($this->handles[$index])) { throw new Exception\LogicException('Plugin not attached'); } // detach all handles of this index foreach ($this->handles[$index] as $handle) { $events->detach($handle); } // remove all detached handles unset($this->handles[$index]); return $this; } /** * On read item post * * @param PostEvent $event * @return void */ public function onReadItemPost(PostEvent $event) { $serializer = $this->getOptions()->getSerializer(); $result = $event->getResult(); $result = $serializer->unserialize($result); $event->setResult($result); } /** * On read items post * * @param PostEvent $event * @return void */ public function onReadItemsPost(PostEvent $event) { $serializer = $this->getOptions()->getSerializer(); $result = $event->getResult(); foreach ($result as &$value) { $value = $serializer->unserialize($value); } $event->setResult($result); } /** * On write item pre * * @param Event $event * @return void */ public function onWriteItemPre(Event $event) { $serializer = $this->getOptions()->getSerializer(); $params = $event->getParams(); $params['value'] = $serializer->serialize($params['value']); } /** * On write items pre * * @param Event $event * @return void */ public function onWriteItemsPre(Event $event) { $serializer = $this->getOptions()->getSerializer(); $params = $event->getParams(); foreach ($params['keyValuePairs'] as &$value) { $value = $serializer->serialize($value); } } /** * On increment item pre * * @param Event $event * @return mixed */ public function onIncrementItemPre(Event $event) { $storage = $event->getTarget(); $params = $event->getParams(); $casToken = null; $success = null; $oldValue = $storage->getItem($params['key'], $success, $casToken); $newValue = $oldValue + $params['value']; if ($success) { $storage->checkAndSetItem($casToken, $params['key'], $oldValue + $params['value']); $result = $newValue; } else { $result = false; } $event->stopPropagation(true); return $result; } /** * On increment items pre * * @param Event $event * @return mixed */ public function onIncrementItemsPre(Event $event) { $storage = $event->getTarget(); $params = $event->getParams(); $keyValuePairs = $storage->getItems(array_keys($params['keyValuePairs'])); foreach ($params['keyValuePairs'] as $key => & $value) { if (isset($keyValuePairs[$key])) { $keyValuePairs[$key]+= $value; } else { $keyValuePairs[$key] = $value; } } $failedKeys = $storage->setItems($keyValuePairs); foreach ($failedKeys as $failedKey) { unset($keyValuePairs[$failedKey]); } $event->stopPropagation(true); return $keyValuePairs; } /** * On decrement item pre * * @param Event $event * @return mixed */ public function onDecrementItemPre(Event $event) { $storage = $event->getTarget(); $params = $event->getParams(); $success = null; $casToken = null; $oldValue = $storage->getItem($params['key'], $success, $casToken); $newValue = $oldValue - $params['value']; if ($success) { $storage->checkAndSetItem($casToken, $params['key'], $oldValue + $params['value']); $result = $newValue; } else { $result = false; } $event->stopPropagation(true); return $result; } /** * On decrement items pre * * @param Event $event * @return mixed */ public function onDecrementItemsPre(Event $event) { $storage = $event->getTarget(); $params = $event->getParams(); $keyValuePairs = $storage->getItems(array_keys($params['keyValuePairs'])); foreach ($params['keyValuePairs'] as $key => &$value) { if (isset($keyValuePairs[$key])) { $keyValuePairs[$key]-= $value; } else { $keyValuePairs[$key] = -$value; } } $failedKeys = $storage->setItems($keyValuePairs); foreach ($failedKeys as $failedKey) { unset($keyValuePairs[$failedKey]); } $event->stopPropagation(true); return $keyValuePairs; } /** * On get capabilities * * @param PostEvent $event * @return void */ public function onGetCapabilitiesPost(PostEvent $event) { $baseCapabilities = $event->getResult(); $index = spl_object_hash($baseCapabilities); if (!isset($this->capabilities[$index])) { $this->capabilities[$index] = new Capabilities( $baseCapabilities->getAdapter(), new stdClass(), // marker array('supportedDatatypes' => array( 'NULL' => true, 'boolean' => true, 'integer' => true, 'double' => true, 'string' => true, 'array' => true, 'object' => 'object', 'resource' => false, )), $baseCapabilities ); } $event->setResult($this->capabilities[$index]); } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/PluginManager.php000066400000000000000000000040211226600447100231350ustar00rootroot00000000000000 'Zend\Cache\Storage\Plugin\ClearExpiredByFactor', 'exceptionhandler' => 'Zend\Cache\Storage\Plugin\ExceptionHandler', 'ignoreuserabort' => 'Zend\Cache\Storage\Plugin\IgnoreUserAbort', 'optimizebyfactor' => 'Zend\Cache\Storage\Plugin\OptimizeByFactor', 'serializer' => 'Zend\Cache\Storage\Plugin\Serializer', ); /** * Do not share by default * * @var array */ protected $shareByDefault = false; /** * Validate the plugin * * Checks that the plugin loaded is an instance of Plugin\PluginInterface. * * @param mixed $plugin * @return void * @throws Exception\RuntimeException if invalid */ public function validatePlugin($plugin) { if ($plugin instanceof Plugin\PluginInterface) { // we're okay return; } throw new Exception\RuntimeException(sprintf( 'Plugin of type %s is invalid; must implement %s\Plugin\PluginInterface', (is_object($plugin) ? get_class($plugin) : gettype($plugin)), __NAMESPACE__ )); } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/PostEvent.php000066400000000000000000000026121226600447100223370ustar00rootroot00000000000000setResult($result); } /** * Set the result/return value * * @param mixed $value * @return PostEvent */ public function setResult(& $value) { $this->result = & $value; return $this; } /** * Get the result/return value * * @return mixed */ public function & getResult() { return $this->result; } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/Storage/StorageInterface.php000066400000000000000000000142241226600447100236370ustar00rootroot00000000000000 $v) { $pluginPrio = 1; // default priority if (is_string($k)) { if (!is_array($v)) { throw new Exception\InvalidArgumentException( "'plugins.{$k}' needs to be an array" ); } $pluginName = $k; $pluginOptions = $v; } elseif (is_array($v)) { if (!isset($v['name'])) { throw new Exception\InvalidArgumentException("Invalid plugins[{$k}] or missing plugins[{$k}].name"); } $pluginName = (string) $v['name']; if (isset($v['options'])) { $pluginOptions = $v['options']; } else { $pluginOptions = array(); } if (isset($v['priority'])) { $pluginPrio = $v['priority']; } } else { $pluginName = $v; $pluginOptions = array(); } $plugin = static::pluginFactory($pluginName, $pluginOptions); $adapter->addPlugin($plugin, $pluginPrio); } } return $adapter; } /** * Instantiate a storage adapter * * @param string|Storage\StorageInterface $adapterName * @param array|Traversable|Storage\Adapter\AdapterOptions $options * @return Storage\StorageInterface * @throws Exception\RuntimeException */ public static function adapterFactory($adapterName, $options = array()) { if ($adapterName instanceof Storage\StorageInterface) { // $adapterName is already an adapter object $adapter = $adapterName; } else { $adapter = static::getAdapterPluginManager()->get($adapterName); } if ($options) { $adapter->setOptions($options); } return $adapter; } /** * Get the adapter plugin manager * * @return Storage\AdapterPluginManager */ public static function getAdapterPluginManager() { if (static::$adapters === null) { static::$adapters = new Storage\AdapterPluginManager(); } return static::$adapters; } /** * Change the adapter plugin manager * * @param Storage\AdapterPluginManager $adapters * @return void */ public static function setAdapterPluginManager(Storage\AdapterPluginManager $adapters) { static::$adapters = $adapters; } /** * Resets the internal adapter plugin manager * * @return void */ public static function resetAdapterPluginManager() { static::$adapters = null; } /** * Instantiate a storage plugin * * @param string|Storage\Plugin\PluginInterface $pluginName * @param array|Traversable|Storage\Plugin\PluginOptions $options * @return Storage\Plugin\PluginInterface * @throws Exception\RuntimeException */ public static function pluginFactory($pluginName, $options = array()) { if ($pluginName instanceof Storage\Plugin\PluginInterface) { // $pluginName is already an plugin object $plugin = $pluginName; } else { $plugin = static::getPluginManager()->get($pluginName); } if (!$options instanceof Storage\Plugin\PluginOptions) { $options = new Storage\Plugin\PluginOptions($options); } if ($options) { $plugin->setOptions($options); } return $plugin; } /** * Get the plugin manager * * @return Storage\PluginManager */ public static function getPluginManager() { if (static::$plugins === null) { static::$plugins = new Storage\PluginManager(); } return static::$plugins; } /** * Change the plugin manager * * @param Storage\PluginManager $plugins * @return void */ public static function setPluginManager(Storage\PluginManager $plugins) { static::$plugins = $plugins; } /** * Resets the internal plugin manager * * @return void */ public static function resetPluginManager() { static::$plugins = null; } } glpi-0.84.3+dfsg.1/lib/Zend/Cache/composer.json000066400000000000000000000017401226600447100210160ustar00rootroot00000000000000{ "name": "zendframework/zend-cache", "description": "provides a generic way to cache any data", "license": "BSD-3-Clause", "keywords": [ "zf2", "cache" ], "autoload": { "psr-0": { "Zend\\Cache\\": "" } }, "target-dir": "Zend/Cache", "require": { "php": ">=5.3.3", "zendframework/zend-stdlib": "self.version", "zendframework/zend-servicemanager": "self.version", "zendframework/zend-eventmanager": "self.version" }, "require-dev": { "zendframework/zend-serializer": "self.version" }, "suggest": { "zendframework/zend-serializer": "Zend\\Serializer component", "ext-apc": "APC >= 3.1.6 to use the APC storage adapter", "ext-dba": "DBA, to use the DBA storage adapter", "ext-memcached": "Memcached >= 1.0.0 to use the Memcached storage adapter", "ext-wincache": "WinCache, to use the WinCache storage adapter" } } glpi-0.84.3+dfsg.1/lib/Zend/EventManager/000077500000000000000000000000001226600447100176435ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/Zend/EventManager/Event.php000066400000000000000000000111601226600447100214340ustar00rootroot00000000000000setName($name); } if (null !== $target) { $this->setTarget($target); } if (null !== $params) { $this->setParams($params); } } /** * Get event name * * @return string */ public function getName() { return $this->name; } /** * Get the event target * * This may be either an object, or the name of a static method. * * @return string|object */ public function getTarget() { return $this->target; } /** * Set parameters * * Overwrites parameters * * @param array|ArrayAccess|object $params * @return Event * @throws Exception\InvalidArgumentException */ public function setParams($params) { if (!is_array($params) && !is_object($params)) { throw new Exception\InvalidArgumentException(sprintf( 'Event parameters must be an array or object; received "%s"', gettype($params) )); } $this->params = $params; return $this; } /** * Get all parameters * * @return array|object|ArrayAccess */ public function getParams() { return $this->params; } /** * Get an individual parameter * * If the parameter does not exist, the $default value will be returned. * * @param string|int $name * @param mixed $default * @return mixed */ public function getParam($name, $default = null) { // Check in params that are arrays or implement array access if (is_array($this->params) || $this->params instanceof ArrayAccess) { if (!isset($this->params[$name])) { return $default; } return $this->params[$name]; } // Check in normal objects if (!isset($this->params->{$name})) { return $default; } return $this->params->{$name}; } /** * Set the event name * * @param string $name * @return Event */ public function setName($name) { $this->name = (string) $name; return $this; } /** * Set the event target/context * * @param null|string|object $target * @return Event */ public function setTarget($target) { $this->target = $target; return $this; } /** * Set an individual parameter to a value * * @param string|int $name * @param mixed $value * @return Event */ public function setParam($name, $value) { if (is_array($this->params) || $this->params instanceof ArrayAccess) { // Arrays or objects implementing array access $this->params[$name] = $value; } else { // Objects $this->params->{$name} = $value; } return $this; } /** * Stop further event propagation * * @param bool $flag * @return void */ public function stopPropagation($flag = true) { $this->stopPropagation = (bool) $flag; } /** * Is propagation stopped? * * @return bool */ public function propagationIsStopped() { return $this->stopPropagation; } } glpi-0.84.3+dfsg.1/lib/Zend/EventManager/EventInterface.php000066400000000000000000000041151226600447100232570ustar00rootroot00000000000000setIdentifiers($identifiers); } /** * Set the event class to utilize * * @param string $class * @return EventManager */ public function setEventClass($class) { $this->eventClass = $class; return $this; } /** * Set shared event manager * * @param SharedEventManagerInterface $sharedEventManager * @return EventManager */ public function setSharedManager(SharedEventManagerInterface $sharedEventManager) { $this->sharedManager = $sharedEventManager; StaticEventManager::setInstance($sharedEventManager); return $this; } /** * Remove any shared event manager currently attached * * @return void */ public function unsetSharedManager() { $this->sharedManager = false; } /** * Get shared event manager * * If one is not defined, but we have a static instance in * StaticEventManager, that one will be used and set in this instance. * * If none is available in the StaticEventManager, a boolean false is * returned. * * @return false|SharedEventManagerInterface */ public function getSharedManager() { // "false" means "I do not want a shared manager; don't try and fetch one" if (false === $this->sharedManager || $this->sharedManager instanceof SharedEventManagerInterface ) { return $this->sharedManager; } if (!StaticEventManager::hasInstance()) { return false; } $this->sharedManager = StaticEventManager::getInstance(); return $this->sharedManager; } /** * Get the identifier(s) for this EventManager * * @return array */ public function getIdentifiers() { return $this->identifiers; } /** * Set the identifiers (overrides any currently set identifiers) * * @param string|int|array|Traversable $identifiers * @return EventManager Provides a fluent interface */ public function setIdentifiers($identifiers) { if (is_array($identifiers) || $identifiers instanceof \Traversable) { $this->identifiers = array_unique((array) $identifiers); } elseif ($identifiers !== null) { $this->identifiers = array($identifiers); } return $this; } /** * Add some identifier(s) (appends to any currently set identifiers) * * @param string|int|array|Traversable $identifiers * @return EventManager Provides a fluent interface */ public function addIdentifiers($identifiers) { if (is_array($identifiers) || $identifiers instanceof \Traversable) { $this->identifiers = array_unique($this->identifiers + (array) $identifiers); } elseif ($identifiers !== null) { $this->identifiers = array_unique(array_merge($this->identifiers, array($identifiers))); } return $this; } /** * Trigger all listeners for a given event * * Can emulate triggerUntil() if the last argument provided is a callback. * * @param string $event * @param string|object $target Object calling emit, or symbol describing target (such as static method name) * @param array|ArrayAccess $argv Array of arguments; typically, should be associative * @param null|callable $callback * @return ResponseCollection All listener return values * @throws Exception\InvalidCallbackException */ public function trigger($event, $target = null, $argv = array(), $callback = null) { if ($event instanceof EventInterface) { $e = $event; $event = $e->getName(); $callback = $target; } elseif ($target instanceof EventInterface) { $e = $target; $e->setName($event); $callback = $argv; } elseif ($argv instanceof EventInterface) { $e = $argv; $e->setName($event); $e->setTarget($target); } else { $e = new $this->eventClass(); $e->setName($event); $e->setTarget($target); $e->setParams($argv); } if ($callback && !is_callable($callback)) { throw new Exception\InvalidCallbackException('Invalid callback provided'); } return $this->triggerListeners($event, $e, $callback); } /** * Trigger listeners until return value of one causes a callback to * evaluate to true * * Triggers listeners until the provided callback evaluates the return * value of one as true, or until all listeners have been executed. * * @param string $event * @param string|object $target Object calling emit, or symbol describing target (such as static method name) * @param array|ArrayAccess $argv Array of arguments; typically, should be associative * @param callable $callback * @return ResponseCollection * @throws Exception\InvalidCallbackException if invalid callable provided */ public function triggerUntil($event, $target, $argv = null, $callback = null) { if ($event instanceof EventInterface) { $e = $event; $event = $e->getName(); $callback = $target; } elseif ($target instanceof EventInterface) { $e = $target; $e->setName($event); $callback = $argv; } elseif ($argv instanceof EventInterface) { $e = $argv; $e->setName($event); $e->setTarget($target); } else { $e = new $this->eventClass(); $e->setName($event); $e->setTarget($target); $e->setParams($argv); } if (!is_callable($callback)) { throw new Exception\InvalidCallbackException('Invalid callback provided'); } return $this->triggerListeners($event, $e, $callback); } /** * Attach a listener to an event * * The first argument is the event, and the next argument describes a * callback that will respond to that event. A CallbackHandler instance * describing the event listener combination will be returned. * * The last argument indicates a priority at which the event should be * executed. By default, this value is 1; however, you may set it for any * integer value. Higher values have higher priority (i.e., execute first). * * You can specify "*" for the event name. In such cases, the listener will * be triggered for every event. * * @param string|array|ListenerAggregateInterface $event An event or array of event names. If a ListenerAggregateInterface, proxies to {@link attachAggregate()}. * @param callable|int $callback If string $event provided, expects PHP callback; for a ListenerAggregateInterface $event, this will be the priority * @param int $priority If provided, the priority at which to register the callable * @return CallbackHandler|mixed CallbackHandler if attaching callable (to allow later unsubscribe); mixed if attaching aggregate * @throws Exception\InvalidArgumentException */ public function attach($event, $callback = null, $priority = 1) { // Proxy ListenerAggregateInterface arguments to attachAggregate() if ($event instanceof ListenerAggregateInterface) { return $this->attachAggregate($event, $callback); } // Null callback is invalid if (null === $callback) { throw new Exception\InvalidArgumentException(sprintf( '%s: expects a callback; none provided', __METHOD__ )); } // Array of events should be registered individually, and return an array of all listeners if (is_array($event)) { $listeners = array(); foreach ($event as $name) { $listeners[] = $this->attach($name, $callback, $priority); } return $listeners; } // If we don't have a priority queue for the event yet, create one if (empty($this->events[$event])) { $this->events[$event] = new PriorityQueue(); } // Create a callback handler, setting the event and priority in its metadata $listener = new CallbackHandler($callback, array('event' => $event, 'priority' => $priority)); // Inject the callback handler into the queue $this->events[$event]->insert($listener, $priority); return $listener; } /** * Attach a listener aggregate * * Listener aggregates accept an EventManagerInterface instance, and call attach() * one or more times, typically to attach to multiple events using local * methods. * * @param ListenerAggregateInterface $aggregate * @param int $priority If provided, a suggested priority for the aggregate to use * @return mixed return value of {@link ListenerAggregateInterface::attach()} */ public function attachAggregate(ListenerAggregateInterface $aggregate, $priority = 1) { return $aggregate->attach($this, $priority); } /** * Unsubscribe a listener from an event * * @param CallbackHandler|ListenerAggregateInterface $listener * @return bool Returns true if event and listener found, and unsubscribed; returns false if either event or listener not found * @throws Exception\InvalidArgumentException if invalid listener provided */ public function detach($listener) { if ($listener instanceof ListenerAggregateInterface) { return $this->detachAggregate($listener); } if (!$listener instanceof CallbackHandler) { throw new Exception\InvalidArgumentException(sprintf( '%s: expected a ListenerAggregateInterface or CallbackHandler; received "%s"', __METHOD__, (is_object($listener) ? get_class($listener) : gettype($listener)) )); } $event = $listener->getMetadatum('event'); if (!$event || empty($this->events[$event])) { return false; } $return = $this->events[$event]->remove($listener); if (!$return) { return false; } if (!count($this->events[$event])) { unset($this->events[$event]); } return true; } /** * Detach a listener aggregate * * Listener aggregates accept an EventManagerInterface instance, and call detach() * of all previously attached listeners. * * @param ListenerAggregateInterface $aggregate * @return mixed return value of {@link ListenerAggregateInterface::detach()} */ public function detachAggregate(ListenerAggregateInterface $aggregate) { return $aggregate->detach($this); } /** * Retrieve all registered events * * @return array */ public function getEvents() { return array_keys($this->events); } /** * Retrieve all listeners for a given event * * @param string $event * @return PriorityQueue */ public function getListeners($event) { if (!array_key_exists($event, $this->events)) { return new PriorityQueue(); } return $this->events[$event]; } /** * Clear all listeners for a given event * * @param string $event * @return void */ public function clearListeners($event) { if (!empty($this->events[$event])) { unset($this->events[$event]); } } /** * Prepare arguments * * Use this method if you want to be able to modify arguments from within a * listener. It returns an ArrayObject of the arguments, which may then be * passed to trigger() or triggerUntil(). * * @param array $args * @return ArrayObject */ public function prepareArgs(array $args) { return new ArrayObject($args); } /** * Trigger listeners * * Actual functionality for triggering listeners, to which both trigger() and triggerUntil() * delegate. * * @param string $event Event name * @param EventInterface $e * @param null|callable $callback * @return ResponseCollection */ protected function triggerListeners($event, EventInterface $e, $callback = null) { $responses = new ResponseCollection; $listeners = $this->getListeners($event); // Add shared/wildcard listeners to the list of listeners, // but don't modify the listeners object $sharedListeners = $this->getSharedListeners($event); $sharedWildcardListeners = $this->getSharedListeners('*'); $wildcardListeners = $this->getListeners('*'); if (count($sharedListeners) || count($sharedWildcardListeners) || count($wildcardListeners)) { $listeners = clone $listeners; // Shared listeners on this specific event $this->insertListeners($listeners, $sharedListeners); // Shared wildcard listeners $this->insertListeners($listeners, $sharedWildcardListeners); // Add wildcard listeners $this->insertListeners($listeners, $wildcardListeners); } foreach ($listeners as $listener) { // Trigger the listener's callback, and push its result onto the // response collection $responses->push(call_user_func($listener->getCallback(), $e)); // If the event was asked to stop propagating, do so if ($e->propagationIsStopped()) { $responses->setStopped(true); break; } // If the result causes our validation callback to return true, // stop propagation if ($callback && call_user_func($callback, $responses->last())) { $responses->setStopped(true); break; } } return $responses; } /** * Get list of all listeners attached to the shared event manager for * identifiers registered by this instance * * @param string $event * @return array */ protected function getSharedListeners($event) { if (!$sharedManager = $this->getSharedManager()) { return array(); } $identifiers = $this->getIdentifiers(); //Add wildcard id to the search, if not already added if (!in_array('*', $identifiers)) { $identifiers[] = '*'; } $sharedListeners = array(); foreach ($identifiers as $id) { if (!$listeners = $sharedManager->getListeners($id, $event)) { continue; } if (!is_array($listeners) && !($listeners instanceof Traversable)) { continue; } foreach ($listeners as $listener) { if (!$listener instanceof CallbackHandler) { continue; } $sharedListeners[] = $listener; } } return $sharedListeners; } /** * Add listeners to the master queue of listeners * * Used to inject shared listeners and wildcard listeners. * * @param PriorityQueue $masterListeners * @param PriorityQueue $listeners * @return void */ protected function insertListeners($masterListeners, $listeners) { foreach ($listeners as $listener) { $priority = $listener->getMetadatum('priority'); if (null === $priority) { $priority = 1; } elseif (is_array($priority)) { // If we have an array, likely using PriorityQueue. Grab first // element of the array, as that's the actual priority. $priority = array_shift($priority); } $masterListeners->insert($listener, $priority); } } } glpi-0.84.3+dfsg.1/lib/Zend/EventManager/EventManagerAwareInterface.php000066400000000000000000000014521226600447100255330ustar00rootroot00000000000000setExtractFlags(self::EXTR_BOTH); // Iterate and remove any matches $removed = false; $items = array(); $this->rewind(); while (!$this->isEmpty()) { $item = $this->extract(); if ($item['data'] === $datum) { $removed = true; continue; } $items[] = $item; } // Repopulate foreach ($items as $item) { $this->insert($item['data'], $item['priority']); } $this->setExtractFlags(self::EXTR_DATA); return $removed; } /** * Iterate the next filter in the chain * * Iterates and calls the next filter in the chain. * * @param mixed $context * @param array $params * @param FilterIterator $chain * @return mixed */ public function next($context = null, array $params = array(), $chain = null) { if (empty($context) || $chain->isEmpty()) { return; } $next = $this->extract(); if (!$next instanceof CallbackHandler) { return; } $return = call_user_func($next->getCallback(), $context, $params, $chain); return $return; } } glpi-0.84.3+dfsg.1/lib/Zend/EventManager/FilterChain.php000066400000000000000000000060131226600447100225440ustar00rootroot00000000000000filters = new Filter\FilterIterator(); } /** * Apply the filters * * Begins iteration of the filters. * * @param mixed $context Object under observation * @param mixed $argv Associative array of arguments * @return mixed */ public function run($context, array $argv = array()) { $chain = clone $this->getFilters(); if ($chain->isEmpty()) { return; } $next = $chain->extract(); if (!$next instanceof CallbackHandler) { return; } return call_user_func($next->getCallback(), $context, $argv, $chain); } /** * Connect a filter to the chain * * @param callable $callback PHP Callback * @param int $priority Priority in the queue at which to execute; defaults to 1 (higher numbers == higher priority) * @return CallbackHandler (to allow later unsubscribe) * @throws Exception\InvalidCallbackException */ public function attach($callback, $priority = 1) { if (empty($callback)) { throw new Exception\InvalidCallbackException('No callback provided'); } $filter = new CallbackHandler($callback, array('priority' => $priority)); $this->filters->insert($filter, $priority); return $filter; } /** * Detach a filter from the chain * * @param CallbackHandler $filter * @return bool Returns true if filter found and unsubscribed; returns false otherwise */ public function detach(CallbackHandler $filter) { return $this->filters->remove($filter); } /** * Retrieve all filters * * @return Filter\FilterIterator */ public function getFilters() { return $this->filters; } /** * Clear all filters * * @return void */ public function clearFilters() { $this->filters = new Filter\FilterIterator(); } /** * Return current responses * * Only available while the chain is still being iterated. Returns the * current ResponseCollection. * * @return null|ResponseCollection */ public function getResponses() { return null; } } glpi-0.84.3+dfsg.1/lib/Zend/EventManager/GlobalEventManager.php000066400000000000000000000066421226600447100240610ustar00rootroot00000000000000trigger($event, $context, $argv); } /** * Trigger listeners until return value of one causes a callback to evaluate * to true. * * @param string $event * @param string|object $context * @param array|object $argv * @param callable $callback * @return ResponseCollection */ public static function triggerUntil($event, $context, $argv, $callback) { return static::getEventCollection()->triggerUntil($event, $context, $argv, $callback); } /** * Attach a listener to an event * * @param string $event * @param callable $callback * @param int $priority * @return CallbackHandler */ public static function attach($event, $callback, $priority = 1) { return static::getEventCollection()->attach($event, $callback, $priority); } /** * Detach a callback from a listener * * @param CallbackHandler $listener * @return bool */ public static function detach(CallbackHandler $listener) { return static::getEventCollection()->detach($listener); } /** * Retrieve list of events this object manages * * @return array */ public static function getEvents() { return static::getEventCollection()->getEvents(); } /** * Retrieve all listeners for a given event * * @param string $event * @return PriorityQueue|array */ public static function getListeners($event) { return static::getEventCollection()->getListeners($event); } /** * Clear all listeners for a given event * * @param string $event * @return void */ public static function clearListeners($event) { static::getEventCollection()->clearListeners($event); } } glpi-0.84.3+dfsg.1/lib/Zend/EventManager/ListenerAggregateInterface.php000066400000000000000000000023771226600447100256020ustar00rootroot00000000000000eventIdentifier)) { if ((is_string($this->eventIdentifier)) || (is_array($this->eventIdentifier)) || ($this->eventIdentifier instanceof Traversable) ) { $identifiers = array_unique(array_merge($identifiers, (array) $this->eventIdentifier)); } elseif (is_object($this->eventIdentifier)) { $identifiers[] = $this->eventIdentifier; } // silently ignore invalid eventIdentifier types } $events->setIdentifiers($identifiers); $this->events = $events; return $this; } /** * Retrieve the event manager * * Lazy-loads an EventManager instance if none registered. * * @return EventManagerInterface */ public function getEventManager() { if (!$this->events instanceof EventManagerInterface) { $this->setEventManager(new EventManager()); } return $this->events; } } glpi-0.84.3+dfsg.1/lib/Zend/EventManager/ResponseCollection.php000066400000000000000000000037031226600447100241710ustar00rootroot00000000000000stopped; } /** * Mark the collection as stopped (or its opposite) * * @param bool $flag * @return ResponseCollection */ public function setStopped($flag) { $this->stopped = (bool) $flag; return $this; } /** * Convenient access to the first handler return value. * * @return mixed The first handler return value */ public function first() { return parent::bottom(); } /** * Convenient access to the last handler return value. * * If the collection is empty, returns null. Otherwise, returns value * returned by last handler. * * @return mixed The last handler return value */ public function last() { if (count($this) === 0) { return null; } return parent::top(); } /** * Check if any of the responses match the given value. * * @param mixed $value The value to look for among responses * @return bool */ public function contains($value) { foreach ($this as $response) { if ($response === $value) { return true; } } return false; } } glpi-0.84.3+dfsg.1/lib/Zend/EventManager/SharedEventManager.php000066400000000000000000000110131226600447100240530ustar00rootroot00000000000000 * $sharedEventManager = new SharedEventManager(); * $sharedEventManager->attach( * array('My\Resource\AbstractResource', 'My\Resource\EntityResource'), * 'getAll', * function ($e) use ($cache) { * if (!$id = $e->getParam('id', false)) { * return; * } * if (!$data = $cache->load(get_class($resource) . '::getOne::' . $id )) { * return; * } * return $data; * } * ); * * * @param string|array $id Identifier(s) for event emitting component(s) * @param string $event * @param callable $callback PHP Callback * @param int $priority Priority at which listener should execute * @return CallbackHandler|array Either CallbackHandler or array of CallbackHandlers */ public function attach($id, $event, $callback, $priority = 1) { $ids = (array) $id; $listeners = array(); foreach ($ids as $id) { if (!array_key_exists($id, $this->identifiers)) { $this->identifiers[$id] = new EventManager(); } $listeners[] = $this->identifiers[$id]->attach($event, $callback, $priority); } if (count($listeners) > 1) { return $listeners; } return $listeners[0]; } /** * Detach a listener from an event offered by a given resource * * @param string|int $id * @param CallbackHandler $listener * @return bool Returns true if event and listener found, and unsubscribed; returns false if either event or listener not found */ public function detach($id, CallbackHandler $listener) { if (!array_key_exists($id, $this->identifiers)) { return false; } return $this->identifiers[$id]->detach($listener); } /** * Retrieve all registered events for a given resource * * @param string|int $id * @return array */ public function getEvents($id) { if (!array_key_exists($id, $this->identifiers)) { //Check if there are any id wildcards listeners if ('*' != $id && array_key_exists('*', $this->identifiers)) { return $this->identifiers['*']->getEvents(); } return false; } return $this->identifiers[$id]->getEvents(); } /** * Retrieve all listeners for a given identifier and event * * @param string|int $id * @param string|int $event * @return false|PriorityQueue */ public function getListeners($id, $event) { if (!array_key_exists($id, $this->identifiers)) { return false; } return $this->identifiers[$id]->getListeners($event); } /** * Clear all listeners for a given identifier, optionally for a specific event * * @param string|int $id * @param null|string $event * @return bool */ public function clearListeners($id, $event = null) { if (!array_key_exists($id, $this->identifiers)) { return false; } if (null === $event) { unset($this->identifiers[$id]); return true; } return $this->identifiers[$id]->clearListeners($event); } } glpi-0.84.3+dfsg.1/lib/Zend/EventManager/SharedEventManagerAwareInterface.php000066400000000000000000000021471226600447100266640ustar00rootroot00000000000000=5.3.3", "zendframework/zend-stdlib": "self.version" } }glpi-0.84.3+dfsg.1/lib/Zend/I18n/000077500000000000000000000000001226600447100160065ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/Zend/I18n/Exception/000077500000000000000000000000001226600447100177445ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/Zend/I18n/Exception/ExceptionInterface.php000066400000000000000000000007341226600447100242400ustar00rootroot00000000000000options['locale'] = $locale; return $this; } /** * Returns the locale option * * @return string */ public function getLocale() { if (!isset($this->options['locale'])) { $this->options['locale'] = Locale::getDefault(); } return $this->options['locale']; } } glpi-0.84.3+dfsg.1/lib/Zend/I18n/Filter/Alnum.php000066400000000000000000000052201226600447100210170ustar00rootroot00000000000000 null, 'allow_white_space' => false, ); /** * Sets default option values for this instance * * @param array|Traversable|boolean|null $allowWhiteSpaceOrOptions * @param string|null $locale */ public function __construct($allowWhiteSpaceOrOptions = null, $locale = null) { if ($allowWhiteSpaceOrOptions !== null) { if (static::isOptions($allowWhiteSpaceOrOptions)) { $this->setOptions($allowWhiteSpaceOrOptions); } else { $this->setAllowWhiteSpace($allowWhiteSpaceOrOptions); $this->setLocale($locale); } } } /** * Sets the allowWhiteSpace option * * @param boolean $flag * @return Alnum Provides a fluent interface */ public function setAllowWhiteSpace($flag = true) { $this->options['allow_white_space'] = (boolean) $flag; return $this; } /** * Whether white space is allowed * * @return boolean */ public function getAllowWhiteSpace() { return $this->options['allow_white_space']; } /** * Defined by Zend\Filter\FilterInterface * * Returns $value as string with all non-alphanumeric characters removed * * @param mixed $value * @return string */ public function filter($value) { $whiteSpace = $this->options['allow_white_space'] ? '\s' : ''; $language = Locale::getPrimaryLanguage($this->getLocale()); if (!static::hasPcreUnicodeSupport()) { // POSIX named classes are not supported, use alternative a-zA-Z0-9 match $pattern = '/[^a-zA-Z0-9' . $whiteSpace . ']/'; } elseif ($language == 'ja'|| $language == 'ko' || $language == 'zh') { // Use english alphabet $pattern = '/[^a-zA-Z0-9' . $whiteSpace . ']/u'; } else { // Use native language alphabet $pattern = '/[^\p{L}\p{N}' . $whiteSpace . ']/u'; } return preg_replace($pattern, '', (string) $value); } } glpi-0.84.3+dfsg.1/lib/Zend/I18n/Filter/Alpha.php000066400000000000000000000026211226600447100207720ustar00rootroot00000000000000options['allow_white_space'] ? '\s' : ''; $language = Locale::getPrimaryLanguage($this->getLocale()); if (!static::hasPcreUnicodeSupport()) { // POSIX named classes are not supported, use alternative [a-zA-Z] match $pattern = '/[^a-zA-Z' . $whiteSpace . ']/'; } elseif ($language == 'ja' || $language == 'ko' || $language == 'zh') { // Use english alphabet $pattern = '/[^a-zA-Z' . $whiteSpace . ']/u'; } else { // Use native language alphabet $pattern = '/[^\p{L}' . $whiteSpace . ']/u'; } return preg_replace($pattern, '', (string) $value); } } glpi-0.84.3+dfsg.1/lib/Zend/I18n/Filter/NumberFormat.php000066400000000000000000000077611226600447100223600ustar00rootroot00000000000000 null, 'style' => NumberFormatter::DEFAULT_STYLE, 'type' => NumberFormatter::TYPE_DOUBLE ); /** * @var NumberFormatter */ protected $formatter = null; /** * @param array|Traversable|string|null $localeOrOptions * @param int $style * @param int $type */ public function __construct( $localeOrOptions = null, $style = NumberFormatter::DEFAULT_STYLE, $type = NumberFormatter::TYPE_DOUBLE) { if ($localeOrOptions !== null) { if ($localeOrOptions instanceof Traversable) { $localeOrOptions = iterator_to_array($localeOrOptions); } if (!is_array($localeOrOptions)) { $this->setLocale($localeOrOptions); $this->setStyle($style); $this->setType($type); } else { $this->setOptions($localeOrOptions); } } } /** * @param string|null $locale * @return NumberFormat */ public function setLocale($locale = null) { $this->options['locale'] = $locale; $this->formatter = null; return $this; } /** * @param int $style * @return NumberFormat */ public function setStyle($style) { $this->options['style'] = (int) $style; $this->formatter = null; return $this; } /** * @return int */ public function getStyle() { return $this->options['style']; } /** * @param int $type * @return NumberFormat */ public function setType($type) { $this->options['type'] = (int) $type; return $this; } /** * @return int */ public function getType() { return $this->options['type']; } /** * @param NumberFormatter $formatter * @return NumberFormat */ public function setFormatter(NumberFormatter $formatter) { $this->formatter = $formatter; return $this; } /** * @return NumberFormatter * @throws Exception\RuntimeException */ public function getFormatter() { if ($this->formatter === null) { $formatter = NumberFormatter::create($this->getLocale(), $this->getStyle()); if (!$formatter) { throw new Exception\RuntimeException( 'Can not create NumberFormatter instance; ' . intl_get_error_message() ); } $this->formatter = $formatter; } return $this->formatter; } /** * Defined by Zend\Filter\FilterInterface * * @see Zend\Filter\FilterInterface::filter() * @param mixed $value * @return mixed */ public function filter($value) { $formatter = $this->getFormatter(); $type = $this->getType(); if (is_int($value) || is_float($value)) { ErrorHandler::start(); $result = $formatter->format($value, $type); ErrorHandler::stop(); } else { $value = str_replace(array("\xC2\xA0", ' '), '', $value); ErrorHandler::start(); $result = $formatter->parse($value, $type); ErrorHandler::stop(); } if ($result === false) { return $value; } return str_replace("\xC2\xA0", ' ', $result); } } glpi-0.84.3+dfsg.1/lib/Zend/I18n/Translator/000077500000000000000000000000001226600447100201375ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/Zend/I18n/Translator/Loader/000077500000000000000000000000001226600447100213455ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/Zend/I18n/Translator/Loader/FileLoaderInterface.php000066400000000000000000000013421226600447100257050ustar00rootroot00000000000000file = fopen($filename, 'rb'); $error = ErrorHandler::stop(); if (false === $this->file) { throw new Exception\InvalidArgumentException(sprintf( 'Could not open file %s for reading', $filename ), 0, $error); } // Verify magic number $magic = fread($this->file, 4); if ($magic == "\x95\x04\x12\xde") { $this->littleEndian = false; } elseif ($magic == "\xde\x12\x04\x95") { $this->littleEndian = true; } else { fclose($this->file); throw new Exception\InvalidArgumentException(sprintf( '%s is not a valid gettext file', $filename )); } // Verify major revision (only 0 and 1 supported) $majorRevision = ($this->readInteger() >> 16); if ($majorRevision !== 0 && $majorRevision !== 1) { fclose($this->file); throw new Exception\InvalidArgumentException(sprintf( '%s has an unknown major revision', $filename )); } // Gather main information $numStrings = $this->readInteger(); $originalStringTableOffset = $this->readInteger(); $translationStringTableOffset = $this->readInteger(); // Usually there follow size and offset of the hash table, but we have // no need for it, so we skip them. fseek($this->file, $originalStringTableOffset); $originalStringTable = $this->readIntegerList(2 * $numStrings); fseek($this->file, $translationStringTableOffset); $translationStringTable = $this->readIntegerList(2 * $numStrings); // Read in all translations for ($current = 0; $current < $numStrings; $current++) { $sizeKey = $current * 2 + 1; $offsetKey = $current * 2 + 2; $originalStringSize = $originalStringTable[$sizeKey]; $originalStringOffset = $originalStringTable[$offsetKey]; $translationStringSize = $translationStringTable[$sizeKey]; $translationStringOffset = $translationStringTable[$offsetKey]; $originalString = array(''); if ($originalStringSize > 0) { fseek($this->file, $originalStringOffset); $originalString = explode("\0", fread($this->file, $originalStringSize)); } if ($translationStringSize > 0) { fseek($this->file, $translationStringOffset); $translationString = explode("\0", fread($this->file, $translationStringSize)); if (count($originalString) > 1 && count($translationString) > 1) { $textDomain[$originalString[0]] = $translationString; array_shift($originalString); /// PROBLEM WITH GLPI WHEN singular = plural /// opened bug http://framework.zend.com/issues/browse/ZF-11974 // foreach ($originalString as $string) { // $textDomain[$string] = ''; // } } else { $textDomain[$originalString[0]] = $translationString[0]; } } } // Read header entries if (array_key_exists('', $textDomain)) { $rawHeaders = explode("\n", trim($textDomain[''])); foreach ($rawHeaders as $rawHeader) { list($header, $content) = explode(':', $rawHeader, 2); if (trim(strtolower($header)) === 'plural-forms') { $textDomain->setPluralRule(PluralRule::fromString($content)); } } unset($textDomain['']); } fclose($this->file); return $textDomain; } /** * Read a single integer from the current file. * * @return integer */ protected function readInteger() { if ($this->littleEndian) { $result = unpack('Vint', fread($this->file, 4)); } else { $result = unpack('Nint', fread($this->file, 4)); } return $result['int']; } /** * Read an integer from the current file. * * @param integer $num * @return integer */ protected function readIntegerList($num) { if ($this->littleEndian) { return unpack('V' . $num, fread($this->file, 4 * $num)); } else { return unpack('N' . $num, fread($this->file, 4 * $num)); } } } glpi-0.84.3+dfsg.1/lib/Zend/I18n/Translator/Loader/PhpArray.php000066400000000000000000000034521226600447100236100ustar00rootroot00000000000000setPluralRule( PluralRule::fromString($textDomain['']['plural_forms']) ); } unset($textDomain['']); } return $textDomain; } } glpi-0.84.3+dfsg.1/lib/Zend/I18n/Translator/Loader/RemoteLoaderInterface.php000066400000000000000000000013631226600447100262640ustar00rootroot00000000000000 'Zend\I18n\Translator\Loader\PhpArray', 'gettext' => 'Zend\I18n\Translator\Loader\Gettext', ); /** * Validate the plugin. * * Checks that the filter loaded is an instance of * Loader\FileLoaderInterface or Loader\RemoteLoaderInterface. * * @param mixed $plugin * @return void * @throws Exception\RuntimeException if invalid */ public function validatePlugin($plugin) { if ($plugin instanceof Loader\FileLoaderInterface || $plugin instanceof Loader\RemoteLoaderInterface) { // we're okay return; } throw new Exception\RuntimeException(sprintf( 'Plugin of type %s is invalid; must implement %s\Loader\FileLoaderInterface or %s\Loader\RemoteLoaderInterface', (is_object($plugin) ? get_class($plugin) : gettype($plugin)), __NAMESPACE__ )); } } glpi-0.84.3+dfsg.1/lib/Zend/I18n/Translator/Plural/000077500000000000000000000000001226600447100213765ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/Zend/I18n/Translator/Plural/Parser.php000066400000000000000000000227031226600447100233470ustar00rootroot00000000000000. * * @category Zend * @package Zend_I18n * @subpackage Translator */ class Parser { /** * String to parse. * * @var string */ protected $string; /** * Current lexer position in the string. * * @var integer */ protected $currentPos; /** * Current token. * * @var Symbol */ protected $currentToken; /** * Table of symbols. * * @var array */ protected $symbolTable = array(); /** * Create a new plural parser. * */ public function __construct() { $this->populateSymbolTable(); } /** * Populate the symbol table. * * @return void */ protected function populateSymbolTable() { // Ternary operators $this->registerSymbol('?', 20)->setLeftDenotationGetter( function (Symbol $self, Symbol $left) { $self->first = $left; $self->second = $self->parser->expression(); $self->parser->advance(':'); $self->third = $self->parser->expression(); return $self; } ); $this->registerSymbol(':'); // Boolean operators $this->registerLeftInfixSymbol('||', 30); $this->registerLeftInfixSymbol('&&', 40); // Equal operators $this->registerLeftInfixSymbol('==', 50); $this->registerLeftInfixSymbol('!=', 50); // Compare operators $this->registerLeftInfixSymbol('>', 50); $this->registerLeftInfixSymbol('<', 50); $this->registerLeftInfixSymbol('>=', 50); $this->registerLeftInfixSymbol('<=', 50); // Add operators $this->registerLeftInfixSymbol('-', 60); $this->registerLeftInfixSymbol('+', 60); // Multiply operators $this->registerLeftInfixSymbol('*', 70); $this->registerLeftInfixSymbol('/', 70); $this->registerLeftInfixSymbol('%', 70); // Not operator $this->registerPrefixSymbol('!', 80); // Literals $this->registerSymbol('n')->setNullDenotationGetter( function (Symbol $self) { return $self; } ); $this->registerSymbol('number')->setNullDenotationGetter( function (Symbol $self) { return $self; } ); // Parentheses $this->registerSymbol('(')->setNullDenotationGetter( function (Symbol $self) { $expression = $self->parser->expression(); $self->parser->advance(')'); return $expression; } ); $this->registerSymbol(')'); // Eof $this->registerSymbol('eof'); } /** * Register a left infix symbol. * * @param string $id * @param integer $leftBindingPower * @return void */ protected function registerLeftInfixSymbol($id, $leftBindingPower) { $this->registerSymbol($id, $leftBindingPower)->setLeftDenotationGetter( function (Symbol $self, Symbol $left) use ($leftBindingPower) { $self->first = $left; $self->second = $self->parser->expression($leftBindingPower); return $self; } ); } /** * Register a right infix symbol. * * @param string $id * @param integer $leftBindingPower * @return void */ protected function registerRightInfixSymbol($id, $leftBindingPower) { $this->registerSymbol($id, $leftBindingPower)->setLeftDenotationGetter( function (Symbol $self, Symbol $left) use ($leftBindingPower) { $self->first = $left; $self->second = $self->parser->expression($leftBindingPower - 1); return $self; } ); } /** * Register a prefix symbol. * * @param string $id * @param integer $leftBindingPower * @return void */ protected function registerPrefixSymbol($id, $leftBindingPower) { $this->registerSymbol($id, $leftBindingPower)->setNullDenotationGetter( function (Symbol $self) use ($leftBindingPower) { $self->first = $self->parser->expression($leftBindingPower); $self->second = null; return $self; } ); } /** * Register a symbol. * * @param string $id * @param integer $leftBindingPower * @return Symbol */ protected function registerSymbol($id, $leftBindingPower = 0) { if (isset($this->symbolTable[$id])) { $symbol = $this->symbolTable[$id]; $symbol->leftBindingPower = max( $symbol->leftBindingPower, $leftBindingPower ); } else { $symbol = new Symbol($this, $id, $leftBindingPower); $this->symbolTable[$id] = $symbol; } return $symbol; } /** * Get a new symbol. * * @param string $id */ protected function getSymbol($id) { if (!isset($this->symbolTable[$id])) { // Unkown symbol exception } return clone $this->symbolTable[$id]; } /** * Parse a string. * * @param string $string * @return array */ public function parse($string) { $this->string = $string . "\0"; $this->currentPos = 0; $this->currentToken = $this->getNextToken(); return $this->expression(); } /** * Parse an expression. * * @param integer $rightBindingPower * @return Symbol */ public function expression($rightBindingPower = 0) { $token = $this->currentToken; $this->currentToken = $this->getNextToken(); $left = $token->getNullDenotation(); while ($rightBindingPower < $this->currentToken->leftBindingPower) { $token = $this->currentToken; $this->currentToken = $this->getNextToken(); $left = $token->getLeftDenotation($left); } return $left; } /** * Advance the current token and optionally check the old token id. * * @param string $id * @return void * @throws Exception\ParseException */ public function advance($id = null) { if ($id !== null && $this->currentToken->id !== $id) { throw new Exception\ParseException(sprintf( 'Expected token with id %s but received %s', $id, $this->currentToken->id )); } $this->currentToken = $this->getNextToken(); } /** * Get the next token. * * @return array * @throws Exception\ParseException */ protected function getNextToken() { while ($this->string[$this->currentPos] === ' ' || $this->string[$this->currentPos] === "\t") { $this->currentPos++; } $result = $this->string[$this->currentPos++]; $value = null; switch ($result) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': while (ctype_digit($this->string[$this->currentPos])) { $result .= $this->string[$this->currentPos++]; } $id = 'number'; $value = (int) $result; break; case '=': case '&': case '|': if ($this->string[$this->currentPos] === $result) { $this->currentPos++; $id = $result . $result; } else { // Yield error } break; case '!': case '<': case '>': if ($this->string[$this->currentPos] === '=') { $this->currentPos++; $result .= '='; } $id = $result; break; case '*': case '/': case '%': case '+': case '-': case 'n': case '?': case ':': case '(': case ')': $id = $result; break; case ';': case "\n": case "\0": $id = 'eof'; $this->currentPos--; break; default: throw new Exception\ParseException(sprintf( 'Found invalid character "%s" in input stream', $result )); break; } $token = $this->getSymbol($id); $token->value = $value; return $token; } } glpi-0.84.3+dfsg.1/lib/Zend/I18n/Translator/Plural/Rule.php000066400000000000000000000165101226600447100230210ustar00rootroot00000000000000numPlurals = $numPlurals; $this->ast = $ast; } /** * Evaluate a number and return the plural index. * * @param integer $number * @return integer * @throws Exception\RangeException */ public function evaluate($number) { $result = $this->evaluateAstPart($this->ast, abs((int) $number)); if ($result < 0 || $result >= $this->numPlurals) { throw new Exception\RangeException(sprintf( 'Calculated result %s is between 0 and %d', $result, ($this->numPlurals - 1) )); } return $result; } /** * Evaluate a part of an ast. * * @param array $ast * @param integer $number * @return integer * @throws Exception\ParseException */ protected function evaluateAstPart(array $ast, $number) { switch ($ast['id']) { case 'number': return $ast['arguments'][0]; case 'n': return $number; case '+': return $this->evaluateAstPart($ast['arguments'][0], $number) + $this->evaluateAstPart($ast['arguments'][1], $number); case '-': return $this->evaluateAstPart($ast['arguments'][0], $number) - $this->evaluateAstPart($ast['arguments'][1], $number); case '/': // Integer division return floor( $this->evaluateAstPart($ast['arguments'][0], $number) / $this->evaluateAstPart($ast['arguments'][1], $number) ); case '*': return $this->evaluateAstPart($ast['arguments'][0], $number) * $this->evaluateAstPart($ast['arguments'][1], $number); case '%': return $this->evaluateAstPart($ast['arguments'][0], $number) % $this->evaluateAstPart($ast['arguments'][1], $number); case '>': return $this->evaluateAstPart($ast['arguments'][0], $number) > $this->evaluateAstPart($ast['arguments'][1], $number) ? 1 : 0; case '>=': return $this->evaluateAstPart($ast['arguments'][0], $number) >= $this->evaluateAstPart($ast['arguments'][1], $number) ? 1 : 0; case '<': return $this->evaluateAstPart($ast['arguments'][0], $number) < $this->evaluateAstPart($ast['arguments'][1], $number) ? 1 : 0; case '<=': return $this->evaluateAstPart($ast['arguments'][0], $number) <= $this->evaluateAstPart($ast['arguments'][1], $number) ? 1 : 0; case '==': return $this->evaluateAstPart($ast['arguments'][0], $number) == $this->evaluateAstPart($ast['arguments'][1], $number) ? 1 : 0; case '!=': return $this->evaluateAstPart($ast['arguments'][0], $number) != $this->evaluateAstPart($ast['arguments'][1], $number) ? 1 : 0; case '&&': return $this->evaluateAstPart($ast['arguments'][0], $number) && $this->evaluateAstPart($ast['arguments'][1], $number) ? 1 : 0; case '||': return $this->evaluateAstPart($ast['arguments'][0], $number) || $this->evaluateAstPart($ast['arguments'][1], $number) ? 1 : 0; case '!': return !$this->evaluateAstPart($ast['arguments'][0], $number) ? 1 : 0; case '?': return $this->evaluateAstPart($ast['arguments'][0], $number) ? $this->evaluateAstPart($ast['arguments'][1], $number) : $this->evaluateAstPart($ast['arguments'][2], $number); default: throw new Exception\ParseException(sprintf( 'Unknown token: %s', $ast['id'] )); } } /** * Create a new rule from a string. * * @param string $string * @throws Exception\ParseException * @return Rule */ public static function fromString($string) { if (static::$parser === null) { static::$parser = new Parser(); } if (!preg_match('(nplurals=(?P\d+))', $string, $match)) { throw new Exception\ParseException(sprintf( 'Unknown or invalid parser rule: %s', $string )); } $numPlurals = (int) $match['nplurals']; if (!preg_match('(plural=(?P[^;\n]+))', $string, $match)) { throw new Exception\ParseException(sprintf( 'Unknown or invalid parser rule: %s', $string )); } $tree = static::$parser->parse($match['plural']); $ast = static::createAst($tree); return new self($numPlurals, $ast); } /** * Create an AST from a tree. * * Theoretically we could just use the given Symbol, but that one is not * so easy to serialize and also takes up more memory. * * @param Symbol $symbol * @return array */ protected static function createAst(Symbol $symbol) { $ast = array('id' => $symbol->id, 'arguments' => array()); switch ($symbol->id) { case 'n': break; case 'number': $ast['arguments'][] = $symbol->value; break; case '!': $ast['arguments'][] = static::createAst($symbol->first); break; case '?': $ast['arguments'][] = static::createAst($symbol->first); $ast['arguments'][] = static::createAst($symbol->second); $ast['arguments'][] = static::createAst($symbol->third); break; default: $ast['arguments'][] = static::createAst($symbol->first); $ast['arguments'][] = static::createAst($symbol->second); break; } return $ast; } } glpi-0.84.3+dfsg.1/lib/Zend/I18n/Translator/Plural/Symbol.php000066400000000000000000000067231226600447100233640ustar00rootroot00000000000000parser = $parser; $this->id = $id; $this->leftBindingPower = $leftBindingPower; } /** * Set the null denotation getter. * * @param Closure $getter * @return Symbol */ public function setNullDenotationGetter(Closure $getter) { $this->nullDenotationGetter = $getter; return $this; } /** * Set the left denotation getter. * * @param Closure $getter * @return Symbol */ public function setLeftDenotationGetter(Closure $getter) { $this->leftDenotationGetter = $getter; return $this; } /** * Get null denotation. * * @throws Exception\ParseException * @return Symbol */ public function getNullDenotation() { if ($this->nullDenotationGetter === null) { throw new Exception\ParseException(sprintf( 'Syntax error: %s', $this->id )); } /** @var callable $function */ $function = $this->nullDenotationGetter; return $function($this); } /** * Get left denotation. * * @param Symbol $left * @throws Exception\ParseException * @return Symbol */ public function getLeftDenotation($left) { if ($this->leftDenotationGetter === null) { throw new Exception\ParseException(sprintf( 'Unknown operator: %s', $this->id )); } /** @var callable $function */ $function = $this->leftDenotationGetter; return $function($this, $left); } } glpi-0.84.3+dfsg.1/lib/Zend/I18n/Translator/TextDomain.php000066400000000000000000000023601226600447100227250ustar00rootroot00000000000000pluralRule = $rule; return $this; } /** * Get the plural rule. * * Lazy loads a default rule if none already registered * * @return PluralRule */ public function getPluralRule() { if ($this->pluralRule === null) { $this->setPluralRule(PluralRule::fromString('nplurals=2; plural=n==1')); } return $this->pluralRule; } } glpi-0.84.3+dfsg.1/lib/Zend/I18n/Translator/Translator.php000066400000000000000000000366001226600447100230060ustar00rootroot00000000000000setLocale(array_shift($locales)); if (count($locales) > 0) { $translator->setFallbackLocale(array_shift($locales)); } } // file patterns if (isset($options['translation_file_patterns'])) { if (!is_array($options['translation_file_patterns'])) { throw new Exception\InvalidArgumentException( '"translation_file_patterns" should be an array' ); } $requiredKeys = array('type', 'base_dir', 'pattern'); foreach ($options['translation_file_patterns'] as $pattern) { foreach ($requiredKeys as $key) { if (!isset($pattern[$key])) { throw new Exception\InvalidArgumentException( "'{$key}' is missing for translation pattern options" ); } } $translator->addTranslationFilePattern( $pattern['type'], $pattern['base_dir'], $pattern['pattern'], isset($pattern['text_domain']) ? $pattern['text_domain'] : 'default' ); } } // files if (isset($options['translation_files'])) { if (!is_array($options['translation_files'])) { throw new Exception\InvalidArgumentException( '"translation_files" should be an array' ); } $requiredKeys = array('type', 'filename'); foreach ($options['translation_files'] as $file) { foreach ($requiredKeys as $key) { if (!isset($file[$key])) { throw new Exception\InvalidArgumentException( "'{$key}' is missing for translation file options" ); } } $translator->addTranslationFile( $file['type'], $file['filename'], isset($file['text_domain']) ? $file['text_domain'] : 'default', isset($file['locale']) ? $file['locale'] : null ); } } // remote if (isset($options['remote_translation'])) { if (!is_array($options['remote_translation'])) { throw new Exception\InvalidArgumentException( '"remote_translation" should be an array' ); } $requiredKeys = array('type'); foreach ($options['remote_translation'] as $remote) { foreach ($requiredKeys as $key) { if (!isset($remote[$key])) { throw new Exception\InvalidArgumentException( "'{$key}' is missing for remote translation options" ); } } $translator->addRemoteTranslations( $remote['type'], isset($remote['text_domain']) ? $remote['text_domain'] : 'default' ); } } // cache if (isset($options['cache'])) { if ($options['cache'] instanceof CacheStorage) { $translator->setCache($options['cache']); } else { $translator->setCache(Cache\StorageFactory::factory($options['cache'])); } } return $translator; } /** * Set the default locale. * * @param string $locale * @return Translator */ public function setLocale($locale) { $this->locale = $locale; return $this; } /** * Get the default locale. * * @return string */ public function getLocale() { if ($this->locale === null) { $this->locale = Locale::getDefault(); } return $this->locale; } /** * Set the fallback locale. * * @param string $locale * @return Translator */ public function setFallbackLocale($locale) { $this->fallbackLocale = $locale; return $this; } /** * Get the fallback locale. * * @return string */ public function getFallbackLocale() { return $this->fallbackLocale; } /** * Sets a cache * * @param CacheStorage $cache * @return Translator */ public function setCache(CacheStorage $cache = null) { $this->cache = $cache; return $this; } /** * Returns the set cache * * @return CacheStorage The set cache */ public function getCache() { return $this->cache; } /** * Set the plugin manager for translation loaders * * @param LoaderPluginManager $pluginManager * @return Translator */ public function setPluginManager(LoaderPluginManager $pluginManager) { $this->pluginManager = $pluginManager; return $this; } /** * Retrieve the plugin manager for translation loaders. * * Lazy loads an instance if none currently set. * * @return LoaderPluginManager */ public function getPluginManager() { if (!$this->pluginManager instanceof LoaderPluginManager) { $this->setPluginManager(new LoaderPluginManager()); } return $this->pluginManager; } /** * Translate a message. * * @param string $message * @param string $textDomain * @param string $locale * @return string */ public function translate($message, $textDomain = 'default', $locale = null) { $locale = ($locale ?: $this->getLocale()); $translation = $this->getTranslatedMessage($message, $locale, $textDomain); if ($translation !== null && $translation !== '') { return $translation; } if (null !== ($fallbackLocale = $this->getFallbackLocale()) && $locale !== $fallbackLocale ) { return $this->translate($message, $textDomain, $fallbackLocale); } return $message; } /** * Translate a plural message. * * @param string $singular * @param string $plural * @param int $number * @param string $textDomain * @param string|null $locale * @return string * @throws Exception\OutOfBoundsException */ public function translatePlural( $singular, $plural, $number, $textDomain = 'default', $locale = null ) { $locale = $locale ?: $this->getLocale(); $translation = $this->getTranslatedMessage($singular, $locale, $textDomain); if ($translation === null || $translation === '') { if (null !== ($fallbackLocale = $this->getFallbackLocale()) && $locale !== $fallbackLocale ) { return $this->translatePlural( $singular, $plural, $number, $textDomain, $fallbackLocale ); } return ($number == 1 ? $singular : $plural); } /// GLPI Hack for languages with 1 plural form (chinese) if (!is_array($translation)) { return $translation; } $index = $this->messages[$textDomain][$locale] ->getPluralRule() ->evaluate($number); if (!isset($translation[$index])) { throw new Exception\OutOfBoundsException(sprintf( 'Provided index %d does not exist in plural array', $index )); } return $translation[$index]; } /** * Get a translated message. * * @param string $message * @param string $locale * @param string $textDomain * @return string|null */ protected function getTranslatedMessage( $message, $locale = null, $textDomain = 'default' ) { if ($message === '') { return ''; } if (!isset($this->messages[$textDomain][$locale])) { $this->loadMessages($textDomain, $locale); } if (!isset($this->messages[$textDomain][$locale][$message])) { return null; } return $this->messages[$textDomain][$locale][$message]; } /** * Add a translation file. * * @param string $type * @param string $filename * @param string $textDomain * @param string $locale * @return Translator */ public function addTranslationFile( $type, $filename, $textDomain = 'default', $locale = null ) { $locale = $locale ?: '*'; if (!isset($this->files[$textDomain])) { $this->files[$textDomain] = array(); } $this->files[$textDomain][$locale] = array( 'type' => $type, 'filename' => $filename, ); return $this; } /** * Add multiple translations with a file pattern. * * @param string $type * @param string $baseDir * @param string $pattern * @param string $textDomain * @return Translator */ public function addTranslationFilePattern( $type, $baseDir, $pattern, $textDomain = 'default' ) { if (!isset($this->patterns[$textDomain])) { $this->patterns[$textDomain] = array(); } $this->patterns[$textDomain][] = array( 'type' => $type, 'baseDir' => rtrim($baseDir, '/'), 'pattern' => $pattern, ); return $this; } /** * Add remote translations. * * @param string $type * @param string $textDomain * @return Translator */ public function addRemoteTranslations($type, $textDomain = 'default') { if (!isset($this->remote[$textDomain])) { $this->remote[$textDomain] = array(); } $this->remote[$textDomain][] = $type; return $this; } /** * Load messages for a given language and domain. * * @param string $textDomain * @param string $locale * @throws Exception\RuntimeException * @return void */ protected function loadMessages($textDomain, $locale) { if (!isset($this->messages[$textDomain])) { $this->messages[$textDomain] = array(); } if (null !== ($cache = $this->getCache())) { $cacheId = 'Zend_I18n_Translator_Messages_' . md5($textDomain . $locale); if (null !== ($result = $cache->getItem($cacheId))) { $this->messages[$textDomain][$locale] = $result; return; } } // Try to load from remote sources if (isset($this->remote[$textDomain])) { foreach ($this->remote[$textDomain] as $loaderType) { $loader = $this->getPluginManager()->get($loaderType); if (!$loader instanceof RemoteLoaderInterface) { throw new Exception\RuntimeException('Specified loader is not a remote loader'); } $this->messages[$textDomain][$locale] = $loader->load($locale, $textDomain); goto cache; } } // Try to load from pattern if (isset($this->patterns[$textDomain])) { foreach ($this->patterns[$textDomain] as $pattern) { $filename = $pattern['baseDir'] . '/' . sprintf($pattern['pattern'], $locale); if (is_file($filename)) { $loader = $this->getPluginManager()->get($pattern['type']); if (!$loader instanceof FileLoaderInterface) { throw new Exception\RuntimeException('Specified loader is not a file loader'); } $this->messages[$textDomain][$locale] = $loader->load($locale, $filename); goto cache; } } } // Try to load from concrete files foreach (array($locale, '*') as $currentLocale) { if (!isset($this->files[$textDomain][$currentLocale])) { continue; } $file = $this->files[$textDomain][$currentLocale]; $loader = $this->getPluginManager()->get($file['type']); if (!$loader instanceof FileLoaderInterface) { throw new Exception\RuntimeException('Specified loader is not a file loader'); } $this->messages[$textDomain][$locale] = $loader->load($locale, $file['filename']); unset($this->files[$textDomain][$currentLocale]); goto cache; } // Cache the loaded text domain cache: if ($cache !== null) { $cache->setItem($cacheId, $this->messages[$textDomain][$locale]); } } } glpi-0.84.3+dfsg.1/lib/Zend/I18n/Translator/TranslatorAwareInterface.php000066400000000000000000000037521226600447100256110ustar00rootroot00000000000000get('Config'); $trConfig = isset($config['translator']) ? $config['translator'] : array(); $translator = Translator::factory($trConfig); return $translator; } } glpi-0.84.3+dfsg.1/lib/Zend/I18n/Validator/000077500000000000000000000000001226600447100177335ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/Zend/I18n/Validator/Alnum.php000066400000000000000000000062161226600447100215250ustar00rootroot00000000000000 "Invalid type given. String, integer or float expected", self::NOT_ALNUM => "The input contains characters which are non alphabetic and no digits", self::STRING_EMPTY => "The input is an empty string", ); /** * Options for this validator * * @var array */ protected $options = array( 'allowWhiteSpace' => false, // Whether to allow white space characters; off by default ); /** * Sets default option values for this instance * * @param bool $allowWhiteSpace */ public function __construct($allowWhiteSpace = false) { $options = is_array($allowWhiteSpace) ? $allowWhiteSpace : null; parent::__construct($options); if (is_scalar($allowWhiteSpace)) { $this->options['allowWhiteSpace'] = (boolean) $allowWhiteSpace; } } /** * Returns the allowWhiteSpace option * * @return boolean */ public function getAllowWhiteSpace() { return $this->options['allowWhiteSpace']; } /** * Sets the allowWhiteSpace option * * @param boolean $allowWhiteSpace * @return AlnumFilter Provides a fluent interface */ public function setAllowWhiteSpace($allowWhiteSpace) { $this->options['allowWhiteSpace'] = (boolean) $allowWhiteSpace; return $this; } /** * Returns true if and only if $value contains only alphabetic and digit characters * * @param string $value * @return boolean */ public function isValid($value) { if (!is_string($value) && !is_int($value) && !is_float($value)) { $this->error(self::INVALID); return false; } $this->setValue($value); if ('' === $value) { $this->error(self::STRING_EMPTY); return false; } if (null === static::$filter) { static::$filter = new AlnumFilter(); } static::$filter->setAllowWhiteSpace($this->options['allowWhiteSpace']); if ($value != static::$filter->filter($value)) { $this->error(self::NOT_ALNUM); return false; } return true; } } glpi-0.84.3+dfsg.1/lib/Zend/I18n/Validator/Alpha.php000066400000000000000000000042371226600447100214770ustar00rootroot00000000000000 "Invalid type given. String expected", self::NOT_ALPHA => "The input contains non alphabetic characters", self::STRING_EMPTY => "The input is an empty string" ); /** * Options for this validator * * @var array */ protected $options = array( 'allowWhiteSpace' => false, // Whether to allow white space characters; off by default ); /** * Returns true if and only if $value contains only alphabetic characters * * @param string $value * @return boolean */ public function isValid($value) { if (!is_string($value)) { $this->error(self::INVALID); return false; } $this->setValue($value); if ('' === $value) { $this->error(self::STRING_EMPTY); return false; } if (null === static::$filter) { static::$filter = new AlphaFilter(); } //static::$filter->setAllowWhiteSpace($this->allowWhiteSpace); static::$filter->setAllowWhiteSpace($this->options['allowWhiteSpace']); if ($value !== static::$filter->filter($value)) { $this->error(self::NOT_ALPHA); return false; } return true; } } glpi-0.84.3+dfsg.1/lib/Zend/I18n/Validator/Float.php000066400000000000000000000070711226600447100215160ustar00rootroot00000000000000 "Invalid type given. String, integer or float expected", self::NOT_FLOAT => "The input does not appear to be a float", ); /** * Optional locale * * @var string|null */ protected $locale; /** * Constructor for the integer validator * * @param array|Traversable $options */ public function __construct($options = array()) { if ($options instanceof Traversable) { $options = ArrayUtils::iteratorToArray($options); } if (array_key_exists('locale', $options)) { $this->setLocale($options['locale']); } parent::__construct($options); } /** * Returns the set locale * * @return string */ public function getLocale() { if (null === $this->locale) { $this->locale = Locale::getDefault(); } return $this->locale; } /** * Sets the locale to use * * @param string|null $locale * @return Float */ public function setLocale($locale) { $this->locale = $locale; return $this; } /** * Returns true if and only if $value is a floating-point value * * @param string $value * @return boolean * @throws Exception\InvalidArgumentException */ public function isValid($value) { if (!is_string($value) && !is_int($value) && !is_float($value)) { $this->error(self::INVALID); return false; } $this->setValue($value); if (is_float($value)) { return true; } $locale = $this->getLocale(); $format = new NumberFormatter($locale, NumberFormatter::DECIMAL); if (intl_is_failure($format->getErrorCode())) { throw new Exception\InvalidArgumentException("Invalid locale string given"); } $parsedFloat = $format->parse($value, NumberFormatter::TYPE_DOUBLE); if (intl_is_failure($format->getErrorCode())) { $this->error(self::NOT_FLOAT); return false; } $decimalSep = $format->getSymbol(NumberFormatter::DECIMAL_SEPARATOR_SYMBOL); $groupingSep = $format->getSymbol(NumberFormatter::GROUPING_SEPARATOR_SYMBOL); $valueFiltered = str_replace($groupingSep, '', $value); $valueFiltered = str_replace($decimalSep, '.', $valueFiltered); while (strpos($valueFiltered, '.') !== false && (substr($valueFiltered, -1) == '0' || substr($valueFiltered, -1) == '.') ) { $valueFiltered = substr($valueFiltered, 0, strlen($valueFiltered) - 1); } if (strval($parsedFloat) !== $valueFiltered) { $this->error(self::NOT_FLOAT); return false; } return true; } } glpi-0.84.3+dfsg.1/lib/Zend/I18n/Validator/Int.php000066400000000000000000000063771226600447100212130ustar00rootroot00000000000000 "Invalid type given. String or integer expected", self::NOT_INT => "The input does not appear to be an integer", ); /** * Optional locale * * @var string|null */ protected $locale; /** * Constructor for the integer validator * * @param array|Traversable $options */ public function __construct($options = array()) { if ($options instanceof Traversable) { $options = ArrayUtils::iteratorToArray($options); } if (array_key_exists('locale', $options)) { $this->setLocale($options['locale']); } parent::__construct($options); } /** * Returns the set locale */ public function getLocale() { if (null === $this->locale) { $this->locale = Locale::getDefault(); } return $this->locale; } /** * Sets the locale to use * * @param string $locale * @return Int */ public function setLocale($locale) { $this->locale = $locale; return $this; } /** * Returns true if and only if $value is a valid integer * * @param string|integer $value * @return boolean * @throws Exception\InvalidArgumentException */ public function isValid($value) { if (!is_string($value) && !is_int($value) && !is_float($value)) { $this->error(self::INVALID); return false; } if (is_int($value)) { return true; } $this->setValue($value); $locale = $this->getLocale(); $format = new NumberFormatter($locale, NumberFormatter::DECIMAL); if (intl_is_failure($format->getErrorCode())) { throw new Exception\InvalidArgumentException("Invalid locale string given"); } $parsedInt = $format->parse($value, NumberFormatter::TYPE_INT64); if (intl_is_failure($format->getErrorCode())) { $this->error(self::NOT_INT); return false; } $decimalSep = $format->getSymbol(NumberFormatter::DECIMAL_SEPARATOR_SYMBOL); $groupingSep = $format->getSymbol(NumberFormatter::GROUPING_SEPARATOR_SYMBOL); $valueFiltered = str_replace($groupingSep, '', $value); $valueFiltered = str_replace($decimalSep, '.', $valueFiltered); if (strval($parsedInt) !== $valueFiltered) { $this->error(self::NOT_INT); return false; } return true; } } glpi-0.84.3+dfsg.1/lib/Zend/I18n/Validator/PostCode.php000066400000000000000000000254501226600447100221720ustar00rootroot00000000000000 "Invalid type given. String or integer expected", self::NO_MATCH => "The input does not appear to be a postal code", self::SERVICE => "The input does not appear to be a postal code", self::SERVICEFAILURE => "An exception has been raised while validating the input", ); /** * Optional Locale to use * * @var string|null */ protected $locale; /** * Optional Manual postal code format * * @var string|null */ protected $format; /** * Optional Service callback for additional validation * * @var mixed|null */ protected $service; /** * Postal Code regexes by territory * * @var array */ protected static $postCodeRegex = array( 'GB' => 'GIR[ ]?0AA|((AB|AL|B|BA|BB|BD|BH|BL|BN|BR|BS|BT|CA|CB|CF|CH|CM|CO|CR|CT|CV|CW|DA|DD|DE|DG|DH|DL|DN|DT|DY|E|EC|EH|EN|EX|FK|FY|G|GL|GY|GU|HA|HD|HG|HP|HR|HS|HU|HX|IG|IM|IP|IV|JE|KA|KT|KW|KY|L|LA|LD|LE|LL|LN|LS|LU|M|ME|MK|ML|N|NE|NG|NN|NP|NR|NW|OL|OX|PA|PE|PH|PL|PO|PR|RG|RH|RM|S|SA|SE|SG|SK|SL|SM|SN|SO|SP|SR|SS|ST|SW|SY|TA|TD|TF|TN|TQ|TR|TS|TW|UB|W|WA|WC|WD|WF|WN|WR|WS|WV|YO|ZE)(\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}))|BFPO[ ]?\d{1,4}', 'JE' => 'JE\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}', 'GG' => 'GY\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}', 'IM' => 'IM\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}', 'US' => '\d{5}([ \-]\d{4})?', 'CA' => '[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][ ]?\d[ABCEGHJ-NPRSTV-Z]\d', 'DE' => '\d{5}', 'JP' => '\d{3}-\d{4}', 'FR' => '\d{2}[ ]?\d{3}', 'AU' => '\d{4}', 'IT' => '\d{5}', 'CH' => '\d{4}', 'AT' => '\d{4}', 'ES' => '\d{5}', 'NL' => '\d{4}[ ]?[A-Z]{2}', 'BE' => '\d{4}', 'DK' => '\d{4}', 'SE' => '\d{3}[ ]?\d{2}', 'NO' => '\d{4}', 'BR' => '\d{5}[\-]?\d{3}', 'PT' => '\d{4}([\-]\d{3})?', 'FI' => '\d{5}', 'AX' => '22\d{3}', 'KR' => '\d{3}[\-]\d{3}', 'CN' => '\d{6}', 'TW' => '\d{3}(\d{2})?', 'SG' => '\d{6}', 'DZ' => '\d{5}', 'AD' => 'AD\d{3}', 'AR' => '([A-HJ-NP-Z])?\d{4}([A-Z]{3})?', 'AM' => '(37)?\d{4}', 'AZ' => '\d{4}', 'BH' => '((1[0-2]|[2-9])\d{2})?', 'BD' => '\d{4}', 'BB' => '(BB\d{5})?', 'BY' => '\d{6}', 'BM' => '[A-Z]{2}[ ]?[A-Z0-9]{2}', 'BA' => '\d{5}', 'IO' => 'BBND 1ZZ', 'BN' => '[A-Z]{2}[ ]?\d{4}', 'BG' => '\d{4}', 'KH' => '\d{5}', 'CV' => '\d{4}', 'CL' => '\d{7}', 'CR' => '\d{4,5}|\d{3}-\d{4}', 'HR' => '\d{5}', 'CY' => '\d{4}', 'CZ' => '\d{3}[ ]?\d{2}', 'DO' => '\d{5}', 'EC' => '([A-Z]\d{4}[A-Z]|(?:[A-Z]{2})?\d{6})?', 'EG' => '\d{5}', 'EE' => '\d{5}', 'FO' => '\d{3}', 'GE' => '\d{4}', 'GR' => '\d{3}[ ]?\d{2}', 'GL' => '39\d{2}', 'GT' => '\d{5}', 'HT' => '\d{4}', 'HN' => '(?:\d{5})?', 'HU' => '\d{4}', 'IS' => '\d{3}', 'IN' => '\d{6}', 'ID' => '\d{5}', 'IE' => '((D|DUBLIN)?([1-9]|6[wW]|1[0-8]|2[024]))?', 'IL' => '\d{5}', 'JO' => '\d{5}', 'KZ' => '\d{6}', 'KE' => '\d{5}', 'KW' => '\d{5}', 'LA' => '\d{5}', 'LV' => '\d{4}', 'LB' => '(\d{4}([ ]?\d{4})?)?', 'LI' => '(948[5-9])|(949[0-7])', 'LT' => '\d{5}', 'LU' => '\d{4}', 'MK' => '\d{4}', 'MY' => '\d{5}', 'MV' => '\d{5}', 'MT' => '[A-Z]{3}[ ]?\d{2,4}', 'MU' => '(\d{3}[A-Z]{2}\d{3})?', 'MX' => '\d{5}', 'MD' => '\d{4}', 'MC' => '980\d{2}', 'MA' => '\d{5}', 'NP' => '\d{5}', 'NZ' => '\d{4}', 'NI' => '((\d{4}-)?\d{3}-\d{3}(-\d{1})?)?', 'NG' => '(\d{6})?', 'OM' => '(PC )?\d{3}', 'PK' => '\d{5}', 'PY' => '\d{4}', 'PH' => '\d{4}', 'PL' => '\d{2}-\d{3}', 'PR' => '00[679]\d{2}([ \-]\d{4})?', 'RO' => '\d{6}', 'RU' => '\d{6}', 'SM' => '4789\d', 'SA' => '\d{5}', 'SN' => '\d{5}', 'SK' => '\d{3}[ ]?\d{2}', 'SI' => '\d{4}', 'ZA' => '\d{4}', 'LK' => '\d{5}', 'TJ' => '\d{6}', 'TH' => '\d{5}', 'TN' => '\d{4}', 'TR' => '\d{5}', 'TM' => '\d{6}', 'UA' => '\d{5}', 'UY' => '\d{5}', 'UZ' => '\d{6}', 'VA' => '00120', 'VE' => '\d{4}', 'ZM' => '\d{5}', 'AS' => '96799', 'CC' => '6799', 'CK' => '\d{4}', 'RS' => '\d{6}', 'ME' => '8\d{4}', 'CS' => '\d{5}', 'YU' => '\d{5}', 'CX' => '6798', 'ET' => '\d{4}', 'FK' => 'FIQQ 1ZZ', 'NF' => '2899', 'FM' => '(9694[1-4])([ \-]\d{4})?', 'GF' => '9[78]3\d{2}', 'GN' => '\d{3}', 'GP' => '9[78][01]\d{2}', 'GS' => 'SIQQ 1ZZ', 'GU' => '969[123]\d([ \-]\d{4})?', 'GW' => '\d{4}', 'HM' => '\d{4}', 'IQ' => '\d{5}', 'KG' => '\d{6}', 'LR' => '\d{4}', 'LS' => '\d{3}', 'MG' => '\d{3}', 'MH' => '969[67]\d([ \-]\d{4})?', 'MN' => '\d{6}', 'MP' => '9695[012]([ \-]\d{4})?', 'MQ' => '9[78]2\d{2}', 'NC' => '988\d{2}', 'NE' => '\d{4}', 'VI' => '008(([0-4]\d)|(5[01]))([ \-]\d{4})?', 'PF' => '987\d{2}', 'PG' => '\d{3}', 'PM' => '9[78]5\d{2}', 'PN' => 'PCRN 1ZZ', 'PW' => '96940', 'RE' => '9[78]4\d{2}', 'SH' => '(ASCN|STHL) 1ZZ', 'SJ' => '\d{4}', 'SO' => '\d{5}', 'SZ' => '[HLMS]\d{3}', 'TC' => 'TKCA 1ZZ', 'WF' => '986\d{2}', 'YT' => '976\d{2}', ); /** * Constructor for the PostCode validator * * Accepts a string locale and/or "format". * * @param array|Traversable $options */ public function __construct($options = array()) { if ($options instanceof Traversable) { $options = ArrayUtils::iteratorToArray($options); } if (array_key_exists('locale', $options)) { $this->setLocale($options['locale']); } else { $this->setLocale(Locale::getDefault()); } if (array_key_exists('format', $options)) { $this->setFormat($options['format']); } if (array_key_exists('service', $options)) { $this->setService($options['service']); } parent::__construct($options); } /** * Returns the set locale * * @return string|null The set locale */ public function getLocale() { return $this->locale; } /** * Sets the locale to use * * @param string|null $locale * @return PostCode Provides fluid interface */ public function setLocale($locale) { $this->locale = $locale; return $this; } /** * Returns the set postal code format * * @return string|null */ public function getFormat() { return $this->format; } /** * Sets a self defined postal format as regex * * @param string $format * @return PostCode Provides fluid interface */ public function setFormat($format) { $this->format = $format; return $this; } /** * Returns the actual set service * * @return mixed|null */ public function getService() { return $this->service; } /** * Sets a new callback for service validation * * @param mixed $service * @return PostCode Provides fluid interface */ public function setService($service) { $this->service = $service; return $this; } /** * Returns true if and only if $value is a valid postalcode * * @param string $value * @return boolean * @throws Exception\InvalidArgumentException */ public function isValid($value) { if (!is_string($value) && !is_int($value)) { $this->error(self::INVALID); return false; } $this->setValue($value); $service = $this->getService(); $locale = $this->getLocale(); $format = $this->getFormat(); if ((null === $format || '' === $format) && !empty($locale)) { $region = Locale::getRegion($locale); if ('' === $region) { throw new Exception\InvalidArgumentException("Locale must contain a region"); } if (isset(static::$postCodeRegex[$region])) { $format = static::$postCodeRegex[$region]; } } if (null === $format || '' === $format) { throw new Exception\InvalidArgumentException("A postcode-format string has to be given for validation"); } if ($format[0] !== '/') { $format = '/^' . $format; } if ($format[strlen($format) - 1] !== '/') { $format .= '$/'; } if (!empty($service)) { if (!is_callable($service)) { throw new Exception\InvalidArgumentException('Invalid callback given'); } try { $callback = new Callback($service); $callback->setOptions(array( 'format' => $format, 'locale' => $locale, )); if (!$callback->isValid($value)) { $this->error(self::SERVICE, $value); return false; } } catch (\Exception $e) { $this->error(self::SERVICEFAILURE, $value); return false; } } if (!preg_match($format, $value)) { $this->error(self::NO_MATCH); return false; } return true; } } glpi-0.84.3+dfsg.1/lib/Zend/I18n/View/000077500000000000000000000000001226600447100167205ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/Zend/I18n/View/Helper/000077500000000000000000000000001226600447100201375ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/Zend/I18n/View/Helper/AbstractTranslatorHelper.php000066400000000000000000000062121226600447100256260ustar00rootroot00000000000000translator = $translator; if (null !== $textDomain) { $this->setTranslatorTextDomain($textDomain); } return $this; } /** * Returns translator used in helper * * @return Translator|null */ public function getTranslator() { if (! $this->isTranslatorEnabled()) { return null; } return $this->translator; } /** * Checks if the helper has a translator * * @return bool */ public function hasTranslator() { return (bool) $this->getTranslator(); } /** * Sets whether translator is enabled and should be used * * @param bool $enabled [optional] whether translator should be used. * Default is true. * @return AbstractTranslatorHelper */ public function setTranslatorEnabled($enabled = true) { $this->translatorEnabled = (bool) $enabled; return $this; } /** * Returns whether translator is enabled and should be used * * @return bool */ public function isTranslatorEnabled() { return $this->translatorEnabled; } /** * Set translation text domain * * @param string $textDomain * @return AbstractTranslatorHelper */ public function setTranslatorTextDomain($textDomain = 'default') { $this->translatorTextDomain = $textDomain; return $this; } /** * Return the translation text domain * * @return string */ public function getTranslatorTextDomain() { return $this->translatorTextDomain; } } glpi-0.84.3+dfsg.1/lib/Zend/I18n/View/Helper/CurrencyFormat.php000066400000000000000000000074341226600447100236230ustar00rootroot00000000000000currencyCode = $currencyCode; return $this; } /** * Get the 3-letter ISO 4217 currency code indicating the currency to use. * * @return string */ public function getCurrencyCode() { return $this->currencyCode; } /** * Set if the view helper should show two decimals * * @param bool $showDecimals * @return CurrencyFormat */ public function setShouldShowDecimals($showDecimals) { $this->showDecimals = (bool) $showDecimals; return $this; } /** * Get if the view helper should show two decimals * * @return bool */ public function shouldShowDecimals() { return $this->showDecimals; } /** * Set locale to use instead of the default. * * @param string $locale * @return CurrencyFormat */ public function setLocale($locale) { $this->locale = (string) $locale; return $this; } /** * Get the locale to use. * * @return string|null */ public function getLocale() { if ($this->locale === null) { $this->locale = Locale::getDefault(); } return $this->locale; } /** * Format a number. * * @param float $number * @param string $currencyCode * @param bool $showDecimals * @param string $locale * @return string */ public function __invoke( $number, $currencyCode = null, $showDecimals = null, $locale = null ) { if (null === $locale) { $locale = $this->getLocale(); } if (null === $currencyCode) { $currencyCode = $this->getCurrencyCode(); } if (null !== $showDecimals) { $this->setShouldShowDecimals($showDecimals); } $formatterId = md5($locale); if (!isset($this->formatters[$formatterId])) { $this->formatters[$formatterId] = new NumberFormatter( $locale, NumberFormatter::CURRENCY ); } if ($this->shouldShowDecimals()) { $this->formatters[$formatterId]->setAttribute(NumberFormatter::FRACTION_DIGITS, 2); } else { $this->formatters[$formatterId]->setAttribute(NumberFormatter::FRACTION_DIGITS, 0); } return $this->formatters[$formatterId]->formatCurrency( $number, $currencyCode ); } } glpi-0.84.3+dfsg.1/lib/Zend/I18n/View/Helper/DateFormat.php000066400000000000000000000063311226600447100227010ustar00rootroot00000000000000timezone = (string) $timezone; foreach ($this->formatters as $formatter) { $formatter->setTimeZoneId($this->timezone); } return $this; } /** * Get the timezone to use. * * @return string|null */ public function getTimezone() { if (!$this->timezone) { return date_default_timezone_get(); } return $this->timezone; } /** * Set locale to use instead of the default. * * @param string $locale * @return DateFormat */ public function setlocale($locale) { $this->locale = (string) $locale; return $this; } /** * Get the locale to use. * * @return string|null */ public function getlocale() { if ($this->locale === null) { $this->locale = Locale::getDefault(); } return $this->locale; } /** * Format a date. * * @param DateTime|integer|array $date * @param integer $dateType * @param integer $timeType * @param string $locale * @return string * @throws Exception\RuntimeException */ public function __invoke( $date, $dateType = IntlDateFormatter::NONE, $timeType = IntlDateFormatter::NONE, $locale = null ) { if ($locale === null) { $locale = $this->getlocale(); } $timezone = $this->getTimezone(); $formatterId = md5($dateType . "\0" . $timeType . "\0" . $locale); if (!isset($this->formatters[$formatterId])) { $this->formatters[$formatterId] = new IntlDateFormatter( $locale, $dateType, $timeType, $timezone ); } // DateTime support for IntlDateFormatter::format() was only added in 5.3.4 if ($date instanceof DateTime && version_compare(PHP_VERSION, '5.3.4', '<')) { $date = $date->getTimestamp(); } return $this->formatters[$formatterId]->format($date); } } glpi-0.84.3+dfsg.1/lib/Zend/I18n/View/Helper/NumberFormat.php000066400000000000000000000070441226600447100232560ustar00rootroot00000000000000formatStyle = (int) $formatStyle; return $this; } /** * Get the format style to use. * * @return integer */ public function getFormatStyle() { if (null === $this->formatStyle) { $this->formatStyle = NumberFormatter::DECIMAL; } return $this->formatStyle; } /** * Set format type to use instead of the default. * * @param integer $formatType * @return NumberFormat */ public function setFormatType($formatType) { $this->formatType = (int) $formatType; return $this; } /** * Get the format type to use. * * @return integer */ public function getFormatType() { if (null === $this->formatType) { $this->formatType = NumberFormatter::TYPE_DEFAULT; } return $this->formatType; } /** * Set locale to use instead of the default. * * @param string $locale * @return NumberFormat */ public function setLocale($locale) { $this->locale = (string) $locale; return $this; } /** * Get the locale to use. * * @return string|null */ public function getLocale() { if ($this->locale === null) { $this->locale = Locale::getDefault(); } return $this->locale; } /** * Format a number. * * @param integer|float $number * @param integer $formatStyle * @param integer $formatType * @param string $locale * @return string */ public function __invoke( $number, $formatStyle = null, $formatType = null, $locale = null ) { if (null === $locale) { $locale = $this->getLocale(); } if (null === $formatStyle) { $formatStyle = $this->getFormatStyle(); } if (null === $formatType) { $formatType = $this->getFormatType(); } $formatterId = md5($formatStyle . "\0" . $locale); if (!isset($this->formatters[$formatterId])) { $this->formatters[$formatterId] = new NumberFormatter( $locale, $formatStyle ); } return $this->formatters[$formatterId]->format($number, $formatType); } } glpi-0.84.3+dfsg.1/lib/Zend/I18n/View/Helper/Translate.php000066400000000000000000000022731226600447100226110ustar00rootroot00000000000000getTranslator(); if (null === $translator) { throw new Exception\RuntimeException('Translator has not been set'); } if (null === $textDomain) { $textDomain = $this->getTranslatorTextDomain(); } return $translator->translate($message, $textDomain, $locale); } } glpi-0.84.3+dfsg.1/lib/Zend/I18n/View/Helper/TranslatePlural.php000066400000000000000000000025531226600447100237720ustar00rootroot00000000000000getTranslator(); if (null === $translator) { throw new Exception\RuntimeException('Translator has not been set'); } if (null === $textDomain) { $textDomain = $this->getTranslatorTextDomain(); } return $translator->translatePlural($singular, $plural, $number, $textDomain, $locale); } } glpi-0.84.3+dfsg.1/lib/Zend/I18n/View/HelperConfig.php000066400000000000000000000027011226600447100217760ustar00rootroot00000000000000 'Zend\I18n\View\Helper\CurrencyFormat', 'dateformat' => 'Zend\I18n\View\Helper\DateFormat', 'numberformat' => 'Zend\I18n\View\Helper\NumberFormat', 'translate' => 'Zend\I18n\View\Helper\Translate', 'translateplural' => 'Zend\I18n\View\Helper\TranslatePlural', ); /** * Configure the provided service manager instance with the configuration * in this class. * * @param ServiceManager $serviceManager * @return void */ public function configureServiceManager(ServiceManager $serviceManager) { foreach ($this->invokables as $name => $service) { $serviceManager->setInvokableClass($name, $service); } } } glpi-0.84.3+dfsg.1/lib/Zend/I18n/composer.json000066400000000000000000000007001226600447100205250ustar00rootroot00000000000000{ "name": "zendframework/zend-i18n", "description": " ", "license": "BSD-3-Clause", "keywords": [ "zf2", "i18n" ], "autoload": { "psr-0": { "Zend\\I18n\\": "" } }, "target-dir": "Zend/I18n", "require": { "php": ">=5.3.3", "ext-intl": "*", "zendframework/zend-filter": "self.version", "zendframework/zend-stdlib": "self.version" } } glpi-0.84.3+dfsg.1/lib/Zend/LICENSE.txt000066400000000000000000000030141226600447100171100ustar00rootroot00000000000000Copyright (c) 2005-2012, Zend Technologies USA, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Zend Technologies USA, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. glpi-0.84.3+dfsg.1/lib/Zend/Loader/000077500000000000000000000000001226600447100164755ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/Zend/Loader/AutoloaderFactory.php000066400000000000000000000166431226600447100226470ustar00rootroot00000000000000 * array( * '' => $autoloaderOptions, * ) * * * The factory will then loop through and instantiate each autoloader with * the specified options, and register each with the spl_autoloader. * * You may retrieve the concrete autoloader instances later using * {@link getRegisteredAutoloaders()}. * * Note that the class names must be resolvable on the include_path or via * the Zend library, using PSR-0 rules (unless the class has already been * loaded). * * @param array|Traversable $options (optional) options to use. Defaults to Zend\Loader\StandardAutoloader * @return void * @throws Exception\InvalidArgumentException for invalid options * @throws Exception\InvalidArgumentException for unloadable autoloader classes * @throws Exception\DomainException for autoloader classes not implementing SplAutoloader */ public static function factory($options = null) { if (null === $options) { if (!isset(static::$loaders[static::STANDARD_AUTOLOADER])) { $autoloader = static::getStandardAutoloader(); $autoloader->register(); static::$loaders[static::STANDARD_AUTOLOADER] = $autoloader; } // Return so we don't hit the next check's exception (we're done here anyway) return; } if (!is_array($options) && !($options instanceof Traversable)) { require_once __DIR__ . '/Exception/InvalidArgumentException.php'; throw new Exception\InvalidArgumentException( 'Options provided must be an array or Traversable' ); } foreach ($options as $class => $autoloaderOptions) { if (!isset(static::$loaders[$class])) { $autoloader = static::getStandardAutoloader(); if (!class_exists($class) && !$autoloader->autoload($class)) { require_once 'Exception/InvalidArgumentException.php'; throw new Exception\InvalidArgumentException( sprintf('Autoloader class "%s" not loaded', $class) ); } if (!static::isSubclassOf($class, 'Zend\Loader\SplAutoloader')) { require_once 'Exception/InvalidArgumentException.php'; throw new Exception\InvalidArgumentException( sprintf('Autoloader class %s must implement Zend\\Loader\\SplAutoloader', $class) ); } if ($class === static::STANDARD_AUTOLOADER) { $autoloader->setOptions($autoloaderOptions); } else { $autoloader = new $class($autoloaderOptions); } $autoloader->register(); static::$loaders[$class] = $autoloader; } else { static::$loaders[$class]->setOptions($autoloaderOptions); } } } /** * Get an list of all autoloaders registered with the factory * * Returns an array of autoloader instances. * * @return array */ public static function getRegisteredAutoloaders() { return static::$loaders; } /** * Retrieves an autoloader by class name * * @param string $class * @return SplAutoloader * @throws Exception\InvalidArgumentException for non-registered class */ public static function getRegisteredAutoloader($class) { if (!isset(static::$loaders[$class])) { require_once 'Exception/InvalidArgumentException.php'; throw new Exception\InvalidArgumentException(sprintf('Autoloader class "%s" not loaded', $class)); } return static::$loaders[$class]; } /** * Unregisters all autoloaders that have been registered via the factory. * This will NOT unregister autoloaders registered outside of the fctory. * * @return void */ public static function unregisterAutoloaders() { foreach (static::getRegisteredAutoloaders() as $class => $autoloader) { spl_autoload_unregister(array($autoloader, 'autoload')); unset(static::$loaders[$class]); } } /** * Unregister a single autoloader by class name * * @param string $autoloaderClass * @return bool */ public static function unregisterAutoloader($autoloaderClass) { if (!isset(static::$loaders[$autoloaderClass])) { return false; } $autoloader = static::$loaders[$autoloaderClass]; spl_autoload_unregister(array($autoloader, 'autoload')); unset(static::$loaders[$autoloaderClass]); return true; } /** * Get an instance of the standard autoloader * * Used to attempt to resolve autoloader classes, using the * StandardAutoloader. The instance is marked as a fallback autoloader, to * allow resolving autoloaders not under the "Zend" namespace. * * @return SplAutoloader */ protected static function getStandardAutoloader() { if (null !== static::$standardAutoloader) { return static::$standardAutoloader; } if (!class_exists(static::STANDARD_AUTOLOADER)) { // Extract the filename from the classname $stdAutoloader = substr(strrchr(static::STANDARD_AUTOLOADER, '\\'), 1); require_once __DIR__ . "/$stdAutoloader.php"; } $loader = new StandardAutoloader(); static::$standardAutoloader = $loader; return static::$standardAutoloader; } /** * Checks if the object has this class as one of its parents * * @see https://bugs.php.net/bug.php?id=53727 * @see https://github.com/zendframework/zf2/pull/1807 * * @param string $className * @param string $type * @return bool */ protected static function isSubclassOf($className, $type) { if (is_subclass_of($className, $type)) { return true; } if (version_compare(PHP_VERSION, '5.3.7', '>=')) { return false; } if (!interface_exists($type)) { return false; } $r = new ReflectionClass($className); return $r->implementsInterface($type); } } glpi-0.84.3+dfsg.1/lib/Zend/Loader/ClassMapAutoloader.php000066400000000000000000000134051226600447100227340ustar00rootroot00000000000000setOptions($options); } } /** * Configure the autoloader * * Proxies to {@link registerAutoloadMaps()}. * * @param array|Traversable $options * @return ClassMapAutoloader */ public function setOptions($options) { $this->registerAutoloadMaps($options); return $this; } /** * Register an autoload map * * An autoload map may be either an associative array, or a file returning * an associative array. * * An autoload map should be an associative array containing * classname/file pairs. * * @param string|array $map * @throws Exception\InvalidArgumentException * @return ClassMapAutoloader */ public function registerAutoloadMap($map) { if (is_string($map)) { $location = $map; if ($this === ($map = $this->loadMapFromFile($location))) { return $this; } } if (!is_array($map)) { require_once __DIR__ . '/Exception/InvalidArgumentException.php'; throw new Exception\InvalidArgumentException(sprintf( 'Map file provided does not return a map. Map file: "%s"', (isset($location) && is_string($location) ? $location : 'unexpected type: ' . gettype($map)) )); } $this->map = array_merge($this->map, $map); if (isset($location)) { $this->mapsLoaded[] = $location; } return $this; } /** * Register many autoload maps at once * * @param array $locations * @throws Exception\InvalidArgumentException * @return ClassMapAutoloader */ public function registerAutoloadMaps($locations) { if (!is_array($locations) && !($locations instanceof Traversable)) { require_once __DIR__ . '/Exception/InvalidArgumentException.php'; throw new Exception\InvalidArgumentException('Map list must be an array or implement Traversable'); } foreach ($locations as $location) { $this->registerAutoloadMap($location); } return $this; } /** * Retrieve current autoload map * * @return array */ public function getAutoloadMap() { return $this->map; } /** * {@inheritDoc} */ public function autoload($class) { if (isset($this->map[$class])) { require_once $this->map[$class]; return $class; } return false; } /** * Register the autoloader with spl_autoload registry * * @return void */ public function register() { spl_autoload_register(array($this, 'autoload'), true, true); } /** * Load a map from a file * * If the map has been previously loaded, returns the current instance; * otherwise, returns whatever was returned by calling include() on the * location. * * @param string $location * @return ClassMapAutoloader|mixed * @throws Exception\InvalidArgumentException for nonexistent locations */ protected function loadMapFromFile($location) { if (!file_exists($location)) { require_once __DIR__ . '/Exception/InvalidArgumentException.php'; throw new Exception\InvalidArgumentException(sprintf( 'Map file provided does not exist. Map file: "%s"', (is_string($location) ? $location : 'unexpected type: ' . gettype($location)) )); } if (!$path = static::realPharPath($location)) { $path = realpath($location); } if (in_array($path, $this->mapsLoaded)) { // Already loaded this map return $this; } $map = include $path; return $map; } /** * Resolve the real_path() to a file within a phar. * * @see https://bugs.php.net/bug.php?id=52769 * @param string $path * @return string */ public static function realPharPath($path) { if (strpos($path, 'phar:///') !== 0) { return; } $parts = explode('/', str_replace(array('/','\\'), '/', substr($path, 8))); $parts = array_values(array_filter($parts, function($p) { return ($p !== '' && $p !== '.'); })); array_walk($parts, function ($value, $key) use(&$parts) { if ($value === '..') { unset($parts[$key], $parts[$key-1]); $parts = array_values($parts); } }); if (file_exists($realPath = 'phar:///' . implode('/', $parts))) { return $realPath; } } } glpi-0.84.3+dfsg.1/lib/Zend/Loader/Exception/000077500000000000000000000000001226600447100204335ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/Zend/Loader/Exception/BadMethodCallException.php000066400000000000000000000011301226600447100254410ustar00rootroot00000000000000 path */ protected $explicitPaths = array(); /** * @var array An array of namespaceName => namespacePath */ protected $namespacedPaths = array(); /** * @var array An array of supported phar extensions (filled on constructor) */ protected $pharExtensions = array(); /** * @var array An array of module classes to their containing files */ protected $moduleClassMap = array(); /** * Constructor * * Allow configuration of the autoloader via the constructor. * * @param null|array|Traversable $options */ public function __construct($options = null) { if (extension_loaded('phar')) { $this->pharExtensions = array( 'phar', 'phar.tar', 'tar', ); // ext/zlib enabled -> phar can read gzip & zip compressed files if (extension_loaded('zlib')) { $this->pharExtensions[] = 'phar.gz'; $this->pharExtensions[] = 'phar.tar.gz'; $this->pharExtensions[] = 'tar.gz'; $this->pharExtensions[] = 'phar.zip'; $this->pharExtensions[] = 'zip'; } // ext/bzip2 enabled -> phar can read bz2 compressed files if (extension_loaded('bzip2')) { $this->pharExtensions[] = 'phar.bz2'; $this->pharExtensions[] = 'phar.tar.bz2'; $this->pharExtensions[] = 'tar.bz2'; } } if (null !== $options) { $this->setOptions($options); } } /** * Configure the autoloader * * In most cases, $options should be either an associative array or * Traversable object. * * @param array|Traversable $options * @return ModuleAutoloader */ public function setOptions($options) { $this->registerPaths($options); return $this; } /** * Autoload a class * * @param $class * @return mixed * False [if unable to load $class] * get_class($class) [if $class is successfully loaded] */ public function autoload($class) { // Limit scope of this autoloader if (substr($class, -7) !== '\Module') { return false; } $moduleName = substr($class, 0, -7); if (isset($this->explicitPaths[$moduleName])) { $classLoaded = $this->loadModuleFromDir($this->explicitPaths[$moduleName], $class); if ($classLoaded) { return $classLoaded; } $classLoaded = $this->loadModuleFromPhar($this->explicitPaths[$moduleName], $class); if ($classLoaded) { return $classLoaded; } } if (count($this->namespacedPaths) >= 1 ) { foreach ( $this->namespacedPaths as $namespace=>$path ) { if ( false === strpos($moduleName,$namespace) ) { continue; } $moduleName_buffer = str_replace($namespace . "\\", "", $moduleName ); $path .= DIRECTORY_SEPARATOR . $moduleName_buffer . DIRECTORY_SEPARATOR; $classLoaded = $this->loadModuleFromDir($path, $class); if ($classLoaded) { return $classLoaded; } $classLoaded = $this->loadModuleFromPhar($path, $class); if ($classLoaded) { return $classLoaded; } } } $moduleClassPath = str_replace('\\', DIRECTORY_SEPARATOR, $moduleName); $pharSuffixPattern = null; if ($this->pharExtensions) { $pharSuffixPattern = '(' . implode('|', array_map('preg_quote', $this->pharExtensions)) . ')'; } foreach ($this->paths as $path) { $path = $path . $moduleClassPath; $classLoaded = $this->loadModuleFromDir($path, $class); if ($classLoaded) { return $classLoaded; } // No directory with Module.php, searching for phars if ($pharSuffixPattern) { foreach (new GlobIterator($path . '.*') as $entry) { if ($entry->isDir()) { continue; } if (!preg_match('#.+\.' . $pharSuffixPattern . '$#', $entry->getPathname())) { continue; } $classLoaded = $this->loadModuleFromPhar($entry->getPathname(), $class); if ($classLoaded) { return $classLoaded; } } } } return false; } /** * loadModuleFromDir * * @param string $dirPath * @param string $class * @return mixed * False [if unable to load $class] * get_class($class) [if $class is successfully loaded] */ protected function loadModuleFromDir($dirPath, $class) { $file = new SplFileInfo($dirPath . '/Module.php'); if ($file->isReadable() && $file->isFile()) { // Found directory with Module.php in it require_once $file->getRealPath(); if (class_exists($class)) { $this->moduleClassMap[$class] = $file->getRealPath(); return $class; } } return false; } /** * loadModuleFromPhar * * @param string $pharPath * @param string $class * @return mixed * False [if unable to load $class] * get_class($class) [if $class is successfully loaded] */ protected function loadModuleFromPhar($pharPath, $class) { $pharPath = static::normalizePath($pharPath, false); $file = new SplFileInfo($pharPath); if (!$file->isReadable() || !$file->isFile()) { return false; } $fileRealPath = $file->getRealPath(); // Phase 0: Check for executable phar with Module class in stub if (strpos($fileRealPath, '.phar') !== false) { // First see if the stub makes the Module class available require_once $fileRealPath; if (class_exists($class)) { $this->moduleClassMap[$class] = $fileRealPath; return $class; } } // Phase 1: Not executable phar, no stub, or stub did not provide Module class; try Module.php directly $moduleClassFile = 'phar://' . $fileRealPath . '/Module.php'; $moduleFile = new SplFileInfo($moduleClassFile); if ($moduleFile->isReadable() && $moduleFile->isFile()) { require_once $moduleClassFile; if (class_exists($class)) { $this->moduleClassMap[$class] = $moduleClassFile; return $class; } } // Phase 2: Check for nested module directory within archive // Checks for /path/to/MyModule.tar/MyModule/Module.php // (shell-integrated zip/tar utilities wrap directories like this) $pharBaseName = $this->pharFileToModuleName($fileRealPath); $moduleClassFile = 'phar://' . $fileRealPath . '/' . $pharBaseName . '/Module.php'; $moduleFile = new SplFileInfo($moduleClassFile); if ($moduleFile->isReadable() && $moduleFile->isFile()) { require_once $moduleClassFile; if (class_exists($class)) { $this->moduleClassMap[$class] = $moduleClassFile; return $class; } } return false; } /** * Register the autoloader with spl_autoload registry * * @return void */ public function register() { spl_autoload_register(array($this, 'autoload')); } /** * Unregister the autoloader with spl_autoload registry * * @return void */ public function unregister() { spl_autoload_unregister(array($this, 'autoload')); } /** * registerPaths * * @param array|Traversable $paths * @throws \InvalidArgumentException * @return ModuleAutoloader */ public function registerPaths($paths) { if (!is_array($paths) && !$paths instanceof Traversable) { throw new \InvalidArgumentException( 'Parameter to \\Zend\\Loader\\ModuleAutoloader\'s ' . 'registerPaths method must be an array or ' . 'implement the \\Traversable interface' ); } foreach ($paths as $module => $path) { if (is_string($module)) { $this->registerPath($path, $module); } else { $this->registerPath($path); } } return $this; } /** * registerPath * * @param string $path * @param bool|string $moduleName * @throws \InvalidArgumentException * @return ModuleAutoloader */ public function registerPath($path, $moduleName = false) { if (!is_string($path)) { throw new \InvalidArgumentException(sprintf( 'Invalid path provided; must be a string, received %s', gettype($path) )); } if ($moduleName) { if (in_array( substr($moduleName, -2 ), array('\\*','\\%') ) ) { $this->namespacedPaths[ substr($moduleName, 0, -2 ) ] = static::normalizePath($path); } else { $this->explicitPaths[$moduleName] = static::normalizePath($path); } } else { $this->paths[] = static::normalizePath($path); } return $this; } /** * getPaths * * This is primarily for unit testing, but could have other uses. * * @return array */ public function getPaths() { return $this->paths; } /** * Returns the base module name from the path to a phar * * @param string $pharPath * @return string */ protected function pharFileToModuleName($pharPath) { do { $pathinfo = pathinfo($pharPath); $pharPath = $pathinfo['filename']; } while (isset($pathinfo['extension'])); return $pathinfo['filename']; } /** * Normalize a path for insertion in the stack * * @param string $path * @param bool $trailingSlash Whether trailing slash should be included * @return string */ public static function normalizePath($path, $trailingSlash = true) { $path = rtrim($path, '/'); $path = rtrim($path, '\\'); if ($trailingSlash) { $path .= DIRECTORY_SEPARATOR; } return $path; } } glpi-0.84.3+dfsg.1/lib/Zend/Loader/PluginClassLoader.php000066400000000000000000000130661226600447100225670ustar00rootroot00000000000000 class name pairs * @var array */ protected $plugins = array(); /** * Static map allow global seeding of plugin loader * @var array */ protected static $staticMap = array(); /** * Constructor * * @param null|array|Traversable $map If provided, seeds the loader with a map */ public function __construct($map = null) { // Merge in static overrides if (!empty(static::$staticMap)) { $this->registerPlugins(static::$staticMap); } // Merge in constructor arguments if ($map !== null) { $this->registerPlugins($map); } } /** * Add a static map of plugins * * A null value will clear the static map. * * @param null|array|Traversable $map * @throws Exception\InvalidArgumentException * @return void */ public static function addStaticMap($map) { if (null === $map) { static::$staticMap = array(); return; } if (!is_array($map) && !$map instanceof \Traversable) { throw new Exception\InvalidArgumentException('Expects an array or Traversable object'); } foreach ($map as $key => $value) { static::$staticMap[$key] = $value; } } /** * Register a class to a given short name * * @param string $shortName * @param string $className * @return PluginClassLoader */ public function registerPlugin($shortName, $className) { $this->plugins[strtolower($shortName)] = $className; return $this; } /** * Register many plugins at once * * If $map is a string, assumes that the map is the class name of a * Traversable object (likely a ShortNameLocator); it will then instantiate * this class and use it to register plugins. * * If $map is an array or Traversable object, it will iterate it to * register plugin names/classes. * * For all other arguments, or if the string $map is not a class or not a * Traversable class, an exception will be raised. * * @param string|array|Traversable $map * @return PluginClassLoader * @throws Exception\InvalidArgumentException */ public function registerPlugins($map) { if (is_string($map)) { if (!class_exists($map)) { throw new Exception\InvalidArgumentException('Map class provided is invalid'); } $map = new $map; } if (is_array($map)) { $map = new ArrayIterator($map); } if (!$map instanceof Traversable) { throw new Exception\InvalidArgumentException('Map provided is invalid; must be traversable'); } // iterator_apply doesn't work as expected with IteratorAggregate if ($map instanceof IteratorAggregate) { $map = $map->getIterator(); } foreach ($map as $name => $class) { if (is_int($name) || is_numeric($name)) { if (!is_object($class) && class_exists($class)) { $class = new $class(); } if ($class instanceof Traversable) { $this->registerPlugins($class); continue; } } $this->registerPlugin($name, $class); } return $this; } /** * Unregister a short name lookup * * @param mixed $shortName * @return PluginClassLoader */ public function unregisterPlugin($shortName) { $lookup = strtolower($shortName); if (array_key_exists($lookup, $this->plugins)) { unset($this->plugins[$lookup]); } return $this; } /** * Get a list of all registered plugins * * @return array|Traversable */ public function getRegisteredPlugins() { return $this->plugins; } /** * Whether or not a plugin by a specific name has been registered * * @param string $name * @return bool */ public function isLoaded($name) { $lookup = strtolower($name); return isset($this->plugins[$lookup]); } /** * Return full class name for a named helper * * @param string $name * @return string|false */ public function getClassName($name) { return $this->load($name); } /** * Load a helper via the name provided * * @param string $name * @return string|false */ public function load($name) { if (!$this->isLoaded($name)) { return false; } return $this->plugins[strtolower($name)]; } /** * Defined by IteratorAggregate * * Returns an instance of ArrayIterator, containing a map of * all plugins * * @return ArrayIterator */ public function getIterator() { return new ArrayIterator($this->plugins); } } glpi-0.84.3+dfsg.1/lib/Zend/Loader/PluginClassLocator.php000066400000000000000000000020761226600447100227630ustar00rootroot00000000000000 * spl_autoload_register(array($this, 'autoload')); * * * @return void */ public function register(); } glpi-0.84.3+dfsg.1/lib/Zend/Loader/StandardAutoloader.php000066400000000000000000000240221226600447100227660ustar00rootroot00000000000000setOptions($options); } } /** * Configure autoloader * * Allows specifying both "namespace" and "prefix" pairs, using the * following structure: * * array( * 'namespaces' => array( * 'Zend' => '/path/to/Zend/library', * 'Doctrine' => '/path/to/Doctrine/library', * ), * 'prefixes' => array( * 'Phly_' => '/path/to/Phly/library', * ), * 'fallback_autoloader' => true, * ) * * * @param array|\Traversable $options * @throws Exception\InvalidArgumentException * @return StandardAutoloader */ public function setOptions($options) { if (!is_array($options) && !($options instanceof \Traversable)) { require_once __DIR__ . '/Exception/InvalidArgumentException.php'; throw new Exception\InvalidArgumentException('Options must be either an array or Traversable'); } foreach ($options as $type => $pairs) { switch ($type) { case self::AUTOREGISTER_ZF: if ($pairs) { $this->registerNamespace('Zend', dirname(__DIR__)); } break; case self::LOAD_NS: if (is_array($pairs) || $pairs instanceof \Traversable) { $this->registerNamespaces($pairs); } break; case self::LOAD_PREFIX: if (is_array($pairs) || $pairs instanceof \Traversable) { $this->registerPrefixes($pairs); } break; case self::ACT_AS_FALLBACK: $this->setFallbackAutoloader($pairs); break; default: // ignore } } return $this; } /** * Set flag indicating fallback autoloader status * * @param bool $flag * @return StandardAutoloader */ public function setFallbackAutoloader($flag) { $this->fallbackAutoloaderFlag = (bool) $flag; return $this; } /** * Is this autoloader acting as a fallback autoloader? * * @return bool */ public function isFallbackAutoloader() { return $this->fallbackAutoloaderFlag; } /** * Register a namespace/directory pair * * @param string $namespace * @param string $directory * @return StandardAutoloader */ public function registerNamespace($namespace, $directory) { $namespace = rtrim($namespace, self::NS_SEPARATOR) . self::NS_SEPARATOR; $this->namespaces[$namespace] = $this->normalizeDirectory($directory); return $this; } /** * Register many namespace/directory pairs at once * * @param array $namespaces * @throws Exception\InvalidArgumentException * @return StandardAutoloader */ public function registerNamespaces($namespaces) { if (!is_array($namespaces) && !$namespaces instanceof \Traversable) { require_once __DIR__ . '/Exception/InvalidArgumentException.php'; throw new Exception\InvalidArgumentException('Namespace pairs must be either an array or Traversable'); } foreach ($namespaces as $namespace => $directory) { $this->registerNamespace($namespace, $directory); } return $this; } /** * Register a prefix/directory pair * * @param string $prefix * @param string $directory * @return StandardAutoloader */ public function registerPrefix($prefix, $directory) { $prefix = rtrim($prefix, self::PREFIX_SEPARATOR). self::PREFIX_SEPARATOR; $this->prefixes[$prefix] = $this->normalizeDirectory($directory); return $this; } /** * Register many namespace/directory pairs at once * * @param array $prefixes * @throws Exception\InvalidArgumentException * @return StandardAutoloader */ public function registerPrefixes($prefixes) { if (!is_array($prefixes) && !$prefixes instanceof \Traversable) { require_once __DIR__ . '/Exception/InvalidArgumentException.php'; throw new Exception\InvalidArgumentException('Prefix pairs must be either an array or Traversable'); } foreach ($prefixes as $prefix => $directory) { $this->registerPrefix($prefix, $directory); } return $this; } /** * Defined by Autoloadable; autoload a class * * @param string $class * @return false|string */ public function autoload($class) { $isFallback = $this->isFallbackAutoloader(); if (false !== strpos($class, self::NS_SEPARATOR)) { if ($this->loadClass($class, self::LOAD_NS)) { return $class; } elseif ($isFallback) { return $this->loadClass($class, self::ACT_AS_FALLBACK); } return false; } if (false !== strpos($class, self::PREFIX_SEPARATOR)) { if ($this->loadClass($class, self::LOAD_PREFIX)) { return $class; } elseif ($isFallback) { return $this->loadClass($class, self::ACT_AS_FALLBACK); } return false; } if ($isFallback) { return $this->loadClass($class, self::ACT_AS_FALLBACK); } return false; } /** * Register the autoloader with spl_autoload * * @return void */ public function register() { spl_autoload_register(array($this, 'autoload')); } /** * Transform the class name to a filename * * @param string $class * @param string $directory * @return string */ protected function transformClassNameToFilename($class, $directory) { // $class may contain a namespace portion, in which case we need // to preserve any underscores in that portion. $matches = array(); preg_match('/(?P.+\\\)?(?P[^\\\]+$)/', $class, $matches); $class = (isset($matches['class'])) ? $matches['class'] : ''; $namespace = (isset($matches['namespace'])) ? $matches['namespace'] : ''; return $directory . str_replace(self::NS_SEPARATOR, '/', $namespace) . str_replace(self::PREFIX_SEPARATOR, '/', $class) . '.php'; } /** * Load a class, based on its type (namespaced or prefixed) * * @param string $class * @param string $type * @return bool|string * @throws Exception\InvalidArgumentException */ protected function loadClass($class, $type) { if (!in_array($type, array(self::LOAD_NS, self::LOAD_PREFIX, self::ACT_AS_FALLBACK))) { require_once __DIR__ . '/Exception/InvalidArgumentException.php'; throw new Exception\InvalidArgumentException(); } // Fallback autoloading if ($type === self::ACT_AS_FALLBACK) { // create filename $filename = $this->transformClassNameToFilename($class, ''); $resolvedName = stream_resolve_include_path($filename); if ($resolvedName !== false) { return include $resolvedName; } return false; } // Namespace and/or prefix autoloading foreach ($this->$type as $leader => $path) { if (0 === strpos($class, $leader)) { // Trim off leader (namespace or prefix) $trimmedClass = substr($class, strlen($leader)); // create filename $filename = $this->transformClassNameToFilename($trimmedClass, $path); if (file_exists($filename)) { return include $filename; } return false; } } return false; } /** * Normalize the directory to include a trailing directory separator * * @param string $directory * @return string */ protected function normalizeDirectory($directory) { $last = $directory[strlen($directory) - 1]; if (in_array($last, array('/', '\\'))) { $directory[strlen($directory) - 1] = DIRECTORY_SEPARATOR; return $directory; } $directory .= DIRECTORY_SEPARATOR; return $directory; } } glpi-0.84.3+dfsg.1/lib/Zend/Loader/composer.json000066400000000000000000000006321226600447100212200ustar00rootroot00000000000000{ "name": "zendframework/zend-loader", "description": " ", "license": "BSD-3-Clause", "keywords": [ "zf2", "loader" ], "autoload": { "psr-0": { "Zend\\Loader\\": "" } }, "target-dir": "Zend/Loader", "require": { "php": ">=5.3.3" }, "suggest": { "zendframework/zend-stdlib": "Zend\\Stdlib component" } }glpi-0.84.3+dfsg.1/lib/Zend/README.md000066400000000000000000000043071226600447100165520ustar00rootroot00000000000000### Welcome to the *Zend Framework 2.0* Release! Master: [![Build Status](https://secure.travis-ci.org/zendframework/zf2.png?branch=master)](http://travis-ci.org/zendframework/zf2) Develop: [![Build Status](https://secure.travis-ci.org/zendframework/zf2.png?branch=develop)](http://travis-ci.org/zendframework/zf2) ## RELEASE INFORMATION *Zend Framework 2.0.5* This is the fifth maintenance release for the 2.0 series. 29 Nov 2012 ### UPDATES IN 2.0.5 *Security Changes* The classes `Zend\Session\Validator\RemoteAddr` and `Zend\View\Helper\ServerUrl` were identified as having incorrect logic for detection of proxy servers. Both were updated to provide better detection, as well as more configuration surrounding detection. For more information on the security fixes, please see http://framework.zend.com/security/advisory/ZF2012-04 For all other changes, please see CHANGELOG.md. ### SYSTEM REQUIREMENTS Zend Framework 2 requires PHP 5.3.3 or later; we recommend using the latest PHP version whenever possible. ### INSTALLATION Please see INSTALL.md. ### CONTRIBUTING If you wish to contribute to Zend Framework 2.0, please read both the CONTRIBUTING.md and README-GIT.md file. ### QUESTIONS AND FEEDBACK Online documentation can be found at http://framework.zend.com/manual. Questions that are not addressed in the manual should be directed to the appropriate mailing list: http://framework.zend.com/archives/subscribe/ If you find code in this release behaving in an unexpected manner or contrary to its documented behavior, please create an issue in our GitHub issue tracker: https://github.com/zendframework/zf2/issues If you would like to be notified of new releases, you can subscribe to the fw-announce mailing list by sending a blank message to . ### LICENSE The files in this archive are released under the Zend Framework license. You can find a copy of this license in LICENSE.txt. ### ACKNOWLEDGEMENTS The Zend Framework team would like to thank all the [contributors](https://github.com/zendframework/zf2/contributors) to the Zend Framework project, our corporate sponsor, and you, the Zend Framework user. Please visit us sometime soon at http://framework.zend.com. glpi-0.84.3+dfsg.1/lib/Zend/ServiceManager/000077500000000000000000000000001226600447100201625ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/Zend/ServiceManager/AbstractFactoryInterface.php000066400000000000000000000020571226600447100256130ustar00rootroot00000000000000addInitializer(function ($instance) use ($self) { if ($instance instanceof ServiceLocatorAwareInterface) { $instance->setServiceLocator($self); } if ($instance instanceof ServiceManagerAwareInterface) { $instance->setServiceManager($self); } }); } /** * Validate the plugin * * Checks that the filter loaded is either a valid callback or an instance * of FilterInterface. * * @param mixed $plugin * @return void * @throws Exception\RuntimeException if invalid */ abstract public function validatePlugin($plugin); /** * Retrieve a service from the manager by name * * Allows passing an array of options to use when creating the instance. * createFromInvokable() will use these and pass them to the instance * constructor if not null and a non-empty array. * * @param string $name * @param array $options * @param bool $usePeeringServiceManagers * @return object */ public function get($name, $options = array(), $usePeeringServiceManagers = true) { // Allow specifying a class name directly; registers as an invokable class if (!$this->has($name) && $this->autoAddInvokableClass && class_exists($name)) { $this->setInvokableClass($name, $name); } $this->creationOptions = $options; $instance = parent::get($name, $usePeeringServiceManagers); $this->creationOptions = null; $this->validatePlugin($instance); return $instance; } /** * Register a service with the locator. * * Validates that the service object via validatePlugin() prior to * attempting to register it. * * @param string $name * @param mixed $service * @param bool $shared * @return AbstractPluginManager * @throws Exception\InvalidServiceNameException */ public function setService($name, $service, $shared = true) { if ($service) { $this->validatePlugin($service); } parent::setService($name, $service, $shared); return $this; } /** * Set the main service locator so factories can have access to it to pull deps * * @param ServiceLocatorInterface $serviceLocator * @return AbstractPluginManager */ public function setServiceLocator(ServiceLocatorInterface $serviceLocator) { $this->serviceLocator = $serviceLocator; return $this; } /** * Get the main plugin manager. Useful for fetching dependencies from within factories. * * @return mixed */ public function getServiceLocator() { return $this->serviceLocator; } /** * Attempt to create an instance via an invokable class * * Overrides parent implementation by passing $creationOptions to the * constructor, if non-null. * * @param string $canonicalName * @param string $requestedName * @return null|\stdClass * @throws Exception\ServiceNotCreatedException If resolved class does not exist */ protected function createFromInvokable($canonicalName, $requestedName) { $invokable = $this->invokableClasses[$canonicalName]; if (null === $this->creationOptions || (is_array($this->creationOptions) && empty($this->creationOptions)) ) { $instance = new $invokable(); } else { $instance = new $invokable($this->creationOptions); } return $instance; } /** * Attempt to create an instance via a factory class * * Overrides parent implementation by passing $creationOptions to the * constructor, if non-null. * * @param string $canonicalName * @param string $requestedName * @return mixed * @throws Exception\ServiceNotCreatedException If factory is not callable */ protected function createFromFactory($canonicalName, $requestedName) { $factory = $this->factories[$canonicalName]; if (is_string($factory) && class_exists($factory, true)) { if (null === $this->creationOptions || (is_array($this->creationOptions) && empty($this->creationOptions))) { $factory = new $factory(); } else { $factory = new $factory($this->creationOptions); } $this->factories[$canonicalName] = $factory; } if ($factory instanceof FactoryInterface) { $instance = $this->createServiceViaCallback(array($factory, 'createService'), $canonicalName, $requestedName); } elseif (is_callable($factory)) { $instance = $this->createServiceViaCallback($factory, $canonicalName, $requestedName); } else { throw new Exception\ServiceNotCreatedException(sprintf( 'While attempting to create %s%s an invalid factory was registered for this instance type.', $canonicalName, ($requestedName ? '(alias: ' . $requestedName . ')' : '') )); } return $instance; } } glpi-0.84.3+dfsg.1/lib/Zend/ServiceManager/Config.php000066400000000000000000000071431226600447100221050ustar00rootroot00000000000000config = $config; } /** * Get allow override * * @return null|bool */ public function getAllowOverride() { return (isset($this->config['allow_override'])) ? $this->config['allow_override'] : null; } /** * Get factories * * @return array */ public function getFactories() { return (isset($this->config['factories'])) ? $this->config['factories'] : array(); } /** * Get abstract factories * * @return array */ public function getAbstractFactories() { return (isset($this->config['abstract_factories'])) ? $this->config['abstract_factories'] : array(); } /** * Get invokables * * @return array */ public function getInvokables() { return (isset($this->config['invokables'])) ? $this->config['invokables'] : array(); } /** * Get services * * @return array */ public function getServices() { return (isset($this->config['services'])) ? $this->config['services'] : array(); } /** * Get aliases * * @return array */ public function getAliases() { return (isset($this->config['aliases'])) ? $this->config['aliases'] : array(); } /** * Get initializers * * @return array */ public function getInitializers() { return (isset($this->config['initializers'])) ? $this->config['initializers'] : array(); } /** * Get shared * * @return array */ public function getShared() { return (isset($this->config['shared'])) ? $this->config['shared'] : array(); } /** * Configure service manager * * @param ServiceManager $serviceManager * @return void */ public function configureServiceManager(ServiceManager $serviceManager) { if (($allowOverride = $this->getAllowOverride()) !== null) { $serviceManager->setAllowOverride($allowOverride); } foreach ($this->getFactories() as $name => $factory) { $serviceManager->setFactory($name, $factory); } foreach ($this->getAbstractFactories() as $factory) { $serviceManager->addAbstractFactory($factory); } foreach ($this->getInvokables() as $name => $invokable) { $serviceManager->setInvokableClass($name, $invokable); } foreach ($this->getServices() as $name => $service) { $serviceManager->setService($name, $service); } foreach ($this->getAliases() as $alias => $nameOrAlias) { $serviceManager->setAlias($alias, $nameOrAlias); } foreach ($this->getInitializers() as $initializer) { $serviceManager->addInitializer($initializer); } foreach ($this->getShared() as $name => $isShared) { $serviceManager->setShared($name, $isShared); } } } glpi-0.84.3+dfsg.1/lib/Zend/ServiceManager/ConfigInterface.php000066400000000000000000000012271226600447100237230ustar00rootroot00000000000000di = $di; if (in_array($useServiceLocator, array(self::USE_SL_BEFORE_DI, self::USE_SL_AFTER_DI, self::USE_SL_NONE))) { $this->useServiceLocator = $useServiceLocator; } // since we are using this in a proxy-fashion, localize state $this->definitions = $this->di->definitions; $this->instanceManager = $this->di->instanceManager; } /** * {@inheritDoc} */ public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $serviceName, $requestedName) { $this->serviceLocator = $serviceLocator; if ($requestedName) { return $this->get($requestedName, array(), true); } else { return $this->get($serviceName, array(), true); } } /** * {@inheritDoc} */ public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName) { return $this->instanceManager->hasSharedInstance($requestedName) || $this->instanceManager->hasAlias($requestedName) || $this->instanceManager->hasConfig($requestedName) || $this->instanceManager->hasTypePreferences($requestedName) || $this->definitions->hasClass($requestedName); } } glpi-0.84.3+dfsg.1/lib/Zend/ServiceManager/Di/DiInstanceManagerProxy.php000066400000000000000000000042141226600447100256060ustar00rootroot00000000000000diInstanceManager = $diInstanceManager; $this->serviceLocator = $serviceLocator; // localize state $this->aliases = &$diInstanceManager->aliases; $this->sharedInstances = &$diInstanceManager->sharedInstances; $this->sharedInstancesWithParams = &$diInstanceManager->sharedInstancesWithParams; $this->configurations = &$diInstanceManager->configurations; $this->typePreferences = &$diInstanceManager->typePreferences; } /** * Determine if we have a shared instance by class or alias * * @param $classOrAlias * @return bool */ public function hasSharedInstance($classOrAlias) { return ($this->serviceLocator->has($classOrAlias) || $this->diInstanceManager->hasSharedInstance($classOrAlias)); } /** * Get shared instance * * @param $classOrAlias * @return mixed */ public function getSharedInstance($classOrAlias) { if ($this->serviceLocator->has($classOrAlias)) { return $this->serviceLocator->get($classOrAlias); } else { return $this->diInstanceManager->getSharedInstance($classOrAlias); } } } glpi-0.84.3+dfsg.1/lib/Zend/ServiceManager/Di/DiServiceFactory.php000066400000000000000000000067631226600447100244500ustar00rootroot00000000000000di = $di; $this->name = $name; $this->parameters = $parameters; if (in_array($useServiceLocator, array(self::USE_SL_BEFORE_DI, self::USE_SL_AFTER_DI, self::USE_SL_NONE))) { $this->useServiceLocator = $useServiceLocator; } // since we are using this in a proxy-fashion, localize state $this->definitions = $this->di->definitions; $this->instanceManager = $this->di->instanceManager; } /** * Create service * * @param ServiceLocatorInterface $serviceLocator * @return object */ public function createService(ServiceLocatorInterface $serviceLocator) { $this->serviceLocator = $serviceLocator; return $this->get($this->name, $this->parameters, true); } /** * Override, as we want it to use the functionality defined in the proxy * * @param string $name * @param array $params * @return object * @throws Exception\ServiceNotFoundException */ public function get($name, array $params = array()) { // allow this di service to get dependencies from the service locator BEFORE trying di if ($this->useServiceLocator == self::USE_SL_BEFORE_DI && $this->serviceLocator->has($name)) { return $this->serviceLocator->get($name); } try { $service = parent::get($name, $params); return $service; } catch (DiClassNotFoundException $e) { // allow this di service to get dependencies from the service locator AFTER trying di if ($this->useServiceLocator == self::USE_SL_AFTER_DI && $this->serviceLocator->has($name)) { return $this->serviceLocator->get($name); } else { throw new Exception\ServiceNotFoundException( sprintf('Service %s was not found in this DI instance', $name), null, $e ); } } } } glpi-0.84.3+dfsg.1/lib/Zend/ServiceManager/Di/DiServiceInitializer.php000066400000000000000000000037161226600447100253170ustar00rootroot00000000000000di = $di; $this->serviceLocator = $serviceLocator; $this->diInstanceManagerProxy = ($diImProxy) ?: new DiInstanceManagerProxy($di->instanceManager(), $serviceLocator); } /** * Initialize * * @param $instance * @param ServiceLocatorInterface $serviceLocator * @throws \Exception */ public function initialize($instance, ServiceLocatorInterface $serviceLocator) { $instanceManager = $this->di->instanceManager; $this->di->instanceManager = $this->diInstanceManagerProxy; try { $this->di->injectDependencies($instance); $this->di->instanceManager = $instanceManager; } catch (\Exception $e) { $this->di->instanceManager = $instanceManager; throw $e; } } } glpi-0.84.3+dfsg.1/lib/Zend/ServiceManager/Exception/000077500000000000000000000000001226600447100221205ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/Zend/ServiceManager/Exception/CircularDependencyFoundException.php000066400000000000000000000010361226600447100312470ustar00rootroot00000000000000 '', '_' => '', ' ' => '', '\\' => '', '/' => ''); /** * Constructor * * @param ConfigInterface $config */ public function __construct(ConfigInterface $config = null) { if ($config) { $config->configureServiceManager($this); } } /** * Set allow override * * @param $allowOverride * @return ServiceManager */ public function setAllowOverride($allowOverride) { $this->allowOverride = (bool) $allowOverride; return $this; } /** * Get allow override * * @return bool */ public function getAllowOverride() { return $this->allowOverride; } /** * Set flag indicating whether services are shared by default * * @param bool $shareByDefault * @return ServiceManager * @throws Exception\RuntimeException if allowOverride is false */ public function setShareByDefault($shareByDefault) { if ($this->allowOverride === false) { throw new Exception\RuntimeException(sprintf( '%s: cannot alter default shared service setting; container is marked immutable (allow_override is false)', __METHOD__ )); } $this->shareByDefault = (bool) $shareByDefault; return $this; } /** * Are services shared by default? * * @return bool */ public function shareByDefault() { return $this->shareByDefault; } /** * Set throw exceptions in create * * @param bool $throwExceptionInCreate * @return ServiceManager */ public function setThrowExceptionInCreate($throwExceptionInCreate) { $this->throwExceptionInCreate = $throwExceptionInCreate; return $this; } /** * Get throw exceptions in create * * @return bool */ public function getThrowExceptionInCreate() { return $this->throwExceptionInCreate; } /** * Set flag indicating whether to pull from peering manager before attempting creation * * @param bool $retrieveFromPeeringManagerFirst * @return ServiceManager */ public function setRetrieveFromPeeringManagerFirst($retrieveFromPeeringManagerFirst = true) { $this->retrieveFromPeeringManagerFirst = (bool) $retrieveFromPeeringManagerFirst; return $this; } /** * Should we retrieve from the peering manager prior to attempting to create a service? * * @return bool */ public function retrieveFromPeeringManagerFirst() { return $this->retrieveFromPeeringManagerFirst; } /** * Set invokable class * * @param string $name * @param string $invokableClass * @param bool $shared * @return ServiceManager * @throws Exception\InvalidServiceNameException */ public function setInvokableClass($name, $invokableClass, $shared = true) { $cName = $this->canonicalizeName($name); $rName = $name; if ($this->has(array($cName, $rName), false)) { if ($this->allowOverride === false) { throw new Exception\InvalidServiceNameException(sprintf( 'A service by the name or alias "%s" already exists and cannot be overridden; please use an alternate name', $cName )); } $this->unregisterService($cName); } $this->invokableClasses[$cName] = $invokableClass; $this->shared[$cName] = (bool) $shared; return $this; } /** * Set factory * * @param string $name * @param string|FactoryInterface|callable $factory * @param bool $shared * @return ServiceManager * @throws Exception\InvalidArgumentException * @throws Exception\InvalidServiceNameException */ public function setFactory($name, $factory, $shared = true) { $cName = $this->canonicalizeName($name); $rName = $name; if (!is_string($factory) && !$factory instanceof FactoryInterface && !is_callable($factory)) { throw new Exception\InvalidArgumentException( 'Provided abstract factory must be the class name of an abstract factory or an instance of an AbstractFactoryInterface.' ); } if ($this->has(array($cName, $rName), false)) { if ($this->allowOverride === false) { throw new Exception\InvalidServiceNameException(sprintf( 'A service by the name or alias "%s" already exists and cannot be overridden, please use an alternate name', $cName )); } $this->unregisterService($cName); } $this->factories[$cName] = $factory; $this->shared[$cName] = (bool) $shared; return $this; } /** * Add abstract factory * * @param AbstractFactoryInterface|string $factory * @param bool $topOfStack * @return ServiceManager * @throws Exception\InvalidArgumentException if the abstract factory is invalid */ public function addAbstractFactory($factory, $topOfStack = true) { if (!is_string($factory) && !$factory instanceof AbstractFactoryInterface) { throw new Exception\InvalidArgumentException( 'Provided abstract factory must be the class name of an abstract factory or an instance of an AbstractFactoryInterface.' ); } if (is_string($factory)) { if (!class_exists($factory, true)) { throw new Exception\InvalidArgumentException( 'Provided abstract factory must be the class name of an abstract factory or an instance of an AbstractFactoryInterface.' ); } $refl = new ReflectionClass($factory); if (!$refl->implementsInterface(__NAMESPACE__ . '\\AbstractFactoryInterface')) { throw new Exception\InvalidArgumentException( 'Provided abstract factory must be the class name of an abstract factory or an instance of an AbstractFactoryInterface.' ); } } if ($topOfStack) { array_unshift($this->abstractFactories, $factory); } else { array_push($this->abstractFactories, $factory); } return $this; } /** * Add initializer * * @param callable|InitializerInterface $initializer * @param bool $topOfStack * @return ServiceManager * @throws Exception\InvalidArgumentException */ public function addInitializer($initializer, $topOfStack = true) { if (!is_callable($initializer) && !$initializer instanceof InitializerInterface) { if (!is_string($initializer) || !$this->isSubclassOf($initializer, __NAMESPACE__ . '\InitializerInterface') ) { throw new Exception\InvalidArgumentException('$initializer should be callable.'); } $initializer = new $initializer; } if ($topOfStack) { array_unshift($this->initializers, $initializer); } else { array_push($this->initializers, $initializer); } return $this; } /** * Register a service with the locator * * @param string $name * @param mixed $service * @param bool $shared * @return ServiceManager * @throws Exception\InvalidServiceNameException */ public function setService($name, $service, $shared = true) { $cName = $this->canonicalizeName($name); if ($this->has($cName, false)) { if ($this->allowOverride === false) { throw new Exception\InvalidServiceNameException(sprintf( '%s: A service by the name "%s" or alias already exists and cannot be overridden, please use an alternate name.', __METHOD__, $name )); } $this->unregisterService($cName); } $this->instances[$cName] = $service; $this->shared[$cName] = (bool) $shared; return $this; } /** * @param string $name * @param bool $isShared * @return ServiceManager * @throws Exception\ServiceNotFoundException */ public function setShared($name, $isShared) { $cName = $this->canonicalizeName($name); if ( !isset($this->invokableClasses[$cName]) && !isset($this->factories[$cName]) && !$this->canCreateFromAbstractFactory($cName, $name) ) { throw new Exception\ServiceNotFoundException(sprintf( '%s: A service by the name "%s" was not found and could not be marked as shared', __METHOD__, $name )); } $this->shared[$cName] = (bool) $isShared; return $this; } /** * Retrieve a registered instance * * @param string $name * @param bool $usePeeringServiceManagers * @throws Exception\ServiceNotFoundException * @return object|array */ public function get($name, $usePeeringServiceManagers = true) { $cName = $this->canonicalizeName($name); $rName = $name; $isAlias = false; if ($this->hasAlias($cName)) { $isAlias = true; do { $cName = $this->aliases[$cName]; } while ($this->hasAlias($cName)); } if (isset($this->instances[$cName])) { return $this->instances[$cName]; } $instance = null; $retrieveFromPeeringManagerFirst = $this->retrieveFromPeeringManagerFirst(); if ($usePeeringServiceManagers && $retrieveFromPeeringManagerFirst) { $instance = $this->retrieveFromPeeringManager($name); } if (!$instance) { if ($this->canCreate(array($cName, $rName))) { $instance = $this->create(array($cName, $rName)); } elseif ($usePeeringServiceManagers && !$retrieveFromPeeringManagerFirst) { $instance = $this->retrieveFromPeeringManager($name); } } // Still no instance? raise an exception if (!$instance && !is_array($instance)) { if ($isAlias) { throw new Exception\ServiceNotFoundException(sprintf( 'An alias "%s" was requested but no service could be found.', $name )); } throw new Exception\ServiceNotFoundException(sprintf( '%s was unable to fetch or create an instance for %s', __METHOD__, $name )); } if ($this->shareByDefault() && (!isset($this->shared[$cName]) || $this->shared[$cName] === true)) { $this->instances[$cName] = $instance; } return $instance; } /** * Create an instance * * @param string|array $name * @return bool|object * @throws Exception\ServiceNotFoundException * @throws Exception\ServiceNotCreatedException */ public function create($name) { $instance = false; if (is_array($name)) { list($cName, $rName) = $name; } else { $rName = $name; $cName = $this->canonicalizeName($rName); } if (isset($this->factories[$cName])) { $instance = $this->createFromFactory($cName, $rName); } if (!$instance && isset($this->invokableClasses[$cName])) { $instance = $this->createFromInvokable($cName, $rName); } if (!$instance && $this->canCreateFromAbstractFactory($cName, $rName)) { $instance = $this->createFromAbstractFactory($cName, $rName); } if ($this->throwExceptionInCreate == true && $instance === false) { throw new Exception\ServiceNotFoundException(sprintf( 'No valid instance was found for %s%s', $cName, ($rName ? '(alias: ' . $rName . ')' : '') )); } foreach ($this->initializers as $initializer) { if ($initializer instanceof InitializerInterface) { $initializer->initialize($instance, $this); } elseif (is_object($initializer) && is_callable($initializer)) { $initializer($instance, $this); } else { call_user_func($initializer, $instance, $this); } } return $instance; } /** * Determine if we can create an instance. * * @param string|array $name * @param bool $checkAbstractFactories * @return bool */ public function canCreate($name, $checkAbstractFactories = true) { if (is_array($name)) { list($cName, $rName) = $name; } else { $rName = $name; $cName = $this->canonicalizeName($rName); } if ( isset($this->invokableClasses[$cName]) || isset($this->factories[$cName]) || isset($this->aliases[$cName]) || isset($this->instances[$cName]) ) { return true; } if ($checkAbstractFactories && $this->canCreateFromAbstractFactory($cName, $rName)) { return true; } return false; } /** * @param string|array $name * @param bool $checkAbstractFactories * @param bool $usePeeringServiceManagers * @return bool */ public function has($name, $checkAbstractFactories = true, $usePeeringServiceManagers = true) { if (is_array($name)) { list($cName, $rName) = $name; } else { $rName = $name; $cName = $this->canonicalizeName($rName); } if ($this->canCreate(array($cName, $rName), $checkAbstractFactories)) { return true; } if ($usePeeringServiceManagers) { foreach ($this->peeringServiceManagers as $peeringServiceManager) { if ($peeringServiceManager->has($rName)) { return true; } } } return false; } /** * Determine if we can create an instance from an abstract factory. * * @param string $cName * @param string $rName * @return bool */ public function canCreateFromAbstractFactory($cName, $rName) { // check abstract factories foreach ($this->abstractFactories as $index => $abstractFactory) { // Support string abstract factory class names if (is_string($abstractFactory) && class_exists($abstractFactory, true)) { $this->abstractFactories[$index] = $abstractFactory = new $abstractFactory(); } if ( isset($this->pendingAbstractFactoryRequests[get_class($abstractFactory)]) && $this->pendingAbstractFactoryRequests[get_class($abstractFactory)] == $rName ) { return false; } if ($abstractFactory->canCreateServiceWithName($this, $cName, $rName)) { return true; } } return false; } /** * @param string $alias * @param string $nameOrAlias * @return ServiceManager * @throws Exception\ServiceNotFoundException * @throws Exception\InvalidServiceNameException */ public function setAlias($alias, $nameOrAlias) { if (!is_string($alias) || !is_string($nameOrAlias)) { throw new Exception\InvalidServiceNameException('Service or alias names must be strings.'); } $cAlias = $this->canonicalizeName($alias); $nameOrAlias = $this->canonicalizeName($nameOrAlias); if ($alias == '' || $nameOrAlias == '') { throw new Exception\InvalidServiceNameException('Invalid service name alias'); } if ($this->allowOverride === false && $this->has(array($cAlias, $alias), false)) { throw new Exception\InvalidServiceNameException('An alias by this name already exists'); } $this->aliases[$cAlias] = $nameOrAlias; return $this; } /** * Determine if we have an alias * * @param string $alias * @return bool */ public function hasAlias($alias) { $alias = $this->canonicalizeName($alias); return (isset($this->aliases[$alias])); } /** * Create scoped service manager * * @param string $peering * @return ServiceManager */ public function createScopedServiceManager($peering = self::SCOPE_PARENT) { $scopedServiceManager = new ServiceManager(); if ($peering == self::SCOPE_PARENT) { $scopedServiceManager->peeringServiceManagers[] = $this; } if ($peering == self::SCOPE_CHILD) { $this->peeringServiceManagers[] = $scopedServiceManager; } return $scopedServiceManager; } /** * Add a peering relationship * * @param ServiceManager $manager * @param string $peering * @return ServiceManager */ public function addPeeringServiceManager(ServiceManager $manager, $peering = self::SCOPE_PARENT) { if ($peering == self::SCOPE_PARENT) { $this->peeringServiceManagers[] = $manager; } if ($peering == self::SCOPE_CHILD) { $manager->peeringServiceManagers[] = $this; } return $this; } /** * Canonicalize name * * @param string $name * @return string */ protected function canonicalizeName($name) { if (isset($this->canonicalNames[$name])) { return $this->canonicalNames[$name]; } // this is just for performance instead of using str_replace return $this->canonicalNames[$name] = strtolower(strtr($name, $this->canonicalNamesReplacements)); } /** * Create service via callback * * @param callable $callable * @param string $cName * @param string $rName * @throws Exception\ServiceNotCreatedException * @throws Exception\ServiceNotFoundException * @throws Exception\CircularDependencyFoundException * @return object */ protected function createServiceViaCallback($callable, $cName, $rName) { static $circularDependencyResolver = array(); $depKey = spl_object_hash($this) . '-' . $cName; if (isset($circularDependencyResolver[$depKey])) { $circularDependencyResolver = array(); throw new Exception\CircularDependencyFoundException('Circular dependency for LazyServiceLoader was found for instance ' . $rName); } try { $circularDependencyResolver[$depKey] = true; $instance = call_user_func($callable, $this, $cName, $rName); unset($circularDependencyResolver[$depKey]); } catch (Exception\ServiceNotFoundException $e) { unset($circularDependencyResolver[$depKey]); throw $e; } catch (\Exception $e) { unset($circularDependencyResolver[$depKey]); throw new Exception\ServiceNotCreatedException( sprintf('An exception was raised while creating "%s"; no instance returned', $rName), $e->getCode(), $e ); } if ($instance === null) { throw new Exception\ServiceNotCreatedException('The factory was called but did not return an instance.'); } return $instance; } /** * Retrieve a keyed list of all registered services. Handy for debugging! * * @return array */ public function getRegisteredServices() { return array( 'invokableClasses' => array_keys($this->invokableClasses), 'factories' => array_keys($this->factories), 'aliases' => array_keys($this->aliases), 'instances' => array_keys($this->instances), ); } /** * Retrieve a keyed list of all canonical names. Handy for debugging! * * @return array */ public function getCanonicalNames() { return $this->canonicalNames; } /** * Allows to override the canonical names lookup map with predefined * values. * * @param array $canonicalNames * @return ServiceManager */ public function setCanonicalNames($canonicalNames) { $this->canonicalNames = $canonicalNames; return $this; } /** * Attempt to retrieve an instance via a peering manager * * @param string $name * @return mixed */ protected function retrieveFromPeeringManager($name) { foreach ($this->peeringServiceManagers as $peeringServiceManager) { if ($peeringServiceManager->has($name)) { return $peeringServiceManager->get($name); } } $name = $this->canonicalizeName($name); if ($this->hasAlias($name)) { do { $name = $this->aliases[$name]; } while ($this->hasAlias($name)); } foreach ($this->peeringServiceManagers as $peeringServiceManager) { if ($peeringServiceManager->has($name)) { return $peeringServiceManager->get($name); } } return null; } /** * Attempt to create an instance via an invokable class * * @param string $canonicalName * @param string $requestedName * @return null|\stdClass * @throws Exception\ServiceNotFoundException If resolved class does not exist */ protected function createFromInvokable($canonicalName, $requestedName) { $invokable = $this->invokableClasses[$canonicalName]; if (!class_exists($invokable)) { throw new Exception\ServiceNotFoundException(sprintf( '%s: failed retrieving "%s%s" via invokable class "%s"; class does not exist', __METHOD__, $canonicalName, ($requestedName ? '(alias: ' . $requestedName . ')' : ''), $invokable )); } $instance = new $invokable; return $instance; } /** * Attempt to create an instance via a factory * * @param string $canonicalName * @param string $requestedName * @return mixed * @throws Exception\ServiceNotCreatedException If factory is not callable */ protected function createFromFactory($canonicalName, $requestedName) { $factory = $this->factories[$canonicalName]; if (is_string($factory) && class_exists($factory, true)) { $factory = new $factory; $this->factories[$canonicalName] = $factory; } if ($factory instanceof FactoryInterface) { $instance = $this->createServiceViaCallback(array($factory, 'createService'), $canonicalName, $requestedName); } elseif (is_callable($factory)) { $instance = $this->createServiceViaCallback($factory, $canonicalName, $requestedName); } else { throw new Exception\ServiceNotCreatedException(sprintf( 'While attempting to create %s%s an invalid factory was registered for this instance type.', $canonicalName, ($requestedName ? '(alias: ' . $requestedName . ')' : '') )); } return $instance; } /** * Attempt to create an instance via an abstract factory * * @param string $canonicalName * @param string $requestedName * @return object|null * @throws Exception\ServiceNotCreatedException If abstract factory is not callable */ protected function createFromAbstractFactory($canonicalName, $requestedName) { foreach ($this->abstractFactories as $index => $abstractFactory) { // support factories as strings if (is_string($abstractFactory) && class_exists($abstractFactory, true)) { $this->abstractFactories[$index] = $abstractFactory = new $abstractFactory; } elseif (!$abstractFactory instanceof AbstractFactoryInterface) { throw new Exception\ServiceNotCreatedException(sprintf( 'While attempting to create %s%s an abstract factory could not produce a valid instance.', $canonicalName, ($requestedName ? '(alias: ' . $requestedName . ')' : '') )); } try { $this->pendingAbstractFactoryRequests[get_class($abstractFactory)] = $requestedName; if ($abstractFactory->canCreateServiceWithName($this, $canonicalName, $requestedName)) { $instance = $this->createServiceViaCallback( array($abstractFactory, 'createServiceWithName'), $canonicalName, $requestedName ); unset($this->pendingAbstractFactoryRequests[get_class($abstractFactory)]); } else { $instance = false; } } catch (\Exception $e) { unset($this->pendingAbstractFactoryRequests[get_class($abstractFactory)]); throw new Exception\ServiceNotCreatedException( sprintf( 'An abstract factory could not create an instance of %s%s.', $canonicalName, ($requestedName ? '(alias: ' . $requestedName . ')' : '') ), $e->getCode(), $e ); } if (is_object($instance)) { break; } } return $instance; } /** * Checks if the object has this class as one of its parents * * @see https://bugs.php.net/bug.php?id=53727 * @see https://github.com/zendframework/zf2/pull/1807 * * @param string $className * @param string $type * @return bool */ protected static function isSubclassOf($className, $type) { if (is_subclass_of($className, $type)) { return true; } if (version_compare(PHP_VERSION, '5.3.7', '>=')) { return false; } if (!interface_exists($type)) { return false; } $r = new ReflectionClass($className); return $r->implementsInterface($type); } /** * Unregister a service * * Called when $allowOverride is true and we detect that a service being * added to the instance already exists. This will remove the duplicate * entry, and also any shared flags previously registered. * * @param string $canonical * @return void */ protected function unregisterService($canonical) { $types = array('invokableClasses', 'factories', 'aliases'); foreach ($types as $type) { if (isset($this->{$type}[$canonical])) { unset($this->{$type}[$canonical]); break; } } if (isset($this->instances[$canonical])) { unset($this->instances[$canonical]); } if (isset($this->shared[$canonical])) { unset($this->shared[$canonical]); } } } glpi-0.84.3+dfsg.1/lib/Zend/ServiceManager/ServiceManagerAwareInterface.php000066400000000000000000000012041226600447100263640ustar00rootroot00000000000000=5.3.3" }, "suggest": { "zendframework/zend-di": "Zend\\Di component" } }glpi-0.84.3+dfsg.1/lib/Zend/Stdlib/000077500000000000000000000000001226600447100165105ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/Zend/Stdlib/AbstractOptions.php000066400000000000000000000101011226600447100223310ustar00rootroot00000000000000setFromArray($options); } } /** * @param array|Traversable $options * @throws Exception\InvalidArgumentException * @return void */ public function setFromArray($options) { if (!is_array($options) && !$options instanceof Traversable) { throw new Exception\InvalidArgumentException(sprintf( 'Parameter provided to %s must be an array or Traversable', __METHOD__ )); } foreach ($options as $key => $value) { $this->__set($key, $value); } } /** * Cast to array * * @return array */ public function toArray() { $array = array(); $transform = function($letters) { $letter = array_shift($letters); return '_' . strtolower($letter); }; foreach ($this as $key => $value) { if ($key === '__strictMode__') continue; $normalizedKey = preg_replace_callback('/([A-Z])/', $transform, $key); $array[$normalizedKey] = $value; } return $array; } /** * @see ParameterObject::__set() * @param string $key * @param mixed $value * @throws Exception\BadMethodCallException * @return void */ public function __set($key, $value) { $setter = 'set' . str_replace(' ', '', ucwords(str_replace('_', ' ', $key))); if ($this->__strictMode__ && !method_exists($this, $setter)) { throw new Exception\BadMethodCallException( 'The option "' . $key . '" does not ' . 'have a matching ' . $setter . ' setter method ' . 'which must be defined' ); } elseif (!$this->__strictMode__ && !method_exists($this, $setter)) { return; } $this->{$setter}($value); } /** * @see ParameterObject::__get() * @param string $key * @throws Exception\BadMethodCallException * @return mixed */ public function __get($key) { $getter = 'get' . str_replace(' ', '', ucwords(str_replace('_', ' ', $key))); if (!method_exists($this, $getter)) { throw new Exception\BadMethodCallException( 'The option "' . $key . '" does not ' . 'have a matching ' . $getter . ' getter method ' . 'which must be defined' ); } return $this->{$getter}(); } /** * @see ParameterObject::__isset() * @param string $key * @return boolean */ public function __isset($key) { return null !== $this->__get($key); } /** * @see ParameterObject::__unset() * @param string $key * @return void * @throws Exception\InvalidArgumentException */ public function __unset($key) { try { $this->__set($key, null); } catch (\InvalidArgumentException $e) { throw new Exception\InvalidArgumentException( 'The class property $' . $key . ' cannot be unset as' . ' NULL is an invalid value for it', 0, $e ); } } } glpi-0.84.3+dfsg.1/lib/Zend/Stdlib/ArraySerializableInterface.php000066400000000000000000000013711226600447100244510ustar00rootroot00000000000000getArrayCopy(); return new ArrayIterator(array_reverse($array)); } } glpi-0.84.3+dfsg.1/lib/Zend/Stdlib/ArrayUtils.php000066400000000000000000000151141226600447100213220ustar00rootroot00000000000000 0; } /** * Test whether an array contains one or more integer keys * * @param mixed $value * @param bool $allowEmpty Should an empty array() return true * @return bool */ public static function hasIntegerKeys($value, $allowEmpty = false) { if (!is_array($value)) { return false; } if (!$value) { return $allowEmpty; } return count(array_filter(array_keys($value), 'is_int')) > 0; } /** * Test whether an array contains one or more numeric keys. * * A numeric key can be one of the following: * - an integer 1, * - a string with a number '20' * - a string with negative number: '-1000' * - a float: 2.2120, -78.150999 * - a string with float: '4000.99999', '-10.10' * * @param mixed $value * @param bool $allowEmpty Should an empty array() return true * @return bool */ public static function hasNumericKeys($value, $allowEmpty = false) { if (!is_array($value)) { return false; } if (!$value) { return $allowEmpty; } return count(array_filter(array_keys($value), 'is_numeric')) > 0; } /** * Test whether an array is a list * * A list is a collection of values assigned to continuous integer keys * starting at 0 and ending at count() - 1. * * For example: * * $list = array( 'a','b','c','d' ); * $list = array( * 0 => 'foo', * 1 => 'bar', * 2 => array( 'foo' => 'baz' ), * ); * * * @param mixed $value * @param bool $allowEmpty Is an empty list a valid list? * @return bool */ public static function isList($value, $allowEmpty = false) { if (!is_array($value)) { return false; } if (!$value) { return $allowEmpty; } return (array_values($value) === $value); } /** * Test whether an array is a hash table. * * An array is a hash table if: * * 1. Contains one or more non-integer keys, or * 2. Integer keys are non-continuous or misaligned (not starting with 0) * * For example: * * $hash = array( * 'foo' => 15, * 'bar' => false, * ); * $hash = array( * 1995 => 'Birth of PHP', * 2009 => 'PHP 5.3.0', * 2012 => 'PHP 5.4.0', * ); * $hash = array( * 'formElement, * 'options' => array( 'debug' => true ), * ); * * * @param mixed $value * @param bool $allowEmpty Is an empty array() a valid hash table? * @return bool */ public static function isHashTable($value, $allowEmpty = false) { if (!is_array($value)) { return false; } if (!$value) { return $allowEmpty; } return (array_values($value) !== $value); } /** * Convert an iterator to an array. * * Converts an iterator to an array. The $recursive flag, on by default, * hints whether or not you want to do so recursively. * * @param array|Traversable $iterator The array or Traversable object to convert * @param bool $recursive Recursively check all nested structures * @throws Exception\InvalidArgumentException if $iterator is not an array or a Traversable object * @return array */ public static function iteratorToArray($iterator, $recursive = true) { if (!is_array($iterator) && !$iterator instanceof Traversable) { throw new Exception\InvalidArgumentException(__METHOD__ . ' expects an array or Traversable object'); } if (!$recursive) { if (is_array($iterator)) { return $iterator; } return iterator_to_array($iterator); } if (method_exists($iterator, 'toArray')) { return $iterator->toArray(); } $array = array(); foreach ($iterator as $key => $value) { if (is_scalar($value)) { $array[$key] = $value; continue; } if ($value instanceof Traversable) { $array[$key] = static::iteratorToArray($value, $recursive); continue; } if (is_array($value)) { $array[$key] = static::iteratorToArray($value, $recursive); continue; } $array[$key] = $value; } return $array; } /** * Merge two arrays together. * * If an integer key exists in both arrays, the value from the second array * will be appended the the first array. If both values are arrays, they * are merged together, else the value of the second array overwrites the * one of the first array. * * @param array $a * @param array $b * @return array */ public static function merge(array $a, array $b) { foreach ($b as $key => $value) { if (array_key_exists($key, $a)) { if (is_int($key)) { $a[] = $value; } elseif (is_array($value) && is_array($a[$key])) { $a[$key] = static::merge($a[$key], $value); } else { $a[$key] = $value; } } else { $a[$key] = $value; } } return $a; } } glpi-0.84.3+dfsg.1/lib/Zend/Stdlib/CallbackHandler.php000066400000000000000000000207771226600447100222300ustar00rootroot00000000000000metadata = $metadata; $this->registerCallback($callback); } /** * Registers the callback provided in the constructor * * If you have pecl/weakref {@see http://pecl.php.net/weakref} installed, * this method provides additional behavior. * * If a callback is a functor, or an array callback composing an object * instance, this method will pass the object to a WeakRef instance prior * to registering the callback. * * @param callable $callback * @throws Exception\InvalidCallbackException * @return void */ protected function registerCallback($callback) { if (!is_callable($callback)) { throw new Exception\InvalidCallbackException('Invalid callback provided; not callable'); } if (null === static::$hasWeakRefExtension) { static::$hasWeakRefExtension = class_exists('WeakRef'); } // If pecl/weakref is not installed, simply store the callback and return if (!static::$hasWeakRefExtension) { $this->callback = $callback; return; } // If WeakRef exists, we want to use it. // If we have a non-closure object, pass it to WeakRef, and then // register it. if (is_object($callback) && !$callback instanceof Closure) { $this->callback = new WeakRef($callback); return; } // If we have a string or closure, register as-is if (!is_array($callback)) { $this->callback = $callback; return; } list($target, $method) = $callback; // If we have an array callback, and the first argument is not an // object, register as-is if (!is_object($target)) { $this->callback = $callback; return; } // We have an array callback with an object as the first argument; // pass it to WeakRef, and then register the new callback $target = new WeakRef($target); $this->callback = array($target, $method); } /** * Retrieve registered callback * * @return callable */ public function getCallback() { $callback = $this->callback; // String callbacks -- simply return if (is_string($callback)) { return $callback; } // WeakRef callbacks -- pull it out of the object and return it if ($callback instanceof WeakRef) { return $callback->get(); } // Non-WeakRef object callback -- return it if (is_object($callback)) { return $callback; } // Array callback with WeakRef object -- retrieve the object first, and // then return list($target, $method) = $callback; if ($target instanceof WeakRef) { return array($target->get(), $method); } // Otherwise, return it return $callback; } /** * Invoke handler * * @param array $args Arguments to pass to callback * @return mixed */ public function call(array $args = array()) { $callback = $this->getCallback(); // WeakRef object will return null if the real object was disposed if (null === $callback) { return null; } // Minor performance tweak, if the callback gets called more than once if (!isset(static::$isPhp54)) { static::$isPhp54 = version_compare(PHP_VERSION, '5.4.0rc1', '>='); } $argCount = count($args); if (static::$isPhp54 && is_string($callback)) { $result = $this->validateStringCallbackFor54($callback); if ($result !== true && $argCount <= 3) { $callback = $result; // Minor performance tweak, if the callback gets called more // than once $this->callback = $result; } } // Minor performance tweak; use call_user_func() until > 3 arguments // reached switch ($argCount) { case 0: if (static::$isPhp54) { return $callback(); } return call_user_func($callback); case 1: if (static::$isPhp54) { return $callback(array_shift($args)); } return call_user_func($callback, array_shift($args)); case 2: $arg1 = array_shift($args); $arg2 = array_shift($args); if (static::$isPhp54) { return $callback($arg1, $arg2); } return call_user_func($callback, $arg1, $arg2); case 3: $arg1 = array_shift($args); $arg2 = array_shift($args); $arg3 = array_shift($args); if (static::$isPhp54) { return $callback($arg1, $arg2, $arg3); } return call_user_func($callback, $arg1, $arg2, $arg3); default: return call_user_func_array($callback, $args); } } /** * Invoke as functor * * @return mixed */ public function __invoke() { return $this->call(func_get_args()); } /** * Get all callback metadata * * @return array */ public function getMetadata() { return $this->metadata; } /** * Retrieve a single metadatum * * @param string $name * @return mixed */ public function getMetadatum($name) { if (array_key_exists($name, $this->metadata)) { return $this->metadata[$name]; } return null; } /** * Validate a static method call * * Validates that a static method call in PHP 5.4 will actually work * * @param string $callback * @return true|array * @throws Exception\InvalidCallbackException if invalid */ protected function validateStringCallbackFor54($callback) { if (!strstr($callback, '::')) { return true; } list($class, $method) = explode('::', $callback, 2); if (!class_exists($class)) { throw new Exception\InvalidCallbackException(sprintf( 'Static method call "%s" refers to a class that does not exist', $callback )); } $r = new ReflectionClass($class); if (!$r->hasMethod($method)) { throw new Exception\InvalidCallbackException(sprintf( 'Static method call "%s" refers to a method that does not exist', $callback )); } $m = $r->getMethod($method); if (!$m->isStatic()) { throw new Exception\InvalidCallbackException(sprintf( 'Static method call "%s" refers to a method that is not static', $callback )); } // returning a non boolean value may not be nice for a validate method, // but that allows the usage of a static string callback without using // the call_user_func function. return array($class, $method); } } glpi-0.84.3+dfsg.1/lib/Zend/Stdlib/DispatchableInterface.php000066400000000000000000000013771226600447100234350ustar00rootroot00000000000000 GLOB_MARK, self::GLOB_NOSORT => GLOB_NOSORT, self::GLOB_NOCHECK => GLOB_NOCHECK, self::GLOB_NOESCAPE => GLOB_NOESCAPE, self::GLOB_BRACE => GLOB_BRACE, self::GLOB_ONLYDIR => GLOB_ONLYDIR, self::GLOB_ERR => GLOB_ERR, ); $globFlags = 0; foreach ($flagMap as $internalFlag => $globFlag) { if ($flags & $internalFlag) { $globFlags |= $globFlag; } } } else { $globFlags = 0; } return glob($pattern, $globFlags); } /** * Expand braces manually, then use the system glob. * * @param string $pattern * @param integer $flags * @return array|false */ protected static function fallbackGlob($pattern, $flags) { if (!$flags & self::GLOB_BRACE) { return static::systemGlob($pattern, $flags); } $flags &= ~self::GLOB_BRACE; $length = strlen($pattern); $paths = array(); if ($flags & self::GLOB_NOESCAPE) { $begin = strpos($pattern, '{'); } else { $begin = 0; while (true) { if ($begin === $length) { $begin = false; break; } elseif ($pattern[$begin] === '\\' && ($begin + 1) < $length) { $begin++; } elseif ($pattern[$begin] === '{') { break; } $begin++; } } if ($begin === false) { return static::systemGlob($pattern, $flags); } $next = static::nextBraceSub($pattern, $begin + 1, $flags); if ($next === null) { return static::systemGlob($pattern, $flags); } $rest = $next; while ($pattern[$rest] !== '}') { $rest = static::nextBraceSub($pattern, $rest + 1, $flags); if ($rest === null) { return static::systemGlob($pattern, $flags); } } $p = $begin + 1; while (true) { $subPattern = substr($pattern, 0, $begin) . substr($pattern, $p, $next - $p) . substr($pattern, $rest + 1); $result = static::fallbackGlob($subPattern, $flags | self::GLOB_BRACE); if ($result) { $paths = array_merge($paths, $result); } if ($pattern[$next] === '}') { break; } $p = $next + 1; $next = static::nextBraceSub($pattern, $p, $flags); } return array_unique($paths); } /** * Find the end of the sub-pattern in a brace expression. * * @param string $pattern * @param integer $begin * @param integer $flags * @return integer|null */ protected static function nextBraceSub($pattern, $begin, $flags) { $length = strlen($pattern); $depth = 0; $current = $begin; while ($current < $length) { if (!$flags & self::GLOB_NOESCAPE && $pattern[$current] === '\\') { if (++$current === $length) { break; } $current++; } else { if (($pattern[$current] === '}' && $depth-- === 0) || ($pattern[$current] === ',' && $depth === 0)) { break; } elseif ($pattern[$current++] === '{') { $depth++; } } } return ($current < $length ? $current : null); } } glpi-0.84.3+dfsg.1/lib/Zend/Stdlib/Hydrator/000077500000000000000000000000001226600447100203045ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/Zend/Stdlib/Hydrator/AbstractHydrator.php000066400000000000000000000061111226600447100242740ustar00rootroot00000000000000strategies = new ArrayObject(); } /** * Gets the strategy with the given name. * * @param string $name The name of the strategy to get. * @return StrategyInterface */ public function getStrategy($name) { return $this->strategies[$name]; } /** * Checks if the strategy with the given name exists. * * @param string $name The name of the strategy to check for. * @return bool */ public function hasStrategy($name) { return array_key_exists($name, $this->strategies); } /** * Adds the given strategy under the given name. * * @param string $name The name of the strategy to register. * @param StrategyInterface $strategy The strategy to register. * @return HydratorInterface */ public function addStrategy($name, StrategyInterface $strategy) { $this->strategies[$name] = $strategy; return $this; } /** * Removes the strategy with the given name. * * @param string $name The name of the strategy to remove. * @return HydratorInterface */ public function removeStrategy($name) { unset($this->strategies[$name]); return $this; } /** * Converts a value for extraction. If no strategy exists the plain value is returned. * * @param string $name The name of the strategy to use. * @param mixed $value The value that should be converted. * @return mixed */ public function extractValue($name, $value) { if ($this->hasStrategy($name)) { $strategy = $this->getStrategy($name); $value = $strategy->extract($value); } return $value; } /** * Converts a value for hydration. If no strategy exists the plain value is returned. * * @param string $name The name of the strategy to use. * @param mixed $value The value that should be converted. * @return mixed */ public function hydrateValue($name, $value) { if ($this->hasStrategy($name)) { $strategy = $this->getStrategy($name); $value = $strategy->hydrate($value); } return $value; } } glpi-0.84.3+dfsg.1/lib/Zend/Stdlib/Hydrator/ArraySerializable.php000066400000000000000000000044311226600447100244240ustar00rootroot00000000000000getArrayCopy(); array_walk($data, function(&$value, $name) use ($self) { $value = $self->extractValue($name, $value); }); return $data; } /** * Hydrate an object * * Hydrates an object by passing $data to either its exchangeArray() or * populate() method. * * @param array $data * @param object $object * @return object * @throws Exception\BadMethodCallException for an $object not implementing exchangeArray() or populate() */ public function hydrate(array $data, $object) { $self = $this; array_walk($data, function(&$value, $name) use ($self) { $value = $self->hydrateValue($name, $value); }); if (is_callable(array($object, 'exchangeArray'))) { $object->exchangeArray($data); } elseif (is_callable(array($object, 'populate'))) { $object->populate($data); } else { throw new Exception\BadMethodCallException(sprintf( '%s expects the provided object to implement exchangeArray() or populate()', __METHOD__ )); } return $object; } } glpi-0.84.3+dfsg.1/lib/Zend/Stdlib/Hydrator/ClassMethods.php000066400000000000000000000067601226600447100234170ustar00rootroot00000000000000underscoreSeparatedKeys = $underscoreSeparatedKeys; } /** * Extract values from an object with class methods * * Extracts the getter/setter of the given $object. * * @param object $object * @return array * @throws Exception\BadMethodCallException for a non-object $object */ public function extract($object) { if (!is_object($object)) { throw new Exception\BadMethodCallException(sprintf( '%s expects the provided $object to be a PHP object)', __METHOD__ )); } $transform = function($letters) { $letter = array_shift($letters); return '_' . strtolower($letter); }; $attributes = array(); $methods = get_class_methods($object); foreach ($methods as $method) { if (!preg_match('/^(get|has|is)[A-Z]\w*/', $method)) { continue; } $attribute = $method; if (preg_match('/^get/', $method)) { $attribute = substr($method, 3); $attribute = lcfirst($attribute); } if ($this->underscoreSeparatedKeys) { $attribute = preg_replace_callback('/([A-Z])/', $transform, $attribute); } $attributes[$attribute] = $this->extractValue($attribute, $object->$method()); } return $attributes; } /** * Hydrate an object by populating getter/setter methods * * Hydrates an object by getter/setter methods of the object. * * @param array $data * @param object $object * @return object * @throws Exception\BadMethodCallException for a non-object $object */ public function hydrate(array $data, $object) { if (!is_object($object)) { throw new Exception\BadMethodCallException(sprintf( '%s expects the provided $object to be a PHP object)', __METHOD__ )); } $transform = function($letters) { $letter = substr(array_shift($letters), 1, 1); return ucfirst($letter); }; foreach ($data as $property => $value) { $method = 'set' . ucfirst($property); if ($this->underscoreSeparatedKeys) { $method = preg_replace_callback('/(_[a-z])/', $transform, $method); } if (method_exists($object, $method)) { $value = $this->hydrateValue($property, $value); $object->$method($value); } } return $object; } } glpi-0.84.3+dfsg.1/lib/Zend/Stdlib/Hydrator/HydratorInterface.php000066400000000000000000000014771226600447100244430ustar00rootroot00000000000000extractValue($name, $value); }); return $data; } /** * Hydrate an object by populating public properties * * Hydrates an object by setting public properties of the object. * * @param array $data * @param object $object * @return object * @throws Exception\BadMethodCallException for a non-object $object */ public function hydrate(array $data, $object) { if (!is_object($object)) { throw new Exception\BadMethodCallException(sprintf( '%s expects the provided $object to be a PHP object)', __METHOD__ )); } foreach ($data as $property => $value) { $object->$property = $this->hydrateValue($property, $value); } return $object; } } glpi-0.84.3+dfsg.1/lib/Zend/Stdlib/Hydrator/Reflection.php000066400000000000000000000051221226600447100231070ustar00rootroot00000000000000getName(); $value = $property->getValue($object); $result[$propertyName] = $this->extractValue($propertyName, $value); } return $result; } /** * Hydrate $object with the provided $data. * * @param array $data * @param object $object * @return object */ public function hydrate(array $data, $object) { $reflProperties = self::getReflProperties($object); foreach ($data as $key => $value) { if (isset($reflProperties[$key])) { $reflProperties[$key]->setValue($object, $this->hydrateValue($key, $value)); } } return $object; } /** * Get a reflection properties from in-memory cache and lazy-load if * class has not been loaded. * * @static * @param string|object $input * @throws Exception\InvalidArgumentException * @return array */ protected static function getReflProperties($input) { if (is_object($input)) { $input = get_class($input); } elseif (!is_string($input)) { throw new Exception\InvalidArgumentException('Input must be a string or an object.'); } if (!isset(static::$reflProperties[$input])) { $reflClass = new ReflectionClass($input); $reflProperties = $reflClass->getProperties(); foreach ($reflProperties as $property) { $property->setAccessible(true); static::$reflProperties[$input][$property->getName()] = $property; } } return static::$reflProperties[$input]; } } glpi-0.84.3+dfsg.1/lib/Zend/Stdlib/Hydrator/Strategy/000077500000000000000000000000001226600447100221065ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/Zend/Stdlib/Hydrator/Strategy/DefaultStrategy.php000066400000000000000000000020651226600447100257310ustar00rootroot00000000000000metadata[$spec] = $value; return $this; } if (!is_array($spec) && !$spec instanceof Traversable) { throw new Exception\InvalidArgumentException(sprintf( 'Expected a string, array, or Traversable argument in first position; received "%s"', (is_object($spec) ? get_class($spec) : gettype($spec)) )); } foreach ($spec as $key => $value) { $this->metadata[$key] = $value; } return $this; } /** * Retrieve all metadata or a single metadatum as specified by key * * @param null|string|int $key * @param null|mixed $default * @throws Exception\InvalidArgumentException * @return mixed */ public function getMetadata($key = null, $default = null) { if (null === $key) { return $this->metadata; } if (!is_scalar($key)) { throw new Exception\InvalidArgumentException('Non-scalar argument provided for key'); } if (array_key_exists($key, $this->metadata)) { return $this->metadata[$key]; } return $default; } /** * Set message content * * @param mixed $value * @return Message */ public function setContent($value) { $this->content = $value; return $this; } /** * Get message content * * @return mixed */ public function getContent() { return $this->content; } /** * @return string */ public function toString() { $request = ''; foreach ($this->getMetadata() as $key => $value) { $request .= sprintf( "%s: %s\r\n", (string) $key, (string) $value ); } $request .= "\r\n" . $this->getContent(); return $request; } } glpi-0.84.3+dfsg.1/lib/Zend/Stdlib/MessageInterface.php000066400000000000000000000017551226600447100224360ustar00rootroot00000000000000exchangeArray($values); } /** * Populate from query string * * @param string $string * @return void */ public function fromString($string) { $array = array(); parse_str($string, $array); $this->fromArray($array); } /** * Serialize to native PHP array * * @return array */ public function toArray() { return $this->getArrayCopy(); } /** * Serialize to query string * * @return string */ public function toString() { return http_build_query($this); } /** * Retrieve by key * * Returns null if the key does not exist. * * @param string $name * @return mixed */ public function offsetGet($name) { if (isset($this[$name])) { return parent::offsetGet($name); } return null; } /** * @param string $name * @param mixed $default optional default value * @return mixed */ public function get($name, $default = null) { if (isset($this[$name])) { return parent::offsetGet($name); } return $default; } /** * @param string $name * @param mixed $value * @return Parameters */ public function set($name, $value) { $this[$name] = $value; return $this; } } glpi-0.84.3+dfsg.1/lib/Zend/Stdlib/ParametersInterface.php000066400000000000000000000036101226600447100231450ustar00rootroot00000000000000items[] = array( 'data' => $data, 'priority' => $priority, ); $this->getQueue()->insert($data, $priority); return $this; } /** * Remove an item from the queue * * This is different than {@link extract()}; its purpose is to dequeue an * item. * * This operation is potentially expensive, as it requires * re-initialization and re-population of the inner queue. * * Note: this removes the first item matching the provided item found. If * the same item has been added multiple times, it will not remove other * instances. * * @param mixed $datum * @return boolean False if the item was not found, true otherwise. */ public function remove($datum) { $found = false; foreach ($this->items as $key => $item) { if ($item['data'] === $datum) { $found = true; break; } } if ($found) { unset($this->items[$key]); $this->queue = null; $queue = $this->getQueue(); foreach ($this->items as $item) { $queue->insert($item['data'], $item['priority']); } return true; } return false; } /** * Is the queue empty? * * @return bool */ public function isEmpty() { return (0 === $this->count()); } /** * How many items are in the queue? * * @return int */ public function count() { return count($this->items); } /** * Peek at the top node in the queue, based on priority. * * @return mixed */ public function top() { return $this->getIterator()->top(); } /** * Extract a node from the inner queue and sift up * * @return mixed */ public function extract() { return $this->getQueue()->extract(); } /** * Retrieve the inner iterator * * SplPriorityQueue acts as a heap, which typically implies that as items * are iterated, they are also removed. This does not work for situations * where the queue may be iterated multiple times. As such, this class * aggregates the values, and also injects an SplPriorityQueue. This method * retrieves the inner queue object, and clones it for purposes of * iteration. * * @return SplPriorityQueue */ public function getIterator() { $queue = $this->getQueue(); return clone $queue; } /** * Serialize the data structure * * @return string */ public function serialize() { return serialize($this->items); } /** * Unserialize a string into a PriorityQueue object * * Serialization format is compatible with {@link Zend\Stdlib\SplPriorityQueue} * * @param string $data * @return void */ public function unserialize($data) { foreach (unserialize($data) as $item) { $this->insert($item['data'], $item['priority']); } } /** * Serialize to an array * * By default, returns only the item data, and in the order registered (not * sorted). You may provide one of the EXTR_* flags as an argument, allowing * the ability to return priorities or both data and priority. * * @param int $flag * @return array */ public function toArray($flag = self::EXTR_DATA) { switch ($flag) { case self::EXTR_BOTH: return $this->items; break; case self::EXTR_PRIORITY: return array_map(function($item) { return $item['priority']; }, $this->items); case self::EXTR_DATA: default: return array_map(function($item) { return $item['data']; }, $this->items); } } /** * Specify the internal queue class * * Please see {@link getIterator()} for details on the necessity of an * internal queue class. The class provided should extend SplPriorityQueue. * * @param string $class * @return PriorityQueue */ public function setInternalQueueClass($class) { $this->queueClass = (string) $class; return $this; } /** * Does the queue contain the given datum? * * @param mixed $datum * @return bool */ public function contains($datum) { foreach ($this->items as $item) { if ($item['data'] === $datum) { return true; } } return false; } /** * Does the queue have an item with the given priority? * * @param int $priority * @return bool */ public function hasPriority($priority) { foreach ($this->items as $item) { if ($item['priority'] === $priority) { return true; } } return false; } /** * Get the inner priority queue instance * * @throws \DomainException * @return SplPriorityQueue */ protected function getQueue() { if (null === $this->queue) { $this->queue = new $this->queueClass(); if (!$this->queue instanceof \SplPriorityQueue) { throw new \DomainException(sprintf( 'PriorityQueue expects an internal queue of type SplPriorityQueue; received "%s"', get_class($this->queue) )); } } return $this->queue; } /** * Add support for deep cloning * * @return void */ public function __clone() { if (null !== $this->queue) { $this->queue = clone $this->queue; } } } glpi-0.84.3+dfsg.1/lib/Zend/Stdlib/Request.php000066400000000000000000000010031226600447100206430ustar00rootroot00000000000000serial--); } parent::insert($datum, $priority); } /** * Serialize to an array * * Array will be priority => data pairs * * @return array */ public function toArray() { $array = array(); foreach (clone $this as $item) { $array[] = $item; } return $array; } /** * Serialize * * @return string */ public function serialize() { $clone = clone $this; $clone->setExtractFlags(self::EXTR_BOTH); $data = array(); foreach ($clone as $item) { $data[] = $item; } return serialize($data); } /** * Deserialize * * @param string $data * @return void */ public function unserialize($data) { foreach (unserialize($data) as $item) { $this->insert($item['data'], $item['priority']); } } } glpi-0.84.3+dfsg.1/lib/Zend/Stdlib/SplQueue.php000066400000000000000000000022251226600447100207650ustar00rootroot00000000000000toArray()); } /** * Unserialize * * @param string $data * @return void */ public function unserialize($data) { foreach (unserialize($data) as $item) { $this->push($item); } } } glpi-0.84.3+dfsg.1/lib/Zend/Stdlib/SplStack.php000066400000000000000000000022361226600447100207500ustar00rootroot00000000000000toArray()); } /** * Unserialize * * @param string $data * @return void */ public function unserialize($data) { foreach (unserialize($data) as $item) { $this->unshift($item); } } } glpi-0.84.3+dfsg.1/lib/Zend/Stdlib/composer.json000066400000000000000000000006651226600447100212410ustar00rootroot00000000000000{ "name": "zendframework/zend-stdlib", "description": " ", "license": "BSD-3-Clause", "keywords": [ "zf2", "stdlib" ], "autoload": { "psr-0": { "Zend\\Stdlib\\": "" } }, "target-dir": "Zend/Stdlib", "suggest": { "pecl-weakref": "Implementation of weak references for Stdlib\\CallbackHandler" }, "require": { "php": ">=5.3.3" } } glpi-0.84.3+dfsg.1/lib/Zend/Version/000077500000000000000000000000001226600447100167145ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/Zend/Version/Version.php000066400000000000000000000101761226600447100210570ustar00rootroot00000000000000') ? $a : $b; }); } elseif($service == self::VERSION_SERVICE_ZEND) { $handle = fopen('http://framework.zend.com/api/zf-version?v=2', 'r'); if (false !== $handle) { static::$latestVersion = stream_get_contents($handle); fclose($handle); } } } return static::$latestVersion; } /** * Returns true if the running version of Zend Framework is * the latest (or newer??) than the latest tag on GitHub, * which is returned by static::getLatest(). * * @return boolean */ public static function isLatest() { return static::compareVersion(static::getLatest()) < 1; } } glpi-0.84.3+dfsg.1/lib/Zend/Version/composer.json000066400000000000000000000005101226600447100214320ustar00rootroot00000000000000{ "name": "zendframework/zend-version", "description": " ", "license": "BSD-3-Clause", "keywords": [ "zf2", "version" ], "autoload": { "psr-0": { "Zend\\Version\\": "" } }, "target-dir": "Zend/Version", "require": { "php": ">=5.3.3" } }glpi-0.84.3+dfsg.1/lib/Zend/autoload_classmap.php000066400000000000000000000572711226600447100215070ustar00rootroot00000000000000 __DIR__ . '/I18n/View/Helper/AbstractTranslatorHelper.php', 'Zend\I18n\View\Helper\DateFormat' => __DIR__ . '/I18n/View/Helper/DateFormat.php', 'Zend\I18n\View\Helper\CurrencyFormat' => __DIR__ . '/I18n/View/Helper/CurrencyFormat.php', 'Zend\I18n\View\Helper\Translate' => __DIR__ . '/I18n/View/Helper/Translate.php', 'Zend\I18n\View\Helper\NumberFormat' => __DIR__ . '/I18n/View/Helper/NumberFormat.php', 'Zend\I18n\View\Helper\TranslatePlural' => __DIR__ . '/I18n/View/Helper/TranslatePlural.php', 'Zend\I18n\View\HelperConfig' => __DIR__ . '/I18n/View/HelperConfig.php', 'Zend\I18n\Validator\Float' => __DIR__ . '/I18n/Validator/Float.php', 'Zend\I18n\Validator\Alpha' => __DIR__ . '/I18n/Validator/Alpha.php', 'Zend\I18n\Validator\Int' => __DIR__ . '/I18n/Validator/Int.php', 'Zend\I18n\Validator\Alnum' => __DIR__ . '/I18n/Validator/Alnum.php', 'Zend\I18n\Validator\PostCode' => __DIR__ . '/I18n/Validator/PostCode.php', 'Zend\I18n\Filter\Alpha' => __DIR__ . '/I18n/Filter/Alpha.php', 'Zend\I18n\Filter\AbstractLocale' => __DIR__ . '/I18n/Filter/AbstractLocale.php', 'Zend\I18n\Filter\NumberFormat' => __DIR__ . '/I18n/Filter/NumberFormat.php', 'Zend\I18n\Filter\Alnum' => __DIR__ . '/I18n/Filter/Alnum.php', 'Zend\I18n\Translator\TextDomain' => __DIR__ . '/I18n/Translator/TextDomain.php', 'Zend\I18n\Translator\Loader\RemoteLoaderInterface' => __DIR__ . '/I18n/Translator/Loader/RemoteLoaderInterface.php', 'Zend\I18n\Translator\Loader\PhpArray' => __DIR__ . '/I18n/Translator/Loader/PhpArray.php', 'Zend\I18n\Translator\Loader\FileLoaderInterface' => __DIR__ . '/I18n/Translator/Loader/FileLoaderInterface.php', 'Zend\I18n\Translator\Loader\Gettext' => __DIR__ . '/I18n/Translator/Loader/Gettext.php', 'Zend\I18n\Translator\Translator' => __DIR__ . '/I18n/Translator/Translator.php', 'Zend\I18n\Translator\TranslatorServiceFactory' => __DIR__ . '/I18n/Translator/TranslatorServiceFactory.php', 'Zend\I18n\Translator\LoaderPluginManager' => __DIR__ . '/I18n/Translator/LoaderPluginManager.php', 'Zend\I18n\Translator\Plural\Rule' => __DIR__ . '/I18n/Translator/Plural/Rule.php', 'Zend\I18n\Translator\Plural\Parser' => __DIR__ . '/I18n/Translator/Plural/Parser.php', 'Zend\I18n\Translator\Plural\Symbol' => __DIR__ . '/I18n/Translator/Plural/Symbol.php', 'Zend\I18n\Translator\TranslatorAwareInterface' => __DIR__ . '/I18n/Translator/TranslatorAwareInterface.php', 'Zend\I18n\Exception\RangeException' => __DIR__ . '/I18n/Exception/RangeException.php', 'Zend\I18n\Exception\RuntimeException' => __DIR__ . '/I18n/Exception/RuntimeException.php', 'Zend\I18n\Exception\OutOfBoundsException' => __DIR__ . '/I18n/Exception/OutOfBoundsException.php', 'Zend\I18n\Exception\ExceptionInterface' => __DIR__ . '/I18n/Exception/ExceptionInterface.php', 'Zend\I18n\Exception\InvalidArgumentException' => __DIR__ . '/I18n/Exception/InvalidArgumentException.php', 'Zend\I18n\Exception\ParseException' => __DIR__ . '/I18n/Exception/ParseException.php', 'Zend\EventManager\EventManager' => __DIR__ . '/EventManager/EventManager.php', 'Zend\EventManager\StaticEventManager' => __DIR__ . '/EventManager/StaticEventManager.php', 'Zend\EventManager\EventsCapableInterface' => __DIR__ . '/EventManager/EventsCapableInterface.php', 'Zend\EventManager\SharedEventManager' => __DIR__ . '/EventManager/SharedEventManager.php', 'Zend\EventManager\EventManagerInterface' => __DIR__ . '/EventManager/EventManagerInterface.php', 'Zend\EventManager\GlobalEventManager' => __DIR__ . '/EventManager/GlobalEventManager.php', 'Zend\EventManager\Filter\FilterInterface' => __DIR__ . '/EventManager/Filter/FilterInterface.php', 'Zend\EventManager\Filter\FilterIterator' => __DIR__ . '/EventManager/Filter/FilterIterator.php', 'Zend\EventManager\EventManagerAwareInterface' => __DIR__ . '/EventManager/EventManagerAwareInterface.php', 'Zend\EventManager\FilterChain' => __DIR__ . '/EventManager/FilterChain.php', 'Zend\EventManager\SharedEventManagerInterface' => __DIR__ . '/EventManager/SharedEventManagerInterface.php', 'Zend\EventManager\ListenerAggregateInterface' => __DIR__ . '/EventManager/ListenerAggregateInterface.php', 'Zend\EventManager\EventInterface' => __DIR__ . '/EventManager/EventInterface.php', 'Zend\EventManager\Event' => __DIR__ . '/EventManager/Event.php', 'Zend\EventManager\SharedEventManagerAwareInterface' => __DIR__ . '/EventManager/SharedEventManagerAwareInterface.php', 'Zend\EventManager\Exception\InvalidCallbackException' => __DIR__ . '/EventManager/Exception/InvalidCallbackException.php', 'Zend\EventManager\Exception\DomainException' => __DIR__ . '/EventManager/Exception/DomainException.php', 'Zend\EventManager\Exception\ExceptionInterface' => __DIR__ . '/EventManager/Exception/ExceptionInterface.php', 'Zend\EventManager\Exception\InvalidArgumentException' => __DIR__ . '/EventManager/Exception/InvalidArgumentException.php', 'Zend\EventManager\ResponseCollection' => __DIR__ . '/EventManager/ResponseCollection.php', 'Zend\Version\Version' => __DIR__ . '/Version/Version.php', 'Zend\Loader\ModuleAutoloader' => __DIR__ . '/Loader/ModuleAutoloader.php', 'Zend\Loader\PluginClassLocator' => __DIR__ . '/Loader/PluginClassLocator.php', 'Zend\Loader\PluginClassLoader' => __DIR__ . '/Loader/PluginClassLoader.php', 'Zend\Loader\ShortNameLocator' => __DIR__ . '/Loader/ShortNameLocator.php', 'Zend\Loader\SplAutoloader' => __DIR__ . '/Loader/SplAutoloader.php', 'Zend\Loader\AutoloaderFactory' => __DIR__ . '/Loader/AutoloaderFactory.php', 'Zend\Loader\StandardAutoloader' => __DIR__ . '/Loader/StandardAutoloader.php', 'Zend\Loader\Exception\InvalidPathException' => __DIR__ . '/Loader/Exception/InvalidPathException.php', 'Zend\Loader\Exception\BadMethodCallException' => __DIR__ . '/Loader/Exception/BadMethodCallException.php', 'Zend\Loader\Exception\SecurityException' => __DIR__ . '/Loader/Exception/SecurityException.php', 'Zend\Loader\Exception\DomainException' => __DIR__ . '/Loader/Exception/DomainException.php', 'Zend\Loader\Exception\RuntimeException' => __DIR__ . '/Loader/Exception/RuntimeException.php', 'Zend\Loader\Exception\ExceptionInterface' => __DIR__ . '/Loader/Exception/ExceptionInterface.php', 'Zend\Loader\Exception\InvalidArgumentException' => __DIR__ . '/Loader/Exception/InvalidArgumentException.php', 'Zend\Loader\Exception\PluginLoaderException' => __DIR__ . '/Loader/Exception/PluginLoaderException.php', 'Zend\Loader\Exception\MissingResourceNamespaceException' => __DIR__ . '/Loader/Exception/MissingResourceNamespaceException.php', 'Zend\Loader\ClassMapAutoloader' => __DIR__ . '/Loader/ClassMapAutoloader.php', 'Zend\Stdlib\AbstractOptions' => __DIR__ . '/Stdlib/AbstractOptions.php', 'Zend\Stdlib\Response' => __DIR__ . '/Stdlib/Response.php', 'Zend\Stdlib\ResponseInterface' => __DIR__ . '/Stdlib/ResponseInterface.php', 'Zend\Stdlib\MessageInterface' => __DIR__ . '/Stdlib/MessageInterface.php', 'Zend\Stdlib\ArrayUtils' => __DIR__ . '/Stdlib/ArrayUtils.php', 'Zend\Stdlib\CallbackHandler' => __DIR__ . '/Stdlib/CallbackHandler.php', 'Zend\Stdlib\Glob' => __DIR__ . '/Stdlib/Glob.php', 'Zend\Stdlib\Hydrator\ClassMethods' => __DIR__ . '/Stdlib/Hydrator/ClassMethods.php', 'Zend\Stdlib\Hydrator\Strategy\StrategyInterface' => __DIR__ . '/Stdlib/Hydrator/Strategy/StrategyInterface.php', 'Zend\Stdlib\Hydrator\Strategy\DefaultStrategy' => __DIR__ . '/Stdlib/Hydrator/Strategy/DefaultStrategy.php', 'Zend\Stdlib\Hydrator\HydratorInterface' => __DIR__ . '/Stdlib/Hydrator/HydratorInterface.php', 'Zend\Stdlib\Hydrator\ArraySerializable' => __DIR__ . '/Stdlib/Hydrator/ArraySerializable.php', 'Zend\Stdlib\Hydrator\Reflection' => __DIR__ . '/Stdlib/Hydrator/Reflection.php', 'Zend\Stdlib\Hydrator\AbstractHydrator' => __DIR__ . '/Stdlib/Hydrator/AbstractHydrator.php', 'Zend\Stdlib\Hydrator\ObjectProperty' => __DIR__ . '/Stdlib/Hydrator/ObjectProperty.php', 'Zend\Stdlib\Hydrator\StrategyEnabledInterface' => __DIR__ . '/Stdlib/Hydrator/StrategyEnabledInterface.php', 'Zend\Stdlib\RequestInterface' => __DIR__ . '/Stdlib/RequestInterface.php', 'Zend\Stdlib\DispatchableInterface' => __DIR__ . '/Stdlib/DispatchableInterface.php', 'Zend\Stdlib\Request' => __DIR__ . '/Stdlib/Request.php', 'Zend\Stdlib\ArrayStack' => __DIR__ . '/Stdlib/ArrayStack.php', 'Zend\Stdlib\ErrorHandler' => __DIR__ . '/Stdlib/ErrorHandler.php', 'Zend\Stdlib\ParameterObjectInterface' => __DIR__ . '/Stdlib/ParameterObjectInterface.php', 'Zend\Stdlib\Parameters' => __DIR__ . '/Stdlib/Parameters.php', 'Zend\Stdlib\SplQueue' => __DIR__ . '/Stdlib/SplQueue.php', 'Zend\Stdlib\Message' => __DIR__ . '/Stdlib/Message.php', 'Zend\Stdlib\PriorityQueue' => __DIR__ . '/Stdlib/PriorityQueue.php', 'Zend\Stdlib\ParametersInterface' => __DIR__ . '/Stdlib/ParametersInterface.php', 'Zend\Stdlib\SplStack' => __DIR__ . '/Stdlib/SplStack.php', 'Zend\Stdlib\Exception\InvalidCallbackException' => __DIR__ . '/Stdlib/Exception/InvalidCallbackException.php', 'Zend\Stdlib\Exception\BadMethodCallException' => __DIR__ . '/Stdlib/Exception/BadMethodCallException.php', 'Zend\Stdlib\Exception\DomainException' => __DIR__ . '/Stdlib/Exception/DomainException.php', 'Zend\Stdlib\Exception\LogicException' => __DIR__ . '/Stdlib/Exception/LogicException.php', 'Zend\Stdlib\Exception\ExceptionInterface' => __DIR__ . '/Stdlib/Exception/ExceptionInterface.php', 'Zend\Stdlib\Exception\InvalidArgumentException' => __DIR__ . '/Stdlib/Exception/InvalidArgumentException.php', 'Zend\Stdlib\SplPriorityQueue' => __DIR__ . '/Stdlib/SplPriorityQueue.php', 'Zend\Stdlib\ArraySerializableInterface' => __DIR__ . '/Stdlib/ArraySerializableInterface.php', 'Zend\Cache\Storage\ExceptionEvent' => __DIR__ . '/Cache/Storage/ExceptionEvent.php', 'Zend\Cache\Storage\Capabilities' => __DIR__ . '/Cache/Storage/Capabilities.php', 'Zend\Cache\Storage\Plugin\ExceptionHandler' => __DIR__ . '/Cache/Storage/Plugin/ExceptionHandler.php', 'Zend\Cache\Storage\Plugin\AbstractPlugin' => __DIR__ . '/Cache/Storage/Plugin/AbstractPlugin.php', 'Zend\Cache\Storage\Plugin\ClearExpiredByFactor' => __DIR__ . '/Cache/Storage/Plugin/ClearExpiredByFactor.php', 'Zend\Cache\Storage\Plugin\OptimizeByFactor' => __DIR__ . '/Cache/Storage/Plugin/OptimizeByFactor.php', 'Zend\Cache\Storage\Plugin\PluginInterface' => __DIR__ . '/Cache/Storage/Plugin/PluginInterface.php', 'Zend\Cache\Storage\Plugin\PluginOptions' => __DIR__ . '/Cache/Storage/Plugin/PluginOptions.php', 'Zend\Cache\Storage\Plugin\Serializer' => __DIR__ . '/Cache/Storage/Plugin/Serializer.php', 'Zend\Cache\Storage\Plugin\IgnoreUserAbort' => __DIR__ . '/Cache/Storage/Plugin/IgnoreUserAbort.php', 'Zend\Cache\Storage\ClearExpiredInterface' => __DIR__ . '/Cache/Storage/ClearExpiredInterface.php', 'Zend\Cache\Storage\AvailableSpaceCapableInterface' => __DIR__ . '/Cache/Storage/AvailableSpaceCapableInterface.php', 'Zend\Cache\Storage\FlushableInterface' => __DIR__ . '/Cache/Storage/FlushableInterface.php', 'Zend\Cache\Storage\IteratorInterface' => __DIR__ . '/Cache/Storage/IteratorInterface.php', 'Zend\Cache\Storage\AdapterPluginManager' => __DIR__ . '/Cache/Storage/AdapterPluginManager.php', 'Zend\Cache\Storage\StorageInterface' => __DIR__ . '/Cache/Storage/StorageInterface.php', 'Zend\Cache\Storage\Adapter\AdapterOptions' => __DIR__ . '/Cache/Storage/Adapter/AdapterOptions.php', 'Zend\Cache\Storage\Adapter\Memcached' => __DIR__ . '/Cache/Storage/Adapter/Memcached.php', 'Zend\Cache\Storage\Adapter\ApcIterator' => __DIR__ . '/Cache/Storage/Adapter/ApcIterator.php', 'Zend\Cache\Storage\Adapter\FilesystemOptions' => __DIR__ . '/Cache/Storage/Adapter/FilesystemOptions.php', 'Zend\Cache\Storage\Adapter\DbaOptions' => __DIR__ . '/Cache/Storage/Adapter/DbaOptions.php', 'Zend\Cache\Storage\Adapter\Memory' => __DIR__ . '/Cache/Storage/Adapter/Memory.php', 'Zend\Cache\Storage\Adapter\AbstractAdapter' => __DIR__ . '/Cache/Storage/Adapter/AbstractAdapter.php', 'Zend\Cache\Storage\Adapter\KeyListIterator' => __DIR__ . '/Cache/Storage/Adapter/KeyListIterator.php', 'Zend\Cache\Storage\Adapter\AbstractZendServer' => __DIR__ . '/Cache/Storage/Adapter/AbstractZendServer.php', 'Zend\Cache\Storage\Adapter\MemoryOptions' => __DIR__ . '/Cache/Storage/Adapter/MemoryOptions.php', 'Zend\Cache\Storage\Adapter\ZendServerShm' => __DIR__ . '/Cache/Storage/Adapter/ZendServerShm.php', 'Zend\Cache\Storage\Adapter\ApcOptions' => __DIR__ . '/Cache/Storage/Adapter/ApcOptions.php', 'Zend\Cache\Storage\Adapter\FilesystemIterator' => __DIR__ . '/Cache/Storage/Adapter/FilesystemIterator.php', 'Zend\Cache\Storage\Adapter\ZendServerDisk' => __DIR__ . '/Cache/Storage/Adapter/ZendServerDisk.php', 'Zend\Cache\Storage\Adapter\WinCacheOptions' => __DIR__ . '/Cache/Storage/Adapter/WinCacheOptions.php', 'Zend\Cache\Storage\Adapter\Apc' => __DIR__ . '/Cache/Storage/Adapter/Apc.php', 'Zend\Cache\Storage\Adapter\MemcachedOptions' => __DIR__ . '/Cache/Storage/Adapter/MemcachedOptions.php', 'Zend\Cache\Storage\Adapter\DbaIterator' => __DIR__ . '/Cache/Storage/Adapter/DbaIterator.php', 'Zend\Cache\Storage\Adapter\WinCache' => __DIR__ . '/Cache/Storage/Adapter/WinCache.php', 'Zend\Cache\Storage\Adapter\Dba' => __DIR__ . '/Cache/Storage/Adapter/Dba.php', 'Zend\Cache\Storage\Adapter\Filesystem' => __DIR__ . '/Cache/Storage/Adapter/Filesystem.php', 'Zend\Cache\Storage\PluginManager' => __DIR__ . '/Cache/Storage/PluginManager.php', 'Zend\Cache\Storage\ClearByNamespaceInterface' => __DIR__ . '/Cache/Storage/ClearByNamespaceInterface.php', 'Zend\Cache\Storage\OptimizableInterface' => __DIR__ . '/Cache/Storage/OptimizableInterface.php', 'Zend\Cache\Storage\TotalSpaceCapableInterface' => __DIR__ . '/Cache/Storage/TotalSpaceCapableInterface.php', 'Zend\Cache\Storage\Event' => __DIR__ . '/Cache/Storage/Event.php', 'Zend\Cache\Storage\ClearByPrefixInterface' => __DIR__ . '/Cache/Storage/ClearByPrefixInterface.php', 'Zend\Cache\Storage\IterableInterface' => __DIR__ . '/Cache/Storage/IterableInterface.php', 'Zend\Cache\Storage\PostEvent' => __DIR__ . '/Cache/Storage/PostEvent.php', 'Zend\Cache\Storage\TaggableInterface' => __DIR__ . '/Cache/Storage/TaggableInterface.php', 'Zend\Cache\Pattern\ClassCache' => __DIR__ . '/Cache/Pattern/ClassCache.php', 'Zend\Cache\Pattern\CaptureCache' => __DIR__ . '/Cache/Pattern/CaptureCache.php', 'Zend\Cache\Pattern\CallbackCache' => __DIR__ . '/Cache/Pattern/CallbackCache.php', 'Zend\Cache\Pattern\OutputCache' => __DIR__ . '/Cache/Pattern/OutputCache.php', 'Zend\Cache\Pattern\PatternInterface' => __DIR__ . '/Cache/Pattern/PatternInterface.php', 'Zend\Cache\Pattern\PatternOptions' => __DIR__ . '/Cache/Pattern/PatternOptions.php', 'Zend\Cache\Pattern\AbstractPattern' => __DIR__ . '/Cache/Pattern/AbstractPattern.php', 'Zend\Cache\Pattern\ObjectCache' => __DIR__ . '/Cache/Pattern/ObjectCache.php', 'Zend\Cache\StorageFactory' => __DIR__ . '/Cache/StorageFactory.php', 'Zend\Cache\PatternFactory' => __DIR__ . '/Cache/PatternFactory.php', 'Zend\Cache\PatternPluginManager' => __DIR__ . '/Cache/PatternPluginManager.php', 'Zend\Cache\Exception\BadMethodCallException' => __DIR__ . '/Cache/Exception/BadMethodCallException.php', 'Zend\Cache\Exception\UnexpectedValueException' => __DIR__ . '/Cache/Exception/UnexpectedValueException.php', 'Zend\Cache\Exception\UnsupportedMethodCallException' => __DIR__ . '/Cache/Exception/UnsupportedMethodCallException.php', 'Zend\Cache\Exception\MissingDependencyException' => __DIR__ . '/Cache/Exception/MissingDependencyException.php', 'Zend\Cache\Exception\OutOfSpaceException' => __DIR__ . '/Cache/Exception/OutOfSpaceException.php', 'Zend\Cache\Exception\RuntimeException' => __DIR__ . '/Cache/Exception/RuntimeException.php', 'Zend\Cache\Exception\LogicException' => __DIR__ . '/Cache/Exception/LogicException.php', 'Zend\Cache\Exception\ExceptionInterface' => __DIR__ . '/Cache/Exception/ExceptionInterface.php', 'Zend\Cache\Exception\InvalidArgumentException' => __DIR__ . '/Cache/Exception/InvalidArgumentException.php', 'Zend\Cache\Exception\MissingKeyException' => __DIR__ . '/Cache/Exception/MissingKeyException.php', 'Zend\Cache\Exception\ExtensionNotLoadedException' => __DIR__ . '/Cache/Exception/ExtensionNotLoadedException.php', 'Zend\ServiceManager\ConfigInterface' => __DIR__ . '/ServiceManager/ConfigInterface.php', 'Zend\ServiceManager\ServiceLocatorAwareInterface' => __DIR__ . '/ServiceManager/ServiceLocatorAwareInterface.php', 'Zend\ServiceManager\AbstractFactoryInterface' => __DIR__ . '/ServiceManager/AbstractFactoryInterface.php', 'Zend\ServiceManager\ServiceManager' => __DIR__ . '/ServiceManager/ServiceManager.php', 'Zend\ServiceManager\FactoryInterface' => __DIR__ . '/ServiceManager/FactoryInterface.php', 'Zend\ServiceManager\Config' => __DIR__ . '/ServiceManager/Config.php', 'Zend\ServiceManager\ServiceManagerAwareInterface' => __DIR__ . '/ServiceManager/ServiceManagerAwareInterface.php', 'Zend\ServiceManager\AbstractPluginManager' => __DIR__ . '/ServiceManager/AbstractPluginManager.php', 'Zend\ServiceManager\Di\DiInstanceManagerProxy' => __DIR__ . '/ServiceManager/Di/DiInstanceManagerProxy.php', 'Zend\ServiceManager\Di\DiAbstractServiceFactory' => __DIR__ . '/ServiceManager/Di/DiAbstractServiceFactory.php', 'Zend\ServiceManager\Di\DiServiceInitializer' => __DIR__ . '/ServiceManager/Di/DiServiceInitializer.php', 'Zend\ServiceManager\Di\DiServiceFactory' => __DIR__ . '/ServiceManager/Di/DiServiceFactory.php', 'Zend\ServiceManager\Exception\CircularDependencyFoundException' => __DIR__ . '/ServiceManager/Exception/CircularDependencyFoundException.php', 'Zend\ServiceManager\Exception\ServiceNotFoundException' => __DIR__ . '/ServiceManager/Exception/ServiceNotFoundException.php', 'Zend\ServiceManager\Exception\InvalidServiceNameException' => __DIR__ . '/ServiceManager/Exception/InvalidServiceNameException.php', 'Zend\ServiceManager\Exception\RuntimeException' => __DIR__ . '/ServiceManager/Exception/RuntimeException.php', 'Zend\ServiceManager\Exception\ExceptionInterface' => __DIR__ . '/ServiceManager/Exception/ExceptionInterface.php', 'Zend\ServiceManager\Exception\InvalidArgumentException' => __DIR__ . '/ServiceManager/Exception/InvalidArgumentException.php', 'Zend\ServiceManager\Exception\ServiceNotCreatedException' => __DIR__ . '/ServiceManager/Exception/ServiceNotCreatedException.php', 'Zend\ServiceManager\ServiceLocatorInterface' => __DIR__ . '/ServiceManager/ServiceLocatorInterface.php', 'Zend\ServiceManager\InitializerInterface' => __DIR__ . '/ServiceManager/InitializerInterface.php', );glpi-0.84.3+dfsg.1/lib/Zend/classmap_generator.php000077500000000000000000000170621226600447100216620ustar00rootroot00000000000000#!/usr/bin/env php ] Library to parse; if none provided, assumes * current directory * --output|-o [ ] Where to write autoload file; if not provided, * assumes "autoload_classmap.php" in library directory * --append|-a Append to autoload file if it exists * --overwrite|-w Whether or not to overwrite existing autoload * file */ $zfLibraryPath = getenv('LIB_PATH') ? getenv('LIB_PATH') : __DIR__ . '/../library'; if (is_dir($zfLibraryPath)) { // Try to load StandardAutoloader from library if (false === include($zfLibraryPath . '/Zend/Loader/StandardAutoloader.php')) { echo 'Unable to locate autoloader via library; aborting' . PHP_EOL; exit(2); } } else { // Try to load StandardAutoloader from include_path if (false === include('Zend/Loader/StandardAutoloader.php')) { echo 'Unable to locate autoloader via include_path; aborting' . PHP_EOL; exit(2); } } $libraryPath = getcwd(); // Setup autoloading $loader = new StandardAutoloader(array('autoregister_zf' => true)); $loader->register(); $rules = array( 'help|h' => 'Get usage message', 'library|l-s' => 'Library to parse; if none provided, assumes current directory', 'output|o-s' => 'Where to write autoload file; if not provided, assumes "autoload_classmap.php" in library directory', 'append|a' => 'Append to autoload file if it exists', 'overwrite|w' => 'Whether or not to overwrite existing autoload file', ); try { $opts = new Console\Getopt($rules); $opts->parse(); } catch (Console\Exception\RuntimeException $e) { echo $e->getUsageMessage(); exit(2); } if ($opts->getOption('h')) { echo $opts->getUsageMessage(); exit(0); } $relativePathForClassmap = ''; if (isset($opts->l)) { if (!is_dir($opts->l)) { echo 'Invalid library directory provided' . PHP_EOL . PHP_EOL; echo $opts->getUsageMessage(); exit(2); } $libraryPath = $opts->l; } $libraryPath = str_replace(DIRECTORY_SEPARATOR, '/', realpath($libraryPath)); $usingStdout = false; $appending = $opts->getOption('a'); $output = $libraryPath . '/autoload_classmap.php'; if (isset($opts->o)) { $output = $opts->o; if ('-' == $output) { $output = STDOUT; $usingStdout = true; } elseif (is_dir($output)) { echo 'Invalid output file provided' . PHP_EOL . PHP_EOL; echo $opts->getUsageMessage(); exit(2); } elseif (!is_writeable(dirname($output))) { echo "Cannot write to '$output'; aborting." . PHP_EOL . PHP_EOL . $opts->getUsageMessage(); exit(2); } elseif (file_exists($output) && !$opts->getOption('w') && !$appending) { echo "Autoload file already exists at '$output'," . PHP_EOL . "but 'overwrite' or 'appending' flag was not specified; aborting." . PHP_EOL . PHP_EOL . $opts->getUsageMessage(); exit(2); } else { // We need to add the $libraryPath into the relative path that is created in the classmap file. $classmapPath = str_replace(DIRECTORY_SEPARATOR, '/', realpath(dirname($output))); // Simple case: $libraryPathCompare is in $classmapPathCompare if (strpos($libraryPath, $classmapPath) === 0) { $relativePathForClassmap = substr($libraryPath, strlen($classmapPath) + 1) . '/'; } else { $libraryPathParts = explode('/', $libraryPath); $classmapPathParts = explode('/', $classmapPath); // Find the common part $count = count($classmapPathParts); for ($i = 0; $i < $count; $i++) { if (!isset($libraryPathParts[$i]) || $libraryPathParts[$i] != $classmapPathParts[$i]) { // Common part end break; } } // Add parent dirs for the subdirs of classmap $relativePathForClassmap = str_repeat('../', $count - $i); // Add library subdirs $count = count($libraryPathParts); for (; $i < $count; $i++) { $relativePathForClassmap .= $libraryPathParts[$i] . '/'; } } } } if (!$usingStdout) { if ($appending) { echo "Appending to class file map '$output' for library in '$libraryPath'..." . PHP_EOL; } else { echo "Creating class file map for library in '$libraryPath'..." . PHP_EOL; } } // Get the ClassFileLocator, and pass it the library path $l = new ClassFileLocator($libraryPath); // Iterate over each element in the path, and create a map of // classname => filename, where the filename is relative to the library path $map = new stdClass; foreach ($l as $file) { $filename = str_replace($libraryPath . '/', '', str_replace(DIRECTORY_SEPARATOR, '/', $file->getPath()) . '/' . $file->getFilename()); // Add in relative path to library $filename = $relativePathForClassmap . $filename; foreach ($file->getClasses() as $class) { $map->{$class} = $filename; } } if ($appending) { $content = var_export((array) $map, true) . ';'; // Prefix with __DIR__; modify the generated content $content = preg_replace("#(=> ')#", "=> __DIR__ . '/", $content); // Fix \' strings from injected DIRECTORY_SEPARATOR usage in iterator_apply op $content = str_replace("\\'", "'", $content); // Convert to an array and remove the first "array(" $content = explode(PHP_EOL, $content); array_shift($content); // Load existing class map file and remove the closing "bracket ");" from it $existing = file($output, FILE_IGNORE_NEW_LINES); array_pop($existing); // Merge $content = implode(PHP_EOL, array_merge($existing, $content)); } else { // Create a file with the class/file map. // Stupid syntax highlighters make separating < from PHP declaration necessary $content = '<' . "?php\n" . "// Generated by ZF2's ./bin/classmap_generator.php\n" . 'return ' . var_export((array) $map, true) . ';'; // Prefix with __DIR__; modify the generated content $content = preg_replace("#(=> ')#", "=> __DIR__ . '/", $content); // Fix \' strings from injected DIRECTORY_SEPARATOR usage in iterator_apply op $content = str_replace("\\'", "'", $content); } // Remove unnecessary double-backslashes $content = str_replace('\\\\', '\\', $content); // Exchange "array (" width "array(" $content = str_replace('array (', 'array(', $content); // Align "=>" operators to match coding standard preg_match_all('(\n\s+([^=]+)=>)', $content, $matches, PREG_SET_ORDER); $maxWidth = 0; foreach ($matches as $match) { $maxWidth = max($maxWidth, strlen($match[1])); } $content = preg_replace('(\n\s+([^=]+)=>)e', "'\n \\1' . str_repeat(' ', " . $maxWidth . " - strlen('\\1')) . '=>'", $content); // Write the contents to disk file_put_contents($output, $content); if (!$usingStdout) { echo "Wrote classmap file to '" . realpath($output) . "'" . PHP_EOL; } glpi-0.84.3+dfsg.1/lib/cache_lite/000077500000000000000000000000001226600447100164475ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/cache_lite/LICENSE000066400000000000000000000574751226600447100174760ustar00rootroot00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS glpi-0.84.3+dfsg.1/lib/cache_lite/Lite.php000066400000000000000000000635251226600447100200700ustar00rootroot00000000000000 * * Nota : A chinese documentation (thanks to RainX ) is * available at : * http://rainx.phpmore.com/manual/cache_lite.html * * @package Cache_Lite * @category Caching * @version $Id: Lite.php,v 1.54 2009/07/07 05:34:37 tacker Exp $ * @author Fabien MARTY */ define('CACHE_LITE_ERROR_RETURN', 1); define('CACHE_LITE_ERROR_DIE', 8); class Cache_Lite { // --- Private properties --- /** * Directory where to put the cache files * (make sure to add a trailing slash) * * @var string $_cacheDir */ var $_cacheDir = '/tmp/'; /** * Enable / disable caching * * (can be very usefull for the debug of cached scripts) * * @var boolean $_caching */ var $_caching = true; /** * Cache lifetime (in seconds) * * If null, the cache is valid forever. * * @var int $_lifeTime */ var $_lifeTime = 3600; /** * Enable / disable fileLocking * * (can avoid cache corruption under bad circumstances) * * @var boolean $_fileLocking */ var $_fileLocking = true; /** * Timestamp of the last valid cache * * @var int $_refreshTime */ var $_refreshTime; /** * File name (with path) * * @var string $_file */ var $_file; /** * File name (without path) * * @var string $_fileName */ var $_fileName; /** * Enable / disable write control (the cache is read just after writing to detect corrupt entries) * * Enable write control will lightly slow the cache writing but not the cache reading * Write control can detect some corrupt cache files but maybe it's not a perfect control * * @var boolean $_writeControl */ var $_writeControl = true; /** * Enable / disable read control * * If enabled, a control key is embeded in cache file and this key is compared with the one * calculated after the reading. * * @var boolean $_writeControl */ var $_readControl = true; /** * Type of read control (only if read control is enabled) * * Available values are : * 'md5' for a md5 hash control (best but slowest) * 'crc32' for a crc32 hash control (lightly less safe but faster, better choice) * 'strlen' for a length only test (fastest) * * @var boolean $_readControlType */ var $_readControlType = 'crc32'; /** * Pear error mode (when raiseError is called) * * (see PEAR doc) * * @see setToDebug() * @var int $_pearErrorMode */ var $_pearErrorMode = CACHE_LITE_ERROR_RETURN; /** * Current cache id * * @var string $_id */ var $_id; /** * Current cache group * * @var string $_group */ var $_group; /** * Enable / Disable "Memory Caching" * * NB : There is no lifetime for memory caching ! * * @var boolean $_memoryCaching */ var $_memoryCaching = false; /** * Enable / Disable "Only Memory Caching" * (be carefull, memory caching is "beta quality") * * @var boolean $_onlyMemoryCaching */ var $_onlyMemoryCaching = false; /** * Memory caching array * * @var array $_memoryCachingArray */ var $_memoryCachingArray = array(); /** * Memory caching counter * * @var int $memoryCachingCounter */ var $_memoryCachingCounter = 0; /** * Memory caching limit * * @var int $memoryCachingLimit */ var $_memoryCachingLimit = 1000; /** * File Name protection * * if set to true, you can use any cache id or group name * if set to false, it can be faster but cache ids and group names * will be used directly in cache file names so be carefull with * special characters... * * @var boolean $fileNameProtection */ var $_fileNameProtection = true; /** * Enable / disable automatic serialization * * it can be used to save directly datas which aren't strings * (but it's slower) * * @var boolean $_serialize */ var $_automaticSerialization = false; /** * Disable / Tune the automatic cleaning process * * The automatic cleaning process destroy too old (for the given life time) * cache files when a new cache file is written. * 0 => no automatic cache cleaning * 1 => systematic cache cleaning * x (integer) > 1 => automatic cleaning randomly 1 times on x cache write * * @var int $_automaticCleaning */ var $_automaticCleaningFactor = 0; /** * Nested directory level * * Set the hashed directory structure level. 0 means "no hashed directory * structure", 1 means "one level of directory", 2 means "two levels"... * This option can speed up Cache_Lite only when you have many thousands of * cache file. Only specific benchs can help you to choose the perfect value * for you. Maybe, 1 or 2 is a good start. * * @var int $_hashedDirectoryLevel */ var $_hashedDirectoryLevel = 0; /** * Umask for hashed directory structure * * @var int $_hashedDirectoryUmask */ var $_hashedDirectoryUmask = 0700; /** * API break for error handling in CACHE_LITE_ERROR_RETURN mode * * In CACHE_LITE_ERROR_RETURN mode, error handling was not good because * for example save() method always returned a boolean (a PEAR_Error object * would be better in CACHE_LITE_ERROR_RETURN mode). To correct this without * breaking the API, this option (false by default) can change this handling. * * @var boolean */ var $_errorHandlingAPIBreak = false; // --- Public methods --- /** * Constructor * * $options is an assoc. Available options are : * $options = array( * 'cacheDir' => directory where to put the cache files (string), * 'caching' => enable / disable caching (boolean), * 'lifeTime' => cache lifetime in seconds (int), * 'fileLocking' => enable / disable fileLocking (boolean), * 'writeControl' => enable / disable write control (boolean), * 'readControl' => enable / disable read control (boolean), * 'readControlType' => type of read control 'crc32', 'md5', 'strlen' (string), * 'pearErrorMode' => pear error mode (when raiseError is called) (cf PEAR doc) (int), * 'memoryCaching' => enable / disable memory caching (boolean), * 'onlyMemoryCaching' => enable / disable only memory caching (boolean), * 'memoryCachingLimit' => max nbr of records to store into memory caching (int), * 'fileNameProtection' => enable / disable automatic file name protection (boolean), * 'automaticSerialization' => enable / disable automatic serialization (boolean), * 'automaticCleaningFactor' => distable / tune automatic cleaning process (int), * 'hashedDirectoryLevel' => level of the hashed directory system (int), * 'hashedDirectoryUmask' => umask for hashed directory structure (int), * 'errorHandlingAPIBreak' => API break for better error handling ? (boolean) * ); * * @param array $options options * @access public */ function Cache_Lite($options = array(NULL)) { foreach($options as $key => $value) { $this->setOption($key, $value); } } /** * Generic way to set a Cache_Lite option * * see Cache_Lite constructor for available options * * @var string $name name of the option * @var mixed $value value of the option * @access public */ function setOption($name, $value) { $availableOptions = array('errorHandlingAPIBreak', 'hashedDirectoryUmask', 'hashedDirectoryLevel', 'automaticCleaningFactor', 'automaticSerialization', 'fileNameProtection', 'memoryCaching', 'onlyMemoryCaching', 'memoryCachingLimit', 'cacheDir', 'caching', 'lifeTime', 'fileLocking', 'writeControl', 'readControl', 'readControlType', 'pearErrorMode'); if (in_array($name, $availableOptions)) { $property = '_'.$name; $this->$property = $value; } } /** * Test if a cache is available and (if yes) return it * * @param string $id cache id * @param string $group name of the cache group * @param boolean $doNotTestCacheValidity if set to true, the cache validity won't be tested * @return string data of the cache (else : false) * @access public */ function get($id, $group = 'default', $doNotTestCacheValidity = false) { $this->_id = $id; $this->_group = $group; $data = false; if ($this->_caching) { $this->_setRefreshTime(); $this->_setFileName($id, $group); clearstatcache(); if ($this->_memoryCaching) { if (isset($this->_memoryCachingArray[$this->_file])) { if ($this->_automaticSerialization) { return unserialize($this->_memoryCachingArray[$this->_file]); } return $this->_memoryCachingArray[$this->_file]; } if ($this->_onlyMemoryCaching) { return false; } } if (($doNotTestCacheValidity) || (is_null($this->_refreshTime))) { if (file_exists($this->_file)) { $data = $this->_read(); } } else { if ((file_exists($this->_file)) && (@filemtime($this->_file) > $this->_refreshTime)) { $data = $this->_read(); } } if (($data) and ($this->_memoryCaching)) { $this->_memoryCacheAdd($data); } if (($this->_automaticSerialization) and (is_string($data))) { $data = unserialize($data); } return $data; } return false; } /** * Save some data in a cache file * * @param string $data data to put in cache (can be another type than strings if automaticSerialization is on) * @param string $id cache id * @param string $group name of the cache group * @return boolean true if no problem (else : false or a PEAR_Error object) * @access public */ function save($data, $id = NULL, $group = 'default') { if ($this->_caching) { if ($this->_automaticSerialization) { $data = serialize($data); } if (isset($id)) { $this->_setFileName($id, $group); } if ($this->_memoryCaching) { $this->_memoryCacheAdd($data); if ($this->_onlyMemoryCaching) { return true; } } if ($this->_automaticCleaningFactor>0 && ($this->_automaticCleaningFactor==1 || mt_rand(1, $this->_automaticCleaningFactor)==1)) { $this->clean(false, 'old'); } if ($this->_writeControl) { $res = $this->_writeAndControl($data); if (is_bool($res)) { if ($res) { return true; } // if $res if false, we need to invalidate the cache @touch($this->_file, time() - 2*abs($this->_lifeTime)); return false; } } else { $res = $this->_write($data); } if (is_object($res)) { // $res is a PEAR_Error object if (!($this->_errorHandlingAPIBreak)) { return false; // we return false (old API) } } return $res; } return false; } /** * Remove a cache file * * @param string $id cache id * @param string $group name of the cache group * @param boolean $checkbeforeunlink check if file exists before removing it * @return boolean true if no problem * @access public */ function remove($id, $group = 'default', $checkbeforeunlink = false) { $this->_setFileName($id, $group); if ($this->_memoryCaching) { if (isset($this->_memoryCachingArray[$this->_file])) { unset($this->_memoryCachingArray[$this->_file]); $this->_memoryCachingCounter = $this->_memoryCachingCounter - 1; } if ($this->_onlyMemoryCaching) { return true; } } if ( $checkbeforeunlink ) { if (!file_exists($this->_file)) return true; } return $this->_unlink($this->_file); } /** * Clean the cache * * if no group is specified all cache files will be destroyed * else only cache files of the specified group will be destroyed * * @param string $group name of the cache group * @param string $mode flush cache mode : 'old', 'ingroup', 'notingroup', * 'callback_myFunction' * @return boolean true if no problem * @access public */ function clean($group = false, $mode = 'ingroup') { return $this->_cleanDir($this->_cacheDir, $group, $mode); } /** * Set to debug mode * * When an error is found, the script will stop and the message will be displayed * (in debug mode only). * * @access public */ function setToDebug() { $this->setOption('pearErrorMode', CACHE_LITE_ERROR_DIE); } /** * Set a new life time * * @param int $newLifeTime new life time (in seconds) * @access public */ function setLifeTime($newLifeTime) { $this->_lifeTime = $newLifeTime; $this->_setRefreshTime(); } /** * Save the state of the caching memory array into a cache file cache * * @param string $id cache id * @param string $group name of the cache group * @access public */ function saveMemoryCachingState($id, $group = 'default') { if ($this->_caching) { $array = array( 'counter' => $this->_memoryCachingCounter, 'array' => $this->_memoryCachingArray ); $data = serialize($array); $this->save($data, $id, $group); } } /** * Load the state of the caching memory array from a given cache file cache * * @param string $id cache id * @param string $group name of the cache group * @param boolean $doNotTestCacheValidity if set to true, the cache validity won't be tested * @access public */ function getMemoryCachingState($id, $group = 'default', $doNotTestCacheValidity = false) { if ($this->_caching) { if ($data = $this->get($id, $group, $doNotTestCacheValidity)) { $array = unserialize($data); $this->_memoryCachingCounter = $array['counter']; $this->_memoryCachingArray = $array['array']; } } } /** * Return the cache last modification time * * BE CAREFUL : THIS METHOD IS FOR HACKING ONLY ! * * @return int last modification time */ function lastModified() { return @filemtime($this->_file); } /** * Trigger a PEAR error * * To improve performances, the PEAR.php file is included dynamically. * The file is so included only when an error is triggered. So, in most * cases, the file isn't included and perfs are much better. * * @param string $msg error message * @param int $code error code * @access public */ function raiseError($msg, $code) { // include_once('PEAR.php'); // return PEAR::raiseError($msg, $code, $this->_pearErrorMode); // Modif GLPI trigger_error("Cache_Lite Error $msg", E_USER_ERROR); } /** * Extend the life of a valid cache file * * see http://pear.php.net/bugs/bug.php?id=6681 * * @access public */ function extendLife() { @touch($this->_file); } // --- Private methods --- /** * Compute & set the refresh time * * @access private */ function _setRefreshTime() { if (is_null($this->_lifeTime)) { $this->_refreshTime = null; } else { $this->_refreshTime = time() - $this->_lifeTime; } } /** * Remove a file * * @param string $file complete file path and name * @return boolean true if no problem * @access private */ function _unlink($file) { if (!@unlink($file)) { return $this->raiseError('Cache_Lite : Unable to remove cache !', -3); } return true; } /** * Recursive function for cleaning cache file in the given directory * * @param string $dir directory complete path (with a trailing slash) * @param string $group name of the cache group * @param string $mode flush cache mode : 'old', 'ingroup', 'notingroup', 'callback_myFunction' * @return boolean true if no problem * @access private */ function _cleanDir($dir, $group = false, $mode = 'ingroup') { if ($this->_fileNameProtection) { $motif = ($group) ? 'cache_'.md5($group).'_' : 'cache_'; } else { $motif = ($group) ? 'cache_'.$group.'_' : 'cache_'; } if ($this->_memoryCaching) { foreach($this->_memoryCachingArray as $key => $v) { if (strpos($key, $motif) !== false) { unset($this->_memoryCachingArray[$key]); $this->_memoryCachingCounter = $this->_memoryCachingCounter - 1; } } if ($this->_onlyMemoryCaching) { return true; } } if (!($dh = opendir($dir))) { return $this->raiseError('Cache_Lite : Unable to open cache directory !', -4); } $result = true; while ($file = readdir($dh)) { if (($file != '.') && ($file != '..')) { if (substr($file, 0, 6)=='cache_') { $file2 = $dir . $file; if (is_file($file2)) { switch (substr($mode, 0, 9)) { case 'old': // files older than lifeTime get deleted from cache if (!is_null($this->_lifeTime)) { if ((time() - @filemtime($file2)) > $this->_lifeTime) { $result = ($result and ($this->_unlink($file2))); } } break; case 'notingrou': if (strpos($file2, $motif) === false) { $result = ($result and ($this->_unlink($file2))); } break; case 'callback_': $func = substr($mode, 9, strlen($mode) - 9); if ($func($file2, $group)) { $result = ($result and ($this->_unlink($file2))); } break; case 'ingroup': default: if (strpos($file2, $motif) !== false) { $result = ($result and ($this->_unlink($file2))); } break; } } if ((is_dir($file2)) and ($this->_hashedDirectoryLevel>0)) { $result = ($result and ($this->_cleanDir($file2 . '/', $group, $mode))); } } } } return $result; } /** * Add some date in the memory caching array * * @param string $data data to cache * @access private */ function _memoryCacheAdd($data) { $this->_memoryCachingArray[$this->_file] = $data; if ($this->_memoryCachingCounter >= $this->_memoryCachingLimit) { list($key, ) = each($this->_memoryCachingArray); unset($this->_memoryCachingArray[$key]); } else { $this->_memoryCachingCounter = $this->_memoryCachingCounter + 1; } } /** * Make a file name (with path) * * @param string $id cache id * @param string $group name of the group * @access private */ function _setFileName($id, $group) { if ($this->_fileNameProtection) { $suffix = 'cache_'.md5($group).'_'.md5($id); } else { $suffix = 'cache_'.$group.'_'.$id; } $root = $this->_cacheDir; if ($this->_hashedDirectoryLevel>0) { $hash = md5($suffix); for ($i=0 ; $i<$this->_hashedDirectoryLevel ; $i++) { $root = $root . 'cache_' . substr($hash, 0, $i + 1) . '/'; } } $this->_fileName = $suffix; $this->_file = $root.$suffix; } /** * Read the cache file and return the content * * @return string content of the cache file (else : false or a PEAR_Error object) * @access private */ function _read() { $fp = @fopen($this->_file, "rb"); if ($this->_fileLocking) @flock($fp, LOCK_SH); if ($fp) { clearstatcache(); $length = @filesize($this->_file); $mqr = get_magic_quotes_runtime(); if ($mqr) { set_magic_quotes_runtime(0); } if ($this->_readControl) { $hashControl = @fread($fp, 32); $length = $length - 32; } if ($length) { $data = @fread($fp, $length); } else { $data = ''; } if ($mqr) { set_magic_quotes_runtime($mqr); } if ($this->_fileLocking) @flock($fp, LOCK_UN); @fclose($fp); if ($this->_readControl) { $hashData = $this->_hash($data, $this->_readControlType); if ($hashData != $hashControl) { if (!(is_null($this->_lifeTime))) { @touch($this->_file, time() - 2*abs($this->_lifeTime)); } else { @unlink($this->_file); } return false; } } return $data; } return $this->raiseError('Cache_Lite : Unable to read cache !', -2); } /** * Write the given data in the cache file * * @param string $data data to put in cache * @return boolean true if ok (a PEAR_Error object else) * @access private */ function _write($data) { if ($this->_hashedDirectoryLevel > 0) { $hash = md5($this->_fileName); $root = $this->_cacheDir; for ($i=0 ; $i<$this->_hashedDirectoryLevel ; $i++) { $root = $root . 'cache_' . substr($hash, 0, $i + 1) . '/'; if (!(@is_dir($root))) { @mkdir($root, $this->_hashedDirectoryUmask); } } } $fp = @fopen($this->_file, "wb"); if ($fp) { if ($this->_fileLocking) @flock($fp, LOCK_EX); if ($this->_readControl) { @fwrite($fp, $this->_hash($data, $this->_readControlType), 32); } $mqr = get_magic_quotes_runtime(); if ($mqr) { set_magic_quotes_runtime(0); } @fwrite($fp, $data); if ($mqr) { set_magic_quotes_runtime($mqr); } if ($this->_fileLocking) @flock($fp, LOCK_UN); @fclose($fp); return true; } return $this->raiseError('Cache_Lite : Unable to write cache file : '.$this->_file, -1); } /** * Write the given data in the cache file and control it just after to avoir corrupted cache entries * * @param string $data data to put in cache * @return boolean true if the test is ok (else : false or a PEAR_Error object) * @access private */ function _writeAndControl($data) { $result = $this->_write($data); if (is_object($result)) { return $result; # We return the PEAR_Error object } $dataRead = $this->_read(); if (is_object($dataRead)) { return $dataRead; # We return the PEAR_Error object } if ((is_bool($dataRead)) && (!$dataRead)) { return false; } return ($dataRead==$data); } /** * Make a control key with the string containing datas * * @param string $data data * @param string $controlType type of control 'md5', 'crc32' or 'strlen' * @return string control key * @access private */ function _hash($data, $controlType) { switch ($controlType) { case 'md5': return md5($data); case 'crc32': return sprintf('% 32d', crc32($data)); case 'strlen': return sprintf('% 32d', strlen($data)); default: return $this->raiseError('Unknown controlType ! (available values are only \'md5\', \'crc32\', \'strlen\')', -5); } } } ?> glpi-0.84.3+dfsg.1/lib/cache_lite/Lite/000077500000000000000000000000001226600447100173445ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/cache_lite/Lite/File.php000066400000000000000000000053761226600447100207470ustar00rootroot00000000000000 */ require_once(GLPI_CACHE_LITE_DIR.'/Lite.php'); class Cache_Lite_File extends Cache_Lite { // --- Private properties --- /** * Complete path of the file used for controlling the cache lifetime * * @var string $_masterFile */ var $_masterFile = ''; /** * Masterfile mtime * * @var int $_masterFile_mtime */ var $_masterFile_mtime = 0; // --- Public methods ---- /** * Constructor * * $options is an assoc. To have a look at availables options, * see the constructor of the Cache_Lite class in 'Cache_Lite.php' * * Comparing to Cache_Lite constructor, there is another option : * $options = array( * (...) see Cache_Lite constructor * 'masterFile' => complete path of the file used for controlling the cache lifetime(string) * ); * * @param array $options options * @access public */ function Cache_Lite_File($options = array(NULL)) { $options['lifetime'] = 0; $this->Cache_Lite($options); if (isset($options['masterFile'])) { $this->_masterFile = $options['masterFile']; } else { return $this->raiseError('Cache_Lite_File : masterFile option must be set !'); } if (!($this->_masterFile_mtime = @filemtime($this->_masterFile))) { return $this->raiseError('Cache_Lite_File : Unable to read masterFile : '.$this->_masterFile, -3); } } /** * Test if a cache is available and (if yes) return it * * @param string $id cache id * @param string $group name of the cache group * @param boolean $doNotTestCacheValidity if set to true, the cache validity won't be tested * @return string data of the cache (else : false) * @access public */ function get($id, $group = 'default', $doNotTestCacheValidity = false) { if ($data = parent::get($id, $group, true)) { if ($filemtime = $this->lastModified()) { if ($filemtime > $this->_masterFile_mtime) { return $data; } } } return false; } } ?> glpi-0.84.3+dfsg.1/lib/cache_lite/Lite/Function.php000066400000000000000000000160461226600447100216510ustar00rootroot00000000000000 * @author Fabien MARTY */ require_once('Cache/Lite.php'); class Cache_Lite_Function extends Cache_Lite { // --- Private properties --- /** * Default cache group for function caching * * @var string $_defaultGroup */ var $_defaultGroup = 'Cache_Lite_Function'; /** * Don't cache the method call when its output contains the string "NOCACHE" * * if set to true, the output of the method will never be displayed (because the output is used * to control the cache) * * @var boolean $_dontCacheWhenTheOutputContainsNOCACHE */ var $_dontCacheWhenTheOutputContainsNOCACHE = false; /** * Don't cache the method call when its result is false * * @var boolean $_dontCacheWhenTheResultIsFalse */ var $_dontCacheWhenTheResultIsFalse = false; /** * Don't cache the method call when its result is null * * @var boolean $_dontCacheWhenTheResultIsNull */ var $_dontCacheWhenTheResultIsNull = false; /** * Debug the Cache_Lite_Function caching process * * @var boolean $_debugCacheLiteFunction */ var $_debugCacheLiteFunction = false; // --- Public methods ---- /** * Constructor * * $options is an assoc. To have a look at availables options, * see the constructor of the Cache_Lite class in 'Cache_Lite.php' * * Comparing to Cache_Lite constructor, there is another option : * $options = array( * (...) see Cache_Lite constructor * 'debugCacheLiteFunction' => (bool) debug the caching process, * 'defaultGroup' => default cache group for function caching (string), * 'dontCacheWhenTheOutputContainsNOCACHE' => (bool) don't cache when the function output contains "NOCACHE", * 'dontCacheWhenTheResultIsFalse' => (bool) don't cache when the function result is false, * 'dontCacheWhenTheResultIsNull' => (bool don't cache when the function result is null * ); * * @param array $options options * @access public */ function Cache_Lite_Function($options = array(NULL)) { $availableOptions = array('debugCacheLiteFunction', 'defaultGroup', 'dontCacheWhenTheOutputContainsNOCACHE', 'dontCacheWhenTheResultIsFalse', 'dontCacheWhenTheResultIsNull'); while (list($name, $value) = each($options)) { if (in_array($name, $availableOptions)) { $property = '_'.$name; $this->$property = $value; } } reset($options); $this->Cache_Lite($options); } /** * Calls a cacheable function or method (or not if there is already a cache for it) * * Arguments of this method are read with func_get_args. So it doesn't appear * in the function definition. Synopsis : * call('functionName', $arg1, $arg2, ...) * (arg1, arg2... are arguments of 'functionName') * * @return mixed result of the function/method * @access public */ function call() { $arguments = func_get_args(); $id = $this->_makeId($arguments); $data = $this->get($id, $this->_defaultGroup); if ($data !== false) { if ($this->_debugCacheLiteFunction) { echo "Cache hit !\n"; } $array = unserialize($data); $output = $array['output']; $result = $array['result']; } else { if ($this->_debugCacheLiteFunction) { echo "Cache missed !\n"; } ob_start(); ob_implicit_flush(false); $target = array_shift($arguments); if (is_array($target)) { // in this case, $target is for example array($obj, 'method') $object = $target[0]; $method = $target[1]; $result = call_user_func_array(array(&$object, $method), $arguments); } else { if (strstr($target, '::')) { // classname::staticMethod list($class, $method) = explode('::', $target); $result = call_user_func_array(array($class, $method), $arguments); } else if (strstr($target, '->')) { // object->method // use a stupid name ($objet_123456789 because) of problems where the object // name is the same as this var name list($object_123456789, $method) = explode('->', $target); global $$object_123456789; $result = call_user_func_array(array($$object_123456789, $method), $arguments); } else { // function $result = call_user_func_array($target, $arguments); } } $output = ob_get_contents(); ob_end_clean(); if ($this->_dontCacheWhenTheResultIsFalse) { if ((is_bool($result)) && (!($result))) { echo($output); return $result; } } if ($this->_dontCacheWhenTheResultIsNull) { if (is_null($result)) { echo($output); return $result; } } if ($this->_dontCacheWhenTheOutputContainsNOCACHE) { if (strpos($output, 'NOCACHE') > -1) { return $result; } } $array['output'] = $output; $array['result'] = $result; $this->save(serialize($array), $id, $this->_defaultGroup); } echo($output); return $result; } /** * Drop a cache file * * Arguments of this method are read with func_get_args. So it doesn't appear * in the function definition. Synopsis : * remove('functionName', $arg1, $arg2, ...) * (arg1, arg2... are arguments of 'functionName') * * @return boolean true if no problem * @access public */ function drop() { $id = $this->_makeId(func_get_args()); return $this->remove($id, $this->_defaultGroup); } /** * Make an id for the cache * * @var array result of func_get_args for the call() or the remove() method * @return string id * @access private */ function _makeId($arguments) { $id = serialize($arguments); // Generate a cache id if (!$this->_fileNameProtection) { $id = md5($id); // if fileNameProtection is set to false, then the id has to be hashed // because it's a very bad file name in most cases } return $id; } } ?> glpi-0.84.3+dfsg.1/lib/cache_lite/Lite/Output.php000066400000000000000000000031741226600447100213620ustar00rootroot00000000000000 */ require_once(GLPI_CACHE_LITE_DIR.'/Lite.php'); class Cache_Lite_Output extends Cache_Lite { // --- Public methods --- /** * Constructor * * $options is an assoc. To have a look at availables options, * see the constructor of the Cache_Lite class in 'Cache_Lite.php' * * @param array $options options * @access public */ function Cache_Lite_Output($options) { $this->Cache_Lite($options); } /** * Start the cache * * @param string $id cache id * @param string $group name of the cache group * @param boolean $doNotTestCacheValidity if set to true, the cache validity won't be tested * @return boolean true if the cache is hit (false else) * @access public */ function start($id, $group = 'default', $doNotTestCacheValidity = false) { $data = $this->get($id, $group, $doNotTestCacheValidity); if ($data !== false) { echo($data); return true; } ob_start(); ob_implicit_flush(false); return false; } /** * Stop the cache * * @access public */ function end() { $data = ob_get_contents(); ob_end_clean(); $this->save($data, $this->_id, $this->_group); echo($data); } } ?> glpi-0.84.3+dfsg.1/lib/cache_lite/TODO000066400000000000000000000031351226600447100171410ustar00rootroot00000000000000 Patrick O'Lone suggests the following idea which sounds interesting to add as an optional mode of Cache_Lite class. (still not tested in the Cache_Lite context) ------------------------------------------------------------------------- If you use the flags: ignore_user_abort(true); $fd = dio_open($szFilename, O_CREATE | O_EXCL | O_TRUNC | O_WRONLY, 0644); if (is_resource($fd)) { dio_fcntl($fd, F_SETLKW, array('type' => F_WRLCK)); dio_write($fd, $szBuffer); dio_fcntl($fd, F_SETLK, array('type' => F_UNLCK)); dio_close($fd); } ignore_user_abort(false); Only the first process will attempt to create a file. Additional processes will see that a file already exists (at the system level), and will fail. Another thing to note is that the file descriptor must be opened using dio_open(), and certain features, like fgets() won't work with it. If your just doing a raw write, dio_write() should be just fine. The dio_read() function should be used like: $fd = dio_open($szFilename, O_RDONLY|O_NONBLOCK, 0644); if (is_resource($fd)) { dio_fcntl($fd, F_SETLKW, array('type' => F_RDLCK)); $szBuffer = dio_read($fd, filesize($szFilename)); dio_fcntl($fd, F_SETLK, array('type' => F_UNLCK)); dio_close($fd); } You still use locking to ensure that a write process can finish before another attempts to read the file. We also set non-blocking mode in read mode so that multiple readers can access the same resource at the same time. NOTE: Direct I/O support must be compiled into PHP for these features to work (--enable-dio). ------------------------------------------------------------------------- glpi-0.84.3+dfsg.1/lib/cache_lite/docs/000077500000000000000000000000001226600447100173775ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/cache_lite/docs/examples000066400000000000000000000110671226600447100211450ustar00rootroot00000000000000A few examples of Cache_Lite using : ------------------------------------ >>> Basic one : '/tmp/', 'lifeTime' => 3600 ); // Create a Cache_Lite object $Cache_Lite = new Cache_Lite($options); // Test if thereis a valide cache for this id if ($data = $Cache_Lite->get($id)) { // Cache hit ! // Content is in $data // (...) } else { // No valid cache found (you have to make the page) // Cache miss ! // Put in $data datas to put in cache // (...) $Cache_Lite->save($data); } ?> >>> Usage with blocks (You can use Cache_Lite for caching blocks and not the whole page) '/tmp/', 'lifeTime' => 3600 ); // Create a Cache_Lite object $Cache_Lite = new Cache_Lite($options); if ($data = $Cache_Lite->get('block1')) { echo($data); } else { $data = 'Data of the block 1'; $Cache_Lite->save($data); } echo('

    Non cached line !

    '); if ($data = $Cache_Lite->get('block2')) { echo($data); } else { $data = 'Data of the block 2'; $Cache_Lite->save($data); } ?> A few examples of Cache_Lite_Output using : ------------------------------------------- >>> Basic one : '/tmp/', 'lifeTime' => 10 ); $cache = new Cache_Lite_Output($options); if (!($cache->start('123'))) { // Cache missed... for($i=0;$i<1000;$i++) { // Making of the page... echo('0123456789'); } $cache->end(); } ?> >>> Usage with blocks : (You can use Cache_Lite_Output for caching blocks and not the whole page) '/tmp/', 'lifeTime' => 10 ); $cache = new Cache_Lite_Output($options); if (!($cache->start('block1'))) { // Cache missed... echo('Data of the block 1 !
    '); $cache->end(); } echo('

    Non cached line !

    '); if (!($cache->start('block2'))) { // Cache missed... echo('Data of the block 2 !
    '); $cache->end(); } A few examples of Cache_Lite_Function using : --------------------------------------------- >>> With function : '/tmp/', 'lifeTime' => 10 ); $cache = new Cache_Lite_Function($options); $cache->call('function_to_bench', 12, 45); function function_to_bench($arg1, $arg2) { echo "This is the output of the function function_to_bench($arg1, $arg2) !
    "; return "This is the result of the function function_to_bench($arg1, $arg2) !
    "; } ?> >>> With method : '/tmp/', 'lifeTime' => 10 ); $cache = new Cache_Lite_Function($options); $obj = new bench(); $obj->test = 666; $cache->call('obj->method_to_bench', 12, 45); class bench { var $test; function method_to_bench($arg1, $arg2) { echo "\$obj->test = $this->test and this is the output of the method \$obj->method_to_bench($arg1, $arg2) !
    "; return "\$obj->test = $this->test and this is the result of the method \$obj->method_to_bench($arg1, $arg2) !
    "; } } ?> >>> With static method : '/tmp/', 'lifeTime' => 10 ); $cache = new Cache_Lite_Function($options); $cache->call('bench::static_method_to_bench', 12, 45); class bench { var $test; function static_method_to_bench($arg1, $arg2) { echo "This is the output of the function static_method_to_bench($arg1, $arg2) !
    "; return "This is the result of the function static_method_to_bench($arg1, $arg2) !
    "; } } ?> >>> IMPORTANT : If you try to use Cache_Lite_Function with $this object ($cache->call('this->method',...) for example), have a look first at : http://pear.php.net/bugs/bug.php?id=660 A few examples of Cache_Lite_File using : ----------------------------------------- '/tmp/', 'masterFile' => '/home/web/config.xml' ); $cache = new Cache_Lite_File($options); // Set a id for this cache $id = '123'; if ($data = $cache->get($id)) { // Cache hit ! // Content is in $data // (...) } else { // No valid cache found (you have to make the page) // Cache miss ! // Put in $data datas to put in cache // (...) $cache->save($data); } ?> glpi-0.84.3+dfsg.1/lib/cache_lite/docs/technical000066400000000000000000000025321226600447100212560ustar00rootroot00000000000000Technical choices for Cache_Lite... ----------------------------------- To begin, the main goals of Cache_Lite : - performances - safe use (even on very high traffic or with NFS (file locking doesn't work with NFS)) - flexibility (can be used by the end user or as a part of a larger script) For speed reasons, it has been decided to focus on the file container (the faster one). So, cache is only stored in files. The class is optimized for that. If you want to use a different cache container, have a look to PEAR/Cache. For speed reasons too, the class 'Cache_Lite' has do be independant (so no 'require_once' at all in 'Cache_Lite.php'). But, a conditional include_once is allowed. For example, when an error is detected, the class include dynamicaly the PEAR base class 'PEAR.php' to be able to use PEAR::raiseError(). But, in most cases, PEAR.php isn't included. For the second goal (safe use), there is three (optional) mecanisms : - File Locking : seems to work fine (but not with distributed file system like NFS...) - WriteControl : the cache is read and compared just after being stored (efficient but not perfect) - ReadControl : a control key (crc32(), md5() ou strlen()) is embeded is the cache file and compared just after reading (the most efficient but the slowest) glpi-0.84.3+dfsg.1/lib/extjs/000077500000000000000000000000001226600447100155245ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/extjs/adapter/000077500000000000000000000000001226600447100171445ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/extjs/adapter/ext/000077500000000000000000000000001226600447100177445ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/extjs/adapter/ext/ext-base-debug.js000066400000000000000000002760341226600447100231120ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ // for old browsers window.undefined = window.undefined; /** * @class Ext * Ext core utilities and functions. * @singleton */ Ext = { /** * The version of the framework * @type String */ version : '3.4.0', versionDetail : { major : 3, minor : 4, patch : 0 } }; /** * Copies all the properties of config to obj. * @param {Object} obj The receiver of the properties * @param {Object} config The source of the properties * @param {Object} defaults A different object that will also be applied for default values * @return {Object} returns obj * @member Ext apply */ Ext.apply = function(o, c, defaults){ // no "this" reference for friendly out of scope calls if(defaults){ Ext.apply(o, defaults); } if(o && c && typeof c == 'object'){ for(var p in c){ o[p] = c[p]; } } return o; }; (function(){ var idSeed = 0, toString = Object.prototype.toString, ua = navigator.userAgent.toLowerCase(), check = function(r){ return r.test(ua); }, DOC = document, docMode = DOC.documentMode, isStrict = DOC.compatMode == "CSS1Compat", isOpera = check(/opera/), isChrome = check(/\bchrome\b/), isWebKit = check(/webkit/), isSafari = !isChrome && check(/safari/), isSafari2 = isSafari && check(/applewebkit\/4/), // unique to Safari 2 isSafari3 = isSafari && check(/version\/3/), isSafari4 = isSafari && check(/version\/4/), isIE = !isOpera && check(/msie/), isIE7 = isIE && (check(/msie 7/) || docMode == 7), isIE8 = isIE && (check(/msie 8/) && docMode != 7), isIE9 = isIE && check(/msie 9/), isIE6 = isIE && !isIE7 && !isIE8 && !isIE9, isGecko = !isWebKit && check(/gecko/), isGecko2 = isGecko && check(/rv:1\.8/), isGecko3 = isGecko && check(/rv:1\.9/), isBorderBox = isIE && !isStrict, isWindows = check(/windows|win32/), isMac = check(/macintosh|mac os x/), isAir = check(/adobeair/), isLinux = check(/linux/), isSecure = /^https/i.test(window.location.protocol); // remove css image flicker if(isIE6){ try{ DOC.execCommand("BackgroundImageCache", false, true); }catch(e){} } Ext.apply(Ext, { /** * URL to a blank file used by Ext when in secure mode for iframe src and onReady src to prevent * the IE insecure content warning ('about:blank', except for IE in secure mode, which is 'javascript:""'). * @type String */ SSL_SECURE_URL : isSecure && isIE ? 'javascript:""' : 'about:blank', /** * True if the browser is in strict (standards-compliant) mode, as opposed to quirks mode * @type Boolean */ isStrict : isStrict, /** * True if the page is running over SSL * @type Boolean */ isSecure : isSecure, /** * True when the document is fully initialized and ready for action * @type Boolean */ isReady : false, /** * True if the {@link Ext.Fx} Class is available * @type Boolean * @property enableFx */ /** * HIGHLY EXPERIMENTAL * True to force css based border-box model override and turning off javascript based adjustments. This is a * runtime configuration and must be set before onReady. * @type Boolean */ enableForcedBoxModel : false, /** * True to automatically uncache orphaned Ext.Elements periodically (defaults to true) * @type Boolean */ enableGarbageCollector : true, /** * True to automatically purge event listeners during garbageCollection (defaults to false). * @type Boolean */ enableListenerCollection : false, /** * EXPERIMENTAL - True to cascade listener removal to child elements when an element is removed. * Currently not optimized for performance. * @type Boolean */ enableNestedListenerRemoval : false, /** * Indicates whether to use native browser parsing for JSON methods. * This option is ignored if the browser does not support native JSON methods. * Note: Native JSON methods will not work with objects that have functions. * Also, property names must be quoted, otherwise the data will not parse. (Defaults to false) * @type Boolean */ USE_NATIVE_JSON : false, /** * Copies all the properties of config to obj if they don't already exist. * @param {Object} obj The receiver of the properties * @param {Object} config The source of the properties * @return {Object} returns obj */ applyIf : function(o, c){ if(o){ for(var p in c){ if(!Ext.isDefined(o[p])){ o[p] = c[p]; } } } return o; }, /** * Generates unique ids. If the element already has an id, it is unchanged * @param {Mixed} el (optional) The element to generate an id for * @param {String} prefix (optional) Id prefix (defaults "ext-gen") * @return {String} The generated Id. */ id : function(el, prefix){ el = Ext.getDom(el, true) || {}; if (!el.id) { el.id = (prefix || "ext-gen") + (++idSeed); } return el.id; }, /** *

    Extends one class to create a subclass and optionally overrides members with the passed literal. This method * also adds the function "override()" to the subclass that can be used to override members of the class.

    * For example, to create a subclass of Ext GridPanel: *
    
    MyGridPanel = Ext.extend(Ext.grid.GridPanel, {
        constructor: function(config) {
    
    //      Create configuration for this Grid.
            var store = new Ext.data.Store({...});
            var colModel = new Ext.grid.ColumnModel({...});
    
    //      Create a new config object containing our computed properties
    //      *plus* whatever was in the config parameter.
            config = Ext.apply({
                store: store,
                colModel: colModel
            }, config);
    
            MyGridPanel.superclass.constructor.call(this, config);
    
    //      Your postprocessing here
        },
    
        yourMethod: function() {
            // etc.
        }
    });
    
    * *

    This function also supports a 3-argument call in which the subclass's constructor is * passed as an argument. In this form, the parameters are as follows:

    *
      *
    • subclass : Function
      The subclass constructor.
    • *
    • superclass : Function
      The constructor of class being extended
    • *
    • overrides : Object
      A literal with members which are copied into the subclass's * prototype, and are therefore shared among all instances of the new class.
    • *
    * * @param {Function} superclass The constructor of class being extended. * @param {Object} overrides

    A literal with members which are copied into the subclass's * prototype, and are therefore shared between all instances of the new class.

    *

    This may contain a special member named constructor. This is used * to define the constructor of the new class, and is returned. If this property is * not specified, a constructor is generated and returned which just calls the * superclass's constructor passing on its parameters.

    *

    It is essential that you call the superclass constructor in any provided constructor. See example code.

    * @return {Function} The subclass constructor from the overrides parameter, or a generated one if not provided. */ extend : function(){ // inline overrides var io = function(o){ for(var m in o){ this[m] = o[m]; } }; var oc = Object.prototype.constructor; return function(sb, sp, overrides){ if(typeof sp == 'object'){ overrides = sp; sp = sb; sb = overrides.constructor != oc ? overrides.constructor : function(){sp.apply(this, arguments);}; } var F = function(){}, sbp, spp = sp.prototype; F.prototype = spp; sbp = sb.prototype = new F(); sbp.constructor=sb; sb.superclass=spp; if(spp.constructor == oc){ spp.constructor=sp; } sb.override = function(o){ Ext.override(sb, o); }; sbp.superclass = sbp.supr = (function(){ return spp; }); sbp.override = io; Ext.override(sb, overrides); sb.extend = function(o){return Ext.extend(sb, o);}; return sb; }; }(), /** * Adds a list of functions to the prototype of an existing class, overwriting any existing methods with the same name. * Usage:
    
    Ext.override(MyClass, {
        newMethod1: function(){
            // etc.
        },
        newMethod2: function(foo){
            // etc.
        }
    });
    
    * @param {Object} origclass The class to override * @param {Object} overrides The list of functions to add to origClass. This should be specified as an object literal * containing one or more methods. * @method override */ override : function(origclass, overrides){ if(overrides){ var p = origclass.prototype; Ext.apply(p, overrides); if(Ext.isIE && overrides.hasOwnProperty('toString')){ p.toString = overrides.toString; } } }, /** * Creates namespaces to be used for scoping variables and classes so that they are not global. * Specifying the last node of a namespace implicitly creates all other nodes. Usage: *
    
    Ext.namespace('Company', 'Company.data');
    Ext.namespace('Company.data'); // equivalent and preferable to above syntax
    Company.Widget = function() { ... }
    Company.data.CustomStore = function(config) { ... }
    
    * @param {String} namespace1 * @param {String} namespace2 * @param {String} etc * @return {Object} The namespace object. (If multiple arguments are passed, this will be the last namespace created) * @method namespace */ namespace : function(){ var len1 = arguments.length, i = 0, len2, j, main, ns, sub, current; for(; i < len1; ++i) { main = arguments[i]; ns = arguments[i].split('.'); current = window[ns[0]]; if (current === undefined) { current = window[ns[0]] = {}; } sub = ns.slice(1); len2 = sub.length; for(j = 0; j < len2; ++j) { current = current[sub[j]] = current[sub[j]] || {}; } } return current; }, /** * Takes an object and converts it to an encoded URL. e.g. Ext.urlEncode({foo: 1, bar: 2}); would return "foo=1&bar=2". Optionally, property values can be arrays, instead of keys and the resulting string that's returned will contain a name/value pair for each array value. * @param {Object} o * @param {String} pre (optional) A prefix to add to the url encoded string * @return {String} */ urlEncode : function(o, pre){ var empty, buf = [], e = encodeURIComponent; Ext.iterate(o, function(key, item){ empty = Ext.isEmpty(item); Ext.each(empty ? key : item, function(val){ buf.push('&', e(key), '=', (!Ext.isEmpty(val) && (val != key || !empty)) ? (Ext.isDate(val) ? Ext.encode(val).replace(/"/g, '') : e(val)) : ''); }); }); if(!pre){ buf.shift(); pre = ''; } return pre + buf.join(''); }, /** * Takes an encoded URL and and converts it to an object. Example:
    
    Ext.urlDecode("foo=1&bar=2"); // returns {foo: "1", bar: "2"}
    Ext.urlDecode("foo=1&bar=2&bar=3&bar=4", false); // returns {foo: "1", bar: ["2", "3", "4"]}
    
    * @param {String} string * @param {Boolean} overwrite (optional) Items of the same name will overwrite previous values instead of creating an an array (Defaults to false). * @return {Object} A literal with members */ urlDecode : function(string, overwrite){ if(Ext.isEmpty(string)){ return {}; } var obj = {}, pairs = string.split('&'), d = decodeURIComponent, name, value; Ext.each(pairs, function(pair) { pair = pair.split('='); name = d(pair[0]); value = d(pair[1]); obj[name] = overwrite || !obj[name] ? value : [].concat(obj[name]).concat(value); }); return obj; }, /** * Appends content to the query string of a URL, handling logic for whether to place * a question mark or ampersand. * @param {String} url The URL to append to. * @param {String} s The content to append to the URL. * @return (String) The resulting URL */ urlAppend : function(url, s){ if(!Ext.isEmpty(s)){ return url + (url.indexOf('?') === -1 ? '?' : '&') + s; } return url; }, /** * Converts any iterable (numeric indices and a length property) into a true array * Don't use this on strings. IE doesn't support "abc"[0] which this implementation depends on. * For strings, use this instead: "abc".match(/./g) => [a,b,c]; * @param {Iterable} the iterable object to be turned into a true Array. * @return (Array) array */ toArray : function(){ return isIE ? function(a, i, j, res){ res = []; for(var x = 0, len = a.length; x < len; x++) { res.push(a[x]); } return res.slice(i || 0, j || res.length); } : function(a, i, j){ return Array.prototype.slice.call(a, i || 0, j || a.length); }; }(), isIterable : function(v){ //check for array or arguments if(Ext.isArray(v) || v.callee){ return true; } //check for node list type if(/NodeList|HTMLCollection/.test(toString.call(v))){ return true; } //NodeList has an item and length property //IXMLDOMNodeList has nextNode method, needs to be checked first. return ((typeof v.nextNode != 'undefined' || v.item) && Ext.isNumber(v.length)); }, /** * Iterates an array calling the supplied function. * @param {Array/NodeList/Mixed} array The array to be iterated. If this * argument is not really an array, the supplied function is called once. * @param {Function} fn The function to be called with each item. If the * supplied function returns false, iteration stops and this method returns * the current index. This function is called with * the following arguments: *
      *
    • item : Mixed *
      The item at the current index * in the passed array
    • *
    • index : Number *
      The current index within the array
    • *
    • allItems : Array *
      The array passed as the first * argument to Ext.each.
    • *
    * @param {Object} scope The scope (this reference) in which the specified function is executed. * Defaults to the item at the current index * within the passed array. * @return See description for the fn parameter. */ each : function(array, fn, scope){ if(Ext.isEmpty(array, true)){ return; } if(!Ext.isIterable(array) || Ext.isPrimitive(array)){ array = [array]; } for(var i = 0, len = array.length; i < len; i++){ if(fn.call(scope || array[i], array[i], i, array) === false){ return i; }; } }, /** * Iterates either the elements in an array, or each of the properties in an object. * Note: If you are only iterating arrays, it is better to call {@link #each}. * @param {Object/Array} object The object or array to be iterated * @param {Function} fn The function to be called for each iteration. * The iteration will stop if the supplied function returns false, or * all array elements / object properties have been covered. The signature * varies depending on the type of object being interated: *
      *
    • Arrays : (Object item, Number index, Array allItems) *
      * When iterating an array, the supplied function is called with each item.
    • *
    • Objects : (String key, Object value, Object) *
      * When iterating an object, the supplied function is called with each key-value pair in * the object, and the iterated object
    • *
    * @param {Object} scope The scope (this reference) in which the specified function is executed. Defaults to * the object being iterated. */ iterate : function(obj, fn, scope){ if(Ext.isEmpty(obj)){ return; } if(Ext.isIterable(obj)){ Ext.each(obj, fn, scope); return; }else if(typeof obj == 'object'){ for(var prop in obj){ if(obj.hasOwnProperty(prop)){ if(fn.call(scope || obj, prop, obj[prop], obj) === false){ return; }; } } } }, /** * Return the dom node for the passed String (id), dom node, or Ext.Element. * Optional 'strict' flag is needed for IE since it can return 'name' and * 'id' elements by using getElementById. * Here are some examples: *
    
    // gets dom node based on id
    var elDom = Ext.getDom('elId');
    // gets dom node based on the dom node
    var elDom1 = Ext.getDom(elDom);
    
    // If we don't know if we are working with an
    // Ext.Element or a dom node use Ext.getDom
    function(el){
        var dom = Ext.getDom(el);
        // do something with the dom node
    }
             * 
    * Note: the dom node to be found actually needs to exist (be rendered, etc) * when this method is called to be successful. * @param {Mixed} el * @return HTMLElement */ getDom : function(el, strict){ if(!el || !DOC){ return null; } if (el.dom){ return el.dom; } else { if (typeof el == 'string') { var e = DOC.getElementById(el); // IE returns elements with the 'name' and 'id' attribute. // we do a strict check to return the element with only the id attribute if (e && isIE && strict) { if (el == e.getAttribute('id')) { return e; } else { return null; } } return e; } else { return el; } } }, /** * Returns the current document body as an {@link Ext.Element}. * @return Ext.Element The document body */ getBody : function(){ return Ext.get(DOC.body || DOC.documentElement); }, /** * Returns the current document body as an {@link Ext.Element}. * @return Ext.Element The document body */ getHead : function() { var head; return function() { if (head == undefined) { head = Ext.get(DOC.getElementsByTagName("head")[0]); } return head; }; }(), /** * Removes a DOM node from the document. */ /** *

    Removes this element from the document, removes all DOM event listeners, and deletes the cache reference. * All DOM event listeners are removed from this element. If {@link Ext#enableNestedListenerRemoval} is * true, then DOM event listeners are also removed from all child nodes. The body node * will be ignored if passed in.

    * @param {HTMLElement} node The node to remove */ removeNode : isIE && !isIE8 ? function(){ var d; return function(n){ if(n && n.tagName != 'BODY'){ (Ext.enableNestedListenerRemoval) ? Ext.EventManager.purgeElement(n, true) : Ext.EventManager.removeAll(n); d = d || DOC.createElement('div'); d.appendChild(n); d.innerHTML = ''; delete Ext.elCache[n.id]; } }; }() : function(n){ if(n && n.parentNode && n.tagName != 'BODY'){ (Ext.enableNestedListenerRemoval) ? Ext.EventManager.purgeElement(n, true) : Ext.EventManager.removeAll(n); n.parentNode.removeChild(n); delete Ext.elCache[n.id]; } }, /** *

    Returns true if the passed value is empty.

    *

    The value is deemed to be empty if it is

      *
    • null
    • *
    • undefined
    • *
    • an empty array
    • *
    • a zero length string (Unless the allowBlank parameter is true)
    • *
    * @param {Mixed} value The value to test * @param {Boolean} allowBlank (optional) true to allow empty strings (defaults to false) * @return {Boolean} */ isEmpty : function(v, allowBlank){ return v === null || v === undefined || ((Ext.isArray(v) && !v.length)) || (!allowBlank ? v === '' : false); }, /** * Returns true if the passed value is a JavaScript array, otherwise false. * @param {Mixed} value The value to test * @return {Boolean} */ isArray : function(v){ return toString.apply(v) === '[object Array]'; }, /** * Returns true if the passed object is a JavaScript date object, otherwise false. * @param {Object} object The object to test * @return {Boolean} */ isDate : function(v){ return toString.apply(v) === '[object Date]'; }, /** * Returns true if the passed value is a JavaScript Object, otherwise false. * @param {Mixed} value The value to test * @return {Boolean} */ isObject : function(v){ return !!v && Object.prototype.toString.call(v) === '[object Object]'; }, /** * Returns true if the passed value is a JavaScript 'primitive', a string, number or boolean. * @param {Mixed} value The value to test * @return {Boolean} */ isPrimitive : function(v){ return Ext.isString(v) || Ext.isNumber(v) || Ext.isBoolean(v); }, /** * Returns true if the passed value is a JavaScript Function, otherwise false. * @param {Mixed} value The value to test * @return {Boolean} */ isFunction : function(v){ return toString.apply(v) === '[object Function]'; }, /** * Returns true if the passed value is a number. Returns false for non-finite numbers. * @param {Mixed} value The value to test * @return {Boolean} */ isNumber : function(v){ return typeof v === 'number' && isFinite(v); }, /** * Returns true if the passed value is a string. * @param {Mixed} value The value to test * @return {Boolean} */ isString : function(v){ return typeof v === 'string'; }, /** * Returns true if the passed value is a boolean. * @param {Mixed} value The value to test * @return {Boolean} */ isBoolean : function(v){ return typeof v === 'boolean'; }, /** * Returns true if the passed value is an HTMLElement * @param {Mixed} value The value to test * @return {Boolean} */ isElement : function(v) { return v ? !!v.tagName : false; }, /** * Returns true if the passed value is not undefined. * @param {Mixed} value The value to test * @return {Boolean} */ isDefined : function(v){ return typeof v !== 'undefined'; }, /** * True if the detected browser is Opera. * @type Boolean */ isOpera : isOpera, /** * True if the detected browser uses WebKit. * @type Boolean */ isWebKit : isWebKit, /** * True if the detected browser is Chrome. * @type Boolean */ isChrome : isChrome, /** * True if the detected browser is Safari. * @type Boolean */ isSafari : isSafari, /** * True if the detected browser is Safari 3.x. * @type Boolean */ isSafari3 : isSafari3, /** * True if the detected browser is Safari 4.x. * @type Boolean */ isSafari4 : isSafari4, /** * True if the detected browser is Safari 2.x. * @type Boolean */ isSafari2 : isSafari2, /** * True if the detected browser is Internet Explorer. * @type Boolean */ isIE : isIE, /** * True if the detected browser is Internet Explorer 6.x. * @type Boolean */ isIE6 : isIE6, /** * True if the detected browser is Internet Explorer 7.x. * @type Boolean */ isIE7 : isIE7, /** * True if the detected browser is Internet Explorer 8.x. * @type Boolean */ isIE8 : isIE8, /** * True if the detected browser is Internet Explorer 9.x. * @type Boolean */ isIE9 : isIE9, /** * True if the detected browser uses the Gecko layout engine (e.g. Mozilla, Firefox). * @type Boolean */ isGecko : isGecko, /** * True if the detected browser uses a pre-Gecko 1.9 layout engine (e.g. Firefox 2.x). * @type Boolean */ isGecko2 : isGecko2, /** * True if the detected browser uses a Gecko 1.9+ layout engine (e.g. Firefox 3.x). * @type Boolean */ isGecko3 : isGecko3, /** * True if the detected browser is Internet Explorer running in non-strict mode. * @type Boolean */ isBorderBox : isBorderBox, /** * True if the detected platform is Linux. * @type Boolean */ isLinux : isLinux, /** * True if the detected platform is Windows. * @type Boolean */ isWindows : isWindows, /** * True if the detected platform is Mac OS. * @type Boolean */ isMac : isMac, /** * True if the detected platform is Adobe Air. * @type Boolean */ isAir : isAir }); /** * Creates namespaces to be used for scoping variables and classes so that they are not global. * Specifying the last node of a namespace implicitly creates all other nodes. Usage: *
    
    Ext.namespace('Company', 'Company.data');
    Ext.namespace('Company.data'); // equivalent and preferable to above syntax
    Company.Widget = function() { ... }
    Company.data.CustomStore = function(config) { ... }
    
    * @param {String} namespace1 * @param {String} namespace2 * @param {String} etc * @return {Object} The namespace object. (If multiple arguments are passed, this will be the last namespace created) * @method ns */ Ext.ns = Ext.namespace; })(); Ext.ns('Ext.util', 'Ext.lib', 'Ext.data', 'Ext.supports'); Ext.elCache = {}; /** * @class Function * These functions are available on every Function object (any JavaScript function). */ Ext.apply(Function.prototype, { /** * Creates an interceptor function. The passed function is called before the original one. If it returns false, * the original one is not called. The resulting function returns the results of the original function. * The passed function is called with the parameters of the original function. Example usage: *
    
    var sayHi = function(name){
        alert('Hi, ' + name);
    }
    
    sayHi('Fred'); // alerts "Hi, Fred"
    
    // create a new function that validates input without
    // directly modifying the original function:
    var sayHiToFriend = sayHi.createInterceptor(function(name){
        return name == 'Brian';
    });
    
    sayHiToFriend('Fred');  // no alert
    sayHiToFriend('Brian'); // alerts "Hi, Brian"
    
    * @param {Function} fcn The function to call before the original * @param {Object} scope (optional) The scope (this reference) in which the passed function is executed. * If omitted, defaults to the scope in which the original function is called or the browser window. * @return {Function} The new function */ createInterceptor : function(fcn, scope){ var method = this; return !Ext.isFunction(fcn) ? this : function() { var me = this, args = arguments; fcn.target = me; fcn.method = method; return (fcn.apply(scope || me || window, args) !== false) ? method.apply(me || window, args) : null; }; }, /** * Creates a callback that passes arguments[0], arguments[1], arguments[2], ... * Call directly on any function. Example: myFunction.createCallback(arg1, arg2) * Will create a function that is bound to those 2 args. If a specific scope is required in the * callback, use {@link #createDelegate} instead. The function returned by createCallback always * executes in the window scope. *

    This method is required when you want to pass arguments to a callback function. If no arguments * are needed, you can simply pass a reference to the function as a callback (e.g., callback: myFn). * However, if you tried to pass a function with arguments (e.g., callback: myFn(arg1, arg2)) the function * would simply execute immediately when the code is parsed. Example usage: *

    
    var sayHi = function(name){
        alert('Hi, ' + name);
    }
    
    // clicking the button alerts "Hi, Fred"
    new Ext.Button({
        text: 'Say Hi',
        renderTo: Ext.getBody(),
        handler: sayHi.createCallback('Fred')
    });
    
    * @return {Function} The new function */ createCallback : function(/*args...*/){ // make args available, in function below var args = arguments, method = this; return function() { return method.apply(window, args); }; }, /** * Creates a delegate (callback) that sets the scope to obj. * Call directly on any function. Example: this.myFunction.createDelegate(this, [arg1, arg2]) * Will create a function that is automatically scoped to obj so that the this variable inside the * callback points to obj. Example usage: *
    
    var sayHi = function(name){
        // Note this use of "this.text" here.  This function expects to
        // execute within a scope that contains a text property.  In this
        // example, the "this" variable is pointing to the btn object that
        // was passed in createDelegate below.
        alert('Hi, ' + name + '. You clicked the "' + this.text + '" button.');
    }
    
    var btn = new Ext.Button({
        text: 'Say Hi',
        renderTo: Ext.getBody()
    });
    
    // This callback will execute in the scope of the
    // button instance. Clicking the button alerts
    // "Hi, Fred. You clicked the "Say Hi" button."
    btn.on('click', sayHi.createDelegate(btn, ['Fred']));
    
    * @param {Object} scope (optional) The scope (this reference) in which the function is executed. * If omitted, defaults to the browser window. * @param {Array} args (optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller) * @param {Boolean/Number} appendArgs (optional) if True args are appended to call args instead of overriding, * if a number the args are inserted at the specified position * @return {Function} The new function */ createDelegate : function(obj, args, appendArgs){ var method = this; return function() { var callArgs = args || arguments; if (appendArgs === true){ callArgs = Array.prototype.slice.call(arguments, 0); callArgs = callArgs.concat(args); }else if (Ext.isNumber(appendArgs)){ callArgs = Array.prototype.slice.call(arguments, 0); // copy arguments first var applyArgs = [appendArgs, 0].concat(args); // create method call params Array.prototype.splice.apply(callArgs, applyArgs); // splice them in } return method.apply(obj || window, callArgs); }; }, /** * Calls this function after the number of millseconds specified, optionally in a specific scope. Example usage: *
    
    var sayHi = function(name){
        alert('Hi, ' + name);
    }
    
    // executes immediately:
    sayHi('Fred');
    
    // executes after 2 seconds:
    sayHi.defer(2000, this, ['Fred']);
    
    // this syntax is sometimes useful for deferring
    // execution of an anonymous function:
    (function(){
        alert('Anonymous');
    }).defer(100);
    
    * @param {Number} millis The number of milliseconds for the setTimeout call (if less than or equal to 0 the function is executed immediately) * @param {Object} scope (optional) The scope (this reference) in which the function is executed. * If omitted, defaults to the browser window. * @param {Array} args (optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller) * @param {Boolean/Number} appendArgs (optional) if True args are appended to call args instead of overriding, * if a number the args are inserted at the specified position * @return {Number} The timeout id that can be used with clearTimeout */ defer : function(millis, obj, args, appendArgs){ var fn = this.createDelegate(obj, args, appendArgs); if(millis > 0){ return setTimeout(fn, millis); } fn(); return 0; } }); /** * @class String * These functions are available on every String object. */ Ext.applyIf(String, { /** * Allows you to define a tokenized string and pass an arbitrary number of arguments to replace the tokens. Each * token must be unique, and must increment in the format {0}, {1}, etc. Example usage: *
    
    var cls = 'my-class', text = 'Some text';
    var s = String.format('<div class="{0}">{1}</div>', cls, text);
    // s now contains the string: '<div class="my-class">Some text</div>'
         * 
    * @param {String} string The tokenized string to be formatted * @param {String} value1 The value to replace token {0} * @param {String} value2 Etc... * @return {String} The formatted string * @static */ format : function(format){ var args = Ext.toArray(arguments, 1); return format.replace(/\{(\d+)\}/g, function(m, i){ return args[i]; }); } }); /** * @class Array */ Ext.applyIf(Array.prototype, { /** * Checks whether or not the specified object exists in the array. * @param {Object} o The object to check for * @param {Number} from (Optional) The index at which to begin the search * @return {Number} The index of o in the array (or -1 if it is not found) */ indexOf : function(o, from){ var len = this.length; from = from || 0; from += (from < 0) ? len : 0; for (; from < len; ++from){ if(this[from] === o){ return from; } } return -1; }, /** * Removes the specified object from the array. If the object is not found nothing happens. * @param {Object} o The object to remove * @return {Array} this array */ remove : function(o){ var index = this.indexOf(o); if(index != -1){ this.splice(index, 1); } return this; } }); /** * @class Ext.util.TaskRunner * Provides the ability to execute one or more arbitrary tasks in a multithreaded * manner. Generally, you can use the singleton {@link Ext.TaskMgr} instead, but * if needed, you can create separate instances of TaskRunner. Any number of * separate tasks can be started at any time and will run independently of each * other. Example usage: *
    
    // Start a simple clock task that updates a div once per second
    var updateClock = function(){
        Ext.fly('clock').update(new Date().format('g:i:s A'));
    } 
    var task = {
        run: updateClock,
        interval: 1000 //1 second
    }
    var runner = new Ext.util.TaskRunner();
    runner.start(task);
    
    // equivalent using TaskMgr
    Ext.TaskMgr.start({
        run: updateClock,
        interval: 1000
    });
    
     * 
    *

    See the {@link #start} method for details about how to configure a task object.

    * Also see {@link Ext.util.DelayedTask}. * * @constructor * @param {Number} interval (optional) The minimum precision in milliseconds supported by this TaskRunner instance * (defaults to 10) */ Ext.util.TaskRunner = function(interval){ interval = interval || 10; var tasks = [], removeQueue = [], id = 0, running = false, // private stopThread = function(){ running = false; clearInterval(id); id = 0; }, // private startThread = function(){ if(!running){ running = true; id = setInterval(runTasks, interval); } }, // private removeTask = function(t){ removeQueue.push(t); if(t.onStop){ t.onStop.apply(t.scope || t); } }, // private runTasks = function(){ var rqLen = removeQueue.length, now = new Date().getTime(); if(rqLen > 0){ for(var i = 0; i < rqLen; i++){ tasks.remove(removeQueue[i]); } removeQueue = []; if(tasks.length < 1){ stopThread(); return; } } for(var i = 0, t, itime, rt, len = tasks.length; i < len; ++i){ t = tasks[i]; itime = now - t.taskRunTime; if(t.interval <= itime){ rt = t.run.apply(t.scope || t, t.args || [++t.taskRunCount]); t.taskRunTime = now; if(rt === false || t.taskRunCount === t.repeat){ removeTask(t); return; } } if(t.duration && t.duration <= (now - t.taskStartTime)){ removeTask(t); } } }; /** * Starts a new task. * @method start * @param {Object} task

    A config object that supports the following properties:

      *
    • run : Function

      The function to execute each time the task is invoked. The * function will be called at each interval and passed the args argument if specified, and the * current invocation count if not.

      *

      If a particular scope (this reference) is required, be sure to specify it using the scope argument.

      *

      Return false from this function to terminate the task.

    • *
    • interval : Number
      The frequency in milliseconds with which the task * should be invoked.
    • *
    • args : Array
      (optional) An array of arguments to be passed to the function * specified by run. If not specified, the current invocation count is passed.
    • *
    • scope : Object
      (optional) The scope (this reference) in which to execute the * run function. Defaults to the task config object.
    • *
    • duration : Number
      (optional) The length of time in milliseconds to invoke * the task before stopping automatically (defaults to indefinite).
    • *
    • repeat : Number
      (optional) The number of times to invoke the task before * stopping automatically (defaults to indefinite).
    • *

    *

    Before each invocation, Ext injects the property taskRunCount into the task object so * that calculations based on the repeat count can be performed.

    * @return {Object} The task */ this.start = function(task){ tasks.push(task); task.taskStartTime = new Date().getTime(); task.taskRunTime = 0; task.taskRunCount = 0; startThread(); return task; }; /** * Stops an existing running task. * @method stop * @param {Object} task The task to stop * @return {Object} The task */ this.stop = function(task){ removeTask(task); return task; }; /** * Stops all tasks that are currently running. * @method stopAll */ this.stopAll = function(){ stopThread(); for(var i = 0, len = tasks.length; i < len; i++){ if(tasks[i].onStop){ tasks[i].onStop(); } } tasks = []; removeQueue = []; }; }; /** * @class Ext.TaskMgr * @extends Ext.util.TaskRunner * A static {@link Ext.util.TaskRunner} instance that can be used to start and stop arbitrary tasks. See * {@link Ext.util.TaskRunner} for supported methods and task config properties. *
    
    // Start a simple clock task that updates a div once per second
    var task = {
        run: function(){
            Ext.fly('clock').update(new Date().format('g:i:s A'));
        },
        interval: 1000 //1 second
    }
    Ext.TaskMgr.start(task);
    
    *

    See the {@link #start} method for details about how to configure a task object.

    * @singleton */ Ext.TaskMgr = new Ext.util.TaskRunner();(function(){ var libFlyweight; function fly(el) { if (!libFlyweight) { libFlyweight = new Ext.Element.Flyweight(); } libFlyweight.dom = el; return libFlyweight; } (function(){ var doc = document, isCSS1 = doc.compatMode == "CSS1Compat", MAX = Math.max, ROUND = Math.round, PARSEINT = parseInt; Ext.lib.Dom = { isAncestor : function(p, c) { var ret = false; p = Ext.getDom(p); c = Ext.getDom(c); if (p && c) { if (p.contains) { return p.contains(c); } else if (p.compareDocumentPosition) { return !!(p.compareDocumentPosition(c) & 16); } else { while (c = c.parentNode) { ret = c == p || ret; } } } return ret; }, getViewWidth : function(full) { return full ? this.getDocumentWidth() : this.getViewportWidth(); }, getViewHeight : function(full) { return full ? this.getDocumentHeight() : this.getViewportHeight(); }, getDocumentHeight: function() { return MAX(!isCSS1 ? doc.body.scrollHeight : doc.documentElement.scrollHeight, this.getViewportHeight()); }, getDocumentWidth: function() { return MAX(!isCSS1 ? doc.body.scrollWidth : doc.documentElement.scrollWidth, this.getViewportWidth()); }, getViewportHeight: function(){ return Ext.isIE ? (Ext.isStrict ? doc.documentElement.clientHeight : doc.body.clientHeight) : self.innerHeight; }, getViewportWidth : function() { return !Ext.isStrict && !Ext.isOpera ? doc.body.clientWidth : Ext.isIE ? doc.documentElement.clientWidth : self.innerWidth; }, getY : function(el) { return this.getXY(el)[1]; }, getX : function(el) { return this.getXY(el)[0]; }, getXY : function(el) { var p, pe, b, bt, bl, dbd, x = 0, y = 0, scroll, hasAbsolute, bd = (doc.body || doc.documentElement), ret = [0,0]; el = Ext.getDom(el); if(el != bd){ if (el.getBoundingClientRect) { b = el.getBoundingClientRect(); scroll = fly(document).getScroll(); ret = [ROUND(b.left + scroll.left), ROUND(b.top + scroll.top)]; } else { p = el; hasAbsolute = fly(el).isStyle("position", "absolute"); while (p) { pe = fly(p); x += p.offsetLeft; y += p.offsetTop; hasAbsolute = hasAbsolute || pe.isStyle("position", "absolute"); if (Ext.isGecko) { y += bt = PARSEINT(pe.getStyle("borderTopWidth"), 10) || 0; x += bl = PARSEINT(pe.getStyle("borderLeftWidth"), 10) || 0; if (p != el && !pe.isStyle('overflow','visible')) { x += bl; y += bt; } } p = p.offsetParent; } if (Ext.isSafari && hasAbsolute) { x -= bd.offsetLeft; y -= bd.offsetTop; } if (Ext.isGecko && !hasAbsolute) { dbd = fly(bd); x += PARSEINT(dbd.getStyle("borderLeftWidth"), 10) || 0; y += PARSEINT(dbd.getStyle("borderTopWidth"), 10) || 0; } p = el.parentNode; while (p && p != bd) { if (!Ext.isOpera || (p.tagName != 'TR' && !fly(p).isStyle("display", "inline"))) { x -= p.scrollLeft; y -= p.scrollTop; } p = p.parentNode; } ret = [x,y]; } } return ret; }, setXY : function(el, xy) { (el = Ext.fly(el, '_setXY')).position(); var pts = el.translatePoints(xy), style = el.dom.style, pos; for (pos in pts) { if (!isNaN(pts[pos])) { style[pos] = pts[pos] + "px"; } } }, setX : function(el, x) { this.setXY(el, [x, false]); }, setY : function(el, y) { this.setXY(el, [false, y]); } }; })();Ext.lib.Event = function() { var loadComplete = false, unloadListeners = {}, retryCount = 0, onAvailStack = [], _interval, locked = false, win = window, doc = document, // constants POLL_RETRYS = 200, POLL_INTERVAL = 20, TYPE = 0, FN = 1, OBJ = 2, ADJ_SCOPE = 3, SCROLLLEFT = 'scrollLeft', SCROLLTOP = 'scrollTop', UNLOAD = 'unload', MOUSEOVER = 'mouseover', MOUSEOUT = 'mouseout', // private doAdd = function() { var ret; if (win.addEventListener) { ret = function(el, eventName, fn, capture) { if (eventName == 'mouseenter') { fn = fn.createInterceptor(checkRelatedTarget); el.addEventListener(MOUSEOVER, fn, (capture)); } else if (eventName == 'mouseleave') { fn = fn.createInterceptor(checkRelatedTarget); el.addEventListener(MOUSEOUT, fn, (capture)); } else { el.addEventListener(eventName, fn, (capture)); } return fn; }; } else if (win.attachEvent) { ret = function(el, eventName, fn, capture) { el.attachEvent("on" + eventName, fn); return fn; }; } else { ret = function(){}; } return ret; }(), // private doRemove = function(){ var ret; if (win.removeEventListener) { ret = function (el, eventName, fn, capture) { if (eventName == 'mouseenter') { eventName = MOUSEOVER; } else if (eventName == 'mouseleave') { eventName = MOUSEOUT; } el.removeEventListener(eventName, fn, (capture)); }; } else if (win.detachEvent) { ret = function (el, eventName, fn) { el.detachEvent("on" + eventName, fn); }; } else { ret = function(){}; } return ret; }(); function checkRelatedTarget(e) { return !elContains(e.currentTarget, pub.getRelatedTarget(e)); } function elContains(parent, child) { if(parent && parent.firstChild){ while(child) { if(child === parent) { return true; } child = child.parentNode; if(child && (child.nodeType != 1)) { child = null; } } } return false; } // private function _tryPreloadAttach() { var ret = false, notAvail = [], element, i, v, override, tryAgain = !loadComplete || (retryCount > 0); if(!locked){ locked = true; for(i = 0; i < onAvailStack.length; ++i){ v = onAvailStack[i]; if(v && (element = doc.getElementById(v.id))){ if(!v.checkReady || loadComplete || element.nextSibling || (doc && doc.body)) { override = v.override; element = override ? (override === true ? v.obj : override) : element; v.fn.call(element, v.obj); onAvailStack.remove(v); --i; }else{ notAvail.push(v); } } } retryCount = (notAvail.length === 0) ? 0 : retryCount - 1; if (tryAgain) { startInterval(); } else { clearInterval(_interval); _interval = null; } ret = !(locked = false); } return ret; } // private function startInterval() { if(!_interval){ var callback = function() { _tryPreloadAttach(); }; _interval = setInterval(callback, POLL_INTERVAL); } } // private function getScroll() { var dd = doc.documentElement, db = doc.body; if(dd && (dd[SCROLLTOP] || dd[SCROLLLEFT])){ return [dd[SCROLLLEFT], dd[SCROLLTOP]]; }else if(db){ return [db[SCROLLLEFT], db[SCROLLTOP]]; }else{ return [0, 0]; } } // private function getPageCoord (ev, xy) { ev = ev.browserEvent || ev; var coord = ev['page' + xy]; if (!coord && coord !== 0) { coord = ev['client' + xy] || 0; if (Ext.isIE) { coord += getScroll()[xy == "X" ? 0 : 1]; } } return coord; } var pub = { extAdapter: true, onAvailable : function(p_id, p_fn, p_obj, p_override) { onAvailStack.push({ id: p_id, fn: p_fn, obj: p_obj, override: p_override, checkReady: false }); retryCount = POLL_RETRYS; startInterval(); }, // This function should ALWAYS be called from Ext.EventManager addListener: function(el, eventName, fn) { el = Ext.getDom(el); if (el && fn) { if (eventName == UNLOAD) { if (unloadListeners[el.id] === undefined) { unloadListeners[el.id] = []; } unloadListeners[el.id].push([eventName, fn]); return fn; } return doAdd(el, eventName, fn, false); } return false; }, // This function should ALWAYS be called from Ext.EventManager removeListener: function(el, eventName, fn) { el = Ext.getDom(el); var i, len, li, lis; if (el && fn) { if(eventName == UNLOAD){ if((lis = unloadListeners[el.id]) !== undefined){ for(i = 0, len = lis.length; i < len; i++){ if((li = lis[i]) && li[TYPE] == eventName && li[FN] == fn){ unloadListeners[el.id].splice(i, 1); } } } return; } doRemove(el, eventName, fn, false); } }, getTarget : function(ev) { ev = ev.browserEvent || ev; return this.resolveTextNode(ev.target || ev.srcElement); }, resolveTextNode : Ext.isGecko ? function(node){ if(!node){ return; } // work around firefox bug, https://bugzilla.mozilla.org/show_bug.cgi?id=101197 var s = HTMLElement.prototype.toString.call(node); if(s == '[xpconnect wrapped native prototype]' || s == '[object XULElement]'){ return; } return node.nodeType == 3 ? node.parentNode : node; } : function(node){ return node && node.nodeType == 3 ? node.parentNode : node; }, getRelatedTarget : function(ev) { ev = ev.browserEvent || ev; return this.resolveTextNode(ev.relatedTarget || (/(mouseout|mouseleave)/.test(ev.type) ? ev.toElement : /(mouseover|mouseenter)/.test(ev.type) ? ev.fromElement : null)); }, getPageX : function(ev) { return getPageCoord(ev, "X"); }, getPageY : function(ev) { return getPageCoord(ev, "Y"); }, getXY : function(ev) { return [this.getPageX(ev), this.getPageY(ev)]; }, stopEvent : function(ev) { this.stopPropagation(ev); this.preventDefault(ev); }, stopPropagation : function(ev) { ev = ev.browserEvent || ev; if (ev.stopPropagation) { ev.stopPropagation(); } else { ev.cancelBubble = true; } }, preventDefault : function(ev) { ev = ev.browserEvent || ev; if (ev.preventDefault) { ev.preventDefault(); } else { if (ev.keyCode) { ev.keyCode = 0; } ev.returnValue = false; } }, getEvent : function(e) { e = e || win.event; if (!e) { var c = this.getEvent.caller; while (c) { e = c.arguments[0]; if (e && Event == e.constructor) { break; } c = c.caller; } } return e; }, getCharCode : function(ev) { ev = ev.browserEvent || ev; return ev.charCode || ev.keyCode || 0; }, //clearCache: function() {}, // deprecated, call from EventManager getListeners : function(el, eventName) { Ext.EventManager.getListeners(el, eventName); }, // deprecated, call from EventManager purgeElement : function(el, recurse, eventName) { Ext.EventManager.purgeElement(el, recurse, eventName); }, _load : function(e) { loadComplete = true; if (Ext.isIE && e !== true) { // IE8 complains that _load is null or not an object // so lets remove self via arguments.callee doRemove(win, "load", arguments.callee); } }, _unload : function(e) { var EU = Ext.lib.Event, i, v, ul, id, len, scope; for (id in unloadListeners) { ul = unloadListeners[id]; for (i = 0, len = ul.length; i < len; i++) { v = ul[i]; if (v) { try{ scope = v[ADJ_SCOPE] ? (v[ADJ_SCOPE] === true ? v[OBJ] : v[ADJ_SCOPE]) : win; v[FN].call(scope, EU.getEvent(e), v[OBJ]); }catch(ex){} } } }; Ext.EventManager._unload(); doRemove(win, UNLOAD, EU._unload); } }; // Initialize stuff. pub.on = pub.addListener; pub.un = pub.removeListener; if (doc && doc.body) { pub._load(true); } else { doAdd(win, "load", pub._load); } doAdd(win, UNLOAD, pub._unload); _tryPreloadAttach(); return pub; }(); /* * Portions of this file are based on pieces of Yahoo User Interface Library * Copyright (c) 2007, Yahoo! Inc. All rights reserved. * YUI licensed under the BSD License: * http://developer.yahoo.net/yui/license.txt */ Ext.lib.Ajax = function() { var activeX = ['Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.3.0', 'Msxml2.XMLHTTP'], CONTENTTYPE = 'Content-Type'; // private function setHeader(o) { var conn = o.conn, prop, headers = {}; function setTheHeaders(conn, headers){ for (prop in headers) { if (headers.hasOwnProperty(prop)) { conn.setRequestHeader(prop, headers[prop]); } } } Ext.apply(headers, pub.headers, pub.defaultHeaders); setTheHeaders(conn, headers); delete pub.headers; } // private function createExceptionObject(tId, callbackArg, isAbort, isTimeout) { return { tId : tId, status : isAbort ? -1 : 0, statusText : isAbort ? 'transaction aborted' : 'communication failure', isAbort: isAbort, isTimeout: isTimeout, argument : callbackArg }; } // private function initHeader(label, value) { (pub.headers = pub.headers || {})[label] = value; } // private function createResponseObject(o, callbackArg) { var headerObj = {}, headerStr, conn = o.conn, t, s, // see: https://prototype.lighthouseapp.com/projects/8886/tickets/129-ie-mangles-http-response-status-code-204-to-1223 isBrokenStatus = conn.status == 1223; try { headerStr = o.conn.getAllResponseHeaders(); Ext.each(headerStr.replace(/\r\n/g, '\n').split('\n'), function(v){ t = v.indexOf(':'); if(t >= 0){ s = v.substr(0, t).toLowerCase(); if(v.charAt(t + 1) == ' '){ ++t; } headerObj[s] = v.substr(t + 1); } }); } catch(e) {} return { tId : o.tId, // Normalize the status and statusText when IE returns 1223, see the above link. status : isBrokenStatus ? 204 : conn.status, statusText : isBrokenStatus ? 'No Content' : conn.statusText, getResponseHeader : function(header){return headerObj[header.toLowerCase()];}, getAllResponseHeaders : function(){return headerStr;}, responseText : conn.responseText, responseXML : conn.responseXML, argument : callbackArg }; } // private function releaseObject(o) { if (o.tId) { pub.conn[o.tId] = null; } o.conn = null; o = null; } // private function handleTransactionResponse(o, callback, isAbort, isTimeout) { if (!callback) { releaseObject(o); return; } var httpStatus, responseObject; try { if (o.conn.status !== undefined && o.conn.status != 0) { httpStatus = o.conn.status; } else { httpStatus = 13030; } } catch(e) { httpStatus = 13030; } if ((httpStatus >= 200 && httpStatus < 300) || (Ext.isIE && httpStatus == 1223)) { responseObject = createResponseObject(o, callback.argument); if (callback.success) { if (!callback.scope) { callback.success(responseObject); } else { callback.success.apply(callback.scope, [responseObject]); } } } else { switch (httpStatus) { case 12002: case 12029: case 12030: case 12031: case 12152: case 13030: responseObject = createExceptionObject(o.tId, callback.argument, (isAbort ? isAbort : false), isTimeout); if (callback.failure) { if (!callback.scope) { callback.failure(responseObject); } else { callback.failure.apply(callback.scope, [responseObject]); } } break; default: responseObject = createResponseObject(o, callback.argument); if (callback.failure) { if (!callback.scope) { callback.failure(responseObject); } else { callback.failure.apply(callback.scope, [responseObject]); } } } } releaseObject(o); responseObject = null; } function checkResponse(o, callback, conn, tId, poll, cbTimeout){ if (conn && conn.readyState == 4) { clearInterval(poll[tId]); poll[tId] = null; if (cbTimeout) { clearTimeout(pub.timeout[tId]); pub.timeout[tId] = null; } handleTransactionResponse(o, callback); } } function checkTimeout(o, callback){ pub.abort(o, callback, true); } // private function handleReadyState(o, callback){ callback = callback || {}; var conn = o.conn, tId = o.tId, poll = pub.poll, cbTimeout = callback.timeout || null; if (cbTimeout) { pub.conn[tId] = conn; pub.timeout[tId] = setTimeout(checkTimeout.createCallback(o, callback), cbTimeout); } poll[tId] = setInterval(checkResponse.createCallback(o, callback, conn, tId, poll, cbTimeout), pub.pollInterval); } // private function asyncRequest(method, uri, callback, postData) { var o = getConnectionObject() || null; if (o) { o.conn.open(method, uri, true); if (pub.useDefaultXhrHeader) { initHeader('X-Requested-With', pub.defaultXhrHeader); } if(postData && pub.useDefaultHeader && (!pub.headers || !pub.headers[CONTENTTYPE])){ initHeader(CONTENTTYPE, pub.defaultPostHeader); } if (pub.defaultHeaders || pub.headers) { setHeader(o); } handleReadyState(o, callback); o.conn.send(postData || null); } return o; } // private function getConnectionObject() { var o; try { if (o = createXhrObject(pub.transactionId)) { pub.transactionId++; } } catch(e) { } finally { return o; } } // private function createXhrObject(transactionId) { var http; try { http = new XMLHttpRequest(); } catch(e) { for (var i = Ext.isIE6 ? 1 : 0; i < activeX.length; ++i) { try { http = new ActiveXObject(activeX[i]); break; } catch(e) {} } } finally { return {conn : http, tId : transactionId}; } } var pub = { request : function(method, uri, cb, data, options) { if(options){ var me = this, xmlData = options.xmlData, jsonData = options.jsonData, hs; Ext.applyIf(me, options); if(xmlData || jsonData){ hs = me.headers; if(!hs || !hs[CONTENTTYPE]){ initHeader(CONTENTTYPE, xmlData ? 'text/xml' : 'application/json'); } data = xmlData || (!Ext.isPrimitive(jsonData) ? Ext.encode(jsonData) : jsonData); } } return asyncRequest(method || options.method || "POST", uri, cb, data); }, serializeForm : function(form) { var fElements = form.elements || (document.forms[form] || Ext.getDom(form)).elements, hasSubmit = false, encoder = encodeURIComponent, name, data = '', type, hasValue; Ext.each(fElements, function(element){ name = element.name; type = element.type; if (!element.disabled && name) { if (/select-(one|multiple)/i.test(type)) { Ext.each(element.options, function(opt){ if (opt.selected) { hasValue = opt.hasAttribute ? opt.hasAttribute('value') : opt.getAttributeNode('value').specified; data += String.format("{0}={1}&", encoder(name), encoder(hasValue ? opt.value : opt.text)); } }); } else if (!(/file|undefined|reset|button/i.test(type))) { if (!(/radio|checkbox/i.test(type) && !element.checked) && !(type == 'submit' && hasSubmit)) { data += encoder(name) + '=' + encoder(element.value) + '&'; hasSubmit = /submit/i.test(type); } } } }); return data.substr(0, data.length - 1); }, useDefaultHeader : true, defaultPostHeader : 'application/x-www-form-urlencoded; charset=UTF-8', useDefaultXhrHeader : true, defaultXhrHeader : 'XMLHttpRequest', poll : {}, timeout : {}, conn: {}, pollInterval : 50, transactionId : 0, // This is never called - Is it worth exposing this? // setProgId : function(id) { // activeX.unshift(id); // }, // This is never called - Is it worth exposing this? // setDefaultPostHeader : function(b) { // this.useDefaultHeader = b; // }, // This is never called - Is it worth exposing this? // setDefaultXhrHeader : function(b) { // this.useDefaultXhrHeader = b; // }, // This is never called - Is it worth exposing this? // setPollingInterval : function(i) { // if (typeof i == 'number' && isFinite(i)) { // this.pollInterval = i; // } // }, // This is never called - Is it worth exposing this? // resetDefaultHeaders : function() { // this.defaultHeaders = null; // }, abort : function(o, callback, isTimeout) { var me = this, tId = o.tId, isAbort = false; if (me.isCallInProgress(o)) { o.conn.abort(); clearInterval(me.poll[tId]); me.poll[tId] = null; clearTimeout(pub.timeout[tId]); me.timeout[tId] = null; handleTransactionResponse(o, callback, (isAbort = true), isTimeout); } return isAbort; }, isCallInProgress : function(o) { // if there is a connection and readyState is not 0 or 4 return o.conn && !{0:true,4:true}[o.conn.readyState]; } }; return pub; }();(function(){ var EXTLIB = Ext.lib, noNegatives = /width|height|opacity|padding/i, offsetAttribute = /^((width|height)|(top|left))$/, defaultUnit = /width|height|top$|bottom$|left$|right$/i, offsetUnit = /\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i, isset = function(v){ return typeof v !== 'undefined'; }, now = function(){ return new Date(); }; EXTLIB.Anim = { motion : function(el, args, duration, easing, cb, scope) { return this.run(el, args, duration, easing, cb, scope, Ext.lib.Motion); }, run : function(el, args, duration, easing, cb, scope, type) { type = type || Ext.lib.AnimBase; if (typeof easing == "string") { easing = Ext.lib.Easing[easing]; } var anim = new type(el, args, duration, easing); anim.animateX(function() { if(Ext.isFunction(cb)){ cb.call(scope); } }); return anim; } }; EXTLIB.AnimBase = function(el, attributes, duration, method) { if (el) { this.init(el, attributes, duration, method); } }; EXTLIB.AnimBase.prototype = { doMethod: function(attr, start, end) { var me = this; return me.method(me.curFrame, start, end - start, me.totalFrames); }, setAttr: function(attr, val, unit) { if (noNegatives.test(attr) && val < 0) { val = 0; } Ext.fly(this.el, '_anim').setStyle(attr, val + unit); }, getAttr: function(attr) { var el = Ext.fly(this.el), val = el.getStyle(attr), a = offsetAttribute.exec(attr) || []; if (val !== 'auto' && !offsetUnit.test(val)) { return parseFloat(val); } return (!!(a[2]) || (el.getStyle('position') == 'absolute' && !!(a[3]))) ? el.dom['offset' + a[0].charAt(0).toUpperCase() + a[0].substr(1)] : 0; }, getDefaultUnit: function(attr) { return defaultUnit.test(attr) ? 'px' : ''; }, animateX : function(callback, scope) { var me = this, f = function() { me.onComplete.removeListener(f); if (Ext.isFunction(callback)) { callback.call(scope || me, me); } }; me.onComplete.addListener(f, me); me.animate(); }, setRunAttr: function(attr) { var me = this, a = this.attributes[attr], to = a.to, by = a.by, from = a.from, unit = a.unit, ra = (this.runAttrs[attr] = {}), end; if (!isset(to) && !isset(by)){ return false; } var start = isset(from) ? from : me.getAttr(attr); if (isset(to)) { end = to; }else if(isset(by)) { if (Ext.isArray(start)){ end = []; for(var i=0,len=start.length; i 0 && isFinite(tweak)){ if(tween.curFrame + tweak >= frames){ tweak = frames - (frame + 1); } tween.curFrame += tweak; } }; }; EXTLIB.Bezier = new function() { this.getPosition = function(points, t) { var n = points.length, tmp = [], c = 1 - t, i, j; for (i = 0; i < n; ++i) { tmp[i] = [points[i][0], points[i][1]]; } for (j = 1; j < n; ++j) { for (i = 0; i < n - j; ++i) { tmp[i][0] = c * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0]; tmp[i][1] = c * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1]; } } return [ tmp[0][0], tmp[0][1] ]; }; }; EXTLIB.Easing = { easeNone: function (t, b, c, d) { return c * t / d + b; }, easeIn: function (t, b, c, d) { return c * (t /= d) * t + b; }, easeOut: function (t, b, c, d) { return -c * (t /= d) * (t - 2) + b; } }; (function() { EXTLIB.Motion = function(el, attributes, duration, method) { if (el) { EXTLIB.Motion.superclass.constructor.call(this, el, attributes, duration, method); } }; Ext.extend(EXTLIB.Motion, Ext.lib.AnimBase); var superclass = EXTLIB.Motion.superclass, pointsRe = /^points$/i; Ext.apply(EXTLIB.Motion.prototype, { setAttr: function(attr, val, unit){ var me = this, setAttr = superclass.setAttr; if (pointsRe.test(attr)) { unit = unit || 'px'; setAttr.call(me, 'left', val[0], unit); setAttr.call(me, 'top', val[1], unit); } else { setAttr.call(me, attr, val, unit); } }, getAttr: function(attr){ var me = this, getAttr = superclass.getAttr; return pointsRe.test(attr) ? [getAttr.call(me, 'left'), getAttr.call(me, 'top')] : getAttr.call(me, attr); }, doMethod: function(attr, start, end){ var me = this; return pointsRe.test(attr) ? EXTLIB.Bezier.getPosition(me.runAttrs[attr], me.method(me.curFrame, 0, 100, me.totalFrames) / 100) : superclass.doMethod.call(me, attr, start, end); }, setRunAttr: function(attr){ if(pointsRe.test(attr)){ var me = this, el = this.el, points = this.attributes.points, control = points.control || [], from = points.from, to = points.to, by = points.by, DOM = EXTLIB.Dom, start, i, end, len, ra; if(control.length > 0 && !Ext.isArray(control[0])){ control = [control]; }else{ /* var tmp = []; for (i = 0,len = control.length; i < len; ++i) { tmp[i] = control[i]; } control = tmp; */ } Ext.fly(el, '_anim').position(); DOM.setXY(el, isset(from) ? from : DOM.getXY(el)); start = me.getAttr('points'); if(isset(to)){ end = translateValues.call(me, to, start); for (i = 0,len = control.length; i < len; ++i) { control[i] = translateValues.call(me, control[i], start); } } else if (isset(by)) { end = [start[0] + by[0], start[1] + by[1]]; for (i = 0,len = control.length; i < len; ++i) { control[i] = [ start[0] + control[i][0], start[1] + control[i][1] ]; } } ra = this.runAttrs[attr] = [start]; if (control.length > 0) { ra = ra.concat(control); } ra[ra.length] = end; }else{ superclass.setRunAttr.call(this, attr); } } }); var translateValues = function(val, start) { var pageXY = EXTLIB.Dom.getXY(this.el); return [val[0] - pageXY[0] + start[0], val[1] - pageXY[1] + start[1]]; }; })(); })();// Easing functions (function(){ // shortcuts to aid compression var abs = Math.abs, pi = Math.PI, asin = Math.asin, pow = Math.pow, sin = Math.sin, EXTLIB = Ext.lib; Ext.apply(EXTLIB.Easing, { easeBoth: function (t, b, c, d) { return ((t /= d / 2) < 1) ? c / 2 * t * t + b : -c / 2 * ((--t) * (t - 2) - 1) + b; }, easeInStrong: function (t, b, c, d) { return c * (t /= d) * t * t * t + b; }, easeOutStrong: function (t, b, c, d) { return -c * ((t = t / d - 1) * t * t * t - 1) + b; }, easeBothStrong: function (t, b, c, d) { return ((t /= d / 2) < 1) ? c / 2 * t * t * t * t + b : -c / 2 * ((t -= 2) * t * t * t - 2) + b; }, elasticIn: function (t, b, c, d, a, p) { if (t == 0 || (t /= d) == 1) { return t == 0 ? b : b + c; } p = p || (d * .3); var s; if (a >= abs(c)) { s = p / (2 * pi) * asin(c / a); } else { a = c; s = p / 4; } return -(a * pow(2, 10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p)) + b; }, elasticOut: function (t, b, c, d, a, p) { if (t == 0 || (t /= d) == 1) { return t == 0 ? b : b + c; } p = p || (d * .3); var s; if (a >= abs(c)) { s = p / (2 * pi) * asin(c / a); } else { a = c; s = p / 4; } return a * pow(2, -10 * t) * sin((t * d - s) * (2 * pi) / p) + c + b; }, elasticBoth: function (t, b, c, d, a, p) { if (t == 0 || (t /= d / 2) == 2) { return t == 0 ? b : b + c; } p = p || (d * (.3 * 1.5)); var s; if (a >= abs(c)) { s = p / (2 * pi) * asin(c / a); } else { a = c; s = p / 4; } return t < 1 ? -.5 * (a * pow(2, 10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p)) + b : a * pow(2, -10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p) * .5 + c + b; }, backIn: function (t, b, c, d, s) { s = s || 1.70158; return c * (t /= d) * t * ((s + 1) * t - s) + b; }, backOut: function (t, b, c, d, s) { if (!s) { s = 1.70158; } return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b; }, backBoth: function (t, b, c, d, s) { s = s || 1.70158; return ((t /= d / 2 ) < 1) ? c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b : c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b; }, bounceIn: function (t, b, c, d) { return c - EXTLIB.Easing.bounceOut(d - t, 0, c, d) + b; }, bounceOut: function (t, b, c, d) { if ((t /= d) < (1 / 2.75)) { return c * (7.5625 * t * t) + b; } else if (t < (2 / 2.75)) { return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b; } else if (t < (2.5 / 2.75)) { return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b; } return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b; }, bounceBoth: function (t, b, c, d) { return (t < d / 2) ? EXTLIB.Easing.bounceIn(t * 2, 0, c, d) * .5 + b : EXTLIB.Easing.bounceOut(t * 2 - d, 0, c, d) * .5 + c * .5 + b; } }); })(); (function() { var EXTLIB = Ext.lib; // Color Animation EXTLIB.Anim.color = function(el, args, duration, easing, cb, scope) { return EXTLIB.Anim.run(el, args, duration, easing, cb, scope, EXTLIB.ColorAnim); }; EXTLIB.ColorAnim = function(el, attributes, duration, method) { EXTLIB.ColorAnim.superclass.constructor.call(this, el, attributes, duration, method); }; Ext.extend(EXTLIB.ColorAnim, EXTLIB.AnimBase); var superclass = EXTLIB.ColorAnim.superclass, colorRE = /color$/i, transparentRE = /^transparent|rgba\(0, 0, 0, 0\)$/, rgbRE = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i, hexRE= /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i, hex3RE = /^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i, isset = function(v){ return typeof v !== 'undefined'; }; // private function parseColor(s) { var pi = parseInt, base, out = null, c; if (s.length == 3) { return s; } Ext.each([hexRE, rgbRE, hex3RE], function(re, idx){ base = (idx % 2 == 0) ? 16 : 10; c = re.exec(s); if(c && c.length == 4){ out = [pi(c[1], base), pi(c[2], base), pi(c[3], base)]; return false; } }); return out; } Ext.apply(EXTLIB.ColorAnim.prototype, { getAttr : function(attr) { var me = this, el = me.el, val; if(colorRE.test(attr)){ while(el && transparentRE.test(val = Ext.fly(el).getStyle(attr))){ el = el.parentNode; val = "fff"; } }else{ val = superclass.getAttr.call(me, attr); } return val; }, doMethod : function(attr, start, end) { var me = this, val, floor = Math.floor, i, len, v; if(colorRE.test(attr)){ val = []; end = end || []; for(i = 0, len = start.length; i < len; i++) { v = start[i]; val[i] = superclass.doMethod.call(me, attr, v, end[i]); } val = 'rgb(' + floor(val[0]) + ',' + floor(val[1]) + ',' + floor(val[2]) + ')'; }else{ val = superclass.doMethod.call(me, attr, start, end); } return val; }, setRunAttr : function(attr) { var me = this, a = me.attributes[attr], to = a.to, by = a.by, ra; superclass.setRunAttr.call(me, attr); ra = me.runAttrs[attr]; if(colorRE.test(attr)){ var start = parseColor(ra.start), end = parseColor(ra.end); if(!isset(to) && isset(by)){ end = parseColor(by); for(var i=0,len=start.length; i0){return setTimeout(d,c)}d();return 0}});Ext.applyIf(String,{format:function(b){var a=Ext.toArray(arguments,1);return b.replace(/\{(\d+)\}/g,function(c,d){return a[d]})}});Ext.applyIf(Array.prototype,{indexOf:function(b,c){var a=this.length;c=c||0;c+=(c<0)?a:0;for(;c0){for(var p=0;p0);if(!A){A=true;for(I=0;I=0){B=s.substr(0,A).toLowerCase();if(s.charAt(A+1)==" "){++A}C[B]=s.substr(A+1)}})}catch(z){}return{tId:u.tId,status:v?204:w.status,statusText:v?"No Content":w.statusText,getResponseHeader:function(s){return C[s.toLowerCase()]},getAllResponseHeaders:function(){return x},responseText:w.responseText,responseXML:w.responseXML,argument:y}}function o(s){if(s.tId){k.conn[s.tId]=null}s.conn=null;s=null}function f(x,y,t,s){if(!y){o(x);return}var v,u;try{if(x.conn.status!==undefined&&x.conn.status!=0){v=x.conn.status}else{v=13030}}catch(w){v=13030}if((v>=200&&v<300)||(Ext.isIE&&v==1223)){u=p(x,y.argument);if(y.success){if(!y.scope){y.success(u)}else{y.success.apply(y.scope,[u])}}}else{switch(v){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:u=e(x.tId,y.argument,(t?t:false),s);if(y.failure){if(!y.scope){y.failure(u)}else{y.failure.apply(y.scope,[u])}}break;default:u=p(x,y.argument);if(y.failure){if(!y.scope){y.failure(u)}else{y.failure.apply(y.scope,[u])}}}}o(x);u=null}function m(u,x,s,w,t,v){if(s&&s.readyState==4){clearInterval(t[w]);t[w]=null;if(v){clearTimeout(k.timeout[w]);k.timeout[w]=null}f(u,x)}}function r(s,t){k.abort(s,t,true)}function n(u,x){x=x||{};var s=u.conn,w=u.tId,t=k.poll,v=x.timeout||null;if(v){k.conn[w]=s;k.timeout[w]=setTimeout(r.createCallback(u,x),v)}t[w]=setInterval(m.createCallback(u,x,s,w,t,v),k.pollInterval)}function i(w,t,v,s){var u=l()||null;if(u){u.conn.open(w,t,true);if(k.useDefaultXhrHeader){j("X-Requested-With",k.defaultXhrHeader)}if(s&&k.useDefaultHeader&&(!k.headers||!k.headers[d])){j(d,k.defaultPostHeader)}if(k.defaultHeaders||k.headers){h(u)}n(u,v);u.conn.send(s||null)}return u}function l(){var t;try{if(t=q(k.transactionId)){k.transactionId++}}catch(s){}finally{return t}}function q(v){var s;try{s=new XMLHttpRequest()}catch(u){for(var t=Ext.isIE6?1:0;t0&&isFinite(w)){if(r.curFrame+w>=v){w=v-(u+1)}r.curFrame+=w}}};g.Bezier=new function(){this.getPosition=function(p,o){var r=p.length,m=[],q=1-o,l,k;for(l=0;l0&&!Ext.isArray(s[0])){s=[s]}else{}Ext.fly(p,"_anim").position();A.setXY(p,j(x)?x:A.getXY(p));o=w.getAttr("points");if(j(y)){q=k.call(w,y,o);for(r=0,t=s.length;r0){n=n.concat(s)}n[n.length]=q}else{m.setRunAttr.call(this,u)}}});var k=function(n,p){var o=g.Dom.getXY(this.el);return[n[0]-o[0]+p[0],n[1]-o[1]+p[1]]}})()})();(function(){var d=Math.abs,i=Math.PI,h=Math.asin,g=Math.pow,e=Math.sin,f=Ext.lib;Ext.apply(f.Easing,{easeBoth:function(k,j,m,l){return((k/=l/2)<1)?m/2*k*k+j:-m/2*((--k)*(k-2)-1)+j},easeInStrong:function(k,j,m,l){return m*(k/=l)*k*k*k+j},easeOutStrong:function(k,j,m,l){return -m*((k=k/l-1)*k*k*k-1)+j},easeBothStrong:function(k,j,m,l){return((k/=l/2)<1)?m/2*k*k*k*k+j:-m/2*((k-=2)*k*k*k-2)+j},elasticIn:function(l,j,q,o,k,n){if(l==0||(l/=o)==1){return l==0?j:j+q}n=n||(o*0.3);var m;if(k>=d(q)){m=n/(2*i)*h(q/k)}else{k=q;m=n/4}return -(k*g(2,10*(l-=1))*e((l*o-m)*(2*i)/n))+j},elasticOut:function(l,j,q,o,k,n){if(l==0||(l/=o)==1){return l==0?j:j+q}n=n||(o*0.3);var m;if(k>=d(q)){m=n/(2*i)*h(q/k)}else{k=q;m=n/4}return k*g(2,-10*l)*e((l*o-m)*(2*i)/n)+q+j},elasticBoth:function(l,j,q,o,k,n){if(l==0||(l/=o/2)==2){return l==0?j:j+q}n=n||(o*(0.3*1.5));var m;if(k>=d(q)){m=n/(2*i)*h(q/k)}else{k=q;m=n/4}return l<1?-0.5*(k*g(2,10*(l-=1))*e((l*o-m)*(2*i)/n))+j:k*g(2,-10*(l-=1))*e((l*o-m)*(2*i)/n)*0.5+q+j},backIn:function(k,j,n,m,l){l=l||1.70158;return n*(k/=m)*k*((l+1)*k-l)+j},backOut:function(k,j,n,m,l){if(!l){l=1.70158}return n*((k=k/m-1)*k*((l+1)*k+l)+1)+j},backBoth:function(k,j,n,m,l){l=l||1.70158;return((k/=m/2)<1)?n/2*(k*k*(((l*=(1.525))+1)*k-l))+j:n/2*((k-=2)*k*(((l*=(1.525))+1)*k+l)+2)+j},bounceIn:function(k,j,m,l){return m-f.Easing.bounceOut(l-k,0,m,l)+j},bounceOut:function(k,j,m,l){if((k/=l)<(1/2.75)){return m*(7.5625*k*k)+j}else{if(k<(2/2.75)){return m*(7.5625*(k-=(1.5/2.75))*k+0.75)+j}else{if(k<(2.5/2.75)){return m*(7.5625*(k-=(2.25/2.75))*k+0.9375)+j}}}return m*(7.5625*(k-=(2.625/2.75))*k+0.984375)+j},bounceBoth:function(k,j,m,l){return(k'about:blank', except for IE in secure mode, which is 'javascript:""'). * @type String */ SSL_SECURE_URL : isSecure && isIE ? 'javascript:""' : 'about:blank', /** * True if the browser is in strict (standards-compliant) mode, as opposed to quirks mode * @type Boolean */ isStrict : isStrict, /** * True if the page is running over SSL * @type Boolean */ isSecure : isSecure, /** * True when the document is fully initialized and ready for action * @type Boolean */ isReady : false, /** * True if the {@link Ext.Fx} Class is available * @type Boolean * @property enableFx */ /** * HIGHLY EXPERIMENTAL * True to force css based border-box model override and turning off javascript based adjustments. This is a * runtime configuration and must be set before onReady. * @type Boolean */ enableForcedBoxModel : false, /** * True to automatically uncache orphaned Ext.Elements periodically (defaults to true) * @type Boolean */ enableGarbageCollector : true, /** * True to automatically purge event listeners during garbageCollection (defaults to false). * @type Boolean */ enableListenerCollection : false, /** * EXPERIMENTAL - True to cascade listener removal to child elements when an element is removed. * Currently not optimized for performance. * @type Boolean */ enableNestedListenerRemoval : false, /** * Indicates whether to use native browser parsing for JSON methods. * This option is ignored if the browser does not support native JSON methods. * Note: Native JSON methods will not work with objects that have functions. * Also, property names must be quoted, otherwise the data will not parse. (Defaults to false) * @type Boolean */ USE_NATIVE_JSON : false, /** * Copies all the properties of config to obj if they don't already exist. * @param {Object} obj The receiver of the properties * @param {Object} config The source of the properties * @return {Object} returns obj */ applyIf : function(o, c){ if(o){ for(var p in c){ if(!Ext.isDefined(o[p])){ o[p] = c[p]; } } } return o; }, /** * Generates unique ids. If the element already has an id, it is unchanged * @param {Mixed} el (optional) The element to generate an id for * @param {String} prefix (optional) Id prefix (defaults "ext-gen") * @return {String} The generated Id. */ id : function(el, prefix){ el = Ext.getDom(el, true) || {}; if (!el.id) { el.id = (prefix || "ext-gen") + (++idSeed); } return el.id; }, /** *

    Extends one class to create a subclass and optionally overrides members with the passed literal. This method * also adds the function "override()" to the subclass that can be used to override members of the class.

    * For example, to create a subclass of Ext GridPanel: *
    
    MyGridPanel = Ext.extend(Ext.grid.GridPanel, {
        constructor: function(config) {
    
    //      Create configuration for this Grid.
            var store = new Ext.data.Store({...});
            var colModel = new Ext.grid.ColumnModel({...});
    
    //      Create a new config object containing our computed properties
    //      *plus* whatever was in the config parameter.
            config = Ext.apply({
                store: store,
                colModel: colModel
            }, config);
    
            MyGridPanel.superclass.constructor.call(this, config);
    
    //      Your postprocessing here
        },
    
        yourMethod: function() {
            // etc.
        }
    });
    
    * *

    This function also supports a 3-argument call in which the subclass's constructor is * passed as an argument. In this form, the parameters are as follows:

    *
      *
    • subclass : Function
      The subclass constructor.
    • *
    • superclass : Function
      The constructor of class being extended
    • *
    • overrides : Object
      A literal with members which are copied into the subclass's * prototype, and are therefore shared among all instances of the new class.
    • *
    * * @param {Function} superclass The constructor of class being extended. * @param {Object} overrides

    A literal with members which are copied into the subclass's * prototype, and are therefore shared between all instances of the new class.

    *

    This may contain a special member named constructor. This is used * to define the constructor of the new class, and is returned. If this property is * not specified, a constructor is generated and returned which just calls the * superclass's constructor passing on its parameters.

    *

    It is essential that you call the superclass constructor in any provided constructor. See example code.

    * @return {Function} The subclass constructor from the overrides parameter, or a generated one if not provided. */ extend : function(){ // inline overrides var io = function(o){ for(var m in o){ this[m] = o[m]; } }; var oc = Object.prototype.constructor; return function(sb, sp, overrides){ if(typeof sp == 'object'){ overrides = sp; sp = sb; sb = overrides.constructor != oc ? overrides.constructor : function(){sp.apply(this, arguments);}; } var F = function(){}, sbp, spp = sp.prototype; F.prototype = spp; sbp = sb.prototype = new F(); sbp.constructor=sb; sb.superclass=spp; if(spp.constructor == oc){ spp.constructor=sp; } sb.override = function(o){ Ext.override(sb, o); }; sbp.superclass = sbp.supr = (function(){ return spp; }); sbp.override = io; Ext.override(sb, overrides); sb.extend = function(o){return Ext.extend(sb, o);}; return sb; }; }(), /** * Adds a list of functions to the prototype of an existing class, overwriting any existing methods with the same name. * Usage:
    
    Ext.override(MyClass, {
        newMethod1: function(){
            // etc.
        },
        newMethod2: function(foo){
            // etc.
        }
    });
    
    * @param {Object} origclass The class to override * @param {Object} overrides The list of functions to add to origClass. This should be specified as an object literal * containing one or more methods. * @method override */ override : function(origclass, overrides){ if(overrides){ var p = origclass.prototype; Ext.apply(p, overrides); if(Ext.isIE && overrides.hasOwnProperty('toString')){ p.toString = overrides.toString; } } }, /** * Creates namespaces to be used for scoping variables and classes so that they are not global. * Specifying the last node of a namespace implicitly creates all other nodes. Usage: *
    
    Ext.namespace('Company', 'Company.data');
    Ext.namespace('Company.data'); // equivalent and preferable to above syntax
    Company.Widget = function() { ... }
    Company.data.CustomStore = function(config) { ... }
    
    * @param {String} namespace1 * @param {String} namespace2 * @param {String} etc * @return {Object} The namespace object. (If multiple arguments are passed, this will be the last namespace created) * @method namespace */ namespace : function(){ var len1 = arguments.length, i = 0, len2, j, main, ns, sub, current; for(; i < len1; ++i) { main = arguments[i]; ns = arguments[i].split('.'); current = window[ns[0]]; if (current === undefined) { current = window[ns[0]] = {}; } sub = ns.slice(1); len2 = sub.length; for(j = 0; j < len2; ++j) { current = current[sub[j]] = current[sub[j]] || {}; } } return current; }, /** * Takes an object and converts it to an encoded URL. e.g. Ext.urlEncode({foo: 1, bar: 2}); would return "foo=1&bar=2". Optionally, property values can be arrays, instead of keys and the resulting string that's returned will contain a name/value pair for each array value. * @param {Object} o * @param {String} pre (optional) A prefix to add to the url encoded string * @return {String} */ urlEncode : function(o, pre){ var empty, buf = [], e = encodeURIComponent; Ext.iterate(o, function(key, item){ empty = Ext.isEmpty(item); Ext.each(empty ? key : item, function(val){ buf.push('&', e(key), '=', (!Ext.isEmpty(val) && (val != key || !empty)) ? (Ext.isDate(val) ? Ext.encode(val).replace(/"/g, '') : e(val)) : ''); }); }); if(!pre){ buf.shift(); pre = ''; } return pre + buf.join(''); }, /** * Takes an encoded URL and and converts it to an object. Example:
    
    Ext.urlDecode("foo=1&bar=2"); // returns {foo: "1", bar: "2"}
    Ext.urlDecode("foo=1&bar=2&bar=3&bar=4", false); // returns {foo: "1", bar: ["2", "3", "4"]}
    
    * @param {String} string * @param {Boolean} overwrite (optional) Items of the same name will overwrite previous values instead of creating an an array (Defaults to false). * @return {Object} A literal with members */ urlDecode : function(string, overwrite){ if(Ext.isEmpty(string)){ return {}; } var obj = {}, pairs = string.split('&'), d = decodeURIComponent, name, value; Ext.each(pairs, function(pair) { pair = pair.split('='); name = d(pair[0]); value = d(pair[1]); obj[name] = overwrite || !obj[name] ? value : [].concat(obj[name]).concat(value); }); return obj; }, /** * Appends content to the query string of a URL, handling logic for whether to place * a question mark or ampersand. * @param {String} url The URL to append to. * @param {String} s The content to append to the URL. * @return (String) The resulting URL */ urlAppend : function(url, s){ if(!Ext.isEmpty(s)){ return url + (url.indexOf('?') === -1 ? '?' : '&') + s; } return url; }, /** * Converts any iterable (numeric indices and a length property) into a true array * Don't use this on strings. IE doesn't support "abc"[0] which this implementation depends on. * For strings, use this instead: "abc".match(/./g) => [a,b,c]; * @param {Iterable} the iterable object to be turned into a true Array. * @return (Array) array */ toArray : function(){ return isIE ? function(a, i, j, res){ res = []; for(var x = 0, len = a.length; x < len; x++) { res.push(a[x]); } return res.slice(i || 0, j || res.length); } : function(a, i, j){ return Array.prototype.slice.call(a, i || 0, j || a.length); }; }(), isIterable : function(v){ //check for array or arguments if(Ext.isArray(v) || v.callee){ return true; } //check for node list type if(/NodeList|HTMLCollection/.test(toString.call(v))){ return true; } //NodeList has an item and length property //IXMLDOMNodeList has nextNode method, needs to be checked first. return ((typeof v.nextNode != 'undefined' || v.item) && Ext.isNumber(v.length)); }, /** * Iterates an array calling the supplied function. * @param {Array/NodeList/Mixed} array The array to be iterated. If this * argument is not really an array, the supplied function is called once. * @param {Function} fn The function to be called with each item. If the * supplied function returns false, iteration stops and this method returns * the current index. This function is called with * the following arguments: *
      *
    • item : Mixed *
      The item at the current index * in the passed array
    • *
    • index : Number *
      The current index within the array
    • *
    • allItems : Array *
      The array passed as the first * argument to Ext.each.
    • *
    * @param {Object} scope The scope (this reference) in which the specified function is executed. * Defaults to the item at the current index * within the passed array. * @return See description for the fn parameter. */ each : function(array, fn, scope){ if(Ext.isEmpty(array, true)){ return; } if(!Ext.isIterable(array) || Ext.isPrimitive(array)){ array = [array]; } for(var i = 0, len = array.length; i < len; i++){ if(fn.call(scope || array[i], array[i], i, array) === false){ return i; }; } }, /** * Iterates either the elements in an array, or each of the properties in an object. * Note: If you are only iterating arrays, it is better to call {@link #each}. * @param {Object/Array} object The object or array to be iterated * @param {Function} fn The function to be called for each iteration. * The iteration will stop if the supplied function returns false, or * all array elements / object properties have been covered. The signature * varies depending on the type of object being interated: *
      *
    • Arrays : (Object item, Number index, Array allItems) *
      * When iterating an array, the supplied function is called with each item.
    • *
    • Objects : (String key, Object value, Object) *
      * When iterating an object, the supplied function is called with each key-value pair in * the object, and the iterated object
    • *
    * @param {Object} scope The scope (this reference) in which the specified function is executed. Defaults to * the object being iterated. */ iterate : function(obj, fn, scope){ if(Ext.isEmpty(obj)){ return; } if(Ext.isIterable(obj)){ Ext.each(obj, fn, scope); return; }else if(typeof obj == 'object'){ for(var prop in obj){ if(obj.hasOwnProperty(prop)){ if(fn.call(scope || obj, prop, obj[prop], obj) === false){ return; }; } } } }, /** * Return the dom node for the passed String (id), dom node, or Ext.Element. * Optional 'strict' flag is needed for IE since it can return 'name' and * 'id' elements by using getElementById. * Here are some examples: *
    
    // gets dom node based on id
    var elDom = Ext.getDom('elId');
    // gets dom node based on the dom node
    var elDom1 = Ext.getDom(elDom);
    
    // If we don't know if we are working with an
    // Ext.Element or a dom node use Ext.getDom
    function(el){
        var dom = Ext.getDom(el);
        // do something with the dom node
    }
             * 
    * Note: the dom node to be found actually needs to exist (be rendered, etc) * when this method is called to be successful. * @param {Mixed} el * @return HTMLElement */ getDom : function(el, strict){ if(!el || !DOC){ return null; } if (el.dom){ return el.dom; } else { if (typeof el == 'string') { var e = DOC.getElementById(el); // IE returns elements with the 'name' and 'id' attribute. // we do a strict check to return the element with only the id attribute if (e && isIE && strict) { if (el == e.getAttribute('id')) { return e; } else { return null; } } return e; } else { return el; } } }, /** * Returns the current document body as an {@link Ext.Element}. * @return Ext.Element The document body */ getBody : function(){ return Ext.get(DOC.body || DOC.documentElement); }, /** * Returns the current document body as an {@link Ext.Element}. * @return Ext.Element The document body */ getHead : function() { var head; return function() { if (head == undefined) { head = Ext.get(DOC.getElementsByTagName("head")[0]); } return head; }; }(), /** * Removes a DOM node from the document. */ /** *

    Removes this element from the document, removes all DOM event listeners, and deletes the cache reference. * All DOM event listeners are removed from this element. If {@link Ext#enableNestedListenerRemoval} is * true, then DOM event listeners are also removed from all child nodes. The body node * will be ignored if passed in.

    * @param {HTMLElement} node The node to remove */ removeNode : isIE && !isIE8 ? function(){ var d; return function(n){ if(n && n.tagName != 'BODY'){ (Ext.enableNestedListenerRemoval) ? Ext.EventManager.purgeElement(n, true) : Ext.EventManager.removeAll(n); d = d || DOC.createElement('div'); d.appendChild(n); d.innerHTML = ''; delete Ext.elCache[n.id]; } }; }() : function(n){ if(n && n.parentNode && n.tagName != 'BODY'){ (Ext.enableNestedListenerRemoval) ? Ext.EventManager.purgeElement(n, true) : Ext.EventManager.removeAll(n); n.parentNode.removeChild(n); delete Ext.elCache[n.id]; } }, /** *

    Returns true if the passed value is empty.

    *

    The value is deemed to be empty if it is

      *
    • null
    • *
    • undefined
    • *
    • an empty array
    • *
    • a zero length string (Unless the allowBlank parameter is true)
    • *
    * @param {Mixed} value The value to test * @param {Boolean} allowBlank (optional) true to allow empty strings (defaults to false) * @return {Boolean} */ isEmpty : function(v, allowBlank){ return v === null || v === undefined || ((Ext.isArray(v) && !v.length)) || (!allowBlank ? v === '' : false); }, /** * Returns true if the passed value is a JavaScript array, otherwise false. * @param {Mixed} value The value to test * @return {Boolean} */ isArray : function(v){ return toString.apply(v) === '[object Array]'; }, /** * Returns true if the passed object is a JavaScript date object, otherwise false. * @param {Object} object The object to test * @return {Boolean} */ isDate : function(v){ return toString.apply(v) === '[object Date]'; }, /** * Returns true if the passed value is a JavaScript Object, otherwise false. * @param {Mixed} value The value to test * @return {Boolean} */ isObject : function(v){ return !!v && Object.prototype.toString.call(v) === '[object Object]'; }, /** * Returns true if the passed value is a JavaScript 'primitive', a string, number or boolean. * @param {Mixed} value The value to test * @return {Boolean} */ isPrimitive : function(v){ return Ext.isString(v) || Ext.isNumber(v) || Ext.isBoolean(v); }, /** * Returns true if the passed value is a JavaScript Function, otherwise false. * @param {Mixed} value The value to test * @return {Boolean} */ isFunction : function(v){ return toString.apply(v) === '[object Function]'; }, /** * Returns true if the passed value is a number. Returns false for non-finite numbers. * @param {Mixed} value The value to test * @return {Boolean} */ isNumber : function(v){ return typeof v === 'number' && isFinite(v); }, /** * Returns true if the passed value is a string. * @param {Mixed} value The value to test * @return {Boolean} */ isString : function(v){ return typeof v === 'string'; }, /** * Returns true if the passed value is a boolean. * @param {Mixed} value The value to test * @return {Boolean} */ isBoolean : function(v){ return typeof v === 'boolean'; }, /** * Returns true if the passed value is an HTMLElement * @param {Mixed} value The value to test * @return {Boolean} */ isElement : function(v) { return v ? !!v.tagName : false; }, /** * Returns true if the passed value is not undefined. * @param {Mixed} value The value to test * @return {Boolean} */ isDefined : function(v){ return typeof v !== 'undefined'; }, /** * True if the detected browser is Opera. * @type Boolean */ isOpera : isOpera, /** * True if the detected browser uses WebKit. * @type Boolean */ isWebKit : isWebKit, /** * True if the detected browser is Chrome. * @type Boolean */ isChrome : isChrome, /** * True if the detected browser is Safari. * @type Boolean */ isSafari : isSafari, /** * True if the detected browser is Safari 3.x. * @type Boolean */ isSafari3 : isSafari3, /** * True if the detected browser is Safari 4.x. * @type Boolean */ isSafari4 : isSafari4, /** * True if the detected browser is Safari 2.x. * @type Boolean */ isSafari2 : isSafari2, /** * True if the detected browser is Internet Explorer. * @type Boolean */ isIE : isIE, /** * True if the detected browser is Internet Explorer 6.x. * @type Boolean */ isIE6 : isIE6, /** * True if the detected browser is Internet Explorer 7.x. * @type Boolean */ isIE7 : isIE7, /** * True if the detected browser is Internet Explorer 8.x. * @type Boolean */ isIE8 : isIE8, /** * True if the detected browser is Internet Explorer 9.x. * @type Boolean */ isIE9 : isIE9, /** * True if the detected browser uses the Gecko layout engine (e.g. Mozilla, Firefox). * @type Boolean */ isGecko : isGecko, /** * True if the detected browser uses a pre-Gecko 1.9 layout engine (e.g. Firefox 2.x). * @type Boolean */ isGecko2 : isGecko2, /** * True if the detected browser uses a Gecko 1.9+ layout engine (e.g. Firefox 3.x). * @type Boolean */ isGecko3 : isGecko3, /** * True if the detected browser is Internet Explorer running in non-strict mode. * @type Boolean */ isBorderBox : isBorderBox, /** * True if the detected platform is Linux. * @type Boolean */ isLinux : isLinux, /** * True if the detected platform is Windows. * @type Boolean */ isWindows : isWindows, /** * True if the detected platform is Mac OS. * @type Boolean */ isMac : isMac, /** * True if the detected platform is Adobe Air. * @type Boolean */ isAir : isAir }); /** * Creates namespaces to be used for scoping variables and classes so that they are not global. * Specifying the last node of a namespace implicitly creates all other nodes. Usage: *
    
    Ext.namespace('Company', 'Company.data');
    Ext.namespace('Company.data'); // equivalent and preferable to above syntax
    Company.Widget = function() { ... }
    Company.data.CustomStore = function(config) { ... }
    
    * @param {String} namespace1 * @param {String} namespace2 * @param {String} etc * @return {Object} The namespace object. (If multiple arguments are passed, this will be the last namespace created) * @method ns */ Ext.ns = Ext.namespace; })(); Ext.ns('Ext.util', 'Ext.lib', 'Ext.data', 'Ext.supports'); Ext.elCache = {}; /** * @class Function * These functions are available on every Function object (any JavaScript function). */ Ext.apply(Function.prototype, { /** * Creates an interceptor function. The passed function is called before the original one. If it returns false, * the original one is not called. The resulting function returns the results of the original function. * The passed function is called with the parameters of the original function. Example usage: *
    
    var sayHi = function(name){
        alert('Hi, ' + name);
    }
    
    sayHi('Fred'); // alerts "Hi, Fred"
    
    // create a new function that validates input without
    // directly modifying the original function:
    var sayHiToFriend = sayHi.createInterceptor(function(name){
        return name == 'Brian';
    });
    
    sayHiToFriend('Fred');  // no alert
    sayHiToFriend('Brian'); // alerts "Hi, Brian"
    
    * @param {Function} fcn The function to call before the original * @param {Object} scope (optional) The scope (this reference) in which the passed function is executed. * If omitted, defaults to the scope in which the original function is called or the browser window. * @return {Function} The new function */ createInterceptor : function(fcn, scope){ var method = this; return !Ext.isFunction(fcn) ? this : function() { var me = this, args = arguments; fcn.target = me; fcn.method = method; return (fcn.apply(scope || me || window, args) !== false) ? method.apply(me || window, args) : null; }; }, /** * Creates a callback that passes arguments[0], arguments[1], arguments[2], ... * Call directly on any function. Example: myFunction.createCallback(arg1, arg2) * Will create a function that is bound to those 2 args. If a specific scope is required in the * callback, use {@link #createDelegate} instead. The function returned by createCallback always * executes in the window scope. *

    This method is required when you want to pass arguments to a callback function. If no arguments * are needed, you can simply pass a reference to the function as a callback (e.g., callback: myFn). * However, if you tried to pass a function with arguments (e.g., callback: myFn(arg1, arg2)) the function * would simply execute immediately when the code is parsed. Example usage: *

    
    var sayHi = function(name){
        alert('Hi, ' + name);
    }
    
    // clicking the button alerts "Hi, Fred"
    new Ext.Button({
        text: 'Say Hi',
        renderTo: Ext.getBody(),
        handler: sayHi.createCallback('Fred')
    });
    
    * @return {Function} The new function */ createCallback : function(/*args...*/){ // make args available, in function below var args = arguments, method = this; return function() { return method.apply(window, args); }; }, /** * Creates a delegate (callback) that sets the scope to obj. * Call directly on any function. Example: this.myFunction.createDelegate(this, [arg1, arg2]) * Will create a function that is automatically scoped to obj so that the this variable inside the * callback points to obj. Example usage: *
    
    var sayHi = function(name){
        // Note this use of "this.text" here.  This function expects to
        // execute within a scope that contains a text property.  In this
        // example, the "this" variable is pointing to the btn object that
        // was passed in createDelegate below.
        alert('Hi, ' + name + '. You clicked the "' + this.text + '" button.');
    }
    
    var btn = new Ext.Button({
        text: 'Say Hi',
        renderTo: Ext.getBody()
    });
    
    // This callback will execute in the scope of the
    // button instance. Clicking the button alerts
    // "Hi, Fred. You clicked the "Say Hi" button."
    btn.on('click', sayHi.createDelegate(btn, ['Fred']));
    
    * @param {Object} scope (optional) The scope (this reference) in which the function is executed. * If omitted, defaults to the browser window. * @param {Array} args (optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller) * @param {Boolean/Number} appendArgs (optional) if True args are appended to call args instead of overriding, * if a number the args are inserted at the specified position * @return {Function} The new function */ createDelegate : function(obj, args, appendArgs){ var method = this; return function() { var callArgs = args || arguments; if (appendArgs === true){ callArgs = Array.prototype.slice.call(arguments, 0); callArgs = callArgs.concat(args); }else if (Ext.isNumber(appendArgs)){ callArgs = Array.prototype.slice.call(arguments, 0); // copy arguments first var applyArgs = [appendArgs, 0].concat(args); // create method call params Array.prototype.splice.apply(callArgs, applyArgs); // splice them in } return method.apply(obj || window, callArgs); }; }, /** * Calls this function after the number of millseconds specified, optionally in a specific scope. Example usage: *
    
    var sayHi = function(name){
        alert('Hi, ' + name);
    }
    
    // executes immediately:
    sayHi('Fred');
    
    // executes after 2 seconds:
    sayHi.defer(2000, this, ['Fred']);
    
    // this syntax is sometimes useful for deferring
    // execution of an anonymous function:
    (function(){
        alert('Anonymous');
    }).defer(100);
    
    * @param {Number} millis The number of milliseconds for the setTimeout call (if less than or equal to 0 the function is executed immediately) * @param {Object} scope (optional) The scope (this reference) in which the function is executed. * If omitted, defaults to the browser window. * @param {Array} args (optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller) * @param {Boolean/Number} appendArgs (optional) if True args are appended to call args instead of overriding, * if a number the args are inserted at the specified position * @return {Number} The timeout id that can be used with clearTimeout */ defer : function(millis, obj, args, appendArgs){ var fn = this.createDelegate(obj, args, appendArgs); if(millis > 0){ return setTimeout(fn, millis); } fn(); return 0; } }); /** * @class String * These functions are available on every String object. */ Ext.applyIf(String, { /** * Allows you to define a tokenized string and pass an arbitrary number of arguments to replace the tokens. Each * token must be unique, and must increment in the format {0}, {1}, etc. Example usage: *
    
    var cls = 'my-class', text = 'Some text';
    var s = String.format('<div class="{0}">{1}</div>', cls, text);
    // s now contains the string: '<div class="my-class">Some text</div>'
         * 
    * @param {String} string The tokenized string to be formatted * @param {String} value1 The value to replace token {0} * @param {String} value2 Etc... * @return {String} The formatted string * @static */ format : function(format){ var args = Ext.toArray(arguments, 1); return format.replace(/\{(\d+)\}/g, function(m, i){ return args[i]; }); } }); /** * @class Array */ Ext.applyIf(Array.prototype, { /** * Checks whether or not the specified object exists in the array. * @param {Object} o The object to check for * @param {Number} from (Optional) The index at which to begin the search * @return {Number} The index of o in the array (or -1 if it is not found) */ indexOf : function(o, from){ var len = this.length; from = from || 0; from += (from < 0) ? len : 0; for (; from < len; ++from){ if(this[from] === o){ return from; } } return -1; }, /** * Removes the specified object from the array. If the object is not found nothing happens. * @param {Object} o The object to remove * @return {Array} this array */ remove : function(o){ var index = this.indexOf(o); if(index != -1){ this.splice(index, 1); } return this; } }); /** * @class Ext.util.TaskRunner * Provides the ability to execute one or more arbitrary tasks in a multithreaded * manner. Generally, you can use the singleton {@link Ext.TaskMgr} instead, but * if needed, you can create separate instances of TaskRunner. Any number of * separate tasks can be started at any time and will run independently of each * other. Example usage: *
    
    // Start a simple clock task that updates a div once per second
    var updateClock = function(){
        Ext.fly('clock').update(new Date().format('g:i:s A'));
    } 
    var task = {
        run: updateClock,
        interval: 1000 //1 second
    }
    var runner = new Ext.util.TaskRunner();
    runner.start(task);
    
    // equivalent using TaskMgr
    Ext.TaskMgr.start({
        run: updateClock,
        interval: 1000
    });
    
     * 
    *

    See the {@link #start} method for details about how to configure a task object.

    * Also see {@link Ext.util.DelayedTask}. * * @constructor * @param {Number} interval (optional) The minimum precision in milliseconds supported by this TaskRunner instance * (defaults to 10) */ Ext.util.TaskRunner = function(interval){ interval = interval || 10; var tasks = [], removeQueue = [], id = 0, running = false, // private stopThread = function(){ running = false; clearInterval(id); id = 0; }, // private startThread = function(){ if(!running){ running = true; id = setInterval(runTasks, interval); } }, // private removeTask = function(t){ removeQueue.push(t); if(t.onStop){ t.onStop.apply(t.scope || t); } }, // private runTasks = function(){ var rqLen = removeQueue.length, now = new Date().getTime(); if(rqLen > 0){ for(var i = 0; i < rqLen; i++){ tasks.remove(removeQueue[i]); } removeQueue = []; if(tasks.length < 1){ stopThread(); return; } } for(var i = 0, t, itime, rt, len = tasks.length; i < len; ++i){ t = tasks[i]; itime = now - t.taskRunTime; if(t.interval <= itime){ rt = t.run.apply(t.scope || t, t.args || [++t.taskRunCount]); t.taskRunTime = now; if(rt === false || t.taskRunCount === t.repeat){ removeTask(t); return; } } if(t.duration && t.duration <= (now - t.taskStartTime)){ removeTask(t); } } }; /** * Starts a new task. * @method start * @param {Object} task

    A config object that supports the following properties:

      *
    • run : Function

      The function to execute each time the task is invoked. The * function will be called at each interval and passed the args argument if specified, and the * current invocation count if not.

      *

      If a particular scope (this reference) is required, be sure to specify it using the scope argument.

      *

      Return false from this function to terminate the task.

    • *
    • interval : Number
      The frequency in milliseconds with which the task * should be invoked.
    • *
    • args : Array
      (optional) An array of arguments to be passed to the function * specified by run. If not specified, the current invocation count is passed.
    • *
    • scope : Object
      (optional) The scope (this reference) in which to execute the * run function. Defaults to the task config object.
    • *
    • duration : Number
      (optional) The length of time in milliseconds to invoke * the task before stopping automatically (defaults to indefinite).
    • *
    • repeat : Number
      (optional) The number of times to invoke the task before * stopping automatically (defaults to indefinite).
    • *

    *

    Before each invocation, Ext injects the property taskRunCount into the task object so * that calculations based on the repeat count can be performed.

    * @return {Object} The task */ this.start = function(task){ tasks.push(task); task.taskStartTime = new Date().getTime(); task.taskRunTime = 0; task.taskRunCount = 0; startThread(); return task; }; /** * Stops an existing running task. * @method stop * @param {Object} task The task to stop * @return {Object} The task */ this.stop = function(task){ removeTask(task); return task; }; /** * Stops all tasks that are currently running. * @method stopAll */ this.stopAll = function(){ stopThread(); for(var i = 0, len = tasks.length; i < len; i++){ if(tasks[i].onStop){ tasks[i].onStop(); } } tasks = []; removeQueue = []; }; }; /** * @class Ext.TaskMgr * @extends Ext.util.TaskRunner * A static {@link Ext.util.TaskRunner} instance that can be used to start and stop arbitrary tasks. See * {@link Ext.util.TaskRunner} for supported methods and task config properties. *
    
    // Start a simple clock task that updates a div once per second
    var task = {
        run: function(){
            Ext.fly('clock').update(new Date().format('g:i:s A'));
        },
        interval: 1000 //1 second
    }
    Ext.TaskMgr.start(task);
    
    *

    See the {@link #start} method for details about how to configure a task object.

    * @singleton */ Ext.TaskMgr = new Ext.util.TaskRunner();(function(){ var libFlyweight, version = Prototype.Version.split('.'), mouseEnterSupported = (parseInt(version[0], 10) >= 2) || (parseInt(version[1], 10) >= 7) || (parseInt(version[2], 10) >= 1), mouseCache = {}, elContains = function(parent, child) { if(parent && parent.firstChild){ while(child) { if(child === parent) { return true; } child = child.parentNode; if(child && (child.nodeType != 1)) { child = null; } } } return false; }, checkRelatedTarget = function(e) { return !elContains(e.currentTarget, Ext.lib.Event.getRelatedTarget(e)); }; Ext.lib.Dom = { getViewWidth : function(full){ return full ? this.getDocumentWidth() : this.getViewportWidth(); }, getViewHeight : function(full){ return full ? this.getDocumentHeight() : this.getViewportHeight(); }, getDocumentHeight: function() { // missing from prototype? var scrollHeight = (document.compatMode != "CSS1Compat") ? document.body.scrollHeight : document.documentElement.scrollHeight; return Math.max(scrollHeight, this.getViewportHeight()); }, getDocumentWidth: function() { // missing from prototype? var scrollWidth = (document.compatMode != "CSS1Compat") ? document.body.scrollWidth : document.documentElement.scrollWidth; return Math.max(scrollWidth, this.getViewportWidth()); }, getViewportHeight: function() { // missing from prototype? var height = self.innerHeight; var mode = document.compatMode; if ( (mode || Ext.isIE) && !Ext.isOpera ) { height = (mode == "CSS1Compat") ? document.documentElement.clientHeight : // Standards document.body.clientHeight; // Quirks } return height; }, getViewportWidth: function() { // missing from prototype? var width = self.innerWidth; // Safari var mode = document.compatMode; if (mode || Ext.isIE) { // IE, Gecko, Opera width = (mode == "CSS1Compat") ? document.documentElement.clientWidth : // Standards document.body.clientWidth; // Quirks } return width; }, isAncestor : function(p, c){ // missing from prototype? var ret = false; p = Ext.getDom(p); c = Ext.getDom(c); if (p && c) { if (p.contains) { return p.contains(c); } else if (p.compareDocumentPosition) { return !!(p.compareDocumentPosition(c) & 16); } else { while (c = c.parentNode) { ret = c == p || ret; } } } return ret; }, getRegion : function(el){ return Ext.lib.Region.getRegion(el); }, getY : function(el){ return this.getXY(el)[1]; }, getX : function(el){ return this.getXY(el)[0]; }, getXY : function(el){ // this initially used Position.cumulativeOffset but it is not accurate enough var p, pe, b, scroll, bd = (document.body || document.documentElement); el = Ext.getDom(el); if(el == bd){ return [0, 0]; } if (el.getBoundingClientRect) { b = el.getBoundingClientRect(); scroll = fly(document).getScroll(); return [Math.round(b.left + scroll.left), Math.round(b.top + scroll.top)]; } var x = 0, y = 0; p = el; var hasAbsolute = fly(el).getStyle("position") == "absolute"; while (p) { x += p.offsetLeft; y += p.offsetTop; if (!hasAbsolute && fly(p).getStyle("position") == "absolute") { hasAbsolute = true; } if (Ext.isGecko) { pe = fly(p); var bt = parseInt(pe.getStyle("borderTopWidth"), 10) || 0; var bl = parseInt(pe.getStyle("borderLeftWidth"), 10) || 0; x += bl; y += bt; if (p != el && pe.getStyle('overflow') != 'visible') { x += bl; y += bt; } } p = p.offsetParent; } if (Ext.isSafari && hasAbsolute) { x -= bd.offsetLeft; y -= bd.offsetTop; } if (Ext.isGecko && !hasAbsolute) { var dbd = fly(bd); x += parseInt(dbd.getStyle("borderLeftWidth"), 10) || 0; y += parseInt(dbd.getStyle("borderTopWidth"), 10) || 0; } p = el.parentNode; while (p && p != bd) { if (!Ext.isOpera || (p.tagName != 'TR' && fly(p).getStyle("display") != "inline")) { x -= p.scrollLeft; y -= p.scrollTop; } p = p.parentNode; } return [x, y]; }, setXY : function(el, xy){ // this initially used Position.cumulativeOffset but it is not accurate enough el = Ext.fly(el, '_setXY'); el.position(); var pts = el.translatePoints(xy); if(xy[0] !== false){ el.dom.style.left = pts.left + "px"; } if(xy[1] !== false){ el.dom.style.top = pts.top + "px"; } }, setX : function(el, x){ this.setXY(el, [x, false]); }, setY : function(el, y){ this.setXY(el, [false, y]); } }; Ext.lib.Event = { getPageX : function(e){ return Event.pointerX(e.browserEvent || e); }, getPageY : function(e){ return Event.pointerY(e.browserEvent || e); }, getXY : function(e){ e = e.browserEvent || e; return [Event.pointerX(e), Event.pointerY(e)]; }, getTarget : function(e){ return Event.element(e.browserEvent || e); }, resolveTextNode: Ext.isGecko ? function(node){ if(!node){ return; } var s = HTMLElement.prototype.toString.call(node); if(s == '[xpconnect wrapped native prototype]' || s == '[object XULElement]'){ return; } return node.nodeType == 3 ? node.parentNode : node; } : function(node){ return node && node.nodeType == 3 ? node.parentNode : node; }, getRelatedTarget: function(ev) { // missing from prototype? ev = ev.browserEvent || ev; var t = ev.relatedTarget; if (!t) { if (ev.type == "mouseout") { t = ev.toElement; } else if (ev.type == "mouseover") { t = ev.fromElement; } } return this.resolveTextNode(t); }, on : function(el, eventName, fn){ if((eventName == 'mouseenter' || eventName == 'mouseleave') && !mouseEnterSupported){ var item = mouseCache[el.id] || (mouseCache[el.id] = {}); item[eventName] = fn; fn = fn.createInterceptor(checkRelatedTarget); eventName = (eventName == 'mouseenter') ? 'mouseover' : 'mouseout'; } Event.observe(el, eventName, fn, false); }, un : function(el, eventName, fn){ if((eventName == 'mouseenter' || eventName == 'mouseleave') && !mouseEnterSupported){ var item = mouseCache[el.id], ev = item && item[eventName]; if(ev){ fn = ev.fn; delete item[eventName]; eventName = (eventName == 'mouseenter') ? 'mouseover' : 'mouseout'; } } Event.stopObserving(el, eventName, fn, false); }, purgeElement : function(el){ // no equiv? }, preventDefault : function(e){ // missing from prototype? e = e.browserEvent || e; if(e.preventDefault) { e.preventDefault(); } else { e.returnValue = false; } }, stopPropagation : function(e){ // missing from prototype? e = e.browserEvent || e; if(e.stopPropagation) { e.stopPropagation(); } else { e.cancelBubble = true; } }, stopEvent : function(e){ Event.stop(e.browserEvent || e); }, onAvailable : function(id, fn, scope){ // no equiv var start = new Date(), iid; var f = function(){ if(start.getElapsed() > 10000){ clearInterval(iid); } var el = document.getElementById(id); if(el){ clearInterval(iid); fn.call(scope||window, el); } }; iid = setInterval(f, 50); } }; Ext.lib.Ajax = function(){ var createSuccess = function(cb){ return cb.success ? function(xhr){ cb.success.call(cb.scope||window, createResponse(cb, xhr)); } : Ext.emptyFn; }; var createFailure = function(cb){ return cb.failure ? function(xhr){ cb.failure.call(cb.scope||window, createResponse(cb, xhr)); } : Ext.emptyFn; }; var createResponse = function(cb, xhr){ var headerObj = {}, headerStr, t, s; try { headerStr = xhr.getAllResponseHeaders(); Ext.each(headerStr.replace(/\r\n/g, '\n').split('\n'), function(v){ t = v.indexOf(':'); if(t >= 0){ s = v.substr(0, t).toLowerCase(); if(v.charAt(t + 1) == ' '){ ++t; } headerObj[s] = v.substr(t + 1); } }); } catch(e) {} return { responseText: xhr.responseText, responseXML : xhr.responseXML, argument: cb.argument, status: xhr.status, statusText: xhr.statusText, getResponseHeader : function(header){ return headerObj[header.toLowerCase()]; }, getAllResponseHeaders : function(){ return headerStr; } }; }; return { request : function(method, uri, cb, data, options){ var o = { method: method, parameters: data || '', timeout: cb.timeout, onSuccess: createSuccess(cb), onFailure: createFailure(cb) }; if(options){ var hs = options.headers; if(hs){ o.requestHeaders = hs; } if(options.xmlData){ method = (method ? method : (options.method ? options.method : 'POST')); if (!hs || !hs['Content-Type']){ o.contentType = 'text/xml'; } o.postBody = options.xmlData; delete o.parameters; } if(options.jsonData){ method = (method ? method : (options.method ? options.method : 'POST')); if (!hs || !hs['Content-Type']){ o.contentType = 'application/json'; } o.postBody = typeof options.jsonData == 'object' ? Ext.encode(options.jsonData) : options.jsonData; delete o.parameters; } } new Ajax.Request(uri, o); }, formRequest : function(form, uri, cb, data, isUpload, sslUri){ new Ajax.Request(uri, { method: Ext.getDom(form).method ||'POST', parameters: Form.serialize(form)+(data?'&'+data:''), timeout: cb.timeout, onSuccess: createSuccess(cb), onFailure: createFailure(cb) }); }, isCallInProgress : function(trans){ return false; }, abort : function(trans){ return false; }, serializeForm : function(form){ return Form.serialize(form.dom||form); } }; }(); Ext.lib.Anim = function(){ var easings = { easeOut: function(pos) { return 1-Math.pow(1-pos,2); }, easeIn: function(pos) { return 1-Math.pow(1-pos,2); } }; var createAnim = function(cb, scope){ return { stop : function(skipToLast){ this.effect.cancel(); }, isAnimated : function(){ return this.effect.state == 'running'; }, proxyCallback : function(){ Ext.callback(cb, scope); } }; }; return { scroll : function(el, args, duration, easing, cb, scope){ // not supported so scroll immediately? var anim = createAnim(cb, scope); el = Ext.getDom(el); if(typeof args.scroll.to[0] == 'number'){ el.scrollLeft = args.scroll.to[0]; } if(typeof args.scroll.to[1] == 'number'){ el.scrollTop = args.scroll.to[1]; } anim.proxyCallback(); return anim; }, motion : function(el, args, duration, easing, cb, scope){ return this.run(el, args, duration, easing, cb, scope); }, color : function(el, args, duration, easing, cb, scope){ return this.run(el, args, duration, easing, cb, scope); }, run : function(el, args, duration, easing, cb, scope, type){ var o = {}; for(var k in args){ switch(k){ // scriptaculous doesn't support, so convert these case 'points': var by, pts, e = Ext.fly(el, '_animrun'); e.position(); if(by = args.points.by){ var xy = e.getXY(); pts = e.translatePoints([xy[0]+by[0], xy[1]+by[1]]); }else{ pts = e.translatePoints(args.points.to); } o.left = pts.left+'px'; o.top = pts.top+'px'; break; case 'width': o.width = args.width.to+'px'; break; case 'height': o.height = args.height.to+'px'; break; case 'opacity': o.opacity = String(args.opacity.to); break; default: o[k] = String(args[k].to); break; } } var anim = createAnim(cb, scope); anim.effect = new Effect.Morph(Ext.id(el), { duration: duration, afterFinish: anim.proxyCallback, transition: easings[easing] || Effect.Transitions.linear, style: o }); return anim; } }; }(); // all lib flyweight calls use their own flyweight to prevent collisions with developer flyweights function fly(el){ if(!libFlyweight){ libFlyweight = new Ext.Element.Flyweight(); } libFlyweight.dom = el; return libFlyweight; } Ext.lib.Region = function(t, r, b, l) { this.top = t; this[1] = t; this.right = r; this.bottom = b; this.left = l; this[0] = l; }; Ext.lib.Region.prototype = { contains : function(region) { return ( region.left >= this.left && region.right <= this.right && region.top >= this.top && region.bottom <= this.bottom ); }, getArea : function() { return ( (this.bottom - this.top) * (this.right - this.left) ); }, intersect : function(region) { var t = Math.max( this.top, region.top ); var r = Math.min( this.right, region.right ); var b = Math.min( this.bottom, region.bottom ); var l = Math.max( this.left, region.left ); if (b >= t && r >= l) { return new Ext.lib.Region(t, r, b, l); } else { return null; } }, union : function(region) { var t = Math.min( this.top, region.top ); var r = Math.max( this.right, region.right ); var b = Math.max( this.bottom, region.bottom ); var l = Math.min( this.left, region.left ); return new Ext.lib.Region(t, r, b, l); }, constrainTo : function(r) { this.top = this.top.constrain(r.top, r.bottom); this.bottom = this.bottom.constrain(r.top, r.bottom); this.left = this.left.constrain(r.left, r.right); this.right = this.right.constrain(r.left, r.right); return this; }, adjust : function(t, l, b, r){ this.top += t; this.left += l; this.right += r; this.bottom += b; return this; } }; Ext.lib.Region.getRegion = function(el) { var p = Ext.lib.Dom.getXY(el); var t = p[1]; var r = p[0] + el.offsetWidth; var b = p[1] + el.offsetHeight; var l = p[0]; return new Ext.lib.Region(t, r, b, l); }; Ext.lib.Point = function(x, y) { if (Ext.isArray(x)) { y = x[1]; x = x[0]; } this.x = this.right = this.left = this[0] = x; this.y = this.top = this.bottom = this[1] = y; }; Ext.lib.Point.prototype = new Ext.lib.Region(); // prevent IE leaks if(Ext.isIE) { function fnCleanUp() { var p = Function.prototype; delete p.createSequence; delete p.defer; delete p.createDelegate; delete p.createCallback; delete p.createInterceptor; window.detachEvent("onunload", fnCleanUp); } window.attachEvent("onunload", fnCleanUp); } })();glpi-0.84.3+dfsg.1/lib/extjs/adapter/prototype/ext-prototype-adapter.js000066400000000000000000000402731226600447100260360ustar00rootroot00000000000000/* * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ window.undefined=window.undefined;Ext={version:"3.4.0",versionDetail:{major:3,minor:4,patch:0}};Ext.apply=function(d,e,b){if(b){Ext.apply(d,b)}if(d&&e&&typeof e=="object"){for(var a in e){d[a]=e[a]}}return d};(function(){var g=0,u=Object.prototype.toString,v=navigator.userAgent.toLowerCase(),A=function(e){return e.test(v)},i=document,n=i.documentMode,l=i.compatMode=="CSS1Compat",C=A(/opera/),h=A(/\bchrome\b/),w=A(/webkit/),z=!h&&A(/safari/),f=z&&A(/applewebkit\/4/),b=z&&A(/version\/3/),D=z&&A(/version\/4/),t=!C&&A(/msie/),r=t&&(A(/msie 7/)||n==7),q=t&&(A(/msie 8/)&&n!=7),p=t&&A(/msie 9/),s=t&&!r&&!q&&!p,o=!w&&A(/gecko/),d=o&&A(/rv:1\.8/),a=o&&A(/rv:1\.9/),x=t&&!l,B=A(/windows|win32/),k=A(/macintosh|mac os x/),j=A(/adobeair/),m=A(/linux/),c=/^https/i.test(window.location.protocol);if(s){try{i.execCommand("BackgroundImageCache",false,true)}catch(y){}}Ext.apply(Ext,{SSL_SECURE_URL:c&&t?'javascript:""':"about:blank",isStrict:l,isSecure:c,isReady:false,enableForcedBoxModel:false,enableGarbageCollector:true,enableListenerCollection:false,enableNestedListenerRemoval:false,USE_NATIVE_JSON:false,applyIf:function(E,F){if(E){for(var e in F){if(!Ext.isDefined(E[e])){E[e]=F[e]}}}return E},id:function(e,E){e=Ext.getDom(e,true)||{};if(!e.id){e.id=(E||"ext-gen")+(++g)}return e.id},extend:function(){var E=function(G){for(var F in G){this[F]=G[F]}};var e=Object.prototype.constructor;return function(L,I,K){if(typeof I=="object"){K=I;I=L;L=K.constructor!=e?K.constructor:function(){I.apply(this,arguments)}}var H=function(){},J,G=I.prototype;H.prototype=G;J=L.prototype=new H();J.constructor=L;L.superclass=G;if(G.constructor==e){G.constructor=I}L.override=function(F){Ext.override(L,F)};J.superclass=J.supr=(function(){return G});J.override=E;Ext.override(L,K);L.extend=function(F){return Ext.extend(L,F)};return L}}(),override:function(e,F){if(F){var E=e.prototype;Ext.apply(E,F);if(Ext.isIE&&F.hasOwnProperty("toString")){E.toString=F.toString}}},namespace:function(){var G=arguments.length,H=0,E,F,e,J,I,K;for(;H0){return setTimeout(d,c)}d();return 0}});Ext.applyIf(String,{format:function(b){var a=Ext.toArray(arguments,1);return b.replace(/\{(\d+)\}/g,function(c,d){return a[d]})}});Ext.applyIf(Array.prototype,{indexOf:function(b,c){var a=this.length;c=c||0;c+=(c<0)?a:0;for(;c0){for(var p=0;p=2)||(parseInt(a[1],10)>=7)||(parseInt(a[2],10)>=1),g={},d=function(i,j){if(i&&i.firstChild){while(j){if(j===i){return true}j=j.parentNode;if(j&&(j.nodeType!=1)){j=null}}}return false},b=function(i){return !d(i.currentTarget,Ext.lib.Event.getRelatedTarget(i))};Ext.lib.Dom={getViewWidth:function(i){return i?this.getDocumentWidth():this.getViewportWidth()},getViewHeight:function(i){return i?this.getDocumentHeight():this.getViewportHeight()},getDocumentHeight:function(){var i=(document.compatMode!="CSS1Compat")?document.body.scrollHeight:document.documentElement.scrollHeight;return Math.max(i,this.getViewportHeight())},getDocumentWidth:function(){var i=(document.compatMode!="CSS1Compat")?document.body.scrollWidth:document.documentElement.scrollWidth;return Math.max(i,this.getViewportWidth())},getViewportHeight:function(){var i=self.innerHeight;var j=document.compatMode;if((j||Ext.isIE)&&!Ext.isOpera){i=(j=="CSS1Compat")?document.documentElement.clientHeight:document.body.clientHeight}return i},getViewportWidth:function(){var i=self.innerWidth;var j=document.compatMode;if(j||Ext.isIE){i=(j=="CSS1Compat")?document.documentElement.clientWidth:document.body.clientWidth}return i},isAncestor:function(j,k){var i=false;j=Ext.getDom(j);k=Ext.getDom(k);if(j&&k){if(j.contains){return j.contains(k)}else{if(j.compareDocumentPosition){return !!(j.compareDocumentPosition(k)&16)}else{while(k=k.parentNode){i=k==j||i}}}}return i},getRegion:function(i){return Ext.lib.Region.getRegion(i)},getY:function(i){return this.getXY(i)[1]},getX:function(i){return this.getXY(i)[0]},getXY:function(k){var j,o,r,s,n=(document.body||document.documentElement);k=Ext.getDom(k);if(k==n){return[0,0]}if(k.getBoundingClientRect){r=k.getBoundingClientRect();s=f(document).getScroll();return[Math.round(r.left+s.left),Math.round(r.top+s.top)]}var t=0,q=0;j=k;var i=f(k).getStyle("position")=="absolute";while(j){t+=j.offsetLeft;q+=j.offsetTop;if(!i&&f(j).getStyle("position")=="absolute"){i=true}if(Ext.isGecko){o=f(j);var u=parseInt(o.getStyle("borderTopWidth"),10)||0;var l=parseInt(o.getStyle("borderLeftWidth"),10)||0;t+=l;q+=u;if(j!=k&&o.getStyle("overflow")!="visible"){t+=l;q+=u}}j=j.offsetParent}if(Ext.isSafari&&i){t-=n.offsetLeft;q-=n.offsetTop}if(Ext.isGecko&&!i){var m=f(n);t+=parseInt(m.getStyle("borderLeftWidth"),10)||0;q+=parseInt(m.getStyle("borderTopWidth"),10)||0}j=k.parentNode;while(j&&j!=n){if(!Ext.isOpera||(j.tagName!="TR"&&f(j).getStyle("display")!="inline")){t-=j.scrollLeft;q-=j.scrollTop}j=j.parentNode}return[t,q]},setXY:function(i,j){i=Ext.fly(i,"_setXY");i.position();var k=i.translatePoints(j);if(j[0]!==false){i.dom.style.left=k.left+"px"}if(j[1]!==false){i.dom.style.top=k.top+"px"}},setX:function(j,i){this.setXY(j,[i,false])},setY:function(i,j){this.setXY(i,[false,j])}};Ext.lib.Event={getPageX:function(i){return Event.pointerX(i.browserEvent||i)},getPageY:function(i){return Event.pointerY(i.browserEvent||i)},getXY:function(i){i=i.browserEvent||i;return[Event.pointerX(i),Event.pointerY(i)]},getTarget:function(i){return Event.element(i.browserEvent||i)},resolveTextNode:Ext.isGecko?function(j){if(!j){return}var i=HTMLElement.prototype.toString.call(j);if(i=="[xpconnect wrapped native prototype]"||i=="[object XULElement]"){return}return j.nodeType==3?j.parentNode:j}:function(i){return i&&i.nodeType==3?i.parentNode:i},getRelatedTarget:function(j){j=j.browserEvent||j;var i=j.relatedTarget;if(!i){if(j.type=="mouseout"){i=j.toElement}else{if(j.type=="mouseover"){i=j.fromElement}}}return this.resolveTextNode(i)},on:function(k,i,j){if((i=="mouseenter"||i=="mouseleave")&&!h){var l=g[k.id]||(g[k.id]={});l[i]=j;j=j.createInterceptor(b);i=(i=="mouseenter")?"mouseover":"mouseout"}Event.observe(k,i,j,false)},un:function(k,i,j){if((i=="mouseenter"||i=="mouseleave")&&!h){var m=g[k.id],l=m&&m[i];if(l){j=l.fn;delete m[i];i=(i=="mouseenter")?"mouseover":"mouseout"}}Event.stopObserving(k,i,j,false)},purgeElement:function(i){},preventDefault:function(i){i=i.browserEvent||i;if(i.preventDefault){i.preventDefault()}else{i.returnValue=false}},stopPropagation:function(i){i=i.browserEvent||i;if(i.stopPropagation){i.stopPropagation()}else{i.cancelBubble=true}},stopEvent:function(i){Event.stop(i.browserEvent||i)},onAvailable:function(n,j,i){var m=new Date(),l;var k=function(){if(m.getElapsed()>10000){clearInterval(l)}var o=document.getElementById(n);if(o){clearInterval(l);j.call(i||window,o)}};l=setInterval(k,50)}};Ext.lib.Ajax=function(){var k=function(l){return l.success?function(m){l.success.call(l.scope||window,i(l,m))}:Ext.emptyFn};var j=function(l){return l.failure?function(m){l.failure.call(l.scope||window,i(l,m))}:Ext.emptyFn};var i=function(l,r){var n={},p,m,o;try{p=r.getAllResponseHeaders();Ext.each(p.replace(/\r\n/g,"\n").split("\n"),function(s){m=s.indexOf(":");if(m>=0){o=s.substr(0,m).toLowerCase();if(s.charAt(m+1)==" "){++m}n[o]=s.substr(m+1)}})}catch(q){}return{responseText:r.responseText,responseXML:r.responseXML,argument:l.argument,status:r.status,statusText:r.statusText,getResponseHeader:function(s){return n[s.toLowerCase()]},getAllResponseHeaders:function(){return p}}};return{request:function(s,p,l,q,m){var r={method:s,parameters:q||"",timeout:l.timeout,onSuccess:k(l),onFailure:j(l)};if(m){var n=m.headers;if(n){r.requestHeaders=n}if(m.xmlData){s=(s?s:(m.method?m.method:"POST"));if(!n||!n["Content-Type"]){r.contentType="text/xml"}r.postBody=m.xmlData;delete r.parameters}if(m.jsonData){s=(s?s:(m.method?m.method:"POST"));if(!n||!n["Content-Type"]){r.contentType="application/json"}r.postBody=typeof m.jsonData=="object"?Ext.encode(m.jsonData):m.jsonData;delete r.parameters}}new Ajax.Request(p,r)},formRequest:function(p,o,m,q,l,n){new Ajax.Request(o,{method:Ext.getDom(p).method||"POST",parameters:Form.serialize(p)+(q?"&"+q:""),timeout:m.timeout,onSuccess:k(m),onFailure:j(m)})},isCallInProgress:function(l){return false},abort:function(l){return false},serializeForm:function(l){return Form.serialize(l.dom||l)}}}();Ext.lib.Anim=function(){var i={easeOut:function(k){return 1-Math.pow(1-k,2)},easeIn:function(k){return 1-Math.pow(1-k,2)}};var j=function(k,l){return{stop:function(m){this.effect.cancel()},isAnimated:function(){return this.effect.state=="running"},proxyCallback:function(){Ext.callback(k,l)}}};return{scroll:function(n,l,p,q,k,m){var o=j(k,m);n=Ext.getDom(n);if(typeof l.scroll.to[0]=="number"){n.scrollLeft=l.scroll.to[0]}if(typeof l.scroll.to[1]=="number"){n.scrollTop=l.scroll.to[1]}o.proxyCallback();return o},motion:function(n,l,o,p,k,m){return this.run(n,l,o,p,k,m)},color:function(n,l,o,p,k,m){return this.run(n,l,o,p,k,m)},run:function(m,v,r,u,n,x,w){var l={};for(var q in v){switch(q){case"points":var t,z,s=Ext.fly(m,"_animrun");s.position();if(t=v.points.by){var y=s.getXY();z=s.translatePoints([y[0]+t[0],y[1]+t[1]])}else{z=s.translatePoints(v.points.to)}l.left=z.left+"px";l.top=z.top+"px";break;case"width":l.width=v.width.to+"px";break;case"height":l.height=v.height.to+"px";break;case"opacity":l.opacity=String(v.opacity.to);break;default:l[q]=String(v[q].to);break}}var p=j(n,x);p.effect=new Effect.Morph(Ext.id(m),{duration:r,afterFinish:p.proxyCallback,transition:i[u]||Effect.Transitions.linear,style:l});return p}}}();function f(i){if(!e){e=new Ext.Element.Flyweight()}e.dom=i;return e}Ext.lib.Region=function(k,m,i,j){this.top=k;this[1]=k;this.right=m;this.bottom=i;this.left=j;this[0]=j};Ext.lib.Region.prototype={contains:function(i){return(i.left>=this.left&&i.right<=this.right&&i.top>=this.top&&i.bottom<=this.bottom)},getArea:function(){return((this.bottom-this.top)*(this.right-this.left))},intersect:function(n){var k=Math.max(this.top,n.top);var m=Math.min(this.right,n.right);var i=Math.min(this.bottom,n.bottom);var j=Math.max(this.left,n.left);if(i>=k&&m>=j){return new Ext.lib.Region(k,m,i,j)}else{return null}},union:function(n){var k=Math.min(this.top,n.top);var m=Math.max(this.right,n.right);var i=Math.max(this.bottom,n.bottom);var j=Math.min(this.left,n.left);return new Ext.lib.Region(k,m,i,j)},constrainTo:function(i){this.top=this.top.constrain(i.top,i.bottom);this.bottom=this.bottom.constrain(i.top,i.bottom);this.left=this.left.constrain(i.left,i.right);this.right=this.right.constrain(i.left,i.right);return this},adjust:function(k,j,i,m){this.top+=k;this.left+=j;this.right+=m;this.bottom+=i;return this}};Ext.lib.Region.getRegion=function(m){var o=Ext.lib.Dom.getXY(m);var k=o[1];var n=o[0]+m.offsetWidth;var i=o[1]+m.offsetHeight;var j=o[0];return new Ext.lib.Region(k,n,i,j)};Ext.lib.Point=function(i,j){if(Ext.isArray(i)){j=i[1];i=i[0]}this.x=this.right=this.left=this[0]=i;this.y=this.top=this.bottom=this[1]=j};Ext.lib.Point.prototype=new Ext.lib.Region();if(Ext.isIE){function c(){var i=Function.prototype;delete i.createSequence;delete i.defer;delete i.createDelegate;delete i.createCallback;delete i.createInterceptor;window.detachEvent("onunload",c)}window.attachEvent("onunload",c)}})();glpi-0.84.3+dfsg.1/lib/extjs/ext-all-debug.js000066400000000000000000052762651226600447100205430ustar00rootroot00000000000000 (function(){ var EXTUTIL = Ext.util, EACH = Ext.each, TRUE = true, FALSE = false; EXTUTIL.Observable = function(){ var me = this, e = me.events; if(me.listeners){ me.on(me.listeners); delete me.listeners; } me.events = e || {}; }; EXTUTIL.Observable.prototype = { filterOptRe : /^(?:scope|delay|buffer|single)$/, fireEvent : function(){ var a = Array.prototype.slice.call(arguments, 0), ename = a[0].toLowerCase(), me = this, ret = TRUE, ce = me.events[ename], cc, q, c; if (me.eventsSuspended === TRUE) { if (q = me.eventQueue) { q.push(a); } } else if(typeof ce == 'object') { if (ce.bubble){ if(ce.fire.apply(ce, a.slice(1)) === FALSE) { return FALSE; } c = me.getBubbleTarget && me.getBubbleTarget(); if(c && c.enableBubble) { cc = c.events[ename]; if(!cc || typeof cc != 'object' || !cc.bubble) { c.enableBubble(ename); } return c.fireEvent.apply(c, a); } } else { a.shift(); ret = ce.fire.apply(ce, a); } } return ret; }, addListener : function(eventName, fn, scope, o){ var me = this, e, oe, ce; if (typeof eventName == 'object') { o = eventName; for (e in o) { oe = o[e]; if (!me.filterOptRe.test(e)) { me.addListener(e, oe.fn || oe, oe.scope || o.scope, oe.fn ? oe : o); } } } else { eventName = eventName.toLowerCase(); ce = me.events[eventName] || TRUE; if (typeof ce == 'boolean') { me.events[eventName] = ce = new EXTUTIL.Event(me, eventName); } ce.addListener(fn, scope, typeof o == 'object' ? o : {}); } }, removeListener : function(eventName, fn, scope){ var ce = this.events[eventName.toLowerCase()]; if (typeof ce == 'object') { ce.removeListener(fn, scope); } }, purgeListeners : function(){ var events = this.events, evt, key; for(key in events){ evt = events[key]; if(typeof evt == 'object'){ evt.clearListeners(); } } }, addEvents : function(o){ var me = this; me.events = me.events || {}; if (typeof o == 'string') { var a = arguments, i = a.length; while(i--) { me.events[a[i]] = me.events[a[i]] || TRUE; } } else { Ext.applyIf(me.events, o); } }, hasListener : function(eventName){ var e = this.events[eventName.toLowerCase()]; return typeof e == 'object' && e.listeners.length > 0; }, suspendEvents : function(queueSuspended){ this.eventsSuspended = TRUE; if(queueSuspended && !this.eventQueue){ this.eventQueue = []; } }, resumeEvents : function(){ var me = this, queued = me.eventQueue || []; me.eventsSuspended = FALSE; delete me.eventQueue; EACH(queued, function(e) { me.fireEvent.apply(me, e); }); } }; var OBSERVABLE = EXTUTIL.Observable.prototype; OBSERVABLE.on = OBSERVABLE.addListener; OBSERVABLE.un = OBSERVABLE.removeListener; EXTUTIL.Observable.releaseCapture = function(o){ o.fireEvent = OBSERVABLE.fireEvent; }; function createTargeted(h, o, scope){ return function(){ if(o.target == arguments[0]){ h.apply(scope, Array.prototype.slice.call(arguments, 0)); } }; }; function createBuffered(h, o, l, scope){ l.task = new EXTUTIL.DelayedTask(); return function(){ l.task.delay(o.buffer, h, scope, Array.prototype.slice.call(arguments, 0)); }; }; function createSingle(h, e, fn, scope){ return function(){ e.removeListener(fn, scope); return h.apply(scope, arguments); }; }; function createDelayed(h, o, l, scope){ return function(){ var task = new EXTUTIL.DelayedTask(), args = Array.prototype.slice.call(arguments, 0); if(!l.tasks) { l.tasks = []; } l.tasks.push(task); task.delay(o.delay || 10, function(){ l.tasks.remove(task); h.apply(scope, args); }, scope); }; }; EXTUTIL.Event = function(obj, name){ this.name = name; this.obj = obj; this.listeners = []; }; EXTUTIL.Event.prototype = { addListener : function(fn, scope, options){ var me = this, l; scope = scope || me.obj; if(!me.isListening(fn, scope)){ l = me.createListener(fn, scope, options); if(me.firing){ me.listeners = me.listeners.slice(0); } me.listeners.push(l); } }, createListener: function(fn, scope, o){ o = o || {}; scope = scope || this.obj; var l = { fn: fn, scope: scope, options: o }, h = fn; if(o.target){ h = createTargeted(h, o, scope); } if(o.delay){ h = createDelayed(h, o, l, scope); } if(o.single){ h = createSingle(h, this, fn, scope); } if(o.buffer){ h = createBuffered(h, o, l, scope); } l.fireFn = h; return l; }, findListener : function(fn, scope){ var list = this.listeners, i = list.length, l; scope = scope || this.obj; while(i--){ l = list[i]; if(l){ if(l.fn == fn && l.scope == scope){ return i; } } } return -1; }, isListening : function(fn, scope){ return this.findListener(fn, scope) != -1; }, removeListener : function(fn, scope){ var index, l, k, me = this, ret = FALSE; if((index = me.findListener(fn, scope)) != -1){ if (me.firing) { me.listeners = me.listeners.slice(0); } l = me.listeners[index]; if(l.task) { l.task.cancel(); delete l.task; } k = l.tasks && l.tasks.length; if(k) { while(k--) { l.tasks[k].cancel(); } delete l.tasks; } me.listeners.splice(index, 1); ret = TRUE; } return ret; }, clearListeners : function(){ var me = this, l = me.listeners, i = l.length; while(i--) { me.removeListener(l[i].fn, l[i].scope); } }, fire : function(){ var me = this, listeners = me.listeners, len = listeners.length, i = 0, l; if(len > 0){ me.firing = TRUE; var args = Array.prototype.slice.call(arguments, 0); for (; i < len; i++) { l = listeners[i]; if(l && l.fireFn.apply(l.scope || me.obj || window, args) === FALSE) { return (me.firing = FALSE); } } } me.firing = FALSE; return TRUE; } }; })(); Ext.DomHelper = function(){ var tempTableEl = null, emptyTags = /^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i, tableRe = /^table|tbody|tr|td$/i, confRe = /tag|children|cn|html$/i, tableElRe = /td|tr|tbody/i, cssRe = /([a-z0-9-]+)\s*:\s*([^;\s]+(?:\s*[^;\s]+)*);?/gi, endRe = /end/i, pub, afterbegin = 'afterbegin', afterend = 'afterend', beforebegin = 'beforebegin', beforeend = 'beforeend', ts = '', te = '
    ', tbs = ts+'', tbe = ''+te, trs = tbs + '', tre = ''+tbe; function doInsert(el, o, returnElement, pos, sibling, append){ var newNode = pub.insertHtml(pos, Ext.getDom(el), createHtml(o)); return returnElement ? Ext.get(newNode, true) : newNode; } function createHtml(o){ var b = '', attr, val, key, cn; if(typeof o == "string"){ b = o; } else if (Ext.isArray(o)) { for (var i=0; i < o.length; i++) { if(o[i]) { b += createHtml(o[i]); } }; } else { b += '<' + (o.tag = o.tag || 'div'); for (attr in o) { val = o[attr]; if(!confRe.test(attr)){ if (typeof val == "object") { b += ' ' + attr + '="'; for (key in val) { b += key + ':' + val[key] + ';'; }; b += '"'; }else{ b += ' ' + ({cls : 'class', htmlFor : 'for'}[attr] || attr) + '="' + val + '"'; } } }; if (emptyTags.test(o.tag)) { b += '/>'; } else { b += '>'; if ((cn = o.children || o.cn)) { b += createHtml(cn); } else if(o.html){ b += o.html; } b += ''; } } return b; } function ieTable(depth, s, h, e){ tempTableEl.innerHTML = [s, h, e].join(''); var i = -1, el = tempTableEl, ns; while(++i < depth){ el = el.firstChild; } if(ns = el.nextSibling){ var df = document.createDocumentFragment(); while(el){ ns = el.nextSibling; df.appendChild(el); el = ns; } el = df; } return el; } function insertIntoTable(tag, where, el, html) { var node, before; tempTableEl = tempTableEl || document.createElement('div'); if(tag == 'td' && (where == afterbegin || where == beforeend) || !tableElRe.test(tag) && (where == beforebegin || where == afterend)) { return; } before = where == beforebegin ? el : where == afterend ? el.nextSibling : where == afterbegin ? el.firstChild : null; if (where == beforebegin || where == afterend) { el = el.parentNode; } if (tag == 'td' || (tag == 'tr' && (where == beforeend || where == afterbegin))) { node = ieTable(4, trs, html, tre); } else if ((tag == 'tbody' && (where == beforeend || where == afterbegin)) || (tag == 'tr' && (where == beforebegin || where == afterend))) { node = ieTable(3, tbs, html, tbe); } else { node = ieTable(2, ts, html, te); } el.insertBefore(node, before); return node; } function createContextualFragment(html){ var div = document.createElement("div"), fragment = document.createDocumentFragment(), i = 0, length, childNodes; div.innerHTML = html; childNodes = div.childNodes; length = childNodes.length; for (; i < length; i++) { fragment.appendChild(childNodes[i].cloneNode(true)); } return fragment; } pub = { markup : function(o){ return createHtml(o); }, applyStyles : function(el, styles){ if (styles) { var matches; el = Ext.fly(el); if (typeof styles == "function") { styles = styles.call(); } if (typeof styles == "string") { cssRe.lastIndex = 0; while ((matches = cssRe.exec(styles))) { el.setStyle(matches[1], matches[2]); } } else if (typeof styles == "object") { el.setStyle(styles); } } }, insertHtml : function(where, el, html){ var hash = {}, hashVal, range, rangeEl, setStart, frag, rs; where = where.toLowerCase(); hash[beforebegin] = ['BeforeBegin', 'previousSibling']; hash[afterend] = ['AfterEnd', 'nextSibling']; if (el.insertAdjacentHTML) { if(tableRe.test(el.tagName) && (rs = insertIntoTable(el.tagName.toLowerCase(), where, el, html))){ return rs; } hash[afterbegin] = ['AfterBegin', 'firstChild']; hash[beforeend] = ['BeforeEnd', 'lastChild']; if ((hashVal = hash[where])) { el.insertAdjacentHTML(hashVal[0], html); return el[hashVal[1]]; } } else { range = el.ownerDocument.createRange(); setStart = 'setStart' + (endRe.test(where) ? 'After' : 'Before'); if (hash[where]) { range[setStart](el); if (!range.createContextualFragment) { frag = createContextualFragment(html); } else { frag = range.createContextualFragment(html); } el.parentNode.insertBefore(frag, where == beforebegin ? el : el.nextSibling); return el[(where == beforebegin ? 'previous' : 'next') + 'Sibling']; } else { rangeEl = (where == afterbegin ? 'first' : 'last') + 'Child'; if (el.firstChild) { range[setStart](el[rangeEl]); if (!range.createContextualFragment) { frag = createContextualFragment(html); } else { frag = range.createContextualFragment(html); } if(where == afterbegin){ el.insertBefore(frag, el.firstChild); }else{ el.appendChild(frag); } } else { el.innerHTML = html; } return el[rangeEl]; } } throw 'Illegal insertion point -> "' + where + '"'; }, insertBefore : function(el, o, returnElement){ return doInsert(el, o, returnElement, beforebegin); }, insertAfter : function(el, o, returnElement){ return doInsert(el, o, returnElement, afterend, 'nextSibling'); }, insertFirst : function(el, o, returnElement){ return doInsert(el, o, returnElement, afterbegin, 'firstChild'); }, append : function(el, o, returnElement){ return doInsert(el, o, returnElement, beforeend, '', true); }, overwrite : function(el, o, returnElement){ el = Ext.getDom(el); el.innerHTML = createHtml(o); return returnElement ? Ext.get(el.firstChild) : el.firstChild; }, createHtml : createHtml }; return pub; }(); Ext.Template = function(html){ var me = this, a = arguments, buf = [], v; if (Ext.isArray(html)) { html = html.join(""); } else if (a.length > 1) { for(var i = 0, len = a.length; i < len; i++){ v = a[i]; if(typeof v == 'object'){ Ext.apply(me, v); } else { buf.push(v); } }; html = buf.join(''); } me.html = html; if (me.compiled) { me.compile(); } }; Ext.Template.prototype = { re : /\{([\w\-]+)\}/g, applyTemplate : function(values){ var me = this; return me.compiled ? me.compiled(values) : me.html.replace(me.re, function(m, name){ return values[name] !== undefined ? values[name] : ""; }); }, set : function(html, compile){ var me = this; me.html = html; me.compiled = null; return compile ? me.compile() : me; }, compile : function(){ var me = this, sep = Ext.isGecko ? "+" : ","; function fn(m, name){ name = "values['" + name + "']"; return "'"+ sep + '(' + name + " == undefined ? '' : " + name + ')' + sep + "'"; } eval("this.compiled = function(values){ return " + (Ext.isGecko ? "'" : "['") + me.html.replace(/\\/g, '\\\\').replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn) + (Ext.isGecko ? "';};" : "'].join('');};")); return me; }, insertFirst: function(el, values, returnElement){ return this.doInsert('afterBegin', el, values, returnElement); }, insertBefore: function(el, values, returnElement){ return this.doInsert('beforeBegin', el, values, returnElement); }, insertAfter : function(el, values, returnElement){ return this.doInsert('afterEnd', el, values, returnElement); }, append : function(el, values, returnElement){ return this.doInsert('beforeEnd', el, values, returnElement); }, doInsert : function(where, el, values, returnEl){ el = Ext.getDom(el); var newNode = Ext.DomHelper.insertHtml(where, el, this.applyTemplate(values)); return returnEl ? Ext.get(newNode, true) : newNode; }, overwrite : function(el, values, returnElement){ el = Ext.getDom(el); el.innerHTML = this.applyTemplate(values); return returnElement ? Ext.get(el.firstChild, true) : el.firstChild; } }; Ext.Template.prototype.apply = Ext.Template.prototype.applyTemplate; Ext.Template.from = function(el, config){ el = Ext.getDom(el); return new Ext.Template(el.value || el.innerHTML, config || ''); }; Ext.DomQuery = function(){ var cache = {}, simpleCache = {}, valueCache = {}, nonSpace = /\S/, trimRe = /^\s+|\s+$/g, tplRe = /\{(\d+)\}/g, modeRe = /^(\s?[\/>+~]\s?|\s|$)/, tagTokenRe = /^(#)?([\w\-\*]+)/, nthRe = /(\d*)n\+?(\d*)/, nthRe2 = /\D/, isIE = window.ActiveXObject ? true : false, key = 30803; eval("var batch = 30803;"); function child(parent, index){ var i = 0, n = parent.firstChild; while(n){ if(n.nodeType == 1){ if(++i == index){ return n; } } n = n.nextSibling; } return null; } function next(n){ while((n = n.nextSibling) && n.nodeType != 1); return n; } function prev(n){ while((n = n.previousSibling) && n.nodeType != 1); return n; } function children(parent){ var n = parent.firstChild, nodeIndex = -1, nextNode; while(n){ nextNode = n.nextSibling; if(n.nodeType == 3 && !nonSpace.test(n.nodeValue)){ parent.removeChild(n); }else{ n.nodeIndex = ++nodeIndex; } n = nextNode; } return this; } function byClassName(nodeSet, cls){ if(!cls){ return nodeSet; } var result = [], ri = -1; for(var i = 0, ci; ci = nodeSet[i]; i++){ if((' '+ci.className+' ').indexOf(cls) != -1){ result[++ri] = ci; } } return result; }; function attrValue(n, attr){ if(!n.tagName && typeof n.length != "undefined"){ n = n[0]; } if(!n){ return null; } if(attr == "for"){ return n.htmlFor; } if(attr == "class" || attr == "className"){ return n.className; } return n.getAttribute(attr) || n[attr]; }; function getNodes(ns, mode, tagName){ var result = [], ri = -1, cs; if(!ns){ return result; } tagName = tagName || "*"; if(typeof ns.getElementsByTagName != "undefined"){ ns = [ns]; } if(!mode){ for(var i = 0, ni; ni = ns[i]; i++){ cs = ni.getElementsByTagName(tagName); for(var j = 0, ci; ci = cs[j]; j++){ result[++ri] = ci; } } } else if(mode == "/" || mode == ">"){ var utag = tagName.toUpperCase(); for(var i = 0, ni, cn; ni = ns[i]; i++){ cn = ni.childNodes; for(var j = 0, cj; cj = cn[j]; j++){ if(cj.nodeName == utag || cj.nodeName == tagName || tagName == '*'){ result[++ri] = cj; } } } }else if(mode == "+"){ var utag = tagName.toUpperCase(); for(var i = 0, n; n = ns[i]; i++){ while((n = n.nextSibling) && n.nodeType != 1); if(n && (n.nodeName == utag || n.nodeName == tagName || tagName == '*')){ result[++ri] = n; } } }else if(mode == "~"){ var utag = tagName.toUpperCase(); for(var i = 0, n; n = ns[i]; i++){ while((n = n.nextSibling)){ if (n.nodeName == utag || n.nodeName == tagName || tagName == '*'){ result[++ri] = n; } } } } return result; } function concat(a, b){ if(b.slice){ return a.concat(b); } for(var i = 0, l = b.length; i < l; i++){ a[a.length] = b[i]; } return a; } function byTag(cs, tagName){ if(cs.tagName || cs == document){ cs = [cs]; } if(!tagName){ return cs; } var result = [], ri = -1; tagName = tagName.toLowerCase(); for(var i = 0, ci; ci = cs[i]; i++){ if(ci.nodeType == 1 && ci.tagName.toLowerCase() == tagName){ result[++ri] = ci; } } return result; } function byId(cs, id){ if(cs.tagName || cs == document){ cs = [cs]; } if(!id){ return cs; } var result = [], ri = -1; for(var i = 0, ci; ci = cs[i]; i++){ if(ci && ci.id == id){ result[++ri] = ci; return result; } } return result; } function byAttribute(cs, attr, value, op, custom){ var result = [], ri = -1, useGetStyle = custom == "{", fn = Ext.DomQuery.operators[op], a, xml, hasXml; for(var i = 0, ci; ci = cs[i]; i++){ if(ci.nodeType != 1){ continue; } if(!hasXml){ xml = Ext.DomQuery.isXml(ci); hasXml = true; } if(!xml){ if(useGetStyle){ a = Ext.DomQuery.getStyle(ci, attr); } else if (attr == "class" || attr == "className"){ a = ci.className; } else if (attr == "for"){ a = ci.htmlFor; } else if (attr == "href"){ a = ci.getAttribute("href", 2); } else{ a = ci.getAttribute(attr); } }else{ a = ci.getAttribute(attr); } if((fn && fn(a, value)) || (!fn && a)){ result[++ri] = ci; } } return result; } function byPseudo(cs, name, value){ return Ext.DomQuery.pseudos[name](cs, value); } function nodupIEXml(cs){ var d = ++key, r; cs[0].setAttribute("_nodup", d); r = [cs[0]]; for(var i = 1, len = cs.length; i < len; i++){ var c = cs[i]; if(!c.getAttribute("_nodup") != d){ c.setAttribute("_nodup", d); r[r.length] = c; } } for(var i = 0, len = cs.length; i < len; i++){ cs[i].removeAttribute("_nodup"); } return r; } function nodup(cs){ if(!cs){ return []; } var len = cs.length, c, i, r = cs, cj, ri = -1; if(!len || typeof cs.nodeType != "undefined" || len == 1){ return cs; } if(isIE && typeof cs[0].selectSingleNode != "undefined"){ return nodupIEXml(cs); } var d = ++key; cs[0]._nodup = d; for(i = 1; c = cs[i]; i++){ if(c._nodup != d){ c._nodup = d; }else{ r = []; for(var j = 0; j < i; j++){ r[++ri] = cs[j]; } for(j = i+1; cj = cs[j]; j++){ if(cj._nodup != d){ cj._nodup = d; r[++ri] = cj; } } return r; } } return r; } function quickDiffIEXml(c1, c2){ var d = ++key, r = []; for(var i = 0, len = c1.length; i < len; i++){ c1[i].setAttribute("_qdiff", d); } for(var i = 0, len = c2.length; i < len; i++){ if(c2[i].getAttribute("_qdiff") != d){ r[r.length] = c2[i]; } } for(var i = 0, len = c1.length; i < len; i++){ c1[i].removeAttribute("_qdiff"); } return r; } function quickDiff(c1, c2){ var len1 = c1.length, d = ++key, r = []; if(!len1){ return c2; } if(isIE && typeof c1[0].selectSingleNode != "undefined"){ return quickDiffIEXml(c1, c2); } for(var i = 0; i < len1; i++){ c1[i]._qdiff = d; } for(var i = 0, len = c2.length; i < len; i++){ if(c2[i]._qdiff != d){ r[r.length] = c2[i]; } } return r; } function quickId(ns, mode, root, id){ if(ns == root){ var d = root.ownerDocument || root; return d.getElementById(id); } ns = getNodes(ns, mode, "*"); return byId(ns, id); } return { getStyle : function(el, name){ return Ext.fly(el).getStyle(name); }, compile : function(path, type){ type = type || "select"; var fn = ["var f = function(root){\n var mode; ++batch; var n = root || document;\n"], mode, lastPath, matchers = Ext.DomQuery.matchers, matchersLn = matchers.length, modeMatch, lmode = path.match(modeRe); if(lmode && lmode[1]){ fn[fn.length] = 'mode="'+lmode[1].replace(trimRe, "")+'";'; path = path.replace(lmode[1], ""); } while(path.substr(0, 1)=="/"){ path = path.substr(1); } while(path && lastPath != path){ lastPath = path; var tokenMatch = path.match(tagTokenRe); if(type == "select"){ if(tokenMatch){ if(tokenMatch[1] == "#"){ fn[fn.length] = 'n = quickId(n, mode, root, "'+tokenMatch[2]+'");'; }else{ fn[fn.length] = 'n = getNodes(n, mode, "'+tokenMatch[2]+'");'; } path = path.replace(tokenMatch[0], ""); }else if(path.substr(0, 1) != '@'){ fn[fn.length] = 'n = getNodes(n, mode, "*");'; } }else{ if(tokenMatch){ if(tokenMatch[1] == "#"){ fn[fn.length] = 'n = byId(n, "'+tokenMatch[2]+'");'; }else{ fn[fn.length] = 'n = byTag(n, "'+tokenMatch[2]+'");'; } path = path.replace(tokenMatch[0], ""); } } while(!(modeMatch = path.match(modeRe))){ var matched = false; for(var j = 0; j < matchersLn; j++){ var t = matchers[j]; var m = path.match(t.re); if(m){ fn[fn.length] = t.select.replace(tplRe, function(x, i){ return m[i]; }); path = path.replace(m[0], ""); matched = true; break; } } if(!matched){ throw 'Error parsing selector, parsing failed at "' + path + '"'; } } if(modeMatch[1]){ fn[fn.length] = 'mode="'+modeMatch[1].replace(trimRe, "")+'";'; path = path.replace(modeMatch[1], ""); } } fn[fn.length] = "return nodup(n);\n}"; eval(fn.join("")); return f; }, jsSelect: function(path, root, type){ root = root || document; if(typeof root == "string"){ root = document.getElementById(root); } var paths = path.split(","), results = []; for(var i = 0, len = paths.length; i < len; i++){ var subPath = paths[i].replace(trimRe, ""); if(!cache[subPath]){ cache[subPath] = Ext.DomQuery.compile(subPath); if(!cache[subPath]){ throw subPath + " is not a valid selector"; } } var result = cache[subPath](root); if(result && result != document){ results = results.concat(result); } } if(paths.length > 1){ return nodup(results); } return results; }, isXml: function(el) { var docEl = (el ? el.ownerDocument || el : 0).documentElement; return docEl ? docEl.nodeName !== "HTML" : false; }, select : document.querySelectorAll ? function(path, root, type) { root = root || document; if (!Ext.DomQuery.isXml(root)) { try { var cs = root.querySelectorAll(path); return Ext.toArray(cs); } catch (ex) {} } return Ext.DomQuery.jsSelect.call(this, path, root, type); } : function(path, root, type) { return Ext.DomQuery.jsSelect.call(this, path, root, type); }, selectNode : function(path, root){ return Ext.DomQuery.select(path, root)[0]; }, selectValue : function(path, root, defaultValue){ path = path.replace(trimRe, ""); if(!valueCache[path]){ valueCache[path] = Ext.DomQuery.compile(path, "select"); } var n = valueCache[path](root), v; n = n[0] ? n[0] : n; if (typeof n.normalize == 'function') n.normalize(); v = (n && n.firstChild ? n.firstChild.nodeValue : null); return ((v === null||v === undefined||v==='') ? defaultValue : v); }, selectNumber : function(path, root, defaultValue){ var v = Ext.DomQuery.selectValue(path, root, defaultValue || 0); return parseFloat(v); }, is : function(el, ss){ if(typeof el == "string"){ el = document.getElementById(el); } var isArray = Ext.isArray(el), result = Ext.DomQuery.filter(isArray ? el : [el], ss); return isArray ? (result.length == el.length) : (result.length > 0); }, filter : function(els, ss, nonMatches){ ss = ss.replace(trimRe, ""); if(!simpleCache[ss]){ simpleCache[ss] = Ext.DomQuery.compile(ss, "simple"); } var result = simpleCache[ss](els); return nonMatches ? quickDiff(result, els) : result; }, matchers : [{ re: /^\.([\w\-]+)/, select: 'n = byClassName(n, " {1} ");' }, { re: /^\:([\w\-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/, select: 'n = byPseudo(n, "{1}", "{2}");' },{ re: /^(?:([\[\{])(?:@)?([\w\-]+)\s?(?:(=|.=)\s?(["']?)(.*?)\4)?[\]\}])/, select: 'n = byAttribute(n, "{2}", "{5}", "{3}", "{1}");' }, { re: /^#([\w\-]+)/, select: 'n = byId(n, "{1}");' },{ re: /^@([\w\-]+)/, select: 'return {firstChild:{nodeValue:attrValue(n, "{1}")}};' } ], /** * Collection of operator comparison functions. The default operators are =, !=, ^=, $=, *=, %=, |= and ~=. * New operators can be added as long as the match the format c= where c is any character other than space, > <. */ operators : { "=" : function(a, v){ return a == v; }, "!=" : function(a, v){ return a != v; }, "^=" : function(a, v){ return a && a.substr(0, v.length) == v; }, "$=" : function(a, v){ return a && a.substr(a.length-v.length) == v; }, "*=" : function(a, v){ return a && a.indexOf(v) !== -1; }, "%=" : function(a, v){ return (a % v) == 0; }, "|=" : function(a, v){ return a && (a == v || a.substr(0, v.length+1) == v+'-'); }, "~=" : function(a, v){ return a && (' '+a+' ').indexOf(' '+v+' ') != -1; } }, /** *

    Object hash of "pseudo class" filter functions which are used when filtering selections. Each function is passed * two parameters:

      *
    • c : Array
      An Array of DOM elements to filter.
    • *
    • v : String
      The argument (if any) supplied in the selector.
    • *
    *

    A filter function returns an Array of DOM elements which conform to the pseudo class.

    *

    In addition to the provided pseudo classes listed above such as first-child and nth-child, * developers may add additional, custom psuedo class filters to select elements according to application-specific requirements.

    *

    For example, to filter <a> elements to only return links to external resources:

    *
    Ext.DomQuery.pseudos.external = function(c, v){
        var r = [], ri = -1;
        for(var i = 0, ci; ci = c[i]; i++){
    //      Include in result set only if it's a link to an external resource
            if(ci.hostname != location.hostname){
                r[++ri] = ci;
            }
        }
        return r;
    };
    * Then external links could be gathered with the following statement:
    var externalLinks = Ext.select("a:external");
    
    */ pseudos : { "first-child" : function(c){ var r = [], ri = -1, n; for(var i = 0, ci; ci = n = c[i]; i++){ while((n = n.previousSibling) && n.nodeType != 1); if(!n){ r[++ri] = ci; } } return r; }, "last-child" : function(c){ var r = [], ri = -1, n; for(var i = 0, ci; ci = n = c[i]; i++){ while((n = n.nextSibling) && n.nodeType != 1); if(!n){ r[++ri] = ci; } } return r; }, "nth-child" : function(c, a) { var r = [], ri = -1, m = nthRe.exec(a == "even" && "2n" || a == "odd" && "2n+1" || !nthRe2.test(a) && "n+" + a || a), f = (m[1] || 1) - 0, l = m[2] - 0; for(var i = 0, n; n = c[i]; i++){ var pn = n.parentNode; if (batch != pn._batch) { var j = 0; for(var cn = pn.firstChild; cn; cn = cn.nextSibling){ if(cn.nodeType == 1){ cn.nodeIndex = ++j; } } pn._batch = batch; } if (f == 1) { if (l == 0 || n.nodeIndex == l){ r[++ri] = n; } } else if ((n.nodeIndex + l) % f == 0){ r[++ri] = n; } } return r; }, "only-child" : function(c){ var r = [], ri = -1;; for(var i = 0, ci; ci = c[i]; i++){ if(!prev(ci) && !next(ci)){ r[++ri] = ci; } } return r; }, "empty" : function(c){ var r = [], ri = -1; for(var i = 0, ci; ci = c[i]; i++){ var cns = ci.childNodes, j = 0, cn, empty = true; while(cn = cns[j]){ ++j; if(cn.nodeType == 1 || cn.nodeType == 3){ empty = false; break; } } if(empty){ r[++ri] = ci; } } return r; }, "contains" : function(c, v){ var r = [], ri = -1; for(var i = 0, ci; ci = c[i]; i++){ if((ci.textContent||ci.innerText||'').indexOf(v) != -1){ r[++ri] = ci; } } return r; }, "nodeValue" : function(c, v){ var r = [], ri = -1; for(var i = 0, ci; ci = c[i]; i++){ if(ci.firstChild && ci.firstChild.nodeValue == v){ r[++ri] = ci; } } return r; }, "checked" : function(c){ var r = [], ri = -1; for(var i = 0, ci; ci = c[i]; i++){ if(ci.checked == true){ r[++ri] = ci; } } return r; }, "not" : function(c, ss){ return Ext.DomQuery.filter(c, ss, true); }, "any" : function(c, selectors){ var ss = selectors.split('|'), r = [], ri = -1, s; for(var i = 0, ci; ci = c[i]; i++){ for(var j = 0; s = ss[j]; j++){ if(Ext.DomQuery.is(ci, s)){ r[++ri] = ci; break; } } } return r; }, "odd" : function(c){ return this["nth-child"](c, "odd"); }, "even" : function(c){ return this["nth-child"](c, "even"); }, "nth" : function(c, a){ return c[a-1] || []; }, "first" : function(c){ return c[0] || []; }, "last" : function(c){ return c[c.length-1] || []; }, "has" : function(c, ss){ var s = Ext.DomQuery.select, r = [], ri = -1; for(var i = 0, ci; ci = c[i]; i++){ if(s(ss, ci).length > 0){ r[++ri] = ci; } } return r; }, "next" : function(c, ss){ var is = Ext.DomQuery.is, r = [], ri = -1; for(var i = 0, ci; ci = c[i]; i++){ var n = next(ci); if(n && is(n, ss)){ r[++ri] = ci; } } return r; }, "prev" : function(c, ss){ var is = Ext.DomQuery.is, r = [], ri = -1; for(var i = 0, ci; ci = c[i]; i++){ var n = prev(ci); if(n && is(n, ss)){ r[++ri] = ci; } } return r; } } }; }(); /** * Selects an array of DOM nodes by CSS/XPath selector. Shorthand of {@link Ext.DomQuery#select} * @param {String} path The selector/xpath query * @param {Node} root (optional) The start of the query (defaults to document). * @return {Array} * @member Ext * @method query */ Ext.query = Ext.DomQuery.select; /** * @class Ext.util.DelayedTask *

    The DelayedTask class provides a convenient way to "buffer" the execution of a method, * performing setTimeout where a new timeout cancels the old timeout. When called, the * task will wait the specified time period before executing. If durng that time period, * the task is called again, the original call will be cancelled. This continues so that * the function is only called a single time for each iteration.

    *

    This method is especially useful for things like detecting whether a user has finished * typing in a text field. An example would be performing validation on a keypress. You can * use this class to buffer the keypress events for a certain number of milliseconds, and * perform only if they stop for that amount of time. Usage:

    
    var task = new Ext.util.DelayedTask(function(){
        alert(Ext.getDom('myInputField').value.length);
    });
    // Wait 500ms before calling our function. If the user presses another key 
    // during that 500ms, it will be cancelled and we'll wait another 500ms.
    Ext.get('myInputField').on('keypress', function(){
        task.{@link #delay}(500); 
    });
     * 
    *

    Note that we are using a DelayedTask here to illustrate a point. The configuration * option buffer for {@link Ext.util.Observable#addListener addListener/on} will * also setup a delayed task for you to buffer events.

    * @constructor The parameters to this constructor serve as defaults and are not required. * @param {Function} fn (optional) The default function to call. * @param {Object} scope The default scope (The this reference) in which the * function is called. If not specified, this will refer to the browser window. * @param {Array} args (optional) The default Array of arguments. */ Ext.util.DelayedTask = function(fn, scope, args){ var me = this, id, call = function(){ clearInterval(id); id = null; fn.apply(scope, args || []); }; /** * Cancels any pending timeout and queues a new one * @param {Number} delay The milliseconds to delay * @param {Function} newFn (optional) Overrides function passed to constructor * @param {Object} newScope (optional) Overrides scope passed to constructor. Remember that if no scope * is specified, this will refer to the browser window. * @param {Array} newArgs (optional) Overrides args passed to constructor */ me.delay = function(delay, newFn, newScope, newArgs){ me.cancel(); fn = newFn || fn; scope = newScope || scope; args = newArgs || args; id = setInterval(call, delay); }; /** * Cancel the last queued timeout */ me.cancel = function(){ if(id){ clearInterval(id); id = null; } }; };/** * @class Ext.Element *

    Encapsulates a DOM element, adding simple DOM manipulation facilities, normalizing for browser differences.

    *

    All instances of this class inherit the methods of {@link Ext.Fx} making visual effects easily available to all DOM elements.

    *

    Note that the events documented in this class are not Ext events, they encapsulate browser events. To * access the underlying browser event, see {@link Ext.EventObject#browserEvent}. Some older * browsers may not support the full range of events. Which events are supported is beyond the control of ExtJs.

    * Usage:
    
    // by id
    var el = Ext.get("my-div");
    
    // by DOM element reference
    var el = Ext.get(myDivElement);
    
    * Animations
    *

    When an element is manipulated, by default there is no animation.

    *
    
    var el = Ext.get("my-div");
    
    // no animation
    el.setWidth(100);
     * 
    *

    Many of the functions for manipulating an element have an optional "animate" parameter. This * parameter can be specified as boolean (true) for default animation effects.

    *
    
    // default animation
    el.setWidth(100, true);
     * 
    * *

    To configure the effects, an object literal with animation options to use as the Element animation * configuration object can also be specified. Note that the supported Element animation configuration * options are a subset of the {@link Ext.Fx} animation options specific to Fx effects. The supported * Element animation configuration options are:

    Option    Default   Description
    --------- --------  ---------------------------------------------
    {@link Ext.Fx#duration duration}  .35       The duration of the animation in seconds
    {@link Ext.Fx#easing easing}    easeOut   The easing method
    {@link Ext.Fx#callback callback}  none      A function to execute when the anim completes
    {@link Ext.Fx#scope scope}     this      The scope (this) of the callback function
    
    * *
    
    // Element animation options object
    var opt = {
        {@link Ext.Fx#duration duration}: 1,
        {@link Ext.Fx#easing easing}: 'elasticIn',
        {@link Ext.Fx#callback callback}: this.foo,
        {@link Ext.Fx#scope scope}: this
    };
    // animation with some options set
    el.setWidth(100, opt);
     * 
    *

    The Element animation object being used for the animation will be set on the options * object as "anim", which allows you to stop or manipulate the animation. Here is an example:

    *
    
    // using the "anim" property to get the Anim object
    if(opt.anim.isAnimated()){
        opt.anim.stop();
    }
     * 
    *

    Also see the {@link #animate} method for another animation technique.

    *

    Composite (Collections of) Elements

    *

    For working with collections of Elements, see {@link Ext.CompositeElement}

    * @constructor Create a new Element directly. * @param {String/HTMLElement} element * @param {Boolean} forceNew (optional) By default the constructor checks to see if there is already an instance of this element in the cache and if there is it returns the same instance. This will skip that check (useful for extending this class). */ (function(){ var DOC = document; Ext.Element = function(element, forceNew){ var dom = typeof element == "string" ? DOC.getElementById(element) : element, id; if(!dom) return null; id = dom.id; if(!forceNew && id && Ext.elCache[id]){ // element object already exists return Ext.elCache[id].el; } /** * The DOM element * @type HTMLElement */ this.dom = dom; /** * The DOM element ID * @type String */ this.id = id || Ext.id(dom); }; var DH = Ext.DomHelper, El = Ext.Element, EC = Ext.elCache; El.prototype = { /** * Sets the passed attributes as attributes of this element (a style attribute can be a string, object or function) * @param {Object} o The object with the attributes * @param {Boolean} useSet (optional) false to override the default setAttribute to use expandos. * @return {Ext.Element} this */ set : function(o, useSet){ var el = this.dom, attr, val, useSet = (useSet !== false) && !!el.setAttribute; for (attr in o) { if (o.hasOwnProperty(attr)) { val = o[attr]; if (attr == 'style') { DH.applyStyles(el, val); } else if (attr == 'cls') { el.className = val; } else if (useSet) { el.setAttribute(attr, val); } else { el[attr] = val; } } } return this; }, // Mouse events /** * @event click * Fires when a mouse click is detected within the element. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event contextmenu * Fires when a right click is detected within the element. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event dblclick * Fires when a mouse double click is detected within the element. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event mousedown * Fires when a mousedown is detected within the element. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event mouseup * Fires when a mouseup is detected within the element. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event mouseover * Fires when a mouseover is detected within the element. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event mousemove * Fires when a mousemove is detected with the element. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event mouseout * Fires when a mouseout is detected with the element. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event mouseenter * Fires when the mouse enters the element. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event mouseleave * Fires when the mouse leaves the element. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ // Keyboard events /** * @event keypress * Fires when a keypress is detected within the element. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event keydown * Fires when a keydown is detected within the element. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event keyup * Fires when a keyup is detected within the element. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ // HTML frame/object events /** * @event load * Fires when the user agent finishes loading all content within the element. Only supported by window, frames, objects and images. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event unload * Fires when the user agent removes all content from a window or frame. For elements, it fires when the target element or any of its content has been removed. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event abort * Fires when an object/image is stopped from loading before completely loaded. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event error * Fires when an object/image/frame cannot be loaded properly. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event resize * Fires when a document view is resized. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event scroll * Fires when a document view is scrolled. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ // Form events /** * @event select * Fires when a user selects some text in a text field, including input and textarea. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event change * Fires when a control loses the input focus and its value has been modified since gaining focus. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event submit * Fires when a form is submitted. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event reset * Fires when a form is reset. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event focus * Fires when an element receives focus either via the pointing device or by tab navigation. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event blur * Fires when an element loses focus either via the pointing device or by tabbing navigation. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ // User Interface events /** * @event DOMFocusIn * Where supported. Similar to HTML focus event, but can be applied to any focusable element. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event DOMFocusOut * Where supported. Similar to HTML blur event, but can be applied to any focusable element. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event DOMActivate * Where supported. Fires when an element is activated, for instance, through a mouse click or a keypress. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ // DOM Mutation events /** * @event DOMSubtreeModified * Where supported. Fires when the subtree is modified. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event DOMNodeInserted * Where supported. Fires when a node has been added as a child of another node. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event DOMNodeRemoved * Where supported. Fires when a descendant node of the element is removed. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event DOMNodeRemovedFromDocument * Where supported. Fires when a node is being removed from a document. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event DOMNodeInsertedIntoDocument * Where supported. Fires when a node is being inserted into a document. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event DOMAttrModified * Where supported. Fires when an attribute has been modified. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * @event DOMCharacterDataModified * Where supported. Fires when the character data has been modified. * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. * @param {HtmlElement} t The target of the event. * @param {Object} o The options configuration passed to the {@link #addListener} call. */ /** * The default unit to append to CSS values where a unit isn't provided (defaults to px). * @type String */ defaultUnit : "px", /** * Returns true if this element matches the passed simple selector (e.g. div.some-class or span:first-child) * @param {String} selector The simple selector to test * @return {Boolean} True if this element matches the selector, else false */ is : function(simpleSelector){ return Ext.DomQuery.is(this.dom, simpleSelector); }, /** * Tries to focus the element. Any exceptions are caught and ignored. * @param {Number} defer (optional) Milliseconds to defer the focus * @return {Ext.Element} this */ focus : function(defer, /* private */ dom) { var me = this, dom = dom || me.dom; try{ if(Number(defer)){ me.focus.defer(defer, null, [null, dom]); }else{ dom.focus(); } }catch(e){} return me; }, /** * Tries to blur the element. Any exceptions are caught and ignored. * @return {Ext.Element} this */ blur : function() { try{ this.dom.blur(); }catch(e){} return this; }, /** * Returns the value of the "value" attribute * @param {Boolean} asNumber true to parse the value as a number * @return {String/Number} */ getValue : function(asNumber){ var val = this.dom.value; return asNumber ? parseInt(val, 10) : val; }, /** * Appends an event handler to this element. The shorthand version {@link #on} is equivalent. * @param {String} eventName The name of event to handle. * @param {Function} fn The handler function the event invokes. This function is passed * the following parameters:
      *
    • evt : EventObject
      The {@link Ext.EventObject EventObject} describing the event.
    • *
    • el : HtmlElement
      The DOM element which was the target of the event. * Note that this may be filtered by using the delegate option.
    • *
    • o : Object
      The options object from the addListener call.
    • *
    * @param {Object} scope (optional) The scope (this reference) in which the handler function is executed. * If omitted, defaults to this Element.. * @param {Object} options (optional) An object containing handler configuration properties. * This may contain any of the following properties:
      *
    • scope Object :
      The scope (this reference) in which the handler function is executed. * If omitted, defaults to this Element.
    • *
    • delegate String:
      A simple selector to filter the target or look for a descendant of the target. See below for additional details.
    • *
    • stopEvent Boolean:
      True to stop the event. That is stop propagation, and prevent the default action.
    • *
    • preventDefault Boolean:
      True to prevent the default action
    • *
    • stopPropagation Boolean:
      True to prevent event propagation
    • *
    • normalized Boolean:
      False to pass a browser event to the handler function instead of an Ext.EventObject
    • *
    • target Ext.Element:
      Only call the handler if the event was fired on the target Element, not if the event was bubbled up from a child node.
    • *
    • delay Number:
      The number of milliseconds to delay the invocation of the handler after the event fires.
    • *
    • single Boolean:
      True to add a handler to handle just the next firing of the event, and then remove itself.
    • *
    • buffer Number:
      Causes the handler to be scheduled to run in an {@link Ext.util.DelayedTask} delayed * by the specified number of milliseconds. If the event fires again within that time, the original * handler is not invoked, but the new handler is scheduled in its place.
    • *

    *

    * Combining Options
    * In the following examples, the shorthand form {@link #on} is used rather than the more verbose * addListener. The two are equivalent. Using the options argument, it is possible to combine different * types of listeners:
    *
    * A delayed, one-time listener that auto stops the event and adds a custom argument (forumId) to the * options object. The options object is available as the third parameter in the handler function.

    * Code:
    
    el.on('click', this.onClick, this, {
        single: true,
        delay: 100,
        stopEvent : true,
        forumId: 4
    });

    *

    * Attaching multiple handlers in 1 call
    * The method also allows for a single argument to be passed which is a config object containing properties * which specify multiple handlers.

    *

    * Code:

    
    el.on({
        'click' : {
            fn: this.onClick,
            scope: this,
            delay: 100
        },
        'mouseover' : {
            fn: this.onMouseOver,
            scope: this
        },
        'mouseout' : {
            fn: this.onMouseOut,
            scope: this
        }
    });
    *

    * Or a shorthand syntax:
    * Code:

    el.on({ 'click' : this.onClick, 'mouseover' : this.onMouseOver, 'mouseout' : this.onMouseOut, scope: this }); *

    *

    delegate

    *

    This is a configuration option that you can pass along when registering a handler for * an event to assist with event delegation. Event delegation is a technique that is used to * reduce memory consumption and prevent exposure to memory-leaks. By registering an event * for a container element as opposed to each element within a container. By setting this * configuration option to a simple selector, the target element will be filtered to look for * a descendant of the target. * For example:

    
    // using this markup:
    <div id='elId'>
        <p id='p1'>paragraph one</p>
        <p id='p2' class='clickable'>paragraph two</p>
        <p id='p3'>paragraph three</p>
    </div>
    // utilize event delegation to registering just one handler on the container element:
    el = Ext.get('elId');
    el.on(
        'click',
        function(e,t) {
            // handle click
            console.info(t.id); // 'p2'
        },
        this,
        {
            // filter the target element to be a descendant with the class 'clickable'
            delegate: '.clickable'
        }
    );
         * 

    * @return {Ext.Element} this */ addListener : function(eventName, fn, scope, options){ Ext.EventManager.on(this.dom, eventName, fn, scope || this, options); return this; }, /** * Removes an event handler from this element. The shorthand version {@link #un} is equivalent. * Note: if a scope was explicitly specified when {@link #addListener adding} the * listener, the same scope must be specified here. * Example: *
    
    el.removeListener('click', this.handlerFn);
    // or
    el.un('click', this.handlerFn);
    
    * @param {String} eventName The name of the event from which to remove the handler. * @param {Function} fn The handler function to remove. This must be a reference to the function passed into the {@link #addListener} call. * @param {Object} scope If a scope (this reference) was specified when the listener was added, * then this must refer to the same object. * @return {Ext.Element} this */ removeListener : function(eventName, fn, scope){ Ext.EventManager.removeListener(this.dom, eventName, fn, scope || this); return this; }, /** * Removes all previous added listeners from this element * @return {Ext.Element} this */ removeAllListeners : function(){ Ext.EventManager.removeAll(this.dom); return this; }, /** * Recursively removes all previous added listeners from this element and its children * @return {Ext.Element} this */ purgeAllListeners : function() { Ext.EventManager.purgeElement(this, true); return this; }, /** * @private Test if size has a unit, otherwise appends the default */ addUnits : function(size){ if(size === "" || size == "auto" || size === undefined){ size = size || ''; } else if(!isNaN(size) || !unitPattern.test(size)){ size = size + (this.defaultUnit || 'px'); } return size; }, /** *

    Updates the Same Origin Policy

    *

    Updating innerHTML of an element will not execute embedded <script> elements. This is a browser restriction.

    * @param {Mixed} options. Either a sring containing the URL from which to load the HTML, or an {@link Ext.Ajax#request} options object specifying * exactly how to request the HTML. * @return {Ext.Element} this */ load : function(url, params, cb){ Ext.Ajax.request(Ext.apply({ params: params, url: url.url || url, callback: cb, el: this.dom, indicatorText: url.indicatorText || '' }, Ext.isObject(url) ? url : {})); return this; }, isBorderBox : function(){ return Ext.isBorderBox || Ext.isForcedBorderBox || noBoxAdjust[(this.dom.tagName || "").toLowerCase()]; }, remove : function(){ var me = this, dom = me.dom; if (dom) { delete me.dom; Ext.removeNode(dom); } }, hover : function(overFn, outFn, scope, options){ var me = this; me.on('mouseenter', overFn, scope || me.dom, options); me.on('mouseleave', outFn, scope || me.dom, options); return me; }, contains : function(el){ return !el ? false : Ext.lib.Dom.isAncestor(this.dom, el.dom ? el.dom : el); }, getAttributeNS : function(ns, name){ return this.getAttribute(name, ns); }, getAttribute: (function(){ var test = document.createElement('table'), isBrokenOnTable = false, hasGetAttribute = 'getAttribute' in test, unknownRe = /undefined|unknown/; if (hasGetAttribute) { try { test.getAttribute('ext:qtip'); } catch (e) { isBrokenOnTable = true; } return function(name, ns) { var el = this.dom, value; if (el.getAttributeNS) { value = el.getAttributeNS(ns, name) || null; } if (value == null) { if (ns) { if (isBrokenOnTable && el.tagName.toUpperCase() == 'TABLE') { try { value = el.getAttribute(ns + ':' + name); } catch (e) { value = ''; } } else { value = el.getAttribute(ns + ':' + name); } } else { value = el.getAttribute(name) || el[name]; } } return value || ''; }; } else { return function(name, ns) { var el = this.om, value, attribute; if (ns) { attribute = el[ns + ':' + name]; value = unknownRe.test(typeof attribute) ? undefined : attribute; } else { value = el[name]; } return value || ''; }; } test = null; })(), update : function(html) { if (this.dom) { this.dom.innerHTML = html; } return this; } }; var ep = El.prototype; El.addMethods = function(o){ Ext.apply(ep, o); }; ep.on = ep.addListener; ep.un = ep.removeListener; ep.autoBoxAdjust = true; var unitPattern = /\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i, docEl; El.get = function(el){ var ex, elm, id; if(!el){ return null; } if (typeof el == "string") { if (!(elm = DOC.getElementById(el))) { return null; } if (EC[el] && EC[el].el) { ex = EC[el].el; ex.dom = elm; } else { ex = El.addToCache(new El(elm)); } return ex; } else if (el.tagName) { if(!(id = el.id)){ id = Ext.id(el); } if (EC[id] && EC[id].el) { ex = EC[id].el; ex.dom = el; } else { ex = El.addToCache(new El(el)); } return ex; } else if (el instanceof El) { if(el != docEl){ if (Ext.isIE && (el.id == undefined || el.id == '')) { el.dom = el.dom; } else { el.dom = DOC.getElementById(el.id) || el.dom; } } return el; } else if(el.isComposite) { return el; } else if(Ext.isArray(el)) { return El.select(el); } else if(el == DOC) { if(!docEl){ var f = function(){}; f.prototype = El.prototype; docEl = new f(); docEl.dom = DOC; } return docEl; } return null; }; El.addToCache = function(el, id){ id = id || el.id; EC[id] = { el: el, data: {}, events: {} }; return el; }; El.data = function(el, key, value){ el = El.get(el); if (!el) { return null; } var c = EC[el.id].data; if(arguments.length == 2){ return c[key]; }else{ return (c[key] = value); } }; function garbageCollect(){ if(!Ext.enableGarbageCollector){ clearInterval(El.collectorThreadId); } else { var eid, el, d, o; for(eid in EC){ o = EC[eid]; if(o.skipGC){ continue; } el = o.el; d = el.dom; if(!d || !d.parentNode || (!d.offsetParent && !DOC.getElementById(eid))){ if(Ext.enableListenerCollection){ Ext.EventManager.removeAll(d); } delete EC[eid]; } } if (Ext.isIE) { var t = {}; for (eid in EC) { t[eid] = EC[eid]; } EC = Ext.elCache = t; } } } El.collectorThreadId = setInterval(garbageCollect, 30000); var flyFn = function(){}; flyFn.prototype = El.prototype; El.Flyweight = function(dom){ this.dom = dom; }; El.Flyweight.prototype = new flyFn(); El.Flyweight.prototype.isFlyweight = true; El._flyweights = {}; El.fly = function(el, named){ var ret = null; named = named || '_global'; if (el = Ext.getDom(el)) { (El._flyweights[named] = El._flyweights[named] || new El.Flyweight()).dom = el; ret = El._flyweights[named]; } return ret; }; Ext.get = El.get; Ext.fly = El.fly; var noBoxAdjust = Ext.isStrict ? { select:1 } : { input:1, select:1, textarea:1 }; if(Ext.isIE || Ext.isGecko){ noBoxAdjust['button'] = 1; } })(); Ext.Element.addMethods(function(){ var PARENTNODE = 'parentNode', NEXTSIBLING = 'nextSibling', PREVIOUSSIBLING = 'previousSibling', DQ = Ext.DomQuery, GET = Ext.get; return { findParent : function(simpleSelector, maxDepth, returnEl){ var p = this.dom, b = document.body, depth = 0, stopEl; if(Ext.isGecko && Object.prototype.toString.call(p) == '[object XULElement]') { return null; } maxDepth = maxDepth || 50; if (isNaN(maxDepth)) { stopEl = Ext.getDom(maxDepth); maxDepth = Number.MAX_VALUE; } while(p && p.nodeType == 1 && depth < maxDepth && p != b && p != stopEl){ if(DQ.is(p, simpleSelector)){ return returnEl ? GET(p) : p; } depth++; p = p.parentNode; } return null; }, findParentNode : function(simpleSelector, maxDepth, returnEl){ var p = Ext.fly(this.dom.parentNode, '_internal'); return p ? p.findParent(simpleSelector, maxDepth, returnEl) : null; }, up : function(simpleSelector, maxDepth){ return this.findParentNode(simpleSelector, maxDepth, true); }, select : function(selector){ return Ext.Element.select(selector, this.dom); }, query : function(selector){ return DQ.select(selector, this.dom); }, child : function(selector, returnDom){ var n = DQ.selectNode(selector, this.dom); return returnDom ? n : GET(n); }, down : function(selector, returnDom){ var n = DQ.selectNode(" > " + selector, this.dom); return returnDom ? n : GET(n); }, parent : function(selector, returnDom){ return this.matchNode(PARENTNODE, PARENTNODE, selector, returnDom); }, next : function(selector, returnDom){ return this.matchNode(NEXTSIBLING, NEXTSIBLING, selector, returnDom); }, prev : function(selector, returnDom){ return this.matchNode(PREVIOUSSIBLING, PREVIOUSSIBLING, selector, returnDom); }, first : function(selector, returnDom){ return this.matchNode(NEXTSIBLING, 'firstChild', selector, returnDom); }, last : function(selector, returnDom){ return this.matchNode(PREVIOUSSIBLING, 'lastChild', selector, returnDom); }, matchNode : function(dir, start, selector, returnDom){ var n = this.dom[start]; while(n){ if(n.nodeType == 1 && (!selector || DQ.is(n, selector))){ return !returnDom ? GET(n) : n; } n = n[dir]; } return null; } }; }()); Ext.Element.addMethods( function() { var GETDOM = Ext.getDom, GET = Ext.get, DH = Ext.DomHelper; return { appendChild: function(el){ return GET(el).appendTo(this); }, appendTo: function(el){ GETDOM(el).appendChild(this.dom); return this; }, insertBefore: function(el){ (el = GETDOM(el)).parentNode.insertBefore(this.dom, el); return this; }, insertAfter: function(el){ (el = GETDOM(el)).parentNode.insertBefore(this.dom, el.nextSibling); return this; }, insertFirst: function(el, returnDom){ el = el || {}; if(el.nodeType || el.dom || typeof el == 'string'){ el = GETDOM(el); this.dom.insertBefore(el, this.dom.firstChild); return !returnDom ? GET(el) : el; }else{ return this.createChild(el, this.dom.firstChild, returnDom); } }, replace: function(el){ el = GET(el); this.insertBefore(el); el.remove(); return this; }, replaceWith: function(el){ var me = this; if(el.nodeType || el.dom || typeof el == 'string'){ el = GETDOM(el); me.dom.parentNode.insertBefore(el, me.dom); }else{ el = DH.insertBefore(me.dom, el); } delete Ext.elCache[me.id]; Ext.removeNode(me.dom); me.id = Ext.id(me.dom = el); Ext.Element.addToCache(me.isFlyweight ? new Ext.Element(me.dom) : me); return me; }, createChild: function(config, insertBefore, returnDom){ config = config || {tag:'div'}; return insertBefore ? DH.insertBefore(insertBefore, config, returnDom !== true) : DH[!this.dom.firstChild ? 'overwrite' : 'append'](this.dom, config, returnDom !== true); }, wrap: function(config, returnDom){ var newEl = DH.insertBefore(this.dom, config || {tag: "div"}, !returnDom); newEl.dom ? newEl.dom.appendChild(this.dom) : newEl.appendChild(this.dom); return newEl; }, insertHtml : function(where, html, returnEl){ var el = DH.insertHtml(where, this.dom, html); return returnEl ? Ext.get(el) : el; } }; }()); Ext.Element.addMethods(function(){ var supports = Ext.supports, propCache = {}, camelRe = /(-[a-z])/gi, view = document.defaultView, opacityRe = /alpha\(opacity=(.*)\)/i, trimRe = /^\s+|\s+$/g, EL = Ext.Element, spacesRe = /\s+/, wordsRe = /\w/g, PADDING = "padding", MARGIN = "margin", BORDER = "border", LEFT = "-left", RIGHT = "-right", TOP = "-top", BOTTOM = "-bottom", WIDTH = "-width", MATH = Math, HIDDEN = 'hidden', ISCLIPPED = 'isClipped', OVERFLOW = 'overflow', OVERFLOWX = 'overflow-x', OVERFLOWY = 'overflow-y', ORIGINALCLIP = 'originalClip', borders = {l: BORDER + LEFT + WIDTH, r: BORDER + RIGHT + WIDTH, t: BORDER + TOP + WIDTH, b: BORDER + BOTTOM + WIDTH}, paddings = {l: PADDING + LEFT, r: PADDING + RIGHT, t: PADDING + TOP, b: PADDING + BOTTOM}, margins = {l: MARGIN + LEFT, r: MARGIN + RIGHT, t: MARGIN + TOP, b: MARGIN + BOTTOM}, data = Ext.Element.data; function camelFn(m, a) { return a.charAt(1).toUpperCase(); } function chkCache(prop) { return propCache[prop] || (propCache[prop] = prop == 'float' ? (supports.cssFloat ? 'cssFloat' : 'styleFloat') : prop.replace(camelRe, camelFn)); } return { adjustWidth : function(width) { var me = this; var isNum = (typeof width == "number"); if(isNum && me.autoBoxAdjust && !me.isBorderBox()){ width -= (me.getBorderWidth("lr") + me.getPadding("lr")); } return (isNum && width < 0) ? 0 : width; }, adjustHeight : function(height) { var me = this; var isNum = (typeof height == "number"); if(isNum && me.autoBoxAdjust && !me.isBorderBox()){ height -= (me.getBorderWidth("tb") + me.getPadding("tb")); } return (isNum && height < 0) ? 0 : height; }, addClass : function(className){ var me = this, i, len, v, cls = []; if (!Ext.isArray(className)) { if (typeof className == 'string' && !this.hasClass(className)) { me.dom.className += " " + className; } } else { for (i = 0, len = className.length; i < len; i++) { v = className[i]; if (typeof v == 'string' && (' ' + me.dom.className + ' ').indexOf(' ' + v + ' ') == -1) { cls.push(v); } } if (cls.length) { me.dom.className += " " + cls.join(" "); } } return me; }, removeClass : function(className){ var me = this, i, idx, len, cls, elClasses; if (!Ext.isArray(className)){ className = [className]; } if (me.dom && me.dom.className) { elClasses = me.dom.className.replace(trimRe, '').split(spacesRe); for (i = 0, len = className.length; i < len; i++) { cls = className[i]; if (typeof cls == 'string') { cls = cls.replace(trimRe, ''); idx = elClasses.indexOf(cls); if (idx != -1) { elClasses.splice(idx, 1); } } } me.dom.className = elClasses.join(" "); } return me; }, radioClass : function(className){ var cn = this.dom.parentNode.childNodes, v, i, len; className = Ext.isArray(className) ? className : [className]; for (i = 0, len = cn.length; i < len; i++) { v = cn[i]; if (v && v.nodeType == 1) { Ext.fly(v, '_internal').removeClass(className); } }; return this.addClass(className); }, toggleClass : function(className){ return this.hasClass(className) ? this.removeClass(className) : this.addClass(className); }, hasClass : function(className){ return className && (' '+this.dom.className+' ').indexOf(' '+className+' ') != -1; }, replaceClass : function(oldClassName, newClassName){ return this.removeClass(oldClassName).addClass(newClassName); }, isStyle : function(style, val) { return this.getStyle(style) == val; }, getStyle : function(){ return view && view.getComputedStyle ? function(prop){ var el = this.dom, v, cs, out, display; if(el == document){ return null; } prop = chkCache(prop); out = (v = el.style[prop]) ? v : (cs = view.getComputedStyle(el, "")) ? cs[prop] : null; if(prop == 'marginRight' && out != '0px' && !supports.correctRightMargin){ display = el.style.display; el.style.display = 'inline-block'; out = view.getComputedStyle(el, '').marginRight; el.style.display = display; } if(prop == 'backgroundColor' && out == 'rgba(0, 0, 0, 0)' && !supports.correctTransparentColor){ out = 'transparent'; } return out; } : function(prop){ var el = this.dom, m, cs; if(el == document) return null; if (prop == 'opacity') { if (el.style.filter.match) { if(m = el.style.filter.match(opacityRe)){ var fv = parseFloat(m[1]); if(!isNaN(fv)){ return fv ? fv / 100 : 0; } } } return 1; } prop = chkCache(prop); return el.style[prop] || ((cs = el.currentStyle) ? cs[prop] : null); }; }(), getColor : function(attr, defaultValue, prefix){ var v = this.getStyle(attr), color = (typeof prefix != 'undefined') ? prefix : '#', h; if(!v || (/transparent|inherit/.test(v))) { return defaultValue; } if(/^r/.test(v)){ Ext.each(v.slice(4, v.length -1).split(','), function(s){ h = parseInt(s, 10); color += (h < 16 ? '0' : '') + h.toString(16); }); }else{ v = v.replace('#', ''); color += v.length == 3 ? v.replace(/^(\w)(\w)(\w)$/, '$1$1$2$2$3$3') : v; } return(color.length > 5 ? color.toLowerCase() : defaultValue); }, setStyle : function(prop, value){ var tmp, style; if (typeof prop != 'object') { tmp = {}; tmp[prop] = value; prop = tmp; } for (style in prop) { value = prop[style]; style == 'opacity' ? this.setOpacity(value) : this.dom.style[chkCache(style)] = value; } return this; }, setOpacity : function(opacity, animate){ var me = this, s = me.dom.style; if(!animate || !me.anim){ if(Ext.isIE){ var opac = opacity < 1 ? 'alpha(opacity=' + opacity * 100 + ')' : '', val = s.filter.replace(opacityRe, '').replace(trimRe, ''); s.zoom = 1; s.filter = val + (val.length > 0 ? ' ' : '') + opac; }else{ s.opacity = opacity; } }else{ me.anim({opacity: {to: opacity}}, me.preanim(arguments, 1), null, .35, 'easeIn'); } return me; }, clearOpacity : function(){ var style = this.dom.style; if(Ext.isIE){ if(!Ext.isEmpty(style.filter)){ style.filter = style.filter.replace(opacityRe, '').replace(trimRe, ''); } }else{ style.opacity = style['-moz-opacity'] = style['-khtml-opacity'] = ''; } return this; }, getHeight : function(contentHeight){ var me = this, dom = me.dom, hidden = Ext.isIE && me.isStyle('display', 'none'), h = MATH.max(dom.offsetHeight, hidden ? 0 : dom.clientHeight) || 0; h = !contentHeight ? h : h - me.getBorderWidth("tb") - me.getPadding("tb"); return h < 0 ? 0 : h; }, getWidth : function(contentWidth){ var me = this, dom = me.dom, hidden = Ext.isIE && me.isStyle('display', 'none'), w = MATH.max(dom.offsetWidth, hidden ? 0 : dom.clientWidth) || 0; w = !contentWidth ? w : w - me.getBorderWidth("lr") - me.getPadding("lr"); return w < 0 ? 0 : w; }, setWidth : function(width, animate){ var me = this; width = me.adjustWidth(width); !animate || !me.anim ? me.dom.style.width = me.addUnits(width) : me.anim({width : {to : width}}, me.preanim(arguments, 1)); return me; }, setHeight : function(height, animate){ var me = this; height = me.adjustHeight(height); !animate || !me.anim ? me.dom.style.height = me.addUnits(height) : me.anim({height : {to : height}}, me.preanim(arguments, 1)); return me; }, getBorderWidth : function(side){ return this.addStyles(side, borders); }, getPadding : function(side){ return this.addStyles(side, paddings); }, clip : function(){ var me = this, dom = me.dom; if(!data(dom, ISCLIPPED)){ data(dom, ISCLIPPED, true); data(dom, ORIGINALCLIP, { o: me.getStyle(OVERFLOW), x: me.getStyle(OVERFLOWX), y: me.getStyle(OVERFLOWY) }); me.setStyle(OVERFLOW, HIDDEN); me.setStyle(OVERFLOWX, HIDDEN); me.setStyle(OVERFLOWY, HIDDEN); } return me; }, unclip : function(){ var me = this, dom = me.dom; if(data(dom, ISCLIPPED)){ data(dom, ISCLIPPED, false); var o = data(dom, ORIGINALCLIP); if(o.o){ me.setStyle(OVERFLOW, o.o); } if(o.x){ me.setStyle(OVERFLOWX, o.x); } if(o.y){ me.setStyle(OVERFLOWY, o.y); } } return me; }, addStyles : function(sides, styles){ var ttlSize = 0, sidesArr = sides.match(wordsRe), side, size, i, len = sidesArr.length; for (i = 0; i < len; i++) { side = sidesArr[i]; size = side && parseInt(this.getStyle(styles[side]), 10); if (size) { ttlSize += MATH.abs(size); } } return ttlSize; }, margins : margins }; }() ); (function(){ var D = Ext.lib.Dom, LEFT = "left", RIGHT = "right", TOP = "top", BOTTOM = "bottom", POSITION = "position", STATIC = "static", RELATIVE = "relative", AUTO = "auto", ZINDEX = "z-index"; Ext.Element.addMethods({ getX : function(){ return D.getX(this.dom); }, getY : function(){ return D.getY(this.dom); }, getXY : function(){ return D.getXY(this.dom); }, getOffsetsTo : function(el){ var o = this.getXY(), e = Ext.fly(el, '_internal').getXY(); return [o[0]-e[0],o[1]-e[1]]; }, setX : function(x, animate){ return this.setXY([x, this.getY()], this.animTest(arguments, animate, 1)); }, setY : function(y, animate){ return this.setXY([this.getX(), y], this.animTest(arguments, animate, 1)); }, setLeft : function(left){ this.setStyle(LEFT, this.addUnits(left)); return this; }, setTop : function(top){ this.setStyle(TOP, this.addUnits(top)); return this; }, setRight : function(right){ this.setStyle(RIGHT, this.addUnits(right)); return this; }, setBottom : function(bottom){ this.setStyle(BOTTOM, this.addUnits(bottom)); return this; }, setXY : function(pos, animate){ var me = this; if(!animate || !me.anim){ D.setXY(me.dom, pos); }else{ me.anim({points: {to: pos}}, me.preanim(arguments, 1), 'motion'); } return me; }, setLocation : function(x, y, animate){ return this.setXY([x, y], this.animTest(arguments, animate, 2)); }, moveTo : function(x, y, animate){ return this.setXY([x, y], this.animTest(arguments, animate, 2)); }, getLeft : function(local){ return !local ? this.getX() : parseInt(this.getStyle(LEFT), 10) || 0; }, getRight : function(local){ var me = this; return !local ? me.getX() + me.getWidth() : (me.getLeft(true) + me.getWidth()) || 0; }, getTop : function(local) { return !local ? this.getY() : parseInt(this.getStyle(TOP), 10) || 0; }, getBottom : function(local){ var me = this; return !local ? me.getY() + me.getHeight() : (me.getTop(true) + me.getHeight()) || 0; }, position : function(pos, zIndex, x, y){ var me = this; if(!pos && me.isStyle(POSITION, STATIC)){ me.setStyle(POSITION, RELATIVE); } else if(pos) { me.setStyle(POSITION, pos); } if(zIndex){ me.setStyle(ZINDEX, zIndex); } if(x || y) me.setXY([x || false, y || false]); }, clearPositioning : function(value){ value = value || ''; this.setStyle({ left : value, right : value, top : value, bottom : value, "z-index" : "", position : STATIC }); return this; }, getPositioning : function(){ var l = this.getStyle(LEFT); var t = this.getStyle(TOP); return { "position" : this.getStyle(POSITION), "left" : l, "right" : l ? "" : this.getStyle(RIGHT), "top" : t, "bottom" : t ? "" : this.getStyle(BOTTOM), "z-index" : this.getStyle(ZINDEX) }; }, setPositioning : function(pc){ var me = this, style = me.dom.style; me.setStyle(pc); if(pc.right == AUTO){ style.right = ""; } if(pc.bottom == AUTO){ style.bottom = ""; } return me; }, translatePoints : function(x, y){ y = isNaN(x[1]) ? y : x[1]; x = isNaN(x[0]) ? x : x[0]; var me = this, relative = me.isStyle(POSITION, RELATIVE), o = me.getXY(), l = parseInt(me.getStyle(LEFT), 10), t = parseInt(me.getStyle(TOP), 10); l = !isNaN(l) ? l : (relative ? 0 : me.dom.offsetLeft); t = !isNaN(t) ? t : (relative ? 0 : me.dom.offsetTop); return {left: (x - o[0] + l), top: (y - o[1] + t)}; }, animTest : function(args, animate, i) { return !!animate && this.preanim ? this.preanim(args, i) : false; } }); })(); Ext.Element.addMethods({ isScrollable : function(){ var dom = this.dom; return dom.scrollHeight > dom.clientHeight || dom.scrollWidth > dom.clientWidth; }, scrollTo : function(side, value){ this.dom["scroll" + (/top/i.test(side) ? "Top" : "Left")] = value; return this; }, getScroll : function(){ var d = this.dom, doc = document, body = doc.body, docElement = doc.documentElement, l, t, ret; if(d == doc || d == body){ if(Ext.isIE && Ext.isStrict){ l = docElement.scrollLeft; t = docElement.scrollTop; }else{ l = window.pageXOffset; t = window.pageYOffset; } ret = {left: l || (body ? body.scrollLeft : 0), top: t || (body ? body.scrollTop : 0)}; }else{ ret = {left: d.scrollLeft, top: d.scrollTop}; } return ret; } }); Ext.Element.VISIBILITY = 1; Ext.Element.DISPLAY = 2; Ext.Element.OFFSETS = 3; Ext.Element.ASCLASS = 4; Ext.Element.visibilityCls = 'x-hide-nosize'; Ext.Element.addMethods(function(){ var El = Ext.Element, OPACITY = "opacity", VISIBILITY = "visibility", DISPLAY = "display", HIDDEN = "hidden", OFFSETS = "offsets", ASCLASS = "asclass", NONE = "none", NOSIZE = 'nosize', ORIGINALDISPLAY = 'originalDisplay', VISMODE = 'visibilityMode', ISVISIBLE = 'isVisible', data = El.data, getDisplay = function(dom){ var d = data(dom, ORIGINALDISPLAY); if(d === undefined){ data(dom, ORIGINALDISPLAY, d = ''); } return d; }, getVisMode = function(dom){ var m = data(dom, VISMODE); if(m === undefined){ data(dom, VISMODE, m = 1); } return m; }; return { originalDisplay : "", visibilityMode : 1, setVisibilityMode : function(visMode){ data(this.dom, VISMODE, visMode); return this; }, animate : function(args, duration, onComplete, easing, animType){ this.anim(args, {duration: duration, callback: onComplete, easing: easing}, animType); return this; }, anim : function(args, opt, animType, defaultDur, defaultEase, cb){ animType = animType || 'run'; opt = opt || {}; var me = this, anim = Ext.lib.Anim[animType]( me.dom, args, (opt.duration || defaultDur) || .35, (opt.easing || defaultEase) || 'easeOut', function(){ if(cb) cb.call(me); if(opt.callback) opt.callback.call(opt.scope || me, me, opt); }, me ); opt.anim = anim; return anim; }, preanim : function(a, i){ return !a[i] ? false : (typeof a[i] == 'object' ? a[i]: {duration: a[i+1], callback: a[i+2], easing: a[i+3]}); }, isVisible : function() { var me = this, dom = me.dom, visible = data(dom, ISVISIBLE); if(typeof visible == 'boolean'){ return visible; } visible = !me.isStyle(VISIBILITY, HIDDEN) && !me.isStyle(DISPLAY, NONE) && !((getVisMode(dom) == El.ASCLASS) && me.hasClass(me.visibilityCls || El.visibilityCls)); data(dom, ISVISIBLE, visible); return visible; }, setVisible : function(visible, animate){ var me = this, isDisplay, isVisibility, isOffsets, isNosize, dom = me.dom, visMode = getVisMode(dom); if (typeof animate == 'string'){ switch (animate) { case DISPLAY: visMode = El.DISPLAY; break; case VISIBILITY: visMode = El.VISIBILITY; break; case OFFSETS: visMode = El.OFFSETS; break; case NOSIZE: case ASCLASS: visMode = El.ASCLASS; break; } me.setVisibilityMode(visMode); animate = false; } if (!animate || !me.anim) { if(visMode == El.ASCLASS ){ me[visible?'removeClass':'addClass'](me.visibilityCls || El.visibilityCls); } else if (visMode == El.DISPLAY){ return me.setDisplayed(visible); } else if (visMode == El.OFFSETS){ if (!visible){ me.hideModeStyles = { position: me.getStyle('position'), top: me.getStyle('top'), left: me.getStyle('left') }; me.applyStyles({position: 'absolute', top: '-10000px', left: '-10000px'}); } else { me.applyStyles(me.hideModeStyles || {position: '', top: '', left: ''}); delete me.hideModeStyles; } }else{ me.fixDisplay(); dom.style.visibility = visible ? "visible" : HIDDEN; } }else{ if(visible){ me.setOpacity(.01); me.setVisible(true); } me.anim({opacity: { to: (visible?1:0) }}, me.preanim(arguments, 1), null, .35, 'easeIn', function(){ visible || me.setVisible(false).setOpacity(1); }); } data(dom, ISVISIBLE, visible); return me; }, hasMetrics : function(){ var dom = this.dom; return this.isVisible() || (getVisMode(dom) == El.VISIBILITY); }, toggle : function(animate){ var me = this; me.setVisible(!me.isVisible(), me.preanim(arguments, 0)); return me; }, setDisplayed : function(value) { if(typeof value == "boolean"){ value = value ? getDisplay(this.dom) : NONE; } this.setStyle(DISPLAY, value); return this; }, fixDisplay : function(){ var me = this; if(me.isStyle(DISPLAY, NONE)){ me.setStyle(VISIBILITY, HIDDEN); me.setStyle(DISPLAY, getDisplay(this.dom)); if(me.isStyle(DISPLAY, NONE)){ me.setStyle(DISPLAY, "block"); } } }, hide : function(animate){ if (typeof animate == 'string'){ this.setVisible(false, animate); return this; } this.setVisible(false, this.preanim(arguments, 0)); return this; }, show : function(animate){ if (typeof animate == 'string'){ this.setVisible(true, animate); return this; } this.setVisible(true, this.preanim(arguments, 0)); return this; } }; }());(function(){ var NULL = null, UNDEFINED = undefined, TRUE = true, FALSE = false, SETX = "setX", SETY = "setY", SETXY = "setXY", LEFT = "left", BOTTOM = "bottom", TOP = "top", RIGHT = "right", HEIGHT = "height", WIDTH = "width", POINTS = "points", HIDDEN = "hidden", ABSOLUTE = "absolute", VISIBLE = "visible", MOTION = "motion", POSITION = "position", EASEOUT = "easeOut", flyEl = new Ext.Element.Flyweight(), queues = {}, getObject = function(o){ return o || {}; }, fly = function(dom){ flyEl.dom = dom; flyEl.id = Ext.id(dom); return flyEl; }, getQueue = function(id){ if(!queues[id]){ queues[id] = []; } return queues[id]; }, setQueue = function(id, value){ queues[id] = value; }; Ext.enableFx = TRUE; Ext.Fx = { switchStatements : function(key, fn, argHash){ return fn.apply(this, argHash[key]); }, slideIn : function(anchor, o){ o = getObject(o); var me = this, dom = me.dom, st = dom.style, xy, r, b, wrap, after, st, args, pt, bw, bh; anchor = anchor || "t"; me.queueFx(o, function(){ xy = fly(dom).getXY(); fly(dom).fixDisplay(); r = fly(dom).getFxRestore(); b = {x: xy[0], y: xy[1], 0: xy[0], 1: xy[1], width: dom.offsetWidth, height: dom.offsetHeight}; b.right = b.x + b.width; b.bottom = b.y + b.height; fly(dom).setWidth(b.width).setHeight(b.height); wrap = fly(dom).fxWrap(r.pos, o, HIDDEN); st.visibility = VISIBLE; st.position = ABSOLUTE; function after(){ fly(dom).fxUnwrap(wrap, r.pos, o); st.width = r.width; st.height = r.height; fly(dom).afterFx(o); } pt = {to: [b.x, b.y]}; bw = {to: b.width}; bh = {to: b.height}; function argCalc(wrap, style, ww, wh, sXY, sXYval, s1, s2, w, h, p){ var ret = {}; fly(wrap).setWidth(ww).setHeight(wh); if(fly(wrap)[sXY]){ fly(wrap)[sXY](sXYval); } style[s1] = style[s2] = "0"; if(w){ ret.width = w; } if(h){ ret.height = h; } if(p){ ret.points = p; } return ret; }; args = fly(dom).switchStatements(anchor.toLowerCase(), argCalc, { t : [wrap, st, b.width, 0, NULL, NULL, LEFT, BOTTOM, NULL, bh, NULL], l : [wrap, st, 0, b.height, NULL, NULL, RIGHT, TOP, bw, NULL, NULL], r : [wrap, st, b.width, b.height, SETX, b.right, LEFT, TOP, NULL, NULL, pt], b : [wrap, st, b.width, b.height, SETY, b.bottom, LEFT, TOP, NULL, bh, pt], tl : [wrap, st, 0, 0, NULL, NULL, RIGHT, BOTTOM, bw, bh, pt], bl : [wrap, st, 0, 0, SETY, b.y + b.height, RIGHT, TOP, bw, bh, pt], br : [wrap, st, 0, 0, SETXY, [b.right, b.bottom], LEFT, TOP, bw, bh, pt], tr : [wrap, st, 0, 0, SETX, b.x + b.width, LEFT, BOTTOM, bw, bh, pt] }); st.visibility = VISIBLE; fly(wrap).show(); arguments.callee.anim = fly(wrap).fxanim(args, o, MOTION, .5, EASEOUT, after); }); return me; }, slideOut : function(anchor, o){ o = getObject(o); var me = this, dom = me.dom, st = dom.style, xy = me.getXY(), wrap, r, b, a, zero = {to: 0}; anchor = anchor || "t"; me.queueFx(o, function(){ r = fly(dom).getFxRestore(); b = {x: xy[0], y: xy[1], 0: xy[0], 1: xy[1], width: dom.offsetWidth, height: dom.offsetHeight}; b.right = b.x + b.width; b.bottom = b.y + b.height; fly(dom).setWidth(b.width).setHeight(b.height); wrap = fly(dom).fxWrap(r.pos, o, VISIBLE); st.visibility = VISIBLE; st.position = ABSOLUTE; fly(wrap).setWidth(b.width).setHeight(b.height); function after(){ o.useDisplay ? fly(dom).setDisplayed(FALSE) : fly(dom).hide(); fly(dom).fxUnwrap(wrap, r.pos, o); st.width = r.width; st.height = r.height; fly(dom).afterFx(o); } function argCalc(style, s1, s2, p1, v1, p2, v2, p3, v3){ var ret = {}; style[s1] = style[s2] = "0"; ret[p1] = v1; if(p2){ ret[p2] = v2; } if(p3){ ret[p3] = v3; } return ret; }; a = fly(dom).switchStatements(anchor.toLowerCase(), argCalc, { t : [st, LEFT, BOTTOM, HEIGHT, zero], l : [st, RIGHT, TOP, WIDTH, zero], r : [st, LEFT, TOP, WIDTH, zero, POINTS, {to : [b.right, b.y]}], b : [st, LEFT, TOP, HEIGHT, zero, POINTS, {to : [b.x, b.bottom]}], tl : [st, RIGHT, BOTTOM, WIDTH, zero, HEIGHT, zero], bl : [st, RIGHT, TOP, WIDTH, zero, HEIGHT, zero, POINTS, {to : [b.x, b.bottom]}], br : [st, LEFT, TOP, WIDTH, zero, HEIGHT, zero, POINTS, {to : [b.x + b.width, b.bottom]}], tr : [st, LEFT, BOTTOM, WIDTH, zero, HEIGHT, zero, POINTS, {to : [b.right, b.y]}] }); arguments.callee.anim = fly(wrap).fxanim(a, o, MOTION, .5, EASEOUT, after); }); return me; }, puff : function(o){ o = getObject(o); var me = this, dom = me.dom, st = dom.style, width, height, r; me.queueFx(o, function(){ width = fly(dom).getWidth(); height = fly(dom).getHeight(); fly(dom).clearOpacity(); fly(dom).show(); r = fly(dom).getFxRestore(); function after(){ o.useDisplay ? fly(dom).setDisplayed(FALSE) : fly(dom).hide(); fly(dom).clearOpacity(); fly(dom).setPositioning(r.pos); st.width = r.width; st.height = r.height; st.fontSize = ''; fly(dom).afterFx(o); } arguments.callee.anim = fly(dom).fxanim({ width : {to : fly(dom).adjustWidth(width * 2)}, height : {to : fly(dom).adjustHeight(height * 2)}, points : {by : [-width * .5, -height * .5]}, opacity : {to : 0}, fontSize: {to : 200, unit: "%"} }, o, MOTION, .5, EASEOUT, after); }); return me; }, switchOff : function(o){ o = getObject(o); var me = this, dom = me.dom, st = dom.style, r; me.queueFx(o, function(){ fly(dom).clearOpacity(); fly(dom).clip(); r = fly(dom).getFxRestore(); function after(){ o.useDisplay ? fly(dom).setDisplayed(FALSE) : fly(dom).hide(); fly(dom).clearOpacity(); fly(dom).setPositioning(r.pos); st.width = r.width; st.height = r.height; fly(dom).afterFx(o); }; fly(dom).fxanim({opacity : {to : 0.3}}, NULL, NULL, .1, NULL, function(){ fly(dom).clearOpacity(); (function(){ fly(dom).fxanim({ height : {to : 1}, points : {by : [0, fly(dom).getHeight() * .5]} }, o, MOTION, 0.3, 'easeIn', after); }).defer(100); }); }); return me; }, highlight : function(color, o){ o = getObject(o); var me = this, dom = me.dom, attr = o.attr || "backgroundColor", a = {}, restore; me.queueFx(o, function(){ fly(dom).clearOpacity(); fly(dom).show(); function after(){ dom.style[attr] = restore; fly(dom).afterFx(o); } restore = dom.style[attr]; a[attr] = {from: color || "ffff9c", to: o.endColor || fly(dom).getColor(attr) || "ffffff"}; arguments.callee.anim = fly(dom).fxanim(a, o, 'color', 1, 'easeIn', after); }); return me; }, frame : function(color, count, o){ o = getObject(o); var me = this, dom = me.dom, proxy, active; me.queueFx(o, function(){ color = color || '#C3DAF9'; if(color.length == 6){ color = '#' + color; } count = count || 1; fly(dom).show(); var xy = fly(dom).getXY(), b = {x: xy[0], y: xy[1], 0: xy[0], 1: xy[1], width: dom.offsetWidth, height: dom.offsetHeight}, queue = function(){ proxy = fly(document.body || document.documentElement).createChild({ style:{ position : ABSOLUTE, 'z-index': 35000, border : '0px solid ' + color } }); return proxy.queueFx({}, animFn); }; arguments.callee.anim = { isAnimated: true, stop: function() { count = 0; proxy.stopFx(); } }; function animFn(){ var scale = Ext.isBorderBox ? 2 : 1; active = proxy.anim({ top : {from : b.y, to : b.y - 20}, left : {from : b.x, to : b.x - 20}, borderWidth : {from : 0, to : 10}, opacity : {from : 1, to : 0}, height : {from : b.height, to : b.height + 20 * scale}, width : {from : b.width, to : b.width + 20 * scale} },{ duration: o.duration || 1, callback: function() { proxy.remove(); --count > 0 ? queue() : fly(dom).afterFx(o); } }); arguments.callee.anim = { isAnimated: true, stop: function(){ active.stop(); } }; }; queue(); }); return me; }, pause : function(seconds){ var dom = this.dom, t; this.queueFx({}, function(){ t = setTimeout(function(){ fly(dom).afterFx({}); }, seconds * 1000); arguments.callee.anim = { isAnimated: true, stop: function(){ clearTimeout(t); fly(dom).afterFx({}); } }; }); return this; }, fadeIn : function(o){ o = getObject(o); var me = this, dom = me.dom, to = o.endOpacity || 1; me.queueFx(o, function(){ fly(dom).setOpacity(0); fly(dom).fixDisplay(); dom.style.visibility = VISIBLE; arguments.callee.anim = fly(dom).fxanim({opacity:{to:to}}, o, NULL, .5, EASEOUT, function(){ if(to == 1){ fly(dom).clearOpacity(); } fly(dom).afterFx(o); }); }); return me; }, fadeOut : function(o){ o = getObject(o); var me = this, dom = me.dom, style = dom.style, to = o.endOpacity || 0; me.queueFx(o, function(){ arguments.callee.anim = fly(dom).fxanim({ opacity : {to : to}}, o, NULL, .5, EASEOUT, function(){ if(to == 0){ Ext.Element.data(dom, 'visibilityMode') == Ext.Element.DISPLAY || o.useDisplay ? style.display = "none" : style.visibility = HIDDEN; fly(dom).clearOpacity(); } fly(dom).afterFx(o); }); }); return me; }, scale : function(w, h, o){ this.shift(Ext.apply({}, o, { width: w, height: h })); return this; }, shift : function(o){ o = getObject(o); var dom = this.dom, a = {}; this.queueFx(o, function(){ for (var prop in o) { if (o[prop] != UNDEFINED) { a[prop] = {to : o[prop]}; } } a.width ? a.width.to = fly(dom).adjustWidth(o.width) : a; a.height ? a.height.to = fly(dom).adjustWidth(o.height) : a; if (a.x || a.y || a.xy) { a.points = a.xy || {to : [ a.x ? a.x.to : fly(dom).getX(), a.y ? a.y.to : fly(dom).getY()]}; } arguments.callee.anim = fly(dom).fxanim(a, o, MOTION, .35, EASEOUT, function(){ fly(dom).afterFx(o); }); }); return this; }, ghost : function(anchor, o){ o = getObject(o); var me = this, dom = me.dom, st = dom.style, a = {opacity: {to: 0}, points: {}}, pt = a.points, r, w, h; anchor = anchor || "b"; me.queueFx(o, function(){ r = fly(dom).getFxRestore(); w = fly(dom).getWidth(); h = fly(dom).getHeight(); function after(){ o.useDisplay ? fly(dom).setDisplayed(FALSE) : fly(dom).hide(); fly(dom).clearOpacity(); fly(dom).setPositioning(r.pos); st.width = r.width; st.height = r.height; fly(dom).afterFx(o); } pt.by = fly(dom).switchStatements(anchor.toLowerCase(), function(v1,v2){ return [v1, v2];}, { t : [0, -h], l : [-w, 0], r : [w, 0], b : [0, h], tl : [-w, -h], bl : [-w, h], br : [w, h], tr : [w, -h] }); arguments.callee.anim = fly(dom).fxanim(a, o, MOTION, .5, EASEOUT, after); }); return me; }, syncFx : function(){ var me = this; me.fxDefaults = Ext.apply(me.fxDefaults || {}, { block : FALSE, concurrent : TRUE, stopFx : FALSE }); return me; }, sequenceFx : function(){ var me = this; me.fxDefaults = Ext.apply(me.fxDefaults || {}, { block : FALSE, concurrent : FALSE, stopFx : FALSE }); return me; }, nextFx : function(){ var ef = getQueue(this.dom.id)[0]; if(ef){ ef.call(this); } }, hasActiveFx : function(){ return getQueue(this.dom.id)[0]; }, stopFx : function(finish){ var me = this, id = me.dom.id; if(me.hasActiveFx()){ var cur = getQueue(id)[0]; if(cur && cur.anim){ if(cur.anim.isAnimated){ setQueue(id, [cur]); cur.anim.stop(finish !== undefined ? finish : TRUE); }else{ setQueue(id, []); } } } return me; }, beforeFx : function(o){ if(this.hasActiveFx() && !o.concurrent){ if(o.stopFx){ this.stopFx(); return TRUE; } return FALSE; } return TRUE; }, hasFxBlock : function(){ var q = getQueue(this.dom.id); return q && q[0] && q[0].block; }, queueFx : function(o, fn){ var me = fly(this.dom); if(!me.hasFxBlock()){ Ext.applyIf(o, me.fxDefaults); if(!o.concurrent){ var run = me.beforeFx(o); fn.block = o.block; getQueue(me.dom.id).push(fn); if(run){ me.nextFx(); } }else{ fn.call(me); } } return me; }, fxWrap : function(pos, o, vis){ var dom = this.dom, wrap, wrapXY; if(!o.wrap || !(wrap = Ext.getDom(o.wrap))){ if(o.fixPosition){ wrapXY = fly(dom).getXY(); } var div = document.createElement("div"); div.style.visibility = vis; wrap = dom.parentNode.insertBefore(div, dom); fly(wrap).setPositioning(pos); if(fly(wrap).isStyle(POSITION, "static")){ fly(wrap).position("relative"); } fly(dom).clearPositioning('auto'); fly(wrap).clip(); wrap.appendChild(dom); if(wrapXY){ fly(wrap).setXY(wrapXY); } } return wrap; }, fxUnwrap : function(wrap, pos, o){ var dom = this.dom; fly(dom).clearPositioning(); fly(dom).setPositioning(pos); if(!o.wrap){ var pn = fly(wrap).dom.parentNode; pn.insertBefore(dom, wrap); fly(wrap).remove(); } }, getFxRestore : function(){ var st = this.dom.style; return {pos: this.getPositioning(), width: st.width, height : st.height}; }, afterFx : function(o){ var dom = this.dom, id = dom.id; if(o.afterStyle){ fly(dom).setStyle(o.afterStyle); } if(o.afterCls){ fly(dom).addClass(o.afterCls); } if(o.remove == TRUE){ fly(dom).remove(); } if(o.callback){ o.callback.call(o.scope, fly(dom)); } if(!o.concurrent){ getQueue(id).shift(); fly(dom).nextFx(); } }, fxanim : function(args, opt, animType, defaultDur, defaultEase, cb){ animType = animType || 'run'; opt = opt || {}; var anim = Ext.lib.Anim[animType]( this.dom, args, (opt.duration || defaultDur) || .35, (opt.easing || defaultEase) || EASEOUT, cb, this ); opt.anim = anim; return anim; } }; Ext.Fx.resize = Ext.Fx.scale; Ext.Element.addMethods(Ext.Fx); })(); Ext.CompositeElementLite = function(els, root){ this.elements = []; this.add(els, root); this.el = new Ext.Element.Flyweight(); }; Ext.CompositeElementLite.prototype = { isComposite: true, getElement : function(el){ var e = this.el; e.dom = el; e.id = el.id; return e; }, transformElement : function(el){ return Ext.getDom(el); }, getCount : function(){ return this.elements.length; }, add : function(els, root){ var me = this, elements = me.elements; if(!els){ return this; } if(typeof els == "string"){ els = Ext.Element.selectorFunction(els, root); }else if(els.isComposite){ els = els.elements; }else if(!Ext.isIterable(els)){ els = [els]; } for(var i = 0, len = els.length; i < len; ++i){ elements.push(me.transformElement(els[i])); } return me; }, invoke : function(fn, args){ var me = this, els = me.elements, len = els.length, e, i; for(i = 0; i < len; i++) { e = els[i]; if(e){ Ext.Element.prototype[fn].apply(me.getElement(e), args); } } return me; }, item : function(index){ var me = this, el = me.elements[index], out = null; if(el){ out = me.getElement(el); } return out; }, addListener : function(eventName, handler, scope, opt){ var els = this.elements, len = els.length, i, e; for(i = 0; i -1){ replacement = Ext.getDom(replacement); if(domReplace){ d = this.elements[index]; d.parentNode.insertBefore(replacement, d); Ext.removeNode(d); } this.elements.splice(index, 1, replacement); } return this; }, clear : function(){ this.elements = []; } }; Ext.CompositeElementLite.prototype.on = Ext.CompositeElementLite.prototype.addListener; Ext.CompositeElementLite.importElementMethods = function() { var fnName, ElProto = Ext.Element.prototype, CelProto = Ext.CompositeElementLite.prototype; for (fnName in ElProto) { if (typeof ElProto[fnName] == 'function'){ (function(fnName) { CelProto[fnName] = CelProto[fnName] || function() { return this.invoke(fnName, arguments); }; }).call(CelProto, fnName); } } }; Ext.CompositeElementLite.importElementMethods(); if(Ext.DomQuery){ Ext.Element.selectorFunction = Ext.DomQuery.select; } Ext.Element.select = function(selector, root){ var els; if(typeof selector == "string"){ els = Ext.Element.selectorFunction(selector, root); }else if(selector.length !== undefined){ els = selector; }else{ throw "Invalid selector"; } return new Ext.CompositeElementLite(els); }; Ext.select = Ext.Element.select; (function(){ var BEFOREREQUEST = "beforerequest", REQUESTCOMPLETE = "requestcomplete", REQUESTEXCEPTION = "requestexception", UNDEFINED = undefined, LOAD = 'load', POST = 'POST', GET = 'GET', WINDOW = window; Ext.data.Connection = function(config){ Ext.apply(this, config); this.addEvents( BEFOREREQUEST, REQUESTCOMPLETE, REQUESTEXCEPTION ); Ext.data.Connection.superclass.constructor.call(this); }; Ext.extend(Ext.data.Connection, Ext.util.Observable, { timeout : 30000, autoAbort:false, disableCaching: true, disableCachingParam: '_dc', request : function(o){ var me = this; if(me.fireEvent(BEFOREREQUEST, me, o)){ if (o.el) { if(!Ext.isEmpty(o.indicatorText)){ me.indicatorText = '
    '+o.indicatorText+"
    "; } if(me.indicatorText) { Ext.getDom(o.el).innerHTML = me.indicatorText; } o.success = (Ext.isFunction(o.success) ? o.success : function(){}).createInterceptor(function(response) { Ext.getDom(o.el).innerHTML = response.responseText; }); } var p = o.params, url = o.url || me.url, method, cb = {success: me.handleResponse, failure: me.handleFailure, scope: me, argument: {options: o}, timeout : Ext.num(o.timeout, me.timeout) }, form, serForm; if (Ext.isFunction(p)) { p = p.call(o.scope||WINDOW, o); } p = Ext.urlEncode(me.extraParams, Ext.isObject(p) ? Ext.urlEncode(p) : p); if (Ext.isFunction(url)) { url = url.call(o.scope || WINDOW, o); } if((form = Ext.getDom(o.form))){ url = url || form.action; if(o.isUpload || (/multipart\/form-data/i.test(form.getAttribute("enctype")))) { return me.doFormUpload.call(me, o, p, url); } serForm = Ext.lib.Ajax.serializeForm(form); p = p ? (p + '&' + serForm) : serForm; } method = o.method || me.method || ((p || o.xmlData || o.jsonData) ? POST : GET); if(method === GET && (me.disableCaching && o.disableCaching !== false) || o.disableCaching === true){ var dcp = o.disableCachingParam || me.disableCachingParam; url = Ext.urlAppend(url, dcp + '=' + (new Date().getTime())); } o.headers = Ext.applyIf(o.headers || {}, me.defaultHeaders || {}); if(o.autoAbort === true || me.autoAbort) { me.abort(); } if((method == GET || o.xmlData || o.jsonData) && p){ url = Ext.urlAppend(url, p); p = ''; } return (me.transId = Ext.lib.Ajax.request(method, url, cb, p, o)); }else{ return o.callback ? o.callback.apply(o.scope, [o,UNDEFINED,UNDEFINED]) : null; } }, isLoading : function(transId){ return transId ? Ext.lib.Ajax.isCallInProgress(transId) : !! this.transId; }, abort : function(transId){ if(transId || this.isLoading()){ Ext.lib.Ajax.abort(transId || this.transId); } }, handleResponse : function(response){ this.transId = false; var options = response.argument.options; response.argument = options ? options.argument : null; this.fireEvent(REQUESTCOMPLETE, this, response, options); if(options.success){ options.success.call(options.scope, response, options); } if(options.callback){ options.callback.call(options.scope, options, true, response); } }, handleFailure : function(response, e){ this.transId = false; var options = response.argument.options; response.argument = options ? options.argument : null; this.fireEvent(REQUESTEXCEPTION, this, response, options, e); if(options.failure){ options.failure.call(options.scope, response, options); } if(options.callback){ options.callback.call(options.scope, options, false, response); } }, doFormUpload : function(o, ps, url){ var id = Ext.id(), doc = document, frame = doc.createElement('iframe'), form = Ext.getDom(o.form), hiddens = [], hd, encoding = 'multipart/form-data', buf = { target: form.target, method: form.method, encoding: form.encoding, enctype: form.enctype, action: form.action }; Ext.fly(frame).set({ id: id, name: id, cls: 'x-hidden', src: Ext.SSL_SECURE_URL }); doc.body.appendChild(frame); if(Ext.isIE){ document.frames[id].name = id; } Ext.fly(form).set({ target: id, method: POST, enctype: encoding, encoding: encoding, action: url || buf.action }); Ext.iterate(Ext.urlDecode(ps, false), function(k, v){ hd = doc.createElement('input'); Ext.fly(hd).set({ type: 'hidden', value: v, name: k }); form.appendChild(hd); hiddens.push(hd); }); function cb(){ var me = this, r = {responseText : '', responseXML : null, argument : o.argument}, doc, firstChild; try{ doc = frame.contentWindow.document || frame.contentDocument || WINDOW.frames[id].document; if(doc){ if(doc.body){ if(/textarea/i.test((firstChild = doc.body.firstChild || {}).tagName)){ r.responseText = firstChild.value; }else{ r.responseText = doc.body.innerHTML; } } r.responseXML = doc.XMLDocument || doc; } } catch(e) {} Ext.EventManager.removeListener(frame, LOAD, cb, me); me.fireEvent(REQUESTCOMPLETE, me, r, o); function runCallback(fn, scope, args){ if(Ext.isFunction(fn)){ fn.apply(scope, args); } } runCallback(o.success, o.scope, [r, o]); runCallback(o.callback, o.scope, [o, true, r]); if(!me.debugUploads){ setTimeout(function(){Ext.removeNode(frame);}, 100); } } Ext.EventManager.on(frame, LOAD, cb, this); form.submit(); Ext.fly(form).set(buf); Ext.each(hiddens, function(h) { Ext.removeNode(h); }); } }); })(); Ext.Ajax = new Ext.data.Connection({ autoAbort : false, serializeForm : function(form){ return Ext.lib.Ajax.serializeForm(form); } }); Ext.util.JSON = new (function(){ var useHasOwn = !!{}.hasOwnProperty, isNative = function() { var useNative = null; return function() { if (useNative === null) { useNative = Ext.USE_NATIVE_JSON && window.JSON && JSON.toString() == '[object JSON]'; } return useNative; }; }(), pad = function(n) { return n < 10 ? "0" + n : n; }, doDecode = function(json){ return json ? eval("(" + json + ")") : ""; }, doEncode = function(o){ if(!Ext.isDefined(o) || o === null){ return "null"; }else if(Ext.isArray(o)){ return encodeArray(o); }else if(Ext.isDate(o)){ return Ext.util.JSON.encodeDate(o); }else if(Ext.isString(o)){ return encodeString(o); }else if(typeof o == "number"){ return isFinite(o) ? String(o) : "null"; }else if(Ext.isBoolean(o)){ return String(o); }else { var a = ["{"], b, i, v; for (i in o) { if(!o.getElementsByTagName){ if(!useHasOwn || o.hasOwnProperty(i)) { v = o[i]; switch (typeof v) { case "undefined": case "function": case "unknown": break; default: if(b){ a.push(','); } a.push(doEncode(i), ":", v === null ? "null" : doEncode(v)); b = true; } } } } a.push("}"); return a.join(""); } }, m = { "\b": '\\b', "\t": '\\t', "\n": '\\n', "\f": '\\f', "\r": '\\r', '"' : '\\"', "\\": '\\\\' }, encodeString = function(s){ if (/["\\\x00-\x1f]/.test(s)) { return '"' + s.replace(/([\x00-\x1f\\"])/g, function(a, b) { var c = m[b]; if(c){ return c; } c = b.charCodeAt(); return "\\u00" + Math.floor(c / 16).toString(16) + (c % 16).toString(16); }) + '"'; } return '"' + s + '"'; }, encodeArray = function(o){ var a = ["["], b, i, l = o.length, v; for (i = 0; i < l; i += 1) { v = o[i]; switch (typeof v) { case "undefined": case "function": case "unknown": break; default: if (b) { a.push(','); } a.push(v === null ? "null" : Ext.util.JSON.encode(v)); b = true; } } a.push("]"); return a.join(""); }; this.encodeDate = function(o){ return '"' + o.getFullYear() + "-" + pad(o.getMonth() + 1) + "-" + pad(o.getDate()) + "T" + pad(o.getHours()) + ":" + pad(o.getMinutes()) + ":" + pad(o.getSeconds()) + '"'; }; this.encode = function() { var ec; return function(o) { if (!ec) { ec = isNative() ? JSON.stringify : doEncode; } return ec(o); }; }(); this.decode = function() { var dc; return function(json) { if (!dc) { dc = isNative() ? JSON.parse : doDecode; } return dc(json); }; }(); })(); Ext.encode = Ext.util.JSON.encode; Ext.decode = Ext.util.JSON.decode; Ext.EventManager = function(){ var docReadyEvent, docReadyProcId, docReadyState = false, DETECT_NATIVE = Ext.isGecko || Ext.isWebKit || Ext.isSafari, E = Ext.lib.Event, D = Ext.lib.Dom, DOC = document, WINDOW = window, DOMCONTENTLOADED = "DOMContentLoaded", COMPLETE = 'complete', propRe = /^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/, specialElCache = []; function getId(el){ var id = false, i = 0, len = specialElCache.length, skip = false, o; if (el) { if (el.getElementById || el.navigator) { for(; i < len; ++i){ o = specialElCache[i]; if(o.el === el){ id = o.id; break; } } if(!id){ id = Ext.id(el); specialElCache.push({ id: id, el: el }); skip = true; } }else{ id = Ext.id(el); } if(!Ext.elCache[id]){ Ext.Element.addToCache(new Ext.Element(el), id); if(skip){ Ext.elCache[id].skipGC = true; } } } return id; } function addListener(el, ename, fn, task, wrap, scope){ el = Ext.getDom(el); var id = getId(el), es = Ext.elCache[id].events, wfn; wfn = E.on(el, ename, wrap); es[ename] = es[ename] || []; es[ename].push([fn, wrap, scope, wfn, task]); if(el.addEventListener && ename == "mousewheel"){ var args = ["DOMMouseScroll", wrap, false]; el.addEventListener.apply(el, args); Ext.EventManager.addListener(WINDOW, 'unload', function(){ el.removeEventListener.apply(el, args); }); } if(el == DOC && ename == "mousedown"){ Ext.EventManager.stoppedMouseDownEvent.addListener(wrap); } } function doScrollChk(){ if(window != top){ return false; } try{ DOC.documentElement.doScroll('left'); }catch(e){ return false; } fireDocReady(); return true; } function checkReadyState(e){ if(Ext.isIE && doScrollChk()){ return true; } if(DOC.readyState == COMPLETE){ fireDocReady(); return true; } docReadyState || (docReadyProcId = setTimeout(arguments.callee, 2)); return false; } var styles; function checkStyleSheets(e){ styles || (styles = Ext.query('style, link[rel=stylesheet]')); if(styles.length == DOC.styleSheets.length){ fireDocReady(); return true; } docReadyState || (docReadyProcId = setTimeout(arguments.callee, 2)); return false; } function OperaDOMContentLoaded(e){ DOC.removeEventListener(DOMCONTENTLOADED, arguments.callee, false); checkStyleSheets(); } function fireDocReady(e){ if(!docReadyState){ docReadyState = true; if(docReadyProcId){ clearTimeout(docReadyProcId); } if(DETECT_NATIVE) { DOC.removeEventListener(DOMCONTENTLOADED, fireDocReady, false); } if(Ext.isIE && checkReadyState.bindIE){ DOC.detachEvent('onreadystatechange', checkReadyState); } E.un(WINDOW, "load", arguments.callee); } if(docReadyEvent && !Ext.isReady){ Ext.isReady = true; docReadyEvent.fire(); docReadyEvent.listeners = []; } } function initDocReady(){ docReadyEvent || (docReadyEvent = new Ext.util.Event()); if (DETECT_NATIVE) { DOC.addEventListener(DOMCONTENTLOADED, fireDocReady, false); } if (Ext.isIE){ if(!checkReadyState()){ checkReadyState.bindIE = true; DOC.attachEvent('onreadystatechange', checkReadyState); } }else if(Ext.isOpera ){ (DOC.readyState == COMPLETE && checkStyleSheets()) || DOC.addEventListener(DOMCONTENTLOADED, OperaDOMContentLoaded, false); }else if (Ext.isWebKit){ checkReadyState(); } E.on(WINDOW, "load", fireDocReady); } function createTargeted(h, o){ return function(){ var args = Ext.toArray(arguments); if(o.target == Ext.EventObject.setEvent(args[0]).target){ h.apply(this, args); } }; } function createBuffered(h, o, task){ return function(e){ task.delay(o.buffer, h, null, [new Ext.EventObjectImpl(e)]); }; } function createSingle(h, el, ename, fn, scope){ return function(e){ Ext.EventManager.removeListener(el, ename, fn, scope); h(e); }; } function createDelayed(h, o, fn){ return function(e){ var task = new Ext.util.DelayedTask(h); if(!fn.tasks) { fn.tasks = []; } fn.tasks.push(task); task.delay(o.delay || 10, h, null, [new Ext.EventObjectImpl(e)]); }; } function listen(element, ename, opt, fn, scope){ var o = (!opt || typeof opt == "boolean") ? {} : opt, el = Ext.getDom(element), task; fn = fn || o.fn; scope = scope || o.scope; if(!el){ throw "Error listening for \"" + ename + '\". Element "' + element + '" doesn\'t exist.'; } function h(e){ if(!Ext){ return; } e = Ext.EventObject.setEvent(e); var t; if (o.delegate) { if(!(t = e.getTarget(o.delegate, el))){ return; } } else { t = e.target; } if (o.stopEvent) { e.stopEvent(); } if (o.preventDefault) { e.preventDefault(); } if (o.stopPropagation) { e.stopPropagation(); } if (o.normalized === false) { e = e.browserEvent; } fn.call(scope || el, e, t, o); } if(o.target){ h = createTargeted(h, o); } if(o.delay){ h = createDelayed(h, o, fn); } if(o.single){ h = createSingle(h, el, ename, fn, scope); } if(o.buffer){ task = new Ext.util.DelayedTask(h); h = createBuffered(h, o, task); } addListener(el, ename, fn, task, h, scope); return h; } var pub = { addListener : function(element, eventName, fn, scope, options){ if(typeof eventName == 'object'){ var o = eventName, e, val; for(e in o){ val = o[e]; if(!propRe.test(e)){ if(Ext.isFunction(val)){ listen(element, e, o, val, o.scope); }else{ listen(element, e, val); } } } } else { listen(element, eventName, options, fn, scope); } }, removeListener : function(el, eventName, fn, scope){ el = Ext.getDom(el); var id = getId(el), f = el && (Ext.elCache[id].events)[eventName] || [], wrap, i, l, k, len, fnc; for (i = 0, len = f.length; i < len; i++) { if (Ext.isArray(fnc = f[i]) && fnc[0] == fn && (!scope || fnc[2] == scope)) { if(fnc[4]) { fnc[4].cancel(); } k = fn.tasks && fn.tasks.length; if(k) { while(k--) { fn.tasks[k].cancel(); } delete fn.tasks; } wrap = fnc[1]; E.un(el, eventName, E.extAdapter ? fnc[3] : wrap); if(wrap && el.addEventListener && eventName == "mousewheel"){ el.removeEventListener("DOMMouseScroll", wrap, false); } if(wrap && el == DOC && eventName == "mousedown"){ Ext.EventManager.stoppedMouseDownEvent.removeListener(wrap); } f.splice(i, 1); if (f.length === 0) { delete Ext.elCache[id].events[eventName]; } for (k in Ext.elCache[id].events) { return false; } Ext.elCache[id].events = {}; return false; } } }, removeAll : function(el){ el = Ext.getDom(el); var id = getId(el), ec = Ext.elCache[id] || {}, es = ec.events || {}, f, i, len, ename, fn, k, wrap; for(ename in es){ if(es.hasOwnProperty(ename)){ f = es[ename]; for (i = 0, len = f.length; i < len; i++) { fn = f[i]; if(fn[4]) { fn[4].cancel(); } if(fn[0].tasks && (k = fn[0].tasks.length)) { while(k--) { fn[0].tasks[k].cancel(); } delete fn.tasks; } wrap = fn[1]; E.un(el, ename, E.extAdapter ? fn[3] : wrap); if(el.addEventListener && wrap && ename == "mousewheel"){ el.removeEventListener("DOMMouseScroll", wrap, false); } if(wrap && el == DOC && ename == "mousedown"){ Ext.EventManager.stoppedMouseDownEvent.removeListener(wrap); } } } } if (Ext.elCache[id]) { Ext.elCache[id].events = {}; } }, getListeners : function(el, eventName) { el = Ext.getDom(el); var id = getId(el), ec = Ext.elCache[id] || {}, es = ec.events || {}, results = []; if (es && es[eventName]) { return es[eventName]; } else { return null; } }, purgeElement : function(el, recurse, eventName) { el = Ext.getDom(el); var id = getId(el), ec = Ext.elCache[id] || {}, es = ec.events || {}, i, f, len; if (eventName) { if (es && es.hasOwnProperty(eventName)) { f = es[eventName]; for (i = 0, len = f.length; i < len; i++) { Ext.EventManager.removeListener(el, eventName, f[i][0]); } } } else { Ext.EventManager.removeAll(el); } if (recurse && el && el.childNodes) { for (i = 0, len = el.childNodes.length; i < len; i++) { Ext.EventManager.purgeElement(el.childNodes[i], recurse, eventName); } } }, _unload : function() { var el; for (el in Ext.elCache) { Ext.EventManager.removeAll(el); } delete Ext.elCache; delete Ext.Element._flyweights; var c, conn, tid, ajax = Ext.lib.Ajax; (typeof ajax.conn == 'object') ? conn = ajax.conn : conn = {}; for (tid in conn) { c = conn[tid]; if (c) { ajax.abort({conn: c, tId: tid}); } } }, onDocumentReady : function(fn, scope, options){ if (Ext.isReady) { docReadyEvent || (docReadyEvent = new Ext.util.Event()); docReadyEvent.addListener(fn, scope, options); docReadyEvent.fire(); docReadyEvent.listeners = []; } else { if (!docReadyEvent) { initDocReady(); } options = options || {}; options.delay = options.delay || 1; docReadyEvent.addListener(fn, scope, options); } }, fireDocReady : fireDocReady }; pub.on = pub.addListener; pub.un = pub.removeListener; pub.stoppedMouseDownEvent = new Ext.util.Event(); return pub; }(); Ext.onReady = Ext.EventManager.onDocumentReady; (function(){ var initExtCss = function() { var bd = document.body || document.getElementsByTagName('body')[0]; if (!bd) { return false; } var cls = [' ', Ext.isIE ? "ext-ie " + (Ext.isIE6 ? 'ext-ie6' : (Ext.isIE7 ? 'ext-ie7' : (Ext.isIE8 ? 'ext-ie8' : 'ext-ie9'))) : Ext.isGecko ? "ext-gecko " + (Ext.isGecko2 ? 'ext-gecko2' : 'ext-gecko3') : Ext.isOpera ? "ext-opera" : Ext.isWebKit ? "ext-webkit" : ""]; if (Ext.isSafari) { cls.push("ext-safari " + (Ext.isSafari2 ? 'ext-safari2' : (Ext.isSafari3 ? 'ext-safari3' : 'ext-safari4'))); } else if(Ext.isChrome) { cls.push("ext-chrome"); } if (Ext.isMac) { cls.push("ext-mac"); } if (Ext.isLinux) { cls.push("ext-linux"); } if (Ext.isStrict || Ext.isBorderBox) { var p = bd.parentNode; if (p) { if (!Ext.isStrict) { Ext.fly(p, '_internal').addClass('x-quirks'); if (Ext.isIE && !Ext.isStrict) { Ext.isIEQuirks = true; } } Ext.fly(p, '_internal').addClass(((Ext.isStrict && Ext.isIE ) || (!Ext.enableForcedBoxModel && !Ext.isIE)) ? ' ext-strict' : ' ext-border-box'); } } if (Ext.enableForcedBoxModel && !Ext.isIE) { Ext.isForcedBorderBox = true; cls.push("ext-forced-border-box"); } Ext.fly(bd, '_internal').addClass(cls); return true; }; if (!initExtCss()) { Ext.onReady(initExtCss); } })(); (function(){ var supports = Ext.apply(Ext.supports, { correctRightMargin: true, correctTransparentColor: true, cssFloat: true }); var supportTests = function(){ var div = document.createElement('div'), doc = document, view, last; div.innerHTML = '
    '; doc.body.appendChild(div); last = div.lastChild; if((view = doc.defaultView)){ if(view.getComputedStyle(div.firstChild.firstChild, null).marginRight != '0px'){ supports.correctRightMargin = false; } if(view.getComputedStyle(last, null).backgroundColor != 'transparent'){ supports.correctTransparentColor = false; } } supports.cssFloat = !!last.style.cssFloat; doc.body.removeChild(div); }; if (Ext.isReady) { supportTests(); } else { Ext.onReady(supportTests); } })(); Ext.EventObject = function(){ var E = Ext.lib.Event, clickRe = /(dbl)?click/, safariKeys = { 3 : 13, 63234 : 37, 63235 : 39, 63232 : 38, 63233 : 40, 63276 : 33, 63277 : 34, 63272 : 46, 63273 : 36, 63275 : 35 }, btnMap = Ext.isIE ? {1:0,4:1,2:2} : {0:0,1:1,2:2}; Ext.EventObjectImpl = function(e){ if(e){ this.setEvent(e.browserEvent || e); } }; Ext.EventObjectImpl.prototype = { setEvent : function(e){ var me = this; if(e == me || (e && e.browserEvent)){ return e; } me.browserEvent = e; if(e){ me.button = e.button ? btnMap[e.button] : (e.which ? e.which - 1 : -1); if(clickRe.test(e.type) && me.button == -1){ me.button = 0; } me.type = e.type; me.shiftKey = e.shiftKey; me.ctrlKey = e.ctrlKey || e.metaKey || false; me.altKey = e.altKey; me.keyCode = e.keyCode; me.charCode = e.charCode; me.target = E.getTarget(e); me.xy = E.getXY(e); }else{ me.button = -1; me.shiftKey = false; me.ctrlKey = false; me.altKey = false; me.keyCode = 0; me.charCode = 0; me.target = null; me.xy = [0, 0]; } return me; }, stopEvent : function(){ var me = this; if(me.browserEvent){ if(me.browserEvent.type == 'mousedown'){ Ext.EventManager.stoppedMouseDownEvent.fire(me); } E.stopEvent(me.browserEvent); } }, preventDefault : function(){ if(this.browserEvent){ E.preventDefault(this.browserEvent); } }, stopPropagation : function(){ var me = this; if(me.browserEvent){ if(me.browserEvent.type == 'mousedown'){ Ext.EventManager.stoppedMouseDownEvent.fire(me); } E.stopPropagation(me.browserEvent); } }, getCharCode : function(){ return this.charCode || this.keyCode; }, getKey : function(){ return this.normalizeKey(this.keyCode || this.charCode); }, normalizeKey: function(k){ return Ext.isSafari ? (safariKeys[k] || k) : k; }, getPageX : function(){ return this.xy[0]; }, getPageY : function(){ return this.xy[1]; }, getXY : function(){ return this.xy; }, getTarget : function(selector, maxDepth, returnEl){ return selector ? Ext.fly(this.target).findParent(selector, maxDepth, returnEl) : (returnEl ? Ext.get(this.target) : this.target); }, getRelatedTarget : function(){ return this.browserEvent ? E.getRelatedTarget(this.browserEvent) : null; }, getWheelDelta : function(){ var e = this.browserEvent; var delta = 0; if(e.wheelDelta){ delta = e.wheelDelta/120; }else if(e.detail){ delta = -e.detail/3; } return delta; }, within : function(el, related, allowEl){ if(el){ var t = this[related ? "getRelatedTarget" : "getTarget"](); return t && ((allowEl ? (t == Ext.getDom(el)) : false) || Ext.fly(el).contains(t)); } return false; } }; return new Ext.EventObjectImpl(); }(); Ext.Loader = Ext.apply({}, { load: function(fileList, callback, scope, preserveOrder) { var scope = scope || this, head = document.getElementsByTagName("head")[0], fragment = document.createDocumentFragment(), numFiles = fileList.length, loadedFiles = 0, me = this; var loadFileIndex = function(index) { head.appendChild( me.buildScriptTag(fileList[index], onFileLoaded) ); }; var onFileLoaded = function() { loadedFiles ++; if (numFiles == loadedFiles && typeof callback == 'function') { callback.call(scope); } else { if (preserveOrder === true) { loadFileIndex(loadedFiles); } } }; if (preserveOrder === true) { loadFileIndex.call(this, 0); } else { Ext.each(fileList, function(file, index) { fragment.appendChild( this.buildScriptTag(file, onFileLoaded) ); }, this); head.appendChild(fragment); } }, buildScriptTag: function(filename, callback) { var script = document.createElement('script'); script.type = "text/javascript"; script.src = filename; if (script.readyState) { script.onreadystatechange = function() { if (script.readyState == "loaded" || script.readyState == "complete") { script.onreadystatechange = null; callback(); } }; } else { script.onload = callback; } return script; } }); Ext.ns("Ext.grid", "Ext.list", "Ext.dd", "Ext.tree", "Ext.form", "Ext.menu", "Ext.state", "Ext.layout.boxOverflow", "Ext.app", "Ext.ux", "Ext.chart", "Ext.direct", "Ext.slider"); Ext.apply(Ext, function(){ var E = Ext, idSeed = 0, scrollWidth = null; return { emptyFn : function(){}, BLANK_IMAGE_URL : Ext.isIE6 || Ext.isIE7 || Ext.isAir ? 'http:/' + '/www.extjs.com/s.gif' : 'data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==', extendX : function(supr, fn){ return Ext.extend(supr, fn(supr.prototype)); }, getDoc : function(){ return Ext.get(document); }, num : function(v, defaultValue){ v = Number(Ext.isEmpty(v) || Ext.isArray(v) || typeof v == 'boolean' || (typeof v == 'string' && v.trim().length == 0) ? NaN : v); return isNaN(v) ? defaultValue : v; }, value : function(v, defaultValue, allowBlank){ return Ext.isEmpty(v, allowBlank) ? defaultValue : v; }, escapeRe : function(s) { return s.replace(/([-.*+?^${}()|[\]\/\\])/g, "\\$1"); }, sequence : function(o, name, fn, scope){ o[name] = o[name].createSequence(fn, scope); }, addBehaviors : function(o){ if(!Ext.isReady){ Ext.onReady(function(){ Ext.addBehaviors(o); }); } else { var cache = {}, parts, b, s; for (b in o) { if ((parts = b.split('@'))[1]) { s = parts[0]; if(!cache[s]){ cache[s] = Ext.select(s); } cache[s].on(parts[1], o[b]); } } cache = null; } }, getScrollBarWidth: function(force){ if(!Ext.isReady){ return 0; } if(force === true || scrollWidth === null){ var div = Ext.getBody().createChild('
    '), child = div.child('div', true); var w1 = child.offsetWidth; div.setStyle('overflow', (Ext.isWebKit || Ext.isGecko) ? 'auto' : 'scroll'); var w2 = child.offsetWidth; div.remove(); scrollWidth = w1 - w2 + 2; } return scrollWidth; }, combine : function(){ var as = arguments, l = as.length, r = []; for(var i = 0; i < l; i++){ var a = as[i]; if(Ext.isArray(a)){ r = r.concat(a); }else if(a.length !== undefined && !a.substr){ r = r.concat(Array.prototype.slice.call(a, 0)); }else{ r.push(a); } } return r; }, copyTo : function(dest, source, names){ if(typeof names == 'string'){ names = names.split(/[,;\s]/); } Ext.each(names, function(name){ if(source.hasOwnProperty(name)){ dest[name] = source[name]; } }, this); return dest; }, destroy : function(){ Ext.each(arguments, function(arg){ if(arg){ if(Ext.isArray(arg)){ this.destroy.apply(this, arg); }else if(typeof arg.destroy == 'function'){ arg.destroy(); }else if(arg.dom){ arg.remove(); } } }, this); }, destroyMembers : function(o, arg1, arg2, etc){ for(var i = 1, a = arguments, len = a.length; i < len; i++) { Ext.destroy(o[a[i]]); delete o[a[i]]; } }, clean : function(arr){ var ret = []; Ext.each(arr, function(v){ if(!!v){ ret.push(v); } }); return ret; }, unique : function(arr){ var ret = [], collect = {}; Ext.each(arr, function(v) { if(!collect[v]){ ret.push(v); } collect[v] = true; }); return ret; }, flatten : function(arr){ var worker = []; function rFlatten(a) { Ext.each(a, function(v) { if(Ext.isArray(v)){ rFlatten(v); }else{ worker.push(v); } }); return worker; } return rFlatten(arr); }, min : function(arr, comp){ var ret = arr[0]; comp = comp || function(a,b){ return a < b ? -1 : 1; }; Ext.each(arr, function(v) { ret = comp(ret, v) == -1 ? ret : v; }); return ret; }, max : function(arr, comp){ var ret = arr[0]; comp = comp || function(a,b){ return a > b ? 1 : -1; }; Ext.each(arr, function(v) { ret = comp(ret, v) == 1 ? ret : v; }); return ret; }, mean : function(arr){ return arr.length > 0 ? Ext.sum(arr) / arr.length : undefined; }, sum : function(arr){ var ret = 0; Ext.each(arr, function(v) { ret += v; }); return ret; }, partition : function(arr, truth){ var ret = [[],[]]; Ext.each(arr, function(v, i, a) { ret[ (truth && truth(v, i, a)) || (!truth && v) ? 0 : 1].push(v); }); return ret; }, invoke : function(arr, methodName){ var ret = [], args = Array.prototype.slice.call(arguments, 2); Ext.each(arr, function(v,i) { if (v && typeof v[methodName] == 'function') { ret.push(v[methodName].apply(v, args)); } else { ret.push(undefined); } }); return ret; }, pluck : function(arr, prop){ var ret = []; Ext.each(arr, function(v) { ret.push( v[prop] ); }); return ret; }, zip : function(){ var parts = Ext.partition(arguments, function( val ){ return typeof val != 'function'; }), arrs = parts[0], fn = parts[1][0], len = Ext.max(Ext.pluck(arrs, "length")), ret = []; for (var i = 0; i < len; i++) { ret[i] = []; if(fn){ ret[i] = fn.apply(fn, Ext.pluck(arrs, i)); }else{ for (var j = 0, aLen = arrs.length; j < aLen; j++){ ret[i].push( arrs[j][i] ); } } } return ret; }, getCmp : function(id){ return Ext.ComponentMgr.get(id); }, useShims: E.isIE6 || (E.isMac && E.isGecko2), type : function(o){ if(o === undefined || o === null){ return false; } if(o.htmlElement){ return 'element'; } var t = typeof o; if(t == 'object' && o.nodeName) { switch(o.nodeType) { case 1: return 'element'; case 3: return (/\S/).test(o.nodeValue) ? 'textnode' : 'whitespace'; } } if(t == 'object' || t == 'function') { switch(o.constructor) { case Array: return 'array'; case RegExp: return 'regexp'; case Date: return 'date'; } if(typeof o.length == 'number' && typeof o.item == 'function') { return 'nodelist'; } } return t; }, intercept : function(o, name, fn, scope){ o[name] = o[name].createInterceptor(fn, scope); }, callback : function(cb, scope, args, delay){ if(typeof cb == 'function'){ if(delay){ cb.defer(delay, scope, args || []); }else{ cb.apply(scope, args || []); } } } }; }()); Ext.apply(Function.prototype, { createSequence : function(fcn, scope){ var method = this; return (typeof fcn != 'function') ? this : function(){ var retval = method.apply(this || window, arguments); fcn.apply(scope || this || window, arguments); return retval; }; } }); Ext.applyIf(String, { escape : function(string) { return string.replace(/('|\\)/g, "\\$1"); }, leftPad : function (val, size, ch) { var result = String(val); if(!ch) { ch = " "; } while (result.length < size) { result = ch + result; } return result; } }); String.prototype.toggle = function(value, other){ return this == value ? other : value; }; String.prototype.trim = function(){ var re = /^\s+|\s+$/g; return function(){ return this.replace(re, ""); }; }(); Date.prototype.getElapsed = function(date) { return Math.abs((date || new Date()).getTime()-this.getTime()); }; Ext.applyIf(Number.prototype, { constrain : function(min, max){ return Math.min(Math.max(this, min), max); } }); Ext.lib.Dom.getRegion = function(el) { return Ext.lib.Region.getRegion(el); }; Ext.lib.Region = function(t, r, b, l) { var me = this; me.top = t; me[1] = t; me.right = r; me.bottom = b; me.left = l; me[0] = l; }; Ext.lib.Region.prototype = { contains : function(region) { var me = this; return ( region.left >= me.left && region.right <= me.right && region.top >= me.top && region.bottom <= me.bottom ); }, getArea : function() { var me = this; return ( (me.bottom - me.top) * (me.right - me.left) ); }, intersect : function(region) { var me = this, t = Math.max(me.top, region.top), r = Math.min(me.right, region.right), b = Math.min(me.bottom, region.bottom), l = Math.max(me.left, region.left); if (b >= t && r >= l) { return new Ext.lib.Region(t, r, b, l); } }, union : function(region) { var me = this, t = Math.min(me.top, region.top), r = Math.max(me.right, region.right), b = Math.max(me.bottom, region.bottom), l = Math.min(me.left, region.left); return new Ext.lib.Region(t, r, b, l); }, constrainTo : function(r) { var me = this; me.top = me.top.constrain(r.top, r.bottom); me.bottom = me.bottom.constrain(r.top, r.bottom); me.left = me.left.constrain(r.left, r.right); me.right = me.right.constrain(r.left, r.right); return me; }, adjust : function(t, l, b, r) { var me = this; me.top += t; me.left += l; me.right += r; me.bottom += b; return me; } }; Ext.lib.Region.getRegion = function(el) { var p = Ext.lib.Dom.getXY(el), t = p[1], r = p[0] + el.offsetWidth, b = p[1] + el.offsetHeight, l = p[0]; return new Ext.lib.Region(t, r, b, l); }; Ext.lib.Point = function(x, y) { if (Ext.isArray(x)) { y = x[1]; x = x[0]; } var me = this; me.x = me.right = me.left = me[0] = x; me.y = me.top = me.bottom = me[1] = y; }; Ext.lib.Point.prototype = new Ext.lib.Region(); Ext.apply(Ext.DomHelper, function(){ var pub, afterbegin = 'afterbegin', afterend = 'afterend', beforebegin = 'beforebegin', beforeend = 'beforeend', confRe = /tag|children|cn|html$/i; function doInsert(el, o, returnElement, pos, sibling, append){ el = Ext.getDom(el); var newNode; if (pub.useDom) { newNode = createDom(o, null); if (append) { el.appendChild(newNode); } else { (sibling == 'firstChild' ? el : el.parentNode).insertBefore(newNode, el[sibling] || el); } } else { newNode = Ext.DomHelper.insertHtml(pos, el, Ext.DomHelper.createHtml(o)); } return returnElement ? Ext.get(newNode, true) : newNode; } function createDom(o, parentNode){ var el, doc = document, useSet, attr, val, cn; if (Ext.isArray(o)) { el = doc.createDocumentFragment(); for (var i = 0, l = o.length; i < l; i++) { createDom(o[i], el); } } else if (typeof o == 'string') { el = doc.createTextNode(o); } else { el = doc.createElement( o.tag || 'div' ); useSet = !!el.setAttribute; for (var attr in o) { if(!confRe.test(attr)){ val = o[attr]; if(attr == 'cls'){ el.className = val; }else{ if(useSet){ el.setAttribute(attr, val); }else{ el[attr] = val; } } } } Ext.DomHelper.applyStyles(el, o.style); if ((cn = o.children || o.cn)) { createDom(cn, el); } else if (o.html) { el.innerHTML = o.html; } } if(parentNode){ parentNode.appendChild(el); } return el; } pub = { createTemplate : function(o){ var html = Ext.DomHelper.createHtml(o); return new Ext.Template(html); }, useDom : false, insertBefore : function(el, o, returnElement){ return doInsert(el, o, returnElement, beforebegin); }, insertAfter : function(el, o, returnElement){ return doInsert(el, o, returnElement, afterend, 'nextSibling'); }, insertFirst : function(el, o, returnElement){ return doInsert(el, o, returnElement, afterbegin, 'firstChild'); }, append: function(el, o, returnElement){ return doInsert(el, o, returnElement, beforeend, '', true); }, createDom: createDom }; return pub; }()); Ext.apply(Ext.Template.prototype, { disableFormats : false, re : /\{([\w\-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g, argsRe : /^\s*['"](.*)["']\s*$/, compileARe : /\\/g, compileBRe : /(\r\n|\n)/g, compileCRe : /'/g, /** * Returns an HTML fragment of this template with the specified values applied. * @param {Object/Array} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'}) * @return {String} The HTML fragment * @hide repeat doc */ applyTemplate : function(values){ var me = this, useF = me.disableFormats !== true, fm = Ext.util.Format, tpl = me; if(me.compiled){ return me.compiled(values); } function fn(m, name, format, args){ if (format && useF) { if (format.substr(0, 5) == "this.") { return tpl.call(format.substr(5), values[name], values); } else { if (args) { // quoted values are required for strings in compiled templates, // but for non compiled we need to strip them // quoted reversed for jsmin var re = me.argsRe; args = args.split(','); for(var i = 0, len = args.length; i < len; i++){ args[i] = args[i].replace(re, "$1"); } args = [values[name]].concat(args); } else { args = [values[name]]; } return fm[format].apply(fm, args); } } else { return values[name] !== undefined ? values[name] : ""; } } return me.html.replace(me.re, fn); }, /** * Compiles the template into an internal function, eliminating the RegEx overhead. * @return {Ext.Template} this * @hide repeat doc */ compile : function(){ var me = this, fm = Ext.util.Format, useF = me.disableFormats !== true, sep = Ext.isGecko ? "+" : ",", body; function fn(m, name, format, args){ if(format && useF){ args = args ? ',' + args : ""; if(format.substr(0, 5) != "this."){ format = "fm." + format + '('; }else{ format = 'this.call("'+ format.substr(5) + '", '; args = ", values"; } }else{ args= ''; format = "(values['" + name + "'] == undefined ? '' : "; } return "'"+ sep + format + "values['" + name + "']" + args + ")"+sep+"'"; } // branched to use + in gecko and [].join() in others if(Ext.isGecko){ body = "this.compiled = function(values){ return '" + me.html.replace(me.compileARe, '\\\\').replace(me.compileBRe, '\\n').replace(me.compileCRe, "\\'").replace(me.re, fn) + "';};"; }else{ body = ["this.compiled = function(values){ return ['"]; body.push(me.html.replace(me.compileARe, '\\\\').replace(me.compileBRe, '\\n').replace(me.compileCRe, "\\'").replace(me.re, fn)); body.push("'].join('');};"); body = body.join(''); } eval(body); return me; }, // private function used to call members call : function(fnName, value, allValues){ return this[fnName](value, allValues); } }); Ext.Template.prototype.apply = Ext.Template.prototype.applyTemplate; /** * @class Ext.util.Functions * @singleton */ Ext.util.Functions = { /** * Creates an interceptor function. The passed function is called before the original one. If it returns false, * the original one is not called. The resulting function returns the results of the original function. * The passed function is called with the parameters of the original function. Example usage: *
    
    var sayHi = function(name){
        alert('Hi, ' + name);
    }
    
    sayHi('Fred'); // alerts "Hi, Fred"
    
    // create a new function that validates input without
    // directly modifying the original function:
    var sayHiToFriend = Ext.createInterceptor(sayHi, function(name){
        return name == 'Brian';
    });
    
    sayHiToFriend('Fred');  // no alert
    sayHiToFriend('Brian'); // alerts "Hi, Brian"
           
    * @param {Function} origFn The original function. * @param {Function} newFn The function to call before the original * @param {Object} scope (optional) The scope (this reference) in which the passed function is executed. * If omitted, defaults to the scope in which the original function is called or the browser window. * @return {Function} The new function */ createInterceptor: function(origFn, newFn, scope) { var method = origFn; if (!Ext.isFunction(newFn)) { return origFn; } else { return function() { var me = this, args = arguments; newFn.target = me; newFn.method = origFn; return (newFn.apply(scope || me || window, args) !== false) ? origFn.apply(me || window, args) : null; }; } }, /** * Creates a delegate (callback) that sets the scope to obj. * Call directly on any function. Example: Ext.createDelegate(this.myFunction, this, [arg1, arg2]) * Will create a function that is automatically scoped to obj so that the this variable inside the * callback points to obj. Example usage: *
    
    var sayHi = function(name){
        // Note this use of "this.text" here.  This function expects to
        // execute within a scope that contains a text property.  In this
        // example, the "this" variable is pointing to the btn object that
        // was passed in createDelegate below.
        alert('Hi, ' + name + '. You clicked the "' + this.text + '" button.');
    }
    
    var btn = new Ext.Button({
        text: 'Say Hi',
        renderTo: Ext.getBody()
    });
    
    // This callback will execute in the scope of the
    // button instance. Clicking the button alerts
    // "Hi, Fred. You clicked the "Say Hi" button."
    btn.on('click', Ext.createDelegate(sayHi, btn, ['Fred']));
           
    * @param {Function} fn The function to delegate. * @param {Object} scope (optional) The scope (this reference) in which the function is executed. * If omitted, defaults to the browser window. * @param {Array} args (optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller) * @param {Boolean/Number} appendArgs (optional) if True args are appended to call args instead of overriding, * if a number the args are inserted at the specified position * @return {Function} The new function */ createDelegate: function(fn, obj, args, appendArgs) { if (!Ext.isFunction(fn)) { return fn; } return function() { var callArgs = args || arguments; if (appendArgs === true) { callArgs = Array.prototype.slice.call(arguments, 0); callArgs = callArgs.concat(args); } else if (Ext.isNumber(appendArgs)) { callArgs = Array.prototype.slice.call(arguments, 0); // copy arguments first var applyArgs = [appendArgs, 0].concat(args); // create method call params Array.prototype.splice.apply(callArgs, applyArgs); // splice them in } return fn.apply(obj || window, callArgs); }; }, /** * Calls this function after the number of millseconds specified, optionally in a specific scope. Example usage: *
    
    var sayHi = function(name){
        alert('Hi, ' + name);
    }
    
    // executes immediately:
    sayHi('Fred');
    
    // executes after 2 seconds:
    Ext.defer(sayHi, 2000, this, ['Fred']);
    
    // this syntax is sometimes useful for deferring
    // execution of an anonymous function:
    Ext.defer(function(){
        alert('Anonymous');
    }, 100);
           
    * @param {Function} fn The function to defer. * @param {Number} millis The number of milliseconds for the setTimeout call (if less than or equal to 0 the function is executed immediately) * @param {Object} scope (optional) The scope (this reference) in which the function is executed. * If omitted, defaults to the browser window. * @param {Array} args (optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller) * @param {Boolean/Number} appendArgs (optional) if True args are appended to call args instead of overriding, * if a number the args are inserted at the specified position * @return {Number} The timeout id that can be used with clearTimeout */ defer: function(fn, millis, obj, args, appendArgs) { fn = Ext.util.Functions.createDelegate(fn, obj, args, appendArgs); if (millis > 0) { return setTimeout(fn, millis); } fn(); return 0; }, /** * Create a combined function call sequence of the original function + the passed function. * The resulting function returns the results of the original function. * The passed fcn is called with the parameters of the original function. Example usage: * var sayHi = function(name){ alert('Hi, ' + name); } sayHi('Fred'); // alerts "Hi, Fred" var sayGoodbye = Ext.createSequence(sayHi, function(name){ alert('Bye, ' + name); }); sayGoodbye('Fred'); // both alerts show * @param {Function} origFn The original function. * @param {Function} newFn The function to sequence * @param {Object} scope (optional) The scope (this reference) in which the passed function is executed. * If omitted, defaults to the scope in which the original function is called or the browser window. * @return {Function} The new function */ createSequence: function(origFn, newFn, scope) { if (!Ext.isFunction(newFn)) { return origFn; } else { return function() { var retval = origFn.apply(this || window, arguments); newFn.apply(scope || this || window, arguments); return retval; }; } } }; /** * Shorthand for {@link Ext.util.Functions#defer} * @param {Function} fn The function to defer. * @param {Number} millis The number of milliseconds for the setTimeout call (if less than or equal to 0 the function is executed immediately) * @param {Object} scope (optional) The scope (this reference) in which the function is executed. * If omitted, defaults to the browser window. * @param {Array} args (optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller) * @param {Boolean/Number} appendArgs (optional) if True args are appended to call args instead of overriding, * if a number the args are inserted at the specified position * @return {Number} The timeout id that can be used with clearTimeout * @member Ext * @method defer */ Ext.defer = Ext.util.Functions.defer; /** * Shorthand for {@link Ext.util.Functions#createInterceptor} * @param {Function} origFn The original function. * @param {Function} newFn The function to call before the original * @param {Object} scope (optional) The scope (this reference) in which the passed function is executed. * If omitted, defaults to the scope in which the original function is called or the browser window. * @return {Function} The new function * @member Ext * @method defer */ Ext.createInterceptor = Ext.util.Functions.createInterceptor; /** * Shorthand for {@link Ext.util.Functions#createSequence} * @param {Function} origFn The original function. * @param {Function} newFn The function to sequence * @param {Object} scope (optional) The scope (this reference) in which the passed function is executed. * If omitted, defaults to the scope in which the original function is called or the browser window. * @return {Function} The new function * @member Ext * @method defer */ Ext.createSequence = Ext.util.Functions.createSequence; /** * Shorthand for {@link Ext.util.Functions#createDelegate} * @param {Function} fn The function to delegate. * @param {Object} scope (optional) The scope (this reference) in which the function is executed. * If omitted, defaults to the browser window. * @param {Array} args (optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller) * @param {Boolean/Number} appendArgs (optional) if True args are appended to call args instead of overriding, * if a number the args are inserted at the specified position * @return {Function} The new function * @member Ext * @method defer */ Ext.createDelegate = Ext.util.Functions.createDelegate; /** * @class Ext.util.Observable */ Ext.apply(Ext.util.Observable.prototype, function(){ // this is considered experimental (along with beforeMethod, afterMethod, removeMethodListener?) // allows for easier interceptor and sequences, including cancelling and overwriting the return value of the call // private function getMethodEvent(method){ var e = (this.methodEvents = this.methodEvents || {})[method], returnValue, v, cancel, obj = this; if (!e) { this.methodEvents[method] = e = {}; e.originalFn = this[method]; e.methodName = method; e.before = []; e.after = []; var makeCall = function(fn, scope, args){ if((v = fn.apply(scope || obj, args)) !== undefined){ if (typeof v == 'object') { if(v.returnValue !== undefined){ returnValue = v.returnValue; }else{ returnValue = v; } cancel = !!v.cancel; } else if (v === false) { cancel = true; } else { returnValue = v; } } }; this[method] = function(){ var args = Array.prototype.slice.call(arguments, 0), b; returnValue = v = undefined; cancel = false; for(var i = 0, len = e.before.length; i < len; i++){ b = e.before[i]; makeCall(b.fn, b.scope, args); if (cancel) { return returnValue; } } if((v = e.originalFn.apply(obj, args)) !== undefined){ returnValue = v; } for(var i = 0, len = e.after.length; i < len; i++){ b = e.after[i]; makeCall(b.fn, b.scope, args); if (cancel) { return returnValue; } } return returnValue; }; } return e; } return { // these are considered experimental // allows for easier interceptor and sequences, including cancelling and overwriting the return value of the call // adds an 'interceptor' called before the original method beforeMethod : function(method, fn, scope){ getMethodEvent.call(this, method).before.push({ fn: fn, scope: scope }); }, // adds a 'sequence' called after the original method afterMethod : function(method, fn, scope){ getMethodEvent.call(this, method).after.push({ fn: fn, scope: scope }); }, removeMethodListener: function(method, fn, scope){ var e = this.getMethodEvent(method); for(var i = 0, len = e.before.length; i < len; i++){ if(e.before[i].fn == fn && e.before[i].scope == scope){ e.before.splice(i, 1); return; } } for(var i = 0, len = e.after.length; i < len; i++){ if(e.after[i].fn == fn && e.after[i].scope == scope){ e.after.splice(i, 1); return; } } }, /** * Relays selected events from the specified Observable as if the events were fired by this. * @param {Object} o The Observable whose events this object is to relay. * @param {Array} events Array of event names to relay. */ relayEvents : function(o, events){ var me = this; function createHandler(ename){ return function(){ return me.fireEvent.apply(me, [ename].concat(Array.prototype.slice.call(arguments, 0))); }; } for(var i = 0, len = events.length; i < len; i++){ var ename = events[i]; me.events[ename] = me.events[ename] || true; o.on(ename, createHandler(ename), me); } }, /** *

    Enables events fired by this Observable to bubble up an owner hierarchy by calling * this.getBubbleTarget() if present. There is no implementation in the Observable base class.

    *

    This is commonly used by Ext.Components to bubble events to owner Containers. See {@link Ext.Component.getBubbleTarget}. The default * implementation in Ext.Component returns the Component's immediate owner. But if a known target is required, this can be overridden to * access the required target more quickly.

    *

    Example:

    
    Ext.override(Ext.form.Field, {
        
        initComponent : Ext.form.Field.prototype.initComponent.createSequence(function() {
            this.enableBubble('change');
        }),
    
        
        getBubbleTarget : function() {
            if (!this.formPanel) {
                this.formPanel = this.findParentByType('form');
            }
            return this.formPanel;
        }
    });
    
    var myForm = new Ext.formPanel({
        title: 'User Details',
        items: [{
            ...
        }],
        listeners: {
            change: function() {
                
                myForm.header.setStyle('color', 'red');
            }
        }
    });
    
    * @param {String/Array} events The event name to bubble, or an Array of event names. */ enableBubble : function(events){ var me = this; if(!Ext.isEmpty(events)){ events = Ext.isArray(events) ? events : Array.prototype.slice.call(arguments, 0); for(var i = 0, len = events.length; i < len; i++){ var ename = events[i]; ename = ename.toLowerCase(); var ce = me.events[ename] || true; if (typeof ce == 'boolean') { ce = new Ext.util.Event(me, ename); me.events[ename] = ce; } ce.bubble = true; } } } }; }()); Ext.util.Observable.capture = function(o, fn, scope){ o.fireEvent = o.fireEvent.createInterceptor(fn, scope); }; Ext.util.Observable.observeClass = function(c, listeners){ if(c){ if(!c.fireEvent){ Ext.apply(c, new Ext.util.Observable()); Ext.util.Observable.capture(c.prototype, c.fireEvent, c); } if(typeof listeners == 'object'){ c.on(listeners); } return c; } }; Ext.apply(Ext.EventManager, function(){ var resizeEvent, resizeTask, textEvent, textSize, D = Ext.lib.Dom, propRe = /^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/, unload = Ext.EventManager._unload, curWidth = 0, curHeight = 0, useKeydown = Ext.isWebKit ? Ext.num(navigator.userAgent.match(/AppleWebKit\/(\d+)/)[1]) >= 525 : !((Ext.isGecko && !Ext.isWindows) || Ext.isOpera); return { _unload: function(){ Ext.EventManager.un(window, "resize", this.fireWindowResize, this); unload.call(Ext.EventManager); }, doResizeEvent: function(){ var h = D.getViewHeight(), w = D.getViewWidth(); if(curHeight != h || curWidth != w){ resizeEvent.fire(curWidth = w, curHeight = h); } }, onWindowResize : function(fn, scope, options){ if(!resizeEvent){ resizeEvent = new Ext.util.Event(); resizeTask = new Ext.util.DelayedTask(this.doResizeEvent); Ext.EventManager.on(window, "resize", this.fireWindowResize, this); } resizeEvent.addListener(fn, scope, options); }, fireWindowResize : function(){ if(resizeEvent){ resizeTask.delay(100); } }, onTextResize : function(fn, scope, options){ if(!textEvent){ textEvent = new Ext.util.Event(); var textEl = new Ext.Element(document.createElement('div')); textEl.dom.className = 'x-text-resize'; textEl.dom.innerHTML = 'X'; textEl.appendTo(document.body); textSize = textEl.dom.offsetHeight; setInterval(function(){ if(textEl.dom.offsetHeight != textSize){ textEvent.fire(textSize, textSize = textEl.dom.offsetHeight); } }, this.textResizeInterval); } textEvent.addListener(fn, scope, options); }, removeResizeListener : function(fn, scope){ if(resizeEvent){ resizeEvent.removeListener(fn, scope); } }, fireResize : function(){ if(resizeEvent){ resizeEvent.fire(D.getViewWidth(), D.getViewHeight()); } }, textResizeInterval : 50, ieDeferSrc : false, getKeyEvent : function(){ return useKeydown ? 'keydown' : 'keypress'; }, useKeydown: useKeydown }; }()); Ext.EventManager.on = Ext.EventManager.addListener; Ext.apply(Ext.EventObjectImpl.prototype, { BACKSPACE: 8, TAB: 9, NUM_CENTER: 12, ENTER: 13, RETURN: 13, SHIFT: 16, CTRL: 17, CONTROL : 17, ALT: 18, PAUSE: 19, CAPS_LOCK: 20, ESC: 27, SPACE: 32, PAGE_UP: 33, PAGEUP : 33, PAGE_DOWN: 34, PAGEDOWN : 34, END: 35, HOME: 36, LEFT: 37, UP: 38, RIGHT: 39, DOWN: 40, PRINT_SCREEN: 44, INSERT: 45, DELETE: 46, ZERO: 48, ONE: 49, TWO: 50, THREE: 51, FOUR: 52, FIVE: 53, SIX: 54, SEVEN: 55, EIGHT: 56, NINE: 57, A: 65, B: 66, C: 67, D: 68, E: 69, F: 70, G: 71, H: 72, I: 73, J: 74, K: 75, L: 76, M: 77, N: 78, O: 79, P: 80, Q: 81, R: 82, S: 83, T: 84, U: 85, V: 86, W: 87, X: 88, Y: 89, Z: 90, CONTEXT_MENU: 93, NUM_ZERO: 96, NUM_ONE: 97, NUM_TWO: 98, NUM_THREE: 99, NUM_FOUR: 100, NUM_FIVE: 101, NUM_SIX: 102, NUM_SEVEN: 103, NUM_EIGHT: 104, NUM_NINE: 105, NUM_MULTIPLY: 106, NUM_PLUS: 107, NUM_MINUS: 109, NUM_PERIOD: 110, NUM_DIVISION: 111, F1: 112, F2: 113, F3: 114, F4: 115, F5: 116, F6: 117, F7: 118, F8: 119, F9: 120, F10: 121, F11: 122, F12: 123, isNavKeyPress : function(){ var me = this, k = this.normalizeKey(me.keyCode); return (k >= 33 && k <= 40) || k == me.RETURN || k == me.TAB || k == me.ESC; }, isSpecialKey : function(){ var k = this.normalizeKey(this.keyCode); return (this.type == 'keypress' && this.ctrlKey) || this.isNavKeyPress() || (k == this.BACKSPACE) || (k >= 16 && k <= 20) || (k >= 44 && k <= 46); }, getPoint : function(){ return new Ext.lib.Point(this.xy[0], this.xy[1]); }, hasModifier : function(){ return ((this.ctrlKey || this.altKey) || this.shiftKey); } }); Ext.Element.addMethods({ swallowEvent : function(eventName, preventDefault) { var me = this; function fn(e) { e.stopPropagation(); if (preventDefault) { e.preventDefault(); } } if (Ext.isArray(eventName)) { Ext.each(eventName, function(e) { me.on(e, fn); }); return me; } me.on(eventName, fn); return me; }, relayEvent : function(eventName, observable) { this.on(eventName, function(e) { observable.fireEvent(eventName, e); }); }, clean : function(forceReclean) { var me = this, dom = me.dom, n = dom.firstChild, ni = -1; if (Ext.Element.data(dom, 'isCleaned') && forceReclean !== true) { return me; } while (n) { var nx = n.nextSibling; if (n.nodeType == 3 && !(/\S/.test(n.nodeValue))) { dom.removeChild(n); } else { n.nodeIndex = ++ni; } n = nx; } Ext.Element.data(dom, 'isCleaned', true); return me; }, load : function() { var updateManager = this.getUpdater(); updateManager.update.apply(updateManager, arguments); return this; }, getUpdater : function() { return this.updateManager || (this.updateManager = new Ext.Updater(this)); }, update : function(html, loadScripts, callback) { if (!this.dom) { return this; } html = html || ""; if (loadScripts !== true) { this.dom.innerHTML = html; if (typeof callback == 'function') { callback(); } return this; } var id = Ext.id(), dom = this.dom; html += ''; Ext.lib.Event.onAvailable(id, function() { var DOC = document, hd = DOC.getElementsByTagName("head")[0], re = /(?:]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig, srcRe = /\ssrc=([\'\"])(.*?)\1/i, typeRe = /\stype=([\'\"])(.*?)\1/i, match, attrs, srcMatch, typeMatch, el, s; while ((match = re.exec(html))) { attrs = match[1]; srcMatch = attrs ? attrs.match(srcRe) : false; if (srcMatch && srcMatch[2]) { s = DOC.createElement("script"); s.src = srcMatch[2]; typeMatch = attrs.match(typeRe); if (typeMatch && typeMatch[2]) { s.type = typeMatch[2]; } hd.appendChild(s); } else if (match[2] && match[2].length > 0) { if (window.execScript) { window.execScript(match[2]); } else { window.eval(match[2]); } } } el = DOC.getElementById(id); if (el) { Ext.removeNode(el); } if (typeof callback == 'function') { callback(); } }); dom.innerHTML = html.replace(/(?:)((\n|\r|.)*?)(?:<\/script>)/ig, ""); return this; }, removeAllListeners : function() { this.removeAnchor(); Ext.EventManager.removeAll(this.dom); return this; }, createProxy : function(config, renderTo, matchBox) { config = (typeof config == 'object') ? config : {tag : "div", cls: config}; var me = this, proxy = renderTo ? Ext.DomHelper.append(renderTo, config, true) : Ext.DomHelper.insertBefore(me.dom, config, true); if (matchBox && me.setBox && me.getBox) { proxy.setBox(me.getBox()); } return proxy; } }); Ext.Element.prototype.getUpdateManager = Ext.Element.prototype.getUpdater; Ext.Element.addMethods({ getAnchorXY : function(anchor, local, s){ anchor = (anchor || "tl").toLowerCase(); s = s || {}; var me = this, vp = me.dom == document.body || me.dom == document, w = s.width || vp ? Ext.lib.Dom.getViewWidth() : me.getWidth(), h = s.height || vp ? Ext.lib.Dom.getViewHeight() : me.getHeight(), xy, r = Math.round, o = me.getXY(), scroll = me.getScroll(), extraX = vp ? scroll.left : !local ? o[0] : 0, extraY = vp ? scroll.top : !local ? o[1] : 0, hash = { c : [r(w * 0.5), r(h * 0.5)], t : [r(w * 0.5), 0], l : [0, r(h * 0.5)], r : [w, r(h * 0.5)], b : [r(w * 0.5), h], tl : [0, 0], bl : [0, h], br : [w, h], tr : [w, 0] }; xy = hash[anchor]; return [xy[0] + extraX, xy[1] + extraY]; }, anchorTo : function(el, alignment, offsets, animate, monitorScroll, callback){ var me = this, dom = me.dom, scroll = !Ext.isEmpty(monitorScroll), action = function(){ Ext.fly(dom).alignTo(el, alignment, offsets, animate); Ext.callback(callback, Ext.fly(dom)); }, anchor = this.getAnchor(); this.removeAnchor(); Ext.apply(anchor, { fn: action, scroll: scroll }); Ext.EventManager.onWindowResize(action, null); if(scroll){ Ext.EventManager.on(window, 'scroll', action, null, {buffer: !isNaN(monitorScroll) ? monitorScroll : 50}); } action.call(me); return me; }, removeAnchor : function(){ var me = this, anchor = this.getAnchor(); if(anchor && anchor.fn){ Ext.EventManager.removeResizeListener(anchor.fn); if(anchor.scroll){ Ext.EventManager.un(window, 'scroll', anchor.fn); } delete anchor.fn; } return me; }, getAnchor : function(){ var data = Ext.Element.data, dom = this.dom; if (!dom) { return; } var anchor = data(dom, '_anchor'); if(!anchor){ anchor = data(dom, '_anchor', {}); } return anchor; }, getAlignToXY : function(el, p, o){ el = Ext.get(el); if(!el || !el.dom){ throw "Element.alignToXY with an element that doesn't exist"; } o = o || [0,0]; p = (!p || p == "?" ? "tl-bl?" : (!(/-/).test(p) && p !== "" ? "tl-" + p : p || "tl-bl")).toLowerCase(); var me = this, d = me.dom, a1, a2, x, y, w, h, r, dw = Ext.lib.Dom.getViewWidth() -10, dh = Ext.lib.Dom.getViewHeight()-10, p1y, p1x, p2y, p2x, swapY, swapX, doc = document, docElement = doc.documentElement, docBody = doc.body, scrollX = (docElement.scrollLeft || docBody.scrollLeft || 0)+5, scrollY = (docElement.scrollTop || docBody.scrollTop || 0)+5, c = false, p1 = "", p2 = "", m = p.match(/^([a-z]+)-([a-z]+)(\?)?$/); if(!m){ throw "Element.alignTo with an invalid alignment " + p; } p1 = m[1]; p2 = m[2]; c = !!m[3]; a1 = me.getAnchorXY(p1, true); a2 = el.getAnchorXY(p2, false); x = a2[0] - a1[0] + o[0]; y = a2[1] - a1[1] + o[1]; if(c){ w = me.getWidth(); h = me.getHeight(); r = el.getRegion(); p1y = p1.charAt(0); p1x = p1.charAt(p1.length-1); p2y = p2.charAt(0); p2x = p2.charAt(p2.length-1); swapY = ((p1y=="t" && p2y=="b") || (p1y=="b" && p2y=="t")); swapX = ((p1x=="r" && p2x=="l") || (p1x=="l" && p2x=="r")); if (x + w > dw + scrollX) { x = swapX ? r.left-w : dw+scrollX-w; } if (x < scrollX) { x = swapX ? r.right : scrollX; } if (y + h > dh + scrollY) { y = swapY ? r.top-h : dh+scrollY-h; } if (y < scrollY){ y = swapY ? r.bottom : scrollY; } } return [x,y]; }, alignTo : function(element, position, offsets, animate){ var me = this; return me.setXY(me.getAlignToXY(element, position, offsets), me.preanim && !!animate ? me.preanim(arguments, 3) : false); }, adjustForConstraints : function(xy, parent, offsets){ return this.getConstrainToXY(parent || document, false, offsets, xy) || xy; }, getConstrainToXY : function(el, local, offsets, proposedXY){ var os = {top:0, left:0, bottom:0, right: 0}; return function(el, local, offsets, proposedXY){ el = Ext.get(el); offsets = offsets ? Ext.applyIf(offsets, os) : os; var vw, vh, vx = 0, vy = 0; if(el.dom == document.body || el.dom == document){ vw =Ext.lib.Dom.getViewWidth(); vh = Ext.lib.Dom.getViewHeight(); }else{ vw = el.dom.clientWidth; vh = el.dom.clientHeight; if(!local){ var vxy = el.getXY(); vx = vxy[0]; vy = vxy[1]; } } var s = el.getScroll(); vx += offsets.left + s.left; vy += offsets.top + s.top; vw -= offsets.right; vh -= offsets.bottom; var vr = vx + vw, vb = vy + vh, xy = proposedXY || (!local ? this.getXY() : [this.getLeft(true), this.getTop(true)]), x = xy[0], y = xy[1], offset = this.getConstrainOffset(), w = this.dom.offsetWidth + offset, h = this.dom.offsetHeight + offset; var moved = false; if((x + w) > vr){ x = vr - w; moved = true; } if((y + h) > vb){ y = vb - h; moved = true; } if(x < vx){ x = vx; moved = true; } if(y < vy){ y = vy; moved = true; } return moved ? [x, y] : false; }; }(), getConstrainOffset : function(){ return 0; }, getCenterXY : function(){ return this.getAlignToXY(document, 'c-c'); }, center : function(centerIn){ return this.alignTo(centerIn || document, 'c-c'); } }); Ext.Element.addMethods({ select : function(selector, unique){ return Ext.Element.select(selector, unique, this.dom); } }); Ext.apply(Ext.Element.prototype, function() { var GETDOM = Ext.getDom, GET = Ext.get, DH = Ext.DomHelper; return { insertSibling: function(el, where, returnDom){ var me = this, rt, isAfter = (where || 'before').toLowerCase() == 'after', insertEl; if(Ext.isArray(el)){ insertEl = me; Ext.each(el, function(e) { rt = Ext.fly(insertEl, '_internal').insertSibling(e, where, returnDom); if(isAfter){ insertEl = rt; } }); return rt; } el = el || {}; if(el.nodeType || el.dom){ rt = me.dom.parentNode.insertBefore(GETDOM(el), isAfter ? me.dom.nextSibling : me.dom); if (!returnDom) { rt = GET(rt); } }else{ if (isAfter && !me.dom.nextSibling) { rt = DH.append(me.dom.parentNode, el, !returnDom); } else { rt = DH[isAfter ? 'insertAfter' : 'insertBefore'](me.dom, el, !returnDom); } } return rt; } }; }()); Ext.Element.boxMarkup = '
    '; Ext.Element.addMethods(function(){ var INTERNAL = "_internal", pxMatch = /(\d+\.?\d+)px/; return { applyStyles : function(style){ Ext.DomHelper.applyStyles(this.dom, style); return this; }, getStyles : function(){ var ret = {}; Ext.each(arguments, function(v) { ret[v] = this.getStyle(v); }, this); return ret; }, setOverflow : function(v){ var dom = this.dom; if(v=='auto' && Ext.isMac && Ext.isGecko2){ dom.style.overflow = 'hidden'; (function(){dom.style.overflow = 'auto';}).defer(1); }else{ dom.style.overflow = v; } }, boxWrap : function(cls){ cls = cls || 'x-box'; var el = Ext.get(this.insertHtml("beforeBegin", "
    " + String.format(Ext.Element.boxMarkup, cls) + "
    ")); Ext.DomQuery.selectNode('.' + cls + '-mc', el.dom).appendChild(this.dom); return el; }, setSize : function(width, height, animate){ var me = this; if(typeof width == 'object'){ height = width.height; width = width.width; } width = me.adjustWidth(width); height = me.adjustHeight(height); if(!animate || !me.anim){ me.dom.style.width = me.addUnits(width); me.dom.style.height = me.addUnits(height); }else{ me.anim({width: {to: width}, height: {to: height}}, me.preanim(arguments, 2)); } return me; }, getComputedHeight : function(){ var me = this, h = Math.max(me.dom.offsetHeight, me.dom.clientHeight); if(!h){ h = parseFloat(me.getStyle('height')) || 0; if(!me.isBorderBox()){ h += me.getFrameWidth('tb'); } } return h; }, getComputedWidth : function(){ var w = Math.max(this.dom.offsetWidth, this.dom.clientWidth); if(!w){ w = parseFloat(this.getStyle('width')) || 0; if(!this.isBorderBox()){ w += this.getFrameWidth('lr'); } } return w; }, getFrameWidth : function(sides, onlyContentBox){ return onlyContentBox && this.isBorderBox() ? 0 : (this.getPadding(sides) + this.getBorderWidth(sides)); }, addClassOnOver : function(className){ this.hover( function(){ Ext.fly(this, INTERNAL).addClass(className); }, function(){ Ext.fly(this, INTERNAL).removeClass(className); } ); return this; }, addClassOnFocus : function(className){ this.on("focus", function(){ Ext.fly(this, INTERNAL).addClass(className); }, this.dom); this.on("blur", function(){ Ext.fly(this, INTERNAL).removeClass(className); }, this.dom); return this; }, addClassOnClick : function(className){ var dom = this.dom; this.on("mousedown", function(){ Ext.fly(dom, INTERNAL).addClass(className); var d = Ext.getDoc(), fn = function(){ Ext.fly(dom, INTERNAL).removeClass(className); d.removeListener("mouseup", fn); }; d.on("mouseup", fn); }); return this; }, getViewSize : function(){ var doc = document, d = this.dom, isDoc = (d == doc || d == doc.body); if (isDoc) { var extdom = Ext.lib.Dom; return { width : extdom.getViewWidth(), height : extdom.getViewHeight() }; } else { return { width : d.clientWidth, height : d.clientHeight }; } }, getStyleSize : function(){ var me = this, w, h, doc = document, d = this.dom, isDoc = (d == doc || d == doc.body), s = d.style; if (isDoc) { var extdom = Ext.lib.Dom; return { width : extdom.getViewWidth(), height : extdom.getViewHeight() }; } if(s.width && s.width != 'auto'){ w = parseFloat(s.width); if(me.isBorderBox()){ w -= me.getFrameWidth('lr'); } } if(s.height && s.height != 'auto'){ h = parseFloat(s.height); if(me.isBorderBox()){ h -= me.getFrameWidth('tb'); } } return {width: w || me.getWidth(true), height: h || me.getHeight(true)}; }, getSize : function(contentSize){ return {width: this.getWidth(contentSize), height: this.getHeight(contentSize)}; }, repaint : function(){ var dom = this.dom; this.addClass("x-repaint"); setTimeout(function(){ Ext.fly(dom).removeClass("x-repaint"); }, 1); return this; }, unselectable : function(){ this.dom.unselectable = "on"; return this.swallowEvent("selectstart", true). applyStyles("-moz-user-select:none;-khtml-user-select:none;"). addClass("x-unselectable"); }, getMargins : function(side){ var me = this, key, hash = {t:"top", l:"left", r:"right", b: "bottom"}, o = {}; if (!side) { for (key in me.margins){ o[hash[key]] = parseFloat(me.getStyle(me.margins[key])) || 0; } return o; } else { return me.addStyles.call(me, side, me.margins); } } }; }()); Ext.Element.addMethods({ setBox : function(box, adjust, animate){ var me = this, w = box.width, h = box.height; if((adjust && !me.autoBoxAdjust) && !me.isBorderBox()){ w -= (me.getBorderWidth("lr") + me.getPadding("lr")); h -= (me.getBorderWidth("tb") + me.getPadding("tb")); } me.setBounds(box.x, box.y, w, h, me.animTest.call(me, arguments, animate, 2)); return me; }, getBox : function(contentBox, local) { var me = this, xy, left, top, getBorderWidth = me.getBorderWidth, getPadding = me.getPadding, l, r, t, b; if(!local){ xy = me.getXY(); }else{ left = parseInt(me.getStyle("left"), 10) || 0; top = parseInt(me.getStyle("top"), 10) || 0; xy = [left, top]; } var el = me.dom, w = el.offsetWidth, h = el.offsetHeight, bx; if(!contentBox){ bx = {x: xy[0], y: xy[1], 0: xy[0], 1: xy[1], width: w, height: h}; }else{ l = getBorderWidth.call(me, "l") + getPadding.call(me, "l"); r = getBorderWidth.call(me, "r") + getPadding.call(me, "r"); t = getBorderWidth.call(me, "t") + getPadding.call(me, "t"); b = getBorderWidth.call(me, "b") + getPadding.call(me, "b"); bx = {x: xy[0]+l, y: xy[1]+t, 0: xy[0]+l, 1: xy[1]+t, width: w-(l+r), height: h-(t+b)}; } bx.right = bx.x + bx.width; bx.bottom = bx.y + bx.height; return bx; }, move : function(direction, distance, animate){ var me = this, xy = me.getXY(), x = xy[0], y = xy[1], left = [x - distance, y], right = [x + distance, y], top = [x, y - distance], bottom = [x, y + distance], hash = { l : left, left : left, r : right, right : right, t : top, top : top, up : top, b : bottom, bottom : bottom, down : bottom }; direction = direction.toLowerCase(); me.moveTo(hash[direction][0], hash[direction][1], me.animTest.call(me, arguments, animate, 2)); }, setLeftTop : function(left, top){ var me = this, style = me.dom.style; style.left = me.addUnits(left); style.top = me.addUnits(top); return me; }, getRegion : function(){ return Ext.lib.Dom.getRegion(this.dom); }, setBounds : function(x, y, width, height, animate){ var me = this; if (!animate || !me.anim) { me.setSize(width, height); me.setLocation(x, y); } else { me.anim({points: {to: [x, y]}, width: {to: me.adjustWidth(width)}, height: {to: me.adjustHeight(height)}}, me.preanim(arguments, 4), 'motion'); } return me; }, setRegion : function(region, animate) { return this.setBounds(region.left, region.top, region.right-region.left, region.bottom-region.top, this.animTest.call(this, arguments, animate, 1)); } }); Ext.Element.addMethods({ scrollTo : function(side, value, animate) { var top = /top/i.test(side), me = this, dom = me.dom, prop; if (!animate || !me.anim) { prop = 'scroll' + (top ? 'Top' : 'Left'); dom[prop] = value; } else { prop = 'scroll' + (top ? 'Left' : 'Top'); me.anim({scroll: {to: top ? [dom[prop], value] : [value, dom[prop]]}}, me.preanim(arguments, 2), 'scroll'); } return me; }, scrollIntoView : function(container, hscroll) { var c = Ext.getDom(container) || Ext.getBody().dom, el = this.dom, o = this.getOffsetsTo(c), l = o[0] + c.scrollLeft, t = o[1] + c.scrollTop, b = t + el.offsetHeight, r = l + el.offsetWidth, ch = c.clientHeight, ct = parseInt(c.scrollTop, 10), cl = parseInt(c.scrollLeft, 10), cb = ct + ch, cr = cl + c.clientWidth; if (el.offsetHeight > ch || t < ct) { c.scrollTop = t; } else if (b > cb) { c.scrollTop = b-ch; } c.scrollTop = c.scrollTop; if (hscroll !== false) { if (el.offsetWidth > c.clientWidth || l < cl) { c.scrollLeft = l; } else if (r > cr) { c.scrollLeft = r - c.clientWidth; } c.scrollLeft = c.scrollLeft; } return this; }, scrollChildIntoView : function(child, hscroll) { Ext.fly(child, '_scrollChildIntoView').scrollIntoView(this, hscroll); }, scroll : function(direction, distance, animate) { if (!this.isScrollable()) { return false; } var el = this.dom, l = el.scrollLeft, t = el.scrollTop, w = el.scrollWidth, h = el.scrollHeight, cw = el.clientWidth, ch = el.clientHeight, scrolled = false, v, hash = { l: Math.min(l + distance, w-cw), r: v = Math.max(l - distance, 0), t: Math.max(t - distance, 0), b: Math.min(t + distance, h-ch) }; hash.d = hash.b; hash.u = hash.t; direction = direction.substr(0, 1); if ((v = hash[direction]) > -1) { scrolled = true; this.scrollTo(direction == 'l' || direction == 'r' ? 'left' : 'top', v, this.preanim(arguments, 2)); } return scrolled; } }); Ext.Element.addMethods( function() { var VISIBILITY = "visibility", DISPLAY = "display", HIDDEN = "hidden", NONE = "none", XMASKED = "x-masked", XMASKEDRELATIVE = "x-masked-relative", data = Ext.Element.data; return { isVisible : function(deep) { var vis = !this.isStyle(VISIBILITY, HIDDEN) && !this.isStyle(DISPLAY, NONE), p = this.dom.parentNode; if (deep !== true || !vis) { return vis; } while (p && !(/^body/i.test(p.tagName))) { if (!Ext.fly(p, '_isVisible').isVisible()) { return false; } p = p.parentNode; } return true; }, isDisplayed : function() { return !this.isStyle(DISPLAY, NONE); }, enableDisplayMode : function(display) { this.setVisibilityMode(Ext.Element.DISPLAY); if (!Ext.isEmpty(display)) { data(this.dom, 'originalDisplay', display); } return this; }, mask : function(msg, msgCls) { var me = this, dom = me.dom, dh = Ext.DomHelper, EXTELMASKMSG = "ext-el-mask-msg", el, mask; if (!/^body/i.test(dom.tagName) && me.getStyle('position') == 'static') { me.addClass(XMASKEDRELATIVE); } if (el = data(dom, 'maskMsg')) { el.remove(); } if (el = data(dom, 'mask')) { el.remove(); } mask = dh.append(dom, {cls : "ext-el-mask"}, true); data(dom, 'mask', mask); me.addClass(XMASKED); mask.setDisplayed(true); if (typeof msg == 'string') { var mm = dh.append(dom, {cls : EXTELMASKMSG, cn:{tag:'div'}}, true); data(dom, 'maskMsg', mm); mm.dom.className = msgCls ? EXTELMASKMSG + " " + msgCls : EXTELMASKMSG; mm.dom.firstChild.innerHTML = msg; mm.setDisplayed(true); mm.center(me); } if (Ext.isIE && !(Ext.isIE7 && Ext.isStrict) && me.getStyle('height') == 'auto') { mask.setSize(undefined, me.getHeight()); } return mask; }, unmask : function() { var me = this, dom = me.dom, mask = data(dom, 'mask'), maskMsg = data(dom, 'maskMsg'); if (mask) { if (maskMsg) { maskMsg.remove(); data(dom, 'maskMsg', undefined); } mask.remove(); data(dom, 'mask', undefined); me.removeClass([XMASKED, XMASKEDRELATIVE]); } }, isMasked : function() { var m = data(this.dom, 'mask'); return m && m.isVisible(); }, createShim : function() { var el = document.createElement('iframe'), shim; el.frameBorder = '0'; el.className = 'ext-shim'; el.src = Ext.SSL_SECURE_URL; shim = Ext.get(this.dom.parentNode.insertBefore(el, this.dom)); shim.autoBoxAdjust = false; return shim; } }; }() ); Ext.Element.addMethods({ addKeyListener : function(key, fn, scope){ var config; if(typeof key != 'object' || Ext.isArray(key)){ config = { key: key, fn: fn, scope: scope }; }else{ config = { key : key.key, shift : key.shift, ctrl : key.ctrl, alt : key.alt, fn: fn, scope: scope }; } return new Ext.KeyMap(this, config); }, addKeyMap : function(config){ return new Ext.KeyMap(this, config); } }); Ext.CompositeElementLite.importElementMethods(); Ext.apply(Ext.CompositeElementLite.prototype, { addElements : function(els, root){ if(!els){ return this; } if(typeof els == "string"){ els = Ext.Element.selectorFunction(els, root); } var yels = this.elements; Ext.each(els, function(e) { yels.push(Ext.get(e)); }); return this; }, first : function(){ return this.item(0); }, last : function(){ return this.item(this.getCount()-1); }, contains : function(el){ return this.indexOf(el) != -1; }, removeElement : function(keys, removeDom){ var me = this, els = this.elements, el; Ext.each(keys, function(val){ if ((el = (els[val] || els[val = me.indexOf(val)]))) { if(removeDom){ if(el.dom){ el.remove(); }else{ Ext.removeNode(el); } } els.splice(val, 1); } }); return this; } }); Ext.CompositeElement = Ext.extend(Ext.CompositeElementLite, { constructor : function(els, root){ this.elements = []; this.add(els, root); }, getElement : function(el){ return el; }, transformElement : function(el){ return Ext.get(el); } }); Ext.Element.select = function(selector, unique, root){ var els; if(typeof selector == "string"){ els = Ext.Element.selectorFunction(selector, root); }else if(selector.length !== undefined){ els = selector; }else{ throw "Invalid selector"; } return (unique === true) ? new Ext.CompositeElement(els) : new Ext.CompositeElementLite(els); }; Ext.select = Ext.Element.select; Ext.UpdateManager = Ext.Updater = Ext.extend(Ext.util.Observable, function() { var BEFOREUPDATE = "beforeupdate", UPDATE = "update", FAILURE = "failure"; function processSuccess(response){ var me = this; me.transaction = null; if (response.argument.form && response.argument.reset) { try { response.argument.form.reset(); } catch(e){} } if (me.loadScripts) { me.renderer.render(me.el, response, me, updateComplete.createDelegate(me, [response])); } else { me.renderer.render(me.el, response, me); updateComplete.call(me, response); } } function updateComplete(response, type, success){ this.fireEvent(type || UPDATE, this.el, response); if(Ext.isFunction(response.argument.callback)){ response.argument.callback.call(response.argument.scope, this.el, Ext.isEmpty(success) ? true : false, response, response.argument.options); } } function processFailure(response){ updateComplete.call(this, response, FAILURE, !!(this.transaction = null)); } return { constructor: function(el, forceNew){ var me = this; el = Ext.get(el); if(!forceNew && el.updateManager){ return el.updateManager; } me.el = el; me.defaultUrl = null; me.addEvents( BEFOREUPDATE, UPDATE, FAILURE ); Ext.apply(me, Ext.Updater.defaults); me.transaction = null; me.refreshDelegate = me.refresh.createDelegate(me); me.updateDelegate = me.update.createDelegate(me); me.formUpdateDelegate = (me.formUpdate || function(){}).createDelegate(me); me.renderer = me.renderer || me.getDefaultRenderer(); Ext.Updater.superclass.constructor.call(me); }, setRenderer : function(renderer){ this.renderer = renderer; }, getRenderer : function(){ return this.renderer; }, getDefaultRenderer: function() { return new Ext.Updater.BasicRenderer(); }, setDefaultUrl : function(defaultUrl){ this.defaultUrl = defaultUrl; }, getEl : function(){ return this.el; }, update : function(url, params, callback, discardUrl){ var me = this, cfg, callerScope; if(me.fireEvent(BEFOREUPDATE, me.el, url, params) !== false){ if(Ext.isObject(url)){ cfg = url; url = cfg.url; params = params || cfg.params; callback = callback || cfg.callback; discardUrl = discardUrl || cfg.discardUrl; callerScope = cfg.scope; if(!Ext.isEmpty(cfg.nocache)){me.disableCaching = cfg.nocache;}; if(!Ext.isEmpty(cfg.text)){me.indicatorText = '
    '+cfg.text+"
    ";}; if(!Ext.isEmpty(cfg.scripts)){me.loadScripts = cfg.scripts;}; if(!Ext.isEmpty(cfg.timeout)){me.timeout = cfg.timeout;}; } me.showLoading(); if(!discardUrl){ me.defaultUrl = url; } if(Ext.isFunction(url)){ url = url.call(me); } var o = Ext.apply({}, { url : url, params: (Ext.isFunction(params) && callerScope) ? params.createDelegate(callerScope) : params, success: processSuccess, failure: processFailure, scope: me, callback: undefined, timeout: (me.timeout*1000), disableCaching: me.disableCaching, argument: { "options": cfg, "url": url, "form": null, "callback": callback, "scope": callerScope || window, "params": params } }, cfg); me.transaction = Ext.Ajax.request(o); } }, formUpdate : function(form, url, reset, callback){ var me = this; if(me.fireEvent(BEFOREUPDATE, me.el, form, url) !== false){ if(Ext.isFunction(url)){ url = url.call(me); } form = Ext.getDom(form); me.transaction = Ext.Ajax.request({ form: form, url:url, success: processSuccess, failure: processFailure, scope: me, timeout: (me.timeout*1000), argument: { "url": url, "form": form, "callback": callback, "reset": reset } }); me.showLoading.defer(1, me); } }, startAutoRefresh : function(interval, url, params, callback, refreshNow){ var me = this; if(refreshNow){ me.update(url || me.defaultUrl, params, callback, true); } if(me.autoRefreshProcId){ clearInterval(me.autoRefreshProcId); } me.autoRefreshProcId = setInterval(me.update.createDelegate(me, [url || me.defaultUrl, params, callback, true]), interval * 1000); }, stopAutoRefresh : function(){ if(this.autoRefreshProcId){ clearInterval(this.autoRefreshProcId); delete this.autoRefreshProcId; } }, isAutoRefreshing : function(){ return !!this.autoRefreshProcId; }, showLoading : function(){ if(this.showLoadIndicator){ this.el.dom.innerHTML = this.indicatorText; } }, abort : function(){ if(this.transaction){ Ext.Ajax.abort(this.transaction); } }, isUpdating : function(){ return this.transaction ? Ext.Ajax.isLoading(this.transaction) : false; }, refresh : function(callback){ if(this.defaultUrl){ this.update(this.defaultUrl, null, callback, true); } } }; }()); Ext.Updater.defaults = { timeout : 30, disableCaching : false, showLoadIndicator : true, indicatorText : '
    Loading...
    ', loadScripts : false, sslBlankUrl : Ext.SSL_SECURE_URL }; Ext.Updater.updateElement = function(el, url, params, options){ var um = Ext.get(el).getUpdater(); Ext.apply(um, options); um.update(url, params, options ? options.callback : null); }; Ext.Updater.BasicRenderer = function(){}; Ext.Updater.BasicRenderer.prototype = { render : function(el, response, updateManager, callback){ el.update(response.responseText, updateManager.loadScripts, callback); } }; (function() { Date.useStrict = false; function xf(format) { var args = Array.prototype.slice.call(arguments, 1); return format.replace(/\{(\d+)\}/g, function(m, i) { return args[i]; }); } Date.formatCodeToRegex = function(character, currentGroup) { var p = Date.parseCodes[character]; if (p) { p = typeof p == 'function'? p() : p; Date.parseCodes[character] = p; } return p ? Ext.applyIf({ c: p.c ? xf(p.c, currentGroup || "{0}") : p.c }, p) : { g:0, c:null, s:Ext.escapeRe(character) }; }; var $f = Date.formatCodeToRegex; Ext.apply(Date, { parseFunctions: { "M$": function(input, strict) { var re = new RegExp('\\/Date\\(([-+])?(\\d+)(?:[+-]\\d{4})?\\)\\/'); var r = (input || '').match(re); return r? new Date(((r[1] || '') + r[2]) * 1) : null; } }, parseRegexes: [], formatFunctions: { "M$": function() { return '\\/Date(' + this.getTime() + ')\\/'; } }, y2kYear : 50, MILLI : "ms", SECOND : "s", MINUTE : "mi", HOUR : "h", DAY : "d", MONTH : "mo", YEAR : "y", defaults: {}, dayNames : [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], monthNames : [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], monthNumbers : { Jan:0, Feb:1, Mar:2, Apr:3, May:4, Jun:5, Jul:6, Aug:7, Sep:8, Oct:9, Nov:10, Dec:11 }, getShortMonthName : function(month) { return Date.monthNames[month].substring(0, 3); }, getShortDayName : function(day) { return Date.dayNames[day].substring(0, 3); }, getMonthNumber : function(name) { return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()]; }, formatContainsHourInfo : (function(){ var stripEscapeRe = /(\\.)/g, hourInfoRe = /([gGhHisucUOPZ]|M\$)/; return function(format){ return hourInfoRe.test(format.replace(stripEscapeRe, '')); }; })(), formatCodes : { d: "String.leftPad(this.getDate(), 2, '0')", D: "Date.getShortDayName(this.getDay())", j: "this.getDate()", l: "Date.dayNames[this.getDay()]", N: "(this.getDay() ? this.getDay() : 7)", S: "this.getSuffix()", w: "this.getDay()", z: "this.getDayOfYear()", W: "String.leftPad(this.getWeekOfYear(), 2, '0')", F: "Date.monthNames[this.getMonth()]", m: "String.leftPad(this.getMonth() + 1, 2, '0')", M: "Date.getShortMonthName(this.getMonth())", n: "(this.getMonth() + 1)", t: "this.getDaysInMonth()", L: "(this.isLeapYear() ? 1 : 0)", o: "(this.getFullYear() + (this.getWeekOfYear() == 1 && this.getMonth() > 0 ? +1 : (this.getWeekOfYear() >= 52 && this.getMonth() < 11 ? -1 : 0)))", Y: "String.leftPad(this.getFullYear(), 4, '0')", y: "('' + this.getFullYear()).substring(2, 4)", a: "(this.getHours() < 12 ? 'am' : 'pm')", A: "(this.getHours() < 12 ? 'AM' : 'PM')", g: "((this.getHours() % 12) ? this.getHours() % 12 : 12)", G: "this.getHours()", h: "String.leftPad((this.getHours() % 12) ? this.getHours() % 12 : 12, 2, '0')", H: "String.leftPad(this.getHours(), 2, '0')", i: "String.leftPad(this.getMinutes(), 2, '0')", s: "String.leftPad(this.getSeconds(), 2, '0')", u: "String.leftPad(this.getMilliseconds(), 3, '0')", O: "this.getGMTOffset()", P: "this.getGMTOffset(true)", T: "this.getTimezone()", Z: "(this.getTimezoneOffset() * -60)", c: function() { for (var c = "Y-m-dTH:i:sP", code = [], i = 0, l = c.length; i < l; ++i) { var e = c.charAt(i); code.push(e == "T" ? "'T'" : Date.getFormatCode(e)); } return code.join(" + "); }, U: "Math.round(this.getTime() / 1000)" }, isValid : function(y, m, d, h, i, s, ms) { h = h || 0; i = i || 0; s = s || 0; ms = ms || 0; var dt = new Date(y < 100 ? 100 : y, m - 1, d, h, i, s, ms).add(Date.YEAR, y < 100 ? y - 100 : 0); return y == dt.getFullYear() && m == dt.getMonth() + 1 && d == dt.getDate() && h == dt.getHours() && i == dt.getMinutes() && s == dt.getSeconds() && ms == dt.getMilliseconds(); }, parseDate : function(input, format, strict) { var p = Date.parseFunctions; if (p[format] == null) { Date.createParser(format); } return p[format](input, Ext.isDefined(strict) ? strict : Date.useStrict); }, getFormatCode : function(character) { var f = Date.formatCodes[character]; if (f) { f = typeof f == 'function'? f() : f; Date.formatCodes[character] = f; } return f || ("'" + String.escape(character) + "'"); }, createFormat : function(format) { var code = [], special = false, ch = ''; for (var i = 0; i < format.length; ++i) { ch = format.charAt(i); if (!special && ch == "\\") { special = true; } else if (special) { special = false; code.push("'" + String.escape(ch) + "'"); } else { code.push(Date.getFormatCode(ch)); } } Date.formatFunctions[format] = new Function("return " + code.join('+')); }, createParser : function() { var code = [ "var dt, y, m, d, h, i, s, ms, o, z, zz, u, v,", "def = Date.defaults,", "results = String(input).match(Date.parseRegexes[{0}]);", "if(results){", "{1}", "if(u != null){", "v = new Date(u * 1000);", "}else{", "dt = (new Date()).clearTime();", "y = Ext.num(y, Ext.num(def.y, dt.getFullYear()));", "m = Ext.num(m, Ext.num(def.m - 1, dt.getMonth()));", "d = Ext.num(d, Ext.num(def.d, dt.getDate()));", "h = Ext.num(h, Ext.num(def.h, dt.getHours()));", "i = Ext.num(i, Ext.num(def.i, dt.getMinutes()));", "s = Ext.num(s, Ext.num(def.s, dt.getSeconds()));", "ms = Ext.num(ms, Ext.num(def.ms, dt.getMilliseconds()));", "if(z >= 0 && y >= 0){", "v = new Date(y < 100 ? 100 : y, 0, 1, h, i, s, ms).add(Date.YEAR, y < 100 ? y - 100 : 0);", "v = !strict? v : (strict === true && (z <= 364 || (v.isLeapYear() && z <= 365))? v.add(Date.DAY, z) : null);", "}else if(strict === true && !Date.isValid(y, m + 1, d, h, i, s, ms)){", "v = null;", "}else{", "v = new Date(y < 100 ? 100 : y, m, d, h, i, s, ms).add(Date.YEAR, y < 100 ? y - 100 : 0);", "}", "}", "}", "if(v){", "if(zz != null){", "v = v.add(Date.SECOND, -v.getTimezoneOffset() * 60 - zz);", "}else if(o){", "v = v.add(Date.MINUTE, -v.getTimezoneOffset() + (sn == '+'? -1 : 1) * (hr * 60 + mn));", "}", "}", "return v;" ].join('\n'); return function(format) { var regexNum = Date.parseRegexes.length, currentGroup = 1, calc = [], regex = [], special = false, ch = "", i = 0, obj, last; for (; i < format.length; ++i) { ch = format.charAt(i); if (!special && ch == "\\") { special = true; } else if (special) { special = false; regex.push(String.escape(ch)); } else { obj = $f(ch, currentGroup); currentGroup += obj.g; regex.push(obj.s); if (obj.g && obj.c) { if (obj.calcLast) { last = obj.c; } else { calc.push(obj.c); } } } } if (last) { calc.push(last); } Date.parseRegexes[regexNum] = new RegExp("^" + regex.join('') + "$", 'i'); Date.parseFunctions[format] = new Function("input", "strict", xf(code, regexNum, calc.join(''))); }; }(), parseCodes : { d: { g:1, c:"d = parseInt(results[{0}], 10);\n", s:"(\\d{2})" }, j: { g:1, c:"d = parseInt(results[{0}], 10);\n", s:"(\\d{1,2})" }, D: function() { for (var a = [], i = 0; i < 7; a.push(Date.getShortDayName(i)), ++i); return { g:0, c:null, s:"(?:" + a.join("|") +")" }; }, l: function() { return { g:0, c:null, s:"(?:" + Date.dayNames.join("|") + ")" }; }, N: { g:0, c:null, s:"[1-7]" }, S: { g:0, c:null, s:"(?:st|nd|rd|th)" }, w: { g:0, c:null, s:"[0-6]" }, z: { g:1, c:"z = parseInt(results[{0}], 10);\n", s:"(\\d{1,3})" }, W: { g:0, c:null, s:"(?:\\d{2})" }, F: function() { return { g:1, c:"m = parseInt(Date.getMonthNumber(results[{0}]), 10);\n", s:"(" + Date.monthNames.join("|") + ")" }; }, M: function() { for (var a = [], i = 0; i < 12; a.push(Date.getShortMonthName(i)), ++i); return Ext.applyIf({ s:"(" + a.join("|") + ")" }, $f("F")); }, m: { g:1, c:"m = parseInt(results[{0}], 10) - 1;\n", s:"(\\d{2})" }, n: { g:1, c:"m = parseInt(results[{0}], 10) - 1;\n", s:"(\\d{1,2})" }, t: { g:0, c:null, s:"(?:\\d{2})" }, L: { g:0, c:null, s:"(?:1|0)" }, o: function() { return $f("Y"); }, Y: { g:1, c:"y = parseInt(results[{0}], 10);\n", s:"(\\d{4})" }, y: { g:1, c:"var ty = parseInt(results[{0}], 10);\n" + "y = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n", s:"(\\d{1,2})" }, a: function(){ return $f("A"); }, A: { calcLast: true, g:1, c:"if (/(am)/i.test(results[{0}])) {\n" + "if (!h || h == 12) { h = 0; }\n" + "} else { if (!h || h < 12) { h = (h || 0) + 12; }}", s:"(AM|PM|am|pm)" }, g: function() { return $f("G"); }, G: { g:1, c:"h = parseInt(results[{0}], 10);\n", s:"(\\d{1,2})" }, h: function() { return $f("H"); }, H: { g:1, c:"h = parseInt(results[{0}], 10);\n", s:"(\\d{2})" }, i: { g:1, c:"i = parseInt(results[{0}], 10);\n", s:"(\\d{2})" }, s: { g:1, c:"s = parseInt(results[{0}], 10);\n", s:"(\\d{2})" }, u: { g:1, c:"ms = results[{0}]; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n", s:"(\\d+)" }, O: { g:1, c:[ "o = results[{0}];", "var sn = o.substring(0,1),", "hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60),", "mn = o.substring(3,5) % 60;", "o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n" ].join("\n"), s: "([+\-]\\d{4})" }, P: { g:1, c:[ "o = results[{0}];", "var sn = o.substring(0,1),", "hr = o.substring(1,3)*1 + Math.floor(o.substring(4,6) / 60),", "mn = o.substring(4,6) % 60;", "o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n" ].join("\n"), s: "([+\-]\\d{2}:\\d{2})" }, T: { g:0, c:null, s:"[A-Z]{1,4}" }, Z: { g:1, c:"zz = results[{0}] * 1;\n" + "zz = (-43200 <= zz && zz <= 50400)? zz : null;\n", s:"([+\-]?\\d{1,5})" }, c: function() { var calc = [], arr = [ $f("Y", 1), $f("m", 2), $f("d", 3), $f("h", 4), $f("i", 5), $f("s", 6), {c:"ms = results[7] || '0'; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n"}, {c:[ "if(results[8]) {", "if(results[8] == 'Z'){", "zz = 0;", "}else if (results[8].indexOf(':') > -1){", $f("P", 8).c, "}else{", $f("O", 8).c, "}", "}" ].join('\n')} ]; for (var i = 0, l = arr.length; i < l; ++i) { calc.push(arr[i].c); } return { g:1, c:calc.join(""), s:[ arr[0].s, "(?:", "-", arr[1].s, "(?:", "-", arr[2].s, "(?:", "(?:T| )?", arr[3].s, ":", arr[4].s, "(?::", arr[5].s, ")?", "(?:(?:\\.|,)(\\d+))?", "(Z|(?:[-+]\\d{2}(?::)?\\d{2}))?", ")?", ")?", ")?" ].join("") }; }, U: { g:1, c:"u = parseInt(results[{0}], 10);\n", s:"(-?\\d+)" } } }); }()); Ext.apply(Date.prototype, { dateFormat : function(format) { if (Date.formatFunctions[format] == null) { Date.createFormat(format); } return Date.formatFunctions[format].call(this); }, getTimezone : function() { return this.toString().replace(/^.* (?:\((.*)\)|([A-Z]{1,4})(?:[\-+][0-9]{4})?(?: -?\d+)?)$/, "$1$2").replace(/[^A-Z]/g, ""); }, getGMTOffset : function(colon) { return (this.getTimezoneOffset() > 0 ? "-" : "+") + String.leftPad(Math.floor(Math.abs(this.getTimezoneOffset()) / 60), 2, "0") + (colon ? ":" : "") + String.leftPad(Math.abs(this.getTimezoneOffset() % 60), 2, "0"); }, getDayOfYear: function() { var num = 0, d = this.clone(), m = this.getMonth(), i; for (i = 0, d.setDate(1), d.setMonth(0); i < m; d.setMonth(++i)) { num += d.getDaysInMonth(); } return num + this.getDate() - 1; }, getWeekOfYear : function() { var ms1d = 864e5, ms7d = 7 * ms1d; return function() { var DC3 = Date.UTC(this.getFullYear(), this.getMonth(), this.getDate() + 3) / ms1d, AWN = Math.floor(DC3 / 7), Wyr = new Date(AWN * ms7d).getUTCFullYear(); return AWN - Math.floor(Date.UTC(Wyr, 0, 7) / ms7d) + 1; }; }(), isLeapYear : function() { var year = this.getFullYear(); return !!((year & 3) == 0 && (year % 100 || (year % 400 == 0 && year))); }, getFirstDayOfMonth : function() { var day = (this.getDay() - (this.getDate() - 1)) % 7; return (day < 0) ? (day + 7) : day; }, getLastDayOfMonth : function() { return this.getLastDateOfMonth().getDay(); }, getFirstDateOfMonth : function() { return new Date(this.getFullYear(), this.getMonth(), 1); }, getLastDateOfMonth : function() { return new Date(this.getFullYear(), this.getMonth(), this.getDaysInMonth()); }, getDaysInMonth: function() { var daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; return function() { var m = this.getMonth(); return m == 1 && this.isLeapYear() ? 29 : daysInMonth[m]; }; }(), getSuffix : function() { switch (this.getDate()) { case 1: case 21: case 31: return "st"; case 2: case 22: return "nd"; case 3: case 23: return "rd"; default: return "th"; } }, clone : function() { return new Date(this.getTime()); }, isDST : function() { return new Date(this.getFullYear(), 0, 1).getTimezoneOffset() != this.getTimezoneOffset(); }, clearTime : function(clone) { if (clone) { return this.clone().clearTime(); } var d = this.getDate(); this.setHours(0); this.setMinutes(0); this.setSeconds(0); this.setMilliseconds(0); if (this.getDate() != d) { for (var hr = 1, c = this.add(Date.HOUR, hr); c.getDate() != d; hr++, c = this.add(Date.HOUR, hr)); this.setDate(d); this.setHours(c.getHours()); } return this; }, add : function(interval, value) { var d = this.clone(); if (!interval || value === 0) return d; switch(interval.toLowerCase()) { case Date.MILLI: d.setMilliseconds(this.getMilliseconds() + value); break; case Date.SECOND: d.setSeconds(this.getSeconds() + value); break; case Date.MINUTE: d.setMinutes(this.getMinutes() + value); break; case Date.HOUR: d.setHours(this.getHours() + value); break; case Date.DAY: d.setDate(this.getDate() + value); break; case Date.MONTH: var day = this.getDate(); if (day > 28) { day = Math.min(day, this.getFirstDateOfMonth().add('mo', value).getLastDateOfMonth().getDate()); } d.setDate(day); d.setMonth(this.getMonth() + value); break; case Date.YEAR: d.setFullYear(this.getFullYear() + value); break; } return d; }, between : function(start, end) { var t = this.getTime(); return start.getTime() <= t && t <= end.getTime(); } }); Date.prototype.format = Date.prototype.dateFormat; if (Ext.isSafari && (navigator.userAgent.match(/WebKit\/(\d+)/)[1] || NaN) < 420) { Ext.apply(Date.prototype, { _xMonth : Date.prototype.setMonth, _xDate : Date.prototype.setDate, setMonth : function(num) { if (num <= -1) { var n = Math.ceil(-num), back_year = Math.ceil(n / 12), month = (n % 12) ? 12 - n % 12 : 0; this.setFullYear(this.getFullYear() - back_year); return this._xMonth(month); } else { return this._xMonth(num); } }, setDate : function(d) { return this.setTime(this.getTime() - (this.getDate() - d) * 864e5); } }); } Ext.util.MixedCollection = function(allowFunctions, keyFn){ this.items = []; this.map = {}; this.keys = []; this.length = 0; this.addEvents( 'clear', 'add', 'replace', 'remove', 'sort' ); this.allowFunctions = allowFunctions === true; if(keyFn){ this.getKey = keyFn; } Ext.util.MixedCollection.superclass.constructor.call(this); }; Ext.extend(Ext.util.MixedCollection, Ext.util.Observable, { allowFunctions : false, add : function(key, o){ if(arguments.length == 1){ o = arguments[0]; key = this.getKey(o); } if(typeof key != 'undefined' && key !== null){ var old = this.map[key]; if(typeof old != 'undefined'){ return this.replace(key, o); } this.map[key] = o; } this.length++; this.items.push(o); this.keys.push(key); this.fireEvent('add', this.length-1, o, key); return o; }, getKey : function(o){ return o.id; }, replace : function(key, o){ if(arguments.length == 1){ o = arguments[0]; key = this.getKey(o); } var old = this.map[key]; if(typeof key == 'undefined' || key === null || typeof old == 'undefined'){ return this.add(key, o); } var index = this.indexOfKey(key); this.items[index] = o; this.map[key] = o; this.fireEvent('replace', key, old, o); return o; }, addAll : function(objs){ if(arguments.length > 1 || Ext.isArray(objs)){ var args = arguments.length > 1 ? arguments : objs; for(var i = 0, len = args.length; i < len; i++){ this.add(args[i]); } }else{ for(var key in objs){ if(this.allowFunctions || typeof objs[key] != 'function'){ this.add(key, objs[key]); } } } }, each : function(fn, scope){ var items = [].concat(this.items); for(var i = 0, len = items.length; i < len; i++){ if(fn.call(scope || items[i], items[i], i, len) === false){ break; } } }, eachKey : function(fn, scope){ for(var i = 0, len = this.keys.length; i < len; i++){ fn.call(scope || window, this.keys[i], this.items[i], i, len); } }, find : function(fn, scope){ for(var i = 0, len = this.items.length; i < len; i++){ if(fn.call(scope || window, this.items[i], this.keys[i])){ return this.items[i]; } } return null; }, insert : function(index, key, o){ if(arguments.length == 2){ o = arguments[1]; key = this.getKey(o); } if(this.containsKey(key)){ this.suspendEvents(); this.removeKey(key); this.resumeEvents(); } if(index >= this.length){ return this.add(key, o); } this.length++; this.items.splice(index, 0, o); if(typeof key != 'undefined' && key !== null){ this.map[key] = o; } this.keys.splice(index, 0, key); this.fireEvent('add', index, o, key); return o; }, remove : function(o){ return this.removeAt(this.indexOf(o)); }, removeAt : function(index){ if(index < this.length && index >= 0){ this.length--; var o = this.items[index]; this.items.splice(index, 1); var key = this.keys[index]; if(typeof key != 'undefined'){ delete this.map[key]; } this.keys.splice(index, 1); this.fireEvent('remove', o, key); return o; } return false; }, removeKey : function(key){ return this.removeAt(this.indexOfKey(key)); }, getCount : function(){ return this.length; }, indexOf : function(o){ return this.items.indexOf(o); }, indexOfKey : function(key){ return this.keys.indexOf(key); }, item : function(key){ var mk = this.map[key], item = mk !== undefined ? mk : (typeof key == 'number') ? this.items[key] : undefined; return typeof item != 'function' || this.allowFunctions ? item : null; }, itemAt : function(index){ return this.items[index]; }, key : function(key){ return this.map[key]; }, contains : function(o){ return this.indexOf(o) != -1; }, containsKey : function(key){ return typeof this.map[key] != 'undefined'; }, clear : function(){ this.length = 0; this.items = []; this.keys = []; this.map = {}; this.fireEvent('clear'); }, first : function(){ return this.items[0]; }, last : function(){ return this.items[this.length-1]; }, _sort : function(property, dir, fn){ var i, len, dsc = String(dir).toUpperCase() == 'DESC' ? -1 : 1, c = [], keys = this.keys, items = this.items; fn = fn || function(a, b) { return a - b; }; for(i = 0, len = items.length; i < len; i++){ c[c.length] = { key : keys[i], value: items[i], index: i }; } c.sort(function(a, b){ var v = fn(a[property], b[property]) * dsc; if(v === 0){ v = (a.index < b.index ? -1 : 1); } return v; }); for(i = 0, len = c.length; i < len; i++){ items[i] = c[i].value; keys[i] = c[i].key; } this.fireEvent('sort', this); }, sort : function(dir, fn){ this._sort('value', dir, fn); }, reorder: function(mapping) { this.suspendEvents(); var items = this.items, index = 0, length = items.length, order = [], remaining = [], oldIndex; for (oldIndex in mapping) { order[mapping[oldIndex]] = items[oldIndex]; } for (index = 0; index < length; index++) { if (mapping[index] == undefined) { remaining.push(items[index]); } } for (index = 0; index < length; index++) { if (order[index] == undefined) { order[index] = remaining.shift(); } } this.clear(); this.addAll(order); this.resumeEvents(); this.fireEvent('sort', this); }, keySort : function(dir, fn){ this._sort('key', dir, fn || function(a, b){ var v1 = String(a).toUpperCase(), v2 = String(b).toUpperCase(); return v1 > v2 ? 1 : (v1 < v2 ? -1 : 0); }); }, getRange : function(start, end){ var items = this.items; if(items.length < 1){ return []; } start = start || 0; end = Math.min(typeof end == 'undefined' ? this.length-1 : end, this.length-1); var i, r = []; if(start <= end){ for(i = start; i <= end; i++) { r[r.length] = items[i]; } }else{ for(i = start; i >= end; i--) { r[r.length] = items[i]; } } return r; }, filter : function(property, value, anyMatch, caseSensitive){ if(Ext.isEmpty(value, false)){ return this.clone(); } value = this.createValueMatcher(value, anyMatch, caseSensitive); return this.filterBy(function(o){ return o && value.test(o[property]); }); }, filterBy : function(fn, scope){ var r = new Ext.util.MixedCollection(); r.getKey = this.getKey; var k = this.keys, it = this.items; for(var i = 0, len = it.length; i < len; i++){ if(fn.call(scope||this, it[i], k[i])){ r.add(k[i], it[i]); } } return r; }, findIndex : function(property, value, start, anyMatch, caseSensitive){ if(Ext.isEmpty(value, false)){ return -1; } value = this.createValueMatcher(value, anyMatch, caseSensitive); return this.findIndexBy(function(o){ return o && value.test(o[property]); }, null, start); }, findIndexBy : function(fn, scope, start){ var k = this.keys, it = this.items; for(var i = (start||0), len = it.length; i < len; i++){ if(fn.call(scope||this, it[i], k[i])){ return i; } } return -1; }, createValueMatcher : function(value, anyMatch, caseSensitive, exactMatch) { if (!value.exec) { var er = Ext.escapeRe; value = String(value); if (anyMatch === true) { value = er(value); } else { value = '^' + er(value); if (exactMatch === true) { value += '$'; } } value = new RegExp(value, caseSensitive ? '' : 'i'); } return value; }, clone : function(){ var r = new Ext.util.MixedCollection(); var k = this.keys, it = this.items; for(var i = 0, len = it.length; i < len; i++){ r.add(k[i], it[i]); } r.getKey = this.getKey; return r; } }); Ext.util.MixedCollection.prototype.get = Ext.util.MixedCollection.prototype.item; Ext.AbstractManager = Ext.extend(Object, { typeName: 'type', constructor: function(config) { Ext.apply(this, config || {}); this.all = new Ext.util.MixedCollection(); this.types = {}; }, get : function(id){ return this.all.get(id); }, register: function(item) { this.all.add(item); }, unregister: function(item) { this.all.remove(item); }, registerType : function(type, cls){ this.types[type] = cls; cls[this.typeName] = type; }, isRegistered : function(type){ return this.types[type] !== undefined; }, create: function(config, defaultType) { var type = config[this.typeName] || config.type || defaultType, Constructor = this.types[type]; if (Constructor == undefined) { throw new Error(String.format("The '{0}' type has not been registered with this manager", type)); } return new Constructor(config); }, onAvailable : function(id, fn, scope){ var all = this.all; all.on("add", function(index, o){ if (o.id == id) { fn.call(scope || o, o); all.un("add", fn, scope); } }); } }); Ext.util.Format = function() { var trimRe = /^\s+|\s+$/g, stripTagsRE = /<\/?[^>]+>/gi, stripScriptsRe = /(?:)((\n|\r|.)*?)(?:<\/script>)/ig, nl2brRe = /\r?\n/g; return { ellipsis : function(value, len, word) { if (value && value.length > len) { if (word) { var vs = value.substr(0, len - 2), index = Math.max(vs.lastIndexOf(' '), vs.lastIndexOf('.'), vs.lastIndexOf('!'), vs.lastIndexOf('?')); if (index == -1 || index < (len - 15)) { return value.substr(0, len - 3) + "..."; } else { return vs.substr(0, index) + "..."; } } else { return value.substr(0, len - 3) + "..."; } } return value; }, undef : function(value) { return value !== undefined ? value : ""; }, defaultValue : function(value, defaultValue) { return value !== undefined && value !== '' ? value : defaultValue; }, htmlEncode : function(value) { return !value ? value : String(value).replace(/&/g, "&").replace(/>/g, ">").replace(/").replace(/</g, "<").replace(/"/g, '"').replace(/&/g, "&"); }, trim : function(value) { return String(value).replace(trimRe, ""); }, substr : function(value, start, length) { return String(value).substr(start, length); }, lowercase : function(value) { return String(value).toLowerCase(); }, uppercase : function(value) { return String(value).toUpperCase(); }, capitalize : function(value) { return !value ? value : value.charAt(0).toUpperCase() + value.substr(1).toLowerCase(); }, call : function(value, fn) { if (arguments.length > 2) { var args = Array.prototype.slice.call(arguments, 2); args.unshift(value); return eval(fn).apply(window, args); } else { return eval(fn).call(window, value); } }, usMoney : function(v) { v = (Math.round((v-0)*100))/100; v = (v == Math.floor(v)) ? v + ".00" : ((v*10 == Math.floor(v*10)) ? v + "0" : v); v = String(v); var ps = v.split('.'), whole = ps[0], sub = ps[1] ? '.'+ ps[1] : '.00', r = /(\d+)(\d{3})/; while (r.test(whole)) { whole = whole.replace(r, '$1' + ',' + '$2'); } v = whole + sub; if (v.charAt(0) == '-') { return '-$' + v.substr(1); } return "$" + v; }, date : function(v, format) { if (!v) { return ""; } if (!Ext.isDate(v)) { v = new Date(Date.parse(v)); } return v.dateFormat(format || "m/d/Y"); }, dateRenderer : function(format) { return function(v) { return Ext.util.Format.date(v, format); }; }, stripTags : function(v) { return !v ? v : String(v).replace(stripTagsRE, ""); }, stripScripts : function(v) { return !v ? v : String(v).replace(stripScriptsRe, ""); }, fileSize : function(size) { if (size < 1024) { return size + " bytes"; } else if (size < 1048576) { return (Math.round(((size*10) / 1024))/10) + " KB"; } else { return (Math.round(((size*10) / 1048576))/10) + " MB"; } }, math : function(){ var fns = {}; return function(v, a){ if (!fns[a]) { fns[a] = new Function('v', 'return v ' + a + ';'); } return fns[a](v); }; }(), round : function(value, precision) { var result = Number(value); if (typeof precision == 'number') { precision = Math.pow(10, precision); result = Math.round(value * precision) / precision; } return result; }, number: function(v, format) { if (!format) { return v; } v = Ext.num(v, NaN); if (isNaN(v)) { return ''; } var comma = ',', dec = '.', i18n = false, neg = v < 0; v = Math.abs(v); if (format.substr(format.length - 2) == '/i') { format = format.substr(0, format.length - 2); i18n = true; comma = '.'; dec = ','; } var hasComma = format.indexOf(comma) != -1, psplit = (i18n ? format.replace(/[^\d\,]/g, '') : format.replace(/[^\d\.]/g, '')).split(dec); if (1 < psplit.length) { v = v.toFixed(psplit[1].length); } else if(2 < psplit.length) { throw ('NumberFormatException: invalid format, formats should have no more than 1 period: ' + format); } else { v = v.toFixed(0); } var fnum = v.toString(); psplit = fnum.split('.'); if (hasComma) { var cnum = psplit[0], parr = [], j = cnum.length, m = Math.floor(j / 3), n = cnum.length % 3 || 3, i; for (i = 0; i < j; i += n) { if (i != 0) { n = 3; } parr[parr.length] = cnum.substr(i, n); m -= 1; } fnum = parr.join(comma); if (psplit[1]) { fnum += dec + psplit[1]; } } else { if (psplit[1]) { fnum = psplit[0] + dec + psplit[1]; } } return (neg ? '-' : '') + format.replace(/[\d,?\.?]+/, fnum); }, numberRenderer : function(format) { return function(v) { return Ext.util.Format.number(v, format); }; }, plural : function(v, s, p) { return v +' ' + (v == 1 ? s : (p ? p : s+'s')); }, nl2br : function(v) { return Ext.isEmpty(v) ? '' : v.replace(nl2brRe, '
    '); } }; }(); Ext.XTemplate = function(){ Ext.XTemplate.superclass.constructor.apply(this, arguments); var me = this, s = me.html, re = /]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/, nameRe = /^]*?for="(.*?)"/, ifRe = /^]*?if="(.*?)"/, execRe = /^]*?exec="(.*?)"/, m, id = 0, tpls = [], VALUES = 'values', PARENT = 'parent', XINDEX = 'xindex', XCOUNT = 'xcount', RETURN = 'return ', WITHVALUES = 'with(values){ '; s = ['', s, ''].join(''); while((m = s.match(re))){ var m2 = m[0].match(nameRe), m3 = m[0].match(ifRe), m4 = m[0].match(execRe), exp = null, fn = null, exec = null, name = m2 && m2[1] ? m2[1] : ''; if (m3) { exp = m3 && m3[1] ? m3[1] : null; if(exp){ fn = new Function(VALUES, PARENT, XINDEX, XCOUNT, WITHVALUES + RETURN +(Ext.util.Format.htmlDecode(exp))+'; }'); } } if (m4) { exp = m4 && m4[1] ? m4[1] : null; if(exp){ exec = new Function(VALUES, PARENT, XINDEX, XCOUNT, WITHVALUES +(Ext.util.Format.htmlDecode(exp))+'; }'); } } if(name){ switch(name){ case '.': name = new Function(VALUES, PARENT, WITHVALUES + RETURN + VALUES + '; }'); break; case '..': name = new Function(VALUES, PARENT, WITHVALUES + RETURN + PARENT + '; }'); break; default: name = new Function(VALUES, PARENT, WITHVALUES + RETURN + name + '; }'); } } tpls.push({ id: id, target: name, exec: exec, test: fn, body: m[1]||'' }); s = s.replace(m[0], '{xtpl'+ id + '}'); ++id; } for(var i = tpls.length-1; i >= 0; --i){ me.compileTpl(tpls[i]); } me.master = tpls[tpls.length-1]; me.tpls = tpls; }; Ext.extend(Ext.XTemplate, Ext.Template, { re : /\{([\w\-\.\#]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?(\s?[\+\-\*\\]\s?[\d\.\+\-\*\\\(\)]+)?\}/g, codeRe : /\{\[((?:\\\]|.|\n)*?)\]\}/g, applySubTemplate : function(id, values, parent, xindex, xcount){ var me = this, len, t = me.tpls[id], vs, buf = []; if ((t.test && !t.test.call(me, values, parent, xindex, xcount)) || (t.exec && t.exec.call(me, values, parent, xindex, xcount))) { return ''; } vs = t.target ? t.target.call(me, values, parent) : values; len = vs.length; parent = t.target ? values : parent; if(t.target && Ext.isArray(vs)){ for(var i = 0, len = vs.length; i < len; i++){ buf[buf.length] = t.compiled.call(me, vs[i], parent, i+1, len); } return buf.join(''); } return t.compiled.call(me, vs, parent, xindex, xcount); }, compileTpl : function(tpl){ var fm = Ext.util.Format, useF = this.disableFormats !== true, sep = Ext.isGecko ? "+" : ",", body; function fn(m, name, format, args, math){ if(name.substr(0, 4) == 'xtpl'){ return "'"+ sep +'this.applySubTemplate('+name.substr(4)+', values, parent, xindex, xcount)'+sep+"'"; } var v; if(name === '.'){ v = 'values'; }else if(name === '#'){ v = 'xindex'; }else if(name.indexOf('.') != -1){ v = name; }else{ v = "values['" + name + "']"; } if(math){ v = '(' + v + math + ')'; } if (format && useF) { args = args ? ',' + args : ""; if(format.substr(0, 5) != "this."){ format = "fm." + format + '('; }else{ format = 'this.call("'+ format.substr(5) + '", '; args = ", values"; } } else { args= ''; format = "("+v+" === undefined ? '' : "; } return "'"+ sep + format + v + args + ")"+sep+"'"; } function codeFn(m, code){ return "'" + sep + '(' + code.replace(/\\'/g, "'") + ')' + sep + "'"; } if(Ext.isGecko){ body = "tpl.compiled = function(values, parent, xindex, xcount){ return '" + tpl.body.replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn).replace(this.codeRe, codeFn) + "';};"; }else{ body = ["tpl.compiled = function(values, parent, xindex, xcount){ return ['"]; body.push(tpl.body.replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn).replace(this.codeRe, codeFn)); body.push("'].join('');};"); body = body.join(''); } eval(body); return this; }, applyTemplate : function(values){ return this.master.compiled.call(this, values, {}, 1, 1); }, compile : function(){return this;} }); Ext.XTemplate.prototype.apply = Ext.XTemplate.prototype.applyTemplate; Ext.XTemplate.from = function(el){ el = Ext.getDom(el); return new Ext.XTemplate(el.value || el.innerHTML); }; Ext.util.CSS = function(){ var rules = null; var doc = document; var camelRe = /(-[a-z])/gi; var camelFn = function(m, a){ return a.charAt(1).toUpperCase(); }; return { createStyleSheet : function(cssText, id){ var ss; var head = doc.getElementsByTagName("head")[0]; var rules = doc.createElement("style"); rules.setAttribute("type", "text/css"); if(id){ rules.setAttribute("id", id); } if(Ext.isIE){ head.appendChild(rules); ss = rules.styleSheet; ss.cssText = cssText; }else{ try{ rules.appendChild(doc.createTextNode(cssText)); }catch(e){ rules.cssText = cssText; } head.appendChild(rules); ss = rules.styleSheet ? rules.styleSheet : (rules.sheet || doc.styleSheets[doc.styleSheets.length-1]); } this.cacheStyleSheet(ss); return ss; }, removeStyleSheet : function(id){ var existing = doc.getElementById(id); if(existing){ existing.parentNode.removeChild(existing); } }, swapStyleSheet : function(id, url){ this.removeStyleSheet(id); var ss = doc.createElement("link"); ss.setAttribute("rel", "stylesheet"); ss.setAttribute("type", "text/css"); ss.setAttribute("id", id); ss.setAttribute("href", url); doc.getElementsByTagName("head")[0].appendChild(ss); }, refreshCache : function(){ return this.getRules(true); }, cacheStyleSheet : function(ss){ if(!rules){ rules = {}; } try{ var ssRules = ss.cssRules || ss.rules; for(var j = ssRules.length-1; j >= 0; --j){ rules[ssRules[j].selectorText.toLowerCase()] = ssRules[j]; } }catch(e){} }, getRules : function(refreshCache){ if(rules === null || refreshCache){ rules = {}; var ds = doc.styleSheets; for(var i =0, len = ds.length; i < len; i++){ try{ this.cacheStyleSheet(ds[i]); }catch(e){} } } return rules; }, getRule : function(selector, refreshCache){ var rs = this.getRules(refreshCache); if(!Ext.isArray(selector)){ return rs[selector.toLowerCase()]; } for(var i = 0; i < selector.length; i++){ if(rs[selector[i]]){ return rs[selector[i].toLowerCase()]; } } return null; }, updateRule : function(selector, property, value){ if(!Ext.isArray(selector)){ var rule = this.getRule(selector); if(rule){ rule.style[property.replace(camelRe, camelFn)] = value; return true; } }else{ for(var i = 0; i < selector.length; i++){ if(this.updateRule(selector[i], property, value)){ return true; } } } return false; } }; }(); Ext.util.ClickRepeater = Ext.extend(Ext.util.Observable, { constructor : function(el, config){ this.el = Ext.get(el); this.el.unselectable(); Ext.apply(this, config); this.addEvents( "mousedown", "click", "mouseup" ); if(!this.disabled){ this.disabled = true; this.enable(); } if(this.handler){ this.on("click", this.handler, this.scope || this); } Ext.util.ClickRepeater.superclass.constructor.call(this); }, interval : 20, delay: 250, preventDefault : true, stopDefault : false, timer : 0, enable: function(){ if(this.disabled){ this.el.on('mousedown', this.handleMouseDown, this); if (Ext.isIE){ this.el.on('dblclick', this.handleDblClick, this); } if(this.preventDefault || this.stopDefault){ this.el.on('click', this.eventOptions, this); } } this.disabled = false; }, disable: function( force){ if(force || !this.disabled){ clearTimeout(this.timer); if(this.pressClass){ this.el.removeClass(this.pressClass); } Ext.getDoc().un('mouseup', this.handleMouseUp, this); this.el.removeAllListeners(); } this.disabled = true; }, setDisabled: function(disabled){ this[disabled ? 'disable' : 'enable'](); }, eventOptions: function(e){ if(this.preventDefault){ e.preventDefault(); } if(this.stopDefault){ e.stopEvent(); } }, destroy : function() { this.disable(true); Ext.destroy(this.el); this.purgeListeners(); }, handleDblClick : function(e){ clearTimeout(this.timer); this.el.blur(); this.fireEvent("mousedown", this, e); this.fireEvent("click", this, e); }, handleMouseDown : function(e){ clearTimeout(this.timer); this.el.blur(); if(this.pressClass){ this.el.addClass(this.pressClass); } this.mousedownTime = new Date(); Ext.getDoc().on("mouseup", this.handleMouseUp, this); this.el.on("mouseout", this.handleMouseOut, this); this.fireEvent("mousedown", this, e); this.fireEvent("click", this, e); if (this.accelerate) { this.delay = 400; } this.timer = this.click.defer(this.delay || this.interval, this, [e]); }, click : function(e){ this.fireEvent("click", this, e); this.timer = this.click.defer(this.accelerate ? this.easeOutExpo(this.mousedownTime.getElapsed(), 400, -390, 12000) : this.interval, this, [e]); }, easeOutExpo : function (t, b, c, d) { return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; }, handleMouseOut : function(){ clearTimeout(this.timer); if(this.pressClass){ this.el.removeClass(this.pressClass); } this.el.on("mouseover", this.handleMouseReturn, this); }, handleMouseReturn : function(){ this.el.un("mouseover", this.handleMouseReturn, this); if(this.pressClass){ this.el.addClass(this.pressClass); } this.click(); }, handleMouseUp : function(e){ clearTimeout(this.timer); this.el.un("mouseover", this.handleMouseReturn, this); this.el.un("mouseout", this.handleMouseOut, this); Ext.getDoc().un("mouseup", this.handleMouseUp, this); this.el.removeClass(this.pressClass); this.fireEvent("mouseup", this, e); } }); Ext.KeyNav = function(el, config){ this.el = Ext.get(el); Ext.apply(this, config); if(!this.disabled){ this.disabled = true; this.enable(); } }; Ext.KeyNav.prototype = { disabled : false, defaultEventAction: "stopEvent", forceKeyDown : false, relay : function(e){ var k = e.getKey(), h = this.keyToHandler[k]; if(h && this[h]){ if(this.doRelay(e, this[h], h) !== true){ e[this.defaultEventAction](); } } }, doRelay : function(e, h, hname){ return h.call(this.scope || this, e, hname); }, enter : false, left : false, right : false, up : false, down : false, tab : false, esc : false, pageUp : false, pageDown : false, del : false, home : false, end : false, space : false, keyToHandler : { 37 : "left", 39 : "right", 38 : "up", 40 : "down", 33 : "pageUp", 34 : "pageDown", 46 : "del", 36 : "home", 35 : "end", 13 : "enter", 27 : "esc", 9 : "tab", 32 : "space" }, stopKeyUp: function(e) { var k = e.getKey(); if (k >= 37 && k <= 40) { e.stopEvent(); } }, destroy: function(){ this.disable(); }, enable: function() { if (this.disabled) { if (Ext.isSafari2) { this.el.on('keyup', this.stopKeyUp, this); } this.el.on(this.isKeydown()? 'keydown' : 'keypress', this.relay, this); this.disabled = false; } }, disable: function() { if (!this.disabled) { if (Ext.isSafari2) { this.el.un('keyup', this.stopKeyUp, this); } this.el.un(this.isKeydown()? 'keydown' : 'keypress', this.relay, this); this.disabled = true; } }, setDisabled : function(disabled){ this[disabled ? "disable" : "enable"](); }, isKeydown: function(){ return this.forceKeyDown || Ext.EventManager.useKeydown; } }; Ext.KeyMap = function(el, config, eventName){ this.el = Ext.get(el); this.eventName = eventName || "keydown"; this.bindings = []; if(config){ this.addBinding(config); } this.enable(); }; Ext.KeyMap.prototype = { stopEvent : false, addBinding : function(config){ if(Ext.isArray(config)){ Ext.each(config, function(c){ this.addBinding(c); }, this); return; } var keyCode = config.key, fn = config.fn || config.handler, scope = config.scope; if (config.stopEvent) { this.stopEvent = config.stopEvent; } if(typeof keyCode == "string"){ var ks = []; var keyString = keyCode.toUpperCase(); for(var j = 0, len = keyString.length; j < len; j++){ ks.push(keyString.charCodeAt(j)); } keyCode = ks; } var keyArray = Ext.isArray(keyCode); var handler = function(e){ if(this.checkModifiers(config, e)){ var k = e.getKey(); if(keyArray){ for(var i = 0, len = keyCode.length; i < len; i++){ if(keyCode[i] == k){ if(this.stopEvent){ e.stopEvent(); } fn.call(scope || window, k, e); return; } } }else{ if(k == keyCode){ if(this.stopEvent){ e.stopEvent(); } fn.call(scope || window, k, e); } } } }; this.bindings.push(handler); }, checkModifiers: function(config, e){ var val, key, keys = ['shift', 'ctrl', 'alt']; for (var i = 0, len = keys.length; i < len; ++i){ key = keys[i]; val = config[key]; if(!(val === undefined || (val === e[key + 'Key']))){ return false; } } return true; }, on : function(key, fn, scope){ var keyCode, shift, ctrl, alt; if(typeof key == "object" && !Ext.isArray(key)){ keyCode = key.key; shift = key.shift; ctrl = key.ctrl; alt = key.alt; }else{ keyCode = key; } this.addBinding({ key: keyCode, shift: shift, ctrl: ctrl, alt: alt, fn: fn, scope: scope }); }, handleKeyDown : function(e){ if(this.enabled){ var b = this.bindings; for(var i = 0, len = b.length; i < len; i++){ b[i].call(this, e); } } }, isEnabled : function(){ return this.enabled; }, enable: function(){ if(!this.enabled){ this.el.on(this.eventName, this.handleKeyDown, this); this.enabled = true; } }, disable: function(){ if(this.enabled){ this.el.removeListener(this.eventName, this.handleKeyDown, this); this.enabled = false; } }, setDisabled : function(disabled){ this[disabled ? "disable" : "enable"](); } }; Ext.util.TextMetrics = function(){ var shared; return { measure : function(el, text, fixedWidth){ if(!shared){ shared = Ext.util.TextMetrics.Instance(el, fixedWidth); } shared.bind(el); shared.setFixedWidth(fixedWidth || 'auto'); return shared.getSize(text); }, createInstance : function(el, fixedWidth){ return Ext.util.TextMetrics.Instance(el, fixedWidth); } }; }(); Ext.util.TextMetrics.Instance = function(bindTo, fixedWidth){ var ml = new Ext.Element(document.createElement('div')); document.body.appendChild(ml.dom); ml.position('absolute'); ml.setLeftTop(-1000, -1000); ml.hide(); if(fixedWidth){ ml.setWidth(fixedWidth); } var instance = { getSize : function(text){ ml.update(text); var s = ml.getSize(); ml.update(''); return s; }, bind : function(el){ ml.setStyle( Ext.fly(el).getStyles('font-size','font-style', 'font-weight', 'font-family','line-height', 'text-transform', 'letter-spacing') ); }, setFixedWidth : function(width){ ml.setWidth(width); }, getWidth : function(text){ ml.dom.style.width = 'auto'; return this.getSize(text).width; }, getHeight : function(text){ return this.getSize(text).height; } }; instance.bind(bindTo); return instance; }; Ext.Element.addMethods({ getTextWidth : function(text, min, max){ return (Ext.util.TextMetrics.measure(this.dom, Ext.value(text, this.dom.innerHTML, true)).width).constrain(min || 0, max || 1000000); } }); Ext.util.Cookies = { set : function(name, value){ var argv = arguments; var argc = arguments.length; var expires = (argc > 2) ? argv[2] : null; var path = (argc > 3) ? argv[3] : '/'; var domain = (argc > 4) ? argv[4] : null; var secure = (argc > 5) ? argv[5] : false; document.cookie = name + "=" + escape(value) + ((expires === null) ? "" : ("; expires=" + expires.toGMTString())) + ((path === null) ? "" : ("; path=" + path)) + ((domain === null) ? "" : ("; domain=" + domain)) + ((secure === true) ? "; secure" : ""); }, get : function(name){ var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; var j = 0; while(i < clen){ j = i + alen; if(document.cookie.substring(i, j) == arg){ return Ext.util.Cookies.getCookieVal(j); } i = document.cookie.indexOf(" ", i) + 1; if(i === 0){ break; } } return null; }, clear : function(name){ if(Ext.util.Cookies.get(name)){ document.cookie = name + "=" + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; } }, getCookieVal : function(offset){ var endstr = document.cookie.indexOf(";", offset); if(endstr == -1){ endstr = document.cookie.length; } return unescape(document.cookie.substring(offset, endstr)); } }; Ext.handleError = function(e) { throw e; }; Ext.Error = function(message) { this.message = (this.lang[message]) ? this.lang[message] : message; }; Ext.Error.prototype = new Error(); Ext.apply(Ext.Error.prototype, { lang: {}, name: 'Ext.Error', getName : function() { return this.name; }, getMessage : function() { return this.message; }, toJson : function() { return Ext.encode(this); } }); Ext.ComponentMgr = function(){ var all = new Ext.util.MixedCollection(); var types = {}; var ptypes = {}; return { register : function(c){ all.add(c); }, unregister : function(c){ all.remove(c); }, get : function(id){ return all.get(id); }, onAvailable : function(id, fn, scope){ all.on("add", function(index, o){ if(o.id == id){ fn.call(scope || o, o); all.un("add", fn, scope); } }); }, all : all, types : types, ptypes: ptypes, isRegistered : function(xtype){ return types[xtype] !== undefined; }, isPluginRegistered : function(ptype){ return ptypes[ptype] !== undefined; }, registerType : function(xtype, cls){ types[xtype] = cls; cls.xtype = xtype; }, create : function(config, defaultType){ return config.render ? config : new types[config.xtype || defaultType](config); }, registerPlugin : function(ptype, cls){ ptypes[ptype] = cls; cls.ptype = ptype; }, createPlugin : function(config, defaultType){ var PluginCls = ptypes[config.ptype || defaultType]; if (PluginCls.init) { return PluginCls; } else { return new PluginCls(config); } } }; }(); Ext.reg = Ext.ComponentMgr.registerType; Ext.preg = Ext.ComponentMgr.registerPlugin; Ext.create = Ext.ComponentMgr.create; Ext.Component = function(config){ config = config || {}; if(config.initialConfig){ if(config.isAction){ this.baseAction = config; } config = config.initialConfig; }else if(config.tagName || config.dom || Ext.isString(config)){ config = {applyTo: config, id: config.id || config}; } this.initialConfig = config; Ext.apply(this, config); this.addEvents( 'added', 'disable', 'enable', 'beforeshow', 'show', 'beforehide', 'hide', 'removed', 'beforerender', 'render', 'afterrender', 'beforedestroy', 'destroy', 'beforestaterestore', 'staterestore', 'beforestatesave', 'statesave' ); this.getId(); Ext.ComponentMgr.register(this); Ext.Component.superclass.constructor.call(this); if(this.baseAction){ this.baseAction.addComponent(this); } this.initComponent(); if(this.plugins){ if(Ext.isArray(this.plugins)){ for(var i = 0, len = this.plugins.length; i < len; i++){ this.plugins[i] = this.initPlugin(this.plugins[i]); } }else{ this.plugins = this.initPlugin(this.plugins); } } if(this.stateful !== false){ this.initState(); } if(this.applyTo){ this.applyToMarkup(this.applyTo); delete this.applyTo; }else if(this.renderTo){ this.render(this.renderTo); delete this.renderTo; } }; Ext.Component.AUTO_ID = 1000; Ext.extend(Ext.Component, Ext.util.Observable, { disabled : false, hidden : false, autoEl : 'div', disabledClass : 'x-item-disabled', allowDomMove : true, autoShow : false, hideMode : 'display', hideParent : false, rendered : false, tplWriteMode : 'overwrite', bubbleEvents: [], ctype : 'Ext.Component', actionMode : 'el', getActionEl : function(){ return this[this.actionMode]; }, initPlugin : function(p){ if(p.ptype && !Ext.isFunction(p.init)){ p = Ext.ComponentMgr.createPlugin(p); }else if(Ext.isString(p)){ p = Ext.ComponentMgr.createPlugin({ ptype: p }); } p.init(this); return p; }, initComponent : function(){ if(this.listeners){ this.on(this.listeners); delete this.listeners; } this.enableBubble(this.bubbleEvents); }, render : function(container, position){ if(!this.rendered && this.fireEvent('beforerender', this) !== false){ if(!container && this.el){ this.el = Ext.get(this.el); container = this.el.dom.parentNode; this.allowDomMove = false; } this.container = Ext.get(container); if(this.ctCls){ this.container.addClass(this.ctCls); } this.rendered = true; if(position !== undefined){ if(Ext.isNumber(position)){ position = this.container.dom.childNodes[position]; }else{ position = Ext.getDom(position); } } this.onRender(this.container, position || null); if(this.autoShow){ this.el.removeClass(['x-hidden','x-hide-' + this.hideMode]); } if(this.cls){ this.el.addClass(this.cls); delete this.cls; } if(this.style){ this.el.applyStyles(this.style); delete this.style; } if(this.overCls){ this.el.addClassOnOver(this.overCls); } this.fireEvent('render', this); var contentTarget = this.getContentTarget(); if (this.html){ contentTarget.update(Ext.DomHelper.markup(this.html)); delete this.html; } if (this.contentEl){ var ce = Ext.getDom(this.contentEl); Ext.fly(ce).removeClass(['x-hidden', 'x-hide-display']); contentTarget.appendChild(ce); } if (this.tpl) { if (!this.tpl.compile) { this.tpl = new Ext.XTemplate(this.tpl); } if (this.data) { this.tpl[this.tplWriteMode](contentTarget, this.data); delete this.data; } } this.afterRender(this.container); if(this.hidden){ this.doHide(); } if(this.disabled){ this.disable(true); } if(this.stateful !== false){ this.initStateEvents(); } this.fireEvent('afterrender', this); } return this; }, update: function(htmlOrData, loadScripts, cb) { var contentTarget = this.getContentTarget(); if (this.tpl && typeof htmlOrData !== "string") { this.tpl[this.tplWriteMode](contentTarget, htmlOrData || {}); } else { var html = Ext.isObject(htmlOrData) ? Ext.DomHelper.markup(htmlOrData) : htmlOrData; contentTarget.update(html, loadScripts, cb); } }, onAdded : function(container, pos) { this.ownerCt = container; this.initRef(); this.fireEvent('added', this, container, pos); }, onRemoved : function() { this.removeRef(); this.fireEvent('removed', this, this.ownerCt); delete this.ownerCt; }, initRef : function() { if(this.ref && !this.refOwner){ var levels = this.ref.split('/'), last = levels.length, i = 0, t = this; while(t && i < last){ t = t.ownerCt; ++i; } if(t){ t[this.refName = levels[--i]] = this; this.refOwner = t; } } }, removeRef : function() { if (this.refOwner && this.refName) { delete this.refOwner[this.refName]; delete this.refOwner; } }, initState : function(){ if(Ext.state.Manager){ var id = this.getStateId(); if(id){ var state = Ext.state.Manager.get(id); if(state){ if(this.fireEvent('beforestaterestore', this, state) !== false){ this.applyState(Ext.apply({}, state)); this.fireEvent('staterestore', this, state); } } } } }, getStateId : function(){ return this.stateId || ((/^(ext-comp-|ext-gen)/).test(String(this.id)) ? null : this.id); }, initStateEvents : function(){ if(this.stateEvents){ for(var i = 0, e; e = this.stateEvents[i]; i++){ this.on(e, this.saveState, this, {delay:100}); } } }, applyState : function(state){ if(state){ Ext.apply(this, state); } }, getState : function(){ return null; }, saveState : function(){ if(Ext.state.Manager && this.stateful !== false){ var id = this.getStateId(); if(id){ var state = this.getState(); if(this.fireEvent('beforestatesave', this, state) !== false){ Ext.state.Manager.set(id, state); this.fireEvent('statesave', this, state); } } } }, applyToMarkup : function(el){ this.allowDomMove = false; this.el = Ext.get(el); this.render(this.el.dom.parentNode); }, addClass : function(cls){ if(this.el){ this.el.addClass(cls); }else{ this.cls = this.cls ? this.cls + ' ' + cls : cls; } return this; }, removeClass : function(cls){ if(this.el){ this.el.removeClass(cls); }else if(this.cls){ this.cls = this.cls.split(' ').remove(cls).join(' '); } return this; }, onRender : function(ct, position){ if(!this.el && this.autoEl){ if(Ext.isString(this.autoEl)){ this.el = document.createElement(this.autoEl); }else{ var div = document.createElement('div'); Ext.DomHelper.overwrite(div, this.autoEl); this.el = div.firstChild; } if (!this.el.id) { this.el.id = this.getId(); } } if(this.el){ this.el = Ext.get(this.el); if(this.allowDomMove !== false){ ct.dom.insertBefore(this.el.dom, position); if (div) { Ext.removeNode(div); div = null; } } } }, getAutoCreate : function(){ var cfg = Ext.isObject(this.autoCreate) ? this.autoCreate : Ext.apply({}, this.defaultAutoCreate); if(this.id && !cfg.id){ cfg.id = this.id; } return cfg; }, afterRender : Ext.emptyFn, destroy : function(){ if(!this.isDestroyed){ if(this.fireEvent('beforedestroy', this) !== false){ this.destroying = true; this.beforeDestroy(); if(this.ownerCt && this.ownerCt.remove){ this.ownerCt.remove(this, false); } if(this.rendered){ this.el.remove(); if(this.actionMode == 'container' || this.removeMode == 'container'){ this.container.remove(); } } if(this.focusTask && this.focusTask.cancel){ this.focusTask.cancel(); } this.onDestroy(); Ext.ComponentMgr.unregister(this); this.fireEvent('destroy', this); this.purgeListeners(); this.destroying = false; this.isDestroyed = true; } } }, deleteMembers : function(){ var args = arguments; for(var i = 0, len = args.length; i < len; ++i){ delete this[args[i]]; } }, beforeDestroy : Ext.emptyFn, onDestroy : Ext.emptyFn, getEl : function(){ return this.el; }, getContentTarget : function(){ return this.el; }, getId : function(){ return this.id || (this.id = 'ext-comp-' + (++Ext.Component.AUTO_ID)); }, getItemId : function(){ return this.itemId || this.getId(); }, focus : function(selectText, delay){ if(delay){ this.focusTask = new Ext.util.DelayedTask(this.focus, this, [selectText, false]); this.focusTask.delay(Ext.isNumber(delay) ? delay : 10); return this; } if(this.rendered && !this.isDestroyed){ this.el.focus(); if(selectText === true){ this.el.dom.select(); } } return this; }, blur : function(){ if(this.rendered){ this.el.blur(); } return this; }, disable : function( silent){ if(this.rendered){ this.onDisable(); } this.disabled = true; if(silent !== true){ this.fireEvent('disable', this); } return this; }, onDisable : function(){ this.getActionEl().addClass(this.disabledClass); this.el.dom.disabled = true; }, enable : function(){ if(this.rendered){ this.onEnable(); } this.disabled = false; this.fireEvent('enable', this); return this; }, onEnable : function(){ this.getActionEl().removeClass(this.disabledClass); this.el.dom.disabled = false; }, setDisabled : function(disabled){ return this[disabled ? 'disable' : 'enable'](); }, show : function(){ if(this.fireEvent('beforeshow', this) !== false){ this.hidden = false; if(this.autoRender){ this.render(Ext.isBoolean(this.autoRender) ? Ext.getBody() : this.autoRender); } if(this.rendered){ this.onShow(); } this.fireEvent('show', this); } return this; }, onShow : function(){ this.getVisibilityEl().removeClass('x-hide-' + this.hideMode); }, hide : function(){ if(this.fireEvent('beforehide', this) !== false){ this.doHide(); this.fireEvent('hide', this); } return this; }, doHide: function(){ this.hidden = true; if(this.rendered){ this.onHide(); } }, onHide : function(){ this.getVisibilityEl().addClass('x-hide-' + this.hideMode); }, getVisibilityEl : function(){ return this.hideParent ? this.container : this.getActionEl(); }, setVisible : function(visible){ return this[visible ? 'show' : 'hide'](); }, isVisible : function(){ return this.rendered && this.getVisibilityEl().isVisible(); }, cloneConfig : function(overrides){ overrides = overrides || {}; var id = overrides.id || Ext.id(); var cfg = Ext.applyIf(overrides, this.initialConfig); cfg.id = id; return new this.constructor(cfg); }, getXType : function(){ return this.constructor.xtype; }, isXType : function(xtype, shallow){ if (Ext.isFunction(xtype)){ xtype = xtype.xtype; }else if (Ext.isObject(xtype)){ xtype = xtype.constructor.xtype; } return !shallow ? ('/' + this.getXTypes() + '/').indexOf('/' + xtype + '/') != -1 : this.constructor.xtype == xtype; }, getXTypes : function(){ var tc = this.constructor; if(!tc.xtypes){ var c = [], sc = this; while(sc && sc.constructor.xtype){ c.unshift(sc.constructor.xtype); sc = sc.constructor.superclass; } tc.xtypeChain = c; tc.xtypes = c.join('/'); } return tc.xtypes; }, findParentBy : function(fn) { for (var p = this.ownerCt; (p != null) && !fn(p, this); p = p.ownerCt); return p || null; }, findParentByType : function(xtype, shallow){ return this.findParentBy(function(c){ return c.isXType(xtype, shallow); }); }, bubble : function(fn, scope, args){ var p = this; while(p){ if(fn.apply(scope || p, args || [p]) === false){ break; } p = p.ownerCt; } return this; }, getPositionEl : function(){ return this.positionEl || this.el; }, purgeListeners : function(){ Ext.Component.superclass.purgeListeners.call(this); if(this.mons){ this.on('beforedestroy', this.clearMons, this, {single: true}); } }, clearMons : function(){ Ext.each(this.mons, function(m){ m.item.un(m.ename, m.fn, m.scope); }, this); this.mons = []; }, createMons: function(){ if(!this.mons){ this.mons = []; this.on('beforedestroy', this.clearMons, this, {single: true}); } }, mon : function(item, ename, fn, scope, opt){ this.createMons(); if(Ext.isObject(ename)){ var propRe = /^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/; var o = ename; for(var e in o){ if(propRe.test(e)){ continue; } if(Ext.isFunction(o[e])){ this.mons.push({ item: item, ename: e, fn: o[e], scope: o.scope }); item.on(e, o[e], o.scope, o); }else{ this.mons.push({ item: item, ename: e, fn: o[e], scope: o.scope }); item.on(e, o[e]); } } return; } this.mons.push({ item: item, ename: ename, fn: fn, scope: scope }); item.on(ename, fn, scope, opt); }, mun : function(item, ename, fn, scope){ var found, mon; this.createMons(); for(var i = 0, len = this.mons.length; i < len; ++i){ mon = this.mons[i]; if(item === mon.item && ename == mon.ename && fn === mon.fn && scope === mon.scope){ this.mons.splice(i, 1); item.un(ename, fn, scope); found = true; break; } } return found; }, nextSibling : function(){ if(this.ownerCt){ var index = this.ownerCt.items.indexOf(this); if(index != -1 && index+1 < this.ownerCt.items.getCount()){ return this.ownerCt.items.itemAt(index+1); } } return null; }, previousSibling : function(){ if(this.ownerCt){ var index = this.ownerCt.items.indexOf(this); if(index > 0){ return this.ownerCt.items.itemAt(index-1); } } return null; }, getBubbleTarget : function(){ return this.ownerCt; } }); Ext.reg('component', Ext.Component); Ext.Action = Ext.extend(Object, { constructor : function(config){ this.initialConfig = config; this.itemId = config.itemId = (config.itemId || config.id || Ext.id()); this.items = []; }, isAction : true, setText : function(text){ this.initialConfig.text = text; this.callEach('setText', [text]); }, getText : function(){ return this.initialConfig.text; }, setIconClass : function(cls){ this.initialConfig.iconCls = cls; this.callEach('setIconClass', [cls]); }, getIconClass : function(){ return this.initialConfig.iconCls; }, setDisabled : function(v){ this.initialConfig.disabled = v; this.callEach('setDisabled', [v]); }, enable : function(){ this.setDisabled(false); }, disable : function(){ this.setDisabled(true); }, isDisabled : function(){ return this.initialConfig.disabled; }, setHidden : function(v){ this.initialConfig.hidden = v; this.callEach('setVisible', [!v]); }, show : function(){ this.setHidden(false); }, hide : function(){ this.setHidden(true); }, isHidden : function(){ return this.initialConfig.hidden; }, setHandler : function(fn, scope){ this.initialConfig.handler = fn; this.initialConfig.scope = scope; this.callEach('setHandler', [fn, scope]); }, each : function(fn, scope){ Ext.each(this.items, fn, scope); }, callEach : function(fnName, args){ var cs = this.items; for(var i = 0, len = cs.length; i < len; i++){ cs[i][fnName].apply(cs[i], args); } }, addComponent : function(comp){ this.items.push(comp); comp.on('destroy', this.removeComponent, this); }, removeComponent : function(comp){ this.items.remove(comp); }, execute : function(){ this.initialConfig.handler.apply(this.initialConfig.scope || window, arguments); } }); (function(){ Ext.Layer = function(config, existingEl){ config = config || {}; var dh = Ext.DomHelper, cp = config.parentEl, pel = cp ? Ext.getDom(cp) : document.body; if (existingEl) { this.dom = Ext.getDom(existingEl); } if(!this.dom){ var o = config.dh || {tag: 'div', cls: 'x-layer'}; this.dom = dh.append(pel, o); } if(config.cls){ this.addClass(config.cls); } this.constrain = config.constrain !== false; this.setVisibilityMode(Ext.Element.VISIBILITY); if(config.id){ this.id = this.dom.id = config.id; }else{ this.id = Ext.id(this.dom); } this.zindex = config.zindex || this.getZIndex(); this.position('absolute', this.zindex); if(config.shadow){ this.shadowOffset = config.shadowOffset || 4; this.shadow = new Ext.Shadow({ offset : this.shadowOffset, mode : config.shadow }); }else{ this.shadowOffset = 0; } this.useShim = config.shim !== false && Ext.useShims; this.useDisplay = config.useDisplay; this.hide(); }; var supr = Ext.Element.prototype; var shims = []; Ext.extend(Ext.Layer, Ext.Element, { getZIndex : function(){ return this.zindex || parseInt((this.getShim() || this).getStyle('z-index'), 10) || 11000; }, getShim : function(){ if(!this.useShim){ return null; } if(this.shim){ return this.shim; } var shim = shims.shift(); if(!shim){ shim = this.createShim(); shim.enableDisplayMode('block'); shim.dom.style.display = 'none'; shim.dom.style.visibility = 'visible'; } var pn = this.dom.parentNode; if(shim.dom.parentNode != pn){ pn.insertBefore(shim.dom, this.dom); } shim.setStyle('z-index', this.getZIndex()-2); this.shim = shim; return shim; }, hideShim : function(){ if(this.shim){ this.shim.setDisplayed(false); shims.push(this.shim); delete this.shim; } }, disableShadow : function(){ if(this.shadow){ this.shadowDisabled = true; this.shadow.hide(); this.lastShadowOffset = this.shadowOffset; this.shadowOffset = 0; } }, enableShadow : function(show){ if(this.shadow){ this.shadowDisabled = false; if(Ext.isDefined(this.lastShadowOffset)) { this.shadowOffset = this.lastShadowOffset; delete this.lastShadowOffset; } if(show){ this.sync(true); } } }, sync : function(doShow){ var shadow = this.shadow; if(!this.updating && this.isVisible() && (shadow || this.useShim)){ var shim = this.getShim(), w = this.getWidth(), h = this.getHeight(), l = this.getLeft(true), t = this.getTop(true); if(shadow && !this.shadowDisabled){ if(doShow && !shadow.isVisible()){ shadow.show(this); }else{ shadow.realign(l, t, w, h); } if(shim){ if(doShow){ shim.show(); } var shadowAdj = shadow.el.getXY(), shimStyle = shim.dom.style, shadowSize = shadow.el.getSize(); shimStyle.left = (shadowAdj[0])+'px'; shimStyle.top = (shadowAdj[1])+'px'; shimStyle.width = (shadowSize.width)+'px'; shimStyle.height = (shadowSize.height)+'px'; } }else if(shim){ if(doShow){ shim.show(); } shim.setSize(w, h); shim.setLeftTop(l, t); } } }, destroy : function(){ this.hideShim(); if(this.shadow){ this.shadow.hide(); } this.removeAllListeners(); Ext.removeNode(this.dom); delete this.dom; }, remove : function(){ this.destroy(); }, beginUpdate : function(){ this.updating = true; }, endUpdate : function(){ this.updating = false; this.sync(true); }, hideUnders : function(negOffset){ if(this.shadow){ this.shadow.hide(); } this.hideShim(); }, constrainXY : function(){ if(this.constrain){ var vw = Ext.lib.Dom.getViewWidth(), vh = Ext.lib.Dom.getViewHeight(); var s = Ext.getDoc().getScroll(); var xy = this.getXY(); var x = xy[0], y = xy[1]; var so = this.shadowOffset; var w = this.dom.offsetWidth+so, h = this.dom.offsetHeight+so; var moved = false; if((x + w) > vw+s.left){ x = vw - w - so; moved = true; } if((y + h) > vh+s.top){ y = vh - h - so; moved = true; } if(x < s.left){ x = s.left; moved = true; } if(y < s.top){ y = s.top; moved = true; } if(moved){ if(this.avoidY){ var ay = this.avoidY; if(y <= ay && (y+h) >= ay){ y = ay-h-5; } } xy = [x, y]; this.storeXY(xy); supr.setXY.call(this, xy); this.sync(); } } return this; }, getConstrainOffset : function(){ return this.shadowOffset; }, isVisible : function(){ return this.visible; }, showAction : function(){ this.visible = true; if(this.useDisplay === true){ this.setDisplayed(''); }else if(this.lastXY){ supr.setXY.call(this, this.lastXY); }else if(this.lastLT){ supr.setLeftTop.call(this, this.lastLT[0], this.lastLT[1]); } }, hideAction : function(){ this.visible = false; if(this.useDisplay === true){ this.setDisplayed(false); }else{ this.setLeftTop(-10000,-10000); } }, setVisible : function(v, a, d, c, e){ if(v){ this.showAction(); } if(a && v){ var cb = function(){ this.sync(true); if(c){ c(); } }.createDelegate(this); supr.setVisible.call(this, true, true, d, cb, e); }else{ if(!v){ this.hideUnders(true); } var cb = c; if(a){ cb = function(){ this.hideAction(); if(c){ c(); } }.createDelegate(this); } supr.setVisible.call(this, v, a, d, cb, e); if(v){ this.sync(true); }else if(!a){ this.hideAction(); } } return this; }, storeXY : function(xy){ delete this.lastLT; this.lastXY = xy; }, storeLeftTop : function(left, top){ delete this.lastXY; this.lastLT = [left, top]; }, beforeFx : function(){ this.beforeAction(); return Ext.Layer.superclass.beforeFx.apply(this, arguments); }, afterFx : function(){ Ext.Layer.superclass.afterFx.apply(this, arguments); this.sync(this.isVisible()); }, beforeAction : function(){ if(!this.updating && this.shadow){ this.shadow.hide(); } }, setLeft : function(left){ this.storeLeftTop(left, this.getTop(true)); supr.setLeft.apply(this, arguments); this.sync(); return this; }, setTop : function(top){ this.storeLeftTop(this.getLeft(true), top); supr.setTop.apply(this, arguments); this.sync(); return this; }, setLeftTop : function(left, top){ this.storeLeftTop(left, top); supr.setLeftTop.apply(this, arguments); this.sync(); return this; }, setXY : function(xy, a, d, c, e){ this.fixDisplay(); this.beforeAction(); this.storeXY(xy); var cb = this.createCB(c); supr.setXY.call(this, xy, a, d, cb, e); if(!a){ cb(); } return this; }, createCB : function(c){ var el = this; return function(){ el.constrainXY(); el.sync(true); if(c){ c(); } }; }, setX : function(x, a, d, c, e){ this.setXY([x, this.getY()], a, d, c, e); return this; }, setY : function(y, a, d, c, e){ this.setXY([this.getX(), y], a, d, c, e); return this; }, setSize : function(w, h, a, d, c, e){ this.beforeAction(); var cb = this.createCB(c); supr.setSize.call(this, w, h, a, d, cb, e); if(!a){ cb(); } return this; }, setWidth : function(w, a, d, c, e){ this.beforeAction(); var cb = this.createCB(c); supr.setWidth.call(this, w, a, d, cb, e); if(!a){ cb(); } return this; }, setHeight : function(h, a, d, c, e){ this.beforeAction(); var cb = this.createCB(c); supr.setHeight.call(this, h, a, d, cb, e); if(!a){ cb(); } return this; }, setBounds : function(x, y, w, h, a, d, c, e){ this.beforeAction(); var cb = this.createCB(c); if(!a){ this.storeXY([x, y]); supr.setXY.call(this, [x, y]); supr.setSize.call(this, w, h, a, d, cb, e); cb(); }else{ supr.setBounds.call(this, x, y, w, h, a, d, cb, e); } return this; }, setZIndex : function(zindex){ this.zindex = zindex; this.setStyle('z-index', zindex + 2); if(this.shadow){ this.shadow.setZIndex(zindex + 1); } if(this.shim){ this.shim.setStyle('z-index', zindex); } return this; } }); })(); Ext.Shadow = function(config) { Ext.apply(this, config); if (typeof this.mode != "string") { this.mode = this.defaultMode; } var o = this.offset, a = { h: 0 }, rad = Math.floor(this.offset / 2); switch (this.mode.toLowerCase()) { case "drop": a.w = 0; a.l = a.t = o; a.t -= 1; if (Ext.isIE) { a.l -= this.offset + rad; a.t -= this.offset + rad; a.w -= rad; a.h -= rad; a.t += 1; } break; case "sides": a.w = (o * 2); a.l = -o; a.t = o - 1; if (Ext.isIE) { a.l -= (this.offset - rad); a.t -= this.offset + rad; a.l += 1; a.w -= (this.offset - rad) * 2; a.w -= rad + 1; a.h -= 1; } break; case "frame": a.w = a.h = (o * 2); a.l = a.t = -o; a.t += 1; a.h -= 2; if (Ext.isIE) { a.l -= (this.offset - rad); a.t -= (this.offset - rad); a.l += 1; a.w -= (this.offset + rad + 1); a.h -= (this.offset + rad); a.h += 1; } break; }; this.adjusts = a; }; Ext.Shadow.prototype = { offset: 4, defaultMode: "drop", show: function(target) { target = Ext.get(target); if (!this.el) { this.el = Ext.Shadow.Pool.pull(); if (this.el.dom.nextSibling != target.dom) { this.el.insertBefore(target); } } this.el.setStyle("z-index", this.zIndex || parseInt(target.getStyle("z-index"), 10) - 1); if (Ext.isIE) { this.el.dom.style.filter = "progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius=" + (this.offset) + ")"; } this.realign( target.getLeft(true), target.getTop(true), target.getWidth(), target.getHeight() ); this.el.dom.style.display = "block"; }, isVisible: function() { return this.el ? true: false; }, realign: function(l, t, w, h) { if (!this.el) { return; } var a = this.adjusts, d = this.el.dom, s = d.style, iea = 0, sw = (w + a.w), sh = (h + a.h), sws = sw + "px", shs = sh + "px", cn, sww; s.left = (l + a.l) + "px"; s.top = (t + a.t) + "px"; if (s.width != sws || s.height != shs) { s.width = sws; s.height = shs; if (!Ext.isIE) { cn = d.childNodes; sww = Math.max(0, (sw - 12)) + "px"; cn[0].childNodes[1].style.width = sww; cn[1].childNodes[1].style.width = sww; cn[2].childNodes[1].style.width = sww; cn[1].style.height = Math.max(0, (sh - 12)) + "px"; } } }, hide: function() { if (this.el) { this.el.dom.style.display = "none"; Ext.Shadow.Pool.push(this.el); delete this.el; } }, setZIndex: function(z) { this.zIndex = z; if (this.el) { this.el.setStyle("z-index", z); } } }; Ext.Shadow.Pool = function() { var p = [], markup = Ext.isIE ? '
    ': '
    '; return { pull: function() { var sh = p.shift(); if (!sh) { sh = Ext.get(Ext.DomHelper.insertHtml("beforeBegin", document.body.firstChild, markup)); sh.autoBoxAdjust = false; } return sh; }, push: function(sh) { p.push(sh); } }; }(); Ext.BoxComponent = Ext.extend(Ext.Component, { initComponent : function(){ Ext.BoxComponent.superclass.initComponent.call(this); this.addEvents( 'resize', 'move' ); }, boxReady : false, deferHeight: false, setSize : function(w, h){ if(typeof w == 'object'){ h = w.height; w = w.width; } if (Ext.isDefined(w) && Ext.isDefined(this.boxMinWidth) && (w < this.boxMinWidth)) { w = this.boxMinWidth; } if (Ext.isDefined(h) && Ext.isDefined(this.boxMinHeight) && (h < this.boxMinHeight)) { h = this.boxMinHeight; } if (Ext.isDefined(w) && Ext.isDefined(this.boxMaxWidth) && (w > this.boxMaxWidth)) { w = this.boxMaxWidth; } if (Ext.isDefined(h) && Ext.isDefined(this.boxMaxHeight) && (h > this.boxMaxHeight)) { h = this.boxMaxHeight; } if(!this.boxReady){ this.width = w; this.height = h; return this; } if(this.cacheSizes !== false && this.lastSize && this.lastSize.width == w && this.lastSize.height == h){ return this; } this.lastSize = {width: w, height: h}; var adj = this.adjustSize(w, h), aw = adj.width, ah = adj.height, rz; if(aw !== undefined || ah !== undefined){ rz = this.getResizeEl(); if(!this.deferHeight && aw !== undefined && ah !== undefined){ rz.setSize(aw, ah); }else if(!this.deferHeight && ah !== undefined){ rz.setHeight(ah); }else if(aw !== undefined){ rz.setWidth(aw); } this.onResize(aw, ah, w, h); this.fireEvent('resize', this, aw, ah, w, h); } return this; }, setWidth : function(width){ return this.setSize(width); }, setHeight : function(height){ return this.setSize(undefined, height); }, getSize : function(){ return this.getResizeEl().getSize(); }, getWidth : function(){ return this.getResizeEl().getWidth(); }, getHeight : function(){ return this.getResizeEl().getHeight(); }, getOuterSize : function(){ var el = this.getResizeEl(); return {width: el.getWidth() + el.getMargins('lr'), height: el.getHeight() + el.getMargins('tb')}; }, getPosition : function(local){ var el = this.getPositionEl(); if(local === true){ return [el.getLeft(true), el.getTop(true)]; } return this.xy || el.getXY(); }, getBox : function(local){ var pos = this.getPosition(local); var s = this.getSize(); s.x = pos[0]; s.y = pos[1]; return s; }, updateBox : function(box){ this.setSize(box.width, box.height); this.setPagePosition(box.x, box.y); return this; }, getResizeEl : function(){ return this.resizeEl || this.el; }, setAutoScroll : function(scroll){ if(this.rendered){ this.getContentTarget().setOverflow(scroll ? 'auto' : ''); } this.autoScroll = scroll; return this; }, setPosition : function(x, y){ if(x && typeof x[1] == 'number'){ y = x[1]; x = x[0]; } this.x = x; this.y = y; if(!this.boxReady){ return this; } var adj = this.adjustPosition(x, y); var ax = adj.x, ay = adj.y; var el = this.getPositionEl(); if(ax !== undefined || ay !== undefined){ if(ax !== undefined && ay !== undefined){ el.setLeftTop(ax, ay); }else if(ax !== undefined){ el.setLeft(ax); }else if(ay !== undefined){ el.setTop(ay); } this.onPosition(ax, ay); this.fireEvent('move', this, ax, ay); } return this; }, setPagePosition : function(x, y){ if(x && typeof x[1] == 'number'){ y = x[1]; x = x[0]; } this.pageX = x; this.pageY = y; if(!this.boxReady){ return; } if(x === undefined || y === undefined){ return; } var p = this.getPositionEl().translatePoints(x, y); this.setPosition(p.left, p.top); return this; }, afterRender : function(){ Ext.BoxComponent.superclass.afterRender.call(this); if(this.resizeEl){ this.resizeEl = Ext.get(this.resizeEl); } if(this.positionEl){ this.positionEl = Ext.get(this.positionEl); } this.boxReady = true; Ext.isDefined(this.autoScroll) && this.setAutoScroll(this.autoScroll); this.setSize(this.width, this.height); if(this.x || this.y){ this.setPosition(this.x, this.y); }else if(this.pageX || this.pageY){ this.setPagePosition(this.pageX, this.pageY); } }, syncSize : function(){ delete this.lastSize; this.setSize(this.autoWidth ? undefined : this.getResizeEl().getWidth(), this.autoHeight ? undefined : this.getResizeEl().getHeight()); return this; }, onResize : function(adjWidth, adjHeight, rawWidth, rawHeight){ }, onPosition : function(x, y){ }, adjustSize : function(w, h){ if(this.autoWidth){ w = 'auto'; } if(this.autoHeight){ h = 'auto'; } return {width : w, height: h}; }, adjustPosition : function(x, y){ return {x : x, y: y}; } }); Ext.reg('box', Ext.BoxComponent); Ext.Spacer = Ext.extend(Ext.BoxComponent, { autoEl:'div' }); Ext.reg('spacer', Ext.Spacer); Ext.SplitBar = function(dragElement, resizingElement, orientation, placement, existingProxy){ this.el = Ext.get(dragElement, true); this.el.dom.unselectable = "on"; this.resizingEl = Ext.get(resizingElement, true); this.orientation = orientation || Ext.SplitBar.HORIZONTAL; this.minSize = 0; this.maxSize = 2000; this.animate = false; this.useShim = false; this.shim = null; if(!existingProxy){ this.proxy = Ext.SplitBar.createProxy(this.orientation); }else{ this.proxy = Ext.get(existingProxy).dom; } this.dd = new Ext.dd.DDProxy(this.el.dom.id, "XSplitBars", {dragElId : this.proxy.id}); this.dd.b4StartDrag = this.onStartProxyDrag.createDelegate(this); this.dd.endDrag = this.onEndProxyDrag.createDelegate(this); this.dragSpecs = {}; this.adapter = new Ext.SplitBar.BasicLayoutAdapter(); this.adapter.init(this); if(this.orientation == Ext.SplitBar.HORIZONTAL){ this.placement = placement || (this.el.getX() > this.resizingEl.getX() ? Ext.SplitBar.LEFT : Ext.SplitBar.RIGHT); this.el.addClass("x-splitbar-h"); }else{ this.placement = placement || (this.el.getY() > this.resizingEl.getY() ? Ext.SplitBar.TOP : Ext.SplitBar.BOTTOM); this.el.addClass("x-splitbar-v"); } this.addEvents( "resize", "moved", "beforeresize", "beforeapply" ); Ext.SplitBar.superclass.constructor.call(this); }; Ext.extend(Ext.SplitBar, Ext.util.Observable, { onStartProxyDrag : function(x, y){ this.fireEvent("beforeresize", this); this.overlay = Ext.DomHelper.append(document.body, {cls: "x-drag-overlay", html: " "}, true); this.overlay.unselectable(); this.overlay.setSize(Ext.lib.Dom.getViewWidth(true), Ext.lib.Dom.getViewHeight(true)); this.overlay.show(); Ext.get(this.proxy).setDisplayed("block"); var size = this.adapter.getElementSize(this); this.activeMinSize = this.getMinimumSize(); this.activeMaxSize = this.getMaximumSize(); var c1 = size - this.activeMinSize; var c2 = Math.max(this.activeMaxSize - size, 0); if(this.orientation == Ext.SplitBar.HORIZONTAL){ this.dd.resetConstraints(); this.dd.setXConstraint( this.placement == Ext.SplitBar.LEFT ? c1 : c2, this.placement == Ext.SplitBar.LEFT ? c2 : c1, this.tickSize ); this.dd.setYConstraint(0, 0); }else{ this.dd.resetConstraints(); this.dd.setXConstraint(0, 0); this.dd.setYConstraint( this.placement == Ext.SplitBar.TOP ? c1 : c2, this.placement == Ext.SplitBar.TOP ? c2 : c1, this.tickSize ); } this.dragSpecs.startSize = size; this.dragSpecs.startPoint = [x, y]; Ext.dd.DDProxy.prototype.b4StartDrag.call(this.dd, x, y); }, onEndProxyDrag : function(e){ Ext.get(this.proxy).setDisplayed(false); var endPoint = Ext.lib.Event.getXY(e); if(this.overlay){ Ext.destroy(this.overlay); delete this.overlay; } var newSize; if(this.orientation == Ext.SplitBar.HORIZONTAL){ newSize = this.dragSpecs.startSize + (this.placement == Ext.SplitBar.LEFT ? endPoint[0] - this.dragSpecs.startPoint[0] : this.dragSpecs.startPoint[0] - endPoint[0] ); }else{ newSize = this.dragSpecs.startSize + (this.placement == Ext.SplitBar.TOP ? endPoint[1] - this.dragSpecs.startPoint[1] : this.dragSpecs.startPoint[1] - endPoint[1] ); } newSize = Math.min(Math.max(newSize, this.activeMinSize), this.activeMaxSize); if(newSize != this.dragSpecs.startSize){ if(this.fireEvent('beforeapply', this, newSize) !== false){ this.adapter.setElementSize(this, newSize); this.fireEvent("moved", this, newSize); this.fireEvent("resize", this, newSize); } } }, getAdapter : function(){ return this.adapter; }, setAdapter : function(adapter){ this.adapter = adapter; this.adapter.init(this); }, getMinimumSize : function(){ return this.minSize; }, setMinimumSize : function(minSize){ this.minSize = minSize; }, getMaximumSize : function(){ return this.maxSize; }, setMaximumSize : function(maxSize){ this.maxSize = maxSize; }, setCurrentSize : function(size){ var oldAnimate = this.animate; this.animate = false; this.adapter.setElementSize(this, size); this.animate = oldAnimate; }, destroy : function(removeEl){ Ext.destroy(this.shim, Ext.get(this.proxy)); this.dd.unreg(); if(removeEl){ this.el.remove(); } this.purgeListeners(); } }); Ext.SplitBar.createProxy = function(dir){ var proxy = new Ext.Element(document.createElement("div")); document.body.appendChild(proxy.dom); proxy.unselectable(); var cls = 'x-splitbar-proxy'; proxy.addClass(cls + ' ' + (dir == Ext.SplitBar.HORIZONTAL ? cls +'-h' : cls + '-v')); return proxy.dom; }; Ext.SplitBar.BasicLayoutAdapter = function(){ }; Ext.SplitBar.BasicLayoutAdapter.prototype = { init : function(s){ }, getElementSize : function(s){ if(s.orientation == Ext.SplitBar.HORIZONTAL){ return s.resizingEl.getWidth(); }else{ return s.resizingEl.getHeight(); } }, setElementSize : function(s, newSize, onComplete){ if(s.orientation == Ext.SplitBar.HORIZONTAL){ if(!s.animate){ s.resizingEl.setWidth(newSize); if(onComplete){ onComplete(s, newSize); } }else{ s.resizingEl.setWidth(newSize, true, .1, onComplete, 'easeOut'); } }else{ if(!s.animate){ s.resizingEl.setHeight(newSize); if(onComplete){ onComplete(s, newSize); } }else{ s.resizingEl.setHeight(newSize, true, .1, onComplete, 'easeOut'); } } } }; Ext.SplitBar.AbsoluteLayoutAdapter = function(container){ this.basic = new Ext.SplitBar.BasicLayoutAdapter(); this.container = Ext.get(container); }; Ext.SplitBar.AbsoluteLayoutAdapter.prototype = { init : function(s){ this.basic.init(s); }, getElementSize : function(s){ return this.basic.getElementSize(s); }, setElementSize : function(s, newSize, onComplete){ this.basic.setElementSize(s, newSize, this.moveSplitter.createDelegate(this, [s])); }, moveSplitter : function(s){ var yes = Ext.SplitBar; switch(s.placement){ case yes.LEFT: s.el.setX(s.resizingEl.getRight()); break; case yes.RIGHT: s.el.setStyle("right", (this.container.getWidth() - s.resizingEl.getLeft()) + "px"); break; case yes.TOP: s.el.setY(s.resizingEl.getBottom()); break; case yes.BOTTOM: s.el.setY(s.resizingEl.getTop() - s.el.getHeight()); break; } } }; Ext.SplitBar.VERTICAL = 1; Ext.SplitBar.HORIZONTAL = 2; Ext.SplitBar.LEFT = 1; Ext.SplitBar.RIGHT = 2; Ext.SplitBar.TOP = 3; Ext.SplitBar.BOTTOM = 4; Ext.Container = Ext.extend(Ext.BoxComponent, { bufferResize: 50, autoDestroy : true, forceLayout: false, defaultType : 'panel', resizeEvent: 'resize', bubbleEvents: ['add', 'remove'], initComponent : function(){ Ext.Container.superclass.initComponent.call(this); this.addEvents( 'afterlayout', 'beforeadd', 'beforeremove', 'add', 'remove' ); var items = this.items; if(items){ delete this.items; this.add(items); } }, initItems : function(){ if(!this.items){ this.items = new Ext.util.MixedCollection(false, this.getComponentId); this.getLayout(); } }, setLayout : function(layout){ if(this.layout && this.layout != layout){ this.layout.setContainer(null); } this.layout = layout; this.initItems(); layout.setContainer(this); }, afterRender: function(){ Ext.Container.superclass.afterRender.call(this); if(!this.layout){ this.layout = 'auto'; } if(Ext.isObject(this.layout) && !this.layout.layout){ this.layoutConfig = this.layout; this.layout = this.layoutConfig.type; } if(Ext.isString(this.layout)){ this.layout = new Ext.Container.LAYOUTS[this.layout.toLowerCase()](this.layoutConfig); } this.setLayout(this.layout); if(this.activeItem !== undefined && this.layout.setActiveItem){ var item = this.activeItem; delete this.activeItem; this.layout.setActiveItem(item); } if(!this.ownerCt){ this.doLayout(false, true); } if(this.monitorResize === true){ Ext.EventManager.onWindowResize(this.doLayout, this, [false]); } }, getLayoutTarget : function(){ return this.el; }, getComponentId : function(comp){ return comp.getItemId(); }, add : function(comp){ this.initItems(); var args = arguments.length > 1; if(args || Ext.isArray(comp)){ var result = []; Ext.each(args ? arguments : comp, function(c){ result.push(this.add(c)); }, this); return result; } var c = this.lookupComponent(this.applyDefaults(comp)); var index = this.items.length; if(this.fireEvent('beforeadd', this, c, index) !== false && this.onBeforeAdd(c) !== false){ this.items.add(c); c.onAdded(this, index); this.onAdd(c); this.fireEvent('add', this, c, index); } return c; }, onAdd : function(c){ }, onAdded : function(container, pos) { this.ownerCt = container; this.initRef(); this.cascade(function(c){ c.initRef(); }); this.fireEvent('added', this, container, pos); }, insert : function(index, comp) { var args = arguments, length = args.length, result = [], i, c; this.initItems(); if (length > 2) { for (i = length - 1; i >= 1; --i) { result.push(this.insert(index, args[i])); } return result; } c = this.lookupComponent(this.applyDefaults(comp)); index = Math.min(index, this.items.length); if (this.fireEvent('beforeadd', this, c, index) !== false && this.onBeforeAdd(c) !== false) { if (c.ownerCt == this) { this.items.remove(c); } this.items.insert(index, c); c.onAdded(this, index); this.onAdd(c); this.fireEvent('add', this, c, index); } return c; }, applyDefaults : function(c){ var d = this.defaults; if(d){ if(Ext.isFunction(d)){ d = d.call(this, c); } if(Ext.isString(c)){ c = Ext.ComponentMgr.get(c); Ext.apply(c, d); }else if(!c.events){ Ext.applyIf(c.isAction ? c.initialConfig : c, d); }else{ Ext.apply(c, d); } } return c; }, onBeforeAdd : function(item){ if(item.ownerCt){ item.ownerCt.remove(item, false); } if(this.hideBorders === true){ item.border = (item.border === true); } }, remove : function(comp, autoDestroy){ this.initItems(); var c = this.getComponent(comp); if(c && this.fireEvent('beforeremove', this, c) !== false){ this.doRemove(c, autoDestroy); this.fireEvent('remove', this, c); } return c; }, onRemove: function(c){ }, doRemove: function(c, autoDestroy){ var l = this.layout, hasLayout = l && this.rendered; if(hasLayout){ l.onRemove(c); } this.items.remove(c); c.onRemoved(); this.onRemove(c); if(autoDestroy === true || (autoDestroy !== false && this.autoDestroy)){ c.destroy(); } if(hasLayout){ l.afterRemove(c); } }, removeAll: function(autoDestroy){ this.initItems(); var item, rem = [], items = []; this.items.each(function(i){ rem.push(i); }); for (var i = 0, len = rem.length; i < len; ++i){ item = rem[i]; this.remove(item, autoDestroy); if(item.ownerCt !== this){ items.push(item); } } return items; }, getComponent : function(comp){ if(Ext.isObject(comp)){ comp = comp.getItemId(); } return this.items.get(comp); }, lookupComponent : function(comp){ if(Ext.isString(comp)){ return Ext.ComponentMgr.get(comp); }else if(!comp.events){ return this.createComponent(comp); } return comp; }, createComponent : function(config, defaultType){ if (config.render) { return config; } var c = Ext.create(Ext.apply({ ownerCt: this }, config), defaultType || this.defaultType); delete c.initialConfig.ownerCt; delete c.ownerCt; return c; }, canLayout : function() { var el = this.getVisibilityEl(); return el && el.dom && !el.isStyle("display", "none"); }, doLayout : function(shallow, force){ var rendered = this.rendered, forceLayout = force || this.forceLayout; if(this.collapsed || !this.canLayout()){ this.deferLayout = this.deferLayout || !shallow; if(!forceLayout){ return; } shallow = shallow && !this.deferLayout; } else { delete this.deferLayout; } if(rendered && this.layout){ this.layout.layout(); } if(shallow !== true && this.items){ var cs = this.items.items; for(var i = 0, len = cs.length; i < len; i++){ var c = cs[i]; if(c.doLayout){ c.doLayout(false, forceLayout); } } } if(rendered){ this.onLayout(shallow, forceLayout); } this.hasLayout = true; delete this.forceLayout; }, onLayout : Ext.emptyFn, shouldBufferLayout: function(){ var hl = this.hasLayout; if(this.ownerCt){ return hl ? !this.hasLayoutPending() : false; } return hl; }, hasLayoutPending: function(){ var pending = false; this.ownerCt.bubble(function(c){ if(c.layoutPending){ pending = true; return false; } }); return pending; }, onShow : function(){ Ext.Container.superclass.onShow.call(this); if(Ext.isDefined(this.deferLayout)){ delete this.deferLayout; this.doLayout(true); } }, getLayout : function(){ if(!this.layout){ var layout = new Ext.layout.AutoLayout(this.layoutConfig); this.setLayout(layout); } return this.layout; }, beforeDestroy : function(){ var c; if(this.items){ while(c = this.items.first()){ this.doRemove(c, true); } } if(this.monitorResize){ Ext.EventManager.removeResizeListener(this.doLayout, this); } Ext.destroy(this.layout); Ext.Container.superclass.beforeDestroy.call(this); }, cascade : function(fn, scope, args){ if(fn.apply(scope || this, args || [this]) !== false){ if(this.items){ var cs = this.items.items; for(var i = 0, len = cs.length; i < len; i++){ if(cs[i].cascade){ cs[i].cascade(fn, scope, args); }else{ fn.apply(scope || cs[i], args || [cs[i]]); } } } } return this; }, findById : function(id){ var m = null, ct = this; this.cascade(function(c){ if(ct != c && c.id === id){ m = c; return false; } }); return m; }, findByType : function(xtype, shallow){ return this.findBy(function(c){ return c.isXType(xtype, shallow); }); }, find : function(prop, value){ return this.findBy(function(c){ return c[prop] === value; }); }, findBy : function(fn, scope){ var m = [], ct = this; this.cascade(function(c){ if(ct != c && fn.call(scope || c, c, ct) === true){ m.push(c); } }); return m; }, get : function(key){ return this.getComponent(key); } }); Ext.Container.LAYOUTS = {}; Ext.reg('container', Ext.Container); Ext.layout.ContainerLayout = Ext.extend(Object, { monitorResize:false, activeItem : null, constructor : function(config){ this.id = Ext.id(null, 'ext-layout-'); Ext.apply(this, config); }, type: 'container', IEMeasureHack : function(target, viewFlag) { var tChildren = target.dom.childNodes, tLen = tChildren.length, c, d = [], e, i, ret; for (i = 0 ; i < tLen ; i++) { c = tChildren[i]; e = Ext.get(c); if (e) { d[i] = e.getStyle('display'); e.setStyle({display: 'none'}); } } ret = target ? target.getViewSize(viewFlag) : {}; for (i = 0 ; i < tLen ; i++) { c = tChildren[i]; e = Ext.get(c); if (e) { e.setStyle({display: d[i]}); } } return ret; }, getLayoutTargetSize : Ext.EmptyFn, layout : function(){ var ct = this.container, target = ct.getLayoutTarget(); if(!(this.hasLayout || Ext.isEmpty(this.targetCls))){ target.addClass(this.targetCls); } this.onLayout(ct, target); ct.fireEvent('afterlayout', ct, this); }, onLayout : function(ct, target){ this.renderAll(ct, target); }, isValidParent : function(c, target){ return target && c.getPositionEl().dom.parentNode == (target.dom || target); }, renderAll : function(ct, target){ var items = ct.items.items, i, c, len = items.length; for(i = 0; i < len; i++) { c = items[i]; if(c && (!c.rendered || !this.isValidParent(c, target))){ this.renderItem(c, i, target); } } }, renderItem : function(c, position, target){ if (c) { if (!c.rendered) { c.render(target, position); this.configureItem(c); } else if (!this.isValidParent(c, target)) { if (Ext.isNumber(position)) { position = target.dom.childNodes[position]; } target.dom.insertBefore(c.getPositionEl().dom, position || null); c.container = target; this.configureItem(c); } } }, getRenderedItems: function(ct){ var t = ct.getLayoutTarget(), cti = ct.items.items, len = cti.length, i, c, items = []; for (i = 0; i < len; i++) { if((c = cti[i]).rendered && this.isValidParent(c, t) && c.shouldLayout !== false){ items.push(c); } }; return items; }, configureItem: function(c){ if (this.extraCls) { var t = c.getPositionEl ? c.getPositionEl() : c; t.addClass(this.extraCls); } if (c.doLayout && this.forceLayout) { c.doLayout(); } if (this.renderHidden && c != this.activeItem) { c.hide(); } }, onRemove: function(c){ if(this.activeItem == c){ delete this.activeItem; } if(c.rendered && this.extraCls){ var t = c.getPositionEl ? c.getPositionEl() : c; t.removeClass(this.extraCls); } }, afterRemove: function(c){ if(c.removeRestore){ c.removeMode = 'container'; delete c.removeRestore; } }, onResize: function(){ var ct = this.container, b; if(ct.collapsed){ return; } if(b = ct.bufferResize && ct.shouldBufferLayout()){ if(!this.resizeTask){ this.resizeTask = new Ext.util.DelayedTask(this.runLayout, this); this.resizeBuffer = Ext.isNumber(b) ? b : 50; } ct.layoutPending = true; this.resizeTask.delay(this.resizeBuffer); }else{ this.runLayout(); } }, runLayout: function(){ var ct = this.container; this.layout(); ct.onLayout(); delete ct.layoutPending; }, setContainer : function(ct){ if(this.monitorResize && ct != this.container){ var old = this.container; if(old){ old.un(old.resizeEvent, this.onResize, this); } if(ct){ ct.on(ct.resizeEvent, this.onResize, this); } } this.container = ct; }, parseMargins : function(v){ if (Ext.isNumber(v)) { v = v.toString(); } var ms = v.split(' '), len = ms.length; if (len == 1) { ms[1] = ms[2] = ms[3] = ms[0]; } else if(len == 2) { ms[2] = ms[0]; ms[3] = ms[1]; } else if(len == 3) { ms[3] = ms[1]; } return { top :parseInt(ms[0], 10) || 0, right :parseInt(ms[1], 10) || 0, bottom:parseInt(ms[2], 10) || 0, left :parseInt(ms[3], 10) || 0 }; }, fieldTpl: (function() { var t = new Ext.Template( '
    ', '', '
    ', '
    ', '
    ' ); t.disableFormats = true; return t.compile(); })(), destroy : function(){ if(this.resizeTask && this.resizeTask.cancel){ this.resizeTask.cancel(); } if(this.container) { this.container.un(this.container.resizeEvent, this.onResize, this); } if(!Ext.isEmpty(this.targetCls)){ var target = this.container.getLayoutTarget(); if(target){ target.removeClass(this.targetCls); } } } }); Ext.layout.AutoLayout = Ext.extend(Ext.layout.ContainerLayout, { type: 'auto', monitorResize: true, onLayout : function(ct, target){ Ext.layout.AutoLayout.superclass.onLayout.call(this, ct, target); var cs = this.getRenderedItems(ct), len = cs.length, i, c; for(i = 0; i < len; i++){ c = cs[i]; if (c.doLayout){ c.doLayout(true); } } } }); Ext.Container.LAYOUTS['auto'] = Ext.layout.AutoLayout; Ext.layout.FitLayout = Ext.extend(Ext.layout.ContainerLayout, { monitorResize:true, type: 'fit', getLayoutTargetSize : function() { var target = this.container.getLayoutTarget(); if (!target) { return {}; } return target.getStyleSize(); }, onLayout : function(ct, target){ Ext.layout.FitLayout.superclass.onLayout.call(this, ct, target); if(!ct.collapsed){ this.setItemSize(this.activeItem || ct.items.itemAt(0), this.getLayoutTargetSize()); } }, setItemSize : function(item, size){ if(item && size.height > 0){ item.setSize(size); } } }); Ext.Container.LAYOUTS['fit'] = Ext.layout.FitLayout; Ext.layout.CardLayout = Ext.extend(Ext.layout.FitLayout, { deferredRender : false, layoutOnCardChange : false, renderHidden : true, type: 'card', setActiveItem : function(item){ var ai = this.activeItem, ct = this.container; item = ct.getComponent(item); if(item && ai != item){ if(ai){ ai.hide(); if (ai.hidden !== true) { return false; } ai.fireEvent('deactivate', ai); } var layout = item.doLayout && (this.layoutOnCardChange || !item.rendered); this.activeItem = item; delete item.deferLayout; item.show(); this.layout(); if(layout){ item.doLayout(); } item.fireEvent('activate', item); } }, renderAll : function(ct, target){ if(this.deferredRender){ this.renderItem(this.activeItem, undefined, target); }else{ Ext.layout.CardLayout.superclass.renderAll.call(this, ct, target); } } }); Ext.Container.LAYOUTS['card'] = Ext.layout.CardLayout; Ext.layout.AnchorLayout = Ext.extend(Ext.layout.ContainerLayout, { monitorResize : true, type : 'anchor', defaultAnchor : '100%', parseAnchorRE : /^(r|right|b|bottom)$/i, getLayoutTargetSize : function() { var target = this.container.getLayoutTarget(), ret = {}; if (target) { ret = target.getViewSize(); if (Ext.isIE && Ext.isStrict && ret.width == 0){ ret = target.getStyleSize(); } ret.width -= target.getPadding('lr'); ret.height -= target.getPadding('tb'); } return ret; }, onLayout : function(container, target) { Ext.layout.AnchorLayout.superclass.onLayout.call(this, container, target); var size = this.getLayoutTargetSize(), containerWidth = size.width, containerHeight = size.height, overflow = target.getStyle('overflow'), components = this.getRenderedItems(container), len = components.length, boxes = [], box, anchorWidth, anchorHeight, component, anchorSpec, calcWidth, calcHeight, anchorsArray, totalHeight = 0, i, el; if(containerWidth < 20 && containerHeight < 20){ return; } if(container.anchorSize) { if(typeof container.anchorSize == 'number') { anchorWidth = container.anchorSize; } else { anchorWidth = container.anchorSize.width; anchorHeight = container.anchorSize.height; } } else { anchorWidth = container.initialConfig.width; anchorHeight = container.initialConfig.height; } for(i = 0; i < len; i++) { component = components[i]; el = component.getPositionEl(); if (!component.anchor && component.items && !Ext.isNumber(component.width) && !(Ext.isIE6 && Ext.isStrict)){ component.anchor = this.defaultAnchor; } if(component.anchor) { anchorSpec = component.anchorSpec; if(!anchorSpec){ anchorsArray = component.anchor.split(' '); component.anchorSpec = anchorSpec = { right: this.parseAnchor(anchorsArray[0], component.initialConfig.width, anchorWidth), bottom: this.parseAnchor(anchorsArray[1], component.initialConfig.height, anchorHeight) }; } calcWidth = anchorSpec.right ? this.adjustWidthAnchor(anchorSpec.right(containerWidth) - el.getMargins('lr'), component) : undefined; calcHeight = anchorSpec.bottom ? this.adjustHeightAnchor(anchorSpec.bottom(containerHeight) - el.getMargins('tb'), component) : undefined; if(calcWidth || calcHeight) { boxes.push({ component: component, width: calcWidth || undefined, height: calcHeight || undefined }); } } } for (i = 0, len = boxes.length; i < len; i++) { box = boxes[i]; box.component.setSize(box.width, box.height); } if (overflow && overflow != 'hidden' && !this.adjustmentPass) { var newTargetSize = this.getLayoutTargetSize(); if (newTargetSize.width != size.width || newTargetSize.height != size.height){ this.adjustmentPass = true; this.onLayout(container, target); } } delete this.adjustmentPass; }, parseAnchor : function(a, start, cstart) { if (a && a != 'none') { var last; if (this.parseAnchorRE.test(a)) { var diff = cstart - start; return function(v){ if(v !== last){ last = v; return v - diff; } }; } else if(a.indexOf('%') != -1) { var ratio = parseFloat(a.replace('%', ''))*.01; return function(v){ if(v !== last){ last = v; return Math.floor(v*ratio); } }; } else { a = parseInt(a, 10); if (!isNaN(a)) { return function(v) { if (v !== last) { last = v; return v + a; } }; } } } return false; }, adjustWidthAnchor : function(value, comp){ return value; }, adjustHeightAnchor : function(value, comp){ return value; } }); Ext.Container.LAYOUTS['anchor'] = Ext.layout.AnchorLayout; Ext.layout.ColumnLayout = Ext.extend(Ext.layout.ContainerLayout, { monitorResize:true, type: 'column', extraCls: 'x-column', scrollOffset : 0, targetCls: 'x-column-layout-ct', isValidParent : function(c, target){ return this.innerCt && c.getPositionEl().dom.parentNode == this.innerCt.dom; }, getLayoutTargetSize : function() { var target = this.container.getLayoutTarget(), ret; if (target) { ret = target.getViewSize(); if (Ext.isIE && Ext.isStrict && ret.width == 0){ ret = target.getStyleSize(); } ret.width -= target.getPadding('lr'); ret.height -= target.getPadding('tb'); } return ret; }, renderAll : function(ct, target) { if(!this.innerCt){ this.innerCt = target.createChild({cls:'x-column-inner'}); this.innerCt.createChild({cls:'x-clear'}); } Ext.layout.ColumnLayout.superclass.renderAll.call(this, ct, this.innerCt); }, onLayout : function(ct, target){ var cs = ct.items.items, len = cs.length, c, i, m, margins = []; this.renderAll(ct, target); var size = this.getLayoutTargetSize(); if(size.width < 1 && size.height < 1){ return; } var w = size.width - this.scrollOffset, h = size.height, pw = w; this.innerCt.setWidth(w); for(i = 0; i < len; i++){ c = cs[i]; m = c.getPositionEl().getMargins('lr'); margins[i] = m; if(!c.columnWidth){ pw -= (c.getWidth() + m); } } pw = pw < 0 ? 0 : pw; for(i = 0; i < len; i++){ c = cs[i]; m = margins[i]; if(c.columnWidth){ c.setSize(Math.floor(c.columnWidth * pw) - m); } } if (Ext.isIE) { if (i = target.getStyle('overflow') && i != 'hidden' && !this.adjustmentPass) { var ts = this.getLayoutTargetSize(); if (ts.width != size.width){ this.adjustmentPass = true; this.onLayout(ct, target); } } } delete this.adjustmentPass; } }); Ext.Container.LAYOUTS['column'] = Ext.layout.ColumnLayout; Ext.layout.BorderLayout = Ext.extend(Ext.layout.ContainerLayout, { monitorResize:true, rendered : false, type: 'border', targetCls: 'x-border-layout-ct', getLayoutTargetSize : function() { var target = this.container.getLayoutTarget(); return target ? target.getViewSize() : {}; }, onLayout : function(ct, target){ var collapsed, i, c, pos, items = ct.items.items, len = items.length; if(!this.rendered){ collapsed = []; for(i = 0; i < len; i++) { c = items[i]; pos = c.region; if(c.collapsed){ collapsed.push(c); } c.collapsed = false; if(!c.rendered){ c.render(target, i); c.getPositionEl().addClass('x-border-panel'); } this[pos] = pos != 'center' && c.split ? new Ext.layout.BorderLayout.SplitRegion(this, c.initialConfig, pos) : new Ext.layout.BorderLayout.Region(this, c.initialConfig, pos); this[pos].render(target, c); } this.rendered = true; } var size = this.getLayoutTargetSize(); if(size.width < 20 || size.height < 20){ if(collapsed){ this.restoreCollapsed = collapsed; } return; }else if(this.restoreCollapsed){ collapsed = this.restoreCollapsed; delete this.restoreCollapsed; } var w = size.width, h = size.height, centerW = w, centerH = h, centerY = 0, centerX = 0, n = this.north, s = this.south, west = this.west, e = this.east, c = this.center, b, m, totalWidth, totalHeight; if(!c && Ext.layout.BorderLayout.WARN !== false){ throw 'No center region defined in BorderLayout ' + ct.id; } if(n && n.isVisible()){ b = n.getSize(); m = n.getMargins(); b.width = w - (m.left+m.right); b.x = m.left; b.y = m.top; centerY = b.height + b.y + m.bottom; centerH -= centerY; n.applyLayout(b); } if(s && s.isVisible()){ b = s.getSize(); m = s.getMargins(); b.width = w - (m.left+m.right); b.x = m.left; totalHeight = (b.height + m.top + m.bottom); b.y = h - totalHeight + m.top; centerH -= totalHeight; s.applyLayout(b); } if(west && west.isVisible()){ b = west.getSize(); m = west.getMargins(); b.height = centerH - (m.top+m.bottom); b.x = m.left; b.y = centerY + m.top; totalWidth = (b.width + m.left + m.right); centerX += totalWidth; centerW -= totalWidth; west.applyLayout(b); } if(e && e.isVisible()){ b = e.getSize(); m = e.getMargins(); b.height = centerH - (m.top+m.bottom); totalWidth = (b.width + m.left + m.right); b.x = w - totalWidth + m.left; b.y = centerY + m.top; centerW -= totalWidth; e.applyLayout(b); } if(c){ m = c.getMargins(); var centerBox = { x: centerX + m.left, y: centerY + m.top, width: centerW - (m.left+m.right), height: centerH - (m.top+m.bottom) }; c.applyLayout(centerBox); } if(collapsed){ for(i = 0, len = collapsed.length; i < len; i++){ collapsed[i].collapse(false); } } if(Ext.isIE && Ext.isStrict){ target.repaint(); } if (i = target.getStyle('overflow') && i != 'hidden' && !this.adjustmentPass) { var ts = this.getLayoutTargetSize(); if (ts.width != size.width || ts.height != size.height){ this.adjustmentPass = true; this.onLayout(ct, target); } } delete this.adjustmentPass; }, destroy: function() { var r = ['north', 'south', 'east', 'west'], i, region; for (i = 0; i < r.length; i++) { region = this[r[i]]; if(region){ if(region.destroy){ region.destroy(); }else if (region.split){ region.split.destroy(true); } } } Ext.layout.BorderLayout.superclass.destroy.call(this); } }); Ext.layout.BorderLayout.Region = function(layout, config, pos){ Ext.apply(this, config); this.layout = layout; this.position = pos; this.state = {}; if(typeof this.margins == 'string'){ this.margins = this.layout.parseMargins(this.margins); } this.margins = Ext.applyIf(this.margins || {}, this.defaultMargins); if(this.collapsible){ if(typeof this.cmargins == 'string'){ this.cmargins = this.layout.parseMargins(this.cmargins); } if(this.collapseMode == 'mini' && !this.cmargins){ this.cmargins = {left:0,top:0,right:0,bottom:0}; }else{ this.cmargins = Ext.applyIf(this.cmargins || {}, pos == 'north' || pos == 'south' ? this.defaultNSCMargins : this.defaultEWCMargins); } } }; Ext.layout.BorderLayout.Region.prototype = { collapsible : false, split:false, floatable: true, minWidth:50, minHeight:50, defaultMargins : {left:0,top:0,right:0,bottom:0}, defaultNSCMargins : {left:5,top:5,right:5,bottom:5}, defaultEWCMargins : {left:5,top:0,right:5,bottom:0}, floatingZIndex: 100, isCollapsed : false, render : function(ct, p){ this.panel = p; p.el.enableDisplayMode(); this.targetEl = ct; this.el = p.el; var gs = p.getState, ps = this.position; p.getState = function(){ return Ext.apply(gs.call(p) || {}, this.state); }.createDelegate(this); if(ps != 'center'){ p.allowQueuedExpand = false; p.on({ beforecollapse: this.beforeCollapse, collapse: this.onCollapse, beforeexpand: this.beforeExpand, expand: this.onExpand, hide: this.onHide, show: this.onShow, scope: this }); if(this.collapsible || this.floatable){ p.collapseEl = 'el'; p.slideAnchor = this.getSlideAnchor(); } if(p.tools && p.tools.toggle){ p.tools.toggle.addClass('x-tool-collapse-'+ps); p.tools.toggle.addClassOnOver('x-tool-collapse-'+ps+'-over'); } } }, getCollapsedEl : function(){ if(!this.collapsedEl){ if(!this.toolTemplate){ var tt = new Ext.Template( '
     
    ' ); tt.disableFormats = true; tt.compile(); Ext.layout.BorderLayout.Region.prototype.toolTemplate = tt; } this.collapsedEl = this.targetEl.createChild({ cls: "x-layout-collapsed x-layout-collapsed-"+this.position, id: this.panel.id + '-xcollapsed' }); this.collapsedEl.enableDisplayMode('block'); if(this.collapseMode == 'mini'){ this.collapsedEl.addClass('x-layout-cmini-'+this.position); this.miniCollapsedEl = this.collapsedEl.createChild({ cls: "x-layout-mini x-layout-mini-"+this.position, html: " " }); this.miniCollapsedEl.addClassOnOver('x-layout-mini-over'); this.collapsedEl.addClassOnOver("x-layout-collapsed-over"); this.collapsedEl.on('click', this.onExpandClick, this, {stopEvent:true}); }else { if(this.collapsible !== false && !this.hideCollapseTool) { var t = this.expandToolEl = this.toolTemplate.append( this.collapsedEl.dom, {id:'expand-'+this.position}, true); t.addClassOnOver('x-tool-expand-'+this.position+'-over'); t.on('click', this.onExpandClick, this, {stopEvent:true}); } if(this.floatable !== false || this.titleCollapse){ this.collapsedEl.addClassOnOver("x-layout-collapsed-over"); this.collapsedEl.on("click", this[this.floatable ? 'collapseClick' : 'onExpandClick'], this); } } } return this.collapsedEl; }, onExpandClick : function(e){ if(this.isSlid){ this.panel.expand(false); }else{ this.panel.expand(); } }, onCollapseClick : function(e){ this.panel.collapse(); }, beforeCollapse : function(p, animate){ this.lastAnim = animate; if(this.splitEl){ this.splitEl.hide(); } this.getCollapsedEl().show(); var el = this.panel.getEl(); this.originalZIndex = el.getStyle('z-index'); el.setStyle('z-index', 100); this.isCollapsed = true; this.layout.layout(); }, onCollapse : function(animate){ this.panel.el.setStyle('z-index', 1); if(this.lastAnim === false || this.panel.animCollapse === false){ this.getCollapsedEl().dom.style.visibility = 'visible'; }else{ this.getCollapsedEl().slideIn(this.panel.slideAnchor, {duration:.2}); } this.state.collapsed = true; this.panel.saveState(); }, beforeExpand : function(animate){ if(this.isSlid){ this.afterSlideIn(); } var c = this.getCollapsedEl(); this.el.show(); if(this.position == 'east' || this.position == 'west'){ this.panel.setSize(undefined, c.getHeight()); }else{ this.panel.setSize(c.getWidth(), undefined); } c.hide(); c.dom.style.visibility = 'hidden'; this.panel.el.setStyle('z-index', this.floatingZIndex); }, onExpand : function(){ this.isCollapsed = false; if(this.splitEl){ this.splitEl.show(); } this.layout.layout(); this.panel.el.setStyle('z-index', this.originalZIndex); this.state.collapsed = false; this.panel.saveState(); }, collapseClick : function(e){ if(this.isSlid){ e.stopPropagation(); this.slideIn(); }else{ e.stopPropagation(); this.slideOut(); } }, onHide : function(){ if(this.isCollapsed){ this.getCollapsedEl().hide(); }else if(this.splitEl){ this.splitEl.hide(); } }, onShow : function(){ if(this.isCollapsed){ this.getCollapsedEl().show(); }else if(this.splitEl){ this.splitEl.show(); } }, isVisible : function(){ return !this.panel.hidden; }, getMargins : function(){ return this.isCollapsed && this.cmargins ? this.cmargins : this.margins; }, getSize : function(){ return this.isCollapsed ? this.getCollapsedEl().getSize() : this.panel.getSize(); }, setPanel : function(panel){ this.panel = panel; }, getMinWidth: function(){ return this.minWidth; }, getMinHeight: function(){ return this.minHeight; }, applyLayoutCollapsed : function(box){ var ce = this.getCollapsedEl(); ce.setLeftTop(box.x, box.y); ce.setSize(box.width, box.height); }, applyLayout : function(box){ if(this.isCollapsed){ this.applyLayoutCollapsed(box); }else{ this.panel.setPosition(box.x, box.y); this.panel.setSize(box.width, box.height); } }, beforeSlide: function(){ this.panel.beforeEffect(); }, afterSlide : function(){ this.panel.afterEffect(); }, initAutoHide : function(){ if(this.autoHide !== false){ if(!this.autoHideHd){ this.autoHideSlideTask = new Ext.util.DelayedTask(this.slideIn, this); this.autoHideHd = { "mouseout": function(e){ if(!e.within(this.el, true)){ this.autoHideSlideTask.delay(500); } }, "mouseover" : function(e){ this.autoHideSlideTask.cancel(); }, scope : this }; } this.el.on(this.autoHideHd); this.collapsedEl.on(this.autoHideHd); } }, clearAutoHide : function(){ if(this.autoHide !== false){ this.el.un("mouseout", this.autoHideHd.mouseout); this.el.un("mouseover", this.autoHideHd.mouseover); this.collapsedEl.un("mouseout", this.autoHideHd.mouseout); this.collapsedEl.un("mouseover", this.autoHideHd.mouseover); } }, clearMonitor : function(){ Ext.getDoc().un("click", this.slideInIf, this); }, slideOut : function(){ if(this.isSlid || this.el.hasActiveFx()){ return; } this.isSlid = true; var ts = this.panel.tools, dh, pc; if(ts && ts.toggle){ ts.toggle.hide(); } this.el.show(); pc = this.panel.collapsed; this.panel.collapsed = false; if(this.position == 'east' || this.position == 'west'){ dh = this.panel.deferHeight; this.panel.deferHeight = false; this.panel.setSize(undefined, this.collapsedEl.getHeight()); this.panel.deferHeight = dh; }else{ this.panel.setSize(this.collapsedEl.getWidth(), undefined); } this.panel.collapsed = pc; this.restoreLT = [this.el.dom.style.left, this.el.dom.style.top]; this.el.alignTo(this.collapsedEl, this.getCollapseAnchor()); this.el.setStyle("z-index", this.floatingZIndex+2); this.panel.el.replaceClass('x-panel-collapsed', 'x-panel-floating'); if(this.animFloat !== false){ this.beforeSlide(); this.el.slideIn(this.getSlideAnchor(), { callback: function(){ this.afterSlide(); this.initAutoHide(); Ext.getDoc().on("click", this.slideInIf, this); }, scope: this, block: true }); }else{ this.initAutoHide(); Ext.getDoc().on("click", this.slideInIf, this); } }, afterSlideIn : function(){ this.clearAutoHide(); this.isSlid = false; this.clearMonitor(); this.el.setStyle("z-index", ""); this.panel.el.replaceClass('x-panel-floating', 'x-panel-collapsed'); this.el.dom.style.left = this.restoreLT[0]; this.el.dom.style.top = this.restoreLT[1]; var ts = this.panel.tools; if(ts && ts.toggle){ ts.toggle.show(); } }, slideIn : function(cb){ if(!this.isSlid || this.el.hasActiveFx()){ Ext.callback(cb); return; } this.isSlid = false; if(this.animFloat !== false){ this.beforeSlide(); this.el.slideOut(this.getSlideAnchor(), { callback: function(){ this.el.hide(); this.afterSlide(); this.afterSlideIn(); Ext.callback(cb); }, scope: this, block: true }); }else{ this.el.hide(); this.afterSlideIn(); } }, slideInIf : function(e){ if(!e.within(this.el)){ this.slideIn(); } }, anchors : { "west" : "left", "east" : "right", "north" : "top", "south" : "bottom" }, sanchors : { "west" : "l", "east" : "r", "north" : "t", "south" : "b" }, canchors : { "west" : "tl-tr", "east" : "tr-tl", "north" : "tl-bl", "south" : "bl-tl" }, getAnchor : function(){ return this.anchors[this.position]; }, getCollapseAnchor : function(){ return this.canchors[this.position]; }, getSlideAnchor : function(){ return this.sanchors[this.position]; }, getAlignAdj : function(){ var cm = this.cmargins; switch(this.position){ case "west": return [0, 0]; break; case "east": return [0, 0]; break; case "north": return [0, 0]; break; case "south": return [0, 0]; break; } }, getExpandAdj : function(){ var c = this.collapsedEl, cm = this.cmargins; switch(this.position){ case "west": return [-(cm.right+c.getWidth()+cm.left), 0]; break; case "east": return [cm.right+c.getWidth()+cm.left, 0]; break; case "north": return [0, -(cm.top+cm.bottom+c.getHeight())]; break; case "south": return [0, cm.top+cm.bottom+c.getHeight()]; break; } }, destroy : function(){ if (this.autoHideSlideTask && this.autoHideSlideTask.cancel){ this.autoHideSlideTask.cancel(); } Ext.destroyMembers(this, 'miniCollapsedEl', 'collapsedEl', 'expandToolEl'); } }; Ext.layout.BorderLayout.SplitRegion = function(layout, config, pos){ Ext.layout.BorderLayout.SplitRegion.superclass.constructor.call(this, layout, config, pos); this.applyLayout = this.applyFns[pos]; }; Ext.extend(Ext.layout.BorderLayout.SplitRegion, Ext.layout.BorderLayout.Region, { splitTip : "Drag to resize.", collapsibleSplitTip : "Drag to resize. Double click to hide.", useSplitTips : false, splitSettings : { north : { orientation: Ext.SplitBar.VERTICAL, placement: Ext.SplitBar.TOP, maxFn : 'getVMaxSize', minProp: 'minHeight', maxProp: 'maxHeight' }, south : { orientation: Ext.SplitBar.VERTICAL, placement: Ext.SplitBar.BOTTOM, maxFn : 'getVMaxSize', minProp: 'minHeight', maxProp: 'maxHeight' }, east : { orientation: Ext.SplitBar.HORIZONTAL, placement: Ext.SplitBar.RIGHT, maxFn : 'getHMaxSize', minProp: 'minWidth', maxProp: 'maxWidth' }, west : { orientation: Ext.SplitBar.HORIZONTAL, placement: Ext.SplitBar.LEFT, maxFn : 'getHMaxSize', minProp: 'minWidth', maxProp: 'maxWidth' } }, applyFns : { west : function(box){ if(this.isCollapsed){ return this.applyLayoutCollapsed(box); } var sd = this.splitEl.dom, s = sd.style; this.panel.setPosition(box.x, box.y); var sw = sd.offsetWidth; s.left = (box.x+box.width-sw)+'px'; s.top = (box.y)+'px'; s.height = Math.max(0, box.height)+'px'; this.panel.setSize(box.width-sw, box.height); }, east : function(box){ if(this.isCollapsed){ return this.applyLayoutCollapsed(box); } var sd = this.splitEl.dom, s = sd.style; var sw = sd.offsetWidth; this.panel.setPosition(box.x+sw, box.y); s.left = (box.x)+'px'; s.top = (box.y)+'px'; s.height = Math.max(0, box.height)+'px'; this.panel.setSize(box.width-sw, box.height); }, north : function(box){ if(this.isCollapsed){ return this.applyLayoutCollapsed(box); } var sd = this.splitEl.dom, s = sd.style; var sh = sd.offsetHeight; this.panel.setPosition(box.x, box.y); s.left = (box.x)+'px'; s.top = (box.y+box.height-sh)+'px'; s.width = Math.max(0, box.width)+'px'; this.panel.setSize(box.width, box.height-sh); }, south : function(box){ if(this.isCollapsed){ return this.applyLayoutCollapsed(box); } var sd = this.splitEl.dom, s = sd.style; var sh = sd.offsetHeight; this.panel.setPosition(box.x, box.y+sh); s.left = (box.x)+'px'; s.top = (box.y)+'px'; s.width = Math.max(0, box.width)+'px'; this.panel.setSize(box.width, box.height-sh); } }, render : function(ct, p){ Ext.layout.BorderLayout.SplitRegion.superclass.render.call(this, ct, p); var ps = this.position; this.splitEl = ct.createChild({ cls: "x-layout-split x-layout-split-"+ps, html: " ", id: this.panel.id + '-xsplit' }); if(this.collapseMode == 'mini'){ this.miniSplitEl = this.splitEl.createChild({ cls: "x-layout-mini x-layout-mini-"+ps, html: " " }); this.miniSplitEl.addClassOnOver('x-layout-mini-over'); this.miniSplitEl.on('click', this.onCollapseClick, this, {stopEvent:true}); } var s = this.splitSettings[ps]; this.split = new Ext.SplitBar(this.splitEl.dom, p.el, s.orientation); this.split.tickSize = this.tickSize; this.split.placement = s.placement; this.split.getMaximumSize = this[s.maxFn].createDelegate(this); this.split.minSize = this.minSize || this[s.minProp]; this.split.on("beforeapply", this.onSplitMove, this); this.split.useShim = this.useShim === true; this.maxSize = this.maxSize || this[s.maxProp]; if(p.hidden){ this.splitEl.hide(); } if(this.useSplitTips){ this.splitEl.dom.title = this.collapsible ? this.collapsibleSplitTip : this.splitTip; } if(this.collapsible){ this.splitEl.on("dblclick", this.onCollapseClick, this); } }, getSize : function(){ if(this.isCollapsed){ return this.collapsedEl.getSize(); } var s = this.panel.getSize(); if(this.position == 'north' || this.position == 'south'){ s.height += this.splitEl.dom.offsetHeight; }else{ s.width += this.splitEl.dom.offsetWidth; } return s; }, getHMaxSize : function(){ var cmax = this.maxSize || 10000; var center = this.layout.center; return Math.min(cmax, (this.el.getWidth()+center.el.getWidth())-center.getMinWidth()); }, getVMaxSize : function(){ var cmax = this.maxSize || 10000; var center = this.layout.center; return Math.min(cmax, (this.el.getHeight()+center.el.getHeight())-center.getMinHeight()); }, onSplitMove : function(split, newSize){ var s = this.panel.getSize(); this.lastSplitSize = newSize; if(this.position == 'north' || this.position == 'south'){ this.panel.setSize(s.width, newSize); this.state.height = newSize; }else{ this.panel.setSize(newSize, s.height); this.state.width = newSize; } this.layout.layout(); this.panel.saveState(); return false; }, getSplitBar : function(){ return this.split; }, destroy : function() { Ext.destroy(this.miniSplitEl, this.split, this.splitEl); Ext.layout.BorderLayout.SplitRegion.superclass.destroy.call(this); } }); Ext.Container.LAYOUTS['border'] = Ext.layout.BorderLayout; Ext.layout.FormLayout = Ext.extend(Ext.layout.AnchorLayout, { labelSeparator : ':', trackLabels: true, type: 'form', onRemove: function(c){ Ext.layout.FormLayout.superclass.onRemove.call(this, c); if(this.trackLabels){ c.un('show', this.onFieldShow, this); c.un('hide', this.onFieldHide, this); } var el = c.getPositionEl(), ct = c.getItemCt && c.getItemCt(); if (c.rendered && ct) { if (el && el.dom) { el.insertAfter(ct); } Ext.destroy(ct); Ext.destroyMembers(c, 'label', 'itemCt'); if (c.customItemCt) { Ext.destroyMembers(c, 'getItemCt', 'customItemCt'); } } }, setContainer : function(ct){ Ext.layout.FormLayout.superclass.setContainer.call(this, ct); if(ct.labelAlign){ ct.addClass('x-form-label-'+ct.labelAlign); } if(ct.hideLabels){ Ext.apply(this, { labelStyle: 'display:none', elementStyle: 'padding-left:0;', labelAdjust: 0 }); }else{ this.labelSeparator = Ext.isDefined(ct.labelSeparator) ? ct.labelSeparator : this.labelSeparator; ct.labelWidth = ct.labelWidth || 100; if(Ext.isNumber(ct.labelWidth)){ var pad = Ext.isNumber(ct.labelPad) ? ct.labelPad : 5; Ext.apply(this, { labelAdjust: ct.labelWidth + pad, labelStyle: 'width:' + ct.labelWidth + 'px;', elementStyle: 'padding-left:' + (ct.labelWidth + pad) + 'px' }); } if(ct.labelAlign == 'top'){ Ext.apply(this, { labelStyle: 'width:auto;', labelAdjust: 0, elementStyle: 'padding-left:0;' }); } } }, isHide: function(c){ return c.hideLabel || this.container.hideLabels; }, onFieldShow: function(c){ c.getItemCt().removeClass('x-hide-' + c.hideMode); if (c.isComposite) { c.doLayout(); } }, onFieldHide: function(c){ c.getItemCt().addClass('x-hide-' + c.hideMode); }, getLabelStyle: function(s){ var ls = '', items = [this.labelStyle, s]; for (var i = 0, len = items.length; i < len; ++i){ if (items[i]){ ls += items[i]; if (ls.substr(-1, 1) != ';'){ ls += ';'; } } } return ls; }, renderItem : function(c, position, target){ if(c && (c.isFormField || c.fieldLabel) && c.inputType != 'hidden'){ var args = this.getTemplateArgs(c); if(Ext.isNumber(position)){ position = target.dom.childNodes[position] || null; } if(position){ c.itemCt = this.fieldTpl.insertBefore(position, args, true); }else{ c.itemCt = this.fieldTpl.append(target, args, true); } if(!c.getItemCt){ Ext.apply(c, { getItemCt: function(){ return c.itemCt; }, customItemCt: true }); } c.label = c.getItemCt().child('label.x-form-item-label'); if(!c.rendered){ c.render('x-form-el-' + c.id); }else if(!this.isValidParent(c, target)){ Ext.fly('x-form-el-' + c.id).appendChild(c.getPositionEl()); } if(this.trackLabels){ if(c.hidden){ this.onFieldHide(c); } c.on({ scope: this, show: this.onFieldShow, hide: this.onFieldHide }); } this.configureItem(c); }else { Ext.layout.FormLayout.superclass.renderItem.apply(this, arguments); } }, getTemplateArgs: function(field) { var noLabelSep = !field.fieldLabel || field.hideLabel, itemCls = (field.itemCls || this.container.itemCls || '') + (field.hideLabel ? ' x-hide-label' : ''); if (Ext.isIE9 && Ext.isIEQuirks && field instanceof Ext.form.TextField) { itemCls += ' x-input-wrapper'; } return { id : field.id, label : field.fieldLabel, itemCls : itemCls, clearCls : field.clearCls || 'x-form-clear-left', labelStyle : this.getLabelStyle(field.labelStyle), elementStyle : this.elementStyle || '', labelSeparator: noLabelSep ? '' : (Ext.isDefined(field.labelSeparator) ? field.labelSeparator : this.labelSeparator) }; }, adjustWidthAnchor: function(value, c){ if(c.label && !this.isHide(c) && (this.container.labelAlign != 'top')){ var adjust = Ext.isIE6 || (Ext.isIE && !Ext.isStrict); return value - this.labelAdjust + (adjust ? -3 : 0); } return value; }, adjustHeightAnchor : function(value, c){ if(c.label && !this.isHide(c) && (this.container.labelAlign == 'top')){ return value - c.label.getHeight(); } return value; }, isValidParent : function(c, target){ return target && this.container.getEl().contains(c.getPositionEl()); } }); Ext.Container.LAYOUTS['form'] = Ext.layout.FormLayout; Ext.layout.AccordionLayout = Ext.extend(Ext.layout.FitLayout, { fill : true, autoWidth : true, titleCollapse : true, hideCollapseTool : false, collapseFirst : false, animate : false, sequence : false, activeOnTop : false, type: 'accordion', renderItem : function(c){ if(this.animate === false){ c.animCollapse = false; } c.collapsible = true; if(this.autoWidth){ c.autoWidth = true; } if(this.titleCollapse){ c.titleCollapse = true; } if(this.hideCollapseTool){ c.hideCollapseTool = true; } if(this.collapseFirst !== undefined){ c.collapseFirst = this.collapseFirst; } if(!this.activeItem && !c.collapsed){ this.setActiveItem(c, true); }else if(this.activeItem && this.activeItem != c){ c.collapsed = true; } Ext.layout.AccordionLayout.superclass.renderItem.apply(this, arguments); c.header.addClass('x-accordion-hd'); c.on('beforeexpand', this.beforeExpand, this); }, onRemove: function(c){ Ext.layout.AccordionLayout.superclass.onRemove.call(this, c); if(c.rendered){ c.header.removeClass('x-accordion-hd'); } c.un('beforeexpand', this.beforeExpand, this); }, beforeExpand : function(p, anim){ var ai = this.activeItem; if(ai){ if(this.sequence){ delete this.activeItem; if (!ai.collapsed){ ai.collapse({callback:function(){ p.expand(anim || true); }, scope: this}); return false; } }else{ ai.collapse(this.animate); } } this.setActive(p); if(this.activeOnTop){ p.el.dom.parentNode.insertBefore(p.el.dom, p.el.dom.parentNode.firstChild); } this.layout(); }, setItemSize : function(item, size){ if(this.fill && item){ var hh = 0, i, ct = this.getRenderedItems(this.container), len = ct.length, p; for (i = 0; i < len; i++) { if((p = ct[i]) != item && !p.hidden){ hh += p.header.getHeight(); } }; size.height -= hh; item.setSize(size); } }, setActiveItem : function(item){ this.setActive(item, true); }, setActive : function(item, expand){ var ai = this.activeItem; item = this.container.getComponent(item); if(ai != item){ if(item.rendered && item.collapsed && expand){ item.expand(); }else{ if(ai){ ai.fireEvent('deactivate', ai); } this.activeItem = item; item.fireEvent('activate', item); } } } }); Ext.Container.LAYOUTS.accordion = Ext.layout.AccordionLayout; Ext.layout.Accordion = Ext.layout.AccordionLayout; Ext.layout.TableLayout = Ext.extend(Ext.layout.ContainerLayout, { monitorResize:false, type: 'table', targetCls: 'x-table-layout-ct', tableAttrs:null, setContainer : function(ct){ Ext.layout.TableLayout.superclass.setContainer.call(this, ct); this.currentRow = 0; this.currentColumn = 0; this.cells = []; }, onLayout : function(ct, target){ var cs = ct.items.items, len = cs.length, c, i; if(!this.table){ target.addClass('x-table-layout-ct'); this.table = target.createChild( Ext.apply({tag:'table', cls:'x-table-layout', cellspacing: 0, cn: {tag: 'tbody'}}, this.tableAttrs), null, true); } this.renderAll(ct, target); }, getRow : function(index){ var row = this.table.tBodies[0].childNodes[index]; if(!row){ row = document.createElement('tr'); this.table.tBodies[0].appendChild(row); } return row; }, getNextCell : function(c){ var cell = this.getNextNonSpan(this.currentColumn, this.currentRow); var curCol = this.currentColumn = cell[0], curRow = this.currentRow = cell[1]; for(var rowIndex = curRow; rowIndex < curRow + (c.rowspan || 1); rowIndex++){ if(!this.cells[rowIndex]){ this.cells[rowIndex] = []; } for(var colIndex = curCol; colIndex < curCol + (c.colspan || 1); colIndex++){ this.cells[rowIndex][colIndex] = true; } } var td = document.createElement('td'); if(c.cellId){ td.id = c.cellId; } var cls = 'x-table-layout-cell'; if(c.cellCls){ cls += ' ' + c.cellCls; } td.className = cls; if(c.colspan){ td.colSpan = c.colspan; } if(c.rowspan){ td.rowSpan = c.rowspan; } this.getRow(curRow).appendChild(td); return td; }, getNextNonSpan: function(colIndex, rowIndex){ var cols = this.columns; while((cols && colIndex >= cols) || (this.cells[rowIndex] && this.cells[rowIndex][colIndex])) { if(cols && colIndex >= cols){ rowIndex++; colIndex = 0; }else{ colIndex++; } } return [colIndex, rowIndex]; }, renderItem : function(c, position, target){ if(!this.table){ this.table = target.createChild( Ext.apply({tag:'table', cls:'x-table-layout', cellspacing: 0, cn: {tag: 'tbody'}}, this.tableAttrs), null, true); } if(c && !c.rendered){ c.render(this.getNextCell(c)); this.configureItem(c); }else if(c && !this.isValidParent(c, target)){ var container = this.getNextCell(c); container.insertBefore(c.getPositionEl().dom, null); c.container = Ext.get(container); this.configureItem(c); } }, isValidParent : function(c, target){ return c.getPositionEl().up('table', 5).dom.parentNode === (target.dom || target); }, destroy: function(){ delete this.table; Ext.layout.TableLayout.superclass.destroy.call(this); } }); Ext.Container.LAYOUTS['table'] = Ext.layout.TableLayout; Ext.layout.AbsoluteLayout = Ext.extend(Ext.layout.AnchorLayout, { extraCls: 'x-abs-layout-item', type: 'absolute', onLayout : function(ct, target){ target.position(); this.paddingLeft = target.getPadding('l'); this.paddingTop = target.getPadding('t'); Ext.layout.AbsoluteLayout.superclass.onLayout.call(this, ct, target); }, adjustWidthAnchor : function(value, comp){ return value ? value - comp.getPosition(true)[0] + this.paddingLeft : value; }, adjustHeightAnchor : function(value, comp){ return value ? value - comp.getPosition(true)[1] + this.paddingTop : value; } }); Ext.Container.LAYOUTS['absolute'] = Ext.layout.AbsoluteLayout; Ext.layout.BoxLayout = Ext.extend(Ext.layout.ContainerLayout, { defaultMargins : {left:0,top:0,right:0,bottom:0}, padding : '0', pack : 'start', monitorResize : true, type: 'box', scrollOffset : 0, extraCls : 'x-box-item', targetCls : 'x-box-layout-ct', innerCls : 'x-box-inner', constructor : function(config){ Ext.layout.BoxLayout.superclass.constructor.call(this, config); if (Ext.isString(this.defaultMargins)) { this.defaultMargins = this.parseMargins(this.defaultMargins); } var handler = this.overflowHandler; if (typeof handler == 'string') { handler = { type: handler }; } var handlerType = 'none'; if (handler && handler.type != undefined) { handlerType = handler.type; } var constructor = Ext.layout.boxOverflow[handlerType]; if (constructor[this.type]) { constructor = constructor[this.type]; } this.overflowHandler = new constructor(this, handler); }, onLayout: function(container, target) { Ext.layout.BoxLayout.superclass.onLayout.call(this, container, target); var tSize = this.getLayoutTargetSize(), items = this.getVisibleItems(container), calcs = this.calculateChildBoxes(items, tSize), boxes = calcs.boxes, meta = calcs.meta; if (tSize.width > 0) { var handler = this.overflowHandler, method = meta.tooNarrow ? 'handleOverflow' : 'clearOverflow'; var results = handler[method](calcs, tSize); if (results) { if (results.targetSize) { tSize = results.targetSize; } if (results.recalculate) { items = this.getVisibleItems(container); calcs = this.calculateChildBoxes(items, tSize); boxes = calcs.boxes; } } } this.layoutTargetLastSize = tSize; this.childBoxCache = calcs; this.updateInnerCtSize(tSize, calcs); this.updateChildBoxes(boxes); this.handleTargetOverflow(tSize, container, target); }, updateChildBoxes: function(boxes) { for (var i = 0, length = boxes.length; i < length; i++) { var box = boxes[i], comp = box.component; if (box.dirtySize) { comp.setSize(box.width, box.height); } if (isNaN(box.left) || isNaN(box.top)) { continue; } comp.setPosition(box.left, box.top); } }, updateInnerCtSize: function(tSize, calcs) { var align = this.align, padding = this.padding, width = tSize.width, height = tSize.height; if (this.type == 'hbox') { var innerCtWidth = width, innerCtHeight = calcs.meta.maxHeight + padding.top + padding.bottom; if (align == 'stretch') { innerCtHeight = height; } else if (align == 'middle') { innerCtHeight = Math.max(height, innerCtHeight); } } else { var innerCtHeight = height, innerCtWidth = calcs.meta.maxWidth + padding.left + padding.right; if (align == 'stretch') { innerCtWidth = width; } else if (align == 'center') { innerCtWidth = Math.max(width, innerCtWidth); } } this.innerCt.setSize(innerCtWidth || undefined, innerCtHeight || undefined); }, handleTargetOverflow: function(previousTargetSize, container, target) { var overflow = target.getStyle('overflow'); if (overflow && overflow != 'hidden' &&!this.adjustmentPass) { var newTargetSize = this.getLayoutTargetSize(); if (newTargetSize.width != previousTargetSize.width || newTargetSize.height != previousTargetSize.height){ this.adjustmentPass = true; this.onLayout(container, target); } } delete this.adjustmentPass; }, isValidParent : function(c, target) { return this.innerCt && c.getPositionEl().dom.parentNode == this.innerCt.dom; }, getVisibleItems: function(ct) { var ct = ct || this.container, t = ct.getLayoutTarget(), cti = ct.items.items, len = cti.length, i, c, items = []; for (i = 0; i < len; i++) { if((c = cti[i]).rendered && this.isValidParent(c, t) && c.hidden !== true && c.collapsed !== true && c.shouldLayout !== false){ items.push(c); } } return items; }, renderAll : function(ct, target) { if (!this.innerCt) { this.innerCt = target.createChild({cls:this.innerCls}); this.padding = this.parseMargins(this.padding); } Ext.layout.BoxLayout.superclass.renderAll.call(this, ct, this.innerCt); }, getLayoutTargetSize : function() { var target = this.container.getLayoutTarget(), ret; if (target) { ret = target.getViewSize(); if (Ext.isIE && Ext.isStrict && ret.width == 0){ ret = target.getStyleSize(); } ret.width -= target.getPadding('lr'); ret.height -= target.getPadding('tb'); } return ret; }, renderItem : function(c) { if(Ext.isString(c.margins)){ c.margins = this.parseMargins(c.margins); }else if(!c.margins){ c.margins = this.defaultMargins; } Ext.layout.BoxLayout.superclass.renderItem.apply(this, arguments); }, destroy: function() { Ext.destroy(this.overflowHandler); Ext.layout.BoxLayout.superclass.destroy.apply(this, arguments); } }); Ext.layout.boxOverflow.None = Ext.extend(Object, { constructor: function(layout, config) { this.layout = layout; Ext.apply(this, config || {}); }, handleOverflow: Ext.emptyFn, clearOverflow: Ext.emptyFn }); Ext.layout.boxOverflow.none = Ext.layout.boxOverflow.None; Ext.layout.boxOverflow.Menu = Ext.extend(Ext.layout.boxOverflow.None, { afterCls: 'x-strip-right', noItemsMenuText : '
    (None)
    ', constructor: function(layout) { Ext.layout.boxOverflow.Menu.superclass.constructor.apply(this, arguments); this.menuItems = []; }, createInnerElements: function() { if (!this.afterCt) { this.afterCt = this.layout.innerCt.insertSibling({cls: this.afterCls}, 'before'); } }, clearOverflow: function(calculations, targetSize) { var newWidth = targetSize.width + (this.afterCt ? this.afterCt.getWidth() : 0), items = this.menuItems; this.hideTrigger(); for (var index = 0, length = items.length; index < length; index++) { items.pop().component.show(); } return { targetSize: { height: targetSize.height, width : newWidth } }; }, showTrigger: function() { this.createMenu(); this.menuTrigger.show(); }, hideTrigger: function() { if (this.menuTrigger != undefined) { this.menuTrigger.hide(); } }, beforeMenuShow: function(menu) { var items = this.menuItems, len = items.length, item, prev; var needsSep = function(group, item){ return group.isXType('buttongroup') && !(item instanceof Ext.Toolbar.Separator); }; this.clearMenu(); menu.removeAll(); for (var i = 0; i < len; i++) { item = items[i].component; if (prev && (needsSep(item, prev) || needsSep(prev, item))) { menu.add('-'); } this.addComponentToMenu(menu, item); prev = item; } if (menu.items.length < 1) { menu.add(this.noItemsMenuText); } }, createMenuConfig : function(component, hideOnClick){ var config = Ext.apply({}, component.initialConfig), group = component.toggleGroup; Ext.copyTo(config, component, [ 'iconCls', 'icon', 'itemId', 'disabled', 'handler', 'scope', 'menu' ]); Ext.apply(config, { text : component.overflowText || component.text, hideOnClick: hideOnClick }); if (group || component.enableToggle) { Ext.apply(config, { group : group, checked: component.pressed, listeners: { checkchange: function(item, checked){ component.toggle(checked); } } }); } delete config.ownerCt; delete config.xtype; delete config.id; return config; }, addComponentToMenu : function(menu, component) { if (component instanceof Ext.Toolbar.Separator) { menu.add('-'); } else if (Ext.isFunction(component.isXType)) { if (component.isXType('splitbutton')) { menu.add(this.createMenuConfig(component, true)); } else if (component.isXType('button')) { menu.add(this.createMenuConfig(component, !component.menu)); } else if (component.isXType('buttongroup')) { component.items.each(function(item){ this.addComponentToMenu(menu, item); }, this); } } }, clearMenu : function(){ var menu = this.moreMenu; if (menu && menu.items) { menu.items.each(function(item){ delete item.menu; }); } }, createMenu: function() { if (!this.menuTrigger) { this.createInnerElements(); this.menu = new Ext.menu.Menu({ ownerCt : this.layout.container, listeners: { scope: this, beforeshow: this.beforeMenuShow } }); this.menuTrigger = new Ext.Button({ iconCls : 'x-toolbar-more-icon', cls : 'x-toolbar-more', menu : this.menu, renderTo: this.afterCt }); } }, destroy: function() { Ext.destroy(this.menu, this.menuTrigger); } }); Ext.layout.boxOverflow.menu = Ext.layout.boxOverflow.Menu; Ext.layout.boxOverflow.HorizontalMenu = Ext.extend(Ext.layout.boxOverflow.Menu, { constructor: function() { Ext.layout.boxOverflow.HorizontalMenu.superclass.constructor.apply(this, arguments); var me = this, layout = me.layout, origFunction = layout.calculateChildBoxes; layout.calculateChildBoxes = function(visibleItems, targetSize) { var calcs = origFunction.apply(layout, arguments), meta = calcs.meta, items = me.menuItems; var hiddenWidth = 0; for (var index = 0, length = items.length; index < length; index++) { hiddenWidth += items[index].width; } meta.minimumWidth += hiddenWidth; meta.tooNarrow = meta.minimumWidth > targetSize.width; return calcs; }; }, handleOverflow: function(calculations, targetSize) { this.showTrigger(); var newWidth = targetSize.width - this.afterCt.getWidth(), boxes = calculations.boxes, usedWidth = 0, recalculate = false; for (var index = 0, length = boxes.length; index < length; index++) { usedWidth += boxes[index].width; } var spareWidth = newWidth - usedWidth, showCount = 0; for (var index = 0, length = this.menuItems.length; index < length; index++) { var hidden = this.menuItems[index], comp = hidden.component, width = hidden.width; if (width < spareWidth) { comp.show(); spareWidth -= width; showCount ++; recalculate = true; } else { break; } } if (recalculate) { this.menuItems = this.menuItems.slice(showCount); } else { for (var i = boxes.length - 1; i >= 0; i--) { var item = boxes[i].component, right = boxes[i].left + boxes[i].width; if (right >= newWidth) { this.menuItems.unshift({ component: item, width : boxes[i].width }); item.hide(); } else { break; } } } if (this.menuItems.length == 0) { this.hideTrigger(); } return { targetSize: { height: targetSize.height, width : newWidth }, recalculate: recalculate }; } }); Ext.layout.boxOverflow.menu.hbox = Ext.layout.boxOverflow.HorizontalMenu; Ext.layout.boxOverflow.Scroller = Ext.extend(Ext.layout.boxOverflow.None, { animateScroll: true, scrollIncrement: 100, wheelIncrement: 3, scrollRepeatInterval: 400, scrollDuration: 0.4, beforeCls: 'x-strip-left', afterCls: 'x-strip-right', scrollerCls: 'x-strip-scroller', beforeScrollerCls: 'x-strip-scroller-left', afterScrollerCls: 'x-strip-scroller-right', createWheelListener: function() { this.layout.innerCt.on({ scope : this, mousewheel: function(e) { e.stopEvent(); this.scrollBy(e.getWheelDelta() * this.wheelIncrement * -1, false); } }); }, handleOverflow: function(calculations, targetSize) { this.createInnerElements(); this.showScrollers(); }, clearOverflow: function() { this.hideScrollers(); }, showScrollers: function() { this.createScrollers(); this.beforeScroller.show(); this.afterScroller.show(); this.updateScrollButtons(); }, hideScrollers: function() { if (this.beforeScroller != undefined) { this.beforeScroller.hide(); this.afterScroller.hide(); } }, createScrollers: function() { if (!this.beforeScroller && !this.afterScroller) { var before = this.beforeCt.createChild({ cls: String.format("{0} {1} ", this.scrollerCls, this.beforeScrollerCls) }); var after = this.afterCt.createChild({ cls: String.format("{0} {1}", this.scrollerCls, this.afterScrollerCls) }); before.addClassOnOver(this.beforeScrollerCls + '-hover'); after.addClassOnOver(this.afterScrollerCls + '-hover'); before.setVisibilityMode(Ext.Element.DISPLAY); after.setVisibilityMode(Ext.Element.DISPLAY); this.beforeRepeater = new Ext.util.ClickRepeater(before, { interval: this.scrollRepeatInterval, handler : this.scrollLeft, scope : this }); this.afterRepeater = new Ext.util.ClickRepeater(after, { interval: this.scrollRepeatInterval, handler : this.scrollRight, scope : this }); this.beforeScroller = before; this.afterScroller = after; } }, destroy: function() { Ext.destroy(this.beforeScroller, this.afterScroller, this.beforeRepeater, this.afterRepeater, this.beforeCt, this.afterCt); }, scrollBy: function(delta, animate) { this.scrollTo(this.getScrollPosition() + delta, animate); }, getItem: function(item) { if (Ext.isString(item)) { item = Ext.getCmp(item); } else if (Ext.isNumber(item)) { item = this.items[item]; } return item; }, getScrollAnim: function() { return { duration: this.scrollDuration, callback: this.updateScrollButtons, scope : this }; }, updateScrollButtons: function() { if (this.beforeScroller == undefined || this.afterScroller == undefined) { return; } var beforeMeth = this.atExtremeBefore() ? 'addClass' : 'removeClass', afterMeth = this.atExtremeAfter() ? 'addClass' : 'removeClass', beforeCls = this.beforeScrollerCls + '-disabled', afterCls = this.afterScrollerCls + '-disabled'; this.beforeScroller[beforeMeth](beforeCls); this.afterScroller[afterMeth](afterCls); this.scrolling = false; }, atExtremeBefore: function() { return this.getScrollPosition() === 0; }, scrollLeft: function(animate) { this.scrollBy(-this.scrollIncrement, animate); }, scrollRight: function(animate) { this.scrollBy(this.scrollIncrement, animate); }, scrollToItem: function(item, animate) { item = this.getItem(item); if (item != undefined) { var visibility = this.getItemVisibility(item); if (!visibility.fullyVisible) { var box = item.getBox(true, true), newX = box.x; if (visibility.hiddenRight) { newX -= (this.layout.innerCt.getWidth() - box.width); } this.scrollTo(newX, animate); } } }, getItemVisibility: function(item) { var box = this.getItem(item).getBox(true, true), itemLeft = box.x, itemRight = box.x + box.width, scrollLeft = this.getScrollPosition(), scrollRight = this.layout.innerCt.getWidth() + scrollLeft; return { hiddenLeft : itemLeft < scrollLeft, hiddenRight : itemRight > scrollRight, fullyVisible: itemLeft > scrollLeft && itemRight < scrollRight }; } }); Ext.layout.boxOverflow.scroller = Ext.layout.boxOverflow.Scroller; Ext.layout.boxOverflow.VerticalScroller = Ext.extend(Ext.layout.boxOverflow.Scroller, { scrollIncrement: 75, wheelIncrement : 2, handleOverflow: function(calculations, targetSize) { Ext.layout.boxOverflow.VerticalScroller.superclass.handleOverflow.apply(this, arguments); return { targetSize: { height: targetSize.height - (this.beforeCt.getHeight() + this.afterCt.getHeight()), width : targetSize.width } }; }, createInnerElements: function() { var target = this.layout.innerCt; if (!this.beforeCt) { this.beforeCt = target.insertSibling({cls: this.beforeCls}, 'before'); this.afterCt = target.insertSibling({cls: this.afterCls}, 'after'); this.createWheelListener(); } }, scrollTo: function(position, animate) { var oldPosition = this.getScrollPosition(), newPosition = position.constrain(0, this.getMaxScrollBottom()); if (newPosition != oldPosition && !this.scrolling) { if (animate == undefined) { animate = this.animateScroll; } this.layout.innerCt.scrollTo('top', newPosition, animate ? this.getScrollAnim() : false); if (animate) { this.scrolling = true; } else { this.scrolling = false; this.updateScrollButtons(); } } }, getScrollPosition: function(){ return parseInt(this.layout.innerCt.dom.scrollTop, 10) || 0; }, getMaxScrollBottom: function() { return this.layout.innerCt.dom.scrollHeight - this.layout.innerCt.getHeight(); }, atExtremeAfter: function() { return this.getScrollPosition() >= this.getMaxScrollBottom(); } }); Ext.layout.boxOverflow.scroller.vbox = Ext.layout.boxOverflow.VerticalScroller; Ext.layout.boxOverflow.HorizontalScroller = Ext.extend(Ext.layout.boxOverflow.Scroller, { handleOverflow: function(calculations, targetSize) { Ext.layout.boxOverflow.HorizontalScroller.superclass.handleOverflow.apply(this, arguments); return { targetSize: { height: targetSize.height, width : targetSize.width - (this.beforeCt.getWidth() + this.afterCt.getWidth()) } }; }, createInnerElements: function() { var target = this.layout.innerCt; if (!this.beforeCt) { this.afterCt = target.insertSibling({cls: this.afterCls}, 'before'); this.beforeCt = target.insertSibling({cls: this.beforeCls}, 'before'); this.createWheelListener(); } }, scrollTo: function(position, animate) { var oldPosition = this.getScrollPosition(), newPosition = position.constrain(0, this.getMaxScrollRight()); if (newPosition != oldPosition && !this.scrolling) { if (animate == undefined) { animate = this.animateScroll; } this.layout.innerCt.scrollTo('left', newPosition, animate ? this.getScrollAnim() : false); if (animate) { this.scrolling = true; } else { this.scrolling = false; this.updateScrollButtons(); } } }, getScrollPosition: function(){ return parseInt(this.layout.innerCt.dom.scrollLeft, 10) || 0; }, getMaxScrollRight: function() { return this.layout.innerCt.dom.scrollWidth - this.layout.innerCt.getWidth(); }, atExtremeAfter: function() { return this.getScrollPosition() >= this.getMaxScrollRight(); } }); Ext.layout.boxOverflow.scroller.hbox = Ext.layout.boxOverflow.HorizontalScroller; Ext.layout.HBoxLayout = Ext.extend(Ext.layout.BoxLayout, { align: 'top', type : 'hbox', calculateChildBoxes: function(visibleItems, targetSize) { var visibleCount = visibleItems.length, padding = this.padding, topOffset = padding.top, leftOffset = padding.left, paddingVert = topOffset + padding.bottom, paddingHoriz = leftOffset + padding.right, width = targetSize.width - this.scrollOffset, height = targetSize.height, availHeight = Math.max(0, height - paddingVert), isStart = this.pack == 'start', isCenter = this.pack == 'center', isEnd = this.pack == 'end', nonFlexWidth = 0, maxHeight = 0, totalFlex = 0, desiredWidth = 0, minimumWidth = 0, boxes = [], child, childWidth, childHeight, childSize, childMargins, canLayout, i, calcs, flexedWidth, horizMargins, vertMargins, stretchHeight; for (i = 0; i < visibleCount; i++) { child = visibleItems[i]; childHeight = child.height; childWidth = child.width; canLayout = !child.hasLayout && typeof child.doLayout == 'function'; if (typeof childWidth != 'number') { if (child.flex && !childWidth) { totalFlex += child.flex; } else { if (!childWidth && canLayout) { child.doLayout(); } childSize = child.getSize(); childWidth = childSize.width; childHeight = childSize.height; } } childMargins = child.margins; horizMargins = childMargins.left + childMargins.right; nonFlexWidth += horizMargins + (childWidth || 0); desiredWidth += horizMargins + (child.flex ? child.minWidth || 0 : childWidth); minimumWidth += horizMargins + (child.minWidth || childWidth || 0); if (typeof childHeight != 'number') { if (canLayout) { child.doLayout(); } childHeight = child.getHeight(); } maxHeight = Math.max(maxHeight, childHeight + childMargins.top + childMargins.bottom); boxes.push({ component: child, height : childHeight || undefined, width : childWidth || undefined }); } var shortfall = desiredWidth - width, tooNarrow = minimumWidth > width; var availableWidth = Math.max(0, width - nonFlexWidth - paddingHoriz); if (tooNarrow) { for (i = 0; i < visibleCount; i++) { boxes[i].width = visibleItems[i].minWidth || visibleItems[i].width || boxes[i].width; } } else { if (shortfall > 0) { var minWidths = []; for (var index = 0, length = visibleCount; index < length; index++) { var item = visibleItems[index], minWidth = item.minWidth || 0; if (item.flex) { boxes[index].width = minWidth; } else { minWidths.push({ minWidth : minWidth, available: boxes[index].width - minWidth, index : index }); } } minWidths.sort(function(a, b) { return a.available > b.available ? 1 : -1; }); for (var i = 0, length = minWidths.length; i < length; i++) { var itemIndex = minWidths[i].index; if (itemIndex == undefined) { continue; } var item = visibleItems[itemIndex], box = boxes[itemIndex], oldWidth = box.width, minWidth = item.minWidth, newWidth = Math.max(minWidth, oldWidth - Math.ceil(shortfall / (length - i))), reduction = oldWidth - newWidth; boxes[itemIndex].width = newWidth; shortfall -= reduction; } } else { var remainingWidth = availableWidth, remainingFlex = totalFlex; for (i = 0; i < visibleCount; i++) { child = visibleItems[i]; calcs = boxes[i]; childMargins = child.margins; vertMargins = childMargins.top + childMargins.bottom; if (isStart && child.flex && !child.width) { flexedWidth = Math.ceil((child.flex / remainingFlex) * remainingWidth); remainingWidth -= flexedWidth; remainingFlex -= child.flex; calcs.width = flexedWidth; calcs.dirtySize = true; } } } } if (isCenter) { leftOffset += availableWidth / 2; } else if (isEnd) { leftOffset += availableWidth; } for (i = 0; i < visibleCount; i++) { child = visibleItems[i]; calcs = boxes[i]; childMargins = child.margins; leftOffset += childMargins.left; vertMargins = childMargins.top + childMargins.bottom; calcs.left = leftOffset; calcs.top = topOffset + childMargins.top; switch (this.align) { case 'stretch': stretchHeight = availHeight - vertMargins; calcs.height = stretchHeight.constrain(child.minHeight || 0, child.maxHeight || 1000000); calcs.dirtySize = true; break; case 'stretchmax': stretchHeight = maxHeight - vertMargins; calcs.height = stretchHeight.constrain(child.minHeight || 0, child.maxHeight || 1000000); calcs.dirtySize = true; break; case 'middle': var diff = availHeight - calcs.height - vertMargins; if (diff > 0) { calcs.top = topOffset + vertMargins + (diff / 2); } } leftOffset += calcs.width + childMargins.right; } return { boxes: boxes, meta : { maxHeight : maxHeight, nonFlexWidth: nonFlexWidth, desiredWidth: desiredWidth, minimumWidth: minimumWidth, shortfall : desiredWidth - width, tooNarrow : tooNarrow } }; } }); Ext.Container.LAYOUTS.hbox = Ext.layout.HBoxLayout; Ext.layout.VBoxLayout = Ext.extend(Ext.layout.BoxLayout, { align : 'left', type: 'vbox', calculateChildBoxes: function(visibleItems, targetSize) { var visibleCount = visibleItems.length, padding = this.padding, topOffset = padding.top, leftOffset = padding.left, paddingVert = topOffset + padding.bottom, paddingHoriz = leftOffset + padding.right, width = targetSize.width - this.scrollOffset, height = targetSize.height, availWidth = Math.max(0, width - paddingHoriz), isStart = this.pack == 'start', isCenter = this.pack == 'center', isEnd = this.pack == 'end', nonFlexHeight= 0, maxWidth = 0, totalFlex = 0, desiredHeight= 0, minimumHeight= 0, boxes = [], child, childWidth, childHeight, childSize, childMargins, canLayout, i, calcs, flexedHeight, horizMargins, vertMargins, stretchWidth, length; for (i = 0; i < visibleCount; i++) { child = visibleItems[i]; childHeight = child.height; childWidth = child.width; canLayout = !child.hasLayout && typeof child.doLayout == 'function'; if (typeof childHeight != 'number') { if (child.flex && !childHeight) { totalFlex += child.flex; } else { if (!childHeight && canLayout) { child.doLayout(); } childSize = child.getSize(); childWidth = childSize.width; childHeight = childSize.height; } } childMargins = child.margins; vertMargins = childMargins.top + childMargins.bottom; nonFlexHeight += vertMargins + (childHeight || 0); desiredHeight += vertMargins + (child.flex ? child.minHeight || 0 : childHeight); minimumHeight += vertMargins + (child.minHeight || childHeight || 0); if (typeof childWidth != 'number') { if (canLayout) { child.doLayout(); } childWidth = child.getWidth(); } maxWidth = Math.max(maxWidth, childWidth + childMargins.left + childMargins.right); boxes.push({ component: child, height : childHeight || undefined, width : childWidth || undefined }); } var shortfall = desiredHeight - height, tooNarrow = minimumHeight > height; var availableHeight = Math.max(0, (height - nonFlexHeight - paddingVert)); if (tooNarrow) { for (i = 0, length = visibleCount; i < length; i++) { boxes[i].height = visibleItems[i].minHeight || visibleItems[i].height || boxes[i].height; } } else { if (shortfall > 0) { var minHeights = []; for (var index = 0, length = visibleCount; index < length; index++) { var item = visibleItems[index], minHeight = item.minHeight || 0; if (item.flex) { boxes[index].height = minHeight; } else { minHeights.push({ minHeight: minHeight, available: boxes[index].height - minHeight, index : index }); } } minHeights.sort(function(a, b) { return a.available > b.available ? 1 : -1; }); for (var i = 0, length = minHeights.length; i < length; i++) { var itemIndex = minHeights[i].index; if (itemIndex == undefined) { continue; } var item = visibleItems[itemIndex], box = boxes[itemIndex], oldHeight = box.height, minHeight = item.minHeight, newHeight = Math.max(minHeight, oldHeight - Math.ceil(shortfall / (length - i))), reduction = oldHeight - newHeight; boxes[itemIndex].height = newHeight; shortfall -= reduction; } } else { var remainingHeight = availableHeight, remainingFlex = totalFlex; for (i = 0; i < visibleCount; i++) { child = visibleItems[i]; calcs = boxes[i]; childMargins = child.margins; horizMargins = childMargins.left + childMargins.right; if (isStart && child.flex && !child.height) { flexedHeight = Math.ceil((child.flex / remainingFlex) * remainingHeight); remainingHeight -= flexedHeight; remainingFlex -= child.flex; calcs.height = flexedHeight; calcs.dirtySize = true; } } } } if (isCenter) { topOffset += availableHeight / 2; } else if (isEnd) { topOffset += availableHeight; } for (i = 0; i < visibleCount; i++) { child = visibleItems[i]; calcs = boxes[i]; childMargins = child.margins; topOffset += childMargins.top; horizMargins = childMargins.left + childMargins.right; calcs.left = leftOffset + childMargins.left; calcs.top = topOffset; switch (this.align) { case 'stretch': stretchWidth = availWidth - horizMargins; calcs.width = stretchWidth.constrain(child.minWidth || 0, child.maxWidth || 1000000); calcs.dirtySize = true; break; case 'stretchmax': stretchWidth = maxWidth - horizMargins; calcs.width = stretchWidth.constrain(child.minWidth || 0, child.maxWidth || 1000000); calcs.dirtySize = true; break; case 'center': var diff = availWidth - calcs.width - horizMargins; if (diff > 0) { calcs.left = leftOffset + horizMargins + (diff / 2); } } topOffset += calcs.height + childMargins.bottom; } return { boxes: boxes, meta : { maxWidth : maxWidth, nonFlexHeight: nonFlexHeight, desiredHeight: desiredHeight, minimumHeight: minimumHeight, shortfall : desiredHeight - height, tooNarrow : tooNarrow } }; } }); Ext.Container.LAYOUTS.vbox = Ext.layout.VBoxLayout; Ext.layout.ToolbarLayout = Ext.extend(Ext.layout.ContainerLayout, { monitorResize : true, type: 'toolbar', triggerWidth: 18, noItemsMenuText : '
    (None)
    ', lastOverflow: false, tableHTML: [ '', '', '', '', '', '', '', '
    ', '', '', '', '', '
    ', '
    ', '', '', '', '', '', '', '', '
    ', '', '', '', '', '
    ', '
    ', '', '', '', '', '
    ', '
    ', '
    ' ].join(""), onLayout : function(ct, target) { if (!this.leftTr) { var align = ct.buttonAlign == 'center' ? 'center' : 'left'; target.addClass('x-toolbar-layout-ct'); target.insertHtml('beforeEnd', String.format(this.tableHTML, align)); this.leftTr = target.child('tr.x-toolbar-left-row', true); this.rightTr = target.child('tr.x-toolbar-right-row', true); this.extrasTr = target.child('tr.x-toolbar-extras-row', true); if (this.hiddenItem == undefined) { this.hiddenItems = []; } } var side = ct.buttonAlign == 'right' ? this.rightTr : this.leftTr, items = ct.items.items, position = 0; for (var i = 0, len = items.length, c; i < len; i++, position++) { c = items[i]; if (c.isFill) { side = this.rightTr; position = -1; } else if (!c.rendered) { c.render(this.insertCell(c, side, position)); this.configureItem(c); } else { if (!c.xtbHidden && !this.isValidParent(c, side.childNodes[position])) { var td = this.insertCell(c, side, position); td.appendChild(c.getPositionEl().dom); c.container = Ext.get(td); } } } this.cleanup(this.leftTr); this.cleanup(this.rightTr); this.cleanup(this.extrasTr); this.fitToSize(target); }, cleanup : function(el) { var cn = el.childNodes, i, c; for (i = cn.length-1; i >= 0 && (c = cn[i]); i--) { if (!c.firstChild) { el.removeChild(c); } } }, insertCell : function(c, target, position) { var td = document.createElement('td'); td.className = 'x-toolbar-cell'; target.insertBefore(td, target.childNodes[position] || null); return td; }, hideItem : function(item) { this.hiddenItems.push(item); item.xtbHidden = true; item.xtbWidth = item.getPositionEl().dom.parentNode.offsetWidth; item.hide(); }, unhideItem : function(item) { item.show(); item.xtbHidden = false; this.hiddenItems.remove(item); }, getItemWidth : function(c) { return c.hidden ? (c.xtbWidth || 0) : c.getPositionEl().dom.parentNode.offsetWidth; }, fitToSize : function(target) { if (this.container.enableOverflow === false) { return; } var width = target.dom.clientWidth, tableWidth = target.dom.firstChild.offsetWidth, clipWidth = width - this.triggerWidth, lastWidth = this.lastWidth || 0, hiddenItems = this.hiddenItems, hasHiddens = hiddenItems.length != 0, isLarger = width >= lastWidth; this.lastWidth = width; if (tableWidth > width || (hasHiddens && isLarger)) { var items = this.container.items.items, len = items.length, loopWidth = 0, item; for (var i = 0; i < len; i++) { item = items[i]; if (!item.isFill) { loopWidth += this.getItemWidth(item); if (loopWidth > clipWidth) { if (!(item.hidden || item.xtbHidden)) { this.hideItem(item); } } else if (item.xtbHidden) { this.unhideItem(item); } } } } hasHiddens = hiddenItems.length != 0; if (hasHiddens) { this.initMore(); if (!this.lastOverflow) { this.container.fireEvent('overflowchange', this.container, true); this.lastOverflow = true; } } else if (this.more) { this.clearMenu(); this.more.destroy(); delete this.more; if (this.lastOverflow) { this.container.fireEvent('overflowchange', this.container, false); this.lastOverflow = false; } } }, createMenuConfig : function(component, hideOnClick){ var config = Ext.apply({}, component.initialConfig), group = component.toggleGroup; Ext.copyTo(config, component, [ 'iconCls', 'icon', 'itemId', 'disabled', 'handler', 'scope', 'menu' ]); Ext.apply(config, { text : component.overflowText || component.text, hideOnClick: hideOnClick }); if (group || component.enableToggle) { Ext.apply(config, { group : group, checked: component.pressed, listeners: { checkchange: function(item, checked){ component.toggle(checked); } } }); } delete config.ownerCt; delete config.xtype; delete config.id; return config; }, addComponentToMenu : function(menu, component) { if (component instanceof Ext.Toolbar.Separator) { menu.add('-'); } else if (Ext.isFunction(component.isXType)) { if (component.isXType('splitbutton')) { menu.add(this.createMenuConfig(component, true)); } else if (component.isXType('button')) { menu.add(this.createMenuConfig(component, !component.menu)); } else if (component.isXType('buttongroup')) { component.items.each(function(item){ this.addComponentToMenu(menu, item); }, this); } } }, clearMenu : function(){ var menu = this.moreMenu; if (menu && menu.items) { menu.items.each(function(item){ delete item.menu; }); } }, beforeMoreShow : function(menu) { var items = this.container.items.items, len = items.length, item, prev; var needsSep = function(group, item){ return group.isXType('buttongroup') && !(item instanceof Ext.Toolbar.Separator); }; this.clearMenu(); menu.removeAll(); for (var i = 0; i < len; i++) { item = items[i]; if (item.xtbHidden) { if (prev && (needsSep(item, prev) || needsSep(prev, item))) { menu.add('-'); } this.addComponentToMenu(menu, item); prev = item; } } if (menu.items.length < 1) { menu.add(this.noItemsMenuText); } }, initMore : function(){ if (!this.more) { this.moreMenu = new Ext.menu.Menu({ ownerCt : this.container, listeners: { beforeshow: this.beforeMoreShow, scope: this } }); this.more = new Ext.Button({ iconCls: 'x-toolbar-more-icon', cls : 'x-toolbar-more', menu : this.moreMenu, ownerCt: this.container }); var td = this.insertCell(this.more, this.extrasTr, 100); this.more.render(td); } }, destroy : function(){ Ext.destroy(this.more, this.moreMenu); delete this.leftTr; delete this.rightTr; delete this.extrasTr; Ext.layout.ToolbarLayout.superclass.destroy.call(this); } }); Ext.Container.LAYOUTS.toolbar = Ext.layout.ToolbarLayout; Ext.layout.MenuLayout = Ext.extend(Ext.layout.ContainerLayout, { monitorResize : true, type: 'menu', setContainer : function(ct){ this.monitorResize = !ct.floating; ct.on('autosize', this.doAutoSize, this); Ext.layout.MenuLayout.superclass.setContainer.call(this, ct); }, renderItem : function(c, position, target){ if (!this.itemTpl) { this.itemTpl = Ext.layout.MenuLayout.prototype.itemTpl = new Ext.XTemplate( '
  • ', '', '{altText}', '', '
  • ' ); } if(c && !c.rendered){ if(Ext.isNumber(position)){ position = target.dom.childNodes[position]; } var a = this.getItemArgs(c); c.render(c.positionEl = position ? this.itemTpl.insertBefore(position, a, true) : this.itemTpl.append(target, a, true)); c.positionEl.menuItemId = c.getItemId(); if (!a.isMenuItem && a.needsIcon) { c.positionEl.addClass('x-menu-list-item-indent'); } this.configureItem(c); }else if(c && !this.isValidParent(c, target)){ if(Ext.isNumber(position)){ position = target.dom.childNodes[position]; } target.dom.insertBefore(c.getActionEl().dom, position || null); } }, getItemArgs : function(c) { var isMenuItem = c instanceof Ext.menu.Item, canHaveIcon = !(isMenuItem || c instanceof Ext.menu.Separator); return { isMenuItem: isMenuItem, needsIcon: canHaveIcon && (c.icon || c.iconCls), icon: c.icon || Ext.BLANK_IMAGE_URL, iconCls: 'x-menu-item-icon ' + (c.iconCls || ''), itemId: 'x-menu-el-' + c.id, itemCls: 'x-menu-list-item ', altText: c.altText || '' }; }, isValidParent : function(c, target) { return c.el.up('li.x-menu-list-item', 5).dom.parentNode === (target.dom || target); }, onLayout : function(ct, target){ Ext.layout.MenuLayout.superclass.onLayout.call(this, ct, target); this.doAutoSize(); }, doAutoSize : function(){ var ct = this.container, w = ct.width; if(ct.floating){ if(w){ ct.setWidth(w); }else if(Ext.isIE){ ct.setWidth(Ext.isStrict && (Ext.isIE7 || Ext.isIE8 || Ext.isIE9) ? 'auto' : ct.minWidth); var el = ct.getEl(), t = el.dom.offsetWidth; ct.setWidth(ct.getLayoutTarget().getWidth() + el.getFrameWidth('lr')); } } } }); Ext.Container.LAYOUTS['menu'] = Ext.layout.MenuLayout; Ext.Viewport = Ext.extend(Ext.Container, { initComponent : function() { Ext.Viewport.superclass.initComponent.call(this); document.getElementsByTagName('html')[0].className += ' x-viewport'; this.el = Ext.getBody(); this.el.setHeight = Ext.emptyFn; this.el.setWidth = Ext.emptyFn; this.el.setSize = Ext.emptyFn; this.el.dom.scroll = 'no'; this.allowDomMove = false; this.autoWidth = true; this.autoHeight = true; Ext.EventManager.onWindowResize(this.fireResize, this); this.renderTo = this.el; }, fireResize : function(w, h){ this.fireEvent('resize', this, w, h, w, h); } }); Ext.reg('viewport', Ext.Viewport); Ext.Panel = Ext.extend(Ext.Container, { baseCls : 'x-panel', collapsedCls : 'x-panel-collapsed', maskDisabled : true, animCollapse : Ext.enableFx, headerAsText : true, buttonAlign : 'right', collapsed : false, collapseFirst : true, minButtonWidth : 75, elements : 'body', preventBodyReset : false, padding: undefined, resizeEvent: 'bodyresize', toolTarget : 'header', collapseEl : 'bwrap', slideAnchor : 't', disabledClass : '', deferHeight : true, expandDefaults: { duration : 0.25 }, collapseDefaults : { duration : 0.25 }, initComponent : function(){ Ext.Panel.superclass.initComponent.call(this); this.addEvents( 'bodyresize', 'titlechange', 'iconchange', 'collapse', 'expand', 'beforecollapse', 'beforeexpand', 'beforeclose', 'close', 'activate', 'deactivate' ); if(this.unstyled){ this.baseCls = 'x-plain'; } this.toolbars = []; if(this.tbar){ this.elements += ',tbar'; this.topToolbar = this.createToolbar(this.tbar); this.tbar = null; } if(this.bbar){ this.elements += ',bbar'; this.bottomToolbar = this.createToolbar(this.bbar); this.bbar = null; } if(this.header === true){ this.elements += ',header'; this.header = null; }else if(this.headerCfg || (this.title && this.header !== false)){ this.elements += ',header'; } if(this.footerCfg || this.footer === true){ this.elements += ',footer'; this.footer = null; } if(this.buttons){ this.fbar = this.buttons; this.buttons = null; } if(this.fbar){ this.createFbar(this.fbar); } if(this.autoLoad){ this.on('render', this.doAutoLoad, this, {delay:10}); } }, createFbar : function(fbar){ var min = this.minButtonWidth; this.elements += ',footer'; this.fbar = this.createToolbar(fbar, { buttonAlign: this.buttonAlign, toolbarCls: 'x-panel-fbar', enableOverflow: false, defaults: function(c){ return { minWidth: c.minWidth || min }; } }); this.fbar.items.each(function(c){ c.minWidth = c.minWidth || this.minButtonWidth; }, this); this.buttons = this.fbar.items.items; }, createToolbar: function(tb, options){ var result; if(Ext.isArray(tb)){ tb = { items: tb }; } result = tb.events ? Ext.apply(tb, options) : this.createComponent(Ext.apply({}, tb, options), 'toolbar'); this.toolbars.push(result); return result; }, createElement : function(name, pnode){ if(this[name]){ pnode.appendChild(this[name].dom); return; } if(name === 'bwrap' || this.elements.indexOf(name) != -1){ if(this[name+'Cfg']){ this[name] = Ext.fly(pnode).createChild(this[name+'Cfg']); }else{ var el = document.createElement('div'); el.className = this[name+'Cls']; this[name] = Ext.get(pnode.appendChild(el)); } if(this[name+'CssClass']){ this[name].addClass(this[name+'CssClass']); } if(this[name+'Style']){ this[name].applyStyles(this[name+'Style']); } } }, onRender : function(ct, position){ Ext.Panel.superclass.onRender.call(this, ct, position); this.createClasses(); var el = this.el, d = el.dom, bw, ts; if(this.collapsible && !this.hideCollapseTool){ this.tools = this.tools ? this.tools.slice(0) : []; this.tools[this.collapseFirst?'unshift':'push']({ id: 'toggle', handler : this.toggleCollapse, scope: this }); } if(this.tools){ ts = this.tools; this.elements += (this.header !== false) ? ',header' : ''; } this.tools = {}; el.addClass(this.baseCls); if(d.firstChild){ this.header = el.down('.'+this.headerCls); this.bwrap = el.down('.'+this.bwrapCls); var cp = this.bwrap ? this.bwrap : el; this.tbar = cp.down('.'+this.tbarCls); this.body = cp.down('.'+this.bodyCls); this.bbar = cp.down('.'+this.bbarCls); this.footer = cp.down('.'+this.footerCls); this.fromMarkup = true; } if (this.preventBodyReset === true) { el.addClass('x-panel-reset'); } if(this.cls){ el.addClass(this.cls); } if(this.buttons){ this.elements += ',footer'; } if(this.frame){ el.insertHtml('afterBegin', String.format(Ext.Element.boxMarkup, this.baseCls)); this.createElement('header', d.firstChild.firstChild.firstChild); this.createElement('bwrap', d); bw = this.bwrap.dom; var ml = d.childNodes[1], bl = d.childNodes[2]; bw.appendChild(ml); bw.appendChild(bl); var mc = bw.firstChild.firstChild.firstChild; this.createElement('tbar', mc); this.createElement('body', mc); this.createElement('bbar', mc); this.createElement('footer', bw.lastChild.firstChild.firstChild); if(!this.footer){ this.bwrap.dom.lastChild.className += ' x-panel-nofooter'; } this.ft = Ext.get(this.bwrap.dom.lastChild); this.mc = Ext.get(mc); }else{ this.createElement('header', d); this.createElement('bwrap', d); bw = this.bwrap.dom; this.createElement('tbar', bw); this.createElement('body', bw); this.createElement('bbar', bw); this.createElement('footer', bw); if(!this.header){ this.body.addClass(this.bodyCls + '-noheader'); if(this.tbar){ this.tbar.addClass(this.tbarCls + '-noheader'); } } } if(Ext.isDefined(this.padding)){ this.body.setStyle('padding', this.body.addUnits(this.padding)); } if(this.border === false){ this.el.addClass(this.baseCls + '-noborder'); this.body.addClass(this.bodyCls + '-noborder'); if(this.header){ this.header.addClass(this.headerCls + '-noborder'); } if(this.footer){ this.footer.addClass(this.footerCls + '-noborder'); } if(this.tbar){ this.tbar.addClass(this.tbarCls + '-noborder'); } if(this.bbar){ this.bbar.addClass(this.bbarCls + '-noborder'); } } if(this.bodyBorder === false){ this.body.addClass(this.bodyCls + '-noborder'); } this.bwrap.enableDisplayMode('block'); if(this.header){ this.header.unselectable(); if(this.headerAsText){ this.header.dom.innerHTML = ''+this.header.dom.innerHTML+''; if(this.iconCls){ this.setIconClass(this.iconCls); } } } if(this.floating){ this.makeFloating(this.floating); } if(this.collapsible && this.titleCollapse && this.header){ this.mon(this.header, 'click', this.toggleCollapse, this); this.header.setStyle('cursor', 'pointer'); } if(ts){ this.addTool.apply(this, ts); } if(this.fbar){ this.footer.addClass('x-panel-btns'); this.fbar.ownerCt = this; this.fbar.render(this.footer); this.footer.createChild({cls:'x-clear'}); } if(this.tbar && this.topToolbar){ this.topToolbar.ownerCt = this; this.topToolbar.render(this.tbar); } if(this.bbar && this.bottomToolbar){ this.bottomToolbar.ownerCt = this; this.bottomToolbar.render(this.bbar); } }, setIconClass : function(cls){ var old = this.iconCls; this.iconCls = cls; if(this.rendered && this.header){ if(this.frame){ this.header.addClass('x-panel-icon'); this.header.replaceClass(old, this.iconCls); }else{ var hd = this.header, img = hd.child('img.x-panel-inline-icon'); if(img){ Ext.fly(img).replaceClass(old, this.iconCls); }else{ var hdspan = hd.child('span.' + this.headerTextCls); if (hdspan) { Ext.DomHelper.insertBefore(hdspan.dom, { tag:'img', alt: '', src: Ext.BLANK_IMAGE_URL, cls:'x-panel-inline-icon '+this.iconCls }); } } } } this.fireEvent('iconchange', this, cls, old); }, makeFloating : function(cfg){ this.floating = true; this.el = new Ext.Layer(Ext.apply({}, cfg, { shadow: Ext.isDefined(this.shadow) ? this.shadow : 'sides', shadowOffset: this.shadowOffset, constrain:false, shim: this.shim === false ? false : undefined }), this.el); }, getTopToolbar : function(){ return this.topToolbar; }, getBottomToolbar : function(){ return this.bottomToolbar; }, getFooterToolbar : function() { return this.fbar; }, addButton : function(config, handler, scope){ if(!this.fbar){ this.createFbar([]); } if(handler){ if(Ext.isString(config)){ config = {text: config}; } config = Ext.apply({ handler: handler, scope: scope }, config); } return this.fbar.add(config); }, addTool : function(){ if(!this.rendered){ if(!this.tools){ this.tools = []; } Ext.each(arguments, function(arg){ this.tools.push(arg); }, this); return; } if(!this[this.toolTarget]){ return; } if(!this.toolTemplate){ var tt = new Ext.Template( '
     
    ' ); tt.disableFormats = true; tt.compile(); Ext.Panel.prototype.toolTemplate = tt; } for(var i = 0, a = arguments, len = a.length; i < len; i++) { var tc = a[i]; if(!this.tools[tc.id]){ var overCls = 'x-tool-'+tc.id+'-over'; var t = this.toolTemplate.insertFirst(this[this.toolTarget], tc, true); this.tools[tc.id] = t; t.enableDisplayMode('block'); this.mon(t, 'click', this.createToolHandler(t, tc, overCls, this)); if(tc.on){ this.mon(t, tc.on); } if(tc.hidden){ t.hide(); } if(tc.qtip){ if(Ext.isObject(tc.qtip)){ Ext.QuickTips.register(Ext.apply({ target: t.id }, tc.qtip)); } else { t.dom.qtip = tc.qtip; } } t.addClassOnOver(overCls); } } }, onLayout : function(shallow, force){ Ext.Panel.superclass.onLayout.apply(this, arguments); if(this.hasLayout && this.toolbars.length > 0){ Ext.each(this.toolbars, function(tb){ tb.doLayout(undefined, force); }); this.syncHeight(); } }, syncHeight : function(){ var h = this.toolbarHeight, bd = this.body, lsh = this.lastSize.height, sz; if(this.autoHeight || !Ext.isDefined(lsh) || lsh == 'auto'){ return; } if(h != this.getToolbarHeight()){ h = Math.max(0, lsh - this.getFrameHeight()); bd.setHeight(h); sz = bd.getSize(); this.toolbarHeight = this.getToolbarHeight(); this.onBodyResize(sz.width, sz.height); } }, onShow : function(){ if(this.floating){ return this.el.show(); } Ext.Panel.superclass.onShow.call(this); }, onHide : function(){ if(this.floating){ return this.el.hide(); } Ext.Panel.superclass.onHide.call(this); }, createToolHandler : function(t, tc, overCls, panel){ return function(e){ t.removeClass(overCls); if(tc.stopEvent !== false){ e.stopEvent(); } if(tc.handler){ tc.handler.call(tc.scope || t, e, t, panel, tc); } }; }, afterRender : function(){ if(this.floating && !this.hidden){ this.el.show(); } if(this.title){ this.setTitle(this.title); } Ext.Panel.superclass.afterRender.call(this); if (this.collapsed) { this.collapsed = false; this.collapse(false); } this.initEvents(); }, getKeyMap : function(){ if(!this.keyMap){ this.keyMap = new Ext.KeyMap(this.el, this.keys); } return this.keyMap; }, initEvents : function(){ if(this.keys){ this.getKeyMap(); } if(this.draggable){ this.initDraggable(); } if(this.toolbars.length > 0){ Ext.each(this.toolbars, function(tb){ tb.doLayout(); tb.on({ scope: this, afterlayout: this.syncHeight, remove: this.syncHeight }); }, this); this.syncHeight(); } }, initDraggable : function(){ this.dd = new Ext.Panel.DD(this, Ext.isBoolean(this.draggable) ? null : this.draggable); }, beforeEffect : function(anim){ if(this.floating){ this.el.beforeAction(); } if(anim !== false){ this.el.addClass('x-panel-animated'); } }, afterEffect : function(anim){ this.syncShadow(); this.el.removeClass('x-panel-animated'); }, createEffect : function(a, cb, scope){ var o = { scope:scope, block:true }; if(a === true){ o.callback = cb; return o; }else if(!a.callback){ o.callback = cb; }else { o.callback = function(){ cb.call(scope); Ext.callback(a.callback, a.scope); }; } return Ext.applyIf(o, a); }, collapse : function(animate){ if(this.collapsed || this.el.hasFxBlock() || this.fireEvent('beforecollapse', this, animate) === false){ return; } var doAnim = animate === true || (animate !== false && this.animCollapse); this.beforeEffect(doAnim); this.onCollapse(doAnim, animate); return this; }, onCollapse : function(doAnim, animArg){ if(doAnim){ this[this.collapseEl].slideOut(this.slideAnchor, Ext.apply(this.createEffect(animArg||true, this.afterCollapse, this), this.collapseDefaults)); }else{ this[this.collapseEl].hide(this.hideMode); this.afterCollapse(false); } }, afterCollapse : function(anim){ this.collapsed = true; this.el.addClass(this.collapsedCls); if(anim !== false){ this[this.collapseEl].hide(this.hideMode); } this.afterEffect(anim); this.cascade(function(c) { if (c.lastSize) { c.lastSize = { width: undefined, height: undefined }; } }); this.fireEvent('collapse', this); }, expand : function(animate){ if(!this.collapsed || this.el.hasFxBlock() || this.fireEvent('beforeexpand', this, animate) === false){ return; } var doAnim = animate === true || (animate !== false && this.animCollapse); this.el.removeClass(this.collapsedCls); this.beforeEffect(doAnim); this.onExpand(doAnim, animate); return this; }, onExpand : function(doAnim, animArg){ if(doAnim){ this[this.collapseEl].slideIn(this.slideAnchor, Ext.apply(this.createEffect(animArg||true, this.afterExpand, this), this.expandDefaults)); }else{ this[this.collapseEl].show(this.hideMode); this.afterExpand(false); } }, afterExpand : function(anim){ this.collapsed = false; if(anim !== false){ this[this.collapseEl].show(this.hideMode); } this.afterEffect(anim); if (this.deferLayout) { delete this.deferLayout; this.doLayout(true); } this.fireEvent('expand', this); }, toggleCollapse : function(animate){ this[this.collapsed ? 'expand' : 'collapse'](animate); return this; }, onDisable : function(){ if(this.rendered && this.maskDisabled){ this.el.mask(); } Ext.Panel.superclass.onDisable.call(this); }, onEnable : function(){ if(this.rendered && this.maskDisabled){ this.el.unmask(); } Ext.Panel.superclass.onEnable.call(this); }, onResize : function(adjWidth, adjHeight, rawWidth, rawHeight){ var w = adjWidth, h = adjHeight; if(Ext.isDefined(w) || Ext.isDefined(h)){ if(!this.collapsed){ if(Ext.isNumber(w)){ this.body.setWidth(w = this.adjustBodyWidth(w - this.getFrameWidth())); } else if (w == 'auto') { w = this.body.setWidth('auto').dom.offsetWidth; } else { w = this.body.dom.offsetWidth; } if(this.tbar){ this.tbar.setWidth(w); if(this.topToolbar){ this.topToolbar.setSize(w); } } if(this.bbar){ this.bbar.setWidth(w); if(this.bottomToolbar){ this.bottomToolbar.setSize(w); if (Ext.isIE) { this.bbar.setStyle('position', 'static'); this.bbar.setStyle('position', ''); } } } if(this.footer){ this.footer.setWidth(w); if(this.fbar){ this.fbar.setSize(Ext.isIE ? (w - this.footer.getFrameWidth('lr')) : 'auto'); } } if(Ext.isNumber(h)){ h = Math.max(0, h - this.getFrameHeight()); this.body.setHeight(h); }else if(h == 'auto'){ this.body.setHeight(h); } if(this.disabled && this.el._mask){ this.el._mask.setSize(this.el.dom.clientWidth, this.el.getHeight()); } }else{ this.queuedBodySize = {width: w, height: h}; if(!this.queuedExpand && this.allowQueuedExpand !== false){ this.queuedExpand = true; this.on('expand', function(){ delete this.queuedExpand; this.onResize(this.queuedBodySize.width, this.queuedBodySize.height); }, this, {single:true}); } } this.onBodyResize(w, h); } this.syncShadow(); Ext.Panel.superclass.onResize.call(this, adjWidth, adjHeight, rawWidth, rawHeight); }, onBodyResize: function(w, h){ this.fireEvent('bodyresize', this, w, h); }, getToolbarHeight: function(){ var h = 0; if(this.rendered){ Ext.each(this.toolbars, function(tb){ h += tb.getHeight(); }, this); } return h; }, adjustBodyHeight : function(h){ return h; }, adjustBodyWidth : function(w){ return w; }, onPosition : function(){ this.syncShadow(); }, getFrameWidth : function(){ var w = this.el.getFrameWidth('lr') + this.bwrap.getFrameWidth('lr'); if(this.frame){ var l = this.bwrap.dom.firstChild; w += (Ext.fly(l).getFrameWidth('l') + Ext.fly(l.firstChild).getFrameWidth('r')); w += this.mc.getFrameWidth('lr'); } return w; }, getFrameHeight : function() { var h = this.el.getFrameWidth('tb') + this.bwrap.getFrameWidth('tb'); h += (this.tbar ? this.tbar.getHeight() : 0) + (this.bbar ? this.bbar.getHeight() : 0); if(this.frame){ h += this.el.dom.firstChild.offsetHeight + this.ft.dom.offsetHeight + this.mc.getFrameWidth('tb'); }else{ h += (this.header ? this.header.getHeight() : 0) + (this.footer ? this.footer.getHeight() : 0); } return h; }, getInnerWidth : function(){ return this.getSize().width - this.getFrameWidth(); }, getInnerHeight : function(){ return this.body.getHeight(); }, syncShadow : function(){ if(this.floating){ this.el.sync(true); } }, getLayoutTarget : function(){ return this.body; }, getContentTarget : function(){ return this.body; }, setTitle : function(title, iconCls){ this.title = title; if(this.header && this.headerAsText){ this.header.child('span').update(title); } if(iconCls){ this.setIconClass(iconCls); } this.fireEvent('titlechange', this, title); return this; }, getUpdater : function(){ return this.body.getUpdater(); }, load : function(){ var um = this.body.getUpdater(); um.update.apply(um, arguments); return this; }, beforeDestroy : function(){ Ext.Panel.superclass.beforeDestroy.call(this); if(this.header){ this.header.removeAllListeners(); } if(this.tools){ for(var k in this.tools){ Ext.destroy(this.tools[k]); } } if(this.toolbars.length > 0){ Ext.each(this.toolbars, function(tb){ tb.un('afterlayout', this.syncHeight, this); tb.un('remove', this.syncHeight, this); }, this); } if(Ext.isArray(this.buttons)){ while(this.buttons.length) { Ext.destroy(this.buttons[0]); } } if(this.rendered){ Ext.destroy( this.ft, this.header, this.footer, this.tbar, this.bbar, this.body, this.mc, this.bwrap, this.dd ); if (this.fbar) { Ext.destroy( this.fbar, this.fbar.el ); } } Ext.destroy(this.toolbars); }, createClasses : function(){ this.headerCls = this.baseCls + '-header'; this.headerTextCls = this.baseCls + '-header-text'; this.bwrapCls = this.baseCls + '-bwrap'; this.tbarCls = this.baseCls + '-tbar'; this.bodyCls = this.baseCls + '-body'; this.bbarCls = this.baseCls + '-bbar'; this.footerCls = this.baseCls + '-footer'; }, createGhost : function(cls, useShim, appendTo){ var el = document.createElement('div'); el.className = 'x-panel-ghost ' + (cls ? cls : ''); if(this.header){ el.appendChild(this.el.dom.firstChild.cloneNode(true)); } Ext.fly(el.appendChild(document.createElement('ul'))).setHeight(this.bwrap.getHeight()); el.style.width = this.el.dom.offsetWidth + 'px';; if(!appendTo){ this.container.dom.appendChild(el); }else{ Ext.getDom(appendTo).appendChild(el); } if(useShim !== false && this.el.useShim !== false){ var layer = new Ext.Layer({shadow:false, useDisplay:true, constrain:false}, el); layer.show(); return layer; }else{ return new Ext.Element(el); } }, doAutoLoad : function(){ var u = this.body.getUpdater(); if(this.renderer){ u.setRenderer(this.renderer); } u.update(Ext.isObject(this.autoLoad) ? this.autoLoad : {url: this.autoLoad}); }, getTool : function(id) { return this.tools[id]; } }); Ext.reg('panel', Ext.Panel); Ext.Editor = function(field, config){ if(field.field){ this.field = Ext.create(field.field, 'textfield'); config = Ext.apply({}, field); delete config.field; }else{ this.field = field; } Ext.Editor.superclass.constructor.call(this, config); }; Ext.extend(Ext.Editor, Ext.Component, { allowBlur: true, value : "", alignment: "c-c?", offsets: [0, 0], shadow : "frame", constrain : false, swallowKeys : true, completeOnEnter : true, cancelOnEsc : true, updateEl : false, initComponent : function(){ Ext.Editor.superclass.initComponent.call(this); this.addEvents( "beforestartedit", "startedit", "beforecomplete", "complete", "canceledit", "specialkey" ); }, onRender : function(ct, position){ this.el = new Ext.Layer({ shadow: this.shadow, cls: "x-editor", parentEl : ct, shim : this.shim, shadowOffset: this.shadowOffset || 4, id: this.id, constrain: this.constrain }); if(this.zIndex){ this.el.setZIndex(this.zIndex); } this.el.setStyle("overflow", Ext.isGecko ? "auto" : "hidden"); if(this.field.msgTarget != 'title'){ this.field.msgTarget = 'qtip'; } this.field.inEditor = true; this.mon(this.field, { scope: this, blur: this.onBlur, specialkey: this.onSpecialKey }); if(this.field.grow){ this.mon(this.field, "autosize", this.el.sync, this.el, {delay:1}); } this.field.render(this.el).show(); this.field.getEl().dom.name = ''; if(this.swallowKeys){ this.field.el.swallowEvent([ 'keypress', 'keydown' ]); } }, onSpecialKey : function(field, e){ var key = e.getKey(), complete = this.completeOnEnter && key == e.ENTER, cancel = this.cancelOnEsc && key == e.ESC; if(complete || cancel){ e.stopEvent(); if(complete){ this.completeEdit(); }else{ this.cancelEdit(); } if(field.triggerBlur){ field.triggerBlur(); } } this.fireEvent('specialkey', field, e); }, startEdit : function(el, value){ if(this.editing){ this.completeEdit(); } this.boundEl = Ext.get(el); var v = value !== undefined ? value : this.boundEl.dom.innerHTML; if(!this.rendered){ this.render(this.parentEl || document.body); } if(this.fireEvent("beforestartedit", this, this.boundEl, v) !== false){ this.startValue = v; this.field.reset(); this.field.setValue(v); this.realign(true); this.editing = true; this.show(); } }, doAutoSize : function(){ if(this.autoSize){ var sz = this.boundEl.getSize(), fs = this.field.getSize(); switch(this.autoSize){ case "width": this.setSize(sz.width, fs.height); break; case "height": this.setSize(fs.width, sz.height); break; case "none": this.setSize(fs.width, fs.height); break; default: this.setSize(sz.width, sz.height); } } }, setSize : function(w, h){ delete this.field.lastSize; this.field.setSize(w, h); if(this.el){ if(Ext.isGecko2 || Ext.isOpera || (Ext.isIE7 && Ext.isStrict)){ this.el.setSize(w, h); } this.el.sync(); } }, realign : function(autoSize){ if(autoSize === true){ this.doAutoSize(); } this.el.alignTo(this.boundEl, this.alignment, this.offsets); }, completeEdit : function(remainVisible){ if(!this.editing){ return; } if (this.field.assertValue) { this.field.assertValue(); } var v = this.getValue(); if(!this.field.isValid()){ if(this.revertInvalid !== false){ this.cancelEdit(remainVisible); } return; } if(String(v) === String(this.startValue) && this.ignoreNoChange){ this.hideEdit(remainVisible); return; } if(this.fireEvent("beforecomplete", this, v, this.startValue) !== false){ v = this.getValue(); if(this.updateEl && this.boundEl){ this.boundEl.update(v); } this.hideEdit(remainVisible); this.fireEvent("complete", this, v, this.startValue); } }, onShow : function(){ this.el.show(); if(this.hideEl !== false){ this.boundEl.hide(); } this.field.show().focus(false, true); this.fireEvent("startedit", this.boundEl, this.startValue); }, cancelEdit : function(remainVisible){ if(this.editing){ var v = this.getValue(); this.setValue(this.startValue); this.hideEdit(remainVisible); this.fireEvent("canceledit", this, v, this.startValue); } }, hideEdit: function(remainVisible){ if(remainVisible !== true){ this.editing = false; this.hide(); } }, onBlur : function(){ if(this.allowBlur === true && this.editing && this.selectSameEditor !== true){ this.completeEdit(); } }, onHide : function(){ if(this.editing){ this.completeEdit(); return; } this.field.blur(); if(this.field.collapse){ this.field.collapse(); } this.el.hide(); if(this.hideEl !== false){ this.boundEl.show(); } }, setValue : function(v){ this.field.setValue(v); }, getValue : function(){ return this.field.getValue(); }, beforeDestroy : function(){ Ext.destroyMembers(this, 'field'); delete this.parentEl; delete this.boundEl; } }); Ext.reg('editor', Ext.Editor); Ext.ColorPalette = Ext.extend(Ext.Component, { itemCls : 'x-color-palette', value : null, clickEvent :'click', ctype : 'Ext.ColorPalette', allowReselect : false, colors : [ '000000', '993300', '333300', '003300', '003366', '000080', '333399', '333333', '800000', 'FF6600', '808000', '008000', '008080', '0000FF', '666699', '808080', 'FF0000', 'FF9900', '99CC00', '339966', '33CCCC', '3366FF', '800080', '969696', 'FF00FF', 'FFCC00', 'FFFF00', '00FF00', '00FFFF', '00CCFF', '993366', 'C0C0C0', 'FF99CC', 'FFCC99', 'FFFF99', 'CCFFCC', 'CCFFFF', '99CCFF', 'CC99FF', 'FFFFFF' ], initComponent : function(){ Ext.ColorPalette.superclass.initComponent.call(this); this.addEvents( 'select' ); if(this.handler){ this.on('select', this.handler, this.scope, true); } }, onRender : function(container, position){ this.autoEl = { tag: 'div', cls: this.itemCls }; Ext.ColorPalette.superclass.onRender.call(this, container, position); var t = this.tpl || new Ext.XTemplate( ' ' ); t.overwrite(this.el, this.colors); this.mon(this.el, this.clickEvent, this.handleClick, this, {delegate: 'a'}); if(this.clickEvent != 'click'){ this.mon(this.el, 'click', Ext.emptyFn, this, {delegate: 'a', preventDefault: true}); } }, afterRender : function(){ Ext.ColorPalette.superclass.afterRender.call(this); if(this.value){ var s = this.value; this.value = null; this.select(s, true); } }, handleClick : function(e, t){ e.preventDefault(); if(!this.disabled){ var c = t.className.match(/(?:^|\s)color-(.{6})(?:\s|$)/)[1]; this.select(c.toUpperCase()); } }, select : function(color, suppressEvent){ color = color.replace('#', ''); if(color != this.value || this.allowReselect){ var el = this.el; if(this.value){ el.child('a.color-'+this.value).removeClass('x-color-palette-sel'); } el.child('a.color-'+color).addClass('x-color-palette-sel'); this.value = color; if(suppressEvent !== true){ this.fireEvent('select', this, color); } } } }); Ext.reg('colorpalette', Ext.ColorPalette); Ext.DatePicker = Ext.extend(Ext.BoxComponent, { todayText : 'Today', okText : ' OK ', cancelText : 'Cancel', todayTip : '{0} (Spacebar)', minText : 'This date is before the minimum date', maxText : 'This date is after the maximum date', format : 'm/d/y', disabledDaysText : 'Disabled', disabledDatesText : 'Disabled', monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Next Month (Control+Right)', prevText : 'Previous Month (Control+Left)', monthYearText : 'Choose a month (Control+Up/Down to move years)', startDay : 0, showToday : true, focusOnSelect: true, initHour: 12, initComponent : function(){ Ext.DatePicker.superclass.initComponent.call(this); this.value = this.value ? this.value.clearTime(true) : new Date().clearTime(); this.addEvents( 'select' ); if(this.handler){ this.on('select', this.handler, this.scope || this); } this.initDisabledDays(); }, initDisabledDays : function(){ if(!this.disabledDatesRE && this.disabledDates){ var dd = this.disabledDates, len = dd.length - 1, re = '(?:'; Ext.each(dd, function(d, i){ re += Ext.isDate(d) ? '^' + Ext.escapeRe(d.dateFormat(this.format)) + '$' : dd[i]; if(i != len){ re += '|'; } }, this); this.disabledDatesRE = new RegExp(re + ')'); } }, setDisabledDates : function(dd){ if(Ext.isArray(dd)){ this.disabledDates = dd; this.disabledDatesRE = null; }else{ this.disabledDatesRE = dd; } this.initDisabledDays(); this.update(this.value, true); }, setDisabledDays : function(dd){ this.disabledDays = dd; this.update(this.value, true); }, setMinDate : function(dt){ this.minDate = dt; this.update(this.value, true); }, setMaxDate : function(dt){ this.maxDate = dt; this.update(this.value, true); }, setValue : function(value){ this.value = value.clearTime(true); this.update(this.value); }, getValue : function(){ return this.value; }, focus : function(){ this.update(this.activeDate); }, onEnable: function(initial){ Ext.DatePicker.superclass.onEnable.call(this); this.doDisabled(false); this.update(initial ? this.value : this.activeDate); if(Ext.isIE){ this.el.repaint(); } }, onDisable : function(){ Ext.DatePicker.superclass.onDisable.call(this); this.doDisabled(true); if(Ext.isIE && !Ext.isIE8){ Ext.each([].concat(this.textNodes, this.el.query('th span')), function(el){ Ext.fly(el).repaint(); }); } }, doDisabled : function(disabled){ this.keyNav.setDisabled(disabled); this.prevRepeater.setDisabled(disabled); this.nextRepeater.setDisabled(disabled); if(this.showToday){ this.todayKeyListener.setDisabled(disabled); this.todayBtn.setDisabled(disabled); } }, onRender : function(container, position){ var m = [ '', '', '', this.showToday ? '' : '', '
      
    '], dn = this.dayNames, i; for(i = 0; i < 7; i++){ var d = this.startDay+i; if(d > 6){ d = d-7; } m.push(''); } m[m.length] = ''; for(i = 0; i < 42; i++) { if(i % 7 === 0 && i !== 0){ m[m.length] = ''; } m[m.length] = ''; } m.push('
    ', dn[d].substr(0,1), '
    '); var el = document.createElement('div'); el.className = 'x-date-picker'; el.innerHTML = m.join(''); container.dom.insertBefore(el, position); this.el = Ext.get(el); this.eventEl = Ext.get(el.firstChild); this.prevRepeater = new Ext.util.ClickRepeater(this.el.child('td.x-date-left a'), { handler: this.showPrevMonth, scope: this, preventDefault:true, stopDefault:true }); this.nextRepeater = new Ext.util.ClickRepeater(this.el.child('td.x-date-right a'), { handler: this.showNextMonth, scope: this, preventDefault:true, stopDefault:true }); this.monthPicker = this.el.down('div.x-date-mp'); this.monthPicker.enableDisplayMode('block'); this.keyNav = new Ext.KeyNav(this.eventEl, { 'left' : function(e){ if(e.ctrlKey){ this.showPrevMonth(); }else{ this.update(this.activeDate.add('d', -1)); } }, 'right' : function(e){ if(e.ctrlKey){ this.showNextMonth(); }else{ this.update(this.activeDate.add('d', 1)); } }, 'up' : function(e){ if(e.ctrlKey){ this.showNextYear(); }else{ this.update(this.activeDate.add('d', -7)); } }, 'down' : function(e){ if(e.ctrlKey){ this.showPrevYear(); }else{ this.update(this.activeDate.add('d', 7)); } }, 'pageUp' : function(e){ this.showNextMonth(); }, 'pageDown' : function(e){ this.showPrevMonth(); }, 'enter' : function(e){ e.stopPropagation(); return true; }, scope : this }); this.el.unselectable(); this.cells = this.el.select('table.x-date-inner tbody td'); this.textNodes = this.el.query('table.x-date-inner tbody span'); this.mbtn = new Ext.Button({ text: ' ', tooltip: this.monthYearText, renderTo: this.el.child('td.x-date-middle', true) }); this.mbtn.el.child('em').addClass('x-btn-arrow'); if(this.showToday){ this.todayKeyListener = this.eventEl.addKeyListener(Ext.EventObject.SPACE, this.selectToday, this); var today = (new Date()).dateFormat(this.format); this.todayBtn = new Ext.Button({ renderTo: this.el.child('td.x-date-bottom', true), text: String.format(this.todayText, today), tooltip: String.format(this.todayTip, today), handler: this.selectToday, scope: this }); } this.mon(this.eventEl, 'mousewheel', this.handleMouseWheel, this); this.mon(this.eventEl, 'click', this.handleDateClick, this, {delegate: 'a.x-date-date'}); this.mon(this.mbtn, 'click', this.showMonthPicker, this); this.onEnable(true); }, createMonthPicker : function(){ if(!this.monthPicker.dom.firstChild){ var buf = ['']; for(var i = 0; i < 6; i++){ buf.push( '', '', i === 0 ? '' : '' ); } buf.push( '', '
    ', Date.getShortMonthName(i), '', Date.getShortMonthName(i + 6), '
    ' ); this.monthPicker.update(buf.join('')); this.mon(this.monthPicker, 'click', this.onMonthClick, this); this.mon(this.monthPicker, 'dblclick', this.onMonthDblClick, this); this.mpMonths = this.monthPicker.select('td.x-date-mp-month'); this.mpYears = this.monthPicker.select('td.x-date-mp-year'); this.mpMonths.each(function(m, a, i){ i += 1; if((i%2) === 0){ m.dom.xmonth = 5 + Math.round(i * 0.5); }else{ m.dom.xmonth = Math.round((i-1) * 0.5); } }); } }, showMonthPicker : function(){ if(!this.disabled){ this.createMonthPicker(); var size = this.el.getSize(); this.monthPicker.setSize(size); this.monthPicker.child('table').setSize(size); this.mpSelMonth = (this.activeDate || this.value).getMonth(); this.updateMPMonth(this.mpSelMonth); this.mpSelYear = (this.activeDate || this.value).getFullYear(); this.updateMPYear(this.mpSelYear); this.monthPicker.slideIn('t', {duration:0.2}); } }, updateMPYear : function(y){ this.mpyear = y; var ys = this.mpYears.elements; for(var i = 1; i <= 10; i++){ var td = ys[i-1], y2; if((i%2) === 0){ y2 = y + Math.round(i * 0.5); td.firstChild.innerHTML = y2; td.xyear = y2; }else{ y2 = y - (5-Math.round(i * 0.5)); td.firstChild.innerHTML = y2; td.xyear = y2; } this.mpYears.item(i-1)[y2 == this.mpSelYear ? 'addClass' : 'removeClass']('x-date-mp-sel'); } }, updateMPMonth : function(sm){ this.mpMonths.each(function(m, a, i){ m[m.dom.xmonth == sm ? 'addClass' : 'removeClass']('x-date-mp-sel'); }); }, selectMPMonth : function(m){ }, onMonthClick : function(e, t){ e.stopEvent(); var el = new Ext.Element(t), pn; if(el.is('button.x-date-mp-cancel')){ this.hideMonthPicker(); } else if(el.is('button.x-date-mp-ok')){ var d = new Date(this.mpSelYear, this.mpSelMonth, (this.activeDate || this.value).getDate()); if(d.getMonth() != this.mpSelMonth){ d = new Date(this.mpSelYear, this.mpSelMonth, 1).getLastDateOfMonth(); } this.update(d); this.hideMonthPicker(); } else if((pn = el.up('td.x-date-mp-month', 2))){ this.mpMonths.removeClass('x-date-mp-sel'); pn.addClass('x-date-mp-sel'); this.mpSelMonth = pn.dom.xmonth; } else if((pn = el.up('td.x-date-mp-year', 2))){ this.mpYears.removeClass('x-date-mp-sel'); pn.addClass('x-date-mp-sel'); this.mpSelYear = pn.dom.xyear; } else if(el.is('a.x-date-mp-prev')){ this.updateMPYear(this.mpyear-10); } else if(el.is('a.x-date-mp-next')){ this.updateMPYear(this.mpyear+10); } }, onMonthDblClick : function(e, t){ e.stopEvent(); var el = new Ext.Element(t), pn; if((pn = el.up('td.x-date-mp-month', 2))){ this.update(new Date(this.mpSelYear, pn.dom.xmonth, (this.activeDate || this.value).getDate())); this.hideMonthPicker(); } else if((pn = el.up('td.x-date-mp-year', 2))){ this.update(new Date(pn.dom.xyear, this.mpSelMonth, (this.activeDate || this.value).getDate())); this.hideMonthPicker(); } }, hideMonthPicker : function(disableAnim){ if(this.monthPicker){ if(disableAnim === true){ this.monthPicker.hide(); }else{ this.monthPicker.slideOut('t', {duration:0.2}); } } }, showPrevMonth : function(e){ this.update(this.activeDate.add('mo', -1)); }, showNextMonth : function(e){ this.update(this.activeDate.add('mo', 1)); }, showPrevYear : function(){ this.update(this.activeDate.add('y', -1)); }, showNextYear : function(){ this.update(this.activeDate.add('y', 1)); }, handleMouseWheel : function(e){ e.stopEvent(); if(!this.disabled){ var delta = e.getWheelDelta(); if(delta > 0){ this.showPrevMonth(); } else if(delta < 0){ this.showNextMonth(); } } }, handleDateClick : function(e, t){ e.stopEvent(); if(!this.disabled && t.dateValue && !Ext.fly(t.parentNode).hasClass('x-date-disabled')){ this.cancelFocus = this.focusOnSelect === false; this.setValue(new Date(t.dateValue)); delete this.cancelFocus; this.fireEvent('select', this, this.value); } }, selectToday : function(){ if(this.todayBtn && !this.todayBtn.disabled){ this.setValue(new Date().clearTime()); this.fireEvent('select', this, this.value); } }, update : function(date, forceRefresh){ if(this.rendered){ var vd = this.activeDate, vis = this.isVisible(); this.activeDate = date; if(!forceRefresh && vd && this.el){ var t = date.getTime(); if(vd.getMonth() == date.getMonth() && vd.getFullYear() == date.getFullYear()){ this.cells.removeClass('x-date-selected'); this.cells.each(function(c){ if(c.dom.firstChild.dateValue == t){ c.addClass('x-date-selected'); if(vis && !this.cancelFocus){ Ext.fly(c.dom.firstChild).focus(50); } return false; } }, this); return; } } var days = date.getDaysInMonth(), firstOfMonth = date.getFirstDateOfMonth(), startingPos = firstOfMonth.getDay()-this.startDay; if(startingPos < 0){ startingPos += 7; } days += startingPos; var pm = date.add('mo', -1), prevStart = pm.getDaysInMonth()-startingPos, cells = this.cells.elements, textEls = this.textNodes, d = (new Date(pm.getFullYear(), pm.getMonth(), prevStart, this.initHour)), today = new Date().clearTime().getTime(), sel = date.clearTime(true).getTime(), min = this.minDate ? this.minDate.clearTime(true) : Number.NEGATIVE_INFINITY, max = this.maxDate ? this.maxDate.clearTime(true) : Number.POSITIVE_INFINITY, ddMatch = this.disabledDatesRE, ddText = this.disabledDatesText, ddays = this.disabledDays ? this.disabledDays.join('') : false, ddaysText = this.disabledDaysText, format = this.format; if(this.showToday){ var td = new Date().clearTime(), disable = (td < min || td > max || (ddMatch && format && ddMatch.test(td.dateFormat(format))) || (ddays && ddays.indexOf(td.getDay()) != -1)); if(!this.disabled){ this.todayBtn.setDisabled(disable); this.todayKeyListener[disable ? 'disable' : 'enable'](); } } var setCellClass = function(cal, cell){ cell.title = ''; var t = d.clearTime(true).getTime(); cell.firstChild.dateValue = t; if(t == today){ cell.className += ' x-date-today'; cell.title = cal.todayText; } if(t == sel){ cell.className += ' x-date-selected'; if(vis){ Ext.fly(cell.firstChild).focus(50); } } if(t < min) { cell.className = ' x-date-disabled'; cell.title = cal.minText; return; } if(t > max) { cell.className = ' x-date-disabled'; cell.title = cal.maxText; return; } if(ddays){ if(ddays.indexOf(d.getDay()) != -1){ cell.title = ddaysText; cell.className = ' x-date-disabled'; } } if(ddMatch && format){ var fvalue = d.dateFormat(format); if(ddMatch.test(fvalue)){ cell.title = ddText.replace('%0', fvalue); cell.className = ' x-date-disabled'; } } }; var i = 0; for(; i < startingPos; i++) { textEls[i].innerHTML = (++prevStart); d.setDate(d.getDate()+1); cells[i].className = 'x-date-prevday'; setCellClass(this, cells[i]); } for(; i < days; i++){ var intDay = i - startingPos + 1; textEls[i].innerHTML = (intDay); d.setDate(d.getDate()+1); cells[i].className = 'x-date-active'; setCellClass(this, cells[i]); } var extraDays = 0; for(; i < 42; i++) { textEls[i].innerHTML = (++extraDays); d.setDate(d.getDate()+1); cells[i].className = 'x-date-nextday'; setCellClass(this, cells[i]); } this.mbtn.setText(this.monthNames[date.getMonth()] + ' ' + date.getFullYear()); if(!this.internalRender){ var main = this.el.dom.firstChild, w = main.offsetWidth; this.el.setWidth(w + this.el.getBorderWidth('lr')); Ext.fly(main).setWidth(w); this.internalRender = true; if(Ext.isOpera && !this.secondPass){ main.rows[0].cells[1].style.width = (w - (main.rows[0].cells[0].offsetWidth+main.rows[0].cells[2].offsetWidth)) + 'px'; this.secondPass = true; this.update.defer(10, this, [date]); } } } }, beforeDestroy : function() { if(this.rendered){ Ext.destroy( this.keyNav, this.monthPicker, this.eventEl, this.mbtn, this.nextRepeater, this.prevRepeater, this.cells.el, this.todayBtn ); delete this.textNodes; delete this.cells.elements; } } }); Ext.reg('datepicker', Ext.DatePicker); Ext.LoadMask = function(el, config){ this.el = Ext.get(el); Ext.apply(this, config); if(this.store){ this.store.on({ scope: this, beforeload: this.onBeforeLoad, load: this.onLoad, exception: this.onLoad }); this.removeMask = Ext.value(this.removeMask, false); }else{ var um = this.el.getUpdater(); um.showLoadIndicator = false; um.on({ scope: this, beforeupdate: this.onBeforeLoad, update: this.onLoad, failure: this.onLoad }); this.removeMask = Ext.value(this.removeMask, true); } }; Ext.LoadMask.prototype = { msg : 'Loading...', msgCls : 'x-mask-loading', disabled: false, disable : function(){ this.disabled = true; }, enable : function(){ this.disabled = false; }, onLoad : function(){ this.el.unmask(this.removeMask); }, onBeforeLoad : function(){ if(!this.disabled){ this.el.mask(this.msg, this.msgCls); } }, show: function(){ this.onBeforeLoad(); }, hide: function(){ this.onLoad(); }, destroy : function(){ if(this.store){ this.store.un('beforeload', this.onBeforeLoad, this); this.store.un('load', this.onLoad, this); this.store.un('exception', this.onLoad, this); }else{ var um = this.el.getUpdater(); um.un('beforeupdate', this.onBeforeLoad, this); um.un('update', this.onLoad, this); um.un('failure', this.onLoad, this); } } }; Ext.slider.Thumb = Ext.extend(Object, { dragging: false, constructor: function(config) { Ext.apply(this, config || {}, { cls: 'x-slider-thumb', constrain: false }); Ext.slider.Thumb.superclass.constructor.call(this, config); if (this.slider.vertical) { Ext.apply(this, Ext.slider.Thumb.Vertical); } }, render: function() { this.el = this.slider.innerEl.insertFirst({cls: this.cls}); this.initEvents(); }, enable: function() { this.disabled = false; this.el.removeClass(this.slider.disabledClass); }, disable: function() { this.disabled = true; this.el.addClass(this.slider.disabledClass); }, initEvents: function() { var el = this.el; el.addClassOnOver('x-slider-thumb-over'); this.tracker = new Ext.dd.DragTracker({ onBeforeStart: this.onBeforeDragStart.createDelegate(this), onStart : this.onDragStart.createDelegate(this), onDrag : this.onDrag.createDelegate(this), onEnd : this.onDragEnd.createDelegate(this), tolerance : 3, autoStart : 300 }); this.tracker.initEl(el); }, onBeforeDragStart : function(e) { if (this.disabled) { return false; } else { this.slider.promoteThumb(this); return true; } }, onDragStart: function(e){ this.el.addClass('x-slider-thumb-drag'); this.dragging = true; this.dragStartValue = this.value; this.slider.fireEvent('dragstart', this.slider, e, this); }, onDrag: function(e) { var slider = this.slider, index = this.index, newValue = this.getNewValue(); if (this.constrain) { var above = slider.thumbs[index + 1], below = slider.thumbs[index - 1]; if (below != undefined && newValue <= below.value) newValue = below.value; if (above != undefined && newValue >= above.value) newValue = above.value; } slider.setValue(index, newValue, false); slider.fireEvent('drag', slider, e, this); }, getNewValue: function() { var slider = this.slider, pos = slider.innerEl.translatePoints(this.tracker.getXY()); return Ext.util.Format.round(slider.reverseValue(pos.left), slider.decimalPrecision); }, onDragEnd: function(e) { var slider = this.slider, value = this.value; this.el.removeClass('x-slider-thumb-drag'); this.dragging = false; slider.fireEvent('dragend', slider, e); if (this.dragStartValue != value) { slider.fireEvent('changecomplete', slider, value, this); } }, destroy: function(){ Ext.destroyMembers(this, 'tracker', 'el'); } }); Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, { vertical: false, minValue: 0, maxValue: 100, decimalPrecision: 0, keyIncrement: 1, increment: 0, clickRange: [5,15], clickToChange : true, animate: true, constrainThumbs: true, topThumbZIndex: 10000, initComponent : function(){ if(!Ext.isDefined(this.value)){ this.value = this.minValue; } this.thumbs = []; Ext.slider.MultiSlider.superclass.initComponent.call(this); this.keyIncrement = Math.max(this.increment, this.keyIncrement); this.addEvents( 'beforechange', 'change', 'changecomplete', 'dragstart', 'drag', 'dragend' ); if (this.values == undefined || Ext.isEmpty(this.values)) this.values = [0]; var values = this.values; for (var i=0; i < values.length; i++) { this.addThumb(values[i]); } if(this.vertical){ Ext.apply(this, Ext.slider.Vertical); } }, addThumb: function(value) { var thumb = new Ext.slider.Thumb({ value : value, slider : this, index : this.thumbs.length, constrain: this.constrainThumbs }); this.thumbs.push(thumb); if (this.rendered) thumb.render(); }, promoteThumb: function(topThumb) { var thumbs = this.thumbs, zIndex, thumb; for (var i = 0, j = thumbs.length; i < j; i++) { thumb = thumbs[i]; if (thumb == topThumb) { zIndex = this.topThumbZIndex; } else { zIndex = ''; } thumb.el.setStyle('zIndex', zIndex); } }, onRender : function() { this.autoEl = { cls: 'x-slider ' + (this.vertical ? 'x-slider-vert' : 'x-slider-horz'), cn : { cls: 'x-slider-end', cn : { cls:'x-slider-inner', cn : [{tag:'a', cls:'x-slider-focus', href:"#", tabIndex: '-1', hidefocus:'on'}] } } }; Ext.slider.MultiSlider.superclass.onRender.apply(this, arguments); this.endEl = this.el.first(); this.innerEl = this.endEl.first(); this.focusEl = this.innerEl.child('.x-slider-focus'); for (var i=0; i < this.thumbs.length; i++) { this.thumbs[i].render(); } var thumb = this.innerEl.child('.x-slider-thumb'); this.halfThumb = (this.vertical ? thumb.getHeight() : thumb.getWidth()) / 2; this.initEvents(); }, initEvents : function(){ this.mon(this.el, { scope : this, mousedown: this.onMouseDown, keydown : this.onKeyDown }); this.focusEl.swallowEvent("click", true); }, onMouseDown : function(e){ if(this.disabled){ return; } var thumbClicked = false; for (var i=0; i < this.thumbs.length; i++) { thumbClicked = thumbClicked || e.target == this.thumbs[i].el.dom; } if (this.clickToChange && !thumbClicked) { var local = this.innerEl.translatePoints(e.getXY()); this.onClickChange(local); } this.focus(); }, onClickChange : function(local) { if (local.top > this.clickRange[0] && local.top < this.clickRange[1]) { var thumb = this.getNearest(local, 'left'), index = thumb.index; this.setValue(index, Ext.util.Format.round(this.reverseValue(local.left), this.decimalPrecision), undefined, true); } }, getNearest: function(local, prop) { var localValue = prop == 'top' ? this.innerEl.getHeight() - local[prop] : local[prop], clickValue = this.reverseValue(localValue), nearestDistance = (this.maxValue - this.minValue) + 5, index = 0, nearest = null; for (var i=0; i < this.thumbs.length; i++) { var thumb = this.thumbs[i], value = thumb.value, dist = Math.abs(value - clickValue); if (Math.abs(dist <= nearestDistance)) { nearest = thumb; index = i; nearestDistance = dist; } } return nearest; }, onKeyDown : function(e){ if(this.disabled || this.thumbs.length !== 1){ e.preventDefault(); return; } var k = e.getKey(), val; switch(k){ case e.UP: case e.RIGHT: e.stopEvent(); val = e.ctrlKey ? this.maxValue : this.getValue(0) + this.keyIncrement; this.setValue(0, val, undefined, true); break; case e.DOWN: case e.LEFT: e.stopEvent(); val = e.ctrlKey ? this.minValue : this.getValue(0) - this.keyIncrement; this.setValue(0, val, undefined, true); break; default: e.preventDefault(); } }, doSnap : function(value){ if (!(this.increment && value)) { return value; } var newValue = value, inc = this.increment, m = value % inc; if (m != 0) { newValue -= m; if (m * 2 >= inc) { newValue += inc; } else if (m * 2 < -inc) { newValue -= inc; } } return newValue.constrain(this.minValue, this.maxValue); }, afterRender : function(){ Ext.slider.MultiSlider.superclass.afterRender.apply(this, arguments); for (var i=0; i < this.thumbs.length; i++) { var thumb = this.thumbs[i]; if (thumb.value !== undefined) { var v = this.normalizeValue(thumb.value); if (v !== thumb.value) { this.setValue(i, v, false); } else { this.moveThumb(i, this.translateValue(v), false); } } }; }, getRatio : function(){ var w = this.innerEl.getWidth(), v = this.maxValue - this.minValue; return v == 0 ? w : (w/v); }, normalizeValue : function(v){ v = this.doSnap(v); v = Ext.util.Format.round(v, this.decimalPrecision); v = v.constrain(this.minValue, this.maxValue); return v; }, setMinValue : function(val){ this.minValue = val; var i = 0, thumbs = this.thumbs, len = thumbs.length, t; for(; i < len; ++i){ t = thumbs[i]; t.value = t.value < val ? val : t.value; } this.syncThumb(); }, setMaxValue : function(val){ this.maxValue = val; var i = 0, thumbs = this.thumbs, len = thumbs.length, t; for(; i < len; ++i){ t = thumbs[i]; t.value = t.value > val ? val : t.value; } this.syncThumb(); }, setValue : function(index, v, animate, changeComplete) { var thumb = this.thumbs[index], el = thumb.el; v = this.normalizeValue(v); if (v !== thumb.value && this.fireEvent('beforechange', this, v, thumb.value, thumb) !== false) { thumb.value = v; if(this.rendered){ this.moveThumb(index, this.translateValue(v), animate !== false); this.fireEvent('change', this, v, thumb); if(changeComplete){ this.fireEvent('changecomplete', this, v, thumb); } } } }, translateValue : function(v) { var ratio = this.getRatio(); return (v * ratio) - (this.minValue * ratio) - this.halfThumb; }, reverseValue : function(pos){ var ratio = this.getRatio(); return (pos + (this.minValue * ratio)) / ratio; }, moveThumb: function(index, v, animate){ var thumb = this.thumbs[index].el; if(!animate || this.animate === false){ thumb.setLeft(v); }else{ thumb.shift({left: v, stopFx: true, duration:.35}); } }, focus : function(){ this.focusEl.focus(10); }, onResize : function(w, h){ var thumbs = this.thumbs, len = thumbs.length, i = 0; for(; i < len; ++i){ thumbs[i].el.stopFx(); } if(Ext.isNumber(w)){ this.innerEl.setWidth(w - (this.el.getPadding('l') + this.endEl.getPadding('r'))); } this.syncThumb(); Ext.slider.MultiSlider.superclass.onResize.apply(this, arguments); }, onDisable: function(){ Ext.slider.MultiSlider.superclass.onDisable.call(this); for (var i=0; i < this.thumbs.length; i++) { var thumb = this.thumbs[i], el = thumb.el; thumb.disable(); if(Ext.isIE){ var xy = el.getXY(); el.hide(); this.innerEl.addClass(this.disabledClass).dom.disabled = true; if (!this.thumbHolder) { this.thumbHolder = this.endEl.createChild({cls: 'x-slider-thumb ' + this.disabledClass}); } this.thumbHolder.show().setXY(xy); } } }, onEnable: function(){ Ext.slider.MultiSlider.superclass.onEnable.call(this); for (var i=0; i < this.thumbs.length; i++) { var thumb = this.thumbs[i], el = thumb.el; thumb.enable(); if (Ext.isIE) { this.innerEl.removeClass(this.disabledClass).dom.disabled = false; if (this.thumbHolder) this.thumbHolder.hide(); el.show(); this.syncThumb(); } } }, syncThumb : function() { if (this.rendered) { for (var i=0; i < this.thumbs.length; i++) { this.moveThumb(i, this.translateValue(this.thumbs[i].value)); } } }, getValue : function(index) { return this.thumbs[index].value; }, getValues: function() { var values = []; for (var i=0; i < this.thumbs.length; i++) { values.push(this.thumbs[i].value); } return values; }, beforeDestroy : function(){ var thumbs = this.thumbs; for(var i = 0, len = thumbs.length; i < len; ++i){ thumbs[i].destroy(); thumbs[i] = null; } Ext.destroyMembers(this, 'endEl', 'innerEl', 'focusEl', 'thumbHolder'); Ext.slider.MultiSlider.superclass.beforeDestroy.call(this); } }); Ext.reg('multislider', Ext.slider.MultiSlider); Ext.slider.SingleSlider = Ext.extend(Ext.slider.MultiSlider, { constructor: function(config) { config = config || {}; Ext.applyIf(config, { values: [config.value || 0] }); Ext.slider.SingleSlider.superclass.constructor.call(this, config); }, getValue: function() { return Ext.slider.SingleSlider.superclass.getValue.call(this, 0); }, setValue: function(value, animate) { var args = Ext.toArray(arguments), len = args.length; if (len == 1 || (len <= 3 && typeof arguments[1] != 'number')) { args.unshift(0); } return Ext.slider.SingleSlider.superclass.setValue.apply(this, args); }, syncThumb : function() { return Ext.slider.SingleSlider.superclass.syncThumb.apply(this, [0].concat(arguments)); }, getNearest : function(){ return this.thumbs[0]; } }); Ext.Slider = Ext.slider.SingleSlider; Ext.reg('slider', Ext.slider.SingleSlider); Ext.slider.Vertical = { onResize : function(w, h){ this.innerEl.setHeight(h - (this.el.getPadding('t') + this.endEl.getPadding('b'))); this.syncThumb(); }, getRatio : function(){ var h = this.innerEl.getHeight(), v = this.maxValue - this.minValue; return h/v; }, moveThumb: function(index, v, animate) { var thumb = this.thumbs[index], el = thumb.el; if (!animate || this.animate === false) { el.setBottom(v); } else { el.shift({bottom: v, stopFx: true, duration:.35}); } }, onClickChange : function(local) { if (local.left > this.clickRange[0] && local.left < this.clickRange[1]) { var thumb = this.getNearest(local, 'top'), index = thumb.index, value = this.minValue + this.reverseValue(this.innerEl.getHeight() - local.top); this.setValue(index, Ext.util.Format.round(value, this.decimalPrecision), undefined, true); } } }; Ext.slider.Thumb.Vertical = { getNewValue: function() { var slider = this.slider, innerEl = slider.innerEl, pos = innerEl.translatePoints(this.tracker.getXY()), bottom = innerEl.getHeight() - pos.top; return slider.minValue + Ext.util.Format.round(bottom / slider.getRatio(), slider.decimalPrecision); } }; Ext.ProgressBar = Ext.extend(Ext.BoxComponent, { baseCls : 'x-progress', animate : false, waitTimer : null, initComponent : function(){ Ext.ProgressBar.superclass.initComponent.call(this); this.addEvents( "update" ); }, onRender : function(ct, position){ var tpl = new Ext.Template( '
    ', '
    ', '
    ', '
    ', '
     
    ', '
    ', '
    ', '
    ', '
     
    ', '
    ', '
    ', '
    ' ); this.el = position ? tpl.insertBefore(position, {cls: this.baseCls}, true) : tpl.append(ct, {cls: this.baseCls}, true); if(this.id){ this.el.dom.id = this.id; } var inner = this.el.dom.firstChild; this.progressBar = Ext.get(inner.firstChild); if(this.textEl){ this.textEl = Ext.get(this.textEl); delete this.textTopEl; }else{ this.textTopEl = Ext.get(this.progressBar.dom.firstChild); var textBackEl = Ext.get(inner.childNodes[1]); this.textTopEl.setStyle("z-index", 99).addClass('x-hidden'); this.textEl = new Ext.CompositeElement([this.textTopEl.dom.firstChild, textBackEl.dom.firstChild]); this.textEl.setWidth(inner.offsetWidth); } this.progressBar.setHeight(inner.offsetHeight); }, afterRender : function(){ Ext.ProgressBar.superclass.afterRender.call(this); if(this.value){ this.updateProgress(this.value, this.text); }else{ this.updateText(this.text); } }, updateProgress : function(value, text, animate){ this.value = value || 0; if(text){ this.updateText(text); } if(this.rendered && !this.isDestroyed){ var w = Math.floor(value*this.el.dom.firstChild.offsetWidth); this.progressBar.setWidth(w, animate === true || (animate !== false && this.animate)); if(this.textTopEl){ this.textTopEl.removeClass('x-hidden').setWidth(w); } } this.fireEvent('update', this, value, text); return this; }, wait : function(o){ if(!this.waitTimer){ var scope = this; o = o || {}; this.updateText(o.text); this.waitTimer = Ext.TaskMgr.start({ run: function(i){ var inc = o.increment || 10; i -= 1; this.updateProgress(((((i+inc)%inc)+1)*(100/inc))*0.01, null, o.animate); }, interval: o.interval || 1000, duration: o.duration, onStop: function(){ if(o.fn){ o.fn.apply(o.scope || this); } this.reset(); }, scope: scope }); } return this; }, isWaiting : function(){ return this.waitTimer !== null; }, updateText : function(text){ this.text = text || ' '; if(this.rendered){ this.textEl.update(this.text); } return this; }, syncProgressBar : function(){ if(this.value){ this.updateProgress(this.value, this.text); } return this; }, setSize : function(w, h){ Ext.ProgressBar.superclass.setSize.call(this, w, h); if(this.textTopEl){ var inner = this.el.dom.firstChild; this.textEl.setSize(inner.offsetWidth, inner.offsetHeight); } this.syncProgressBar(); return this; }, reset : function(hide){ this.updateProgress(0); if(this.textTopEl){ this.textTopEl.addClass('x-hidden'); } this.clearTimer(); if(hide === true){ this.hide(); } return this; }, clearTimer : function(){ if(this.waitTimer){ this.waitTimer.onStop = null; Ext.TaskMgr.stop(this.waitTimer); this.waitTimer = null; } }, onDestroy: function(){ this.clearTimer(); if(this.rendered){ if(this.textEl.isComposite){ this.textEl.clear(); } Ext.destroyMembers(this, 'textEl', 'progressBar', 'textTopEl'); } Ext.ProgressBar.superclass.onDestroy.call(this); } }); Ext.reg('progress', Ext.ProgressBar); (function() { var Event=Ext.EventManager; var Dom=Ext.lib.Dom; Ext.dd.DragDrop = function(id, sGroup, config) { if(id) { this.init(id, sGroup, config); } }; Ext.dd.DragDrop.prototype = { id: null, config: null, dragElId: null, handleElId: null, invalidHandleTypes: null, invalidHandleIds: null, invalidHandleClasses: null, startPageX: 0, startPageY: 0, groups: null, locked: false, lock: function() { this.locked = true; }, moveOnly: false, unlock: function() { this.locked = false; }, isTarget: true, padding: null, _domRef: null, __ygDragDrop: true, constrainX: false, constrainY: false, minX: 0, maxX: 0, minY: 0, maxY: 0, maintainOffset: false, xTicks: null, yTicks: null, primaryButtonOnly: true, available: false, hasOuterHandles: false, b4StartDrag: function(x, y) { }, startDrag: function(x, y) { }, b4Drag: function(e) { }, onDrag: function(e) { }, onDragEnter: function(e, id) { }, b4DragOver: function(e) { }, onDragOver: function(e, id) { }, b4DragOut: function(e) { }, onDragOut: function(e, id) { }, b4DragDrop: function(e) { }, onDragDrop: function(e, id) { }, onInvalidDrop: function(e) { }, b4EndDrag: function(e) { }, endDrag: function(e) { }, b4MouseDown: function(e) { }, onMouseDown: function(e) { }, onMouseUp: function(e) { }, onAvailable: function () { }, defaultPadding : {left:0, right:0, top:0, bottom:0}, constrainTo : function(constrainTo, pad, inContent){ if(Ext.isNumber(pad)){ pad = {left: pad, right:pad, top:pad, bottom:pad}; } pad = pad || this.defaultPadding; var b = Ext.get(this.getEl()).getBox(), ce = Ext.get(constrainTo), s = ce.getScroll(), c, cd = ce.dom; if(cd == document.body){ c = { x: s.left, y: s.top, width: Ext.lib.Dom.getViewWidth(), height: Ext.lib.Dom.getViewHeight()}; }else{ var xy = ce.getXY(); c = {x : xy[0], y: xy[1], width: cd.clientWidth, height: cd.clientHeight}; } var topSpace = b.y - c.y, leftSpace = b.x - c.x; this.resetConstraints(); this.setXConstraint(leftSpace - (pad.left||0), c.width - leftSpace - b.width - (pad.right||0), this.xTickSize ); this.setYConstraint(topSpace - (pad.top||0), c.height - topSpace - b.height - (pad.bottom||0), this.yTickSize ); }, getEl: function() { if (!this._domRef) { this._domRef = Ext.getDom(this.id); } return this._domRef; }, getDragEl: function() { return Ext.getDom(this.dragElId); }, init: function(id, sGroup, config) { this.initTarget(id, sGroup, config); Event.on(this.id, "mousedown", this.handleMouseDown, this); }, initTarget: function(id, sGroup, config) { this.config = config || {}; this.DDM = Ext.dd.DDM; this.groups = {}; if (typeof id !== "string") { id = Ext.id(id); } this.id = id; this.addToGroup((sGroup) ? sGroup : "default"); this.handleElId = id; this.setDragElId(id); this.invalidHandleTypes = { A: "A" }; this.invalidHandleIds = {}; this.invalidHandleClasses = []; this.applyConfig(); this.handleOnAvailable(); }, applyConfig: function() { this.padding = this.config.padding || [0, 0, 0, 0]; this.isTarget = (this.config.isTarget !== false); this.maintainOffset = (this.config.maintainOffset); this.primaryButtonOnly = (this.config.primaryButtonOnly !== false); }, handleOnAvailable: function() { this.available = true; this.resetConstraints(); this.onAvailable(); }, setPadding: function(iTop, iRight, iBot, iLeft) { if (!iRight && 0 !== iRight) { this.padding = [iTop, iTop, iTop, iTop]; } else if (!iBot && 0 !== iBot) { this.padding = [iTop, iRight, iTop, iRight]; } else { this.padding = [iTop, iRight, iBot, iLeft]; } }, setInitPosition: function(diffX, diffY) { var el = this.getEl(); if (!this.DDM.verifyEl(el)) { return; } var dx = diffX || 0; var dy = diffY || 0; var p = Dom.getXY( el ); this.initPageX = p[0] - dx; this.initPageY = p[1] - dy; this.lastPageX = p[0]; this.lastPageY = p[1]; this.setStartPosition(p); }, setStartPosition: function(pos) { var p = pos || Dom.getXY( this.getEl() ); this.deltaSetXY = null; this.startPageX = p[0]; this.startPageY = p[1]; }, addToGroup: function(sGroup) { this.groups[sGroup] = true; this.DDM.regDragDrop(this, sGroup); }, removeFromGroup: function(sGroup) { if (this.groups[sGroup]) { delete this.groups[sGroup]; } this.DDM.removeDDFromGroup(this, sGroup); }, setDragElId: function(id) { this.dragElId = id; }, setHandleElId: function(id) { if (typeof id !== "string") { id = Ext.id(id); } this.handleElId = id; this.DDM.regHandle(this.id, id); }, setOuterHandleElId: function(id) { if (typeof id !== "string") { id = Ext.id(id); } Event.on(id, "mousedown", this.handleMouseDown, this); this.setHandleElId(id); this.hasOuterHandles = true; }, unreg: function() { Event.un(this.id, "mousedown", this.handleMouseDown); this._domRef = null; this.DDM._remove(this); }, destroy : function(){ this.unreg(); }, isLocked: function() { return (this.DDM.isLocked() || this.locked); }, handleMouseDown: function(e, oDD){ if (this.primaryButtonOnly && e.button != 0) { return; } if (this.isLocked()) { return; } this.DDM.refreshCache(this.groups); var pt = new Ext.lib.Point(Ext.lib.Event.getPageX(e), Ext.lib.Event.getPageY(e)); if (!this.hasOuterHandles && !this.DDM.isOverTarget(pt, this) ) { } else { if (this.clickValidator(e)) { this.setStartPosition(); this.b4MouseDown(e); this.onMouseDown(e); this.DDM.handleMouseDown(e, this); this.DDM.stopEvent(e); } else { } } }, clickValidator: function(e) { var target = e.getTarget(); return ( this.isValidHandleChild(target) && (this.id == this.handleElId || this.DDM.handleWasClicked(target, this.id)) ); }, addInvalidHandleType: function(tagName) { var type = tagName.toUpperCase(); this.invalidHandleTypes[type] = type; }, addInvalidHandleId: function(id) { if (typeof id !== "string") { id = Ext.id(id); } this.invalidHandleIds[id] = id; }, addInvalidHandleClass: function(cssClass) { this.invalidHandleClasses.push(cssClass); }, removeInvalidHandleType: function(tagName) { var type = tagName.toUpperCase(); delete this.invalidHandleTypes[type]; }, removeInvalidHandleId: function(id) { if (typeof id !== "string") { id = Ext.id(id); } delete this.invalidHandleIds[id]; }, removeInvalidHandleClass: function(cssClass) { for (var i=0, len=this.invalidHandleClasses.length; i= this.minX; i = i - iTickSize) { if (!tickMap[i]) { this.xTicks[this.xTicks.length] = i; tickMap[i] = true; } } for (i = this.initPageX; i <= this.maxX; i = i + iTickSize) { if (!tickMap[i]) { this.xTicks[this.xTicks.length] = i; tickMap[i] = true; } } this.xTicks.sort(this.DDM.numericSort) ; }, setYTicks: function(iStartY, iTickSize) { this.yTicks = []; this.yTickSize = iTickSize; var tickMap = {}; for (var i = this.initPageY; i >= this.minY; i = i - iTickSize) { if (!tickMap[i]) { this.yTicks[this.yTicks.length] = i; tickMap[i] = true; } } for (i = this.initPageY; i <= this.maxY; i = i + iTickSize) { if (!tickMap[i]) { this.yTicks[this.yTicks.length] = i; tickMap[i] = true; } } this.yTicks.sort(this.DDM.numericSort) ; }, setXConstraint: function(iLeft, iRight, iTickSize) { this.leftConstraint = iLeft; this.rightConstraint = iRight; this.minX = this.initPageX - iLeft; this.maxX = this.initPageX + iRight; if (iTickSize) { this.setXTicks(this.initPageX, iTickSize); } this.constrainX = true; }, clearConstraints: function() { this.constrainX = false; this.constrainY = false; this.clearTicks(); }, clearTicks: function() { this.xTicks = null; this.yTicks = null; this.xTickSize = 0; this.yTickSize = 0; }, setYConstraint: function(iUp, iDown, iTickSize) { this.topConstraint = iUp; this.bottomConstraint = iDown; this.minY = this.initPageY - iUp; this.maxY = this.initPageY + iDown; if (iTickSize) { this.setYTicks(this.initPageY, iTickSize); } this.constrainY = true; }, resetConstraints: function() { if (this.initPageX || this.initPageX === 0) { var dx = (this.maintainOffset) ? this.lastPageX - this.initPageX : 0; var dy = (this.maintainOffset) ? this.lastPageY - this.initPageY : 0; this.setInitPosition(dx, dy); } else { this.setInitPosition(); } if (this.constrainX) { this.setXConstraint( this.leftConstraint, this.rightConstraint, this.xTickSize ); } if (this.constrainY) { this.setYConstraint( this.topConstraint, this.bottomConstraint, this.yTickSize ); } }, getTick: function(val, tickArray) { if (!tickArray) { return val; } else if (tickArray[0] >= val) { return tickArray[0]; } else { for (var i=0, len=tickArray.length; i= val) { var diff1 = val - tickArray[i]; var diff2 = tickArray[next] - val; return (diff2 > diff1) ? tickArray[i] : tickArray[next]; } } return tickArray[tickArray.length - 1]; } }, toString: function() { return ("DragDrop " + this.id); } }; })(); if (!Ext.dd.DragDropMgr) { Ext.dd.DragDropMgr = function() { var Event = Ext.EventManager; return { ids: {}, handleIds: {}, dragCurrent: null, dragOvers: {}, deltaX: 0, deltaY: 0, preventDefault: true, stopPropagation: true, initialized: false, locked: false, init: function() { this.initialized = true; }, POINT: 0, INTERSECT: 1, mode: 0, _execOnAll: function(sMethod, args) { for (var i in this.ids) { for (var j in this.ids[i]) { var oDD = this.ids[i][j]; if (! this.isTypeOfDD(oDD)) { continue; } oDD[sMethod].apply(oDD, args); } } }, _onLoad: function() { this.init(); Event.on(document, "mouseup", this.handleMouseUp, this, true); Event.on(document, "mousemove", this.handleMouseMove, this, true); Event.on(window, "unload", this._onUnload, this, true); Event.on(window, "resize", this._onResize, this, true); }, _onResize: function(e) { this._execOnAll("resetConstraints", []); }, lock: function() { this.locked = true; }, unlock: function() { this.locked = false; }, isLocked: function() { return this.locked; }, locationCache: {}, useCache: true, clickPixelThresh: 3, clickTimeThresh: 350, dragThreshMet: false, clickTimeout: null, startX: 0, startY: 0, regDragDrop: function(oDD, sGroup) { if (!this.initialized) { this.init(); } if (!this.ids[sGroup]) { this.ids[sGroup] = {}; } this.ids[sGroup][oDD.id] = oDD; }, removeDDFromGroup: function(oDD, sGroup) { if (!this.ids[sGroup]) { this.ids[sGroup] = {}; } var obj = this.ids[sGroup]; if (obj && obj[oDD.id]) { delete obj[oDD.id]; } }, _remove: function(oDD) { for (var g in oDD.groups) { if (g && this.ids[g] && this.ids[g][oDD.id]) { delete this.ids[g][oDD.id]; } } delete this.handleIds[oDD.id]; }, regHandle: function(sDDId, sHandleId) { if (!this.handleIds[sDDId]) { this.handleIds[sDDId] = {}; } this.handleIds[sDDId][sHandleId] = sHandleId; }, isDragDrop: function(id) { return ( this.getDDById(id) ) ? true : false; }, getRelated: function(p_oDD, bTargetsOnly) { var oDDs = []; for (var i in p_oDD.groups) { for (var j in this.ids[i]) { var dd = this.ids[i][j]; if (! this.isTypeOfDD(dd)) { continue; } if (!bTargetsOnly || dd.isTarget) { oDDs[oDDs.length] = dd; } } } return oDDs; }, isLegalTarget: function (oDD, oTargetDD) { var targets = this.getRelated(oDD, true); for (var i=0, len=targets.length;i this.clickPixelThresh || diffY > this.clickPixelThresh) { this.startDrag(this.startX, this.startY); } } if (this.dragThreshMet) { this.dragCurrent.b4Drag(e); this.dragCurrent.onDrag(e); if(!this.dragCurrent.moveOnly){ this.fireEvents(e, false); } } this.stopEvent(e); return true; }, fireEvents: function(e, isDrop) { var dc = this.dragCurrent; if (!dc || dc.isLocked()) { return; } var pt = e.getPoint(); var oldOvers = []; var outEvts = []; var overEvts = []; var dropEvts = []; var enterEvts = []; for (var i in this.dragOvers) { var ddo = this.dragOvers[i]; if (! this.isTypeOfDD(ddo)) { continue; } if (! this.isOverTarget(pt, ddo, this.mode)) { outEvts.push( ddo ); } oldOvers[i] = true; delete this.dragOvers[i]; } for (var sGroup in dc.groups) { if ("string" != typeof sGroup) { continue; } for (i in this.ids[sGroup]) { var oDD = this.ids[sGroup][i]; if (! this.isTypeOfDD(oDD)) { continue; } if (oDD.isTarget && !oDD.isLocked() && ((oDD != dc) || (dc.ignoreSelf === false))) { if (this.isOverTarget(pt, oDD, this.mode)) { if (isDrop) { dropEvts.push( oDD ); } else { if (!oldOvers[oDD.id]) { enterEvts.push( oDD ); } else { overEvts.push( oDD ); } this.dragOvers[oDD.id] = oDD; } } } } } if (this.mode) { if (outEvts.length) { dc.b4DragOut(e, outEvts); dc.onDragOut(e, outEvts); } if (enterEvts.length) { dc.onDragEnter(e, enterEvts); } if (overEvts.length) { dc.b4DragOver(e, overEvts); dc.onDragOver(e, overEvts); } if (dropEvts.length) { dc.b4DragDrop(e, dropEvts); dc.onDragDrop(e, dropEvts); } } else { var len = 0; for (i=0, len=outEvts.length; i 2000) { } else { setTimeout(DDM._addListeners, 10); if (document && document.body) { DDM._timeoutCount += 1; } } } }, handleWasClicked: function(node, id) { if (this.isHandle(id, node.id)) { return true; } else { var p = node.parentNode; while (p) { if (this.isHandle(id, p.id)) { return true; } else { p = p.parentNode; } } } return false; } }; }(); Ext.dd.DDM = Ext.dd.DragDropMgr; Ext.dd.DDM._addListeners(); } Ext.dd.DD = function(id, sGroup, config) { if (id) { this.init(id, sGroup, config); } }; Ext.extend(Ext.dd.DD, Ext.dd.DragDrop, { scroll: true, autoOffset: function(iPageX, iPageY) { var x = iPageX - this.startPageX; var y = iPageY - this.startPageY; this.setDelta(x, y); }, setDelta: function(iDeltaX, iDeltaY) { this.deltaX = iDeltaX; this.deltaY = iDeltaY; }, setDragElPos: function(iPageX, iPageY) { var el = this.getDragEl(); this.alignElWithMouse(el, iPageX, iPageY); }, alignElWithMouse: function(el, iPageX, iPageY) { var oCoord = this.getTargetCoord(iPageX, iPageY); var fly = el.dom ? el : Ext.fly(el, '_dd'); if (!this.deltaSetXY) { var aCoord = [oCoord.x, oCoord.y]; fly.setXY(aCoord); var newLeft = fly.getLeft(true); var newTop = fly.getTop(true); this.deltaSetXY = [ newLeft - oCoord.x, newTop - oCoord.y ]; } else { fly.setLeftTop(oCoord.x + this.deltaSetXY[0], oCoord.y + this.deltaSetXY[1]); } this.cachePosition(oCoord.x, oCoord.y); this.autoScroll(oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth); return oCoord; }, cachePosition: function(iPageX, iPageY) { if (iPageX) { this.lastPageX = iPageX; this.lastPageY = iPageY; } else { var aCoord = Ext.lib.Dom.getXY(this.getEl()); this.lastPageX = aCoord[0]; this.lastPageY = aCoord[1]; } }, autoScroll: function(x, y, h, w) { if (this.scroll) { var clientH = Ext.lib.Dom.getViewHeight(); var clientW = Ext.lib.Dom.getViewWidth(); var st = this.DDM.getScrollTop(); var sl = this.DDM.getScrollLeft(); var bot = h + y; var right = w + x; var toBot = (clientH + st - y - this.deltaY); var toRight = (clientW + sl - x - this.deltaX); var thresh = 40; var scrAmt = (document.all) ? 80 : 30; if ( bot > clientH && toBot < thresh ) { window.scrollTo(sl, st + scrAmt); } if ( y < st && st > 0 && y - st < thresh ) { window.scrollTo(sl, st - scrAmt); } if ( right > clientW && toRight < thresh ) { window.scrollTo(sl + scrAmt, st); } if ( x < sl && sl > 0 && x - sl < thresh ) { window.scrollTo(sl - scrAmt, st); } } }, getTargetCoord: function(iPageX, iPageY) { var x = iPageX - this.deltaX; var y = iPageY - this.deltaY; if (this.constrainX) { if (x < this.minX) { x = this.minX; } if (x > this.maxX) { x = this.maxX; } } if (this.constrainY) { if (y < this.minY) { y = this.minY; } if (y > this.maxY) { y = this.maxY; } } x = this.getTick(x, this.xTicks); y = this.getTick(y, this.yTicks); return {x:x, y:y}; }, applyConfig: function() { Ext.dd.DD.superclass.applyConfig.call(this); this.scroll = (this.config.scroll !== false); }, b4MouseDown: function(e) { this.autoOffset(e.getPageX(), e.getPageY()); }, b4Drag: function(e) { this.setDragElPos(e.getPageX(), e.getPageY()); }, toString: function() { return ("DD " + this.id); } }); Ext.dd.DDProxy = function(id, sGroup, config) { if (id) { this.init(id, sGroup, config); this.initFrame(); } }; Ext.dd.DDProxy.dragElId = "ygddfdiv"; Ext.extend(Ext.dd.DDProxy, Ext.dd.DD, { resizeFrame: true, centerFrame: false, createFrame: function() { var self = this; var body = document.body; if (!body || !body.firstChild) { setTimeout( function() { self.createFrame(); }, 50 ); return; } var div = this.getDragEl(); if (!div) { div = document.createElement("div"); div.id = this.dragElId; var s = div.style; s.position = "absolute"; s.visibility = "hidden"; s.cursor = "move"; s.border = "2px solid #aaa"; s.zIndex = 999; body.insertBefore(div, body.firstChild); } }, initFrame: function() { this.createFrame(); }, applyConfig: function() { Ext.dd.DDProxy.superclass.applyConfig.call(this); this.resizeFrame = (this.config.resizeFrame !== false); this.centerFrame = (this.config.centerFrame); this.setDragElId(this.config.dragElId || Ext.dd.DDProxy.dragElId); }, showFrame: function(iPageX, iPageY) { var el = this.getEl(); var dragEl = this.getDragEl(); var s = dragEl.style; this._resizeProxy(); if (this.centerFrame) { this.setDelta( Math.round(parseInt(s.width, 10)/2), Math.round(parseInt(s.height, 10)/2) ); } this.setDragElPos(iPageX, iPageY); Ext.fly(dragEl).show(); }, _resizeProxy: function() { if (this.resizeFrame) { var el = this.getEl(); Ext.fly(this.getDragEl()).setSize(el.offsetWidth, el.offsetHeight); } }, b4MouseDown: function(e) { var x = e.getPageX(); var y = e.getPageY(); this.autoOffset(x, y); this.setDragElPos(x, y); }, b4StartDrag: function(x, y) { this.showFrame(x, y); }, b4EndDrag: function(e) { Ext.fly(this.getDragEl()).hide(); }, endDrag: function(e) { var lel = this.getEl(); var del = this.getDragEl(); del.style.visibility = ""; this.beforeMove(); lel.style.visibility = "hidden"; Ext.dd.DDM.moveToEl(lel, del); del.style.visibility = "hidden"; lel.style.visibility = ""; this.afterDrag(); }, beforeMove : function(){ }, afterDrag : function(){ }, toString: function() { return ("DDProxy " + this.id); } }); Ext.dd.DDTarget = function(id, sGroup, config) { if (id) { this.initTarget(id, sGroup, config); } }; Ext.extend(Ext.dd.DDTarget, Ext.dd.DragDrop, { getDragEl: Ext.emptyFn, isValidHandleChild: Ext.emptyFn, startDrag: Ext.emptyFn, endDrag: Ext.emptyFn, onDrag: Ext.emptyFn, onDragDrop: Ext.emptyFn, onDragEnter: Ext.emptyFn, onDragOut: Ext.emptyFn, onDragOver: Ext.emptyFn, onInvalidDrop: Ext.emptyFn, onMouseDown: Ext.emptyFn, onMouseUp: Ext.emptyFn, setXConstraint: Ext.emptyFn, setYConstraint: Ext.emptyFn, resetConstraints: Ext.emptyFn, clearConstraints: Ext.emptyFn, clearTicks: Ext.emptyFn, setInitPosition: Ext.emptyFn, setDragElId: Ext.emptyFn, setHandleElId: Ext.emptyFn, setOuterHandleElId: Ext.emptyFn, addInvalidHandleClass: Ext.emptyFn, addInvalidHandleId: Ext.emptyFn, addInvalidHandleType: Ext.emptyFn, removeInvalidHandleClass: Ext.emptyFn, removeInvalidHandleId: Ext.emptyFn, removeInvalidHandleType: Ext.emptyFn, toString: function() { return ("DDTarget " + this.id); } }); Ext.dd.DragTracker = Ext.extend(Ext.util.Observable, { active: false, tolerance: 5, autoStart: false, constructor : function(config){ Ext.apply(this, config); this.addEvents( 'mousedown', 'mouseup', 'mousemove', 'dragstart', 'dragend', 'drag' ); this.dragRegion = new Ext.lib.Region(0,0,0,0); if(this.el){ this.initEl(this.el); } Ext.dd.DragTracker.superclass.constructor.call(this, config); }, initEl: function(el){ this.el = Ext.get(el); el.on('mousedown', this.onMouseDown, this, this.delegate ? {delegate: this.delegate} : undefined); }, destroy : function(){ this.el.un('mousedown', this.onMouseDown, this); delete this.el; }, onMouseDown: function(e, target){ if(this.fireEvent('mousedown', this, e) !== false && this.onBeforeStart(e) !== false){ this.startXY = this.lastXY = e.getXY(); this.dragTarget = this.delegate ? target : this.el.dom; if(this.preventDefault !== false){ e.preventDefault(); } Ext.getDoc().on({ scope: this, mouseup: this.onMouseUp, mousemove: this.onMouseMove, selectstart: this.stopSelect }); if(this.autoStart){ this.timer = this.triggerStart.defer(this.autoStart === true ? 1000 : this.autoStart, this, [e]); } } }, onMouseMove: function(e, target){ if(this.active && Ext.isIE && !e.browserEvent.button){ e.preventDefault(); this.onMouseUp(e); return; } e.preventDefault(); var xy = e.getXY(), s = this.startXY; this.lastXY = xy; if(!this.active){ if(Math.abs(s[0]-xy[0]) > this.tolerance || Math.abs(s[1]-xy[1]) > this.tolerance){ this.triggerStart(e); }else{ return; } } this.fireEvent('mousemove', this, e); this.onDrag(e); this.fireEvent('drag', this, e); }, onMouseUp: function(e) { var doc = Ext.getDoc(), wasActive = this.active; doc.un('mousemove', this.onMouseMove, this); doc.un('mouseup', this.onMouseUp, this); doc.un('selectstart', this.stopSelect, this); e.preventDefault(); this.clearStart(); this.active = false; delete this.elRegion; this.fireEvent('mouseup', this, e); if(wasActive){ this.onEnd(e); this.fireEvent('dragend', this, e); } }, triggerStart: function(e) { this.clearStart(); this.active = true; this.onStart(e); this.fireEvent('dragstart', this, e); }, clearStart : function() { if(this.timer){ clearTimeout(this.timer); delete this.timer; } }, stopSelect : function(e) { e.stopEvent(); return false; }, onBeforeStart : function(e) { }, onStart : function(xy) { }, onDrag : function(e) { }, onEnd : function(e) { }, getDragTarget : function(){ return this.dragTarget; }, getDragCt : function(){ return this.el; }, getXY : function(constrain){ return constrain ? this.constrainModes[constrain].call(this, this.lastXY) : this.lastXY; }, getOffset : function(constrain){ var xy = this.getXY(constrain), s = this.startXY; return [s[0]-xy[0], s[1]-xy[1]]; }, constrainModes: { 'point' : function(xy){ if(!this.elRegion){ this.elRegion = this.getDragCt().getRegion(); } var dr = this.dragRegion; dr.left = xy[0]; dr.top = xy[1]; dr.right = xy[0]; dr.bottom = xy[1]; dr.constrainTo(this.elRegion); return [dr.left, dr.top]; } } }); Ext.dd.ScrollManager = function(){ var ddm = Ext.dd.DragDropMgr; var els = {}; var dragEl = null; var proc = {}; var onStop = function(e){ dragEl = null; clearProc(); }; var triggerRefresh = function(){ if(ddm.dragCurrent){ ddm.refreshCache(ddm.dragCurrent.groups); } }; var doScroll = function(){ if(ddm.dragCurrent){ var dds = Ext.dd.ScrollManager; var inc = proc.el.ddScrollConfig ? proc.el.ddScrollConfig.increment : dds.increment; if(!dds.animate){ if(proc.el.scroll(proc.dir, inc)){ triggerRefresh(); } }else{ proc.el.scroll(proc.dir, inc, true, dds.animDuration, triggerRefresh); } } }; var clearProc = function(){ if(proc.id){ clearInterval(proc.id); } proc.id = 0; proc.el = null; proc.dir = ""; }; var startProc = function(el, dir){ clearProc(); proc.el = el; proc.dir = dir; var group = el.ddScrollConfig ? el.ddScrollConfig.ddGroup : undefined, freq = (el.ddScrollConfig && el.ddScrollConfig.frequency) ? el.ddScrollConfig.frequency : Ext.dd.ScrollManager.frequency; if (group === undefined || ddm.dragCurrent.ddGroup == group) { proc.id = setInterval(doScroll, freq); } }; var onFire = function(e, isDrop){ if(isDrop || !ddm.dragCurrent){ return; } var dds = Ext.dd.ScrollManager; if(!dragEl || dragEl != ddm.dragCurrent){ dragEl = ddm.dragCurrent; dds.refreshCache(); } var xy = Ext.lib.Event.getXY(e); var pt = new Ext.lib.Point(xy[0], xy[1]); for(var id in els){ var el = els[id], r = el._region; var c = el.ddScrollConfig ? el.ddScrollConfig : dds; if(r && r.contains(pt) && el.isScrollable()){ if(r.bottom - pt.y <= c.vthresh){ if(proc.el != el){ startProc(el, "down"); } return; }else if(r.right - pt.x <= c.hthresh){ if(proc.el != el){ startProc(el, "left"); } return; }else if(pt.y - r.top <= c.vthresh){ if(proc.el != el){ startProc(el, "up"); } return; }else if(pt.x - r.left <= c.hthresh){ if(proc.el != el){ startProc(el, "right"); } return; } } } clearProc(); }; ddm.fireEvents = ddm.fireEvents.createSequence(onFire, ddm); ddm.stopDrag = ddm.stopDrag.createSequence(onStop, ddm); return { register : function(el){ if(Ext.isArray(el)){ for(var i = 0, len = el.length; i < len; i++) { this.register(el[i]); } }else{ el = Ext.get(el); els[el.id] = el; } }, unregister : function(el){ if(Ext.isArray(el)){ for(var i = 0, len = el.length; i < len; i++) { this.unregister(el[i]); } }else{ el = Ext.get(el); delete els[el.id]; } }, vthresh : 25, hthresh : 25, increment : 100, frequency : 500, animate: true, animDuration: .4, ddGroup: undefined, refreshCache : function(){ for(var id in els){ if(typeof els[id] == 'object'){ els[id]._region = els[id].getRegion(); } } } }; }(); Ext.dd.Registry = function(){ var elements = {}; var handles = {}; var autoIdSeed = 0; var getId = function(el, autogen){ if(typeof el == "string"){ return el; } var id = el.id; if(!id && autogen !== false){ id = "extdd-" + (++autoIdSeed); el.id = id; } return id; }; return { register : function(el, data){ data = data || {}; if(typeof el == "string"){ el = document.getElementById(el); } data.ddel = el; elements[getId(el)] = data; if(data.isHandle !== false){ handles[data.ddel.id] = data; } if(data.handles){ var hs = data.handles; for(var i = 0, len = hs.length; i < len; i++){ handles[getId(hs[i])] = data; } } }, unregister : function(el){ var id = getId(el, false); var data = elements[id]; if(data){ delete elements[id]; if(data.handles){ var hs = data.handles; for(var i = 0, len = hs.length; i < len; i++){ delete handles[getId(hs[i], false)]; } } } }, getHandle : function(id){ if(typeof id != "string"){ id = id.id; } return handles[id]; }, getHandleFromEvent : function(e){ var t = Ext.lib.Event.getTarget(e); return t ? handles[t.id] : null; }, getTarget : function(id){ if(typeof id != "string"){ id = id.id; } return elements[id]; }, getTargetFromEvent : function(e){ var t = Ext.lib.Event.getTarget(e); return t ? elements[t.id] || handles[t.id] : null; } }; }(); Ext.dd.StatusProxy = function(config){ Ext.apply(this, config); this.id = this.id || Ext.id(); this.el = new Ext.Layer({ dh: { id: this.id, tag: "div", cls: "x-dd-drag-proxy "+this.dropNotAllowed, children: [ {tag: "div", cls: "x-dd-drop-icon"}, {tag: "div", cls: "x-dd-drag-ghost"} ] }, shadow: !config || config.shadow !== false }); this.ghost = Ext.get(this.el.dom.childNodes[1]); this.dropStatus = this.dropNotAllowed; }; Ext.dd.StatusProxy.prototype = { dropAllowed : "x-dd-drop-ok", dropNotAllowed : "x-dd-drop-nodrop", setStatus : function(cssClass){ cssClass = cssClass || this.dropNotAllowed; if(this.dropStatus != cssClass){ this.el.replaceClass(this.dropStatus, cssClass); this.dropStatus = cssClass; } }, reset : function(clearGhost){ this.el.dom.className = "x-dd-drag-proxy " + this.dropNotAllowed; this.dropStatus = this.dropNotAllowed; if(clearGhost){ this.ghost.update(""); } }, update : function(html){ if(typeof html == "string"){ this.ghost.update(html); }else{ this.ghost.update(""); html.style.margin = "0"; this.ghost.dom.appendChild(html); } var el = this.ghost.dom.firstChild; if(el){ Ext.fly(el).setStyle('float', 'none'); } }, getEl : function(){ return this.el; }, getGhost : function(){ return this.ghost; }, hide : function(clear){ this.el.hide(); if(clear){ this.reset(true); } }, stop : function(){ if(this.anim && this.anim.isAnimated && this.anim.isAnimated()){ this.anim.stop(); } }, show : function(){ this.el.show(); }, sync : function(){ this.el.sync(); }, repair : function(xy, callback, scope){ this.callback = callback; this.scope = scope; if(xy && this.animRepair !== false){ this.el.addClass("x-dd-drag-repair"); this.el.hideUnders(true); this.anim = this.el.shift({ duration: this.repairDuration || .5, easing: 'easeOut', xy: xy, stopFx: true, callback: this.afterRepair, scope: this }); }else{ this.afterRepair(); } }, afterRepair : function(){ this.hide(true); if(typeof this.callback == "function"){ this.callback.call(this.scope || this); } this.callback = null; this.scope = null; }, destroy: function(){ Ext.destroy(this.ghost, this.el); } }; Ext.dd.DragSource = function(el, config){ this.el = Ext.get(el); if(!this.dragData){ this.dragData = {}; } Ext.apply(this, config); if(!this.proxy){ this.proxy = new Ext.dd.StatusProxy(); } Ext.dd.DragSource.superclass.constructor.call(this, this.el.dom, this.ddGroup || this.group, {dragElId : this.proxy.id, resizeFrame: false, isTarget: false, scroll: this.scroll === true}); this.dragging = false; }; Ext.extend(Ext.dd.DragSource, Ext.dd.DDProxy, { dropAllowed : "x-dd-drop-ok", dropNotAllowed : "x-dd-drop-nodrop", getDragData : function(e){ return this.dragData; }, onDragEnter : function(e, id){ var target = Ext.dd.DragDropMgr.getDDById(id); this.cachedTarget = target; if(this.beforeDragEnter(target, e, id) !== false){ if(target.isNotifyTarget){ var status = target.notifyEnter(this, e, this.dragData); this.proxy.setStatus(status); }else{ this.proxy.setStatus(this.dropAllowed); } if(this.afterDragEnter){ this.afterDragEnter(target, e, id); } } }, beforeDragEnter : function(target, e, id){ return true; }, alignElWithMouse: function() { Ext.dd.DragSource.superclass.alignElWithMouse.apply(this, arguments); this.proxy.sync(); }, onDragOver : function(e, id){ var target = this.cachedTarget || Ext.dd.DragDropMgr.getDDById(id); if(this.beforeDragOver(target, e, id) !== false){ if(target.isNotifyTarget){ var status = target.notifyOver(this, e, this.dragData); this.proxy.setStatus(status); } if(this.afterDragOver){ this.afterDragOver(target, e, id); } } }, beforeDragOver : function(target, e, id){ return true; }, onDragOut : function(e, id){ var target = this.cachedTarget || Ext.dd.DragDropMgr.getDDById(id); if(this.beforeDragOut(target, e, id) !== false){ if(target.isNotifyTarget){ target.notifyOut(this, e, this.dragData); } this.proxy.reset(); if(this.afterDragOut){ this.afterDragOut(target, e, id); } } this.cachedTarget = null; }, beforeDragOut : function(target, e, id){ return true; }, onDragDrop : function(e, id){ var target = this.cachedTarget || Ext.dd.DragDropMgr.getDDById(id); if(this.beforeDragDrop(target, e, id) !== false){ if(target.isNotifyTarget){ if(target.notifyDrop(this, e, this.dragData)){ this.onValidDrop(target, e, id); }else{ this.onInvalidDrop(target, e, id); } }else{ this.onValidDrop(target, e, id); } if(this.afterDragDrop){ this.afterDragDrop(target, e, id); } } delete this.cachedTarget; }, beforeDragDrop : function(target, e, id){ return true; }, onValidDrop : function(target, e, id){ this.hideProxy(); if(this.afterValidDrop){ this.afterValidDrop(target, e, id); } }, getRepairXY : function(e, data){ return this.el.getXY(); }, onInvalidDrop : function(target, e, id){ this.beforeInvalidDrop(target, e, id); if(this.cachedTarget){ if(this.cachedTarget.isNotifyTarget){ this.cachedTarget.notifyOut(this, e, this.dragData); } this.cacheTarget = null; } this.proxy.repair(this.getRepairXY(e, this.dragData), this.afterRepair, this); if(this.afterInvalidDrop){ this.afterInvalidDrop(e, id); } }, afterRepair : function(){ if(Ext.enableFx){ this.el.highlight(this.hlColor || "c3daf9"); } this.dragging = false; }, beforeInvalidDrop : function(target, e, id){ return true; }, handleMouseDown : function(e){ if(this.dragging) { return; } var data = this.getDragData(e); if(data && this.onBeforeDrag(data, e) !== false){ this.dragData = data; this.proxy.stop(); Ext.dd.DragSource.superclass.handleMouseDown.apply(this, arguments); } }, onBeforeDrag : function(data, e){ return true; }, onStartDrag : Ext.emptyFn, startDrag : function(x, y){ this.proxy.reset(); this.dragging = true; this.proxy.update(""); this.onInitDrag(x, y); this.proxy.show(); }, onInitDrag : function(x, y){ var clone = this.el.dom.cloneNode(true); clone.id = Ext.id(); this.proxy.update(clone); this.onStartDrag(x, y); return true; }, getProxy : function(){ return this.proxy; }, hideProxy : function(){ this.proxy.hide(); this.proxy.reset(true); this.dragging = false; }, triggerCacheRefresh : function(){ Ext.dd.DDM.refreshCache(this.groups); }, b4EndDrag: function(e) { }, endDrag : function(e){ this.onEndDrag(this.dragData, e); }, onEndDrag : function(data, e){ }, autoOffset : function(x, y) { this.setDelta(-12, -20); }, destroy: function(){ Ext.dd.DragSource.superclass.destroy.call(this); Ext.destroy(this.proxy); } }); Ext.dd.DropTarget = Ext.extend(Ext.dd.DDTarget, { constructor : function(el, config){ this.el = Ext.get(el); Ext.apply(this, config); if(this.containerScroll){ Ext.dd.ScrollManager.register(this.el); } Ext.dd.DropTarget.superclass.constructor.call(this, this.el.dom, this.ddGroup || this.group, {isTarget: true}); }, dropAllowed : "x-dd-drop-ok", dropNotAllowed : "x-dd-drop-nodrop", isTarget : true, isNotifyTarget : true, notifyEnter : function(dd, e, data){ if(this.overClass){ this.el.addClass(this.overClass); } return this.dropAllowed; }, notifyOver : function(dd, e, data){ return this.dropAllowed; }, notifyOut : function(dd, e, data){ if(this.overClass){ this.el.removeClass(this.overClass); } }, notifyDrop : function(dd, e, data){ return false; }, destroy : function(){ Ext.dd.DropTarget.superclass.destroy.call(this); if(this.containerScroll){ Ext.dd.ScrollManager.unregister(this.el); } } }); Ext.dd.DragZone = Ext.extend(Ext.dd.DragSource, { constructor : function(el, config){ Ext.dd.DragZone.superclass.constructor.call(this, el, config); if(this.containerScroll){ Ext.dd.ScrollManager.register(this.el); } }, getDragData : function(e){ return Ext.dd.Registry.getHandleFromEvent(e); }, onInitDrag : function(x, y){ this.proxy.update(this.dragData.ddel.cloneNode(true)); this.onStartDrag(x, y); return true; }, afterRepair : function(){ if(Ext.enableFx){ Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor || "c3daf9"); } this.dragging = false; }, getRepairXY : function(e){ return Ext.Element.fly(this.dragData.ddel).getXY(); }, destroy : function(){ Ext.dd.DragZone.superclass.destroy.call(this); if(this.containerScroll){ Ext.dd.ScrollManager.unregister(this.el); } } }); Ext.dd.DropZone = function(el, config){ Ext.dd.DropZone.superclass.constructor.call(this, el, config); }; Ext.extend(Ext.dd.DropZone, Ext.dd.DropTarget, { getTargetFromEvent : function(e){ return Ext.dd.Registry.getTargetFromEvent(e); }, onNodeEnter : function(n, dd, e, data){ }, onNodeOver : function(n, dd, e, data){ return this.dropAllowed; }, onNodeOut : function(n, dd, e, data){ }, onNodeDrop : function(n, dd, e, data){ return false; }, onContainerOver : function(dd, e, data){ return this.dropNotAllowed; }, onContainerDrop : function(dd, e, data){ return false; }, notifyEnter : function(dd, e, data){ return this.dropNotAllowed; }, notifyOver : function(dd, e, data){ var n = this.getTargetFromEvent(e); if(!n){ if(this.lastOverNode){ this.onNodeOut(this.lastOverNode, dd, e, data); this.lastOverNode = null; } return this.onContainerOver(dd, e, data); } if(this.lastOverNode != n){ if(this.lastOverNode){ this.onNodeOut(this.lastOverNode, dd, e, data); } this.onNodeEnter(n, dd, e, data); this.lastOverNode = n; } return this.onNodeOver(n, dd, e, data); }, notifyOut : function(dd, e, data){ if(this.lastOverNode){ this.onNodeOut(this.lastOverNode, dd, e, data); this.lastOverNode = null; } }, notifyDrop : function(dd, e, data){ if(this.lastOverNode){ this.onNodeOut(this.lastOverNode, dd, e, data); this.lastOverNode = null; } var n = this.getTargetFromEvent(e); return n ? this.onNodeDrop(n, dd, e, data) : this.onContainerDrop(dd, e, data); }, triggerCacheRefresh : function(){ Ext.dd.DDM.refreshCache(this.groups); } }); Ext.Element.addMethods({ initDD : function(group, config, overrides){ var dd = new Ext.dd.DD(Ext.id(this.dom), group, config); return Ext.apply(dd, overrides); }, initDDProxy : function(group, config, overrides){ var dd = new Ext.dd.DDProxy(Ext.id(this.dom), group, config); return Ext.apply(dd, overrides); }, initDDTarget : function(group, config, overrides){ var dd = new Ext.dd.DDTarget(Ext.id(this.dom), group, config); return Ext.apply(dd, overrides); } }); Ext.data.Api = (function() { var validActions = {}; return { actions : { create : 'create', read : 'read', update : 'update', destroy : 'destroy' }, restActions : { create : 'POST', read : 'GET', update : 'PUT', destroy : 'DELETE' }, isAction : function(action) { return (Ext.data.Api.actions[action]) ? true : false; }, getVerb : function(name) { if (validActions[name]) { return validActions[name]; } for (var verb in this.actions) { if (this.actions[verb] === name) { validActions[name] = verb; break; } } return (validActions[name] !== undefined) ? validActions[name] : null; }, isValid : function(api){ var invalid = []; var crud = this.actions; for (var action in api) { if (!(action in crud)) { invalid.push(action); } } return (!invalid.length) ? true : invalid; }, hasUniqueUrl : function(proxy, verb) { var url = (proxy.api[verb]) ? proxy.api[verb].url : null; var unique = true; for (var action in proxy.api) { if ((unique = (action === verb) ? true : (proxy.api[action].url != url) ? true : false) === false) { break; } } return unique; }, prepare : function(proxy) { if (!proxy.api) { proxy.api = {}; } for (var verb in this.actions) { var action = this.actions[verb]; proxy.api[action] = proxy.api[action] || proxy.url || proxy.directFn; if (typeof(proxy.api[action]) == 'string') { proxy.api[action] = { url: proxy.api[action], method: (proxy.restful === true) ? Ext.data.Api.restActions[action] : undefined }; } } }, restify : function(proxy) { proxy.restful = true; for (var verb in this.restActions) { proxy.api[this.actions[verb]].method || (proxy.api[this.actions[verb]].method = this.restActions[verb]); } proxy.onWrite = proxy.onWrite.createInterceptor(function(action, o, response, rs) { var reader = o.reader; var res = new Ext.data.Response({ action: action, raw: response }); switch (response.status) { case 200: return true; break; case 201: if (Ext.isEmpty(res.raw.responseText)) { res.success = true; } else { return true; } break; case 204: res.success = true; res.data = null; break; default: return true; break; } if (res.success === true) { this.fireEvent("write", this, action, res.data, res, rs, o.request.arg); } else { this.fireEvent('exception', this, 'remote', action, o, res, rs); } o.request.callback.call(o.request.scope, res.data, res, res.success); return false; }, proxy); } }; })(); Ext.data.Response = function(params, response) { Ext.apply(this, params, { raw: response }); }; Ext.data.Response.prototype = { message : null, success : false, status : null, root : null, raw : null, getMessage : function() { return this.message; }, getSuccess : function() { return this.success; }, getStatus : function() { return this.status; }, getRoot : function() { return this.root; }, getRawResponse : function() { return this.raw; } }; Ext.data.Api.Error = Ext.extend(Ext.Error, { constructor : function(message, arg) { this.arg = arg; Ext.Error.call(this, message); }, name: 'Ext.data.Api' }); Ext.apply(Ext.data.Api.Error.prototype, { lang: { 'action-url-undefined': 'No fallback url defined for this action. When defining a DataProxy api, please be sure to define an url for each CRUD action in Ext.data.Api.actions or define a default url in addition to your api-configuration.', 'invalid': 'received an invalid API-configuration. Please ensure your proxy API-configuration contains only the actions defined in Ext.data.Api.actions', 'invalid-url': 'Invalid url. Please review your proxy configuration.', 'execute': 'Attempted to execute an unknown action. Valid API actions are defined in Ext.data.Api.actions"' } }); Ext.data.SortTypes = { none : function(s){ return s; }, stripTagsRE : /<\/?[^>]+>/gi, asText : function(s){ return String(s).replace(this.stripTagsRE, ""); }, asUCText : function(s){ return String(s).toUpperCase().replace(this.stripTagsRE, ""); }, asUCString : function(s) { return String(s).toUpperCase(); }, asDate : function(s) { if(!s){ return 0; } if(Ext.isDate(s)){ return s.getTime(); } return Date.parse(String(s)); }, asFloat : function(s) { var val = parseFloat(String(s).replace(/,/g, "")); return isNaN(val) ? 0 : val; }, asInt : function(s) { var val = parseInt(String(s).replace(/,/g, ""), 10); return isNaN(val) ? 0 : val; } }; Ext.data.Record = function(data, id){ this.id = (id || id === 0) ? id : Ext.data.Record.id(this); this.data = data || {}; }; Ext.data.Record.create = function(o){ var f = Ext.extend(Ext.data.Record, {}); var p = f.prototype; p.fields = new Ext.util.MixedCollection(false, function(field){ return field.name; }); for(var i = 0, len = o.length; i < len; i++){ p.fields.add(new Ext.data.Field(o[i])); } f.getField = function(name){ return p.fields.get(name); }; return f; }; Ext.data.Record.PREFIX = 'ext-record'; Ext.data.Record.AUTO_ID = 1; Ext.data.Record.EDIT = 'edit'; Ext.data.Record.REJECT = 'reject'; Ext.data.Record.COMMIT = 'commit'; Ext.data.Record.id = function(rec) { rec.phantom = true; return [Ext.data.Record.PREFIX, '-', Ext.data.Record.AUTO_ID++].join(''); }; Ext.data.Record.prototype = { dirty : false, editing : false, error : null, modified : null, phantom : false, join : function(store){ this.store = store; }, set : function(name, value){ var encode = Ext.isPrimitive(value) ? String : Ext.encode; if(encode(this.data[name]) == encode(value)) { return; } this.dirty = true; if(!this.modified){ this.modified = {}; } if(this.modified[name] === undefined){ this.modified[name] = this.data[name]; } this.data[name] = value; if(!this.editing){ this.afterEdit(); } }, afterEdit : function(){ if (this.store != undefined && typeof this.store.afterEdit == "function") { this.store.afterEdit(this); } }, afterReject : function(){ if(this.store){ this.store.afterReject(this); } }, afterCommit : function(){ if(this.store){ this.store.afterCommit(this); } }, get : function(name){ return this.data[name]; }, beginEdit : function(){ this.editing = true; this.modified = this.modified || {}; }, cancelEdit : function(){ this.editing = false; delete this.modified; }, endEdit : function(){ this.editing = false; if(this.dirty){ this.afterEdit(); } }, reject : function(silent){ var m = this.modified; for(var n in m){ if(typeof m[n] != "function"){ this.data[n] = m[n]; } } this.dirty = false; delete this.modified; this.editing = false; if(silent !== true){ this.afterReject(); } }, commit : function(silent){ this.dirty = false; delete this.modified; this.editing = false; if(silent !== true){ this.afterCommit(); } }, getChanges : function(){ var m = this.modified, cs = {}; for(var n in m){ if(m.hasOwnProperty(n)){ cs[n] = this.data[n]; } } return cs; }, hasError : function(){ return this.error !== null; }, clearError : function(){ this.error = null; }, copy : function(newId) { return new this.constructor(Ext.apply({}, this.data), newId || this.id); }, isModified : function(fieldName){ return !!(this.modified && this.modified.hasOwnProperty(fieldName)); }, isValid : function() { return this.fields.find(function(f) { return (f.allowBlank === false && Ext.isEmpty(this.data[f.name])) ? true : false; },this) ? false : true; }, markDirty : function(){ this.dirty = true; if(!this.modified){ this.modified = {}; } this.fields.each(function(f) { this.modified[f.name] = this.data[f.name]; },this); } }; Ext.StoreMgr = Ext.apply(new Ext.util.MixedCollection(), { register : function(){ for(var i = 0, s; (s = arguments[i]); i++){ this.add(s); } }, unregister : function(){ for(var i = 0, s; (s = arguments[i]); i++){ this.remove(this.lookup(s)); } }, lookup : function(id){ if(Ext.isArray(id)){ var fields = ['field1'], expand = !Ext.isArray(id[0]); if(!expand){ for(var i = 2, len = id[0].length; i <= len; ++i){ fields.push('field' + i); } } return new Ext.data.ArrayStore({ fields: fields, data: id, expandData: expand, autoDestroy: true, autoCreated: true }); } return Ext.isObject(id) ? (id.events ? id : Ext.create(id, 'store')) : this.get(id); }, getKey : function(o){ return o.storeId; } }); Ext.data.Store = Ext.extend(Ext.util.Observable, { writer : undefined, remoteSort : false, autoDestroy : false, pruneModifiedRecords : false, lastOptions : null, autoSave : true, batch : true, restful: false, paramNames : undefined, defaultParamNames : { start : 'start', limit : 'limit', sort : 'sort', dir : 'dir' }, isDestroyed: false, hasMultiSort: false, batchKey : '_ext_batch_', constructor : function(config){ this.data = new Ext.util.MixedCollection(false); this.data.getKey = function(o){ return o.id; }; this.removed = []; if(config && config.data){ this.inlineData = config.data; delete config.data; } Ext.apply(this, config); this.baseParams = Ext.isObject(this.baseParams) ? this.baseParams : {}; this.paramNames = Ext.applyIf(this.paramNames || {}, this.defaultParamNames); if((this.url || this.api) && !this.proxy){ this.proxy = new Ext.data.HttpProxy({url: this.url, api: this.api}); } if (this.restful === true && this.proxy) { this.batch = false; Ext.data.Api.restify(this.proxy); } if(this.reader){ if(!this.recordType){ this.recordType = this.reader.recordType; } if(this.reader.onMetaChange){ this.reader.onMetaChange = this.reader.onMetaChange.createSequence(this.onMetaChange, this); } if (this.writer) { if (this.writer instanceof(Ext.data.DataWriter) === false) { this.writer = this.buildWriter(this.writer); } this.writer.meta = this.reader.meta; this.pruneModifiedRecords = true; } } if(this.recordType){ this.fields = this.recordType.prototype.fields; } this.modified = []; this.addEvents( 'datachanged', 'metachange', 'add', 'remove', 'update', 'clear', 'exception', 'beforeload', 'load', 'loadexception', 'beforewrite', 'write', 'beforesave', 'save' ); if(this.proxy){ this.relayEvents(this.proxy, ['loadexception', 'exception']); } if (this.writer) { this.on({ scope: this, add: this.createRecords, remove: this.destroyRecord, update: this.updateRecord, clear: this.onClear }); } this.sortToggle = {}; if(this.sortField){ this.setDefaultSort(this.sortField, this.sortDir); }else if(this.sortInfo){ this.setDefaultSort(this.sortInfo.field, this.sortInfo.direction); } Ext.data.Store.superclass.constructor.call(this); if(this.id){ this.storeId = this.id; delete this.id; } if(this.storeId){ Ext.StoreMgr.register(this); } if(this.inlineData){ this.loadData(this.inlineData); delete this.inlineData; }else if(this.autoLoad){ this.load.defer(10, this, [ typeof this.autoLoad == 'object' ? this.autoLoad : undefined]); } this.batchCounter = 0; this.batches = {}; }, buildWriter : function(config) { var klass = undefined, type = (config.format || 'json').toLowerCase(); switch (type) { case 'json': klass = Ext.data.JsonWriter; break; case 'xml': klass = Ext.data.XmlWriter; break; default: klass = Ext.data.JsonWriter; } return new klass(config); }, destroy : function(){ if(!this.isDestroyed){ if(this.storeId){ Ext.StoreMgr.unregister(this); } this.clearData(); this.data = null; Ext.destroy(this.proxy); this.reader = this.writer = null; this.purgeListeners(); this.isDestroyed = true; } }, add : function(records) { var i, len, record, index; records = [].concat(records); if (records.length < 1) { return; } for (i = 0, len = records.length; i < len; i++) { record = records[i]; record.join(this); if (record.dirty || record.phantom) { this.modified.push(record); } } index = this.data.length; this.data.addAll(records); if (this.snapshot) { this.snapshot.addAll(records); } this.fireEvent('add', this, records, index); }, addSorted : function(record){ var index = this.findInsertIndex(record); this.insert(index, record); }, doUpdate: function(rec){ var id = rec.id; this.getById(id).join(null); this.data.replace(id, rec); if (this.snapshot) { this.snapshot.replace(id, rec); } rec.join(this); this.fireEvent('update', this, rec, Ext.data.Record.COMMIT); }, remove : function(record){ if(Ext.isArray(record)){ Ext.each(record, function(r){ this.remove(r); }, this); return; } var index = this.data.indexOf(record); if(index > -1){ record.join(null); this.data.removeAt(index); } if(this.pruneModifiedRecords){ this.modified.remove(record); } if(this.snapshot){ this.snapshot.remove(record); } if(index > -1){ this.fireEvent('remove', this, record, index); } }, removeAt : function(index){ this.remove(this.getAt(index)); }, removeAll : function(silent){ var items = []; this.each(function(rec){ items.push(rec); }); this.clearData(); if(this.snapshot){ this.snapshot.clear(); } if(this.pruneModifiedRecords){ this.modified = []; } if (silent !== true) { this.fireEvent('clear', this, items); } }, onClear: function(store, records){ Ext.each(records, function(rec, index){ this.destroyRecord(this, rec, index); }, this); }, insert : function(index, records) { var i, len, record; records = [].concat(records); for (i = 0, len = records.length; i < len; i++) { record = records[i]; this.data.insert(index + i, record); record.join(this); if (record.dirty || record.phantom) { this.modified.push(record); } } if (this.snapshot) { this.snapshot.addAll(records); } this.fireEvent('add', this, records, index); }, indexOf : function(record){ return this.data.indexOf(record); }, indexOfId : function(id){ return this.data.indexOfKey(id); }, getById : function(id){ return (this.snapshot || this.data).key(id); }, getAt : function(index){ return this.data.itemAt(index); }, getRange : function(start, end){ return this.data.getRange(start, end); }, storeOptions : function(o){ o = Ext.apply({}, o); delete o.callback; delete o.scope; this.lastOptions = o; }, clearData: function(){ this.data.each(function(rec) { rec.join(null); }); this.data.clear(); }, load : function(options) { options = Ext.apply({}, options); this.storeOptions(options); if(this.sortInfo && this.remoteSort){ var pn = this.paramNames; options.params = Ext.apply({}, options.params); options.params[pn.sort] = this.sortInfo.field; options.params[pn.dir] = this.sortInfo.direction; } try { return this.execute('read', null, options); } catch(e) { this.handleException(e); return false; } }, updateRecord : function(store, record, action) { if (action == Ext.data.Record.EDIT && this.autoSave === true && (!record.phantom || (record.phantom && record.isValid()))) { this.save(); } }, createRecords : function(store, records, index) { var modified = this.modified, length = records.length, record, i; for (i = 0; i < length; i++) { record = records[i]; if (record.phantom && record.isValid()) { record.markDirty(); if (modified.indexOf(record) == -1) { modified.push(record); } } } if (this.autoSave === true) { this.save(); } }, destroyRecord : function(store, record, index) { if (this.modified.indexOf(record) != -1) { this.modified.remove(record); } if (!record.phantom) { this.removed.push(record); record.lastIndex = index; if (this.autoSave === true) { this.save(); } } }, execute : function(action, rs, options, batch) { if (!Ext.data.Api.isAction(action)) { throw new Ext.data.Api.Error('execute', action); } options = Ext.applyIf(options||{}, { params: {} }); if(batch !== undefined){ this.addToBatch(batch); } var doRequest = true; if (action === 'read') { doRequest = this.fireEvent('beforeload', this, options); Ext.applyIf(options.params, this.baseParams); } else { if (this.writer.listful === true && this.restful !== true) { rs = (Ext.isArray(rs)) ? rs : [rs]; } else if (Ext.isArray(rs) && rs.length == 1) { rs = rs.shift(); } if ((doRequest = this.fireEvent('beforewrite', this, action, rs, options)) !== false) { this.writer.apply(options.params, this.baseParams, action, rs); } } if (doRequest !== false) { if (this.writer && this.proxy.url && !this.proxy.restful && !Ext.data.Api.hasUniqueUrl(this.proxy, action)) { options.params.xaction = action; } this.proxy.request(Ext.data.Api.actions[action], rs, options.params, this.reader, this.createCallback(action, rs, batch), this, options); } return doRequest; }, save : function() { if (!this.writer) { throw new Ext.data.Store.Error('writer-undefined'); } var queue = [], len, trans, batch, data = {}, i; if(this.removed.length){ queue.push(['destroy', this.removed]); } var rs = [].concat(this.getModifiedRecords()); if(rs.length){ var phantoms = []; for(i = rs.length-1; i >= 0; i--){ if(rs[i].phantom === true){ var rec = rs.splice(i, 1).shift(); if(rec.isValid()){ phantoms.push(rec); } }else if(!rs[i].isValid()){ rs.splice(i,1); } } if(phantoms.length){ queue.push(['create', phantoms]); } if(rs.length){ queue.push(['update', rs]); } } len = queue.length; if(len){ batch = ++this.batchCounter; for(i = 0; i < len; ++i){ trans = queue[i]; data[trans[0]] = trans[1]; } if(this.fireEvent('beforesave', this, data) !== false){ for(i = 0; i < len; ++i){ trans = queue[i]; this.doTransaction(trans[0], trans[1], batch); } return batch; } } return -1; }, doTransaction : function(action, rs, batch) { function transaction(records) { try{ this.execute(action, records, undefined, batch); }catch (e){ this.handleException(e); } } if(this.batch === false){ for(var i = 0, len = rs.length; i < len; i++){ transaction.call(this, rs[i]); } }else{ transaction.call(this, rs); } }, addToBatch : function(batch){ var b = this.batches, key = this.batchKey + batch, o = b[key]; if(!o){ b[key] = o = { id: batch, count: 0, data: {} }; } ++o.count; }, removeFromBatch : function(batch, action, data){ var b = this.batches, key = this.batchKey + batch, o = b[key], arr; if(o){ arr = o.data[action] || []; o.data[action] = arr.concat(data); if(o.count === 1){ data = o.data; delete b[key]; this.fireEvent('save', this, batch, data); }else{ --o.count; } } }, createCallback : function(action, rs, batch) { var actions = Ext.data.Api.actions; return (action == 'read') ? this.loadRecords : function(data, response, success) { this['on' + Ext.util.Format.capitalize(action) + 'Records'](success, rs, [].concat(data)); if (success === true) { this.fireEvent('write', this, action, data, response, rs); } this.removeFromBatch(batch, action, data); }; }, clearModified : function(rs) { if (Ext.isArray(rs)) { for (var n=rs.length-1;n>=0;n--) { this.modified.splice(this.modified.indexOf(rs[n]), 1); } } else { this.modified.splice(this.modified.indexOf(rs), 1); } }, reMap : function(record) { if (Ext.isArray(record)) { for (var i = 0, len = record.length; i < len; i++) { this.reMap(record[i]); } } else { delete this.data.map[record._phid]; this.data.map[record.id] = record; var index = this.data.keys.indexOf(record._phid); this.data.keys.splice(index, 1, record.id); delete record._phid; } }, onCreateRecords : function(success, rs, data) { if (success === true) { try { this.reader.realize(rs, data); } catch (e) { this.handleException(e); if (Ext.isArray(rs)) { this.onCreateRecords(success, rs, data); } } } }, onUpdateRecords : function(success, rs, data) { if (success === true) { try { this.reader.update(rs, data); } catch (e) { this.handleException(e); if (Ext.isArray(rs)) { this.onUpdateRecords(success, rs, data); } } } }, onDestroyRecords : function(success, rs, data) { rs = (rs instanceof Ext.data.Record) ? [rs] : [].concat(rs); for (var i=0,len=rs.length;i=0;i--) { this.insert(rs[i].lastIndex, rs[i]); } } }, handleException : function(e) { Ext.handleError(e); }, reload : function(options){ this.load(Ext.applyIf(options||{}, this.lastOptions)); }, loadRecords : function(o, options, success){ var i, len; if (this.isDestroyed === true) { return; } if(!o || success === false){ if(success !== false){ this.fireEvent('load', this, [], options); } if(options.callback){ options.callback.call(options.scope || this, [], options, false, o); } return; } var r = o.records, t = o.totalRecords || r.length; if(!options || options.add !== true){ if(this.pruneModifiedRecords){ this.modified = []; } for(i = 0, len = r.length; i < len; i++){ r[i].join(this); } if(this.snapshot){ this.data = this.snapshot; delete this.snapshot; } this.clearData(); this.data.addAll(r); this.totalLength = t; this.applySort(); this.fireEvent('datachanged', this); }else{ var toAdd = [], rec, cnt = 0; for(i = 0, len = r.length; i < len; ++i){ rec = r[i]; if(this.indexOfId(rec.id) > -1){ this.doUpdate(rec); }else{ toAdd.push(rec); ++cnt; } } this.totalLength = Math.max(t, this.data.length + cnt); this.add(toAdd); } this.fireEvent('load', this, r, options); if(options.callback){ options.callback.call(options.scope || this, r, options, true); } }, loadData : function(o, append){ var r = this.reader.readRecords(o); this.loadRecords(r, {add: append}, true); }, getCount : function(){ return this.data.length || 0; }, getTotalCount : function(){ return this.totalLength || 0; }, getSortState : function(){ return this.sortInfo; }, applySort : function(){ if ((this.sortInfo || this.multiSortInfo) && !this.remoteSort) { this.sortData(); } }, sortData : function() { var sortInfo = this.hasMultiSort ? this.multiSortInfo : this.sortInfo, direction = sortInfo.direction || "ASC", sorters = sortInfo.sorters, sortFns = []; if (!this.hasMultiSort) { sorters = [{direction: direction, field: sortInfo.field}]; } for (var i=0, j = sorters.length; i < j; i++) { sortFns.push(this.createSortFunction(sorters[i].field, sorters[i].direction)); } if (sortFns.length == 0) { return; } var directionModifier = direction.toUpperCase() == "DESC" ? -1 : 1; var fn = function(r1, r2) { var result = sortFns[0].call(this, r1, r2); if (sortFns.length > 1) { for (var i=1, j = sortFns.length; i < j; i++) { result = result || sortFns[i].call(this, r1, r2); } } return directionModifier * result; }; this.data.sort(direction, fn); if (this.snapshot && this.snapshot != this.data) { this.snapshot.sort(direction, fn); } }, createSortFunction: function(field, direction) { direction = direction || "ASC"; var directionModifier = direction.toUpperCase() == "DESC" ? -1 : 1; var sortType = this.fields.get(field).sortType; return function(r1, r2) { var v1 = sortType(r1.data[field]), v2 = sortType(r2.data[field]); return directionModifier * (v1 > v2 ? 1 : (v1 < v2 ? -1 : 0)); }; }, setDefaultSort : function(field, dir) { dir = dir ? dir.toUpperCase() : 'ASC'; this.sortInfo = {field: field, direction: dir}; this.sortToggle[field] = dir; }, sort : function(fieldName, dir) { if (Ext.isArray(arguments[0])) { return this.multiSort.call(this, fieldName, dir); } else { return this.singleSort(fieldName, dir); } }, singleSort: function(fieldName, dir) { var field = this.fields.get(fieldName); if (!field) { return false; } var name = field.name, sortInfo = this.sortInfo || null, sortToggle = this.sortToggle ? this.sortToggle[name] : null; if (!dir) { if (sortInfo && sortInfo.field == name) { dir = (this.sortToggle[name] || 'ASC').toggle('ASC', 'DESC'); } else { dir = field.sortDir; } } this.sortToggle[name] = dir; this.sortInfo = {field: name, direction: dir}; this.hasMultiSort = false; if (this.remoteSort) { if (!this.load(this.lastOptions)) { if (sortToggle) { this.sortToggle[name] = sortToggle; } if (sortInfo) { this.sortInfo = sortInfo; } } } else { this.applySort(); this.fireEvent('datachanged', this); } return true; }, multiSort: function(sorters, direction) { this.hasMultiSort = true; direction = direction || "ASC"; if (this.multiSortInfo && direction == this.multiSortInfo.direction) { direction = direction.toggle("ASC", "DESC"); } this.multiSortInfo = { sorters : sorters, direction: direction }; if (this.remoteSort) { this.singleSort(sorters[0].field, sorters[0].direction); } else { this.applySort(); this.fireEvent('datachanged', this); } }, each : function(fn, scope){ this.data.each(fn, scope); }, getModifiedRecords : function(){ return this.modified; }, sum : function(property, start, end){ var rs = this.data.items, v = 0; start = start || 0; end = (end || end === 0) ? end : rs.length-1; for(var i = start; i <= end; i++){ v += (rs[i].data[property] || 0); } return v; }, createFilterFn : function(property, value, anyMatch, caseSensitive, exactMatch){ if(Ext.isEmpty(value, false)){ return false; } value = this.data.createValueMatcher(value, anyMatch, caseSensitive, exactMatch); return function(r) { return value.test(r.data[property]); }; }, createMultipleFilterFn: function(filters) { return function(record) { var isMatch = true; for (var i=0, j = filters.length; i < j; i++) { var filter = filters[i], fn = filter.fn, scope = filter.scope; isMatch = isMatch && fn.call(scope, record); } return isMatch; }; }, filter : function(property, value, anyMatch, caseSensitive, exactMatch){ var fn; if (Ext.isObject(property)) { property = [property]; } if (Ext.isArray(property)) { var filters = []; for (var i=0, j = property.length; i < j; i++) { var filter = property[i], func = filter.fn, scope = filter.scope || this; if (!Ext.isFunction(func)) { func = this.createFilterFn(filter.property, filter.value, filter.anyMatch, filter.caseSensitive, filter.exactMatch); } filters.push({fn: func, scope: scope}); } fn = this.createMultipleFilterFn(filters); } else { fn = this.createFilterFn(property, value, anyMatch, caseSensitive, exactMatch); } return fn ? this.filterBy(fn) : this.clearFilter(); }, filterBy : function(fn, scope){ this.snapshot = this.snapshot || this.data; this.data = this.queryBy(fn, scope || this); this.fireEvent('datachanged', this); }, clearFilter : function(suppressEvent){ if(this.isFiltered()){ this.data = this.snapshot; delete this.snapshot; if(suppressEvent !== true){ this.fireEvent('datachanged', this); } } }, isFiltered : function(){ return !!this.snapshot && this.snapshot != this.data; }, query : function(property, value, anyMatch, caseSensitive){ var fn = this.createFilterFn(property, value, anyMatch, caseSensitive); return fn ? this.queryBy(fn) : this.data.clone(); }, queryBy : function(fn, scope){ var data = this.snapshot || this.data; return data.filterBy(fn, scope||this); }, find : function(property, value, start, anyMatch, caseSensitive){ var fn = this.createFilterFn(property, value, anyMatch, caseSensitive); return fn ? this.data.findIndexBy(fn, null, start) : -1; }, findExact: function(property, value, start){ return this.data.findIndexBy(function(rec){ return rec.get(property) === value; }, this, start); }, findBy : function(fn, scope, start){ return this.data.findIndexBy(fn, scope, start); }, collect : function(dataIndex, allowNull, bypassFilter){ var d = (bypassFilter === true && this.snapshot) ? this.snapshot.items : this.data.items; var v, sv, r = [], l = {}; for(var i = 0, len = d.length; i < len; i++){ v = d[i].data[dataIndex]; sv = String(v); if((allowNull || !Ext.isEmpty(v)) && !l[sv]){ l[sv] = true; r[r.length] = v; } } return r; }, afterEdit : function(record){ if(this.modified.indexOf(record) == -1){ this.modified.push(record); } this.fireEvent('update', this, record, Ext.data.Record.EDIT); }, afterReject : function(record){ this.modified.remove(record); this.fireEvent('update', this, record, Ext.data.Record.REJECT); }, afterCommit : function(record){ this.modified.remove(record); this.fireEvent('update', this, record, Ext.data.Record.COMMIT); }, commitChanges : function(){ var modified = this.modified.slice(0), length = modified.length, i; for (i = 0; i < length; i++){ modified[i].commit(); } this.modified = []; this.removed = []; }, rejectChanges : function() { var modified = this.modified.slice(0), removed = this.removed.slice(0).reverse(), mLength = modified.length, rLength = removed.length, i; for (i = 0; i < mLength; i++) { modified[i].reject(); } for (i = 0; i < rLength; i++) { this.insert(removed[i].lastIndex || 0, removed[i]); removed[i].reject(); } this.modified = []; this.removed = []; }, onMetaChange : function(meta){ this.recordType = this.reader.recordType; this.fields = this.recordType.prototype.fields; delete this.snapshot; if(this.reader.meta.sortInfo){ this.sortInfo = this.reader.meta.sortInfo; }else if(this.sortInfo && !this.fields.get(this.sortInfo.field)){ delete this.sortInfo; } if(this.writer){ this.writer.meta = this.reader.meta; } this.modified = []; this.fireEvent('metachange', this, this.reader.meta); }, findInsertIndex : function(record){ this.suspendEvents(); var data = this.data.clone(); this.data.add(record); this.applySort(); var index = this.data.indexOf(record); this.data = data; this.resumeEvents(); return index; }, setBaseParam : function (name, value){ this.baseParams = this.baseParams || {}; this.baseParams[name] = value; } }); Ext.reg('store', Ext.data.Store); Ext.data.Store.Error = Ext.extend(Ext.Error, { name: 'Ext.data.Store' }); Ext.apply(Ext.data.Store.Error.prototype, { lang: { 'writer-undefined' : 'Attempted to execute a write-action without a DataWriter installed.' } }); Ext.data.Field = Ext.extend(Object, { constructor : function(config){ if(Ext.isString(config)){ config = {name: config}; } Ext.apply(this, config); var types = Ext.data.Types, st = this.sortType, t; if(this.type){ if(Ext.isString(this.type)){ this.type = Ext.data.Types[this.type.toUpperCase()] || types.AUTO; } }else{ this.type = types.AUTO; } if(Ext.isString(st)){ this.sortType = Ext.data.SortTypes[st]; }else if(Ext.isEmpty(st)){ this.sortType = this.type.sortType; } if(!this.convert){ this.convert = this.type.convert; } }, dateFormat: null, useNull: false, defaultValue: "", mapping: null, sortType : null, sortDir : "ASC", allowBlank : true }); Ext.data.DataReader = function(meta, recordType){ this.meta = meta; this.recordType = Ext.isArray(recordType) ? Ext.data.Record.create(recordType) : recordType; if (this.recordType){ this.buildExtractors(); } }; Ext.data.DataReader.prototype = { getTotal: Ext.emptyFn, getRoot: Ext.emptyFn, getMessage: Ext.emptyFn, getSuccess: Ext.emptyFn, getId: Ext.emptyFn, buildExtractors : Ext.emptyFn, extractValues : Ext.emptyFn, realize: function(rs, data){ if (Ext.isArray(rs)) { for (var i = rs.length - 1; i >= 0; i--) { if (Ext.isArray(data)) { this.realize(rs.splice(i,1).shift(), data.splice(i,1).shift()); } else { this.realize(rs.splice(i,1).shift(), data); } } } else { if (Ext.isArray(data) && data.length == 1) { data = data.shift(); } if (!this.isData(data)) { throw new Ext.data.DataReader.Error('realize', rs); } rs.phantom = false; rs._phid = rs.id; rs.id = this.getId(data); rs.data = data; rs.commit(); rs.store.reMap(rs); } }, update : function(rs, data) { if (Ext.isArray(rs)) { for (var i=rs.length-1; i >= 0; i--) { if (Ext.isArray(data)) { this.update(rs.splice(i,1).shift(), data.splice(i,1).shift()); } else { this.update(rs.splice(i,1).shift(), data); } } } else { if (Ext.isArray(data) && data.length == 1) { data = data.shift(); } if (this.isData(data)) { rs.data = Ext.apply(rs.data, data); } rs.commit(); } }, extractData : function(root, returnRecords) { var rawName = (this instanceof Ext.data.JsonReader) ? 'json' : 'node'; var rs = []; if (this.isData(root) && !(this instanceof Ext.data.XmlReader)) { root = [root]; } var f = this.recordType.prototype.fields, fi = f.items, fl = f.length, rs = []; if (returnRecords === true) { var Record = this.recordType; for (var i = 0; i < root.length; i++) { var n = root[i]; var record = new Record(this.extractValues(n, fi, fl), this.getId(n)); record[rawName] = n; rs.push(record); } } else { for (var i = 0; i < root.length; i++) { var data = this.extractValues(root[i], fi, fl); data[this.meta.idProperty] = this.getId(root[i]); rs.push(data); } } return rs; }, isData : function(data) { return (data && Ext.isObject(data) && !Ext.isEmpty(this.getId(data))) ? true : false; }, onMetaChange : function(meta){ delete this.ef; this.meta = meta; this.recordType = Ext.data.Record.create(meta.fields); this.buildExtractors(); } }; Ext.data.DataReader.Error = Ext.extend(Ext.Error, { constructor : function(message, arg) { this.arg = arg; Ext.Error.call(this, message); }, name: 'Ext.data.DataReader' }); Ext.apply(Ext.data.DataReader.Error.prototype, { lang : { 'update': "#update received invalid data from server. Please see docs for DataReader#update and review your DataReader configuration.", 'realize': "#realize was called with invalid remote-data. Please see the docs for DataReader#realize and review your DataReader configuration.", 'invalid-response': "#readResponse received an invalid response from the server." } }); Ext.data.DataWriter = function(config){ Ext.apply(this, config); }; Ext.data.DataWriter.prototype = { writeAllFields : false, listful : false, apply : function(params, baseParams, action, rs) { var data = [], renderer = action + 'Record'; if (Ext.isArray(rs)) { Ext.each(rs, function(rec){ data.push(this[renderer](rec)); }, this); } else if (rs instanceof Ext.data.Record) { data = this[renderer](rs); } this.render(params, baseParams, data); }, render : Ext.emptyFn, updateRecord : Ext.emptyFn, createRecord : Ext.emptyFn, destroyRecord : Ext.emptyFn, toHash : function(rec, config) { var map = rec.fields.map, data = {}, raw = (this.writeAllFields === false && rec.phantom === false) ? rec.getChanges() : rec.data, m; Ext.iterate(raw, function(prop, value){ if((m = map[prop])){ data[m.mapping ? m.mapping : m.name] = value; } }); if (rec.phantom) { if (rec.fields.containsKey(this.meta.idProperty) && Ext.isEmpty(rec.data[this.meta.idProperty])) { delete data[this.meta.idProperty]; } } else { data[this.meta.idProperty] = rec.id; } return data; }, toArray : function(data) { var fields = []; Ext.iterate(data, function(k, v) {fields.push({name: k, value: v});},this); return fields; } }; Ext.data.DataProxy = function(conn){ conn = conn || {}; this.api = conn.api; this.url = conn.url; this.restful = conn.restful; this.listeners = conn.listeners; this.prettyUrls = conn.prettyUrls; this.addEvents( 'exception', 'beforeload', 'load', 'loadexception', 'beforewrite', 'write' ); Ext.data.DataProxy.superclass.constructor.call(this); try { Ext.data.Api.prepare(this); } catch (e) { if (e instanceof Ext.data.Api.Error) { e.toConsole(); } } Ext.data.DataProxy.relayEvents(this, ['beforewrite', 'write', 'exception']); }; Ext.extend(Ext.data.DataProxy, Ext.util.Observable, { restful: false, setApi : function() { if (arguments.length == 1) { var valid = Ext.data.Api.isValid(arguments[0]); if (valid === true) { this.api = arguments[0]; } else { throw new Ext.data.Api.Error('invalid', valid); } } else if (arguments.length == 2) { if (!Ext.data.Api.isAction(arguments[0])) { throw new Ext.data.Api.Error('invalid', arguments[0]); } this.api[arguments[0]] = arguments[1]; } Ext.data.Api.prepare(this); }, isApiAction : function(action) { return (this.api[action]) ? true : false; }, request : function(action, rs, params, reader, callback, scope, options) { if (!this.api[action] && !this.load) { throw new Ext.data.DataProxy.Error('action-undefined', action); } params = params || {}; if ((action === Ext.data.Api.actions.read) ? this.fireEvent("beforeload", this, params) : this.fireEvent("beforewrite", this, action, rs, params) !== false) { this.doRequest.apply(this, arguments); } else { callback.call(scope || this, null, options, false); } }, load : null, doRequest : function(action, rs, params, reader, callback, scope, options) { this.load(params, reader, callback, scope, options); }, onRead : Ext.emptyFn, onWrite : Ext.emptyFn, buildUrl : function(action, record) { record = record || null; var url = (this.conn && this.conn.url) ? this.conn.url : (this.api[action]) ? this.api[action].url : this.url; if (!url) { throw new Ext.data.Api.Error('invalid-url', action); } var provides = null; var m = url.match(/(.*)(\.json|\.xml|\.html)$/); if (m) { provides = m[2]; url = m[1]; } if ((this.restful === true || this.prettyUrls === true) && record instanceof Ext.data.Record && !record.phantom) { url += '/' + record.id; } return (provides === null) ? url : url + provides; }, destroy: function(){ this.purgeListeners(); } }); Ext.apply(Ext.data.DataProxy, Ext.util.Observable.prototype); Ext.util.Observable.call(Ext.data.DataProxy); Ext.data.DataProxy.Error = Ext.extend(Ext.Error, { constructor : function(message, arg) { this.arg = arg; Ext.Error.call(this, message); }, name: 'Ext.data.DataProxy' }); Ext.apply(Ext.data.DataProxy.Error.prototype, { lang: { 'action-undefined': "DataProxy attempted to execute an API-action but found an undefined url / function. Please review your Proxy url/api-configuration.", 'api-invalid': 'Recieved an invalid API-configuration. Please ensure your proxy API-configuration contains only the actions from Ext.data.Api.actions.' } }); Ext.data.Request = function(params) { Ext.apply(this, params); }; Ext.data.Request.prototype = { action : undefined, rs : undefined, params: undefined, callback : Ext.emptyFn, scope : undefined, reader : undefined }; Ext.data.Response = function(params) { Ext.apply(this, params); }; Ext.data.Response.prototype = { action: undefined, success : undefined, message : undefined, data: undefined, raw: undefined, records: undefined }; Ext.data.ScriptTagProxy = function(config){ Ext.apply(this, config); Ext.data.ScriptTagProxy.superclass.constructor.call(this, config); this.head = document.getElementsByTagName("head")[0]; }; Ext.data.ScriptTagProxy.TRANS_ID = 1000; Ext.extend(Ext.data.ScriptTagProxy, Ext.data.DataProxy, { timeout : 30000, callbackParam : "callback", nocache : true, doRequest : function(action, rs, params, reader, callback, scope, arg) { var p = Ext.urlEncode(Ext.apply(params, this.extraParams)); var url = this.buildUrl(action, rs); if (!url) { throw new Ext.data.Api.Error('invalid-url', url); } url = Ext.urlAppend(url, p); if(this.nocache){ url = Ext.urlAppend(url, '_dc=' + (new Date().getTime())); } var transId = ++Ext.data.ScriptTagProxy.TRANS_ID; var trans = { id : transId, action: action, cb : "stcCallback"+transId, scriptId : "stcScript"+transId, params : params, arg : arg, url : url, callback : callback, scope : scope, reader : reader }; window[trans.cb] = this.createCallback(action, rs, trans); url += String.format("&{0}={1}", this.callbackParam, trans.cb); if(this.autoAbort !== false){ this.abort(); } trans.timeoutId = this.handleFailure.defer(this.timeout, this, [trans]); var script = document.createElement("script"); script.setAttribute("src", url); script.setAttribute("type", "text/javascript"); script.setAttribute("id", trans.scriptId); this.head.appendChild(script); this.trans = trans; }, createCallback : function(action, rs, trans) { var self = this; return function(res) { self.trans = false; self.destroyTrans(trans, true); if (action === Ext.data.Api.actions.read) { self.onRead.call(self, action, trans, res); } else { self.onWrite.call(self, action, trans, res, rs); } }; }, onRead : function(action, trans, res) { var result; try { result = trans.reader.readRecords(res); }catch(e){ this.fireEvent("loadexception", this, trans, res, e); this.fireEvent('exception', this, 'response', action, trans, res, e); trans.callback.call(trans.scope||window, null, trans.arg, false); return; } if (result.success === false) { this.fireEvent('loadexception', this, trans, res); this.fireEvent('exception', this, 'remote', action, trans, res, null); } else { this.fireEvent("load", this, res, trans.arg); } trans.callback.call(trans.scope||window, result, trans.arg, result.success); }, onWrite : function(action, trans, response, rs) { var reader = trans.reader; try { var res = reader.readResponse(action, response); } catch (e) { this.fireEvent('exception', this, 'response', action, trans, res, e); trans.callback.call(trans.scope||window, null, res, false); return; } if(!res.success === true){ this.fireEvent('exception', this, 'remote', action, trans, res, rs); trans.callback.call(trans.scope||window, null, res, false); return; } this.fireEvent("write", this, action, res.data, res, rs, trans.arg ); trans.callback.call(trans.scope||window, res.data, res, true); }, isLoading : function(){ return this.trans ? true : false; }, abort : function(){ if(this.isLoading()){ this.destroyTrans(this.trans); } }, destroyTrans : function(trans, isLoaded){ this.head.removeChild(document.getElementById(trans.scriptId)); clearTimeout(trans.timeoutId); if(isLoaded){ window[trans.cb] = undefined; try{ delete window[trans.cb]; }catch(e){} }else{ window[trans.cb] = function(){ window[trans.cb] = undefined; try{ delete window[trans.cb]; }catch(e){} }; } }, handleFailure : function(trans){ this.trans = false; this.destroyTrans(trans, false); if (trans.action === Ext.data.Api.actions.read) { this.fireEvent("loadexception", this, null, trans.arg); } this.fireEvent('exception', this, 'response', trans.action, { response: null, options: trans.arg }); trans.callback.call(trans.scope||window, null, trans.arg, false); }, destroy: function(){ this.abort(); Ext.data.ScriptTagProxy.superclass.destroy.call(this); } }); Ext.data.HttpProxy = function(conn){ Ext.data.HttpProxy.superclass.constructor.call(this, conn); this.conn = conn; this.conn.url = null; this.useAjax = !conn || !conn.events; var actions = Ext.data.Api.actions; this.activeRequest = {}; for (var verb in actions) { this.activeRequest[actions[verb]] = undefined; } }; Ext.extend(Ext.data.HttpProxy, Ext.data.DataProxy, { getConnection : function() { return this.useAjax ? Ext.Ajax : this.conn; }, setUrl : function(url, makePermanent) { this.conn.url = url; if (makePermanent === true) { this.url = url; this.api = null; Ext.data.Api.prepare(this); } }, doRequest : function(action, rs, params, reader, cb, scope, arg) { var o = { method: (this.api[action]) ? this.api[action]['method'] : undefined, request: { callback : cb, scope : scope, arg : arg }, reader: reader, callback : this.createCallback(action, rs), scope: this }; if (params.jsonData) { o.jsonData = params.jsonData; } else if (params.xmlData) { o.xmlData = params.xmlData; } else { o.params = params || {}; } this.conn.url = this.buildUrl(action, rs); if(this.useAjax){ Ext.applyIf(o, this.conn); if (this.activeRequest[action]) { } this.activeRequest[action] = Ext.Ajax.request(o); }else{ this.conn.request(o); } this.conn.url = null; }, createCallback : function(action, rs) { return function(o, success, response) { this.activeRequest[action] = undefined; if (!success) { if (action === Ext.data.Api.actions.read) { this.fireEvent('loadexception', this, o, response); } this.fireEvent('exception', this, 'response', action, o, response); o.request.callback.call(o.request.scope, null, o.request.arg, false); return; } if (action === Ext.data.Api.actions.read) { this.onRead(action, o, response); } else { this.onWrite(action, o, response, rs); } }; }, onRead : function(action, o, response) { var result; try { result = o.reader.read(response); }catch(e){ this.fireEvent('loadexception', this, o, response, e); this.fireEvent('exception', this, 'response', action, o, response, e); o.request.callback.call(o.request.scope, null, o.request.arg, false); return; } if (result.success === false) { this.fireEvent('loadexception', this, o, response); var res = o.reader.readResponse(action, response); this.fireEvent('exception', this, 'remote', action, o, res, null); } else { this.fireEvent('load', this, o, o.request.arg); } o.request.callback.call(o.request.scope, result, o.request.arg, result.success); }, onWrite : function(action, o, response, rs) { var reader = o.reader; var res; try { res = reader.readResponse(action, response); } catch (e) { this.fireEvent('exception', this, 'response', action, o, response, e); o.request.callback.call(o.request.scope, null, o.request.arg, false); return; } if (res.success === true) { this.fireEvent('write', this, action, res.data, res, rs, o.request.arg); } else { this.fireEvent('exception', this, 'remote', action, o, res, rs); } o.request.callback.call(o.request.scope, res.data, res, res.success); }, destroy: function(){ if(!this.useAjax){ this.conn.abort(); }else if(this.activeRequest){ var actions = Ext.data.Api.actions; for (var verb in actions) { if(this.activeRequest[actions[verb]]){ Ext.Ajax.abort(this.activeRequest[actions[verb]]); } } } Ext.data.HttpProxy.superclass.destroy.call(this); } }); Ext.data.MemoryProxy = function(data){ var api = {}; api[Ext.data.Api.actions.read] = true; Ext.data.MemoryProxy.superclass.constructor.call(this, { api: api }); this.data = data; }; Ext.extend(Ext.data.MemoryProxy, Ext.data.DataProxy, { doRequest : function(action, rs, params, reader, callback, scope, arg) { params = params || {}; var result; try { result = reader.readRecords(this.data); }catch(e){ this.fireEvent("loadexception", this, null, arg, e); this.fireEvent('exception', this, 'response', action, arg, null, e); callback.call(scope, null, arg, false); return; } callback.call(scope, result, arg, true); } }); Ext.data.Types = new function(){ var st = Ext.data.SortTypes; Ext.apply(this, { stripRe: /[\$,%]/g, AUTO: { convert: function(v){ return v; }, sortType: st.none, type: 'auto' }, STRING: { convert: function(v){ return (v === undefined || v === null) ? '' : String(v); }, sortType: st.asUCString, type: 'string' }, INT: { convert: function(v){ return v !== undefined && v !== null && v !== '' ? parseInt(String(v).replace(Ext.data.Types.stripRe, ''), 10) : (this.useNull ? null : 0); }, sortType: st.none, type: 'int' }, FLOAT: { convert: function(v){ return v !== undefined && v !== null && v !== '' ? parseFloat(String(v).replace(Ext.data.Types.stripRe, ''), 10) : (this.useNull ? null : 0); }, sortType: st.none, type: 'float' }, BOOL: { convert: function(v){ return v === true || v === 'true' || v == 1; }, sortType: st.none, type: 'bool' }, DATE: { convert: function(v){ var df = this.dateFormat; if(!v){ return null; } if(Ext.isDate(v)){ return v; } if(df){ if(df == 'timestamp'){ return new Date(v*1000); } if(df == 'time'){ return new Date(parseInt(v, 10)); } return Date.parseDate(v, df); } var parsed = Date.parse(v); return parsed ? new Date(parsed) : null; }, sortType: st.asDate, type: 'date' } }); Ext.apply(this, { BOOLEAN: this.BOOL, INTEGER: this.INT, NUMBER: this.FLOAT }); }; Ext.data.JsonWriter = Ext.extend(Ext.data.DataWriter, { encode : true, encodeDelete: false, constructor : function(config){ Ext.data.JsonWriter.superclass.constructor.call(this, config); }, render : function(params, baseParams, data) { if (this.encode === true) { Ext.apply(params, baseParams); params[this.meta.root] = Ext.encode(data); } else { var jdata = Ext.apply({}, baseParams); jdata[this.meta.root] = data; params.jsonData = jdata; } }, createRecord : function(rec) { return this.toHash(rec); }, updateRecord : function(rec) { return this.toHash(rec); }, destroyRecord : function(rec){ if(this.encodeDelete){ var data = {}; data[this.meta.idProperty] = rec.id; return data; }else{ return rec.id; } } }); Ext.data.JsonReader = function(meta, recordType){ meta = meta || {}; Ext.applyIf(meta, { idProperty: 'id', successProperty: 'success', totalProperty: 'total' }); Ext.data.JsonReader.superclass.constructor.call(this, meta, recordType || meta.fields); }; Ext.extend(Ext.data.JsonReader, Ext.data.DataReader, { read : function(response){ var json = response.responseText; var o = Ext.decode(json); if(!o) { throw {message: 'JsonReader.read: Json object not found'}; } return this.readRecords(o); }, readResponse : function(action, response) { var o = (response.responseText !== undefined) ? Ext.decode(response.responseText) : response; if(!o) { throw new Ext.data.JsonReader.Error('response'); } var root = this.getRoot(o), success = this.getSuccess(o); if (success && action === Ext.data.Api.actions.create) { var def = Ext.isDefined(root); if (def && Ext.isEmpty(root)) { throw new Ext.data.JsonReader.Error('root-empty', this.meta.root); } else if (!def) { throw new Ext.data.JsonReader.Error('root-undefined-response', this.meta.root); } } var res = new Ext.data.Response({ action: action, success: success, data: (root) ? this.extractData(root, false) : [], message: this.getMessage(o), raw: o }); if (Ext.isEmpty(res.success)) { throw new Ext.data.JsonReader.Error('successProperty-response', this.meta.successProperty); } return res; }, readRecords : function(o){ this.jsonData = o; if(o.metaData){ this.onMetaChange(o.metaData); } var s = this.meta, Record = this.recordType, f = Record.prototype.fields, fi = f.items, fl = f.length, v; var root = this.getRoot(o), c = root.length, totalRecords = c, success = true; if(s.totalProperty){ v = parseInt(this.getTotal(o), 10); if(!isNaN(v)){ totalRecords = v; } } if(s.successProperty){ v = this.getSuccess(o); if(v === false || v === 'false'){ success = false; } } return { success : success, records : this.extractData(root, true), totalRecords : totalRecords }; }, buildExtractors : function() { if(this.ef){ return; } var s = this.meta, Record = this.recordType, f = Record.prototype.fields, fi = f.items, fl = f.length; if(s.totalProperty) { this.getTotal = this.createAccessor(s.totalProperty); } if(s.successProperty) { this.getSuccess = this.createAccessor(s.successProperty); } if (s.messageProperty) { this.getMessage = this.createAccessor(s.messageProperty); } this.getRoot = s.root ? this.createAccessor(s.root) : function(p){return p;}; if (s.id || s.idProperty) { var g = this.createAccessor(s.id || s.idProperty); this.getId = function(rec) { var r = g(rec); return (r === undefined || r === '') ? null : r; }; } else { this.getId = function(){return null;}; } var ef = []; for(var i = 0; i < fl; i++){ f = fi[i]; var map = (f.mapping !== undefined && f.mapping !== null) ? f.mapping : f.name; ef.push(this.createAccessor(map)); } this.ef = ef; }, simpleAccess : function(obj, subsc) { return obj[subsc]; }, createAccessor : function(){ var re = /[\[\.]/; return function(expr) { if(Ext.isEmpty(expr)){ return Ext.emptyFn; } if(Ext.isFunction(expr)){ return expr; } var i = String(expr).search(re); if(i >= 0){ return new Function('obj', 'return obj' + (i > 0 ? '.' : '') + expr); } return function(obj){ return obj[expr]; }; }; }(), extractValues : function(data, items, len) { var f, values = {}; for(var j = 0; j < len; j++){ f = items[j]; var v = this.ef[j](data); values[f.name] = f.convert((v !== undefined) ? v : f.defaultValue, data); } return values; } }); Ext.data.JsonReader.Error = Ext.extend(Ext.Error, { constructor : function(message, arg) { this.arg = arg; Ext.Error.call(this, message); }, name : 'Ext.data.JsonReader' }); Ext.apply(Ext.data.JsonReader.Error.prototype, { lang: { 'response': 'An error occurred while json-decoding your server response', 'successProperty-response': 'Could not locate your "successProperty" in your server response. Please review your JsonReader config to ensure the config-property "successProperty" matches the property in your server-response. See the JsonReader docs.', 'root-undefined-config': 'Your JsonReader was configured without a "root" property. Please review your JsonReader config and make sure to define the root property. See the JsonReader docs.', 'idProperty-undefined' : 'Your JsonReader was configured without an "idProperty" Please review your JsonReader configuration and ensure the "idProperty" is set (e.g.: "id"). See the JsonReader docs.', 'root-empty': 'Data was expected to be returned by the server in the "root" property of the response. Please review your JsonReader configuration to ensure the "root" property matches that returned in the server-response. See JsonReader docs.' } }); Ext.data.ArrayReader = Ext.extend(Ext.data.JsonReader, { readRecords : function(o){ this.arrayData = o; var s = this.meta, sid = s ? Ext.num(s.idIndex, s.id) : null, recordType = this.recordType, fields = recordType.prototype.fields, records = [], success = true, v; var root = this.getRoot(o); for(var i = 0, len = root.length; i < len; i++) { var n = root[i], values = {}, id = ((sid || sid === 0) && n[sid] !== undefined && n[sid] !== "" ? n[sid] : null); for(var j = 0, jlen = fields.length; j < jlen; j++) { var f = fields.items[j], k = f.mapping !== undefined && f.mapping !== null ? f.mapping : j; v = n[k] !== undefined ? n[k] : f.defaultValue; v = f.convert(v, n); values[f.name] = v; } var record = new recordType(values, id); record.json = n; records[records.length] = record; } var totalRecords = records.length; if(s.totalProperty) { v = parseInt(this.getTotal(o), 10); if(!isNaN(v)) { totalRecords = v; } } if(s.successProperty){ v = this.getSuccess(o); if(v === false || v === 'false'){ success = false; } } return { success : success, records : records, totalRecords : totalRecords }; } }); Ext.data.ArrayStore = Ext.extend(Ext.data.Store, { constructor: function(config){ Ext.data.ArrayStore.superclass.constructor.call(this, Ext.apply(config, { reader: new Ext.data.ArrayReader(config) })); }, loadData : function(data, append){ if(this.expandData === true){ var r = []; for(var i = 0, len = data.length; i < len; i++){ r[r.length] = [data[i]]; } data = r; } Ext.data.ArrayStore.superclass.loadData.call(this, data, append); } }); Ext.reg('arraystore', Ext.data.ArrayStore); Ext.data.SimpleStore = Ext.data.ArrayStore; Ext.reg('simplestore', Ext.data.SimpleStore); Ext.data.JsonStore = Ext.extend(Ext.data.Store, { constructor: function(config){ Ext.data.JsonStore.superclass.constructor.call(this, Ext.apply(config, { reader: new Ext.data.JsonReader(config) })); } }); Ext.reg('jsonstore', Ext.data.JsonStore); Ext.data.XmlWriter = function(params) { Ext.data.XmlWriter.superclass.constructor.apply(this, arguments); this.tpl = (typeof(this.tpl) === 'string') ? new Ext.XTemplate(this.tpl).compile() : this.tpl.compile(); }; Ext.extend(Ext.data.XmlWriter, Ext.data.DataWriter, { documentRoot: 'xrequest', forceDocumentRoot: false, root: 'records', xmlVersion : '1.0', xmlEncoding: 'ISO-8859-15', tpl: '<\u003fxml version="{version}" encoding="{encoding}"\u003f><{documentRoot}><{name}>{value}<{root}><{parent.record}><{name}>{value}', render : function(params, baseParams, data) { baseParams = this.toArray(baseParams); params.xmlData = this.tpl.applyTemplate({ version: this.xmlVersion, encoding: this.xmlEncoding, documentRoot: (baseParams.length > 0 || this.forceDocumentRoot === true) ? this.documentRoot : false, record: this.meta.record, root: this.root, baseParams: baseParams, records: (Ext.isArray(data[0])) ? data : [data] }); }, createRecord : function(rec) { return this.toArray(this.toHash(rec)); }, updateRecord : function(rec) { return this.toArray(this.toHash(rec)); }, destroyRecord : function(rec) { var data = {}; data[this.meta.idProperty] = rec.id; return this.toArray(data); } }); Ext.data.XmlReader = function(meta, recordType){ meta = meta || {}; Ext.applyIf(meta, { idProperty: meta.idProperty || meta.idPath || meta.id, successProperty: meta.successProperty || meta.success }); Ext.data.XmlReader.superclass.constructor.call(this, meta, recordType || meta.fields); }; Ext.extend(Ext.data.XmlReader, Ext.data.DataReader, { read : function(response){ var doc = response.responseXML; if(!doc) { throw {message: "XmlReader.read: XML Document not available"}; } return this.readRecords(doc); }, readRecords : function(doc){ this.xmlData = doc; var root = doc.documentElement || doc, q = Ext.DomQuery, totalRecords = 0, success = true; if(this.meta.totalProperty){ totalRecords = this.getTotal(root, 0); } if(this.meta.successProperty){ success = this.getSuccess(root); } var records = this.extractData(q.select(this.meta.record, root), true); return { success : success, records : records, totalRecords : totalRecords || records.length }; }, readResponse : function(action, response) { var q = Ext.DomQuery, doc = response.responseXML, root = doc.documentElement || doc; var res = new Ext.data.Response({ action: action, success : this.getSuccess(root), message: this.getMessage(root), data: this.extractData(q.select(this.meta.record, root) || q.select(this.meta.root, root), false), raw: doc }); if (Ext.isEmpty(res.success)) { throw new Ext.data.DataReader.Error('successProperty-response', this.meta.successProperty); } if (action === Ext.data.Api.actions.create) { var def = Ext.isDefined(res.data); if (def && Ext.isEmpty(res.data)) { throw new Ext.data.JsonReader.Error('root-empty', this.meta.root); } else if (!def) { throw new Ext.data.JsonReader.Error('root-undefined-response', this.meta.root); } } return res; }, getSuccess : function() { return true; }, buildExtractors : function() { if(this.ef){ return; } var s = this.meta, Record = this.recordType, f = Record.prototype.fields, fi = f.items, fl = f.length; if(s.totalProperty) { this.getTotal = this.createAccessor(s.totalProperty); } if(s.successProperty) { this.getSuccess = this.createAccessor(s.successProperty); } if (s.messageProperty) { this.getMessage = this.createAccessor(s.messageProperty); } this.getRoot = function(res) { return (!Ext.isEmpty(res[this.meta.record])) ? res[this.meta.record] : res[this.meta.root]; }; if (s.idPath || s.idProperty) { var g = this.createAccessor(s.idPath || s.idProperty); this.getId = function(rec) { var id = g(rec) || rec.id; return (id === undefined || id === '') ? null : id; }; } else { this.getId = function(){return null;}; } var ef = []; for(var i = 0; i < fl; i++){ f = fi[i]; var map = (f.mapping !== undefined && f.mapping !== null) ? f.mapping : f.name; ef.push(this.createAccessor(map)); } this.ef = ef; }, createAccessor : function(){ var q = Ext.DomQuery; return function(key) { if (Ext.isFunction(key)) { return key; } switch(key) { case this.meta.totalProperty: return function(root, def){ return q.selectNumber(key, root, def); }; break; case this.meta.successProperty: return function(root, def) { var sv = q.selectValue(key, root, true); var success = sv !== false && sv !== 'false'; return success; }; break; default: return function(root, def) { return q.selectValue(key, root, def); }; break; } }; }(), extractValues : function(data, items, len) { var f, values = {}; for(var j = 0; j < len; j++){ f = items[j]; var v = this.ef[j](data); values[f.name] = f.convert((v !== undefined) ? v : f.defaultValue, data); } return values; } }); Ext.data.XmlStore = Ext.extend(Ext.data.Store, { constructor: function(config){ Ext.data.XmlStore.superclass.constructor.call(this, Ext.apply(config, { reader: new Ext.data.XmlReader(config) })); } }); Ext.reg('xmlstore', Ext.data.XmlStore); Ext.data.GroupingStore = Ext.extend(Ext.data.Store, { constructor: function(config) { config = config || {}; this.hasMultiSort = true; this.multiSortInfo = this.multiSortInfo || {sorters: []}; var sorters = this.multiSortInfo.sorters, groupField = config.groupField || this.groupField, sortInfo = config.sortInfo || this.sortInfo, groupDir = config.groupDir || this.groupDir; if(groupField){ sorters.push({ field : groupField, direction: groupDir }); } if (sortInfo) { sorters.push(sortInfo); } Ext.data.GroupingStore.superclass.constructor.call(this, config); this.addEvents( 'groupchange' ); this.applyGroupField(); }, remoteGroup : false, groupOnSort:false, groupDir : 'ASC', clearGrouping : function(){ this.groupField = false; if(this.remoteGroup){ if(this.baseParams){ delete this.baseParams.groupBy; delete this.baseParams.groupDir; } var lo = this.lastOptions; if(lo && lo.params){ delete lo.params.groupBy; delete lo.params.groupDir; } this.reload(); }else{ this.sort(); this.fireEvent('datachanged', this); } }, groupBy : function(field, forceRegroup, direction) { direction = direction ? (String(direction).toUpperCase() == 'DESC' ? 'DESC' : 'ASC') : this.groupDir; if (this.groupField == field && this.groupDir == direction && !forceRegroup) { return; } var sorters = this.multiSortInfo.sorters; if (sorters.length > 0 && sorters[0].field == this.groupField) { sorters.shift(); } this.groupField = field; this.groupDir = direction; this.applyGroupField(); var fireGroupEvent = function() { this.fireEvent('groupchange', this, this.getGroupState()); }; if (this.groupOnSort) { this.sort(field, direction); fireGroupEvent.call(this); return; } if (this.remoteGroup) { this.on('load', fireGroupEvent, this, {single: true}); this.reload(); } else { this.sort(sorters); fireGroupEvent.call(this); } }, sort : function(fieldName, dir) { if (this.remoteSort) { return Ext.data.GroupingStore.superclass.sort.call(this, fieldName, dir); } var sorters = []; if (Ext.isArray(arguments[0])) { sorters = arguments[0]; } else if (fieldName == undefined) { sorters = this.sortInfo ? [this.sortInfo] : []; } else { var field = this.fields.get(fieldName); if (!field) return false; var name = field.name, sortInfo = this.sortInfo || null, sortToggle = this.sortToggle ? this.sortToggle[name] : null; if (!dir) { if (sortInfo && sortInfo.field == name) { dir = (this.sortToggle[name] || 'ASC').toggle('ASC', 'DESC'); } else { dir = field.sortDir; } } this.sortToggle[name] = dir; this.sortInfo = {field: name, direction: dir}; sorters = [this.sortInfo]; } if (this.groupField) { sorters.unshift({direction: this.groupDir, field: this.groupField}); } return this.multiSort.call(this, sorters, dir); }, applyGroupField: function(){ if (this.remoteGroup) { if(!this.baseParams){ this.baseParams = {}; } Ext.apply(this.baseParams, { groupBy : this.groupField, groupDir: this.groupDir }); var lo = this.lastOptions; if (lo && lo.params) { lo.params.groupDir = this.groupDir; delete lo.params.groupBy; } } }, applyGrouping : function(alwaysFireChange){ if(this.groupField !== false){ this.groupBy(this.groupField, true, this.groupDir); return true; }else{ if(alwaysFireChange === true){ this.fireEvent('datachanged', this); } return false; } }, getGroupState : function(){ return this.groupOnSort && this.groupField !== false ? (this.sortInfo ? this.sortInfo.field : undefined) : this.groupField; } }); Ext.reg('groupingstore', Ext.data.GroupingStore); Ext.data.DirectProxy = function(config){ Ext.apply(this, config); if(typeof this.paramOrder == 'string'){ this.paramOrder = this.paramOrder.split(/[\s,|]/); } Ext.data.DirectProxy.superclass.constructor.call(this, config); }; Ext.extend(Ext.data.DirectProxy, Ext.data.DataProxy, { paramOrder: undefined, paramsAsHash: true, directFn : undefined, doRequest : function(action, rs, params, reader, callback, scope, options) { var args = [], directFn = this.api[action] || this.directFn; switch (action) { case Ext.data.Api.actions.create: args.push(params.jsonData); break; case Ext.data.Api.actions.read: if(directFn.directCfg.method.len > 0){ if(this.paramOrder){ for(var i = 0, len = this.paramOrder.length; i < len; i++){ args.push(params[this.paramOrder[i]]); } }else if(this.paramsAsHash){ args.push(params); } } break; case Ext.data.Api.actions.update: args.push(params.jsonData); break; case Ext.data.Api.actions.destroy: args.push(params.jsonData); break; } var trans = { params : params || {}, request: { callback : callback, scope : scope, arg : options }, reader: reader }; args.push(this.createCallback(action, rs, trans), this); directFn.apply(window, args); }, createCallback : function(action, rs, trans) { var me = this; return function(result, res) { if (!res.status) { if (action === Ext.data.Api.actions.read) { me.fireEvent("loadexception", me, trans, res, null); } me.fireEvent('exception', me, 'remote', action, trans, res, null); trans.request.callback.call(trans.request.scope, null, trans.request.arg, false); return; } if (action === Ext.data.Api.actions.read) { me.onRead(action, trans, result, res); } else { me.onWrite(action, trans, result, res, rs); } }; }, onRead : function(action, trans, result, res) { var records; try { records = trans.reader.readRecords(result); } catch (ex) { this.fireEvent("loadexception", this, trans, res, ex); this.fireEvent('exception', this, 'response', action, trans, res, ex); trans.request.callback.call(trans.request.scope, null, trans.request.arg, false); return; } this.fireEvent("load", this, res, trans.request.arg); trans.request.callback.call(trans.request.scope, records, trans.request.arg, true); }, onWrite : function(action, trans, result, res, rs) { var data = trans.reader.extractData(trans.reader.getRoot(result), false); var success = trans.reader.getSuccess(result); success = (success !== false); if (success){ this.fireEvent("write", this, action, data, res, rs, trans.request.arg); }else{ this.fireEvent('exception', this, 'remote', action, trans, result, rs); } trans.request.callback.call(trans.request.scope, data, res, success); } }); Ext.data.DirectStore = Ext.extend(Ext.data.Store, { constructor : function(config){ var c = Ext.apply({}, { batchTransactions: false }, config); Ext.data.DirectStore.superclass.constructor.call(this, Ext.apply(c, { proxy: Ext.isDefined(c.proxy) ? c.proxy : new Ext.data.DirectProxy(Ext.copyTo({}, c, 'paramOrder,paramsAsHash,directFn,api')), reader: (!Ext.isDefined(c.reader) && c.fields) ? new Ext.data.JsonReader(Ext.copyTo({}, c, 'totalProperty,root,idProperty'), c.fields) : c.reader })); } }); Ext.reg('directstore', Ext.data.DirectStore); Ext.Direct = Ext.extend(Ext.util.Observable, { exceptions: { TRANSPORT: 'xhr', PARSE: 'parse', LOGIN: 'login', SERVER: 'exception' }, constructor: function(){ this.addEvents( 'event', 'exception' ); this.transactions = {}; this.providers = {}; }, addProvider : function(provider){ var a = arguments; if(a.length > 1){ for(var i = 0, len = a.length; i < len; i++){ this.addProvider(a[i]); } return; } if(!provider.events){ provider = new Ext.Direct.PROVIDERS[provider.type](provider); } provider.id = provider.id || Ext.id(); this.providers[provider.id] = provider; provider.on('data', this.onProviderData, this); provider.on('exception', this.onProviderException, this); if(!provider.isConnected()){ provider.connect(); } return provider; }, getProvider : function(id){ return this.providers[id]; }, removeProvider : function(id){ var provider = id.id ? id : this.providers[id]; provider.un('data', this.onProviderData, this); provider.un('exception', this.onProviderException, this); delete this.providers[provider.id]; return provider; }, addTransaction: function(t){ this.transactions[t.tid] = t; return t; }, removeTransaction: function(t){ delete this.transactions[t.tid || t]; return t; }, getTransaction: function(tid){ return this.transactions[tid.tid || tid]; }, onProviderData : function(provider, e){ if(Ext.isArray(e)){ for(var i = 0, len = e.length; i < len; i++){ this.onProviderData(provider, e[i]); } return; } if(e.name && e.name != 'event' && e.name != 'exception'){ this.fireEvent(e.name, e); }else if(e.type == 'exception'){ this.fireEvent('exception', e); } this.fireEvent('event', e, provider); }, createEvent : function(response, extraProps){ return new Ext.Direct.eventTypes[response.type](Ext.apply(response, extraProps)); } }); Ext.Direct = new Ext.Direct(); Ext.Direct.TID = 1; Ext.Direct.PROVIDERS = {}; Ext.Direct.Transaction = function(config){ Ext.apply(this, config); this.tid = ++Ext.Direct.TID; this.retryCount = 0; }; Ext.Direct.Transaction.prototype = { send: function(){ this.provider.queueTransaction(this); }, retry: function(){ this.retryCount++; this.send(); }, getProvider: function(){ return this.provider; } };Ext.Direct.Event = function(config){ Ext.apply(this, config); }; Ext.Direct.Event.prototype = { status: true, getData: function(){ return this.data; } }; Ext.Direct.RemotingEvent = Ext.extend(Ext.Direct.Event, { type: 'rpc', getTransaction: function(){ return this.transaction || Ext.Direct.getTransaction(this.tid); } }); Ext.Direct.ExceptionEvent = Ext.extend(Ext.Direct.RemotingEvent, { status: false, type: 'exception' }); Ext.Direct.eventTypes = { 'rpc': Ext.Direct.RemotingEvent, 'event': Ext.Direct.Event, 'exception': Ext.Direct.ExceptionEvent }; Ext.direct.Provider = Ext.extend(Ext.util.Observable, { priority: 1, constructor : function(config){ Ext.apply(this, config); this.addEvents( 'connect', 'disconnect', 'data', 'exception' ); Ext.direct.Provider.superclass.constructor.call(this, config); }, isConnected: function(){ return false; }, connect: Ext.emptyFn, disconnect: Ext.emptyFn }); Ext.direct.JsonProvider = Ext.extend(Ext.direct.Provider, { parseResponse: function(xhr){ if(!Ext.isEmpty(xhr.responseText)){ if(typeof xhr.responseText == 'object'){ return xhr.responseText; } return Ext.decode(xhr.responseText); } return null; }, getEvents: function(xhr){ var data = null; try{ data = this.parseResponse(xhr); }catch(e){ var event = new Ext.Direct.ExceptionEvent({ data: e, xhr: xhr, code: Ext.Direct.exceptions.PARSE, message: 'Error parsing json response: \n\n ' + data }); return [event]; } var events = []; if(Ext.isArray(data)){ for(var i = 0, len = data.length; i < len; i++){ events.push(Ext.Direct.createEvent(data[i])); } }else{ events.push(Ext.Direct.createEvent(data)); } return events; } }); Ext.direct.PollingProvider = Ext.extend(Ext.direct.JsonProvider, { priority: 3, interval: 3000, constructor : function(config){ Ext.direct.PollingProvider.superclass.constructor.call(this, config); this.addEvents( 'beforepoll', 'poll' ); }, isConnected: function(){ return !!this.pollTask; }, connect: function(){ if(this.url && !this.pollTask){ this.pollTask = Ext.TaskMgr.start({ run: function(){ if(this.fireEvent('beforepoll', this) !== false){ if(typeof this.url == 'function'){ this.url(this.baseParams); }else{ Ext.Ajax.request({ url: this.url, callback: this.onData, scope: this, params: this.baseParams }); } } }, interval: this.interval, scope: this }); this.fireEvent('connect', this); }else if(!this.url){ throw 'Error initializing PollingProvider, no url configured.'; } }, disconnect: function(){ if(this.pollTask){ Ext.TaskMgr.stop(this.pollTask); delete this.pollTask; this.fireEvent('disconnect', this); } }, onData: function(opt, success, xhr){ if(success){ var events = this.getEvents(xhr); for(var i = 0, len = events.length; i < len; i++){ var e = events[i]; this.fireEvent('data', this, e); } }else{ var e = new Ext.Direct.ExceptionEvent({ data: e, code: Ext.Direct.exceptions.TRANSPORT, message: 'Unable to connect to the server.', xhr: xhr }); this.fireEvent('data', this, e); } } }); Ext.Direct.PROVIDERS['polling'] = Ext.direct.PollingProvider; Ext.direct.RemotingProvider = Ext.extend(Ext.direct.JsonProvider, { enableBuffer: 10, maxRetries: 1, timeout: undefined, constructor : function(config){ Ext.direct.RemotingProvider.superclass.constructor.call(this, config); this.addEvents( 'beforecall', 'call' ); this.namespace = (Ext.isString(this.namespace)) ? Ext.ns(this.namespace) : this.namespace || window; this.transactions = {}; this.callBuffer = []; }, initAPI : function(){ var o = this.actions; for(var c in o){ var cls = this.namespace[c] || (this.namespace[c] = {}), ms = o[c]; for(var i = 0, len = ms.length; i < len; i++){ var m = ms[i]; cls[m.name] = this.createMethod(c, m); } } }, isConnected: function(){ return !!this.connected; }, connect: function(){ if(this.url){ this.initAPI(); this.connected = true; this.fireEvent('connect', this); }else if(!this.url){ throw 'Error initializing RemotingProvider, no url configured.'; } }, disconnect: function(){ if(this.connected){ this.connected = false; this.fireEvent('disconnect', this); } }, onData: function(opt, success, xhr){ if(success){ var events = this.getEvents(xhr); for(var i = 0, len = events.length; i < len; i++){ var e = events[i], t = this.getTransaction(e); this.fireEvent('data', this, e); if(t){ this.doCallback(t, e, true); Ext.Direct.removeTransaction(t); } } }else{ var ts = [].concat(opt.ts); for(var i = 0, len = ts.length; i < len; i++){ var t = this.getTransaction(ts[i]); if(t && t.retryCount < this.maxRetries){ t.retry(); }else{ var e = new Ext.Direct.ExceptionEvent({ data: e, transaction: t, code: Ext.Direct.exceptions.TRANSPORT, message: 'Unable to connect to the server.', xhr: xhr }); this.fireEvent('data', this, e); if(t){ this.doCallback(t, e, false); Ext.Direct.removeTransaction(t); } } } } }, getCallData: function(t){ return { action: t.action, method: t.method, data: t.data, type: 'rpc', tid: t.tid }; }, doSend : function(data){ var o = { url: this.url, callback: this.onData, scope: this, ts: data, timeout: this.timeout }, callData; if(Ext.isArray(data)){ callData = []; for(var i = 0, len = data.length; i < len; i++){ callData.push(this.getCallData(data[i])); } }else{ callData = this.getCallData(data); } if(this.enableUrlEncode){ var params = {}; params[Ext.isString(this.enableUrlEncode) ? this.enableUrlEncode : 'data'] = Ext.encode(callData); o.params = params; }else{ o.jsonData = callData; } Ext.Ajax.request(o); }, combineAndSend : function(){ var len = this.callBuffer.length; if(len > 0){ this.doSend(len == 1 ? this.callBuffer[0] : this.callBuffer); this.callBuffer = []; } }, queueTransaction: function(t){ if(t.form){ this.processForm(t); return; } this.callBuffer.push(t); if(this.enableBuffer){ if(!this.callTask){ this.callTask = new Ext.util.DelayedTask(this.combineAndSend, this); } this.callTask.delay(Ext.isNumber(this.enableBuffer) ? this.enableBuffer : 10); }else{ this.combineAndSend(); } }, doCall : function(c, m, args){ var data = null, hs = args[m.len], scope = args[m.len+1]; if(m.len !== 0){ data = args.slice(0, m.len); } var t = new Ext.Direct.Transaction({ provider: this, args: args, action: c, method: m.name, data: data, cb: scope && Ext.isFunction(hs) ? hs.createDelegate(scope) : hs }); if(this.fireEvent('beforecall', this, t, m) !== false){ Ext.Direct.addTransaction(t); this.queueTransaction(t); this.fireEvent('call', this, t, m); } }, doForm : function(c, m, form, callback, scope){ var t = new Ext.Direct.Transaction({ provider: this, action: c, method: m.name, args:[form, callback, scope], cb: scope && Ext.isFunction(callback) ? callback.createDelegate(scope) : callback, isForm: true }); if(this.fireEvent('beforecall', this, t, m) !== false){ Ext.Direct.addTransaction(t); var isUpload = String(form.getAttribute("enctype")).toLowerCase() == 'multipart/form-data', params = { extTID: t.tid, extAction: c, extMethod: m.name, extType: 'rpc', extUpload: String(isUpload) }; Ext.apply(t, { form: Ext.getDom(form), isUpload: isUpload, params: callback && Ext.isObject(callback.params) ? Ext.apply(params, callback.params) : params }); this.fireEvent('call', this, t, m); this.processForm(t); } }, processForm: function(t){ Ext.Ajax.request({ url: this.url, params: t.params, callback: this.onData, scope: this, form: t.form, isUpload: t.isUpload, ts: t }); }, createMethod : function(c, m){ var f; if(!m.formHandler){ f = function(){ this.doCall(c, m, Array.prototype.slice.call(arguments, 0)); }.createDelegate(this); }else{ f = function(form, callback, scope){ this.doForm(c, m, form, callback, scope); }.createDelegate(this); } f.directCfg = { action: c, method: m }; return f; }, getTransaction: function(opt){ return opt && opt.tid ? Ext.Direct.getTransaction(opt.tid) : null; }, doCallback: function(t, e){ var fn = e.status ? 'success' : 'failure'; if(t && t.cb){ var hs = t.cb, result = Ext.isDefined(e.result) ? e.result : e.data; if(Ext.isFunction(hs)){ hs(result, e); } else{ Ext.callback(hs[fn], hs.scope, [result, e]); Ext.callback(hs.callback, hs.scope, [result, e]); } } } }); Ext.Direct.PROVIDERS['remoting'] = Ext.direct.RemotingProvider; Ext.Resizable = Ext.extend(Ext.util.Observable, { constructor: function(el, config){ this.el = Ext.get(el); if(config && config.wrap){ config.resizeChild = this.el; this.el = this.el.wrap(typeof config.wrap == 'object' ? config.wrap : {cls:'xresizable-wrap'}); this.el.id = this.el.dom.id = config.resizeChild.id + '-rzwrap'; this.el.setStyle('overflow', 'hidden'); this.el.setPositioning(config.resizeChild.getPositioning()); config.resizeChild.clearPositioning(); if(!config.width || !config.height){ var csize = config.resizeChild.getSize(); this.el.setSize(csize.width, csize.height); } if(config.pinned && !config.adjustments){ config.adjustments = 'auto'; } } this.proxy = this.el.createProxy({tag: 'div', cls: 'x-resizable-proxy', id: this.el.id + '-rzproxy'}, Ext.getBody()); this.proxy.unselectable(); this.proxy.enableDisplayMode('block'); Ext.apply(this, config); if(this.pinned){ this.disableTrackOver = true; this.el.addClass('x-resizable-pinned'); } var position = this.el.getStyle('position'); if(position != 'absolute' && position != 'fixed'){ this.el.setStyle('position', 'relative'); } if(!this.handles){ this.handles = 's,e,se'; if(this.multiDirectional){ this.handles += ',n,w'; } } if(this.handles == 'all'){ this.handles = 'n s e w ne nw se sw'; } var hs = this.handles.split(/\s*?[,;]\s*?| /); var ps = Ext.Resizable.positions; for(var i = 0, len = hs.length; i < len; i++){ if(hs[i] && ps[hs[i]]){ var pos = ps[hs[i]]; this[pos] = new Ext.Resizable.Handle(this, pos, this.disableTrackOver, this.transparent, this.handleCls); } } this.corner = this.southeast; if(this.handles.indexOf('n') != -1 || this.handles.indexOf('w') != -1){ this.updateBox = true; } this.activeHandle = null; if(this.resizeChild){ if(typeof this.resizeChild == 'boolean'){ this.resizeChild = Ext.get(this.el.dom.firstChild, true); }else{ this.resizeChild = Ext.get(this.resizeChild, true); } } if(this.adjustments == 'auto'){ var rc = this.resizeChild; var hw = this.west, he = this.east, hn = this.north, hs = this.south; if(rc && (hw || hn)){ rc.position('relative'); rc.setLeft(hw ? hw.el.getWidth() : 0); rc.setTop(hn ? hn.el.getHeight() : 0); } this.adjustments = [ (he ? -he.el.getWidth() : 0) + (hw ? -hw.el.getWidth() : 0), (hn ? -hn.el.getHeight() : 0) + (hs ? -hs.el.getHeight() : 0) -1 ]; } if(this.draggable){ this.dd = this.dynamic ? this.el.initDD(null) : this.el.initDDProxy(null, {dragElId: this.proxy.id}); this.dd.setHandleElId(this.resizeChild ? this.resizeChild.id : this.el.id); if(this.constrainTo){ this.dd.constrainTo(this.constrainTo); } } this.addEvents( 'beforeresize', 'resize' ); if(this.width !== null && this.height !== null){ this.resizeTo(this.width, this.height); }else{ this.updateChildSize(); } if(Ext.isIE){ this.el.dom.style.zoom = 1; } Ext.Resizable.superclass.constructor.call(this); }, adjustments : [0, 0], animate : false, disableTrackOver : false, draggable: false, duration : 0.35, dynamic : false, easing : 'easeOutStrong', enabled : true, handles : false, multiDirectional : false, height : null, width : null, heightIncrement : 0, widthIncrement : 0, minHeight : 5, minWidth : 5, maxHeight : 10000, maxWidth : 10000, minX: 0, minY: 0, pinned : false, preserveRatio : false, resizeChild : false, transparent: false, resizeTo : function(width, height){ this.el.setSize(width, height); this.updateChildSize(); this.fireEvent('resize', this, width, height, null); }, startSizing : function(e, handle){ this.fireEvent('beforeresize', this, e); if(this.enabled){ if(!this.overlay){ this.overlay = this.el.createProxy({tag: 'div', cls: 'x-resizable-overlay', html: ' '}, Ext.getBody()); this.overlay.unselectable(); this.overlay.enableDisplayMode('block'); this.overlay.on({ scope: this, mousemove: this.onMouseMove, mouseup: this.onMouseUp }); } this.overlay.setStyle('cursor', handle.el.getStyle('cursor')); this.resizing = true; this.startBox = this.el.getBox(); this.startPoint = e.getXY(); this.offsets = [(this.startBox.x + this.startBox.width) - this.startPoint[0], (this.startBox.y + this.startBox.height) - this.startPoint[1]]; this.overlay.setSize(Ext.lib.Dom.getViewWidth(true), Ext.lib.Dom.getViewHeight(true)); this.overlay.show(); if(this.constrainTo) { var ct = Ext.get(this.constrainTo); this.resizeRegion = ct.getRegion().adjust( ct.getFrameWidth('t'), ct.getFrameWidth('l'), -ct.getFrameWidth('b'), -ct.getFrameWidth('r') ); } this.proxy.setStyle('visibility', 'hidden'); this.proxy.show(); this.proxy.setBox(this.startBox); if(!this.dynamic){ this.proxy.setStyle('visibility', 'visible'); } } }, onMouseDown : function(handle, e){ if(this.enabled){ e.stopEvent(); this.activeHandle = handle; this.startSizing(e, handle); } }, onMouseUp : function(e){ this.activeHandle = null; var size = this.resizeElement(); this.resizing = false; this.handleOut(); this.overlay.hide(); this.proxy.hide(); this.fireEvent('resize', this, size.width, size.height, e); }, updateChildSize : function(){ if(this.resizeChild){ var el = this.el; var child = this.resizeChild; var adj = this.adjustments; if(el.dom.offsetWidth){ var b = el.getSize(true); child.setSize(b.width+adj[0], b.height+adj[1]); } if(Ext.isIE){ setTimeout(function(){ if(el.dom.offsetWidth){ var b = el.getSize(true); child.setSize(b.width+adj[0], b.height+adj[1]); } }, 10); } } }, snap : function(value, inc, min){ if(!inc || !value){ return value; } var newValue = value; var m = value % inc; if(m > 0){ if(m > (inc/2)){ newValue = value + (inc-m); }else{ newValue = value - m; } } return Math.max(min, newValue); }, resizeElement : function(){ var box = this.proxy.getBox(); if(this.updateBox){ this.el.setBox(box, false, this.animate, this.duration, null, this.easing); }else{ this.el.setSize(box.width, box.height, this.animate, this.duration, null, this.easing); } this.updateChildSize(); if(!this.dynamic){ this.proxy.hide(); } if(this.draggable && this.constrainTo){ this.dd.resetConstraints(); this.dd.constrainTo(this.constrainTo); } return box; }, constrain : function(v, diff, m, mx){ if(v - diff < m){ diff = v - m; }else if(v - diff > mx){ diff = v - mx; } return diff; }, onMouseMove : function(e){ if(this.enabled && this.activeHandle){ try{ if(this.resizeRegion && !this.resizeRegion.contains(e.getPoint())) { return; } var curSize = this.curSize || this.startBox, x = this.startBox.x, y = this.startBox.y, ox = x, oy = y, w = curSize.width, h = curSize.height, ow = w, oh = h, mw = this.minWidth, mh = this.minHeight, mxw = this.maxWidth, mxh = this.maxHeight, wi = this.widthIncrement, hi = this.heightIncrement, eventXY = e.getXY(), diffX = -(this.startPoint[0] - Math.max(this.minX, eventXY[0])), diffY = -(this.startPoint[1] - Math.max(this.minY, eventXY[1])), pos = this.activeHandle.position, tw, th; switch(pos){ case 'east': w += diffX; w = Math.min(Math.max(mw, w), mxw); break; case 'south': h += diffY; h = Math.min(Math.max(mh, h), mxh); break; case 'southeast': w += diffX; h += diffY; w = Math.min(Math.max(mw, w), mxw); h = Math.min(Math.max(mh, h), mxh); break; case 'north': diffY = this.constrain(h, diffY, mh, mxh); y += diffY; h -= diffY; break; case 'west': diffX = this.constrain(w, diffX, mw, mxw); x += diffX; w -= diffX; break; case 'northeast': w += diffX; w = Math.min(Math.max(mw, w), mxw); diffY = this.constrain(h, diffY, mh, mxh); y += diffY; h -= diffY; break; case 'northwest': diffX = this.constrain(w, diffX, mw, mxw); diffY = this.constrain(h, diffY, mh, mxh); y += diffY; h -= diffY; x += diffX; w -= diffX; break; case 'southwest': diffX = this.constrain(w, diffX, mw, mxw); h += diffY; h = Math.min(Math.max(mh, h), mxh); x += diffX; w -= diffX; break; } var sw = this.snap(w, wi, mw); var sh = this.snap(h, hi, mh); if(sw != w || sh != h){ switch(pos){ case 'northeast': y -= sh - h; break; case 'north': y -= sh - h; break; case 'southwest': x -= sw - w; break; case 'west': x -= sw - w; break; case 'northwest': x -= sw - w; y -= sh - h; break; } w = sw; h = sh; } if(this.preserveRatio){ switch(pos){ case 'southeast': case 'east': h = oh * (w/ow); h = Math.min(Math.max(mh, h), mxh); w = ow * (h/oh); break; case 'south': w = ow * (h/oh); w = Math.min(Math.max(mw, w), mxw); h = oh * (w/ow); break; case 'northeast': w = ow * (h/oh); w = Math.min(Math.max(mw, w), mxw); h = oh * (w/ow); break; case 'north': tw = w; w = ow * (h/oh); w = Math.min(Math.max(mw, w), mxw); h = oh * (w/ow); x += (tw - w) / 2; break; case 'southwest': h = oh * (w/ow); h = Math.min(Math.max(mh, h), mxh); tw = w; w = ow * (h/oh); x += tw - w; break; case 'west': th = h; h = oh * (w/ow); h = Math.min(Math.max(mh, h), mxh); y += (th - h) / 2; tw = w; w = ow * (h/oh); x += tw - w; break; case 'northwest': tw = w; th = h; h = oh * (w/ow); h = Math.min(Math.max(mh, h), mxh); w = ow * (h/oh); y += th - h; x += tw - w; break; } } this.proxy.setBounds(x, y, w, h); if(this.dynamic){ this.resizeElement(); } }catch(ex){} } }, handleOver : function(){ if(this.enabled){ this.el.addClass('x-resizable-over'); } }, handleOut : function(){ if(!this.resizing){ this.el.removeClass('x-resizable-over'); } }, getEl : function(){ return this.el; }, getResizeChild : function(){ return this.resizeChild; }, destroy : function(removeEl){ Ext.destroy(this.dd, this.overlay, this.proxy); this.overlay = null; this.proxy = null; var ps = Ext.Resizable.positions; for(var k in ps){ if(typeof ps[k] != 'function' && this[ps[k]]){ this[ps[k]].destroy(); } } if(removeEl){ this.el.update(''); Ext.destroy(this.el); this.el = null; } this.purgeListeners(); }, syncHandleHeight : function(){ var h = this.el.getHeight(true); if(this.west){ this.west.el.setHeight(h); } if(this.east){ this.east.el.setHeight(h); } } }); Ext.Resizable.positions = { n: 'north', s: 'south', e: 'east', w: 'west', se: 'southeast', sw: 'southwest', nw: 'northwest', ne: 'northeast' }; Ext.Resizable.Handle = Ext.extend(Object, { constructor : function(rz, pos, disableTrackOver, transparent, cls){ if(!this.tpl){ var tpl = Ext.DomHelper.createTemplate( {tag: 'div', cls: 'x-resizable-handle x-resizable-handle-{0}'} ); tpl.compile(); Ext.Resizable.Handle.prototype.tpl = tpl; } this.position = pos; this.rz = rz; this.el = this.tpl.append(rz.el.dom, [this.position], true); this.el.unselectable(); if(transparent){ this.el.setOpacity(0); } if(!Ext.isEmpty(cls)){ this.el.addClass(cls); } this.el.on('mousedown', this.onMouseDown, this); if(!disableTrackOver){ this.el.on({ scope: this, mouseover: this.onMouseOver, mouseout: this.onMouseOut }); } }, afterResize : function(rz){ }, onMouseDown : function(e){ this.rz.onMouseDown(this, e); }, onMouseOver : function(e){ this.rz.handleOver(this, e); }, onMouseOut : function(e){ this.rz.handleOut(this, e); }, destroy : function(){ Ext.destroy(this.el); this.el = null; } }); Ext.Window = Ext.extend(Ext.Panel, { baseCls : 'x-window', resizable : true, draggable : true, closable : true, closeAction : 'close', constrain : false, constrainHeader : false, plain : false, minimizable : false, maximizable : false, minHeight : 100, minWidth : 200, expandOnShow : true, showAnimDuration: 0.25, hideAnimDuration: 0.25, collapsible : false, initHidden : undefined, hidden : true, elements : 'header,body', frame : true, floating : true, initComponent : function(){ this.initTools(); Ext.Window.superclass.initComponent.call(this); this.addEvents( 'resize', 'maximize', 'minimize', 'restore' ); if(Ext.isDefined(this.initHidden)){ this.hidden = this.initHidden; } if(this.hidden === false){ this.hidden = true; this.show(); } }, getState : function(){ return Ext.apply(Ext.Window.superclass.getState.call(this) || {}, this.getBox(true)); }, onRender : function(ct, position){ Ext.Window.superclass.onRender.call(this, ct, position); if(this.plain){ this.el.addClass('x-window-plain'); } this.focusEl = this.el.createChild({ tag: 'a', href:'#', cls:'x-dlg-focus', tabIndex:'-1', html: ' '}); this.focusEl.swallowEvent('click', true); this.proxy = this.el.createProxy('x-window-proxy'); this.proxy.enableDisplayMode('block'); if(this.modal){ this.mask = this.container.createChild({cls:'ext-el-mask'}, this.el.dom); this.mask.enableDisplayMode('block'); this.mask.hide(); this.mon(this.mask, 'click', this.focus, this); } if(this.maximizable){ this.mon(this.header, 'dblclick', this.toggleMaximize, this); } }, initEvents : function(){ Ext.Window.superclass.initEvents.call(this); if(this.animateTarget){ this.setAnimateTarget(this.animateTarget); } if(this.resizable){ this.resizer = new Ext.Resizable(this.el, { minWidth: this.minWidth, minHeight:this.minHeight, handles: this.resizeHandles || 'all', pinned: true, resizeElement : this.resizerAction, handleCls: 'x-window-handle' }); this.resizer.window = this; this.mon(this.resizer, 'beforeresize', this.beforeResize, this); } if(this.draggable){ this.header.addClass('x-window-draggable'); } this.mon(this.el, 'mousedown', this.toFront, this); this.manager = this.manager || Ext.WindowMgr; this.manager.register(this); if(this.maximized){ this.maximized = false; this.maximize(); } if(this.closable){ var km = this.getKeyMap(); km.on(27, this.onEsc, this); km.disable(); } }, initDraggable : function(){ this.dd = new Ext.Window.DD(this); }, onEsc : function(k, e){ if (this.activeGhost) { this.unghost(); } e.stopEvent(); this[this.closeAction](); }, beforeDestroy : function(){ if(this.rendered){ this.hide(); this.clearAnchor(); Ext.destroy( this.focusEl, this.resizer, this.dd, this.proxy, this.mask ); } Ext.Window.superclass.beforeDestroy.call(this); }, onDestroy : function(){ if(this.manager){ this.manager.unregister(this); } Ext.Window.superclass.onDestroy.call(this); }, initTools : function(){ if(this.minimizable){ this.addTool({ id: 'minimize', handler: this.minimize.createDelegate(this, []) }); } if(this.maximizable){ this.addTool({ id: 'maximize', handler: this.maximize.createDelegate(this, []) }); this.addTool({ id: 'restore', handler: this.restore.createDelegate(this, []), hidden:true }); } if(this.closable){ this.addTool({ id: 'close', handler: this[this.closeAction].createDelegate(this, []) }); } }, resizerAction : function(){ var box = this.proxy.getBox(); this.proxy.hide(); this.window.handleResize(box); return box; }, beforeResize : function(){ this.resizer.minHeight = Math.max(this.minHeight, this.getFrameHeight() + 40); this.resizer.minWidth = Math.max(this.minWidth, this.getFrameWidth() + 40); this.resizeBox = this.el.getBox(); }, updateHandles : function(){ if(Ext.isIE && this.resizer){ this.resizer.syncHandleHeight(); this.el.repaint(); } }, handleResize : function(box){ var rz = this.resizeBox; if(rz.x != box.x || rz.y != box.y){ this.updateBox(box); }else{ this.setSize(box); if (Ext.isIE6 && Ext.isStrict) { this.doLayout(); } } this.focus(); this.updateHandles(); this.saveState(); }, focus : function(){ var f = this.focusEl, db = this.defaultButton, t = typeof db, el, ct; if(Ext.isDefined(db)){ if(Ext.isNumber(db) && this.fbar){ f = this.fbar.items.get(db); }else if(Ext.isString(db)){ f = Ext.getCmp(db); }else{ f = db; } el = f.getEl(); ct = Ext.getDom(this.container); if (el && ct) { if (ct != document.body && !Ext.lib.Region.getRegion(ct).contains(Ext.lib.Region.getRegion(el.dom))){ return; } } } f = f || this.focusEl; f.focus.defer(10, f); }, setAnimateTarget : function(el){ el = Ext.get(el); this.animateTarget = el; }, beforeShow : function(){ delete this.el.lastXY; delete this.el.lastLT; if(this.x === undefined || this.y === undefined){ var xy = this.el.getAlignToXY(this.container, 'c-c'); var pos = this.el.translatePoints(xy[0], xy[1]); this.x = this.x === undefined? pos.left : this.x; this.y = this.y === undefined? pos.top : this.y; } this.el.setLeftTop(this.x, this.y); if(this.expandOnShow){ this.expand(false); } if(this.modal){ Ext.getBody().addClass('x-body-masked'); this.mask.setSize(Ext.lib.Dom.getViewWidth(true), Ext.lib.Dom.getViewHeight(true)); this.mask.show(); } }, show : function(animateTarget, cb, scope){ if(!this.rendered){ this.render(Ext.getBody()); } if(this.hidden === false){ this.toFront(); return this; } if(this.fireEvent('beforeshow', this) === false){ return this; } if(cb){ this.on('show', cb, scope, {single:true}); } this.hidden = false; if(Ext.isDefined(animateTarget)){ this.setAnimateTarget(animateTarget); } this.beforeShow(); if(this.animateTarget){ this.animShow(); }else{ this.afterShow(); } return this; }, afterShow : function(isAnim){ if (this.isDestroyed){ return false; } this.proxy.hide(); this.el.setStyle('display', 'block'); this.el.show(); if(this.maximized){ this.fitContainer(); } if(Ext.isMac && Ext.isGecko2){ this.cascade(this.setAutoScroll); } if(this.monitorResize || this.modal || this.constrain || this.constrainHeader){ Ext.EventManager.onWindowResize(this.onWindowResize, this); } this.doConstrain(); this.doLayout(); if(this.keyMap){ this.keyMap.enable(); } this.toFront(); this.updateHandles(); if(isAnim && (Ext.isIE || Ext.isWebKit)){ var sz = this.getSize(); this.onResize(sz.width, sz.height); } this.onShow(); this.fireEvent('show', this); }, animShow : function(){ this.proxy.show(); this.proxy.setBox(this.animateTarget.getBox()); this.proxy.setOpacity(0); var b = this.getBox(); this.el.setStyle('display', 'none'); this.proxy.shift(Ext.apply(b, { callback: this.afterShow.createDelegate(this, [true], false), scope: this, easing: 'easeNone', duration: this.showAnimDuration, opacity: 0.5 })); }, hide : function(animateTarget, cb, scope){ if(this.hidden || this.fireEvent('beforehide', this) === false){ return this; } if(cb){ this.on('hide', cb, scope, {single:true}); } this.hidden = true; if(animateTarget !== undefined){ this.setAnimateTarget(animateTarget); } if(this.modal){ this.mask.hide(); Ext.getBody().removeClass('x-body-masked'); } if(this.animateTarget){ this.animHide(); }else{ this.el.hide(); this.afterHide(); } return this; }, afterHide : function(){ this.proxy.hide(); if(this.monitorResize || this.modal || this.constrain || this.constrainHeader){ Ext.EventManager.removeResizeListener(this.onWindowResize, this); } if(this.keyMap){ this.keyMap.disable(); } this.onHide(); this.fireEvent('hide', this); }, animHide : function(){ this.proxy.setOpacity(0.5); this.proxy.show(); var tb = this.getBox(false); this.proxy.setBox(tb); this.el.hide(); this.proxy.shift(Ext.apply(this.animateTarget.getBox(), { callback: this.afterHide, scope: this, duration: this.hideAnimDuration, easing: 'easeNone', opacity: 0 })); }, onShow : Ext.emptyFn, onHide : Ext.emptyFn, onWindowResize : function(){ if(this.maximized){ this.fitContainer(); } if(this.modal){ this.mask.setSize('100%', '100%'); var force = this.mask.dom.offsetHeight; this.mask.setSize(Ext.lib.Dom.getViewWidth(true), Ext.lib.Dom.getViewHeight(true)); } this.doConstrain(); }, doConstrain : function(){ if(this.constrain || this.constrainHeader){ var offsets; if(this.constrain){ offsets = { right:this.el.shadowOffset, left:this.el.shadowOffset, bottom:this.el.shadowOffset }; }else { var s = this.getSize(); offsets = { right:-(s.width - 100), bottom:-(s.height - 25 + this.el.getConstrainOffset()) }; } var xy = this.el.getConstrainToXY(this.container, true, offsets); if(xy){ this.setPosition(xy[0], xy[1]); } } }, ghost : function(cls){ var ghost = this.createGhost(cls); var box = this.getBox(true); ghost.setLeftTop(box.x, box.y); ghost.setWidth(box.width); this.el.hide(); this.activeGhost = ghost; return ghost; }, unghost : function(show, matchPosition){ if(!this.activeGhost) { return; } if(show !== false){ this.el.show(); this.focus.defer(10, this); if(Ext.isMac && Ext.isGecko2){ this.cascade(this.setAutoScroll); } } if(matchPosition !== false){ this.setPosition(this.activeGhost.getLeft(true), this.activeGhost.getTop(true)); } this.activeGhost.hide(); this.activeGhost.remove(); delete this.activeGhost; }, minimize : function(){ this.fireEvent('minimize', this); return this; }, close : function(){ if(this.fireEvent('beforeclose', this) !== false){ if(this.hidden){ this.doClose(); }else{ this.hide(null, this.doClose, this); } } }, doClose : function(){ this.fireEvent('close', this); this.destroy(); }, maximize : function(){ if(!this.maximized){ this.expand(false); this.restoreSize = this.getSize(); this.restorePos = this.getPosition(true); if (this.maximizable){ this.tools.maximize.hide(); this.tools.restore.show(); } this.maximized = true; this.el.disableShadow(); if(this.dd){ this.dd.lock(); } if(this.collapsible){ this.tools.toggle.hide(); } this.el.addClass('x-window-maximized'); this.container.addClass('x-window-maximized-ct'); this.setPosition(0, 0); this.fitContainer(); this.fireEvent('maximize', this); } return this; }, restore : function(){ if(this.maximized){ var t = this.tools; this.el.removeClass('x-window-maximized'); if(t.restore){ t.restore.hide(); } if(t.maximize){ t.maximize.show(); } this.setPosition(this.restorePos[0], this.restorePos[1]); this.setSize(this.restoreSize.width, this.restoreSize.height); delete this.restorePos; delete this.restoreSize; this.maximized = false; this.el.enableShadow(true); if(this.dd){ this.dd.unlock(); } if(this.collapsible && t.toggle){ t.toggle.show(); } this.container.removeClass('x-window-maximized-ct'); this.doConstrain(); this.fireEvent('restore', this); } return this; }, toggleMaximize : function(){ return this[this.maximized ? 'restore' : 'maximize'](); }, fitContainer : function(){ var vs = this.container.getViewSize(false); this.setSize(vs.width, vs.height); }, setZIndex : function(index){ if(this.modal){ this.mask.setStyle('z-index', index); } this.el.setZIndex(++index); index += 5; if(this.resizer){ this.resizer.proxy.setStyle('z-index', ++index); } this.lastZIndex = index; }, alignTo : function(element, position, offsets){ var xy = this.el.getAlignToXY(element, position, offsets); this.setPagePosition(xy[0], xy[1]); return this; }, anchorTo : function(el, alignment, offsets, monitorScroll){ this.clearAnchor(); this.anchorTarget = { el: el, alignment: alignment, offsets: offsets }; Ext.EventManager.onWindowResize(this.doAnchor, this); var tm = typeof monitorScroll; if(tm != 'undefined'){ Ext.EventManager.on(window, 'scroll', this.doAnchor, this, {buffer: tm == 'number' ? monitorScroll : 50}); } return this.doAnchor(); }, doAnchor : function(){ var o = this.anchorTarget; this.alignTo(o.el, o.alignment, o.offsets); return this; }, clearAnchor : function(){ if(this.anchorTarget){ Ext.EventManager.removeResizeListener(this.doAnchor, this); Ext.EventManager.un(window, 'scroll', this.doAnchor, this); delete this.anchorTarget; } return this; }, toFront : function(e){ if(this.manager.bringToFront(this)){ if(!e || !e.getTarget().focus){ this.focus(); } } return this; }, setActive : function(active){ if(active){ if(!this.maximized){ this.el.enableShadow(true); } this.fireEvent('activate', this); }else{ this.el.disableShadow(); this.fireEvent('deactivate', this); } }, toBack : function(){ this.manager.sendToBack(this); return this; }, center : function(){ var xy = this.el.getAlignToXY(this.container, 'c-c'); this.setPagePosition(xy[0], xy[1]); return this; } }); Ext.reg('window', Ext.Window); Ext.Window.DD = Ext.extend(Ext.dd.DD, { constructor : function(win){ this.win = win; Ext.Window.DD.superclass.constructor.call(this, win.el.id, 'WindowDD-'+win.id); this.setHandleElId(win.header.id); this.scroll = false; }, moveOnly:true, headerOffsets:[100, 25], startDrag : function(){ var w = this.win; this.proxy = w.ghost(w.initialConfig.cls); if(w.constrain !== false){ var so = w.el.shadowOffset; this.constrainTo(w.container, {right: so, left: so, bottom: so}); }else if(w.constrainHeader !== false){ var s = this.proxy.getSize(); this.constrainTo(w.container, {right: -(s.width-this.headerOffsets[0]), bottom: -(s.height-this.headerOffsets[1])}); } }, b4Drag : Ext.emptyFn, onDrag : function(e){ this.alignElWithMouse(this.proxy, e.getPageX(), e.getPageY()); }, endDrag : function(e){ this.win.unghost(); this.win.saveState(); } }); Ext.WindowGroup = function(){ var list = {}; var accessList = []; var front = null; var sortWindows = function(d1, d2){ return (!d1._lastAccess || d1._lastAccess < d2._lastAccess) ? -1 : 1; }; var orderWindows = function(){ var a = accessList, len = a.length; if(len > 0){ a.sort(sortWindows); var seed = a[0].manager.zseed; for(var i = 0; i < len; i++){ var win = a[i]; if(win && !win.hidden){ win.setZIndex(seed + (i*10)); } } } activateLast(); }; var setActiveWin = function(win){ if(win != front){ if(front){ front.setActive(false); } front = win; if(win){ win.setActive(true); } } }; var activateLast = function(){ for(var i = accessList.length-1; i >=0; --i) { if(!accessList[i].hidden){ setActiveWin(accessList[i]); return; } } setActiveWin(null); }; return { zseed : 9000, register : function(win){ if(win.manager){ win.manager.unregister(win); } win.manager = this; list[win.id] = win; accessList.push(win); win.on('hide', activateLast); }, unregister : function(win){ delete win.manager; delete list[win.id]; win.un('hide', activateLast); accessList.remove(win); }, get : function(id){ return typeof id == "object" ? id : list[id]; }, bringToFront : function(win){ win = this.get(win); if(win != front){ win._lastAccess = new Date().getTime(); orderWindows(); return true; } return false; }, sendToBack : function(win){ win = this.get(win); win._lastAccess = -(new Date().getTime()); orderWindows(); return win; }, hideAll : function(){ for(var id in list){ if(list[id] && typeof list[id] != "function" && list[id].isVisible()){ list[id].hide(); } } }, getActive : function(){ return front; }, getBy : function(fn, scope){ var r = []; for(var i = accessList.length-1; i >=0; --i) { var win = accessList[i]; if(fn.call(scope||win, win) !== false){ r.push(win); } } return r; }, each : function(fn, scope){ for(var id in list){ if(list[id] && typeof list[id] != "function"){ if(fn.call(scope || list[id], list[id]) === false){ return; } } } } }; }; Ext.WindowMgr = new Ext.WindowGroup(); Ext.MessageBox = function(){ var dlg, opt, mask, waitTimer, bodyEl, msgEl, textboxEl, textareaEl, progressBar, pp, iconEl, spacerEl, buttons, activeTextEl, bwidth, bufferIcon = '', iconCls = '', buttonNames = ['ok', 'yes', 'no', 'cancel']; var handleButton = function(button){ buttons[button].blur(); if(dlg.isVisible()){ dlg.hide(); handleHide(); Ext.callback(opt.fn, opt.scope||window, [button, activeTextEl.dom.value, opt], 1); } }; var handleHide = function(){ if(opt && opt.cls){ dlg.el.removeClass(opt.cls); } progressBar.reset(); }; var handleEsc = function(d, k, e){ if(opt && opt.closable !== false){ dlg.hide(); handleHide(); } if(e){ e.stopEvent(); } }; var updateButtons = function(b){ var width = 0, cfg; if(!b){ Ext.each(buttonNames, function(name){ buttons[name].hide(); }); return width; } dlg.footer.dom.style.display = ''; Ext.iterate(buttons, function(name, btn){ cfg = b[name]; if(cfg){ btn.show(); btn.setText(Ext.isString(cfg) ? cfg : Ext.MessageBox.buttonText[name]); width += btn.getEl().getWidth() + 15; }else{ btn.hide(); } }); return width; }; return { getDialog : function(titleText){ if(!dlg){ var btns = []; buttons = {}; Ext.each(buttonNames, function(name){ btns.push(buttons[name] = new Ext.Button({ text: this.buttonText[name], handler: handleButton.createCallback(name), hideMode: 'offsets' })); }, this); dlg = new Ext.Window({ autoCreate : true, title:titleText, resizable:false, constrain:true, constrainHeader:true, minimizable : false, maximizable : false, stateful: false, modal: true, shim:true, buttonAlign:"center", width:400, height:100, minHeight: 80, plain:true, footer:true, closable:true, close : function(){ if(opt && opt.buttons && opt.buttons.no && !opt.buttons.cancel){ handleButton("no"); }else{ handleButton("cancel"); } }, fbar: new Ext.Toolbar({ items: btns, enableOverflow: false }) }); dlg.render(document.body); dlg.getEl().addClass('x-window-dlg'); mask = dlg.mask; bodyEl = dlg.body.createChild({ html:'

    ' }); iconEl = Ext.get(bodyEl.dom.firstChild); var contentEl = bodyEl.dom.childNodes[1]; msgEl = Ext.get(contentEl.firstChild); textboxEl = Ext.get(contentEl.childNodes[2].firstChild); textboxEl.enableDisplayMode(); textboxEl.addKeyListener([10,13], function(){ if(dlg.isVisible() && opt && opt.buttons){ if(opt.buttons.ok){ handleButton("ok"); }else if(opt.buttons.yes){ handleButton("yes"); } } }); textareaEl = Ext.get(contentEl.childNodes[2].childNodes[1]); textareaEl.enableDisplayMode(); progressBar = new Ext.ProgressBar({ renderTo:bodyEl }); bodyEl.createChild({cls:'x-clear'}); } return dlg; }, updateText : function(text){ if(!dlg.isVisible() && !opt.width){ dlg.setSize(this.maxWidth, 100); } msgEl.update(text ? text + ' ' : ' '); var iw = iconCls != '' ? (iconEl.getWidth() + iconEl.getMargins('lr')) : 0, mw = msgEl.getWidth() + msgEl.getMargins('lr'), fw = dlg.getFrameWidth('lr'), bw = dlg.body.getFrameWidth('lr'), w; w = Math.max(Math.min(opt.width || iw+mw+fw+bw, opt.maxWidth || this.maxWidth), Math.max(opt.minWidth || this.minWidth, bwidth || 0)); if(opt.prompt === true){ activeTextEl.setWidth(w-iw-fw-bw); } if(opt.progress === true || opt.wait === true){ progressBar.setSize(w-iw-fw-bw); } if(Ext.isIE && w == bwidth){ w += 4; } msgEl.update(text || ' '); dlg.setSize(w, 'auto').center(); return this; }, updateProgress : function(value, progressText, msg){ progressBar.updateProgress(value, progressText); if(msg){ this.updateText(msg); } return this; }, isVisible : function(){ return dlg && dlg.isVisible(); }, hide : function(){ var proxy = dlg ? dlg.activeGhost : null; if(this.isVisible() || proxy){ dlg.hide(); handleHide(); if (proxy){ dlg.unghost(false, false); } } return this; }, show : function(options){ if(this.isVisible()){ this.hide(); } opt = options; var d = this.getDialog(opt.title || " "); d.setTitle(opt.title || " "); var allowClose = (opt.closable !== false && opt.progress !== true && opt.wait !== true); d.tools.close.setDisplayed(allowClose); activeTextEl = textboxEl; opt.prompt = opt.prompt || (opt.multiline ? true : false); if(opt.prompt){ if(opt.multiline){ textboxEl.hide(); textareaEl.show(); textareaEl.setHeight(Ext.isNumber(opt.multiline) ? opt.multiline : this.defaultTextHeight); activeTextEl = textareaEl; }else{ textboxEl.show(); textareaEl.hide(); } }else{ textboxEl.hide(); textareaEl.hide(); } activeTextEl.dom.value = opt.value || ""; if(opt.prompt){ d.focusEl = activeTextEl; }else{ var bs = opt.buttons; var db = null; if(bs && bs.ok){ db = buttons["ok"]; }else if(bs && bs.yes){ db = buttons["yes"]; } if (db){ d.focusEl = db; } } if(Ext.isDefined(opt.iconCls)){ d.setIconClass(opt.iconCls); } this.setIcon(Ext.isDefined(opt.icon) ? opt.icon : bufferIcon); bwidth = updateButtons(opt.buttons); progressBar.setVisible(opt.progress === true || opt.wait === true); this.updateProgress(0, opt.progressText); this.updateText(opt.msg); if(opt.cls){ d.el.addClass(opt.cls); } d.proxyDrag = opt.proxyDrag === true; d.modal = opt.modal !== false; d.mask = opt.modal !== false ? mask : false; if(!d.isVisible()){ document.body.appendChild(dlg.el.dom); d.setAnimateTarget(opt.animEl); d.on('show', function(){ if(allowClose === true){ d.keyMap.enable(); }else{ d.keyMap.disable(); } }, this, {single:true}); d.show(opt.animEl); } if(opt.wait === true){ progressBar.wait(opt.waitConfig); } return this; }, setIcon : function(icon){ if(!dlg){ bufferIcon = icon; return; } bufferIcon = undefined; if(icon && icon != ''){ iconEl.removeClass('x-hidden'); iconEl.replaceClass(iconCls, icon); bodyEl.addClass('x-dlg-icon'); iconCls = icon; }else{ iconEl.replaceClass(iconCls, 'x-hidden'); bodyEl.removeClass('x-dlg-icon'); iconCls = ''; } return this; }, progress : function(title, msg, progressText){ this.show({ title : title, msg : msg, buttons: false, progress:true, closable:false, minWidth: this.minProgressWidth, progressText: progressText }); return this; }, wait : function(msg, title, config){ this.show({ title : title, msg : msg, buttons: false, closable:false, wait:true, modal:true, minWidth: this.minProgressWidth, waitConfig: config }); return this; }, alert : function(title, msg, fn, scope){ this.show({ title : title, msg : msg, buttons: this.OK, fn: fn, scope : scope, minWidth: this.minWidth }); return this; }, confirm : function(title, msg, fn, scope){ this.show({ title : title, msg : msg, buttons: this.YESNO, fn: fn, scope : scope, icon: this.QUESTION, minWidth: this.minWidth }); return this; }, prompt : function(title, msg, fn, scope, multiline, value){ this.show({ title : title, msg : msg, buttons: this.OKCANCEL, fn: fn, minWidth: this.minPromptWidth, scope : scope, prompt:true, multiline: multiline, value: value }); return this; }, OK : {ok:true}, CANCEL : {cancel:true}, OKCANCEL : {ok:true, cancel:true}, YESNO : {yes:true, no:true}, YESNOCANCEL : {yes:true, no:true, cancel:true}, INFO : 'ext-mb-info', WARNING : 'ext-mb-warning', QUESTION : 'ext-mb-question', ERROR : 'ext-mb-error', defaultTextHeight : 75, maxWidth : 600, minWidth : 100, minProgressWidth : 250, minPromptWidth: 250, buttonText : { ok : "OK", cancel : "Cancel", yes : "Yes", no : "No" } }; }(); Ext.Msg = Ext.MessageBox; Ext.dd.PanelProxy = Ext.extend(Object, { constructor : function(panel, config){ this.panel = panel; this.id = this.panel.id +'-ddproxy'; Ext.apply(this, config); }, insertProxy : true, setStatus : Ext.emptyFn, reset : Ext.emptyFn, update : Ext.emptyFn, stop : Ext.emptyFn, sync: Ext.emptyFn, getEl : function(){ return this.ghost; }, getGhost : function(){ return this.ghost; }, getProxy : function(){ return this.proxy; }, hide : function(){ if(this.ghost){ if(this.proxy){ this.proxy.remove(); delete this.proxy; } this.panel.el.dom.style.display = ''; this.ghost.remove(); delete this.ghost; } }, show : function(){ if(!this.ghost){ this.ghost = this.panel.createGhost(this.panel.initialConfig.cls, undefined, Ext.getBody()); this.ghost.setXY(this.panel.el.getXY()); if(this.insertProxy){ this.proxy = this.panel.el.insertSibling({cls:'x-panel-dd-spacer'}); this.proxy.setSize(this.panel.getSize()); } this.panel.el.dom.style.display = 'none'; } }, repair : function(xy, callback, scope){ this.hide(); if(typeof callback == "function"){ callback.call(scope || this); } }, moveProxy : function(parentNode, before){ if(this.proxy){ parentNode.insertBefore(this.proxy.dom, before); } } }); Ext.Panel.DD = Ext.extend(Ext.dd.DragSource, { constructor : function(panel, cfg){ this.panel = panel; this.dragData = {panel: panel}; this.proxy = new Ext.dd.PanelProxy(panel, cfg); Ext.Panel.DD.superclass.constructor.call(this, panel.el, cfg); var h = panel.header, el = panel.body; if(h){ this.setHandleElId(h.id); el = panel.header; } el.setStyle('cursor', 'move'); this.scroll = false; }, showFrame: Ext.emptyFn, startDrag: Ext.emptyFn, b4StartDrag: function(x, y) { this.proxy.show(); }, b4MouseDown: function(e) { var x = e.getPageX(), y = e.getPageY(); this.autoOffset(x, y); }, onInitDrag : function(x, y){ this.onStartDrag(x, y); return true; }, createFrame : Ext.emptyFn, getDragEl : function(e){ return this.proxy.ghost.dom; }, endDrag : function(e){ this.proxy.hide(); this.panel.saveState(); }, autoOffset : function(x, y) { x -= this.startPageX; y -= this.startPageY; this.setDelta(x, y); } }); Ext.state.Provider = Ext.extend(Ext.util.Observable, { constructor : function(){ this.addEvents("statechange"); this.state = {}; Ext.state.Provider.superclass.constructor.call(this); }, get : function(name, defaultValue){ return typeof this.state[name] == "undefined" ? defaultValue : this.state[name]; }, clear : function(name){ delete this.state[name]; this.fireEvent("statechange", this, name, null); }, set : function(name, value){ this.state[name] = value; this.fireEvent("statechange", this, name, value); }, decodeValue : function(cookie){ var re = /^(a|n|d|b|s|o|e)\:(.*)$/, matches = re.exec(unescape(cookie)), all, type, v, kv; if(!matches || !matches[1]){ return; } type = matches[1]; v = matches[2]; switch(type){ case 'e': return null; case 'n': return parseFloat(v); case 'd': return new Date(Date.parse(v)); case 'b': return (v == '1'); case 'a': all = []; if(v != ''){ Ext.each(v.split('^'), function(val){ all.push(this.decodeValue(val)); }, this); } return all; case 'o': all = {}; if(v != ''){ Ext.each(v.split('^'), function(val){ kv = val.split('='); all[kv[0]] = this.decodeValue(kv[1]); }, this); } return all; default: return v; } }, encodeValue : function(v){ var enc, flat = '', i = 0, len, key; if(v == null){ return 'e:1'; }else if(typeof v == 'number'){ enc = 'n:' + v; }else if(typeof v == 'boolean'){ enc = 'b:' + (v ? '1' : '0'); }else if(Ext.isDate(v)){ enc = 'd:' + v.toGMTString(); }else if(Ext.isArray(v)){ for(len = v.length; i < len; i++){ flat += this.encodeValue(v[i]); if(i != len - 1){ flat += '^'; } } enc = 'a:' + flat; }else if(typeof v == 'object'){ for(key in v){ if(typeof v[key] != 'function' && v[key] !== undefined){ flat += key + '=' + this.encodeValue(v[key]) + '^'; } } enc = 'o:' + flat.substring(0, flat.length-1); }else{ enc = 's:' + v; } return escape(enc); } }); Ext.state.Manager = function(){ var provider = new Ext.state.Provider(); return { setProvider : function(stateProvider){ provider = stateProvider; }, get : function(key, defaultValue){ return provider.get(key, defaultValue); }, set : function(key, value){ provider.set(key, value); }, clear : function(key){ provider.clear(key); }, getProvider : function(){ return provider; } }; }(); Ext.state.CookieProvider = Ext.extend(Ext.state.Provider, { constructor : function(config){ Ext.state.CookieProvider.superclass.constructor.call(this); this.path = "/"; this.expires = new Date(new Date().getTime()+(1000*60*60*24*7)); this.domain = null; this.secure = false; Ext.apply(this, config); this.state = this.readCookies(); }, set : function(name, value){ if(typeof value == "undefined" || value === null){ this.clear(name); return; } this.setCookie(name, value); Ext.state.CookieProvider.superclass.set.call(this, name, value); }, clear : function(name){ this.clearCookie(name); Ext.state.CookieProvider.superclass.clear.call(this, name); }, readCookies : function(){ var cookies = {}, c = document.cookie + ";", re = /\s?(.*?)=(.*?);/g, matches, name, value; while((matches = re.exec(c)) != null){ name = matches[1]; value = matches[2]; if(name && name.substring(0,3) == "ys-"){ cookies[name.substr(3)] = this.decodeValue(value); } } return cookies; }, setCookie : function(name, value){ document.cookie = "ys-"+ name + "=" + this.encodeValue(value) + ((this.expires == null) ? "" : ("; expires=" + this.expires.toGMTString())) + ((this.path == null) ? "" : ("; path=" + this.path)) + ((this.domain == null) ? "" : ("; domain=" + this.domain)) + ((this.secure == true) ? "; secure" : ""); }, clearCookie : function(name){ document.cookie = "ys-" + name + "=null; expires=Thu, 01-Jan-70 00:00:01 GMT" + ((this.path == null) ? "" : ("; path=" + this.path)) + ((this.domain == null) ? "" : ("; domain=" + this.domain)) + ((this.secure == true) ? "; secure" : ""); } }); Ext.DataView = Ext.extend(Ext.BoxComponent, { selectedClass : "x-view-selected", emptyText : "", deferEmptyText: true, trackOver: false, blockRefresh: false, last: false, initComponent : function(){ Ext.DataView.superclass.initComponent.call(this); if(Ext.isString(this.tpl) || Ext.isArray(this.tpl)){ this.tpl = new Ext.XTemplate(this.tpl); } this.addEvents( "beforeclick", "click", "mouseenter", "mouseleave", "containerclick", "dblclick", "contextmenu", "containercontextmenu", "selectionchange", "beforeselect" ); this.store = Ext.StoreMgr.lookup(this.store); this.all = new Ext.CompositeElementLite(); this.selected = new Ext.CompositeElementLite(); }, afterRender : function(){ Ext.DataView.superclass.afterRender.call(this); this.mon(this.getTemplateTarget(), { "click": this.onClick, "dblclick": this.onDblClick, "contextmenu": this.onContextMenu, scope:this }); if(this.overClass || this.trackOver){ this.mon(this.getTemplateTarget(), { "mouseover": this.onMouseOver, "mouseout": this.onMouseOut, scope:this }); } if(this.store){ this.bindStore(this.store, true); } }, refresh : function() { this.clearSelections(false, true); var el = this.getTemplateTarget(), records = this.store.getRange(); el.update(''); if(records.length < 1){ if(!this.deferEmptyText || this.hasSkippedEmptyText){ el.update(this.emptyText); } this.all.clear(); }else{ this.tpl.overwrite(el, this.collectData(records, 0)); this.all.fill(Ext.query(this.itemSelector, el.dom)); this.updateIndexes(0); } this.hasSkippedEmptyText = true; }, getTemplateTarget: function(){ return this.el; }, prepareData : function(data){ return data; }, collectData : function(records, startIndex){ var r = [], i = 0, len = records.length; for(; i < len; i++){ r[r.length] = this.prepareData(records[i].data, startIndex + i, records[i]); } return r; }, bufferRender : function(records, index){ var div = document.createElement('div'); this.tpl.overwrite(div, this.collectData(records, index)); return Ext.query(this.itemSelector, div); }, onUpdate : function(ds, record){ var index = this.store.indexOf(record); if(index > -1){ var sel = this.isSelected(index), original = this.all.elements[index], node = this.bufferRender([record], index)[0]; this.all.replaceElement(index, node, true); if(sel){ this.selected.replaceElement(original, node); this.all.item(index).addClass(this.selectedClass); } this.updateIndexes(index, index); } }, onAdd : function(ds, records, index){ if(this.all.getCount() === 0){ this.refresh(); return; } var nodes = this.bufferRender(records, index), n, a = this.all.elements; if(index < this.all.getCount()){ n = this.all.item(index).insertSibling(nodes, 'before', true); a.splice.apply(a, [index, 0].concat(nodes)); }else{ n = this.all.last().insertSibling(nodes, 'after', true); a.push.apply(a, nodes); } this.updateIndexes(index); }, onRemove : function(ds, record, index){ this.deselect(index); this.all.removeElement(index, true); this.updateIndexes(index); if (this.store.getCount() === 0){ this.refresh(); } }, refreshNode : function(index){ this.onUpdate(this.store, this.store.getAt(index)); }, updateIndexes : function(startIndex, endIndex){ var ns = this.all.elements; startIndex = startIndex || 0; endIndex = endIndex || ((endIndex === 0) ? 0 : (ns.length - 1)); for(var i = startIndex; i <= endIndex; i++){ ns[i].viewIndex = i; } }, getStore : function(){ return this.store; }, bindStore : function(store, initial){ if(!initial && this.store){ if(store !== this.store && this.store.autoDestroy){ this.store.destroy(); }else{ this.store.un("beforeload", this.onBeforeLoad, this); this.store.un("datachanged", this.onDataChanged, this); this.store.un("add", this.onAdd, this); this.store.un("remove", this.onRemove, this); this.store.un("update", this.onUpdate, this); this.store.un("clear", this.refresh, this); } if(!store){ this.store = null; } } if(store){ store = Ext.StoreMgr.lookup(store); store.on({ scope: this, beforeload: this.onBeforeLoad, datachanged: this.onDataChanged, add: this.onAdd, remove: this.onRemove, update: this.onUpdate, clear: this.refresh }); } this.store = store; if(store){ this.refresh(); } }, onDataChanged: function() { if (this.blockRefresh !== true) { this.refresh.apply(this, arguments); } }, findItemFromChild : function(node){ return Ext.fly(node).findParent(this.itemSelector, this.getTemplateTarget()); }, onClick : function(e){ var item = e.getTarget(this.itemSelector, this.getTemplateTarget()), index; if(item){ index = this.indexOf(item); if(this.onItemClick(item, index, e) !== false){ this.fireEvent("click", this, index, item, e); } }else{ if(this.fireEvent("containerclick", this, e) !== false){ this.onContainerClick(e); } } }, onContainerClick : function(e){ this.clearSelections(); }, onContextMenu : function(e){ var item = e.getTarget(this.itemSelector, this.getTemplateTarget()); if(item){ this.fireEvent("contextmenu", this, this.indexOf(item), item, e); }else{ this.fireEvent("containercontextmenu", this, e); } }, onDblClick : function(e){ var item = e.getTarget(this.itemSelector, this.getTemplateTarget()); if(item){ this.fireEvent("dblclick", this, this.indexOf(item), item, e); } }, onMouseOver : function(e){ var item = e.getTarget(this.itemSelector, this.getTemplateTarget()); if(item && item !== this.lastItem){ this.lastItem = item; Ext.fly(item).addClass(this.overClass); this.fireEvent("mouseenter", this, this.indexOf(item), item, e); } }, onMouseOut : function(e){ if(this.lastItem){ if(!e.within(this.lastItem, true, true)){ Ext.fly(this.lastItem).removeClass(this.overClass); this.fireEvent("mouseleave", this, this.indexOf(this.lastItem), this.lastItem, e); delete this.lastItem; } } }, onItemClick : function(item, index, e){ if(this.fireEvent("beforeclick", this, index, item, e) === false){ return false; } if(this.multiSelect){ this.doMultiSelection(item, index, e); e.preventDefault(); }else if(this.singleSelect){ this.doSingleSelection(item, index, e); e.preventDefault(); } return true; }, doSingleSelection : function(item, index, e){ if(e.ctrlKey && this.isSelected(index)){ this.deselect(index); }else{ this.select(index, false); } }, doMultiSelection : function(item, index, e){ if(e.shiftKey && this.last !== false){ var last = this.last; this.selectRange(last, index, e.ctrlKey); this.last = last; }else{ if((e.ctrlKey||this.simpleSelect) && this.isSelected(index)){ this.deselect(index); }else{ this.select(index, e.ctrlKey || e.shiftKey || this.simpleSelect); } } }, getSelectionCount : function(){ return this.selected.getCount(); }, getSelectedNodes : function(){ return this.selected.elements; }, getSelectedIndexes : function(){ var indexes = [], selected = this.selected.elements, i = 0, len = selected.length; for(; i < len; i++){ indexes.push(selected[i].viewIndex); } return indexes; }, getSelectedRecords : function(){ return this.getRecords(this.selected.elements); }, getRecords : function(nodes){ var records = [], i = 0, len = nodes.length; for(; i < len; i++){ records[records.length] = this.store.getAt(nodes[i].viewIndex); } return records; }, getRecord : function(node){ return this.store.getAt(node.viewIndex); }, clearSelections : function(suppressEvent, skipUpdate){ if((this.multiSelect || this.singleSelect) && this.selected.getCount() > 0){ if(!skipUpdate){ this.selected.removeClass(this.selectedClass); } this.selected.clear(); this.last = false; if(!suppressEvent){ this.fireEvent("selectionchange", this, this.selected.elements); } } }, isSelected : function(node){ return this.selected.contains(this.getNode(node)); }, deselect : function(node){ if(this.isSelected(node)){ node = this.getNode(node); this.selected.removeElement(node); if(this.last == node.viewIndex){ this.last = false; } Ext.fly(node).removeClass(this.selectedClass); this.fireEvent("selectionchange", this, this.selected.elements); } }, select : function(nodeInfo, keepExisting, suppressEvent){ if(Ext.isArray(nodeInfo)){ if(!keepExisting){ this.clearSelections(true); } for(var i = 0, len = nodeInfo.length; i < len; i++){ this.select(nodeInfo[i], true, true); } if(!suppressEvent){ this.fireEvent("selectionchange", this, this.selected.elements); } } else{ var node = this.getNode(nodeInfo); if(!keepExisting){ this.clearSelections(true); } if(node && !this.isSelected(node)){ if(this.fireEvent("beforeselect", this, node, this.selected.elements) !== false){ Ext.fly(node).addClass(this.selectedClass); this.selected.add(node); this.last = node.viewIndex; if(!suppressEvent){ this.fireEvent("selectionchange", this, this.selected.elements); } } } } }, selectRange : function(start, end, keepExisting){ if(!keepExisting){ this.clearSelections(true); } this.select(this.getNodes(start, end), true); }, getNode : function(nodeInfo){ if(Ext.isString(nodeInfo)){ return document.getElementById(nodeInfo); }else if(Ext.isNumber(nodeInfo)){ return this.all.elements[nodeInfo]; }else if(nodeInfo instanceof Ext.data.Record){ var idx = this.store.indexOf(nodeInfo); return this.all.elements[idx]; } return nodeInfo; }, getNodes : function(start, end){ var ns = this.all.elements, nodes = [], i; start = start || 0; end = !Ext.isDefined(end) ? Math.max(ns.length - 1, 0) : end; if(start <= end){ for(i = start; i <= end && ns[i]; i++){ nodes.push(ns[i]); } } else{ for(i = start; i >= end && ns[i]; i--){ nodes.push(ns[i]); } } return nodes; }, indexOf : function(node){ node = this.getNode(node); if(Ext.isNumber(node.viewIndex)){ return node.viewIndex; } return this.all.indexOf(node); }, onBeforeLoad : function(){ if(this.loadingText){ this.clearSelections(false, true); this.getTemplateTarget().update('
    '+this.loadingText+'
    '); this.all.clear(); } }, onDestroy : function(){ this.all.clear(); this.selected.clear(); Ext.DataView.superclass.onDestroy.call(this); this.bindStore(null); } }); Ext.DataView.prototype.setStore = Ext.DataView.prototype.bindStore; Ext.reg('dataview', Ext.DataView); Ext.list.ListView = Ext.extend(Ext.DataView, { itemSelector: 'dl', selectedClass:'x-list-selected', overClass:'x-list-over', scrollOffset : undefined, columnResize: true, columnSort: true, maxColumnWidth: Ext.isIE ? 99 : 100, initComponent : function(){ if(this.columnResize){ this.colResizer = new Ext.list.ColumnResizer(this.colResizer); this.colResizer.init(this); } if(this.columnSort){ this.colSorter = new Ext.list.Sorter(this.columnSort); this.colSorter.init(this); } if(!this.internalTpl){ this.internalTpl = new Ext.XTemplate( '
    ', '', '
    ', '{header}', '
    ', '
    ', '
    ', '
    ', '
    ', '
    ' ); } if(!this.tpl){ this.tpl = new Ext.XTemplate( '', '
    ', '', '
    ', ' class="{cls}">', '{[values.tpl.apply(parent)]}', '
    ', '
    ', '
    ', '
    ', '
    ' ); }; var cs = this.columns, allocatedWidth = 0, colsWithWidth = 0, len = cs.length, columns = []; for(var i = 0; i < len; i++){ var c = cs[i]; if(!c.isColumn) { c.xtype = c.xtype ? (/^lv/.test(c.xtype) ? c.xtype : 'lv' + c.xtype) : 'lvcolumn'; c = Ext.create(c); } if(c.width) { allocatedWidth += c.width*100; if(allocatedWidth > this.maxColumnWidth){ c.width -= (allocatedWidth - this.maxColumnWidth) / 100; } colsWithWidth++; } columns.push(c); } cs = this.columns = columns; if(colsWithWidth < len){ var remaining = len - colsWithWidth; if(allocatedWidth < this.maxColumnWidth){ var perCol = ((this.maxColumnWidth-allocatedWidth) / remaining)/100; for(var j = 0; j < len; j++){ var c = cs[j]; if(!c.width){ c.width = perCol; } } } } Ext.list.ListView.superclass.initComponent.call(this); }, onRender : function(){ this.autoEl = { cls: 'x-list-wrap' }; Ext.list.ListView.superclass.onRender.apply(this, arguments); this.internalTpl.overwrite(this.el, {columns: this.columns}); this.innerBody = Ext.get(this.el.dom.childNodes[1].firstChild); this.innerHd = Ext.get(this.el.dom.firstChild.firstChild); if(this.hideHeaders){ this.el.dom.firstChild.style.display = 'none'; } }, getTemplateTarget : function(){ return this.innerBody; }, collectData : function(){ var rs = Ext.list.ListView.superclass.collectData.apply(this, arguments); return { columns: this.columns, rows: rs }; }, verifyInternalSize : function(){ if(this.lastSize){ this.onResize(this.lastSize.width, this.lastSize.height); } }, onResize : function(w, h){ var body = this.innerBody.dom, header = this.innerHd.dom, scrollWidth = w - Ext.num(this.scrollOffset, Ext.getScrollBarWidth()) + 'px', parentNode; if(!body){ return; } parentNode = body.parentNode; if(Ext.isNumber(w)){ if(this.reserveScrollOffset || ((parentNode.offsetWidth - parentNode.clientWidth) > 10)){ body.style.width = scrollWidth; header.style.width = scrollWidth; }else{ body.style.width = w + 'px'; header.style.width = w + 'px'; setTimeout(function(){ if((parentNode.offsetWidth - parentNode.clientWidth) > 10){ body.style.width = scrollWidth; header.style.width = scrollWidth; } }, 10); } } if(Ext.isNumber(h)){ parentNode.style.height = Math.max(0, h - header.parentNode.offsetHeight) + 'px'; } }, updateIndexes : function(){ Ext.list.ListView.superclass.updateIndexes.apply(this, arguments); this.verifyInternalSize(); }, findHeaderIndex : function(header){ header = header.dom || header; var parentNode = header.parentNode, children = parentNode.parentNode.childNodes, i = 0, c; for(; c = children[i]; i++){ if(c == parentNode){ return i; } } return -1; }, setHdWidths : function(){ var els = this.innerHd.dom.getElementsByTagName('div'), i = 0, columns = this.columns, len = columns.length; for(; i < len; i++){ els[i].style.width = (columns[i].width*100) + '%'; } } }); Ext.reg('listview', Ext.list.ListView); Ext.ListView = Ext.list.ListView; Ext.list.Column = Ext.extend(Object, { isColumn: true, align: 'left', header: '', width: null, cls: '', constructor : function(c){ if(!c.tpl){ c.tpl = new Ext.XTemplate('{' + c.dataIndex + '}'); } else if(Ext.isString(c.tpl)){ c.tpl = new Ext.XTemplate(c.tpl); } Ext.apply(this, c); } }); Ext.reg('lvcolumn', Ext.list.Column); Ext.list.NumberColumn = Ext.extend(Ext.list.Column, { format: '0,000.00', constructor : function(c) { c.tpl = c.tpl || new Ext.XTemplate('{' + c.dataIndex + ':number("' + (c.format || this.format) + '")}'); Ext.list.NumberColumn.superclass.constructor.call(this, c); } }); Ext.reg('lvnumbercolumn', Ext.list.NumberColumn); Ext.list.DateColumn = Ext.extend(Ext.list.Column, { format: 'm/d/Y', constructor : function(c) { c.tpl = c.tpl || new Ext.XTemplate('{' + c.dataIndex + ':date("' + (c.format || this.format) + '")}'); Ext.list.DateColumn.superclass.constructor.call(this, c); } }); Ext.reg('lvdatecolumn', Ext.list.DateColumn); Ext.list.BooleanColumn = Ext.extend(Ext.list.Column, { trueText: 'true', falseText: 'false', undefinedText: ' ', constructor : function(c) { c.tpl = c.tpl || new Ext.XTemplate('{' + c.dataIndex + ':this.format}'); var t = this.trueText, f = this.falseText, u = this.undefinedText; c.tpl.format = function(v){ if(v === undefined){ return u; } if(!v || v === 'false'){ return f; } return t; }; Ext.list.DateColumn.superclass.constructor.call(this, c); } }); Ext.reg('lvbooleancolumn', Ext.list.BooleanColumn); Ext.list.ColumnResizer = Ext.extend(Ext.util.Observable, { minPct: .05, constructor: function(config){ Ext.apply(this, config); Ext.list.ColumnResizer.superclass.constructor.call(this); }, init : function(listView){ this.view = listView; listView.on('render', this.initEvents, this); }, initEvents : function(view){ view.mon(view.innerHd, 'mousemove', this.handleHdMove, this); this.tracker = new Ext.dd.DragTracker({ onBeforeStart: this.onBeforeStart.createDelegate(this), onStart: this.onStart.createDelegate(this), onDrag: this.onDrag.createDelegate(this), onEnd: this.onEnd.createDelegate(this), tolerance: 3, autoStart: 300 }); this.tracker.initEl(view.innerHd); view.on('beforedestroy', this.tracker.destroy, this.tracker); }, handleHdMove : function(e, t){ var handleWidth = 5, x = e.getPageX(), header = e.getTarget('em', 3, true); if(header){ var region = header.getRegion(), style = header.dom.style, parentNode = header.dom.parentNode; if(x - region.left <= handleWidth && parentNode != parentNode.parentNode.firstChild){ this.activeHd = Ext.get(parentNode.previousSibling.firstChild); style.cursor = Ext.isWebKit ? 'e-resize' : 'col-resize'; } else if(region.right - x <= handleWidth && parentNode != parentNode.parentNode.lastChild.previousSibling){ this.activeHd = header; style.cursor = Ext.isWebKit ? 'w-resize' : 'col-resize'; } else{ delete this.activeHd; style.cursor = ''; } } }, onBeforeStart : function(e){ this.dragHd = this.activeHd; return !!this.dragHd; }, onStart: function(e){ var me = this, view = me.view, dragHeader = me.dragHd, x = me.tracker.getXY()[0]; me.proxy = view.el.createChild({cls:'x-list-resizer'}); me.dragX = dragHeader.getX(); me.headerIndex = view.findHeaderIndex(dragHeader); me.headersDisabled = view.disableHeaders; view.disableHeaders = true; me.proxy.setHeight(view.el.getHeight()); me.proxy.setX(me.dragX); me.proxy.setWidth(x - me.dragX); this.setBoundaries(); }, setBoundaries: function(relativeX){ var view = this.view, headerIndex = this.headerIndex, width = view.innerHd.getWidth(), relativeX = view.innerHd.getX(), minWidth = Math.ceil(width * this.minPct), maxWidth = width - minWidth, numColumns = view.columns.length, headers = view.innerHd.select('em', true), minX = minWidth + relativeX, maxX = maxWidth + relativeX, header; if (numColumns == 2) { this.minX = minX; this.maxX = maxX; }else{ header = headers.item(headerIndex + 2); this.minX = headers.item(headerIndex).getX() + minWidth; this.maxX = header ? header.getX() - minWidth : maxX; if (headerIndex == 0) { this.minX = minX; } else if (headerIndex == numColumns - 2) { this.maxX = maxX; } } }, onDrag: function(e){ var me = this, cursorX = me.tracker.getXY()[0].constrain(me.minX, me.maxX); me.proxy.setWidth(cursorX - this.dragX); }, onEnd: function(e){ var newWidth = this.proxy.getWidth(), index = this.headerIndex, view = this.view, columns = view.columns, width = view.innerHd.getWidth(), newPercent = Math.ceil(newWidth * view.maxColumnWidth / width) / 100, disabled = this.headersDisabled, headerCol = columns[index], otherCol = columns[index + 1], totalPercent = headerCol.width + otherCol.width; this.proxy.remove(); headerCol.width = newPercent; otherCol.width = totalPercent - newPercent; delete this.dragHd; view.setHdWidths(); view.refresh(); setTimeout(function(){ view.disableHeaders = disabled; }, 100); } }); Ext.ListView.ColumnResizer = Ext.list.ColumnResizer; Ext.list.Sorter = Ext.extend(Ext.util.Observable, { sortClasses : ["sort-asc", "sort-desc"], constructor: function(config){ Ext.apply(this, config); Ext.list.Sorter.superclass.constructor.call(this); }, init : function(listView){ this.view = listView; listView.on('render', this.initEvents, this); }, initEvents : function(view){ view.mon(view.innerHd, 'click', this.onHdClick, this); view.innerHd.setStyle('cursor', 'pointer'); view.mon(view.store, 'datachanged', this.updateSortState, this); this.updateSortState.defer(10, this, [view.store]); }, updateSortState : function(store){ var state = store.getSortState(); if(!state){ return; } this.sortState = state; var cs = this.view.columns, sortColumn = -1; for(var i = 0, len = cs.length; i < len; i++){ if(cs[i].dataIndex == state.field){ sortColumn = i; break; } } if(sortColumn != -1){ var sortDir = state.direction; this.updateSortIcon(sortColumn, sortDir); } }, updateSortIcon : function(col, dir){ var sc = this.sortClasses; var hds = this.view.innerHd.select('em').removeClass(sc); hds.item(col).addClass(sc[dir == "DESC" ? 1 : 0]); }, onHdClick : function(e){ var hd = e.getTarget('em', 3); if(hd && !this.view.disableHeaders){ var index = this.view.findHeaderIndex(hd); this.view.store.sort(this.view.columns[index].dataIndex); } } }); Ext.ListView.Sorter = Ext.list.Sorter; Ext.TabPanel = Ext.extend(Ext.Panel, { deferredRender : true, tabWidth : 120, minTabWidth : 30, resizeTabs : false, enableTabScroll : false, scrollIncrement : 0, scrollRepeatInterval : 400, scrollDuration : 0.35, animScroll : true, tabPosition : 'top', baseCls : 'x-tab-panel', autoTabs : false, autoTabSelector : 'div.x-tab', activeTab : undefined, tabMargin : 2, plain : false, wheelIncrement : 20, idDelimiter : '__', itemCls : 'x-tab-item', elements : 'body', headerAsText : false, frame : false, hideBorders :true, initComponent : function(){ this.frame = false; Ext.TabPanel.superclass.initComponent.call(this); this.addEvents( 'beforetabchange', 'tabchange', 'contextmenu' ); this.setLayout(new Ext.layout.CardLayout(Ext.apply({ layoutOnCardChange: this.layoutOnTabChange, deferredRender: this.deferredRender }, this.layoutConfig))); if(this.tabPosition == 'top'){ this.elements += ',header'; this.stripTarget = 'header'; }else { this.elements += ',footer'; this.stripTarget = 'footer'; } if(!this.stack){ this.stack = Ext.TabPanel.AccessStack(); } this.initItems(); }, onRender : function(ct, position){ Ext.TabPanel.superclass.onRender.call(this, ct, position); if(this.plain){ var pos = this.tabPosition == 'top' ? 'header' : 'footer'; this[pos].addClass('x-tab-panel-'+pos+'-plain'); } var st = this[this.stripTarget]; this.stripWrap = st.createChild({cls:'x-tab-strip-wrap', cn:{ tag:'ul', cls:'x-tab-strip x-tab-strip-'+this.tabPosition}}); var beforeEl = (this.tabPosition=='bottom' ? this.stripWrap : null); st.createChild({cls:'x-tab-strip-spacer'}, beforeEl); this.strip = new Ext.Element(this.stripWrap.dom.firstChild); this.edge = this.strip.createChild({tag:'li', cls:'x-tab-edge', cn: [{tag: 'span', cls: 'x-tab-strip-text', cn: ' '}]}); this.strip.createChild({cls:'x-clear'}); this.body.addClass('x-tab-panel-body-'+this.tabPosition); if(!this.itemTpl){ var tt = new Ext.Template( '
  • ', '', '{text}', '
  • ' ); tt.disableFormats = true; tt.compile(); Ext.TabPanel.prototype.itemTpl = tt; } this.items.each(this.initTab, this); }, afterRender : function(){ Ext.TabPanel.superclass.afterRender.call(this); if(this.autoTabs){ this.readTabs(false); } if(this.activeTab !== undefined){ var item = Ext.isObject(this.activeTab) ? this.activeTab : this.items.get(this.activeTab); delete this.activeTab; this.setActiveTab(item); } }, initEvents : function(){ Ext.TabPanel.superclass.initEvents.call(this); this.mon(this.strip, { scope: this, mousedown: this.onStripMouseDown, contextmenu: this.onStripContextMenu }); if(this.enableTabScroll){ this.mon(this.strip, 'mousewheel', this.onWheel, this); } }, findTargets : function(e){ var item = null, itemEl = e.getTarget('li:not(.x-tab-edge)', this.strip); if(itemEl){ item = this.getComponent(itemEl.id.split(this.idDelimiter)[1]); if(item.disabled){ return { close : null, item : null, el : null }; } } return { close : e.getTarget('.x-tab-strip-close', this.strip), item : item, el : itemEl }; }, onStripMouseDown : function(e){ if(e.button !== 0){ return; } e.preventDefault(); var t = this.findTargets(e); if(t.close){ if (t.item.fireEvent('beforeclose', t.item) !== false) { t.item.fireEvent('close', t.item); this.remove(t.item); } return; } if(t.item && t.item != this.activeTab){ this.setActiveTab(t.item); } }, onStripContextMenu : function(e){ e.preventDefault(); var t = this.findTargets(e); if(t.item){ this.fireEvent('contextmenu', this, t.item, e); } }, readTabs : function(removeExisting){ if(removeExisting === true){ this.items.each(function(item){ this.remove(item); }, this); } var tabs = this.el.query(this.autoTabSelector); for(var i = 0, len = tabs.length; i < len; i++){ var tab = tabs[i], title = tab.getAttribute('title'); tab.removeAttribute('title'); this.add({ title: title, contentEl: tab }); } }, initTab : function(item, index){ var before = this.strip.dom.childNodes[index], p = this.getTemplateArgs(item), el = before ? this.itemTpl.insertBefore(before, p) : this.itemTpl.append(this.strip, p), cls = 'x-tab-strip-over', tabEl = Ext.get(el); tabEl.hover(function(){ if(!item.disabled){ tabEl.addClass(cls); } }, function(){ tabEl.removeClass(cls); }); if(item.tabTip){ tabEl.child('span.x-tab-strip-text', true).qtip = item.tabTip; } item.tabEl = el; tabEl.select('a').on('click', function(e){ if(!e.getPageX()){ this.onStripMouseDown(e); } }, this, {preventDefault: true}); item.on({ scope: this, disable: this.onItemDisabled, enable: this.onItemEnabled, titlechange: this.onItemTitleChanged, iconchange: this.onItemIconChanged, beforeshow: this.onBeforeShowItem }); }, getTemplateArgs : function(item) { var cls = item.closable ? 'x-tab-strip-closable' : ''; if(item.disabled){ cls += ' x-item-disabled'; } if(item.iconCls){ cls += ' x-tab-with-icon'; } if(item.tabCls){ cls += ' ' + item.tabCls; } return { id: this.id + this.idDelimiter + item.getItemId(), text: item.title, cls: cls, iconCls: item.iconCls || '' }; }, onAdd : function(c){ Ext.TabPanel.superclass.onAdd.call(this, c); if(this.rendered){ var items = this.items; this.initTab(c, items.indexOf(c)); this.delegateUpdates(); } }, onBeforeAdd : function(item){ var existing = item.events ? (this.items.containsKey(item.getItemId()) ? item : null) : this.items.get(item); if(existing){ this.setActiveTab(item); return false; } Ext.TabPanel.superclass.onBeforeAdd.apply(this, arguments); var es = item.elements; item.elements = es ? es.replace(',header', '') : es; item.border = (item.border === true); }, onRemove : function(c){ var te = Ext.get(c.tabEl); if(te){ te.select('a').removeAllListeners(); Ext.destroy(te); } Ext.TabPanel.superclass.onRemove.call(this, c); this.stack.remove(c); delete c.tabEl; c.un('disable', this.onItemDisabled, this); c.un('enable', this.onItemEnabled, this); c.un('titlechange', this.onItemTitleChanged, this); c.un('iconchange', this.onItemIconChanged, this); c.un('beforeshow', this.onBeforeShowItem, this); if(c == this.activeTab){ var next = this.stack.next(); if(next){ this.setActiveTab(next); }else if(this.items.getCount() > 0){ this.setActiveTab(0); }else{ this.setActiveTab(null); } } if(!this.destroying){ this.delegateUpdates(); } }, onBeforeShowItem : function(item){ if(item != this.activeTab){ this.setActiveTab(item); return false; } }, onItemDisabled : function(item){ var el = this.getTabEl(item); if(el){ Ext.fly(el).addClass('x-item-disabled'); } this.stack.remove(item); }, onItemEnabled : function(item){ var el = this.getTabEl(item); if(el){ Ext.fly(el).removeClass('x-item-disabled'); } }, onItemTitleChanged : function(item){ var el = this.getTabEl(item); if(el){ Ext.fly(el).child('span.x-tab-strip-text', true).innerHTML = item.title; } }, onItemIconChanged : function(item, iconCls, oldCls){ var el = this.getTabEl(item); if(el){ el = Ext.get(el); el.child('span.x-tab-strip-text').replaceClass(oldCls, iconCls); el[Ext.isEmpty(iconCls) ? 'removeClass' : 'addClass']('x-tab-with-icon'); } }, getTabEl : function(item){ var c = this.getComponent(item); return c ? c.tabEl : null; }, onResize : function(){ Ext.TabPanel.superclass.onResize.apply(this, arguments); this.delegateUpdates(); }, beginUpdate : function(){ this.suspendUpdates = true; }, endUpdate : function(){ this.suspendUpdates = false; this.delegateUpdates(); }, hideTabStripItem : function(item){ item = this.getComponent(item); var el = this.getTabEl(item); if(el){ el.style.display = 'none'; this.delegateUpdates(); } this.stack.remove(item); }, unhideTabStripItem : function(item){ item = this.getComponent(item); var el = this.getTabEl(item); if(el){ el.style.display = ''; this.delegateUpdates(); } }, delegateUpdates : function(){ var rendered = this.rendered; if(this.suspendUpdates){ return; } if(this.resizeTabs && rendered){ this.autoSizeTabs(); } if(this.enableTabScroll && rendered){ this.autoScrollTabs(); } }, autoSizeTabs : function(){ var count = this.items.length, ce = this.tabPosition != 'bottom' ? 'header' : 'footer', ow = this[ce].dom.offsetWidth, aw = this[ce].dom.clientWidth; if(!this.resizeTabs || count < 1 || !aw){ return; } var each = Math.max(Math.min(Math.floor((aw-4) / count) - this.tabMargin, this.tabWidth), this.minTabWidth); this.lastTabWidth = each; var lis = this.strip.query('li:not(.x-tab-edge)'); for(var i = 0, len = lis.length; i < len; i++) { var li = lis[i], inner = Ext.fly(li).child('.x-tab-strip-inner', true), tw = li.offsetWidth, iw = inner.offsetWidth; inner.style.width = (each - (tw-iw)) + 'px'; } }, adjustBodyWidth : function(w){ if(this.header){ this.header.setWidth(w); } if(this.footer){ this.footer.setWidth(w); } return w; }, setActiveTab : function(item){ item = this.getComponent(item); if(this.fireEvent('beforetabchange', this, item, this.activeTab) === false){ return; } if(!this.rendered){ this.activeTab = item; return; } if(this.activeTab != item){ if(this.activeTab){ var oldEl = this.getTabEl(this.activeTab); if(oldEl){ Ext.fly(oldEl).removeClass('x-tab-strip-active'); } } this.activeTab = item; if(item){ var el = this.getTabEl(item); Ext.fly(el).addClass('x-tab-strip-active'); this.stack.add(item); this.layout.setActiveItem(item); this.delegateUpdates(); if(this.scrolling){ this.scrollToTab(item, this.animScroll); } } this.fireEvent('tabchange', this, item); } }, getActiveTab : function(){ return this.activeTab || null; }, getItem : function(item){ return this.getComponent(item); }, autoScrollTabs : function(){ this.pos = this.tabPosition=='bottom' ? this.footer : this.header; var count = this.items.length, ow = this.pos.dom.offsetWidth, tw = this.pos.dom.clientWidth, wrap = this.stripWrap, wd = wrap.dom, cw = wd.offsetWidth, pos = this.getScrollPos(), l = this.edge.getOffsetsTo(this.stripWrap)[0] + pos; if(!this.enableTabScroll || cw < 20){ return; } if(count == 0 || l <= tw){ wd.scrollLeft = 0; wrap.setWidth(tw); if(this.scrolling){ this.scrolling = false; this.pos.removeClass('x-tab-scrolling'); this.scrollLeft.hide(); this.scrollRight.hide(); if(Ext.isAir || Ext.isWebKit){ wd.style.marginLeft = ''; wd.style.marginRight = ''; } } }else{ if(!this.scrolling){ this.pos.addClass('x-tab-scrolling'); if(Ext.isAir || Ext.isWebKit){ wd.style.marginLeft = '18px'; wd.style.marginRight = '18px'; } } tw -= wrap.getMargins('lr'); wrap.setWidth(tw > 20 ? tw : 20); if(!this.scrolling){ if(!this.scrollLeft){ this.createScrollers(); }else{ this.scrollLeft.show(); this.scrollRight.show(); } } this.scrolling = true; if(pos > (l-tw)){ wd.scrollLeft = l-tw; }else{ this.scrollToTab(this.activeTab, false); } this.updateScrollButtons(); } }, createScrollers : function(){ this.pos.addClass('x-tab-scrolling-' + this.tabPosition); var h = this.stripWrap.dom.offsetHeight; var sl = this.pos.insertFirst({ cls:'x-tab-scroller-left' }); sl.setHeight(h); sl.addClassOnOver('x-tab-scroller-left-over'); this.leftRepeater = new Ext.util.ClickRepeater(sl, { interval : this.scrollRepeatInterval, handler: this.onScrollLeft, scope: this }); this.scrollLeft = sl; var sr = this.pos.insertFirst({ cls:'x-tab-scroller-right' }); sr.setHeight(h); sr.addClassOnOver('x-tab-scroller-right-over'); this.rightRepeater = new Ext.util.ClickRepeater(sr, { interval : this.scrollRepeatInterval, handler: this.onScrollRight, scope: this }); this.scrollRight = sr; }, getScrollWidth : function(){ return this.edge.getOffsetsTo(this.stripWrap)[0] + this.getScrollPos(); }, getScrollPos : function(){ return parseInt(this.stripWrap.dom.scrollLeft, 10) || 0; }, getScrollArea : function(){ return parseInt(this.stripWrap.dom.clientWidth, 10) || 0; }, getScrollAnim : function(){ return {duration:this.scrollDuration, callback: this.updateScrollButtons, scope: this}; }, getScrollIncrement : function(){ return this.scrollIncrement || (this.resizeTabs ? this.lastTabWidth+2 : 100); }, scrollToTab : function(item, animate){ if(!item){ return; } var el = this.getTabEl(item), pos = this.getScrollPos(), area = this.getScrollArea(), left = Ext.fly(el).getOffsetsTo(this.stripWrap)[0] + pos, right = left + el.offsetWidth; if(left < pos){ this.scrollTo(left, animate); }else if(right > (pos + area)){ this.scrollTo(right - area, animate); } }, scrollTo : function(pos, animate){ this.stripWrap.scrollTo('left', pos, animate ? this.getScrollAnim() : false); if(!animate){ this.updateScrollButtons(); } }, onWheel : function(e){ var d = e.getWheelDelta()*this.wheelIncrement*-1; e.stopEvent(); var pos = this.getScrollPos(), newpos = pos + d, sw = this.getScrollWidth()-this.getScrollArea(); var s = Math.max(0, Math.min(sw, newpos)); if(s != pos){ this.scrollTo(s, false); } }, onScrollRight : function(){ var sw = this.getScrollWidth()-this.getScrollArea(), pos = this.getScrollPos(), s = Math.min(sw, pos + this.getScrollIncrement()); if(s != pos){ this.scrollTo(s, this.animScroll); } }, onScrollLeft : function(){ var pos = this.getScrollPos(), s = Math.max(0, pos - this.getScrollIncrement()); if(s != pos){ this.scrollTo(s, this.animScroll); } }, updateScrollButtons : function(){ var pos = this.getScrollPos(); this.scrollLeft[pos === 0 ? 'addClass' : 'removeClass']('x-tab-scroller-left-disabled'); this.scrollRight[pos >= (this.getScrollWidth()-this.getScrollArea()) ? 'addClass' : 'removeClass']('x-tab-scroller-right-disabled'); }, beforeDestroy : function() { Ext.destroy(this.leftRepeater, this.rightRepeater); this.deleteMembers('strip', 'edge', 'scrollLeft', 'scrollRight', 'stripWrap'); this.activeTab = null; Ext.TabPanel.superclass.beforeDestroy.apply(this); } }); Ext.reg('tabpanel', Ext.TabPanel); Ext.TabPanel.prototype.activate = Ext.TabPanel.prototype.setActiveTab; Ext.TabPanel.AccessStack = function(){ var items = []; return { add : function(item){ items.push(item); if(items.length > 10){ items.shift(); } }, remove : function(item){ var s = []; for(var i = 0, len = items.length; i < len; i++) { if(items[i] != item){ s.push(items[i]); } } items = s; }, next : function(){ return items.pop(); } }; }; Ext.Button = Ext.extend(Ext.BoxComponent, { hidden : false, disabled : false, pressed : false, enableToggle : false, menuAlign : 'tl-bl?', type : 'button', menuClassTarget : 'tr:nth(2)', clickEvent : 'click', handleMouseEvents : true, tooltipType : 'qtip', buttonSelector : 'button:first-child', scale : 'small', iconAlign : 'left', arrowAlign : 'right', initComponent : function(){ if(this.menu){ if (Ext.isArray(this.menu)){ this.menu = { items: this.menu }; } if (Ext.isObject(this.menu)){ this.menu.ownerCt = this; } this.menu = Ext.menu.MenuMgr.get(this.menu); this.menu.ownerCt = undefined; } Ext.Button.superclass.initComponent.call(this); this.addEvents( 'click', 'toggle', 'mouseover', 'mouseout', 'menushow', 'menuhide', 'menutriggerover', 'menutriggerout' ); if(Ext.isString(this.toggleGroup)){ this.enableToggle = true; } }, getTemplateArgs : function(){ return [this.type, 'x-btn-' + this.scale + ' x-btn-icon-' + this.scale + '-' + this.iconAlign, this.getMenuClass(), this.cls, this.id]; }, setButtonClass : function(){ if(this.useSetClass){ if(!Ext.isEmpty(this.oldCls)){ this.el.removeClass([this.oldCls, 'x-btn-pressed']); } this.oldCls = (this.iconCls || this.icon) ? (this.text ? 'x-btn-text-icon' : 'x-btn-icon') : 'x-btn-noicon'; this.el.addClass([this.oldCls, this.pressed ? 'x-btn-pressed' : null]); } }, getMenuClass : function(){ return this.menu ? (this.arrowAlign != 'bottom' ? 'x-btn-arrow' : 'x-btn-arrow-bottom') : ''; }, onRender : function(ct, position){ if(!this.template){ if(!Ext.Button.buttonTemplate){ Ext.Button.buttonTemplate = new Ext.Template( '', '', '', '', '
      
      
      
    '); Ext.Button.buttonTemplate.compile(); } this.template = Ext.Button.buttonTemplate; } var btn, targs = this.getTemplateArgs(); if(position){ btn = this.template.insertBefore(position, targs, true); }else{ btn = this.template.append(ct, targs, true); } this.btnEl = btn.child(this.buttonSelector); this.mon(this.btnEl, { scope: this, focus: this.onFocus, blur: this.onBlur }); this.initButtonEl(btn, this.btnEl); Ext.ButtonToggleMgr.register(this); }, initButtonEl : function(btn, btnEl){ this.el = btn; this.setIcon(this.icon); this.setText(this.text); this.setIconClass(this.iconCls); if(Ext.isDefined(this.tabIndex)){ btnEl.dom.tabIndex = this.tabIndex; } if(this.tooltip){ this.setTooltip(this.tooltip, true); } if(this.handleMouseEvents){ this.mon(btn, { scope: this, mouseover: this.onMouseOver, mousedown: this.onMouseDown }); } if(this.menu){ this.mon(this.menu, { scope: this, show: this.onMenuShow, hide: this.onMenuHide }); } if(this.repeat){ var repeater = new Ext.util.ClickRepeater(btn, Ext.isObject(this.repeat) ? this.repeat : {}); this.mon(repeater, 'click', this.onRepeatClick, this); }else{ this.mon(btn, this.clickEvent, this.onClick, this); } }, afterRender : function(){ Ext.Button.superclass.afterRender.call(this); this.useSetClass = true; this.setButtonClass(); this.doc = Ext.getDoc(); this.doAutoWidth(); }, setIconClass : function(cls){ this.iconCls = cls; if(this.el){ this.btnEl.dom.className = ''; this.btnEl.addClass(['x-btn-text', cls || '']); this.setButtonClass(); } return this; }, setTooltip : function(tooltip, initial){ if(this.rendered){ if(!initial){ this.clearTip(); } if(Ext.isObject(tooltip)){ Ext.QuickTips.register(Ext.apply({ target: this.btnEl.id }, tooltip)); this.tooltip = tooltip; }else{ this.btnEl.dom[this.tooltipType] = tooltip; } }else{ this.tooltip = tooltip; } return this; }, clearTip : function(){ if(Ext.isObject(this.tooltip)){ Ext.QuickTips.unregister(this.btnEl); } }, beforeDestroy : function(){ if(this.rendered){ this.clearTip(); } if(this.menu && this.destroyMenu !== false) { Ext.destroy(this.btnEl, this.menu); } Ext.destroy(this.repeater); }, onDestroy : function(){ if(this.rendered){ this.doc.un('mouseover', this.monitorMouseOver, this); this.doc.un('mouseup', this.onMouseUp, this); delete this.doc; delete this.btnEl; Ext.ButtonToggleMgr.unregister(this); } Ext.Button.superclass.onDestroy.call(this); }, doAutoWidth : function(){ if(this.autoWidth !== false && this.el && this.text && this.width === undefined){ this.el.setWidth('auto'); if(Ext.isIE7 && Ext.isStrict){ var ib = this.btnEl; if(ib && ib.getWidth() > 20){ ib.clip(); ib.setWidth(Ext.util.TextMetrics.measure(ib, this.text).width+ib.getFrameWidth('lr')); } } if(this.minWidth){ if(this.el.getWidth() < this.minWidth){ this.el.setWidth(this.minWidth); } } } }, setHandler : function(handler, scope){ this.handler = handler; this.scope = scope; return this; }, setText : function(text){ this.text = text; if(this.el){ this.btnEl.update(text || ' '); this.setButtonClass(); } this.doAutoWidth(); return this; }, setIcon : function(icon){ this.icon = icon; if(this.el){ this.btnEl.setStyle('background-image', icon ? 'url(' + icon + ')' : ''); this.setButtonClass(); } return this; }, getText : function(){ return this.text; }, toggle : function(state, suppressEvent){ state = state === undefined ? !this.pressed : !!state; if(state != this.pressed){ if(this.rendered){ this.el[state ? 'addClass' : 'removeClass']('x-btn-pressed'); } this.pressed = state; if(!suppressEvent){ this.fireEvent('toggle', this, state); if(this.toggleHandler){ this.toggleHandler.call(this.scope || this, this, state); } } } return this; }, onDisable : function(){ this.onDisableChange(true); }, onEnable : function(){ this.onDisableChange(false); }, onDisableChange : function(disabled){ if(this.el){ if(!Ext.isIE6 || !this.text){ this.el[disabled ? 'addClass' : 'removeClass'](this.disabledClass); } this.el.dom.disabled = disabled; } this.disabled = disabled; }, showMenu : function(){ if(this.rendered && this.menu){ if(this.tooltip){ Ext.QuickTips.getQuickTip().cancelShow(this.btnEl); } if(this.menu.isVisible()){ this.menu.hide(); } this.menu.ownerCt = this; this.menu.show(this.el, this.menuAlign); } return this; }, hideMenu : function(){ if(this.hasVisibleMenu()){ this.menu.hide(); } return this; }, hasVisibleMenu : function(){ return this.menu && this.menu.ownerCt == this && this.menu.isVisible(); }, onRepeatClick : function(repeat, e){ this.onClick(e); }, onClick : function(e){ if(e){ e.preventDefault(); } if(e.button !== 0){ return; } if(!this.disabled){ this.doToggle(); if(this.menu && !this.hasVisibleMenu() && !this.ignoreNextClick){ this.showMenu(); } this.fireEvent('click', this, e); if(this.handler){ this.handler.call(this.scope || this, this, e); } } }, doToggle: function(){ if (this.enableToggle && (this.allowDepress !== false || !this.pressed)) { this.toggle(); } }, isMenuTriggerOver : function(e, internal){ return this.menu && !internal; }, isMenuTriggerOut : function(e, internal){ return this.menu && !internal; }, onMouseOver : function(e){ if(!this.disabled){ var internal = e.within(this.el, true); if(!internal){ this.el.addClass('x-btn-over'); if(!this.monitoringMouseOver){ this.doc.on('mouseover', this.monitorMouseOver, this); this.monitoringMouseOver = true; } this.fireEvent('mouseover', this, e); } if(this.isMenuTriggerOver(e, internal)){ this.fireEvent('menutriggerover', this, this.menu, e); } } }, monitorMouseOver : function(e){ if(e.target != this.el.dom && !e.within(this.el)){ if(this.monitoringMouseOver){ this.doc.un('mouseover', this.monitorMouseOver, this); this.monitoringMouseOver = false; } this.onMouseOut(e); } }, onMouseOut : function(e){ var internal = e.within(this.el) && e.target != this.el.dom; this.el.removeClass('x-btn-over'); this.fireEvent('mouseout', this, e); if(this.isMenuTriggerOut(e, internal)){ this.fireEvent('menutriggerout', this, this.menu, e); } }, focus : function() { this.btnEl.focus(); }, blur : function() { this.btnEl.blur(); }, onFocus : function(e){ if(!this.disabled){ this.el.addClass('x-btn-focus'); } }, onBlur : function(e){ this.el.removeClass('x-btn-focus'); }, getClickEl : function(e, isUp){ return this.el; }, onMouseDown : function(e){ if(!this.disabled && e.button === 0){ this.getClickEl(e).addClass('x-btn-click'); this.doc.on('mouseup', this.onMouseUp, this); } }, onMouseUp : function(e){ if(e.button === 0){ this.getClickEl(e, true).removeClass('x-btn-click'); this.doc.un('mouseup', this.onMouseUp, this); } }, onMenuShow : function(e){ if(this.menu.ownerCt == this){ this.menu.ownerCt = this; this.ignoreNextClick = 0; this.el.addClass('x-btn-menu-active'); this.fireEvent('menushow', this, this.menu); } }, onMenuHide : function(e){ if(this.menu.ownerCt == this){ this.el.removeClass('x-btn-menu-active'); this.ignoreNextClick = this.restoreClick.defer(250, this); this.fireEvent('menuhide', this, this.menu); delete this.menu.ownerCt; } }, restoreClick : function(){ this.ignoreNextClick = 0; } }); Ext.reg('button', Ext.Button); Ext.ButtonToggleMgr = function(){ var groups = {}; function toggleGroup(btn, state){ if(state){ var g = groups[btn.toggleGroup]; for(var i = 0, l = g.length; i < l; i++){ if(g[i] != btn){ g[i].toggle(false); } } } } return { register : function(btn){ if(!btn.toggleGroup){ return; } var g = groups[btn.toggleGroup]; if(!g){ g = groups[btn.toggleGroup] = []; } g.push(btn); btn.on('toggle', toggleGroup); }, unregister : function(btn){ if(!btn.toggleGroup){ return; } var g = groups[btn.toggleGroup]; if(g){ g.remove(btn); btn.un('toggle', toggleGroup); } }, getPressed : function(group){ var g = groups[group]; if(g){ for(var i = 0, len = g.length; i < len; i++){ if(g[i].pressed === true){ return g[i]; } } } return null; } }; }(); Ext.SplitButton = Ext.extend(Ext.Button, { arrowSelector : 'em', split: true, initComponent : function(){ Ext.SplitButton.superclass.initComponent.call(this); this.addEvents("arrowclick"); }, onRender : function(){ Ext.SplitButton.superclass.onRender.apply(this, arguments); if(this.arrowTooltip){ this.el.child(this.arrowSelector).dom[this.tooltipType] = this.arrowTooltip; } }, setArrowHandler : function(handler, scope){ this.arrowHandler = handler; this.scope = scope; }, getMenuClass : function(){ return 'x-btn-split' + (this.arrowAlign == 'bottom' ? '-bottom' : ''); }, isClickOnArrow : function(e){ if (this.arrowAlign != 'bottom') { var visBtn = this.el.child('em.x-btn-split'); var right = visBtn.getRegion().right - visBtn.getPadding('r'); return e.getPageX() > right; } else { return e.getPageY() > this.btnEl.getRegion().bottom; } }, onClick : function(e, t){ e.preventDefault(); if(!this.disabled){ if(this.isClickOnArrow(e)){ if(this.menu && !this.menu.isVisible() && !this.ignoreNextClick){ this.showMenu(); } this.fireEvent("arrowclick", this, e); if(this.arrowHandler){ this.arrowHandler.call(this.scope || this, this, e); } }else{ this.doToggle(); this.fireEvent("click", this, e); if(this.handler){ this.handler.call(this.scope || this, this, e); } } } }, isMenuTriggerOver : function(e){ return this.menu && e.target.tagName == this.arrowSelector; }, isMenuTriggerOut : function(e, internal){ return this.menu && e.target.tagName != this.arrowSelector; } }); Ext.reg('splitbutton', Ext.SplitButton); Ext.CycleButton = Ext.extend(Ext.SplitButton, { getItemText : function(item){ if(item && this.showText === true){ var text = ''; if(this.prependText){ text += this.prependText; } text += item.text; return text; } return undefined; }, setActiveItem : function(item, suppressEvent){ if(!Ext.isObject(item)){ item = this.menu.getComponent(item); } if(item){ if(!this.rendered){ this.text = this.getItemText(item); this.iconCls = item.iconCls; }else{ var t = this.getItemText(item); if(t){ this.setText(t); } this.setIconClass(item.iconCls); } this.activeItem = item; if(!item.checked){ item.setChecked(true, suppressEvent); } if(this.forceIcon){ this.setIconClass(this.forceIcon); } if(!suppressEvent){ this.fireEvent('change', this, item); } } }, getActiveItem : function(){ return this.activeItem; }, initComponent : function(){ this.addEvents( "change" ); if(this.changeHandler){ this.on('change', this.changeHandler, this.scope||this); delete this.changeHandler; } this.itemCount = this.items.length; this.menu = {cls:'x-cycle-menu', items:[]}; var checked = 0; Ext.each(this.items, function(item, i){ Ext.apply(item, { group: item.group || this.id, itemIndex: i, checkHandler: this.checkHandler, scope: this, checked: item.checked || false }); this.menu.items.push(item); if(item.checked){ checked = i; } }, this); Ext.CycleButton.superclass.initComponent.call(this); this.on('click', this.toggleSelected, this); this.setActiveItem(checked, true); }, checkHandler : function(item, pressed){ if(pressed){ this.setActiveItem(item); } }, toggleSelected : function(){ var m = this.menu; m.render(); if(!m.hasLayout){ m.doLayout(); } var nextIdx, checkItem; for (var i = 1; i < this.itemCount; i++) { nextIdx = (this.activeItem.itemIndex + i) % this.itemCount; checkItem = m.items.itemAt(nextIdx); if (!checkItem.disabled) { checkItem.setChecked(true); break; } } } }); Ext.reg('cycle', Ext.CycleButton); Ext.Toolbar = function(config){ if(Ext.isArray(config)){ config = {items: config, layout: 'toolbar'}; } else { config = Ext.apply({ layout: 'toolbar' }, config); if(config.buttons) { config.items = config.buttons; } } Ext.Toolbar.superclass.constructor.call(this, config); }; (function(){ var T = Ext.Toolbar; Ext.extend(T, Ext.Container, { defaultType: 'button', enableOverflow : false, trackMenus : true, internalDefaults: {removeMode: 'container', hideParent: true}, toolbarCls: 'x-toolbar', initComponent : function(){ T.superclass.initComponent.call(this); this.addEvents('overflowchange'); }, onRender : function(ct, position){ if(!this.el){ if(!this.autoCreate){ this.autoCreate = { cls: this.toolbarCls + ' x-small-editor' }; } this.el = ct.createChild(Ext.apply({ id: this.id },this.autoCreate), position); Ext.Toolbar.superclass.onRender.apply(this, arguments); } }, lookupComponent : function(c){ if(Ext.isString(c)){ if(c == '-'){ c = new T.Separator(); }else if(c == ' '){ c = new T.Spacer(); }else if(c == '->'){ c = new T.Fill(); }else{ c = new T.TextItem(c); } this.applyDefaults(c); }else{ if(c.isFormField || c.render){ c = this.createComponent(c); }else if(c.tag){ c = new T.Item({autoEl: c}); }else if(c.tagName){ c = new T.Item({el:c}); }else if(Ext.isObject(c)){ c = c.xtype ? this.createComponent(c) : this.constructButton(c); } } return c; }, applyDefaults : function(c){ if(!Ext.isString(c)){ c = Ext.Toolbar.superclass.applyDefaults.call(this, c); var d = this.internalDefaults; if(c.events){ Ext.applyIf(c.initialConfig, d); Ext.apply(c, d); }else{ Ext.applyIf(c, d); } } return c; }, addSeparator : function(){ return this.add(new T.Separator()); }, addSpacer : function(){ return this.add(new T.Spacer()); }, addFill : function(){ this.add(new T.Fill()); }, addElement : function(el){ return this.addItem(new T.Item({el:el})); }, addItem : function(item){ return this.add.apply(this, arguments); }, addButton : function(config){ if(Ext.isArray(config)){ var buttons = []; for(var i = 0, len = config.length; i < len; i++) { buttons.push(this.addButton(config[i])); } return buttons; } return this.add(this.constructButton(config)); }, addText : function(text){ return this.addItem(new T.TextItem(text)); }, addDom : function(config){ return this.add(new T.Item({autoEl: config})); }, addField : function(field){ return this.add(field); }, insertButton : function(index, item){ if(Ext.isArray(item)){ var buttons = []; for(var i = 0, len = item.length; i < len; i++) { buttons.push(this.insertButton(index + i, item[i])); } return buttons; } return Ext.Toolbar.superclass.insert.call(this, index, item); }, trackMenu : function(item, remove){ if(this.trackMenus && item.menu){ var method = remove ? 'mun' : 'mon'; this[method](item, 'menutriggerover', this.onButtonTriggerOver, this); this[method](item, 'menushow', this.onButtonMenuShow, this); this[method](item, 'menuhide', this.onButtonMenuHide, this); } }, constructButton : function(item){ var b = item.events ? item : this.createComponent(item, item.split ? 'splitbutton' : this.defaultType); return b; }, onAdd : function(c){ Ext.Toolbar.superclass.onAdd.call(this); this.trackMenu(c); if(this.disabled){ c.disable(); } }, onRemove : function(c){ Ext.Toolbar.superclass.onRemove.call(this); if (c == this.activeMenuBtn) { delete this.activeMenuBtn; } this.trackMenu(c, true); }, onDisable : function(){ this.items.each(function(item){ if(item.disable){ item.disable(); } }); }, onEnable : function(){ this.items.each(function(item){ if(item.enable){ item.enable(); } }); }, onButtonTriggerOver : function(btn){ if(this.activeMenuBtn && this.activeMenuBtn != btn){ this.activeMenuBtn.hideMenu(); btn.showMenu(); this.activeMenuBtn = btn; } }, onButtonMenuShow : function(btn){ this.activeMenuBtn = btn; }, onButtonMenuHide : function(btn){ delete this.activeMenuBtn; } }); Ext.reg('toolbar', Ext.Toolbar); T.Item = Ext.extend(Ext.BoxComponent, { hideParent: true, enable:Ext.emptyFn, disable:Ext.emptyFn, focus:Ext.emptyFn }); Ext.reg('tbitem', T.Item); T.Separator = Ext.extend(T.Item, { onRender : function(ct, position){ this.el = ct.createChild({tag:'span', cls:'xtb-sep'}, position); } }); Ext.reg('tbseparator', T.Separator); T.Spacer = Ext.extend(T.Item, { onRender : function(ct, position){ this.el = ct.createChild({tag:'div', cls:'xtb-spacer', style: this.width?'width:'+this.width+'px':''}, position); } }); Ext.reg('tbspacer', T.Spacer); T.Fill = Ext.extend(T.Item, { render : Ext.emptyFn, isFill : true }); Ext.reg('tbfill', T.Fill); T.TextItem = Ext.extend(T.Item, { constructor: function(config){ T.TextItem.superclass.constructor.call(this, Ext.isString(config) ? {text: config} : config); }, onRender : function(ct, position) { this.autoEl = {cls: 'xtb-text', html: this.text || ''}; T.TextItem.superclass.onRender.call(this, ct, position); }, setText : function(t) { if(this.rendered){ this.el.update(t); }else{ this.text = t; } } }); Ext.reg('tbtext', T.TextItem); T.Button = Ext.extend(Ext.Button, {}); T.SplitButton = Ext.extend(Ext.SplitButton, {}); Ext.reg('tbbutton', T.Button); Ext.reg('tbsplit', T.SplitButton); })(); Ext.ButtonGroup = Ext.extend(Ext.Panel, { baseCls: 'x-btn-group', layout:'table', defaultType: 'button', frame: true, internalDefaults: {removeMode: 'container', hideParent: true}, initComponent : function(){ this.layoutConfig = this.layoutConfig || {}; Ext.applyIf(this.layoutConfig, { columns : this.columns }); if(!this.title){ this.addClass('x-btn-group-notitle'); } this.on('afterlayout', this.onAfterLayout, this); Ext.ButtonGroup.superclass.initComponent.call(this); }, applyDefaults : function(c){ c = Ext.ButtonGroup.superclass.applyDefaults.call(this, c); var d = this.internalDefaults; if(c.events){ Ext.applyIf(c.initialConfig, d); Ext.apply(c, d); }else{ Ext.applyIf(c, d); } return c; }, onAfterLayout : function(){ var bodyWidth = this.body.getFrameWidth('lr') + this.body.dom.firstChild.offsetWidth; this.body.setWidth(bodyWidth); this.el.setWidth(bodyWidth + this.getFrameWidth()); } }); Ext.reg('buttongroup', Ext.ButtonGroup); (function() { var T = Ext.Toolbar; Ext.PagingToolbar = Ext.extend(Ext.Toolbar, { pageSize : 20, displayMsg : 'Displaying {0} - {1} of {2}', emptyMsg : 'No data to display', beforePageText : 'Page', afterPageText : 'of {0}', firstText : 'First Page', prevText : 'Previous Page', nextText : 'Next Page', lastText : 'Last Page', refreshText : 'Refresh', initComponent : function(){ var pagingItems = [this.first = new T.Button({ tooltip: this.firstText, overflowText: this.firstText, iconCls: 'x-tbar-page-first', disabled: true, handler: this.moveFirst, scope: this }), this.prev = new T.Button({ tooltip: this.prevText, overflowText: this.prevText, iconCls: 'x-tbar-page-prev', disabled: true, handler: this.movePrevious, scope: this }), '-', this.beforePageText, this.inputItem = new Ext.form.NumberField({ cls: 'x-tbar-page-number', allowDecimals: false, allowNegative: false, enableKeyEvents: true, selectOnFocus: true, submitValue: false, listeners: { scope: this, keydown: this.onPagingKeyDown, blur: this.onPagingBlur } }), this.afterTextItem = new T.TextItem({ text: String.format(this.afterPageText, 1) }), '-', this.next = new T.Button({ tooltip: this.nextText, overflowText: this.nextText, iconCls: 'x-tbar-page-next', disabled: true, handler: this.moveNext, scope: this }), this.last = new T.Button({ tooltip: this.lastText, overflowText: this.lastText, iconCls: 'x-tbar-page-last', disabled: true, handler: this.moveLast, scope: this }), '-', this.refresh = new T.Button({ tooltip: this.refreshText, overflowText: this.refreshText, iconCls: 'x-tbar-loading', handler: this.doRefresh, scope: this })]; var userItems = this.items || this.buttons || []; if (this.prependButtons) { this.items = userItems.concat(pagingItems); }else{ this.items = pagingItems.concat(userItems); } delete this.buttons; if(this.displayInfo){ this.items.push('->'); this.items.push(this.displayItem = new T.TextItem({})); } Ext.PagingToolbar.superclass.initComponent.call(this); this.addEvents( 'change', 'beforechange' ); this.on('afterlayout', this.onFirstLayout, this, {single: true}); this.cursor = 0; this.bindStore(this.store, true); }, onFirstLayout : function(){ if(this.dsLoaded){ this.onLoad.apply(this, this.dsLoaded); } }, updateInfo : function(){ if(this.displayItem){ var count = this.store.getCount(); var msg = count == 0 ? this.emptyMsg : String.format( this.displayMsg, this.cursor+1, this.cursor+count, this.store.getTotalCount() ); this.displayItem.setText(msg); } }, onLoad : function(store, r, o){ if(!this.rendered){ this.dsLoaded = [store, r, o]; return; } var p = this.getParams(); this.cursor = (o.params && o.params[p.start]) ? o.params[p.start] : 0; var d = this.getPageData(), ap = d.activePage, ps = d.pages; this.afterTextItem.setText(String.format(this.afterPageText, d.pages)); this.inputItem.setValue(ap); this.first.setDisabled(ap == 1); this.prev.setDisabled(ap == 1); this.next.setDisabled(ap == ps); this.last.setDisabled(ap == ps); this.refresh.enable(); this.updateInfo(); this.fireEvent('change', this, d); }, getPageData : function(){ var total = this.store.getTotalCount(); return { total : total, activePage : Math.ceil((this.cursor+this.pageSize)/this.pageSize), pages : total < this.pageSize ? 1 : Math.ceil(total/this.pageSize) }; }, changePage : function(page){ this.doLoad(((page-1) * this.pageSize).constrain(0, this.store.getTotalCount())); }, onLoadError : function(){ if(!this.rendered){ return; } this.refresh.enable(); }, readPage : function(d){ var v = this.inputItem.getValue(), pageNum; if (!v || isNaN(pageNum = parseInt(v, 10))) { this.inputItem.setValue(d.activePage); return false; } return pageNum; }, onPagingFocus : function(){ this.inputItem.select(); }, onPagingBlur : function(e){ this.inputItem.setValue(this.getPageData().activePage); }, onPagingKeyDown : function(field, e){ var k = e.getKey(), d = this.getPageData(), pageNum; if (k == e.RETURN) { e.stopEvent(); pageNum = this.readPage(d); if(pageNum !== false){ pageNum = Math.min(Math.max(1, pageNum), d.pages) - 1; this.doLoad(pageNum * this.pageSize); } }else if (k == e.HOME || k == e.END){ e.stopEvent(); pageNum = k == e.HOME ? 1 : d.pages; field.setValue(pageNum); }else if (k == e.UP || k == e.PAGEUP || k == e.DOWN || k == e.PAGEDOWN){ e.stopEvent(); if((pageNum = this.readPage(d))){ var increment = e.shiftKey ? 10 : 1; if(k == e.DOWN || k == e.PAGEDOWN){ increment *= -1; } pageNum += increment; if(pageNum >= 1 & pageNum <= d.pages){ field.setValue(pageNum); } } } }, getParams : function(){ return this.paramNames || this.store.paramNames; }, beforeLoad : function(){ if(this.rendered && this.refresh){ this.refresh.disable(); } }, doLoad : function(start){ var o = {}, pn = this.getParams(); o[pn.start] = start; o[pn.limit] = this.pageSize; if(this.fireEvent('beforechange', this, o) !== false){ this.store.load({params:o}); } }, moveFirst : function(){ this.doLoad(0); }, movePrevious : function(){ this.doLoad(Math.max(0, this.cursor-this.pageSize)); }, moveNext : function(){ this.doLoad(this.cursor+this.pageSize); }, moveLast : function(){ var total = this.store.getTotalCount(), extra = total % this.pageSize; this.doLoad(extra ? (total - extra) : total - this.pageSize); }, doRefresh : function(){ this.doLoad(this.cursor); }, bindStore : function(store, initial){ var doLoad; if(!initial && this.store){ if(store !== this.store && this.store.autoDestroy){ this.store.destroy(); }else{ this.store.un('beforeload', this.beforeLoad, this); this.store.un('load', this.onLoad, this); this.store.un('exception', this.onLoadError, this); } if(!store){ this.store = null; } } if(store){ store = Ext.StoreMgr.lookup(store); store.on({ scope: this, beforeload: this.beforeLoad, load: this.onLoad, exception: this.onLoadError }); doLoad = true; } this.store = store; if(doLoad){ this.onLoad(store, null, {}); } }, unbind : function(store){ this.bindStore(null); }, bind : function(store){ this.bindStore(store); }, onDestroy : function(){ this.bindStore(null); Ext.PagingToolbar.superclass.onDestroy.call(this); } }); })(); Ext.reg('paging', Ext.PagingToolbar); Ext.History = (function () { var iframe, hiddenField; var ready = false; var currentToken; function getHash() { var href = location.href, i = href.indexOf("#"), hash = i >= 0 ? href.substr(i + 1) : null; if (Ext.isGecko) { hash = decodeURIComponent(hash); } return hash; } function doSave() { hiddenField.value = currentToken; } function handleStateChange(token) { currentToken = token; Ext.History.fireEvent('change', token); } function updateIFrame (token) { var html = ['
    ',Ext.util.Format.htmlEncode(token),'
    '].join(''); try { var doc = iframe.contentWindow.document; doc.open(); doc.write(html); doc.close(); return true; } catch (e) { return false; } } function checkIFrame() { if (!iframe.contentWindow || !iframe.contentWindow.document) { setTimeout(checkIFrame, 10); return; } var doc = iframe.contentWindow.document; var elem = doc.getElementById("state"); var token = elem ? elem.innerText : null; var hash = getHash(); setInterval(function () { doc = iframe.contentWindow.document; elem = doc.getElementById("state"); var newtoken = elem ? elem.innerText : null; var newHash = getHash(); if (newtoken !== token) { token = newtoken; handleStateChange(token); location.hash = token; hash = token; doSave(); } else if (newHash !== hash) { hash = newHash; updateIFrame(newHash); } }, 50); ready = true; Ext.History.fireEvent('ready', Ext.History); } function startUp() { currentToken = hiddenField.value ? hiddenField.value : getHash(); if (Ext.isIE) { checkIFrame(); } else { var hash = getHash(); setInterval(function () { var newHash = getHash(); if (newHash !== hash) { hash = newHash; handleStateChange(hash); doSave(); } }, 50); ready = true; Ext.History.fireEvent('ready', Ext.History); } } return { fieldId: 'x-history-field', iframeId: 'x-history-frame', events:{}, init: function (onReady, scope) { if(ready) { Ext.callback(onReady, scope, [this]); return; } if(!Ext.isReady){ Ext.onReady(function(){ Ext.History.init(onReady, scope); }); return; } hiddenField = Ext.getDom(Ext.History.fieldId); if (Ext.isIE) { iframe = Ext.getDom(Ext.History.iframeId); } this.addEvents( 'ready', 'change' ); if(onReady){ this.on('ready', onReady, scope, {single:true}); } startUp(); }, add: function (token, preventDup) { if(preventDup !== false){ if(this.getToken() == token){ return true; } } if (Ext.isIE) { return updateIFrame(token); } else { location.hash = token; return true; } }, back: function(){ history.go(-1); }, forward: function(){ history.go(1); }, getToken: function() { return ready ? currentToken : getHash(); } }; })(); Ext.apply(Ext.History, new Ext.util.Observable()); Ext.Tip = Ext.extend(Ext.Panel, { minWidth : 40, maxWidth : 300, shadow : "sides", defaultAlign : "tl-bl?", autoRender: true, quickShowInterval : 250, frame:true, hidden:true, baseCls: 'x-tip', floating:{shadow:true,shim:true,useDisplay:true,constrain:false}, autoHeight:true, closeAction: 'hide', initComponent : function(){ Ext.Tip.superclass.initComponent.call(this); if(this.closable && !this.title){ this.elements += ',header'; } }, afterRender : function(){ Ext.Tip.superclass.afterRender.call(this); if(this.closable){ this.addTool({ id: 'close', handler: this[this.closeAction], scope: this }); } }, showAt : function(xy){ Ext.Tip.superclass.show.call(this); if(this.measureWidth !== false && (!this.initialConfig || typeof this.initialConfig.width != 'number')){ this.doAutoWidth(); } if(this.constrainPosition){ xy = this.el.adjustForConstraints(xy); } this.setPagePosition(xy[0], xy[1]); }, doAutoWidth : function(adjust){ adjust = adjust || 0; var bw = this.body.getTextWidth(); if(this.title){ bw = Math.max(bw, this.header.child('span').getTextWidth(this.title)); } bw += this.getFrameWidth() + (this.closable ? 20 : 0) + this.body.getPadding("lr") + adjust; this.setWidth(bw.constrain(this.minWidth, this.maxWidth)); if(Ext.isIE7 && !this.repainted){ this.el.repaint(); this.repainted = true; } }, showBy : function(el, pos){ if(!this.rendered){ this.render(Ext.getBody()); } this.showAt(this.el.getAlignToXY(el, pos || this.defaultAlign)); }, initDraggable : function(){ this.dd = new Ext.Tip.DD(this, typeof this.draggable == 'boolean' ? null : this.draggable); this.header.addClass('x-tip-draggable'); } }); Ext.reg('tip', Ext.Tip); Ext.Tip.DD = function(tip, config){ Ext.apply(this, config); this.tip = tip; Ext.Tip.DD.superclass.constructor.call(this, tip.el.id, 'WindowDD-'+tip.id); this.setHandleElId(tip.header.id); this.scroll = false; }; Ext.extend(Ext.Tip.DD, Ext.dd.DD, { moveOnly:true, scroll:false, headerOffsets:[100, 25], startDrag : function(){ this.tip.el.disableShadow(); }, endDrag : function(e){ this.tip.el.enableShadow(true); } }); Ext.ToolTip = Ext.extend(Ext.Tip, { showDelay : 500, hideDelay : 200, dismissDelay : 5000, trackMouse : false, anchorToTarget : true, anchorOffset : 0, targetCounter : 0, constrainPosition : false, initComponent : function(){ Ext.ToolTip.superclass.initComponent.call(this); this.lastActive = new Date(); this.initTarget(this.target); this.origAnchor = this.anchor; }, onRender : function(ct, position){ Ext.ToolTip.superclass.onRender.call(this, ct, position); this.anchorCls = 'x-tip-anchor-' + this.getAnchorPosition(); this.anchorEl = this.el.createChild({ cls: 'x-tip-anchor ' + this.anchorCls }); }, afterRender : function(){ Ext.ToolTip.superclass.afterRender.call(this); this.anchorEl.setStyle('z-index', this.el.getZIndex() + 1).setVisibilityMode(Ext.Element.DISPLAY); }, initTarget : function(target){ var t; if((t = Ext.get(target))){ if(this.target){ var tg = Ext.get(this.target); this.mun(tg, 'mouseover', this.onTargetOver, this); this.mun(tg, 'mouseout', this.onTargetOut, this); this.mun(tg, 'mousemove', this.onMouseMove, this); } this.mon(t, { mouseover: this.onTargetOver, mouseout: this.onTargetOut, mousemove: this.onMouseMove, scope: this }); this.target = t; } if(this.anchor){ this.anchorTarget = this.target; } }, onMouseMove : function(e){ var t = this.delegate ? e.getTarget(this.delegate) : this.triggerElement = true; if (t) { this.targetXY = e.getXY(); if (t === this.triggerElement) { if(!this.hidden && this.trackMouse){ this.setPagePosition(this.getTargetXY()); } } else { this.hide(); this.lastActive = new Date(0); this.onTargetOver(e); } } else if (!this.closable && this.isVisible()) { this.hide(); } }, getTargetXY : function(){ if(this.delegate){ this.anchorTarget = this.triggerElement; } if(this.anchor){ this.targetCounter++; var offsets = this.getOffsets(), xy = (this.anchorToTarget && !this.trackMouse) ? this.el.getAlignToXY(this.anchorTarget, this.getAnchorAlign()) : this.targetXY, dw = Ext.lib.Dom.getViewWidth() - 5, dh = Ext.lib.Dom.getViewHeight() - 5, de = document.documentElement, bd = document.body, scrollX = (de.scrollLeft || bd.scrollLeft || 0) + 5, scrollY = (de.scrollTop || bd.scrollTop || 0) + 5, axy = [xy[0] + offsets[0], xy[1] + offsets[1]], sz = this.getSize(); this.anchorEl.removeClass(this.anchorCls); if(this.targetCounter < 2){ if(axy[0] < scrollX){ if(this.anchorToTarget){ this.defaultAlign = 'l-r'; if(this.mouseOffset){this.mouseOffset[0] *= -1;} } this.anchor = 'left'; return this.getTargetXY(); } if(axy[0]+sz.width > dw){ if(this.anchorToTarget){ this.defaultAlign = 'r-l'; if(this.mouseOffset){this.mouseOffset[0] *= -1;} } this.anchor = 'right'; return this.getTargetXY(); } if(axy[1] < scrollY){ if(this.anchorToTarget){ this.defaultAlign = 't-b'; if(this.mouseOffset){this.mouseOffset[1] *= -1;} } this.anchor = 'top'; return this.getTargetXY(); } if(axy[1]+sz.height > dh){ if(this.anchorToTarget){ this.defaultAlign = 'b-t'; if(this.mouseOffset){this.mouseOffset[1] *= -1;} } this.anchor = 'bottom'; return this.getTargetXY(); } } this.anchorCls = 'x-tip-anchor-'+this.getAnchorPosition(); this.anchorEl.addClass(this.anchorCls); this.targetCounter = 0; return axy; }else{ var mouseOffset = this.getMouseOffset(); return [this.targetXY[0]+mouseOffset[0], this.targetXY[1]+mouseOffset[1]]; } }, getMouseOffset : function(){ var offset = this.anchor ? [0,0] : [15,18]; if(this.mouseOffset){ offset[0] += this.mouseOffset[0]; offset[1] += this.mouseOffset[1]; } return offset; }, getAnchorPosition : function(){ if(this.anchor){ this.tipAnchor = this.anchor.charAt(0); }else{ var m = this.defaultAlign.match(/^([a-z]+)-([a-z]+)(\?)?$/); if(!m){ throw 'AnchorTip.defaultAlign is invalid'; } this.tipAnchor = m[1].charAt(0); } switch(this.tipAnchor){ case 't': return 'top'; case 'b': return 'bottom'; case 'r': return 'right'; } return 'left'; }, getAnchorAlign : function(){ switch(this.anchor){ case 'top' : return 'tl-bl'; case 'left' : return 'tl-tr'; case 'right': return 'tr-tl'; default : return 'bl-tl'; } }, getOffsets : function(){ var offsets, ap = this.getAnchorPosition().charAt(0); if(this.anchorToTarget && !this.trackMouse){ switch(ap){ case 't': offsets = [0, 9]; break; case 'b': offsets = [0, -13]; break; case 'r': offsets = [-13, 0]; break; default: offsets = [9, 0]; break; } }else{ switch(ap){ case 't': offsets = [-15-this.anchorOffset, 30]; break; case 'b': offsets = [-19-this.anchorOffset, -13-this.el.dom.offsetHeight]; break; case 'r': offsets = [-15-this.el.dom.offsetWidth, -13-this.anchorOffset]; break; default: offsets = [25, -13-this.anchorOffset]; break; } } var mouseOffset = this.getMouseOffset(); offsets[0] += mouseOffset[0]; offsets[1] += mouseOffset[1]; return offsets; }, onTargetOver : function(e){ if(this.disabled || e.within(this.target.dom, true)){ return; } var t = e.getTarget(this.delegate); if (t) { this.triggerElement = t; this.clearTimer('hide'); this.targetXY = e.getXY(); this.delayShow(); } }, delayShow : function(){ if(this.hidden && !this.showTimer){ if(this.lastActive.getElapsed() < this.quickShowInterval){ this.show(); }else{ this.showTimer = this.show.defer(this.showDelay, this); } }else if(!this.hidden && this.autoHide !== false){ this.show(); } }, onTargetOut : function(e){ if(this.disabled || e.within(this.target.dom, true)){ return; } this.clearTimer('show'); if(this.autoHide !== false){ this.delayHide(); } }, delayHide : function(){ if(!this.hidden && !this.hideTimer){ this.hideTimer = this.hide.defer(this.hideDelay, this); } }, hide: function(){ this.clearTimer('dismiss'); this.lastActive = new Date(); if(this.anchorEl){ this.anchorEl.hide(); } Ext.ToolTip.superclass.hide.call(this); delete this.triggerElement; }, show : function(){ if(this.anchor){ this.showAt([-1000,-1000]); this.origConstrainPosition = this.constrainPosition; this.constrainPosition = false; this.anchor = this.origAnchor; } this.showAt(this.getTargetXY()); if(this.anchor){ this.anchorEl.show(); this.syncAnchor(); this.constrainPosition = this.origConstrainPosition; }else{ this.anchorEl.hide(); } }, showAt : function(xy){ this.lastActive = new Date(); this.clearTimers(); Ext.ToolTip.superclass.showAt.call(this, xy); if(this.dismissDelay && this.autoHide !== false){ this.dismissTimer = this.hide.defer(this.dismissDelay, this); } if(this.anchor && !this.anchorEl.isVisible()){ this.syncAnchor(); this.anchorEl.show(); }else{ this.anchorEl.hide(); } }, syncAnchor : function(){ var anchorPos, targetPos, offset; switch(this.tipAnchor.charAt(0)){ case 't': anchorPos = 'b'; targetPos = 'tl'; offset = [20+this.anchorOffset, 2]; break; case 'r': anchorPos = 'l'; targetPos = 'tr'; offset = [-2, 11+this.anchorOffset]; break; case 'b': anchorPos = 't'; targetPos = 'bl'; offset = [20+this.anchorOffset, -2]; break; default: anchorPos = 'r'; targetPos = 'tl'; offset = [2, 11+this.anchorOffset]; break; } this.anchorEl.alignTo(this.el, anchorPos+'-'+targetPos, offset); }, setPagePosition : function(x, y){ Ext.ToolTip.superclass.setPagePosition.call(this, x, y); if(this.anchor){ this.syncAnchor(); } }, clearTimer : function(name){ name = name + 'Timer'; clearTimeout(this[name]); delete this[name]; }, clearTimers : function(){ this.clearTimer('show'); this.clearTimer('dismiss'); this.clearTimer('hide'); }, onShow : function(){ Ext.ToolTip.superclass.onShow.call(this); Ext.getDoc().on('mousedown', this.onDocMouseDown, this); }, onHide : function(){ Ext.ToolTip.superclass.onHide.call(this); Ext.getDoc().un('mousedown', this.onDocMouseDown, this); }, onDocMouseDown : function(e){ if(this.autoHide !== true && !this.closable && !e.within(this.el.dom)){ this.disable(); this.doEnable.defer(100, this); } }, doEnable : function(){ if(!this.isDestroyed){ this.enable(); } }, onDisable : function(){ this.clearTimers(); this.hide(); }, adjustPosition : function(x, y){ if(this.constrainPosition){ var ay = this.targetXY[1], h = this.getSize().height; if(y <= ay && (y+h) >= ay){ y = ay-h-5; } } return {x : x, y: y}; }, beforeDestroy : function(){ this.clearTimers(); Ext.destroy(this.anchorEl); delete this.anchorEl; delete this.target; delete this.anchorTarget; delete this.triggerElement; Ext.ToolTip.superclass.beforeDestroy.call(this); }, onDestroy : function(){ Ext.getDoc().un('mousedown', this.onDocMouseDown, this); Ext.ToolTip.superclass.onDestroy.call(this); } }); Ext.reg('tooltip', Ext.ToolTip); Ext.QuickTip = Ext.extend(Ext.ToolTip, { interceptTitles : false, tagConfig : { namespace : "ext", attribute : "qtip", width : "qwidth", target : "target", title : "qtitle", hide : "hide", cls : "qclass", align : "qalign", anchor : "anchor" }, initComponent : function(){ this.target = this.target || Ext.getDoc(); this.targets = this.targets || {}; Ext.QuickTip.superclass.initComponent.call(this); }, register : function(config){ var cs = Ext.isArray(config) ? config : arguments; for(var i = 0, len = cs.length; i < len; i++){ var c = cs[i]; var target = c.target; if(target){ if(Ext.isArray(target)){ for(var j = 0, jlen = target.length; j < jlen; j++){ this.targets[Ext.id(target[j])] = c; } } else{ this.targets[Ext.id(target)] = c; } } } }, unregister : function(el){ delete this.targets[Ext.id(el)]; }, cancelShow: function(el){ var at = this.activeTarget; el = Ext.get(el).dom; if(this.isVisible()){ if(at && at.el == el){ this.hide(); } }else if(at && at.el == el){ this.clearTimer('show'); } }, getTipCfg: function(e) { var t = e.getTarget(), ttp, cfg; if(this.interceptTitles && t.title && Ext.isString(t.title)){ ttp = t.title; t.qtip = ttp; t.removeAttribute("title"); e.preventDefault(); }else{ cfg = this.tagConfig; ttp = t.qtip || Ext.fly(t).getAttribute(cfg.attribute, cfg.namespace); } return ttp; }, onTargetOver : function(e){ if(this.disabled){ return; } this.targetXY = e.getXY(); var t = e.getTarget(); if(!t || t.nodeType !== 1 || t == document || t == document.body){ return; } if(this.activeTarget && ((t == this.activeTarget.el) || Ext.fly(this.activeTarget.el).contains(t))){ this.clearTimer('hide'); this.show(); return; } if(t && this.targets[t.id]){ this.activeTarget = this.targets[t.id]; this.activeTarget.el = t; this.anchor = this.activeTarget.anchor; if(this.anchor){ this.anchorTarget = t; } this.delayShow(); return; } var ttp, et = Ext.fly(t), cfg = this.tagConfig, ns = cfg.namespace; if(ttp = this.getTipCfg(e)){ var autoHide = et.getAttribute(cfg.hide, ns); this.activeTarget = { el: t, text: ttp, width: et.getAttribute(cfg.width, ns), autoHide: autoHide != "user" && autoHide !== 'false', title: et.getAttribute(cfg.title, ns), cls: et.getAttribute(cfg.cls, ns), align: et.getAttribute(cfg.align, ns) }; this.anchor = et.getAttribute(cfg.anchor, ns); if(this.anchor){ this.anchorTarget = t; } this.delayShow(); } }, onTargetOut : function(e){ if (this.activeTarget && e.within(this.activeTarget.el) && !this.getTipCfg(e)) { return; } this.clearTimer('show'); if(this.autoHide !== false){ this.delayHide(); } }, showAt : function(xy){ var t = this.activeTarget; if(t){ if(!this.rendered){ this.render(Ext.getBody()); this.activeTarget = t; } if(t.width){ this.setWidth(t.width); this.body.setWidth(this.adjustBodyWidth(t.width - this.getFrameWidth())); this.measureWidth = false; } else{ this.measureWidth = true; } this.setTitle(t.title || ''); this.body.update(t.text); this.autoHide = t.autoHide; this.dismissDelay = t.dismissDelay || this.dismissDelay; if(this.lastCls){ this.el.removeClass(this.lastCls); delete this.lastCls; } if(t.cls){ this.el.addClass(t.cls); this.lastCls = t.cls; } if(this.anchor){ this.constrainPosition = false; }else if(t.align){ xy = this.el.getAlignToXY(t.el, t.align); this.constrainPosition = false; }else{ this.constrainPosition = true; } } Ext.QuickTip.superclass.showAt.call(this, xy); }, hide: function(){ delete this.activeTarget; Ext.QuickTip.superclass.hide.call(this); } }); Ext.reg('quicktip', Ext.QuickTip); Ext.QuickTips = function(){ var tip, disabled = false; return { init : function(autoRender){ if(!tip){ if(!Ext.isReady){ Ext.onReady(function(){ Ext.QuickTips.init(autoRender); }); return; } tip = new Ext.QuickTip({ elements:'header,body', disabled: disabled }); if(autoRender !== false){ tip.render(Ext.getBody()); } } }, ddDisable : function(){ if(tip && !disabled){ tip.disable(); } }, ddEnable : function(){ if(tip && !disabled){ tip.enable(); } }, enable : function(){ if(tip){ tip.enable(); } disabled = false; }, disable : function(){ if(tip){ tip.disable(); } disabled = true; }, isEnabled : function(){ return tip !== undefined && !tip.disabled; }, getQuickTip : function(){ return tip; }, register : function(){ tip.register.apply(tip, arguments); }, unregister : function(){ tip.unregister.apply(tip, arguments); }, tips : function(){ tip.register.apply(tip, arguments); } }; }(); Ext.slider.Tip = Ext.extend(Ext.Tip, { minWidth: 10, offsets : [0, -10], init: function(slider) { slider.on({ scope : this, dragstart: this.onSlide, drag : this.onSlide, dragend : this.hide, destroy : this.destroy }); }, onSlide : function(slider, e, thumb) { this.show(); this.body.update(this.getText(thumb)); this.doAutoWidth(); this.el.alignTo(thumb.el, 'b-t?', this.offsets); }, getText : function(thumb) { return String(thumb.value); } }); Ext.ux.SliderTip = Ext.slider.Tip; Ext.tree.TreePanel = Ext.extend(Ext.Panel, { rootVisible : true, animate : Ext.enableFx, lines : true, enableDD : false, hlDrop : Ext.enableFx, pathSeparator : '/', bubbleEvents : [], initComponent : function(){ Ext.tree.TreePanel.superclass.initComponent.call(this); if(!this.eventModel){ this.eventModel = new Ext.tree.TreeEventModel(this); } var l = this.loader; if(!l){ l = new Ext.tree.TreeLoader({ dataUrl: this.dataUrl, requestMethod: this.requestMethod }); }else if(Ext.isObject(l) && !l.load){ l = new Ext.tree.TreeLoader(l); } this.loader = l; this.nodeHash = {}; if(this.root){ var r = this.root; delete this.root; this.setRootNode(r); } this.addEvents( 'append', 'remove', 'movenode', 'insert', 'beforeappend', 'beforeremove', 'beforemovenode', 'beforeinsert', 'beforeload', 'load', 'textchange', 'beforeexpandnode', 'beforecollapsenode', 'expandnode', 'disabledchange', 'collapsenode', 'beforeclick', 'click', 'containerclick', 'checkchange', 'beforedblclick', 'dblclick', 'containerdblclick', 'contextmenu', 'containercontextmenu', 'beforechildrenrendered', 'startdrag', 'enddrag', 'dragdrop', 'beforenodedrop', 'nodedrop', 'nodedragover' ); if(this.singleExpand){ this.on('beforeexpandnode', this.restrictExpand, this); } }, proxyNodeEvent : function(ename, a1, a2, a3, a4, a5, a6){ if(ename == 'collapse' || ename == 'expand' || ename == 'beforecollapse' || ename == 'beforeexpand' || ename == 'move' || ename == 'beforemove'){ ename = ename+'node'; } return this.fireEvent(ename, a1, a2, a3, a4, a5, a6); }, getRootNode : function(){ return this.root; }, setRootNode : function(node){ this.destroyRoot(); if(!node.render){ node = this.loader.createNode(node); } this.root = node; node.ownerTree = this; node.isRoot = true; this.registerNode(node); if(!this.rootVisible){ var uiP = node.attributes.uiProvider; node.ui = uiP ? new uiP(node) : new Ext.tree.RootTreeNodeUI(node); } if(this.innerCt){ this.clearInnerCt(); this.renderRoot(); } return node; }, clearInnerCt : function(){ this.innerCt.update(''); }, renderRoot : function(){ this.root.render(); if(!this.rootVisible){ this.root.renderChildren(); } }, getNodeById : function(id){ return this.nodeHash[id]; }, registerNode : function(node){ this.nodeHash[node.id] = node; }, unregisterNode : function(node){ delete this.nodeHash[node.id]; }, toString : function(){ return '[Tree'+(this.id?' '+this.id:'')+']'; }, restrictExpand : function(node){ var p = node.parentNode; if(p){ if(p.expandedChild && p.expandedChild.parentNode == p){ p.expandedChild.collapse(); } p.expandedChild = node; } }, getChecked : function(a, startNode){ startNode = startNode || this.root; var r = []; var f = function(){ if(this.attributes.checked){ r.push(!a ? this : (a == 'id' ? this.id : this.attributes[a])); } }; startNode.cascade(f); return r; }, getLoader : function(){ return this.loader; }, expandAll : function(){ this.root.expand(true); }, collapseAll : function(){ this.root.collapse(true); }, getSelectionModel : function(){ if(!this.selModel){ this.selModel = new Ext.tree.DefaultSelectionModel(); } return this.selModel; }, expandPath : function(path, attr, callback){ if(Ext.isEmpty(path)){ if(callback){ callback(false, undefined); } return; } attr = attr || 'id'; var keys = path.split(this.pathSeparator); var curNode = this.root; if(curNode.attributes[attr] != keys[1]){ if(callback){ callback(false, null); } return; } var index = 1; var f = function(){ if(++index == keys.length){ if(callback){ callback(true, curNode); } return; } var c = curNode.findChild(attr, keys[index]); if(!c){ if(callback){ callback(false, curNode); } return; } curNode = c; c.expand(false, false, f); }; curNode.expand(false, false, f); }, selectPath : function(path, attr, callback){ if(Ext.isEmpty(path)){ if(callback){ callback(false, undefined); } return; } attr = attr || 'id'; var keys = path.split(this.pathSeparator), v = keys.pop(); if(keys.length > 1){ var f = function(success, node){ if(success && node){ var n = node.findChild(attr, v); if(n){ n.select(); if(callback){ callback(true, n); } }else if(callback){ callback(false, n); } }else{ if(callback){ callback(false, n); } } }; this.expandPath(keys.join(this.pathSeparator), attr, f); }else{ this.root.select(); if(callback){ callback(true, this.root); } } }, getTreeEl : function(){ return this.body; }, onRender : function(ct, position){ Ext.tree.TreePanel.superclass.onRender.call(this, ct, position); this.el.addClass('x-tree'); this.innerCt = this.body.createChild({tag:'ul', cls:'x-tree-root-ct ' + (this.useArrows ? 'x-tree-arrows' : this.lines ? 'x-tree-lines' : 'x-tree-no-lines')}); }, initEvents : function(){ Ext.tree.TreePanel.superclass.initEvents.call(this); if(this.containerScroll){ Ext.dd.ScrollManager.register(this.body); } if((this.enableDD || this.enableDrop) && !this.dropZone){ this.dropZone = new Ext.tree.TreeDropZone(this, this.dropConfig || { ddGroup: this.ddGroup || 'TreeDD', appendOnly: this.ddAppendOnly === true }); } if((this.enableDD || this.enableDrag) && !this.dragZone){ this.dragZone = new Ext.tree.TreeDragZone(this, this.dragConfig || { ddGroup: this.ddGroup || 'TreeDD', scroll: this.ddScroll }); } this.getSelectionModel().init(this); }, afterRender : function(){ Ext.tree.TreePanel.superclass.afterRender.call(this); this.renderRoot(); }, beforeDestroy : function(){ if(this.rendered){ Ext.dd.ScrollManager.unregister(this.body); Ext.destroy(this.dropZone, this.dragZone); } this.destroyRoot(); Ext.destroy(this.loader); this.nodeHash = this.root = this.loader = null; Ext.tree.TreePanel.superclass.beforeDestroy.call(this); }, destroyRoot : function(){ if(this.root && this.root.destroy){ this.root.destroy(true); } } }); Ext.tree.TreePanel.nodeTypes = {}; Ext.reg('treepanel', Ext.tree.TreePanel);Ext.tree.TreeEventModel = function(tree){ this.tree = tree; this.tree.on('render', this.initEvents, this); }; Ext.tree.TreeEventModel.prototype = { initEvents : function(){ var t = this.tree; if(t.trackMouseOver !== false){ t.mon(t.innerCt, { scope: this, mouseover: this.delegateOver, mouseout: this.delegateOut }); } t.mon(t.getTreeEl(), { scope: this, click: this.delegateClick, dblclick: this.delegateDblClick, contextmenu: this.delegateContextMenu }); }, getNode : function(e){ var t; if(t = e.getTarget('.x-tree-node-el', 10)){ var id = Ext.fly(t, '_treeEvents').getAttribute('tree-node-id', 'ext'); if(id){ return this.tree.getNodeById(id); } } return null; }, getNodeTarget : function(e){ var t = e.getTarget('.x-tree-node-icon', 1); if(!t){ t = e.getTarget('.x-tree-node-el', 6); } return t; }, delegateOut : function(e, t){ if(!this.beforeEvent(e)){ return; } if(e.getTarget('.x-tree-ec-icon', 1)){ var n = this.getNode(e); this.onIconOut(e, n); if(n == this.lastEcOver){ delete this.lastEcOver; } } if((t = this.getNodeTarget(e)) && !e.within(t, true)){ this.onNodeOut(e, this.getNode(e)); } }, delegateOver : function(e, t){ if(!this.beforeEvent(e)){ return; } if(Ext.isGecko && !this.trackingDoc){ Ext.getBody().on('mouseover', this.trackExit, this); this.trackingDoc = true; } if(this.lastEcOver){ this.onIconOut(e, this.lastEcOver); delete this.lastEcOver; } if(e.getTarget('.x-tree-ec-icon', 1)){ this.lastEcOver = this.getNode(e); this.onIconOver(e, this.lastEcOver); } if(t = this.getNodeTarget(e)){ this.onNodeOver(e, this.getNode(e)); } }, trackExit : function(e){ if(this.lastOverNode){ if(this.lastOverNode.ui && !e.within(this.lastOverNode.ui.getEl())){ this.onNodeOut(e, this.lastOverNode); } delete this.lastOverNode; Ext.getBody().un('mouseover', this.trackExit, this); this.trackingDoc = false; } }, delegateClick : function(e, t){ if(this.beforeEvent(e)){ if(e.getTarget('input[type=checkbox]', 1)){ this.onCheckboxClick(e, this.getNode(e)); }else if(e.getTarget('.x-tree-ec-icon', 1)){ this.onIconClick(e, this.getNode(e)); }else if(this.getNodeTarget(e)){ this.onNodeClick(e, this.getNode(e)); } }else{ this.checkContainerEvent(e, 'click'); } }, delegateDblClick : function(e, t){ if(this.beforeEvent(e)){ if(this.getNodeTarget(e)){ this.onNodeDblClick(e, this.getNode(e)); } }else{ this.checkContainerEvent(e, 'dblclick'); } }, delegateContextMenu : function(e, t){ if(this.beforeEvent(e)){ if(this.getNodeTarget(e)){ this.onNodeContextMenu(e, this.getNode(e)); } }else{ this.checkContainerEvent(e, 'contextmenu'); } }, checkContainerEvent: function(e, type){ if(this.disabled){ e.stopEvent(); return false; } this.onContainerEvent(e, type); }, onContainerEvent: function(e, type){ this.tree.fireEvent('container' + type, this.tree, e); }, onNodeClick : function(e, node){ node.ui.onClick(e); }, onNodeOver : function(e, node){ this.lastOverNode = node; node.ui.onOver(e); }, onNodeOut : function(e, node){ node.ui.onOut(e); }, onIconOver : function(e, node){ node.ui.addClass('x-tree-ec-over'); }, onIconOut : function(e, node){ node.ui.removeClass('x-tree-ec-over'); }, onIconClick : function(e, node){ node.ui.ecClick(e); }, onCheckboxClick : function(e, node){ node.ui.onCheckChange(e); }, onNodeDblClick : function(e, node){ node.ui.onDblClick(e); }, onNodeContextMenu : function(e, node){ node.ui.onContextMenu(e); }, beforeEvent : function(e){ var node = this.getNode(e); if(this.disabled || !node || !node.ui){ e.stopEvent(); return false; } return true; }, disable: function(){ this.disabled = true; }, enable: function(){ this.disabled = false; } }; Ext.tree.DefaultSelectionModel = Ext.extend(Ext.util.Observable, { constructor : function(config){ this.selNode = null; this.addEvents( 'selectionchange', 'beforeselect' ); Ext.apply(this, config); Ext.tree.DefaultSelectionModel.superclass.constructor.call(this); }, init : function(tree){ this.tree = tree; tree.mon(tree.getTreeEl(), 'keydown', this.onKeyDown, this); tree.on('click', this.onNodeClick, this); }, onNodeClick : function(node, e){ this.select(node); }, select : function(node, selectNextNode){ if (!Ext.fly(node.ui.wrap).isVisible() && selectNextNode) { return selectNextNode.call(this, node); } var last = this.selNode; if(node == last){ node.ui.onSelectedChange(true); }else if(this.fireEvent('beforeselect', this, node, last) !== false){ if(last && last.ui){ last.ui.onSelectedChange(false); } this.selNode = node; node.ui.onSelectedChange(true); this.fireEvent('selectionchange', this, node, last); } return node; }, unselect : function(node, silent){ if(this.selNode == node){ this.clearSelections(silent); } }, clearSelections : function(silent){ var n = this.selNode; if(n){ n.ui.onSelectedChange(false); this.selNode = null; if(silent !== true){ this.fireEvent('selectionchange', this, null); } } return n; }, getSelectedNode : function(){ return this.selNode; }, isSelected : function(node){ return this.selNode == node; }, selectPrevious : function( s){ if(!(s = s || this.selNode || this.lastSelNode)){ return null; } var ps = s.previousSibling; if(ps){ if(!ps.isExpanded() || ps.childNodes.length < 1){ return this.select(ps, this.selectPrevious); } else{ var lc = ps.lastChild; while(lc && lc.isExpanded() && Ext.fly(lc.ui.wrap).isVisible() && lc.childNodes.length > 0){ lc = lc.lastChild; } return this.select(lc, this.selectPrevious); } } else if(s.parentNode && (this.tree.rootVisible || !s.parentNode.isRoot)){ return this.select(s.parentNode, this.selectPrevious); } return null; }, selectNext : function( s){ if(!(s = s || this.selNode || this.lastSelNode)){ return null; } if(s.firstChild && s.isExpanded() && Ext.fly(s.ui.wrap).isVisible()){ return this.select(s.firstChild, this.selectNext); }else if(s.nextSibling){ return this.select(s.nextSibling, this.selectNext); }else if(s.parentNode){ var newS = null; s.parentNode.bubble(function(){ if(this.nextSibling){ newS = this.getOwnerTree().selModel.select(this.nextSibling, this.selectNext); return false; } }); return newS; } return null; }, onKeyDown : function(e){ var s = this.selNode || this.lastSelNode; var sm = this; if(!s){ return; } var k = e.getKey(); switch(k){ case e.DOWN: e.stopEvent(); this.selectNext(); break; case e.UP: e.stopEvent(); this.selectPrevious(); break; case e.RIGHT: e.preventDefault(); if(s.hasChildNodes()){ if(!s.isExpanded()){ s.expand(); }else if(s.firstChild){ this.select(s.firstChild, e); } } break; case e.LEFT: e.preventDefault(); if(s.hasChildNodes() && s.isExpanded()){ s.collapse(); }else if(s.parentNode && (this.tree.rootVisible || s.parentNode != this.tree.getRootNode())){ this.select(s.parentNode, e); } break; }; } }); Ext.tree.MultiSelectionModel = Ext.extend(Ext.util.Observable, { constructor : function(config){ this.selNodes = []; this.selMap = {}; this.addEvents( 'selectionchange' ); Ext.apply(this, config); Ext.tree.MultiSelectionModel.superclass.constructor.call(this); }, init : function(tree){ this.tree = tree; tree.mon(tree.getTreeEl(), 'keydown', this.onKeyDown, this); tree.on('click', this.onNodeClick, this); }, onNodeClick : function(node, e){ if(e.ctrlKey && this.isSelected(node)){ this.unselect(node); }else{ this.select(node, e, e.ctrlKey); } }, select : function(node, e, keepExisting){ if(keepExisting !== true){ this.clearSelections(true); } if(this.isSelected(node)){ this.lastSelNode = node; return node; } this.selNodes.push(node); this.selMap[node.id] = node; this.lastSelNode = node; node.ui.onSelectedChange(true); this.fireEvent('selectionchange', this, this.selNodes); return node; }, unselect : function(node){ if(this.selMap[node.id]){ node.ui.onSelectedChange(false); var sn = this.selNodes; var index = sn.indexOf(node); if(index != -1){ this.selNodes.splice(index, 1); } delete this.selMap[node.id]; this.fireEvent('selectionchange', this, this.selNodes); } }, clearSelections : function(suppressEvent){ var sn = this.selNodes; if(sn.length > 0){ for(var i = 0, len = sn.length; i < len; i++){ sn[i].ui.onSelectedChange(false); } this.selNodes = []; this.selMap = {}; if(suppressEvent !== true){ this.fireEvent('selectionchange', this, this.selNodes); } } }, isSelected : function(node){ return this.selMap[node.id] ? true : false; }, getSelectedNodes : function(){ return this.selNodes.concat([]); }, onKeyDown : Ext.tree.DefaultSelectionModel.prototype.onKeyDown, selectNext : Ext.tree.DefaultSelectionModel.prototype.selectNext, selectPrevious : Ext.tree.DefaultSelectionModel.prototype.selectPrevious }); Ext.data.Tree = Ext.extend(Ext.util.Observable, { constructor: function(root){ this.nodeHash = {}; this.root = null; if(root){ this.setRootNode(root); } this.addEvents( "append", "remove", "move", "insert", "beforeappend", "beforeremove", "beforemove", "beforeinsert" ); Ext.data.Tree.superclass.constructor.call(this); }, pathSeparator: "/", proxyNodeEvent : function(){ return this.fireEvent.apply(this, arguments); }, getRootNode : function(){ return this.root; }, setRootNode : function(node){ this.root = node; node.ownerTree = this; node.isRoot = true; this.registerNode(node); return node; }, getNodeById : function(id){ return this.nodeHash[id]; }, registerNode : function(node){ this.nodeHash[node.id] = node; }, unregisterNode : function(node){ delete this.nodeHash[node.id]; }, toString : function(){ return "[Tree"+(this.id?" "+this.id:"")+"]"; } }); Ext.data.Node = Ext.extend(Ext.util.Observable, { constructor: function(attributes){ this.attributes = attributes || {}; this.leaf = this.attributes.leaf; this.id = this.attributes.id; if(!this.id){ this.id = Ext.id(null, "xnode-"); this.attributes.id = this.id; } this.childNodes = []; this.parentNode = null; this.firstChild = null; this.lastChild = null; this.previousSibling = null; this.nextSibling = null; this.addEvents({ "append" : true, "remove" : true, "move" : true, "insert" : true, "beforeappend" : true, "beforeremove" : true, "beforemove" : true, "beforeinsert" : true }); this.listeners = this.attributes.listeners; Ext.data.Node.superclass.constructor.call(this); }, fireEvent : function(evtName){ if(Ext.data.Node.superclass.fireEvent.apply(this, arguments) === false){ return false; } var ot = this.getOwnerTree(); if(ot){ if(ot.proxyNodeEvent.apply(ot, arguments) === false){ return false; } } return true; }, isLeaf : function(){ return this.leaf === true; }, setFirstChild : function(node){ this.firstChild = node; }, setLastChild : function(node){ this.lastChild = node; }, isLast : function(){ return (!this.parentNode ? true : this.parentNode.lastChild == this); }, isFirst : function(){ return (!this.parentNode ? true : this.parentNode.firstChild == this); }, hasChildNodes : function(){ return !this.isLeaf() && this.childNodes.length > 0; }, isExpandable : function(){ return this.attributes.expandable || this.hasChildNodes(); }, appendChild : function(node){ var multi = false; if(Ext.isArray(node)){ multi = node; }else if(arguments.length > 1){ multi = arguments; } if(multi){ for(var i = 0, len = multi.length; i < len; i++) { this.appendChild(multi[i]); } }else{ if(this.fireEvent("beforeappend", this.ownerTree, this, node) === false){ return false; } var index = this.childNodes.length; var oldParent = node.parentNode; if(oldParent){ if(node.fireEvent("beforemove", node.getOwnerTree(), node, oldParent, this, index) === false){ return false; } oldParent.removeChild(node); } index = this.childNodes.length; if(index === 0){ this.setFirstChild(node); } this.childNodes.push(node); node.parentNode = this; var ps = this.childNodes[index-1]; if(ps){ node.previousSibling = ps; ps.nextSibling = node; }else{ node.previousSibling = null; } node.nextSibling = null; this.setLastChild(node); node.setOwnerTree(this.getOwnerTree()); this.fireEvent("append", this.ownerTree, this, node, index); if(oldParent){ node.fireEvent("move", this.ownerTree, node, oldParent, this, index); } return node; } }, removeChild : function(node, destroy){ var index = this.childNodes.indexOf(node); if(index == -1){ return false; } if(this.fireEvent("beforeremove", this.ownerTree, this, node) === false){ return false; } this.childNodes.splice(index, 1); if(node.previousSibling){ node.previousSibling.nextSibling = node.nextSibling; } if(node.nextSibling){ node.nextSibling.previousSibling = node.previousSibling; } if(this.firstChild == node){ this.setFirstChild(node.nextSibling); } if(this.lastChild == node){ this.setLastChild(node.previousSibling); } this.fireEvent("remove", this.ownerTree, this, node); if(destroy){ node.destroy(true); }else{ node.clear(); } return node; }, clear : function(destroy){ this.setOwnerTree(null, destroy); this.parentNode = this.previousSibling = this.nextSibling = null; if(destroy){ this.firstChild = this.lastChild = null; } }, destroy : function( silent){ if(silent === true){ this.purgeListeners(); this.clear(true); Ext.each(this.childNodes, function(n){ n.destroy(true); }); this.childNodes = null; }else{ this.remove(true); } }, insertBefore : function(node, refNode){ if(!refNode){ return this.appendChild(node); } if(node == refNode){ return false; } if(this.fireEvent("beforeinsert", this.ownerTree, this, node, refNode) === false){ return false; } var index = this.childNodes.indexOf(refNode); var oldParent = node.parentNode; var refIndex = index; if(oldParent == this && this.childNodes.indexOf(node) < index){ refIndex--; } if(oldParent){ if(node.fireEvent("beforemove", node.getOwnerTree(), node, oldParent, this, index, refNode) === false){ return false; } oldParent.removeChild(node); } if(refIndex === 0){ this.setFirstChild(node); } this.childNodes.splice(refIndex, 0, node); node.parentNode = this; var ps = this.childNodes[refIndex-1]; if(ps){ node.previousSibling = ps; ps.nextSibling = node; }else{ node.previousSibling = null; } node.nextSibling = refNode; refNode.previousSibling = node; node.setOwnerTree(this.getOwnerTree()); this.fireEvent("insert", this.ownerTree, this, node, refNode); if(oldParent){ node.fireEvent("move", this.ownerTree, node, oldParent, this, refIndex, refNode); } return node; }, remove : function(destroy){ if (this.parentNode) { this.parentNode.removeChild(this, destroy); } return this; }, removeAll : function(destroy){ var cn = this.childNodes, n; while((n = cn[0])){ this.removeChild(n, destroy); } return this; }, item : function(index){ return this.childNodes[index]; }, replaceChild : function(newChild, oldChild){ var s = oldChild ? oldChild.nextSibling : null; this.removeChild(oldChild); this.insertBefore(newChild, s); return oldChild; }, indexOf : function(child){ return this.childNodes.indexOf(child); }, getOwnerTree : function(){ if(!this.ownerTree){ var p = this; while(p){ if(p.ownerTree){ this.ownerTree = p.ownerTree; break; } p = p.parentNode; } } return this.ownerTree; }, getDepth : function(){ var depth = 0; var p = this; while(p.parentNode){ ++depth; p = p.parentNode; } return depth; }, setOwnerTree : function(tree, destroy){ if(tree != this.ownerTree){ if(this.ownerTree){ this.ownerTree.unregisterNode(this); } this.ownerTree = tree; if(destroy !== true){ Ext.each(this.childNodes, function(n){ n.setOwnerTree(tree); }); } if(tree){ tree.registerNode(this); } } }, setId: function(id){ if(id !== this.id){ var t = this.ownerTree; if(t){ t.unregisterNode(this); } this.id = this.attributes.id = id; if(t){ t.registerNode(this); } this.onIdChange(id); } }, onIdChange: Ext.emptyFn, getPath : function(attr){ attr = attr || "id"; var p = this.parentNode; var b = [this.attributes[attr]]; while(p){ b.unshift(p.attributes[attr]); p = p.parentNode; } var sep = this.getOwnerTree().pathSeparator; return sep + b.join(sep); }, bubble : function(fn, scope, args){ var p = this; while(p){ if(fn.apply(scope || p, args || [p]) === false){ break; } p = p.parentNode; } }, cascade : function(fn, scope, args){ if(fn.apply(scope || this, args || [this]) !== false){ var cs = this.childNodes; for(var i = 0, len = cs.length; i < len; i++) { cs[i].cascade(fn, scope, args); } } }, eachChild : function(fn, scope, args){ var cs = this.childNodes; for(var i = 0, len = cs.length; i < len; i++) { if(fn.apply(scope || cs[i], args || [cs[i]]) === false){ break; } } }, findChild : function(attribute, value, deep){ return this.findChildBy(function(){ return this.attributes[attribute] == value; }, null, deep); }, findChildBy : function(fn, scope, deep){ var cs = this.childNodes, len = cs.length, i = 0, n, res; for(; i < len; i++){ n = cs[i]; if(fn.call(scope || n, n) === true){ return n; }else if (deep){ res = n.findChildBy(fn, scope, deep); if(res != null){ return res; } } } return null; }, sort : function(fn, scope){ var cs = this.childNodes; var len = cs.length; if(len > 0){ var sortFn = scope ? function(){fn.apply(scope, arguments);} : fn; cs.sort(sortFn); for(var i = 0; i < len; i++){ var n = cs[i]; n.previousSibling = cs[i-1]; n.nextSibling = cs[i+1]; if(i === 0){ this.setFirstChild(n); } if(i == len-1){ this.setLastChild(n); } } } }, contains : function(node){ return node.isAncestor(this); }, isAncestor : function(node){ var p = this.parentNode; while(p){ if(p == node){ return true; } p = p.parentNode; } return false; }, toString : function(){ return "[Node"+(this.id?" "+this.id:"")+"]"; } }); Ext.tree.TreeNode = Ext.extend(Ext.data.Node, { constructor : function(attributes){ attributes = attributes || {}; if(Ext.isString(attributes)){ attributes = {text: attributes}; } this.childrenRendered = false; this.rendered = false; Ext.tree.TreeNode.superclass.constructor.call(this, attributes); this.expanded = attributes.expanded === true; this.isTarget = attributes.isTarget !== false; this.draggable = attributes.draggable !== false && attributes.allowDrag !== false; this.allowChildren = attributes.allowChildren !== false && attributes.allowDrop !== false; this.text = attributes.text; this.disabled = attributes.disabled === true; this.hidden = attributes.hidden === true; this.addEvents( 'textchange', 'beforeexpand', 'beforecollapse', 'expand', 'disabledchange', 'collapse', 'beforeclick', 'click', 'checkchange', 'beforedblclick', 'dblclick', 'contextmenu', 'beforechildrenrendered' ); var uiClass = this.attributes.uiProvider || this.defaultUI || Ext.tree.TreeNodeUI; this.ui = new uiClass(this); }, preventHScroll : true, isExpanded : function(){ return this.expanded; }, getUI : function(){ return this.ui; }, getLoader : function(){ var owner; return this.loader || ((owner = this.getOwnerTree()) && owner.loader ? owner.loader : (this.loader = new Ext.tree.TreeLoader())); }, setFirstChild : function(node){ var of = this.firstChild; Ext.tree.TreeNode.superclass.setFirstChild.call(this, node); if(this.childrenRendered && of && node != of){ of.renderIndent(true, true); } if(this.rendered){ this.renderIndent(true, true); } }, setLastChild : function(node){ var ol = this.lastChild; Ext.tree.TreeNode.superclass.setLastChild.call(this, node); if(this.childrenRendered && ol && node != ol){ ol.renderIndent(true, true); } if(this.rendered){ this.renderIndent(true, true); } }, appendChild : function(n){ if(!n.render && !Ext.isArray(n)){ n = this.getLoader().createNode(n); } var node = Ext.tree.TreeNode.superclass.appendChild.call(this, n); if(node && this.childrenRendered){ node.render(); } this.ui.updateExpandIcon(); return node; }, removeChild : function(node, destroy){ this.ownerTree.getSelectionModel().unselect(node); Ext.tree.TreeNode.superclass.removeChild.apply(this, arguments); if(!destroy){ var rendered = node.ui.rendered; if(rendered){ node.ui.remove(); } if(rendered && this.childNodes.length < 1){ this.collapse(false, false); }else{ this.ui.updateExpandIcon(); } if(!this.firstChild && !this.isHiddenRoot()){ this.childrenRendered = false; } } return node; }, insertBefore : function(node, refNode){ if(!node.render){ node = this.getLoader().createNode(node); } var newNode = Ext.tree.TreeNode.superclass.insertBefore.call(this, node, refNode); if(newNode && refNode && this.childrenRendered){ node.render(); } this.ui.updateExpandIcon(); return newNode; }, setText : function(text){ var oldText = this.text; this.text = this.attributes.text = text; if(this.rendered){ this.ui.onTextChange(this, text, oldText); } this.fireEvent('textchange', this, text, oldText); }, setIconCls : function(cls){ var old = this.attributes.iconCls; this.attributes.iconCls = cls; if(this.rendered){ this.ui.onIconClsChange(this, cls, old); } }, setTooltip : function(tip, title){ this.attributes.qtip = tip; this.attributes.qtipTitle = title; if(this.rendered){ this.ui.onTipChange(this, tip, title); } }, setIcon : function(icon){ this.attributes.icon = icon; if(this.rendered){ this.ui.onIconChange(this, icon); } }, setHref : function(href, target){ this.attributes.href = href; this.attributes.hrefTarget = target; if(this.rendered){ this.ui.onHrefChange(this, href, target); } }, setCls : function(cls){ var old = this.attributes.cls; this.attributes.cls = cls; if(this.rendered){ this.ui.onClsChange(this, cls, old); } }, select : function(){ var t = this.getOwnerTree(); if(t){ t.getSelectionModel().select(this); } }, unselect : function(silent){ var t = this.getOwnerTree(); if(t){ t.getSelectionModel().unselect(this, silent); } }, isSelected : function(){ var t = this.getOwnerTree(); return t ? t.getSelectionModel().isSelected(this) : false; }, expand : function(deep, anim, callback, scope){ if(!this.expanded){ if(this.fireEvent('beforeexpand', this, deep, anim) === false){ return; } if(!this.childrenRendered){ this.renderChildren(); } this.expanded = true; if(!this.isHiddenRoot() && (this.getOwnerTree().animate && anim !== false) || anim){ this.ui.animExpand(function(){ this.fireEvent('expand', this); this.runCallback(callback, scope || this, [this]); if(deep === true){ this.expandChildNodes(true, true); } }.createDelegate(this)); return; }else{ this.ui.expand(); this.fireEvent('expand', this); this.runCallback(callback, scope || this, [this]); } }else{ this.runCallback(callback, scope || this, [this]); } if(deep === true){ this.expandChildNodes(true); } }, runCallback : function(cb, scope, args){ if(Ext.isFunction(cb)){ cb.apply(scope, args); } }, isHiddenRoot : function(){ return this.isRoot && !this.getOwnerTree().rootVisible; }, collapse : function(deep, anim, callback, scope){ if(this.expanded && !this.isHiddenRoot()){ if(this.fireEvent('beforecollapse', this, deep, anim) === false){ return; } this.expanded = false; if((this.getOwnerTree().animate && anim !== false) || anim){ this.ui.animCollapse(function(){ this.fireEvent('collapse', this); this.runCallback(callback, scope || this, [this]); if(deep === true){ this.collapseChildNodes(true); } }.createDelegate(this)); return; }else{ this.ui.collapse(); this.fireEvent('collapse', this); this.runCallback(callback, scope || this, [this]); } }else if(!this.expanded){ this.runCallback(callback, scope || this, [this]); } if(deep === true){ var cs = this.childNodes; for(var i = 0, len = cs.length; i < len; i++) { cs[i].collapse(true, false); } } }, delayedExpand : function(delay){ if(!this.expandProcId){ this.expandProcId = this.expand.defer(delay, this); } }, cancelExpand : function(){ if(this.expandProcId){ clearTimeout(this.expandProcId); } this.expandProcId = false; }, toggle : function(){ if(this.expanded){ this.collapse(); }else{ this.expand(); } }, ensureVisible : function(callback, scope){ var tree = this.getOwnerTree(); tree.expandPath(this.parentNode ? this.parentNode.getPath() : this.getPath(), false, function(){ var node = tree.getNodeById(this.id); tree.getTreeEl().scrollChildIntoView(node.ui.anchor); this.runCallback(callback, scope || this, [this]); }.createDelegate(this)); }, expandChildNodes : function(deep, anim) { var cs = this.childNodes, i, len = cs.length; for (i = 0; i < len; i++) { cs[i].expand(deep, anim); } }, collapseChildNodes : function(deep){ var cs = this.childNodes; for(var i = 0, len = cs.length; i < len; i++) { cs[i].collapse(deep); } }, disable : function(){ this.disabled = true; this.unselect(); if(this.rendered && this.ui.onDisableChange){ this.ui.onDisableChange(this, true); } this.fireEvent('disabledchange', this, true); }, enable : function(){ this.disabled = false; if(this.rendered && this.ui.onDisableChange){ this.ui.onDisableChange(this, false); } this.fireEvent('disabledchange', this, false); }, renderChildren : function(suppressEvent){ if(suppressEvent !== false){ this.fireEvent('beforechildrenrendered', this); } var cs = this.childNodes; for(var i = 0, len = cs.length; i < len; i++){ cs[i].render(true); } this.childrenRendered = true; }, sort : function(fn, scope){ Ext.tree.TreeNode.superclass.sort.apply(this, arguments); if(this.childrenRendered){ var cs = this.childNodes; for(var i = 0, len = cs.length; i < len; i++){ cs[i].render(true); } } }, render : function(bulkRender){ this.ui.render(bulkRender); if(!this.rendered){ this.getOwnerTree().registerNode(this); this.rendered = true; if(this.expanded){ this.expanded = false; this.expand(false, false); } } }, renderIndent : function(deep, refresh){ if(refresh){ this.ui.childIndent = null; } this.ui.renderIndent(); if(deep === true && this.childrenRendered){ var cs = this.childNodes; for(var i = 0, len = cs.length; i < len; i++){ cs[i].renderIndent(true, refresh); } } }, beginUpdate : function(){ this.childrenRendered = false; }, endUpdate : function(){ if(this.expanded && this.rendered){ this.renderChildren(); } }, destroy : function(silent){ if(silent === true){ this.unselect(true); } Ext.tree.TreeNode.superclass.destroy.call(this, silent); Ext.destroy(this.ui, this.loader); this.ui = this.loader = null; }, onIdChange : function(id){ this.ui.onIdChange(id); } }); Ext.tree.TreePanel.nodeTypes.node = Ext.tree.TreeNode; Ext.tree.AsyncTreeNode = function(config){ this.loaded = config && config.loaded === true; this.loading = false; Ext.tree.AsyncTreeNode.superclass.constructor.apply(this, arguments); this.addEvents('beforeload', 'load'); }; Ext.extend(Ext.tree.AsyncTreeNode, Ext.tree.TreeNode, { expand : function(deep, anim, callback, scope){ if(this.loading){ var timer; var f = function(){ if(!this.loading){ clearInterval(timer); this.expand(deep, anim, callback, scope); } }.createDelegate(this); timer = setInterval(f, 200); return; } if(!this.loaded){ if(this.fireEvent("beforeload", this) === false){ return; } this.loading = true; this.ui.beforeLoad(this); var loader = this.loader || this.attributes.loader || this.getOwnerTree().getLoader(); if(loader){ loader.load(this, this.loadComplete.createDelegate(this, [deep, anim, callback, scope]), this); return; } } Ext.tree.AsyncTreeNode.superclass.expand.call(this, deep, anim, callback, scope); }, isLoading : function(){ return this.loading; }, loadComplete : function(deep, anim, callback, scope){ this.loading = false; this.loaded = true; this.ui.afterLoad(this); this.fireEvent("load", this); this.expand(deep, anim, callback, scope); }, isLoaded : function(){ return this.loaded; }, hasChildNodes : function(){ if(!this.isLeaf() && !this.loaded){ return true; }else{ return Ext.tree.AsyncTreeNode.superclass.hasChildNodes.call(this); } }, reload : function(callback, scope){ this.collapse(false, false); while(this.firstChild){ this.removeChild(this.firstChild).destroy(); } this.childrenRendered = false; this.loaded = false; if(this.isHiddenRoot()){ this.expanded = false; } this.expand(false, false, callback, scope); } }); Ext.tree.TreePanel.nodeTypes.async = Ext.tree.AsyncTreeNode; Ext.tree.TreeNodeUI = Ext.extend(Object, { constructor : function(node){ Ext.apply(this, { node: node, rendered: false, animating: false, wasLeaf: true, ecc: 'x-tree-ec-icon x-tree-elbow', emptyIcon: Ext.BLANK_IMAGE_URL }); }, removeChild : function(node){ if(this.rendered){ this.ctNode.removeChild(node.ui.getEl()); } }, beforeLoad : function(){ this.addClass("x-tree-node-loading"); }, afterLoad : function(){ this.removeClass("x-tree-node-loading"); }, onTextChange : function(node, text, oldText){ if(this.rendered){ this.textNode.innerHTML = text; } }, onIconClsChange : function(node, cls, oldCls){ if(this.rendered){ Ext.fly(this.iconNode).replaceClass(oldCls, cls); } }, onIconChange : function(node, icon){ if(this.rendered){ var empty = Ext.isEmpty(icon); this.iconNode.src = empty ? this.emptyIcon : icon; Ext.fly(this.iconNode)[empty ? 'removeClass' : 'addClass']('x-tree-node-inline-icon'); } }, onTipChange : function(node, tip, title){ if(this.rendered){ var hasTitle = Ext.isDefined(title); if(this.textNode.setAttributeNS){ this.textNode.setAttributeNS("ext", "qtip", tip); if(hasTitle){ this.textNode.setAttributeNS("ext", "qtitle", title); } }else{ this.textNode.setAttribute("ext:qtip", tip); if(hasTitle){ this.textNode.setAttribute("ext:qtitle", title); } } } }, onHrefChange : function(node, href, target){ if(this.rendered){ this.anchor.href = this.getHref(href); if(Ext.isDefined(target)){ this.anchor.target = target; } } }, onClsChange : function(node, cls, oldCls){ if(this.rendered){ Ext.fly(this.elNode).replaceClass(oldCls, cls); } }, onDisableChange : function(node, state){ this.disabled = state; if (this.checkbox) { this.checkbox.disabled = state; } this[state ? 'addClass' : 'removeClass']('x-tree-node-disabled'); }, onSelectedChange : function(state){ if(state){ this.focus(); this.addClass("x-tree-selected"); }else{ this.removeClass("x-tree-selected"); } }, onMove : function(tree, node, oldParent, newParent, index, refNode){ this.childIndent = null; if(this.rendered){ var targetNode = newParent.ui.getContainer(); if(!targetNode){ this.holder = document.createElement("div"); this.holder.appendChild(this.wrap); return; } var insertBefore = refNode ? refNode.ui.getEl() : null; if(insertBefore){ targetNode.insertBefore(this.wrap, insertBefore); }else{ targetNode.appendChild(this.wrap); } this.node.renderIndent(true, oldParent != newParent); } }, addClass : function(cls){ if(this.elNode){ Ext.fly(this.elNode).addClass(cls); } }, removeClass : function(cls){ if(this.elNode){ Ext.fly(this.elNode).removeClass(cls); } }, remove : function(){ if(this.rendered){ this.holder = document.createElement("div"); this.holder.appendChild(this.wrap); } }, fireEvent : function(){ return this.node.fireEvent.apply(this.node, arguments); }, initEvents : function(){ this.node.on("move", this.onMove, this); if(this.node.disabled){ this.onDisableChange(this.node, true); } if(this.node.hidden){ this.hide(); } var ot = this.node.getOwnerTree(); var dd = ot.enableDD || ot.enableDrag || ot.enableDrop; if(dd && (!this.node.isRoot || ot.rootVisible)){ Ext.dd.Registry.register(this.elNode, { node: this.node, handles: this.getDDHandles(), isHandle: false }); } }, getDDHandles : function(){ return [this.iconNode, this.textNode, this.elNode]; }, hide : function(){ this.node.hidden = true; if(this.wrap){ this.wrap.style.display = "none"; } }, show : function(){ this.node.hidden = false; if(this.wrap){ this.wrap.style.display = ""; } }, onContextMenu : function(e){ if (this.node.hasListener("contextmenu") || this.node.getOwnerTree().hasListener("contextmenu")) { e.preventDefault(); this.focus(); this.fireEvent("contextmenu", this.node, e); } }, onClick : function(e){ if(this.dropping){ e.stopEvent(); return; } if(this.fireEvent("beforeclick", this.node, e) !== false){ var a = e.getTarget('a'); if(!this.disabled && this.node.attributes.href && a){ this.fireEvent("click", this.node, e); return; }else if(a && e.ctrlKey){ e.stopEvent(); } e.preventDefault(); if(this.disabled){ return; } if(this.node.attributes.singleClickExpand && !this.animating && this.node.isExpandable()){ this.node.toggle(); } this.fireEvent("click", this.node, e); }else{ e.stopEvent(); } }, onDblClick : function(e){ e.preventDefault(); if(this.disabled){ return; } if(this.fireEvent("beforedblclick", this.node, e) !== false){ if(this.checkbox){ this.toggleCheck(); } if(!this.animating && this.node.isExpandable()){ this.node.toggle(); } this.fireEvent("dblclick", this.node, e); } }, onOver : function(e){ this.addClass('x-tree-node-over'); }, onOut : function(e){ this.removeClass('x-tree-node-over'); }, onCheckChange : function(){ var checked = this.checkbox.checked; this.checkbox.defaultChecked = checked; this.node.attributes.checked = checked; this.fireEvent('checkchange', this.node, checked); }, ecClick : function(e){ if(!this.animating && this.node.isExpandable()){ this.node.toggle(); } }, startDrop : function(){ this.dropping = true; }, endDrop : function(){ setTimeout(function(){ this.dropping = false; }.createDelegate(this), 50); }, expand : function(){ this.updateExpandIcon(); this.ctNode.style.display = ""; }, focus : function(){ if(!this.node.preventHScroll){ try{this.anchor.focus(); }catch(e){} }else{ try{ var noscroll = this.node.getOwnerTree().getTreeEl().dom; var l = noscroll.scrollLeft; this.anchor.focus(); noscroll.scrollLeft = l; }catch(e){} } }, toggleCheck : function(value){ var cb = this.checkbox; if(cb){ cb.checked = (value === undefined ? !cb.checked : value); this.onCheckChange(); } }, blur : function(){ try{ this.anchor.blur(); }catch(e){} }, animExpand : function(callback){ var ct = Ext.get(this.ctNode); ct.stopFx(); if(!this.node.isExpandable()){ this.updateExpandIcon(); this.ctNode.style.display = ""; Ext.callback(callback); return; } this.animating = true; this.updateExpandIcon(); ct.slideIn('t', { callback : function(){ this.animating = false; Ext.callback(callback); }, scope: this, duration: this.node.ownerTree.duration || .25 }); }, highlight : function(){ var tree = this.node.getOwnerTree(); Ext.fly(this.wrap).highlight( tree.hlColor || "C3DAF9", {endColor: tree.hlBaseColor} ); }, collapse : function(){ this.updateExpandIcon(); this.ctNode.style.display = "none"; }, animCollapse : function(callback){ var ct = Ext.get(this.ctNode); ct.enableDisplayMode('block'); ct.stopFx(); this.animating = true; this.updateExpandIcon(); ct.slideOut('t', { callback : function(){ this.animating = false; Ext.callback(callback); }, scope: this, duration: this.node.ownerTree.duration || .25 }); }, getContainer : function(){ return this.ctNode; }, getEl : function(){ return this.wrap; }, appendDDGhost : function(ghostNode){ ghostNode.appendChild(this.elNode.cloneNode(true)); }, getDDRepairXY : function(){ return Ext.lib.Dom.getXY(this.iconNode); }, onRender : function(){ this.render(); }, render : function(bulkRender){ var n = this.node, a = n.attributes; var targetNode = n.parentNode ? n.parentNode.ui.getContainer() : n.ownerTree.innerCt.dom; if(!this.rendered){ this.rendered = true; this.renderElements(n, a, targetNode, bulkRender); if(a.qtip){ this.onTipChange(n, a.qtip, a.qtipTitle); }else if(a.qtipCfg){ a.qtipCfg.target = Ext.id(this.textNode); Ext.QuickTips.register(a.qtipCfg); } this.initEvents(); if(!this.node.expanded){ this.updateExpandIcon(true); } }else{ if(bulkRender === true) { targetNode.appendChild(this.wrap); } } }, renderElements : function(n, a, targetNode, bulkRender){ this.indentMarkup = n.parentNode ? n.parentNode.ui.getChildIndent() : ''; var cb = Ext.isBoolean(a.checked), nel, href = this.getHref(a.href), buf = ['
  • ', '',this.indentMarkup,"", '', '', cb ? ('' : '/>')) : '', '',n.text,"
    ", '', "
  • "].join(''); if(bulkRender !== true && n.nextSibling && (nel = n.nextSibling.ui.getEl())){ this.wrap = Ext.DomHelper.insertHtml("beforeBegin", nel, buf); }else{ this.wrap = Ext.DomHelper.insertHtml("beforeEnd", targetNode, buf); } this.elNode = this.wrap.childNodes[0]; this.ctNode = this.wrap.childNodes[1]; var cs = this.elNode.childNodes; this.indentNode = cs[0]; this.ecNode = cs[1]; this.iconNode = cs[2]; var index = 3; if(cb){ this.checkbox = cs[3]; this.checkbox.defaultChecked = this.checkbox.checked; index++; } this.anchor = cs[index]; this.textNode = cs[index].firstChild; }, getHref : function(href){ return Ext.isEmpty(href) ? (Ext.isGecko ? '' : '#') : href; }, getAnchor : function(){ return this.anchor; }, getTextEl : function(){ return this.textNode; }, getIconEl : function(){ return this.iconNode; }, isChecked : function(){ return this.checkbox ? this.checkbox.checked : false; }, updateExpandIcon : function(){ if(this.rendered){ var n = this.node, c1, c2, cls = n.isLast() ? "x-tree-elbow-end" : "x-tree-elbow", hasChild = n.hasChildNodes(); if(hasChild || n.attributes.expandable){ if(n.expanded){ cls += "-minus"; c1 = "x-tree-node-collapsed"; c2 = "x-tree-node-expanded"; }else{ cls += "-plus"; c1 = "x-tree-node-expanded"; c2 = "x-tree-node-collapsed"; } if(this.wasLeaf){ this.removeClass("x-tree-node-leaf"); this.wasLeaf = false; } if(this.c1 != c1 || this.c2 != c2){ Ext.fly(this.elNode).replaceClass(c1, c2); this.c1 = c1; this.c2 = c2; } }else{ if(!this.wasLeaf){ Ext.fly(this.elNode).replaceClass("x-tree-node-expanded", "x-tree-node-collapsed"); delete this.c1; delete this.c2; this.wasLeaf = true; } } var ecc = "x-tree-ec-icon "+cls; if(this.ecc != ecc){ this.ecNode.className = ecc; this.ecc = ecc; } } }, onIdChange: function(id){ if(this.rendered){ this.elNode.setAttribute('ext:tree-node-id', id); } }, getChildIndent : function(){ if(!this.childIndent){ var buf = [], p = this.node; while(p){ if(!p.isRoot || (p.isRoot && p.ownerTree.rootVisible)){ if(!p.isLast()) { buf.unshift(''); } else { buf.unshift(''); } } p = p.parentNode; } this.childIndent = buf.join(""); } return this.childIndent; }, renderIndent : function(){ if(this.rendered){ var indent = "", p = this.node.parentNode; if(p){ indent = p.ui.getChildIndent(); } if(this.indentMarkup != indent){ this.indentNode.innerHTML = indent; this.indentMarkup = indent; } this.updateExpandIcon(); } }, destroy : function(){ if(this.elNode){ Ext.dd.Registry.unregister(this.elNode.id); } Ext.each(['textnode', 'anchor', 'checkbox', 'indentNode', 'ecNode', 'iconNode', 'elNode', 'ctNode', 'wrap', 'holder'], function(el){ if(this[el]){ Ext.fly(this[el]).remove(); delete this[el]; } }, this); delete this.node; } }); Ext.tree.RootTreeNodeUI = Ext.extend(Ext.tree.TreeNodeUI, { render : function(){ if(!this.rendered){ var targetNode = this.node.ownerTree.innerCt.dom; this.node.expanded = true; targetNode.innerHTML = '
    '; this.wrap = this.ctNode = targetNode.firstChild; } }, collapse : Ext.emptyFn, expand : Ext.emptyFn }); Ext.tree.TreeLoader = function(config){ this.baseParams = {}; Ext.apply(this, config); this.addEvents( "beforeload", "load", "loadexception" ); Ext.tree.TreeLoader.superclass.constructor.call(this); if(Ext.isString(this.paramOrder)){ this.paramOrder = this.paramOrder.split(/[\s,|]/); } }; Ext.extend(Ext.tree.TreeLoader, Ext.util.Observable, { uiProviders : {}, clearOnLoad : true, paramOrder: undefined, paramsAsHash: false, nodeParameter: 'node', directFn : undefined, load : function(node, callback, scope){ if(this.clearOnLoad){ while(node.firstChild){ node.removeChild(node.firstChild); } } if(this.doPreload(node)){ this.runCallback(callback, scope || node, [node]); }else if(this.directFn || this.dataUrl || this.url){ this.requestData(node, callback, scope || node); } }, doPreload : function(node){ if(node.attributes.children){ if(node.childNodes.length < 1){ var cs = node.attributes.children; node.beginUpdate(); for(var i = 0, len = cs.length; i < len; i++){ var cn = node.appendChild(this.createNode(cs[i])); if(this.preloadChildren){ this.doPreload(cn); } } node.endUpdate(); } return true; } return false; }, getParams: function(node){ var bp = Ext.apply({}, this.baseParams), np = this.nodeParameter, po = this.paramOrder; np && (bp[ np ] = node.id); if(this.directFn){ var buf = [node.id]; if(po){ if(np && po.indexOf(np) > -1){ buf = []; } for(var i = 0, len = po.length; i < len; i++){ buf.push(bp[ po[i] ]); } }else if(this.paramsAsHash){ buf = [bp]; } return buf; }else{ return bp; } }, requestData : function(node, callback, scope){ if(this.fireEvent("beforeload", this, node, callback) !== false){ if(this.directFn){ var args = this.getParams(node); args.push(this.processDirectResponse.createDelegate(this, [{callback: callback, node: node, scope: scope}], true)); this.directFn.apply(window, args); }else{ this.transId = Ext.Ajax.request({ method:this.requestMethod, url: this.dataUrl||this.url, success: this.handleResponse, failure: this.handleFailure, scope: this, argument: {callback: callback, node: node, scope: scope}, params: this.getParams(node) }); } }else{ this.runCallback(callback, scope || node, []); } }, processDirectResponse: function(result, response, args){ if(response.status){ this.handleResponse({ responseData: Ext.isArray(result) ? result : null, responseText: result, argument: args }); }else{ this.handleFailure({ argument: args }); } }, runCallback: function(cb, scope, args){ if(Ext.isFunction(cb)){ cb.apply(scope, args); } }, isLoading : function(){ return !!this.transId; }, abort : function(){ if(this.isLoading()){ Ext.Ajax.abort(this.transId); } }, createNode : function(attr){ if(this.baseAttrs){ Ext.applyIf(attr, this.baseAttrs); } if(this.applyLoader !== false && !attr.loader){ attr.loader = this; } if(Ext.isString(attr.uiProvider)){ attr.uiProvider = this.uiProviders[attr.uiProvider] || eval(attr.uiProvider); } if(attr.nodeType){ return new Ext.tree.TreePanel.nodeTypes[attr.nodeType](attr); }else{ return attr.leaf ? new Ext.tree.TreeNode(attr) : new Ext.tree.AsyncTreeNode(attr); } }, processResponse : function(response, node, callback, scope){ var json = response.responseText; try { var o = response.responseData || Ext.decode(json); node.beginUpdate(); for(var i = 0, len = o.length; i < len; i++){ var n = this.createNode(o[i]); if(n){ node.appendChild(n); } } node.endUpdate(); this.runCallback(callback, scope || node, [node]); }catch(e){ this.handleFailure(response); } }, handleResponse : function(response){ this.transId = false; var a = response.argument; this.processResponse(response, a.node, a.callback, a.scope); this.fireEvent("load", this, a.node, response); }, handleFailure : function(response){ this.transId = false; var a = response.argument; this.fireEvent("loadexception", this, a.node, response); this.runCallback(a.callback, a.scope || a.node, [a.node]); }, destroy : function(){ this.abort(); this.purgeListeners(); } }); Ext.tree.TreeFilter = function(tree, config){ this.tree = tree; this.filtered = {}; Ext.apply(this, config); }; Ext.tree.TreeFilter.prototype = { clearBlank:false, reverse:false, autoClear:false, remove:false, filter : function(value, attr, startNode){ attr = attr || "text"; var f; if(typeof value == "string"){ var vlen = value.length; if(vlen == 0 && this.clearBlank){ this.clear(); return; } value = value.toLowerCase(); f = function(n){ return n.attributes[attr].substr(0, vlen).toLowerCase() == value; }; }else if(value.exec){ f = function(n){ return value.test(n.attributes[attr]); }; }else{ throw 'Illegal filter type, must be string or regex'; } this.filterBy(f, null, startNode); }, filterBy : function(fn, scope, startNode){ startNode = startNode || this.tree.root; if(this.autoClear){ this.clear(); } var af = this.filtered, rv = this.reverse; var f = function(n){ if(n == startNode){ return true; } if(af[n.id]){ return false; } var m = fn.call(scope || n, n); if(!m || rv){ af[n.id] = n; n.ui.hide(); return false; } return true; }; startNode.cascade(f); if(this.remove){ for(var id in af){ if(typeof id != "function"){ var n = af[id]; if(n && n.parentNode){ n.parentNode.removeChild(n); } } } } }, clear : function(){ var t = this.tree; var af = this.filtered; for(var id in af){ if(typeof id != "function"){ var n = af[id]; if(n){ n.ui.show(); } } } this.filtered = {}; } }; Ext.tree.TreeSorter = Ext.extend(Object, { constructor: function(tree, config){ Ext.apply(this, config); tree.on({ scope: this, beforechildrenrendered: this.doSort, append: this.updateSort, insert: this.updateSort, textchange: this.updateSortParent }); var desc = this.dir && this.dir.toLowerCase() == 'desc', prop = this.property || 'text', sortType = this.sortType, folderSort = this.folderSort, caseSensitive = this.caseSensitive === true, leafAttr = this.leafAttr || 'leaf'; if(Ext.isString(sortType)){ sortType = Ext.data.SortTypes[sortType]; } this.sortFn = function(n1, n2){ var attr1 = n1.attributes, attr2 = n2.attributes; if(folderSort){ if(attr1[leafAttr] && !attr2[leafAttr]){ return 1; } if(!attr1[leafAttr] && attr2[leafAttr]){ return -1; } } var prop1 = attr1[prop], prop2 = attr2[prop], v1 = sortType ? sortType(prop1) : (caseSensitive ? prop1 : prop1.toUpperCase()), v2 = sortType ? sortType(prop2) : (caseSensitive ? prop2 : prop2.toUpperCase()); if(v1 < v2){ return desc ? 1 : -1; }else if(v1 > v2){ return desc ? -1 : 1; } return 0; }; }, doSort : function(node){ node.sort(this.sortFn); }, updateSort : function(tree, node){ if(node.childrenRendered){ this.doSort.defer(1, this, [node]); } }, updateSortParent : function(node){ var p = node.parentNode; if(p && p.childrenRendered){ this.doSort.defer(1, this, [p]); } } }); if(Ext.dd.DropZone){ Ext.tree.TreeDropZone = function(tree, config){ this.allowParentInsert = config.allowParentInsert || false; this.allowContainerDrop = config.allowContainerDrop || false; this.appendOnly = config.appendOnly || false; Ext.tree.TreeDropZone.superclass.constructor.call(this, tree.getTreeEl(), config); this.tree = tree; this.dragOverData = {}; this.lastInsertClass = "x-tree-no-status"; }; Ext.extend(Ext.tree.TreeDropZone, Ext.dd.DropZone, { ddGroup : "TreeDD", expandDelay : 1000, expandNode : function(node){ if(node.hasChildNodes() && !node.isExpanded()){ node.expand(false, null, this.triggerCacheRefresh.createDelegate(this)); } }, queueExpand : function(node){ this.expandProcId = this.expandNode.defer(this.expandDelay, this, [node]); }, cancelExpand : function(){ if(this.expandProcId){ clearTimeout(this.expandProcId); this.expandProcId = false; } }, isValidDropPoint : function(n, pt, dd, e, data){ if(!n || !data){ return false; } var targetNode = n.node; var dropNode = data.node; if(!(targetNode && targetNode.isTarget && pt)){ return false; } if(pt == "append" && targetNode.allowChildren === false){ return false; } if((pt == "above" || pt == "below") && (targetNode.parentNode && targetNode.parentNode.allowChildren === false)){ return false; } if(dropNode && (targetNode == dropNode || dropNode.contains(targetNode))){ return false; } var overEvent = this.dragOverData; overEvent.tree = this.tree; overEvent.target = targetNode; overEvent.data = data; overEvent.point = pt; overEvent.source = dd; overEvent.rawEvent = e; overEvent.dropNode = dropNode; overEvent.cancel = false; var result = this.tree.fireEvent("nodedragover", overEvent); return overEvent.cancel === false && result !== false; }, getDropPoint : function(e, n, dd){ var tn = n.node; if(tn.isRoot){ return tn.allowChildren !== false ? "append" : false; } var dragEl = n.ddel; var t = Ext.lib.Dom.getY(dragEl), b = t + dragEl.offsetHeight; var y = Ext.lib.Event.getPageY(e); var noAppend = tn.allowChildren === false || tn.isLeaf(); if(this.appendOnly || tn.parentNode.allowChildren === false){ return noAppend ? false : "append"; } var noBelow = false; if(!this.allowParentInsert){ noBelow = tn.hasChildNodes() && tn.isExpanded(); } var q = (b - t) / (noAppend ? 2 : 3); if(y >= t && y < (t + q)){ return "above"; }else if(!noBelow && (noAppend || y >= b-q && y <= b)){ return "below"; }else{ return "append"; } }, onNodeEnter : function(n, dd, e, data){ this.cancelExpand(); }, onContainerOver : function(dd, e, data) { if (this.allowContainerDrop && this.isValidDropPoint({ ddel: this.tree.getRootNode().ui.elNode, node: this.tree.getRootNode() }, "append", dd, e, data)) { return this.dropAllowed; } return this.dropNotAllowed; }, onNodeOver : function(n, dd, e, data){ var pt = this.getDropPoint(e, n, dd); var node = n.node; if(!this.expandProcId && pt == "append" && node.hasChildNodes() && !n.node.isExpanded()){ this.queueExpand(node); }else if(pt != "append"){ this.cancelExpand(); } var returnCls = this.dropNotAllowed; if(this.isValidDropPoint(n, pt, dd, e, data)){ if(pt){ var el = n.ddel; var cls; if(pt == "above"){ returnCls = n.node.isFirst() ? "x-tree-drop-ok-above" : "x-tree-drop-ok-between"; cls = "x-tree-drag-insert-above"; }else if(pt == "below"){ returnCls = n.node.isLast() ? "x-tree-drop-ok-below" : "x-tree-drop-ok-between"; cls = "x-tree-drag-insert-below"; }else{ returnCls = "x-tree-drop-ok-append"; cls = "x-tree-drag-append"; } if(this.lastInsertClass != cls){ Ext.fly(el).replaceClass(this.lastInsertClass, cls); this.lastInsertClass = cls; } } } return returnCls; }, onNodeOut : function(n, dd, e, data){ this.cancelExpand(); this.removeDropIndicators(n); }, onNodeDrop : function(n, dd, e, data){ var point = this.getDropPoint(e, n, dd); var targetNode = n.node; targetNode.ui.startDrop(); if(!this.isValidDropPoint(n, point, dd, e, data)){ targetNode.ui.endDrop(); return false; } var dropNode = data.node || (dd.getTreeNode ? dd.getTreeNode(data, targetNode, point, e) : null); return this.processDrop(targetNode, data, point, dd, e, dropNode); }, onContainerDrop : function(dd, e, data){ if (this.allowContainerDrop && this.isValidDropPoint({ ddel: this.tree.getRootNode().ui.elNode, node: this.tree.getRootNode() }, "append", dd, e, data)) { var targetNode = this.tree.getRootNode(); targetNode.ui.startDrop(); var dropNode = data.node || (dd.getTreeNode ? dd.getTreeNode(data, targetNode, 'append', e) : null); return this.processDrop(targetNode, data, 'append', dd, e, dropNode); } return false; }, processDrop: function(target, data, point, dd, e, dropNode){ var dropEvent = { tree : this.tree, target: target, data: data, point: point, source: dd, rawEvent: e, dropNode: dropNode, cancel: !dropNode, dropStatus: false }; var retval = this.tree.fireEvent("beforenodedrop", dropEvent); if(retval === false || dropEvent.cancel === true || !dropEvent.dropNode){ target.ui.endDrop(); return dropEvent.dropStatus; } target = dropEvent.target; if(point == 'append' && !target.isExpanded()){ target.expand(false, null, function(){ this.completeDrop(dropEvent); }.createDelegate(this)); }else{ this.completeDrop(dropEvent); } return true; }, completeDrop : function(de){ var ns = de.dropNode, p = de.point, t = de.target; if(!Ext.isArray(ns)){ ns = [ns]; } var n; for(var i = 0, len = ns.length; i < len; i++){ n = ns[i]; if(p == "above"){ t.parentNode.insertBefore(n, t); }else if(p == "below"){ t.parentNode.insertBefore(n, t.nextSibling); }else{ t.appendChild(n); } } n.ui.focus(); if(Ext.enableFx && this.tree.hlDrop){ n.ui.highlight(); } t.ui.endDrop(); this.tree.fireEvent("nodedrop", de); }, afterNodeMoved : function(dd, data, e, targetNode, dropNode){ if(Ext.enableFx && this.tree.hlDrop){ dropNode.ui.focus(); dropNode.ui.highlight(); } this.tree.fireEvent("nodedrop", this.tree, targetNode, data, dd, e); }, getTree : function(){ return this.tree; }, removeDropIndicators : function(n){ if(n && n.ddel){ var el = n.ddel; Ext.fly(el).removeClass([ "x-tree-drag-insert-above", "x-tree-drag-insert-below", "x-tree-drag-append"]); this.lastInsertClass = "_noclass"; } }, beforeDragDrop : function(target, e, id){ this.cancelExpand(); return true; }, afterRepair : function(data){ if(data && Ext.enableFx){ data.node.ui.highlight(); } this.hideProxy(); } }); } if(Ext.dd.DragZone){ Ext.tree.TreeDragZone = function(tree, config){ Ext.tree.TreeDragZone.superclass.constructor.call(this, tree.innerCt, config); this.tree = tree; }; Ext.extend(Ext.tree.TreeDragZone, Ext.dd.DragZone, { ddGroup : "TreeDD", onBeforeDrag : function(data, e){ var n = data.node; return n && n.draggable && !n.disabled; }, onInitDrag : function(e){ var data = this.dragData; this.tree.getSelectionModel().select(data.node); this.tree.eventModel.disable(); this.proxy.update(""); data.node.ui.appendDDGhost(this.proxy.ghost.dom); this.tree.fireEvent("startdrag", this.tree, data.node, e); }, getRepairXY : function(e, data){ return data.node.ui.getDDRepairXY(); }, onEndDrag : function(data, e){ this.tree.eventModel.enable.defer(100, this.tree.eventModel); this.tree.fireEvent("enddrag", this.tree, data.node, e); }, onValidDrop : function(dd, e, id){ this.tree.fireEvent("dragdrop", this.tree, this.dragData.node, dd, e); this.hideProxy(); }, beforeInvalidDrop : function(e, id){ var sm = this.tree.getSelectionModel(); sm.clearSelections(); sm.select(this.dragData.node); }, afterRepair : function(){ if (Ext.enableFx && this.tree.hlDrop) { Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor || "c3daf9"); } this.dragging = false; } }); } Ext.tree.TreeEditor = function(tree, fc, config){ fc = fc || {}; var field = fc.events ? fc : new Ext.form.TextField(fc); Ext.tree.TreeEditor.superclass.constructor.call(this, field, config); this.tree = tree; if(!tree.rendered){ tree.on('render', this.initEditor, this); }else{ this.initEditor(tree); } }; Ext.extend(Ext.tree.TreeEditor, Ext.Editor, { alignment: "l-l", autoSize: false, hideEl : false, cls: "x-small-editor x-tree-editor", shim:false, shadow:"frame", maxWidth: 250, editDelay : 350, initEditor : function(tree){ tree.on({ scope : this, beforeclick: this.beforeNodeClick, dblclick : this.onNodeDblClick }); this.on({ scope : this, complete : this.updateNode, beforestartedit: this.fitToTree, specialkey : this.onSpecialKey }); this.on('startedit', this.bindScroll, this, {delay:10}); }, fitToTree : function(ed, el){ var td = this.tree.getTreeEl().dom, nd = el.dom; if(td.scrollLeft > nd.offsetLeft){ td.scrollLeft = nd.offsetLeft; } var w = Math.min( this.maxWidth, (td.clientWidth > 20 ? td.clientWidth : td.offsetWidth) - Math.max(0, nd.offsetLeft-td.scrollLeft) - 5); this.setSize(w, ''); }, triggerEdit : function(node, defer){ this.completeEdit(); if(node.attributes.editable !== false){ this.editNode = node; if(this.tree.autoScroll){ Ext.fly(node.ui.getEl()).scrollIntoView(this.tree.body); } var value = node.text || ''; if (!Ext.isGecko && Ext.isEmpty(node.text)){ node.setText(' '); } this.autoEditTimer = this.startEdit.defer(this.editDelay, this, [node.ui.textNode, value]); return false; } }, bindScroll : function(){ this.tree.getTreeEl().on('scroll', this.cancelEdit, this); }, beforeNodeClick : function(node, e){ clearTimeout(this.autoEditTimer); if(this.tree.getSelectionModel().isSelected(node)){ e.stopEvent(); return this.triggerEdit(node); } }, onNodeDblClick : function(node, e){ clearTimeout(this.autoEditTimer); }, updateNode : function(ed, value){ this.tree.getTreeEl().un('scroll', this.cancelEdit, this); this.editNode.setText(value); }, onHide : function(){ Ext.tree.TreeEditor.superclass.onHide.call(this); if(this.editNode){ this.editNode.ui.focus.defer(50, this.editNode.ui); } }, onSpecialKey : function(field, e){ var k = e.getKey(); if(k == e.ESC){ e.stopEvent(); this.cancelEdit(); }else if(k == e.ENTER && !e.hasModifier()){ e.stopEvent(); this.completeEdit(); } }, onDestroy : function(){ clearTimeout(this.autoEditTimer); Ext.tree.TreeEditor.superclass.onDestroy.call(this); var tree = this.tree; tree.un('beforeclick', this.beforeNodeClick, this); tree.un('dblclick', this.onNodeDblClick, this); } }); var swfobject = function() { var UNDEF = "undefined", OBJECT = "object", SHOCKWAVE_FLASH = "Shockwave Flash", SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash", FLASH_MIME_TYPE = "application/x-shockwave-flash", EXPRESS_INSTALL_ID = "SWFObjectExprInst", ON_READY_STATE_CHANGE = "onreadystatechange", win = window, doc = document, nav = navigator, plugin = false, domLoadFnArr = [main], regObjArr = [], objIdArr = [], listenersArr = [], storedAltContent, storedAltContentId, storedCallbackFn, storedCallbackObj, isDomLoaded = false, isExpressInstallActive = false, dynamicStylesheet, dynamicStylesheetMedia, autoHideShow = true, ua = function() { var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF, u = nav.userAgent.toLowerCase(), p = nav.platform.toLowerCase(), windows = p ? (/win/).test(p) : /win/.test(u), mac = p ? (/mac/).test(p) : /mac/.test(u), webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, ie = !+"\v1", playerVersion = [0,0,0], d = null; if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) { d = nav.plugins[SHOCKWAVE_FLASH].description; if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { plugin = true; ie = false; d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1"); playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10); playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10); playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0; } } else if (typeof win.ActiveXObject != UNDEF) { try { var a = new ActiveXObject(SHOCKWAVE_FLASH_AX); if (a) { d = a.GetVariable("$version"); if (d) { ie = true; d = d.split(" ")[1].split(","); playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; } } } catch(e) {} } return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac }; }(), onDomLoad = function() { if (!ua.w3) { return; } if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { callDomLoadFunctions(); } if (!isDomLoaded) { if (typeof doc.addEventListener != UNDEF) { doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false); } if (ua.ie && ua.win) { doc.attachEvent(ON_READY_STATE_CHANGE, function() { if (doc.readyState == "complete") { doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee); callDomLoadFunctions(); } }); if (win == top) { (function(){ if (isDomLoaded) { return; } try { doc.documentElement.doScroll("left"); } catch(e) { setTimeout(arguments.callee, 0); return; } callDomLoadFunctions(); })(); } } if (ua.wk) { (function(){ if (isDomLoaded) { return; } if (!(/loaded|complete/).test(doc.readyState)) { setTimeout(arguments.callee, 0); return; } callDomLoadFunctions(); })(); } addLoadEvent(callDomLoadFunctions); } }(); function callDomLoadFunctions() { if (isDomLoaded) { return; } try { var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span")); t.parentNode.removeChild(t); } catch (e) { return; } isDomLoaded = true; var dl = domLoadFnArr.length; for (var i = 0; i < dl; i++) { domLoadFnArr[i](); } } function addDomLoadEvent(fn) { if (isDomLoaded) { fn(); } else { domLoadFnArr[domLoadFnArr.length] = fn; } } function addLoadEvent(fn) { if (typeof win.addEventListener != UNDEF) { win.addEventListener("load", fn, false); } else if (typeof doc.addEventListener != UNDEF) { doc.addEventListener("load", fn, false); } else if (typeof win.attachEvent != UNDEF) { addListener(win, "onload", fn); } else if (typeof win.onload == "function") { var fnOld = win.onload; win.onload = function() { fnOld(); fn(); }; } else { win.onload = fn; } } function main() { if (plugin) { testPlayerVersion(); } else { matchVersions(); } } function testPlayerVersion() { var b = doc.getElementsByTagName("body")[0]; var o = createElement(OBJECT); o.setAttribute("type", FLASH_MIME_TYPE); var t = b.appendChild(o); if (t) { var counter = 0; (function(){ if (typeof t.GetVariable != UNDEF) { var d = t.GetVariable("$version"); if (d) { d = d.split(" ")[1].split(","); ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; } } else if (counter < 10) { counter++; setTimeout(arguments.callee, 10); return; } b.removeChild(o); t = null; matchVersions(); })(); } else { matchVersions(); } } function matchVersions() { var rl = regObjArr.length; if (rl > 0) { for (var i = 0; i < rl; i++) { var id = regObjArr[i].id; var cb = regObjArr[i].callbackFn; var cbObj = {success:false, id:id}; if (ua.pv[0] > 0) { var obj = getElementById(id); if (obj) { if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { setVisibility(id, true); if (cb) { cbObj.success = true; cbObj.ref = getObjectById(id); cb(cbObj); } } else if (regObjArr[i].expressInstall && canExpressInstall()) { var att = {}; att.data = regObjArr[i].expressInstall; att.width = obj.getAttribute("width") || "0"; att.height = obj.getAttribute("height") || "0"; if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); } if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); } var par = {}; var p = obj.getElementsByTagName("param"); var pl = p.length; for (var j = 0; j < pl; j++) { if (p[j].getAttribute("name").toLowerCase() != "movie") { par[p[j].getAttribute("name")] = p[j].getAttribute("value"); } } showExpressInstall(att, par, id, cb); } else { displayAltContent(obj); if (cb) { cb(cbObj); } } } } else { setVisibility(id, true); if (cb) { var o = getObjectById(id); if (o && typeof o.SetVariable != UNDEF) { cbObj.success = true; cbObj.ref = o; } cb(cbObj); } } } } } function getObjectById(objectIdStr) { var r = null; var o = getElementById(objectIdStr); if (o && o.nodeName == "OBJECT") { if (typeof o.SetVariable != UNDEF) { r = o; } else { var n = o.getElementsByTagName(OBJECT)[0]; if (n) { r = n; } } } return r; } function canExpressInstall() { return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312); } function showExpressInstall(att, par, replaceElemIdStr, callbackFn) { isExpressInstallActive = true; storedCallbackFn = callbackFn || null; storedCallbackObj = {success:false, id:replaceElemIdStr}; var obj = getElementById(replaceElemIdStr); if (obj) { if (obj.nodeName == "OBJECT") { storedAltContent = abstractAltContent(obj); storedAltContentId = null; } else { storedAltContent = obj; storedAltContentId = replaceElemIdStr; } att.id = EXPRESS_INSTALL_ID; if (typeof att.width == UNDEF || (!(/%$/).test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; } if (typeof att.height == UNDEF || (!(/%$/).test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; } doc.title = doc.title.slice(0, 47) + " - Flash Player Installation"; var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn", fv = "MMredirectURL=" + win.location.toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title; if (typeof par.flashvars != UNDEF) { par.flashvars += "&" + fv; } else { par.flashvars = fv; } if (ua.ie && ua.win && obj.readyState != 4) { var newObj = createElement("div"); replaceElemIdStr += "SWFObjectNew"; newObj.setAttribute("id", replaceElemIdStr); obj.parentNode.insertBefore(newObj, obj); obj.style.display = "none"; (function(){ if (obj.readyState == 4) { obj.parentNode.removeChild(obj); } else { setTimeout(arguments.callee, 10); } })(); } createSWF(att, par, replaceElemIdStr); } } function displayAltContent(obj) { if (ua.ie && ua.win && obj.readyState != 4) { var el = createElement("div"); obj.parentNode.insertBefore(el, obj); el.parentNode.replaceChild(abstractAltContent(obj), el); obj.style.display = "none"; (function(){ if (obj.readyState == 4) { obj.parentNode.removeChild(obj); } else { setTimeout(arguments.callee, 10); } })(); } else { obj.parentNode.replaceChild(abstractAltContent(obj), obj); } } function abstractAltContent(obj) { var ac = createElement("div"); if (ua.win && ua.ie) { ac.innerHTML = obj.innerHTML; } else { var nestedObj = obj.getElementsByTagName(OBJECT)[0]; if (nestedObj) { var c = nestedObj.childNodes; if (c) { var cl = c.length; for (var i = 0; i < cl; i++) { if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) { ac.appendChild(c[i].cloneNode(true)); } } } } } return ac; } function createSWF(attObj, parObj, id) { var r, el = getElementById(id); if (ua.wk && ua.wk < 312) { return r; } if (el) { if (typeof attObj.id == UNDEF) { attObj.id = id; } if (ua.ie && ua.win) { var att = ""; for (var i in attObj) { if (attObj[i] != Object.prototype[i]) { if (i.toLowerCase() == "data") { parObj.movie = attObj[i]; } else if (i.toLowerCase() == "styleclass") { att += ' class="' + attObj[i] + '"'; } else if (i.toLowerCase() != "classid") { att += ' ' + i + '="' + attObj[i] + '"'; } } } var par = ""; for (var j in parObj) { if (parObj[j] != Object.prototype[j]) { par += ''; } } el.outerHTML = '' + par + ''; objIdArr[objIdArr.length] = attObj.id; r = getElementById(attObj.id); } else { var o = createElement(OBJECT); o.setAttribute("type", FLASH_MIME_TYPE); for (var m in attObj) { if (attObj[m] != Object.prototype[m]) { if (m.toLowerCase() == "styleclass") { o.setAttribute("class", attObj[m]); } else if (m.toLowerCase() != "classid") { o.setAttribute(m, attObj[m]); } } } for (var n in parObj) { if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { createObjParam(o, n, parObj[n]); } } el.parentNode.replaceChild(o, el); r = o; } } return r; } function createObjParam(el, pName, pValue) { var p = createElement("param"); p.setAttribute("name", pName); p.setAttribute("value", pValue); el.appendChild(p); } function removeSWF(id) { var obj = getElementById(id); if (obj && obj.nodeName == "OBJECT") { if (ua.ie && ua.win) { obj.style.display = "none"; (function(){ if (obj.readyState == 4) { removeObjectInIE(id); } else { setTimeout(arguments.callee, 10); } })(); } else { obj.parentNode.removeChild(obj); } } } function removeObjectInIE(id) { var obj = getElementById(id); if (obj) { for (var i in obj) { if (typeof obj[i] == "function") { obj[i] = null; } } obj.parentNode.removeChild(obj); } } function getElementById(id) { var el = null; try { el = doc.getElementById(id); } catch (e) {} return el; } function createElement(el) { return doc.createElement(el); } function addListener(target, eventType, fn) { target.attachEvent(eventType, fn); listenersArr[listenersArr.length] = [target, eventType, fn]; } function hasPlayerVersion(rv) { var pv = ua.pv, v = rv.split("."); v[0] = parseInt(v[0], 10); v[1] = parseInt(v[1], 10) || 0; v[2] = parseInt(v[2], 10) || 0; return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false; } function createCSS(sel, decl, media, newStyle) { if (ua.ie && ua.mac) { return; } var h = doc.getElementsByTagName("head")[0]; if (!h) { return; } var m = (media && typeof media == "string") ? media : "screen"; if (newStyle) { dynamicStylesheet = null; dynamicStylesheetMedia = null; } if (!dynamicStylesheet || dynamicStylesheetMedia != m) { var s = createElement("style"); s.setAttribute("type", "text/css"); s.setAttribute("media", m); dynamicStylesheet = h.appendChild(s); if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) { dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1]; } dynamicStylesheetMedia = m; } if (ua.ie && ua.win) { if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) { dynamicStylesheet.addRule(sel, decl); } } else { if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) { dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}")); } } } function setVisibility(id, isVisible) { if (!autoHideShow) { return; } var v = isVisible ? "visible" : "hidden"; if (isDomLoaded && getElementById(id)) { getElementById(id).style.visibility = v; } else { createCSS("#" + id, "visibility:" + v); } } function urlEncodeIfNecessary(s) { var regex = /[\\\"<>\.;]/; var hasBadChars = regex.exec(s) != null; return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s; } var cleanup = function() { if (ua.ie && ua.win) { window.attachEvent("onunload", function() { var ll = listenersArr.length; for (var i = 0; i < ll; i++) { listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]); } var il = objIdArr.length; for (var j = 0; j < il; j++) { removeSWF(objIdArr[j]); } for (var k in ua) { ua[k] = null; } ua = null; for (var l in swfobject) { swfobject[l] = null; } swfobject = null; window.detachEvent('onunload', arguments.callee); }); } }(); return { registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) { if (ua.w3 && objectIdStr && swfVersionStr) { var regObj = {}; regObj.id = objectIdStr; regObj.swfVersion = swfVersionStr; regObj.expressInstall = xiSwfUrlStr; regObj.callbackFn = callbackFn; regObjArr[regObjArr.length] = regObj; setVisibility(objectIdStr, false); } else if (callbackFn) { callbackFn({success:false, id:objectIdStr}); } }, getObjectById: function(objectIdStr) { if (ua.w3) { return getObjectById(objectIdStr); } }, embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) { var callbackObj = {success:false, id:replaceElemIdStr}; if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) { setVisibility(replaceElemIdStr, false); addDomLoadEvent(function() { widthStr += ""; heightStr += ""; var att = {}; if (attObj && typeof attObj === OBJECT) { for (var i in attObj) { att[i] = attObj[i]; } } att.data = swfUrlStr; att.width = widthStr; att.height = heightStr; var par = {}; if (parObj && typeof parObj === OBJECT) { for (var j in parObj) { par[j] = parObj[j]; } } if (flashvarsObj && typeof flashvarsObj === OBJECT) { for (var k in flashvarsObj) { if (typeof par.flashvars != UNDEF) { par.flashvars += "&" + k + "=" + flashvarsObj[k]; } else { par.flashvars = k + "=" + flashvarsObj[k]; } } } if (hasPlayerVersion(swfVersionStr)) { var obj = createSWF(att, par, replaceElemIdStr); if (att.id == replaceElemIdStr) { setVisibility(replaceElemIdStr, true); } callbackObj.success = true; callbackObj.ref = obj; } else if (xiSwfUrlStr && canExpressInstall()) { att.data = xiSwfUrlStr; showExpressInstall(att, par, replaceElemIdStr, callbackFn); return; } else { setVisibility(replaceElemIdStr, true); } if (callbackFn) { callbackFn(callbackObj); } }); } else if (callbackFn) { callbackFn(callbackObj); } }, switchOffAutoHideShow: function() { autoHideShow = false; }, ua: ua, getFlashPlayerVersion: function() { return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] }; }, hasFlashPlayerVersion: hasPlayerVersion, createSWF: function(attObj, parObj, replaceElemIdStr) { if (ua.w3) { return createSWF(attObj, parObj, replaceElemIdStr); } else { return undefined; } }, showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) { if (ua.w3 && canExpressInstall()) { showExpressInstall(att, par, replaceElemIdStr, callbackFn); } }, removeSWF: function(objElemIdStr) { if (ua.w3) { removeSWF(objElemIdStr); } }, createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) { if (ua.w3) { createCSS(selStr, declStr, mediaStr, newStyleBoolean); } }, addDomLoadEvent: addDomLoadEvent, addLoadEvent: addLoadEvent, getQueryParamValue: function(param) { var q = doc.location.search || doc.location.hash; if (q) { if (/\?/.test(q)) { q = q.split("?")[1]; } if (param == null) { return urlEncodeIfNecessary(q); } var pairs = q.split("&"); for (var i = 0; i < pairs.length; i++) { if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) { return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1))); } } } return ""; }, expressInstallCallback: function() { if (isExpressInstallActive) { var obj = getElementById(EXPRESS_INSTALL_ID); if (obj && storedAltContent) { obj.parentNode.replaceChild(storedAltContent, obj); if (storedAltContentId) { setVisibility(storedAltContentId, true); if (ua.ie && ua.win) { storedAltContent.style.display = "block"; } } if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); } } isExpressInstallActive = false; } } }; }(); Ext.FlashComponent = Ext.extend(Ext.BoxComponent, { flashVersion : '9.0.115', backgroundColor: '#ffffff', wmode: 'opaque', flashVars: undefined, flashParams: undefined, url: undefined, swfId : undefined, swfWidth: '100%', swfHeight: '100%', expressInstall: false, initComponent : function(){ Ext.FlashComponent.superclass.initComponent.call(this); this.addEvents( 'initialize' ); }, onRender : function(){ Ext.FlashComponent.superclass.onRender.apply(this, arguments); var params = Ext.apply({ allowScriptAccess: 'always', bgcolor: this.backgroundColor, wmode: this.wmode }, this.flashParams), vars = Ext.apply({ allowedDomain: document.location.hostname, YUISwfId: this.getId(), YUIBridgeCallback: 'Ext.FlashEventProxy.onEvent' }, this.flashVars); new swfobject.embedSWF(this.url, this.id, this.swfWidth, this.swfHeight, this.flashVersion, this.expressInstall ? Ext.FlashComponent.EXPRESS_INSTALL_URL : undefined, vars, params); this.swf = Ext.getDom(this.id); this.el = Ext.get(this.swf); }, getSwfId : function(){ return this.swfId || (this.swfId = "extswf" + (++Ext.Component.AUTO_ID)); }, getId : function(){ return this.id || (this.id = "extflashcmp" + (++Ext.Component.AUTO_ID)); }, onFlashEvent : function(e){ switch(e.type){ case "swfReady": this.initSwf(); return; case "log": return; } e.component = this; this.fireEvent(e.type.toLowerCase().replace(/event$/, ''), e); }, initSwf : function(){ this.onSwfReady(!!this.isInitialized); this.isInitialized = true; this.fireEvent('initialize', this); }, beforeDestroy: function(){ if(this.rendered){ swfobject.removeSWF(this.swf.id); } Ext.FlashComponent.superclass.beforeDestroy.call(this); }, onSwfReady : Ext.emptyFn }); Ext.FlashComponent.EXPRESS_INSTALL_URL = 'http:/' + '/swfobject.googlecode.com/svn/trunk/swfobject/expressInstall.swf'; Ext.reg('flash', Ext.FlashComponent); Ext.FlashEventProxy = { onEvent : function(id, e){ var fp = Ext.getCmp(id); if(fp){ fp.onFlashEvent(e); }else{ arguments.callee.defer(10, this, [id, e]); } } }; Ext.chart.Chart = Ext.extend(Ext.FlashComponent, { refreshBuffer: 100, chartStyle: { padding: 10, animationEnabled: true, font: { name: 'Tahoma', color: 0x444444, size: 11 }, dataTip: { padding: 5, border: { color: 0x99bbe8, size:1 }, background: { color: 0xDAE7F6, alpha: .9 }, font: { name: 'Tahoma', color: 0x15428B, size: 10, bold: true } } }, extraStyle: null, seriesStyles: null, disableCaching: Ext.isIE || Ext.isOpera, disableCacheParam: '_dc', initComponent : function(){ Ext.chart.Chart.superclass.initComponent.call(this); if(!this.url){ this.url = Ext.chart.Chart.CHART_URL; } if(this.disableCaching){ this.url = Ext.urlAppend(this.url, String.format('{0}={1}', this.disableCacheParam, new Date().getTime())); } this.addEvents( 'itemmouseover', 'itemmouseout', 'itemclick', 'itemdoubleclick', 'itemdragstart', 'itemdrag', 'itemdragend', 'beforerefresh', 'refresh' ); this.store = Ext.StoreMgr.lookup(this.store); }, setStyle: function(name, value){ this.swf.setStyle(name, Ext.encode(value)); }, setStyles: function(styles){ this.swf.setStyles(Ext.encode(styles)); }, setSeriesStyles: function(styles){ this.seriesStyles = styles; var s = []; Ext.each(styles, function(style){ s.push(Ext.encode(style)); }); this.swf.setSeriesStyles(s); }, setCategoryNames : function(names){ this.swf.setCategoryNames(names); }, setLegendRenderer : function(fn, scope){ var chart = this; scope = scope || chart; chart.removeFnProxy(chart.legendFnName); chart.legendFnName = chart.createFnProxy(function(name){ return fn.call(scope, name); }); chart.swf.setLegendLabelFunction(chart.legendFnName); }, setTipRenderer : function(fn, scope){ var chart = this; scope = scope || chart; chart.removeFnProxy(chart.tipFnName); chart.tipFnName = chart.createFnProxy(function(item, index, series){ var record = chart.store.getAt(index); return fn.call(scope, chart, record, index, series); }); chart.swf.setDataTipFunction(chart.tipFnName); }, setSeries : function(series){ this.series = series; this.refresh(); }, bindStore : function(store, initial){ if(!initial && this.store){ if(store !== this.store && this.store.autoDestroy){ this.store.destroy(); }else{ this.store.un("datachanged", this.refresh, this); this.store.un("add", this.delayRefresh, this); this.store.un("remove", this.delayRefresh, this); this.store.un("update", this.delayRefresh, this); this.store.un("clear", this.refresh, this); } } if(store){ store = Ext.StoreMgr.lookup(store); store.on({ scope: this, datachanged: this.refresh, add: this.delayRefresh, remove: this.delayRefresh, update: this.delayRefresh, clear: this.refresh }); } this.store = store; if(store && !initial){ this.refresh(); } }, onSwfReady : function(isReset){ Ext.chart.Chart.superclass.onSwfReady.call(this, isReset); var ref; this.swf.setType(this.type); if(this.chartStyle){ this.setStyles(Ext.apply({}, this.extraStyle, this.chartStyle)); } if(this.categoryNames){ this.setCategoryNames(this.categoryNames); } if(this.tipRenderer){ ref = this.getFunctionRef(this.tipRenderer); this.setTipRenderer(ref.fn, ref.scope); } if(this.legendRenderer){ ref = this.getFunctionRef(this.legendRenderer); this.setLegendRenderer(ref.fn, ref.scope); } if(!isReset){ this.bindStore(this.store, true); } this.refresh.defer(10, this); }, delayRefresh : function(){ if(!this.refreshTask){ this.refreshTask = new Ext.util.DelayedTask(this.refresh, this); } this.refreshTask.delay(this.refreshBuffer); }, refresh : function(){ if(this.fireEvent('beforerefresh', this) !== false){ var styleChanged = false; var data = [], rs = this.store.data.items; for(var j = 0, len = rs.length; j < len; j++){ data[j] = rs[j].data; } var dataProvider = []; var seriesCount = 0; var currentSeries = null; var i = 0; if(this.series){ seriesCount = this.series.length; for(i = 0; i < seriesCount; i++){ currentSeries = this.series[i]; var clonedSeries = {}; for(var prop in currentSeries){ if(prop == "style" && currentSeries.style !== null){ clonedSeries.style = Ext.encode(currentSeries.style); styleChanged = true; } else{ clonedSeries[prop] = currentSeries[prop]; } } dataProvider.push(clonedSeries); } } if(seriesCount > 0){ for(i = 0; i < seriesCount; i++){ currentSeries = dataProvider[i]; if(!currentSeries.type){ currentSeries.type = this.type; } currentSeries.dataProvider = data; } } else{ dataProvider.push({type: this.type, dataProvider: data}); } this.swf.setDataProvider(dataProvider); if(this.seriesStyles){ this.setSeriesStyles(this.seriesStyles); } this.fireEvent('refresh', this); } }, createFnProxy : function(fn){ var fnName = 'extFnProxy' + (++Ext.chart.Chart.PROXY_FN_ID); Ext.chart.Chart.proxyFunction[fnName] = fn; return 'Ext.chart.Chart.proxyFunction.' + fnName; }, removeFnProxy : function(fn){ if(!Ext.isEmpty(fn)){ fn = fn.replace('Ext.chart.Chart.proxyFunction.', ''); delete Ext.chart.Chart.proxyFunction[fn]; } }, getFunctionRef : function(val){ if(Ext.isFunction(val)){ return { fn: val, scope: this }; }else{ return { fn: val.fn, scope: val.scope || this }; } }, onDestroy: function(){ if (this.refreshTask && this.refreshTask.cancel){ this.refreshTask.cancel(); } Ext.chart.Chart.superclass.onDestroy.call(this); this.bindStore(null); this.removeFnProxy(this.tipFnName); this.removeFnProxy(this.legendFnName); } }); Ext.reg('chart', Ext.chart.Chart); Ext.chart.Chart.PROXY_FN_ID = 0; Ext.chart.Chart.proxyFunction = {}; Ext.chart.Chart.CHART_URL = 'http:/' + '/yui.yahooapis.com/2.8.2/build/charts/assets/charts.swf'; Ext.chart.PieChart = Ext.extend(Ext.chart.Chart, { type: 'pie', onSwfReady : function(isReset){ Ext.chart.PieChart.superclass.onSwfReady.call(this, isReset); this.setDataField(this.dataField); this.setCategoryField(this.categoryField); }, setDataField : function(field){ this.dataField = field; this.swf.setDataField(field); }, setCategoryField : function(field){ this.categoryField = field; this.swf.setCategoryField(field); } }); Ext.reg('piechart', Ext.chart.PieChart); Ext.chart.CartesianChart = Ext.extend(Ext.chart.Chart, { onSwfReady : function(isReset){ Ext.chart.CartesianChart.superclass.onSwfReady.call(this, isReset); this.labelFn = []; if(this.xField){ this.setXField(this.xField); } if(this.yField){ this.setYField(this.yField); } if(this.xAxis){ this.setXAxis(this.xAxis); } if(this.xAxes){ this.setXAxes(this.xAxes); } if(this.yAxis){ this.setYAxis(this.yAxis); } if(this.yAxes){ this.setYAxes(this.yAxes); } if(Ext.isDefined(this.constrainViewport)){ this.swf.setConstrainViewport(this.constrainViewport); } }, setXField : function(value){ this.xField = value; this.swf.setHorizontalField(value); }, setYField : function(value){ this.yField = value; this.swf.setVerticalField(value); }, setXAxis : function(value){ this.xAxis = this.createAxis('xAxis', value); this.swf.setHorizontalAxis(this.xAxis); }, setXAxes : function(value){ var axis; for(var i = 0; i < value.length; i++) { axis = this.createAxis('xAxis' + i, value[i]); this.swf.setHorizontalAxis(axis); } }, setYAxis : function(value){ this.yAxis = this.createAxis('yAxis', value); this.swf.setVerticalAxis(this.yAxis); }, setYAxes : function(value){ var axis; for(var i = 0; i < value.length; i++) { axis = this.createAxis('yAxis' + i, value[i]); this.swf.setVerticalAxis(axis); } }, createAxis : function(axis, value){ var o = Ext.apply({}, value), ref, old; if(this[axis]){ old = this[axis].labelFunction; this.removeFnProxy(old); this.labelFn.remove(old); } if(o.labelRenderer){ ref = this.getFunctionRef(o.labelRenderer); o.labelFunction = this.createFnProxy(function(v){ return ref.fn.call(ref.scope, v); }); delete o.labelRenderer; this.labelFn.push(o.labelFunction); } if(axis.indexOf('xAxis') > -1 && o.position == 'left'){ o.position = 'bottom'; } return o; }, onDestroy : function(){ Ext.chart.CartesianChart.superclass.onDestroy.call(this); Ext.each(this.labelFn, function(fn){ this.removeFnProxy(fn); }, this); } }); Ext.reg('cartesianchart', Ext.chart.CartesianChart); Ext.chart.LineChart = Ext.extend(Ext.chart.CartesianChart, { type: 'line' }); Ext.reg('linechart', Ext.chart.LineChart); Ext.chart.ColumnChart = Ext.extend(Ext.chart.CartesianChart, { type: 'column' }); Ext.reg('columnchart', Ext.chart.ColumnChart); Ext.chart.StackedColumnChart = Ext.extend(Ext.chart.CartesianChart, { type: 'stackcolumn' }); Ext.reg('stackedcolumnchart', Ext.chart.StackedColumnChart); Ext.chart.BarChart = Ext.extend(Ext.chart.CartesianChart, { type: 'bar' }); Ext.reg('barchart', Ext.chart.BarChart); Ext.chart.StackedBarChart = Ext.extend(Ext.chart.CartesianChart, { type: 'stackbar' }); Ext.reg('stackedbarchart', Ext.chart.StackedBarChart); Ext.chart.Axis = function(config){ Ext.apply(this, config); }; Ext.chart.Axis.prototype = { type: null, orientation: "horizontal", reverse: false, labelFunction: null, hideOverlappingLabels: true, labelSpacing: 2 }; Ext.chart.NumericAxis = Ext.extend(Ext.chart.Axis, { type: "numeric", minimum: NaN, maximum: NaN, majorUnit: NaN, minorUnit: NaN, snapToUnits: true, alwaysShowZero: true, scale: "linear", roundMajorUnit: true, calculateByLabelSize: true, position: 'left', adjustMaximumByMajorUnit: true, adjustMinimumByMajorUnit: true }); Ext.chart.TimeAxis = Ext.extend(Ext.chart.Axis, { type: "time", minimum: null, maximum: null, majorUnit: NaN, majorTimeUnit: null, minorUnit: NaN, minorTimeUnit: null, snapToUnits: true, stackingEnabled: false, calculateByLabelSize: true }); Ext.chart.CategoryAxis = Ext.extend(Ext.chart.Axis, { type: "category", categoryNames: null, calculateCategoryCount: false }); Ext.chart.Series = function(config) { Ext.apply(this, config); }; Ext.chart.Series.prototype = { type: null, displayName: null }; Ext.chart.CartesianSeries = Ext.extend(Ext.chart.Series, { xField: null, yField: null, showInLegend: true, axis: 'primary' }); Ext.chart.ColumnSeries = Ext.extend(Ext.chart.CartesianSeries, { type: "column" }); Ext.chart.LineSeries = Ext.extend(Ext.chart.CartesianSeries, { type: "line" }); Ext.chart.BarSeries = Ext.extend(Ext.chart.CartesianSeries, { type: "bar" }); Ext.chart.PieSeries = Ext.extend(Ext.chart.Series, { type: "pie", dataField: null, categoryField: null }); Ext.menu.Menu = Ext.extend(Ext.Container, { minWidth : 120, shadow : 'sides', subMenuAlign : 'tl-tr?', defaultAlign : 'tl-bl?', allowOtherMenus : false, ignoreParentClicks : false, enableScrolling : true, maxHeight : null, scrollIncrement : 24, showSeparator : true, defaultOffsets : [0, 0], plain : false, floating : true, zIndex: 15000, hidden : true, layout : 'menu', hideMode : 'offsets', scrollerHeight : 8, autoLayout : true, defaultType : 'menuitem', bufferResize : false, initComponent : function(){ if(Ext.isArray(this.initialConfig)){ Ext.apply(this, {items:this.initialConfig}); } this.addEvents( 'click', 'mouseover', 'mouseout', 'itemclick' ); Ext.menu.MenuMgr.register(this); if(this.floating){ Ext.EventManager.onWindowResize(this.hide, this); }else{ if(this.initialConfig.hidden !== false){ this.hidden = false; } this.internalDefaults = {hideOnClick: false}; } Ext.menu.Menu.superclass.initComponent.call(this); if(this.autoLayout){ var fn = this.doLayout.createDelegate(this, []); this.on({ add: fn, remove: fn }); } }, getLayoutTarget : function() { return this.ul; }, onRender : function(ct, position){ if(!ct){ ct = Ext.getBody(); } var dh = { id: this.getId(), cls: 'x-menu ' + ((this.floating) ? 'x-menu-floating x-layer ' : '') + (this.cls || '') + (this.plain ? ' x-menu-plain' : '') + (this.showSeparator ? '' : ' x-menu-nosep'), style: this.style, cn: [ {tag: 'a', cls: 'x-menu-focus', href: '#', onclick: 'return false;', tabIndex: '-1'}, {tag: 'ul', cls: 'x-menu-list'} ] }; if(this.floating){ this.el = new Ext.Layer({ shadow: this.shadow, dh: dh, constrain: false, parentEl: ct, zindex: this.zIndex }); }else{ this.el = ct.createChild(dh); } Ext.menu.Menu.superclass.onRender.call(this, ct, position); if(!this.keyNav){ this.keyNav = new Ext.menu.MenuNav(this); } this.focusEl = this.el.child('a.x-menu-focus'); this.ul = this.el.child('ul.x-menu-list'); this.mon(this.ul, { scope: this, click: this.onClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut }); if(this.enableScrolling){ this.mon(this.el, { scope: this, delegate: '.x-menu-scroller', click: this.onScroll, mouseover: this.deactivateActive }); } }, findTargetItem : function(e){ var t = e.getTarget('.x-menu-list-item', this.ul, true); if(t && t.menuItemId){ return this.items.get(t.menuItemId); } }, onClick : function(e){ var t = this.findTargetItem(e); if(t){ if(t.isFormField){ this.setActiveItem(t); }else if(t instanceof Ext.menu.BaseItem){ if(t.menu && this.ignoreParentClicks){ t.expandMenu(); e.preventDefault(); }else if(t.onClick){ t.onClick(e); this.fireEvent('click', this, t, e); } } } }, setActiveItem : function(item, autoExpand){ if(item != this.activeItem){ this.deactivateActive(); if((this.activeItem = item).isFormField){ item.focus(); }else{ item.activate(autoExpand); } }else if(autoExpand){ item.expandMenu(); } }, deactivateActive : function(){ var a = this.activeItem; if(a){ if(a.isFormField){ if(a.collapse){ a.collapse(); } }else{ a.deactivate(); } delete this.activeItem; } }, tryActivate : function(start, step){ var items = this.items; for(var i = start, len = items.length; i >= 0 && i < len; i+= step){ var item = items.get(i); if(item.isVisible() && !item.disabled && (item.canActivate || item.isFormField)){ this.setActiveItem(item, false); return item; } } return false; }, onMouseOver : function(e){ var t = this.findTargetItem(e); if(t){ if(t.canActivate && !t.disabled){ this.setActiveItem(t, true); } } this.over = true; this.fireEvent('mouseover', this, e, t); }, onMouseOut : function(e){ var t = this.findTargetItem(e); if(t){ if(t == this.activeItem && t.shouldDeactivate && t.shouldDeactivate(e)){ this.activeItem.deactivate(); delete this.activeItem; } } this.over = false; this.fireEvent('mouseout', this, e, t); }, onScroll : function(e, t){ if(e){ e.stopEvent(); } var ul = this.ul.dom, top = Ext.fly(t).is('.x-menu-scroller-top'); ul.scrollTop += this.scrollIncrement * (top ? -1 : 1); if(top ? ul.scrollTop <= 0 : ul.scrollTop + this.activeMax >= ul.scrollHeight){ this.onScrollerOut(null, t); } }, onScrollerIn : function(e, t){ var ul = this.ul.dom, top = Ext.fly(t).is('.x-menu-scroller-top'); if(top ? ul.scrollTop > 0 : ul.scrollTop + this.activeMax < ul.scrollHeight){ Ext.fly(t).addClass(['x-menu-item-active', 'x-menu-scroller-active']); } }, onScrollerOut : function(e, t){ Ext.fly(t).removeClass(['x-menu-item-active', 'x-menu-scroller-active']); }, show : function(el, pos, parentMenu){ if(this.floating){ this.parentMenu = parentMenu; if(!this.el){ this.render(); this.doLayout(false, true); } this.showAt(this.el.getAlignToXY(el, pos || this.defaultAlign, this.defaultOffsets), parentMenu); }else{ Ext.menu.Menu.superclass.show.call(this); } }, showAt : function(xy, parentMenu){ if(this.fireEvent('beforeshow', this) !== false){ this.parentMenu = parentMenu; if(!this.el){ this.render(); } if(this.enableScrolling){ this.el.setXY(xy); xy[1] = this.constrainScroll(xy[1]); xy = [this.el.adjustForConstraints(xy)[0], xy[1]]; }else{ xy = this.el.adjustForConstraints(xy); } this.el.setXY(xy); this.el.show(); Ext.menu.Menu.superclass.onShow.call(this); if(Ext.isIE){ this.fireEvent('autosize', this); if(!Ext.isIE8){ this.el.repaint(); } } this.hidden = false; this.focus(); this.fireEvent('show', this); } }, constrainScroll : function(y){ var max, full = this.ul.setHeight('auto').getHeight(), returnY = y, normalY, parentEl, scrollTop, viewHeight; if(this.floating){ parentEl = Ext.fly(this.el.dom.parentNode); scrollTop = parentEl.getScroll().top; viewHeight = parentEl.getViewSize().height; normalY = y - scrollTop; max = this.maxHeight ? this.maxHeight : viewHeight - normalY; if(full > viewHeight) { max = viewHeight; returnY = y - normalY; } else if(max < full) { returnY = y - (full - max); max = full; } }else{ max = this.getHeight(); } if (this.maxHeight){ max = Math.min(this.maxHeight, max); } if(full > max && max > 0){ this.activeMax = max - this.scrollerHeight * 2 - this.el.getFrameWidth('tb') - Ext.num(this.el.shadowOffset, 0); this.ul.setHeight(this.activeMax); this.createScrollers(); this.el.select('.x-menu-scroller').setDisplayed(''); }else{ this.ul.setHeight(full); this.el.select('.x-menu-scroller').setDisplayed('none'); } this.ul.dom.scrollTop = 0; return returnY; }, createScrollers : function(){ if(!this.scroller){ this.scroller = { pos: 0, top: this.el.insertFirst({ tag: 'div', cls: 'x-menu-scroller x-menu-scroller-top', html: ' ' }), bottom: this.el.createChild({ tag: 'div', cls: 'x-menu-scroller x-menu-scroller-bottom', html: ' ' }) }; this.scroller.top.hover(this.onScrollerIn, this.onScrollerOut, this); this.scroller.topRepeater = new Ext.util.ClickRepeater(this.scroller.top, { listeners: { click: this.onScroll.createDelegate(this, [null, this.scroller.top], false) } }); this.scroller.bottom.hover(this.onScrollerIn, this.onScrollerOut, this); this.scroller.bottomRepeater = new Ext.util.ClickRepeater(this.scroller.bottom, { listeners: { click: this.onScroll.createDelegate(this, [null, this.scroller.bottom], false) } }); } }, onLayout : function(){ if(this.isVisible()){ if(this.enableScrolling){ this.constrainScroll(this.el.getTop()); } if(this.floating){ this.el.sync(); } } }, focus : function(){ if(!this.hidden){ this.doFocus.defer(50, this); } }, doFocus : function(){ if(!this.hidden){ this.focusEl.focus(); } }, hide : function(deep){ if (!this.isDestroyed) { this.deepHide = deep; Ext.menu.Menu.superclass.hide.call(this); delete this.deepHide; } }, onHide : function(){ Ext.menu.Menu.superclass.onHide.call(this); this.deactivateActive(); if(this.el && this.floating){ this.el.hide(); } var pm = this.parentMenu; if(this.deepHide === true && pm){ if(pm.floating){ pm.hide(true); }else{ pm.deactivateActive(); } } }, lookupComponent : function(c){ if(Ext.isString(c)){ c = (c == 'separator' || c == '-') ? new Ext.menu.Separator() : new Ext.menu.TextItem(c); this.applyDefaults(c); }else{ if(Ext.isObject(c)){ c = this.getMenuItem(c); }else if(c.tagName || c.el){ c = new Ext.BoxComponent({ el: c }); } } return c; }, applyDefaults : function(c) { if (!Ext.isString(c)) { c = Ext.menu.Menu.superclass.applyDefaults.call(this, c); var d = this.internalDefaults; if(d){ if(c.events){ Ext.applyIf(c.initialConfig, d); Ext.apply(c, d); }else{ Ext.applyIf(c, d); } } } return c; }, getMenuItem : function(config) { config.ownerCt = this; if (!config.isXType) { if (!config.xtype && Ext.isBoolean(config.checked)) { return new Ext.menu.CheckItem(config); } return Ext.create(config, this.defaultType); } return config; }, addSeparator : function() { return this.add(new Ext.menu.Separator()); }, addElement : function(el) { return this.add(new Ext.menu.BaseItem({ el: el })); }, addItem : function(item) { return this.add(item); }, addMenuItem : function(config) { return this.add(this.getMenuItem(config)); }, addText : function(text){ return this.add(new Ext.menu.TextItem(text)); }, onDestroy : function(){ Ext.EventManager.removeResizeListener(this.hide, this); var pm = this.parentMenu; if(pm && pm.activeChild == this){ delete pm.activeChild; } delete this.parentMenu; Ext.menu.Menu.superclass.onDestroy.call(this); Ext.menu.MenuMgr.unregister(this); if(this.keyNav) { this.keyNav.disable(); } var s = this.scroller; if(s){ Ext.destroy(s.topRepeater, s.bottomRepeater, s.top, s.bottom); } Ext.destroy( this.el, this.focusEl, this.ul ); } }); Ext.reg('menu', Ext.menu.Menu); Ext.menu.MenuNav = Ext.extend(Ext.KeyNav, function(){ function up(e, m){ if(!m.tryActivate(m.items.indexOf(m.activeItem)-1, -1)){ m.tryActivate(m.items.length-1, -1); } } function down(e, m){ if(!m.tryActivate(m.items.indexOf(m.activeItem)+1, 1)){ m.tryActivate(0, 1); } } return { constructor : function(menu){ Ext.menu.MenuNav.superclass.constructor.call(this, menu.el); this.scope = this.menu = menu; }, doRelay : function(e, h){ var k = e.getKey(); if (this.menu.activeItem && this.menu.activeItem.isFormField && k != e.TAB) { return false; } if(!this.menu.activeItem && e.isNavKeyPress() && k != e.SPACE && k != e.RETURN){ this.menu.tryActivate(0, 1); return false; } return h.call(this.scope || this, e, this.menu); }, tab: function(e, m) { e.stopEvent(); if (e.shiftKey) { up(e, m); } else { down(e, m); } }, up : up, down : down, right : function(e, m){ if(m.activeItem){ m.activeItem.expandMenu(true); } }, left : function(e, m){ m.hide(); if(m.parentMenu && m.parentMenu.activeItem){ m.parentMenu.activeItem.activate(); } }, enter : function(e, m){ if(m.activeItem){ e.stopPropagation(); m.activeItem.onClick(e); m.fireEvent('click', this, m.activeItem); return true; } } }; }()); Ext.menu.MenuMgr = function(){ var menus, active, map, groups = {}, attached = false, lastShow = new Date(); function init(){ menus = {}; active = new Ext.util.MixedCollection(); map = Ext.getDoc().addKeyListener(27, hideAll); map.disable(); } function hideAll(){ if(active && active.length > 0){ var c = active.clone(); c.each(function(m){ m.hide(); }); return true; } return false; } function onHide(m){ active.remove(m); if(active.length < 1){ map.disable(); Ext.getDoc().un("mousedown", onMouseDown); attached = false; } } function onShow(m){ var last = active.last(); lastShow = new Date(); active.add(m); if(!attached){ map.enable(); Ext.getDoc().on("mousedown", onMouseDown); attached = true; } if(m.parentMenu){ m.getEl().setZIndex(parseInt(m.parentMenu.getEl().getStyle("z-index"), 10) + 3); m.parentMenu.activeChild = m; }else if(last && !last.isDestroyed && last.isVisible()){ m.getEl().setZIndex(parseInt(last.getEl().getStyle("z-index"), 10) + 3); } } function onBeforeHide(m){ if(m.activeChild){ m.activeChild.hide(); } if(m.autoHideTimer){ clearTimeout(m.autoHideTimer); delete m.autoHideTimer; } } function onBeforeShow(m){ var pm = m.parentMenu; if(!pm && !m.allowOtherMenus){ hideAll(); }else if(pm && pm.activeChild){ pm.activeChild.hide(); } } function onMouseDown(e){ if(lastShow.getElapsed() > 50 && active.length > 0 && !e.getTarget(".x-menu")){ hideAll(); } } return { hideAll : function(){ return hideAll(); }, register : function(menu){ if(!menus){ init(); } menus[menu.id] = menu; menu.on({ beforehide: onBeforeHide, hide: onHide, beforeshow: onBeforeShow, show: onShow }); }, get : function(menu){ if(typeof menu == "string"){ if(!menus){ return null; } return menus[menu]; }else if(menu.events){ return menu; }else if(typeof menu.length == 'number'){ return new Ext.menu.Menu({items:menu}); }else{ return Ext.create(menu, 'menu'); } }, unregister : function(menu){ delete menus[menu.id]; menu.un("beforehide", onBeforeHide); menu.un("hide", onHide); menu.un("beforeshow", onBeforeShow); menu.un("show", onShow); }, registerCheckable : function(menuItem){ var g = menuItem.group; if(g){ if(!groups[g]){ groups[g] = []; } groups[g].push(menuItem); } }, unregisterCheckable : function(menuItem){ var g = menuItem.group; if(g){ groups[g].remove(menuItem); } }, onCheckChange: function(item, state){ if(item.group && state){ var group = groups[item.group], i = 0, len = group.length, current; for(; i < len; i++){ current = group[i]; if(current != item){ current.setChecked(false); } } } }, getCheckedItem : function(groupId){ var g = groups[groupId]; if(g){ for(var i = 0, l = g.length; i < l; i++){ if(g[i].checked){ return g[i]; } } } return null; }, setCheckedItem : function(groupId, itemId){ var g = groups[groupId]; if(g){ for(var i = 0, l = g.length; i < l; i++){ if(g[i].id == itemId){ g[i].setChecked(true); } } } return null; } }; }(); Ext.menu.BaseItem = Ext.extend(Ext.Component, { canActivate : false, activeClass : "x-menu-item-active", hideOnClick : true, clickHideDelay : 1, ctype : "Ext.menu.BaseItem", actionMode : "container", initComponent : function(){ Ext.menu.BaseItem.superclass.initComponent.call(this); this.addEvents( 'click', 'activate', 'deactivate' ); if(this.handler){ this.on("click", this.handler, this.scope); } }, onRender : function(container, position){ Ext.menu.BaseItem.superclass.onRender.apply(this, arguments); if(this.ownerCt && this.ownerCt instanceof Ext.menu.Menu){ this.parentMenu = this.ownerCt; }else{ this.container.addClass('x-menu-list-item'); this.mon(this.el, { scope: this, click: this.onClick, mouseenter: this.activate, mouseleave: this.deactivate }); } }, setHandler : function(handler, scope){ if(this.handler){ this.un("click", this.handler, this.scope); } this.on("click", this.handler = handler, this.scope = scope); }, onClick : function(e){ if(!this.disabled && this.fireEvent("click", this, e) !== false && (this.parentMenu && this.parentMenu.fireEvent("itemclick", this, e) !== false)){ this.handleClick(e); }else{ e.stopEvent(); } }, activate : function(){ if(this.disabled){ return false; } var li = this.container; li.addClass(this.activeClass); this.region = li.getRegion().adjust(2, 2, -2, -2); this.fireEvent("activate", this); return true; }, deactivate : function(){ this.container.removeClass(this.activeClass); this.fireEvent("deactivate", this); }, shouldDeactivate : function(e){ return !this.region || !this.region.contains(e.getPoint()); }, handleClick : function(e){ var pm = this.parentMenu; if(this.hideOnClick){ if(pm.floating){ this.clickHideDelayTimer = pm.hide.defer(this.clickHideDelay, pm, [true]); }else{ pm.deactivateActive(); } } }, beforeDestroy: function(){ clearTimeout(this.clickHideDelayTimer); Ext.menu.BaseItem.superclass.beforeDestroy.call(this); }, expandMenu : Ext.emptyFn, hideMenu : Ext.emptyFn }); Ext.reg('menubaseitem', Ext.menu.BaseItem); Ext.menu.TextItem = Ext.extend(Ext.menu.BaseItem, { hideOnClick : false, itemCls : "x-menu-text", constructor : function(config) { if (typeof config == 'string') { config = { text: config }; } Ext.menu.TextItem.superclass.constructor.call(this, config); }, onRender : function() { var s = document.createElement("span"); s.className = this.itemCls; s.innerHTML = this.text; this.el = s; Ext.menu.TextItem.superclass.onRender.apply(this, arguments); } }); Ext.reg('menutextitem', Ext.menu.TextItem); Ext.menu.Separator = Ext.extend(Ext.menu.BaseItem, { itemCls : "x-menu-sep", hideOnClick : false, activeClass: '', onRender : function(li){ var s = document.createElement("span"); s.className = this.itemCls; s.innerHTML = " "; this.el = s; li.addClass("x-menu-sep-li"); Ext.menu.Separator.superclass.onRender.apply(this, arguments); } }); Ext.reg('menuseparator', Ext.menu.Separator); Ext.menu.Item = Ext.extend(Ext.menu.BaseItem, { itemCls : 'x-menu-item', canActivate : true, showDelay: 200, altText: '', hideDelay: 200, ctype: 'Ext.menu.Item', initComponent : function(){ Ext.menu.Item.superclass.initComponent.call(this); if(this.menu){ if (Ext.isArray(this.menu)){ this.menu = { items: this.menu }; } if (Ext.isObject(this.menu)){ this.menu.ownerCt = this; } this.menu = Ext.menu.MenuMgr.get(this.menu); this.menu.ownerCt = undefined; } }, onRender : function(container, position){ if (!this.itemTpl) { this.itemTpl = Ext.menu.Item.prototype.itemTpl = new Ext.XTemplate( '', ' target="{hrefTarget}"', '', '>', '{altText}', '{text}', '' ); } var a = this.getTemplateArgs(); this.el = position ? this.itemTpl.insertBefore(position, a, true) : this.itemTpl.append(container, a, true); this.iconEl = this.el.child('img.x-menu-item-icon'); this.textEl = this.el.child('.x-menu-item-text'); if(!this.href) { this.mon(this.el, 'click', Ext.emptyFn, null, { preventDefault: true }); } Ext.menu.Item.superclass.onRender.call(this, container, position); }, getTemplateArgs: function() { return { id: this.id, cls: this.itemCls + (this.menu ? ' x-menu-item-arrow' : '') + (this.cls ? ' ' + this.cls : ''), href: this.href || '#', hrefTarget: this.hrefTarget, icon: this.icon || Ext.BLANK_IMAGE_URL, iconCls: this.iconCls || '', text: this.itemText||this.text||' ', altText: this.altText || '' }; }, setText : function(text){ this.text = text||' '; if(this.rendered){ this.textEl.update(this.text); this.parentMenu.layout.doAutoSize(); } }, setIconClass : function(cls){ var oldCls = this.iconCls; this.iconCls = cls; if(this.rendered){ this.iconEl.replaceClass(oldCls, this.iconCls); } }, beforeDestroy: function(){ clearTimeout(this.showTimer); clearTimeout(this.hideTimer); if (this.menu){ delete this.menu.ownerCt; this.menu.destroy(); } Ext.menu.Item.superclass.beforeDestroy.call(this); }, handleClick : function(e){ if(!this.href){ e.stopEvent(); } Ext.menu.Item.superclass.handleClick.apply(this, arguments); }, activate : function(autoExpand){ if(Ext.menu.Item.superclass.activate.apply(this, arguments)){ this.focus(); if(autoExpand){ this.expandMenu(); } } return true; }, shouldDeactivate : function(e){ if(Ext.menu.Item.superclass.shouldDeactivate.call(this, e)){ if(this.menu && this.menu.isVisible()){ return !this.menu.getEl().getRegion().contains(e.getPoint()); } return true; } return false; }, deactivate : function(){ Ext.menu.Item.superclass.deactivate.apply(this, arguments); this.hideMenu(); }, expandMenu : function(autoActivate){ if(!this.disabled && this.menu){ clearTimeout(this.hideTimer); delete this.hideTimer; if(!this.menu.isVisible() && !this.showTimer){ this.showTimer = this.deferExpand.defer(this.showDelay, this, [autoActivate]); }else if (this.menu.isVisible() && autoActivate){ this.menu.tryActivate(0, 1); } } }, deferExpand : function(autoActivate){ delete this.showTimer; this.menu.show(this.container, this.parentMenu.subMenuAlign || 'tl-tr?', this.parentMenu); if(autoActivate){ this.menu.tryActivate(0, 1); } }, hideMenu : function(){ clearTimeout(this.showTimer); delete this.showTimer; if(!this.hideTimer && this.menu && this.menu.isVisible()){ this.hideTimer = this.deferHide.defer(this.hideDelay, this); } }, deferHide : function(){ delete this.hideTimer; if(this.menu.over){ this.parentMenu.setActiveItem(this, false); }else{ this.menu.hide(); } } }); Ext.reg('menuitem', Ext.menu.Item); Ext.menu.CheckItem = Ext.extend(Ext.menu.Item, { itemCls : "x-menu-item x-menu-check-item", groupClass : "x-menu-group-item", checked: false, ctype: "Ext.menu.CheckItem", initComponent : function(){ Ext.menu.CheckItem.superclass.initComponent.call(this); this.addEvents( "beforecheckchange" , "checkchange" ); if(this.checkHandler){ this.on('checkchange', this.checkHandler, this.scope); } Ext.menu.MenuMgr.registerCheckable(this); }, onRender : function(c){ Ext.menu.CheckItem.superclass.onRender.apply(this, arguments); if(this.group){ this.el.addClass(this.groupClass); } if(this.checked){ this.checked = false; this.setChecked(true, true); } }, destroy : function(){ Ext.menu.MenuMgr.unregisterCheckable(this); Ext.menu.CheckItem.superclass.destroy.apply(this, arguments); }, setChecked : function(state, suppressEvent){ var suppress = suppressEvent === true; if(this.checked != state && (suppress || this.fireEvent("beforecheckchange", this, state) !== false)){ Ext.menu.MenuMgr.onCheckChange(this, state); if(this.container){ this.container[state ? "addClass" : "removeClass"]("x-menu-item-checked"); } this.checked = state; if(!suppress){ this.fireEvent("checkchange", this, state); } } }, handleClick : function(e){ if(!this.disabled && !(this.checked && this.group)){ this.setChecked(!this.checked); } Ext.menu.CheckItem.superclass.handleClick.apply(this, arguments); } }); Ext.reg('menucheckitem', Ext.menu.CheckItem); Ext.menu.DateMenu = Ext.extend(Ext.menu.Menu, { enableScrolling : false, hideOnClick : true, pickerId : null, cls : 'x-date-menu', initComponent : function(){ this.on('beforeshow', this.onBeforeShow, this); if(this.strict = (Ext.isIE7 && Ext.isStrict)){ this.on('show', this.onShow, this, {single: true, delay: 20}); } Ext.apply(this, { plain: true, showSeparator: false, items: this.picker = new Ext.DatePicker(Ext.applyIf({ internalRender: this.strict || !Ext.isIE, ctCls: 'x-menu-date-item', id: this.pickerId }, this.initialConfig)) }); this.picker.purgeListeners(); Ext.menu.DateMenu.superclass.initComponent.call(this); this.relayEvents(this.picker, ['select']); this.on('show', this.picker.focus, this.picker); this.on('select', this.menuHide, this); if(this.handler){ this.on('select', this.handler, this.scope || this); } }, menuHide : function() { if(this.hideOnClick){ this.hide(true); } }, onBeforeShow : function(){ if(this.picker){ this.picker.hideMonthPicker(true); } }, onShow : function(){ var el = this.picker.getEl(); el.setWidth(el.getWidth()); } }); Ext.reg('datemenu', Ext.menu.DateMenu); Ext.menu.ColorMenu = Ext.extend(Ext.menu.Menu, { enableScrolling : false, hideOnClick : true, cls : 'x-color-menu', paletteId : null, initComponent : function(){ Ext.apply(this, { plain: true, showSeparator: false, items: this.palette = new Ext.ColorPalette(Ext.applyIf({ id: this.paletteId }, this.initialConfig)) }); this.palette.purgeListeners(); Ext.menu.ColorMenu.superclass.initComponent.call(this); this.relayEvents(this.palette, ['select']); this.on('select', this.menuHide, this); if(this.handler){ this.on('select', this.handler, this.scope || this); } }, menuHide : function(){ if(this.hideOnClick){ this.hide(true); } } }); Ext.reg('colormenu', Ext.menu.ColorMenu); Ext.form.Field = Ext.extend(Ext.BoxComponent, { invalidClass : 'x-form-invalid', invalidText : 'The value in this field is invalid', focusClass : 'x-form-focus', validationEvent : 'keyup', validateOnBlur : true, validationDelay : 250, defaultAutoCreate : {tag: 'input', type: 'text', size: '20', autocomplete: 'off'}, fieldClass : 'x-form-field', msgTarget : 'qtip', msgFx : 'normal', readOnly : false, disabled : false, submitValue: true, isFormField : true, msgDisplay: '', hasFocus : false, initComponent : function(){ Ext.form.Field.superclass.initComponent.call(this); this.addEvents( 'focus', 'blur', 'specialkey', 'change', 'invalid', 'valid' ); }, getName : function(){ return this.rendered && this.el.dom.name ? this.el.dom.name : this.name || this.id || ''; }, onRender : function(ct, position){ if(!this.el){ var cfg = this.getAutoCreate(); if(!cfg.name){ cfg.name = this.name || this.id; } if(this.inputType){ cfg.type = this.inputType; } this.autoEl = cfg; } Ext.form.Field.superclass.onRender.call(this, ct, position); if(this.submitValue === false){ this.el.dom.removeAttribute('name'); } var type = this.el.dom.type; if(type){ if(type == 'password'){ type = 'text'; } this.el.addClass('x-form-'+type); } if(this.readOnly){ this.setReadOnly(true); } if(this.tabIndex !== undefined){ this.el.dom.setAttribute('tabIndex', this.tabIndex); } this.el.addClass([this.fieldClass, this.cls]); }, getItemCt : function(){ return this.itemCt; }, initValue : function(){ if(this.value !== undefined){ this.setValue(this.value); }else if(!Ext.isEmpty(this.el.dom.value) && this.el.dom.value != this.emptyText){ this.setValue(this.el.dom.value); } this.originalValue = this.getValue(); }, isDirty : function() { if(this.disabled || !this.rendered) { return false; } return String(this.getValue()) !== String(this.originalValue); }, setReadOnly : function(readOnly){ if(this.rendered){ this.el.dom.readOnly = readOnly; } this.readOnly = readOnly; }, afterRender : function(){ Ext.form.Field.superclass.afterRender.call(this); this.initEvents(); this.initValue(); }, fireKey : function(e){ if(e.isSpecialKey()){ this.fireEvent('specialkey', this, e); } }, reset : function(){ this.setValue(this.originalValue); this.clearInvalid(); }, initEvents : function(){ this.mon(this.el, Ext.EventManager.getKeyEvent(), this.fireKey, this); this.mon(this.el, 'focus', this.onFocus, this); this.mon(this.el, 'blur', this.onBlur, this, this.inEditor ? {buffer:10} : null); }, preFocus: Ext.emptyFn, onFocus : function(){ this.preFocus(); if(this.focusClass){ this.el.addClass(this.focusClass); } if(!this.hasFocus){ this.hasFocus = true; this.startValue = this.getValue(); this.fireEvent('focus', this); } }, beforeBlur : Ext.emptyFn, onBlur : function(){ this.beforeBlur(); if(this.focusClass){ this.el.removeClass(this.focusClass); } this.hasFocus = false; if(this.validationEvent !== false && (this.validateOnBlur || this.validationEvent == 'blur')){ this.validate(); } var v = this.getValue(); if(String(v) !== String(this.startValue)){ this.fireEvent('change', this, v, this.startValue); } this.fireEvent('blur', this); this.postBlur(); }, postBlur : Ext.emptyFn, isValid : function(preventMark){ if(this.disabled){ return true; } var restore = this.preventMark; this.preventMark = preventMark === true; var v = this.validateValue(this.processValue(this.getRawValue()), preventMark); this.preventMark = restore; return v; }, validate : function(){ if(this.disabled || this.validateValue(this.processValue(this.getRawValue()))){ this.clearInvalid(); return true; } return false; }, processValue : function(value){ return value; }, validateValue : function(value) { var error = this.getErrors(value)[0]; if (error == undefined) { return true; } else { this.markInvalid(error); return false; } }, getErrors: function() { return []; }, getActiveError : function(){ return this.activeError || ''; }, markInvalid : function(msg){ if (this.rendered && !this.preventMark) { msg = msg || this.invalidText; var mt = this.getMessageHandler(); if(mt){ mt.mark(this, msg); }else if(this.msgTarget){ this.el.addClass(this.invalidClass); var t = Ext.getDom(this.msgTarget); if(t){ t.innerHTML = msg; t.style.display = this.msgDisplay; } } } this.setActiveError(msg); }, clearInvalid : function(){ if (this.rendered && !this.preventMark) { this.el.removeClass(this.invalidClass); var mt = this.getMessageHandler(); if(mt){ mt.clear(this); }else if(this.msgTarget){ this.el.removeClass(this.invalidClass); var t = Ext.getDom(this.msgTarget); if(t){ t.innerHTML = ''; t.style.display = 'none'; } } } this.unsetActiveError(); }, setActiveError: function(msg, suppressEvent) { this.activeError = msg; if (suppressEvent !== true) this.fireEvent('invalid', this, msg); }, unsetActiveError: function(suppressEvent) { delete this.activeError; if (suppressEvent !== true) this.fireEvent('valid', this); }, getMessageHandler : function(){ return Ext.form.MessageTargets[this.msgTarget]; }, getErrorCt : function(){ return this.el.findParent('.x-form-element', 5, true) || this.el.findParent('.x-form-field-wrap', 5, true); }, alignErrorEl : function(){ this.errorEl.setWidth(this.getErrorCt().getWidth(true) - 20); }, alignErrorIcon : function(){ this.errorIcon.alignTo(this.el, 'tl-tr', [2, 0]); }, getRawValue : function(){ var v = this.rendered ? this.el.getValue() : Ext.value(this.value, ''); if(v === this.emptyText){ v = ''; } return v; }, getValue : function(){ if(!this.rendered) { return this.value; } var v = this.el.getValue(); if(v === this.emptyText || v === undefined){ v = ''; } return v; }, setRawValue : function(v){ return this.rendered ? (this.el.dom.value = (Ext.isEmpty(v) ? '' : v)) : ''; }, setValue : function(v){ this.value = v; if(this.rendered){ this.el.dom.value = (Ext.isEmpty(v) ? '' : v); this.validate(); } return this; }, append : function(v){ this.setValue([this.getValue(), v].join('')); } }); Ext.form.MessageTargets = { 'qtip' : { mark: function(field, msg){ field.el.addClass(field.invalidClass); field.el.dom.qtip = msg; field.el.dom.qclass = 'x-form-invalid-tip'; if(Ext.QuickTips){ Ext.QuickTips.enable(); } }, clear: function(field){ field.el.removeClass(field.invalidClass); field.el.dom.qtip = ''; } }, 'title' : { mark: function(field, msg){ field.el.addClass(field.invalidClass); field.el.dom.title = msg; }, clear: function(field){ field.el.dom.title = ''; } }, 'under' : { mark: function(field, msg){ field.el.addClass(field.invalidClass); if(!field.errorEl){ var elp = field.getErrorCt(); if(!elp){ field.el.dom.title = msg; return; } field.errorEl = elp.createChild({cls:'x-form-invalid-msg'}); field.on('resize', field.alignErrorEl, field); field.on('destroy', function(){ Ext.destroy(this.errorEl); }, field); } field.alignErrorEl(); field.errorEl.update(msg); Ext.form.Field.msgFx[field.msgFx].show(field.errorEl, field); }, clear: function(field){ field.el.removeClass(field.invalidClass); if(field.errorEl){ Ext.form.Field.msgFx[field.msgFx].hide(field.errorEl, field); }else{ field.el.dom.title = ''; } } }, 'side' : { mark: function(field, msg){ field.el.addClass(field.invalidClass); if(!field.errorIcon){ var elp = field.getErrorCt(); if(!elp){ field.el.dom.title = msg; return; } field.errorIcon = elp.createChild({cls:'x-form-invalid-icon'}); if (field.ownerCt) { field.ownerCt.on('afterlayout', field.alignErrorIcon, field); field.ownerCt.on('expand', field.alignErrorIcon, field); } field.on('resize', field.alignErrorIcon, field); field.on('destroy', function(){ Ext.destroy(this.errorIcon); }, field); } field.alignErrorIcon(); field.errorIcon.dom.qtip = msg; field.errorIcon.dom.qclass = 'x-form-invalid-tip'; field.errorIcon.show(); }, clear: function(field){ field.el.removeClass(field.invalidClass); if(field.errorIcon){ field.errorIcon.dom.qtip = ''; field.errorIcon.hide(); }else{ field.el.dom.title = ''; } } } }; Ext.form.Field.msgFx = { normal : { show: function(msgEl, f){ msgEl.setDisplayed('block'); }, hide : function(msgEl, f){ msgEl.setDisplayed(false).update(''); } }, slide : { show: function(msgEl, f){ msgEl.slideIn('t', {stopFx:true}); }, hide : function(msgEl, f){ msgEl.slideOut('t', {stopFx:true,useDisplay:true}); } }, slideRight : { show: function(msgEl, f){ msgEl.fixDisplay(); msgEl.alignTo(f.el, 'tl-tr'); msgEl.slideIn('l', {stopFx:true}); }, hide : function(msgEl, f){ msgEl.slideOut('l', {stopFx:true,useDisplay:true}); } } }; Ext.reg('field', Ext.form.Field); Ext.form.TextField = Ext.extend(Ext.form.Field, { grow : false, growMin : 30, growMax : 800, vtype : null, maskRe : null, disableKeyFilter : false, allowBlank : true, minLength : 0, maxLength : Number.MAX_VALUE, minLengthText : 'The minimum length for this field is {0}', maxLengthText : 'The maximum length for this field is {0}', selectOnFocus : false, blankText : 'This field is required', validator : null, regex : null, regexText : '', emptyText : null, emptyClass : 'x-form-empty-field', initComponent : function(){ Ext.form.TextField.superclass.initComponent.call(this); this.addEvents( 'autosize', 'keydown', 'keyup', 'keypress' ); }, initEvents : function(){ Ext.form.TextField.superclass.initEvents.call(this); if(this.validationEvent == 'keyup'){ this.validationTask = new Ext.util.DelayedTask(this.validate, this); this.mon(this.el, 'keyup', this.filterValidation, this); } else if(this.validationEvent !== false && this.validationEvent != 'blur'){ this.mon(this.el, this.validationEvent, this.validate, this, {buffer: this.validationDelay}); } if(this.selectOnFocus || this.emptyText){ this.mon(this.el, 'mousedown', this.onMouseDown, this); if(this.emptyText){ this.applyEmptyText(); } } if(this.maskRe || (this.vtype && this.disableKeyFilter !== true && (this.maskRe = Ext.form.VTypes[this.vtype+'Mask']))){ this.mon(this.el, 'keypress', this.filterKeys, this); } if(this.grow){ this.mon(this.el, 'keyup', this.onKeyUpBuffered, this, {buffer: 50}); this.mon(this.el, 'click', this.autoSize, this); } if(this.enableKeyEvents){ this.mon(this.el, { scope: this, keyup: this.onKeyUp, keydown: this.onKeyDown, keypress: this.onKeyPress }); } }, onMouseDown: function(e){ if(!this.hasFocus){ this.mon(this.el, 'mouseup', Ext.emptyFn, this, { single: true, preventDefault: true }); } }, processValue : function(value){ if(this.stripCharsRe){ var newValue = value.replace(this.stripCharsRe, ''); if(newValue !== value){ this.setRawValue(newValue); return newValue; } } return value; }, filterValidation : function(e){ if(!e.isNavKeyPress()){ this.validationTask.delay(this.validationDelay); } }, onDisable: function(){ Ext.form.TextField.superclass.onDisable.call(this); if(Ext.isIE){ this.el.dom.unselectable = 'on'; } }, onEnable: function(){ Ext.form.TextField.superclass.onEnable.call(this); if(Ext.isIE){ this.el.dom.unselectable = ''; } }, onKeyUpBuffered : function(e){ if(this.doAutoSize(e)){ this.autoSize(); } }, doAutoSize : function(e){ return !e.isNavKeyPress(); }, onKeyUp : function(e){ this.fireEvent('keyup', this, e); }, onKeyDown : function(e){ this.fireEvent('keydown', this, e); }, onKeyPress : function(e){ this.fireEvent('keypress', this, e); }, reset : function(){ Ext.form.TextField.superclass.reset.call(this); this.applyEmptyText(); }, applyEmptyText : function(){ if(this.rendered && this.emptyText && this.getRawValue().length < 1 && !this.hasFocus){ this.setRawValue(this.emptyText); this.el.addClass(this.emptyClass); } }, preFocus : function(){ var el = this.el, isEmpty; if(this.emptyText){ if(el.dom.value == this.emptyText){ this.setRawValue(''); isEmpty = true; } el.removeClass(this.emptyClass); } if(this.selectOnFocus || isEmpty){ el.dom.select(); } }, postBlur : function(){ this.applyEmptyText(); }, filterKeys : function(e){ if(e.ctrlKey){ return; } var k = e.getKey(); if(Ext.isGecko && (e.isNavKeyPress() || k == e.BACKSPACE || (k == e.DELETE && e.button == -1))){ return; } var cc = String.fromCharCode(e.getCharCode()); if(!Ext.isGecko && e.isSpecialKey() && !cc){ return; } if(!this.maskRe.test(cc)){ e.stopEvent(); } }, setValue : function(v){ if(this.emptyText && this.el && !Ext.isEmpty(v)){ this.el.removeClass(this.emptyClass); } Ext.form.TextField.superclass.setValue.apply(this, arguments); this.applyEmptyText(); this.autoSize(); return this; }, getErrors: function(value) { var errors = Ext.form.TextField.superclass.getErrors.apply(this, arguments); value = Ext.isDefined(value) ? value : this.processValue(this.getRawValue()); if (Ext.isFunction(this.validator)) { var msg = this.validator(value); if (msg !== true) { errors.push(msg); } } if (value.length < 1 || value === this.emptyText) { if (this.allowBlank) { return errors; } else { errors.push(this.blankText); } } if (!this.allowBlank && (value.length < 1 || value === this.emptyText)) { errors.push(this.blankText); } if (value.length < this.minLength) { errors.push(String.format(this.minLengthText, this.minLength)); } if (value.length > this.maxLength) { errors.push(String.format(this.maxLengthText, this.maxLength)); } if (this.vtype) { var vt = Ext.form.VTypes; if(!vt[this.vtype](value, this)){ errors.push(this.vtypeText || vt[this.vtype +'Text']); } } if (this.regex && !this.regex.test(value)) { errors.push(this.regexText); } return errors; }, selectText : function(start, end){ var v = this.getRawValue(); var doFocus = false; if(v.length > 0){ start = start === undefined ? 0 : start; end = end === undefined ? v.length : end; var d = this.el.dom; if(d.setSelectionRange){ d.setSelectionRange(start, end); }else if(d.createTextRange){ var range = d.createTextRange(); range.moveStart('character', start); range.moveEnd('character', end-v.length); range.select(); } doFocus = Ext.isGecko || Ext.isOpera; }else{ doFocus = true; } if(doFocus){ this.focus(); } }, autoSize : function(){ if(!this.grow || !this.rendered){ return; } if(!this.metrics){ this.metrics = Ext.util.TextMetrics.createInstance(this.el); } var el = this.el; var v = el.dom.value; var d = document.createElement('div'); d.appendChild(document.createTextNode(v)); v = d.innerHTML; Ext.removeNode(d); d = null; v += ' '; var w = Math.min(this.growMax, Math.max(this.metrics.getWidth(v) + 10, this.growMin)); this.el.setWidth(w); this.fireEvent('autosize', this, w); }, onDestroy: function(){ if(this.validationTask){ this.validationTask.cancel(); this.validationTask = null; } Ext.form.TextField.superclass.onDestroy.call(this); } }); Ext.reg('textfield', Ext.form.TextField); Ext.form.TriggerField = Ext.extend(Ext.form.TextField, { defaultAutoCreate : {tag: "input", type: "text", size: "16", autocomplete: "off"}, hideTrigger:false, editable: true, readOnly: false, wrapFocusClass: 'x-trigger-wrap-focus', autoSize: Ext.emptyFn, monitorTab : true, deferHeight : true, mimicing : false, actionMode: 'wrap', defaultTriggerWidth: 17, onResize : function(w, h){ Ext.form.TriggerField.superclass.onResize.call(this, w, h); var tw = this.getTriggerWidth(); if(Ext.isNumber(w)){ this.el.setWidth(w - tw); } this.wrap.setWidth(this.el.getWidth() + tw); }, getTriggerWidth: function(){ var tw = this.trigger.getWidth(); if(!this.hideTrigger && !this.readOnly && tw === 0){ tw = this.defaultTriggerWidth; } return tw; }, alignErrorIcon : function(){ if(this.wrap){ this.errorIcon.alignTo(this.wrap, 'tl-tr', [2, 0]); } }, onRender : function(ct, position){ this.doc = Ext.isIE ? Ext.getBody() : Ext.getDoc(); Ext.form.TriggerField.superclass.onRender.call(this, ct, position); this.wrap = this.el.wrap({cls: 'x-form-field-wrap x-form-field-trigger-wrap'}); this.trigger = this.wrap.createChild(this.triggerConfig || {tag: "img", src: Ext.BLANK_IMAGE_URL, alt: "", cls: "x-form-trigger " + this.triggerClass}); this.initTrigger(); if(!this.width){ this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth()); } this.resizeEl = this.positionEl = this.wrap; }, getWidth: function() { return(this.el.getWidth() + this.trigger.getWidth()); }, updateEditState: function(){ if(this.rendered){ if (this.readOnly) { this.el.dom.readOnly = true; this.el.addClass('x-trigger-noedit'); this.mun(this.el, 'click', this.onTriggerClick, this); this.trigger.setDisplayed(false); } else { if (!this.editable) { this.el.dom.readOnly = true; this.el.addClass('x-trigger-noedit'); this.mon(this.el, 'click', this.onTriggerClick, this); } else { this.el.dom.readOnly = false; this.el.removeClass('x-trigger-noedit'); this.mun(this.el, 'click', this.onTriggerClick, this); } this.trigger.setDisplayed(!this.hideTrigger); } this.onResize(this.width || this.wrap.getWidth()); } }, setHideTrigger: function(hideTrigger){ if(hideTrigger != this.hideTrigger){ this.hideTrigger = hideTrigger; this.updateEditState(); } }, setEditable: function(editable){ if(editable != this.editable){ this.editable = editable; this.updateEditState(); } }, setReadOnly: function(readOnly){ if(readOnly != this.readOnly){ this.readOnly = readOnly; this.updateEditState(); } }, afterRender : function(){ Ext.form.TriggerField.superclass.afterRender.call(this); this.updateEditState(); }, initTrigger : function(){ this.mon(this.trigger, 'click', this.onTriggerClick, this, {preventDefault:true}); this.trigger.addClassOnOver('x-form-trigger-over'); this.trigger.addClassOnClick('x-form-trigger-click'); }, onDestroy : function(){ Ext.destroy(this.trigger, this.wrap); if (this.mimicing){ this.doc.un('mousedown', this.mimicBlur, this); } delete this.doc; Ext.form.TriggerField.superclass.onDestroy.call(this); }, onFocus : function(){ Ext.form.TriggerField.superclass.onFocus.call(this); if(!this.mimicing){ this.wrap.addClass(this.wrapFocusClass); this.mimicing = true; this.doc.on('mousedown', this.mimicBlur, this, {delay: 10}); if(this.monitorTab){ this.on('specialkey', this.checkTab, this); } } }, checkTab : function(me, e){ if(e.getKey() == e.TAB){ this.triggerBlur(); } }, onBlur : Ext.emptyFn, mimicBlur : function(e){ if(!this.isDestroyed && !this.wrap.contains(e.target) && this.validateBlur(e)){ this.triggerBlur(); } }, triggerBlur : function(){ this.mimicing = false; this.doc.un('mousedown', this.mimicBlur, this); if(this.monitorTab && this.el){ this.un('specialkey', this.checkTab, this); } Ext.form.TriggerField.superclass.onBlur.call(this); if(this.wrap){ this.wrap.removeClass(this.wrapFocusClass); } }, beforeBlur : Ext.emptyFn, validateBlur : function(e){ return true; }, onTriggerClick : Ext.emptyFn }); Ext.form.TwinTriggerField = Ext.extend(Ext.form.TriggerField, { initComponent : function(){ Ext.form.TwinTriggerField.superclass.initComponent.call(this); this.triggerConfig = { tag:'span', cls:'x-form-twin-triggers', cn:[ {tag: "img", src: Ext.BLANK_IMAGE_URL, alt: "", cls: "x-form-trigger " + this.trigger1Class}, {tag: "img", src: Ext.BLANK_IMAGE_URL, alt: "", cls: "x-form-trigger " + this.trigger2Class} ]}; }, getTrigger : function(index){ return this.triggers[index]; }, afterRender: function(){ Ext.form.TwinTriggerField.superclass.afterRender.call(this); var triggers = this.triggers, i = 0, len = triggers.length; for(; i < len; ++i){ if(this['hideTrigger' + (i + 1)]){ triggers[i].hide(); } } }, initTrigger : function(){ var ts = this.trigger.select('.x-form-trigger', true), triggerField = this; ts.each(function(t, all, index){ var triggerIndex = 'Trigger'+(index+1); t.hide = function(){ var w = triggerField.wrap.getWidth(); this.dom.style.display = 'none'; triggerField.el.setWidth(w-triggerField.trigger.getWidth()); triggerField['hidden' + triggerIndex] = true; }; t.show = function(){ var w = triggerField.wrap.getWidth(); this.dom.style.display = ''; triggerField.el.setWidth(w-triggerField.trigger.getWidth()); triggerField['hidden' + triggerIndex] = false; }; this.mon(t, 'click', this['on'+triggerIndex+'Click'], this, {preventDefault:true}); t.addClassOnOver('x-form-trigger-over'); t.addClassOnClick('x-form-trigger-click'); }, this); this.triggers = ts.elements; }, getTriggerWidth: function(){ var tw = 0; Ext.each(this.triggers, function(t, index){ var triggerIndex = 'Trigger' + (index + 1), w = t.getWidth(); if(w === 0 && !this['hidden' + triggerIndex]){ tw += this.defaultTriggerWidth; }else{ tw += w; } }, this); return tw; }, onDestroy : function() { Ext.destroy(this.triggers); Ext.form.TwinTriggerField.superclass.onDestroy.call(this); }, onTrigger1Click : Ext.emptyFn, onTrigger2Click : Ext.emptyFn }); Ext.reg('trigger', Ext.form.TriggerField); Ext.form.TextArea = Ext.extend(Ext.form.TextField, { growMin : 60, growMax: 1000, growAppend : ' \n ', enterIsSpecial : false, preventScrollbars: false, onRender : function(ct, position){ if(!this.el){ this.defaultAutoCreate = { tag: "textarea", style:"width:100px;height:60px;", autocomplete: "off" }; } Ext.form.TextArea.superclass.onRender.call(this, ct, position); if(this.grow){ this.textSizeEl = Ext.DomHelper.append(document.body, { tag: "pre", cls: "x-form-grow-sizer" }); if(this.preventScrollbars){ this.el.setStyle("overflow", "hidden"); } this.el.setHeight(this.growMin); } }, onDestroy : function(){ Ext.removeNode(this.textSizeEl); Ext.form.TextArea.superclass.onDestroy.call(this); }, fireKey : function(e){ if(e.isSpecialKey() && (this.enterIsSpecial || (e.getKey() != e.ENTER || e.hasModifier()))){ this.fireEvent("specialkey", this, e); } }, doAutoSize : function(e){ return !e.isNavKeyPress() || e.getKey() == e.ENTER; }, filterValidation: function(e) { if(!e.isNavKeyPress() || (!this.enterIsSpecial && e.keyCode == e.ENTER)){ this.validationTask.delay(this.validationDelay); } }, autoSize: function(){ if(!this.grow || !this.textSizeEl){ return; } var el = this.el, v = Ext.util.Format.htmlEncode(el.dom.value), ts = this.textSizeEl, h; Ext.fly(ts).setWidth(this.el.getWidth()); if(v.length < 1){ v = "  "; }else{ v += this.growAppend; if(Ext.isIE){ v = v.replace(/\n/g, ' 
    '); } } ts.innerHTML = v; h = Math.min(this.growMax, Math.max(ts.offsetHeight, this.growMin)); if(h != this.lastHeight){ this.lastHeight = h; this.el.setHeight(h); this.fireEvent("autosize", this, h); } } }); Ext.reg('textarea', Ext.form.TextArea); Ext.form.NumberField = Ext.extend(Ext.form.TextField, { fieldClass: "x-form-field x-form-num-field", allowDecimals : true, decimalSeparator : ".", decimalPrecision : 2, allowNegative : true, minValue : Number.NEGATIVE_INFINITY, maxValue : Number.MAX_VALUE, minText : "The minimum value for this field is {0}", maxText : "The maximum value for this field is {0}", nanText : "{0} is not a valid number", baseChars : "0123456789", autoStripChars: false, initEvents : function() { var allowed = this.baseChars + ''; if (this.allowDecimals) { allowed += this.decimalSeparator; } if (this.allowNegative) { allowed += '-'; } allowed = Ext.escapeRe(allowed); this.maskRe = new RegExp('[' + allowed + ']'); if (this.autoStripChars) { this.stripCharsRe = new RegExp('[^' + allowed + ']', 'gi'); } Ext.form.NumberField.superclass.initEvents.call(this); }, getErrors: function(value) { var errors = Ext.form.NumberField.superclass.getErrors.apply(this, arguments); value = Ext.isDefined(value) ? value : this.processValue(this.getRawValue()); if (value.length < 1) { return errors; } value = String(value).replace(this.decimalSeparator, "."); if(isNaN(value)){ errors.push(String.format(this.nanText, value)); } var num = this.parseValue(value); if (num < this.minValue) { errors.push(String.format(this.minText, this.minValue)); } if (num > this.maxValue) { errors.push(String.format(this.maxText, this.maxValue)); } return errors; }, getValue : function() { return this.fixPrecision(this.parseValue(Ext.form.NumberField.superclass.getValue.call(this))); }, setValue : function(v) { v = Ext.isNumber(v) ? v : parseFloat(String(v).replace(this.decimalSeparator, ".")); v = this.fixPrecision(v); v = isNaN(v) ? '' : String(v).replace(".", this.decimalSeparator); return Ext.form.NumberField.superclass.setValue.call(this, v); }, setMinValue : function(value) { this.minValue = Ext.num(value, Number.NEGATIVE_INFINITY); }, setMaxValue : function(value) { this.maxValue = Ext.num(value, Number.MAX_VALUE); }, parseValue : function(value) { value = parseFloat(String(value).replace(this.decimalSeparator, ".")); return isNaN(value) ? '' : value; }, fixPrecision : function(value) { var nan = isNaN(value); if (!this.allowDecimals || this.decimalPrecision == -1 || nan || !value) { return nan ? '' : value; } return parseFloat(parseFloat(value).toFixed(this.decimalPrecision)); }, beforeBlur : function() { var v = this.parseValue(this.getRawValue()); if (!Ext.isEmpty(v)) { this.setValue(v); } } }); Ext.reg('numberfield', Ext.form.NumberField); Ext.form.DateField = Ext.extend(Ext.form.TriggerField, { format : "m/d/Y", altFormats : "m/d/Y|n/j/Y|n/j/y|m/j/y|n/d/y|m/j/Y|n/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d|n-j|n/j", disabledDaysText : "Disabled", disabledDatesText : "Disabled", minText : "The date in this field must be equal to or after {0}", maxText : "The date in this field must be equal to or before {0}", invalidText : "{0} is not a valid date - it must be in the format {1}", triggerClass : 'x-form-date-trigger', showToday : true, startDay : 0, defaultAutoCreate : {tag: "input", type: "text", size: "10", autocomplete: "off"}, initTime: '12', initTimeFormat: 'H', safeParse : function(value, format) { if (Date.formatContainsHourInfo(format)) { return Date.parseDate(value, format); } else { var parsedDate = Date.parseDate(value + ' ' + this.initTime, format + ' ' + this.initTimeFormat); if (parsedDate) { return parsedDate.clearTime(); } } }, initComponent : function(){ Ext.form.DateField.superclass.initComponent.call(this); this.addEvents( 'select' ); if(Ext.isString(this.minValue)){ this.minValue = this.parseDate(this.minValue); } if(Ext.isString(this.maxValue)){ this.maxValue = this.parseDate(this.maxValue); } this.disabledDatesRE = null; this.initDisabledDays(); }, initEvents: function() { Ext.form.DateField.superclass.initEvents.call(this); this.keyNav = new Ext.KeyNav(this.el, { "down": function(e) { this.onTriggerClick(); }, scope: this, forceKeyDown: true }); }, initDisabledDays : function(){ if(this.disabledDates){ var dd = this.disabledDates, len = dd.length - 1, re = "(?:"; Ext.each(dd, function(d, i){ re += Ext.isDate(d) ? '^' + Ext.escapeRe(d.dateFormat(this.format)) + '$' : dd[i]; if(i != len){ re += '|'; } }, this); this.disabledDatesRE = new RegExp(re + ')'); } }, setDisabledDates : function(dd){ this.disabledDates = dd; this.initDisabledDays(); if(this.menu){ this.menu.picker.setDisabledDates(this.disabledDatesRE); } }, setDisabledDays : function(dd){ this.disabledDays = dd; if(this.menu){ this.menu.picker.setDisabledDays(dd); } }, setMinValue : function(dt){ this.minValue = (Ext.isString(dt) ? this.parseDate(dt) : dt); if(this.menu){ this.menu.picker.setMinDate(this.minValue); } }, setMaxValue : function(dt){ this.maxValue = (Ext.isString(dt) ? this.parseDate(dt) : dt); if(this.menu){ this.menu.picker.setMaxDate(this.maxValue); } }, getErrors: function(value) { var errors = Ext.form.DateField.superclass.getErrors.apply(this, arguments); value = this.formatDate(value || this.processValue(this.getRawValue())); if (value.length < 1) { return errors; } var svalue = value; value = this.parseDate(value); if (!value) { errors.push(String.format(this.invalidText, svalue, this.format)); return errors; } var time = value.getTime(); if (this.minValue && time < this.minValue.clearTime().getTime()) { errors.push(String.format(this.minText, this.formatDate(this.minValue))); } if (this.maxValue && time > this.maxValue.clearTime().getTime()) { errors.push(String.format(this.maxText, this.formatDate(this.maxValue))); } if (this.disabledDays) { var day = value.getDay(); for(var i = 0; i < this.disabledDays.length; i++) { if (day === this.disabledDays[i]) { errors.push(this.disabledDaysText); break; } } } var fvalue = this.formatDate(value); if (this.disabledDatesRE && this.disabledDatesRE.test(fvalue)) { errors.push(String.format(this.disabledDatesText, fvalue)); } return errors; }, validateBlur : function(){ return !this.menu || !this.menu.isVisible(); }, getValue : function(){ return this.parseDate(Ext.form.DateField.superclass.getValue.call(this)) || ""; }, setValue : function(date){ return Ext.form.DateField.superclass.setValue.call(this, this.formatDate(this.parseDate(date))); }, parseDate : function(value) { if(!value || Ext.isDate(value)){ return value; } var v = this.safeParse(value, this.format), af = this.altFormats, afa = this.altFormatsArray; if (!v && af) { afa = afa || af.split("|"); for (var i = 0, len = afa.length; i < len && !v; i++) { v = this.safeParse(value, afa[i]); } } return v; }, onDestroy : function(){ Ext.destroy(this.menu, this.keyNav); Ext.form.DateField.superclass.onDestroy.call(this); }, formatDate : function(date){ return Ext.isDate(date) ? date.dateFormat(this.format) : date; }, onTriggerClick : function(){ if(this.disabled){ return; } if(this.menu == null){ this.menu = new Ext.menu.DateMenu({ hideOnClick: false, focusOnSelect: false }); } this.onFocus(); Ext.apply(this.menu.picker, { minDate : this.minValue, maxDate : this.maxValue, disabledDatesRE : this.disabledDatesRE, disabledDatesText : this.disabledDatesText, disabledDays : this.disabledDays, disabledDaysText : this.disabledDaysText, format : this.format, showToday : this.showToday, startDay: this.startDay, minText : String.format(this.minText, this.formatDate(this.minValue)), maxText : String.format(this.maxText, this.formatDate(this.maxValue)) }); this.menu.picker.setValue(this.getValue() || new Date()); this.menu.show(this.el, "tl-bl?"); this.menuEvents('on'); }, menuEvents: function(method){ this.menu[method]('select', this.onSelect, this); this.menu[method]('hide', this.onMenuHide, this); this.menu[method]('show', this.onFocus, this); }, onSelect: function(m, d){ this.setValue(d); this.fireEvent('select', this, d); this.menu.hide(); }, onMenuHide: function(){ this.focus(false, 60); this.menuEvents('un'); }, beforeBlur : function(){ var v = this.parseDate(this.getRawValue()); if(v){ this.setValue(v); } } }); Ext.reg('datefield', Ext.form.DateField); Ext.form.DisplayField = Ext.extend(Ext.form.Field, { validationEvent : false, validateOnBlur : false, defaultAutoCreate : {tag: "div"}, fieldClass : "x-form-display-field", htmlEncode: false, initEvents : Ext.emptyFn, isValid : function(){ return true; }, validate : function(){ return true; }, getRawValue : function(){ var v = this.rendered ? this.el.dom.innerHTML : Ext.value(this.value, ''); if(v === this.emptyText){ v = ''; } if(this.htmlEncode){ v = Ext.util.Format.htmlDecode(v); } return v; }, getValue : function(){ return this.getRawValue(); }, getName: function() { return this.name; }, setRawValue : function(v){ if(this.htmlEncode){ v = Ext.util.Format.htmlEncode(v); } return this.rendered ? (this.el.dom.innerHTML = (Ext.isEmpty(v) ? '' : v)) : (this.value = v); }, setValue : function(v){ this.setRawValue(v); return this; } }); Ext.reg('displayfield', Ext.form.DisplayField); Ext.form.ComboBox = Ext.extend(Ext.form.TriggerField, { defaultAutoCreate : {tag: "input", type: "text", size: "24", autocomplete: "off"}, listClass : '', selectedClass : 'x-combo-selected', listEmptyText: '', triggerClass : 'x-form-arrow-trigger', shadow : 'sides', listAlign : 'tl-bl?', maxHeight : 300, minHeight : 90, triggerAction : 'query', minChars : 4, autoSelect : true, typeAhead : false, queryDelay : 500, pageSize : 0, selectOnFocus : false, queryParam : 'query', loadingText : 'Loading...', resizable : false, handleHeight : 8, allQuery: '', mode: 'remote', minListWidth : 70, forceSelection : false, typeAheadDelay : 250, lazyInit : true, clearFilterOnReset : true, submitValue: undefined, initComponent : function(){ Ext.form.ComboBox.superclass.initComponent.call(this); this.addEvents( 'expand', 'collapse', 'beforeselect', 'select', 'beforequery' ); if(this.transform){ var s = Ext.getDom(this.transform); if(!this.hiddenName){ this.hiddenName = s.name; } if(!this.store){ this.mode = 'local'; var d = [], opts = s.options; for(var i = 0, len = opts.length;i < len; i++){ var o = opts[i], value = (o.hasAttribute ? o.hasAttribute('value') : o.getAttributeNode('value').specified) ? o.value : o.text; if(o.selected && Ext.isEmpty(this.value, true)) { this.value = value; } d.push([value, o.text]); } this.store = new Ext.data.ArrayStore({ idIndex: 0, fields: ['value', 'text'], data : d, autoDestroy: true }); this.valueField = 'value'; this.displayField = 'text'; } s.name = Ext.id(); if(!this.lazyRender){ this.target = true; this.el = Ext.DomHelper.insertBefore(s, this.autoCreate || this.defaultAutoCreate); this.render(this.el.parentNode, s); } Ext.removeNode(s); } else if(this.store){ this.store = Ext.StoreMgr.lookup(this.store); if(this.store.autoCreated){ this.displayField = this.valueField = 'field1'; if(!this.store.expandData){ this.displayField = 'field2'; } this.mode = 'local'; } } this.selectedIndex = -1; if(this.mode == 'local'){ if(!Ext.isDefined(this.initialConfig.queryDelay)){ this.queryDelay = 10; } if(!Ext.isDefined(this.initialConfig.minChars)){ this.minChars = 0; } } }, onRender : function(ct, position){ if(this.hiddenName && !Ext.isDefined(this.submitValue)){ this.submitValue = false; } Ext.form.ComboBox.superclass.onRender.call(this, ct, position); if(this.hiddenName){ this.hiddenField = this.el.insertSibling({tag:'input', type:'hidden', name: this.hiddenName, id: (this.hiddenId || Ext.id())}, 'before', true); } if(Ext.isGecko){ this.el.dom.setAttribute('autocomplete', 'off'); } if(!this.lazyInit){ this.initList(); }else{ this.on('focus', this.initList, this, {single: true}); } }, initValue : function(){ Ext.form.ComboBox.superclass.initValue.call(this); if(this.hiddenField){ this.hiddenField.value = Ext.value(Ext.isDefined(this.hiddenValue) ? this.hiddenValue : this.value, ''); } }, getParentZIndex : function(){ var zindex; if (this.ownerCt){ this.findParentBy(function(ct){ zindex = parseInt(ct.getPositionEl().getStyle('z-index'), 10); return !!zindex; }); } return zindex; }, getZIndex : function(listParent){ listParent = listParent || Ext.getDom(this.getListParent() || Ext.getBody()); var zindex = parseInt(Ext.fly(listParent).getStyle('z-index'), 10); if(!zindex){ zindex = this.getParentZIndex(); } return (zindex || 12000) + 5; }, initList : function(){ if(!this.list){ var cls = 'x-combo-list', listParent = Ext.getDom(this.getListParent() || Ext.getBody()); this.list = new Ext.Layer({ parentEl: listParent, shadow: this.shadow, cls: [cls, this.listClass].join(' '), constrain:false, zindex: this.getZIndex(listParent) }); var lw = this.listWidth || Math.max(this.wrap.getWidth(), this.minListWidth); this.list.setSize(lw, 0); this.list.swallowEvent('mousewheel'); this.assetHeight = 0; if(this.syncFont !== false){ this.list.setStyle('font-size', this.el.getStyle('font-size')); } if(this.title){ this.header = this.list.createChild({cls:cls+'-hd', html: this.title}); this.assetHeight += this.header.getHeight(); } this.innerList = this.list.createChild({cls:cls+'-inner'}); this.mon(this.innerList, 'mouseover', this.onViewOver, this); this.mon(this.innerList, 'mousemove', this.onViewMove, this); this.innerList.setWidth(lw - this.list.getFrameWidth('lr')); if(this.pageSize){ this.footer = this.list.createChild({cls:cls+'-ft'}); this.pageTb = new Ext.PagingToolbar({ store: this.store, pageSize: this.pageSize, renderTo:this.footer }); this.assetHeight += this.footer.getHeight(); } if(!this.tpl){ this.tpl = '
    {' + this.displayField + '}
    '; } this.view = new Ext.DataView({ applyTo: this.innerList, tpl: this.tpl, singleSelect: true, selectedClass: this.selectedClass, itemSelector: this.itemSelector || '.' + cls + '-item', emptyText: this.listEmptyText, deferEmptyText: false }); this.mon(this.view, { containerclick : this.onViewClick, click : this.onViewClick, scope :this }); this.bindStore(this.store, true); if(this.resizable){ this.resizer = new Ext.Resizable(this.list, { pinned:true, handles:'se' }); this.mon(this.resizer, 'resize', function(r, w, h){ this.maxHeight = h-this.handleHeight-this.list.getFrameWidth('tb')-this.assetHeight; this.listWidth = w; this.innerList.setWidth(w - this.list.getFrameWidth('lr')); this.restrictHeight(); }, this); this[this.pageSize?'footer':'innerList'].setStyle('margin-bottom', this.handleHeight+'px'); } } }, getListParent : function() { return document.body; }, getStore : function(){ return this.store; }, bindStore : function(store, initial){ if(this.store && !initial){ if(this.store !== store && this.store.autoDestroy){ this.store.destroy(); }else{ this.store.un('beforeload', this.onBeforeLoad, this); this.store.un('load', this.onLoad, this); this.store.un('exception', this.collapse, this); } if(!store){ this.store = null; if(this.view){ this.view.bindStore(null); } if(this.pageTb){ this.pageTb.bindStore(null); } } } if(store){ if(!initial) { this.lastQuery = null; if(this.pageTb) { this.pageTb.bindStore(store); } } this.store = Ext.StoreMgr.lookup(store); this.store.on({ scope: this, beforeload: this.onBeforeLoad, load: this.onLoad, exception: this.collapse }); if(this.view){ this.view.bindStore(store); } } }, reset : function(){ if(this.clearFilterOnReset && this.mode == 'local'){ this.store.clearFilter(); } Ext.form.ComboBox.superclass.reset.call(this); }, initEvents : function(){ Ext.form.ComboBox.superclass.initEvents.call(this); this.keyNav = new Ext.KeyNav(this.el, { "up" : function(e){ this.inKeyMode = true; this.selectPrev(); }, "down" : function(e){ if(!this.isExpanded()){ this.onTriggerClick(); }else{ this.inKeyMode = true; this.selectNext(); } }, "enter" : function(e){ this.onViewClick(); }, "esc" : function(e){ this.collapse(); }, "tab" : function(e){ if (this.forceSelection === true) { this.collapse(); } else { this.onViewClick(false); } return true; }, scope : this, doRelay : function(e, h, hname){ if(hname == 'down' || this.scope.isExpanded()){ var relay = Ext.KeyNav.prototype.doRelay.apply(this, arguments); if(!Ext.isIE && Ext.EventManager.useKeydown){ this.scope.fireKey(e); } return relay; } return true; }, forceKeyDown : true, defaultEventAction: 'stopEvent' }); this.queryDelay = Math.max(this.queryDelay || 10, this.mode == 'local' ? 10 : 250); this.dqTask = new Ext.util.DelayedTask(this.initQuery, this); if(this.typeAhead){ this.taTask = new Ext.util.DelayedTask(this.onTypeAhead, this); } if(!this.enableKeyEvents){ this.mon(this.el, 'keyup', this.onKeyUp, this); } }, onDestroy : function(){ if (this.dqTask){ this.dqTask.cancel(); this.dqTask = null; } this.bindStore(null); Ext.destroy( this.resizer, this.view, this.pageTb, this.list ); Ext.destroyMembers(this, 'hiddenField'); Ext.form.ComboBox.superclass.onDestroy.call(this); }, fireKey : function(e){ if (!this.isExpanded()) { Ext.form.ComboBox.superclass.fireKey.call(this, e); } }, onResize : function(w, h){ Ext.form.ComboBox.superclass.onResize.apply(this, arguments); if(!isNaN(w) && this.isVisible() && this.list){ this.doResize(w); }else{ this.bufferSize = w; } }, doResize: function(w){ if(!Ext.isDefined(this.listWidth)){ var lw = Math.max(w, this.minListWidth); this.list.setWidth(lw); this.innerList.setWidth(lw - this.list.getFrameWidth('lr')); } }, onEnable : function(){ Ext.form.ComboBox.superclass.onEnable.apply(this, arguments); if(this.hiddenField){ this.hiddenField.disabled = false; } }, onDisable : function(){ Ext.form.ComboBox.superclass.onDisable.apply(this, arguments); if(this.hiddenField){ this.hiddenField.disabled = true; } }, onBeforeLoad : function(){ if(!this.hasFocus){ return; } this.innerList.update(this.loadingText ? '
    '+this.loadingText+'
    ' : ''); this.restrictHeight(); this.selectedIndex = -1; }, onLoad : function(){ if(!this.hasFocus){ return; } if(this.store.getCount() > 0 || this.listEmptyText){ this.expand(); this.restrictHeight(); if(this.lastQuery == this.allQuery){ if(this.editable){ this.el.dom.select(); } if(this.autoSelect !== false && !this.selectByValue(this.value, true)){ this.select(0, true); } }else{ if(this.autoSelect !== false){ this.selectNext(); } if(this.typeAhead && this.lastKey != Ext.EventObject.BACKSPACE && this.lastKey != Ext.EventObject.DELETE){ this.taTask.delay(this.typeAheadDelay); } } }else{ this.collapse(); } }, onTypeAhead : function(){ if(this.store.getCount() > 0){ var r = this.store.getAt(0); var newValue = r.data[this.displayField]; var len = newValue.length; var selStart = this.getRawValue().length; if(selStart != len){ this.setRawValue(newValue); this.selectText(selStart, newValue.length); } } }, assertValue : function(){ var val = this.getRawValue(), rec; if(this.valueField && Ext.isDefined(this.value)){ rec = this.findRecord(this.valueField, this.value); } if(!rec || rec.get(this.displayField) != val){ rec = this.findRecord(this.displayField, val); } if(!rec && this.forceSelection){ if(val.length > 0 && val != this.emptyText){ this.el.dom.value = Ext.value(this.lastSelectionText, ''); this.applyEmptyText(); }else{ this.clearValue(); } }else{ if(rec && this.valueField){ if (this.value == val){ return; } val = rec.get(this.valueField || this.displayField); } this.setValue(val); } }, onSelect : function(record, index){ if(this.fireEvent('beforeselect', this, record, index) !== false){ this.setValue(record.data[this.valueField || this.displayField]); this.collapse(); this.fireEvent('select', this, record, index); } }, getName: function(){ var hf = this.hiddenField; return hf && hf.name ? hf.name : this.hiddenName || Ext.form.ComboBox.superclass.getName.call(this); }, getValue : function(){ if(this.valueField){ return Ext.isDefined(this.value) ? this.value : ''; }else{ return Ext.form.ComboBox.superclass.getValue.call(this); } }, clearValue : function(){ if(this.hiddenField){ this.hiddenField.value = ''; } this.setRawValue(''); this.lastSelectionText = ''; this.applyEmptyText(); this.value = ''; }, setValue : function(v){ var text = v; if(this.valueField){ var r = this.findRecord(this.valueField, v); if(r){ text = r.data[this.displayField]; }else if(Ext.isDefined(this.valueNotFoundText)){ text = this.valueNotFoundText; } } this.lastSelectionText = text; if(this.hiddenField){ this.hiddenField.value = Ext.value(v, ''); } Ext.form.ComboBox.superclass.setValue.call(this, text); this.value = v; return this; }, findRecord : function(prop, value){ var record; if(this.store.getCount() > 0){ this.store.each(function(r){ if(r.data[prop] == value){ record = r; return false; } }); } return record; }, onViewMove : function(e, t){ this.inKeyMode = false; }, onViewOver : function(e, t){ if(this.inKeyMode){ return; } var item = this.view.findItemFromChild(t); if(item){ var index = this.view.indexOf(item); this.select(index, false); } }, onViewClick : function(doFocus){ var index = this.view.getSelectedIndexes()[0], s = this.store, r = s.getAt(index); if(r){ this.onSelect(r, index); }else { this.collapse(); } if(doFocus !== false){ this.el.focus(); } }, restrictHeight : function(){ this.innerList.dom.style.height = ''; var inner = this.innerList.dom, pad = this.list.getFrameWidth('tb') + (this.resizable ? this.handleHeight : 0) + this.assetHeight, h = Math.max(inner.clientHeight, inner.offsetHeight, inner.scrollHeight), ha = this.getPosition()[1]-Ext.getBody().getScroll().top, hb = Ext.lib.Dom.getViewHeight()-ha-this.getSize().height, space = Math.max(ha, hb, this.minHeight || 0)-this.list.shadowOffset-pad-5; h = Math.min(h, space, this.maxHeight); this.innerList.setHeight(h); this.list.beginUpdate(); this.list.setHeight(h+pad); this.list.alignTo.apply(this.list, [this.el].concat(this.listAlign)); this.list.endUpdate(); }, isExpanded : function(){ return this.list && this.list.isVisible(); }, selectByValue : function(v, scrollIntoView){ if(!Ext.isEmpty(v, true)){ var r = this.findRecord(this.valueField || this.displayField, v); if(r){ this.select(this.store.indexOf(r), scrollIntoView); return true; } } return false; }, select : function(index, scrollIntoView){ this.selectedIndex = index; this.view.select(index); if(scrollIntoView !== false){ var el = this.view.getNode(index); if(el){ this.innerList.scrollChildIntoView(el, false); } } }, selectNext : function(){ var ct = this.store.getCount(); if(ct > 0){ if(this.selectedIndex == -1){ this.select(0); }else if(this.selectedIndex < ct-1){ this.select(this.selectedIndex+1); } } }, selectPrev : function(){ var ct = this.store.getCount(); if(ct > 0){ if(this.selectedIndex == -1){ this.select(0); }else if(this.selectedIndex !== 0){ this.select(this.selectedIndex-1); } } }, onKeyUp : function(e){ var k = e.getKey(); if(this.editable !== false && this.readOnly !== true && (k == e.BACKSPACE || !e.isSpecialKey())){ this.lastKey = k; this.dqTask.delay(this.queryDelay); } Ext.form.ComboBox.superclass.onKeyUp.call(this, e); }, validateBlur : function(){ return !this.list || !this.list.isVisible(); }, initQuery : function(){ this.doQuery(this.getRawValue()); }, beforeBlur : function(){ this.assertValue(); }, postBlur : function(){ Ext.form.ComboBox.superclass.postBlur.call(this); this.collapse(); this.inKeyMode = false; }, doQuery : function(q, forceAll){ q = Ext.isEmpty(q) ? '' : q; var qe = { query: q, forceAll: forceAll, combo: this, cancel:false }; if(this.fireEvent('beforequery', qe)===false || qe.cancel){ return false; } q = qe.query; forceAll = qe.forceAll; if(forceAll === true || (q.length >= this.minChars)){ if(this.lastQuery !== q){ this.lastQuery = q; if(this.mode == 'local'){ this.selectedIndex = -1; if(forceAll){ this.store.clearFilter(); }else{ this.store.filter(this.displayField, q); } this.onLoad(); }else{ this.store.baseParams[this.queryParam] = q; this.store.load({ params: this.getParams(q) }); this.expand(); } }else{ this.selectedIndex = -1; this.onLoad(); } } }, getParams : function(q){ var params = {}, paramNames = this.store.paramNames; if(this.pageSize){ params[paramNames.start] = 0; params[paramNames.limit] = this.pageSize; } return params; }, collapse : function(){ if(!this.isExpanded()){ return; } this.list.hide(); Ext.getDoc().un('mousewheel', this.collapseIf, this); Ext.getDoc().un('mousedown', this.collapseIf, this); this.fireEvent('collapse', this); }, collapseIf : function(e){ if(!this.isDestroyed && !e.within(this.wrap) && !e.within(this.list)){ this.collapse(); } }, expand : function(){ if(this.isExpanded() || !this.hasFocus){ return; } if(this.title || this.pageSize){ this.assetHeight = 0; if(this.title){ this.assetHeight += this.header.getHeight(); } if(this.pageSize){ this.assetHeight += this.footer.getHeight(); } } if(this.bufferSize){ this.doResize(this.bufferSize); delete this.bufferSize; } this.list.alignTo.apply(this.list, [this.el].concat(this.listAlign)); this.list.setZIndex(this.getZIndex()); this.list.show(); if(Ext.isGecko2){ this.innerList.setOverflow('auto'); } this.mon(Ext.getDoc(), { scope: this, mousewheel: this.collapseIf, mousedown: this.collapseIf }); this.fireEvent('expand', this); }, onTriggerClick : function(){ if(this.readOnly || this.disabled){ return; } if(this.isExpanded()){ this.collapse(); this.el.focus(); }else { this.onFocus({}); if(this.triggerAction == 'all') { this.doQuery(this.allQuery, true); } else { this.doQuery(this.getRawValue()); } this.el.focus(); } } }); Ext.reg('combo', Ext.form.ComboBox); Ext.form.Checkbox = Ext.extend(Ext.form.Field, { focusClass : undefined, fieldClass : 'x-form-field', checked : false, boxLabel: ' ', defaultAutoCreate : { tag: 'input', type: 'checkbox', autocomplete: 'off'}, actionMode : 'wrap', initComponent : function(){ Ext.form.Checkbox.superclass.initComponent.call(this); this.addEvents( 'check' ); }, onResize : function(){ Ext.form.Checkbox.superclass.onResize.apply(this, arguments); if(!this.boxLabel && !this.fieldLabel){ this.el.alignTo(this.wrap, 'c-c'); } }, initEvents : function(){ Ext.form.Checkbox.superclass.initEvents.call(this); this.mon(this.el, { scope: this, click: this.onClick, change: this.onClick }); }, markInvalid : Ext.emptyFn, clearInvalid : Ext.emptyFn, onRender : function(ct, position){ Ext.form.Checkbox.superclass.onRender.call(this, ct, position); if(this.inputValue !== undefined){ this.el.dom.value = this.inputValue; } this.wrap = this.el.wrap({cls: 'x-form-check-wrap'}); if(this.boxLabel){ this.wrap.createChild({tag: 'label', htmlFor: this.el.id, cls: 'x-form-cb-label', html: this.boxLabel}); } if(this.checked){ this.setValue(true); }else{ this.checked = this.el.dom.checked; } if (Ext.isIE && !Ext.isStrict) { this.wrap.repaint(); } this.resizeEl = this.positionEl = this.wrap; }, onDestroy : function(){ Ext.destroy(this.wrap); Ext.form.Checkbox.superclass.onDestroy.call(this); }, initValue : function() { this.originalValue = this.getValue(); }, getValue : function(){ if(this.rendered){ return this.el.dom.checked; } return this.checked; }, onClick : function(){ if(this.el.dom.checked != this.checked){ this.setValue(this.el.dom.checked); } }, setValue : function(v){ var checked = this.checked, inputVal = this.inputValue; if (v === false) { this.checked = false; } else { this.checked = (v === true || v === 'true' || v == '1' || (inputVal ? v == inputVal : String(v).toLowerCase() == 'on')); } if(this.rendered){ this.el.dom.checked = this.checked; this.el.dom.defaultChecked = this.checked; } if(checked != this.checked){ this.fireEvent('check', this, this.checked); if(this.handler){ this.handler.call(this.scope || this, this, this.checked); } } return this; } }); Ext.reg('checkbox', Ext.form.Checkbox); Ext.form.CheckboxGroup = Ext.extend(Ext.form.Field, { columns : 'auto', vertical : false, allowBlank : true, blankText : "You must select at least one item in this group", defaultType : 'checkbox', groupCls : 'x-form-check-group', initComponent: function(){ this.addEvents( 'change' ); this.on('change', this.validate, this); Ext.form.CheckboxGroup.superclass.initComponent.call(this); }, onRender : function(ct, position){ if(!this.el){ var panelCfg = { autoEl: { id: this.id }, cls: this.groupCls, layout: 'column', renderTo: ct, bufferResize: false }; var colCfg = { xtype: 'container', defaultType: this.defaultType, layout: 'form', defaults: { hideLabel: true, anchor: '100%' } }; if(this.items[0].items){ Ext.apply(panelCfg, { layoutConfig: {columns: this.items.length}, defaults: this.defaults, items: this.items }); for(var i=0, len=this.items.length; i0 && i%rows==0){ ri++; } if(this.items[i].fieldLabel){ this.items[i].hideLabel = false; } cols[ri].items.push(this.items[i]); }; }else{ for(var i=0, len=this.items.length; i -1){ item.setValue(true); } }); }, getBox : function(id){ var box = null; this.eachItem(function(f){ if(id == f || f.dataIndex == id || f.id == id || f.getName() == id){ box = f; return false; } }); return box; }, getValue : function(){ var out = []; this.eachItem(function(item){ if(item.checked){ out.push(item); } }); return out; }, eachItem: function(fn, scope) { if(this.items && this.items.each){ this.items.each(fn, scope || this); } }, getRawValue : Ext.emptyFn, setRawValue : Ext.emptyFn }); Ext.reg('checkboxgroup', Ext.form.CheckboxGroup); Ext.form.CompositeField = Ext.extend(Ext.form.Field, { defaultMargins: '0 5 0 0', skipLastItemMargin: true, isComposite: true, combineErrors: true, labelConnector: ', ', initComponent: function() { var labels = [], items = this.items, item; for (var i=0, j = items.length; i < j; i++) { item = items[i]; if (!Ext.isEmpty(item.ref)){ item.ref = '../' + item.ref; } labels.push(item.fieldLabel); Ext.applyIf(item, this.defaults); if (!(i == j - 1 && this.skipLastItemMargin)) { Ext.applyIf(item, {margins: this.defaultMargins}); } } this.fieldLabel = this.fieldLabel || this.buildLabel(labels); this.fieldErrors = new Ext.util.MixedCollection(true, function(item) { return item.field; }); this.fieldErrors.on({ scope : this, add : this.updateInvalidMark, remove : this.updateInvalidMark, replace: this.updateInvalidMark }); Ext.form.CompositeField.superclass.initComponent.apply(this, arguments); this.innerCt = new Ext.Container({ layout : 'hbox', items : this.items, cls : 'x-form-composite', defaultMargins: '0 3 0 0', ownerCt: this }); this.innerCt.ownerCt = undefined; var fields = this.innerCt.findBy(function(c) { return c.isFormField; }, this); this.items = new Ext.util.MixedCollection(); this.items.addAll(fields); }, onRender: function(ct, position) { if (!this.el) { var innerCt = this.innerCt; innerCt.render(ct); this.el = innerCt.getEl(); if (this.combineErrors) { this.eachItem(function(field) { Ext.apply(field, { markInvalid : this.onFieldMarkInvalid.createDelegate(this, [field], 0), clearInvalid: this.onFieldClearInvalid.createDelegate(this, [field], 0) }); }); } var l = this.el.parent().parent().child('label', true); if (l) { l.setAttribute('for', this.items.items[0].id); } } Ext.form.CompositeField.superclass.onRender.apply(this, arguments); }, onFieldMarkInvalid: function(field, message) { var name = field.getName(), error = { field: name, errorName: field.fieldLabel || name, error: message }; this.fieldErrors.replace(name, error); if (!field.preventMark) { field.el.addClass(field.invalidClass); } }, onFieldClearInvalid: function(field) { this.fieldErrors.removeKey(field.getName()); field.el.removeClass(field.invalidClass); }, updateInvalidMark: function() { var ieStrict = Ext.isIE6 && Ext.isStrict; if (this.fieldErrors.length == 0) { this.clearInvalid(); if (ieStrict) { this.clearInvalid.defer(50, this); } } else { var message = this.buildCombinedErrorMessage(this.fieldErrors.items); this.sortErrors(); this.markInvalid(message); if (ieStrict) { this.markInvalid(message); } } }, validateValue: function(value, preventMark) { var valid = true; this.eachItem(function(field) { if (!field.isValid(preventMark)) { valid = false; } }); return valid; }, buildCombinedErrorMessage: function(errors) { var combined = [], error; for (var i = 0, j = errors.length; i < j; i++) { error = errors[i]; combined.push(String.format("{0}: {1}", error.errorName, error.error)); } return combined.join("
    "); }, sortErrors: function() { var fields = this.items; this.fieldErrors.sort("ASC", function(a, b) { var findByName = function(key) { return function(field) { return field.getName() == key; }; }; var aIndex = fields.findIndexBy(findByName(a.field)), bIndex = fields.findIndexBy(findByName(b.field)); return aIndex < bIndex ? -1 : 1; }); }, reset: function() { this.eachItem(function(item) { item.reset(); }); (function() { this.clearInvalid(); }).defer(50, this); }, clearInvalidChildren: function() { this.eachItem(function(item) { item.clearInvalid(); }); }, buildLabel: function(segments) { return Ext.clean(segments).join(this.labelConnector); }, isDirty: function(){ if (this.disabled || !this.rendered) { return false; } var dirty = false; this.eachItem(function(item){ if(item.isDirty()){ dirty = true; return false; } }); return dirty; }, eachItem: function(fn, scope) { if(this.items && this.items.each){ this.items.each(fn, scope || this); } }, onResize: function(adjWidth, adjHeight, rawWidth, rawHeight) { var innerCt = this.innerCt; if (this.rendered && innerCt.rendered) { innerCt.setSize(adjWidth, adjHeight); } Ext.form.CompositeField.superclass.onResize.apply(this, arguments); }, doLayout: function(shallow, force) { if (this.rendered) { var innerCt = this.innerCt; innerCt.forceLayout = this.ownerCt.forceLayout; innerCt.doLayout(shallow, force); } }, beforeDestroy: function(){ Ext.destroy(this.innerCt); Ext.form.CompositeField.superclass.beforeDestroy.call(this); }, setReadOnly : function(readOnly) { if (readOnly == undefined) { readOnly = true; } readOnly = !!readOnly; if(this.rendered){ this.eachItem(function(item){ item.setReadOnly(readOnly); }); } this.readOnly = readOnly; }, onShow : function() { Ext.form.CompositeField.superclass.onShow.call(this); this.doLayout(); }, onDisable : function(){ this.eachItem(function(item){ item.disable(); }); }, onEnable : function(){ this.eachItem(function(item){ item.enable(); }); } }); Ext.reg('compositefield', Ext.form.CompositeField); Ext.form.Radio = Ext.extend(Ext.form.Checkbox, { inputType: 'radio', markInvalid : Ext.emptyFn, clearInvalid : Ext.emptyFn, getGroupValue : function(){ var p = this.el.up('form') || Ext.getBody(); var c = p.child('input[name="'+this.el.dom.name+'"]:checked', true); return c ? c.value : null; }, setValue : function(v){ var checkEl, els, radio; if (typeof v == 'boolean') { Ext.form.Radio.superclass.setValue.call(this, v); } else if (this.rendered) { checkEl = this.getCheckEl(); radio = checkEl.child('input[name="' + this.el.dom.name + '"][value="' + v + '"]', true); if(radio){ Ext.getCmp(radio.id).setValue(true); } } if(this.rendered && this.checked){ checkEl = checkEl || this.getCheckEl(); els = this.getCheckEl().select('input[name="' + this.el.dom.name + '"]'); els.each(function(el){ if(el.dom.id != this.id){ Ext.getCmp(el.dom.id).setValue(false); } }, this); } return this; }, getCheckEl: function(){ if(this.inGroup){ return this.el.up('.x-form-radio-group'); } return this.el.up('form') || Ext.getBody(); } }); Ext.reg('radio', Ext.form.Radio); Ext.form.RadioGroup = Ext.extend(Ext.form.CheckboxGroup, { allowBlank : true, blankText : 'You must select one item in this group', defaultType : 'radio', groupCls : 'x-form-radio-group', getValue : function(){ var out = null; this.eachItem(function(item){ if(item.checked){ out = item; return false; } }); return out; }, onSetValue : function(id, value){ if(arguments.length > 1){ var f = this.getBox(id); if(f){ f.setValue(value); if(f.checked){ this.eachItem(function(item){ if (item !== f){ item.setValue(false); } }); } } }else{ this.setValueForItem(id); } }, setValueForItem : function(val){ val = String(val).split(',')[0]; this.eachItem(function(item){ item.setValue(val == item.inputValue); }); }, fireChecked : function(){ if(!this.checkTask){ this.checkTask = new Ext.util.DelayedTask(this.bufferChecked, this); } this.checkTask.delay(10); }, bufferChecked : function(){ var out = null; this.eachItem(function(item){ if(item.checked){ out = item; return false; } }); this.fireEvent('change', this, out); }, onDestroy : function(){ if(this.checkTask){ this.checkTask.cancel(); this.checkTask = null; } Ext.form.RadioGroup.superclass.onDestroy.call(this); } }); Ext.reg('radiogroup', Ext.form.RadioGroup); Ext.form.Hidden = Ext.extend(Ext.form.Field, { inputType : 'hidden', shouldLayout: false, onRender : function(){ Ext.form.Hidden.superclass.onRender.apply(this, arguments); }, initEvents : function(){ this.originalValue = this.getValue(); }, setSize : Ext.emptyFn, setWidth : Ext.emptyFn, setHeight : Ext.emptyFn, setPosition : Ext.emptyFn, setPagePosition : Ext.emptyFn, markInvalid : Ext.emptyFn, clearInvalid : Ext.emptyFn }); Ext.reg('hidden', Ext.form.Hidden); Ext.form.BasicForm = Ext.extend(Ext.util.Observable, { constructor: function(el, config){ Ext.apply(this, config); if(Ext.isString(this.paramOrder)){ this.paramOrder = this.paramOrder.split(/[\s,|]/); } this.items = new Ext.util.MixedCollection(false, function(o){ return o.getItemId(); }); this.addEvents( 'beforeaction', 'actionfailed', 'actioncomplete' ); if(el){ this.initEl(el); } Ext.form.BasicForm.superclass.constructor.call(this); }, timeout: 30, paramOrder: undefined, paramsAsHash: false, waitTitle: 'Please Wait...', activeAction : null, trackResetOnLoad : false, initEl : function(el){ this.el = Ext.get(el); this.id = this.el.id || Ext.id(); if(!this.standardSubmit){ this.el.on('submit', this.onSubmit, this); } this.el.addClass('x-form'); }, getEl: function(){ return this.el; }, onSubmit : function(e){ e.stopEvent(); }, destroy: function(bound){ if(bound !== true){ this.items.each(function(f){ Ext.destroy(f); }); Ext.destroy(this.el); } this.items.clear(); this.purgeListeners(); }, isValid : function(){ var valid = true; this.items.each(function(f){ if(!f.validate()){ valid = false; } }); return valid; }, isDirty : function(){ var dirty = false; this.items.each(function(f){ if(f.isDirty()){ dirty = true; return false; } }); return dirty; }, doAction : function(action, options){ if(Ext.isString(action)){ action = new Ext.form.Action.ACTION_TYPES[action](this, options); } if(this.fireEvent('beforeaction', this, action) !== false){ this.beforeAction(action); action.run.defer(100, action); } return this; }, submit : function(options){ options = options || {}; if(this.standardSubmit){ var v = options.clientValidation === false || this.isValid(); if(v){ var el = this.el.dom; if(this.url && Ext.isEmpty(el.action)){ el.action = this.url; } el.submit(); } return v; } var submitAction = String.format('{0}submit', this.api ? 'direct' : ''); this.doAction(submitAction, options); return this; }, load : function(options){ var loadAction = String.format('{0}load', this.api ? 'direct' : ''); this.doAction(loadAction, options); return this; }, updateRecord : function(record){ record.beginEdit(); var fs = record.fields, field, value; fs.each(function(f){ field = this.findField(f.name); if(field){ value = field.getValue(); if (Ext.type(value) !== false && value.getGroupValue) { value = value.getGroupValue(); } else if ( field.eachItem ) { value = []; field.eachItem(function(item){ value.push(item.getValue()); }); } record.set(f.name, value); } }, this); record.endEdit(); return this; }, loadRecord : function(record){ this.setValues(record.data); return this; }, beforeAction : function(action){ this.items.each(function(f){ if(f.isFormField && f.syncValue){ f.syncValue(); } }); var o = action.options; if(o.waitMsg){ if(this.waitMsgTarget === true){ this.el.mask(o.waitMsg, 'x-mask-loading'); }else if(this.waitMsgTarget){ this.waitMsgTarget = Ext.get(this.waitMsgTarget); this.waitMsgTarget.mask(o.waitMsg, 'x-mask-loading'); }else{ Ext.MessageBox.wait(o.waitMsg, o.waitTitle || this.waitTitle); } } }, afterAction : function(action, success){ this.activeAction = null; var o = action.options; if(o.waitMsg){ if(this.waitMsgTarget === true){ this.el.unmask(); }else if(this.waitMsgTarget){ this.waitMsgTarget.unmask(); }else{ Ext.MessageBox.updateProgress(1); Ext.MessageBox.hide(); } } if(success){ if(o.reset){ this.reset(); } Ext.callback(o.success, o.scope, [this, action]); this.fireEvent('actioncomplete', this, action); }else{ Ext.callback(o.failure, o.scope, [this, action]); this.fireEvent('actionfailed', this, action); } }, findField : function(id) { var field = this.items.get(id); if (!Ext.isObject(field)) { var findMatchingField = function(f) { if (f.isFormField) { if (f.dataIndex == id || f.id == id || f.getName() == id) { field = f; return false; } else if (f.isComposite) { return f.items.each(findMatchingField); } else if (f instanceof Ext.form.CheckboxGroup && f.rendered) { return f.eachItem(findMatchingField); } } }; this.items.each(findMatchingField); } return field || null; }, markInvalid : function(errors){ if (Ext.isArray(errors)) { for(var i = 0, len = errors.length; i < len; i++){ var fieldError = errors[i]; var f = this.findField(fieldError.id); if(f){ f.markInvalid(fieldError.msg); } } } else { var field, id; for(id in errors){ if(!Ext.isFunction(errors[id]) && (field = this.findField(id))){ field.markInvalid(errors[id]); } } } return this; }, setValues : function(values){ if(Ext.isArray(values)){ for(var i = 0, len = values.length; i < len; i++){ var v = values[i]; var f = this.findField(v.id); if(f){ f.setValue(v.value); if(this.trackResetOnLoad){ f.originalValue = f.getValue(); } } } }else{ var field, id; for(id in values){ if(!Ext.isFunction(values[id]) && (field = this.findField(id))){ field.setValue(values[id]); if(this.trackResetOnLoad){ field.originalValue = field.getValue(); } } } } return this; }, getValues : function(asString){ var fs = Ext.lib.Ajax.serializeForm(this.el.dom); if(asString === true){ return fs; } return Ext.urlDecode(fs); }, getFieldValues : function(dirtyOnly){ var o = {}, n, key, val; this.items.each(function(f) { if (!f.disabled && (dirtyOnly !== true || f.isDirty())) { n = f.getName(); key = o[n]; val = f.getValue(); if(Ext.isDefined(key)){ if(Ext.isArray(key)){ o[n].push(val); }else{ o[n] = [key, val]; } }else{ o[n] = val; } } }); return o; }, clearInvalid : function(){ this.items.each(function(f){ f.clearInvalid(); }); return this; }, reset : function(){ this.items.each(function(f){ f.reset(); }); return this; }, add : function(){ this.items.addAll(Array.prototype.slice.call(arguments, 0)); return this; }, remove : function(field){ this.items.remove(field); return this; }, cleanDestroyed : function() { this.items.filterBy(function(o) { return !!o.isDestroyed; }).each(this.remove, this); }, render : function(){ this.items.each(function(f){ if(f.isFormField && !f.rendered && document.getElementById(f.id)){ f.applyToMarkup(f.id); } }); return this; }, applyToFields : function(o){ this.items.each(function(f){ Ext.apply(f, o); }); return this; }, applyIfToFields : function(o){ this.items.each(function(f){ Ext.applyIf(f, o); }); return this; }, callFieldMethod : function(fnName, args){ args = args || []; this.items.each(function(f){ if(Ext.isFunction(f[fnName])){ f[fnName].apply(f, args); } }); return this; } }); Ext.BasicForm = Ext.form.BasicForm; Ext.FormPanel = Ext.extend(Ext.Panel, { minButtonWidth : 75, labelAlign : 'left', monitorValid : false, monitorPoll : 200, layout : 'form', initComponent : function(){ this.form = this.createForm(); Ext.FormPanel.superclass.initComponent.call(this); this.bodyCfg = { tag: 'form', cls: this.baseCls + '-body', method : this.method || 'POST', id : this.formId || Ext.id() }; if(this.fileUpload) { this.bodyCfg.enctype = 'multipart/form-data'; } this.initItems(); this.addEvents( 'clientvalidation' ); this.relayEvents(this.form, ['beforeaction', 'actionfailed', 'actioncomplete']); }, createForm : function(){ var config = Ext.applyIf({listeners: {}}, this.initialConfig); return new Ext.form.BasicForm(null, config); }, initFields : function(){ var f = this.form; var formPanel = this; var fn = function(c){ if(formPanel.isField(c)){ f.add(c); }else if(c.findBy && c != formPanel){ formPanel.applySettings(c); if(c.items && c.items.each){ c.items.each(fn, this); } } }; this.items.each(fn, this); }, applySettings: function(c){ var ct = c.ownerCt; Ext.applyIf(c, { labelAlign: ct.labelAlign, labelWidth: ct.labelWidth, itemCls: ct.itemCls }); }, getLayoutTarget : function(){ return this.form.el; }, getForm : function(){ return this.form; }, onRender : function(ct, position){ this.initFields(); Ext.FormPanel.superclass.onRender.call(this, ct, position); this.form.initEl(this.body); }, beforeDestroy : function(){ this.stopMonitoring(); this.form.destroy(true); Ext.FormPanel.superclass.beforeDestroy.call(this); }, isField : function(c) { return !!c.setValue && !!c.getValue && !!c.markInvalid && !!c.clearInvalid; }, initEvents : function(){ Ext.FormPanel.superclass.initEvents.call(this); this.on({ scope: this, add: this.onAddEvent, remove: this.onRemoveEvent }); if(this.monitorValid){ this.startMonitoring(); } }, onAdd: function(c){ Ext.FormPanel.superclass.onAdd.call(this, c); this.processAdd(c); }, onAddEvent: function(ct, c){ if(ct !== this){ this.processAdd(c); } }, processAdd : function(c){ if(this.isField(c)){ this.form.add(c); }else if(c.findBy){ this.applySettings(c); this.form.add.apply(this.form, c.findBy(this.isField)); } }, onRemove: function(c){ Ext.FormPanel.superclass.onRemove.call(this, c); this.processRemove(c); }, onRemoveEvent: function(ct, c){ if(ct !== this){ this.processRemove(c); } }, processRemove: function(c){ if(!this.destroying){ if(this.isField(c)){ this.form.remove(c); }else if (c.findBy){ Ext.each(c.findBy(this.isField), this.form.remove, this.form); this.form.cleanDestroyed(); } } }, startMonitoring : function(){ if(!this.validTask){ this.validTask = new Ext.util.TaskRunner(); this.validTask.start({ run : this.bindHandler, interval : this.monitorPoll || 200, scope: this }); } }, stopMonitoring : function(){ if(this.validTask){ this.validTask.stopAll(); this.validTask = null; } }, load : function(){ this.form.load.apply(this.form, arguments); }, onDisable : function(){ Ext.FormPanel.superclass.onDisable.call(this); if(this.form){ this.form.items.each(function(){ this.disable(); }); } }, onEnable : function(){ Ext.FormPanel.superclass.onEnable.call(this); if(this.form){ this.form.items.each(function(){ this.enable(); }); } }, bindHandler : function(){ var valid = true; this.form.items.each(function(f){ if(!f.isValid(true)){ valid = false; return false; } }); if(this.fbar){ var fitems = this.fbar.items.items; for(var i = 0, len = fitems.length; i < len; i++){ var btn = fitems[i]; if(btn.formBind === true && btn.disabled === valid){ btn.setDisabled(!valid); } } } this.fireEvent('clientvalidation', this, valid); } }); Ext.reg('form', Ext.FormPanel); Ext.form.FormPanel = Ext.FormPanel; Ext.form.FieldSet = Ext.extend(Ext.Panel, { baseCls : 'x-fieldset', layout : 'form', animCollapse : false, onRender : function(ct, position){ if(!this.el){ this.el = document.createElement('fieldset'); this.el.id = this.id; if (this.title || this.header || this.checkboxToggle) { this.el.appendChild(document.createElement('legend')).className = this.baseCls + '-header'; } } Ext.form.FieldSet.superclass.onRender.call(this, ct, position); if(this.checkboxToggle){ var o = typeof this.checkboxToggle == 'object' ? this.checkboxToggle : {tag: 'input', type: 'checkbox', name: this.checkboxName || this.id+'-checkbox'}; this.checkbox = this.header.insertFirst(o); this.checkbox.dom.checked = !this.collapsed; this.mon(this.checkbox, 'click', this.onCheckClick, this); } }, onCollapse : function(doAnim, animArg){ if(this.checkbox){ this.checkbox.dom.checked = false; } Ext.form.FieldSet.superclass.onCollapse.call(this, doAnim, animArg); }, onExpand : function(doAnim, animArg){ if(this.checkbox){ this.checkbox.dom.checked = true; } Ext.form.FieldSet.superclass.onExpand.call(this, doAnim, animArg); }, onCheckClick : function(){ this[this.checkbox.dom.checked ? 'expand' : 'collapse'](); } }); Ext.reg('fieldset', Ext.form.FieldSet); Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, { enableFormat : true, enableFontSize : true, enableColors : true, enableAlignments : true, enableLists : true, enableSourceEdit : true, enableLinks : true, enableFont : true, createLinkText : 'Please enter the URL for the link:', defaultLinkValue : 'http:/'+'/', fontFamilies : [ 'Arial', 'Courier New', 'Tahoma', 'Times New Roman', 'Verdana' ], defaultFont: 'tahoma', defaultValue: (Ext.isOpera || Ext.isIE6) ? ' ' : '​', actionMode: 'wrap', validationEvent : false, deferHeight: true, initialized : false, activated : false, sourceEditMode : false, onFocus : Ext.emptyFn, iframePad:3, hideMode:'offsets', defaultAutoCreate : { tag: "textarea", style:"width:500px;height:300px;", autocomplete: "off" }, initComponent : function(){ this.addEvents( 'initialize', 'activate', 'beforesync', 'beforepush', 'sync', 'push', 'editmodechange' ); Ext.form.HtmlEditor.superclass.initComponent.call(this); }, createFontOptions : function(){ var buf = [], fs = this.fontFamilies, ff, lc; for(var i = 0, len = fs.length; i< len; i++){ ff = fs[i]; lc = ff.toLowerCase(); buf.push( '' ); } return buf.join(''); }, createToolbar : function(editor){ var items = []; var tipsEnabled = Ext.QuickTips && Ext.QuickTips.isEnabled(); function btn(id, toggle, handler){ return { itemId : id, cls : 'x-btn-icon', iconCls: 'x-edit-'+id, enableToggle:toggle !== false, scope: editor, handler:handler||editor.relayBtnCmd, clickEvent:'mousedown', tooltip: tipsEnabled ? editor.buttonTips[id] || undefined : undefined, overflowText: editor.buttonTips[id].title || undefined, tabIndex:-1 }; } if(this.enableFont && !Ext.isSafari2){ var fontSelectItem = new Ext.Toolbar.Item({ autoEl: { tag:'select', cls:'x-font-select', html: this.createFontOptions() } }); items.push( fontSelectItem, '-' ); } if(this.enableFormat){ items.push( btn('bold'), btn('italic'), btn('underline') ); } if(this.enableFontSize){ items.push( '-', btn('increasefontsize', false, this.adjustFont), btn('decreasefontsize', false, this.adjustFont) ); } if(this.enableColors){ items.push( '-', { itemId:'forecolor', cls:'x-btn-icon', iconCls: 'x-edit-forecolor', clickEvent:'mousedown', tooltip: tipsEnabled ? editor.buttonTips.forecolor || undefined : undefined, tabIndex:-1, menu : new Ext.menu.ColorMenu({ allowReselect: true, focus: Ext.emptyFn, value:'000000', plain:true, listeners: { scope: this, select: function(cp, color){ this.execCmd('forecolor', Ext.isWebKit || Ext.isIE ? '#'+color : color); this.deferFocus(); } }, clickEvent:'mousedown' }) }, { itemId:'backcolor', cls:'x-btn-icon', iconCls: 'x-edit-backcolor', clickEvent:'mousedown', tooltip: tipsEnabled ? editor.buttonTips.backcolor || undefined : undefined, tabIndex:-1, menu : new Ext.menu.ColorMenu({ focus: Ext.emptyFn, value:'FFFFFF', plain:true, allowReselect: true, listeners: { scope: this, select: function(cp, color){ if(Ext.isGecko){ this.execCmd('useCSS', false); this.execCmd('hilitecolor', color); this.execCmd('useCSS', true); this.deferFocus(); }else{ this.execCmd(Ext.isOpera ? 'hilitecolor' : 'backcolor', Ext.isWebKit || Ext.isIE ? '#'+color : color); this.deferFocus(); } } }, clickEvent:'mousedown' }) } ); } if(this.enableAlignments){ items.push( '-', btn('justifyleft'), btn('justifycenter'), btn('justifyright') ); } if(!Ext.isSafari2){ if(this.enableLinks){ items.push( '-', btn('createlink', false, this.createLink) ); } if(this.enableLists){ items.push( '-', btn('insertorderedlist'), btn('insertunorderedlist') ); } if(this.enableSourceEdit){ items.push( '-', btn('sourceedit', true, function(btn){ this.toggleSourceEdit(!this.sourceEditMode); }) ); } } var tb = new Ext.Toolbar({ renderTo: this.wrap.dom.firstChild, items: items }); if (fontSelectItem) { this.fontSelect = fontSelectItem.el; this.mon(this.fontSelect, 'change', function(){ var font = this.fontSelect.dom.value; this.relayCmd('fontname', font); this.deferFocus(); }, this); } this.mon(tb.el, 'click', function(e){ e.preventDefault(); }); this.tb = tb; this.tb.doLayout(); }, onDisable: function(){ this.wrap.mask(); Ext.form.HtmlEditor.superclass.onDisable.call(this); }, onEnable: function(){ this.wrap.unmask(); Ext.form.HtmlEditor.superclass.onEnable.call(this); }, setReadOnly: function(readOnly){ Ext.form.HtmlEditor.superclass.setReadOnly.call(this, readOnly); if(this.initialized){ if(Ext.isIE){ this.getEditorBody().contentEditable = !readOnly; }else{ this.setDesignMode(!readOnly); } var bd = this.getEditorBody(); if(bd){ bd.style.cursor = this.readOnly ? 'default' : 'text'; } this.disableItems(readOnly); } }, getDocMarkup : function(){ var h = Ext.fly(this.iframe).getHeight() - this.iframePad * 2; return String.format('', this.iframePad, h); }, getEditorBody : function(){ var doc = this.getDoc(); return doc.body || doc.documentElement; }, getDoc : function(){ return Ext.isIE ? this.getWin().document : (this.iframe.contentDocument || this.getWin().document); }, getWin : function(){ return Ext.isIE ? this.iframe.contentWindow : window.frames[this.iframe.name]; }, onRender : function(ct, position){ Ext.form.HtmlEditor.superclass.onRender.call(this, ct, position); this.el.dom.style.border = '0 none'; this.el.dom.setAttribute('tabIndex', -1); this.el.addClass('x-hidden'); if(Ext.isIE){ this.el.applyStyles('margin-top:-1px;margin-bottom:-1px;'); } this.wrap = this.el.wrap({ cls:'x-html-editor-wrap', cn:{cls:'x-html-editor-tb'} }); this.createToolbar(this); this.disableItems(true); this.tb.doLayout(); this.createIFrame(); if(!this.width){ var sz = this.el.getSize(); this.setSize(sz.width, this.height || sz.height); } this.resizeEl = this.positionEl = this.wrap; }, createIFrame: function(){ var iframe = document.createElement('iframe'); iframe.name = Ext.id(); iframe.frameBorder = '0'; iframe.style.overflow = 'auto'; iframe.src = Ext.SSL_SECURE_URL; this.wrap.dom.appendChild(iframe); this.iframe = iframe; this.monitorTask = Ext.TaskMgr.start({ run: this.checkDesignMode, scope: this, interval:100 }); }, initFrame : function(){ Ext.TaskMgr.stop(this.monitorTask); var doc = this.getDoc(); this.win = this.getWin(); doc.open(); doc.write(this.getDocMarkup()); doc.close(); var task = { run : function(){ var doc = this.getDoc(); if(doc.body || doc.readyState == 'complete'){ Ext.TaskMgr.stop(task); this.setDesignMode(true); this.initEditor.defer(10, this); } }, interval : 10, duration:10000, scope: this }; Ext.TaskMgr.start(task); }, checkDesignMode : function(){ if(this.wrap && this.wrap.dom.offsetWidth){ var doc = this.getDoc(); if(!doc){ return; } if(!doc.editorInitialized || this.getDesignMode() != 'on'){ this.initFrame(); } } }, setDesignMode : function(mode){ var doc = this.getDoc(); if (doc) { if(this.readOnly){ mode = false; } doc.designMode = (/on|true/i).test(String(mode).toLowerCase()) ?'on':'off'; } }, getDesignMode : function(){ var doc = this.getDoc(); if(!doc){ return ''; } return String(doc.designMode).toLowerCase(); }, disableItems: function(disabled){ if(this.fontSelect){ this.fontSelect.dom.disabled = disabled; } this.tb.items.each(function(item){ if(item.getItemId() != 'sourceedit'){ item.setDisabled(disabled); } }); }, onResize : function(w, h){ Ext.form.HtmlEditor.superclass.onResize.apply(this, arguments); if(this.el && this.iframe){ if(Ext.isNumber(w)){ var aw = w - this.wrap.getFrameWidth('lr'); this.el.setWidth(aw); this.tb.setWidth(aw); this.iframe.style.width = Math.max(aw, 0) + 'px'; } if(Ext.isNumber(h)){ var ah = h - this.wrap.getFrameWidth('tb') - this.tb.el.getHeight(); this.el.setHeight(ah); this.iframe.style.height = Math.max(ah, 0) + 'px'; var bd = this.getEditorBody(); if(bd){ bd.style.height = Math.max((ah - (this.iframePad*2)), 0) + 'px'; } } } }, toggleSourceEdit : function(sourceEditMode){ var iframeHeight, elHeight; if (sourceEditMode === undefined) { sourceEditMode = !this.sourceEditMode; } this.sourceEditMode = sourceEditMode === true; var btn = this.tb.getComponent('sourceedit'); if (btn.pressed !== this.sourceEditMode) { btn.toggle(this.sourceEditMode); if (!btn.xtbHidden) { return; } } if (this.sourceEditMode) { this.previousSize = this.getSize(); iframeHeight = Ext.get(this.iframe).getHeight(); this.disableItems(true); this.syncValue(); this.iframe.className = 'x-hidden'; this.el.removeClass('x-hidden'); this.el.dom.removeAttribute('tabIndex'); this.el.focus(); this.el.dom.style.height = iframeHeight + 'px'; } else { elHeight = parseInt(this.el.dom.style.height, 10); if (this.initialized) { this.disableItems(this.readOnly); } this.pushValue(); this.iframe.className = ''; this.el.addClass('x-hidden'); this.el.dom.setAttribute('tabIndex', -1); this.deferFocus(); this.setSize(this.previousSize); delete this.previousSize; this.iframe.style.height = elHeight + 'px'; } this.fireEvent('editmodechange', this, this.sourceEditMode); }, createLink : function() { var url = prompt(this.createLinkText, this.defaultLinkValue); if(url && url != 'http:/'+'/'){ this.relayCmd('createlink', url); } }, initEvents : function(){ this.originalValue = this.getValue(); }, markInvalid : Ext.emptyFn, clearInvalid : Ext.emptyFn, setValue : function(v){ Ext.form.HtmlEditor.superclass.setValue.call(this, v); this.pushValue(); return this; }, cleanHtml: function(html) { html = String(html); if(Ext.isWebKit){ html = html.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi, ''); } if(html.charCodeAt(0) == this.defaultValue.replace(/\D/g, '')){ html = html.substring(1); } return html; }, syncValue : function(){ if(this.initialized){ var bd = this.getEditorBody(); var html = bd.innerHTML; if(Ext.isWebKit){ var bs = bd.getAttribute('style'); var m = bs.match(/text-align:(.*?);/i); if(m && m[1]){ html = '
    ' + html + '
    '; } } html = this.cleanHtml(html); if(this.fireEvent('beforesync', this, html) !== false){ this.el.dom.value = html; this.fireEvent('sync', this, html); } } }, getValue : function() { this[this.sourceEditMode ? 'pushValue' : 'syncValue'](); return Ext.form.HtmlEditor.superclass.getValue.call(this); }, pushValue : function(){ if(this.initialized){ var v = this.el.dom.value; if(!this.activated && v.length < 1){ v = this.defaultValue; } if(this.fireEvent('beforepush', this, v) !== false){ this.getEditorBody().innerHTML = v; if(Ext.isGecko){ this.setDesignMode(false); this.setDesignMode(true); } this.fireEvent('push', this, v); } } }, deferFocus : function(){ this.focus.defer(10, this); }, focus : function(){ if(this.win && !this.sourceEditMode){ this.win.focus(); }else{ this.el.focus(); } }, initEditor : function(){ try{ var dbody = this.getEditorBody(), ss = this.el.getStyles('font-size', 'font-family', 'background-image', 'background-repeat', 'background-color', 'color'), doc, fn; ss['background-attachment'] = 'fixed'; dbody.bgProperties = 'fixed'; Ext.DomHelper.applyStyles(dbody, ss); doc = this.getDoc(); if(doc){ try{ Ext.EventManager.removeAll(doc); }catch(e){} } fn = this.onEditorEvent.createDelegate(this); Ext.EventManager.on(doc, { mousedown: fn, dblclick: fn, click: fn, keyup: fn, buffer:100 }); if(Ext.isGecko){ Ext.EventManager.on(doc, 'keypress', this.applyCommand, this); } if(Ext.isIE || Ext.isWebKit || Ext.isOpera){ Ext.EventManager.on(doc, 'keydown', this.fixKeys, this); } doc.editorInitialized = true; this.initialized = true; this.pushValue(); this.setReadOnly(this.readOnly); this.fireEvent('initialize', this); }catch(e){} }, beforeDestroy : function(){ if(this.monitorTask){ Ext.TaskMgr.stop(this.monitorTask); } if(this.rendered){ Ext.destroy(this.tb); var doc = this.getDoc(); if(doc){ try{ Ext.EventManager.removeAll(doc); for (var prop in doc){ delete doc[prop]; } }catch(e){} } if(this.wrap){ this.wrap.dom.innerHTML = ''; this.wrap.remove(); } } Ext.form.HtmlEditor.superclass.beforeDestroy.call(this); }, onFirstFocus : function(){ this.activated = true; this.disableItems(this.readOnly); if(Ext.isGecko){ this.win.focus(); var s = this.win.getSelection(); if(!s.focusNode || s.focusNode.nodeType != 3){ var r = s.getRangeAt(0); r.selectNodeContents(this.getEditorBody()); r.collapse(true); this.deferFocus(); } try{ this.execCmd('useCSS', true); this.execCmd('styleWithCSS', false); }catch(e){} } this.fireEvent('activate', this); }, adjustFont: function(btn){ var adjust = btn.getItemId() == 'increasefontsize' ? 1 : -1, doc = this.getDoc(), v = parseInt(doc.queryCommandValue('FontSize') || 2, 10); if((Ext.isSafari && !Ext.isSafari2) || Ext.isChrome || Ext.isAir){ if(v <= 10){ v = 1 + adjust; }else if(v <= 13){ v = 2 + adjust; }else if(v <= 16){ v = 3 + adjust; }else if(v <= 18){ v = 4 + adjust; }else if(v <= 24){ v = 5 + adjust; }else { v = 6 + adjust; } v = v.constrain(1, 6); }else{ if(Ext.isSafari){ adjust *= 2; } v = Math.max(1, v+adjust) + (Ext.isSafari ? 'px' : 0); } this.execCmd('FontSize', v); }, onEditorEvent : function(e){ this.updateToolbar(); }, updateToolbar: function(){ if(this.readOnly){ return; } if(!this.activated){ this.onFirstFocus(); return; } var btns = this.tb.items.map, doc = this.getDoc(); if(this.enableFont && !Ext.isSafari2){ var name = (doc.queryCommandValue('FontName')||this.defaultFont).toLowerCase(); if(name != this.fontSelect.dom.value){ this.fontSelect.dom.value = name; } } if(this.enableFormat){ btns.bold.toggle(doc.queryCommandState('bold')); btns.italic.toggle(doc.queryCommandState('italic')); btns.underline.toggle(doc.queryCommandState('underline')); } if(this.enableAlignments){ btns.justifyleft.toggle(doc.queryCommandState('justifyleft')); btns.justifycenter.toggle(doc.queryCommandState('justifycenter')); btns.justifyright.toggle(doc.queryCommandState('justifyright')); } if(!Ext.isSafari2 && this.enableLists){ btns.insertorderedlist.toggle(doc.queryCommandState('insertorderedlist')); btns.insertunorderedlist.toggle(doc.queryCommandState('insertunorderedlist')); } Ext.menu.MenuMgr.hideAll(); this.syncValue(); }, relayBtnCmd : function(btn){ this.relayCmd(btn.getItemId()); }, relayCmd : function(cmd, value){ (function(){ this.focus(); this.execCmd(cmd, value); this.updateToolbar(); }).defer(10, this); }, execCmd : function(cmd, value){ var doc = this.getDoc(); doc.execCommand(cmd, false, value === undefined ? null : value); this.syncValue(); }, applyCommand : function(e){ if(e.ctrlKey){ var c = e.getCharCode(), cmd; if(c > 0){ c = String.fromCharCode(c); switch(c){ case 'b': cmd = 'bold'; break; case 'i': cmd = 'italic'; break; case 'u': cmd = 'underline'; break; } if(cmd){ this.win.focus(); this.execCmd(cmd); this.deferFocus(); e.preventDefault(); } } } }, insertAtCursor : function(text){ if(!this.activated){ return; } if(Ext.isIE){ this.win.focus(); var doc = this.getDoc(), r = doc.selection.createRange(); if(r){ r.pasteHTML(text); this.syncValue(); this.deferFocus(); } }else{ this.win.focus(); this.execCmd('InsertHTML', text); this.deferFocus(); } }, fixKeys : function(){ if(Ext.isIE){ return function(e){ var k = e.getKey(), doc = this.getDoc(), r; if(k == e.TAB){ e.stopEvent(); r = doc.selection.createRange(); if(r){ r.collapse(true); r.pasteHTML('    '); this.deferFocus(); } }else if(k == e.ENTER){ r = doc.selection.createRange(); if(r){ var target = r.parentElement(); if(!target || target.tagName.toLowerCase() != 'li'){ e.stopEvent(); r.pasteHTML('
    '); r.collapse(false); r.select(); } } } }; }else if(Ext.isOpera){ return function(e){ var k = e.getKey(); if(k == e.TAB){ e.stopEvent(); this.win.focus(); this.execCmd('InsertHTML','    '); this.deferFocus(); } }; }else if(Ext.isWebKit){ return function(e){ var k = e.getKey(); if(k == e.TAB){ e.stopEvent(); this.execCmd('InsertText','\t'); this.deferFocus(); }else if(k == e.ENTER){ e.stopEvent(); this.execCmd('InsertHtml','

    '); this.deferFocus(); } }; } }(), getToolbar : function(){ return this.tb; }, buttonTips : { bold : { title: 'Bold (Ctrl+B)', text: 'Make the selected text bold.', cls: 'x-html-editor-tip' }, italic : { title: 'Italic (Ctrl+I)', text: 'Make the selected text italic.', cls: 'x-html-editor-tip' }, underline : { title: 'Underline (Ctrl+U)', text: 'Underline the selected text.', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'Grow Text', text: 'Increase the font size.', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'Shrink Text', text: 'Decrease the font size.', cls: 'x-html-editor-tip' }, backcolor : { title: 'Text Highlight Color', text: 'Change the background color of the selected text.', cls: 'x-html-editor-tip' }, forecolor : { title: 'Font Color', text: 'Change the color of the selected text.', cls: 'x-html-editor-tip' }, justifyleft : { title: 'Align Text Left', text: 'Align text to the left.', cls: 'x-html-editor-tip' }, justifycenter : { title: 'Center Text', text: 'Center text in the editor.', cls: 'x-html-editor-tip' }, justifyright : { title: 'Align Text Right', text: 'Align text to the right.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'Bullet List', text: 'Start a bulleted list.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'Numbered List', text: 'Start a numbered list.', cls: 'x-html-editor-tip' }, createlink : { title: 'Hyperlink', text: 'Make the selected text a hyperlink.', cls: 'x-html-editor-tip' }, sourceedit : { title: 'Source Edit', text: 'Switch to source editing mode.', cls: 'x-html-editor-tip' } } }); Ext.reg('htmleditor', Ext.form.HtmlEditor); Ext.form.TimeField = Ext.extend(Ext.form.ComboBox, { minValue : undefined, maxValue : undefined, minText : "The time in this field must be equal to or after {0}", maxText : "The time in this field must be equal to or before {0}", invalidText : "{0} is not a valid time", format : "g:i A", altFormats : "g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|gi|hi|gia|hia|g|H|gi a|hi a|giA|hiA|gi A|hi A", increment: 15, mode: 'local', triggerAction: 'all', typeAhead: false, initDate: '1/1/2008', initDateFormat: 'j/n/Y', initComponent : function(){ if(Ext.isDefined(this.minValue)){ this.setMinValue(this.minValue, true); } if(Ext.isDefined(this.maxValue)){ this.setMaxValue(this.maxValue, true); } if(!this.store){ this.generateStore(true); } Ext.form.TimeField.superclass.initComponent.call(this); }, setMinValue: function(value, initial){ this.setLimit(value, true, initial); return this; }, setMaxValue: function(value, initial){ this.setLimit(value, false, initial); return this; }, generateStore: function(initial){ var min = this.minValue || new Date(this.initDate).clearTime(), max = this.maxValue || new Date(this.initDate).clearTime().add('mi', (24 * 60) - 1), times = []; while(min <= max){ times.push(min.dateFormat(this.format)); min = min.add('mi', this.increment); } this.bindStore(times, initial); }, setLimit: function(value, isMin, initial){ var d; if(Ext.isString(value)){ d = this.parseDate(value); }else if(Ext.isDate(value)){ d = value; } if(d){ var val = new Date(this.initDate).clearTime(); val.setHours(d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds()); this[isMin ? 'minValue' : 'maxValue'] = val; if(!initial){ this.generateStore(); } } }, getValue : function(){ var v = Ext.form.TimeField.superclass.getValue.call(this); return this.formatDate(this.parseDate(v)) || ''; }, setValue : function(value){ return Ext.form.TimeField.superclass.setValue.call(this, this.formatDate(this.parseDate(value))); }, validateValue : Ext.form.DateField.prototype.validateValue, formatDate : Ext.form.DateField.prototype.formatDate, parseDate: function(value) { if (!value || Ext.isDate(value)) { return value; } var id = this.initDate + ' ', idf = this.initDateFormat + ' ', v = Date.parseDate(id + value, idf + this.format), af = this.altFormats; if (!v && af) { if (!this.altFormatsArray) { this.altFormatsArray = af.split("|"); } for (var i = 0, afa = this.altFormatsArray, len = afa.length; i < len && !v; i++) { v = Date.parseDate(id + value, idf + afa[i]); } } return v; } }); Ext.reg('timefield', Ext.form.TimeField); Ext.form.SliderField = Ext.extend(Ext.form.Field, { useTips : true, tipText : null, actionMode: 'wrap', initComponent : function() { var cfg = Ext.copyTo({ id: this.id + '-slider' }, this.initialConfig, ['vertical', 'minValue', 'maxValue', 'decimalPrecision', 'keyIncrement', 'increment', 'clickToChange', 'animate']); if (this.useTips) { var plug = this.tipText ? {getText: this.tipText} : {}; cfg.plugins = [new Ext.slider.Tip(plug)]; } this.slider = new Ext.Slider(cfg); Ext.form.SliderField.superclass.initComponent.call(this); }, onRender : function(ct, position){ this.autoCreate = { id: this.id, name: this.name, type: 'hidden', tag: 'input' }; Ext.form.SliderField.superclass.onRender.call(this, ct, position); this.wrap = this.el.wrap({cls: 'x-form-field-wrap'}); this.resizeEl = this.positionEl = this.wrap; this.slider.render(this.wrap); }, onResize : function(w, h, aw, ah){ Ext.form.SliderField.superclass.onResize.call(this, w, h, aw, ah); this.slider.setSize(w, h); }, initEvents : function(){ Ext.form.SliderField.superclass.initEvents.call(this); this.slider.on('change', this.onChange, this); }, onChange : function(slider, v){ this.setValue(v, undefined, true); }, onEnable : function(){ Ext.form.SliderField.superclass.onEnable.call(this); this.slider.enable(); }, onDisable : function(){ Ext.form.SliderField.superclass.onDisable.call(this); this.slider.disable(); }, beforeDestroy : function(){ Ext.destroy(this.slider); Ext.form.SliderField.superclass.beforeDestroy.call(this); }, alignErrorIcon : function(){ this.errorIcon.alignTo(this.slider.el, 'tl-tr', [2, 0]); }, setMinValue : function(v){ this.slider.setMinValue(v); return this; }, setMaxValue : function(v){ this.slider.setMaxValue(v); return this; }, setValue : function(v, animate, silent){ if(!silent){ this.slider.setValue(v, animate); } return Ext.form.SliderField.superclass.setValue.call(this, this.slider.getValue()); }, getValue : function(){ return this.slider.getValue(); } }); Ext.reg('sliderfield', Ext.form.SliderField); Ext.form.Label = Ext.extend(Ext.BoxComponent, { onRender : function(ct, position){ if(!this.el){ this.el = document.createElement('label'); this.el.id = this.getId(); this.el.innerHTML = this.text ? Ext.util.Format.htmlEncode(this.text) : (this.html || ''); if(this.forId){ this.el.setAttribute('for', this.forId); } } Ext.form.Label.superclass.onRender.call(this, ct, position); }, setText : function(t, encode){ var e = encode === false; this[!e ? 'text' : 'html'] = t; delete this[e ? 'text' : 'html']; if(this.rendered){ this.el.dom.innerHTML = encode !== false ? Ext.util.Format.htmlEncode(t) : t; } return this; } }); Ext.reg('label', Ext.form.Label); Ext.form.Action = function(form, options){ this.form = form; this.options = options || {}; }; Ext.form.Action.CLIENT_INVALID = 'client'; Ext.form.Action.SERVER_INVALID = 'server'; Ext.form.Action.CONNECT_FAILURE = 'connect'; Ext.form.Action.LOAD_FAILURE = 'load'; Ext.form.Action.prototype = { type : 'default', run : function(options){ }, success : function(response){ }, handleResponse : function(response){ }, failure : function(response){ this.response = response; this.failureType = Ext.form.Action.CONNECT_FAILURE; this.form.afterAction(this, false); }, processResponse : function(response){ this.response = response; if(!response.responseText && !response.responseXML){ return true; } this.result = this.handleResponse(response); return this.result; }, decodeResponse: function(response) { try { return Ext.decode(response.responseText); } catch(e) { return false; } }, getUrl : function(appendParams){ var url = this.options.url || this.form.url || this.form.el.dom.action; if(appendParams){ var p = this.getParams(); if(p){ url = Ext.urlAppend(url, p); } } return url; }, getMethod : function(){ return (this.options.method || this.form.method || this.form.el.dom.method || 'POST').toUpperCase(); }, getParams : function(){ var bp = this.form.baseParams; var p = this.options.params; if(p){ if(typeof p == "object"){ p = Ext.urlEncode(Ext.applyIf(p, bp)); }else if(typeof p == 'string' && bp){ p += '&' + Ext.urlEncode(bp); } }else if(bp){ p = Ext.urlEncode(bp); } return p; }, createCallback : function(opts){ var opts = opts || {}; return { success: this.success, failure: this.failure, scope: this, timeout: (opts.timeout*1000) || (this.form.timeout*1000), upload: this.form.fileUpload ? this.success : undefined }; } }; Ext.form.Action.Submit = function(form, options){ Ext.form.Action.Submit.superclass.constructor.call(this, form, options); }; Ext.extend(Ext.form.Action.Submit, Ext.form.Action, { type : 'submit', run : function(){ var o = this.options, method = this.getMethod(), isGet = method == 'GET'; if(o.clientValidation === false || this.form.isValid()){ if (o.submitEmptyText === false) { var fields = this.form.items, emptyFields = [], setupEmptyFields = function(f){ if (f.el.getValue() == f.emptyText) { emptyFields.push(f); f.el.dom.value = ""; } if(f.isComposite && f.rendered){ f.items.each(setupEmptyFields); } }; fields.each(setupEmptyFields); } Ext.Ajax.request(Ext.apply(this.createCallback(o), { form:this.form.el.dom, url:this.getUrl(isGet), method: method, headers: o.headers, params:!isGet ? this.getParams() : null, isUpload: this.form.fileUpload })); if (o.submitEmptyText === false) { Ext.each(emptyFields, function(f) { if (f.applyEmptyText) { f.applyEmptyText(); } }); } }else if (o.clientValidation !== false){ this.failureType = Ext.form.Action.CLIENT_INVALID; this.form.afterAction(this, false); } }, success : function(response){ var result = this.processResponse(response); if(result === true || result.success){ this.form.afterAction(this, true); return; } if(result.errors){ this.form.markInvalid(result.errors); } this.failureType = Ext.form.Action.SERVER_INVALID; this.form.afterAction(this, false); }, handleResponse : function(response){ if(this.form.errorReader){ var rs = this.form.errorReader.read(response); var errors = []; if(rs.records){ for(var i = 0, len = rs.records.length; i < len; i++) { var r = rs.records[i]; errors[i] = r.data; } } if(errors.length < 1){ errors = null; } return { success : rs.success, errors : errors }; } return this.decodeResponse(response); } }); Ext.form.Action.Load = function(form, options){ Ext.form.Action.Load.superclass.constructor.call(this, form, options); this.reader = this.form.reader; }; Ext.extend(Ext.form.Action.Load, Ext.form.Action, { type : 'load', run : function(){ Ext.Ajax.request(Ext.apply( this.createCallback(this.options), { method:this.getMethod(), url:this.getUrl(false), headers: this.options.headers, params:this.getParams() })); }, success : function(response){ var result = this.processResponse(response); if(result === true || !result.success || !result.data){ this.failureType = Ext.form.Action.LOAD_FAILURE; this.form.afterAction(this, false); return; } this.form.clearInvalid(); this.form.setValues(result.data); this.form.afterAction(this, true); }, handleResponse : function(response){ if(this.form.reader){ var rs = this.form.reader.read(response); var data = rs.records && rs.records[0] ? rs.records[0].data : null; return { success : rs.success, data : data }; } return this.decodeResponse(response); } }); Ext.form.Action.DirectLoad = Ext.extend(Ext.form.Action.Load, { constructor: function(form, opts) { Ext.form.Action.DirectLoad.superclass.constructor.call(this, form, opts); }, type : 'directload', run : function(){ var args = this.getParams(); args.push(this.success, this); this.form.api.load.apply(window, args); }, getParams : function() { var buf = [], o = {}; var bp = this.form.baseParams; var p = this.options.params; Ext.apply(o, p, bp); var paramOrder = this.form.paramOrder; if(paramOrder){ for(var i = 0, len = paramOrder.length; i < len; i++){ buf.push(o[paramOrder[i]]); } }else if(this.form.paramsAsHash){ buf.push(o); } return buf; }, processResponse : function(result) { this.result = result; return result; }, success : function(response, trans){ if(trans.type == Ext.Direct.exceptions.SERVER){ response = {}; } Ext.form.Action.DirectLoad.superclass.success.call(this, response); } }); Ext.form.Action.DirectSubmit = Ext.extend(Ext.form.Action.Submit, { constructor : function(form, opts) { Ext.form.Action.DirectSubmit.superclass.constructor.call(this, form, opts); }, type : 'directsubmit', run : function(){ var o = this.options; if(o.clientValidation === false || this.form.isValid()){ this.success.params = this.getParams(); this.form.api.submit(this.form.el.dom, this.success, this); }else if (o.clientValidation !== false){ this.failureType = Ext.form.Action.CLIENT_INVALID; this.form.afterAction(this, false); } }, getParams : function() { var o = {}; var bp = this.form.baseParams; var p = this.options.params; Ext.apply(o, p, bp); return o; }, processResponse : function(result) { this.result = result; return result; }, success : function(response, trans){ if(trans.type == Ext.Direct.exceptions.SERVER){ response = {}; } Ext.form.Action.DirectSubmit.superclass.success.call(this, response); } }); Ext.form.Action.ACTION_TYPES = { 'load' : Ext.form.Action.Load, 'submit' : Ext.form.Action.Submit, 'directload' : Ext.form.Action.DirectLoad, 'directsubmit' : Ext.form.Action.DirectSubmit }; Ext.form.VTypes = function(){ var alpha = /^[a-zA-Z_]+$/, alphanum = /^[a-zA-Z0-9_]+$/, email = /^(\w+)([\-+.\'][\w]+)*@(\w[\-\w]*\.){1,5}([A-Za-z]){2,6}$/, url = /(((^https?)|(^ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i; return { 'email' : function(v){ return email.test(v); }, 'emailText' : 'This field should be an e-mail address in the format "user@example.com"', 'emailMask' : /[a-z0-9_\.\-\+\'@]/i, /** * The function used to validate URLs * @param {String} value The URL * @return {Boolean} true if the RegExp test passed, and false if not. */ 'url' : function(v){ return url.test(v); }, /** * The error text to display when the url validation function returns false. Defaults to: * 'This field should be a URL in the format "http:/'+'/www.example.com"' * @type String */ 'urlText' : 'This field should be a URL in the format "http:/'+'/www.example.com"', /** * The function used to validate alpha values * @param {String} value The value * @return {Boolean} true if the RegExp test passed, and false if not. */ 'alpha' : function(v){ return alpha.test(v); }, /** * The error text to display when the alpha validation function returns false. Defaults to: * 'This field should only contain letters and _' * @type String */ 'alphaText' : 'This field should only contain letters and _', /** * The keystroke filter mask to be applied on alpha input. Defaults to: * /[a-z_]/i * @type RegExp */ 'alphaMask' : /[a-z_]/i, /** * The function used to validate alphanumeric values * @param {String} value The value * @return {Boolean} true if the RegExp test passed, and false if not. */ 'alphanum' : function(v){ return alphanum.test(v); }, /** * The error text to display when the alphanumeric validation function returns false. Defaults to: * 'This field should only contain letters, numbers and _' * @type String */ 'alphanumText' : 'This field should only contain letters, numbers and _', /** * The keystroke filter mask to be applied on alphanumeric input. Defaults to: * /[a-z0-9_]/i * @type RegExp */ 'alphanumMask' : /[a-z0-9_]/i }; }(); /** * @class Ext.grid.GridPanel * @extends Ext.Panel *

    This class represents the primary interface of a component based grid control to represent data * in a tabular format of rows and columns. The GridPanel is composed of the following:

    *
      *
    • {@link Ext.data.Store Store} : The Model holding the data records (rows) *
    • *
    • {@link Ext.grid.ColumnModel Column model} : Column makeup *
    • *
    • {@link Ext.grid.GridView View} : Encapsulates the user interface *
    • *
    • {@link Ext.grid.AbstractSelectionModel selection model} : Selection behavior *
    • *
    *

    Example usage:

    *
    
    var grid = new Ext.grid.GridPanel({
        {@link #store}: new {@link Ext.data.Store}({
            {@link Ext.data.Store#autoDestroy autoDestroy}: true,
            {@link Ext.data.Store#reader reader}: reader,
            {@link Ext.data.Store#data data}: xg.dummyData
        }),
        {@link #colModel}: new {@link Ext.grid.ColumnModel}({
            {@link Ext.grid.ColumnModel#defaults defaults}: {
                width: 120,
                sortable: true
            },
            {@link Ext.grid.ColumnModel#columns columns}: [
                {id: 'company', header: 'Company', width: 200, sortable: true, dataIndex: 'company'},
                {header: 'Price', renderer: Ext.util.Format.usMoney, dataIndex: 'price'},
                {header: 'Change', dataIndex: 'change'},
                {header: '% Change', dataIndex: 'pctChange'},
                // instead of specifying renderer: Ext.util.Format.dateRenderer('m/d/Y') use xtype
                {
                    header: 'Last Updated', width: 135, dataIndex: 'lastChange',
                    xtype: 'datecolumn', format: 'M d, Y'
                }
            ]
        }),
        {@link #viewConfig}: {
            {@link Ext.grid.GridView#forceFit forceFit}: true,
    
    //      Return CSS class to apply to rows depending upon data values
            {@link Ext.grid.GridView#getRowClass getRowClass}: function(record, index) {
                var c = record.{@link Ext.data.Record#get get}('change');
                if (c < 0) {
                    return 'price-fall';
                } else if (c > 0) {
                    return 'price-rise';
                }
            }
        },
        {@link #sm}: new Ext.grid.RowSelectionModel({singleSelect:true}),
        width: 600,
        height: 300,
        frame: true,
        title: 'Framed with Row Selection and Horizontal Scrolling',
        iconCls: 'icon-grid'
    });
     * 
    *

    Notes:

    *
      *
    • Although this class inherits many configuration options from base classes, some of them * (such as autoScroll, autoWidth, layout, items, etc) are not used by this class, and will * have no effect.
    • *
    • A grid requires a width in which to scroll its columns, and a height in which to * scroll its rows. These dimensions can either be set explicitly through the * {@link Ext.BoxComponent#height height} and {@link Ext.BoxComponent#width width} * configuration options or implicitly set by using the grid as a child item of a * {@link Ext.Container Container} which will have a {@link Ext.Container#layout layout manager} * provide the sizing of its child items (for example the Container of the Grid may specify * {@link Ext.Container#layout layout}:'fit').
    • *
    • To access the data in a Grid, it is necessary to use the data model encapsulated * by the {@link #store Store}. See the {@link #cellclick} event for more details.
    • *
    * @constructor * @param {Object} config The config object * @xtype grid */ Ext.grid.GridPanel = Ext.extend(Ext.Panel, { /** * @cfg {String} autoExpandColumn *

    The {@link Ext.grid.Column#id id} of a {@link Ext.grid.Column column} in * this grid that should expand to fill unused space. This value specified here can not * be 0.

    *

    Note: If the Grid's {@link Ext.grid.GridView view} is configured with * {@link Ext.grid.GridView#forceFit forceFit}=true the autoExpandColumn * is ignored. See {@link Ext.grid.Column}.{@link Ext.grid.Column#width width} * for additional details.

    *

    See {@link #autoExpandMax} and {@link #autoExpandMin} also.

    */ autoExpandColumn : false, autoExpandMax : 1000, autoExpandMin : 50, columnLines : false, ddText : '{0} selected row{1}', deferRowRender : true, enableColumnHide : true, enableColumnMove : true, enableDragDrop : false, enableHdMenu : true, loadMask : false, minColumnWidth : 25, stripeRows : false, trackMouseOver : true, stateEvents : ['columnmove', 'columnresize', 'sortchange', 'groupchange'], view : null, bubbleEvents: [], rendered : false, viewReady : false, initComponent : function() { Ext.grid.GridPanel.superclass.initComponent.call(this); if (this.columnLines) { this.cls = (this.cls || '') + ' x-grid-with-col-lines'; } this.autoScroll = false; this.autoWidth = false; if(Ext.isArray(this.columns)){ this.colModel = new Ext.grid.ColumnModel(this.columns); delete this.columns; } if(this.ds){ this.store = this.ds; delete this.ds; } if(this.cm){ this.colModel = this.cm; delete this.cm; } if(this.sm){ this.selModel = this.sm; delete this.sm; } this.store = Ext.StoreMgr.lookup(this.store); this.addEvents( 'click', 'dblclick', 'contextmenu', 'mousedown', 'mouseup', 'mouseover', 'mouseout', 'keypress', 'keydown', 'cellmousedown', 'rowmousedown', 'headermousedown', 'groupmousedown', 'rowbodymousedown', 'containermousedown', 'cellclick', 'celldblclick', 'rowclick', 'rowdblclick', 'headerclick', 'headerdblclick', 'groupclick', 'groupdblclick', 'containerclick', 'containerdblclick', 'rowbodyclick', 'rowbodydblclick', 'rowcontextmenu', 'cellcontextmenu', 'headercontextmenu', 'groupcontextmenu', 'containercontextmenu', 'rowbodycontextmenu', 'bodyscroll', 'columnresize', 'columnmove', 'sortchange', 'groupchange', 'reconfigure', 'viewready' ); }, onRender : function(ct, position){ Ext.grid.GridPanel.superclass.onRender.apply(this, arguments); var c = this.getGridEl(); this.el.addClass('x-grid-panel'); this.mon(c, { scope: this, mousedown: this.onMouseDown, click: this.onClick, dblclick: this.onDblClick, contextmenu: this.onContextMenu }); this.relayEvents(c, ['mousedown','mouseup','mouseover','mouseout','keypress', 'keydown']); var view = this.getView(); view.init(this); view.render(); this.getSelectionModel().init(this); }, initEvents : function(){ Ext.grid.GridPanel.superclass.initEvents.call(this); if(this.loadMask){ this.loadMask = new Ext.LoadMask(this.bwrap, Ext.apply({store:this.store}, this.loadMask)); } }, initStateEvents : function(){ Ext.grid.GridPanel.superclass.initStateEvents.call(this); this.mon(this.colModel, 'hiddenchange', this.saveState, this, {delay: 100}); }, applyState : function(state){ var cm = this.colModel, cs = state.columns, store = this.store, s, c, colIndex; if(cs){ for(var i = 0, len = cs.length; i < len; i++){ s = cs[i]; c = cm.getColumnById(s.id); if(c){ colIndex = cm.getIndexById(s.id); cm.setState(colIndex, { hidden: s.hidden, width: s.width, sortable: s.sortable }); if(colIndex != i){ cm.moveColumn(colIndex, i); } } } } if(store){ s = state.sort; if(s){ store[store.remoteSort ? 'setDefaultSort' : 'sort'](s.field, s.direction); } s = state.group; if(store.groupBy){ if(s){ store.groupBy(s); }else{ store.clearGrouping(); } } } var o = Ext.apply({}, state); delete o.columns; delete o.sort; Ext.grid.GridPanel.superclass.applyState.call(this, o); }, getState : function(){ var o = {columns: []}, store = this.store, ss, gs; for(var i = 0, c; (c = this.colModel.config[i]); i++){ o.columns[i] = { id: c.id, width: c.width }; if(c.hidden){ o.columns[i].hidden = true; } if(c.sortable){ o.columns[i].sortable = true; } } if(store){ ss = store.getSortState(); if(ss){ o.sort = ss; } if(store.getGroupState){ gs = store.getGroupState(); if(gs){ o.group = gs; } } } return o; }, afterRender : function(){ Ext.grid.GridPanel.superclass.afterRender.call(this); var v = this.view; this.on('bodyresize', v.layout, v); v.layout(true); if(this.deferRowRender){ if (!this.deferRowRenderTask){ this.deferRowRenderTask = new Ext.util.DelayedTask(v.afterRender, this.view); } this.deferRowRenderTask.delay(10); }else{ v.afterRender(); } this.viewReady = true; }, reconfigure : function(store, colModel){ var rendered = this.rendered; if(rendered){ if(this.loadMask){ this.loadMask.destroy(); this.loadMask = new Ext.LoadMask(this.bwrap, Ext.apply({}, {store:store}, this.initialConfig.loadMask)); } } if(this.view){ this.view.initData(store, colModel); } this.store = store; this.colModel = colModel; if(rendered){ this.view.refresh(true); } this.fireEvent('reconfigure', this, store, colModel); }, onDestroy : function(){ if (this.deferRowRenderTask && this.deferRowRenderTask.cancel){ this.deferRowRenderTask.cancel(); } if(this.rendered){ Ext.destroy(this.view, this.loadMask); }else if(this.store && this.store.autoDestroy){ this.store.destroy(); } Ext.destroy(this.colModel, this.selModel); this.store = this.selModel = this.colModel = this.view = this.loadMask = null; Ext.grid.GridPanel.superclass.onDestroy.call(this); }, processEvent : function(name, e){ this.view.processEvent(name, e); }, onClick : function(e){ this.processEvent('click', e); }, onMouseDown : function(e){ this.processEvent('mousedown', e); }, onContextMenu : function(e, t){ this.processEvent('contextmenu', e); }, onDblClick : function(e){ this.processEvent('dblclick', e); }, walkCells : function(row, col, step, fn, scope){ var cm = this.colModel, clen = cm.getColumnCount(), ds = this.store, rlen = ds.getCount(), first = true; if(step < 0){ if(col < 0){ row--; first = false; } while(row >= 0){ if(!first){ col = clen-1; } first = false; while(col >= 0){ if(fn.call(scope || this, row, col, cm) === true){ return [row, col]; } col--; } row--; } } else { if(col >= clen){ row++; first = false; } while(row < rlen){ if(!first){ col = 0; } first = false; while(col < clen){ if(fn.call(scope || this, row, col, cm) === true){ return [row, col]; } col++; } row++; } } return null; }, getGridEl : function(){ return this.body; }, stopEditing : Ext.emptyFn, getSelectionModel : function(){ if(!this.selModel){ this.selModel = new Ext.grid.RowSelectionModel( this.disableSelection ? {selectRow: Ext.emptyFn} : null); } return this.selModel; }, getStore : function(){ return this.store; }, getColumnModel : function(){ return this.colModel; }, getView : function() { if (!this.view) { this.view = new Ext.grid.GridView(this.viewConfig); } return this.view; }, getDragDropText : function(){ var count = this.selModel.getCount(); return String.format(this.ddText, count, count == 1 ? '' : 's'); } }); Ext.reg('grid', Ext.grid.GridPanel); Ext.grid.PivotGrid = Ext.extend(Ext.grid.GridPanel, { aggregator: 'sum', renderer: undefined, initComponent: function() { Ext.grid.PivotGrid.superclass.initComponent.apply(this, arguments); this.initAxes(); this.enableColumnResize = false; this.viewConfig = Ext.apply(this.viewConfig || {}, { forceFit: true }); this.colModel = new Ext.grid.ColumnModel({}); }, getAggregator: function() { if (typeof this.aggregator == 'string') { return Ext.grid.PivotAggregatorMgr.types[this.aggregator]; } else { return this.aggregator; } }, setAggregator: function(aggregator) { this.aggregator = aggregator; }, setMeasure: function(measure) { this.measure = measure; }, setLeftAxis: function(axis, refresh) { this.leftAxis = axis; if (refresh) { this.view.refresh(); } }, setTopAxis: function(axis, refresh) { this.topAxis = axis; if (refresh) { this.view.refresh(); } }, initAxes: function() { var PivotAxis = Ext.grid.PivotAxis; if (!(this.leftAxis instanceof PivotAxis)) { this.setLeftAxis(new PivotAxis({ orientation: 'vertical', dimensions : this.leftAxis || [], store : this.store })); }; if (!(this.topAxis instanceof PivotAxis)) { this.setTopAxis(new PivotAxis({ orientation: 'horizontal', dimensions : this.topAxis || [], store : this.store })); }; }, extractData: function() { var records = this.store.data.items, recCount = records.length, cells = [], record, i, j, k; if (recCount == 0) { return []; } var leftTuples = this.leftAxis.getTuples(), leftCount = leftTuples.length, topTuples = this.topAxis.getTuples(), topCount = topTuples.length, aggregator = this.getAggregator(); for (i = 0; i < recCount; i++) { record = records[i]; for (j = 0; j < leftCount; j++) { cells[j] = cells[j] || []; if (leftTuples[j].matcher(record) === true) { for (k = 0; k < topCount; k++) { cells[j][k] = cells[j][k] || []; if (topTuples[k].matcher(record)) { cells[j][k].push(record); } } } } } var rowCount = cells.length, colCount, row; for (i = 0; i < rowCount; i++) { row = cells[i]; colCount = row.length; for (j = 0; j < colCount; j++) { cells[i][j] = aggregator(cells[i][j], this.measure); } } return cells; }, getView: function() { if (!this.view) { this.view = new Ext.grid.PivotGridView(this.viewConfig); } return this.view; } }); Ext.reg('pivotgrid', Ext.grid.PivotGrid); Ext.grid.PivotAggregatorMgr = new Ext.AbstractManager(); Ext.grid.PivotAggregatorMgr.registerType('sum', function(records, measure) { var length = records.length, total = 0, i; for (i = 0; i < length; i++) { total += records[i].get(measure); } return total; }); Ext.grid.PivotAggregatorMgr.registerType('avg', function(records, measure) { var length = records.length, total = 0, i; for (i = 0; i < length; i++) { total += records[i].get(measure); } return (total / length) || 'n/a'; }); Ext.grid.PivotAggregatorMgr.registerType('min', function(records, measure) { var data = [], length = records.length, i; for (i = 0; i < length; i++) { data.push(records[i].get(measure)); } return Math.min.apply(this, data) || 'n/a'; }); Ext.grid.PivotAggregatorMgr.registerType('max', function(records, measure) { var data = [], length = records.length, i; for (i = 0; i < length; i++) { data.push(records[i].get(measure)); } return Math.max.apply(this, data) || 'n/a'; }); Ext.grid.PivotAggregatorMgr.registerType('count', function(records, measure) { return records.length; }); Ext.grid.GridView = Ext.extend(Ext.util.Observable, { deferEmptyText : true, scrollOffset : undefined, autoFill : false, forceFit : false, sortClasses : ['sort-asc', 'sort-desc'], sortAscText : 'Sort Ascending', sortDescText : 'Sort Descending', columnsText : 'Columns', selectedRowClass : 'x-grid3-row-selected', borderWidth : 2, tdClass : 'x-grid3-cell', hdCls : 'x-grid3-hd', markDirty : true, cellSelectorDepth : 4, rowSelectorDepth : 10, rowBodySelectorDepth : 10, cellSelector : 'td.x-grid3-cell', rowSelector : 'div.x-grid3-row', rowBodySelector : 'div.x-grid3-row-body', firstRowCls: 'x-grid3-row-first', lastRowCls: 'x-grid3-row-last', rowClsRe: /(?:^|\s+)x-grid3-row-(first|last|alt)(?:\s+|$)/g, headerMenuOpenCls: 'x-grid3-hd-menu-open', rowOverCls: 'x-grid3-row-over', constructor : function(config) { Ext.apply(this, config); this.addEvents( 'beforerowremoved', 'beforerowsinserted', 'beforerefresh', 'rowremoved', 'rowsinserted', 'rowupdated', 'refresh' ); Ext.grid.GridView.superclass.constructor.call(this); }, masterTpl: new Ext.Template( '
    ', '
    ', '
    ', '
    ', '
    {header}
    ', '
    ', '
    ', '
    ', '
    ', '
    {body}
    ', '', '
    ', '
    ', '
     
    ', '
     
    ', '
    ' ), headerTpl: new Ext.Template( '', '', '{cells}', '', '
    ' ), bodyTpl: new Ext.Template('{rows}'), cellTpl: new Ext.Template( '', '
    {value}
    ', '' ), initTemplates : function() { var templates = this.templates || {}, template, name, headerCellTpl = new Ext.Template( '', '
    ', this.grid.enableHdMenu ? '' : '', '{value}', '', '
    ', '' ), rowBodyText = [ '', '', '
    {body}
    ', '', '' ].join(""), innerText = [ '', '', '{cells}', this.enableRowBody ? rowBodyText : '', '', '
    ' ].join(""); Ext.applyIf(templates, { hcell : headerCellTpl, cell : this.cellTpl, body : this.bodyTpl, header : this.headerTpl, master : this.masterTpl, row : new Ext.Template('
    ' + innerText + '
    '), rowInner: new Ext.Template(innerText) }); for (name in templates) { template = templates[name]; if (template && Ext.isFunction(template.compile) && !template.compiled) { template.disableFormats = true; template.compile(); } } this.templates = templates; this.colRe = new RegExp('x-grid3-td-([^\\s]+)', ''); }, fly : function(el) { if (!this._flyweight) { this._flyweight = new Ext.Element.Flyweight(document.body); } this._flyweight.dom = el; return this._flyweight; }, getEditorParent : function() { return this.scroller.dom; }, initElements : function() { var Element = Ext.Element, el = Ext.get(this.grid.getGridEl().dom.firstChild), mainWrap = new Element(el.child('div.x-grid3-viewport')), mainHd = new Element(mainWrap.child('div.x-grid3-header')), scroller = new Element(mainWrap.child('div.x-grid3-scroller')); if (this.grid.hideHeaders) { mainHd.setDisplayed(false); } if (this.forceFit) { scroller.setStyle('overflow-x', 'hidden'); } Ext.apply(this, { el : el, mainWrap: mainWrap, scroller: scroller, mainHd : mainHd, innerHd : mainHd.child('div.x-grid3-header-inner').dom, mainBody: new Element(Element.fly(scroller).child('div.x-grid3-body')), focusEl : new Element(Element.fly(scroller).child('a')), resizeMarker: new Element(el.child('div.x-grid3-resize-marker')), resizeProxy : new Element(el.child('div.x-grid3-resize-proxy')) }); this.focusEl.swallowEvent('click', true); }, getRows : function() { return this.hasRows() ? this.mainBody.dom.childNodes : []; }, findCell : function(el) { if (!el) { return false; } return this.fly(el).findParent(this.cellSelector, this.cellSelectorDepth); }, findCellIndex : function(el, requiredCls) { var cell = this.findCell(el), hasCls; if (cell) { hasCls = this.fly(cell).hasClass(requiredCls); if (!requiredCls || hasCls) { return this.getCellIndex(cell); } } return false; }, getCellIndex : function(el) { if (el) { var match = el.className.match(this.colRe); if (match && match[1]) { return this.cm.getIndexById(match[1]); } } return false; }, findHeaderCell : function(el) { var cell = this.findCell(el); return cell && this.fly(cell).hasClass(this.hdCls) ? cell : null; }, findHeaderIndex : function(el){ return this.findCellIndex(el, this.hdCls); }, findRow : function(el) { if (!el) { return false; } return this.fly(el).findParent(this.rowSelector, this.rowSelectorDepth); }, findRowIndex : function(el) { var row = this.findRow(el); return row ? row.rowIndex : false; }, findRowBody : function(el) { if (!el) { return false; } return this.fly(el).findParent(this.rowBodySelector, this.rowBodySelectorDepth); }, getRow : function(row) { return this.getRows()[row]; }, getCell : function(row, col) { return Ext.fly(this.getRow(row)).query(this.cellSelector)[col]; }, getHeaderCell : function(index) { return this.mainHd.dom.getElementsByTagName('td')[index]; }, addRowClass : function(rowId, cls) { var row = this.getRow(rowId); if (row) { this.fly(row).addClass(cls); } }, removeRowClass : function(row, cls) { var r = this.getRow(row); if(r){ this.fly(r).removeClass(cls); } }, removeRow : function(row) { Ext.removeNode(this.getRow(row)); this.syncFocusEl(row); }, removeRows : function(firstRow, lastRow) { var bd = this.mainBody.dom, rowIndex; for (rowIndex = firstRow; rowIndex <= lastRow; rowIndex++){ Ext.removeNode(bd.childNodes[firstRow]); } this.syncFocusEl(firstRow); }, getScrollState : function() { var sb = this.scroller.dom; return { left: sb.scrollLeft, top : sb.scrollTop }; }, restoreScroll : function(state) { var sb = this.scroller.dom; sb.scrollLeft = state.left; sb.scrollTop = state.top; }, scrollToTop : function() { var dom = this.scroller.dom; dom.scrollTop = 0; dom.scrollLeft = 0; }, syncScroll : function() { this.syncHeaderScroll(); var mb = this.scroller.dom; this.grid.fireEvent('bodyscroll', mb.scrollLeft, mb.scrollTop); }, syncHeaderScroll : function() { var innerHd = this.innerHd, scrollLeft = this.scroller.dom.scrollLeft; innerHd.scrollLeft = scrollLeft; innerHd.scrollLeft = scrollLeft; }, updateSortIcon : function(col, dir) { var sortClasses = this.sortClasses, sortClass = sortClasses[dir == "DESC" ? 1 : 0], headers = this.mainHd.select('td').removeClass(sortClasses); headers.item(col).addClass(sortClass); }, updateAllColumnWidths : function() { var totalWidth = this.getTotalWidth(), colCount = this.cm.getColumnCount(), rows = this.getRows(), rowCount = rows.length, widths = [], row, rowFirstChild, trow, i, j; for (i = 0; i < colCount; i++) { widths[i] = this.getColumnWidth(i); this.getHeaderCell(i).style.width = widths[i]; } this.updateHeaderWidth(); for (i = 0; i < rowCount; i++) { row = rows[i]; row.style.width = totalWidth; rowFirstChild = row.firstChild; if (rowFirstChild) { rowFirstChild.style.width = totalWidth; trow = rowFirstChild.rows[0]; for (j = 0; j < colCount; j++) { trow.childNodes[j].style.width = widths[j]; } } } this.onAllColumnWidthsUpdated(widths, totalWidth); }, updateColumnWidth : function(column, width) { var columnWidth = this.getColumnWidth(column), totalWidth = this.getTotalWidth(), headerCell = this.getHeaderCell(column), nodes = this.getRows(), nodeCount = nodes.length, row, i, firstChild; this.updateHeaderWidth(); headerCell.style.width = columnWidth; for (i = 0; i < nodeCount; i++) { row = nodes[i]; firstChild = row.firstChild; row.style.width = totalWidth; if (firstChild) { firstChild.style.width = totalWidth; firstChild.rows[0].childNodes[column].style.width = columnWidth; } } this.onColumnWidthUpdated(column, columnWidth, totalWidth); }, updateColumnHidden : function(col, hidden) { var totalWidth = this.getTotalWidth(), display = hidden ? 'none' : '', headerCell = this.getHeaderCell(col), nodes = this.getRows(), nodeCount = nodes.length, row, rowFirstChild, i; this.updateHeaderWidth(); headerCell.style.display = display; for (i = 0; i < nodeCount; i++) { row = nodes[i]; row.style.width = totalWidth; rowFirstChild = row.firstChild; if (rowFirstChild) { rowFirstChild.style.width = totalWidth; rowFirstChild.rows[0].childNodes[col].style.display = display; } } this.onColumnHiddenUpdated(col, hidden, totalWidth); delete this.lastViewWidth; this.layout(); }, doRender : function(columns, records, store, startRow, colCount, stripe) { var templates = this.templates, cellTemplate = templates.cell, rowTemplate = templates.row, last = colCount - 1, tstyle = 'width:' + this.getTotalWidth() + ';', rowBuffer = [], colBuffer = [], rowParams = {tstyle: tstyle}, meta = {}, len = records.length, alt, column, record, i, j, rowIndex; for (j = 0; j < len; j++) { record = records[j]; colBuffer = []; rowIndex = j + startRow; for (i = 0; i < colCount; i++) { column = columns[i]; meta.id = column.id; meta.css = i === 0 ? 'x-grid3-cell-first ' : (i == last ? 'x-grid3-cell-last ' : ''); meta.attr = meta.cellAttr = ''; meta.style = column.style; meta.value = column.renderer.call(column.scope, record.data[column.name], meta, record, rowIndex, i, store); if (Ext.isEmpty(meta.value)) { meta.value = ' '; } if (this.markDirty && record.dirty && typeof record.modified[column.name] != 'undefined') { meta.css += ' x-grid3-dirty-cell'; } colBuffer[colBuffer.length] = cellTemplate.apply(meta); } alt = []; if (stripe && ((rowIndex + 1) % 2 === 0)) { alt[0] = 'x-grid3-row-alt'; } if (record.dirty) { alt[1] = ' x-grid3-dirty-row'; } rowParams.cols = colCount; if (this.getRowClass) { alt[2] = this.getRowClass(record, rowIndex, rowParams, store); } rowParams.alt = alt.join(' '); rowParams.cells = colBuffer.join(''); rowBuffer[rowBuffer.length] = rowTemplate.apply(rowParams); } return rowBuffer.join(''); }, processRows : function(startRow, skipStripe) { if (!this.ds || this.ds.getCount() < 1) { return; } var rows = this.getRows(), length = rows.length, row, i; skipStripe = skipStripe || !this.grid.stripeRows; startRow = startRow || 0; for (i = 0; i < length; i++) { row = rows[i]; if (row) { row.rowIndex = i; if (!skipStripe) { row.className = row.className.replace(this.rowClsRe, ' '); if ((i + 1) % 2 === 0){ row.className += ' x-grid3-row-alt'; } } } } if (startRow === 0) { Ext.fly(rows[0]).addClass(this.firstRowCls); } Ext.fly(rows[length - 1]).addClass(this.lastRowCls); }, afterRender : function() { if (!this.ds || !this.cm) { return; } this.mainBody.dom.innerHTML = this.renderBody() || ' '; this.processRows(0, true); if (this.deferEmptyText !== true) { this.applyEmptyText(); } this.grid.fireEvent('viewready', this.grid); }, afterRenderUI: function() { var grid = this.grid; this.initElements(); Ext.fly(this.innerHd).on('click', this.handleHdDown, this); this.mainHd.on({ scope : this, mouseover: this.handleHdOver, mouseout : this.handleHdOut, mousemove: this.handleHdMove }); this.scroller.on('scroll', this.syncScroll, this); if (grid.enableColumnResize !== false) { this.splitZone = new Ext.grid.GridView.SplitDragZone(grid, this.mainHd.dom); } if (grid.enableColumnMove) { this.columnDrag = new Ext.grid.GridView.ColumnDragZone(grid, this.innerHd); this.columnDrop = new Ext.grid.HeaderDropZone(grid, this.mainHd.dom); } if (grid.enableHdMenu !== false) { this.hmenu = new Ext.menu.Menu({id: grid.id + '-hctx'}); this.hmenu.add( {itemId:'asc', text: this.sortAscText, cls: 'xg-hmenu-sort-asc'}, {itemId:'desc', text: this.sortDescText, cls: 'xg-hmenu-sort-desc'} ); if (grid.enableColumnHide !== false) { this.colMenu = new Ext.menu.Menu({id:grid.id + '-hcols-menu'}); this.colMenu.on({ scope : this, beforeshow: this.beforeColMenuShow, itemclick : this.handleHdMenuClick }); this.hmenu.add('-', { itemId:'columns', hideOnClick: false, text: this.columnsText, menu: this.colMenu, iconCls: 'x-cols-icon' }); } this.hmenu.on('itemclick', this.handleHdMenuClick, this); } if (grid.trackMouseOver) { this.mainBody.on({ scope : this, mouseover: this.onRowOver, mouseout : this.onRowOut }); } if (grid.enableDragDrop || grid.enableDrag) { this.dragZone = new Ext.grid.GridDragZone(grid, { ddGroup : grid.ddGroup || 'GridDD' }); } this.updateHeaderSortState(); }, renderUI : function() { var templates = this.templates; return templates.master.apply({ body : templates.body.apply({rows:' '}), header: this.renderHeaders(), ostyle: 'width:' + this.getOffsetWidth() + ';', bstyle: 'width:' + this.getTotalWidth() + ';' }); }, processEvent : function(name, e) { var target = e.getTarget(), grid = this.grid, header = this.findHeaderIndex(target), row, cell, col, body; grid.fireEvent(name, e); if (header !== false) { grid.fireEvent('header' + name, grid, header, e); } else { row = this.findRowIndex(target); if (row !== false) { cell = this.findCellIndex(target); if (cell !== false) { col = grid.colModel.getColumnAt(cell); if (grid.fireEvent('cell' + name, grid, row, cell, e) !== false) { if (!col || (col.processEvent && (col.processEvent(name, e, grid, row, cell) !== false))) { grid.fireEvent('row' + name, grid, row, e); } } } else { if (grid.fireEvent('row' + name, grid, row, e) !== false) { (body = this.findRowBody(target)) && grid.fireEvent('rowbody' + name, grid, row, e); } } } else { grid.fireEvent('container' + name, grid, e); } } }, layout : function(initial) { if (!this.mainBody) { return; } var grid = this.grid, gridEl = grid.getGridEl(), gridSize = gridEl.getSize(true), gridWidth = gridSize.width, gridHeight = gridSize.height, scroller = this.scroller, scrollStyle, headerHeight, scrollHeight; if (gridWidth < 20 || gridHeight < 20) { return; } if (grid.autoHeight) { scrollStyle = scroller.dom.style; scrollStyle.overflow = 'visible'; if (Ext.isWebKit) { scrollStyle.position = 'static'; } } else { this.el.setSize(gridWidth, gridHeight); headerHeight = this.mainHd.getHeight(); scrollHeight = gridHeight - headerHeight; scroller.setSize(gridWidth, scrollHeight); if (this.innerHd) { this.innerHd.style.width = (gridWidth) + "px"; } } if (this.forceFit || (initial === true && this.autoFill)) { if (this.lastViewWidth != gridWidth) { this.fitColumns(false, false); this.lastViewWidth = gridWidth; } } else { this.autoExpand(); this.syncHeaderScroll(); } this.onLayout(gridWidth, scrollHeight); }, onLayout : function(vw, vh) { }, onColumnWidthUpdated : function(col, w, tw) { }, onAllColumnWidthsUpdated : function(ws, tw) { }, onColumnHiddenUpdated : function(col, hidden, tw) { }, updateColumnText : function(col, text) { }, afterMove : function(colIndex) { }, init : function(grid) { this.grid = grid; this.initTemplates(); this.initData(grid.store, grid.colModel); this.initUI(grid); }, getColumnId : function(index){ return this.cm.getColumnId(index); }, getOffsetWidth : function() { return (this.cm.getTotalWidth() + this.getScrollOffset()) + 'px'; }, getScrollOffset: function() { return Ext.num(this.scrollOffset, Ext.getScrollBarWidth()); }, renderHeaders : function() { var colModel = this.cm, templates = this.templates, headerTpl = templates.hcell, properties = {}, colCount = colModel.getColumnCount(), last = colCount - 1, cells = [], i, cssCls; for (i = 0; i < colCount; i++) { if (i == 0) { cssCls = 'x-grid3-cell-first '; } else { cssCls = i == last ? 'x-grid3-cell-last ' : ''; } properties = { id : colModel.getColumnId(i), value : colModel.getColumnHeader(i) || '', style : this.getColumnStyle(i, true), css : cssCls, tooltip: this.getColumnTooltip(i) }; if (colModel.config[i].align == 'right') { properties.istyle = 'padding-right: 16px;'; } else { delete properties.istyle; } cells[i] = headerTpl.apply(properties); } return templates.header.apply({ cells : cells.join(""), tstyle: String.format("width: {0};", this.getTotalWidth()) }); }, getColumnTooltip : function(i) { var tooltip = this.cm.getColumnTooltip(i); if (tooltip) { if (Ext.QuickTips.isEnabled()) { return 'ext:qtip="' + tooltip + '"'; } else { return 'title="' + tooltip + '"'; } } return ''; }, beforeUpdate : function() { this.grid.stopEditing(true); }, updateHeaders : function() { this.innerHd.firstChild.innerHTML = this.renderHeaders(); this.updateHeaderWidth(false); }, updateHeaderWidth: function(updateMain) { var innerHdChild = this.innerHd.firstChild, totalWidth = this.getTotalWidth(); innerHdChild.style.width = this.getOffsetWidth(); innerHdChild.firstChild.style.width = totalWidth; if (updateMain !== false) { this.mainBody.dom.style.width = totalWidth; } }, focusRow : function(row) { this.focusCell(row, 0, false); }, focusCell : function(row, col, hscroll) { this.syncFocusEl(this.ensureVisible(row, col, hscroll)); var focusEl = this.focusEl; if (Ext.isGecko) { focusEl.focus(); } else { focusEl.focus.defer(1, focusEl); } }, resolveCell : function(row, col, hscroll) { if (!Ext.isNumber(row)) { row = row.rowIndex; } if (!this.ds) { return null; } if (row < 0 || row >= this.ds.getCount()) { return null; } col = (col !== undefined ? col : 0); var rowEl = this.getRow(row), colModel = this.cm, colCount = colModel.getColumnCount(), cellEl; if (!(hscroll === false && col === 0)) { while (col < colCount && colModel.isHidden(col)) { col++; } cellEl = this.getCell(row, col); } return {row: rowEl, cell: cellEl}; }, getResolvedXY : function(resolved) { if (!resolved) { return null; } var cell = resolved.cell, row = resolved.row; if (cell) { return Ext.fly(cell).getXY(); } else { return [this.el.getX(), Ext.fly(row).getY()]; } }, syncFocusEl : function(row, col, hscroll) { var xy = row; if (!Ext.isArray(xy)) { row = Math.min(row, Math.max(0, this.getRows().length-1)); if (isNaN(row)) { return; } xy = this.getResolvedXY(this.resolveCell(row, col, hscroll)); } this.focusEl.setXY(xy || this.scroller.getXY()); }, ensureVisible : function(row, col, hscroll) { var resolved = this.resolveCell(row, col, hscroll); if (!resolved || !resolved.row) { return null; } var rowEl = resolved.row, cellEl = resolved.cell, c = this.scroller.dom, p = rowEl, ctop = 0, stop = this.el.dom; while (p && p != stop) { ctop += p.offsetTop; p = p.offsetParent; } ctop -= this.mainHd.dom.offsetHeight; stop = parseInt(c.scrollTop, 10); var cbot = ctop + rowEl.offsetHeight, ch = c.clientHeight, sbot = stop + ch; if (ctop < stop) { c.scrollTop = ctop; } else if(cbot > sbot) { c.scrollTop = cbot-ch; } if (hscroll !== false) { var cleft = parseInt(cellEl.offsetLeft, 10), cright = cleft + cellEl.offsetWidth, sleft = parseInt(c.scrollLeft, 10), sright = sleft + c.clientWidth; if (cleft < sleft) { c.scrollLeft = cleft; } else if(cright > sright) { c.scrollLeft = cright-c.clientWidth; } } return this.getResolvedXY(resolved); }, insertRows : function(dm, firstRow, lastRow, isUpdate) { var last = dm.getCount() - 1; if( !isUpdate && firstRow === 0 && lastRow >= last) { this.fireEvent('beforerowsinserted', this, firstRow, lastRow); this.refresh(); this.fireEvent('rowsinserted', this, firstRow, lastRow); } else { if (!isUpdate) { this.fireEvent('beforerowsinserted', this, firstRow, lastRow); } var html = this.renderRows(firstRow, lastRow), before = this.getRow(firstRow); if (before) { if(firstRow === 0){ Ext.fly(this.getRow(0)).removeClass(this.firstRowCls); } Ext.DomHelper.insertHtml('beforeBegin', before, html); } else { var r = this.getRow(last - 1); if(r){ Ext.fly(r).removeClass(this.lastRowCls); } Ext.DomHelper.insertHtml('beforeEnd', this.mainBody.dom, html); } if (!isUpdate) { this.processRows(firstRow); this.fireEvent('rowsinserted', this, firstRow, lastRow); } else if (firstRow === 0 || firstRow >= last) { Ext.fly(this.getRow(firstRow)).addClass(firstRow === 0 ? this.firstRowCls : this.lastRowCls); } } this.syncFocusEl(firstRow); }, deleteRows : function(dm, firstRow, lastRow) { if (dm.getRowCount() < 1) { this.refresh(); } else { this.fireEvent('beforerowsdeleted', this, firstRow, lastRow); this.removeRows(firstRow, lastRow); this.processRows(firstRow); this.fireEvent('rowsdeleted', this, firstRow, lastRow); } }, getColumnStyle : function(colIndex, isHeader) { var colModel = this.cm, colConfig = colModel.config, style = isHeader ? '' : colConfig[colIndex].css || '', align = colConfig[colIndex].align; style += String.format("width: {0};", this.getColumnWidth(colIndex)); if (colModel.isHidden(colIndex)) { style += 'display: none; '; } if (align) { style += String.format("text-align: {0};", align); } return style; }, getColumnWidth : function(column) { var columnWidth = this.cm.getColumnWidth(column), borderWidth = this.borderWidth; if (Ext.isNumber(columnWidth)) { if (Ext.isBorderBox || (Ext.isWebKit && !Ext.isSafari2)) { return columnWidth + "px"; } else { return Math.max(columnWidth - borderWidth, 0) + "px"; } } else { return columnWidth; } }, getTotalWidth : function() { return this.cm.getTotalWidth() + 'px'; }, fitColumns : function(preventRefresh, onlyExpand, omitColumn) { var grid = this.grid, colModel = this.cm, totalColWidth = colModel.getTotalWidth(false), gridWidth = this.getGridInnerWidth(), extraWidth = gridWidth - totalColWidth, columns = [], extraCol = 0, width = 0, colWidth, fraction, i; if (gridWidth < 20 || extraWidth === 0) { return false; } var visibleColCount = colModel.getColumnCount(true), totalColCount = colModel.getColumnCount(false), adjCount = visibleColCount - (Ext.isNumber(omitColumn) ? 1 : 0); if (adjCount === 0) { adjCount = 1; omitColumn = undefined; } for (i = 0; i < totalColCount; i++) { if (!colModel.isFixed(i) && i !== omitColumn) { colWidth = colModel.getColumnWidth(i); columns.push(i, colWidth); if (!colModel.isHidden(i)) { extraCol = i; width += colWidth; } } } fraction = (gridWidth - colModel.getTotalWidth()) / width; while (columns.length) { colWidth = columns.pop(); i = columns.pop(); colModel.setColumnWidth(i, Math.max(grid.minColumnWidth, Math.floor(colWidth + colWidth * fraction)), true); } totalColWidth = colModel.getTotalWidth(false); if (totalColWidth > gridWidth) { var adjustCol = (adjCount == visibleColCount) ? extraCol : omitColumn, newWidth = Math.max(1, colModel.getColumnWidth(adjustCol) - (totalColWidth - gridWidth)); colModel.setColumnWidth(adjustCol, newWidth, true); } if (preventRefresh !== true) { this.updateAllColumnWidths(); } return true; }, autoExpand : function(preventUpdate) { var grid = this.grid, colModel = this.cm, gridWidth = this.getGridInnerWidth(), totalColumnWidth = colModel.getTotalWidth(false), autoExpandColumn = grid.autoExpandColumn; if (!this.userResized && autoExpandColumn) { if (gridWidth != totalColumnWidth) { var colIndex = colModel.getIndexById(autoExpandColumn), currentWidth = colModel.getColumnWidth(colIndex), desiredWidth = gridWidth - totalColumnWidth + currentWidth, newWidth = Math.min(Math.max(desiredWidth, grid.autoExpandMin), grid.autoExpandMax); if (currentWidth != newWidth) { colModel.setColumnWidth(colIndex, newWidth, true); if (preventUpdate !== true) { this.updateColumnWidth(colIndex, newWidth); } } } } }, getGridInnerWidth: function() { return this.grid.getGridEl().getWidth(true) - this.getScrollOffset(); }, getColumnData : function() { var columns = [], colModel = this.cm, colCount = colModel.getColumnCount(), fields = this.ds.fields, i, name; for (i = 0; i < colCount; i++) { name = colModel.getDataIndex(i); columns[i] = { name : Ext.isDefined(name) ? name : (fields.get(i) ? fields.get(i).name : undefined), renderer: colModel.getRenderer(i), scope : colModel.getRendererScope(i), id : colModel.getColumnId(i), style : this.getColumnStyle(i) }; } return columns; }, renderRows : function(startRow, endRow) { var grid = this.grid, store = grid.store, stripe = grid.stripeRows, colModel = grid.colModel, colCount = colModel.getColumnCount(), rowCount = store.getCount(), records; if (rowCount < 1) { return ''; } startRow = startRow || 0; endRow = Ext.isDefined(endRow) ? endRow : rowCount - 1; records = store.getRange(startRow, endRow); return this.doRender(this.getColumnData(), records, store, startRow, colCount, stripe); }, renderBody : function(){ var markup = this.renderRows() || ' '; return this.templates.body.apply({rows: markup}); }, refreshRow: function(record) { var store = this.ds, colCount = this.cm.getColumnCount(), columns = this.getColumnData(), last = colCount - 1, cls = ['x-grid3-row'], rowParams = { tstyle: String.format("width: {0};", this.getTotalWidth()) }, colBuffer = [], cellTpl = this.templates.cell, rowIndex, row, column, meta, css, i; if (Ext.isNumber(record)) { rowIndex = record; record = store.getAt(rowIndex); } else { rowIndex = store.indexOf(record); } if (!record || rowIndex < 0) { return; } for (i = 0; i < colCount; i++) { column = columns[i]; if (i == 0) { css = 'x-grid3-cell-first'; } else { css = (i == last) ? 'x-grid3-cell-last ' : ''; } meta = { id : column.id, style : column.style, css : css, attr : "", cellAttr: "" }; meta.value = column.renderer.call(column.scope, record.data[column.name], meta, record, rowIndex, i, store); if (Ext.isEmpty(meta.value)) { meta.value = ' '; } if (this.markDirty && record.dirty && typeof record.modified[column.name] != 'undefined') { meta.css += ' x-grid3-dirty-cell'; } colBuffer[i] = cellTpl.apply(meta); } row = this.getRow(rowIndex); row.className = ''; if (this.grid.stripeRows && ((rowIndex + 1) % 2 === 0)) { cls.push('x-grid3-row-alt'); } if (this.getRowClass) { rowParams.cols = colCount; cls.push(this.getRowClass(record, rowIndex, rowParams, store)); } this.fly(row).addClass(cls).setStyle(rowParams.tstyle); rowParams.cells = colBuffer.join(""); row.innerHTML = this.templates.rowInner.apply(rowParams); this.fireEvent('rowupdated', this, rowIndex, record); }, refresh : function(headersToo) { this.fireEvent('beforerefresh', this); this.grid.stopEditing(true); var result = this.renderBody(); this.mainBody.update(result).setWidth(this.getTotalWidth()); if (headersToo === true) { this.updateHeaders(); this.updateHeaderSortState(); } this.processRows(0, true); this.layout(); this.applyEmptyText(); this.fireEvent('refresh', this); }, applyEmptyText : function() { if (this.emptyText && !this.hasRows()) { this.mainBody.update('
    ' + this.emptyText + '
    '); } }, updateHeaderSortState : function() { var state = this.ds.getSortState(); if (!state) { return; } if (!this.sortState || (this.sortState.field != state.field || this.sortState.direction != state.direction)) { this.grid.fireEvent('sortchange', this.grid, state); } this.sortState = state; var sortColumn = this.cm.findColumnIndex(state.field); if (sortColumn != -1) { var sortDir = state.direction; this.updateSortIcon(sortColumn, sortDir); } }, clearHeaderSortState : function() { if (!this.sortState) { return; } this.grid.fireEvent('sortchange', this.grid, null); this.mainHd.select('td').removeClass(this.sortClasses); delete this.sortState; }, destroy : function() { var me = this, grid = me.grid, gridEl = grid.getGridEl(), dragZone = me.dragZone, splitZone = me.splitZone, columnDrag = me.columnDrag, columnDrop = me.columnDrop, scrollToTopTask = me.scrollToTopTask, columnDragData, columnDragProxy; if (scrollToTopTask && scrollToTopTask.cancel) { scrollToTopTask.cancel(); } Ext.destroyMembers(me, 'colMenu', 'hmenu'); me.initData(null, null); me.purgeListeners(); Ext.fly(me.innerHd).un("click", me.handleHdDown, me); if (grid.enableColumnMove) { columnDragData = columnDrag.dragData; columnDragProxy = columnDrag.proxy; Ext.destroy( columnDrag.el, columnDragProxy.ghost, columnDragProxy.el, columnDrop.el, columnDrop.proxyTop, columnDrop.proxyBottom, columnDragData.ddel, columnDragData.header ); if (columnDragProxy.anim) { Ext.destroy(columnDragProxy.anim); } delete columnDragProxy.ghost; delete columnDragData.ddel; delete columnDragData.header; columnDrag.destroy(); delete Ext.dd.DDM.locationCache[columnDrag.id]; delete columnDrag._domRef; delete columnDrop.proxyTop; delete columnDrop.proxyBottom; columnDrop.destroy(); delete Ext.dd.DDM.locationCache["gridHeader" + gridEl.id]; delete columnDrop._domRef; delete Ext.dd.DDM.ids[columnDrop.ddGroup]; } if (splitZone) { splitZone.destroy(); delete splitZone._domRef; delete Ext.dd.DDM.ids["gridSplitters" + gridEl.id]; } Ext.fly(me.innerHd).removeAllListeners(); Ext.removeNode(me.innerHd); delete me.innerHd; Ext.destroy( me.el, me.mainWrap, me.mainHd, me.scroller, me.mainBody, me.focusEl, me.resizeMarker, me.resizeProxy, me.activeHdBtn, me._flyweight, dragZone, splitZone ); delete grid.container; if (dragZone) { dragZone.destroy(); } Ext.dd.DDM.currentTarget = null; delete Ext.dd.DDM.locationCache[gridEl.id]; Ext.EventManager.removeResizeListener(me.onWindowResize, me); }, onDenyColumnHide : function() { }, render : function() { if (this.autoFill) { var ct = this.grid.ownerCt; if (ct && ct.getLayout()) { ct.on('afterlayout', function() { this.fitColumns(true, true); this.updateHeaders(); this.updateHeaderSortState(); }, this, {single: true}); } } else if (this.forceFit) { this.fitColumns(true, false); } else if (this.grid.autoExpandColumn) { this.autoExpand(true); } this.grid.getGridEl().dom.innerHTML = this.renderUI(); this.afterRenderUI(); }, initData : function(newStore, newColModel) { var me = this; if (me.ds) { var oldStore = me.ds; oldStore.un('add', me.onAdd, me); oldStore.un('load', me.onLoad, me); oldStore.un('clear', me.onClear, me); oldStore.un('remove', me.onRemove, me); oldStore.un('update', me.onUpdate, me); oldStore.un('datachanged', me.onDataChange, me); if (oldStore !== newStore && oldStore.autoDestroy) { oldStore.destroy(); } } if (newStore) { newStore.on({ scope : me, load : me.onLoad, add : me.onAdd, remove : me.onRemove, update : me.onUpdate, clear : me.onClear, datachanged: me.onDataChange }); } if (me.cm) { var oldColModel = me.cm; oldColModel.un('configchange', me.onColConfigChange, me); oldColModel.un('widthchange', me.onColWidthChange, me); oldColModel.un('headerchange', me.onHeaderChange, me); oldColModel.un('hiddenchange', me.onHiddenChange, me); oldColModel.un('columnmoved', me.onColumnMove, me); } if (newColModel) { delete me.lastViewWidth; newColModel.on({ scope : me, configchange: me.onColConfigChange, widthchange : me.onColWidthChange, headerchange: me.onHeaderChange, hiddenchange: me.onHiddenChange, columnmoved : me.onColumnMove }); } me.ds = newStore; me.cm = newColModel; }, onDataChange : function(){ this.refresh(true); this.updateHeaderSortState(); this.syncFocusEl(0); }, onClear : function() { this.refresh(); this.syncFocusEl(0); }, onUpdate : function(store, record) { this.refreshRow(record); }, onAdd : function(store, records, index) { this.insertRows(store, index, index + (records.length-1)); }, onRemove : function(store, record, index, isUpdate) { if (isUpdate !== true) { this.fireEvent('beforerowremoved', this, index, record); } this.removeRow(index); if (isUpdate !== true) { this.processRows(index); this.applyEmptyText(); this.fireEvent('rowremoved', this, index, record); } }, onLoad : function() { if (Ext.isGecko) { if (!this.scrollToTopTask) { this.scrollToTopTask = new Ext.util.DelayedTask(this.scrollToTop, this); } this.scrollToTopTask.delay(1); } else { this.scrollToTop(); } }, onColWidthChange : function(cm, col, width) { this.updateColumnWidth(col, width); }, onHeaderChange : function(cm, col, text) { this.updateHeaders(); }, onHiddenChange : function(cm, col, hidden) { this.updateColumnHidden(col, hidden); }, onColumnMove : function(cm, oldIndex, newIndex) { this.indexMap = null; this.refresh(true); this.restoreScroll(this.getScrollState()); this.afterMove(newIndex); this.grid.fireEvent('columnmove', oldIndex, newIndex); }, onColConfigChange : function() { delete this.lastViewWidth; this.indexMap = null; this.refresh(true); }, initUI : function(grid) { grid.on('headerclick', this.onHeaderClick, this); }, initEvents : Ext.emptyFn, onHeaderClick : function(g, index) { if (this.headersDisabled || !this.cm.isSortable(index)) { return; } g.stopEditing(true); g.store.sort(this.cm.getDataIndex(index)); }, onRowOver : function(e, target) { var row = this.findRowIndex(target); if (row !== false) { this.addRowClass(row, this.rowOverCls); } }, onRowOut : function(e, target) { var row = this.findRowIndex(target); if (row !== false && !e.within(this.getRow(row), true)) { this.removeRowClass(row, this.rowOverCls); } }, onRowSelect : function(row) { this.addRowClass(row, this.selectedRowClass); }, onRowDeselect : function(row) { this.removeRowClass(row, this.selectedRowClass); }, onCellSelect : function(row, col) { var cell = this.getCell(row, col); if (cell) { this.fly(cell).addClass('x-grid3-cell-selected'); } }, onCellDeselect : function(row, col) { var cell = this.getCell(row, col); if (cell) { this.fly(cell).removeClass('x-grid3-cell-selected'); } }, handleWheel : function(e) { e.stopPropagation(); }, onColumnSplitterMoved : function(cellIndex, width) { this.userResized = true; this.grid.colModel.setColumnWidth(cellIndex, width, true); if (this.forceFit) { this.fitColumns(true, false, cellIndex); this.updateAllColumnWidths(); } else { this.updateColumnWidth(cellIndex, width); this.syncHeaderScroll(); } this.grid.fireEvent('columnresize', cellIndex, width); }, beforeColMenuShow : function() { var colModel = this.cm, colCount = colModel.getColumnCount(), colMenu = this.colMenu, i; colMenu.removeAll(); for (i = 0; i < colCount; i++) { if (colModel.config[i].hideable !== false) { colMenu.add(new Ext.menu.CheckItem({ text : colModel.getColumnHeader(i), itemId : 'col-' + colModel.getColumnId(i), checked : !colModel.isHidden(i), disabled : colModel.config[i].hideable === false, hideOnClick: false })); } } }, handleHdMenuClick : function(item) { var store = this.ds, dataIndex = this.cm.getDataIndex(this.hdCtxIndex); switch (item.getItemId()) { case 'asc': store.sort(dataIndex, 'ASC'); break; case 'desc': store.sort(dataIndex, 'DESC'); break; default: this.handleHdMenuClickDefault(item); } return true; }, handleHdMenuClickDefault: function(item) { var colModel = this.cm, itemId = item.getItemId(), index = colModel.getIndexById(itemId.substr(4)); if (index != -1) { if (item.checked && colModel.getColumnsBy(this.isHideableColumn, this).length <= 1) { this.onDenyColumnHide(); return; } colModel.setHidden(index, item.checked); } }, handleHdDown : function(e, target) { if (Ext.fly(target).hasClass('x-grid3-hd-btn')) { e.stopEvent(); var colModel = this.cm, header = this.findHeaderCell(target), index = this.getCellIndex(header), sortable = colModel.isSortable(index), menu = this.hmenu, menuItems = menu.items, menuCls = this.headerMenuOpenCls; this.hdCtxIndex = index; Ext.fly(header).addClass(menuCls); menuItems.get('asc').setDisabled(!sortable); menuItems.get('desc').setDisabled(!sortable); menu.on('hide', function() { Ext.fly(header).removeClass(menuCls); }, this, {single:true}); menu.show(target, 'tl-bl?'); } }, handleHdMove : function(e) { var header = this.findHeaderCell(this.activeHdRef); if (header && !this.headersDisabled) { var handleWidth = this.splitHandleWidth || 5, activeRegion = this.activeHdRegion, headerStyle = header.style, colModel = this.cm, cursor = '', pageX = e.getPageX(); if (this.grid.enableColumnResize !== false) { var activeHeaderIndex = this.activeHdIndex, previousVisible = this.getPreviousVisible(activeHeaderIndex), currentResizable = colModel.isResizable(activeHeaderIndex), previousResizable = previousVisible && colModel.isResizable(previousVisible), inLeftResizer = pageX - activeRegion.left <= handleWidth, inRightResizer = activeRegion.right - pageX <= (!this.activeHdBtn ? handleWidth : 2); if (inLeftResizer && previousResizable) { cursor = Ext.isAir ? 'move' : Ext.isWebKit ? 'e-resize' : 'col-resize'; } else if (inRightResizer && currentResizable) { cursor = Ext.isAir ? 'move' : Ext.isWebKit ? 'w-resize' : 'col-resize'; } } headerStyle.cursor = cursor; } }, getPreviousVisible: function(index) { while (index > 0) { if (!this.cm.isHidden(index - 1)) { return index; } index--; } return undefined; }, handleHdOver : function(e, target) { var header = this.findHeaderCell(target); if (header && !this.headersDisabled) { var fly = this.fly(header); this.activeHdRef = target; this.activeHdIndex = this.getCellIndex(header); this.activeHdRegion = fly.getRegion(); if (!this.isMenuDisabled(this.activeHdIndex, fly)) { fly.addClass('x-grid3-hd-over'); this.activeHdBtn = fly.child('.x-grid3-hd-btn'); if (this.activeHdBtn) { this.activeHdBtn.dom.style.height = (header.firstChild.offsetHeight - 1) + 'px'; } } } }, handleHdOut : function(e, target) { var header = this.findHeaderCell(target); if (header && (!Ext.isIE || !e.within(header, true))) { this.activeHdRef = null; this.fly(header).removeClass('x-grid3-hd-over'); header.style.cursor = ''; } }, isMenuDisabled: function(cellIndex, el) { return this.cm.isMenuDisabled(cellIndex); }, hasRows : function() { var fc = this.mainBody.dom.firstChild; return fc && fc.nodeType == 1 && fc.className != 'x-grid-empty'; }, isHideableColumn : function(c) { return !c.hidden; }, bind : function(d, c) { this.initData(d, c); } }); Ext.grid.GridView.SplitDragZone = Ext.extend(Ext.dd.DDProxy, { constructor: function(grid, hd){ this.grid = grid; this.view = grid.getView(); this.marker = this.view.resizeMarker; this.proxy = this.view.resizeProxy; Ext.grid.GridView.SplitDragZone.superclass.constructor.call(this, hd, 'gridSplitters' + this.grid.getGridEl().id, { dragElId : Ext.id(this.proxy.dom), resizeFrame:false }); this.scroll = false; this.hw = this.view.splitHandleWidth || 5; }, b4StartDrag : function(x, y){ this.dragHeadersDisabled = this.view.headersDisabled; this.view.headersDisabled = true; var h = this.view.mainWrap.getHeight(); this.marker.setHeight(h); this.marker.show(); this.marker.alignTo(this.view.getHeaderCell(this.cellIndex), 'tl-tl', [-2, 0]); this.proxy.setHeight(h); var w = this.cm.getColumnWidth(this.cellIndex), minw = Math.max(w-this.grid.minColumnWidth, 0); this.resetConstraints(); this.setXConstraint(minw, 1000); this.setYConstraint(0, 0); this.minX = x - minw; this.maxX = x + 1000; this.startPos = x; Ext.dd.DDProxy.prototype.b4StartDrag.call(this, x, y); }, allowHeaderDrag : function(e){ return true; }, handleMouseDown : function(e){ var t = this.view.findHeaderCell(e.getTarget()); if(t && this.allowHeaderDrag(e)){ var xy = this.view.fly(t).getXY(), x = xy[0], exy = e.getXY(), ex = exy[0], w = t.offsetWidth, adjust = false; if((ex - x) <= this.hw){ adjust = -1; }else if((x+w) - ex <= this.hw){ adjust = 0; } if(adjust !== false){ this.cm = this.grid.colModel; var ci = this.view.getCellIndex(t); if(adjust == -1){ if (ci + adjust < 0) { return; } while(this.cm.isHidden(ci+adjust)){ --adjust; if(ci+adjust < 0){ return; } } } this.cellIndex = ci+adjust; this.split = t.dom; if(this.cm.isResizable(this.cellIndex) && !this.cm.isFixed(this.cellIndex)){ Ext.grid.GridView.SplitDragZone.superclass.handleMouseDown.apply(this, arguments); } }else if(this.view.columnDrag){ this.view.columnDrag.callHandleMouseDown(e); } } }, endDrag : function(e){ this.marker.hide(); var v = this.view, endX = Math.max(this.minX, e.getPageX()), diff = endX - this.startPos, disabled = this.dragHeadersDisabled; v.onColumnSplitterMoved(this.cellIndex, this.cm.getColumnWidth(this.cellIndex)+diff); setTimeout(function(){ v.headersDisabled = disabled; }, 50); }, autoOffset : function(){ this.setDelta(0,0); } }); Ext.grid.PivotGridView = Ext.extend(Ext.grid.GridView, { colHeaderCellCls: 'grid-hd-group-cell', title: '', getColumnHeaders: function() { return this.grid.topAxis.buildHeaders();; }, getRowHeaders: function() { return this.grid.leftAxis.buildHeaders(); }, renderRows : function(startRow, endRow) { var grid = this.grid, rows = grid.extractData(), rowCount = rows.length, templates = this.templates, renderer = grid.renderer, hasRenderer = typeof renderer == 'function', getCellCls = this.getCellCls, hasGetCellCls = typeof getCellCls == 'function', cellTemplate = templates.cell, rowTemplate = templates.row, rowBuffer = [], meta = {}, tstyle = 'width:' + this.getGridInnerWidth() + 'px;', colBuffer, colCount, column, i, row; startRow = startRow || 0; endRow = Ext.isDefined(endRow) ? endRow : rowCount - 1; for (i = 0; i < rowCount; i++) { row = rows[i]; colCount = row.length; colBuffer = []; for (var j = 0; j < colCount; j++) { meta.id = i + '-' + j; meta.css = j === 0 ? 'x-grid3-cell-first ' : (j == (colCount - 1) ? 'x-grid3-cell-last ' : ''); meta.attr = meta.cellAttr = ''; meta.value = row[j]; if (Ext.isEmpty(meta.value)) { meta.value = ' '; } if (hasRenderer) { meta.value = renderer(meta.value); } if (hasGetCellCls) { meta.css += getCellCls(meta.value) + ' '; } colBuffer[colBuffer.length] = cellTemplate.apply(meta); } rowBuffer[rowBuffer.length] = rowTemplate.apply({ tstyle: tstyle, cols : colCount, cells : colBuffer.join(""), alt : '' }); } return rowBuffer.join(""); }, masterTpl: new Ext.Template( '
    ', '
    ', '
    ', '
    {title}
    ', '
    ', '
    ', '
    ', '
    ', '
    ', '
    ', '
    ', '
    {body}
    ', '', '
    ', '
    ', '
     
    ', '
     
    ', '
    ' ), initTemplates: function() { Ext.grid.PivotGridView.superclass.initTemplates.apply(this, arguments); var templates = this.templates || {}; if (!templates.gcell) { templates.gcell = new Ext.XTemplate( '', '
    ', this.grid.enableHdMenu ? '' : '', '{value}', '
    ', '' ); } this.templates = templates; this.hrowRe = new RegExp("ux-grid-hd-group-row-(\\d+)", ""); }, initElements: function() { Ext.grid.PivotGridView.superclass.initElements.apply(this, arguments); this.rowHeadersEl = new Ext.Element(this.scroller.child('div.x-grid3-row-headers')); this.headerTitleEl = new Ext.Element(this.mainHd.child('div.x-grid3-header-title')); }, getGridInnerWidth: function() { var previousWidth = Ext.grid.PivotGridView.superclass.getGridInnerWidth.apply(this, arguments); return previousWidth - this.getTotalRowHeaderWidth(); }, getTotalRowHeaderWidth: function() { var headers = this.getRowHeaders(), length = headers.length, total = 0, i; for (i = 0; i< length; i++) { total += headers[i].width; } return total; }, getTotalColumnHeaderHeight: function() { return this.getColumnHeaders().length * 21; }, getCellIndex : function(el) { if (el) { var match = el.className.match(this.colRe), data; if (match && (data = match[1])) { return parseInt(data.split('-')[1], 10); } } return false; }, renderUI : function() { var templates = this.templates, innerWidth = this.getGridInnerWidth(); return templates.master.apply({ body : templates.body.apply({rows:' '}), ostyle: 'width:' + innerWidth + 'px', bstyle: 'width:' + innerWidth + 'px' }); }, onLayout: function(width, height) { Ext.grid.PivotGridView.superclass.onLayout.apply(this, arguments); var width = this.getGridInnerWidth(); this.resizeColumnHeaders(width); this.resizeAllRows(width); }, refresh : function(headersToo) { this.fireEvent('beforerefresh', this); this.grid.stopEditing(true); var result = this.renderBody(); this.mainBody.update(result).setWidth(this.getGridInnerWidth()); if (headersToo === true) { this.updateHeaders(); this.updateHeaderSortState(); } this.processRows(0, true); this.layout(); this.applyEmptyText(); this.fireEvent('refresh', this); }, renderHeaders: Ext.emptyFn, fitColumns: Ext.emptyFn, resizeColumnHeaders: function(width) { var topAxis = this.grid.topAxis; if (topAxis.rendered) { topAxis.el.setWidth(width); } }, resizeRowHeaders: function() { var rowHeaderWidth = this.getTotalRowHeaderWidth(), marginStyle = String.format("margin-left: {0}px;", rowHeaderWidth); this.rowHeadersEl.setWidth(rowHeaderWidth); this.mainBody.applyStyles(marginStyle); Ext.fly(this.innerHd).applyStyles(marginStyle); this.headerTitleEl.setWidth(rowHeaderWidth); this.headerTitleEl.setHeight(this.getTotalColumnHeaderHeight()); }, resizeAllRows: function(width) { var rows = this.getRows(), length = rows.length, i; for (i = 0; i < length; i++) { Ext.fly(rows[i]).setWidth(width); Ext.fly(rows[i]).child('table').setWidth(width); } }, updateHeaders: function() { this.renderGroupRowHeaders(); this.renderGroupColumnHeaders(); }, renderGroupRowHeaders: function() { var leftAxis = this.grid.leftAxis; this.resizeRowHeaders(); leftAxis.rendered = false; leftAxis.render(this.rowHeadersEl); this.setTitle(this.title); }, setTitle: function(title) { this.headerTitleEl.child('span').dom.innerHTML = title; }, renderGroupColumnHeaders: function() { var topAxis = this.grid.topAxis; topAxis.rendered = false; topAxis.render(this.innerHd.firstChild); }, isMenuDisabled: function(cellIndex, el) { return true; } }); Ext.grid.PivotAxis = Ext.extend(Ext.Component, { orientation: 'horizontal', defaultHeaderWidth: 80, paddingWidth: 7, setDimensions: function(dimensions) { this.dimensions = dimensions; }, onRender: function(ct, position) { var rows = this.orientation == 'horizontal' ? this.renderHorizontalRows() : this.renderVerticalRows(); this.el = Ext.DomHelper.overwrite(ct.dom, {tag: 'table', cn: rows}, true); }, renderHorizontalRows: function() { var headers = this.buildHeaders(), rowCount = headers.length, rows = [], cells, cols, colCount, i, j; for (i = 0; i < rowCount; i++) { cells = []; cols = headers[i].items; colCount = cols.length; for (j = 0; j < colCount; j++) { cells.push({ tag: 'td', html: cols[j].header, colspan: cols[j].span }); } rows[i] = { tag: 'tr', cn: cells }; } return rows; }, renderVerticalRows: function() { var headers = this.buildHeaders(), colCount = headers.length, rowCells = [], rows = [], rowCount, col, row, colWidth, i, j; for (i = 0; i < colCount; i++) { col = headers[i]; colWidth = col.width || 80; rowCount = col.items.length; for (j = 0; j < rowCount; j++) { row = col.items[j]; rowCells[row.start] = rowCells[row.start] || []; rowCells[row.start].push({ tag : 'td', html : row.header, rowspan: row.span, width : Ext.isBorderBox ? colWidth : colWidth - this.paddingWidth }); } } rowCount = rowCells.length; for (i = 0; i < rowCount; i++) { rows[i] = { tag: 'tr', cn : rowCells[i] }; } return rows; }, getTuples: function() { var newStore = new Ext.data.Store({}); newStore.data = this.store.data.clone(); newStore.fields = this.store.fields; var sorters = [], dimensions = this.dimensions, length = dimensions.length, i; for (i = 0; i < length; i++) { sorters.push({ field : dimensions[i].dataIndex, direction: dimensions[i].direction || 'ASC' }); } newStore.sort(sorters); var records = newStore.data.items, hashes = [], tuples = [], recData, hash, info, data, key; length = records.length; for (i = 0; i < length; i++) { info = this.getRecordInfo(records[i]); data = info.data; hash = ""; for (key in data) { hash += data[key] + '---'; } if (hashes.indexOf(hash) == -1) { hashes.push(hash); tuples.push(info); } } newStore.destroy(); return tuples; }, getRecordInfo: function(record) { var dimensions = this.dimensions, length = dimensions.length, data = {}, dimension, dataIndex, i; for (i = 0; i < length; i++) { dimension = dimensions[i]; dataIndex = dimension.dataIndex; data[dataIndex] = record.get(dataIndex); } var createMatcherFunction = function(data) { return function(record) { for (var dataIndex in data) { if (record.get(dataIndex) != data[dataIndex]) { return false; } } return true; }; }; return { data: data, matcher: createMatcherFunction(data) }; }, buildHeaders: function() { var tuples = this.getTuples(), rowCount = tuples.length, dimensions = this.dimensions, dimension, colCount = dimensions.length, headers = [], tuple, rows, currentHeader, previousHeader, span, start, isLast, changed, i, j; for (i = 0; i < colCount; i++) { dimension = dimensions[i]; rows = []; span = 0; start = 0; for (j = 0; j < rowCount; j++) { tuple = tuples[j]; isLast = j == (rowCount - 1); currentHeader = tuple.data[dimension.dataIndex]; changed = previousHeader != undefined && previousHeader != currentHeader; if (i > 0 && j > 0) { changed = changed || tuple.data[dimensions[i-1].dataIndex] != tuples[j-1].data[dimensions[i-1].dataIndex]; } if (changed) { rows.push({ header: previousHeader, span : span, start : start }); start += span; span = 0; } if (isLast) { rows.push({ header: currentHeader, span : span + 1, start : start }); start += span; span = 0; } previousHeader = currentHeader; span++; } headers.push({ items: rows, width: dimension.width || this.defaultHeaderWidth }); previousHeader = undefined; } return headers; } }); Ext.grid.HeaderDragZone = Ext.extend(Ext.dd.DragZone, { maxDragWidth: 120, constructor : function(grid, hd, hd2){ this.grid = grid; this.view = grid.getView(); this.ddGroup = "gridHeader" + this.grid.getGridEl().id; Ext.grid.HeaderDragZone.superclass.constructor.call(this, hd); if(hd2){ this.setHandleElId(Ext.id(hd)); this.setOuterHandleElId(Ext.id(hd2)); } this.scroll = false; }, getDragData : function(e){ var t = Ext.lib.Event.getTarget(e), h = this.view.findHeaderCell(t); if(h){ return {ddel: h.firstChild, header:h}; } return false; }, onInitDrag : function(e){ this.dragHeadersDisabled = this.view.headersDisabled; this.view.headersDisabled = true; var clone = this.dragData.ddel.cloneNode(true); clone.id = Ext.id(); clone.style.width = Math.min(this.dragData.header.offsetWidth,this.maxDragWidth) + "px"; this.proxy.update(clone); return true; }, afterValidDrop : function(){ this.completeDrop(); }, afterInvalidDrop : function(){ this.completeDrop(); }, completeDrop: function(){ var v = this.view, disabled = this.dragHeadersDisabled; setTimeout(function(){ v.headersDisabled = disabled; }, 50); } }); Ext.grid.HeaderDropZone = Ext.extend(Ext.dd.DropZone, { proxyOffsets : [-4, -9], fly: Ext.Element.fly, constructor : function(grid, hd, hd2){ this.grid = grid; this.view = grid.getView(); this.proxyTop = Ext.DomHelper.append(document.body, { cls:"col-move-top", html:" " }, true); this.proxyBottom = Ext.DomHelper.append(document.body, { cls:"col-move-bottom", html:" " }, true); this.proxyTop.hide = this.proxyBottom.hide = function(){ this.setLeftTop(-100,-100); this.setStyle("visibility", "hidden"); }; this.ddGroup = "gridHeader" + this.grid.getGridEl().id; Ext.grid.HeaderDropZone.superclass.constructor.call(this, grid.getGridEl().dom); }, getTargetFromEvent : function(e){ var t = Ext.lib.Event.getTarget(e), cindex = this.view.findCellIndex(t); if(cindex !== false){ return this.view.getHeaderCell(cindex); } }, nextVisible : function(h){ var v = this.view, cm = this.grid.colModel; h = h.nextSibling; while(h){ if(!cm.isHidden(v.getCellIndex(h))){ return h; } h = h.nextSibling; } return null; }, prevVisible : function(h){ var v = this.view, cm = this.grid.colModel; h = h.prevSibling; while(h){ if(!cm.isHidden(v.getCellIndex(h))){ return h; } h = h.prevSibling; } return null; }, positionIndicator : function(h, n, e){ var x = Ext.lib.Event.getPageX(e), r = Ext.lib.Dom.getRegion(n.firstChild), px, pt, py = r.top + this.proxyOffsets[1]; if((r.right - x) <= (r.right-r.left)/2){ px = r.right+this.view.borderWidth; pt = "after"; }else{ px = r.left; pt = "before"; } if(this.grid.colModel.isFixed(this.view.getCellIndex(n))){ return false; } px += this.proxyOffsets[0]; this.proxyTop.setLeftTop(px, py); this.proxyTop.show(); if(!this.bottomOffset){ this.bottomOffset = this.view.mainHd.getHeight(); } this.proxyBottom.setLeftTop(px, py+this.proxyTop.dom.offsetHeight+this.bottomOffset); this.proxyBottom.show(); return pt; }, onNodeEnter : function(n, dd, e, data){ if(data.header != n){ this.positionIndicator(data.header, n, e); } }, onNodeOver : function(n, dd, e, data){ var result = false; if(data.header != n){ result = this.positionIndicator(data.header, n, e); } if(!result){ this.proxyTop.hide(); this.proxyBottom.hide(); } return result ? this.dropAllowed : this.dropNotAllowed; }, onNodeOut : function(n, dd, e, data){ this.proxyTop.hide(); this.proxyBottom.hide(); }, onNodeDrop : function(n, dd, e, data){ var h = data.header; if(h != n){ var cm = this.grid.colModel, x = Ext.lib.Event.getPageX(e), r = Ext.lib.Dom.getRegion(n.firstChild), pt = (r.right - x) <= ((r.right-r.left)/2) ? "after" : "before", oldIndex = this.view.getCellIndex(h), newIndex = this.view.getCellIndex(n); if(pt == "after"){ newIndex++; } if(oldIndex < newIndex){ newIndex--; } cm.moveColumn(oldIndex, newIndex); return true; } return false; } }); Ext.grid.GridView.ColumnDragZone = Ext.extend(Ext.grid.HeaderDragZone, { constructor : function(grid, hd){ Ext.grid.GridView.ColumnDragZone.superclass.constructor.call(this, grid, hd, null); this.proxy.el.addClass('x-grid3-col-dd'); }, handleMouseDown : function(e){ }, callHandleMouseDown : function(e){ Ext.grid.GridView.ColumnDragZone.superclass.handleMouseDown.call(this, e); } }); Ext.grid.SplitDragZone = Ext.extend(Ext.dd.DDProxy, { fly: Ext.Element.fly, constructor : function(grid, hd, hd2){ this.grid = grid; this.view = grid.getView(); this.proxy = this.view.resizeProxy; Ext.grid.SplitDragZone.superclass.constructor.call(this, hd, "gridSplitters" + this.grid.getGridEl().id, { dragElId : Ext.id(this.proxy.dom), resizeFrame:false }); this.setHandleElId(Ext.id(hd)); this.setOuterHandleElId(Ext.id(hd2)); this.scroll = false; }, b4StartDrag : function(x, y){ this.view.headersDisabled = true; this.proxy.setHeight(this.view.mainWrap.getHeight()); var w = this.cm.getColumnWidth(this.cellIndex); var minw = Math.max(w-this.grid.minColumnWidth, 0); this.resetConstraints(); this.setXConstraint(minw, 1000); this.setYConstraint(0, 0); this.minX = x - minw; this.maxX = x + 1000; this.startPos = x; Ext.dd.DDProxy.prototype.b4StartDrag.call(this, x, y); }, handleMouseDown : function(e){ var ev = Ext.EventObject.setEvent(e); var t = this.fly(ev.getTarget()); if(t.hasClass("x-grid-split")){ this.cellIndex = this.view.getCellIndex(t.dom); this.split = t.dom; this.cm = this.grid.colModel; if(this.cm.isResizable(this.cellIndex) && !this.cm.isFixed(this.cellIndex)){ Ext.grid.SplitDragZone.superclass.handleMouseDown.apply(this, arguments); } } }, endDrag : function(e){ this.view.headersDisabled = false; var endX = Math.max(this.minX, Ext.lib.Event.getPageX(e)); var diff = endX - this.startPos; this.view.onColumnSplitterMoved(this.cellIndex, this.cm.getColumnWidth(this.cellIndex)+diff); }, autoOffset : function(){ this.setDelta(0,0); } }); Ext.grid.GridDragZone = function(grid, config){ this.view = grid.getView(); Ext.grid.GridDragZone.superclass.constructor.call(this, this.view.mainBody.dom, config); this.scroll = false; this.grid = grid; this.ddel = document.createElement('div'); this.ddel.className = 'x-grid-dd-wrap'; }; Ext.extend(Ext.grid.GridDragZone, Ext.dd.DragZone, { ddGroup : "GridDD", getDragData : function(e){ var t = Ext.lib.Event.getTarget(e); var rowIndex = this.view.findRowIndex(t); if(rowIndex !== false){ var sm = this.grid.selModel; if(!sm.isSelected(rowIndex) || e.hasModifier()){ sm.handleMouseDown(this.grid, rowIndex, e); } return {grid: this.grid, ddel: this.ddel, rowIndex: rowIndex, selections:sm.getSelections()}; } return false; }, onInitDrag : function(e){ var data = this.dragData; this.ddel.innerHTML = this.grid.getDragDropText(); this.proxy.update(this.ddel); }, afterRepair : function(){ this.dragging = false; }, getRepairXY : function(e, data){ return false; }, onEndDrag : function(data, e){ }, onValidDrop : function(dd, e, id){ this.hideProxy(); }, beforeInvalidDrop : function(e, id){ } }); Ext.grid.ColumnModel = Ext.extend(Ext.util.Observable, { defaultWidth: 100, defaultSortable: false, constructor : function(config) { if (config.columns) { Ext.apply(this, config); this.setConfig(config.columns, true); } else { this.setConfig(config, true); } this.addEvents( "widthchange", "headerchange", "hiddenchange", "columnmoved", "configchange" ); Ext.grid.ColumnModel.superclass.constructor.call(this); }, getColumnId : function(index) { return this.config[index].id; }, getColumnAt : function(index) { return this.config[index]; }, setConfig : function(config, initial) { var i, c, len; if (!initial) { delete this.totalWidth; for (i = 0, len = this.config.length; i < len; i++) { c = this.config[i]; if (c.setEditor) { c.setEditor(null); } } } this.defaults = Ext.apply({ width: this.defaultWidth, sortable: this.defaultSortable }, this.defaults); this.config = config; this.lookup = {}; for (i = 0, len = config.length; i < len; i++) { c = Ext.applyIf(config[i], this.defaults); if (Ext.isEmpty(c.id)) { c.id = i; } if (!c.isColumn) { var Cls = Ext.grid.Column.types[c.xtype || 'gridcolumn']; c = new Cls(c); config[i] = c; } this.lookup[c.id] = c; } if (!initial) { this.fireEvent('configchange', this); } }, getColumnById : function(id) { return this.lookup[id]; }, getIndexById : function(id) { for (var i = 0, len = this.config.length; i < len; i++) { if (this.config[i].id == id) { return i; } } return -1; }, moveColumn : function(oldIndex, newIndex) { var config = this.config, c = config[oldIndex]; config.splice(oldIndex, 1); config.splice(newIndex, 0, c); this.dataMap = null; this.fireEvent("columnmoved", this, oldIndex, newIndex); }, getColumnCount : function(visibleOnly) { var length = this.config.length, c = 0, i; if (visibleOnly === true) { for (i = 0; i < length; i++) { if (!this.isHidden(i)) { c++; } } return c; } return length; }, getColumnsBy : function(fn, scope) { var config = this.config, length = config.length, result = [], i, c; for (i = 0; i < length; i++){ c = config[i]; if (fn.call(scope || this, c, i) === true) { result[result.length] = c; } } return result; }, isSortable : function(col) { return !!this.config[col].sortable; }, isMenuDisabled : function(col) { return !!this.config[col].menuDisabled; }, getRenderer : function(col) { return this.config[col].renderer || Ext.grid.ColumnModel.defaultRenderer; }, getRendererScope : function(col) { return this.config[col].scope; }, setRenderer : function(col, fn) { this.config[col].renderer = fn; }, getColumnWidth : function(col) { var width = this.config[col].width; if(typeof width != 'number'){ width = this.defaultWidth; } return width; }, setColumnWidth : function(col, width, suppressEvent) { this.config[col].width = width; this.totalWidth = null; if (!suppressEvent) { this.fireEvent("widthchange", this, col, width); } }, getTotalWidth : function(includeHidden) { if (!this.totalWidth) { this.totalWidth = 0; for (var i = 0, len = this.config.length; i < len; i++) { if (includeHidden || !this.isHidden(i)) { this.totalWidth += this.getColumnWidth(i); } } } return this.totalWidth; }, getColumnHeader : function(col) { return this.config[col].header; }, setColumnHeader : function(col, header) { this.config[col].header = header; this.fireEvent("headerchange", this, col, header); }, getColumnTooltip : function(col) { return this.config[col].tooltip; }, setColumnTooltip : function(col, tooltip) { this.config[col].tooltip = tooltip; }, getDataIndex : function(col) { return this.config[col].dataIndex; }, setDataIndex : function(col, dataIndex) { this.config[col].dataIndex = dataIndex; }, findColumnIndex : function(dataIndex) { var c = this.config; for(var i = 0, len = c.length; i < len; i++){ if(c[i].dataIndex == dataIndex){ return i; } } return -1; }, isCellEditable : function(colIndex, rowIndex) { var c = this.config[colIndex], ed = c.editable; return !!(ed || (!Ext.isDefined(ed) && c.editor)); }, getCellEditor : function(colIndex, rowIndex) { return this.config[colIndex].getCellEditor(rowIndex); }, setEditable : function(col, editable) { this.config[col].editable = editable; }, isHidden : function(colIndex) { return !!this.config[colIndex].hidden; }, isFixed : function(colIndex) { return !!this.config[colIndex].fixed; }, isResizable : function(colIndex) { return colIndex >= 0 && this.config[colIndex].resizable !== false && this.config[colIndex].fixed !== true; }, setHidden : function(colIndex, hidden) { var c = this.config[colIndex]; if(c.hidden !== hidden){ c.hidden = hidden; this.totalWidth = null; this.fireEvent("hiddenchange", this, colIndex, hidden); } }, setEditor : function(col, editor) { this.config[col].setEditor(editor); }, destroy : function() { var length = this.config.length, i = 0; for (; i < length; i++){ this.config[i].destroy(); } delete this.config; delete this.lookup; this.purgeListeners(); }, setState : function(col, state) { state = Ext.applyIf(state, this.defaults); Ext.apply(this.config[col], state); } }); Ext.grid.ColumnModel.defaultRenderer = function(value) { if (typeof value == "string" && value.length < 1) { return " "; } return value; }; Ext.grid.AbstractSelectionModel = Ext.extend(Ext.util.Observable, { constructor : function(){ this.locked = false; Ext.grid.AbstractSelectionModel.superclass.constructor.call(this); }, init : function(grid){ this.grid = grid; if(this.lockOnInit){ delete this.lockOnInit; this.locked = false; this.lock(); } this.initEvents(); }, lock : function(){ if(!this.locked){ this.locked = true; var g = this.grid; if(g){ g.getView().on({ scope: this, beforerefresh: this.sortUnLock, refresh: this.sortLock }); }else{ this.lockOnInit = true; } } }, sortLock : function() { this.locked = true; }, sortUnLock : function() { this.locked = false; }, unlock : function(){ if(this.locked){ this.locked = false; var g = this.grid, gv; if(g){ gv = g.getView(); gv.un('beforerefresh', this.sortUnLock, this); gv.un('refresh', this.sortLock, this); }else{ delete this.lockOnInit; } } }, isLocked : function(){ return this.locked; }, destroy: function(){ this.unlock(); this.purgeListeners(); } }); Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, { singleSelect : false, constructor : function(config){ Ext.apply(this, config); this.selections = new Ext.util.MixedCollection(false, function(o){ return o.id; }); this.last = false; this.lastActive = false; this.addEvents( 'selectionchange', 'beforerowselect', 'rowselect', 'rowdeselect' ); Ext.grid.RowSelectionModel.superclass.constructor.call(this); }, initEvents : function(){ if(!this.grid.enableDragDrop && !this.grid.enableDrag){ this.grid.on('rowmousedown', this.handleMouseDown, this); } this.rowNav = new Ext.KeyNav(this.grid.getGridEl(), { up: this.onKeyPress, down: this.onKeyPress, scope: this }); this.grid.getView().on({ scope: this, refresh: this.onRefresh, rowupdated: this.onRowUpdated, rowremoved: this.onRemove }); }, onKeyPress : function(e, name){ var up = name == 'up', method = up ? 'selectPrevious' : 'selectNext', add = up ? -1 : 1, last; if(!e.shiftKey || this.singleSelect){ this[method](false); }else if(this.last !== false && this.lastActive !== false){ last = this.last; this.selectRange(this.last, this.lastActive + add); this.grid.getView().focusRow(this.lastActive); if(last !== false){ this.last = last; } }else{ this.selectFirstRow(); } }, onRefresh : function(){ var ds = this.grid.store, s = this.getSelections(), i = 0, len = s.length, index, r; this.silent = true; this.clearSelections(true); for(; i < len; i++){ r = s[i]; if((index = ds.indexOfId(r.id)) != -1){ this.selectRow(index, true); } } if(s.length != this.selections.getCount()){ this.fireEvent('selectionchange', this); } this.silent = false; }, onRemove : function(v, index, r){ if(this.selections.remove(r) !== false){ this.fireEvent('selectionchange', this); } }, onRowUpdated : function(v, index, r){ if(this.isSelected(r)){ v.onRowSelect(index); } }, selectRecords : function(records, keepExisting){ if(!keepExisting){ this.clearSelections(); } var ds = this.grid.store, i = 0, len = records.length; for(; i < len; i++){ this.selectRow(ds.indexOf(records[i]), true); } }, getCount : function(){ return this.selections.length; }, selectFirstRow : function(){ this.selectRow(0); }, selectLastRow : function(keepExisting){ this.selectRow(this.grid.store.getCount() - 1, keepExisting); }, selectNext : function(keepExisting){ if(this.hasNext()){ this.selectRow(this.last+1, keepExisting); this.grid.getView().focusRow(this.last); return true; } return false; }, selectPrevious : function(keepExisting){ if(this.hasPrevious()){ this.selectRow(this.last-1, keepExisting); this.grid.getView().focusRow(this.last); return true; } return false; }, hasNext : function(){ return this.last !== false && (this.last+1) < this.grid.store.getCount(); }, hasPrevious : function(){ return !!this.last; }, getSelections : function(){ return [].concat(this.selections.items); }, getSelected : function(){ return this.selections.itemAt(0); }, each : function(fn, scope){ var s = this.getSelections(), i = 0, len = s.length; for(; i < len; i++){ if(fn.call(scope || this, s[i], i) === false){ return false; } } return true; }, clearSelections : function(fast){ if(this.isLocked()){ return; } if(fast !== true){ var ds = this.grid.store, s = this.selections; s.each(function(r){ this.deselectRow(ds.indexOfId(r.id)); }, this); s.clear(); }else{ this.selections.clear(); } this.last = false; }, selectAll : function(){ if(this.isLocked()){ return; } this.selections.clear(); for(var i = 0, len = this.grid.store.getCount(); i < len; i++){ this.selectRow(i, true); } }, hasSelection : function(){ return this.selections.length > 0; }, isSelected : function(index){ var r = Ext.isNumber(index) ? this.grid.store.getAt(index) : index; return (r && this.selections.key(r.id) ? true : false); }, isIdSelected : function(id){ return (this.selections.key(id) ? true : false); }, handleMouseDown : function(g, rowIndex, e){ if(e.button !== 0 || this.isLocked()){ return; } var view = this.grid.getView(); if(e.shiftKey && !this.singleSelect && this.last !== false){ var last = this.last; this.selectRange(last, rowIndex, e.ctrlKey); this.last = last; view.focusRow(rowIndex); }else{ var isSelected = this.isSelected(rowIndex); if(e.ctrlKey && isSelected){ this.deselectRow(rowIndex); }else if(!isSelected || this.getCount() > 1){ this.selectRow(rowIndex, e.ctrlKey || e.shiftKey); view.focusRow(rowIndex); } } }, selectRows : function(rows, keepExisting){ if(!keepExisting){ this.clearSelections(); } for(var i = 0, len = rows.length; i < len; i++){ this.selectRow(rows[i], true); } }, selectRange : function(startRow, endRow, keepExisting){ var i; if(this.isLocked()){ return; } if(!keepExisting){ this.clearSelections(); } if(startRow <= endRow){ for(i = startRow; i <= endRow; i++){ this.selectRow(i, true); } }else{ for(i = startRow; i >= endRow; i--){ this.selectRow(i, true); } } }, deselectRange : function(startRow, endRow, preventViewNotify){ if(this.isLocked()){ return; } for(var i = startRow; i <= endRow; i++){ this.deselectRow(i, preventViewNotify); } }, selectRow : function(index, keepExisting, preventViewNotify){ if(this.isLocked() || (index < 0 || index >= this.grid.store.getCount()) || (keepExisting && this.isSelected(index))){ return; } var r = this.grid.store.getAt(index); if(r && this.fireEvent('beforerowselect', this, index, keepExisting, r) !== false){ if(!keepExisting || this.singleSelect){ this.clearSelections(); } this.selections.add(r); this.last = this.lastActive = index; if(!preventViewNotify){ this.grid.getView().onRowSelect(index); } if(!this.silent){ this.fireEvent('rowselect', this, index, r); this.fireEvent('selectionchange', this); } } }, deselectRow : function(index, preventViewNotify){ if(this.isLocked()){ return; } if(this.last == index){ this.last = false; } if(this.lastActive == index){ this.lastActive = false; } var r = this.grid.store.getAt(index); if(r){ this.selections.remove(r); if(!preventViewNotify){ this.grid.getView().onRowDeselect(index); } this.fireEvent('rowdeselect', this, index, r); this.fireEvent('selectionchange', this); } }, acceptsNav : function(row, col, cm){ return !cm.isHidden(col) && cm.isCellEditable(col, row); }, onEditorKey : function(field, e){ var k = e.getKey(), newCell, g = this.grid, last = g.lastEdit, ed = g.activeEditor, shift = e.shiftKey, ae, last, r, c; if(k == e.TAB){ e.stopEvent(); ed.completeEdit(); if(shift){ newCell = g.walkCells(ed.row, ed.col-1, -1, this.acceptsNav, this); }else{ newCell = g.walkCells(ed.row, ed.col+1, 1, this.acceptsNav, this); } }else if(k == e.ENTER){ if(this.moveEditorOnEnter !== false){ if(shift){ newCell = g.walkCells(last.row - 1, last.col, -1, this.acceptsNav, this); }else{ newCell = g.walkCells(last.row + 1, last.col, 1, this.acceptsNav, this); } } } if(newCell){ r = newCell[0]; c = newCell[1]; this.onEditorSelect(r, last.row); if(g.isEditor && g.editing){ ae = g.activeEditor; if(ae && ae.field.triggerBlur){ ae.field.triggerBlur(); } } g.startEditing(r, c); } }, onEditorSelect: function(row, lastRow){ if(lastRow != row){ this.selectRow(row); } }, destroy : function(){ Ext.destroy(this.rowNav); this.rowNav = null; Ext.grid.RowSelectionModel.superclass.destroy.call(this); } }); Ext.grid.Column = Ext.extend(Ext.util.Observable, { isColumn : true, constructor : function(config){ Ext.apply(this, config); if(Ext.isString(this.renderer)){ this.renderer = Ext.util.Format[this.renderer]; }else if(Ext.isObject(this.renderer)){ this.scope = this.renderer.scope; this.renderer = this.renderer.fn; } if(!this.scope){ this.scope = this; } var ed = this.editor; delete this.editor; this.setEditor(ed); this.addEvents( 'click', 'contextmenu', 'dblclick', 'mousedown' ); Ext.grid.Column.superclass.constructor.call(this); }, processEvent : function(name, e, grid, rowIndex, colIndex){ return this.fireEvent(name, this, grid, rowIndex, e); }, destroy: function() { if(this.setEditor){ this.setEditor(null); } this.purgeListeners(); }, renderer : function(value){ return value; }, getEditor: function(rowIndex){ return this.editable !== false ? this.editor : null; }, setEditor : function(editor){ var ed = this.editor; if(ed){ if(ed.gridEditor){ ed.gridEditor.destroy(); delete ed.gridEditor; }else{ ed.destroy(); } } this.editor = null; if(editor){ if(!editor.isXType){ editor = Ext.create(editor, 'textfield'); } this.editor = editor; } }, getCellEditor: function(rowIndex){ var ed = this.getEditor(rowIndex); if(ed){ if(!ed.startEdit){ if(!ed.gridEditor){ ed.gridEditor = new Ext.grid.GridEditor(ed); } ed = ed.gridEditor; } } return ed; } }); Ext.grid.BooleanColumn = Ext.extend(Ext.grid.Column, { trueText: 'true', falseText: 'false', undefinedText: ' ', constructor: function(cfg){ Ext.grid.BooleanColumn.superclass.constructor.call(this, cfg); var t = this.trueText, f = this.falseText, u = this.undefinedText; this.renderer = function(v){ if(v === undefined){ return u; } if(!v || v === 'false'){ return f; } return t; }; } }); Ext.grid.NumberColumn = Ext.extend(Ext.grid.Column, { format : '0,000.00', constructor: function(cfg){ Ext.grid.NumberColumn.superclass.constructor.call(this, cfg); this.renderer = Ext.util.Format.numberRenderer(this.format); } }); Ext.grid.DateColumn = Ext.extend(Ext.grid.Column, { format : 'm/d/Y', constructor: function(cfg){ Ext.grid.DateColumn.superclass.constructor.call(this, cfg); this.renderer = Ext.util.Format.dateRenderer(this.format); } }); Ext.grid.TemplateColumn = Ext.extend(Ext.grid.Column, { constructor: function(cfg){ Ext.grid.TemplateColumn.superclass.constructor.call(this, cfg); var tpl = (!Ext.isPrimitive(this.tpl) && this.tpl.compile) ? this.tpl : new Ext.XTemplate(this.tpl); this.renderer = function(value, p, r){ return tpl.apply(r.data); }; this.tpl = tpl; } }); Ext.grid.ActionColumn = Ext.extend(Ext.grid.Column, { header: ' ', actionIdRe: /x-action-col-(\d+)/, altText: '', constructor: function(cfg) { var me = this, items = cfg.items || (me.items = [me]), l = items.length, i, item; Ext.grid.ActionColumn.superclass.constructor.call(me, cfg); me.renderer = function(v, meta) { v = Ext.isFunction(cfg.renderer) ? cfg.renderer.apply(this, arguments)||'' : ''; meta.css += ' x-action-col-cell'; for (i = 0; i < l; i++) { item = items[i]; v += '' + (item.altText || me.altText) + ''; } return v; }; }, destroy: function() { delete this.items; delete this.renderer; return Ext.grid.ActionColumn.superclass.destroy.apply(this, arguments); }, processEvent : function(name, e, grid, rowIndex, colIndex){ var m = e.getTarget().className.match(this.actionIdRe), item, fn; if (m && (item = this.items[parseInt(m[1], 10)])) { if (name == 'click') { (fn = item.handler || this.handler) && fn.call(item.scope||this.scope||this, grid, rowIndex, colIndex, item, e); } else if ((name == 'mousedown') && (item.stopSelection !== false)) { return false; } } return Ext.grid.ActionColumn.superclass.processEvent.apply(this, arguments); } }); Ext.grid.Column.types = { gridcolumn : Ext.grid.Column, booleancolumn: Ext.grid.BooleanColumn, numbercolumn: Ext.grid.NumberColumn, datecolumn: Ext.grid.DateColumn, templatecolumn: Ext.grid.TemplateColumn, actioncolumn: Ext.grid.ActionColumn }; Ext.grid.RowNumberer = Ext.extend(Object, { header: "", width: 23, sortable: false, constructor : function(config){ Ext.apply(this, config); if(this.rowspan){ this.renderer = this.renderer.createDelegate(this); } }, fixed:true, hideable: false, menuDisabled:true, dataIndex: '', id: 'numberer', rowspan: undefined, renderer : function(v, p, record, rowIndex){ if(this.rowspan){ p.cellAttr = 'rowspan="'+this.rowspan+'"'; } return rowIndex+1; } }); Ext.grid.CheckboxSelectionModel = Ext.extend(Ext.grid.RowSelectionModel, { header : '
     
    ', width : 20, sortable : false, menuDisabled : true, fixed : true, hideable: false, dataIndex : '', id : 'checker', isColumn: true, constructor : function(){ Ext.grid.CheckboxSelectionModel.superclass.constructor.apply(this, arguments); if(this.checkOnly){ this.handleMouseDown = Ext.emptyFn; } }, initEvents : function(){ Ext.grid.CheckboxSelectionModel.superclass.initEvents.call(this); this.grid.on('render', function(){ Ext.fly(this.grid.getView().innerHd).on('mousedown', this.onHdMouseDown, this); }, this); }, processEvent : function(name, e, grid, rowIndex, colIndex){ if (name == 'mousedown') { this.onMouseDown(e, e.getTarget()); return false; } else { return Ext.grid.Column.prototype.processEvent.apply(this, arguments); } }, onMouseDown : function(e, t){ if(e.button === 0 && t.className == 'x-grid3-row-checker'){ e.stopEvent(); var row = e.getTarget('.x-grid3-row'); if(row){ var index = row.rowIndex; if(this.isSelected(index)){ this.deselectRow(index); }else{ this.selectRow(index, true); this.grid.getView().focusRow(index); } } } }, onHdMouseDown : function(e, t) { if(t.className == 'x-grid3-hd-checker'){ e.stopEvent(); var hd = Ext.fly(t.parentNode); var isChecked = hd.hasClass('x-grid3-hd-checker-on'); if(isChecked){ hd.removeClass('x-grid3-hd-checker-on'); this.clearSelections(); }else{ hd.addClass('x-grid3-hd-checker-on'); this.selectAll(); } } }, renderer : function(v, p, record){ return '
     
    '; }, onEditorSelect: function(row, lastRow){ if(lastRow != row && !this.checkOnly){ this.selectRow(row); } } }); Ext.grid.CellSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, { constructor : function(config){ Ext.apply(this, config); this.selection = null; this.addEvents( "beforecellselect", "cellselect", "selectionchange" ); Ext.grid.CellSelectionModel.superclass.constructor.call(this); }, initEvents : function(){ this.grid.on('cellmousedown', this.handleMouseDown, this); this.grid.on(Ext.EventManager.getKeyEvent(), this.handleKeyDown, this); this.grid.getView().on({ scope: this, refresh: this.onViewChange, rowupdated: this.onRowUpdated, beforerowremoved: this.clearSelections, beforerowsinserted: this.clearSelections }); if(this.grid.isEditor){ this.grid.on('beforeedit', this.beforeEdit, this); } }, beforeEdit : function(e){ this.select(e.row, e.column, false, true, e.record); }, onRowUpdated : function(v, index, r){ if(this.selection && this.selection.record == r){ v.onCellSelect(index, this.selection.cell[1]); } }, onViewChange : function(){ this.clearSelections(true); }, getSelectedCell : function(){ return this.selection ? this.selection.cell : null; }, clearSelections : function(preventNotify){ var s = this.selection; if(s){ if(preventNotify !== true){ this.grid.view.onCellDeselect(s.cell[0], s.cell[1]); } this.selection = null; this.fireEvent("selectionchange", this, null); } }, hasSelection : function(){ return this.selection ? true : false; }, handleMouseDown : function(g, row, cell, e){ if(e.button !== 0 || this.isLocked()){ return; } this.select(row, cell); }, select : function(rowIndex, colIndex, preventViewNotify, preventFocus, r){ if(this.fireEvent("beforecellselect", this, rowIndex, colIndex) !== false){ this.clearSelections(); r = r || this.grid.store.getAt(rowIndex); this.selection = { record : r, cell : [rowIndex, colIndex] }; if(!preventViewNotify){ var v = this.grid.getView(); v.onCellSelect(rowIndex, colIndex); if(preventFocus !== true){ v.focusCell(rowIndex, colIndex); } } this.fireEvent("cellselect", this, rowIndex, colIndex); this.fireEvent("selectionchange", this, this.selection); } }, isSelectable : function(rowIndex, colIndex, cm){ return !cm.isHidden(colIndex); }, onEditorKey: function(field, e){ if(e.getKey() == e.TAB){ this.handleKeyDown(e); } }, handleKeyDown : function(e){ if(!e.isNavKeyPress()){ return; } var k = e.getKey(), g = this.grid, s = this.selection, sm = this, walk = function(row, col, step){ return g.walkCells( row, col, step, g.isEditor && g.editing ? sm.acceptsNav : sm.isSelectable, sm ); }, cell, newCell, r, c, ae; switch(k){ case e.ESC: case e.PAGE_UP: case e.PAGE_DOWN: break; default: e.stopEvent(); break; } if(!s){ cell = walk(0, 0, 1); if(cell){ this.select(cell[0], cell[1]); } return; } cell = s.cell; r = cell[0]; c = cell[1]; switch(k){ case e.TAB: if(e.shiftKey){ newCell = walk(r, c - 1, -1); }else{ newCell = walk(r, c + 1, 1); } break; case e.DOWN: newCell = walk(r + 1, c, 1); break; case e.UP: newCell = walk(r - 1, c, -1); break; case e.RIGHT: newCell = walk(r, c + 1, 1); break; case e.LEFT: newCell = walk(r, c - 1, -1); break; case e.ENTER: if (g.isEditor && !g.editing) { g.startEditing(r, c); return; } break; } if(newCell){ r = newCell[0]; c = newCell[1]; this.select(r, c); if(g.isEditor && g.editing){ ae = g.activeEditor; if(ae && ae.field.triggerBlur){ ae.field.triggerBlur(); } g.startEditing(r, c); } } }, acceptsNav : function(row, col, cm){ return !cm.isHidden(col) && cm.isCellEditable(col, row); } }); Ext.grid.EditorGridPanel = Ext.extend(Ext.grid.GridPanel, { clicksToEdit: 2, forceValidation: false, isEditor : true, detectEdit: false, autoEncode : false, trackMouseOver: false, initComponent : function(){ Ext.grid.EditorGridPanel.superclass.initComponent.call(this); if(!this.selModel){ this.selModel = new Ext.grid.CellSelectionModel(); } this.activeEditor = null; this.addEvents( "beforeedit", "afteredit", "validateedit" ); }, initEvents : function(){ Ext.grid.EditorGridPanel.superclass.initEvents.call(this); this.getGridEl().on('mousewheel', this.stopEditing.createDelegate(this, [true]), this); this.on('columnresize', this.stopEditing, this, [true]); if(this.clicksToEdit == 1){ this.on("cellclick", this.onCellDblClick, this); }else { var view = this.getView(); if(this.clicksToEdit == 'auto' && view.mainBody){ view.mainBody.on('mousedown', this.onAutoEditClick, this); } this.on('celldblclick', this.onCellDblClick, this); } }, onResize : function(){ Ext.grid.EditorGridPanel.superclass.onResize.apply(this, arguments); var ae = this.activeEditor; if(this.editing && ae){ ae.realign(true); } }, onCellDblClick : function(g, row, col){ this.startEditing(row, col); }, onAutoEditClick : function(e, t){ if(e.button !== 0){ return; } var row = this.view.findRowIndex(t), col = this.view.findCellIndex(t); if(row !== false && col !== false){ this.stopEditing(); if(this.selModel.getSelectedCell){ var sc = this.selModel.getSelectedCell(); if(sc && sc[0] === row && sc[1] === col){ this.startEditing(row, col); } }else{ if(this.selModel.isSelected(row)){ this.startEditing(row, col); } } } }, onEditComplete : function(ed, value, startValue){ this.editing = false; this.lastActiveEditor = this.activeEditor; this.activeEditor = null; var r = ed.record, field = this.colModel.getDataIndex(ed.col); value = this.postEditValue(value, startValue, r, field); if(this.forceValidation === true || String(value) !== String(startValue)){ var e = { grid: this, record: r, field: field, originalValue: startValue, value: value, row: ed.row, column: ed.col, cancel:false }; if(this.fireEvent("validateedit", e) !== false && !e.cancel && String(value) !== String(startValue)){ r.set(field, e.value); delete e.cancel; this.fireEvent("afteredit", e); } } this.view.focusCell(ed.row, ed.col); }, startEditing : function(row, col){ this.stopEditing(); if(this.colModel.isCellEditable(col, row)){ this.view.ensureVisible(row, col, true); var r = this.store.getAt(row), field = this.colModel.getDataIndex(col), e = { grid: this, record: r, field: field, value: r.data[field], row: row, column: col, cancel:false }; if(this.fireEvent("beforeedit", e) !== false && !e.cancel){ this.editing = true; var ed = this.colModel.getCellEditor(col, row); if(!ed){ return; } if(!ed.rendered){ ed.parentEl = this.view.getEditorParent(ed); ed.on({ scope: this, render: { fn: function(c){ c.field.focus(false, true); }, single: true, scope: this }, specialkey: function(field, e){ this.getSelectionModel().onEditorKey(field, e); }, complete: this.onEditComplete, canceledit: this.stopEditing.createDelegate(this, [true]) }); } Ext.apply(ed, { row : row, col : col, record : r }); this.lastEdit = { row: row, col: col }; this.activeEditor = ed; ed.selectSameEditor = (this.activeEditor == this.lastActiveEditor); var v = this.preEditValue(r, field); ed.startEdit(this.view.getCell(row, col).firstChild, Ext.isDefined(v) ? v : ''); (function(){ delete ed.selectSameEditor; }).defer(50); } } }, preEditValue : function(r, field){ var value = r.data[field]; return this.autoEncode && Ext.isString(value) ? Ext.util.Format.htmlDecode(value) : value; }, postEditValue : function(value, originalValue, r, field){ return this.autoEncode && Ext.isString(value) ? Ext.util.Format.htmlEncode(value) : value; }, stopEditing : function(cancel){ if(this.editing){ var ae = this.lastActiveEditor = this.activeEditor; if(ae){ ae[cancel === true ? 'cancelEdit' : 'completeEdit'](); this.view.focusCell(ae.row, ae.col); } this.activeEditor = null; } this.editing = false; } }); Ext.reg('editorgrid', Ext.grid.EditorGridPanel); Ext.grid.GridEditor = function(field, config){ Ext.grid.GridEditor.superclass.constructor.call(this, field, config); field.monitorTab = false; }; Ext.extend(Ext.grid.GridEditor, Ext.Editor, { alignment: "tl-tl", autoSize: "width", hideEl : false, cls: "x-small-editor x-grid-editor", shim:false, shadow:false }); Ext.grid.PropertyRecord = Ext.data.Record.create([ {name:'name',type:'string'}, 'value' ]); Ext.grid.PropertyStore = Ext.extend(Ext.util.Observable, { constructor : function(grid, source){ this.grid = grid; this.store = new Ext.data.Store({ recordType : Ext.grid.PropertyRecord }); this.store.on('update', this.onUpdate, this); if(source){ this.setSource(source); } Ext.grid.PropertyStore.superclass.constructor.call(this); }, setSource : function(o){ this.source = o; this.store.removeAll(); var data = []; for(var k in o){ if(this.isEditableValue(o[k])){ data.push(new Ext.grid.PropertyRecord({name: k, value: o[k]}, k)); } } this.store.loadRecords({records: data}, {}, true); }, onUpdate : function(ds, record, type){ if(type == Ext.data.Record.EDIT){ var v = record.data.value; var oldValue = record.modified.value; if(this.grid.fireEvent('beforepropertychange', this.source, record.id, v, oldValue) !== false){ this.source[record.id] = v; record.commit(); this.grid.fireEvent('propertychange', this.source, record.id, v, oldValue); }else{ record.reject(); } } }, getProperty : function(row){ return this.store.getAt(row); }, isEditableValue: function(val){ return Ext.isPrimitive(val) || Ext.isDate(val); }, setValue : function(prop, value, create){ var r = this.getRec(prop); if(r){ r.set('value', value); this.source[prop] = value; }else if(create){ this.source[prop] = value; r = new Ext.grid.PropertyRecord({name: prop, value: value}, prop); this.store.add(r); } }, remove : function(prop){ var r = this.getRec(prop); if(r){ this.store.remove(r); delete this.source[prop]; } }, getRec : function(prop){ return this.store.getById(prop); }, getSource : function(){ return this.source; } }); Ext.grid.PropertyColumnModel = Ext.extend(Ext.grid.ColumnModel, { nameText : 'Name', valueText : 'Value', dateFormat : 'm/j/Y', trueText: 'true', falseText: 'false', constructor : function(grid, store){ var g = Ext.grid, f = Ext.form; this.grid = grid; g.PropertyColumnModel.superclass.constructor.call(this, [ {header: this.nameText, width:50, sortable: true, dataIndex:'name', id: 'name', menuDisabled:true}, {header: this.valueText, width:50, resizable:false, dataIndex: 'value', id: 'value', menuDisabled:true} ]); this.store = store; var bfield = new f.Field({ autoCreate: {tag: 'select', children: [ {tag: 'option', value: 'true', html: this.trueText}, {tag: 'option', value: 'false', html: this.falseText} ]}, getValue : function(){ return this.el.dom.value == 'true'; } }); this.editors = { 'date' : new g.GridEditor(new f.DateField({selectOnFocus:true})), 'string' : new g.GridEditor(new f.TextField({selectOnFocus:true})), 'number' : new g.GridEditor(new f.NumberField({selectOnFocus:true, style:'text-align:left;'})), 'boolean' : new g.GridEditor(bfield, { autoSize: 'both' }) }; this.renderCellDelegate = this.renderCell.createDelegate(this); this.renderPropDelegate = this.renderProp.createDelegate(this); }, renderDate : function(dateVal){ return dateVal.dateFormat(this.dateFormat); }, renderBool : function(bVal){ return this[bVal ? 'trueText' : 'falseText']; }, isCellEditable : function(colIndex, rowIndex){ return colIndex == 1; }, getRenderer : function(col){ return col == 1 ? this.renderCellDelegate : this.renderPropDelegate; }, renderProp : function(v){ return this.getPropertyName(v); }, renderCell : function(val, meta, rec){ var renderer = this.grid.customRenderers[rec.get('name')]; if(renderer){ return renderer.apply(this, arguments); } var rv = val; if(Ext.isDate(val)){ rv = this.renderDate(val); }else if(typeof val == 'boolean'){ rv = this.renderBool(val); } return Ext.util.Format.htmlEncode(rv); }, getPropertyName : function(name){ var pn = this.grid.propertyNames; return pn && pn[name] ? pn[name] : name; }, getCellEditor : function(colIndex, rowIndex){ var p = this.store.getProperty(rowIndex), n = p.data.name, val = p.data.value; if(this.grid.customEditors[n]){ return this.grid.customEditors[n]; } if(Ext.isDate(val)){ return this.editors.date; }else if(typeof val == 'number'){ return this.editors.number; }else if(typeof val == 'boolean'){ return this.editors['boolean']; }else{ return this.editors.string; } }, destroy : function(){ Ext.grid.PropertyColumnModel.superclass.destroy.call(this); this.destroyEditors(this.editors); this.destroyEditors(this.grid.customEditors); }, destroyEditors: function(editors){ for(var ed in editors){ Ext.destroy(editors[ed]); } } }); Ext.grid.PropertyGrid = Ext.extend(Ext.grid.EditorGridPanel, { enableColumnMove:false, stripeRows:false, trackMouseOver: false, clicksToEdit:1, enableHdMenu : false, viewConfig : { forceFit:true }, initComponent : function(){ this.customRenderers = this.customRenderers || {}; this.customEditors = this.customEditors || {}; this.lastEditRow = null; var store = new Ext.grid.PropertyStore(this); this.propStore = store; var cm = new Ext.grid.PropertyColumnModel(this, store); store.store.sort('name', 'ASC'); this.addEvents( 'beforepropertychange', 'propertychange' ); this.cm = cm; this.ds = store.store; Ext.grid.PropertyGrid.superclass.initComponent.call(this); this.mon(this.selModel, 'beforecellselect', function(sm, rowIndex, colIndex){ if(colIndex === 0){ this.startEditing.defer(200, this, [rowIndex, 1]); return false; } }, this); }, onRender : function(){ Ext.grid.PropertyGrid.superclass.onRender.apply(this, arguments); this.getGridEl().addClass('x-props-grid'); }, afterRender: function(){ Ext.grid.PropertyGrid.superclass.afterRender.apply(this, arguments); if(this.source){ this.setSource(this.source); } }, setSource : function(source){ this.propStore.setSource(source); }, getSource : function(){ return this.propStore.getSource(); }, setProperty : function(prop, value, create){ this.propStore.setValue(prop, value, create); }, removeProperty : function(prop){ this.propStore.remove(prop); } }); Ext.reg("propertygrid", Ext.grid.PropertyGrid); Ext.grid.GroupingView = Ext.extend(Ext.grid.GridView, { groupByText : 'Group By This Field', showGroupsText : 'Show in Groups', hideGroupedColumn : false, showGroupName : true, startCollapsed : false, enableGrouping : true, enableGroupingMenu : true, enableNoGroups : true, emptyGroupText : '(None)', ignoreAdd : false, groupTextTpl : '{text}', groupMode: 'value', cancelEditOnToggle: true, initTemplates : function(){ Ext.grid.GroupingView.superclass.initTemplates.call(this); this.state = {}; var sm = this.grid.getSelectionModel(); sm.on(sm.selectRow ? 'beforerowselect' : 'beforecellselect', this.onBeforeRowSelect, this); if(!this.startGroup){ this.startGroup = new Ext.XTemplate( '
    ', '
    ', this.groupTextTpl ,'
    ', '
    ' ); } this.startGroup.compile(); if (!this.endGroup) { this.endGroup = '
    '; } }, findGroup : function(el){ return Ext.fly(el).up('.x-grid-group', this.mainBody.dom); }, getGroups : function(){ return this.hasRows() ? this.mainBody.dom.childNodes : []; }, onAdd : function(ds, records, index) { if (this.canGroup() && !this.ignoreAdd) { var ss = this.getScrollState(); this.fireEvent('beforerowsinserted', ds, index, index + (records.length-1)); this.refresh(); this.restoreScroll(ss); this.fireEvent('rowsinserted', ds, index, index + (records.length-1)); } else if (!this.canGroup()) { Ext.grid.GroupingView.superclass.onAdd.apply(this, arguments); } }, onRemove : function(ds, record, index, isUpdate){ Ext.grid.GroupingView.superclass.onRemove.apply(this, arguments); var g = document.getElementById(record._groupId); if(g && g.childNodes[1].childNodes.length < 1){ Ext.removeNode(g); } this.applyEmptyText(); }, refreshRow : function(record){ if(this.ds.getCount()==1){ this.refresh(); }else{ this.isUpdating = true; Ext.grid.GroupingView.superclass.refreshRow.apply(this, arguments); this.isUpdating = false; } }, beforeMenuShow : function(){ var item, items = this.hmenu.items, disabled = this.cm.config[this.hdCtxIndex].groupable === false; if((item = items.get('groupBy'))){ item.setDisabled(disabled); } if((item = items.get('showGroups'))){ item.setDisabled(disabled); item.setChecked(this.canGroup(), true); } }, renderUI : function(){ var markup = Ext.grid.GroupingView.superclass.renderUI.call(this); if(this.enableGroupingMenu && this.hmenu){ this.hmenu.add('-',{ itemId:'groupBy', text: this.groupByText, handler: this.onGroupByClick, scope: this, iconCls:'x-group-by-icon' }); if(this.enableNoGroups){ this.hmenu.add({ itemId:'showGroups', text: this.showGroupsText, checked: true, checkHandler: this.onShowGroupsClick, scope: this }); } this.hmenu.on('beforeshow', this.beforeMenuShow, this); } return markup; }, processEvent: function(name, e){ Ext.grid.GroupingView.superclass.processEvent.call(this, name, e); var hd = e.getTarget('.x-grid-group-hd', this.mainBody); if(hd){ var field = this.getGroupField(), prefix = this.getPrefix(field), groupValue = hd.id.substring(prefix.length), emptyRe = new RegExp('gp-' + Ext.escapeRe(field) + '--hd'); groupValue = groupValue.substr(0, groupValue.length - 3); if(groupValue || emptyRe.test(hd.id)){ this.grid.fireEvent('group' + name, this.grid, field, groupValue, e); } if(name == 'mousedown' && e.button == 0){ this.toggleGroup(hd.parentNode); } } }, onGroupByClick : function(){ var grid = this.grid; this.enableGrouping = true; grid.store.groupBy(this.cm.getDataIndex(this.hdCtxIndex)); grid.fireEvent('groupchange', grid, grid.store.getGroupState()); this.beforeMenuShow(); this.refresh(); }, onShowGroupsClick : function(mi, checked){ this.enableGrouping = checked; if(checked){ this.onGroupByClick(); }else{ this.grid.store.clearGrouping(); this.grid.fireEvent('groupchange', this, null); } }, toggleRowIndex : function(rowIndex, expanded){ if(!this.canGroup()){ return; } var row = this.getRow(rowIndex); if(row){ this.toggleGroup(this.findGroup(row), expanded); } }, toggleGroup : function(group, expanded){ var gel = Ext.get(group), id = Ext.util.Format.htmlEncode(gel.id); expanded = Ext.isDefined(expanded) ? expanded : gel.hasClass('x-grid-group-collapsed'); if(this.state[id] !== expanded){ if (this.cancelEditOnToggle !== false) { this.grid.stopEditing(true); } this.state[id] = expanded; gel[expanded ? 'removeClass' : 'addClass']('x-grid-group-collapsed'); } }, toggleAllGroups : function(expanded){ var groups = this.getGroups(); for(var i = 0, len = groups.length; i < len; i++){ this.toggleGroup(groups[i], expanded); } }, expandAllGroups : function(){ this.toggleAllGroups(true); }, collapseAllGroups : function(){ this.toggleAllGroups(false); }, getGroup : function(v, r, groupRenderer, rowIndex, colIndex, ds){ var column = this.cm.config[colIndex], g = groupRenderer ? groupRenderer.call(column.scope, v, {}, r, rowIndex, colIndex, ds) : String(v); if(g === '' || g === ' '){ g = column.emptyGroupText || this.emptyGroupText; } return g; }, getGroupField : function(){ return this.grid.store.getGroupState(); }, afterRender : function(){ if(!this.ds || !this.cm){ return; } Ext.grid.GroupingView.superclass.afterRender.call(this); if(this.grid.deferRowRender){ this.updateGroupWidths(); } }, afterRenderUI: function () { Ext.grid.GroupingView.superclass.afterRenderUI.call(this); if (this.enableGroupingMenu && this.hmenu) { this.hmenu.add('-',{ itemId:'groupBy', text: this.groupByText, handler: this.onGroupByClick, scope: this, iconCls:'x-group-by-icon' }); if (this.enableNoGroups) { this.hmenu.add({ itemId:'showGroups', text: this.showGroupsText, checked: true, checkHandler: this.onShowGroupsClick, scope: this }); } this.hmenu.on('beforeshow', this.beforeMenuShow, this); } }, renderRows : function(){ var groupField = this.getGroupField(); var eg = !!groupField; if(this.hideGroupedColumn) { var colIndex = this.cm.findColumnIndex(groupField), hasLastGroupField = Ext.isDefined(this.lastGroupField); if(!eg && hasLastGroupField){ this.mainBody.update(''); this.cm.setHidden(this.cm.findColumnIndex(this.lastGroupField), false); delete this.lastGroupField; }else if (eg && !hasLastGroupField){ this.lastGroupField = groupField; this.cm.setHidden(colIndex, true); }else if (eg && hasLastGroupField && groupField !== this.lastGroupField) { this.mainBody.update(''); var oldIndex = this.cm.findColumnIndex(this.lastGroupField); this.cm.setHidden(oldIndex, false); this.lastGroupField = groupField; this.cm.setHidden(colIndex, true); } } return Ext.grid.GroupingView.superclass.renderRows.apply( this, arguments); }, doRender : function(cs, rs, ds, startRow, colCount, stripe){ if(rs.length < 1){ return ''; } if(!this.canGroup() || this.isUpdating){ return Ext.grid.GroupingView.superclass.doRender.apply(this, arguments); } var groupField = this.getGroupField(), colIndex = this.cm.findColumnIndex(groupField), g, gstyle = 'width:' + this.getTotalWidth() + ';', cfg = this.cm.config[colIndex], groupRenderer = cfg.groupRenderer || cfg.renderer, prefix = this.showGroupName ? (cfg.groupName || cfg.header)+': ' : '', groups = [], curGroup, i, len, gid; for(i = 0, len = rs.length; i < len; i++){ var rowIndex = startRow + i, r = rs[i], gvalue = r.data[groupField]; g = this.getGroup(gvalue, r, groupRenderer, rowIndex, colIndex, ds); if(!curGroup || curGroup.group != g){ gid = this.constructId(gvalue, groupField, colIndex); this.state[gid] = !(Ext.isDefined(this.state[gid]) ? !this.state[gid] : this.startCollapsed); curGroup = { group: g, gvalue: gvalue, text: prefix + g, groupId: gid, startRow: rowIndex, rs: [r], cls: this.state[gid] ? '' : 'x-grid-group-collapsed', style: gstyle }; groups.push(curGroup); }else{ curGroup.rs.push(r); } r._groupId = gid; } var buf = []; for(i = 0, len = groups.length; i < len; i++){ g = groups[i]; this.doGroupStart(buf, g, cs, ds, colCount); buf[buf.length] = Ext.grid.GroupingView.superclass.doRender.call( this, cs, g.rs, ds, g.startRow, colCount, stripe); this.doGroupEnd(buf, g, cs, ds, colCount); } return buf.join(''); }, getGroupId : function(value){ var field = this.getGroupField(); return this.constructId(value, field, this.cm.findColumnIndex(field)); }, constructId : function(value, field, idx){ var cfg = this.cm.config[idx], groupRenderer = cfg.groupRenderer || cfg.renderer, val = (this.groupMode == 'value') ? value : this.getGroup(value, {data:{}}, groupRenderer, 0, idx, this.ds); return this.getPrefix(field) + Ext.util.Format.htmlEncode(val); }, canGroup : function(){ return this.enableGrouping && !!this.getGroupField(); }, getPrefix: function(field){ return this.grid.getGridEl().id + '-gp-' + field + '-'; }, doGroupStart : function(buf, g, cs, ds, colCount){ buf[buf.length] = this.startGroup.apply(g); }, doGroupEnd : function(buf, g, cs, ds, colCount){ buf[buf.length] = this.endGroup; }, getRows : function(){ if(!this.canGroup()){ return Ext.grid.GroupingView.superclass.getRows.call(this); } var r = [], gs = this.getGroups(), g, i = 0, len = gs.length, j, jlen; for(; i < len; ++i){ g = gs[i].childNodes[1]; if(g){ g = g.childNodes; for(j = 0, jlen = g.length; j < jlen; ++j){ r[r.length] = g[j]; } } } return r; }, updateGroupWidths : function(){ if(!this.canGroup() || !this.hasRows()){ return; } var tw = Math.max(this.cm.getTotalWidth(), this.el.dom.offsetWidth-this.getScrollOffset()) +'px'; var gs = this.getGroups(); for(var i = 0, len = gs.length; i < len; i++){ gs[i].firstChild.style.width = tw; } }, onColumnWidthUpdated : function(col, w, tw){ Ext.grid.GroupingView.superclass.onColumnWidthUpdated.call(this, col, w, tw); this.updateGroupWidths(); }, onAllColumnWidthsUpdated : function(ws, tw){ Ext.grid.GroupingView.superclass.onAllColumnWidthsUpdated.call(this, ws, tw); this.updateGroupWidths(); }, onColumnHiddenUpdated : function(col, hidden, tw){ Ext.grid.GroupingView.superclass.onColumnHiddenUpdated.call(this, col, hidden, tw); this.updateGroupWidths(); }, onLayout : function(){ this.updateGroupWidths(); }, onBeforeRowSelect : function(sm, rowIndex){ this.toggleRowIndex(rowIndex, true); } }); Ext.grid.GroupingView.GROUP_ID = 1000; glpi-0.84.3+dfsg.1/lib/extjs/ext-all.js000066400000000000000000025712731226600447100174510ustar00rootroot00000000000000/* * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ (function(){var h=Ext.util,j=Ext.each,g=true,i=false;h.Observable=function(){var k=this,l=k.events;if(k.listeners){k.on(k.listeners);delete k.listeners}k.events=l||{}};h.Observable.prototype={filterOptRe:/^(?:scope|delay|buffer|single)$/,fireEvent:function(){var k=Array.prototype.slice.call(arguments,0),m=k[0].toLowerCase(),n=this,l=g,p=n.events[m],s,o,r;if(n.eventsSuspended===g){if(o=n.eventQueue){o.push(k)}}else{if(typeof p=="object"){if(p.bubble){if(p.fire.apply(p,k.slice(1))===i){return i}r=n.getBubbleTarget&&n.getBubbleTarget();if(r&&r.enableBubble){s=r.events[m];if(!s||typeof s!="object"||!s.bubble){r.enableBubble(m)}return r.fireEvent.apply(r,k)}}else{k.shift();l=p.fire.apply(p,k)}}}return l},addListener:function(k,m,l,r){var n=this,q,s,p;if(typeof k=="object"){r=k;for(q in r){s=r[q];if(!n.filterOptRe.test(q)){n.addListener(q,s.fn||s,s.scope||r.scope,s.fn?s:r)}}}else{k=k.toLowerCase();p=n.events[k]||g;if(typeof p=="boolean"){n.events[k]=p=new h.Event(n,k)}p.addListener(m,l,typeof r=="object"?r:{})}},removeListener:function(k,m,l){var n=this.events[k.toLowerCase()];if(typeof n=="object"){n.removeListener(m,l)}},purgeListeners:function(){var m=this.events,k,l;for(l in m){k=m[l];if(typeof k=="object"){k.clearListeners()}}},addEvents:function(n){var m=this;m.events=m.events||{};if(typeof n=="string"){var k=arguments,l=k.length;while(l--){m.events[k[l]]=m.events[k[l]]||g}}else{Ext.applyIf(m.events,n)}},hasListener:function(k){var l=this.events[k.toLowerCase()];return typeof l=="object"&&l.listeners.length>0},suspendEvents:function(k){this.eventsSuspended=g;if(k&&!this.eventQueue){this.eventQueue=[]}},resumeEvents:function(){var k=this,l=k.eventQueue||[];k.eventsSuspended=i;delete k.eventQueue;j(l,function(m){k.fireEvent.apply(k,m)})}};var d=h.Observable.prototype;d.on=d.addListener;d.un=d.removeListener;h.Observable.releaseCapture=function(k){k.fireEvent=d.fireEvent};function e(l,m,k){return function(){if(m.target==arguments[0]){l.apply(k,Array.prototype.slice.call(arguments,0))}}}function b(n,p,k,m){k.task=new h.DelayedTask();return function(){k.task.delay(p.buffer,n,m,Array.prototype.slice.call(arguments,0))}}function c(m,n,l,k){return function(){n.removeListener(l,k);return m.apply(k,arguments)}}function a(n,p,k,m){return function(){var l=new h.DelayedTask(),o=Array.prototype.slice.call(arguments,0);if(!k.tasks){k.tasks=[]}k.tasks.push(l);l.delay(p.delay||10,function(){k.tasks.remove(l);n.apply(m,o)},m)}}h.Event=function(l,k){this.name=k;this.obj=l;this.listeners=[]};h.Event.prototype={addListener:function(o,n,m){var p=this,k;n=n||p.obj;if(!p.isListening(o,n)){k=p.createListener(o,n,m);if(p.firing){p.listeners=p.listeners.slice(0)}p.listeners.push(k)}},createListener:function(p,n,q){q=q||{};n=n||this.obj;var k={fn:p,scope:n,options:q},m=p;if(q.target){m=e(m,q,n)}if(q.delay){m=a(m,q,k,n)}if(q.single){m=c(m,this,p,n)}if(q.buffer){m=b(m,q,k,n)}k.fireFn=m;return k},findListener:function(o,n){var p=this.listeners,m=p.length,k;n=n||this.obj;while(m--){k=p[m];if(k){if(k.fn==o&&k.scope==n){return m}}}return -1},isListening:function(l,k){return this.findListener(l,k)!=-1},removeListener:function(r,q){var p,m,n,s=this,o=i;if((p=s.findListener(r,q))!=-1){if(s.firing){s.listeners=s.listeners.slice(0)}m=s.listeners[p];if(m.task){m.task.cancel();delete m.task}n=m.tasks&&m.tasks.length;if(n){while(n--){m.tasks[n].cancel()}delete m.tasks}s.listeners.splice(p,1);o=g}return o},clearListeners:function(){var n=this,k=n.listeners,m=k.length;while(m--){n.removeListener(k[m].fn,k[m].scope)}},fire:function(){var q=this,p=q.listeners,k=p.length,o=0,m;if(k>0){q.firing=g;var n=Array.prototype.slice.call(arguments,0);for(;o",i="",b=a+"",j=""+i,l=b+"",w=""+j;function h(B,D,C,E,A,y){var z=r.insertHtml(E,Ext.getDom(B),u(D));return C?Ext.get(z,true):z}function u(D){var z="",y,C,B,E;if(typeof D=="string"){z=D}else{if(Ext.isArray(D)){for(var A=0;A"}}}return z}function g(F,C,B,D){x.innerHTML=[C,B,D].join("");var y=-1,A=x,z;while(++y "'+D+'"'},insertBefore:function(y,A,z){return h(y,A,z,c)},insertAfter:function(y,A,z){return h(y,A,z,p,"nextSibling")},insertFirst:function(y,A,z){return h(y,A,z,n,"firstChild")},append:function(y,A,z){return h(y,A,z,q,"",true)},overwrite:function(y,A,z){y=Ext.getDom(y);y.innerHTML=u(A);return z?Ext.get(y.firstChild):y.firstChild},createHtml:u};return r}();Ext.Template=function(h){var j=this,c=arguments,e=[],d;if(Ext.isArray(h)){h=h.join("")}else{if(c.length>1){for(var g=0,b=c.length;g+~]\s?|\s|$)/,tagTokenRe=/^(#)?([\w\-\*]+)/,nthRe=/(\d*)n\+?(\d*)/,nthRe2=/\D/,isIE=window.ActiveXObject?true:false,key=30803;eval("var batch = 30803;");function child(parent,index){var i=0,n=parent.firstChild;while(n){if(n.nodeType==1){if(++i==index){return n}}n=n.nextSibling}return null}function next(n){while((n=n.nextSibling)&&n.nodeType!=1){}return n}function prev(n){while((n=n.previousSibling)&&n.nodeType!=1){}return n}function children(parent){var n=parent.firstChild,nodeIndex=-1,nextNode;while(n){nextNode=n.nextSibling;if(n.nodeType==3&&!nonSpace.test(n.nodeValue)){parent.removeChild(n)}else{n.nodeIndex=++nodeIndex}n=nextNode}return this}function byClassName(nodeSet,cls){if(!cls){return nodeSet}var result=[],ri=-1;for(var i=0,ci;ci=nodeSet[i];i++){if((" "+ci.className+" ").indexOf(cls)!=-1){result[++ri]=ci}}return result}function attrValue(n,attr){if(!n.tagName&&typeof n.length!="undefined"){n=n[0]}if(!n){return null}if(attr=="for"){return n.htmlFor}if(attr=="class"||attr=="className"){return n.className}return n.getAttribute(attr)||n[attr]}function getNodes(ns,mode,tagName){var result=[],ri=-1,cs;if(!ns){return result}tagName=tagName||"*";if(typeof ns.getElementsByTagName!="undefined"){ns=[ns]}if(!mode){for(var i=0,ni;ni=ns[i];i++){cs=ni.getElementsByTagName(tagName);for(var j=0,ci;ci=cs[j];j++){result[++ri]=ci}}}else{if(mode=="/"||mode==">"){var utag=tagName.toUpperCase();for(var i=0,ni,cn;ni=ns[i];i++){cn=ni.childNodes;for(var j=0,cj;cj=cn[j];j++){if(cj.nodeName==utag||cj.nodeName==tagName||tagName=="*"){result[++ri]=cj}}}}else{if(mode=="+"){var utag=tagName.toUpperCase();for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)&&n.nodeType!=1){}if(n&&(n.nodeName==utag||n.nodeName==tagName||tagName=="*")){result[++ri]=n}}}else{if(mode=="~"){var utag=tagName.toUpperCase();for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)){if(n.nodeName==utag||n.nodeName==tagName||tagName=="*"){result[++ri]=n}}}}}}}return result}function concat(a,b){if(b.slice){return a.concat(b)}for(var i=0,l=b.length;i1){return nodup(results)}return results},isXml:function(el){var docEl=(el?el.ownerDocument||el:0).documentElement;return docEl?docEl.nodeName!=="HTML":false},select:document.querySelectorAll?function(path,root,type){root=root||document;if(!Ext.DomQuery.isXml(root)){try{var cs=root.querySelectorAll(path);return Ext.toArray(cs)}catch(ex){}}return Ext.DomQuery.jsSelect.call(this,path,root,type)}:function(path,root,type){return Ext.DomQuery.jsSelect.call(this,path,root,type)},selectNode:function(path,root){return Ext.DomQuery.select(path,root)[0]},selectValue:function(path,root,defaultValue){path=path.replace(trimRe,"");if(!valueCache[path]){valueCache[path]=Ext.DomQuery.compile(path,"select")}var n=valueCache[path](root),v;n=n[0]?n[0]:n;if(typeof n.normalize=="function"){n.normalize()}v=(n&&n.firstChild?n.firstChild.nodeValue:null);return((v===null||v===undefined||v==="")?defaultValue:v)},selectNumber:function(path,root,defaultValue){var v=Ext.DomQuery.selectValue(path,root,defaultValue||0);return parseFloat(v)},is:function(el,ss){if(typeof el=="string"){el=document.getElementById(el)}var isArray=Ext.isArray(el),result=Ext.DomQuery.filter(isArray?el:[el],ss);return isArray?(result.length==el.length):(result.length>0)},filter:function(els,ss,nonMatches){ss=ss.replace(trimRe,"");if(!simpleCache[ss]){simpleCache[ss]=Ext.DomQuery.compile(ss,"simple")}var result=simpleCache[ss](els);return nonMatches?quickDiff(result,els):result},matchers:[{re:/^\.([\w\-]+)/,select:'n = byClassName(n, " {1} ");'},{re:/^\:([\w\-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,select:'n = byPseudo(n, "{1}", "{2}");'},{re:/^(?:([\[\{])(?:@)?([\w\-]+)\s?(?:(=|.=)\s?(["']?)(.*?)\4)?[\]\}])/,select:'n = byAttribute(n, "{2}", "{5}", "{3}", "{1}");'},{re:/^#([\w\-]+)/,select:'n = byId(n, "{1}");'},{re:/^@([\w\-]+)/,select:'return {firstChild:{nodeValue:attrValue(n, "{1}")}};'}],operators:{"=":function(a,v){return a==v},"!=":function(a,v){return a!=v},"^=":function(a,v){return a&&a.substr(0,v.length)==v},"$=":function(a,v){return a&&a.substr(a.length-v.length)==v},"*=":function(a,v){return a&&a.indexOf(v)!==-1},"%=":function(a,v){return(a%v)==0},"|=":function(a,v){return a&&(a==v||a.substr(0,v.length+1)==v+"-")},"~=":function(a,v){return a&&(" "+a+" ").indexOf(" "+v+" ")!=-1}},pseudos:{"first-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.previousSibling)&&n.nodeType!=1){}if(!n){r[++ri]=ci}}return r},"last-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.nextSibling)&&n.nodeType!=1){}if(!n){r[++ri]=ci}}return r},"nth-child":function(c,a){var r=[],ri=-1,m=nthRe.exec(a=="even"&&"2n"||a=="odd"&&"2n+1"||!nthRe2.test(a)&&"n+"+a||a),f=(m[1]||1)-0,l=m[2]-0;for(var i=0,n;n=c[i];i++){var pn=n.parentNode;if(batch!=pn._batch){var j=0;for(var cn=pn.firstChild;cn;cn=cn.nextSibling){if(cn.nodeType==1){cn.nodeIndex=++j}}pn._batch=batch}if(f==1){if(l==0||n.nodeIndex==l){r[++ri]=n}}else{if((n.nodeIndex+l)%f==0){r[++ri]=n}}}return r},"only-child":function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(!prev(ci)&&!next(ci)){r[++ri]=ci}}return r},empty:function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var cns=ci.childNodes,j=0,cn,empty=true;while(cn=cns[j]){++j;if(cn.nodeType==1||cn.nodeType==3){empty=false;break}}if(empty){r[++ri]=ci}}return r},contains:function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if((ci.textContent||ci.innerText||"").indexOf(v)!=-1){r[++ri]=ci}}return r},nodeValue:function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.firstChild&&ci.firstChild.nodeValue==v){r[++ri]=ci}}return r},checked:function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.checked==true){r[++ri]=ci}}return r},not:function(c,ss){return Ext.DomQuery.filter(c,ss,true)},any:function(c,selectors){var ss=selectors.split("|"),r=[],ri=-1,s;for(var i=0,ci;ci=c[i];i++){for(var j=0;s=ss[j];j++){if(Ext.DomQuery.is(ci,s)){r[++ri]=ci;break}}}return r},odd:function(c){return this["nth-child"](c,"odd")},even:function(c){return this["nth-child"](c,"even")},nth:function(c,a){return c[a-1]||[]},first:function(c){return c[0]||[]},last:function(c){return c[c.length-1]||[]},has:function(c,ss){var s=Ext.DomQuery.select,r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(s(ss,ci).length>0){r[++ri]=ci}}return r},next:function(c,ss){var is=Ext.DomQuery.is,r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=next(ci);if(n&&is(n,ss)){r[++ri]=ci}}return r},prev:function(c,ss){var is=Ext.DomQuery.is,r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=prev(ci);if(n&&is(n,ss)){r[++ri]=ci}}return r}}}}();Ext.query=Ext.DomQuery.select;Ext.util.DelayedTask=function(d,c,a){var e=this,g,b=function(){clearInterval(g);g=null;d.apply(c,a||[])};e.delay=function(i,k,j,h){e.cancel();d=k||d;c=j||c;a=h||a;g=setInterval(b,i)};e.cancel=function(){if(g){clearInterval(g);g=null}}};(function(){var h=document;Ext.Element=function(l,m){var n=typeof l=="string"?h.getElementById(l):l,o;if(!n){return null}o=n.id;if(!m&&o&&Ext.elCache[o]){return Ext.elCache[o].el}this.dom=n;this.id=o||Ext.id(n)};var d=Ext.DomHelper,e=Ext.Element,a=Ext.elCache;e.prototype={set:function(q,m){var n=this.dom,l,p,m=(m!==false)&&!!n.setAttribute;for(l in q){if(q.hasOwnProperty(l)){p=q[l];if(l=="style"){d.applyStyles(n,p)}else{if(l=="cls"){n.className=p}else{if(m){n.setAttribute(l,p)}else{n[l]=p}}}}}return this},defaultUnit:"px",is:function(l){return Ext.DomQuery.is(this.dom,l)},focus:function(o,n){var l=this,n=n||l.dom;try{if(Number(o)){l.focus.defer(o,null,[null,n])}else{n.focus()}}catch(m){}return l},blur:function(){try{this.dom.blur()}catch(l){}return this},getValue:function(l){var m=this.dom.value;return l?parseInt(m,10):m},addListener:function(l,o,n,m){Ext.EventManager.on(this.dom,l,o,n||this,m);return this},removeListener:function(l,n,m){Ext.EventManager.removeListener(this.dom,l,n,m||this);return this},removeAllListeners:function(){Ext.EventManager.removeAll(this.dom);return this},purgeAllListeners:function(){Ext.EventManager.purgeElement(this,true);return this},addUnits:function(l){if(l===""||l=="auto"||l===undefined){l=l||""}else{if(!isNaN(l)||!i.test(l)){l=l+(this.defaultUnit||"px")}}return l},load:function(m,n,l){Ext.Ajax.request(Ext.apply({params:n,url:m.url||m,callback:l,el:this.dom,indicatorText:m.indicatorText||""},Ext.isObject(m)?m:{}));return this},isBorderBox:function(){return Ext.isBorderBox||Ext.isForcedBorderBox||g[(this.dom.tagName||"").toLowerCase()]},remove:function(){var l=this,m=l.dom;if(m){delete l.dom;Ext.removeNode(m)}},hover:function(m,l,o,n){var p=this;p.on("mouseenter",m,o||p.dom,n);p.on("mouseleave",l,o||p.dom,n);return p},contains:function(l){return !l?false:Ext.lib.Dom.isAncestor(this.dom,l.dom?l.dom:l)},getAttributeNS:function(m,l){return this.getAttribute(l,m)},getAttribute:(function(){var p=document.createElement("table"),o=false,m="getAttribute" in p,l=/undefined|unknown/;if(m){try{p.getAttribute("ext:qtip")}catch(n){o=true}return function(q,s){var r=this.dom,t;if(r.getAttributeNS){t=r.getAttributeNS(s,q)||null}if(t==null){if(s){if(o&&r.tagName.toUpperCase()=="TABLE"){try{t=r.getAttribute(s+":"+q)}catch(u){t=""}}else{t=r.getAttribute(s+":"+q)}}else{t=r.getAttribute(q)||r[q]}}return t||""}}else{return function(q,s){var r=this.om,u,t;if(s){t=r[s+":"+q];u=l.test(typeof t)?undefined:t}else{u=r[q]}return u||""}}p=null})(),update:function(l){if(this.dom){this.dom.innerHTML=l}return this}};var k=e.prototype;e.addMethods=function(l){Ext.apply(k,l)};k.on=k.addListener;k.un=k.removeListener;k.autoBoxAdjust=true;var i=/\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i,c;e.get=function(m){var l,p,o;if(!m){return null}if(typeof m=="string"){if(!(p=h.getElementById(m))){return null}if(a[m]&&a[m].el){l=a[m].el;l.dom=p}else{l=e.addToCache(new e(p))}return l}else{if(m.tagName){if(!(o=m.id)){o=Ext.id(m)}if(a[o]&&a[o].el){l=a[o].el;l.dom=m}else{l=e.addToCache(new e(m))}return l}else{if(m instanceof e){if(m!=c){if(Ext.isIE&&(m.id==undefined||m.id=="")){m.dom=m.dom}else{m.dom=h.getElementById(m.id)||m.dom}}return m}else{if(m.isComposite){return m}else{if(Ext.isArray(m)){return e.select(m)}else{if(m==h){if(!c){var n=function(){};n.prototype=e.prototype;c=new n();c.dom=h}return c}}}}}}return null};e.addToCache=function(l,m){m=m||l.id;a[m]={el:l,data:{},events:{}};return l};e.data=function(m,l,n){m=e.get(m);if(!m){return null}var o=a[m.id].data;if(arguments.length==2){return o[l]}else{return(o[l]=n)}};function j(){if(!Ext.enableGarbageCollector){clearInterval(e.collectorThreadId)}else{var l,n,q,p;for(l in a){p=a[l];if(p.skipGC){continue}n=p.el;q=n.dom;if(!q||!q.parentNode||(!q.offsetParent&&!h.getElementById(l))){if(Ext.enableListenerCollection){Ext.EventManager.removeAll(q)}delete a[l]}}if(Ext.isIE){var m={};for(l in a){m[l]=a[l]}a=Ext.elCache=m}}}e.collectorThreadId=setInterval(j,30000);var b=function(){};b.prototype=e.prototype;e.Flyweight=function(l){this.dom=l};e.Flyweight.prototype=new b();e.Flyweight.prototype.isFlyweight=true;e._flyweights={};e.fly=function(n,l){var m=null;l=l||"_global";if(n=Ext.getDom(n)){(e._flyweights[l]=e._flyweights[l]||new e.Flyweight()).dom=n;m=e._flyweights[l]}return m};Ext.get=e.get;Ext.fly=e.fly;var g=Ext.isStrict?{select:1}:{input:1,select:1,textarea:1};if(Ext.isIE||Ext.isGecko){g.button=1}})();Ext.Element.addMethods(function(){var d="parentNode",b="nextSibling",c="previousSibling",e=Ext.DomQuery,a=Ext.get;return{findParent:function(m,l,h){var j=this.dom,g=document.body,k=0,i;if(Ext.isGecko&&Object.prototype.toString.call(j)=="[object XULElement]"){return null}l=l||50;if(isNaN(l)){i=Ext.getDom(l);l=Number.MAX_VALUE}while(j&&j.nodeType==1&&k "+g,this.dom);return h?i:a(i)},parent:function(g,h){return this.matchNode(d,d,g,h)},next:function(g,h){return this.matchNode(b,b,g,h)},prev:function(g,h){return this.matchNode(c,c,g,h)},first:function(g,h){return this.matchNode(b,"firstChild",g,h)},last:function(g,h){return this.matchNode(c,"lastChild",g,h)},matchNode:function(h,k,g,i){var j=this.dom[k];while(j){if(j.nodeType==1&&(!g||e.is(j,g))){return !i?a(j):j}j=j[h]}return null}}}());Ext.Element.addMethods(function(){var c=Ext.getDom,a=Ext.get,b=Ext.DomHelper;return{appendChild:function(d){return a(d).appendTo(this)},appendTo:function(d){c(d).appendChild(this.dom);return this},insertBefore:function(d){(d=c(d)).parentNode.insertBefore(this.dom,d);return this},insertAfter:function(d){(d=c(d)).parentNode.insertBefore(this.dom,d.nextSibling);return this},insertFirst:function(e,d){e=e||{};if(e.nodeType||e.dom||typeof e=="string"){e=c(e);this.dom.insertBefore(e,this.dom.firstChild);return !d?a(e):e}else{return this.createChild(e,this.dom.firstChild,d)}},replace:function(d){d=a(d);this.insertBefore(d);d.remove();return this},replaceWith:function(d){var e=this;if(d.nodeType||d.dom||typeof d=="string"){d=c(d);e.dom.parentNode.insertBefore(d,e.dom)}else{d=b.insertBefore(e.dom,d)}delete Ext.elCache[e.id];Ext.removeNode(e.dom);e.id=Ext.id(e.dom=d);Ext.Element.addToCache(e.isFlyweight?new Ext.Element(e.dom):e);return e},createChild:function(e,d,g){e=e||{tag:"div"};return d?b.insertBefore(d,e,g!==true):b[!this.dom.firstChild?"overwrite":"append"](this.dom,e,g!==true)},wrap:function(d,e){var g=b.insertBefore(this.dom,d||{tag:"div"},!e);g.dom?g.dom.appendChild(this.dom):g.appendChild(this.dom);return g},insertHtml:function(e,g,d){var h=b.insertHtml(e,this.dom,g);return d?Ext.get(h):h}}}());Ext.Element.addMethods(function(){var A=Ext.supports,h={},x=/(-[a-z])/gi,s=document.defaultView,D=/alpha\(opacity=(.*)\)/i,l=/^\s+|\s+$/g,B=Ext.Element,u=/\s+/,b=/\w/g,d="padding",c="margin",y="border",t="-left",q="-right",w="-top",o="-bottom",j="-width",r=Math,z="hidden",e="isClipped",k="overflow",n="overflow-x",m="overflow-y",C="originalClip",i={l:y+t+j,r:y+q+j,t:y+w+j,b:y+o+j},g={l:d+t,r:d+q,t:d+w,b:d+o},a={l:c+t,r:c+q,t:c+w,b:c+o},E=Ext.Element.data;function p(F,G){return G.charAt(1).toUpperCase()}function v(F){return h[F]||(h[F]=F=="float"?(A.cssFloat?"cssFloat":"styleFloat"):F.replace(x,p))}return{adjustWidth:function(F){var G=this;var H=(typeof F=="number");if(H&&G.autoBoxAdjust&&!G.isBorderBox()){F-=(G.getBorderWidth("lr")+G.getPadding("lr"))}return(H&&F<0)?0:F},adjustHeight:function(F){var G=this;var H=(typeof F=="number");if(H&&G.autoBoxAdjust&&!G.isBorderBox()){F-=(G.getBorderWidth("tb")+G.getPadding("tb"))}return(H&&F<0)?0:F},addClass:function(J){var K=this,I,F,H,G=[];if(!Ext.isArray(J)){if(typeof J=="string"&&!this.hasClass(J)){K.dom.className+=" "+J}}else{for(I=0,F=J.length;I5?H.toLowerCase():G)},setStyle:function(I,H){var F,G;if(typeof I!="object"){F={};F[I]=H;I=F}for(G in I){H=I[G];G=="opacity"?this.setOpacity(H):this.dom.style[v(G)]=H}return this},setOpacity:function(G,F){var J=this,H=J.dom.style;if(!F||!J.anim){if(Ext.isIE){var I=G<1?"alpha(opacity="+G*100+")":"",K=H.filter.replace(D,"").replace(l,"");H.zoom=1;H.filter=K+(K.length>0?" ":"")+I}else{H.opacity=G}}else{J.anim({opacity:{to:G}},J.preanim(arguments,1),null,0.35,"easeIn")}return J},clearOpacity:function(){var F=this.dom.style;if(Ext.isIE){if(!Ext.isEmpty(F.filter)){F.filter=F.filter.replace(D,"").replace(l,"")}}else{F.opacity=F["-moz-opacity"]=F["-khtml-opacity"]=""}return this},getHeight:function(H){var G=this,J=G.dom,I=Ext.isIE&&G.isStyle("display","none"),F=r.max(J.offsetHeight,I?0:J.clientHeight)||0;F=!H?F:F-G.getBorderWidth("tb")-G.getPadding("tb");return F<0?0:F},getWidth:function(G){var H=this,J=H.dom,I=Ext.isIE&&H.isStyle("display","none"),F=r.max(J.offsetWidth,I?0:J.clientWidth)||0;F=!G?F:F-H.getBorderWidth("lr")-H.getPadding("lr");return F<0?0:F},setWidth:function(G,F){var H=this;G=H.adjustWidth(G);!F||!H.anim?H.dom.style.width=H.addUnits(G):H.anim({width:{to:G}},H.preanim(arguments,1));return H},setHeight:function(F,G){var H=this;F=H.adjustHeight(F);!G||!H.anim?H.dom.style.height=H.addUnits(F):H.anim({height:{to:F}},H.preanim(arguments,1));return H},getBorderWidth:function(F){return this.addStyles(F,i)},getPadding:function(F){return this.addStyles(F,g)},clip:function(){var F=this,G=F.dom;if(!E(G,e)){E(G,e,true);E(G,C,{o:F.getStyle(k),x:F.getStyle(n),y:F.getStyle(m)});F.setStyle(k,z);F.setStyle(n,z);F.setStyle(m,z)}return F},unclip:function(){var F=this,H=F.dom;if(E(H,e)){E(H,e,false);var G=E(H,C);if(G.o){F.setStyle(k,G.o)}if(G.x){F.setStyle(n,G.x)}if(G.y){F.setStyle(m,G.y)}}return F},addStyles:function(M,L){var J=0,K=M.match(b),I,H,G,F=K.length;for(G=0;Ga.clientHeight||a.scrollWidth>a.clientWidth},scrollTo:function(a,b){this.dom["scroll"+(/top/i.test(a)?"Top":"Left")]=b;return this},getScroll:function(){var i=this.dom,h=document,a=h.body,c=h.documentElement,b,g,e;if(i==h||i==a){if(Ext.isIE&&Ext.isStrict){b=c.scrollLeft;g=c.scrollTop}else{b=window.pageXOffset;g=window.pageYOffset}e={left:b||(a?a.scrollLeft:0),top:g||(a?a.scrollTop:0)}}else{e={left:i.scrollLeft,top:i.scrollTop}}return e}});Ext.Element.VISIBILITY=1;Ext.Element.DISPLAY=2;Ext.Element.OFFSETS=3;Ext.Element.ASCLASS=4;Ext.Element.visibilityCls="x-hide-nosize";Ext.Element.addMethods(function(){var e=Ext.Element,p="opacity",j="visibility",g="display",d="hidden",n="offsets",k="asclass",m="none",a="nosize",b="originalDisplay",c="visibilityMode",h="isVisible",i=e.data,l=function(r){var q=i(r,b);if(q===undefined){i(r,b,q="")}return q},o=function(r){var q=i(r,c);if(q===undefined){i(r,c,q=1)}return q};return{originalDisplay:"",visibilityMode:1,setVisibilityMode:function(q){i(this.dom,c,q);return this},animate:function(r,t,s,u,q){this.anim(r,{duration:t,callback:s,easing:u},q);return this},anim:function(t,u,r,w,s,q){r=r||"run";u=u||{};var v=this,x=Ext.lib.Anim[r](v.dom,t,(u.duration||w)||0.35,(u.easing||s)||"easeOut",function(){if(q){q.call(v)}if(u.callback){u.callback.call(u.scope||v,v,u)}},v);u.anim=x;return x},preanim:function(q,r){return !q[r]?false:(typeof q[r]=="object"?q[r]:{duration:q[r+1],callback:q[r+2],easing:q[r+3]})},isVisible:function(){var q=this,s=q.dom,r=i(s,h);if(typeof r=="boolean"){return r}r=!q.isStyle(j,d)&&!q.isStyle(g,m)&&!((o(s)==e.ASCLASS)&&q.hasClass(q.visibilityCls||e.visibilityCls));i(s,h,r);return r},setVisible:function(t,q){var w=this,r,y,x,v,u=w.dom,s=o(u);if(typeof q=="string"){switch(q){case g:s=e.DISPLAY;break;case j:s=e.VISIBILITY;break;case n:s=e.OFFSETS;break;case a:case k:s=e.ASCLASS;break}w.setVisibilityMode(s);q=false}if(!q||!w.anim){if(s==e.ASCLASS){w[t?"removeClass":"addClass"](w.visibilityCls||e.visibilityCls)}else{if(s==e.DISPLAY){return w.setDisplayed(t)}else{if(s==e.OFFSETS){if(!t){w.hideModeStyles={position:w.getStyle("position"),top:w.getStyle("top"),left:w.getStyle("left")};w.applyStyles({position:"absolute",top:"-10000px",left:"-10000px"})}else{w.applyStyles(w.hideModeStyles||{position:"",top:"",left:""});delete w.hideModeStyles}}else{w.fixDisplay();u.style.visibility=t?"visible":d}}}}else{if(t){w.setOpacity(0.01);w.setVisible(true)}w.anim({opacity:{to:(t?1:0)}},w.preanim(arguments,1),null,0.35,"easeIn",function(){t||w.setVisible(false).setOpacity(1)})}i(u,h,t);return w},hasMetrics:function(){var q=this.dom;return this.isVisible()||(o(q)==e.VISIBILITY)},toggle:function(q){var r=this;r.setVisible(!r.isVisible(),r.preanim(arguments,0));return r},setDisplayed:function(q){if(typeof q=="boolean"){q=q?l(this.dom):m}this.setStyle(g,q);return this},fixDisplay:function(){var q=this;if(q.isStyle(g,m)){q.setStyle(j,d);q.setStyle(g,l(this.dom));if(q.isStyle(g,m)){q.setStyle(g,"block")}}},hide:function(q){if(typeof q=="string"){this.setVisible(false,q);return this}this.setVisible(false,this.preanim(arguments,0));return this},show:function(q){if(typeof q=="string"){this.setVisible(true,q);return this}this.setVisible(true,this.preanim(arguments,0));return this}}}());(function(){var y=null,A=undefined,k=true,t=false,j="setX",h="setY",a="setXY",n="left",l="bottom",s="top",m="right",q="height",g="width",i="points",w="hidden",z="absolute",u="visible",e="motion",o="position",r="easeOut",d=new Ext.Element.Flyweight(),v={},x=function(B){return B||{}},p=function(B){d.dom=B;d.id=Ext.id(B);return d},c=function(B){if(!v[B]){v[B]=[]}return v[B]},b=function(C,B){v[C]=B};Ext.enableFx=k;Ext.Fx={switchStatements:function(C,D,B){return D.apply(this,B[C])},slideIn:function(H,E){E=x(E);var J=this,G=J.dom,M=G.style,O,B,L,D,C,M,I,N,K,F;H=H||"t";J.queueFx(E,function(){O=p(G).getXY();p(G).fixDisplay();B=p(G).getFxRestore();L={x:O[0],y:O[1],0:O[0],1:O[1],width:G.offsetWidth,height:G.offsetHeight};L.right=L.x+L.width;L.bottom=L.y+L.height;p(G).setWidth(L.width).setHeight(L.height);D=p(G).fxWrap(B.pos,E,w);M.visibility=u;M.position=z;function P(){p(G).fxUnwrap(D,B.pos,E);M.width=B.width;M.height=B.height;p(G).afterFx(E)}N={to:[L.x,L.y]};K={to:L.width};F={to:L.height};function Q(U,R,V,S,X,Z,ac,ab,aa,W,T){var Y={};p(U).setWidth(V).setHeight(S);if(p(U)[X]){p(U)[X](Z)}R[ac]=R[ab]="0";if(aa){Y.width=aa}if(W){Y.height=W}if(T){Y.points=T}return Y}I=p(G).switchStatements(H.toLowerCase(),Q,{t:[D,M,L.width,0,y,y,n,l,y,F,y],l:[D,M,0,L.height,y,y,m,s,K,y,y],r:[D,M,L.width,L.height,j,L.right,n,s,y,y,N],b:[D,M,L.width,L.height,h,L.bottom,n,s,y,F,N],tl:[D,M,0,0,y,y,m,l,K,F,N],bl:[D,M,0,0,h,L.y+L.height,m,s,K,F,N],br:[D,M,0,0,a,[L.right,L.bottom],n,s,K,F,N],tr:[D,M,0,0,j,L.x+L.width,n,l,K,F,N]});M.visibility=u;p(D).show();arguments.callee.anim=p(D).fxanim(I,E,e,0.5,r,P)});return J},slideOut:function(F,D){D=x(D);var H=this,E=H.dom,K=E.style,L=H.getXY(),C,B,I,J,G={to:0};F=F||"t";H.queueFx(D,function(){B=p(E).getFxRestore();I={x:L[0],y:L[1],0:L[0],1:L[1],width:E.offsetWidth,height:E.offsetHeight};I.right=I.x+I.width;I.bottom=I.y+I.height;p(E).setWidth(I.width).setHeight(I.height);C=p(E).fxWrap(B.pos,D,u);K.visibility=u;K.position=z;p(C).setWidth(I.width).setHeight(I.height);function M(){D.useDisplay?p(E).setDisplayed(t):p(E).hide();p(E).fxUnwrap(C,B.pos,D);K.width=B.width;K.height=B.height;p(E).afterFx(D)}function N(O,W,U,X,S,V,R,T,Q){var P={};O[W]=O[U]="0";P[X]=S;if(V){P[V]=R}if(T){P[T]=Q}return P}J=p(E).switchStatements(F.toLowerCase(),N,{t:[K,n,l,q,G],l:[K,m,s,g,G],r:[K,n,s,g,G,i,{to:[I.right,I.y]}],b:[K,n,s,q,G,i,{to:[I.x,I.bottom]}],tl:[K,m,l,g,G,q,G],bl:[K,m,s,g,G,q,G,i,{to:[I.x,I.bottom]}],br:[K,n,s,g,G,q,G,i,{to:[I.x+I.width,I.bottom]}],tr:[K,n,l,g,G,q,G,i,{to:[I.right,I.y]}]});arguments.callee.anim=p(C).fxanim(J,D,e,0.5,r,M)});return H},puff:function(H){H=x(H);var F=this,G=F.dom,C=G.style,D,B,E;F.queueFx(H,function(){D=p(G).getWidth();B=p(G).getHeight();p(G).clearOpacity();p(G).show();E=p(G).getFxRestore();function I(){H.useDisplay?p(G).setDisplayed(t):p(G).hide();p(G).clearOpacity();p(G).setPositioning(E.pos);C.width=E.width;C.height=E.height;C.fontSize="";p(G).afterFx(H)}arguments.callee.anim=p(G).fxanim({width:{to:p(G).adjustWidth(D*2)},height:{to:p(G).adjustHeight(B*2)},points:{by:[-D*0.5,-B*0.5]},opacity:{to:0},fontSize:{to:200,unit:"%"}},H,e,0.5,r,I)});return F},switchOff:function(F){F=x(F);var D=this,E=D.dom,B=E.style,C;D.queueFx(F,function(){p(E).clearOpacity();p(E).clip();C=p(E).getFxRestore();function G(){F.useDisplay?p(E).setDisplayed(t):p(E).hide();p(E).clearOpacity();p(E).setPositioning(C.pos);B.width=C.width;B.height=C.height;p(E).afterFx(F)}p(E).fxanim({opacity:{to:0.3}},y,y,0.1,y,function(){p(E).clearOpacity();(function(){p(E).fxanim({height:{to:1},points:{by:[0,p(E).getHeight()*0.5]}},F,e,0.3,"easeIn",G)}).defer(100)})});return D},highlight:function(D,H){H=x(H);var F=this,G=F.dom,B=H.attr||"backgroundColor",C={},E;F.queueFx(H,function(){p(G).clearOpacity();p(G).show();function I(){G.style[B]=E;p(G).afterFx(H)}E=G.style[B];C[B]={from:D||"ffff9c",to:H.endColor||p(G).getColor(B)||"ffffff"};arguments.callee.anim=p(G).fxanim(C,H,"color",1,"easeIn",I)});return F},frame:function(B,E,H){H=x(H);var D=this,G=D.dom,C,F;D.queueFx(H,function(){B=B||"#C3DAF9";if(B.length==6){B="#"+B}E=E||1;p(G).show();var L=p(G).getXY(),J={x:L[0],y:L[1],0:L[0],1:L[1],width:G.offsetWidth,height:G.offsetHeight},I=function(){C=p(document.body||document.documentElement).createChild({style:{position:z,"z-index":35000,border:"0px solid "+B}});return C.queueFx({},K)};arguments.callee.anim={isAnimated:true,stop:function(){E=0;C.stopFx()}};function K(){var M=Ext.isBorderBox?2:1;F=C.anim({top:{from:J.y,to:J.y-20},left:{from:J.x,to:J.x-20},borderWidth:{from:0,to:10},opacity:{from:1,to:0},height:{from:J.height,to:J.height+20*M},width:{from:J.width,to:J.width+20*M}},{duration:H.duration||1,callback:function(){C.remove();--E>0?I():p(G).afterFx(H)}});arguments.callee.anim={isAnimated:true,stop:function(){F.stop()}}}I()});return D},pause:function(D){var C=this.dom,B;this.queueFx({},function(){B=setTimeout(function(){p(C).afterFx({})},D*1000);arguments.callee.anim={isAnimated:true,stop:function(){clearTimeout(B);p(C).afterFx({})}}});return this},fadeIn:function(D){D=x(D);var B=this,C=B.dom,E=D.endOpacity||1;B.queueFx(D,function(){p(C).setOpacity(0);p(C).fixDisplay();C.style.visibility=u;arguments.callee.anim=p(C).fxanim({opacity:{to:E}},D,y,0.5,r,function(){if(E==1){p(C).clearOpacity()}p(C).afterFx(D)})});return B},fadeOut:function(E){E=x(E);var C=this,D=C.dom,B=D.style,F=E.endOpacity||0;C.queueFx(E,function(){arguments.callee.anim=p(D).fxanim({opacity:{to:F}},E,y,0.5,r,function(){if(F==0){Ext.Element.data(D,"visibilityMode")==Ext.Element.DISPLAY||E.useDisplay?B.display="none":B.visibility=w;p(D).clearOpacity()}p(D).afterFx(E)})});return C},scale:function(B,C,D){this.shift(Ext.apply({},D,{width:B,height:C}));return this},shift:function(D){D=x(D);var C=this.dom,B={};this.queueFx(D,function(){for(var E in D){if(D[E]!=A){B[E]={to:D[E]}}}B.width?B.width.to=p(C).adjustWidth(D.width):B;B.height?B.height.to=p(C).adjustWidth(D.height):B;if(B.x||B.y||B.xy){B.points=B.xy||{to:[B.x?B.x.to:p(C).getX(),B.y?B.y.to:p(C).getY()]}}arguments.callee.anim=p(C).fxanim(B,D,e,0.35,r,function(){p(C).afterFx(D)})});return this},ghost:function(E,C){C=x(C);var G=this,D=G.dom,J=D.style,H={opacity:{to:0},points:{}},K=H.points,B,I,F;E=E||"b";G.queueFx(C,function(){B=p(D).getFxRestore();I=p(D).getWidth();F=p(D).getHeight();function L(){C.useDisplay?p(D).setDisplayed(t):p(D).hide();p(D).clearOpacity();p(D).setPositioning(B.pos);J.width=B.width;J.height=B.height;p(D).afterFx(C)}K.by=p(D).switchStatements(E.toLowerCase(),function(N,M){return[N,M]},{t:[0,-F],l:[-I,0],r:[I,0],b:[0,F],tl:[-I,-F],bl:[-I,F],br:[I,F],tr:[I,-F]});arguments.callee.anim=p(D).fxanim(H,C,e,0.5,r,L)});return G},syncFx:function(){var B=this;B.fxDefaults=Ext.apply(B.fxDefaults||{},{block:t,concurrent:k,stopFx:t});return B},sequenceFx:function(){var B=this;B.fxDefaults=Ext.apply(B.fxDefaults||{},{block:t,concurrent:t,stopFx:t});return B},nextFx:function(){var B=c(this.dom.id)[0];if(B){B.call(this)}},hasActiveFx:function(){return c(this.dom.id)[0]},stopFx:function(B){var C=this,E=C.dom.id;if(C.hasActiveFx()){var D=c(E)[0];if(D&&D.anim){if(D.anim.isAnimated){b(E,[D]);D.anim.stop(B!==undefined?B:k)}else{b(E,[])}}}return C},beforeFx:function(B){if(this.hasActiveFx()&&!B.concurrent){if(B.stopFx){this.stopFx();return k}return t}return k},hasFxBlock:function(){var B=c(this.dom.id);return B&&B[0]&&B[0].block},queueFx:function(E,B){var C=p(this.dom);if(!C.hasFxBlock()){Ext.applyIf(E,C.fxDefaults);if(!E.concurrent){var D=C.beforeFx(E);B.block=E.block;c(C.dom.id).push(B);if(D){C.nextFx()}}else{B.call(C)}}return C},fxWrap:function(H,F,D){var E=this.dom,C,B;if(!F.wrap||!(C=Ext.getDom(F.wrap))){if(F.fixPosition){B=p(E).getXY()}var G=document.createElement("div");G.style.visibility=D;C=E.parentNode.insertBefore(G,E);p(C).setPositioning(H);if(p(C).isStyle(o,"static")){p(C).position("relative")}p(E).clearPositioning("auto");p(C).clip();C.appendChild(E);if(B){p(C).setXY(B)}}return C},fxUnwrap:function(C,F,E){var D=this.dom;p(D).clearPositioning();p(D).setPositioning(F);if(!E.wrap){var B=p(C).dom.parentNode;B.insertBefore(D,C);p(C).remove()}},getFxRestore:function(){var B=this.dom.style;return{pos:this.getPositioning(),width:B.width,height:B.height}},afterFx:function(C){var B=this.dom,D=B.id;if(C.afterStyle){p(B).setStyle(C.afterStyle)}if(C.afterCls){p(B).addClass(C.afterCls)}if(C.remove==k){p(B).remove()}if(C.callback){C.callback.call(C.scope,p(B))}if(!C.concurrent){c(D).shift();p(B).nextFx()}},fxanim:function(E,F,C,G,D,B){C=C||"run";F=F||{};var H=Ext.lib.Anim[C](this.dom,E,(F.duration||G)||0.35,(F.easing||D)||r,B,this);F.anim=H;return H}};Ext.Fx.resize=Ext.Fx.scale;Ext.Element.addMethods(Ext.Fx)})();Ext.CompositeElementLite=function(b,a){this.elements=[];this.add(b,a);this.el=new Ext.Element.Flyweight()};Ext.CompositeElementLite.prototype={isComposite:true,getElement:function(a){var b=this.el;b.dom=a;b.id=a.id;return b},transformElement:function(a){return Ext.getDom(a)},getCount:function(){return this.elements.length},add:function(d,b){var e=this,g=e.elements;if(!d){return this}if(typeof d=="string"){d=Ext.Element.selectorFunction(d,b)}else{if(d.isComposite){d=d.elements}else{if(!Ext.isIterable(d)){d=[d]}}}for(var c=0,a=d.length;c-1){c=Ext.getDom(c);if(a){g=this.elements[b];g.parentNode.insertBefore(c,g);Ext.removeNode(g)}this.elements.splice(b,1,c)}return this},clear:function(){this.elements=[]}};Ext.CompositeElementLite.prototype.on=Ext.CompositeElementLite.prototype.addListener;Ext.CompositeElementLite.importElementMethods=function(){var c,b=Ext.Element.prototype,a=Ext.CompositeElementLite.prototype;for(c in b){if(typeof b[c]=="function"){(function(d){a[d]=a[d]||function(){return this.invoke(d,arguments)}}).call(a,c)}}};Ext.CompositeElementLite.importElementMethods();if(Ext.DomQuery){Ext.Element.selectorFunction=Ext.DomQuery.select}Ext.Element.select=function(a,b){var c;if(typeof a=="string"){c=Ext.Element.selectorFunction(a,b)}else{if(a.length!==undefined){c=a}else{throw"Invalid selector"}}return new Ext.CompositeElementLite(c)};Ext.select=Ext.Element.select;(function(){var b="beforerequest",e="requestcomplete",d="requestexception",h=undefined,c="load",i="POST",a="GET",g=window;Ext.data.Connection=function(j){Ext.apply(this,j);this.addEvents(b,e,d);Ext.data.Connection.superclass.constructor.call(this)};Ext.extend(Ext.data.Connection,Ext.util.Observable,{timeout:30000,autoAbort:false,disableCaching:true,disableCachingParam:"_dc",request:function(n){var s=this;if(s.fireEvent(b,s,n)){if(n.el){if(!Ext.isEmpty(n.indicatorText)){s.indicatorText='
    '+n.indicatorText+"
    "}if(s.indicatorText){Ext.getDom(n.el).innerHTML=s.indicatorText}n.success=(Ext.isFunction(n.success)?n.success:function(){}).createInterceptor(function(o){Ext.getDom(n.el).innerHTML=o.responseText})}var l=n.params,k=n.url||s.url,j,q={success:s.handleResponse,failure:s.handleFailure,scope:s,argument:{options:n},timeout:Ext.num(n.timeout,s.timeout)},m,t;if(Ext.isFunction(l)){l=l.call(n.scope||g,n)}l=Ext.urlEncode(s.extraParams,Ext.isObject(l)?Ext.urlEncode(l):l);if(Ext.isFunction(k)){k=k.call(n.scope||g,n)}if((m=Ext.getDom(n.form))){k=k||m.action;if(n.isUpload||(/multipart\/form-data/i.test(m.getAttribute("enctype")))){return s.doFormUpload.call(s,n,l,k)}t=Ext.lib.Ajax.serializeForm(m);l=l?(l+"&"+t):t}j=n.method||s.method||((l||n.xmlData||n.jsonData)?i:a);if(j===a&&(s.disableCaching&&n.disableCaching!==false)||n.disableCaching===true){var r=n.disableCachingParam||s.disableCachingParam;k=Ext.urlAppend(k,r+"="+(new Date().getTime()))}n.headers=Ext.applyIf(n.headers||{},s.defaultHeaders||{});if(n.autoAbort===true||s.autoAbort){s.abort()}if((j==a||n.xmlData||n.jsonData)&&l){k=Ext.urlAppend(k,l);l=""}return(s.transId=Ext.lib.Ajax.request(j,k,q,l,n))}else{return n.callback?n.callback.apply(n.scope,[n,h,h]):null}},isLoading:function(j){return j?Ext.lib.Ajax.isCallInProgress(j):!!this.transId},abort:function(j){if(j||this.isLoading()){Ext.lib.Ajax.abort(j||this.transId)}},handleResponse:function(j){this.transId=false;var k=j.argument.options;j.argument=k?k.argument:null;this.fireEvent(e,this,j,k);if(k.success){k.success.call(k.scope,j,k)}if(k.callback){k.callback.call(k.scope,k,true,j)}},handleFailure:function(j,l){this.transId=false;var k=j.argument.options;j.argument=k?k.argument:null;this.fireEvent(d,this,j,k,l);if(k.failure){k.failure.call(k.scope,j,k)}if(k.callback){k.callback.call(k.scope,k,false,j)}},doFormUpload:function(q,j,k){var l=Ext.id(),v=document,r=v.createElement("iframe"),m=Ext.getDom(q.form),u=[],t,p="multipart/form-data",n={target:m.target,method:m.method,encoding:m.encoding,enctype:m.enctype,action:m.action};Ext.fly(r).set({id:l,name:l,cls:"x-hidden",src:Ext.SSL_SECURE_URL});v.body.appendChild(r);if(Ext.isIE){document.frames[l].name=l}Ext.fly(m).set({target:l,method:i,enctype:p,encoding:p,action:k||n.action});Ext.iterate(Ext.urlDecode(j,false),function(w,o){t=v.createElement("input");Ext.fly(t).set({type:"hidden",value:o,name:w});m.appendChild(t);u.push(t)});function s(){var x=this,w={responseText:"",responseXML:null,argument:q.argument},A,z;try{A=r.contentWindow.document||r.contentDocument||g.frames[l].document;if(A){if(A.body){if(/textarea/i.test((z=A.body.firstChild||{}).tagName)){w.responseText=z.value}else{w.responseText=A.body.innerHTML}}w.responseXML=A.XMLDocument||A}}catch(y){}Ext.EventManager.removeListener(r,c,s,x);x.fireEvent(e,x,w,q);function o(D,C,B){if(Ext.isFunction(D)){D.apply(C,B)}}o(q.success,q.scope,[w,q]);o(q.callback,q.scope,[q,true,w]);if(!x.debugUploads){setTimeout(function(){Ext.removeNode(r)},100)}}Ext.EventManager.on(r,c,s,this);m.submit();Ext.fly(m).set(n);Ext.each(u,function(o){Ext.removeNode(o)})}})})();Ext.Ajax=new Ext.data.Connection({autoAbort:false,serializeForm:function(a){return Ext.lib.Ajax.serializeForm(a)}});Ext.util.JSON=new (function(){var useHasOwn=!!{}.hasOwnProperty,isNative=function(){var useNative=null;return function(){if(useNative===null){useNative=Ext.USE_NATIVE_JSON&&window.JSON&&JSON.toString()=="[object JSON]"}return useNative}}(),pad=function(n){return n<10?"0"+n:n},doDecode=function(json){return json?eval("("+json+")"):""},doEncode=function(o){if(!Ext.isDefined(o)||o===null){return"null"}else{if(Ext.isArray(o)){return encodeArray(o)}else{if(Ext.isDate(o)){return Ext.util.JSON.encodeDate(o)}else{if(Ext.isString(o)){return encodeString(o)}else{if(typeof o=="number"){return isFinite(o)?String(o):"null"}else{if(Ext.isBoolean(o)){return String(o)}else{var a=["{"],b,i,v;for(i in o){if(!o.getElementsByTagName){if(!useHasOwn||o.hasOwnProperty(i)){v=o[i];switch(typeof v){case"undefined":case"function":case"unknown":break;default:if(b){a.push(",")}a.push(doEncode(i),":",v===null?"null":doEncode(v));b=true}}}}a.push("}");return a.join("")}}}}}}},m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},encodeString=function(s){if(/["\\\x00-\x1f]/.test(s)){return'"'+s.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c}c=b.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"'}return'"'+s+'"'},encodeArray=function(o){var a=["["],b,i,l=o.length,v;for(i=0;i
    ';e.body.appendChild(g);d=g.lastChild;if((c=e.defaultView)){if(c.getComputedStyle(g.firstChild.firstChild,null).marginRight!="0px"){b.correctRightMargin=false}if(c.getComputedStyle(d,null).backgroundColor!="transparent"){b.correctTransparentColor=false}}b.cssFloat=!!d.style.cssFloat;e.body.removeChild(g)};if(Ext.isReady){a()}else{Ext.onReady(a)}})();Ext.EventObject=function(){var b=Ext.lib.Event,c=/(dbl)?click/,a={3:13,63234:37,63235:39,63232:38,63233:40,63276:33,63277:34,63272:46,63273:36,63275:35},d=Ext.isIE?{1:0,4:1,2:2}:{0:0,1:1,2:2};Ext.EventObjectImpl=function(g){if(g){this.setEvent(g.browserEvent||g)}};Ext.EventObjectImpl.prototype={setEvent:function(h){var g=this;if(h==g||(h&&h.browserEvent)){return h}g.browserEvent=h;if(h){g.button=h.button?d[h.button]:(h.which?h.which-1:-1);if(c.test(h.type)&&g.button==-1){g.button=0}g.type=h.type;g.shiftKey=h.shiftKey;g.ctrlKey=h.ctrlKey||h.metaKey||false;g.altKey=h.altKey;g.keyCode=h.keyCode;g.charCode=h.charCode;g.target=b.getTarget(h);g.xy=b.getXY(h)}else{g.button=-1;g.shiftKey=false;g.ctrlKey=false;g.altKey=false;g.keyCode=0;g.charCode=0;g.target=null;g.xy=[0,0]}return g},stopEvent:function(){var e=this;if(e.browserEvent){if(e.browserEvent.type=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.fire(e)}b.stopEvent(e.browserEvent)}},preventDefault:function(){if(this.browserEvent){b.preventDefault(this.browserEvent)}},stopPropagation:function(){var e=this;if(e.browserEvent){if(e.browserEvent.type=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.fire(e)}b.stopPropagation(e.browserEvent)}},getCharCode:function(){return this.charCode||this.keyCode},getKey:function(){return this.normalizeKey(this.keyCode||this.charCode)},normalizeKey:function(e){return Ext.isSafari?(a[e]||e):e},getPageX:function(){return this.xy[0]},getPageY:function(){return this.xy[1]},getXY:function(){return this.xy},getTarget:function(g,h,e){return g?Ext.fly(this.target).findParent(g,h,e):(e?Ext.get(this.target):this.target)},getRelatedTarget:function(){return this.browserEvent?b.getRelatedTarget(this.browserEvent):null},getWheelDelta:function(){var g=this.browserEvent;var h=0;if(g.wheelDelta){h=g.wheelDelta/120}else{if(g.detail){h=-g.detail/3}}return h},within:function(h,i,e){if(h){var g=this[i?"getRelatedTarget":"getTarget"]();return g&&((e?(g==Ext.getDom(h)):false)||Ext.fly(h).contains(g))}return false}};return new Ext.EventObjectImpl()}();Ext.Loader=Ext.apply({},{load:function(j,i,k,c){var k=k||this,g=document.getElementsByTagName("head")[0],b=document.createDocumentFragment(),a=j.length,h=0,e=this;var l=function(m){g.appendChild(e.buildScriptTag(j[m],d))};var d=function(){h++;if(a==h&&typeof i=="function"){i.call(k)}else{if(c===true){l(h)}}};if(c===true){l.call(this,0)}else{Ext.each(j,function(n,m){b.appendChild(this.buildScriptTag(n,d))},this);g.appendChild(b)}},buildScriptTag:function(b,c){var a=document.createElement("script");a.type="text/javascript";a.src=b;if(a.readyState){a.onreadystatechange=function(){if(a.readyState=="loaded"||a.readyState=="complete"){a.onreadystatechange=null;c()}}}else{a.onload=c}return a}});Ext.ns("Ext.grid","Ext.list","Ext.dd","Ext.tree","Ext.form","Ext.menu","Ext.state","Ext.layout.boxOverflow","Ext.app","Ext.ux","Ext.chart","Ext.direct","Ext.slider");Ext.apply(Ext,function(){var c=Ext,a=0,b=null;return{emptyFn:function(){},BLANK_IMAGE_URL:Ext.isIE6||Ext.isIE7||Ext.isAir?"http://www.extjs.com/s.gif":"data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",extendX:function(d,e){return Ext.extend(d,e(d.prototype))},getDoc:function(){return Ext.get(document)},num:function(e,d){e=Number(Ext.isEmpty(e)||Ext.isArray(e)||typeof e=="boolean"||(typeof e=="string"&&e.trim().length==0)?NaN:e);return isNaN(e)?d:e},value:function(g,d,e){return Ext.isEmpty(g,e)?d:g},escapeRe:function(d){return d.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")},sequence:function(h,d,g,e){h[d]=h[d].createSequence(g,e)},addBehaviors:function(i){if(!Ext.isReady){Ext.onReady(function(){Ext.addBehaviors(i)})}else{var e={},h,d,g;for(d in i){if((h=d.split("@"))[1]){g=h[0];if(!e[g]){e[g]=Ext.select(g)}e[g].on(h[1],i[d])}}e=null}},getScrollBarWidth:function(g){if(!Ext.isReady){return 0}if(g===true||b===null){var i=Ext.getBody().createChild('
    '),h=i.child("div",true);var e=h.offsetWidth;i.setStyle("overflow",(Ext.isWebKit||Ext.isGecko)?"auto":"scroll");var d=h.offsetWidth;i.remove();b=e-d+2}return b},combine:function(){var g=arguments,e=g.length,j=[];for(var h=0;hh?1:-1};Ext.each(d,function(h){g=e(g,h)==1?g:h});return g},mean:function(d){return d.length>0?Ext.sum(d)/d.length:undefined},sum:function(d){var e=0;Ext.each(d,function(g){e+=g});return e},partition:function(d,e){var g=[[],[]];Ext.each(d,function(j,k,h){g[(e&&e(j,k,h))||(!e&&j)?0:1].push(j)});return g},invoke:function(d,e){var h=[],g=Array.prototype.slice.call(arguments,2);Ext.each(d,function(j,k){if(j&&typeof j[e]=="function"){h.push(j[e].apply(j,g))}else{h.push(undefined)}});return h},pluck:function(d,g){var e=[];Ext.each(d,function(h){e.push(h[g])});return e},zip:function(){var n=Ext.partition(arguments,function(i){return typeof i!="function"}),k=n[0],m=n[1][0],d=Ext.max(Ext.pluck(k,"length")),h=[];for(var l=0;l=a.left&&b.right<=a.right&&b.top>=a.top&&b.bottom<=a.bottom)},getArea:function(){var a=this;return((a.bottom-a.top)*(a.right-a.left))},intersect:function(h){var g=this,d=Math.max(g.top,h.top),e=Math.min(g.right,h.right),a=Math.min(g.bottom,h.bottom),c=Math.max(g.left,h.left);if(a>=d&&e>=c){return new Ext.lib.Region(d,e,a,c)}},union:function(h){var g=this,d=Math.min(g.top,h.top),e=Math.max(g.right,h.right),a=Math.max(g.bottom,h.bottom),c=Math.min(g.left,h.left);return new Ext.lib.Region(d,e,a,c)},constrainTo:function(b){var a=this;a.top=a.top.constrain(b.top,b.bottom);a.bottom=a.bottom.constrain(b.top,b.bottom);a.left=a.left.constrain(b.left,b.right);a.right=a.right.constrain(b.left,b.right);return a},adjust:function(d,c,a,g){var e=this;e.top+=d;e.left+=c;e.right+=g;e.bottom+=a;return e}};Ext.lib.Region.getRegion=function(e){var h=Ext.lib.Dom.getXY(e),d=h[1],g=h[0]+e.offsetWidth,a=h[1]+e.offsetHeight,c=h[0];return new Ext.lib.Region(d,g,a,c)};Ext.lib.Point=function(a,c){if(Ext.isArray(a)){c=a[1];a=a[0]}var b=this;b.x=b.right=b.left=b[0]=a;b.y=b.top=b.bottom=b[1]=c};Ext.lib.Point.prototype=new Ext.lib.Region();Ext.apply(Ext.DomHelper,function(){var e,a="afterbegin",h="afterend",i="beforebegin",d="beforeend",b=/tag|children|cn|html$/i;function g(m,p,n,q,l,j){m=Ext.getDom(m);var k;if(e.useDom){k=c(p,null);if(j){m.appendChild(k)}else{(l=="firstChild"?m:m.parentNode).insertBefore(k,m[l]||m)}}else{k=Ext.DomHelper.insertHtml(q,m,Ext.DomHelper.createHtml(p))}return n?Ext.get(k,true):k}function c(j,r){var k,u=document,p,s,m,t;if(Ext.isArray(j)){k=u.createDocumentFragment();for(var q=0,n=j.length;q0){return setTimeout(d,c)}d();return 0},createSequence:function(c,b,a){if(!Ext.isFunction(b)){return c}else{return function(){var d=c.apply(this||window,arguments);b.apply(a||this||window,arguments);return d}}}};Ext.defer=Ext.util.Functions.defer;Ext.createInterceptor=Ext.util.Functions.createInterceptor;Ext.createSequence=Ext.util.Functions.createSequence;Ext.createDelegate=Ext.util.Functions.createDelegate;Ext.apply(Ext.util.Observable.prototype,function(){function a(j){var i=(this.methodEvents=this.methodEvents||{})[j],d,c,g,h=this;if(!i){this.methodEvents[j]=i={};i.originalFn=this[j];i.methodName=j;i.before=[];i.after=[];var b=function(l,k,e){if((c=l.apply(k||h,e))!==undefined){if(typeof c=="object"){if(c.returnValue!==undefined){d=c.returnValue}else{d=c}g=!!c.cancel}else{if(c===false){g=true}else{d=c}}}};this[j]=function(){var l=Array.prototype.slice.call(arguments,0),k;d=c=undefined;g=false;for(var m=0,e=i.before.length;m=525:!((Ext.isGecko&&!Ext.isWindows)||Ext.isOpera);return{_unload:function(){Ext.EventManager.un(window,"resize",this.fireWindowResize,this);c.call(Ext.EventManager)},doResizeEvent:function(){var m=a.getViewHeight(),l=a.getViewWidth();if(h!=m||i!=l){d.fire(i=l,h=m)}},onWindowResize:function(n,m,l){if(!d){d=new Ext.util.Event();k=new Ext.util.DelayedTask(this.doResizeEvent);Ext.EventManager.on(window,"resize",this.fireWindowResize,this)}d.addListener(n,m,l)},fireWindowResize:function(){if(d){k.delay(100)}},onTextResize:function(o,n,l){if(!g){g=new Ext.util.Event();var m=new Ext.Element(document.createElement("div"));m.dom.className="x-text-resize";m.dom.innerHTML="X";m.appendTo(document.body);b=m.dom.offsetHeight;setInterval(function(){if(m.dom.offsetHeight!=b){g.fire(b,b=m.dom.offsetHeight)}},this.textResizeInterval)}g.addListener(o,n,l)},removeResizeListener:function(m,l){if(d){d.removeListener(m,l)}},fireResize:function(){if(d){d.fire(a.getViewWidth(),a.getViewHeight())}},textResizeInterval:50,ieDeferSrc:false,getKeyEvent:function(){return e?"keydown":"keypress"},useKeydown:e}}());Ext.EventManager.on=Ext.EventManager.addListener;Ext.apply(Ext.EventObjectImpl.prototype,{BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,RETURN:13,SHIFT:16,CTRL:17,CONTROL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGEUP:33,PAGE_DOWN:34,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,isNavKeyPress:function(){var b=this,a=this.normalizeKey(b.keyCode);return(a>=33&&a<=40)||a==b.RETURN||a==b.TAB||a==b.ESC},isSpecialKey:function(){var a=this.normalizeKey(this.keyCode);return(this.type=="keypress"&&this.ctrlKey)||this.isNavKeyPress()||(a==this.BACKSPACE)||(a>=16&&a<=20)||(a>=44&&a<=46)},getPoint:function(){return new Ext.lib.Point(this.xy[0],this.xy[1])},hasModifier:function(){return((this.ctrlKey||this.altKey)||this.shiftKey)}});Ext.Element.addMethods({swallowEvent:function(a,b){var d=this;function c(g){g.stopPropagation();if(b){g.preventDefault()}}if(Ext.isArray(a)){Ext.each(a,function(g){d.on(g,c)});return d}d.on(a,c);return d},relayEvent:function(a,b){this.on(a,function(c){b.fireEvent(a,c)})},clean:function(b){var d=this,e=d.dom,g=e.firstChild,c=-1;if(Ext.Element.data(e,"isCleaned")&&b!==true){return d}while(g){var a=g.nextSibling;if(g.nodeType==3&&!(/\S/.test(g.nodeValue))){e.removeChild(g)}else{g.nodeIndex=++c}g=a}Ext.Element.data(e,"isCleaned",true);return d},load:function(){var a=this.getUpdater();a.update.apply(a,arguments);return this},getUpdater:function(){return this.updateManager||(this.updateManager=new Ext.Updater(this))},update:function(html,loadScripts,callback){if(!this.dom){return this}html=html||"";if(loadScripts!==true){this.dom.innerHTML=html;if(typeof callback=="function"){callback()}return this}var id=Ext.id(),dom=this.dom;html+='';Ext.lib.Event.onAvailable(id,function(){var DOC=document,hd=DOC.getElementsByTagName("head")[0],re=/(?:]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig,srcRe=/\ssrc=([\'\"])(.*?)\1/i,typeRe=/\stype=([\'\"])(.*?)\1/i,match,attrs,srcMatch,typeMatch,el,s;while((match=re.exec(html))){attrs=match[1];srcMatch=attrs?attrs.match(srcRe):false;if(srcMatch&&srcMatch[2]){s=DOC.createElement("script");s.src=srcMatch[2];typeMatch=attrs.match(typeRe);if(typeMatch&&typeMatch[2]){s.type=typeMatch[2]}hd.appendChild(s)}else{if(match[2]&&match[2].length>0){if(window.execScript){window.execScript(match[2])}else{window.eval(match[2])}}}}el=DOC.getElementById(id);if(el){Ext.removeNode(el)}if(typeof callback=="function"){callback()}});dom.innerHTML=html.replace(/(?:)((\n|\r|.)*?)(?:<\/script>)/ig,"");return this},removeAllListeners:function(){this.removeAnchor();Ext.EventManager.removeAll(this.dom);return this},createProxy:function(a,e,d){a=(typeof a=="object")?a:{tag:"div",cls:a};var c=this,b=e?Ext.DomHelper.append(e,a,true):Ext.DomHelper.insertBefore(c.dom,a,true);if(d&&c.setBox&&c.getBox){b.setBox(c.getBox())}return b}});Ext.Element.prototype.getUpdateManager=Ext.Element.prototype.getUpdater;Ext.Element.addMethods({getAnchorXY:function(e,l,q){e=(e||"tl").toLowerCase();q=q||{};var k=this,b=k.dom==document.body||k.dom==document,n=q.width||b?Ext.lib.Dom.getViewWidth():k.getWidth(),i=q.height||b?Ext.lib.Dom.getViewHeight():k.getHeight(),p,a=Math.round,c=k.getXY(),m=k.getScroll(),j=b?m.left:!l?c[0]:0,g=b?m.top:!l?c[1]:0,d={c:[a(n*0.5),a(i*0.5)],t:[a(n*0.5),0],l:[0,a(i*0.5)],r:[n,a(i*0.5)],b:[a(n*0.5),i],tl:[0,0],bl:[0,i],br:[n,i],tr:[n,0]};p=d[e];return[p[0]+j,p[1]+g]},anchorTo:function(b,h,c,a,k,l){var i=this,e=i.dom,j=!Ext.isEmpty(k),d=function(){Ext.fly(e).alignTo(b,h,c,a);Ext.callback(l,Ext.fly(e))},g=this.getAnchor();this.removeAnchor();Ext.apply(g,{fn:d,scroll:j});Ext.EventManager.onWindowResize(d,null);if(j){Ext.EventManager.on(window,"scroll",d,null,{buffer:!isNaN(k)?k:50})}d.call(i);return i},removeAnchor:function(){var b=this,a=this.getAnchor();if(a&&a.fn){Ext.EventManager.removeResizeListener(a.fn);if(a.scroll){Ext.EventManager.un(window,"scroll",a.fn)}delete a.fn}return b},getAnchor:function(){var b=Ext.Element.data,c=this.dom;if(!c){return}var a=b(c,"_anchor");if(!a){a=b(c,"_anchor",{})}return a},getAlignToXY:function(g,A,B){g=Ext.get(g);if(!g||!g.dom){throw"Element.alignToXY with an element that doesn't exist"}B=B||[0,0];A=(!A||A=="?"?"tl-bl?":(!(/-/).test(A)&&A!==""?"tl-"+A:A||"tl-bl")).toLowerCase();var K=this,H=K.dom,M,L,n,l,s,F,v,t=Ext.lib.Dom.getViewWidth()-10,G=Ext.lib.Dom.getViewHeight()-10,b,i,j,k,u,z,N=document,J=N.documentElement,q=N.body,E=(J.scrollLeft||q.scrollLeft||0)+5,D=(J.scrollTop||q.scrollTop||0)+5,I=false,e="",a="",C=A.match(/^([a-z]+)-([a-z]+)(\?)?$/);if(!C){throw"Element.alignTo with an invalid alignment "+A}e=C[1];a=C[2];I=!!C[3];M=K.getAnchorXY(e,true);L=g.getAnchorXY(a,false);n=L[0]-M[0]+B[0];l=L[1]-M[1]+B[1];if(I){s=K.getWidth();F=K.getHeight();v=g.getRegion();b=e.charAt(0);i=e.charAt(e.length-1);j=a.charAt(0);k=a.charAt(a.length-1);u=((b=="t"&&j=="b")||(b=="b"&&j=="t"));z=((i=="r"&&k=="l")||(i=="l"&&k=="r"));if(n+s>t+E){n=z?v.left-s:t+E-s}if(nG+D){l=u?v.top-F:G+D-F}if(lB){p=B-q;m=true}if((o+C)>g){o=g-C;m=true}if(p"+String.format(Ext.Element.boxMarkup,c)+"
    "));Ext.DomQuery.selectNode("."+c+"-mc",d.dom).appendChild(this.dom);return d},setSize:function(e,c,d){var g=this;if(typeof e=="object"){c=e.height;e=e.width}e=g.adjustWidth(e);c=g.adjustHeight(c);if(!d||!g.anim){g.dom.style.width=g.addUnits(e);g.dom.style.height=g.addUnits(c)}else{g.anim({width:{to:e},height:{to:c}},g.preanim(arguments,2))}return g},getComputedHeight:function(){var d=this,c=Math.max(d.dom.offsetHeight,d.dom.clientHeight);if(!c){c=parseFloat(d.getStyle("height"))||0;if(!d.isBorderBox()){c+=d.getFrameWidth("tb")}}return c},getComputedWidth:function(){var c=Math.max(this.dom.offsetWidth,this.dom.clientWidth);if(!c){c=parseFloat(this.getStyle("width"))||0;if(!this.isBorderBox()){c+=this.getFrameWidth("lr")}}return c},getFrameWidth:function(d,c){return c&&this.isBorderBox()?0:(this.getPadding(d)+this.getBorderWidth(d))},addClassOnOver:function(c){this.hover(function(){Ext.fly(this,a).addClass(c)},function(){Ext.fly(this,a).removeClass(c)});return this},addClassOnFocus:function(c){this.on("focus",function(){Ext.fly(this,a).addClass(c)},this.dom);this.on("blur",function(){Ext.fly(this,a).removeClass(c)},this.dom);return this},addClassOnClick:function(c){var d=this.dom;this.on("mousedown",function(){Ext.fly(d,a).addClass(c);var g=Ext.getDoc(),e=function(){Ext.fly(d,a).removeClass(c);g.removeListener("mouseup",e)};g.on("mouseup",e)});return this},getViewSize:function(){var g=document,h=this.dom,c=(h==g||h==g.body);if(c){var e=Ext.lib.Dom;return{width:e.getViewWidth(),height:e.getViewHeight()}}else{return{width:h.clientWidth,height:h.clientHeight}}},getStyleSize:function(){var j=this,c,i,l=document,m=this.dom,e=(m==l||m==l.body),g=m.style;if(e){var k=Ext.lib.Dom;return{width:k.getViewWidth(),height:k.getViewHeight()}}if(g.width&&g.width!="auto"){c=parseFloat(g.width);if(j.isBorderBox()){c-=j.getFrameWidth("lr")}}if(g.height&&g.height!="auto"){i=parseFloat(g.height);if(j.isBorderBox()){i-=j.getFrameWidth("tb")}}return{width:c||j.getWidth(true),height:i||j.getHeight(true)}},getSize:function(c){return{width:this.getWidth(c),height:this.getHeight(c)}},repaint:function(){var c=this.dom;this.addClass("x-repaint");setTimeout(function(){Ext.fly(c).removeClass("x-repaint")},1);return this},unselectable:function(){this.dom.unselectable="on";return this.swallowEvent("selectstart",true).applyStyles("-moz-user-select:none;-khtml-user-select:none;").addClass("x-unselectable")},getMargins:function(d){var e=this,c,g={t:"top",l:"left",r:"right",b:"bottom"},h={};if(!d){for(c in e.margins){h[g[c]]=parseFloat(e.getStyle(e.margins[c]))||0}return h}else{return e.addStyles.call(e,d,e.margins)}}}}());Ext.Element.addMethods({setBox:function(e,g,b){var d=this,a=e.width,c=e.height;if((g&&!d.autoBoxAdjust)&&!d.isBorderBox()){a-=(d.getBorderWidth("lr")+d.getPadding("lr"));c-=(d.getBorderWidth("tb")+d.getPadding("tb"))}d.setBounds(e.x,e.y,a,c,d.animTest.call(d,arguments,b,2));return d},getBox:function(j,p){var m=this,v,e,o,d=m.getBorderWidth,q=m.getPadding,g,a,u,n;if(!p){v=m.getXY()}else{e=parseInt(m.getStyle("left"),10)||0;o=parseInt(m.getStyle("top"),10)||0;v=[e,o]}var c=m.dom,s=c.offsetWidth,i=c.offsetHeight,k;if(!j){k={x:v[0],y:v[1],0:v[0],1:v[1],width:s,height:i}}else{g=d.call(m,"l")+q.call(m,"l");a=d.call(m,"r")+q.call(m,"r");u=d.call(m,"t")+q.call(m,"t");n=d.call(m,"b")+q.call(m,"b");k={x:v[0]+g,y:v[1]+u,0:v[0]+g,1:v[1]+u,width:s-(g+a),height:i-(u+n)}}k.right=k.x+k.width;k.bottom=k.y+k.height;return k},move:function(j,b,c){var g=this,m=g.getXY(),k=m[0],i=m[1],d=[k-b,i],l=[k+b,i],h=[k,i-b],a=[k,i+b],e={l:d,left:d,r:l,right:l,t:h,top:h,up:h,b:a,bottom:a,down:a};j=j.toLowerCase();g.moveTo(e[j][0],e[j][1],g.animTest.call(g,arguments,c,2))},setLeftTop:function(d,c){var b=this,a=b.dom.style;a.left=b.addUnits(d);a.top=b.addUnits(c);return b},getRegion:function(){return Ext.lib.Dom.getRegion(this.dom)},setBounds:function(b,g,d,a,c){var e=this;if(!c||!e.anim){e.setSize(d,a);e.setLocation(b,g)}else{e.anim({points:{to:[b,g]},width:{to:e.adjustWidth(d)},height:{to:e.adjustHeight(a)}},e.preanim(arguments,4),"motion")}return e},setRegion:function(b,a){return this.setBounds(b.left,b.top,b.right-b.left,b.bottom-b.top,this.animTest.call(this,arguments,a,1))}});Ext.Element.addMethods({scrollTo:function(b,d,a){var e=/top/i.test(b),c=this,g=c.dom,h;if(!a||!c.anim){h="scroll"+(e?"Top":"Left");g[h]=d}else{h="scroll"+(e?"Left":"Top");c.anim({scroll:{to:e?[g[h],d]:[d,g[h]]}},c.preanim(arguments,2),"scroll")}return c},scrollIntoView:function(e,i){var p=Ext.getDom(e)||Ext.getBody().dom,h=this.dom,g=this.getOffsetsTo(p),k=g[0]+p.scrollLeft,u=g[1]+p.scrollTop,q=u+h.offsetHeight,d=k+h.offsetWidth,a=p.clientHeight,m=parseInt(p.scrollTop,10),s=parseInt(p.scrollLeft,10),j=m+a,n=s+p.clientWidth;if(h.offsetHeight>a||uj){p.scrollTop=q-a}}p.scrollTop=p.scrollTop;if(i!==false){if(h.offsetWidth>p.clientWidth||kn){p.scrollLeft=d-p.clientWidth}}p.scrollLeft=p.scrollLeft}return this},scrollChildIntoView:function(b,a){Ext.fly(b,"_scrollChildIntoView").scrollIntoView(this,a)},scroll:function(m,b,d){if(!this.isScrollable()){return false}var e=this.dom,g=e.scrollLeft,p=e.scrollTop,n=e.scrollWidth,k=e.scrollHeight,i=e.clientWidth,a=e.clientHeight,c=false,o,j={l:Math.min(g+b,n-i),r:o=Math.max(g-b,0),t:Math.max(p-b,0),b:Math.min(p+b,k-a)};j.d=j.b;j.u=j.t;m=m.substr(0,1);if((o=j[m])>-1){c=true;this.scrollTo(m=="l"||m=="r"?"left":"top",o,this.preanim(arguments,2))}return c}});Ext.Element.addMethods(function(){var d="visibility",b="display",a="hidden",h="none",c="x-masked",g="x-masked-relative",e=Ext.Element.data;return{isVisible:function(i){var j=!this.isStyle(d,a)&&!this.isStyle(b,h),k=this.dom.parentNode;if(i!==true||!j){return j}while(k&&!(/^body/i.test(k.tagName))){if(!Ext.fly(k,"_isVisible").isVisible()){return false}k=k.parentNode}return true},isDisplayed:function(){return !this.isStyle(b,h)},enableDisplayMode:function(i){this.setVisibilityMode(Ext.Element.DISPLAY);if(!Ext.isEmpty(i)){e(this.dom,"originalDisplay",i)}return this},mask:function(j,n){var p=this,l=p.dom,o=Ext.DomHelper,m="ext-el-mask-msg",i,q;if(!/^body/i.test(l.tagName)&&p.getStyle("position")=="static"){p.addClass(g)}if(i=e(l,"maskMsg")){i.remove()}if(i=e(l,"mask")){i.remove()}q=o.append(l,{cls:"ext-el-mask"},true);e(l,"mask",q);p.addClass(c);q.setDisplayed(true);if(typeof j=="string"){var k=o.append(l,{cls:m,cn:{tag:"div"}},true);e(l,"maskMsg",k);k.dom.className=n?m+" "+n:m;k.dom.firstChild.innerHTML=j;k.setDisplayed(true);k.center(p)}if(Ext.isIE&&!(Ext.isIE7&&Ext.isStrict)&&p.getStyle("height")=="auto"){q.setSize(undefined,p.getHeight())}return q},unmask:function(){var k=this,l=k.dom,i=e(l,"mask"),j=e(l,"maskMsg");if(i){if(j){j.remove();e(l,"maskMsg",undefined)}i.remove();e(l,"mask",undefined);k.removeClass([c,g])}},isMasked:function(){var i=e(this.dom,"mask");return i&&i.isVisible()},createShim:function(){var i=document.createElement("iframe"),j;i.frameBorder="0";i.className="ext-shim";i.src=Ext.SSL_SECURE_URL;j=Ext.get(this.dom.parentNode.insertBefore(i,this.dom));j.autoBoxAdjust=false;return j}}}());Ext.Element.addMethods({addKeyListener:function(b,d,c){var a;if(typeof b!="object"||Ext.isArray(b)){a={key:b,fn:d,scope:c}}else{a={key:b.key,shift:b.shift,ctrl:b.ctrl,alt:b.alt,fn:d,scope:c}}return new Ext.KeyMap(this,a)},addKeyMap:function(a){return new Ext.KeyMap(this,a)}});Ext.CompositeElementLite.importElementMethods();Ext.apply(Ext.CompositeElementLite.prototype,{addElements:function(c,a){if(!c){return this}if(typeof c=="string"){c=Ext.Element.selectorFunction(c,a)}var b=this.elements;Ext.each(c,function(d){b.push(Ext.get(d))});return this},first:function(){return this.item(0)},last:function(){return this.item(this.getCount()-1)},contains:function(a){return this.indexOf(a)!=-1},removeElement:function(d,e){var c=this,a=this.elements,b;Ext.each(d,function(g){if((b=(a[g]||a[g=c.indexOf(g)]))){if(e){if(b.dom){b.remove()}else{Ext.removeNode(b)}}a.splice(g,1)}});return this}});Ext.CompositeElement=Ext.extend(Ext.CompositeElementLite,{constructor:function(b,a){this.elements=[];this.add(b,a)},getElement:function(a){return a},transformElement:function(a){return Ext.get(a)}});Ext.Element.select=function(a,d,b){var c;if(typeof a=="string"){c=Ext.Element.selectorFunction(a,b)}else{if(a.length!==undefined){c=a}else{throw"Invalid selector"}}return(d===true)?new Ext.CompositeElement(c):new Ext.CompositeElementLite(c)};Ext.select=Ext.Element.select;Ext.UpdateManager=Ext.Updater=Ext.extend(Ext.util.Observable,function(){var b="beforeupdate",d="update",c="failure";function a(h){var i=this;i.transaction=null;if(h.argument.form&&h.argument.reset){try{h.argument.form.reset()}catch(j){}}if(i.loadScripts){i.renderer.render(i.el,h,i,g.createDelegate(i,[h]))}else{i.renderer.render(i.el,h,i);g.call(i,h)}}function g(h,i,j){this.fireEvent(i||d,this.el,h);if(Ext.isFunction(h.argument.callback)){h.argument.callback.call(h.argument.scope,this.el,Ext.isEmpty(j)?true:false,h,h.argument.options)}}function e(h){g.call(this,h,c,!!(this.transaction=null))}return{constructor:function(i,h){var j=this;i=Ext.get(i);if(!h&&i.updateManager){return i.updateManager}j.el=i;j.defaultUrl=null;j.addEvents(b,d,c);Ext.apply(j,Ext.Updater.defaults);j.transaction=null;j.refreshDelegate=j.refresh.createDelegate(j);j.updateDelegate=j.update.createDelegate(j);j.formUpdateDelegate=(j.formUpdate||function(){}).createDelegate(j);j.renderer=j.renderer||j.getDefaultRenderer();Ext.Updater.superclass.constructor.call(j)},setRenderer:function(h){this.renderer=h},getRenderer:function(){return this.renderer},getDefaultRenderer:function(){return new Ext.Updater.BasicRenderer()},setDefaultUrl:function(h){this.defaultUrl=h},getEl:function(){return this.el},update:function(i,n,p,l){var k=this,h,j;if(k.fireEvent(b,k.el,i,n)!==false){if(Ext.isObject(i)){h=i;i=h.url;n=n||h.params;p=p||h.callback;l=l||h.discardUrl;j=h.scope;if(!Ext.isEmpty(h.nocache)){k.disableCaching=h.nocache}if(!Ext.isEmpty(h.text)){k.indicatorText='
    '+h.text+"
    "}if(!Ext.isEmpty(h.scripts)){k.loadScripts=h.scripts}if(!Ext.isEmpty(h.timeout)){k.timeout=h.timeout}}k.showLoading();if(!l){k.defaultUrl=i}if(Ext.isFunction(i)){i=i.call(k)}var m=Ext.apply({},{url:i,params:(Ext.isFunction(n)&&j)?n.createDelegate(j):n,success:a,failure:e,scope:k,callback:undefined,timeout:(k.timeout*1000),disableCaching:k.disableCaching,argument:{options:h,url:i,form:null,callback:p,scope:j||window,params:n}},h);k.transaction=Ext.Ajax.request(m)}},formUpdate:function(k,h,j,l){var i=this;if(i.fireEvent(b,i.el,k,h)!==false){if(Ext.isFunction(h)){h=h.call(i)}k=Ext.getDom(k);i.transaction=Ext.Ajax.request({form:k,url:h,success:a,failure:e,scope:i,timeout:(i.timeout*1000),argument:{url:h,form:k,callback:l,reset:j}});i.showLoading.defer(1,i)}},startAutoRefresh:function(i,j,l,m,h){var k=this;if(h){k.update(j||k.defaultUrl,l,m,true)}if(k.autoRefreshProcId){clearInterval(k.autoRefreshProcId)}k.autoRefreshProcId=setInterval(k.update.createDelegate(k,[j||k.defaultUrl,l,m,true]),i*1000)},stopAutoRefresh:function(){if(this.autoRefreshProcId){clearInterval(this.autoRefreshProcId);delete this.autoRefreshProcId}},isAutoRefreshing:function(){return !!this.autoRefreshProcId},showLoading:function(){if(this.showLoadIndicator){this.el.dom.innerHTML=this.indicatorText}},abort:function(){if(this.transaction){Ext.Ajax.abort(this.transaction)}},isUpdating:function(){return this.transaction?Ext.Ajax.isLoading(this.transaction):false},refresh:function(h){if(this.defaultUrl){this.update(this.defaultUrl,null,h,true)}}}}());Ext.Updater.defaults={timeout:30,disableCaching:false,showLoadIndicator:true,indicatorText:'
    Loading...
    ',loadScripts:false,sslBlankUrl:Ext.SSL_SECURE_URL};Ext.Updater.updateElement=function(d,c,e,b){var a=Ext.get(d).getUpdater();Ext.apply(a,b);a.update(c,e,b?b.callback:null)};Ext.Updater.BasicRenderer=function(){};Ext.Updater.BasicRenderer.prototype={render:function(c,a,b,d){c.update(a.responseText,b.loadScripts,d)}};(function(){Date.useStrict=false;function b(d){var c=Array.prototype.slice.call(arguments,1);return d.replace(/\{(\d+)\}/g,function(e,g){return c[g]})}Date.formatCodeToRegex=function(d,c){var e=Date.parseCodes[d];if(e){e=typeof e=="function"?e():e;Date.parseCodes[d]=e}return e?Ext.applyIf({c:e.c?b(e.c,c||"{0}"):e.c},e):{g:0,c:null,s:Ext.escapeRe(d)}};var a=Date.formatCodeToRegex;Ext.apply(Date,{parseFunctions:{"M$":function(d,c){var e=new RegExp("\\/Date\\(([-+])?(\\d+)(?:[+-]\\d{4})?\\)\\/");var g=(d||"").match(e);return g?new Date(((g[1]||"")+g[2])*1):null}},parseRegexes:[],formatFunctions:{"M$":function(){return"\\/Date("+this.getTime()+")\\/"}},y2kYear:50,MILLI:"ms",SECOND:"s",MINUTE:"mi",HOUR:"h",DAY:"d",MONTH:"mo",YEAR:"y",defaults:{},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNumbers:{Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11},getShortMonthName:function(c){return Date.monthNames[c].substring(0,3)},getShortDayName:function(c){return Date.dayNames[c].substring(0,3)},getMonthNumber:function(c){return Date.monthNumbers[c.substring(0,1).toUpperCase()+c.substring(1,3).toLowerCase()]},formatContainsHourInfo:(function(){var d=/(\\.)/g,c=/([gGhHisucUOPZ]|M\$)/;return function(e){return c.test(e.replace(d,""))}})(),formatCodes:{d:"String.leftPad(this.getDate(), 2, '0')",D:"Date.getShortDayName(this.getDay())",j:"this.getDate()",l:"Date.dayNames[this.getDay()]",N:"(this.getDay() ? this.getDay() : 7)",S:"this.getSuffix()",w:"this.getDay()",z:"this.getDayOfYear()",W:"String.leftPad(this.getWeekOfYear(), 2, '0')",F:"Date.monthNames[this.getMonth()]",m:"String.leftPad(this.getMonth() + 1, 2, '0')",M:"Date.getShortMonthName(this.getMonth())",n:"(this.getMonth() + 1)",t:"this.getDaysInMonth()",L:"(this.isLeapYear() ? 1 : 0)",o:"(this.getFullYear() + (this.getWeekOfYear() == 1 && this.getMonth() > 0 ? +1 : (this.getWeekOfYear() >= 52 && this.getMonth() < 11 ? -1 : 0)))",Y:"String.leftPad(this.getFullYear(), 4, '0')",y:"('' + this.getFullYear()).substring(2, 4)",a:"(this.getHours() < 12 ? 'am' : 'pm')",A:"(this.getHours() < 12 ? 'AM' : 'PM')",g:"((this.getHours() % 12) ? this.getHours() % 12 : 12)",G:"this.getHours()",h:"String.leftPad((this.getHours() % 12) ? this.getHours() % 12 : 12, 2, '0')",H:"String.leftPad(this.getHours(), 2, '0')",i:"String.leftPad(this.getMinutes(), 2, '0')",s:"String.leftPad(this.getSeconds(), 2, '0')",u:"String.leftPad(this.getMilliseconds(), 3, '0')",O:"this.getGMTOffset()",P:"this.getGMTOffset(true)",T:"this.getTimezone()",Z:"(this.getTimezoneOffset() * -60)",c:function(){for(var k="Y-m-dTH:i:sP",h=[],g=0,d=k.length;g= 0 && y >= 0){","v = new Date(y < 100 ? 100 : y, 0, 1, h, i, s, ms).add(Date.YEAR, y < 100 ? y - 100 : 0);","v = !strict? v : (strict === true && (z <= 364 || (v.isLeapYear() && z <= 365))? v.add(Date.DAY, z) : null);","}else if(strict === true && !Date.isValid(y, m + 1, d, h, i, s, ms)){","v = null;","}else{","v = new Date(y < 100 ? 100 : y, m, d, h, i, s, ms).add(Date.YEAR, y < 100 ? y - 100 : 0);","}","}","}","if(v){","if(zz != null){","v = v.add(Date.SECOND, -v.getTimezoneOffset() * 60 - zz);","}else if(o){","v = v.add(Date.MINUTE, -v.getTimezoneOffset() + (sn == '+'? -1 : 1) * (hr * 60 + mn));","}","}","return v;"].join("\n");return function(m){var e=Date.parseRegexes.length,o=1,g=[],l=[],k=false,d="",j=0,h,n;for(;j Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"},a:function(){return a("A")},A:{calcLast:true,g:1,c:"if (/(am)/i.test(results[{0}])) {\nif (!h || h == 12) { h = 0; }\n} else { if (!h || h < 12) { h = (h || 0) + 12; }}",s:"(AM|PM|am|pm)"},g:function(){return a("G")},G:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(\\d{1,2})"},h:function(){return a("H")},H:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},i:{g:1,c:"i = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},s:{g:1,c:"s = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},u:{g:1,c:"ms = results[{0}]; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n",s:"(\\d+)"},O:{g:1,c:["o = results[{0}];","var sn = o.substring(0,1),","hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60),","mn = o.substring(3,5) % 60;","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"].join("\n"),s:"([+-]\\d{4})"},P:{g:1,c:["o = results[{0}];","var sn = o.substring(0,1),","hr = o.substring(1,3)*1 + Math.floor(o.substring(4,6) / 60),","mn = o.substring(4,6) % 60;","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"].join("\n"),s:"([+-]\\d{2}:\\d{2})"},T:{g:0,c:null,s:"[A-Z]{1,4}"},Z:{g:1,c:"zz = results[{0}] * 1;\nzz = (-43200 <= zz && zz <= 50400)? zz : null;\n",s:"([+-]?\\d{1,5})"},c:function(){var e=[],c=[a("Y",1),a("m",2),a("d",3),a("h",4),a("i",5),a("s",6),{c:"ms = results[7] || '0'; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n"},{c:["if(results[8]) {","if(results[8] == 'Z'){","zz = 0;","}else if (results[8].indexOf(':') > -1){",a("P",8).c,"}else{",a("O",8).c,"}","}"].join("\n")}];for(var g=0,d=c.length;g0?"-":"+")+String.leftPad(Math.floor(Math.abs(this.getTimezoneOffset())/60),2,"0")+(a?":":"")+String.leftPad(Math.abs(this.getTimezoneOffset()%60),2,"0")},getDayOfYear:function(){var b=0,e=this.clone(),a=this.getMonth(),c;for(c=0,e.setDate(1),e.setMonth(0);c28){a=Math.min(a,this.getFirstDateOfMonth().add("mo",c).getLastDateOfMonth().getDate())}e.setDate(a);e.setMonth(this.getMonth()+c);break;case Date.YEAR:e.setFullYear(this.getFullYear()+c);break}return e},between:function(c,a){var b=this.getTime();return c.getTime()<=b&&b<=a.getTime()}});Date.prototype.format=Date.prototype.dateFormat;if(Ext.isSafari&&(navigator.userAgent.match(/WebKit\/(\d+)/)[1]||NaN)<420){Ext.apply(Date.prototype,{_xMonth:Date.prototype.setMonth,_xDate:Date.prototype.setDate,setMonth:function(a){if(a<=-1){var d=Math.ceil(-a),c=Math.ceil(d/12),b=(d%12)?12-d%12:0;this.setFullYear(this.getFullYear()-c);return this._xMonth(b)}else{return this._xMonth(a)}},setDate:function(a){return this.setTime(this.getTime()-(this.getDate()-a)*86400000)}})}Ext.util.MixedCollection=function(b,a){this.items=[];this.map={};this.keys=[];this.length=0;this.addEvents("clear","add","replace","remove","sort");this.allowFunctions=b===true;if(a){this.getKey=a}Ext.util.MixedCollection.superclass.constructor.call(this)};Ext.extend(Ext.util.MixedCollection,Ext.util.Observable,{allowFunctions:false,add:function(b,c){if(arguments.length==1){c=arguments[0];b=this.getKey(c)}if(typeof b!="undefined"&&b!==null){var a=this.map[b];if(typeof a!="undefined"){return this.replace(b,c)}this.map[b]=c}this.length++;this.items.push(c);this.keys.push(b);this.fireEvent("add",this.length-1,c,b);return c},getKey:function(a){return a.id},replace:function(c,d){if(arguments.length==1){d=arguments[0];c=this.getKey(d)}var a=this.map[c];if(typeof c=="undefined"||c===null||typeof a=="undefined"){return this.add(c,d)}var b=this.indexOfKey(c);this.items[b]=d;this.map[c]=d;this.fireEvent("replace",c,a,d);return d},addAll:function(e){if(arguments.length>1||Ext.isArray(e)){var b=arguments.length>1?arguments:e;for(var d=0,a=b.length;d=this.length){return this.add(b,c)}this.length++;this.items.splice(a,0,c);if(typeof b!="undefined"&&b!==null){this.map[b]=c}this.keys.splice(a,0,b);this.fireEvent("add",a,c,b);return c},remove:function(a){return this.removeAt(this.indexOf(a))},removeAt:function(a){if(a=0){this.length--;var c=this.items[a];this.items.splice(a,1);var b=this.keys[a];if(typeof b!="undefined"){delete this.map[b]}this.keys.splice(a,1);this.fireEvent("remove",c,b);return c}return false},removeKey:function(a){return this.removeAt(this.indexOfKey(a))},getCount:function(){return this.length},indexOf:function(a){return this.items.indexOf(a)},indexOfKey:function(a){return this.keys.indexOf(a)},item:function(b){var a=this.map[b],c=a!==undefined?a:(typeof b=="number")?this.items[b]:undefined;return typeof c!="function"||this.allowFunctions?c:null},itemAt:function(a){return this.items[a]},key:function(a){return this.map[a]},contains:function(a){return this.indexOf(a)!=-1},containsKey:function(a){return typeof this.map[a]!="undefined"},clear:function(){this.length=0;this.items=[];this.keys=[];this.map={};this.fireEvent("clear")},first:function(){return this.items[0]},last:function(){return this.items[this.length-1]},_sort:function(k,a,j){var d,e,b=String(a).toUpperCase()=="DESC"?-1:1,h=[],l=this.keys,g=this.items;j=j||function(i,c){return i-c};for(d=0,e=g.length;de?1:(g=a;c--){d[d.length]=b[c]}}return d},filter:function(c,b,d,a){if(Ext.isEmpty(b,false)){return this.clone()}b=this.createValueMatcher(b,d,a);return this.filterBy(function(e){return e&&b.test(e[c])})},filterBy:function(g,e){var h=new Ext.util.MixedCollection();h.getKey=this.getKey;var b=this.keys,d=this.items;for(var c=0,a=d.length;c]+>/gi,stripScriptsRe=/(?:)((\n|\r|.)*?)(?:<\/script>)/ig,nl2brRe=/\r?\n/g;return{ellipsis:function(value,len,word){if(value&&value.length>len){if(word){var vs=value.substr(0,len-2),index=Math.max(vs.lastIndexOf(" "),vs.lastIndexOf("."),vs.lastIndexOf("!"),vs.lastIndexOf("?"));if(index==-1||index<(len-15)){return value.substr(0,len-3)+"..."}else{return vs.substr(0,index)+"..."}}else{return value.substr(0,len-3)+"..."}}return value},undef:function(value){return value!==undefined?value:""},defaultValue:function(value,defaultValue){return value!==undefined&&value!==""?value:defaultValue},htmlEncode:function(value){return !value?value:String(value).replace(/&/g,"&").replace(/>/g,">").replace(/").replace(/</g,"<").replace(/"/g,'"').replace(/&/g,"&")},trim:function(value){return String(value).replace(trimRe,"")},substr:function(value,start,length){return String(value).substr(start,length)},lowercase:function(value){return String(value).toLowerCase()},uppercase:function(value){return String(value).toUpperCase()},capitalize:function(value){return !value?value:value.charAt(0).toUpperCase()+value.substr(1).toLowerCase()},call:function(value,fn){if(arguments.length>2){var args=Array.prototype.slice.call(arguments,2);args.unshift(value);return eval(fn).apply(window,args)}else{return eval(fn).call(window,value)}},usMoney:function(v){v=(Math.round((v-0)*100))/100;v=(v==Math.floor(v))?v+".00":((v*10==Math.floor(v*10))?v+"0":v);v=String(v);var ps=v.split("."),whole=ps[0],sub=ps[1]?"."+ps[1]:".00",r=/(\d+)(\d{3})/;while(r.test(whole)){whole=whole.replace(r,"$1,$2")}v=whole+sub;if(v.charAt(0)=="-"){return"-$"+v.substr(1)}return"$"+v},date:function(v,format){if(!v){return""}if(!Ext.isDate(v)){v=new Date(Date.parse(v))}return v.dateFormat(format||"m/d/Y")},dateRenderer:function(format){return function(v){return Ext.util.Format.date(v,format)}},stripTags:function(v){return !v?v:String(v).replace(stripTagsRE,"")},stripScripts:function(v){return !v?v:String(v).replace(stripScriptsRe,"")},fileSize:function(size){if(size<1024){return size+" bytes"}else{if(size<1048576){return(Math.round(((size*10)/1024))/10)+" KB"}else{return(Math.round(((size*10)/1048576))/10)+" MB"}}},math:function(){var fns={};return function(v,a){if(!fns[a]){fns[a]=new Function("v","return v "+a+";")}return fns[a](v)}}(),round:function(value,precision){var result=Number(value);if(typeof precision=="number"){precision=Math.pow(10,precision);result=Math.round(value*precision)/precision}return result},number:function(v,format){if(!format){return v}v=Ext.num(v,NaN);if(isNaN(v)){return""}var comma=",",dec=".",i18n=false,neg=v<0;v=Math.abs(v);if(format.substr(format.length-2)=="/i"){format=format.substr(0,format.length-2);i18n=true;comma=".";dec=","}var hasComma=format.indexOf(comma)!=-1,psplit=(i18n?format.replace(/[^\d\,]/g,""):format.replace(/[^\d\.]/g,"")).split(dec);if(1")}}}();Ext.XTemplate=function(){Ext.XTemplate.superclass.constructor.apply(this,arguments);var y=this,j=y.html,q=/]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/,d=/^]*?for="(.*?)"/,v=/^]*?if="(.*?)"/,x=/^]*?exec="(.*?)"/,r,p=0,k=[],o="values",w="parent",l="xindex",n="xcount",e="return ",c="with(values){ ";j=["",j,""].join("");while((r=j.match(q))){var b=r[0].match(d),a=r[0].match(v),A=r[0].match(x),g=null,h=null,t=null,z=b&&b[1]?b[1]:"";if(a){g=a&&a[1]?a[1]:null;if(g){h=new Function(o,w,l,n,c+e+(Ext.util.Format.htmlDecode(g))+"; }")}}if(A){g=A&&A[1]?A[1]:null;if(g){t=new Function(o,w,l,n,c+(Ext.util.Format.htmlDecode(g))+"; }")}}if(z){switch(z){case".":z=new Function(o,w,c+e+o+"; }");break;case"..":z=new Function(o,w,c+e+w+"; }");break;default:z=new Function(o,w,c+e+z+"; }")}}k.push({id:p,target:z,exec:t,test:h,body:r[1]||""});j=j.replace(r[0],"{xtpl"+p+"}");++p}for(var u=k.length-1;u>=0;--u){y.compileTpl(k[u])}y.master=k[k.length-1];y.tpls=k};Ext.extend(Ext.XTemplate,Ext.Template,{re:/\{([\w\-\.\#]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?(\s?[\+\-\*\\]\s?[\d\.\+\-\*\\\(\)]+)?\}/g,codeRe:/\{\[((?:\\\]|.|\n)*?)\]\}/g,applySubTemplate:function(a,k,j,d,c){var h=this,g,m=h.tpls[a],l,b=[];if((m.test&&!m.test.call(h,k,j,d,c))||(m.exec&&m.exec.call(h,k,j,d,c))){return""}l=m.target?m.target.call(h,k,j):k;g=l.length;j=m.target?k:j;if(m.target&&Ext.isArray(l)){for(var e=0,g=l.length;e=0;--g){d[k[g].selectorText.toLowerCase()]=k[g]}}catch(i){}},getRules:function(h){if(d===null||h){d={};var k=c.styleSheets;for(var j=0,g=k.length;j=37&&a<=40){b.stopEvent()}},destroy:function(){this.disable()},enable:function(){if(this.disabled){if(Ext.isSafari2){this.el.on("keyup",this.stopKeyUp,this)}this.el.on(this.isKeydown()?"keydown":"keypress",this.relay,this);this.disabled=false}},disable:function(){if(!this.disabled){if(Ext.isSafari2){this.el.un("keyup",this.stopKeyUp,this)}this.el.un(this.isKeydown()?"keydown":"keypress",this.relay,this);this.disabled=true}},setDisabled:function(a){this[a?"disable":"enable"]()},isKeydown:function(){return this.forceKeyDown||Ext.EventManager.useKeydown}};Ext.KeyMap=function(c,b,a){this.el=Ext.get(c);this.eventName=a||"keydown";this.bindings=[];if(b){this.addBinding(b)}this.enable()};Ext.KeyMap.prototype={stopEvent:false,addBinding:function(b){if(Ext.isArray(b)){Ext.each(b,function(j){this.addBinding(j)},this);return}var k=b.key,g=b.fn||b.handler,l=b.scope;if(b.stopEvent){this.stopEvent=b.stopEvent}if(typeof k=="string"){var h=[];var e=k.toUpperCase();for(var c=0,d=e.length;c2)?a[2]:null;var h=(i>3)?a[3]:"/";var d=(i>4)?a[4]:null;var g=(i>5)?a[5]:false;document.cookie=c+"="+escape(e)+((b===null)?"":("; expires="+b.toGMTString()))+((h===null)?"":("; path="+h))+((d===null)?"":("; domain="+d))+((g===true)?"; secure":"")},get:function(d){var b=d+"=";var g=b.length;var a=document.cookie.length;var e=0;var c=0;while(e0){return this.ownerCt.items.itemAt(a-1)}}return null},getBubbleTarget:function(){return this.ownerCt}});Ext.reg("component",Ext.Component);Ext.Action=Ext.extend(Object,{constructor:function(a){this.initialConfig=a;this.itemId=a.itemId=(a.itemId||a.id||Ext.id());this.items=[]},isAction:true,setText:function(a){this.initialConfig.text=a;this.callEach("setText",[a])},getText:function(){return this.initialConfig.text},setIconClass:function(a){this.initialConfig.iconCls=a;this.callEach("setIconClass",[a])},getIconClass:function(){return this.initialConfig.iconCls},setDisabled:function(a){this.initialConfig.disabled=a;this.callEach("setDisabled",[a])},enable:function(){this.setDisabled(false)},disable:function(){this.setDisabled(true)},isDisabled:function(){return this.initialConfig.disabled},setHidden:function(a){this.initialConfig.hidden=a;this.callEach("setVisible",[!a])},show:function(){this.setHidden(false)},hide:function(){this.setHidden(true)},isHidden:function(){return this.initialConfig.hidden},setHandler:function(b,a){this.initialConfig.handler=b;this.initialConfig.scope=a;this.callEach("setHandler",[b,a])},each:function(b,a){Ext.each(this.items,b,a)},callEach:function(e,b){var d=this.items;for(var c=0,a=d.length;cj+o.left){k=j-l-c;g=true}if((i+e)>d+o.top){i=d-e-c;g=true}if(k=m){i=m-e-5}}n=[k,i];this.storeXY(n);a.setXY.call(this,n);this.sync()}}return this},getConstrainOffset:function(){return this.shadowOffset},isVisible:function(){return this.visible},showAction:function(){this.visible=true;if(this.useDisplay===true){this.setDisplayed("")}else{if(this.lastXY){a.setXY.call(this,this.lastXY)}else{if(this.lastLT){a.setLeftTop.call(this,this.lastLT[0],this.lastLT[1])}}}},hideAction:function(){this.visible=false;if(this.useDisplay===true){this.setDisplayed(false)}else{this.setLeftTop(-10000,-10000)}},setVisible:function(i,h,k,l,j){if(i){this.showAction()}if(h&&i){var g=function(){this.sync(true);if(l){l()}}.createDelegate(this);a.setVisible.call(this,true,true,k,g,j)}else{if(!i){this.hideUnders(true)}var g=l;if(h){g=function(){this.hideAction();if(l){l()}}.createDelegate(this)}a.setVisible.call(this,i,h,k,g,j);if(i){this.sync(true)}else{if(!h){this.hideAction()}}}return this},storeXY:function(c){delete this.lastLT;this.lastXY=c},storeLeftTop:function(d,c){delete this.lastXY;this.lastLT=[d,c]},beforeFx:function(){this.beforeAction();return Ext.Layer.superclass.beforeFx.apply(this,arguments)},afterFx:function(){Ext.Layer.superclass.afterFx.apply(this,arguments);this.sync(this.isVisible())},beforeAction:function(){if(!this.updating&&this.shadow){this.shadow.hide()}},setLeft:function(c){this.storeLeftTop(c,this.getTop(true));a.setLeft.apply(this,arguments);this.sync();return this},setTop:function(c){this.storeLeftTop(this.getLeft(true),c);a.setTop.apply(this,arguments);this.sync();return this},setLeftTop:function(d,c){this.storeLeftTop(d,c);a.setLeftTop.apply(this,arguments);this.sync();return this},setXY:function(j,h,k,l,i){this.fixDisplay();this.beforeAction();this.storeXY(j);var g=this.createCB(l);a.setXY.call(this,j,h,k,g,i);if(!h){g()}return this},createCB:function(e){var d=this;return function(){d.constrainXY();d.sync(true);if(e){e()}}},setX:function(g,h,j,k,i){this.setXY([g,this.getY()],h,j,k,i);return this},setY:function(k,g,i,j,h){this.setXY([this.getX(),k],g,i,j,h);return this},setSize:function(j,k,i,m,n,l){this.beforeAction();var g=this.createCB(n);a.setSize.call(this,j,k,i,m,g,l);if(!i){g()}return this},setWidth:function(i,h,k,l,j){this.beforeAction();var g=this.createCB(l);a.setWidth.call(this,i,h,k,g,j);if(!h){g()}return this},setHeight:function(j,i,l,m,k){this.beforeAction();var g=this.createCB(m);a.setHeight.call(this,j,i,l,g,k);if(!i){g()}return this},setBounds:function(o,m,p,i,n,k,l,j){this.beforeAction();var g=this.createCB(l);if(!n){this.storeXY([o,m]);a.setXY.call(this,[o,m]);a.setSize.call(this,p,i,n,k,g,j);g()}else{a.setBounds.call(this,o,m,p,i,n,k,g,j)}return this},setZIndex:function(c){this.zindex=c;this.setStyle("z-index",c+2);if(this.shadow){this.shadow.setZIndex(c+1)}if(this.shim){this.shim.setStyle("z-index",c)}return this}})})();Ext.Shadow=function(d){Ext.apply(this,d);if(typeof this.mode!="string"){this.mode=this.defaultMode}var e=this.offset,c={h:0},b=Math.floor(this.offset/2);switch(this.mode.toLowerCase()){case"drop":c.w=0;c.l=c.t=e;c.t-=1;if(Ext.isIE){c.l-=this.offset+b;c.t-=this.offset+b;c.w-=b;c.h-=b;c.t+=1}break;case"sides":c.w=(e*2);c.l=-e;c.t=e-1;if(Ext.isIE){c.l-=(this.offset-b);c.t-=this.offset+b;c.l+=1;c.w-=(this.offset-b)*2;c.w-=b+1;c.h-=1}break;case"frame":c.w=c.h=(e*2);c.l=c.t=-e;c.t+=1;c.h-=2;if(Ext.isIE){c.l-=(this.offset-b);c.t-=(this.offset-b);c.l+=1;c.w-=(this.offset+b+1);c.h-=(this.offset+b);c.h+=1}break}this.adjusts=c};Ext.Shadow.prototype={offset:4,defaultMode:"drop",show:function(a){a=Ext.get(a);if(!this.el){this.el=Ext.Shadow.Pool.pull();if(this.el.dom.nextSibling!=a.dom){this.el.insertBefore(a)}}this.el.setStyle("z-index",this.zIndex||parseInt(a.getStyle("z-index"),10)-1);if(Ext.isIE){this.el.dom.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius="+(this.offset)+")"}this.realign(a.getLeft(true),a.getTop(true),a.getWidth(),a.getHeight());this.el.dom.style.display="block"},isVisible:function(){return this.el?true:false},realign:function(b,r,q,g){if(!this.el){return}var n=this.adjusts,k=this.el.dom,u=k.style,i=0,p=(q+n.w),e=(g+n.h),j=p+"px",o=e+"px",m,c;u.left=(b+n.l)+"px";u.top=(r+n.t)+"px";if(u.width!=j||u.height!=o){u.width=j;u.height=o;if(!Ext.isIE){m=k.childNodes;c=Math.max(0,(p-12))+"px";m[0].childNodes[1].style.width=c;m[1].childNodes[1].style.width=c;m[2].childNodes[1].style.width=c;m[1].style.height=Math.max(0,(e-12))+"px"}}},hide:function(){if(this.el){this.el.dom.style.display="none";Ext.Shadow.Pool.push(this.el);delete this.el}},setZIndex:function(a){this.zIndex=a;if(this.el){this.el.setStyle("z-index",a)}}};Ext.Shadow.Pool=function(){var b=[],a=Ext.isIE?'
    ':'
    ';return{pull:function(){var c=b.shift();if(!c){c=Ext.get(Ext.DomHelper.insertHtml("beforeBegin",document.body.firstChild,a));c.autoBoxAdjust=false}return c},push:function(c){b.push(c)}}}();Ext.BoxComponent=Ext.extend(Ext.Component,{initComponent:function(){Ext.BoxComponent.superclass.initComponent.call(this);this.addEvents("resize","move")},boxReady:false,deferHeight:false,setSize:function(b,d){if(typeof b=="object"){d=b.height;b=b.width}if(Ext.isDefined(b)&&Ext.isDefined(this.boxMinWidth)&&(bthis.boxMaxWidth)){b=this.boxMaxWidth}if(Ext.isDefined(d)&&Ext.isDefined(this.boxMaxHeight)&&(d>this.boxMaxHeight)){d=this.boxMaxHeight}if(!this.boxReady){this.width=b;this.height=d;return this}if(this.cacheSizes!==false&&this.lastSize&&this.lastSize.width==b&&this.lastSize.height==d){return this}this.lastSize={width:b,height:d};var c=this.adjustSize(b,d),g=c.width,a=c.height,e;if(g!==undefined||a!==undefined){e=this.getResizeEl();if(!this.deferHeight&&g!==undefined&&a!==undefined){e.setSize(g,a)}else{if(!this.deferHeight&&a!==undefined){e.setHeight(a)}else{if(g!==undefined){e.setWidth(g)}}}this.onResize(g,a,b,d);this.fireEvent("resize",this,g,a,b,d)}return this},setWidth:function(a){return this.setSize(a)},setHeight:function(a){return this.setSize(undefined,a)},getSize:function(){return this.getResizeEl().getSize()},getWidth:function(){return this.getResizeEl().getWidth()},getHeight:function(){return this.getResizeEl().getHeight()},getOuterSize:function(){var a=this.getResizeEl();return{width:a.getWidth()+a.getMargins("lr"),height:a.getHeight()+a.getMargins("tb")}},getPosition:function(a){var b=this.getPositionEl();if(a===true){return[b.getLeft(true),b.getTop(true)]}return this.xy||b.getXY()},getBox:function(a){var c=this.getPosition(a);var b=this.getSize();b.x=c[0];b.y=c[1];return b},updateBox:function(a){this.setSize(a.width,a.height);this.setPagePosition(a.x,a.y);return this},getResizeEl:function(){return this.resizeEl||this.el},setAutoScroll:function(a){if(this.rendered){this.getContentTarget().setOverflow(a?"auto":"")}this.autoScroll=a;return this},setPosition:function(a,g){if(a&&typeof a[1]=="number"){g=a[1];a=a[0]}this.x=a;this.y=g;if(!this.boxReady){return this}var b=this.adjustPosition(a,g);var e=b.x,d=b.y;var c=this.getPositionEl();if(e!==undefined||d!==undefined){if(e!==undefined&&d!==undefined){c.setLeftTop(e,d)}else{if(e!==undefined){c.setLeft(e)}else{if(d!==undefined){c.setTop(d)}}}this.onPosition(e,d);this.fireEvent("move",this,e,d)}return this},setPagePosition:function(a,c){if(a&&typeof a[1]=="number"){c=a[1];a=a[0]}this.pageX=a;this.pageY=c;if(!this.boxReady){return}if(a===undefined||c===undefined){return}var b=this.getPositionEl().translatePoints(a,c);this.setPosition(b.left,b.top);return this},afterRender:function(){Ext.BoxComponent.superclass.afterRender.call(this);if(this.resizeEl){this.resizeEl=Ext.get(this.resizeEl)}if(this.positionEl){this.positionEl=Ext.get(this.positionEl)}this.boxReady=true;Ext.isDefined(this.autoScroll)&&this.setAutoScroll(this.autoScroll);this.setSize(this.width,this.height);if(this.x||this.y){this.setPosition(this.x,this.y)}else{if(this.pageX||this.pageY){this.setPagePosition(this.pageX,this.pageY)}}},syncSize:function(){delete this.lastSize;this.setSize(this.autoWidth?undefined:this.getResizeEl().getWidth(),this.autoHeight?undefined:this.getResizeEl().getHeight());return this},onResize:function(d,b,a,c){},onPosition:function(a,b){},adjustSize:function(a,b){if(this.autoWidth){a="auto"}if(this.autoHeight){b="auto"}return{width:a,height:b}},adjustPosition:function(a,b){return{x:a,y:b}}});Ext.reg("box",Ext.BoxComponent);Ext.Spacer=Ext.extend(Ext.BoxComponent,{autoEl:"div"});Ext.reg("spacer",Ext.Spacer);Ext.SplitBar=function(c,e,b,d,a){this.el=Ext.get(c,true);this.el.dom.unselectable="on";this.resizingEl=Ext.get(e,true);this.orientation=b||Ext.SplitBar.HORIZONTAL;this.minSize=0;this.maxSize=2000;this.animate=false;this.useShim=false;this.shim=null;if(!a){this.proxy=Ext.SplitBar.createProxy(this.orientation)}else{this.proxy=Ext.get(a).dom}this.dd=new Ext.dd.DDProxy(this.el.dom.id,"XSplitBars",{dragElId:this.proxy.id});this.dd.b4StartDrag=this.onStartProxyDrag.createDelegate(this);this.dd.endDrag=this.onEndProxyDrag.createDelegate(this);this.dragSpecs={};this.adapter=new Ext.SplitBar.BasicLayoutAdapter();this.adapter.init(this);if(this.orientation==Ext.SplitBar.HORIZONTAL){this.placement=d||(this.el.getX()>this.resizingEl.getX()?Ext.SplitBar.LEFT:Ext.SplitBar.RIGHT);this.el.addClass("x-splitbar-h")}else{this.placement=d||(this.el.getY()>this.resizingEl.getY()?Ext.SplitBar.TOP:Ext.SplitBar.BOTTOM);this.el.addClass("x-splitbar-v")}this.addEvents("resize","moved","beforeresize","beforeapply");Ext.SplitBar.superclass.constructor.call(this)};Ext.extend(Ext.SplitBar,Ext.util.Observable,{onStartProxyDrag:function(a,e){this.fireEvent("beforeresize",this);this.overlay=Ext.DomHelper.append(document.body,{cls:"x-drag-overlay",html:" "},true);this.overlay.unselectable();this.overlay.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.overlay.show();Ext.get(this.proxy).setDisplayed("block");var c=this.adapter.getElementSize(this);this.activeMinSize=this.getMinimumSize();this.activeMaxSize=this.getMaximumSize();var d=c-this.activeMinSize;var b=Math.max(this.activeMaxSize-c,0);if(this.orientation==Ext.SplitBar.HORIZONTAL){this.dd.resetConstraints();this.dd.setXConstraint(this.placement==Ext.SplitBar.LEFT?d:b,this.placement==Ext.SplitBar.LEFT?b:d,this.tickSize);this.dd.setYConstraint(0,0)}else{this.dd.resetConstraints();this.dd.setXConstraint(0,0);this.dd.setYConstraint(this.placement==Ext.SplitBar.TOP?d:b,this.placement==Ext.SplitBar.TOP?b:d,this.tickSize)}this.dragSpecs.startSize=c;this.dragSpecs.startPoint=[a,e];Ext.dd.DDProxy.prototype.b4StartDrag.call(this.dd,a,e)},onEndProxyDrag:function(c){Ext.get(this.proxy).setDisplayed(false);var b=Ext.lib.Event.getXY(c);if(this.overlay){Ext.destroy(this.overlay);delete this.overlay}var a;if(this.orientation==Ext.SplitBar.HORIZONTAL){a=this.dragSpecs.startSize+(this.placement==Ext.SplitBar.LEFT?b[0]-this.dragSpecs.startPoint[0]:this.dragSpecs.startPoint[0]-b[0])}else{a=this.dragSpecs.startSize+(this.placement==Ext.SplitBar.TOP?b[1]-this.dragSpecs.startPoint[1]:this.dragSpecs.startPoint[1]-b[1])}a=Math.min(Math.max(a,this.activeMinSize),this.activeMaxSize);if(a!=this.dragSpecs.startSize){if(this.fireEvent("beforeapply",this,a)!==false){this.adapter.setElementSize(this,a);this.fireEvent("moved",this,a);this.fireEvent("resize",this,a)}}},getAdapter:function(){return this.adapter},setAdapter:function(a){this.adapter=a;this.adapter.init(this)},getMinimumSize:function(){return this.minSize},setMinimumSize:function(a){this.minSize=a},getMaximumSize:function(){return this.maxSize},setMaximumSize:function(a){this.maxSize=a},setCurrentSize:function(b){var a=this.animate;this.animate=false;this.adapter.setElementSize(this,b);this.animate=a},destroy:function(a){Ext.destroy(this.shim,Ext.get(this.proxy));this.dd.unreg();if(a){this.el.remove()}this.purgeListeners()}});Ext.SplitBar.createProxy=function(b){var c=new Ext.Element(document.createElement("div"));document.body.appendChild(c.dom);c.unselectable();var a="x-splitbar-proxy";c.addClass(a+" "+(b==Ext.SplitBar.HORIZONTAL?a+"-h":a+"-v"));return c.dom};Ext.SplitBar.BasicLayoutAdapter=function(){};Ext.SplitBar.BasicLayoutAdapter.prototype={init:function(a){},getElementSize:function(a){if(a.orientation==Ext.SplitBar.HORIZONTAL){return a.resizingEl.getWidth()}else{return a.resizingEl.getHeight()}},setElementSize:function(b,a,c){if(b.orientation==Ext.SplitBar.HORIZONTAL){if(!b.animate){b.resizingEl.setWidth(a);if(c){c(b,a)}}else{b.resizingEl.setWidth(a,true,0.1,c,"easeOut")}}else{if(!b.animate){b.resizingEl.setHeight(a);if(c){c(b,a)}}else{b.resizingEl.setHeight(a,true,0.1,c,"easeOut")}}}};Ext.SplitBar.AbsoluteLayoutAdapter=function(a){this.basic=new Ext.SplitBar.BasicLayoutAdapter();this.container=Ext.get(a)};Ext.SplitBar.AbsoluteLayoutAdapter.prototype={init:function(a){this.basic.init(a)},getElementSize:function(a){return this.basic.getElementSize(a)},setElementSize:function(b,a,c){this.basic.setElementSize(b,a,this.moveSplitter.createDelegate(this,[b]))},moveSplitter:function(a){var b=Ext.SplitBar;switch(a.placement){case b.LEFT:a.el.setX(a.resizingEl.getRight());break;case b.RIGHT:a.el.setStyle("right",(this.container.getWidth()-a.resizingEl.getLeft())+"px");break;case b.TOP:a.el.setY(a.resizingEl.getBottom());break;case b.BOTTOM:a.el.setY(a.resizingEl.getTop()-a.el.getHeight());break}}};Ext.SplitBar.VERTICAL=1;Ext.SplitBar.HORIZONTAL=2;Ext.SplitBar.LEFT=1;Ext.SplitBar.RIGHT=2;Ext.SplitBar.TOP=3;Ext.SplitBar.BOTTOM=4;Ext.Container=Ext.extend(Ext.BoxComponent,{bufferResize:50,autoDestroy:true,forceLayout:false,defaultType:"panel",resizeEvent:"resize",bubbleEvents:["add","remove"],initComponent:function(){Ext.Container.superclass.initComponent.call(this);this.addEvents("afterlayout","beforeadd","beforeremove","add","remove");var a=this.items;if(a){delete this.items;this.add(a)}},initItems:function(){if(!this.items){this.items=new Ext.util.MixedCollection(false,this.getComponentId);this.getLayout()}},setLayout:function(a){if(this.layout&&this.layout!=a){this.layout.setContainer(null)}this.layout=a;this.initItems();a.setContainer(this)},afterRender:function(){Ext.Container.superclass.afterRender.call(this);if(!this.layout){this.layout="auto"}if(Ext.isObject(this.layout)&&!this.layout.layout){this.layoutConfig=this.layout;this.layout=this.layoutConfig.type}if(Ext.isString(this.layout)){this.layout=new Ext.Container.LAYOUTS[this.layout.toLowerCase()](this.layoutConfig)}this.setLayout(this.layout);if(this.activeItem!==undefined&&this.layout.setActiveItem){var a=this.activeItem;delete this.activeItem;this.layout.setActiveItem(a)}if(!this.ownerCt){this.doLayout(false,true)}if(this.monitorResize===true){Ext.EventManager.onWindowResize(this.doLayout,this,[false])}},getLayoutTarget:function(){return this.el},getComponentId:function(a){return a.getItemId()},add:function(b){this.initItems();var e=arguments.length>1;if(e||Ext.isArray(b)){var a=[];Ext.each(e?arguments:b,function(h){a.push(this.add(h))},this);return a}var g=this.lookupComponent(this.applyDefaults(b));var d=this.items.length;if(this.fireEvent("beforeadd",this,g,d)!==false&&this.onBeforeAdd(g)!==false){this.items.add(g);g.onAdded(this,d);this.onAdd(g);this.fireEvent("add",this,g,d)}return g},onAdd:function(a){},onAdded:function(a,b){this.ownerCt=a;this.initRef();this.cascade(function(d){d.initRef()});this.fireEvent("added",this,a,b)},insert:function(e,b){var d=arguments,h=d.length,a=[],g,j;this.initItems();if(h>2){for(g=h-1;g>=1;--g){a.push(this.insert(e,d[g]))}return a}j=this.lookupComponent(this.applyDefaults(b));e=Math.min(e,this.items.length);if(this.fireEvent("beforeadd",this,j,e)!==false&&this.onBeforeAdd(j)!==false){if(j.ownerCt==this){this.items.remove(j)}this.items.insert(e,j);j.onAdded(this,e);this.onAdd(j);this.fireEvent("add",this,j,e)}return j},applyDefaults:function(b){var a=this.defaults;if(a){if(Ext.isFunction(a)){a=a.call(this,b)}if(Ext.isString(b)){b=Ext.ComponentMgr.get(b);Ext.apply(b,a)}else{if(!b.events){Ext.applyIf(b.isAction?b.initialConfig:b,a)}else{Ext.apply(b,a)}}}return b},onBeforeAdd:function(a){if(a.ownerCt){a.ownerCt.remove(a,false)}if(this.hideBorders===true){a.border=(a.border===true)}},remove:function(a,b){this.initItems();var d=this.getComponent(a);if(d&&this.fireEvent("beforeremove",this,d)!==false){this.doRemove(d,b);this.fireEvent("remove",this,d)}return d},onRemove:function(a){},doRemove:function(e,d){var b=this.layout,a=b&&this.rendered;if(a){b.onRemove(e)}this.items.remove(e);e.onRemoved();this.onRemove(e);if(d===true||(d!==false&&this.autoDestroy)){e.destroy()}if(a){b.afterRemove(e)}},removeAll:function(c){this.initItems();var e,g=[],b=[];this.items.each(function(h){g.push(h)});for(var d=0,a=g.length;d','','
    ','
    ',"
    ");a.disableFormats=true;return a.compile()})(),destroy:function(){if(this.resizeTask&&this.resizeTask.cancel){this.resizeTask.cancel()}if(this.container){this.container.un(this.container.resizeEvent,this.onResize,this)}if(!Ext.isEmpty(this.targetCls)){var a=this.container.getLayoutTarget();if(a){a.removeClass(this.targetCls)}}}});Ext.layout.AutoLayout=Ext.extend(Ext.layout.ContainerLayout,{type:"auto",monitorResize:true,onLayout:function(d,g){Ext.layout.AutoLayout.superclass.onLayout.call(this,d,g);var e=this.getRenderedItems(d),a=e.length,b,h;for(b=0;b0){b.setSize(a)}}});Ext.Container.LAYOUTS.fit=Ext.layout.FitLayout;Ext.layout.CardLayout=Ext.extend(Ext.layout.FitLayout,{deferredRender:false,layoutOnCardChange:false,renderHidden:true,type:"card",setActiveItem:function(d){var a=this.activeItem,b=this.container;d=b.getComponent(d);if(d&&a!=d){if(a){a.hide();if(a.hidden!==true){return false}a.fireEvent("deactivate",a)}var c=d.doLayout&&(this.layoutOnCardChange||!d.rendered);this.activeItem=d;delete d.deferLayout;d.show();this.layout();if(c){d.doLayout()}d.fireEvent("activate",d)}},renderAll:function(a,b){if(this.deferredRender){this.renderItem(this.activeItem,undefined,b)}else{Ext.layout.CardLayout.superclass.renderAll.call(this,a,b)}}});Ext.Container.LAYOUTS.card=Ext.layout.CardLayout;Ext.layout.AnchorLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"anchor",defaultAnchor:"100%",parseAnchorRE:/^(r|right|b|bottom)$/i,getLayoutTargetSize:function(){var b=this.container.getLayoutTarget(),a={};if(b){a=b.getViewSize();if(Ext.isIE&&Ext.isStrict&&a.width==0){a=b.getStyleSize()}a.width-=b.getPadding("lr");a.height-=b.getPadding("tb")}return a},onLayout:function(m,w){Ext.layout.AnchorLayout.superclass.onLayout.call(this,m,w);var p=this.getLayoutTargetSize(),k=p.width,o=p.height,q=w.getStyle("overflow"),n=this.getRenderedItems(m),t=n.length,g=[],j,a,v,l,h,c,e,d,u=0,s,b;if(k<20&&o<20){return}if(m.anchorSize){if(typeof m.anchorSize=="number"){a=m.anchorSize}else{a=m.anchorSize.width;v=m.anchorSize.height}}else{a=m.initialConfig.width;v=m.initialConfig.height}for(s=0;s ');b.disableFormats=true;b.compile();Ext.layout.BorderLayout.Region.prototype.toolTemplate=b}this.collapsedEl=this.targetEl.createChild({cls:"x-layout-collapsed x-layout-collapsed-"+this.position,id:this.panel.id+"-xcollapsed"});this.collapsedEl.enableDisplayMode("block");if(this.collapseMode=="mini"){this.collapsedEl.addClass("x-layout-cmini-"+this.position);this.miniCollapsedEl=this.collapsedEl.createChild({cls:"x-layout-mini x-layout-mini-"+this.position,html:" "});this.miniCollapsedEl.addClassOnOver("x-layout-mini-over");this.collapsedEl.addClassOnOver("x-layout-collapsed-over");this.collapsedEl.on("click",this.onExpandClick,this,{stopEvent:true})}else{if(this.collapsible!==false&&!this.hideCollapseTool){var a=this.expandToolEl=this.toolTemplate.append(this.collapsedEl.dom,{id:"expand-"+this.position},true);a.addClassOnOver("x-tool-expand-"+this.position+"-over");a.on("click",this.onExpandClick,this,{stopEvent:true})}if(this.floatable!==false||this.titleCollapse){this.collapsedEl.addClassOnOver("x-layout-collapsed-over");this.collapsedEl.on("click",this[this.floatable?"collapseClick":"onExpandClick"],this)}}}return this.collapsedEl},onExpandClick:function(a){if(this.isSlid){this.panel.expand(false)}else{this.panel.expand()}},onCollapseClick:function(a){this.panel.collapse()},beforeCollapse:function(c,a){this.lastAnim=a;if(this.splitEl){this.splitEl.hide()}this.getCollapsedEl().show();var b=this.panel.getEl();this.originalZIndex=b.getStyle("z-index");b.setStyle("z-index",100);this.isCollapsed=true;this.layout.layout()},onCollapse:function(a){this.panel.el.setStyle("z-index",1);if(this.lastAnim===false||this.panel.animCollapse===false){this.getCollapsedEl().dom.style.visibility="visible"}else{this.getCollapsedEl().slideIn(this.panel.slideAnchor,{duration:0.2})}this.state.collapsed=true;this.panel.saveState()},beforeExpand:function(a){if(this.isSlid){this.afterSlideIn()}var b=this.getCollapsedEl();this.el.show();if(this.position=="east"||this.position=="west"){this.panel.setSize(undefined,b.getHeight())}else{this.panel.setSize(b.getWidth(),undefined)}b.hide();b.dom.style.visibility="hidden";this.panel.el.setStyle("z-index",this.floatingZIndex)},onExpand:function(){this.isCollapsed=false;if(this.splitEl){this.splitEl.show()}this.layout.layout();this.panel.el.setStyle("z-index",this.originalZIndex);this.state.collapsed=false;this.panel.saveState()},collapseClick:function(a){if(this.isSlid){a.stopPropagation();this.slideIn()}else{a.stopPropagation();this.slideOut()}},onHide:function(){if(this.isCollapsed){this.getCollapsedEl().hide()}else{if(this.splitEl){this.splitEl.hide()}}},onShow:function(){if(this.isCollapsed){this.getCollapsedEl().show()}else{if(this.splitEl){this.splitEl.show()}}},isVisible:function(){return !this.panel.hidden},getMargins:function(){return this.isCollapsed&&this.cmargins?this.cmargins:this.margins},getSize:function(){return this.isCollapsed?this.getCollapsedEl().getSize():this.panel.getSize()},setPanel:function(a){this.panel=a},getMinWidth:function(){return this.minWidth},getMinHeight:function(){return this.minHeight},applyLayoutCollapsed:function(a){var b=this.getCollapsedEl();b.setLeftTop(a.x,a.y);b.setSize(a.width,a.height)},applyLayout:function(a){if(this.isCollapsed){this.applyLayoutCollapsed(a)}else{this.panel.setPosition(a.x,a.y);this.panel.setSize(a.width,a.height)}},beforeSlide:function(){this.panel.beforeEffect()},afterSlide:function(){this.panel.afterEffect()},initAutoHide:function(){if(this.autoHide!==false){if(!this.autoHideHd){this.autoHideSlideTask=new Ext.util.DelayedTask(this.slideIn,this);this.autoHideHd={mouseout:function(a){if(!a.within(this.el,true)){this.autoHideSlideTask.delay(500)}},mouseover:function(a){this.autoHideSlideTask.cancel()},scope:this}}this.el.on(this.autoHideHd);this.collapsedEl.on(this.autoHideHd)}},clearAutoHide:function(){if(this.autoHide!==false){this.el.un("mouseout",this.autoHideHd.mouseout);this.el.un("mouseover",this.autoHideHd.mouseover);this.collapsedEl.un("mouseout",this.autoHideHd.mouseout);this.collapsedEl.un("mouseover",this.autoHideHd.mouseover)}},clearMonitor:function(){Ext.getDoc().un("click",this.slideInIf,this)},slideOut:function(){if(this.isSlid||this.el.hasActiveFx()){return}this.isSlid=true;var b=this.panel.tools,c,a;if(b&&b.toggle){b.toggle.hide()}this.el.show();a=this.panel.collapsed;this.panel.collapsed=false;if(this.position=="east"||this.position=="west"){c=this.panel.deferHeight;this.panel.deferHeight=false;this.panel.setSize(undefined,this.collapsedEl.getHeight());this.panel.deferHeight=c}else{this.panel.setSize(this.collapsedEl.getWidth(),undefined)}this.panel.collapsed=a;this.restoreLT=[this.el.dom.style.left,this.el.dom.style.top];this.el.alignTo(this.collapsedEl,this.getCollapseAnchor());this.el.setStyle("z-index",this.floatingZIndex+2);this.panel.el.replaceClass("x-panel-collapsed","x-panel-floating");if(this.animFloat!==false){this.beforeSlide();this.el.slideIn(this.getSlideAnchor(),{callback:function(){this.afterSlide();this.initAutoHide();Ext.getDoc().on("click",this.slideInIf,this)},scope:this,block:true})}else{this.initAutoHide();Ext.getDoc().on("click",this.slideInIf,this)}},afterSlideIn:function(){this.clearAutoHide();this.isSlid=false;this.clearMonitor();this.el.setStyle("z-index","");this.panel.el.replaceClass("x-panel-floating","x-panel-collapsed");this.el.dom.style.left=this.restoreLT[0];this.el.dom.style.top=this.restoreLT[1];var a=this.panel.tools;if(a&&a.toggle){a.toggle.show()}},slideIn:function(a){if(!this.isSlid||this.el.hasActiveFx()){Ext.callback(a);return}this.isSlid=false;if(this.animFloat!==false){this.beforeSlide();this.el.slideOut(this.getSlideAnchor(),{callback:function(){this.el.hide();this.afterSlide();this.afterSlideIn();Ext.callback(a)},scope:this,block:true})}else{this.el.hide();this.afterSlideIn()}},slideInIf:function(a){if(!a.within(this.el)){this.slideIn()}},anchors:{west:"left",east:"right",north:"top",south:"bottom"},sanchors:{west:"l",east:"r",north:"t",south:"b"},canchors:{west:"tl-tr",east:"tr-tl",north:"tl-bl",south:"bl-tl"},getAnchor:function(){return this.anchors[this.position]},getCollapseAnchor:function(){return this.canchors[this.position]},getSlideAnchor:function(){return this.sanchors[this.position]},getAlignAdj:function(){var a=this.cmargins;switch(this.position){case"west":return[0,0];break;case"east":return[0,0];break;case"north":return[0,0];break;case"south":return[0,0];break}},getExpandAdj:function(){var b=this.collapsedEl,a=this.cmargins;switch(this.position){case"west":return[-(a.right+b.getWidth()+a.left),0];break;case"east":return[a.right+b.getWidth()+a.left,0];break;case"north":return[0,-(a.top+a.bottom+b.getHeight())];break;case"south":return[0,a.top+a.bottom+b.getHeight()];break}},destroy:function(){if(this.autoHideSlideTask&&this.autoHideSlideTask.cancel){this.autoHideSlideTask.cancel()}Ext.destroyMembers(this,"miniCollapsedEl","collapsedEl","expandToolEl")}};Ext.layout.BorderLayout.SplitRegion=function(b,a,c){Ext.layout.BorderLayout.SplitRegion.superclass.constructor.call(this,b,a,c);this.applyLayout=this.applyFns[c]};Ext.extend(Ext.layout.BorderLayout.SplitRegion,Ext.layout.BorderLayout.Region,{splitTip:"Drag to resize.",collapsibleSplitTip:"Drag to resize. Double click to hide.",useSplitTips:false,splitSettings:{north:{orientation:Ext.SplitBar.VERTICAL,placement:Ext.SplitBar.TOP,maxFn:"getVMaxSize",minProp:"minHeight",maxProp:"maxHeight"},south:{orientation:Ext.SplitBar.VERTICAL,placement:Ext.SplitBar.BOTTOM,maxFn:"getVMaxSize",minProp:"minHeight",maxProp:"maxHeight"},east:{orientation:Ext.SplitBar.HORIZONTAL,placement:Ext.SplitBar.RIGHT,maxFn:"getHMaxSize",minProp:"minWidth",maxProp:"maxWidth"},west:{orientation:Ext.SplitBar.HORIZONTAL,placement:Ext.SplitBar.LEFT,maxFn:"getHMaxSize",minProp:"minWidth",maxProp:"maxWidth"}},applyFns:{west:function(c){if(this.isCollapsed){return this.applyLayoutCollapsed(c)}var d=this.splitEl.dom,b=d.style;this.panel.setPosition(c.x,c.y);var a=d.offsetWidth;b.left=(c.x+c.width-a)+"px";b.top=(c.y)+"px";b.height=Math.max(0,c.height)+"px";this.panel.setSize(c.width-a,c.height)},east:function(c){if(this.isCollapsed){return this.applyLayoutCollapsed(c)}var d=this.splitEl.dom,b=d.style;var a=d.offsetWidth;this.panel.setPosition(c.x+a,c.y);b.left=(c.x)+"px";b.top=(c.y)+"px";b.height=Math.max(0,c.height)+"px";this.panel.setSize(c.width-a,c.height)},north:function(c){if(this.isCollapsed){return this.applyLayoutCollapsed(c)}var d=this.splitEl.dom,b=d.style;var a=d.offsetHeight;this.panel.setPosition(c.x,c.y);b.left=(c.x)+"px";b.top=(c.y+c.height-a)+"px";b.width=Math.max(0,c.width)+"px";this.panel.setSize(c.width,c.height-a)},south:function(c){if(this.isCollapsed){return this.applyLayoutCollapsed(c)}var d=this.splitEl.dom,b=d.style;var a=d.offsetHeight;this.panel.setPosition(c.x,c.y+a);b.left=(c.x)+"px";b.top=(c.y)+"px";b.width=Math.max(0,c.width)+"px";this.panel.setSize(c.width,c.height-a)}},render:function(a,c){Ext.layout.BorderLayout.SplitRegion.superclass.render.call(this,a,c);var d=this.position;this.splitEl=a.createChild({cls:"x-layout-split x-layout-split-"+d,html:" ",id:this.panel.id+"-xsplit"});if(this.collapseMode=="mini"){this.miniSplitEl=this.splitEl.createChild({cls:"x-layout-mini x-layout-mini-"+d,html:" "});this.miniSplitEl.addClassOnOver("x-layout-mini-over");this.miniSplitEl.on("click",this.onCollapseClick,this,{stopEvent:true})}var b=this.splitSettings[d];this.split=new Ext.SplitBar(this.splitEl.dom,c.el,b.orientation);this.split.tickSize=this.tickSize;this.split.placement=b.placement;this.split.getMaximumSize=this[b.maxFn].createDelegate(this);this.split.minSize=this.minSize||this[b.minProp];this.split.on("beforeapply",this.onSplitMove,this);this.split.useShim=this.useShim===true;this.maxSize=this.maxSize||this[b.maxProp];if(c.hidden){this.splitEl.hide()}if(this.useSplitTips){this.splitEl.dom.title=this.collapsible?this.collapsibleSplitTip:this.splitTip}if(this.collapsible){this.splitEl.on("dblclick",this.onCollapseClick,this)}},getSize:function(){if(this.isCollapsed){return this.collapsedEl.getSize()}var a=this.panel.getSize();if(this.position=="north"||this.position=="south"){a.height+=this.splitEl.dom.offsetHeight}else{a.width+=this.splitEl.dom.offsetWidth}return a},getHMaxSize:function(){var b=this.maxSize||10000;var a=this.layout.center;return Math.min(b,(this.el.getWidth()+a.el.getWidth())-a.getMinWidth())},getVMaxSize:function(){var b=this.maxSize||10000;var a=this.layout.center;return Math.min(b,(this.el.getHeight()+a.el.getHeight())-a.getMinHeight())},onSplitMove:function(b,a){var c=this.panel.getSize();this.lastSplitSize=a;if(this.position=="north"||this.position=="south"){this.panel.setSize(c.width,a);this.state.height=a}else{this.panel.setSize(a,c.height);this.state.width=a}this.layout.layout();this.panel.saveState();return false},getSplitBar:function(){return this.split},destroy:function(){Ext.destroy(this.miniSplitEl,this.split,this.splitEl);Ext.layout.BorderLayout.SplitRegion.superclass.destroy.call(this)}});Ext.Container.LAYOUTS.border=Ext.layout.BorderLayout;Ext.layout.FormLayout=Ext.extend(Ext.layout.AnchorLayout,{labelSeparator:":",trackLabels:true,type:"form",onRemove:function(d){Ext.layout.FormLayout.superclass.onRemove.call(this,d);if(this.trackLabels){d.un("show",this.onFieldShow,this);d.un("hide",this.onFieldHide,this)}var b=d.getPositionEl(),a=d.getItemCt&&d.getItemCt();if(d.rendered&&a){if(b&&b.dom){b.insertAfter(a)}Ext.destroy(a);Ext.destroyMembers(d,"label","itemCt");if(d.customItemCt){Ext.destroyMembers(d,"getItemCt","customItemCt")}}},setContainer:function(a){Ext.layout.FormLayout.superclass.setContainer.call(this,a);if(a.labelAlign){a.addClass("x-form-label-"+a.labelAlign)}if(a.hideLabels){Ext.apply(this,{labelStyle:"display:none",elementStyle:"padding-left:0;",labelAdjust:0})}else{this.labelSeparator=Ext.isDefined(a.labelSeparator)?a.labelSeparator:this.labelSeparator;a.labelWidth=a.labelWidth||100;if(Ext.isNumber(a.labelWidth)){var b=Ext.isNumber(a.labelPad)?a.labelPad:5;Ext.apply(this,{labelAdjust:a.labelWidth+b,labelStyle:"width:"+a.labelWidth+"px;",elementStyle:"padding-left:"+(a.labelWidth+b)+"px"})}if(a.labelAlign=="top"){Ext.apply(this,{labelStyle:"width:auto;",labelAdjust:0,elementStyle:"padding-left:0;"})}}},isHide:function(a){return a.hideLabel||this.container.hideLabels},onFieldShow:function(a){a.getItemCt().removeClass("x-hide-"+a.hideMode);if(a.isComposite){a.doLayout()}},onFieldHide:function(a){a.getItemCt().addClass("x-hide-"+a.hideMode)},getLabelStyle:function(e){var b="",c=[this.labelStyle,e];for(var d=0,a=c.length;d=b)||(this.cells[c]&&this.cells[c][a])){if(b&&a>=b){c++;a=0}else{a++}}return[a,c]},renderItem:function(e,a,d){if(!this.table){this.table=d.createChild(Ext.apply({tag:"table",cls:"x-table-layout",cellspacing:0,cn:{tag:"tbody"}},this.tableAttrs),null,true)}if(e&&!e.rendered){e.render(this.getNextCell(e));this.configureItem(e)}else{if(e&&!this.isValidParent(e,d)){var b=this.getNextCell(e);b.insertBefore(e.getPositionEl().dom,null);e.container=Ext.get(b);this.configureItem(e)}}},isValidParent:function(b,a){return b.getPositionEl().up("table",5).dom.parentNode===(a.dom||a)},destroy:function(){delete this.table;Ext.layout.TableLayout.superclass.destroy.call(this)}});Ext.Container.LAYOUTS.table=Ext.layout.TableLayout;Ext.layout.AbsoluteLayout=Ext.extend(Ext.layout.AnchorLayout,{extraCls:"x-abs-layout-item",type:"absolute",onLayout:function(a,b){b.position();this.paddingLeft=b.getPadding("l");this.paddingTop=b.getPadding("t");Ext.layout.AbsoluteLayout.superclass.onLayout.call(this,a,b)},adjustWidthAnchor:function(b,a){return b?b-a.getPosition(true)[0]+this.paddingLeft:b},adjustHeightAnchor:function(b,a){return b?b-a.getPosition(true)[1]+this.paddingTop:b}});Ext.Container.LAYOUTS.absolute=Ext.layout.AbsoluteLayout;Ext.layout.BoxLayout=Ext.extend(Ext.layout.ContainerLayout,{defaultMargins:{left:0,top:0,right:0,bottom:0},padding:"0",pack:"start",monitorResize:true,type:"box",scrollOffset:0,extraCls:"x-box-item",targetCls:"x-box-layout-ct",innerCls:"x-box-inner",constructor:function(a){Ext.layout.BoxLayout.superclass.constructor.call(this,a);if(Ext.isString(this.defaultMargins)){this.defaultMargins=this.parseMargins(this.defaultMargins)}var d=this.overflowHandler;if(typeof d=="string"){d={type:d}}var c="none";if(d&&d.type!=undefined){c=d.type}var b=Ext.layout.boxOverflow[c];if(b[this.type]){b=b[this.type]}this.overflowHandler=new b(this,d)},onLayout:function(b,h){Ext.layout.BoxLayout.superclass.onLayout.call(this,b,h);var d=this.getLayoutTargetSize(),i=this.getVisibleItems(b),c=this.calculateChildBoxes(i,d),g=c.boxes,j=c.meta;if(d.width>0){var k=this.overflowHandler,a=j.tooNarrow?"handleOverflow":"clearOverflow";var e=k[a](c,d);if(e){if(e.targetSize){d=e.targetSize}if(e.recalculate){i=this.getVisibleItems(b);c=this.calculateChildBoxes(i,d);g=c.boxes}}}this.layoutTargetLastSize=d;this.childBoxCache=c;this.updateInnerCtSize(d,c);this.updateChildBoxes(g);this.handleTargetOverflow(d,b,h)},updateChildBoxes:function(c){for(var b=0,e=c.length;b(None)',constructor:function(a){Ext.layout.boxOverflow.Menu.superclass.constructor.apply(this,arguments);this.menuItems=[]},createInnerElements:function(){if(!this.afterCt){this.afterCt=this.layout.innerCt.insertSibling({cls:this.afterCls},"before")}},clearOverflow:function(a,g){var e=g.width+(this.afterCt?this.afterCt.getWidth():0),b=this.menuItems;this.hideTrigger();for(var c=0,d=b.length;ci.width;return l}},handleOverflow:function(d,h){this.showTrigger();var k=h.width-this.afterCt.getWidth(),l=d.boxes,e=0,r=false;for(var o=0,c=l.length;o=0;j--){var q=l[j].component,p=l[j].left+l[j].width;if(p>=k){this.menuItems.unshift({component:q,width:l[j].width});q.hide()}else{break}}}if(this.menuItems.length==0){this.hideTrigger()}return{targetSize:{height:h.height,width:k},recalculate:r}}});Ext.layout.boxOverflow.menu.hbox=Ext.layout.boxOverflow.HorizontalMenu;Ext.layout.boxOverflow.Scroller=Ext.extend(Ext.layout.boxOverflow.None,{animateScroll:true,scrollIncrement:100,wheelIncrement:3,scrollRepeatInterval:400,scrollDuration:0.4,beforeCls:"x-strip-left",afterCls:"x-strip-right",scrollerCls:"x-strip-scroller",beforeScrollerCls:"x-strip-scroller-left",afterScrollerCls:"x-strip-scroller-right",createWheelListener:function(){this.layout.innerCt.on({scope:this,mousewheel:function(a){a.stopEvent();this.scrollBy(a.getWheelDelta()*this.wheelIncrement*-1,false)}})},handleOverflow:function(a,b){this.createInnerElements();this.showScrollers()},clearOverflow:function(){this.hideScrollers()},showScrollers:function(){this.createScrollers();this.beforeScroller.show();this.afterScroller.show();this.updateScrollButtons()},hideScrollers:function(){if(this.beforeScroller!=undefined){this.beforeScroller.hide();this.afterScroller.hide()}},createScrollers:function(){if(!this.beforeScroller&&!this.afterScroller){var a=this.beforeCt.createChild({cls:String.format("{0} {1} ",this.scrollerCls,this.beforeScrollerCls)});var b=this.afterCt.createChild({cls:String.format("{0} {1}",this.scrollerCls,this.afterScrollerCls)});a.addClassOnOver(this.beforeScrollerCls+"-hover");b.addClassOnOver(this.afterScrollerCls+"-hover");a.setVisibilityMode(Ext.Element.DISPLAY);b.setVisibilityMode(Ext.Element.DISPLAY);this.beforeRepeater=new Ext.util.ClickRepeater(a,{interval:this.scrollRepeatInterval,handler:this.scrollLeft,scope:this});this.afterRepeater=new Ext.util.ClickRepeater(b,{interval:this.scrollRepeatInterval,handler:this.scrollRight,scope:this});this.beforeScroller=a;this.afterScroller=b}},destroy:function(){Ext.destroy(this.beforeScroller,this.afterScroller,this.beforeRepeater,this.afterRepeater,this.beforeCt,this.afterCt)},scrollBy:function(b,a){this.scrollTo(this.getScrollPosition()+b,a)},getItem:function(a){if(Ext.isString(a)){a=Ext.getCmp(a)}else{if(Ext.isNumber(a)){a=this.items[a]}}return a},getScrollAnim:function(){return{duration:this.scrollDuration,callback:this.updateScrollButtons,scope:this}},updateScrollButtons:function(){if(this.beforeScroller==undefined||this.afterScroller==undefined){return}var d=this.atExtremeBefore()?"addClass":"removeClass",c=this.atExtremeAfter()?"addClass":"removeClass",a=this.beforeScrollerCls+"-disabled",b=this.afterScrollerCls+"-disabled";this.beforeScroller[d](a);this.afterScroller[c](b);this.scrolling=false},atExtremeBefore:function(){return this.getScrollPosition()===0},scrollLeft:function(a){this.scrollBy(-this.scrollIncrement,a)},scrollRight:function(a){this.scrollBy(this.scrollIncrement,a)},scrollToItem:function(d,b){d=this.getItem(d);if(d!=undefined){var a=this.getItemVisibility(d);if(!a.fullyVisible){var c=d.getBox(true,true),e=c.x;if(a.hiddenRight){e-=(this.layout.innerCt.getWidth()-c.width)}this.scrollTo(e,b)}}},getItemVisibility:function(e){var d=this.getItem(e).getBox(true,true),a=d.x,c=d.x+d.width,g=this.getScrollPosition(),b=this.layout.innerCt.getWidth()+g;return{hiddenLeft:ab,fullyVisible:a>g&&c=this.getMaxScrollBottom()}});Ext.layout.boxOverflow.scroller.vbox=Ext.layout.boxOverflow.VerticalScroller;Ext.layout.boxOverflow.HorizontalScroller=Ext.extend(Ext.layout.boxOverflow.Scroller,{handleOverflow:function(a,b){Ext.layout.boxOverflow.HorizontalScroller.superclass.handleOverflow.apply(this,arguments);return{targetSize:{height:b.height,width:b.width-(this.beforeCt.getWidth()+this.afterCt.getWidth())}}},createInnerElements:function(){var a=this.layout.innerCt;if(!this.beforeCt){this.afterCt=a.insertSibling({cls:this.afterCls},"before");this.beforeCt=a.insertSibling({cls:this.beforeCls},"before");this.createWheelListener()}},scrollTo:function(a,b){var d=this.getScrollPosition(),c=a.constrain(0,this.getMaxScrollRight());if(c!=d&&!this.scrolling){if(b==undefined){b=this.animateScroll}this.layout.innerCt.scrollTo("left",c,b?this.getScrollAnim():false);if(b){this.scrolling=true}else{this.scrolling=false;this.updateScrollButtons()}}},getScrollPosition:function(){return parseInt(this.layout.innerCt.dom.scrollLeft,10)||0},getMaxScrollRight:function(){return this.layout.innerCt.dom.scrollWidth-this.layout.innerCt.getWidth()},atExtremeAfter:function(){return this.getScrollPosition()>=this.getMaxScrollRight()}});Ext.layout.boxOverflow.scroller.hbox=Ext.layout.boxOverflow.HorizontalScroller;Ext.layout.HBoxLayout=Ext.extend(Ext.layout.BoxLayout,{align:"top",type:"hbox",calculateChildBoxes:function(r,b){var F=r.length,R=this.padding,D=R.top,U=R.left,y=D+R.bottom,O=U+R.right,a=b.width-this.scrollOffset,e=b.height,o=Math.max(0,e-y),P=this.pack=="start",W=this.pack=="center",A=this.pack=="end",L=0,Q=0,T=0,l=0,X=0,H=[],k,J,M,V,w,j,S,I,c,x,q,N;for(S=0;Sa;var n=Math.max(0,a-L-O);if(p){for(S=0;S0){var C=[];for(var E=0,v=F;Ei.available?1:-1});for(var S=0,v=C.length;S0){I.top=D+q+(z/2)}}U+=I.width+w.right}return{boxes:H,meta:{maxHeight:Q,nonFlexWidth:L,desiredWidth:l,minimumWidth:X,shortfall:l-a,tooNarrow:p}}}});Ext.Container.LAYOUTS.hbox=Ext.layout.HBoxLayout;Ext.layout.VBoxLayout=Ext.extend(Ext.layout.BoxLayout,{align:"left",type:"vbox",calculateChildBoxes:function(o,b){var E=o.length,R=this.padding,C=R.top,V=R.left,x=C+R.bottom,O=V+R.right,a=b.width-this.scrollOffset,c=b.height,K=Math.max(0,a-O),P=this.pack=="start",X=this.pack=="center",z=this.pack=="end",k=0,u=0,U=0,L=0,m=0,G=[],h,I,N,W,t,g,T,H,S,w,n,d,r;for(T=0;Tc;var q=Math.max(0,(c-k-x));if(l){for(T=0,r=E;T0){var J=[];for(var D=0,r=E;Di.available?1:-1});for(var T=0,r=J.length;T0){H.left=V+w+(y/2)}}C+=H.height+t.bottom}return{boxes:G,meta:{maxWidth:u,nonFlexHeight:k,desiredHeight:L,minimumHeight:m,shortfall:L-c,tooNarrow:l}}}});Ext.Container.LAYOUTS.vbox=Ext.layout.VBoxLayout;Ext.layout.ToolbarLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"toolbar",triggerWidth:18,noItemsMenuText:'
    (None)
    ',lastOverflow:false,tableHTML:['',"","",'",'","","","
    ','',"",'',"","
    ","
    ','',"","","","","","","
    ",'',"",'',"","
    ","
    ",'',"",'',"","
    ","
    ","
    "].join(""),onLayout:function(e,j){if(!this.leftTr){var h=e.buttonAlign=="center"?"center":"left";j.addClass("x-toolbar-layout-ct");j.insertHtml("beforeEnd",String.format(this.tableHTML,h));this.leftTr=j.child("tr.x-toolbar-left-row",true);this.rightTr=j.child("tr.x-toolbar-right-row",true);this.extrasTr=j.child("tr.x-toolbar-extras-row",true);if(this.hiddenItem==undefined){this.hiddenItems=[]}}var k=e.buttonAlign=="right"?this.rightTr:this.leftTr,l=e.items.items,d=0;for(var b=0,g=l.length,m;b=0&&(d=e[a]);a--){if(!d.firstChild){b.removeChild(d)}}},insertCell:function(e,b,a){var d=document.createElement("td");d.className="x-toolbar-cell";b.insertBefore(d,b.childNodes[a]||null);return d},hideItem:function(a){this.hiddenItems.push(a);a.xtbHidden=true;a.xtbWidth=a.getPositionEl().dom.parentNode.offsetWidth;a.hide()},unhideItem:function(a){a.show();a.xtbHidden=false;this.hiddenItems.remove(a)},getItemWidth:function(a){return a.hidden?(a.xtbWidth||0):a.getPositionEl().dom.parentNode.offsetWidth},fitToSize:function(k){if(this.container.enableOverflow===false){return}var b=k.dom.clientWidth,j=k.dom.firstChild.offsetWidth,m=b-this.triggerWidth,a=this.lastWidth||0,c=this.hiddenItems,e=c.length!=0,n=b>=a;this.lastWidth=b;if(j>b||(e&&n)){var l=this.container.items.items,h=l.length,d=0,o;for(var g=0;gm){if(!(o.hidden||o.xtbHidden)){this.hideItem(o)}}else{if(o.xtbHidden){this.unhideItem(o)}}}}}e=c.length!=0;if(e){this.initMore();if(!this.lastOverflow){this.container.fireEvent("overflowchange",this.container,true);this.lastOverflow=true}}else{if(this.more){this.clearMenu();this.more.destroy();delete this.more;if(this.lastOverflow){this.container.fireEvent("overflowchange",this.container,false);this.lastOverflow=false}}}},createMenuConfig:function(c,a){var b=Ext.apply({},c.initialConfig),d=c.toggleGroup;Ext.copyTo(b,c,["iconCls","icon","itemId","disabled","handler","scope","menu"]);Ext.apply(b,{text:c.overflowText||c.text,hideOnClick:a});if(d||c.enableToggle){Ext.apply(b,{group:d,checked:c.pressed,listeners:{checkchange:function(g,e){c.toggle(e)}}})}delete b.ownerCt;delete b.xtype;delete b.id;return b},addComponentToMenu:function(b,a){if(a instanceof Ext.Toolbar.Separator){b.add("-")}else{if(Ext.isFunction(a.isXType)){if(a.isXType("splitbutton")){b.add(this.createMenuConfig(a,true))}else{if(a.isXType("button")){b.add(this.createMenuConfig(a,!a.menu))}else{if(a.isXType("buttongroup")){a.items.each(function(c){this.addComponentToMenu(b,c)},this)}}}}}},clearMenu:function(){var a=this.moreMenu;if(a&&a.items){a.items.each(function(b){delete b.menu})}},beforeMoreShow:function(h){var b=this.container.items.items,a=b.length,g,e;var c=function(j,i){return j.isXType("buttongroup")&&!(i instanceof Ext.Toolbar.Separator)};this.clearMenu();h.removeAll();for(var d=0;d','','{altText}',"","")}if(g&&!g.rendered){if(Ext.isNumber(b)){b=e.dom.childNodes[b]}var d=this.getItemArgs(g);g.render(g.positionEl=b?this.itemTpl.insertBefore(b,d,true):this.itemTpl.append(e,d,true));g.positionEl.menuItemId=g.getItemId();if(!d.isMenuItem&&d.needsIcon){g.positionEl.addClass("x-menu-list-item-indent")}this.configureItem(g)}else{if(g&&!this.isValidParent(g,e)){if(Ext.isNumber(b)){b=e.dom.childNodes[b]}e.dom.insertBefore(g.getActionEl().dom,b||null)}}},getItemArgs:function(d){var a=d instanceof Ext.menu.Item,b=!(a||d instanceof Ext.menu.Separator);return{isMenuItem:a,needsIcon:b&&(d.icon||d.iconCls),icon:d.icon||Ext.BLANK_IMAGE_URL,iconCls:"x-menu-item-icon "+(d.iconCls||""),itemId:"x-menu-el-"+d.id,itemCls:"x-menu-list-item ",altText:d.altText||""}},isValidParent:function(b,a){return b.el.up("li.x-menu-list-item",5).dom.parentNode===(a.dom||a)},onLayout:function(a,b){Ext.layout.MenuLayout.superclass.onLayout.call(this,a,b);this.doAutoSize()},doAutoSize:function(){var c=this.container,a=c.width;if(c.floating){if(a){c.setWidth(a)}else{if(Ext.isIE){c.setWidth(Ext.isStrict&&(Ext.isIE7||Ext.isIE8||Ext.isIE9)?"auto":c.minWidth);var d=c.getEl(),b=d.dom.offsetWidth;c.setWidth(c.getLayoutTarget().getWidth()+d.getFrameWidth("lr"))}}}}});Ext.Container.LAYOUTS.menu=Ext.layout.MenuLayout;Ext.Viewport=Ext.extend(Ext.Container,{initComponent:function(){Ext.Viewport.superclass.initComponent.call(this);document.getElementsByTagName("html")[0].className+=" x-viewport";this.el=Ext.getBody();this.el.setHeight=Ext.emptyFn;this.el.setWidth=Ext.emptyFn;this.el.setSize=Ext.emptyFn;this.el.dom.scroll="no";this.allowDomMove=false;this.autoWidth=true;this.autoHeight=true;Ext.EventManager.onWindowResize(this.fireResize,this);this.renderTo=this.el},fireResize:function(a,b){this.fireEvent("resize",this,a,b,a,b)}});Ext.reg("viewport",Ext.Viewport);Ext.Panel=Ext.extend(Ext.Container,{baseCls:"x-panel",collapsedCls:"x-panel-collapsed",maskDisabled:true,animCollapse:Ext.enableFx,headerAsText:true,buttonAlign:"right",collapsed:false,collapseFirst:true,minButtonWidth:75,elements:"body",preventBodyReset:false,padding:undefined,resizeEvent:"bodyresize",toolTarget:"header",collapseEl:"bwrap",slideAnchor:"t",disabledClass:"",deferHeight:true,expandDefaults:{duration:0.25},collapseDefaults:{duration:0.25},initComponent:function(){Ext.Panel.superclass.initComponent.call(this);this.addEvents("bodyresize","titlechange","iconchange","collapse","expand","beforecollapse","beforeexpand","beforeclose","close","activate","deactivate");if(this.unstyled){this.baseCls="x-plain"}this.toolbars=[];if(this.tbar){this.elements+=",tbar";this.topToolbar=this.createToolbar(this.tbar);this.tbar=null}if(this.bbar){this.elements+=",bbar";this.bottomToolbar=this.createToolbar(this.bbar);this.bbar=null}if(this.header===true){this.elements+=",header";this.header=null}else{if(this.headerCfg||(this.title&&this.header!==false)){this.elements+=",header"}}if(this.footerCfg||this.footer===true){this.elements+=",footer";this.footer=null}if(this.buttons){this.fbar=this.buttons;this.buttons=null}if(this.fbar){this.createFbar(this.fbar)}if(this.autoLoad){this.on("render",this.doAutoLoad,this,{delay:10})}},createFbar:function(b){var a=this.minButtonWidth;this.elements+=",footer";this.fbar=this.createToolbar(b,{buttonAlign:this.buttonAlign,toolbarCls:"x-panel-fbar",enableOverflow:false,defaults:function(d){return{minWidth:d.minWidth||a}}});this.fbar.items.each(function(d){d.minWidth=d.minWidth||this.minButtonWidth},this);this.buttons=this.fbar.items.items},createToolbar:function(b,c){var a;if(Ext.isArray(b)){b={items:b}}a=b.events?Ext.apply(b,c):this.createComponent(Ext.apply({},b,c),"toolbar");this.toolbars.push(a);return a},createElement:function(a,c){if(this[a]){c.appendChild(this[a].dom);return}if(a==="bwrap"||this.elements.indexOf(a)!=-1){if(this[a+"Cfg"]){this[a]=Ext.fly(c).createChild(this[a+"Cfg"])}else{var b=document.createElement("div");b.className=this[a+"Cls"];this[a]=Ext.get(c.appendChild(b))}if(this[a+"CssClass"]){this[a].addClass(this[a+"CssClass"])}if(this[a+"Style"]){this[a].applyStyles(this[a+"Style"])}}},onRender:function(g,e){Ext.Panel.superclass.onRender.call(this,g,e);this.createClasses();var a=this.el,h=a.dom,k,i;if(this.collapsible&&!this.hideCollapseTool){this.tools=this.tools?this.tools.slice(0):[];this.tools[this.collapseFirst?"unshift":"push"]({id:"toggle",handler:this.toggleCollapse,scope:this})}if(this.tools){i=this.tools;this.elements+=(this.header!==false)?",header":""}this.tools={};a.addClass(this.baseCls);if(h.firstChild){this.header=a.down("."+this.headerCls);this.bwrap=a.down("."+this.bwrapCls);var j=this.bwrap?this.bwrap:a;this.tbar=j.down("."+this.tbarCls);this.body=j.down("."+this.bodyCls);this.bbar=j.down("."+this.bbarCls);this.footer=j.down("."+this.footerCls);this.fromMarkup=true}if(this.preventBodyReset===true){a.addClass("x-panel-reset")}if(this.cls){a.addClass(this.cls)}if(this.buttons){this.elements+=",footer"}if(this.frame){a.insertHtml("afterBegin",String.format(Ext.Element.boxMarkup,this.baseCls));this.createElement("header",h.firstChild.firstChild.firstChild);this.createElement("bwrap",h);k=this.bwrap.dom;var c=h.childNodes[1],b=h.childNodes[2];k.appendChild(c);k.appendChild(b);var l=k.firstChild.firstChild.firstChild;this.createElement("tbar",l);this.createElement("body",l);this.createElement("bbar",l);this.createElement("footer",k.lastChild.firstChild.firstChild);if(!this.footer){this.bwrap.dom.lastChild.className+=" x-panel-nofooter"}this.ft=Ext.get(this.bwrap.dom.lastChild);this.mc=Ext.get(l)}else{this.createElement("header",h);this.createElement("bwrap",h);k=this.bwrap.dom;this.createElement("tbar",k);this.createElement("body",k);this.createElement("bbar",k);this.createElement("footer",k);if(!this.header){this.body.addClass(this.bodyCls+"-noheader");if(this.tbar){this.tbar.addClass(this.tbarCls+"-noheader")}}}if(Ext.isDefined(this.padding)){this.body.setStyle("padding",this.body.addUnits(this.padding))}if(this.border===false){this.el.addClass(this.baseCls+"-noborder");this.body.addClass(this.bodyCls+"-noborder");if(this.header){this.header.addClass(this.headerCls+"-noborder")}if(this.footer){this.footer.addClass(this.footerCls+"-noborder")}if(this.tbar){this.tbar.addClass(this.tbarCls+"-noborder")}if(this.bbar){this.bbar.addClass(this.bbarCls+"-noborder")}}if(this.bodyBorder===false){this.body.addClass(this.bodyCls+"-noborder")}this.bwrap.enableDisplayMode("block");if(this.header){this.header.unselectable();if(this.headerAsText){this.header.dom.innerHTML=''+this.header.dom.innerHTML+"";if(this.iconCls){this.setIconClass(this.iconCls)}}}if(this.floating){this.makeFloating(this.floating)}if(this.collapsible&&this.titleCollapse&&this.header){this.mon(this.header,"click",this.toggleCollapse,this);this.header.setStyle("cursor","pointer")}if(i){this.addTool.apply(this,i)}if(this.fbar){this.footer.addClass("x-panel-btns");this.fbar.ownerCt=this;this.fbar.render(this.footer);this.footer.createChild({cls:"x-clear"})}if(this.tbar&&this.topToolbar){this.topToolbar.ownerCt=this;this.topToolbar.render(this.tbar)}if(this.bbar&&this.bottomToolbar){this.bottomToolbar.ownerCt=this;this.bottomToolbar.render(this.bbar)}},setIconClass:function(b){var a=this.iconCls;this.iconCls=b;if(this.rendered&&this.header){if(this.frame){this.header.addClass("x-panel-icon");this.header.replaceClass(a,this.iconCls)}else{var e=this.header,c=e.child("img.x-panel-inline-icon");if(c){Ext.fly(c).replaceClass(a,this.iconCls)}else{var d=e.child("span."+this.headerTextCls);if(d){Ext.DomHelper.insertBefore(d.dom,{tag:"img",alt:"",src:Ext.BLANK_IMAGE_URL,cls:"x-panel-inline-icon "+this.iconCls})}}}}this.fireEvent("iconchange",this,b,a)},makeFloating:function(a){this.floating=true;this.el=new Ext.Layer(Ext.apply({},a,{shadow:Ext.isDefined(this.shadow)?this.shadow:"sides",shadowOffset:this.shadowOffset,constrain:false,shim:this.shim===false?false:undefined}),this.el)},getTopToolbar:function(){return this.topToolbar},getBottomToolbar:function(){return this.bottomToolbar},getFooterToolbar:function(){return this.fbar},addButton:function(a,c,b){if(!this.fbar){this.createFbar([])}if(c){if(Ext.isString(a)){a={text:a}}a=Ext.apply({handler:c,scope:b},a)}return this.fbar.add(a)},addTool:function(){if(!this.rendered){if(!this.tools){this.tools=[]}Ext.each(arguments,function(a){this.tools.push(a)},this);return}if(!this[this.toolTarget]){return}if(!this.toolTemplate){var h=new Ext.Template('
     
    ');h.disableFormats=true;h.compile();Ext.Panel.prototype.toolTemplate=h}for(var g=0,d=arguments,c=d.length;g0){Ext.each(this.toolbars,function(c){c.doLayout(undefined,a)});this.syncHeight()}},syncHeight:function(){var b=this.toolbarHeight,c=this.body,a=this.lastSize.height,d;if(this.autoHeight||!Ext.isDefined(a)||a=="auto"){return}if(b!=this.getToolbarHeight()){b=Math.max(0,a-this.getFrameHeight());c.setHeight(b);d=c.getSize();this.toolbarHeight=this.getToolbarHeight();this.onBodyResize(d.width,d.height)}},onShow:function(){if(this.floating){return this.el.show()}Ext.Panel.superclass.onShow.call(this)},onHide:function(){if(this.floating){return this.el.hide()}Ext.Panel.superclass.onHide.call(this)},createToolHandler:function(c,a,d,b){return function(g){c.removeClass(d);if(a.stopEvent!==false){g.stopEvent()}if(a.handler){a.handler.call(a.scope||c,g,c,b,a)}}},afterRender:function(){if(this.floating&&!this.hidden){this.el.show()}if(this.title){this.setTitle(this.title)}Ext.Panel.superclass.afterRender.call(this);if(this.collapsed){this.collapsed=false;this.collapse(false)}this.initEvents()},getKeyMap:function(){if(!this.keyMap){this.keyMap=new Ext.KeyMap(this.el,this.keys)}return this.keyMap},initEvents:function(){if(this.keys){this.getKeyMap()}if(this.draggable){this.initDraggable()}if(this.toolbars.length>0){Ext.each(this.toolbars,function(a){a.doLayout();a.on({scope:this,afterlayout:this.syncHeight,remove:this.syncHeight})},this);this.syncHeight()}},initDraggable:function(){this.dd=new Ext.Panel.DD(this,Ext.isBoolean(this.draggable)?null:this.draggable)},beforeEffect:function(a){if(this.floating){this.el.beforeAction()}if(a!==false){this.el.addClass("x-panel-animated")}},afterEffect:function(a){this.syncShadow();this.el.removeClass("x-panel-animated")},createEffect:function(c,b,d){var e={scope:d,block:true};if(c===true){e.callback=b;return e}else{if(!c.callback){e.callback=b}else{e.callback=function(){b.call(d);Ext.callback(c.callback,c.scope)}}}return Ext.applyIf(e,c)},collapse:function(b){if(this.collapsed||this.el.hasFxBlock()||this.fireEvent("beforecollapse",this,b)===false){return}var a=b===true||(b!==false&&this.animCollapse);this.beforeEffect(a);this.onCollapse(a,b);return this},onCollapse:function(a,b){if(a){this[this.collapseEl].slideOut(this.slideAnchor,Ext.apply(this.createEffect(b||true,this.afterCollapse,this),this.collapseDefaults))}else{this[this.collapseEl].hide(this.hideMode);this.afterCollapse(false)}},afterCollapse:function(a){this.collapsed=true;this.el.addClass(this.collapsedCls);if(a!==false){this[this.collapseEl].hide(this.hideMode)}this.afterEffect(a);this.cascade(function(b){if(b.lastSize){b.lastSize={width:undefined,height:undefined}}});this.fireEvent("collapse",this)},expand:function(b){if(!this.collapsed||this.el.hasFxBlock()||this.fireEvent("beforeexpand",this,b)===false){return}var a=b===true||(b!==false&&this.animCollapse);this.el.removeClass(this.collapsedCls);this.beforeEffect(a);this.onExpand(a,b);return this},onExpand:function(a,b){if(a){this[this.collapseEl].slideIn(this.slideAnchor,Ext.apply(this.createEffect(b||true,this.afterExpand,this),this.expandDefaults))}else{this[this.collapseEl].show(this.hideMode);this.afterExpand(false)}},afterExpand:function(a){this.collapsed=false;if(a!==false){this[this.collapseEl].show(this.hideMode)}this.afterEffect(a);if(this.deferLayout){delete this.deferLayout;this.doLayout(true)}this.fireEvent("expand",this)},toggleCollapse:function(a){this[this.collapsed?"expand":"collapse"](a);return this},onDisable:function(){if(this.rendered&&this.maskDisabled){this.el.mask()}Ext.Panel.superclass.onDisable.call(this)},onEnable:function(){if(this.rendered&&this.maskDisabled){this.el.unmask()}Ext.Panel.superclass.onEnable.call(this)},onResize:function(g,d,c,e){var a=g,b=d;if(Ext.isDefined(a)||Ext.isDefined(b)){if(!this.collapsed){if(Ext.isNumber(a)){this.body.setWidth(a=this.adjustBodyWidth(a-this.getFrameWidth()))}else{if(a=="auto"){a=this.body.setWidth("auto").dom.offsetWidth}else{a=this.body.dom.offsetWidth}}if(this.tbar){this.tbar.setWidth(a);if(this.topToolbar){this.topToolbar.setSize(a)}}if(this.bbar){this.bbar.setWidth(a);if(this.bottomToolbar){this.bottomToolbar.setSize(a);if(Ext.isIE){this.bbar.setStyle("position","static");this.bbar.setStyle("position","")}}}if(this.footer){this.footer.setWidth(a);if(this.fbar){this.fbar.setSize(Ext.isIE?(a-this.footer.getFrameWidth("lr")):"auto")}}if(Ext.isNumber(b)){b=Math.max(0,b-this.getFrameHeight());this.body.setHeight(b)}else{if(b=="auto"){this.body.setHeight(b)}}if(this.disabled&&this.el._mask){this.el._mask.setSize(this.el.dom.clientWidth,this.el.getHeight())}}else{this.queuedBodySize={width:a,height:b};if(!this.queuedExpand&&this.allowQueuedExpand!==false){this.queuedExpand=true;this.on("expand",function(){delete this.queuedExpand;this.onResize(this.queuedBodySize.width,this.queuedBodySize.height)},this,{single:true})}}this.onBodyResize(a,b)}this.syncShadow();Ext.Panel.superclass.onResize.call(this,g,d,c,e)},onBodyResize:function(a,b){this.fireEvent("bodyresize",this,a,b)},getToolbarHeight:function(){var a=0;if(this.rendered){Ext.each(this.toolbars,function(b){a+=b.getHeight()},this)}return a},adjustBodyHeight:function(a){return a},adjustBodyWidth:function(a){return a},onPosition:function(){this.syncShadow()},getFrameWidth:function(){var b=this.el.getFrameWidth("lr")+this.bwrap.getFrameWidth("lr");if(this.frame){var a=this.bwrap.dom.firstChild;b+=(Ext.fly(a).getFrameWidth("l")+Ext.fly(a.firstChild).getFrameWidth("r"));b+=this.mc.getFrameWidth("lr")}return b},getFrameHeight:function(){var a=this.el.getFrameWidth("tb")+this.bwrap.getFrameWidth("tb");a+=(this.tbar?this.tbar.getHeight():0)+(this.bbar?this.bbar.getHeight():0);if(this.frame){a+=this.el.dom.firstChild.offsetHeight+this.ft.dom.offsetHeight+this.mc.getFrameWidth("tb")}else{a+=(this.header?this.header.getHeight():0)+(this.footer?this.footer.getHeight():0)}return a},getInnerWidth:function(){return this.getSize().width-this.getFrameWidth()},getInnerHeight:function(){return this.body.getHeight()},syncShadow:function(){if(this.floating){this.el.sync(true)}},getLayoutTarget:function(){return this.body},getContentTarget:function(){return this.body},setTitle:function(b,a){this.title=b;if(this.header&&this.headerAsText){this.header.child("span").update(b)}if(a){this.setIconClass(a)}this.fireEvent("titlechange",this,b);return this},getUpdater:function(){return this.body.getUpdater()},load:function(){var a=this.body.getUpdater();a.update.apply(a,arguments);return this},beforeDestroy:function(){Ext.Panel.superclass.beforeDestroy.call(this);if(this.header){this.header.removeAllListeners()}if(this.tools){for(var a in this.tools){Ext.destroy(this.tools[a])}}if(this.toolbars.length>0){Ext.each(this.toolbars,function(b){b.un("afterlayout",this.syncHeight,this);b.un("remove",this.syncHeight,this)},this)}if(Ext.isArray(this.buttons)){while(this.buttons.length){Ext.destroy(this.buttons[0])}}if(this.rendered){Ext.destroy(this.ft,this.header,this.footer,this.tbar,this.bbar,this.body,this.mc,this.bwrap,this.dd);if(this.fbar){Ext.destroy(this.fbar,this.fbar.el)}}Ext.destroy(this.toolbars)},createClasses:function(){this.headerCls=this.baseCls+"-header";this.headerTextCls=this.baseCls+"-header-text";this.bwrapCls=this.baseCls+"-bwrap";this.tbarCls=this.baseCls+"-tbar";this.bodyCls=this.baseCls+"-body";this.bbarCls=this.baseCls+"-bbar";this.footerCls=this.baseCls+"-footer"},createGhost:function(a,e,b){var d=document.createElement("div");d.className="x-panel-ghost "+(a?a:"");if(this.header){d.appendChild(this.el.dom.firstChild.cloneNode(true))}Ext.fly(d.appendChild(document.createElement("ul"))).setHeight(this.bwrap.getHeight());d.style.width=this.el.dom.offsetWidth+"px";if(!b){this.container.dom.appendChild(d)}else{Ext.getDom(b).appendChild(d)}if(e!==false&&this.el.useShim!==false){var c=new Ext.Layer({shadow:false,useDisplay:true,constrain:false},d);c.show();return c}else{return new Ext.Element(d)}},doAutoLoad:function(){var a=this.body.getUpdater();if(this.renderer){a.setRenderer(this.renderer)}a.update(Ext.isObject(this.autoLoad)?this.autoLoad:{url:this.autoLoad})},getTool:function(a){return this.tools[a]}});Ext.reg("panel",Ext.Panel);Ext.Editor=function(b,a){if(b.field){this.field=Ext.create(b.field,"textfield");a=Ext.apply({},b);delete a.field}else{this.field=b}Ext.Editor.superclass.constructor.call(this,a)};Ext.extend(Ext.Editor,Ext.Component,{allowBlur:true,value:"",alignment:"c-c?",offsets:[0,0],shadow:"frame",constrain:false,swallowKeys:true,completeOnEnter:true,cancelOnEsc:true,updateEl:false,initComponent:function(){Ext.Editor.superclass.initComponent.call(this);this.addEvents("beforestartedit","startedit","beforecomplete","complete","canceledit","specialkey")},onRender:function(b,a){this.el=new Ext.Layer({shadow:this.shadow,cls:"x-editor",parentEl:b,shim:this.shim,shadowOffset:this.shadowOffset||4,id:this.id,constrain:this.constrain});if(this.zIndex){this.el.setZIndex(this.zIndex)}this.el.setStyle("overflow",Ext.isGecko?"auto":"hidden");if(this.field.msgTarget!="title"){this.field.msgTarget="qtip"}this.field.inEditor=true;this.mon(this.field,{scope:this,blur:this.onBlur,specialkey:this.onSpecialKey});if(this.field.grow){this.mon(this.field,"autosize",this.el.sync,this.el,{delay:1})}this.field.render(this.el).show();this.field.getEl().dom.name="";if(this.swallowKeys){this.field.el.swallowEvent(["keypress","keydown"])}},onSpecialKey:function(g,d){var b=d.getKey(),a=this.completeOnEnter&&b==d.ENTER,c=this.cancelOnEsc&&b==d.ESC;if(a||c){d.stopEvent();if(a){this.completeEdit()}else{this.cancelEdit()}if(g.triggerBlur){g.triggerBlur()}}this.fireEvent("specialkey",g,d)},startEdit:function(b,c){if(this.editing){this.completeEdit()}this.boundEl=Ext.get(b);var a=c!==undefined?c:this.boundEl.dom.innerHTML;if(!this.rendered){this.render(this.parentEl||document.body)}if(this.fireEvent("beforestartedit",this,this.boundEl,a)!==false){this.startValue=a;this.field.reset();this.field.setValue(a);this.realign(true);this.editing=true;this.show()}},doAutoSize:function(){if(this.autoSize){var b=this.boundEl.getSize(),a=this.field.getSize();switch(this.autoSize){case"width":this.setSize(b.width,a.height);break;case"height":this.setSize(a.width,b.height);break;case"none":this.setSize(a.width,a.height);break;default:this.setSize(b.width,b.height)}}},setSize:function(a,b){delete this.field.lastSize;this.field.setSize(a,b);if(this.el){if(Ext.isGecko2||Ext.isOpera||(Ext.isIE7&&Ext.isStrict)){this.el.setSize(a,b)}this.el.sync()}},realign:function(a){if(a===true){this.doAutoSize()}this.el.alignTo(this.boundEl,this.alignment,this.offsets)},completeEdit:function(a){if(!this.editing){return}if(this.field.assertValue){this.field.assertValue()}var b=this.getValue();if(!this.field.isValid()){if(this.revertInvalid!==false){this.cancelEdit(a)}return}if(String(b)===String(this.startValue)&&this.ignoreNoChange){this.hideEdit(a);return}if(this.fireEvent("beforecomplete",this,b,this.startValue)!==false){b=this.getValue();if(this.updateEl&&this.boundEl){this.boundEl.update(b)}this.hideEdit(a);this.fireEvent("complete",this,b,this.startValue)}},onShow:function(){this.el.show();if(this.hideEl!==false){this.boundEl.hide()}this.field.show().focus(false,true);this.fireEvent("startedit",this.boundEl,this.startValue)},cancelEdit:function(a){if(this.editing){var b=this.getValue();this.setValue(this.startValue);this.hideEdit(a);this.fireEvent("canceledit",this,b,this.startValue)}},hideEdit:function(a){if(a!==true){this.editing=false;this.hide()}},onBlur:function(){if(this.allowBlur===true&&this.editing&&this.selectSameEditor!==true){this.completeEdit()}},onHide:function(){if(this.editing){this.completeEdit();return}this.field.blur();if(this.field.collapse){this.field.collapse()}this.el.hide();if(this.hideEl!==false){this.boundEl.show()}},setValue:function(a){this.field.setValue(a)},getValue:function(){return this.field.getValue()},beforeDestroy:function(){Ext.destroyMembers(this,"field");delete this.parentEl;delete this.boundEl}});Ext.reg("editor",Ext.Editor);Ext.ColorPalette=Ext.extend(Ext.Component,{itemCls:"x-color-palette",value:null,clickEvent:"click",ctype:"Ext.ColorPalette",allowReselect:false,colors:["000000","993300","333300","003300","003366","000080","333399","333333","800000","FF6600","808000","008000","008080","0000FF","666699","808080","FF0000","FF9900","99CC00","339966","33CCCC","3366FF","800080","969696","FF00FF","FFCC00","FFFF00","00FF00","00FFFF","00CCFF","993366","C0C0C0","FF99CC","FFCC99","FFFF99","CCFFCC","CCFFFF","99CCFF","CC99FF","FFFFFF"],initComponent:function(){Ext.ColorPalette.superclass.initComponent.call(this);this.addEvents("select");if(this.handler){this.on("select",this.handler,this.scope,true)}},onRender:function(b,a){this.autoEl={tag:"div",cls:this.itemCls};Ext.ColorPalette.superclass.onRender.call(this,b,a);var c=this.tpl||new Ext.XTemplate(' ');c.overwrite(this.el,this.colors);this.mon(this.el,this.clickEvent,this.handleClick,this,{delegate:"a"});if(this.clickEvent!="click"){this.mon(this.el,"click",Ext.emptyFn,this,{delegate:"a",preventDefault:true})}},afterRender:function(){Ext.ColorPalette.superclass.afterRender.call(this);if(this.value){var a=this.value;this.value=null;this.select(a,true)}},handleClick:function(b,a){b.preventDefault();if(!this.disabled){var d=a.className.match(/(?:^|\s)color-(.{6})(?:\s|$)/)[1];this.select(d.toUpperCase())}},select:function(b,a){b=b.replace("#","");if(b!=this.value||this.allowReselect){var c=this.el;if(this.value){c.child("a.color-"+this.value).removeClass("x-color-palette-sel")}c.child("a.color-"+b).addClass("x-color-palette-sel");this.value=b;if(a!==true){this.fireEvent("select",this,b)}}}});Ext.reg("colorpalette",Ext.ColorPalette);Ext.DatePicker=Ext.extend(Ext.BoxComponent,{todayText:"Today",okText:" OK ",cancelText:"Cancel",todayTip:"{0} (Spacebar)",minText:"This date is before the minimum date",maxText:"This date is after the maximum date",format:"m/d/y",disabledDaysText:"Disabled",disabledDatesText:"Disabled",monthNames:Date.monthNames,dayNames:Date.dayNames,nextText:"Next Month (Control+Right)",prevText:"Previous Month (Control+Left)",monthYearText:"Choose a month (Control+Up/Down to move years)",startDay:0,showToday:true,focusOnSelect:true,initHour:12,initComponent:function(){Ext.DatePicker.superclass.initComponent.call(this);this.value=this.value?this.value.clearTime(true):new Date().clearTime();this.addEvents("select");if(this.handler){this.on("select",this.handler,this.scope||this)}this.initDisabledDays()},initDisabledDays:function(){if(!this.disabledDatesRE&&this.disabledDates){var b=this.disabledDates,a=b.length-1,c="(?:";Ext.each(b,function(g,e){c+=Ext.isDate(g)?"^"+Ext.escapeRe(g.dateFormat(this.format))+"$":b[e];if(e!=a){c+="|"}},this);this.disabledDatesRE=new RegExp(c+")")}},setDisabledDates:function(a){if(Ext.isArray(a)){this.disabledDates=a;this.disabledDatesRE=null}else{this.disabledDatesRE=a}this.initDisabledDays();this.update(this.value,true)},setDisabledDays:function(a){this.disabledDays=a;this.update(this.value,true)},setMinDate:function(a){this.minDate=a;this.update(this.value,true)},setMaxDate:function(a){this.maxDate=a;this.update(this.value,true)},setValue:function(a){this.value=a.clearTime(true);this.update(this.value)},getValue:function(){return this.value},focus:function(){this.update(this.activeDate)},onEnable:function(a){Ext.DatePicker.superclass.onEnable.call(this);this.doDisabled(false);this.update(a?this.value:this.activeDate);if(Ext.isIE){this.el.repaint()}},onDisable:function(){Ext.DatePicker.superclass.onDisable.call(this);this.doDisabled(true);if(Ext.isIE&&!Ext.isIE8){Ext.each([].concat(this.textNodes,this.el.query("th span")),function(a){Ext.fly(a).repaint()})}},doDisabled:function(a){this.keyNav.setDisabled(a);this.prevRepeater.setDisabled(a);this.nextRepeater.setDisabled(a);if(this.showToday){this.todayKeyListener.setDisabled(a);this.todayBtn.setDisabled(a)}},onRender:function(e,b){var a=['','','",this.showToday?'':"",'
      
    '],c=this.dayNames,h;for(h=0;h<7;h++){var k=this.startDay+h;if(k>6){k=k-7}a.push("")}a[a.length]="";for(h=0;h<42;h++){if(h%7===0&&h!==0){a[a.length]=""}a[a.length]=''}a.push("
    ",c[k].substr(0,1),"
    ');var j=document.createElement("div");j.className="x-date-picker";j.innerHTML=a.join("");e.dom.insertBefore(j,b);this.el=Ext.get(j);this.eventEl=Ext.get(j.firstChild);this.prevRepeater=new Ext.util.ClickRepeater(this.el.child("td.x-date-left a"),{handler:this.showPrevMonth,scope:this,preventDefault:true,stopDefault:true});this.nextRepeater=new Ext.util.ClickRepeater(this.el.child("td.x-date-right a"),{handler:this.showNextMonth,scope:this,preventDefault:true,stopDefault:true});this.monthPicker=this.el.down("div.x-date-mp");this.monthPicker.enableDisplayMode("block");this.keyNav=new Ext.KeyNav(this.eventEl,{left:function(d){if(d.ctrlKey){this.showPrevMonth()}else{this.update(this.activeDate.add("d",-1))}},right:function(d){if(d.ctrlKey){this.showNextMonth()}else{this.update(this.activeDate.add("d",1))}},up:function(d){if(d.ctrlKey){this.showNextYear()}else{this.update(this.activeDate.add("d",-7))}},down:function(d){if(d.ctrlKey){this.showPrevYear()}else{this.update(this.activeDate.add("d",7))}},pageUp:function(d){this.showNextMonth()},pageDown:function(d){this.showPrevMonth()},enter:function(d){d.stopPropagation();return true},scope:this});this.el.unselectable();this.cells=this.el.select("table.x-date-inner tbody td");this.textNodes=this.el.query("table.x-date-inner tbody span");this.mbtn=new Ext.Button({text:" ",tooltip:this.monthYearText,renderTo:this.el.child("td.x-date-middle",true)});this.mbtn.el.child("em").addClass("x-btn-arrow");if(this.showToday){this.todayKeyListener=this.eventEl.addKeyListener(Ext.EventObject.SPACE,this.selectToday,this);var g=(new Date()).dateFormat(this.format);this.todayBtn=new Ext.Button({renderTo:this.el.child("td.x-date-bottom",true),text:String.format(this.todayText,g),tooltip:String.format(this.todayTip,g),handler:this.selectToday,scope:this})}this.mon(this.eventEl,"mousewheel",this.handleMouseWheel,this);this.mon(this.eventEl,"click",this.handleDateClick,this,{delegate:"a.x-date-date"});this.mon(this.mbtn,"click",this.showMonthPicker,this);this.onEnable(true)},createMonthPicker:function(){if(!this.monthPicker.dom.firstChild){var a=[''];for(var b=0;b<6;b++){a.push('",'",b===0?'':'')}a.push('","
    ',Date.getShortMonthName(b),"',Date.getShortMonthName(b+6),"
    ");this.monthPicker.update(a.join(""));this.mon(this.monthPicker,"click",this.onMonthClick,this);this.mon(this.monthPicker,"dblclick",this.onMonthDblClick,this);this.mpMonths=this.monthPicker.select("td.x-date-mp-month");this.mpYears=this.monthPicker.select("td.x-date-mp-year");this.mpMonths.each(function(c,d,e){e+=1;if((e%2)===0){c.dom.xmonth=5+Math.round(e*0.5)}else{c.dom.xmonth=Math.round((e-1)*0.5)}})}},showMonthPicker:function(){if(!this.disabled){this.createMonthPicker();var a=this.el.getSize();this.monthPicker.setSize(a);this.monthPicker.child("table").setSize(a);this.mpSelMonth=(this.activeDate||this.value).getMonth();this.updateMPMonth(this.mpSelMonth);this.mpSelYear=(this.activeDate||this.value).getFullYear();this.updateMPYear(this.mpSelYear);this.monthPicker.slideIn("t",{duration:0.2})}},updateMPYear:function(e){this.mpyear=e;var c=this.mpYears.elements;for(var b=1;b<=10;b++){var d=c[b-1],a;if((b%2)===0){a=e+Math.round(b*0.5);d.firstChild.innerHTML=a;d.xyear=a}else{a=e-(5-Math.round(b*0.5));d.firstChild.innerHTML=a;d.xyear=a}this.mpYears.item(b-1)[a==this.mpSelYear?"addClass":"removeClass"]("x-date-mp-sel")}},updateMPMonth:function(a){this.mpMonths.each(function(b,c,d){b[b.dom.xmonth==a?"addClass":"removeClass"]("x-date-mp-sel")})},selectMPMonth:function(a){},onMonthClick:function(g,b){g.stopEvent();var c=new Ext.Element(b),a;if(c.is("button.x-date-mp-cancel")){this.hideMonthPicker()}else{if(c.is("button.x-date-mp-ok")){var h=new Date(this.mpSelYear,this.mpSelMonth,(this.activeDate||this.value).getDate());if(h.getMonth()!=this.mpSelMonth){h=new Date(this.mpSelYear,this.mpSelMonth,1).getLastDateOfMonth()}this.update(h);this.hideMonthPicker()}else{if((a=c.up("td.x-date-mp-month",2))){this.mpMonths.removeClass("x-date-mp-sel");a.addClass("x-date-mp-sel");this.mpSelMonth=a.dom.xmonth}else{if((a=c.up("td.x-date-mp-year",2))){this.mpYears.removeClass("x-date-mp-sel");a.addClass("x-date-mp-sel");this.mpSelYear=a.dom.xyear}else{if(c.is("a.x-date-mp-prev")){this.updateMPYear(this.mpyear-10)}else{if(c.is("a.x-date-mp-next")){this.updateMPYear(this.mpyear+10)}}}}}}},onMonthDblClick:function(d,b){d.stopEvent();var c=new Ext.Element(b),a;if((a=c.up("td.x-date-mp-month",2))){this.update(new Date(this.mpSelYear,a.dom.xmonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker()}else{if((a=c.up("td.x-date-mp-year",2))){this.update(new Date(a.dom.xyear,this.mpSelMonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker()}}},hideMonthPicker:function(a){if(this.monthPicker){if(a===true){this.monthPicker.hide()}else{this.monthPicker.slideOut("t",{duration:0.2})}}},showPrevMonth:function(a){this.update(this.activeDate.add("mo",-1))},showNextMonth:function(a){this.update(this.activeDate.add("mo",1))},showPrevYear:function(){this.update(this.activeDate.add("y",-1))},showNextYear:function(){this.update(this.activeDate.add("y",1))},handleMouseWheel:function(a){a.stopEvent();if(!this.disabled){var b=a.getWheelDelta();if(b>0){this.showPrevMonth()}else{if(b<0){this.showNextMonth()}}}},handleDateClick:function(b,a){b.stopEvent();if(!this.disabled&&a.dateValue&&!Ext.fly(a.parentNode).hasClass("x-date-disabled")){this.cancelFocus=this.focusOnSelect===false;this.setValue(new Date(a.dateValue));delete this.cancelFocus;this.fireEvent("select",this,this.value)}},selectToday:function(){if(this.todayBtn&&!this.todayBtn.disabled){this.setValue(new Date().clearTime());this.fireEvent("select",this,this.value)}},update:function(G,A){if(this.rendered){var a=this.activeDate,p=this.isVisible();this.activeDate=G;if(!A&&a&&this.el){var o=G.getTime();if(a.getMonth()==G.getMonth()&&a.getFullYear()==G.getFullYear()){this.cells.removeClass("x-date-selected");this.cells.each(function(d){if(d.dom.firstChild.dateValue==o){d.addClass("x-date-selected");if(p&&!this.cancelFocus){Ext.fly(d.dom.firstChild).focus(50)}return false}},this);return}}var k=G.getDaysInMonth(),q=G.getFirstDateOfMonth(),g=q.getDay()-this.startDay;if(g<0){g+=7}k+=g;var B=G.add("mo",-1),h=B.getDaysInMonth()-g,e=this.cells.elements,r=this.textNodes,D=(new Date(B.getFullYear(),B.getMonth(),h,this.initHour)),C=new Date().clearTime().getTime(),v=G.clearTime(true).getTime(),u=this.minDate?this.minDate.clearTime(true):Number.NEGATIVE_INFINITY,y=this.maxDate?this.maxDate.clearTime(true):Number.POSITIVE_INFINITY,F=this.disabledDatesRE,s=this.disabledDatesText,I=this.disabledDays?this.disabledDays.join(""):false,E=this.disabledDaysText,z=this.format;if(this.showToday){var m=new Date().clearTime(),c=(my||(F&&z&&F.test(m.dateFormat(z)))||(I&&I.indexOf(m.getDay())!=-1));if(!this.disabled){this.todayBtn.setDisabled(c);this.todayKeyListener[c?"disable":"enable"]()}}var l=function(J,d){d.title="";var i=D.clearTime(true).getTime();d.firstChild.dateValue=i;if(i==C){d.className+=" x-date-today";d.title=J.todayText}if(i==v){d.className+=" x-date-selected";if(p){Ext.fly(d.firstChild).focus(50)}}if(iy){d.className=" x-date-disabled";d.title=J.maxText;return}if(I){if(I.indexOf(D.getDay())!=-1){d.title=E;d.className=" x-date-disabled"}}if(F&&z){var w=D.dateFormat(z);if(F.test(w)){d.title=s.replace("%0",w);d.className=" x-date-disabled"}}};var x=0;for(;x=a.value){d=a.value}}c.setValue(b,d,false);c.fireEvent("drag",c,g,this)},getNewValue:function(){var a=this.slider,b=a.innerEl.translatePoints(this.tracker.getXY());return Ext.util.Format.round(a.reverseValue(b.left),a.decimalPrecision)},onDragEnd:function(c){var a=this.slider,b=this.value;this.el.removeClass("x-slider-thumb-drag");this.dragging=false;a.fireEvent("dragend",a,c);if(this.dragStartValue!=b){a.fireEvent("changecomplete",a,b,this)}},destroy:function(){Ext.destroyMembers(this,"tracker","el")}});Ext.slider.MultiSlider=Ext.extend(Ext.BoxComponent,{vertical:false,minValue:0,maxValue:100,decimalPrecision:0,keyIncrement:1,increment:0,clickRange:[5,15],clickToChange:true,animate:true,constrainThumbs:true,topThumbZIndex:10000,initComponent:function(){if(!Ext.isDefined(this.value)){this.value=this.minValue}this.thumbs=[];Ext.slider.MultiSlider.superclass.initComponent.call(this);this.keyIncrement=Math.max(this.increment,this.keyIncrement);this.addEvents("beforechange","change","changecomplete","dragstart","drag","dragend");if(this.values==undefined||Ext.isEmpty(this.values)){this.values=[0]}var a=this.values;for(var b=0;bthis.clickRange[0]&&c.top=c){d+=c}else{if(a*2<-c){d-=c}}}return d.constrain(this.minValue,this.maxValue)},afterRender:function(){Ext.slider.MultiSlider.superclass.afterRender.apply(this,arguments);for(var c=0;ce?e:c.value}this.syncThumb()},setValue:function(d,c,b,g){var a=this.thumbs[d],e=a.el;c=this.normalizeValue(c);if(c!==a.value&&this.fireEvent("beforechange",this,c,a.value,a)!==false){a.value=c;if(this.rendered){this.moveThumb(d,this.translateValue(c),b!==false);this.fireEvent("change",this,c,a);if(g){this.fireEvent("changecomplete",this,c,a)}}}},translateValue:function(a){var b=this.getRatio();return(a*b)-(this.minValue*b)-this.halfThumb},reverseValue:function(b){var a=this.getRatio();return(b+(this.minValue*a))/a},moveThumb:function(d,c,b){var a=this.thumbs[d].el;if(!b||this.animate===false){a.setLeft(c)}else{a.shift({left:c,stopFx:true,duration:0.35})}},focus:function(){this.focusEl.focus(10)},onResize:function(c,e){var b=this.thumbs,a=b.length,d=0;for(;dthis.clickRange[0]&&c.left','
    ','
    ','
    ',"
     
    ","
    ","
    ",'
    ',"
     
    ","
    ","
    ","");this.el=a?c.insertBefore(a,{cls:this.baseCls},true):c.append(d,{cls:this.baseCls},true);if(this.id){this.el.dom.id=this.id}var b=this.el.dom.firstChild;this.progressBar=Ext.get(b.firstChild);if(this.textEl){this.textEl=Ext.get(this.textEl);delete this.textTopEl}else{this.textTopEl=Ext.get(this.progressBar.dom.firstChild);var e=Ext.get(b.childNodes[1]);this.textTopEl.setStyle("z-index",99).addClass("x-hidden");this.textEl=new Ext.CompositeElement([this.textTopEl.dom.firstChild,e.dom.firstChild]);this.textEl.setWidth(b.offsetWidth)}this.progressBar.setHeight(b.offsetHeight)},afterRender:function(){Ext.ProgressBar.superclass.afterRender.call(this);if(this.value){this.updateProgress(this.value,this.text)}else{this.updateText(this.text)}},updateProgress:function(c,d,b){this.value=c||0;if(d){this.updateText(d)}if(this.rendered&&!this.isDestroyed){var a=Math.floor(c*this.el.dom.firstChild.offsetWidth);this.progressBar.setWidth(a,b===true||(b!==false&&this.animate));if(this.textTopEl){this.textTopEl.removeClass("x-hidden").setWidth(a)}}this.fireEvent("update",this,c,d);return this},wait:function(b){if(!this.waitTimer){var a=this;b=b||{};this.updateText(b.text);this.waitTimer=Ext.TaskMgr.start({run:function(c){var d=b.increment||10;c-=1;this.updateProgress(((((c+d)%d)+1)*(100/d))*0.01,null,b.animate)},interval:b.interval||1000,duration:b.duration,onStop:function(){if(b.fn){b.fn.apply(b.scope||this)}this.reset()},scope:a})}return this},isWaiting:function(){return this.waitTimer!==null},updateText:function(a){this.text=a||" ";if(this.rendered){this.textEl.update(this.text)}return this},syncProgressBar:function(){if(this.value){this.updateProgress(this.value,this.text)}return this},setSize:function(a,c){Ext.ProgressBar.superclass.setSize.call(this,a,c);if(this.textTopEl){var b=this.el.dom.firstChild;this.textEl.setSize(b.offsetWidth,b.offsetHeight)}this.syncProgressBar();return this},reset:function(a){this.updateProgress(0);if(this.textTopEl){this.textTopEl.addClass("x-hidden")}this.clearTimer();if(a===true){this.hide()}return this},clearTimer:function(){if(this.waitTimer){this.waitTimer.onStop=null;Ext.TaskMgr.stop(this.waitTimer);this.waitTimer=null}},onDestroy:function(){this.clearTimer();if(this.rendered){if(this.textEl.isComposite){this.textEl.clear()}Ext.destroyMembers(this,"textEl","progressBar","textTopEl")}Ext.ProgressBar.superclass.onDestroy.call(this)}});Ext.reg("progress",Ext.ProgressBar);(function(){var a=Ext.EventManager;var b=Ext.lib.Dom;Ext.dd.DragDrop=function(e,c,d){if(e){this.init(e,c,d)}};Ext.dd.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true},moveOnly:false,unlock:function(){this.locked=false},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,b4StartDrag:function(c,d){},startDrag:function(c,d){},b4Drag:function(c){},onDrag:function(c){},onDragEnter:function(c,d){},b4DragOver:function(c){},onDragOver:function(c,d){},b4DragOut:function(c){},onDragOut:function(c,d){},b4DragDrop:function(c){},onDragDrop:function(c,d){},onInvalidDrop:function(c){},b4EndDrag:function(c){},endDrag:function(c){},b4MouseDown:function(c){},onMouseDown:function(c){},onMouseUp:function(c){},onAvailable:function(){},defaultPadding:{left:0,right:0,top:0,bottom:0},constrainTo:function(j,h,o){if(Ext.isNumber(h)){h={left:h,right:h,top:h,bottom:h}}h=h||this.defaultPadding;var l=Ext.get(this.getEl()).getBox(),d=Ext.get(j),n=d.getScroll(),k,e=d.dom;if(e==document.body){k={x:n.left,y:n.top,width:Ext.lib.Dom.getViewWidth(),height:Ext.lib.Dom.getViewHeight()}}else{var m=d.getXY();k={x:m[0],y:m[1],width:e.clientWidth,height:e.clientHeight}}var i=l.y-k.y,g=l.x-k.x;this.resetConstraints();this.setXConstraint(g-(h.left||0),k.width-g-l.width-(h.right||0),this.xTickSize);this.setYConstraint(i-(h.top||0),k.height-i-l.height-(h.bottom||0),this.yTickSize)},getEl:function(){if(!this._domRef){this._domRef=Ext.getDom(this.id)}return this._domRef},getDragEl:function(){return Ext.getDom(this.dragElId)},init:function(e,c,d){this.initTarget(e,c,d);a.on(this.id,"mousedown",this.handleMouseDown,this)},initTarget:function(e,c,d){this.config=d||{};this.DDM=Ext.dd.DDM;this.groups={};if(typeof e!=="string"){e=Ext.id(e)}this.id=e;this.addToGroup((c)?c:"default");this.handleElId=e;this.setDragElId(e);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();this.handleOnAvailable()},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false)},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable()},setPadding:function(e,c,g,d){if(!c&&0!==c){this.padding=[e,e,e,e]}else{if(!g&&0!==g){this.padding=[e,c,e,c]}else{this.padding=[e,c,g,d]}}},setInitPosition:function(g,e){var h=this.getEl();if(!this.DDM.verifyEl(h)){return}var d=g||0;var c=e||0;var i=b.getXY(h);this.initPageX=i[0]-d;this.initPageY=i[1]-c;this.lastPageX=i[0];this.lastPageY=i[1];this.setStartPosition(i)},setStartPosition:function(d){var c=d||b.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=c[0];this.startPageY=c[1]},addToGroup:function(c){this.groups[c]=true;this.DDM.regDragDrop(this,c)},removeFromGroup:function(c){if(this.groups[c]){delete this.groups[c]}this.DDM.removeDDFromGroup(this,c)},setDragElId:function(c){this.dragElId=c},setHandleElId:function(c){if(typeof c!=="string"){c=Ext.id(c)}this.handleElId=c;this.DDM.regHandle(this.id,c)},setOuterHandleElId:function(c){if(typeof c!=="string"){c=Ext.id(c)}a.on(c,"mousedown",this.handleMouseDown,this);this.setHandleElId(c);this.hasOuterHandles=true},unreg:function(){a.un(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this)},destroy:function(){this.unreg()},isLocked:function(){return(this.DDM.isLocked()||this.locked)},handleMouseDown:function(g,d){if(this.primaryButtonOnly&&g.button!=0){return}if(this.isLocked()){return}this.DDM.refreshCache(this.groups);var c=new Ext.lib.Point(Ext.lib.Event.getPageX(g),Ext.lib.Event.getPageY(g));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(c,this)){}else{if(this.clickValidator(g)){this.setStartPosition();this.b4MouseDown(g);this.onMouseDown(g);this.DDM.handleMouseDown(g,this);this.DDM.stopEvent(g)}else{}}},clickValidator:function(d){var c=d.getTarget();return(this.isValidHandleChild(c)&&(this.id==this.handleElId||this.DDM.handleWasClicked(c,this.id)))},addInvalidHandleType:function(c){var d=c.toUpperCase();this.invalidHandleTypes[d]=d},addInvalidHandleId:function(c){if(typeof c!=="string"){c=Ext.id(c)}this.invalidHandleIds[c]=c},addInvalidHandleClass:function(c){this.invalidHandleClasses.push(c)},removeInvalidHandleType:function(c){var d=c.toUpperCase();delete this.invalidHandleTypes[d]},removeInvalidHandleId:function(c){if(typeof c!=="string"){c=Ext.id(c)}delete this.invalidHandleIds[c]},removeInvalidHandleClass:function(d){for(var e=0,c=this.invalidHandleClasses.length;e=this.minX;d=d-c){if(!e[d]){this.xTicks[this.xTicks.length]=d;e[d]=true}}for(d=this.initPageX;d<=this.maxX;d=d+c){if(!e[d]){this.xTicks[this.xTicks.length]=d;e[d]=true}}this.xTicks.sort(this.DDM.numericSort)},setYTicks:function(g,c){this.yTicks=[];this.yTickSize=c;var e={};for(var d=this.initPageY;d>=this.minY;d=d-c){if(!e[d]){this.yTicks[this.yTicks.length]=d;e[d]=true}}for(d=this.initPageY;d<=this.maxY;d=d+c){if(!e[d]){this.yTicks[this.yTicks.length]=d;e[d]=true}}this.yTicks.sort(this.DDM.numericSort)},setXConstraint:function(e,d,c){this.leftConstraint=e;this.rightConstraint=d;this.minX=this.initPageX-e;this.maxX=this.initPageX+d;if(c){this.setXTicks(this.initPageX,c)}this.constrainX=true},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks()},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0},setYConstraint:function(c,e,d){this.topConstraint=c;this.bottomConstraint=e;this.minY=this.initPageY-c;this.maxY=this.initPageY+e;if(d){this.setYTicks(this.initPageY,d)}this.constrainY=true},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var d=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var c=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(d,c)}else{this.setInitPosition()}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize)}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize)}},getTick:function(k,g){if(!g){return k}else{if(g[0]>=k){return g[0]}else{for(var d=0,c=g.length;d=k){var j=k-g[d];var h=g[e]-k;return(h>j)?g[d]:g[e]}}return g[g.length-1]}}},toString:function(){return("DragDrop "+this.id)}}})();if(!Ext.dd.DragDropMgr){Ext.dd.DragDropMgr=function(){var a=Ext.EventManager;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,init:function(){this.initialized=true},POINT:0,INTERSECT:1,mode:0,_execOnAll:function(d,c){for(var e in this.ids){for(var b in this.ids[e]){var g=this.ids[e][b];if(!this.isTypeOfDD(g)){continue}g[d].apply(g,c)}}},_onLoad:function(){this.init();a.on(document,"mouseup",this.handleMouseUp,this,true);a.on(document,"mousemove",this.handleMouseMove,this,true);a.on(window,"unload",this._onUnload,this,true);a.on(window,"resize",this._onResize,this,true)},_onResize:function(b){this._execOnAll("resetConstraints",[])},lock:function(){this.locked=true},unlock:function(){this.locked=false},isLocked:function(){return this.locked},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:350,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,regDragDrop:function(c,b){if(!this.initialized){this.init()}if(!this.ids[b]){this.ids[b]={}}this.ids[b][c.id]=c},removeDDFromGroup:function(d,b){if(!this.ids[b]){this.ids[b]={}}var c=this.ids[b];if(c&&c[d.id]){delete c[d.id]}},_remove:function(c){for(var b in c.groups){if(b&&this.ids[b]&&this.ids[b][c.id]){delete this.ids[b][c.id]}}delete this.handleIds[c.id]},regHandle:function(c,b){if(!this.handleIds[c]){this.handleIds[c]={}}this.handleIds[c][b]=b},isDragDrop:function(b){return(this.getDDById(b))?true:false},getRelated:function(h,c){var g=[];for(var e in h.groups){for(var d in this.ids[e]){var b=this.ids[e][d];if(!this.isTypeOfDD(b)){continue}if(!c||b.isTarget){g[g.length]=b}}}return g},isLegalTarget:function(g,e){var c=this.getRelated(g,true);for(var d=0,b=c.length;dthis.clickPixelThresh||b>this.clickPixelThresh){this.startDrag(this.startX,this.startY)}}if(this.dragThreshMet){this.dragCurrent.b4Drag(d);this.dragCurrent.onDrag(d);if(!this.dragCurrent.moveOnly){this.fireEvents(d,false)}}this.stopEvent(d);return true},fireEvents:function(n,o){var q=this.dragCurrent;if(!q||q.isLocked()){return}var r=n.getPoint();var b=[];var g=[];var l=[];var j=[];var d=[];for(var h in this.dragOvers){var c=this.dragOvers[h];if(!this.isTypeOfDD(c)){continue}if(!this.isOverTarget(r,c,this.mode)){g.push(c)}b[h]=true;delete this.dragOvers[h]}for(var p in q.groups){if("string"!=typeof p){continue}for(h in this.ids[p]){var k=this.ids[p][h];if(!this.isTypeOfDD(k)){continue}if(k.isTarget&&!k.isLocked()&&((k!=q)||(q.ignoreSelf===false))){if(this.isOverTarget(r,k,this.mode)){if(o){j.push(k)}else{if(!b[k.id]){d.push(k)}else{l.push(k)}this.dragOvers[k.id]=k}}}}}if(this.mode){if(g.length){q.b4DragOut(n,g);q.onDragOut(n,g)}if(d.length){q.onDragEnter(n,d)}if(l.length){q.b4DragOver(n,l);q.onDragOver(n,l)}if(j.length){q.b4DragDrop(n,j);q.onDragDrop(n,j)}}else{var m=0;for(h=0,m=g.length;h2000){}else{setTimeout(b._addListeners,10);if(document&&document.body){b._timeoutCount+=1}}}},handleWasClicked:function(b,d){if(this.isHandle(d,b.id)){return true}else{var c=b.parentNode;while(c){if(this.isHandle(d,c.id)){return true}else{c=c.parentNode}}}return false}}}();Ext.dd.DDM=Ext.dd.DragDropMgr;Ext.dd.DDM._addListeners()}Ext.dd.DD=function(c,a,b){if(c){this.init(c,a,b)}};Ext.extend(Ext.dd.DD,Ext.dd.DragDrop,{scroll:true,autoOffset:function(c,b){var a=c-this.startPageX;var d=b-this.startPageY;this.setDelta(a,d)},setDelta:function(b,a){this.deltaX=b;this.deltaY=a},setDragElPos:function(c,b){var a=this.getDragEl();this.alignElWithMouse(a,c,b)},alignElWithMouse:function(c,h,g){var e=this.getTargetCoord(h,g);var b=c.dom?c:Ext.fly(c,"_dd");if(!this.deltaSetXY){var i=[e.x,e.y];b.setXY(i);var d=b.getLeft(true);var a=b.getTop(true);this.deltaSetXY=[d-e.x,a-e.y]}else{b.setLeftTop(e.x+this.deltaSetXY[0],e.y+this.deltaSetXY[1])}this.cachePosition(e.x,e.y);this.autoScroll(e.x,e.y,c.offsetHeight,c.offsetWidth);return e},cachePosition:function(b,a){if(b){this.lastPageX=b;this.lastPageY=a}else{var c=Ext.lib.Dom.getXY(this.getEl());this.lastPageX=c[0];this.lastPageY=c[1]}},autoScroll:function(l,k,e,m){if(this.scroll){var n=Ext.lib.Dom.getViewHeight();var b=Ext.lib.Dom.getViewWidth();var p=this.DDM.getScrollTop();var d=this.DDM.getScrollLeft();var j=e+k;var o=m+l;var i=(n+p-k-this.deltaY);var g=(b+d-l-this.deltaX);var c=40;var a=(document.all)?80:30;if(j>n&&i0&&k-pb&&g0&&l-dthis.maxX){a=this.maxX}}if(this.constrainY){if(dthis.maxY){d=this.maxY}}a=this.getTick(a,this.xTicks);d=this.getTick(d,this.yTicks);return{x:a,y:d}},applyConfig:function(){Ext.dd.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false)},b4MouseDown:function(a){this.autoOffset(a.getPageX(),a.getPageY())},b4Drag:function(a){this.setDragElPos(a.getPageX(),a.getPageY())},toString:function(){return("DD "+this.id)}});Ext.dd.DDProxy=function(c,a,b){if(c){this.init(c,a,b);this.initFrame()}};Ext.dd.DDProxy.dragElId="ygddfdiv";Ext.extend(Ext.dd.DDProxy,Ext.dd.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var b=this;var a=document.body;if(!a||!a.firstChild){setTimeout(function(){b.createFrame()},50);return}var d=this.getDragEl();if(!d){d=document.createElement("div");d.id=this.dragElId;var c=d.style;c.position="absolute";c.visibility="hidden";c.cursor="move";c.border="2px solid #aaa";c.zIndex=999;a.insertBefore(d,a.firstChild)}},initFrame:function(){this.createFrame()},applyConfig:function(){Ext.dd.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||Ext.dd.DDProxy.dragElId)},showFrame:function(e,d){var c=this.getEl();var a=this.getDragEl();var b=a.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(b.width,10)/2),Math.round(parseInt(b.height,10)/2))}this.setDragElPos(e,d);Ext.fly(a).show()},_resizeProxy:function(){if(this.resizeFrame){var a=this.getEl();Ext.fly(this.getDragEl()).setSize(a.offsetWidth,a.offsetHeight)}},b4MouseDown:function(b){var a=b.getPageX();var c=b.getPageY();this.autoOffset(a,c);this.setDragElPos(a,c)},b4StartDrag:function(a,b){this.showFrame(a,b)},b4EndDrag:function(a){Ext.fly(this.getDragEl()).hide()},endDrag:function(c){var b=this.getEl();var a=this.getDragEl();a.style.visibility="";this.beforeMove();b.style.visibility="hidden";Ext.dd.DDM.moveToEl(b,a);a.style.visibility="hidden";b.style.visibility="";this.afterDrag()},beforeMove:function(){},afterDrag:function(){},toString:function(){return("DDProxy "+this.id)}});Ext.dd.DDTarget=function(c,a,b){if(c){this.initTarget(c,a,b)}};Ext.extend(Ext.dd.DDTarget,Ext.dd.DragDrop,{getDragEl:Ext.emptyFn,isValidHandleChild:Ext.emptyFn,startDrag:Ext.emptyFn,endDrag:Ext.emptyFn,onDrag:Ext.emptyFn,onDragDrop:Ext.emptyFn,onDragEnter:Ext.emptyFn,onDragOut:Ext.emptyFn,onDragOver:Ext.emptyFn,onInvalidDrop:Ext.emptyFn,onMouseDown:Ext.emptyFn,onMouseUp:Ext.emptyFn,setXConstraint:Ext.emptyFn,setYConstraint:Ext.emptyFn,resetConstraints:Ext.emptyFn,clearConstraints:Ext.emptyFn,clearTicks:Ext.emptyFn,setInitPosition:Ext.emptyFn,setDragElId:Ext.emptyFn,setHandleElId:Ext.emptyFn,setOuterHandleElId:Ext.emptyFn,addInvalidHandleClass:Ext.emptyFn,addInvalidHandleId:Ext.emptyFn,addInvalidHandleType:Ext.emptyFn,removeInvalidHandleClass:Ext.emptyFn,removeInvalidHandleId:Ext.emptyFn,removeInvalidHandleType:Ext.emptyFn,toString:function(){return("DDTarget "+this.id)}});Ext.dd.DragTracker=Ext.extend(Ext.util.Observable,{active:false,tolerance:5,autoStart:false,constructor:function(a){Ext.apply(this,a);this.addEvents("mousedown","mouseup","mousemove","dragstart","dragend","drag");this.dragRegion=new Ext.lib.Region(0,0,0,0);if(this.el){this.initEl(this.el)}Ext.dd.DragTracker.superclass.constructor.call(this,a)},initEl:function(a){this.el=Ext.get(a);a.on("mousedown",this.onMouseDown,this,this.delegate?{delegate:this.delegate}:undefined)},destroy:function(){this.el.un("mousedown",this.onMouseDown,this);delete this.el},onMouseDown:function(b,a){if(this.fireEvent("mousedown",this,b)!==false&&this.onBeforeStart(b)!==false){this.startXY=this.lastXY=b.getXY();this.dragTarget=this.delegate?a:this.el.dom;if(this.preventDefault!==false){b.preventDefault()}Ext.getDoc().on({scope:this,mouseup:this.onMouseUp,mousemove:this.onMouseMove,selectstart:this.stopSelect});if(this.autoStart){this.timer=this.triggerStart.defer(this.autoStart===true?1000:this.autoStart,this,[b])}}},onMouseMove:function(d,c){if(this.active&&Ext.isIE&&!d.browserEvent.button){d.preventDefault();this.onMouseUp(d);return}d.preventDefault();var b=d.getXY(),a=this.startXY;this.lastXY=b;if(!this.active){if(Math.abs(a[0]-b[0])>this.tolerance||Math.abs(a[1]-b[1])>this.tolerance){this.triggerStart(d)}else{return}}this.fireEvent("mousemove",this,d);this.onDrag(d);this.fireEvent("drag",this,d)},onMouseUp:function(c){var b=Ext.getDoc(),a=this.active;b.un("mousemove",this.onMouseMove,this);b.un("mouseup",this.onMouseUp,this);b.un("selectstart",this.stopSelect,this);c.preventDefault();this.clearStart();this.active=false;delete this.elRegion;this.fireEvent("mouseup",this,c);if(a){this.onEnd(c);this.fireEvent("dragend",this,c)}},triggerStart:function(a){this.clearStart();this.active=true;this.onStart(a);this.fireEvent("dragstart",this,a)},clearStart:function(){if(this.timer){clearTimeout(this.timer);delete this.timer}},stopSelect:function(a){a.stopEvent();return false},onBeforeStart:function(a){},onStart:function(a){},onDrag:function(a){},onEnd:function(a){},getDragTarget:function(){return this.dragTarget},getDragCt:function(){return this.el},getXY:function(a){return a?this.constrainModes[a].call(this,this.lastXY):this.lastXY},getOffset:function(c){var b=this.getXY(c),a=this.startXY;return[a[0]-b[0],a[1]-b[1]]},constrainModes:{point:function(b){if(!this.elRegion){this.elRegion=this.getDragCt().getRegion()}var a=this.dragRegion;a.left=b[0];a.top=b[1];a.right=b[0];a.bottom=b[1];a.constrainTo(this.elRegion);return[a.left,a.top]}}});Ext.dd.ScrollManager=function(){var c=Ext.dd.DragDropMgr;var e={};var b=null;var i={};var h=function(l){b=null;a()};var j=function(){if(c.dragCurrent){c.refreshCache(c.dragCurrent.groups)}};var d=function(){if(c.dragCurrent){var l=Ext.dd.ScrollManager;var m=i.el.ddScrollConfig?i.el.ddScrollConfig.increment:l.increment;if(!l.animate){if(i.el.scroll(i.dir,m)){j()}}else{i.el.scroll(i.dir,m,true,l.animDuration,j)}}};var a=function(){if(i.id){clearInterval(i.id)}i.id=0;i.el=null;i.dir=""};var g=function(m,l){a();i.el=m;i.dir=l;var o=m.ddScrollConfig?m.ddScrollConfig.ddGroup:undefined,n=(m.ddScrollConfig&&m.ddScrollConfig.frequency)?m.ddScrollConfig.frequency:Ext.dd.ScrollManager.frequency;if(o===undefined||c.dragCurrent.ddGroup==o){i.id=setInterval(d,n)}};var k=function(o,q){if(q||!c.dragCurrent){return}var s=Ext.dd.ScrollManager;if(!b||b!=c.dragCurrent){b=c.dragCurrent;s.refreshCache()}var t=Ext.lib.Event.getXY(o);var u=new Ext.lib.Point(t[0],t[1]);for(var m in e){var n=e[m],l=n._region;var p=n.ddScrollConfig?n.ddScrollConfig:s;if(l&&l.contains(u)&&n.isScrollable()){if(l.bottom-u.y<=p.vthresh){if(i.el!=n){g(n,"down")}return}else{if(l.right-u.x<=p.hthresh){if(i.el!=n){g(n,"left")}return}else{if(u.y-l.top<=p.vthresh){if(i.el!=n){g(n,"up")}return}else{if(u.x-l.left<=p.hthresh){if(i.el!=n){g(n,"right")}return}}}}}}a()};c.fireEvents=c.fireEvents.createSequence(k,c);c.stopDrag=c.stopDrag.createSequence(h,c);return{register:function(n){if(Ext.isArray(n)){for(var m=0,l=n.length;m]+>/gi,asText:function(a){return String(a).replace(this.stripTagsRE,"")},asUCText:function(a){return String(a).toUpperCase().replace(this.stripTagsRE,"")},asUCString:function(a){return String(a).toUpperCase()},asDate:function(a){if(!a){return 0}if(Ext.isDate(a)){return a.getTime()}return Date.parse(String(a))},asFloat:function(a){var b=parseFloat(String(a).replace(/,/g,""));return isNaN(b)?0:b},asInt:function(a){var b=parseInt(String(a).replace(/,/g,""),10);return isNaN(b)?0:b}};Ext.data.Record=function(a,b){this.id=(b||b===0)?b:Ext.data.Record.id(this);this.data=a||{}};Ext.data.Record.create=function(e){var c=Ext.extend(Ext.data.Record,{});var d=c.prototype;d.fields=new Ext.util.MixedCollection(false,function(g){return g.name});for(var b=0,a=e.length;b-1){a.join(null);this.data.removeAt(b)}if(this.pruneModifiedRecords){this.modified.remove(a)}if(this.snapshot){this.snapshot.remove(a)}if(b>-1){this.fireEvent("remove",this,a,b)}},removeAt:function(a){this.remove(this.getAt(a))},removeAll:function(b){var a=[];this.each(function(c){a.push(c)});this.clearData();if(this.snapshot){this.snapshot.clear()}if(this.pruneModifiedRecords){this.modified=[]}if(b!==true){this.fireEvent("clear",this,a)}},onClear:function(b,a){Ext.each(a,function(d,c){this.destroyRecord(this,d,c)},this)},insert:function(d,c){var e,a,b;c=[].concat(c);for(e=0,a=c.length;e=0;d--){if(b[d].phantom===true){var a=b.splice(d,1).shift();if(a.isValid()){g.push(a)}}else{if(!b[d].isValid()){b.splice(d,1)}}}if(g.length){h.push(["create",g])}if(b.length){h.push(["update",b])}}j=h.length;if(j){e=++this.batchCounter;for(d=0;d=0;b--){this.modified.splice(this.modified.indexOf(a[b]),1)}}else{this.modified.splice(this.modified.indexOf(a),1)}},reMap:function(b){if(Ext.isArray(b)){for(var d=0,a=b.length;d=0;c--){this.insert(b[c].lastIndex,b[c])}}},handleException:function(a){Ext.handleError(a)},reload:function(a){this.load(Ext.applyIf(a||{},this.lastOptions))},loadRecords:function(b,l,h){var e,g;if(this.isDestroyed===true){return}if(!b||h===false){if(h!==false){this.fireEvent("load",this,[],l)}if(l.callback){l.callback.call(l.scope||this,[],l,false,b)}return}var a=b.records,j=b.totalRecords||a.length;if(!l||l.add!==true){if(this.pruneModifiedRecords){this.modified=[]}for(e=0,g=a.length;e-1){this.doUpdate(d)}else{k.push(d);++c}}this.totalLength=Math.max(j,this.data.length+c);this.add(k)}this.fireEvent("load",this,a,l);if(l.callback){l.callback.call(l.scope||this,a,l,true)}},loadData:function(c,a){var b=this.reader.readRecords(c);this.loadRecords(b,{add:a},true)},getCount:function(){return this.data.length||0},getTotalCount:function(){return this.totalLength||0},getSortState:function(){return this.sortInfo},applySort:function(){if((this.sortInfo||this.multiSortInfo)&&!this.remoteSort){this.sortData()}},sortData:function(){var a=this.hasMultiSort?this.multiSortInfo:this.sortInfo,k=a.direction||"ASC",h=a.sorters,c=[];if(!this.hasMultiSort){h=[{direction:k,field:a.field}]}for(var d=0,b=h.length;d1){for(var p=1,o=c.length;ph?1:(i=0;b--){if(Ext.isArray(c)){this.realize(a.splice(b,1).shift(),c.splice(b,1).shift())}else{this.realize(a.splice(b,1).shift(),c)}}}else{if(Ext.isArray(c)&&c.length==1){c=c.shift()}if(!this.isData(c)){throw new Ext.data.DataReader.Error("realize",a)}a.phantom=false;a._phid=a.id;a.id=this.getId(c);a.data=c;a.commit();a.store.reMap(a)}},update:function(a,c){if(Ext.isArray(a)){for(var b=a.length-1;b>=0;b--){if(Ext.isArray(c)){this.update(a.splice(b,1).shift(),c.splice(b,1).shift())}else{this.update(a.splice(b,1).shift(),c)}}}else{if(Ext.isArray(c)&&c.length==1){c=c.shift()}if(this.isData(c)){a.data=Ext.apply(a.data,c)}a.commit()}},extractData:function(k,a){var j=(this instanceof Ext.data.JsonReader)?"json":"node";var c=[];if(this.isData(k)&&!(this instanceof Ext.data.XmlReader)){k=[k]}var h=this.recordType.prototype.fields,o=h.items,m=h.length,c=[];if(a===true){var l=this.recordType;for(var e=0;e=0){return new Function("obj","return obj"+(b>0?".":"")+c)}return function(d){return d[c]}}}(),extractValues:function(h,d,a){var g,c={};for(var e=0;e<\u003fxml version="{version}" encoding="{encoding}"\u003f><{documentRoot}><{name}>{value}<{root}><{parent.record}><{name}>{value}',render:function(b,c,a){c=this.toArray(c);b.xmlData=this.tpl.applyTemplate({version:this.xmlVersion,encoding:this.xmlEncoding,documentRoot:(c.length>0||this.forceDocumentRoot===true)?this.documentRoot:false,record:this.meta.record,root:this.root,baseParams:c,records:(Ext.isArray(a[0]))?a:[a]})},createRecord:function(a){return this.toArray(this.toHash(a))},updateRecord:function(a){return this.toArray(this.toHash(a))},destroyRecord:function(b){var a={};a[this.meta.idProperty]=b.id;return this.toArray(a)}});Ext.data.XmlReader=function(a,b){a=a||{};Ext.applyIf(a,{idProperty:a.idProperty||a.idPath||a.id,successProperty:a.successProperty||a.success});Ext.data.XmlReader.superclass.constructor.call(this,a,b||a.fields)};Ext.extend(Ext.data.XmlReader,Ext.data.DataReader,{read:function(a){var b=a.responseXML;if(!b){throw {message:"XmlReader.read: XML Document not available"}}return this.readRecords(b)},readRecords:function(d){this.xmlData=d;var a=d.documentElement||d,c=Ext.DomQuery,g=0,e=true;if(this.meta.totalProperty){g=this.getTotal(a,0)}if(this.meta.successProperty){e=this.getSuccess(a)}var b=this.extractData(c.select(this.meta.record,a),true);return{success:e,records:b,totalRecords:g||b.length}},readResponse:function(g,b){var e=Ext.DomQuery,h=b.responseXML,a=h.documentElement||h;var c=new Ext.data.Response({action:g,success:this.getSuccess(a),message:this.getMessage(a),data:this.extractData(e.select(this.meta.record,a)||e.select(this.meta.root,a),false),raw:h});if(Ext.isEmpty(c.success)){throw new Ext.data.DataReader.Error("successProperty-response",this.meta.successProperty)}if(g===Ext.data.Api.actions.create){var d=Ext.isDefined(c.data);if(d&&Ext.isEmpty(c.data)){throw new Ext.data.JsonReader.Error("root-empty",this.meta.root)}else{if(!d){throw new Ext.data.JsonReader.Error("root-undefined-response",this.meta.root)}}}return c},getSuccess:function(){return true},buildExtractors:function(){if(this.ef){return}var l=this.meta,h=this.recordType,e=h.prototype.fields,k=e.items,j=e.length;if(l.totalProperty){this.getTotal=this.createAccessor(l.totalProperty)}if(l.successProperty){this.getSuccess=this.createAccessor(l.successProperty)}if(l.messageProperty){this.getMessage=this.createAccessor(l.messageProperty)}this.getRoot=function(g){return(!Ext.isEmpty(g[this.meta.record]))?g[this.meta.record]:g[this.meta.root]};if(l.idPath||l.idProperty){var d=this.createAccessor(l.idPath||l.idProperty);this.getId=function(g){var i=d(g)||g.id;return(i===undefined||i==="")?null:i}}else{this.getId=function(){return null}}var c=[];for(var b=0;b0&&c[0].field==this.groupField){c.shift()}this.groupField=e;this.groupDir=d;this.applyGroupField();var b=function(){this.fireEvent("groupchange",this,this.getGroupState())};if(this.groupOnSort){this.sort(e,d);b.call(this);return}if(this.remoteGroup){this.on("load",b,this,{single:true});this.reload()}else{this.sort(c);b.call(this)}},sort:function(h,c){if(this.remoteSort){return Ext.data.GroupingStore.superclass.sort.call(this,h,c)}var g=[];if(Ext.isArray(arguments[0])){g=arguments[0]}else{if(h==undefined){g=this.sortInfo?[this.sortInfo]:[]}else{var e=this.fields.get(h);if(!e){return false}var b=e.name,a=this.sortInfo||null,d=this.sortToggle?this.sortToggle[b]:null;if(!c){if(a&&a.field==b){c=(this.sortToggle[b]||"ASC").toggle("ASC","DESC")}else{c=e.sortDir}}this.sortToggle[b]=c;this.sortInfo={field:b,direction:c};g=[this.sortInfo]}}if(this.groupField){g.unshift({direction:this.groupDir,field:this.groupField})}return this.multiSort.call(this,g,c)},applyGroupField:function(){if(this.remoteGroup){if(!this.baseParams){this.baseParams={}}Ext.apply(this.baseParams,{groupBy:this.groupField,groupDir:this.groupDir});var a=this.lastOptions;if(a&&a.params){a.params.groupDir=this.groupDir;delete a.params.groupBy}}},applyGrouping:function(a){if(this.groupField!==false){this.groupBy(this.groupField,true,this.groupDir);return true}else{if(a===true){this.fireEvent("datachanged",this)}return false}},getGroupState:function(){return this.groupOnSort&&this.groupField!==false?(this.sortInfo?this.sortInfo.field:undefined):this.groupField}});Ext.reg("groupingstore",Ext.data.GroupingStore);Ext.data.DirectProxy=function(a){Ext.apply(this,a);if(typeof this.paramOrder=="string"){this.paramOrder=this.paramOrder.split(/[\s,|]/)}Ext.data.DirectProxy.superclass.constructor.call(this,a)};Ext.extend(Ext.data.DirectProxy,Ext.data.DataProxy,{paramOrder:undefined,paramsAsHash:true,directFn:undefined,doRequest:function(b,c,a,e,k,l,n){var j=[],h=this.api[b]||this.directFn;switch(b){case Ext.data.Api.actions.create:j.push(a.jsonData);break;case Ext.data.Api.actions.read:if(h.directCfg.method.len>0){if(this.paramOrder){for(var d=0,g=this.paramOrder.length;d1){for(var d=0,b=c.length;d0){this.doSend(a==1?this.callBuffer[0]:this.callBuffer);this.callBuffer=[]}},queueTransaction:function(a){if(a.form){this.processForm(a);return}this.callBuffer.push(a);if(this.enableBuffer){if(!this.callTask){this.callTask=new Ext.util.DelayedTask(this.combineAndSend,this)}this.callTask.delay(Ext.isNumber(this.enableBuffer)?this.enableBuffer:10)}else{this.combineAndSend()}},doCall:function(i,a,b){var h=null,e=b[a.len],g=b[a.len+1];if(a.len!==0){h=b.slice(0,a.len)}var d=new Ext.Direct.Transaction({provider:this,args:b,action:i,method:a.name,data:h,cb:g&&Ext.isFunction(e)?e.createDelegate(g):e});if(this.fireEvent("beforecall",this,d,a)!==false){Ext.Direct.addTransaction(d);this.queueTransaction(d);this.fireEvent("call",this,d,a)}},doForm:function(j,b,g,i,e){var d=new Ext.Direct.Transaction({provider:this,action:j,method:b.name,args:[g,i,e],cb:e&&Ext.isFunction(i)?i.createDelegate(e):i,isForm:true});if(this.fireEvent("beforecall",this,d,b)!==false){Ext.Direct.addTransaction(d);var a=String(g.getAttribute("enctype")).toLowerCase()=="multipart/form-data",h={extTID:d.tid,extAction:j,extMethod:b.name,extType:"rpc",extUpload:String(a)};Ext.apply(d,{form:Ext.getDom(g),isUpload:a,params:i&&Ext.isObject(i.params)?Ext.apply(h,i.params):h});this.fireEvent("call",this,d,b);this.processForm(d)}},processForm:function(a){Ext.Ajax.request({url:this.url,params:a.params,callback:this.onData,scope:this,form:a.form,isUpload:a.isUpload,ts:a})},createMethod:function(d,a){var b;if(!a.formHandler){b=function(){this.doCall(d,a,Array.prototype.slice.call(arguments,0))}.createDelegate(this)}else{b=function(e,g,c){this.doForm(d,a,e,g,c)}.createDelegate(this)}b.directCfg={action:d,method:a};return b},getTransaction:function(a){return a&&a.tid?Ext.Direct.getTransaction(a.tid):null},doCallback:function(c,g){var d=g.status?"success":"failure";if(c&&c.cb){var b=c.cb,a=Ext.isDefined(g.result)?g.result:g.data;if(Ext.isFunction(b)){b(a,g)}else{Ext.callback(b[d],b.scope,[a,g]);Ext.callback(b.callback,b.scope,[a,g])}}}});Ext.Direct.PROVIDERS.remoting=Ext.direct.RemotingProvider;Ext.Resizable=Ext.extend(Ext.util.Observable,{constructor:function(d,e){this.el=Ext.get(d);if(e&&e.wrap){e.resizeChild=this.el;this.el=this.el.wrap(typeof e.wrap=="object"?e.wrap:{cls:"xresizable-wrap"});this.el.id=this.el.dom.id=e.resizeChild.id+"-rzwrap";this.el.setStyle("overflow","hidden");this.el.setPositioning(e.resizeChild.getPositioning());e.resizeChild.clearPositioning();if(!e.width||!e.height){var g=e.resizeChild.getSize();this.el.setSize(g.width,g.height)}if(e.pinned&&!e.adjustments){e.adjustments="auto"}}this.proxy=this.el.createProxy({tag:"div",cls:"x-resizable-proxy",id:this.el.id+"-rzproxy"},Ext.getBody());this.proxy.unselectable();this.proxy.enableDisplayMode("block");Ext.apply(this,e);if(this.pinned){this.disableTrackOver=true;this.el.addClass("x-resizable-pinned")}var k=this.el.getStyle("position");if(k!="absolute"&&k!="fixed"){this.el.setStyle("position","relative")}if(!this.handles){this.handles="s,e,se";if(this.multiDirectional){this.handles+=",n,w"}}if(this.handles=="all"){this.handles="n s e w ne nw se sw"}var o=this.handles.split(/\s*?[,;]\s*?| /);var c=Ext.Resizable.positions;for(var j=0,l=o.length;j0){if(a>(e/2)){d=c+(e-a)}else{d=c-a}}return Math.max(b,d)},resizeElement:function(){var a=this.proxy.getBox();if(this.updateBox){this.el.setBox(a,false,this.animate,this.duration,null,this.easing)}else{this.el.setSize(a.width,a.height,this.animate,this.duration,null,this.easing)}this.updateChildSize();if(!this.dynamic){this.proxy.hide()}if(this.draggable&&this.constrainTo){this.dd.resetConstraints();this.dd.constrainTo(this.constrainTo)}return a},constrain:function(b,c,a,d){if(b-cd){c=b-d}}return c},onMouseMove:function(z){if(this.enabled&&this.activeHandle){try{if(this.resizeRegion&&!this.resizeRegion.contains(z.getPoint())){return}var t=this.curSize||this.startBox,l=this.startBox.x,k=this.startBox.y,c=l,b=k,m=t.width,u=t.height,d=m,o=u,n=this.minWidth,A=this.minHeight,s=this.maxWidth,D=this.maxHeight,i=this.widthIncrement,a=this.heightIncrement,B=z.getXY(),r=-(this.startPoint[0]-Math.max(this.minX,B[0])),p=-(this.startPoint[1]-Math.max(this.minY,B[1])),j=this.activeHandle.position,E,g;switch(j){case"east":m+=r;m=Math.min(Math.max(n,m),s);break;case"south":u+=p;u=Math.min(Math.max(A,u),D);break;case"southeast":m+=r;u+=p;m=Math.min(Math.max(n,m),s);u=Math.min(Math.max(A,u),D);break;case"north":p=this.constrain(u,p,A,D);k+=p;u-=p;break;case"west":r=this.constrain(m,r,n,s);l+=r;m-=r;break;case"northeast":m+=r;m=Math.min(Math.max(n,m),s);p=this.constrain(u,p,A,D);k+=p;u-=p;break;case"northwest":r=this.constrain(m,r,n,s);p=this.constrain(u,p,A,D);k+=p;u-=p;l+=r;m-=r;break;case"southwest":r=this.constrain(m,r,n,s);u+=p;u=Math.min(Math.max(A,u),D);l+=r;m-=r;break}var q=this.snap(m,i,n);var C=this.snap(u,a,A);if(q!=m||C!=u){switch(j){case"northeast":k-=C-u;break;case"north":k-=C-u;break;case"southwest":l-=q-m;break;case"west":l-=q-m;break;case"northwest":l-=q-m;k-=C-u;break}m=q;u=C}if(this.preserveRatio){switch(j){case"southeast":case"east":u=o*(m/d);u=Math.min(Math.max(A,u),D);m=d*(u/o);break;case"south":m=d*(u/o);m=Math.min(Math.max(n,m),s);u=o*(m/d);break;case"northeast":m=d*(u/o);m=Math.min(Math.max(n,m),s);u=o*(m/d);break;case"north":E=m;m=d*(u/o);m=Math.min(Math.max(n,m),s);u=o*(m/d);l+=(E-m)/2;break;case"southwest":u=o*(m/d);u=Math.min(Math.max(A,u),D);E=m;m=d*(u/o);l+=E-m;break;case"west":g=u;u=o*(m/d);u=Math.min(Math.max(A,u),D);k+=(g-u)/2;E=m;m=d*(u/o);l+=E-m;break;case"northwest":E=m;g=u;u=o*(m/d);u=Math.min(Math.max(A,u),D);m=d*(u/o);k+=g-u;l+=E-m;break}}this.proxy.setBounds(l,k,m,u);if(this.dynamic){this.resizeElement()}}catch(v){}}},handleOver:function(){if(this.enabled){this.el.addClass("x-resizable-over")}},handleOut:function(){if(!this.resizing){this.el.removeClass("x-resizable-over")}},getEl:function(){return this.el},getResizeChild:function(){return this.resizeChild},destroy:function(b){Ext.destroy(this.dd,this.overlay,this.proxy);this.overlay=null;this.proxy=null;var c=Ext.Resizable.positions;for(var a in c){if(typeof c[a]!="function"&&this[c[a]]){this[c[a]].destroy()}}if(b){this.el.update("");Ext.destroy(this.el);this.el=null}this.purgeListeners()},syncHandleHeight:function(){var a=this.el.getHeight(true);if(this.west){this.west.el.setHeight(a)}if(this.east){this.east.el.setHeight(a)}}});Ext.Resizable.positions={n:"north",s:"south",e:"east",w:"west",se:"southeast",sw:"southwest",nw:"northwest",ne:"northeast"};Ext.Resizable.Handle=Ext.extend(Object,{constructor:function(d,g,c,e,a){if(!this.tpl){var b=Ext.DomHelper.createTemplate({tag:"div",cls:"x-resizable-handle x-resizable-handle-{0}"});b.compile();Ext.Resizable.Handle.prototype.tpl=b}this.position=g;this.rz=d;this.el=this.tpl.append(d.el.dom,[this.position],true);this.el.unselectable();if(e){this.el.setOpacity(0)}if(!Ext.isEmpty(a)){this.el.addClass(a)}this.el.on("mousedown",this.onMouseDown,this);if(!c){this.el.on({scope:this,mouseover:this.onMouseOver,mouseout:this.onMouseOut})}},afterResize:function(a){},onMouseDown:function(a){this.rz.onMouseDown(this,a)},onMouseOver:function(a){this.rz.handleOver(this,a)},onMouseOut:function(a){this.rz.handleOut(this,a)},destroy:function(){Ext.destroy(this.el);this.el=null}});Ext.Window=Ext.extend(Ext.Panel,{baseCls:"x-window",resizable:true,draggable:true,closable:true,closeAction:"close",constrain:false,constrainHeader:false,plain:false,minimizable:false,maximizable:false,minHeight:100,minWidth:200,expandOnShow:true,showAnimDuration:0.25,hideAnimDuration:0.25,collapsible:false,initHidden:undefined,hidden:true,elements:"header,body",frame:true,floating:true,initComponent:function(){this.initTools();Ext.Window.superclass.initComponent.call(this);this.addEvents("resize","maximize","minimize","restore");if(Ext.isDefined(this.initHidden)){this.hidden=this.initHidden}if(this.hidden===false){this.hidden=true;this.show()}},getState:function(){return Ext.apply(Ext.Window.superclass.getState.call(this)||{},this.getBox(true))},onRender:function(b,a){Ext.Window.superclass.onRender.call(this,b,a);if(this.plain){this.el.addClass("x-window-plain")}this.focusEl=this.el.createChild({tag:"a",href:"#",cls:"x-dlg-focus",tabIndex:"-1",html:" "});this.focusEl.swallowEvent("click",true);this.proxy=this.el.createProxy("x-window-proxy");this.proxy.enableDisplayMode("block");if(this.modal){this.mask=this.container.createChild({cls:"ext-el-mask"},this.el.dom);this.mask.enableDisplayMode("block");this.mask.hide();this.mon(this.mask,"click",this.focus,this)}if(this.maximizable){this.mon(this.header,"dblclick",this.toggleMaximize,this)}},initEvents:function(){Ext.Window.superclass.initEvents.call(this);if(this.animateTarget){this.setAnimateTarget(this.animateTarget)}if(this.resizable){this.resizer=new Ext.Resizable(this.el,{minWidth:this.minWidth,minHeight:this.minHeight,handles:this.resizeHandles||"all",pinned:true,resizeElement:this.resizerAction,handleCls:"x-window-handle"});this.resizer.window=this;this.mon(this.resizer,"beforeresize",this.beforeResize,this)}if(this.draggable){this.header.addClass("x-window-draggable")}this.mon(this.el,"mousedown",this.toFront,this);this.manager=this.manager||Ext.WindowMgr;this.manager.register(this);if(this.maximized){this.maximized=false;this.maximize()}if(this.closable){var a=this.getKeyMap();a.on(27,this.onEsc,this);a.disable()}},initDraggable:function(){this.dd=new Ext.Window.DD(this)},onEsc:function(a,b){if(this.activeGhost){this.unghost()}b.stopEvent();this[this.closeAction]()},beforeDestroy:function(){if(this.rendered){this.hide();this.clearAnchor();Ext.destroy(this.focusEl,this.resizer,this.dd,this.proxy,this.mask)}Ext.Window.superclass.beforeDestroy.call(this)},onDestroy:function(){if(this.manager){this.manager.unregister(this)}Ext.Window.superclass.onDestroy.call(this)},initTools:function(){if(this.minimizable){this.addTool({id:"minimize",handler:this.minimize.createDelegate(this,[])})}if(this.maximizable){this.addTool({id:"maximize",handler:this.maximize.createDelegate(this,[])});this.addTool({id:"restore",handler:this.restore.createDelegate(this,[]),hidden:true})}if(this.closable){this.addTool({id:"close",handler:this[this.closeAction].createDelegate(this,[])})}},resizerAction:function(){var a=this.proxy.getBox();this.proxy.hide();this.window.handleResize(a);return a},beforeResize:function(){this.resizer.minHeight=Math.max(this.minHeight,this.getFrameHeight()+40);this.resizer.minWidth=Math.max(this.minWidth,this.getFrameWidth()+40);this.resizeBox=this.el.getBox()},updateHandles:function(){if(Ext.isIE&&this.resizer){this.resizer.syncHandleHeight();this.el.repaint()}},handleResize:function(b){var a=this.resizeBox;if(a.x!=b.x||a.y!=b.y){this.updateBox(b)}else{this.setSize(b);if(Ext.isIE6&&Ext.isStrict){this.doLayout()}}this.focus();this.updateHandles();this.saveState()},focus:function(){var e=this.focusEl,a=this.defaultButton,c=typeof a,d,b;if(Ext.isDefined(a)){if(Ext.isNumber(a)&&this.fbar){e=this.fbar.items.get(a)}else{if(Ext.isString(a)){e=Ext.getCmp(a)}else{e=a}}d=e.getEl();b=Ext.getDom(this.container);if(d&&b){if(b!=document.body&&!Ext.lib.Region.getRegion(b).contains(Ext.lib.Region.getRegion(d.dom))){return}}}e=e||this.focusEl;e.focus.defer(10,e)},setAnimateTarget:function(a){a=Ext.get(a);this.animateTarget=a},beforeShow:function(){delete this.el.lastXY;delete this.el.lastLT;if(this.x===undefined||this.y===undefined){var a=this.el.getAlignToXY(this.container,"c-c");var b=this.el.translatePoints(a[0],a[1]);this.x=this.x===undefined?b.left:this.x;this.y=this.y===undefined?b.top:this.y}this.el.setLeftTop(this.x,this.y);if(this.expandOnShow){this.expand(false)}if(this.modal){Ext.getBody().addClass("x-body-masked");this.mask.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.mask.show()}},show:function(c,a,b){if(!this.rendered){this.render(Ext.getBody())}if(this.hidden===false){this.toFront();return this}if(this.fireEvent("beforeshow",this)===false){return this}if(a){this.on("show",a,b,{single:true})}this.hidden=false;if(Ext.isDefined(c)){this.setAnimateTarget(c)}this.beforeShow();if(this.animateTarget){this.animShow()}else{this.afterShow()}return this},afterShow:function(b){if(this.isDestroyed){return false}this.proxy.hide();this.el.setStyle("display","block");this.el.show();if(this.maximized){this.fitContainer()}if(Ext.isMac&&Ext.isGecko2){this.cascade(this.setAutoScroll)}if(this.monitorResize||this.modal||this.constrain||this.constrainHeader){Ext.EventManager.onWindowResize(this.onWindowResize,this)}this.doConstrain();this.doLayout();if(this.keyMap){this.keyMap.enable()}this.toFront();this.updateHandles();if(b&&(Ext.isIE||Ext.isWebKit)){var a=this.getSize();this.onResize(a.width,a.height)}this.onShow();this.fireEvent("show",this)},animShow:function(){this.proxy.show();this.proxy.setBox(this.animateTarget.getBox());this.proxy.setOpacity(0);var a=this.getBox();this.el.setStyle("display","none");this.proxy.shift(Ext.apply(a,{callback:this.afterShow.createDelegate(this,[true],false),scope:this,easing:"easeNone",duration:this.showAnimDuration,opacity:0.5}))},hide:function(c,a,b){if(this.hidden||this.fireEvent("beforehide",this)===false){return this}if(a){this.on("hide",a,b,{single:true})}this.hidden=true;if(c!==undefined){this.setAnimateTarget(c)}if(this.modal){this.mask.hide();Ext.getBody().removeClass("x-body-masked")}if(this.animateTarget){this.animHide()}else{this.el.hide();this.afterHide()}return this},afterHide:function(){this.proxy.hide();if(this.monitorResize||this.modal||this.constrain||this.constrainHeader){Ext.EventManager.removeResizeListener(this.onWindowResize,this)}if(this.keyMap){this.keyMap.disable()}this.onHide();this.fireEvent("hide",this)},animHide:function(){this.proxy.setOpacity(0.5);this.proxy.show();var a=this.getBox(false);this.proxy.setBox(a);this.el.hide();this.proxy.shift(Ext.apply(this.animateTarget.getBox(),{callback:this.afterHide,scope:this,duration:this.hideAnimDuration,easing:"easeNone",opacity:0}))},onShow:Ext.emptyFn,onHide:Ext.emptyFn,onWindowResize:function(){if(this.maximized){this.fitContainer()}if(this.modal){this.mask.setSize("100%","100%");var a=this.mask.dom.offsetHeight;this.mask.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true))}this.doConstrain()},doConstrain:function(){if(this.constrain||this.constrainHeader){var b;if(this.constrain){b={right:this.el.shadowOffset,left:this.el.shadowOffset,bottom:this.el.shadowOffset}}else{var a=this.getSize();b={right:-(a.width-100),bottom:-(a.height-25+this.el.getConstrainOffset())}}var c=this.el.getConstrainToXY(this.container,true,b);if(c){this.setPosition(c[0],c[1])}}},ghost:function(a){var c=this.createGhost(a);var b=this.getBox(true);c.setLeftTop(b.x,b.y);c.setWidth(b.width);this.el.hide();this.activeGhost=c;return c},unghost:function(b,a){if(!this.activeGhost){return}if(b!==false){this.el.show();this.focus.defer(10,this);if(Ext.isMac&&Ext.isGecko2){this.cascade(this.setAutoScroll)}}if(a!==false){this.setPosition(this.activeGhost.getLeft(true),this.activeGhost.getTop(true))}this.activeGhost.hide();this.activeGhost.remove();delete this.activeGhost},minimize:function(){this.fireEvent("minimize",this);return this},close:function(){if(this.fireEvent("beforeclose",this)!==false){if(this.hidden){this.doClose()}else{this.hide(null,this.doClose,this)}}},doClose:function(){this.fireEvent("close",this);this.destroy()},maximize:function(){if(!this.maximized){this.expand(false);this.restoreSize=this.getSize();this.restorePos=this.getPosition(true);if(this.maximizable){this.tools.maximize.hide();this.tools.restore.show()}this.maximized=true;this.el.disableShadow();if(this.dd){this.dd.lock()}if(this.collapsible){this.tools.toggle.hide()}this.el.addClass("x-window-maximized");this.container.addClass("x-window-maximized-ct");this.setPosition(0,0);this.fitContainer();this.fireEvent("maximize",this)}return this},restore:function(){if(this.maximized){var a=this.tools;this.el.removeClass("x-window-maximized");if(a.restore){a.restore.hide()}if(a.maximize){a.maximize.show()}this.setPosition(this.restorePos[0],this.restorePos[1]);this.setSize(this.restoreSize.width,this.restoreSize.height);delete this.restorePos;delete this.restoreSize;this.maximized=false;this.el.enableShadow(true);if(this.dd){this.dd.unlock()}if(this.collapsible&&a.toggle){a.toggle.show()}this.container.removeClass("x-window-maximized-ct");this.doConstrain();this.fireEvent("restore",this)}return this},toggleMaximize:function(){return this[this.maximized?"restore":"maximize"]()},fitContainer:function(){var a=this.container.getViewSize(false);this.setSize(a.width,a.height)},setZIndex:function(a){if(this.modal){this.mask.setStyle("z-index",a)}this.el.setZIndex(++a);a+=5;if(this.resizer){this.resizer.proxy.setStyle("z-index",++a)}this.lastZIndex=a},alignTo:function(b,a,c){var d=this.el.getAlignToXY(b,a,c);this.setPagePosition(d[0],d[1]);return this},anchorTo:function(c,e,d,b){this.clearAnchor();this.anchorTarget={el:c,alignment:e,offsets:d};Ext.EventManager.onWindowResize(this.doAnchor,this);var a=typeof b;if(a!="undefined"){Ext.EventManager.on(window,"scroll",this.doAnchor,this,{buffer:a=="number"?b:50})}return this.doAnchor()},doAnchor:function(){var a=this.anchorTarget;this.alignTo(a.el,a.alignment,a.offsets);return this},clearAnchor:function(){if(this.anchorTarget){Ext.EventManager.removeResizeListener(this.doAnchor,this);Ext.EventManager.un(window,"scroll",this.doAnchor,this);delete this.anchorTarget}return this},toFront:function(a){if(this.manager.bringToFront(this)){if(!a||!a.getTarget().focus){this.focus()}}return this},setActive:function(a){if(a){if(!this.maximized){this.el.enableShadow(true)}this.fireEvent("activate",this)}else{this.el.disableShadow();this.fireEvent("deactivate",this)}},toBack:function(){this.manager.sendToBack(this);return this},center:function(){var a=this.el.getAlignToXY(this.container,"c-c");this.setPagePosition(a[0],a[1]);return this}});Ext.reg("window",Ext.Window);Ext.Window.DD=Ext.extend(Ext.dd.DD,{constructor:function(a){this.win=a;Ext.Window.DD.superclass.constructor.call(this,a.el.id,"WindowDD-"+a.id);this.setHandleElId(a.header.id);this.scroll=false},moveOnly:true,headerOffsets:[100,25],startDrag:function(){var a=this.win;this.proxy=a.ghost(a.initialConfig.cls);if(a.constrain!==false){var c=a.el.shadowOffset;this.constrainTo(a.container,{right:c,left:c,bottom:c})}else{if(a.constrainHeader!==false){var b=this.proxy.getSize();this.constrainTo(a.container,{right:-(b.width-this.headerOffsets[0]),bottom:-(b.height-this.headerOffsets[1])})}}},b4Drag:Ext.emptyFn,onDrag:function(a){this.alignElWithMouse(this.proxy,a.getPageX(),a.getPageY())},endDrag:function(a){this.win.unghost();this.win.saveState()}});Ext.WindowGroup=function(){var g={};var d=[];var e=null;var c=function(j,i){return(!j._lastAccess||j._lastAccess0){l.sort(c);var k=l[0].manager.zseed;for(var m=0;m=0;--j){if(!d[j].hidden){b(d[j]);return}}b(null)};return{zseed:9000,register:function(i){if(i.manager){i.manager.unregister(i)}i.manager=this;g[i.id]=i;d.push(i);i.on("hide",a)},unregister:function(i){delete i.manager;delete g[i.id];i.un("hide",a);d.remove(i)},get:function(i){return typeof i=="object"?i:g[i]},bringToFront:function(i){i=this.get(i);if(i!=e){i._lastAccess=new Date().getTime();h();return true}return false},sendToBack:function(i){i=this.get(i);i._lastAccess=-(new Date().getTime());h();return i},hideAll:function(){for(var i in g){if(g[i]&&typeof g[i]!="function"&&g[i].isVisible()){g[i].hide()}}},getActive:function(){return e},getBy:function(l,k){var m=[];for(var j=d.length-1;j>=0;--j){var n=d[j];if(l.call(k||n,n)!==false){m.push(n)}}return m},each:function(j,i){for(var k in g){if(g[k]&&typeof g[k]!="function"){if(j.call(i||g[k],g[k])===false){return}}}}}};Ext.WindowMgr=new Ext.WindowGroup();Ext.MessageBox=function(){var u,b,q,t,h,l,s,a,n,p,j,g,r,v,o,i="",d="",m=["ok","yes","no","cancel"];var c=function(x){r[x].blur();if(u.isVisible()){u.hide();w();Ext.callback(b.fn,b.scope||window,[x,v.dom.value,b],1)}};var w=function(){if(b&&b.cls){u.el.removeClass(b.cls)}n.reset()};var e=function(z,x,y){if(b&&b.closable!==false){u.hide();w()}if(y){y.stopEvent()}};var k=function(x){var z=0,y;if(!x){Ext.each(m,function(A){r[A].hide()});return z}u.footer.dom.style.display="";Ext.iterate(r,function(A,B){y=x[A];if(y){B.show();B.setText(Ext.isString(y)?y:Ext.MessageBox.buttonText[A]);z+=B.getEl().getWidth()+15}else{B.hide()}});return z};return{getDialog:function(x){if(!u){var z=[];r={};Ext.each(m,function(A){z.push(r[A]=new Ext.Button({text:this.buttonText[A],handler:c.createCallback(A),hideMode:"offsets"}))},this);u=new Ext.Window({autoCreate:true,title:x,resizable:false,constrain:true,constrainHeader:true,minimizable:false,maximizable:false,stateful:false,modal:true,shim:true,buttonAlign:"center",width:400,height:100,minHeight:80,plain:true,footer:true,closable:true,close:function(){if(b&&b.buttons&&b.buttons.no&&!b.buttons.cancel){c("no")}else{c("cancel")}},fbar:new Ext.Toolbar({items:z,enableOverflow:false})});u.render(document.body);u.getEl().addClass("x-window-dlg");q=u.mask;h=u.body.createChild({html:'

    '});j=Ext.get(h.dom.firstChild);var y=h.dom.childNodes[1];l=Ext.get(y.firstChild);s=Ext.get(y.childNodes[2].firstChild);s.enableDisplayMode();s.addKeyListener([10,13],function(){if(u.isVisible()&&b&&b.buttons){if(b.buttons.ok){c("ok")}else{if(b.buttons.yes){c("yes")}}}});a=Ext.get(y.childNodes[2].childNodes[1]);a.enableDisplayMode();n=new Ext.ProgressBar({renderTo:h});h.createChild({cls:"x-clear"})}return u},updateText:function(A){if(!u.isVisible()&&!b.width){u.setSize(this.maxWidth,100)}l.update(A?A+" ":" ");var y=d!=""?(j.getWidth()+j.getMargins("lr")):0,C=l.getWidth()+l.getMargins("lr"),z=u.getFrameWidth("lr"),B=u.body.getFrameWidth("lr"),x;x=Math.max(Math.min(b.width||y+C+z+B,b.maxWidth||this.maxWidth),Math.max(b.minWidth||this.minWidth,o||0));if(b.prompt===true){v.setWidth(x-y-z-B)}if(b.progress===true||b.wait===true){n.setSize(x-y-z-B)}if(Ext.isIE&&x==o){x+=4}l.update(A||" ");u.setSize(x,"auto").center();return this},updateProgress:function(y,x,z){n.updateProgress(y,x);if(z){this.updateText(z)}return this},isVisible:function(){return u&&u.isVisible()},hide:function(){var x=u?u.activeGhost:null;if(this.isVisible()||x){u.hide();w();if(x){u.unghost(false,false)}}return this},show:function(A){if(this.isVisible()){this.hide()}b=A;var B=this.getDialog(b.title||" ");B.setTitle(b.title||" ");var x=(b.closable!==false&&b.progress!==true&&b.wait!==true);B.tools.close.setDisplayed(x);v=s;b.prompt=b.prompt||(b.multiline?true:false);if(b.prompt){if(b.multiline){s.hide();a.show();a.setHeight(Ext.isNumber(b.multiline)?b.multiline:this.defaultTextHeight);v=a}else{s.show();a.hide()}}else{s.hide();a.hide()}v.dom.value=b.value||"";if(b.prompt){B.focusEl=v}else{var z=b.buttons;var y=null;if(z&&z.ok){y=r.ok}else{if(z&&z.yes){y=r.yes}}if(y){B.focusEl=y}}if(Ext.isDefined(b.iconCls)){B.setIconClass(b.iconCls)}this.setIcon(Ext.isDefined(b.icon)?b.icon:i);o=k(b.buttons);n.setVisible(b.progress===true||b.wait===true);this.updateProgress(0,b.progressText);this.updateText(b.msg);if(b.cls){B.el.addClass(b.cls)}B.proxyDrag=b.proxyDrag===true;B.modal=b.modal!==false;B.mask=b.modal!==false?q:false;if(!B.isVisible()){document.body.appendChild(u.el.dom);B.setAnimateTarget(b.animEl);B.on("show",function(){if(x===true){B.keyMap.enable()}else{B.keyMap.disable()}},this,{single:true});B.show(b.animEl)}if(b.wait===true){n.wait(b.waitConfig)}return this},setIcon:function(x){if(!u){i=x;return}i=undefined;if(x&&x!=""){j.removeClass("x-hidden");j.replaceClass(d,x);h.addClass("x-dlg-icon");d=x}else{j.replaceClass(d,"x-hidden");h.removeClass("x-dlg-icon");d=""}return this},progress:function(z,y,x){this.show({title:z,msg:y,buttons:false,progress:true,closable:false,minWidth:this.minProgressWidth,progressText:x});return this},wait:function(z,y,x){this.show({title:y,msg:z,buttons:false,closable:false,wait:true,modal:true,minWidth:this.minProgressWidth,waitConfig:x});return this},alert:function(A,z,y,x){this.show({title:A,msg:z,buttons:this.OK,fn:y,scope:x,minWidth:this.minWidth});return this},confirm:function(A,z,y,x){this.show({title:A,msg:z,buttons:this.YESNO,fn:y,scope:x,icon:this.QUESTION,minWidth:this.minWidth});return this},prompt:function(C,B,z,y,x,A){this.show({title:C,msg:B,buttons:this.OKCANCEL,fn:z,minWidth:this.minPromptWidth,scope:y,prompt:true,multiline:x,value:A});return this},OK:{ok:true},CANCEL:{cancel:true},OKCANCEL:{ok:true,cancel:true},YESNO:{yes:true,no:true},YESNOCANCEL:{yes:true,no:true,cancel:true},INFO:"ext-mb-info",WARNING:"ext-mb-warning",QUESTION:"ext-mb-question",ERROR:"ext-mb-error",defaultTextHeight:75,maxWidth:600,minWidth:100,minProgressWidth:250,minPromptWidth:250,buttonText:{ok:"OK",cancel:"Cancel",yes:"Yes",no:"No"}}}();Ext.Msg=Ext.MessageBox;Ext.dd.PanelProxy=Ext.extend(Object,{constructor:function(a,b){this.panel=a;this.id=this.panel.id+"-ddproxy";Ext.apply(this,b)},insertProxy:true,setStatus:Ext.emptyFn,reset:Ext.emptyFn,update:Ext.emptyFn,stop:Ext.emptyFn,sync:Ext.emptyFn,getEl:function(){return this.ghost},getGhost:function(){return this.ghost},getProxy:function(){return this.proxy},hide:function(){if(this.ghost){if(this.proxy){this.proxy.remove();delete this.proxy}this.panel.el.dom.style.display="";this.ghost.remove();delete this.ghost}},show:function(){if(!this.ghost){this.ghost=this.panel.createGhost(this.panel.initialConfig.cls,undefined,Ext.getBody());this.ghost.setXY(this.panel.el.getXY());if(this.insertProxy){this.proxy=this.panel.el.insertSibling({cls:"x-panel-dd-spacer"});this.proxy.setSize(this.panel.getSize())}this.panel.el.dom.style.display="none"}},repair:function(b,c,a){this.hide();if(typeof c=="function"){c.call(a||this)}},moveProxy:function(a,b){if(this.proxy){a.insertBefore(this.proxy.dom,b)}}});Ext.Panel.DD=Ext.extend(Ext.dd.DragSource,{constructor:function(b,a){this.panel=b;this.dragData={panel:b};this.proxy=new Ext.dd.PanelProxy(b,a);Ext.Panel.DD.superclass.constructor.call(this,b.el,a);var d=b.header,c=b.body;if(d){this.setHandleElId(d.id);c=b.header}c.setStyle("cursor","move");this.scroll=false},showFrame:Ext.emptyFn,startDrag:Ext.emptyFn,b4StartDrag:function(a,b){this.proxy.show()},b4MouseDown:function(b){var a=b.getPageX(),c=b.getPageY();this.autoOffset(a,c)},onInitDrag:function(a,b){this.onStartDrag(a,b);return true},createFrame:Ext.emptyFn,getDragEl:function(a){return this.proxy.ghost.dom},endDrag:function(a){this.proxy.hide();this.panel.saveState()},autoOffset:function(a,b){a-=this.startPageX;b-=this.startPageY;this.setDelta(a,b)}});Ext.state.Provider=Ext.extend(Ext.util.Observable,{constructor:function(){this.addEvents("statechange");this.state={};Ext.state.Provider.superclass.constructor.call(this)},get:function(b,a){return typeof this.state[b]=="undefined"?a:this.state[b]},clear:function(a){delete this.state[a];this.fireEvent("statechange",this,a,null)},set:function(a,b){this.state[a]=b;this.fireEvent("statechange",this,a,b)},decodeValue:function(b){var e=/^(a|n|d|b|s|o|e)\:(.*)$/,h=e.exec(unescape(b)),d,c,a,g;if(!h||!h[1]){return}c=h[1];a=h[2];switch(c){case"e":return null;case"n":return parseFloat(a);case"d":return new Date(Date.parse(a));case"b":return(a=="1");case"a":d=[];if(a!=""){Ext.each(a.split("^"),function(i){d.push(this.decodeValue(i))},this)}return d;case"o":d={};if(a!=""){Ext.each(a.split("^"),function(i){g=i.split("=");d[g[0]]=this.decodeValue(g[1])},this)}return d;default:return a}},encodeValue:function(c){var b,g="",e=0,a,d;if(c==null){return"e:1"}else{if(typeof c=="number"){b="n:"+c}else{if(typeof c=="boolean"){b="b:"+(c?"1":"0")}else{if(Ext.isDate(c)){b="d:"+c.toGMTString()}else{if(Ext.isArray(c)){for(a=c.length;e-1){var e=this.isSelected(b),c=this.all.elements[b],d=this.bufferRender([a],b)[0];this.all.replaceElement(b,d,true);if(e){this.selected.replaceElement(c,d);this.all.item(b).addClass(this.selectedClass)}this.updateIndexes(b,b)}},onAdd:function(g,d,e){if(this.all.getCount()===0){this.refresh();return}var c=this.bufferRender(d,e),h,b=this.all.elements;if(e0){if(!b){this.selected.removeClass(this.selectedClass)}this.selected.clear();this.last=false;if(!a){this.fireEvent("selectionchange",this,this.selected.elements)}}},isSelected:function(a){return this.selected.contains(this.getNode(a))},deselect:function(a){if(this.isSelected(a)){a=this.getNode(a);this.selected.removeElement(a);if(this.last==a.viewIndex){this.last=false}Ext.fly(a).removeClass(this.selectedClass);this.fireEvent("selectionchange",this,this.selected.elements)}},select:function(d,g,b){if(Ext.isArray(d)){if(!g){this.clearSelections(true)}for(var c=0,a=d.length;c=a&&d[c];c--){b.push(d[c])}}return b},indexOf:function(a){a=this.getNode(a);if(Ext.isNumber(a.viewIndex)){return a.viewIndex}return this.all.indexOf(a)},onBeforeLoad:function(){if(this.loadingText){this.clearSelections(false,true);this.getTemplateTarget().update('
    '+this.loadingText+"
    ");this.all.clear()}},onDestroy:function(){this.all.clear();this.selected.clear();Ext.DataView.superclass.onDestroy.call(this);this.bindStore(null)}});Ext.DataView.prototype.setStore=Ext.DataView.prototype.bindStore;Ext.reg("dataview",Ext.DataView);Ext.list.ListView=Ext.extend(Ext.DataView,{itemSelector:"dl",selectedClass:"x-list-selected",overClass:"x-list-over",scrollOffset:undefined,columnResize:true,columnSort:true,maxColumnWidth:Ext.isIE?99:100,initComponent:function(){if(this.columnResize){this.colResizer=new Ext.list.ColumnResizer(this.colResizer);this.colResizer.init(this)}if(this.columnSort){this.colSorter=new Ext.list.Sorter(this.columnSort);this.colSorter.init(this)}if(!this.internalTpl){this.internalTpl=new Ext.XTemplate('
    ','','
    ',"{header}","
    ","
    ",'
    ',"
    ",'
    ',"
    ")}if(!this.tpl){this.tpl=new Ext.XTemplate('',"
    ",'','
    ',' class="{cls}">',"{[values.tpl.apply(parent)]}","
    ","
    ",'
    ',"
    ","
    ")}var l=this.columns,h=0,k=0,m=l.length,b=[];for(var g=0;gthis.maxColumnWidth){n.width-=(h-this.maxColumnWidth)/100}k++}b.push(n)}l=this.columns=b;if(k10)){b.style.width=d;g.style.width=d}else{b.style.width=c+"px";g.style.width=c+"px";setTimeout(function(){if((a.offsetWidth-a.clientWidth)>10){b.style.width=d;g.style.width=d}},10)}}if(Ext.isNumber(e)){a.style.height=Math.max(0,e-g.parentNode.offsetHeight)+"px"}},updateIndexes:function(){Ext.list.ListView.superclass.updateIndexes.apply(this,arguments);this.verifyInternalSize()},findHeaderIndex:function(g){g=g.dom||g;var a=g.parentNode,d=a.parentNode.childNodes,b=0,e;for(;e=d[b];b++){if(e==a){return b}}return -1},setHdWidths:function(){var d=this.innerHd.dom.getElementsByTagName("div"),c=0,b=this.columns,a=b.length;for(;c','','{text}',"");d.disableFormats=true;d.compile();Ext.TabPanel.prototype.itemTpl=d}this.items.each(this.initTab,this)},afterRender:function(){Ext.TabPanel.superclass.afterRender.call(this);if(this.autoTabs){this.readTabs(false)}if(this.activeTab!==undefined){var a=Ext.isObject(this.activeTab)?this.activeTab:this.items.get(this.activeTab);delete this.activeTab;this.setActiveTab(a)}},initEvents:function(){Ext.TabPanel.superclass.initEvents.call(this);this.mon(this.strip,{scope:this,mousedown:this.onStripMouseDown,contextmenu:this.onStripContextMenu});if(this.enableTabScroll){this.mon(this.strip,"mousewheel",this.onWheel,this)}},findTargets:function(c){var b=null,a=c.getTarget("li:not(.x-tab-edge)",this.strip);if(a){b=this.getComponent(a.id.split(this.idDelimiter)[1]);if(b.disabled){return{close:null,item:null,el:null}}}return{close:c.getTarget(".x-tab-strip-close",this.strip),item:b,el:a}},onStripMouseDown:function(b){if(b.button!==0){return}b.preventDefault();var a=this.findTargets(b);if(a.close){if(a.item.fireEvent("beforeclose",a.item)!==false){a.item.fireEvent("close",a.item);this.remove(a.item)}return}if(a.item&&a.item!=this.activeTab){this.setActiveTab(a.item)}},onStripContextMenu:function(b){b.preventDefault();var a=this.findTargets(b);if(a.item){this.fireEvent("contextmenu",this,a.item,b)}},readTabs:function(d){if(d===true){this.items.each(function(h){this.remove(h)},this)}var c=this.el.query(this.autoTabSelector);for(var b=0,a=c.length;b0){this.setActiveTab(0)}else{this.setActiveTab(null)}}}if(!this.destroying){this.delegateUpdates()}},onBeforeShowItem:function(a){if(a!=this.activeTab){this.setActiveTab(a);return false}},onItemDisabled:function(b){var a=this.getTabEl(b);if(a){Ext.fly(a).addClass("x-item-disabled")}this.stack.remove(b)},onItemEnabled:function(b){var a=this.getTabEl(b);if(a){Ext.fly(a).removeClass("x-item-disabled")}},onItemTitleChanged:function(b){var a=this.getTabEl(b);if(a){Ext.fly(a).child("span.x-tab-strip-text",true).innerHTML=b.title}},onItemIconChanged:function(d,a,c){var b=this.getTabEl(d);if(b){b=Ext.get(b);b.child("span.x-tab-strip-text").replaceClass(c,a);b[Ext.isEmpty(a)?"removeClass":"addClass"]("x-tab-with-icon")}},getTabEl:function(a){var b=this.getComponent(a);return b?b.tabEl:null},onResize:function(){Ext.TabPanel.superclass.onResize.apply(this,arguments);this.delegateUpdates()},beginUpdate:function(){this.suspendUpdates=true},endUpdate:function(){this.suspendUpdates=false;this.delegateUpdates()},hideTabStripItem:function(b){b=this.getComponent(b);var a=this.getTabEl(b);if(a){a.style.display="none";this.delegateUpdates()}this.stack.remove(b)},unhideTabStripItem:function(b){b=this.getComponent(b);var a=this.getTabEl(b);if(a){a.style.display="";this.delegateUpdates()}},delegateUpdates:function(){var a=this.rendered;if(this.suspendUpdates){return}if(this.resizeTabs&&a){this.autoSizeTabs()}if(this.enableTabScroll&&a){this.autoScrollTabs()}},autoSizeTabs:function(){var h=this.items.length,b=this.tabPosition!="bottom"?"header":"footer",c=this[b].dom.offsetWidth,a=this[b].dom.clientWidth;if(!this.resizeTabs||h<1||!a){return}var k=Math.max(Math.min(Math.floor((a-4)/h)-this.tabMargin,this.tabWidth),this.minTabWidth);this.lastTabWidth=k;var m=this.strip.query("li:not(.x-tab-edge)");for(var e=0,j=m.length;e20?c:20);if(!this.scrolling){if(!this.scrollLeft){this.createScrollers()}else{this.scrollLeft.show();this.scrollRight.show()}}this.scrolling=true;if(i>(a-c)){e.scrollLeft=a-c}else{this.scrollToTab(this.activeTab,false)}this.updateScrollButtons()}},createScrollers:function(){this.pos.addClass("x-tab-scrolling-"+this.tabPosition);var c=this.stripWrap.dom.offsetHeight;var a=this.pos.insertFirst({cls:"x-tab-scroller-left"});a.setHeight(c);a.addClassOnOver("x-tab-scroller-left-over");this.leftRepeater=new Ext.util.ClickRepeater(a,{interval:this.scrollRepeatInterval,handler:this.onScrollLeft,scope:this});this.scrollLeft=a;var b=this.pos.insertFirst({cls:"x-tab-scroller-right"});b.setHeight(c);b.addClassOnOver("x-tab-scroller-right-over");this.rightRepeater=new Ext.util.ClickRepeater(b,{interval:this.scrollRepeatInterval,handler:this.onScrollRight,scope:this});this.scrollRight=b},getScrollWidth:function(){return this.edge.getOffsetsTo(this.stripWrap)[0]+this.getScrollPos()},getScrollPos:function(){return parseInt(this.stripWrap.dom.scrollLeft,10)||0},getScrollArea:function(){return parseInt(this.stripWrap.dom.clientWidth,10)||0},getScrollAnim:function(){return{duration:this.scrollDuration,callback:this.updateScrollButtons,scope:this}},getScrollIncrement:function(){return this.scrollIncrement||(this.resizeTabs?this.lastTabWidth+2:100)},scrollToTab:function(e,a){if(!e){return}var c=this.getTabEl(e),h=this.getScrollPos(),d=this.getScrollArea(),g=Ext.fly(c).getOffsetsTo(this.stripWrap)[0]+h,b=g+c.offsetWidth;if(g(h+d)){this.scrollTo(b-d,a)}}},scrollTo:function(b,a){this.stripWrap.scrollTo("left",b,a?this.getScrollAnim():false);if(!a){this.updateScrollButtons()}},onWheel:function(g){var h=g.getWheelDelta()*this.wheelIncrement*-1;g.stopEvent();var i=this.getScrollPos(),c=i+h,a=this.getScrollWidth()-this.getScrollArea();var b=Math.max(0,Math.min(a,c));if(b!=i){this.scrollTo(b,false)}},onScrollRight:function(){var a=this.getScrollWidth()-this.getScrollArea(),c=this.getScrollPos(),b=Math.min(a,c+this.getScrollIncrement());if(b!=c){this.scrollTo(b,this.animScroll)}},onScrollLeft:function(){var b=this.getScrollPos(),a=Math.max(0,b-this.getScrollIncrement());if(a!=b){this.scrollTo(a,this.animScroll)}},updateScrollButtons:function(){var a=this.getScrollPos();this.scrollLeft[a===0?"addClass":"removeClass"]("x-tab-scroller-left-disabled");this.scrollRight[a>=(this.getScrollWidth()-this.getScrollArea())?"addClass":"removeClass"]("x-tab-scroller-right-disabled")},beforeDestroy:function(){Ext.destroy(this.leftRepeater,this.rightRepeater);this.deleteMembers("strip","edge","scrollLeft","scrollRight","stripWrap");this.activeTab=null;Ext.TabPanel.superclass.beforeDestroy.apply(this)}});Ext.reg("tabpanel",Ext.TabPanel);Ext.TabPanel.prototype.activate=Ext.TabPanel.prototype.setActiveTab;Ext.TabPanel.AccessStack=function(){var a=[];return{add:function(b){a.push(b);if(a.length>10){a.shift()}},remove:function(e){var d=[];for(var c=0,b=a.length;c','  ','  ','  ',"");Ext.Button.buttonTemplate.compile()}this.template=Ext.Button.buttonTemplate}var b,d=this.getTemplateArgs();if(a){b=this.template.insertBefore(a,d,true)}else{b=this.template.append(c,d,true)}this.btnEl=b.child(this.buttonSelector);this.mon(this.btnEl,{scope:this,focus:this.onFocus,blur:this.onBlur});this.initButtonEl(b,this.btnEl);Ext.ButtonToggleMgr.register(this)},initButtonEl:function(b,c){this.el=b;this.setIcon(this.icon);this.setText(this.text);this.setIconClass(this.iconCls);if(Ext.isDefined(this.tabIndex)){c.dom.tabIndex=this.tabIndex}if(this.tooltip){this.setTooltip(this.tooltip,true)}if(this.handleMouseEvents){this.mon(b,{scope:this,mouseover:this.onMouseOver,mousedown:this.onMouseDown})}if(this.menu){this.mon(this.menu,{scope:this,show:this.onMenuShow,hide:this.onMenuHide})}if(this.repeat){var a=new Ext.util.ClickRepeater(b,Ext.isObject(this.repeat)?this.repeat:{});this.mon(a,"click",this.onRepeatClick,this)}else{this.mon(b,this.clickEvent,this.onClick,this)}},afterRender:function(){Ext.Button.superclass.afterRender.call(this);this.useSetClass=true;this.setButtonClass();this.doc=Ext.getDoc();this.doAutoWidth()},setIconClass:function(a){this.iconCls=a;if(this.el){this.btnEl.dom.className="";this.btnEl.addClass(["x-btn-text",a||""]);this.setButtonClass()}return this},setTooltip:function(b,a){if(this.rendered){if(!a){this.clearTip()}if(Ext.isObject(b)){Ext.QuickTips.register(Ext.apply({target:this.btnEl.id},b));this.tooltip=b}else{this.btnEl.dom[this.tooltipType]=b}}else{this.tooltip=b}return this},clearTip:function(){if(Ext.isObject(this.tooltip)){Ext.QuickTips.unregister(this.btnEl)}},beforeDestroy:function(){if(this.rendered){this.clearTip()}if(this.menu&&this.destroyMenu!==false){Ext.destroy(this.btnEl,this.menu)}Ext.destroy(this.repeater)},onDestroy:function(){if(this.rendered){this.doc.un("mouseover",this.monitorMouseOver,this);this.doc.un("mouseup",this.onMouseUp,this);delete this.doc;delete this.btnEl;Ext.ButtonToggleMgr.unregister(this)}Ext.Button.superclass.onDestroy.call(this)},doAutoWidth:function(){if(this.autoWidth!==false&&this.el&&this.text&&this.width===undefined){this.el.setWidth("auto");if(Ext.isIE7&&Ext.isStrict){var a=this.btnEl;if(a&&a.getWidth()>20){a.clip();a.setWidth(Ext.util.TextMetrics.measure(a,this.text).width+a.getFrameWidth("lr"))}}if(this.minWidth){if(this.el.getWidth()a}else{return c.getPageY()>this.btnEl.getRegion().bottom}},onClick:function(b,a){b.preventDefault();if(!this.disabled){if(this.isClickOnArrow(b)){if(this.menu&&!this.menu.isVisible()&&!this.ignoreNextClick){this.showMenu()}this.fireEvent("arrowclick",this,b);if(this.arrowHandler){this.arrowHandler.call(this.scope||this,this,b)}}else{this.doToggle();this.fireEvent("click",this,b);if(this.handler){this.handler.call(this.scope||this,this,b)}}}},isMenuTriggerOver:function(a){return this.menu&&a.target.tagName==this.arrowSelector},isMenuTriggerOut:function(b,a){return this.menu&&b.target.tagName!=this.arrowSelector}});Ext.reg("splitbutton",Ext.SplitButton);Ext.CycleButton=Ext.extend(Ext.SplitButton,{getItemText:function(a){if(a&&this.showText===true){var b="";if(this.prependText){b+=this.prependText}b+=a.text;return b}return undefined},setActiveItem:function(c,a){if(!Ext.isObject(c)){c=this.menu.getComponent(c)}if(c){if(!this.rendered){this.text=this.getItemText(c);this.iconCls=c.iconCls}else{var b=this.getItemText(c);if(b){this.setText(b)}this.setIconClass(c.iconCls)}this.activeItem=c;if(!c.checked){c.setChecked(true,a)}if(this.forceIcon){this.setIconClass(this.forceIcon)}if(!a){this.fireEvent("change",this,c)}}},getActiveItem:function(){return this.activeItem},initComponent:function(){this.addEvents("change");if(this.changeHandler){this.on("change",this.changeHandler,this.scope||this);delete this.changeHandler}this.itemCount=this.items.length;this.menu={cls:"x-cycle-menu",items:[]};var a=0;Ext.each(this.items,function(c,b){Ext.apply(c,{group:c.group||this.id,itemIndex:b,checkHandler:this.checkHandler,scope:this,checked:c.checked||false});this.menu.items.push(c);if(c.checked){a=b}},this);Ext.CycleButton.superclass.initComponent.call(this);this.on("click",this.toggleSelected,this);this.setActiveItem(a,true)},checkHandler:function(a,b){if(b){this.setActiveItem(a)}},toggleSelected:function(){var a=this.menu;a.render();if(!a.hasLayout){a.doLayout()}var d,b;for(var c=1;c"){b=new a.Fill()}else{b=new a.TextItem(b)}}}this.applyDefaults(b)}else{if(b.isFormField||b.render){b=this.createComponent(b)}else{if(b.tag){b=new a.Item({autoEl:b})}else{if(b.tagName){b=new a.Item({el:b})}else{if(Ext.isObject(b)){b=b.xtype?this.createComponent(b):this.constructButton(b)}}}}}return b},applyDefaults:function(e){if(!Ext.isString(e)){e=Ext.Toolbar.superclass.applyDefaults.call(this,e);var b=this.internalDefaults;if(e.events){Ext.applyIf(e.initialConfig,b);Ext.apply(e,b)}else{Ext.applyIf(e,b)}}return e},addSeparator:function(){return this.add(new a.Separator())},addSpacer:function(){return this.add(new a.Spacer())},addFill:function(){this.add(new a.Fill())},addElement:function(b){return this.addItem(new a.Item({el:b}))},addItem:function(b){return this.add.apply(this,arguments)},addButton:function(c){if(Ext.isArray(c)){var e=[];for(var d=0,b=c.length;d");this.items.push(this.displayItem=new a.TextItem({}))}Ext.PagingToolbar.superclass.initComponent.call(this);this.addEvents("change","beforechange");this.on("afterlayout",this.onFirstLayout,this,{single:true});this.cursor=0;this.bindStore(this.store,true)},onFirstLayout:function(){if(this.dsLoaded){this.onLoad.apply(this,this.dsLoaded)}},updateInfo:function(){if(this.displayItem){var b=this.store.getCount();var c=b==0?this.emptyMsg:String.format(this.displayMsg,this.cursor+1,this.cursor+b,this.store.getTotalCount());this.displayItem.setText(c)}},onLoad:function(b,e,j){if(!this.rendered){this.dsLoaded=[b,e,j];return}var g=this.getParams();this.cursor=(j.params&&j.params[g.start])?j.params[g.start]:0;var i=this.getPageData(),c=i.activePage,h=i.pages;this.afterTextItem.setText(String.format(this.afterPageText,i.pages));this.inputItem.setValue(c);this.first.setDisabled(c==1);this.prev.setDisabled(c==1);this.next.setDisabled(c==h);this.last.setDisabled(c==h);this.refresh.enable();this.updateInfo();this.fireEvent("change",this,i)},getPageData:function(){var b=this.store.getTotalCount();return{total:b,activePage:Math.ceil((this.cursor+this.pageSize)/this.pageSize),pages:b=1&g<=j.pages){i.setValue(g)}}}}}},getParams:function(){return this.paramNames||this.store.paramNames},beforeLoad:function(){if(this.rendered&&this.refresh){this.refresh.disable()}},doLoad:function(d){var c={},b=this.getParams();c[b.start]=d;c[b.limit]=this.pageSize;if(this.fireEvent("beforechange",this,c)!==false){this.store.load({params:c})}},moveFirst:function(){this.doLoad(0)},movePrevious:function(){this.doLoad(Math.max(0,this.cursor-this.pageSize))},moveNext:function(){this.doLoad(this.cursor+this.pageSize)},moveLast:function(){var c=this.store.getTotalCount(),b=c%this.pageSize;this.doLoad(b?(c-b):c-this.pageSize)},doRefresh:function(){this.doLoad(this.cursor)},bindStore:function(c,d){var b;if(!d&&this.store){if(c!==this.store&&this.store.autoDestroy){this.store.destroy()}else{this.store.un("beforeload",this.beforeLoad,this);this.store.un("load",this.onLoad,this);this.store.un("exception",this.onLoadError,this)}if(!c){this.store=null}}if(c){c=Ext.StoreMgr.lookup(c);c.on({scope:this,beforeload:this.beforeLoad,load:this.onLoad,exception:this.onLoadError});b=true}this.store=c;if(b){this.onLoad(c,null,{})}},unbind:function(b){this.bindStore(null)},bind:function(b){this.bindStore(b)},onDestroy:function(){this.bindStore(null);Ext.PagingToolbar.superclass.onDestroy.call(this)}})})();Ext.reg("paging",Ext.PagingToolbar);Ext.History=(function(){var e,c;var k=false;var d;function g(){var l=location.href,m=l.indexOf("#"),n=m>=0?l.substr(m+1):null;if(Ext.isGecko){n=decodeURIComponent(n)}return n}function a(){c.value=d}function h(l){d=l;Ext.History.fireEvent("change",l)}function i(m){var l=['
    ',Ext.util.Format.htmlEncode(m),"
    "].join("");try{var o=e.contentWindow.document;o.open();o.write(l);o.close();return true}catch(n){return false}}function b(){if(!e.contentWindow||!e.contentWindow.document){setTimeout(b,10);return}var o=e.contentWindow.document;var m=o.getElementById("state");var l=m?m.innerText:null;var n=g();setInterval(function(){o=e.contentWindow.document;m=o.getElementById("state");var q=m?m.innerText:null;var p=g();if(q!==l){l=q;h(l);location.hash=l;n=l;a()}else{if(p!==n){n=p;i(p)}}},50);k=true;Ext.History.fireEvent("ready",Ext.History)}function j(){d=c.value?c.value:g();if(Ext.isIE){b()}else{var l=g();setInterval(function(){var m=g();if(m!==l){l=m;h(l);a()}},50);k=true;Ext.History.fireEvent("ready",Ext.History)}}return{fieldId:"x-history-field",iframeId:"x-history-frame",events:{},init:function(m,l){if(k){Ext.callback(m,l,[this]);return}if(!Ext.isReady){Ext.onReady(function(){Ext.History.init(m,l)});return}c=Ext.getDom(Ext.History.fieldId);if(Ext.isIE){e=Ext.getDom(Ext.History.iframeId)}this.addEvents("ready","change");if(m){this.on("ready",m,l,{single:true})}j()},add:function(l,m){if(m!==false){if(this.getToken()==l){return true}}if(Ext.isIE){return i(l)}else{location.hash=l;return true}},back:function(){history.go(-1)},forward:function(){history.go(1)},getToken:function(){return k?d:g()}}})();Ext.apply(Ext.History,new Ext.util.Observable());Ext.Tip=Ext.extend(Ext.Panel,{minWidth:40,maxWidth:300,shadow:"sides",defaultAlign:"tl-bl?",autoRender:true,quickShowInterval:250,frame:true,hidden:true,baseCls:"x-tip",floating:{shadow:true,shim:true,useDisplay:true,constrain:false},autoHeight:true,closeAction:"hide",initComponent:function(){Ext.Tip.superclass.initComponent.call(this);if(this.closable&&!this.title){this.elements+=",header"}},afterRender:function(){Ext.Tip.superclass.afterRender.call(this);if(this.closable){this.addTool({id:"close",handler:this[this.closeAction],scope:this})}},showAt:function(a){Ext.Tip.superclass.show.call(this);if(this.measureWidth!==false&&(!this.initialConfig||typeof this.initialConfig.width!="number")){this.doAutoWidth()}if(this.constrainPosition){a=this.el.adjustForConstraints(a)}this.setPagePosition(a[0],a[1])},doAutoWidth:function(a){a=a||0;var b=this.body.getTextWidth();if(this.title){b=Math.max(b,this.header.child("span").getTextWidth(this.title))}b+=this.getFrameWidth()+(this.closable?20:0)+this.body.getPadding("lr")+a;this.setWidth(b.constrain(this.minWidth,this.maxWidth));if(Ext.isIE7&&!this.repainted){this.el.repaint();this.repainted=true}},showBy:function(a,b){if(!this.rendered){this.render(Ext.getBody())}this.showAt(this.el.getAlignToXY(a,b||this.defaultAlign))},initDraggable:function(){this.dd=new Ext.Tip.DD(this,typeof this.draggable=="boolean"?null:this.draggable);this.header.addClass("x-tip-draggable")}});Ext.reg("tip",Ext.Tip);Ext.Tip.DD=function(b,a){Ext.apply(this,a);this.tip=b;Ext.Tip.DD.superclass.constructor.call(this,b.el.id,"WindowDD-"+b.id);this.setHandleElId(b.header.id);this.scroll=false};Ext.extend(Ext.Tip.DD,Ext.dd.DD,{moveOnly:true,scroll:false,headerOffsets:[100,25],startDrag:function(){this.tip.el.disableShadow()},endDrag:function(a){this.tip.el.enableShadow(true)}});Ext.ToolTip=Ext.extend(Ext.Tip,{showDelay:500,hideDelay:200,dismissDelay:5000,trackMouse:false,anchorToTarget:true,anchorOffset:0,targetCounter:0,constrainPosition:false,initComponent:function(){Ext.ToolTip.superclass.initComponent.call(this);this.lastActive=new Date();this.initTarget(this.target);this.origAnchor=this.anchor},onRender:function(b,a){Ext.ToolTip.superclass.onRender.call(this,b,a);this.anchorCls="x-tip-anchor-"+this.getAnchorPosition();this.anchorEl=this.el.createChild({cls:"x-tip-anchor "+this.anchorCls})},afterRender:function(){Ext.ToolTip.superclass.afterRender.call(this);this.anchorEl.setStyle("z-index",this.el.getZIndex()+1).setVisibilityMode(Ext.Element.DISPLAY)},initTarget:function(c){var a;if((a=Ext.get(c))){if(this.target){var b=Ext.get(this.target);this.mun(b,"mouseover",this.onTargetOver,this);this.mun(b,"mouseout",this.onTargetOut,this);this.mun(b,"mousemove",this.onMouseMove,this)}this.mon(a,{mouseover:this.onTargetOver,mouseout:this.onTargetOut,mousemove:this.onMouseMove,scope:this});this.target=a}if(this.anchor){this.anchorTarget=this.target}},onMouseMove:function(b){var a=this.delegate?b.getTarget(this.delegate):this.triggerElement=true;if(a){this.targetXY=b.getXY();if(a===this.triggerElement){if(!this.hidden&&this.trackMouse){this.setPagePosition(this.getTargetXY())}}else{this.hide();this.lastActive=new Date(0);this.onTargetOver(b)}}else{if(!this.closable&&this.isVisible()){this.hide()}}},getTargetXY:function(){if(this.delegate){this.anchorTarget=this.triggerElement}if(this.anchor){this.targetCounter++;var c=this.getOffsets(),l=(this.anchorToTarget&&!this.trackMouse)?this.el.getAlignToXY(this.anchorTarget,this.getAnchorAlign()):this.targetXY,a=Ext.lib.Dom.getViewWidth()-5,h=Ext.lib.Dom.getViewHeight()-5,i=document.documentElement,e=document.body,k=(i.scrollLeft||e.scrollLeft||0)+5,j=(i.scrollTop||e.scrollTop||0)+5,b=[l[0]+c[0],l[1]+c[1]],g=this.getSize();this.anchorEl.removeClass(this.anchorCls);if(this.targetCounter<2){if(b[0]a){if(this.anchorToTarget){this.defaultAlign="r-l";if(this.mouseOffset){this.mouseOffset[0]*=-1}}this.anchor="right";return this.getTargetXY()}if(b[1]h){if(this.anchorToTarget){this.defaultAlign="b-t";if(this.mouseOffset){this.mouseOffset[1]*=-1}}this.anchor="bottom";return this.getTargetXY()}}this.anchorCls="x-tip-anchor-"+this.getAnchorPosition();this.anchorEl.addClass(this.anchorCls);this.targetCounter=0;return b}else{var d=this.getMouseOffset();return[this.targetXY[0]+d[0],this.targetXY[1]+d[1]]}},getMouseOffset:function(){var a=this.anchor?[0,0]:[15,18];if(this.mouseOffset){a[0]+=this.mouseOffset[0];a[1]+=this.mouseOffset[1]}return a},getAnchorPosition:function(){if(this.anchor){this.tipAnchor=this.anchor.charAt(0)}else{var a=this.defaultAlign.match(/^([a-z]+)-([a-z]+)(\?)?$/);if(!a){throw"AnchorTip.defaultAlign is invalid"}this.tipAnchor=a[1].charAt(0)}switch(this.tipAnchor){case"t":return"top";case"b":return"bottom";case"r":return"right"}return"left"},getAnchorAlign:function(){switch(this.anchor){case"top":return"tl-bl";case"left":return"tl-tr";case"right":return"tr-tl";default:return"bl-tl"}},getOffsets:function(){var b,a=this.getAnchorPosition().charAt(0);if(this.anchorToTarget&&!this.trackMouse){switch(a){case"t":b=[0,9];break;case"b":b=[0,-13];break;case"r":b=[-13,0];break;default:b=[9,0];break}}else{switch(a){case"t":b=[-15-this.anchorOffset,30];break;case"b":b=[-19-this.anchorOffset,-13-this.el.dom.offsetHeight];break;case"r":b=[-15-this.el.dom.offsetWidth,-13-this.anchorOffset];break;default:b=[25,-13-this.anchorOffset];break}}var c=this.getMouseOffset();b[0]+=c[0];b[1]+=c[1];return b},onTargetOver:function(b){if(this.disabled||b.within(this.target.dom,true)){return}var a=b.getTarget(this.delegate);if(a){this.triggerElement=a;this.clearTimer("hide");this.targetXY=b.getXY();this.delayShow()}},delayShow:function(){if(this.hidden&&!this.showTimer){if(this.lastActive.getElapsed()=c){d=c-b-5}}return{x:a,y:d}},beforeDestroy:function(){this.clearTimers();Ext.destroy(this.anchorEl);delete this.anchorEl;delete this.target;delete this.anchorTarget;delete this.triggerElement;Ext.ToolTip.superclass.beforeDestroy.call(this)},onDestroy:function(){Ext.getDoc().un("mousedown",this.onDocMouseDown,this);Ext.ToolTip.superclass.onDestroy.call(this)}});Ext.reg("tooltip",Ext.ToolTip);Ext.QuickTip=Ext.extend(Ext.ToolTip,{interceptTitles:false,tagConfig:{namespace:"ext",attribute:"qtip",width:"qwidth",target:"target",title:"qtitle",hide:"hide",cls:"qclass",align:"qalign",anchor:"anchor"},initComponent:function(){this.target=this.target||Ext.getDoc();this.targets=this.targets||{};Ext.QuickTip.superclass.initComponent.call(this)},register:function(e){var h=Ext.isArray(e)?e:arguments;for(var g=0,a=h.length;g1){var d=function(i,h){if(i&&h){var j=h.findChild(a,b);if(j){j.select();if(g){g(true,j)}}else{if(g){g(false,j)}}}else{if(g){g(false,j)}}};this.expandPath(c.join(this.pathSeparator),a,d)}else{this.root.select();if(g){g(true,this.root)}}},getTreeEl:function(){return this.body},onRender:function(b,a){Ext.tree.TreePanel.superclass.onRender.call(this,b,a);this.el.addClass("x-tree");this.innerCt=this.body.createChild({tag:"ul",cls:"x-tree-root-ct "+(this.useArrows?"x-tree-arrows":this.lines?"x-tree-lines":"x-tree-no-lines")})},initEvents:function(){Ext.tree.TreePanel.superclass.initEvents.call(this);if(this.containerScroll){Ext.dd.ScrollManager.register(this.body)}if((this.enableDD||this.enableDrop)&&!this.dropZone){this.dropZone=new Ext.tree.TreeDropZone(this,this.dropConfig||{ddGroup:this.ddGroup||"TreeDD",appendOnly:this.ddAppendOnly===true})}if((this.enableDD||this.enableDrag)&&!this.dragZone){this.dragZone=new Ext.tree.TreeDragZone(this,this.dragConfig||{ddGroup:this.ddGroup||"TreeDD",scroll:this.ddScroll})}this.getSelectionModel().init(this)},afterRender:function(){Ext.tree.TreePanel.superclass.afterRender.call(this);this.renderRoot()},beforeDestroy:function(){if(this.rendered){Ext.dd.ScrollManager.unregister(this.body);Ext.destroy(this.dropZone,this.dragZone)}this.destroyRoot();Ext.destroy(this.loader);this.nodeHash=this.root=this.loader=null;Ext.tree.TreePanel.superclass.beforeDestroy.call(this)},destroyRoot:function(){if(this.root&&this.root.destroy){this.root.destroy(true)}}});Ext.tree.TreePanel.nodeTypes={};Ext.reg("treepanel",Ext.tree.TreePanel);Ext.tree.TreeEventModel=function(a){this.tree=a;this.tree.on("render",this.initEvents,this)};Ext.tree.TreeEventModel.prototype={initEvents:function(){var a=this.tree;if(a.trackMouseOver!==false){a.mon(a.innerCt,{scope:this,mouseover:this.delegateOver,mouseout:this.delegateOut})}a.mon(a.getTreeEl(),{scope:this,click:this.delegateClick,dblclick:this.delegateDblClick,contextmenu:this.delegateContextMenu})},getNode:function(b){var a;if(a=b.getTarget(".x-tree-node-el",10)){var c=Ext.fly(a,"_treeEvents").getAttribute("tree-node-id","ext");if(c){return this.tree.getNodeById(c)}}return null},getNodeTarget:function(b){var a=b.getTarget(".x-tree-node-icon",1);if(!a){a=b.getTarget(".x-tree-node-el",6)}return a},delegateOut:function(b,a){if(!this.beforeEvent(b)){return}if(b.getTarget(".x-tree-ec-icon",1)){var c=this.getNode(b);this.onIconOut(b,c);if(c==this.lastEcOver){delete this.lastEcOver}}if((a=this.getNodeTarget(b))&&!b.within(a,true)){this.onNodeOut(b,this.getNode(b))}},delegateOver:function(b,a){if(!this.beforeEvent(b)){return}if(Ext.isGecko&&!this.trackingDoc){Ext.getBody().on("mouseover",this.trackExit,this);this.trackingDoc=true}if(this.lastEcOver){this.onIconOut(b,this.lastEcOver);delete this.lastEcOver}if(b.getTarget(".x-tree-ec-icon",1)){this.lastEcOver=this.getNode(b);this.onIconOver(b,this.lastEcOver)}if(a=this.getNodeTarget(b)){this.onNodeOver(b,this.getNode(b))}},trackExit:function(a){if(this.lastOverNode){if(this.lastOverNode.ui&&!a.within(this.lastOverNode.ui.getEl())){this.onNodeOut(a,this.lastOverNode)}delete this.lastOverNode;Ext.getBody().un("mouseover",this.trackExit,this);this.trackingDoc=false}},delegateClick:function(b,a){if(this.beforeEvent(b)){if(b.getTarget("input[type=checkbox]",1)){this.onCheckboxClick(b,this.getNode(b))}else{if(b.getTarget(".x-tree-ec-icon",1)){this.onIconClick(b,this.getNode(b))}else{if(this.getNodeTarget(b)){this.onNodeClick(b,this.getNode(b))}}}}else{this.checkContainerEvent(b,"click")}},delegateDblClick:function(b,a){if(this.beforeEvent(b)){if(this.getNodeTarget(b)){this.onNodeDblClick(b,this.getNode(b))}}else{this.checkContainerEvent(b,"dblclick")}},delegateContextMenu:function(b,a){if(this.beforeEvent(b)){if(this.getNodeTarget(b)){this.onNodeContextMenu(b,this.getNode(b))}}else{this.checkContainerEvent(b,"contextmenu")}},checkContainerEvent:function(b,a){if(this.disabled){b.stopEvent();return false}this.onContainerEvent(b,a)},onContainerEvent:function(b,a){this.tree.fireEvent("container"+a,this.tree,b)},onNodeClick:function(b,a){a.ui.onClick(b)},onNodeOver:function(b,a){this.lastOverNode=a;a.ui.onOver(b)},onNodeOut:function(b,a){a.ui.onOut(b)},onIconOver:function(b,a){a.ui.addClass("x-tree-ec-over")},onIconOut:function(b,a){a.ui.removeClass("x-tree-ec-over")},onIconClick:function(b,a){a.ui.ecClick(b)},onCheckboxClick:function(b,a){a.ui.onCheckChange(b)},onNodeDblClick:function(b,a){a.ui.onDblClick(b)},onNodeContextMenu:function(b,a){a.ui.onContextMenu(b)},beforeEvent:function(b){var a=this.getNode(b);if(this.disabled||!a||!a.ui){b.stopEvent();return false}return true},disable:function(){this.disabled=true},enable:function(){this.disabled=false}};Ext.tree.DefaultSelectionModel=Ext.extend(Ext.util.Observable,{constructor:function(a){this.selNode=null;this.addEvents("selectionchange","beforeselect");Ext.apply(this,a);Ext.tree.DefaultSelectionModel.superclass.constructor.call(this)},init:function(a){this.tree=a;a.mon(a.getTreeEl(),"keydown",this.onKeyDown,this);a.on("click",this.onNodeClick,this)},onNodeClick:function(a,b){this.select(a)},select:function(c,a){if(!Ext.fly(c.ui.wrap).isVisible()&&a){return a.call(this,c)}var b=this.selNode;if(c==b){c.ui.onSelectedChange(true)}else{if(this.fireEvent("beforeselect",this,c,b)!==false){if(b&&b.ui){b.ui.onSelectedChange(false)}this.selNode=c;c.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,c,b)}}return c},unselect:function(b,a){if(this.selNode==b){this.clearSelections(a)}},clearSelections:function(a){var b=this.selNode;if(b){b.ui.onSelectedChange(false);this.selNode=null;if(a!==true){this.fireEvent("selectionchange",this,null)}}return b},getSelectedNode:function(){return this.selNode},isSelected:function(a){return this.selNode==a},selectPrevious:function(a){if(!(a=a||this.selNode||this.lastSelNode)){return null}var c=a.previousSibling;if(c){if(!c.isExpanded()||c.childNodes.length<1){return this.select(c,this.selectPrevious)}else{var b=c.lastChild;while(b&&b.isExpanded()&&Ext.fly(b.ui.wrap).isVisible()&&b.childNodes.length>0){b=b.lastChild}return this.select(b,this.selectPrevious)}}else{if(a.parentNode&&(this.tree.rootVisible||!a.parentNode.isRoot)){return this.select(a.parentNode,this.selectPrevious)}}return null},selectNext:function(b){if(!(b=b||this.selNode||this.lastSelNode)){return null}if(b.firstChild&&b.isExpanded()&&Ext.fly(b.ui.wrap).isVisible()){return this.select(b.firstChild,this.selectNext)}else{if(b.nextSibling){return this.select(b.nextSibling,this.selectNext)}else{if(b.parentNode){var a=null;b.parentNode.bubble(function(){if(this.nextSibling){a=this.getOwnerTree().selModel.select(this.nextSibling,this.selectNext);return false}});return a}}}return null},onKeyDown:function(c){var b=this.selNode||this.lastSelNode;var d=this;if(!b){return}var a=c.getKey();switch(a){case c.DOWN:c.stopEvent();this.selectNext();break;case c.UP:c.stopEvent();this.selectPrevious();break;case c.RIGHT:c.preventDefault();if(b.hasChildNodes()){if(!b.isExpanded()){b.expand()}else{if(b.firstChild){this.select(b.firstChild,c)}}}break;case c.LEFT:c.preventDefault();if(b.hasChildNodes()&&b.isExpanded()){b.collapse()}else{if(b.parentNode&&(this.tree.rootVisible||b.parentNode!=this.tree.getRootNode())){this.select(b.parentNode,c)}}break}}});Ext.tree.MultiSelectionModel=Ext.extend(Ext.util.Observable,{constructor:function(a){this.selNodes=[];this.selMap={};this.addEvents("selectionchange");Ext.apply(this,a);Ext.tree.MultiSelectionModel.superclass.constructor.call(this)},init:function(a){this.tree=a;a.mon(a.getTreeEl(),"keydown",this.onKeyDown,this);a.on("click",this.onNodeClick,this)},onNodeClick:function(a,b){if(b.ctrlKey&&this.isSelected(a)){this.unselect(a)}else{this.select(a,b,b.ctrlKey)}},select:function(a,c,b){if(b!==true){this.clearSelections(true)}if(this.isSelected(a)){this.lastSelNode=a;return a}this.selNodes.push(a);this.selMap[a.id]=a;this.lastSelNode=a;a.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,this.selNodes);return a},unselect:function(b){if(this.selMap[b.id]){b.ui.onSelectedChange(false);var c=this.selNodes;var a=c.indexOf(b);if(a!=-1){this.selNodes.splice(a,1)}delete this.selMap[b.id];this.fireEvent("selectionchange",this,this.selNodes)}},clearSelections:function(b){var d=this.selNodes;if(d.length>0){for(var c=0,a=d.length;c0},isExpandable:function(){return this.attributes.expandable||this.hasChildNodes()},appendChild:function(e){var g=false;if(Ext.isArray(e)){g=e}else{if(arguments.length>1){g=arguments}}if(g){for(var d=0,a=g.length;d0){var g=d?function(){e.apply(d,arguments)}:e;c.sort(g);for(var b=0;b
    ','',this.indentMarkup,"",'','',g?('':"/>")):"",'',e.text,"
    ",'',""].join("");if(l!==true&&e.nextSibling&&(b=e.nextSibling.ui.getEl())){this.wrap=Ext.DomHelper.insertHtml("beforeBegin",b,d)}else{this.wrap=Ext.DomHelper.insertHtml("beforeEnd",j,d)}this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1];var i=this.elNode.childNodes;this.indentNode=i[0];this.ecNode=i[1];this.iconNode=i[2];var h=3;if(g){this.checkbox=i[3];this.checkbox.defaultChecked=this.checkbox.checked;h++}this.anchor=i[h];this.textNode=i[h].firstChild},getHref:function(a){return Ext.isEmpty(a)?(Ext.isGecko?"":"#"):a},getAnchor:function(){return this.anchor},getTextEl:function(){return this.textNode},getIconEl:function(){return this.iconNode},isChecked:function(){return this.checkbox?this.checkbox.checked:false},updateExpandIcon:function(){if(this.rendered){var g=this.node,d,c,a=g.isLast()?"x-tree-elbow-end":"x-tree-elbow",e=g.hasChildNodes();if(e||g.attributes.expandable){if(g.expanded){a+="-minus";d="x-tree-node-collapsed";c="x-tree-node-expanded"}else{a+="-plus";d="x-tree-node-expanded";c="x-tree-node-collapsed"}if(this.wasLeaf){this.removeClass("x-tree-node-leaf");this.wasLeaf=false}if(this.c1!=d||this.c2!=c){Ext.fly(this.elNode).replaceClass(d,c);this.c1=d;this.c2=c}}else{if(!this.wasLeaf){Ext.fly(this.elNode).replaceClass("x-tree-node-expanded","x-tree-node-collapsed");delete this.c1;delete this.c2;this.wasLeaf=true}}var b="x-tree-ec-icon "+a;if(this.ecc!=b){this.ecNode.className=b;this.ecc=b}}},onIdChange:function(a){if(this.rendered){this.elNode.setAttribute("ext:tree-node-id",a)}},getChildIndent:function(){if(!this.childIndent){var a=[],b=this.node;while(b){if(!b.isRoot||(b.isRoot&&b.ownerTree.rootVisible)){if(!b.isLast()){a.unshift('')}else{a.unshift('')}}b=b.parentNode}this.childIndent=a.join("")}return this.childIndent},renderIndent:function(){if(this.rendered){var a="",b=this.node.parentNode;if(b){a=b.ui.getChildIndent()}if(this.indentMarkup!=a){this.indentNode.innerHTML=a;this.indentMarkup=a}this.updateExpandIcon()}},destroy:function(){if(this.elNode){Ext.dd.Registry.unregister(this.elNode.id)}Ext.each(["textnode","anchor","checkbox","indentNode","ecNode","iconNode","elNode","ctNode","wrap","holder"],function(a){if(this[a]){Ext.fly(this[a]).remove();delete this[a]}},this);delete this.node}});Ext.tree.RootTreeNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{render:function(){if(!this.rendered){var a=this.node.ownerTree.innerCt.dom;this.node.expanded=true;a.innerHTML='
    ';this.wrap=this.ctNode=a.firstChild}},collapse:Ext.emptyFn,expand:Ext.emptyFn});Ext.tree.TreeLoader=function(a){this.baseParams={};Ext.apply(this,a);this.addEvents("beforeload","load","loadexception");Ext.tree.TreeLoader.superclass.constructor.call(this);if(Ext.isString(this.paramOrder)){this.paramOrder=this.paramOrder.split(/[\s,|]/)}};Ext.extend(Ext.tree.TreeLoader,Ext.util.Observable,{uiProviders:{},clearOnLoad:true,paramOrder:undefined,paramsAsHash:false,nodeParameter:"node",directFn:undefined,load:function(b,c,a){if(this.clearOnLoad){while(b.firstChild){b.removeChild(b.firstChild)}}if(this.doPreload(b)){this.runCallback(c,a||b,[b])}else{if(this.directFn||this.dataUrl||this.url){this.requestData(b,c,a||b)}}},doPreload:function(d){if(d.attributes.children){if(d.childNodes.length<1){var c=d.attributes.children;d.beginUpdate();for(var b=0,a=c.length;b-1){c=[]}for(var d=0,a=b.length;dp){return e?-1:1}}return 0}},doSort:function(a){a.sort(this.sortFn)},updateSort:function(a,b){if(b.childrenRendered){this.doSort.defer(1,this,[b])}},updateSortParent:function(a){var b=a.parentNode;if(b&&b.childrenRendered){this.doSort.defer(1,this,[b])}}});if(Ext.dd.DropZone){Ext.tree.TreeDropZone=function(a,b){this.allowParentInsert=b.allowParentInsert||false;this.allowContainerDrop=b.allowContainerDrop||false;this.appendOnly=b.appendOnly||false;Ext.tree.TreeDropZone.superclass.constructor.call(this,a.getTreeEl(),b);this.tree=a;this.dragOverData={};this.lastInsertClass="x-tree-no-status"};Ext.extend(Ext.tree.TreeDropZone,Ext.dd.DropZone,{ddGroup:"TreeDD",expandDelay:1000,expandNode:function(a){if(a.hasChildNodes()&&!a.isExpanded()){a.expand(false,null,this.triggerCacheRefresh.createDelegate(this))}},queueExpand:function(a){this.expandProcId=this.expandNode.defer(this.expandDelay,this,[a])},cancelExpand:function(){if(this.expandProcId){clearTimeout(this.expandProcId);this.expandProcId=false}},isValidDropPoint:function(a,k,i,d,c){if(!a||!c){return false}var g=a.node;var h=c.node;if(!(g&&g.isTarget&&k)){return false}if(k=="append"&&g.allowChildren===false){return false}if((k=="above"||k=="below")&&(g.parentNode&&g.parentNode.allowChildren===false)){return false}if(h&&(g==h||h.contains(g))){return false}var b=this.dragOverData;b.tree=this.tree;b.target=g;b.data=c;b.point=k;b.source=i;b.rawEvent=d;b.dropNode=h;b.cancel=false;var j=this.tree.fireEvent("nodedragover",b);return b.cancel===false&&j!==false},getDropPoint:function(h,g,l){var m=g.node;if(m.isRoot){return m.allowChildren!==false?"append":false}var c=g.ddel;var o=Ext.lib.Dom.getY(c),j=o+c.offsetHeight;var i=Ext.lib.Event.getPageY(h);var k=m.allowChildren===false||m.isLeaf();if(this.appendOnly||m.parentNode.allowChildren===false){return k?false:"append"}var d=false;if(!this.allowParentInsert){d=m.hasChildNodes()&&m.isExpanded()}var a=(j-o)/(k?2:3);if(i>=o&&i<(o+a)){return"above"}else{if(!d&&(k||i>=j-a&&i<=j)){return"below"}else{return"append"}}},onNodeEnter:function(d,a,c,b){this.cancelExpand()},onContainerOver:function(a,c,b){if(this.allowContainerDrop&&this.isValidDropPoint({ddel:this.tree.getRootNode().ui.elNode,node:this.tree.getRootNode()},"append",a,c,b)){return this.dropAllowed}return this.dropNotAllowed},onNodeOver:function(b,i,h,g){var k=this.getDropPoint(h,b,i);var c=b.node;if(!this.expandProcId&&k=="append"&&c.hasChildNodes()&&!b.node.isExpanded()){this.queueExpand(c)}else{if(k!="append"){this.cancelExpand()}}var d=this.dropNotAllowed;if(this.isValidDropPoint(b,k,i,h,g)){if(k){var a=b.ddel;var j;if(k=="above"){d=b.node.isFirst()?"x-tree-drop-ok-above":"x-tree-drop-ok-between";j="x-tree-drag-insert-above"}else{if(k=="below"){d=b.node.isLast()?"x-tree-drop-ok-below":"x-tree-drop-ok-between";j="x-tree-drag-insert-below"}else{d="x-tree-drop-ok-append";j="x-tree-drag-append"}}if(this.lastInsertClass!=j){Ext.fly(a).replaceClass(this.lastInsertClass,j);this.lastInsertClass=j}}}return d},onNodeOut:function(d,a,c,b){this.cancelExpand();this.removeDropIndicators(d)},onNodeDrop:function(i,b,h,d){var a=this.getDropPoint(h,i,b);var g=i.node;g.ui.startDrop();if(!this.isValidDropPoint(i,a,b,h,d)){g.ui.endDrop();return false}var c=d.node||(b.getTreeNode?b.getTreeNode(d,g,a,h):null);return this.processDrop(g,d,a,b,h,c)},onContainerDrop:function(a,g,c){if(this.allowContainerDrop&&this.isValidDropPoint({ddel:this.tree.getRootNode().ui.elNode,node:this.tree.getRootNode()},"append",a,g,c)){var d=this.tree.getRootNode();d.ui.startDrop();var b=c.node||(a.getTreeNode?a.getTreeNode(c,d,"append",g):null);return this.processDrop(d,c,"append",a,g,b)}return false},processDrop:function(j,h,b,a,i,d){var g={tree:this.tree,target:j,data:h,point:b,source:a,rawEvent:i,dropNode:d,cancel:!d,dropStatus:false};var c=this.tree.fireEvent("beforenodedrop",g);if(c===false||g.cancel===true||!g.dropNode){j.ui.endDrop();return g.dropStatus}j=g.target;if(b=="append"&&!j.isExpanded()){j.expand(false,null,function(){this.completeDrop(g)}.createDelegate(this))}else{this.completeDrop(g)}return true},completeDrop:function(h){var d=h.dropNode,e=h.point,c=h.target;if(!Ext.isArray(d)){d=[d]}var g;for(var b=0,a=d.length;bd.offsetLeft){e.scrollLeft=d.offsetLeft}var a=Math.min(this.maxWidth,(e.clientWidth>20?e.clientWidth:e.offsetWidth)-Math.max(0,d.offsetLeft-e.scrollLeft)-5);this.setSize(a,"")},triggerEdit:function(a,c){this.completeEdit();if(a.attributes.editable!==false){this.editNode=a;if(this.tree.autoScroll){Ext.fly(a.ui.getEl()).scrollIntoView(this.tree.body)}var b=a.text||"";if(!Ext.isGecko&&Ext.isEmpty(a.text)){a.setText(" ")}this.autoEditTimer=this.startEdit.defer(this.editDelay,this,[a.ui.textNode,b]);return false}},bindScroll:function(){this.tree.getTreeEl().on("scroll",this.cancelEdit,this)},beforeNodeClick:function(a,b){clearTimeout(this.autoEditTimer);if(this.tree.getSelectionModel().isSelected(a)){b.stopEvent();return this.triggerEdit(a)}},onNodeDblClick:function(a,b){clearTimeout(this.autoEditTimer)},updateNode:function(a,b){this.tree.getTreeEl().un("scroll",this.cancelEdit,this);this.editNode.setText(b)},onHide:function(){Ext.tree.TreeEditor.superclass.onHide.call(this);if(this.editNode){this.editNode.ui.focus.defer(50,this.editNode.ui)}},onSpecialKey:function(c,b){var a=b.getKey();if(a==b.ESC){b.stopEvent();this.cancelEdit()}else{if(a==b.ENTER&&!b.hasModifier()){b.stopEvent();this.completeEdit()}}},onDestroy:function(){clearTimeout(this.autoEditTimer);Ext.tree.TreeEditor.superclass.onDestroy.call(this);var a=this.tree;a.un("beforeclick",this.beforeNodeClick,this);a.un("dblclick",this.onNodeDblClick,this)}}); /* SWFObject v2.2 is released under the MIT License */ var swfobject=function(){var E="undefined",s="object",T="Shockwave Flash",X="ShockwaveFlash.ShockwaveFlash",r="application/x-shockwave-flash",S="SWFObjectExprInst",y="onreadystatechange",P=window,k=document,u=navigator,U=false,V=[i],p=[],O=[],J=[],m,R,F,C,K=false,a=false,o,H,n=true,N=function(){var ab=typeof k.getElementById!=E&&typeof k.getElementsByTagName!=E&&typeof k.createElement!=E,ai=u.userAgent.toLowerCase(),Z=u.platform.toLowerCase(),af=Z?(/win/).test(Z):/win/.test(ai),ad=Z?(/mac/).test(Z):/mac/.test(ai),ag=/webkit/.test(ai)?parseFloat(ai.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,Y=!+"\v1",ah=[0,0,0],ac=null;if(typeof u.plugins!=E&&typeof u.plugins[T]==s){ac=u.plugins[T].description;if(ac&&!(typeof u.mimeTypes!=E&&u.mimeTypes[r]&&!u.mimeTypes[r].enabledPlugin)){U=true;Y=false;ac=ac.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ah[0]=parseInt(ac.replace(/^(.*)\..*$/,"$1"),10);ah[1]=parseInt(ac.replace(/^.*\.(.*)\s.*$/,"$1"),10);ah[2]=/[a-zA-Z]/.test(ac)?parseInt(ac.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof P.ActiveXObject!=E){try{var ae=new ActiveXObject(X);if(ae){ac=ae.GetVariable("$version");if(ac){Y=true;ac=ac.split(" ")[1].split(",");ah=[parseInt(ac[0],10),parseInt(ac[1],10),parseInt(ac[2],10)]}}}catch(aa){}}}return{w3:ab,pv:ah,wk:ag,ie:Y,win:af,mac:ad}}(),l=function(){if(!N.w3){return}if((typeof k.readyState!=E&&k.readyState=="complete")||(typeof k.readyState==E&&(k.getElementsByTagName("body")[0]||k.body))){g()}if(!K){if(typeof k.addEventListener!=E){k.addEventListener("DOMContentLoaded",g,false)}if(N.ie&&N.win){k.attachEvent(y,function(){if(k.readyState=="complete"){k.detachEvent(y,arguments.callee);g()}});if(P==top){(function(){if(K){return}try{k.documentElement.doScroll("left")}catch(Y){setTimeout(arguments.callee,0);return}g()})()}}if(N.wk){(function(){if(K){return}if(!(/loaded|complete/).test(k.readyState)){setTimeout(arguments.callee,0);return}g()})()}t(g)}}();function g(){if(K){return}try{var aa=k.getElementsByTagName("body")[0].appendChild(D("span"));aa.parentNode.removeChild(aa)}catch(ab){return}K=true;var Y=V.length;for(var Z=0;Z0){for(var ag=0;ag0){var af=c(Z);if(af){if(G(p[ag].swfVersion)&&!(N.wk&&N.wk<312)){x(Z,true);if(ac){ab.success=true;ab.ref=A(Z);ac(ab)}}else{if(p[ag].expressInstall&&B()){var aj={};aj.data=p[ag].expressInstall;aj.width=af.getAttribute("width")||"0";aj.height=af.getAttribute("height")||"0";if(af.getAttribute("class")){aj.styleclass=af.getAttribute("class")}if(af.getAttribute("align")){aj.align=af.getAttribute("align")}var ai={};var Y=af.getElementsByTagName("param");var ad=Y.length;for(var ae=0;ae'}}ab.outerHTML='"+ag+"";O[O.length]=aj.id;Y=c(aj.id)}else{var aa=D(s);aa.setAttribute("type",r);for(var ad in aj){if(aj[ad]!=Object.prototype[ad]){if(ad.toLowerCase()=="styleclass"){aa.setAttribute("class",aj[ad])}else{if(ad.toLowerCase()!="classid"){aa.setAttribute(ad,aj[ad])}}}}for(var ac in ah){if(ah[ac]!=Object.prototype[ac]&&ac.toLowerCase()!="movie"){e(aa,ac,ah[ac])}}ab.parentNode.replaceChild(aa,ab);Y=aa}}return Y}function e(aa,Y,Z){var ab=D("param");ab.setAttribute("name",Y);ab.setAttribute("value",Z);aa.appendChild(ab)}function z(Z){var Y=c(Z);if(Y&&Y.nodeName=="OBJECT"){if(N.ie&&N.win){Y.style.display="none";(function(){if(Y.readyState==4){b(Z)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.removeChild(Y)}}}function b(aa){var Z=c(aa);if(Z){for(var Y in Z){if(typeof Z[Y]=="function"){Z[Y]=null}}Z.parentNode.removeChild(Z)}}function c(aa){var Y=null;try{Y=k.getElementById(aa)}catch(Z){}return Y}function D(Y){return k.createElement(Y)}function j(aa,Y,Z){aa.attachEvent(Y,Z);J[J.length]=[aa,Y,Z]}function G(aa){var Z=N.pv,Y=aa.split(".");Y[0]=parseInt(Y[0],10);Y[1]=parseInt(Y[1],10)||0;Y[2]=parseInt(Y[2],10)||0;return(Z[0]>Y[0]||(Z[0]==Y[0]&&Z[1]>Y[1])||(Z[0]==Y[0]&&Z[1]==Y[1]&&Z[2]>=Y[2]))?true:false}function w(ad,Z,ae,ac){if(N.ie&&N.mac){return}var ab=k.getElementsByTagName("head")[0];if(!ab){return}var Y=(ae&&typeof ae=="string")?ae:"screen";if(ac){o=null;H=null}if(!o||H!=Y){var aa=D("style");aa.setAttribute("type","text/css");aa.setAttribute("media",Y);o=ab.appendChild(aa);if(N.ie&&N.win&&typeof k.styleSheets!=E&&k.styleSheets.length>0){o=k.styleSheets[k.styleSheets.length-1]}H=Y}if(N.ie&&N.win){if(o&&typeof o.addRule==s){o.addRule(ad,Z)}}else{if(o&&typeof k.createTextNode!=E){o.appendChild(k.createTextNode(ad+" {"+Z+"}"))}}}function x(aa,Y){if(!n){return}var Z=Y?"visible":"hidden";if(K&&c(aa)){c(aa).style.visibility=Z}else{w("#"+aa,"visibility:"+Z)}}function M(Z){var aa=/[\\\"<>\.;]/;var Y=aa.exec(Z)!=null;return Y&&typeof encodeURIComponent!=E?encodeURIComponent(Z):Z}var d=function(){if(N.ie&&N.win){window.attachEvent("onunload",function(){var ad=J.length;for(var ac=0;ac0){for(h=0;h-1&&e.position=="left"){e.position="bottom"}return e},onDestroy:function(){Ext.chart.CartesianChart.superclass.onDestroy.call(this);Ext.each(this.labelFn,function(a){this.removeFnProxy(a)},this)}});Ext.reg("cartesianchart",Ext.chart.CartesianChart);Ext.chart.LineChart=Ext.extend(Ext.chart.CartesianChart,{type:"line"});Ext.reg("linechart",Ext.chart.LineChart);Ext.chart.ColumnChart=Ext.extend(Ext.chart.CartesianChart,{type:"column"});Ext.reg("columnchart",Ext.chart.ColumnChart);Ext.chart.StackedColumnChart=Ext.extend(Ext.chart.CartesianChart,{type:"stackcolumn"});Ext.reg("stackedcolumnchart",Ext.chart.StackedColumnChart);Ext.chart.BarChart=Ext.extend(Ext.chart.CartesianChart,{type:"bar"});Ext.reg("barchart",Ext.chart.BarChart);Ext.chart.StackedBarChart=Ext.extend(Ext.chart.CartesianChart,{type:"stackbar"});Ext.reg("stackedbarchart",Ext.chart.StackedBarChart);Ext.chart.Axis=function(a){Ext.apply(this,a)};Ext.chart.Axis.prototype={type:null,orientation:"horizontal",reverse:false,labelFunction:null,hideOverlappingLabels:true,labelSpacing:2};Ext.chart.NumericAxis=Ext.extend(Ext.chart.Axis,{type:"numeric",minimum:NaN,maximum:NaN,majorUnit:NaN,minorUnit:NaN,snapToUnits:true,alwaysShowZero:true,scale:"linear",roundMajorUnit:true,calculateByLabelSize:true,position:"left",adjustMaximumByMajorUnit:true,adjustMinimumByMajorUnit:true});Ext.chart.TimeAxis=Ext.extend(Ext.chart.Axis,{type:"time",minimum:null,maximum:null,majorUnit:NaN,majorTimeUnit:null,minorUnit:NaN,minorTimeUnit:null,snapToUnits:true,stackingEnabled:false,calculateByLabelSize:true});Ext.chart.CategoryAxis=Ext.extend(Ext.chart.Axis,{type:"category",categoryNames:null,calculateCategoryCount:false});Ext.chart.Series=function(a){Ext.apply(this,a)};Ext.chart.Series.prototype={type:null,displayName:null};Ext.chart.CartesianSeries=Ext.extend(Ext.chart.Series,{xField:null,yField:null,showInLegend:true,axis:"primary"});Ext.chart.ColumnSeries=Ext.extend(Ext.chart.CartesianSeries,{type:"column"});Ext.chart.LineSeries=Ext.extend(Ext.chart.CartesianSeries,{type:"line"});Ext.chart.BarSeries=Ext.extend(Ext.chart.CartesianSeries,{type:"bar"});Ext.chart.PieSeries=Ext.extend(Ext.chart.Series,{type:"pie",dataField:null,categoryField:null});Ext.menu.Menu=Ext.extend(Ext.Container,{minWidth:120,shadow:"sides",subMenuAlign:"tl-tr?",defaultAlign:"tl-bl?",allowOtherMenus:false,ignoreParentClicks:false,enableScrolling:true,maxHeight:null,scrollIncrement:24,showSeparator:true,defaultOffsets:[0,0],plain:false,floating:true,zIndex:15000,hidden:true,layout:"menu",hideMode:"offsets",scrollerHeight:8,autoLayout:true,defaultType:"menuitem",bufferResize:false,initComponent:function(){if(Ext.isArray(this.initialConfig)){Ext.apply(this,{items:this.initialConfig})}this.addEvents("click","mouseover","mouseout","itemclick");Ext.menu.MenuMgr.register(this);if(this.floating){Ext.EventManager.onWindowResize(this.hide,this)}else{if(this.initialConfig.hidden!==false){this.hidden=false}this.internalDefaults={hideOnClick:false}}Ext.menu.Menu.superclass.initComponent.call(this);if(this.autoLayout){var a=this.doLayout.createDelegate(this,[]);this.on({add:a,remove:a})}},getLayoutTarget:function(){return this.ul},onRender:function(b,a){if(!b){b=Ext.getBody()}var c={id:this.getId(),cls:"x-menu "+((this.floating)?"x-menu-floating x-layer ":"")+(this.cls||"")+(this.plain?" x-menu-plain":"")+(this.showSeparator?"":" x-menu-nosep"),style:this.style,cn:[{tag:"a",cls:"x-menu-focus",href:"#",onclick:"return false;",tabIndex:"-1"},{tag:"ul",cls:"x-menu-list"}]};if(this.floating){this.el=new Ext.Layer({shadow:this.shadow,dh:c,constrain:false,parentEl:b,zindex:this.zIndex})}else{this.el=b.createChild(c)}Ext.menu.Menu.superclass.onRender.call(this,b,a);if(!this.keyNav){this.keyNav=new Ext.menu.MenuNav(this)}this.focusEl=this.el.child("a.x-menu-focus");this.ul=this.el.child("ul.x-menu-list");this.mon(this.ul,{scope:this,click:this.onClick,mouseover:this.onMouseOver,mouseout:this.onMouseOut});if(this.enableScrolling){this.mon(this.el,{scope:this,delegate:".x-menu-scroller",click:this.onScroll,mouseover:this.deactivateActive})}},findTargetItem:function(b){var a=b.getTarget(".x-menu-list-item",this.ul,true);if(a&&a.menuItemId){return this.items.get(a.menuItemId)}},onClick:function(b){var a=this.findTargetItem(b);if(a){if(a.isFormField){this.setActiveItem(a)}else{if(a instanceof Ext.menu.BaseItem){if(a.menu&&this.ignoreParentClicks){a.expandMenu();b.preventDefault()}else{if(a.onClick){a.onClick(b);this.fireEvent("click",this,a,b)}}}}}},setActiveItem:function(a,b){if(a!=this.activeItem){this.deactivateActive();if((this.activeItem=a).isFormField){a.focus()}else{a.activate(b)}}else{if(b){a.expandMenu()}}},deactivateActive:function(){var b=this.activeItem;if(b){if(b.isFormField){if(b.collapse){b.collapse()}}else{b.deactivate()}delete this.activeItem}},tryActivate:function(g,e){var b=this.items;for(var c=g,a=b.length;c>=0&&c=a.scrollHeight){this.onScrollerOut(null,b)}},onScrollerIn:function(d,b){var a=this.ul.dom,c=Ext.fly(b).is(".x-menu-scroller-top");if(c?a.scrollTop>0:a.scrollTop+this.activeMaxc){b=c;a=i-h}else{if(bb&&b>0){this.activeMax=b-this.scrollerHeight*2-this.el.getFrameWidth("tb")-Ext.num(this.el.shadowOffset,0);this.ul.setHeight(this.activeMax);this.createScrollers();this.el.select(".x-menu-scroller").setDisplayed("")}else{this.ul.setHeight(d);this.el.select(".x-menu-scroller").setDisplayed("none")}this.ul.dom.scrollTop=0;return a},createScrollers:function(){if(!this.scroller){this.scroller={pos:0,top:this.el.insertFirst({tag:"div",cls:"x-menu-scroller x-menu-scroller-top",html:" "}),bottom:this.el.createChild({tag:"div",cls:"x-menu-scroller x-menu-scroller-bottom",html:" "})};this.scroller.top.hover(this.onScrollerIn,this.onScrollerOut,this);this.scroller.topRepeater=new Ext.util.ClickRepeater(this.scroller.top,{listeners:{click:this.onScroll.createDelegate(this,[null,this.scroller.top],false)}});this.scroller.bottom.hover(this.onScrollerIn,this.onScrollerOut,this);this.scroller.bottomRepeater=new Ext.util.ClickRepeater(this.scroller.bottom,{listeners:{click:this.onScroll.createDelegate(this,[null,this.scroller.bottom],false)}})}},onLayout:function(){if(this.isVisible()){if(this.enableScrolling){this.constrainScroll(this.el.getTop())}if(this.floating){this.el.sync()}}},focus:function(){if(!this.hidden){this.doFocus.defer(50,this)}},doFocus:function(){if(!this.hidden){this.focusEl.focus()}},hide:function(a){if(!this.isDestroyed){this.deepHide=a;Ext.menu.Menu.superclass.hide.call(this);delete this.deepHide}},onHide:function(){Ext.menu.Menu.superclass.onHide.call(this);this.deactivateActive();if(this.el&&this.floating){this.el.hide()}var a=this.parentMenu;if(this.deepHide===true&&a){if(a.floating){a.hide(true)}else{a.deactivateActive()}}},lookupComponent:function(a){if(Ext.isString(a)){a=(a=="separator"||a=="-")?new Ext.menu.Separator():new Ext.menu.TextItem(a);this.applyDefaults(a)}else{if(Ext.isObject(a)){a=this.getMenuItem(a)}else{if(a.tagName||a.el){a=new Ext.BoxComponent({el:a})}}}return a},applyDefaults:function(b){if(!Ext.isString(b)){b=Ext.menu.Menu.superclass.applyDefaults.call(this,b);var a=this.internalDefaults;if(a){if(b.events){Ext.applyIf(b.initialConfig,a);Ext.apply(b,a)}else{Ext.applyIf(b,a)}}}return b},getMenuItem:function(a){a.ownerCt=this;if(!a.isXType){if(!a.xtype&&Ext.isBoolean(a.checked)){return new Ext.menu.CheckItem(a)}return Ext.create(a,this.defaultType)}return a},addSeparator:function(){return this.add(new Ext.menu.Separator())},addElement:function(a){return this.add(new Ext.menu.BaseItem({el:a}))},addItem:function(a){return this.add(a)},addMenuItem:function(a){return this.add(this.getMenuItem(a))},addText:function(a){return this.add(new Ext.menu.TextItem(a))},onDestroy:function(){Ext.EventManager.removeResizeListener(this.hide,this);var a=this.parentMenu;if(a&&a.activeChild==this){delete a.activeChild}delete this.parentMenu;Ext.menu.Menu.superclass.onDestroy.call(this);Ext.menu.MenuMgr.unregister(this);if(this.keyNav){this.keyNav.disable()}var b=this.scroller;if(b){Ext.destroy(b.topRepeater,b.bottomRepeater,b.top,b.bottom)}Ext.destroy(this.el,this.focusEl,this.ul)}});Ext.reg("menu",Ext.menu.Menu);Ext.menu.MenuNav=Ext.extend(Ext.KeyNav,function(){function a(d,c){if(!c.tryActivate(c.items.indexOf(c.activeItem)-1,-1)){c.tryActivate(c.items.length-1,-1)}}function b(d,c){if(!c.tryActivate(c.items.indexOf(c.activeItem)+1,1)){c.tryActivate(0,1)}}return{constructor:function(c){Ext.menu.MenuNav.superclass.constructor.call(this,c.el);this.scope=this.menu=c},doRelay:function(g,d){var c=g.getKey();if(this.menu.activeItem&&this.menu.activeItem.isFormField&&c!=g.TAB){return false}if(!this.menu.activeItem&&g.isNavKeyPress()&&c!=g.SPACE&&c!=g.RETURN){this.menu.tryActivate(0,1);return false}return d.call(this.scope||this,g,this.menu)},tab:function(d,c){d.stopEvent();if(d.shiftKey){a(d,c)}else{b(d,c)}},up:a,down:b,right:function(d,c){if(c.activeItem){c.activeItem.expandMenu(true)}},left:function(d,c){c.hide();if(c.parentMenu&&c.parentMenu.activeItem){c.parentMenu.activeItem.activate()}},enter:function(d,c){if(c.activeItem){d.stopPropagation();c.activeItem.onClick(d);c.fireEvent("click",this,c.activeItem);return true}}}}());Ext.menu.MenuMgr=function(){var h,e,b,d={},a=false,l=new Date();function n(){h={};e=new Ext.util.MixedCollection();b=Ext.getDoc().addKeyListener(27,j);b.disable()}function j(){if(e&&e.length>0){var o=e.clone();o.each(function(p){p.hide()});return true}return false}function g(o){e.remove(o);if(e.length<1){b.disable();Ext.getDoc().un("mousedown",m);a=false}}function k(o){var p=e.last();l=new Date();e.add(o);if(!a){b.enable();Ext.getDoc().on("mousedown",m);a=true}if(o.parentMenu){o.getEl().setZIndex(parseInt(o.parentMenu.getEl().getStyle("z-index"),10)+3);o.parentMenu.activeChild=o}else{if(p&&!p.isDestroyed&&p.isVisible()){o.getEl().setZIndex(parseInt(p.getEl().getStyle("z-index"),10)+3)}}}function c(o){if(o.activeChild){o.activeChild.hide()}if(o.autoHideTimer){clearTimeout(o.autoHideTimer);delete o.autoHideTimer}}function i(o){var p=o.parentMenu;if(!p&&!o.allowOtherMenus){j()}else{if(p&&p.activeChild){p.activeChild.hide()}}}function m(o){if(l.getElapsed()>50&&e.length>0&&!o.getTarget(".x-menu")){j()}}return{hideAll:function(){return j()},register:function(o){if(!h){n()}h[o.id]=o;o.on({beforehide:c,hide:g,beforeshow:i,show:k})},get:function(o){if(typeof o=="string"){if(!h){return null}return h[o]}else{if(o.events){return o}else{if(typeof o.length=="number"){return new Ext.menu.Menu({items:o})}else{return Ext.create(o,"menu")}}}},unregister:function(o){delete h[o.id];o.un("beforehide",c);o.un("hide",g);o.un("beforeshow",i);o.un("show",k)},registerCheckable:function(o){var p=o.group;if(p){if(!d[p]){d[p]=[]}d[p].push(o)}},unregisterCheckable:function(o){var p=o.group;if(p){d[p].remove(o)}},onCheckChange:function(q,r){if(q.group&&r){var t=d[q.group],p=0,o=t.length,s;for(;p',' target="{hrefTarget}"',"",">",'{altText}','{text}',"")}var c=this.getTemplateArgs();this.el=b?this.itemTpl.insertBefore(b,c,true):this.itemTpl.append(d,c,true);this.iconEl=this.el.child("img.x-menu-item-icon");this.textEl=this.el.child(".x-menu-item-text");if(!this.href){this.mon(this.el,"click",Ext.emptyFn,null,{preventDefault:true})}Ext.menu.Item.superclass.onRender.call(this,d,b)},getTemplateArgs:function(){return{id:this.id,cls:this.itemCls+(this.menu?" x-menu-item-arrow":"")+(this.cls?" "+this.cls:""),href:this.href||"#",hrefTarget:this.hrefTarget,icon:this.icon||Ext.BLANK_IMAGE_URL,iconCls:this.iconCls||"",text:this.itemText||this.text||" ",altText:this.altText||""}},setText:function(a){this.text=a||" ";if(this.rendered){this.textEl.update(this.text);this.parentMenu.layout.doAutoSize()}},setIconClass:function(a){var b=this.iconCls;this.iconCls=a;if(this.rendered){this.iconEl.replaceClass(b,this.iconCls)}},beforeDestroy:function(){clearTimeout(this.showTimer);clearTimeout(this.hideTimer);if(this.menu){delete this.menu.ownerCt;this.menu.destroy()}Ext.menu.Item.superclass.beforeDestroy.call(this)},handleClick:function(a){if(!this.href){a.stopEvent()}Ext.menu.Item.superclass.handleClick.apply(this,arguments)},activate:function(a){if(Ext.menu.Item.superclass.activate.apply(this,arguments)){this.focus();if(a){this.expandMenu()}}return true},shouldDeactivate:function(a){if(Ext.menu.Item.superclass.shouldDeactivate.call(this,a)){if(this.menu&&this.menu.isVisible()){return !this.menu.getEl().getRegion().contains(a.getPoint())}return true}return false},deactivate:function(){Ext.menu.Item.superclass.deactivate.apply(this,arguments);this.hideMenu()},expandMenu:function(a){if(!this.disabled&&this.menu){clearTimeout(this.hideTimer);delete this.hideTimer;if(!this.menu.isVisible()&&!this.showTimer){this.showTimer=this.deferExpand.defer(this.showDelay,this,[a])}else{if(this.menu.isVisible()&&a){this.menu.tryActivate(0,1)}}}},deferExpand:function(a){delete this.showTimer;this.menu.show(this.container,this.parentMenu.subMenuAlign||"tl-tr?",this.parentMenu);if(a){this.menu.tryActivate(0,1)}},hideMenu:function(){clearTimeout(this.showTimer);delete this.showTimer;if(!this.hideTimer&&this.menu&&this.menu.isVisible()){this.hideTimer=this.deferHide.defer(this.hideDelay,this)}},deferHide:function(){delete this.hideTimer;if(this.menu.over){this.parentMenu.setActiveItem(this,false)}else{this.menu.hide()}}});Ext.reg("menuitem",Ext.menu.Item);Ext.menu.CheckItem=Ext.extend(Ext.menu.Item,{itemCls:"x-menu-item x-menu-check-item",groupClass:"x-menu-group-item",checked:false,ctype:"Ext.menu.CheckItem",initComponent:function(){Ext.menu.CheckItem.superclass.initComponent.call(this);this.addEvents("beforecheckchange","checkchange");if(this.checkHandler){this.on("checkchange",this.checkHandler,this.scope)}Ext.menu.MenuMgr.registerCheckable(this)},onRender:function(a){Ext.menu.CheckItem.superclass.onRender.apply(this,arguments);if(this.group){this.el.addClass(this.groupClass)}if(this.checked){this.checked=false;this.setChecked(true,true)}},destroy:function(){Ext.menu.MenuMgr.unregisterCheckable(this);Ext.menu.CheckItem.superclass.destroy.apply(this,arguments)},setChecked:function(b,a){var c=a===true;if(this.checked!=b&&(c||this.fireEvent("beforecheckchange",this,b)!==false)){Ext.menu.MenuMgr.onCheckChange(this,b);if(this.container){this.container[b?"addClass":"removeClass"]("x-menu-item-checked")}this.checked=b;if(!c){this.fireEvent("checkchange",this,b)}}},handleClick:function(a){if(!this.disabled&&!(this.checked&&this.group)){this.setChecked(!this.checked)}Ext.menu.CheckItem.superclass.handleClick.apply(this,arguments)}});Ext.reg("menucheckitem",Ext.menu.CheckItem);Ext.menu.DateMenu=Ext.extend(Ext.menu.Menu,{enableScrolling:false,hideOnClick:true,pickerId:null,cls:"x-date-menu",initComponent:function(){this.on("beforeshow",this.onBeforeShow,this);if(this.strict=(Ext.isIE7&&Ext.isStrict)){this.on("show",this.onShow,this,{single:true,delay:20})}Ext.apply(this,{plain:true,showSeparator:false,items:this.picker=new Ext.DatePicker(Ext.applyIf({internalRender:this.strict||!Ext.isIE,ctCls:"x-menu-date-item",id:this.pickerId},this.initialConfig))});this.picker.purgeListeners();Ext.menu.DateMenu.superclass.initComponent.call(this);this.relayEvents(this.picker,["select"]);this.on("show",this.picker.focus,this.picker);this.on("select",this.menuHide,this);if(this.handler){this.on("select",this.handler,this.scope||this)}},menuHide:function(){if(this.hideOnClick){this.hide(true)}},onBeforeShow:function(){if(this.picker){this.picker.hideMonthPicker(true)}},onShow:function(){var a=this.picker.getEl();a.setWidth(a.getWidth())}});Ext.reg("datemenu",Ext.menu.DateMenu);Ext.menu.ColorMenu=Ext.extend(Ext.menu.Menu,{enableScrolling:false,hideOnClick:true,cls:"x-color-menu",paletteId:null,initComponent:function(){Ext.apply(this,{plain:true,showSeparator:false,items:this.palette=new Ext.ColorPalette(Ext.applyIf({id:this.paletteId},this.initialConfig))});this.palette.purgeListeners();Ext.menu.ColorMenu.superclass.initComponent.call(this);this.relayEvents(this.palette,["select"]);this.on("select",this.menuHide,this);if(this.handler){this.on("select",this.handler,this.scope||this)}},menuHide:function(){if(this.hideOnClick){this.hide(true)}}});Ext.reg("colormenu",Ext.menu.ColorMenu);Ext.form.Field=Ext.extend(Ext.BoxComponent,{invalidClass:"x-form-invalid",invalidText:"The value in this field is invalid",focusClass:"x-form-focus",validationEvent:"keyup",validateOnBlur:true,validationDelay:250,defaultAutoCreate:{tag:"input",type:"text",size:"20",autocomplete:"off"},fieldClass:"x-form-field",msgTarget:"qtip",msgFx:"normal",readOnly:false,disabled:false,submitValue:true,isFormField:true,msgDisplay:"",hasFocus:false,initComponent:function(){Ext.form.Field.superclass.initComponent.call(this);this.addEvents("focus","blur","specialkey","change","invalid","valid")},getName:function(){return this.rendered&&this.el.dom.name?this.el.dom.name:this.name||this.id||""},onRender:function(c,a){if(!this.el){var b=this.getAutoCreate();if(!b.name){b.name=this.name||this.id}if(this.inputType){b.type=this.inputType}this.autoEl=b}Ext.form.Field.superclass.onRender.call(this,c,a);if(this.submitValue===false){this.el.dom.removeAttribute("name")}var d=this.el.dom.type;if(d){if(d=="password"){d="text"}this.el.addClass("x-form-"+d)}if(this.readOnly){this.setReadOnly(true)}if(this.tabIndex!==undefined){this.el.dom.setAttribute("tabIndex",this.tabIndex)}this.el.addClass([this.fieldClass,this.cls])},getItemCt:function(){return this.itemCt},initValue:function(){if(this.value!==undefined){this.setValue(this.value)}else{if(!Ext.isEmpty(this.el.dom.value)&&this.el.dom.value!=this.emptyText){this.setValue(this.el.dom.value)}}this.originalValue=this.getValue()},isDirty:function(){if(this.disabled||!this.rendered){return false}return String(this.getValue())!==String(this.originalValue)},setReadOnly:function(a){if(this.rendered){this.el.dom.readOnly=a}this.readOnly=a},afterRender:function(){Ext.form.Field.superclass.afterRender.call(this);this.initEvents();this.initValue()},fireKey:function(a){if(a.isSpecialKey()){this.fireEvent("specialkey",this,a)}},reset:function(){this.setValue(this.originalValue);this.clearInvalid()},initEvents:function(){this.mon(this.el,Ext.EventManager.getKeyEvent(),this.fireKey,this);this.mon(this.el,"focus",this.onFocus,this);this.mon(this.el,"blur",this.onBlur,this,this.inEditor?{buffer:10}:null)},preFocus:Ext.emptyFn,onFocus:function(){this.preFocus();if(this.focusClass){this.el.addClass(this.focusClass)}if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this)}},beforeBlur:Ext.emptyFn,onBlur:function(){this.beforeBlur();if(this.focusClass){this.el.removeClass(this.focusClass)}this.hasFocus=false;if(this.validationEvent!==false&&(this.validateOnBlur||this.validationEvent=="blur")){this.validate()}var a=this.getValue();if(String(a)!==String(this.startValue)){this.fireEvent("change",this,a,this.startValue)}this.fireEvent("blur",this);this.postBlur()},postBlur:Ext.emptyFn,isValid:function(a){if(this.disabled){return true}var c=this.preventMark;this.preventMark=a===true;var b=this.validateValue(this.processValue(this.getRawValue()),a);this.preventMark=c;return b},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getRawValue()))){this.clearInvalid();return true}return false},processValue:function(a){return a},validateValue:function(b){var a=this.getErrors(b)[0];if(a==undefined){return true}else{this.markInvalid(a);return false}},getErrors:function(){return[]},getActiveError:function(){return this.activeError||""},markInvalid:function(c){if(this.rendered&&!this.preventMark){c=c||this.invalidText;var a=this.getMessageHandler();if(a){a.mark(this,c)}else{if(this.msgTarget){this.el.addClass(this.invalidClass);var b=Ext.getDom(this.msgTarget);if(b){b.innerHTML=c;b.style.display=this.msgDisplay}}}}this.setActiveError(c)},clearInvalid:function(){if(this.rendered&&!this.preventMark){this.el.removeClass(this.invalidClass);var a=this.getMessageHandler();if(a){a.clear(this)}else{if(this.msgTarget){this.el.removeClass(this.invalidClass);var b=Ext.getDom(this.msgTarget);if(b){b.innerHTML="";b.style.display="none"}}}}this.unsetActiveError()},setActiveError:function(b,a){this.activeError=b;if(a!==true){this.fireEvent("invalid",this,b)}},unsetActiveError:function(a){delete this.activeError;if(a!==true){this.fireEvent("valid",this)}},getMessageHandler:function(){return Ext.form.MessageTargets[this.msgTarget]},getErrorCt:function(){return this.el.findParent(".x-form-element",5,true)||this.el.findParent(".x-form-field-wrap",5,true)},alignErrorEl:function(){this.errorEl.setWidth(this.getErrorCt().getWidth(true)-20)},alignErrorIcon:function(){this.errorIcon.alignTo(this.el,"tl-tr",[2,0])},getRawValue:function(){var a=this.rendered?this.el.getValue():Ext.value(this.value,"");if(a===this.emptyText){a=""}return a},getValue:function(){if(!this.rendered){return this.value}var a=this.el.getValue();if(a===this.emptyText||a===undefined){a=""}return a},setRawValue:function(a){return this.rendered?(this.el.dom.value=(Ext.isEmpty(a)?"":a)):""},setValue:function(a){this.value=a;if(this.rendered){this.el.dom.value=(Ext.isEmpty(a)?"":a);this.validate()}return this},append:function(a){this.setValue([this.getValue(),a].join(""))}});Ext.form.MessageTargets={qtip:{mark:function(a,b){a.el.addClass(a.invalidClass);a.el.dom.qtip=b;a.el.dom.qclass="x-form-invalid-tip";if(Ext.QuickTips){Ext.QuickTips.enable()}},clear:function(a){a.el.removeClass(a.invalidClass);a.el.dom.qtip=""}},title:{mark:function(a,b){a.el.addClass(a.invalidClass);a.el.dom.title=b},clear:function(a){a.el.dom.title=""}},under:{mark:function(b,c){b.el.addClass(b.invalidClass);if(!b.errorEl){var a=b.getErrorCt();if(!a){b.el.dom.title=c;return}b.errorEl=a.createChild({cls:"x-form-invalid-msg"});b.on("resize",b.alignErrorEl,b);b.on("destroy",function(){Ext.destroy(this.errorEl)},b)}b.alignErrorEl();b.errorEl.update(c);Ext.form.Field.msgFx[b.msgFx].show(b.errorEl,b)},clear:function(a){a.el.removeClass(a.invalidClass);if(a.errorEl){Ext.form.Field.msgFx[a.msgFx].hide(a.errorEl,a)}else{a.el.dom.title=""}}},side:{mark:function(b,c){b.el.addClass(b.invalidClass);if(!b.errorIcon){var a=b.getErrorCt();if(!a){b.el.dom.title=c;return}b.errorIcon=a.createChild({cls:"x-form-invalid-icon"});if(b.ownerCt){b.ownerCt.on("afterlayout",b.alignErrorIcon,b);b.ownerCt.on("expand",b.alignErrorIcon,b)}b.on("resize",b.alignErrorIcon,b);b.on("destroy",function(){Ext.destroy(this.errorIcon)},b)}b.alignErrorIcon();b.errorIcon.dom.qtip=c;b.errorIcon.dom.qclass="x-form-invalid-tip";b.errorIcon.show()},clear:function(a){a.el.removeClass(a.invalidClass);if(a.errorIcon){a.errorIcon.dom.qtip="";a.errorIcon.hide()}else{a.el.dom.title=""}}}};Ext.form.Field.msgFx={normal:{show:function(a,b){a.setDisplayed("block")},hide:function(a,b){a.setDisplayed(false).update("")}},slide:{show:function(a,b){a.slideIn("t",{stopFx:true})},hide:function(a,b){a.slideOut("t",{stopFx:true,useDisplay:true})}},slideRight:{show:function(a,b){a.fixDisplay();a.alignTo(b.el,"tl-tr");a.slideIn("l",{stopFx:true})},hide:function(a,b){a.slideOut("l",{stopFx:true,useDisplay:true})}}};Ext.reg("field",Ext.form.Field);Ext.form.TextField=Ext.extend(Ext.form.Field,{grow:false,growMin:30,growMax:800,vtype:null,maskRe:null,disableKeyFilter:false,allowBlank:true,minLength:0,maxLength:Number.MAX_VALUE,minLengthText:"The minimum length for this field is {0}",maxLengthText:"The maximum length for this field is {0}",selectOnFocus:false,blankText:"This field is required",validator:null,regex:null,regexText:"",emptyText:null,emptyClass:"x-form-empty-field",initComponent:function(){Ext.form.TextField.superclass.initComponent.call(this);this.addEvents("autosize","keydown","keyup","keypress")},initEvents:function(){Ext.form.TextField.superclass.initEvents.call(this);if(this.validationEvent=="keyup"){this.validationTask=new Ext.util.DelayedTask(this.validate,this);this.mon(this.el,"keyup",this.filterValidation,this)}else{if(this.validationEvent!==false&&this.validationEvent!="blur"){this.mon(this.el,this.validationEvent,this.validate,this,{buffer:this.validationDelay})}}if(this.selectOnFocus||this.emptyText){this.mon(this.el,"mousedown",this.onMouseDown,this);if(this.emptyText){this.applyEmptyText()}}if(this.maskRe||(this.vtype&&this.disableKeyFilter!==true&&(this.maskRe=Ext.form.VTypes[this.vtype+"Mask"]))){this.mon(this.el,"keypress",this.filterKeys,this)}if(this.grow){this.mon(this.el,"keyup",this.onKeyUpBuffered,this,{buffer:50});this.mon(this.el,"click",this.autoSize,this)}if(this.enableKeyEvents){this.mon(this.el,{scope:this,keyup:this.onKeyUp,keydown:this.onKeyDown,keypress:this.onKeyPress})}},onMouseDown:function(a){if(!this.hasFocus){this.mon(this.el,"mouseup",Ext.emptyFn,this,{single:true,preventDefault:true})}},processValue:function(a){if(this.stripCharsRe){var b=a.replace(this.stripCharsRe,"");if(b!==a){this.setRawValue(b);return b}}return a},filterValidation:function(a){if(!a.isNavKeyPress()){this.validationTask.delay(this.validationDelay)}},onDisable:function(){Ext.form.TextField.superclass.onDisable.call(this);if(Ext.isIE){this.el.dom.unselectable="on"}},onEnable:function(){Ext.form.TextField.superclass.onEnable.call(this);if(Ext.isIE){this.el.dom.unselectable=""}},onKeyUpBuffered:function(a){if(this.doAutoSize(a)){this.autoSize()}},doAutoSize:function(a){return !a.isNavKeyPress()},onKeyUp:function(a){this.fireEvent("keyup",this,a)},onKeyDown:function(a){this.fireEvent("keydown",this,a)},onKeyPress:function(a){this.fireEvent("keypress",this,a)},reset:function(){Ext.form.TextField.superclass.reset.call(this);this.applyEmptyText()},applyEmptyText:function(){if(this.rendered&&this.emptyText&&this.getRawValue().length<1&&!this.hasFocus){this.setRawValue(this.emptyText);this.el.addClass(this.emptyClass)}},preFocus:function(){var a=this.el,b;if(this.emptyText){if(a.dom.value==this.emptyText){this.setRawValue("");b=true}a.removeClass(this.emptyClass)}if(this.selectOnFocus||b){a.dom.select()}},postBlur:function(){this.applyEmptyText()},filterKeys:function(b){if(b.ctrlKey){return}var a=b.getKey();if(Ext.isGecko&&(b.isNavKeyPress()||a==b.BACKSPACE||(a==b.DELETE&&b.button==-1))){return}var c=String.fromCharCode(b.getCharCode());if(!Ext.isGecko&&b.isSpecialKey()&&!c){return}if(!this.maskRe.test(c)){b.stopEvent()}},setValue:function(a){if(this.emptyText&&this.el&&!Ext.isEmpty(a)){this.el.removeClass(this.emptyClass)}Ext.form.TextField.superclass.setValue.apply(this,arguments);this.applyEmptyText();this.autoSize();return this},getErrors:function(a){var d=Ext.form.TextField.superclass.getErrors.apply(this,arguments);a=Ext.isDefined(a)?a:this.processValue(this.getRawValue());if(Ext.isFunction(this.validator)){var c=this.validator(a);if(c!==true){d.push(c)}}if(a.length<1||a===this.emptyText){if(this.allowBlank){return d}else{d.push(this.blankText)}}if(!this.allowBlank&&(a.length<1||a===this.emptyText)){d.push(this.blankText)}if(a.lengththis.maxLength){d.push(String.format(this.maxLengthText,this.maxLength))}if(this.vtype){var b=Ext.form.VTypes;if(!b[this.vtype](a,this)){d.push(this.vtypeText||b[this.vtype+"Text"])}}if(this.regex&&!this.regex.test(a)){d.push(this.regexText)}return d},selectText:function(h,a){var c=this.getRawValue();var e=false;if(c.length>0){h=h===undefined?0:h;a=a===undefined?c.length:a;var g=this.el.dom;if(g.setSelectionRange){g.setSelectionRange(h,a)}else{if(g.createTextRange){var b=g.createTextRange();b.moveStart("character",h);b.moveEnd("character",a-c.length);b.select()}}e=Ext.isGecko||Ext.isOpera}else{e=true}if(e){this.focus()}},autoSize:function(){if(!this.grow||!this.rendered){return}if(!this.metrics){this.metrics=Ext.util.TextMetrics.createInstance(this.el)}var c=this.el;var b=c.dom.value;var e=document.createElement("div");e.appendChild(document.createTextNode(b));b=e.innerHTML;Ext.removeNode(e);e=null;b+=" ";var a=Math.min(this.growMax,Math.max(this.metrics.getWidth(b)+10,this.growMin));this.el.setWidth(a);this.fireEvent("autosize",this,a)},onDestroy:function(){if(this.validationTask){this.validationTask.cancel();this.validationTask=null}Ext.form.TextField.superclass.onDestroy.call(this)}});Ext.reg("textfield",Ext.form.TextField);Ext.form.TriggerField=Ext.extend(Ext.form.TextField,{defaultAutoCreate:{tag:"input",type:"text",size:"16",autocomplete:"off"},hideTrigger:false,editable:true,readOnly:false,wrapFocusClass:"x-trigger-wrap-focus",autoSize:Ext.emptyFn,monitorTab:true,deferHeight:true,mimicing:false,actionMode:"wrap",defaultTriggerWidth:17,onResize:function(a,c){Ext.form.TriggerField.superclass.onResize.call(this,a,c);var b=this.getTriggerWidth();if(Ext.isNumber(a)){this.el.setWidth(a-b)}this.wrap.setWidth(this.el.getWidth()+b)},getTriggerWidth:function(){var a=this.trigger.getWidth();if(!this.hideTrigger&&!this.readOnly&&a===0){a=this.defaultTriggerWidth}return a},alignErrorIcon:function(){if(this.wrap){this.errorIcon.alignTo(this.wrap,"tl-tr",[2,0])}},onRender:function(b,a){this.doc=Ext.isIE?Ext.getBody():Ext.getDoc();Ext.form.TriggerField.superclass.onRender.call(this,b,a);this.wrap=this.el.wrap({cls:"x-form-field-wrap x-form-field-trigger-wrap"});this.trigger=this.wrap.createChild(this.triggerConfig||{tag:"img",src:Ext.BLANK_IMAGE_URL,alt:"",cls:"x-form-trigger "+this.triggerClass});this.initTrigger();if(!this.width){this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth())}this.resizeEl=this.positionEl=this.wrap},getWidth:function(){return(this.el.getWidth()+this.trigger.getWidth())},updateEditState:function(){if(this.rendered){if(this.readOnly){this.el.dom.readOnly=true;this.el.addClass("x-trigger-noedit");this.mun(this.el,"click",this.onTriggerClick,this);this.trigger.setDisplayed(false)}else{if(!this.editable){this.el.dom.readOnly=true;this.el.addClass("x-trigger-noedit");this.mon(this.el,"click",this.onTriggerClick,this)}else{this.el.dom.readOnly=false;this.el.removeClass("x-trigger-noedit");this.mun(this.el,"click",this.onTriggerClick,this)}this.trigger.setDisplayed(!this.hideTrigger)}this.onResize(this.width||this.wrap.getWidth())}},setHideTrigger:function(a){if(a!=this.hideTrigger){this.hideTrigger=a;this.updateEditState()}},setEditable:function(a){if(a!=this.editable){this.editable=a;this.updateEditState()}},setReadOnly:function(a){if(a!=this.readOnly){this.readOnly=a;this.updateEditState()}},afterRender:function(){Ext.form.TriggerField.superclass.afterRender.call(this);this.updateEditState()},initTrigger:function(){this.mon(this.trigger,"click",this.onTriggerClick,this,{preventDefault:true});this.trigger.addClassOnOver("x-form-trigger-over");this.trigger.addClassOnClick("x-form-trigger-click")},onDestroy:function(){Ext.destroy(this.trigger,this.wrap);if(this.mimicing){this.doc.un("mousedown",this.mimicBlur,this)}delete this.doc;Ext.form.TriggerField.superclass.onDestroy.call(this)},onFocus:function(){Ext.form.TriggerField.superclass.onFocus.call(this);if(!this.mimicing){this.wrap.addClass(this.wrapFocusClass);this.mimicing=true;this.doc.on("mousedown",this.mimicBlur,this,{delay:10});if(this.monitorTab){this.on("specialkey",this.checkTab,this)}}},checkTab:function(a,b){if(b.getKey()==b.TAB){this.triggerBlur()}},onBlur:Ext.emptyFn,mimicBlur:function(a){if(!this.isDestroyed&&!this.wrap.contains(a.target)&&this.validateBlur(a)){this.triggerBlur()}},triggerBlur:function(){this.mimicing=false;this.doc.un("mousedown",this.mimicBlur,this);if(this.monitorTab&&this.el){this.un("specialkey",this.checkTab,this)}Ext.form.TriggerField.superclass.onBlur.call(this);if(this.wrap){this.wrap.removeClass(this.wrapFocusClass)}},beforeBlur:Ext.emptyFn,validateBlur:function(a){return true},onTriggerClick:Ext.emptyFn});Ext.form.TwinTriggerField=Ext.extend(Ext.form.TriggerField,{initComponent:function(){Ext.form.TwinTriggerField.superclass.initComponent.call(this);this.triggerConfig={tag:"span",cls:"x-form-twin-triggers",cn:[{tag:"img",src:Ext.BLANK_IMAGE_URL,alt:"",cls:"x-form-trigger "+this.trigger1Class},{tag:"img",src:Ext.BLANK_IMAGE_URL,alt:"",cls:"x-form-trigger "+this.trigger2Class}]}},getTrigger:function(a){return this.triggers[a]},afterRender:function(){Ext.form.TwinTriggerField.superclass.afterRender.call(this);var c=this.triggers,b=0,a=c.length;for(;b")}}d.innerHTML=a;b=Math.min(this.growMax,Math.max(d.offsetHeight,this.growMin));if(b!=this.lastHeight){this.lastHeight=b;this.el.setHeight(b);this.fireEvent("autosize",this,b)}}});Ext.reg("textarea",Ext.form.TextArea);Ext.form.NumberField=Ext.extend(Ext.form.TextField,{fieldClass:"x-form-field x-form-num-field",allowDecimals:true,decimalSeparator:".",decimalPrecision:2,allowNegative:true,minValue:Number.NEGATIVE_INFINITY,maxValue:Number.MAX_VALUE,minText:"The minimum value for this field is {0}",maxText:"The maximum value for this field is {0}",nanText:"{0} is not a valid number",baseChars:"0123456789",autoStripChars:false,initEvents:function(){var a=this.baseChars+"";if(this.allowDecimals){a+=this.decimalSeparator}if(this.allowNegative){a+="-"}a=Ext.escapeRe(a);this.maskRe=new RegExp("["+a+"]");if(this.autoStripChars){this.stripCharsRe=new RegExp("[^"+a+"]","gi")}Ext.form.NumberField.superclass.initEvents.call(this)},getErrors:function(b){var c=Ext.form.NumberField.superclass.getErrors.apply(this,arguments);b=Ext.isDefined(b)?b:this.processValue(this.getRawValue());if(b.length<1){return c}b=String(b).replace(this.decimalSeparator,".");if(isNaN(b)){c.push(String.format(this.nanText,b))}var a=this.parseValue(b);if(athis.maxValue){c.push(String.format(this.maxText,this.maxValue))}return c},getValue:function(){return this.fixPrecision(this.parseValue(Ext.form.NumberField.superclass.getValue.call(this)))},setValue:function(a){a=Ext.isNumber(a)?a:parseFloat(String(a).replace(this.decimalSeparator,"."));a=this.fixPrecision(a);a=isNaN(a)?"":String(a).replace(".",this.decimalSeparator);return Ext.form.NumberField.superclass.setValue.call(this,a)},setMinValue:function(a){this.minValue=Ext.num(a,Number.NEGATIVE_INFINITY)},setMaxValue:function(a){this.maxValue=Ext.num(a,Number.MAX_VALUE)},parseValue:function(a){a=parseFloat(String(a).replace(this.decimalSeparator,"."));return isNaN(a)?"":a},fixPrecision:function(b){var a=isNaN(b);if(!this.allowDecimals||this.decimalPrecision==-1||a||!b){return a?"":b}return parseFloat(parseFloat(b).toFixed(this.decimalPrecision))},beforeBlur:function(){var a=this.parseValue(this.getRawValue());if(!Ext.isEmpty(a)){this.setValue(a)}}});Ext.reg("numberfield",Ext.form.NumberField);Ext.form.DateField=Ext.extend(Ext.form.TriggerField,{format:"m/d/Y",altFormats:"m/d/Y|n/j/Y|n/j/y|m/j/y|n/d/y|m/j/Y|n/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d|n-j|n/j",disabledDaysText:"Disabled",disabledDatesText:"Disabled",minText:"The date in this field must be equal to or after {0}",maxText:"The date in this field must be equal to or before {0}",invalidText:"{0} is not a valid date - it must be in the format {1}",triggerClass:"x-form-date-trigger",showToday:true,startDay:0,defaultAutoCreate:{tag:"input",type:"text",size:"10",autocomplete:"off"},initTime:"12",initTimeFormat:"H",safeParse:function(b,c){if(Date.formatContainsHourInfo(c)){return Date.parseDate(b,c)}else{var a=Date.parseDate(b+" "+this.initTime,c+" "+this.initTimeFormat);if(a){return a.clearTime()}}},initComponent:function(){Ext.form.DateField.superclass.initComponent.call(this);this.addEvents("select");if(Ext.isString(this.minValue)){this.minValue=this.parseDate(this.minValue)}if(Ext.isString(this.maxValue)){this.maxValue=this.parseDate(this.maxValue)}this.disabledDatesRE=null;this.initDisabledDays()},initEvents:function(){Ext.form.DateField.superclass.initEvents.call(this);this.keyNav=new Ext.KeyNav(this.el,{down:function(a){this.onTriggerClick()},scope:this,forceKeyDown:true})},initDisabledDays:function(){if(this.disabledDates){var b=this.disabledDates,a=b.length-1,c="(?:";Ext.each(b,function(g,e){c+=Ext.isDate(g)?"^"+Ext.escapeRe(g.dateFormat(this.format))+"$":b[e];if(e!=a){c+="|"}},this);this.disabledDatesRE=new RegExp(c+")")}},setDisabledDates:function(a){this.disabledDates=a;this.initDisabledDays();if(this.menu){this.menu.picker.setDisabledDates(this.disabledDatesRE)}},setDisabledDays:function(a){this.disabledDays=a;if(this.menu){this.menu.picker.setDisabledDays(a)}},setMinValue:function(a){this.minValue=(Ext.isString(a)?this.parseDate(a):a);if(this.menu){this.menu.picker.setMinDate(this.minValue)}},setMaxValue:function(a){this.maxValue=(Ext.isString(a)?this.parseDate(a):a);if(this.menu){this.menu.picker.setMaxDate(this.maxValue)}},getErrors:function(e){var h=Ext.form.DateField.superclass.getErrors.apply(this,arguments);e=this.formatDate(e||this.processValue(this.getRawValue()));if(e.length<1){return h}var c=e;e=this.parseDate(e);if(!e){h.push(String.format(this.invalidText,c,this.format));return h}var g=e.getTime();if(this.minValue&&gthis.maxValue.clearTime().getTime()){h.push(String.format(this.maxText,this.formatDate(this.maxValue)))}if(this.disabledDays){var a=e.getDay();for(var b=0;b
    {'+this.displayField+"}
    "}this.view=new Ext.DataView({applyTo:this.innerList,tpl:this.tpl,singleSelect:true,selectedClass:this.selectedClass,itemSelector:this.itemSelector||"."+a+"-item",emptyText:this.listEmptyText,deferEmptyText:false});this.mon(this.view,{containerclick:this.onViewClick,click:this.onViewClick,scope:this});this.bindStore(this.store,true);if(this.resizable){this.resizer=new Ext.Resizable(this.list,{pinned:true,handles:"se"});this.mon(this.resizer,"resize",function(g,d,e){this.maxHeight=e-this.handleHeight-this.list.getFrameWidth("tb")-this.assetHeight;this.listWidth=d;this.innerList.setWidth(d-this.list.getFrameWidth("lr"));this.restrictHeight()},this);this[this.pageSize?"footer":"innerList"].setStyle("margin-bottom",this.handleHeight+"px")}}},getListParent:function(){return document.body},getStore:function(){return this.store},bindStore:function(a,b){if(this.store&&!b){if(this.store!==a&&this.store.autoDestroy){this.store.destroy()}else{this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("load",this.onLoad,this);this.store.un("exception",this.collapse,this)}if(!a){this.store=null;if(this.view){this.view.bindStore(null)}if(this.pageTb){this.pageTb.bindStore(null)}}}if(a){if(!b){this.lastQuery=null;if(this.pageTb){this.pageTb.bindStore(a)}}this.store=Ext.StoreMgr.lookup(a);this.store.on({scope:this,beforeload:this.onBeforeLoad,load:this.onLoad,exception:this.collapse});if(this.view){this.view.bindStore(a)}}},reset:function(){if(this.clearFilterOnReset&&this.mode=="local"){this.store.clearFilter()}Ext.form.ComboBox.superclass.reset.call(this)},initEvents:function(){Ext.form.ComboBox.superclass.initEvents.call(this);this.keyNav=new Ext.KeyNav(this.el,{up:function(a){this.inKeyMode=true;this.selectPrev()},down:function(a){if(!this.isExpanded()){this.onTriggerClick()}else{this.inKeyMode=true;this.selectNext()}},enter:function(a){this.onViewClick()},esc:function(a){this.collapse()},tab:function(a){if(this.forceSelection===true){this.collapse()}else{this.onViewClick(false)}return true},scope:this,doRelay:function(c,b,a){if(a=="down"||this.scope.isExpanded()){var d=Ext.KeyNav.prototype.doRelay.apply(this,arguments);if(!Ext.isIE&&Ext.EventManager.useKeydown){this.scope.fireKey(c)}return d}return true},forceKeyDown:true,defaultEventAction:"stopEvent"});this.queryDelay=Math.max(this.queryDelay||10,this.mode=="local"?10:250);this.dqTask=new Ext.util.DelayedTask(this.initQuery,this);if(this.typeAhead){this.taTask=new Ext.util.DelayedTask(this.onTypeAhead,this)}if(!this.enableKeyEvents){this.mon(this.el,"keyup",this.onKeyUp,this)}},onDestroy:function(){if(this.dqTask){this.dqTask.cancel();this.dqTask=null}this.bindStore(null);Ext.destroy(this.resizer,this.view,this.pageTb,this.list);Ext.destroyMembers(this,"hiddenField");Ext.form.ComboBox.superclass.onDestroy.call(this)},fireKey:function(a){if(!this.isExpanded()){Ext.form.ComboBox.superclass.fireKey.call(this,a)}},onResize:function(a,b){Ext.form.ComboBox.superclass.onResize.apply(this,arguments);if(!isNaN(a)&&this.isVisible()&&this.list){this.doResize(a)}else{this.bufferSize=a}},doResize:function(a){if(!Ext.isDefined(this.listWidth)){var b=Math.max(a,this.minListWidth);this.list.setWidth(b);this.innerList.setWidth(b-this.list.getFrameWidth("lr"))}},onEnable:function(){Ext.form.ComboBox.superclass.onEnable.apply(this,arguments);if(this.hiddenField){this.hiddenField.disabled=false}},onDisable:function(){Ext.form.ComboBox.superclass.onDisable.apply(this,arguments);if(this.hiddenField){this.hiddenField.disabled=true}},onBeforeLoad:function(){if(!this.hasFocus){return}this.innerList.update(this.loadingText?'
    '+this.loadingText+"
    ":"");this.restrictHeight();this.selectedIndex=-1},onLoad:function(){if(!this.hasFocus){return}if(this.store.getCount()>0||this.listEmptyText){this.expand();this.restrictHeight();if(this.lastQuery==this.allQuery){if(this.editable){this.el.dom.select()}if(this.autoSelect!==false&&!this.selectByValue(this.value,true)){this.select(0,true)}}else{if(this.autoSelect!==false){this.selectNext()}if(this.typeAhead&&this.lastKey!=Ext.EventObject.BACKSPACE&&this.lastKey!=Ext.EventObject.DELETE){this.taTask.delay(this.typeAheadDelay)}}}else{this.collapse()}},onTypeAhead:function(){if(this.store.getCount()>0){var b=this.store.getAt(0);var c=b.data[this.displayField];var a=c.length;var d=this.getRawValue().length;if(d!=a){this.setRawValue(c);this.selectText(d,c.length)}}},assertValue:function(){var b=this.getRawValue(),a;if(this.valueField&&Ext.isDefined(this.value)){a=this.findRecord(this.valueField,this.value)}if(!a||a.get(this.displayField)!=b){a=this.findRecord(this.displayField,b)}if(!a&&this.forceSelection){if(b.length>0&&b!=this.emptyText){this.el.dom.value=Ext.value(this.lastSelectionText,"");this.applyEmptyText()}else{this.clearValue()}}else{if(a&&this.valueField){if(this.value==b){return}b=a.get(this.valueField||this.displayField)}this.setValue(b)}},onSelect:function(a,b){if(this.fireEvent("beforeselect",this,a,b)!==false){this.setValue(a.data[this.valueField||this.displayField]);this.collapse();this.fireEvent("select",this,a,b)}},getName:function(){var a=this.hiddenField;return a&&a.name?a.name:this.hiddenName||Ext.form.ComboBox.superclass.getName.call(this)},getValue:function(){if(this.valueField){return Ext.isDefined(this.value)?this.value:""}else{return Ext.form.ComboBox.superclass.getValue.call(this)}},clearValue:function(){if(this.hiddenField){this.hiddenField.value=""}this.setRawValue("");this.lastSelectionText="";this.applyEmptyText();this.value=""},setValue:function(a){var c=a;if(this.valueField){var b=this.findRecord(this.valueField,a);if(b){c=b.data[this.displayField]}else{if(Ext.isDefined(this.valueNotFoundText)){c=this.valueNotFoundText}}}this.lastSelectionText=c;if(this.hiddenField){this.hiddenField.value=Ext.value(a,"")}Ext.form.ComboBox.superclass.setValue.call(this,c);this.value=a;return this},findRecord:function(c,b){var a;if(this.store.getCount()>0){this.store.each(function(d){if(d.data[c]==b){a=d;return false}})}return a},onViewMove:function(b,a){this.inKeyMode=false},onViewOver:function(d,b){if(this.inKeyMode){return}var c=this.view.findItemFromChild(b);if(c){var a=this.view.indexOf(c);this.select(a,false)}},onViewClick:function(b){var a=this.view.getSelectedIndexes()[0],c=this.store,d=c.getAt(a);if(d){this.onSelect(d,a)}else{this.collapse()}if(b!==false){this.el.focus()}},restrictHeight:function(){this.innerList.dom.style.height="";var b=this.innerList.dom,e=this.list.getFrameWidth("tb")+(this.resizable?this.handleHeight:0)+this.assetHeight,c=Math.max(b.clientHeight,b.offsetHeight,b.scrollHeight),a=this.getPosition()[1]-Ext.getBody().getScroll().top,g=Ext.lib.Dom.getViewHeight()-a-this.getSize().height,d=Math.max(a,g,this.minHeight||0)-this.list.shadowOffset-e-5;c=Math.min(c,d,this.maxHeight);this.innerList.setHeight(c);this.list.beginUpdate();this.list.setHeight(c+e);this.list.alignTo.apply(this.list,[this.el].concat(this.listAlign));this.list.endUpdate()},isExpanded:function(){return this.list&&this.list.isVisible()},selectByValue:function(a,c){if(!Ext.isEmpty(a,true)){var b=this.findRecord(this.valueField||this.displayField,a);if(b){this.select(this.store.indexOf(b),c);return true}}return false},select:function(a,c){this.selectedIndex=a;this.view.select(a);if(c!==false){var b=this.view.getNode(a);if(b){this.innerList.scrollChildIntoView(b,false)}}},selectNext:function(){var a=this.store.getCount();if(a>0){if(this.selectedIndex==-1){this.select(0)}else{if(this.selectedIndex0){if(this.selectedIndex==-1){this.select(0)}else{if(this.selectedIndex!==0){this.select(this.selectedIndex-1)}}}},onKeyUp:function(b){var a=b.getKey();if(this.editable!==false&&this.readOnly!==true&&(a==b.BACKSPACE||!b.isSpecialKey())){this.lastKey=a;this.dqTask.delay(this.queryDelay)}Ext.form.ComboBox.superclass.onKeyUp.call(this,b)},validateBlur:function(){return !this.list||!this.list.isVisible()},initQuery:function(){this.doQuery(this.getRawValue())},beforeBlur:function(){this.assertValue()},postBlur:function(){Ext.form.ComboBox.superclass.postBlur.call(this);this.collapse();this.inKeyMode=false},doQuery:function(c,b){c=Ext.isEmpty(c)?"":c;var a={query:c,forceAll:b,combo:this,cancel:false};if(this.fireEvent("beforequery",a)===false||a.cancel){return false}c=a.query;b=a.forceAll;if(b===true||(c.length>=this.minChars)){if(this.lastQuery!==c){this.lastQuery=c;if(this.mode=="local"){this.selectedIndex=-1;if(b){this.store.clearFilter()}else{this.store.filter(this.displayField,c)}this.onLoad()}else{this.store.baseParams[this.queryParam]=c;this.store.load({params:this.getParams(c)});this.expand()}}else{this.selectedIndex=-1;this.onLoad()}}},getParams:function(a){var b={},c=this.store.paramNames;if(this.pageSize){b[c.start]=0;b[c.limit]=this.pageSize}return b},collapse:function(){if(!this.isExpanded()){return}this.list.hide();Ext.getDoc().un("mousewheel",this.collapseIf,this);Ext.getDoc().un("mousedown",this.collapseIf,this);this.fireEvent("collapse",this)},collapseIf:function(a){if(!this.isDestroyed&&!a.within(this.wrap)&&!a.within(this.list)){this.collapse()}},expand:function(){if(this.isExpanded()||!this.hasFocus){return}if(this.title||this.pageSize){this.assetHeight=0;if(this.title){this.assetHeight+=this.header.getHeight()}if(this.pageSize){this.assetHeight+=this.footer.getHeight()}}if(this.bufferSize){this.doResize(this.bufferSize);delete this.bufferSize}this.list.alignTo.apply(this.list,[this.el].concat(this.listAlign));this.list.setZIndex(this.getZIndex());this.list.show();if(Ext.isGecko2){this.innerList.setOverflow("auto")}this.mon(Ext.getDoc(),{scope:this,mousewheel:this.collapseIf,mousedown:this.collapseIf});this.fireEvent("expand",this)},onTriggerClick:function(){if(this.readOnly||this.disabled){return}if(this.isExpanded()){this.collapse();this.el.focus()}else{this.onFocus({});if(this.triggerAction=="all"){this.doQuery(this.allQuery,true)}else{this.doQuery(this.getRawValue())}this.el.focus()}}});Ext.reg("combo",Ext.form.ComboBox);Ext.form.Checkbox=Ext.extend(Ext.form.Field,{focusClass:undefined,fieldClass:"x-form-field",checked:false,boxLabel:" ",defaultAutoCreate:{tag:"input",type:"checkbox",autocomplete:"off"},actionMode:"wrap",initComponent:function(){Ext.form.Checkbox.superclass.initComponent.call(this);this.addEvents("check")},onResize:function(){Ext.form.Checkbox.superclass.onResize.apply(this,arguments);if(!this.boxLabel&&!this.fieldLabel){this.el.alignTo(this.wrap,"c-c")}},initEvents:function(){Ext.form.Checkbox.superclass.initEvents.call(this);this.mon(this.el,{scope:this,click:this.onClick,change:this.onClick})},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,onRender:function(b,a){Ext.form.Checkbox.superclass.onRender.call(this,b,a);if(this.inputValue!==undefined){this.el.dom.value=this.inputValue}this.wrap=this.el.wrap({cls:"x-form-check-wrap"});if(this.boxLabel){this.wrap.createChild({tag:"label",htmlFor:this.el.id,cls:"x-form-cb-label",html:this.boxLabel})}if(this.checked){this.setValue(true)}else{this.checked=this.el.dom.checked}if(Ext.isIE&&!Ext.isStrict){this.wrap.repaint()}this.resizeEl=this.positionEl=this.wrap},onDestroy:function(){Ext.destroy(this.wrap);Ext.form.Checkbox.superclass.onDestroy.call(this)},initValue:function(){this.originalValue=this.getValue()},getValue:function(){if(this.rendered){return this.el.dom.checked}return this.checked},onClick:function(){if(this.el.dom.checked!=this.checked){this.setValue(this.el.dom.checked)}},setValue:function(a){var c=this.checked,b=this.inputValue;if(a===false){this.checked=false}else{this.checked=(a===true||a==="true"||a=="1"||(b?a==b:String(a).toLowerCase()=="on"))}if(this.rendered){this.el.dom.checked=this.checked;this.el.dom.defaultChecked=this.checked}if(c!=this.checked){this.fireEvent("check",this,this.checked);if(this.handler){this.handler.call(this.scope||this,this,this.checked)}}return this}});Ext.reg("checkbox",Ext.form.Checkbox);Ext.form.CheckboxGroup=Ext.extend(Ext.form.Field,{columns:"auto",vertical:false,allowBlank:true,blankText:"You must select at least one item in this group",defaultType:"checkbox",groupCls:"x-form-check-group",initComponent:function(){this.addEvents("change");this.on("change",this.validate,this);Ext.form.CheckboxGroup.superclass.initComponent.call(this)},onRender:function(j,g){if(!this.el){var p={autoEl:{id:this.id},cls:this.groupCls,layout:"column",renderTo:j,bufferResize:false};var a={xtype:"container",defaultType:this.defaultType,layout:"form",defaults:{hideLabel:true,anchor:"100%"}};if(this.items[0].items){Ext.apply(p,{layoutConfig:{columns:this.items.length},defaults:this.defaults,items:this.items});for(var e=0,m=this.items.length;e0&&e%r==0){o++}if(this.items[e].fieldLabel){this.items[e].hideLabel=false}n[o].items.push(this.items[e])}}else{for(var e=0,m=this.items.length;e-1){b.setValue(true)}})},getBox:function(b){var a=null;this.eachItem(function(c){if(b==c||c.dataIndex==b||c.id==b||c.getName()==b){a=c;return false}});return a},getValue:function(){var a=[];this.eachItem(function(b){if(b.checked){a.push(b)}});return a},eachItem:function(b,a){if(this.items&&this.items.each){this.items.each(b,a||this)}},getRawValue:Ext.emptyFn,setRawValue:Ext.emptyFn});Ext.reg("checkboxgroup",Ext.form.CheckboxGroup);Ext.form.CompositeField=Ext.extend(Ext.form.Field,{defaultMargins:"0 5 0 0",skipLastItemMargin:true,isComposite:true,combineErrors:true,labelConnector:", ",initComponent:function(){var g=[],b=this.items,e;for(var d=0,c=b.length;d")},sortErrors:function(){var a=this.items;this.fieldErrors.sort("ASC",function(g,d){var c=function(b){return function(i){return i.getName()==b}};var h=a.findIndexBy(c(g.field)),e=a.findIndexBy(c(d.field));return h1){var a=this.getBox(c);if(a){a.setValue(b);if(a.checked){this.eachItem(function(d){if(d!==a){d.setValue(false)}})}}}else{this.setValueForItem(c)}},setValueForItem:function(a){a=String(a).split(",")[0];this.eachItem(function(b){b.setValue(a==b.inputValue)})},fireChecked:function(){if(!this.checkTask){this.checkTask=new Ext.util.DelayedTask(this.bufferChecked,this)}this.checkTask.delay(10)},bufferChecked:function(){var a=null;this.eachItem(function(b){if(b.checked){a=b;return false}});this.fireEvent("change",this,a)},onDestroy:function(){if(this.checkTask){this.checkTask.cancel();this.checkTask=null}Ext.form.RadioGroup.superclass.onDestroy.call(this)}});Ext.reg("radiogroup",Ext.form.RadioGroup);Ext.form.Hidden=Ext.extend(Ext.form.Field,{inputType:"hidden",shouldLayout:false,onRender:function(){Ext.form.Hidden.superclass.onRender.apply(this,arguments)},initEvents:function(){this.originalValue=this.getValue()},setSize:Ext.emptyFn,setWidth:Ext.emptyFn,setHeight:Ext.emptyFn,setPosition:Ext.emptyFn,setPagePosition:Ext.emptyFn,markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn});Ext.reg("hidden",Ext.form.Hidden);Ext.form.BasicForm=Ext.extend(Ext.util.Observable,{constructor:function(b,a){Ext.apply(this,a);if(Ext.isString(this.paramOrder)){this.paramOrder=this.paramOrder.split(/[\s,|]/)}this.items=new Ext.util.MixedCollection(false,function(c){return c.getItemId()});this.addEvents("beforeaction","actionfailed","actioncomplete");if(b){this.initEl(b)}Ext.form.BasicForm.superclass.constructor.call(this)},timeout:30,paramOrder:undefined,paramsAsHash:false,waitTitle:"Please Wait...",activeAction:null,trackResetOnLoad:false,initEl:function(a){this.el=Ext.get(a);this.id=this.el.id||Ext.id();if(!this.standardSubmit){this.el.on("submit",this.onSubmit,this)}this.el.addClass("x-form")},getEl:function(){return this.el},onSubmit:function(a){a.stopEvent()},destroy:function(a){if(a!==true){this.items.each(function(b){Ext.destroy(b)});Ext.destroy(this.el)}this.items.clear();this.purgeListeners()},isValid:function(){var a=true;this.items.each(function(b){if(!b.validate()){a=false}});return a},isDirty:function(){var a=false;this.items.each(function(b){if(b.isDirty()){a=true;return false}});return a},doAction:function(b,a){if(Ext.isString(b)){b=new Ext.form.Action.ACTION_TYPES[b](this,a)}if(this.fireEvent("beforeaction",this,b)!==false){this.beforeAction(b);b.run.defer(100,b)}return this},submit:function(b){b=b||{};if(this.standardSubmit){var a=b.clientValidation===false||this.isValid();if(a){var c=this.el.dom;if(this.url&&Ext.isEmpty(c.action)){c.action=this.url}c.submit()}return a}var d=String.format("{0}submit",this.api?"direct":"");this.doAction(d,b);return this},load:function(a){var b=String.format("{0}load",this.api?"direct":"");this.doAction(b,a);return this},updateRecord:function(b){b.beginEdit();var a=b.fields,d,c;a.each(function(e){d=this.findField(e.name);if(d){c=d.getValue();if(Ext.type(c)!==false&&c.getGroupValue){c=c.getGroupValue()}else{if(d.eachItem){c=[];d.eachItem(function(g){c.push(g.getValue())})}}b.set(e.name,c)}},this);b.endEdit();return this},loadRecord:function(a){this.setValues(a.data);return this},beforeAction:function(a){this.items.each(function(c){if(c.isFormField&&c.syncValue){c.syncValue()}});var b=a.options;if(b.waitMsg){if(this.waitMsgTarget===true){this.el.mask(b.waitMsg,"x-mask-loading")}else{if(this.waitMsgTarget){this.waitMsgTarget=Ext.get(this.waitMsgTarget);this.waitMsgTarget.mask(b.waitMsg,"x-mask-loading")}else{Ext.MessageBox.wait(b.waitMsg,b.waitTitle||this.waitTitle)}}}},afterAction:function(a,c){this.activeAction=null;var b=a.options;if(b.waitMsg){if(this.waitMsgTarget===true){this.el.unmask()}else{if(this.waitMsgTarget){this.waitMsgTarget.unmask()}else{Ext.MessageBox.updateProgress(1);Ext.MessageBox.hide()}}}if(c){if(b.reset){this.reset()}Ext.callback(b.success,b.scope,[this,a]);this.fireEvent("actioncomplete",this,a)}else{Ext.callback(b.failure,b.scope,[this,a]);this.fireEvent("actionfailed",this,a)}},findField:function(c){var b=this.items.get(c);if(!Ext.isObject(b)){var a=function(d){if(d.isFormField){if(d.dataIndex==c||d.id==c||d.getName()==c){b=d;return false}else{if(d.isComposite){return d.items.each(a)}else{if(d instanceof Ext.form.CheckboxGroup&&d.rendered){return d.eachItem(a)}}}}};this.items.each(a)}return b||null},markInvalid:function(h){if(Ext.isArray(h)){for(var c=0,a=h.length;c':">"),c,"")}return d.join("")},createToolbar:function(e){var c=[];var a=Ext.QuickTips&&Ext.QuickTips.isEnabled();function d(j,h,i){return{itemId:j,cls:"x-btn-icon",iconCls:"x-edit-"+j,enableToggle:h!==false,scope:e,handler:i||e.relayBtnCmd,clickEvent:"mousedown",tooltip:a?e.buttonTips[j]||undefined:undefined,overflowText:e.buttonTips[j].title||undefined,tabIndex:-1}}if(this.enableFont&&!Ext.isSafari2){var g=new Ext.Toolbar.Item({autoEl:{tag:"select",cls:"x-font-select",html:this.createFontOptions()}});c.push(g,"-")}if(this.enableFormat){c.push(d("bold"),d("italic"),d("underline"))}if(this.enableFontSize){c.push("-",d("increasefontsize",false,this.adjustFont),d("decreasefontsize",false,this.adjustFont))}if(this.enableColors){c.push("-",{itemId:"forecolor",cls:"x-btn-icon",iconCls:"x-edit-forecolor",clickEvent:"mousedown",tooltip:a?e.buttonTips.forecolor||undefined:undefined,tabIndex:-1,menu:new Ext.menu.ColorMenu({allowReselect:true,focus:Ext.emptyFn,value:"000000",plain:true,listeners:{scope:this,select:function(i,h){this.execCmd("forecolor",Ext.isWebKit||Ext.isIE?"#"+h:h);this.deferFocus()}},clickEvent:"mousedown"})},{itemId:"backcolor",cls:"x-btn-icon",iconCls:"x-edit-backcolor",clickEvent:"mousedown",tooltip:a?e.buttonTips.backcolor||undefined:undefined,tabIndex:-1,menu:new Ext.menu.ColorMenu({focus:Ext.emptyFn,value:"FFFFFF",plain:true,allowReselect:true,listeners:{scope:this,select:function(i,h){if(Ext.isGecko){this.execCmd("useCSS",false);this.execCmd("hilitecolor",h);this.execCmd("useCSS",true);this.deferFocus()}else{this.execCmd(Ext.isOpera?"hilitecolor":"backcolor",Ext.isWebKit||Ext.isIE?"#"+h:h);this.deferFocus()}}},clickEvent:"mousedown"})})}if(this.enableAlignments){c.push("-",d("justifyleft"),d("justifycenter"),d("justifyright"))}if(!Ext.isSafari2){if(this.enableLinks){c.push("-",d("createlink",false,this.createLink))}if(this.enableLists){c.push("-",d("insertorderedlist"),d("insertunorderedlist"))}if(this.enableSourceEdit){c.push("-",d("sourceedit",true,function(h){this.toggleSourceEdit(!this.sourceEditMode)}))}}var b=new Ext.Toolbar({renderTo:this.wrap.dom.firstChild,items:c});if(g){this.fontSelect=g.el;this.mon(this.fontSelect,"change",function(){var h=this.fontSelect.dom.value;this.relayCmd("fontname",h);this.deferFocus()},this)}this.mon(b.el,"click",function(h){h.preventDefault()});this.tb=b;this.tb.doLayout()},onDisable:function(){this.wrap.mask();Ext.form.HtmlEditor.superclass.onDisable.call(this)},onEnable:function(){this.wrap.unmask();Ext.form.HtmlEditor.superclass.onEnable.call(this)},setReadOnly:function(b){Ext.form.HtmlEditor.superclass.setReadOnly.call(this,b);if(this.initialized){if(Ext.isIE){this.getEditorBody().contentEditable=!b}else{this.setDesignMode(!b)}var a=this.getEditorBody();if(a){a.style.cursor=this.readOnly?"default":"text"}this.disableItems(b)}},getDocMarkup:function(){var a=Ext.fly(this.iframe).getHeight()-this.iframePad*2;return String.format('',this.iframePad,a)},getEditorBody:function(){var a=this.getDoc();return a.body||a.documentElement},getDoc:function(){return Ext.isIE?this.getWin().document:(this.iframe.contentDocument||this.getWin().document)},getWin:function(){return Ext.isIE?this.iframe.contentWindow:window.frames[this.iframe.name]},onRender:function(b,a){Ext.form.HtmlEditor.superclass.onRender.call(this,b,a);this.el.dom.style.border="0 none";this.el.dom.setAttribute("tabIndex",-1);this.el.addClass("x-hidden");if(Ext.isIE){this.el.applyStyles("margin-top:-1px;margin-bottom:-1px;")}this.wrap=this.el.wrap({cls:"x-html-editor-wrap",cn:{cls:"x-html-editor-tb"}});this.createToolbar(this);this.disableItems(true);this.tb.doLayout();this.createIFrame();if(!this.width){var c=this.el.getSize();this.setSize(c.width,this.height||c.height)}this.resizeEl=this.positionEl=this.wrap},createIFrame:function(){var a=document.createElement("iframe");a.name=Ext.id();a.frameBorder="0";a.style.overflow="auto";a.src=Ext.SSL_SECURE_URL;this.wrap.dom.appendChild(a);this.iframe=a;this.monitorTask=Ext.TaskMgr.start({run:this.checkDesignMode,scope:this,interval:100})},initFrame:function(){Ext.TaskMgr.stop(this.monitorTask);var b=this.getDoc();this.win=this.getWin();b.open();b.write(this.getDocMarkup());b.close();var a={run:function(){var c=this.getDoc();if(c.body||c.readyState=="complete"){Ext.TaskMgr.stop(a);this.setDesignMode(true);this.initEditor.defer(10,this)}},interval:10,duration:10000,scope:this};Ext.TaskMgr.start(a)},checkDesignMode:function(){if(this.wrap&&this.wrap.dom.offsetWidth){var a=this.getDoc();if(!a){return}if(!a.editorInitialized||this.getDesignMode()!="on"){this.initFrame()}}},setDesignMode:function(b){var a=this.getDoc();if(a){if(this.readOnly){b=false}a.designMode=(/on|true/i).test(String(b).toLowerCase())?"on":"off"}},getDesignMode:function(){var a=this.getDoc();if(!a){return""}return String(a.designMode).toLowerCase()},disableItems:function(a){if(this.fontSelect){this.fontSelect.dom.disabled=a}this.tb.items.each(function(b){if(b.getItemId()!="sourceedit"){b.setDisabled(a)}})},onResize:function(b,c){Ext.form.HtmlEditor.superclass.onResize.apply(this,arguments);if(this.el&&this.iframe){if(Ext.isNumber(b)){var e=b-this.wrap.getFrameWidth("lr");this.el.setWidth(e);this.tb.setWidth(e);this.iframe.style.width=Math.max(e,0)+"px"}if(Ext.isNumber(c)){var a=c-this.wrap.getFrameWidth("tb")-this.tb.el.getHeight();this.el.setHeight(a);this.iframe.style.height=Math.max(a,0)+"px";var d=this.getEditorBody();if(d){d.style.height=Math.max((a-(this.iframePad*2)),0)+"px"}}}},toggleSourceEdit:function(b){var d,a;if(b===undefined){b=!this.sourceEditMode}this.sourceEditMode=b===true;var c=this.tb.getComponent("sourceedit");if(c.pressed!==this.sourceEditMode){c.toggle(this.sourceEditMode);if(!c.xtbHidden){return}}if(this.sourceEditMode){this.previousSize=this.getSize();d=Ext.get(this.iframe).getHeight();this.disableItems(true);this.syncValue();this.iframe.className="x-hidden";this.el.removeClass("x-hidden");this.el.dom.removeAttribute("tabIndex");this.el.focus();this.el.dom.style.height=d+"px"}else{a=parseInt(this.el.dom.style.height,10);if(this.initialized){this.disableItems(this.readOnly)}this.pushValue();this.iframe.className="";this.el.addClass("x-hidden");this.el.dom.setAttribute("tabIndex",-1);this.deferFocus();this.setSize(this.previousSize);delete this.previousSize;this.iframe.style.height=a+"px"}this.fireEvent("editmodechange",this,this.sourceEditMode)},createLink:function(){var a=prompt(this.createLinkText,this.defaultLinkValue);if(a&&a!="http://"){this.relayCmd("createlink",a)}},initEvents:function(){this.originalValue=this.getValue()},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,setValue:function(a){Ext.form.HtmlEditor.superclass.setValue.call(this,a);this.pushValue();return this},cleanHtml:function(a){a=String(a);if(Ext.isWebKit){a=a.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi,"")}if(a.charCodeAt(0)==this.defaultValue.replace(/\D/g,"")){a=a.substring(1)}return a},syncValue:function(){if(this.initialized){var d=this.getEditorBody();var c=d.innerHTML;if(Ext.isWebKit){var b=d.getAttribute("style");var a=b.match(/text-align:(.*?);/i);if(a&&a[1]){c='
    '+c+"
    "}}c=this.cleanHtml(c);if(this.fireEvent("beforesync",this,c)!==false){this.el.dom.value=c;this.fireEvent("sync",this,c)}}},getValue:function(){this[this.sourceEditMode?"pushValue":"syncValue"]();return Ext.form.HtmlEditor.superclass.getValue.call(this)},pushValue:function(){if(this.initialized){var a=this.el.dom.value;if(!this.activated&&a.length<1){a=this.defaultValue}if(this.fireEvent("beforepush",this,a)!==false){this.getEditorBody().innerHTML=a;if(Ext.isGecko){this.setDesignMode(false);this.setDesignMode(true)}this.fireEvent("push",this,a)}}},deferFocus:function(){this.focus.defer(10,this)},focus:function(){if(this.win&&!this.sourceEditMode){this.win.focus()}else{this.el.focus()}},initEditor:function(){try{var c=this.getEditorBody(),a=this.el.getStyles("font-size","font-family","background-image","background-repeat","background-color","color"),g,b;a["background-attachment"]="fixed";c.bgProperties="fixed";Ext.DomHelper.applyStyles(c,a);g=this.getDoc();if(g){try{Ext.EventManager.removeAll(g)}catch(d){}}b=this.onEditorEvent.createDelegate(this);Ext.EventManager.on(g,{mousedown:b,dblclick:b,click:b,keyup:b,buffer:100});if(Ext.isGecko){Ext.EventManager.on(g,"keypress",this.applyCommand,this)}if(Ext.isIE||Ext.isWebKit||Ext.isOpera){Ext.EventManager.on(g,"keydown",this.fixKeys,this)}g.editorInitialized=true;this.initialized=true;this.pushValue();this.setReadOnly(this.readOnly);this.fireEvent("initialize",this)}catch(d){}},beforeDestroy:function(){if(this.monitorTask){Ext.TaskMgr.stop(this.monitorTask)}if(this.rendered){Ext.destroy(this.tb);var b=this.getDoc();if(b){try{Ext.EventManager.removeAll(b);for(var c in b){delete b[c]}}catch(a){}}if(this.wrap){this.wrap.dom.innerHTML="";this.wrap.remove()}}Ext.form.HtmlEditor.superclass.beforeDestroy.call(this)},onFirstFocus:function(){this.activated=true;this.disableItems(this.readOnly);if(Ext.isGecko){this.win.focus();var a=this.win.getSelection();if(!a.focusNode||a.focusNode.nodeType!=3){var b=a.getRangeAt(0);b.selectNodeContents(this.getEditorBody());b.collapse(true);this.deferFocus()}try{this.execCmd("useCSS",true);this.execCmd("styleWithCSS",false)}catch(c){}}this.fireEvent("activate",this)},adjustFont:function(b){var d=b.getItemId()=="increasefontsize"?1:-1,c=this.getDoc(),a=parseInt(c.queryCommandValue("FontSize")||2,10);if((Ext.isSafari&&!Ext.isSafari2)||Ext.isChrome||Ext.isAir){if(a<=10){a=1+d}else{if(a<=13){a=2+d}else{if(a<=16){a=3+d}else{if(a<=18){a=4+d}else{if(a<=24){a=5+d}else{a=6+d}}}}}a=a.constrain(1,6)}else{if(Ext.isSafari){d*=2}a=Math.max(1,a+d)+(Ext.isSafari?"px":0)}this.execCmd("FontSize",a)},onEditorEvent:function(a){this.updateToolbar()},updateToolbar:function(){if(this.readOnly){return}if(!this.activated){this.onFirstFocus();return}var b=this.tb.items.map,c=this.getDoc();if(this.enableFont&&!Ext.isSafari2){var a=(c.queryCommandValue("FontName")||this.defaultFont).toLowerCase();if(a!=this.fontSelect.dom.value){this.fontSelect.dom.value=a}}if(this.enableFormat){b.bold.toggle(c.queryCommandState("bold"));b.italic.toggle(c.queryCommandState("italic"));b.underline.toggle(c.queryCommandState("underline"))}if(this.enableAlignments){b.justifyleft.toggle(c.queryCommandState("justifyleft"));b.justifycenter.toggle(c.queryCommandState("justifycenter"));b.justifyright.toggle(c.queryCommandState("justifyright"))}if(!Ext.isSafari2&&this.enableLists){b.insertorderedlist.toggle(c.queryCommandState("insertorderedlist"));b.insertunorderedlist.toggle(c.queryCommandState("insertunorderedlist"))}Ext.menu.MenuMgr.hideAll();this.syncValue()},relayBtnCmd:function(a){this.relayCmd(a.getItemId())},relayCmd:function(b,a){(function(){this.focus();this.execCmd(b,a);this.updateToolbar()}).defer(10,this)},execCmd:function(b,a){var c=this.getDoc();c.execCommand(b,false,a===undefined?null:a);this.syncValue()},applyCommand:function(b){if(b.ctrlKey){var d=b.getCharCode(),a;if(d>0){d=String.fromCharCode(d);switch(d){case"b":a="bold";break;case"i":a="italic";break;case"u":a="underline";break}if(a){this.win.focus();this.execCmd(a);this.deferFocus();b.preventDefault()}}}},insertAtCursor:function(c){if(!this.activated){return}if(Ext.isIE){this.win.focus();var b=this.getDoc(),a=b.selection.createRange();if(a){a.pasteHTML(c);this.syncValue();this.deferFocus()}}else{this.win.focus();this.execCmd("InsertHTML",c);this.deferFocus()}},fixKeys:function(){if(Ext.isIE){return function(g){var a=g.getKey(),d=this.getDoc(),b;if(a==g.TAB){g.stopEvent();b=d.selection.createRange();if(b){b.collapse(true);b.pasteHTML("    ");this.deferFocus()}}else{if(a==g.ENTER){b=d.selection.createRange();if(b){var c=b.parentElement();if(!c||c.tagName.toLowerCase()!="li"){g.stopEvent();b.pasteHTML("
    ");b.collapse(false);b.select()}}}}}}else{if(Ext.isOpera){return function(b){var a=b.getKey();if(a==b.TAB){b.stopEvent();this.win.focus();this.execCmd("InsertHTML","    ");this.deferFocus()}}}else{if(Ext.isWebKit){return function(b){var a=b.getKey();if(a==b.TAB){b.stopEvent();this.execCmd("InsertText","\t");this.deferFocus()}else{if(a==b.ENTER){b.stopEvent();this.execCmd("InsertHtml","

    ");this.deferFocus()}}}}}}}(),getToolbar:function(){return this.tb},buttonTips:{bold:{title:"Bold (Ctrl+B)",text:"Make the selected text bold.",cls:"x-html-editor-tip"},italic:{title:"Italic (Ctrl+I)",text:"Make the selected text italic.",cls:"x-html-editor-tip"},underline:{title:"Underline (Ctrl+U)",text:"Underline the selected text.",cls:"x-html-editor-tip"},increasefontsize:{title:"Grow Text",text:"Increase the font size.",cls:"x-html-editor-tip"},decreasefontsize:{title:"Shrink Text",text:"Decrease the font size.",cls:"x-html-editor-tip"},backcolor:{title:"Text Highlight Color",text:"Change the background color of the selected text.",cls:"x-html-editor-tip"},forecolor:{title:"Font Color",text:"Change the color of the selected text.",cls:"x-html-editor-tip"},justifyleft:{title:"Align Text Left",text:"Align text to the left.",cls:"x-html-editor-tip"},justifycenter:{title:"Center Text",text:"Center text in the editor.",cls:"x-html-editor-tip"},justifyright:{title:"Align Text Right",text:"Align text to the right.",cls:"x-html-editor-tip"},insertunorderedlist:{title:"Bullet List",text:"Start a bulleted list.",cls:"x-html-editor-tip"},insertorderedlist:{title:"Numbered List",text:"Start a numbered list.",cls:"x-html-editor-tip"},createlink:{title:"Hyperlink",text:"Make the selected text a hyperlink.",cls:"x-html-editor-tip"},sourceedit:{title:"Source Edit",text:"Switch to source editing mode.",cls:"x-html-editor-tip"}}});Ext.reg("htmleditor",Ext.form.HtmlEditor);Ext.form.TimeField=Ext.extend(Ext.form.ComboBox,{minValue:undefined,maxValue:undefined,minText:"The time in this field must be equal to or after {0}",maxText:"The time in this field must be equal to or before {0}",invalidText:"{0} is not a valid time",format:"g:i A",altFormats:"g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|gi|hi|gia|hia|g|H|gi a|hi a|giA|hiA|gi A|hi A",increment:15,mode:"local",triggerAction:"all",typeAhead:false,initDate:"1/1/2008",initDateFormat:"j/n/Y",initComponent:function(){if(Ext.isDefined(this.minValue)){this.setMinValue(this.minValue,true)}if(Ext.isDefined(this.maxValue)){this.setMaxValue(this.maxValue,true)}if(!this.store){this.generateStore(true)}Ext.form.TimeField.superclass.initComponent.call(this)},setMinValue:function(b,a){this.setLimit(b,true,a);return this},setMaxValue:function(b,a){this.setLimit(b,false,a);return this},generateStore:function(b){var c=this.minValue||new Date(this.initDate).clearTime(),a=this.maxValue||new Date(this.initDate).clearTime().add("mi",(24*60)-1),d=[];while(c<=a){d.push(c.dateFormat(this.format));c=c.add("mi",this.increment)}this.bindStore(d,b)},setLimit:function(b,g,a){var e;if(Ext.isString(b)){e=this.parseDate(b)}else{if(Ext.isDate(b)){e=b}}if(e){var c=new Date(this.initDate).clearTime();c.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds());this[g?"minValue":"maxValue"]=c;if(!a){this.generateStore()}}},getValue:function(){var a=Ext.form.TimeField.superclass.getValue.call(this);return this.formatDate(this.parseDate(a))||""},setValue:function(a){return Ext.form.TimeField.superclass.setValue.call(this,this.formatDate(this.parseDate(a)))},validateValue:Ext.form.DateField.prototype.validateValue,formatDate:Ext.form.DateField.prototype.formatDate,parseDate:function(h){if(!h||Ext.isDate(h)){return h}var j=this.initDate+" ",g=this.initDateFormat+" ",b=Date.parseDate(j+h,g+this.format),c=this.altFormats;if(!b&&c){if(!this.altFormatsArray){this.altFormatsArray=c.split("|")}for(var e=0,d=this.altFormatsArray,a=d.length;e=0){if(!d){c=g-1}d=false;while(c>=0){if(e.call(j||this,k,c,i)===true){return[k,c]}c--}k--}}else{if(c>=g){k++;d=false}while(k','
    ','
    ','
    ','
    {header}
    ',"
    ",'
    ',"
    ",'
    ','
    {body}
    ','',"
    ","
    ",'
     
    ','
     
    ',""),headerTpl:new Ext.Template('',"",'{cells}',"","
    "),bodyTpl:new Ext.Template("{rows}"),cellTpl:new Ext.Template('','
    {value}
    ',""),initTemplates:function(){var c=this.templates||{},d,b,g=new Ext.Template('','
    ',this.grid.enableHdMenu?'':"","{value}",'',"
    ",""),a=['','','
    {body}
    ',"",""].join(""),e=['',"","{cells}",this.enableRowBody?a:"","","
    "].join("");Ext.applyIf(c,{hcell:g,cell:this.cellTpl,body:this.bodyTpl,header:this.headerTpl,master:this.masterTpl,row:new Ext.Template('
    '+e+"
    "),rowInner:new Ext.Template(e)});for(b in c){d=c[b];if(d&&Ext.isFunction(d.compile)&&!d.compiled){d.disableFormats=true;d.compile()}}this.templates=c;this.colRe=new RegExp("x-grid3-td-([^\\s]+)","")},fly:function(a){if(!this._flyweight){this._flyweight=new Ext.Element.Flyweight(document.body)}this._flyweight.dom=a;return this._flyweight},getEditorParent:function(){return this.scroller.dom},initElements:function(){var b=Ext.Element,d=Ext.get(this.grid.getGridEl().dom.firstChild),e=new b(d.child("div.x-grid3-viewport")),c=new b(e.child("div.x-grid3-header")),a=new b(e.child("div.x-grid3-scroller"));if(this.grid.hideHeaders){c.setDisplayed(false)}if(this.forceFit){a.setStyle("overflow-x","hidden")}Ext.apply(this,{el:d,mainWrap:e,scroller:a,mainHd:c,innerHd:c.child("div.x-grid3-header-inner").dom,mainBody:new b(b.fly(a).child("div.x-grid3-body")),focusEl:new b(b.fly(a).child("a")),resizeMarker:new b(d.child("div.x-grid3-resize-marker")),resizeProxy:new b(d.child("div.x-grid3-resize-proxy"))});this.focusEl.swallowEvent("click",true)},getRows:function(){return this.hasRows()?this.mainBody.dom.childNodes:[]},findCell:function(a){if(!a){return false}return this.fly(a).findParent(this.cellSelector,this.cellSelectorDepth)},findCellIndex:function(d,c){var b=this.findCell(d),a;if(b){a=this.fly(b).hasClass(c);if(!c||a){return this.getCellIndex(b)}}return false},getCellIndex:function(b){if(b){var a=b.className.match(this.colRe);if(a&&a[1]){return this.cm.getIndexById(a[1])}}return false},findHeaderCell:function(b){var a=this.findCell(b);return a&&this.fly(a).hasClass(this.hdCls)?a:null},findHeaderIndex:function(a){return this.findCellIndex(a,this.hdCls)},findRow:function(a){if(!a){return false}return this.fly(a).findParent(this.rowSelector,this.rowSelectorDepth)},findRowIndex:function(a){var b=this.findRow(a);return b?b.rowIndex:false},findRowBody:function(a){if(!a){return false}return this.fly(a).findParent(this.rowBodySelector,this.rowBodySelectorDepth)},getRow:function(a){return this.getRows()[a]},getCell:function(b,a){return Ext.fly(this.getRow(b)).query(this.cellSelector)[a]},getHeaderCell:function(a){return this.mainHd.dom.getElementsByTagName("td")[a]},addRowClass:function(b,a){var c=this.getRow(b);if(c){this.fly(c).addClass(a)}},removeRowClass:function(c,a){var b=this.getRow(c);if(b){this.fly(b).removeClass(a)}},removeRow:function(a){Ext.removeNode(this.getRow(a));this.syncFocusEl(a)},removeRows:function(c,a){var b=this.mainBody.dom,d;for(d=c;d<=a;d++){Ext.removeNode(b.childNodes[c])}this.syncFocusEl(c)},getScrollState:function(){var a=this.scroller.dom;return{left:a.scrollLeft,top:a.scrollTop}},restoreScroll:function(a){var b=this.scroller.dom;b.scrollLeft=a.left;b.scrollTop=a.top},scrollToTop:function(){var a=this.scroller.dom;a.scrollTop=0;a.scrollLeft=0},syncScroll:function(){this.syncHeaderScroll();var a=this.scroller.dom;this.grid.fireEvent("bodyscroll",a.scrollLeft,a.scrollTop)},syncHeaderScroll:function(){var a=this.innerHd,b=this.scroller.dom.scrollLeft;a.scrollLeft=b;a.scrollLeft=b},updateSortIcon:function(d,c){var a=this.sortClasses,b=a[c=="DESC"?1:0],e=this.mainHd.select("td").removeClass(a);e.item(d).addClass(b)},updateAllColumnWidths:function(){var e=this.getTotalWidth(),k=this.cm.getColumnCount(),m=this.getRows(),g=m.length,b=[],l,a,h,d,c;for(d=0;d=this.ds.getCount()){return null}d=(d!==undefined?d:0);var c=this.getRow(h),b=this.cm,e=b.getColumnCount(),a;if(!(g===false&&d===0)){while(dm){n.scrollTop=q-a}}if(e!==false){var l=parseInt(h.offsetLeft,10),j=l+h.offsetWidth,i=parseInt(n.scrollLeft,10),b=i+n.clientWidth;if(lb){n.scrollLeft=j-n.clientWidth}}}return this.getResolvedXY(r)},insertRows:function(a,i,e,h){var d=a.getCount()-1;if(!h&&i===0&&e>=d){this.fireEvent("beforerowsinserted",this,i,e);this.refresh();this.fireEvent("rowsinserted",this,i,e)}else{if(!h){this.fireEvent("beforerowsinserted",this,i,e)}var b=this.renderRows(i,e),g=this.getRow(i);if(g){if(i===0){Ext.fly(this.getRow(0)).removeClass(this.firstRowCls)}Ext.DomHelper.insertHtml("beforeBegin",g,b)}else{var c=this.getRow(d-1);if(c){Ext.fly(c).removeClass(this.lastRowCls)}Ext.DomHelper.insertHtml("beforeEnd",this.mainBody.dom,b)}if(!h){this.processRows(i);this.fireEvent("rowsinserted",this,i,e)}else{if(i===0||i>=d){Ext.fly(this.getRow(i)).addClass(i===0?this.firstRowCls:this.lastRowCls)}}}this.syncFocusEl(i)},deleteRows:function(a,c,b){if(a.getRowCount()<1){this.refresh()}else{this.fireEvent("beforerowsdeleted",this,c,b);this.removeRows(c,b);this.processRows(c);this.fireEvent("rowsdeleted",this,c,b)}},getColumnStyle:function(b,d){var a=this.cm,g=a.config,c=d?"":g[b].css||"",e=g[b].align;c+=String.format("width: {0};",this.getColumnWidth(b));if(a.isHidden(b)){c+="display: none; "}if(e){c+=String.format("text-align: {0};",e)}return c},getColumnWidth:function(b){var c=this.cm.getColumnWidth(b),a=this.borderWidth;if(Ext.isNumber(c)){if(Ext.isBorderBox||(Ext.isWebKit&&!Ext.isSafari2)){return c+"px"}else{return Math.max(c-a,0)+"px"}}else{return c}},getTotalWidth:function(){return this.cm.getTotalWidth()+"px"},fitColumns:function(g,j,h){var a=this.grid,l=this.cm,s=l.getTotalWidth(false),q=this.getGridInnerWidth(),r=q-s,c=[],o=0,n=0,u,d,p;if(q<20||r===0){return false}var e=l.getColumnCount(true),m=l.getColumnCount(false),b=e-(Ext.isNumber(h)?1:0);if(b===0){b=1;h=undefined}for(p=0;pq){var t=(b==e)?o:h,k=Math.max(1,l.getColumnWidth(t)-(s-q));l.setColumnWidth(t,k,true)}if(g!==true){this.updateAllColumnWidths()}return true},autoExpand:function(k){var a=this.grid,i=this.cm,e=this.getGridInnerWidth(),c=i.getTotalWidth(false),g=a.autoExpandColumn;if(!this.userResized&&g){if(e!=c){var j=i.getIndexById(g),b=i.getColumnWidth(j),h=e-c+b,d=Math.min(Math.max(h,a.autoExpandMin),a.autoExpandMax);if(b!=d){i.setColumnWidth(j,d,true);if(k!==true){this.updateColumnWidth(j,d)}}}}},getGridInnerWidth:function(){return this.grid.getGridEl().getWidth(true)-this.getScrollOffset()},getColumnData:function(){var e=[],c=this.cm,g=c.getColumnCount(),a=this.ds.fields,d,b;for(d=0;d'+this.emptyText+"")}},updateHeaderSortState:function(){var b=this.ds.getSortState();if(!b){return}if(!this.sortState||(this.sortState.field!=b.field||this.sortState.direction!=b.direction)){this.grid.fireEvent("sortchange",this.grid,b)}this.sortState=b;var c=this.cm.findColumnIndex(b.field);if(c!=-1){var a=b.direction;this.updateSortIcon(c,a)}},clearHeaderSortState:function(){if(!this.sortState){return}this.grid.fireEvent("sortchange",this.grid,null);this.mainHd.select("td").removeClass(this.sortClasses);delete this.sortState},destroy:function(){var j=this,a=j.grid,d=a.getGridEl(),i=j.dragZone,g=j.splitZone,h=j.columnDrag,e=j.columnDrop,k=j.scrollToTopTask,c,b;if(k&&k.cancel){k.cancel()}Ext.destroyMembers(j,"colMenu","hmenu");j.initData(null,null);j.purgeListeners();Ext.fly(j.innerHd).un("click",j.handleHdDown,j);if(a.enableColumnMove){c=h.dragData;b=h.proxy;Ext.destroy(h.el,b.ghost,b.el,e.el,e.proxyTop,e.proxyBottom,c.ddel,c.header);if(b.anim){Ext.destroy(b.anim)}delete b.ghost;delete c.ddel;delete c.header;h.destroy();delete Ext.dd.DDM.locationCache[h.id];delete h._domRef;delete e.proxyTop;delete e.proxyBottom;e.destroy();delete Ext.dd.DDM.locationCache["gridHeader"+d.id];delete e._domRef;delete Ext.dd.DDM.ids[e.ddGroup]}if(g){g.destroy();delete g._domRef;delete Ext.dd.DDM.ids["gridSplitters"+d.id]}Ext.fly(j.innerHd).removeAllListeners();Ext.removeNode(j.innerHd);delete j.innerHd;Ext.destroy(j.el,j.mainWrap,j.mainHd,j.scroller,j.mainBody,j.focusEl,j.resizeMarker,j.resizeProxy,j.activeHdBtn,j._flyweight,i,g);delete a.container;if(i){i.destroy()}Ext.dd.DDM.currentTarget=null;delete Ext.dd.DDM.locationCache[d.id];Ext.EventManager.removeResizeListener(j.onWindowResize,j)},onDenyColumnHide:function(){},render:function(){if(this.autoFill){var a=this.grid.ownerCt;if(a&&a.getLayout()){a.on("afterlayout",function(){this.fitColumns(true,true);this.updateHeaders();this.updateHeaderSortState()},this,{single:true})}}else{if(this.forceFit){this.fitColumns(true,false)}else{if(this.grid.autoExpandColumn){this.autoExpand(true)}}}this.grid.getGridEl().dom.innerHTML=this.renderUI();this.afterRenderUI()},initData:function(a,e){var b=this;if(b.ds){var d=b.ds;d.un("add",b.onAdd,b);d.un("load",b.onLoad,b);d.un("clear",b.onClear,b);d.un("remove",b.onRemove,b);d.un("update",b.onUpdate,b);d.un("datachanged",b.onDataChange,b);if(d!==a&&d.autoDestroy){d.destroy()}}if(a){a.on({scope:b,load:b.onLoad,add:b.onAdd,remove:b.onRemove,update:b.onUpdate,clear:b.onClear,datachanged:b.onDataChange})}if(b.cm){var c=b.cm;c.un("configchange",b.onColConfigChange,b);c.un("widthchange",b.onColWidthChange,b);c.un("headerchange",b.onHeaderChange,b);c.un("hiddenchange",b.onHiddenChange,b);c.un("columnmoved",b.onColumnMove,b)}if(e){delete b.lastViewWidth;e.on({scope:b,configchange:b.onColConfigChange,widthchange:b.onColWidthChange,headerchange:b.onHeaderChange,hiddenchange:b.onHiddenChange,columnmoved:b.onColumnMove})}b.ds=a;b.cm=e},onDataChange:function(){this.refresh(true);this.updateHeaderSortState();this.syncFocusEl(0)},onClear:function(){this.refresh();this.syncFocusEl(0)},onUpdate:function(b,a){this.refreshRow(a)},onAdd:function(b,a,c){this.insertRows(b,c,c+(a.length-1))},onRemove:function(b,a,c,d){if(d!==true){this.fireEvent("beforerowremoved",this,c,a)}this.removeRow(c);if(d!==true){this.processRows(c);this.applyEmptyText();this.fireEvent("rowremoved",this,c,a)}},onLoad:function(){if(Ext.isGecko){if(!this.scrollToTopTask){this.scrollToTopTask=new Ext.util.DelayedTask(this.scrollToTop,this)}this.scrollToTopTask.delay(1)}else{this.scrollToTop()}},onColWidthChange:function(a,b,c){this.updateColumnWidth(b,c)},onHeaderChange:function(a,b,c){this.updateHeaders()},onHiddenChange:function(a,b,c){this.updateColumnHidden(b,c)},onColumnMove:function(a,c,b){this.indexMap=null;this.refresh(true);this.restoreScroll(this.getScrollState());this.afterMove(b);this.grid.fireEvent("columnmove",c,b)},onColConfigChange:function(){delete this.lastViewWidth;this.indexMap=null;this.refresh(true)},initUI:function(a){a.on("headerclick",this.onHeaderClick,this)},initEvents:Ext.emptyFn,onHeaderClick:function(b,a){if(this.headersDisabled||!this.cm.isSortable(a)){return}b.stopEditing(true);b.store.sort(this.cm.getDataIndex(a))},onRowOver:function(b,a){var c=this.findRowIndex(a);if(c!==false){this.addRowClass(c,this.rowOverCls)}},onRowOut:function(b,a){var c=this.findRowIndex(a);if(c!==false&&!b.within(this.getRow(c),true)){this.removeRowClass(c,this.rowOverCls)}},onRowSelect:function(a){this.addRowClass(a,this.selectedRowClass)},onRowDeselect:function(a){this.removeRowClass(a,this.selectedRowClass)},onCellSelect:function(c,b){var a=this.getCell(c,b);if(a){this.fly(a).addClass("x-grid3-cell-selected")}},onCellDeselect:function(c,b){var a=this.getCell(c,b);if(a){this.fly(a).removeClass("x-grid3-cell-selected")}},handleWheel:function(a){a.stopPropagation()},onColumnSplitterMoved:function(a,b){this.userResized=true;this.grid.colModel.setColumnWidth(a,b,true);if(this.forceFit){this.fitColumns(true,false,a);this.updateAllColumnWidths()}else{this.updateColumnWidth(a,b);this.syncHeaderScroll()}this.grid.fireEvent("columnresize",a,b)},beforeColMenuShow:function(){var b=this.cm,d=b.getColumnCount(),a=this.colMenu,c;a.removeAll();for(c=0;c0){if(!this.cm.isHidden(a-1)){return a}a--}return undefined},handleHdOver:function(c,b){var d=this.findHeaderCell(b);if(d&&!this.headersDisabled){var a=this.fly(d);this.activeHdRef=b;this.activeHdIndex=this.getCellIndex(d);this.activeHdRegion=a.getRegion();if(!this.isMenuDisabled(this.activeHdIndex,a)){a.addClass("x-grid3-hd-over");this.activeHdBtn=a.child(".x-grid3-hd-btn");if(this.activeHdBtn){this.activeHdBtn.dom.style.height=(d.firstChild.offsetHeight-1)+"px"}}}},handleHdOut:function(b,a){var c=this.findHeaderCell(a);if(c&&(!Ext.isIE||!b.within(c,true))){this.activeHdRef=null;this.fly(c).removeClass("x-grid3-hd-over");c.style.cursor=""}},isMenuDisabled:function(a,b){return this.cm.isMenuDisabled(a)},hasRows:function(){var a=this.mainBody.dom.firstChild;return a&&a.nodeType==1&&a.className!="x-grid-empty"},isHideableColumn:function(a){return !a.hidden},bind:function(a,b){this.initData(a,b)}});Ext.grid.GridView.SplitDragZone=Ext.extend(Ext.dd.DDProxy,{constructor:function(a,b){this.grid=a;this.view=a.getView();this.marker=this.view.resizeMarker;this.proxy=this.view.resizeProxy;Ext.grid.GridView.SplitDragZone.superclass.constructor.call(this,b,"gridSplitters"+this.grid.getGridEl().id,{dragElId:Ext.id(this.proxy.dom),resizeFrame:false});this.scroll=false;this.hw=this.view.splitHandleWidth||5},b4StartDrag:function(a,e){this.dragHeadersDisabled=this.view.headersDisabled;this.view.headersDisabled=true;var d=this.view.mainWrap.getHeight();this.marker.setHeight(d);this.marker.show();this.marker.alignTo(this.view.getHeaderCell(this.cellIndex),"tl-tl",[-2,0]);this.proxy.setHeight(d);var b=this.cm.getColumnWidth(this.cellIndex),c=Math.max(b-this.grid.minColumnWidth,0);this.resetConstraints();this.setXConstraint(c,1000);this.setYConstraint(0,0);this.minX=a-c;this.maxX=a+1000;this.startPos=a;Ext.dd.DDProxy.prototype.b4StartDrag.call(this,a,e)},allowHeaderDrag:function(a){return true},handleMouseDown:function(a){var h=this.view.findHeaderCell(a.getTarget());if(h&&this.allowHeaderDrag(a)){var k=this.view.fly(h).getXY(),c=k[0],i=a.getXY(),b=i[0],g=h.offsetWidth,d=false;if((b-c)<=this.hw){d=-1}else{if((c+g)-b<=this.hw){d=0}}if(d!==false){this.cm=this.grid.colModel;var j=this.view.getCellIndex(h);if(d==-1){if(j+d<0){return}while(this.cm.isHidden(j+d)){--d;if(j+d<0){return}}}this.cellIndex=j+d;this.split=h.dom;if(this.cm.isResizable(this.cellIndex)&&!this.cm.isFixed(this.cellIndex)){Ext.grid.GridView.SplitDragZone.superclass.handleMouseDown.apply(this,arguments)}}else{if(this.view.columnDrag){this.view.columnDrag.callHandleMouseDown(a)}}}},endDrag:function(g){this.marker.hide();var a=this.view,c=Math.max(this.minX,g.getPageX()),d=c-this.startPos,b=this.dragHeadersDisabled;a.onColumnSplitterMoved(this.cellIndex,this.cm.getColumnWidth(this.cellIndex)+d);setTimeout(function(){a.headersDisabled=b},50)},autoOffset:function(){this.setDelta(0,0)}});Ext.grid.PivotGridView=Ext.extend(Ext.grid.GridView,{colHeaderCellCls:"grid-hd-group-cell",title:"",getColumnHeaders:function(){return this.grid.topAxis.buildHeaders()},getRowHeaders:function(){return this.grid.leftAxis.buildHeaders()},renderRows:function(a,t){var b=this.grid,o=b.extractData(),p=o.length,g=this.templates,s=b.renderer,h=typeof s=="function",w=this.getCellCls,n=typeof w=="function",d=g.cell,x=g.row,k=[],q={},c="width:"+this.getGridInnerWidth()+"px;",l,r,e,v,m;a=a||0;t=Ext.isDefined(t)?t:p-1;for(v=0;v','
    ','
    ','
    {title}
    ','
    ','
    ',"
    ",'
    ',"
    ",'
    ','
    ','
    {body}
    ','',"
    ","
    ",'
     
    ','
     
    ',""),initTemplates:function(){Ext.grid.PivotGridView.superclass.initTemplates.apply(this,arguments);var a=this.templates||{};if(!a.gcell){a.gcell=new Ext.XTemplate('','
    ',this.grid.enableHdMenu?'':"","{value}","
    ","")}this.templates=a;this.hrowRe=new RegExp("ux-grid-hd-group-row-(\\d+)","")},initElements:function(){Ext.grid.PivotGridView.superclass.initElements.apply(this,arguments);this.rowHeadersEl=new Ext.Element(this.scroller.child("div.x-grid3-row-headers"));this.headerTitleEl=new Ext.Element(this.mainHd.child("div.x-grid3-header-title"))},getGridInnerWidth:function(){var a=Ext.grid.PivotGridView.superclass.getGridInnerWidth.apply(this,arguments);return a-this.getTotalRowHeaderWidth()},getTotalRowHeaderWidth:function(){var d=this.getRowHeaders(),c=d.length,b=0,a;for(a=0;a0&&d>0){h=h||o.data[a[g-1].dataIndex]!=l[d-1].data[a[g-1].dataIndex]}if(h){s.push({header:q,span:p,start:b});b+=p;p=0}if(k){s.push({header:n,span:p+1,start:b});b+=p;p=0}q=n;p++}c.push({items:s,width:e.width||this.defaultHeaderWidth});q=undefined}return c}});Ext.grid.HeaderDragZone=Ext.extend(Ext.dd.DragZone,{maxDragWidth:120,constructor:function(a,c,b){this.grid=a;this.view=a.getView();this.ddGroup="gridHeader"+this.grid.getGridEl().id;Ext.grid.HeaderDragZone.superclass.constructor.call(this,c);if(b){this.setHandleElId(Ext.id(c));this.setOuterHandleElId(Ext.id(b))}this.scroll=false},getDragData:function(c){var a=Ext.lib.Event.getTarget(c),b=this.view.findHeaderCell(a);if(b){return{ddel:b.firstChild,header:b}}return false},onInitDrag:function(a){this.dragHeadersDisabled=this.view.headersDisabled;this.view.headersDisabled=true;var b=this.dragData.ddel.cloneNode(true);b.id=Ext.id();b.style.width=Math.min(this.dragData.header.offsetWidth,this.maxDragWidth)+"px";this.proxy.update(b);return true},afterValidDrop:function(){this.completeDrop()},afterInvalidDrop:function(){this.completeDrop()},completeDrop:function(){var a=this.view,b=this.dragHeadersDisabled;setTimeout(function(){a.headersDisabled=b},50)}});Ext.grid.HeaderDropZone=Ext.extend(Ext.dd.DropZone,{proxyOffsets:[-4,-9],fly:Ext.Element.fly,constructor:function(a,c,b){this.grid=a;this.view=a.getView();this.proxyTop=Ext.DomHelper.append(document.body,{cls:"col-move-top",html:" "},true);this.proxyBottom=Ext.DomHelper.append(document.body,{cls:"col-move-bottom",html:" "},true);this.proxyTop.hide=this.proxyBottom.hide=function(){this.setLeftTop(-100,-100);this.setStyle("visibility","hidden")};this.ddGroup="gridHeader"+this.grid.getGridEl().id;Ext.grid.HeaderDropZone.superclass.constructor.call(this,a.getGridEl().dom)},getTargetFromEvent:function(c){var a=Ext.lib.Event.getTarget(c),b=this.view.findCellIndex(a);if(b!==false){return this.view.getHeaderCell(b)}},nextVisible:function(c){var b=this.view,a=this.grid.colModel;c=c.nextSibling;while(c){if(!a.isHidden(b.getCellIndex(c))){return c}c=c.nextSibling}return null},prevVisible:function(c){var b=this.view,a=this.grid.colModel;c=c.prevSibling;while(c){if(!a.isHidden(b.getCellIndex(c))){return c}c=c.prevSibling}return null},positionIndicator:function(d,k,j){var a=Ext.lib.Event.getPageX(j),g=Ext.lib.Dom.getRegion(k.firstChild),c,i,b=g.top+this.proxyOffsets[1];if((g.right-a)<=(g.right-g.left)/2){c=g.right+this.view.borderWidth;i="after"}else{c=g.left;i="before"}if(this.grid.colModel.isFixed(this.view.getCellIndex(k))){return false}c+=this.proxyOffsets[0];this.proxyTop.setLeftTop(c,b);this.proxyTop.show();if(!this.bottomOffset){this.bottomOffset=this.view.mainHd.getHeight()}this.proxyBottom.setLeftTop(c,b+this.proxyTop.dom.offsetHeight+this.bottomOffset);this.proxyBottom.show();return i},onNodeEnter:function(d,a,c,b){if(b.header!=d){this.positionIndicator(b.header,d,c)}},onNodeOver:function(g,b,d,c){var a=false;if(c.header!=g){a=this.positionIndicator(c.header,g,d)}if(!a){this.proxyTop.hide();this.proxyBottom.hide()}return a?this.dropAllowed:this.dropNotAllowed},onNodeOut:function(d,a,c,b){this.proxyTop.hide();this.proxyBottom.hide()},onNodeDrop:function(b,m,g,c){var d=c.header;if(d!=b){var k=this.grid.colModel,j=Ext.lib.Event.getPageX(g),a=Ext.lib.Dom.getRegion(b.firstChild),o=(a.right-j)<=((a.right-a.left)/2)?"after":"before",i=this.view.getCellIndex(d),l=this.view.getCellIndex(b);if(o=="after"){l++}if(i=0&&this.config[a].resizable!==false&&this.config[a].fixed!==true},setHidden:function(a,b){var d=this.config[a];if(d.hidden!==b){d.hidden=b;this.totalWidth=null;this.fireEvent("hiddenchange",this,a,b)}},setEditor:function(a,b){this.config[a].setEditor(b)},destroy:function(){var b=this.config.length,a=0;for(;a0},isSelected:function(a){var b=Ext.isNumber(a)?this.grid.store.getAt(a):a;return(b&&this.selections.key(b.id)?true:false)},isIdSelected:function(a){return(this.selections.key(a)?true:false)},handleMouseDown:function(d,i,h){if(h.button!==0||this.isLocked()){return}var a=this.grid.getView();if(h.shiftKey&&!this.singleSelect&&this.last!==false){var c=this.last;this.selectRange(c,i,h.ctrlKey);this.last=c;a.focusRow(i)}else{var b=this.isSelected(i);if(h.ctrlKey&&b){this.deselectRow(i)}else{if(!b||this.getCount()>1){this.selectRow(i,h.ctrlKey||h.shiftKey);a.focusRow(i)}}}},selectRows:function(c,d){if(!d){this.clearSelections()}for(var b=0,a=c.length;b=a;c--){this.selectRow(c,true)}}},deselectRange:function(c,b,a){if(this.isLocked()){return}for(var d=c;d<=b;d++){this.deselectRow(d,a)}},selectRow:function(b,d,a){if(this.isLocked()||(b<0||b>=this.grid.store.getCount())||(d&&this.isSelected(b))){return}var c=this.grid.store.getAt(b);if(c&&this.fireEvent("beforerowselect",this,b,d,c)!==false){if(!d||this.singleSelect){this.clearSelections()}this.selections.add(c);this.last=this.lastActive=b;if(!a){this.grid.getView().onRowSelect(b)}if(!this.silent){this.fireEvent("rowselect",this,b,c);this.fireEvent("selectionchange",this)}}},deselectRow:function(b,a){if(this.isLocked()){return}if(this.last==b){this.last=false}if(this.lastActive==b){this.lastActive=false}var c=this.grid.store.getAt(b);if(c){this.selections.remove(c);if(!a){this.grid.getView().onRowDeselect(b)}this.fireEvent("rowdeselect",this,b,c);this.fireEvent("selectionchange",this)}},acceptsNav:function(c,b,a){return !a.isHidden(b)&&a.isCellEditable(b,c)},onEditorKey:function(n,l){var d=l.getKey(),h,i=this.grid,p=i.lastEdit,j=i.activeEditor,b=l.shiftKey,o,p,a,m;if(d==l.TAB){l.stopEvent();j.completeEdit();if(b){h=i.walkCells(j.row,j.col-1,-1,this.acceptsNav,this)}else{h=i.walkCells(j.row,j.col+1,1,this.acceptsNav,this)}}else{if(d==l.ENTER){if(this.moveEditorOnEnter!==false){if(b){h=i.walkCells(p.row-1,p.col,-1,this.acceptsNav,this)}else{h=i.walkCells(p.row+1,p.col,1,this.acceptsNav,this)}}}}if(h){a=h[0];m=h[1];this.onEditorSelect(a,p.row);if(i.isEditor&&i.editing){o=i.activeEditor;if(o&&o.field.triggerBlur){o.field.triggerBlur()}}i.startEditing(a,m)}},onEditorSelect:function(b,a){if(a!=b){this.selectRow(b)}},destroy:function(){Ext.destroy(this.rowNav);this.rowNav=null;Ext.grid.RowSelectionModel.superclass.destroy.call(this)}});Ext.grid.Column=Ext.extend(Ext.util.Observable,{isColumn:true,constructor:function(b){Ext.apply(this,b);if(Ext.isString(this.renderer)){this.renderer=Ext.util.Format[this.renderer]}else{if(Ext.isObject(this.renderer)){this.scope=this.renderer.scope;this.renderer=this.renderer.fn}}if(!this.scope){this.scope=this}var a=this.editor;delete this.editor;this.setEditor(a);this.addEvents("click","contextmenu","dblclick","mousedown");Ext.grid.Column.superclass.constructor.call(this)},processEvent:function(b,d,c,g,a){return this.fireEvent(b,this,c,g,d)},destroy:function(){if(this.setEditor){this.setEditor(null)}this.purgeListeners()},renderer:function(a){return a},getEditor:function(a){return this.editable!==false?this.editor:null},setEditor:function(b){var a=this.editor;if(a){if(a.gridEditor){a.gridEditor.destroy();delete a.gridEditor}else{a.destroy()}}this.editor=null;if(b){if(!b.isXType){b=Ext.create(b,"textfield")}this.editor=b}},getCellEditor:function(b){var a=this.getEditor(b);if(a){if(!a.startEdit){if(!a.gridEditor){a.gridEditor=new Ext.grid.GridEditor(a)}a=a.gridEditor}}return a}});Ext.grid.BooleanColumn=Ext.extend(Ext.grid.Column,{trueText:"true",falseText:"false",undefinedText:" ",constructor:function(a){Ext.grid.BooleanColumn.superclass.constructor.call(this,a);var c=this.trueText,d=this.falseText,b=this.undefinedText;this.renderer=function(e){if(e===undefined){return b}if(!e||e==="false"){return d}return c}}});Ext.grid.NumberColumn=Ext.extend(Ext.grid.Column,{format:"0,000.00",constructor:function(a){Ext.grid.NumberColumn.superclass.constructor.call(this,a);this.renderer=Ext.util.Format.numberRenderer(this.format)}});Ext.grid.DateColumn=Ext.extend(Ext.grid.Column,{format:"m/d/Y",constructor:function(a){Ext.grid.DateColumn.superclass.constructor.call(this,a);this.renderer=Ext.util.Format.dateRenderer(this.format)}});Ext.grid.TemplateColumn=Ext.extend(Ext.grid.Column,{constructor:function(a){Ext.grid.TemplateColumn.superclass.constructor.call(this,a);var b=(!Ext.isPrimitive(this.tpl)&&this.tpl.compile)?this.tpl:new Ext.XTemplate(this.tpl);this.renderer=function(d,e,c){return b.apply(c.data)};this.tpl=b}});Ext.grid.ActionColumn=Ext.extend(Ext.grid.Column,{header:" ",actionIdRe:/x-action-col-(\d+)/,altText:"",constructor:function(b){var g=this,c=b.items||(g.items=[g]),a=c.length,d,e;Ext.grid.ActionColumn.superclass.constructor.call(g,b);g.renderer=function(h,i){h=Ext.isFunction(b.renderer)?b.renderer.apply(this,arguments)||"":"";i.css+=" x-action-col-cell";for(d=0;d"}return h}},destroy:function(){delete this.items;delete this.renderer;return Ext.grid.ActionColumn.superclass.destroy.apply(this,arguments)},processEvent:function(c,i,d,j,b){var a=i.getTarget().className.match(this.actionIdRe),h,g;if(a&&(h=this.items[parseInt(a[1],10)])){if(c=="click"){(g=h.handler||this.handler)&&g.call(h.scope||this.scope||this,d,j,b,h,i)}else{if((c=="mousedown")&&(h.stopSelection!==false)){return false}}}return Ext.grid.ActionColumn.superclass.processEvent.apply(this,arguments)}});Ext.grid.Column.types={gridcolumn:Ext.grid.Column,booleancolumn:Ext.grid.BooleanColumn,numbercolumn:Ext.grid.NumberColumn,datecolumn:Ext.grid.DateColumn,templatecolumn:Ext.grid.TemplateColumn,actioncolumn:Ext.grid.ActionColumn};Ext.grid.RowNumberer=Ext.extend(Object,{header:"",width:23,sortable:false,constructor:function(a){Ext.apply(this,a);if(this.rowspan){this.renderer=this.renderer.createDelegate(this)}},fixed:true,hideable:false,menuDisabled:true,dataIndex:"",id:"numberer",rowspan:undefined,renderer:function(b,c,a,d){if(this.rowspan){c.cellAttr='rowspan="'+this.rowspan+'"'}return d+1}});Ext.grid.CheckboxSelectionModel=Ext.extend(Ext.grid.RowSelectionModel,{header:'
     
    ',width:20,sortable:false,menuDisabled:true,fixed:true,hideable:false,dataIndex:"",id:"checker",isColumn:true,constructor:function(){Ext.grid.CheckboxSelectionModel.superclass.constructor.apply(this,arguments);if(this.checkOnly){this.handleMouseDown=Ext.emptyFn}},initEvents:function(){Ext.grid.CheckboxSelectionModel.superclass.initEvents.call(this);this.grid.on("render",function(){Ext.fly(this.grid.getView().innerHd).on("mousedown",this.onHdMouseDown,this)},this)},processEvent:function(b,d,c,g,a){if(b=="mousedown"){this.onMouseDown(d,d.getTarget());return false}else{return Ext.grid.Column.prototype.processEvent.apply(this,arguments)}},onMouseDown:function(c,b){if(c.button===0&&b.className=="x-grid3-row-checker"){c.stopEvent();var d=c.getTarget(".x-grid3-row");if(d){var a=d.rowIndex;if(this.isSelected(a)){this.deselectRow(a)}else{this.selectRow(a,true);this.grid.getView().focusRow(a)}}}},onHdMouseDown:function(c,a){if(a.className=="x-grid3-hd-checker"){c.stopEvent();var b=Ext.fly(a.parentNode);var d=b.hasClass("x-grid3-hd-checker-on");if(d){b.removeClass("x-grid3-hd-checker-on");this.clearSelections()}else{b.addClass("x-grid3-hd-checker-on");this.selectAll()}}},renderer:function(b,c,a){return'
     
    '},onEditorSelect:function(b,a){if(a!=b&&!this.checkOnly){this.selectRow(b)}}});Ext.grid.CellSelectionModel=Ext.extend(Ext.grid.AbstractSelectionModel,{constructor:function(a){Ext.apply(this,a);this.selection=null;this.addEvents("beforecellselect","cellselect","selectionchange");Ext.grid.CellSelectionModel.superclass.constructor.call(this)},initEvents:function(){this.grid.on("cellmousedown",this.handleMouseDown,this);this.grid.on(Ext.EventManager.getKeyEvent(),this.handleKeyDown,this);this.grid.getView().on({scope:this,refresh:this.onViewChange,rowupdated:this.onRowUpdated,beforerowremoved:this.clearSelections,beforerowsinserted:this.clearSelections});if(this.grid.isEditor){this.grid.on("beforeedit",this.beforeEdit,this)}},beforeEdit:function(a){this.select(a.row,a.column,false,true,a.record)},onRowUpdated:function(a,b,c){if(this.selection&&this.selection.record==c){a.onCellSelect(b,this.selection.cell[1])}},onViewChange:function(){this.clearSelections(true)},getSelectedCell:function(){return this.selection?this.selection.cell:null},clearSelections:function(b){var a=this.selection;if(a){if(b!==true){this.grid.view.onCellDeselect(a.cell[0],a.cell[1])}this.selection=null;this.fireEvent("selectionchange",this,null)}},hasSelection:function(){return this.selection?true:false},handleMouseDown:function(b,d,a,c){if(c.button!==0||this.isLocked()){return}this.select(d,a)},select:function(g,c,b,e,d){if(this.fireEvent("beforecellselect",this,g,c)!==false){this.clearSelections();d=d||this.grid.store.getAt(g);this.selection={record:d,cell:[g,c]};if(!b){var a=this.grid.getView();a.onCellSelect(g,c);if(e!==true){a.focusCell(g,c)}}this.fireEvent("cellselect",this,g,c);this.fireEvent("selectionchange",this,this.selection)}},isSelectable:function(c,b,a){return !a.isHidden(b)},onEditorKey:function(b,a){if(a.getKey()==a.TAB){this.handleKeyDown(a)}},handleKeyDown:function(j){if(!j.isNavKeyPress()){return}var d=j.getKey(),i=this.grid,p=this.selection,b=this,m=function(g,c,e){return i.walkCells(g,c,e,i.isEditor&&i.editing?b.acceptsNav:b.isSelectable,b)},o,h,a,l,n;switch(d){case j.ESC:case j.PAGE_UP:case j.PAGE_DOWN:break;default:j.stopEvent();break}if(!p){o=m(0,0,1);if(o){this.select(o[0],o[1])}return}o=p.cell;a=o[0];l=o[1];switch(d){case j.TAB:if(j.shiftKey){h=m(a,l-1,-1)}else{h=m(a,l+1,1)}break;case j.DOWN:h=m(a+1,l,1);break;case j.UP:h=m(a-1,l,-1);break;case j.RIGHT:h=m(a,l+1,1);break;case j.LEFT:h=m(a,l-1,-1);break;case j.ENTER:if(i.isEditor&&!i.editing){i.startEditing(a,l);return}break}if(h){a=h[0];l=h[1];this.select(a,l);if(i.isEditor&&i.editing){n=i.activeEditor;if(n&&n.field.triggerBlur){n.field.triggerBlur()}i.startEditing(a,l)}}},acceptsNav:function(c,b,a){return !a.isHidden(b)&&a.isCellEditable(b,c)}});Ext.grid.EditorGridPanel=Ext.extend(Ext.grid.GridPanel,{clicksToEdit:2,forceValidation:false,isEditor:true,detectEdit:false,autoEncode:false,trackMouseOver:false,initComponent:function(){Ext.grid.EditorGridPanel.superclass.initComponent.call(this);if(!this.selModel){this.selModel=new Ext.grid.CellSelectionModel()}this.activeEditor=null;this.addEvents("beforeedit","afteredit","validateedit")},initEvents:function(){Ext.grid.EditorGridPanel.superclass.initEvents.call(this);this.getGridEl().on("mousewheel",this.stopEditing.createDelegate(this,[true]),this);this.on("columnresize",this.stopEditing,this,[true]);if(this.clicksToEdit==1){this.on("cellclick",this.onCellDblClick,this)}else{var a=this.getView();if(this.clicksToEdit=="auto"&&a.mainBody){a.mainBody.on("mousedown",this.onAutoEditClick,this)}this.on("celldblclick",this.onCellDblClick,this)}},onResize:function(){Ext.grid.EditorGridPanel.superclass.onResize.apply(this,arguments);var a=this.activeEditor;if(this.editing&&a){a.realign(true)}},onCellDblClick:function(b,c,a){this.startEditing(c,a)},onAutoEditClick:function(c,b){if(c.button!==0){return}var g=this.view.findRowIndex(b),a=this.view.findCellIndex(b);if(g!==false&&a!==false){this.stopEditing();if(this.selModel.getSelectedCell){var d=this.selModel.getSelectedCell();if(d&&d[0]===g&&d[1]===a){this.startEditing(g,a)}}else{if(this.selModel.isSelected(g)){this.startEditing(g,a)}}}},onEditComplete:function(b,d,a){this.editing=false;this.lastActiveEditor=this.activeEditor;this.activeEditor=null;var c=b.record,h=this.colModel.getDataIndex(b.col);d=this.postEditValue(d,a,c,h);if(this.forceValidation===true||String(d)!==String(a)){var g={grid:this,record:c,field:h,originalValue:a,value:d,row:b.row,column:b.col,cancel:false};if(this.fireEvent("validateedit",g)!==false&&!g.cancel&&String(d)!==String(a)){c.set(h,g.value);delete g.cancel;this.fireEvent("afteredit",g)}}this.view.focusCell(b.row,b.col)},startEditing:function(i,c){this.stopEditing();if(this.colModel.isCellEditable(c,i)){this.view.ensureVisible(i,c,true);var d=this.store.getAt(i),h=this.colModel.getDataIndex(c),g={grid:this,record:d,field:h,value:d.data[h],row:i,column:c,cancel:false};if(this.fireEvent("beforeedit",g)!==false&&!g.cancel){this.editing=true;var b=this.colModel.getCellEditor(c,i);if(!b){return}if(!b.rendered){b.parentEl=this.view.getEditorParent(b);b.on({scope:this,render:{fn:function(e){e.field.focus(false,true)},single:true,scope:this},specialkey:function(k,j){this.getSelectionModel().onEditorKey(k,j)},complete:this.onEditComplete,canceledit:this.stopEditing.createDelegate(this,[true])})}Ext.apply(b,{row:i,col:c,record:d});this.lastEdit={row:i,col:c};this.activeEditor=b;b.selectSameEditor=(this.activeEditor==this.lastActiveEditor);var a=this.preEditValue(d,h);b.startEdit(this.view.getCell(i,c).firstChild,Ext.isDefined(a)?a:"");(function(){delete b.selectSameEditor}).defer(50)}}},preEditValue:function(a,c){var b=a.data[c];return this.autoEncode&&Ext.isString(b)?Ext.util.Format.htmlDecode(b):b},postEditValue:function(c,a,b,d){return this.autoEncode&&Ext.isString(c)?Ext.util.Format.htmlEncode(c):c},stopEditing:function(b){if(this.editing){var a=this.lastActiveEditor=this.activeEditor;if(a){a[b===true?"cancelEdit":"completeEdit"]();this.view.focusCell(a.row,a.col)}this.activeEditor=null}this.editing=false}});Ext.reg("editorgrid",Ext.grid.EditorGridPanel);Ext.grid.GridEditor=function(b,a){Ext.grid.GridEditor.superclass.constructor.call(this,b,a);b.monitorTab=false};Ext.extend(Ext.grid.GridEditor,Ext.Editor,{alignment:"tl-tl",autoSize:"width",hideEl:false,cls:"x-small-editor x-grid-editor",shim:false,shadow:false});Ext.grid.PropertyRecord=Ext.data.Record.create([{name:"name",type:"string"},"value"]);Ext.grid.PropertyStore=Ext.extend(Ext.util.Observable,{constructor:function(a,b){this.grid=a;this.store=new Ext.data.Store({recordType:Ext.grid.PropertyRecord});this.store.on("update",this.onUpdate,this);if(b){this.setSource(b)}Ext.grid.PropertyStore.superclass.constructor.call(this)},setSource:function(c){this.source=c;this.store.removeAll();var b=[];for(var a in c){if(this.isEditableValue(c[a])){b.push(new Ext.grid.PropertyRecord({name:a,value:c[a]},a))}}this.store.loadRecords({records:b},{},true)},onUpdate:function(e,a,d){if(d==Ext.data.Record.EDIT){var b=a.data.value;var c=a.modified.value;if(this.grid.fireEvent("beforepropertychange",this.source,a.id,b,c)!==false){this.source[a.id]=b;a.commit();this.grid.fireEvent("propertychange",this.source,a.id,b,c)}else{a.reject()}}},getProperty:function(a){return this.store.getAt(a)},isEditableValue:function(a){return Ext.isPrimitive(a)||Ext.isDate(a)},setValue:function(d,c,a){var b=this.getRec(d);if(b){b.set("value",c);this.source[d]=c}else{if(a){this.source[d]=c;b=new Ext.grid.PropertyRecord({name:d,value:c},d);this.store.add(b)}}},remove:function(b){var a=this.getRec(b);if(a){this.store.remove(a);delete this.source[b]}},getRec:function(a){return this.store.getById(a)},getSource:function(){return this.source}});Ext.grid.PropertyColumnModel=Ext.extend(Ext.grid.ColumnModel,{nameText:"Name",valueText:"Value",dateFormat:"m/j/Y",trueText:"true",falseText:"false",constructor:function(c,b){var d=Ext.grid,e=Ext.form;this.grid=c;d.PropertyColumnModel.superclass.constructor.call(this,[{header:this.nameText,width:50,sortable:true,dataIndex:"name",id:"name",menuDisabled:true},{header:this.valueText,width:50,resizable:false,dataIndex:"value",id:"value",menuDisabled:true}]);this.store=b;var a=new e.Field({autoCreate:{tag:"select",children:[{tag:"option",value:"true",html:this.trueText},{tag:"option",value:"false",html:this.falseText}]},getValue:function(){return this.el.dom.value=="true"}});this.editors={date:new d.GridEditor(new e.DateField({selectOnFocus:true})),string:new d.GridEditor(new e.TextField({selectOnFocus:true})),number:new d.GridEditor(new e.NumberField({selectOnFocus:true,style:"text-align:left;"})),"boolean":new d.GridEditor(a,{autoSize:"both"})};this.renderCellDelegate=this.renderCell.createDelegate(this);this.renderPropDelegate=this.renderProp.createDelegate(this)},renderDate:function(a){return a.dateFormat(this.dateFormat)},renderBool:function(a){return this[a?"trueText":"falseText"]},isCellEditable:function(a,b){return a==1},getRenderer:function(a){return a==1?this.renderCellDelegate:this.renderPropDelegate},renderProp:function(a){return this.getPropertyName(a)},renderCell:function(d,b,c){var a=this.grid.customRenderers[c.get("name")];if(a){return a.apply(this,arguments)}var e=d;if(Ext.isDate(d)){e=this.renderDate(d)}else{if(typeof d=="boolean"){e=this.renderBool(d)}}return Ext.util.Format.htmlEncode(e)},getPropertyName:function(b){var a=this.grid.propertyNames;return a&&a[b]?a[b]:b},getCellEditor:function(a,e){var b=this.store.getProperty(e),d=b.data.name,c=b.data.value;if(this.grid.customEditors[d]){return this.grid.customEditors[d]}if(Ext.isDate(c)){return this.editors.date}else{if(typeof c=="number"){return this.editors.number}else{if(typeof c=="boolean"){return this.editors["boolean"]}else{return this.editors.string}}}},destroy:function(){Ext.grid.PropertyColumnModel.superclass.destroy.call(this);this.destroyEditors(this.editors);this.destroyEditors(this.grid.customEditors)},destroyEditors:function(b){for(var a in b){Ext.destroy(b[a])}}});Ext.grid.PropertyGrid=Ext.extend(Ext.grid.EditorGridPanel,{enableColumnMove:false,stripeRows:false,trackMouseOver:false,clicksToEdit:1,enableHdMenu:false,viewConfig:{forceFit:true},initComponent:function(){this.customRenderers=this.customRenderers||{};this.customEditors=this.customEditors||{};this.lastEditRow=null;var b=new Ext.grid.PropertyStore(this);this.propStore=b;var a=new Ext.grid.PropertyColumnModel(this,b);b.store.sort("name","ASC");this.addEvents("beforepropertychange","propertychange");this.cm=a;this.ds=b.store;Ext.grid.PropertyGrid.superclass.initComponent.call(this);this.mon(this.selModel,"beforecellselect",function(e,d,c){if(c===0){this.startEditing.defer(200,this,[d,1]);return false}},this)},onRender:function(){Ext.grid.PropertyGrid.superclass.onRender.apply(this,arguments);this.getGridEl().addClass("x-props-grid")},afterRender:function(){Ext.grid.PropertyGrid.superclass.afterRender.apply(this,arguments);if(this.source){this.setSource(this.source)}},setSource:function(a){this.propStore.setSource(a)},getSource:function(){return this.propStore.getSource()},setProperty:function(c,b,a){this.propStore.setValue(c,b,a)},removeProperty:function(a){this.propStore.remove(a)}});Ext.reg("propertygrid",Ext.grid.PropertyGrid);Ext.grid.GroupingView=Ext.extend(Ext.grid.GridView,{groupByText:"Group By This Field",showGroupsText:"Show in Groups",hideGroupedColumn:false,showGroupName:true,startCollapsed:false,enableGrouping:true,enableGroupingMenu:true,enableNoGroups:true,emptyGroupText:"(None)",ignoreAdd:false,groupTextTpl:"{text}",groupMode:"value",cancelEditOnToggle:true,initTemplates:function(){Ext.grid.GroupingView.superclass.initTemplates.call(this);this.state={};var a=this.grid.getSelectionModel();a.on(a.selectRow?"beforerowselect":"beforecellselect",this.onBeforeRowSelect,this);if(!this.startGroup){this.startGroup=new Ext.XTemplate('
    ','
    ',this.groupTextTpl,"
    ",'
    ')}this.startGroup.compile();if(!this.endGroup){this.endGroup="
    "}},findGroup:function(a){return Ext.fly(a).up(".x-grid-group",this.mainBody.dom)},getGroups:function(){return this.hasRows()?this.mainBody.dom.childNodes:[]},onAdd:function(d,a,b){if(this.canGroup()&&!this.ignoreAdd){var c=this.getScrollState();this.fireEvent("beforerowsinserted",d,b,b+(a.length-1));this.refresh();this.restoreScroll(c);this.fireEvent("rowsinserted",d,b,b+(a.length-1))}else{if(!this.canGroup()){Ext.grid.GroupingView.superclass.onAdd.apply(this,arguments)}}},onRemove:function(e,a,b,d){Ext.grid.GroupingView.superclass.onRemove.apply(this,arguments);var c=document.getElementById(a._groupId);if(c&&c.childNodes[1].childNodes.length<1){Ext.removeNode(c)}this.applyEmptyText()},refreshRow:function(a){if(this.ds.getCount()==1){this.refresh()}else{this.isUpdating=true;Ext.grid.GroupingView.superclass.refreshRow.apply(this,arguments);this.isUpdating=false}},beforeMenuShow:function(){var c,a=this.hmenu.items,b=this.cm.config[this.hdCtxIndex].groupable===false;if((c=a.get("groupBy"))){c.setDisabled(b)}if((c=a.get("showGroups"))){c.setDisabled(b);c.setChecked(this.canGroup(),true)}},renderUI:function(){var a=Ext.grid.GroupingView.superclass.renderUI.call(this);if(this.enableGroupingMenu&&this.hmenu){this.hmenu.add("-",{itemId:"groupBy",text:this.groupByText,handler:this.onGroupByClick,scope:this,iconCls:"x-group-by-icon"});if(this.enableNoGroups){this.hmenu.add({itemId:"showGroups",text:this.showGroupsText,checked:true,checkHandler:this.onShowGroupsClick,scope:this})}this.hmenu.on("beforeshow",this.beforeMenuShow,this)}return a},processEvent:function(b,i){Ext.grid.GroupingView.superclass.processEvent.call(this,b,i);var h=i.getTarget(".x-grid-group-hd",this.mainBody);if(h){var g=this.getGroupField(),d=this.getPrefix(g),a=h.id.substring(d.length),c=new RegExp("gp-"+Ext.escapeRe(g)+"--hd");a=a.substr(0,a.length-3);if(a||c.test(h.id)){this.grid.fireEvent("group"+b,this.grid,g,a,i)}if(b=="mousedown"&&i.button==0){this.toggleGroup(h.parentNode)}}},onGroupByClick:function(){var a=this.grid;this.enableGrouping=true;a.store.groupBy(this.cm.getDataIndex(this.hdCtxIndex));a.fireEvent("groupchange",a,a.store.getGroupState());this.beforeMenuShow();this.refresh()},onShowGroupsClick:function(a,b){this.enableGrouping=b;if(b){this.onGroupByClick()}else{this.grid.store.clearGrouping();this.grid.fireEvent("groupchange",this,null)}},toggleRowIndex:function(c,a){if(!this.canGroup()){return}var b=this.getRow(c);if(b){this.toggleGroup(this.findGroup(b),a)}},toggleGroup:function(c,b){var a=Ext.get(c),d=Ext.util.Format.htmlEncode(a.id);b=Ext.isDefined(b)?b:a.hasClass("x-grid-group-collapsed");if(this.state[d]!==b){if(this.cancelEditOnToggle!==false){this.grid.stopEditing(true)}this.state[d]=b;a[b?"removeClass":"addClass"]("x-grid-group-collapsed")}},toggleAllGroups:function(c){var b=this.getGroups();for(var d=0,a=b.length;d Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . glpi-0.84.3+dfsg.1/lib/extjs/index.html000066400000000000000000000200011226600447100175120ustar00rootroot00000000000000 Welcome to Ext JS

    Learn

    Use the included files to view samples and our API documentation.

    For advanced, hands-on support, please see our premium support subscriptions. Larger organizations can use our enterprise training and services.

    Engage

    Our community forums have over 100,000 registered users and are a great place to ask questions and interact with other Ext JS developers.

    License

    Ext JS is dual licensed. This means:

    • Free to use and test in your local development environment.
    • Free to use in your open source projects.
    • Purchase a developer license if you don’t plan on releasing your website or application’s code as open source.

    To purchase a commercial license, please see our pricing page.

    Check out our Job Board »

    glpi-0.84.3+dfsg.1/lib/extjs/license.txt000066400000000000000000000030341226600447100177070ustar00rootroot00000000000000Ext JS - JavaScript Library Copyright (c) 2006-2011, Sencha Inc. All rights reserved. licensing@sencha.com http://www.sencha.com/license Open Source License ------------------------------------------------------------------------------------------ Ext JS is licensed under the terms of the Open Source GPL 3.0 license. http://www.gnu.org/licenses/gpl.html There are several FLOSS exceptions available for use with this release for open source applications that are distributed under a license other than the GPL. * Open Source License Exception for Applications http://www.sencha.com/products/floss-exception.php * Open Source License Exception for Development http://www.sencha.com/products/ux-exception.php Commercial License ------------------------------------------------------------------------------------------ This is the appropriate option if you are creating proprietary applications and you are not prepared to distribute and share the source code of your application under the GPL v3 license. Please visit http://www.sencha.com/license for more details. OEM / Reseller License ------------------------------------------------------------------------------------------ For more details, please visit: http://www.sencha.com/license. -- This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF THIRD-PARTY INTELLECTUAL PROPERTY RIGHTS. See the GNU General Public License for more details.glpi-0.84.3+dfsg.1/lib/extjs/locale/000077500000000000000000000000001226600447100167635ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-af.js000066400000000000000000000121201226600447100214200ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /* * List compiled by mystix on the extjs.com forums. * Thank you Mystix! * * Afrikaans Translations * by Thys Meintjes (20 July 2007) */ /* Ext Core translations */ Ext.UpdateManager.defaults.indicatorText = '
    Besig om te laai...
    '; /* Ext single string translations */ if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} geselekteerde ry(e)"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Maak die oortjie toe"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "Die waarde in hierdie veld is foutief"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Besig om te laai..."; } /* Javascript month and days translations */ Date.monthNames = [ "Januarie", "Februarie", "Maart", "April", "Mei", "Junie", "Julie", "Augustus", "September", "Oktober", "November", "Desember" ]; Date.dayNames = [ "Sondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrydag", "Saterdag" ]; /* Ext components translations */ if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "OK", cancel : "Kanselleer", yes : "Ja", no : "Nee" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d-m-y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Vandag", minText : "Hierdie datum is vroër as die minimum datum", maxText : "Hierdie dataum is later as die maximum datum", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Volgende Maand (Beheer+Regs)', prevText : 'Vorige Maand (Beheer+Links)', monthYearText : "Kies 'n maand (Beheer+Op/Af volgende/vorige jaar)", todayTip : "{0} (Spasie)", format : "d-m-y", startDay : 0 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Bladsy", afterPageText : "van {0}", firstText : "Eerste Bladsy", prevText : "Vorige Bladsy", nextText : "Volgende Bladsy", lastText : "Laatste Bladsy", refreshText : "Verfris", displayMsg : "Wys {0} - {1} van {2}", emptyMsg : 'Geen data om te wys nie' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "Die minimum lengte van die veld is {0}", maxLengthText : "Die maximum lengte van die veld is {0}", blankText : "Die veld is verpligtend", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "Die minimum waarde vir die veld is {0}", maxText : "Die maximum waarde vir die veld is {0}", nanText : "{0} is nie 'n geldige waarde nie" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Afgeskakel", disabledDatesText : "Afgeskakel", minText : "Die datum in hierdie veld moet na {0} wees", maxText : "Die datum in hierdie veld moet voor {0} wees", invalidText : "{0} is nie 'n geldige datum nie - datumformaat is {1}", format : "d/m/y", altFormats : "d/m/Y|d-m-y|d-m-Y|d/m|d-m|dm|dmy|dmY|d|Y-m-d", startDay : 0 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Besig om te laai...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : "Hierdie veld moet 'n e-pos adres wees met die formaat 'gebruiker@domein.za'", urlText : "Hierdie veld moet 'n URL wees me die formaat 'http:/'+'/www.domein.za'", alphaText : 'Die veld mag alleenlik letters en _ bevat', alphanumText : 'Die veld mag alleenlik letters, syfers en _ bevat' }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Sorteer Oplopend", sortDescText : "Sorteer Aflopend", lockText : "Vries Kolom", unlockText : "Ontvries Kolom", columnsText : "Kolomme" }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Naam", valueText : "Waarde", dateFormat : "Y-m-j" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Trek om grootte aan te pas.", collapsibleSplitTip : "Trek om grootte aan te pas. Dubbel-klik om weg te steek." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-am.js000066400000000000000000000273141226600447100214420ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * List compiled by Tewodros Wondimu on the extjs.com forums Oct 18, 2010. * * Amharic Translations */ Ext.UpdateManager.defaults.indicatorText = '
    እያስገባ ነዉ...
    '; if(Ext.DataView){ Ext.DataView.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} ምርጥ ረድፍ {1}"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "እያስገባ ነዉ..."; } Date.shortMonthNames = [ "መስከ", "ጥቅም", "ህዳር", "ታህሳ", "ጥር", "የካቲ", "መጋቢ", "ሚያዚ", "ግንቦ", "ሰኔ", "ሐምሌ", "ነሃሴ", "ጷግሜ" ]; Date.monthNames = [ "መስከረም", "ጥቅምት", "ህዳር", "ታህሳስ", "ጥር", "የካቲት", "መጋቢት", "ሚያዚያ", "ግንቦት", "ሰኔ", "ሐምሌ", "ነሃሴ", "ጷግሜ" ]; Date.getShortMonthName = function(month) { return Date.monthNames[month].substring(0, 3); }; Date.monthNumbers = { "መስከረም" : 0, "ጥቅምት" : 1, "ህዳር" : 2, "ታህሳስ" : 3, "ጥር" : 4, "የካቲት" : 5, "መጋቢት" : 6, "ሚያዚያ" : 7, "ግንቦት" : 8, "ሰኔ" : 9, "ሐምሌ" : 10, "ነሃሴ" : 11, "ጷግሜ" : 12 }; Date.getMonthNumber = function(name) { return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()]; }; Date.dayNames = [ "እሁድ", "ሰኞ", "ማክሰኞ", "ዓሮብ", "ሐሙስ", "አርብ", "ቅዳሜ" ]; Date.getShortDayName = function(day) { return Date.dayNames[day].substring(0, 3); }; Date.parseCodes.S.s = "(?:st|nd|rd|th)"; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "ይሁን", cancel : "ሰርዝ", yes : "አዎ", no : "የለም / አይ" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "ወ/ቀ/አ"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "ዛሬ", minText : "ይሄ ቀን ከመጨረሻ ትንሹ ቀን በፊት ነዉ", maxText : "ይሄ ቀን ከመጨረሻ ትልቁ ቀን በፊት ነዉ", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'የሚቀጥለዉ ወር(መቆጣጣሪያ ቁምፍ+ቀኝ)', prevText : 'ያለፈዉ ወር(መቆጣጣሪያ ቁምፍ+ግራ)', monthYearText : 'ወር ምረጥ (አመት ለመለወጥ መቆጣጣሪያ ቁምፍ+ወደላይ/ወደታች)', todayTip : "{0} (የቦታ ቁልፍ)", format : "d/m/Y", okText : "ይሁን", cancelText : "ሰርዝ", startDay : 0 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "ገልጽ", afterPageText : "የ {0}", firstText : "የመጀመሪያዉ ገልጽ", prevText : "ያለፈዉ ገልጽ", nextText : "የሚቀጥለዉ ገልጽ", lastText : "የመጨረሻዉ ገልጽ", refreshText : "ከልስ", displayMsg : "{0} - {1} ሲያሳይ ከ {2}", emptyMsg : 'የሚታይ ዳታ የለም' }); } if(Ext.form.BasicForm){ Ext.form.BasicForm.prototype.waitTitle = "እባክዎን ይጠብቁ..." } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "የዚህ መስክ እሴት የተሳሳተ ነዉ"; } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "የዚህ መስክ የመጨረሻ ትንሽ ርዝመት {0} ነዉ", maxLengthText : "የዚህ መስክ የመጨረሻ ትልቅ ርዝመት {0} ነዉ", blankText : "ይሄ መስክ አስፈላጊ ነዉ", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { decimalSeparator : ".", decimalPrecision : 2, minText : "የዚህ መስክ የመጨረሻ ትንሽ እሴት {0} ነዉ", maxText : "የዚህ መስክ የመጨረሻ ትልቅ እሴት {0} ነዉ", nanText : "{0} የተሳሳተ ቁጥር ነዉ" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "ቦዝኗል / ስራ አቁሟል", disabledDatesText : "ቦዝኗል / ስራ አቁሟል", minText : "እዚ እሴት ዉስጥ ያለዉ ቀን ከ{0} በሑአላ መሆን አለበት", maxText : "እዚ እሴት ዉስጥ ያለዉ ቀን ከ{0} በፊት መሆን አለበት", invalidText : "{0} የተሳሳተ ቀን ነዉ - በዚህ ቅርፀት መሆን አለበት {1}", format : "d/m/y", altFormats : "d/m/Y|d/m/y|d-m-y|d-m-Y|d/m|d-m|dm|dmy|dmY|d|Y-m-d", startDay : 0 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "እያስገባ ነዉ...", valueNotFoundText : "አልተወሰነም" }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'ይሄ እሴት ኢሜይል መሆን አለበት - በዚህ ቅርፀት መሆን አለበት "user@example.com"', urlText : 'ይሄ እሴት ዩአርኤን መሆን አለበት - በዚህ ቅርፀት መሆን አለበት "http:/'+'/www.example.com"', alphaText : 'ይሄ እሴት መያዝ ያለበት ቃላትና _ ብቻ ነዉ', alphanumText : 'ይሄ እሴት መያዝ ያለበት ቃላት፤ ቁጥርና _ ብቻ ነዉ' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'እባኮትን ለዚ ዩአርኤን አገናኝ አስገባ:', buttonTips : { bold : { title: 'ደማቅ (መቆጣጣሪያ ቁምፍ+B)', text: 'የተመረጠዉን ጽሁፍ አድምቅ::', cls: 'ኤክስ-ኤችቲኤምኤል-አርታኢ-ጠቃሚ ምክር' }, italic : { title: 'ሰያፍ (መቆጣጣሪያ ቁምፍ+I)', text: 'የተመረጠዉን ጽሁፍ ሰያፍ አድርግ::', cls: 'ኤክስ-ኤችቲኤምኤል-አርታኢ-ጠቃሚ ምክር' }, underline : { title: 'መስመረግርጌ (መቆጣጣሪያ ቁምፍ+U)', text: 'የተመረጠዉን ጽሁፍ ከግርጌ አስምር::', cls: 'ኤክስ-ኤችቲኤምኤል-አርታኢ-ጠቃሚ ምክር' }, increasefontsize : { title: 'ጽሁፉን አሳድግ', text: 'ቅርጸ ቁምፊ አሳድገግ::', cls: 'ኤክስ-ኤችቲኤምኤል-አርታኢ-ጠቃሚ ምክር' }, decreasefontsize : { title: 'ጽሁፉን አሳንስ', text: 'ቅርጸ ቁምፊ አሳንስ::', cls: 'ኤክስ-ኤችቲኤምኤል-አርታኢ-ጠቃሚ ምክር' }, backcolor : { title: 'ጽሁፍ ምረጥ ቀለም', text: 'የተመረጠዉን ጽሁፍ ዳራ ቀለም ለዉጥ::', cls: 'ኤክስ-ኤችቲኤምኤል-አርታኢ-ጠቃሚ ምክር' }, forecolor : { title: 'ቅርጸ ቁምፊ ቀለም', text: 'የተመረጠዉን ጽሁፍ ቀለም ለዉጥ::', cls: 'ኤክስ-ኤችቲኤምኤል-አርታኢ-ጠቃሚ ምክር' }, justifyleft : { title: 'ጽሁፍ ግራ አሰልፍ', text: 'ጽሁፉን ወደግራ አሰልፍ::', cls: 'ኤክስ-ኤችቲኤምኤል-አርታኢ-ጠቃሚ ምክር' }, justifycenter : { title: 'ጽሁፍ አማክል', text: 'አርታኢዉ ላይ ጽሁፉን አማክል::', cls: 'ኤክስ-ኤችቲኤምኤል-አርታኢ-ጠቃሚ ምክር' }, justifyright : { title: 'ጽሁፍ ቀኝ አሰልፍ', text: 'ጽሁፉን ወደቀኝ አሰልፍ::', cls: 'ኤክስ-ኤችቲኤምኤል-አርታኢ-ጠቃሚ ምክር' }, insertunorderedlist : { title: 'ነጥበ ምልክት ዝርዝር', text: 'ነጥበ ምልክት ዝርዝር ጀምር::', cls: 'ኤክስ-ኤችቲኤምኤል-አርታኢ-ጠቃሚ ምክር' }, insertorderedlist : { title: 'ቁጥራዊ ዝርዝር', text: 'ቁጥራዊ ዝርዝር ጀምር::', cls: 'ኤክስ-ኤችቲኤምኤል-አርታኢ-ጠቃሚ ምክር' }, createlink : { title: 'ገፅ አገናኝ', text: 'የተመረጠዉን ጽሁፍ ገፅ አገናኝ አድርግ::', cls: 'ኤክስ-ኤችቲኤምኤል-አርታኢ-ጠቃሚ ምክር' }, sourceedit : { title: 'ምንጭ አርትእ', text: 'ወደ ምንጭ አርትእ ሁነታ ቀይር::', cls: 'ኤክስ-ኤችቲኤምኤል-አርታኢ-ጠቃሚ ምክር' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "ሽቅብ ደርድር", sortDescText : "ቁልቁል ደርድር", columnsText : "አምዶች" }); } if(Ext.grid.GroupingView){ Ext.apply(Ext.grid.GroupingView.prototype, { emptyGroupText : '(ማንም)', groupByText : 'በዚ መስክ ቦድን', showGroupsText : 'በቡድን አሳይ' }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "ስም", valueText : "እሴት ", dateFormat : "m/j/Y", trueText: "እሙን", falseText: "ሐሰት" }); } if(Ext.grid.BooleanColumn){ Ext.apply(Ext.grid.BooleanColumn.prototype, { trueText : "እሙን", falseText : "ሐሰት", undefinedText: ' ' }); } if(Ext.grid.NumberColumn){ Ext.apply(Ext.grid.NumberColumn.prototype, { format : '0,000.00' }); } if(Ext.grid.DateColumn){ Ext.apply(Ext.grid.DateColumn.prototype, { format : 'm/d/Y' }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "መጠን ለመቀይር ጎትት::", collapsibleSplitTip : "መጠን ለመቀይር ጎትት:: ለመደበቅ ሁለቴ ጠቅ አድርግ::" }); } if(Ext.form.TimeField){ Ext.apply(Ext.form.TimeField.prototype, { minText : "እዚህ መስክ ዉስጥ ያለዉ ሰዓት ከ{0} እኩል ወይም በኁላ መሆን አለበት", maxText : "እዚህ መስክ ዉስጥ ያለዉ ሰዓት ከ{0} እኩል ወይም በፊት መሆን አለበት", invalidText : "{0} የተሳሳተ ሰዓት ነዉ", format : "g:i A", altFormats : "g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|gi|hi|gia|hia|g|H" }); } if(Ext.form.CheckboxGroup){ Ext.apply(Ext.form.CheckboxGroup.prototype, { blankText : "እዚህ ቡድን ዉስጥ ቢያንስ አንድ ዓይነት መምረጥ አለብህ" }); } if(Ext.form.RadioGroup){ Ext.apply(Ext.form.RadioGroup.prototype, { blankText : "እዚህ ቡድን ዉስጥ ቢያንስ አንድ ዓይነት መምረጥ አለብህ" }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-bg.js000066400000000000000000000211411226600447100214250ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * Bulgarian Translation * * By Георги Костадинов, Калгари, Канада * 10 October 2007 * By Nedko Penev * 26 October 2007 * * (utf-8 encoding) */ Ext.UpdateManager.defaults.indicatorText = '
    Зареждане...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} избрани колони"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Затвори таб"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "Невалидна стойност на полето"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Зареждане..."; } Date.monthNames = [ "Януари", "Февруари", "Март", "Април", "Май", "Юни", "Юли", "Август", "Септември", "Октомври", "Ноември", "Декември" ]; Date.monthNumbers = { Jan : 0, Feb : 1, Mar : 2, Apr : 3, May : 4, Jun : 5, Jul : 6, Aug : 7, Sep : 8, Oct : 9, Nov : 10, Dec : 11 }; Date.dayNames = [ "Неделя", "Понеделник", "Вторник", "Сряда", "Четвъртък", "Петък", "Събота" ]; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "OK", cancel : "Отмени", yes : "Да", no : "Не" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d.m.Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Днес", minText : "Тази дата е преди минималната", maxText : "Тази дата е след максималната", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Следващ месец (Control+Right)', prevText : 'Предишен месец (Control+Left)', monthYearText : 'Избери месец (Control+Up/Down за преместване по години)', todayTip : "{0} (Spacebar)", format : "d.m.y", okText : " OK ", cancelText : "Отмени", startDay : 1 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Страница", afterPageText : "от {0}", firstText : "Първа страница", prevText : "Предишна страница", nextText : "Следваща страница", lastText : "Последна страница", refreshText : "Презареди", displayMsg : "Показвайки {0} - {1} от {2}", emptyMsg : 'Няма данни за показване' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "Минималната дължина на това поле е {0}", maxLengthText : "Максималната дължина на това поле е {0}", blankText : "Това поле е задължително", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "Минималната стойност за това поле е {0}", maxText : "Максималната стойност за това поле е {0}", nanText : "{0} не е валидно число" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Недостъпен", disabledDatesText : "Недостъпен", minText : "Датата в това поле трябва да е след {0}", maxText : "Датата в това поле трябва да е преди {0}", invalidText : "{0} не е валидна дата - трябва да бъде във формат {1}", format : "d.m.y", altFormats : "d.m.y|d/m/Y|d-m-y|d-m-Y|d/m|d-m|dm|dmy|dmY|d|Y-m-d", startDay : 1 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Зареждане...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Това поле трябва да бъде емейл във формат "user@example.com"', urlText : 'Това поле трябва да бъде URL във формат "http:/'+'/www.example.com"', alphaText : 'Това поле трябва да съдържа само букви и _', alphanumText : 'Това поле трябва да съдържа само букви, цифри и _' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'Моля, въведете URL за връзката:', buttonTips : { bold : { title: 'Bold (Ctrl+B)', text: 'Удебелява избрания текст.', cls: 'x-html-editor-tip' }, italic : { title: 'Italic (Ctrl+I)', text: 'Прави избрания текст курсив.', cls: 'x-html-editor-tip' }, underline : { title: 'Underline (Ctrl+U)', text: 'Подчертава избрания текст.', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'Уголеми текста', text: 'Уголемява размера на шрифта.', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'Намали текста', text: 'Намалява размера на шрифта.', cls: 'x-html-editor-tip' }, backcolor : { title: 'Цвят на маркирания текст', text: 'Променя фоновия цвят на избрания текст.', cls: 'x-html-editor-tip' }, forecolor : { title: 'Цвят на шрифта', text: 'Променя цвета на избрания текст.', cls: 'x-html-editor-tip' }, justifyleft : { title: 'Ляво подравняване', text: 'Подравнява текста на ляво.', cls: 'x-html-editor-tip' }, justifycenter : { title: 'Центриране', text: 'Центрира текста.', cls: 'x-html-editor-tip' }, justifyright : { title: 'Дясно подравняване', text: 'Подравнява текста на дясно.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'Неномериран списък', text: 'Започва неномериран списък.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'Номериран списък', text: 'Започва номериран списък.', cls: 'x-html-editor-tip' }, createlink : { title: 'Хипервръзка', text: 'Превръща избрания текст в хипервръзка.', cls: 'x-html-editor-tip' }, sourceedit : { title: 'Редактиране на кода', text: 'Преминаване в режим на редактиране на кода.', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Подреди в нарастващ ред", sortDescText : "Подреди в намаляващ ред", lockText : "Заключи колона", unlockText : "Отключи колона", columnsText : "Колони" }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Име", valueText : "Стойност", dateFormat : "d.m.Y" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Влачете с мишката за да промените размера.", collapsibleSplitTip : "Влачете с мишката за да промените размера. Чукнете два пъти за да скриете." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-ca.js000066400000000000000000000213241226600447100214230ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * Catalonian Translation by halkon_polako 6-12-2007 * December correction halkon_polako 11-12-2007 * * Synchronized with 2.2 version of ext-lang-en.js (provided by Condor 8 aug 2008) * by halkon_polako 14-aug-2008 */ Ext.UpdateManager.defaults.indicatorText = '
    Carregant...
    '; if(Ext.DataView){ Ext.DataView.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} fila(es) seleccionada(es)"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Carregant..."; } Date.monthNames = [ "Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre" ]; Date.getShortMonthName = function(month) { return Date.monthNames[month].substring(0, 3); }; Date.monthNumbers = { Gen : 0, Feb : 1, Mar : 2, Abr : 3, Mai : 4, Jun : 5, Jul : 6, Ago : 7, Set : 8, Oct : 9, Nov : 10, Dec : 11 }; Date.getMonthNumber = function(name) { return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()]; }; Date.dayNames = [ "Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte" ]; Date.getShortDayName = function(day) { return Date.dayNames[day].substring(0, 3); }; Date.parseCodes.S.s = "(?:st|nd|rd|th)"; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "Acceptar", cancel : "Cancel·lar", yes : "Sí", no : "No" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d/m/Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Avui", minText : "Aquesta data és anterior a la data mínima", maxText : "Aquesta data és posterior a la data màxima", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Mes Següent (Control+Fletxa Dreta)', prevText : 'Mes Anterior (Control+Fletxa Esquerra)', monthYearText : 'Seleccioni un mes (Control+Fletxa a Dalt o Abaix per canviar els anys)', todayTip : "{0} (Barra d'espai)", format : "d/m/Y", okText : " Acceptar ", cancelText : "Cancel·lar", startDay : 1 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Pàgina", afterPageText : "de {0}", firstText : "Primera Pàgina", prevText : "Pàgina Anterior", nextText : "Pàgina Següent", lastText : "Darrera Pàgina", refreshText : "Refrescar", displayMsg : "Mostrant {0} - {1} de {2}", emptyMsg : 'Sense dades per mostrar' }); } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "El valor d'aquest camp és invàlid"; } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "El tamany mínim per aquest camp és {0}", maxLengthText : "El tamany màxim per aquest camp és {0}", blankText : "Aquest camp és obligatori", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { decimalSeparator : ",", decimalPrecision : 2, minText : "El valor mínim per aquest camp és {0}", maxText : "El valor màxim per aquest camp és {0}", nanText : "{0} no és un nombre vàlid" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Deshabilitat", disabledDatesText : "Deshabilitat", minText : "La data en aquest camp ha de ser posterior a {0}", maxText : "La data en aquest camp ha de ser inferior a {0}", invalidText : "{0} no és una data vàlida - ha de tenir el format {1}", format : "d/m/Y", altFormats : "d/m/Y|d-m-y|d-m-Y|d/m|d-m|dm|dmy|dmY|d|Y-m-d", startDay : 1 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Carregant...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Aquest camp ha de ser una adreça de e-mail amb el format "user@example.com"', urlText : 'Aquest camp ha de ser una URL amb el format "http:/'+'/www.example.com"', alphaText : 'Aquest camp només pot contenir lletres i _', alphanumText : 'Aquest camp només por contenir lletres, nombres i _' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'Si us plau, tecleixi la URL per l\'enllaç:', buttonTips : { bold : { title: 'Negreta (Ctrl+B)', text: 'Posa el text seleccionat en negreta.', cls: 'x-html-editor-tip' }, italic : { title: 'Itàlica (Ctrl+I)', text: 'Posa el text seleccionat en itàlica.', cls: 'x-html-editor-tip' }, underline : { title: 'Subratllat (Ctrl+U)', text: 'Subratlla el text seleccionat.', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'Augmentar Text', text: 'Augmenta el tamany de la font de text.', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'Disminuir Text', text: 'Disminueix el tamany de la font de text.', cls: 'x-html-editor-tip' }, backcolor : { title: 'Color de fons', text: 'Canvia el color de fons del text seleccionat.', cls: 'x-html-editor-tip' }, forecolor : { title: 'Color de la font de text', text: 'Canvia el color del text seleccionat.', cls: 'x-html-editor-tip' }, justifyleft : { title: 'Alinear a la esquerra', text: 'Alinea el text a la esquerra.', cls: 'x-html-editor-tip' }, justifycenter : { title: 'Centrar el text', text: 'Centra el text a l\'editor', cls: 'x-html-editor-tip' }, justifyright : { title: 'Alinear a la dreta', text: 'Alinea el text a la dreta.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'Llista amb vinyetes', text: 'Comença una llista amb vinyetes.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'Llista numerada', text: 'Comença una llista numerada.', cls: 'x-html-editor-tip' }, createlink : { title: 'Enllaç', text: 'Transforma el text seleccionat en un enllaç.', cls: 'x-html-editor-tip' }, sourceedit : { title: 'Editar Codi', text: 'Canvia al mode d\'edició de codi.', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Ordenació Ascendent", sortDescText : "Ordenació Descendent", columnsText : "Columnes" }); } if(Ext.grid.GroupingView){ Ext.apply(Ext.grid.GroupingView.prototype, { emptyGroupText : '(Buit)', groupByText : 'Agrupar Per Aquest Camp', showGroupsText : 'Mostrar en Grups' }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Nom", valueText : "Valor", dateFormat : "d/m/Y" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Cliqueu i arrossegueu per canviar el tamany del panell.", collapsibleSplitTip : "Cliqueu i arrossegueu per canviar el tamany del panell. Doble clic per ocultar-ho." }); } if(Ext.form.TimeField){ Ext.apply(Ext.form.TimeField.prototype, { minText : "L\'hora en aquest camp ha de ser igual o posterior a {0}", maxText : "L\'hora en aquest camp ha de ser igual o anterior {0}", invalidText : "{0} no és un hora vàlida", format : "g:i A", altFormats : "g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|gi|hi|gia|hia|g|H" }); } if(Ext.form.CheckboxGroup){ Ext.apply(Ext.form.CheckboxGroup.prototype, { blankText : "Ha de seleccionar almenys un étem d\'aquest group" }); } if(Ext.form.RadioGroup){ Ext.apply(Ext.form.RadioGroup.prototype, { blankText : "Ha de seleccionar un étem d\'aquest grup" }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-cs.js000066400000000000000000000206731226600447100214530ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * Czech Translations * Translated by Tomáš Korčák (72) * 2008/02/08 18:02, Ext-2.0.1 */ Ext.UpdateManager.defaults.indicatorText = '
    Prosím čekejte...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} vybraných řádků"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Zavřít záložku"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "Hodnota v tomto poli je neplatná"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Prosím čekejte..."; } Date.monthNames = [ "Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec" ]; Date.shortMonthNames = { "Leden" : "Led", "Únor" : "Úno", "Březen" : "Bře", "Duben" : "Dub", "Květen" : "Kvě", "Červen" : "Čer", "Červenec" : "Čvc", "Srpen" : "Srp", "Září" : "Zář", "Říjen" : "Říj", "Listopad" : "Lis", "Prosinec" : "Pro" }; Date.getShortMonthName = function(month) { return Date.shortMonthNames[Date.monthNames[month]]; }; Date.monthNumbers = { "Leden" : 0, "Únor" : 1, "Březen" : 2, "Duben" : 3, "Květen" : 4, "Červen" : 5, "Červenec" : 6, "Srpen" : 7, "Září" : 8, "Říjen" : 9, "Listopad" : 10, "Prosinec" : 11 }; Date.getMonthNumber = function(name) { return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1).toLowerCase()]; }; Date.dayNames = [ "Neděle", "Pondělí", "Úterý", "Středa", "Čtvrtek", "Pátek", "Sobota" ]; Date.getShortDayName = function(day) { return Date.dayNames[day].substring(0, 3); }; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "OK", cancel : "Storno", yes : "Ano", no : "Ne" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d.m.Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Dnes", minText : "Datum nesmí být starší než je minimální", maxText : "Datum nesmí být dřívější než je maximální", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Následující měsíc (Control+Right)', prevText : 'Předcházející měsíc (Control+Left)', monthYearText : 'Zvolte měsíc (ke změně let použijte Control+Up/Down)', todayTip : "{0} (Spacebar)", format : "d.m.Y", okText : " OK ", cancelText : "Storno", startDay : 1 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Strana", afterPageText : "z {0}", firstText : "První strana", prevText : "Přecházející strana", nextText : "Následující strana", lastText : "Poslední strana", refreshText : "Aktualizovat", displayMsg : "Zobrazeno {0} - {1} z celkových {2}", emptyMsg : 'Žádné záznamy nebyly nalezeny' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "Pole nesmí mít méně {0} znaků", maxLengthText : "Pole nesmí být delší než {0} znaků", blankText : "This field is required", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "Hodnota v tomto poli nesmí být menší než {0}", maxText : "Hodnota v tomto poli nesmí být větší než {0}", nanText : "{0} není platné číslo" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Neaktivní", disabledDatesText : "Neaktivní", minText : "Datum v tomto poli nesmí být starší než {0}", maxText : "Datum v tomto poli nesmí být novější než {0}", invalidText : "{0} není platným datem - zkontrolujte zda-li je ve formátu {1}", format : "d.m.Y", altFormats : "d/m/Y|d-m-y|d-m-Y|d/m|d-m|dm|dmy|dmY|d|Y-m-d", startDay : 1 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Prosím čekejte...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'V tomto poli může být vyplněna pouze emailová adresa ve formátu "uživatel@doména.cz"', urlText : 'V tomto poli může být vyplněna pouze URL (adresa internetové stránky) ve formátu "http:/'+'/www.doména.cz"', alphaText : 'Toto pole může obsahovat pouze písmena abecedy a znak _', alphanumText : 'Toto pole může obsahovat pouze písmena abecedy, čísla a znak _' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'Zadejte URL adresu odkazu:', buttonTips : { bold : { title: 'Tučné (Ctrl+B)', text: 'Označí vybraný text tučně.', cls: 'x-html-editor-tip' }, italic : { title: 'Kurzíva (Ctrl+I)', text: 'Označí vybraný text kurzívou.', cls: 'x-html-editor-tip' }, underline : { title: 'Podtržení (Ctrl+U)', text: 'Podtrhne vybraný text.', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'Zvětšit písmo', text: 'Zvětší velikost písma.', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'Zúžit písmo', text: 'Zmenší velikost písma.', cls: 'x-html-editor-tip' }, backcolor : { title: 'Barva zvýraznění textu', text: 'Označí vybraný text tak, aby vypadal jako označený zvýrazňovačem.', cls: 'x-html-editor-tip' }, forecolor : { title: 'Barva písma', text: 'Změní barvu textu.', cls: 'x-html-editor-tip' }, justifyleft : { title: 'Zarovnat text vlevo', text: 'Zarovná text doleva.', cls: 'x-html-editor-tip' }, justifycenter : { title: 'Zarovnat na střed', text: 'Zarovná text na střed.', cls: 'x-html-editor-tip' }, justifyright : { title: 'Zarovnat text vpravo', text: 'Zarovná text doprava.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'Odrážky', text: 'Začne seznam s odrážkami.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'Číslování', text: 'Začne číslovaný seznam.', cls: 'x-html-editor-tip' }, createlink : { title: 'Internetový odkaz', text: 'Z vybraného textu vytvoří internetový odkaz.', cls: 'x-html-editor-tip' }, sourceedit : { title: 'Zdrojový kód', text: 'Přepne do módu úpravy zdrojového kódu.', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Řadit vzestupně", sortDescText : "Řadit sestupně", lockText : "Ukotvit sloupec", unlockText : "Uvolnit sloupec", columnsText : "Sloupce" }); } if(Ext.grid.GroupingView){ Ext.apply(Ext.grid.GroupingView.prototype, { emptyGroupText : '(Žádná data)', groupByText : 'Seskupit dle tohoto pole', showGroupsText : 'Zobrazit ve skupině' }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Název", valueText : "Hodnota", dateFormat : "j.m.Y" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Tahem změnit velikost.", collapsibleSplitTip : "Tahem změnit velikost. Dvojklikem skrýt." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-da.js000066400000000000000000000175161226600447100214340ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /* * Danish translation * By JohnF * 04-09-2007, 05:28 AM * * Extended and modified by Karl Krukow, * December, 2007. */ Ext.UpdateManager.defaults.indicatorText = '
    Henter...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} markerede rækker"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Luk denne fane"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "Værdien i dette felt er ugyldig"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Henter..."; } Date.monthNames = [ "januar", "februar", "marts", "april", "maj", "juni", "juli", "august", "september", "oktober", "november", "december" ]; Date.getShortMonthName = function(month) { return Date.monthNames[month].substring(0, 3); }; Date.monthNumbers = { Jan : 0, Feb : 1, Mar : 2, Apr : 3, May : 4, Jun : 5, Jul : 6, Aug : 7, Sep : 8, Oct : 9, Nov : 10, Dec : 11 }; Date.getMonthNumber = function(name) { return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()]; }; Date.dayNames = [ "søndag", "mandag", "tirsdag", "onsdag", "torsdag", "fredag", "lørdag" ]; Date.getShortDayName = function(day) { return Date.dayNames[day].substring(0, 3); }; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "OK", cancel : "Fortryd", yes : "Ja", no : "Nej" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d/m/Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "I dag", minText : "Denne dato er før den tidligst tilladte", maxText : "Denne dato er senere end den senest tilladte", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Næste måned (Ctrl + højre piltast)', prevText : 'Forrige måned (Ctrl + venstre piltast)', monthYearText : 'Vælg en måned (Ctrl + op/ned pil for at ændre årstal)', todayTip : "{0} (mellemrum)", format : "d/m/y", okText : " OK ", cancelText : "Cancel", startDay : 1 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Side", afterPageText : "af {0}", firstText : "Første side", prevText : "Forrige side", nextText : "Næste side", lastText : "Sidste side", refreshText : "Opfrisk", displayMsg : "Viser {0} - {1} af {2}", emptyMsg : 'Der er ingen data at vise' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "Minimum længden for dette felt er {0}", maxLengthText : "Maksimum længden for dette felt er {0}", blankText : "Dette felt skal udfyldes", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "Mindste-værdien for dette felt er {0}", maxText : "Maksimum-værdien for dette felt er {0}", nanText : "{0} er ikke et tilladt nummer" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Inaktiveret", disabledDatesText : "Inaktiveret", minText : "Datoen i dette felt skal være efter {0}", maxText : "Datoen i dette felt skal være før {0}", invalidText : "{0} er ikke en tilladt dato - datoer skal angives i formatet {1}", format : "d/m/y", altFormats : "d/m/Y|d-m-y|d-m-Y|d/m|d-m|dm|dmy|dmY|d|Y-m-d", startDay : 1 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Henter...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Dette felt skal være en email adresse i formatet "xxx@yyy.zzz"', urlText : 'Dette felt skal være en URL i formatet "http:/'+'/xxx.yyy"', alphaText : 'Dette felt kan kun indeholde bogstaver og "_" (understregning)', alphanumText : 'Dette felt kan kun indeholde bogstaver, tal og "_" (understregning)' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'Indtast URL:', buttonTips : { bold : { title: 'Fed (Ctrl+B)', //Can I change this to Ctrl+F? text: 'Formater det markerede tekst med fed.', cls: 'x-html-editor-tip' }, italic : { title: 'Kursiv (Ctrl+I)',//Ctrl+K text: 'Formater det markerede tekst med kursiv.', cls: 'x-html-editor-tip' }, underline : { title: 'Understreg (Ctrl+U)', text: 'Understreg det markerede tekst.', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'Forstør tekst', text: 'Forøg fontstørrelsen.', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'Formindsk tekst', text: 'Formindsk fontstørrelsen.', cls: 'x-html-editor-tip' }, backcolor : { title: 'Farve for tekstfremhævelse', text: 'Skift baggrundsfarve for det markerede tekst.', cls: 'x-html-editor-tip' }, forecolor : { title: 'Skriftfarve', text: 'Skift skriftfarve for det markerede tekst.', cls: 'x-html-editor-tip' }, justifyleft : { title: 'Juster venstre', text: 'Venstrestil tekst.', cls: 'x-html-editor-tip' }, justifycenter : { title: 'Centreret', text: 'Centrer tekst.', cls: 'x-html-editor-tip' }, justifyright : { title: 'Juster højre', text: 'Højrestil tekst.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'Punktopstilling', text: 'Påbegynd punktopstilling.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'Nummereret opstilling', text: 'Påbegynd nummereret opstilling.', cls: 'x-html-editor-tip' }, createlink : { title: 'Hyperlink', text: 'Lav det markerede test til et hyperlink.', cls: 'x-html-editor-tip' }, sourceedit : { title: 'Kildetekstredigering', text: 'Skift til redigering af kildetekst.', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Sortér stigende", sortDescText : "Sortér faldende", lockText : "Lås kolonne", unlockText : "Fjern lås fra kolonne", columnsText : "Kolonner" }); } if(Ext.grid.GroupingView){ Ext.apply(Ext.grid.GroupingView.prototype, { emptyGroupText : '(Ingen)', groupByText : 'Gruppér efter dette felt', showGroupsText : 'Vis i grupper' //should this be sort in groups? }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Navn", valueText : "Værdi", dateFormat : "j/m/Y" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Træk for at ændre størrelsen.", collapsibleSplitTip : "Træk for at ændre størrelsen. Dobbelt-klik for at skjule." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-de.js000066400000000000000000000225661226600447100214410ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /* * German translation * 2007-Apr-07 update by schmidetzki and humpdi * 2007-Oct-31 update by wm003 * 2009-Jul-10 update by Patrick Matsumura and Rupert Quaderer * 2010-Mar-10 update by Volker Grabsch */ Ext.UpdateManager.defaults.indicatorText = '
    Übertrage Daten ...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} Zeile(n) ausgewählt"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Diesen Tab schließen"; } if(Ext.form.BasicForm){ Ext.form.BasicForm.prototype.waitTitle = "Bitte warten..."; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "Der Wert des Feldes ist nicht korrekt"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Übertrage Daten..."; } Date.monthNames = [ "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember" ]; Date.getShortMonthName = function(month) { return Date.monthNames[month].substring(0, 3); }; Date.monthNumbers = { Jan : 0, Feb : 1, "M\u00e4r" : 2, Apr : 3, Mai : 4, Jun : 5, Jul : 6, Aug : 7, Sep : 8, Okt : 9, Nov : 10, Dez : 11 }; Date.getMonthNumber = function(name) { return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()]; }; Date.dayNames = [ "Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag" ]; Date.getShortDayName = function(day) { return Date.dayNames[day].substring(0, 3); }; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "OK", cancel : "Abbrechen", yes : "Ja", no : "Nein" }; } if(Ext.util.Format){ Ext.util.Format.__number = Ext.util.Format.number; Ext.util.Format.number = function(v, format) { return Ext.util.Format.__number(v, format || "0.000,00/i"); }; Ext.util.Format.date = function(v, format) { if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d.m.Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Heute", minText : "Dieses Datum liegt von dem erstmöglichen Datum", maxText : "Dieses Datum liegt nach dem letztmöglichen Datum", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : "Nächster Monat (Strg/Control + Rechts)", prevText : "Vorheriger Monat (Strg/Control + Links)", monthYearText : "Monat auswählen (Strg/Control + Hoch/Runter, um ein Jahr auszuwählen)", todayTip : "Heute ({0}) (Leertaste)", format : "d.m.Y", okText : " OK ", cancelText : "Abbrechen", startDay : 1 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Seite", afterPageText : "von {0}", firstText : "Erste Seite", prevText : "vorherige Seite", nextText : "nächste Seite", lastText : "letzte Seite", refreshText : "Aktualisieren", displayMsg : "Anzeige Eintrag {0} - {1} von {2}", emptyMsg : "Keine Daten vorhanden" }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "Bitte geben Sie mindestens {0} Zeichen ein", maxLengthText : "Bitte geben Sie maximal {0} Zeichen ein", blankText : "Dieses Feld darf nicht leer sein", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "Der Mindestwert für dieses Feld ist {0}", maxText : "Der Maximalwert für dieses Feld ist {0}", nanText : "{0} ist keine Zahl", decimalSeparator : "," }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "nicht erlaubt", disabledDatesText : "nicht erlaubt", minText : "Das Datum in diesem Feld muss nach dem {0} liegen", maxText : "Das Datum in diesem Feld muss vor dem {0} liegen", invalidText : "{0} ist kein gültiges Datum - es muss im Format {1} eingegeben werden", format : "d.m.Y", altFormats : "j.n.Y|j.n.y|j.n.|j.|j/n/Y|j/n/y|j-n-y|j-n-Y|j/n|j-n|dm|dmy|dmY|j|Y-n-j", startDay : 1 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Lade Daten ...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Dieses Feld sollte eine E-Mail-Adresse enthalten. Format: "user@example.com"', urlText : 'Dieses Feld sollte eine URL enthalten. Format: "http:/'+'/www.example.com"', alphaText : 'Dieses Feld darf nur Buchstaben enthalten und _', alphanumText : 'Dieses Feld darf nur Buchstaben und Zahlen enthalten und _' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'Bitte geben Sie die URL für den Link ein:', buttonTips : { bold : { title: 'Fett (Ctrl+B)', text: 'Erstellt den ausgewählten Text in Fettschrift.', cls: 'x-html-editor-tip' }, italic : { title: 'Kursiv (Ctrl+I)', text: 'Erstellt den ausgewählten Text in Schrägschrift.', cls: 'x-html-editor-tip' }, underline : { title: 'Unterstrichen (Ctrl+U)', text: 'Unterstreicht den ausgewählten Text.', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'Text vergößern', text: 'Erhöht die Schriftgröße.', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'Text verkleinern', text: 'Verringert die Schriftgröße.', cls: 'x-html-editor-tip' }, backcolor : { title: 'Text farblich hervorheben', text: 'Hintergrundfarbe des ausgewählten Textes ändern.', cls: 'x-html-editor-tip' }, forecolor : { title: 'Schriftfarbe', text: 'Farbe des ausgewählten Textes ändern.', cls: 'x-html-editor-tip' }, justifyleft : { title: 'Linksbündig', text: 'Setzt den Text linksbündig.', cls: 'x-html-editor-tip' }, justifycenter : { title: 'Zentrieren', text: 'Zentriert den Text in Editor.', cls: 'x-html-editor-tip' }, justifyright : { title: 'Rechtsbündig', text: 'Setzt den Text rechtsbündig.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'Aufzählungsliste', text: 'Beginnt eine Aufzählungsliste mit Spiegelstrichen.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'Numerierte Liste', text: 'Beginnt eine numerierte Liste.', cls: 'x-html-editor-tip' }, createlink : { title: 'Hyperlink', text: 'Erstellt einen Hyperlink aus dem ausgewählten text.', cls: 'x-html-editor-tip' }, sourceedit : { title: 'Source bearbeiten', text: 'Zur Bearbeitung des Quelltextes wechseln.', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Aufsteigend sortieren", sortDescText : "Absteigend sortieren", lockText : "Spalte sperren", unlockText : "Spalte freigeben (entsperren)", columnsText : "Spalten" }); } if(Ext.grid.GroupingView){ Ext.apply(Ext.grid.GroupingView.prototype, { emptyGroupText : '(Keine)', groupByText : 'Dieses Feld gruppieren', showGroupsText : 'In Gruppen anzeigen' }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Name", valueText : "Wert", dateFormat : "d.m.Y" }); } if(Ext.grid.BooleanColumn){ Ext.apply(Ext.grid.BooleanColumn.prototype, { trueText : "wahr", falseText : "falsch" }); } if(Ext.grid.NumberColumn){ Ext.apply(Ext.grid.NumberColumn.prototype, { format : '0.000,00/i' }); } if(Ext.grid.DateColumn){ Ext.apply(Ext.grid.DateColumn.prototype, { format : 'd.m.Y' }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Ziehen, um Größe zu ändern.", collapsibleSplitTip : "Ziehen, um Größe zu ändern. Doppelklick um Panel auszublenden." }); } if(Ext.form.TimeField){ Ext.apply(Ext.form.TimeField.prototype, { minText : "Die Zeit muss gleich oder nach {0} liegen", maxText : "Die Zeit muss gleich oder vor {0} liegen", invalidText : "{0} ist keine gültige Zeit", format : "H:i" }); } if(Ext.form.CheckboxGroup){ Ext.apply(Ext.form.CheckboxGroup.prototype, { blankText : "Du mußt mehr als einen Eintrag aus der Gruppe auswählen" }); } if(Ext.form.RadioGroup){ Ext.apply(Ext.form.RadioGroup.prototype, { blankText : "Du mußt einen Eintrag aus der Gruppe auswählen" }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-el_GR.js000066400000000000000000000251031226600447100220270ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * Greek translation * By thesilentman (utf8 encoding) * 27 Apr 2008 * * Changes since previous (second) Version: * + added Date.shortMonthNames * + added Date.getShortMonthName * + added Date.monthNumbers * + added Ext.grid.GroupingView */ Ext.UpdateManager.defaults.indicatorText = '
    Μεταφόρτωση δεδομένων...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} Επιλεγμένες σειρές"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Κλείστε το tab"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "Το περιεχόμενο του πεδίου δεν είναι αποδεκτό"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Μεταφόρτωση δεδομένων..."; } Date.monthNames = [ "Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάιος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος" ]; Date.shortMonthNames = [ "Ιαν", "Φεβ", "Μάρ", "Απρ", "Μάι", "Ιού", "Ιού", "Αύγ", "Σεπ", "Οκτ", "Νοέ", "Δεκ" ]; Date.getShortMonthName = function(month) { return Date.monthNames[month].substring(0, 3); }; Date.monthNumbers = { Jan : 0, Feb : 1, Mar : 2, Apr : 3, May : 4, Jun : 5, Jul : 6, Aug : 7, Sep : 8, Oct : 9, Nov : 10, Dec : 11 }; Date.getMonthNumber = function(name) { return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()]; }; Date.dayNames = [ "Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο" ]; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "OK", cancel : "Άκυρο", yes : "Ναι", no : "Όχι" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d/m/Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Σήμερα", minText : "Η Ημερομηνία είναι προγενέστερη από την παλαιότερη αποδεκτή", maxText : "Η Ημερομηνία είναι μεταγενέστερη από την νεότερη αποδεκτή", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Επόμενος Μήνας (Control+Δεξί Βέλος)', prevText : 'Προηγούμενος Μήνας (Control + Αριστερό Βέλος)', monthYearText : 'Επιλογή Μηνός (Control + Επάνω/Κάτω Βέλος για μεταβολή ετών)', todayTip : "{0} (ΠΛήκτρο Διαστήματος)", format : "d/m/y" }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Σελίδα", afterPageText : "από {0}", firstText : "Πρώτη Σελίδα", prevText : "Προηγούμενη Σελίδα", nextText : "Επόμενη Σελίδα", lastText : "Τελευταία Σελίδα", refreshText : "Ανανέωση", displayMsg : "Εμφάνιση {0} - {1} από {2}", emptyMsg : 'Δεν υπάρχουν δεδομένα' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "Το μικρότερο αποδεκτό μήκος για το πεδίο είναι {0}", maxLengthText : "Το μεγαλύτερο αποδεκτό μήκος για το πεδίο είναι {0}", blankText : "Το πεδίο είναι υποχρεωτικό", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "Η μικρότερη τιμή του πεδίου είναι {0}", maxText : "Η μεγαλύτερη τιμή του πεδίου είναι {0}", nanText : "{0} δεν είναι αποδεκτός αριθμός" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Ανενεργό", disabledDatesText : "Ανενεργό", minText : "Η ημερομηνία αυτού του πεδίου πρέπει να είναι μετά την {0}", maxText : "Η ημερομηνία αυτού του πεδίου πρέπει να είναι πριν την {0}", invalidText : "{0} δεν είναι έγκυρη ημερομηνία - πρέπει να είναι στη μορφή {1}", format : "d/m/y" }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Μεταφόρτωση δεδομένων...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Το πεδίο δέχεται μόνο διευθύνσεις Email σε μορφή "user@example.com"', urlText : 'Το πεδίο δέχεται μόνο URL σε μορφή "http:/'+'/www.example.com"', alphaText : 'Το πεδίο δέχεται μόνο χαρακτήρες και _', alphanumText : 'Το πεδίο δέχεται μόνο χαρακτήρες, αριθμούς και _' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'Δώστε τη διεύθυνση (URL) για το σύνδεσμο (link):', buttonTips : { bold : { title: 'Έντονα (Ctrl+B)', text: 'Κάνετε το προεπιλεγμένο κείμενο έντονο.', cls: 'x-html-editor-tip' }, italic : { title: 'Πλάγια (Ctrl+I)', text: 'Κάνετε το προεπιλεγμένο κείμενο πλάγιο.', cls: 'x-html-editor-tip' }, underline : { title: 'Υπογράμμιση (Ctrl+U)', text: 'Υπογραμμίζετε το προεπιλεγμένο κείμενο.', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'Μεγέθυνση κειμένου', text: 'Μεγαλώνετε τη γραμματοσειρά.', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'Σμίκρυνση κειμένου', text: 'Μικραίνετε τη γραμματοσειρά.', cls: 'x-html-editor-tip' }, backcolor : { title: 'Χρώμα Φόντου Κειμένου', text: 'Αλλάζετε το χρώμα στο φόντο του προεπιλεγμένου κειμένου.', cls: 'x-html-editor-tip' }, forecolor : { title: 'Χρώμα Γραμματοσειράς', text: 'Αλλάζετε το χρώμα στη γραμματοσειρά του προεπιλεγμένου κειμένου.', cls: 'x-html-editor-tip' }, justifyleft : { title: 'Αριστερή Στοίχιση Κειμένου', text: 'Στοιχίζετε το κείμενο στα αριστερά.', cls: 'x-html-editor-tip' }, justifycenter : { title: 'Κεντράρισμα Κειμένου', text: 'Στοιχίζετε το κείμενο στο κέντρο.', cls: 'x-html-editor-tip' }, justifyright : { title: 'Δεξιά Στοίχιση Κειμένου', text: 'Στοιχίζετε το κείμενο στα δεξιά.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'Εισαγωγή Λίστας Κουκίδων', text: 'Ξεκινήστε μια λίστα με κουκίδες.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'Εισαγωγή Λίστας Αρίθμησης', text: 'Ξεκινήστε μια λίστα με αρίθμηση.', cls: 'x-html-editor-tip' }, createlink : { title: 'Hyperlink', text: 'Μετατρέπετε το προεπιλεγμένο κείμενο σε Link.', cls: 'x-html-editor-tip' }, sourceedit : { title: 'Επεξεργασία Κώδικα', text: 'Μεταβαίνετε στη λειτουργία επεξεργασίας κώδικα.', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Αύξουσα ταξινόμηση", sortDescText : "Φθίνουσα ταξινόμηση", lockText : "Κλείδωμα στήλης", unlockText : "Ξεκλείδωμα στήλης", columnsText : "Στήλες" }); } if(Ext.grid.GroupingView){ Ext.apply(Ext.grid.GroupingView.prototype, { emptyGroupText : '(Καμμία)', groupByText : 'Ομαδοποίηση βάσει αυτού του πεδίου', showGroupsText : 'Να εμφανίζεται στις ομάδες' }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Όνομα", valueText : "Περιεχόμενο", dateFormat : "d/m/Y" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Σύρετε για αλλαγή μεγέθους.", collapsibleSplitTip : "Σύρετε για αλλαγή μεγέθους. Διπλό κλικ για απόκρυψη." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-en.js000066400000000000000000000211551226600447100214440ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * List compiled by mystix on the extjs.com forums. * Thank you Mystix! * * English Translations * updated to 2.2 by Condor (8 Aug 2008) */ Ext.UpdateManager.defaults.indicatorText = '
    Loading...
    '; if(Ext.data.Types){ Ext.data.Types.stripRe = /[\$,%]/g; } if(Ext.DataView){ Ext.DataView.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} selected row{1}"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Loading..."; } Date.monthNames = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; Date.getShortMonthName = function(month) { return Date.monthNames[month].substring(0, 3); }; Date.monthNumbers = { Jan : 0, Feb : 1, Mar : 2, Apr : 3, May : 4, Jun : 5, Jul : 6, Aug : 7, Sep : 8, Oct : 9, Nov : 10, Dec : 11 }; Date.getMonthNumber = function(name) { return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()]; }; Date.dayNames = [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ]; Date.getShortDayName = function(day) { return Date.dayNames[day].substring(0, 3); }; Date.parseCodes.S.s = "(?:st|nd|rd|th)"; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "OK", cancel : "Cancel", yes : "Yes", no : "No" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "m/d/Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Today", minText : "This date is before the minimum date", maxText : "This date is after the maximum date", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Next Month (Control+Right)', prevText : 'Previous Month (Control+Left)', monthYearText : 'Choose a month (Control+Up/Down to move years)', todayTip : "{0} (Spacebar)", format : "m/d/y", okText : " OK ", cancelText : "Cancel", startDay : 0 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Page", afterPageText : "of {0}", firstText : "First Page", prevText : "Previous Page", nextText : "Next Page", lastText : "Last Page", refreshText : "Refresh", displayMsg : "Displaying {0} - {1} of {2}", emptyMsg : 'No data to display' }); } if(Ext.form.BasicForm){ Ext.form.BasicForm.prototype.waitTitle = "Please Wait..." } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "The value in this field is invalid"; } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "The minimum length for this field is {0}", maxLengthText : "The maximum length for this field is {0}", blankText : "This field is required", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { decimalSeparator : ".", decimalPrecision : 2, minText : "The minimum value for this field is {0}", maxText : "The maximum value for this field is {0}", nanText : "{0} is not a valid number" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Disabled", disabledDatesText : "Disabled", minText : "The date in this field must be after {0}", maxText : "The date in this field must be before {0}", invalidText : "{0} is not a valid date - it must be in the format {1}", format : "m/d/y", altFormats : "m/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d", startDay : 0 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Loading...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'This field should be an e-mail address in the format "user@example.com"', urlText : 'This field should be a URL in the format "http:/'+'/www.example.com"', alphaText : 'This field should only contain letters and _', alphanumText : 'This field should only contain letters, numbers and _' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'Please enter the URL for the link:', buttonTips : { bold : { title: 'Bold (Ctrl+B)', text: 'Make the selected text bold.', cls: 'x-html-editor-tip' }, italic : { title: 'Italic (Ctrl+I)', text: 'Make the selected text italic.', cls: 'x-html-editor-tip' }, underline : { title: 'Underline (Ctrl+U)', text: 'Underline the selected text.', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'Grow Text', text: 'Increase the font size.', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'Shrink Text', text: 'Decrease the font size.', cls: 'x-html-editor-tip' }, backcolor : { title: 'Text Highlight Color', text: 'Change the background color of the selected text.', cls: 'x-html-editor-tip' }, forecolor : { title: 'Font Color', text: 'Change the color of the selected text.', cls: 'x-html-editor-tip' }, justifyleft : { title: 'Align Text Left', text: 'Align text to the left.', cls: 'x-html-editor-tip' }, justifycenter : { title: 'Center Text', text: 'Center text in the editor.', cls: 'x-html-editor-tip' }, justifyright : { title: 'Align Text Right', text: 'Align text to the right.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'Bullet List', text: 'Start a bulleted list.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'Numbered List', text: 'Start a numbered list.', cls: 'x-html-editor-tip' }, createlink : { title: 'Hyperlink', text: 'Make the selected text a hyperlink.', cls: 'x-html-editor-tip' }, sourceedit : { title: 'Source Edit', text: 'Switch to source editing mode.', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Sort Ascending", sortDescText : "Sort Descending", columnsText : "Columns" }); } if(Ext.grid.GroupingView){ Ext.apply(Ext.grid.GroupingView.prototype, { emptyGroupText : '(None)', groupByText : 'Group By This Field', showGroupsText : 'Show in Groups' }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Name", valueText : "Value", dateFormat : "m/j/Y", trueText: "true", falseText: "false" }); } if(Ext.grid.BooleanColumn){ Ext.apply(Ext.grid.BooleanColumn.prototype, { trueText : "true", falseText : "false", undefinedText: ' ' }); } if(Ext.grid.NumberColumn){ Ext.apply(Ext.grid.NumberColumn.prototype, { format : '0,000.00' }); } if(Ext.grid.DateColumn){ Ext.apply(Ext.grid.DateColumn.prototype, { format : 'm/d/Y' }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Drag to resize.", collapsibleSplitTip : "Drag to resize. Double click to hide." }); } if(Ext.form.TimeField){ Ext.apply(Ext.form.TimeField.prototype, { minText : "The time in this field must be equal to or after {0}", maxText : "The time in this field must be equal to or before {0}", invalidText : "{0} is not a valid time", format : "g:i A", altFormats : "g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|gi|hi|gia|hia|g|H" }); } if(Ext.form.CheckboxGroup){ Ext.apply(Ext.form.CheckboxGroup.prototype, { blankText : "You must select at least one item in this group" }); } if(Ext.form.RadioGroup){ Ext.apply(Ext.form.RadioGroup.prototype, { blankText : "You must select one item in this group" }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-en_GB.js000066400000000000000000000202601226600447100220100ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * List compiled by mystix on the extjs.com forums. * Thank you Mystix! * * English (UK) Translations * updated to 2.2 by Condor (8 Aug 2008) */ Ext.UpdateManager.defaults.indicatorText = '
    Loading...
    '; if(Ext.DataView){ Ext.DataView.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} selected row{1}"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Loading..."; } Date.monthNames = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; Date.getShortMonthName = function(month) { return Date.monthNames[month].substring(0, 3); }; Date.monthNumbers = { Jan : 0, Feb : 1, Mar : 2, Apr : 3, May : 4, Jun : 5, Jul : 6, Aug : 7, Sep : 8, Oct : 9, Nov : 10, Dec : 11 }; Date.getMonthNumber = function(name) { return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()]; }; Date.dayNames = [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ]; Date.getShortDayName = function(day) { return Date.dayNames[day].substring(0, 3); }; Date.parseCodes.S.s = "(?:st|nd|rd|th)"; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "OK", cancel : "Cancel", yes : "Yes", no : "No" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d/m/Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Today", minText : "This date is before the minimum date", maxText : "This date is after the maximum date", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Next Month (Control+Right)', prevText : 'Previous Month (Control+Left)', monthYearText : 'Choose a month (Control+Up/Down to move years)', todayTip : "{0} (Spacebar)", format : "d/m/Y", okText : " OK ", cancelText : "Cancel", startDay : 0 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Page", afterPageText : "of {0}", firstText : "First Page", prevText : "Previous Page", nextText : "Next Page", lastText : "Last Page", refreshText : "Refresh", displayMsg : "Displaying {0} - {1} of {2}", emptyMsg : 'No data to display' }); } if(Ext.form.BasicForm){ Ext.form.BasicForm.prototype.waitTitle = "Please Wait..." } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "The value in this field is invalid"; } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "The minimum length for this field is {0}", maxLengthText : "The maximum length for this field is {0}", blankText : "This field is required", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { decimalSeparator : ".", decimalPrecision : 2, minText : "The minimum value for this field is {0}", maxText : "The maximum value for this field is {0}", nanText : "{0} is not a valid number" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Disabled", disabledDatesText : "Disabled", minText : "The date in this field must be after {0}", maxText : "The date in this field must be before {0}", invalidText : "{0} is not a valid date - it must be in the format {1}", format : "d/m/y", altFormats : "d/m/Y|d/m/y|d-m-y|d-m-Y|d/m|d-m|dm|dmy|dmY|d|Y-m-d", startDay : 0 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Loading...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'This field should be an e-mail address in the format "user@example.com"', urlText : 'This field should be a URL in the format "http:/'+'/www.example.com"', alphaText : 'This field should only contain letters and _', alphanumText : 'This field should only contain letters, numbers and _' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'Please enter the URL for the link:', buttonTips : { bold : { title: 'Bold (Ctrl+B)', text: 'Make the selected text bold.', cls: 'x-html-editor-tip' }, italic : { title: 'Italic (Ctrl+I)', text: 'Make the selected text italic.', cls: 'x-html-editor-tip' }, underline : { title: 'Underline (Ctrl+U)', text: 'Underline the selected text.', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'Grow Text', text: 'Increase the font size.', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'Shrink Text', text: 'Decrease the font size.', cls: 'x-html-editor-tip' }, backcolor : { title: 'Text Highlight Color', text: 'Change the background color of the selected text.', cls: 'x-html-editor-tip' }, forecolor : { title: 'Font Color', text: 'Change the color of the selected text.', cls: 'x-html-editor-tip' }, justifyleft : { title: 'Align Text Left', text: 'Align text to the left.', cls: 'x-html-editor-tip' }, justifycenter : { title: 'Center Text', text: 'Center text in the editor.', cls: 'x-html-editor-tip' }, justifyright : { title: 'Align Text Right', text: 'Align text to the right.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'Bullet List', text: 'Start a bulleted list.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'Numbered List', text: 'Start a numbered list.', cls: 'x-html-editor-tip' }, createlink : { title: 'Hyperlink', text: 'Make the selected text a hyperlink.', cls: 'x-html-editor-tip' }, sourceedit : { title: 'Source Edit', text: 'Switch to source editing mode.', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Sort Ascending", sortDescText : "Sort Descending", columnsText : "Columns" }); } if(Ext.grid.GroupingView){ Ext.apply(Ext.grid.GroupingView.prototype, { emptyGroupText : '(None)', groupByText : 'Group By This Field', showGroupsText : 'Show in Groups' }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Name", valueText : "Value", dateFormat : "j/m/Y", trueText: "true", falseText: "false" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Drag to resize.", collapsibleSplitTip : "Drag to resize. Double click to hide." }); } if(Ext.form.TimeField){ Ext.apply(Ext.form.TimeField.prototype, { minText : "The time in this field must be equal to or after {0}", maxText : "The time in this field must be equal to or before {0}", invalidText : "{0} is not a valid time", format : "g:i A", altFormats : "g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|gi|hi|gia|hia|g|H" }); } if(Ext.form.CheckboxGroup){ Ext.apply(Ext.form.CheckboxGroup.prototype, { blankText : "You must select at least one item in this group" }); } if(Ext.form.RadioGroup){ Ext.apply(Ext.form.RadioGroup.prototype, { blankText : "You must select one item in this group" }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-es.js000066400000000000000000000213551226600447100214530ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /* * Spanish/Latin American Translation by genius551v 04-08-2007 * Revised by efege, 2007-04-15. * Revised by Rafaga2k 10-01-2007 (mm/dd/yyyy) * Revised by FeDe 12-13-2007 (mm/dd/yyyy) * Synchronized with 2.2 version of ext-lang-en.js (provided by Condor 8 aug 2008) * by halkon_polako 14-aug-2008 */ Ext.UpdateManager.defaults.indicatorText = '
    Cargando...
    '; if(Ext.DataView){ Ext.DataView.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} fila(s) seleccionada(s)"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Cargando..."; } Date.monthNames = [ "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre" ]; Date.getShortMonthName = function(month) { return Date.monthNames[month].substring(0, 3); }; Date.monthNumbers = { Ene : 0, Feb : 1, Mar : 2, Abr : 3, May : 4, Jun : 5, Jul : 6, Ago : 7, Sep : 8, Oct : 9, Nov : 10, Dic : 11 }; Date.getMonthNumber = function(name) { return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()]; }; Date.dayNames = [ "Domingo", "Lunes", "Martes", "Mi\u00E9rcoles", "Jueves", "Viernes", "S\u00E1bado" ]; Date.getShortDayName = function(day) { if (day==3) return "Mié"; if (day==6) return "Sáb"; return Date.dayNames[day].substring(0, 3); }; Date.parseCodes.S.s = "(?:st|nd|rd|th)"; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "Aceptar", cancel : "Cancelar", yes : "S\u00ED", no : "No" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d/m/Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Hoy", minText : "Esta fecha es anterior a la fecha m\u00EDnima", maxText : "Esta fecha es posterior a la fecha m\u00E1xima", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Mes Siguiente (Control+Right)', prevText : 'Mes Anterior (Control+Left)', monthYearText : 'Seleccione un mes (Control+Up/Down para desplazar el a\u00F1o)', todayTip : "{0} (Barra espaciadora)", format : "d/m/Y", okText : " Ok ", cancelText : "Cancelar", startDay : 1 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "P\u00E1gina", afterPageText : "de {0}", firstText : "Primera p\u00E1gina", prevText : "P\u00E1gina anterior", nextText : "P\u00E1gina siguiente", lastText : "Última p\u00E1gina", refreshText : "Actualizar", displayMsg : "Mostrando {0} - {1} de {2}", emptyMsg : 'Sin datos para mostrar' }); } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "El valor en este campo es inv\u00E1lido"; } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "El tama\u00F1o m\u00EDnimo para este campo es de {0}", maxLengthText : "El tama\u00F1o m\u00E1ximo para este campo es de {0}", blankText : "Este campo es obligatorio", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { decimalSeparator : ".", decimalPrecision : 2, minText : "El valor m\u00EDnimo para este campo es de {0}", maxText : "El valor m\u00E1ximo para este campo es de {0}", nanText : "{0} no es un n\u00FAmero v\u00E1lido" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Deshabilitado", disabledDatesText : "Deshabilitado", minText : "La fecha para este campo debe ser posterior a {0}", maxText : "La fecha para este campo debe ser anterior a {0}", invalidText : "{0} no es una fecha v\u00E1lida - debe tener el formato {1}", format : "d/m/Y", altFormats : "d/m/Y|d-m-y|d-m-Y|d/m|d-m|dm|dmy|dmY|d|Y-m-d", startDay : 1 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Cargando...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Este campo debe ser una direcci\u00F3n de correo electr\u00F3nico con el formato "usuario@dominio.com"', urlText : 'Este campo debe ser una URL con el formato "http:/'+'/www.dominio.com"', alphaText : 'Este campo s\u00F3lo debe contener letras y _', alphanumText : 'Este campo s\u00F3lo debe contener letras, n\u00FAmeros y _' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : "Por favor proporcione la URL para el enlace:", buttonTips : { bold : { title: 'Negritas (Ctrl+B)', text: 'Transforma el texto seleccionado en Negritas.', cls: 'x-html-editor-tip' }, italic : { title: 'It\u00E1lica (Ctrl+I)', text: 'Transforma el texto seleccionado en It\u00E1licas.', cls: 'x-html-editor-tip' }, underline : { title: 'Subrayado (Ctrl+U)', text: 'Subraya el texto seleccionado.', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'Aumentar la fuente', text: 'Aumenta el tama\u00F1o de la fuente', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'Reducir la fuente', text: 'Reduce el tama\u00F1o de la fuente.', cls: 'x-html-editor-tip' }, backcolor : { title: 'Color de fondo', text: 'Modifica el color de fondo del texto seleccionado.', cls: 'x-html-editor-tip' }, forecolor : { title: 'Color de la fuente', text: 'Modifica el color del texto seleccionado.', cls: 'x-html-editor-tip' }, justifyleft : { title: 'Alinear a la izquierda', text: 'Alinea el texto a la izquierda.', cls: 'x-html-editor-tip' }, justifycenter : { title: 'Centrar', text: 'Centrar el texto.', cls: 'x-html-editor-tip' }, justifyright : { title: 'Alinear a la derecha', text: 'Alinea el texto a la derecha.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'Lista de vi\u00F1etas', text: 'Inicia una lista con vi\u00F1etas.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'Lista numerada', text: 'Inicia una lista numerada.', cls: 'x-html-editor-tip' }, createlink : { title: 'Enlace', text: 'Inserta un enlace de hipertexto.', cls: 'x-html-editor-tip' }, sourceedit : { title: 'C\u00F3digo Fuente', text: 'Pasar al modo de edici\u00F3n de c\u00F3digo fuente.', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Ordenar en forma ascendente", sortDescText : "Ordenar en forma descendente", columnsText : "Columnas" }); } if(Ext.grid.GroupingView){ Ext.apply(Ext.grid.GroupingView.prototype, { emptyGroupText : '(Ninguno)', groupByText : 'Agrupar por este campo', showGroupsText : 'Mostrar en grupos' }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Nombre", valueText : "Valor", dateFormat : "j/m/Y" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Arrastre para redimensionar.", collapsibleSplitTip : "Arrastre para redimensionar. Doble clic para ocultar." }); } if(Ext.form.TimeField){ Ext.apply(Ext.form.TimeField.prototype, { minText : "La hora en este campo debe ser igual o posterior a {0}", maxText : "La hora en este campo debe ser igual o anterior a {0}", invalidText : "{0} no es una hora v\u00E1lida", format : "g:i A", altFormats : "g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|gi|hi|gia|hia|g|H" }); } if(Ext.form.CheckboxGroup){ Ext.apply(Ext.form.CheckboxGroup.prototype, { blankText : "Debe seleccionar al menos un \u00E9tem de este grupo" }); } if(Ext.form.RadioGroup){ Ext.apply(Ext.form.RadioGroup.prototype, { blankText : "Debe seleccionar un \u00E9tem de este grupo" }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-fa.js000066400000000000000000000203111226600447100214210ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /* * Farsi (Persian) translation * By Mohaqa * 03-10-2007, 06:23 PM */ Ext.UpdateManager.defaults.indicatorText = '
    در حال بارگذاری ...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} رکورد انتخاب شده"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "بستن"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "مقدار فیلد صحیح نیست"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "در حال بارگذاری ..."; } Date.monthNames = [ "ژانویه", "فوریه", "مارس", "آپریل", "می", "ژوئن", "جولای", "آگوست", "سپتامبر", "اکتبر", "نوامبر", "دسامبر" ]; Date.monthNumbers = { Jan : 0, Feb : 1, Mar : 2, Apr : 3, May : 4, Jun : 5, Jul : 6, Aug : 7, Sep : 8, Oct : 9, Nov : 10, Dec : 11 }; Date.dayNames = [ "یکشنبه", "دوشنبه", "سه شنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه" ]; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "تایید", cancel : "بازگشت", yes : "بله", no : "خیر" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "Y/m/d"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "امروز", minText : "این تاریخ قبل از محدوده مجاز است", maxText : "این تاریخ پس از محدوده مجاز است", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'ماه بعد (Control + Right)', prevText : 'ماه قبل (Control+Left)', monthYearText : 'یک ماه را انتخاب کنید (Control+Up/Down برای انتقال در سال)', todayTip : "{0} (Spacebar)", format : "y/m/d", okText : " OK ", cancelText : "Cancel", startDay : 0 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "صفحه", afterPageText : "از {0}", firstText : "صفحه اول", prevText : "صفحه قبل", nextText : "صفحه بعد", lastText : "صفحه آخر", refreshText : "بازخوانی", displayMsg : "نمایش {0} - {1} of {2}", emptyMsg : 'داده ای برای نمایش وجود ندارد' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "حداقل طول این فیلد برابر است با {0}", maxLengthText : "حداکثر طول این فیلد برابر است با {0}", blankText : "این فیلد باید مقداری داشته باشد", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "حداقل مقدار این فیلد برابر است با {0}", maxText : "حداکثر مقدار این فیلد برابر است با {0}", nanText : "{0} یک عدد نیست" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "غیرفعال", disabledDatesText : "غیرفعال", minText : "تاریخ باید پس از {0} باشد", maxText : "تاریخ باید پس از {0} باشد", invalidText : "{0} تاریخ صحیحی نیست - فرمت صحیح {1}", format : "y/m/d", startDay : 0 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "در حال بارگذاری ...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'مقدار این فیلد باید یک ایمیل با این فرمت باشد "user@example.com"', urlText : 'مقدار این آدرس باید یک آدرس سایت با این فرمت باشد "http:/'+'/www.example.com"', alphaText : 'مقدار این فیلد باید فقط از حروف الفبا و _ تشکیل شده باشد ', alphanumText : 'مقدار این فیلد باید فقط از حروف الفبا، اعداد و _ تشکیل شده باشد' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'لطفا آدرس لینک را وارد کنید:', buttonTips : { bold : { title: 'تیره (Ctrl+B)', text: 'متن انتخاب شده را تیره می کند.', cls: 'x-html-editor-tip' }, italic : { title: 'ایتالیک (Ctrl+I)', text: 'متن انتخاب شده را ایتالیک می کند.', cls: 'x-html-editor-tip' }, underline : { title: 'زیرخط (Ctrl+U)', text: 'زیر هر نوشته یک خط نمایش می دهد.', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'افزایش اندازه', text: 'اندازه فونت را افزایش می دهد.', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'کاهش اندازه', text: 'اندازه متن را کاهش می دهد.', cls: 'x-html-editor-tip' }, backcolor : { title: 'رنگ زمینه متن', text: 'برای تغییر رنگ زمینه متن استفاده می شود.', cls: 'x-html-editor-tip' }, forecolor : { title: 'رنگ قلم', text: 'رنگ قلم متن را تغییر می دهد.', cls: 'x-html-editor-tip' }, justifyleft : { title: 'چیدن متن از سمت چپ', text: 'متن از سمت چپ چیده شده می شود.', cls: 'x-html-editor-tip' }, justifycenter : { title: 'متن در وسط ', text: 'نمایش متن در قسمت وسط صفحه و رعابت سمت چپ و راست.', cls: 'x-html-editor-tip' }, justifyright : { title: 'چیدن متن از سمت راست', text: 'متن از سمت راست پیده خواهد شد.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'لیست همراه با علامت', text: 'یک لیست جدید ایجاد می کند.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'لیست عددی', text: 'یک لیست عددی ایجاد می کند. ', cls: 'x-html-editor-tip' }, createlink : { title: 'لینک', text: 'متن انتخاب شده را به لینک تبدیل کنید.', cls: 'x-html-editor-tip' }, sourceedit : { title: 'ویرایش سورس', text: 'رفتن به حالت ویرایش سورس.', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "مرتب سازی افزایشی", sortDescText : "مرتب سازی کاهشی", lockText : "قفل ستون ها", unlockText : "بازکردن ستون ها", columnsText : "ستون ها" }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "نام", valueText : "مقدار", dateFormat : "Y/m/d" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "درگ برای تغییر اندازه.", collapsibleSplitTip : "برای تغییر اندازه درگ کنید." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-fi.js000066400000000000000000000177671226600447100214560ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * Finnish Translations * * 'ä' should read as lowercase 'a' with two dots on top (ä) */ Ext.UpdateManager.defaults.indicatorText = '
    Ladataan...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} rivi(ä) valittu"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Sulje tämä välilehti"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Ladataan..."; } Date.monthNames = [ "tammikuu", "helmikuu", "maaliskuu", "huhtikuu", "toukokuu", "kesäkuu", "heinäkuu", "elokuu", "syyskuu", "lokakuu", "marraskuu", "joulukuu" ]; Date.getShortMonthName = function(month) { //return Date.monthNames[month].substring(0, 3); return (month+1) + "."; }; Date.monthNumbers = { Jan : 0, Feb : 1, Mar : 2, Apr : 3, May : 4, Jun : 5, Jul : 6, Aug : 7, Sep : 8, Oct : 9, Nov : 10, Dec : 11 }; Date.getMonthNumber = function(name) { if(name.match(/^(1?\d)\./)) { return -1+RegExp.$1; } else { return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()]; } }; Date.dayNames = [ "sunnuntai", "maanantai", "tiistai", "keskiviikko", "torstai", "perjantai", "lauantai" ]; Date.getShortDayName = function(day) { return Date.dayNames[day].substring(0, 2); }; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "OK", cancel : "Peruuta", yes : "Kyllä", no : "Ei" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "j.n.Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Tänään", minText : "Tämä päivämäärä on aikaisempi kuin ensimmäinen sallittu", maxText : "Tämä päivämäärä on myöhäisempi kuin viimeinen sallittu", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Seuraava kuukausi (Control+oikealle)', prevText : 'Edellinen kuukausi (Control+vasemmalle)', monthYearText : 'Valitse kuukausi (vaihda vuotta painamalla Control+ylös/alas)', todayTip : "{0} (välilyönti)", format : "j.n.Y", okText : " OK ", cancelText : "Peruuta", startDay : 1 // viikko alkaa maanantaista }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Sivu", afterPageText : "/ {0}", firstText : "Ensimmäinen sivu", prevText : "Edellinen sivu", nextText : "Seuraava sivu", lastText : "Viimeinen sivu", refreshText : "Päivitä", displayMsg : "Näytetään {0} - {1} / {2}", emptyMsg : 'Ei tietoja' }); } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "Tämän kentän arvo ei kelpaa"; } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "Tämän kentän minimipituus on {0}", maxLengthText : "Tämän kentän maksimipituus on {0}", blankText : "Tämä kenttä on pakollinen", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "Tämän kentän pienin sallittu arvo on {0}", maxText : "Tämän kentän suurin sallittu arvo on {0}", nanText : "{0} ei ole numero" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Ei käytössä", disabledDatesText : "Ei käytössä", minText : "Tämän kentän päivämäärän tulee olla {0} jälkeen", maxText : "Tämän kentän päivämäärän tulee olla ennen {0}", invalidText : "Päivämäärä {0} ei ole oikeassa muodossa - kirjoita päivämäärä muodossa {1}", format : "j.n.Y", altFormats : "j.n.|d.m.|mdy|mdY|d|Y-m-d|Y/m/d", startDay : 1 // viikko alkaa maanantaista }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Ladataan...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Syötä tähän kenttään sähköpostiosoite, esim. "etunimi.sukunimi@osoite.fi"', urlText : 'Syötä tähän kenttään URL-osoite, esim. "http:/'+'/www.osoite.fi"', alphaText : 'Syötä tähän kenttään vain kirjaimia (a-z, A-Z) ja alaviivoja (_)', alphanumText : 'Syötä tähän kenttään vain kirjaimia (a-z, A-Z), numeroita (0-9) ja alaviivoja (_)' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'Anna linkin URL-osoite:', buttonTips : { bold : { title: 'Lihavoi (Ctrl+B)', text: 'Lihavoi valittu teksti.', cls: 'x-html-editor-tip' }, italic : { title: 'Kursivoi (Ctrl+I)', text: 'Kursivoi valittu teksti.', cls: 'x-html-editor-tip' }, underline : { title: 'Alleviivaa (Ctrl+U)', text: 'Alleviivaa valittu teksti.', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'Suurenna tekstiä', text: 'Kasvata tekstin kirjasinkokoa.', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'Pienennä tekstiä', text: 'Pienennä tekstin kirjasinkokoa.', cls: 'x-html-editor-tip' }, backcolor : { title: 'Tekstin korostusväri', text: 'Vaihda valitun tekstin taustaväriä.', cls: 'x-html-editor-tip' }, forecolor : { title: 'Tekstin väri', text: 'Vaihda valitun tekstin väriä.', cls: 'x-html-editor-tip' }, justifyleft : { title: 'Tasaa vasemmalle', text: 'Tasaa teksti vasempaan reunaan.', cls: 'x-html-editor-tip' }, justifycenter : { title: 'Keskitä', text: 'Keskitä teksti.', cls: 'x-html-editor-tip' }, justifyright : { title: 'Tasaa oikealle', text: 'Tasaa teksti oikeaan reunaan.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'Luettelo', text: 'Luo luettelo.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'Numeroitu luettelo', text: 'Luo numeroitu luettelo.', cls: 'x-html-editor-tip' }, createlink : { title: 'Linkki', text: 'Tee valitusta tekstistä hyperlinkki.', cls: 'x-html-editor-tip' }, sourceedit : { title: 'Lähdekoodin muokkaus', text: 'Vaihda lähdekoodin muokkausnäkymään.', cls: 'x-html-editor-tip' } } }); } if(Ext.form.BasicForm){ Ext.form.BasicForm.prototype.waitTitle = "Odota..."; } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Järjestä A-Ö", sortDescText : "Järjestä Ö-A", lockText : "Lukitse sarake", unlockText : "Vapauta sarakkeen lukitus", columnsText : "Sarakkeet" }); } if(Ext.grid.GroupingView){ Ext.apply(Ext.grid.GroupingView.prototype, { emptyGroupText : '(ei mitään)', groupByText : 'Ryhmittele tämän kentän mukaan', showGroupsText : 'Näytä ryhmissä' }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Nimi", valueText : "Arvo", dateFormat : "j.m.Y" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Muuta kokoa vetämällä.", collapsibleSplitTip : "Muuta kokoa vetämällä. Piilota kaksoisklikkauksella." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-fr.js000066400000000000000000000241001226600447100214420ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /* * France (France) translation * By Thylia * 09-11-2007, 02:22 PM * updated by disizben (22 Sep 2008) * updated by Thylia (20 Apr 2010) */ Ext.UpdateManager.defaults.indicatorText = '
    En cours de chargement...
    '; if(Ext.DataView){ Ext.DataView.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} ligne{1} sélectionnée{1}"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "En cours de chargement..."; } Date.shortMonthNames = [ "Janv", "Févr", "Mars", "Avr", "Mai", "Juin", "Juil", "Août", "Sept", "Oct", "Nov", "Déc" ]; Date.getShortMonthName = function(month) { return Date.shortMonthNames[month]; }; Date.monthNames = [ "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre" ]; Date.monthNumbers = { "Janvier" : 0, "Février" : 1, "Mars" : 2, "Avril" : 3, "Mai" : 4, "Juin" : 5, "Juillet" : 6, "Août" : 7, "Septembre" : 8, "Octobre" : 9, "Novembre" : 10, "Décembre" : 11 }; Date.getMonthNumber = function(name) { return Date.monthNumbers[Ext.util.Format.capitalize(name)]; }; Date.dayNames = [ "Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi" ]; Date.getShortDayName = function(day) { return Date.dayNames[day].substring(0, 3); }; Date.parseCodes.S.s = "(?:er)"; Ext.override(Date, { getSuffix : function() { return (this.getDate() == 1) ? "er" : ""; } }); if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "OK", cancel : "Annuler", yes : "Oui", no : "Non" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!Ext.isDate(v)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d/m/Y"); }; Ext.util.Format.plural = function(v, s, p) { return v + ' ' + (v <= 1 ? s : (p ? p : s + 's')); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Aujourd'hui", minText : "Cette date est antérieure à la date minimum", maxText : "Cette date est postérieure à la date maximum", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Mois suivant (CTRL+Flèche droite)', prevText : "Mois précédent (CTRL+Flèche gauche)", monthYearText : "Choisissez un mois (CTRL+Flèche haut ou bas pour changer d'année.)", todayTip : "{0} (Barre d'espace)", okText : " OK ", cancelText : "Annuler", format : "d/m/y", startDay : 1 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Page", afterPageText : "sur {0}", firstText : "Première page", prevText : "Page précédente", nextText : "Page suivante", lastText : "Dernière page", refreshText : "Actualiser la page", displayMsg : "Page courante {0} - {1} sur {2}", emptyMsg : 'Aucune donnée à afficher' }); } if(Ext.form.BasicForm){ Ext.form.BasicForm.prototype.waitTitle = "Veuillez patienter..."; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "La valeur de ce champ est invalide"; } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "La longueur minimum de ce champ est de {0} caractère(s)", maxLengthText : "La longueur maximum de ce champ est de {0} caractère(s)", blankText : "Ce champ est obligatoire", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { decimalSeparator : ",", decimalPrecision : 2, minText : "La valeur minimum de ce champ doit être de {0}", maxText : "La valeur maximum de ce champ doit être de {0}", nanText : "{0} n'est pas un nombre valide" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Désactivé", disabledDatesText : "Désactivé", minText : "La date de ce champ ne peut être antérieure au {0}", maxText : "La date de ce champ ne peut être postérieure au {0}", invalidText : "{0} n'est pas une date valide - elle doit être au format suivant: {1}", format : "d/m/y", altFormats : "d/m/Y|d-m-y|d-m-Y|d/m|d-m|dm|dmy|dmY|d|Y-m-d", startDay : 1 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "En cours de chargement...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Ce champ doit contenir une adresse email au format: "usager@example.com"', urlText : 'Ce champ doit contenir une URL au format suivant: "http:/'+'/www.example.com"', alphaText : 'Ce champ ne peut contenir que des lettres et le caractère souligné (_)', alphanumText : 'Ce champ ne peut contenir que des caractères alphanumériques ainsi que le caractère souligné (_)' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : "Veuillez entrer l'URL pour ce lien:", buttonTips : { bold : { title: 'Gras (Ctrl+B)', text: 'Met le texte sélectionné en gras.', cls: 'x-html-editor-tip' }, italic : { title: 'Italique (Ctrl+I)', text: 'Met le texte sélectionné en italique.', cls: 'x-html-editor-tip' }, underline : { title: 'Souligné (Ctrl+U)', text: 'Souligne le texte sélectionné.', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'Agrandir la police', text: 'Augmente la taille de la police.', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'Réduire la police', text: 'Réduit la taille de la police.', cls: 'x-html-editor-tip' }, backcolor : { title: 'Couleur de surbrillance', text: 'Modifie la couleur de fond du texte sélectionné.', cls: 'x-html-editor-tip' }, forecolor : { title: 'Couleur de police', text: 'Modifie la couleur du texte sélectionné.', cls: 'x-html-editor-tip' }, justifyleft : { title: 'Aligner à gauche', text: 'Aligne le texte à gauche.', cls: 'x-html-editor-tip' }, justifycenter : { title: 'Centrer', text: 'Centre le texte.', cls: 'x-html-editor-tip' }, justifyright : { title: 'Aligner à droite', text: 'Aligner le texte à droite.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'Liste à puce', text: 'Démarre une liste à puce.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'Liste numérotée', text: 'Démarre une liste numérotée.', cls: 'x-html-editor-tip' }, createlink : { title: 'Lien hypertexte', text: 'Transforme en lien hypertexte.', cls: 'x-html-editor-tip' }, sourceedit : { title: 'Code source', text: 'Basculer en mode édition du code source.', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Tri croissant", sortDescText : "Tri décroissant", columnsText : "Colonnes" }); } if(Ext.grid.GroupingView){ Ext.apply(Ext.grid.GroupingView.prototype, { emptyGroupText : '(Aucun)', groupByText : 'Grouper par ce champ', showGroupsText : 'Afficher par groupes' }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Propriété", valueText : "Valeur", dateFormat : "d/m/Y", trueText : "vrai", falseText : "faux" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Cliquer et glisser pour redimensionner le panneau.", collapsibleSplitTip : "Cliquer et glisser pour redimensionner le panneau. Double-cliquer pour le cacher." }); } if(Ext.form.TimeField){ Ext.apply(Ext.form.TimeField.prototype, { minText : "L'heure de ce champ ne peut être antérieure à {0}", maxText : "L'heure de ce champ ne peut être postérieure à {0}", invalidText : "{0} n'est pas une heure valide", format : "H:i", altFormats : "g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|h a|g a|g A|gi|hi|Hi|gia|hia|g|H" }); } if(Ext.form.CheckboxGroup){ Ext.apply(Ext.form.CheckboxGroup.prototype, { blankText : "Vous devez sélectionner au moins un élément dans ce groupe" }); } if(Ext.form.RadioGroup){ Ext.apply(Ext.form.RadioGroup.prototype, { blankText : "Vous devez sélectionner au moins un élément dans ce groupe" }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-fr_CA.js000066400000000000000000000132141226600447100220110ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /* * France (Canadian) translation * By BernardChhun * 04-08-2007, 03:07 AM */ Ext.UpdateManager.defaults.indicatorText = '
    En cours de chargement...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} ligne(s) sélectionné(s)"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Fermer cette onglet"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "La valeur de ce champ est invalide"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "En cours de chargement..."; } Date.shortMonthNames = [ "Janv", "Févr", "Mars", "Avr", "Mai", "Juin", "Juil", "Août", "Sept", "Oct", "Nov", "Déc" ]; Date.getShortMonthName = function(month) { return Date.shortMonthNames[month]; }; Date.monthNames = [ "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre" ]; Date.monthNumbers = { "Janvier" : 0, "Février" : 1, "Mars" : 2, "Avril" : 3, "Mai" : 4, "Juin" : 5, "Juillet" : 6, "Août" : 7, "Septembre" : 8, "Octobre" : 9, "Novembre" : 10, "Décembre" : 11 }; Date.getMonthNumber = function(name) { return Date.monthNumbers[Ext.util.Format.capitalize(name)]; }; Date.dayNames = [ "Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi" ]; Date.getShortDayName = function(day) { return Date.dayNames[day].substring(0, 3); }; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "OK", cancel : "Annuler", yes : "Oui", no : "Non" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d/m/Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Aujourd'hui", minText : "Cette date est plus petite que la date minimum", maxText : "Cette date est plus grande que la date maximum", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Prochain mois (CTRL+Fléche droite)', prevText : 'Mois précédent (CTRL+Fléche gauche)', monthYearText : 'Choissisez un mois (CTRL+Fléche haut ou bas pour changer d\'année.)', todayTip : "{0} (Barre d'espace)", format : "d/m/y" }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Page", afterPageText : "de {0}", firstText : "Première page", prevText : "Page précédente", nextText : "Prochaine page", lastText : "Dernière page", refreshText : "Recharger la page", displayMsg : "Page courante {0} - {1} de {2}", emptyMsg : 'Aucune donnée à afficher' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "La longueur minimum de ce champ est de {0} caractères", maxLengthText : "La longueur maximum de ce champ est de {0} caractères", blankText : "Ce champ est obligatoire", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "La valeur minimum de ce champ doit être de {0}", maxText : "La valeur maximum de ce champ doit être de {0}", nanText : "{0} n'est pas un nombre valide" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Désactivé", disabledDatesText : "Désactivé", minText : "La date de ce champ doit être avant le {0}", maxText : "La date de ce champ doit être après le {0}", invalidText : "{0} n'est pas une date valide - il doit être au format suivant: {1}", format : "d/m/y" }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "En cours de chargement...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Ce champ doit contenir un courriel et doit être sous ce format: "usager@example.com"', urlText : 'Ce champ doit contenir une URL sous le format suivant: "http:/'+'/www.example.com"', alphaText : 'Ce champ ne peut contenir que des lettres et le caractère souligné (_)', alphanumText : 'Ce champ ne peut contenir que des caractères alphanumériques ainsi que le caractère souligné (_)' }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Tri ascendant", sortDescText : "Tri descendant", lockText : "Verrouillé la colonne", unlockText : "Déverrouillé la colonne", columnsText : "Colonnes" }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Propriété", valueText : "Valeur", dateFormat : "d/m/Y" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Cliquer et glisser pour redimensionner le panneau.", collapsibleSplitTip : "Cliquer et glisser pour redimensionner le panneau. Double-cliquer pour cacher le panneau." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-gr.js000066400000000000000000000137631226600447100214600ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * Greek (Old Version) Translations by Vagelis * 03-June-2007 */ Ext.UpdateManager.defaults.indicatorText = '
    Öüñôùóç...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} åðéëåãìÝíç(åò) ãñáììÞ(Ýò)"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Êëåßóôå áõôÞ ôçí êáñôÝëá"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "Ç ôéìÞ óôï ðåäßï äåí åßíáé Ýãêõñç"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Öüñôùóç..."; } Date.monthNames = [ "ÉáíïõÜñéïò", "ÖåâñïõÜñéïò", "ÌÜñôéïò", "Áðñßëéïò", "ÌÜéïò", "Éïýíéïò", "Éïýëéïò", "Áýãïõóôïò", "ÓåðôÝìâñéïò", "Ïêôþâñéïò", "ÍïÝìâñéïò", "ÄåêÝìâñéïò" ]; Date.dayNames = [ "ÊõñéáêÞ", "ÄåõôÝñá", "Ôñßôç", "ÔåôÜñôç", "ÐÝìðôç", "ÐáñáóêåõÞ", "ÓÜââáôï" ]; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "ÅíôÜîåé", cancel : "Áêýñùóç", yes : "Íáé", no : "¼÷é" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "ì/ç/Å"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "ÓÞìåñá", minText : "Ç çìåñïìçíßá áõôÞ åßíáé ðñéí ôçí ìéêñüôåñç çìåñïìçíßá", maxText : "Ç çìåñïìçíßá áõôÞ åßíáé ìåôÜ ôçí ìåãáëýôåñç çìåñïìçíßá", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Åðüìåíïò ÌÞíáò (Control+Right)', prevText : 'Ðñïçãïýìåíïò ÌÞíáò (Control+Left)', monthYearText : 'ÅðéëÝîôå ÌÞíá (Control+Up/Down ãéá ìåôáêßíçóç óôá Ýôç)', todayTip : "{0} (Spacebar)", format : "ì/ç/Å" }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Óåëßäá", afterPageText : "áðü {0}", firstText : "Ðñþôç óåëßäá", prevText : "Ðñïçãïýìåíç óåëßäá", nextText : "Åðüìåíç óåëßäá", lastText : "Ôåëåõôáßá óåëßäá", refreshText : "ÁíáíÝùóç", displayMsg : "ÅìöÜíéóç {0} - {1} áðü {2}", emptyMsg : 'Äåí âñÝèçêáí åããñáöÝò ãéá åìöÜíéóç' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "Ôï åëÜ÷éóôï ìÝãåèïò ãéá áõôü ôï ðåäßï åßíáé {0}", maxLengthText : "Ôï ìÝãéóôï ìÝãåèïò ãéá áõôü ôï ðåäßï åßíáé {0}", blankText : "Ôï ðåäßï áõôü åßíáé õðï÷ñåùôïêü", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "Ç åëÜ÷éóôç ôéìÞ ãéá áõôü ôï ðåäßï åßíáé {0}", maxText : "Ç ìÝãéóôç ôéìÞ ãéá áõôü ôï ðåäßï åßíáé {0}", nanText : "{0} äåí åßíáé Ýãêõñïò áñéèìüò" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "ÁðåíåñãïðïéçìÝíï", disabledDatesText : "ÁðåíåñãïðïéçìÝíï", minText : "Ç çìåñïìçíßá ó' áõôü ôï ðåäßï ðñÝðåé íá åßíáé ìåôÜ áðü {0}", maxText : "Ç çìåñïìçíßá ó' áõôü ôï ðåäßï ðñÝðåé íá åßíáé ðñéí áðü {0}", invalidText : "{0} äåí åßíáé Ýãêõñç çìåñïìçíßá - ðñÝðåé íá åßíáé ôçò ìïñöÞò {1}", format : "ì/ç/Å" }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Öüñôùóç...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Áõôü ôï ðåäßï ðñÝðåé íá åßíáé e-mail address ôçò ìïñöÞò "user@example.com"', urlText : 'Áõôü ôï ðåäßï ðñÝðåé íá åßíáé ìéá äéåýèõíóç URL ôçò ìïñöÞò "http:/'+'/www.example.com"', alphaText : 'Áõôü ôï ðåäßï ðñÝðåé íá ðåñéÝ÷åé ãñÜììáôá êáé _', alphanumText : 'Áõôü ôï ðåäßï ðñÝðåé íá ðåñéÝ÷åé ãñÜììáôá, áñéèìïýò êáé _' }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Áýîïõóá Ôáîéíüìçóç", sortDescText : "Öèßíïõóá Ôáîéíüìçóç", lockText : "Êëåßäùìá óôÞëçò", unlockText : "Îåêëåßäùìá óôÞëçò", columnsText : "ÓôÞëåò" }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "¼íïìá", valueText : "ÔéìÞ", dateFormat : "ì/ç/Å" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Óýñåôå ãéá áëëáãÞ ìåãÝèïõò.", collapsibleSplitTip : "Óýñåôå ãéá áëëáãÞ ìåãÝèïõò. Double click ãéá áðüêñõøç." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-he.js000066400000000000000000000225161226600447100214400ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * Hebrew Translations * By spartacus (from forums) 06-12-2007 */ Ext.UpdateManager.defaults.indicatorText = '
    ...����
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "����� ������ {0}"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "���� ������"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "���� ���� �� ����"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "...����"; } Date.monthNames = [ "�����", "������", "���", "�����", "���", "����", "����", "������", "������", "�������", "������", "�����" ]; Date.getShortMonthName = function(month) { return Date.monthNames[month].substring(0, 3); }; Date.monthNumbers = { Jan : 0, Feb : 1, Mar : 2, Apr : 3, May : 4, Jun : 5, Jul : 6, Aug : 7, Sep : 8, Oct : 9, Nov : 10, Dec : 11 }; Date.getMonthNumber = function(name) { return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()]; }; Date.dayNames = [ "�", "�", "�", "�", "�", "�", "�" ]; Date.getShortDayName = function(day) { return Date.dayNames[day].substring(0, 3); }; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "�����", cancel : "�����", yes : "��", no : "��" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d/m/Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "����", minText : ".����� �� �� ���� ������ ������� �����", maxText : ".����� �� �� ���� ������ ����� �����", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : '(Control+Right) ����� ���', prevText : '(Control+Left) ����� �����', monthYearText : '(������ ��� Control+Up/Down) ��� ����', todayTip : "��� ����) {0})", format : "d/m/Y", okText : " ����� ", cancelText : "�����", startDay : 0 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "����", afterPageText : "{0} ����", firstText : "���� �����", prevText : "���� ����", nextText : "���� ���", lastText : "���� �����", refreshText : "����", displayMsg : "���� {0} - {1} ���� {2}", emptyMsg : '��� ���� �����' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "{0} ����� ��������� ���� �� ���", maxLengthText : "{0} ����� ������ ���� �� ���", blankText : "��� �� �����", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "{0} ���� ��������� ���� �� ���", maxText : "{0} ���� ������ ���� �� ���", nanText : "��� �� ���� {0}" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "������", disabledDatesText : "������", minText : "{0} ������ ���� �� ���� ����� ����", maxText : "{0} ������ ���� �� ���� ����� ����", invalidText : "{1} ��� �� ����� ���� - ���� ����� ������ {0}", format : "m/d/y", altFormats : "m/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d", startDay : 0 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "...����", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : '"user@example.com" ��� �� ���� ����� ����� ���� �������� ������', urlText : '"http:/'+'/www.example.com" ��� �� ���� ����� ����� ������� ������', alphaText : '_��� �� ���� ����� �� ������ �', alphanumText : '_��� �� ���� ����� �� ������, ������ �' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : ':��� ���� �� ����� �������� ���� ������', buttonTips : { bold : { title: '(Ctrl+B) �����', text: '.���� �� ����� �����', cls: 'x-html-editor-tip' }, italic : { title: '(Ctrl+I) ����', text: '.��� �� ����� �����', cls: 'x-html-editor-tip' }, underline : { title: '(Ctrl+U) �� ����', text: '.���� �� ���� ���� ����� �����', cls: 'x-html-editor-tip' }, increasefontsize : { title: '���� ����', text: '.���� ���� ���� ����� �����', cls: 'x-html-editor-tip' }, decreasefontsize : { title: '���� ����', text: '.���� ���� ���� ����� �����', cls: 'x-html-editor-tip' }, backcolor : { title: '��� ��� �����', text: '.��� �� ��� ���� ���� ����� �����', cls: 'x-html-editor-tip' }, forecolor : { title: '��� ����', text: '.��� �� ��� ����� ���� ����� �����', cls: 'x-html-editor-tip' }, justifyleft : { title: '���� �����', text: '.��� ����� �� ����� �����', cls: 'x-html-editor-tip' }, justifycenter : { title: '���� �����', text: '.��� ����� �� ����� �����', cls: 'x-html-editor-tip' }, justifyright : { title: '���� �����', text: '.��� ����� �� ����� �����', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: '����� ������', text: '.���� ����� ������', cls: 'x-html-editor-tip' }, insertorderedlist : { title: '����� �������', text: '.���� ����� �������', cls: 'x-html-editor-tip' }, createlink : { title: '�����', text: '.���� �� ����� ����� ������', cls: 'x-html-editor-tip' }, sourceedit : { title: '����� ��� ����', text: '.��� ��� ����', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "���� ���� ����", sortDescText : "���� ���� ����", lockText : "��� �����", unlockText : "���� �����", columnsText : "������" }); } if(Ext.grid.GroupingView){ Ext.apply(Ext.grid.GroupingView.prototype, { emptyGroupText : '(���)', groupByText : '��� ������� ��� ��� ��', showGroupsText : '��� �������' }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "��", valueText : "���", dateFormat : "m/j/Y" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : ".���� ������ ����", collapsibleSplitTip : ".���� ������ ����. ����� ����� ������" }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-hr.js000066400000000000000000000174671226600447100214660ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /* * Croatian translation * By Ylodi (utf8 encoding) * 8 May 2007 * * By Stjepan at gmail dot com (utf8 encoding) * 17 May 2008 */ Ext.UpdateManager.defaults.indicatorText = '
    Učitavanje...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} odabranih redova"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Zatvori ovaj tab"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "Unesena vrijednost u ovom polju je neispravna"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Učitavanje..."; } Date.monthNames = [ "Siječanj", "Veljača", "Ožujak", "Travanj", "Svibanj", "Lipanj", "Srpanj", "Kolovoz", "Rujan", "Listopad", "Studeni", "Prosinac" ]; Date.getShortMonthName = function(month) { return Date.monthNames[month].substring(0, 3); }; Date.monthNumbers = { Jan : 0, Feb : 1, Mar : 2, Apr : 3, May : 4, Jun : 5, Jul : 6, Aug : 7, Sep : 8, Oct : 9, Nov : 10, Dec : 11 }; Date.getMonthNumber = function(name) { return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()]; }; Date.dayNames = [ "Nedjelja", "Ponedjeljak", "Utorak", "Srijeda", "Četvrtak", "Petak", "Subota" ]; Date.getShortDayName = function(day) { return Date.dayNames[day].substring(0, 3); }; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "U redu", cancel : "Odustani", yes : "Da", no : "Ne" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d.m.Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Danas", minText : "Taj datum je prije najmanjeg datuma", maxText : "Taj datum je poslije najvećeg datuma", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Slijedeći mjesec (Control+Desno)', prevText : 'Prethodni mjesec (Control+Lijevo)', monthYearText : 'Odaberite mjesec (Control+Gore/Dolje za promjenu godine)', todayTip : "{0} (Razmaknica)", format : "d.m.y", okText : " U redu ", cancelText : "Odustani", startDay : 1 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Stranica", afterPageText : "od {0}", firstText : "Prva stranica", prevText : "Prethodna stranica", nextText : "Slijedeća stranica", lastText : "Posljednja stranica", refreshText : "Obnovi", displayMsg : "Prikazujem {0} - {1} od {2}", emptyMsg : 'Nema podataka za prikaz' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "Minimalna dužina za ovo polje je {0}", maxLengthText : "Maksimalna dužina za ovo polje je {0}", blankText : "Ovo polje je obavezno", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "Minimalna vrijednost za ovo polje je {0}", maxText : "Maksimalna vrijednost za ovo polje je {0}", nanText : "{0} nije ispravan broj" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Neaktivno", disabledDatesText : "Neaktivno", minText : "Datum u ovom polje mora biti poslije {0}", maxText : "Datum u ovom polju mora biti prije {0}", invalidText : "{0} nije ispravan datum - mora biti u obliku {1}", format : "d.m.y", startDay : 1 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Učitavanje...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Ovdje možete unijeti samo e-mail adresu u obliku "korisnik@domena.com"', urlText : 'Ovdje možete unijeti samo URL u obliku "http:/'+'/www.domena.com"', alphaText : 'Ovo polje može sadržavati samo slova i znak _', alphanumText : 'Ovo polje može sadržavati samo slova, brojeve i znak _' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'Unesite URL za link:', buttonTips : { bold : { title: 'Podebljano (Ctrl+B)', text: 'Podebljavanje označenog teksta.', cls: 'x-html-editor-tip' }, italic : { title: 'Kurziv (Ctrl+I)', text: 'Pretvaranje označenog tekst u kurziv', cls: 'x-html-editor-tip' }, underline : { title: 'Podcrtano (Ctrl+U)', text: 'Potcrtavanje označenog teksta', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'Povećanje teksta', text: 'Povećavanje veličine fonta.', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'Smanjivanje teksta', text: 'Smanjivanje veličine fonta.', cls: 'x-html-editor-tip' }, backcolor : { title: 'Boja označenog teksta', text: 'Promjena boje pozadine označenog teksta.', cls: 'x-html-editor-tip' }, forecolor : { title: 'Boja fonta', text: 'Promjena boje označenog teksta.', cls: 'x-html-editor-tip' }, justifyleft : { title: 'Lijevo poravnanje teksta', text: 'Poravnanje teksta na lijevu stranu.', cls: 'x-html-editor-tip' }, justifycenter : { title: 'Centriranje teksta', text: 'Centriranje teksta u uređivaču teksta.', cls: 'x-html-editor-tip' }, justifyright : { title: 'Desno poravnanje teksta', text: 'Poravnanje teksta na desnu stranu.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'Označena lista', text: 'Započinjanje označene liste.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'Numerirana lista', text: 'Započinjanje numerirane liste.', cls: 'x-html-editor-tip' }, createlink : { title: 'Hiperveza', text: 'Stvaranje hiperveze od označenog teksta.', cls: 'x-html-editor-tip' }, sourceedit : { title: 'Uređivanje izvornog koda', text: 'Prebacivanje u način rada za uređivanje izvornog koda.', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Sortiraj rastućim redoslijedom", sortDescText : "Sortiraj padajućim redoslijedom", lockText : "Zaključaj stupac", unlockText : "Otključaj stupac", columnsText : "Stupci" }); } if(Ext.grid.GroupingView){ Ext.apply(Ext.grid.GroupingView.prototype, { emptyGroupText : '(Ništa)', groupByText : 'Grupiranje po ovom polju', showGroupsText : 'Prikaz u grupama' }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Naziv", valueText : "Vrijednost", dateFormat : "d.m.Y" }); } if(Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Povuci za promjenu veličine.", collapsibleSplitTip : "Povuci za promjenu veličine. Dvostruki klik za skrivanje." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-hu.js000066400000000000000000000174101226600447100214550ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * List compiled by mystix on the extjs.com forums. * Thank you Mystix! * * Hungarian Translations (utf-8 encoded) * by Amon (27 Apr 2008) * encoding fixed by Vili (17 Feb 2009) */ Ext.UpdateManager.defaults.indicatorText = '
    Betöltés...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} kiválasztott sor"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Fül bezárása"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "Hibás érték!"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Betöltés..."; } Date.monthNames = [ "Január", "Február", "Március", "Április", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December" ]; Date.getShortMonthName = function(month) { return Date.monthNames[month].substring(0, 3); }; Date.monthNumbers = { 'Jan' : 0, 'Feb' : 1, 'Már' : 2, 'Ápr' : 3, 'Máj' : 4, 'Jún' : 5, 'Júl' : 6, 'Aug' : 7, 'Sze' : 8, 'Okt' : 9, 'Nov' : 10, 'Dec' : 11 }; Date.getMonthNumber = function(name) { return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()]; }; Date.dayNames = [ "Vasárnap", "Hétfő", "Kedd", "Szerda", "Csütörtök", "Péntek", "Szombat" ]; Date.getShortDayName = function(day) { return Date.dayNames[day].substring(0, 3); }; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "OK", cancel : "Mégsem", yes : "Igen", no : "Nem" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "Y m d"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Mai nap", minText : "A dátum korábbi a megengedettnél", maxText : "A dátum későbbi a megengedettnél", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Köv. hónap (CTRL+Jobbra)', prevText : 'Előző hónap (CTRL+Balra)', monthYearText : 'Válassz hónapot (Évválasztás: CTRL+Fel/Le)', todayTip : "{0} (Szóköz)", format : "y-m-d", okText : " OK ", cancelText : "Mégsem", startDay : 0 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Oldal", afterPageText : "a {0}-ból/ből", firstText : "Első oldal", prevText : "Előző oldal", nextText : "Következő oldal", lastText : "Utolsó oldal", refreshText : "Frissítés", displayMsg : "{0} - {1} sorok láthatók a {2}-ból/ből", emptyMsg : 'Nincs megjeleníthető adat' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "A mező tartalma legalább {0} hosszú kell legyen", maxLengthText : "A mező tartalma legfeljebb {0} hosszú lehet", blankText : "Kötelezően kitöltendő mező", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "A mező tartalma nem lehet kissebb, mint {0}", maxText : "A mező tartalma nem lehet nagyobb, mint {0}", nanText : "{0} nem szám" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Nem választható", disabledDatesText : "Nem választható", minText : "A dátum nem lehet korábbi, mint {0}", maxText : "A dátum nem lehet későbbi, mint {0}", invalidText : "{0} nem megfelelő dátum - a helyes formátum: {1}", format : "Y m d", altFormats : "Y-m-d|y-m-d|y/m/d|m/d|m-d|md|ymd|Ymd|d", startDay : 0 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Betöltés...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'A mező email címet tartalmazhat, melynek formátuma "felhasználó@szolgáltató.hu"', urlText : 'A mező webcímet tartalmazhat, melynek formátuma "http:/'+'/www.weboldal.hu"', alphaText : 'A mező csak betűket és aláhúzást (_) tartalmazhat', alphanumText : 'A mező csak betűket, számokat és aláhúzást (_) tartalmazhat' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'Add meg a webcímet:', buttonTips : { bold : { title: 'Félkövér (Ctrl+B)', text: 'Félkövérré teszi a kijelölt szöveget.', cls: 'x-html-editor-tip' }, italic : { title: 'Dőlt (Ctrl+I)', text: 'Dőlté teszi a kijelölt szöveget.', cls: 'x-html-editor-tip' }, underline : { title: 'Aláhúzás (Ctrl+U)', text: 'Aláhúzza a kijelölt szöveget.', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'Szöveg nagyítás', text: 'Növeli a szövegméretet.', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'Szöveg kicsinyítés', text: 'Csökkenti a szövegméretet.', cls: 'x-html-editor-tip' }, backcolor : { title: 'Háttérszín', text: 'A kijelölt szöveg háttérszínét módosítja.', cls: 'x-html-editor-tip' }, forecolor : { title: 'Szövegszín', text: 'A kijelölt szöveg színét módosítja.', cls: 'x-html-editor-tip' }, justifyleft : { title: 'Balra zárt', text: 'Balra zárja a szöveget.', cls: 'x-html-editor-tip' }, justifycenter : { title: 'Középre zárt', text: 'Középre zárja a szöveget.', cls: 'x-html-editor-tip' }, justifyright : { title: 'Jobbra zárt', text: 'Jobbra zárja a szöveget.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'Felsorolás', text: 'Felsorolást kezd.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'Számozás', text: 'Számozott listát kezd.', cls: 'x-html-editor-tip' }, createlink : { title: 'Hiperlink', text: 'A kijelölt szöveget linkké teszi.', cls: 'x-html-editor-tip' }, sourceedit : { title: 'Forrás nézet', text: 'Forrás nézetbe kapcsol.', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Növekvő rendezés", sortDescText : "Csökkenő rendezés", lockText : "Oszlop zárolás", unlockText : "Oszlop feloldás", columnsText : "Oszlopok" }); } if(Ext.grid.GroupingView){ Ext.apply(Ext.grid.GroupingView.prototype, { emptyGroupText : '(Nincs)', groupByText : 'Oszlop szerint csoportosítás', showGroupsText : 'Csoportos nézet' }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Név", valueText : "Érték", dateFormat : "Y m j" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Átméretezés húzásra.", collapsibleSplitTip : "Átméretezés húzásra. Eltüntetés duplaklikk." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-id.js000066400000000000000000000177661226600447100214530ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * Pedoman translasi: * http://id.wikisource.org/wiki/Panduan_Pembakuan_Istilah,_Pelaksanaan_Instruksi_Presiden_Nomor_2_Tahun_2001_Tentang_Penggunaan_Komputer_Dengan_Aplikasi_Komputer_Berbahasa_Indonesia * Original source: http://vlsm.org/etc/baku-0.txt * by Farid GS * farid [at] pulen.net * 10:13 04 Desember 2007 * Indonesian Translations */ Ext.UpdateManager.defaults.indicatorText = '
    Pemuatan...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} selected row(s)"; Ext.grid.GridPanel.prototype.ddText = "{0} baris terpilih"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Close this tab"; Ext.TabPanelItem.prototype.closeText = "Tutup tab ini"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "The value in this field is invalid"; Ext.form.Field.prototype.invalidText = "Isian belum benar"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Loading..."; Ext.LoadMask.prototype.msg = "Pemuatan..."; } Date.monthNames = [ "Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember" ]; Date.getShortMonthName = function(month) { return Date.monthNames[month].substring(0, 3); }; Date.monthNumbers = { Jan : 0, Feb : 1, Mar : 2, Apr : 3, Mei : 4, Jun : 5, Jul : 6, Agu : 7, Sep : 8, Okt : 9, Nov : 10, Des : 11 }; Date.getMonthNumber = function(name) { return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()]; }; Date.dayNames = [ "Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu" ]; Date.getShortDayName = function(day) { return Date.dayNames[day].substring(0, 3); }; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "OK", cancel : "Batal", yes : "Ya", no : "Tidak" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d/m/Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Hari ini", minText : "Tanggal ini sebelum batas tanggal minimal", maxText : "Tanggal ini setelah batas tanggal maksimal", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Bulan Berikut (Kontrol+Kanan)', prevText : 'Bulan Sebelum (Kontrol+Kiri)', monthYearText : 'Pilih bulan (Kontrol+Atas/Bawah untuk pindah tahun)', todayTip : "{0} (Spacebar)", format : "d/m/y", okText : " OK ", cancelText : "Batal", startDay : 1 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Hal", afterPageText : "dari {0}", firstText : "Hal. Pertama", prevText : "Hal. Sebelum", nextText : "Hal. Berikut", lastText : "Hal. Akhir", refreshText : "Segarkan", displayMsg : "Menampilkan {0} - {1} dari {2}", emptyMsg : 'Data tidak ditemukan' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "Panjang minimal untuk field ini adalah {0}", maxLengthText : "Panjang maksimal untuk field ini adalah {0}", blankText : "Field ini wajib diisi", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "Nilai minimal untuk field ini adalah {0}", maxText : "Nilai maksimal untuk field ini adalah {0}", nanText : "{0} bukan angka" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Disfungsi", disabledDatesText : "Disfungsi", minText : "Tanggal dalam field ini harus setelah {0}", maxText : "Tanggal dalam field ini harus sebelum {0}", invalidText : "{0} tanggal salah - Harus dalam format {1}", format : "d/m/y", //altFormats : "m/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d" altFormats : "d/m/Y|d-m-y|d-m-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d", startDay : 1 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Pemuatan...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Field ini harus dalam format email seperti "user@example.com"', urlText : 'Field ini harus dalam format URL seperti "http:/'+'/www.example.com"', alphaText : 'Field ini harus terdiri dari huruf dan _', alphanumText : 'Field ini haris terdiri dari huruf, angka dan _' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'Silakan masukkan URL untuk tautan:', buttonTips : { bold : { title: 'Tebal (Ctrl+B)', text: 'Buat tebal teks terpilih', cls: 'x-html-editor-tip' }, italic : { title: 'Miring (CTRL+I)', text: 'Buat miring teks terpilih', cls: 'x-html-editor-tip' }, underline : { title: 'Garisbawah (CTRl+U)', text: 'Garisbawahi teks terpilih', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'Perbesar teks', text: 'Perbesar ukuran fonta', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'Perkecil teks', text: 'Perkecil ukuran fonta', cls: 'x-html-editor-tip' }, backcolor : { title: 'Sorot Warna Teks', text: 'Ubah warna latar teks terpilih', cls: 'x-html-editor-tip' }, forecolor : { title: 'Warna Fonta', text: 'Ubah warna teks terpilih', cls: 'x-html-editor-tip' }, justifyleft : { title: 'Rata Kiri', text: 'Ratakan teks ke kiri', cls: 'x-html-editor-tip' }, justifycenter : { title: 'Rata Tengah', text: 'Ratakan teks ke tengah editor', cls: 'x-html-editor-tip' }, justifyright : { title: 'Rata Kanan', text: 'Ratakan teks ke kanan', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'Daftar Bulet', text: 'Membuat daftar berbasis bulet', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'Daftar Angka', text: 'Membuat daftar berbasis angka', cls: 'x-html-editor-tip' }, createlink : { title: 'Hipertaut', text: 'Buat teks terpilih sebagai Hipertaut', cls: 'x-html-editor-tip' }, sourceedit : { title: 'Edit Kode Sumber', text: 'Pindah dalam mode kode sumber', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Urut Naik", sortDescText : "Urut Turun", lockText : "Kancing Kolom", unlockText : "Lepas Kunci Kolom", columnsText : "Kolom" }); } if(Ext.grid.GroupingView){ Ext.apply(Ext.grid.GroupingView.prototype, { emptyGroupText : '(Kosong)', groupByText : 'Kelompokkan Berdasar Field Ini', showGroupsText : 'Tampil Dalam Kelompok' }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Nama", valueText : "Nilai", dateFormat : "d/m/Y" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Seret untuk ubah ukuran.", collapsibleSplitTip : "Seret untuk ubah ukuran, Dobel klik untuk sembunyikan." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-it.js000066400000000000000000000175761226600447100214720ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /* * Italian translation * By eric_void * 04-10-2007, 11:25 AM * Updated by Federico Grilli 21/12/2007 */ Ext.UpdateManager.defaults.indicatorText = '
    Caricamento in corso...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} righe selezionate"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Chiudi pannello"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "Valore non valido"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Caricamento in corso..."; } Date.monthNames = [ "Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre" ]; Date.getShortMonthName = function(month) { return Date.monthNames[month].substring(0, 3); }; Date.monthNumbers = { Gen : 0, Feb : 1, Mar : 2, Apr : 3, Mag : 4, Giu : 5, Lug : 6, Ago : 7, Set : 8, Ott : 9, Nov : 10, Dic : 11 }; Date.getMonthNumber = function(name) { return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()]; }; Date.dayNames = [ "Domenica", "Luned\u00EC", "Marted\u00EC", "Mercoled\u00EC", "Gioved\u00EC", "Venerd\u00EC", "Sabato" ]; Date.getShortDayName = function(day) { return Date.dayNames[day].substring(0, 3); }; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "OK", cancel : "Annulla", yes : "S\u00EC", no : "No" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d/m/Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Oggi", minText : "Data precedente alla data minima", maxText : "Data successiva alla data massima", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Mese successivo (Ctrl+Destra)', prevText : 'Mese precedente (Ctrl+Sinistra)', monthYearText : 'Scegli un mese (Ctrl+Su/Giu per cambiare anno)', todayTip : "{0} (Barra spaziatrice)", format : "d/m/y", cancelText : "Annulla", okText : " OK ", startDay : 1 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Pagina", afterPageText : "di {0}", firstText : "Prima pagina", prevText : "Pagina precedente", nextText : "Pagina successiva", lastText : "Ultima pagina", refreshText : "Aggiorna", displayMsg : "Record {0} - {1} di {2}", emptyMsg : 'Nessun dato da mostrare' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "La lunghezza minima \u00E8 {0}", maxLengthText : "La lunghezza massima \u00E8 {0}", blankText : "Campo obbligatorio", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { decimalSeparator : ",", decimalPrecision : 2, minText : "Il valore minimo \u00E8 {0}", maxText : "Il valore massimo \u00E8 {0}", nanText : "{0} non \u00E8 un valore numerico corretto" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Disabilitato", disabledDatesText : "Disabilitato", minText : "La data deve essere successiva al {0}", maxText : "La data deve essere precedente al {0}", invalidText : "{0} non \u00E8 una data valida. Deve essere nel formato {1}", format : "d/m/y", altFormats : "d/m/Y|d-m-y|d-m-Y|d/m|d-m|dm|dmy|dmY|d|Y-m-d", startDay : 1 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Caricamento in corso...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Il campo deve essere un indirizzo e-mail nel formato "user@example.com"', urlText : 'Il campo deve essere un indirizzo web nel formato "http:/'+'/www.example.com"', alphaText : 'Il campo deve contenere solo lettere e _', alphanumText : 'Il campo deve contenere solo lettere, numeri e _' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'Inserire un URL per il link:', buttonTips : { bold : { title: 'Grassetto (Ctrl+B)', text: 'Rende il testo selezionato in grassetto.', cls: 'x-html-editor-tip' }, italic : { title: 'Corsivo (Ctrl+I)', text: 'Rende il testo selezionato in corsivo.', cls: 'x-html-editor-tip' }, underline : { title: 'Sottolinea (Ctrl+U)', text: 'Sottolinea il testo selezionato.', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'Ingrandisci testo', text: 'Aumenta la dimensione del carattere.', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'Rimpicciolisci testo', text: 'Diminuisce la dimensione del carattere.', cls: 'x-html-editor-tip' }, backcolor : { title: 'Colore evidenziatore testo', text: 'Modifica il colore di sfondo del testo selezionato.', cls: 'x-html-editor-tip' }, forecolor : { title: 'Colore carattere', text: 'Modifica il colore del testo selezionato.', cls: 'x-html-editor-tip' }, justifyleft : { title: 'Allinea a sinistra', text: 'Allinea il testo a sinistra.', cls: 'x-html-editor-tip' }, justifycenter : { title: 'Centra', text: 'Centra il testo.', cls: 'x-html-editor-tip' }, justifyright : { title: 'Allinea a destra', text: 'Allinea il testo a destra.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'Elenco puntato', text: 'Elenco puntato.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'Elenco numerato', text: 'Elenco numerato.', cls: 'x-html-editor-tip' }, createlink : { title: 'Collegamento', text: 'Trasforma il testo selezionato in un collegamanto.', cls: 'x-html-editor-tip' }, sourceedit : { title: 'Sorgente', text: 'Passa alla modalit\u00E0 editing del sorgente.', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Ordinamento crescente", sortDescText : "Ordinamento decrescente", lockText : "Blocca colonna", unlockText : "Sblocca colonna", columnsText : "Colonne" }); } if(Ext.grid.GroupingView){ Ext.apply(Ext.grid.GroupingView.prototype, { emptyGroupText : '(Nessun dato)', groupByText : 'Raggruppa per questo campo', showGroupsText : 'Mostra nei gruppi' }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Nome", valueText : "Valore", dateFormat : "j/m/Y" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Trascina per cambiare dimensioni.", collapsibleSplitTip : "Trascina per cambiare dimensioni. Doppio click per nascondere." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-ja.js000066400000000000000000000220471226600447100214350ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /* * Japanese translation * By tyama * 04-08-2007, 05:49 AM * * update based on English Translations by Condor (8 Aug 2008) * By sakuro (30 Aug 2008) */ Ext.UpdateManager.defaults.indicatorText = '
    読み込み中...
    '; if(Ext.DataView){ Ext.DataView.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} 行選択"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "読み込み中..."; } Date.monthNames = [ '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月' ]; Date.getShortMonthName = function(month) { return "" + (month + 1); }; Date.monthNumbers = { "1" : 0, "2" : 1, "3" : 2, "4" : 3, "5" : 4, "6" : 5, "7" : 6, "8" : 7, "9" : 8, "10" : 9, "11" : 10, "12" : 11 }; Date.getMonthNumber = function(name) { return Date.monthNumbers[name.substring(0, name.length - 1)]; // or simply parseInt(name.substring(0, name.length - 1)) - 1 }; Date.dayNames = [ "日曜日", "月曜日", "火曜日", "水曜日", "木曜日", "金曜日", "土曜日" ]; Date.getShortDayName = function(day) { return Date.dayNames[day].substring(0, 1); // just remove "曜日" suffix }; Date.formatCodes.a = "(this.getHours() < 12 ? '午前' : '午後')"; Date.formatCodes.A = "(this.getHours() < 12 ? '午前' : '午後')"; // no case difference if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "OK", cancel : "キャンセル", yes : "はい", no : "いいえ" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "Y/m/d"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "今日", minText : "選択した日付は最小値以下です。", maxText : "選択した日付は最大値以上です。", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : '次月へ (コントロール+右)', prevText : '前月へ (コントロール+左)', monthYearText : '月選択 (コントロール+上/下で年移動)', todayTip : "{0} (スペースキー)", format : "Y/m/d", okText : "OK", cancelText : "キャンセル", startDay : 0 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "ページ", afterPageText : "/ {0}", firstText : "最初のページ", prevText : "前のページ", nextText : "次のページ", lastText : "最後のページ", refreshText : "更新", displayMsg : "{2} 件中 {0} - {1} を表示", emptyMsg : '表示するデータがありません。' }); } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "フィールドの値が不正です。"; } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "このフィールドの最小値は {0} です。", maxLengthText : "このフィールドの最大値は {0} です。", blankText : "必須項目です。", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { decimalSeparator : ".", decimalPrecision : 2, minText : "このフィールドの最小値は {0} です。", maxText : "このフィールドの最大値は {0} です。", nanText : "{0} は数値ではありません。" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "無効", disabledDatesText : "無効", minText : "このフィールドの日付は、 {0} 以降の日付に設定してください。", maxText : "このフィールドの日付は、 {0} 以前の日付に設定してください。", invalidText : "{0} は間違った日付入力です。 - 入力形式は「{1}」です。", format : "Y/m/d", altFormats : "y/m/d|m/d/y|m/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d", startDay : 0 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "読み込み中...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'メールアドレスを"user@example.com"の形式で入力してください。', urlText : 'URLを"http:/'+'/www.example.com"の形式で入力してください。', alphaText : '半角英字と"_"のみです。', alphanumText : '半角英数と"_"のみです。' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'リンクのURLを入力してください:', buttonTips : { bold : { title: '太字 (コントロール+B)', text: '選択テキストを太字にします。', cls: 'x-html-editor-tip' }, italic : { title: '斜体 (コントロール+I)', text: '選択テキストを斜体にします。', cls: 'x-html-editor-tip' }, underline : { title: '下線 (コントロール+U)', text: '選択テキストに下線を引きます。', cls: 'x-html-editor-tip' }, increasefontsize : { title: '文字を大きく', text: 'フォントサイズを大きくします。', cls: 'x-html-editor-tip' }, decreasefontsize : { title: '文字を小さく', text: 'フォントサイズを小さくします。', cls: 'x-html-editor-tip' }, backcolor : { title: '文字のハイライト', text: '選択テキストの背景色を変更します。', cls: 'x-html-editor-tip' }, forecolor : { title: '文字の色', text: '選択テキストの色を変更します。', cls: 'x-html-editor-tip' }, justifyleft : { title: '左揃え', text: 'テキストを左揃えにします。', cls: 'x-html-editor-tip' }, justifycenter : { title: '中央揃え', text: 'テキストを中央揃えにします。', cls: 'x-html-editor-tip' }, justifyright : { title: '右揃え', text: 'テキストを右揃えにします。', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: '番号なし箇条書き', text: '番号なし箇条書きを開始します。', cls: 'x-html-editor-tip' }, insertorderedlist : { title: '番号付き箇条書き', text: '番号付き箇条書きを開始します。', cls: 'x-html-editor-tip' }, createlink : { title: 'ハイパーリンク', text: '選択テキストをハイパーリンクにします。', cls: 'x-html-editor-tip' }, sourceedit : { title: 'ソース編集', text: 'ソース編集モードに切り替えます。', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "昇順", sortDescText : "降順", columnsText : "カラム" }); } if(Ext.grid.GroupingView){ Ext.apply(Ext.grid.GroupingView.prototype, { emptyGroupText : '(なし)', groupByText : 'このカラムでグルーピング', showGroupsText : 'グルーピング' }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "名称", valueText : "値", dateFormat : "Y/m/d" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "ドラッグするとリサイズできます。", collapsibleSplitTip : "ドラッグでリサイズ。 ダブルクリックで隠す。" }); } if(Ext.form.TimeField){ Ext.apply(Ext.form.TimeField.prototype, { minText : "このフィールドの時刻は、 {0} 以降の時刻に設定してください。", maxText : "このフィールドの時刻は、 {0} 以前の時刻に設定してください。", invalidText : "{0} は間違った時刻入力です。", format : "g:i A", altFormats : "g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|gi|hi|gia|hia|g|H" }); } if(Ext.form.CheckboxGroup){ Ext.apply(Ext.form.CheckboxGroup.prototype, { blankText : "このグループから最低1つのアイテムを選択しなければなりません。" }); } if(Ext.form.RadioGroup){ Ext.apply(Ext.form.RadioGroup.prototype, { blankText : "このグループから1つのアイテムを選択しなければなりません。" }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-ko.js000066400000000000000000000176301226600447100214560ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * Korean Translations By nicetip * 05 September 2007 * Modify by techbug / 25 February 2008 */ Ext.UpdateManager.defaults.indicatorText = '
    로딩중...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} 개가 선택되었습니다."; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "닫기"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "올바른 값이 아닙니다."; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "로딩중..."; } Date.monthNames = [ "1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월" ]; Date.dayNames = [ "일", "월", "화", "수", "목", "금", "토" ]; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "확인", cancel : "취소", yes : "예", no : "아니오" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "m/d/Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "오늘", minText : "최소 날짜범위를 넘었습니다.", maxText : "최대 날짜범위를 넘었습니다.", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : '다음달(컨트롤키+오른쪽 화살표)', prevText : '이전달 (컨트롤키+왼족 화살표)', monthYearText : '월을 선택해주세요. (컨트롤키+위/아래 화살표)', todayTip : "{0} (스페이스바)", format : "m/d/y", okText : "확인", cancelText : "취소", startDay : 0 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "페이지", afterPageText : "/ {0}", firstText : "첫 페이지", prevText : "이전 페이지", nextText : "다음 페이지", lastText : "마지막 페이지", refreshText : "새로고침", displayMsg : "전체 {2} 중 {0} - {1}", emptyMsg : '표시할 데이터가 없습니다.' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "최소길이는 {0}입니다.", maxLengthText : "최대길이는 {0}입니다.", blankText : "값을 입력해주세요.", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "최소값은 {0}입니다.", maxText : "최대값은 {0}입니다.", nanText : "{0}는 올바른 숫자가 아닙니다." }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "비활성", disabledDatesText : "비활성", minText : "{0}일 이후여야 합니다.", maxText : "{0}일 이전이어야 합니다.", invalidText : "{0}는 올바른 날짜형식이 아닙니다. - 다음과 같은 형식이어야 합니다. {1}", format : "m/d/y", startDay : 0 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "로딩중...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : '이메일 주소 형식에 맞게 입력해야합니다. (예: "user@example.com")', urlText : 'URL 형식에 맞게 입력해야합니다. (예: "http:/'+'/www.example.com")', alphaText : '영문, 밑줄(_)만 입력할 수 있습니다.', alphanumText : '영문, 숫자, 밑줄(_)만 입력할 수 있습니다.' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'URL을 입력해주세요:', buttonTips : { bold : { title: '굵게 (Ctrl+B)', text: '선택한 텍스트를 굵게 표시합니다.', cls: 'x-html-editor-tip' }, italic : { title: '기울임꼴 (Ctrl+I)', text: '선택한 텍스트를 기울임꼴로 표시합니다.', cls: 'x-html-editor-tip' }, underline : { title: '밑줄 (Ctrl+U)', text: '선택한 텍스트에 밑줄을 표시합니다.', cls: 'x-html-editor-tip' }, increasefontsize : { title: '글꼴크기 늘림', text: '글꼴 크기를 크게 합니다.', cls: 'x-html-editor-tip' }, decreasefontsize : { title: '글꼴크기 줄임', text: '글꼴 크기를 작게 합니다.', cls: 'x-html-editor-tip' }, backcolor : { title: '텍스트 강조 색', text: '선택한 텍스트의 배경색을 변경합니다.', cls: 'x-html-editor-tip' }, forecolor : { title: '글꼴색', text: '선택한 텍스트의 색을 변경합니다.', cls: 'x-html-editor-tip' }, justifyleft : { title: '텍스트 왼쪽 맞춤', text: '왼쪽에 텍스트를 맞춥니다.', cls: 'x-html-editor-tip' }, justifycenter : { title: '가운데 맞춤', text: '가운데에 텍스트를 맞춥니다.', cls: 'x-html-editor-tip' }, justifyright : { title: '텍스트 오른쪽 맞춤', text: '오른쪽에 텍스트를 맞춥니다.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: '글머리 기호', text: '글머리 기호 목록을 시작합니다.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: '번호 매기기', text: '번호 매기기 목록을 시작합니다.', cls: 'x-html-editor-tip' }, createlink : { title: '하이퍼링크', text: '선택한 텍스트에 하이퍼링크를 만듭니다.', cls: 'x-html-editor-tip' }, sourceedit : { title: '소스편집', text: '소스편집 모드로 변환합니다.', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "오름차순 정렬", sortDescText : "내림차순 정렬", lockText : "칼럼 잠금", unlockText : "칼럼 잠금해제", columnsText : "칼럼 목록" }); } if(Ext.grid.GroupingView){ Ext.apply(Ext.grid.GroupingView.prototype, { emptyGroupText : '(None)', groupByText : '현재 필드로 그룹핑합니다.', showGroupsText : '그룹으로 보여주기' }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "항목", valueText : "값", dateFormat : "m/j/Y" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "크기변경을 위해 드래그하세요.", collapsibleSplitTip : "크기변경을 위해 드래그, 숨기기 위해 더블클릭 하세요." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-lt.js000066400000000000000000000216071226600447100214630ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * Lithuanian Translations (UTF-8) * Vladas Saulis (vladas at prodata dot lt), 03-29-2009 * Vladas Saulis (vladas at prodata dot lt), 10-18-2007 */ Ext.UpdateManager.defaults.indicatorText = '
    Kraunasi...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.DataView){ Ext.DataView.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} pažymėtų eilučių"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Uždaryti šią užsklandą"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "Šio lauko reikšmė neteisinga"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Kraunasi..."; } Date.monthNames = [ "Sausis", "Vasaris", "Kovas", "Balandis", "Gegužė", "Birželis", "Liepa", "Rugpjūtis", "Rugsėjis", "Spalis", "Lapkritis", "Gruodis" ]; Date.getShortMonthName = function(month) { // Uncommons if (month == 7) return "Rgp"; if (month == 8) return "Rgs"; if (month == 11) return "Grd"; return Date.monthNames[month].substring(0, 3); }; Date.monthNumbers = { Sau : 0, Vas : 1, Kov : 2, Bal : 3, Geg : 4, Bir : 5, Lie : 6, Rgp : 7, Rgs : 8, Spa : 9, Lap : 10, Grd : 11 }; Date.getMonthNumber = function(name) { // Some uncommons if (name == "Rugpjūtis") return 7; if (name == "Rugsėjis") return 8; if (name == "Gruodis") return 11; return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()]; }; Date.dayNames = [ "Sekmadienis", "Pirmadienis", "Antradienis", "Trečiadienis", "Ketvirtadienis", "Penktadienis", "Šeštadienis" ]; Date.parseCodes.S.s = "(?:as|as|as|as)"; Date.getShortDayName = function(day) { return Date.dayNames[day].substring(0, 3); }; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "Gerai", cancel : "Atsisakyti", yes : "Taip", no : "Ne" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "Y-m-d"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Šiandien", minText : "Ši data yra mažesnė už leistiną", maxText : "Ši data yra didesnė už leistiną", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Kitas mėnuo (Control+Right)', prevText : 'Ankstesnis mėnuo (Control+Left)', monthYearText : 'Pasirinkti mėnesį (Control+Up/Down perėjimui tarp metų)', todayTip : "{0} (Tarpas)", format : "y-m-d", okText : " Gerai ", cancelText : "Atsisaktyi", startDay : 1 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Puslapis", afterPageText : "iš {0}", firstText : "Pirmas puslapis", prevText : "Ankstesnis pusl.", nextText : "Kitas puslapis", lastText : "Pakutinis pusl.", refreshText : "Atnaujinti", displayMsg : "Rodomi įrašai {0} - {1} iš {2}", emptyMsg : 'Nėra duomenų' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "Minimalus šio lauko ilgis yra {0}", maxLengthText : "Maksimalus šio lauko ilgis yra {0}", blankText : "Šis laukas yra privalomas", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "Minimalus šio lauko ilgis yra {0}", maxText : "Maksimalus šio lauko ilgis yra {0}", nanText : "{0} yra neleistina reikšmė" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Neprieinama", disabledDatesText : "Neprieinama", minText : "Šiame lauke data turi būti didesnė už {0}", maxText : "Šiame lauke data turi būti mažesnėė už {0}", invalidText : "{0} yra neteisinga data - ji turi būti įvesta formatu {1}", format : "y-m-d", altFormats : "y-m-d|y/m/d|Y-m-d|m/d|m-d|md|ymd|Ymd|d|Y-m-d", startDay : 1 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Kraunasi...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Šiame lauke turi būti el.pašto adresas formatu "user@example.com"', urlText : 'Šiame lauke turi būti nuoroda (URL) formatu "http:/'+'/www.example.com"', alphaText : 'Šiame lauke gali būti tik raidės ir ženklas "_"', alphanumText : 'Šiame lauke gali būti tik raidės, skaičiai ir ženklas "_"' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'Įveskite URL šiai nuorodai:', buttonTips : { bold : { title: 'Bold (Ctrl+B)', text: 'Teksto paryškinimas.', cls: 'x-html-editor-tip' }, italic : { title: 'Italic (Ctrl+I)', text: 'Kursyvinis tekstas.', cls: 'x-html-editor-tip' }, underline : { title: 'Underline (Ctrl+U)', text: 'Teksto pabraukimas.', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'Padidinti šriftą', text: 'Padidinti šrifto dydį.', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'Sumažinti šriftą', text: 'Sumažinti šrifto dydį.', cls: 'x-html-editor-tip' }, backcolor : { title: 'Nuspalvinti teksto foną', text: 'Pakeisti teksto fono spalvą.', cls: 'x-html-editor-tip' }, forecolor : { title: 'Teksto spalva', text: 'Pakeisti pažymėto teksto spalvą.', cls: 'x-html-editor-tip' }, justifyleft : { title: 'Išlyginti kairen', text: 'Išlyginti tekstą į kairę.', cls: 'x-html-editor-tip' }, justifycenter : { title: 'Centruoti tekstą', text: 'Centruoti tektą redaktoriaus lange.', cls: 'x-html-editor-tip' }, justifyright : { title: 'Išlyginti dešinėn', text: 'Išlyginti tekstą į dešinę.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'Paprastas sąrašas', text: 'Pradėti neorganizuotą sąrašą.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'Numeruotas sąrašas', text: 'Pradėti numeruotą sąrašą.', cls: 'x-html-editor-tip' }, createlink : { title: 'Nuoroda', text: 'Padaryti pažymėta tekstą nuoroda.', cls: 'x-html-editor-tip' }, sourceedit : { title: 'Išeities tekstas', text: 'Persijungti į išeities teksto koregavimo režimą.', cls: 'x-html-editor-tip' } } }); } if(Ext.form.BasicForm){ Ext.form.BasicForm.prototype.waitTitle = "Palaukite..."; } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Rūšiuoti didėjančia tvarka", sortDescText : "Rūšiuoti mažėjančia tvarka", lockText : "Užfiksuoti stulpelį", unlockText : "Atlaisvinti stulpelį", columnsText : "Stulpeliai" }); } if(Ext.grid.GroupingView){ Ext.apply(Ext.grid.GroupingView.prototype, { emptyGroupText : '(Nėra)', groupByText : 'Grupuoti pagal šį lauką', showGroupsText : 'Rodyti grupėse' }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Pavadinimas", valueText : "Reikšmė", dateFormat : "Y-m-d" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Patraukite juostelę.", collapsibleSplitTip : "Patraukite juostelę arba Paspauskite dvigubai kad paslėpti." }); } if(Ext.form.TimeField){ Ext.apply(Ext.form.TimeField.prototype, { minText : "Laikas turi buti lygus arba vėlesnis už {0}", maxText : "Laikas turi būti lygus arba ankstesnis už {0}", invalidText : "{0} yra neteisingas laikas", format : "H:i", altFormats : "g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|gi|hi|gia|hia|g|H" }); } if(Ext.form.CheckboxGroup){ Ext.apply(Ext.form.CheckboxGroup.prototype, { blankText : "Jūs turite padaryti bent vieną pasirinkimą šioje grupėje" }); } if(Ext.form.RadioGroup){ Ext.apply(Ext.form.RadioGroup.prototype, { blankText : "Jūs turite padaryti bent vieną pasirinkimą šioje grupėje" }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-lv.js000066400000000000000000000115471226600447100214670ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * Latvian Translations * By salix 17 April 2007 */ Ext.UpdateManager.defaults.indicatorText = '
    Notiek ielāde...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} iezīmētu rindu"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Aizver šo zīmni"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "Vērtība šajā laukā nav pareiza"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Ielādē..."; } Date.monthNames = [ "Janvāris", "Februāris", "Marts", "Aprīlis", "Maijs", "Jūnijs", "Jūlijs", "Augusts", "Septembris", "Oktobris", "Novembris", "Decembris" ]; Date.dayNames = [ "Svētdiena", "Pirmdiena", "Otrdiena", "Trešdiena", "Ceturtdiena", "Piektdiena", "Sestdiena" ]; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "Labi", cancel : "Atcelt", yes : "Jā", no : "Nē" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d.m.Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Šodiena", minText : "Norādītais datums ir mazāks par minimālo datumu", maxText : "Norādītais datums ir lielāks par maksimālo datumu", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Nākamais mēnesis (Control+pa labi)', prevText : 'Iepriekšējais mēnesis (Control+pa kreisi)', monthYearText : 'Mēneša izvēle (Control+uz augšu/uz leju lai pārslēgtu gadus)', todayTip : "{0} (Tukšumzīme)", format : "d.m.Y", startDay : 1 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Lapa", afterPageText : "no {0}", firstText : "Pirmā lapa", prevText : "iepriekšējā lapa", nextText : "Nākamā lapa", lastText : "Pēdējā lapa", refreshText : "Atsvaidzināt", displayMsg : "Rāda no {0} līdz {1} ierakstiem, kopā {2}", emptyMsg : 'Nav datu, ko parādīt' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "Minimālais garums šim laukam ir {0}", maxLengthText : "Maksimālais garums šim laukam ir {0}", blankText : "Šis ir obligāts lauks", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "Minimālais garums šim laukam ir {0}", maxText : "Maksimālais garums šim laukam ir {0}", nanText : "{0} nav pareizs skaitlis" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Atspējots", disabledDatesText : "Atspējots", minText : "Datumam šajā laukā jābūt lielākam kā {0}", maxText : "Datumam šajā laukā jābūt mazākam kā {0}", invalidText : "{0} nav pareizs datums - tam jābūt šādā formātā: {1}", format : "d.m.Y", startDay : 1 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Ielādē...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Šajā laukā jāieraksta e-pasta adrese formātā "lietotās@domēns.lv"', urlText : 'Šajā laukā jāieraksta URL formātā "http:/'+'/www.domēns.lv"', alphaText : 'Šis lauks drīkst saturēt tikai burtus un _ zīmi', alphanumText : 'Šis lauks drīkst saturēt tikai burtus, ciparus un _ zīmi' }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Kārtot pieaugošā secībā", sortDescText : "Kārtot dilstošā secībā", lockText : "Noslēgt kolonnu", unlockText : "Atslēgt kolonnu", columnsText : "Kolonnas" }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Nosaukums", valueText : "Vērtība", dateFormat : "j.m.Y" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Velc, lai mainītu izmēru.", collapsibleSplitTip : "Velc, lai mainītu izmēru. Dubultklikšķis noslēpj apgabalu." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-mk.js000066400000000000000000000132511226600447100214470ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /* * Macedonia translation * By PetarD petar.dimitrijevic@vorteksed.com.mk (utf8 encoding) * 23 April 2007 */ Ext.UpdateManager.defaults.indicatorText = '
    Вчитувам...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} избрани редици"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Затвори tab"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "Вредноста во ова поле е невалидна"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Вчитувам..."; } Date.monthNames = [ "Јануари", "Февруари", "Март", "Април", "Мај", "Јуни", "Јули", "Август", "Септември", "Октомври", "Ноември", "Декември" ]; Date.dayNames = [ "Недела", "Понеделник", "Вторник", "Среда", "Четврток", "Петок", "Сабота" ]; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "Потврди", cancel : "Поништи", yes : "Да", no : "Не" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d.m.y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Денеска", minText : "Овој датум е пред најмалиот датум", maxText : "Овој датум е пред најголемиот датум", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Следен месец (Control+Стрелка десно)', prevText : 'Претходен месец (Control+Стрелка лево)', monthYearText : 'Изберете месец (Control+Стрелка горе/Стрелка десно за менување година)', todayTip : "{0} (Spacebar)", format : "d.m.y" }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Страница", afterPageText : "од {0}", firstText : "Прва Страница", prevText : "Претходна Страница", nextText : "Следна Страница", lastText : "Последна Страница", refreshText : "Освежи", displayMsg : "Прикажувам {0} - {1} од {2}", emptyMsg : 'Нема податоци за приказ' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "Минималната должина за ова поле е {0}", maxLengthText : "Максималната должина за ова поле е {0}", blankText : "Податоците во ова поле се потребни", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "Минималната вредност за ова поле е {0}", maxText : "Максималната вредност за ова поле е {0}", nanText : "{0} не е валиден број" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Неактивно", disabledDatesText : "Неактивно", minText : "Датумот во ова поле мора да биде пред {0}", maxText : "Датумот во ова поле мора да биде по {0}", invalidText : "{0} не е валиден датум - мора да биде во формат {1}", format : "d.m.y" }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Вчитувам...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Ова поле треба да биде e-mail адреса во формат "user@example.com"', urlText : 'Ова поле треба да биде URL во формат "http:/'+'/www.example.com"', alphaText : 'Ова поле треба да содржи само букви и _', alphanumText : 'Ова поле треба да содржи само букви, бројки и _' }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Сортирај Растечки", sortDescText : "Сортирај Опаѓачки", lockText : "Заклучи Колона", unlockText : "Отклучи колона", columnsText : "Колони" }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Име", valueText : "Вредност", dateFormat : "m.d.Y" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Повлечете за менување на големината.", collapsibleSplitTip : "Повлечете за менување на големината. Дупли клик за криење." }); }glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-nl.js000066400000000000000000000200011226600447100214400ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * List compiled by mystix on the extjs.com forums. * Thank you Mystix! * * Dutch Translations * by Ido Sebastiaan Bas van Oostveen (12 Oct 2007) * updated to 2.2 by Condor (8 Aug 2008) */ Ext.UpdateManager.defaults.indicatorText = '
    Bezig met laden...
    '; if(Ext.DataView){ Ext.DataView.prototype.emptyText = ''; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = '{0} geselecteerde rij(en)'; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = 'Bezig met laden...'; } Date.monthNames = [ 'januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december' ]; Date.getShortMonthName = function(month) { if (month == 2) { return 'mrt'; } return Date.monthNames[month].substring(0, 3); }; Date.monthNumbers = { jan: 0, feb: 1, mrt: 2, apr: 3, mei: 4, jun: 5, jul: 6, aug: 7, sep: 8, okt: 9, nov: 10, dec: 11 }; Date.getMonthNumber = function(name) { var sname = name.substring(0, 3).toLowerCase(); if (sname == 'maa') { return 2; } return Date.monthNumbers[sname]; }; Date.dayNames = [ 'zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag' ]; Date.getShortDayName = function(day) { return Date.dayNames[day].substring(0, 3); }; Date.parseCodes.S.s = "(?:ste|e)"; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok: 'OK', cancel: 'Annuleren', yes: 'Ja', no: 'Nee' }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if (!v) return ''; if (!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || 'j-m-y'); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText: 'Vandaag', minText: 'Deze datum is eerder dan de minimale datum', maxText: 'Deze datum is later dan de maximale datum', disabledDaysText: '', disabledDatesText: '', monthNames: Date.monthNames, dayNames: Date.dayNames, nextText: 'Volgende maand (Ctrl+rechts)', prevText: 'Vorige maand (Ctrl+links)', monthYearText: 'Kies een maand (Ctrl+omhoog/omlaag volgend/vorig jaar)', todayTip: '{0} (spatie)', format: 'j-m-y', okText: ' OK ', cancelText: 'Annuleren', startDay: 1 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText: 'Pagina', afterPageText: 'van {0}', firstText: 'Eerste pagina', prevText: 'Vorige pagina', nextText: 'Volgende pagina', lastText: 'Laatste pagina', refreshText: 'Ververs', displayMsg: 'Getoond {0} - {1} van {2}', emptyMsg: 'Geen gegevens om weer te geven' }); } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = 'De waarde van dit veld is ongeldig'; } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText: 'De minimale lengte van dit veld is {0}', maxLengthText: 'De maximale lengte van dit veld is {0}', blankText: 'Dit veld is verplicht', regexText: '', emptyText: null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { decimalSeparator : ",", decimalPrecision : 2, minText: 'De minimale waarde van dit veld is {0}', maxText: 'De maximale waarde van dit veld is {0}', nanText: '{0} is geen geldig getal' }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText: 'Uitgeschakeld', disabledDatesText: 'Uitgeschakeld', minText: 'De datum in dit veld moet na {0} liggen', maxText: 'De datum in dit veld moet voor {0} liggen', invalidText: '{0} is geen geldige datum - formaat voor datum is {1}', format: 'j-m-y', altFormats: 'd/m/Y|d-m-y|d-m-Y|d/m|d-m|dm|dmy|dmY|d|Y-m-d', startDay: 1 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText: 'Bezig met laden...', valueNotFoundText: undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText: 'Dit veld moet een e-mail adres bevatten in het formaat "gebruiker@domein.nl"', urlText: 'Dit veld moet een URL bevatten in het formaat "http:/'+'/www.domein.nl"', alphaText: 'Dit veld mag alleen letters en _ bevatten', alphanumText: 'Dit veld mag alleen letters, cijfers en _ bevatten' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText: 'Vul hier de URL voor de hyperlink in:', buttonTips: { bold: { title: 'Vet (Ctrl+B)', text: 'Maak de geselecteerde tekst vet.', cls: 'x-html-editor-tip' }, italic: { title: 'Cursief (Ctrl+I)', text: 'Maak de geselecteerde tekst cursief.', cls: 'x-html-editor-tip' }, underline: { title: 'Onderstrepen (Ctrl+U)', text: 'Onderstreep de geselecteerde tekst.', cls: 'x-html-editor-tip' }, increasefontsize: { title: 'Tekst vergroten', text: 'Vergroot het lettertype.', cls: 'x-html-editor-tip' }, decreasefontsize: { title: 'Tekst verkleinen', text: 'Verklein het lettertype.', cls: 'x-html-editor-tip' }, backcolor: { title: 'Tekst achtergrondkleur', text: 'Verander de achtergrondkleur van de geselecteerde tekst.', cls: 'x-html-editor-tip' }, forecolor: { title: 'Tekst kleur', text: 'Verander de kleur van de geselecteerde tekst.', cls: 'x-html-editor-tip' }, justifyleft: { title: 'Tekst links uitlijnen', text: 'Lijn de tekst links uit.', cls: 'x-html-editor-tip' }, justifycenter: { title: 'Tekst centreren', text: 'Centreer de tekst.', cls: 'x-html-editor-tip' }, justifyright: { title: 'Tekst rechts uitlijnen', text: 'Lijn de tekst rechts uit.', cls: 'x-html-editor-tip' }, insertunorderedlist: { title: 'Opsommingstekens', text: 'Begin een ongenummerde lijst.', cls: 'x-html-editor-tip' }, insertorderedlist: { title: 'Genummerde lijst', text: 'Begin een genummerde lijst.', cls: 'x-html-editor-tip' }, createlink: { title: 'Hyperlink', text: 'Maak van de geselecteerde tekst een hyperlink.', cls: 'x-html-editor-tip' }, sourceedit: { title: 'Bron aanpassen', text: 'Schakel modus over naar bron aanpassen.', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText: 'Sorteer oplopend', sortDescText: 'Sorteer aflopend', columnsText: 'Kolommen' }); } if(Ext.grid.GroupingView){ Ext.apply(Ext.grid.GroupingView.prototype, { emptyGroupText: '(Geen)', groupByText: 'Dit veld groeperen', showGroupsText: 'Toon in groepen' }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText: 'Naam', valueText: 'Waarde', dateFormat: 'j-m-Y' }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip: 'Sleep om grootte aan te passen.', collapsibleSplitTip: 'Sleep om grootte aan te passen. Dubbel klikken om te verbergen.' }); } if(Ext.form.TimeField){ Ext.apply(Ext.form.TimeField.prototype, { minText: 'De tijd in dit veld moet op of na {0} liggen', maxText: 'De tijd in dit veld moet op of voor {0} liggen', invalidText: '{0} is geen geldig tijdstip', format: 'G:i', altFormats: 'g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|gi|hi|gia|hia|g|H' }); } if(Ext.form.CheckboxGroup){ Ext.apply(Ext.form.CheckboxGroup.prototype, { blankText : 'Selecteer minimaal een element in deze groep' }); } if(Ext.form.RadioGroup){ Ext.apply(Ext.form.RadioGroup.prototype, { blankText : 'Selecteer een element in deze groep' }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-no_NB.js000066400000000000000000000170361226600447100220400ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * * Norwegian translation (Bokmål: no-NB) * By Tore Kjørsvik 21-January-2008 * */ Ext.UpdateManager.defaults.indicatorText = '
    Laster...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} markert(e) rad(er)"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Lukk denne fanen"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "Verdien i dette feltet er ugyldig"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Laster..."; } Date.monthNames = [ "Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember" ]; Date.getShortMonthName = function(month) { return Date.monthNames[month].substring(0, 3); }; Date.monthNumbers = { Jan : 0, Feb : 1, Mar : 2, Apr : 3, Mai : 4, Jun : 5, Jul : 6, Aug : 7, Sep : 8, Okt : 9, Nov : 10, Des : 11 }; Date.getMonthNumber = function(name) { return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()]; }; Date.dayNames = [ "Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag" ]; Date.getShortDayName = function(day) { return Date.dayNames[day].substring(0, 3); }; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "OK", cancel : "Avbryt", yes : "Ja", no : "Nei" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d.m.Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "I dag", minText : "Denne datoen er før tidligste tillatte dato", maxText : "Denne datoen er etter seneste tillatte dato", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Neste måned (Control+Pil Høyre)', prevText : 'Forrige måned (Control+Pil Venstre)', monthYearText : 'Velg en måned (Control+Pil Opp/Ned for å skifte år)', todayTip : "{0} (Mellomrom)", format : "d.m.y", okText : " OK ", cancelText : "Avbryt", startDay : 1 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Side", afterPageText : "av {0}", firstText : "Første side", prevText : "Forrige side", nextText : "Neste side", lastText : "Siste side", refreshText : "Oppdater", displayMsg : "Viser {0} - {1} av {2}", emptyMsg : 'Ingen data å vise' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "Den minste lengden for dette feltet er {0}", maxLengthText : "Den største lengden for dette feltet er {0}", blankText : "Dette feltet er påkrevd", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "Den minste verdien for dette feltet er {0}", maxText : "Den største verdien for dette feltet er {0}", nanText : "{0} er ikke et gyldig nummer" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Deaktivert", disabledDatesText : "Deaktivert", minText : "Datoen i dette feltet må være etter {0}", maxText : "Datoen i dette feltet må være før {0}", invalidText : "{0} er ikke en gyldig dato - den må være på formatet {1}", format : "d.m.y", altFormats : "d.m.Y|d/m/y|d/m/Y|d-m-y|d-m-Y|d.m|d/m|d-m|dm|dmy|dmY|Y-m-d|d", startDay : 1 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Laster...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Dette feltet skal være en epost adresse på formatet "bruker@domene.no"', urlText : 'Dette feltet skal være en link (URL) på formatet "http:/'+'/www.domene.no"', alphaText : 'Dette feltet skal kun inneholde bokstaver og _', alphanumText : 'Dette feltet skal kun inneholde bokstaver, tall og _' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'Vennligst skriv inn URL for lenken:', buttonTips : { bold : { title: 'Fet (Ctrl+B)', text: 'Gjør den valgte teksten fet.', cls: 'x-html-editor-tip' }, italic : { title: 'Kursiv (Ctrl+I)', text: 'Gjør den valgte teksten kursiv.', cls: 'x-html-editor-tip' }, underline : { title: 'Understrek (Ctrl+U)', text: 'Understrek den valgte teksten.', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'Forstørr tekst', text: 'Gjør fontstørrelse større.', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'Forminsk tekst', text: 'Gjør fontstørrelse mindre.', cls: 'x-html-editor-tip' }, backcolor : { title: 'Tekst markeringsfarge', text: 'Endre bakgrunnsfarge til den valgte teksten.', cls: 'x-html-editor-tip' }, forecolor : { title: 'Font farge', text: 'Endre farge på den valgte teksten.', cls: 'x-html-editor-tip' }, justifyleft : { title: 'Venstrejuster tekst', text: 'Venstrejuster teksten.', cls: 'x-html-editor-tip' }, justifycenter : { title: 'Sentrer tekst', text: 'Sentrer teksten.', cls: 'x-html-editor-tip' }, justifyright : { title: 'Høyrejuster tekst', text: 'Høyrejuster teksten.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'Punktliste', text: 'Start en punktliste.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'Nummerert liste', text: 'Start en nummerert liste.', cls: 'x-html-editor-tip' }, createlink : { title: 'Lenke', text: 'Gjør den valgte teksten til en lenke.', cls: 'x-html-editor-tip' }, sourceedit : { title: 'Rediger kilde', text: 'Bytt til kilderedigeringsvisning.', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Sorter stigende", sortDescText : "Sorter synkende", lockText : "Lås kolonne", unlockText : "Lås opp kolonne", columnsText : "Kolonner" }); } if(Ext.grid.GroupingView){ Ext.apply(Ext.grid.GroupingView.prototype, { emptyGroupText : '(Ingen)', groupByText : 'Grupper etter dette feltet', showGroupsText : 'Vis i grupper' }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Navn", valueText : "Verdi", dateFormat : "d.m.Y" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Dra for å endre størrelse.", collapsibleSplitTip : "Dra for å endre størrelse. Dobbelklikk for å skjule." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-no_NN.js000066400000000000000000000170231226600447100220500ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * * Norwegian translation (Nynorsk: no-NN) * By Tore Kjørsvik 21-January-2008 * */ Ext.UpdateManager.defaults.indicatorText = '
    Lastar...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} markert(e) rad(er)"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Lukk denne fana"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "Verdien i dette feltet er ugyldig"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Lastar..."; } Date.monthNames = [ "Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember" ]; Date.getShortMonthName = function(month) { return Date.monthNames[month].substring(0, 3); }; Date.monthNumbers = { Jan : 0, Feb : 1, Mar : 2, Apr : 3, Mai : 4, Jun : 5, Jul : 6, Aug : 7, Sep : 8, Okt : 9, Nov : 10, Des : 11 }; Date.getMonthNumber = function(name) { return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()]; }; Date.dayNames = [ "Søndag", "Måndag", "Tysdag", "Onsdag", "Torsdag", "Fredag", "Laurdag" ]; Date.getShortDayName = function(day) { return Date.dayNames[day].substring(0, 3); }; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "OK", cancel : "Avbryt", yes : "Ja", no : "Nei" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d.m.Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "I dag", minText : "Denne datoen er før tidlegaste tillatne dato", maxText : "Denne datoen er etter seinaste tillatne dato", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Neste månad (Control+Pil Høgre)', prevText : 'Førre månad (Control+Pil Venstre)', monthYearText : 'Velj ein månad (Control+Pil Opp/Ned for å skifte år)', todayTip : "{0} (Mellomrom)", format : "d.m.y", okText : " OK ", cancelText : "Avbryt", startDay : 1 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Side", afterPageText : "av {0}", firstText : "Første sida", prevText : "Førre sida", nextText : "Neste sida", lastText : "Siste sida", refreshText : "Oppdater", displayMsg : "Viser {0} - {1} av {2}", emptyMsg : 'Ingen data å vise' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "Den minste lengda for dette feltet er {0}", maxLengthText : "Den største lengda for dette feltet er {0}", blankText : "Dette feltet er påkravd", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "Den minste verdien for dette feltet er {0}", maxText : "Den største verdien for dette feltet er {0}", nanText : "{0} er ikkje eit gyldig nummer" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Deaktivert", disabledDatesText : "Deaktivert", minText : "Datoen i dette feltet må vere etter {0}", maxText : "Datoen i dette feltet må vere før {0}", invalidText : "{0} er ikkje ein gyldig dato - han må vere på formatet {1}", format : "d.m.y", altFormats : "d.m.Y|d/m/y|d/m/Y|d-m-y|d-m-Y|d.m|d/m|d-m|dm|dmy|dmY|Y-m-d|d", startDay : 1 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Lastar...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Dette feltet skal vere ei epost adresse på formatet "bruker@domene.no"', urlText : 'Dette feltet skal vere ein link (URL) på formatet "http:/'+'/www.domene.no"', alphaText : 'Dette feltet skal berre innehalde bokstavar og _', alphanumText : 'Dette feltet skal berre innehalde bokstavar, tal og _' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'Ver venleg og skriv inn URL for lenken:', buttonTips : { bold : { title: 'Feit (Ctrl+B)', text: 'Gjer den valde teksten feit.', cls: 'x-html-editor-tip' }, italic : { title: 'Kursiv (Ctrl+I)', text: 'Gjer den valde teksten kursiv.', cls: 'x-html-editor-tip' }, underline : { title: 'Understrek (Ctrl+U)', text: 'Understrek den valde teksten.', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'Forstørr tekst', text: 'Gjer fontstorleik større.', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'Forminsk tekst', text: 'Gjer fontstorleik mindre.', cls: 'x-html-editor-tip' }, backcolor : { title: 'Tekst markeringsfarge', text: 'Endre bakgrunnsfarge til den valde teksten.', cls: 'x-html-editor-tip' }, forecolor : { title: 'Font farge', text: 'Endre farge på den valde teksten.', cls: 'x-html-editor-tip' }, justifyleft : { title: 'Venstrejuster tekst', text: 'Venstrejuster teksten.', cls: 'x-html-editor-tip' }, justifycenter : { title: 'Sentrer tekst', text: 'Sentrer teksten.', cls: 'x-html-editor-tip' }, justifyright : { title: 'Høgrejuster tekst', text: 'Høgrejuster teksten.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'Punktliste', text: 'Start ei punktliste.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'Nummerert liste', text: 'Start ei nummerert liste.', cls: 'x-html-editor-tip' }, createlink : { title: 'Lenke', text: 'Gjer den valde teksten til ei lenke.', cls: 'x-html-editor-tip' }, sourceedit : { title: 'Rediger kjelde', text: 'Bytt til kjelderedigeringsvising.', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Sorter stigande", sortDescText : "Sorter fallande", lockText : "Lås kolonne", unlockText : "Lås opp kolonne", columnsText : "Kolonner" }); } if(Ext.grid.GroupingView){ Ext.apply(Ext.grid.GroupingView.prototype, { emptyGroupText : '(Ingen)', groupByText : 'Grupper etter dette feltet', showGroupsText : 'Vis i grupper' }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Namn", valueText : "Verdi", dateFormat : "d.m.Y" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Dra for å endre storleik.", collapsibleSplitTip : "Dra for å endre storleik. Dobbelklikk for å skjule." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-pl.js000066400000000000000000000174061226600447100214610ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * Polish Translations * By vbert 17-April-2007 * Updated by mmar 16-November-2007 * Encoding: utf-8 */ Ext.UpdateManager.defaults.indicatorText = '
    Wczytywanie danych...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} wybrano wiersze(y)"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Zamknij zakładkę"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "Wartość tego pola jest niewłaściwa"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Wczytywanie danych..."; } Date.monthNames = [ "Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień" ]; Date.getShortMonthName = function(month) { return Date.monthNames[month].substring(0, 3); }; Date.monthNumbers = { Sty : 0, Lut : 1, Mar : 2, Kwi : 3, Maj : 4, Cze : 5, Lip : 6, Sie : 7, Wrz : 8, Paź : 9, Lis : 10, Gru : 11 }; Date.getMonthNumber = function(name) { return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()]; }; Date.dayNames = [ "Niedziela", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota" ]; Date.getShortDayName = function(day) { switch(day) { case 0: return 'ndz'; case 1: return 'pon'; case 2: return 'wt'; case 3: return 'śr'; case 4: return 'czw'; case 5: return 'pt'; case 6: return 'sob'; default: return ''; } }; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "OK", cancel : "Anuluj", yes : "Tak", no : "Nie" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "Y-m-d"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Dzisiaj", minText : "Data jest wcześniejsza od daty minimalnej", maxText : "Data jest późniejsza od daty maksymalnej", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : "Następny miesiąc (Control+StrzałkaWPrawo)", prevText : "Poprzedni miesiąc (Control+StrzałkaWLewo)", monthYearText : "Wybierz miesiąc (Control+Up/Down aby zmienić rok)", todayTip : "{0} (Spacja)", format : "Y-m-d", okText : " OK ", cancelText : "Anuluj", startDay : 1 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Strona", afterPageText : "z {0}", firstText : "Pierwsza strona", prevText : "Poprzednia strona", nextText : "Następna strona", lastText : "Ostatnia strona", refreshText : "Odśwież", displayMsg : "Wyświetlono {0} - {1} z {2}", emptyMsg : "Brak danych do wyświetlenia" }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "Minimalna ilość znaków dla tego pola to {0}", maxLengthText : "Maksymalna ilość znaków dla tego pola to {0}", blankText : "To pole jest wymagane", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "Minimalna wartość dla tego pola to {0}", maxText : "Maksymalna wartość dla tego pola to {0}", nanText : "{0} to nie jest właściwa wartość" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Wyłączony", disabledDatesText : "Wyłączony", minText : "Data w tym polu musi być późniejsza od {0}", maxText : "Data w tym polu musi być wcześniejsza od {0}", invalidText : "{0} to nie jest prawidłowa data - prawidłowy format daty {1}", format : "Y-m-d", altFormats : "m/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d", startDay : 1 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Wczytuję...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'To pole wymaga podania adresu e-mail w formacie: "nazwa@domena.pl"', urlText : 'To pole wymaga podania adresu strony www w formacie: "http:/'+'/www.domena.pl"', alphaText : 'To pole wymaga podania tylko liter i _', alphanumText : 'To pole wymaga podania tylko liter, cyfr i _' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'Wprowadź adres URL strony:', buttonTips : { bold : { title: 'Pogrubienie (Ctrl+B)', text: 'Ustaw styl zaznaczonego tekstu na pogrubiony.', cls: 'x-html-editor-tip' }, italic : { title: 'Kursywa (Ctrl+I)', text: 'Ustaw styl zaznaczonego tekstu na kursywę.', cls: 'x-html-editor-tip' }, underline : { title: 'Podkreślenie (Ctrl+U)', text: 'Podkreśl zaznaczony tekst.', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'Zwiększ czcionkę', text: 'Zwiększ rozmiar czcionki.', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'Zmniejsz czcionkę', text: 'Zmniejsz rozmiar czcionki.', cls: 'x-html-editor-tip' }, backcolor : { title: 'Wyróżnienie', text: 'Zmień kolor wyróżnienia zaznaczonego tekstu.', cls: 'x-html-editor-tip' }, forecolor : { title: 'Kolor czcionki', text: 'Zmień kolor zaznaczonego tekstu.', cls: 'x-html-editor-tip' }, justifyleft : { title: 'Do lewej', text: 'Wyrównaj tekst do lewej.', cls: 'x-html-editor-tip' }, justifycenter : { title: 'Wyśrodkuj', text: 'Wyrównaj tekst do środka.', cls: 'x-html-editor-tip' }, justifyright : { title: 'Do prawej', text: 'Wyrównaj tekst do prawej.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'Lista wypunktowana', text: 'Rozpocznij listę wypunktowaną.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'Lista numerowana', text: 'Rozpocznij listę numerowaną.', cls: 'x-html-editor-tip' }, createlink : { title: 'Hiperłącze', text: 'Przekształć zaznaczony tekst w hiperłącze.', cls: 'x-html-editor-tip' }, sourceedit : { title: 'Edycja źródła', text: 'Przełącz w tryb edycji źródła.', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Sortuj rosnąco", sortDescText : "Sortuj malejąco", lockText : "Zablokuj kolumnę", unlockText : "Odblokuj kolumnę", columnsText : "Kolumny" }); } if(Ext.grid.GroupingView){ Ext.apply(Ext.grid.GroupingView.prototype, { emptyGroupText : '(None)', groupByText : 'Grupuj po tym polu', showGroupsText : 'Pokaż w grupach' }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Nazwa", valueText : "Wartość", dateFormat : "Y-m-d" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Przeciągnij aby zmienić rozmiar.", collapsibleSplitTip : "Przeciągnij aby zmienić rozmiar. Kliknij dwukrotnie aby ukryć." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-pt.js000066400000000000000000000176341226600447100214740ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /* * Portuguese/Brazil Translation by Weber Souza * 08 April 2007 * Updated by Allan Brazute Alves (EthraZa) * 06 September 2007 * Adapted to European Portuguese by Helder Batista (hbatista) * 31 January 2008 */ Ext.UpdateManager.defaults.indicatorText = '
    Carregando...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} linha(s) seleccionada(s)"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Fechar"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "O valor para este campo é inválido"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Carregando..."; } Date.monthNames = [ "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro" ]; Date.dayNames = [ "Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado" ]; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "OK", cancel : "Cancelar", yes : "Sim", no : "Não" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d/m/Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Hoje", minText : "Esta data é anterior à menor data", maxText : "Esta data é posterior à maior data", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Próximo Mês (Control+Direita)', prevText : 'Mês Anterior (Control+Esquerda)', monthYearText : 'Escolha um Mês (Control+Cima/Baixo para mover entre os anos)', todayTip : "{0} (Espaço)", format : "d/m/Y", okText : " OK ", cancelText : "Cancelar", startDay : 0 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Página", afterPageText : "de {0}", firstText : "Primeira Página", prevText : "Página Anterior", nextText : "Próxima Página", lastText : "Última Página", refreshText : "Atualizar", displayMsg : "{0} à {1} de {2} registo(s)", emptyMsg : 'Sem registos para exibir' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "O tamanho mínimo para este campo é {0}", maxLengthText : "O tamanho máximo para este campo é {0}", blankText : "Este campo é obrigatório.", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "O valor mínimo para este campo é {0}", maxText : "O valor máximo para este campo é {0}", nanText : "{0} não é um número válido" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Desabilitado", disabledDatesText : "Desabilitado", minText : "A data deste campo deve ser posterior a {0}", maxText : "A data deste campo deve ser anterior a {0}", invalidText : "{0} não é uma data válida - deve ser usado o formato {1}", format : "d/m/Y", startDay : 0 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Carregando...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Este campo deve ser um endereço de e-mail válido, no formato "utilizador@dominio.com"', urlText : 'Este campo deve ser um URL no formato "http:/'+'/www.dominio.com"', alphaText : 'Este campo deve conter apenas letras e _', alphanumText : 'Este campo deve conter apenas letras, números e _' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'Por favor, entre com o URL do link:', buttonTips : { bold : { title: 'Negrito (Ctrl+B)', text: 'Deixa o texto seleccionado em negrito.', cls: 'x-html-editor-tip' }, italic : { title: 'Italico (Ctrl+I)', text: 'Deixa o texto seleccionado em italico.', cls: 'x-html-editor-tip' }, underline : { title: 'Sublinhado (Ctrl+U)', text: 'Sublinha o texto seleccionado.', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'Aumentar Texto', text: 'Aumenta o tamanho da fonte.', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'Diminuir Texto', text: 'Diminui o tamanho da fonte.', cls: 'x-html-editor-tip' }, backcolor : { title: 'Cor de Fundo', text: 'Muda a cor do fundo do texto seleccionado.', cls: 'x-html-editor-tip' }, forecolor : { title: 'Cor da Fonte', text: 'Muda a cor do texto seleccionado.', cls: 'x-html-editor-tip' }, justifyleft : { title: 'Alinhar à Esquerda', text: 'Alinha o texto à esquerda.', cls: 'x-html-editor-tip' }, justifycenter : { title: 'Centrar Texto', text: 'Centra o texto no editor.', cls: 'x-html-editor-tip' }, justifyright : { title: 'Alinhar à Direita', text: 'Alinha o texto à direita.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'Lista com Marcadores', text: 'Inicia uma lista com marcadores.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'Lista Numerada', text: 'Inicia uma lista numerada.', cls: 'x-html-editor-tip' }, createlink : { title: 'Hyperligação', text: 'Transforma o texto selecionado num hyperlink.', cls: 'x-html-editor-tip' }, sourceedit : { title: 'Editar Fonte', text: 'Troca para o modo de edição de código fonte.', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Ordem Ascendente", sortDescText : "Ordem Descendente", lockText : "Bloquear Coluna", unlockText : "Desbloquear Coluna", columnsText : "Colunas" }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Nome", valueText : "Valor", dateFormat : "d/m/Y" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Arraste para redimensionar.", collapsibleSplitTip : "Arraste para redimensionar. Duplo clique para esconder." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-pt_BR.js000066400000000000000000000215021226600447100220440ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * Portuguese/Brazil Translation by Weber Souza * 08 April 2007 * Updated by Allan Brazute Alves (EthraZa) * 06 September 2007 * Updated by Leonardo Lima * 05 March 2008 * Updated by Juliano Tarini (jtarini) * 22 April 2008 */ Ext.UpdateManager.defaults.indicatorText = '
    Carregando...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} linha(s) selecionada(s)"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Fechar"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "O valor para este campo é inválido"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Carregando..."; } Date.monthNames = [ "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro" ]; Date.getShortMonthName = function(month) { return Date.monthNames[month].substring(0, 3); }; Date.monthNumbers = { Jan : 0, Fev : 1, Mar : 2, Abr : 3, Mai : 4, Jun : 5, Jul : 6, Ago : 7, Set : 8, Out : 9, Nov : 10, Dez : 11 }; Date.getMonthNumber = function(name) { return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()]; }; Date.dayNames = [ "Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado" ]; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "OK", cancel : "Cancelar", yes : "Sim", no : "Não" }; } if (Ext.util.Format) { Ext.util.Format.date = function(v, format){ if (!v) return ""; if (!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d/m/Y"); }; Ext.util.Format.brMoney = function(v){ v = (Math.round((v - 0) * 100)) / 100; v = (v == Math.floor(v)) ? v + ".00" : ((v * 10 == Math.floor(v * 10)) ? v + "0" : v); v = String(v); var ps = v.split('.'); var whole = ps[0]; var sub = ps[1] ? '.' + ps[1] : '.00'; var r = /(\d+)(\d{3})/; while (r.test(whole)) { whole = whole.replace(r, '$1' + '.' + '$2'); } v = whole + sub; if (v.charAt(0) == '-') { return '- R$ ' + v.substr(1); } return "R$ " + v; } } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Hoje", minText : "Esta data é anterior a menor data", maxText : "Esta data é posterior a maior data", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Próximo Mês (Control+Direita)', prevText : 'Mês Anterior (Control+Esquerda)', monthYearText : 'Escolha um Mês (Control+Cima/Baixo para mover entre os anos)', todayTip : "{0} (Espaço)", format : "d/m/Y", okText : " OK ", cancelText : "Cancelar", startDay : 0 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Página", afterPageText : "de {0}", firstText : "Primeira Página", prevText : "Página Anterior", nextText : "Próxima Página", lastText : "Última Página", refreshText : "Atualizar", displayMsg : "{0} à {1} de {2} registro(s)", emptyMsg : 'Sem registros para exibir' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "O tamanho mínimo para este campo é {0}", maxLengthText : "O tamanho máximo para este campo é {0}", blankText : "Este campo é obrigatório.", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "O valor mínimo para este campo é {0}", maxText : "O valor máximo para este campo é {0}", nanText : "{0} não é um número válido" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Desabilitado", disabledDatesText : "Desabilitado", minText : "A data deste campo deve ser posterior a {0}", maxText : "A data deste campo deve ser anterior a {0}", invalidText : "{0} não é uma data válida - deve ser informado no formato {1}", format : "d/m/Y", startDay : 0 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Carregando...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Este campo deve ser um endereço de e-mail válido, no formato "usuario@dominio.com.br"', urlText : 'Este campo deve ser uma URL no formato "http:/'+'/www.dominio.com.br"', alphaText : 'Este campo deve conter apenas letras e _', alphanumText : 'Este campo deve conter apenas letras, números e _' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'Por favor, entre com a URL do link:', buttonTips : { bold : { title: 'Negrito (Ctrl+B)', text: 'Deixa o texto selecionado em negrito.', cls: 'x-html-editor-tip' }, italic : { title: 'Itálico (Ctrl+I)', text: 'Deixa o texto selecionado em itálico.', cls: 'x-html-editor-tip' }, underline : { title: 'Sublinhado (Ctrl+U)', text: 'Sublinha o texto selecionado.', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'Aumentar Texto', text: 'Aumenta o tamanho da fonte.', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'Diminuir Texto', text: 'Diminui o tamanho da fonte.', cls: 'x-html-editor-tip' }, backcolor : { title: 'Cor de Fundo', text: 'Muda a cor do fundo do texto selecionado.', cls: 'x-html-editor-tip' }, forecolor : { title: 'Cor da Fonte', text: 'Muda a cor do texto selecionado.', cls: 'x-html-editor-tip' }, justifyleft : { title: 'Alinhar à Esquerda', text: 'Alinha o texto à esquerda.', cls: 'x-html-editor-tip' }, justifycenter : { title: 'Centralizar Texto', text: 'Centraliza o texto no editor.', cls: 'x-html-editor-tip' }, justifyright : { title: 'Alinhar à Direita', text: 'Alinha o texto à direita.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'Lista com Marcadores', text: 'Inicia uma lista com marcadores.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'Lista Numerada', text: 'Inicia uma lista numerada.', cls: 'x-html-editor-tip' }, createlink : { title: 'Link', text: 'Transforma o texto selecionado em um link.', cls: 'x-html-editor-tip' }, sourceedit : { title: 'Editar Fonte', text: 'Troca para o modo de edição de código fonte.', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Ordem Ascendente", sortDescText : "Ordem Descendente", lockText : "Bloquear Coluna", unlockText : "Desbloquear Coluna", columnsText : "Colunas" }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Nome", valueText : "Valor", dateFormat : "d/m/Y" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Arraste para redimensionar.", collapsibleSplitTip : "Arraste para redimensionar. Duplo clique para esconder." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-pt_PT.js000066400000000000000000000177021226600447100220730ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * Portuguese/Portugal (pt_PT) Translation * by Nuno Franco da Costa - francodacosta.com * translated from ext-lang-en.js */ Ext.UpdateManager.defaults.indicatorText = '
    A carregar...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} linha(s) seleccionada(s)"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Fechar aba"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "A carregar..."; } Date.monthNames = [ "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro" ]; Date.getShortMonthName = function(month) { return Date.monthNames[month].substring(0, 3); }; Date.monthNumbers = { Jan : 0, Feb : 1, Mar : 2, Apr : 3, May : 4, Jun : 5, Jul : 6, Aug : 7, Sep : 8, Oct : 9, Nov : 10, Dec : 11 }; Date.getMonthNumber = function(name) { return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()]; }; Date.dayNames = [ "Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sabado" ]; Date.getShortDayName = function(day) { return Date.dayNames[day].substring(0, 3); }; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "OK", cancel : "Cancelar", yes : "Sim", no : "Não" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "Y/m/d"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Hoje", minText : "A data é anterior ao mínimo definido", maxText : "A data é posterior ao m�ximo definido", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Mês Seguinte (Control+Right)', prevText : 'Mês Anterior (Control+Left)', monthYearText : 'Escolha um mês (Control+Up/Down avaçar/recuar anos)', todayTip : "{0} (barra de espa�o)", format : "y/m/d", okText : "*OK*", cancelText : "Cancelar", startDay : 0 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Página", afterPageText : "de {0}", firstText : "Primeira Página", prevText : "Página Anterior", nextText : "Pr%oacute;xima Página", lastText : "Última Página", refreshText : "Recaregar", displayMsg : "A mostrar {0} - {1} de {2}", emptyMsg : 'Sem dados para mostrar' }); } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "O valor deste campo é inválido"; } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "O comprimento mínimo deste campo &eaute; {0}", maxLengthText : "O comprimento máximo deste campo &eaute; {0}", blankText : "Este campo é de preenchimento obrigatório", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "O valor mínimo deste campo &eaute; {0}", maxText : "O valor máximo deste campo &eaute; {0}", nanText : "{0} não é um numero" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Desabilitado", disabledDatesText : "Desabilitado", minText : "A data deste campo deve ser posterior a {0}", maxText : "A data deste campo deve ser anterior a {0}", invalidText : "{0} não é uma data válida - deve estar no seguinte formato{1}", format : "y/m/d", altFormats : "m/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d", startDay : 0 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "A Carregar...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Este campo deve ser um endereço de email no formato "utilizador@dominio.com"', urlText : 'Este campo deve ser um URL no formato "http:/'+'/www.dominio.com"', alphaText : 'Este campo deve conter apenas letras e _', alphanumText : 'Este campo deve conter apenas letras, n@uacute;meros e _' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'Indique o endereço do link:', buttonTips : { bold : { title: 'Negrito (Ctrl+B)', text: 'Transforma o texto em Negrito.', cls: 'x-html-editor-tip' }, italic : { title: 'Itálico (Ctrl+I)', text: 'Transforma o texto em itálico.', cls: 'x-html-editor-tip' }, underline : { title: 'Sublinhar (Ctrl+U)', text: 'Sublinha o texto.', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'Aumentar texto', text: 'Aumenta o tamanho da fonte.', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'Encolher texto', text: 'Diminui o tamanho da fonte.', cls: 'x-html-editor-tip' }, backcolor : { title: 'Côr de fundo do texto', text: 'Altera a côr de fundo do texto.', cls: 'x-html-editor-tip' }, forecolor : { title: 'Côr do texo', text: 'Altera a aôr do texo.', cls: 'x-html-editor-tip' }, justifyleft : { title: 'ALinhar à esquerda', text: 'ALinha o texto à esquerda.', cls: 'x-html-editor-tip' }, justifycenter : { title: 'Centrar', text: 'Centra o texto.', cls: 'x-html-editor-tip' }, justifyright : { title: 'ALinhar à direita', text: 'ALinha o texto &agravce; direita.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'Lista', text: 'Inicia uma lista.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'Lista Numerada', text: 'Inicia uma lista numerada.', cls: 'x-html-editor-tip' }, createlink : { title: 'Hyperlink', text: 'Transforma o texto num hyperlink.', cls: 'x-html-editor-tip' }, sourceedit : { title: 'Editar código', text: 'Alterar para o modo de edição de código.', cls: 'x-html-editor-tip' } } }); } if(Ext.form.BasicForm){ Ext.form.BasicForm.prototype.waitTitle = "Por favor espere..."; } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Ordenação Crescente", sortDescText : "Ordenação Decrescente", lockText : "Fixar Coluna", unlockText : "Libertar Coluna", columnsText : "Colunas" }); } if(Ext.grid.GroupingView){ Ext.apply(Ext.grid.GroupingView.prototype, { emptyGroupText : '(Nenhum)', groupByText : 'Agrupar por este campo', showGroupsText : 'Mostrar nos Grupos' }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Nome", valueText : "Valor", dateFormat : "Y/j/m" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Arastar para redimensionar.", collapsibleSplitTip : "Arastar para redimensionar. DUplo clique para esconder" }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-ro.js000066400000000000000000000203071226600447100214600ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * Romanian translations for ExtJS 2.1 * First released by Lucian Lature on 2007-04-24 * Changed locale for Romania (date formats) as suggested by keypoint * on ExtJS forums: http://www.extjs.com/forum/showthread.php?p=129524#post129524 * Removed some useless parts * Changed by: Emil Cazamir, 2008-04-24 * Fixed some errors left behind * Changed by: Emil Cazamir, 2008-09-01 */ Ext.UpdateManager.defaults.indicatorText = '
    Încărcare...
    '; if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} rând(uri) selectate"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Închide acest tab"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "Valoarea acestui câmp este invalidă"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Încărcare..."; } Date.monthNames = [ "Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie" ]; Date.getShortMonthName = function(month) { return Date.monthNames[month].substring(0, 3); }; Date.monthNumbers = { Ian : 0, Feb : 1, Mar : 2, Apr : 3, Mai : 4, Iun : 5, Iul : 6, Aug : 7, Sep : 8, Oct : 9, Noi : 10, Dec : 11 }; Date.getMonthNumber = function(name) { return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()]; }; Date.dayNames = [ "Duminică", "Luni", "Marţi", "Miercuri", "Joi", "Vineri", "Sâmbătă" ]; Date.getShortDayName = function(day) { return Date.dayNames[day].substring(0, 3); }; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "OK", cancel : "Renunţă", yes : "Da", no : "Nu" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d.m.Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Astăzi", minText : "Această dată este anterioară datei minime", maxText : "Această dată este ulterioară datei maxime", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Luna următoare (Control+Dreapta)', prevText : 'Luna precedentă (Control+Stânga)', monthYearText : 'Alege o lună (Control+Sus/Jos pentru a parcurge anii)', todayTip : "{0} (Bara spațiu)", format : "d.m.Y", okText : " OK ", cancelText : "Renunță", startDay : 0 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Pagina", afterPageText : "din {0}", firstText : "Prima pagină", prevText : "Pagina anterioară", nextText : "Pagina următoare", lastText : "Ultima pagină", refreshText : "Împrospătează", displayMsg : "Afișare înregistrările {0} - {1} din {2}", emptyMsg : 'Nu sunt date de afișat' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "Lungimea minimă pentru acest câmp este de {0}", maxLengthText : "Lungimea maximă pentru acest câmp este {0}", blankText : "Acest câmp este obligatoriu", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "Valoarea minimă permisă a acestui câmp este {0}", maxText : "Valaorea maximă permisă a acestui câmp este {0}", nanText : "{0} nu este un număr valid" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Indisponibil", disabledDatesText : "Indisponibil", minText : "Data din această casetă trebuie să fie după {0}", maxText : "Data din această casetă trebuie să fie inainte de {0}", invalidText : "{0} nu este o dată validă, trebuie să fie în formatul {1}", format : "d.m.Y", altFormats : "d-m-Y|d.m.y|d-m-y|d.m|d-m|dm|d|Y-m-d", startDay : 0 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Încărcare...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Acest câmp trebuie să conţină o adresă de e-mail în formatul "user@domeniu.com"', urlText : 'Acest câmp trebuie să conţină o adresă URL în formatul "http:/'+'/www.domeniu.com"', alphaText : 'Acest câmp trebuie să conţină doar litere şi _', alphanumText : 'Acest câmp trebuie să conţină doar litere, cifre şi _' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'Vă rugăm introduceti un URL pentru această legătură web:', buttonTips : { bold : { title: 'Îngroşat (Ctrl+B)', text: 'Îngroşati caracterele textului selectat.', cls: 'x-html-editor-tip' }, italic : { title: 'Înclinat (Ctrl+I)', text: 'Înclinaţi caracterele textului selectat.', cls: 'x-html-editor-tip' }, underline : { title: 'Subliniat (Ctrl+U)', text: 'Subliniaţi caracterele textului selectat.', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'Mărit', text: 'Măreşte dimensiunea fontului.', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'Micşorat', text: 'Micşorează dimensiunea textului.', cls: 'x-html-editor-tip' }, backcolor : { title: 'Culoarea fundalului', text: 'Schimbă culoarea fundalului pentru textul selectat.', cls: 'x-html-editor-tip' }, forecolor : { title: 'Culoarea textului', text: 'Schimbă culoarea textului selectat.', cls: 'x-html-editor-tip' }, justifyleft : { title: 'Aliniat la stânga', text: 'Aliniază textul la stânga.', cls: 'x-html-editor-tip' }, justifycenter : { title: 'Centrat', text: 'Centrează textul în editor.', cls: 'x-html-editor-tip' }, justifyright : { title: 'Aliniat la dreapta', text: 'Aliniază textul la dreapta.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'Listă cu puncte', text: 'Inserează listă cu puncte.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'Listă numerotată', text: 'Inserează o listă numerotată.', cls: 'x-html-editor-tip' }, createlink : { title: 'Legătură web', text: 'Transformă textul selectat în legătură web.', cls: 'x-html-editor-tip' }, sourceedit : { title: 'Editare sursă', text: 'Schimbă pe modul de editare al codului HTML.', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Sortare ascendentă", sortDescText : "Sortare descendentă", lockText : "Blochează coloana", unlockText : "Deblochează coloana", columnsText : "Coloane" }); } if(Ext.grid.GroupingView){ Ext.apply(Ext.grid.GroupingView.prototype, { emptyGroupText : '(Fără)', groupByText : 'Grupează după această coloană', showGroupsText : 'Afișează grupat' }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Nume", valueText : "Valoare", dateFormat : "d.m.Y" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Trage pentru redimensionare.", collapsibleSplitTip : "Trage pentru redimensionare. Dublu-click pentru ascundere." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-ru.js000066400000000000000000000244011226600447100214650ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /* * Russian translation * By ZooKeeper (utf-8 encoding) * 6 November 2007 */ Ext.UpdateManager.defaults.indicatorText = '
    Идет загрузка...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} выбранных строк"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Закрыть эту вкладку"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "Значение в этом поле неверное"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Загрузка..."; } Date.monthNames = [ "Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь" ]; Date.shortMonthNames = [ "Янв", "Февр", "Март", "Апр", "Май", "Июнь", "Июль", "Авг", "Сент", "Окт", "Нояб", "Дек" ]; Date.getShortMonthName = function(month) { return Date.shortMonthNames[month]; }; Date.monthNumbers = { 'Янв': 0, 'Фев': 1, 'Мар': 2, 'Апр': 3, 'Май': 4, 'Июн': 5, 'Июл': 6, 'Авг': 7, 'Сен': 8, 'Окт': 9, 'Ноя': 10, 'Дек': 11 }; Date.getMonthNumber = function(name) { return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()]; }; Date.dayNames = [ "Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота" ]; Date.getShortDayName = function(day) { return Date.dayNames[day].substring(0, 3); }; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "OK", cancel : "Отмена", yes : "Да", no : "Нет" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d.m.Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Сегодня", minText : "Эта дата раньше минимальной даты", maxText : "Эта дата позже максимальной даты", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Следующий месяц (Control+Вправо)', prevText : 'Предыдущий месяц (Control+Влево)', monthYearText : 'Выбор месяца (Control+Вверх/Вниз для выбора года)', todayTip : "{0} (Пробел)", format : "d.m.y", okText : " OK ", cancelText : "Отмена", startDay : 1 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Страница", afterPageText : "из {0}", firstText : "Первая страница", prevText : "Предыдущая страница", nextText : "Следующая страница", lastText : "Последняя страница", refreshText : "Обновить", displayMsg : "Отображаются записи с {0} по {1}, всего {2}", emptyMsg : 'Нет данных для отображения' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "Минимальная длина этого поля {0}", maxLengthText : "Максимальная длина этого поля {0}", blankText : "Это поле обязательно для заполнения", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "Значение этого поля не может быть меньше {0}", maxText : "Значение этого поля не может быть больше {0}", nanText : "{0} не является числом" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Не доступно", disabledDatesText : "Не доступно", minText : "Дата в этом поле должна быть позде {0}", maxText : "Дата в этом поле должна быть раньше {0}", invalidText : "{0} не является правильной датой - дата должна быть указана в формате {1}", format : "d.m.y", altFormats : "d.m.y|d/m/Y|d-m-y|d-m-Y|d/m|d-m|dm|dmy|dmY|d|Y-m-d", startDay : 1 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Загрузка...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Это поле должно содержать адрес электронной почты в формате "user@example.com"', urlText : 'Это поле должно содержать URL в формате "http:/'+'/www.example.com"', alphaText : 'Это поле должно содержать только латинские буквы и символ подчеркивания "_"', alphanumText : 'Это поле должно содержать только латинские буквы, цифры и символ подчеркивания "_"' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'Пожалуйста введите адрес:', buttonTips : { bold : { title: 'Полужирный (Ctrl+B)', text: 'Применение полужирного начертания к выделенному тексту.', cls: 'x-html-editor-tip' }, italic : { title: 'Курсив (Ctrl+I)', text: 'Применение курсивного начертания к выделенному тексту.', cls: 'x-html-editor-tip' }, underline : { title: 'Подчёркнутый (Ctrl+U)', text: 'Подчёркивание выделенного текста.', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'Увеличить размер', text: 'Увеличение размера шрифта.', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'Уменьшить размер', text: 'Уменьшение размера шрифта.', cls: 'x-html-editor-tip' }, backcolor : { title: 'Заливка', text: 'Изменение цвета фона для выделенного текста или абзаца.', cls: 'x-html-editor-tip' }, forecolor : { title: 'Цвет текста', text: 'Измение цвета текста.', cls: 'x-html-editor-tip' }, justifyleft : { title: 'Выровнять текст по левому краю', text: 'Выровнивание текста по левому краю.', cls: 'x-html-editor-tip' }, justifycenter : { title: 'По центру', text: 'Выровнивание текста по центру.', cls: 'x-html-editor-tip' }, justifyright : { title: 'Выровнять текст по правому краю', text: 'Выровнивание текста по правому краю.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'Маркеры', text: 'Начать маркированный список.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'Нумерация', text: 'Начать нумернованный список.', cls: 'x-html-editor-tip' }, createlink : { title: 'Вставить гиперссылку', text: 'Создание ссылки из выделенного текста.', cls: 'x-html-editor-tip' }, sourceedit : { title: 'Исходный код', text: 'Переключиться на исходный код.', cls: 'x-html-editor-tip' } } }); } if(Ext.form.BasicForm){ Ext.form.BasicForm.prototype.waitTitle = "Пожалуйста подождите..."; } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Сортировать по возрастанию", sortDescText : "Сортировать по убыванию", lockText : "Закрепить столбец", unlockText : "Снять закрепление столбца", columnsText : "Столбцы" }); } if(Ext.grid.GroupingView){ Ext.apply(Ext.grid.GroupingView.prototype, { emptyGroupText : '(Пусто)', groupByText : 'Группировать по этому полю', showGroupsText : 'Отображать по группам' }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Название", valueText : "Значение", dateFormat : "d.m.Y" }); } if(Ext.SplitLayoutRegion){ Ext.apply(Ext.SplitLayoutRegion.prototype, { splitTip : "Тяните для изменения размера.", collapsibleSplitTip : "Тяните для изменения размера. Двойной щелчок спрячет панель." }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Тяните для изменения размера.", collapsibleSplitTip : "Тяните для изменения размера. Двойной щелчок спрячет панель." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-sk.js000066400000000000000000000114061226600447100214550ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * List compiled by mystix on the extjs.com forums. * Thank you Mystix! */ /* Slovak Translation by Michal Thomka * 14 April 2007 */ Ext.UpdateManager.defaults.indicatorText = '
    Nahrávam...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} označených riadkov"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Zavrieť túto záložku"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "Hodnota v tomto poli je nesprávna"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Nahrávam..."; } Date.monthNames = [ "Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December" ]; Date.dayNames = [ "Nedeľa", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatok", "Sobota" ]; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "OK", cancel : "Zrušiť", yes : "Áno", no : "Nie" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d.m.Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Dnes", minText : "Tento dátum je menší ako minimálny možný dátum", maxText : "Tento dátum je väčší ako maximálny možný dátum", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Ďalší Mesiac (Control+Doprava)', prevText : 'Predch. Mesiac (Control+Doľava)', monthYearText : 'Vyberte Mesiac (Control+Hore/Dole pre posun rokov)', todayTip : "{0} (Medzerník)", format : "d.m.Y" }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Strana", afterPageText : "z {0}", firstText : "Prvá Strana", prevText : "Predch. Strana", nextText : "Ďalšia Strana", lastText : "Posledná strana", refreshText : "Obnoviť", displayMsg : "Zobrazujem {0} - {1} z {2}", emptyMsg : 'Žiadne dáta' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "Minimálna dĺžka pre toto pole je {0}", maxLengthText : "Maximálna dĺžka pre toto pole je {0}", blankText : "Toto pole je povinné", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "Minimálna hodnota pre toto pole je {0}", maxText : "Maximálna hodnota pre toto pole je {0}", nanText : "{0} je nesprávne číslo" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Zablokované", disabledDatesText : "Zablokované", minText : "Dátum v tomto poli musí byť až po {0}", maxText : "Dátum v tomto poli musí byť pred {0}", invalidText : "{0} nie je správny dátum - musí byť vo formáte {1}", format : "d.m.Y" }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Nahrávam...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Toto pole musí byť e-mailová adresa vo formáte "user@example.com"', urlText : 'Toto pole musí byť URL vo formáte "http:/'+'/www.example.com"', alphaText : 'Toto pole može obsahovať iba písmená a znak _', alphanumText : 'Toto pole može obsahovať iba písmená, čísla a znak _' }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Zoradiť vzostupne", sortDescText : "Zoradiť zostupne", lockText : "Zamknúť stľpec", unlockText : "Odomknúť stľpec", columnsText : "Stľpce" }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Názov", valueText : "Hodnota", dateFormat : "d.m.Y" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Potiahnite pre zmenu rozmeru", collapsibleSplitTip : "Potiahnite pre zmenu rozmeru. Dvojklikom schováte." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-sl.js000066400000000000000000000110711226600447100214540ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * Slovenian translation by Matjaž (UTF-8 encoding) * 25 April 2007 */ Ext.UpdateManager.defaults.indicatorText = '
    Nalagam...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} izbranih vrstic"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Zapri zavihek"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "Neveljavna vrednost"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Nalagam..."; } Date.monthNames = [ "Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December" ]; Date.dayNames = [ "Nedelja", "Ponedeljek", "Torek", "Sreda", "Četrtek", "Petek", "Sobota" ]; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "V redu", cancel : "Prekliči", yes : "Da", no : "Ne" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d.m.Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Danes", minText : "Navedeni datum je pred spodnjim datumom", maxText : "Navedeni datum je za zgornjim datumom", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Naslednji mesec (Control+Desno)', prevText : 'Prejšnji mesec (Control+Levo)', monthYearText : 'Izberite mesec (Control+Gor/Dol za premik let)', todayTip : "{0} (Preslednica)", format : "d.m.y", startDay : 1 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Stran", afterPageText : "od {0}", firstText : "Prva stran", prevText : "Prejšnja stran", nextText : "Naslednja stran", lastText : "Zadnja stran", refreshText : "Osveži", displayMsg : "Prikazujem {0} - {1} od {2}", emptyMsg : 'Ni podatkov za prikaz' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "Minimalna dolžina tega polja je {0}", maxLengthText : "Maksimalna dolžina tega polja je {0}", blankText : "To polje je obvezno", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "Minimalna vrednost tega polja je {0}", maxText : "Maksimalna vrednost tega polja je {0}", nanText : "{0} ni veljavna številka" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Onemogočen", disabledDatesText : "Onemogočen", minText : "Datum mora biti po {0}", maxText : "Datum mora biti pred {0}", invalidText : "{0} ni veljaven datum - mora biti v tem formatu {1}", format : "d.m.y", startDay : 1 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Nalagam...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'To polje je e-mail naslov formata "ime@domena.si"', urlText : 'To polje je URL naslov formata "http:/'+'/www.domena.si"', alphaText : 'To polje lahko vsebuje samo črke in _', alphanumText : 'To polje lahko vsebuje samo črke, številke in _' }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Sortiraj naraščajoče", sortDescText : "Sortiraj padajoče", lockText : "Zakleni stolpec", unlockText : "Odkleni stolpec", columnsText : "Stolpci" }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Ime", valueText : "Vrednost", dateFormat : "j.m.Y" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Potegni za razširitev.", collapsibleSplitTip : "Potegni za razširitev. Dvojni klik, če želite skriti." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-sr.js000066400000000000000000000114701226600447100214650ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /* * Serbian Latin Translation * by Atila Hajnal (latin, utf8 encoding) * sr * 14 Sep 2007 */ Ext.UpdateManager.defaults.indicatorText = '
    Učitavam...
    '; if(Ext.View){ Ext.View.prototype.emptyText = "Ne postoji ni jedan slog"; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} izabranih redova"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Zatvori оvu »karticu«"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "Unešena vrednost nije pravilna"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Učitavam..."; } Date.monthNames = [ "Januar", "Februar", "Mart", "April", "Мај", "Jun", "Јul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar" ]; Date.dayNames = [ "Nedelja", "Ponedeljak", "Utorak", "Sreda", "Četvrtak", "Petak", "Subota" ]; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "U redu", cancel : "Odustani", yes : "Da", no : "Ne" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d.m.Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Danas", minText : "Datum је ispred najmanjeg dozvoljenog datuma", maxText : "Datum је nakon najvećeg dozvoljenog datuma", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Sledeći mesec (Control+Desno)', prevText : 'Prethodni mesec (Control+Levo)', monthYearText : 'Izaberite mesec (Control+Gore/Dole za izbor godine)', todayTip : "{0} (Razmaknica)", format : "d.m.y", startDay : 1 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Strana", afterPageText : "od {0}", firstText : "Prva strana", prevText : "Prethodna strana", nextText : "Sledeća strana", lastText : "Poslednja strana", refreshText : "Osveži", displayMsg : "Prikazana {0} - {1} od {2}", emptyMsg : 'Nemam šta prikazati' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "Minimalna dužina ovog polja је {0}", maxLengthText : "Maksimalna dužina ovog polja је {0}", blankText : "Polje је obavezno", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "Minimalna vrednost u polju је {0}", maxText : "Maksimalna vrednost u polju је {0}", nanText : "{0} nije pravilan broj" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Pasivno", disabledDatesText : "Pasivno", minText : "Datum u ovom polju mora biti nakon {0}", maxText : "Datum u ovom polju mora biti pre {0}", invalidText : "{0} nije pravilan datum - zahtevani oblik je {1}", format : "d.m.y", altFormats : "d.m.y|d/m/Y|d-m-y|d-m-Y|d/m|d-m|dm|dmy|dmY|d|Y-m-d", startDay : 1 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Učitavam...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Ovo polje prihavata e-mail adresu isključivo u obliku "korisnik@domen.com"', urlText : 'Ovo polje prihavata URL adresu isključivo u obliku "http:/'+'/www.domen.com"', alphaText : 'Ovo polje može sadržati isključivo slova i znak _', alphanumText : 'Ovo polje može sadržati само slova, brojeve i znak _' }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Rastući redosled", sortDescText : "Opadajući redosled", lockText : "Zaključaj kolonu", unlockText : "Otključaj kolonu", columnsText : "Kolone" }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Naziv", valueText : "Vrednost", dateFormat : "d.m.Y" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Povući za izmenu veličine.", collapsibleSplitTip : "Povući za izmenu veličine. Dvostruku klik za sakrivanje." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-sr_RS.js000066400000000000000000000132271226600447100220730ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /* * Serbian Cyrillic Translation * by Čolovic Vladan (cyrillic, utf8 encoding) * sr_RS (ex: sr_CS, sr_YU) * 12 May 2007 */ Ext.UpdateManager.defaults.indicatorText = '
    Учитавам...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} изабраних редова"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Затвори ову »картицу«"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "Унешена вредност није правилна"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Учитавам..."; } Date.monthNames = [ "Јануар", "Фебруар", "Март", "Април", "Мај", "Јун", "Јул", "Август", "Септембар", "Октобар", "Новембар", "Децембар" ]; Date.dayNames = [ "Недеља", "Понедељак", "Уторак", "Среда", "Четвртак", "Петак", "Субота" ]; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "У реду", cancel : "Одустани", yes : "Да", no : "Не" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d.m.Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Данас", minText : "Датум је испред најмањег дозвољеног датума", maxText : "Датум је након највећег дозвољеног датума", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Следећи месец (Control+Десно)', prevText : 'Претходни месец (Control+Лево)', monthYearText : 'Изаберите месец (Control+Горе/Доле за избор године)', todayTip : "{0} (Размакница)", format : "d.m.y", startDay : 1 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Страна", afterPageText : "од {0}", firstText : "Прва страна", prevText : "Претходна страна", nextText : "Следећа страна", lastText : "Последња страна", refreshText : "Освежи", displayMsg : "Приказана {0} - {1} од {2}", emptyMsg : 'Немам шта приказати' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "Минимална дужина овог поља је {0}", maxLengthText : "Максимална дужина овог поља је {0}", blankText : "Поље је обавезно", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "Минимална вредност у пољу је {0}", maxText : "Максимална вредност у пољу је {0}", nanText : "{0} није правилан број" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Пасивно", disabledDatesText : "Пасивно", minText : "Датум у овом пољу мора бити након {0}", maxText : "Датум у овом пољу мора бити пре {0}", invalidText : "{0} није правилан датум - захтевани облик је {1}", format : "d.m.y", startDay : 1 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Учитавам...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Ово поље прихвата e-mail адресу искључиво у облику "korisnik@domen.com"', urlText : 'Ово поље прихвата URL адресу искључиво у облику "http:/'+'/www.domen.com"', alphaText : 'Ово поље може садржати искључиво слова и знак _', alphanumText : 'Ово поље може садржати само слова, бројеве и знак _' }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Растући редослед", sortDescText : "Опадајући редослед", lockText : "Закључај колону", unlockText : "Откључај колону", columnsText : "Колоне" }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Назив", valueText : "Вредност", dateFormat : "d.m.Y" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Повући за измену величине.", collapsibleSplitTip : "Повући за измену величине. Двоструки клик за сакривање." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-sv_SE.js000066400000000000000000000116171226600447100220630ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * Swedish translation (utf8-encoding) * By Erik Andersson, Monator Technologies * 24 April 2007 * Changed by Cariad, 29 July 2007 */ Ext.UpdateManager.defaults.indicatorText = '
    Laddar...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} markerade rad(er)"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Stäng denna flik"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "Värdet i detta fält är inte tillåtet"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Laddar..."; } Date.monthNames = [ "januari", "februari", "mars", "april", "maj", "juni", "juli", "augusti", "september", "oktober", "november", "december" ]; Date.dayNames = [ "söndag", "måndag", "tisdag", "onsdag", "torsdag", "fredag", "lördag" ]; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "OK", cancel : "Avbryt", yes : "Ja", no : "Nej" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "Y-m-d"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Idag", minText : "Detta datum inträffar före det tidigast tillåtna", maxText : "Detta datum inträffar efter det senast tillåtna", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Nästa månad (Ctrl + högerpil)', prevText : 'Föregående månad (Ctrl + vänsterpil)', monthYearText : 'Välj en månad (Ctrl + uppåtpil/neråtpil för att ändra årtal)', todayTip : "{0} (mellanslag)", format : "Y-m-d", startDay : 1 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Sida", afterPageText : "av {0}", firstText : "Första sidan", prevText : "Föregående sida", nextText : "Nästa sida", lastText : "Sista sidan", refreshText : "Uppdatera", displayMsg : "Visar {0} - {1} av {2}", emptyMsg : 'Det finns ingen data att visa' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "Minsta tillåtna längd för detta fält är {0}", maxLengthText : "Största tillåtna längd för detta fält är {0}", blankText : "Detta fält är obligatoriskt", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "Minsta tillåtna värde för detta fält är {0}", maxText : "Största tillåtna värde för detta fält är {0}", nanText : "{0} är inte ett tillåtet nummer" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Inaktiverad", disabledDatesText : "Inaktiverad", minText : "Datumet i detta fält måste inträffa efter {0}", maxText : "Datumet i detta fält måste inträffa före {0}", invalidText : "{0} är inte ett tillåtet datum - datum ska anges i formatet {1}", format : "Y-m-d", startDay : 1 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Laddar...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Detta fält ska innehålla en e-post adress i formatet "användare@domän.se"', urlText : 'Detta fält ska innehålla en länk (URL) i formatet "http:/'+'/www.domän.se"', alphaText : 'Detta fält får bara innehålla bokstäver och "_"', alphanumText : 'Detta fält får bara innehålla bokstäver, nummer och "_"' }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Sortera stigande", sortDescText : "Sortera fallande", lockText : "Lås kolumn", unlockText : "Lås upp kolumn", columnsText : "Kolumner" }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Namn", valueText : "Värde", dateFormat : "Y-m-d" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Dra för att ändra storleken.", collapsibleSplitTip : "Dra för att ändra storleken. Dubbelklicka för att gömma." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-th.js000066400000000000000000000174301226600447100214560ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * List compiled by KillerNay on the extjs.com forums. * Thank you KillerNay! * * Thailand Translations */ Ext.UpdateManager.defaults.indicatorText = '
    ¡ÓÅѧâËÅŽ...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} àÅ×Í¡áÅéÇ·Ñé§ËÁŽá¶Ç"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "»ÔŽá·çº¹Õé"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "€èҢͧªèͧ¹ÕéäÁè¶Ù¡µéͧ"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "¡ÓÅѧâËÅŽ..."; } Date.monthNames = [ "Á¡ÃÒ€Á", "¡ØÁŸÒӟѹžì", "ÁÕ¹Ò€Á", "àÁÉÒ¹", "ŸÄÉÀÒ€Á", "ÁԶعÒ¹", "¡Ä¡¯Ò€Á", "ÊÔ§ËÒ€Á", "¡Ñ¹ÂÒ¹", "µØÅÒ€Á", "ŸÄÈšÔ¡Ò¹", "žÑ¹ÇÒ€Á" ]; Date.getShortMonthName = function(month) { return Date.monthNames[month].substring(0, 3); }; Date.monthNumbers = { "Á€" : 0, "¡Ÿ" : 1, "ÁÕ€" : 2, "àÁÂ" : 3, "Ÿ€" : 4, "ÁÔÂ" : 5, "¡€" : 6, "Ê€" : 7, "¡Â" : 8, "µ€" : 9, "ŸÂ" : 10, "ž€" : 11 }; Date.getMonthNumber = function(name) { return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()]; }; Date.dayNames = [ "ÍÒ·ÔµÂì", "šÑ¹·Ãì", "Íѧ€ÒÃ", "ŸØ×ž", "ŸÄËÑʺŽÕ", "ÈØ¡Ãì", "àÊÒÃì" ]; Date.getShortDayName = function(day) { return Date.dayNames[day].substring(0, 3); }; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "µ¡Å§", cancel : "¡àÅÔ¡", yes : "ãªè", no : "äÁèãªè" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "m/d/Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Çѹ¹Õé", minText : "This date is before the minimum date", maxText : "This date is after the maximum date", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'àŽ×͹¶ÑŽä» (Control+Right)', prevText : 'àŽ×͹¡è͹˹éÒ (Control+Left)', monthYearText : 'àÅ×Í¡àŽ×͹ (Control+Up/Down to move years)', todayTip : "{0} (Spacebar)", format : "m/d/y", okText : " µ¡Å§ ", cancelText : "¡àÅÔ¡", startDay : 0 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "˹éÒ", afterPageText : "of {0}", firstText : "˹éÒáá", prevText : "¡è͹˹éÒ", nextText : "¶ÑŽä»", lastText : "˹éÒÊØŽ·éÒÂ", refreshText : "ÃÕà¿Ãª", displayMsg : "¡ÓÅѧáÊŽ§ {0} - {1} šÒ¡ {2}", emptyMsg : 'äÁèÁÕ¢éÍÁÙÅáÊŽ§' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "The minimum length for this field is {0}", maxLengthText : "The maximum length for this field is {0}", blankText : "This field is required", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "The minimum value for this field is {0}", maxText : "The maximum value for this field is {0}", nanText : "{0} is not a valid number" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "»ÔŽ", disabledDatesText : "»ÔŽ", minText : "The date in this field must be after {0}", maxText : "The date in this field must be before {0}", invalidText : "{0} is not a valid date - it must be in the format {1}", format : "m/d/y", altFormats : "m/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d", startDay : 0 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "¡ÓÅѧâËÅŽ...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'This field should be an e-mail address in the format "user@example.com"', urlText : 'This field should be a URL in the format "http:/'+'/www.example.com"', alphaText : 'This field should only contain letters and _', alphanumText : 'This field should only contain letters, numbers and _' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'Please enter the URL for the link:', buttonTips : { bold : { title: 'Bold (Ctrl+B)', text: 'Make the selected text bold.', cls: 'x-html-editor-tip' }, italic : { title: 'Italic (Ctrl+I)', text: 'Make the selected text italic.', cls: 'x-html-editor-tip' }, underline : { title: 'Underline (Ctrl+U)', text: 'Underline the selected text.', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'Grow Text', text: 'Increase the font size.', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'Shrink Text', text: 'Decrease the font size.', cls: 'x-html-editor-tip' }, backcolor : { title: 'Text Highlight Color', text: 'Change the background color of the selected text.', cls: 'x-html-editor-tip' }, forecolor : { title: 'Font Color', text: 'Change the color of the selected text.', cls: 'x-html-editor-tip' }, justifyleft : { title: 'Align Text Left', text: 'Align text to the left.', cls: 'x-html-editor-tip' }, justifycenter : { title: 'Center Text', text: 'Center text in the editor.', cls: 'x-html-editor-tip' }, justifyright : { title: 'Align Text Right', text: 'Align text to the right.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'Bullet List', text: 'Start a bulleted list.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'Numbered List', text: 'Start a numbered list.', cls: 'x-html-editor-tip' }, createlink : { title: 'Hyperlink', text: 'Make the selected text a hyperlink.', cls: 'x-html-editor-tip' }, sourceedit : { title: 'Source Edit', text: 'Switch to source editing mode.', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Sort Ascending", sortDescText : "Sort Descending", lockText : "Lock Column", unlockText : "Unlock Column", columnsText : "Columns" }); } if(Ext.grid.GroupingView){ Ext.apply(Ext.grid.GroupingView.prototype, { emptyGroupText : '(None)', groupByText : 'Group By This Field', showGroupsText : 'Show in Groups' }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Name", valueText : "Value", dateFormat : "m/j/Y" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Drag to resize.", collapsibleSplitTip : "Drag to resize. Double click to hide." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-tr.js000066400000000000000000000176351226600447100214770ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * List compiled by mystix on the extjs.com forums. * Thank you Mystix! * * Turkish translation by Alper YAZGAN * 2008-01-24, 10:29 AM * * Updated to 2.2 by YargicX * 2008-10-05, 06:22 PM */ Ext.UpdateManager.defaults.indicatorText = '
    Yükleniyor ...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.Grid){ Ext.grid.Grid.prototype.ddText = "Seçili satýr sayýsý : {0}"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Sekmeyi kapat"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "Bu alandaki deðer geçersiz"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Yükleniyor ..."; } Date.monthNames = [ "Ocak", "Þžubat", "Mart", "Nisan", "Mayýs", "Haziran", "Temmuz", "Aðustos", "Eylül", "Ekim", "Kasým", "Aralýk" ]; Date.getShortMonthName = function(month) { return Date.monthNames[month].substring(0, 3); }; Date.monthNumbers = { Jan : 0, Feb : 1, Mar : 2, Apr : 3, May : 4, Jun : 5, Jul : 6, Aug : 7, Sep : 8, Oct : 9, Nov : 10, Dec : 11 }; Date.getMonthNumber = function(name) { return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()]; }; Date.dayNames = [ "Pazar", "Pazartesi", "Salý", "LJarþŸamba", "PerþŸembe", "Cuma", "Cumartesi" ]; Date.shortDayNames = [ "Paz", "Pzt", "Sal", "ÇrþŸ", "Prþ", "Cum", "Cmt" ]; Date.getShortDayName = function(day) { return Date.shortDayNames[day]; }; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "Tamam", cancel : "İptal", yes : "Evet", no : "Hayýr" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d/m/Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Bugün", minText : "Bu tarih izin verilen en küçük tarihten daha önce", maxText : "Bu tarih izin verilen en büyük tarihten daha sonra", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Gelecek Ay (Control+Right)', prevText : 'Önceki Ay (Control+Left)', monthYearText : 'Bir ay sŸeçiniz (Yýlý artýrmak/azaltmak için Control+Up/Down)', todayTip : "{0} (BoþŸluk TuþŸu - Spacebar)", format : "d/m/Y", okText : " Tamam ", cancelText : "İptal", startDay : 1 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Sayfa", afterPageText : " / {0}", firstText : "İlk Sayfa", prevText : "Önceki Sayfa", nextText : "Sonraki Sayfa", lastText : "Son Sayfa", refreshText : "Yenile", displayMsg : "Gösterilen {0} - {1} / {2}", emptyMsg : 'Gösterilebilecek veri yok' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "Girilen verinin uzunluðu en az {0} olabilir", maxLengthText : "Girilen verinin uzunluðu en fazla {0} olabilir", blankText : "Bu alan boþŸ býrakýlamaz", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "En az {0} girilebilir", maxText : "En çok {0} girilebilir", nanText : "{0} geçersiz bir sayýdýr" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Disabled", disabledDatesText : "Disabled", minText : "Bu tarih, {0} tarihinden daha sonra olmalýdýr", maxText : "Bu tarih, {0} tarihinden daha önce olmalýdýr", invalidText : "{0} geçersiz bir tarihdir - tarih formatý {1} þŸeklinde olmalýdýr", format : "d/m/Y", altFormats : "d.m.y|d.m.Y|d/m/y|d-m-Y|d-m-y|d.m|d/m|d-m|dm|dmY|dmy|d|Y.m.d|Y-m-d|Y/m/d", startDay : 1 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Yükleniyor ...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.form.VTypes["emailText"]='Bu alan "user@example.com" þŸeklinde elektronik posta formatýnda olmalýdýr'; Ext.form.VTypes["urlText"]='Bu alan "http://www.example.com" þŸeklinde URL adres formatýnda olmalýdýr'; Ext.form.VTypes["alphaText"]='Bu alan sadece harf ve _ içermeli'; Ext.form.VTypes["alphanumText"]='Bu alan sadece harf, sayý ve _ içermeli'; } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'Lütfen bu baðlantý için gerekli URL adresini giriniz:', buttonTips : { bold : { title: 'Kalýn(Bold) (Ctrl+B)', text: 'Þžeçili yazýyý kalýn yapar.', cls: 'x-html-editor-tip' }, italic : { title: 'İtalik(Italic) (Ctrl+I)', text: 'Þžeçili yazýyý italik yapar.', cls: 'x-html-editor-tip' }, underline : { title: 'Alt Çizgi(Underline) (Ctrl+U)', text: 'Þžeçili yazýnýn altýný çizer.', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'Fontu büyült', text: 'Yazý fontunu büyütür.', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'Fontu küçült', text: 'Yazý fontunu küçültür.', cls: 'x-html-editor-tip' }, backcolor : { title: 'Arka Plan Rengi', text: 'Seçili yazýnýn arka plan rengini deðiþŸtir.', cls: 'x-html-editor-tip' }, forecolor : { title: 'Yazý Rengi', text: 'Seçili yazýnýn rengini deðiþŸtir.', cls: 'x-html-editor-tip' }, justifyleft : { title: 'Sola Daya', text: 'Yazýyý sola daya.', cls: 'x-html-editor-tip' }, justifycenter : { title: 'Ortala', text: 'Yazýyý editörde ortala.', cls: 'x-html-editor-tip' }, justifyright : { title: 'Saða daya', text: 'Yazýyý saða daya.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'Noktalý Liste', text: 'Noktalý listeye baþŸla.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'Numaralý Liste', text: 'Numaralý lisyeye baþŸla.', cls: 'x-html-editor-tip' }, createlink : { title: 'Web Adresi(Hyperlink)', text: 'Seçili yazýyý web adresi(hyperlink) yap.', cls: 'x-html-editor-tip' }, sourceedit : { title: 'Kaynak kodu Düzenleme', text: 'Kaynak kodu düzenleme moduna geç.', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Artan sýrada sýrala", sortDescText : "Azalan sýrada sýrala", lockText : "Kolonu kilitle", unlockText : "Kolon kilidini kaldýr", columnsText : "Kolonlar" }); } if(Ext.grid.GroupingView){ Ext.apply(Ext.grid.GroupingView.prototype, { emptyGroupText : '(Yok)', groupByText : 'Bu Alana Göre Grupla', showGroupsText : 'Gruplar Halinde Göster' }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Ad", valueText : "Deðer", dateFormat : "d/m/Y" }); } if(Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Yeniden boyutlandýrmak için sürükle.", collapsibleSplitTip : "Yeniden boyutlandýrmak için sürükle. Saklamak için çift týkla." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-ukr.js000066400000000000000000000227521226600447100216470ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /* * Ukrainian translations for ExtJS (UTF-8 encoding) * * Original translation by zlatko * 3 October 2007 * * Updated by dev.ashevchuk@gmail.com * 01.09.2009 */ Ext.UpdateManager.defaults.indicatorText = '
    Завантаження...
    '; if(Ext.View){ Ext.View.prototype.emptyText = "<Порожньо>"; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} обраних рядків"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Закрити цю вкладку"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "Хибне значення"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Завантаження..."; } Date.monthNames = [ "Січень", "Лютий", "Березень", "Квітень", "Травень", "Червень", "Липень", "Серпень", "Вересень", "Жовтень", "Листопад", "Грудень" ]; Date.dayNames = [ "Неділя", "Понеділок", "Вівторок", "Середа", "Четвер", "П’ятниця", "Субота" ]; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "OK", cancel : "Відміна", yes : "Так", no : "Ні" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d.m.Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Сьогодні", minText : "Ця дата меньша за мінімальну допустиму дату", maxText : "Ця дата більша за максимальну допустиму дату", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Наступний місяць (Control+Вправо)', prevText : 'Попередній місяць (Control+Вліво)', monthYearText : 'Вибір місяця (Control+Вверх/Вниз для вибору року)', todayTip : "{0} (Пробіл)", format : "d.m.y", okText : " OK ", cancelText : "Відміна", startDay : 1 }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Сторінка", afterPageText : "з {0}", firstText : "Перша сторінка", prevText : "Попередня сторінка", nextText : "Наступна сторінка", lastText : "Остання сторінка", refreshText : "Освіжити", displayMsg : "Відображення записів з {0} по {1}, всього {2}", emptyMsg : 'Дані для відображення відсутні' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "Мінімальна довжина цього поля {0}", maxLengthText : "Максимальна довжина цього поля {0}", blankText : "Це поле є обов’язковим для заповнення", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "Значення у цьому полі не може бути меньше {0}", maxText : "Значення у цьому полі не може бути більше {0}", nanText : "{0} не є числом" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Не доступно", disabledDatesText : "Не доступно", minText : "Дата у цьому полі повинна бути більша {0}", maxText : "Дата у цьому полі повинна бути меньша {0}", invalidText : "{0} хибна дата - дата повинна бути вказана у форматі {1}", format : "d.m.y", startDay : 1 }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Завантаження...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Це поле повинно містити адресу електронної пошти у форматі "user@example.com"', urlText : 'Це поле повинно містити URL у форматі "http:/'+'/www.example.com"', alphaText : 'Це поле повинно містити виключно латинські літери та символ підкреслення "_"', alphanumText : 'Це поле повинно містити виключно латинські літери, цифри та символ підкреслення "_"' }); } if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : 'Будь-ласка введіть адресу:', buttonTips : { bold : { title: 'Напівжирний (Ctrl+B)', text: 'Зробити напівжирним виділений текст.', cls: 'x-html-editor-tip' }, italic : { title: 'Курсив (Ctrl+I)', text: 'Зробити курсивом виділений текст.', cls: 'x-html-editor-tip' }, underline : { title: 'Підкреслений (Ctrl+U)', text: 'Зробити підкресленим виділений текст.', cls: 'x-html-editor-tip' }, increasefontsize : { title: 'Збільшити розмір', text: 'Збільшити розмір шрифта.', cls: 'x-html-editor-tip' }, decreasefontsize : { title: 'Зменьшити розмір', text: 'Зменьшити розмір шрифта.', cls: 'x-html-editor-tip' }, backcolor : { title: 'Заливка', text: 'Змінити колір фону для виділеного тексту або абзацу.', cls: 'x-html-editor-tip' }, forecolor : { title: 'Колір тексту', text: 'Змінити колір виділеного тексту або абзацу.', cls: 'x-html-editor-tip' }, justifyleft : { title: 'Вирівняти текст по лівому полю', text: 'Вирівнювання тексту по лівому полю.', cls: 'x-html-editor-tip' }, justifycenter : { title: 'Вирівняти текст по центру', text: 'Вирівнювання тексту по центру.', cls: 'x-html-editor-tip' }, justifyright : { title: 'Вирівняти текст по правому полю', text: 'Вирівнювання тексту по правому полю.', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: 'Маркери', text: 'Почати маркований список.', cls: 'x-html-editor-tip' }, insertorderedlist : { title: 'Нумерація', text: 'Почати нумернований список.', cls: 'x-html-editor-tip' }, createlink : { title: 'Вставити гіперпосилання', text: 'Створення посилання із виділеного тексту.', cls: 'x-html-editor-tip' }, sourceedit : { title: 'Джерельний код', text: 'Режим редагування джерельного коду.', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Сортувати по зростанню", sortDescText : "Сортувати по спаданню", lockText : "Закріпити стовпець", unlockText : "Відкріпити стовпець", columnsText : "Стовпці" }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Назва", valueText : "Значення", dateFormat : "j.m.Y" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Тягніть для зміни розміру.", collapsibleSplitTip : "Тягніть для зміни розміру. Подвійний клік сховає панель." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-vn.js000066400000000000000000000120701226600447100214610ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * List compiled by mystix on the extjs.com forums. * Thank you Mystix! */ /** * Vietnamese translation * By bpmtri * 12-April-2007 04:06PM */ Ext.UpdateManager.defaults.indicatorText = '
    Đang tải...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} dòng được chọn"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Đóng thẻ này"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "Giá trị của ô này không hợp lệ."; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Đang tải..."; } Date.monthNames = [ "Tháng 1", "Tháng 2", "Tháng 3", "Tháng 4", "Tháng 5", "Tháng 6", "Tháng 7", "Tháng 8", "Tháng 9", "Tháng 10", "Tháng 11", "Tháng 12" ]; Date.dayNames = [ "Chủ nhật", "Thứ hai", "Thứ ba", "Thứ tư", "Thứ năm", "Thứ sáu", "Thứ bảy" ]; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "Đồng ý", cancel : "Hủy bỏ", yes : "Có", no : "Không" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "d/m/Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Hôm nay", minText : "Ngày này nhỏ hơn ngày nhỏ nhất", maxText : "Ngày này lớn hơn ngày lớn nhất", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Tháng sau (Control+Right)', prevText : 'Tháng trước (Control+Left)', monthYearText : 'Chọn một tháng (Control+Up/Down để thay đổi năm)', todayTip : "{0} (Spacebar - Phím trắng)", format : "d/m/y" }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Trang", afterPageText : "of {0}", firstText : "Trang đầu", prevText : "Trang trước", nextText : "Trang sau", lastText : "Trang cuối", refreshText : "Tải lại", displayMsg : "Hiển thị {0} - {1} của {2}", emptyMsg : 'Không có dữ liệu để hiển thị' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "Chiều dài tối thiểu của ô này là {0}", maxLengthText : "Chiều dài tối đa của ô này là {0}", blankText : "Ô này cần phải nhập giá trị", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "Giá trị nhỏ nhất của ô này là {0}", maxText : "Giá trị lớn nhất của ô này là {0}", nanText : "{0} hông phải là một số hợp lệ" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Vô hiệu", disabledDatesText : "Vô hiệu", minText : "Ngày nhập trong ô này phải sau ngày {0}", maxText : "Ngày nhập trong ô này phải trước ngày {0}", invalidText : "{0} không phải là một ngày hợp lệ - phải có dạng {1}", format : "d/m/y" }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Đang tải...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Giá trị của ô này phải là một địa chỉ email có dạng như "ten@abc.com"', urlText : 'Giá trị của ô này phải là một địa chỉ web(URL) hợp lệ, có dạng như "http:/'+'/www.example.com"', alphaText : 'Ô này chỉ được nhập các kí tự và gạch dưới(_)', alphanumText : 'Ô này chỉ được nhập các kí tự, số và gạch dưới(_)' }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Tăng dần", sortDescText : "Giảm dần", lockText : "Khóa cột", unlockText : "Bỏ khóa cột", columnsText : "Các cột" }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Tên", valueText : "Giá trị", dateFormat : "j/m/Y" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Kéo giữ chuột để thay đổi kích thước.", collapsibleSplitTip : "Kéo giữ chuột để thay đổi kích thước. Nhấp đúp để ẩn đi." }); } glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-zh_CN.js000066400000000000000000000157401226600447100220460ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /* * Simplified Chinese translation * By DavidHu * 09 April 2007 * * update by andy_ghg * 2009-10-22 15:00:57 */ Ext.UpdateManager.defaults.indicatorText = '
    加载中...
    '; if(Ext.DataView){ Ext.DataView.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "选择了 {0} 行"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "关闭此标签"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "输入值非法"; } if (Ext.LoadMask) { Ext.LoadMask.prototype.msg = "读取中..."; } Date.monthNames = [ "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月" ]; Date.dayNames = [ "日", "一", "二", "三", "四", "五", "六" ]; Date.formatCodes.a = "(this.getHours() < 12 ? '上午' : '下午')"; Date.formatCodes.A = "(this.getHours() < 12 ? '上午' : '下午')"; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "确定", cancel : "取消", yes : "是", no : "否" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "y年m月d日"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "今天", minText : "日期必须大于最小允许日期",//update maxText : "日期必须小于最大允许日期",//update disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : '下个月 (Ctrl+Right)', prevText : '上个月 (Ctrl+Left)', monthYearText : '选择一个月 (Control+Up/Down 来改变年份)',//update todayTip : "{0} (空格键选择)", format : "y年m月d日", okText : "确定", cancelText : "取消" }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "第",//update afterPageText : "页,共 {0} 页",//update firstText : "第一页", prevText : "上一页",//update nextText : "下一页", lastText : "最后页", refreshText : "刷新", displayMsg : "显示 {0} - {1}条,共 {2} 条",//update emptyMsg : '没有数据' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "该输入项的最小长度是 {0} 个字符", maxLengthText : "该输入项的最大长度是 {0} 个字符", blankText : "该输入项为必输项", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "该输入项的最小值是 {0}", maxText : "该输入项的最大值是 {0}", nanText : "{0} 不是有效数值" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "禁用", disabledDatesText : "禁用", minText : "该输入项的日期必须在 {0} 之后", maxText : "该输入项的日期必须在 {0} 之前", invalidText : "{0} 是无效的日期 - 必须符合格式: {1}", format : "y年m月d日" }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "加载中...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : '该输入项必须是电子邮件地址,格式如: "user@example.com"', urlText : '该输入项必须是URL地址,格式如: "http:/'+'/www.example.com"', alphaText : '该输入项只能包含半角字母和_',//update alphanumText : '该输入项只能包含半角字母,数字和_'//update }); } //add HTMLEditor's tips by andy_ghg if(Ext.form.HtmlEditor){ Ext.apply(Ext.form.HtmlEditor.prototype, { createLinkText : '添加超级链接:', buttonTips : { bold : { title: '粗体 (Ctrl+B)', text: '将选中的文字设置为粗体', cls: 'x-html-editor-tip' }, italic : { title: '斜体 (Ctrl+I)', text: '将选中的文字设置为斜体', cls: 'x-html-editor-tip' }, underline : { title: '下划线 (Ctrl+U)', text: '给所选文字加下划线', cls: 'x-html-editor-tip' }, increasefontsize : { title: '增大字体', text: '增大字号', cls: 'x-html-editor-tip' }, decreasefontsize : { title: '缩小字体', text: '减小字号', cls: 'x-html-editor-tip' }, backcolor : { title: '以不同颜色突出显示文本', text: '使文字看上去像是用荧光笔做了标记一样', cls: 'x-html-editor-tip' }, forecolor : { title: '字体颜色', text: '更改字体颜色', cls: 'x-html-editor-tip' }, justifyleft : { title: '左对齐', text: '将文字左对齐', cls: 'x-html-editor-tip' }, justifycenter : { title: '居中', text: '将文字居中对齐', cls: 'x-html-editor-tip' }, justifyright : { title: '右对齐', text: '将文字右对齐', cls: 'x-html-editor-tip' }, insertunorderedlist : { title: '项目符号', text: '开始创建项目符号列表', cls: 'x-html-editor-tip' }, insertorderedlist : { title: '编号', text: '开始创建编号列表', cls: 'x-html-editor-tip' }, createlink : { title: '转成超级链接', text: '将所选文本转换成超级链接', cls: 'x-html-editor-tip' }, sourceedit : { title: '代码视图', text: '以代码的形式展现文本', cls: 'x-html-editor-tip' } } }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "正序",//update sortDescText : "倒序",//update lockText : "锁定列",//update unlockText : "解除锁定",//update columnsText : "列" }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "名称", valueText : "值", dateFormat : "y年m月d日" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "拖动来改变尺寸.", collapsibleSplitTip : "拖动来改变尺寸. 双击隐藏." }); }glpi-0.84.3+dfsg.1/lib/extjs/locale/ext-lang-zh_TW.js000066400000000000000000000113511226600447100220720ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /* * Traditional Chinese translation * By hata1234 * 09 April 2007 */ Ext.UpdateManager.defaults.indicatorText = '
    讀取中...
    '; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "選擇了 {0} 行"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "關閉此標籤"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "數值不符合欄位規定"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "讀取中..."; } Date.monthNames = [ "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月" ]; Date.dayNames = [ "日", "一", "二", "三", "四", "五", "六" ]; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "確定", cancel : "取消", yes : "是", no : "否" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "Y/m/d"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "今天", minText : "日期必須大於最小容許日期", maxText : "日期必須小於最大容許日期", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : "下個月 (Ctrl+右方向鍵)", prevText : "上個月 (Ctrl+左方向鍵)", monthYearText : "選擇月份 (Ctrl+上/下方向鍵選擇年份)", todayTip : "{0} (空白鍵)", format : "y/m/d", okText : "确定", cancelText : "取消" }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "第", afterPageText : "頁,共{0}頁", firstText : "第一頁", prevText : "上一頁", nextText : "下一頁", lastText : "最後頁", refreshText : "重新整理", displayMsg : "顯示{0} - {1}筆,共{2}筆", emptyMsg : '沒有任何資料' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "此欄位最少要輸入 {0} 個字", maxLengthText : "此欄位最多輸入 {0} 個字", blankText : "此欄位為必填", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "此欄位之數值必須大於 {0}", maxText : "此欄位之數值必須小於 {0}", nanText : "{0} 不是合法的數字" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "無法使用", disabledDatesText : "無法使用", minText : "此欄位之日期必須在 {0} 之後", maxText : "此欄位之日期必須在 {0} 之前", invalidText : "{0} 不是正確的日期格式 - 必須像是 「 {1} 」 這樣的格式", format : "Y/m/d" }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "讀取中 ...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : '此欄位必須輸入像 "user@example.com" 之E-Mail格式', urlText : '此欄位必須輸入像 "http:/'+'/www.example.com" 之網址格式', alphaText : '此欄位僅能輸入半形英文字母及底線( _ )符號', alphanumText : '此欄位僅能輸入半形英文字母、數字及底線( _ )符號' }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "正向排序", sortDescText : "反向排序", lockText : "鎖定欄位", unlockText : "解開欄位鎖定", columnsText : "欄位" }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "名稱", valueText : "數值", dateFormat : "Y/m/d" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "拖曳縮放大小.", collapsibleSplitTip : "拖曳縮放大小. 滑鼠雙擊隱藏." }); } glpi-0.84.3+dfsg.1/lib/extjs/resources/000077500000000000000000000000001226600447100175365ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/extjs/resources/css/000077500000000000000000000000001226600447100203265ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/extjs/resources/css/README.txt000066400000000000000000000005601226600447100220250ustar00rootroot000000000000002010-03-16 jwr: The CSS file, yourtheme.css, is an exact copy of xtheme-blue.css. Feel free to edit the images inside the yourtheme image directory to build your custom theme--just remember to update your background-image file paths in yourtheme.css. 2006-11-21 jvs: ext-all.css contains all of the other css files combined and stripped of comments (except themes). glpi-0.84.3+dfsg.1/lib/extjs/resources/css/debug.css000066400000000000000000000016251226600447100221320ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ #x-debug-browser .x-tree .x-tree-node a span { padding-top:2px; line-height:18px; } #x-debug-browser .x-tool-toggle { background-position:0 -75px; } #x-debug-browser .x-tool-toggle-over { background-position:-15px -75px; } #x-debug-browser.x-panel-collapsed .x-tool-toggle { background-position:0 -60px; } #x-debug-browser.x-panel-collapsed .x-tool-toggle-over { background-position:-15px -60px; }#x-debug-browser .x-tree .x-tree-node a span { color:#222297; font-size:11px; font-family:"monotype","courier new",sans-serif; } #x-debug-browser .x-tree a i { color:#ff4545; font-style:normal; } #x-debug-browser .x-tree a em { color:#999; } #x-debug-browser .x-tree .x-tree-node .x-tree-selected a span{ background-color:#c3daf9; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/ext-all-notheme.css000066400000000000000000003045611226600447100240540ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ html,body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td{margin:0;padding:0;}img,body,html{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}ol,ul {list-style:none;}caption,th {text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;}q:before,q:after{content:'';} .ext-forced-border-box, .ext-forced-border-box * { -moz-box-sizing: border-box; -ms-box-sizing: border-box; -webkit-box-sizing: border-box; } .ext-el-mask { z-index: 100; position: absolute; top:0; left:0; -moz-opacity: 0.5; opacity: .50; filter: alpha(opacity=50); width: 100%; height: 100%; zoom: 1; } .ext-el-mask-msg { z-index: 20001; position: absolute; top: 0; left: 0; border:1px solid; background:repeat-x 0 -16px; padding:2px; } .ext-el-mask-msg div { padding:5px 10px 5px 10px; border:1px solid; cursor:wait; } .ext-shim { position:absolute; visibility:hidden; left:0; top:0; overflow:hidden; } .ext-ie .ext-shim { filter: alpha(opacity=0); } .ext-ie6 .ext-shim { margin-left: 5px; margin-top: 3px; } .x-mask-loading div { padding:5px 10px 5px 25px; background:no-repeat 5px 5px; line-height:16px; } /* class for hiding elements without using display:none */ .x-hidden, .x-hide-offsets { position:absolute !important; left:-10000px; top:-10000px; visibility:hidden; } .x-hide-display { display:none !important; } .x-hide-nosize, .x-hide-nosize * /* Emulate display:none for children */ { height:0px!important; width:0px!important; visibility:hidden!important; border:none!important; zoom:1; } .x-hide-visibility { visibility:hidden !important; } .x-masked { overflow: hidden !important; } .x-masked-relative { position: relative !important; } .x-masked select, .x-masked object, .x-masked embed { visibility: hidden; } .x-layer { visibility: hidden; } .x-unselectable, .x-unselectable * { -moz-user-select: none; -khtml-user-select: none; -webkit-user-select:ignore; } .x-repaint { zoom: 1; background-color: transparent; -moz-outline: none; outline: none; } .x-item-disabled { cursor: default; opacity: .6; -moz-opacity: .6; filter: alpha(opacity=60); } .x-item-disabled * { cursor: default !important; } .x-form-radio-group .x-item-disabled { filter: none; } .x-splitbar-proxy { position: absolute; visibility: hidden; z-index: 20001; zoom: 1; line-height: 1px; font-size: 1px; overflow: hidden; } .x-splitbar-h, .x-splitbar-proxy-h { cursor: e-resize; cursor: col-resize; } .x-splitbar-v, .x-splitbar-proxy-v { cursor: s-resize; cursor: row-resize; } .x-color-palette { width: 150px; height: 92px; cursor: pointer; } .x-color-palette a { border: 1px solid; float: left; padding: 2px; text-decoration: none; -moz-outline: 0 none; outline: 0 none; cursor: pointer; } .x-color-palette a:hover, .x-color-palette a.x-color-palette-sel { border: 1px solid; } .x-color-palette em { display: block; border: 1px solid; } .x-color-palette em span { cursor: pointer; display: block; height: 10px; line-height: 10px; width: 10px; } .x-ie-shadow { display: none; position: absolute; overflow: hidden; left:0; top:0; zoom:1; } .x-shadow { display: none; position: absolute; overflow: hidden; left:0; top:0; } .x-shadow * { overflow: hidden; } .x-shadow * { padding: 0; border: 0; margin: 0; clear: none; zoom: 1; } /* top bottom */ .x-shadow .xstc, .x-shadow .xsbc { height: 6px; float: left; } /* corners */ .x-shadow .xstl, .x-shadow .xstr, .x-shadow .xsbl, .x-shadow .xsbr { width: 6px; height: 6px; float: left; } /* sides */ .x-shadow .xsc { width: 100%; } .x-shadow .xsml, .x-shadow .xsmr { width: 6px; float: left; height: 100%; } .x-shadow .xsmc { float: left; height: 100%; background-color: transparent; } .x-shadow .xst, .x-shadow .xsb { height: 6px; overflow: hidden; width: 100%; } .x-shadow .xsml { background: transparent repeat-y 0 0; } .x-shadow .xsmr { background: transparent repeat-y -6px 0; } .x-shadow .xstl { background: transparent no-repeat 0 0; } .x-shadow .xstc { background: transparent repeat-x 0 -30px; } .x-shadow .xstr { background: transparent repeat-x 0 -18px; } .x-shadow .xsbl { background: transparent no-repeat 0 -12px; } .x-shadow .xsbc { background: transparent repeat-x 0 -36px; } .x-shadow .xsbr { background: transparent repeat-x 0 -6px; } .loading-indicator { background: no-repeat left; padding-left: 20px; line-height: 16px; margin: 3px; } .x-text-resize { position: absolute; left: -1000px; top: -1000px; visibility: hidden; zoom: 1; } .x-drag-overlay { width: 100%; height: 100%; display: none; position: absolute; left: 0; top: 0; background-image:url(../images/default/s.gif); z-index: 20000; } .x-clear { clear:both; height:0; overflow:hidden; line-height:0; font-size:0; } .x-spotlight { z-index: 8999; position: absolute; top:0; left:0; -moz-opacity: 0.5; opacity: .50; filter: alpha(opacity=50); width:0; height:0; zoom: 1; } #x-history-frame { position:absolute; top:-1px; left:0; width:1px; height:1px; visibility:hidden; } #x-history-field { position:absolute; top:0; left:-1px; width:1px; height:1px; visibility:hidden; } .x-resizable-handle { position:absolute; z-index:100; /* ie needs these */ font-size:1px; line-height:6px; overflow:hidden; filter:alpha(opacity=0); opacity:0; zoom:1; } .x-resizable-handle-east{ width:6px; cursor:e-resize; right:0; top:0; height:100%; } .ext-ie .x-resizable-handle-east { margin-right:-1px; /*IE rounding error*/ } .x-resizable-handle-south{ width:100%; cursor:s-resize; left:0; bottom:0; height:6px; } .ext-ie .x-resizable-handle-south { margin-bottom:-1px; /*IE rounding error*/ } .x-resizable-handle-west{ width:6px; cursor:w-resize; left:0; top:0; height:100%; } .x-resizable-handle-north{ width:100%; cursor:n-resize; left:0; top:0; height:6px; } .x-resizable-handle-southeast{ width:6px; cursor:se-resize; right:0; bottom:0; height:6px; z-index:101; } .x-resizable-handle-northwest{ width:6px; cursor:nw-resize; left:0; top:0; height:6px; z-index:101; } .x-resizable-handle-northeast{ width:6px; cursor:ne-resize; right:0; top:0; height:6px; z-index:101; } .x-resizable-handle-southwest{ width:6px; cursor:sw-resize; left:0; bottom:0; height:6px; z-index:101; } .x-resizable-over .x-resizable-handle, .x-resizable-pinned .x-resizable-handle{ filter:alpha(opacity=100); opacity:1; } .x-resizable-over .x-resizable-handle-east, .x-resizable-pinned .x-resizable-handle-east, .x-resizable-over .x-resizable-handle-west, .x-resizable-pinned .x-resizable-handle-west { background-position: left; } .x-resizable-over .x-resizable-handle-south, .x-resizable-pinned .x-resizable-handle-south, .x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north { background-position: top; } .x-resizable-over .x-resizable-handle-southeast, .x-resizable-pinned .x-resizable-handle-southeast{ background-position: top left; } .x-resizable-over .x-resizable-handle-northwest, .x-resizable-pinned .x-resizable-handle-northwest{ background-position:bottom right; } .x-resizable-over .x-resizable-handle-northeast, .x-resizable-pinned .x-resizable-handle-northeast{ background-position: bottom left; } .x-resizable-over .x-resizable-handle-southwest, .x-resizable-pinned .x-resizable-handle-southwest{ background-position: top right; } .x-resizable-proxy{ border: 1px dashed; position:absolute; overflow:hidden; display:none; left:0; top:0; z-index:50000; } .x-resizable-overlay{ width:100%; height:100%; display:none; position:absolute; left:0; top:0; z-index:200000; -moz-opacity: 0; opacity:0; filter: alpha(opacity=0); } .x-tab-panel { overflow:hidden; } .x-tab-panel-header, .x-tab-panel-footer { border: 1px solid; overflow:hidden; zoom:1; } .x-tab-panel-header { border: 1px solid; padding-bottom: 2px; } .x-tab-panel-footer { border: 1px solid; padding-top: 2px; } .x-tab-strip-wrap { width:100%; overflow:hidden; position:relative; zoom:1; } ul.x-tab-strip { display:block; width:5000px; zoom:1; } ul.x-tab-strip-top{ padding-top: 1px; background: repeat-x bottom; border-bottom: 1px solid; } ul.x-tab-strip-bottom{ padding-bottom: 1px; background: repeat-x top; border-top: 1px solid; border-bottom: 0 none; } .x-tab-panel-header-plain .x-tab-strip-top { background:transparent !important; padding-top:0 !important; } .x-tab-panel-header-plain { background:transparent !important; border-width:0 !important; padding-bottom:0 !important; } .x-tab-panel-header-plain .x-tab-strip-spacer, .x-tab-panel-footer-plain .x-tab-strip-spacer { border:1px solid; height:2px; font-size:1px; line-height:1px; } .x-tab-panel-header-plain .x-tab-strip-spacer { border-top: 0 none; } .x-tab-panel-footer-plain .x-tab-strip-spacer { border-bottom: 0 none; } .x-tab-panel-footer-plain .x-tab-strip-bottom { background:transparent !important; padding-bottom:0 !important; } .x-tab-panel-footer-plain { background:transparent !important; border-width:0 !important; padding-top:0 !important; } .ext-border-box .x-tab-panel-header-plain .x-tab-strip-spacer, .ext-border-box .x-tab-panel-footer-plain .x-tab-strip-spacer { height:3px; } ul.x-tab-strip li { float:left; margin-left:2px; } ul.x-tab-strip li.x-tab-edge { float:left; margin:0 !important; padding:0 !important; border:0 none !important; font-size:1px !important; line-height:1px !important; overflow:hidden; zoom:1; background:transparent !important; width:1px; } .x-tab-strip a, .x-tab-strip span, .x-tab-strip em { display:block; } .x-tab-strip a { text-decoration:none !important; -moz-outline: none; outline: none; cursor:pointer; } .x-tab-strip-inner { overflow:hidden; text-overflow: ellipsis; } .x-tab-strip span.x-tab-strip-text { white-space: nowrap; cursor:pointer; padding:4px 0; } .x-tab-strip-top .x-tab-with-icon .x-tab-right { padding-left:6px; } .x-tab-strip .x-tab-with-icon span.x-tab-strip-text { padding-left:20px; background-position: 0 3px; background-repeat: no-repeat; } .x-tab-strip-active, .x-tab-strip-active a.x-tab-right { cursor:default; } .x-tab-strip-active span.x-tab-strip-text { cursor:default; } .x-tab-strip-disabled .x-tabs-text { cursor:default; } .x-tab-panel-body { overflow:hidden; } .x-tab-panel-bwrap { overflow:hidden; } .ext-ie .x-tab-strip .x-tab-right { position:relative; } .x-tab-strip-top .x-tab-strip-active .x-tab-right { margin-bottom:-1px; } /* * Horrible hack for IE8 in quirks mode */ .ext-ie8 .x-tab-strip li { position: relative; } .ext-border-box .ext-ie8 .x-tab-strip-top .x-tab-right { top: 1px; } .ext-ie8 .x-tab-strip-top { padding-top: 1; } .ext-border-box .ext-ie8 .x-tab-strip-top { padding-top: 0; } .ext-ie8 .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close { top:3px; } .ext-border-box .ext-ie8 .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close { top:4px; } .ext-ie8 .x-tab-strip-bottom .x-tab-right{ top:0; } .x-tab-strip-top .x-tab-strip-active .x-tab-right span.x-tab-strip-text { padding-bottom:5px; } .x-tab-strip-bottom .x-tab-strip-active .x-tab-right { margin-top:-1px; } .x-tab-strip-bottom .x-tab-strip-active .x-tab-right span.x-tab-strip-text { padding-top:5px; } .x-tab-strip-top .x-tab-right { background: transparent no-repeat 0 -51px; padding-left:10px; } .x-tab-strip-top .x-tab-left { background: transparent no-repeat right -351px; padding-right:10px; } .x-tab-strip-top .x-tab-strip-inner { background: transparent repeat-x 0 -201px; } .x-tab-strip-top .x-tab-strip-over .x-tab-right { background-position:0 -101px; } .x-tab-strip-top .x-tab-strip-over .x-tab-left { background-position:right -401px; } .x-tab-strip-top .x-tab-strip-over .x-tab-strip-inner { background-position:0 -251px; } .x-tab-strip-top .x-tab-strip-active .x-tab-right { background-position: 0 0; } .x-tab-strip-top .x-tab-strip-active .x-tab-left { background-position: right -301px; } .x-tab-strip-top .x-tab-strip-active .x-tab-strip-inner { background-position: 0 -151px; } .x-tab-strip-bottom .x-tab-right { background: no-repeat bottom right; } .x-tab-strip-bottom .x-tab-left { background: no-repeat bottom left; } .x-tab-strip-bottom .x-tab-strip-active .x-tab-right { background: no-repeat bottom right; } .x-tab-strip-bottom .x-tab-strip-active .x-tab-left { background: no-repeat bottom left; } .x-tab-strip-bottom .x-tab-left { margin-right: 3px; padding:0 10px; } .x-tab-strip-bottom .x-tab-right { padding:0; } .x-tab-strip .x-tab-strip-close { display:none; } .x-tab-strip-closable { position:relative; } .x-tab-strip-closable .x-tab-left { padding-right:19px; } .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close { opacity:.6; -moz-opacity:.6; background-repeat:no-repeat; display:block; width:11px; height:11px; position:absolute; top:3px; right:3px; cursor:pointer; z-index:2; } .x-tab-strip .x-tab-strip-active a.x-tab-strip-close { opacity:.8; -moz-opacity:.8; } .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close:hover{ opacity:1; -moz-opacity:1; } .x-tab-panel-body { border: 1px solid; } .x-tab-panel-body-top { border-top: 0 none; } .x-tab-panel-body-bottom { border-bottom: 0 none; } .x-tab-scroller-left { background: transparent no-repeat -18px 0; border-bottom: 1px solid; width:18px; position:absolute; left:0; top:0; z-index:10; cursor:pointer; } .x-tab-scroller-left-over { background-position: 0 0; } .x-tab-scroller-left-disabled { background-position: -18px 0; opacity:.5; -moz-opacity:.5; filter:alpha(opacity=50); cursor:default; } .x-tab-scroller-right { background: transparent no-repeat 0 0; border-bottom: 1px solid; width:18px; position:absolute; right:0; top:0; z-index:10; cursor:pointer; } .x-tab-scroller-right-over { background-position: -18px 0; } .x-tab-scroller-right-disabled { background-position: 0 0; opacity:.5; -moz-opacity:.5; filter:alpha(opacity=50); cursor:default; } .x-tab-scrolling-bottom .x-tab-scroller-left, .x-tab-scrolling-bottom .x-tab-scroller-right{ margin-top: 1px; } .x-tab-scrolling .x-tab-strip-wrap { margin-left:18px; margin-right:18px; } .x-tab-scrolling { position:relative; } .x-tab-panel-bbar .x-toolbar { border:1px solid; border-top:0 none; overflow:hidden; padding:2px; } .x-tab-panel-tbar .x-toolbar { border:1px solid; border-top:0 none; overflow:hidden; padding:2px; }/* all fields */ .x-form-field{ margin: 0 0 0 0; } .ext-webkit *:focus{ outline: none !important; } /* ---- text fields ---- */ .x-form-text, textarea.x-form-field{ padding:1px 3px; background:repeat-x 0 0; border:1px solid; } textarea.x-form-field { padding:2px 3px; } .x-form-text, .ext-ie .x-form-file { height:22px; line-height:18px; vertical-align:middle; } .ext-ie6 .x-form-text, .ext-ie7 .x-form-text { margin:-1px 0; /* ie bogus margin bug */ height:22px; /* ie quirks */ line-height:18px; } .x-quirks .ext-ie9 .x-form-text { height: 22px; padding-top: 3px; padding-bottom: 0px; } /* Ugly hacks for the bogus 1px margin bug in IE9 quirks */ .x-quirks .ext-ie9 .x-input-wrapper .x-form-text, .x-quirks .ext-ie9 .x-form-field-trigger-wrap .x-form-text { margin-top: -1px; margin-bottom: -1px; } .x-quirks .ext-ie9 .x-input-wrapper .x-form-element { margin-bottom: -1px; } .ext-ie6 .x-form-field-wrap .x-form-file-btn, .ext-ie7 .x-form-field-wrap .x-form-file-btn { top: -1px; /* because of all these margin hacks, these buttons are off by one pixel in IE6,7 */ } .ext-ie6 textarea.x-form-field, .ext-ie7 textarea.x-form-field { margin:-1px 0; /* ie bogus margin bug */ } .ext-strict .x-form-text { height:18px; } .ext-safari.ext-mac textarea.x-form-field { margin-bottom:-2px; /* another bogus margin bug, safari/mac only */ } /* .ext-strict .ext-ie8 .x-form-text, .ext-strict .ext-ie8 textarea.x-form-field { margin-bottom: 1px; } */ .ext-gecko .x-form-text , .ext-ie8 .x-form-text { padding-top:2px; /* FF won't center the text vertically */ padding-bottom:0; } .ext-ie6 .x-form-composite .x-form-text.x-box-item, .ext-ie7 .x-form-composite .x-form-text.x-box-item { margin: 0 !important; /* clear ie bogus margin bug fix */ } textarea { resize: none; /* Disable browser resizable textarea */ } /* select boxes */ .x-form-select-one { height:20px; line-height:18px; vertical-align:middle; border: 1px solid; } /* multi select boxes */ /* --- TODO --- */ /* 2.0.2 style */ .x-form-check-wrap { line-height:18px; height: auto; } .ext-ie .x-form-check-wrap input { width:15px; height:15px; } .x-form-check-wrap input{ vertical-align: bottom; } .x-editor .x-form-check-wrap { padding:3px; } .x-editor .x-form-checkbox { height:13px; } .x-form-check-group-label { border-bottom: 1px solid; margin-bottom: 5px; padding-left: 3px !important; float: none !important; } /* wrapped fields and triggers */ .x-form-field-wrap .x-form-trigger{ width:17px; height:21px; border:0; background:transparent no-repeat 0 0; cursor:pointer; border-bottom: 1px solid; position:absolute; top:0; } .x-form-field-wrap .x-form-date-trigger, .x-form-field-wrap .x-form-clear-trigger, .x-form-field-wrap .x-form-search-trigger{ cursor:pointer; } .x-form-field-wrap .x-form-twin-triggers .x-form-trigger{ position:static; top:auto; vertical-align:top; } .x-form-field-wrap { position:relative; left:0;top:0; text-align: left; zoom:1; white-space: nowrap; } .ext-strict .ext-ie8 .x-toolbar-cell .x-form-field-trigger-wrap .x-form-trigger { right: 0; /* IE8 Strict mode trigger bug */ } .x-form-field-wrap .x-form-trigger-over{ background-position:-17px 0; } .x-form-field-wrap .x-form-trigger-click{ background-position:-34px 0; } .x-trigger-wrap-focus .x-form-trigger{ background-position:-51px 0; } .x-trigger-wrap-focus .x-form-trigger-over{ background-position:-68px 0; } .x-trigger-wrap-focus .x-form-trigger-click{ background-position:-85px 0; } .x-trigger-wrap-focus .x-form-trigger{ border-bottom: 1px solid; } .x-item-disabled .x-form-trigger-over{ background-position:0 0 !important; border-bottom: 1px solid; } .x-item-disabled .x-form-trigger-click{ background-position:0 0 !important; border-bottom: 1px solid; } .x-trigger-noedit{ cursor:pointer; } /* field focus style */ .x-form-focus, textarea.x-form-focus{ border: 1px solid; } /* invalid fields */ .x-form-invalid, textarea.x-form-invalid{ background:repeat-x bottom; border: 1px solid; } .x-form-inner-invalid, textarea.x-form-inner-invalid{ background:repeat-x bottom; } /* editors */ .x-editor { visibility:hidden; padding:0; margin:0; } .x-form-grow-sizer { left: -10000px; padding: 8px 3px; position: absolute; visibility:hidden; top: -10000px; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word; zoom:1; } .x-form-grow-sizer p { margin:0 !important; border:0 none !important; padding:0 !important; } /* Form Items CSS */ .x-form-item { display:block; margin-bottom:4px; zoom:1; } .x-form-item label.x-form-item-label { display:block; float:left; width:100px; padding:3px; padding-left:0; clear:left; z-index:2; position:relative; } .x-form-element { padding-left:105px; position:relative; } .x-form-invalid-msg { padding:2px; padding-left:18px; background: transparent no-repeat 0 2px; line-height:16px; width:200px; } .x-form-label-left label.x-form-item-label { text-align:left; } .x-form-label-right label.x-form-item-label { text-align:right; } .x-form-label-top .x-form-item label.x-form-item-label { width:auto; float:none; clear:none; display:inline; margin-bottom:4px; position:static; } .x-form-label-top .x-form-element { padding-left:0; padding-top:4px; } .x-form-label-top .x-form-item { padding-bottom:4px; } /* Editor small font for grid, toolbar and tree */ .x-small-editor .x-form-text { height:20px; line-height:16px; vertical-align:middle; } .ext-ie6 .x-small-editor .x-form-text, .ext-ie7 .x-small-editor .x-form-text { margin-top:-1px !important; /* ie bogus margin bug */ margin-bottom:-1px !important; height:20px !important; /* ie quirks */ line-height:16px !important; } .ext-strict .x-small-editor .x-form-text { height:16px !important; } .ext-ie6 .x-small-editor .x-form-text, .ext-ie7 .x-small-editor .x-form-text { height:20px; line-height:16px; } .ext-border-box .x-small-editor .x-form-text { height:20px; } .x-small-editor .x-form-select-one { height:20px; line-height:16px; vertical-align:middle; } .x-small-editor .x-form-num-field { text-align:right; } .x-small-editor .x-form-field-wrap .x-form-trigger{ height:19px; } .ext-webkit .x-small-editor .x-form-text{padding-top:3px;font-size:100%;} .ext-strict .ext-webkit .x-small-editor .x-form-text{ height:14px !important; } .x-form-clear { clear:both; height:0; overflow:hidden; line-height:0; font-size:0; } .x-form-clear-left { clear:left; height:0; overflow:hidden; line-height:0; font-size:0; } .ext-ie6 .x-form-check-wrap input, .ext-border-box .x-form-check-wrap input{ margin-top: 3px; } .x-form-cb-label { position: relative; margin-left:4px; top: 2px; } .ext-ie .x-form-cb-label{ top: 1px; } .ext-ie6 .x-form-cb-label, .ext-border-box .x-form-cb-label{ top: 3px; } .x-form-display-field{ padding-top: 2px; } .ext-gecko .x-form-display-field, .ext-strict .ext-ie7 .x-form-display-field{ padding-top: 1px; } .ext-ie .x-form-display-field{ padding-top: 3px; } .ext-strict .ext-ie8 .x-form-display-field{ padding-top: 0; } .x-form-column { float:left; padding:0; margin:0; width:48%; overflow:hidden; zoom:1; } /* buttons */ .x-form .x-form-btns-ct .x-btn{ float:right; clear:none; } .x-form .x-form-btns-ct .x-form-btns td { border:0; padding:0; } .x-form .x-form-btns-ct .x-form-btns-right table{ float:right; clear:none; } .x-form .x-form-btns-ct .x-form-btns-left table{ float:left; clear:none; } .x-form .x-form-btns-ct .x-form-btns-center{ text-align:center; /*ie*/ } .x-form .x-form-btns-ct .x-form-btns-center table{ margin:0 auto; /*everyone else*/ } .x-form .x-form-btns-ct table td.x-form-btn-td{ padding:3px; } .x-form .x-form-btns-ct .x-btn-focus .x-btn-left{ background-position:0 -147px; } .x-form .x-form-btns-ct .x-btn-focus .x-btn-right{ background-position:0 -168px; } .x-form .x-form-btns-ct .x-btn-focus .x-btn-center{ background-position:0 -189px; } .x-form .x-form-btns-ct .x-btn-click .x-btn-center{ background-position:0 -126px; } .x-form .x-form-btns-ct .x-btn-click .x-btn-right{ background-position:0 -84px; } .x-form .x-form-btns-ct .x-btn-click .x-btn-left{ background-position:0 -63px; } .x-form-invalid-icon { width:16px; height:18px; visibility:hidden; position:absolute; left:0; top:0; display:block; background:transparent no-repeat 0 2px; } /* fieldsets */ .x-fieldset { border:1px solid; padding:10px; margin-bottom:10px; display:block; /* preserve margins in IE */ } /* make top of checkbox/tools visible in webkit */ .ext-webkit .x-fieldset-header { padding-top: 1px; } .ext-ie .x-fieldset legend { margin-bottom:10px; } .ext-strict .ext-ie9 .x-fieldset legend.x-fieldset-header { padding-top: 1px; } .ext-ie .x-fieldset { padding-top: 0; padding-bottom:10px; } .x-fieldset legend .x-tool-toggle { margin-right:3px; margin-left:0; float:left !important; } .x-fieldset legend input { margin-right:3px; float:left !important; height:13px; width:13px; } fieldset.x-panel-collapsed { padding-bottom:0 !important; border-width: 1px 1px 0 1px !important; border-left-color: transparent; border-right-color: transparent; } .ext-ie6 fieldset.x-panel-collapsed{ padding-bottom:0 !important; border-width: 1px 0 0 0 !important; margin-left: 1px; margin-right: 1px; } fieldset.x-panel-collapsed .x-fieldset-bwrap { visibility:hidden; position:absolute; left:-1000px; top:-1000px; } .ext-ie .x-fieldset-bwrap { zoom:1; } .x-fieldset-noborder { border:0px none transparent; } .x-fieldset-noborder legend { margin-left:-3px; } /* IE legend positioning bug */ .ext-ie .x-fieldset-noborder legend { position: relative; margin-bottom:23px; } .ext-ie .x-fieldset-noborder legend span { position: absolute; left:16px; } .ext-gecko .x-window-body .x-form-item { -moz-outline: none; outline: none; overflow: auto; } .ext-mac.ext-gecko .x-window-body .x-form-item { overflow:hidden; } .ext-gecko .x-form-item { -moz-outline: none; outline: none; } .x-hide-label label.x-form-item-label { display:none; } .x-hide-label .x-form-element { padding-left: 0 !important; } .x-form-label-top .x-hide-label label.x-form-item-label{ display: none; } .x-fieldset { overflow:hidden; } .x-fieldset-bwrap { overflow:hidden; zoom:1; } .x-fieldset-body { overflow:hidden; } .x-btn{ cursor:pointer; white-space: nowrap; } .x-btn button{ border:0 none; background-color:transparent; padding-left:3px; padding-right:3px; cursor:pointer; margin:0; overflow:visible; width:auto; -moz-outline:0 none; outline:0 none; } * html .ext-ie .x-btn button { width:1px; } .ext-gecko .x-btn button, .ext-webkit .x-btn button { padding-left:0; padding-right:0; } .ext-gecko .x-btn button::-moz-focus-inner { padding:0; } .ext-ie .x-btn button { padding-top:2px; } .x-btn td { padding:0 !important; } .x-btn-text { cursor:pointer; white-space: nowrap; padding:0; } /* icon placement and sizing styles */ /* Only text */ .x-btn-noicon .x-btn-small .x-btn-text{ height: 16px; } .x-btn-noicon .x-btn-medium .x-btn-text{ height: 24px; } .x-btn-noicon .x-btn-large .x-btn-text{ height: 32px; } /* Only icons */ .x-btn-icon .x-btn-text{ background-position: center; background-repeat: no-repeat; } .x-btn-icon .x-btn-small .x-btn-text{ height: 16px; width: 16px; } .x-btn-icon .x-btn-medium .x-btn-text{ height: 24px; width: 24px; } .x-btn-icon .x-btn-large .x-btn-text{ height: 32px; width: 32px; } /* Icons and text */ /* left */ .x-btn-text-icon .x-btn-icon-small-left .x-btn-text{ background-position: 0 center; background-repeat: no-repeat; padding-left:18px; height:16px; } .x-btn-text-icon .x-btn-icon-medium-left .x-btn-text{ background-position: 0 center; background-repeat: no-repeat; padding-left:26px; height:24px; } .x-btn-text-icon .x-btn-icon-large-left .x-btn-text{ background-position: 0 center; background-repeat: no-repeat; padding-left:34px; height:32px; } /* top */ .x-btn-text-icon .x-btn-icon-small-top .x-btn-text{ background-position: center 0; background-repeat: no-repeat; padding-top:18px; } .x-btn-text-icon .x-btn-icon-medium-top .x-btn-text{ background-position: center 0; background-repeat: no-repeat; padding-top:26px; } .x-btn-text-icon .x-btn-icon-large-top .x-btn-text{ background-position: center 0; background-repeat: no-repeat; padding-top:34px; } /* right */ .x-btn-text-icon .x-btn-icon-small-right .x-btn-text{ background-position: right center; background-repeat: no-repeat; padding-right:18px; height:16px; } .x-btn-text-icon .x-btn-icon-medium-right .x-btn-text{ background-position: right center; background-repeat: no-repeat; padding-right:26px; height:24px; } .x-btn-text-icon .x-btn-icon-large-right .x-btn-text{ background-position: right center; background-repeat: no-repeat; padding-right:34px; height:32px; } /* bottom */ .x-btn-text-icon .x-btn-icon-small-bottom .x-btn-text{ background-position: center bottom; background-repeat: no-repeat; padding-bottom:18px; } .x-btn-text-icon .x-btn-icon-medium-bottom .x-btn-text{ background-position: center bottom; background-repeat: no-repeat; padding-bottom:26px; } .x-btn-text-icon .x-btn-icon-large-bottom .x-btn-text{ background-position: center bottom; background-repeat: no-repeat; padding-bottom:34px; } /* background positioning */ .x-btn-tr i, .x-btn-tl i, .x-btn-mr i, .x-btn-ml i, .x-btn-br i, .x-btn-bl i{ font-size:1px; line-height:1px; width:3px; display:block; overflow:hidden; } .x-btn-tr i, .x-btn-tl i, .x-btn-br i, .x-btn-bl i{ height:3px; } .x-btn-tl{ width:3px; height:3px; background:no-repeat 0 0; } .x-btn-tr{ width:3px; height:3px; background:no-repeat -3px 0; } .x-btn-tc{ height:3px; background:repeat-x 0 -6px; } .x-btn-ml{ width:3px; background:no-repeat 0 -24px; } .x-btn-mr{ width:3px; background:no-repeat -3px -24px; } .x-btn-mc{ background:repeat-x 0 -1096px; vertical-align: middle; text-align:center; padding:0 5px; cursor:pointer; white-space:nowrap; } /* Fixes an issue with the button height */ .ext-strict .ext-ie6 .x-btn-mc, .ext-strict .ext-ie7 .x-btn-mc { height: 100%; } .x-btn-bl{ width:3px; height:3px; background:no-repeat 0 -3px; } .x-btn-br{ width:3px; height:3px; background:no-repeat -3px -3px; } .x-btn-bc{ height:3px; background:repeat-x 0 -15px; } .x-btn-over .x-btn-tl{ background-position: -6px 0; } .x-btn-over .x-btn-tr{ background-position: -9px 0; } .x-btn-over .x-btn-tc{ background-position: 0 -9px; } .x-btn-over .x-btn-ml{ background-position: -6px -24px; } .x-btn-over .x-btn-mr{ background-position: -9px -24px; } .x-btn-over .x-btn-mc{ background-position: 0 -2168px; } .x-btn-over .x-btn-bl{ background-position: -6px -3px; } .x-btn-over .x-btn-br{ background-position: -9px -3px; } .x-btn-over .x-btn-bc{ background-position: 0 -18px; } .x-btn-click .x-btn-tl, .x-btn-menu-active .x-btn-tl, .x-btn-pressed .x-btn-tl{ background-position: -12px 0; } .x-btn-click .x-btn-tr, .x-btn-menu-active .x-btn-tr, .x-btn-pressed .x-btn-tr{ background-position: -15px 0; } .x-btn-click .x-btn-tc, .x-btn-menu-active .x-btn-tc, .x-btn-pressed .x-btn-tc{ background-position: 0 -12px; } .x-btn-click .x-btn-ml, .x-btn-menu-active .x-btn-ml, .x-btn-pressed .x-btn-ml{ background-position: -12px -24px; } .x-btn-click .x-btn-mr, .x-btn-menu-active .x-btn-mr, .x-btn-pressed .x-btn-mr{ background-position: -15px -24px; } .x-btn-click .x-btn-mc, .x-btn-menu-active .x-btn-mc, .x-btn-pressed .x-btn-mc{ background-position: 0 -3240px; } .x-btn-click .x-btn-bl, .x-btn-menu-active .x-btn-bl, .x-btn-pressed .x-btn-bl{ background-position: -12px -3px; } .x-btn-click .x-btn-br, .x-btn-menu-active .x-btn-br, .x-btn-pressed .x-btn-br{ background-position: -15px -3px; } .x-btn-click .x-btn-bc, .x-btn-menu-active .x-btn-bc, .x-btn-pressed .x-btn-bc{ background-position: 0 -21px; } .x-btn-disabled *{ cursor:default !important; } /* With a menu arrow */ /* right */ .x-btn-mc em.x-btn-arrow { display:block; background:transparent no-repeat right center; padding-right:10px; } .x-btn-mc em.x-btn-split { display:block; background:transparent no-repeat right center; padding-right:14px; } /* bottom */ .x-btn-mc em.x-btn-arrow-bottom { display:block; background:transparent no-repeat center bottom; padding-bottom:14px; } .x-btn-mc em.x-btn-split-bottom { display:block; background:transparent no-repeat center bottom; padding-bottom:14px; } /* height adjustment class */ .x-btn-as-arrow .x-btn-mc em { display:block; background-color:transparent; padding-bottom:14px; } /* groups */ .x-btn-group { padding:1px; } .x-btn-group-header { padding:2px; text-align:center; } .x-btn-group-tc { background: transparent repeat-x 0 0; overflow:hidden; } .x-btn-group-tl { background: transparent no-repeat 0 0; padding-left:3px; zoom:1; } .x-btn-group-tr { background: transparent no-repeat right 0; zoom:1; padding-right:3px; } .x-btn-group-bc { background: transparent repeat-x 0 bottom; zoom:1; } .x-btn-group-bc .x-panel-footer { zoom:1; } .x-btn-group-bl { background: transparent no-repeat 0 bottom; padding-left:3px; zoom:1; } .x-btn-group-br { background: transparent no-repeat right bottom; padding-right:3px; zoom:1; } .x-btn-group-mc { border:0 none; padding:1px 0 0 0; margin:0; } .x-btn-group-mc .x-btn-group-body { background-color:transparent; border: 0 none; } .x-btn-group-ml { background: transparent repeat-y 0 0; padding-left:3px; zoom:1; } .x-btn-group-mr { background: transparent repeat-y right 0; padding-right:3px; zoom:1; } .x-btn-group-bc .x-btn-group-footer { padding-bottom:6px; } .x-panel-nofooter .x-btn-group-bc { height:3px; font-size:0; line-height:0; } .x-btn-group-bwrap { overflow:hidden; zoom:1; } .x-btn-group-body { overflow:hidden; zoom:1; } .x-btn-group-notitle .x-btn-group-tc { background: transparent repeat-x 0 0; overflow:hidden; height:2px; }.x-toolbar{ border-style:solid; border-width:0 0 1px 0; display: block; padding:2px; background:repeat-x top left; position:relative; left:0; top:0; zoom:1; overflow:hidden; } .x-toolbar-left { width: 100%; } .x-toolbar .x-item-disabled .x-btn-icon { opacity: .35; -moz-opacity: .35; filter: alpha(opacity=35); } .x-toolbar td { vertical-align:middle; } .x-toolbar td,.x-toolbar span,.x-toolbar input,.x-toolbar div,.x-toolbar select,.x-toolbar label{ white-space: nowrap; } .x-toolbar .x-item-disabled { cursor:default; opacity:.6; -moz-opacity:.6; filter:alpha(opacity=60); } .x-toolbar .x-item-disabled * { cursor:default; } .x-toolbar .x-toolbar-cell { vertical-align:middle; } .x-toolbar .x-btn-tl, .x-toolbar .x-btn-tr, .x-toolbar .x-btn-tc, .x-toolbar .x-btn-ml, .x-toolbar .x-btn-mr, .x-toolbar .x-btn-mc, .x-toolbar .x-btn-bl, .x-toolbar .x-btn-br, .x-toolbar .x-btn-bc { background-position: 500px 500px; } /* These rules are duplicated from button.css to give priority of x-toolbar rules above */ .x-toolbar .x-btn-over .x-btn-tl{ background-position: -6px 0; } .x-toolbar .x-btn-over .x-btn-tr{ background-position: -9px 0; } .x-toolbar .x-btn-over .x-btn-tc{ background-position: 0 -9px; } .x-toolbar .x-btn-over .x-btn-ml{ background-position: -6px -24px; } .x-toolbar .x-btn-over .x-btn-mr{ background-position: -9px -24px; } .x-toolbar .x-btn-over .x-btn-mc{ background-position: 0 -2168px; } .x-toolbar .x-btn-over .x-btn-bl{ background-position: -6px -3px; } .x-toolbar .x-btn-over .x-btn-br{ background-position: -9px -3px; } .x-toolbar .x-btn-over .x-btn-bc{ background-position: 0 -18px; } .x-toolbar .x-btn-click .x-btn-tl, .x-toolbar .x-btn-menu-active .x-btn-tl, .x-toolbar .x-btn-pressed .x-btn-tl{ background-position: -12px 0; } .x-toolbar .x-btn-click .x-btn-tr, .x-toolbar .x-btn-menu-active .x-btn-tr, .x-toolbar .x-btn-pressed .x-btn-tr{ background-position: -15px 0; } .x-toolbar .x-btn-click .x-btn-tc, .x-toolbar .x-btn-menu-active .x-btn-tc, .x-toolbar .x-btn-pressed .x-btn-tc{ background-position: 0 -12px; } .x-toolbar .x-btn-click .x-btn-ml, .x-toolbar .x-btn-menu-active .x-btn-ml, .x-toolbar .x-btn-pressed .x-btn-ml{ background-position: -12px -24px; } .x-toolbar .x-btn-click .x-btn-mr, .x-toolbar .x-btn-menu-active .x-btn-mr, .x-toolbar .x-btn-pressed .x-btn-mr{ background-position: -15px -24px; } .x-toolbar .x-btn-click .x-btn-mc, .x-toolbar .x-btn-menu-active .x-btn-mc, .x-toolbar .x-btn-pressed .x-btn-mc{ background-position: 0 -3240px; } .x-toolbar .x-btn-click .x-btn-bl, .x-toolbar .x-btn-menu-active .x-btn-bl, .x-toolbar .x-btn-pressed .x-btn-bl{ background-position: -12px -3px; } .x-toolbar .x-btn-click .x-btn-br, .x-toolbar .x-btn-menu-active .x-btn-br, .x-toolbar .x-btn-pressed .x-btn-br{ background-position: -15px -3px; } .x-toolbar .x-btn-click .x-btn-bc, .x-toolbar .x-btn-menu-active .x-btn-bc, .x-toolbar .x-btn-pressed .x-btn-bc{ background-position: 0 -21px; } .x-toolbar div.xtb-text{ padding:2px 2px 0; line-height:16px; display:block; } .x-toolbar .xtb-sep { background-position: center; background-repeat: no-repeat; display: block; font-size: 1px; height: 16px; width:4px; overflow: hidden; cursor:default; margin: 0 2px 0; border:0; } .x-toolbar .xtb-spacer { width:2px; } /* Paging Toolbar */ .x-tbar-page-number{ width:30px; height:14px; } .ext-ie .x-tbar-page-number{ margin-top: 2px; } .x-paging-info { position:absolute; top:5px; right: 8px; } /* floating */ .x-toolbar-ct { width:100%; } .x-toolbar-right td { text-align: center; } .x-panel-tbar, .x-panel-bbar, .x-window-tbar, .x-window-bbar, .x-tab-panel-tbar, .x-tab-panel-bbar, .x-plain-tbar, .x-plain-bbar { overflow:hidden; zoom:1; } .x-toolbar-more .x-btn-small .x-btn-text{ height: 16px; width: 12px; } .x-toolbar-more em.x-btn-arrow { display:inline; background-color:transparent; padding-right:0; } .x-toolbar-more .x-btn-mc em.x-btn-arrow { background-image: none; } div.x-toolbar-no-items { color:gray !important; padding:5px 10px !important; } /* fix ie toolbar form items */ .ext-border-box .x-toolbar-cell .x-form-text { margin-bottom:-1px !important; } .ext-border-box .x-toolbar-cell .x-form-field-wrap .x-form-text { margin:0 !important; } .ext-ie .x-toolbar-cell .x-form-field-wrap { height:21px; } .ext-ie .x-toolbar-cell .x-form-text { position:relative; top:-1px; } .ext-strict .ext-ie8 .x-toolbar-cell .x-form-field-trigger-wrap .x-form-text, .ext-strict .ext-ie .x-toolbar-cell .x-form-text { top: 0px; } .x-toolbar-right td .x-form-field-trigger-wrap{ text-align: left; } .x-toolbar-cell .x-form-checkbox, .x-toolbar-cell .x-form-radio{ margin-top: 5px; } .x-toolbar-cell .x-form-cb-label{ vertical-align: bottom; top: 1px; } .ext-ie .x-toolbar-cell .x-form-checkbox, .ext-ie .x-toolbar-cell .x-form-radio{ margin-top: 4px; } .ext-ie .x-toolbar-cell .x-form-cb-label{ top: 0; } /* Grid3 styles */ .x-grid3 { position:relative; overflow:hidden; } .x-grid-panel .x-panel-body { overflow:hidden !important; } .x-grid-panel .x-panel-mc .x-panel-body { border:1px solid; } .x-grid3 table { table-layout:fixed; } .x-grid3-viewport{ overflow:hidden; } .x-grid3-hd-row td, .x-grid3-row td, .x-grid3-summary-row td{ -moz-outline: none; outline: none; -moz-user-focus: normal; } .x-grid3-row td, .x-grid3-summary-row td { line-height:13px; vertical-align: top; padding-left:1px; padding-right:1px; -moz-user-select: none; -khtml-user-select:none; -webkit-user-select:ignore; } .x-grid3-cell{ -moz-user-select: none; -khtml-user-select:none; -webkit-user-select:ignore; } .x-grid3-hd-row td { line-height:15px; vertical-align:middle; border-left:1px solid; border-right:1px solid; } .x-grid3-hd-row .x-grid3-marker-hd { padding:3px; } .x-grid3-row .x-grid3-marker { padding:3px; } .x-grid3-cell-inner, .x-grid3-hd-inner{ overflow:hidden; -o-text-overflow: ellipsis; text-overflow: ellipsis; padding:3px 3px 3px 5px; white-space: nowrap; } /* ActionColumn, reduce padding to accommodate 16x16 icons in normal row height */ .x-action-col-cell .x-grid3-cell-inner { padding-top: 1px; padding-bottom: 1px; } .x-action-col-icon { cursor: pointer; } .x-grid3-hd-inner { position:relative; cursor:inherit; padding:4px 3px 4px 5px; } .x-grid3-row-body { white-space:normal; } .x-grid3-body-cell { -moz-outline:0 none; outline:0 none; } /* IE Quirks to clip */ .ext-ie .x-grid3-cell-inner, .ext-ie .x-grid3-hd-inner{ width:100%; } /* reverse above in strict mode */ .ext-strict .x-grid3-cell-inner, .ext-strict .x-grid3-hd-inner{ width:auto; } .x-grid-row-loading { background: no-repeat center center; } .x-grid-page { overflow:hidden; } .x-grid3-row { cursor: default; border: 1px solid; width:100%; } .x-grid3-row-over { border:1px solid; background: repeat-x left top; } .x-grid3-resize-proxy { width:1px; left:0; cursor: e-resize; cursor: col-resize; position:absolute; top:0; height:100px; overflow:hidden; visibility:hidden; border:0 none; z-index:7; } .x-grid3-resize-marker { width:1px; left:0; position:absolute; top:0; height:100px; overflow:hidden; visibility:hidden; border:0 none; z-index:7; } .x-grid3-focus { position:absolute; left:0; top:0; width:1px; height:1px; line-height:1px; font-size:1px; -moz-outline:0 none; outline:0 none; -moz-user-select: text; -khtml-user-select: text; -webkit-user-select:ignore; } /* header styles */ .x-grid3-header{ background: repeat-x 0 bottom; cursor:default; zoom:1; padding:1px 0 0 0; } .x-grid3-header-pop { border-left:1px solid; float:right; clear:none; } .x-grid3-header-pop-inner { border-left:1px solid; width:14px; height:19px; background: transparent no-repeat center center; } .ext-ie .x-grid3-header-pop-inner { width:15px; } .ext-strict .x-grid3-header-pop-inner { width:14px; } .x-grid3-header-inner { overflow:hidden; zoom:1; float:left; } .x-grid3-header-offset { padding-left:1px; text-align: left; } td.x-grid3-hd-over, td.sort-desc, td.sort-asc, td.x-grid3-hd-menu-open { border-left:1px solid; border-right:1px solid; } td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-asc .x-grid3-hd-inner, td.x-grid3-hd-menu-open .x-grid3-hd-inner { background: repeat-x left bottom; } .x-grid3-sort-icon{ background-repeat: no-repeat; display: none; height: 4px; width: 13px; margin-left:3px; vertical-align: middle; } .sort-asc .x-grid3-sort-icon, .sort-desc .x-grid3-sort-icon { display: inline; } /* Header position fixes for IE strict mode */ .ext-strict .ext-ie .x-grid3-header-inner, .ext-strict .ext-ie6 .x-grid3-hd { position:relative; } .ext-strict .ext-ie6 .x-grid3-hd-inner{ position:static; } /* Body Styles */ .x-grid3-body { zoom:1; } .x-grid3-scroller { overflow:auto; zoom:1; position:relative; } .x-grid3-cell-text, .x-grid3-hd-text { display: block; padding: 3px 5px 3px 5px; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select:ignore; } .x-grid3-split { background-position: center; background-repeat: no-repeat; cursor: e-resize; cursor: col-resize; display: block; font-size: 1px; height: 16px; overflow: hidden; position: absolute; top: 2px; width: 6px; z-index: 3; } /* Column Reorder DD */ .x-dd-drag-proxy .x-grid3-hd-inner{ background: repeat-x left bottom; width:120px; padding:3px; border:1px solid; overflow:hidden; } .col-move-top, .col-move-bottom{ width:9px; height:9px; position:absolute; top:0; line-height:1px; font-size:1px; overflow:hidden; visibility:hidden; z-index:20000; background:transparent no-repeat left top; } /* Selection Styles */ .x-grid3-row-selected { border:1px dotted; } .x-grid3-locked td.x-grid3-row-marker, .x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker{ background: repeat-x 0 bottom !important; vertical-align:middle !important; padding:0; border-top:1px solid; border-bottom:none !important; border-right:1px solid !important; text-align:center; } .x-grid3-locked td.x-grid3-row-marker div, .x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker div{ padding:0 4px; text-align:center; } /* dirty cells */ .x-grid3-dirty-cell { background: transparent no-repeat 0 0; } /* Grid Toolbars */ .x-grid3-topbar, .x-grid3-bottombar{ overflow:hidden; display:none; zoom:1; position:relative; } .x-grid3-topbar .x-toolbar{ border-right:0 none; } .x-grid3-bottombar .x-toolbar{ border-right:0 none; border-bottom:0 none; border-top:1px solid; } /* Props Grid Styles */ .x-props-grid .x-grid3-cell{ padding:1px; } .x-props-grid .x-grid3-td-name .x-grid3-cell-inner{ background:transparent repeat-y -16px !important; padding-left:12px; } .x-props-grid .x-grid3-body .x-grid3-td-name{ padding:1px; padding-right:0; border:0 none; border-right:1px solid; } /* dd */ .x-grid3-col-dd { border:0 none; padding:0; background-color:transparent; } .x-dd-drag-ghost .x-grid3-dd-wrap { padding:1px 3px 3px 1px; } .x-grid3-hd { -moz-user-select:none; -khtml-user-select:none; -webkit-user-select:ignore; } .x-grid3-hd-btn { display:none; position:absolute; width:14px; background:no-repeat left center; right:0; top:0; z-index:2; cursor:pointer; } .x-grid3-hd-over .x-grid3-hd-btn, .x-grid3-hd-menu-open .x-grid3-hd-btn { display:block; } a.x-grid3-hd-btn:hover { background-position:-14px center; } /* Expanders */ .x-grid3-body .x-grid3-td-expander { background:transparent repeat-y right; } .x-grid3-body .x-grid3-td-expander .x-grid3-cell-inner { padding:0 !important; height:100%; } .x-grid3-row-expander { width:100%; height:18px; background-position:4px 2px; background-repeat:no-repeat; background-color:transparent; } .x-grid3-row-collapsed .x-grid3-row-expander { background-position:4px 2px; } .x-grid3-row-expanded .x-grid3-row-expander { background-position:-21px 2px; } .x-grid3-row-collapsed .x-grid3-row-body { display:none !important; } .x-grid3-row-expanded .x-grid3-row-body { display:block !important; } /* Checkers */ .x-grid3-body .x-grid3-td-checker { background:transparent repeat-y right; } .x-grid3-body .x-grid3-td-checker .x-grid3-cell-inner, .x-grid3-header .x-grid3-td-checker .x-grid3-hd-inner { padding:0 !important; height:100%; } .x-grid3-row-checker, .x-grid3-hd-checker { width:100%; height:18px; background-position:2px 2px; background-repeat:no-repeat; background-color:transparent; } .x-grid3-row .x-grid3-row-checker { background-position:2px 2px; } .x-grid3-row-selected .x-grid3-row-checker, .x-grid3-hd-checker-on .x-grid3-hd-checker,.x-grid3-row-checked .x-grid3-row-checker { background-position:-23px 2px; } .x-grid3-hd-checker { background-position:2px 1px; } .ext-border-box .x-grid3-hd-checker { background-position:2px 3px; } .x-grid3-hd-checker-on .x-grid3-hd-checker { background-position:-23px 1px; } .ext-border-box .x-grid3-hd-checker-on .x-grid3-hd-checker { background-position:-23px 3px; } /* Numberer */ .x-grid3-body .x-grid3-td-numberer { background:transparent repeat-y right; } .x-grid3-body .x-grid3-td-numberer .x-grid3-cell-inner { padding:3px 5px 0 0 !important; text-align:right; } /* Row Icon */ .x-grid3-body .x-grid3-td-row-icon { background:transparent repeat-y right; vertical-align:top; text-align:center; } .x-grid3-body .x-grid3-td-row-icon .x-grid3-cell-inner { padding:0 !important; background-position:center center; background-repeat:no-repeat; width:16px; height:16px; margin-left:2px; margin-top:3px; } /* All specials */ .x-grid3-body .x-grid3-row-selected .x-grid3-td-numberer, .x-grid3-body .x-grid3-row-selected .x-grid3-td-checker, .x-grid3-body .x-grid3-row-selected .x-grid3-td-expander { background:transparent repeat-y right; } .x-grid3-body .x-grid3-check-col-td .x-grid3-cell-inner { padding: 1px 0 0 0 !important; } .x-grid3-check-col { width:100%; height:16px; background-position:center center; background-repeat:no-repeat; background-color:transparent; } .x-grid3-check-col-on { width:100%; height:16px; background-position:center center; background-repeat:no-repeat; background-color:transparent; } /* Grouping classes */ .x-grid-group, .x-grid-group-body, .x-grid-group-hd { zoom:1; } .x-grid-group-hd { border-bottom: 2px solid; cursor:pointer; padding-top:6px; } .x-grid-group-hd div.x-grid-group-title { background:transparent no-repeat 3px 3px; padding:4px 4px 4px 17px; } .x-grid-group-collapsed .x-grid-group-body { display:none; } .ext-ie6 .x-grid3 .x-editor .x-form-text, .ext-ie7 .x-grid3 .x-editor .x-form-text { position:relative; top:-1px; } .ext-ie .x-props-grid .x-editor .x-form-text { position:static; top:0; } .x-grid-empty { padding:10px; } /* fix floating toolbar issue */ .ext-ie7 .x-grid-panel .x-panel-bbar { position:relative; } /* Reset position to static when Grid Panel has been framed */ /* to resolve 'snapping' from top to bottom behavior. */ /* @forumThread 86656 */ .ext-ie7 .x-grid-panel .x-panel-mc .x-panel-bbar { position: static; } .ext-ie6 .x-grid3-header { position: relative; } /* Fix WebKit bug in Grids */ .ext-webkit .x-grid-panel .x-panel-bwrap{ -webkit-user-select:none; } .ext-webkit .x-tbar-page-number{ -webkit-user-select:ignore; } /* end*/ /* column lines */ .x-grid-with-col-lines .x-grid3-row td.x-grid3-cell { padding-right:0; border-right:1px solid; } .x-pivotgrid .x-grid3-header-offset table { width: 100%; border-collapse: collapse; } .x-pivotgrid .x-grid3-header-offset table td { padding: 4px 3px 4px 5px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; line-height: 13px; font-family: tahoma; } .x-pivotgrid .x-grid3-row-headers { display: block; float: left; } .x-pivotgrid .x-grid3-row-headers table { height: 100%; width: 100%; border-collapse: collapse; } .x-pivotgrid .x-grid3-row-headers table td { height: 18px; padding: 2px 7px 0 0; text-align: right; text-overflow: ellipsis; font-size: 11px; font-family: tahoma; } .ext-gecko .x-pivotgrid .x-grid3-row-headers table td { height: 21px; } .x-grid3-header-title { top: 0%; left: 0%; position: absolute; text-align: center; vertical-align: middle; font-family: tahoma; font-size: 11px; padding: auto 1px; display: table-cell; } .x-grid3-header-title span { position: absolute; top: 50%; left: 0%; width: 100%; margin-top: -6px; }.x-dd-drag-proxy{ position:absolute; left:0; top:0; visibility:hidden; z-index:15000; } .x-dd-drag-ghost{ -moz-opacity: 0.85; opacity:.85; filter: alpha(opacity=85); border: 1px solid; padding:3px; padding-left:20px; white-space:nowrap; } .x-dd-drag-repair .x-dd-drag-ghost{ -moz-opacity: 0.4; opacity:.4; filter: alpha(opacity=40); border:0 none; padding:0; background-color:transparent; } .x-dd-drag-repair .x-dd-drop-icon{ visibility:hidden; } .x-dd-drop-icon{ position:absolute; top:3px; left:3px; display:block; width:16px; height:16px; background-color:transparent; background-position: center; background-repeat: no-repeat; z-index:1; } .x-view-selector { position:absolute; left:0; top:0; width:0; border:1px dotted; opacity: .5; -moz-opacity: .5; filter:alpha(opacity=50); zoom:1; }.ext-strict .ext-ie .x-tree .x-panel-bwrap{ position:relative; overflow:hidden; } .x-tree-icon, .x-tree-ec-icon, .x-tree-elbow-line, .x-tree-elbow, .x-tree-elbow-end, .x-tree-elbow-plus, .x-tree-elbow-minus, .x-tree-elbow-end-plus, .x-tree-elbow-end-minus{ border: 0 none; height: 18px; margin: 0; padding: 0; vertical-align: top; width: 16px; background-repeat: no-repeat; } .x-tree-node-collapsed .x-tree-node-icon, .x-tree-node-expanded .x-tree-node-icon, .x-tree-node-leaf .x-tree-node-icon{ border: 0 none; height: 18px; margin: 0; padding: 0; vertical-align: top; width: 16px; background-position:center; background-repeat: no-repeat; } .ext-ie .x-tree-node-indent img, .ext-ie .x-tree-node-icon, .ext-ie .x-tree-ec-icon { vertical-align: middle !important; } .ext-strict .ext-ie8 .x-tree-node-indent img, .ext-strict .ext-ie8 .x-tree-node-icon, .ext-strict .ext-ie8 .x-tree-ec-icon { vertical-align: top !important; } /* checkboxes */ input.x-tree-node-cb { margin-left:1px; height: 19px; vertical-align: bottom; } .ext-ie input.x-tree-node-cb { margin-left:0; margin-top: 1px; width: 16px; height: 16px; vertical-align: middle; } .ext-strict .ext-ie8 input.x-tree-node-cb{ margin: 1px 1px; height: 14px; vertical-align: bottom; } .ext-strict .ext-ie8 input.x-tree-node-cb + a{ vertical-align: bottom; } .ext-opera input.x-tree-node-cb { height: 14px; vertical-align: middle; } .x-tree-noicon .x-tree-node-icon{ width:0; height:0; } /* No line styles */ .x-tree-no-lines .x-tree-elbow{ background-color:transparent; } .x-tree-no-lines .x-tree-elbow-end{ background-color:transparent; } .x-tree-no-lines .x-tree-elbow-line{ background-color:transparent; } /* Arrows */ .x-tree-arrows .x-tree-elbow{ background-color:transparent; } .x-tree-arrows .x-tree-elbow-plus{ background:transparent no-repeat 0 0; } .x-tree-arrows .x-tree-elbow-minus{ background:transparent no-repeat -16px 0; } .x-tree-arrows .x-tree-elbow-end{ background-color:transparent; } .x-tree-arrows .x-tree-elbow-end-plus{ background:transparent no-repeat 0 0; } .x-tree-arrows .x-tree-elbow-end-minus{ background:transparent no-repeat -16px 0; } .x-tree-arrows .x-tree-elbow-line{ background-color:transparent; } .x-tree-arrows .x-tree-ec-over .x-tree-elbow-plus{ background-position:-32px 0; } .x-tree-arrows .x-tree-ec-over .x-tree-elbow-minus{ background-position:-48px 0; } .x-tree-arrows .x-tree-ec-over .x-tree-elbow-end-plus{ background-position:-32px 0; } .x-tree-arrows .x-tree-ec-over .x-tree-elbow-end-minus{ background-position:-48px 0; } .x-tree-elbow-plus, .x-tree-elbow-minus, .x-tree-elbow-end-plus, .x-tree-elbow-end-minus{ cursor:pointer; } .ext-ie ul.x-tree-node-ct{ font-size:0; line-height:0; zoom:1; } .x-tree-node{ white-space: nowrap; } .x-tree-node-el { line-height:18px; cursor:pointer; } .x-tree-node a, .x-dd-drag-ghost a{ text-decoration:none; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:ignore; -kthml-user-focus:normal; -moz-user-focus:normal; -moz-outline: 0 none; outline:0 none; } .x-tree-node a span, .x-dd-drag-ghost a span{ text-decoration:none; padding:1px 3px 1px 2px; } .x-tree-node .x-tree-node-disabled .x-tree-node-icon{ -moz-opacity: 0.5; opacity:.5; filter: alpha(opacity=50); } .x-tree-node .x-tree-node-inline-icon{ background-color:transparent; } .x-tree-node a:hover, .x-dd-drag-ghost a:hover{ text-decoration:none; } .x-tree-node div.x-tree-drag-insert-below{ border-bottom:1px dotted; } .x-tree-node div.x-tree-drag-insert-above{ border-top:1px dotted; } .x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-below{ border-bottom:0 none; } .x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-above{ border-top:0 none; } .x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-below a{ border-bottom:2px solid; } .x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-above a{ border-top:2px solid; } .x-tree-node .x-tree-drag-append a span{ border:1px dotted; } .x-dd-drag-ghost .x-tree-node-indent, .x-dd-drag-ghost .x-tree-ec-icon{ display:none !important; } /* Fix for ie rootVisible:false issue */ .x-tree-root-ct { zoom:1; } .x-date-picker { border: 1px solid; border-top:0 none; position:relative; } .x-date-picker a { -moz-outline:0 none; outline:0 none; } .x-date-inner, .x-date-inner td, .x-date-inner th{ border-collapse:separate; } .x-date-middle,.x-date-left,.x-date-right { background: repeat-x 0 -83px; overflow:hidden; } .x-date-middle .x-btn-tc,.x-date-middle .x-btn-tl,.x-date-middle .x-btn-tr, .x-date-middle .x-btn-mc,.x-date-middle .x-btn-ml,.x-date-middle .x-btn-mr, .x-date-middle .x-btn-bc,.x-date-middle .x-btn-bl,.x-date-middle .x-btn-br{ background:transparent !important; vertical-align:middle; } .x-date-middle .x-btn-mc em.x-btn-arrow { background:transparent no-repeat right 0; } .x-date-right, .x-date-left { width:18px; } .x-date-right{ text-align:right; } .x-date-middle { padding-top:2px; padding-bottom:2px; width:130px; /* FF3 */ } .x-date-right a, .x-date-left a{ display:block; width:16px; height:16px; background-position: center; background-repeat: no-repeat; cursor:pointer; -moz-opacity: 0.6; opacity:.6; filter: alpha(opacity=60); } .x-date-right a:hover, .x-date-left a:hover{ -moz-opacity: 1; opacity:1; filter: alpha(opacity=100); } .x-item-disabled .x-date-right a:hover, .x-item-disabled .x-date-left a:hover{ -moz-opacity: 0.6; opacity:.6; filter: alpha(opacity=60); } .x-date-right a { margin-right:2px; text-decoration:none !important; } .x-date-left a{ margin-left:2px; text-decoration:none !important; } table.x-date-inner { width: 100%; table-layout:fixed; } .ext-webkit table.x-date-inner{ /* Fix for webkit browsers */ width: 175px; } .x-date-inner th { width:25px; } .x-date-inner th { background: repeat-x left top; text-align:right !important; border-bottom: 1px solid; cursor:default; padding:0; border-collapse:separate; } .x-date-inner th span { display:block; padding:2px; padding-right:7px; } .x-date-inner td { border: 1px solid; text-align:right; padding:0; } .x-date-inner a { padding:2px 5px; display:block; text-decoration:none; text-align:right; zoom:1; } .x-date-inner .x-date-active{ cursor:pointer; color:black; } .x-date-inner .x-date-selected a{ background: repeat-x left top; border:1px solid; padding:1px 4px; } .x-date-inner .x-date-today a{ border: 1px solid; padding:1px 4px; } .x-date-inner .x-date-prevday a,.x-date-inner .x-date-nextday a { text-decoration:none !important; } .x-date-bottom { padding:4px; border-top: 1px solid; background: repeat-x left top; } .x-date-inner a:hover, .x-date-inner .x-date-disabled a:hover{ text-decoration:none !important; } .x-item-disabled .x-date-inner a:hover{ background: none; } .x-date-inner .x-date-disabled a { cursor:default; } .x-date-menu .x-menu-item { padding:1px 24px 1px 4px; white-space: nowrap; } .x-date-menu .x-menu-item .x-menu-item-icon { width:10px; height:10px; margin-right:5px; background-position:center -4px !important; } .x-date-mp { position:absolute; left:0; top:0; display:none; } .x-date-mp td { padding:2px; font:normal 11px arial, helvetica,tahoma,sans-serif; } td.x-date-mp-month,td.x-date-mp-year,td.x-date-mp-ybtn { border: 0 none; text-align:center; vertical-align: middle; width:25%; } .x-date-mp-ok { margin-right:3px; } .x-date-mp-btns button { text-decoration:none; text-align:center; text-decoration:none !important; border:1px solid; padding:1px 3px 1px; cursor:pointer; } .x-date-mp-btns { background: repeat-x left top; } .x-date-mp-btns td { border-top: 1px solid; text-align:center; } td.x-date-mp-month a,td.x-date-mp-year a { display:block; padding:2px 4px; text-decoration:none; text-align:center; } td.x-date-mp-month a:hover,td.x-date-mp-year a:hover { text-decoration:none; cursor:pointer; } td.x-date-mp-sel a { padding:1px 3px; background: repeat-x left top; border:1px solid; } .x-date-mp-ybtn a { overflow:hidden; width:15px; height:15px; cursor:pointer; background:transparent no-repeat; display:block; margin:0 auto; } .x-date-mp-ybtn a.x-date-mp-next { background-position:0 -120px; } .x-date-mp-ybtn a.x-date-mp-next:hover { background-position:-15px -120px; } .x-date-mp-ybtn a.x-date-mp-prev { background-position:0 -105px; } .x-date-mp-ybtn a.x-date-mp-prev:hover { background-position:-15px -105px; } .x-date-mp-ybtn { text-align:center; } td.x-date-mp-sep { border-right:1px solid; }.x-tip{ position: absolute; top: 0; left:0; visibility: hidden; z-index: 20002; border:0 none; } .x-tip .x-tip-close{ height: 15px; float:right; width: 15px; margin:0 0 2px 2px; cursor:pointer; display:none; } .x-tip .x-tip-tc { background: transparent no-repeat 0 -62px; padding-top:3px; overflow:hidden; zoom:1; } .x-tip .x-tip-tl { background: transparent no-repeat 0 0; padding-left:6px; overflow:hidden; zoom:1; } .x-tip .x-tip-tr { background: transparent no-repeat right 0; padding-right:6px; overflow:hidden; zoom:1; } .x-tip .x-tip-bc { background: transparent no-repeat 0 -121px; height:3px; overflow:hidden; } .x-tip .x-tip-bl { background: transparent no-repeat 0 -59px; padding-left:6px; zoom:1; } .x-tip .x-tip-br { background: transparent no-repeat right -59px; padding-right:6px; zoom:1; } .x-tip .x-tip-mc { border:0 none; } .x-tip .x-tip-ml { background: no-repeat 0 -124px; padding-left:6px; zoom:1; } .x-tip .x-tip-mr { background: transparent no-repeat right -124px; padding-right:6px; zoom:1; } .ext-ie .x-tip .x-tip-header,.ext-ie .x-tip .x-tip-tc { font-size:0; line-height:0; } .ext-border-box .x-tip .x-tip-header, .ext-border-box .x-tip .x-tip-tc{ line-height: 1px; } .x-tip .x-tip-header-text { padding:0; margin:0 0 2px 0; } .x-tip .x-tip-body { margin:0 !important; line-height:14px; padding:0; } .x-tip .x-tip-body .loading-indicator { margin:0; } .x-tip-draggable .x-tip-header,.x-tip-draggable .x-tip-header-text { cursor:move; } .x-form-invalid-tip .x-tip-tc { background: repeat-x 0 -12px; padding-top:6px; } .x-form-invalid-tip .x-tip-bc { background: repeat-x 0 -18px; height:6px; } .x-form-invalid-tip .x-tip-bl { background: no-repeat 0 -6px; } .x-form-invalid-tip .x-tip-br { background: no-repeat right -6px; } .x-form-invalid-tip .x-tip-body { padding:2px; } .x-form-invalid-tip .x-tip-body { padding-left:24px; background:transparent no-repeat 2px 2px; } .x-tip-anchor { position: absolute; width: 9px; height: 10px; overflow:hidden; background: transparent no-repeat 0 0; zoom:1; } .x-tip-anchor-bottom { background-position: -9px 0; } .x-tip-anchor-right { background-position: -18px 0; width: 10px; } .x-tip-anchor-left { background-position: -28px 0; width: 10px; }.x-menu { z-index: 15000; zoom: 1; background: repeat-y; } .x-menu-floating{ border: 1px solid; } .x-menu a { text-decoration: none !important; } .ext-ie .x-menu { zoom:1; overflow:hidden; } .x-menu-list{ padding: 2px; background-color:transparent; border:0 none; overflow:hidden; overflow-y: hidden; } .ext-strict .ext-ie .x-menu-list{ position: relative; } .x-menu li{ line-height:100%; } .x-menu li.x-menu-sep-li{ font-size:1px; line-height:1px; } .x-menu-list-item{ white-space: nowrap; display:block; padding:1px; } .x-menu-item{ -moz-user-select: none; -khtml-user-select:none; -webkit-user-select:ignore; } .x-menu-item-arrow{ background:transparent no-repeat right; } .x-menu-sep { display:block; font-size:1px; line-height:1px; margin: 2px 3px; border-bottom:1px solid; overflow:hidden; } .x-menu-focus { position:absolute; left:-1px; top:-1px; width:1px; height:1px; line-height:1px; font-size:1px; -moz-outline:0 none; outline:0 none; -moz-user-select: none; -khtml-user-select:none; -webkit-user-select:ignore; overflow:hidden; display:block; } a.x-menu-item { cursor: pointer; display: block; line-height: 16px; outline-color: -moz-use-text-color; outline-style: none; outline-width: 0; padding: 3px 21px 3px 27px; position: relative; text-decoration: none; white-space: nowrap; } .x-menu-item-active { background-repeat: repeat-x; background-position: left bottom; border-style:solid; border-width: 1px 0; margin:0 1px; padding: 0; } .x-menu-item-active a.x-menu-item { border-style:solid; border-width:0 1px; margin:0 -1px; } .x-menu-item-icon { border: 0 none; height: 16px; padding: 0; vertical-align: top; width: 16px; position: absolute; left: 3px; top: 3px; margin: 0; background-position:center; } .ext-ie .x-menu-item-icon { left: -24px; } .ext-strict .x-menu-item-icon { left: 3px; } .ext-ie6 .x-menu-item-icon { left: -24px; } .ext-ie .x-menu-item-icon { vertical-align: middle; } .x-menu-check-item .x-menu-item-icon{ background: transparent no-repeat center; } .x-menu-group-item .x-menu-item-icon{ background-color: transparent; } .x-menu-item-checked .x-menu-group-item .x-menu-item-icon{ background: transparent no-repeat center; } .x-date-menu .x-menu-list{ padding: 0; } .x-menu-date-item{ padding:0; } .x-menu .x-color-palette, .x-menu .x-date-picker{ margin-left: 26px; margin-right:4px; } .x-menu .x-date-picker{ border:1px solid; margin-top:2px; margin-bottom:2px; } .x-menu-plain .x-color-palette, .x-menu-plain .x-date-picker{ margin: 0; border: 0 none; } .x-date-menu { padding:0 !important; } /* * fixes separator visibility problem in IE 6 */ .ext-strict .ext-ie6 .x-menu-sep-li { padding: 3px 4px; } .ext-strict .ext-ie6 .x-menu-sep { margin: 0; height: 1px; } /* * Fixes an issue with "fat" separators in webkit */ .ext-webkit .x-menu-sep{ height: 1px; } /* * Ugly mess to remove the white border under the picker */ .ext-ie .x-date-menu{ height: 199px; } .ext-strict .ext-ie .x-date-menu, .ext-border-box .ext-ie8 .x-date-menu{ height: 197px; } .ext-strict .ext-ie7 .x-date-menu{ height: 195px; } .ext-strict .ext-ie8 .x-date-menu{ height: auto; } .x-cycle-menu .x-menu-item-checked { border:1px dotted !important; padding:0; } .x-menu .x-menu-scroller { width: 100%; background-repeat:no-repeat; background-position:center; height:8px; line-height: 8px; cursor:pointer; margin: 0; padding: 0; } .x-menu .x-menu-scroller-active{ height: 6px; line-height: 6px; } .x-menu-list-item-indent{ padding-left: 27px; }/* Creates rounded, raised boxes like on the Ext website - the markup isn't pretty:

    YOUR TITLE HERE (optional)

    YOUR CONTENT HERE
    */ .x-box-tl { background: transparent no-repeat 0 0; zoom:1; } .x-box-tc { height: 8px; background: transparent repeat-x 0 0; overflow: hidden; } .x-box-tr { background: transparent no-repeat right -8px; } .x-box-ml { background: transparent repeat-y 0; padding-left: 4px; overflow: hidden; zoom:1; } .x-box-mc { background: repeat-x 0 -16px; padding: 4px 10px; } .x-box-mc h3 { margin: 0 0 4px 0; zoom:1; } .x-box-mr { background: transparent repeat-y right; padding-right: 4px; overflow: hidden; } .x-box-bl { background: transparent no-repeat 0 -16px; zoom:1; } .x-box-bc { background: transparent repeat-x 0 -8px; height: 8px; overflow: hidden; } .x-box-br { background: transparent no-repeat right -24px; } .x-box-tl, .x-box-bl { padding-left: 8px; overflow: hidden; } .x-box-tr, .x-box-br { padding-right: 8px; overflow: hidden; }.x-combo-list { border:1px solid; zoom:1; overflow:hidden; } .x-combo-list-inner { overflow:auto; position:relative; /* for calculating scroll offsets */ zoom:1; overflow-x:hidden; } .x-combo-list-hd { border-bottom:1px solid; padding:3px; } .x-resizable-pinned .x-combo-list-inner { border-bottom:1px solid; } .x-combo-list-item { padding:2px; border:1px solid; white-space: nowrap; overflow:hidden; text-overflow: ellipsis; } .x-combo-list .x-combo-selected{ border:1px dotted !important; cursor:pointer; } .x-combo-list .x-toolbar { border-top:1px solid; border-bottom:0 none; }.x-panel { border-style: solid; border-width:0; } .x-panel-header { overflow:hidden; zoom:1; padding:5px 3px 4px 5px; border:1px solid; line-height: 15px; background: transparent repeat-x 0 -1px; } .x-panel-body { border:1px solid; border-top:0 none; overflow:hidden; position: relative; /* added for item scroll positioning */ } .x-panel-bbar .x-toolbar, .x-panel-tbar .x-toolbar { border:1px solid; border-top:0 none; overflow:hidden; padding:2px; } .x-panel-tbar-noheader .x-toolbar, .x-panel-mc .x-panel-tbar .x-toolbar { border-top:1px solid; border-bottom: 0 none; } .x-panel-body-noheader, .x-panel-mc .x-panel-body { border-top:1px solid; } .x-panel-header { overflow:hidden; zoom:1; } .x-panel-tl .x-panel-header { padding:5px 0 4px 0; border:0 none; background:transparent no-repeat; } .x-panel-tl .x-panel-icon, .x-window-tl .x-panel-icon { padding-left:20px !important; background-repeat:no-repeat; background-position:0 4px; zoom:1; } .x-panel-inline-icon { width:16px; height:16px; background-repeat:no-repeat; background-position:0 0; vertical-align:middle; margin-right:4px; margin-top:-1px; margin-bottom:-1px; } .x-panel-tc { background: transparent repeat-x 0 0; overflow:hidden; } /* fix ie7 strict mode bug */ .ext-strict .ext-ie7 .x-panel-tc { overflow: visible; } .x-panel-tl { background: transparent no-repeat 0 0; padding-left:6px; zoom:1; border-bottom:1px solid; } .x-panel-tr { background: transparent no-repeat right 0; zoom:1; padding-right:6px; } .x-panel-bc { background: transparent repeat-x 0 bottom; zoom:1; } .x-panel-bc .x-panel-footer { zoom:1; } .x-panel-bl { background: transparent no-repeat 0 bottom; padding-left:6px; zoom:1; } .x-panel-br { background: transparent no-repeat right bottom; padding-right:6px; zoom:1; } .x-panel-mc { border:0 none; padding:0; margin:0; padding-top:6px; } .x-panel-mc .x-panel-body { background-color:transparent; border: 0 none; } .x-panel-ml { background: repeat-y 0 0; padding-left:6px; zoom:1; } .x-panel-mr { background: transparent repeat-y right 0; padding-right:6px; zoom:1; } .x-panel-bc .x-panel-footer { padding-bottom:6px; } .x-panel-nofooter .x-panel-bc, .x-panel-nofooter .x-window-bc { height:6px; font-size:0; line-height:0; } .x-panel-bwrap { overflow:hidden; zoom:1; left:0; top:0; } .x-panel-body { overflow:hidden; zoom:1; } .x-panel-collapsed .x-resizable-handle{ display:none; } .ext-gecko .x-panel-animated div { overflow:hidden !important; } /* Plain */ .x-plain-body { overflow:hidden; } .x-plain-bbar .x-toolbar { overflow:hidden; padding:2px; } .x-plain-tbar .x-toolbar { overflow:hidden; padding:2px; } .x-plain-bwrap { overflow:hidden; zoom:1; } .x-plain { overflow:hidden; } /* Tools */ .x-tool { overflow:hidden; width:15px; height:15px; float:right; cursor:pointer; background:transparent no-repeat; margin-left:2px; } /* expand / collapse tools */ .x-tool-toggle { background-position:0 -60px; } .x-tool-toggle-over { background-position:-15px -60px; } .x-panel-collapsed .x-tool-toggle { background-position:0 -75px; } .x-panel-collapsed .x-tool-toggle-over { background-position:-15px -75px; } .x-tool-close { background-position:0 -0; } .x-tool-close-over { background-position:-15px 0; } .x-tool-minimize { background-position:0 -15px; } .x-tool-minimize-over { background-position:-15px -15px; } .x-tool-maximize { background-position:0 -30px; } .x-tool-maximize-over { background-position:-15px -30px; } .x-tool-restore { background-position:0 -45px; } .x-tool-restore-over { background-position:-15px -45px; } .x-tool-gear { background-position:0 -90px; } .x-tool-gear-over { background-position:-15px -90px; } .x-tool-prev { background-position:0 -105px; } .x-tool-prev-over { background-position:-15px -105px; } .x-tool-next { background-position:0 -120px; } .x-tool-next-over { background-position:-15px -120px; } .x-tool-pin { background-position:0 -135px; } .x-tool-pin-over { background-position:-15px -135px; } .x-tool-unpin { background-position:0 -150px; } .x-tool-unpin-over { background-position:-15px -150px; } .x-tool-right { background-position:0 -165px; } .x-tool-right-over { background-position:-15px -165px; } .x-tool-left { background-position:0 -180px; } .x-tool-left-over { background-position:-15px -180px; } .x-tool-down { background-position:0 -195px; } .x-tool-down-over { background-position:-15px -195px; } .x-tool-up { background-position:0 -210px; } .x-tool-up-over { background-position:-15px -210px; } .x-tool-refresh { background-position:0 -225px; } .x-tool-refresh-over { background-position:-15px -225px; } .x-tool-plus { background-position:0 -240px; } .x-tool-plus-over { background-position:-15px -240px; } .x-tool-minus { background-position:0 -255px; } .x-tool-minus-over { background-position:-15px -255px; } .x-tool-search { background-position:0 -270px; } .x-tool-search-over { background-position:-15px -270px; } .x-tool-save { background-position:0 -285px; } .x-tool-save-over { background-position:-15px -285px; } .x-tool-help { background-position:0 -300px; } .x-tool-help-over { background-position:-15px -300px; } .x-tool-print { background-position:0 -315px; } .x-tool-print-over { background-position:-15px -315px; } .x-tool-expand { background-position:0 -330px; } .x-tool-expand-over { background-position:-15px -330px; } .x-tool-collapse { background-position:0 -345px; } .x-tool-collapse-over { background-position:-15px -345px; } .x-tool-resize { background-position:0 -360px; } .x-tool-resize-over { background-position:-15px -360px; } .x-tool-move { background-position:0 -375px; } .x-tool-move-over { background-position:-15px -375px; } /* Ghosting */ .x-panel-ghost { z-index:12000; overflow:hidden; position:absolute; left:0;top:0; opacity:.65; -moz-opacity:.65; filter:alpha(opacity=65); } .x-panel-ghost ul { margin:0; padding:0; overflow:hidden; font-size:0; line-height:0; border:1px solid; border-top:0 none; display:block; } .x-panel-ghost * { cursor:move !important; } .x-panel-dd-spacer { border:2px dashed; } /* Buttons */ .x-panel-btns { padding:5px; overflow:hidden; } .x-panel-btns td.x-toolbar-cell{ padding:3px; } .x-panel-btns .x-btn-focus .x-btn-left{ background-position:0 -147px; } .x-panel-btns .x-btn-focus .x-btn-right{ background-position:0 -168px; } .x-panel-btns .x-btn-focus .x-btn-center{ background-position:0 -189px; } .x-panel-btns .x-btn-over .x-btn-left{ background-position:0 -63px; } .x-panel-btns .x-btn-over .x-btn-right{ background-position:0 -84px; } .x-panel-btns .x-btn-over .x-btn-center{ background-position:0 -105px; } .x-panel-btns .x-btn-click .x-btn-center{ background-position:0 -126px; } .x-panel-btns .x-btn-click .x-btn-right{ background-position:0 -84px; } .x-panel-btns .x-btn-click .x-btn-left{ background-position:0 -63px; } .x-panel-fbar td,.x-panel-fbar span,.x-panel-fbar input,.x-panel-fbar div,.x-panel-fbar select,.x-panel-fbar label{ white-space: nowrap; } /** * W3C Suggested Default style sheet for HTML 4 * http://www.w3.org/TR/CSS21/sample.html * * Resets for Ext.Panel @cfg normal: true */ .x-panel-reset .x-panel-body html, .x-panel-reset .x-panel-body address, .x-panel-reset .x-panel-body blockquote, .x-panel-reset .x-panel-body body, .x-panel-reset .x-panel-body dd, .x-panel-reset .x-panel-body div, .x-panel-reset .x-panel-body dl, .x-panel-reset .x-panel-body dt, .x-panel-reset .x-panel-body fieldset, .x-panel-reset .x-panel-body form, .x-panel-reset .x-panel-body frame, frameset, .x-panel-reset .x-panel-body h1, .x-panel-reset .x-panel-body h2, .x-panel-reset .x-panel-body h3, .x-panel-reset .x-panel-body h4, .x-panel-reset .x-panel-body h5, .x-panel-reset .x-panel-body h6, .x-panel-reset .x-panel-body noframes, .x-panel-reset .x-panel-body ol, .x-panel-reset .x-panel-body p, .x-panel-reset .x-panel-body ul, .x-panel-reset .x-panel-body center, .x-panel-reset .x-panel-body dir, .x-panel-reset .x-panel-body hr, .x-panel-reset .x-panel-body menu, .x-panel-reset .x-panel-body pre { display: block } .x-panel-reset .x-panel-body li { display: list-item } .x-panel-reset .x-panel-body head { display: none } .x-panel-reset .x-panel-body table { display: table } .x-panel-reset .x-panel-body tr { display: table-row } .x-panel-reset .x-panel-body thead { display: table-header-group } .x-panel-reset .x-panel-body tbody { display: table-row-group } .x-panel-reset .x-panel-body tfoot { display: table-footer-group } .x-panel-reset .x-panel-body col { display: table-column } .x-panel-reset .x-panel-body colgroup { display: table-column-group } .x-panel-reset .x-panel-body td, .x-panel-reset .x-panel-body th { display: table-cell } .x-panel-reset .x-panel-body caption { display: table-caption } .x-panel-reset .x-panel-body th { font-weight: bolder; text-align: center } .x-panel-reset .x-panel-body caption { text-align: center } .x-panel-reset .x-panel-body body { margin: 8px } .x-panel-reset .x-panel-body h1 { font-size: 2em; margin: .67em 0 } .x-panel-reset .x-panel-body h2 { font-size: 1.5em; margin: .75em 0 } .x-panel-reset .x-panel-body h3 { font-size: 1.17em; margin: .83em 0 } .x-panel-reset .x-panel-body h4, .x-panel-reset .x-panel-body p, .x-panel-reset .x-panel-body blockquote, .x-panel-reset .x-panel-body ul, .x-panel-reset .x-panel-body fieldset, .x-panel-reset .x-panel-body form, .x-panel-reset .x-panel-body ol, .x-panel-reset .x-panel-body dl, .x-panel-reset .x-panel-body dir, .x-panel-reset .x-panel-body menu { margin: 1.12em 0 } .x-panel-reset .x-panel-body h5 { font-size: .83em; margin: 1.5em 0 } .x-panel-reset .x-panel-body h6 { font-size: .75em; margin: 1.67em 0 } .x-panel-reset .x-panel-body h1, .x-panel-reset .x-panel-body h2, .x-panel-reset .x-panel-body h3, .x-panel-reset .x-panel-body h4, .x-panel-reset .x-panel-body h5, .x-panel-reset .x-panel-body h6, .x-panel-reset .x-panel-body b, .x-panel-reset .x-panel-body strong { font-weight: bolder } .x-panel-reset .x-panel-body blockquote { margin-left: 40px; margin-right: 40px } .x-panel-reset .x-panel-body i, .x-panel-reset .x-panel-body cite, .x-panel-reset .x-panel-body em, .x-panel-reset .x-panel-body var, .x-panel-reset .x-panel-body address { font-style: italic } .x-panel-reset .x-panel-body pre, .x-panel-reset .x-panel-body tt, .x-panel-reset .x-panel-body code, .x-panel-reset .x-panel-body kbd, .x-panel-reset .x-panel-body samp { font-family: monospace } .x-panel-reset .x-panel-body pre { white-space: pre } .x-panel-reset .x-panel-body button, .x-panel-reset .x-panel-body textarea, .x-panel-reset .x-panel-body input, .x-panel-reset .x-panel-body select { display: inline-block } .x-panel-reset .x-panel-body big { font-size: 1.17em } .x-panel-reset .x-panel-body small, .x-panel-reset .x-panel-body sub, .x-panel-reset .x-panel-body sup { font-size: .83em } .x-panel-reset .x-panel-body sub { vertical-align: sub } .x-panel-reset .x-panel-body sup { vertical-align: super } .x-panel-reset .x-panel-body table { border-spacing: 2px; } .x-panel-reset .x-panel-body thead, .x-panel-reset .x-panel-body tbody, .x-panel-reset .x-panel-body tfoot { vertical-align: middle } .x-panel-reset .x-panel-body td, .x-panel-reset .x-panel-body th { vertical-align: inherit } .x-panel-reset .x-panel-body s, .x-panel-reset .x-panel-body strike, .x-panel-reset .x-panel-body del { text-decoration: line-through } .x-panel-reset .x-panel-body hr { border: 1px inset } .x-panel-reset .x-panel-body ol, .x-panel-reset .x-panel-body ul, .x-panel-reset .x-panel-body dir, .x-panel-reset .x-panel-body menu, .x-panel-reset .x-panel-body dd { margin-left: 40px } .x-panel-reset .x-panel-body ul, .x-panel-reset .x-panel-body menu, .x-panel-reset .x-panel-body dir { list-style-type: disc;} .x-panel-reset .x-panel-body ol { list-style-type: decimal } .x-panel-reset .x-panel-body ol ul, .x-panel-reset .x-panel-body ul ol, .x-panel-reset .x-panel-body ul ul, .x-panel-reset .x-panel-body ol ol { margin-top: 0; margin-bottom: 0 } .x-panel-reset .x-panel-body u, .x-panel-reset .x-panel-body ins { text-decoration: underline } .x-panel-reset .x-panel-body br:before { content: "\A" } .x-panel-reset .x-panel-body :before, .x-panel-reset .x-panel-body :after { white-space: pre-line } .x-panel-reset .x-panel-body center { text-align: center } .x-panel-reset .x-panel-body :link, .x-panel-reset .x-panel-body :visited { text-decoration: underline } .x-panel-reset .x-panel-body :focus { outline: invert dotted thin } /* Begin bidirectionality settings (do not change) */ .x-panel-reset .x-panel-body BDO[DIR="ltr"] { direction: ltr; unicode-bidi: bidi-override } .x-panel-reset .x-panel-body BDO[DIR="rtl"] { direction: rtl; unicode-bidi: bidi-override } .x-window { zoom:1; } .x-window .x-window-handle { opacity:0; -moz-opacity:0; filter:alpha(opacity=0); } .x-window-proxy { border:1px solid; z-index:12000; overflow:hidden; position:absolute; left:0;top:0; display:none; opacity:.5; -moz-opacity:.5; filter:alpha(opacity=50); } .x-window-header { overflow:hidden; zoom:1; } .x-window-bwrap { z-index:1; position:relative; zoom:1; left:0;top:0; } .x-window-tl .x-window-header { padding:5px 0 4px 0; } .x-window-header-text { cursor:pointer; } .x-window-tc { background: transparent repeat-x 0 0; overflow:hidden; zoom:1; } .x-window-tl { background: transparent no-repeat 0 0; padding-left:6px; zoom:1; z-index:1; position:relative; } .x-window-tr { background: transparent no-repeat right 0; padding-right:6px; } .x-window-bc { background: transparent repeat-x 0 bottom; zoom:1; } .x-window-bc .x-window-footer { padding-bottom:6px; zoom:1; font-size:0; line-height:0; } .x-window-bl { background: transparent no-repeat 0 bottom; padding-left:6px; zoom:1; } .x-window-br { background: transparent no-repeat right bottom; padding-right:6px; zoom:1; } .x-window-mc { border:1px solid; padding:0; margin:0; } .x-window-ml { background: transparent repeat-y 0 0; padding-left:6px; zoom:1; } .x-window-mr { background: transparent repeat-y right 0; padding-right:6px; zoom:1; } .x-window-body { overflow:hidden; } .x-window-bwrap { overflow:hidden; } .x-window-maximized .x-window-bl, .x-window-maximized .x-window-br, .x-window-maximized .x-window-ml, .x-window-maximized .x-window-mr, .x-window-maximized .x-window-tl, .x-window-maximized .x-window-tr { padding:0; } .x-window-maximized .x-window-footer { padding-bottom:0; } .x-window-maximized .x-window-tc { padding-left:3px; padding-right:3px; } .x-window-maximized .x-window-mc { border-left:0 none; border-right:0 none; } .x-window-tbar .x-toolbar, .x-window-bbar .x-toolbar { border-left:0 none; border-right: 0 none; } .x-window-bbar .x-toolbar { border-top:1px solid; border-bottom:0 none; } .x-window-draggable, .x-window-draggable .x-window-header-text { cursor:move; } .x-window-maximized .x-window-draggable, .x-window-maximized .x-window-draggable .x-window-header-text { cursor:default; } .x-window-body { background-color:transparent; } .x-panel-ghost .x-window-tl { border-bottom:1px solid; } .x-panel-collapsed .x-window-tl { border-bottom:1px solid; } .x-window-maximized-ct { overflow:hidden; } .x-window-maximized .x-window-handle { display:none; } .x-window-sizing-ghost ul { border:0 none !important; } .x-dlg-focus{ -moz-outline:0 none; outline:0 none; width:0; height:0; overflow:hidden; position:absolute; top:0; left:0; } .ext-webkit .x-dlg-focus{ width: 1px; height: 1px; } .x-dlg-mask{ z-index:10000; display:none; position:absolute; top:0; left:0; -moz-opacity: 0.5; opacity:.50; filter: alpha(opacity=50); } body.ext-ie6.x-body-masked select { visibility:hidden; } body.ext-ie6.x-body-masked .x-window select { visibility:visible; } .x-window-plain .x-window-mc { border: 1px solid; } .x-window-plain .x-window-body { border: 1px solid; background:transparent !important; }.x-html-editor-wrap { border:1px solid; } .x-html-editor-tb .x-btn-text { background:transparent no-repeat; } .x-html-editor-tb .x-edit-bold, .x-menu-item img.x-edit-bold { background-position:0 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-italic, .x-menu-item img.x-edit-italic { background-position:-16px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-underline, .x-menu-item img.x-edit-underline { background-position:-32px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-forecolor, .x-menu-item img.x-edit-forecolor { background-position:-160px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-backcolor, .x-menu-item img.x-edit-backcolor { background-position:-176px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-justifyleft, .x-menu-item img.x-edit-justifyleft { background-position:-112px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-justifycenter, .x-menu-item img.x-edit-justifycenter { background-position:-128px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-justifyright, .x-menu-item img.x-edit-justifyright { background-position:-144px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-insertorderedlist, .x-menu-item img.x-edit-insertorderedlist { background-position:-80px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-insertunorderedlist, .x-menu-item img.x-edit-insertunorderedlist { background-position:-96px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-increasefontsize, .x-menu-item img.x-edit-increasefontsize { background-position:-48px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-decreasefontsize, .x-menu-item img.x-edit-decreasefontsize { background-position:-64px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-sourceedit, .x-menu-item img.x-edit-sourceedit { background-position:-192px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-createlink, .x-menu-item img.x-edit-createlink { background-position:-208px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tip .x-tip-bd .x-tip-bd-inner { padding:5px; padding-bottom:1px; } .x-html-editor-tb .x-toolbar { position:static !important; }.x-panel-noborder .x-panel-body-noborder { border-width:0; } .x-panel-noborder .x-panel-header-noborder { border-width:0 0 1px; border-style:solid; } .x-panel-noborder .x-panel-tbar-noborder .x-toolbar { border-width:0 0 1px; border-style:solid; } .x-panel-noborder .x-panel-bbar-noborder .x-toolbar { border-width:1px 0 0 0; border-style:solid; } .x-window-noborder .x-window-mc { border-width:0; } .x-window-plain .x-window-body-noborder { border-width:0; } .x-tab-panel-noborder .x-tab-panel-body-noborder { border-width:0; } .x-tab-panel-noborder .x-tab-panel-header-noborder { border-width: 0 0 1px 0; } .x-tab-panel-noborder .x-tab-panel-footer-noborder { border-width: 1px 0 0 0; } .x-tab-panel-bbar-noborder .x-toolbar { border-width: 1px 0 0 0; border-style:solid; } .x-tab-panel-tbar-noborder .x-toolbar { border-width:0 0 1px; border-style:solid; }.x-border-layout-ct { position: relative; } .x-border-panel { position:absolute; left:0; top:0; } .x-tool-collapse-south { background-position:0 -195px; } .x-tool-collapse-south-over { background-position:-15px -195px; } .x-tool-collapse-north { background-position:0 -210px; } .x-tool-collapse-north-over { background-position:-15px -210px; } .x-tool-collapse-west { background-position:0 -180px; } .x-tool-collapse-west-over { background-position:-15px -180px; } .x-tool-collapse-east { background-position:0 -165px; } .x-tool-collapse-east-over { background-position:-15px -165px; } .x-tool-expand-south { background-position:0 -210px; } .x-tool-expand-south-over { background-position:-15px -210px; } .x-tool-expand-north { background-position:0 -195px; } .x-tool-expand-north-over { background-position:-15px -195px; } .x-tool-expand-west { background-position:0 -165px; } .x-tool-expand-west-over { background-position:-15px -165px; } .x-tool-expand-east { background-position:0 -180px; } .x-tool-expand-east-over { background-position:-15px -180px; } .x-tool-expand-north, .x-tool-expand-south { float:right; margin:3px; } .x-tool-expand-east, .x-tool-expand-west { float:none; margin:3px 2px; } .x-accordion-hd .x-tool-toggle { background-position:0 -255px; } .x-accordion-hd .x-tool-toggle-over { background-position:-15px -255px; } .x-panel-collapsed .x-accordion-hd .x-tool-toggle { background-position:0 -240px; } .x-panel-collapsed .x-accordion-hd .x-tool-toggle-over { background-position:-15px -240px; } .x-accordion-hd { padding-top:4px; padding-bottom:3px; border-top:0 none; background: transparent repeat-x 0 -9px; } .x-layout-collapsed{ position:absolute; left:-10000px; top:-10000px; visibility:hidden; width:20px; height:20px; overflow:hidden; border:1px solid; z-index:20; } .ext-border-box .x-layout-collapsed{ width:22px; height:22px; } .x-layout-collapsed-over{ cursor:pointer; } .x-layout-collapsed-west .x-layout-collapsed-tools, .x-layout-collapsed-east .x-layout-collapsed-tools{ position:absolute; top:0; left:0; width:20px; height:20px; } .x-layout-split{ position:absolute; height:5px; width:5px; line-height:1px; font-size:1px; z-index:3; background-color:transparent; } /* IE6 strict won't drag w/out a color */ .ext-strict .ext-ie6 .x-layout-split{ background-color: #fff !important; filter: alpha(opacity=1); } .x-layout-split-h{ background-image:url(../images/default/s.gif); background-position: left; } .x-layout-split-v{ background-image:url(../images/default/s.gif); background-position: top; } .x-column-layout-ct { overflow:hidden; zoom:1; } .x-column { float:left; padding:0; margin:0; overflow:hidden; zoom:1; } .x-column-inner { overflow:hidden; zoom:1; } /* mini mode */ .x-layout-mini { position:absolute; top:0; left:0; display:block; width:5px; height:35px; cursor:pointer; opacity:.5; -moz-opacity:.5; filter:alpha(opacity=50); } .x-layout-mini-over, .x-layout-collapsed-over .x-layout-mini{ opacity:1; -moz-opacity:1; filter:none; } .x-layout-split-west .x-layout-mini { top:48%; } .x-layout-split-east .x-layout-mini { top:48%; } .x-layout-split-north .x-layout-mini { left:48%; height:5px; width:35px; } .x-layout-split-south .x-layout-mini { left:48%; height:5px; width:35px; } .x-layout-cmini-west .x-layout-mini { top:48%; } .x-layout-cmini-east .x-layout-mini { top:48%; } .x-layout-cmini-north .x-layout-mini { left:48%; height:5px; width:35px; } .x-layout-cmini-south .x-layout-mini { left:48%; height:5px; width:35px; } .x-layout-cmini-west, .x-layout-cmini-east { border:0 none; width:5px !important; padding:0; background-color:transparent; } .x-layout-cmini-north, .x-layout-cmini-south { border:0 none; height:5px !important; padding:0; background-color:transparent; } .x-viewport, .x-viewport body { margin: 0; padding: 0; border: 0 none; overflow: hidden; height: 100%; } .x-abs-layout-item { position:absolute; left:0; top:0; } .ext-ie input.x-abs-layout-item, .ext-ie textarea.x-abs-layout-item { margin:0; } .x-box-layout-ct { overflow:hidden; zoom:1; } .x-box-inner { overflow:hidden; zoom:1; position:relative; left:0; top:0; } .x-box-item { position:absolute; left:0; top:0; }.x-progress-wrap { border:1px solid; overflow:hidden; } .x-progress-inner { height:18px; background:repeat-x; position:relative; } .x-progress-bar { height:18px; float:left; width:0; background: repeat-x left center; border-top:1px solid; border-bottom:1px solid; border-right:1px solid; } .x-progress-text { padding:1px 5px; overflow:hidden; position:absolute; left:0; text-align:center; } .x-progress-text-back { line-height:16px; } .ext-ie .x-progress-text-back { line-height:15px; } .ext-strict .ext-ie7 .x-progress-text-back{ width: 100%; } .x-list-header{ background: repeat-x 0 bottom; cursor:default; zoom:1; height:22px; } .x-list-header-inner div { display:block; float:left; overflow:hidden; -o-text-overflow: ellipsis; text-overflow: ellipsis; white-space: nowrap; } .x-list-header-inner div em { display:block; border-left:1px solid; padding:4px 4px; overflow:hidden; -moz-user-select: none; -khtml-user-select: none; line-height:14px; } .x-list-body { overflow:auto; overflow-x:hidden; overflow-y:auto; zoom:1; float: left; width: 100%; } .x-list-body dl { zoom:1; } .x-list-body dt { display:block; float:left; overflow:hidden; -o-text-overflow: ellipsis; text-overflow: ellipsis; white-space: nowrap; cursor:pointer; zoom:1; } .x-list-body dt em { display:block; padding:3px 4px; overflow:hidden; -moz-user-select: none; -khtml-user-select: none; } .x-list-resizer { border-left:1px solid; border-right:1px solid; position:absolute; left:0; top:0; } .x-list-header-inner em.sort-asc { background: transparent no-repeat center 0; border-style:solid; border-width: 0 1px 1px; padding-bottom:3px; } .x-list-header-inner em.sort-desc { background: transparent no-repeat center -23px; border-style:solid; border-width: 0 1px 1px; padding-bottom:3px; } /* Shared styles */ .x-slider { zoom:1; } .x-slider-inner { position:relative; left:0; top:0; overflow:visible; zoom:1; } .x-slider-focus { position:absolute; left:0; top:0; width:1px; height:1px; line-height:1px; font-size:1px; -moz-outline:0 none; outline:0 none; -moz-user-select: none; -khtml-user-select:none; -webkit-user-select:ignore; display:block; overflow:hidden; } /* Horizontal styles */ .x-slider-horz { padding-left:7px; background:transparent no-repeat 0 -22px; } .x-slider-horz .x-slider-end { padding-right:7px; zoom:1; background:transparent no-repeat right -44px; } .x-slider-horz .x-slider-inner { background:transparent repeat-x 0 0; height:22px; } .x-slider-horz .x-slider-thumb { width:14px; height:15px; position:absolute; left:0; top:3px; background:transparent no-repeat 0 0; } .x-slider-horz .x-slider-thumb-over { background-position: -14px -15px; } .x-slider-horz .x-slider-thumb-drag { background-position: -28px -30px; } /* Vertical styles */ .x-slider-vert { padding-top:7px; background:transparent no-repeat -44px 0; width:22px; } .x-slider-vert .x-slider-end { padding-bottom:7px; zoom:1; background:transparent no-repeat -22px bottom; } .x-slider-vert .x-slider-inner { background:transparent repeat-y 0 0; } .x-slider-vert .x-slider-thumb { width:15px; height:14px; position:absolute; left:3px; bottom:0; background:transparent no-repeat 0 0; } .x-slider-vert .x-slider-thumb-over { background-position: -15px -14px; } .x-slider-vert .x-slider-thumb-drag { background-position: -30px -28px; }.x-window-dlg .x-window-body { border:0 none !important; padding:5px 10px; overflow:hidden !important; } .x-window-dlg .x-window-mc { border:0 none !important; } .x-window-dlg .ext-mb-input { margin-top:4px; width:95%; } .x-window-dlg .ext-mb-textarea { margin-top:4px; } .x-window-dlg .x-progress-wrap { margin-top:4px; } .ext-ie .x-window-dlg .x-progress-wrap { margin-top:6px; } .x-window-dlg .x-msg-box-wait { background:transparent no-repeat left; display:block; width:300px; padding-left:18px; line-height:18px; } .x-window-dlg .ext-mb-icon { float:left; width:47px; height:32px; } .x-window-dlg .x-dlg-icon .ext-mb-content{ zoom: 1; margin-left: 47px; } .x-window-dlg .ext-mb-info, .x-window-dlg .ext-mb-warning, .x-window-dlg .ext-mb-question, .x-window-dlg .ext-mb-error { background:transparent no-repeat top left; } .ext-gecko2 .ext-mb-fix-cursor { overflow:auto; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/ext-all.css000066400000000000000000004205071226600447100224160ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ html,body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td{margin:0;padding:0;}img,body,html{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}ol,ul {list-style:none;}caption,th {text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;}q:before,q:after{content:'';} .ext-forced-border-box, .ext-forced-border-box * { -moz-box-sizing: border-box; -ms-box-sizing: border-box; -webkit-box-sizing: border-box; } .ext-el-mask { z-index: 100; position: absolute; top:0; left:0; -moz-opacity: 0.5; opacity: .50; filter: alpha(opacity=50); width: 100%; height: 100%; zoom: 1; } .ext-el-mask-msg { z-index: 20001; position: absolute; top: 0; left: 0; border:1px solid; background:repeat-x 0 -16px; padding:2px; } .ext-el-mask-msg div { padding:5px 10px 5px 10px; border:1px solid; cursor:wait; } .ext-shim { position:absolute; visibility:hidden; left:0; top:0; overflow:hidden; } .ext-ie .ext-shim { filter: alpha(opacity=0); } .ext-ie6 .ext-shim { margin-left: 5px; margin-top: 3px; } .x-mask-loading div { padding:5px 10px 5px 25px; background:no-repeat 5px 5px; line-height:16px; } /* class for hiding elements without using display:none */ .x-hidden, .x-hide-offsets { position:absolute !important; left:-10000px; top:-10000px; visibility:hidden; } .x-hide-display { display:none !important; } .x-hide-nosize, .x-hide-nosize * /* Emulate display:none for children */ { height:0px!important; width:0px!important; visibility:hidden!important; border:none!important; zoom:1; } .x-hide-visibility { visibility:hidden !important; } .x-masked { overflow: hidden !important; } .x-masked-relative { position: relative !important; } .x-masked select, .x-masked object, .x-masked embed { visibility: hidden; } .x-layer { visibility: hidden; } .x-unselectable, .x-unselectable * { -moz-user-select: none; -khtml-user-select: none; -webkit-user-select:ignore; } .x-repaint { zoom: 1; background-color: transparent; -moz-outline: none; outline: none; } .x-item-disabled { cursor: default; opacity: .6; -moz-opacity: .6; filter: alpha(opacity=60); } .x-item-disabled * { cursor: default !important; } .x-form-radio-group .x-item-disabled { filter: none; } .x-splitbar-proxy { position: absolute; visibility: hidden; z-index: 20001; zoom: 1; line-height: 1px; font-size: 1px; overflow: hidden; } .x-splitbar-h, .x-splitbar-proxy-h { cursor: e-resize; cursor: col-resize; } .x-splitbar-v, .x-splitbar-proxy-v { cursor: s-resize; cursor: row-resize; } .x-color-palette { width: 150px; height: 92px; cursor: pointer; } .x-color-palette a { border: 1px solid; float: left; padding: 2px; text-decoration: none; -moz-outline: 0 none; outline: 0 none; cursor: pointer; } .x-color-palette a:hover, .x-color-palette a.x-color-palette-sel { border: 1px solid; } .x-color-palette em { display: block; border: 1px solid; } .x-color-palette em span { cursor: pointer; display: block; height: 10px; line-height: 10px; width: 10px; } .x-ie-shadow { display: none; position: absolute; overflow: hidden; left:0; top:0; zoom:1; } .x-shadow { display: none; position: absolute; overflow: hidden; left:0; top:0; } .x-shadow * { overflow: hidden; } .x-shadow * { padding: 0; border: 0; margin: 0; clear: none; zoom: 1; } /* top bottom */ .x-shadow .xstc, .x-shadow .xsbc { height: 6px; float: left; } /* corners */ .x-shadow .xstl, .x-shadow .xstr, .x-shadow .xsbl, .x-shadow .xsbr { width: 6px; height: 6px; float: left; } /* sides */ .x-shadow .xsc { width: 100%; } .x-shadow .xsml, .x-shadow .xsmr { width: 6px; float: left; height: 100%; } .x-shadow .xsmc { float: left; height: 100%; background-color: transparent; } .x-shadow .xst, .x-shadow .xsb { height: 6px; overflow: hidden; width: 100%; } .x-shadow .xsml { background: transparent repeat-y 0 0; } .x-shadow .xsmr { background: transparent repeat-y -6px 0; } .x-shadow .xstl { background: transparent no-repeat 0 0; } .x-shadow .xstc { background: transparent repeat-x 0 -30px; } .x-shadow .xstr { background: transparent repeat-x 0 -18px; } .x-shadow .xsbl { background: transparent no-repeat 0 -12px; } .x-shadow .xsbc { background: transparent repeat-x 0 -36px; } .x-shadow .xsbr { background: transparent repeat-x 0 -6px; } .loading-indicator { background: no-repeat left; padding-left: 20px; line-height: 16px; margin: 3px; } .x-text-resize { position: absolute; left: -1000px; top: -1000px; visibility: hidden; zoom: 1; } .x-drag-overlay { width: 100%; height: 100%; display: none; position: absolute; left: 0; top: 0; background-image:url(../images/default/s.gif); z-index: 20000; } .x-clear { clear:both; height:0; overflow:hidden; line-height:0; font-size:0; } .x-spotlight { z-index: 8999; position: absolute; top:0; left:0; -moz-opacity: 0.5; opacity: .50; filter: alpha(opacity=50); width:0; height:0; zoom: 1; } #x-history-frame { position:absolute; top:-1px; left:0; width:1px; height:1px; visibility:hidden; } #x-history-field { position:absolute; top:0; left:-1px; width:1px; height:1px; visibility:hidden; } .x-resizable-handle { position:absolute; z-index:100; /* ie needs these */ font-size:1px; line-height:6px; overflow:hidden; filter:alpha(opacity=0); opacity:0; zoom:1; } .x-resizable-handle-east{ width:6px; cursor:e-resize; right:0; top:0; height:100%; } .ext-ie .x-resizable-handle-east { margin-right:-1px; /*IE rounding error*/ } .x-resizable-handle-south{ width:100%; cursor:s-resize; left:0; bottom:0; height:6px; } .ext-ie .x-resizable-handle-south { margin-bottom:-1px; /*IE rounding error*/ } .x-resizable-handle-west{ width:6px; cursor:w-resize; left:0; top:0; height:100%; } .x-resizable-handle-north{ width:100%; cursor:n-resize; left:0; top:0; height:6px; } .x-resizable-handle-southeast{ width:6px; cursor:se-resize; right:0; bottom:0; height:6px; z-index:101; } .x-resizable-handle-northwest{ width:6px; cursor:nw-resize; left:0; top:0; height:6px; z-index:101; } .x-resizable-handle-northeast{ width:6px; cursor:ne-resize; right:0; top:0; height:6px; z-index:101; } .x-resizable-handle-southwest{ width:6px; cursor:sw-resize; left:0; bottom:0; height:6px; z-index:101; } .x-resizable-over .x-resizable-handle, .x-resizable-pinned .x-resizable-handle{ filter:alpha(opacity=100); opacity:1; } .x-resizable-over .x-resizable-handle-east, .x-resizable-pinned .x-resizable-handle-east, .x-resizable-over .x-resizable-handle-west, .x-resizable-pinned .x-resizable-handle-west { background-position: left; } .x-resizable-over .x-resizable-handle-south, .x-resizable-pinned .x-resizable-handle-south, .x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north { background-position: top; } .x-resizable-over .x-resizable-handle-southeast, .x-resizable-pinned .x-resizable-handle-southeast{ background-position: top left; } .x-resizable-over .x-resizable-handle-northwest, .x-resizable-pinned .x-resizable-handle-northwest{ background-position:bottom right; } .x-resizable-over .x-resizable-handle-northeast, .x-resizable-pinned .x-resizable-handle-northeast{ background-position: bottom left; } .x-resizable-over .x-resizable-handle-southwest, .x-resizable-pinned .x-resizable-handle-southwest{ background-position: top right; } .x-resizable-proxy{ border: 1px dashed; position:absolute; overflow:hidden; display:none; left:0; top:0; z-index:50000; } .x-resizable-overlay{ width:100%; height:100%; display:none; position:absolute; left:0; top:0; z-index:200000; -moz-opacity: 0; opacity:0; filter: alpha(opacity=0); } .x-tab-panel { overflow:hidden; } .x-tab-panel-header, .x-tab-panel-footer { border: 1px solid; overflow:hidden; zoom:1; } .x-tab-panel-header { border: 1px solid; padding-bottom: 2px; } .x-tab-panel-footer { border: 1px solid; padding-top: 2px; } .x-tab-strip-wrap { width:100%; overflow:hidden; position:relative; zoom:1; } ul.x-tab-strip { display:block; width:5000px; zoom:1; } ul.x-tab-strip-top{ padding-top: 1px; background: repeat-x bottom; border-bottom: 1px solid; } ul.x-tab-strip-bottom{ padding-bottom: 1px; background: repeat-x top; border-top: 1px solid; border-bottom: 0 none; } .x-tab-panel-header-plain .x-tab-strip-top { background:transparent !important; padding-top:0 !important; } .x-tab-panel-header-plain { background:transparent !important; border-width:0 !important; padding-bottom:0 !important; } .x-tab-panel-header-plain .x-tab-strip-spacer, .x-tab-panel-footer-plain .x-tab-strip-spacer { border:1px solid; height:2px; font-size:1px; line-height:1px; } .x-tab-panel-header-plain .x-tab-strip-spacer { border-top: 0 none; } .x-tab-panel-footer-plain .x-tab-strip-spacer { border-bottom: 0 none; } .x-tab-panel-footer-plain .x-tab-strip-bottom { background:transparent !important; padding-bottom:0 !important; } .x-tab-panel-footer-plain { background:transparent !important; border-width:0 !important; padding-top:0 !important; } .ext-border-box .x-tab-panel-header-plain .x-tab-strip-spacer, .ext-border-box .x-tab-panel-footer-plain .x-tab-strip-spacer { height:3px; } ul.x-tab-strip li { float:left; margin-left:2px; } ul.x-tab-strip li.x-tab-edge { float:left; margin:0 !important; padding:0 !important; border:0 none !important; font-size:1px !important; line-height:1px !important; overflow:hidden; zoom:1; background:transparent !important; width:1px; } .x-tab-strip a, .x-tab-strip span, .x-tab-strip em { display:block; } .x-tab-strip a { text-decoration:none !important; -moz-outline: none; outline: none; cursor:pointer; } .x-tab-strip-inner { overflow:hidden; text-overflow: ellipsis; } .x-tab-strip span.x-tab-strip-text { white-space: nowrap; cursor:pointer; padding:4px 0; } .x-tab-strip-top .x-tab-with-icon .x-tab-right { padding-left:6px; } .x-tab-strip .x-tab-with-icon span.x-tab-strip-text { padding-left:20px; background-position: 0 3px; background-repeat: no-repeat; } .x-tab-strip-active, .x-tab-strip-active a.x-tab-right { cursor:default; } .x-tab-strip-active span.x-tab-strip-text { cursor:default; } .x-tab-strip-disabled .x-tabs-text { cursor:default; } .x-tab-panel-body { overflow:hidden; } .x-tab-panel-bwrap { overflow:hidden; } .ext-ie .x-tab-strip .x-tab-right { position:relative; } .x-tab-strip-top .x-tab-strip-active .x-tab-right { margin-bottom:-1px; } /* * Horrible hack for IE8 in quirks mode */ .ext-ie8 .x-tab-strip li { position: relative; } .ext-border-box .ext-ie8 .x-tab-strip-top .x-tab-right { top: 1px; } .ext-ie8 .x-tab-strip-top { padding-top: 1; } .ext-border-box .ext-ie8 .x-tab-strip-top { padding-top: 0; } .ext-ie8 .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close { top:3px; } .ext-border-box .ext-ie8 .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close { top:4px; } .ext-ie8 .x-tab-strip-bottom .x-tab-right{ top:0; } .x-tab-strip-top .x-tab-strip-active .x-tab-right span.x-tab-strip-text { padding-bottom:5px; } .x-tab-strip-bottom .x-tab-strip-active .x-tab-right { margin-top:-1px; } .x-tab-strip-bottom .x-tab-strip-active .x-tab-right span.x-tab-strip-text { padding-top:5px; } .x-tab-strip-top .x-tab-right { background: transparent no-repeat 0 -51px; padding-left:10px; } .x-tab-strip-top .x-tab-left { background: transparent no-repeat right -351px; padding-right:10px; } .x-tab-strip-top .x-tab-strip-inner { background: transparent repeat-x 0 -201px; } .x-tab-strip-top .x-tab-strip-over .x-tab-right { background-position:0 -101px; } .x-tab-strip-top .x-tab-strip-over .x-tab-left { background-position:right -401px; } .x-tab-strip-top .x-tab-strip-over .x-tab-strip-inner { background-position:0 -251px; } .x-tab-strip-top .x-tab-strip-active .x-tab-right { background-position: 0 0; } .x-tab-strip-top .x-tab-strip-active .x-tab-left { background-position: right -301px; } .x-tab-strip-top .x-tab-strip-active .x-tab-strip-inner { background-position: 0 -151px; } .x-tab-strip-bottom .x-tab-right { background: no-repeat bottom right; } .x-tab-strip-bottom .x-tab-left { background: no-repeat bottom left; } .x-tab-strip-bottom .x-tab-strip-active .x-tab-right { background: no-repeat bottom right; } .x-tab-strip-bottom .x-tab-strip-active .x-tab-left { background: no-repeat bottom left; } .x-tab-strip-bottom .x-tab-left { margin-right: 3px; padding:0 10px; } .x-tab-strip-bottom .x-tab-right { padding:0; } .x-tab-strip .x-tab-strip-close { display:none; } .x-tab-strip-closable { position:relative; } .x-tab-strip-closable .x-tab-left { padding-right:19px; } .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close { opacity:.6; -moz-opacity:.6; background-repeat:no-repeat; display:block; width:11px; height:11px; position:absolute; top:3px; right:3px; cursor:pointer; z-index:2; } .x-tab-strip .x-tab-strip-active a.x-tab-strip-close { opacity:.8; -moz-opacity:.8; } .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close:hover{ opacity:1; -moz-opacity:1; } .x-tab-panel-body { border: 1px solid; } .x-tab-panel-body-top { border-top: 0 none; } .x-tab-panel-body-bottom { border-bottom: 0 none; } .x-tab-scroller-left { background: transparent no-repeat -18px 0; border-bottom: 1px solid; width:18px; position:absolute; left:0; top:0; z-index:10; cursor:pointer; } .x-tab-scroller-left-over { background-position: 0 0; } .x-tab-scroller-left-disabled { background-position: -18px 0; opacity:.5; -moz-opacity:.5; filter:alpha(opacity=50); cursor:default; } .x-tab-scroller-right { background: transparent no-repeat 0 0; border-bottom: 1px solid; width:18px; position:absolute; right:0; top:0; z-index:10; cursor:pointer; } .x-tab-scroller-right-over { background-position: -18px 0; } .x-tab-scroller-right-disabled { background-position: 0 0; opacity:.5; -moz-opacity:.5; filter:alpha(opacity=50); cursor:default; } .x-tab-scrolling-bottom .x-tab-scroller-left, .x-tab-scrolling-bottom .x-tab-scroller-right{ margin-top: 1px; } .x-tab-scrolling .x-tab-strip-wrap { margin-left:18px; margin-right:18px; } .x-tab-scrolling { position:relative; } .x-tab-panel-bbar .x-toolbar { border:1px solid; border-top:0 none; overflow:hidden; padding:2px; } .x-tab-panel-tbar .x-toolbar { border:1px solid; border-top:0 none; overflow:hidden; padding:2px; }/* all fields */ .x-form-field{ margin: 0 0 0 0; } .ext-webkit *:focus{ outline: none !important; } /* ---- text fields ---- */ .x-form-text, textarea.x-form-field{ padding:1px 3px; background:repeat-x 0 0; border:1px solid; } textarea.x-form-field { padding:2px 3px; } .x-form-text, .ext-ie .x-form-file { height:22px; line-height:18px; vertical-align:middle; } .ext-ie6 .x-form-text, .ext-ie7 .x-form-text { margin:-1px 0; /* ie bogus margin bug */ height:22px; /* ie quirks */ line-height:18px; } .x-quirks .ext-ie9 .x-form-text { height: 22px; padding-top: 3px; padding-bottom: 0px; } /* Ugly hacks for the bogus 1px margin bug in IE9 quirks */ .x-quirks .ext-ie9 .x-input-wrapper .x-form-text, .x-quirks .ext-ie9 .x-form-field-trigger-wrap .x-form-text { margin-top: -1px; margin-bottom: -1px; } .x-quirks .ext-ie9 .x-input-wrapper .x-form-element { margin-bottom: -1px; } .ext-ie6 .x-form-field-wrap .x-form-file-btn, .ext-ie7 .x-form-field-wrap .x-form-file-btn { top: -1px; /* because of all these margin hacks, these buttons are off by one pixel in IE6,7 */ } .ext-ie6 textarea.x-form-field, .ext-ie7 textarea.x-form-field { margin:-1px 0; /* ie bogus margin bug */ } .ext-strict .x-form-text { height:18px; } .ext-safari.ext-mac textarea.x-form-field { margin-bottom:-2px; /* another bogus margin bug, safari/mac only */ } /* .ext-strict .ext-ie8 .x-form-text, .ext-strict .ext-ie8 textarea.x-form-field { margin-bottom: 1px; } */ .ext-gecko .x-form-text , .ext-ie8 .x-form-text { padding-top:2px; /* FF won't center the text vertically */ padding-bottom:0; } .ext-ie6 .x-form-composite .x-form-text.x-box-item, .ext-ie7 .x-form-composite .x-form-text.x-box-item { margin: 0 !important; /* clear ie bogus margin bug fix */ } textarea { resize: none; /* Disable browser resizable textarea */ } /* select boxes */ .x-form-select-one { height:20px; line-height:18px; vertical-align:middle; border: 1px solid; } /* multi select boxes */ /* --- TODO --- */ /* 2.0.2 style */ .x-form-check-wrap { line-height:18px; height: auto; } .ext-ie .x-form-check-wrap input { width:15px; height:15px; } .x-form-check-wrap input{ vertical-align: bottom; } .x-editor .x-form-check-wrap { padding:3px; } .x-editor .x-form-checkbox { height:13px; } .x-form-check-group-label { border-bottom: 1px solid; margin-bottom: 5px; padding-left: 3px !important; float: none !important; } /* wrapped fields and triggers */ .x-form-field-wrap .x-form-trigger{ width:17px; height:21px; border:0; background:transparent no-repeat 0 0; cursor:pointer; border-bottom: 1px solid; position:absolute; top:0; } .x-form-field-wrap .x-form-date-trigger, .x-form-field-wrap .x-form-clear-trigger, .x-form-field-wrap .x-form-search-trigger{ cursor:pointer; } .x-form-field-wrap .x-form-twin-triggers .x-form-trigger{ position:static; top:auto; vertical-align:top; } .x-form-field-wrap { position:relative; left:0;top:0; text-align: left; zoom:1; white-space: nowrap; } .ext-strict .ext-ie8 .x-toolbar-cell .x-form-field-trigger-wrap .x-form-trigger { right: 0; /* IE8 Strict mode trigger bug */ } .x-form-field-wrap .x-form-trigger-over{ background-position:-17px 0; } .x-form-field-wrap .x-form-trigger-click{ background-position:-34px 0; } .x-trigger-wrap-focus .x-form-trigger{ background-position:-51px 0; } .x-trigger-wrap-focus .x-form-trigger-over{ background-position:-68px 0; } .x-trigger-wrap-focus .x-form-trigger-click{ background-position:-85px 0; } .x-trigger-wrap-focus .x-form-trigger{ border-bottom: 1px solid; } .x-item-disabled .x-form-trigger-over{ background-position:0 0 !important; border-bottom: 1px solid; } .x-item-disabled .x-form-trigger-click{ background-position:0 0 !important; border-bottom: 1px solid; } .x-trigger-noedit{ cursor:pointer; } /* field focus style */ .x-form-focus, textarea.x-form-focus{ border: 1px solid; } /* invalid fields */ .x-form-invalid, textarea.x-form-invalid{ background:repeat-x bottom; border: 1px solid; } .x-form-inner-invalid, textarea.x-form-inner-invalid{ background:repeat-x bottom; } /* editors */ .x-editor { visibility:hidden; padding:0; margin:0; } .x-form-grow-sizer { left: -10000px; padding: 8px 3px; position: absolute; visibility:hidden; top: -10000px; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word; zoom:1; } .x-form-grow-sizer p { margin:0 !important; border:0 none !important; padding:0 !important; } /* Form Items CSS */ .x-form-item { display:block; margin-bottom:4px; zoom:1; } .x-form-item label.x-form-item-label { display:block; float:left; width:100px; padding:3px; padding-left:0; clear:left; z-index:2; position:relative; } .x-form-element { padding-left:105px; position:relative; } .x-form-invalid-msg { padding:2px; padding-left:18px; background: transparent no-repeat 0 2px; line-height:16px; width:200px; } .x-form-label-left label.x-form-item-label { text-align:left; } .x-form-label-right label.x-form-item-label { text-align:right; } .x-form-label-top .x-form-item label.x-form-item-label { width:auto; float:none; clear:none; display:inline; margin-bottom:4px; position:static; } .x-form-label-top .x-form-element { padding-left:0; padding-top:4px; } .x-form-label-top .x-form-item { padding-bottom:4px; } /* Editor small font for grid, toolbar and tree */ .x-small-editor .x-form-text { height:20px; line-height:16px; vertical-align:middle; } .ext-ie6 .x-small-editor .x-form-text, .ext-ie7 .x-small-editor .x-form-text { margin-top:-1px !important; /* ie bogus margin bug */ margin-bottom:-1px !important; height:20px !important; /* ie quirks */ line-height:16px !important; } .ext-strict .x-small-editor .x-form-text { height:16px !important; } .ext-ie6 .x-small-editor .x-form-text, .ext-ie7 .x-small-editor .x-form-text { height:20px; line-height:16px; } .ext-border-box .x-small-editor .x-form-text { height:20px; } .x-small-editor .x-form-select-one { height:20px; line-height:16px; vertical-align:middle; } .x-small-editor .x-form-num-field { text-align:right; } .x-small-editor .x-form-field-wrap .x-form-trigger{ height:19px; } .ext-webkit .x-small-editor .x-form-text{padding-top:3px;font-size:100%;} .ext-strict .ext-webkit .x-small-editor .x-form-text{ height:14px !important; } .x-form-clear { clear:both; height:0; overflow:hidden; line-height:0; font-size:0; } .x-form-clear-left { clear:left; height:0; overflow:hidden; line-height:0; font-size:0; } .ext-ie6 .x-form-check-wrap input, .ext-border-box .x-form-check-wrap input{ margin-top: 3px; } .x-form-cb-label { position: relative; margin-left:4px; top: 2px; } .ext-ie .x-form-cb-label{ top: 1px; } .ext-ie6 .x-form-cb-label, .ext-border-box .x-form-cb-label{ top: 3px; } .x-form-display-field{ padding-top: 2px; } .ext-gecko .x-form-display-field, .ext-strict .ext-ie7 .x-form-display-field{ padding-top: 1px; } .ext-ie .x-form-display-field{ padding-top: 3px; } .ext-strict .ext-ie8 .x-form-display-field{ padding-top: 0; } .x-form-column { float:left; padding:0; margin:0; width:48%; overflow:hidden; zoom:1; } /* buttons */ .x-form .x-form-btns-ct .x-btn{ float:right; clear:none; } .x-form .x-form-btns-ct .x-form-btns td { border:0; padding:0; } .x-form .x-form-btns-ct .x-form-btns-right table{ float:right; clear:none; } .x-form .x-form-btns-ct .x-form-btns-left table{ float:left; clear:none; } .x-form .x-form-btns-ct .x-form-btns-center{ text-align:center; /*ie*/ } .x-form .x-form-btns-ct .x-form-btns-center table{ margin:0 auto; /*everyone else*/ } .x-form .x-form-btns-ct table td.x-form-btn-td{ padding:3px; } .x-form .x-form-btns-ct .x-btn-focus .x-btn-left{ background-position:0 -147px; } .x-form .x-form-btns-ct .x-btn-focus .x-btn-right{ background-position:0 -168px; } .x-form .x-form-btns-ct .x-btn-focus .x-btn-center{ background-position:0 -189px; } .x-form .x-form-btns-ct .x-btn-click .x-btn-center{ background-position:0 -126px; } .x-form .x-form-btns-ct .x-btn-click .x-btn-right{ background-position:0 -84px; } .x-form .x-form-btns-ct .x-btn-click .x-btn-left{ background-position:0 -63px; } .x-form-invalid-icon { width:16px; height:18px; visibility:hidden; position:absolute; left:0; top:0; display:block; background:transparent no-repeat 0 2px; } /* fieldsets */ .x-fieldset { border:1px solid; padding:10px; margin-bottom:10px; display:block; /* preserve margins in IE */ } /* make top of checkbox/tools visible in webkit */ .ext-webkit .x-fieldset-header { padding-top: 1px; } .ext-ie .x-fieldset legend { margin-bottom:10px; } .ext-strict .ext-ie9 .x-fieldset legend.x-fieldset-header { padding-top: 1px; } .ext-ie .x-fieldset { padding-top: 0; padding-bottom:10px; } .x-fieldset legend .x-tool-toggle { margin-right:3px; margin-left:0; float:left !important; } .x-fieldset legend input { margin-right:3px; float:left !important; height:13px; width:13px; } fieldset.x-panel-collapsed { padding-bottom:0 !important; border-width: 1px 1px 0 1px !important; border-left-color: transparent; border-right-color: transparent; } .ext-ie6 fieldset.x-panel-collapsed{ padding-bottom:0 !important; border-width: 1px 0 0 0 !important; margin-left: 1px; margin-right: 1px; } fieldset.x-panel-collapsed .x-fieldset-bwrap { visibility:hidden; position:absolute; left:-1000px; top:-1000px; } .ext-ie .x-fieldset-bwrap { zoom:1; } .x-fieldset-noborder { border:0px none transparent; } .x-fieldset-noborder legend { margin-left:-3px; } /* IE legend positioning bug */ .ext-ie .x-fieldset-noborder legend { position: relative; margin-bottom:23px; } .ext-ie .x-fieldset-noborder legend span { position: absolute; left:16px; } .ext-gecko .x-window-body .x-form-item { -moz-outline: none; outline: none; overflow: auto; } .ext-mac.ext-gecko .x-window-body .x-form-item { overflow:hidden; } .ext-gecko .x-form-item { -moz-outline: none; outline: none; } .x-hide-label label.x-form-item-label { display:none; } .x-hide-label .x-form-element { padding-left: 0 !important; } .x-form-label-top .x-hide-label label.x-form-item-label{ display: none; } .x-fieldset { overflow:hidden; } .x-fieldset-bwrap { overflow:hidden; zoom:1; } .x-fieldset-body { overflow:hidden; } .x-btn{ cursor:pointer; white-space: nowrap; } .x-btn button{ border:0 none; background-color:transparent; padding-left:3px; padding-right:3px; cursor:pointer; margin:0; overflow:visible; width:auto; -moz-outline:0 none; outline:0 none; } * html .ext-ie .x-btn button { width:1px; } .ext-gecko .x-btn button, .ext-webkit .x-btn button { padding-left:0; padding-right:0; } .ext-gecko .x-btn button::-moz-focus-inner { padding:0; } .ext-ie .x-btn button { padding-top:2px; } .x-btn td { padding:0 !important; } .x-btn-text { cursor:pointer; white-space: nowrap; padding:0; } /* icon placement and sizing styles */ /* Only text */ .x-btn-noicon .x-btn-small .x-btn-text{ height: 16px; } .x-btn-noicon .x-btn-medium .x-btn-text{ height: 24px; } .x-btn-noicon .x-btn-large .x-btn-text{ height: 32px; } /* Only icons */ .x-btn-icon .x-btn-text{ background-position: center; background-repeat: no-repeat; } .x-btn-icon .x-btn-small .x-btn-text{ height: 16px; width: 16px; } .x-btn-icon .x-btn-medium .x-btn-text{ height: 24px; width: 24px; } .x-btn-icon .x-btn-large .x-btn-text{ height: 32px; width: 32px; } /* Icons and text */ /* left */ .x-btn-text-icon .x-btn-icon-small-left .x-btn-text{ background-position: 0 center; background-repeat: no-repeat; padding-left:18px; height:16px; } .x-btn-text-icon .x-btn-icon-medium-left .x-btn-text{ background-position: 0 center; background-repeat: no-repeat; padding-left:26px; height:24px; } .x-btn-text-icon .x-btn-icon-large-left .x-btn-text{ background-position: 0 center; background-repeat: no-repeat; padding-left:34px; height:32px; } /* top */ .x-btn-text-icon .x-btn-icon-small-top .x-btn-text{ background-position: center 0; background-repeat: no-repeat; padding-top:18px; } .x-btn-text-icon .x-btn-icon-medium-top .x-btn-text{ background-position: center 0; background-repeat: no-repeat; padding-top:26px; } .x-btn-text-icon .x-btn-icon-large-top .x-btn-text{ background-position: center 0; background-repeat: no-repeat; padding-top:34px; } /* right */ .x-btn-text-icon .x-btn-icon-small-right .x-btn-text{ background-position: right center; background-repeat: no-repeat; padding-right:18px; height:16px; } .x-btn-text-icon .x-btn-icon-medium-right .x-btn-text{ background-position: right center; background-repeat: no-repeat; padding-right:26px; height:24px; } .x-btn-text-icon .x-btn-icon-large-right .x-btn-text{ background-position: right center; background-repeat: no-repeat; padding-right:34px; height:32px; } /* bottom */ .x-btn-text-icon .x-btn-icon-small-bottom .x-btn-text{ background-position: center bottom; background-repeat: no-repeat; padding-bottom:18px; } .x-btn-text-icon .x-btn-icon-medium-bottom .x-btn-text{ background-position: center bottom; background-repeat: no-repeat; padding-bottom:26px; } .x-btn-text-icon .x-btn-icon-large-bottom .x-btn-text{ background-position: center bottom; background-repeat: no-repeat; padding-bottom:34px; } /* background positioning */ .x-btn-tr i, .x-btn-tl i, .x-btn-mr i, .x-btn-ml i, .x-btn-br i, .x-btn-bl i{ font-size:1px; line-height:1px; width:3px; display:block; overflow:hidden; } .x-btn-tr i, .x-btn-tl i, .x-btn-br i, .x-btn-bl i{ height:3px; } .x-btn-tl{ width:3px; height:3px; background:no-repeat 0 0; } .x-btn-tr{ width:3px; height:3px; background:no-repeat -3px 0; } .x-btn-tc{ height:3px; background:repeat-x 0 -6px; } .x-btn-ml{ width:3px; background:no-repeat 0 -24px; } .x-btn-mr{ width:3px; background:no-repeat -3px -24px; } .x-btn-mc{ background:repeat-x 0 -1096px; vertical-align: middle; text-align:center; padding:0 5px; cursor:pointer; white-space:nowrap; } /* Fixes an issue with the button height */ .ext-strict .ext-ie6 .x-btn-mc, .ext-strict .ext-ie7 .x-btn-mc { height: 100%; } .x-btn-bl{ width:3px; height:3px; background:no-repeat 0 -3px; } .x-btn-br{ width:3px; height:3px; background:no-repeat -3px -3px; } .x-btn-bc{ height:3px; background:repeat-x 0 -15px; } .x-btn-over .x-btn-tl{ background-position: -6px 0; } .x-btn-over .x-btn-tr{ background-position: -9px 0; } .x-btn-over .x-btn-tc{ background-position: 0 -9px; } .x-btn-over .x-btn-ml{ background-position: -6px -24px; } .x-btn-over .x-btn-mr{ background-position: -9px -24px; } .x-btn-over .x-btn-mc{ background-position: 0 -2168px; } .x-btn-over .x-btn-bl{ background-position: -6px -3px; } .x-btn-over .x-btn-br{ background-position: -9px -3px; } .x-btn-over .x-btn-bc{ background-position: 0 -18px; } .x-btn-click .x-btn-tl, .x-btn-menu-active .x-btn-tl, .x-btn-pressed .x-btn-tl{ background-position: -12px 0; } .x-btn-click .x-btn-tr, .x-btn-menu-active .x-btn-tr, .x-btn-pressed .x-btn-tr{ background-position: -15px 0; } .x-btn-click .x-btn-tc, .x-btn-menu-active .x-btn-tc, .x-btn-pressed .x-btn-tc{ background-position: 0 -12px; } .x-btn-click .x-btn-ml, .x-btn-menu-active .x-btn-ml, .x-btn-pressed .x-btn-ml{ background-position: -12px -24px; } .x-btn-click .x-btn-mr, .x-btn-menu-active .x-btn-mr, .x-btn-pressed .x-btn-mr{ background-position: -15px -24px; } .x-btn-click .x-btn-mc, .x-btn-menu-active .x-btn-mc, .x-btn-pressed .x-btn-mc{ background-position: 0 -3240px; } .x-btn-click .x-btn-bl, .x-btn-menu-active .x-btn-bl, .x-btn-pressed .x-btn-bl{ background-position: -12px -3px; } .x-btn-click .x-btn-br, .x-btn-menu-active .x-btn-br, .x-btn-pressed .x-btn-br{ background-position: -15px -3px; } .x-btn-click .x-btn-bc, .x-btn-menu-active .x-btn-bc, .x-btn-pressed .x-btn-bc{ background-position: 0 -21px; } .x-btn-disabled *{ cursor:default !important; } /* With a menu arrow */ /* right */ .x-btn-mc em.x-btn-arrow { display:block; background:transparent no-repeat right center; padding-right:10px; } .x-btn-mc em.x-btn-split { display:block; background:transparent no-repeat right center; padding-right:14px; } /* bottom */ .x-btn-mc em.x-btn-arrow-bottom { display:block; background:transparent no-repeat center bottom; padding-bottom:14px; } .x-btn-mc em.x-btn-split-bottom { display:block; background:transparent no-repeat center bottom; padding-bottom:14px; } /* height adjustment class */ .x-btn-as-arrow .x-btn-mc em { display:block; background-color:transparent; padding-bottom:14px; } /* groups */ .x-btn-group { padding:1px; } .x-btn-group-header { padding:2px; text-align:center; } .x-btn-group-tc { background: transparent repeat-x 0 0; overflow:hidden; } .x-btn-group-tl { background: transparent no-repeat 0 0; padding-left:3px; zoom:1; } .x-btn-group-tr { background: transparent no-repeat right 0; zoom:1; padding-right:3px; } .x-btn-group-bc { background: transparent repeat-x 0 bottom; zoom:1; } .x-btn-group-bc .x-panel-footer { zoom:1; } .x-btn-group-bl { background: transparent no-repeat 0 bottom; padding-left:3px; zoom:1; } .x-btn-group-br { background: transparent no-repeat right bottom; padding-right:3px; zoom:1; } .x-btn-group-mc { border:0 none; padding:1px 0 0 0; margin:0; } .x-btn-group-mc .x-btn-group-body { background-color:transparent; border: 0 none; } .x-btn-group-ml { background: transparent repeat-y 0 0; padding-left:3px; zoom:1; } .x-btn-group-mr { background: transparent repeat-y right 0; padding-right:3px; zoom:1; } .x-btn-group-bc .x-btn-group-footer { padding-bottom:6px; } .x-panel-nofooter .x-btn-group-bc { height:3px; font-size:0; line-height:0; } .x-btn-group-bwrap { overflow:hidden; zoom:1; } .x-btn-group-body { overflow:hidden; zoom:1; } .x-btn-group-notitle .x-btn-group-tc { background: transparent repeat-x 0 0; overflow:hidden; height:2px; }.x-toolbar{ border-style:solid; border-width:0 0 1px 0; display: block; padding:2px; background:repeat-x top left; position:relative; left:0; top:0; zoom:1; overflow:hidden; } .x-toolbar-left { width: 100%; } .x-toolbar .x-item-disabled .x-btn-icon { opacity: .35; -moz-opacity: .35; filter: alpha(opacity=35); } .x-toolbar td { vertical-align:middle; } .x-toolbar td,.x-toolbar span,.x-toolbar input,.x-toolbar div,.x-toolbar select,.x-toolbar label{ white-space: nowrap; } .x-toolbar .x-item-disabled { cursor:default; opacity:.6; -moz-opacity:.6; filter:alpha(opacity=60); } .x-toolbar .x-item-disabled * { cursor:default; } .x-toolbar .x-toolbar-cell { vertical-align:middle; } .x-toolbar .x-btn-tl, .x-toolbar .x-btn-tr, .x-toolbar .x-btn-tc, .x-toolbar .x-btn-ml, .x-toolbar .x-btn-mr, .x-toolbar .x-btn-mc, .x-toolbar .x-btn-bl, .x-toolbar .x-btn-br, .x-toolbar .x-btn-bc { background-position: 500px 500px; } /* These rules are duplicated from button.css to give priority of x-toolbar rules above */ .x-toolbar .x-btn-over .x-btn-tl{ background-position: -6px 0; } .x-toolbar .x-btn-over .x-btn-tr{ background-position: -9px 0; } .x-toolbar .x-btn-over .x-btn-tc{ background-position: 0 -9px; } .x-toolbar .x-btn-over .x-btn-ml{ background-position: -6px -24px; } .x-toolbar .x-btn-over .x-btn-mr{ background-position: -9px -24px; } .x-toolbar .x-btn-over .x-btn-mc{ background-position: 0 -2168px; } .x-toolbar .x-btn-over .x-btn-bl{ background-position: -6px -3px; } .x-toolbar .x-btn-over .x-btn-br{ background-position: -9px -3px; } .x-toolbar .x-btn-over .x-btn-bc{ background-position: 0 -18px; } .x-toolbar .x-btn-click .x-btn-tl, .x-toolbar .x-btn-menu-active .x-btn-tl, .x-toolbar .x-btn-pressed .x-btn-tl{ background-position: -12px 0; } .x-toolbar .x-btn-click .x-btn-tr, .x-toolbar .x-btn-menu-active .x-btn-tr, .x-toolbar .x-btn-pressed .x-btn-tr{ background-position: -15px 0; } .x-toolbar .x-btn-click .x-btn-tc, .x-toolbar .x-btn-menu-active .x-btn-tc, .x-toolbar .x-btn-pressed .x-btn-tc{ background-position: 0 -12px; } .x-toolbar .x-btn-click .x-btn-ml, .x-toolbar .x-btn-menu-active .x-btn-ml, .x-toolbar .x-btn-pressed .x-btn-ml{ background-position: -12px -24px; } .x-toolbar .x-btn-click .x-btn-mr, .x-toolbar .x-btn-menu-active .x-btn-mr, .x-toolbar .x-btn-pressed .x-btn-mr{ background-position: -15px -24px; } .x-toolbar .x-btn-click .x-btn-mc, .x-toolbar .x-btn-menu-active .x-btn-mc, .x-toolbar .x-btn-pressed .x-btn-mc{ background-position: 0 -3240px; } .x-toolbar .x-btn-click .x-btn-bl, .x-toolbar .x-btn-menu-active .x-btn-bl, .x-toolbar .x-btn-pressed .x-btn-bl{ background-position: -12px -3px; } .x-toolbar .x-btn-click .x-btn-br, .x-toolbar .x-btn-menu-active .x-btn-br, .x-toolbar .x-btn-pressed .x-btn-br{ background-position: -15px -3px; } .x-toolbar .x-btn-click .x-btn-bc, .x-toolbar .x-btn-menu-active .x-btn-bc, .x-toolbar .x-btn-pressed .x-btn-bc{ background-position: 0 -21px; } .x-toolbar div.xtb-text{ padding:2px 2px 0; line-height:16px; display:block; } .x-toolbar .xtb-sep { background-position: center; background-repeat: no-repeat; display: block; font-size: 1px; height: 16px; width:4px; overflow: hidden; cursor:default; margin: 0 2px 0; border:0; } .x-toolbar .xtb-spacer { width:2px; } /* Paging Toolbar */ .x-tbar-page-number{ width:30px; height:14px; } .ext-ie .x-tbar-page-number{ margin-top: 2px; } .x-paging-info { position:absolute; top:5px; right: 8px; } /* floating */ .x-toolbar-ct { width:100%; } .x-toolbar-right td { text-align: center; } .x-panel-tbar, .x-panel-bbar, .x-window-tbar, .x-window-bbar, .x-tab-panel-tbar, .x-tab-panel-bbar, .x-plain-tbar, .x-plain-bbar { overflow:hidden; zoom:1; } .x-toolbar-more .x-btn-small .x-btn-text{ height: 16px; width: 12px; } .x-toolbar-more em.x-btn-arrow { display:inline; background-color:transparent; padding-right:0; } .x-toolbar-more .x-btn-mc em.x-btn-arrow { background-image: none; } div.x-toolbar-no-items { color:gray !important; padding:5px 10px !important; } /* fix ie toolbar form items */ .ext-border-box .x-toolbar-cell .x-form-text { margin-bottom:-1px !important; } .ext-border-box .x-toolbar-cell .x-form-field-wrap .x-form-text { margin:0 !important; } .ext-ie .x-toolbar-cell .x-form-field-wrap { height:21px; } .ext-ie .x-toolbar-cell .x-form-text { position:relative; top:-1px; } .ext-strict .ext-ie8 .x-toolbar-cell .x-form-field-trigger-wrap .x-form-text, .ext-strict .ext-ie .x-toolbar-cell .x-form-text { top: 0px; } .x-toolbar-right td .x-form-field-trigger-wrap{ text-align: left; } .x-toolbar-cell .x-form-checkbox, .x-toolbar-cell .x-form-radio{ margin-top: 5px; } .x-toolbar-cell .x-form-cb-label{ vertical-align: bottom; top: 1px; } .ext-ie .x-toolbar-cell .x-form-checkbox, .ext-ie .x-toolbar-cell .x-form-radio{ margin-top: 4px; } .ext-ie .x-toolbar-cell .x-form-cb-label{ top: 0; } /* Grid3 styles */ .x-grid3 { position:relative; overflow:hidden; } .x-grid-panel .x-panel-body { overflow:hidden !important; } .x-grid-panel .x-panel-mc .x-panel-body { border:1px solid; } .x-grid3 table { table-layout:fixed; } .x-grid3-viewport{ overflow:hidden; } .x-grid3-hd-row td, .x-grid3-row td, .x-grid3-summary-row td{ -moz-outline: none; outline: none; -moz-user-focus: normal; } .x-grid3-row td, .x-grid3-summary-row td { line-height:13px; vertical-align: top; padding-left:1px; padding-right:1px; -moz-user-select: none; -khtml-user-select:none; -webkit-user-select:ignore; } .x-grid3-cell{ -moz-user-select: none; -khtml-user-select:none; -webkit-user-select:ignore; } .x-grid3-hd-row td { line-height:15px; vertical-align:middle; border-left:1px solid; border-right:1px solid; } .x-grid3-hd-row .x-grid3-marker-hd { padding:3px; } .x-grid3-row .x-grid3-marker { padding:3px; } .x-grid3-cell-inner, .x-grid3-hd-inner{ overflow:hidden; -o-text-overflow: ellipsis; text-overflow: ellipsis; padding:3px 3px 3px 5px; white-space: nowrap; } /* ActionColumn, reduce padding to accommodate 16x16 icons in normal row height */ .x-action-col-cell .x-grid3-cell-inner { padding-top: 1px; padding-bottom: 1px; } .x-action-col-icon { cursor: pointer; } .x-grid3-hd-inner { position:relative; cursor:inherit; padding:4px 3px 4px 5px; } .x-grid3-row-body { white-space:normal; } .x-grid3-body-cell { -moz-outline:0 none; outline:0 none; } /* IE Quirks to clip */ .ext-ie .x-grid3-cell-inner, .ext-ie .x-grid3-hd-inner{ width:100%; } /* reverse above in strict mode */ .ext-strict .x-grid3-cell-inner, .ext-strict .x-grid3-hd-inner{ width:auto; } .x-grid-row-loading { background: no-repeat center center; } .x-grid-page { overflow:hidden; } .x-grid3-row { cursor: default; border: 1px solid; width:100%; } .x-grid3-row-over { border:1px solid; background: repeat-x left top; } .x-grid3-resize-proxy { width:1px; left:0; cursor: e-resize; cursor: col-resize; position:absolute; top:0; height:100px; overflow:hidden; visibility:hidden; border:0 none; z-index:7; } .x-grid3-resize-marker { width:1px; left:0; position:absolute; top:0; height:100px; overflow:hidden; visibility:hidden; border:0 none; z-index:7; } .x-grid3-focus { position:absolute; left:0; top:0; width:1px; height:1px; line-height:1px; font-size:1px; -moz-outline:0 none; outline:0 none; -moz-user-select: text; -khtml-user-select: text; -webkit-user-select:ignore; } /* header styles */ .x-grid3-header{ background: repeat-x 0 bottom; cursor:default; zoom:1; padding:1px 0 0 0; } .x-grid3-header-pop { border-left:1px solid; float:right; clear:none; } .x-grid3-header-pop-inner { border-left:1px solid; width:14px; height:19px; background: transparent no-repeat center center; } .ext-ie .x-grid3-header-pop-inner { width:15px; } .ext-strict .x-grid3-header-pop-inner { width:14px; } .x-grid3-header-inner { overflow:hidden; zoom:1; float:left; } .x-grid3-header-offset { padding-left:1px; text-align: left; } td.x-grid3-hd-over, td.sort-desc, td.sort-asc, td.x-grid3-hd-menu-open { border-left:1px solid; border-right:1px solid; } td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-asc .x-grid3-hd-inner, td.x-grid3-hd-menu-open .x-grid3-hd-inner { background: repeat-x left bottom; } .x-grid3-sort-icon{ background-repeat: no-repeat; display: none; height: 4px; width: 13px; margin-left:3px; vertical-align: middle; } .sort-asc .x-grid3-sort-icon, .sort-desc .x-grid3-sort-icon { display: inline; } /* Header position fixes for IE strict mode */ .ext-strict .ext-ie .x-grid3-header-inner, .ext-strict .ext-ie6 .x-grid3-hd { position:relative; } .ext-strict .ext-ie6 .x-grid3-hd-inner{ position:static; } /* Body Styles */ .x-grid3-body { zoom:1; } .x-grid3-scroller { overflow:auto; zoom:1; position:relative; } .x-grid3-cell-text, .x-grid3-hd-text { display: block; padding: 3px 5px 3px 5px; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select:ignore; } .x-grid3-split { background-position: center; background-repeat: no-repeat; cursor: e-resize; cursor: col-resize; display: block; font-size: 1px; height: 16px; overflow: hidden; position: absolute; top: 2px; width: 6px; z-index: 3; } /* Column Reorder DD */ .x-dd-drag-proxy .x-grid3-hd-inner{ background: repeat-x left bottom; width:120px; padding:3px; border:1px solid; overflow:hidden; } .col-move-top, .col-move-bottom{ width:9px; height:9px; position:absolute; top:0; line-height:1px; font-size:1px; overflow:hidden; visibility:hidden; z-index:20000; background:transparent no-repeat left top; } /* Selection Styles */ .x-grid3-row-selected { border:1px dotted; } .x-grid3-locked td.x-grid3-row-marker, .x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker{ background: repeat-x 0 bottom !important; vertical-align:middle !important; padding:0; border-top:1px solid; border-bottom:none !important; border-right:1px solid !important; text-align:center; } .x-grid3-locked td.x-grid3-row-marker div, .x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker div{ padding:0 4px; text-align:center; } /* dirty cells */ .x-grid3-dirty-cell { background: transparent no-repeat 0 0; } /* Grid Toolbars */ .x-grid3-topbar, .x-grid3-bottombar{ overflow:hidden; display:none; zoom:1; position:relative; } .x-grid3-topbar .x-toolbar{ border-right:0 none; } .x-grid3-bottombar .x-toolbar{ border-right:0 none; border-bottom:0 none; border-top:1px solid; } /* Props Grid Styles */ .x-props-grid .x-grid3-cell{ padding:1px; } .x-props-grid .x-grid3-td-name .x-grid3-cell-inner{ background:transparent repeat-y -16px !important; padding-left:12px; } .x-props-grid .x-grid3-body .x-grid3-td-name{ padding:1px; padding-right:0; border:0 none; border-right:1px solid; } /* dd */ .x-grid3-col-dd { border:0 none; padding:0; background-color:transparent; } .x-dd-drag-ghost .x-grid3-dd-wrap { padding:1px 3px 3px 1px; } .x-grid3-hd { -moz-user-select:none; -khtml-user-select:none; -webkit-user-select:ignore; } .x-grid3-hd-btn { display:none; position:absolute; width:14px; background:no-repeat left center; right:0; top:0; z-index:2; cursor:pointer; } .x-grid3-hd-over .x-grid3-hd-btn, .x-grid3-hd-menu-open .x-grid3-hd-btn { display:block; } a.x-grid3-hd-btn:hover { background-position:-14px center; } /* Expanders */ .x-grid3-body .x-grid3-td-expander { background:transparent repeat-y right; } .x-grid3-body .x-grid3-td-expander .x-grid3-cell-inner { padding:0 !important; height:100%; } .x-grid3-row-expander { width:100%; height:18px; background-position:4px 2px; background-repeat:no-repeat; background-color:transparent; } .x-grid3-row-collapsed .x-grid3-row-expander { background-position:4px 2px; } .x-grid3-row-expanded .x-grid3-row-expander { background-position:-21px 2px; } .x-grid3-row-collapsed .x-grid3-row-body { display:none !important; } .x-grid3-row-expanded .x-grid3-row-body { display:block !important; } /* Checkers */ .x-grid3-body .x-grid3-td-checker { background:transparent repeat-y right; } .x-grid3-body .x-grid3-td-checker .x-grid3-cell-inner, .x-grid3-header .x-grid3-td-checker .x-grid3-hd-inner { padding:0 !important; height:100%; } .x-grid3-row-checker, .x-grid3-hd-checker { width:100%; height:18px; background-position:2px 2px; background-repeat:no-repeat; background-color:transparent; } .x-grid3-row .x-grid3-row-checker { background-position:2px 2px; } .x-grid3-row-selected .x-grid3-row-checker, .x-grid3-hd-checker-on .x-grid3-hd-checker,.x-grid3-row-checked .x-grid3-row-checker { background-position:-23px 2px; } .x-grid3-hd-checker { background-position:2px 1px; } .ext-border-box .x-grid3-hd-checker { background-position:2px 3px; } .x-grid3-hd-checker-on .x-grid3-hd-checker { background-position:-23px 1px; } .ext-border-box .x-grid3-hd-checker-on .x-grid3-hd-checker { background-position:-23px 3px; } /* Numberer */ .x-grid3-body .x-grid3-td-numberer { background:transparent repeat-y right; } .x-grid3-body .x-grid3-td-numberer .x-grid3-cell-inner { padding:3px 5px 0 0 !important; text-align:right; } /* Row Icon */ .x-grid3-body .x-grid3-td-row-icon { background:transparent repeat-y right; vertical-align:top; text-align:center; } .x-grid3-body .x-grid3-td-row-icon .x-grid3-cell-inner { padding:0 !important; background-position:center center; background-repeat:no-repeat; width:16px; height:16px; margin-left:2px; margin-top:3px; } /* All specials */ .x-grid3-body .x-grid3-row-selected .x-grid3-td-numberer, .x-grid3-body .x-grid3-row-selected .x-grid3-td-checker, .x-grid3-body .x-grid3-row-selected .x-grid3-td-expander { background:transparent repeat-y right; } .x-grid3-body .x-grid3-check-col-td .x-grid3-cell-inner { padding: 1px 0 0 0 !important; } .x-grid3-check-col { width:100%; height:16px; background-position:center center; background-repeat:no-repeat; background-color:transparent; } .x-grid3-check-col-on { width:100%; height:16px; background-position:center center; background-repeat:no-repeat; background-color:transparent; } /* Grouping classes */ .x-grid-group, .x-grid-group-body, .x-grid-group-hd { zoom:1; } .x-grid-group-hd { border-bottom: 2px solid; cursor:pointer; padding-top:6px; } .x-grid-group-hd div.x-grid-group-title { background:transparent no-repeat 3px 3px; padding:4px 4px 4px 17px; } .x-grid-group-collapsed .x-grid-group-body { display:none; } .ext-ie6 .x-grid3 .x-editor .x-form-text, .ext-ie7 .x-grid3 .x-editor .x-form-text { position:relative; top:-1px; } .ext-ie .x-props-grid .x-editor .x-form-text { position:static; top:0; } .x-grid-empty { padding:10px; } /* fix floating toolbar issue */ .ext-ie7 .x-grid-panel .x-panel-bbar { position:relative; } /* Reset position to static when Grid Panel has been framed */ /* to resolve 'snapping' from top to bottom behavior. */ /* @forumThread 86656 */ .ext-ie7 .x-grid-panel .x-panel-mc .x-panel-bbar { position: static; } .ext-ie6 .x-grid3-header { position: relative; } /* Fix WebKit bug in Grids */ .ext-webkit .x-grid-panel .x-panel-bwrap{ -webkit-user-select:none; } .ext-webkit .x-tbar-page-number{ -webkit-user-select:ignore; } /* end*/ /* column lines */ .x-grid-with-col-lines .x-grid3-row td.x-grid3-cell { padding-right:0; border-right:1px solid; } .x-pivotgrid .x-grid3-header-offset table { width: 100%; border-collapse: collapse; } .x-pivotgrid .x-grid3-header-offset table td { padding: 4px 3px 4px 5px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; line-height: 13px; font-family: tahoma; } .x-pivotgrid .x-grid3-row-headers { display: block; float: left; } .x-pivotgrid .x-grid3-row-headers table { height: 100%; width: 100%; border-collapse: collapse; } .x-pivotgrid .x-grid3-row-headers table td { height: 18px; padding: 2px 7px 0 0; text-align: right; text-overflow: ellipsis; font-size: 11px; font-family: tahoma; } .ext-gecko .x-pivotgrid .x-grid3-row-headers table td { height: 21px; } .x-grid3-header-title { top: 0%; left: 0%; position: absolute; text-align: center; vertical-align: middle; font-family: tahoma; font-size: 11px; padding: auto 1px; display: table-cell; } .x-grid3-header-title span { position: absolute; top: 50%; left: 0%; width: 100%; margin-top: -6px; }.x-dd-drag-proxy{ position:absolute; left:0; top:0; visibility:hidden; z-index:15000; } .x-dd-drag-ghost{ -moz-opacity: 0.85; opacity:.85; filter: alpha(opacity=85); border: 1px solid; padding:3px; padding-left:20px; white-space:nowrap; } .x-dd-drag-repair .x-dd-drag-ghost{ -moz-opacity: 0.4; opacity:.4; filter: alpha(opacity=40); border:0 none; padding:0; background-color:transparent; } .x-dd-drag-repair .x-dd-drop-icon{ visibility:hidden; } .x-dd-drop-icon{ position:absolute; top:3px; left:3px; display:block; width:16px; height:16px; background-color:transparent; background-position: center; background-repeat: no-repeat; z-index:1; } .x-view-selector { position:absolute; left:0; top:0; width:0; border:1px dotted; opacity: .5; -moz-opacity: .5; filter:alpha(opacity=50); zoom:1; }.ext-strict .ext-ie .x-tree .x-panel-bwrap{ position:relative; overflow:hidden; } .x-tree-icon, .x-tree-ec-icon, .x-tree-elbow-line, .x-tree-elbow, .x-tree-elbow-end, .x-tree-elbow-plus, .x-tree-elbow-minus, .x-tree-elbow-end-plus, .x-tree-elbow-end-minus{ border: 0 none; height: 18px; margin: 0; padding: 0; vertical-align: top; width: 16px; background-repeat: no-repeat; } .x-tree-node-collapsed .x-tree-node-icon, .x-tree-node-expanded .x-tree-node-icon, .x-tree-node-leaf .x-tree-node-icon{ border: 0 none; height: 18px; margin: 0; padding: 0; vertical-align: top; width: 16px; background-position:center; background-repeat: no-repeat; } .ext-ie .x-tree-node-indent img, .ext-ie .x-tree-node-icon, .ext-ie .x-tree-ec-icon { vertical-align: middle !important; } .ext-strict .ext-ie8 .x-tree-node-indent img, .ext-strict .ext-ie8 .x-tree-node-icon, .ext-strict .ext-ie8 .x-tree-ec-icon { vertical-align: top !important; } /* checkboxes */ input.x-tree-node-cb { margin-left:1px; height: 19px; vertical-align: bottom; } .ext-ie input.x-tree-node-cb { margin-left:0; margin-top: 1px; width: 16px; height: 16px; vertical-align: middle; } .ext-strict .ext-ie8 input.x-tree-node-cb{ margin: 1px 1px; height: 14px; vertical-align: bottom; } .ext-strict .ext-ie8 input.x-tree-node-cb + a{ vertical-align: bottom; } .ext-opera input.x-tree-node-cb { height: 14px; vertical-align: middle; } .x-tree-noicon .x-tree-node-icon{ width:0; height:0; } /* No line styles */ .x-tree-no-lines .x-tree-elbow{ background-color:transparent; } .x-tree-no-lines .x-tree-elbow-end{ background-color:transparent; } .x-tree-no-lines .x-tree-elbow-line{ background-color:transparent; } /* Arrows */ .x-tree-arrows .x-tree-elbow{ background-color:transparent; } .x-tree-arrows .x-tree-elbow-plus{ background:transparent no-repeat 0 0; } .x-tree-arrows .x-tree-elbow-minus{ background:transparent no-repeat -16px 0; } .x-tree-arrows .x-tree-elbow-end{ background-color:transparent; } .x-tree-arrows .x-tree-elbow-end-plus{ background:transparent no-repeat 0 0; } .x-tree-arrows .x-tree-elbow-end-minus{ background:transparent no-repeat -16px 0; } .x-tree-arrows .x-tree-elbow-line{ background-color:transparent; } .x-tree-arrows .x-tree-ec-over .x-tree-elbow-plus{ background-position:-32px 0; } .x-tree-arrows .x-tree-ec-over .x-tree-elbow-minus{ background-position:-48px 0; } .x-tree-arrows .x-tree-ec-over .x-tree-elbow-end-plus{ background-position:-32px 0; } .x-tree-arrows .x-tree-ec-over .x-tree-elbow-end-minus{ background-position:-48px 0; } .x-tree-elbow-plus, .x-tree-elbow-minus, .x-tree-elbow-end-plus, .x-tree-elbow-end-minus{ cursor:pointer; } .ext-ie ul.x-tree-node-ct{ font-size:0; line-height:0; zoom:1; } .x-tree-node{ white-space: nowrap; } .x-tree-node-el { line-height:18px; cursor:pointer; } .x-tree-node a, .x-dd-drag-ghost a{ text-decoration:none; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:ignore; -kthml-user-focus:normal; -moz-user-focus:normal; -moz-outline: 0 none; outline:0 none; } .x-tree-node a span, .x-dd-drag-ghost a span{ text-decoration:none; padding:1px 3px 1px 2px; } .x-tree-node .x-tree-node-disabled .x-tree-node-icon{ -moz-opacity: 0.5; opacity:.5; filter: alpha(opacity=50); } .x-tree-node .x-tree-node-inline-icon{ background-color:transparent; } .x-tree-node a:hover, .x-dd-drag-ghost a:hover{ text-decoration:none; } .x-tree-node div.x-tree-drag-insert-below{ border-bottom:1px dotted; } .x-tree-node div.x-tree-drag-insert-above{ border-top:1px dotted; } .x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-below{ border-bottom:0 none; } .x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-above{ border-top:0 none; } .x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-below a{ border-bottom:2px solid; } .x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-above a{ border-top:2px solid; } .x-tree-node .x-tree-drag-append a span{ border:1px dotted; } .x-dd-drag-ghost .x-tree-node-indent, .x-dd-drag-ghost .x-tree-ec-icon{ display:none !important; } /* Fix for ie rootVisible:false issue */ .x-tree-root-ct { zoom:1; } .x-date-picker { border: 1px solid; border-top:0 none; position:relative; } .x-date-picker a { -moz-outline:0 none; outline:0 none; } .x-date-inner, .x-date-inner td, .x-date-inner th{ border-collapse:separate; } .x-date-middle,.x-date-left,.x-date-right { background: repeat-x 0 -83px; overflow:hidden; } .x-date-middle .x-btn-tc,.x-date-middle .x-btn-tl,.x-date-middle .x-btn-tr, .x-date-middle .x-btn-mc,.x-date-middle .x-btn-ml,.x-date-middle .x-btn-mr, .x-date-middle .x-btn-bc,.x-date-middle .x-btn-bl,.x-date-middle .x-btn-br{ background:transparent !important; vertical-align:middle; } .x-date-middle .x-btn-mc em.x-btn-arrow { background:transparent no-repeat right 0; } .x-date-right, .x-date-left { width:18px; } .x-date-right{ text-align:right; } .x-date-middle { padding-top:2px; padding-bottom:2px; width:130px; /* FF3 */ } .x-date-right a, .x-date-left a{ display:block; width:16px; height:16px; background-position: center; background-repeat: no-repeat; cursor:pointer; -moz-opacity: 0.6; opacity:.6; filter: alpha(opacity=60); } .x-date-right a:hover, .x-date-left a:hover{ -moz-opacity: 1; opacity:1; filter: alpha(opacity=100); } .x-item-disabled .x-date-right a:hover, .x-item-disabled .x-date-left a:hover{ -moz-opacity: 0.6; opacity:.6; filter: alpha(opacity=60); } .x-date-right a { margin-right:2px; text-decoration:none !important; } .x-date-left a{ margin-left:2px; text-decoration:none !important; } table.x-date-inner { width: 100%; table-layout:fixed; } .ext-webkit table.x-date-inner{ /* Fix for webkit browsers */ width: 175px; } .x-date-inner th { width:25px; } .x-date-inner th { background: repeat-x left top; text-align:right !important; border-bottom: 1px solid; cursor:default; padding:0; border-collapse:separate; } .x-date-inner th span { display:block; padding:2px; padding-right:7px; } .x-date-inner td { border: 1px solid; text-align:right; padding:0; } .x-date-inner a { padding:2px 5px; display:block; text-decoration:none; text-align:right; zoom:1; } .x-date-inner .x-date-active{ cursor:pointer; color:black; } .x-date-inner .x-date-selected a{ background: repeat-x left top; border:1px solid; padding:1px 4px; } .x-date-inner .x-date-today a{ border: 1px solid; padding:1px 4px; } .x-date-inner .x-date-prevday a,.x-date-inner .x-date-nextday a { text-decoration:none !important; } .x-date-bottom { padding:4px; border-top: 1px solid; background: repeat-x left top; } .x-date-inner a:hover, .x-date-inner .x-date-disabled a:hover{ text-decoration:none !important; } .x-item-disabled .x-date-inner a:hover{ background: none; } .x-date-inner .x-date-disabled a { cursor:default; } .x-date-menu .x-menu-item { padding:1px 24px 1px 4px; white-space: nowrap; } .x-date-menu .x-menu-item .x-menu-item-icon { width:10px; height:10px; margin-right:5px; background-position:center -4px !important; } .x-date-mp { position:absolute; left:0; top:0; display:none; } .x-date-mp td { padding:2px; font:normal 11px arial, helvetica,tahoma,sans-serif; } td.x-date-mp-month,td.x-date-mp-year,td.x-date-mp-ybtn { border: 0 none; text-align:center; vertical-align: middle; width:25%; } .x-date-mp-ok { margin-right:3px; } .x-date-mp-btns button { text-decoration:none; text-align:center; text-decoration:none !important; border:1px solid; padding:1px 3px 1px; cursor:pointer; } .x-date-mp-btns { background: repeat-x left top; } .x-date-mp-btns td { border-top: 1px solid; text-align:center; } td.x-date-mp-month a,td.x-date-mp-year a { display:block; padding:2px 4px; text-decoration:none; text-align:center; } td.x-date-mp-month a:hover,td.x-date-mp-year a:hover { text-decoration:none; cursor:pointer; } td.x-date-mp-sel a { padding:1px 3px; background: repeat-x left top; border:1px solid; } .x-date-mp-ybtn a { overflow:hidden; width:15px; height:15px; cursor:pointer; background:transparent no-repeat; display:block; margin:0 auto; } .x-date-mp-ybtn a.x-date-mp-next { background-position:0 -120px; } .x-date-mp-ybtn a.x-date-mp-next:hover { background-position:-15px -120px; } .x-date-mp-ybtn a.x-date-mp-prev { background-position:0 -105px; } .x-date-mp-ybtn a.x-date-mp-prev:hover { background-position:-15px -105px; } .x-date-mp-ybtn { text-align:center; } td.x-date-mp-sep { border-right:1px solid; }.x-tip{ position: absolute; top: 0; left:0; visibility: hidden; z-index: 20002; border:0 none; } .x-tip .x-tip-close{ height: 15px; float:right; width: 15px; margin:0 0 2px 2px; cursor:pointer; display:none; } .x-tip .x-tip-tc { background: transparent no-repeat 0 -62px; padding-top:3px; overflow:hidden; zoom:1; } .x-tip .x-tip-tl { background: transparent no-repeat 0 0; padding-left:6px; overflow:hidden; zoom:1; } .x-tip .x-tip-tr { background: transparent no-repeat right 0; padding-right:6px; overflow:hidden; zoom:1; } .x-tip .x-tip-bc { background: transparent no-repeat 0 -121px; height:3px; overflow:hidden; } .x-tip .x-tip-bl { background: transparent no-repeat 0 -59px; padding-left:6px; zoom:1; } .x-tip .x-tip-br { background: transparent no-repeat right -59px; padding-right:6px; zoom:1; } .x-tip .x-tip-mc { border:0 none; } .x-tip .x-tip-ml { background: no-repeat 0 -124px; padding-left:6px; zoom:1; } .x-tip .x-tip-mr { background: transparent no-repeat right -124px; padding-right:6px; zoom:1; } .ext-ie .x-tip .x-tip-header,.ext-ie .x-tip .x-tip-tc { font-size:0; line-height:0; } .ext-border-box .x-tip .x-tip-header, .ext-border-box .x-tip .x-tip-tc{ line-height: 1px; } .x-tip .x-tip-header-text { padding:0; margin:0 0 2px 0; } .x-tip .x-tip-body { margin:0 !important; line-height:14px; padding:0; } .x-tip .x-tip-body .loading-indicator { margin:0; } .x-tip-draggable .x-tip-header,.x-tip-draggable .x-tip-header-text { cursor:move; } .x-form-invalid-tip .x-tip-tc { background: repeat-x 0 -12px; padding-top:6px; } .x-form-invalid-tip .x-tip-bc { background: repeat-x 0 -18px; height:6px; } .x-form-invalid-tip .x-tip-bl { background: no-repeat 0 -6px; } .x-form-invalid-tip .x-tip-br { background: no-repeat right -6px; } .x-form-invalid-tip .x-tip-body { padding:2px; } .x-form-invalid-tip .x-tip-body { padding-left:24px; background:transparent no-repeat 2px 2px; } .x-tip-anchor { position: absolute; width: 9px; height: 10px; overflow:hidden; background: transparent no-repeat 0 0; zoom:1; } .x-tip-anchor-bottom { background-position: -9px 0; } .x-tip-anchor-right { background-position: -18px 0; width: 10px; } .x-tip-anchor-left { background-position: -28px 0; width: 10px; }.x-menu { z-index: 15000; zoom: 1; background: repeat-y; } .x-menu-floating{ border: 1px solid; } .x-menu a { text-decoration: none !important; } .ext-ie .x-menu { zoom:1; overflow:hidden; } .x-menu-list{ padding: 2px; background-color:transparent; border:0 none; overflow:hidden; overflow-y: hidden; } .ext-strict .ext-ie .x-menu-list{ position: relative; } .x-menu li{ line-height:100%; } .x-menu li.x-menu-sep-li{ font-size:1px; line-height:1px; } .x-menu-list-item{ white-space: nowrap; display:block; padding:1px; } .x-menu-item{ -moz-user-select: none; -khtml-user-select:none; -webkit-user-select:ignore; } .x-menu-item-arrow{ background:transparent no-repeat right; } .x-menu-sep { display:block; font-size:1px; line-height:1px; margin: 2px 3px; border-bottom:1px solid; overflow:hidden; } .x-menu-focus { position:absolute; left:-1px; top:-1px; width:1px; height:1px; line-height:1px; font-size:1px; -moz-outline:0 none; outline:0 none; -moz-user-select: none; -khtml-user-select:none; -webkit-user-select:ignore; overflow:hidden; display:block; } a.x-menu-item { cursor: pointer; display: block; line-height: 16px; outline-color: -moz-use-text-color; outline-style: none; outline-width: 0; padding: 3px 21px 3px 27px; position: relative; text-decoration: none; white-space: nowrap; } .x-menu-item-active { background-repeat: repeat-x; background-position: left bottom; border-style:solid; border-width: 1px 0; margin:0 1px; padding: 0; } .x-menu-item-active a.x-menu-item { border-style:solid; border-width:0 1px; margin:0 -1px; } .x-menu-item-icon { border: 0 none; height: 16px; padding: 0; vertical-align: top; width: 16px; position: absolute; left: 3px; top: 3px; margin: 0; background-position:center; } .ext-ie .x-menu-item-icon { left: -24px; } .ext-strict .x-menu-item-icon { left: 3px; } .ext-ie6 .x-menu-item-icon { left: -24px; } .ext-ie .x-menu-item-icon { vertical-align: middle; } .x-menu-check-item .x-menu-item-icon{ background: transparent no-repeat center; } .x-menu-group-item .x-menu-item-icon{ background-color: transparent; } .x-menu-item-checked .x-menu-group-item .x-menu-item-icon{ background: transparent no-repeat center; } .x-date-menu .x-menu-list{ padding: 0; } .x-menu-date-item{ padding:0; } .x-menu .x-color-palette, .x-menu .x-date-picker{ margin-left: 26px; margin-right:4px; } .x-menu .x-date-picker{ border:1px solid; margin-top:2px; margin-bottom:2px; } .x-menu-plain .x-color-palette, .x-menu-plain .x-date-picker{ margin: 0; border: 0 none; } .x-date-menu { padding:0 !important; } /* * fixes separator visibility problem in IE 6 */ .ext-strict .ext-ie6 .x-menu-sep-li { padding: 3px 4px; } .ext-strict .ext-ie6 .x-menu-sep { margin: 0; height: 1px; } /* * Fixes an issue with "fat" separators in webkit */ .ext-webkit .x-menu-sep{ height: 1px; } /* * Ugly mess to remove the white border under the picker */ .ext-ie .x-date-menu{ height: 199px; } .ext-strict .ext-ie .x-date-menu, .ext-border-box .ext-ie8 .x-date-menu{ height: 197px; } .ext-strict .ext-ie7 .x-date-menu{ height: 195px; } .ext-strict .ext-ie8 .x-date-menu{ height: auto; } .x-cycle-menu .x-menu-item-checked { border:1px dotted !important; padding:0; } .x-menu .x-menu-scroller { width: 100%; background-repeat:no-repeat; background-position:center; height:8px; line-height: 8px; cursor:pointer; margin: 0; padding: 0; } .x-menu .x-menu-scroller-active{ height: 6px; line-height: 6px; } .x-menu-list-item-indent{ padding-left: 27px; }/* Creates rounded, raised boxes like on the Ext website - the markup isn't pretty:

    YOUR TITLE HERE (optional)

    YOUR CONTENT HERE
    */ .x-box-tl { background: transparent no-repeat 0 0; zoom:1; } .x-box-tc { height: 8px; background: transparent repeat-x 0 0; overflow: hidden; } .x-box-tr { background: transparent no-repeat right -8px; } .x-box-ml { background: transparent repeat-y 0; padding-left: 4px; overflow: hidden; zoom:1; } .x-box-mc { background: repeat-x 0 -16px; padding: 4px 10px; } .x-box-mc h3 { margin: 0 0 4px 0; zoom:1; } .x-box-mr { background: transparent repeat-y right; padding-right: 4px; overflow: hidden; } .x-box-bl { background: transparent no-repeat 0 -16px; zoom:1; } .x-box-bc { background: transparent repeat-x 0 -8px; height: 8px; overflow: hidden; } .x-box-br { background: transparent no-repeat right -24px; } .x-box-tl, .x-box-bl { padding-left: 8px; overflow: hidden; } .x-box-tr, .x-box-br { padding-right: 8px; overflow: hidden; }.x-combo-list { border:1px solid; zoom:1; overflow:hidden; } .x-combo-list-inner { overflow:auto; position:relative; /* for calculating scroll offsets */ zoom:1; overflow-x:hidden; } .x-combo-list-hd { border-bottom:1px solid; padding:3px; } .x-resizable-pinned .x-combo-list-inner { border-bottom:1px solid; } .x-combo-list-item { padding:2px; border:1px solid; white-space: nowrap; overflow:hidden; text-overflow: ellipsis; } .x-combo-list .x-combo-selected{ border:1px dotted !important; cursor:pointer; } .x-combo-list .x-toolbar { border-top:1px solid; border-bottom:0 none; }.x-panel { border-style: solid; border-width:0; } .x-panel-header { overflow:hidden; zoom:1; padding:5px 3px 4px 5px; border:1px solid; line-height: 15px; background: transparent repeat-x 0 -1px; } .x-panel-body { border:1px solid; border-top:0 none; overflow:hidden; position: relative; /* added for item scroll positioning */ } .x-panel-bbar .x-toolbar, .x-panel-tbar .x-toolbar { border:1px solid; border-top:0 none; overflow:hidden; padding:2px; } .x-panel-tbar-noheader .x-toolbar, .x-panel-mc .x-panel-tbar .x-toolbar { border-top:1px solid; border-bottom: 0 none; } .x-panel-body-noheader, .x-panel-mc .x-panel-body { border-top:1px solid; } .x-panel-header { overflow:hidden; zoom:1; } .x-panel-tl .x-panel-header { padding:5px 0 4px 0; border:0 none; background:transparent no-repeat; } .x-panel-tl .x-panel-icon, .x-window-tl .x-panel-icon { padding-left:20px !important; background-repeat:no-repeat; background-position:0 4px; zoom:1; } .x-panel-inline-icon { width:16px; height:16px; background-repeat:no-repeat; background-position:0 0; vertical-align:middle; margin-right:4px; margin-top:-1px; margin-bottom:-1px; } .x-panel-tc { background: transparent repeat-x 0 0; overflow:hidden; } /* fix ie7 strict mode bug */ .ext-strict .ext-ie7 .x-panel-tc { overflow: visible; } .x-panel-tl { background: transparent no-repeat 0 0; padding-left:6px; zoom:1; border-bottom:1px solid; } .x-panel-tr { background: transparent no-repeat right 0; zoom:1; padding-right:6px; } .x-panel-bc { background: transparent repeat-x 0 bottom; zoom:1; } .x-panel-bc .x-panel-footer { zoom:1; } .x-panel-bl { background: transparent no-repeat 0 bottom; padding-left:6px; zoom:1; } .x-panel-br { background: transparent no-repeat right bottom; padding-right:6px; zoom:1; } .x-panel-mc { border:0 none; padding:0; margin:0; padding-top:6px; } .x-panel-mc .x-panel-body { background-color:transparent; border: 0 none; } .x-panel-ml { background: repeat-y 0 0; padding-left:6px; zoom:1; } .x-panel-mr { background: transparent repeat-y right 0; padding-right:6px; zoom:1; } .x-panel-bc .x-panel-footer { padding-bottom:6px; } .x-panel-nofooter .x-panel-bc, .x-panel-nofooter .x-window-bc { height:6px; font-size:0; line-height:0; } .x-panel-bwrap { overflow:hidden; zoom:1; left:0; top:0; } .x-panel-body { overflow:hidden; zoom:1; } .x-panel-collapsed .x-resizable-handle{ display:none; } .ext-gecko .x-panel-animated div { overflow:hidden !important; } /* Plain */ .x-plain-body { overflow:hidden; } .x-plain-bbar .x-toolbar { overflow:hidden; padding:2px; } .x-plain-tbar .x-toolbar { overflow:hidden; padding:2px; } .x-plain-bwrap { overflow:hidden; zoom:1; } .x-plain { overflow:hidden; } /* Tools */ .x-tool { overflow:hidden; width:15px; height:15px; float:right; cursor:pointer; background:transparent no-repeat; margin-left:2px; } /* expand / collapse tools */ .x-tool-toggle { background-position:0 -60px; } .x-tool-toggle-over { background-position:-15px -60px; } .x-panel-collapsed .x-tool-toggle { background-position:0 -75px; } .x-panel-collapsed .x-tool-toggle-over { background-position:-15px -75px; } .x-tool-close { background-position:0 -0; } .x-tool-close-over { background-position:-15px 0; } .x-tool-minimize { background-position:0 -15px; } .x-tool-minimize-over { background-position:-15px -15px; } .x-tool-maximize { background-position:0 -30px; } .x-tool-maximize-over { background-position:-15px -30px; } .x-tool-restore { background-position:0 -45px; } .x-tool-restore-over { background-position:-15px -45px; } .x-tool-gear { background-position:0 -90px; } .x-tool-gear-over { background-position:-15px -90px; } .x-tool-prev { background-position:0 -105px; } .x-tool-prev-over { background-position:-15px -105px; } .x-tool-next { background-position:0 -120px; } .x-tool-next-over { background-position:-15px -120px; } .x-tool-pin { background-position:0 -135px; } .x-tool-pin-over { background-position:-15px -135px; } .x-tool-unpin { background-position:0 -150px; } .x-tool-unpin-over { background-position:-15px -150px; } .x-tool-right { background-position:0 -165px; } .x-tool-right-over { background-position:-15px -165px; } .x-tool-left { background-position:0 -180px; } .x-tool-left-over { background-position:-15px -180px; } .x-tool-down { background-position:0 -195px; } .x-tool-down-over { background-position:-15px -195px; } .x-tool-up { background-position:0 -210px; } .x-tool-up-over { background-position:-15px -210px; } .x-tool-refresh { background-position:0 -225px; } .x-tool-refresh-over { background-position:-15px -225px; } .x-tool-plus { background-position:0 -240px; } .x-tool-plus-over { background-position:-15px -240px; } .x-tool-minus { background-position:0 -255px; } .x-tool-minus-over { background-position:-15px -255px; } .x-tool-search { background-position:0 -270px; } .x-tool-search-over { background-position:-15px -270px; } .x-tool-save { background-position:0 -285px; } .x-tool-save-over { background-position:-15px -285px; } .x-tool-help { background-position:0 -300px; } .x-tool-help-over { background-position:-15px -300px; } .x-tool-print { background-position:0 -315px; } .x-tool-print-over { background-position:-15px -315px; } .x-tool-expand { background-position:0 -330px; } .x-tool-expand-over { background-position:-15px -330px; } .x-tool-collapse { background-position:0 -345px; } .x-tool-collapse-over { background-position:-15px -345px; } .x-tool-resize { background-position:0 -360px; } .x-tool-resize-over { background-position:-15px -360px; } .x-tool-move { background-position:0 -375px; } .x-tool-move-over { background-position:-15px -375px; } /* Ghosting */ .x-panel-ghost { z-index:12000; overflow:hidden; position:absolute; left:0;top:0; opacity:.65; -moz-opacity:.65; filter:alpha(opacity=65); } .x-panel-ghost ul { margin:0; padding:0; overflow:hidden; font-size:0; line-height:0; border:1px solid; border-top:0 none; display:block; } .x-panel-ghost * { cursor:move !important; } .x-panel-dd-spacer { border:2px dashed; } /* Buttons */ .x-panel-btns { padding:5px; overflow:hidden; } .x-panel-btns td.x-toolbar-cell{ padding:3px; } .x-panel-btns .x-btn-focus .x-btn-left{ background-position:0 -147px; } .x-panel-btns .x-btn-focus .x-btn-right{ background-position:0 -168px; } .x-panel-btns .x-btn-focus .x-btn-center{ background-position:0 -189px; } .x-panel-btns .x-btn-over .x-btn-left{ background-position:0 -63px; } .x-panel-btns .x-btn-over .x-btn-right{ background-position:0 -84px; } .x-panel-btns .x-btn-over .x-btn-center{ background-position:0 -105px; } .x-panel-btns .x-btn-click .x-btn-center{ background-position:0 -126px; } .x-panel-btns .x-btn-click .x-btn-right{ background-position:0 -84px; } .x-panel-btns .x-btn-click .x-btn-left{ background-position:0 -63px; } .x-panel-fbar td,.x-panel-fbar span,.x-panel-fbar input,.x-panel-fbar div,.x-panel-fbar select,.x-panel-fbar label{ white-space: nowrap; } /** * W3C Suggested Default style sheet for HTML 4 * http://www.w3.org/TR/CSS21/sample.html * * Resets for Ext.Panel @cfg normal: true */ .x-panel-reset .x-panel-body html, .x-panel-reset .x-panel-body address, .x-panel-reset .x-panel-body blockquote, .x-panel-reset .x-panel-body body, .x-panel-reset .x-panel-body dd, .x-panel-reset .x-panel-body div, .x-panel-reset .x-panel-body dl, .x-panel-reset .x-panel-body dt, .x-panel-reset .x-panel-body fieldset, .x-panel-reset .x-panel-body form, .x-panel-reset .x-panel-body frame, frameset, .x-panel-reset .x-panel-body h1, .x-panel-reset .x-panel-body h2, .x-panel-reset .x-panel-body h3, .x-panel-reset .x-panel-body h4, .x-panel-reset .x-panel-body h5, .x-panel-reset .x-panel-body h6, .x-panel-reset .x-panel-body noframes, .x-panel-reset .x-panel-body ol, .x-panel-reset .x-panel-body p, .x-panel-reset .x-panel-body ul, .x-panel-reset .x-panel-body center, .x-panel-reset .x-panel-body dir, .x-panel-reset .x-panel-body hr, .x-panel-reset .x-panel-body menu, .x-panel-reset .x-panel-body pre { display: block } .x-panel-reset .x-panel-body li { display: list-item } .x-panel-reset .x-panel-body head { display: none } .x-panel-reset .x-panel-body table { display: table } .x-panel-reset .x-panel-body tr { display: table-row } .x-panel-reset .x-panel-body thead { display: table-header-group } .x-panel-reset .x-panel-body tbody { display: table-row-group } .x-panel-reset .x-panel-body tfoot { display: table-footer-group } .x-panel-reset .x-panel-body col { display: table-column } .x-panel-reset .x-panel-body colgroup { display: table-column-group } .x-panel-reset .x-panel-body td, .x-panel-reset .x-panel-body th { display: table-cell } .x-panel-reset .x-panel-body caption { display: table-caption } .x-panel-reset .x-panel-body th { font-weight: bolder; text-align: center } .x-panel-reset .x-panel-body caption { text-align: center } .x-panel-reset .x-panel-body body { margin: 8px } .x-panel-reset .x-panel-body h1 { font-size: 2em; margin: .67em 0 } .x-panel-reset .x-panel-body h2 { font-size: 1.5em; margin: .75em 0 } .x-panel-reset .x-panel-body h3 { font-size: 1.17em; margin: .83em 0 } .x-panel-reset .x-panel-body h4, .x-panel-reset .x-panel-body p, .x-panel-reset .x-panel-body blockquote, .x-panel-reset .x-panel-body ul, .x-panel-reset .x-panel-body fieldset, .x-panel-reset .x-panel-body form, .x-panel-reset .x-panel-body ol, .x-panel-reset .x-panel-body dl, .x-panel-reset .x-panel-body dir, .x-panel-reset .x-panel-body menu { margin: 1.12em 0 } .x-panel-reset .x-panel-body h5 { font-size: .83em; margin: 1.5em 0 } .x-panel-reset .x-panel-body h6 { font-size: .75em; margin: 1.67em 0 } .x-panel-reset .x-panel-body h1, .x-panel-reset .x-panel-body h2, .x-panel-reset .x-panel-body h3, .x-panel-reset .x-panel-body h4, .x-panel-reset .x-panel-body h5, .x-panel-reset .x-panel-body h6, .x-panel-reset .x-panel-body b, .x-panel-reset .x-panel-body strong { font-weight: bolder } .x-panel-reset .x-panel-body blockquote { margin-left: 40px; margin-right: 40px } .x-panel-reset .x-panel-body i, .x-panel-reset .x-panel-body cite, .x-panel-reset .x-panel-body em, .x-panel-reset .x-panel-body var, .x-panel-reset .x-panel-body address { font-style: italic } .x-panel-reset .x-panel-body pre, .x-panel-reset .x-panel-body tt, .x-panel-reset .x-panel-body code, .x-panel-reset .x-panel-body kbd, .x-panel-reset .x-panel-body samp { font-family: monospace } .x-panel-reset .x-panel-body pre { white-space: pre } .x-panel-reset .x-panel-body button, .x-panel-reset .x-panel-body textarea, .x-panel-reset .x-panel-body input, .x-panel-reset .x-panel-body select { display: inline-block } .x-panel-reset .x-panel-body big { font-size: 1.17em } .x-panel-reset .x-panel-body small, .x-panel-reset .x-panel-body sub, .x-panel-reset .x-panel-body sup { font-size: .83em } .x-panel-reset .x-panel-body sub { vertical-align: sub } .x-panel-reset .x-panel-body sup { vertical-align: super } .x-panel-reset .x-panel-body table { border-spacing: 2px; } .x-panel-reset .x-panel-body thead, .x-panel-reset .x-panel-body tbody, .x-panel-reset .x-panel-body tfoot { vertical-align: middle } .x-panel-reset .x-panel-body td, .x-panel-reset .x-panel-body th { vertical-align: inherit } .x-panel-reset .x-panel-body s, .x-panel-reset .x-panel-body strike, .x-panel-reset .x-panel-body del { text-decoration: line-through } .x-panel-reset .x-panel-body hr { border: 1px inset } .x-panel-reset .x-panel-body ol, .x-panel-reset .x-panel-body ul, .x-panel-reset .x-panel-body dir, .x-panel-reset .x-panel-body menu, .x-panel-reset .x-panel-body dd { margin-left: 40px } .x-panel-reset .x-panel-body ul, .x-panel-reset .x-panel-body menu, .x-panel-reset .x-panel-body dir { list-style-type: disc;} .x-panel-reset .x-panel-body ol { list-style-type: decimal } .x-panel-reset .x-panel-body ol ul, .x-panel-reset .x-panel-body ul ol, .x-panel-reset .x-panel-body ul ul, .x-panel-reset .x-panel-body ol ol { margin-top: 0; margin-bottom: 0 } .x-panel-reset .x-panel-body u, .x-panel-reset .x-panel-body ins { text-decoration: underline } .x-panel-reset .x-panel-body br:before { content: "\A" } .x-panel-reset .x-panel-body :before, .x-panel-reset .x-panel-body :after { white-space: pre-line } .x-panel-reset .x-panel-body center { text-align: center } .x-panel-reset .x-panel-body :link, .x-panel-reset .x-panel-body :visited { text-decoration: underline } .x-panel-reset .x-panel-body :focus { outline: invert dotted thin } /* Begin bidirectionality settings (do not change) */ .x-panel-reset .x-panel-body BDO[DIR="ltr"] { direction: ltr; unicode-bidi: bidi-override } .x-panel-reset .x-panel-body BDO[DIR="rtl"] { direction: rtl; unicode-bidi: bidi-override } .x-window { zoom:1; } .x-window .x-window-handle { opacity:0; -moz-opacity:0; filter:alpha(opacity=0); } .x-window-proxy { border:1px solid; z-index:12000; overflow:hidden; position:absolute; left:0;top:0; display:none; opacity:.5; -moz-opacity:.5; filter:alpha(opacity=50); } .x-window-header { overflow:hidden; zoom:1; } .x-window-bwrap { z-index:1; position:relative; zoom:1; left:0;top:0; } .x-window-tl .x-window-header { padding:5px 0 4px 0; } .x-window-header-text { cursor:pointer; } .x-window-tc { background: transparent repeat-x 0 0; overflow:hidden; zoom:1; } .x-window-tl { background: transparent no-repeat 0 0; padding-left:6px; zoom:1; z-index:1; position:relative; } .x-window-tr { background: transparent no-repeat right 0; padding-right:6px; } .x-window-bc { background: transparent repeat-x 0 bottom; zoom:1; } .x-window-bc .x-window-footer { padding-bottom:6px; zoom:1; font-size:0; line-height:0; } .x-window-bl { background: transparent no-repeat 0 bottom; padding-left:6px; zoom:1; } .x-window-br { background: transparent no-repeat right bottom; padding-right:6px; zoom:1; } .x-window-mc { border:1px solid; padding:0; margin:0; } .x-window-ml { background: transparent repeat-y 0 0; padding-left:6px; zoom:1; } .x-window-mr { background: transparent repeat-y right 0; padding-right:6px; zoom:1; } .x-window-body { overflow:hidden; } .x-window-bwrap { overflow:hidden; } .x-window-maximized .x-window-bl, .x-window-maximized .x-window-br, .x-window-maximized .x-window-ml, .x-window-maximized .x-window-mr, .x-window-maximized .x-window-tl, .x-window-maximized .x-window-tr { padding:0; } .x-window-maximized .x-window-footer { padding-bottom:0; } .x-window-maximized .x-window-tc { padding-left:3px; padding-right:3px; } .x-window-maximized .x-window-mc { border-left:0 none; border-right:0 none; } .x-window-tbar .x-toolbar, .x-window-bbar .x-toolbar { border-left:0 none; border-right: 0 none; } .x-window-bbar .x-toolbar { border-top:1px solid; border-bottom:0 none; } .x-window-draggable, .x-window-draggable .x-window-header-text { cursor:move; } .x-window-maximized .x-window-draggable, .x-window-maximized .x-window-draggable .x-window-header-text { cursor:default; } .x-window-body { background-color:transparent; } .x-panel-ghost .x-window-tl { border-bottom:1px solid; } .x-panel-collapsed .x-window-tl { border-bottom:1px solid; } .x-window-maximized-ct { overflow:hidden; } .x-window-maximized .x-window-handle { display:none; } .x-window-sizing-ghost ul { border:0 none !important; } .x-dlg-focus{ -moz-outline:0 none; outline:0 none; width:0; height:0; overflow:hidden; position:absolute; top:0; left:0; } .ext-webkit .x-dlg-focus{ width: 1px; height: 1px; } .x-dlg-mask{ z-index:10000; display:none; position:absolute; top:0; left:0; -moz-opacity: 0.5; opacity:.50; filter: alpha(opacity=50); } body.ext-ie6.x-body-masked select { visibility:hidden; } body.ext-ie6.x-body-masked .x-window select { visibility:visible; } .x-window-plain .x-window-mc { border: 1px solid; } .x-window-plain .x-window-body { border: 1px solid; background:transparent !important; }.x-html-editor-wrap { border:1px solid; } .x-html-editor-tb .x-btn-text { background:transparent no-repeat; } .x-html-editor-tb .x-edit-bold, .x-menu-item img.x-edit-bold { background-position:0 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-italic, .x-menu-item img.x-edit-italic { background-position:-16px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-underline, .x-menu-item img.x-edit-underline { background-position:-32px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-forecolor, .x-menu-item img.x-edit-forecolor { background-position:-160px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-backcolor, .x-menu-item img.x-edit-backcolor { background-position:-176px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-justifyleft, .x-menu-item img.x-edit-justifyleft { background-position:-112px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-justifycenter, .x-menu-item img.x-edit-justifycenter { background-position:-128px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-justifyright, .x-menu-item img.x-edit-justifyright { background-position:-144px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-insertorderedlist, .x-menu-item img.x-edit-insertorderedlist { background-position:-80px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-insertunorderedlist, .x-menu-item img.x-edit-insertunorderedlist { background-position:-96px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-increasefontsize, .x-menu-item img.x-edit-increasefontsize { background-position:-48px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-decreasefontsize, .x-menu-item img.x-edit-decreasefontsize { background-position:-64px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-sourceedit, .x-menu-item img.x-edit-sourceedit { background-position:-192px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-createlink, .x-menu-item img.x-edit-createlink { background-position:-208px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tip .x-tip-bd .x-tip-bd-inner { padding:5px; padding-bottom:1px; } .x-html-editor-tb .x-toolbar { position:static !important; }.x-panel-noborder .x-panel-body-noborder { border-width:0; } .x-panel-noborder .x-panel-header-noborder { border-width:0 0 1px; border-style:solid; } .x-panel-noborder .x-panel-tbar-noborder .x-toolbar { border-width:0 0 1px; border-style:solid; } .x-panel-noborder .x-panel-bbar-noborder .x-toolbar { border-width:1px 0 0 0; border-style:solid; } .x-window-noborder .x-window-mc { border-width:0; } .x-window-plain .x-window-body-noborder { border-width:0; } .x-tab-panel-noborder .x-tab-panel-body-noborder { border-width:0; } .x-tab-panel-noborder .x-tab-panel-header-noborder { border-width: 0 0 1px 0; } .x-tab-panel-noborder .x-tab-panel-footer-noborder { border-width: 1px 0 0 0; } .x-tab-panel-bbar-noborder .x-toolbar { border-width: 1px 0 0 0; border-style:solid; } .x-tab-panel-tbar-noborder .x-toolbar { border-width:0 0 1px; border-style:solid; }.x-border-layout-ct { position: relative; } .x-border-panel { position:absolute; left:0; top:0; } .x-tool-collapse-south { background-position:0 -195px; } .x-tool-collapse-south-over { background-position:-15px -195px; } .x-tool-collapse-north { background-position:0 -210px; } .x-tool-collapse-north-over { background-position:-15px -210px; } .x-tool-collapse-west { background-position:0 -180px; } .x-tool-collapse-west-over { background-position:-15px -180px; } .x-tool-collapse-east { background-position:0 -165px; } .x-tool-collapse-east-over { background-position:-15px -165px; } .x-tool-expand-south { background-position:0 -210px; } .x-tool-expand-south-over { background-position:-15px -210px; } .x-tool-expand-north { background-position:0 -195px; } .x-tool-expand-north-over { background-position:-15px -195px; } .x-tool-expand-west { background-position:0 -165px; } .x-tool-expand-west-over { background-position:-15px -165px; } .x-tool-expand-east { background-position:0 -180px; } .x-tool-expand-east-over { background-position:-15px -180px; } .x-tool-expand-north, .x-tool-expand-south { float:right; margin:3px; } .x-tool-expand-east, .x-tool-expand-west { float:none; margin:3px 2px; } .x-accordion-hd .x-tool-toggle { background-position:0 -255px; } .x-accordion-hd .x-tool-toggle-over { background-position:-15px -255px; } .x-panel-collapsed .x-accordion-hd .x-tool-toggle { background-position:0 -240px; } .x-panel-collapsed .x-accordion-hd .x-tool-toggle-over { background-position:-15px -240px; } .x-accordion-hd { padding-top:4px; padding-bottom:3px; border-top:0 none; background: transparent repeat-x 0 -9px; } .x-layout-collapsed{ position:absolute; left:-10000px; top:-10000px; visibility:hidden; width:20px; height:20px; overflow:hidden; border:1px solid; z-index:20; } .ext-border-box .x-layout-collapsed{ width:22px; height:22px; } .x-layout-collapsed-over{ cursor:pointer; } .x-layout-collapsed-west .x-layout-collapsed-tools, .x-layout-collapsed-east .x-layout-collapsed-tools{ position:absolute; top:0; left:0; width:20px; height:20px; } .x-layout-split{ position:absolute; height:5px; width:5px; line-height:1px; font-size:1px; z-index:3; background-color:transparent; } /* IE6 strict won't drag w/out a color */ .ext-strict .ext-ie6 .x-layout-split{ background-color: #fff !important; filter: alpha(opacity=1); } .x-layout-split-h{ background-image:url(../images/default/s.gif); background-position: left; } .x-layout-split-v{ background-image:url(../images/default/s.gif); background-position: top; } .x-column-layout-ct { overflow:hidden; zoom:1; } .x-column { float:left; padding:0; margin:0; overflow:hidden; zoom:1; } .x-column-inner { overflow:hidden; zoom:1; } /* mini mode */ .x-layout-mini { position:absolute; top:0; left:0; display:block; width:5px; height:35px; cursor:pointer; opacity:.5; -moz-opacity:.5; filter:alpha(opacity=50); } .x-layout-mini-over, .x-layout-collapsed-over .x-layout-mini{ opacity:1; -moz-opacity:1; filter:none; } .x-layout-split-west .x-layout-mini { top:48%; } .x-layout-split-east .x-layout-mini { top:48%; } .x-layout-split-north .x-layout-mini { left:48%; height:5px; width:35px; } .x-layout-split-south .x-layout-mini { left:48%; height:5px; width:35px; } .x-layout-cmini-west .x-layout-mini { top:48%; } .x-layout-cmini-east .x-layout-mini { top:48%; } .x-layout-cmini-north .x-layout-mini { left:48%; height:5px; width:35px; } .x-layout-cmini-south .x-layout-mini { left:48%; height:5px; width:35px; } .x-layout-cmini-west, .x-layout-cmini-east { border:0 none; width:5px !important; padding:0; background-color:transparent; } .x-layout-cmini-north, .x-layout-cmini-south { border:0 none; height:5px !important; padding:0; background-color:transparent; } .x-viewport, .x-viewport body { margin: 0; padding: 0; border: 0 none; overflow: hidden; height: 100%; } .x-abs-layout-item { position:absolute; left:0; top:0; } .ext-ie input.x-abs-layout-item, .ext-ie textarea.x-abs-layout-item { margin:0; } .x-box-layout-ct { overflow:hidden; zoom:1; } .x-box-inner { overflow:hidden; zoom:1; position:relative; left:0; top:0; } .x-box-item { position:absolute; left:0; top:0; }.x-progress-wrap { border:1px solid; overflow:hidden; } .x-progress-inner { height:18px; background:repeat-x; position:relative; } .x-progress-bar { height:18px; float:left; width:0; background: repeat-x left center; border-top:1px solid; border-bottom:1px solid; border-right:1px solid; } .x-progress-text { padding:1px 5px; overflow:hidden; position:absolute; left:0; text-align:center; } .x-progress-text-back { line-height:16px; } .ext-ie .x-progress-text-back { line-height:15px; } .ext-strict .ext-ie7 .x-progress-text-back{ width: 100%; } .x-list-header{ background: repeat-x 0 bottom; cursor:default; zoom:1; height:22px; } .x-list-header-inner div { display:block; float:left; overflow:hidden; -o-text-overflow: ellipsis; text-overflow: ellipsis; white-space: nowrap; } .x-list-header-inner div em { display:block; border-left:1px solid; padding:4px 4px; overflow:hidden; -moz-user-select: none; -khtml-user-select: none; line-height:14px; } .x-list-body { overflow:auto; overflow-x:hidden; overflow-y:auto; zoom:1; float: left; width: 100%; } .x-list-body dl { zoom:1; } .x-list-body dt { display:block; float:left; overflow:hidden; -o-text-overflow: ellipsis; text-overflow: ellipsis; white-space: nowrap; cursor:pointer; zoom:1; } .x-list-body dt em { display:block; padding:3px 4px; overflow:hidden; -moz-user-select: none; -khtml-user-select: none; } .x-list-resizer { border-left:1px solid; border-right:1px solid; position:absolute; left:0; top:0; } .x-list-header-inner em.sort-asc { background: transparent no-repeat center 0; border-style:solid; border-width: 0 1px 1px; padding-bottom:3px; } .x-list-header-inner em.sort-desc { background: transparent no-repeat center -23px; border-style:solid; border-width: 0 1px 1px; padding-bottom:3px; } /* Shared styles */ .x-slider { zoom:1; } .x-slider-inner { position:relative; left:0; top:0; overflow:visible; zoom:1; } .x-slider-focus { position:absolute; left:0; top:0; width:1px; height:1px; line-height:1px; font-size:1px; -moz-outline:0 none; outline:0 none; -moz-user-select: none; -khtml-user-select:none; -webkit-user-select:ignore; display:block; overflow:hidden; } /* Horizontal styles */ .x-slider-horz { padding-left:7px; background:transparent no-repeat 0 -22px; } .x-slider-horz .x-slider-end { padding-right:7px; zoom:1; background:transparent no-repeat right -44px; } .x-slider-horz .x-slider-inner { background:transparent repeat-x 0 0; height:22px; } .x-slider-horz .x-slider-thumb { width:14px; height:15px; position:absolute; left:0; top:3px; background:transparent no-repeat 0 0; } .x-slider-horz .x-slider-thumb-over { background-position: -14px -15px; } .x-slider-horz .x-slider-thumb-drag { background-position: -28px -30px; } /* Vertical styles */ .x-slider-vert { padding-top:7px; background:transparent no-repeat -44px 0; width:22px; } .x-slider-vert .x-slider-end { padding-bottom:7px; zoom:1; background:transparent no-repeat -22px bottom; } .x-slider-vert .x-slider-inner { background:transparent repeat-y 0 0; } .x-slider-vert .x-slider-thumb { width:15px; height:14px; position:absolute; left:3px; bottom:0; background:transparent no-repeat 0 0; } .x-slider-vert .x-slider-thumb-over { background-position: -15px -14px; } .x-slider-vert .x-slider-thumb-drag { background-position: -30px -28px; }.x-window-dlg .x-window-body { border:0 none !important; padding:5px 10px; overflow:hidden !important; } .x-window-dlg .x-window-mc { border:0 none !important; } .x-window-dlg .ext-mb-input { margin-top:4px; width:95%; } .x-window-dlg .ext-mb-textarea { margin-top:4px; } .x-window-dlg .x-progress-wrap { margin-top:4px; } .ext-ie .x-window-dlg .x-progress-wrap { margin-top:6px; } .x-window-dlg .x-msg-box-wait { background:transparent no-repeat left; display:block; width:300px; padding-left:18px; line-height:18px; } .x-window-dlg .ext-mb-icon { float:left; width:47px; height:32px; } .x-window-dlg .x-dlg-icon .ext-mb-content{ zoom: 1; margin-left: 47px; } .x-window-dlg .ext-mb-info, .x-window-dlg .ext-mb-warning, .x-window-dlg .ext-mb-question, .x-window-dlg .ext-mb-error { background:transparent no-repeat top left; } .ext-gecko2 .ext-mb-fix-cursor { overflow:auto; }.ext-el-mask { background-color: #ccc; } .ext-el-mask-msg { border-color:#6593cf; background-color:#c3daf9; background-image:url(../images/default/box/tb-blue.gif); } .ext-el-mask-msg div { background-color: #eee; border-color:#a3bad9; color:#222; font:normal 11px tahoma, arial, helvetica, sans-serif; } .x-mask-loading div { background-color:#fbfbfb; background-image:url(../images/default/grid/loading.gif); } .x-item-disabled { color: gray; } .x-item-disabled * { color: gray !important; } .x-splitbar-proxy { background-color: #aaa; } .x-color-palette a { border-color:#fff; } .x-color-palette a:hover, .x-color-palette a.x-color-palette-sel { border-color:#8bb8f3; background-color: #deecfd; } /* .x-color-palette em:hover, .x-color-palette span:hover{ background-color: #deecfd; } */ .x-color-palette em { border-color:#aca899; } .x-ie-shadow { background-color:#777; } .x-shadow .xsmc { background-image: url(../images/default/shadow-c.png); } .x-shadow .xsml, .x-shadow .xsmr { background-image: url(../images/default/shadow-lr.png); } .x-shadow .xstl, .x-shadow .xstc, .x-shadow .xstr, .x-shadow .xsbl, .x-shadow .xsbc, .x-shadow .xsbr{ background-image: url(../images/default/shadow.png); } .loading-indicator { font-size: 11px; background-image: url(../images/default/grid/loading.gif); } .x-spotlight { background-color: #ccc; } .x-tab-panel-header, .x-tab-panel-footer { background-color: #deecfd; border-color:#8db2e3; overflow:hidden; zoom:1; } .x-tab-panel-header, .x-tab-panel-footer { border-color:#8db2e3; } ul.x-tab-strip-top{ background-color:#cedff5; background-image: url(../images/default/tabs/tab-strip-bg.gif); border-bottom-color:#8db2e3; } ul.x-tab-strip-bottom{ background-color:#cedff5; background-image: url(../images/default/tabs/tab-strip-btm-bg.gif); border-top-color:#8db2e3; } .x-tab-panel-header-plain .x-tab-strip-spacer, .x-tab-panel-footer-plain .x-tab-strip-spacer { border-color:#8db2e3; background-color: #deecfd; } .x-tab-strip span.x-tab-strip-text { font:normal 11px tahoma,arial,helvetica; color:#416aa3; } .x-tab-strip-over span.x-tab-strip-text { color:#15428b; } .x-tab-strip-active span.x-tab-strip-text { color:#15428b; font-weight:bold; } .x-tab-strip-disabled .x-tabs-text { color:#aaaaaa; } .x-tab-strip-top .x-tab-right, .x-tab-strip-top .x-tab-left, .x-tab-strip-top .x-tab-strip-inner{ background-image: url(../images/default/tabs/tabs-sprite.gif); } .x-tab-strip-bottom .x-tab-right { background-image: url(../images/default/tabs/tab-btm-inactive-right-bg.gif); } .x-tab-strip-bottom .x-tab-left { background-image: url(../images/default/tabs/tab-btm-inactive-left-bg.gif); } .x-tab-strip-bottom .x-tab-strip-over .x-tab-right { background-image: url(../images/default/tabs/tab-btm-over-right-bg.gif); } .x-tab-strip-bottom .x-tab-strip-over .x-tab-left { background-image: url(../images/default/tabs/tab-btm-over-left-bg.gif); } .x-tab-strip-bottom .x-tab-strip-active .x-tab-right { background-image: url(../images/default/tabs/tab-btm-right-bg.gif); } .x-tab-strip-bottom .x-tab-strip-active .x-tab-left { background-image: url(../images/default/tabs/tab-btm-left-bg.gif); } .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close { background-image:url(../images/default/tabs/tab-close.gif); } .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close:hover{ background-image:url(../images/default/tabs/tab-close.gif); } .x-tab-panel-body { border-color:#8db2e3; background-color:#fff; } .x-tab-panel-body-top { border-top: 0 none; } .x-tab-panel-body-bottom { border-bottom: 0 none; } .x-tab-scroller-left { background-image:url(../images/default/tabs/scroll-left.gif); border-bottom-color:#8db2e3; } .x-tab-scroller-left-over { background-position: 0 0; } .x-tab-scroller-left-disabled { background-position: -18px 0; opacity:.5; -moz-opacity:.5; filter:alpha(opacity=50); cursor:default; } .x-tab-scroller-right { background-image:url(../images/default/tabs/scroll-right.gif); border-bottom-color:#8db2e3; } .x-tab-panel-bbar .x-toolbar, .x-tab-panel-tbar .x-toolbar { border-color:#99bbe8; }.x-form-field { font:normal 12px tahoma, arial, helvetica, sans-serif; } .x-form-text, textarea.x-form-field { background-color:#fff; background-image:url(../images/default/form/text-bg.gif); border-color:#b5b8c8; } .x-form-select-one { background-color:#fff; border-color:#b5b8c8; } .x-form-check-group-label { border-bottom: 1px solid #99bbe8; color: #15428b; } .x-editor .x-form-check-wrap { background-color:#fff; } .x-form-field-wrap .x-form-trigger { background-image:url(../images/default/form/trigger.gif); border-bottom-color:#b5b8c8; } .x-form-field-wrap .x-form-date-trigger { background-image: url(../images/default/form/date-trigger.gif); } .x-form-field-wrap .x-form-clear-trigger { background-image: url(../images/default/form/clear-trigger.gif); } .x-form-field-wrap .x-form-search-trigger { background-image: url(../images/default/form/search-trigger.gif); } .x-trigger-wrap-focus .x-form-trigger { border-bottom-color:#7eadd9; } .x-item-disabled .x-form-trigger-over { border-bottom-color:#b5b8c8; } .x-item-disabled .x-form-trigger-click { border-bottom-color:#b5b8c8; } .x-form-focus, textarea.x-form-focus { border-color:#7eadd9; } .x-form-invalid, textarea.x-form-invalid { background-color:#fff; background-image:url(../images/default/grid/invalid_line.gif); border-color:#c30; } .x-form-invalid.x-form-composite { border: none; background-image: none; } .x-form-invalid.x-form-composite .x-form-invalid { background-color:#fff; background-image:url(../images/default/grid/invalid_line.gif); border-color:#c30; } .x-form-inner-invalid, textarea.x-form-inner-invalid { background-color:#fff; background-image:url(../images/default/grid/invalid_line.gif); } .x-form-grow-sizer { font:normal 12px tahoma, arial, helvetica, sans-serif; } .x-form-item { font:normal 12px tahoma, arial, helvetica, sans-serif; } .x-form-invalid-msg { color:#c0272b; font:normal 11px tahoma, arial, helvetica, sans-serif; background-image:url(../images/default/shared/warning.gif); } .x-form-empty-field { color:gray; } .x-small-editor .x-form-field { font:normal 11px arial, tahoma, helvetica, sans-serif; } .ext-webkit .x-small-editor .x-form-field { font:normal 11px arial, tahoma, helvetica, sans-serif; } .x-form-invalid-icon { background-image:url(../images/default/form/exclamation.gif); } .x-fieldset { border-color:#b5b8c8; } .x-fieldset legend { font:bold 11px tahoma, arial, helvetica, sans-serif; color:#15428b; } .x-btn{ font:normal 11px tahoma, verdana, helvetica; } .x-btn button{ font:normal 11px arial,tahoma,verdana,helvetica; color:#333; } .x-btn em { font-style:normal; font-weight:normal; } .x-btn-tl, .x-btn-tr, .x-btn-tc, .x-btn-ml, .x-btn-mr, .x-btn-mc, .x-btn-bl, .x-btn-br, .x-btn-bc{ background-image:url(../images/default/button/btn.gif); } .x-btn-click .x-btn-text, .x-btn-menu-active .x-btn-text, .x-btn-pressed .x-btn-text{ color:#000; } .x-btn-disabled *{ color:gray !important; } .x-btn-mc em.x-btn-arrow { background-image:url(../images/default/button/arrow.gif); } .x-btn-mc em.x-btn-split { background-image:url(../images/default/button/s-arrow.gif); } .x-btn-over .x-btn-mc em.x-btn-split, .x-btn-click .x-btn-mc em.x-btn-split, .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-btn-pressed .x-btn-mc em.x-btn-split { background-image:url(../images/default/button/s-arrow-o.gif); } .x-btn-mc em.x-btn-arrow-bottom { background-image:url(../images/default/button/s-arrow-b-noline.gif); } .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/default/button/s-arrow-b.gif); } .x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-btn-click .x-btn-mc em.x-btn-split-bottom, .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-btn-pressed .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/default/button/s-arrow-bo.gif); } .x-btn-group-header { color: #3e6aaa; } .x-btn-group-tc { background-image: url(../images/default/button/group-tb.gif); } .x-btn-group-tl { background-image: url(../images/default/button/group-cs.gif); } .x-btn-group-tr { background-image: url(../images/default/button/group-cs.gif); } .x-btn-group-bc { background-image: url(../images/default/button/group-tb.gif); } .x-btn-group-bl { background-image: url(../images/default/button/group-cs.gif); } .x-btn-group-br { background-image: url(../images/default/button/group-cs.gif); } .x-btn-group-ml { background-image: url(../images/default/button/group-lr.gif); } .x-btn-group-mr { background-image: url(../images/default/button/group-lr.gif); } .x-btn-group-notitle .x-btn-group-tc { background-image: url(../images/default/button/group-tb.gif); }.x-toolbar{ border-color:#a9bfd3; background-color:#d0def0; background-image:url(../images/default/toolbar/bg.gif); } .x-toolbar td,.x-toolbar span,.x-toolbar input,.x-toolbar div,.x-toolbar select,.x-toolbar label{ font:normal 11px arial,tahoma, helvetica, sans-serif; } .x-toolbar .x-item-disabled { color:gray; } .x-toolbar .x-item-disabled * { color:gray; } .x-toolbar .x-btn-mc em.x-btn-split { background-image:url(../images/default/button/s-arrow-noline.gif); } .x-toolbar .x-btn-over .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split { background-image:url(../images/default/button/s-arrow-o.gif); } .x-toolbar .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/default/button/s-arrow-b-noline.gif); } .x-toolbar .x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/default/button/s-arrow-bo.gif); } .x-toolbar .xtb-sep { background-image: url(../images/default/grid/grid-blue-split.gif); } .x-tbar-page-first{ background-image: url(../images/default/grid/page-first.gif) !important; } .x-tbar-loading{ background-image: url(../images/default/grid/refresh.gif) !important; } .x-tbar-page-last{ background-image: url(../images/default/grid/page-last.gif) !important; } .x-tbar-page-next{ background-image: url(../images/default/grid/page-next.gif) !important; } .x-tbar-page-prev{ background-image: url(../images/default/grid/page-prev.gif) !important; } .x-item-disabled .x-tbar-loading{ background-image: url(../images/default/grid/refresh-disabled.gif) !important; } .x-item-disabled .x-tbar-page-first{ background-image: url(../images/default/grid/page-first-disabled.gif) !important; } .x-item-disabled .x-tbar-page-last{ background-image: url(../images/default/grid/page-last-disabled.gif) !important; } .x-item-disabled .x-tbar-page-next{ background-image: url(../images/default/grid/page-next-disabled.gif) !important; } .x-item-disabled .x-tbar-page-prev{ background-image: url(../images/default/grid/page-prev-disabled.gif) !important; } .x-paging-info { color:#444; } .x-toolbar-more-icon { background-image: url(../images/default/toolbar/more.gif) !important; }.x-resizable-handle { background-color:#fff; } .x-resizable-over .x-resizable-handle-east, .x-resizable-pinned .x-resizable-handle-east, .x-resizable-over .x-resizable-handle-west, .x-resizable-pinned .x-resizable-handle-west { background-image:url(../images/default/sizer/e-handle.gif); } .x-resizable-over .x-resizable-handle-south, .x-resizable-pinned .x-resizable-handle-south, .x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north { background-image:url(../images/default/sizer/s-handle.gif); } .x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north{ background-image:url(../images/default/sizer/s-handle.gif); } .x-resizable-over .x-resizable-handle-southeast, .x-resizable-pinned .x-resizable-handle-southeast{ background-image:url(../images/default/sizer/se-handle.gif); } .x-resizable-over .x-resizable-handle-northwest, .x-resizable-pinned .x-resizable-handle-northwest{ background-image:url(../images/default/sizer/nw-handle.gif); } .x-resizable-over .x-resizable-handle-northeast, .x-resizable-pinned .x-resizable-handle-northeast{ background-image:url(../images/default/sizer/ne-handle.gif); } .x-resizable-over .x-resizable-handle-southwest, .x-resizable-pinned .x-resizable-handle-southwest{ background-image:url(../images/default/sizer/sw-handle.gif); } .x-resizable-proxy{ border-color:#3b5a82; } .x-resizable-overlay{ background-color:#fff; } .x-grid3 { background-color:#fff; } .x-grid-panel .x-panel-mc .x-panel-body { border-color:#99bbe8; } .x-grid3-row td, .x-grid3-summary-row td{ font:normal 11px/13px arial, tahoma, helvetica, sans-serif; } .x-grid3-hd-row td { font:normal 11px/15px arial, tahoma, helvetica, sans-serif; } .x-grid3-hd-row td { border-left-color:#eee; border-right-color:#d0d0d0; } .x-grid-row-loading { background-color: #fff; background-image:url(../images/default/shared/loading-balls.gif); } .x-grid3-row { border-color:#ededed; border-top-color:#fff; } .x-grid3-row-alt{ background-color:#fafafa; } .x-grid3-row-over { border-color:#ddd; background-color:#efefef; background-image:url(../images/default/grid/row-over.gif); } .x-grid3-resize-proxy { background-color:#777; } .x-grid3-resize-marker { background-color:#777; } .x-grid3-header{ background-color:#f9f9f9; background-image:url(../images/default/grid/grid3-hrow.gif); } .x-grid3-header-pop { border-left-color:#d0d0d0; } .x-grid3-header-pop-inner { border-left-color:#eee; background-image:url(../images/default/grid/hd-pop.gif); } td.x-grid3-hd-over, td.sort-desc, td.sort-asc, td.x-grid3-hd-menu-open { border-left-color:#aaccf6; border-right-color:#aaccf6; } td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-asc .x-grid3-hd-inner, td.x-grid3-hd-menu-open .x-grid3-hd-inner { background-color:#ebf3fd; background-image:url(../images/default/grid/grid3-hrow-over.gif); } .sort-asc .x-grid3-sort-icon { background-image: url(../images/default/grid/sort_asc.gif); } .sort-desc .x-grid3-sort-icon { background-image: url(../images/default/grid/sort_desc.gif); } .x-grid3-cell-text, .x-grid3-hd-text { color:#000; } .x-grid3-split { background-image: url(../images/default/grid/grid-split.gif); } .x-grid3-hd-text { color:#15428b; } .x-dd-drag-proxy .x-grid3-hd-inner{ background-color:#ebf3fd; background-image:url(../images/default/grid/grid3-hrow-over.gif); border-color:#aaccf6; } .col-move-top{ background-image:url(../images/default/grid/col-move-top.gif); } .col-move-bottom{ background-image:url(../images/default/grid/col-move-bottom.gif); } td.grid-hd-group-cell { background: url(../images/default/grid/grid3-hrow.gif) repeat-x bottom; } .x-grid3-row-selected { background-color: #dfe8f6 !important; background-image: none; border-color:#a3bae9; } .x-grid3-cell-selected{ background-color: #b8cfee !important; color:#000; } .x-grid3-cell-selected span{ color:#000 !important; } .x-grid3-cell-selected .x-grid3-cell-text{ color:#000; } .x-grid3-locked td.x-grid3-row-marker, .x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker{ background-color:#ebeadb !important; background-image:url(../images/default/grid/grid-hrow.gif) !important; color:#000; border-top-color:#fff; border-right-color:#6fa0df !important; } .x-grid3-locked td.x-grid3-row-marker div, .x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker div{ color:#15428b !important; } .x-grid3-dirty-cell { background-image:url(../images/default/grid/dirty.gif); } .x-grid3-topbar, .x-grid3-bottombar{ font:normal 11px arial, tahoma, helvetica, sans-serif; } .x-grid3-bottombar .x-toolbar{ border-top-color:#a9bfd3; } .x-props-grid .x-grid3-td-name .x-grid3-cell-inner{ background-image:url(../images/default/grid/grid3-special-col-bg.gif) !important; color:#000 !important; } .x-props-grid .x-grid3-body .x-grid3-td-name{ background-color:#fff !important; border-right-color:#eee; } .xg-hmenu-sort-asc .x-menu-item-icon{ background-image: url(../images/default/grid/hmenu-asc.gif); } .xg-hmenu-sort-desc .x-menu-item-icon{ background-image: url(../images/default/grid/hmenu-desc.gif); } .xg-hmenu-lock .x-menu-item-icon{ background-image: url(../images/default/grid/hmenu-lock.gif); } .xg-hmenu-unlock .x-menu-item-icon{ background-image: url(../images/default/grid/hmenu-unlock.gif); } .x-grid3-hd-btn { background-color:#c3daf9; background-image:url(../images/default/grid/grid3-hd-btn.gif); } .x-grid3-body .x-grid3-td-expander { background-image:url(../images/default/grid/grid3-special-col-bg.gif); } .x-grid3-row-expander { background-image:url(../images/default/grid/row-expand-sprite.gif); } .x-grid3-body .x-grid3-td-checker { background-image: url(../images/default/grid/grid3-special-col-bg.gif); } .x-grid3-row-checker, .x-grid3-hd-checker { background-image:url(../images/default/grid/row-check-sprite.gif); } .x-grid3-body .x-grid3-td-numberer { background-image:url(../images/default/grid/grid3-special-col-bg.gif); } .x-grid3-body .x-grid3-td-numberer .x-grid3-cell-inner { color:#444; } .x-grid3-body .x-grid3-td-row-icon { background-image:url(../images/default/grid/grid3-special-col-bg.gif); } .x-grid3-body .x-grid3-row-selected .x-grid3-td-numberer, .x-grid3-body .x-grid3-row-selected .x-grid3-td-checker, .x-grid3-body .x-grid3-row-selected .x-grid3-td-expander { background-image:url(../images/default/grid/grid3-special-col-sel-bg.gif); } .x-grid3-check-col { background-image:url(../images/default/menu/unchecked.gif); } .x-grid3-check-col-on { background-image:url(../images/default/menu/checked.gif); } .x-grid-group, .x-grid-group-body, .x-grid-group-hd { zoom:1; } .x-grid-group-hd { border-bottom-color:#99bbe8; } .x-grid-group-hd div.x-grid-group-title { background-image:url(../images/default/grid/group-collapse.gif); color:#3764a0; font:bold 11px tahoma, arial, helvetica, sans-serif; } .x-grid-group-collapsed .x-grid-group-hd div.x-grid-group-title { background-image:url(../images/default/grid/group-expand.gif); } .x-group-by-icon { background-image:url(../images/default/grid/group-by.gif); } .x-cols-icon { background-image:url(../images/default/grid/columns.gif); } .x-show-groups-icon { background-image:url(../images/default/grid/group-by.gif); } .x-grid-empty { color:gray; font:normal 11px tahoma, arial, helvetica, sans-serif; } .x-grid-with-col-lines .x-grid3-row td.x-grid3-cell { border-right-color:#ededed; } .x-grid-with-col-lines .x-grid3-row-selected { border-top-color:#a3bae9; }.x-pivotgrid .x-grid3-header-offset table td { background: url(../images/default/grid/grid3-hrow.gif) repeat-x 50% 100%; border-left: 1px solid; border-right: 1px solid; border-left-color: #EEE; border-right-color: #D0D0D0; } .x-pivotgrid .x-grid3-row-headers { background-color: #f9f9f9; } .x-pivotgrid .x-grid3-row-headers table td { background: #EEE url(../images/default/grid/grid3-rowheader.gif) repeat-x left top; border-left: 1px solid; border-right: 1px solid; border-left-color: #EEE; border-right-color: #D0D0D0; border-bottom: 1px solid; border-bottom-color: #D0D0D0; height: 18px; } .x-dd-drag-ghost{ color:#000; font: normal 11px arial, helvetica, sans-serif; border-color: #ddd #bbb #bbb #ddd; background-color:#fff; } .x-dd-drop-nodrop .x-dd-drop-icon{ background-image: url(../images/default/dd/drop-no.gif); } .x-dd-drop-ok .x-dd-drop-icon{ background-image: url(../images/default/dd/drop-yes.gif); } .x-dd-drop-ok-add .x-dd-drop-icon{ background-image: url(../images/default/dd/drop-add.gif); } .x-view-selector { background-color:#c3daf9; border-color:#3399bb; }.x-tree-node-expanded .x-tree-node-icon{ background-image:url(../images/default/tree/folder-open.gif); } .x-tree-node-leaf .x-tree-node-icon{ background-image:url(../images/default/tree/leaf.gif); } .x-tree-node-collapsed .x-tree-node-icon{ background-image:url(../images/default/tree/folder.gif); } .x-tree-node-loading .x-tree-node-icon{ background-image:url(../images/default/tree/loading.gif) !important; } .x-tree-node .x-tree-node-inline-icon { background-image: none; } .x-tree-node-loading a span{ font-style: italic; color:#444444; } .x-tree-lines .x-tree-elbow{ background-image:url(../images/default/tree/elbow.gif); } .x-tree-lines .x-tree-elbow-plus{ background-image:url(../images/default/tree/elbow-plus.gif); } .x-tree-lines .x-tree-elbow-minus{ background-image:url(../images/default/tree/elbow-minus.gif); } .x-tree-lines .x-tree-elbow-end{ background-image:url(../images/default/tree/elbow-end.gif); } .x-tree-lines .x-tree-elbow-end-plus{ background-image:url(../images/default/tree/elbow-end-plus.gif); } .x-tree-lines .x-tree-elbow-end-minus{ background-image:url(../images/default/tree/elbow-end-minus.gif); } .x-tree-lines .x-tree-elbow-line{ background-image:url(../images/default/tree/elbow-line.gif); } .x-tree-no-lines .x-tree-elbow-plus{ background-image:url(../images/default/tree/elbow-plus-nl.gif); } .x-tree-no-lines .x-tree-elbow-minus{ background-image:url(../images/default/tree/elbow-minus-nl.gif); } .x-tree-no-lines .x-tree-elbow-end-plus{ background-image:url(../images/default/tree/elbow-end-plus-nl.gif); } .x-tree-no-lines .x-tree-elbow-end-minus{ background-image:url(../images/default/tree/elbow-end-minus-nl.gif); } .x-tree-arrows .x-tree-elbow-plus{ background-image:url(../images/default/tree/arrows.gif); } .x-tree-arrows .x-tree-elbow-minus{ background-image:url(../images/default/tree/arrows.gif); } .x-tree-arrows .x-tree-elbow-end-plus{ background-image:url(../images/default/tree/arrows.gif); } .x-tree-arrows .x-tree-elbow-end-minus{ background-image:url(../images/default/tree/arrows.gif); } .x-tree-node{ color:#000; font: normal 11px arial, tahoma, helvetica, sans-serif; } .x-tree-node a, .x-dd-drag-ghost a{ color:#000; } .x-tree-node a span, .x-dd-drag-ghost a span{ color:#000; } .x-tree-node .x-tree-node-disabled a span{ color:gray !important; } .x-tree-node div.x-tree-drag-insert-below{ border-bottom-color:#36c; } .x-tree-node div.x-tree-drag-insert-above{ border-top-color:#36c; } .x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-below a{ border-bottom-color:#36c; } .x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-above a{ border-top-color:#36c; } .x-tree-node .x-tree-drag-append a span{ background-color:#ddd; border-color:gray; } .x-tree-node .x-tree-node-over { background-color: #eee; } .x-tree-node .x-tree-selected { background-color: #d9e8fb; } .x-tree-drop-ok-append .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-add.gif); } .x-tree-drop-ok-above .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-over.gif); } .x-tree-drop-ok-below .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-under.gif); } .x-tree-drop-ok-between .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-between.gif); }.x-date-picker { border-color: #1b376c; background-color:#fff; } .x-date-middle,.x-date-left,.x-date-right { background-image: url(../images/default/shared/hd-sprite.gif); color:#fff; font:bold 11px "sans serif", tahoma, verdana, helvetica; } .x-date-middle .x-btn .x-btn-text { color:#fff; } .x-date-middle .x-btn-mc em.x-btn-arrow { background-image:url(../images/default/toolbar/btn-arrow-light.gif); } .x-date-right a { background-image: url(../images/default/shared/right-btn.gif); } .x-date-left a{ background-image: url(../images/default/shared/left-btn.gif); } .x-date-inner th { background-color:#dfecfb; background-image:url(../images/default/shared/glass-bg.gif); border-bottom-color:#a3bad9; font:normal 10px arial, helvetica,tahoma,sans-serif; color:#233d6d; } .x-date-inner td { border-color:#fff; } .x-date-inner a { font:normal 11px arial, helvetica,tahoma,sans-serif; color:#000; } .x-date-inner .x-date-active{ color:#000; } .x-date-inner .x-date-selected a{ background-color:#dfecfb; background-image:url(../images/default/shared/glass-bg.gif); border-color:#8db2e3; } .x-date-inner .x-date-today a{ border-color:darkred; } .x-date-inner .x-date-selected span{ font-weight:bold; } .x-date-inner .x-date-prevday a,.x-date-inner .x-date-nextday a { color:#aaa; } .x-date-bottom { border-top-color:#a3bad9; background-color:#dfecfb; background-image:url(../images/default/shared/glass-bg.gif); } .x-date-inner a:hover, .x-date-inner .x-date-disabled a:hover{ color:#000; background-color:#ddecfe; } .x-date-inner .x-date-disabled a { background-color:#eee; color:#bbb; } .x-date-mmenu{ background-color:#eee !important; } .x-date-mmenu .x-menu-item { font-size:10px; color:#000; } .x-date-mp { background-color:#fff; } .x-date-mp td { font:normal 11px arial, helvetica,tahoma,sans-serif; } .x-date-mp-btns button { background-color:#083772; color:#fff; border-color: #3366cc #000055 #000055 #3366cc; font:normal 11px arial, helvetica,tahoma,sans-serif; } .x-date-mp-btns { background-color: #dfecfb; background-image: url(../images/default/shared/glass-bg.gif); } .x-date-mp-btns td { border-top-color: #c5d2df; } td.x-date-mp-month a,td.x-date-mp-year a { color:#15428b; } td.x-date-mp-month a:hover,td.x-date-mp-year a:hover { color:#15428b; background-color: #ddecfe; } td.x-date-mp-sel a { background-color: #dfecfb; background-image: url(../images/default/shared/glass-bg.gif); border-color:#8db2e3; } .x-date-mp-ybtn a { background-image:url(../images/default/panel/tool-sprites.gif); } td.x-date-mp-sep { border-right-color:#c5d2df; }.x-tip .x-tip-close{ background-image: url(../images/default/qtip/close.gif); } .x-tip .x-tip-tc, .x-tip .x-tip-tl, .x-tip .x-tip-tr, .x-tip .x-tip-bc, .x-tip .x-tip-bl, .x-tip .x-tip-br, .x-tip .x-tip-ml, .x-tip .x-tip-mr { background-image: url(../images/default/qtip/tip-sprite.gif); } .x-tip .x-tip-mc { font: normal 11px tahoma,arial,helvetica,sans-serif; } .x-tip .x-tip-ml { background-color: #fff; } .x-tip .x-tip-header-text { font: bold 11px tahoma,arial,helvetica,sans-serif; color:#444; } .x-tip .x-tip-body { font: normal 11px tahoma,arial,helvetica,sans-serif; color:#444; } .x-form-invalid-tip .x-tip-tc, .x-form-invalid-tip .x-tip-tl, .x-form-invalid-tip .x-tip-tr, .x-form-invalid-tip .x-tip-bc, .x-form-invalid-tip .x-tip-bl, .x-form-invalid-tip .x-tip-br, .x-form-invalid-tip .x-tip-ml, .x-form-invalid-tip .x-tip-mr { background-image: url(../images/default/form/error-tip-corners.gif); } .x-form-invalid-tip .x-tip-body { background-image:url(../images/default/form/exclamation.gif); } .x-tip-anchor { background-image:url(../images/default/qtip/tip-anchor-sprite.gif); }.x-menu { background-color:#f0f0f0; background-image:url(../images/default/menu/menu.gif); } .x-menu-floating{ border-color:#718bb7; } .x-menu-nosep { background-image:none; } .x-menu-list-item{ font:normal 11px arial,tahoma,sans-serif; } .x-menu-item-arrow{ background-image:url(../images/default/menu/menu-parent.gif); } .x-menu-sep { background-color:#e0e0e0; border-bottom-color:#fff; } a.x-menu-item { color:#222; } .x-menu-item-active { background-image: url(../images/default/menu/item-over.gif); background-color: #dbecf4; border-color:#aaccf6; } .x-menu-item-active a.x-menu-item { border-color:#aaccf6; } .x-menu-check-item .x-menu-item-icon{ background-image:url(../images/default/menu/unchecked.gif); } .x-menu-item-checked .x-menu-item-icon{ background-image:url(../images/default/menu/checked.gif); } .x-menu-item-checked .x-menu-group-item .x-menu-item-icon{ background-image:url(../images/default/menu/group-checked.gif); } .x-menu-group-item .x-menu-item-icon{ background-image:none; } .x-menu-plain { background-color:#f0f0f0 !important; background-image: none; } .x-date-menu, .x-color-menu{ background-color: #fff !important; } .x-menu .x-date-picker{ border-color:#a3bad9; } .x-cycle-menu .x-menu-item-checked { border-color:#a3bae9 !important; background-color:#def8f6; } .x-menu-scroller-top { background-image:url(../images/default/layout/mini-top.gif); } .x-menu-scroller-bottom { background-image:url(../images/default/layout/mini-bottom.gif); } .x-box-tl { background-image: url(../images/default/box/corners.gif); } .x-box-tc { background-image: url(../images/default/box/tb.gif); } .x-box-tr { background-image: url(../images/default/box/corners.gif); } .x-box-ml { background-image: url(../images/default/box/l.gif); } .x-box-mc { background-color: #eee; background-image: url(../images/default/box/tb.gif); font-family: "Myriad Pro","Myriad Web","Tahoma","Helvetica","Arial",sans-serif; color: #393939; font-size: 12px; } .x-box-mc h3 { font-size: 14px; font-weight: bold; } .x-box-mr { background-image: url(../images/default/box/r.gif); } .x-box-bl { background-image: url(../images/default/box/corners.gif); } .x-box-bc { background-image: url(../images/default/box/tb.gif); } .x-box-br { background-image: url(../images/default/box/corners.gif); } .x-box-blue .x-box-bl, .x-box-blue .x-box-br, .x-box-blue .x-box-tl, .x-box-blue .x-box-tr { background-image: url(../images/default/box/corners-blue.gif); } .x-box-blue .x-box-bc, .x-box-blue .x-box-mc, .x-box-blue .x-box-tc { background-image: url(../images/default/box/tb-blue.gif); } .x-box-blue .x-box-mc { background-color: #c3daf9; } .x-box-blue .x-box-mc h3 { color: #17385b; } .x-box-blue .x-box-ml { background-image: url(../images/default/box/l-blue.gif); } .x-box-blue .x-box-mr { background-image: url(../images/default/box/r-blue.gif); }.x-combo-list { border-color:#98c0f4; background-color:#ddecfe; font:normal 12px tahoma, arial, helvetica, sans-serif; } .x-combo-list-inner { background-color:#fff; } .x-combo-list-hd { font:bold 11px tahoma, arial, helvetica, sans-serif; color:#15428b; background-image: url(../images/default/layout/panel-title-light-bg.gif); border-bottom-color:#98c0f4; } .x-resizable-pinned .x-combo-list-inner { border-bottom-color:#98c0f4; } .x-combo-list-item { border-color:#fff; } .x-combo-list .x-combo-selected{ border-color:#a3bae9 !important; background-color:#dfe8f6; } .x-combo-list .x-toolbar { border-top-color:#98c0f4; } .x-combo-list-small { font:normal 11px tahoma, arial, helvetica, sans-serif; }.x-panel { border-color: #99bbe8; } .x-panel-header { color:#15428b; font-weight:bold; font-size: 11px; font-family: tahoma,arial,verdana,sans-serif; border-color:#99bbe8; background-image: url(../images/default/panel/white-top-bottom.gif); } .x-panel-body { border-color:#99bbe8; background-color:#fff; } .x-panel-bbar .x-toolbar, .x-panel-tbar .x-toolbar { border-color:#99bbe8; } .x-panel-tbar-noheader .x-toolbar, .x-panel-mc .x-panel-tbar .x-toolbar { border-top-color:#99bbe8; } .x-panel-body-noheader, .x-panel-mc .x-panel-body { border-top-color:#99bbe8; } .x-panel-tl .x-panel-header { color:#15428b; font:bold 11px tahoma,arial,verdana,sans-serif; } .x-panel-tc { background-image: url(../images/default/panel/top-bottom.gif); } .x-panel-tl, .x-panel-tr, .x-panel-bl, .x-panel-br{ background-image: url(../images/default/panel/corners-sprite.gif); border-bottom-color:#99bbe8; } .x-panel-bc { background-image: url(../images/default/panel/top-bottom.gif); } .x-panel-mc { font: normal 11px tahoma,arial,helvetica,sans-serif; background-color:#dfe8f6; } .x-panel-ml { background-color: #fff; background-image:url(../images/default/panel/left-right.gif); } .x-panel-mr { background-image: url(../images/default/panel/left-right.gif); } .x-tool { background-image:url(../images/default/panel/tool-sprites.gif); } .x-panel-ghost { background-color:#cbddf3; } .x-panel-ghost ul { border-color:#99bbe8; } .x-panel-dd-spacer { border-color:#99bbe8; } .x-panel-fbar td,.x-panel-fbar span,.x-panel-fbar input,.x-panel-fbar div,.x-panel-fbar select,.x-panel-fbar label{ font:normal 11px arial,tahoma, helvetica, sans-serif; } .x-window-proxy { background-color:#c7dffc; border-color:#99bbe8; } .x-window-tl .x-window-header { color:#15428b; font:bold 11px tahoma,arial,verdana,sans-serif; } .x-window-tc { background-image: url(../images/default/window/top-bottom.png); } .x-window-tl { background-image: url(../images/default/window/left-corners.png); } .x-window-tr { background-image: url(../images/default/window/right-corners.png); } .x-window-bc { background-image: url(../images/default/window/top-bottom.png); } .x-window-bl { background-image: url(../images/default/window/left-corners.png); } .x-window-br { background-image: url(../images/default/window/right-corners.png); } .x-window-mc { border-color:#99bbe8; font: normal 11px tahoma,arial,helvetica,sans-serif; background-color:#dfe8f6; } .x-window-ml { background-image: url(../images/default/window/left-right.png); } .x-window-mr { background-image: url(../images/default/window/left-right.png); } .x-window-maximized .x-window-tc { background-color:#fff; } .x-window-bbar .x-toolbar { border-top-color:#99bbe8; } .x-panel-ghost .x-window-tl { border-bottom-color:#99bbe8; } .x-panel-collapsed .x-window-tl { border-bottom-color:#84a0c4; } .x-dlg-mask{ background-color:#ccc; } .x-window-plain .x-window-mc { background-color: #ccd9e8; border-color: #a3bae9 #dfe8f6 #dfe8f6 #a3bae9; } .x-window-plain .x-window-body { border-color: #dfe8f6 #a3bae9 #a3bae9 #dfe8f6; } body.x-body-masked .x-window-plain .x-window-mc { background-color: #ccd9e8; }.x-html-editor-wrap { border-color:#a9bfd3; background-color:#fff; } .x-html-editor-tb .x-btn-text { background-image:url(../images/default/editor/tb-sprite.gif); }.x-panel-noborder .x-panel-header-noborder { border-bottom-color:#99bbe8; } .x-panel-noborder .x-panel-tbar-noborder .x-toolbar { border-bottom-color:#99bbe8; } .x-panel-noborder .x-panel-bbar-noborder .x-toolbar { border-top-color:#99bbe8; } .x-tab-panel-bbar-noborder .x-toolbar { border-top-color:#99bbe8; } .x-tab-panel-tbar-noborder .x-toolbar { border-bottom-color:#99bbe8; }.x-border-layout-ct { background-color:#dfe8f6; } .x-accordion-hd { color:#222; font-weight:normal; background-image: url(../images/default/panel/light-hd.gif); } .x-layout-collapsed{ background-color:#d2e0f2; border-color:#98c0f4; } .x-layout-collapsed-over{ background-color:#d9e8fb; } .x-layout-split-west .x-layout-mini { background-image:url(../images/default/layout/mini-left.gif); } .x-layout-split-east .x-layout-mini { background-image:url(../images/default/layout/mini-right.gif); } .x-layout-split-north .x-layout-mini { background-image:url(../images/default/layout/mini-top.gif); } .x-layout-split-south .x-layout-mini { background-image:url(../images/default/layout/mini-bottom.gif); } .x-layout-cmini-west .x-layout-mini { background-image:url(../images/default/layout/mini-right.gif); } .x-layout-cmini-east .x-layout-mini { background-image:url(../images/default/layout/mini-left.gif); } .x-layout-cmini-north .x-layout-mini { background-image:url(../images/default/layout/mini-bottom.gif); } .x-layout-cmini-south .x-layout-mini { background-image:url(../images/default/layout/mini-top.gif); }.x-progress-wrap { border-color:#6593cf; } .x-progress-inner { background-color:#e0e8f3; background-image:url(../images/default/qtip/bg.gif); } .x-progress-bar { background-color:#9cbfee; background-image:url(../images/default/progress/progress-bg.gif); border-top-color:#d1e4fd; border-bottom-color:#7fa9e4; border-right-color:#7fa9e4; } .x-progress-text { font-size:11px; font-weight:bold; color:#fff; } .x-progress-text-back { color:#396095; }.x-list-header{ background-color:#f9f9f9; background-image:url(../images/default/grid/grid3-hrow.gif); } .x-list-header-inner div em { border-left-color:#ddd; font:normal 11px arial, tahoma, helvetica, sans-serif; } .x-list-body dt em { font:normal 11px arial, tahoma, helvetica, sans-serif; } .x-list-over { background-color:#eee; } .x-list-selected { background-color:#dfe8f6; } .x-list-resizer { border-left-color:#555; border-right-color:#555; } .x-list-header-inner em.sort-asc, .x-list-header-inner em.sort-desc { background-image:url(../images/default/grid/sort-hd.gif); border-color: #99bbe8; }.x-slider-horz, .x-slider-horz .x-slider-end, .x-slider-horz .x-slider-inner { background-image:url(../images/default/slider/slider-bg.png); } .x-slider-horz .x-slider-thumb { background-image:url(../images/default/slider/slider-thumb.png); } .x-slider-vert, .x-slider-vert .x-slider-end, .x-slider-vert .x-slider-inner { background-image:url(../images/default/slider/slider-v-bg.png); } .x-slider-vert .x-slider-thumb { background-image:url(../images/default/slider/slider-v-thumb.png); }.x-window-dlg .ext-mb-text, .x-window-dlg .x-window-header-text { font-size:12px; } .x-window-dlg .ext-mb-textarea { font:normal 12px tahoma,arial,helvetica,sans-serif; } .x-window-dlg .x-msg-box-wait { background-image:url(../images/default/grid/loading.gif); } .x-window-dlg .ext-mb-info { background-image:url(../images/default/window/icon-info.gif); } .x-window-dlg .ext-mb-warning { background-image:url(../images/default/window/icon-warning.gif); } .x-window-dlg .ext-mb-question { background-image:url(../images/default/window/icon-question.gif); } .x-window-dlg .ext-mb-error { background-image:url(../images/default/window/icon-error.gif); }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/reset-min.css000066400000000000000000000007211226600447100227430ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ html,body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td{margin:0;padding:0;}img,body,html{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}ol,ul {list-style:none;}caption,th {text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;}q:before,q:after{content:'';}glpi-0.84.3+dfsg.1/lib/extjs/resources/css/structure/000077500000000000000000000000001226600447100223665ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/extjs/resources/css/structure/borders.css000066400000000000000000000020411226600447100245350ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-panel-noborder .x-panel-body-noborder { border-width:0; } .x-panel-noborder .x-panel-header-noborder { border-width:0 0 1px; border-style:solid; } .x-panel-noborder .x-panel-tbar-noborder .x-toolbar { border-width:0 0 1px; border-style:solid; } .x-panel-noborder .x-panel-bbar-noborder .x-toolbar { border-width:1px 0 0 0; border-style:solid; } .x-window-noborder .x-window-mc { border-width:0; } .x-window-plain .x-window-body-noborder { border-width:0; } .x-tab-panel-noborder .x-tab-panel-body-noborder { border-width:0; } .x-tab-panel-noborder .x-tab-panel-header-noborder { border-width: 0 0 1px 0; } .x-tab-panel-noborder .x-tab-panel-footer-noborder { border-width: 1px 0 0 0; } .x-tab-panel-bbar-noborder .x-toolbar { border-width: 1px 0 0 0; border-style:solid; } .x-tab-panel-tbar-noborder .x-toolbar { border-width:0 0 1px; border-style:solid; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/structure/box.css000066400000000000000000000027541226600447100237000ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /* Creates rounded, raised boxes like on the Ext website - the markup isn't pretty:

    YOUR TITLE HERE (optional)

    YOUR CONTENT HERE
    */ .x-box-tl { background: transparent no-repeat 0 0; zoom:1; } .x-box-tc { height: 8px; background: transparent repeat-x 0 0; overflow: hidden; } .x-box-tr { background: transparent no-repeat right -8px; } .x-box-ml { background: transparent repeat-y 0; padding-left: 4px; overflow: hidden; zoom:1; } .x-box-mc { background: repeat-x 0 -16px; padding: 4px 10px; } .x-box-mc h3 { margin: 0 0 4px 0; zoom:1; } .x-box-mr { background: transparent repeat-y right; padding-right: 4px; overflow: hidden; } .x-box-bl { background: transparent no-repeat 0 -16px; zoom:1; } .x-box-bc { background: transparent repeat-x 0 -8px; height: 8px; overflow: hidden; } .x-box-br { background: transparent no-repeat right -24px; } .x-box-tl, .x-box-bl { padding-left: 8px; overflow: hidden; } .x-box-tr, .x-box-br { padding-right: 8px; overflow: hidden; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/structure/button.css000066400000000000000000000176371226600447100244310ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-btn{ cursor:pointer; white-space: nowrap; } .x-btn button{ border:0 none; background-color:transparent; padding-left:3px; padding-right:3px; cursor:pointer; margin:0; overflow:visible; width:auto; -moz-outline:0 none; outline:0 none; } * html .ext-ie .x-btn button { width:1px; } .ext-gecko .x-btn button, .ext-webkit .x-btn button { padding-left:0; padding-right:0; } .ext-gecko .x-btn button::-moz-focus-inner { padding:0; } .ext-ie .x-btn button { padding-top:2px; } .x-btn td { padding:0 !important; } .x-btn-text { cursor:pointer; white-space: nowrap; padding:0; } /* icon placement and sizing styles */ /* Only text */ .x-btn-noicon .x-btn-small .x-btn-text{ height: 16px; } .x-btn-noicon .x-btn-medium .x-btn-text{ height: 24px; } .x-btn-noicon .x-btn-large .x-btn-text{ height: 32px; } /* Only icons */ .x-btn-icon .x-btn-text{ background-position: center; background-repeat: no-repeat; } .x-btn-icon .x-btn-small .x-btn-text{ height: 16px; width: 16px; } .x-btn-icon .x-btn-medium .x-btn-text{ height: 24px; width: 24px; } .x-btn-icon .x-btn-large .x-btn-text{ height: 32px; width: 32px; } /* Icons and text */ /* left */ .x-btn-text-icon .x-btn-icon-small-left .x-btn-text{ background-position: 0 center; background-repeat: no-repeat; padding-left:18px; height:16px; } .x-btn-text-icon .x-btn-icon-medium-left .x-btn-text{ background-position: 0 center; background-repeat: no-repeat; padding-left:26px; height:24px; } .x-btn-text-icon .x-btn-icon-large-left .x-btn-text{ background-position: 0 center; background-repeat: no-repeat; padding-left:34px; height:32px; } /* top */ .x-btn-text-icon .x-btn-icon-small-top .x-btn-text{ background-position: center 0; background-repeat: no-repeat; padding-top:18px; } .x-btn-text-icon .x-btn-icon-medium-top .x-btn-text{ background-position: center 0; background-repeat: no-repeat; padding-top:26px; } .x-btn-text-icon .x-btn-icon-large-top .x-btn-text{ background-position: center 0; background-repeat: no-repeat; padding-top:34px; } /* right */ .x-btn-text-icon .x-btn-icon-small-right .x-btn-text{ background-position: right center; background-repeat: no-repeat; padding-right:18px; height:16px; } .x-btn-text-icon .x-btn-icon-medium-right .x-btn-text{ background-position: right center; background-repeat: no-repeat; padding-right:26px; height:24px; } .x-btn-text-icon .x-btn-icon-large-right .x-btn-text{ background-position: right center; background-repeat: no-repeat; padding-right:34px; height:32px; } /* bottom */ .x-btn-text-icon .x-btn-icon-small-bottom .x-btn-text{ background-position: center bottom; background-repeat: no-repeat; padding-bottom:18px; } .x-btn-text-icon .x-btn-icon-medium-bottom .x-btn-text{ background-position: center bottom; background-repeat: no-repeat; padding-bottom:26px; } .x-btn-text-icon .x-btn-icon-large-bottom .x-btn-text{ background-position: center bottom; background-repeat: no-repeat; padding-bottom:34px; } /* background positioning */ .x-btn-tr i, .x-btn-tl i, .x-btn-mr i, .x-btn-ml i, .x-btn-br i, .x-btn-bl i{ font-size:1px; line-height:1px; width:3px; display:block; overflow:hidden; } .x-btn-tr i, .x-btn-tl i, .x-btn-br i, .x-btn-bl i{ height:3px; } .x-btn-tl{ width:3px; height:3px; background:no-repeat 0 0; } .x-btn-tr{ width:3px; height:3px; background:no-repeat -3px 0; } .x-btn-tc{ height:3px; background:repeat-x 0 -6px; } .x-btn-ml{ width:3px; background:no-repeat 0 -24px; } .x-btn-mr{ width:3px; background:no-repeat -3px -24px; } .x-btn-mc{ background:repeat-x 0 -1096px; vertical-align: middle; text-align:center; padding:0 5px; cursor:pointer; white-space:nowrap; } /* Fixes an issue with the button height */ .ext-strict .ext-ie6 .x-btn-mc, .ext-strict .ext-ie7 .x-btn-mc { height: 100%; } .x-btn-bl{ width:3px; height:3px; background:no-repeat 0 -3px; } .x-btn-br{ width:3px; height:3px; background:no-repeat -3px -3px; } .x-btn-bc{ height:3px; background:repeat-x 0 -15px; } .x-btn-over .x-btn-tl{ background-position: -6px 0; } .x-btn-over .x-btn-tr{ background-position: -9px 0; } .x-btn-over .x-btn-tc{ background-position: 0 -9px; } .x-btn-over .x-btn-ml{ background-position: -6px -24px; } .x-btn-over .x-btn-mr{ background-position: -9px -24px; } .x-btn-over .x-btn-mc{ background-position: 0 -2168px; } .x-btn-over .x-btn-bl{ background-position: -6px -3px; } .x-btn-over .x-btn-br{ background-position: -9px -3px; } .x-btn-over .x-btn-bc{ background-position: 0 -18px; } .x-btn-click .x-btn-tl, .x-btn-menu-active .x-btn-tl, .x-btn-pressed .x-btn-tl{ background-position: -12px 0; } .x-btn-click .x-btn-tr, .x-btn-menu-active .x-btn-tr, .x-btn-pressed .x-btn-tr{ background-position: -15px 0; } .x-btn-click .x-btn-tc, .x-btn-menu-active .x-btn-tc, .x-btn-pressed .x-btn-tc{ background-position: 0 -12px; } .x-btn-click .x-btn-ml, .x-btn-menu-active .x-btn-ml, .x-btn-pressed .x-btn-ml{ background-position: -12px -24px; } .x-btn-click .x-btn-mr, .x-btn-menu-active .x-btn-mr, .x-btn-pressed .x-btn-mr{ background-position: -15px -24px; } .x-btn-click .x-btn-mc, .x-btn-menu-active .x-btn-mc, .x-btn-pressed .x-btn-mc{ background-position: 0 -3240px; } .x-btn-click .x-btn-bl, .x-btn-menu-active .x-btn-bl, .x-btn-pressed .x-btn-bl{ background-position: -12px -3px; } .x-btn-click .x-btn-br, .x-btn-menu-active .x-btn-br, .x-btn-pressed .x-btn-br{ background-position: -15px -3px; } .x-btn-click .x-btn-bc, .x-btn-menu-active .x-btn-bc, .x-btn-pressed .x-btn-bc{ background-position: 0 -21px; } .x-btn-disabled *{ cursor:default !important; } /* With a menu arrow */ /* right */ .x-btn-mc em.x-btn-arrow { display:block; background:transparent no-repeat right center; padding-right:10px; } .x-btn-mc em.x-btn-split { display:block; background:transparent no-repeat right center; padding-right:14px; } /* bottom */ .x-btn-mc em.x-btn-arrow-bottom { display:block; background:transparent no-repeat center bottom; padding-bottom:14px; } .x-btn-mc em.x-btn-split-bottom { display:block; background:transparent no-repeat center bottom; padding-bottom:14px; } /* height adjustment class */ .x-btn-as-arrow .x-btn-mc em { display:block; background-color:transparent; padding-bottom:14px; } /* groups */ .x-btn-group { padding:1px; } .x-btn-group-header { padding:2px; text-align:center; } .x-btn-group-tc { background: transparent repeat-x 0 0; overflow:hidden; } .x-btn-group-tl { background: transparent no-repeat 0 0; padding-left:3px; zoom:1; } .x-btn-group-tr { background: transparent no-repeat right 0; zoom:1; padding-right:3px; } .x-btn-group-bc { background: transparent repeat-x 0 bottom; zoom:1; } .x-btn-group-bc .x-panel-footer { zoom:1; } .x-btn-group-bl { background: transparent no-repeat 0 bottom; padding-left:3px; zoom:1; } .x-btn-group-br { background: transparent no-repeat right bottom; padding-right:3px; zoom:1; } .x-btn-group-mc { border:0 none; padding:1px 0 0 0; margin:0; } .x-btn-group-mc .x-btn-group-body { background-color:transparent; border: 0 none; } .x-btn-group-ml { background: transparent repeat-y 0 0; padding-left:3px; zoom:1; } .x-btn-group-mr { background: transparent repeat-y right 0; padding-right:3px; zoom:1; } .x-btn-group-bc .x-btn-group-footer { padding-bottom:6px; } .x-panel-nofooter .x-btn-group-bc { height:3px; font-size:0; line-height:0; } .x-btn-group-bwrap { overflow:hidden; zoom:1; } .x-btn-group-body { overflow:hidden; zoom:1; } .x-btn-group-notitle .x-btn-group-tc { background: transparent repeat-x 0 0; overflow:hidden; height:2px; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/structure/combo.css000066400000000000000000000014231226600447100241770ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-combo-list { border:1px solid; zoom:1; overflow:hidden; } .x-combo-list-inner { overflow:auto; position:relative; /* for calculating scroll offsets */ zoom:1; overflow-x:hidden; } .x-combo-list-hd { border-bottom:1px solid; padding:3px; } .x-resizable-pinned .x-combo-list-inner { border-bottom:1px solid; } .x-combo-list-item { padding:2px; border:1px solid; white-space: nowrap; overflow:hidden; text-overflow: ellipsis; } .x-combo-list .x-combo-selected{ border:1px dotted !important; cursor:pointer; } .x-combo-list .x-toolbar { border-top:1px solid; border-bottom:0 none; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/structure/core.css000066400000000000000000000124251226600447100240340ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .ext-el-mask { z-index: 100; position: absolute; top:0; left:0; -moz-opacity: 0.5; opacity: .50; filter: alpha(opacity=50); width: 100%; height: 100%; zoom: 1; } .ext-el-mask-msg { z-index: 20001; position: absolute; top: 0; left: 0; border:1px solid; background:repeat-x 0 -16px; padding:2px; } .ext-el-mask-msg div { padding:5px 10px 5px 10px; border:1px solid; cursor:wait; } .ext-shim { position:absolute; visibility:hidden; left:0; top:0; overflow:hidden; } .ext-ie .ext-shim { filter: alpha(opacity=0); } .ext-ie6 .ext-shim { margin-left: 5px; margin-top: 3px; } .x-mask-loading div { padding:5px 10px 5px 25px; background:no-repeat 5px 5px; line-height:16px; } /* class for hiding elements without using display:none */ .x-hidden, .x-hide-offsets { position:absolute !important; left:-10000px; top:-10000px; visibility:hidden; } .x-hide-display { display:none !important; } .x-hide-nosize, .x-hide-nosize * /* Emulate display:none for children */ { height:0px!important; width:0px!important; visibility:hidden!important; border:none!important; zoom:1; } .x-hide-visibility { visibility:hidden !important; } .x-masked { overflow: hidden !important; } .x-masked-relative { position: relative !important; } .x-masked select, .x-masked object, .x-masked embed { visibility: hidden; } .x-layer { visibility: hidden; } .x-unselectable, .x-unselectable * { -moz-user-select: none; -khtml-user-select: none; -webkit-user-select:ignore; } .x-repaint { zoom: 1; background-color: transparent; -moz-outline: none; outline: none; } .x-item-disabled { cursor: default; opacity: .6; -moz-opacity: .6; filter: alpha(opacity=60); } .x-item-disabled * { cursor: default !important; } .x-form-radio-group .x-item-disabled { filter: none; } .x-splitbar-proxy { position: absolute; visibility: hidden; z-index: 20001; zoom: 1; line-height: 1px; font-size: 1px; overflow: hidden; } .x-splitbar-h, .x-splitbar-proxy-h { cursor: e-resize; cursor: col-resize; } .x-splitbar-v, .x-splitbar-proxy-v { cursor: s-resize; cursor: row-resize; } .x-color-palette { width: 150px; height: 92px; cursor: pointer; } .x-color-palette a { border: 1px solid; float: left; padding: 2px; text-decoration: none; -moz-outline: 0 none; outline: 0 none; cursor: pointer; } .x-color-palette a:hover, .x-color-palette a.x-color-palette-sel { border: 1px solid; } .x-color-palette em { display: block; border: 1px solid; } .x-color-palette em span { cursor: pointer; display: block; height: 10px; line-height: 10px; width: 10px; } .x-ie-shadow { display: none; position: absolute; overflow: hidden; left:0; top:0; zoom:1; } .x-shadow { display: none; position: absolute; overflow: hidden; left:0; top:0; } .x-shadow * { overflow: hidden; } .x-shadow * { padding: 0; border: 0; margin: 0; clear: none; zoom: 1; } /* top bottom */ .x-shadow .xstc, .x-shadow .xsbc { height: 6px; float: left; } /* corners */ .x-shadow .xstl, .x-shadow .xstr, .x-shadow .xsbl, .x-shadow .xsbr { width: 6px; height: 6px; float: left; } /* sides */ .x-shadow .xsc { width: 100%; } .x-shadow .xsml, .x-shadow .xsmr { width: 6px; float: left; height: 100%; } .x-shadow .xsmc { float: left; height: 100%; background-color: transparent; } .x-shadow .xst, .x-shadow .xsb { height: 6px; overflow: hidden; width: 100%; } .x-shadow .xsml { background: transparent repeat-y 0 0; } .x-shadow .xsmr { background: transparent repeat-y -6px 0; } .x-shadow .xstl { background: transparent no-repeat 0 0; } .x-shadow .xstc { background: transparent repeat-x 0 -30px; } .x-shadow .xstr { background: transparent repeat-x 0 -18px; } .x-shadow .xsbl { background: transparent no-repeat 0 -12px; } .x-shadow .xsbc { background: transparent repeat-x 0 -36px; } .x-shadow .xsbr { background: transparent repeat-x 0 -6px; } .loading-indicator { background: no-repeat left; padding-left: 20px; line-height: 16px; margin: 3px; } .x-text-resize { position: absolute; left: -1000px; top: -1000px; visibility: hidden; zoom: 1; } .x-drag-overlay { width: 100%; height: 100%; display: none; position: absolute; left: 0; top: 0; background-image:url(../images/default/s.gif); z-index: 20000; } .x-clear { clear:both; height:0; overflow:hidden; line-height:0; font-size:0; } .x-spotlight { z-index: 8999; position: absolute; top:0; left:0; -moz-opacity: 0.5; opacity: .50; filter: alpha(opacity=50); width:0; height:0; zoom: 1; } #x-history-frame { position:absolute; top:-1px; left:0; width:1px; height:1px; visibility:hidden; } #x-history-field { position:absolute; top:0; left:-1px; width:1px; height:1px; visibility:hidden; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/structure/date-picker.css000066400000000000000000000112161226600447100252710ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-date-picker { border: 1px solid; border-top:0 none; position:relative; } .x-date-picker a { -moz-outline:0 none; outline:0 none; } .x-date-inner, .x-date-inner td, .x-date-inner th{ border-collapse:separate; } .x-date-middle,.x-date-left,.x-date-right { background: repeat-x 0 -83px; overflow:hidden; } .x-date-middle .x-btn-tc,.x-date-middle .x-btn-tl,.x-date-middle .x-btn-tr, .x-date-middle .x-btn-mc,.x-date-middle .x-btn-ml,.x-date-middle .x-btn-mr, .x-date-middle .x-btn-bc,.x-date-middle .x-btn-bl,.x-date-middle .x-btn-br{ background:transparent !important; vertical-align:middle; } .x-date-middle .x-btn-mc em.x-btn-arrow { background:transparent no-repeat right 0; } .x-date-right, .x-date-left { width:18px; } .x-date-right{ text-align:right; } .x-date-middle { padding-top:2px; padding-bottom:2px; width:130px; /* FF3 */ } .x-date-right a, .x-date-left a{ display:block; width:16px; height:16px; background-position: center; background-repeat: no-repeat; cursor:pointer; -moz-opacity: 0.6; opacity:.6; filter: alpha(opacity=60); } .x-date-right a:hover, .x-date-left a:hover{ -moz-opacity: 1; opacity:1; filter: alpha(opacity=100); } .x-item-disabled .x-date-right a:hover, .x-item-disabled .x-date-left a:hover{ -moz-opacity: 0.6; opacity:.6; filter: alpha(opacity=60); } .x-date-right a { margin-right:2px; text-decoration:none !important; } .x-date-left a{ margin-left:2px; text-decoration:none !important; } table.x-date-inner { width: 100%; table-layout:fixed; } .ext-webkit table.x-date-inner{ /* Fix for webkit browsers */ width: 175px; } .x-date-inner th { width:25px; } .x-date-inner th { background: repeat-x left top; text-align:right !important; border-bottom: 1px solid; cursor:default; padding:0; border-collapse:separate; } .x-date-inner th span { display:block; padding:2px; padding-right:7px; } .x-date-inner td { border: 1px solid; text-align:right; padding:0; } .x-date-inner a { padding:2px 5px; display:block; text-decoration:none; text-align:right; zoom:1; } .x-date-inner .x-date-active{ cursor:pointer; color:black; } .x-date-inner .x-date-selected a{ background: repeat-x left top; border:1px solid; padding:1px 4px; } .x-date-inner .x-date-today a{ border: 1px solid; padding:1px 4px; } .x-date-inner .x-date-prevday a,.x-date-inner .x-date-nextday a { text-decoration:none !important; } .x-date-bottom { padding:4px; border-top: 1px solid; background: repeat-x left top; } .x-date-inner a:hover, .x-date-inner .x-date-disabled a:hover{ text-decoration:none !important; } .x-item-disabled .x-date-inner a:hover{ background: none; } .x-date-inner .x-date-disabled a { cursor:default; } .x-date-menu .x-menu-item { padding:1px 24px 1px 4px; white-space: nowrap; } .x-date-menu .x-menu-item .x-menu-item-icon { width:10px; height:10px; margin-right:5px; background-position:center -4px !important; } .x-date-mp { position:absolute; left:0; top:0; display:none; } .x-date-mp td { padding:2px; font:normal 11px arial, helvetica,tahoma,sans-serif; } td.x-date-mp-month,td.x-date-mp-year,td.x-date-mp-ybtn { border: 0 none; text-align:center; vertical-align: middle; width:25%; } .x-date-mp-ok { margin-right:3px; } .x-date-mp-btns button { text-decoration:none; text-align:center; text-decoration:none !important; border:1px solid; padding:1px 3px 1px; cursor:pointer; } .x-date-mp-btns { background: repeat-x left top; } .x-date-mp-btns td { border-top: 1px solid; text-align:center; } td.x-date-mp-month a,td.x-date-mp-year a { display:block; padding:2px 4px; text-decoration:none; text-align:center; } td.x-date-mp-month a:hover,td.x-date-mp-year a:hover { text-decoration:none; cursor:pointer; } td.x-date-mp-sel a { padding:1px 3px; background: repeat-x left top; border:1px solid; } .x-date-mp-ybtn a { overflow:hidden; width:15px; height:15px; cursor:pointer; background:transparent no-repeat; display:block; margin:0 auto; } .x-date-mp-ybtn a.x-date-mp-next { background-position:0 -120px; } .x-date-mp-ybtn a.x-date-mp-next:hover { background-position:-15px -120px; } .x-date-mp-ybtn a.x-date-mp-prev { background-position:0 -105px; } .x-date-mp-ybtn a.x-date-mp-prev:hover { background-position:-15px -105px; } .x-date-mp-ybtn { text-align:center; } td.x-date-mp-sep { border-right:1px solid; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/structure/dd.css000066400000000000000000000017561226600447100235000ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-dd-drag-proxy{ position:absolute; left:0; top:0; visibility:hidden; z-index:15000; } .x-dd-drag-ghost{ -moz-opacity: 0.85; opacity:.85; filter: alpha(opacity=85); border: 1px solid; padding:3px; padding-left:20px; white-space:nowrap; } .x-dd-drag-repair .x-dd-drag-ghost{ -moz-opacity: 0.4; opacity:.4; filter: alpha(opacity=40); border:0 none; padding:0; background-color:transparent; } .x-dd-drag-repair .x-dd-drop-icon{ visibility:hidden; } .x-dd-drop-icon{ position:absolute; top:3px; left:3px; display:block; width:16px; height:16px; background-color:transparent; background-position: center; background-repeat: no-repeat; z-index:1; } .x-view-selector { position:absolute; left:0; top:0; width:0; border:1px dotted; opacity: .5; -moz-opacity: .5; filter:alpha(opacity=50); zoom:1; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/structure/debug.css000066400000000000000000000010521226600447100241640ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ #x-debug-browser .x-tree .x-tree-node a span { padding-top:2px; line-height:18px; } #x-debug-browser .x-tool-toggle { background-position:0 -75px; } #x-debug-browser .x-tool-toggle-over { background-position:-15px -75px; } #x-debug-browser.x-panel-collapsed .x-tool-toggle { background-position:0 -60px; } #x-debug-browser.x-panel-collapsed .x-tool-toggle-over { background-position:-15px -60px; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/structure/dialog.css000066400000000000000000000021121226600447100243330ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-window-dlg .x-window-body { border:0 none !important; padding:5px 10px; overflow:hidden !important; } .x-window-dlg .x-window-mc { border:0 none !important; } .x-window-dlg .ext-mb-input { margin-top:4px; width:95%; } .x-window-dlg .ext-mb-textarea { margin-top:4px; } .x-window-dlg .x-progress-wrap { margin-top:4px; } .ext-ie .x-window-dlg .x-progress-wrap { margin-top:6px; } .x-window-dlg .x-msg-box-wait { background:transparent no-repeat left; display:block; width:300px; padding-left:18px; line-height:18px; } .x-window-dlg .ext-mb-icon { float:left; width:47px; height:32px; } .x-window-dlg .x-dlg-icon .ext-mb-content{ zoom: 1; margin-left: 47px; } .x-window-dlg .ext-mb-info, .x-window-dlg .ext-mb-warning, .x-window-dlg .ext-mb-question, .x-window-dlg .ext-mb-error { background:transparent no-repeat top left; } .ext-gecko2 .ext-mb-fix-cursor { overflow:auto; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/structure/editor.css000066400000000000000000000055611226600447100243750ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-html-editor-wrap { border:1px solid; } .x-html-editor-tb .x-btn-text { background:transparent no-repeat; } .x-html-editor-tb .x-edit-bold, .x-menu-item img.x-edit-bold { background-position:0 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-italic, .x-menu-item img.x-edit-italic { background-position:-16px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-underline, .x-menu-item img.x-edit-underline { background-position:-32px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-forecolor, .x-menu-item img.x-edit-forecolor { background-position:-160px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-backcolor, .x-menu-item img.x-edit-backcolor { background-position:-176px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-justifyleft, .x-menu-item img.x-edit-justifyleft { background-position:-112px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-justifycenter, .x-menu-item img.x-edit-justifycenter { background-position:-128px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-justifyright, .x-menu-item img.x-edit-justifyright { background-position:-144px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-insertorderedlist, .x-menu-item img.x-edit-insertorderedlist { background-position:-80px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-insertunorderedlist, .x-menu-item img.x-edit-insertunorderedlist { background-position:-96px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-increasefontsize, .x-menu-item img.x-edit-increasefontsize { background-position:-48px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-decreasefontsize, .x-menu-item img.x-edit-decreasefontsize { background-position:-64px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-sourceedit, .x-menu-item img.x-edit-sourceedit { background-position:-192px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tb .x-edit-createlink, .x-menu-item img.x-edit-createlink { background-position:-208px 0; background-image:url(../images/default/editor/tb-sprite.gif); } .x-html-editor-tip .x-tip-bd .x-tip-bd-inner { padding:5px; padding-bottom:1px; } .x-html-editor-tb .x-toolbar { position:static !important; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/structure/form.css000066400000000000000000000260141226600447100240460ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /* all fields */ .x-form-field{ margin: 0 0 0 0; } .ext-webkit *:focus{ outline: none !important; } /* ---- text fields ---- */ .x-form-text, textarea.x-form-field{ padding:1px 3px; background:repeat-x 0 0; border:1px solid; } textarea.x-form-field { padding:2px 3px; } .x-form-text, .ext-ie .x-form-file { height:22px; line-height:18px; vertical-align:middle; } .ext-ie6 .x-form-text, .ext-ie7 .x-form-text { margin:-1px 0; /* ie bogus margin bug */ height:22px; /* ie quirks */ line-height:18px; } .x-quirks .ext-ie9 .x-form-text { height: 22px; padding-top: 3px; padding-bottom: 0px; } /* Ugly hacks for the bogus 1px margin bug in IE9 quirks */ .x-quirks .ext-ie9 .x-input-wrapper .x-form-text, .x-quirks .ext-ie9 .x-form-field-trigger-wrap .x-form-text { margin-top: -1px; margin-bottom: -1px; } .x-quirks .ext-ie9 .x-input-wrapper .x-form-element { margin-bottom: -1px; } .ext-ie6 .x-form-field-wrap .x-form-file-btn, .ext-ie7 .x-form-field-wrap .x-form-file-btn { top: -1px; /* because of all these margin hacks, these buttons are off by one pixel in IE6,7 */ } .ext-ie6 textarea.x-form-field, .ext-ie7 textarea.x-form-field { margin:-1px 0; /* ie bogus margin bug */ } .ext-strict .x-form-text { height:18px; } .ext-safari.ext-mac textarea.x-form-field { margin-bottom:-2px; /* another bogus margin bug, safari/mac only */ } /* .ext-strict .ext-ie8 .x-form-text, .ext-strict .ext-ie8 textarea.x-form-field { margin-bottom: 1px; } */ .ext-gecko .x-form-text , .ext-ie8 .x-form-text { padding-top:2px; /* FF won't center the text vertically */ padding-bottom:0; } .ext-ie6 .x-form-composite .x-form-text.x-box-item, .ext-ie7 .x-form-composite .x-form-text.x-box-item { margin: 0 !important; /* clear ie bogus margin bug fix */ } textarea { resize: none; /* Disable browser resizable textarea */ } /* select boxes */ .x-form-select-one { height:20px; line-height:18px; vertical-align:middle; border: 1px solid; } /* multi select boxes */ /* --- TODO --- */ /* 2.0.2 style */ .x-form-check-wrap { line-height:18px; height: auto; } .ext-ie .x-form-check-wrap input { width:15px; height:15px; } .x-form-check-wrap input{ vertical-align: bottom; } .x-editor .x-form-check-wrap { padding:3px; } .x-editor .x-form-checkbox { height:13px; } .x-form-check-group-label { border-bottom: 1px solid; margin-bottom: 5px; padding-left: 3px !important; float: none !important; } /* wrapped fields and triggers */ .x-form-field-wrap .x-form-trigger{ width:17px; height:21px; border:0; background:transparent no-repeat 0 0; cursor:pointer; border-bottom: 1px solid; position:absolute; top:0; } .x-form-field-wrap .x-form-date-trigger, .x-form-field-wrap .x-form-clear-trigger, .x-form-field-wrap .x-form-search-trigger{ cursor:pointer; } .x-form-field-wrap .x-form-twin-triggers .x-form-trigger{ position:static; top:auto; vertical-align:top; } .x-form-field-wrap { position:relative; left:0;top:0; text-align: left; zoom:1; white-space: nowrap; } .ext-strict .ext-ie8 .x-toolbar-cell .x-form-field-trigger-wrap .x-form-trigger { right: 0; /* IE8 Strict mode trigger bug */ } .x-form-field-wrap .x-form-trigger-over{ background-position:-17px 0; } .x-form-field-wrap .x-form-trigger-click{ background-position:-34px 0; } .x-trigger-wrap-focus .x-form-trigger{ background-position:-51px 0; } .x-trigger-wrap-focus .x-form-trigger-over{ background-position:-68px 0; } .x-trigger-wrap-focus .x-form-trigger-click{ background-position:-85px 0; } .x-trigger-wrap-focus .x-form-trigger{ border-bottom: 1px solid; } .x-item-disabled .x-form-trigger-over{ background-position:0 0 !important; border-bottom: 1px solid; } .x-item-disabled .x-form-trigger-click{ background-position:0 0 !important; border-bottom: 1px solid; } .x-trigger-noedit{ cursor:pointer; } /* field focus style */ .x-form-focus, textarea.x-form-focus{ border: 1px solid; } /* invalid fields */ .x-form-invalid, textarea.x-form-invalid{ background:repeat-x bottom; border: 1px solid; } .x-form-inner-invalid, textarea.x-form-inner-invalid{ background:repeat-x bottom; } /* editors */ .x-editor { visibility:hidden; padding:0; margin:0; } .x-form-grow-sizer { left: -10000px; padding: 8px 3px; position: absolute; visibility:hidden; top: -10000px; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word; zoom:1; } .x-form-grow-sizer p { margin:0 !important; border:0 none !important; padding:0 !important; } /* Form Items CSS */ .x-form-item { display:block; margin-bottom:4px; zoom:1; } .x-form-item label.x-form-item-label { display:block; float:left; width:100px; padding:3px; padding-left:0; clear:left; z-index:2; position:relative; } .x-form-element { padding-left:105px; position:relative; } .x-form-invalid-msg { padding:2px; padding-left:18px; background: transparent no-repeat 0 2px; line-height:16px; width:200px; } .x-form-label-left label.x-form-item-label { text-align:left; } .x-form-label-right label.x-form-item-label { text-align:right; } .x-form-label-top .x-form-item label.x-form-item-label { width:auto; float:none; clear:none; display:inline; margin-bottom:4px; position:static; } .x-form-label-top .x-form-element { padding-left:0; padding-top:4px; } .x-form-label-top .x-form-item { padding-bottom:4px; } /* Editor small font for grid, toolbar and tree */ .x-small-editor .x-form-text { height:20px; line-height:16px; vertical-align:middle; } .ext-ie6 .x-small-editor .x-form-text, .ext-ie7 .x-small-editor .x-form-text { margin-top:-1px !important; /* ie bogus margin bug */ margin-bottom:-1px !important; height:20px !important; /* ie quirks */ line-height:16px !important; } .ext-strict .x-small-editor .x-form-text { height:16px !important; } .ext-ie6 .x-small-editor .x-form-text, .ext-ie7 .x-small-editor .x-form-text { height:20px; line-height:16px; } .ext-border-box .x-small-editor .x-form-text { height:20px; } .x-small-editor .x-form-select-one { height:20px; line-height:16px; vertical-align:middle; } .x-small-editor .x-form-num-field { text-align:right; } .x-small-editor .x-form-field-wrap .x-form-trigger{ height:19px; } .ext-webkit .x-small-editor .x-form-text{padding-top:3px;font-size:100%;} .ext-strict .ext-webkit .x-small-editor .x-form-text{ height:14px !important; } .x-form-clear { clear:both; height:0; overflow:hidden; line-height:0; font-size:0; } .x-form-clear-left { clear:left; height:0; overflow:hidden; line-height:0; font-size:0; } .ext-ie6 .x-form-check-wrap input, .ext-border-box .x-form-check-wrap input{ margin-top: 3px; } .x-form-cb-label { position: relative; margin-left:4px; top: 2px; } .ext-ie .x-form-cb-label{ top: 1px; } .ext-ie6 .x-form-cb-label, .ext-border-box .x-form-cb-label{ top: 3px; } .x-form-display-field{ padding-top: 2px; } .ext-gecko .x-form-display-field, .ext-strict .ext-ie7 .x-form-display-field{ padding-top: 1px; } .ext-ie .x-form-display-field{ padding-top: 3px; } .ext-strict .ext-ie8 .x-form-display-field{ padding-top: 0; } .x-form-column { float:left; padding:0; margin:0; width:48%; overflow:hidden; zoom:1; } /* buttons */ .x-form .x-form-btns-ct .x-btn{ float:right; clear:none; } .x-form .x-form-btns-ct .x-form-btns td { border:0; padding:0; } .x-form .x-form-btns-ct .x-form-btns-right table{ float:right; clear:none; } .x-form .x-form-btns-ct .x-form-btns-left table{ float:left; clear:none; } .x-form .x-form-btns-ct .x-form-btns-center{ text-align:center; /*ie*/ } .x-form .x-form-btns-ct .x-form-btns-center table{ margin:0 auto; /*everyone else*/ } .x-form .x-form-btns-ct table td.x-form-btn-td{ padding:3px; } .x-form .x-form-btns-ct .x-btn-focus .x-btn-left{ background-position:0 -147px; } .x-form .x-form-btns-ct .x-btn-focus .x-btn-right{ background-position:0 -168px; } .x-form .x-form-btns-ct .x-btn-focus .x-btn-center{ background-position:0 -189px; } .x-form .x-form-btns-ct .x-btn-click .x-btn-center{ background-position:0 -126px; } .x-form .x-form-btns-ct .x-btn-click .x-btn-right{ background-position:0 -84px; } .x-form .x-form-btns-ct .x-btn-click .x-btn-left{ background-position:0 -63px; } .x-form-invalid-icon { width:16px; height:18px; visibility:hidden; position:absolute; left:0; top:0; display:block; background:transparent no-repeat 0 2px; } /* fieldsets */ .x-fieldset { border:1px solid; padding:10px; margin-bottom:10px; display:block; /* preserve margins in IE */ } /* make top of checkbox/tools visible in webkit */ .ext-webkit .x-fieldset-header { padding-top: 1px; } .ext-ie .x-fieldset legend { margin-bottom:10px; } .ext-strict .ext-ie9 .x-fieldset legend.x-fieldset-header { padding-top: 1px; } .ext-ie .x-fieldset { padding-top: 0; padding-bottom:10px; } .x-fieldset legend .x-tool-toggle { margin-right:3px; margin-left:0; float:left !important; } .x-fieldset legend input { margin-right:3px; float:left !important; height:13px; width:13px; } fieldset.x-panel-collapsed { padding-bottom:0 !important; border-width: 1px 1px 0 1px !important; border-left-color: transparent; border-right-color: transparent; } .ext-ie6 fieldset.x-panel-collapsed{ padding-bottom:0 !important; border-width: 1px 0 0 0 !important; margin-left: 1px; margin-right: 1px; } fieldset.x-panel-collapsed .x-fieldset-bwrap { visibility:hidden; position:absolute; left:-1000px; top:-1000px; } .ext-ie .x-fieldset-bwrap { zoom:1; } .x-fieldset-noborder { border:0px none transparent; } .x-fieldset-noborder legend { margin-left:-3px; } /* IE legend positioning bug */ .ext-ie .x-fieldset-noborder legend { position: relative; margin-bottom:23px; } .ext-ie .x-fieldset-noborder legend span { position: absolute; left:16px; } .ext-gecko .x-window-body .x-form-item { -moz-outline: none; outline: none; overflow: auto; } .ext-mac.ext-gecko .x-window-body .x-form-item { overflow:hidden; } .ext-gecko .x-form-item { -moz-outline: none; outline: none; } .x-hide-label label.x-form-item-label { display:none; } .x-hide-label .x-form-element { padding-left: 0 !important; } .x-form-label-top .x-hide-label label.x-form-item-label{ display: none; } .x-fieldset { overflow:hidden; } .x-fieldset-bwrap { overflow:hidden; zoom:1; } .x-fieldset-body { overflow:hidden; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/structure/grid.css000066400000000000000000000256321226600447100240350ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /* Grid3 styles */ .x-grid3 { position:relative; overflow:hidden; } .x-grid-panel .x-panel-body { overflow:hidden !important; } .x-grid-panel .x-panel-mc .x-panel-body { border:1px solid; } .x-grid3 table { table-layout:fixed; } .x-grid3-viewport{ overflow:hidden; } .x-grid3-hd-row td, .x-grid3-row td, .x-grid3-summary-row td{ -moz-outline: none; outline: none; -moz-user-focus: normal; } .x-grid3-row td, .x-grid3-summary-row td { line-height:13px; vertical-align: top; padding-left:1px; padding-right:1px; -moz-user-select: none; -khtml-user-select:none; -webkit-user-select:ignore; } .x-grid3-cell{ -moz-user-select: none; -khtml-user-select:none; -webkit-user-select:ignore; } .x-grid3-hd-row td { line-height:15px; vertical-align:middle; border-left:1px solid; border-right:1px solid; } .x-grid3-hd-row .x-grid3-marker-hd { padding:3px; } .x-grid3-row .x-grid3-marker { padding:3px; } .x-grid3-cell-inner, .x-grid3-hd-inner{ overflow:hidden; -o-text-overflow: ellipsis; text-overflow: ellipsis; padding:3px 3px 3px 5px; white-space: nowrap; } /* ActionColumn, reduce padding to accommodate 16x16 icons in normal row height */ .x-action-col-cell .x-grid3-cell-inner { padding-top: 1px; padding-bottom: 1px; } .x-action-col-icon { cursor: pointer; } .x-grid3-hd-inner { position:relative; cursor:inherit; padding:4px 3px 4px 5px; } .x-grid3-row-body { white-space:normal; } .x-grid3-body-cell { -moz-outline:0 none; outline:0 none; } /* IE Quirks to clip */ .ext-ie .x-grid3-cell-inner, .ext-ie .x-grid3-hd-inner{ width:100%; } /* reverse above in strict mode */ .ext-strict .x-grid3-cell-inner, .ext-strict .x-grid3-hd-inner{ width:auto; } .x-grid-row-loading { background: no-repeat center center; } .x-grid-page { overflow:hidden; } .x-grid3-row { cursor: default; border: 1px solid; width:100%; } .x-grid3-row-over { border:1px solid; background: repeat-x left top; } .x-grid3-resize-proxy { width:1px; left:0; cursor: e-resize; cursor: col-resize; position:absolute; top:0; height:100px; overflow:hidden; visibility:hidden; border:0 none; z-index:7; } .x-grid3-resize-marker { width:1px; left:0; position:absolute; top:0; height:100px; overflow:hidden; visibility:hidden; border:0 none; z-index:7; } .x-grid3-focus { position:absolute; left:0; top:0; width:1px; height:1px; line-height:1px; font-size:1px; -moz-outline:0 none; outline:0 none; -moz-user-select: text; -khtml-user-select: text; -webkit-user-select:ignore; } /* header styles */ .x-grid3-header{ background: repeat-x 0 bottom; cursor:default; zoom:1; padding:1px 0 0 0; } .x-grid3-header-pop { border-left:1px solid; float:right; clear:none; } .x-grid3-header-pop-inner { border-left:1px solid; width:14px; height:19px; background: transparent no-repeat center center; } .ext-ie .x-grid3-header-pop-inner { width:15px; } .ext-strict .x-grid3-header-pop-inner { width:14px; } .x-grid3-header-inner { overflow:hidden; zoom:1; float:left; } .x-grid3-header-offset { padding-left:1px; text-align: left; } td.x-grid3-hd-over, td.sort-desc, td.sort-asc, td.x-grid3-hd-menu-open { border-left:1px solid; border-right:1px solid; } td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-asc .x-grid3-hd-inner, td.x-grid3-hd-menu-open .x-grid3-hd-inner { background: repeat-x left bottom; } .x-grid3-sort-icon{ background-repeat: no-repeat; display: none; height: 4px; width: 13px; margin-left:3px; vertical-align: middle; } .sort-asc .x-grid3-sort-icon, .sort-desc .x-grid3-sort-icon { display: inline; } /* Header position fixes for IE strict mode */ .ext-strict .ext-ie .x-grid3-header-inner, .ext-strict .ext-ie6 .x-grid3-hd { position:relative; } .ext-strict .ext-ie6 .x-grid3-hd-inner{ position:static; } /* Body Styles */ .x-grid3-body { zoom:1; } .x-grid3-scroller { overflow:auto; zoom:1; position:relative; } .x-grid3-cell-text, .x-grid3-hd-text { display: block; padding: 3px 5px 3px 5px; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select:ignore; } .x-grid3-split { background-position: center; background-repeat: no-repeat; cursor: e-resize; cursor: col-resize; display: block; font-size: 1px; height: 16px; overflow: hidden; position: absolute; top: 2px; width: 6px; z-index: 3; } /* Column Reorder DD */ .x-dd-drag-proxy .x-grid3-hd-inner{ background: repeat-x left bottom; width:120px; padding:3px; border:1px solid; overflow:hidden; } .col-move-top, .col-move-bottom{ width:9px; height:9px; position:absolute; top:0; line-height:1px; font-size:1px; overflow:hidden; visibility:hidden; z-index:20000; background:transparent no-repeat left top; } /* Selection Styles */ .x-grid3-row-selected { border:1px dotted; } .x-grid3-locked td.x-grid3-row-marker, .x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker{ background: repeat-x 0 bottom !important; vertical-align:middle !important; padding:0; border-top:1px solid; border-bottom:none !important; border-right:1px solid !important; text-align:center; } .x-grid3-locked td.x-grid3-row-marker div, .x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker div{ padding:0 4px; text-align:center; } /* dirty cells */ .x-grid3-dirty-cell { background: transparent no-repeat 0 0; } /* Grid Toolbars */ .x-grid3-topbar, .x-grid3-bottombar{ overflow:hidden; display:none; zoom:1; position:relative; } .x-grid3-topbar .x-toolbar{ border-right:0 none; } .x-grid3-bottombar .x-toolbar{ border-right:0 none; border-bottom:0 none; border-top:1px solid; } /* Props Grid Styles */ .x-props-grid .x-grid3-cell{ padding:1px; } .x-props-grid .x-grid3-td-name .x-grid3-cell-inner{ background:transparent repeat-y -16px !important; padding-left:12px; } .x-props-grid .x-grid3-body .x-grid3-td-name{ padding:1px; padding-right:0; border:0 none; border-right:1px solid; } /* dd */ .x-grid3-col-dd { border:0 none; padding:0; background-color:transparent; } .x-dd-drag-ghost .x-grid3-dd-wrap { padding:1px 3px 3px 1px; } .x-grid3-hd { -moz-user-select:none; -khtml-user-select:none; -webkit-user-select:ignore; } .x-grid3-hd-btn { display:none; position:absolute; width:14px; background:no-repeat left center; right:0; top:0; z-index:2; cursor:pointer; } .x-grid3-hd-over .x-grid3-hd-btn, .x-grid3-hd-menu-open .x-grid3-hd-btn { display:block; } a.x-grid3-hd-btn:hover { background-position:-14px center; } /* Expanders */ .x-grid3-body .x-grid3-td-expander { background:transparent repeat-y right; } .x-grid3-body .x-grid3-td-expander .x-grid3-cell-inner { padding:0 !important; height:100%; } .x-grid3-row-expander { width:100%; height:18px; background-position:4px 2px; background-repeat:no-repeat; background-color:transparent; } .x-grid3-row-collapsed .x-grid3-row-expander { background-position:4px 2px; } .x-grid3-row-expanded .x-grid3-row-expander { background-position:-21px 2px; } .x-grid3-row-collapsed .x-grid3-row-body { display:none !important; } .x-grid3-row-expanded .x-grid3-row-body { display:block !important; } /* Checkers */ .x-grid3-body .x-grid3-td-checker { background:transparent repeat-y right; } .x-grid3-body .x-grid3-td-checker .x-grid3-cell-inner, .x-grid3-header .x-grid3-td-checker .x-grid3-hd-inner { padding:0 !important; height:100%; } .x-grid3-row-checker, .x-grid3-hd-checker { width:100%; height:18px; background-position:2px 2px; background-repeat:no-repeat; background-color:transparent; } .x-grid3-row .x-grid3-row-checker { background-position:2px 2px; } .x-grid3-row-selected .x-grid3-row-checker, .x-grid3-hd-checker-on .x-grid3-hd-checker,.x-grid3-row-checked .x-grid3-row-checker { background-position:-23px 2px; } .x-grid3-hd-checker { background-position:2px 1px; } .ext-border-box .x-grid3-hd-checker { background-position:2px 3px; } .x-grid3-hd-checker-on .x-grid3-hd-checker { background-position:-23px 1px; } .ext-border-box .x-grid3-hd-checker-on .x-grid3-hd-checker { background-position:-23px 3px; } /* Numberer */ .x-grid3-body .x-grid3-td-numberer { background:transparent repeat-y right; } .x-grid3-body .x-grid3-td-numberer .x-grid3-cell-inner { padding:3px 5px 0 0 !important; text-align:right; } /* Row Icon */ .x-grid3-body .x-grid3-td-row-icon { background:transparent repeat-y right; vertical-align:top; text-align:center; } .x-grid3-body .x-grid3-td-row-icon .x-grid3-cell-inner { padding:0 !important; background-position:center center; background-repeat:no-repeat; width:16px; height:16px; margin-left:2px; margin-top:3px; } /* All specials */ .x-grid3-body .x-grid3-row-selected .x-grid3-td-numberer, .x-grid3-body .x-grid3-row-selected .x-grid3-td-checker, .x-grid3-body .x-grid3-row-selected .x-grid3-td-expander { background:transparent repeat-y right; } .x-grid3-body .x-grid3-check-col-td .x-grid3-cell-inner { padding: 1px 0 0 0 !important; } .x-grid3-check-col { width:100%; height:16px; background-position:center center; background-repeat:no-repeat; background-color:transparent; } .x-grid3-check-col-on { width:100%; height:16px; background-position:center center; background-repeat:no-repeat; background-color:transparent; } /* Grouping classes */ .x-grid-group, .x-grid-group-body, .x-grid-group-hd { zoom:1; } .x-grid-group-hd { border-bottom: 2px solid; cursor:pointer; padding-top:6px; } .x-grid-group-hd div.x-grid-group-title { background:transparent no-repeat 3px 3px; padding:4px 4px 4px 17px; } .x-grid-group-collapsed .x-grid-group-body { display:none; } .ext-ie6 .x-grid3 .x-editor .x-form-text, .ext-ie7 .x-grid3 .x-editor .x-form-text { position:relative; top:-1px; } .ext-ie .x-props-grid .x-editor .x-form-text { position:static; top:0; } .x-grid-empty { padding:10px; } /* fix floating toolbar issue */ .ext-ie7 .x-grid-panel .x-panel-bbar { position:relative; } /* Reset position to static when Grid Panel has been framed */ /* to resolve 'snapping' from top to bottom behavior. */ /* @forumThread 86656 */ .ext-ie7 .x-grid-panel .x-panel-mc .x-panel-bbar { position: static; } .ext-ie6 .x-grid3-header { position: relative; } /* Fix WebKit bug in Grids */ .ext-webkit .x-grid-panel .x-panel-bwrap{ -webkit-user-select:none; } .ext-webkit .x-tbar-page-number{ -webkit-user-select:ignore; } /* end*/ /* column lines */ .x-grid-with-col-lines .x-grid3-row td.x-grid3-cell { padding-right:0; border-right:1px solid; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/structure/layout.css000066400000000000000000000113241226600447100244160ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-border-layout-ct { position: relative; } .x-border-panel { position:absolute; left:0; top:0; } .x-tool-collapse-south { background-position:0 -195px; } .x-tool-collapse-south-over { background-position:-15px -195px; } .x-tool-collapse-north { background-position:0 -210px; } .x-tool-collapse-north-over { background-position:-15px -210px; } .x-tool-collapse-west { background-position:0 -180px; } .x-tool-collapse-west-over { background-position:-15px -180px; } .x-tool-collapse-east { background-position:0 -165px; } .x-tool-collapse-east-over { background-position:-15px -165px; } .x-tool-expand-south { background-position:0 -210px; } .x-tool-expand-south-over { background-position:-15px -210px; } .x-tool-expand-north { background-position:0 -195px; } .x-tool-expand-north-over { background-position:-15px -195px; } .x-tool-expand-west { background-position:0 -165px; } .x-tool-expand-west-over { background-position:-15px -165px; } .x-tool-expand-east { background-position:0 -180px; } .x-tool-expand-east-over { background-position:-15px -180px; } .x-tool-expand-north, .x-tool-expand-south { float:right; margin:3px; } .x-tool-expand-east, .x-tool-expand-west { float:none; margin:3px 2px; } .x-accordion-hd .x-tool-toggle { background-position:0 -255px; } .x-accordion-hd .x-tool-toggle-over { background-position:-15px -255px; } .x-panel-collapsed .x-accordion-hd .x-tool-toggle { background-position:0 -240px; } .x-panel-collapsed .x-accordion-hd .x-tool-toggle-over { background-position:-15px -240px; } .x-accordion-hd { padding-top:4px; padding-bottom:3px; border-top:0 none; background: transparent repeat-x 0 -9px; } .x-layout-collapsed{ position:absolute; left:-10000px; top:-10000px; visibility:hidden; width:20px; height:20px; overflow:hidden; border:1px solid; z-index:20; } .ext-border-box .x-layout-collapsed{ width:22px; height:22px; } .x-layout-collapsed-over{ cursor:pointer; } .x-layout-collapsed-west .x-layout-collapsed-tools, .x-layout-collapsed-east .x-layout-collapsed-tools{ position:absolute; top:0; left:0; width:20px; height:20px; } .x-layout-split{ position:absolute; height:5px; width:5px; line-height:1px; font-size:1px; z-index:3; background-color:transparent; } /* IE6 strict won't drag w/out a color */ .ext-strict .ext-ie6 .x-layout-split{ background-color: #fff !important; filter: alpha(opacity=1); } .x-layout-split-h{ background-image:url(../images/default/s.gif); background-position: left; } .x-layout-split-v{ background-image:url(../images/default/s.gif); background-position: top; } .x-column-layout-ct { overflow:hidden; zoom:1; } .x-column { float:left; padding:0; margin:0; overflow:hidden; zoom:1; } .x-column-inner { overflow:hidden; zoom:1; } /* mini mode */ .x-layout-mini { position:absolute; top:0; left:0; display:block; width:5px; height:35px; cursor:pointer; opacity:.5; -moz-opacity:.5; filter:alpha(opacity=50); } .x-layout-mini-over, .x-layout-collapsed-over .x-layout-mini{ opacity:1; -moz-opacity:1; filter:none; } .x-layout-split-west .x-layout-mini { top:48%; } .x-layout-split-east .x-layout-mini { top:48%; } .x-layout-split-north .x-layout-mini { left:48%; height:5px; width:35px; } .x-layout-split-south .x-layout-mini { left:48%; height:5px; width:35px; } .x-layout-cmini-west .x-layout-mini { top:48%; } .x-layout-cmini-east .x-layout-mini { top:48%; } .x-layout-cmini-north .x-layout-mini { left:48%; height:5px; width:35px; } .x-layout-cmini-south .x-layout-mini { left:48%; height:5px; width:35px; } .x-layout-cmini-west, .x-layout-cmini-east { border:0 none; width:5px !important; padding:0; background-color:transparent; } .x-layout-cmini-north, .x-layout-cmini-south { border:0 none; height:5px !important; padding:0; background-color:transparent; } .x-viewport, .x-viewport body { margin: 0; padding: 0; border: 0 none; overflow: hidden; height: 100%; } .x-abs-layout-item { position:absolute; left:0; top:0; } .ext-ie input.x-abs-layout-item, .ext-ie textarea.x-abs-layout-item { margin:0; } .x-box-layout-ct { overflow:hidden; zoom:1; } .x-box-inner { overflow:hidden; zoom:1; position:relative; left:0; top:0; } .x-box-item { position:absolute; left:0; top:0; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/structure/list-view.css000066400000000000000000000030001226600447100250140ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-list-header{ background: repeat-x 0 bottom; cursor:default; zoom:1; height:22px; } .x-list-header-inner div { display:block; float:left; overflow:hidden; -o-text-overflow: ellipsis; text-overflow: ellipsis; white-space: nowrap; } .x-list-header-inner div em { display:block; border-left:1px solid; padding:4px 4px; overflow:hidden; -moz-user-select: none; -khtml-user-select: none; line-height:14px; } .x-list-body { overflow:auto; overflow-x:hidden; overflow-y:auto; zoom:1; float: left; width: 100%; } .x-list-body dl { zoom:1; } .x-list-body dt { display:block; float:left; overflow:hidden; -o-text-overflow: ellipsis; text-overflow: ellipsis; white-space: nowrap; cursor:pointer; zoom:1; } .x-list-body dt em { display:block; padding:3px 4px; overflow:hidden; -moz-user-select: none; -khtml-user-select: none; } .x-list-resizer { border-left:1px solid; border-right:1px solid; position:absolute; left:0; top:0; } .x-list-header-inner em.sort-asc { background: transparent no-repeat center 0; border-style:solid; border-width: 0 1px 1px; padding-bottom:3px; } .x-list-header-inner em.sort-desc { background: transparent no-repeat center -23px; border-style:solid; border-width: 0 1px 1px; padding-bottom:3px; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/structure/menu.css000066400000000000000000000075531226600447100240560ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-menu { z-index: 15000; zoom: 1; background: repeat-y; } .x-menu-floating{ border: 1px solid; } .x-menu a { text-decoration: none !important; } .ext-ie .x-menu { zoom:1; overflow:hidden; } .x-menu-list{ padding: 2px; background-color:transparent; border:0 none; overflow:hidden; overflow-y: hidden; } .ext-strict .ext-ie .x-menu-list{ position: relative; } .x-menu li{ line-height:100%; } .x-menu li.x-menu-sep-li{ font-size:1px; line-height:1px; } .x-menu-list-item{ white-space: nowrap; display:block; padding:1px; } .x-menu-item{ -moz-user-select: none; -khtml-user-select:none; -webkit-user-select:ignore; } .x-menu-item-arrow{ background:transparent no-repeat right; } .x-menu-sep { display:block; font-size:1px; line-height:1px; margin: 2px 3px; border-bottom:1px solid; overflow:hidden; } .x-menu-focus { position:absolute; left:-1px; top:-1px; width:1px; height:1px; line-height:1px; font-size:1px; -moz-outline:0 none; outline:0 none; -moz-user-select: none; -khtml-user-select:none; -webkit-user-select:ignore; overflow:hidden; display:block; } a.x-menu-item { cursor: pointer; display: block; line-height: 16px; outline-color: -moz-use-text-color; outline-style: none; outline-width: 0; padding: 3px 21px 3px 27px; position: relative; text-decoration: none; white-space: nowrap; } .x-menu-item-active { background-repeat: repeat-x; background-position: left bottom; border-style:solid; border-width: 1px 0; margin:0 1px; padding: 0; } .x-menu-item-active a.x-menu-item { border-style:solid; border-width:0 1px; margin:0 -1px; } .x-menu-item-icon { border: 0 none; height: 16px; padding: 0; vertical-align: top; width: 16px; position: absolute; left: 3px; top: 3px; margin: 0; background-position:center; } .ext-ie .x-menu-item-icon { left: -24px; } .ext-strict .x-menu-item-icon { left: 3px; } .ext-ie6 .x-menu-item-icon { left: -24px; } .ext-ie .x-menu-item-icon { vertical-align: middle; } .x-menu-check-item .x-menu-item-icon{ background: transparent no-repeat center; } .x-menu-group-item .x-menu-item-icon{ background-color: transparent; } .x-menu-item-checked .x-menu-group-item .x-menu-item-icon{ background: transparent no-repeat center; } .x-date-menu .x-menu-list{ padding: 0; } .x-menu-date-item{ padding:0; } .x-menu .x-color-palette, .x-menu .x-date-picker{ margin-left: 26px; margin-right:4px; } .x-menu .x-date-picker{ border:1px solid; margin-top:2px; margin-bottom:2px; } .x-menu-plain .x-color-palette, .x-menu-plain .x-date-picker{ margin: 0; border: 0 none; } .x-date-menu { padding:0 !important; } /* * fixes separator visibility problem in IE 6 */ .ext-strict .ext-ie6 .x-menu-sep-li { padding: 3px 4px; } .ext-strict .ext-ie6 .x-menu-sep { margin: 0; height: 1px; } /* * Fixes an issue with "fat" separators in webkit */ .ext-webkit .x-menu-sep{ height: 1px; } /* * Ugly mess to remove the white border under the picker */ .ext-ie .x-date-menu{ height: 199px; } .ext-strict .ext-ie .x-date-menu, .ext-border-box .ext-ie8 .x-date-menu{ height: 197px; } .ext-strict .ext-ie7 .x-date-menu{ height: 195px; } .ext-strict .ext-ie8 .x-date-menu{ height: auto; } .x-cycle-menu .x-menu-item-checked { border:1px dotted !important; padding:0; } .x-menu .x-menu-scroller { width: 100%; background-repeat:no-repeat; background-position:center; height:8px; line-height: 8px; cursor:pointer; margin: 0; padding: 0; } .x-menu .x-menu-scroller-active{ height: 6px; line-height: 6px; } .x-menu-list-item-indent{ padding-left: 27px; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/structure/panel-reset.css000066400000000000000000000142041226600447100253200ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /** * W3C Suggested Default style sheet for HTML 4 * http://www.w3.org/TR/CSS21/sample.html * * Resets for Ext.Panel @cfg normal: true */ .x-panel-reset .x-panel-body html, .x-panel-reset .x-panel-body address, .x-panel-reset .x-panel-body blockquote, .x-panel-reset .x-panel-body body, .x-panel-reset .x-panel-body dd, .x-panel-reset .x-panel-body div, .x-panel-reset .x-panel-body dl, .x-panel-reset .x-panel-body dt, .x-panel-reset .x-panel-body fieldset, .x-panel-reset .x-panel-body form, .x-panel-reset .x-panel-body frame, frameset, .x-panel-reset .x-panel-body h1, .x-panel-reset .x-panel-body h2, .x-panel-reset .x-panel-body h3, .x-panel-reset .x-panel-body h4, .x-panel-reset .x-panel-body h5, .x-panel-reset .x-panel-body h6, .x-panel-reset .x-panel-body noframes, .x-panel-reset .x-panel-body ol, .x-panel-reset .x-panel-body p, .x-panel-reset .x-panel-body ul, .x-panel-reset .x-panel-body center, .x-panel-reset .x-panel-body dir, .x-panel-reset .x-panel-body hr, .x-panel-reset .x-panel-body menu, .x-panel-reset .x-panel-body pre { display: block } .x-panel-reset .x-panel-body li { display: list-item } .x-panel-reset .x-panel-body head { display: none } .x-panel-reset .x-panel-body table { display: table } .x-panel-reset .x-panel-body tr { display: table-row } .x-panel-reset .x-panel-body thead { display: table-header-group } .x-panel-reset .x-panel-body tbody { display: table-row-group } .x-panel-reset .x-panel-body tfoot { display: table-footer-group } .x-panel-reset .x-panel-body col { display: table-column } .x-panel-reset .x-panel-body colgroup { display: table-column-group } .x-panel-reset .x-panel-body td, .x-panel-reset .x-panel-body th { display: table-cell } .x-panel-reset .x-panel-body caption { display: table-caption } .x-panel-reset .x-panel-body th { font-weight: bolder; text-align: center } .x-panel-reset .x-panel-body caption { text-align: center } .x-panel-reset .x-panel-body body { margin: 8px } .x-panel-reset .x-panel-body h1 { font-size: 2em; margin: .67em 0 } .x-panel-reset .x-panel-body h2 { font-size: 1.5em; margin: .75em 0 } .x-panel-reset .x-panel-body h3 { font-size: 1.17em; margin: .83em 0 } .x-panel-reset .x-panel-body h4, .x-panel-reset .x-panel-body p, .x-panel-reset .x-panel-body blockquote, .x-panel-reset .x-panel-body ul, .x-panel-reset .x-panel-body fieldset, .x-panel-reset .x-panel-body form, .x-panel-reset .x-panel-body ol, .x-panel-reset .x-panel-body dl, .x-panel-reset .x-panel-body dir, .x-panel-reset .x-panel-body menu { margin: 1.12em 0 } .x-panel-reset .x-panel-body h5 { font-size: .83em; margin: 1.5em 0 } .x-panel-reset .x-panel-body h6 { font-size: .75em; margin: 1.67em 0 } .x-panel-reset .x-panel-body h1, .x-panel-reset .x-panel-body h2, .x-panel-reset .x-panel-body h3, .x-panel-reset .x-panel-body h4, .x-panel-reset .x-panel-body h5, .x-panel-reset .x-panel-body h6, .x-panel-reset .x-panel-body b, .x-panel-reset .x-panel-body strong { font-weight: bolder } .x-panel-reset .x-panel-body blockquote { margin-left: 40px; margin-right: 40px } .x-panel-reset .x-panel-body i, .x-panel-reset .x-panel-body cite, .x-panel-reset .x-panel-body em, .x-panel-reset .x-panel-body var, .x-panel-reset .x-panel-body address { font-style: italic } .x-panel-reset .x-panel-body pre, .x-panel-reset .x-panel-body tt, .x-panel-reset .x-panel-body code, .x-panel-reset .x-panel-body kbd, .x-panel-reset .x-panel-body samp { font-family: monospace } .x-panel-reset .x-panel-body pre { white-space: pre } .x-panel-reset .x-panel-body button, .x-panel-reset .x-panel-body textarea, .x-panel-reset .x-panel-body input, .x-panel-reset .x-panel-body select { display: inline-block } .x-panel-reset .x-panel-body big { font-size: 1.17em } .x-panel-reset .x-panel-body small, .x-panel-reset .x-panel-body sub, .x-panel-reset .x-panel-body sup { font-size: .83em } .x-panel-reset .x-panel-body sub { vertical-align: sub } .x-panel-reset .x-panel-body sup { vertical-align: super } .x-panel-reset .x-panel-body table { border-spacing: 2px; } .x-panel-reset .x-panel-body thead, .x-panel-reset .x-panel-body tbody, .x-panel-reset .x-panel-body tfoot { vertical-align: middle } .x-panel-reset .x-panel-body td, .x-panel-reset .x-panel-body th { vertical-align: inherit } .x-panel-reset .x-panel-body s, .x-panel-reset .x-panel-body strike, .x-panel-reset .x-panel-body del { text-decoration: line-through } .x-panel-reset .x-panel-body hr { border: 1px inset } .x-panel-reset .x-panel-body ol, .x-panel-reset .x-panel-body ul, .x-panel-reset .x-panel-body dir, .x-panel-reset .x-panel-body menu, .x-panel-reset .x-panel-body dd { margin-left: 40px } .x-panel-reset .x-panel-body ul, .x-panel-reset .x-panel-body menu, .x-panel-reset .x-panel-body dir { list-style-type: disc;} .x-panel-reset .x-panel-body ol { list-style-type: decimal } .x-panel-reset .x-panel-body ol ul, .x-panel-reset .x-panel-body ul ol, .x-panel-reset .x-panel-body ul ul, .x-panel-reset .x-panel-body ol ol { margin-top: 0; margin-bottom: 0 } .x-panel-reset .x-panel-body u, .x-panel-reset .x-panel-body ins { text-decoration: underline } .x-panel-reset .x-panel-body br:before { content: "\A" } .x-panel-reset .x-panel-body :before, .x-panel-reset .x-panel-body :after { white-space: pre-line } .x-panel-reset .x-panel-body center { text-align: center } .x-panel-reset .x-panel-body :link, .x-panel-reset .x-panel-body :visited { text-decoration: underline } .x-panel-reset .x-panel-body :focus { outline: invert dotted thin } /* Begin bidirectionality settings (do not change) */ .x-panel-reset .x-panel-body BDO[DIR="ltr"] { direction: ltr; unicode-bidi: bidi-override } .x-panel-reset .x-panel-body BDO[DIR="rtl"] { direction: rtl; unicode-bidi: bidi-override } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/structure/panel.css000066400000000000000000000170631226600447100242060ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-panel { border-style: solid; border-width:0; } .x-panel-header { overflow:hidden; zoom:1; padding:5px 3px 4px 5px; border:1px solid; line-height: 15px; background: transparent repeat-x 0 -1px; } .x-panel-body { border:1px solid; border-top:0 none; overflow:hidden; position: relative; /* added for item scroll positioning */ } .x-panel-bbar .x-toolbar, .x-panel-tbar .x-toolbar { border:1px solid; border-top:0 none; overflow:hidden; padding:2px; } .x-panel-tbar-noheader .x-toolbar, .x-panel-mc .x-panel-tbar .x-toolbar { border-top:1px solid; border-bottom: 0 none; } .x-panel-body-noheader, .x-panel-mc .x-panel-body { border-top:1px solid; } .x-panel-header { overflow:hidden; zoom:1; } .x-panel-tl .x-panel-header { padding:5px 0 4px 0; border:0 none; background:transparent no-repeat; } .x-panel-tl .x-panel-icon, .x-window-tl .x-panel-icon { padding-left:20px !important; background-repeat:no-repeat; background-position:0 4px; zoom:1; } .x-panel-inline-icon { width:16px; height:16px; background-repeat:no-repeat; background-position:0 0; vertical-align:middle; margin-right:4px; margin-top:-1px; margin-bottom:-1px; } .x-panel-tc { background: transparent repeat-x 0 0; overflow:hidden; } /* fix ie7 strict mode bug */ .ext-strict .ext-ie7 .x-panel-tc { overflow: visible; } .x-panel-tl { background: transparent no-repeat 0 0; padding-left:6px; zoom:1; border-bottom:1px solid; } .x-panel-tr { background: transparent no-repeat right 0; zoom:1; padding-right:6px; } .x-panel-bc { background: transparent repeat-x 0 bottom; zoom:1; } .x-panel-bc .x-panel-footer { zoom:1; } .x-panel-bl { background: transparent no-repeat 0 bottom; padding-left:6px; zoom:1; } .x-panel-br { background: transparent no-repeat right bottom; padding-right:6px; zoom:1; } .x-panel-mc { border:0 none; padding:0; margin:0; padding-top:6px; } .x-panel-mc .x-panel-body { background-color:transparent; border: 0 none; } .x-panel-ml { background: repeat-y 0 0; padding-left:6px; zoom:1; } .x-panel-mr { background: transparent repeat-y right 0; padding-right:6px; zoom:1; } .x-panel-bc .x-panel-footer { padding-bottom:6px; } .x-panel-nofooter .x-panel-bc, .x-panel-nofooter .x-window-bc { height:6px; font-size:0; line-height:0; } .x-panel-bwrap { overflow:hidden; zoom:1; left:0; top:0; } .x-panel-body { overflow:hidden; zoom:1; } .x-panel-collapsed .x-resizable-handle{ display:none; } .ext-gecko .x-panel-animated div { overflow:hidden !important; } /* Plain */ .x-plain-body { overflow:hidden; } .x-plain-bbar .x-toolbar { overflow:hidden; padding:2px; } .x-plain-tbar .x-toolbar { overflow:hidden; padding:2px; } .x-plain-bwrap { overflow:hidden; zoom:1; } .x-plain { overflow:hidden; } /* Tools */ .x-tool { overflow:hidden; width:15px; height:15px; float:right; cursor:pointer; background:transparent no-repeat; margin-left:2px; } /* expand / collapse tools */ .x-tool-toggle { background-position:0 -60px; } .x-tool-toggle-over { background-position:-15px -60px; } .x-panel-collapsed .x-tool-toggle { background-position:0 -75px; } .x-panel-collapsed .x-tool-toggle-over { background-position:-15px -75px; } .x-tool-close { background-position:0 -0; } .x-tool-close-over { background-position:-15px 0; } .x-tool-minimize { background-position:0 -15px; } .x-tool-minimize-over { background-position:-15px -15px; } .x-tool-maximize { background-position:0 -30px; } .x-tool-maximize-over { background-position:-15px -30px; } .x-tool-restore { background-position:0 -45px; } .x-tool-restore-over { background-position:-15px -45px; } .x-tool-gear { background-position:0 -90px; } .x-tool-gear-over { background-position:-15px -90px; } .x-tool-prev { background-position:0 -105px; } .x-tool-prev-over { background-position:-15px -105px; } .x-tool-next { background-position:0 -120px; } .x-tool-next-over { background-position:-15px -120px; } .x-tool-pin { background-position:0 -135px; } .x-tool-pin-over { background-position:-15px -135px; } .x-tool-unpin { background-position:0 -150px; } .x-tool-unpin-over { background-position:-15px -150px; } .x-tool-right { background-position:0 -165px; } .x-tool-right-over { background-position:-15px -165px; } .x-tool-left { background-position:0 -180px; } .x-tool-left-over { background-position:-15px -180px; } .x-tool-down { background-position:0 -195px; } .x-tool-down-over { background-position:-15px -195px; } .x-tool-up { background-position:0 -210px; } .x-tool-up-over { background-position:-15px -210px; } .x-tool-refresh { background-position:0 -225px; } .x-tool-refresh-over { background-position:-15px -225px; } .x-tool-plus { background-position:0 -240px; } .x-tool-plus-over { background-position:-15px -240px; } .x-tool-minus { background-position:0 -255px; } .x-tool-minus-over { background-position:-15px -255px; } .x-tool-search { background-position:0 -270px; } .x-tool-search-over { background-position:-15px -270px; } .x-tool-save { background-position:0 -285px; } .x-tool-save-over { background-position:-15px -285px; } .x-tool-help { background-position:0 -300px; } .x-tool-help-over { background-position:-15px -300px; } .x-tool-print { background-position:0 -315px; } .x-tool-print-over { background-position:-15px -315px; } .x-tool-expand { background-position:0 -330px; } .x-tool-expand-over { background-position:-15px -330px; } .x-tool-collapse { background-position:0 -345px; } .x-tool-collapse-over { background-position:-15px -345px; } .x-tool-resize { background-position:0 -360px; } .x-tool-resize-over { background-position:-15px -360px; } .x-tool-move { background-position:0 -375px; } .x-tool-move-over { background-position:-15px -375px; } /* Ghosting */ .x-panel-ghost { z-index:12000; overflow:hidden; position:absolute; left:0;top:0; opacity:.65; -moz-opacity:.65; filter:alpha(opacity=65); } .x-panel-ghost ul { margin:0; padding:0; overflow:hidden; font-size:0; line-height:0; border:1px solid; border-top:0 none; display:block; } .x-panel-ghost * { cursor:move !important; } .x-panel-dd-spacer { border:2px dashed; } /* Buttons */ .x-panel-btns { padding:5px; overflow:hidden; } .x-panel-btns td.x-toolbar-cell{ padding:3px; } .x-panel-btns .x-btn-focus .x-btn-left{ background-position:0 -147px; } .x-panel-btns .x-btn-focus .x-btn-right{ background-position:0 -168px; } .x-panel-btns .x-btn-focus .x-btn-center{ background-position:0 -189px; } .x-panel-btns .x-btn-over .x-btn-left{ background-position:0 -63px; } .x-panel-btns .x-btn-over .x-btn-right{ background-position:0 -84px; } .x-panel-btns .x-btn-over .x-btn-center{ background-position:0 -105px; } .x-panel-btns .x-btn-click .x-btn-center{ background-position:0 -126px; } .x-panel-btns .x-btn-click .x-btn-right{ background-position:0 -84px; } .x-panel-btns .x-btn-click .x-btn-left{ background-position:0 -63px; } .x-panel-fbar td,.x-panel-fbar span,.x-panel-fbar input,.x-panel-fbar div,.x-panel-fbar select,.x-panel-fbar label{ white-space: nowrap; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/structure/pivotgrid.css000066400000000000000000000023661226600447100251160ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-pivotgrid .x-grid3-header-offset table { width: 100%; border-collapse: collapse; } .x-pivotgrid .x-grid3-header-offset table td { padding: 4px 3px 4px 5px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; line-height: 13px; font-family: tahoma; } .x-pivotgrid .x-grid3-row-headers { display: block; float: left; } .x-pivotgrid .x-grid3-row-headers table { height: 100%; width: 100%; border-collapse: collapse; } .x-pivotgrid .x-grid3-row-headers table td { height: 18px; padding: 2px 7px 0 0; text-align: right; text-overflow: ellipsis; font-size: 11px; font-family: tahoma; } .ext-gecko .x-pivotgrid .x-grid3-row-headers table td { height: 21px; } .x-grid3-header-title { top: 0%; left: 0%; position: absolute; text-align: center; vertical-align: middle; font-family: tahoma; font-size: 11px; padding: auto 1px; display: table-cell; } .x-grid3-header-title span { position: absolute; top: 50%; left: 0%; width: 100%; margin-top: -6px; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/structure/progress.css000066400000000000000000000013671226600447100247530ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-progress-wrap { border:1px solid; overflow:hidden; } .x-progress-inner { height:18px; background:repeat-x; position:relative; } .x-progress-bar { height:18px; float:left; width:0; background: repeat-x left center; border-top:1px solid; border-bottom:1px solid; border-right:1px solid; } .x-progress-text { padding:1px 5px; overflow:hidden; position:absolute; left:0; text-align:center; } .x-progress-text-back { line-height:16px; } .ext-ie .x-progress-text-back { line-height:15px; } .ext-strict .ext-ie7 .x-progress-text-back{ width: 100%; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/structure/qtips.css000066400000000000000000000050041226600447100242370ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-tip{ position: absolute; top: 0; left:0; visibility: hidden; z-index: 20002; border:0 none; } .x-tip .x-tip-close{ height: 15px; float:right; width: 15px; margin:0 0 2px 2px; cursor:pointer; display:none; } .x-tip .x-tip-tc { background: transparent no-repeat 0 -62px; padding-top:3px; overflow:hidden; zoom:1; } .x-tip .x-tip-tl { background: transparent no-repeat 0 0; padding-left:6px; overflow:hidden; zoom:1; } .x-tip .x-tip-tr { background: transparent no-repeat right 0; padding-right:6px; overflow:hidden; zoom:1; } .x-tip .x-tip-bc { background: transparent no-repeat 0 -121px; height:3px; overflow:hidden; } .x-tip .x-tip-bl { background: transparent no-repeat 0 -59px; padding-left:6px; zoom:1; } .x-tip .x-tip-br { background: transparent no-repeat right -59px; padding-right:6px; zoom:1; } .x-tip .x-tip-mc { border:0 none; } .x-tip .x-tip-ml { background: no-repeat 0 -124px; padding-left:6px; zoom:1; } .x-tip .x-tip-mr { background: transparent no-repeat right -124px; padding-right:6px; zoom:1; } .ext-ie .x-tip .x-tip-header,.ext-ie .x-tip .x-tip-tc { font-size:0; line-height:0; } .ext-border-box .x-tip .x-tip-header, .ext-border-box .x-tip .x-tip-tc{ line-height: 1px; } .x-tip .x-tip-header-text { padding:0; margin:0 0 2px 0; } .x-tip .x-tip-body { margin:0 !important; line-height:14px; padding:0; } .x-tip .x-tip-body .loading-indicator { margin:0; } .x-tip-draggable .x-tip-header,.x-tip-draggable .x-tip-header-text { cursor:move; } .x-form-invalid-tip .x-tip-tc { background: repeat-x 0 -12px; padding-top:6px; } .x-form-invalid-tip .x-tip-bc { background: repeat-x 0 -18px; height:6px; } .x-form-invalid-tip .x-tip-bl { background: no-repeat 0 -6px; } .x-form-invalid-tip .x-tip-br { background: no-repeat right -6px; } .x-form-invalid-tip .x-tip-body { padding:2px; } .x-form-invalid-tip .x-tip-body { padding-left:24px; background:transparent no-repeat 2px 2px; } .x-tip-anchor { position: absolute; width: 9px; height: 10px; overflow:hidden; background: transparent no-repeat 0 0; zoom:1; } .x-tip-anchor-bottom { background-position: -9px 0; } .x-tip-anchor-right { background-position: -18px 0; width: 10px; } .x-tip-anchor-left { background-position: -28px 0; width: 10px; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/structure/reset.css000066400000000000000000000011551226600447100242240ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ html,body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td{margin:0;padding:0;}img,body,html{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}ol,ul {list-style:none;}caption,th {text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;}q:before,q:after{content:'';} .ext-forced-border-box, .ext-forced-border-box * { -moz-box-sizing: border-box; -ms-box-sizing: border-box; -webkit-box-sizing: border-box; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/structure/resizable.css000066400000000000000000000055041226600447100250640ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-resizable-handle { position:absolute; z-index:100; /* ie needs these */ font-size:1px; line-height:6px; overflow:hidden; filter:alpha(opacity=0); opacity:0; zoom:1; } .x-resizable-handle-east{ width:6px; cursor:e-resize; right:0; top:0; height:100%; } .ext-ie .x-resizable-handle-east { margin-right:-1px; /*IE rounding error*/ } .x-resizable-handle-south{ width:100%; cursor:s-resize; left:0; bottom:0; height:6px; } .ext-ie .x-resizable-handle-south { margin-bottom:-1px; /*IE rounding error*/ } .x-resizable-handle-west{ width:6px; cursor:w-resize; left:0; top:0; height:100%; } .x-resizable-handle-north{ width:100%; cursor:n-resize; left:0; top:0; height:6px; } .x-resizable-handle-southeast{ width:6px; cursor:se-resize; right:0; bottom:0; height:6px; z-index:101; } .x-resizable-handle-northwest{ width:6px; cursor:nw-resize; left:0; top:0; height:6px; z-index:101; } .x-resizable-handle-northeast{ width:6px; cursor:ne-resize; right:0; top:0; height:6px; z-index:101; } .x-resizable-handle-southwest{ width:6px; cursor:sw-resize; left:0; bottom:0; height:6px; z-index:101; } .x-resizable-over .x-resizable-handle, .x-resizable-pinned .x-resizable-handle{ filter:alpha(opacity=100); opacity:1; } .x-resizable-over .x-resizable-handle-east, .x-resizable-pinned .x-resizable-handle-east, .x-resizable-over .x-resizable-handle-west, .x-resizable-pinned .x-resizable-handle-west { background-position: left; } .x-resizable-over .x-resizable-handle-south, .x-resizable-pinned .x-resizable-handle-south, .x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north { background-position: top; } .x-resizable-over .x-resizable-handle-southeast, .x-resizable-pinned .x-resizable-handle-southeast{ background-position: top left; } .x-resizable-over .x-resizable-handle-northwest, .x-resizable-pinned .x-resizable-handle-northwest{ background-position:bottom right; } .x-resizable-over .x-resizable-handle-northeast, .x-resizable-pinned .x-resizable-handle-northeast{ background-position: bottom left; } .x-resizable-over .x-resizable-handle-southwest, .x-resizable-pinned .x-resizable-handle-southwest{ background-position: top right; } .x-resizable-proxy{ border: 1px dashed; position:absolute; overflow:hidden; display:none; left:0; top:0; z-index:50000; } .x-resizable-overlay{ width:100%; height:100%; display:none; position:absolute; left:0; top:0; z-index:200000; -moz-opacity: 0; opacity:0; filter: alpha(opacity=0); } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/structure/slider.css000066400000000000000000000034731226600447100243710ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ /* Shared styles */ .x-slider { zoom:1; } .x-slider-inner { position:relative; left:0; top:0; overflow:visible; zoom:1; } .x-slider-focus { position:absolute; left:0; top:0; width:1px; height:1px; line-height:1px; font-size:1px; -moz-outline:0 none; outline:0 none; -moz-user-select: none; -khtml-user-select:none; -webkit-user-select:ignore; display:block; overflow:hidden; } /* Horizontal styles */ .x-slider-horz { padding-left:7px; background:transparent no-repeat 0 -22px; } .x-slider-horz .x-slider-end { padding-right:7px; zoom:1; background:transparent no-repeat right -44px; } .x-slider-horz .x-slider-inner { background:transparent repeat-x 0 0; height:22px; } .x-slider-horz .x-slider-thumb { width:14px; height:15px; position:absolute; left:0; top:3px; background:transparent no-repeat 0 0; } .x-slider-horz .x-slider-thumb-over { background-position: -14px -15px; } .x-slider-horz .x-slider-thumb-drag { background-position: -28px -30px; } /* Vertical styles */ .x-slider-vert { padding-top:7px; background:transparent no-repeat -44px 0; width:22px; } .x-slider-vert .x-slider-end { padding-bottom:7px; zoom:1; background:transparent no-repeat -22px bottom; } .x-slider-vert .x-slider-inner { background:transparent repeat-y 0 0; } .x-slider-vert .x-slider-thumb { width:15px; height:14px; position:absolute; left:3px; bottom:0; background:transparent no-repeat 0 0; } .x-slider-vert .x-slider-thumb-over { background-position: -15px -14px; } .x-slider-vert .x-slider-thumb-drag { background-position: -30px -28px; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/structure/tabs.css000066400000000000000000000161721226600447100240400ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-tab-panel { overflow:hidden; } .x-tab-panel-header, .x-tab-panel-footer { border: 1px solid; overflow:hidden; zoom:1; } .x-tab-panel-header { border: 1px solid; padding-bottom: 2px; } .x-tab-panel-footer { border: 1px solid; padding-top: 2px; } .x-tab-strip-wrap { width:100%; overflow:hidden; position:relative; zoom:1; } ul.x-tab-strip { display:block; width:5000px; zoom:1; } ul.x-tab-strip-top{ padding-top: 1px; background: repeat-x bottom; border-bottom: 1px solid; } ul.x-tab-strip-bottom{ padding-bottom: 1px; background: repeat-x top; border-top: 1px solid; border-bottom: 0 none; } .x-tab-panel-header-plain .x-tab-strip-top { background:transparent !important; padding-top:0 !important; } .x-tab-panel-header-plain { background:transparent !important; border-width:0 !important; padding-bottom:0 !important; } .x-tab-panel-header-plain .x-tab-strip-spacer, .x-tab-panel-footer-plain .x-tab-strip-spacer { border:1px solid; height:2px; font-size:1px; line-height:1px; } .x-tab-panel-header-plain .x-tab-strip-spacer { border-top: 0 none; } .x-tab-panel-footer-plain .x-tab-strip-spacer { border-bottom: 0 none; } .x-tab-panel-footer-plain .x-tab-strip-bottom { background:transparent !important; padding-bottom:0 !important; } .x-tab-panel-footer-plain { background:transparent !important; border-width:0 !important; padding-top:0 !important; } .ext-border-box .x-tab-panel-header-plain .x-tab-strip-spacer, .ext-border-box .x-tab-panel-footer-plain .x-tab-strip-spacer { height:3px; } ul.x-tab-strip li { float:left; margin-left:2px; } ul.x-tab-strip li.x-tab-edge { float:left; margin:0 !important; padding:0 !important; border:0 none !important; font-size:1px !important; line-height:1px !important; overflow:hidden; zoom:1; background:transparent !important; width:1px; } .x-tab-strip a, .x-tab-strip span, .x-tab-strip em { display:block; } .x-tab-strip a { text-decoration:none !important; -moz-outline: none; outline: none; cursor:pointer; } .x-tab-strip-inner { overflow:hidden; text-overflow: ellipsis; } .x-tab-strip span.x-tab-strip-text { white-space: nowrap; cursor:pointer; padding:4px 0; } .x-tab-strip-top .x-tab-with-icon .x-tab-right { padding-left:6px; } .x-tab-strip .x-tab-with-icon span.x-tab-strip-text { padding-left:20px; background-position: 0 3px; background-repeat: no-repeat; } .x-tab-strip-active, .x-tab-strip-active a.x-tab-right { cursor:default; } .x-tab-strip-active span.x-tab-strip-text { cursor:default; } .x-tab-strip-disabled .x-tabs-text { cursor:default; } .x-tab-panel-body { overflow:hidden; } .x-tab-panel-bwrap { overflow:hidden; } .ext-ie .x-tab-strip .x-tab-right { position:relative; } .x-tab-strip-top .x-tab-strip-active .x-tab-right { margin-bottom:-1px; } /* * Horrible hack for IE8 in quirks mode */ .ext-ie8 .x-tab-strip li { position: relative; } .ext-border-box .ext-ie8 .x-tab-strip-top .x-tab-right { top: 1px; } .ext-ie8 .x-tab-strip-top { padding-top: 1; } .ext-border-box .ext-ie8 .x-tab-strip-top { padding-top: 0; } .ext-ie8 .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close { top:3px; } .ext-border-box .ext-ie8 .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close { top:4px; } .ext-ie8 .x-tab-strip-bottom .x-tab-right{ top:0; } .x-tab-strip-top .x-tab-strip-active .x-tab-right span.x-tab-strip-text { padding-bottom:5px; } .x-tab-strip-bottom .x-tab-strip-active .x-tab-right { margin-top:-1px; } .x-tab-strip-bottom .x-tab-strip-active .x-tab-right span.x-tab-strip-text { padding-top:5px; } .x-tab-strip-top .x-tab-right { background: transparent no-repeat 0 -51px; padding-left:10px; } .x-tab-strip-top .x-tab-left { background: transparent no-repeat right -351px; padding-right:10px; } .x-tab-strip-top .x-tab-strip-inner { background: transparent repeat-x 0 -201px; } .x-tab-strip-top .x-tab-strip-over .x-tab-right { background-position:0 -101px; } .x-tab-strip-top .x-tab-strip-over .x-tab-left { background-position:right -401px; } .x-tab-strip-top .x-tab-strip-over .x-tab-strip-inner { background-position:0 -251px; } .x-tab-strip-top .x-tab-strip-active .x-tab-right { background-position: 0 0; } .x-tab-strip-top .x-tab-strip-active .x-tab-left { background-position: right -301px; } .x-tab-strip-top .x-tab-strip-active .x-tab-strip-inner { background-position: 0 -151px; } .x-tab-strip-bottom .x-tab-right { background: no-repeat bottom right; } .x-tab-strip-bottom .x-tab-left { background: no-repeat bottom left; } .x-tab-strip-bottom .x-tab-strip-active .x-tab-right { background: no-repeat bottom right; } .x-tab-strip-bottom .x-tab-strip-active .x-tab-left { background: no-repeat bottom left; } .x-tab-strip-bottom .x-tab-left { margin-right: 3px; padding:0 10px; } .x-tab-strip-bottom .x-tab-right { padding:0; } .x-tab-strip .x-tab-strip-close { display:none; } .x-tab-strip-closable { position:relative; } .x-tab-strip-closable .x-tab-left { padding-right:19px; } .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close { opacity:.6; -moz-opacity:.6; background-repeat:no-repeat; display:block; width:11px; height:11px; position:absolute; top:3px; right:3px; cursor:pointer; z-index:2; } .x-tab-strip .x-tab-strip-active a.x-tab-strip-close { opacity:.8; -moz-opacity:.8; } .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close:hover{ opacity:1; -moz-opacity:1; } .x-tab-panel-body { border: 1px solid; } .x-tab-panel-body-top { border-top: 0 none; } .x-tab-panel-body-bottom { border-bottom: 0 none; } .x-tab-scroller-left { background: transparent no-repeat -18px 0; border-bottom: 1px solid; width:18px; position:absolute; left:0; top:0; z-index:10; cursor:pointer; } .x-tab-scroller-left-over { background-position: 0 0; } .x-tab-scroller-left-disabled { background-position: -18px 0; opacity:.5; -moz-opacity:.5; filter:alpha(opacity=50); cursor:default; } .x-tab-scroller-right { background: transparent no-repeat 0 0; border-bottom: 1px solid; width:18px; position:absolute; right:0; top:0; z-index:10; cursor:pointer; } .x-tab-scroller-right-over { background-position: -18px 0; } .x-tab-scroller-right-disabled { background-position: 0 0; opacity:.5; -moz-opacity:.5; filter:alpha(opacity=50); cursor:default; } .x-tab-scrolling-bottom .x-tab-scroller-left, .x-tab-scrolling-bottom .x-tab-scroller-right{ margin-top: 1px; } .x-tab-scrolling .x-tab-strip-wrap { margin-left:18px; margin-right:18px; } .x-tab-scrolling { position:relative; } .x-tab-panel-bbar .x-toolbar { border:1px solid; border-top:0 none; overflow:hidden; padding:2px; } .x-tab-panel-tbar .x-toolbar { border:1px solid; border-top:0 none; overflow:hidden; padding:2px; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/structure/toolbar.css000066400000000000000000000121521226600447100245430ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-toolbar{ border-style:solid; border-width:0 0 1px 0; display: block; padding:2px; background:repeat-x top left; position:relative; left:0; top:0; zoom:1; overflow:hidden; } .x-toolbar-left { width: 100%; } .x-toolbar .x-item-disabled .x-btn-icon { opacity: .35; -moz-opacity: .35; filter: alpha(opacity=35); } .x-toolbar td { vertical-align:middle; } .x-toolbar td,.x-toolbar span,.x-toolbar input,.x-toolbar div,.x-toolbar select,.x-toolbar label{ white-space: nowrap; } .x-toolbar .x-item-disabled { cursor:default; opacity:.6; -moz-opacity:.6; filter:alpha(opacity=60); } .x-toolbar .x-item-disabled * { cursor:default; } .x-toolbar .x-toolbar-cell { vertical-align:middle; } .x-toolbar .x-btn-tl, .x-toolbar .x-btn-tr, .x-toolbar .x-btn-tc, .x-toolbar .x-btn-ml, .x-toolbar .x-btn-mr, .x-toolbar .x-btn-mc, .x-toolbar .x-btn-bl, .x-toolbar .x-btn-br, .x-toolbar .x-btn-bc { background-position: 500px 500px; } /* These rules are duplicated from button.css to give priority of x-toolbar rules above */ .x-toolbar .x-btn-over .x-btn-tl{ background-position: -6px 0; } .x-toolbar .x-btn-over .x-btn-tr{ background-position: -9px 0; } .x-toolbar .x-btn-over .x-btn-tc{ background-position: 0 -9px; } .x-toolbar .x-btn-over .x-btn-ml{ background-position: -6px -24px; } .x-toolbar .x-btn-over .x-btn-mr{ background-position: -9px -24px; } .x-toolbar .x-btn-over .x-btn-mc{ background-position: 0 -2168px; } .x-toolbar .x-btn-over .x-btn-bl{ background-position: -6px -3px; } .x-toolbar .x-btn-over .x-btn-br{ background-position: -9px -3px; } .x-toolbar .x-btn-over .x-btn-bc{ background-position: 0 -18px; } .x-toolbar .x-btn-click .x-btn-tl, .x-toolbar .x-btn-menu-active .x-btn-tl, .x-toolbar .x-btn-pressed .x-btn-tl{ background-position: -12px 0; } .x-toolbar .x-btn-click .x-btn-tr, .x-toolbar .x-btn-menu-active .x-btn-tr, .x-toolbar .x-btn-pressed .x-btn-tr{ background-position: -15px 0; } .x-toolbar .x-btn-click .x-btn-tc, .x-toolbar .x-btn-menu-active .x-btn-tc, .x-toolbar .x-btn-pressed .x-btn-tc{ background-position: 0 -12px; } .x-toolbar .x-btn-click .x-btn-ml, .x-toolbar .x-btn-menu-active .x-btn-ml, .x-toolbar .x-btn-pressed .x-btn-ml{ background-position: -12px -24px; } .x-toolbar .x-btn-click .x-btn-mr, .x-toolbar .x-btn-menu-active .x-btn-mr, .x-toolbar .x-btn-pressed .x-btn-mr{ background-position: -15px -24px; } .x-toolbar .x-btn-click .x-btn-mc, .x-toolbar .x-btn-menu-active .x-btn-mc, .x-toolbar .x-btn-pressed .x-btn-mc{ background-position: 0 -3240px; } .x-toolbar .x-btn-click .x-btn-bl, .x-toolbar .x-btn-menu-active .x-btn-bl, .x-toolbar .x-btn-pressed .x-btn-bl{ background-position: -12px -3px; } .x-toolbar .x-btn-click .x-btn-br, .x-toolbar .x-btn-menu-active .x-btn-br, .x-toolbar .x-btn-pressed .x-btn-br{ background-position: -15px -3px; } .x-toolbar .x-btn-click .x-btn-bc, .x-toolbar .x-btn-menu-active .x-btn-bc, .x-toolbar .x-btn-pressed .x-btn-bc{ background-position: 0 -21px; } .x-toolbar div.xtb-text{ padding:2px 2px 0; line-height:16px; display:block; } .x-toolbar .xtb-sep { background-position: center; background-repeat: no-repeat; display: block; font-size: 1px; height: 16px; width:4px; overflow: hidden; cursor:default; margin: 0 2px 0; border:0; } .x-toolbar .xtb-spacer { width:2px; } /* Paging Toolbar */ .x-tbar-page-number{ width:30px; height:14px; } .ext-ie .x-tbar-page-number{ margin-top: 2px; } .x-paging-info { position:absolute; top:5px; right: 8px; } /* floating */ .x-toolbar-ct { width:100%; } .x-toolbar-right td { text-align: center; } .x-panel-tbar, .x-panel-bbar, .x-window-tbar, .x-window-bbar, .x-tab-panel-tbar, .x-tab-panel-bbar, .x-plain-tbar, .x-plain-bbar { overflow:hidden; zoom:1; } .x-toolbar-more .x-btn-small .x-btn-text{ height: 16px; width: 12px; } .x-toolbar-more em.x-btn-arrow { display:inline; background-color:transparent; padding-right:0; } .x-toolbar-more .x-btn-mc em.x-btn-arrow { background-image: none; } div.x-toolbar-no-items { color:gray !important; padding:5px 10px !important; } /* fix ie toolbar form items */ .ext-border-box .x-toolbar-cell .x-form-text { margin-bottom:-1px !important; } .ext-border-box .x-toolbar-cell .x-form-field-wrap .x-form-text { margin:0 !important; } .ext-ie .x-toolbar-cell .x-form-field-wrap { height:21px; } .ext-ie .x-toolbar-cell .x-form-text { position:relative; top:-1px; } .ext-strict .ext-ie8 .x-toolbar-cell .x-form-field-trigger-wrap .x-form-text, .ext-strict .ext-ie .x-toolbar-cell .x-form-text { top: 0px; } .x-toolbar-right td .x-form-field-trigger-wrap{ text-align: left; } .x-toolbar-cell .x-form-checkbox, .x-toolbar-cell .x-form-radio{ margin-top: 5px; } .x-toolbar-cell .x-form-cb-label{ vertical-align: bottom; top: 1px; } .ext-ie .x-toolbar-cell .x-form-checkbox, .ext-ie .x-toolbar-cell .x-form-radio{ margin-top: 4px; } .ext-ie .x-toolbar-cell .x-form-cb-label{ top: 0; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/structure/tree.css000066400000000000000000000105641226600447100240450ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .ext-strict .ext-ie .x-tree .x-panel-bwrap{ position:relative; overflow:hidden; } .x-tree-icon, .x-tree-ec-icon, .x-tree-elbow-line, .x-tree-elbow, .x-tree-elbow-end, .x-tree-elbow-plus, .x-tree-elbow-minus, .x-tree-elbow-end-plus, .x-tree-elbow-end-minus{ border: 0 none; height: 18px; margin: 0; padding: 0; vertical-align: top; width: 16px; background-repeat: no-repeat; } .x-tree-node-collapsed .x-tree-node-icon, .x-tree-node-expanded .x-tree-node-icon, .x-tree-node-leaf .x-tree-node-icon{ border: 0 none; height: 18px; margin: 0; padding: 0; vertical-align: top; width: 16px; background-position:center; background-repeat: no-repeat; } .ext-ie .x-tree-node-indent img, .ext-ie .x-tree-node-icon, .ext-ie .x-tree-ec-icon { vertical-align: middle !important; } .ext-strict .ext-ie8 .x-tree-node-indent img, .ext-strict .ext-ie8 .x-tree-node-icon, .ext-strict .ext-ie8 .x-tree-ec-icon { vertical-align: top !important; } /* checkboxes */ input.x-tree-node-cb { margin-left:1px; height: 19px; vertical-align: bottom; } .ext-ie input.x-tree-node-cb { margin-left:0; margin-top: 1px; width: 16px; height: 16px; vertical-align: middle; } .ext-strict .ext-ie8 input.x-tree-node-cb{ margin: 1px 1px; height: 14px; vertical-align: bottom; } .ext-strict .ext-ie8 input.x-tree-node-cb + a{ vertical-align: bottom; } .ext-opera input.x-tree-node-cb { height: 14px; vertical-align: middle; } .x-tree-noicon .x-tree-node-icon{ width:0; height:0; } /* No line styles */ .x-tree-no-lines .x-tree-elbow{ background-color:transparent; } .x-tree-no-lines .x-tree-elbow-end{ background-color:transparent; } .x-tree-no-lines .x-tree-elbow-line{ background-color:transparent; } /* Arrows */ .x-tree-arrows .x-tree-elbow{ background-color:transparent; } .x-tree-arrows .x-tree-elbow-plus{ background:transparent no-repeat 0 0; } .x-tree-arrows .x-tree-elbow-minus{ background:transparent no-repeat -16px 0; } .x-tree-arrows .x-tree-elbow-end{ background-color:transparent; } .x-tree-arrows .x-tree-elbow-end-plus{ background:transparent no-repeat 0 0; } .x-tree-arrows .x-tree-elbow-end-minus{ background:transparent no-repeat -16px 0; } .x-tree-arrows .x-tree-elbow-line{ background-color:transparent; } .x-tree-arrows .x-tree-ec-over .x-tree-elbow-plus{ background-position:-32px 0; } .x-tree-arrows .x-tree-ec-over .x-tree-elbow-minus{ background-position:-48px 0; } .x-tree-arrows .x-tree-ec-over .x-tree-elbow-end-plus{ background-position:-32px 0; } .x-tree-arrows .x-tree-ec-over .x-tree-elbow-end-minus{ background-position:-48px 0; } .x-tree-elbow-plus, .x-tree-elbow-minus, .x-tree-elbow-end-plus, .x-tree-elbow-end-minus{ cursor:pointer; } .ext-ie ul.x-tree-node-ct{ font-size:0; line-height:0; zoom:1; } .x-tree-node{ white-space: nowrap; } .x-tree-node-el { line-height:18px; cursor:pointer; } .x-tree-node a, .x-dd-drag-ghost a{ text-decoration:none; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:ignore; -kthml-user-focus:normal; -moz-user-focus:normal; -moz-outline: 0 none; outline:0 none; } .x-tree-node a span, .x-dd-drag-ghost a span{ text-decoration:none; padding:1px 3px 1px 2px; } .x-tree-node .x-tree-node-disabled .x-tree-node-icon{ -moz-opacity: 0.5; opacity:.5; filter: alpha(opacity=50); } .x-tree-node .x-tree-node-inline-icon{ background-color:transparent; } .x-tree-node a:hover, .x-dd-drag-ghost a:hover{ text-decoration:none; } .x-tree-node div.x-tree-drag-insert-below{ border-bottom:1px dotted; } .x-tree-node div.x-tree-drag-insert-above{ border-top:1px dotted; } .x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-below{ border-bottom:0 none; } .x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-above{ border-top:0 none; } .x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-below a{ border-bottom:2px solid; } .x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-above a{ border-top:2px solid; } .x-tree-node .x-tree-drag-append a span{ border:1px dotted; } .x-dd-drag-ghost .x-tree-node-indent, .x-dd-drag-ghost .x-tree-ec-icon{ display:none !important; } /* Fix for ie rootVisible:false issue */ .x-tree-root-ct { zoom:1; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/structure/window.css000066400000000000000000000067741226600447100244250ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-window { zoom:1; } .x-window .x-window-handle { opacity:0; -moz-opacity:0; filter:alpha(opacity=0); } .x-window-proxy { border:1px solid; z-index:12000; overflow:hidden; position:absolute; left:0;top:0; display:none; opacity:.5; -moz-opacity:.5; filter:alpha(opacity=50); } .x-window-header { overflow:hidden; zoom:1; } .x-window-bwrap { z-index:1; position:relative; zoom:1; left:0;top:0; } .x-window-tl .x-window-header { padding:5px 0 4px 0; } .x-window-header-text { cursor:pointer; } .x-window-tc { background: transparent repeat-x 0 0; overflow:hidden; zoom:1; } .x-window-tl { background: transparent no-repeat 0 0; padding-left:6px; zoom:1; z-index:1; position:relative; } .x-window-tr { background: transparent no-repeat right 0; padding-right:6px; } .x-window-bc { background: transparent repeat-x 0 bottom; zoom:1; } .x-window-bc .x-window-footer { padding-bottom:6px; zoom:1; font-size:0; line-height:0; } .x-window-bl { background: transparent no-repeat 0 bottom; padding-left:6px; zoom:1; } .x-window-br { background: transparent no-repeat right bottom; padding-right:6px; zoom:1; } .x-window-mc { border:1px solid; padding:0; margin:0; } .x-window-ml { background: transparent repeat-y 0 0; padding-left:6px; zoom:1; } .x-window-mr { background: transparent repeat-y right 0; padding-right:6px; zoom:1; } .x-window-body { overflow:hidden; } .x-window-bwrap { overflow:hidden; } .x-window-maximized .x-window-bl, .x-window-maximized .x-window-br, .x-window-maximized .x-window-ml, .x-window-maximized .x-window-mr, .x-window-maximized .x-window-tl, .x-window-maximized .x-window-tr { padding:0; } .x-window-maximized .x-window-footer { padding-bottom:0; } .x-window-maximized .x-window-tc { padding-left:3px; padding-right:3px; } .x-window-maximized .x-window-mc { border-left:0 none; border-right:0 none; } .x-window-tbar .x-toolbar, .x-window-bbar .x-toolbar { border-left:0 none; border-right: 0 none; } .x-window-bbar .x-toolbar { border-top:1px solid; border-bottom:0 none; } .x-window-draggable, .x-window-draggable .x-window-header-text { cursor:move; } .x-window-maximized .x-window-draggable, .x-window-maximized .x-window-draggable .x-window-header-text { cursor:default; } .x-window-body { background-color:transparent; } .x-panel-ghost .x-window-tl { border-bottom:1px solid; } .x-panel-collapsed .x-window-tl { border-bottom:1px solid; } .x-window-maximized-ct { overflow:hidden; } .x-window-maximized .x-window-handle { display:none; } .x-window-sizing-ghost ul { border:0 none !important; } .x-dlg-focus{ -moz-outline:0 none; outline:0 none; width:0; height:0; overflow:hidden; position:absolute; top:0; left:0; } .ext-webkit .x-dlg-focus{ width: 1px; height: 1px; } .x-dlg-mask{ z-index:10000; display:none; position:absolute; top:0; left:0; -moz-opacity: 0.5; opacity:.50; filter: alpha(opacity=50); } body.ext-ie6.x-body-masked select { visibility:hidden; } body.ext-ie6.x-body-masked .x-window select { visibility:visible; } .x-window-plain .x-window-mc { border: 1px solid; } .x-window-plain .x-window-body { border: 1px solid; background:transparent !important; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-access/000077500000000000000000000000001226600447100226675ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-access/borders.css000066400000000000000000000010251226600447100250370ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-panel-noborder .x-panel-header-noborder { border-bottom-color:#343d4e; } .x-panel-noborder .x-panel-tbar-noborder .x-toolbar { border-bottom-color:#343d4e; } .x-panel-noborder .x-panel-bbar-noborder .x-toolbar { border-top-color:#343d4e; } .x-tab-panel-bbar-noborder .x-toolbar { border-top-color:#343d4e; } .x-tab-panel-tbar-noborder .x-toolbar { border-bottom-color:#343d4e; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-access/box.css000066400000000000000000000027711226600447100242000ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-box-tl { background-image: url(../images/default/box/corners.gif); } .x-box-tc { background-image: url(../images/default/box/tb.gif); } .x-box-tr { background-image: url(../images/default/box/corners.gif); } .x-box-ml { background-image: url(../images/default/box/l.gif); } .x-box-mc { background-color: #eee; background-image: url(../images/default/box/tb.gif); font-family: "Myriad Pro","Myriad Web","Tahoma","Helvetica","Arial",sans-serif; color: #393939; font-size: 15px; } .x-box-mc h3 { font-size: 18px; font-weight: bold; } .x-box-mr { background-image: url(../images/default/box/r.gif); } .x-box-bl { background-image: url(../images/default/box/corners.gif); } .x-box-bc { background-image: url(../images/default/box/tb.gif); } .x-box-br { background-image: url(../images/default/box/corners.gif); } .x-box-blue .x-box-bl, .x-box-blue .x-box-br, .x-box-blue .x-box-tl, .x-box-blue .x-box-tr { background-image: url(../images/default/box/corners-blue.gif); } .x-box-blue .x-box-bc, .x-box-blue .x-box-mc, .x-box-blue .x-box-tc { background-image: url(../images/default/box/tb-blue.gif); } .x-box-blue .x-box-mc { background-color: #c3daf9; } .x-box-blue .x-box-mc h3 { color: #17385b; } .x-box-blue .x-box-ml { background-image: url(../images/default/box/l-blue.gif); } .x-box-blue .x-box-mr { background-image: url(../images/default/box/r-blue.gif); } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-access/button.css000066400000000000000000000063761226600447100247300ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-btn { font:normal 14px tahoma, verdana, helvetica; } .x-btn button { font:normal 14px arial,tahoma,verdana,helvetica; color:#fffffa; padding-left:6px !important; padding-right:6px !important; } .x-btn-over .x-btn button{ color:#fff; } .x-btn-noicon .x-btn-small .x-btn-text, .x-btn-text-icon .x-btn-icon-small-left .x-btn-text, .x-btn-icon .x-btn-small .x-btn-text, .x-btn-text-icon .x-btn-icon-small-right .x-btn-text { height:18px; } .x-btn-icon .x-btn-small .x-btn-text { width:18px; } .x-btn-text-icon .x-btn-icon-small-left .x-btn-text { padding-left:21px !important; } .x-btn-text-icon .x-btn-icon-small-right .x-btn-text { padding-right:21px !important; } .x-btn-text-icon .x-btn-icon-medium-left .x-btn-text { padding-left:29px !important; } .x-btn-text-icon .x-btn-icon-medium-right .x-btn-text { padding-right:29px !important; } .x-btn-text-icon .x-btn-icon-large-left .x-btn-text { padding-left:37px !important; } .x-btn-text-icon .x-btn-icon-large-right .x-btn-text { padding-right:37px !important; } .x-btn em { font-style:normal; font-weight:normal; } .x-btn-tl, .x-btn-tr, .x-btn-tc, .x-btn-ml, .x-btn-mr, .x-btn-mc, .x-btn-bl, .x-btn-br, .x-btn-bc{ background-image:url(../images/access/button/btn.gif); } .x-btn-click .x-btn-text, .x-btn-menu-active .x-btn-text, .x-btn-pressed .x-btn-text{ color:#fff; } .x-btn-disabled *{ color:#eee !important; } .x-btn-mc em.x-btn-arrow { background-image:url(../images/access/button/arrow.gif); padding-right:13px; } .x-btn-mc em.x-btn-split { background-image:url(../images/access/button/s-arrow.gif); padding-right:20px; } .x-btn-over .x-btn-mc em.x-btn-split, .x-btn-click .x-btn-mc em.x-btn-split, .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-btn-pressed .x-btn-mc em.x-btn-split { background-image:url(../images/access/button/s-arrow-o.gif); } .x-btn-mc em.x-btn-arrow-bottom { background-image:url(../images/access/button/s-arrow-b-noline.gif); } .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/access/button/s-arrow-b.gif); } .x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-btn-click .x-btn-mc em.x-btn-split-bottom, .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-btn-pressed .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/access/button/s-arrow-bo.gif); } .x-btn-group-header { color: #d2d2d2; } .x-btn-group-tc { background-image: url(../images/access/button/group-tb.gif); } .x-btn-group-tl { background-image: url(../images/access/button/group-cs.gif); } .x-btn-group-tr { background-image: url(../images/access/button/group-cs.gif); } .x-btn-group-bc { background-image: url(../images/access/button/group-tb.gif); } .x-btn-group-bl { background-image: url(../images/access/button/group-cs.gif); } .x-btn-group-br { background-image: url(../images/access/button/group-cs.gif); } .x-btn-group-ml { background-image: url(../images/access/button/group-lr.gif); } .x-btn-group-mr { background-image: url(../images/access/button/group-lr.gif); } .x-btn-group-notitle .x-btn-group-tc { background-image: url(../images/access/button/group-tb.gif); } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-access/combo.css000066400000000000000000000015771226600447100245120ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-combo-list { border:2px solid #232732; background-color:#555566; font:normal 15px tahoma, arial, helvetica, sans-serif; } .x-combo-list-inner { background-color:#414551; } .x-combo-list-hd { font:bold 14px tahoma, arial, helvetica, sans-serif; color:#fff; background-image: url(../images/default/layout/panel-title-light-bg.gif); border-bottom-color:#98c0f4; } .x-resizable-pinned .x-combo-list-inner { border-bottom-color:#98c0f4; } .x-combo-list-item { border-color:#556; } .x-combo-list .x-combo-selected { border-color:#e5872c !important; background-color:#e5872c; } .x-combo-list .x-toolbar { border-top-color:#98c0f4; } .x-combo-list-small { font:normal 14px tahoma, arial, helvetica, sans-serif; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-access/core.css000066400000000000000000000027771226600447100243460ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ body { background-color:#16181a; color:#fcfcfc; } .ext-el-mask { background-color: #ccc; } .ext-el-mask-msg { border-color:#223; background-color:#3f4757; background-image:url(../images/access/box/tb-blue.gif); } .ext-el-mask-msg div { background-color: #232d38; border-color:#556; color:#fff; font:normal 14px tahoma, arial, helvetica, sans-serif; } .x-mask-loading div { background-color:#232d38; background-image:url(../images/access/grid/loading.gif); } .x-item-disabled { color: #ddd; } .x-item-disabled * { color: #ddd !important; } .x-splitbar-proxy { background-color: #aaa; } .x-color-palette a { border-color:#fff; } .x-color-palette a:hover, .x-color-palette a.x-color-palette-sel { border-color:#8bb8f3; background-color: #deecfd; } .x-color-palette em { border-color:#aca899; } .x-ie-shadow { background-color:#777; } .x-shadow .xsmc { background-image: url(../images/default/shadow-c.png); } .x-shadow .xsml, .x-shadow .xsmr { background-image: url(../images/default/shadow-lr.png); } .x-shadow .xstl, .x-shadow .xstc, .x-shadow .xstr, .x-shadow .xsbl, .x-shadow .xsbc, .x-shadow .xsbr{ background-image: url(../images/default/shadow.png); } .loading-indicator { font-size: 14px; background-image: url(../images/access/grid/loading.gif); } .x-spotlight { background-color: #ccc; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-access/date-picker.css000066400000000000000000000055651226600447100256040ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-date-picker { border-color: #737b8c; background-color:#21252e; } .x-date-middle,.x-date-left,.x-date-right { background-image: url(../images/access/shared/hd-sprite.gif); color:#fff; font:bold 14px "sans serif", tahoma, verdana, helvetica; } .x-date-middle .x-btn .x-btn-text { color:#fff; } .x-date-middle .x-btn-mc em.x-btn-arrow { background-image:url(../images/access/toolbar/btn-arrow-light.gif); } .x-date-right a { background-image: url(../images/access/shared/right-btn.gif); } .x-date-left a{ background-image: url(../images/access/shared/left-btn.gif); } .x-date-inner th { background-color:#363d4a; background-image:url(../images/access/toolbar/bg.gif); border-bottom-color:#535b5c; font:normal 13px arial, helvetica,tahoma,sans-serif; color:#fff; } .x-date-inner td { border-color:#112; } .x-date-inner a { font:normal 14px arial, helvetica,tahoma,sans-serif; color:#fff; padding:2px 7px 1px 3px; /* Structure to account for larger, bolder fonts in Access theme. */ } .x-date-inner .x-date-active{ color:#000; } .x-date-inner .x-date-selected a{ background-color:#e5872c; background-image:none; border-color:#864900; padding:1px 6px 1px 2px; /* Structure to account for larger, bolder fonts in Access theme. */ } .x-date-inner .x-date-today a{ border-color:#99a; } .x-date-inner .x-date-selected span{ font-weight:bold; } .x-date-inner .x-date-prevday a,.x-date-inner .x-date-nextday a { color:#aaa; } .x-date-bottom { border-top-color:#737b8c; background-color:#464d5a; background-image:url(../images/access/shared/glass-bg.gif); } .x-date-inner a:hover, .x-date-inner .x-date-disabled a:hover{ color:#fff; background-color:#7e5530; } .x-date-inner .x-date-disabled a { background-color:#eee; color:#bbb; } .x-date-mmenu{ background-color:#eee !important; } .x-date-mmenu .x-menu-item { font-size:13px; color:#000; } .x-date-mp { background-color:#21252e; } .x-date-mp td { font:normal 14px arial, helvetica,tahoma,sans-serif; } .x-date-mp-btns button { background-color:#083772; color:#fff; border-color: #3366cc #000055 #000055 #3366cc; font:normal 14px arial, helvetica,tahoma,sans-serif; } .x-date-mp-btns { background-color: #dfecfb; background-image: url(../images/access/shared/glass-bg.gif); } .x-date-mp-btns td { border-top-color: #c5d2df; } td.x-date-mp-month a,td.x-date-mp-year a { color:#fff; } td.x-date-mp-month a:hover,td.x-date-mp-year a:hover { color:#fff; background-color: #7e5530; } td.x-date-mp-sel a { background-color: #e5872c; background-image: none; border-color:#864900; } .x-date-mp-ybtn a { background-image:url(../images/access/panel/tool-sprites.gif); } td.x-date-mp-sep { border-right-color:#c5d2df; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-access/dd.css000066400000000000000000000011771226600447100237760ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-dd-drag-ghost{ color:#000; font: normal 14px arial, helvetica, sans-serif; border-color: #ddd #bbb #bbb #ddd; background-color:#fff; } .x-dd-drop-nodrop .x-dd-drop-icon{ background-image: url(../images/default/dd/drop-no.gif); } .x-dd-drop-ok .x-dd-drop-icon{ background-image: url(../images/default/dd/drop-yes.gif); } .x-dd-drop-ok-add .x-dd-drop-icon{ background-image: url(../images/default/dd/drop-add.gif); } .x-view-selector { background-color:#c3daf9; border-color:#3399bb; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-access/debug.css000066400000000000000000000007531226600447100244740ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ #x-debug-browser .x-tree .x-tree-node a span { color:#222297; font-size:14px; font-family:"monotype","courier new",sans-serif; } #x-debug-browser .x-tree a i { color:#ff4545; font-style:normal; } #x-debug-browser .x-tree a em { color:#999; } #x-debug-browser .x-tree .x-tree-node .x-tree-selected a span{ background-color:#c3daf9; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-access/dialog.css000066400000000000000000000014471226600447100246460ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-window-dlg .ext-mb-text, .x-window-dlg .x-window-header-text { font-size:15px; } .x-window-dlg .ext-mb-textarea { font:normal 15px tahoma,arial,helvetica,sans-serif; } .x-window-dlg .x-msg-box-wait { background-image:url(../images/access/grid/loading.gif); } .x-window-dlg .ext-mb-info { background-image:url(../images/access/window/icon-info.gif); } .x-window-dlg .ext-mb-warning { background-image:url(../images/access/window/icon-warning.gif); } .x-window-dlg .ext-mb-question { background-image:url(../images/access/window/icon-question.gif); } .x-window-dlg .ext-mb-error { background-image:url(../images/access/window/icon-error.gif); } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-access/editor.css000066400000000000000000000005511226600447100246700ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-html-editor-wrap { border-color:#737B8C; background-color:#fff; } .x-html-editor-wrap iframe { background-color: #fff; } .x-html-editor-tb .x-btn-text { background-image:url(../images/access/editor/tb-sprite.gif); }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-access/form.css000066400000000000000000000071321226600447100243470ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-form-field { font:normal 15px tahoma, arial, helvetica, sans-serif; } .x-form-text, textarea.x-form-field{ color: #ffffff; background-color:#33373d; background-image:url(../images/access/form/text-bg.gif); border-color:#737b8c; border-width:2px; } .ext-webkit .x-form-text, .ext-webkit textarea.x-form-field{ border-width:2px; } .x-form-text, .ext-ie .x-form-file { height:26px; } .ext-strict .x-form-text { height:20px; } .x-form-select-one { background-color:#fff; border-color:#b5b8c8; } .x-form-check-group-label { border-bottom: 1px solid #99bbe8; color: #fff; } .x-editor .x-form-check-wrap { background-color:#fff; } .x-form-field-wrap .x-form-trigger{ background-image:url(../images/access/form/trigger.gif); border-bottom-color:#737b8c; border-bottom-width:2px; height:24px; width:20px; } .x-form-field-wrap .x-form-trigger.x-form-trigger-over{ border-bottom-color:#d97e27; } .x-form-field-wrap .x-form-trigger.x-form-trigger-click{ border-bottom-color:#c86e19; } .x-small-editor .x-form-field-wrap .x-form-trigger { height:24px; } .x-form-field-wrap .x-form-trigger-over { background-position:-20px 0; } .x-form-field-wrap .x-form-trigger-click { background-position:-40px 0; } .x-trigger-wrap-focus .x-form-trigger { background-position:-60px 0; } .x-trigger-wrap-focus .x-form-trigger-over { background-position:-80px 0; } .x-trigger-wrap-focus .x-form-trigger-click { background-position:-100px 0; } .x-form-field-wrap .x-form-date-trigger{ background-image: url(../images/access/form/date-trigger.gif); } .x-form-field-wrap .x-form-clear-trigger{ background-image: url(../images/access/form/clear-trigger.gif); } .x-form-field-wrap .x-form-search-trigger{ background-image: url(../images/access/form/search-trigger.gif); } .x-trigger-wrap-focus .x-form-trigger{ border-bottom-color:#737b8c; } .x-item-disabled .x-form-trigger-over{ border-bottom-color:#b5b8c8; } .x-item-disabled .x-form-trigger-click{ border-bottom-color:#b5b8c8; } .x-form-focus, textarea.x-form-focus{ border-color:#ff9c33; } .x-form-invalid, textarea.x-form-invalid, .ext-webkit .x-form-invalid, .ext-webkit textarea.x-form-invalid{ background-color:#15171a; background-image:url(../images/access/grid/invalid_line.gif); border-color:#c30; } /* .ext-safari .x-form-invalid{ background-color:#fee; border-color:#ff7870; } */ .x-form-inner-invalid, textarea.x-form-inner-invalid{ background-color:#fff; background-image:url(../images/access/grid/invalid_line.gif); } .x-form-grow-sizer { font:normal 15px tahoma, arial, helvetica, sans-serif; } .x-form-item { font:normal 15px tahoma, arial, helvetica, sans-serif; } .x-form-invalid-msg { color:#c0272b; font:normal 14px tahoma, arial, helvetica, sans-serif; background-image:url(../images/default/shared/warning.gif); } .x-form-empty-field { color:#dadadd; } .x-small-editor .x-form-text { height: 26px; } .x-small-editor .x-form-field { font:normal 14px arial, tahoma, helvetica, sans-serif; } .ext-safari .x-small-editor .x-form-field { font:normal 15px arial, tahoma, helvetica, sans-serif; } .x-form-invalid-icon { background-image:url(../images/access/form/exclamation.gif); height:25px; width:19px; background-position:center right; } .x-fieldset { border-color:#737B8C; } .x-fieldset legend { font:bold 14px tahoma, arial, helvetica, sans-serif; color:#fff; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-access/grid.css000066400000000000000000000146101226600447100243300ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-grid3 { background-color:#1f2933; } .x-grid-panel .x-panel-mc .x-panel-body { border-color:#223; } .x-grid3-hd-row td, .x-grid3-row td, .x-grid3-summary-row td{ font:normal 14px arial, tahoma, helvetica, sans-serif; } .x-grid3-hd-row td { border-left-color:#556; border-right-color:#223; } .x-grid-row-loading { background-color: #fff; background-image:url(../images/default/shared/loading-balls.gif); } .x-grid3-row { border:0 none; border-bottom:1px solid #111; border-right:1px solid #1a1a1c; } .x-grid3-row-alt{ background-color:#1b232b; } .x-grid3-row-over { background-color:#7e5530; } .x-grid3-resize-proxy { background-color:#777; } .x-grid3-resize-marker { background-color:#777; } .x-grid3-header{ background-color:#3b3f50; background-image:url(../images/access/grid/grid3-hrow.gif); } .x-grid3-header-pop { border-left-color:#d0d0d0; } .x-grid3-header-pop-inner { border-left-color:#eee; background-image:url(../images/default/grid/hd-pop.gif); } td.x-grid3-hd-over, td.sort-desc, td.sort-asc, td.x-grid3-hd-menu-open { border-left-color:#889; border-right-color:#445; } td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-asc .x-grid3-hd-inner, td.x-grid3-hd-menu-open .x-grid3-hd-inner { background-color:#4e628a; background-image:url(../images/access/grid/grid3-hrow-over.gif); } .x-grid3-cell-inner, .x-grid3-hd-inner { color:#fff; } .sort-asc .x-grid3-sort-icon { background-image: url(../images/access/grid/sort_asc.gif); width:15px; height:9px; margin-left:5px; } .sort-desc .x-grid3-sort-icon { background-image: url(../images/access/grid/sort_desc.gif); width:15px; height:9px; margin-left:5px; } .x-grid3-cell-text, .x-grid3-hd-text { color:#fff; } .x-grid3-split { background-image: url(../images/default/grid/grid-split.gif); } .x-grid3-hd-text { color:#fff; } .x-dd-drag-proxy .x-grid3-hd-inner{ background-color:#ebf3fd; background-image:url(../images/access/grid/grid3-hrow-over.gif); border-color:#aaccf6; } .col-move-top{ background-image:url(../images/default/grid/col-move-top.gif); } .col-move-bottom{ background-image:url(../images/default/grid/col-move-bottom.gif); } .x-grid3-row-selected { background-color: #e5872c !important; background-image: none; border-style: solid; } .x-grid3-row-selected .x-grid3-cell { color: #fff; } .x-grid3-cell-selected { background-color: #ffa340 !important; color:#fff; } .x-grid3-cell-selected span{ color:#fff !important; } .x-grid3-cell-selected .x-grid3-cell-text{ color:#fff; } .x-grid3-locked td.x-grid3-row-marker, .x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker{ background-color:#ebeadb !important; background-image:url(../images/default/grid/grid-hrow.gif) !important; color:#fff; border-top-color:#fff; border-right-color:#6fa0df !important; } .x-grid3-locked td.x-grid3-row-marker div, .x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker div{ color:#fff !important; } .x-grid3-dirty-cell { background-image:url(../images/access/grid/dirty.gif); } .x-grid3-topbar, .x-grid3-bottombar{ font:normal 14px arial, tahoma, helvetica, sans-serif; } .x-grid3-bottombar .x-toolbar{ border-top-color:#a9bfd3; } .x-props-grid .x-grid3-td-name .x-grid3-cell-inner{ background-image:url(../images/access/grid/grid3-special-col-bg.gif) !important; color:#fff !important; } .x-props-grid .x-grid3-td-value { color:#fff !important; } .x-props-grid .x-grid3-body .x-grid3-td-name{ background-color:#263240 !important; border-right-color:#223; } .xg-hmenu-sort-asc .x-menu-item-icon{ background-image: url(../images/access/grid/hmenu-asc.gif); } .xg-hmenu-sort-desc .x-menu-item-icon{ background-image: url(../images/access/grid/hmenu-desc.gif); } .xg-hmenu-lock .x-menu-item-icon{ background-image: url(../images/access/grid/hmenu-lock.gif); } .xg-hmenu-unlock .x-menu-item-icon{ background-image: url(../images/access/grid/hmenu-unlock.gif); } .x-grid3-hd-btn { background-color:#c2c9d0; background-image:url(../images/access/grid/grid3-hd-btn.gif); } .x-grid3-body .x-grid3-td-expander { background-image:url(../images/access/grid/grid3-special-col-bg.gif); } .x-grid3-row-expander { background-image:url(../images/access/grid/row-expand-sprite.gif); } .x-grid3-body .x-grid3-td-checker { background-image: url(../images/access/grid/grid3-special-col-bg.gif); } .x-grid3-row-checker, .x-grid3-hd-checker { background-image:url(../images/default/grid/row-check-sprite.gif); } .x-grid3-body .x-grid3-td-numberer { background-image:url(../images/access/grid/grid3-special-col-bg.gif); } .x-grid3-body .x-grid3-td-numberer .x-grid3-cell-inner { color:#fff; } .x-grid3-body .x-grid3-td-row-icon { background-image:url(../images/access/grid/grid3-special-col-bg.gif); } .x-grid3-body .x-grid3-row-selected .x-grid3-td-numberer, .x-grid3-body .x-grid3-row-selected .x-grid3-td-checker, .x-grid3-body .x-grid3-row-selected .x-grid3-td-expander { background-image:url(../images/access/grid/grid3-special-col-sel-bg.gif); } .x-grid3-check-col { background-image:url(../images/default/menu/unchecked.gif); } .x-grid3-check-col-on { background-image:url(../images/default/menu/checked.gif); } .x-grid-group, .x-grid-group-body, .x-grid-group-hd { zoom:1; } .x-grid-group-hd { border-bottom-color:#4e628a; } .x-grid-group-hd div.x-grid-group-title { background-image:url(../images/access/grid/group-collapse.gif); background-position:3px 6px; color:#ffd; font:bold 14px tahoma, arial, helvetica, sans-serif; } .x-grid-group-collapsed .x-grid-group-hd div.x-grid-group-title { background-image:url(../images/access/grid/group-expand.gif); } .x-group-by-icon { background-image:url(../images/default/grid/group-by.gif); } .x-cols-icon { background-image:url(../images/default/grid/columns.gif); } .x-show-groups-icon { background-image:url(../images/default/grid/group-by.gif); } .x-grid-empty { color:gray; font:normal 14px tahoma, arial, helvetica, sans-serif; } .x-grid-with-col-lines .x-grid3-row td.x-grid3-cell { border-right-color:#ededed; } .x-grid-with-col-lines .x-grid3-row{ border-top-color:#ededed; } .x-grid-with-col-lines .x-grid3-row-selected { border-top-color:#a3bae9; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-access/layout.css000066400000000000000000000024271226600447100247230ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-border-layout-ct { background-color:#3f4757; } .x-accordion-hd { color:#fff; font-weight:normal; background-image: url(../images/access/panel/light-hd.gif); } .x-layout-collapsed{ background-color:#323845; border-color:#1a1a1c; } .x-layout-collapsed-over{ background-color:#2d3440; } .x-layout-split-west .x-layout-mini { background-image:url(../images/default/layout/mini-left.gif); } .x-layout-split-east .x-layout-mini { background-image:url(../images/default/layout/mini-right.gif); } .x-layout-split-north .x-layout-mini { background-image:url(../images/default/layout/mini-top.gif); } .x-layout-split-south .x-layout-mini { background-image:url(../images/default/layout/mini-bottom.gif); } .x-layout-cmini-west .x-layout-mini { background-image:url(../images/default/layout/mini-right.gif); } .x-layout-cmini-east .x-layout-mini { background-image:url(../images/default/layout/mini-left.gif); } .x-layout-cmini-north .x-layout-mini { background-image:url(../images/default/layout/mini-bottom.gif); } .x-layout-cmini-south .x-layout-mini { background-image:url(../images/default/layout/mini-top.gif); } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-access/list-view.css000066400000000000000000000015561226600447100253330ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-list-header{ background-color:#393d4e; background-image:url(../images/access/toolbar/bg.gif); background-position:0 top; } .x-list-header-inner div em { border-left-color:#667; font:normal 14px arial, tahoma, helvetica, sans-serif; line-height: 14px; } .x-list-body-inner { background-color:#1B232B; } .x-list-body dt em { font:normal 14px arial, tahoma, helvetica, sans-serif; } .x-list-over { background-color:#7E5530; } .x-list-selected { background-color:#E5872C; } .x-list-resizer { border-left-color:#555; border-right-color:#555; } .x-list-header-inner em.sort-asc, .x-list-header-inner em.sort-desc { background-image:url(../images/access/grid/sort-hd.gif); border-color: #3e4e6c; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-access/menu.css000066400000000000000000000027511226600447100243520ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-menu { border-color:#222; background-color:#414551; background-image:url(../images/access/menu/menu.gif); } .x-menu-nosep { background-image:none; } .x-menu-list-item{ font:normal 14px tahoma,arial, sans-serif; } .x-menu-item-arrow{ background-image:url(../images/access/menu/menu-parent.gif); } .x-menu-sep { background-color:#223; border-bottom-color:#666; } a.x-menu-item { color:#fffff6; } .x-menu-item-active { background-color: #f09134; background-image: none; border-color:#b36427; } .x-menu-item-active a.x-menu-item { border-color:#b36427; } .x-menu-check-item .x-menu-item-icon{ background-image:url(../images/default/menu/unchecked.gif); } .x-menu-item-checked .x-menu-item-icon{ background-image:url(../images/default/menu/checked.gif); } .x-menu-item-checked .x-menu-group-item .x-menu-item-icon{ background-image:url(../images/access/menu/group-checked.gif); } .x-menu-group-item .x-menu-item-icon{ background-image:none; } .x-menu-plain { background-color:#fff !important; } .x-menu .x-date-picker{ border-color:#a3bad9; } .x-cycle-menu .x-menu-item-checked { border-color:#a3bae9 !important; background-color:#def8f6; } .x-menu-scroller-top { background-image:url(../images/default/layout/mini-top.gif); } .x-menu-scroller-bottom { background-image:url(../images/default/layout/mini-bottom.gif); } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-access/panel.css000066400000000000000000000036741226600447100245120ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-panel { border-color: #18181a; font-size: 14px; } .x-panel-header { color:#fff; font-weight:bold; font-size: 14px; font-family: tahoma,arial,verdana,sans-serif; border-color:#18181a; background-image: url(../images/access/panel/white-top-bottom.gif); } .x-panel-body { color: #fffff6; border-color:#18181a; background-color:#232d38; } .x-tab-panel .x-panel-body { color: #fffff6; border-color:#18181a; background-color:#1f2730; } .x-panel-bbar .x-toolbar, .x-panel-tbar .x-toolbar { border-color:#223; } .x-panel-tbar-noheader .x-toolbar, .x-panel-mc .x-panel-tbar .x-toolbar { border-top-color:#223; } .x-panel-body-noheader, .x-panel-mc .x-panel-body { border-top-color:#223; } .x-panel-tl .x-panel-header { color:#fff; font:bold 14px tahoma,arial,verdana,sans-serif; } .x-panel-tc { background-image: url(../images/access/panel/top-bottom.gif); } .x-panel-tl, .x-panel-tr, .x-panel-bl, .x-panel-br{ background-image: url(../images/access/panel/corners-sprite.gif); border-bottom-color:#222224; } .x-panel-bc { background-image: url(../images/access/panel/top-bottom.gif); } .x-panel-mc { font: normal 14px tahoma,arial,helvetica,sans-serif; background-color:#3f4757; } .x-panel-ml { background-image:url(../images/access/panel/left-right.gif); } .x-panel-mr { background-image: url(../images/access/panel/left-right.gif); } .x-tool { background-image:url(../images/access/panel/tool-sprites.gif); } .x-panel-ghost { background-color:#3f4757; } .x-panel-ghost ul { border-color:#18181a; } .x-panel-dd-spacer { border-color:#18181a; } .x-panel-fbar td,.x-panel-fbar span,.x-panel-fbar input,.x-panel-fbar div,.x-panel-fbar select,.x-panel-fbar label{ font:normal 14px arial,tahoma, helvetica, sans-serif; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-access/progress.css000066400000000000000000000014071226600447100252470ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-progress-wrap { border-color:#18181a; } .x-progress-inner { background-color:#232d38; background-image:none; } .x-progress-bar { background-color:#f39a00; background-image:url(../images/access/progress/progress-bg.gif); border-top-color:#a66900; border-bottom-color:#a66900; border-right-color:#ffb941; height: 20px !important; /* structural override for Accessibility Theme */ } .x-progress-text { font-size:14px; font-weight:bold; color:#fff; padding: 0 5px !important; /* structural override for Accessibility Theme */ } .x-progress-text-back { color:#aaa; line-height: 19px; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-access/qtips.css000066400000000000000000000023471226600447100245470ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-tip .x-tip-close{ background-image: url(../images/access/qtip/close.gif); } .x-tip .x-tip-tc, .x-tip .x-tip-tl, .x-tip .x-tip-tr, .x-tip .x-tip-bc, .x-tip .x-tip-bl, .x-tip .x-tip-br, .x-tip .x-tip-ml, .x-tip .x-tip-mr { background-image: url(../images/access/qtip/tip-sprite.gif); } .x-tip .x-tip-mc { font: normal 14px tahoma,arial,helvetica,sans-serif; } .x-tip .x-tip-ml { background-color: #fff; } .x-tip .x-tip-header-text { font: bold 14px tahoma,arial,helvetica,sans-serif; color:#ffd; } .x-tip .x-tip-body { font: normal 14px tahoma,arial,helvetica,sans-serif; color:#000; } .x-form-invalid-tip .x-tip-tc, .x-form-invalid-tip .x-tip-tl, .x-form-invalid-tip .x-tip-tr, .x-form-invalid-tip .x-tip-bc, .x-form-invalid-tip .x-tip-bl, .x-form-invalid-tip .x-tip-br, .x-form-invalid-tip .x-tip-ml, .x-form-invalid-tip .x-tip-mr { background-image: url(../images/default/form/error-tip-corners.gif); } .x-form-invalid-tip .x-tip-body { background-image:url(../images/access/form/exclamation.gif); } .x-tip-anchor { background-image:url(../images/access/qtip/tip-anchor-sprite.gif); } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-access/resizable.css000066400000000000000000000031101226600447100253540ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-resizable-handle { background-color:#fff; color: #000; } .x-resizable-over .x-resizable-handle-east, .x-resizable-pinned .x-resizable-handle-east, .x-resizable-over .x-resizable-handle-west, .x-resizable-pinned .x-resizable-handle-west { background-image:url(../images/access/sizer/e-handle.gif); } .x-resizable-over .x-resizable-handle-south, .x-resizable-pinned .x-resizable-handle-south, .x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north { background-image:url(../images/access/sizer/s-handle.gif); } .x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north{ background-image:url(../images/access/sizer/s-handle.gif); } .x-resizable-over .x-resizable-handle-southeast, .x-resizable-pinned .x-resizable-handle-southeast{ background-image:url(../images/access/sizer/se-handle.gif); } .x-resizable-over .x-resizable-handle-northwest, .x-resizable-pinned .x-resizable-handle-northwest{ background-image:url(../images/access/sizer/nw-handle.gif); } .x-resizable-over .x-resizable-handle-northeast, .x-resizable-pinned .x-resizable-handle-northeast{ background-image:url(../images/access/sizer/ne-handle.gif); } .x-resizable-over .x-resizable-handle-southwest, .x-resizable-pinned .x-resizable-handle-southwest{ background-image:url(../images/access/sizer/sw-handle.gif); } .x-resizable-proxy{ border-color:#3b5a82; } .x-resizable-overlay{ background-color:#fff; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-access/slider.css000066400000000000000000000011701226600447100246620ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-slider-horz, .x-slider-horz .x-slider-end, .x-slider-horz .x-slider-inner { background-image:url(../images/access/slider/slider-bg.png); } .x-slider-horz .x-slider-thumb { background-image:url(../images/access/slider/slider-thumb.png); } .x-slider-vert, .x-slider-vert .x-slider-end, .x-slider-vert .x-slider-inner { background-image:url(../images/access/slider/slider-v-bg.png); } .x-slider-vert .x-slider-thumb { background-image:url(../images/access/slider/slider-v-thumb.png); } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-access/tabs.css000066400000000000000000000052011226600447100243300ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-tab-panel-header, .x-tab-panel-footer { background-color:#e18325; border-color:#8db2e3; overflow:hidden; zoom:1; } .x-tab-panel-header, .x-tab-panel-footer { border-color:#222; } ul.x-tab-strip-top{ background-color:#343843; background-image: url(../images/access/tabs/tab-strip-bg.gif); border-bottom-color:#343d4e; } ul.x-tab-strip-bottom{ background-color:#343843; background-image: url(../images/access/tabs/tab-strip-btm-bg.gif); border-top-color:#343843; } .x-tab-panel-header-plain .x-tab-strip-spacer, .x-tab-panel-footer-plain .x-tab-strip-spacer { border-color:#222; background-color:#e18325; } .x-tab-strip span.x-tab-strip-text { font:normal 14px tahoma,arial,helvetica; color:#fff; } .x-tab-strip-over span.x-tab-strip-text { color:#fff; } .x-tab-strip-active span.x-tab-strip-text { color:#fff; font-weight:bold; } .x-tab-strip-disabled .x-tabs-text { color:#aaaaaa; } .x-tab-strip-top .x-tab-right, .x-tab-strip-top .x-tab-left, .x-tab-strip-top .x-tab-strip-inner{ background-image: url(../images/access/tabs/tabs-sprite.gif); } .x-tab-strip-bottom .x-tab-right { background-image: url(../images/access/tabs/tab-btm-inactive-right-bg.gif); } .x-tab-strip-bottom .x-tab-left { background-image: url(../images/access/tabs/tab-btm-inactive-left-bg.gif); } .x-tab-strip-bottom .x-tab-strip-active .x-tab-right { background-image: url(../images/access/tabs/tab-btm-right-bg.gif); } .x-tab-strip-bottom .x-tab-strip-active .x-tab-left { background-image: url(../images/access/tabs/tab-btm-left-bg.gif); } .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close { background-image:url(../images/access/tabs/tab-close.gif); } .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close:hover{ background-image:url(../images/access/tabs/tab-close.gif); } .x-tab-panel-body { border-color:#18181a; background-color:#fff; } .x-tab-panel-body-top { border-top: 0 none; } .x-tab-panel-body-bottom { border-bottom: 0 none; } .x-tab-scroller-left { background-image:url(../images/access/tabs/scroll-left.gif); border-bottom-color:#8db2e3; } .x-tab-scroller-left-over { background-position: 0 0; } .x-tab-scroller-left-disabled { background-position: -18px 0; opacity:.5; -moz-opacity:.5; filter:alpha(opacity=50); cursor:default; } .x-tab-scroller-right { background-image:url(../images/access/tabs/scroll-right.gif); border-bottom-color:#8db2e3; } .x-tab-panel-bbar .x-toolbar, .x-tab-panel-tbar .x-toolbar { border-color:#99bbe8; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-access/toolbar.css000066400000000000000000000060151226600447100250450ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-toolbar{ border-color:#18181a; background-color:#393d4e; background-image:url(../images/access/toolbar/bg.gif); } .x-toolbar td,.x-toolbar span,.x-toolbar input,.x-toolbar div,.x-toolbar select,.x-toolbar label{ font:normal 14px arial,tahoma, helvetica, sans-serif; } .x-toolbar .x-item-disabled { color:gray; } .x-toolbar .x-item-disabled * { color:gray; } .x-toolbar .x-btn-mc em.x-btn-split { background-image:url(../images/access/button/s-arrow-noline.gif); } .x-toolbar .x-btn-over .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split { background-image:url(../images/access/button/s-arrow-o.gif); } .x-toolbar .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/access/button/s-arrow-b-noline.gif); } .x-toolbar .x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/access/button/s-arrow-bo.gif); } .x-toolbar .xtb-sep { background-image: url(../images/access/grid/grid-blue-split.gif); } .x-toolbar .x-btn { padding-left:3px; padding-right:3px; } .x-toolbar .x-btn-mc em.x-btn-arrow { padding-right:10px; } .x-toolbar .x-btn-text-icon .x-btn-icon-small-left .x-btn-text { padding-left:18px !important; } .x-toolbar .x-btn-mc em.x-btn-split { padding-right:14px; } .x-tbar-page-first{ background-image: url(../images/access/grid/page-first.gif) !important; } .x-tbar-loading{ background-image: url(../images/access/grid/refresh.gif) !important; } .x-tbar-page-last{ background-image: url(../images/access/grid/page-last.gif) !important; } .x-tbar-page-next{ background-image: url(../images/access/grid/page-next.gif) !important; } .x-tbar-page-prev{ background-image: url(../images/access/grid/page-prev.gif) !important; } .x-item-disabled .x-tbar-loading{ background-image: url(../images/access/grid/loading.gif) !important; } .x-item-disabled .x-tbar-page-first{ background-image: url(../images/access/grid/page-first-disabled.gif) !important; } .x-item-disabled .x-tbar-page-last{ background-image: url(../images/access/grid/page-last-disabled.gif) !important; } .x-item-disabled .x-tbar-page-next{ background-image: url(../images/access/grid/page-next-disabled.gif) !important; } .x-item-disabled .x-tbar-page-prev{ background-image: url(../images/access/grid/page-prev-disabled.gif) !important; } .x-paging-info { color:#444; } .x-toolbar-more-icon { background-image: url(../images/access/toolbar/more.gif) !important; } .x-statusbar .x-status-busy { background-image: url(../images/access/grid/loading.gif); } .x-statusbar .x-status-text-panel { border-color: #99bbe8 #fff #fff #99bbe8; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-access/tree.css000066400000000000000000000071451226600447100243470ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-tree-node-expanded .x-tree-node-icon{ background-image:url(../images/access/tree/folder-open.gif); } .x-tree-node-leaf .x-tree-node-icon{ background-image:url(../images/default/tree/leaf.gif); } .x-tree-node-collapsed .x-tree-node-icon{ background-image:url(../images/access/tree/folder.gif); } .x-tree-node-loading .x-tree-node-icon{ background-image:url(../images/default/tree/loading.gif) !important; } .x-tree-node .x-tree-node-inline-icon { background-image: none; } .x-tree-node-loading a span{ font-style: italic; color:#444444; } .ext-ie .x-tree-node-el input { width:14px; height:14px; } .x-tree-lines .x-tree-elbow{ background-image:url(../images/access/tree/elbow.gif); } .x-tree-lines .x-tree-elbow-plus{ background-image:url(../images/access/tree/elbow-plus.gif); } .x-tree-lines .x-tree-elbow-minus{ background-image:url(../images/access/tree/elbow-minus.gif); } .x-tree-lines .x-tree-elbow-end{ background-image:url(../images/access/tree/elbow-end.gif); } .x-tree-lines .x-tree-elbow-end-plus{ background-image:url(../images/access/tree/elbow-end-plus.gif); } .x-tree-lines .x-tree-elbow-end-minus{ background-image:url(../images/access/tree/elbow-end-minus.gif); } .x-tree-lines .x-tree-elbow-line{ background-image:url(../images/access/tree/elbow-line.gif); } .x-tree-no-lines .x-tree-elbow-plus{ background-image:url(../images/access/tree/elbow-plus-nl.gif); } .x-tree-no-lines .x-tree-elbow-minus{ background-image:url(../images/access/tree/elbow-minus-nl.gif); } .x-tree-no-lines .x-tree-elbow-end-plus{ background-image:url(../images/access/tree/elbow-end-plus-nl.gif); } .x-tree-no-lines .x-tree-elbow-end-minus{ background-image:url(../images/access/tree/elbow-end-minus-nl.gif); } .x-tree-arrows .x-tree-elbow-plus{ background-image:url(../images/access/tree/arrows.gif); } .x-tree-arrows .x-tree-elbow-minus{ background-image:url(../images/access/tree/arrows.gif); } .x-tree-arrows .x-tree-elbow-end-plus{ background-image:url(../images/access/tree/arrows.gif); } .x-tree-arrows .x-tree-elbow-end-minus{ background-image:url(../images/access/tree/arrows.gif); } .x-tree-node{ color:#000; font: normal 14px arial, tahoma, helvetica, sans-serif; } .x-tree-node a, .x-dd-drag-ghost a{ color:#fff; } .x-tree-node a span, .x-dd-drag-ghost a span{ color:#fff; } .x-tree-node .x-tree-selected a, .x-dd-drag-ghost a{ color:#fff; } .x-tree-node .x-tree-selected a span, .x-dd-drag-ghost a span{ color:#fff; } .x-tree-node .x-tree-node-disabled a span{ color:gray !important; } .x-tree-node div.x-tree-drag-insert-below{ border-bottom-color:#36c; } .x-tree-node div.x-tree-drag-insert-above{ border-top-color:#36c; } .x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-below a{ border-bottom-color:#36c; } .x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-above a{ border-top-color:#36c; } .x-tree-node .x-tree-drag-append a span{ background-color:#ddd; border-color:gray; } .x-tree-node .x-tree-node-over { background-color: #7e5530; } .x-tree-node .x-tree-selected { background-color: #e5872c; } .x-tree-drop-ok-append .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-add.gif); } .x-tree-drop-ok-above .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-over.gif); } .x-tree-drop-ok-below .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-under.gif); } .x-tree-drop-ok-between .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-between.gif); } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-access/window.css000066400000000000000000000031771226600447100247200ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-window-proxy { background-color:#1f2833; border-color:#18181a; } .x-window-tl .x-window-header { color:#fff; font:bold 14px tahoma,arial,verdana,sans-serif; } .x-window-tc { background-image: url(../images/access/window/top-bottom.png); } .x-window-tl { background-image: url(../images/access/window/left-corners.png); } .x-window-tr { background-image: url(../images/access/window/right-corners.png); } .x-window-bc { background-image: url(../images/access/window/top-bottom.png); } .x-window-bl { background-image: url(../images/access/window/left-corners.png); } .x-window-br { background-image: url(../images/access/window/right-corners.png); } .x-window-mc { border-color:#18181a; font: normal 14px tahoma,arial,helvetica,sans-serif; background-color:#1f2833; } .x-window-ml { background-image: url(../images/access/window/left-right.png); } .x-window-mr { background-image: url(../images/access/window/left-right.png); } .x-window-maximized .x-window-tc { background-color:#fff; } .x-window-bbar .x-toolbar { border-top-color:#323945; } .x-panel-ghost .x-window-tl { border-bottom-color:#323945; } .x-panel-collapsed .x-window-tl { border-bottom-color:#323945; } .x-dlg-mask{ background-color:#ccc; } .x-window-plain .x-window-mc { background-color: #464f61; border-color: #636778; } .x-window-plain .x-window-body { color: #fffff6; border-color: #464F61; } body.x-body-masked .x-window-plain .x-window-mc { background-color: #464f61; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-gray/000077500000000000000000000000001226600447100223705ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-gray/borders.css000066400000000000000000000011141226600447100245370ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-panel-noborder .x-panel-header-noborder { border-bottom-color:#d0d0d0; } .x-panel-noborder .x-panel-tbar-noborder .x-toolbar { border-bottom-color:#d0d0d0; } .x-panel-noborder .x-panel-bbar-noborder .x-toolbar { border-top-color:#d0d0d0; } .x-tab-panel-bbar-noborder .x-toolbar { border-top-color:#d0d0d0; } .x-tab-panel-tbar-noborder .x-toolbar { border-bottom-color:#d0d0d0; } .x-border-layout-ct { background-color:#f0f0f0; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-gray/box.css000066400000000000000000000027711226600447100237010ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-box-tl { background-image: url(../images/default/box/corners.gif); } .x-box-tc { background-image: url(../images/default/box/tb.gif); } .x-box-tr { background-image: url(../images/default/box/corners.gif); } .x-box-ml { background-image: url(../images/default/box/l.gif); } .x-box-mc { background-color: #eee; background-image: url(../images/default/box/tb.gif); font-family: "Myriad Pro","Myriad Web","Tahoma","Helvetica","Arial",sans-serif; color: #393939; font-size: 12px; } .x-box-mc h3 { font-size: 14px; font-weight: bold; } .x-box-mr { background-image: url(../images/default/box/r.gif); } .x-box-bl { background-image: url(../images/default/box/corners.gif); } .x-box-bc { background-image: url(../images/default/box/tb.gif); } .x-box-br { background-image: url(../images/default/box/corners.gif); } .x-box-blue .x-box-bl, .x-box-blue .x-box-br, .x-box-blue .x-box-tl, .x-box-blue .x-box-tr { background-image: url(../images/default/box/corners-blue.gif); } .x-box-blue .x-box-bc, .x-box-blue .x-box-mc, .x-box-blue .x-box-tc { background-image: url(../images/default/box/tb-blue.gif); } .x-box-blue .x-box-mc { background-color: #c3daf9; } .x-box-blue .x-box-mc h3 { color: #17385b; } .x-box-blue .x-box-ml { background-image: url(../images/default/box/l-blue.gif); } .x-box-blue .x-box-mr { background-image: url(../images/default/box/r-blue.gif); } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-gray/button.css000066400000000000000000000044161226600447100244220ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-btn{ font:normal 11px tahoma, verdana, helvetica; } .x-btn button{ font:normal 11px arial,tahoma,verdana,helvetica; color:#333; } .x-btn em { font-style:normal; font-weight:normal; } .x-btn-tl, .x-btn-tr, .x-btn-tc, .x-btn-ml, .x-btn-mr, .x-btn-mc, .x-btn-bl, .x-btn-br, .x-btn-bc{ background-image:url(../images/gray/button/btn.gif); } .x-btn-click .x-btn-text, .x-btn-menu-active .x-btn-text, .x-btn-pressed .x-btn-text{ color:#000; } .x-btn-disabled *{ color:gray !important; } .x-btn-mc em.x-btn-arrow { background-image:url(../images/default/button/arrow.gif); } .x-btn-mc em.x-btn-split { background-image:url(../images/default/button/s-arrow.gif); } .x-btn-over .x-btn-mc em.x-btn-split, .x-btn-click .x-btn-mc em.x-btn-split, .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-btn-pressed .x-btn-mc em.x-btn-split { background-image:url(../images/gray/button/s-arrow-o.gif); } .x-btn-mc em.x-btn-arrow-bottom { background-image:url(../images/default/button/s-arrow-b-noline.gif); } .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/default/button/s-arrow-b.gif); } .x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-btn-click .x-btn-mc em.x-btn-split-bottom, .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-btn-pressed .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/gray/button/s-arrow-bo.gif); } .x-btn-group-header { color: #666; } .x-btn-group-tc { background-image: url(../images/gray/button/group-tb.gif); } .x-btn-group-tl { background-image: url(../images/gray/button/group-cs.gif); } .x-btn-group-tr { background-image: url(../images/gray/button/group-cs.gif); } .x-btn-group-bc { background-image: url(../images/gray/button/group-tb.gif); } .x-btn-group-bl { background-image: url(../images/gray/button/group-cs.gif); } .x-btn-group-br { background-image: url(../images/gray/button/group-cs.gif); } .x-btn-group-ml { background-image: url(../images/gray/button/group-lr.gif); } .x-btn-group-mr { background-image: url(../images/gray/button/group-lr.gif); } .x-btn-group-notitle .x-btn-group-tc { background-image: url(../images/gray/button/group-tb.gif); } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-gray/combo.css000066400000000000000000000015551226600447100242070ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-combo-list { border-color:#ccc; background-color:#ddd; font:normal 12px tahoma, arial, helvetica, sans-serif; } .x-combo-list-inner { background-color:#fff; } .x-combo-list-hd { font:bold 11px tahoma, arial, helvetica, sans-serif; color:#333; background-image: url(../images/default/layout/panel-title-light-bg.gif); border-bottom-color:#BCBCBC; } .x-resizable-pinned .x-combo-list-inner { border-bottom-color:#BEBEBE; } .x-combo-list-item { border-color:#fff; } .x-combo-list .x-combo-selected{ border-color:#777 !important; background-color:#f0f0f0; } .x-combo-list .x-toolbar { border-top-color:#BCBCBC; } .x-combo-list-small { font:normal 11px tahoma, arial, helvetica, sans-serif; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-gray/core.css000066400000000000000000000031261226600447100240340ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .ext-el-mask { background-color: #ccc; } .ext-el-mask-msg { border-color:#999; background-color:#ddd; background-image:url(../images/gray/panel/white-top-bottom.gif); background-position: 0 -1px; } .ext-el-mask-msg div { background-color: #eee; border-color:#d0d0d0; color:#222; font:normal 11px tahoma, arial, helvetica, sans-serif; } .x-mask-loading div { background-color:#fbfbfb; background-image:url(../images/default/grid/loading.gif); } .x-item-disabled { color: gray; } .x-item-disabled * { color: gray !important; } .x-splitbar-proxy { background-color: #aaa; } .x-color-palette a { border-color:#fff; } .x-color-palette a:hover, .x-color-palette a.x-color-palette-sel { border-color:#CFCFCF; background-color: #eaeaea; } /* .x-color-palette em:hover, .x-color-palette span:hover{ background-color: #eaeaea; } */ .x-color-palette em { border-color:#aca899; } .x-ie-shadow { background-color:#777; } .x-shadow .xsmc { background-image: url(../images/default/shadow-c.png); } .x-shadow .xsml, .x-shadow .xsmr { background-image: url(../images/default/shadow-lr.png); } .x-shadow .xstl, .x-shadow .xstc, .x-shadow .xstr, .x-shadow .xsbl, .x-shadow .xsbc, .x-shadow .xsbr{ background-image: url(../images/default/shadow.png); } .loading-indicator { font-size: 11px; background-image: url(../images/default/grid/loading.gif); } .x-spotlight { background-color: #ccc; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-gray/date-picker.css000066400000000000000000000054031226600447100252740ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-date-picker { border-color:#585858; background-color:#fff; } .x-date-middle,.x-date-left,.x-date-right { background-image: url(../images/gray/shared/hd-sprite.gif); color:#fff; font:bold 11px "sans serif", tahoma, verdana, helvetica; } .x-date-middle .x-btn .x-btn-text { color:#fff; } .x-date-middle .x-btn-mc em.x-btn-arrow { background-image:url(../images/gray/toolbar/btn-arrow-light.gif); } .x-date-right a { background-image: url(../images/gray/shared/right-btn.gif); } .x-date-left a{ background-image: url(../images/gray/shared/left-btn.gif); } .x-date-inner th { background-color:#D8D8D8; background-image: url(../images/gray/panel/white-top-bottom.gif); border-bottom-color:#AFAFAF; font:normal 10px arial, helvetica,tahoma,sans-serif; color:#595959; } .x-date-inner td { border-color:#fff; } .x-date-inner a { font:normal 11px arial, helvetica,tahoma,sans-serif; color:#000; } .x-date-inner .x-date-active{ color:#000; } .x-date-inner .x-date-selected a{ background-image: none; background-color:#D8D8D8; border-color:#DCDCDC; } .x-date-inner .x-date-today a{ border-color:darkred; } .x-date-inner .x-date-selected span{ font-weight:bold; } .x-date-inner .x-date-prevday a,.x-date-inner .x-date-nextday a { color:#aaa; } .x-date-bottom { border-top-color:#AFAFAF; background-color:#D8D8D8; background:#D8D8D8 url(../images/gray/panel/white-top-bottom.gif) 0 -2px; } .x-date-inner a:hover, .x-date-inner .x-date-disabled a:hover{ color:#000; background-color:#D8D8D8; } .x-date-inner .x-date-disabled a { background-color:#eee; color:#bbb; } .x-date-mmenu{ background-color:#eee !important; } .x-date-mmenu .x-menu-item { font-size:10px; color:#000; } .x-date-mp { background-color:#fff; } .x-date-mp td { font:normal 11px arial, helvetica,tahoma,sans-serif; } .x-date-mp-btns button { background-color:#4E565F; color:#fff; border-color:#C0C0C0 #434343 #434343 #C0C0C0; font:normal 11px arial, helvetica,tahoma,sans-serif; } .x-date-mp-btns { background-color:#D8D8D8; background:#D8D8D8 url(../images/gray/panel/white-top-bottom.gif) 0 -2px; } .x-date-mp-btns td { border-top-color:#AFAFAF; } td.x-date-mp-month a,td.x-date-mp-year a { color: #333; } td.x-date-mp-month a:hover,td.x-date-mp-year a:hover { color:#333; background-color:#FDFDFD; } td.x-date-mp-sel a { background-color:#D8D8D8; background:#D8D8D8 url(../images/gray/panel/white-top-bottom.gif) 0 -2px; border-color:#DCDCDC; } .x-date-mp-ybtn a { background-image:url(../images/gray/panel/tool-sprites.gif); } td.x-date-mp-sep { border-right-color:#D7D7D7; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-gray/dd.css000066400000000000000000000011761226600447100234760ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-dd-drag-ghost{ color:#000; font: normal 11px arial, helvetica, sans-serif; border-color: #ddd #bbb #bbb #ddd; background-color:#fff; } .x-dd-drop-nodrop .x-dd-drop-icon{ background-image: url(../images/default/dd/drop-no.gif); } .x-dd-drop-ok .x-dd-drop-icon{ background-image: url(../images/default/dd/drop-yes.gif); } .x-dd-drop-ok-add .x-dd-drop-icon{ background-image: url(../images/default/dd/drop-add.gif); } .x-view-selector { background-color:#D6D6D6; border-color:#888888; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-gray/debug.css000066400000000000000000000007531226600447100241750ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ #x-debug-browser .x-tree .x-tree-node a span { color:#222297; font-size:11px; font-family:"monotype","courier new",sans-serif; } #x-debug-browser .x-tree a i { color:#ff4545; font-style:normal; } #x-debug-browser .x-tree a em { color:#999; } #x-debug-browser .x-tree .x-tree-node .x-tree-selected a span{ background-color:#D5D5D5; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-gray/dialog.css000066400000000000000000000014401226600447100243400ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-window-dlg .ext-mb-text, .x-window-dlg .x-window-header-text { font-size:12px; } .x-window-dlg .ext-mb-textarea { font:normal 12px tahoma,arial,helvetica,sans-serif; } .x-window-dlg .x-msg-box-wait { background-image:url(../images/default/grid/loading.gif); } .x-window-dlg .ext-mb-info { background-image:url(../images/gray/window/icon-info.gif); } .x-window-dlg .ext-mb-warning { background-image:url(../images/gray/window/icon-warning.gif); } .x-window-dlg .ext-mb-question { background-image:url(../images/gray/window/icon-question.gif); } .x-window-dlg .ext-mb-error { background-image:url(../images/gray/window/icon-error.gif); } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-gray/editor.css000066400000000000000000000004601226600447100243700ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-html-editor-wrap { border-color:#BCBCBC; background-color:#fff; } .x-html-editor-tb .x-btn-text { background-image:url(../images/default/editor/tb-sprite.gif); } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-gray/form.css000066400000000000000000000047271226600447100240570ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-form-field{ font:normal 12px tahoma, arial, helvetica, sans-serif; } .x-form-text, textarea.x-form-field{ background-color:#fff; background-image:url(../images/default/form/text-bg.gif); border-color:#C1C1C1; } .x-form-select-one { background-color:#fff; border-color:#C1C1C1; } .x-form-check-group-label { border-bottom: 1px solid #d0d0d0; color: #333; } .x-editor .x-form-check-wrap { background-color:#fff; } .x-form-field-wrap .x-form-trigger{ background-image:url(../images/gray/form/trigger.gif); border-bottom-color:#b5b8c8; } .x-form-field-wrap .x-form-date-trigger{ background-image: url(../images/gray/form/date-trigger.gif); } .x-form-field-wrap .x-form-clear-trigger{ background-image: url(../images/gray/form/clear-trigger.gif); } .x-form-field-wrap .x-form-search-trigger{ background-image: url(../images/gray/form/search-trigger.gif); } .x-trigger-wrap-focus .x-form-trigger{ border-bottom-color: #777777; } .x-item-disabled .x-form-trigger-over{ border-bottom-color:#b5b8c8; } .x-item-disabled .x-form-trigger-click{ border-bottom-color:#b5b8c8; } .x-form-focus, textarea.x-form-focus{ border-color:#777777; } .x-form-invalid, textarea.x-form-invalid{ background-color:#fff; background-image:url(../images/default/grid/invalid_line.gif); border-color:#c30; } .ext-webkit .x-form-invalid{ background-color:#fee; border-color:#ff7870; } .x-form-inner-invalid, textarea.x-form-inner-invalid{ background-color:#fff; background-image:url(../images/default/grid/invalid_line.gif); } .x-form-grow-sizer { font:normal 12px tahoma, arial, helvetica, sans-serif; } .x-form-item { font:normal 12px tahoma, arial, helvetica, sans-serif; } .x-form-invalid-msg { color:#c0272b; font:normal 11px tahoma, arial, helvetica, sans-serif; background-image:url(../images/default/shared/warning.gif); } .x-form-empty-field { color:gray; } .x-small-editor .x-form-field { font:normal 11px arial, tahoma, helvetica, sans-serif; } .ext-webkit .x-small-editor .x-form-field { font:normal 12px arial, tahoma, helvetica, sans-serif; } .x-form-invalid-icon { background-image:url(../images/default/form/exclamation.gif); } .x-fieldset { border-color:#CCCCCC; } .x-fieldset legend { font:bold 11px tahoma, arial, helvetica, sans-serif; color:#777777; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-gray/grid.css000066400000000000000000000143211226600447100240300ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-grid3 { background-color:#fff; } .x-grid-panel .x-panel-mc .x-panel-body { border-color:#d0d0d0; } .x-grid3-row td, .x-grid3-summary-row td{ font:normal 11px/13px arial, tahoma, helvetica, sans-serif; } .x-grid3-hd-row td { font:normal 11px/15px arial, tahoma, helvetica, sans-serif; } .x-grid3-hd-row td { border-left-color:#eee; border-right-color:#d0d0d0; } .x-grid-row-loading { background-color: #fff; background-image:url(../images/default/shared/loading-balls.gif); } .x-grid3-row { border-color:#ededed; border-top-color:#fff; } .x-grid3-row-alt{ background-color:#fafafa; } .x-grid3-row-over { border-color:#ddd; background-color:#efefef; background-image:url(../images/default/grid/row-over.gif); } .x-grid3-resize-proxy { background-color:#777; } .x-grid3-resize-marker { background-color:#777; } .x-grid3-header{ background-color:#f9f9f9; background-image:url(../images/gray/grid/grid3-hrow2.gif); } .x-grid3-header-pop { border-left-color:#d0d0d0; } .x-grid3-header-pop-inner { border-left-color:#eee; background-image:url(../images/default/grid/hd-pop.gif); } td.x-grid3-hd-over, td.sort-desc, td.sort-asc, td.x-grid3-hd-menu-open { border-left-color:#ACACAC; border-right-color:#ACACAC; } td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-asc .x-grid3-hd-inner, td.x-grid3-hd-menu-open .x-grid3-hd-inner { background-color:#f9f9f9; background-image:url(../images/gray/grid/grid3-hrow-over2.gif); } .sort-asc .x-grid3-sort-icon { background-image: url(../images/gray/grid/sort_asc.gif); } .sort-desc .x-grid3-sort-icon { background-image: url(../images/gray/grid/sort_desc.gif); } .x-grid3-cell-text, .x-grid3-hd-text { color:#000; } .x-grid3-split { background-image: url(../images/default/grid/grid-split.gif); } .x-grid3-hd-text { color:#333; } .x-dd-drag-proxy .x-grid3-hd-inner{ background-color:#f9f9f9; background-image:url(../images/gray/grid/grid3-hrow-over2.gif); border-color:#ACACAC; } .col-move-top{ background-image:url(../images/gray/grid/col-move-top.gif); } .col-move-bottom{ background-image:url(../images/gray/grid/col-move-bottom.gif); } .x-grid3-row-selected { background-color:#CCCCCC !important; background-image: none; border-color:#ACACAC; } .x-grid3-cell-selected{ background-color: #CBCBCB !important; color:#000; } .x-grid3-cell-selected span{ color:#000 !important; } .x-grid3-cell-selected .x-grid3-cell-text{ color:#000; } .x-grid3-locked td.x-grid3-row-marker, .x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker{ background-color:#ebeadb !important; background-image:url(../images/default/grid/grid-hrow.gif) !important; color:#000; border-top-color:#fff; border-right-color:#6fa0df !important; } .x-grid3-locked td.x-grid3-row-marker div, .x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker div{ color:#333 !important; } .x-grid3-dirty-cell { background-image:url(../images/default/grid/dirty.gif); } .x-grid3-topbar, .x-grid3-bottombar{ font:normal 11px arial, tahoma, helvetica, sans-serif; } .x-grid3-bottombar .x-toolbar{ border-top-color:#a9bfd3; } .x-props-grid .x-grid3-td-name .x-grid3-cell-inner{ background-image:url(../images/default/grid/grid3-special-col-bg.gif) !important; color:#000 !important; } .x-props-grid .x-grid3-body .x-grid3-td-name{ background-color:#fff !important; border-right-color:#eee; } .xg-hmenu-sort-asc .x-menu-item-icon{ background-image: url(../images/default/grid/hmenu-asc.gif); } .xg-hmenu-sort-desc .x-menu-item-icon{ background-image: url(../images/default/grid/hmenu-desc.gif); } .xg-hmenu-lock .x-menu-item-icon{ background-image: url(../images/default/grid/hmenu-lock.gif); } .xg-hmenu-unlock .x-menu-item-icon{ background-image: url(../images/default/grid/hmenu-unlock.gif); } .x-grid3-hd-btn { background-color:#f9f9f9; background-image:url(../images/gray/grid/grid3-hd-btn.gif); } .x-grid3-body .x-grid3-td-expander { background-image:url(../images/default/grid/grid3-special-col-bg.gif); } .x-grid3-row-expander { background-image:url(../images/gray/grid/row-expand-sprite.gif); } .x-grid3-body .x-grid3-td-checker { background-image: url(../images/default/grid/grid3-special-col-bg.gif); } .x-grid3-row-checker, .x-grid3-hd-checker { background-image:url(../images/default/grid/row-check-sprite.gif); } .x-grid3-body .x-grid3-td-numberer { background-image:url(../images/default/grid/grid3-special-col-bg.gif); } .x-grid3-body .x-grid3-td-numberer .x-grid3-cell-inner { color:#444; } .x-grid3-body .x-grid3-td-row-icon { background-image:url(../images/default/grid/grid3-special-col-bg.gif); } .x-grid3-body .x-grid3-row-selected .x-grid3-td-numberer, .x-grid3-body .x-grid3-row-selected .x-grid3-td-checker, .x-grid3-body .x-grid3-row-selected .x-grid3-td-expander { background-image:url(../images/gray/grid/grid3-special-col-sel-bg.gif); } .x-grid3-check-col { background-image:url(../images/default/menu/unchecked.gif); } .x-grid3-check-col-on { background-image:url(../images/default/menu/checked.gif); } .x-grid-group, .x-grid-group-body, .x-grid-group-hd { zoom:1; } .x-grid-group-hd { border-bottom-color:#d0d0d0; } .x-grid-group-hd div.x-grid-group-title { background-image:url(../images/gray/grid/group-collapse.gif); color:#5F5F5F; font:bold 11px tahoma, arial, helvetica, sans-serif; } .x-grid-group-collapsed .x-grid-group-hd div.x-grid-group-title { background-image:url(../images/gray/grid/group-expand.gif); } .x-group-by-icon { background-image:url(../images/default/grid/group-by.gif); } .x-cols-icon { background-image:url(../images/default/grid/columns.gif); } .x-show-groups-icon { background-image:url(../images/default/grid/group-by.gif); } .x-grid-empty { color:gray; font:normal 11px tahoma, arial, helvetica, sans-serif; } .x-grid-with-col-lines .x-grid3-row td.x-grid3-cell { border-right-color:#ededed; } .x-grid-with-col-lines .x-grid3-row{ border-top-color:#ededed; } .x-grid-with-col-lines .x-grid3-row-selected { border-top-color:#B9B9B9; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-gray/layout.css000066400000000000000000000024221226600447100244170ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-border-layout-ct { background-color:#f0f0f0; } .x-accordion-hd { color:#222; font-weight:normal; background-image: url(../images/gray/panel/light-hd.gif); } .x-layout-collapsed{ background-color:#dfdfdf; border-color:#d0d0d0; } .x-layout-collapsed-over{ background-color:#e7e7e7; } .x-layout-split-west .x-layout-mini { background-image:url(../images/default/layout/mini-left.gif); } .x-layout-split-east .x-layout-mini { background-image:url(../images/default/layout/mini-right.gif); } .x-layout-split-north .x-layout-mini { background-image:url(../images/default/layout/mini-top.gif); } .x-layout-split-south .x-layout-mini { background-image:url(../images/default/layout/mini-bottom.gif); } .x-layout-cmini-west .x-layout-mini { background-image:url(../images/default/layout/mini-right.gif); } .x-layout-cmini-east .x-layout-mini { background-image:url(../images/default/layout/mini-left.gif); } .x-layout-cmini-north .x-layout-mini { background-image:url(../images/default/layout/mini-bottom.gif); } .x-layout-cmini-south .x-layout-mini { background-image:url(../images/default/layout/mini-top.gif); } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-gray/list-view.css000066400000000000000000000014041226600447100250240ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-list-header{ background-color:#f9f9f9; background-image:url(../images/gray/grid/grid3-hrow2.gif); } .x-list-header-inner div em { border-left-color:#ddd; font:normal 11px arial, tahoma, helvetica, sans-serif; } .x-list-body dt em { font:normal 11px arial, tahoma, helvetica, sans-serif; } .x-list-over { background-color:#eee; } .x-list-selected { background-color:#f0f0f0; } .x-list-resizer { border-left-color:#555; border-right-color:#555; } .x-list-header-inner em.sort-asc, .x-list-header-inner em.sort-desc { background-image:url(../images/gray/grid/sort-hd.gif); border-color: #d0d0d0; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-gray/menu.css000066400000000000000000000030441226600447100240470ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-menu { background-color:#f0f0f0; background-image:url(../images/default/menu/menu.gif); } .x-menu-floating{ border-color:#7D7D7D; } .x-menu-nosep { background-image:none; } .x-menu-list-item{ font:normal 11px arial,tahoma,sans-serif; } .x-menu-item-arrow{ background-image:url(../images/gray/menu/menu-parent.gif); } .x-menu-sep { background-color:#e0e0e0; border-bottom-color:#fff; } a.x-menu-item { color:#222; } .x-menu-item-active { background-image: url(../images/gray/menu/item-over.gif); background-color: #f1f1f1; border-color:#ACACAC; } .x-menu-item-active a.x-menu-item { border-color:#ACACAC; } .x-menu-check-item .x-menu-item-icon{ background-image:url(../images/default/menu/unchecked.gif); } .x-menu-item-checked .x-menu-item-icon{ background-image:url(../images/default/menu/checked.gif); } .x-menu-item-checked .x-menu-group-item .x-menu-item-icon{ background-image:url(../images/gray/menu/group-checked.gif); } .x-menu-group-item .x-menu-item-icon{ background-image:none; } .x-menu-plain { background-color:#fff !important; } .x-menu .x-date-picker{ border-color:#AFAFAF; } .x-cycle-menu .x-menu-item-checked { border-color:#B9B9B9 !important; background-color:#F1F1F1; } .x-menu-scroller-top { background-image:url(../images/default/layout/mini-top.gif); } .x-menu-scroller-bottom { background-image:url(../images/default/layout/mini-bottom.gif); }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-gray/panel.css000066400000000000000000000034541226600447100242070ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-panel { border-color: #d0d0d0; } .x-panel-header { color:#333; font-weight:bold; font-size: 11px; font-family: tahoma,arial,verdana,sans-serif; border-color:#d0d0d0; background-image: url(../images/gray/panel/white-top-bottom.gif); } .x-panel-body { border-color:#d0d0d0; background-color:#fff; } .x-panel-bbar .x-toolbar, .x-panel-tbar .x-toolbar { border-color:#d0d0d0; } .x-panel-tbar-noheader .x-toolbar, .x-panel-mc .x-panel-tbar .x-toolbar { border-top-color:#d0d0d0; } .x-panel-body-noheader, .x-panel-mc .x-panel-body { border-top-color:#d0d0d0; } .x-panel-tl .x-panel-header { color:#333; font:bold 11px tahoma,arial,verdana,sans-serif; } .x-panel-tc { background-image: url(../images/gray/panel/top-bottom.gif); } .x-panel-tl, .x-panel-tr, .x-panel-bl, .x-panel-br{ background-image: url(../images/gray/panel/corners-sprite.gif); border-bottom-color:#d0d0d0; } .x-panel-bc { background-image: url(../images/gray/panel/top-bottom.gif); } .x-panel-mc { font: normal 11px tahoma,arial,helvetica,sans-serif; background-color:#f1f1f1; } .x-panel-ml { background-color: #fff; background-image:url(../images/gray/panel/left-right.gif); } .x-panel-mr { background-image: url(../images/gray/panel/left-right.gif); } .x-tool { background-image:url(../images/gray/panel/tool-sprites.gif); } .x-panel-ghost { background-color:#f2f2f2; } .x-panel-ghost ul { border-color:#d0d0d0; } .x-panel-dd-spacer { border-color:#d0d0d0; } .x-panel-fbar td,.x-panel-fbar span,.x-panel-fbar input,.x-panel-fbar div,.x-panel-fbar select,.x-panel-fbar label{ font:normal 11px arial,tahoma, helvetica, sans-serif; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-gray/pivotgrid.css000066400000000000000000000014151226600447100251120ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-pivotgrid .x-grid3-header-offset table td { background: url(../images/gray/grid/grid3-hrow2.gif) repeat-x 50% 100%; border-left: 1px solid; border-right: 1px solid; border-left-color: #D0D0D0; border-right-color: #D0D0D0; } .x-pivotgrid .x-grid3-row-headers { background-color: #f9f9f9; } .x-pivotgrid .x-grid3-row-headers table td { background: #EEE url(../images/default/grid/grid3-rowheader.gif) repeat-x left top; border-left: 1px solid; border-right: 1px solid; border-left-color: #EEE; border-right-color: #D0D0D0; border-bottom: 1px solid; border-bottom-color: #D0D0D0; height: 18px; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-gray/progress.css000066400000000000000000000011541226600447100247470ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-progress-wrap { border-color:#8E8E8E; } .x-progress-inner { background-color:#E7E7E7; background-image:url(../images/gray/qtip/bg.gif); } .x-progress-bar { background-color:#BCBCBC; background-image:url(../images/gray/progress/progress-bg.gif); border-top-color:#E2E2E2; border-bottom-color:#A4A4A4; border-right-color:#A4A4A4; } .x-progress-text { font-size:11px; font-weight:bold; color:#fff; } .x-progress-text-back { color:#5F5F5F; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-gray/qtips.css000066400000000000000000000023411226600447100242420ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-tip .x-tip-close{ background-image: url(../images/gray/qtip/close.gif); } .x-tip .x-tip-tc, .x-tip .x-tip-tl, .x-tip .x-tip-tr, .x-tip .x-tip-bc, .x-tip .x-tip-bl, .x-tip .x-tip-br, .x-tip .x-tip-ml, .x-tip .x-tip-mr { background-image: url(../images/gray/qtip/tip-sprite.gif); } .x-tip .x-tip-mc { font: normal 11px tahoma,arial,helvetica,sans-serif; } .x-tip .x-tip-ml { background-color: #fff; } .x-tip .x-tip-header-text { font: bold 11px tahoma,arial,helvetica,sans-serif; color:#444; } .x-tip .x-tip-body { font: normal 11px tahoma,arial,helvetica,sans-serif; color:#444; } .x-form-invalid-tip .x-tip-tc, .x-form-invalid-tip .x-tip-tl, .x-form-invalid-tip .x-tip-tr, .x-form-invalid-tip .x-tip-bc, .x-form-invalid-tip .x-tip-bl, .x-form-invalid-tip .x-tip-br, .x-form-invalid-tip .x-tip-ml, .x-form-invalid-tip .x-tip-mr { background-image: url(../images/default/form/error-tip-corners.gif); } .x-form-invalid-tip .x-tip-body { background-image:url(../images/default/form/exclamation.gif); } .x-tip-anchor { background-image:url(../images/gray/qtip/tip-anchor-sprite.gif); }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-gray/resizable.css000066400000000000000000000030541226600447100250640ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-resizable-handle { background-color:#fff; } .x-resizable-over .x-resizable-handle-east, .x-resizable-pinned .x-resizable-handle-east, .x-resizable-over .x-resizable-handle-west, .x-resizable-pinned .x-resizable-handle-west { background-image:url(../images/gray/sizer/e-handle.gif); } .x-resizable-over .x-resizable-handle-south, .x-resizable-pinned .x-resizable-handle-south, .x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north { background-image:url(../images/gray/sizer/s-handle.gif); } .x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north{ background-image:url(../images/gray/sizer/s-handle.gif); } .x-resizable-over .x-resizable-handle-southeast, .x-resizable-pinned .x-resizable-handle-southeast{ background-image:url(../images/gray/sizer/se-handle.gif); } .x-resizable-over .x-resizable-handle-northwest, .x-resizable-pinned .x-resizable-handle-northwest{ background-image:url(../images/gray/sizer/nw-handle.gif); } .x-resizable-over .x-resizable-handle-northeast, .x-resizable-pinned .x-resizable-handle-northeast{ background-image:url(../images/gray/sizer/ne-handle.gif); } .x-resizable-over .x-resizable-handle-southwest, .x-resizable-pinned .x-resizable-handle-southwest{ background-image:url(../images/gray/sizer/sw-handle.gif); } .x-resizable-proxy{ border-color:#565656; } .x-resizable-overlay{ background-color:#fff; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-gray/slider.css000066400000000000000000000011661226600447100243700ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-slider-horz, .x-slider-horz .x-slider-end, .x-slider-horz .x-slider-inner { background-image:url(../images/default/slider/slider-bg.png); } .x-slider-horz .x-slider-thumb { background-image:url(../images/gray/slider/slider-thumb.png); } .x-slider-vert, .x-slider-vert .x-slider-end, .x-slider-vert .x-slider-inner { background-image:url(../images/default/slider/slider-v-bg.png); } .x-slider-vert .x-slider-thumb { background-image:url(../images/gray/slider/slider-v-thumb.png); } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-gray/tabs.css000066400000000000000000000055571226600447100240470ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-tab-panel-header, .x-tab-panel-footer { background-color: #eaeaea; border-color:#d0d0d0; overflow:hidden; zoom:1; } .x-tab-panel-header, .x-tab-panel-footer { border-color:#d0d0d0; } ul.x-tab-strip-top{ background-color:#dbdbdb; background-image: url(../images/gray/tabs/tab-strip-bg.gif); border-bottom-color:#d0d0d0; } ul.x-tab-strip-bottom{ background-color:#dbdbdb; background-image: url(../images/gray/tabs/tab-strip-btm-bg.gif); border-top-color:#d0d0d0; } .x-tab-panel-header-plain .x-tab-strip-spacer, .x-tab-panel-footer-plain .x-tab-strip-spacer { border-color:#d0d0d0; background-color: #eaeaea; } .x-tab-strip span.x-tab-strip-text { font:normal 11px tahoma,arial,helvetica; color:#333; } .x-tab-strip-over span.x-tab-strip-text { color:#111; } .x-tab-strip-active span.x-tab-strip-text { color:#333; font-weight:bold; } .x-tab-strip-disabled .x-tabs-text { color:#aaaaaa; } .x-tab-strip-top .x-tab-right, .x-tab-strip-top .x-tab-left, .x-tab-strip-top .x-tab-strip-inner{ background-image: url(../images/gray/tabs/tabs-sprite.gif); } .x-tab-strip-bottom .x-tab-right { background-image: url(../images/gray/tabs/tab-btm-inactive-right-bg.gif); } .x-tab-strip-bottom .x-tab-left { background-image: url(../images/gray/tabs/tab-btm-inactive-left-bg.gif); } .x-tab-strip-bottom .x-tab-strip-over .x-tab-left { background-image: url(../images/gray/tabs/tab-btm-over-left-bg.gif); } .x-tab-strip-bottom .x-tab-strip-over .x-tab-right { background-image: url(../images/gray/tabs/tab-btm-over-right-bg.gif); } .x-tab-strip-bottom .x-tab-strip-active .x-tab-right { background-image: url(../images/gray/tabs/tab-btm-right-bg.gif); } .x-tab-strip-bottom .x-tab-strip-active .x-tab-left { background-image: url(../images/gray/tabs/tab-btm-left-bg.gif); } .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close { background-image:url(../images/gray/tabs/tab-close.gif); } .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close:hover{ background-image:url(../images/gray/tabs/tab-close.gif); } .x-tab-panel-body { border-color:#d0d0d0; background-color:#fff; } .x-tab-panel-body-top { border-top: 0 none; } .x-tab-panel-body-bottom { border-bottom: 0 none; } .x-tab-scroller-left { background-image:url(../images/gray/tabs/scroll-left.gif); border-bottom-color:#d0d0d0; } .x-tab-scroller-left-over { background-position: 0 0; } .x-tab-scroller-left-disabled { background-position: -18px 0; opacity:.5; -moz-opacity:.5; filter:alpha(opacity=50); cursor:default; } .x-tab-scroller-right { background-image:url(../images/gray/tabs/scroll-right.gif); border-bottom-color:#d0d0d0; } .x-tab-panel-bbar .x-toolbar, .x-tab-panel-tbar .x-toolbar { border-color:#d0d0d0; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-gray/toolbar.css000066400000000000000000000050371226600447100245510ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-toolbar{ border-color:#d0d0d0; background-color:#f0f0f0; background-image:url(../images/gray/toolbar/bg.gif); } .x-toolbar td,.x-toolbar span,.x-toolbar input,.x-toolbar div,.x-toolbar select,.x-toolbar label{ font:normal 11px arial,tahoma, helvetica, sans-serif; } .x-toolbar .x-item-disabled { color:gray; } .x-toolbar .x-item-disabled * { color:gray; } .x-toolbar .x-btn-mc em.x-btn-split { background-image:url(../images/default/button/s-arrow-noline.gif); } .x-toolbar .x-btn-over .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split { background-image:url(../images/gray/button/s-arrow-o.gif); } .x-toolbar .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/default/button/s-arrow-b-noline.gif); } .x-toolbar .x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/gray/button/s-arrow-bo.gif); } .x-toolbar .xtb-sep { background-image: url(../images/default/grid/grid-split.gif); } .x-tbar-page-first{ background-image: url(../images/gray/grid/page-first.gif) !important; } .x-tbar-loading{ background-image: url(../images/gray/grid/refresh.gif) !important; } .x-tbar-page-last{ background-image: url(../images/gray/grid/page-last.gif) !important; } .x-tbar-page-next{ background-image: url(../images/gray/grid/page-next.gif) !important; } .x-tbar-page-prev{ background-image: url(../images/gray/grid/page-prev.gif) !important; } .x-item-disabled .x-tbar-loading{ background-image: url(../images/default/grid/loading.gif) !important; } .x-item-disabled .x-tbar-page-first{ background-image: url(../images/default/grid/page-first-disabled.gif) !important; } .x-item-disabled .x-tbar-page-last{ background-image: url(../images/default/grid/page-last-disabled.gif) !important; } .x-item-disabled .x-tbar-page-next{ background-image: url(../images/default/grid/page-next-disabled.gif) !important; } .x-item-disabled .x-tbar-page-prev{ background-image: url(../images/default/grid/page-prev-disabled.gif) !important; } .x-paging-info { color:#444; } .x-toolbar-more-icon { background-image: url(../images/gray/toolbar/more.gif) !important; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-gray/tree.css000066400000000000000000000067041226600447100240500ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-tree-node-expanded .x-tree-node-icon{ background-image:url(../images/default/tree/folder-open.gif); } .x-tree-node-leaf .x-tree-node-icon{ background-image:url(../images/default/tree/leaf.gif); } .x-tree-node-collapsed .x-tree-node-icon{ background-image:url(../images/default/tree/folder.gif); } .x-tree-node-loading .x-tree-node-icon{ background-image:url(../images/default/tree/loading.gif) !important; } .x-tree-node .x-tree-node-inline-icon { background-image: none; } .x-tree-node-loading a span{ font-style: italic; color:#444444; } .ext-ie .x-tree-node-el input { width:15px; height:15px; } .x-tree-lines .x-tree-elbow{ background-image:url(../images/default/tree/elbow.gif); } .x-tree-lines .x-tree-elbow-plus{ background-image:url(../images/default/tree/elbow-plus.gif); } .x-tree-lines .x-tree-elbow-minus{ background-image:url(../images/default/tree/elbow-minus.gif); } .x-tree-lines .x-tree-elbow-end{ background-image:url(../images/default/tree/elbow-end.gif); } .x-tree-lines .x-tree-elbow-end-plus{ background-image:url(../images/gray/tree/elbow-end-plus.gif); } .x-tree-lines .x-tree-elbow-end-minus{ background-image:url(../images/gray/tree/elbow-end-minus.gif); } .x-tree-lines .x-tree-elbow-line{ background-image:url(../images/default/tree/elbow-line.gif); } .x-tree-no-lines .x-tree-elbow-plus{ background-image:url(../images/default/tree/elbow-plus-nl.gif); } .x-tree-no-lines .x-tree-elbow-minus{ background-image:url(../images/default/tree/elbow-minus-nl.gif); } .x-tree-no-lines .x-tree-elbow-end-plus{ background-image:url(../images/gray/tree/elbow-end-plus-nl.gif); } .x-tree-no-lines .x-tree-elbow-end-minus{ background-image:url(../images/gray/tree/elbow-end-minus-nl.gif); } .x-tree-arrows .x-tree-elbow-plus{ background-image:url(../images/gray/tree/arrows.gif); } .x-tree-arrows .x-tree-elbow-minus{ background-image:url(../images/gray/tree/arrows.gif); } .x-tree-arrows .x-tree-elbow-end-plus{ background-image:url(../images/gray/tree/arrows.gif); } .x-tree-arrows .x-tree-elbow-end-minus{ background-image:url(../images/gray/tree/arrows.gif); } .x-tree-node{ color:#000; font: normal 11px arial, tahoma, helvetica, sans-serif; } .x-tree-node a, .x-dd-drag-ghost a{ color:#000; } .x-tree-node a span, .x-dd-drag-ghost a span{ color:#000; } .x-tree-node .x-tree-node-disabled a span{ color:gray !important; } .x-tree-node div.x-tree-drag-insert-below{ border-bottom-color:#36c; } .x-tree-node div.x-tree-drag-insert-above{ border-top-color:#36c; } .x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-below a{ border-bottom-color:#36c; } .x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-above a{ border-top-color:#36c; } .x-tree-node .x-tree-drag-append a span{ background-color:#ddd; border-color:gray; } .x-tree-node .x-tree-node-over { background-color: #eee; } .x-tree-node .x-tree-selected { background-color: #ddd; } .x-tree-drop-ok-append .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-add.gif); } .x-tree-drop-ok-above .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-over.gif); } .x-tree-drop-ok-below .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-under.gif); } .x-tree-drop-ok-between .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-between.gif); } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/theme-gray/window.css000066400000000000000000000032131226600447100244100ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-window-proxy { background-color:#fcfcfc; border-color:#d0d0d0; } .x-window-tl .x-window-header { color:#555; font:bold 11px tahoma,arial,verdana,sans-serif; } .x-window-tc { background-image: url(../images/gray/window/top-bottom.png); } .x-window-tl { background-image: url(../images/gray/window/left-corners.png); } .x-window-tr { background-image: url(../images/gray/window/right-corners.png); } .x-window-bc { background-image: url(../images/gray/window/top-bottom.png); } .x-window-bl { background-image: url(../images/gray/window/left-corners.png); } .x-window-br { background-image: url(../images/gray/window/right-corners.png); } .x-window-mc { border-color:#d0d0d0; font: normal 11px tahoma,arial,helvetica,sans-serif; background-color:#e8e8e8; } .x-window-ml { background-image: url(../images/gray/window/left-right.png); } .x-window-mr { background-image: url(../images/gray/window/left-right.png); } .x-window-maximized .x-window-tc { background-color:#fff; } .x-window-bbar .x-toolbar { border-top-color:#d0d0d0; } .x-panel-ghost .x-window-tl { border-bottom-color:#d0d0d0; } .x-panel-collapsed .x-window-tl { border-bottom-color:#d0d0d0; } .x-dlg-mask{ background-color:#ccc; } .x-window-plain .x-window-mc { background-color: #E8E8E8; border-color: #D0D0D0 #EEEEEE #EEEEEE #D0D0D0; } .x-window-plain .x-window-body { border-color: #EEEEEE #D0D0D0 #D0D0D0 #EEEEEE; } body.x-body-masked .x-window-plain .x-window-mc { background-color: #E4E4E4; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/visual/000077500000000000000000000000001226600447100216315ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/extjs/resources/css/visual/borders.css000066400000000000000000000010241226600447100240000ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-panel-noborder .x-panel-header-noborder { border-bottom-color:#99bbe8; } .x-panel-noborder .x-panel-tbar-noborder .x-toolbar { border-bottom-color:#99bbe8; } .x-panel-noborder .x-panel-bbar-noborder .x-toolbar { border-top-color:#99bbe8; } .x-tab-panel-bbar-noborder .x-toolbar { border-top-color:#99bbe8; } .x-tab-panel-tbar-noborder .x-toolbar { border-bottom-color:#99bbe8; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/visual/box.css000066400000000000000000000027701226600447100231410ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-box-tl { background-image: url(../images/default/box/corners.gif); } .x-box-tc { background-image: url(../images/default/box/tb.gif); } .x-box-tr { background-image: url(../images/default/box/corners.gif); } .x-box-ml { background-image: url(../images/default/box/l.gif); } .x-box-mc { background-color: #eee; background-image: url(../images/default/box/tb.gif); font-family: "Myriad Pro","Myriad Web","Tahoma","Helvetica","Arial",sans-serif; color: #393939; font-size: 12px; } .x-box-mc h3 { font-size: 14px; font-weight: bold; } .x-box-mr { background-image: url(../images/default/box/r.gif); } .x-box-bl { background-image: url(../images/default/box/corners.gif); } .x-box-bc { background-image: url(../images/default/box/tb.gif); } .x-box-br { background-image: url(../images/default/box/corners.gif); } .x-box-blue .x-box-bl, .x-box-blue .x-box-br, .x-box-blue .x-box-tl, .x-box-blue .x-box-tr { background-image: url(../images/default/box/corners-blue.gif); } .x-box-blue .x-box-bc, .x-box-blue .x-box-mc, .x-box-blue .x-box-tc { background-image: url(../images/default/box/tb-blue.gif); } .x-box-blue .x-box-mc { background-color: #c3daf9; } .x-box-blue .x-box-mc h3 { color: #17385b; } .x-box-blue .x-box-ml { background-image: url(../images/default/box/l-blue.gif); } .x-box-blue .x-box-mr { background-image: url(../images/default/box/r-blue.gif); }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/visual/button.css000066400000000000000000000044641226600447100236660ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-btn{ font:normal 11px tahoma, verdana, helvetica; } .x-btn button{ font:normal 11px arial,tahoma,verdana,helvetica; color:#333; } .x-btn em { font-style:normal; font-weight:normal; } .x-btn-tl, .x-btn-tr, .x-btn-tc, .x-btn-ml, .x-btn-mr, .x-btn-mc, .x-btn-bl, .x-btn-br, .x-btn-bc{ background-image:url(../images/default/button/btn.gif); } .x-btn-click .x-btn-text, .x-btn-menu-active .x-btn-text, .x-btn-pressed .x-btn-text{ color:#000; } .x-btn-disabled *{ color:gray !important; } .x-btn-mc em.x-btn-arrow { background-image:url(../images/default/button/arrow.gif); } .x-btn-mc em.x-btn-split { background-image:url(../images/default/button/s-arrow.gif); } .x-btn-over .x-btn-mc em.x-btn-split, .x-btn-click .x-btn-mc em.x-btn-split, .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-btn-pressed .x-btn-mc em.x-btn-split { background-image:url(../images/default/button/s-arrow-o.gif); } .x-btn-mc em.x-btn-arrow-bottom { background-image:url(../images/default/button/s-arrow-b-noline.gif); } .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/default/button/s-arrow-b.gif); } .x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-btn-click .x-btn-mc em.x-btn-split-bottom, .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-btn-pressed .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/default/button/s-arrow-bo.gif); } .x-btn-group-header { color: #3e6aaa; } .x-btn-group-tc { background-image: url(../images/default/button/group-tb.gif); } .x-btn-group-tl { background-image: url(../images/default/button/group-cs.gif); } .x-btn-group-tr { background-image: url(../images/default/button/group-cs.gif); } .x-btn-group-bc { background-image: url(../images/default/button/group-tb.gif); } .x-btn-group-bl { background-image: url(../images/default/button/group-cs.gif); } .x-btn-group-br { background-image: url(../images/default/button/group-cs.gif); } .x-btn-group-ml { background-image: url(../images/default/button/group-lr.gif); } .x-btn-group-mr { background-image: url(../images/default/button/group-lr.gif); } .x-btn-group-notitle .x-btn-group-tc { background-image: url(../images/default/button/group-tb.gif); }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/visual/combo.css000066400000000000000000000015711226600447100234460ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-combo-list { border-color:#98c0f4; background-color:#ddecfe; font:normal 12px tahoma, arial, helvetica, sans-serif; } .x-combo-list-inner { background-color:#fff; } .x-combo-list-hd { font:bold 11px tahoma, arial, helvetica, sans-serif; color:#15428b; background-image: url(../images/default/layout/panel-title-light-bg.gif); border-bottom-color:#98c0f4; } .x-resizable-pinned .x-combo-list-inner { border-bottom-color:#98c0f4; } .x-combo-list-item { border-color:#fff; } .x-combo-list .x-combo-selected{ border-color:#a3bae9 !important; background-color:#dfe8f6; } .x-combo-list .x-toolbar { border-top-color:#98c0f4; } .x-combo-list-small { font:normal 11px tahoma, arial, helvetica, sans-serif; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/visual/core.css000066400000000000000000000030641226600447100232760ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .ext-el-mask { background-color: #ccc; } .ext-el-mask-msg { border-color:#6593cf; background-color:#c3daf9; background-image:url(../images/default/box/tb-blue.gif); } .ext-el-mask-msg div { background-color: #eee; border-color:#a3bad9; color:#222; font:normal 11px tahoma, arial, helvetica, sans-serif; } .x-mask-loading div { background-color:#fbfbfb; background-image:url(../images/default/grid/loading.gif); } .x-item-disabled { color: gray; } .x-item-disabled * { color: gray !important; } .x-splitbar-proxy { background-color: #aaa; } .x-color-palette a { border-color:#fff; } .x-color-palette a:hover, .x-color-palette a.x-color-palette-sel { border-color:#8bb8f3; background-color: #deecfd; } /* .x-color-palette em:hover, .x-color-palette span:hover{ background-color: #deecfd; } */ .x-color-palette em { border-color:#aca899; } .x-ie-shadow { background-color:#777; } .x-shadow .xsmc { background-image: url(../images/default/shadow-c.png); } .x-shadow .xsml, .x-shadow .xsmr { background-image: url(../images/default/shadow-lr.png); } .x-shadow .xstl, .x-shadow .xstc, .x-shadow .xstr, .x-shadow .xsbl, .x-shadow .xsbc, .x-shadow .xsbr{ background-image: url(../images/default/shadow.png); } .loading-indicator { font-size: 11px; background-image: url(../images/default/grid/loading.gif); } .x-spotlight { background-color: #ccc; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/visual/date-picker.css000066400000000000000000000054171226600447100245420ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-date-picker { border-color: #1b376c; background-color:#fff; } .x-date-middle,.x-date-left,.x-date-right { background-image: url(../images/default/shared/hd-sprite.gif); color:#fff; font:bold 11px "sans serif", tahoma, verdana, helvetica; } .x-date-middle .x-btn .x-btn-text { color:#fff; } .x-date-middle .x-btn-mc em.x-btn-arrow { background-image:url(../images/default/toolbar/btn-arrow-light.gif); } .x-date-right a { background-image: url(../images/default/shared/right-btn.gif); } .x-date-left a{ background-image: url(../images/default/shared/left-btn.gif); } .x-date-inner th { background-color:#dfecfb; background-image:url(../images/default/shared/glass-bg.gif); border-bottom-color:#a3bad9; font:normal 10px arial, helvetica,tahoma,sans-serif; color:#233d6d; } .x-date-inner td { border-color:#fff; } .x-date-inner a { font:normal 11px arial, helvetica,tahoma,sans-serif; color:#000; } .x-date-inner .x-date-active{ color:#000; } .x-date-inner .x-date-selected a{ background-color:#dfecfb; background-image:url(../images/default/shared/glass-bg.gif); border-color:#8db2e3; } .x-date-inner .x-date-today a{ border-color:darkred; } .x-date-inner .x-date-selected span{ font-weight:bold; } .x-date-inner .x-date-prevday a,.x-date-inner .x-date-nextday a { color:#aaa; } .x-date-bottom { border-top-color:#a3bad9; background-color:#dfecfb; background-image:url(../images/default/shared/glass-bg.gif); } .x-date-inner a:hover, .x-date-inner .x-date-disabled a:hover{ color:#000; background-color:#ddecfe; } .x-date-inner .x-date-disabled a { background-color:#eee; color:#bbb; } .x-date-mmenu{ background-color:#eee !important; } .x-date-mmenu .x-menu-item { font-size:10px; color:#000; } .x-date-mp { background-color:#fff; } .x-date-mp td { font:normal 11px arial, helvetica,tahoma,sans-serif; } .x-date-mp-btns button { background-color:#083772; color:#fff; border-color: #3366cc #000055 #000055 #3366cc; font:normal 11px arial, helvetica,tahoma,sans-serif; } .x-date-mp-btns { background-color: #dfecfb; background-image: url(../images/default/shared/glass-bg.gif); } .x-date-mp-btns td { border-top-color: #c5d2df; } td.x-date-mp-month a,td.x-date-mp-year a { color:#15428b; } td.x-date-mp-month a:hover,td.x-date-mp-year a:hover { color:#15428b; background-color: #ddecfe; } td.x-date-mp-sel a { background-color: #dfecfb; background-image: url(../images/default/shared/glass-bg.gif); border-color:#8db2e3; } .x-date-mp-ybtn a { background-image:url(../images/default/panel/tool-sprites.gif); } td.x-date-mp-sep { border-right-color:#c5d2df; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/visual/dd.css000066400000000000000000000011761226600447100227370ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-dd-drag-ghost{ color:#000; font: normal 11px arial, helvetica, sans-serif; border-color: #ddd #bbb #bbb #ddd; background-color:#fff; } .x-dd-drop-nodrop .x-dd-drop-icon{ background-image: url(../images/default/dd/drop-no.gif); } .x-dd-drop-ok .x-dd-drop-icon{ background-image: url(../images/default/dd/drop-yes.gif); } .x-dd-drop-ok-add .x-dd-drop-icon{ background-image: url(../images/default/dd/drop-add.gif); } .x-view-selector { background-color:#c3daf9; border-color:#3399bb; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/visual/debug.css000066400000000000000000000007521226600447100234350ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ #x-debug-browser .x-tree .x-tree-node a span { color:#222297; font-size:11px; font-family:"monotype","courier new",sans-serif; } #x-debug-browser .x-tree a i { color:#ff4545; font-style:normal; } #x-debug-browser .x-tree a em { color:#999; } #x-debug-browser .x-tree .x-tree-node .x-tree-selected a span{ background-color:#c3daf9; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/visual/dialog.css000066400000000000000000000014531226600447100236050ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-window-dlg .ext-mb-text, .x-window-dlg .x-window-header-text { font-size:12px; } .x-window-dlg .ext-mb-textarea { font:normal 12px tahoma,arial,helvetica,sans-serif; } .x-window-dlg .x-msg-box-wait { background-image:url(../images/default/grid/loading.gif); } .x-window-dlg .ext-mb-info { background-image:url(../images/default/window/icon-info.gif); } .x-window-dlg .ext-mb-warning { background-image:url(../images/default/window/icon-warning.gif); } .x-window-dlg .ext-mb-question { background-image:url(../images/default/window/icon-question.gif); } .x-window-dlg .ext-mb-error { background-image:url(../images/default/window/icon-error.gif); }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/visual/editor.css000066400000000000000000000004571226600447100236370ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-html-editor-wrap { border-color:#a9bfd3; background-color:#fff; } .x-html-editor-tb .x-btn-text { background-image:url(../images/default/editor/tb-sprite.gif); }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/visual/form.css000066400000000000000000000052341226600447100233120ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-form-field { font:normal 12px tahoma, arial, helvetica, sans-serif; } .x-form-text, textarea.x-form-field { background-color:#fff; background-image:url(../images/default/form/text-bg.gif); border-color:#b5b8c8; } .x-form-select-one { background-color:#fff; border-color:#b5b8c8; } .x-form-check-group-label { border-bottom: 1px solid #99bbe8; color: #15428b; } .x-editor .x-form-check-wrap { background-color:#fff; } .x-form-field-wrap .x-form-trigger { background-image:url(../images/default/form/trigger.gif); border-bottom-color:#b5b8c8; } .x-form-field-wrap .x-form-date-trigger { background-image: url(../images/default/form/date-trigger.gif); } .x-form-field-wrap .x-form-clear-trigger { background-image: url(../images/default/form/clear-trigger.gif); } .x-form-field-wrap .x-form-search-trigger { background-image: url(../images/default/form/search-trigger.gif); } .x-trigger-wrap-focus .x-form-trigger { border-bottom-color:#7eadd9; } .x-item-disabled .x-form-trigger-over { border-bottom-color:#b5b8c8; } .x-item-disabled .x-form-trigger-click { border-bottom-color:#b5b8c8; } .x-form-focus, textarea.x-form-focus { border-color:#7eadd9; } .x-form-invalid, textarea.x-form-invalid { background-color:#fff; background-image:url(../images/default/grid/invalid_line.gif); border-color:#c30; } .x-form-invalid.x-form-composite { border: none; background-image: none; } .x-form-invalid.x-form-composite .x-form-invalid { background-color:#fff; background-image:url(../images/default/grid/invalid_line.gif); border-color:#c30; } .x-form-inner-invalid, textarea.x-form-inner-invalid { background-color:#fff; background-image:url(../images/default/grid/invalid_line.gif); } .x-form-grow-sizer { font:normal 12px tahoma, arial, helvetica, sans-serif; } .x-form-item { font:normal 12px tahoma, arial, helvetica, sans-serif; } .x-form-invalid-msg { color:#c0272b; font:normal 11px tahoma, arial, helvetica, sans-serif; background-image:url(../images/default/shared/warning.gif); } .x-form-empty-field { color:gray; } .x-small-editor .x-form-field { font:normal 11px arial, tahoma, helvetica, sans-serif; } .ext-webkit .x-small-editor .x-form-field { font:normal 11px arial, tahoma, helvetica, sans-serif; } .x-form-invalid-icon { background-image:url(../images/default/form/exclamation.gif); } .x-fieldset { border-color:#b5b8c8; } .x-fieldset legend { font:bold 11px tahoma, arial, helvetica, sans-serif; color:#15428b; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/visual/grid.css000066400000000000000000000144241226600447100232750ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-grid3 { background-color:#fff; } .x-grid-panel .x-panel-mc .x-panel-body { border-color:#99bbe8; } .x-grid3-row td, .x-grid3-summary-row td{ font:normal 11px/13px arial, tahoma, helvetica, sans-serif; } .x-grid3-hd-row td { font:normal 11px/15px arial, tahoma, helvetica, sans-serif; } .x-grid3-hd-row td { border-left-color:#eee; border-right-color:#d0d0d0; } .x-grid-row-loading { background-color: #fff; background-image:url(../images/default/shared/loading-balls.gif); } .x-grid3-row { border-color:#ededed; border-top-color:#fff; } .x-grid3-row-alt{ background-color:#fafafa; } .x-grid3-row-over { border-color:#ddd; background-color:#efefef; background-image:url(../images/default/grid/row-over.gif); } .x-grid3-resize-proxy { background-color:#777; } .x-grid3-resize-marker { background-color:#777; } .x-grid3-header{ background-color:#f9f9f9; background-image:url(../images/default/grid/grid3-hrow.gif); } .x-grid3-header-pop { border-left-color:#d0d0d0; } .x-grid3-header-pop-inner { border-left-color:#eee; background-image:url(../images/default/grid/hd-pop.gif); } td.x-grid3-hd-over, td.sort-desc, td.sort-asc, td.x-grid3-hd-menu-open { border-left-color:#aaccf6; border-right-color:#aaccf6; } td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-asc .x-grid3-hd-inner, td.x-grid3-hd-menu-open .x-grid3-hd-inner { background-color:#ebf3fd; background-image:url(../images/default/grid/grid3-hrow-over.gif); } .sort-asc .x-grid3-sort-icon { background-image: url(../images/default/grid/sort_asc.gif); } .sort-desc .x-grid3-sort-icon { background-image: url(../images/default/grid/sort_desc.gif); } .x-grid3-cell-text, .x-grid3-hd-text { color:#000; } .x-grid3-split { background-image: url(../images/default/grid/grid-split.gif); } .x-grid3-hd-text { color:#15428b; } .x-dd-drag-proxy .x-grid3-hd-inner{ background-color:#ebf3fd; background-image:url(../images/default/grid/grid3-hrow-over.gif); border-color:#aaccf6; } .col-move-top{ background-image:url(../images/default/grid/col-move-top.gif); } .col-move-bottom{ background-image:url(../images/default/grid/col-move-bottom.gif); } td.grid-hd-group-cell { background: url(../images/default/grid/grid3-hrow.gif) repeat-x bottom; } .x-grid3-row-selected { background-color: #dfe8f6 !important; background-image: none; border-color:#a3bae9; } .x-grid3-cell-selected{ background-color: #b8cfee !important; color:#000; } .x-grid3-cell-selected span{ color:#000 !important; } .x-grid3-cell-selected .x-grid3-cell-text{ color:#000; } .x-grid3-locked td.x-grid3-row-marker, .x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker{ background-color:#ebeadb !important; background-image:url(../images/default/grid/grid-hrow.gif) !important; color:#000; border-top-color:#fff; border-right-color:#6fa0df !important; } .x-grid3-locked td.x-grid3-row-marker div, .x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker div{ color:#15428b !important; } .x-grid3-dirty-cell { background-image:url(../images/default/grid/dirty.gif); } .x-grid3-topbar, .x-grid3-bottombar{ font:normal 11px arial, tahoma, helvetica, sans-serif; } .x-grid3-bottombar .x-toolbar{ border-top-color:#a9bfd3; } .x-props-grid .x-grid3-td-name .x-grid3-cell-inner{ background-image:url(../images/default/grid/grid3-special-col-bg.gif) !important; color:#000 !important; } .x-props-grid .x-grid3-body .x-grid3-td-name{ background-color:#fff !important; border-right-color:#eee; } .xg-hmenu-sort-asc .x-menu-item-icon{ background-image: url(../images/default/grid/hmenu-asc.gif); } .xg-hmenu-sort-desc .x-menu-item-icon{ background-image: url(../images/default/grid/hmenu-desc.gif); } .xg-hmenu-lock .x-menu-item-icon{ background-image: url(../images/default/grid/hmenu-lock.gif); } .xg-hmenu-unlock .x-menu-item-icon{ background-image: url(../images/default/grid/hmenu-unlock.gif); } .x-grid3-hd-btn { background-color:#c3daf9; background-image:url(../images/default/grid/grid3-hd-btn.gif); } .x-grid3-body .x-grid3-td-expander { background-image:url(../images/default/grid/grid3-special-col-bg.gif); } .x-grid3-row-expander { background-image:url(../images/default/grid/row-expand-sprite.gif); } .x-grid3-body .x-grid3-td-checker { background-image: url(../images/default/grid/grid3-special-col-bg.gif); } .x-grid3-row-checker, .x-grid3-hd-checker { background-image:url(../images/default/grid/row-check-sprite.gif); } .x-grid3-body .x-grid3-td-numberer { background-image:url(../images/default/grid/grid3-special-col-bg.gif); } .x-grid3-body .x-grid3-td-numberer .x-grid3-cell-inner { color:#444; } .x-grid3-body .x-grid3-td-row-icon { background-image:url(../images/default/grid/grid3-special-col-bg.gif); } .x-grid3-body .x-grid3-row-selected .x-grid3-td-numberer, .x-grid3-body .x-grid3-row-selected .x-grid3-td-checker, .x-grid3-body .x-grid3-row-selected .x-grid3-td-expander { background-image:url(../images/default/grid/grid3-special-col-sel-bg.gif); } .x-grid3-check-col { background-image:url(../images/default/menu/unchecked.gif); } .x-grid3-check-col-on { background-image:url(../images/default/menu/checked.gif); } .x-grid-group, .x-grid-group-body, .x-grid-group-hd { zoom:1; } .x-grid-group-hd { border-bottom-color:#99bbe8; } .x-grid-group-hd div.x-grid-group-title { background-image:url(../images/default/grid/group-collapse.gif); color:#3764a0; font:bold 11px tahoma, arial, helvetica, sans-serif; } .x-grid-group-collapsed .x-grid-group-hd div.x-grid-group-title { background-image:url(../images/default/grid/group-expand.gif); } .x-group-by-icon { background-image:url(../images/default/grid/group-by.gif); } .x-cols-icon { background-image:url(../images/default/grid/columns.gif); } .x-show-groups-icon { background-image:url(../images/default/grid/group-by.gif); } .x-grid-empty { color:gray; font:normal 11px tahoma, arial, helvetica, sans-serif; } .x-grid-with-col-lines .x-grid3-row td.x-grid3-cell { border-right-color:#ededed; } .x-grid-with-col-lines .x-grid3-row-selected { border-top-color:#a3bae9; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/visual/layout.css000066400000000000000000000024241226600447100236620ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-border-layout-ct { background-color:#dfe8f6; } .x-accordion-hd { color:#222; font-weight:normal; background-image: url(../images/default/panel/light-hd.gif); } .x-layout-collapsed{ background-color:#d2e0f2; border-color:#98c0f4; } .x-layout-collapsed-over{ background-color:#d9e8fb; } .x-layout-split-west .x-layout-mini { background-image:url(../images/default/layout/mini-left.gif); } .x-layout-split-east .x-layout-mini { background-image:url(../images/default/layout/mini-right.gif); } .x-layout-split-north .x-layout-mini { background-image:url(../images/default/layout/mini-top.gif); } .x-layout-split-south .x-layout-mini { background-image:url(../images/default/layout/mini-bottom.gif); } .x-layout-cmini-west .x-layout-mini { background-image:url(../images/default/layout/mini-right.gif); } .x-layout-cmini-east .x-layout-mini { background-image:url(../images/default/layout/mini-left.gif); } .x-layout-cmini-north .x-layout-mini { background-image:url(../images/default/layout/mini-bottom.gif); } .x-layout-cmini-south .x-layout-mini { background-image:url(../images/default/layout/mini-top.gif); }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/visual/list-view.css000066400000000000000000000014101226600447100242620ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-list-header{ background-color:#f9f9f9; background-image:url(../images/default/grid/grid3-hrow.gif); } .x-list-header-inner div em { border-left-color:#ddd; font:normal 11px arial, tahoma, helvetica, sans-serif; } .x-list-body dt em { font:normal 11px arial, tahoma, helvetica, sans-serif; } .x-list-over { background-color:#eee; } .x-list-selected { background-color:#dfe8f6; } .x-list-resizer { border-left-color:#555; border-right-color:#555; } .x-list-header-inner em.sort-asc, .x-list-header-inner em.sort-desc { background-image:url(../images/default/grid/sort-hd.gif); border-color: #99bbe8; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/visual/menu.css000066400000000000000000000032241226600447100233100ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-menu { background-color:#f0f0f0; background-image:url(../images/default/menu/menu.gif); } .x-menu-floating{ border-color:#718bb7; } .x-menu-nosep { background-image:none; } .x-menu-list-item{ font:normal 11px arial,tahoma,sans-serif; } .x-menu-item-arrow{ background-image:url(../images/default/menu/menu-parent.gif); } .x-menu-sep { background-color:#e0e0e0; border-bottom-color:#fff; } a.x-menu-item { color:#222; } .x-menu-item-active { background-image: url(../images/default/menu/item-over.gif); background-color: #dbecf4; border-color:#aaccf6; } .x-menu-item-active a.x-menu-item { border-color:#aaccf6; } .x-menu-check-item .x-menu-item-icon{ background-image:url(../images/default/menu/unchecked.gif); } .x-menu-item-checked .x-menu-item-icon{ background-image:url(../images/default/menu/checked.gif); } .x-menu-item-checked .x-menu-group-item .x-menu-item-icon{ background-image:url(../images/default/menu/group-checked.gif); } .x-menu-group-item .x-menu-item-icon{ background-image:none; } .x-menu-plain { background-color:#f0f0f0 !important; background-image: none; } .x-date-menu, .x-color-menu{ background-color: #fff !important; } .x-menu .x-date-picker{ border-color:#a3bad9; } .x-cycle-menu .x-menu-item-checked { border-color:#a3bae9 !important; background-color:#def8f6; } .x-menu-scroller-top { background-image:url(../images/default/layout/mini-top.gif); } .x-menu-scroller-bottom { background-image:url(../images/default/layout/mini-bottom.gif); } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/visual/panel.css000066400000000000000000000035071226600447100234470ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-panel { border-color: #99bbe8; } .x-panel-header { color:#15428b; font-weight:bold; font-size: 11px; font-family: tahoma,arial,verdana,sans-serif; border-color:#99bbe8; background-image: url(../images/default/panel/white-top-bottom.gif); } .x-panel-body { border-color:#99bbe8; background-color:#fff; } .x-panel-bbar .x-toolbar, .x-panel-tbar .x-toolbar { border-color:#99bbe8; } .x-panel-tbar-noheader .x-toolbar, .x-panel-mc .x-panel-tbar .x-toolbar { border-top-color:#99bbe8; } .x-panel-body-noheader, .x-panel-mc .x-panel-body { border-top-color:#99bbe8; } .x-panel-tl .x-panel-header { color:#15428b; font:bold 11px tahoma,arial,verdana,sans-serif; } .x-panel-tc { background-image: url(../images/default/panel/top-bottom.gif); } .x-panel-tl, .x-panel-tr, .x-panel-bl, .x-panel-br{ background-image: url(../images/default/panel/corners-sprite.gif); border-bottom-color:#99bbe8; } .x-panel-bc { background-image: url(../images/default/panel/top-bottom.gif); } .x-panel-mc { font: normal 11px tahoma,arial,helvetica,sans-serif; background-color:#dfe8f6; } .x-panel-ml { background-color: #fff; background-image:url(../images/default/panel/left-right.gif); } .x-panel-mr { background-image: url(../images/default/panel/left-right.gif); } .x-tool { background-image:url(../images/default/panel/tool-sprites.gif); } .x-panel-ghost { background-color:#cbddf3; } .x-panel-ghost ul { border-color:#99bbe8; } .x-panel-dd-spacer { border-color:#99bbe8; } .x-panel-fbar td,.x-panel-fbar span,.x-panel-fbar input,.x-panel-fbar div,.x-panel-fbar select,.x-panel-fbar label{ font:normal 11px arial,tahoma, helvetica, sans-serif; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/visual/pivotgrid.css000066400000000000000000000014141226600447100243520ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-pivotgrid .x-grid3-header-offset table td { background: url(../images/default/grid/grid3-hrow.gif) repeat-x 50% 100%; border-left: 1px solid; border-right: 1px solid; border-left-color: #EEE; border-right-color: #D0D0D0; } .x-pivotgrid .x-grid3-row-headers { background-color: #f9f9f9; } .x-pivotgrid .x-grid3-row-headers table td { background: #EEE url(../images/default/grid/grid3-rowheader.gif) repeat-x left top; border-left: 1px solid; border-right: 1px solid; border-left-color: #EEE; border-right-color: #D0D0D0; border-bottom: 1px solid; border-bottom-color: #D0D0D0; height: 18px; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/visual/progress.css000066400000000000000000000011611226600447100242060ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-progress-wrap { border-color:#6593cf; } .x-progress-inner { background-color:#e0e8f3; background-image:url(../images/default/qtip/bg.gif); } .x-progress-bar { background-color:#9cbfee; background-image:url(../images/default/progress/progress-bg.gif); border-top-color:#d1e4fd; border-bottom-color:#7fa9e4; border-right-color:#7fa9e4; } .x-progress-text { font-size:11px; font-weight:bold; color:#fff; } .x-progress-text-back { color:#396095; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/visual/qtips.css000066400000000000000000000023521226600447100235050ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-tip .x-tip-close{ background-image: url(../images/default/qtip/close.gif); } .x-tip .x-tip-tc, .x-tip .x-tip-tl, .x-tip .x-tip-tr, .x-tip .x-tip-bc, .x-tip .x-tip-bl, .x-tip .x-tip-br, .x-tip .x-tip-ml, .x-tip .x-tip-mr { background-image: url(../images/default/qtip/tip-sprite.gif); } .x-tip .x-tip-mc { font: normal 11px tahoma,arial,helvetica,sans-serif; } .x-tip .x-tip-ml { background-color: #fff; } .x-tip .x-tip-header-text { font: bold 11px tahoma,arial,helvetica,sans-serif; color:#444; } .x-tip .x-tip-body { font: normal 11px tahoma,arial,helvetica,sans-serif; color:#444; } .x-form-invalid-tip .x-tip-tc, .x-form-invalid-tip .x-tip-tl, .x-form-invalid-tip .x-tip-tr, .x-form-invalid-tip .x-tip-bc, .x-form-invalid-tip .x-tip-bl, .x-form-invalid-tip .x-tip-br, .x-form-invalid-tip .x-tip-ml, .x-form-invalid-tip .x-tip-mr { background-image: url(../images/default/form/error-tip-corners.gif); } .x-form-invalid-tip .x-tip-body { background-image:url(../images/default/form/exclamation.gif); } .x-tip-anchor { background-image:url(../images/default/qtip/tip-anchor-sprite.gif); }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/visual/resizable.css000066400000000000000000000031011226600447100243160ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-resizable-handle { background-color:#fff; } .x-resizable-over .x-resizable-handle-east, .x-resizable-pinned .x-resizable-handle-east, .x-resizable-over .x-resizable-handle-west, .x-resizable-pinned .x-resizable-handle-west { background-image:url(../images/default/sizer/e-handle.gif); } .x-resizable-over .x-resizable-handle-south, .x-resizable-pinned .x-resizable-handle-south, .x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north { background-image:url(../images/default/sizer/s-handle.gif); } .x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north{ background-image:url(../images/default/sizer/s-handle.gif); } .x-resizable-over .x-resizable-handle-southeast, .x-resizable-pinned .x-resizable-handle-southeast{ background-image:url(../images/default/sizer/se-handle.gif); } .x-resizable-over .x-resizable-handle-northwest, .x-resizable-pinned .x-resizable-handle-northwest{ background-image:url(../images/default/sizer/nw-handle.gif); } .x-resizable-over .x-resizable-handle-northeast, .x-resizable-pinned .x-resizable-handle-northeast{ background-image:url(../images/default/sizer/ne-handle.gif); } .x-resizable-over .x-resizable-handle-southwest, .x-resizable-pinned .x-resizable-handle-southwest{ background-image:url(../images/default/sizer/sw-handle.gif); } .x-resizable-proxy{ border-color:#3b5a82; } .x-resizable-overlay{ background-color:#fff; } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/visual/slider.css000066400000000000000000000011731226600447100236270ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-slider-horz, .x-slider-horz .x-slider-end, .x-slider-horz .x-slider-inner { background-image:url(../images/default/slider/slider-bg.png); } .x-slider-horz .x-slider-thumb { background-image:url(../images/default/slider/slider-thumb.png); } .x-slider-vert, .x-slider-vert .x-slider-end, .x-slider-vert .x-slider-inner { background-image:url(../images/default/slider/slider-v-bg.png); } .x-slider-vert .x-slider-thumb { background-image:url(../images/default/slider/slider-v-thumb.png); }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/visual/tabs.css000066400000000000000000000056361226600447100233060ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-tab-panel-header, .x-tab-panel-footer { background-color: #deecfd; border-color:#8db2e3; overflow:hidden; zoom:1; } .x-tab-panel-header, .x-tab-panel-footer { border-color:#8db2e3; } ul.x-tab-strip-top{ background-color:#cedff5; background-image: url(../images/default/tabs/tab-strip-bg.gif); border-bottom-color:#8db2e3; } ul.x-tab-strip-bottom{ background-color:#cedff5; background-image: url(../images/default/tabs/tab-strip-btm-bg.gif); border-top-color:#8db2e3; } .x-tab-panel-header-plain .x-tab-strip-spacer, .x-tab-panel-footer-plain .x-tab-strip-spacer { border-color:#8db2e3; background-color: #deecfd; } .x-tab-strip span.x-tab-strip-text { font:normal 11px tahoma,arial,helvetica; color:#416aa3; } .x-tab-strip-over span.x-tab-strip-text { color:#15428b; } .x-tab-strip-active span.x-tab-strip-text { color:#15428b; font-weight:bold; } .x-tab-strip-disabled .x-tabs-text { color:#aaaaaa; } .x-tab-strip-top .x-tab-right, .x-tab-strip-top .x-tab-left, .x-tab-strip-top .x-tab-strip-inner{ background-image: url(../images/default/tabs/tabs-sprite.gif); } .x-tab-strip-bottom .x-tab-right { background-image: url(../images/default/tabs/tab-btm-inactive-right-bg.gif); } .x-tab-strip-bottom .x-tab-left { background-image: url(../images/default/tabs/tab-btm-inactive-left-bg.gif); } .x-tab-strip-bottom .x-tab-strip-over .x-tab-right { background-image: url(../images/default/tabs/tab-btm-over-right-bg.gif); } .x-tab-strip-bottom .x-tab-strip-over .x-tab-left { background-image: url(../images/default/tabs/tab-btm-over-left-bg.gif); } .x-tab-strip-bottom .x-tab-strip-active .x-tab-right { background-image: url(../images/default/tabs/tab-btm-right-bg.gif); } .x-tab-strip-bottom .x-tab-strip-active .x-tab-left { background-image: url(../images/default/tabs/tab-btm-left-bg.gif); } .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close { background-image:url(../images/default/tabs/tab-close.gif); } .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close:hover{ background-image:url(../images/default/tabs/tab-close.gif); } .x-tab-panel-body { border-color:#8db2e3; background-color:#fff; } .x-tab-panel-body-top { border-top: 0 none; } .x-tab-panel-body-bottom { border-bottom: 0 none; } .x-tab-scroller-left { background-image:url(../images/default/tabs/scroll-left.gif); border-bottom-color:#8db2e3; } .x-tab-scroller-left-over { background-position: 0 0; } .x-tab-scroller-left-disabled { background-position: -18px 0; opacity:.5; -moz-opacity:.5; filter:alpha(opacity=50); cursor:default; } .x-tab-scroller-right { background-image:url(../images/default/tabs/scroll-right.gif); border-bottom-color:#8db2e3; } .x-tab-panel-bbar .x-toolbar, .x-tab-panel-tbar .x-toolbar { border-color:#99bbe8; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/visual/toolbar.css000066400000000000000000000051031226600447100240040ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-toolbar{ border-color:#a9bfd3; background-color:#d0def0; background-image:url(../images/default/toolbar/bg.gif); } .x-toolbar td,.x-toolbar span,.x-toolbar input,.x-toolbar div,.x-toolbar select,.x-toolbar label{ font:normal 11px arial,tahoma, helvetica, sans-serif; } .x-toolbar .x-item-disabled { color:gray; } .x-toolbar .x-item-disabled * { color:gray; } .x-toolbar .x-btn-mc em.x-btn-split { background-image:url(../images/default/button/s-arrow-noline.gif); } .x-toolbar .x-btn-over .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split { background-image:url(../images/default/button/s-arrow-o.gif); } .x-toolbar .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/default/button/s-arrow-b-noline.gif); } .x-toolbar .x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/default/button/s-arrow-bo.gif); } .x-toolbar .xtb-sep { background-image: url(../images/default/grid/grid-blue-split.gif); } .x-tbar-page-first{ background-image: url(../images/default/grid/page-first.gif) !important; } .x-tbar-loading{ background-image: url(../images/default/grid/refresh.gif) !important; } .x-tbar-page-last{ background-image: url(../images/default/grid/page-last.gif) !important; } .x-tbar-page-next{ background-image: url(../images/default/grid/page-next.gif) !important; } .x-tbar-page-prev{ background-image: url(../images/default/grid/page-prev.gif) !important; } .x-item-disabled .x-tbar-loading{ background-image: url(../images/default/grid/refresh-disabled.gif) !important; } .x-item-disabled .x-tbar-page-first{ background-image: url(../images/default/grid/page-first-disabled.gif) !important; } .x-item-disabled .x-tbar-page-last{ background-image: url(../images/default/grid/page-last-disabled.gif) !important; } .x-item-disabled .x-tbar-page-next{ background-image: url(../images/default/grid/page-next-disabled.gif) !important; } .x-item-disabled .x-tbar-page-prev{ background-image: url(../images/default/grid/page-prev-disabled.gif) !important; } .x-paging-info { color:#444; } .x-toolbar-more-icon { background-image: url(../images/default/toolbar/more.gif) !important; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/visual/tree.css000066400000000000000000000066321226600447100233110ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-tree-node-expanded .x-tree-node-icon{ background-image:url(../images/default/tree/folder-open.gif); } .x-tree-node-leaf .x-tree-node-icon{ background-image:url(../images/default/tree/leaf.gif); } .x-tree-node-collapsed .x-tree-node-icon{ background-image:url(../images/default/tree/folder.gif); } .x-tree-node-loading .x-tree-node-icon{ background-image:url(../images/default/tree/loading.gif) !important; } .x-tree-node .x-tree-node-inline-icon { background-image: none; } .x-tree-node-loading a span{ font-style: italic; color:#444444; } .x-tree-lines .x-tree-elbow{ background-image:url(../images/default/tree/elbow.gif); } .x-tree-lines .x-tree-elbow-plus{ background-image:url(../images/default/tree/elbow-plus.gif); } .x-tree-lines .x-tree-elbow-minus{ background-image:url(../images/default/tree/elbow-minus.gif); } .x-tree-lines .x-tree-elbow-end{ background-image:url(../images/default/tree/elbow-end.gif); } .x-tree-lines .x-tree-elbow-end-plus{ background-image:url(../images/default/tree/elbow-end-plus.gif); } .x-tree-lines .x-tree-elbow-end-minus{ background-image:url(../images/default/tree/elbow-end-minus.gif); } .x-tree-lines .x-tree-elbow-line{ background-image:url(../images/default/tree/elbow-line.gif); } .x-tree-no-lines .x-tree-elbow-plus{ background-image:url(../images/default/tree/elbow-plus-nl.gif); } .x-tree-no-lines .x-tree-elbow-minus{ background-image:url(../images/default/tree/elbow-minus-nl.gif); } .x-tree-no-lines .x-tree-elbow-end-plus{ background-image:url(../images/default/tree/elbow-end-plus-nl.gif); } .x-tree-no-lines .x-tree-elbow-end-minus{ background-image:url(../images/default/tree/elbow-end-minus-nl.gif); } .x-tree-arrows .x-tree-elbow-plus{ background-image:url(../images/default/tree/arrows.gif); } .x-tree-arrows .x-tree-elbow-minus{ background-image:url(../images/default/tree/arrows.gif); } .x-tree-arrows .x-tree-elbow-end-plus{ background-image:url(../images/default/tree/arrows.gif); } .x-tree-arrows .x-tree-elbow-end-minus{ background-image:url(../images/default/tree/arrows.gif); } .x-tree-node{ color:#000; font: normal 11px arial, tahoma, helvetica, sans-serif; } .x-tree-node a, .x-dd-drag-ghost a{ color:#000; } .x-tree-node a span, .x-dd-drag-ghost a span{ color:#000; } .x-tree-node .x-tree-node-disabled a span{ color:gray !important; } .x-tree-node div.x-tree-drag-insert-below{ border-bottom-color:#36c; } .x-tree-node div.x-tree-drag-insert-above{ border-top-color:#36c; } .x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-below a{ border-bottom-color:#36c; } .x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-above a{ border-top-color:#36c; } .x-tree-node .x-tree-drag-append a span{ background-color:#ddd; border-color:gray; } .x-tree-node .x-tree-node-over { background-color: #eee; } .x-tree-node .x-tree-selected { background-color: #d9e8fb; } .x-tree-drop-ok-append .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-add.gif); } .x-tree-drop-ok-above .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-over.gif); } .x-tree-drop-ok-below .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-under.gif); } .x-tree-drop-ok-between .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-between.gif); }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/visual/window.css000066400000000000000000000032451226600447100236560ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .x-window-proxy { background-color:#c7dffc; border-color:#99bbe8; } .x-window-tl .x-window-header { color:#15428b; font:bold 11px tahoma,arial,verdana,sans-serif; } .x-window-tc { background-image: url(../images/default/window/top-bottom.png); } .x-window-tl { background-image: url(../images/default/window/left-corners.png); } .x-window-tr { background-image: url(../images/default/window/right-corners.png); } .x-window-bc { background-image: url(../images/default/window/top-bottom.png); } .x-window-bl { background-image: url(../images/default/window/left-corners.png); } .x-window-br { background-image: url(../images/default/window/right-corners.png); } .x-window-mc { border-color:#99bbe8; font: normal 11px tahoma,arial,helvetica,sans-serif; background-color:#dfe8f6; } .x-window-ml { background-image: url(../images/default/window/left-right.png); } .x-window-mr { background-image: url(../images/default/window/left-right.png); } .x-window-maximized .x-window-tc { background-color:#fff; } .x-window-bbar .x-toolbar { border-top-color:#99bbe8; } .x-panel-ghost .x-window-tl { border-bottom-color:#99bbe8; } .x-panel-collapsed .x-window-tl { border-bottom-color:#84a0c4; } .x-dlg-mask{ background-color:#ccc; } .x-window-plain .x-window-mc { background-color: #ccd9e8; border-color: #a3bae9 #dfe8f6 #dfe8f6 #a3bae9; } .x-window-plain .x-window-body { border-color: #dfe8f6 #a3bae9 #a3bae9 #dfe8f6; } body.x-body-masked .x-window-plain .x-window-mc { background-color: #ccd9e8; }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/xtheme-access.css000066400000000000000000001201201226600447100235650ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ body { background-color:#16181a; color:#fcfcfc; } .ext-el-mask { background-color: #ccc; } .ext-el-mask-msg { border-color:#223; background-color:#3f4757; background-image:url(../images/access/box/tb-blue.gif); } .ext-el-mask-msg div { background-color: #232d38; border-color:#556; color:#fff; font:normal 14px tahoma, arial, helvetica, sans-serif; } .x-mask-loading div { background-color:#232d38; background-image:url(../images/access/grid/loading.gif); } .x-item-disabled { color: #ddd; } .x-item-disabled * { color: #ddd !important; } .x-splitbar-proxy { background-color: #aaa; } .x-color-palette a { border-color:#fff; } .x-color-palette a:hover, .x-color-palette a.x-color-palette-sel { border-color:#8bb8f3; background-color: #deecfd; } .x-color-palette em { border-color:#aca899; } .x-ie-shadow { background-color:#777; } .x-shadow .xsmc { background-image: url(../images/default/shadow-c.png); } .x-shadow .xsml, .x-shadow .xsmr { background-image: url(../images/default/shadow-lr.png); } .x-shadow .xstl, .x-shadow .xstc, .x-shadow .xstr, .x-shadow .xsbl, .x-shadow .xsbc, .x-shadow .xsbr{ background-image: url(../images/default/shadow.png); } .loading-indicator { font-size: 14px; background-image: url(../images/access/grid/loading.gif); } .x-spotlight { background-color: #ccc; }.x-tab-panel-header, .x-tab-panel-footer { background-color:#e18325; border-color:#8db2e3; overflow:hidden; zoom:1; } .x-tab-panel-header, .x-tab-panel-footer { border-color:#222; } ul.x-tab-strip-top{ background-color:#343843; background-image: url(../images/access/tabs/tab-strip-bg.gif); border-bottom-color:#343d4e; } ul.x-tab-strip-bottom{ background-color:#343843; background-image: url(../images/access/tabs/tab-strip-btm-bg.gif); border-top-color:#343843; } .x-tab-panel-header-plain .x-tab-strip-spacer, .x-tab-panel-footer-plain .x-tab-strip-spacer { border-color:#222; background-color:#e18325; } .x-tab-strip span.x-tab-strip-text { font:normal 14px tahoma,arial,helvetica; color:#fff; } .x-tab-strip-over span.x-tab-strip-text { color:#fff; } .x-tab-strip-active span.x-tab-strip-text { color:#fff; font-weight:bold; } .x-tab-strip-disabled .x-tabs-text { color:#aaaaaa; } .x-tab-strip-top .x-tab-right, .x-tab-strip-top .x-tab-left, .x-tab-strip-top .x-tab-strip-inner{ background-image: url(../images/access/tabs/tabs-sprite.gif); } .x-tab-strip-bottom .x-tab-right { background-image: url(../images/access/tabs/tab-btm-inactive-right-bg.gif); } .x-tab-strip-bottom .x-tab-left { background-image: url(../images/access/tabs/tab-btm-inactive-left-bg.gif); } .x-tab-strip-bottom .x-tab-strip-active .x-tab-right { background-image: url(../images/access/tabs/tab-btm-right-bg.gif); } .x-tab-strip-bottom .x-tab-strip-active .x-tab-left { background-image: url(../images/access/tabs/tab-btm-left-bg.gif); } .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close { background-image:url(../images/access/tabs/tab-close.gif); } .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close:hover{ background-image:url(../images/access/tabs/tab-close.gif); } .x-tab-panel-body { border-color:#18181a; background-color:#fff; } .x-tab-panel-body-top { border-top: 0 none; } .x-tab-panel-body-bottom { border-bottom: 0 none; } .x-tab-scroller-left { background-image:url(../images/access/tabs/scroll-left.gif); border-bottom-color:#8db2e3; } .x-tab-scroller-left-over { background-position: 0 0; } .x-tab-scroller-left-disabled { background-position: -18px 0; opacity:.5; -moz-opacity:.5; filter:alpha(opacity=50); cursor:default; } .x-tab-scroller-right { background-image:url(../images/access/tabs/scroll-right.gif); border-bottom-color:#8db2e3; } .x-tab-panel-bbar .x-toolbar, .x-tab-panel-tbar .x-toolbar { border-color:#99bbe8; } .x-form-field { font:normal 15px tahoma, arial, helvetica, sans-serif; } .x-form-text, textarea.x-form-field{ color: #ffffff; background-color:#33373d; background-image:url(../images/access/form/text-bg.gif); border-color:#737b8c; border-width:2px; } .ext-webkit .x-form-text, .ext-webkit textarea.x-form-field{ border-width:2px; } .x-form-text, .ext-ie .x-form-file { height:26px; } .ext-strict .x-form-text { height:20px; } .x-form-select-one { background-color:#fff; border-color:#b5b8c8; } .x-form-check-group-label { border-bottom: 1px solid #99bbe8; color: #fff; } .x-editor .x-form-check-wrap { background-color:#fff; } .x-form-field-wrap .x-form-trigger{ background-image:url(../images/access/form/trigger.gif); border-bottom-color:#737b8c; border-bottom-width:2px; height:24px; width:20px; } .x-form-field-wrap .x-form-trigger.x-form-trigger-over{ border-bottom-color:#d97e27; } .x-form-field-wrap .x-form-trigger.x-form-trigger-click{ border-bottom-color:#c86e19; } .x-small-editor .x-form-field-wrap .x-form-trigger { height:24px; } .x-form-field-wrap .x-form-trigger-over { background-position:-20px 0; } .x-form-field-wrap .x-form-trigger-click { background-position:-40px 0; } .x-trigger-wrap-focus .x-form-trigger { background-position:-60px 0; } .x-trigger-wrap-focus .x-form-trigger-over { background-position:-80px 0; } .x-trigger-wrap-focus .x-form-trigger-click { background-position:-100px 0; } .x-form-field-wrap .x-form-date-trigger{ background-image: url(../images/access/form/date-trigger.gif); } .x-form-field-wrap .x-form-clear-trigger{ background-image: url(../images/access/form/clear-trigger.gif); } .x-form-field-wrap .x-form-search-trigger{ background-image: url(../images/access/form/search-trigger.gif); } .x-trigger-wrap-focus .x-form-trigger{ border-bottom-color:#737b8c; } .x-item-disabled .x-form-trigger-over{ border-bottom-color:#b5b8c8; } .x-item-disabled .x-form-trigger-click{ border-bottom-color:#b5b8c8; } .x-form-focus, textarea.x-form-focus{ border-color:#ff9c33; } .x-form-invalid, textarea.x-form-invalid, .ext-webkit .x-form-invalid, .ext-webkit textarea.x-form-invalid{ background-color:#15171a; background-image:url(../images/access/grid/invalid_line.gif); border-color:#c30; } /* .ext-safari .x-form-invalid{ background-color:#fee; border-color:#ff7870; } */ .x-form-inner-invalid, textarea.x-form-inner-invalid{ background-color:#fff; background-image:url(../images/access/grid/invalid_line.gif); } .x-form-grow-sizer { font:normal 15px tahoma, arial, helvetica, sans-serif; } .x-form-item { font:normal 15px tahoma, arial, helvetica, sans-serif; } .x-form-invalid-msg { color:#c0272b; font:normal 14px tahoma, arial, helvetica, sans-serif; background-image:url(../images/default/shared/warning.gif); } .x-form-empty-field { color:#dadadd; } .x-small-editor .x-form-text { height: 26px; } .x-small-editor .x-form-field { font:normal 14px arial, tahoma, helvetica, sans-serif; } .ext-safari .x-small-editor .x-form-field { font:normal 15px arial, tahoma, helvetica, sans-serif; } .x-form-invalid-icon { background-image:url(../images/access/form/exclamation.gif); height:25px; width:19px; background-position:center right; } .x-fieldset { border-color:#737B8C; } .x-fieldset legend { font:bold 14px tahoma, arial, helvetica, sans-serif; color:#fff; } .x-btn { font:normal 14px tahoma, verdana, helvetica; } .x-btn button { font:normal 14px arial,tahoma,verdana,helvetica; color:#fffffa; padding-left:6px !important; padding-right:6px !important; } .x-btn-over .x-btn button{ color:#fff; } .x-btn-noicon .x-btn-small .x-btn-text, .x-btn-text-icon .x-btn-icon-small-left .x-btn-text, .x-btn-icon .x-btn-small .x-btn-text, .x-btn-text-icon .x-btn-icon-small-right .x-btn-text { height:18px; } .x-btn-icon .x-btn-small .x-btn-text { width:18px; } .x-btn-text-icon .x-btn-icon-small-left .x-btn-text { padding-left:21px !important; } .x-btn-text-icon .x-btn-icon-small-right .x-btn-text { padding-right:21px !important; } .x-btn-text-icon .x-btn-icon-medium-left .x-btn-text { padding-left:29px !important; } .x-btn-text-icon .x-btn-icon-medium-right .x-btn-text { padding-right:29px !important; } .x-btn-text-icon .x-btn-icon-large-left .x-btn-text { padding-left:37px !important; } .x-btn-text-icon .x-btn-icon-large-right .x-btn-text { padding-right:37px !important; } .x-btn em { font-style:normal; font-weight:normal; } .x-btn-tl, .x-btn-tr, .x-btn-tc, .x-btn-ml, .x-btn-mr, .x-btn-mc, .x-btn-bl, .x-btn-br, .x-btn-bc{ background-image:url(../images/access/button/btn.gif); } .x-btn-click .x-btn-text, .x-btn-menu-active .x-btn-text, .x-btn-pressed .x-btn-text{ color:#fff; } .x-btn-disabled *{ color:#eee !important; } .x-btn-mc em.x-btn-arrow { background-image:url(../images/access/button/arrow.gif); padding-right:13px; } .x-btn-mc em.x-btn-split { background-image:url(../images/access/button/s-arrow.gif); padding-right:20px; } .x-btn-over .x-btn-mc em.x-btn-split, .x-btn-click .x-btn-mc em.x-btn-split, .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-btn-pressed .x-btn-mc em.x-btn-split { background-image:url(../images/access/button/s-arrow-o.gif); } .x-btn-mc em.x-btn-arrow-bottom { background-image:url(../images/access/button/s-arrow-b-noline.gif); } .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/access/button/s-arrow-b.gif); } .x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-btn-click .x-btn-mc em.x-btn-split-bottom, .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-btn-pressed .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/access/button/s-arrow-bo.gif); } .x-btn-group-header { color: #d2d2d2; } .x-btn-group-tc { background-image: url(../images/access/button/group-tb.gif); } .x-btn-group-tl { background-image: url(../images/access/button/group-cs.gif); } .x-btn-group-tr { background-image: url(../images/access/button/group-cs.gif); } .x-btn-group-bc { background-image: url(../images/access/button/group-tb.gif); } .x-btn-group-bl { background-image: url(../images/access/button/group-cs.gif); } .x-btn-group-br { background-image: url(../images/access/button/group-cs.gif); } .x-btn-group-ml { background-image: url(../images/access/button/group-lr.gif); } .x-btn-group-mr { background-image: url(../images/access/button/group-lr.gif); } .x-btn-group-notitle .x-btn-group-tc { background-image: url(../images/access/button/group-tb.gif); } .x-toolbar{ border-color:#18181a; background-color:#393d4e; background-image:url(../images/access/toolbar/bg.gif); } .x-toolbar td,.x-toolbar span,.x-toolbar input,.x-toolbar div,.x-toolbar select,.x-toolbar label{ font:normal 14px arial,tahoma, helvetica, sans-serif; } .x-toolbar .x-item-disabled { color:gray; } .x-toolbar .x-item-disabled * { color:gray; } .x-toolbar .x-btn-mc em.x-btn-split { background-image:url(../images/access/button/s-arrow-noline.gif); } .x-toolbar .x-btn-over .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split { background-image:url(../images/access/button/s-arrow-o.gif); } .x-toolbar .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/access/button/s-arrow-b-noline.gif); } .x-toolbar .x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/access/button/s-arrow-bo.gif); } .x-toolbar .xtb-sep { background-image: url(../images/access/grid/grid-blue-split.gif); } .x-toolbar .x-btn { padding-left:3px; padding-right:3px; } .x-toolbar .x-btn-mc em.x-btn-arrow { padding-right:10px; } .x-toolbar .x-btn-text-icon .x-btn-icon-small-left .x-btn-text { padding-left:18px !important; } .x-toolbar .x-btn-mc em.x-btn-split { padding-right:14px; } .x-tbar-page-first{ background-image: url(../images/access/grid/page-first.gif) !important; } .x-tbar-loading{ background-image: url(../images/access/grid/refresh.gif) !important; } .x-tbar-page-last{ background-image: url(../images/access/grid/page-last.gif) !important; } .x-tbar-page-next{ background-image: url(../images/access/grid/page-next.gif) !important; } .x-tbar-page-prev{ background-image: url(../images/access/grid/page-prev.gif) !important; } .x-item-disabled .x-tbar-loading{ background-image: url(../images/access/grid/loading.gif) !important; } .x-item-disabled .x-tbar-page-first{ background-image: url(../images/access/grid/page-first-disabled.gif) !important; } .x-item-disabled .x-tbar-page-last{ background-image: url(../images/access/grid/page-last-disabled.gif) !important; } .x-item-disabled .x-tbar-page-next{ background-image: url(../images/access/grid/page-next-disabled.gif) !important; } .x-item-disabled .x-tbar-page-prev{ background-image: url(../images/access/grid/page-prev-disabled.gif) !important; } .x-paging-info { color:#444; } .x-toolbar-more-icon { background-image: url(../images/access/toolbar/more.gif) !important; } .x-statusbar .x-status-busy { background-image: url(../images/access/grid/loading.gif); } .x-statusbar .x-status-text-panel { border-color: #99bbe8 #fff #fff #99bbe8; } .x-resizable-handle { background-color:#fff; color: #000; } .x-resizable-over .x-resizable-handle-east, .x-resizable-pinned .x-resizable-handle-east, .x-resizable-over .x-resizable-handle-west, .x-resizable-pinned .x-resizable-handle-west { background-image:url(../images/access/sizer/e-handle.gif); } .x-resizable-over .x-resizable-handle-south, .x-resizable-pinned .x-resizable-handle-south, .x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north { background-image:url(../images/access/sizer/s-handle.gif); } .x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north{ background-image:url(../images/access/sizer/s-handle.gif); } .x-resizable-over .x-resizable-handle-southeast, .x-resizable-pinned .x-resizable-handle-southeast{ background-image:url(../images/access/sizer/se-handle.gif); } .x-resizable-over .x-resizable-handle-northwest, .x-resizable-pinned .x-resizable-handle-northwest{ background-image:url(../images/access/sizer/nw-handle.gif); } .x-resizable-over .x-resizable-handle-northeast, .x-resizable-pinned .x-resizable-handle-northeast{ background-image:url(../images/access/sizer/ne-handle.gif); } .x-resizable-over .x-resizable-handle-southwest, .x-resizable-pinned .x-resizable-handle-southwest{ background-image:url(../images/access/sizer/sw-handle.gif); } .x-resizable-proxy{ border-color:#3b5a82; } .x-resizable-overlay{ background-color:#fff; } .x-grid3 { background-color:#1f2933; } .x-grid-panel .x-panel-mc .x-panel-body { border-color:#223; } .x-grid3-hd-row td, .x-grid3-row td, .x-grid3-summary-row td{ font:normal 14px arial, tahoma, helvetica, sans-serif; } .x-grid3-hd-row td { border-left-color:#556; border-right-color:#223; } .x-grid-row-loading { background-color: #fff; background-image:url(../images/default/shared/loading-balls.gif); } .x-grid3-row { border:0 none; border-bottom:1px solid #111; border-right:1px solid #1a1a1c; } .x-grid3-row-alt{ background-color:#1b232b; } .x-grid3-row-over { background-color:#7e5530; } .x-grid3-resize-proxy { background-color:#777; } .x-grid3-resize-marker { background-color:#777; } .x-grid3-header{ background-color:#3b3f50; background-image:url(../images/access/grid/grid3-hrow.gif); } .x-grid3-header-pop { border-left-color:#d0d0d0; } .x-grid3-header-pop-inner { border-left-color:#eee; background-image:url(../images/default/grid/hd-pop.gif); } td.x-grid3-hd-over, td.sort-desc, td.sort-asc, td.x-grid3-hd-menu-open { border-left-color:#889; border-right-color:#445; } td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-asc .x-grid3-hd-inner, td.x-grid3-hd-menu-open .x-grid3-hd-inner { background-color:#4e628a; background-image:url(../images/access/grid/grid3-hrow-over.gif); } .x-grid3-cell-inner, .x-grid3-hd-inner { color:#fff; } .sort-asc .x-grid3-sort-icon { background-image: url(../images/access/grid/sort_asc.gif); width:15px; height:9px; margin-left:5px; } .sort-desc .x-grid3-sort-icon { background-image: url(../images/access/grid/sort_desc.gif); width:15px; height:9px; margin-left:5px; } .x-grid3-cell-text, .x-grid3-hd-text { color:#fff; } .x-grid3-split { background-image: url(../images/default/grid/grid-split.gif); } .x-grid3-hd-text { color:#fff; } .x-dd-drag-proxy .x-grid3-hd-inner{ background-color:#ebf3fd; background-image:url(../images/access/grid/grid3-hrow-over.gif); border-color:#aaccf6; } .col-move-top{ background-image:url(../images/default/grid/col-move-top.gif); } .col-move-bottom{ background-image:url(../images/default/grid/col-move-bottom.gif); } .x-grid3-row-selected { background-color: #e5872c !important; background-image: none; border-style: solid; } .x-grid3-row-selected .x-grid3-cell { color: #fff; } .x-grid3-cell-selected { background-color: #ffa340 !important; color:#fff; } .x-grid3-cell-selected span{ color:#fff !important; } .x-grid3-cell-selected .x-grid3-cell-text{ color:#fff; } .x-grid3-locked td.x-grid3-row-marker, .x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker{ background-color:#ebeadb !important; background-image:url(../images/default/grid/grid-hrow.gif) !important; color:#fff; border-top-color:#fff; border-right-color:#6fa0df !important; } .x-grid3-locked td.x-grid3-row-marker div, .x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker div{ color:#fff !important; } .x-grid3-dirty-cell { background-image:url(../images/access/grid/dirty.gif); } .x-grid3-topbar, .x-grid3-bottombar{ font:normal 14px arial, tahoma, helvetica, sans-serif; } .x-grid3-bottombar .x-toolbar{ border-top-color:#a9bfd3; } .x-props-grid .x-grid3-td-name .x-grid3-cell-inner{ background-image:url(../images/access/grid/grid3-special-col-bg.gif) !important; color:#fff !important; } .x-props-grid .x-grid3-td-value { color:#fff !important; } .x-props-grid .x-grid3-body .x-grid3-td-name{ background-color:#263240 !important; border-right-color:#223; } .xg-hmenu-sort-asc .x-menu-item-icon{ background-image: url(../images/access/grid/hmenu-asc.gif); } .xg-hmenu-sort-desc .x-menu-item-icon{ background-image: url(../images/access/grid/hmenu-desc.gif); } .xg-hmenu-lock .x-menu-item-icon{ background-image: url(../images/access/grid/hmenu-lock.gif); } .xg-hmenu-unlock .x-menu-item-icon{ background-image: url(../images/access/grid/hmenu-unlock.gif); } .x-grid3-hd-btn { background-color:#c2c9d0; background-image:url(../images/access/grid/grid3-hd-btn.gif); } .x-grid3-body .x-grid3-td-expander { background-image:url(../images/access/grid/grid3-special-col-bg.gif); } .x-grid3-row-expander { background-image:url(../images/access/grid/row-expand-sprite.gif); } .x-grid3-body .x-grid3-td-checker { background-image: url(../images/access/grid/grid3-special-col-bg.gif); } .x-grid3-row-checker, .x-grid3-hd-checker { background-image:url(../images/default/grid/row-check-sprite.gif); } .x-grid3-body .x-grid3-td-numberer { background-image:url(../images/access/grid/grid3-special-col-bg.gif); } .x-grid3-body .x-grid3-td-numberer .x-grid3-cell-inner { color:#fff; } .x-grid3-body .x-grid3-td-row-icon { background-image:url(../images/access/grid/grid3-special-col-bg.gif); } .x-grid3-body .x-grid3-row-selected .x-grid3-td-numberer, .x-grid3-body .x-grid3-row-selected .x-grid3-td-checker, .x-grid3-body .x-grid3-row-selected .x-grid3-td-expander { background-image:url(../images/access/grid/grid3-special-col-sel-bg.gif); } .x-grid3-check-col { background-image:url(../images/default/menu/unchecked.gif); } .x-grid3-check-col-on { background-image:url(../images/default/menu/checked.gif); } .x-grid-group, .x-grid-group-body, .x-grid-group-hd { zoom:1; } .x-grid-group-hd { border-bottom-color:#4e628a; } .x-grid-group-hd div.x-grid-group-title { background-image:url(../images/access/grid/group-collapse.gif); background-position:3px 6px; color:#ffd; font:bold 14px tahoma, arial, helvetica, sans-serif; } .x-grid-group-collapsed .x-grid-group-hd div.x-grid-group-title { background-image:url(../images/access/grid/group-expand.gif); } .x-group-by-icon { background-image:url(../images/default/grid/group-by.gif); } .x-cols-icon { background-image:url(../images/default/grid/columns.gif); } .x-show-groups-icon { background-image:url(../images/default/grid/group-by.gif); } .x-grid-empty { color:gray; font:normal 14px tahoma, arial, helvetica, sans-serif; } .x-grid-with-col-lines .x-grid3-row td.x-grid3-cell { border-right-color:#ededed; } .x-grid-with-col-lines .x-grid3-row{ border-top-color:#ededed; } .x-grid-with-col-lines .x-grid3-row-selected { border-top-color:#a3bae9; } .x-dd-drag-ghost{ color:#000; font: normal 14px arial, helvetica, sans-serif; border-color: #ddd #bbb #bbb #ddd; background-color:#fff; } .x-dd-drop-nodrop .x-dd-drop-icon{ background-image: url(../images/default/dd/drop-no.gif); } .x-dd-drop-ok .x-dd-drop-icon{ background-image: url(../images/default/dd/drop-yes.gif); } .x-dd-drop-ok-add .x-dd-drop-icon{ background-image: url(../images/default/dd/drop-add.gif); } .x-view-selector { background-color:#c3daf9; border-color:#3399bb; } .x-tree-node-expanded .x-tree-node-icon{ background-image:url(../images/access/tree/folder-open.gif); } .x-tree-node-leaf .x-tree-node-icon{ background-image:url(../images/default/tree/leaf.gif); } .x-tree-node-collapsed .x-tree-node-icon{ background-image:url(../images/access/tree/folder.gif); } .x-tree-node-loading .x-tree-node-icon{ background-image:url(../images/default/tree/loading.gif) !important; } .x-tree-node .x-tree-node-inline-icon { background-image: none; } .x-tree-node-loading a span{ font-style: italic; color:#444444; } .ext-ie .x-tree-node-el input { width:14px; height:14px; } .x-tree-lines .x-tree-elbow{ background-image:url(../images/access/tree/elbow.gif); } .x-tree-lines .x-tree-elbow-plus{ background-image:url(../images/access/tree/elbow-plus.gif); } .x-tree-lines .x-tree-elbow-minus{ background-image:url(../images/access/tree/elbow-minus.gif); } .x-tree-lines .x-tree-elbow-end{ background-image:url(../images/access/tree/elbow-end.gif); } .x-tree-lines .x-tree-elbow-end-plus{ background-image:url(../images/access/tree/elbow-end-plus.gif); } .x-tree-lines .x-tree-elbow-end-minus{ background-image:url(../images/access/tree/elbow-end-minus.gif); } .x-tree-lines .x-tree-elbow-line{ background-image:url(../images/access/tree/elbow-line.gif); } .x-tree-no-lines .x-tree-elbow-plus{ background-image:url(../images/access/tree/elbow-plus-nl.gif); } .x-tree-no-lines .x-tree-elbow-minus{ background-image:url(../images/access/tree/elbow-minus-nl.gif); } .x-tree-no-lines .x-tree-elbow-end-plus{ background-image:url(../images/access/tree/elbow-end-plus-nl.gif); } .x-tree-no-lines .x-tree-elbow-end-minus{ background-image:url(../images/access/tree/elbow-end-minus-nl.gif); } .x-tree-arrows .x-tree-elbow-plus{ background-image:url(../images/access/tree/arrows.gif); } .x-tree-arrows .x-tree-elbow-minus{ background-image:url(../images/access/tree/arrows.gif); } .x-tree-arrows .x-tree-elbow-end-plus{ background-image:url(../images/access/tree/arrows.gif); } .x-tree-arrows .x-tree-elbow-end-minus{ background-image:url(../images/access/tree/arrows.gif); } .x-tree-node{ color:#000; font: normal 14px arial, tahoma, helvetica, sans-serif; } .x-tree-node a, .x-dd-drag-ghost a{ color:#fff; } .x-tree-node a span, .x-dd-drag-ghost a span{ color:#fff; } .x-tree-node .x-tree-selected a, .x-dd-drag-ghost a{ color:#fff; } .x-tree-node .x-tree-selected a span, .x-dd-drag-ghost a span{ color:#fff; } .x-tree-node .x-tree-node-disabled a span{ color:gray !important; } .x-tree-node div.x-tree-drag-insert-below{ border-bottom-color:#36c; } .x-tree-node div.x-tree-drag-insert-above{ border-top-color:#36c; } .x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-below a{ border-bottom-color:#36c; } .x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-above a{ border-top-color:#36c; } .x-tree-node .x-tree-drag-append a span{ background-color:#ddd; border-color:gray; } .x-tree-node .x-tree-node-over { background-color: #7e5530; } .x-tree-node .x-tree-selected { background-color: #e5872c; } .x-tree-drop-ok-append .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-add.gif); } .x-tree-drop-ok-above .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-over.gif); } .x-tree-drop-ok-below .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-under.gif); } .x-tree-drop-ok-between .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-between.gif); } .x-date-picker { border-color: #737b8c; background-color:#21252e; } .x-date-middle,.x-date-left,.x-date-right { background-image: url(../images/access/shared/hd-sprite.gif); color:#fff; font:bold 14px "sans serif", tahoma, verdana, helvetica; } .x-date-middle .x-btn .x-btn-text { color:#fff; } .x-date-middle .x-btn-mc em.x-btn-arrow { background-image:url(../images/access/toolbar/btn-arrow-light.gif); } .x-date-right a { background-image: url(../images/access/shared/right-btn.gif); } .x-date-left a{ background-image: url(../images/access/shared/left-btn.gif); } .x-date-inner th { background-color:#363d4a; background-image:url(../images/access/toolbar/bg.gif); border-bottom-color:#535b5c; font:normal 13px arial, helvetica,tahoma,sans-serif; color:#fff; } .x-date-inner td { border-color:#112; } .x-date-inner a { font:normal 14px arial, helvetica,tahoma,sans-serif; color:#fff; padding:2px 7px 1px 3px; /* Structure to account for larger, bolder fonts in Access theme. */ } .x-date-inner .x-date-active{ color:#000; } .x-date-inner .x-date-selected a{ background-color:#e5872c; background-image:none; border-color:#864900; padding:1px 6px 1px 2px; /* Structure to account for larger, bolder fonts in Access theme. */ } .x-date-inner .x-date-today a{ border-color:#99a; } .x-date-inner .x-date-selected span{ font-weight:bold; } .x-date-inner .x-date-prevday a,.x-date-inner .x-date-nextday a { color:#aaa; } .x-date-bottom { border-top-color:#737b8c; background-color:#464d5a; background-image:url(../images/access/shared/glass-bg.gif); } .x-date-inner a:hover, .x-date-inner .x-date-disabled a:hover{ color:#fff; background-color:#7e5530; } .x-date-inner .x-date-disabled a { background-color:#eee; color:#bbb; } .x-date-mmenu{ background-color:#eee !important; } .x-date-mmenu .x-menu-item { font-size:13px; color:#000; } .x-date-mp { background-color:#21252e; } .x-date-mp td { font:normal 14px arial, helvetica,tahoma,sans-serif; } .x-date-mp-btns button { background-color:#083772; color:#fff; border-color: #3366cc #000055 #000055 #3366cc; font:normal 14px arial, helvetica,tahoma,sans-serif; } .x-date-mp-btns { background-color: #dfecfb; background-image: url(../images/access/shared/glass-bg.gif); } .x-date-mp-btns td { border-top-color: #c5d2df; } td.x-date-mp-month a,td.x-date-mp-year a { color:#fff; } td.x-date-mp-month a:hover,td.x-date-mp-year a:hover { color:#fff; background-color: #7e5530; } td.x-date-mp-sel a { background-color: #e5872c; background-image: none; border-color:#864900; } .x-date-mp-ybtn a { background-image:url(../images/access/panel/tool-sprites.gif); } td.x-date-mp-sep { border-right-color:#c5d2df; } .x-tip .x-tip-close{ background-image: url(../images/access/qtip/close.gif); } .x-tip .x-tip-tc, .x-tip .x-tip-tl, .x-tip .x-tip-tr, .x-tip .x-tip-bc, .x-tip .x-tip-bl, .x-tip .x-tip-br, .x-tip .x-tip-ml, .x-tip .x-tip-mr { background-image: url(../images/access/qtip/tip-sprite.gif); } .x-tip .x-tip-mc { font: normal 14px tahoma,arial,helvetica,sans-serif; } .x-tip .x-tip-ml { background-color: #fff; } .x-tip .x-tip-header-text { font: bold 14px tahoma,arial,helvetica,sans-serif; color:#ffd; } .x-tip .x-tip-body { font: normal 14px tahoma,arial,helvetica,sans-serif; color:#000; } .x-form-invalid-tip .x-tip-tc, .x-form-invalid-tip .x-tip-tl, .x-form-invalid-tip .x-tip-tr, .x-form-invalid-tip .x-tip-bc, .x-form-invalid-tip .x-tip-bl, .x-form-invalid-tip .x-tip-br, .x-form-invalid-tip .x-tip-ml, .x-form-invalid-tip .x-tip-mr { background-image: url(../images/default/form/error-tip-corners.gif); } .x-form-invalid-tip .x-tip-body { background-image:url(../images/access/form/exclamation.gif); } .x-tip-anchor { background-image:url(../images/access/qtip/tip-anchor-sprite.gif); } .x-menu { border-color:#222; background-color:#414551; background-image:url(../images/access/menu/menu.gif); } .x-menu-nosep { background-image:none; } .x-menu-list-item{ font:normal 14px tahoma,arial, sans-serif; } .x-menu-item-arrow{ background-image:url(../images/access/menu/menu-parent.gif); } .x-menu-sep { background-color:#223; border-bottom-color:#666; } a.x-menu-item { color:#fffff6; } .x-menu-item-active { background-color: #f09134; background-image: none; border-color:#b36427; } .x-menu-item-active a.x-menu-item { border-color:#b36427; } .x-menu-check-item .x-menu-item-icon{ background-image:url(../images/default/menu/unchecked.gif); } .x-menu-item-checked .x-menu-item-icon{ background-image:url(../images/default/menu/checked.gif); } .x-menu-item-checked .x-menu-group-item .x-menu-item-icon{ background-image:url(../images/access/menu/group-checked.gif); } .x-menu-group-item .x-menu-item-icon{ background-image:none; } .x-menu-plain { background-color:#fff !important; } .x-menu .x-date-picker{ border-color:#a3bad9; } .x-cycle-menu .x-menu-item-checked { border-color:#a3bae9 !important; background-color:#def8f6; } .x-menu-scroller-top { background-image:url(../images/default/layout/mini-top.gif); } .x-menu-scroller-bottom { background-image:url(../images/default/layout/mini-bottom.gif); } .x-box-tl { background-image: url(../images/default/box/corners.gif); } .x-box-tc { background-image: url(../images/default/box/tb.gif); } .x-box-tr { background-image: url(../images/default/box/corners.gif); } .x-box-ml { background-image: url(../images/default/box/l.gif); } .x-box-mc { background-color: #eee; background-image: url(../images/default/box/tb.gif); font-family: "Myriad Pro","Myriad Web","Tahoma","Helvetica","Arial",sans-serif; color: #393939; font-size: 15px; } .x-box-mc h3 { font-size: 18px; font-weight: bold; } .x-box-mr { background-image: url(../images/default/box/r.gif); } .x-box-bl { background-image: url(../images/default/box/corners.gif); } .x-box-bc { background-image: url(../images/default/box/tb.gif); } .x-box-br { background-image: url(../images/default/box/corners.gif); } .x-box-blue .x-box-bl, .x-box-blue .x-box-br, .x-box-blue .x-box-tl, .x-box-blue .x-box-tr { background-image: url(../images/default/box/corners-blue.gif); } .x-box-blue .x-box-bc, .x-box-blue .x-box-mc, .x-box-blue .x-box-tc { background-image: url(../images/default/box/tb-blue.gif); } .x-box-blue .x-box-mc { background-color: #c3daf9; } .x-box-blue .x-box-mc h3 { color: #17385b; } .x-box-blue .x-box-ml { background-image: url(../images/default/box/l-blue.gif); } .x-box-blue .x-box-mr { background-image: url(../images/default/box/r-blue.gif); } .x-combo-list { border:2px solid #232732; background-color:#555566; font:normal 15px tahoma, arial, helvetica, sans-serif; } .x-combo-list-inner { background-color:#414551; } .x-combo-list-hd { font:bold 14px tahoma, arial, helvetica, sans-serif; color:#fff; background-image: url(../images/default/layout/panel-title-light-bg.gif); border-bottom-color:#98c0f4; } .x-resizable-pinned .x-combo-list-inner { border-bottom-color:#98c0f4; } .x-combo-list-item { border-color:#556; } .x-combo-list .x-combo-selected { border-color:#e5872c !important; background-color:#e5872c; } .x-combo-list .x-toolbar { border-top-color:#98c0f4; } .x-combo-list-small { font:normal 14px tahoma, arial, helvetica, sans-serif; } .x-panel { border-color: #18181a; font-size: 14px; } .x-panel-header { color:#fff; font-weight:bold; font-size: 14px; font-family: tahoma,arial,verdana,sans-serif; border-color:#18181a; background-image: url(../images/access/panel/white-top-bottom.gif); } .x-panel-body { color: #fffff6; border-color:#18181a; background-color:#232d38; } .x-tab-panel .x-panel-body { color: #fffff6; border-color:#18181a; background-color:#1f2730; } .x-panel-bbar .x-toolbar, .x-panel-tbar .x-toolbar { border-color:#223; } .x-panel-tbar-noheader .x-toolbar, .x-panel-mc .x-panel-tbar .x-toolbar { border-top-color:#223; } .x-panel-body-noheader, .x-panel-mc .x-panel-body { border-top-color:#223; } .x-panel-tl .x-panel-header { color:#fff; font:bold 14px tahoma,arial,verdana,sans-serif; } .x-panel-tc { background-image: url(../images/access/panel/top-bottom.gif); } .x-panel-tl, .x-panel-tr, .x-panel-bl, .x-panel-br{ background-image: url(../images/access/panel/corners-sprite.gif); border-bottom-color:#222224; } .x-panel-bc { background-image: url(../images/access/panel/top-bottom.gif); } .x-panel-mc { font: normal 14px tahoma,arial,helvetica,sans-serif; background-color:#3f4757; } .x-panel-ml { background-image:url(../images/access/panel/left-right.gif); } .x-panel-mr { background-image: url(../images/access/panel/left-right.gif); } .x-tool { background-image:url(../images/access/panel/tool-sprites.gif); } .x-panel-ghost { background-color:#3f4757; } .x-panel-ghost ul { border-color:#18181a; } .x-panel-dd-spacer { border-color:#18181a; } .x-panel-fbar td,.x-panel-fbar span,.x-panel-fbar input,.x-panel-fbar div,.x-panel-fbar select,.x-panel-fbar label{ font:normal 14px arial,tahoma, helvetica, sans-serif; } .x-window-proxy { background-color:#1f2833; border-color:#18181a; } .x-window-tl .x-window-header { color:#fff; font:bold 14px tahoma,arial,verdana,sans-serif; } .x-window-tc { background-image: url(../images/access/window/top-bottom.png); } .x-window-tl { background-image: url(../images/access/window/left-corners.png); } .x-window-tr { background-image: url(../images/access/window/right-corners.png); } .x-window-bc { background-image: url(../images/access/window/top-bottom.png); } .x-window-bl { background-image: url(../images/access/window/left-corners.png); } .x-window-br { background-image: url(../images/access/window/right-corners.png); } .x-window-mc { border-color:#18181a; font: normal 14px tahoma,arial,helvetica,sans-serif; background-color:#1f2833; } .x-window-ml { background-image: url(../images/access/window/left-right.png); } .x-window-mr { background-image: url(../images/access/window/left-right.png); } .x-window-maximized .x-window-tc { background-color:#fff; } .x-window-bbar .x-toolbar { border-top-color:#323945; } .x-panel-ghost .x-window-tl { border-bottom-color:#323945; } .x-panel-collapsed .x-window-tl { border-bottom-color:#323945; } .x-dlg-mask{ background-color:#ccc; } .x-window-plain .x-window-mc { background-color: #464f61; border-color: #636778; } .x-window-plain .x-window-body { color: #fffff6; border-color: #464F61; } body.x-body-masked .x-window-plain .x-window-mc { background-color: #464f61; } .x-html-editor-wrap { border-color:#737B8C; background-color:#fff; } .x-html-editor-wrap iframe { background-color: #fff; } .x-html-editor-tb .x-btn-text { background-image:url(../images/access/editor/tb-sprite.gif); }.x-panel-noborder .x-panel-header-noborder { border-bottom-color:#343d4e; } .x-panel-noborder .x-panel-tbar-noborder .x-toolbar { border-bottom-color:#343d4e; } .x-panel-noborder .x-panel-bbar-noborder .x-toolbar { border-top-color:#343d4e; } .x-tab-panel-bbar-noborder .x-toolbar { border-top-color:#343d4e; } .x-tab-panel-tbar-noborder .x-toolbar { border-bottom-color:#343d4e; } .x-border-layout-ct { background-color:#3f4757; } .x-accordion-hd { color:#fff; font-weight:normal; background-image: url(../images/access/panel/light-hd.gif); } .x-layout-collapsed{ background-color:#323845; border-color:#1a1a1c; } .x-layout-collapsed-over{ background-color:#2d3440; } .x-layout-split-west .x-layout-mini { background-image:url(../images/default/layout/mini-left.gif); } .x-layout-split-east .x-layout-mini { background-image:url(../images/default/layout/mini-right.gif); } .x-layout-split-north .x-layout-mini { background-image:url(../images/default/layout/mini-top.gif); } .x-layout-split-south .x-layout-mini { background-image:url(../images/default/layout/mini-bottom.gif); } .x-layout-cmini-west .x-layout-mini { background-image:url(../images/default/layout/mini-right.gif); } .x-layout-cmini-east .x-layout-mini { background-image:url(../images/default/layout/mini-left.gif); } .x-layout-cmini-north .x-layout-mini { background-image:url(../images/default/layout/mini-bottom.gif); } .x-layout-cmini-south .x-layout-mini { background-image:url(../images/default/layout/mini-top.gif); } .x-progress-wrap { border-color:#18181a; } .x-progress-inner { background-color:#232d38; background-image:none; } .x-progress-bar { background-color:#f39a00; background-image:url(../images/access/progress/progress-bg.gif); border-top-color:#a66900; border-bottom-color:#a66900; border-right-color:#ffb941; height: 20px !important; /* structural override for Accessibility Theme */ } .x-progress-text { font-size:14px; font-weight:bold; color:#fff; padding: 0 5px !important; /* structural override for Accessibility Theme */ } .x-progress-text-back { color:#aaa; line-height: 19px; } .x-list-header{ background-color:#393d4e; background-image:url(../images/access/toolbar/bg.gif); background-position:0 top; } .x-list-header-inner div em { border-left-color:#667; font:normal 14px arial, tahoma, helvetica, sans-serif; line-height: 14px; } .x-list-body-inner { background-color:#1B232B; } .x-list-body dt em { font:normal 14px arial, tahoma, helvetica, sans-serif; } .x-list-over { background-color:#7E5530; } .x-list-selected { background-color:#E5872C; } .x-list-resizer { border-left-color:#555; border-right-color:#555; } .x-list-header-inner em.sort-asc, .x-list-header-inner em.sort-desc { background-image:url(../images/access/grid/sort-hd.gif); border-color: #3e4e6c; } .x-slider-horz, .x-slider-horz .x-slider-end, .x-slider-horz .x-slider-inner { background-image:url(../images/access/slider/slider-bg.png); } .x-slider-horz .x-slider-thumb { background-image:url(../images/access/slider/slider-thumb.png); } .x-slider-vert, .x-slider-vert .x-slider-end, .x-slider-vert .x-slider-inner { background-image:url(../images/access/slider/slider-v-bg.png); } .x-slider-vert .x-slider-thumb { background-image:url(../images/access/slider/slider-v-thumb.png); } .x-window-dlg .ext-mb-text, .x-window-dlg .x-window-header-text { font-size:15px; } .x-window-dlg .ext-mb-textarea { font:normal 15px tahoma,arial,helvetica,sans-serif; } .x-window-dlg .x-msg-box-wait { background-image:url(../images/access/grid/loading.gif); } .x-window-dlg .ext-mb-info { background-image:url(../images/access/window/icon-info.gif); } .x-window-dlg .ext-mb-warning { background-image:url(../images/access/window/icon-warning.gif); } .x-window-dlg .ext-mb-question { background-image:url(../images/access/window/icon-question.gif); } .x-window-dlg .ext-mb-error { background-image:url(../images/access/window/icon-error.gif); } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/xtheme-blue.css000066400000000000000000001141251226600447100232630ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .ext-el-mask { background-color: #ccc; } .ext-el-mask-msg { border-color:#6593cf; background-color:#c3daf9; background-image:url(../images/default/box/tb-blue.gif); } .ext-el-mask-msg div { background-color: #eee; border-color:#a3bad9; color:#222; font:normal 11px tahoma, arial, helvetica, sans-serif; } .x-mask-loading div { background-color:#fbfbfb; background-image:url(../images/default/grid/loading.gif); } .x-item-disabled { color: gray; } .x-item-disabled * { color: gray !important; } .x-splitbar-proxy { background-color: #aaa; } .x-color-palette a { border-color:#fff; } .x-color-palette a:hover, .x-color-palette a.x-color-palette-sel { border-color:#8bb8f3; background-color: #deecfd; } /* .x-color-palette em:hover, .x-color-palette span:hover{ background-color: #deecfd; } */ .x-color-palette em { border-color:#aca899; } .x-ie-shadow { background-color:#777; } .x-shadow .xsmc { background-image: url(../images/default/shadow-c.png); } .x-shadow .xsml, .x-shadow .xsmr { background-image: url(../images/default/shadow-lr.png); } .x-shadow .xstl, .x-shadow .xstc, .x-shadow .xstr, .x-shadow .xsbl, .x-shadow .xsbc, .x-shadow .xsbr{ background-image: url(../images/default/shadow.png); } .loading-indicator { font-size: 11px; background-image: url(../images/default/grid/loading.gif); } .x-spotlight { background-color: #ccc; } .x-tab-panel-header, .x-tab-panel-footer { background-color: #deecfd; border-color:#8db2e3; overflow:hidden; zoom:1; } .x-tab-panel-header, .x-tab-panel-footer { border-color:#8db2e3; } ul.x-tab-strip-top{ background-color:#cedff5; background-image: url(../images/default/tabs/tab-strip-bg.gif); border-bottom-color:#8db2e3; } ul.x-tab-strip-bottom{ background-color:#cedff5; background-image: url(../images/default/tabs/tab-strip-btm-bg.gif); border-top-color:#8db2e3; } .x-tab-panel-header-plain .x-tab-strip-spacer, .x-tab-panel-footer-plain .x-tab-strip-spacer { border-color:#8db2e3; background-color: #deecfd; } .x-tab-strip span.x-tab-strip-text { font:normal 11px tahoma,arial,helvetica; color:#416aa3; } .x-tab-strip-over span.x-tab-strip-text { color:#15428b; } .x-tab-strip-active span.x-tab-strip-text { color:#15428b; font-weight:bold; } .x-tab-strip-disabled .x-tabs-text { color:#aaaaaa; } .x-tab-strip-top .x-tab-right, .x-tab-strip-top .x-tab-left, .x-tab-strip-top .x-tab-strip-inner{ background-image: url(../images/default/tabs/tabs-sprite.gif); } .x-tab-strip-bottom .x-tab-right { background-image: url(../images/default/tabs/tab-btm-inactive-right-bg.gif); } .x-tab-strip-bottom .x-tab-left { background-image: url(../images/default/tabs/tab-btm-inactive-left-bg.gif); } .x-tab-strip-bottom .x-tab-strip-over .x-tab-right { background-image: url(../images/default/tabs/tab-btm-over-right-bg.gif); } .x-tab-strip-bottom .x-tab-strip-over .x-tab-left { background-image: url(../images/default/tabs/tab-btm-over-left-bg.gif); } .x-tab-strip-bottom .x-tab-strip-active .x-tab-right { background-image: url(../images/default/tabs/tab-btm-right-bg.gif); } .x-tab-strip-bottom .x-tab-strip-active .x-tab-left { background-image: url(../images/default/tabs/tab-btm-left-bg.gif); } .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close { background-image:url(../images/default/tabs/tab-close.gif); } .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close:hover{ background-image:url(../images/default/tabs/tab-close.gif); } .x-tab-panel-body { border-color:#8db2e3; background-color:#fff; } .x-tab-panel-body-top { border-top: 0 none; } .x-tab-panel-body-bottom { border-bottom: 0 none; } .x-tab-scroller-left { background-image:url(../images/default/tabs/scroll-left.gif); border-bottom-color:#8db2e3; } .x-tab-scroller-left-over { background-position: 0 0; } .x-tab-scroller-left-disabled { background-position: -18px 0; opacity:.5; -moz-opacity:.5; filter:alpha(opacity=50); cursor:default; } .x-tab-scroller-right { background-image:url(../images/default/tabs/scroll-right.gif); border-bottom-color:#8db2e3; } .x-tab-panel-bbar .x-toolbar, .x-tab-panel-tbar .x-toolbar { border-color:#99bbe8; }.x-form-field { font:normal 12px tahoma, arial, helvetica, sans-serif; } .x-form-text, textarea.x-form-field { background-color:#fff; background-image:url(../images/default/form/text-bg.gif); border-color:#b5b8c8; } .x-form-select-one { background-color:#fff; border-color:#b5b8c8; } .x-form-check-group-label { border-bottom: 1px solid #99bbe8; color: #15428b; } .x-editor .x-form-check-wrap { background-color:#fff; } .x-form-field-wrap .x-form-trigger { background-image:url(../images/default/form/trigger.gif); border-bottom-color:#b5b8c8; } .x-form-field-wrap .x-form-date-trigger { background-image: url(../images/default/form/date-trigger.gif); } .x-form-field-wrap .x-form-clear-trigger { background-image: url(../images/default/form/clear-trigger.gif); } .x-form-field-wrap .x-form-search-trigger { background-image: url(../images/default/form/search-trigger.gif); } .x-trigger-wrap-focus .x-form-trigger { border-bottom-color:#7eadd9; } .x-item-disabled .x-form-trigger-over { border-bottom-color:#b5b8c8; } .x-item-disabled .x-form-trigger-click { border-bottom-color:#b5b8c8; } .x-form-focus, textarea.x-form-focus { border-color:#7eadd9; } .x-form-invalid, textarea.x-form-invalid { background-color:#fff; background-image:url(../images/default/grid/invalid_line.gif); border-color:#c30; } .x-form-invalid.x-form-composite { border: none; background-image: none; } .x-form-invalid.x-form-composite .x-form-invalid { background-color:#fff; background-image:url(../images/default/grid/invalid_line.gif); border-color:#c30; } .x-form-inner-invalid, textarea.x-form-inner-invalid { background-color:#fff; background-image:url(../images/default/grid/invalid_line.gif); } .x-form-grow-sizer { font:normal 12px tahoma, arial, helvetica, sans-serif; } .x-form-item { font:normal 12px tahoma, arial, helvetica, sans-serif; } .x-form-invalid-msg { color:#c0272b; font:normal 11px tahoma, arial, helvetica, sans-serif; background-image:url(../images/default/shared/warning.gif); } .x-form-empty-field { color:gray; } .x-small-editor .x-form-field { font:normal 11px arial, tahoma, helvetica, sans-serif; } .ext-webkit .x-small-editor .x-form-field { font:normal 11px arial, tahoma, helvetica, sans-serif; } .x-form-invalid-icon { background-image:url(../images/default/form/exclamation.gif); } .x-fieldset { border-color:#b5b8c8; } .x-fieldset legend { font:bold 11px tahoma, arial, helvetica, sans-serif; color:#15428b; } .x-btn{ font:normal 11px tahoma, verdana, helvetica; } .x-btn button{ font:normal 11px arial,tahoma,verdana,helvetica; color:#333; } .x-btn em { font-style:normal; font-weight:normal; } .x-btn-tl, .x-btn-tr, .x-btn-tc, .x-btn-ml, .x-btn-mr, .x-btn-mc, .x-btn-bl, .x-btn-br, .x-btn-bc{ background-image:url(../images/default/button/btn.gif); } .x-btn-click .x-btn-text, .x-btn-menu-active .x-btn-text, .x-btn-pressed .x-btn-text{ color:#000; } .x-btn-disabled *{ color:gray !important; } .x-btn-mc em.x-btn-arrow { background-image:url(../images/default/button/arrow.gif); } .x-btn-mc em.x-btn-split { background-image:url(../images/default/button/s-arrow.gif); } .x-btn-over .x-btn-mc em.x-btn-split, .x-btn-click .x-btn-mc em.x-btn-split, .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-btn-pressed .x-btn-mc em.x-btn-split { background-image:url(../images/default/button/s-arrow-o.gif); } .x-btn-mc em.x-btn-arrow-bottom { background-image:url(../images/default/button/s-arrow-b-noline.gif); } .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/default/button/s-arrow-b.gif); } .x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-btn-click .x-btn-mc em.x-btn-split-bottom, .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-btn-pressed .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/default/button/s-arrow-bo.gif); } .x-btn-group-header { color: #3e6aaa; } .x-btn-group-tc { background-image: url(../images/default/button/group-tb.gif); } .x-btn-group-tl { background-image: url(../images/default/button/group-cs.gif); } .x-btn-group-tr { background-image: url(../images/default/button/group-cs.gif); } .x-btn-group-bc { background-image: url(../images/default/button/group-tb.gif); } .x-btn-group-bl { background-image: url(../images/default/button/group-cs.gif); } .x-btn-group-br { background-image: url(../images/default/button/group-cs.gif); } .x-btn-group-ml { background-image: url(../images/default/button/group-lr.gif); } .x-btn-group-mr { background-image: url(../images/default/button/group-lr.gif); } .x-btn-group-notitle .x-btn-group-tc { background-image: url(../images/default/button/group-tb.gif); }.x-toolbar{ border-color:#a9bfd3; background-color:#d0def0; background-image:url(../images/default/toolbar/bg.gif); } .x-toolbar td,.x-toolbar span,.x-toolbar input,.x-toolbar div,.x-toolbar select,.x-toolbar label{ font:normal 11px arial,tahoma, helvetica, sans-serif; } .x-toolbar .x-item-disabled { color:gray; } .x-toolbar .x-item-disabled * { color:gray; } .x-toolbar .x-btn-mc em.x-btn-split { background-image:url(../images/default/button/s-arrow-noline.gif); } .x-toolbar .x-btn-over .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split { background-image:url(../images/default/button/s-arrow-o.gif); } .x-toolbar .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/default/button/s-arrow-b-noline.gif); } .x-toolbar .x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/default/button/s-arrow-bo.gif); } .x-toolbar .xtb-sep { background-image: url(../images/default/grid/grid-blue-split.gif); } .x-tbar-page-first{ background-image: url(../images/default/grid/page-first.gif) !important; } .x-tbar-loading{ background-image: url(../images/default/grid/refresh.gif) !important; } .x-tbar-page-last{ background-image: url(../images/default/grid/page-last.gif) !important; } .x-tbar-page-next{ background-image: url(../images/default/grid/page-next.gif) !important; } .x-tbar-page-prev{ background-image: url(../images/default/grid/page-prev.gif) !important; } .x-item-disabled .x-tbar-loading{ background-image: url(../images/default/grid/refresh-disabled.gif) !important; } .x-item-disabled .x-tbar-page-first{ background-image: url(../images/default/grid/page-first-disabled.gif) !important; } .x-item-disabled .x-tbar-page-last{ background-image: url(../images/default/grid/page-last-disabled.gif) !important; } .x-item-disabled .x-tbar-page-next{ background-image: url(../images/default/grid/page-next-disabled.gif) !important; } .x-item-disabled .x-tbar-page-prev{ background-image: url(../images/default/grid/page-prev-disabled.gif) !important; } .x-paging-info { color:#444; } .x-toolbar-more-icon { background-image: url(../images/default/toolbar/more.gif) !important; }.x-resizable-handle { background-color:#fff; } .x-resizable-over .x-resizable-handle-east, .x-resizable-pinned .x-resizable-handle-east, .x-resizable-over .x-resizable-handle-west, .x-resizable-pinned .x-resizable-handle-west { background-image:url(../images/default/sizer/e-handle.gif); } .x-resizable-over .x-resizable-handle-south, .x-resizable-pinned .x-resizable-handle-south, .x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north { background-image:url(../images/default/sizer/s-handle.gif); } .x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north{ background-image:url(../images/default/sizer/s-handle.gif); } .x-resizable-over .x-resizable-handle-southeast, .x-resizable-pinned .x-resizable-handle-southeast{ background-image:url(../images/default/sizer/se-handle.gif); } .x-resizable-over .x-resizable-handle-northwest, .x-resizable-pinned .x-resizable-handle-northwest{ background-image:url(../images/default/sizer/nw-handle.gif); } .x-resizable-over .x-resizable-handle-northeast, .x-resizable-pinned .x-resizable-handle-northeast{ background-image:url(../images/default/sizer/ne-handle.gif); } .x-resizable-over .x-resizable-handle-southwest, .x-resizable-pinned .x-resizable-handle-southwest{ background-image:url(../images/default/sizer/sw-handle.gif); } .x-resizable-proxy{ border-color:#3b5a82; } .x-resizable-overlay{ background-color:#fff; } .x-grid3 { background-color:#fff; } .x-grid-panel .x-panel-mc .x-panel-body { border-color:#99bbe8; } .x-grid3-row td, .x-grid3-summary-row td{ font:normal 11px/13px arial, tahoma, helvetica, sans-serif; } .x-grid3-hd-row td { font:normal 11px/15px arial, tahoma, helvetica, sans-serif; } .x-grid3-hd-row td { border-left-color:#eee; border-right-color:#d0d0d0; } .x-grid-row-loading { background-color: #fff; background-image:url(../images/default/shared/loading-balls.gif); } .x-grid3-row { border-color:#ededed; border-top-color:#fff; } .x-grid3-row-alt{ background-color:#fafafa; } .x-grid3-row-over { border-color:#ddd; background-color:#efefef; background-image:url(../images/default/grid/row-over.gif); } .x-grid3-resize-proxy { background-color:#777; } .x-grid3-resize-marker { background-color:#777; } .x-grid3-header{ background-color:#f9f9f9; background-image:url(../images/default/grid/grid3-hrow.gif); } .x-grid3-header-pop { border-left-color:#d0d0d0; } .x-grid3-header-pop-inner { border-left-color:#eee; background-image:url(../images/default/grid/hd-pop.gif); } td.x-grid3-hd-over, td.sort-desc, td.sort-asc, td.x-grid3-hd-menu-open { border-left-color:#aaccf6; border-right-color:#aaccf6; } td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-asc .x-grid3-hd-inner, td.x-grid3-hd-menu-open .x-grid3-hd-inner { background-color:#ebf3fd; background-image:url(../images/default/grid/grid3-hrow-over.gif); } .sort-asc .x-grid3-sort-icon { background-image: url(../images/default/grid/sort_asc.gif); } .sort-desc .x-grid3-sort-icon { background-image: url(../images/default/grid/sort_desc.gif); } .x-grid3-cell-text, .x-grid3-hd-text { color:#000; } .x-grid3-split { background-image: url(../images/default/grid/grid-split.gif); } .x-grid3-hd-text { color:#15428b; } .x-dd-drag-proxy .x-grid3-hd-inner{ background-color:#ebf3fd; background-image:url(../images/default/grid/grid3-hrow-over.gif); border-color:#aaccf6; } .col-move-top{ background-image:url(../images/default/grid/col-move-top.gif); } .col-move-bottom{ background-image:url(../images/default/grid/col-move-bottom.gif); } td.grid-hd-group-cell { background: url(../images/default/grid/grid3-hrow.gif) repeat-x bottom; } .x-grid3-row-selected { background-color: #dfe8f6 !important; background-image: none; border-color:#a3bae9; } .x-grid3-cell-selected{ background-color: #b8cfee !important; color:#000; } .x-grid3-cell-selected span{ color:#000 !important; } .x-grid3-cell-selected .x-grid3-cell-text{ color:#000; } .x-grid3-locked td.x-grid3-row-marker, .x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker{ background-color:#ebeadb !important; background-image:url(../images/default/grid/grid-hrow.gif) !important; color:#000; border-top-color:#fff; border-right-color:#6fa0df !important; } .x-grid3-locked td.x-grid3-row-marker div, .x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker div{ color:#15428b !important; } .x-grid3-dirty-cell { background-image:url(../images/default/grid/dirty.gif); } .x-grid3-topbar, .x-grid3-bottombar{ font:normal 11px arial, tahoma, helvetica, sans-serif; } .x-grid3-bottombar .x-toolbar{ border-top-color:#a9bfd3; } .x-props-grid .x-grid3-td-name .x-grid3-cell-inner{ background-image:url(../images/default/grid/grid3-special-col-bg.gif) !important; color:#000 !important; } .x-props-grid .x-grid3-body .x-grid3-td-name{ background-color:#fff !important; border-right-color:#eee; } .xg-hmenu-sort-asc .x-menu-item-icon{ background-image: url(../images/default/grid/hmenu-asc.gif); } .xg-hmenu-sort-desc .x-menu-item-icon{ background-image: url(../images/default/grid/hmenu-desc.gif); } .xg-hmenu-lock .x-menu-item-icon{ background-image: url(../images/default/grid/hmenu-lock.gif); } .xg-hmenu-unlock .x-menu-item-icon{ background-image: url(../images/default/grid/hmenu-unlock.gif); } .x-grid3-hd-btn { background-color:#c3daf9; background-image:url(../images/default/grid/grid3-hd-btn.gif); } .x-grid3-body .x-grid3-td-expander { background-image:url(../images/default/grid/grid3-special-col-bg.gif); } .x-grid3-row-expander { background-image:url(../images/default/grid/row-expand-sprite.gif); } .x-grid3-body .x-grid3-td-checker { background-image: url(../images/default/grid/grid3-special-col-bg.gif); } .x-grid3-row-checker, .x-grid3-hd-checker { background-image:url(../images/default/grid/row-check-sprite.gif); } .x-grid3-body .x-grid3-td-numberer { background-image:url(../images/default/grid/grid3-special-col-bg.gif); } .x-grid3-body .x-grid3-td-numberer .x-grid3-cell-inner { color:#444; } .x-grid3-body .x-grid3-td-row-icon { background-image:url(../images/default/grid/grid3-special-col-bg.gif); } .x-grid3-body .x-grid3-row-selected .x-grid3-td-numberer, .x-grid3-body .x-grid3-row-selected .x-grid3-td-checker, .x-grid3-body .x-grid3-row-selected .x-grid3-td-expander { background-image:url(../images/default/grid/grid3-special-col-sel-bg.gif); } .x-grid3-check-col { background-image:url(../images/default/menu/unchecked.gif); } .x-grid3-check-col-on { background-image:url(../images/default/menu/checked.gif); } .x-grid-group, .x-grid-group-body, .x-grid-group-hd { zoom:1; } .x-grid-group-hd { border-bottom-color:#99bbe8; } .x-grid-group-hd div.x-grid-group-title { background-image:url(../images/default/grid/group-collapse.gif); color:#3764a0; font:bold 11px tahoma, arial, helvetica, sans-serif; } .x-grid-group-collapsed .x-grid-group-hd div.x-grid-group-title { background-image:url(../images/default/grid/group-expand.gif); } .x-group-by-icon { background-image:url(../images/default/grid/group-by.gif); } .x-cols-icon { background-image:url(../images/default/grid/columns.gif); } .x-show-groups-icon { background-image:url(../images/default/grid/group-by.gif); } .x-grid-empty { color:gray; font:normal 11px tahoma, arial, helvetica, sans-serif; } .x-grid-with-col-lines .x-grid3-row td.x-grid3-cell { border-right-color:#ededed; } .x-grid-with-col-lines .x-grid3-row-selected { border-top-color:#a3bae9; }.x-pivotgrid .x-grid3-header-offset table td { background: url(../images/default/grid/grid3-hrow.gif) repeat-x 50% 100%; border-left: 1px solid; border-right: 1px solid; border-left-color: #EEE; border-right-color: #D0D0D0; } .x-pivotgrid .x-grid3-row-headers { background-color: #f9f9f9; } .x-pivotgrid .x-grid3-row-headers table td { background: #EEE url(../images/default/grid/grid3-rowheader.gif) repeat-x left top; border-left: 1px solid; border-right: 1px solid; border-left-color: #EEE; border-right-color: #D0D0D0; border-bottom: 1px solid; border-bottom-color: #D0D0D0; height: 18px; } .x-dd-drag-ghost{ color:#000; font: normal 11px arial, helvetica, sans-serif; border-color: #ddd #bbb #bbb #ddd; background-color:#fff; } .x-dd-drop-nodrop .x-dd-drop-icon{ background-image: url(../images/default/dd/drop-no.gif); } .x-dd-drop-ok .x-dd-drop-icon{ background-image: url(../images/default/dd/drop-yes.gif); } .x-dd-drop-ok-add .x-dd-drop-icon{ background-image: url(../images/default/dd/drop-add.gif); } .x-view-selector { background-color:#c3daf9; border-color:#3399bb; }.x-tree-node-expanded .x-tree-node-icon{ background-image:url(../images/default/tree/folder-open.gif); } .x-tree-node-leaf .x-tree-node-icon{ background-image:url(../images/default/tree/leaf.gif); } .x-tree-node-collapsed .x-tree-node-icon{ background-image:url(../images/default/tree/folder.gif); } .x-tree-node-loading .x-tree-node-icon{ background-image:url(../images/default/tree/loading.gif) !important; } .x-tree-node .x-tree-node-inline-icon { background-image: none; } .x-tree-node-loading a span{ font-style: italic; color:#444444; } .x-tree-lines .x-tree-elbow{ background-image:url(../images/default/tree/elbow.gif); } .x-tree-lines .x-tree-elbow-plus{ background-image:url(../images/default/tree/elbow-plus.gif); } .x-tree-lines .x-tree-elbow-minus{ background-image:url(../images/default/tree/elbow-minus.gif); } .x-tree-lines .x-tree-elbow-end{ background-image:url(../images/default/tree/elbow-end.gif); } .x-tree-lines .x-tree-elbow-end-plus{ background-image:url(../images/default/tree/elbow-end-plus.gif); } .x-tree-lines .x-tree-elbow-end-minus{ background-image:url(../images/default/tree/elbow-end-minus.gif); } .x-tree-lines .x-tree-elbow-line{ background-image:url(../images/default/tree/elbow-line.gif); } .x-tree-no-lines .x-tree-elbow-plus{ background-image:url(../images/default/tree/elbow-plus-nl.gif); } .x-tree-no-lines .x-tree-elbow-minus{ background-image:url(../images/default/tree/elbow-minus-nl.gif); } .x-tree-no-lines .x-tree-elbow-end-plus{ background-image:url(../images/default/tree/elbow-end-plus-nl.gif); } .x-tree-no-lines .x-tree-elbow-end-minus{ background-image:url(../images/default/tree/elbow-end-minus-nl.gif); } .x-tree-arrows .x-tree-elbow-plus{ background-image:url(../images/default/tree/arrows.gif); } .x-tree-arrows .x-tree-elbow-minus{ background-image:url(../images/default/tree/arrows.gif); } .x-tree-arrows .x-tree-elbow-end-plus{ background-image:url(../images/default/tree/arrows.gif); } .x-tree-arrows .x-tree-elbow-end-minus{ background-image:url(../images/default/tree/arrows.gif); } .x-tree-node{ color:#000; font: normal 11px arial, tahoma, helvetica, sans-serif; } .x-tree-node a, .x-dd-drag-ghost a{ color:#000; } .x-tree-node a span, .x-dd-drag-ghost a span{ color:#000; } .x-tree-node .x-tree-node-disabled a span{ color:gray !important; } .x-tree-node div.x-tree-drag-insert-below{ border-bottom-color:#36c; } .x-tree-node div.x-tree-drag-insert-above{ border-top-color:#36c; } .x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-below a{ border-bottom-color:#36c; } .x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-above a{ border-top-color:#36c; } .x-tree-node .x-tree-drag-append a span{ background-color:#ddd; border-color:gray; } .x-tree-node .x-tree-node-over { background-color: #eee; } .x-tree-node .x-tree-selected { background-color: #d9e8fb; } .x-tree-drop-ok-append .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-add.gif); } .x-tree-drop-ok-above .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-over.gif); } .x-tree-drop-ok-below .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-under.gif); } .x-tree-drop-ok-between .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-between.gif); }.x-date-picker { border-color: #1b376c; background-color:#fff; } .x-date-middle,.x-date-left,.x-date-right { background-image: url(../images/default/shared/hd-sprite.gif); color:#fff; font:bold 11px "sans serif", tahoma, verdana, helvetica; } .x-date-middle .x-btn .x-btn-text { color:#fff; } .x-date-middle .x-btn-mc em.x-btn-arrow { background-image:url(../images/default/toolbar/btn-arrow-light.gif); } .x-date-right a { background-image: url(../images/default/shared/right-btn.gif); } .x-date-left a{ background-image: url(../images/default/shared/left-btn.gif); } .x-date-inner th { background-color:#dfecfb; background-image:url(../images/default/shared/glass-bg.gif); border-bottom-color:#a3bad9; font:normal 10px arial, helvetica,tahoma,sans-serif; color:#233d6d; } .x-date-inner td { border-color:#fff; } .x-date-inner a { font:normal 11px arial, helvetica,tahoma,sans-serif; color:#000; } .x-date-inner .x-date-active{ color:#000; } .x-date-inner .x-date-selected a{ background-color:#dfecfb; background-image:url(../images/default/shared/glass-bg.gif); border-color:#8db2e3; } .x-date-inner .x-date-today a{ border-color:darkred; } .x-date-inner .x-date-selected span{ font-weight:bold; } .x-date-inner .x-date-prevday a,.x-date-inner .x-date-nextday a { color:#aaa; } .x-date-bottom { border-top-color:#a3bad9; background-color:#dfecfb; background-image:url(../images/default/shared/glass-bg.gif); } .x-date-inner a:hover, .x-date-inner .x-date-disabled a:hover{ color:#000; background-color:#ddecfe; } .x-date-inner .x-date-disabled a { background-color:#eee; color:#bbb; } .x-date-mmenu{ background-color:#eee !important; } .x-date-mmenu .x-menu-item { font-size:10px; color:#000; } .x-date-mp { background-color:#fff; } .x-date-mp td { font:normal 11px arial, helvetica,tahoma,sans-serif; } .x-date-mp-btns button { background-color:#083772; color:#fff; border-color: #3366cc #000055 #000055 #3366cc; font:normal 11px arial, helvetica,tahoma,sans-serif; } .x-date-mp-btns { background-color: #dfecfb; background-image: url(../images/default/shared/glass-bg.gif); } .x-date-mp-btns td { border-top-color: #c5d2df; } td.x-date-mp-month a,td.x-date-mp-year a { color:#15428b; } td.x-date-mp-month a:hover,td.x-date-mp-year a:hover { color:#15428b; background-color: #ddecfe; } td.x-date-mp-sel a { background-color: #dfecfb; background-image: url(../images/default/shared/glass-bg.gif); border-color:#8db2e3; } .x-date-mp-ybtn a { background-image:url(../images/default/panel/tool-sprites.gif); } td.x-date-mp-sep { border-right-color:#c5d2df; }.x-tip .x-tip-close{ background-image: url(../images/default/qtip/close.gif); } .x-tip .x-tip-tc, .x-tip .x-tip-tl, .x-tip .x-tip-tr, .x-tip .x-tip-bc, .x-tip .x-tip-bl, .x-tip .x-tip-br, .x-tip .x-tip-ml, .x-tip .x-tip-mr { background-image: url(../images/default/qtip/tip-sprite.gif); } .x-tip .x-tip-mc { font: normal 11px tahoma,arial,helvetica,sans-serif; } .x-tip .x-tip-ml { background-color: #fff; } .x-tip .x-tip-header-text { font: bold 11px tahoma,arial,helvetica,sans-serif; color:#444; } .x-tip .x-tip-body { font: normal 11px tahoma,arial,helvetica,sans-serif; color:#444; } .x-form-invalid-tip .x-tip-tc, .x-form-invalid-tip .x-tip-tl, .x-form-invalid-tip .x-tip-tr, .x-form-invalid-tip .x-tip-bc, .x-form-invalid-tip .x-tip-bl, .x-form-invalid-tip .x-tip-br, .x-form-invalid-tip .x-tip-ml, .x-form-invalid-tip .x-tip-mr { background-image: url(../images/default/form/error-tip-corners.gif); } .x-form-invalid-tip .x-tip-body { background-image:url(../images/default/form/exclamation.gif); } .x-tip-anchor { background-image:url(../images/default/qtip/tip-anchor-sprite.gif); }.x-menu { background-color:#f0f0f0; background-image:url(../images/default/menu/menu.gif); } .x-menu-floating{ border-color:#718bb7; } .x-menu-nosep { background-image:none; } .x-menu-list-item{ font:normal 11px arial,tahoma,sans-serif; } .x-menu-item-arrow{ background-image:url(../images/default/menu/menu-parent.gif); } .x-menu-sep { background-color:#e0e0e0; border-bottom-color:#fff; } a.x-menu-item { color:#222; } .x-menu-item-active { background-image: url(../images/default/menu/item-over.gif); background-color: #dbecf4; border-color:#aaccf6; } .x-menu-item-active a.x-menu-item { border-color:#aaccf6; } .x-menu-check-item .x-menu-item-icon{ background-image:url(../images/default/menu/unchecked.gif); } .x-menu-item-checked .x-menu-item-icon{ background-image:url(../images/default/menu/checked.gif); } .x-menu-item-checked .x-menu-group-item .x-menu-item-icon{ background-image:url(../images/default/menu/group-checked.gif); } .x-menu-group-item .x-menu-item-icon{ background-image:none; } .x-menu-plain { background-color:#f0f0f0 !important; background-image: none; } .x-date-menu, .x-color-menu{ background-color: #fff !important; } .x-menu .x-date-picker{ border-color:#a3bad9; } .x-cycle-menu .x-menu-item-checked { border-color:#a3bae9 !important; background-color:#def8f6; } .x-menu-scroller-top { background-image:url(../images/default/layout/mini-top.gif); } .x-menu-scroller-bottom { background-image:url(../images/default/layout/mini-bottom.gif); } .x-box-tl { background-image: url(../images/default/box/corners.gif); } .x-box-tc { background-image: url(../images/default/box/tb.gif); } .x-box-tr { background-image: url(../images/default/box/corners.gif); } .x-box-ml { background-image: url(../images/default/box/l.gif); } .x-box-mc { background-color: #eee; background-image: url(../images/default/box/tb.gif); font-family: "Myriad Pro","Myriad Web","Tahoma","Helvetica","Arial",sans-serif; color: #393939; font-size: 12px; } .x-box-mc h3 { font-size: 14px; font-weight: bold; } .x-box-mr { background-image: url(../images/default/box/r.gif); } .x-box-bl { background-image: url(../images/default/box/corners.gif); } .x-box-bc { background-image: url(../images/default/box/tb.gif); } .x-box-br { background-image: url(../images/default/box/corners.gif); } .x-box-blue .x-box-bl, .x-box-blue .x-box-br, .x-box-blue .x-box-tl, .x-box-blue .x-box-tr { background-image: url(../images/default/box/corners-blue.gif); } .x-box-blue .x-box-bc, .x-box-blue .x-box-mc, .x-box-blue .x-box-tc { background-image: url(../images/default/box/tb-blue.gif); } .x-box-blue .x-box-mc { background-color: #c3daf9; } .x-box-blue .x-box-mc h3 { color: #17385b; } .x-box-blue .x-box-ml { background-image: url(../images/default/box/l-blue.gif); } .x-box-blue .x-box-mr { background-image: url(../images/default/box/r-blue.gif); }.x-combo-list { border-color:#98c0f4; background-color:#ddecfe; font:normal 12px tahoma, arial, helvetica, sans-serif; } .x-combo-list-inner { background-color:#fff; } .x-combo-list-hd { font:bold 11px tahoma, arial, helvetica, sans-serif; color:#15428b; background-image: url(../images/default/layout/panel-title-light-bg.gif); border-bottom-color:#98c0f4; } .x-resizable-pinned .x-combo-list-inner { border-bottom-color:#98c0f4; } .x-combo-list-item { border-color:#fff; } .x-combo-list .x-combo-selected{ border-color:#a3bae9 !important; background-color:#dfe8f6; } .x-combo-list .x-toolbar { border-top-color:#98c0f4; } .x-combo-list-small { font:normal 11px tahoma, arial, helvetica, sans-serif; }.x-panel { border-color: #99bbe8; } .x-panel-header { color:#15428b; font-weight:bold; font-size: 11px; font-family: tahoma,arial,verdana,sans-serif; border-color:#99bbe8; background-image: url(../images/default/panel/white-top-bottom.gif); } .x-panel-body { border-color:#99bbe8; background-color:#fff; } .x-panel-bbar .x-toolbar, .x-panel-tbar .x-toolbar { border-color:#99bbe8; } .x-panel-tbar-noheader .x-toolbar, .x-panel-mc .x-panel-tbar .x-toolbar { border-top-color:#99bbe8; } .x-panel-body-noheader, .x-panel-mc .x-panel-body { border-top-color:#99bbe8; } .x-panel-tl .x-panel-header { color:#15428b; font:bold 11px tahoma,arial,verdana,sans-serif; } .x-panel-tc { background-image: url(../images/default/panel/top-bottom.gif); } .x-panel-tl, .x-panel-tr, .x-panel-bl, .x-panel-br{ background-image: url(../images/default/panel/corners-sprite.gif); border-bottom-color:#99bbe8; } .x-panel-bc { background-image: url(../images/default/panel/top-bottom.gif); } .x-panel-mc { font: normal 11px tahoma,arial,helvetica,sans-serif; background-color:#dfe8f6; } .x-panel-ml { background-color: #fff; background-image:url(../images/default/panel/left-right.gif); } .x-panel-mr { background-image: url(../images/default/panel/left-right.gif); } .x-tool { background-image:url(../images/default/panel/tool-sprites.gif); } .x-panel-ghost { background-color:#cbddf3; } .x-panel-ghost ul { border-color:#99bbe8; } .x-panel-dd-spacer { border-color:#99bbe8; } .x-panel-fbar td,.x-panel-fbar span,.x-panel-fbar input,.x-panel-fbar div,.x-panel-fbar select,.x-panel-fbar label{ font:normal 11px arial,tahoma, helvetica, sans-serif; } .x-window-proxy { background-color:#c7dffc; border-color:#99bbe8; } .x-window-tl .x-window-header { color:#15428b; font:bold 11px tahoma,arial,verdana,sans-serif; } .x-window-tc { background-image: url(../images/default/window/top-bottom.png); } .x-window-tl { background-image: url(../images/default/window/left-corners.png); } .x-window-tr { background-image: url(../images/default/window/right-corners.png); } .x-window-bc { background-image: url(../images/default/window/top-bottom.png); } .x-window-bl { background-image: url(../images/default/window/left-corners.png); } .x-window-br { background-image: url(../images/default/window/right-corners.png); } .x-window-mc { border-color:#99bbe8; font: normal 11px tahoma,arial,helvetica,sans-serif; background-color:#dfe8f6; } .x-window-ml { background-image: url(../images/default/window/left-right.png); } .x-window-mr { background-image: url(../images/default/window/left-right.png); } .x-window-maximized .x-window-tc { background-color:#fff; } .x-window-bbar .x-toolbar { border-top-color:#99bbe8; } .x-panel-ghost .x-window-tl { border-bottom-color:#99bbe8; } .x-panel-collapsed .x-window-tl { border-bottom-color:#84a0c4; } .x-dlg-mask{ background-color:#ccc; } .x-window-plain .x-window-mc { background-color: #ccd9e8; border-color: #a3bae9 #dfe8f6 #dfe8f6 #a3bae9; } .x-window-plain .x-window-body { border-color: #dfe8f6 #a3bae9 #a3bae9 #dfe8f6; } body.x-body-masked .x-window-plain .x-window-mc { background-color: #ccd9e8; }.x-html-editor-wrap { border-color:#a9bfd3; background-color:#fff; } .x-html-editor-tb .x-btn-text { background-image:url(../images/default/editor/tb-sprite.gif); }.x-panel-noborder .x-panel-header-noborder { border-bottom-color:#99bbe8; } .x-panel-noborder .x-panel-tbar-noborder .x-toolbar { border-bottom-color:#99bbe8; } .x-panel-noborder .x-panel-bbar-noborder .x-toolbar { border-top-color:#99bbe8; } .x-tab-panel-bbar-noborder .x-toolbar { border-top-color:#99bbe8; } .x-tab-panel-tbar-noborder .x-toolbar { border-bottom-color:#99bbe8; }.x-border-layout-ct { background-color:#dfe8f6; } .x-accordion-hd { color:#222; font-weight:normal; background-image: url(../images/default/panel/light-hd.gif); } .x-layout-collapsed{ background-color:#d2e0f2; border-color:#98c0f4; } .x-layout-collapsed-over{ background-color:#d9e8fb; } .x-layout-split-west .x-layout-mini { background-image:url(../images/default/layout/mini-left.gif); } .x-layout-split-east .x-layout-mini { background-image:url(../images/default/layout/mini-right.gif); } .x-layout-split-north .x-layout-mini { background-image:url(../images/default/layout/mini-top.gif); } .x-layout-split-south .x-layout-mini { background-image:url(../images/default/layout/mini-bottom.gif); } .x-layout-cmini-west .x-layout-mini { background-image:url(../images/default/layout/mini-right.gif); } .x-layout-cmini-east .x-layout-mini { background-image:url(../images/default/layout/mini-left.gif); } .x-layout-cmini-north .x-layout-mini { background-image:url(../images/default/layout/mini-bottom.gif); } .x-layout-cmini-south .x-layout-mini { background-image:url(../images/default/layout/mini-top.gif); }.x-progress-wrap { border-color:#6593cf; } .x-progress-inner { background-color:#e0e8f3; background-image:url(../images/default/qtip/bg.gif); } .x-progress-bar { background-color:#9cbfee; background-image:url(../images/default/progress/progress-bg.gif); border-top-color:#d1e4fd; border-bottom-color:#7fa9e4; border-right-color:#7fa9e4; } .x-progress-text { font-size:11px; font-weight:bold; color:#fff; } .x-progress-text-back { color:#396095; }.x-list-header{ background-color:#f9f9f9; background-image:url(../images/default/grid/grid3-hrow.gif); } .x-list-header-inner div em { border-left-color:#ddd; font:normal 11px arial, tahoma, helvetica, sans-serif; } .x-list-body dt em { font:normal 11px arial, tahoma, helvetica, sans-serif; } .x-list-over { background-color:#eee; } .x-list-selected { background-color:#dfe8f6; } .x-list-resizer { border-left-color:#555; border-right-color:#555; } .x-list-header-inner em.sort-asc, .x-list-header-inner em.sort-desc { background-image:url(../images/default/grid/sort-hd.gif); border-color: #99bbe8; }.x-slider-horz, .x-slider-horz .x-slider-end, .x-slider-horz .x-slider-inner { background-image:url(../images/default/slider/slider-bg.png); } .x-slider-horz .x-slider-thumb { background-image:url(../images/default/slider/slider-thumb.png); } .x-slider-vert, .x-slider-vert .x-slider-end, .x-slider-vert .x-slider-inner { background-image:url(../images/default/slider/slider-v-bg.png); } .x-slider-vert .x-slider-thumb { background-image:url(../images/default/slider/slider-v-thumb.png); }.x-window-dlg .ext-mb-text, .x-window-dlg .x-window-header-text { font-size:12px; } .x-window-dlg .ext-mb-textarea { font:normal 12px tahoma,arial,helvetica,sans-serif; } .x-window-dlg .x-msg-box-wait { background-image:url(../images/default/grid/loading.gif); } .x-window-dlg .ext-mb-info { background-image:url(../images/default/window/icon-info.gif); } .x-window-dlg .ext-mb-warning { background-image:url(../images/default/window/icon-warning.gif); } .x-window-dlg .ext-mb-question { background-image:url(../images/default/window/icon-question.gif); } .x-window-dlg .ext-mb-error { background-image:url(../images/default/window/icon-error.gif); }glpi-0.84.3+dfsg.1/lib/extjs/resources/css/xtheme-gray.css000066400000000000000000001131451226600447100232770ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .ext-el-mask { background-color: #ccc; } .ext-el-mask-msg { border-color:#999; background-color:#ddd; background-image:url(../images/gray/panel/white-top-bottom.gif); background-position: 0 -1px; } .ext-el-mask-msg div { background-color: #eee; border-color:#d0d0d0; color:#222; font:normal 11px tahoma, arial, helvetica, sans-serif; } .x-mask-loading div { background-color:#fbfbfb; background-image:url(../images/default/grid/loading.gif); } .x-item-disabled { color: gray; } .x-item-disabled * { color: gray !important; } .x-splitbar-proxy { background-color: #aaa; } .x-color-palette a { border-color:#fff; } .x-color-palette a:hover, .x-color-palette a.x-color-palette-sel { border-color:#CFCFCF; background-color: #eaeaea; } /* .x-color-palette em:hover, .x-color-palette span:hover{ background-color: #eaeaea; } */ .x-color-palette em { border-color:#aca899; } .x-ie-shadow { background-color:#777; } .x-shadow .xsmc { background-image: url(../images/default/shadow-c.png); } .x-shadow .xsml, .x-shadow .xsmr { background-image: url(../images/default/shadow-lr.png); } .x-shadow .xstl, .x-shadow .xstc, .x-shadow .xstr, .x-shadow .xsbl, .x-shadow .xsbc, .x-shadow .xsbr{ background-image: url(../images/default/shadow.png); } .loading-indicator { font-size: 11px; background-image: url(../images/default/grid/loading.gif); } .x-spotlight { background-color: #ccc; }.x-tab-panel-header, .x-tab-panel-footer { background-color: #eaeaea; border-color:#d0d0d0; overflow:hidden; zoom:1; } .x-tab-panel-header, .x-tab-panel-footer { border-color:#d0d0d0; } ul.x-tab-strip-top{ background-color:#dbdbdb; background-image: url(../images/gray/tabs/tab-strip-bg.gif); border-bottom-color:#d0d0d0; } ul.x-tab-strip-bottom{ background-color:#dbdbdb; background-image: url(../images/gray/tabs/tab-strip-btm-bg.gif); border-top-color:#d0d0d0; } .x-tab-panel-header-plain .x-tab-strip-spacer, .x-tab-panel-footer-plain .x-tab-strip-spacer { border-color:#d0d0d0; background-color: #eaeaea; } .x-tab-strip span.x-tab-strip-text { font:normal 11px tahoma,arial,helvetica; color:#333; } .x-tab-strip-over span.x-tab-strip-text { color:#111; } .x-tab-strip-active span.x-tab-strip-text { color:#333; font-weight:bold; } .x-tab-strip-disabled .x-tabs-text { color:#aaaaaa; } .x-tab-strip-top .x-tab-right, .x-tab-strip-top .x-tab-left, .x-tab-strip-top .x-tab-strip-inner{ background-image: url(../images/gray/tabs/tabs-sprite.gif); } .x-tab-strip-bottom .x-tab-right { background-image: url(../images/gray/tabs/tab-btm-inactive-right-bg.gif); } .x-tab-strip-bottom .x-tab-left { background-image: url(../images/gray/tabs/tab-btm-inactive-left-bg.gif); } .x-tab-strip-bottom .x-tab-strip-over .x-tab-left { background-image: url(../images/gray/tabs/tab-btm-over-left-bg.gif); } .x-tab-strip-bottom .x-tab-strip-over .x-tab-right { background-image: url(../images/gray/tabs/tab-btm-over-right-bg.gif); } .x-tab-strip-bottom .x-tab-strip-active .x-tab-right { background-image: url(../images/gray/tabs/tab-btm-right-bg.gif); } .x-tab-strip-bottom .x-tab-strip-active .x-tab-left { background-image: url(../images/gray/tabs/tab-btm-left-bg.gif); } .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close { background-image:url(../images/gray/tabs/tab-close.gif); } .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close:hover{ background-image:url(../images/gray/tabs/tab-close.gif); } .x-tab-panel-body { border-color:#d0d0d0; background-color:#fff; } .x-tab-panel-body-top { border-top: 0 none; } .x-tab-panel-body-bottom { border-bottom: 0 none; } .x-tab-scroller-left { background-image:url(../images/gray/tabs/scroll-left.gif); border-bottom-color:#d0d0d0; } .x-tab-scroller-left-over { background-position: 0 0; } .x-tab-scroller-left-disabled { background-position: -18px 0; opacity:.5; -moz-opacity:.5; filter:alpha(opacity=50); cursor:default; } .x-tab-scroller-right { background-image:url(../images/gray/tabs/scroll-right.gif); border-bottom-color:#d0d0d0; } .x-tab-panel-bbar .x-toolbar, .x-tab-panel-tbar .x-toolbar { border-color:#d0d0d0; } .x-form-field{ font:normal 12px tahoma, arial, helvetica, sans-serif; } .x-form-text, textarea.x-form-field{ background-color:#fff; background-image:url(../images/default/form/text-bg.gif); border-color:#C1C1C1; } .x-form-select-one { background-color:#fff; border-color:#C1C1C1; } .x-form-check-group-label { border-bottom: 1px solid #d0d0d0; color: #333; } .x-editor .x-form-check-wrap { background-color:#fff; } .x-form-field-wrap .x-form-trigger{ background-image:url(../images/gray/form/trigger.gif); border-bottom-color:#b5b8c8; } .x-form-field-wrap .x-form-date-trigger{ background-image: url(../images/gray/form/date-trigger.gif); } .x-form-field-wrap .x-form-clear-trigger{ background-image: url(../images/gray/form/clear-trigger.gif); } .x-form-field-wrap .x-form-search-trigger{ background-image: url(../images/gray/form/search-trigger.gif); } .x-trigger-wrap-focus .x-form-trigger{ border-bottom-color: #777777; } .x-item-disabled .x-form-trigger-over{ border-bottom-color:#b5b8c8; } .x-item-disabled .x-form-trigger-click{ border-bottom-color:#b5b8c8; } .x-form-focus, textarea.x-form-focus{ border-color:#777777; } .x-form-invalid, textarea.x-form-invalid{ background-color:#fff; background-image:url(../images/default/grid/invalid_line.gif); border-color:#c30; } .ext-webkit .x-form-invalid{ background-color:#fee; border-color:#ff7870; } .x-form-inner-invalid, textarea.x-form-inner-invalid{ background-color:#fff; background-image:url(../images/default/grid/invalid_line.gif); } .x-form-grow-sizer { font:normal 12px tahoma, arial, helvetica, sans-serif; } .x-form-item { font:normal 12px tahoma, arial, helvetica, sans-serif; } .x-form-invalid-msg { color:#c0272b; font:normal 11px tahoma, arial, helvetica, sans-serif; background-image:url(../images/default/shared/warning.gif); } .x-form-empty-field { color:gray; } .x-small-editor .x-form-field { font:normal 11px arial, tahoma, helvetica, sans-serif; } .ext-webkit .x-small-editor .x-form-field { font:normal 12px arial, tahoma, helvetica, sans-serif; } .x-form-invalid-icon { background-image:url(../images/default/form/exclamation.gif); } .x-fieldset { border-color:#CCCCCC; } .x-fieldset legend { font:bold 11px tahoma, arial, helvetica, sans-serif; color:#777777; }.x-btn{ font:normal 11px tahoma, verdana, helvetica; } .x-btn button{ font:normal 11px arial,tahoma,verdana,helvetica; color:#333; } .x-btn em { font-style:normal; font-weight:normal; } .x-btn-tl, .x-btn-tr, .x-btn-tc, .x-btn-ml, .x-btn-mr, .x-btn-mc, .x-btn-bl, .x-btn-br, .x-btn-bc{ background-image:url(../images/gray/button/btn.gif); } .x-btn-click .x-btn-text, .x-btn-menu-active .x-btn-text, .x-btn-pressed .x-btn-text{ color:#000; } .x-btn-disabled *{ color:gray !important; } .x-btn-mc em.x-btn-arrow { background-image:url(../images/default/button/arrow.gif); } .x-btn-mc em.x-btn-split { background-image:url(../images/default/button/s-arrow.gif); } .x-btn-over .x-btn-mc em.x-btn-split, .x-btn-click .x-btn-mc em.x-btn-split, .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-btn-pressed .x-btn-mc em.x-btn-split { background-image:url(../images/gray/button/s-arrow-o.gif); } .x-btn-mc em.x-btn-arrow-bottom { background-image:url(../images/default/button/s-arrow-b-noline.gif); } .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/default/button/s-arrow-b.gif); } .x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-btn-click .x-btn-mc em.x-btn-split-bottom, .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-btn-pressed .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/gray/button/s-arrow-bo.gif); } .x-btn-group-header { color: #666; } .x-btn-group-tc { background-image: url(../images/gray/button/group-tb.gif); } .x-btn-group-tl { background-image: url(../images/gray/button/group-cs.gif); } .x-btn-group-tr { background-image: url(../images/gray/button/group-cs.gif); } .x-btn-group-bc { background-image: url(../images/gray/button/group-tb.gif); } .x-btn-group-bl { background-image: url(../images/gray/button/group-cs.gif); } .x-btn-group-br { background-image: url(../images/gray/button/group-cs.gif); } .x-btn-group-ml { background-image: url(../images/gray/button/group-lr.gif); } .x-btn-group-mr { background-image: url(../images/gray/button/group-lr.gif); } .x-btn-group-notitle .x-btn-group-tc { background-image: url(../images/gray/button/group-tb.gif); } .x-toolbar{ border-color:#d0d0d0; background-color:#f0f0f0; background-image:url(../images/gray/toolbar/bg.gif); } .x-toolbar td,.x-toolbar span,.x-toolbar input,.x-toolbar div,.x-toolbar select,.x-toolbar label{ font:normal 11px arial,tahoma, helvetica, sans-serif; } .x-toolbar .x-item-disabled { color:gray; } .x-toolbar .x-item-disabled * { color:gray; } .x-toolbar .x-btn-mc em.x-btn-split { background-image:url(../images/default/button/s-arrow-noline.gif); } .x-toolbar .x-btn-over .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split { background-image:url(../images/gray/button/s-arrow-o.gif); } .x-toolbar .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/default/button/s-arrow-b-noline.gif); } .x-toolbar .x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/gray/button/s-arrow-bo.gif); } .x-toolbar .xtb-sep { background-image: url(../images/default/grid/grid-split.gif); } .x-tbar-page-first{ background-image: url(../images/gray/grid/page-first.gif) !important; } .x-tbar-loading{ background-image: url(../images/gray/grid/refresh.gif) !important; } .x-tbar-page-last{ background-image: url(../images/gray/grid/page-last.gif) !important; } .x-tbar-page-next{ background-image: url(../images/gray/grid/page-next.gif) !important; } .x-tbar-page-prev{ background-image: url(../images/gray/grid/page-prev.gif) !important; } .x-item-disabled .x-tbar-loading{ background-image: url(../images/default/grid/loading.gif) !important; } .x-item-disabled .x-tbar-page-first{ background-image: url(../images/default/grid/page-first-disabled.gif) !important; } .x-item-disabled .x-tbar-page-last{ background-image: url(../images/default/grid/page-last-disabled.gif) !important; } .x-item-disabled .x-tbar-page-next{ background-image: url(../images/default/grid/page-next-disabled.gif) !important; } .x-item-disabled .x-tbar-page-prev{ background-image: url(../images/default/grid/page-prev-disabled.gif) !important; } .x-paging-info { color:#444; } .x-toolbar-more-icon { background-image: url(../images/gray/toolbar/more.gif) !important; } .x-resizable-handle { background-color:#fff; } .x-resizable-over .x-resizable-handle-east, .x-resizable-pinned .x-resizable-handle-east, .x-resizable-over .x-resizable-handle-west, .x-resizable-pinned .x-resizable-handle-west { background-image:url(../images/gray/sizer/e-handle.gif); } .x-resizable-over .x-resizable-handle-south, .x-resizable-pinned .x-resizable-handle-south, .x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north { background-image:url(../images/gray/sizer/s-handle.gif); } .x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north{ background-image:url(../images/gray/sizer/s-handle.gif); } .x-resizable-over .x-resizable-handle-southeast, .x-resizable-pinned .x-resizable-handle-southeast{ background-image:url(../images/gray/sizer/se-handle.gif); } .x-resizable-over .x-resizable-handle-northwest, .x-resizable-pinned .x-resizable-handle-northwest{ background-image:url(../images/gray/sizer/nw-handle.gif); } .x-resizable-over .x-resizable-handle-northeast, .x-resizable-pinned .x-resizable-handle-northeast{ background-image:url(../images/gray/sizer/ne-handle.gif); } .x-resizable-over .x-resizable-handle-southwest, .x-resizable-pinned .x-resizable-handle-southwest{ background-image:url(../images/gray/sizer/sw-handle.gif); } .x-resizable-proxy{ border-color:#565656; } .x-resizable-overlay{ background-color:#fff; } .x-grid3 { background-color:#fff; } .x-grid-panel .x-panel-mc .x-panel-body { border-color:#d0d0d0; } .x-grid3-row td, .x-grid3-summary-row td{ font:normal 11px/13px arial, tahoma, helvetica, sans-serif; } .x-grid3-hd-row td { font:normal 11px/15px arial, tahoma, helvetica, sans-serif; } .x-grid3-hd-row td { border-left-color:#eee; border-right-color:#d0d0d0; } .x-grid-row-loading { background-color: #fff; background-image:url(../images/default/shared/loading-balls.gif); } .x-grid3-row { border-color:#ededed; border-top-color:#fff; } .x-grid3-row-alt{ background-color:#fafafa; } .x-grid3-row-over { border-color:#ddd; background-color:#efefef; background-image:url(../images/default/grid/row-over.gif); } .x-grid3-resize-proxy { background-color:#777; } .x-grid3-resize-marker { background-color:#777; } .x-grid3-header{ background-color:#f9f9f9; background-image:url(../images/gray/grid/grid3-hrow2.gif); } .x-grid3-header-pop { border-left-color:#d0d0d0; } .x-grid3-header-pop-inner { border-left-color:#eee; background-image:url(../images/default/grid/hd-pop.gif); } td.x-grid3-hd-over, td.sort-desc, td.sort-asc, td.x-grid3-hd-menu-open { border-left-color:#ACACAC; border-right-color:#ACACAC; } td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-asc .x-grid3-hd-inner, td.x-grid3-hd-menu-open .x-grid3-hd-inner { background-color:#f9f9f9; background-image:url(../images/gray/grid/grid3-hrow-over2.gif); } .sort-asc .x-grid3-sort-icon { background-image: url(../images/gray/grid/sort_asc.gif); } .sort-desc .x-grid3-sort-icon { background-image: url(../images/gray/grid/sort_desc.gif); } .x-grid3-cell-text, .x-grid3-hd-text { color:#000; } .x-grid3-split { background-image: url(../images/default/grid/grid-split.gif); } .x-grid3-hd-text { color:#333; } .x-dd-drag-proxy .x-grid3-hd-inner{ background-color:#f9f9f9; background-image:url(../images/gray/grid/grid3-hrow-over2.gif); border-color:#ACACAC; } .col-move-top{ background-image:url(../images/gray/grid/col-move-top.gif); } .col-move-bottom{ background-image:url(../images/gray/grid/col-move-bottom.gif); } .x-grid3-row-selected { background-color:#CCCCCC !important; background-image: none; border-color:#ACACAC; } .x-grid3-cell-selected{ background-color: #CBCBCB !important; color:#000; } .x-grid3-cell-selected span{ color:#000 !important; } .x-grid3-cell-selected .x-grid3-cell-text{ color:#000; } .x-grid3-locked td.x-grid3-row-marker, .x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker{ background-color:#ebeadb !important; background-image:url(../images/default/grid/grid-hrow.gif) !important; color:#000; border-top-color:#fff; border-right-color:#6fa0df !important; } .x-grid3-locked td.x-grid3-row-marker div, .x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker div{ color:#333 !important; } .x-grid3-dirty-cell { background-image:url(../images/default/grid/dirty.gif); } .x-grid3-topbar, .x-grid3-bottombar{ font:normal 11px arial, tahoma, helvetica, sans-serif; } .x-grid3-bottombar .x-toolbar{ border-top-color:#a9bfd3; } .x-props-grid .x-grid3-td-name .x-grid3-cell-inner{ background-image:url(../images/default/grid/grid3-special-col-bg.gif) !important; color:#000 !important; } .x-props-grid .x-grid3-body .x-grid3-td-name{ background-color:#fff !important; border-right-color:#eee; } .xg-hmenu-sort-asc .x-menu-item-icon{ background-image: url(../images/default/grid/hmenu-asc.gif); } .xg-hmenu-sort-desc .x-menu-item-icon{ background-image: url(../images/default/grid/hmenu-desc.gif); } .xg-hmenu-lock .x-menu-item-icon{ background-image: url(../images/default/grid/hmenu-lock.gif); } .xg-hmenu-unlock .x-menu-item-icon{ background-image: url(../images/default/grid/hmenu-unlock.gif); } .x-grid3-hd-btn { background-color:#f9f9f9; background-image:url(../images/gray/grid/grid3-hd-btn.gif); } .x-grid3-body .x-grid3-td-expander { background-image:url(../images/default/grid/grid3-special-col-bg.gif); } .x-grid3-row-expander { background-image:url(../images/gray/grid/row-expand-sprite.gif); } .x-grid3-body .x-grid3-td-checker { background-image: url(../images/default/grid/grid3-special-col-bg.gif); } .x-grid3-row-checker, .x-grid3-hd-checker { background-image:url(../images/default/grid/row-check-sprite.gif); } .x-grid3-body .x-grid3-td-numberer { background-image:url(../images/default/grid/grid3-special-col-bg.gif); } .x-grid3-body .x-grid3-td-numberer .x-grid3-cell-inner { color:#444; } .x-grid3-body .x-grid3-td-row-icon { background-image:url(../images/default/grid/grid3-special-col-bg.gif); } .x-grid3-body .x-grid3-row-selected .x-grid3-td-numberer, .x-grid3-body .x-grid3-row-selected .x-grid3-td-checker, .x-grid3-body .x-grid3-row-selected .x-grid3-td-expander { background-image:url(../images/gray/grid/grid3-special-col-sel-bg.gif); } .x-grid3-check-col { background-image:url(../images/default/menu/unchecked.gif); } .x-grid3-check-col-on { background-image:url(../images/default/menu/checked.gif); } .x-grid-group, .x-grid-group-body, .x-grid-group-hd { zoom:1; } .x-grid-group-hd { border-bottom-color:#d0d0d0; } .x-grid-group-hd div.x-grid-group-title { background-image:url(../images/gray/grid/group-collapse.gif); color:#5F5F5F; font:bold 11px tahoma, arial, helvetica, sans-serif; } .x-grid-group-collapsed .x-grid-group-hd div.x-grid-group-title { background-image:url(../images/gray/grid/group-expand.gif); } .x-group-by-icon { background-image:url(../images/default/grid/group-by.gif); } .x-cols-icon { background-image:url(../images/default/grid/columns.gif); } .x-show-groups-icon { background-image:url(../images/default/grid/group-by.gif); } .x-grid-empty { color:gray; font:normal 11px tahoma, arial, helvetica, sans-serif; } .x-grid-with-col-lines .x-grid3-row td.x-grid3-cell { border-right-color:#ededed; } .x-grid-with-col-lines .x-grid3-row{ border-top-color:#ededed; } .x-grid-with-col-lines .x-grid3-row-selected { border-top-color:#B9B9B9; } .x-pivotgrid .x-grid3-header-offset table td { background: url(../images/gray/grid/grid3-hrow2.gif) repeat-x 50% 100%; border-left: 1px solid; border-right: 1px solid; border-left-color: #D0D0D0; border-right-color: #D0D0D0; } .x-pivotgrid .x-grid3-row-headers { background-color: #f9f9f9; } .x-pivotgrid .x-grid3-row-headers table td { background: #EEE url(../images/default/grid/grid3-rowheader.gif) repeat-x left top; border-left: 1px solid; border-right: 1px solid; border-left-color: #EEE; border-right-color: #D0D0D0; border-bottom: 1px solid; border-bottom-color: #D0D0D0; height: 18px; } .x-dd-drag-ghost{ color:#000; font: normal 11px arial, helvetica, sans-serif; border-color: #ddd #bbb #bbb #ddd; background-color:#fff; } .x-dd-drop-nodrop .x-dd-drop-icon{ background-image: url(../images/default/dd/drop-no.gif); } .x-dd-drop-ok .x-dd-drop-icon{ background-image: url(../images/default/dd/drop-yes.gif); } .x-dd-drop-ok-add .x-dd-drop-icon{ background-image: url(../images/default/dd/drop-add.gif); } .x-view-selector { background-color:#D6D6D6; border-color:#888888; }.x-tree-node-expanded .x-tree-node-icon{ background-image:url(../images/default/tree/folder-open.gif); } .x-tree-node-leaf .x-tree-node-icon{ background-image:url(../images/default/tree/leaf.gif); } .x-tree-node-collapsed .x-tree-node-icon{ background-image:url(../images/default/tree/folder.gif); } .x-tree-node-loading .x-tree-node-icon{ background-image:url(../images/default/tree/loading.gif) !important; } .x-tree-node .x-tree-node-inline-icon { background-image: none; } .x-tree-node-loading a span{ font-style: italic; color:#444444; } .ext-ie .x-tree-node-el input { width:15px; height:15px; } .x-tree-lines .x-tree-elbow{ background-image:url(../images/default/tree/elbow.gif); } .x-tree-lines .x-tree-elbow-plus{ background-image:url(../images/default/tree/elbow-plus.gif); } .x-tree-lines .x-tree-elbow-minus{ background-image:url(../images/default/tree/elbow-minus.gif); } .x-tree-lines .x-tree-elbow-end{ background-image:url(../images/default/tree/elbow-end.gif); } .x-tree-lines .x-tree-elbow-end-plus{ background-image:url(../images/gray/tree/elbow-end-plus.gif); } .x-tree-lines .x-tree-elbow-end-minus{ background-image:url(../images/gray/tree/elbow-end-minus.gif); } .x-tree-lines .x-tree-elbow-line{ background-image:url(../images/default/tree/elbow-line.gif); } .x-tree-no-lines .x-tree-elbow-plus{ background-image:url(../images/default/tree/elbow-plus-nl.gif); } .x-tree-no-lines .x-tree-elbow-minus{ background-image:url(../images/default/tree/elbow-minus-nl.gif); } .x-tree-no-lines .x-tree-elbow-end-plus{ background-image:url(../images/gray/tree/elbow-end-plus-nl.gif); } .x-tree-no-lines .x-tree-elbow-end-minus{ background-image:url(../images/gray/tree/elbow-end-minus-nl.gif); } .x-tree-arrows .x-tree-elbow-plus{ background-image:url(../images/gray/tree/arrows.gif); } .x-tree-arrows .x-tree-elbow-minus{ background-image:url(../images/gray/tree/arrows.gif); } .x-tree-arrows .x-tree-elbow-end-plus{ background-image:url(../images/gray/tree/arrows.gif); } .x-tree-arrows .x-tree-elbow-end-minus{ background-image:url(../images/gray/tree/arrows.gif); } .x-tree-node{ color:#000; font: normal 11px arial, tahoma, helvetica, sans-serif; } .x-tree-node a, .x-dd-drag-ghost a{ color:#000; } .x-tree-node a span, .x-dd-drag-ghost a span{ color:#000; } .x-tree-node .x-tree-node-disabled a span{ color:gray !important; } .x-tree-node div.x-tree-drag-insert-below{ border-bottom-color:#36c; } .x-tree-node div.x-tree-drag-insert-above{ border-top-color:#36c; } .x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-below a{ border-bottom-color:#36c; } .x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-above a{ border-top-color:#36c; } .x-tree-node .x-tree-drag-append a span{ background-color:#ddd; border-color:gray; } .x-tree-node .x-tree-node-over { background-color: #eee; } .x-tree-node .x-tree-selected { background-color: #ddd; } .x-tree-drop-ok-append .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-add.gif); } .x-tree-drop-ok-above .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-over.gif); } .x-tree-drop-ok-below .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-under.gif); } .x-tree-drop-ok-between .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-between.gif); } .x-date-picker { border-color:#585858; background-color:#fff; } .x-date-middle,.x-date-left,.x-date-right { background-image: url(../images/gray/shared/hd-sprite.gif); color:#fff; font:bold 11px "sans serif", tahoma, verdana, helvetica; } .x-date-middle .x-btn .x-btn-text { color:#fff; } .x-date-middle .x-btn-mc em.x-btn-arrow { background-image:url(../images/gray/toolbar/btn-arrow-light.gif); } .x-date-right a { background-image: url(../images/gray/shared/right-btn.gif); } .x-date-left a{ background-image: url(../images/gray/shared/left-btn.gif); } .x-date-inner th { background-color:#D8D8D8; background-image: url(../images/gray/panel/white-top-bottom.gif); border-bottom-color:#AFAFAF; font:normal 10px arial, helvetica,tahoma,sans-serif; color:#595959; } .x-date-inner td { border-color:#fff; } .x-date-inner a { font:normal 11px arial, helvetica,tahoma,sans-serif; color:#000; } .x-date-inner .x-date-active{ color:#000; } .x-date-inner .x-date-selected a{ background-image: none; background-color:#D8D8D8; border-color:#DCDCDC; } .x-date-inner .x-date-today a{ border-color:darkred; } .x-date-inner .x-date-selected span{ font-weight:bold; } .x-date-inner .x-date-prevday a,.x-date-inner .x-date-nextday a { color:#aaa; } .x-date-bottom { border-top-color:#AFAFAF; background-color:#D8D8D8; background:#D8D8D8 url(../images/gray/panel/white-top-bottom.gif) 0 -2px; } .x-date-inner a:hover, .x-date-inner .x-date-disabled a:hover{ color:#000; background-color:#D8D8D8; } .x-date-inner .x-date-disabled a { background-color:#eee; color:#bbb; } .x-date-mmenu{ background-color:#eee !important; } .x-date-mmenu .x-menu-item { font-size:10px; color:#000; } .x-date-mp { background-color:#fff; } .x-date-mp td { font:normal 11px arial, helvetica,tahoma,sans-serif; } .x-date-mp-btns button { background-color:#4E565F; color:#fff; border-color:#C0C0C0 #434343 #434343 #C0C0C0; font:normal 11px arial, helvetica,tahoma,sans-serif; } .x-date-mp-btns { background-color:#D8D8D8; background:#D8D8D8 url(../images/gray/panel/white-top-bottom.gif) 0 -2px; } .x-date-mp-btns td { border-top-color:#AFAFAF; } td.x-date-mp-month a,td.x-date-mp-year a { color: #333; } td.x-date-mp-month a:hover,td.x-date-mp-year a:hover { color:#333; background-color:#FDFDFD; } td.x-date-mp-sel a { background-color:#D8D8D8; background:#D8D8D8 url(../images/gray/panel/white-top-bottom.gif) 0 -2px; border-color:#DCDCDC; } .x-date-mp-ybtn a { background-image:url(../images/gray/panel/tool-sprites.gif); } td.x-date-mp-sep { border-right-color:#D7D7D7; }.x-tip .x-tip-close{ background-image: url(../images/gray/qtip/close.gif); } .x-tip .x-tip-tc, .x-tip .x-tip-tl, .x-tip .x-tip-tr, .x-tip .x-tip-bc, .x-tip .x-tip-bl, .x-tip .x-tip-br, .x-tip .x-tip-ml, .x-tip .x-tip-mr { background-image: url(../images/gray/qtip/tip-sprite.gif); } .x-tip .x-tip-mc { font: normal 11px tahoma,arial,helvetica,sans-serif; } .x-tip .x-tip-ml { background-color: #fff; } .x-tip .x-tip-header-text { font: bold 11px tahoma,arial,helvetica,sans-serif; color:#444; } .x-tip .x-tip-body { font: normal 11px tahoma,arial,helvetica,sans-serif; color:#444; } .x-form-invalid-tip .x-tip-tc, .x-form-invalid-tip .x-tip-tl, .x-form-invalid-tip .x-tip-tr, .x-form-invalid-tip .x-tip-bc, .x-form-invalid-tip .x-tip-bl, .x-form-invalid-tip .x-tip-br, .x-form-invalid-tip .x-tip-ml, .x-form-invalid-tip .x-tip-mr { background-image: url(../images/default/form/error-tip-corners.gif); } .x-form-invalid-tip .x-tip-body { background-image:url(../images/default/form/exclamation.gif); } .x-tip-anchor { background-image:url(../images/gray/qtip/tip-anchor-sprite.gif); }.x-menu { background-color:#f0f0f0; background-image:url(../images/default/menu/menu.gif); } .x-menu-floating{ border-color:#7D7D7D; } .x-menu-nosep { background-image:none; } .x-menu-list-item{ font:normal 11px arial,tahoma,sans-serif; } .x-menu-item-arrow{ background-image:url(../images/gray/menu/menu-parent.gif); } .x-menu-sep { background-color:#e0e0e0; border-bottom-color:#fff; } a.x-menu-item { color:#222; } .x-menu-item-active { background-image: url(../images/gray/menu/item-over.gif); background-color: #f1f1f1; border-color:#ACACAC; } .x-menu-item-active a.x-menu-item { border-color:#ACACAC; } .x-menu-check-item .x-menu-item-icon{ background-image:url(../images/default/menu/unchecked.gif); } .x-menu-item-checked .x-menu-item-icon{ background-image:url(../images/default/menu/checked.gif); } .x-menu-item-checked .x-menu-group-item .x-menu-item-icon{ background-image:url(../images/gray/menu/group-checked.gif); } .x-menu-group-item .x-menu-item-icon{ background-image:none; } .x-menu-plain { background-color:#fff !important; } .x-menu .x-date-picker{ border-color:#AFAFAF; } .x-cycle-menu .x-menu-item-checked { border-color:#B9B9B9 !important; background-color:#F1F1F1; } .x-menu-scroller-top { background-image:url(../images/default/layout/mini-top.gif); } .x-menu-scroller-bottom { background-image:url(../images/default/layout/mini-bottom.gif); }.x-box-tl { background-image: url(../images/default/box/corners.gif); } .x-box-tc { background-image: url(../images/default/box/tb.gif); } .x-box-tr { background-image: url(../images/default/box/corners.gif); } .x-box-ml { background-image: url(../images/default/box/l.gif); } .x-box-mc { background-color: #eee; background-image: url(../images/default/box/tb.gif); font-family: "Myriad Pro","Myriad Web","Tahoma","Helvetica","Arial",sans-serif; color: #393939; font-size: 12px; } .x-box-mc h3 { font-size: 14px; font-weight: bold; } .x-box-mr { background-image: url(../images/default/box/r.gif); } .x-box-bl { background-image: url(../images/default/box/corners.gif); } .x-box-bc { background-image: url(../images/default/box/tb.gif); } .x-box-br { background-image: url(../images/default/box/corners.gif); } .x-box-blue .x-box-bl, .x-box-blue .x-box-br, .x-box-blue .x-box-tl, .x-box-blue .x-box-tr { background-image: url(../images/default/box/corners-blue.gif); } .x-box-blue .x-box-bc, .x-box-blue .x-box-mc, .x-box-blue .x-box-tc { background-image: url(../images/default/box/tb-blue.gif); } .x-box-blue .x-box-mc { background-color: #c3daf9; } .x-box-blue .x-box-mc h3 { color: #17385b; } .x-box-blue .x-box-ml { background-image: url(../images/default/box/l-blue.gif); } .x-box-blue .x-box-mr { background-image: url(../images/default/box/r-blue.gif); } .x-combo-list { border-color:#ccc; background-color:#ddd; font:normal 12px tahoma, arial, helvetica, sans-serif; } .x-combo-list-inner { background-color:#fff; } .x-combo-list-hd { font:bold 11px tahoma, arial, helvetica, sans-serif; color:#333; background-image: url(../images/default/layout/panel-title-light-bg.gif); border-bottom-color:#BCBCBC; } .x-resizable-pinned .x-combo-list-inner { border-bottom-color:#BEBEBE; } .x-combo-list-item { border-color:#fff; } .x-combo-list .x-combo-selected{ border-color:#777 !important; background-color:#f0f0f0; } .x-combo-list .x-toolbar { border-top-color:#BCBCBC; } .x-combo-list-small { font:normal 11px tahoma, arial, helvetica, sans-serif; }.x-panel { border-color: #d0d0d0; } .x-panel-header { color:#333; font-weight:bold; font-size: 11px; font-family: tahoma,arial,verdana,sans-serif; border-color:#d0d0d0; background-image: url(../images/gray/panel/white-top-bottom.gif); } .x-panel-body { border-color:#d0d0d0; background-color:#fff; } .x-panel-bbar .x-toolbar, .x-panel-tbar .x-toolbar { border-color:#d0d0d0; } .x-panel-tbar-noheader .x-toolbar, .x-panel-mc .x-panel-tbar .x-toolbar { border-top-color:#d0d0d0; } .x-panel-body-noheader, .x-panel-mc .x-panel-body { border-top-color:#d0d0d0; } .x-panel-tl .x-panel-header { color:#333; font:bold 11px tahoma,arial,verdana,sans-serif; } .x-panel-tc { background-image: url(../images/gray/panel/top-bottom.gif); } .x-panel-tl, .x-panel-tr, .x-panel-bl, .x-panel-br{ background-image: url(../images/gray/panel/corners-sprite.gif); border-bottom-color:#d0d0d0; } .x-panel-bc { background-image: url(../images/gray/panel/top-bottom.gif); } .x-panel-mc { font: normal 11px tahoma,arial,helvetica,sans-serif; background-color:#f1f1f1; } .x-panel-ml { background-color: #fff; background-image:url(../images/gray/panel/left-right.gif); } .x-panel-mr { background-image: url(../images/gray/panel/left-right.gif); } .x-tool { background-image:url(../images/gray/panel/tool-sprites.gif); } .x-panel-ghost { background-color:#f2f2f2; } .x-panel-ghost ul { border-color:#d0d0d0; } .x-panel-dd-spacer { border-color:#d0d0d0; } .x-panel-fbar td,.x-panel-fbar span,.x-panel-fbar input,.x-panel-fbar div,.x-panel-fbar select,.x-panel-fbar label{ font:normal 11px arial,tahoma, helvetica, sans-serif; } .x-window-proxy { background-color:#fcfcfc; border-color:#d0d0d0; } .x-window-tl .x-window-header { color:#555; font:bold 11px tahoma,arial,verdana,sans-serif; } .x-window-tc { background-image: url(../images/gray/window/top-bottom.png); } .x-window-tl { background-image: url(../images/gray/window/left-corners.png); } .x-window-tr { background-image: url(../images/gray/window/right-corners.png); } .x-window-bc { background-image: url(../images/gray/window/top-bottom.png); } .x-window-bl { background-image: url(../images/gray/window/left-corners.png); } .x-window-br { background-image: url(../images/gray/window/right-corners.png); } .x-window-mc { border-color:#d0d0d0; font: normal 11px tahoma,arial,helvetica,sans-serif; background-color:#e8e8e8; } .x-window-ml { background-image: url(../images/gray/window/left-right.png); } .x-window-mr { background-image: url(../images/gray/window/left-right.png); } .x-window-maximized .x-window-tc { background-color:#fff; } .x-window-bbar .x-toolbar { border-top-color:#d0d0d0; } .x-panel-ghost .x-window-tl { border-bottom-color:#d0d0d0; } .x-panel-collapsed .x-window-tl { border-bottom-color:#d0d0d0; } .x-dlg-mask{ background-color:#ccc; } .x-window-plain .x-window-mc { background-color: #E8E8E8; border-color: #D0D0D0 #EEEEEE #EEEEEE #D0D0D0; } .x-window-plain .x-window-body { border-color: #EEEEEE #D0D0D0 #D0D0D0 #EEEEEE; } body.x-body-masked .x-window-plain .x-window-mc { background-color: #E4E4E4; } .x-html-editor-wrap { border-color:#BCBCBC; background-color:#fff; } .x-html-editor-tb .x-btn-text { background-image:url(../images/default/editor/tb-sprite.gif); } .x-panel-noborder .x-panel-header-noborder { border-bottom-color:#d0d0d0; } .x-panel-noborder .x-panel-tbar-noborder .x-toolbar { border-bottom-color:#d0d0d0; } .x-panel-noborder .x-panel-bbar-noborder .x-toolbar { border-top-color:#d0d0d0; } .x-tab-panel-bbar-noborder .x-toolbar { border-top-color:#d0d0d0; } .x-tab-panel-tbar-noborder .x-toolbar { border-bottom-color:#d0d0d0; } .x-border-layout-ct { background-color:#f0f0f0; } .x-border-layout-ct { background-color:#f0f0f0; } .x-accordion-hd { color:#222; font-weight:normal; background-image: url(../images/gray/panel/light-hd.gif); } .x-layout-collapsed{ background-color:#dfdfdf; border-color:#d0d0d0; } .x-layout-collapsed-over{ background-color:#e7e7e7; } .x-layout-split-west .x-layout-mini { background-image:url(../images/default/layout/mini-left.gif); } .x-layout-split-east .x-layout-mini { background-image:url(../images/default/layout/mini-right.gif); } .x-layout-split-north .x-layout-mini { background-image:url(../images/default/layout/mini-top.gif); } .x-layout-split-south .x-layout-mini { background-image:url(../images/default/layout/mini-bottom.gif); } .x-layout-cmini-west .x-layout-mini { background-image:url(../images/default/layout/mini-right.gif); } .x-layout-cmini-east .x-layout-mini { background-image:url(../images/default/layout/mini-left.gif); } .x-layout-cmini-north .x-layout-mini { background-image:url(../images/default/layout/mini-bottom.gif); } .x-layout-cmini-south .x-layout-mini { background-image:url(../images/default/layout/mini-top.gif); } .x-progress-wrap { border-color:#8E8E8E; } .x-progress-inner { background-color:#E7E7E7; background-image:url(../images/gray/qtip/bg.gif); } .x-progress-bar { background-color:#BCBCBC; background-image:url(../images/gray/progress/progress-bg.gif); border-top-color:#E2E2E2; border-bottom-color:#A4A4A4; border-right-color:#A4A4A4; } .x-progress-text { font-size:11px; font-weight:bold; color:#fff; } .x-progress-text-back { color:#5F5F5F; } .x-list-header{ background-color:#f9f9f9; background-image:url(../images/gray/grid/grid3-hrow2.gif); } .x-list-header-inner div em { border-left-color:#ddd; font:normal 11px arial, tahoma, helvetica, sans-serif; } .x-list-body dt em { font:normal 11px arial, tahoma, helvetica, sans-serif; } .x-list-over { background-color:#eee; } .x-list-selected { background-color:#f0f0f0; } .x-list-resizer { border-left-color:#555; border-right-color:#555; } .x-list-header-inner em.sort-asc, .x-list-header-inner em.sort-desc { background-image:url(../images/gray/grid/sort-hd.gif); border-color: #d0d0d0; } .x-slider-horz, .x-slider-horz .x-slider-end, .x-slider-horz .x-slider-inner { background-image:url(../images/default/slider/slider-bg.png); } .x-slider-horz .x-slider-thumb { background-image:url(../images/gray/slider/slider-thumb.png); } .x-slider-vert, .x-slider-vert .x-slider-end, .x-slider-vert .x-slider-inner { background-image:url(../images/default/slider/slider-v-bg.png); } .x-slider-vert .x-slider-thumb { background-image:url(../images/gray/slider/slider-v-thumb.png); } .x-window-dlg .ext-mb-text, .x-window-dlg .x-window-header-text { font-size:12px; } .x-window-dlg .ext-mb-textarea { font:normal 12px tahoma,arial,helvetica,sans-serif; } .x-window-dlg .x-msg-box-wait { background-image:url(../images/default/grid/loading.gif); } .x-window-dlg .ext-mb-info { background-image:url(../images/gray/window/icon-info.gif); } .x-window-dlg .ext-mb-warning { background-image:url(../images/gray/window/icon-warning.gif); } .x-window-dlg .ext-mb-question { background-image:url(../images/gray/window/icon-question.gif); } .x-window-dlg .ext-mb-error { background-image:url(../images/gray/window/icon-error.gif); } glpi-0.84.3+dfsg.1/lib/extjs/resources/css/yourtheme.css000066400000000000000000001127101226600447100230630ustar00rootroot00000000000000/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ .ext-el-mask { background-color: #ccc; } .ext-el-mask-msg { border-color:#6593cf; background-color:#c3daf9; background-image:url(../images/default/box/tb-blue.gif); } .ext-el-mask-msg div { background-color: #eee; border-color:#a3bad9; color:#222; font:normal 11px tahoma, arial, helvetica, sans-serif; } .x-mask-loading div { background-color:#fbfbfb; background-image:url(../images/default/grid/loading.gif); } .x-item-disabled { color: gray; } .x-item-disabled * { color: gray !important; } .x-splitbar-proxy { background-color: #aaa; } .x-color-palette a { border-color:#fff; } .x-color-palette a:hover, .x-color-palette a.x-color-palette-sel { border-color:#8bb8f3; background-color: #deecfd; } /* .x-color-palette em:hover, .x-color-palette span:hover{ background-color: #deecfd; } */ .x-color-palette em { border-color:#aca899; } .x-ie-shadow { background-color:#777; } .x-shadow .xsmc { background-image: url(../images/default/shadow-c.png); } .x-shadow .xsml, .x-shadow .xsmr { background-image: url(../images/default/shadow-lr.png); } .x-shadow .xstl, .x-shadow .xstc, .x-shadow .xstr, .x-shadow .xsbl, .x-shadow .xsbc, .x-shadow .xsbr{ background-image: url(../images/default/shadow.png); } .loading-indicator { font-size: 11px; background-image: url(../images/default/grid/loading.gif); } .x-spotlight { background-color: #ccc; } .x-tab-panel-header, .x-tab-panel-footer { background-color: #deecfd; border-color:#8db2e3; overflow:hidden; zoom:1; } .x-tab-panel-header, .x-tab-panel-footer { border-color:#8db2e3; } ul.x-tab-strip-top{ background-color:#cedff5; background-image: url(../images/default/tabs/tab-strip-bg.gif); border-bottom-color:#8db2e3; } ul.x-tab-strip-bottom{ background-color:#cedff5; background-image: url(../images/default/tabs/tab-strip-btm-bg.gif); border-top-color:#8db2e3; } .x-tab-panel-header-plain .x-tab-strip-spacer, .x-tab-panel-footer-plain .x-tab-strip-spacer { border-color:#8db2e3; background-color: #deecfd; } .x-tab-strip span.x-tab-strip-text { font:normal 11px tahoma,arial,helvetica; color:#416aa3; } .x-tab-strip-over span.x-tab-strip-text { color:#15428b; } .x-tab-strip-active span.x-tab-strip-text { color:#15428b; font-weight:bold; } .x-tab-strip-disabled .x-tabs-text { color:#aaaaaa; } .x-tab-strip-top .x-tab-right, .x-tab-strip-top .x-tab-left, .x-tab-strip-top .x-tab-strip-inner{ background-image: url(../images/default/tabs/tabs-sprite.gif); } .x-tab-strip-bottom .x-tab-right { background-image: url(../images/default/tabs/tab-btm-inactive-right-bg.gif); } .x-tab-strip-bottom .x-tab-left { background-image: url(../images/default/tabs/tab-btm-inactive-left-bg.gif); } .x-tab-strip-bottom .x-tab-strip-over .x-tab-right { background-image: url(../images/default/tabs/tab-btm-over-right-bg.gif); } .x-tab-strip-bottom .x-tab-strip-over .x-tab-left { background-image: url(../images/default/tabs/tab-btm-over-left-bg.gif); } .x-tab-strip-bottom .x-tab-strip-active .x-tab-right { background-image: url(../images/default/tabs/tab-btm-right-bg.gif); } .x-tab-strip-bottom .x-tab-strip-active .x-tab-left { background-image: url(../images/default/tabs/tab-btm-left-bg.gif); } .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close { background-image:url(../images/default/tabs/tab-close.gif); } .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close:hover{ background-image:url(../images/default/tabs/tab-close.gif); } .x-tab-panel-body { border-color:#8db2e3; background-color:#fff; } .x-tab-panel-body-top { border-top: 0 none; } .x-tab-panel-body-bottom { border-bottom: 0 none; } .x-tab-scroller-left { background-image:url(../images/default/tabs/scroll-left.gif); border-bottom-color:#8db2e3; } .x-tab-scroller-left-over { background-position: 0 0; } .x-tab-scroller-left-disabled { background-position: -18px 0; opacity:.5; -moz-opacity:.5; filter:alpha(opacity=50); cursor:default; } .x-tab-scroller-right { background-image:url(../images/default/tabs/scroll-right.gif); border-bottom-color:#8db2e3; } .x-tab-panel-bbar .x-toolbar, .x-tab-panel-tbar .x-toolbar { border-color:#99bbe8; }.x-form-field { font:normal 12px tahoma, arial, helvetica, sans-serif; } .x-form-text, textarea.x-form-field { background-color:#fff; background-image:url(../images/default/form/text-bg.gif); border-color:#b5b8c8; } .x-form-select-one { background-color:#fff; border-color:#b5b8c8; } .x-form-check-group-label { border-bottom: 1px solid #99bbe8; color: #15428b; } .x-editor .x-form-check-wrap { background-color:#fff; } .x-form-field-wrap .x-form-trigger { background-image:url(../images/default/form/trigger.gif); border-bottom-color:#b5b8c8; } .x-form-field-wrap .x-form-date-trigger { background-image: url(../images/default/form/date-trigger.gif); } .x-form-field-wrap .x-form-clear-trigger { background-image: url(../images/default/form/clear-trigger.gif); } .x-form-field-wrap .x-form-search-trigger { background-image: url(../images/default/form/search-trigger.gif); } .x-trigger-wrap-focus .x-form-trigger { border-bottom-color:#7eadd9; } .x-item-disabled .x-form-trigger-over { border-bottom-color:#b5b8c8; } .x-item-disabled .x-form-trigger-click { border-bottom-color:#b5b8c8; } .x-form-focus, textarea.x-form-focus { border-color:#7eadd9; } .x-form-invalid, textarea.x-form-invalid { background-color:#fff; background-image:url(../images/default/grid/invalid_line.gif); border-color:#c30; } .x-form-invalid.x-form-composite { border: none; background-image: none; } .x-form-invalid.x-form-composite .x-form-invalid { background-color:#fff; background-image:url(../images/default/grid/invalid_line.gif); border-color:#c30; } .x-form-inner-invalid, textarea.x-form-inner-invalid { background-color:#fff; background-image:url(../images/default/grid/invalid_line.gif); } .x-form-grow-sizer { font:normal 12px tahoma, arial, helvetica, sans-serif; } .x-form-item { font:normal 12px tahoma, arial, helvetica, sans-serif; } .x-form-invalid-msg { color:#c0272b; font:normal 11px tahoma, arial, helvetica, sans-serif; background-image:url(../images/default/shared/warning.gif); } .x-form-empty-field { color:gray; } .x-small-editor .x-form-field { font:normal 11px arial, tahoma, helvetica, sans-serif; } .ext-webkit .x-small-editor .x-form-field { font:normal 11px arial, tahoma, helvetica, sans-serif; } .x-form-invalid-icon { background-image:url(../images/default/form/exclamation.gif); } .x-fieldset { border-color:#b5b8c8; } .x-fieldset legend { font:bold 11px tahoma, arial, helvetica, sans-serif; color:#15428b; } .x-btn{ font:normal 11px tahoma, verdana, helvetica; } .x-btn button{ font:normal 11px arial,tahoma,verdana,helvetica; color:#333; } .x-btn em { font-style:normal; font-weight:normal; } .x-btn-tl, .x-btn-tr, .x-btn-tc, .x-btn-ml, .x-btn-mr, .x-btn-mc, .x-btn-bl, .x-btn-br, .x-btn-bc{ background-image:url(../images/default/button/btn.gif); } .x-btn-click .x-btn-text, .x-btn-menu-active .x-btn-text, .x-btn-pressed .x-btn-text{ color:#000; } .x-btn-disabled *{ color:gray !important; } .x-btn-mc em.x-btn-arrow { background-image:url(../images/default/button/arrow.gif); } .x-btn-mc em.x-btn-split { background-image:url(../images/default/button/s-arrow.gif); } .x-btn-over .x-btn-mc em.x-btn-split, .x-btn-click .x-btn-mc em.x-btn-split, .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-btn-pressed .x-btn-mc em.x-btn-split { background-image:url(../images/default/button/s-arrow-o.gif); } .x-btn-mc em.x-btn-arrow-bottom { background-image:url(../images/default/button/s-arrow-b-noline.gif); } .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/default/button/s-arrow-b.gif); } .x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-btn-click .x-btn-mc em.x-btn-split-bottom, .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-btn-pressed .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/default/button/s-arrow-bo.gif); } .x-btn-group-header { color: #3e6aaa; } .x-btn-group-tc { background-image: url(../images/default/button/group-tb.gif); } .x-btn-group-tl { background-image: url(../images/default/button/group-cs.gif); } .x-btn-group-tr { background-image: url(../images/default/button/group-cs.gif); } .x-btn-group-bc { background-image: url(../images/default/button/group-tb.gif); } .x-btn-group-bl { background-image: url(../images/default/button/group-cs.gif); } .x-btn-group-br { background-image: url(../images/default/button/group-cs.gif); } .x-btn-group-ml { background-image: url(../images/default/button/group-lr.gif); } .x-btn-group-mr { background-image: url(../images/default/button/group-lr.gif); } .x-btn-group-notitle .x-btn-group-tc { background-image: url(../images/default/button/group-tb.gif); }.x-toolbar{ border-color:#a9bfd3; background-color:#d0def0; background-image:url(../images/default/toolbar/bg.gif); } .x-toolbar td,.x-toolbar span,.x-toolbar input,.x-toolbar div,.x-toolbar select,.x-toolbar label{ font:normal 11px arial,tahoma, helvetica, sans-serif; } .x-toolbar .x-item-disabled { color:gray; } .x-toolbar .x-item-disabled * { color:gray; } .x-toolbar .x-btn-mc em.x-btn-split { background-image:url(../images/default/button/s-arrow-noline.gif); } .x-toolbar .x-btn-over .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split { background-image:url(../images/default/button/s-arrow-o.gif); } .x-toolbar .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/default/button/s-arrow-b-noline.gif); } .x-toolbar .x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split-bottom { background-image:url(../images/default/button/s-arrow-bo.gif); } .x-toolbar .xtb-sep { background-image: url(../images/default/grid/grid-blue-split.gif); } .x-tbar-page-first{ background-image: url(../images/default/grid/page-first.gif) !important; } .x-tbar-loading{ background-image: url(../images/default/grid/refresh.gif) !important; } .x-tbar-page-last{ background-image: url(../images/default/grid/page-last.gif) !important; } .x-tbar-page-next{ background-image: url(../images/default/grid/page-next.gif) !important; } .x-tbar-page-prev{ background-image: url(../images/default/grid/page-prev.gif) !important; } .x-item-disabled .x-tbar-loading{ background-image: url(../images/default/grid/refresh-disabled.gif) !important; } .x-item-disabled .x-tbar-page-first{ background-image: url(../images/default/grid/page-first-disabled.gif) !important; } .x-item-disabled .x-tbar-page-last{ background-image: url(../images/default/grid/page-last-disabled.gif) !important; } .x-item-disabled .x-tbar-page-next{ background-image: url(../images/default/grid/page-next-disabled.gif) !important; } .x-item-disabled .x-tbar-page-prev{ background-image: url(../images/default/grid/page-prev-disabled.gif) !important; } .x-paging-info { color:#444; } .x-toolbar-more-icon { background-image: url(../images/default/toolbar/more.gif) !important; }.x-resizable-handle { background-color:#fff; } .x-resizable-over .x-resizable-handle-east, .x-resizable-pinned .x-resizable-handle-east, .x-resizable-over .x-resizable-handle-west, .x-resizable-pinned .x-resizable-handle-west { background-image:url(../images/default/sizer/e-handle.gif); } .x-resizable-over .x-resizable-handle-south, .x-resizable-pinned .x-resizable-handle-south, .x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north { background-image:url(../images/default/sizer/s-handle.gif); } .x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north{ background-image:url(../images/default/sizer/s-handle.gif); } .x-resizable-over .x-resizable-handle-southeast, .x-resizable-pinned .x-resizable-handle-southeast{ background-image:url(../images/default/sizer/se-handle.gif); } .x-resizable-over .x-resizable-handle-northwest, .x-resizable-pinned .x-resizable-handle-northwest{ background-image:url(../images/default/sizer/nw-handle.gif); } .x-resizable-over .x-resizable-handle-northeast, .x-resizable-pinned .x-resizable-handle-northeast{ background-image:url(../images/default/sizer/ne-handle.gif); } .x-resizable-over .x-resizable-handle-southwest, .x-resizable-pinned .x-resizable-handle-southwest{ background-image:url(../images/default/sizer/sw-handle.gif); } .x-resizable-proxy{ border-color:#3b5a82; } .x-resizable-overlay{ background-color:#fff; } .x-grid3 { background-color:#fff; } .x-grid-panel .x-panel-mc .x-panel-body { border-color:#99bbe8; } .x-grid3-row td, .x-grid3-summary-row td{ font:normal 11px/13px arial, tahoma, helvetica, sans-serif; } .x-grid3-hd-row td { font:normal 11px/15px arial, tahoma, helvetica, sans-serif; } .x-grid3-hd-row td { border-left-color:#eee; border-right-color:#d0d0d0; } .x-grid-row-loading { background-color: #fff; background-image:url(../images/default/shared/loading-balls.gif); } .x-grid3-row { border-color:#ededed; border-top-color:#fff; } .x-grid3-row-alt{ background-color:#fafafa; } .x-grid3-row-over { border-color:#ddd; background-color:#efefef; background-image:url(../images/default/grid/row-over.gif); } .x-grid3-resize-proxy { background-color:#777; } .x-grid3-resize-marker { background-color:#777; } .x-grid3-header{ background-color:#f9f9f9; background-image:url(../images/default/grid/grid3-hrow.gif); } .x-grid3-header-pop { border-left-color:#d0d0d0; } .x-grid3-header-pop-inner { border-left-color:#eee; background-image:url(../images/default/grid/hd-pop.gif); } td.x-grid3-hd-over, td.sort-desc, td.sort-asc, td.x-grid3-hd-menu-open { border-left-color:#aaccf6; border-right-color:#aaccf6; } td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-asc .x-grid3-hd-inner, td.x-grid3-hd-menu-open .x-grid3-hd-inner { background-color:#ebf3fd; background-image:url(../images/default/grid/grid3-hrow-over.gif); } .sort-asc .x-grid3-sort-icon { background-image: url(../images/default/grid/sort_asc.gif); } .sort-desc .x-grid3-sort-icon { background-image: url(../images/default/grid/sort_desc.gif); } .x-grid3-cell-text, .x-grid3-hd-text { color:#000; } .x-grid3-split { background-image: url(../images/default/grid/grid-split.gif); } .x-grid3-hd-text { color:#15428b; } .x-dd-drag-proxy .x-grid3-hd-inner{ background-color:#ebf3fd; background-image:url(../images/default/grid/grid3-hrow-over.gif); border-color:#aaccf6; } .col-move-top{ background-image:url(../images/default/grid/col-move-top.gif); } .col-move-bottom{ background-image:url(../images/default/grid/col-move-bottom.gif); } td.grid-hd-group-cell { background: url(../images/default/grid/grid3-hrow.gif) repeat-x bottom; } .x-grid3-row-selected { background-color: #dfe8f6 !important; background-image: none; border-color:#a3bae9; } .x-grid3-cell-selected{ background-color: #b8cfee !important; color:#000; } .x-grid3-cell-selected span{ color:#000 !important; } .x-grid3-cell-selected .x-grid3-cell-text{ color:#000; } .x-grid3-locked td.x-grid3-row-marker, .x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker{ background-color:#ebeadb !important; background-image:url(../images/default/grid/grid-hrow.gif) !important; color:#000; border-top-color:#fff; border-right-color:#6fa0df !important; } .x-grid3-locked td.x-grid3-row-marker div, .x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker div{ color:#15428b !important; } .x-grid3-dirty-cell { background-image:url(../images/default/grid/dirty.gif); } .x-grid3-topbar, .x-grid3-bottombar{ font:normal 11px arial, tahoma, helvetica, sans-serif; } .x-grid3-bottombar .x-toolbar{ border-top-color:#a9bfd3; } .x-props-grid .x-grid3-td-name .x-grid3-cell-inner{ background-image:url(../images/default/grid/grid3-special-col-bg.gif) !important; color:#000 !important; } .x-props-grid .x-grid3-body .x-grid3-td-name{ background-color:#fff !important; border-right-color:#eee; } .xg-hmenu-sort-asc .x-menu-item-icon{ background-image: url(../images/default/grid/hmenu-asc.gif); } .xg-hmenu-sort-desc .x-menu-item-icon{ background-image: url(../images/default/grid/hmenu-desc.gif); } .xg-hmenu-lock .x-menu-item-icon{ background-image: url(../images/default/grid/hmenu-lock.gif); } .xg-hmenu-unlock .x-menu-item-icon{ background-image: url(../images/default/grid/hmenu-unlock.gif); } .x-grid3-hd-btn { background-color:#c3daf9; background-image:url(../images/default/grid/grid3-hd-btn.gif); } .x-grid3-body .x-grid3-td-expander { background-image:url(../images/default/grid/grid3-special-col-bg.gif); } .x-grid3-row-expander { background-image:url(../images/default/grid/row-expand-sprite.gif); } .x-grid3-body .x-grid3-td-checker { background-image: url(../images/default/grid/grid3-special-col-bg.gif); } .x-grid3-row-checker, .x-grid3-hd-checker { background-image:url(../images/default/grid/row-check-sprite.gif); } .x-grid3-body .x-grid3-td-numberer { background-image:url(../images/default/grid/grid3-special-col-bg.gif); } .x-grid3-body .x-grid3-td-numberer .x-grid3-cell-inner { color:#444; } .x-grid3-body .x-grid3-td-row-icon { background-image:url(../images/default/grid/grid3-special-col-bg.gif); } .x-grid3-body .x-grid3-row-selected .x-grid3-td-numberer, .x-grid3-body .x-grid3-row-selected .x-grid3-td-checker, .x-grid3-body .x-grid3-row-selected .x-grid3-td-expander { background-image:url(../images/default/grid/grid3-special-col-sel-bg.gif); } .x-grid3-check-col { background-image:url(../images/default/menu/unchecked.gif); } .x-grid3-check-col-on { background-image:url(../images/default/menu/checked.gif); } .x-grid-group, .x-grid-group-body, .x-grid-group-hd { zoom:1; } .x-grid-group-hd { border-bottom-color:#99bbe8; } .x-grid-group-hd div.x-grid-group-title { background-image:url(../images/default/grid/group-collapse.gif); color:#3764a0; font:bold 11px tahoma, arial, helvetica, sans-serif; } .x-grid-group-collapsed .x-grid-group-hd div.x-grid-group-title { background-image:url(../images/default/grid/group-expand.gif); } .x-group-by-icon { background-image:url(../images/default/grid/group-by.gif); } .x-cols-icon { background-image:url(../images/default/grid/columns.gif); } .x-show-groups-icon { background-image:url(../images/default/grid/group-by.gif); } .x-grid-empty { color:gray; font:normal 11px tahoma, arial, helvetica, sans-serif; } .x-grid-with-col-lines .x-grid3-row td.x-grid3-cell { border-right-color:#ededed; } .x-grid-with-col-lines .x-grid3-row-selected { border-top-color:#a3bae9; }.x-dd-drag-ghost{ color:#000; font: normal 11px arial, helvetica, sans-serif; border-color: #ddd #bbb #bbb #ddd; background-color:#fff; } .x-dd-drop-nodrop .x-dd-drop-icon{ background-image: url(../images/default/dd/drop-no.gif); } .x-dd-drop-ok .x-dd-drop-icon{ background-image: url(../images/default/dd/drop-yes.gif); } .x-dd-drop-ok-add .x-dd-drop-icon{ background-image: url(../images/default/dd/drop-add.gif); } .x-view-selector { background-color:#c3daf9; border-color:#3399bb; }.x-tree-node-expanded .x-tree-node-icon{ background-image:url(../images/default/tree/folder-open.gif); } .x-tree-node-leaf .x-tree-node-icon{ background-image:url(../images/default/tree/leaf.gif); } .x-tree-node-collapsed .x-tree-node-icon{ background-image:url(../images/default/tree/folder.gif); } .x-tree-node-loading .x-tree-node-icon{ background-image:url(../images/default/tree/loading.gif) !important; } .x-tree-node .x-tree-node-inline-icon { background-image: none; } .x-tree-node-loading a span{ font-style: italic; color:#444444; } .x-tree-lines .x-tree-elbow{ background-image:url(../images/default/tree/elbow.gif); } .x-tree-lines .x-tree-elbow-plus{ background-image:url(../images/default/tree/elbow-plus.gif); } .x-tree-lines .x-tree-elbow-minus{ background-image:url(../images/default/tree/elbow-minus.gif); } .x-tree-lines .x-tree-elbow-end{ background-image:url(../images/default/tree/elbow-end.gif); } .x-tree-lines .x-tree-elbow-end-plus{ background-image:url(../images/default/tree/elbow-end-plus.gif); } .x-tree-lines .x-tree-elbow-end-minus{ background-image:url(../images/default/tree/elbow-end-minus.gif); } .x-tree-lines .x-tree-elbow-line{ background-image:url(../images/default/tree/elbow-line.gif); } .x-tree-no-lines .x-tree-elbow-plus{ background-image:url(../images/default/tree/elbow-plus-nl.gif); } .x-tree-no-lines .x-tree-elbow-minus{ background-image:url(../images/default/tree/elbow-minus-nl.gif); } .x-tree-no-lines .x-tree-elbow-end-plus{ background-image:url(../images/default/tree/elbow-end-plus-nl.gif); } .x-tree-no-lines .x-tree-elbow-end-minus{ background-image:url(../images/default/tree/elbow-end-minus-nl.gif); } .x-tree-arrows .x-tree-elbow-plus{ background-image:url(../images/default/tree/arrows.gif); } .x-tree-arrows .x-tree-elbow-minus{ background-image:url(../images/default/tree/arrows.gif); } .x-tree-arrows .x-tree-elbow-end-plus{ background-image:url(../images/default/tree/arrows.gif); } .x-tree-arrows .x-tree-elbow-end-minus{ background-image:url(../images/default/tree/arrows.gif); } .x-tree-node{ color:#000; font: normal 11px arial, tahoma, helvetica, sans-serif; } .x-tree-node a, .x-dd-drag-ghost a{ color:#000; } .x-tree-node a span, .x-dd-drag-ghost a span{ color:#000; } .x-tree-node .x-tree-node-disabled a span{ color:gray !important; } .x-tree-node div.x-tree-drag-insert-below{ border-bottom-color:#36c; } .x-tree-node div.x-tree-drag-insert-above{ border-top-color:#36c; } .x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-below a{ border-bottom-color:#36c; } .x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-above a{ border-top-color:#36c; } .x-tree-node .x-tree-drag-append a span{ background-color:#ddd; border-color:gray; } .x-tree-node .x-tree-node-over { background-color: #eee; } .x-tree-node .x-tree-selected { background-color: #d9e8fb; } .x-tree-drop-ok-append .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-add.gif); } .x-tree-drop-ok-above .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-over.gif); } .x-tree-drop-ok-below .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-under.gif); } .x-tree-drop-ok-between .x-dd-drop-icon{ background-image: url(../images/default/tree/drop-between.gif); }.x-date-picker { border-color: #1b376c; background-color:#fff; } .x-date-middle,.x-date-left,.x-date-right { background-image: url(../images/default/shared/hd-sprite.gif); color:#fff; font:bold 11px "sans serif", tahoma, verdana, helvetica; } .x-date-middle .x-btn .x-btn-text { color:#fff; } .x-date-middle .x-btn-mc em.x-btn-arrow { background-image:url(../images/default/toolbar/btn-arrow-light.gif); } .x-date-right a { background-image: url(../images/default/shared/right-btn.gif); } .x-date-left a{ background-image: url(../images/default/shared/left-btn.gif); } .x-date-inner th { background-color:#dfecfb; background-image:url(../images/default/shared/glass-bg.gif); border-bottom-color:#a3bad9; font:normal 10px arial, helvetica,tahoma,sans-serif; color:#233d6d; } .x-date-inner td { border-color:#fff; } .x-date-inner a { font:normal 11px arial, helvetica,tahoma,sans-serif; color:#000; } .x-date-inner .x-date-active{ color:#000; } .x-date-inner .x-date-selected a{ background-color:#dfecfb; background-image:url(../images/default/shared/glass-bg.gif); border-color:#8db2e3; } .x-date-inner .x-date-today a{ border-color:darkred; } .x-date-inner .x-date-selected span{ font-weight:bold; } .x-date-inner .x-date-prevday a,.x-date-inner .x-date-nextday a { color:#aaa; } .x-date-bottom { border-top-color:#a3bad9; background-color:#dfecfb; background-image:url(../images/default/shared/glass-bg.gif); } .x-date-inner a:hover, .x-date-inner .x-date-disabled a:hover{ color:#000; background-color:#ddecfe; } .x-date-inner .x-date-disabled a { background-color:#eee; color:#bbb; } .x-date-mmenu{ background-color:#eee !important; } .x-date-mmenu .x-menu-item { font-size:10px; color:#000; } .x-date-mp { background-color:#fff; } .x-date-mp td { font:normal 11px arial, helvetica,tahoma,sans-serif; } .x-date-mp-btns button { background-color:#083772; color:#fff; border-color: #3366cc #000055 #000055 #3366cc; font:normal 11px arial, helvetica,tahoma,sans-serif; } .x-date-mp-btns { background-color: #dfecfb; background-image: url(../images/default/shared/glass-bg.gif); } .x-date-mp-btns td { border-top-color: #c5d2df; } td.x-date-mp-month a,td.x-date-mp-year a { color:#15428b; } td.x-date-mp-month a:hover,td.x-date-mp-year a:hover { color:#15428b; background-color: #ddecfe; } td.x-date-mp-sel a { background-color: #dfecfb; background-image: url(../images/default/shared/glass-bg.gif); border-color:#8db2e3; } .x-date-mp-ybtn a { background-image:url(../images/default/panel/tool-sprites.gif); } td.x-date-mp-sep { border-right-color:#c5d2df; }.x-tip .x-tip-close{ background-image: url(../images/default/qtip/close.gif); } .x-tip .x-tip-tc, .x-tip .x-tip-tl, .x-tip .x-tip-tr, .x-tip .x-tip-bc, .x-tip .x-tip-bl, .x-tip .x-tip-br, .x-tip .x-tip-ml, .x-tip .x-tip-mr { background-image: url(../images/default/qtip/tip-sprite.gif); } .x-tip .x-tip-mc { font: normal 11px tahoma,arial,helvetica,sans-serif; } .x-tip .x-tip-ml { background-color: #fff; } .x-tip .x-tip-header-text { font: bold 11px tahoma,arial,helvetica,sans-serif; color:#444; } .x-tip .x-tip-body { font: normal 11px tahoma,arial,helvetica,sans-serif; color:#444; } .x-form-invalid-tip .x-tip-tc, .x-form-invalid-tip .x-tip-tl, .x-form-invalid-tip .x-tip-tr, .x-form-invalid-tip .x-tip-bc, .x-form-invalid-tip .x-tip-bl, .x-form-invalid-tip .x-tip-br, .x-form-invalid-tip .x-tip-ml, .x-form-invalid-tip .x-tip-mr { background-image: url(../images/default/form/error-tip-corners.gif); } .x-form-invalid-tip .x-tip-body { background-image:url(../images/default/form/exclamation.gif); } .x-tip-anchor { background-image:url(../images/default/qtip/tip-anchor-sprite.gif); }.x-menu { background-color:#f0f0f0; background-image:url(../images/default/menu/menu.gif); } .x-menu-floating{ border-color:#718bb7; } .x-menu-nosep { background-image:none; } .x-menu-list-item{ font:normal 11px arial,tahoma,sans-serif; } .x-menu-item-arrow{ background-image:url(../images/default/menu/menu-parent.gif); } .x-menu-sep { background-color:#e0e0e0; border-bottom-color:#fff; } a.x-menu-item { color:#222; } .x-menu-item-active { background-image: url(../images/default/menu/item-over.gif); background-color: #dbecf4; border-color:#aaccf6; } .x-menu-item-active a.x-menu-item { border-color:#aaccf6; } .x-menu-check-item .x-menu-item-icon{ background-image:url(../images/default/menu/unchecked.gif); } .x-menu-item-checked .x-menu-item-icon{ background-image:url(../images/default/menu/checked.gif); } .x-menu-item-checked .x-menu-group-item .x-menu-item-icon{ background-image:url(../images/default/menu/group-checked.gif); } .x-menu-group-item .x-menu-item-icon{ background-image:none; } .x-menu-plain { background-color:#f0f0f0 !important; background-image: none; } .x-date-menu, .x-color-menu{ background-color: #fff !important; } .x-menu .x-date-picker{ border-color:#a3bad9; } .x-cycle-menu .x-menu-item-checked { border-color:#a3bae9 !important; background-color:#def8f6; } .x-menu-scroller-top { background-image:url(../images/default/layout/mini-top.gif); } .x-menu-scroller-bottom { background-image:url(../images/default/layout/mini-bottom.gif); } .x-box-tl { background-image: url(../images/default/box/corners.gif); } .x-box-tc { background-image: url(../images/default/box/tb.gif); } .x-box-tr { background-image: url(../images/default/box/corners.gif); } .x-box-ml { background-image: url(../images/default/box/l.gif); } .x-box-mc { background-color: #eee; background-image: url(../images/default/box/tb.gif); font-family: "Myriad Pro","Myriad Web","Tahoma","Helvetica","Arial",sans-serif; color: #393939; font-size: 12px; } .x-box-mc h3 { font-size: 14px; font-weight: bold; } .x-box-mr { background-image: url(../images/default/box/r.gif); } .x-box-bl { background-image: url(../images/default/box/corners.gif); } .x-box-bc { background-image: url(../images/default/box/tb.gif); } .x-box-br { background-image: url(../images/default/box/corners.gif); } .x-box-blue .x-box-bl, .x-box-blue .x-box-br, .x-box-blue .x-box-tl, .x-box-blue .x-box-tr { background-image: url(../images/default/box/corners-blue.gif); } .x-box-blue .x-box-bc, .x-box-blue .x-box-mc, .x-box-blue .x-box-tc { background-image: url(../images/default/box/tb-blue.gif); } .x-box-blue .x-box-mc { background-color: #c3daf9; } .x-box-blue .x-box-mc h3 { color: #17385b; } .x-box-blue .x-box-ml { background-image: url(../images/default/box/l-blue.gif); } .x-box-blue .x-box-mr { background-image: url(../images/default/box/r-blue.gif); }.x-combo-list { border-color:#98c0f4; background-color:#ddecfe; font:normal 12px tahoma, arial, helvetica, sans-serif; } .x-combo-list-inner { background-color:#fff; } .x-combo-list-hd { font:bold 11px tahoma, arial, helvetica, sans-serif; color:#15428b; background-image: url(../images/default/layout/panel-title-light-bg.gif); border-bottom-color:#98c0f4; } .x-resizable-pinned .x-combo-list-inner { border-bottom-color:#98c0f4; } .x-combo-list-item { border-color:#fff; } .x-combo-list .x-combo-selected{ border-color:#a3bae9 !important; background-color:#dfe8f6; } .x-combo-list .x-toolbar { border-top-color:#98c0f4; } .x-combo-list-small { font:normal 11px tahoma, arial, helvetica, sans-serif; }.x-panel { border-color: #99bbe8; } .x-panel-header { color:#15428b; font-weight:bold; font-size: 11px; font-family: tahoma,arial,verdana,sans-serif; border-color:#99bbe8; background-image: url(../images/default/panel/white-top-bottom.gif); } .x-panel-body { border-color:#99bbe8; background-color:#fff; } .x-panel-bbar .x-toolbar, .x-panel-tbar .x-toolbar { border-color:#99bbe8; } .x-panel-tbar-noheader .x-toolbar, .x-panel-mc .x-panel-tbar .x-toolbar { border-top-color:#99bbe8; } .x-panel-body-noheader, .x-panel-mc .x-panel-body { border-top-color:#99bbe8; } .x-panel-tl .x-panel-header { color:#15428b; font:bold 11px tahoma,arial,verdana,sans-serif; } .x-panel-tc { background-image: url(../images/default/panel/top-bottom.gif); } .x-panel-tl, .x-panel-tr, .x-panel-bl, .x-panel-br{ background-image: url(../images/default/panel/corners-sprite.gif); border-bottom-color:#99bbe8; } .x-panel-bc { background-image: url(../images/default/panel/top-bottom.gif); } .x-panel-mc { font: normal 11px tahoma,arial,helvetica,sans-serif; background-color:#dfe8f6; } .x-panel-ml { background-color: #fff; background-image:url(../images/default/panel/left-right.gif); } .x-panel-mr { background-image: url(../images/default/panel/left-right.gif); } .x-tool { background-image:url(../images/default/panel/tool-sprites.gif); } .x-panel-ghost { background-color:#cbddf3; } .x-panel-ghost ul { border-color:#99bbe8; } .x-panel-dd-spacer { border-color:#99bbe8; } .x-panel-fbar td,.x-panel-fbar span,.x-panel-fbar input,.x-panel-fbar div,.x-panel-fbar select,.x-panel-fbar label{ font:normal 11px arial,tahoma, helvetica, sans-serif; } .x-window-proxy { background-color:#c7dffc; border-color:#99bbe8; } .x-window-tl .x-window-header { color:#15428b; font:bold 11px tahoma,arial,verdana,sans-serif; } .x-window-tc { background-image: url(../images/default/window/top-bottom.png); } .x-window-tl { background-image: url(../images/default/window/left-corners.png); } .x-window-tr { background-image: url(../images/default/window/right-corners.png); } .x-window-bc { background-image: url(../images/default/window/top-bottom.png); } .x-window-bl { background-image: url(../images/default/window/left-corners.png); } .x-window-br { background-image: url(../images/default/window/right-corners.png); } .x-window-mc { border-color:#99bbe8; font: normal 11px tahoma,arial,helvetica,sans-serif; background-color:#dfe8f6; } .x-window-ml { background-image: url(../images/default/window/left-right.png); } .x-window-mr { background-image: url(../images/default/window/left-right.png); } .x-window-maximized .x-window-tc { background-color:#fff; } .x-window-bbar .x-toolbar { border-top-color:#99bbe8; } .x-panel-ghost .x-window-tl { border-bottom-color:#99bbe8; } .x-panel-collapsed .x-window-tl { border-bottom-color:#84a0c4; } .x-dlg-mask{ background-color:#ccc; } .x-window-plain .x-window-mc { background-color: #ccd9e8; border-color: #a3bae9 #dfe8f6 #dfe8f6 #a3bae9; } .x-window-plain .x-window-body { border-color: #dfe8f6 #a3bae9 #a3bae9 #dfe8f6; } body.x-body-masked .x-window-plain .x-window-mc { background-color: #ccd9e8; }.x-html-editor-wrap { border-color:#a9bfd3; background-color:#fff; } .x-html-editor-tb .x-btn-text { background-image:url(../images/default/editor/tb-sprite.gif); }.x-panel-noborder .x-panel-header-noborder { border-bottom-color:#99bbe8; } .x-panel-noborder .x-panel-tbar-noborder .x-toolbar { border-bottom-color:#99bbe8; } .x-panel-noborder .x-panel-bbar-noborder .x-toolbar { border-top-color:#99bbe8; } .x-tab-panel-bbar-noborder .x-toolbar { border-top-color:#99bbe8; } .x-tab-panel-tbar-noborder .x-toolbar { border-bottom-color:#99bbe8; }.x-border-layout-ct { background-color:#dfe8f6; } .x-accordion-hd { color:#222; font-weight:normal; background-image: url(../images/default/panel/light-hd.gif); } .x-layout-collapsed{ background-color:#d2e0f2; border-color:#98c0f4; } .x-layout-collapsed-over{ background-color:#d9e8fb; } .x-layout-split-west .x-layout-mini { background-image:url(../images/default/layout/mini-left.gif); } .x-layout-split-east .x-layout-mini { background-image:url(../images/default/layout/mini-right.gif); } .x-layout-split-north .x-layout-mini { background-image:url(../images/default/layout/mini-top.gif); } .x-layout-split-south .x-layout-mini { background-image:url(../images/default/layout/mini-bottom.gif); } .x-layout-cmini-west .x-layout-mini { background-image:url(../images/default/layout/mini-right.gif); } .x-layout-cmini-east .x-layout-mini { background-image:url(../images/default/layout/mini-left.gif); } .x-layout-cmini-north .x-layout-mini { background-image:url(../images/default/layout/mini-bottom.gif); } .x-layout-cmini-south .x-layout-mini { background-image:url(../images/default/layout/mini-top.gif); }.x-progress-wrap { border-color:#6593cf; } .x-progress-inner { background-color:#e0e8f3; background-image:url(../images/default/qtip/bg.gif); } .x-progress-bar { background-color:#9cbfee; background-image:url(../images/default/progress/progress-bg.gif); border-top-color:#d1e4fd; border-bottom-color:#7fa9e4; border-right-color:#7fa9e4; } .x-progress-text { font-size:11px; font-weight:bold; color:#fff; } .x-progress-text-back { color:#396095; }.x-list-header{ background-color:#f9f9f9; background-image:url(../images/default/grid/grid3-hrow.gif); } .x-list-header-inner div em { border-left-color:#ddd; font:normal 11px arial, tahoma, helvetica, sans-serif; } .x-list-body dt em { font:normal 11px arial, tahoma, helvetica, sans-serif; } .x-list-over { background-color:#eee; } .x-list-selected { background-color:#dfe8f6; } .x-list-resizer { border-left-color:#555; border-right-color:#555; } .x-list-header-inner em.sort-asc, .x-list-header-inner em.sort-desc { background-image:url(../images/default/grid/sort-hd.gif); border-color: #99bbe8; }.x-slider-horz, .x-slider-horz .x-slider-end, .x-slider-horz .x-slider-inner { background-image:url(../images/default/slider/slider-bg.png); } .x-slider-horz .x-slider-thumb { background-image:url(../images/default/slider/slider-thumb.png); } .x-slider-vert, .x-slider-vert .x-slider-end, .x-slider-vert .x-slider-inner { background-image:url(../images/default/slider/slider-v-bg.png); } .x-slider-vert .x-slider-thumb { background-image:url(../images/default/slider/slider-v-thumb.png); }.x-window-dlg .ext-mb-text, .x-window-dlg .x-window-header-text { font-size:12px; } .x-window-dlg .ext-mb-textarea { font:normal 12px tahoma,arial,helvetica,sans-serif; } .x-window-dlg .x-msg-box-wait { background-image:url(../images/default/grid/loading.gif); } .x-window-dlg .ext-mb-info { background-image:url(../images/default/window/icon-info.gif); } .x-window-dlg .ext-mb-warning { background-image:url(../images/default/window/icon-warning.gif); } .x-window-dlg .ext-mb-question { background-image:url(../images/default/window/icon-question.gif); } .x-window-dlg .ext-mb-error { background-image:url(../images/default/window/icon-error.gif); }glpi-0.84.3+dfsg.1/lib/extjs/resources/images/000077500000000000000000000000001226600447100210035ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/000077500000000000000000000000001226600447100224275ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/box/000077500000000000000000000000001226600447100232175ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/box/corners-blue.gif000066400000000000000000000017621226600447100263140ustar00rootroot00000000000000GIF89a @@!, 5 Hp   !&p`& X pBIjIVA\1p(ȁcHh"@K>`!*&hʰ`l"* @XM$@  A 8$PB4e aIaX v $l$A0yHIC̀;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/box/corners.gif000066400000000000000000000017551226600447100253710ustar00rootroot00000000000000GIF89a @@!,  Hp a)8<8!!8P 8v 8q@#PTCD8C "5z`qd &R/ p8$€# ZUx Hlh@ C\X&BdA,,5 DheYUP 24@\xB$=da̿%\;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/box/l-blue.gif000066400000000000000000000014521226600447100250700ustar00rootroot00000000000000GIF89a!,0 ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/box/l.gif000066400000000000000000000014521226600447100241430ustar00rootroot00000000000000GIF89a!,0 ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/box/r-blue.gif000066400000000000000000000014521226600447100250760ustar00rootroot00000000000000GIF89a!, ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/box/r.gif000066400000000000000000000014521226600447100241510ustar00rootroot00000000000000GIF89a!, ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/box/tb-blue.gif000066400000000000000000000015231226600447100252410ustar00rootroot00000000000000GIF89a*!,*07\AA : ,T@a8@ @@;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/box/tb.gif000066400000000000000000000015071226600447100243160ustar00rootroot00000000000000GIF89a !, $  A `@ $DA $@p@;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/button/000077500000000000000000000000001226600447100237425ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/button/arrow.gif000066400000000000000000000014741226600447100255710ustar00rootroot00000000000000GIF89a !, H XPaÃJX0 ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/button/btn.gif000066400000000000000000000103121226600447100252110ustar00rootroot00000000000000GIF89artsutvxw€yyząԃт}|ƈׇֆ}|Ň~ǀɋ؊ׂʁɌل̃ˎڇφ΅͉ЊЌҋэә㏬ԑ֐՟螽鞺|}~́Ѐσ҄ҍڐ܏ۓޒݗᖷߚ䜼喴ڙۥݼ!,C:tJhPrɌL* @ٱ4-drM#L&zUJ4i²ehzEq'`<N&ň)0Y2 A1Ԉjݪׯ`K,YhӪM۷pZK]ݫף߿LÈ#6˸ǐ#CIw3M¹ϝ}MZӨOO]ͺ5kl` *z|A[XhpʑS2Y.'öu05ih0PAœs$| KVoJ5jTAA5=H"I);0`ǁv0 N)CxTG0HD ) pLjwPN@98#`@!4b9(xN @(5pȐ1(SLyD`1c(RH1 !dxe [r{ĹPL1(QD!(,H 1 B PAcD:F00@(Zh!*w{棯~w~{')ЀD @ o1A ^~ L`QhVP+| ]ưamHA;!K(DFLAʰLlDpMa+&QXEьeѸF5>m8G'wG=RяYb H8ZD ŘF91<B4$ 3yJ$%C9>bҒ#MR*|*FҒ&QJXޒ)EY0]YKe21 M\S%2Kg̴f2oRS&7ifT89nt9yNx3ۜ@IЀ4M(B Ph?'ϊh>7ώ );A:Rֳ(=Jҁ*0(E1QԥE5Q1)M{ҟT;OqԙԦFͩSZT"uPPT^UVzSNe=Xզ&Z=kVֹU]k]*սUX[׾6+bض~]] ٸu+]Ylc-YҎViUZjudA[6`q[~-f-pY״mo{vMnn ].lËb .w{^JWMswՍ.~^~~l_׼\`Xup|a*o <3 a 71=\bx"pIa'1cbx+1kH.r[&3D,*@.<Ǭ2Øg6s5p>Lg*c`F,e+kbVs\g?9m< υ3>Kщ4MiMzҏ&AiQ{6EՕtaUwZճm]זu}i`˺6[lR3ΎQ-WԮ=mZzuoG[F]nbƶ=oy_ok .pO'N[O7{@GN_(OWrc09Eۼʹw| Ї.tcH?;PNS`XϺֳ{`{fOkpNw]x; OK9b&O[ϼ7{GOқOWֻgOϽwOO;ЏO[Ͼ{OOOϿ8Xx ؀8Xx؁ "8$X&x(*,؂.0284X6x8:<؃>@B8DXFxHJLX(PPhTXVXՑZ\؅^8 b8b( fxhj!np/2tXt#xzM҇~~%88lr'؈؈8)xx+2X-Ҋ/88 s1؋؋-83xxO،6oSx8ڸܸ(:XX긎(<3X(>؏9Yy ِ9Yyّ "9$Y&y(*,ْ.0294Y6y8:<ٓ>@B9DYFyHJLٔNPR9TYVyXZ\ٕ^`b9dYfyhjlٖnpr9tYvyxz|ٗ~9Yy٘9Yyٙ9Yyٚ9YYYћ9QyʹҜ9$Ry5ڹRҝc9rRy깞Ҟ9Ryҟ:Rz Ӡ$:3SzDUӡf":uS&z*Ӣ.2:S6zȓ:ӣ>@B:DZFzHJLڤNPR:TZVzXZ\ڥ^`b:dZfzhjlڦnpr:tZvzxz|ڧ~:Zzڨ:Zzک:Zzڪ:Zzګ:ZzȚʺڬ:Zzؚںڭ:Zz蚮꺮ڮ:Zz;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/button/group-cs.gif000066400000000000000000000046331226600447100261760ustar00rootroot00000000000000GIF89a,@@!,,@P@*\ȰÇ#JHŋ3jȱǏ CIɓ(S\ɲ˗0_P rɳϟ@ JѣH*]Nn$@իXjʵׯ`ÊI@N˶۷pʝK݇jT{߿ Lռh^̸ǐ#Kxoɘ3k̹gȕ^LӨSfZװc˞MtYͻȓ+_8\УK>ZسkËO^ӫ_+^EK2emv+Զކ+Kk$jn ѻkoޫ/+0l / ?,qOl1_o챦,r!l%r)2-,s1l35߬93=,tAm4EtI/M?-QOmU_Yo5]-vamevim-}qm7|u߭wzyx}-vntr/q?.oOn9m_koi.gnzf:db.`n{_߮\[.|XoF/DoC߯B8}<1{ ' n38 ryB(㑰;! . c8u6r񰇣!?'!nF8%2qN|(Q"-^81mf<ҨƳc{#&9nv8=i~)ȣC;$"E$#9IRe2ɓq#$(?&Qn*S9Ua|b)˃Ѳ%.]0Ya3^i*T4k<*RݨԥƱN#TzǩRUVjU@r*X )ֱ&fe$ZȵUn}k%*WLҵ+^=׽~%%`{V=l+XX2|,dm)沲%f3rVl1C+Zd<-jF&NbxҖSs[U-p*n*r2}Y+]Rm.vε޵+xÛ񒗯=_ӫ^}/|+.u,Nv_E*:ʞD';glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/button/group-lr.gif000066400000000000000000000015351226600447100262040ustar00rootroot00000000000000GIF89a!,:@*\ȰÇ#JHŋ3jȱǏ CIɓ(S\ɲK;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/button/group-tb.gif000066400000000000000000000015161226600447100261730ustar00rootroot00000000000000GIF89a,!,,+ @*\xÇ#JHŋ3jȱǏ Cn ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/button/s-arrow-b-noline.gif000066400000000000000000000016021226600447100275230ustar00rootroot00000000000000GIF89a!,_H*\ȰÇ#JHŋ3jȱǏ CIɓ(S\ɲ˗0cʜIMrɳ'G> `ѣH*]ʴӧPv ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/button/s-arrow-b.gif000066400000000000000000000016511226600447100262450ustar00rootroot00000000000000GIF89a!,H*\ȰÇ#J0ŋ3jȱǏ CIɓ\ɲ˗0cʜI͛8s)ϟ@ JѣH*]ʴӧPJJիhՊׯKv*hӪ]˶۷pʝKl@;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/button/s-arrow-bo.gif000066400000000000000000000002131226600447100264150ustar00rootroot00000000000000GIF89a! ,@\ڋxH扦ʶL \ĢL* JԪjܮkeNij S(ʞH XTA0pthգ@ʒ+լ`*,ٳ[Ǧ5mWouUb@;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/button/s-arrow.gif000066400000000000000000000016511226600447100260260ustar00rootroot00000000000000GIF89aH!,H "\( à (ań+RaGD8bF'=RdK/M^xĘ7gĨ'Ϛ>ij S(ʞH XTA0pthգ@ʒ+լ`*,ٳ[Ǧ5mWouUb@;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/dd/000077500000000000000000000000001226600447100230165ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/dd/drop-add.gif000066400000000000000000000017511226600447100252030ustar00rootroot00000000000000GIF89a=5B6C8D;E{aOHq) 4p #41QI @-Yp0! ⰵ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/dd/drop-no.gif000066400000000000000000000016651226600447100250730ustar00rootroot00000000000000GIF89a$$44<t@aK |`BŸ hM bS ҁAcμ*fZeH$jH3nq"Ö%N$(;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/dd/drop-yes.gif000066400000000000000000000017701226600447100252540ustar00rootroot00000000000000GIF89a'r$&#)w%)z%4|051&#*%51?;?;?;?<;'L=B3D3I'Q.U5]?Z7NARB^HdLlVmWnXoXoYjPt[t\pWpYq[r[s\q_w`}f|d}f}gi\;\=fIjIlKiJtYrUoaoananbncodpcqcpesftdrhthuhvivjyd~i~oykzmpmrusrwyvxǃˆ̅ȏ͈LJˆʇ̇͊΋ыЌԍבҐґؒ֕וזқӛܗߛסנܥܦ٥ݧ٥ڦۨۨݪ߬߬еѵٵ۵ߵ㟵᮷᯷᰾㶿!, HAB5\TǠ@G3hCg͇ 2zQŐ(Q`AU ))DȐ$}<G!%A|? 8nXt)1 JǡG<]T#Yd%I[`1'@ iB%-Jl@ |pI!X2B=(L :dO*IP@.y6ʲ`Vd&;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/editor/000077500000000000000000000000001226600447100237155ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/editor/tb-sprite.gif000066400000000000000000000040301226600447100263120ustar00rootroot00000000000000GIF89a#  04!$#/4:0( 0*4123<:G 8` 4p9A;)Ah"@q0H`@80]FPP0CCDIMSMVLISYPH@PHPQRSBWrS\dMuKQbPWpW^fk\mu`X`a~TphPefenwhv~nttt 8 @ H0H4P1S0X@X@X@`EaRiGf@eLpXvPpmw`ppw`x`x@hPpPx`x;7?w@bZu}8~x)VJN,fY>0"rhCXP̱#d&3AD GJ-@8)>|B/k_m*01Y X*0pv~ *@A;;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/form/000077500000000000000000000000001226600447100233725ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/form/checkbox.gif000066400000000000000000000040151226600447100256470ustar00rootroot00000000000000GIF89a4'***...222555999==="qBBBFFFHHHLLLRRRUUUYYY]]]bbbdddiiimmmrrruuuzzz~~~"<'A*D-F,T0I0W3X6Y?V:[=\,bE[I^@dK`LaWjEjLpRpTsVx]pasbudvgxhzk}nU[ww{T^ghciuy|ɋʀݕÝȗЛـ⣮ȦͩϯϥѠע٩ֻѶչЄ߻ի𠠤!,4'Hp"tÆ"J(3"dǏ qɓ\bDzKv,I3L>;> B"I"J &)W|]UPUE TiO.i'#u!YDv$H$]ڲ]OUz% WQWjXeJ¤V%[nΥJ6Ty+QPfbʤZ7%k5mܺusu׾Ò%tfM}{.tgp]-}=\SmI8[Fg%ǚn/RJWdȩT;zeФA[o-.5A#9sY2 4'QSKcp6WI&G09Q#xK0ahZFdcX(1#G 9CDDё1XAI5PF)e2j$<h:sYDLJװ52tDWO7uĝwBKiNE74Hd[#BcgqL &!̟li͠2AJ5wC6^ peGTH& Ku6:K5 ̒/xB<235"i7 8CV$lAN@ma m7ܰӍ6JL/ s\A*%D:΅EI&LC { H0R 0Ȱ[L009ϒH-( I"px 35 091E c R\͆j@2$"8 lCܙUs%ydN<].8/'qj&JĤBN>4Pf uWm'9ZRp`UU޻Q` J$u`U~iЇ)_bX`XHZKT?I[VH p).Ӂu p?SE 3@;3B `0Zpo~;* @+pUP@\L Q pQT?AaC(TpFLb0/\@W@8?SP12&@ `]`r8E BA@@\HE*Bz(@+ W(2`($ <  Tah AqK AP! Q|"b84 Z2Q>Qa @1=[u4׸<.rj': ;;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/form/clear-trigger.gif000066400000000000000000000037041226600447100266140ustar00rootroot00000000000000GIF89af0xXzY{Z{0abb~فЁЁёББё൸Ȯ!,f5H@*\ȰÇ#JlhŋmiűǏI@rJ'cD͛8ai óϟd`<ў\)]ʴ+CKIΣFF5ӯKnE쫚fњ}!0eʼ֭بu-VY) <80CZVXby! _21 7Lɜ!$OD@zsϡGFvUZjjڡLZjBfPJV f:^HC*cH& H^EQi׳o=4i @S&桧{&`%Ztib$qvt3-:馣:뮋@įkhxA<^;3< /|' $.:^?h<ϿY(Z׾ŏi2H@|`L\"A -HA-(L WvP gHu@p]0HD&ˡ?&Zz.HD@ H2Ph61^xC1эhL<;B?yCRq$d D!I.J|#EQd'HJl)׈;+ ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/form/clear-trigger.psd000066400000000000000000000270341226600447100266370ustar00rootroot000000000000008BPSf8BIM7200705288BIM Tf48JFIF[[f  # !"!%'$ '!!    }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr $4%&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ?[[m:)ج <HϷz8Gde:e4uxN)Zd\n^sQR)YK u!U7 latk-2{m2%ˈI-ÀN滢Hvqt$Xt[ J[V :gb2;qvޛ&͉{&Ii̳tifE`O)ԝNnX |in2hz?6B@ۜgq3YZݾfΝeq]ZkR%Q Oe*m'6Dc]-o$X\pEJmZFb :ԸWzo)JIkiz]αzi o U6KI{R: {J0sjeyC}-f !i]r9wMފIj_=KTHt8ա !p=D*TT{(A+-OBiZ5J T#ƏiZGJײme_ JFn+Rrw1+sV^wt3.D|`-b5xѼ=:}&4H結[HK `7\㎕8>urStzCqo*G)=bʹcc ^1xӨMp5,M|G'9J^@>~u8Ԭ٥"1ԸGԉͩ&OSѵ+v}V;;Y"[q`n0/vd ;| Uƭ~o T)s?_[ur[@_1D gV)NFX+7 WOdD?vCju7/]}Y=@GakIl?VU.R}BW/%_^#E%,딿*We?]dxAQt~?}8BIM8BIM8BIMfpbp8BIMnorm<( BackgroundbZZ8BIMnorm<(Raster 1~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~𸸭ЭЭȸ9[^VRKORZ^W,,,,,,,,,,,,,,,,DD,,,,DD,,,,  D  D,,,, ,,,, DDDD,,DDDD,,,,,,DD,,,,DD  ,,  ,,DD DD ,,,,,,,,D,,,,,,,,D,,,,,,,,"HRRRLPRRR< `` `` `` `` 00 00 `` 00 00 ``0000 000000 00XX00XX00XXXXXXXXXX XԀX XԀXXX XԀX XԀXXX XۀX XۀX XԀX XۀX XۀX XԀX XۀX XۀX"HRRRLPRRR<       xxxx xxxx zzxxzzxxzzzzzzzzzz zޘz zޘzzz zޘz zޘzzz zߐz zߐz zޘz zߐz zߐz zޘz zߐz zߐz" >RRLHFNR<аааааааааааа8Xhld^dllh`48Xhld\bhldP(0RhhbV`frfH(~~~~~~~~~~~~~~~~~~~~~~~~~~~bb aa~~ aa~ bb~~ 00 00~ aa~ 00~ 00~ aa~00ށ00~ 00~ށ00~00~ 00~X߀X~ށ00~߀X~X~ށ00~XX ܁XX~݀Xİ~ ܁XX~߁XX~݀Xİ~ XՁX ہXсX۽~ ہXXۼ~ ہXсX۽~ ށXӁX~ ہXXۼ~ ZہZ YՁY~ ځXсXڵ~ YՁY~ Y؁Y~ ځXсXڵ~ ǼǼ~ YӁYߵ~ ǼǼ~~ YӁYߵ~~ Ӽּ~~~ Ӽּ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~𸸭    븀 ︩ 븀 ﹀﹀ ︩xxxx 글츀xxxx 글츀zzxxzzxxzzzzzЭzzzzzЭ zޙz zܙzzz zܙz zޙzzz {ޑ{ {ܑ{ zݙz {ܑ{ {ߑ{ zݙz {ܑ{ {ܑ{ȸ    аааа ааѰа аааа 거 거챰 거 거glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/form/date-trigger.gif000066400000000000000000000031031226600447100264340ustar00rootroot00000000000000GIF89af@@w~لȮ!,f H *\P†>p"Ņ/JǏII6\ɲ%J0Ke˛,QɳgOLJ)q*PУdHJJڳFPNflSUZM:3 Kn8(!%Ķ])`o_t#0bA KD$:F\@ΟF0D.]yŊrޡ᪆+[w޼:u w#kӶ0wp @M7ƏS7~ h>7]rB6UB^|v;,Xa~E8o2!R(t6qXY ))@0 )У'@'Hae $% \p&_9fe :nX*@)I~tЁu0hW\i`.0馇~"T`nT̚[Jfo 00 +lJJ]&{&W챛.+@L6mm}kffJL-\ 0_+fFw<$lr ll,k% 4l)<(-SH,LӌsG'tBG\HM3tQkBLdž-\w] -6PZp? tmo-7P6Y=C=qS ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/form/date-trigger.psd000066400000000000000000000301311226600447100264560ustar00rootroot000000000000008BPSf *8BIM7200705308BIM f4JFIF[[f  # !"!%'$ '!!    }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr $4%&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ?U֤.lYnʏ)bk1*ra)F7h~'e{]]vHt%vEkzMXAyi!DzN:T:_uC V)^hqa&|I"1"H:?.Hqiߚ7]y]۵̩QWit]GP2R_j^Ьm" I=֣k ied}HfB*NxZeNd'm&UEE`XՂT$|܁޴Itg*TܔU}= l8O}|UsO~/g i{m>K eH<'}5Pm}uWۯaԦꎯIβ;O sӎJSe$_0i4]CLZa46iDrHڼTC*jRiuV:э=7WɥE-W[i k/̖8~3]xJP* Sg+S+o'S<듩]]Bћpynݳ%wՆ (SivVǷtUۛݭ}v64IoH$}Q{wRJyY7RW? kb!%D$IyfvKyOnkΧOe?j8e+nڮ;Y3$0ʠhd;^haOi/ G7~#Hmqi/{n>o*ZdmY~l3{ǹ>zkg{m&GpiؕT\=M{3+ow#Ã/͛ZBXH[]y?$d2u<9<6Ӵ[jZ P^j1JrL1UV'vܛw)z$gs&ɝl$L6dnFdݑ<Ƿj)FOEaw|yH 4\Dڊ׹C gWuVv}]d׊z8 n1@WOdDmo.n~m n l~f/ǫ&@?G3 U-KjԽפ2Zq~%_/4hHYEVFpFA:?g=14Y߅ \ϸ!LD8T X(8BIMnorm<(Raster 1 @~@~@~@~@~@׵~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ٸϭϭϭϭϭЭЭ@@@@@@  @HZfNZfBT2 wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww @HZfNZfBT2 ޒޒޒޒޒޒޒޒޒޒޒޒޒޒޒޒޒޒޒޒޒޒޒޒޒޒޒޒޒޒޒޒޒޒޒޒ @HZfNZfBT2 ޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷ 48T\nzbnzVhJ$ 48T\nz`nzVhJ$58U]o{cnzVhJ$@~@~@~@~@~@׵~~~~~~~~~~~~~~~ww~~w~w~~ww~w~w~w~w~wwww~w~ww~ww~w~wwww~ww~ww~ww~ww~wwww~ww~ww~ww~ww~wwww~ww~ww~ww~ww~wwww~ww~ww~ww~ww~wwww~ww~ww~ww~ww~wwww~ww~ww~ww~ww~wwww~ww~ww~ww~ww~wwww~ww~ww~ww~ww~ww~ww~w~w~ww~~w~~~w~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ٸϭϭϭϭϭޒޒޒޒޒޒޒޒޒޒޒޒޒޒЭޒޒЭޒޒޒޒޒޒޒޒޒޒޒޒޒޒޒޒޒޒޒޒ@@@@@@޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷޷glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/form/error-tip-corners.gif000066400000000000000000000101271226600447100274560ustar00rootroot00000000000000GIF89a8@@1VFqf݋!,8@@*\ȰÇ#JHŋ3jȱǏ Cv@@D\ɲ˗0cʜIBpϟ@ Jс `GJJի $]J0OKٳ+ hUZ0=ʝK]Xzmܻ Lc^K x}[ǐet1Ș3k t-WN9MƭLA4ͺ8|M$ͻ Nȓ+_μУKNhνËOӫ_Ͼ˟O Ͽ(h& 6F(Vhv ($h(,0(4hb<@)DH&L6PF)TViXf\v`)dihlp)'Fix|*蠄j衈&裐F*餔bߥf馜v駠*wؕjꩨꪬ꫰6Xsj뭸뮼ꪖR^k&[( F+V&>kvb,k)k:ol60 7 W,gƷb 2,(L*r,,L87ls<>-t@mL+tPGRWm5T_ff`sud-f6hvm-qmwu߭7yw}-8΁n˅8ʉ/Ǎ?.őOnÕ_o.nz$gNN0k{{'o7:/=Oo_o}/>o埯~~Oߏ}hPz<`1{ ' 38 ruB(Bӑ;! =j. c(q6rC񰇂!&!ꭈF(%2mN|ڢ(EQd"-r^@0jf<#ƨL{#9Ov:q|{#)H#$"gE"^##IRq,ɐq$(Qj(S;Trb|%V)KŲ %.9G]N0 ^s}Z"@Ł=éyNK(DЉ-F3:rW*y<)Jҕ.'Lc*ЙҴ6)BsӅL=OZMF=$T%c*Ta&թVV0rh[*VU#+Zֵ^n\㊾5vv+'M+`$/W[I2V}l1+Y65lfYvkh:Z6ukj׺Zkl:[6jn[Ujp:\7iruܛ6ύit]:ݕV-ivEݏvhx-:މmhzރ h|9}g~wMg9qf`k6xf9aeV&fa_vxek9bY'feSbSx/e;9cM7d#cGx?Fd 9dAGcd;6yOc8e5VW&cøe/vy_b8f)gfbf#yob{8gwacgyFaK8h`3h 6z`8iV&`.Ӟv&eCVP>5GjUx}5Ys>٦vcsM`CMo)nvҢ-Qzii|pr䎨;t~F-һ 7G}L^+so!<[7Ļቬׄqj|iD^<?Lr2\,o9b.s04Xss9*F+ғ^ן3]~]'utyW_ҫξsIYߤ׿;pdgn=k'Iϝu{ }oߥx 酧];xx/ޖOAyO~ua凞_n7{ѕ>鑙77{r:=}4crː*_C4>ȑCooq;9oa\jC;o~~տ7W nߤQ޶sc)Xno6R PGu;wHՀk/5h, 6%(S"8ÁvEł5*{0(o277n9S4Xޗ@5;n=5G(T8&LUEnI5SSK6XhsQHnUx5_h5aF]mcHQemgFZ;׆ns?qPcMqզKttHt8GWtM7q|(mx4VlGHl(4GP>C=c9Êu`74dƋN勰4Xvj2HUxj،%HWdȍ%Fd Î䍱莥(5f㏮r(YY1k93GT搌HdÑ葹$%c Ʌ 9(i0/Y01 Y-I3/79Y*o<)W(BIDYxHJNUMHeŕ啢%EeŖ喲%Eeŗ%Eeʅ̥Ř%Eeڅܥř%Eeꅚ쥚Ś%Eeś&Ff Ɯ&FfƝ "$&&F(f*,.ƞ024&6F8f:<>Ɵ@BD&FFHfJLNƠPRT&VFXfZ\^ơ`bd&fFhfjlnƢprt&vFxfz|~ƣ棂&FfƤ椒&FfVqƥn?Ff[(ƦX"6T)vzOHƧL(bz4:.J4jzlll JqZju m:u_Rۦ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/form/exclamation.gif000066400000000000000000000017441226600447100263730ustar00rootroot00000000000000GIF89a@@K2M4O6T=U]2G2H4J3G3H4J8X>W>X@\@Z CgFd @X$D]0K_%F`&Hb.J`6Qf5RhFdzHcxT VY_]be.b3cFlJmQq< " (*(2X@GJLVWRZeji}kl~]cflizrtuz]itÌŎɏȑƑɘʜ̻œО܃޽žɩ!,4] H*2.ȑÇXHAAI %EdPJJXU #`2~FSGB*FȈLT$RbL#TZ S6m|ZcS$VjM"b`=u0yTa j)é>|T"! HGIiBEy(I)y%ZCN@ LJ+lJN Wg%SNj)@dIr$VS\!M D橡kS+I&NI$p5JJRJ@hT>_S]x+gpJo$u ("&~^vIo +*ʊ+Za'a(dnD`Q$+5cTQ!t )\ Ֆ]~IY[[T~Bgt%fNdSYU {FPCR@dDYFydH Хf )Z]dPFutP$JRe L4)N:SATTRJAwa9UUnQ[ Jp)"rJ)y;[pU!<`^zeX \P84Q$(2R$1tfj@`&O,#2 (GkCa 4a+OeJ*8e (prʍCD1 1~5P@D l ݡ܊%gRI%13pT )`@̃1 $t DR|om" ` <`ILB L(@%H*˩  p@_بH(i9$ ;$@ )T֔t%(늖z&`JD!o1FhyE)yrvi+" kCF4Q*U$ ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/form/search-trigger.gif000066400000000000000000000042061226600447100267710ustar00rootroot00000000000000GIF89af,Is.R5_8g;hpv=|EgIhHiBnBoKqDpIsJuLuLwNxOyPvQxQy@@;<p"Ņ/JDZyHd!R\dɗ]4M'ܙOO(:4kY6߿,=IRѢG.mWۇOoNRϞjsKN}BmW Z*K`Ą#ŶU,ײpy_{UFJw /v6uʂh-:hBw:\M1v\ܻ?\W׈h]#̾P+~Iʊm@r8O(G 5TO$@5G +x"D{ t Jdz~ BfJ:b>]E,B@)2 *+tLSh8J7Å"<[)+"'T9#j{nX3JaB0z4񚋮+7 K5ܖI>K뿎:8q#x1l2r'K(w#pKA(!0L،Φ6@tj`< Bmt#@!#U Lrj]ABpa %33m(~!tۍBK6l0 kpAּ_+^*:8o72I+zJ%yHrwPz< {s/|: @%p.pGC(ЫH@8 $  WD 3Ew` I_X&pG pF6f:[ V0~G`"R 'ҘAD$-4L "qLB%2IȆwtÅ/L# (NWdapoxc+ C_lb2" G b Eh`AgT&EHHC"d`;QK%@@INB0LJ8T*[& F 5IXʒĥPL= f 1 L!dK0Bilrl&^9I!(<6Kp~SgJh4 U"TDPT(E jЋS RjIORtt%iH:Ԥը;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/form/search-trigger.psd000066400000000000000000000363611226600447100270210ustar00rootroot000000000000008BPSf8BIM7200705288BIM f4iJFIF[[f  # !"!%'$ '!!    }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr $4%&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ?KZ[o/C[ƻk JUg6&Wm"]SXmWgzUdhOOƮ{Jr ){:ٔoIi6wR4X2`(^-8;+wvIEJ4$XjǫZׅ{6,-TgQl(qZAʕFg(F42gt(隸{F^a4i{mWwQJ^$O6fZj-Ķoe@QJ3ֺ%NS6c \ͭͭ&Nk"Ϝl|'RIJ.nm{$7Je/uovF" q!~o;ˈ#/sk+{Of>Wi6.9m.!p>Υr^PX `d*'$[+4wngG6KnO%Ε.Ly\FMo `+SqjUjO׮SnTwhiIWl*c*J:|r~]^WjҜ5c6ڄS)D[Bq#k(|v28\[@eׇ5=*8)d0jK tqQRK[I]_4+M5~ws(#.kL.42NSH:bx=>ajSro/3֯NutSkšΟյMXjZ C1PO$Ic_Ӎ{4A\wg5d|L-)e @ww0<+7EUhƣvQKNRRv1J%XYk:89ȹ(')Qv9NrJ2j˷kX׵=:tڕطOݫ/# jRRvVzM]C>xZR*m ɌKqҵ"c KwNJOCKu;J+Bd8mb1PӁ+B-Ymk~(M c=aBKR$zTҔ.; q֦Ɲm46aq'ƹܛݵTvWK@ŗ7 k-Za=Dž %!Fvl{QamRa:nJ'<-i 1dR$bI(Vs#|θ0X+'ӉжZlmb]{l߼Feu*q#d~_3ymf̲]H@Z[/O՗Kfп1[#?-5DK_4(VC s#1jR$jEݥbKԭ6%1S Fp¾8BIM8BIM8BIMf8BIMnorm<( Backgrounde 8BIMnorm8(Icons @~@~@~@~@~@׵~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ٸϭϭϭϭϭЭЭ@@@@@@*JXdkh^Z^hmkhfN>53A33A33A33A36aR6aR3A36aR6aR3A3QTQT6aRQTQT6aR2R2RQT2R2RQTA2A22RA2A22RCACAA2CACAA2CACACACACACAF2F2CAF2F2CAdRdRF2dRdRF2TTTTdRTTTTdRR˼RR˼RTTR˼RR˼RTT 2dGCA3 2dGCA3R˼R 2dGCA3 2dGCA3R˼R?T ?T  2dGCA3?T ?T  2dGCA31R1R?T 1R1R?T 1?31?31R1?31?31R1?31?34JZbddd`^\L@:  ^6l^6l^6l^6l`6bX6p`6bX6p^6l`6bX6p`6bX6p^6l 7`O7 7`O7`6bX6p 7`O7 7`O7`6bX6p 77 77 7`O7 77 77 7`O7 88 88 77 88 88 77 8LB= 8LB= 88 8LB= 8LB= 88?8C|?8?8C|?8 8LB=?8C|?8?8C|?8 8LB=E7Z7?E7Z7??8C|?8E7Z7?E7Z7??8C|?8?1p߼?1p߼E7Z7??1p߼?1p߼E7Z7?8*k8*k?1p߼8*k8*k?1p߼ d d8*k d d8*k d d4JZbddd`^\L@:  񚁜ǖ񚁜ǖ񚁜ǖ񚁜ǖ xx xx񚁜ǖ xx xx񚁜ǖ qq qq xx qq qq xx kk kk qq kk kk qq gunj gunj kk gunj gunj kklgolglgolg gunjlgolglgolg gunjoeejoeejlgolgoeejoeejlgolgf[f[oeejf[f[oeejZNZNf[ZNZNf[>y>yZN>y>yZN>y>y4JZbddd`^\L@:  ɽȽɽȽɽȽɽȽ ɽȽ ɽȽ ѵյ ѵյ ѵյ ѵյ ұϱ ұϱ ѵյ ұϱ ұϱ ѵյ 䯷 䯷 ұϱ 䯷 䯷 ұϱ貯ɲ貯ɲ 䯷貯ɲ貯ɲ 䯷籬籬貯ɲ籬籬貯ɲ䢛䢛籬䢛䢛籬ߍߍ䢛ߍߍ䢛jjߍjjߍjj.]fnmllllikjreQE=(.NdlllkkkjkjqbOC<(.H`ikkmkkjiiiZHA4"@~@~@~@~@~@׵~~~~~~~~~~ ɤ 徜~~ 徜~Ƣ~~~G=JxE<G~ ߹~xE<G~|F=I~ ߹~q`QKܺ=`QG~l:cZE~ܺ=`QG~=`QJ~l:cZE~<>ڜ;=~ع=`QG~ڜ;=~<=~ع=`QG~=?ٟ<>~؛;=~ٟ<>~=>~؛;=~=LDPdȀ[N̄\z &>&2ac j&3ݠ(n8@n Dã SX@HD$~ARQb)*6F&CJʪ:+ вPFRQF* ¶C¦10n+@LB Znv*. ¾+鮛j%4pEPD;c.0Kd1'. q,&s\E2L&'2 vaH+K'O0-5%3s@K Pk-6!TlX pPBq+Ix vz7gGb?/G.yv=8N F [n9ሇNn9sPSC >+^.z;n 73;o}wo 0o>M=>{/ߏ9o|KgP#x>k({ ,x{B/ D@;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/form/trigger-square.psd000066400000000000000000001072761226600447100270600ustar00rootroot000000000000008BPSfkL8BIM7200705288BIM%{Nj)+vBc8BIM$9A 2010-02-22T14:42:23-08:00 2010-02-23T16:57:46-08:00 2010-02-23T16:57:46-08:00 Adobe Photoshop CS3 Macintosh application/vnd.adobe.photoshop 3 2007-05-28 uuid:4081AAC72E22DF11BB6AF3A5946C22D7 1 2000000/10000 2000000/10000 2 256,257,258,259,262,274,277,284,530,531,282,283,296,301,318,319,529,532,306,270,271,272,305,315,33432;D11A1296B3AD65739C5FFFE122BCF9CD 102 24 -1 36864,40960,40961,37121,37122,40962,40963,37510,40964,36867,36868,33434,33437,34850,34852,34855,34856,37377,37378,37379,37380,37381,37382,37383,37384,37385,37386,37396,41483,41484,41486,41487,41488,41492,41493,41495,41728,41729,41730,41985,41986,41987,41988,41989,41990,41991,41992,41993,41994,41995,41996,42016,0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,22,23,24,25,26,27,28,30;219ED83ED13E6FB591D4B06458FB1309 8BIM com.apple.print.PageFormat.PMHorizontalRes com.apple.print.ticket.creator com.apple.jobticket com.apple.print.ticket.itemArray com.apple.print.PageFormat.PMHorizontalRes 72 com.apple.print.ticket.stateFlag 0 com.apple.print.PageFormat.PMOrientation com.apple.print.ticket.creator com.apple.jobticket com.apple.print.ticket.itemArray com.apple.print.PageFormat.PMOrientation 1 com.apple.print.ticket.stateFlag 0 com.apple.print.PageFormat.PMScaling com.apple.print.ticket.creator com.apple.jobticket com.apple.print.ticket.itemArray com.apple.print.PageFormat.PMScaling 1 com.apple.print.ticket.stateFlag 0 com.apple.print.PageFormat.PMVerticalRes com.apple.print.ticket.creator com.apple.jobticket com.apple.print.ticket.itemArray com.apple.print.PageFormat.PMVerticalRes 72 com.apple.print.ticket.stateFlag 0 com.apple.print.PageFormat.PMVerticalScaling com.apple.print.ticket.creator com.apple.jobticket com.apple.print.ticket.itemArray com.apple.print.PageFormat.PMVerticalScaling 1 com.apple.print.ticket.stateFlag 0 com.apple.print.subTicket.paper_info_ticket PMPPDPaperCodeName com.apple.print.ticket.creator com.apple.jobticket com.apple.print.ticket.itemArray PMPPDPaperCodeName Letter com.apple.print.ticket.stateFlag 0 PMTiogaPaperName com.apple.print.ticket.creator com.apple.jobticket com.apple.print.ticket.itemArray PMTiogaPaperName na-letter com.apple.print.ticket.stateFlag 0 com.apple.print.PageFormat.PMAdjustedPageRect com.apple.print.ticket.creator com.apple.jobticket com.apple.print.ticket.itemArray com.apple.print.PageFormat.PMAdjustedPageRect 0 0 734 576 com.apple.print.ticket.stateFlag 0 com.apple.print.PageFormat.PMAdjustedPaperRect com.apple.print.ticket.creator com.apple.jobticket com.apple.print.ticket.itemArray com.apple.print.PageFormat.PMAdjustedPaperRect -18 -18 774 594 com.apple.print.ticket.stateFlag 0 com.apple.print.PaperInfo.PMPaperName com.apple.print.ticket.creator com.apple.jobticket com.apple.print.ticket.itemArray com.apple.print.PaperInfo.PMPaperName na-letter com.apple.print.ticket.stateFlag 0 com.apple.print.PaperInfo.PMUnadjustedPageRect com.apple.print.ticket.creator com.apple.jobticket com.apple.print.ticket.itemArray com.apple.print.PaperInfo.PMUnadjustedPageRect 0 0 734 576 com.apple.print.ticket.stateFlag 0 com.apple.print.PaperInfo.PMUnadjustedPaperRect com.apple.print.ticket.creator com.apple.jobticket com.apple.print.ticket.itemArray com.apple.print.PaperInfo.PMUnadjustedPaperRect -18 -18 774 594 com.apple.print.ticket.stateFlag 0 com.apple.print.PaperInfo.ppd.PMPaperName com.apple.print.ticket.creator com.apple.jobticket com.apple.print.ticket.itemArray com.apple.print.PaperInfo.ppd.PMPaperName US Letter com.apple.print.ticket.stateFlag 0 com.apple.print.ticket.APIVersion 00.20 com.apple.print.ticket.type com.apple.print.PaperInfoTicket com.apple.print.ticket.APIVersion 00.20 com.apple.print.ticket.type com.apple.print.PageFormatTicket 8BIM8BIM&?8BIM 8BIM8BIM 8BIM 8BIM' 8BIMH/fflff/ff2Z5-8BIMp8BIM8BIM8BIM08BIM-8BIM@@8BIM6nullVrsnlongenabbool numBeforelongnumAfterlongSpcnlong minOpacitylong maxOpacitylong2BlnMlong8BIM3null Vrsnlong frameStepObjcnull numeratorlong denominatorlongX frameRatedoub@>timeObjcnull numeratorlong denominatorlongXdurationObjcnull numeratorlongp denominatorlongX workInTimeObjcnull numeratorlong denominatorlongX workOutTimeObjcnull numeratorlongp denominatorlongXLCntlongglobalTrackListVlLs hasMotionbool8BIM4FnullVrsnlongsheetTimelineOptionsVlLs8BIM8BIMnullbaseNameTEXTUserboundsObjcRct1Top longLeftlongBtomlongRghtlongfslicesVlLsObjcslicesliceIDlonggroupIDlongoriginenum ESliceOrigin autoGeneratedTypeenum ESliceTypeImg boundsObjcRct1Top longLeftlongBtomlongRghtlongfurlTEXTnullTEXTMsgeTEXTaltTagTEXTcellTextIsHTMLboolcellTextTEXT horzAlignenumESliceHorzAligndefault vertAlignenumESliceVertAligndefault bgColorTypeenumESliceBGColorTypeNone topOutsetlong leftOutsetlong bottomOutsetlong rightOutsetlong8BIM( ?8BIM8BIM8BIM 9f4JFIFHH Adobe_CMAdobed            f"?   3!1AQa"q2B#$Rb34rC%Scs5&DTdE£t6UeuF'Vfv7GWgw5!1AQaq"2B#R3$brCScs4%&5DTdEU6teuFVfv'7GWgw ?5ǎR8k ȬnsyTYn.XMx4].6]iߓl͖8eXi|Z5f*u,w[ޛI?B?VVn}Cqʡ ʞ#mm}{񞝵Nv"~ru#D~i݈ٷV=&?}JfDBk,Ųn3Cnwz=;p+=O+}zuG6Tݬ=V" uh1,Z).5ߘ%gy4^E[MmhFis~>ϑ]/nn}-2oʪE^=CllI6ΛUa}oEf\/ep9i꾬T̆wI^sk]*kw[=OlF6~jP#/6 ,$Lٱ3П.EN&HkƵnX7z8[c;*dFStsVlLsObjcnullFsIDlongAFrmlongFsFrVlLslong(LCntlong8BIMRoll8BIMmfrifbn`n8BIMnorm(Layer 08BIMluniLayer 08BIMlnsrlayr8BIMlyid8BIMclbl8BIMinfx8BIMknko8BIMlspf8BIMlclr8BIMfxrpcK98BIMnorm(Raster 18BIMluniRaster 18BIMlyid8BIMclbl8BIMinfx8BIMknko8BIMlspf8BIMlclr8BIMfxrpfbbbb8BIMsat (Turn on for Gray theme8BIMluni0Turn on for Gray theme8BIMlyid8BIMclbl8BIMinfx8BIMknko8BIMlspf8BIMlclr8BIMfxrp~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~𸬭ЭЭȬ9[^^WMB6*     ,,,, ,,,,  ,,,, ,,,,  D D ,,,, D D ,,,, ,, ,, D ,, ,, D,,,, ,,,,,, ,,,,,,,,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,6INJ8:>6*1111111111111111111111111111111111111111116EDF8:>6*PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP" 6F822*&8BIMPatt8BIMFMsk 2H]ggd^TF:$8aggbXL@4 0XfdbXJ:0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ ~ ~~~.513315513315~/~513315~513315~~ 313313 313313~513315~313313 ~313313~513315~313313~212212𼯮~313~313~212212𼯮~313313·~212~313·~313~212~54ź~212~4ź~5~212~~4~~~4~~鼯~~~鼯~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~𸬭  .TPRRPTSPRRPSޭ/SPRRPSޭTPRRPT RPRRPR RPRRPRSPRRPSۭRPRRPR RPRRPRSPRRPSۭRPRQPQRPRRPRЭQPQRPRRPRRPRЭRPRQPQRPRQPQRPRRPRSSRPRSSRPRSSȬ  .   glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/form/trigger-tpl.gif000066400000000000000000000027171226600447100263300ustar00rootroot00000000000000GIF89af@@~ٵȮ!,fH*\0†>p"Ņ/JǏI.\ɲ%J0Ke˛,QɳgODJ)q* PУ\HJ J3FPNflSUZM:epʝKC@xve"mA|^ǐ나L}X\)ϠC6ӨSۡװI k*r[vVӪˡ}/E8УKgسk^wW'x4hTVi%J\Vi`)Xfcl>p)gf.)qZ|'ujx $h~FYf)@<6کJ<ꪬ XXjk©gj믴vk쫣Z6, )vv-Zk.J-.z+/: ~p/;&/0? qp#, Û1@wLv;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/form/trigger.gif000066400000000000000000000034301226600447100255240ustar00rootroot00000000000000GIF89af~ٱ1P3R2R׶5S3Q4S5T5T5S!,fHD*\P†>p"Ņ/JǏ$I\ɲ%J0Ke˛,Q6ɳgO J )q*PУ$HJJOPNflSUZM: pʝcxv"@|ǐFL}X\)ϠCVppau1Ȏ#l m&=VܿkF6WO;i \pqt`Qgtf;_qdQF^< WPh/GA~祷^{nA| |tuQC*8hVLB?P! 70q s" ~iȡ Hr8؂-L(^qb+$* 0H >],@ XPUŖXD @Q"qD[vecҀDZTxyj n6â{1!Ǣ;8Da6@ H  ShLz ïi8Nkꫮ묵 m p,QpL['t[3tj fT P@)Tn~m/B!+/nB  KÖnA(13(| [+3G xA&, D"z]4tON|@3<T]P*d ]>c#-(-7aDVLB | vلNv"D.-x*[o}c+.:}y ꬷnU n{w臗j o빗7<λ;o=w< }b>w/.W׿W@=_BP^ . _ 3(zo' 5>OU@;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/form/trigger.psd000066400000000000000000001113371226600447100255530ustar00rootroot000000000000008BPSfk8BIM7200705288BIM%{Nj)+vBc8BIM$9A 2010-02-22T14:42:23-08:00 2010-02-23T16:57:07-08:00 2010-02-23T16:57:07-08:00 Adobe Photoshop CS3 Macintosh application/vnd.adobe.photoshop 3 2007-05-28 uuid:3D81AAC72E22DF11BB6AF3A5946C22D7 1 2000000/10000 2000000/10000 2 256,257,258,259,262,274,277,284,530,531,282,283,296,301,318,319,529,532,306,270,271,272,305,315,33432;39650545AEF1302ADCDB19D9B6602BEE 102 24 -1 36864,40960,40961,37121,37122,40962,40963,37510,40964,36867,36868,33434,33437,34850,34852,34855,34856,37377,37378,37379,37380,37381,37382,37383,37384,37385,37386,37396,41483,41484,41486,41487,41488,41492,41493,41495,41728,41729,41730,41985,41986,41987,41988,41989,41990,41991,41992,41993,41994,41995,41996,42016,0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,22,23,24,25,26,27,28,30;219ED83ED13E6FB591D4B06458FB1309 8BIM com.apple.print.PageFormat.PMHorizontalRes com.apple.print.ticket.creator com.apple.jobticket com.apple.print.ticket.itemArray com.apple.print.PageFormat.PMHorizontalRes 72 com.apple.print.ticket.stateFlag 0 com.apple.print.PageFormat.PMOrientation com.apple.print.ticket.creator com.apple.jobticket com.apple.print.ticket.itemArray com.apple.print.PageFormat.PMOrientation 1 com.apple.print.ticket.stateFlag 0 com.apple.print.PageFormat.PMScaling com.apple.print.ticket.creator com.apple.jobticket com.apple.print.ticket.itemArray com.apple.print.PageFormat.PMScaling 1 com.apple.print.ticket.stateFlag 0 com.apple.print.PageFormat.PMVerticalRes com.apple.print.ticket.creator com.apple.jobticket com.apple.print.ticket.itemArray com.apple.print.PageFormat.PMVerticalRes 72 com.apple.print.ticket.stateFlag 0 com.apple.print.PageFormat.PMVerticalScaling com.apple.print.ticket.creator com.apple.jobticket com.apple.print.ticket.itemArray com.apple.print.PageFormat.PMVerticalScaling 1 com.apple.print.ticket.stateFlag 0 com.apple.print.subTicket.paper_info_ticket PMPPDPaperCodeName com.apple.print.ticket.creator com.apple.jobticket com.apple.print.ticket.itemArray PMPPDPaperCodeName Letter com.apple.print.ticket.stateFlag 0 PMTiogaPaperName com.apple.print.ticket.creator com.apple.jobticket com.apple.print.ticket.itemArray PMTiogaPaperName na-letter com.apple.print.ticket.stateFlag 0 com.apple.print.PageFormat.PMAdjustedPageRect com.apple.print.ticket.creator com.apple.jobticket com.apple.print.ticket.itemArray com.apple.print.PageFormat.PMAdjustedPageRect 0 0 734 576 com.apple.print.ticket.stateFlag 0 com.apple.print.PageFormat.PMAdjustedPaperRect com.apple.print.ticket.creator com.apple.jobticket com.apple.print.ticket.itemArray com.apple.print.PageFormat.PMAdjustedPaperRect -18 -18 774 594 com.apple.print.ticket.stateFlag 0 com.apple.print.PaperInfo.PMPaperName com.apple.print.ticket.creator com.apple.jobticket com.apple.print.ticket.itemArray com.apple.print.PaperInfo.PMPaperName na-letter com.apple.print.ticket.stateFlag 0 com.apple.print.PaperInfo.PMUnadjustedPageRect com.apple.print.ticket.creator com.apple.jobticket com.apple.print.ticket.itemArray com.apple.print.PaperInfo.PMUnadjustedPageRect 0 0 734 576 com.apple.print.ticket.stateFlag 0 com.apple.print.PaperInfo.PMUnadjustedPaperRect com.apple.print.ticket.creator com.apple.jobticket com.apple.print.ticket.itemArray com.apple.print.PaperInfo.PMUnadjustedPaperRect -18 -18 774 594 com.apple.print.ticket.stateFlag 0 com.apple.print.PaperInfo.ppd.PMPaperName com.apple.print.ticket.creator com.apple.jobticket com.apple.print.ticket.itemArray com.apple.print.PaperInfo.ppd.PMPaperName US Letter com.apple.print.ticket.stateFlag 0 com.apple.print.ticket.APIVersion 00.20 com.apple.print.ticket.type com.apple.print.PaperInfoTicket com.apple.print.ticket.APIVersion 00.20 com.apple.print.ticket.type com.apple.print.PageFormatTicket 8BIM8BIM&?8BIM Transparency8BIM Transparency8BIMd8BIM5d8BIM8BIM 8BIM8BIM 8BIM 8BIM' 8BIMH/fflff/ff2Z5-8BIMp8BIM8BIM8BIM08BIM-8BIM@@8BIM6nullVrsnlongenabbool numBeforelongnumAfterlongSpcnlong minOpacitylong maxOpacitylong2BlnMlong8BIM3null Vrsnlong frameStepObjcnull numeratorlong denominatorlongX frameRatedoub@>timeObjcnull numeratorlong denominatorlongXdurationObjcnull numeratorlongp denominatorlongX workInTimeObjcnull numeratorlong denominatorlongX workOutTimeObjcnull numeratorlongp denominatorlongXLCntlongglobalTrackListVlLs hasMotionbool8BIM4FnullVrsnlongsheetTimelineOptionsVlLs8BIM8BIMnullbaseNameTEXTUserboundsObjcRct1Top longLeftlongBtomlongRghtlongfslicesVlLsObjcslicesliceIDlonggroupIDlongoriginenum ESliceOrigin autoGeneratedTypeenum ESliceTypeImg boundsObjcRct1Top longLeftlongBtomlongRghtlongfurlTEXTnullTEXTMsgeTEXTaltTagTEXTcellTextIsHTMLboolcellTextTEXT horzAlignenumESliceHorzAligndefault vertAlignenumESliceVertAligndefault bgColorTypeenumESliceBGColorTypeNone topOutsetlong leftOutsetlong bottomOutsetlong rightOutsetlong8BIM( ?8BIM8BIM8BIM `f4DJFIFHH Adobe_CMAdobed            f"?   3!1AQa"q2B#$Rb34rC%Scs5&DTdE£t6UeuF'Vfv7GWgw5!1AQaq"2B#R3$brCScs4%&5DTdEU6teuFVfv'7GWgw ?5ǎS4W/U9Ƽ,7R,?nIdcݦtl:cEU8m~Z}XRǻNQ}[]5qh/y$/B=[|MmEefW1,6[׻[ta2.G'\9Gk?٦M؉gkk CZ1~?ٱ3Ы̊یYam8výgߩO3ӱVd<׏Ch ߴSv??XΞ5UI`,kmcp;[r73~D?dWEieno\ߠOWnFKۨKs6̆7[2׊F>3sM5lpfZ]kmUڬ}cO[*dc}-ksK{˫Lk,tnϗ1_ҦIm51{^^KM{Yw7zٱ3Чm\L,V5}`i\ms쪶󋍐=+6^ԋttMM}akCZ~~rHvX驲v[6=n z7I5Oڎ(/zʾqI%?C7V\ 2$yI%Е}+?}b"$u܎jI%?E9OR$w/V}:\$z}?j8BIM!UAdobe PhotoshopAdobe Photoshop CS38BIM".MM*bj(1r2i''Adobe Photoshop CS3 Macintosh2010:02:23 16:57:07f&(.HH8BIMmoptdlTargetSettingsClrTObjc ColorTableClrsVlLsisExactboolMttCObjc NativeQuadBl longGrn longRd longTrnsbool addMetadatabool autoReduceboolcolorTableControlObjcColorTableControl lockedColorsVlLs shiftEntriesVlLsditherAlgorithmenumDitherAlgorithmDfsn ditherPercentlongd fileFormatenum FileFormatGIF interlacedboollossylong noMatteColorbool numColorslongreductionAlgorithmenumReductionAlgorithmPercrolloverMasterPalettebooltransparencyDitherAlgorithmenumDitherAlgorithmNonetransparencyDitherAmountlongdwebShiftPercentlong zonedDitherObjc ZonedInfo channelIDlong emphasizeTextboolemphasizeVectorsboolfloorlongzonedHistogramWeightObjc ZonedInfo channelIDlong emphasizeTextboolemphasizeVectorsboolfloorlong zonedLossyObjc ZonedInfo channelIDlong emphasizeTextboolemphasizeVectorsboolfloorlong8BIM-msetnullVersionlong8BIMms4w8BIMmaniIRFR8BIMAnDsnullAFStlongFrInVlLsObjcnullFrIDlongn=FrDllongFrGAdoub@>FStsVlLsObjcnullFsIDlongAFrmlongFsFrVlLslongn=LCntlong8BIMRoll8BIMmfripfx8BIMnorm(Layer 08BIMluniLayer 08BIMlnsrlayr8BIMlyid8BIMclbl8BIMinfx8BIMknko8BIMlspf8BIMlclr8BIMfxrpcK98BIMnorm(Raster 18BIMluniRaster 18BIMlyid8BIMclbl8BIMinfx8BIMknko8BIMlspf8BIMlclr8BIMfxrpfxxxx8BIMsat (Turn on for Gray theme8BIMluni0Turn on for Gray theme8BIMlyid8BIMclbl8BIMinfx8BIMknko8BIMlspf8BIMlclr8BIMfxrp ~~~~~׵~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ٸϭϭϭϭϭЭЭ9[^^WMB6*     ,,,, ,,,,  ,,,, ,,,,  D D ,,,, D D ,,,, ,, ,, D ,, ,, D,,,, ,,,,,, ,,,,,,,,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,6INJ8:>6*1111111111111111111111111111111111111111116EDF8:>6*PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP" 6F822*&8BIMPatt8BIMFMsk 2 L]ggfbXJ>( <aggf\PD8$3Xfde\N>4$~~~~~׵~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"~~~~.513315513315~/~513315~513315~~c313313313313~513315~313313~313313~513315~313313~212212𼯮~313~313~212212𼯮~313313·~212~313·~313~212~54ź~212~4ź~5~212~~4~~~4~~鼯~~~鼯~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ٸϭϭϭϭϭ".TPRRPTSPRRPS/SPRRPSTPRRPTcRPRRPRRPRRPRSPRRPSۭRPRRPRRPRRPRSPRRPSۭRPRQPQRPRRPRЭQPQRPRRPRRPRЭRPRQPQRPRQPQRPRRPRSSRPRSSRPRSS. A glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/gradient-bg.gif000066400000000000000000000027001226600447100253000ustar00rootroot00000000000000GIF89a@vvvwwxxxyyzz{z{|}}~~~ހހށ߁߂߂߃߂ᄨᆨᆩᇩᇩ↪ᇪ≫ሪ∫≫⊬⊭⋬⋭⌭㌮㍮㍯㍮䎯䎰䏰䐰吱䐱呱呲咲撳擳擳甴攴畴畵當疵疶痶痷瘷瘷虷蘸虸虹蚸隹蚹雹雺霺霻霺ꜻꝻꝼꞼꞼ랽ꟼ럽럾렽렾렾졾졿좿죿!,@K H*a(QE2~ıc'N CrDRɓ0Ĕeb^DJr4IB )H>ZӧIUDUѢ&Bĵ+C`KPh Z˖ D7xǏ>CϞÈYXOyHC˘Lt=Gr⨎5pȞ6lrfפ3ϘYn&yˌ>u1ń0཈ҥ|.跨߂ZȿB Xo)NAŀR(EB O4ă:ĄL4aa.Jtć &ĈHaGb,0!#Bč8Ď<Ï@DÑHÒ<4ɃP 9`Vޠ \viC `@Ø3i3Ƞ 0Û1 /`.+'  `( )$z¢'& i ¥#d:§~nĝjkzkAR`,$;FlJBfv@6 ".k`  lp$| 7G,Wlgw ,$l(,;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/000077500000000000000000000000001226600447100233545ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/arrow-left-white.gif000066400000000000000000000014711226600447100272460ustar00rootroot00000000000000GIF89a @@!, @*DXaÁ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/arrow-right-white.gif000066400000000000000000000014711226600447100274310ustar00rootroot00000000000000GIF89a @@!, @` &<0@;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/col-move-bottom.gif000066400000000000000000000015441226600447100270720ustar00rootroot00000000000000GIF89a H H P0P0X0X0h@p@p@xPxPP```ppp! , A\aA \#X0AB6 (8PBl0M;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/col-move-top.gif000066400000000000000000000015451226600447100263710ustar00rootroot00000000000000GIF89a 0P0X0X@`@h@hPpPxPxPxPPP```ppppp! , B( !JА "hD 4 ` x`B H(`A( @;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/columns.gif000066400000000000000000000017021226600447100255230ustar00rootroot00000000000000GIF89aQqQrSsSsTuTuVvWyXzX{Z|\~\~@v@@^_`acdVfhllnoopprssuvyyzzz{ܑnjƆݒޒ!,HkH"B|!C5dȱc)BI (KXJ\С%Zh#*Yр>ryDQ D: |ܰN;} 0U˗4x+*T,˳(ĸ` $8`b D;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/dirty.gif000066400000000000000000000015001226600447100251720ustar00rootroot00000000000000GIF89a !, ` pa†!JHʼn;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/done.gif000066400000000000000000000002051226600447100247650ustar00rootroot00000000000000GIF89awuly! ,2Z'mUHzbvٲ`J\T971?׊[P;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/drop-no.gif000066400000000000000000000016631226600447100254270ustar00rootroot00000000000000GIF89a #'*367:;>?BCFGJOR[^ceoqًۏݗޛ䫬寰!,(`tC(@‡ @C-R~0fr,!B'p@B`Qt\z`@OI I3@Rf#KL9Ō;~'l Ā;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/drop-yes.gif000066400000000000000000000015341226600447100256100ustar00rootroot00000000000000GIF89a"#!,9H*,@B .!C*lE?1Br|˗/;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/footer-bg.gif000066400000000000000000000015021226600447100257250ustar00rootroot00000000000000GIF89a!,/XP  QJE[CFLь!j,HA5Y@y/I 8C5JEpA)n" -PaG@",P  H2` .DxBDM`'ducFRÅ ,HXM@;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/hmenu-lock.png000066400000000000000000000012101226600447100261160ustar00rootroot00000000000000PNG  IHDRa+tEXtCreation TimeFr 12 Dez 2003 22:10:15 +0100_NtIMEP pHYs B4gAMA aIDATxڥRkAfJXEDzPDD,A{͋"QhI@v1vVH@ ]}{Z##RӠzpm'Oߚ1}f9!*_չz|fv K<ˌC dr d3FHoI5N[_2 .1ڴSV}N5Mڜt9GQ> 81pԽ^n`,q ?^NXl 1d08DzP]i+x*x .!@V;[hbfdo#KIӨw TjИJ-K$o()2Y: dސx8wP &SXI!BN',Am űھNkIENDB`glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/hmenu-unlock.gif000066400000000000000000000017131226600447100264520ustar00rootroot00000000000000GIF89avtiqqqsssttty?tʕϟզأޫ߬ګ ԡդ֥ئئݶҥ#٧ ׫5ߺ.ϫO <(.'+&347879:BEEyMSCSbfں!y,HAbHr*OdiP 'D %(i ] $H#JE *"@$Q" hM)D!k~q" P#G !20x`nn 2Fv@1 0c*J;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/hmenu-unlock.png000066400000000000000000000012711226600447100264700ustar00rootroot00000000000000PNG  IHDRa+tEXtCreation TimeFr 12 Dez 2003 22:10:15 +0100_NtIME *J& pHYs B4gAMA aIDATxڵRKhQ=oiS%V nJЍt.čݹʍ.ilM 6.vPP,Q[if&V, ws;?j,937 NsPTE]EA>EP(K\.IPsmnZz9UUzf9Mn$hlo bjET2iLSp++k? hrj㜳+{{hM޽|mmdVo&I IKv˻O=ﮄ93)LL'ImmZ2 P(Zo䋳*1@N;:|; !1h4˲o?pVC=~ DإGpQ6`h߽t[nxDC,Ms$Q5(r %#í,?1Y.n~t#*$t* m!v"X_-aW?_򼏔gb놁[&nS|H )IENDB`glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/invalid_line.gif000066400000000000000000000014571226600447100265070ustar00rootroot00000000000000GIF89a!, @;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/loading.gif000066400000000000000000000014031226600447100254560ustar00rootroot00000000000000GIF89a wuly! NETSCAPE2.0! ,OɌ{Y̲`ID8+Sޤ(D(I~ H` ZfkNqك;'L! ,N {@1Q]AiN:)ST ޴,Žb$? Q(0)jf{n-~Nž! ,MΡ,EeuȔ%5Ef3 ݮg(<LD"X`RJJN 9ܣ=! ,NJZ'B q`P)8/,S&$$ݮ yD"`Rakbm^Sڙ! ,MZgJ }HI b$(t}绝 ~9@Y,2 i00 |řt;! ,MRZR }HIlԲtP0Bv>CG12iPѦJ0R-Jt;! ,MɔZZ$ }HIlat0ޭ8B dLIB)q80 &tह3;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/mso-hd.gif000066400000000000000000000015531226600447100252360ustar00rootroot00000000000000GIF89a!,H=xЁ 4hȐ ,XP @(P H@ 0h @A;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/nowait.gif000066400000000000000000000015641226600447100253520ustar00rootroot00000000000000GIF89a@@!,QH\0*thP" +fB^8F)B$Y8\IgM-;rЀ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/page-first-disabled.gif000066400000000000000000000016351226600447100276560ustar00rootroot00000000000000GIF89aggglllrrrxxx@@!,z HC`A,0jX^X!A &L℆+YAʼnAg#28 `<`0`MP  U "`0d@,³h ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/page-first.gif000066400000000000000000000016351226600447100261110ustar00rootroot00000000000000GIF89a$H(M-S3Y8`?hf/d/e,f0b1j8n>s?u$j,q4r>~DoBmJuO{HzN{@@SSUXOOQWVY__`eihkomgihq~煮!,z3Ha@a0A:$`a vᢂ4LfcƇ AĀG Bg-<@ `Ё Dx0 M*0 U "`0@,³h ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/page-last-disabled.gif000066400000000000000000000016331226600447100274700ustar00rootroot00000000000000GIF89aggglllrrrxxx@@!,x H;"A r0Aj " 0 #$0CMl0`Ё@:@I.p L`@WUٳ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/page-last.gif000066400000000000000000000016331226600447100257230ustar00rootroot00000000000000GIF89a$H(M-S3Y8`?hf/d/e,f0b1j8n>s?u$j,q4r>~DoBmJuO{HzN{@@SSUXOOQWVY__`eihkomgihq~煮!,x3Ha!A$ `  5( 4aÂ6^a Ah! bL0xFM/(`@:PA  I28q`0AW Uٳ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/page-next-disabled.gif000066400000000000000000000015531226600447100275040ustar00rootroot00000000000000GIF89agggxxx@@!,HH@HhTxQ@  T\@!B Hp`@ ,!("Tɳ';glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/page-next.gif000066400000000000000000000015531226600447100257370ustar00rootroot00000000000000GIF89a$H(M-S3Y8`?hf/d/e,f0b1j8n>s?u$j,q4r>~DoBmJuO{HzN{@@SSUXOOQWVY__`eihkomgihq~煮!,H3H3Hh Sx1 5(TaE Ah!`,!2ₚTɳ';glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/page-prev-disabled.gif000066400000000000000000000015571226600447100275060ustar00rootroot00000000000000GIF89aggglllrrrxxx@@!,L H NHX+hp @C #dp .P`@ T,` Yϟ@ ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/page-prev.gif000066400000000000000000000015571226600447100257410ustar00rootroot00000000000000GIF89a$H(M-S3Y8`?hf/d/e,f0b1j8n>s?u$j,q4r>~DoBmJuO{HzN{@@SSUXOOQWVY__`eihkomgihq~煮!,L3H HXK1C.*@cƇ 7BB Zx@T̠ϟ@ ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/pick-button.gif000066400000000000000000000020141226600447100262770ustar00rootroot00000000000000GIF89aMa@@ތޏߓߖ߈㊦㍩፩䐫ᐪ䒭┫䗬╭嘮ᛯ䜲坳栴她竾!,H 2``B 4@0b&K(I!?r %H:ѣG0&dxdM 4b…$I$Ƌ-ZQ`Xh5j !FW)ZL@lW(⢘]]g̈k?@Ɖ'B0+xÈ#c8d`^аQ +V-`~ ; Q 0 +_μy@;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/refresh-disabled.gif000066400000000000000000000011011226600447100272370ustar00rootroot00000000000000GIF89asx~߽̩X`jnt{ɠkt{hnvdmvٚՐLS\ᱶeoyYbj哜bjs\dnmt|js{u|s|~ٷy愎tyemvʐeluFMVfowhqyÿۿ˙lryx{ѡkqyzdmuw}{hr{qzⓚp{ߪ!s,s#ZJKaQgpV>@rB-Nj kfGHn O48IP'CUsE07?; h&l"[S LqF(^Wc 6]mAi5!o3s2Y)M1*T\e+.R. AGİ %G zx w;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/refresh.gif000066400000000000000000000017211226600447100255020ustar00rootroot00000000000000GIF89aX\nt q&x'{'{${*y7w:=zCyB|R~"*,*<,**4:=JJJJOBJXVTDLRKHCHORZWYekopnnt`okcvvtuuy~փ۔݅㍲ᏺ萾睾!, H&(&P02ph1Z 0b i2jܘfEӰi4RĠɈUlA5atōBLTg 2 XN2r(ЄE>cC)WX=g(dAvar 05.LF0$0`cC0AH"ƌ!b<@DkQ1FM&%yd@ ܼ}1 eҬN7c(@daӬcI-]d1. |=Fl5iƵFw)>(ߡŀ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/row-expand-sprite.gif000066400000000000000000000016731226600447100274420ustar00rootroot00000000000000GIF89a21JcBBƥ֩ڽƵ!,2H*\ȰÇ. @q@XbFـ#ID)@I'YAL3`͆9KpNHh4)ҥ8( `DJj+DB(@5*ױe `0@Ym6mNj|7/ LXp@;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/grid/row-over.gif000066400000000000000000000014671226600447100256330ustar00rootroot00000000000000GIF89a  !!!"""###$$$%%%&&&'''((()))***+++,,,---...///000111222333444555666777888999:::;;;<<<===>>>???@@@AAABBBCCCDDDEEEFFFGGGHHHIIIJJJKKKLLLMMMNNNOOOPPPQQQRRRSSSTTTUUUVVVWWWXXXYYYZZZ[[[\\\]]]^^^___```aaabbbcccdddeeefffggghhhiiijjjkkklllmmmnnnooopppqqqrrrssstttuuuvvvwwwxxxyyyzzz{{{|||}}}~~~!,ݳW&̂((cr}Ҏ7II y>aDш$#X2 )AOHDcPff$.!!,d&(X:ƶ°6M#p@F#e$9BX3ыrź 1H$E @?xf( ~Qe$.!!,e&(i8 YiMa@ I$$5"H")b x RXT"1iH)ZӧIUDUѢ&Bĵ+C`KPh Z˖ D7xǏ>CϞÈYXOyHC˘Lt=Gr⨎5pȞ6lrfפ3ϘYn&yˌ>u1ń0཈ҥ|.跨߂ZȿB Xo)NAŀR(EB O4ă:ĄL4aa.Jtć &ĈHaGb,0!#Bč8Ď<Ï@DÑHÒ<4ɃP 9`Vޠ \viC `@Ø3i3Ƞ 0Û1 /`.+'  `( )$z¢'& i ¥#d:§~nĝjkzkAR`,$;FlJBfv@6 ".k`  lp$| 7G,Wlgw ,$l(,;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/layout/mini-bottom.gif000066400000000000000000000015301226600447100266700ustar00rootroot00000000000000GIF89a#CCE@@!,#5HÆ"F|HV|(qË3zt`dC!3"\2e@;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/layout/mini-left.gif000066400000000000000000000015471226600447100263260ustar00rootroot00000000000000GIF89a#CCE@@!,#D `0@!Æ:É)^cE r9Rˌ0=nLP Cq ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/layout/mini-right.gif000066400000000000000000000015501226600447100265030ustar00rootroot00000000000000GIF89a#CCE@@!,#E@L*d8QbD/Vh1G4(ɑ@n\ǎ09dP`…  ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/layout/mini-top.gif000066400000000000000000000015301226600447100261660ustar00rootroot00000000000000GIF89a#CCE@@!,#5 &P#B C ZF:8G *\ɲe@;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/layout/ns-collapse.gif000066400000000000000000000015121226600447100266520ustar00rootroot00000000000000GIF89a @@P!, 'HA `Æ!QD&ŏ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/layout/ns-expand.gif000066400000000000000000000015131226600447100263300ustar00rootroot00000000000000GIF89a @@P!, (H TH0!2<8D V\ ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/layout/panel-close.gif000066400000000000000000000014751226600447100266440ustar00rootroot00000000000000GIF89a0m@@!,@P@ T`Ä"d8a@;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/layout/panel-title-bg.gif000066400000000000000000000015061226600447100272410ustar00rootroot00000000000000GIF89ad1j1k2m2n3p4q4s5t6v6w7y8z9|9}:;!,d#8h`0PHHŋ3jb@;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/layout/panel-title-light-bg.gif000066400000000000000000000015031226600447100303430ustar00rootroot00000000000000GIF89ab!,b 0X   #JHŋ3R ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/layout/stick.gif000066400000000000000000000015521226600447100255530ustar00rootroot00000000000000GIF89a P\!!Created with The GIMP, -HLP`.Bbć2jdā?:l8€;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/layout/stuck.gif000066400000000000000000000001341226600447100255620ustar00rootroot00000000000000GIF89a \!Created with The GIMP! , `sj(`)Q;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/layout/tab-close-on.gif000066400000000000000000000015601226600447100267200ustar00rootroot00000000000000GIF89a MWZsts!, MHP  \`,`/V ŏ"q$|R//P@"@O;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/layout/tab-close.gif000066400000000000000000000015331226600447100263060ustar00rootroot00000000000000GIF89a MWZsts@@!, 8 HP P@ h(bC'4QƋ=FXb!>Pa;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/menu/000077500000000000000000000000001226600447100233735ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/menu/checked.gif000066400000000000000000000016771226600447100254630ustar00rootroot00000000000000GIF89aCYDYF[G\H]H^I^J_K`Vi]p`rcudvfwm~@@vȯϰѷչкռ!,!H%(\p@ @"J2  ^((MHL`6ІX1B:r@1!A&lHX!;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/menu/group-checked.gif000066400000000000000000000015731226600447100266100ustar00rootroot00000000000000GIF89a4p7q6r9s;zF~G} J KBBCDEFGHIJKLMNRRTUUVY\]]#\ ]$\-bBf@eEgBiFk@l@mFqGqOyNyL|!1,XcH*\HŁ-AC ] !C)"Å  4a @B 8p XB *]4 ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/menu/item-over.gif000066400000000000000000000014641226600447100257760ustar00rootroot00000000000000GIF89a!,H*\pa@;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/menu/menu-parent.gif000066400000000000000000000015261226600447100263210ustar00rootroot00000000000000GIF89a )n*q2u,p+u:z@@89<=GAURTgb!, 3H $@B$L` xHA ,P‒ 4;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/menu/menu.gif000066400000000000000000000015021226600447100250240ustar00rootroot00000000000000GIF89a!,H\ȰÇ#JHŋ#;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/menu/unchecked.gif000066400000000000000000000016551226600447100260220ustar00rootroot00000000000000GIF89a@@!,H(\p4"JH#C2jP@ŋt0†B A D,H `% 6(M.h ~0ЁĊ3rP`D 3hԠB2hkB)<`ᢅ )ZTٰ\;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/panel/000077500000000000000000000000001226600447100235265ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/panel/corners-sprite.gif000066400000000000000000000026121226600447100271750ustar00rootroot00000000000000GIF89a ,@@!, ,H(*L8` #BDPDP\q#FB ɓ&?RXr 0c(͚#ܩ#@b Ѣf ) 5Ju hݪŠ ahӢ0Dp߂BݻvC ߾"`@0I4Xx1%H,@2klbAO8 'iI:hңO[umַ]熝4ݴ{[m㸑Vŝg\qɱ/9q࿋;sn~}W߾>|g׿~W&H26VHNءb#zX"'(!+j1X7Q c) >Dn`$D.$B>dO:Y%IZ%Mr])%_zYPy[&e'gY'i9yzy|Jh 皈*i襓Z雛頕riڪgꪬjkJ+*,۫>l:,";V mfKn~mz[.ؚ. dK ¾ې@ @@;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/panel/left-right.gif000066400000000000000000000014571226600447100262710ustar00rootroot00000000000000GIF89a !,  @ A;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/panel/light-hd.gif000066400000000000000000000014731226600447100257220ustar00rootroot00000000000000GIF89a.!,.(HÇ#J;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/panel/tool-sprite-tpl.gif000066400000000000000000000017131226600447100272750ustar00rootroot00000000000000GIF89a@@qݙ!,@AXȰaHHBhqÈCZ(Lj R\`0O2P@M.oꔙϟ \*ѣHLTfǧ.> իX Uf`p)LhӪ5r[ʝ{%ݻ2ܕR@F{,8ċn|(:;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/panel/tool-sprites.gif000066400000000000000000000124551226600447100266700ustar00rootroot00000000000000GIF89ahqݙ&C2UPQNiAMf}s.Kolzq꛹TQTW~UDp:iylpᄩA\wnsmhDm{>junyQap4:MnԃeVfi|ANobmr}^fqa}]qx_koɦ|qN\~猯ΉĆFY֡䙶_qg|yOXqEMuЧ薶Wb~݀ۀ._p?H`]O\{sSkugzz9ATO_gxfnBI\uifzagk}b[BOi~QXratn}yVjFUw/5D\m{݌hͩꢱzȈrYbOZtzqUei})xYpn`ɋsa푣ږuzٍd̄8C\V2NY?Znʳd}ok/LhWWqrw褹! XMP DataXMP ~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"!  !,h@ XȰHHBh1ÈCZ(Lj OU4jU}r+"2X{Z0v `M|Չ&QTS@*0k#C&bY g/d3x1cǎCg}[xp9\&6JsHk7swYg*^.]DYd@Y`ܩR@y \H0Q Me] f[ Ww5לxɹeHp"IIeg~ɹه$(j8g#z3xB21q(ȭcΥ$ gHӔJ]5eFM4_euexZz֪`角YIW{Ii`_]8XK.Rԥa:(:!Ή5*TIio.bP3rjIXjduR7vn]vfj^UEGVfuFڎeZ)}~t업5X@`AK(hefh-훚l\i){ۦ|cqX(J'ZvSQCa]S5Rʕ5/O\Vo%Wo\i&?-zmH :f;pHʈnZvQ#bj(Kd0rP,E@4bTj OF5i-47G?}tWU b50swF߇?~_Cq$ʺۏM h Ŵ ;aHT"bB" CC)\! axWjxki^:A_鐘5- qh;b3cV :iĚI;k ҽ^H"WO#)F`$=# :&ns"v֗5)rЄ&r]nCˌg67!i]kרD6NoB#RF IÞ;@$Ƌ9)gDc(Fy:_CG;~i#yX8@,M\ iDf[ HE2h#Fäe4"Eшb"R 0}t"EF1칢C~4wL /V,0ˉ2cԨF ` @,8ӏa5rf-͌ !#ބ/T9% Hr@;S-44T\4tVeSt ?V!\Y#ȎlXR|Ll@:Vr8@<C,nj xXg'@% /V0$ KN(g<9PUG$eOl-EZWPweٲxTu(~0:r ,R{Ď)$mcBX>V++OU价;j,Y6Yκ-]KS!,j$b ۧP5LgQ&IӭgxI߲4?K u@Ȋx%^!$.O;ÆiLoz^Ǿcd[/7WޣzlJӚ=0 [PpZqB?r-(< ʰm)bɳa-=g 0NWlUhAcǰ+긡<%a DxɋXf4u{ efť/HfDzexmgS2T<?X-a-|zݛ&=}TkNp ( kwkQ!|l9OӅa=G}*z*5[:nIMpu6IXˉ7CczCԺR"pؗs̪o3pY5%|0_o_I_d"Cn $ra'R?V#v7_߼+_m?1K&z>cuQi6oFoj{{ v&R|Z2_ | }g}98uZ#rւ{Ub7b!GhW6sFy=(y?\WcExcct`0t,фO5KP _ Wp<ە[؅_uHap`z UjȆn  İ``;Vw{؇ 0 ~ fg$]@ifwQ <K f芃! !Ej` .ȋp@ǘaՆɸ͘xg;sAhyCTnW0/IhWfKBgP @ `6鸎 @ LoЏh@Ỳ Pj ID0 { O! L7p5/&`v)-1 @%p  m (@`9=Ay# 0 )@lIMQ9'X P6Y]a0,2+@|;kٖoxd%7:/xWynh  @kptuڕo 1g0 =.pj`RQ pkP0SPko kkj8 (fx3rsa%N-Vru85VBsD5>) ;zUZ <0Z*U Yס*P |g1*ɒ. f'Y%:A"JTHL)0Q@MIA*g'@R: RS:A!4tjɖnI JUA!.ǗGmyyٍy5V hҀ j *X1@@|z4Q64bF"ȡg"8!Y܇e$FĞ{Ǚg~J._?Hh$h$7tZ)Pȭ"Wc#S& &u9f V)&r`h RnaIetwBW_e{~e1}Oևf2ZaiIZ 6W([`8F۝QVETiRҹ`tbY\ҕבBjBK{WFid*JݾZ_&/ Q7y۱;0EԋչhkZhbm ٩׹{dSŮb0$h[e@ s^̳d0QP@t"xsx@@!,YYo[9's[=@ l<n-7,X\\7`@SS;9DJP@pS_\9TpDŽUq$|ߨLzp%ʪmVh*kj%@+ktl[/=l7 Ћ" '}jmqzc[wٲ>{|Y쾷D<=޿2H+x򖇦J ʯ I3D m/|"|gAMA aiIDATxchYp 0=𛁉Xh^d``b`bbrA$#$!bp &Qb!<1J#XQ"l ni"+IENDB`glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/panel/white-corners-sprite.gif000066400000000000000000000025261226600447100303170ustar00rootroot00000000000000GIF89a ,@@Ĥҫ!, ,H@*L(`` #BPD2\q# B ɓ&?RXr 0c(͚#ܩ#@~@(я*MӧN?JuXb׮+h~\-ۏ ʍݻv?:w(VaBXrȉ'#2e͋A7fҖ3`ug՟M=viاm^׼=xm㷃#{9ʣCpձ~{rw=;yӇW?}/>緿s~Wםw  "ۅahi ~@h(hb+Hb,#7ڸ";!c4 $'")#92٣Cx$SJ$WZ5beJvɥY饘f&_6lftioY'{FgyZ|fڨ"褐R*i^颖r)کj*3 뭲J뮶zjk;++*R[е;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/panel/white-left-right.gif000066400000000000000000000014571226600447100274070ustar00rootroot00000000000000GIF89a !,  @ ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/panel/white-top-bottom.gif000066400000000000000000000015501226600447100274400ustar00rootroot00000000000000GIF89a,ī!,,E\` "@x  8  8ȱǏ CIɓ(=bXɲ˗0cʜI͛8s;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/progress/000077500000000000000000000000001226600447100242735ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/progress/progress-bg.gif000066400000000000000000000015021226600447100272120ustar00rootroot00000000000000GIF89a`sy|셮憲萶ꖺ윿,`'H :h`@ 2jȱǏ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/qtip/000077500000000000000000000000001226600447100234045ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/qtip/bg.gif000066400000000000000000000021031226600447100244570ustar00rootroot00000000000000GIF89a N!, N_8(\ȰB#F\@b3jܘсǏ!92ɓ'%\r˗/)Ȝ9͛7-ܹϟ?1:4ѣG5(]tӧO9H:իW=hݺć`A,YhӦm[$ܶ5aݻ%Nݻ7߿UwÇY(^؅#;BrȐkFyπQK/޸rSVڬ배JmFʛoy IqYDɜ$@JH#Kp! O|XϞ O~ϟ@;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/qtip/close.gif000066400000000000000000000017141226600447100252030ustar00rootroot00000000000000GIF89aeee@@!,LH (XȰ! DCX|1VtOGSD \V0O6A8X!C(E~(@D1p`kW8lh h== \44 z֣u#F8$q!B#K ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/qtip/tip-anchor-sprite.gif000066400000000000000000000016671226600447100274550ustar00rootroot00000000000000GIF89a& ή!,&  4`(Tp#|8`  XP0fH𢀊x# C>0F)[bxJ2!SόtQMT3ƕLiҥюHuB5ЅI9V՘dY%m:$zeۙp~Dļ#;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/qtip/tip-sprite.gif000066400000000000000000000102571226600447100262000ustar00rootroot00000000000000GIF89ajJJή !,j8*\ȰÇ#JHŋ3jȱǏ CH`Rɲ˗0cʜI͛ U0p JѣH*=@MJJիXA6}'Ь`ÊKl˭=`۷pZ];kr˷FvL᷀Ӯ≠Ew ˘3J8Ϡ=o|GwFͺ밪վMlmͻ% {OμyΣK/ }됫cݯû.yϫ_4=kO׼6~hA~ . } >(zNhx^vnt~(br!hp%n)l-(#j1h#h5ިe9c=(daAidj)&ۑLVdPdT5eX^ue\Je`ޖdi\_|crpft4gx~tg|jYT}Z]*FO6J(7ē@%QL%i*ꨤjꩨꪬ꫰*무j뭸jN+k&6F+VkmMev+k覫+k,l'pt5G,Wlgw ,$l(,0,4l8<@-DmH'L7PG-TWmXg\w`-dmhlp-tmx|߀.n'7G.Wngw砇.褗n騧ꬷ.n/o'7G/Wogw/o觯//o wL:앮&H Z̠7z0TnbY0e%< Ic-| 5ڰb5!M? z(D6<"e%NT!h)RQVq"'1f 5{n|(ѱ׻#=N~ Ay<1{$$'I &3MrwB)ܑ;%*kUή,cYҲur񲗧%0K'a 2e2s|)Q&6+mNތ8qq<ҩı{'< 'y >}o*мw;(BЅέD#Rm2Ѵqg(H&ґ& JSk.}b*ӬѴW)NӝN>PiF=ҒԤ1G{*T&թV Vrg^*֜7;+Zkֵάn\ҵevW*+`M&𯆕\a2}+YQ4,fw^šfCk8ВVb=-GZ {-l8-nM(p=D܊2}.t7*z )vKrJ+ޖ0=/zgڴ)|PߢH/*;*L3~V#,R`0Ǫ N+C&>\S⺲x}1*L6~/s,>1~,=2%N>0)SV2 s23,1sf0,5n~3,ӹ.3c=Ӹ~q3гE4lZFѧ4i%ZJ{қ4f5]YNKӏ5cEXRԃE5`UWVw5]eWZk5Zu]V^_6WUb[SE6TTf+G6QTj;6N]Sn/7KŝRr#E7HQvk7EQz; 7B]P~ 8?OD8<N89%N{865^MK93ELD90UK巄9-eK9*u^J:'I[D:$H+釄:!H{:^Go;ŞFcD;EkW;E;K;^D ACF1cd4,ɷ33?sΞ|C/z>>=zͷfax~gb_W8|)?ax@/b}Uշ}/fG_:|'c~75Ɵ_x4{Ggf=8G8f= hG f =Geh=GeH=Gxe(=#(H!He%=)XH'e+uH0Ei7MY\J!(tcTYAI\X)7_\ZIa 7e\c)g6k]im6qI]os6wy]uy6}]{i6]I6 ^))69^z 6i^z5^z5^z5cՕX=YYzi5 dY难T#C֛)[)5idy9՜PCI )z4dؙIɔyhhhhhi9iYiyiiiiij:jZjzjj j j jk:kZkzkkkkkl!:l#Zl%zl'l)l+l-l/m1:m3Zm5zm7m9m;m=m?nA:nCZnEznGnInKnMnOoQ:oSZoUzoWoYo[o]o_pa:pcZpezpgpipkpmpoqq:qsZquzqwqyq{q}qr:rZrzrrrrrs:sZszssssst:tZtztttttu:uZuzuuuuuv:vZvzvǚvɺvvvw:wZwzwךwٺwwwx:xZxzx;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/s.gif000066400000000000000000000000531226600447100233560ustar00rootroot00000000000000GIF89a!,D;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/shadow-c.png000066400000000000000000000001661226600447100246450ustar00rootroot00000000000000PNG  IHDRo&tEXtSoftwareAdobe ImageReadyqe<IDATxbd```@L XBSIENDB`glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/shadow-lr.png000066400000000000000000000002071226600447100250340ustar00rootroot00000000000000PNG  IHDR tEXtSoftwareAdobe ImageReadyqe<)IDATxbd``bn >@J`b    -oIENDB`glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/shadow.png000066400000000000000000000004671226600447100244310ustar00rootroot00000000000000PNG  IHDR02 tEXtSoftwareAdobe ImageReadyqe<IDATxē=0[PAQ`⤃ ^ҁ#a&CHs. #&C 1RơD"!caJ)3!SnY8 !vH EExX ,45Bh/b.'e$"\#E1CnĎ~J,,AaUw^4I%Pu Q33{0i1TGgwy}%%'R  = 3G%p0 JRo5Ȇ0IĦmykxT_}(^yKs>i_%n=q4e-M¤D! , I)*')Ed]PR A:!zrbw %6"G(d$["JFhaQP`p%†/BFP\cU ?TtW/pG&OtDa_sylD'M q tc b2DM : d% 4%s) uE3 YUtږD$JiM^%o/rvl9'L;99% i9 C "B BDs ^Xf}$P {L?P O4 E咛V$dJ#)pV$! , IiRͧ"Jd] RZN*P*;$P{*N\EА!1UO2D _r6Ib H8 B; "'ZtbK#C'Kw}?Kiz6:xKAC&}9tz\ \D5;x Qd( KW  MBIڈM=ˤs⸽8DaJ`@LG! , IiRͧ"Jd] RZN*P*;$P{*N\EА!1UO2D _r6Ib H8 B; "'ZtbK#C'KGziz68}z~%XK9:0}% tz\Blc LbQ   lj ųKň x(țPX ,ւ|/"! , IiRͧ"Jd] RZN*P*;$P{*N\EА!1UO2D _r6Ib H8 B; "'ZtbK#C'KGziz68}z~%:A/ C} u\ h}b D]=  V)  ڊ9CDK Ku *00StD! , IiRͧ"Jd] RZN*P*;$P{*N\EА!1UO2D _r6Ib H8 B; "'ZtbK#C'KGz z5 C: A/ C}u\ Eh}b6[=Wx&)I9Ԭ@oCT?Kd]B76ЫD! , IiRͧ"Jd] RZN*P*;$P{*N\EА!1UO2D _r6I ƀH03hոaj U {CIkmbK#cK8 {a8nV:/q:M Cu~Ehk6 [_6P.]6!)V! , IiRͧ"Jd]U RZN JjN2sK6 dI)  LHWG 6 KX젱.6d~zhuur/6 X5I;_t O#E {O9V94;VC/ 6Ø~*'MonbX:~]+V*mK_OrKN@.d~qЦDB֋ 5D;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/shared/calendar.gif000066400000000000000000000017231226600447100261400ustar00rootroot00000000000000GIF89a1Ia3I`4Ha4Hc5Ib4Jb6H`7Hb4Id5Id5Je7Hf8Ic8Ie0b1d8r7s9q:rAu@vF}L}PWWbjndju|s}w}Ņ醥艫ꋩ鋫苪ꋪ댩덩ꄫɣϧ۫Э۟ѳܻݠ!,1H@2jРD6dPaF١#&J4`x! (@ Irl$ OL`hh'r )Eϟu >v ?w!@x!@y"Az"B{#B|#C}Jt!(,{+T@qB J@D#*Q!D @T:tC *hP!C 0Tp RPa„ $T'e$"\#E1CnĎ~J,,AaUw^4I%Pu Q33{0i1TGgwy}%%'R  = 3G%p0 JRo5Ȇ0IĦmykxT_}(^yKs>i_%n=q4e-M¤D! , I)*')Ed]PR A:!zrbw %6"G(d$["JFhaQP`p%†/BFP\cU ?TtW/pG&OtDa_sylD'M q tc b2DM : d% 4%s) uE3 YUtږD$JiM^%o/rvl9'L;99% i9 C "B BDs ^Xf}$P {L?P O4 E咛V$dJ#)pV$! , IiRͧ"Jd] RZN*P*;$P{*N\EА!1UO2D _r6Ib H8 B; "'ZtbK#C'Kw}?Kiz6:xKAC&}9tz\ \D5;x Qd( KW  MBIڈM=ˤs⸽8DaJ`@LG! , IiRͧ"Jd] RZN*P*;$P{*N\EА!1UO2D _r6Ib H8 B; "'ZtbK#C'KGziz68}z~%XK9:0}% tz\Blc LbQ   lj ųKň x(țPX ,ւ|/"! , IiRͧ"Jd] RZN*P*;$P{*N\EА!1UO2D _r6Ib H8 B; "'ZtbK#C'KGziz68}z~%:A/ C} u\ h}b D]=  V)  ڊ9CDK Ku *00StD! , IiRͧ"Jd] RZN*P*;$P{*N\EА!1UO2D _r6Ib H8 B; "'ZtbK#C'KGz z5 C: A/ C}u\ Eh}b6[=Wx&)I9Ԭ@oCT?Kd]B76ЫD! , IiRͧ"Jd] RZN*P*;$P{*N\EА!1UO2D _r6I ƀH03hոaj U {CIkmbK#cK8 {a8nV:/q:M Cu~Ehk6 [_6P.]6!)V! , IiRͧ"Jd]U RZN JjN2sK6 dI)  LHWG 6 KX젱.6d~zhuur/6 X5I;_t O#E {O9V94;VC/ 6Ø~*'MonbX:~]+V*mK_OrKN@.d~qЦDB֋ 5D;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/shared/left-btn.gif000066400000000000000000000015461226600447100261050ustar00rootroot00000000000000GIF89a0m8}!B'I/d<~@A,KH A XȰJ\ 3^ȱ# =~ I"Ohrʊ*_$i6kY08;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/shared/loading-balls.gif000066400000000000000000000041061226600447100270750ustar00rootroot00000000000000GIF89a) ۗۛݛܜܜݞޟޡߠޡߢߡߢޣ! NETSCAPE2.0! >,) }HX A5XXQD'VQ<| a2vɔ+[T%J2}(BĆ |G(5TiѣI>m0<#6\5Gر^%v.L`6jh")^|K@'_PѢMɔ-G\2g͉ (c (6<"k5^'M! >,) }H`bE%$HPb†^th!G2v<| a!G|I"m \3PP! P?.U8~pq 8`x j[b,ۮ>Tب ,\`sL׮P|BE&K@?1̞MjLaEƓ8M[}:۶! >,) }H`bE >XbA% 2tQ"D;x܀AG "I(AÇ FD9ɐ5G(|3!Dl0@(O@#6\z5G֭4Xև 5b`mܹAX0nʥ.a/^hfōWB3v9)Lh2% (iҠENH6! >,) }H`bE > $(E2v!G<<| aK.G(|3P@}(BĆ DG >m8ak\f0<u,W*lԈтEиsޕK׮.L`\z)xE 57~|R" hDeƗ!0bѥE6]@)6! >,) }H`bE >!DX A 2v!G1dƖgBS@1hҡGqt  |LH!FILE IDENTITY Created or modified by Brian Created by Alchemy Mindworks' GIF Construction Set Professional http://www.mindworkshop.com!UNREGISTERED SHAREWARE Assembled with GIF Construction Set: Alchemy Mindworks Inc. Box 500 Beeton, ON L0G 1A0 CANADA. http://www.mindworkshop.com This comment will not appear in files created with a registered version.! GIFCONtb1.055c:\Users\Jack\Projects\raw-images\loading\Image1.gif55c:\Users\Jack\Projects\raw-images\loading\Image2.gif55c:\Users\Jack\Projects\raw-images\loading\Image3.gif55c:\Users\Jack\Projects\raw-images\loading\Image4.gif55c:\Users\Jack\Projects\raw-images\loading\Image5.gif;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/shared/right-btn.gif000066400000000000000000000015471226600447100262710ustar00rootroot00000000000000GIF89a0m8}!B'I/d<~@A,LH A XȰJ\ 3^ȱ" A"2H%9Ddʎ#_|i6kY0;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/shared/warning.gif000066400000000000000000000017001226600447100260270ustar00rootroot00000000000000GIF89apPpX@@@dbb@@Xph p x xx  АР Ш00P 0 0P@P`pĺβȀ!, HA$@q=R<Ѱ;`!%|A`2 c#D,1K_ |?(6h!.!{r}vH")xb^30b2Xc@XC$1*$>Qx$D.U 9Z]^)fafhftixƩ'|'}疂Jg&:2hy* wv駔jiinꨧSd@~:+rt+F!+F+B4FzB+*ѲZ-z*ʭ^kۖn.Z/o+p;{p +G0KqkL$l2q(21ܲ/\33|3, AG?'O7 uQ#=5X\5VKu`s-dSmvCk}h;vpl7w=rwa=ނ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/sizer/ne-handle-dark.gif000066400000000000000000000015071226600447100270270ustar00rootroot00000000000000GIF89a U!, $H `!@d8"x;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/sizer/ne-handle.gif000066400000000000000000000015261226600447100261110ustar00rootroot00000000000000GIF89a v!, 3H P@C("4PŠ(@`" ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/sizer/nw-handle-dark.gif000066400000000000000000000015071226600447100270510ustar00rootroot00000000000000GIF89a U!, $H `aA@ P0"#;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/sizer/nw-handle.gif000066400000000000000000000015251226600447100261320ustar00rootroot00000000000000GIF89a v!, 2H*P ` $BT0@%8`F$;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/sizer/s-handle-dark.gif000066400000000000000000000020441226600447100266640ustar00rootroot00000000000000GIF89a U!, H*\ȰÇ#JHŋ3jȱǏ CIɓ(S\ɲ˗0cʜI͛8sɳϟ@ JѣH*]thF @jӫXjʵׯ`ÊKٳhӪ]󩀪޺ݻx˷߿ La&@Ð#KL˘3k̹ϠCMӨS^ͺװc˞M۸sͻ Nȓ+_μУKNسkν;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/sizer/s-handle.gif000066400000000000000000000024461226600447100257530ustar00rootroot00000000000000GIF89a v!,  H*\ȰÇ#JHŋ3jȱǏ CIɓ(S\ɲ˗0cʜI͛8sɳϗ JѣH*]ʴӧPJJիXjʵׯ`ÊKٳhӪ]+n%ݻx˷߿ La+^̸ǐ#KL˘3k̹ϠCMӨS^ͺװc˞حq Nȓ+_μKNسkνËOӫ_Ͼ˟O?݀g& 6F(Vhzdv ($h(,0(4h8<@)DiH&L6PF)TViXf\v`)dihlp)tix|矀*蠄j衈&袌6裐F*餔Vj饘f馜v駠*ꨤjꩨꪬ꫰e@;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/sizer/se-handle-dark.gif000066400000000000000000000015061226600447100270330ustar00rootroot00000000000000GIF89a U!, # @A<(@!‚&L! 3jqc@;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/sizer/se-handle.gif000066400000000000000000000015251226600447100261150ustar00rootroot00000000000000GIF89a v!, 2 0 8P  0@ÄѡCɓ(S ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/sizer/square.gif000066400000000000000000000015401226600447100255520ustar00rootroot00000000000000GIF89a e!, =HP` DaC"J(Ѐŋȑ@ C8I\R`0a ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/sizer/sw-handle-dark.gif000066400000000000000000000015071226600447100270560ustar00rootroot00000000000000GIF89a U!, $  (@ƒ 2, C jȱ#;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/sizer/sw-handle.gif000066400000000000000000000015271226600447100261410ustar00rootroot00000000000000GIF89a v!, 4 0 `*P0@ ,@N0q“(S\ ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/slider/000077500000000000000000000000001226600447100237115ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/slider/slider-bg.png000066400000000000000000000004541226600447100262720ustar00rootroot00000000000000PNG  IHDRB<>,tEXtCreation TimeThu 27 Mar 2008 03:40:17 -0500YtIME#;d^ pHYs(JgAMA a$PLTEѳÿ,CtRNS@fFIDATx͐ 0ȉ jDHJA膝YVgdg;ďL>!8IENDB`glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/slider/slider-thumb.png000066400000000000000000000016451226600447100270240ustar00rootroot00000000000000PNG  IHDR*- ,tEXtCreation TimeThu 27 Mar 2008 03:50:58 -0500 8)tIME%ᦏ pHYs(JgAMA a}PLTE闷頺ݱolڀ4tRNS@ffIDATx?BQuoxD*YBJ̳!!2w7>-⬾:#ZQVsg"%p?>eϱWI4}&(@X]*h2~@F 'g_8F>bt#Cxͭ0a5 !bt=0j*ZMRpY,i^V[¢ϿZvVU.}ig6;|p{tz'V+@:Pt6l::޾ABXwY-lhthKLn5Ym+ʦEiST+\ KɗԠ/)%A/Oj4e_oF׭AIENDB`glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/slider/slider-v-bg.png000066400000000000000000000004401226600447100265300ustar00rootroot00000000000000PNG  IHDRBk,tEXtCreation TimeThu 27 Mar 2008 03:40:17 -0500YtIME$ pHYs(JgAMA a$PLTE׼ÿtRNS@f:IDATxc`F&ff&4]C$#8ٸX(2ll=QaFIENDB`glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/slider/slider-v-thumb.png000066400000000000000000000015631226600447100272660ustar00rootroot00000000000000PNG  IHDR-*",tEXtCreation TimeThu 27 Mar 2008 03:50:58 -0500 8)tIME% 3 4 pHYs(JgAMA a}PLTE@@ݗoҭl{tRNS@f4IDATxc`aBnƻ.6*!r&6vҲʌ*&"T:3%+;'617(վ)@3P ID态\G(U%jF&$L #3!< )vpuswPUҴ OF@PVșBV26D6315S6 J p#"Tka@C8)HZ\^AQxr2%I54AOH1: dA"JIdCH5$J5hwN5#J̓XJlC̾8IENDB`glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tabs/000077500000000000000000000000001226600447100233605ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tabs/scroll-left.gif000066400000000000000000000024171226600447100263010ustar00rootroot00000000000000GIF89a$+LrV|@@jtč!,$+H (\ȰÇ_HH3R,Ǐ W(0ɓ(GT˗*FIM#Sɳg JHH*]bEPJ鉫XOؚ `Êh؊S p 7xn `_N)LƒXLb/_[;@a3; 1}9;@J;3ǬFiN?v څnmXS=xУ_Ni3 j7tTShZT 6 8UVhaN!vS($>(80(,`8樣5#-ظ7AIGΘ;2dOBSXE%Br@)&Yn%Si%M %Gʩ$Hd:`|x8h~y:盉蜑9靕y)});glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tabs/scroll-right.gif000066400000000000000000000024241226600447100264620ustar00rootroot00000000000000GIF89a$+LrV|@@jtč!,$+H (\ȰÇ Hʼn/j(qǏ Cɓ(WH˗"$IM;ɳg) J4E*]ʔQPJ膫Xjpׯ.~{TٳE{Ԅ[a }(x)%  ,G'(^*:>"˨1q4kП]> ԗ> 7콽6?myΙࡲԩe;޻͐:]@~ܰU u FG% 6QD(ZpfU (bG`(xQ0>P h80<BD($H(dE$K2O7RYCbe [Z٥5jd%^Y%X$Rʙ$L i&dA$g'k:Z'oJ'sZ(<*J@z:%I;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tabs/scroller-bg.gif000066400000000000000000000021141226600447100262600ustar00rootroot00000000000000GIF89a#2U@@㙻!,#HÇ#J|(`!3jȱcFxIRc0Xɲ倍.cb| T '&QZӧ8d T 1+lf)m[J-\sdP_p@Cǁ<~\xrȓeӀg?(,:g/D5 ~ [8 `w¾{= 8(_ΜAХR)Qrp]y)s|Η.P%,1.x}0Q $;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tabs/tab-btm-inactive-left-bg.gif000066400000000000000000000015661226600447100305230ustar00rootroot00000000000000GIF89a1㙻蚼꛽!,1S$ *40aÅ#B"B#@ 7@CI$!@68 XP@`00;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tabs/tab-btm-inactive-right-bg.gif000066400000000000000000000025521226600447100307020ustar00rootroot00000000000000GIF89a,2㙻蚼꛽!,,2'H*\ȰÇ#JHŋ?ȱǏ CIa%S\ɲ˖'_ʜI͕1oɳϜ> J#ТH*]ztӧPi6JUSjUa֮`^*٤dϪ]3-۷paK\xt߅|  JT#ТH*MztӧPe6JՎSjUa֮`V*٢dϪ]{3-۷pWKǹvꝈw߿ W0v #^V1fCU2V-cT3H=T4:M^=S50ž5!mmT6m}.U8r#_NR7C.سkνËOӫ_^˟OϿ((& 6F(Vhfvȡ@($h(,0(4hc%<@)DiH&L6N TViXf\v`)dih)lp)tix|矀 @ j衈&袌6裐F*餔Vj饘fi5駠*ꨤjꩨꪬ꫰W*묲뮼+k&6ˬ:+Vkf@ +k覫+;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tabs/tab-btm-over-left-bg.gif000066400000000000000000000002771226600447100276720ustar00rootroot00000000000000GIF89a1ꍲ!,1< "9詚lڮn o6E>dF$IBIP l dL. !R8!;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tabs/tab-btm-over-right-bg.gif000066400000000000000000000011761226600447100300540ustar00rootroot00000000000000GIF89a,2!,,2 dihlp,tm6|pHlȤrl2ΨtJ&֬vbxtڬnR6|N~u~gYK?2(vohaZSO;kb [TMHA<4/ `*\ȰÇ#JHŋ3jqc CIɓ(S\ɲ˗0cʜI&M~rɳϟ@ JѣH*]ʴӦHJիXjʵׯ`ÊKٳf7,(۷pʝKݻx˷߿È+^̸ǐ#KL˘3kެ9CMӨS^ͺװc˞M6 ͻ Nȓ+_μ1,P@سkνËOӣ_˟OϿ(6A;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tabs/tab-btm-right-bg.gif000066400000000000000000000015371226600447100271040ustar00rootroot00000000000000GIF89a2!,2<8 *40aÅ#BDh`&` 6  ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tabs/tab-close.gif000066400000000000000000000016001226600447100257150ustar00rootroot00000000000000GIF89a Tz@@[bho㙻!, ]8@%(\( 8A(`#!4 @d0`0$@f1 `,0(QW*]yP;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tabs/tab-strip-bg.gif000066400000000000000000000015031226600447100263410ustar00rootroot00000000000000GIF89a!, /X@a gAMA aZIDATx nH@ fIENDB`glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tabs/tab-strip-btm-bg.gif000066400000000000000000000014721226600447100271260ustar00rootroot00000000000000GIF89a!, ` H`#B ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tabs/tabs-sprite.gif000066400000000000000000000041101226600447100263000ustar00rootroot00000000000000GIF89a@@!,@ Çw b;thȱGsIq\ɲKgȜIaɳO_JY(]ʴSIHJUChʵ-KY aϪ5v[;޾m+,ݺew/\l&woa&xbZvC2_̓9 X4a~Ma׈a+͘cYn[` Zcȓ+_^ УKN@ kν;%OD,XϾ `@P@-@`& R a ~aJ∺X"`b+nbh/cj3V#b7*#c;d?VeCU$[G$aKddO(d\v)pY ihـspuix9x矀ZAzj衈&z|4裐F~Tj饘ft駠&jꩨj~*Zj)*|@*A>;N[V>-"n[n暮ޚ-z/[///{m\ }$'UlKg|G,S$|(ʸ0,4l8<@-DmHClsL7]P{'Um5|Xg\ -dmhlp-jyiJW|z.K6G~Wngw砇.褗n騧꬛4p >{羑D>DD?D'D"7?D%GD(W?D+gDqϚ~x_rnѿjf_dX(Zt>ρ$> ς4?σD-,v+BHj0ZFCl VxJ="XkH  &$4 %V1fIbD܌`dǒ1Efx67mYG:3u!G>q0}HB/D!HF./FI-0_&ʹn2GJ;@Kd ĹP1f(q ^zy]3ժ2ekZ.XN Mfy6mg)-r>˜B'MotgNyڊ󴧬y%O}ƊO5zP u( P;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/toolbar/000077500000000000000000000000001226600447100240715ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/toolbar/bg.gif000066400000000000000000000016101226600447100251460ustar00rootroot00000000000000GIF89a8!,8eA@:pడ 2H̀" ,h@# |Рd D`$0` $@ 2pP#HPի;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/toolbar/btn-arrow-light.gif000066400000000000000000000016241226600447100276030ustar00rootroot00000000000000GIF89a d@@]t|˜Ĝǡʦ̪ϯѴԸֽٿ!, dqH*D8C6haăjȱǏ CIɓ(S\2@  @,"1\Fjǖn'O, QD+S\KUtkWY[˅]npr{aOHq) 4p #41QI @-Yp0! ⰵ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tree/drop-between.gif000066400000000000000000000016131226600447100264510ustar00rootroot00000000000000GIF89a5IcF7+H9,RA3VD5 Hgzk~t|~`jnwx`lx!,h1X1T@@‡,8`@ Ä$ \"s… )Ζ$},xp%PeFXbƍ~ 9RI** ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tree/drop-no.gif000066400000000000000000000016651226600447100254430ustar00rootroot00000000000000GIF89a$$44<t@aK |`BŸ hM bS ҁAcμ*fZeH$jH3nq"Ö%N$(;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tree/drop-over.gif000066400000000000000000000016171226600447100257770ustar00rootroot00000000000000GIF89a5IcF7+H9,RA3VD5 Hgzk~t|~`jnwx`lx!,l58C .A  0PρfJի;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tree/elbow-end-plus-nl.gif000066400000000000000000000016041226600447100273220ustar00rootroot00000000000000GIF89a1JcBBƥ֩ڽƵ!,aH*\  A2flE8*hcF  Yp0a<(G `IP IPx S J0 ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tree/elbow-end-plus.gif000066400000000000000000000016131226600447100267130ustar00rootroot00000000000000GIF89a1JcBBƥ֩ڽƵ!,hH *\x0!Ç8`pc4vQAH9`ɂ9e8`/ @ `p@AI5#īXB ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tree/elbow-end.gif000066400000000000000000000015141226600447100257320ustar00rootroot00000000000000GIF89aBB!,)H*\x0!Ç BHP"E 3xǏ C ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tree/elbow-line.gif000066400000000000000000000015161226600447100261150ustar00rootroot00000000000000GIF89aBB!,+H*\x0!Ç BHP"E/B̨!ǎ ?41 ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tree/elbow-minus-nl.gif000066400000000000000000000016021226600447100267240ustar00rootroot00000000000000GIF89a1JcBBƥ֩ڽƹ!,_H*\  A2flE8"hF ,8/UVqM9g2P@:bçP" ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tree/elbow-minus.gif000066400000000000000000000016141226600447100263200ustar00rootroot00000000000000GIF89a1JcBBƥ֩ڽƹ!,iH *\x0!Ç8`pc4vtAH=2X`dȔ2ÁH\K>.A  0PρfJMX$;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tree/elbow-plus-nl.gif000066400000000000000000000016041226600447100265560ustar00rootroot00000000000000GIF89a1JcBBƥ֩ڽƵ!,aH*\  A2flE8*hcF  Yp0a<(G `IP IPx S J0 ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tree/elbow-plus.gif000066400000000000000000000016161226600447100261520ustar00rootroot00000000000000GIF89a1JcBBƥ֩ڽƵ!,kH *\x0!Ç8`pc4vQAH9`ɂ9e8`/ @ `p@AI5#ī7j`@;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tree/elbow.gif000066400000000000000000000015221226600447100251650ustar00rootroot00000000000000GIF89aBB!,/H*\x0!Ç BHP"E 3x ǎ ?T(rǃ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tree/folder-open.gif000066400000000000000000000016741226600447100262770ustar00rootroot00000000000000GIF89a1JcBBghjlnp q r s uz~"%ƚƚ*ȕ0ɖ1˘3̙4ɠ!Ϣ&׸@ڿlCPpuzƥ֩ڽƹׄ!,H3dpBzHˆ22f!!CIp0cXPc͛8m~hƄ&M0@c”b4tA*<Sƈ`Ga@T1B]V5NP@n `@4 ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tree/folder.gif000066400000000000000000000016701226600447100253340ustar00rootroot00000000000000GIF89a1JcBBghjlnq s uvyz|~"%(*Œ-ǔ/ȕ0ɖ1˘3̙4۷R۷qouƥ֩ڽƹ!,H7lАBlHd 8ha8Aɓ&AŊ0cH"8syE *RJTTXʴ>)AU|NPׯ*ƒٳhU   8`-` ᢯߿z ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tree/leaf.gif000066400000000000000000000016611226600447100247700ustar00rootroot00000000000000GIF89a5Ic6Jd/b1e9r>v@vF{J}@@NVXblnejvzqw}Ä醦ꋪꄫȧ̟! ,HA(„,@`@)P 1BD *H@B 8`@Af/\h"?it"6odQT J¨ Im'PBrc(ӱ4N*M9[XkxE7 ;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tree/loading.gif000066400000000000000000000014031226600447100254700ustar00rootroot00000000000000GIF89a wuly! NETSCAPE2.0! ,OɌ{Y̲`ID8+Sޤ(D(I~ H` ZfkNqك;'L! ,N {@1Q]AiN:)ST ޴,Žb$? Q(0)jf{n-~Nž! ,MΡ,EeuȔ%5Ef3 ݮg(<LD"X`RJJN 9ܣ=! ,NJZ'B q`P)8/,S&$$ݮ yD"`Rakbm^Sڙ! ,MZgJ }HI b$(t}绝 ~9@Y,2 i00 |řt;! ,MRZR }HIlԲtP0Bv>CG12iPѦJ0R-Jt;! ,MɔZZ$ }HIlat0ޭ8B dLIB)q80 &tह3;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/tree/s.gif000066400000000000000000000000531226600447100243150ustar00rootroot00000000000000GIF89a!,D;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/window/000077500000000000000000000000001226600447100237365ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/window/icon-error.gif000066400000000000000000000032051226600447100265040ustar00rootroot00000000000000GIF89a    #)079?.-.//01&&556<;=EOM T[]M9:mbrtx~b34FEFGGHIIJSRTTTUfQSnVVtVVqYYz_`g``feggfhkkmu``|hjvuw}|~~~89 #$$%))//22""::JLOP[[egkkmmssxxiillssqq||__CCHHJJkm{{rr    $$12<<45:;  ./""56 --$$,,==33:;HFAAMMSS__UVHHCCIIPP^^UVtu|}MMOOCCLLTUWY__SS[[_`achjpry{ddjjss||˪ū˦ֲؼȓр§ꄆ⑓碤榩㲵!,  H,VT27w#J$MRXi5+*JZHEۺ m-YLQBdDXLɢmʖf i9\Ek.9 $HwԪYhT)Sbq9djUXTYUWI$Q "6Д,*4!CZ\ę92 h%JP֥>Q᫙D٩E"Mf?; _ǥ9g5(WgH;~L?~ްpv8(?ո[@)*4JxӞ?чl0u" =# 08qL0AH|đq@IHPLn!GL%c'i#kJ, jras`?{Tii,DK(K`g ?RVƠB @.x(VaYP#?DI 1?&\nKͥŦK,D?CXCIl)^P&? C4 8p 84P d; qw,= !$ #Q? 5CU mC0.cV=6ue 6XC6Lp:Hܠ6{`B/W84lp|T` 320@#K2;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/window/icon-info.gif000066400000000000000000000030621226600447100263070ustar00rootroot00000000000000GIF89a <HOE IWdb m |~ !O$R#L'T(R,U.X1[3m5c6a7o!3[%8a&=f!=k*=e.>d/Bg%Cr(K{3Be7Hm1Jt5P~>Sx@MoHZ}N[{ ,&'*.00>/ >CGINP+I1O=\?b;b>a)^H`AbUc[g\kQm^sMlV|V_~doepiuiymymzv\xzcicempq~{NQciusz{nxpqr|׃LJȂĀ΄ʋċˀڊԌӐÒ̙™ԓ͚Ú˒ԓؖۘӞ՛ؑ榱äʦ˩éȩɣӱµŴʸŹȞ֬۶̻ʱհ޴߸ս־ۣ!,  (;m)\8o2g#JL|i/#M'Fcƍ#&UoF$(pR}\]<7@g-j!߼1`^WCl!Gw_W?7){o{uڷQw6*{"wEZgEv-{^dz-&o۷6+t z֥^_9r8K-0zAY e Μ9{ 'Usρӓ(h:rIp{ѓ:(g>cN9L0kqg:`|#8(9Lb wy=*8ᄃ2 mxJ0wԈN8O +*xGÇc%8di,ΜI+ᔸ| 됙 8$L-@V!&#:& a8~"N1PRI0Q4w,I-،#12@ 5CiN pP[`2H"r ꘁ@ 80g/@<EH#P0 cJ1K22,4҈4@a3*2I%sL2C $"<0 E`q "!K.(B SxN|2 LPKxR!Z20 MR AB"pѲ-PC!J49Gӟ0!M MäLYXM]h iQ#3O UD;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/window/icon-question.gif000066400000000000000000000031071226600447100272230ustar00rootroot00000000000000GIF89a W]]fkt,m!s$z)w 1}5xCFKLKMLNRHPYRRTHUaJZlT[e\^bUgyRhffihgiglreo{ttvxz}%*+09 ;>=?IJ"G(N2S4X N$R*R+U2X:_1b;kRkRm[n^xCjIm\w]_|Z}aomviyr{Apoafinmhjmjuptvyy|Zbkqyx{qs~Ѕ˂Ć˅̌ʌŌ̄҅ЌъތڗŒɜ͐ۗɞǝΔԔؕۙӜہ菵畼㘻ࢳã̫èʠנثѵǰοժ۵̺˱ձٸһֽۢ!,  (p7n[hӦH8wǏ#|{L"ʼneǑ˗.՛G3o'l/̟?{G I;jO-]-=&rcΧ}F1Xynn׵ (M  g=taw`'P! yU׭eE#g=)AƽKB$H޺u˵rgZկ)_-:uꀛUʌYM^1l( "ze?G>G^:ѣ `z$(9ô =e'vs3l94FuƧ'Xc8 25.1!\N$$83Hr0ӂ"$ 8߄0 A|K5 hc㥘t$O`pG3q 6Ԩ@!Lj 20(0B(f8_@:|1 )D@Ìq`(Ȱ@,˨ &p!HM(j1I.4(29` 'rLRI!U\GI#nDB. +1 & .P25< 4AFj %ز/k/XGLA44yDm T/xb U4a c'M?SPQE"<@`MN *uALH'b4G!-;@ w"|AA@c'3\ 6'^ctA|>XGׅ#-3xN!F^;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/window/icon-warning.gif000066400000000000000000000027131226600447100270230ustar00rootroot00000000000000GIF89a  ".1 0>$'$' BKEJCj|q w src oonj{ i1a='O20_52]$'e()d+,b.-b/0b7!h1/`10`;8lM:P<+D1NA?YZN XD\M.mU"dP2y]!@@XIITXNNPGQQSOwaV}b]%+%-.2/5;AP@STi[cehjoqvx{i!k6t6v3-)1)&= Oƫ ˥ͤɨήø֪խмڰ޲޴#  )=   #"$)>1h`~Ydne~hً̾܊ݎ۰!,  Hp ?x*\(p3c1`ƌGkEGPZ1: T͔fӞaܱdfS1;0Tc.13R3`B(-S/pl1M"U l4s+&==115lzx7AET%$d1la+xh2.c_ XgaLA2pjժ(S -Xl9P-XŚqUeąUl5,h1Ufl 04rKEhK,c-P|~'7 + +L8 $"XB'IrԎ~'t+l1!L,|9q%d™-=I2\D;s.MfҤ-g g&@#%@ر.d"4@ 0̤#LQ>3G̒%IHzɭ(#x`?đ&pJ) ltb,0 GCr$"0­#t]\HvH"|\BPFoan!# Ё7Ff4GRd ¯B %t  *hA $O90,9;glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/window/left-corners.png000066400000000000000000000003101226600447100270410ustar00rootroot00000000000000PNG  IHDR,R2tIME #\$ pHYsiTSgAMA aPLTEBtRNS@f,IDATxQ vc-=dH$I= ,\yǞIENDB`glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/window/left-corners.psd000066400000000000000000000363301226600447100270560ustar00rootroot000000000000008BPS,8BIM8BIM ,pxJFIF[[,  # !"!%'$ '!!    }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr $4%&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ?gJ4tIi`IdXٔ3H$IJWi>,Tlirml:E֩_' ezC֫=A?Z}_÷X2!kGW0 HZ;z,u~ށa E_÷X2!kGW0 HZ;z,u~ށa E_÷X2!kGW0 HZ;z,u~ށa E_÷X2!kGW0 HZ;zezC֎a[ל?-i.ށc E ÷X6kB0? 8Zк;zl.ށc E ÷X6kB0? 8Zк;zl.ށc E ÷X6kB0? 8Zк;zl.ށc E ÷X6kB0? 8Zк;zl.ށc E ÷^DLxkx6vvH投&Sv8BIM8BIM8BIM,(8BIMnorm<(Raster 1,48BIMnorm<(Raster 2@@@@glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/window/left-right.png000066400000000000000000000002301226600447100265040ustar00rootroot00000000000000PNG  IHDR FtIME !Ux pHYsnu>gAMA a PLTE <IDATxc``dF28 [HIENDB`glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/window/left-right.psd000066400000000000000000000567561226600447100265360ustar00rootroot000000000000008BPS WT8BIMh8BIM%)U5]DOFP8BIM$9 application/vnd.adobe.photoshop Adobe Photoshop CS3 Windows 2008-07-01T14:22:03-04:00 2008-07-28T12:25:17-04:00 2008-07-28T12:25:17-04:00 uuid:05AD0E979A47DD11A771A34AE3767208 uuid:1382F64CC15CDD1196A98F513C040B01 1 1999996/10000 1999996/10000 2 256,257,258,259,262,274,277,284,530,531,282,283,296,301,318,319,529,532,306,270,271,272,305,315,33432;91900F7BC0D70966DFFB8E5F0F4B5F62 12 5 1 36864,40960,40961,37121,37122,40962,40963,37510,40964,36867,36868,33434,33437,34850,34852,34855,34856,37377,37378,37379,37380,37381,37382,37383,37384,37385,37386,37396,41483,41484,41486,41487,41488,41492,41493,41495,41728,41729,41730,41985,41986,41987,41988,41989,41990,41991,41992,41993,41994,41995,41996,42016,0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,22,23,24,25,26,27,28,30;233A187878907C48377C87C97B57867D 3 sRGB IEC61966-2.1 8BIM/JXX iU('llun8BIM8BIM&?8BIM Transparency8BIM Transparency8BIMd8BIM5d8BIM8BIM x8BIM8BIM 8BIM 8BIM' 8BIMH/fflff/ff2Z5-8BIMp8BIM8BIM8BIM08BIM-8BIM@@8BIM8BIMnullbaseNameTEXTUserboundsObjcRct1Top longLeftlongBtomlongRghtlong slicesVlLsObjcslicesliceIDlonggroupIDlongoriginenum ESliceOrigin autoGeneratedTypeenum ESliceTypeImg boundsObjcRct1Top longLeftlongBtomlongRghtlong urlTEXTnullTEXTMsgeTEXTaltTagTEXTcellTextIsHTMLboolcellTextTEXT horzAlignenumESliceHorzAligndefault vertAlignenumESliceVertAligndefault bgColorTypeenumESliceBGColorTypeNone topOutsetlong leftOutsetlong bottomOutsetlong rightOutsetlong8BIM( ?8BIM H HLinomntrRGB XYZ  1acspMSFTIEC sRGB-HP cprtP3desclwtptbkptrXYZgXYZ,bXYZ@dmndTpdmddvuedLview$lumimeas $tech0 rTRC< gTRC< bTRC< textCopyright (c) 1998 Hewlett-Packard CompanydescsRGB IEC61966-2.1sRGB IEC61966-2.1XYZ QXYZ XYZ o8XYZ bXYZ $descIEC http://www.iec.chIEC http://www.iec.chdesc.IEC 61966-2.1 Default RGB colour space - sRGB.IEC 61966-2.1 Default RGB colour space - sRGBdesc,Reference Viewing Condition in IEC61966-2.1,Reference Viewing Condition in IEC61966-2.1view_. \XYZ L VPWmeassig CRT curv #(-27;@EJOTY^chmrw| %+28>ELRY`gnu| &/8AKT]gqz !-8COZfr~ -;HUcq~ +:IXgw'7HYj{+=Oat 2FZn  % : O d y  ' = T j " 9 Q i  * C \ u & @ Z t .Id %A^z &Ca~1Om&Ed#Cc'Ij4Vx&IlAe@e Ek*Qw;c*R{Gp@j>i  A l !!H!u!!!"'"U"""# #8#f###$$M$|$$% %8%h%%%&'&W&&&''I'z''( (?(q(())8)k))**5*h**++6+i++,,9,n,,- -A-v--..L.../$/Z///050l0011J1112*2c223 3F3334+4e4455M555676r667$7`7788P8899B999:6:t::;-;k;;<' >`>>?!?a??@#@d@@A)AjAAB0BrBBC:C}CDDGDDEEUEEF"FgFFG5G{GHHKHHIIcIIJ7J}JK KSKKL*LrLMMJMMN%NnNOOIOOP'PqPQQPQQR1R|RSS_SSTBTTU(UuUVV\VVWDWWX/X}XYYiYZZVZZ[E[[\5\\]']x]^^l^__a_``W``aOaabIbbcCccd@dde=eef=ffg=ggh?hhiCiijHjjkOkklWlmm`mnnknooxop+ppq:qqrKrss]sttptu(uuv>vvwVwxxnxy*yyzFz{{c{|!||}A}~~b~#G k͂0WGrׇ;iΉ3dʋ0cʍ1fΏ6n֑?zM _ɖ4 uL$h՛BdҞ@iءG&vVǥ8nRĩ7u\ЭD-u`ֲK³8%yhYѹJº;.! zpg_XQKFAǿ=ȼ:ɹ8ʷ6˶5̵5͵6ζ7ϸ9к<Ѿ?DINU\dlvۀ܊ݖޢ)߯6DScs 2F[p(@Xr4Pm8Ww)Km8BIM8BIM Y $=JFIFHH Adobe_CMAdobed             "?   3!1AQa"q2B#$Rb34rC%Scs5&DTdE£t6UeuF'Vfv7GWgw5!1AQaq"2B#R3$brCScs4%&5DTdEU6teuFVfv'7GWgw ??ыĔO8BIM!UAdobe PhotoshopAdobe Photoshop CS38BIM".MM*bj(1r2i|'|'Adobe Photoshop CS3 Windows2008:07:28 12:25:17 &(.HH8BIMmoptHTargetSettingsMttCObjc NativeQuadBl longGrn longRd longTrnsbool addMetadatabool fileFormatenum FileFormatPNG24 interlacedbool noMatteColorbooltransparencyDitherAlgorithmenumDitherAlgorithmNonetransparencyDitherAmountlong8BIM-msetnullVersionlong8BIMms4w8BIMmaniIRFR8BIMAnDsnullAFStlongFrInVlLsObjcnullFrIDlongHAFStsVlLsObjcnullFsIDlongAFrmlongFsFrVlLslongHALCntlong8BIMRoll8BIMmfri 8BIMnorm ( Background8BIMluni Background8BIMlnsrbgnd8BIMlyid8BIMclbl8BIMinfx8BIMknko8BIMlspf8BIMlclr8BIMfxrp 8BIMnorm(Layer 18BIMluniLayer 18BIMlnsrlayr8BIMlyid8BIMclbl8BIMinfx8BIMknko8BIMlspf8BIMlclr8BIMfxrp   8BIMnorm(Layer 28BIMluniLayer 28BIMlnsrlayr8BIMlyid8BIMclbl8BIMinfx8BIMknko8BIMlspf8BIMlclr8BIMfxrp@     8BIMnorm(Layer 38BIMluniLayer 38BIMlnsrlayr8BIMlyid8BIMclbl8BIMinfx8BIMknko8BIMlspf8BIMlclr8BIMfxrp@#@8BIMPatt8BIMFMsk 2glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/window/right-corners.png000066400000000000000000000004001226600447100272240ustar00rootroot00000000000000PNG  IHDR,R2,tEXtCreation TimeWed 25 Apr 2007 02:44:16 -0800.B3tIME #[ pHYsiTSgAMA aPLTE.쪈tRNS@f,IDATx K4,em-ZM#"B-"Y8҃cIENDB`glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/window/right-corners.psd000066400000000000000000000362521226600447100272440ustar00rootroot000000000000008BPS,*8BIM7200704258BIM ,pJFIF[[,  # !"!%'$ '!!    }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr $4%&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ?Ʊţ1iqǞ"2Z(*ăQҽ>-UU-x3{]tU"j|?2?ȼ??O?/O'?/O'?/O'?/O'?/O'?/O'?/O'?/O'?/O'?/O'?/O'?/O'?/O'?/O'?/O'?.OqQOO\%?xE_QOO\%?xE_QOO\%?xE_QOO\%?xE_QOO\%?xE_QOO\%?xE_QOO\%?xE_QOO\%?xE_QOO\%?xE_QOOZ-Q\Q۸7Luz jʧ8BIM8BIM8BIM,48BIMnorm<(Raster 1ïïglpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/window/top-bottom.png000066400000000000000000000002641226600447100265520ustar00rootroot00000000000000PNG  IHDR,gAMA aPLTE6M'(IDATxc```Q FQr%G!F2 XIENDB`glpi-0.84.3+dfsg.1/lib/extjs/resources/images/default/window/top-bottom.psd000066400000000000000000000766001226600447100265630ustar00rootroot000000000000008BPS,L 8BIM%8BIM$:C 2008-07-01T18:22:22-04:00 2008-07-01T18:22:22-04:00 2008-07-01T18:22:22-04:00 Adobe Photoshop CS3 Windows application/vnd.adobe.photoshop 3 uuid:63110EC7BA47DD11A771A34AE3767208 uuid:DAA209C29A47DD11A771A34AE3767208 uuid:62110EC7BA47DD11A771A34AE3767208 1 2000000/10000 2000000/10000 2 256,257,258,259,262,274,277,284,530,531,282,283,296,301,318,319,529,532,306,270,271,272,305,315,33432;EA484933FF37A43FC20EE285745EE468 5 300 -1 36864,40960,40961,37121,37122,40962,40963,37510,40964,36867,36868,33434,33437,34850,34852,34855,34856,37377,37378,37379,37380,37381,37382,37383,37384,37385,37386,37396,41483,41484,41486,41487,41488,41492,41493,41495,41728,41729,41730,41985,41986,41987,41988,41989,41990,41991,41992,41993,41994,41995,41996,42016,0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,22,23,24,25,26,27,28,30;89C9D4D99272D70C3C8BFF4808CEE5BA 8BIM/JHH@d'om.psd8BIM8BIM&?8BIM Transparency8BIM Transparency8BIMd8BIM5d8BIM8BIM 8BIM8BIM 8BIM 8BIM' 8BIMH/fflff/ff2Z5-8BIMp8BIM8BIM8BIM08BIM-8BIM@@8BIM8BIMnullbaseNameTEXTUserboundsObjcRct1Top longLeftlongBtomlong,RghtlongslicesVlLsObjcslicesliceIDlonggroupIDlongoriginenum ESliceOrigin autoGeneratedTypeenum ESliceTypeImg boundsObjcRct1Top longLeftlongBtomlong,RghtlongurlTEXTnullTEXTMsgeTEXTaltTagTEXTcellTextIsHTMLboolcellTextTEXT horzAlignenumESliceHorzAligndefault vertAlignenumESliceVertAligndefault bgColorTypeenumESliceBGColorTypeNone topOutsetlong leftOutsetlong bottomOutsetlong rightOutsetlong8BIM( ?8BIM8BIM8BIM  JFIFHH Adobe_CMAdobed            "?   3!1AQa"q2B#$Rb34rC%Scs5&DTdE£t6UeuF'Vfv7GWgw5!1AQaq"2B#R3$brCScs4%&5DTdEU6teuFVfv'7GWgw ?X?oE$4oININININININININno7zJv'8BIM!UAdobe PhotoshopAdobe Photoshop CS38BIM".MM*bj(1r2i''Adobe Photoshop CS3 Windows2008:07:01 18:22:22,&(.HH8BIMmoptHTargetSettingsMttCObjc NativeQuadBl longGrn longRd longTrnsbool addMetadatabool fileFormatenum FileFormatPNG24 interlacedbool noMatteColorbooltransparencyDitherAlgorithmenumDitherAlgorithmNonetransparencyDitherAmountlong8BIM-msetnullVersionlong8BIMms4w8BIM maniIRFR8BIMAnDsnullAFStlongFrInVlLsObjcnullFrIDlongFStsVlLsObjcnullFsIDlongAFrmlongFsFrVlLslong pageSize) { var numSubMenus = Math.floor(totalItems / pageSize); var remainder = totalItems % pageSize; // Loop through all of the items and create submenus in chunks of 10 for (var i = 0 ; i < numSubMenus; i++) { var curPage = (i + 1) * pageSize; var menuItems = []; for (var x = 0; x < pageSize; x++) { index = x + curPage - pageSize; var item = this.items.get(index); menuItems.push(this.autoGenMenuItem(item)); } this.tabsMenu.add({ text : this.tabScrollerMenu.getMenuPrefixText() + ' ' + (curPage - pageSize + 1) + ' - ' + curPage, menu : menuItems }); } // remaining items if (remainder > 0) { var start = numSubMenus * pageSize; menuItems = []; for (var i = start ; i < totalItems; i ++ ) { var item = this.items.get(i); menuItems.push(this.autoGenMenuItem(item)); } this.tabsMenu.add({ text : this.tabScrollerMenu.menuPrefixText + ' ' + (start + 1) + ' - ' + (start + menuItems.length), menu : menuItems }); } } else { this.items.each(function(item) { // if (item.id != curActive.id) { this.tabsMenu.add(this.autoGenMenuItem(item)); // } }, this); } }, // private autoGenMenuItem : function(item) { var maxText = this.tabScrollerMenu.getMaxText(); var text = Ext.util.Format.ellipsis(item.title, maxText); return { text : text, handler : this.showTabFromMenu, scope : this, disabled : item.disabled, tabToShow : item, iconCls : item.iconCls } }, // private showTabFromMenu : function(menuItem) { this.setActiveTab(menuItem.tabToShow); } } }); Ext.preg('tabscrollermenu', Ext.ux.TabScrollerMenu); glpi-0.84.3+dfsg.1/lib/extrajs/datetime.js000066400000000000000000000506201226600447100202040ustar00rootroot00000000000000// vim: ts=4:sw=4:nu:fdc=4:nospell /*global Ext */ /** * @class Ext.ux.form.DateTime * @extends Ext.form.Field * * DateTime field, combination of DateField and TimeField * * @author Ing. Jozef Sakáloš * @copyright (c) 2008, Ing. Jozef Sakáloš * @version 2.0 * @revision $Id: Ext.ux.form.DateTime.js 813 2010-01-29 23:32:36Z jozo $ * * @license Ext.ux.form.DateTime is licensed under the terms of * the Open Source LGPL 3.0 license. Commercial use is permitted to the extent * that the code/component(s) do NOT become part of another Open Source or Commercially * licensed development library or toolkit without explicit permission. * *

    License details: http://www.gnu.org/licenses/lgpl.html

    * * @forum 22661 * * @donate *
    * * * * *
    */ Ext.ns('Ext.ux.form'); /** * Creates new DateTime * @constructor * @param {Object} config A config object */ Ext.ux.form.DateTime = Ext.extend(Ext.form.Field, { /** * @cfg {Function} dateValidator A custom validation function to be called during date field * validation (defaults to null) */ dateValidator:null /** * @cfg {String/Object} defaultAutoCreate DomHelper element spec * Let superclass to create hidden field instead of textbox. Hidden will be submittend to server */ ,defaultAutoCreate:{tag:'input', type:'hidden'} /** * @cfg {String} dtSeparator Date - Time separator. Used to split date and time (defaults to ' ' (space)) */ ,dtSeparator:' ' /** * @cfg {String} hiddenFormat Format of datetime used to store value in hidden field * and submitted to server (defaults to 'Y-m-d H:i:s' that is mysql format) */ ,hiddenFormat:'Y-m-d H:i:s' /** * @cfg {Boolean} otherToNow Set other field to now() if not explicly filled in (defaults to true) */ ,otherToNow:true /** * @cfg {Boolean} emptyToNow Set field value to now on attempt to set empty value. * If it is true then setValue() sets value of field to current date and time (defaults to false) */ /** * @cfg {String} timePosition Where the time field should be rendered. 'right' is suitable for forms * and 'below' is suitable if the field is used as the grid editor (defaults to 'right') */ ,timePosition:'right' // valid values:'below', 'right' /** * @cfg {Function} timeValidator A custom validation function to be called during time field * validation (defaults to null) */ ,timeValidator:null /** * @cfg {Number} timeWidth Width of time field in pixels (defaults to 100) */ ,timeWidth:100 /** GLPI add * @cfg {Number} timeWidth Width of time field in pixels (defaults to 100) */ ,dateWidth:100 /** * @cfg {String} dateFormat Format of DateField. Can be localized. (defaults to 'm/y/d') */ ,dateFormat:'m/d/y' /** * @cfg {String} timeFormat Format of TimeField. Can be localized. (defaults to 'g:i A') */ ,timeFormat:'g:i A' /** * @cfg {Object} dateConfig Config for DateField constructor. */ /** * @cfg {Object} timeConfig Config for TimeField constructor. */ // {{{ /** * @private * creates DateField and TimeField and installs the necessary event handlers */ ,initComponent:function() { // call parent initComponent Ext.ux.form.DateTime.superclass.initComponent.call(this); // create DateField var dateConfig = Ext.apply({}, { id:this.id + '-date' ,format:this.dateFormat || Ext.form.DateField.prototype.format // GLPI correction : specific datewidth ,width:this.dateWidth ,selectOnFocus:this.selectOnFocus ,validator:this.dateValidator // GLPI correction : startDay ,startDay: this.startDay ,listeners:{ blur:{scope:this, fn:this.onBlur} ,focus:{scope:this, fn:this.onFocus} } }, this.dateConfig); this.df = new Ext.form.DateField(dateConfig); this.df.ownerCt = this; delete(this.dateFormat); // create TimeField var timeConfig = Ext.apply({}, { id:this.id + '-time' ,format:this.timeFormat || Ext.form.TimeField.prototype.format ,width:this.timeWidth ,selectOnFocus:this.selectOnFocus ,validator:this.timeValidator ,listeners:{ blur:{scope:this, fn:this.onBlur} ,focus:{scope:this, fn:this.onFocus} } }, this.timeConfig); this.tf = new Ext.form.TimeField(timeConfig); this.tf.ownerCt = this; delete(this.timeFormat); // relay events this.relayEvents(this.df, ['focus', 'specialkey', 'invalid', 'valid']); this.relayEvents(this.tf, ['focus', 'specialkey', 'invalid', 'valid']); this.on('specialkey', this.onSpecialKey, this); } // eo function initComponent // }}} // {{{ /** * @private * Renders underlying DateField and TimeField and provides a workaround for side error icon bug */ ,onRender:function(ct, position) { // don't run more than once if(this.isRendered) { return; } // render underlying hidden field Ext.ux.form.DateTime.superclass.onRender.call(this, ct, position); // render DateField and TimeField // create bounding table var t; if('below' === this.timePosition || 'bellow' === this.timePosition) { t = Ext.DomHelper.append(ct, {tag:'table',style:'border-collapse:collapse',children:[ {tag:'tr',children:[{tag:'td', style:'padding-bottom:1px', cls:'ux-datetime-date'}]} ,{tag:'tr',children:[{tag:'td', cls:'ux-datetime-time'}]} ]}, true); } else { t = Ext.DomHelper.append(ct, {tag:'table',style:'border-collapse:collapse',children:[ {tag:'tr',children:[ {tag:'td',style:'padding-right:4px', cls:'ux-datetime-date'},{tag:'td', cls:'ux-datetime-time'} ]} ]}, true); } this.tableEl = t; this.wrap = t.wrap({cls:'x-form-field-wrap'}); // this.wrap = t.wrap(); this.wrap.on("mousedown", this.onMouseDown, this, {delay:10}); // render DateField & TimeField this.df.render(t.child('td.ux-datetime-date')); this.tf.render(t.child('td.ux-datetime-time')); // workaround for IE trigger misalignment bug // see http://extjs.com/forum/showthread.php?p=341075#post341075 // if(Ext.isIE && Ext.isStrict) { // t.select('input').applyStyles({top:0}); // } this.df.el.swallowEvent(['keydown', 'keypress']); this.tf.el.swallowEvent(['keydown', 'keypress']); // create icon for side invalid errorIcon if('side' === this.msgTarget) { var elp = this.el.findParent('.x-form-element', 10, true); if(elp) { this.errorIcon = elp.createChild({cls:'x-form-invalid-icon'}); } var o = { errorIcon:this.errorIcon ,msgTarget:'side' ,alignErrorIcon:this.alignErrorIcon.createDelegate(this) }; Ext.apply(this.df, o); Ext.apply(this.tf, o); // this.df.errorIcon = this.errorIcon; // this.tf.errorIcon = this.errorIcon; } // setup name for submit this.el.dom.name = this.hiddenName || this.name || this.id; // prevent helper fields from being submitted this.df.el.dom.removeAttribute("name"); this.tf.el.dom.removeAttribute("name"); // we're rendered flag this.isRendered = true; // update hidden field this.updateHidden(); } // eo function onRender // }}} // {{{ /** * @private */ ,adjustSize:Ext.BoxComponent.prototype.adjustSize // }}} // {{{ /** * @private */ ,alignErrorIcon:function() { this.errorIcon.alignTo(this.tableEl, 'tl-tr', [2, 0]); } // }}} // {{{ /** * @private initializes internal dateValue */ ,initDateValue:function() { this.dateValue = this.otherToNow ? new Date() : new Date(1970, 0, 1, 0, 0, 0); } // }}} // {{{ /** * Calls clearInvalid on the DateField and TimeField */ ,clearInvalid:function(){ this.df.clearInvalid(); this.tf.clearInvalid(); } // eo function clearInvalid // }}} // {{{ /** * Calls markInvalid on both DateField and TimeField * @param {String} msg Invalid message to display */ ,markInvalid:function(msg){ this.df.markInvalid(msg); this.tf.markInvalid(msg); } // eo function markInvalid // }}} // {{{ /** * @private * called from Component::destroy. * Destroys all elements and removes all listeners we've created. */ ,beforeDestroy:function() { if(this.isRendered) { // this.removeAllListeners(); this.wrap.removeAllListeners(); this.wrap.remove(); this.tableEl.remove(); this.df.destroy(); this.tf.destroy(); } } // eo function beforeDestroy // }}} // {{{ /** * Disable this component. * @return {Ext.Component} this */ ,disable:function() { if(this.isRendered) { this.df.disabled = this.disabled; this.df.onDisable(); this.tf.onDisable(); } this.disabled = true; this.df.disabled = true; this.tf.disabled = true; this.fireEvent("disable", this); return this; } // eo function disable // }}} // {{{ /** * Enable this component. * @return {Ext.Component} this */ ,enable:function() { if(this.rendered){ this.df.onEnable(); this.tf.onEnable(); } this.disabled = false; this.df.disabled = false; this.tf.disabled = false; this.fireEvent("enable", this); return this; } // eo function enable // }}} // {{{ /** * @private Focus date filed */ ,focus:function() { this.df.focus(); } // eo function focus // }}} // {{{ /** * @private */ ,getPositionEl:function() { return this.wrap; } // }}} // {{{ /** * @private */ ,getResizeEl:function() { return this.wrap; } // }}} // {{{ /** * @return {Date/String} Returns value of this field */ ,getValue:function() { // create new instance of date return this.dateValue ? new Date(this.dateValue) : ''; } // eo function getValue // }}} // {{{ /** * @return {Boolean} true = valid, false = invalid * @private Calls isValid methods of underlying DateField and TimeField and returns the result */ ,isValid:function() { return this.df.isValid() && this.tf.isValid(); } // eo function isValid // }}} // {{{ /** * Returns true if this component is visible * @return {boolean} */ ,isVisible : function(){ return this.df.rendered && this.df.getActionEl().isVisible(); } // eo function isVisible // }}} // {{{ /** * @private Handles blur event */ ,onBlur:function(f) { // called by both DateField and TimeField blur events // revert focus to previous field if clicked in between if(this.wrapClick) { f.focus(); this.wrapClick = false; } // update underlying value if(f === this.df) { this.updateDate(); } else { this.updateTime(); } this.updateHidden(); this.validate(); // fire events later (function() { if(!this.df.hasFocus && !this.tf.hasFocus) { var v = this.getValue(); if(String(v) !== String(this.startValue)) { this.fireEvent("change", this, v, this.startValue); } this.hasFocus = false; this.fireEvent('blur', this); } }).defer(100, this); } // eo function onBlur // }}} // {{{ /** * @private Handles focus event */ ,onFocus:function() { if(!this.hasFocus){ this.hasFocus = true; this.startValue = this.getValue(); this.fireEvent("focus", this); } } // }}} // {{{ /** * @private Just to prevent blur event when clicked in the middle of fields */ ,onMouseDown:function(e) { if(!this.disabled) { this.wrapClick = 'td' === e.target.nodeName.toLowerCase(); } } // }}} // {{{ /** * @private * Handles Tab and Shift-Tab events */ ,onSpecialKey:function(t, e) { var key = e.getKey(); if(key === e.TAB) { if(t === this.df && !e.shiftKey) { e.stopEvent(); this.tf.focus(); } if(t === this.tf && e.shiftKey) { e.stopEvent(); this.df.focus(); } this.updateValue(); } // otherwise it misbehaves in editor grid if(key === e.ENTER) { this.updateValue(); } } // eo function onSpecialKey // }}} // {{{ /** * Resets the current field value to the originally loaded value * and clears any validation messages. See Ext.form.BasicForm.trackResetOnLoad */ ,reset:function() { this.df.setValue(this.originalValue); this.tf.setValue(this.originalValue); } // eo function reset // }}} // {{{ /** * @private Sets the value of DateField */ ,setDate:function(date) { this.df.setValue(date); } // eo function setDate // }}} // {{{ /** * @private Sets the value of TimeField */ ,setTime:function(date) { this.tf.setValue(date); } // eo function setTime // }}} // {{{ /** * @private * Sets correct sizes of underlying DateField and TimeField * With workarounds for IE bugs */ ,setSize:function(w, h) { if(!w) { return; } if('below' === this.timePosition) { this.df.setSize(w, h); this.tf.setSize(w, h); if(Ext.isIE) { this.df.el.up('td').setWidth(w); this.tf.el.up('td').setWidth(w); } } else { this.df.setSize(w - this.timeWidth - 4, h); this.tf.setSize(this.timeWidth, h); if(Ext.isIE) { this.df.el.up('td').setWidth(w - this.timeWidth - 4); this.tf.el.up('td').setWidth(this.timeWidth); } } } // eo function setSize // }}} // {{{ /** * @param {Mixed} val Value to set * Sets the value of this field */ ,setValue:function(val) { if(!val && true === this.emptyToNow) { this.setValue(new Date()); return; } else if(!val) { this.setDate(''); this.setTime(''); this.updateValue(); return; } if ('number' === typeof val) { val = new Date(val); } else if('string' === typeof val && this.hiddenFormat) { val = Date.parseDate(val, this.hiddenFormat); } val = val ? val : new Date(1970, 0 ,1, 0, 0, 0); var da; if(val instanceof Date) { this.setDate(val); this.setTime(val); // UPDATE GLPI due to bug in create by copy in IE this.dateValue = new Date(val.getTime()); // this.dateValue = new Date(Ext.isIE ? val.getTime() : val); } else { da = val.split(this.dtSeparator); this.setDate(da[0]); if(da[1]) { if(da[2]) { // add am/pm part back to time da[1] += da[2]; } this.setTime(da[1]); } } this.updateValue(); } // eo function setValue // }}} // {{{ /** * Hide or show this component by boolean * @return {Ext.Component} this */ ,setVisible: function(visible){ if(visible) { this.df.show(); this.tf.show(); }else{ this.df.hide(); this.tf.hide(); } return this; } // eo function setVisible // }}} //{{{ ,show:function() { return this.setVisible(true); } // eo function show //}}} //{{{ ,hide:function() { return this.setVisible(false); } // eo function hide //}}} // {{{ /** * @private Updates the date part */ ,updateDate:function() { var d = this.df.getValue(); if(d) { if(!(this.dateValue instanceof Date)) { this.initDateValue(); if(!this.tf.getValue()) { this.setTime(this.dateValue); } } this.dateValue.setMonth(0); // because of leap years this.dateValue.setFullYear(d.getFullYear()); this.dateValue.setMonth(d.getMonth(), d.getDate()); // this.dateValue.setDate(d.getDate()); } else { this.dateValue = ''; this.setTime(''); } } // eo function updateDate // }}} // {{{ /** * @private * Updates the time part */ ,updateTime:function() { var t = this.tf.getValue(); if(t && !(t instanceof Date)) { t = Date.parseDate(t, this.tf.format); } if(t && !this.df.getValue()) { this.initDateValue(); this.setDate(this.dateValue); } if(this.dateValue instanceof Date) { if(t) { this.dateValue.setHours(t.getHours()); this.dateValue.setMinutes(t.getMinutes()); this.dateValue.setSeconds(t.getSeconds()); } else { this.dateValue.setHours(0); this.dateValue.setMinutes(0); this.dateValue.setSeconds(0); } } } // eo function updateTime // }}} // {{{ /** * @private Updates the underlying hidden field value */ ,updateHidden:function() { if(this.isRendered) { // GLPI update : default to NULL var value = this.dateValue instanceof Date ? this.dateValue.format(this.hiddenFormat) : 'NULL'; // var value = this.dateValue instanceof Date ? this.dateValue.format(this.hiddenFormat) : ''; this.el.dom.value = value; } } // }}} // {{{ /** * @private Updates all of Date, Time and Hidden */ ,updateValue:function() { this.updateDate(); this.updateTime(); this.updateHidden(); return; } // eo function updateValue // }}} // {{{ /** * @return {Boolean} true = valid, false = invalid * calls validate methods of DateField and TimeField */ ,validate:function() { return this.df.validate() && this.tf.validate(); } // eo function validate // }}} // {{{ /** * Returns renderer suitable to render this field * @param {Object} Column model config */ ,renderer: function(field) { var format = field.editor.dateFormat || Ext.ux.form.DateTime.prototype.dateFormat; format += ' ' + (field.editor.timeFormat || Ext.ux.form.DateTime.prototype.timeFormat); var renderer = function(val) { var retval = Ext.util.Format.date(val, format); return retval; }; return renderer; } // eo function renderer // }}} }); // eo extend // register xtype Ext.reg('xdatetime', Ext.ux.form.DateTime); // eofglpi-0.84.3+dfsg.1/lib/extrajs/spancombobox.js000066400000000000000000000011751226600447100211030ustar00rootroot00000000000000Ext.ns('Ext.ux.form'); // Create for use other display (inline) Ext.ux.form.SpanComboBox = Ext.extend(Ext.form.ComboBox, { initComponent:function() { // call parent initComponent Ext.ux.form.SpanComboBox.superclass.initComponent.call(this); } ,onRender : function(ct, position){ // don't run more than once if(this.isRendered) { return; } // render underlying hidden field Ext.ux.form.SpanComboBox.superclass.onRender.call(this, ct, position); var wrap = this.el.up('div.x-form-field-wrap'); this.wrap.applyStyles({display:'inline'}); } }); Ext.reg('spancombobox', Ext.ux.form.SpanComboBox);glpi-0.84.3+dfsg.1/lib/extrajs/starslider/000077500000000000000000000000001226600447100202235ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/extrajs/starslider/images/000077500000000000000000000000001226600447100214705ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/extrajs/starslider/images/slider-bg.jpg000066400000000000000000000006131226600447100240420ustar00rootroot00000000000000JFIFC     "" $(4,$&1'-=-157:::#+?D?8C49:7C 7%%77777777777777777777777777777777777777777777777777""!A1"Qa ?o)}mԕJKAu k*DY6=L<ƣ)n}+i&Ltf͚_~U\Gӧ?ܹ󺳳&|Un7n|xϟt㎎ntua,COO/߿ LLL`|ĉv^xQQQ{...9NNN1A40###ϟ??ׯ__#)@ β> A?.iB@xyA {n08555A0`+Wà]^ZZz+,ڕ^E D!2@@AA[@͙PPɷoߎ!kŌ@5AA,pss#{Wpф1R"0 @۾c',A T`z9߿&μzjǏOHF*Y1 @ {ŋy^ZZ_xqB6`zDd,t1Цнt!P"i }4u4,<IENDB`glpi-0.84.3+dfsg.1/lib/extrajs/starslider/images/slider-thumb.jpg000066400000000000000000000006441226600447100245750ustar00rootroot00000000000000JFIFC     "" $(4,$&1'-=-157:::#+?D?8C49:7C 7%%77777777777777777777777777777777777777777777777777"!!A1Qaq!1Q ?֦ahE*# Tk9ю[)*{:-)OQHM8%$e? K+SyPf1H C}`2G|k4Zglpi-0.84.3+dfsg.1/lib/extrajs/starslider/images/slider-thumb.png000066400000000000000000000013121226600447100245720ustar00rootroot00000000000000PNG  IHDRatEXtSoftwareAdobe ImageReadyqe<lIDATx|RMOQM;PK?-hSH5b R _` mEٸfELTFݸqA Ƙƅ,p#HJX:neygjh̙7ysy{1x^DZoKߠl*K m;;:;R|z=xl2MVkd1dk桘 R\6 ,yW[ݫ(7 IJi= !dVPT2Όq< TsHa":QHBAŰTL V@ۧ%qɅ%0QdUgoW2?%<=oL2dr7+B)8g}mzȶD.*:$"T ܴ~jujdRޖs`CTN\/j4`qc6Nb4D:d#n}vpa#9)|yT]c@X"c/oX2&k>g!;7ٮ1 ׅؑ0S'Ek7cWcy6Yz gpIENDB`glpi-0.84.3+dfsg.1/lib/extrajs/starslider/slider.css000066400000000000000000000022631226600447100222220ustar00rootroot00000000000000.x-starslider { zoom:1; cursor:pointer; } .x-starslider-inner { position:relative; left:0; top:0; overflow:visible; zoom:1; } .x-starslider-focus { position:absolute; left:0; top:0; width:1px; height:1px; line-height:1px; font-size:1px; -moz-outline:0 none; outline:0 none; -moz-user-select: text; -khtml-user-select: text; } /* Horizontal styles */ .x-starslider-horz { padding-left:7px; background:transparent url(./images/slider-bg.png) no-repeat 0 -22px; } .x-starslider-horz .x-starslider-end { zoom:1; background:transparent url(./images/slider-bg.png) no-repeat right -44px; } .x-starslider-horz .x-starslider-inner { background:transparent url(./images/slider-bg.png) repeat-x 0 0; height:22px; } .x-starslider-horz .x-starslider-thumb { width:14px; height:15px; position:absolute; left:0; top:0px; background:transparent url(./images/slider-thumb.png) repeat-x 0 0; } .x-starslider-horz .x-starslider-thumb-over { background-position: 0px 0px; } .x-starslider-horz .x-starslider-thumb-drag { background-position: -28px -30px; } glpi-0.84.3+dfsg.1/lib/extrajs/starslider/slider.html000066400000000000000000000033661226600447100224030ustar00rootroot00000000000000 Ext Slider Example
    glpi-0.84.3+dfsg.1/lib/extrajs/starslider/slider.js000066400000000000000000000202401226600447100220410ustar00rootroot00000000000000Ext.StarSlider = Ext.extend(Ext.BoxComponent, { minValue: 0, maxValue: 100, keyIncrement: 1, increment: 1, clickRange: [5,15], clickToChange : true, animate: true, dragging: false, initComponent : function(){ if(this.value === undefined){ this.value = this.minValue; } Ext.StarSlider.superclass.initComponent.call(this); this.keyIncrement = Math.max(this.increment, this.keyIncrement); this.addEvents( 'beforechange', 'change', 'changecomplete', 'dragstart', 'drag', 'click', 'dragend' ); }, onRender : function(){ this.autoEl = { cls: 'x-starslider x-starslider-horz', cn:{cls:'x-starslider-end',cn:{cls:'x-starslider-inner',cn:[{cls:'x-starslider-thumb'},{tag:'a', cls:'x-starslider-focus', href:"#", tabIndex: '-1', hidefocus:'on'}]}} }; this.width = (this.maxValue / this.increment)*16+8; Ext.StarSlider.superclass.onRender.apply(this, arguments); this.endEl = this.el.first(); this.innerEl = this.endEl.first(); this.thumb = this.innerEl.first(); this.halfThumb = this.thumb.getWidth()/2; this.focusEl = this.thumb.next(); this.initEvents(); this.resizeThumb(this.translateValue(this.value), false); }, initEvents : function(){ this.thumb.addClassOnOver('x-starslider-thumb-over'); this.mon(this.el, 'mousedown', this.onMouseDown, this); this.mon(this.el, 'keydown', this.onKeyDown, this); this.focusEl.swallowEvent("click", true); this.tracker = new Ext.dd.DragTracker({ onBeforeStart: this.onBeforeDragStart.createDelegate(this), onStart: this.onDragStart.createDelegate(this), onDrag: this.onDrag.createDelegate(this), onEnd: this.onDragEnd.createDelegate(this), tolerance: 3, autoStart: 300 }); this.tracker.initEl(this.thumb); this.on('beforedestroy', this.tracker.destroy, this.tracker); }, onMouseDown : function(e){ if(this.disabled) {return;} var local = this.innerEl.translatePoints(e.getXY()); this.onClickChange(local); this.focus(); }, onClickChange : function(local){ if(local.top > this.clickRange[0] && local.top < this.clickRange[1]){ this.setValue(Math.round(this.reverseValue(local.left)), undefined, true); } }, onKeyDown : function(e){ if(this.disabled){e.preventDefault();return;} var k = e.getKey(); switch(k){ case e.UP: case e.RIGHT: e.stopEvent(); if(e.ctrlKey){ this.setValue(this.maxValue, undefined, true); }else{ this.setValue(this.value+this.keyIncrement, undefined, true); } break; case e.DOWN: case e.LEFT: e.stopEvent(); if(e.ctrlKey){ this.setValue(this.minValue, undefined, true); }else{ this.setValue(this.value-this.keyIncrement, undefined, true); } break; default: e.preventDefault(); } }, doSnap : function(value){ if(!this.increment || this.increment == 1 || !value) { return value; } var newValue = value, inc = this.increment; var m = value % inc; if(m > 0){ if(m > (inc/2)){ newValue = value + (inc-m); }else{ newValue = value - m; } } return newValue.constrain(this.minValue, this.maxValue); }, afterRender : function(){ Ext.StarSlider.superclass.afterRender.apply(this, arguments); if(this.value !== undefined){ var v = this.normalizeValue(this.value); if(v !== this.value){ delete this.value; this.setValue(v, false); } else { this.moveThumb(this.translateValue(v), false); } } }, getRatio : function(){ var w = this.innerEl.getWidth(); var v = this.maxValue - this.minValue; return v == 0 ? w : (w/v); }, normalizeValue : function(v){ if(typeof v != 'number'){ v = parseInt(v); } v = Math.round(v); v = this.doSnap(v); v = v.constrain(this.minValue, this.maxValue); return v; }, setValue : function(v, animate, changeComplete){ v = this.normalizeValue(v); if(v !== this.value && this.fireEvent('beforechange', this, v, this.value) !== false){ this.value = v; this.resizeThumb(this.translateValue(v), animate !== false); this.fireEvent('change', this, v); if(changeComplete){ this.fireEvent('changecomplete', this, v); } } }, translateValue : function(v) { var ratio = this.getRatio(); return (v * ratio)-(this.minValue * ratio)-this.halfThumb; }, reverseValue : function(pos){ var ratio = this.getRatio(); return (pos+this.halfThumb+(this.minValue * ratio))/ratio; }, moveThumb: function(v, animate){ }, resizeThumb: function(v, animate){ this.thumb.setWidth(this.value*16, animate); }, focus : function(){ this.focusEl.focus(10); }, onBeforeDragStart : function(e){ return !this.disabled; }, onDragStart: function(e){ this.thumb.addClass('x-starslider-thumb-drag'); this.dragging = true; this.dragStartValue = this.value; this.fireEvent('dragstart', this, e); }, onDrag: function(e){ var pos = this.innerEl.translatePoints(this.tracker.getXY()); this.setValue(Math.round(this.reverseValue(pos.left)), false); this.fireEvent('drag', this, e); }, onDragEnd: function(e) { this.thumb.removeClass('x-starslider-thumb-drag'); this.dragging = false; this.fireEvent('dragend', this, e); if(this.dragStartValue != this.value){ this.fireEvent('changecomplete', this, this.value); } }, onResize : function(w, h){ this.innerEl.setWidth(w - (this.el.getPadding('l') + this.endEl.getPadding('r'))); this.syncThumb(); }, syncThumb : function(){ if(this.rendered){ this.moveThumb(this.translateValue(this.value)); } }, getValue : function(){ return this.value; } }); Ext.reg('starslider', Ext.StarSlider); Ext.form.StarRate = Ext.extend(Ext.form.Field, { defaultAutoCreate:{tag:'input', type:'hidden'} ,initComponent:function() { Ext.form.StarRate.superclass.initComponent.call(this); } ,onRender:function(ct, position) { Ext.form.StarRate.superclass.onRender.call(this, ct, position); Ext.apply(this.starConfig, { formElement: this.el.dom, listeners: { change: function(s, v) { this.formElement.value = v } } }) this.star = new Ext.StarSlider(this.starConfig); var t; t = Ext.DomHelper.append(ct, {tag:'table',style:'border-collapse:collapse',children:[ {tag:'tr',children:[ {tag:'td',style:'padding-right:4px', cls: 'x-form-element'},{tag:'td', cls: 'x-form-element'} ]} ]}, true); this.tableEl = t; this.wrap = t.wrap(); this.star.render(t.child('td.x-form-element')); if(Ext.isIE && Ext.isStrict) { t.select('input').applyStyles({top:0}); } this.star.el.swallowEvent(['keydown', 'keypress']); this.el.dom.name = this.hiddenName || this.name || this.id; this.star.el.dom.removeAttribute("name"); } }); Ext.reg('xstarrate', Ext.form.StarRate); glpi-0.84.3+dfsg.1/lib/extrajs/xdatefield.js000066400000000000000000000052231226600447100205200ustar00rootroot00000000000000// vim: ts=4:sw=4:nu:fdc=2:nospell /** * Ext.ux.form.XDateField - Date field that supports submitFormat * * @author Ing. Jozef Sakalos * @version $Id: Ext.ux.form.XDateField.js 471 2009-01-22 23:05:23Z jozo $ * * @license Ext.ux.grid.XDateField is licensed under the terms of * the Open Source LGPL 3.0 license. Commercial use is permitted to the extent * that the code/component(s) do NOT become part of another Open Source or Commercially * licensed development library or toolkit without explicit permission. * * License details: http://www.gnu.org/licenses/lgpl.html */ /*global Ext */ Ext.ns('Ext.ux.form'); /** * @class Ext.ux.form.XDateField * @extends Ext.form.DateField */ Ext.ux.form.XDateField = Ext.extend(Ext.form.DateField, { submitFormat:'Y-m-d' ,onRender:function() { // call parent Ext.ux.form.XDateField.superclass.onRender.apply(this, arguments); var name = this.name || this.el.dom.name; this.hiddenField = this.el.insertSibling({ tag:'input' ,type:'hidden' ,name:name ,value:this.formatHiddenDate(this.parseDate(this.value)) }); this.hiddenName = name; // otherwise field is not found by BasicForm::findField this.el.dom.removeAttribute('name'); this.el.on({ keyup:{scope:this, fn:this.updateHidden} ,blur:{scope:this, fn:this.updateHidden} }, Ext.isIE ? 'after' : 'before'); this.setValue = this.setValue.createSequence(this.updateHidden); } // eo function onRender ,onDisable: function(){ // call parent Ext.ux.form.XDateField.superclass.onDisable.apply(this, arguments); if(this.hiddenField) { this.hiddenField.dom.setAttribute('disabled','disabled'); } } // of function onDisable ,onEnable: function(){ // call parent Ext.ux.form.XDateField.superclass.onEnable.apply(this, arguments); if(this.hiddenField) { this.hiddenField.dom.removeAttribute('disabled'); } } // eo function onEnable ,formatHiddenDate : function(date){ if(!Ext.isDate(date)) { /// GLPI correction + default to NULL return 'NULL'; } if('timestamp' === this.submitFormat) { return date.getTime()/1000; } else { return Ext.util.Format.date(date, this.submitFormat); } } ,updateHidden:function() { this.hiddenField.dom.value = this.formatHiddenDate(this.getValue()); } // eo function updateHidden }); // end of extend // register xtype Ext.reg('xdatefield', Ext.ux.form.XDateField); // eof glpi-0.84.3+dfsg.1/lib/ezcomponents/000077500000000000000000000000001226600447100171135ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/000077500000000000000000000000001226600447100177655ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/CREDITS000066400000000000000000000003451226600447100210070ustar00rootroot00000000000000CREDITS ======= eZ Components team ------------------ - Sergey Alexeev - Sebastian Bergmann - Jan Borsodi - Raymond Bosman - Frederik Holljen - Kore Nordmann - Derick Rethans - Vadym Savchuk - Tobias Schlitt - Alexandru Stanoi glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/ChangeLog000066400000000000000000000272411226600447100215450ustar00rootroot000000000000001.8 - Monday 21 December 2009 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Fixed issue #15896: Autoload not working for all lowercase class names. 1.7 - Monday 29 June 2009 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - No changes 1.7rc1 - Monday 22 June 2009 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Fixed an issue with the PEAR reader as sometimes the returned structure is different. 1.7beta1 - Monday 08 June 2009 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Made sure that we (try) to load the PEAR Registry class so that PEAR doesn't have to be in autoload. 1.7alpha1 - Tuesday 26 May 2009 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Added 'SunOS' to the list of Unices to make finding binaries work on Solaris as well. - Implemented issue #13718: Include metadata about installed components that can be queried to figure out required PHP versions, dependencies and component versions. 1.6.1 - Monday 09 February 2009 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Fixed issue #14402: Auto detection of external programs (binaries) does not throw warnings anymore. 1.6 - Monday 05 January 2009 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Added a workaround for a segfault in call_user_func() in PHP 5.2.x. 1.6rc1 - Monday 15 December 2008 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Implemented issue #12542: Refactored the ezcBaseFile::findRecursive() method into the ezcBase::walkRecursive() method so that you can setup your own callbacks to "do things". The findRecursive() method is now implemented through this. - Fixed issue #14091: Incorrect documentation for ezcBaseConfigurationInitializer. 1.6beta1 - Monday 01 December 2008 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Added the exception class ezcBaseFunctionalityNotSupportedException. 1.5.2 - Monday 06 October 2008 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Fixed an issue in ezcBaseFile::removeRecursive, where the parent directory could not be written to. We now make sure nothing is deleted until we're sure everything can be deleted. 1.5.1 - Monday 04 August 2008 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Fixed issue #13370: Infinitive loop in ezcBaseFile::calculateRelativePath(). - Implemented issue #11865: Different development modes. 1.5 - Monday 16 June 2008 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - No changes. 1.5rc1 - Tuesday 10 June 2008 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - No changes 1.5beta1 - Tuesday 27 May 2008 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Added the ezcBasePersistable interface that can be used to ensure that the object implementing this interface can be used with PersistentObject and Search. 1.5alpha2 - Tuesday 13 May 2008 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Fixed a bug in ezcBaseFile::findRecursive that prevented you from passing an empty array to collect statistics. - Changed ezcBase::getInstallationPath() so that it always returns a trailing directory separator. 1.5alpha1 - Monday 07 April 2008 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Implemented issue #8529: Added a by-reference argument to ezcBaseFile::findRecursive that returns statistsics (count and total size) of all files that are returned by this function. - Implemented issue #11506: Added the static method ezcBase::getInstallationPath(). - Implemented issue #12694: replace reflection test for class type with spl function. 1.4.1 - Monday 14 January 2008 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Fixed issue #11448: ezc_bootsrap.php uses relative paths. - Fixed issue #12316: Numbers in own component prefix not possible. - Fixed issue #12329: ezcBaseFeatures::findExecutableInPath's return value does not include the extension to the executable at the end on Windows. - Added an optional argument to the ezcBaseValueException constructor to allow the exception to be used for non-property/setting type violations as well. 1.4 - Monday 17 December 2007 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - No changes. 1.4rc1 - Wednesday 05 December 2007 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - No changes. 1.4beta1 - Wednesday 28 November 2007 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - No changes. 1.4alpha2 - Monday 29 October 2007 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Added the ezcBaseFile::copyRecursive() method, to recursively copy files or directories - Fixed issue #11540: Problems with ezcFile::findRecursive and ezcFile::calculateRelativePath on systems where DIRECTORY_SEPERATOR is not //. 1.4alpha1 - Tuesday 18 September 2007 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Added the ezcBaseFile class, which was moved from the File component. - Added the ezcBaseFile::isAbsolutePath() method, which returns whether a path is absolute or relative. 1.3.1 - Monday 30 July 2007 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Fixed issue #11057: The ezcBaseConfigurationInitializer inteface is not enforced for callback classes. 1.3 - Monday 02 July 2007 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Documentation fixes and updates. 1.3rc1 - Monday 25 June 2007 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Documentation fixes and updates. 1.3beta2 - Thursday 31 May 2007 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Fixed issue #10704: Autoload fails on class not found. The exception is now off by default, but can be turned on through the "debug" property of the ezcBaseAutoloadOptions class. This option class can be set with ezcBase::setOptions(). 1.3beta1 - Monday 07 May 2007 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Fixed issue #8433: ezcBase::getRepositoryDirectories() problems. - Fixed issue #10583: ezcBaseOptions misses __isset(). - Fixed issue #10666: ezc_bootstrap.php fails on Windows. - Implemented issue #9569: Add "autoload.php" as 3rd fallback autoload file to search for. - Implemented issue #9988: Implement component preloading for better opcode cache performance. - Added exception class ezcBaseExtensionNotFoundException to be thrown when an extension is required but is not found. - Changed the ezcBaseInit::fetchConfig() method to return the value that was returned from the callback function. 1.2 - Monday 18 December 2006 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Fixed issue #9658: Checking if $_ENV['PATH'] is set before using it in ezcBaseFeatures. - Fixed issue #9780: ezcBaseFeatures throws notice about non-existing array key "PATH". - Fixed issue #9819: Let all components deal with the ezcBaseAutoloadException properly. - Fixed the exception name for 'ezcBaseDoubleClassRepositoryPrefix' - it was missing "Exception". - Implemented issue #9811: If a file for a class can not be found through autoloading, we now throw the ezcBaseAutoloadException which makes debugging easier. - Added the static method ezcBaseFeatures::findExecutableInPath() that searches the path for the given executable. - Added the static method ezcBaseFeatures::os() that returns a sanitized version of the current OS' name. 1.2beta2 - Monday 20 November 2006 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Fixed issue #8507: Two autoload directories with the same basepath don't work. - Fixed issue #9390: Classes in external repositories that map to the same autoload filename of an internal component were added to the external autoload cache array as well. 1.2beta1 - Tuesday 24 October 2006 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Added the ezcBaseFeatures class to check whether the current PHP installation and environment provides features that can be used in the components. - Added the ezcBaseInit class that assists you by setting up on-demand configurations for objects (most notable useful for singleton classes). - Implemented FR #8508: Display search paths for the autoload files in case of a missing class. - Implemented FR #8753: Added the 'Base/ezc_bootstrap.php' file which sets up the autoload environment for you to facilitate an easier way of starting to use the eZ components. 1.1.1 - Monday 28 August 2006 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Added the ezcBaseStruct class from which all structs in all components should inherit from. 1.1 - Friday 09 June 2006 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Fixed bug #8434: ezcBase autoload system does not handle classes without a prefix. - Fixed bug #8435: ezcBase::addClassRepository assumes the ezc way of structuring files. From now on the path specifying the autoload directory is *not* relative to the repository directory anymore. 1.1rc1 - Monday 29 May 2006 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Fixed bug #8252: Autoloading for external repositories only works for the first such class. 1.1beta2 - Tuesday 09 May 2006 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Added support for external class repositories. You can now add a class repository to the autoload mechanism by using the addClassRepository() method. - Added a method to return all configured class repositories. - Added the REMOVE constant to the ezcBaseFileException. - Added the ezcBaseOptions class that serves as base class for all option classes in the components. 1.1beta1 - Wednesday 19 April 2006 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Changed the way how files are included when the SVN checkout of the eZ components was used. This does not affect normal use of the components. - Fixed class descriptions for the exceptions in the documentation. 1.0 - Monday 30 January 2006 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Added HTML escaping of exception messages so that they show up correctly in a browser. The original message is stored in the originalMessage property in the exception object. 1.0rc1 - Monday 16 January 2006 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Added the ezcBaseException that all exceptions in the components library should descent from. - Added generic File and IO exceptions that all other components can use instead of having to reimplement them. - Added ezcBase::checkDependency() method that allows components to specify dependencies on either a PHP version or a PHP extension. 1.0beta2 - Wednesday 21 December 2005 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Added the ezcBasePropertyException that can be used by components to signal that an property was assigned a value which it does not allows. 1.0beta1 - Tuesday 22 November 2005 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Initial release of this package. glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/DESCRIPTION000066400000000000000000000002001226600447100214630ustar00rootroot00000000000000The Base package provides the basic infrastructure that all packages rely on. Therefore every component relies on this package. glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/review-1.5.txt000066400000000000000000000020741226600447100223330ustar00rootroot00000000000000Review Alexandru 2008-05-08 =========================== [X] Regarding feature request #8529 (a du -s implementation). The documentation for ezcBaseFile::findRecursive() says that you can supply an empty array as the 4th argument to get the statistics. If I pass for example $stats which I initialized with array() before, then I get notices: "Undefined index: count in /home/as/dev/ezcomponents/trunk/Base/src/file.php on line 139", and the same notice for index "size". Also the documentation does not mention that you need to pass a variable and not a value - if I pass array() as the 4th argument I get the error "Cannot pass parameter 4 by reference" If I pass $stats which I initialize with null, false or empty string before, then the function works. Also all the file recursive tests fail on Windows (slash issues mostly). [X] Regarding feature request #11506 (method ezcBase::getInstallationPath()). On Linux it returns the path without any slash at the end, but on Windows (Vista) it adds a Windows slash at the end. glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/000077500000000000000000000000001226600447100205545ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/base.php000066400000000000000000000533131226600447100222040ustar00rootroot00000000000000array) */ protected static $repositoryDirs = array(); /** * This variable stores all the elements from the autoload arrays. When a * new autoload file is loaded, their files are added to this array. * * @var array(string=>string) */ protected static $autoloadArray = array(); /** * This variable stores all the elements from the autoload arrays for * external repositories. When a new autoload file is loaded, their files * are added to this array. * * @var array(string=>string) */ protected static $externalAutoloadArray = array(); /** * Options for the ezcBase class. * * @var ezcBaseOptions */ static private $options; /** * Associates an option object with this static class. * * @param ezcBaseAutoloadOptions $options */ static public function setOptions( ezcBaseAutoloadOptions $options ) { self::$options = $options; } /** * Tries to autoload the given className. If the className could be found * this method returns true, otherwise false. * * This class caches the requested class names (including the ones who * failed to load). * * @param string $className The name of the class that should be loaded. * * @return bool */ public static function autoload( $className ) { ezcBase::setPackageDir(); // Check whether the classname is already in the cached autoloadArray. if ( array_key_exists( $className, ezcBase::$autoloadArray ) ) { // Is it registered as 'unloadable'? if ( ezcBase::$autoloadArray[$className] == false ) { return false; } ezcBase::loadFile( ezcBase::$autoloadArray[$className] ); return true; } // Check whether the classname is already in the cached autoloadArray // for external repositories. if ( array_key_exists( $className, ezcBase::$externalAutoloadArray ) ) { // Is it registered as 'unloadable'? if ( ezcBase::$externalAutoloadArray[$className] == false ) { return false; } ezcBase::loadExternalFile( ezcBase::$externalAutoloadArray[$className] ); return true; } // Not cached, so load the autoload from the package. // Matches the first and optionally the second 'word' from the classname. $fileNames = array(); if ( preg_match( "/^([a-z0-9]*)([A-Z][a-z0-9]*)?([A-Z][a-z0-9]*)?/", $className, $matches ) !== false ) { $autoloadFile = ""; // Try to match with both names, if available. switch ( sizeof( $matches ) ) { case 4: // check for x_y_autoload.php $autoloadFile = strtolower( "{$matches[2]}_{$matches[3]}_autoload.php" ); $fileNames[] = $autoloadFile; if ( ezcBase::requireFile( $autoloadFile, $className, $matches[1] ) ) { return true; } // break intentionally missing. case 3: // check for x_autoload.php $autoloadFile = strtolower( "{$matches[2]}_autoload.php" ); $fileNames[] = $autoloadFile; if ( ezcBase::requireFile( $autoloadFile, $className, $matches[1] ) ) { return true; } // break intentionally missing. case 2: // check for autoload.php $autoloadFile = 'autoload.php'; $fileNames[] = $autoloadFile; if ( ezcBase::requireFile( $autoloadFile, $className, $matches[1] ) ) { return true; } break; } // Maybe there is another autoload available. // Register this classname as false. ezcBase::$autoloadArray[$className] = false; } $path = ezcBase::$packageDir . 'autoload/'; $realPath = realpath( $path ); if ( $realPath == '' ) { // Can not be tested, because if this happens, then the autoload // environment has not been set-up correctly. trigger_error( "Couldn't find autoload directory '$path'", E_USER_ERROR ); } $dirs = self::getRepositoryDirectories(); if ( ezcBase::$options && ezcBase::$options->debug ) { throw new ezcBaseAutoloadException( $className, $fileNames, $dirs ); } return false; } /** * Sets the current working directory to $directory. * * @param string $directory */ public static function setWorkingDirectory( $directory ) { self::$libraryMode = 'custom'; self::$currentWorkingDirectory = $directory; } /** * Figures out the base path of the eZ Components installation. * * It stores the path that it finds in a static member variable. The path * depends on the installation method of the eZ Components. The SVN version * has a different path than the PEAR installed version. */ protected static function setPackageDir() { if ( ezcBase::$packageDir !== null ) { return; } // Get the path to the components. $baseDir = dirname( __FILE__ ); switch ( ezcBase::$libraryMode ) { case "custom": ezcBase::$packageDir = self::$currentWorkingDirectory . '/'; break; case "devel": case "tarball": ezcBase::$packageDir = $baseDir. "/../../"; break; case "pear"; ezcBase::$packageDir = $baseDir. "/../"; break; } } /** * Tries to load the autoload array and, if loaded correctly, includes the class. * * @param string $fileName Name of the autoload file. * @param string $className Name of the class that should be autoloaded. * @param string $prefix The prefix of the class repository. * * @return bool True is returned when the file is correctly loaded. * Otherwise false is returned. */ protected static function requireFile( $fileName, $className, $prefix ) { $autoloadDir = ezcBase::$packageDir . "autoload/"; // We need the full path to the fileName. The method file_exists() doesn't // automatically check the (php.ini) library paths. Therefore: // file_exists( "ezc/autoload/$fileName" ) doesn't work. if ( $prefix === 'ezc' && file_exists( "$autoloadDir$fileName" ) ) { $array = require( "$autoloadDir$fileName" ); if ( is_array( $array) && array_key_exists( $className, $array ) ) { // Add the array to the cache, and include the requested file. ezcBase::$autoloadArray = array_merge( ezcBase::$autoloadArray, $array ); if ( ezcBase::$options !== null && ezcBase::$options->preload && !preg_match( '/Exception$/', $className ) ) { foreach ( $array as $loadClassName => $file ) { if ( $loadClassName !== 'ezcBase' && !class_exists( $loadClassName, false ) && !interface_exists( $loadClassName, false ) && !preg_match( '/Exception$/', $loadClassName ) /*&& !class_exists( $loadClassName, false ) && !interface_exists( $loadClassName, false )*/ ) { ezcBase::loadFile( ezcBase::$autoloadArray[$loadClassName] ); } } } else { ezcBase::loadFile( ezcBase::$autoloadArray[$className] ); } return true; } } // It is not in components autoload/ dir. // try to search in additional dirs. foreach ( ezcBase::$repositoryDirs as $repositoryPrefix => $extraDir ) { if ( gettype( $repositoryPrefix ) === 'string' && $repositoryPrefix !== $prefix ) { continue; } if ( file_exists( $extraDir['autoloadDirPath'] . '/' . $fileName ) ) { $array = array(); $originalArray = require( $extraDir['autoloadDirPath'] . '/' . $fileName ); // Building paths. // Resulting path to class definition file consists of: // path to extra directory with autoload file + // basePath provided for current extra directory + // path to class definition file stored in autoload file. foreach ( $originalArray as $class => $classPath ) { $array[$class] = $extraDir['basePath'] . '/' . $classPath; } if ( is_array( $array ) && array_key_exists( $className, $array ) ) { // Add the array to the cache, and include the requested file. ezcBase::$externalAutoloadArray = array_merge( ezcBase::$externalAutoloadArray, $array ); ezcBase::loadExternalFile( ezcBase::$externalAutoloadArray[$className] ); return true; } } } // Nothing found :-(. return false; } /** * Loads, require(), the given file name. If we are in development mode, * "/src/" is inserted into the path. * * @param string $file The name of the file that should be loaded. */ protected static function loadFile( $file ) { switch ( ezcBase::$libraryMode ) { case "devel": case "tarball": list( $first, $second ) = explode( '/', $file, 2 ); $file = $first . "/src/" . $second; break; case "custom": list( $first, $second ) = explode( '/', $file, 2 ); // Add the "src/" after the package name. if ( $first == 'Base' || $first == 'UnitTest' ) { list( $first, $second ) = explode( '/', $file, 2 ); $file = $first . "/src/" . $second; } else { list( $first, $second, $third ) = explode( '/', $file, 3 ); $file = $first . '/' . $second . "/src/" . $third; } break; case "pear": /* do nothing, it's already correct */ break; } if ( file_exists( ezcBase::$packageDir . $file ) ) { require( ezcBase::$packageDir . $file ); } else { // Can not be tested, because if this happens, then one of the // components has a broken autoload file. throw new ezcBaseFileNotFoundException( ezcBase::$packageDir.$file ); } } /** * Loads, require(), the given file name from an external package. * * @param string $file The name of the file that should be loaded. */ protected static function loadExternalFile( $file ) { if ( file_exists( $file ) ) { require( $file ); } else { throw new ezcBaseFileNotFoundException( $file ); } } /** * Checks for dependencies on PHP versions or extensions * * The function as called by the $component component checks for the $type * dependency. The dependency $type is compared against the $value. The * function aborts the script if the dependency is not matched. * * @param string $component * @param int $type * @param mixed $value */ public static function checkDependency( $component, $type, $value ) { switch ( $type ) { case self::DEP_PHP_EXTENSION: if ( extension_loaded( $value ) ) { return; } else { // Can not be tested as it would abort the PHP script. die( "\nThe {$component} component depends on the default PHP extension '{$value}', which is not loaded.\n" ); } break; case self::DEP_PHP_VERSION: $phpVersion = phpversion(); if ( version_compare( $phpVersion, $value, '>=' ) ) { return; } else { // Can not be tested as it would abort the PHP script. die( "\nThe {$component} component depends on the PHP version '{$value}', but the current version is '{$phpVersion}'.\n" ); } break; } } /** * Return the list of directories that contain class repositories. * * The path to the eZ components directory is always included in the result * array. Each element in the returned array has the format of: * packageDirectory => ezcBaseRepositoryDirectory * * @return array(string=>ezcBaseRepositoryDirectory) */ public static function getRepositoryDirectories() { $autoloadDirs = array(); ezcBase::setPackageDir(); $repositoryDir = self::$currentWorkingDirectory ? self::$currentWorkingDirectory : ( realpath( dirname( __FILE__ ) . '/../../' ) ); $autoloadDirs['ezc'] = new ezcBaseRepositoryDirectory( ezcBaseRepositoryDirectory::TYPE_INTERNAL, $repositoryDir, $repositoryDir . "/autoload" ); foreach ( ezcBase::$repositoryDirs as $extraDirKey => $extraDirArray ) { $repositoryDirectory = new ezcBaseRepositoryDirectory( ezcBaseRepositoryDirectory::TYPE_EXTERNAL, realpath( $extraDirArray['basePath'] ), realpath( $extraDirArray['autoloadDirPath'] ) ); $autoloadDirs[$extraDirKey] = $repositoryDirectory; } return $autoloadDirs; } /** * Adds an additional class repository. * * Used for adding class repositoryies outside the eZ components to be * loaded by the autoload system. * * This function takes two arguments: $basePath is the base path for the * whole class repository and $autoloadDirPath the path where autoload * files for this repository are found. The paths in the autoload files are * relative to the package directory as specified by the $basePath * argument. I.e. class definition file will be searched at location * $basePath + path to the class definition file as stored in the autoload * file. * * addClassRepository() should be called somewhere in code before external classes * are used. * * Example: * Take the following facts: *
      *
    • there is a class repository stored in the directory "./repos"
    • *
    • autoload files for that repository are stored in "./repos/autoloads"
    • *
    • there are two components in this repository: "Me" and "You"
    • *
    • the "Me" component has the classes "erMyClass1" and "erMyClass2"
    • *
    • the "You" component has the classes "erYourClass1" and "erYourClass2"
    • *
    * * In this case you would need to create the following files in * "./repos/autoloads". Please note that the part before _autoload.php in * the filename is the first part of the classname, not considering * the all lower-case letter prefix. * * "my_autoload.php": * * 'Me/myclass1.php', * 'erMyClass2' => 'Me/myclass2.php', * ); * ?> * * * "your_autoload.php": * * 'You/yourclass1.php', * 'erYourClass2' => 'You/yourclass2.php', * ); * ?> * * * The directory structure for the external repository is then: * * ./repos/autoloads/my_autoload.php * ./repos/autoloads/you_autoload.php * ./repos/Me/myclass1.php * ./repos/Me/myclass2.php * ./repos/You/yourclass1.php * ./repos/You/yourclass2.php * * * To use this repository with the autoload mechanism you have to use the * following code: * * * * * @throws ezcBaseFileNotFoundException if $autoloadDirPath or $basePath do not exist. * @param string $basePath * @param string $autoloadDirPath * @param string $prefix */ public static function addClassRepository( $basePath, $autoloadDirPath = null, $prefix = null ) { // check if base path exists if ( !is_dir( $basePath ) ) { throw new ezcBaseFileNotFoundException( $basePath, 'base directory' ); } // calculate autoload path if it wasn't given if ( is_null( $autoloadDirPath ) ) { $autoloadDirPath = $basePath . '/autoload'; } // check if autoload dir exists if ( !is_dir( $autoloadDirPath ) ) { throw new ezcBaseFileNotFoundException( $autoloadDirPath, 'autoload directory' ); } // add info to $repositoryDirs if ( $prefix === null ) { $array = array( 'basePath' => $basePath, 'autoloadDirPath' => $autoloadDirPath ); // add info to the list of extra dirs ezcBase::$repositoryDirs[] = $array; } else { if ( array_key_exists( $prefix, ezcBase::$repositoryDirs ) ) { throw new ezcBaseDoubleClassRepositoryPrefixException( $prefix, $basePath, $autoloadDirPath ); } // add info to the list of extra dirs, and use the prefix to identify the new repository. ezcBase::$repositoryDirs[$prefix] = array( 'basePath' => $basePath, 'autoloadDirPath' => $autoloadDirPath ); } } /** * Returns the base path of the eZ Components installation * * This method returns the base path, including a trailing directory * separator. * * @return string */ public static function getInstallationPath() { self::setPackageDir(); $path = realpath( self::$packageDir ); if ( substr( $path, -1 ) !== DIRECTORY_SEPARATOR ) { $path .= DIRECTORY_SEPARATOR; } return $path; } /** * Sets the development mode to the one specified. * * @param int $runMode */ public static function setRunMode( $runMode ) { if ( !in_array( $runMode, array( ezcBase::MODE_PRODUCTION, ezcBase::MODE_DEVELOPMENT ) ) ) { throw new ezcBaseValueException( 'runMode', $runMode, 'ezcBase::MODE_PRODUCTION or ezcBase::MODE_DEVELOPMENT' ); } self::$runMode = $runMode; } /** * Returns the current development mode. * * @return int */ public static function getRunMode() { return self::$runMode; } /** * Returns true when we are in development mode. * * @return bool */ public static function inDevMode() { return self::$runMode == ezcBase::MODE_DEVELOPMENT; } /** * Returns the installation method * * Possible return values are 'custom', 'devel', 'tarball' and 'pear'. Only * 'tarball' and 'pear' are returned for user-installed versions. * * @return string */ public static function getInstallMethod() { return self::$libraryMode; } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/exceptions/000077500000000000000000000000001226600447100227355ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/exceptions/autoload.php000066400000000000000000000021621226600447100252570ustar00rootroot00000000000000autoloadPath ); } parent::__construct( "Could not find a class to file mapping for '{$className}'. Searched for ". implode( ', ', $files ) . " in: " . implode( ', ', $paths ) ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/exceptions/double_class_repository_prefix.php000066400000000000000000000021211226600447100317550ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/exceptions/exception.php000066400000000000000000000016451226600447100254520ustar00rootroot00000000000000originalMessage = $message; if ( php_sapi_name() == 'cli' ) { parent::__construct( $message ); } else { parent::__construct( htmlspecialchars( $message ) ); } } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/exceptions/extension_not_found.php000066400000000000000000000020611226600447100275340ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/exceptions/file_exception.php000066400000000000000000000010501226600447100264370ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/exceptions/file_io.php000066400000000000000000000027201226600447100250550ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/exceptions/file_not_found.php000066400000000000000000000021051226600447100264360ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/exceptions/file_permission.php000066400000000000000000000042451226600447100266420ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/exceptions/functionality_not_supported.php000066400000000000000000000014711226600447100313260ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/exceptions/init_callback_configured.php000066400000000000000000000016521226600447100304360ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/exceptions/invalid_callback_class.php000066400000000000000000000015541226600447100301020ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/exceptions/invalid_parent_class.php000066400000000000000000000015001226600447100276260ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/exceptions/property_not_found.php000066400000000000000000000013641226600447100274110ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/exceptions/property_permission.php000066400000000000000000000021411226600447100276000ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/exceptions/setting_not_found.php000066400000000000000000000015171226600447100272020ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/exceptions/setting_value.php000066400000000000000000000025261226600447100263240ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/exceptions/value.php000066400000000000000000000027011226600447100245620ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/exceptions/whatever.php000066400000000000000000000024061226600447100252750ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/ezc_bootstrap.php000066400000000000000000000021741226600447100241470ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/features.php000066400000000000000000000256321226600447100231130ustar00rootroot00000000000000 * * * * @package Base * @version 1.8 */ class ezcBaseFeatures { /** * Used to store the path of the ImageMagick convert utility. * * It is initialized in the {@link getImageConvertExecutable()} function. * * @var string */ private static $imageConvert = null; /** * Used to store the path of the ImageMagick identify utility. * * It is initialized in the {@link getImageIdentifyExecutable()} function. * * @var string */ private static $imageIdentify = null; /** * Used to store the operating system. * * It is initialized in the {@link os()} function. * * @var string */ private static $os = null; /** * Determines if hardlinks are supported. * * @return bool */ public static function supportsLink() { return function_exists( 'link' ); } /** * Determines if symlinks are supported. * * @return bool */ public static function supportsSymLink() { return function_exists( 'symlink' ); } /** * Determines if posix uids are supported. * * @return bool */ public static function supportsUserId() { return function_exists( 'posix_getpwuid' ); } /** * Determines if the ImageMagick convert utility is installed. * * @return bool */ public static function hasImageConvert() { return !is_null( self::getImageConvertExecutable() ); } /** * Returns the path to the ImageMagick convert utility. * * On Linux, Unix,... it will return something like: /usr/bin/convert * On Windows it will return something like: C:\Windows\System32\convert.exe * * @return string */ public static function getImageConvertExecutable() { if ( !is_null( self::$imageConvert ) ) { return self::$imageConvert; } return ( self::$imageConvert = self::findExecutableInPath( 'convert' ) ); } /** * Determines if the ImageMagick identify utility is installed. * * @return bool */ public static function hasImageIdentify() { return !is_null( self::getImageIdentifyExecutable() ); } /** * Returns the path to the ImageMagick identify utility. * * On Linux, Unix,... it will return something like: /usr/bin/identify * On Windows it will return something like: C:\Windows\System32\identify.exe * * @return string */ public static function getImageIdentifyExecutable() { if ( !is_null( self::$imageIdentify ) ) { return self::$imageIdentify; } return ( self::$imageIdentify = self::findExecutableInPath( 'identify' ) ); } /** * Determines if the specified extension is loaded. * * If $version is specified, the specified extension will be tested also * against the version of the loaded extension. * * Examples: * * hasExtensionSupport( 'gzip' ); * * will return true if gzip extension is loaded. * * * hasExtensionSupport( 'pdo_mysql', '1.0.2' ); * * will return true if pdo_mysql extension is loaded and its version is at least 1.0.2. * * @param string $extension * @param string $version * @return bool */ public static function hasExtensionSupport( $extension, $version = null ) { if ( is_null( $version ) ) { return extension_loaded( $extension ); } return extension_loaded( $extension ) && version_compare( phpversion( $extension ), $version, ">=" ) ; } /** * Determines if the specified function is available. * * Examples: * * ezcBaseFeatures::hasFunction( 'imagepstext' ); * * will return true if support for Type 1 fonts is available with your GD * extension. * * @param string $functionName * @return bool */ public static function hasFunction( $functionName ) { return function_exists( $functionName ); } /** * Returns if a given class exists. * Checks for a given class name and returns if this class exists or not. * Catches the ezcBaseAutoloadException and returns false, if it was thrown. * * @param string $className The class to check for. * @param bool $autoload True to use __autoload(), otherwise false. * @return bool True if the class exists. Otherwise false. */ public static function classExists( $className, $autoload = true ) { try { if ( class_exists( $className, $autoload ) ) { return true; } return false; } catch ( ezcBaseAutoloadException $e ) { return false; } } /** * Returns the operating system on which PHP is running. * * This method returns a sanitized form of the OS name, example * return values are "Windows", "Mac", "Linux" and "FreeBSD". In * all other cases it returns the value of the internal PHP constant * PHP_OS. * * @return string */ public static function os() { if ( is_null( self::$os ) ) { $uname = php_uname( 's' ); if ( substr( $uname, 0, 7 ) == 'Windows' ) { self::$os = 'Windows'; } elseif ( substr( $uname, 0, 3 ) == 'Mac' ) { self::$os = 'Mac'; } elseif ( strtolower( $uname ) == 'linux' ) { self::$os = 'Linux'; } elseif ( strtolower( substr( $uname, 0, 7 ) ) == 'freebsd' ) { self::$os = 'FreeBSD'; } else { self::$os = PHP_OS; } } return self::$os; } /** * Returns the path of the specified executable, if it can be found in the system's path. * * It scans the PATH enviroment variable based on the OS to find the * $fileName. For Windows, the path is with \, not /. If $fileName is not * found, it returns null. * * @todo consider using getenv( 'PATH' ) instead of $_ENV['PATH'] * (but that won't work under IIS) * * @param string $fileName * @return string */ public static function findExecutableInPath( $fileName ) { if ( array_key_exists( 'PATH', $_ENV ) ) { $envPath = trim( $_ENV['PATH'] ); } else if ( ( $envPath = getenv( 'PATH' ) ) !== false ) { $envPath = trim( $envPath ); } if ( is_string( $envPath ) && strlen( trim( $envPath ) ) == 0 ) { $envPath = false; } switch ( self::os() ) { case 'Unix': case 'FreeBSD': case 'Mac': case 'MacOS': case 'Darwin': case 'Linux': case 'SunOS': if ( $envPath ) { $dirs = explode( ':', $envPath ); foreach ( $dirs as $dir ) { // The @-operator is used here mainly to avoid // open_basedir warnings. If open_basedir (or any other // circumstance) prevents the desired file from being // accessed, it is fine for file_exists() to return // false, since it is useless for use then, anyway. if ( file_exists( "{$dir}/{$fileName}" ) ) { return "{$dir}/{$fileName}"; } } } // The @-operator is used here mainly to avoid open_basedir // warnings. If open_basedir (or any other circumstance) // prevents the desired file from being accessed, it is fine // for file_exists() to return false, since it is useless for // use then, anyway. elseif ( @file_exists( "./{$fileName}" ) ) { return $fileName; } break; case 'Windows': if ( $envPath ) { $dirs = explode( ';', $envPath ); foreach ( $dirs as $dir ) { // The @-operator is used here mainly to avoid // open_basedir warnings. If open_basedir (or any other // circumstance) prevents the desired file from being // accessed, it is fine for file_exists() to return // false, since it is useless for use then, anyway. if ( @file_exists( "{$dir}\\{$fileName}.exe" ) ) { return "{$dir}\\{$fileName}.exe"; } } } // The @-operator is used here mainly to avoid open_basedir // warnings. If open_basedir (or any other circumstance) // prevents the desired file from being accessed, it is fine // for file_exists() to return false, since it is useless for // use then, anyway. elseif ( @file_exists( "{$fileName}.exe" ) ) { return "{$fileName}.exe"; } break; } return null; } /** * Reset the cached information. * * @return void * @access private * @ignore */ public static function reset() { self::$imageIdentify = null; self::$imageConvert = null; self::$os = null; } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/file.php000066400000000000000000000425211226600447100222100ustar00rootroot00000000000000 * * * * @package Base * @version 1.8 * @mainclass */ class ezcBaseFile { /** * This is the callback used by findRecursive to collect data. * * This callback method works together with walkRecursive() and is called * for every file/and or directory. The $context is a callback specific * container in which data can be stored and shared between the different * calls to the callback function. The walkRecursive() function also passes * in the full absolute directory in $sourceDir, the filename in $fileName * and file information (such as size, modes, types) as an array as * returned by PHP's stat() in the $fileInfo parameter. * * @param ezcBaseFileFindContext $context * @param string $sourceDir * @param string $fileName * @param array(stat) $fileInfo */ static protected function findRecursiveCallback( ezcBaseFileFindContext $context, $sourceDir, $fileName, $fileInfo ) { // ignore if we have a directory if ( $fileInfo['mode'] & 0x4000 ) { return; } // update the statistics $context->elements[] = $sourceDir . DIRECTORY_SEPARATOR . $fileName; $context->count++; $context->size += $fileInfo['size']; } /** * Walks files and directories recursively on a file system * * This method walks over a directory and calls a callback from every file * and directory it finds. You can use $includeFilters to include only * specific files, and $excludeFilters to exclude certain files from being * returned. The function will always go into subdirectories even if the * entry would not have passed the filters. * * The callback is passed in the $callback parameter, and the * $callbackContext will be send to the callback function/method as * parameter so that you can store data in there that persists with all the * calls and recursive calls to this method. It's up to the callback method * to do something useful with this. The callback function's parameters are * in order: * *
      *
    • ezcBaseFileFindContext $context
    • *
    • string $sourceDir
    • *
    • string $fileName
    • *
    • array(stat) $fileInfo
    • *
    * * See {@see findRecursiveCallback()} for an example of a callback function. * * Filters are regular expressions and are therefore required to have * starting and ending delimiters. The Perl Compatible syntax is used as * regular expression language. * * @param string $sourceDir * @param array(string) $includeFilters * @param array(string) $excludeFilters * @param callback $callback * @param mixed $callbackContext * * @throws ezcBaseFileNotFoundException if the $sourceDir directory is not * a directory or does not exist. * @throws ezcBaseFilePermissionException if the $sourceDir directory could * not be opened for reading. * @return array */ static public function walkRecursive( $sourceDir, array $includeFilters = array(), array $excludeFilters = array(), $callback, &$callbackContext ) { if ( !is_dir( $sourceDir ) ) { throw new ezcBaseFileNotFoundException( $sourceDir, 'directory' ); } $elements = array(); $d = @dir( $sourceDir ); if ( !$d ) { throw new ezcBaseFilePermissionException( $sourceDir, ezcBaseFileException::READ ); } while ( ( $entry = $d->read() ) !== false ) { if ( $entry == '.' || $entry == '..' ) { continue; } $fileInfo = @stat( $sourceDir . DIRECTORY_SEPARATOR . $entry ); if ( !$fileInfo ) { $fileInfo = array( 'size' => 0, 'mode' => 0 ); } if ( $fileInfo['mode'] & 0x4000 ) { // We need to ignore the Permission exceptions here as it can // be normal that a directory can not be accessed. We only need // the exception if the top directory could not be read. try { call_user_func_array( $callback, array( $callbackContext, $sourceDir, $entry, $fileInfo ) ); $subList = self::walkRecursive( $sourceDir . DIRECTORY_SEPARATOR . $entry, $includeFilters, $excludeFilters, $callback, $callbackContext ); $elements = array_merge( $elements, $subList ); } catch ( ezcBaseFilePermissionException $e ) { } } else { // By default a file is included in the return list $ok = true; // Iterate over the $includeFilters and prohibit the file from // being returned when atleast one of them does not match foreach ( $includeFilters as $filter ) { if ( !preg_match( $filter, $sourceDir . DIRECTORY_SEPARATOR . $entry ) ) { $ok = false; break; } } // Iterate over the $excludeFilters and prohibit the file from // being returns when atleast one of them matches foreach ( $excludeFilters as $filter ) { if ( preg_match( $filter, $sourceDir . DIRECTORY_SEPARATOR . $entry ) ) { $ok = false; break; } } // If everything's allright, call the callback and add the // entry to the elements array if ( $ok ) { call_user_func( $callback, $callbackContext, $sourceDir, $entry, $fileInfo ); $elements[] = $sourceDir . DIRECTORY_SEPARATOR . $entry; } } } sort( $elements ); return $elements; } /** * Finds files recursively on a file system * * With this method you can scan the file system for files. You can use * $includeFilters to include only specific files, and $excludeFilters to * exclude certain files from being returned. The function will always go * into subdirectories even if the entry would not have passed the filters. * It uses the {@see walkRecursive()} method to do the actually recursion. * * Filters are regular expressions and are therefore required to have * starting and ending delimiters. The Perl Compatible syntax is used as * regular expression language. * * If you pass an empty array to the $statistics argument, the function * will in details about the number of files found into the 'count' array * element, and the total filesize in the 'size' array element. Because this * argument is passed by reference, you *have* to pass a variable and you * can not pass a constant value such as "array()". * * @param string $sourceDir * @param array(string) $includeFilters * @param array(string) $excludeFilters * @param array() $statistics * * @throws ezcBaseFileNotFoundException if the $sourceDir directory is not * a directory or does not exist. * @throws ezcBaseFilePermissionException if the $sourceDir directory could * not be opened for reading. * @return array */ static public function findRecursive( $sourceDir, array $includeFilters = array(), array $excludeFilters = array(), &$statistics = null ) { // init statistics array if ( !is_array( $statistics ) || !array_key_exists( 'size', $statistics ) || !array_key_exists( 'count', $statistics ) ) { $statistics['size'] = 0; $statistics['count'] = 0; } // create the context, and then start walking over the array $context = new ezcBaseFileFindContext; self::walkRecursive( $sourceDir, $includeFilters, $excludeFilters, array( 'ezcBaseFile', 'findRecursiveCallback' ), $context ); // collect the statistics $statistics['size'] = $context->size; $statistics['count'] = $context->count; // return the found and pattern-matched files sort( $context->elements ); return $context->elements; } /** * Removes files and directories recursively from a file system * * This method recursively removes the $directory and all its contents. * You should be extremely careful with this method as it has the * potential to erase everything that the current user has access to. * * @param string $directory */ static public function removeRecursive( $directory ) { $sourceDir = realpath( $directory ); if ( !$sourceDir ) { throw new ezcBaseFileNotFoundException( $directory, 'directory' ); } $d = @dir( $sourceDir ); if ( !$d ) { throw new ezcBaseFilePermissionException( $directory, ezcBaseFileException::READ ); } // check if we can remove the dir $parentDir = realpath( $directory . DIRECTORY_SEPARATOR . '..' ); if ( !is_writable( $parentDir ) ) { throw new ezcBaseFilePermissionException( $parentDir, ezcBaseFileException::WRITE ); } // loop over contents while ( ( $entry = $d->read() ) !== false ) { if ( $entry == '.' || $entry == '..' ) { continue; } if ( is_dir( $sourceDir . DIRECTORY_SEPARATOR . $entry ) ) { self::removeRecursive( $sourceDir . DIRECTORY_SEPARATOR . $entry ); } else { if ( @unlink( $sourceDir . DIRECTORY_SEPARATOR . $entry ) === false ) { throw new ezcBaseFilePermissionException( $directory . DIRECTORY_SEPARATOR . $entry, ezcBaseFileException::REMOVE ); } } } $d->close(); rmdir( $sourceDir ); } /** * Recursively copy a file or directory. * * Recursively copy a file or directory in $source to the given * destination. If a depth is given, the operation will stop, if the given * recursion depth is reached. A depth of -1 means no limit, while a depth * of 0 means, that only the current file or directory will be copied, * without any recursion. * * You may optionally define modes used to create files and directories. * * @throws ezcBaseFileNotFoundException * If the $sourceDir directory is not a directory or does not exist. * @throws ezcBaseFilePermissionException * If the $sourceDir directory could not be opened for reading, or the * destination is not writeable. * * @param string $source * @param string $destination * @param int $depth * @param int $dirMode * @param int $fileMode * @return void */ static public function copyRecursive( $source, $destination, $depth = -1, $dirMode = 0775, $fileMode = 0664 ) { // Check if source file exists at all. if ( !is_file( $source ) && !is_dir( $source ) ) { throw new ezcBaseFileNotFoundException( $source ); } // Destination file should NOT exist if ( is_file( $destination ) || is_dir( $destination ) ) { throw new ezcBaseFilePermissionException( $destination, ezcBaseFileException::WRITE ); } // Skip non readable files in source directory if ( !is_readable( $source ) ) { return; } // Copy if ( is_dir( $source ) ) { mkdir( $destination ); // To ignore umask, umask() should not be changed with // multithreaded servers... chmod( $destination, $dirMode ); } elseif ( is_file( $source ) ) { copy( $source, $destination ); chmod( $destination, $fileMode ); } if ( ( $depth === 0 ) || ( !is_dir( $source ) ) ) { // Do not recurse (any more) return; } // Recurse $dh = opendir( $source ); while ( ( $file = readdir( $dh ) ) !== false ) { if ( ( $file === '.' ) || ( $file === '..' ) ) { continue; } self::copyRecursive( $source . '/' . $file, $destination . '/' . $file, $depth - 1, $dirMode, $fileMode ); } } /** * Calculates the relative path of the file/directory '$path' to a given * $base path. * * $path and $base should be fully absolute paths. This function returns the * answer of "How do I go from $base to $path". If the $path and $base are * the same path, the function returns '.'. This method does not touch the * filesystem. * * @param string $path * @param string $base * @return string */ static public function calculateRelativePath( $path, $base ) { // Sanitize the paths to use the correct directory separator for the platform $path = strtr( $path, '\\/', DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR ); $base = strtr( $base, '\\/', DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR ); $base = explode( DIRECTORY_SEPARATOR, $base ); $path = explode( DIRECTORY_SEPARATOR, $path ); // If the paths are the same we return if ( $base === $path ) { return '.'; } $result = ''; $pathPart = array_shift( $path ); $basePart = array_shift( $base ); while ( $pathPart == $basePart ) { $pathPart = array_shift( $path ); $basePart = array_shift( $base ); } if ( $pathPart != null ) { array_unshift( $path, $pathPart ); } if ( $basePart != null ) { array_unshift( $base, $basePart ); } $result = str_repeat( '..' . DIRECTORY_SEPARATOR, count( $base ) ); // prevent a trailing DIRECTORY_SEPARATOR in case there is only a .. if ( count( $path ) == 0 ) { $result = substr( $result, 0, -strlen( DIRECTORY_SEPARATOR ) ); } $result .= join( DIRECTORY_SEPARATOR, $path ); return $result; } /** * Returns whether the passed $path is an absolute path, giving the current $os. * * With the $os parameter you can tell this function to use the semantics * for a different operating system to determine whether a path is * absolute. The $os argument defaults to the OS that the script is running * on. * * @param string $path * @param string $os * @return bool */ public static function isAbsolutePath( $path, $os = null ) { if ( $os === null ) { $os = ezcBaseFeatures::os(); } // Stream wrapper like phar can also be considered absolute paths if ( preg_match( '(^[a-z]{3,}://)S', $path ) ) { return true; } switch ( $os ) { case 'Windows': // Sanitize the paths to use the correct directory separator for the platform $path = strtr( $path, '\\/', '\\\\' ); // Absolute paths with drive letter: X:\ if ( preg_match( '@^[A-Z]:\\\\@i', $path ) ) { return true; } // Absolute paths with network paths: \\server\share\ if ( preg_match( '@^\\\\\\\\[A-Z]+\\\\[^\\\\]@i', $path ) ) { return true; } break; case 'Mac': case 'Linux': case 'FreeBSD': default: // Sanitize the paths to use the correct directory separator for the platform $path = strtr( $path, '\\/', '//' ); if ( $path[0] == '/' ) { return true; } } return false; } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/init.php000066400000000000000000000101131226600447100222240ustar00rootroot00000000000000 * * * * You will also need to configure which callback class to call. This you do * with the ezcBaseInit::setCallback() method. The following examples sets the * callback classname for the configuration identifier * 'ezcInitConfigurationManager' to 'cfgConfigurationManager': * * * * * * The class 'cfgConfigurationManager' is required to implement the * ezcBaseConfigurationInitializer interface, which defines only one method: * configureObject(). An example on how to implement such a class could be: * * * init( 'ezcConfigurationIniReader', 'settings', array( 'useComments' => true ) ); * } * } * ?> * * * Of course the implementation of this callback class is up to the application * developer that uses the component (in this example the Configuration * component's class ezcConfigurationManager). * * @package Base * @version 1.8 */ class ezcBaseInit { /** * Contains the callback where the identifier is the key of the array, and the classname to callback to the value. * * @var array(string=>string) */ static private $callbackMap = array(); /** * Adds the classname $callbackClassname as callback for the identifier $identifier. * * @param string $identifier * @param string $callbackClassname */ public static function setCallback( $identifier, $callbackClassname ) { if ( array_key_exists( $identifier, self::$callbackMap ) ) { throw new ezcBaseInitCallbackConfiguredException( $identifier, self::$callbackMap[$identifier] ); } else { // Check if the passed classname actually exists if ( !ezcBaseFeatures::classExists( $callbackClassname, true ) ) { throw new ezcBaseInitInvalidCallbackClassException( $callbackClassname ); } // Check if the passed classname actually implements the interface. if ( !in_array( 'ezcBaseConfigurationInitializer', class_implements( $callbackClassname ) ) ) { throw new ezcBaseInitInvalidCallbackClassException( $callbackClassname ); } self::$callbackMap[$identifier] = $callbackClassname; } } /** * Uses the configured callback belonging to $identifier to configure the $object. * * The method will return the return value of the callback method, or null * in case there was no callback set for the specified $identifier. * * @param string $identifier * @param object $object * @return mixed */ public static function fetchConfig( $identifier, $object ) { if ( isset( self::$callbackMap[$identifier] ) ) { $callbackClassname = self::$callbackMap[$identifier]; return call_user_func( array( $callbackClassname, 'configureObject' ), $object ); } return null; } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/interfaces/000077500000000000000000000000001226600447100226775ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/interfaces/configuration_initializer.php000066400000000000000000000016061226600447100306650ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/interfaces/exportable.php000066400000000000000000000016521226600447100255610ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/interfaces/persistable.php000066400000000000000000000017661226600447100257370ustar00rootroot00000000000000mixed) */ public function getState(); /** * Accepts an array containing data for one or more of the class' properties. * * @param array $properties */ public function setState( array $properties ); } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/metadata.php000066400000000000000000000066641226600447100230610ustar00rootroot00000000000000reader = new ezcBaseMetaDataTarballReader; break; case 'pear': $this->reader = new ezcBaseMetaDataPearReader; break; default: throw new ezcBaseMetaDataReaderException( "Unknown install method '$installMethod'." ); break; } } /** * Returns the version string for the installed eZ Components bundle. * * A version string such as "2008.2.2" is returned. * * @return string */ public function getBundleVersion() { return $this->reader->getBundleVersion(); } /** * Returns a PHP version string that describes the required PHP version for * this installed eZ Components bundle. * * @return string */ public function getRequiredPhpVersion() { return $this->reader->getRequiredPhpVersion(); } /** * Returns whether $componentName is installed * * If installed with PEAR, it checks the PEAR registry whether the * component is there. In case the tarball installation method is used, it * will return true for every component that exists (because all of them * are then available). * * @return bool */ public function isComponentInstalled( $componentName ) { return $this->reader->isComponentInstalled( $componentName ); } /** * Returns the version string of the available $componentName or false when * the component is not installed. * * @return string */ public function getComponentVersion( $componentName ) { return $this->reader->getComponentVersion( $componentName ); } /** * Returns a list of components that $componentName depends on. * * If $componentName is left empty, all installed components are returned. * * The returned array has as keys the component names, and as values the * version of the components. * * @return array(string=>string). */ public function getComponentDependencies( $componentName = null ) { if ( $componentName === null ) { return $this->reader->getComponentDependencies(); } else { return $this->reader->getComponentDependencies( $componentName ); } } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/metadata/000077500000000000000000000000001226600447100223345ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/metadata/pear.php000066400000000000000000000074111226600447100237770ustar00rootroot00000000000000registry = new PEAR_Registry; } /** * Returns the version string for the installed eZ Components bundle. * * A version string such as "2008.2.2" is returned. * * @return string */ public function getBundleVersion() { @$packageInfo = $this->registry->packageInfo( 'ezcomponents', null, 'components.ez.no' ); return $packageInfo['version']['release']; } /** * Returns a PHP version string that describes the required PHP version for * this installed eZ Components bundle. * * @return string */ public function getRequiredPhpVersion() { @$packageInfo = $this->registry->packageInfo( 'ezcomponents', null, 'components.ez.no' ); if ( array_key_exists( 'required', $packageInfo['dependencies'] ) ) { return $packageInfo['dependencies']['required']['php']['min']; } return $packageInfo['dependencies']['php']['min']; } /** * Returns whether $componentName is installed * * Checks the PEAR registry whether the component is there. * * @return bool */ public function isComponentInstalled( $componentName ) { @$packageInfo = $this->registry->packageInfo( $componentName, null, 'components.ez.no' ); return is_array( $packageInfo ); } /** * Returns the version string of the available $componentName or false when * the component is not installed. * * @return string */ public function getComponentVersion( $componentName ) { @$packageInfo = $this->registry->packageInfo( $componentName, null, 'components.ez.no' ); $release = $packageInfo['version']['release']; return $release === null ? false : $release; } /** * Returns a list of components that $componentName depends on. * * If $componentName is left empty, all installed components are returned. * * The returned array has as keys the component names, and as values the * version of the components. * * @return array(string=>string). */ public function getComponentDependencies( $componentName = 'ezcomponents' ) { @$packageInfo = $this->registry->packageInfo( $componentName, 'dependencies', 'components.ez.no' ); if ( isset( $packageInfo['required']['package'] ) ) { $deps = array(); if ( isset( $packageInfo['required']['package']['name'] ) ) { $deps[$packageInfo['required']['package']['name']] = $packageInfo['required']['package']['min']; } else { foreach ( $packageInfo['required']['package'] as $package ) { $deps[$package['name']] = $package['min']; } } return $deps; } return array(); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/metadata/tarball.php000066400000000000000000000100061226600447100244630ustar00rootroot00000000000000xml = simplexml_load_file( $filename ); } /** * Returns the version string for the installed eZ Components bundle. * * A version string such as "2008.2.2" is returned. * * @return string */ public function getBundleVersion() { return (string) $this->xml->version; } /** * Returns a PHP version string that describes the required PHP version for * this installed eZ Components bundle. * * @return string */ public function getRequiredPhpVersion() { return (string) $this->xml->deps->php; } /** * Returns whether $componentName is installed * * Returns true for every component that exists (because all of them are * then available). * * @return bool */ public function isComponentInstalled( $componentName ) { $root = $this->xml->deps->packages->package; foreach ( $root as $package ) { if ( (string) $package['name'] == $componentName ) { return true; } } return false; } /** * Returns the version string of the available $componentName or false when * the component is not installed. * * @return string */ public function getComponentVersion( $componentName ) { $root = $this->xml->deps->packages->package; foreach ( $root as $package ) { if ( (string) $package['name'] == $componentName ) { return (string) $package['version']; } } return false; } /** * Returns a list of components that $componentName depends on. * * If $componentName is left empty, all installed components are returned. * * The returned array has as keys the component names, and as values the * version of the components. It returns null of the $componentName * is not found. * * @return array(string=>string). */ public function getComponentDependencies( $componentName = null ) { $baseVersion = false; $root = $this->xml->deps->packages; $found = $componentName === null ? true : false; // in case $componentName != null, we loop through all the components // in the file, and figure out the new root that we can list dependency // packages from. foreach ( $root->package as $package ) { if ( (string) $package['name'] == 'Base' ) { $baseVersion = $package['version']; } if ( !$found && (string) $package['name'] == $componentName ) { $root = $package->deps; $found = true; } } if ( !$found ) { return null; } // We always add the Base dependency even though it's not in the dependency file. $deps = array(); $deps['Base'] = (string) $baseVersion; if ( !isset( $root->package ) ) { return $deps; } foreach ( $root->package as $package ) { $deps[(string) $package['name']] = (string) $package['version']; } return $deps; } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/options.php000066400000000000000000000123551226600447100227660ustar00rootroot00000000000000mixed) */ protected $properties; /** * Construct a new options object. * Options are constructed from an option array by default. The constructor * automatically passes the given options to the __set() method to set them * in the class. * * @throws ezcBasePropertyNotFoundException * If trying to access a non existent property. * @throws ezcBaseValueException * If the value for a property is out of range. * @param array(string=>mixed) $options The initial options to set. */ public function __construct( array $options = array() ) { foreach ( $options as $option => $value ) { $this->__set( $option, $value ); } } /** * Merge an array into the actual options object. * This method merges an array of new options into the actual options object. * * @throws ezcBasePropertyNotFoundException * If trying to access a non existent property. * @throws ezcBaseValueException * If the value for a property is out of range. * @param array(string=>mixed) $newOptions The new options. */ public function merge( array $newOptions ) { foreach ( $newOptions as $key => $value ) { $this->__set( $key, $value ); } } /** * Property get access. * Simply returns a given option. * * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @param string $propertyName The name of the option to get. * @return mixed The option value. * @ignore * * @throws ezcBasePropertyNotFoundException * if the given property does not exist. * @throws ezcBasePropertyPermissionException * if the property to be set is a write-only property. */ public function __get( $propertyName ) { if ( $this->__isset( $propertyName ) === true ) { return $this->properties[$propertyName]; } throw new ezcBasePropertyNotFoundException( $propertyName ); } /** * Sets an option. * This method is called when an option is set. * * @param string $propertyName The name of the option to set. * @param mixed $propertyValue The option value. * @ignore * * @throws ezcBasePropertyNotFoundException * if the given property does not exist. * @throws ezcBaseValueException * if the value to be assigned to a property is invalid. * @throws ezcBasePropertyPermissionException * if the property to be set is a read-only property. */ abstract public function __set( $propertyName, $propertyValue ); /** * Returns if a option exists. * * @param string $propertyName Option name to check for. * @return bool Whether the option exists. * @ignore */ public function __isset( $propertyName ) { return array_key_exists( $propertyName, $this->properties ); } /** * Returns if an option exists. * Allows isset() using ArrayAccess. * * @param string $propertyName The name of the option to get. * @return bool Whether the option exists. */ public function offsetExists( $propertyName ) { return $this->__isset( $propertyName ); } /** * Returns an option value. * Get an option value by ArrayAccess. * * @throws ezcBasePropertyNotFoundException * If $propertyName is not a key in the $properties array. * @param string $propertyName The name of the option to get. * @return mixed The option value. */ public function offsetGet( $propertyName ) { return $this->__get( $propertyName ); } /** * Set an option. * Sets an option using ArrayAccess. * * @throws ezcBasePropertyNotFoundException * If $propertyName is not a key in the $properties array. * @throws ezcBaseValueException * If the value for a property is out of range. * @param string $propertyName The name of the option to set. * @param mixed $propertyValue The value for the option. */ public function offsetSet( $propertyName, $propertyValue ) { $this->__set( $propertyName, $propertyValue ); } /** * Unset an option. * Unsets an option using ArrayAccess. * * @throws ezcBasePropertyNotFoundException * If $propertyName is not a key in the $properties array. * @throws ezcBaseValueException * If a the value for a property is out of range. * @param string $propertyName The name of the option to unset. */ public function offsetUnset( $propertyName ) { $this->__set( $propertyName, null ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/options/000077500000000000000000000000001226600447100222475ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/options/autoload.php000066400000000000000000000043751226600447100246010ustar00rootroot00000000000000mixed) $options */ public function __construct( array $options = array() ) { $this->preload = false; $this->debug = false; parent::__construct( $options ); } /** * Sets the option $name to $value. * * @throws ezcBasePropertyNotFoundException * if the property $name is not defined * @throws ezcBaseValueException * if $value is not correct for the property $name * @param string $name * @param mixed $value * @ignore */ public function __set( $name, $value ) { switch ( $name ) { case 'debug': case 'preload': if ( !is_bool( $value ) ) { throw new ezcBaseValueException( $name, $value, 'bool' ); } $this->properties[$name] = $value; break; default: throw new ezcBasePropertyNotFoundException( $name ); } } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/struct.php000066400000000000000000000014641226600447100226160ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/structs/000077500000000000000000000000001226600447100222635ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/structs/file_find_context.php000066400000000000000000000032521226600447100264610ustar00rootroot00000000000000elements = $elements; $this->count = $count; $this->size = $size; } /** * Returns a new instance of this class with the data specified by $array. * * $array contains all the data members of this class in the form: * array('member_name'=>value). * * __set_state makes this class exportable with var_export. * var_export() generates code, that calls this method when it * is parsed with PHP. * * @param array(string=>mixed) $array * @return ezcBaseFileFindContext */ static public function __set_state( array $array ) { return new ezcBaseFileFindContext( $array['elements'], $array['count'], $array['size'] ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Base/src/structs/repository_directory.php000066400000000000000000000040141226600447100272760ustar00rootroot00000000000000type = $type; $this->basePath = $basePath; $this->autoloadPath = $autoloadPath; } /** * Returns a new instance of this class with the data specified by $array. * * $array contains all the data members of this class in the form: * array('member_name'=>value). * * __set_state makes this class exportable with var_export. * var_export() generates code, that calls this method when it * is parsed with PHP. * * @param array(string=>mixed) $array * @return ezcBaseRepositoryDirectory */ static public function __set_state( array $array ) { return new ezcBaseRepositoryDirectory( $array['type'], $array['basePath'], $array['autoloadPath'] ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/FreeSans.ttf000066400000000000000000000546241226600447100213530ustar00rootroot00000000000000pGDEF H(*GPOSIPBGSUB HTOS/2g?xVcmapב=cvt !yxgaspH glyfXA7head6hhea4$hmtxU Iloca,|maxpX names?ipostFFH_< D؉D؉==xfI@33f 'PfEd@ ffÀ99jrrD;VjbNRf9^99rXrrFrBr9rHrXr^rLrN99\ffrFV#VbV9Z9#Vr9NV9NVb+V=-V-V9999/Zr-rVro?r5rR9%r;rwrrJror5F9r #)?X;99rjr5rrrX=LrR^95f'!rKb9P}Rr}}!rV#V#V#V#V#V#bVVVV9999)9N9N9N9N9N9=VSrVrVrVrVrVrVF?rRrRrRrR9999rJrrJrJrJrJrJf%rrrr)po)h ~1  1|vuip  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`absefjyqlwkthxm}don~czr{!y.H] >Vlyc *+?},mPhvGr  W j  / A T a p > y 4 [ o ! U /U{CPsw\x$Ut8Zh='3?Kr $0<p|.:FR^j')5@KVa`lx!!!#/щA ##5-P-L7jq 3#%3#j7P8H8P7V3#3#####53#533!#!I@PNPN@JJHcAoPPeoD%)/8A#5$'&=3&'&'&5476753#&'&'67654'&'%jxf4 .> TtxiJYA<tF a#w1} -3' hh+oodI2'I?`z-6C6Ci93-;%)?O2#"'&'4547676"327654'&%3#2#"'&'4547676"327654'&ee`` feb` ^>3H;N\?3H:ׇ˓eda_ eea` ^>3H;N]?3J9{ekedba feG;M]?3F:Ma>2+eiec b` edG:L^>3G9Kb>1j)9F%#"'&54767&'&547632674=3#67654'&#" 3276J'thIF|ef^SK?:m)F/>g/f1SNkun'Ii{n]\nV+0]_eYySFRhs sZ@+7Z2"L+9:2,DlW6BpMI[b#3#b7R8NT3#&&56q6.8qX7Qwtqva[Gɺ1?NN #65&'3p6-7pY6RNStq~`Yʺ¾R37''7'7H &ݐif'Mx>JJ>xMfF !#!5!3FXX#YX 73#5676=#L{N,'d%^F!5F%#5F3#qpX%63 # & !265X$Re}Llo;?!C%w'ZDLI !5>7673#$w CP)OTF#!2!!67676?654'&# fЂ̨7 : HE(0[Qsyv oZ^1B}xkjp|OEB 2"#%632# &'3327654'&##567654'&)2J\uRʣ4_ 8LM-LKUk>6NpPeO8wEf|sRk8wFe+2@$9) !533##״9\R{H&!672# &'3327654'&#"#:|ςqM= T9tQxqM$(ljV { |U]A;/X"2%632#&'&#"632# &%"327654'&XirM v+3Q0vؿ|~}{B&UE]SwSLoF3>_/ۄȢ|~͉ V5eRz^T`YS4^) #!5)<#V~3<z ]L,<"#"'&'47&'&54632"327654'&"327654'&!׈~)zr>,D-^A]E,c?ZTBcQwU?fQw|~}xOM:WskxI4Y:Rz>+X9P>'bLoQAeKnP?N"2#"'&'332767#"'&'476763 "327654'&jrMr-6Q0n%+}}}z@ SKnGfUI]SЦ@_1ۄȄ~͉ [bXS5bS|^T1%#5#5\1#53#5676=#M{1N,'d%\F5 \'fF!5!5F  ӏfP5 5P'#XJP#'#5476767654'&#"#%632#5n[Xf]a_Dc1HYwadzQP:.4`pxoXZC38{A.?_|PhFQe332767654'&'&#"327# '&'&57676763 #"'#"'&547676322767654'&#"R.obejoY:iq9`=Lj~z[:{u_axmEFN{y_NG3Fr_aH9E"/nr,,ϩ>؍=AVߌ`B!΂̷%!jl5~#[6'lo rH8#9 !#3#  ?+`X&#!! 4'&#!!27627654'&#!w^^m6ν7)2q+ ˸=gBc/vmմYnbHC;%#5?D,bj#47%63 #&'&#"327673! &&be::?| /Lf~yf6Cv . WC(N3'# '&&576%63 6'&'&#"32767'`ױ) AF»* 䐔  uo wh GK?, HM  1o(#&=4'&#!#! 4'&#!!276J#2){2I(j4g2-5J36D=9:#/`2}նZb0"+2b2% 7654'&'%$4763 #&'&#"! '&'3"G/>۞1cTy\@K7tvJ"b䜓tly/7GbLvjtI%^A]b5'e9IWu \U+#!5!վ--)3! '&5332765jVxfBᆄM&{Px=)!#3 3#-o !# #3 3 3KT5DD-1 # # 3 3!hfoJJ#3 3JJ)9 !!5!5լN#3!ՓF#`q/N53#5!/}NayZf3# #=f!53ff-#{0VHP1@%63 327#"'&'#"'&5476767676=4'&#"276= C.31LF H-# #&^BwT%^ 0>1aF8kE\5$#5#"'&7632"327654'&b2=~s}nӓWNkS|SInM+!  +}qsZ}orPRP(!3273#"'&57632!654'&#"(OG'mxŃF%+ZZUzV>߄H {aA|B]sX\WtU%###53547632&#"r:P/1'w1Z< m;BP*:"'&'&576723253#"'&'33276="32765'&y x ~EZ&*p? "(A,ds2P@xIjM:D/ㇰLnX7$mlAi h74'&#"#367632#9y/5PB^g>UY;0uaz#pJk3#5#3\1B9#53#"'5327659(/#]\ .@w 3 ##!BF^7#7+P*36763267632#4'&#"#4'&#"#]r6ET^b:OFb+:lJFq%1lJF1"^(q @V2VQq^,VQq^P367632#4'&#"#]z=P]A\5LPB1*kKoz8!uaJP #"'&576"327654'&-`k|ɟSAwLpSC~JPÕޘ}/xmmFll?oB/P!36 #"'&'"327654'&oz}t|ǩr+SGkMsWOmQBmnorRzpsW5BP$##"'&5763253"327654'&`%*|rz +WOkS|SImMB9}qsZ}nsPP#367632NZd_-5*IU1¢+FP2327654'&/&'&547632#&'&#"# '&'~yB%O"5H8o\,:e(:> vA ?r^J(6P' '3RAoZMIgM%0P+'2m:R]Q4>X#327#"'&5#533+6P;& 1!E i$+'1!#5#"'&53327653ۙ`qAU\A\5LPB(lKn;z8!va`1!#3 3H/1f 1 !# #333oȽJ1CC#1 # # 3 3Vs{+d#{)B13#"'53276?3#TA1;L$ A1 65?1 !!5!51XN5*#";#"'&54'&'5676547635U=%F%A^62#K^" o0@Յ&EJ.A'.[z=UV<*A=V>NH3#{{y;N*5327654767&'&54'&+532#;!Vy%B!a53"G]!q0@N&FsS C"(s[}>%"#676323276=3#"/&'&s^l "(959-QlY5IOW((2 !#M' !E)5\11j '673#5&'&576753#&'&# eVxgsVb2k, ;qP{Vw:?+,2i15HA!!632327#"'&'&#"'67654'#53&'&54767632#!"-4>HO5nyEr`3O[Vg{Xu6mrb11T zztT P7/V]mqW:_lIoP#>e ,)Ln=CLSq:$4{zv;aCh/'#"''7&'454767'76327"327654'&wlR{nRirb<?osqYmwRytp2;bA6J>S^B9K=nl=3iudRn q[qlp59lwpWhg_I=Q_@6G=OdA4\!!!#!5!5!5!3 3\`5]zoehifihm)NH3#3#{{{{XL EU327654'&'%&'&54767&'&54767232#54'&#"#"'&567654'%L"m6!T  q*4\\A]SbN$bduhAi~gGB &H/"=^#5!#5!!9Q#"'&547632#&'&#"32767 #"'&'&57676"32767654'&'&j(^ȯooynV$M$4F6QFi5пO,{ͼR1~ޯ9~X]籦7XIy5D$x\dV#q~L)ۃпO-X]߳<TYⲦ:Lm-<!5%#"'&'#"'&54767676=4'&#"#6763232'32765R "Per7KJOTS y)00 %jc N[9'hh[ 8XW/?k0/  D'3$0-L6%, 5%75%7m7ѶRZ!#!R^F!5F%=U#&?4'&#!#! %!27654'&#! #"'&'&57676"32767654'&'&U)"E%+ M.пO,{ͼR1~ޯ9~X]籦7X7lA3QLRk Z5Yf Ü~L)ۃпO-X]߳<TYⲦ:9 j!5j5}2#"'&'46"327654'&m[Z^[|Z[Y<.D6D_:,E5}[[[YZ`~uE6EY<.G5GZ9-fF !#!5!3!5FXX TXX%'F%"#67632!!67676?654'&m.:U@ Y! 54wyC/?). [Dc_B/6%vNLM?AaN-!)0"#7632#"'&53327654'&'򀴦'&Z~ J,umS}I$a"0}*?i+M"?]#6 e7673#HlJX^ 8V Rm#!52#"'&5476"327654'& E#yFdI)C^h,V%1e-[#hhQsX3TzU,kh:R:d:S8 57'557'5} #57>7673#3#%!533##HlJXwbw<_^ 8V f+y l9]} 5#57>7673#3#"#7632!!67676?654'&HlJXvcw;*2U@ Y! 54wxC.^ 8V f+##)[Dc`A/6%wMMK?@bN-!04?B"#7632#"'&53327654'&'򀴦'&%3#%!533##Z~ J,umS}I$a"0}*?i+M"wbv'_?]#6 eYS]!/+h2/C <!?O!'I'e::?| -Pq~ywa,DTm2$ R0.:(. + IǷ+,+ [b)'9)'9)'9);'k9J'j=#3!2#%!27654'&#!y{`wt+G&wCas}qxur>VC%1 7654'&#"#4763 #"'53 7654'&+Z)qNy9}eqF6y1;--#0 2>!j ~=*<`Bmb~`f z^]{B)0' VHP'EVHP'EVHP'EVHP'EVH'kEVHP'EFP<MV3273#"'&/#"'&5476%63676=4'&#"#%63 6763227676=!4'&#"ANJ&nw$!=D^Gp~ #*1   :F_Q$&57632#&'&#"323#632#"'&'7327654'&#"'Y'm= ,7N6zIj, rw! g=XOS$:+i1/B= +2p\0li>q\DQo1 T0.:RP'IRP'IRP'IR'kI&&&'&kJ$47632&'&''7&'&'77# '&"327654'&Jm3NHd J8dZE_'RWзw}[SAuLrSC~J]OJT \PR+9Z;\LTuj`ǑmnIll?P'RJP'SJP'SJP'SJP'SJ'kSfF !5#5#5F [+%;P +#"''7&576327327654 &'&#";Z||}Ab}ƁwXR>IySAΘu91wxbk'\ m1'Y1'Y1'Y'kY)B1']oB-$367632#"'&'"327654'&oY'*||ǩr+SGkMsWOmQBtmnorRzpsW)B'k]"f J>4\ HX 3h% R FV$,f f    J > 4\   H X $$ $H+$TuCopyleft 2002, 2003, 2005 Free Software Foundation.Copyleft 2002, 2003, 2005 Free Software Foundation.FreeSansFreeSansMediumMediumFontForge 1.0 : Free Sans : 26-1-2006FontForge 1.0 : Free Sans : 26-1-2006Free SansFree SansVersion $Revision: 1.76 $ Version $Revision: 1.76 $ FreeSansFreeSansThe use of this font is granted subject to GNU General Public License.The use of this font is granted subject to GNU General Public License.http://www.gnu.org/copyleft/gpl.htmlhttp://www.gnu.org/copyleft/gpl.htmlThe quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.navadnoDovoljena je uporaba v skladu z licenco GNU General Public License.http://www.gnu.org/copyleft/gpl.html`erif bo za vajo spet kuhal doma e ~gance.f  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghjikmlnoqprsutvwxzy{}|~glyph3 softhyphenuni02CAuni02CB "jkkl DFLT2armnbengHdevaRgujr\gurufhebrplatnzkernkernz FT3 %8\:;=D1 %8:B;y=~H4zP\.\B\fp     x b  0 ^ F L Z p ~ "0>LZhv|&{  '+358B9:f;=5EFGHIKSUXYZ[]n%3:;= %,/3 %.8:;<=##%s.3EIMNSVYssssss %8:;=%'+378)EISY]%#'+378)9:);u=Y]###)%'+ES %8:;<=%`.`EIS```P'+389:;=EISY] %8:;=X/3b3%='+.337:;!=)E3GHI=KJMNSDVDWDYFZ=[B]3n======99N %QRTV&\JJyy%o'+378EIKMSVY]nVoooooo`$%'+378'EIKMSVY]n '35EISY]$ TNL%;'+378/ELIJKVMSPTYZn;;;;;;-TXZ]NZ[]Z[]LOXZ[\]EIJ-MNPSX1E]8NEIKSWY]T Z[]8;T Z[]85XZ[\]X]GY+ssEGHIJ5KMO PSTUWX9YZ;[?\)]1^X7EILSssEGIKSWEGIKSWEGISUqqEGIKPSW   '+358B9:f;=5{  '+358B9:f;=5EFGHIKSUXYZ[]n   '+358B9:f;=5   '+358B9:f;=5{  '+358B9:f;=5EFGHKSUXYZ[]n{  '+358B9:f;=5EFGHIKSUXYZ[]n%8:=%8:;=8:=8:=%8:;<=%%%QRTV%%FQRTVZ[]Z[]Z[]Z[]Z[]Z[]Z[]Z[]Z[]XXZ[\]%(*+.024 6> EGIMO],238=?BDGglpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/000077500000000000000000000000001226600447100201545ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/CREDITS000066400000000000000000000006471226600447100212030ustar00rootroot00000000000000CREDITS ======= eZ Components team ------------------ - Sergey Alexeev - Sebastian Bergmann - Jan Borsodi - Raymond Bosman - Frederik Holljen - Kore Nordmann - Derick Rethans - Vadym Savchuk - Tobias Schlitt - Alexandru Stanoi Contributors ------------ - Lars Jankowski * ODO Meter Charts - Elger Thiele * Custom highlight values in line and bar charts. - Michael Maclean * Contributing the Cairo-OO-driver glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/ChangeLog000066400000000000000000000314651226600447100217370ustar00rootroot000000000000001.5 - Monday 21 December 2009 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - No changes. 1.5rc1 - Monday 07 December 2009 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - No changes. 1.5beta1 - Monday 23 November 2009 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - No changes. 1.5alpha2 - Monday 09 November 2009 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Fixed #15537: Graph shows too small and truncated rotated axis labels. - Fixed #15578: formatString not working with numeric axis. 1.5alpha1 - Tuesday 01 September 2009 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Implemented feature #13341: Vertical Bar Charts. - Implemented feature #14294: Add option for axis label rotation. - Implemented feature #15095: Special rotated label renderer for bar charts. - Implemented feature #15133: Better configurable axis spaces. - Implemented feature #15135: Add support for pecl/cairo's object-oriented API, patch by Michael Maclean. 1.4.3 - Monday 08 June 2009 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Fixed #14538: Performance degration for very high numbers of data points. - Fixed #14857: Highlight text misplaced in charts with multiple bar data sets. 1.4.2 - Monday 30 March 2009 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Implemented feature #14400: Add shortcut to set background color - Fixed #14651: Handle floor() floating point inaccuracies in numneric axis step evaluation - Fixed #14655: A full circle sector is not drawn at all in GD driver. 1.4.1 - Monday 09 February 2009 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Fixed issue #13631: Rendering issues, when axisSpace set to 0 - Resolved task #14219: Refactor grid drawing to be less susceptible to floating point inaccuracies - Implemented feature #11980: Provide an initial array with labels for labeled axis - Implemented feature #12897: Add the possibility to have a subtitle for Graphs. - Implemented feature #13634: Make Offset of ezcGraphAxisRotatedLabelRenderer optional - Implamented feature #14146: Add new data symbols - square and box 1.4 - Monday 05 January 2009 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - No changes. 1.4rc1 - Monday 15 December 2008 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Implemented feature #014010: Possibility to set x/y offsets for highlightValue. (Initial patch by Markus Lervik) 1.4beta1 - Monday 01 December 2008 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - No changes. 1.4alpha1 - Monday 10 November 2008 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Implemented feature #13103: Different axes end styles. - Implemented feature #13102: Axes not extending beyond zero in line charts - Implemented feature #11981: Provide option for exact axis label renderer to put last value outside of the normal label boundings - Fixed issue #13253: Division by zero when trying to render stacked bars. - Fixed issue #13361: Provided workaround for ext/GD bug: http://bugs.php.net/45552 - Fixed issue #13595: majorStep overridden if min and max are both set 1.3 - Monday 16 June 2008 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - No changes. 1.3rc1 - Tuesday 10 June 2008 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Fixed issue #12581: Wrong axis captions in bar charts with manual min/max values 1.3beta1 - Tuesday 27 May 2008 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - No changes. 1.3alpha1 - Monday 05 May 2008 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Implemented feature #10829: Get resource from driver. - Implemented feature #10957: Embed glyphs for exact SVG font width estimation. (Patch by Freddie Witherden) - Implemented feature #11979: Line width configurable per data set. - Implemented feature #12382: Enhance line chart to allow invisible lines. - Fixed issue #12483: Average dataset does not work with a single value. 1.2.1 - Monday 21 January 2008 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Implemented feature #9407: Cairo driver. - Fixed issue #11777: Optionally independent axis font configuration. - Fixed issue #12254: Bad property-check for strokeLineJoin in SVG driver. - Fixed issue #12295: Broken automatic scaling with manually set min value, not divisible by major step. - Fixed issue #12326: Per datapoint colors not used with bar charts. - Fixed issue #12405: Highlightfontsize reduced when padding > 0 in highlight font options. 1.2 - Monday 17 December 2007 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Fixed issue #12238: Documentation error. - Fixed issue #12246: dataBorder doesn't works in 2D renderer for piecharts. 1.2beta1 - Wednesday 28 November 2007 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Fixed issue #12064: Gradients are not rendered correctly in Flash driver. - Implemented support for odometer charts. Thanks to Lars Jankowski from Oxid esales for the initial patch. 1.2alpha1 - Monday 29 October 2007 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Fixed issue #11640: Polygon size reducement fails for very thin four edged polygons. - Fixed issue #11511: Line thickness wasn't used for rendering. - Fixed issue #11509: Typo in line chart option. - Implemented feature #10978: Add support for stacked bar charts. - Implemented feature #11325: Allow values of 0 to be added to pie charts, to be included in the legend and not rendered in the actual pie. - Implemented feature #11247: Custom highlight values in line and bar charts. Thanks to Elger Thiele for the basic patch. - Implemented feature #10322 and #10565: Support for multiple x, y axis, vertical and horizontal lines in line and bar charts. 1.1.1 - Monday 13 August 2007 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Fixed issue #11107: Floating point inaccuracies caused missing grid in line chart. - Fixed issue #11157: Wrong display of single record with labeled axis. - Fixed issue #11180: Color Palette: $dataSetColor in ezcGraphPalette starts with index 1 and not zero in pie charts. - Fixed issue #11207: Missing URL property for legend, or missing legend, may cause PHP notice. - Fixed issue #11233: Path for circular arcs in SVG driver may break because of locale settings. - Fixed issue #11235: In interactive 3D bar charts circle and bullet bars are not linked. - Fixed issue #11236: Legend is not properly linked in interactive 3D line and bar charts. 1.1 - Monday 02 July 2007 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Documentation updates. 1.1rc1 - Monday 25 June 2007 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Fixed issue #10828: PHP error when overwriting renderer in extended ezGraphPieChart. - Documentation updates and fixes. 1.1beta2 - Thursday 31 May 2007 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Fixed issue #10741: Make ezcGraphOutOfLogithmicalBoundingsException more descriptive. - Fixed issue #10744: ExactAxisLabelRenderer shows last value at position of second last value if showLastValue is disabled. - Fixed issue #10745 (BaxedAxisLabelRenderer wrong label positions for angles: (135 <= $angle <= 325). - Fixed issue #10746: Border size reducement algorithm fails for polygones with edge lengths < reducement. - Fixed issue #10747: axisLabelRotatedRenderer accesses unitialised variables for Angles % 90 != .0 - Fixed issue #10750: SVG drivers output broken with wrong LC_NUMERIC. - Fixed issue #10759: Unset implementation broken in array access in datasets and dataset properties. - Fixed issue #10830: Automatically shorten labels if not enough space is available. - Fixed issue #10842: Pie charts fatal error with datasets with value sum <= 0. - Fixed issue #10846: Division by zero in polygon size reducement algorithm for edges with an angle equals 0 degree. - Fixed issue #10848: Missing pie segment labels in pie charts with 3d renderer. - Fixed issue #10852: Fixed radar chart documentation. - Fixed issue #10858: Document on how to embed the SVG graphs in an HTML document. - Fixed issue #10861: Circle sector size reducement failes for very big angles. - Fixed issue #10881: Wrong labeling with ezcGraphDateAxis. 1.1beta1 - Monday 07 May 2007 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Fixed issue #9916: Not documented: ArrayDataSet also can use Iterators. - Fixed issue #9926: Float values with date axis result in date parsing exception. - Fixed issue #9948: Make ezcGraphPolynom documentation public. - Fixed issue #9950: Improved ezcGraphPolynom::__toString method for more exact output. - Fixed issue #10018: Axis scale incorrect when startDate != first day of month. - Fixed issue #10025: Wrong statement in tutorial about swf versions supported by ext/ming. - Fixed issue #10074: Use iconv instead of mbstring. - Fixed issue #10055: Improve chart class documentation with chart elements. - Fixed issue #10056: Fixed drawing order for boxes with background and border. - Fixed issue #10199: Use saveXML instead of save( 'php://output' ) to work around PHP bug #40429. - Fixed issue #10246: sprintf output modification in PHP 5.2.1. - Fixed issue #10275: Low label count on labeled axis, when having (prime number > 10) + 1 labels. - Fixed issue #10536: Bar side polygons are drawn at the wrong side. - Fixed issue #10599: Pie chart label formatting callback only accepts callback functions but neither static nor non static methods. - Fixed issue #10606: Call to undefined function imagePsLoadFont() in gd tests when no t1lib is available. - Fixed issue #10675: Arrow heads on axis too small. - Fixed issue #10693: ezcGraphChartElementAxis::getSteps returns minor steps after last major steps. - Implemented feature #9402: Numeric datasets. - Implemented feature #9404: Add support for rotated texts on axis. - Implemented feature #9406: Add support for radar charts. - Implemented feature #9511: Added helper functions to create image maps an link SVG images in ezcGraphTools. - Implemented feature #10017: Plot whole months on date axis respecting their different length. - Implemented feature #10375: Manually reduce or increase the label count on labeled axis. - Implemented feature #10470: Add support for format callback functions on all axis. 1.0 - Monday 18 December 2006 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Renamed ezcGraphMingDriver to ezcGraphFlashDriver. - Renamed pie chart options percentTreshHold to percentThreshold and absoluteTreshHold to absoluteThreshold. - Added feature #9647: Added the renderToOutput() method to the drivers. - Fixed issue #9545: Pie chart treshhold does not work if aggregated data stays below treshhold. - Fixed issue #9549: Pie chart slices are not contiguous with the flash driver. - Fixed issue #9568: Division by zero warning. - Fixed issue #9583: Data typecasting should only be done in axis. - Fixed issue #9586: No data rendered with string keys on date axis. - Fixed issue #9588: Wrong polynoms build from data. - Fixed issue #9612: Element links for SVG image in the legend require you to click on exactly the text. - Fixed issue #9655: pieChartOffset and highlight do not work together in 2D renderer. - Fixed issue #9762: Structs don't inherit from ezcBaseStruct. - Fixed issue #9764: 3D Pie chart segment side polygon in front of circular arc. - Fixed issue #9795: Interferring bars, when bars count is higher then major step count. - Fixed issue #9823: Failing tests with PHP 5.1, because of different parameter handling in imagepng, and (string) not calling __toString method. - Fixed issue #9827: Use majorStep size for min/max estimating on numeric axis with only one value. 1.0beta2 - Monday 20 November 2006 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Added logarithmical scaled numeric axis. - Added treshhold for pie charts. - Added custom maximum value for pie charts. - Added ming driver for flash output. - Added text shadow, background and border to font options. - Added gleam to 2D pie charts. - Added feature #9304: Possibility to format labels via callback. - Fixed issue #9403: Element references do not work with Gleam in SVG. 1.0beta1 - Monday 25 September 2006 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Initial release of this package. glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/DESCRIPTION000066400000000000000000000001161226600447100216600ustar00rootroot00000000000000A component for creating pie charts, line graphs and other kinds of diagrams. glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/000077500000000000000000000000001226600447100207435ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/axis/000077500000000000000000000000001226600447100217075ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/axis/container.php000066400000000000000000000134111226600447100244020ustar00rootroot00000000000000chart = $chart; } /** * Returns if the given offset exists. * * This method is part of the ArrayAccess interface to allow access to the * data of this object as if it was an array. * * @param string $key Identifier of dataset. * @return bool True when the offset exists, otherwise false. */ public function offsetExists( $key ) { return isset( $this->data[$key] ); } /** * Returns the element with the given offset. * * This method is part of the ArrayAccess interface to allow access to the * data of this object as if it was an array. * * @param string $key Identifier of dataset. * @return ezcGraphChartElementAxis * * @throws ezcBasePropertyNotFoundException * If no dataset with identifier exists */ public function offsetGet( $key ) { if ( !isset( $this->data[$key] ) ) { throw new ezcBasePropertyNotFoundException( $key ); } return $this->data[$key]; } /** * Set the element with the given offset. * * This method is part of the ArrayAccess interface to allow access to the * data of this object as if it was an array. * * @param string $key * @param ezcGraphChartElementAxis $value * @return void * * @throws ezcBaseValueException * If supplied value is not an ezcGraphChartElementAxis */ public function offsetSet( $key, $value ) { if ( !$value instanceof ezcGraphChartElementAxis ) { throw new ezcBaseValueException( $key, $value, 'ezcGraphChartElementAxis' ); } if ( $key === null ) { $key = count( $this->data ); } // Add axis and configure it with current font and palette $this->data[$key] = $value; $value->font = $this->chart->options->font; $value->setFromPalette( $this->chart->palette ); return $value; } /** * Unset the element with the given offset. * * This method is part of the ArrayAccess interface to allow access to the * data of this object as if it was an array. * * @param string $key * @return void */ public function offsetUnset( $key ) { if ( !isset( $this->data[$key] ) ) { throw new ezcBasePropertyNotFoundException( $key ); } unset( $this->data[$key] ); } /** * Returns the currently selected dataset. * * This method is part of the Iterator interface to allow access to the * datasets of this row by iterating over it like an array (e.g. using * foreach). * * @return ezcGraphChartElementAxis The currently selected dataset. */ public function current() { return current( $this->data ); } /** * Returns the next dataset and selects it or false on the last dataset. * * This method is part of the Iterator interface to allow access to the * datasets of this row by iterating over it like an array (e.g. using * foreach). * * @return mixed ezcGraphChartElementAxis if the next dataset exists, or false. */ public function next() { return next( $this->data ); } /** * Returns the key of the currently selected dataset. * * This method is part of the Iterator interface to allow access to the * datasets of this row by iterating over it like an array (e.g. using * foreach). * * @return int The key of the currently selected dataset. */ public function key() { return key( $this->data ); } /** * Returns if the current dataset is valid. * * This method is part of the Iterator interface to allow access to the * datasets of this row by iterating over it like an array (e.g. using * foreach). * * @return bool If the current dataset is valid */ public function valid() { return ( current( $this->data ) !== false ); } /** * Selects the very first dataset and returns it. * This method is part of the Iterator interface to allow access to the * datasets of this row by iterating over it like an array (e.g. using * foreach). * * @return ezcGraphChartElementAxis The very first dataset. */ public function rewind() { return reset( $this->data ); } /** * Returns the number of datasets in the row. * * This method is part of the Countable interface to allow the usage of * PHP's count() function to check how many datasets exist. * * @return int Number of datasets. */ public function count() { return count( $this->data ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/axis/date.php000066400000000000000000000437721226600447100233520ustar00rootroot00000000000000 * $graph = new ezcGraphLineChart(); * $graph->options->fillLines = 210; * $graph->title = 'Concurrent requests'; * $graph->legend = false; * * $graph->xAxis = new ezcGraphChartElementDateAxis(); * * // Add data * $graph->data['Machine 1'] = new ezcGraphArrayDataSet( array( * '8:00' => 3241, * '8:13' => 934, * '8:24' => 1201, * '8:27' => 1752, * '8:51' => 123, * ) ); * $graph->data['Machine 2'] = new ezcGraphArrayDataSet( array( * '8:05' => 623, * '8:12' => 2103, * '8:33' => 543, * '8:43' => 2034, * '8:59' => 3410, * ) ); * * $graph->data['Machine 1']->symbol = ezcGraph::BULLET; * $graph->data['Machine 2']->symbol = ezcGraph::BULLET; * * $graph->render( 400, 150, 'tutorial_axis_datetime.svg' ); * * * @property float $startDate * Starting date used to display on axis. * @property float $endDate * End date used to display on axis. * @property float $interval * Time interval between steps on axis. * @property string $dateFormat * Format of date string * Like http://php.net/date * * @version 1.5 * @package Graph * @mainclass */ class ezcGraphChartElementDateAxis extends ezcGraphChartElementAxis { const MONTH = 2629800; const YEAR = 31536000; const DECADE = 315360000; /** * Minimum inserted date * * @var int */ protected $minValue = false; /** * Maximum inserted date * * @var int */ protected $maxValue = false; /** * Nice time intervals to used if there is no user defined interval * * @var array */ protected $predefinedIntervals = array( // Second 1 => 'H:i.s', // Ten seconds 10 => 'H:i.s', // Thirty seconds 30 => 'H:i.s', // Minute 60 => 'H:i', // Ten minutes 600 => 'H:i', // Half an hour 1800 => 'H:i', // Hour 3600 => 'H:i', // Four hours 14400 => 'H:i', // Six hours 21600 => 'H:i', // Half a day 43200 => 'd.m a', // Day 86400 => 'd.m', // Week 604800 => 'W', // Month self::MONTH => 'M y', // Year self::YEAR => 'Y', // Decade self::DECADE => 'Y', ); /** * Constant used for calculation of automatic definition of major scaling * steps */ const MAJOR_COUNT = 10; /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->properties['startDate'] = false; $this->properties['endDate'] = false; $this->properties['interval'] = false; $this->properties['dateFormat'] = false; parent::__construct( $options ); } /** * __set * * @param mixed $propertyName * @param mixed $propertyValue * @throws ezcBaseValueException * If a submitted parameter was out of range or type. * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return void * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'startDate': $this->properties['startDate'] = (int) $propertyValue; break; case 'endDate': $this->properties['endDate'] = (int) $propertyValue; break; case 'interval': $this->properties['interval'] = (int) $propertyValue; $this->properties['initialized'] = true; break; case 'dateFormat': $this->properties['dateFormat'] = (string) $propertyValue; break; default: parent::__set( $propertyName, $propertyValue ); break; } } /** * Ensure proper timestamp * * Takes a mixed value from datasets, like timestamps, or strings * describing some time and converts it to a timestamp. * * @param mixed $value * @return int */ protected static function ensureTimestamp( $value ) { if ( is_numeric( $value ) ) { $timestamp = (int) $value; } elseif ( ( $timestamp = strtotime( $value ) ) === false ) { throw new ezcGraphErrorParsingDateException( $value ); } return $timestamp; } /** * Add data for this axis * * @param array $values Value which will be displayed on this axis * @return void */ public function addData( array $values ) { foreach ( $values as $nr => $value ) { $value = self::ensureTimestamp( $value ); if ( $this->minValue === false || $value < $this->minValue ) { $this->minValue = $value; } if ( $this->maxValue === false || $value > $this->maxValue ) { $this->maxValue = $value; } } $this->properties['initialized'] = true; } /** * Calculate nice time interval * * Use the best fitting time interval defined in class property array * predefinedIntervals. * * @param int $min Start time * @param int $max End time * @return void */ protected function calculateInterval( $min, $max ) { $diff = $max - $min; foreach ( $this->predefinedIntervals as $interval => $format ) { if ( ( $diff / $interval ) <= self::MAJOR_COUNT ) { break; } } if ( ( $this->properties['startDate'] !== false ) && ( $this->properties['endDate'] !== false ) ) { // Use interval between defined borders if ( ( $diff % $interval ) > 0 ) { // Stil use predefined date format from old interval if not set if ( $this->properties['dateFormat'] === false ) { $this->properties['dateFormat'] = $this->predefinedIntervals[$interval]; } $count = ceil( $diff / $interval ); $interval = round( $diff / $count, 0 ); } } $this->properties['interval'] = $interval; } /** * Calculate lower nice date * * Calculates a date which is earlier or equal to the given date, and is * divisible by the given interval. * * @param int $min Date * @param int $interval Interval * @return int Earlier date */ protected function calculateLowerNiceDate( $min, $interval ) { switch ( $interval ) { case self::MONTH: // Special handling for months - not covered by the default // algorithm return mktime( 1, 0, 0, (int) date( 'm', $min ), 1, (int) date( 'Y', $min ) ); default: $dateSteps = array( 60, 60, 24, 7, 52 ); $date = array( (int) date( 's', $min ), (int) date( 'i', $min ), (int) date( 'H', $min ), (int) date( 'd', $min ), (int) date( 'm', $min ), (int) date( 'Y', $min ), ); $element = 0; while ( ( $step = array_shift( $dateSteps ) ) && ( $interval > $step ) ) { $interval /= $step; $date[$element++] = (int) ( $element > 2 ); } $date[$element] -= $date[$element] % $interval; return mktime( $date[2], $date[1], $date[0], $date[4], $date[3], $date[5] ); } } /** * Calculate start date * * Use calculateLowerNiceDate to get a date earlier or equal date then the * minimum date to use it as the start date for the axis depending on the * selected interval. * * @param mixed $min Minimum date * @param mixed $max Maximum date * @return void */ public function calculateMinimum( $min, $max ) { if ( $this->properties['endDate'] === false ) { $this->properties['startDate'] = $this->calculateLowerNiceDate( $min, $this->interval ); } else { $this->properties['startDate'] = $this->properties['endDate']; while ( $this->properties['startDate'] > $min ) { switch ( $this->interval ) { case self::MONTH: $this->properties['startDate'] = strtotime( '-1 month', $this->properties['startDate'] ); break; case self::YEAR: $this->properties['startDate'] = strtotime( '-1 year', $this->properties['startDate'] ); break; case self::DECADE: $this->properties['startDate'] = strtotime( '-10 years', $this->properties['startDate'] ); break; default: $this->properties['startDate'] -= $this->interval; } } } } /** * Calculate end date * * Use calculateLowerNiceDate to get a date later or equal date then the * maximum date to use it as the end date for the axis depending on the * selected interval. * * @param mixed $min Minimum date * @param mixed $max Maximum date * @return void */ public function calculateMaximum( $min, $max ) { $this->properties['endDate'] = $this->properties['startDate']; while ( $this->properties['endDate'] < $max ) { switch ( $this->interval ) { case self::MONTH: $this->properties['endDate'] = strtotime( '+1 month', $this->properties['endDate'] ); break; case self::YEAR: $this->properties['endDate'] = strtotime( '+1 year', $this->properties['endDate'] ); break; case self::DECADE: $this->properties['endDate'] = strtotime( '+10 years', $this->properties['endDate'] ); break; default: $this->properties['endDate'] += $this->interval; } } } /** * Calculate axis bounding values on base of the assigned values * * @return void */ public function calculateAxisBoundings() { // Prevent division by zero, when min == max if ( $this->minValue == $this->maxValue ) { if ( $this->minValue == 0 ) { $this->maxValue = 1; } else { $this->minValue -= ( $this->minValue * .1 ); $this->maxValue += ( $this->maxValue * .1 ); } } // Use custom minimum and maximum if available if ( $this->properties['startDate'] !== false ) { $this->minValue = $this->properties['startDate']; } if ( $this->properties['endDate'] !== false ) { $this->maxValue = $this->properties['endDate']; } // Calculate "nice" values for scaling parameters if ( $this->properties['interval'] === false ) { $this->calculateInterval( $this->minValue, $this->maxValue ); } if ( $this->properties['dateFormat'] === false && isset( $this->predefinedIntervals[$this->interval] ) ) { $this->properties['dateFormat'] = $this->predefinedIntervals[$this->interval]; } if ( $this->properties['startDate'] === false ) { $this->calculateMinimum( $this->minValue, $this->maxValue ); } if ( $this->properties['endDate'] === false ) { $this->calculateMaximum( $this->minValue, $this->maxValue ); } } /** * Get coordinate for a dedicated value on the chart * * @param float $value Value to determine position for * @return float Position on chart */ public function getCoordinate( $value ) { // Force typecast, because ( false < -100 ) results in (bool) true $intValue = ( $value === false ? false : self::ensureTimestamp( $value ) ); if ( ( $value === false ) && ( ( $intValue < $this->startDate ) || ( $intValue > $this->endDate ) ) ) { switch ( $this->position ) { case ezcGraph::LEFT: case ezcGraph::TOP: return 0.; case ezcGraph::RIGHT: case ezcGraph::BOTTOM: return 1.; } } else { switch ( $this->position ) { case ezcGraph::LEFT: case ezcGraph::TOP: return ( $intValue - $this->startDate ) / ( $this->endDate - $this->startDate ); case ezcGraph::RIGHT: case ezcGraph::BOTTOM: return 1 - ( $intValue - $this->startDate ) / ( $this->endDate - $this->startDate ); } } } /** * Return count of minor steps * * @return integer Count of minor steps */ public function getMinorStepCount() { return false; } /** * Return count of major steps * * @return integer Count of major steps */ public function getMajorStepCount() { return (int) ceil( ( $this->properties['endDate'] - $this->startDate ) / $this->interval ); } /** * Get label for a dedicated step on the axis * * @param integer $step Number of step * @return string label */ public function getLabel( $step ) { return $this->getLabelFromTimestamp( $this->startDate + ( $step * $this->interval ), $step ); } /** * Get label for timestamp * * @param int $time * @param int $step * @return string */ protected function getLabelFromTimestamp( $time, $step ) { if ( $this->properties['labelCallback'] !== null ) { return call_user_func_array( $this->properties['labelCallback'], array( date( $this->properties['dateFormat'], $time ), $step, ) ); } else { return date( $this->properties['dateFormat'], $time ); } } /** * Return array of steps on this axis * * @return array( ezcGraphAxisStep ) */ public function getSteps() { $steps = array(); $start = $this->properties['startDate']; $end = $this->properties['endDate']; $distance = $end - $start; $step = 0; for ( $time = $start; $time <= $end; ) { $steps[] = new ezcGraphAxisStep( ( $time - $start ) / $distance, $this->interval / $distance, $this->getLabelFromTimestamp( $time, $step++ ), array(), $step === 1, $time >= $end ); switch ( $this->interval ) { case self::MONTH: $time = strtotime( '+1 month', $time ); break; case self::YEAR: $time = strtotime( '+1 year', $time ); break; case self::DECADE: $time = strtotime( '+10 years', $time ); break; default: $time += $this->interval; break; } } return $steps; } /** * Is zero step * * Returns true if the given step is the one on the initial axis position * * @param int $step Number of step * @return bool Status If given step is initial axis position */ public function isZeroStep( $step ) { return ( $step == 0 ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/axis/labeled.php000066400000000000000000000345331226600447100240200ustar00rootroot00000000000000 * $graph = new ezcGraphLineChart(); * $graph->options->fillLines = 210; * $graph->options->font->maxFontSize = 10; * $graph->title = 'Error level colors'; * $graph->legend = false; * * $graph->yAxis = new ezcGraphChartElementLabeledAxis(); * $graph->yAxis->axisLabelRenderer->showZeroValue = true; * * $graph->yAxis->label = 'Color'; * $graph->xAxis->label = 'Error level'; * * // Add data * $graph->data['colors'] = new ezcGraphArrayDataSet( * array( * 'info' => 'blue', * 'notice' => 'green', * 'warning' => 'orange', * 'error' => 'red', * 'fatal' => 'red', * ) * ); * * $graph->render( 400, 150, 'tutorial_axis_labeled.svg' ); * * * @property float $labelCount * Define count of displayed labels on the axis * * @version 1.5 * @package Graph * @mainclass */ class ezcGraphChartElementLabeledAxis extends ezcGraphChartElementAxis { /** * Array with labeles for data * * @var array */ protected $labels = array(); /** * Labels indexed by their name as key for faster lookups * * @var array */ protected $labelsIndexed = array(); /** * Reduced amount of labels which will be displayed in the chart * * @var array */ protected $displayedLabels = array(); /** * Maximum count of labels which can be displayed on one axis * @todo Perhaps base this on the chart size */ const MAX_LABEL_COUNT = 10; /** * Precalculated steps on the axis * * @var array(ezcGraphAxisStep) */ protected $steps; /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->properties['labelCount'] = null; $this->axisLabelRenderer = new ezcGraphAxisCenteredLabelRenderer(); parent::__construct( $options ); } /** * __set * * @param mixed $propertyName * @param mixed $propertyValue * @throws ezcBaseValueException * If a submitted parameter was out of range or type. * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return void * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'labelCount': if ( !is_numeric( $propertyValue ) || ( $propertyValue <= 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int > 1' ); } $this->properties['labelCount'] = (int) $propertyValue; break; default: parent::__set( $propertyName, $propertyValue ); break; } } /** * Increase the keys of all elements in the array up from the start key, to * insert an additional element at the correct position. * * @param array $array Array * @param int $startKey Key to increase keys from * @return array Updated array */ protected function increaseKeys( array $array, $startKey ) { foreach ( $array as $key => $value ) { if ( $key === $startKey ) { // Recursive check, if next key should be increased, too if ( isset ( $array[$key + 1] ) ) { $array = $this->increaseKeys( $array, $key + 1 ); } // Increase key $array[$key + 1] = $array[$key]; unset( $array[$key] ); } } return $array; } /** * Provide initial set of labels * * This method may be used to provide an ordered set of labels, containing * labels, which are not available in the datasets or to provide a label * order different to the one in the given dataset. * * @param array $labels * @return void */ public function provideLabels( array $labels ) { $this->addData( $labels ); } /** * Add data for this axis * * @param array $values Value which will be displayed on this axis * @return void */ public function addData( array $values ) { $position = 0; foreach ( $values as $label ) { $label = (string) $label; if ( !in_array( $label, $this->labels, true ) ) { if ( isset( $this->labels[$position] ) ) { $this->labels = $this->increaseKeys( $this->labels, $position ); $this->labels[$position++] = $label; } else { $this->labels[$position++] = $label; } } else { $position = array_search( $label, $this->labels, true ) + 1; } } ksort( $this->labels ); $this->labelsIndexed = array_flip( $this->labels ); $this->properties['initialized'] = true; } /** * Calculate axis bounding values on base of the assigned values * * @abstract * @access public * @return void */ public function calculateAxisBoundings() { $this->steps = array(); // Apply label format callback function if ( $this->properties['labelCallback'] !== null ) { foreach ( $this->labels as $nr => $label ) { $this->labels[$nr] = call_user_func_array( $this->properties['labelCallback'], array( $label, $nr ) ); } } $labelCount = count( $this->labels ) - 1; if ( $labelCount === 0 ) { // Create single only step $this->steps = array( new ezcGraphAxisStep( 0, 1, reset( $this->labels ), array(), true, true ), ); return true; } if ( $this->properties['labelCount'] === null ) { if ( $labelCount <= self::MAX_LABEL_COUNT ) { $stepSize = 1 / $labelCount; foreach ( $this->labels as $nr => $label ) { $this->steps[] = new ezcGraphAxisStep( $stepSize * $nr, $stepSize, $label, array(), $nr === 0, $nr === $labelCount ); } // @TODO: This line is deprecated and only build for // deprecated getLabel() $this->displayedLabels = $this->labels; return true; } for ( $div = self::MAX_LABEL_COUNT; $div > 1; --$div ) { if ( ( $labelCount % $div ) === 0 ) { // @TODO: This part is deprecated and only build for // deprecated getLabel() $step = $labelCount / $div; foreach ( $this->labels as $nr => $label ) { if ( ( $nr % $step ) === 0 ) { $this->displayedLabels[] = $label; } } // End of deprecated part break; } } } else { $div = false; } // Build up step array if ( $div > 2 ) { $step = $labelCount / $div; $stepSize = 1 / $div; $minorStepSize = $stepSize / $step; foreach ( $this->labels as $nr => $label ) { if ( ( $nr % $step ) === 0 ) { $mainstep = new ezcGraphAxisStep( $stepSize * ( $nr / $step ), $stepSize, $label, array(), $nr === 0, $nr === $labelCount ); $this->steps[] = $mainstep; } else { $mainstep->childs[] = new ezcGraphAxisStep( $mainstep->position + $minorStepSize * ( $nr % $step ), $minorStepSize ); } } } else { if ( $this->properties['labelCount'] === null ) { $floatStep = $labelCount / ( self::MAX_LABEL_COUNT - 1 ); } else { $floatStep = $labelCount / min( $labelCount, $this->properties['labelCount'] - 1 ); } $position = 0; $minorStepSize = 1 / $labelCount; foreach ( $this->labels as $nr => $label ) { if ( $nr >= $position ) { $position += $floatStep; // Add as major step $mainstep = new ezcGraphAxisStep( $minorStepSize * $nr, ceil( $position - $nr ) * $minorStepSize, $label, array(), $nr === 0, $nr === $labelCount ); // @TODO: This line is deprecated and only build for // deprecated getLabel() $this->displayedLabels[] = $label; $this->steps[] = $mainstep; } else { $mainstep->childs[] = new ezcGraphAxisStep( $minorStepSize * $nr, $minorStepSize ); } } } } /** * Return array of steps on this axis * * @return array( ezcGraphAxisStep ) */ public function getSteps() { return $this->steps; } /** * Get coordinate for a dedicated value on the chart * * @param string $value Value to determine position for * @return float Position on chart */ public function getCoordinate( $value ) { if ( ( $value === false ) || ( $value === null ) || ( !isset( $this->labelsIndexed[$value] ) ) ) { switch ( $this->position ) { case ezcGraph::LEFT: case ezcGraph::TOP: return 0.; case ezcGraph::RIGHT: case ezcGraph::BOTTOM: return 1.; } } else { $key = $this->labelsIndexed[$value]; switch ( $this->position ) { case ezcGraph::LEFT: case ezcGraph::TOP: if ( count( $this->labels ) > 1 ) { return (float) $key / ( count ( $this->labels ) - 1 ); } else { return 0; } case ezcGraph::BOTTOM: case ezcGraph::RIGHT: if ( count( $this->labels ) > 1 ) { return (float) 1 - $key / ( count ( $this->labels ) - 1 ); } else { return 1; } } } } /** * Return count of minor steps * * @return integer Count of minor steps */ public function getMinorStepCount() { return 0; } /** * Return count of major steps * * @return integer Count of major steps */ public function getMajorStepCount() { return max( count( $this->displayedLabels ) - 1, 1 ); } /** * Get label for a dedicated step on the axis * * @param integer $step Number of step * @return string label */ public function getLabel( $step ) { if ( isset( $this->displayedLabels[$step] ) ) { return $this->displayedLabels[$step]; } else { return false; } } /** * Is zero step * * Returns true if the given step is the one on the initial axis position * * @param int $step Number of step * @return bool Status If given step is initial axis position */ public function isZeroStep( $step ) { return !$step; } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/axis/logarithmic.php000066400000000000000000000251231226600447100247250ustar00rootroot00000000000000 * $graph = new ezcGraphLineChart(); * $graph->title = 'The power of x'; * $graph->legend->position = ezcGraph::BOTTOM; * * $graph->xAxis = new ezcGraphChartElementNumericAxis(); * $graph->yAxis = new ezcGraphChartElementLogarithmicalAxis(); * * $graph->data['x^2'] = new ezcGraphNumericDataSet( * -10, 10, * create_function( '$x', 'return pow( $x, 2 ) + 1;' ) * ); * * $graph->data['x^4'] = new ezcGraphNumericDataSet( * -10, 10, * create_function( '$x', 'return pow( $x, 4 ) + 1;' ) * ); * * $graph->data['x^6'] = new ezcGraphNumericDataSet( * -10, 10, * create_function( '$x', 'return pow( $x, 6 ) + 1;' ) * ); * * $graph->render( 400, 250, 'tutorial_axis_logarithmic.svg' ); * * * @property float $base * Base for logarithmical scaling. * @property string $logarithmicalFormatString * Sprintf formatstring for the axis labels where * $1 is the base and * $2 is the exponent. * @property-read float $minValue * Minimum Value to display on this axis. * @property-read float $maxValue * Maximum value to display on this axis. * * @version 1.5 * @package Graph * @mainclass */ class ezcGraphChartElementLogarithmicalAxis extends ezcGraphChartElementAxis { /** * Constant used for calculation of automatic definition of major scaling * steps */ const MAX_STEPS = 9; /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->properties['min'] = null; $this->properties['max'] = null; $this->properties['base'] = 10; $this->properties['logarithmicalFormatString'] = '%1$d^%2$d'; $this->properties['minValue'] = null; $this->properties['maxValue'] = null; parent::__construct( $options ); } /** * __set * * @param mixed $propertyName * @param mixed $propertyValue * @throws ezcBaseValueException * If a submitted parameter was out of range or type. * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return void * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'min': case 'max': if ( !is_numeric( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'float' ); } $this->properties[$propertyName] = (float) $propertyValue; $this->properties['initialized'] = true; break; case 'base': if ( !is_numeric( $propertyValue ) || ( $propertyValue <= 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'float > 0' ); } $this->properties[$propertyName] = (float) $propertyValue; break; case 'logarithmicalFormatString': $this->properties['logarithmicalFormatString'] = (string) $propertyValue; break; default: parent::__set( $propertyName, $propertyValue ); break; } } /** * Add data for this axis * * @param array $values Value which will be displayed on this axis * @return void */ public function addData( array $values ) { foreach ( $values as $value ) { if ( $this->properties['minValue'] === null || $value < $this->properties['minValue'] ) { $this->properties['minValue'] = $value; } if ( $this->properties['maxValue'] === null || $value > $this->properties['maxValue'] ) { $this->properties['maxValue'] = $value; } } $this->properties['initialized'] = true; } /** * Calculate axis bounding values on base of the assigned values * * @abstract * @access public * @return void */ public function calculateAxisBoundings() { // Prevent division by zero, when min == max if ( $this->properties['minValue'] == $this->properties['maxValue'] ) { if ( $this->properties['minValue'] == 0 ) { $this->properties['maxValue'] = 1; } else { $this->properties['minValue'] -= ( $this->properties['minValue'] * .1 ); $this->properties['maxValue'] += ( $this->properties['maxValue'] * .1 ); } } if ( $this->properties['minValue'] <= 0 ) { throw new ezcGraphOutOfLogithmicalBoundingsException( $this->properties['minValue'] ); } // Use custom minimum and maximum if available if ( $this->properties['min'] !== null ) { $this->properties['minValue'] = pow( $this->properties['base'], $this->properties['min'] ); } if ( $this->properties['max'] !== null ) { $this->properties['maxValue'] = pow( $this->properties['base'], $this->properties['max'] ); } // Calculate "nice" values for scaling parameters if ( $this->properties['min'] === null ) { $this->properties['min'] = floor( log( $this->properties['minValue'], $this->properties['base'] ) ); } if ( $this->properties['max'] === null ) { $this->properties['max'] = ceil( log( $this->properties['maxValue'], $this->properties['base'] ) ); } $this->properties['minorStep'] = 1; if ( ( $modifier = ( ( $this->properties['max'] - $this->properties['min'] ) / self::MAX_STEPS ) ) > 1 ) { $this->properties['majorStep'] = $modifier = ceil( $modifier ); $this->properties['min'] = floor( $this->properties['min'] / $modifier ) * $modifier; $this->properties['max'] = floor( $this->properties['max'] / $modifier ) * $modifier; } else { $this->properties['majorStep'] = 1; } } /** * Get coordinate for a dedicated value on the chart * * @param float $value Value to determine position for * @return float Position on chart */ public function getCoordinate( $value ) { // Force typecast, because ( false < -100 ) results in (bool) true $floatValue = (float) $value; if ( $value === false ) { switch ( $this->position ) { case ezcGraph::LEFT: case ezcGraph::TOP: return 0.; case ezcGraph::RIGHT: case ezcGraph::BOTTOM: return 1.; } } else { $position = ( log( $value, $this->properties['base'] ) - $this->properties['min'] ) / ( $this->properties['max'] - $this->properties['min'] ); switch ( $this->position ) { case ezcGraph::LEFT: case ezcGraph::TOP: return $position; case ezcGraph::RIGHT: case ezcGraph::BOTTOM: return 1 - $position; } } } /** * Return count of minor steps * * @return integer Count of minor steps */ public function getMinorStepCount() { return (int) ( ( $this->properties['max'] - $this->properties['min'] ) / $this->properties['minorStep'] ); } /** * Return count of major steps * * @return integer Count of major steps */ public function getMajorStepCount() { return (int) ( ( $this->properties['max'] - $this->properties['min'] ) / $this->properties['majorStep'] ); } /** * Get label for a dedicated step on the axis * * @param integer $step Number of step * @return string label */ public function getLabel( $step ) { if ( $this->properties['labelCallback'] !== null ) { return call_user_func_array( $this->properties['labelCallback'], array( sprintf( $this->properties['logarithmicalFormatString'], $this->properties['base'], $this->properties['min'] + ( $step * $this->properties['majorStep'] ) ), $step, ) ); } else { return sprintf( $this->properties['logarithmicalFormatString'], $this->properties['base'], $this->properties['min'] + ( $step * $this->properties['majorStep'] ) ); } } /** * Is zero step * * Returns true if the given step is the one on the initial axis position * * @param int $step Number of step * @return bool Status If given step is initial axis position */ public function isZeroStep( $step ) { return ( $step == 0 ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/axis/numeric.php000066400000000000000000000400411226600447100240610ustar00rootroot00000000000000 * $graph = new ezcGraphLineChart(); * $graph->title = 'Some random data'; * $graph->legend = false; * * $graph->xAxis = new ezcGraphChartElementNumericAxis(); * // The y axis is numeric by default. * * $graph->xAxis->min = -15; * $graph->xAxis->max = 15; * $graph->xAxis->majorStep = 5; * * $data = array( * array(), * array() * ); * for ( $i = -10; $i <= 10; $i++ ) * { * $data[0][$i] = mt_rand( -23, 59 ); * $data[1][$i] = mt_rand( -23, 59 ); * } * * // Add data * $graph->data['random blue'] = new ezcGraphArrayDataSet( $data[0] ); * $graph->data['random green'] = new ezcGraphArrayDataSet( $data[1] ); * * $graph->render( 400, 150, 'tutorial_axis_numeric.svg' ); * * * @property float $min * Minimum value of displayed scale on axis. * @property float $max * Maximum value of displayed scale on axis. * @property mixed $majorStep * Labeled major steps displayed on the axis. * @property mixed $minorStep * Non labeled minor steps on the axis. * @property-read float $minValue * Minimum Value to display on this axis. * @property-read float $maxValue * Maximum value to display on this axis. * * @version 1.5 * @package Graph * @mainclass */ class ezcGraphChartElementNumericAxis extends ezcGraphChartElementAxis { /** * Constant used for calculation of automatic definition of major scaling * steps */ const MIN_MAJOR_COUNT = 5; /** * Constant used for automatic calculation of minor steps from given major * steps */ const MIN_MINOR_COUNT = 8; /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->properties['min'] = null; $this->properties['max'] = null; $this->properties['minValue'] = null; $this->properties['maxValue'] = null; parent::__construct( $options ); } /** * __set * * @param mixed $propertyName * @param mixed $propertyValue * @throws ezcBaseValueException * If a submitted parameter was out of range or type. * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return void * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'min': if ( !is_numeric( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'float' ); } $this->properties['min'] = (float) $propertyValue; $this->properties['initialized'] = true; break; case 'max': if ( !is_numeric( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'float' ); } $this->properties['max'] = (float) $propertyValue; $this->properties['initialized'] = true; break; default: parent::__set( $propertyName, $propertyValue ); break; } } /** * Returns a "nice" number for a given floating point number. * * Nice numbers are steps on a scale which are easily recognized by humans * like 0.5, 25, 1000 etc. * * @param float $float Number to be altered * @return float Nice number */ protected function getNiceNumber( $float ) { // Get absolute value and save sign $abs = abs( $float ); $sign = $float / $abs; // Normalize number to a range between 1 and 10 $log = (int) round( log10( $abs ), 0 ); $abs /= pow( 10, $log ); // find next nice number if ( $abs > 5 ) { $abs = 10.; } elseif ( $abs > 2.5 ) { $abs = 5.; } elseif ( $abs > 1 ) { $abs = 2.5; } else { $abs = 1; } // unnormalize number to original values return $abs * pow( 10, $log ) * $sign; } /** * Calculate minimum value for displayed axe basing on real minimum and * major step size * * @param float $min Real data minimum * @param float $max Real data maximum * @return void */ protected function calculateMinimum( $min, $max ) { if ( $this->properties['max'] === null ) { $this->properties['min'] = floor( $min / $this->properties['majorStep'] ) * $this->properties['majorStep']; } else { $calculatedMin = $this->properties['max']; do { $calculatedMin -= $this->properties['majorStep']; } while ( $calculatedMin > $min ); $this->properties['min'] = $calculatedMin; } } /** * Calculate maximum value for displayed axe basing on real maximum and * major step size * * @param float $min Real data minimum * @param float $max Real data maximum * @return void */ protected function calculateMaximum( $min, $max ) { $calculatedMax = $this->properties['min']; do { $calculatedMax += $this->properties['majorStep']; } while ( $calculatedMax < $max ); $this->properties['max'] = $calculatedMax; } /** * Calculate size of minor steps based on the size of the major step size * * @param float $min Real data minimum * @param float $max Real data maximum * @return void */ protected function calculateMinorStep( $min, $max ) { $stepSize = $this->properties['majorStep'] / self::MIN_MINOR_COUNT; $this->properties['minorStep'] = $this->getNiceNumber( $stepSize ); } /** * Calculate size of major step based on the span to be displayed and the * defined MIN_MAJOR_COUNT constant. * * @param float $min Real data minimum * @param float $max Real data maximum * @return void */ protected function calculateMajorStep( $min, $max ) { $span = $max - $min; $stepSize = $span / self::MIN_MAJOR_COUNT; $this->properties['majorStep'] = $this->getNiceNumber( $stepSize ); } /** * Add data for this axis * * @param array $values Value which will be displayed on this axis * @return void */ public function addData( array $values ) { foreach ( $values as $value ) { if ( $this->properties['minValue'] === null || $value < $this->properties['minValue'] ) { $this->properties['minValue'] = $value; } if ( $this->properties['maxValue'] === null || $value > $this->properties['maxValue'] ) { $this->properties['maxValue'] = $value; } } $this->properties['initialized'] = true; } /** * Calculate axis bounding values on base of the assigned values * * @abstract * @access public * @return void */ public function calculateAxisBoundings() { // Prevent division by zero, when min == max if ( $this->properties['minValue'] == $this->properties['maxValue'] ) { if ( $this->properties['minValue'] == 0 ) { $this->properties['maxValue'] = 1; } else { if ( $this->properties['majorStep'] !== null ) { $this->properties['minValue'] -= $this->properties['majorStep']; $this->properties['maxValue'] += $this->properties['majorStep']; } else { $this->properties['minValue'] -= ( $this->properties['minValue'] * .1 ); $this->properties['maxValue'] += ( $this->properties['maxValue'] * .1 ); } } } // Use custom minimum and maximum if available if ( $this->properties['min'] !== null ) { $this->properties['minValue'] = $this->properties['min']; } if ( $this->properties['max'] !== null ) { $this->properties['maxValue'] = $this->properties['max']; } // If min and max values are forced, we may not be able to find a // "nice" number for the steps. Try to find such a nice step size, or // fall back to a step size, which is just the span divided by 5. if ( ( $this->properties['min'] !== null ) && ( $this->properties['max'] !== null ) && ( $this->properties['majorStep'] === null ) ) { $diff = $this->properties['max'] - $this->properties['min']; $this->calculateMajorStep( $this->properties['minValue'], $this->properties['maxValue'] ); $stepInvariance = $diff / $this->properties['majorStep']; if ( ( $stepInvariance - floor( $stepInvariance ) ) > .0000001 ) { // For too big step invariances calculate the step size just // from the given difference between min and max value. $this->properties['majorStep'] = ( $this->properties['max'] - $this->properties['min'] ) / self::MIN_MAJOR_COUNT; $this->properties['minorStep'] = $this->properties['majorStep'] / self::MIN_MAJOR_COUNT; } } // Calculate "nice" values for scaling parameters if ( $this->properties['majorStep'] === null ) { $this->calculateMajorStep( $this->properties['minValue'], $this->properties['maxValue'] ); } if ( $this->properties['minorStep'] === null ) { $this->calculateMinorStep( $this->properties['minValue'], $this->properties['maxValue'] ); } if ( $this->properties['min'] === null ) { $this->calculateMinimum( $this->properties['minValue'], $this->properties['maxValue'] ); } if ( $this->properties['max'] === null ) { $this->calculateMaximum( $this->properties['minValue'], $this->properties['maxValue'] ); } // Check that the major step size matches up with the min and max // values on the axis. $quotient = ( $this->properties['max'] - $this->properties['min'] ) / $this->properties['majorStep']; $quotient = abs( $quotient - floor( $quotient ) ); if ( ( $quotient >= .00001 ) && ( abs( $quotient - 1 ) >= .00001 ) ) { throw new ezcGraphInvalidStepSizeException( "The difference between minimum and maximum value is not a multiplier of the major step size." ); } // Check that the minor step size matches up with major step size on // the axis. $quotient = $this->properties['majorStep'] / $this->properties['minorStep']; $quotient = abs( $quotient - floor( $quotient ) ); if ( ( $quotient >= .00001 ) && ( abs( $quotient - 1 ) >= .00001 ) ) { throw new ezcGraphInvalidStepSizeException( "The major step size value is not a multiplier of the minor step size." ); } } /** * Get coordinate for a dedicated value on the chart * * @param float $value Value to determine position for * @return float Position on chart */ public function getCoordinate( $value ) { // Force typecast, because ( false < -100 ) results in (bool) true $floatValue = (float) $value; if ( ( $value === false ) && ( ( $floatValue < $this->properties['min'] ) || ( $floatValue > $this->properties['max'] ) ) ) { switch ( $this->position ) { case ezcGraph::LEFT: case ezcGraph::TOP: return 0.; case ezcGraph::RIGHT: case ezcGraph::BOTTOM: return 1.; } } else { switch ( $this->position ) { case ezcGraph::LEFT: case ezcGraph::TOP: return ( $value - $this->properties['min'] ) / ( $this->properties['max'] - $this->properties['min'] ); case ezcGraph::RIGHT: case ezcGraph::BOTTOM: return 1 - ( $value - $this->properties['min'] ) / ( $this->properties['max'] - $this->properties['min'] ); } } } /** * Return count of minor steps * * @return integer Count of minor steps */ public function getMinorStepCount() { return (int) ( ( $this->properties['max'] - $this->properties['min'] ) / $this->properties['minorStep'] ); } /** * Return count of major steps * * @return integer Count of major steps */ public function getMajorStepCount() { return (int) ( ( $this->properties['max'] - $this->properties['min'] ) / $this->properties['majorStep'] ); } /** * Get label for a dedicated step on the axis * * @param integer $step Number of step * @return string label */ public function getLabel( $step ) { if ( $this->properties['labelCallback'] !== null ) { return call_user_func_array( $this->properties['labelCallback'], array( $this->properties['min'] + ( $step * $this->properties['majorStep'] ), $step, ) ); } elseif ( $this->properties['formatString'] !== null ) { return sprintf( $this->properties['formatString'], $this->properties['min'] + ( $step * $this->properties['majorStep'] ) ); } else { return $this->properties['min'] + ( $step * $this->properties['majorStep'] ); } } /** * Is zero step * * Returns true if the given step is the one on the initial axis position * * @param int $step Number of step * @return bool Status If given step is initial axis position */ public function isZeroStep( $step ) { return ( $this->getLabel( $step ) == 0 ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/charts/000077500000000000000000000000001226600447100222275ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/charts/bar.php000066400000000000000000000050131226600447100235030ustar00rootroot00000000000000 * // Create a new line chart * $chart = new ezcGraphBarChart(); * * // Add data to line chart * $chart->data['sample dataset'] = new ezcGraphArrayDataSet( * array( * '100' => 1.2, * '200' => 43.2, * '300' => -34.14, * '350' => 65, * '400' => 123, * ) * ); * * // Render chart with default 2d renderer and default SVG driver * $chart->render( 500, 200, 'bar_chart.svg' ); * * * Each chart consists of several chart elements which represents logical * parts of the chart and can be formatted independently. The bar chart * consists of: * - title ( {@link ezcGraphChartElementText} ) * - legend ( {@link ezcGraphChartElementLegend} ) * - background ( {@link ezcGraphChartElementBackground} ) * - xAxis ( {@link ezcGraphChartElementLabeledAxis} ) * - yAxis ( {@link ezcGraphChartElementNumericAxis} ) * * The type of the axis may be changed and all elements can be configured by * accessing them as properties of the chart: * * * $chart->legend->position = ezcGraph::RIGHT; * * * The chart itself also offers several options to configure the appearance. As * bar charts extend line charts the the extended configure options are * available in {@link ezcGraphLineChartOptions} extending the * {@link ezcGraphChartOptions}. * * @property ezcGraphLineChartOptions $options * Chart options class * * @version 1.5 * @package Graph * @mainclass */ class ezcGraphBarChart extends ezcGraphLineChart { /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { parent::__construct(); $this->elements['xAxis']->axisLabelRenderer = new ezcGraphAxisBoxedLabelRenderer(); } /** * Returns the default display type of the current chart type. * * @return int Display type */ public function getDefaultDisplayType() { return ezcGraph::BAR; } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/charts/horizontal_bar.php000066400000000000000000000247001226600447100257600ustar00rootroot00000000000000 * // Create a new horizontal bar chart * $chart = new ezcGraphHorizontalBarChart(); * * // Add data to line chart * $chart->data['sample dataset'] = new ezcGraphArrayDataSet( * array( * '100' => 1.2, * '200' => 43.2, * '300' => -34.14, * '350' => 65, * '400' => 123, * ) * ); * * // Render chart with the special designated renderer and default SVG driver * $chart->renderer = new ezcGraphHorizontalRenderer(); * $chart->render( 500, 200, 'bar_chart.svg' ); * * * Each chart consists of several chart elements which represents logical * parts of the chart and can be formatted independently. The bar chart * consists of: * - title ( {@link ezcGraphChartElementText} ) * - legend ( {@link ezcGraphChartElementLegend} ) * - background ( {@link ezcGraphChartElementBackground} ) * - xAxis ( {@link ezcGraphChartElementLabeledAxis} ) * - yAxis ( {@link ezcGraphChartElementNumericAxis} ) * * The type of the axis may be changed and all elements can be configured by * accessing them as properties of the chart: * * * $chart->legend->position = ezcGraph::RIGHT; * * * The chart itself also offers several options to configure the appearance. As * bar charts extend line charts the the extended configure options are * available in {@link ezcGraphLineChartOptions} extending the * {@link ezcGraphChartOptions}. * * @property ezcGraphLineChartOptions $options * Chart options class * * @version 1.5 * @package Graph * @mainclass */ class ezcGraphHorizontalBarChart extends ezcGraphBarChart { /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { parent::__construct(); $this->addElement( 'xAxis', new ezcGraphChartElementNumericAxis() ); $this->elements['xAxis']->axisLabelRenderer = new ezcGraphAxisCenteredLabelRenderer(); $this->elements['xAxis']->position = ezcGraph::LEFT; $this->addElement( 'yAxis', new ezcGraphChartElementLabeledAxis() ); $this->elements['yAxis']->axisLabelRenderer = new ezcGraphAxisBoxedLabelRenderer(); $this->elements['yAxis']->position = ezcGraph::BOTTOM; $this->renderer = new ezcGraphHorizontalRenderer(); } /** * Render the assigned data * * Will renderer all charts data in the remaining boundings after drawing * all other chart elements. The data will be rendered depending on the * settings in the dataset. * * @param ezcGraphRenderer $renderer Renderer * @param ezcGraphBoundings $boundings Remaining boundings * @return void */ protected function renderData( ezcGraphRenderer $renderer, ezcGraphBoundings $boundings, ezcGraphBoundings $innerBoundings ) { // Use inner boundings for drawning chart data $boundings = $innerBoundings; $yAxisNullPosition = $this->elements['xAxis']->getCoordinate( false ); // Initialize counters $nr = array(); $count = array(); foreach ( $this->data as $data ) { if ( !isset( $nr[$data->displayType->default] ) ) { $nr[$data->displayType->default] = 0; $count[$data->displayType->default] = 0; } $nr[$data->displayType->default]++; $count[$data->displayType->default]++; } $checkedRegularSteps = false; // Display data foreach ( $this->data as $datasetName => $data ) { --$nr[$data->displayType->default]; // Check which axis should be used $xAxis = ( $data->xAxis->default ? $data->xAxis->default: $this->elements['xAxis'] ); $yAxis = ( $data->yAxis->default ? $data->yAxis->default: $this->elements['yAxis'] ); // Determine fill color for dataset if ( $this->options->fillLines !== false ) { $fillColor = clone $data->color->default; $fillColor->alpha = (int) round( ( 255 - $fillColor->alpha ) * ( $this->options->fillLines / 255 ) ); } else { $fillColor = null; } // Ensure regular steps on axis when used with bar charts and // precalculate some values use to render bar charts // // Called only once and only when bars should be rendered if ( ( $checkedRegularSteps === false ) && ( $data->displayType->default === ezcGraph::BAR ) ) { $height = $this->calculateStepWidth( $yAxis, $xAxis, $boundings->height )->y; } // Draw lines for dataset $lastPoint = false; foreach ( $data as $key => $value ) { // Calculate point in chart $point = $xAxis->axisLabelRenderer->modifyChartDataPosition( $yAxis->axisLabelRenderer->modifyChartDataPosition( new ezcGraphCoordinate( $xAxis->getCoordinate( $value ), $yAxis->getCoordinate( $key ) ) ) ); // Render depending on display type of dataset switch ( true ) { case $data->displayType->default === ezcGraph::BAR: $renderer->drawHorizontalBar( $boundings, new ezcGraphContext( $datasetName, $key, $data->url[$key] ), $data->color[$key], $point, $height, $nr[$data->displayType->default], $count[$data->displayType->default], $data->symbol[$key], $yAxisNullPosition ); // Render highlight string if requested if ( $data->highlight[$key] ) { $renderer->drawDataHighlightText( $boundings, new ezcGraphContext( $datasetName, $key, $data->url[$key] ), $point, $yAxisNullPosition, $nr[$data->displayType->default], $count[$data->displayType->default], $this->options->highlightFont, ( $data->highlightValue[$key] ? $data->highlightValue[$key] : $value ), $this->options->highlightSize + $this->options->highlightFont->padding * 2, ( $this->options->highlightLines ? $data->color[$key] : null ), ( $this->options->highlightXOffset ? $this->options->highlightXOffset : 0 ), ( $this->options->highlightYOffset ? $this->options->highlightYOffset : 0 ), $height, $data->displayType->default ); } break; default: throw new ezcGraphInvalidDisplayTypeException( $data->displayType->default ); break; } // Store last point, used to connect lines in line chart. $lastPoint = $point; } } } /** * Aggregate and calculate value boundings on axis. * * This function is nearly the same as in ezcGraphLineChart, but reverses * the usage of keys and values for the axis. * * @return void */ protected function setAxisValues() { // Virtual data set build for agrregated values sums for bar charts $virtualBarSumDataSet = array( array(), array() ); // Calculate axis scaling and labeling foreach ( $this->data as $dataset ) { $nr = 0; $labels = array(); $values = array(); foreach ( $dataset as $label => $value ) { $labels[] = $label; $values[] = $value; // Build sum of all bars if ( $this->options->stackBars && ( $dataset->displayType->default === ezcGraph::BAR ) ) { if ( !isset( $virtualBarSumDataSet[(int) $value >= 0][$nr] ) ) { $virtualBarSumDataSet[(int) $value >= 0][$nr++] = $value; } else { $virtualBarSumDataSet[(int) $value >= 0][$nr++] += $value; } } } // Check if data has been associated with another custom axis, use // default axis otherwise. if ( $dataset->xAxis->default ) { $dataset->xAxis->default->addData( $values ); } else { $this->elements['xAxis']->addData( $values ); } if ( $dataset->yAxis->default ) { $dataset->yAxis->default->addData( array_reverse( $labels ) ); } else { $this->elements['yAxis']->addData( array_reverse( $labels ) ); } } // There should always be something assigned to the main x and y axis. if ( !$this->elements['xAxis']->initialized || !$this->elements['yAxis']->initialized ) { throw new ezcGraphNoDataException(); } // Calculate boundings from assigned data $this->elements['xAxis']->calculateAxisBoundings(); $this->elements['yAxis']->calculateAxisBoundings(); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/charts/line.php000066400000000000000000000645061226600447100237020ustar00rootroot00000000000000 * // Create a new line chart * $chart = new ezcGraphLineChart(); * * // Add data to line chart * $chart->data['sample dataset'] = new ezcGraphArrayDataSet( * array( * '100' => 1.2, * '200' => 43.2, * '300' => -34.14, * '350' => 65, * '400' => 123, * ) * ); * * // Render chart with default 2d renderer and default SVG driver * $chart->render( 500, 200, 'line_chart.svg' ); * * * Each chart consists of several chart elements which represents logical * parts of the chart and can be formatted independently. The line chart * consists of: * - title ( {@link ezcGraphChartElementText} ) * - legend ( {@link ezcGraphChartElementLegend} ) * - background ( {@link ezcGraphChartElementBackground} ) * - xAxis ( {@link ezcGraphChartElementLabeledAxis} ) * - yAxis ( {@link ezcGraphChartElementNumericAxis} ) * * The type of the axis may be changed and all elements can be configured by * accessing them as properties of the chart: * * * $chart->legend->position = ezcGraph::RIGHT; * * * The chart itself also offers several options to configure the appearance. * The extended configure options are available in * {@link ezcGraphLineChartOptions} extending the {@link ezcGraphChartOptions}. * * @property ezcGraphLineChartOptions $options * Chart options class * * @version 1.5 * @package Graph * @mainclass */ class ezcGraphLineChart extends ezcGraphChart { /** * Array with additional axis for the chart * * @var ezcGraphAxisContainer */ protected $additionalAxis; /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->additionalAxis = new ezcGraphAxisContainer( $this ); $this->options = new ezcGraphLineChartOptions( $options ); $this->options->highlightFont = $this->options->font; parent::__construct(); $this->addElement( 'xAxis', new ezcGraphChartElementLabeledAxis() ); $this->elements['xAxis']->position = ezcGraph::LEFT; $this->addElement( 'yAxis', new ezcGraphChartElementNumericAxis() ); $this->elements['yAxis']->position = ezcGraph::BOTTOM; } /** * __get * * @param mixed $propertyName * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return mixed * @ignore */ public function __get( $propertyName ) { switch ( $propertyName ) { case 'additionalAxis': return $this->additionalAxis; } return parent::__get( $propertyName ); } /** * Options write access * * @throws ezcBasePropertyNotFoundException * If Option could not be found * @throws ezcBaseValueException * If value is out of range * @param mixed $propertyName Option name * @param mixed $propertyValue Option value; * @return mixed * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'xAxis': if ( $propertyValue instanceof ezcGraphChartElementAxis ) { $this->addElement( 'xAxis', $propertyValue ); $this->elements['xAxis']->position = ezcGraph::LEFT; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphChartElementAxis' ); } break; case 'yAxis': if ( $propertyValue instanceof ezcGraphChartElementAxis ) { $this->addElement( 'yAxis', $propertyValue ); $this->elements['yAxis']->position = ezcGraph::BOTTOM; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphChartElementAxis' ); } break; default: parent::__set( $propertyName, $propertyValue ); } } /** * Set colors and border for this element * * @param ezcGraphPalette $palette Palette * @return void */ public function setFromPalette( ezcGraphPalette $palette ) { foreach ( $this->additionalAxis as $element ) { $element->setFromPalette( $palette ); } parent::setFromPalette( $palette ); } /** * Calculate bar chart step width * * @return void */ protected function calculateStepWidth( ezcGraphChartElementAxis $mainAxis, ezcGraphChartElementAxis $secondAxis, $width ) { $steps = $mainAxis->getSteps(); $stepWidth = null; foreach ( $steps as $step ) { if ( $stepWidth === null ) { $stepWidth = $step->width; } elseif ( $step->width !== $stepWidth ) { throw new ezcGraphUnregularStepsException(); } } $step = reset( $steps ); if ( count( $step->childs ) ) { // Keep this for BC reasons $barCount = ( $mainAxis->getMajorStepCount() + 1 ) * ( $mainAxis->getMinorStepCount() - 1 ); $stepWidth = 1 / $barCount; } $checkedRegularSteps = true; return $mainAxis->axisLabelRenderer->modifyChartDataPosition( $secondAxis->axisLabelRenderer->modifyChartDataPosition( new ezcGraphCoordinate( $width * $stepWidth, $width * $stepWidth ) ) ); } /** * Render the assigned data * * Will renderer all charts data in the remaining boundings after drawing * all other chart elements. The data will be rendered depending on the * settings in the dataset. * * @param ezcGraphRenderer $renderer Renderer * @param ezcGraphBoundings $boundings Remaining boundings * @return void */ protected function renderData( ezcGraphRenderer $renderer, ezcGraphBoundings $boundings, ezcGraphBoundings $innerBoundings ) { // Use inner boundings for drawning chart data $boundings = $innerBoundings; $yAxisNullPosition = $this->elements['yAxis']->getCoordinate( false ); // Initialize counters $nr = array(); $count = array(); foreach ( $this->data as $data ) { if ( !isset( $nr[$data->displayType->default] ) ) { $nr[$data->displayType->default] = 0; $count[$data->displayType->default] = 0; } $nr[$data->displayType->default]++; $count[$data->displayType->default]++; } $checkedRegularSteps = false; // Display data foreach ( $this->data as $datasetName => $data ) { --$nr[$data->displayType->default]; // Check which axis should be used $xAxis = ( $data->xAxis->default ? $data->xAxis->default: $this->elements['xAxis'] ); $yAxis = ( $data->yAxis->default ? $data->yAxis->default: $this->elements['yAxis'] ); // Determine fill color for dataset if ( $this->options->fillLines !== false ) { $fillColor = clone $data->color->default; $fillColor->alpha = (int) round( ( 255 - $fillColor->alpha ) * ( $this->options->fillLines / 255 ) ); } else { $fillColor = null; } // Ensure regular steps on axis when used with bar charts and // precalculate some values use to render bar charts // // Called only once and only when bars should be rendered if ( ( $checkedRegularSteps === false ) && ( $data->displayType->default === ezcGraph::BAR ) ) { $width = $this->calculateStepWidth( $xAxis, $yAxis, $boundings->width )->x; } // Draw lines for dataset $lastPoint = false; foreach ( $data as $key => $value ) { // Calculate point in chart $point = $xAxis->axisLabelRenderer->modifyChartDataPosition( $yAxis->axisLabelRenderer->modifyChartDataPosition( new ezcGraphCoordinate( $xAxis->getCoordinate( $key ), $yAxis->getCoordinate( $value ) ) ) ); // Render depending on display type of dataset switch ( true ) { case $data->displayType->default === ezcGraph::LINE: $renderer->drawDataLine( $boundings, new ezcGraphContext( $datasetName, $key, $data->url[$key] ), $data->color->default, ( $lastPoint === false ? $point : $lastPoint ), $point, $nr[$data->displayType->default], $count[$data->displayType->default], $data->symbol[$key], $data->color[$key], $fillColor, $yAxisNullPosition, ( $data->lineThickness->default ? $data->lineThickness->default : $this->options->lineThickness ) ); // Render highlight string if requested if ( $data->highlight[$key] ) { $renderer->drawDataHighlightText( $boundings, new ezcGraphContext( $datasetName, $key, $data->url[$key] ), $point, $yAxisNullPosition, $nr[$data->displayType->default], $count[$data->displayType->default], $this->options->highlightFont, ( $data->highlightValue[$key] ? $data->highlightValue[$key] : $value ), $this->options->highlightSize + $this->options->highlightFont->padding * 2, ( $this->options->highlightLines ? $data->color[$key] : null ), ( $this->options->highlightXOffset ? $this->options->highlightXOffset : 0 ), ( $this->options->highlightYOffset ? $this->options->highlightYOffset : 0 ), 0., ezcGraph::LINE ); } break; case ( $data->displayType->default === ezcGraph::BAR ) && $this->options->stackBars : // Check if a bar has already been stacked if ( !isset( $stackedValue[(int) ( $point->x * 10000 )][(int) $value > 0] ) ) { $start = new ezcGraphCoordinate( $point->x, $yAxisNullPosition ); $stackedValue[(int) ( $point->x * 10000 )][(int) $value > 0] = $value; } else { $start = $xAxis->axisLabelRenderer->modifyChartDataPosition( $yAxis->axisLabelRenderer->modifyChartDataPosition( new ezcGraphCoordinate( $xAxis->getCoordinate( $key ), $yAxis->getCoordinate( $stackedValue[(int) ( $point->x * 10000 )][(int) $value > 0] ) ) ) ); $point = $xAxis->axisLabelRenderer->modifyChartDataPosition( $yAxis->axisLabelRenderer->modifyChartDataPosition( new ezcGraphCoordinate( $xAxis->getCoordinate( $key ), $yAxis->getCoordinate( $stackedValue[(int) ( $point->x * 10000 )][(int) $value > 0] += $value ) ) ) ); } // Force one symbol for each stacked bar if ( !isset( $stackedSymbol[(int) ( $point->x * 10000 )] ) ) { $stackedSymbol[(int) ( $point->x * 10000 )] = $data->symbol[$key]; } // Store stacked value for next iteration $side = ( $point->y == 0 ? 1 : $point->y / abs( $point->y ) ); $stacked[(int) ( $point->x * 10000 )][$side] = $point; $renderer->drawStackedBar( $boundings, new ezcGraphContext( $datasetName, $key, $data->url[$key] ), $data->color->default, $start, $point, $width, $stackedSymbol[(int) ( $point->x * 10000 )], $yAxisNullPosition ); // Render highlight string if requested if ( $data->highlight[$key] ) { $renderer->drawDataHighlightText( $boundings, new ezcGraphContext( $datasetName, $key, $data->url[$key] ), $point, $yAxisNullPosition, $nr[$data->displayType->default], $count[$data->displayType->default], $this->options->highlightFont, ( $data->highlightValue[$key] ? $data->highlightValue[$key] : $value ), $this->options->highlightSize + $this->options->highlightFont->padding * 2, ( $this->options->highlightLines ? $data->color[$key] : null ), ( $this->options->highlightXOffset ? $this->options->highlightXOffset : 0 ), ( $this->options->highlightYOffset ? $this->options->highlightYOffset : 0 ), 0., ezcGraph::LINE ); } break; case $data->displayType->default === ezcGraph::BAR: $renderer->drawBar( $boundings, new ezcGraphContext( $datasetName, $key, $data->url[$key] ), $data->color[$key], $point, $width, $nr[$data->displayType->default], $count[$data->displayType->default], $data->symbol[$key], $yAxisNullPosition ); // Render highlight string if requested if ( $data->highlight[$key] ) { $renderer->drawDataHighlightText( $boundings, new ezcGraphContext( $datasetName, $key, $data->url[$key] ), $point, $yAxisNullPosition, $nr[$data->displayType->default], $count[$data->displayType->default], $this->options->highlightFont, ( $data->highlightValue[$key] ? $data->highlightValue[$key] : $value ), $this->options->highlightSize + $this->options->highlightFont->padding * 2, ( $this->options->highlightLines ? $data->color[$key] : null ), ( $this->options->highlightXOffset ? $this->options->highlightXOffset : 0 ), ( $this->options->highlightYOffset ? $this->options->highlightYOffset : 0 ), $width, $data->displayType->default ); } break; default: throw new ezcGraphInvalidDisplayTypeException( $data->displayType->default ); break; } // Store last point, used to connect lines in line chart. $lastPoint = $point; } } } /** * Returns the default display type of the current chart type. * * @return int Display type */ public function getDefaultDisplayType() { return ezcGraph::LINE; } /** * Check if renderer supports features requested by some special chart * options. * * @throws ezcBaseValueException * If some feature is not supported * * @return void */ protected function checkRenderer() { // When stacked bars are enabled, check if renderer supports them if ( $this->options->stackBars ) { if ( !$this->renderer instanceof ezcGraphStackedBarsRenderer ) { throw new ezcBaseValueException( 'renderer', $this->renderer, 'ezcGraphStackedBarsRenderer' ); } } } /** * Aggregate and calculate value boundings on axis. * * @return void */ protected function setAxisValues() { // Virtual data set build for agrregated values sums for bar charts $virtualBarSumDataSet = array( array(), array() ); // Calculate axis scaling and labeling foreach ( $this->data as $dataset ) { $nr = 0; $labels = array(); $values = array(); foreach ( $dataset as $label => $value ) { $labels[] = $label; $values[] = $value; // Build sum of all bars if ( $this->options->stackBars && ( $dataset->displayType->default === ezcGraph::BAR ) ) { if ( !isset( $virtualBarSumDataSet[(int) $value >= 0][$nr] ) ) { $virtualBarSumDataSet[(int) $value >= 0][$nr++] = $value; } else { $virtualBarSumDataSet[(int) $value >= 0][$nr++] += $value; } } } // Check if data has been associated with another custom axis, use // default axis otherwise. if ( $dataset->xAxis->default ) { $dataset->xAxis->default->addData( $labels ); } else { $this->elements['xAxis']->addData( $labels ); } if ( $dataset->yAxis->default ) { $dataset->yAxis->default->addData( $values ); } else { $this->elements['yAxis']->addData( $values ); } } // Also use stacked bar values as base for y axis value span // calculation if ( $this->options->stackBars ) { $this->elements['yAxis']->addData( $virtualBarSumDataSet[0] ); $this->elements['yAxis']->addData( $virtualBarSumDataSet[1] ); } // There should always be something assigned to the main x and y axis. if ( !$this->elements['xAxis']->initialized || !$this->elements['yAxis']->initialized ) { throw new ezcGraphNoDataException(); } // Calculate boundings from assigned data $this->elements['xAxis']->calculateAxisBoundings(); $this->elements['yAxis']->calculateAxisBoundings(); } /** * Renders the basic elements of this chart type * * @param int $width * @param int $height * @return void */ protected function renderElements( $width, $height ) { if ( !count( $this->data ) ) { throw new ezcGraphNoDataException(); } // Check if renderer supports requested features $this->checkRenderer(); // Set values form datasets on axis to calculate correct spans $this->setAxisValues(); // Generate legend $this->elements['legend']->generateFromDataSets( $this->data ); // Get boundings from parameters $this->options->width = $width; $this->options->height = $height; // Set image properties in driver $this->driver->options->width = $width; $this->driver->options->height = $height; // Render subelements $boundings = new ezcGraphBoundings(); $boundings->x1 = $this->options->width; $boundings->y1 = $this->options->height; $boundings = $this->elements['xAxis']->axisLabelRenderer->modifyChartBoundings( $this->elements['yAxis']->axisLabelRenderer->modifyChartBoundings( $boundings, new ezcGraphCoordinate( 1, 0 ) ), new ezcGraphCoordinate( -1, 0 ) ); // Render subelements foreach ( $this->elements as $name => $element ) { // Skip element, if it should not get rendered if ( ( $this->renderElement[$name] === false ) || ( $name === 'xAxis' ) || ( $name === 'yAxis' ) ) { continue; } $this->driver->options->font = $element->font; $boundings = $element->render( $this->renderer, $boundings ); } // Set relative positions of axis in chart depending on the "null" // value on the other axis. $this->elements['xAxis']->nullPosition = $this->elements['yAxis']->getCoordinate( false ); $this->elements['yAxis']->nullPosition = $this->elements['xAxis']->getCoordinate( false ); // Calculate inner data boundings of chart $innerBoundings = new ezcGraphBoundings( $boundings->x0 + $boundings->width * $this->elements['yAxis']->axisSpace, $boundings->y0 + $boundings->height * ( ( $this->elements['xAxis']->outerAxisSpace === null ) ? $this->elements['xAxis']->axisSpace : $this->elements['xAxis']->outerAxisSpace ), $boundings->x1 - $boundings->width * ( ( $this->elements['yAxis']->outerAxisSpace === null ) ? $this->elements['yAxis']->axisSpace : $this->elements['yAxis']->outerAxisSpace ), $boundings->y1 - $boundings->height * $this->elements['xAxis']->axisSpace ); // Render axis $this->driver->options->font = $this->elements['yAxis']->font; $boundings = $this->elements['xAxis']->render( $this->renderer, $boundings, $innerBoundings ); $boundings = $this->elements['yAxis']->render( $this->renderer, $boundings, $innerBoundings ); // Render additional axis foreach ( $this->additionalAxis as $element ) { if ( $element->initialized ) { // Calculate all required step sizes if values has been // assigned to axis. $element->calculateAxisBoundings(); } else { // Do not render any axis labels, if no values were assigned // and no step sizes were defined. $element->axisLabelRenderer = new ezcGraphAxisNoLabelRenderer(); } $this->driver->options->font = $element->font; $element->nullPosition = $element->chartPosition; $boundings = $element->render( $this->renderer, $boundings, $innerBoundings ); } // Render graph $this->renderData( $this->renderer, $boundings, $innerBoundings ); } /** * Render the line chart * * Renders the chart into a file or stream. The width and height are * needed to specify the dimensions of the resulting image. For direct * output use 'php://stdout' as output file. * * @param int $width Image width * @param int $height Image height * @param string $file Output file * @apichange * @return void */ public function render( $width, $height, $file = null ) { $this->renderElements( $width, $height ); if ( !empty( $file ) ) { $this->renderer->render( $file ); } $this->renderedFile = $file; } /** * Renders this chart to direct output * * Does the same as ezcGraphChart::render(), but renders directly to * output and not into a file. * * @param int $width * @param int $height * @apichange * @return void */ public function renderToOutput( $width, $height ) { // @TODO: merge this function with render an deprecate ommit of third // argument in render() when API break is possible $this->renderElements( $width, $height ); $this->renderer->render( null ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/charts/odometer.php000066400000000000000000000220261226600447100245600ustar00rootroot00000000000000 * $graph = new ezcGraphOdometerChart(); * $graph->title = 'Custom odometer'; * * $graph->data['data'] = new ezcGraphArrayDataSet( * array( 87 ) * ); * * // Set the marker color * $graph->data['data']->color[0] = '#A0000055'; * * // Set colors for the background gradient * $graph->options->startColor = '#2E3436'; * $graph->options->endColor = '#EEEEEC'; * * // Define a border for the odometer * $graph->options->borderWidth = 2; * $graph->options->borderColor = '#BABDB6'; * * // Set marker width * $graph->options->markerWidth = 5; * * // Set space, which the odometer may consume * $graph->options->odometerHeight = .7; * * // Set axis span and label * $graph->axis->min = 0; * $graph->axis->max = 100; * $graph->axis->label = 'Coverage '; * * $graph->render( 400, 150, 'custom_odometer_chart.svg' ); * * * Each chart consists of several chart elements which represents logical parts * of the chart and can be formatted independently. The odometer chart consists * of: * - title ( {@link ezcGraphChartElementText} ) * - background ( {@link ezcGraphChartElementBackground} ) * * All elements can be configured by accessing them as properties of the chart: * * * $chart->title->position = ezcGraph::BOTTOM; * * * The chart itself also offers several options to configure the appearance. * The extended configure options are available in * {@link ezcGraphOdometerChartOptions} extending the {@link * ezcGraphChartOptions}. * * @property ezcGraphOdometerChartOptions $options * Chart options class * * @version 1.5 * @package Graph * @mainclass */ class ezcGraphOdometerChart extends ezcGraphChart { /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->options = new ezcGraphOdometerChartOptions( $options ); parent::__construct( $options ); $this->data = new ezcGraphChartSingleDataContainer( $this ); $this->addElement( 'axis', new ezcGraphChartElementNumericAxis()); $this->elements['axis']->axisLabelRenderer = new ezcGraphAxisCenteredLabelRenderer(); $this->elements['axis']->axisLabelRenderer->showZeroValue = true; $this->elements['axis']->position = ezcGraph::LEFT; $this->elements['axis']->axisSpace = .05; } /** * Property write access * * @throws ezcBasePropertyNotFoundException * If Option could not be found * @throws ezcBaseValueException * If value is out of range * @param string $propertyName Option name * @param mixed $propertyValue Option value; * @return void * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'axis': if ( $propertyValue instanceof ezcGraphChartElementAxis ) { $this->addElement( 'axis', $propertyValue ); $this->elements['axis']->axisLabelRenderer = new ezcGraphAxisCenteredLabelRenderer(); $this->elements['axis']->axisLabelRenderer->showZeroValue = true; $this->elements['axis']->position = ezcGraph::LEFT; $this->elements['axis']->axisSpace = .05; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphChartElementAxis' ); } break; case 'renderer': if ( $propertyValue instanceof ezcGraphOdometerRenderer ) { parent::__set( $propertyName, $propertyValue ); } else { throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphOdometerRenderer' ); } break; default: parent::__set( $propertyName, $propertyValue ); } } /** * Render the assigned data * * Will renderer all charts data in the remaining boundings after drawing * all other chart elements. The data will be rendered depending on the * settings in the dataset. * * @param ezcGraphRenderer $renderer Renderer * @param ezcGraphBoundings $boundings Remaining boundings * @return void */ protected function renderData( ezcGraphRenderer $renderer, ezcGraphBoundings $boundings ) { // Draw the odometer data $dataset = $this->data->rewind(); foreach ( $dataset as $key => $value ) { $renderer->drawOdometerMarker( $boundings, $this->elements['axis']->axisLabelRenderer->modifyChartDataPosition( new ezcGraphCoordinate( $this->elements['axis']->getCoordinate( $value ), 0 ) ), $dataset->symbol[$key], $dataset->color[$key], $this->options->markerWidth ); } } /** * Returns the default display type of the current chart type. * * @return int Display type */ public function getDefaultDisplayType() { return ezcGraph::ODOMETER; } /** * Renders the basic elements of this chart type * * @param int $width * @param int $height * @return void */ protected function renderElements( $width, $height ) { if ( !count( $this->data ) ) { throw new ezcGraphNoDataException(); } // Set image properties in driver $this->driver->options->width = $width; $this->driver->options->height = $height; // no legend $this->renderElement['legend'] = false; // Get boundings from parameters $this->options->width = $width; $this->options->height = $height; $boundings = new ezcGraphBoundings(); $boundings->x1 = $this->options->width; $boundings->y1 = $this->options->height; // Get values out the single used dataset to calculate axis boundings $values = array(); foreach ( $this->data->rewind() as $value ) { $values[] = $value; } // Set values for Axis $this->elements['axis']->addData( $values ); $this->elements['axis']->nullPosition = 0.5 + $this->options->odometerHeight / 2; $this->elements['axis']->calculateAxisBoundings(); // Render subelements exept axis, which will be drawn together with the // odometer bar foreach ( $this->elements as $name => $element ) { // Skip element, if it should not get rendered if ( $this->renderElement[$name] === false || $name === 'axis' ) { continue; } $this->driver->options->font = $element->font; $boundings = $element->render( $this->renderer, $boundings ); } // Draw basic odometer $this->driver->options->font = $this->elements['axis']->font; $boundings = $this->renderer->drawOdometer( $boundings, $this->elements['axis'], $this->options ); // Render graph $this->renderData( $this->renderer, $boundings ); } /** * Render the pie chart * * Renders the chart into a file or stream. The width and height are * needed to specify the dimensions of the resulting image. For direct * output use 'php://stdout' as output file. * * @param int $width Image width * @param int $height Image height * @param string $file Output file * @apichange * @return void */ public function render( $width, $height, $file = null ) { $this->renderElements( $width, $height ); if ( !empty( $file ) ) { $this->renderer->render( $file ); } $this->renderedFile = $file; } /** * Renders this chart to direct output * * Does the same as ezcGraphChart::render(), but renders directly to * output and not into a file. * * @param int $width * @param int $height * @apichange * @return void */ public function renderToOutput( $width, $height ) { // @TODO: merge this function with render an deprecate ommit of third // argument in render() when API break is possible $this->renderElements( $width, $height ); $this->renderer->render( null ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/charts/pie.php000066400000000000000000000215511226600447100235210ustar00rootroot00000000000000 * // Create a new pie chart * $chart = new ezcGraphPieChart(); * * // Add data to line chart * $chart->data['sample dataset'] = new ezcGraphArrayDataSet( * array( * 'one' => 1.2, * 'two' => 43.2, * 'three' => -34.14, * 'four' => 65, * 'five' => 123, * ) * ); * * // Render chart with default 2d renderer and default SVG driver * $chart->render( 500, 200, 'pie_chart.svg' ); * * * Each chart consists of several chart elements which represents logical * parts of the chart and can be formatted independently. The pie chart * consists of: * - title ( {@link ezcGraphChartElementText} ) * - legend ( {@link ezcGraphChartElementLegend} ) * - background ( {@link ezcGraphChartElementBackground} ) * * All elements can be configured by accessing them as properties of the chart: * * * $chart->legend->position = ezcGraph::RIGHT; * * * The chart itself also offers several options to configure the appearance. * The extended configure options are available in * {@link ezcGraphPieChartOptions} extending the {@link ezcGraphChartOptions}. * * @property ezcGraphPieChartOptions $options * Chart options class * * @version 1.5 * @package Graph * @mainclass */ class ezcGraphPieChart extends ezcGraphChart { /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->options = new ezcGraphPieChartOptions( $options ); parent::__construct( $options ); $this->data = new ezcGraphChartSingleDataContainer( $this ); } /** * Render the assigned data * * Will renderer all charts data in the remaining boundings after drawing * all other chart elements. The data will be rendered depending on the * settings in the dataset. * * @param ezcGraphRenderer $renderer Renderer * @param ezcGraphBoundings $boundings Remaining boundings * @return void */ protected function renderData( ezcGraphRenderer $renderer, ezcGraphBoundings $boundings ) { // Only draw the first (and only) dataset $dataset = $this->data->rewind(); $datasetName = $this->data->key(); $this->driver->options->font = $this->options->font; // Calculate sum of all values to be able to calculate percentage $sum = 0; foreach ( $dataset as $name => $value ) { if ( $value < 0 ) { throw new ezcGraphInvalidDataException( "Values >= 0 required, '$name' => '$value'." ); } $sum += $value; } if ( $this->options->sum !== false ) { $sum = max( $sum, $this->options->sum ); } if ( $sum <= 0 ) { throw new ezcGraphInvalidDataException( "Pie charts require a value sum > 0, your value: '$sum'." ); } $angle = 0; foreach ( $dataset as $label => $value ) { // Skip rendering values which equals 0 if ( $value <= 0 ) { continue; } switch ( $dataset->displayType->default ) { case ezcGraph::PIE: $displayLabel = ( $this->options->labelCallback !== null ? call_user_func( $this->options->labelCallback, $label, $value, $value / $sum ) : sprintf( $this->options->label, $label, $value, $value / $sum * 100 ) ); $renderer->drawPieSegment( $boundings, new ezcGraphContext( $datasetName, $label, $dataset->url[$label] ), $dataset->color[$label], $angle, $angle += $value / $sum * 360, $displayLabel, $dataset->highlight[$label] ); break; default: throw new ezcGraphInvalidDisplayTypeException( $dataset->displayType->default ); break; } } } /** * Returns the default display type of the current chart type. * * @return int Display type */ public function getDefaultDisplayType() { return ezcGraph::PIE; } /** * Apply tresh hold * * Iterates over the dataset and applies the configured tresh hold to * the datasets data. * * @return void */ protected function applyThreshold() { if ( $this->options->percentThreshold || $this->options->absoluteThreshold ) { $dataset = $this->data->rewind(); $sum = 0; foreach ( $dataset as $value ) { $sum += $value; } if ( $this->options->sum !== false ) { $sum = max( $sum, $this->options->sum ); } $unset = array(); foreach ( $dataset as $label => $value ) { if ( $label === $this->options->summarizeCaption ) { continue; } if ( ( $value <= $this->options->absoluteThreshold ) || ( ( $value / $sum ) <= $this->options->percentThreshold ) ) { if ( !isset( $dataset[$this->options->summarizeCaption] ) ) { $dataset[$this->options->summarizeCaption] = $value; } else { $dataset[$this->options->summarizeCaption] += $value; } $unset[] = $label; } } foreach ( $unset as $label ) { unset( $dataset[$label] ); } } } /** * Renders the basic elements of this chart type * * @param int $width * @param int $height * @return void */ protected function renderElements( $width, $height ) { if ( !count( $this->data ) ) { throw new ezcGraphNoDataException(); } // Set image properties in driver $this->driver->options->width = $width; $this->driver->options->height = $height; // Apply tresh hold $this->applyThreshold(); // Generate legend $this->elements['legend']->generateFromDataSet( $this->data->rewind() ); // Get boundings from parameters $this->options->width = $width; $this->options->height = $height; $boundings = new ezcGraphBoundings(); $boundings->x1 = $this->options->width; $boundings->y1 = $this->options->height; // Render subelements foreach ( $this->elements as $name => $element ) { // Skip element, if it should not get rendered if ( $this->renderElement[$name] === false ) { continue; } $this->driver->options->font = $element->font; $boundings = $element->render( $this->renderer, $boundings ); } // Render graph $this->renderData( $this->renderer, $boundings ); } /** * Render the pie chart * * Renders the chart into a file or stream. The width and height are * needed to specify the dimensions of the resulting image. For direct * output use 'php://stdout' as output file. * * @param int $width Image width * @param int $height Image height * @param string $file Output file * @apichange * @return void */ public function render( $width, $height, $file = null ) { $this->renderElements( $width, $height ); if ( !empty( $file ) ) { $this->renderer->render( $file ); } $this->renderedFile = $file; } /** * Renders this chart to direct output * * Does the same as ezcGraphChart::render(), but renders directly to * output and not into a file. * * @param int $width * @param int $height * @apichange * @return void */ public function renderToOutput( $width, $height ) { // @TODO: merge this function with render an deprecate ommit of third // argument in render() when API break is possible $this->renderElements( $width, $height ); $this->renderer->render( null ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/charts/radar.php000066400000000000000000000351331226600447100240360ustar00rootroot00000000000000 * // Create a new radar chart * $chart = new ezcGraphRadarChart(); * * // Add data to line chart * $chart->data['sample dataset'] = new ezcGraphArrayDataSet( * array( * '100' => 1.2, * '200' => 43.2, * '300' => -34.14, * '350' => 65, * '400' => 123, * ) * ); * * // Render chart with default 2d renderer and default SVG driver * $chart->render( 500, 200, 'radar_chart.svg' ); * * * Each chart consists of several chart elements which represents logical * parts of the chart and can be formatted independently. The line chart * consists of: * - title ( {@link ezcGraphChartElementText} ) * - legend ( {@link ezcGraphChartElementLegend} ) * - background ( {@link ezcGraphChartElementBackground} ) * - axis ( {@link ezcGraphChartElementNumericAxis} ) * - ratation axis ( {@link ezcGraphChartElementLabeledAxis} ) * * The type of the axis may be changed and all elements can be configured by * accessing them as properties of the chart: * * The chart itself also offers several options to configure the appearance. * The extended configure options are available in * {@link ezcGraphRadarChartOptions} extending the * {@link ezcGraphChartOptions}. * * * $chart->legend->position = ezcGraph::RIGHT; * * * @property ezcGraphRadarChartOptions $options * Chart options class * * @version 1.5 * @package Graph * @mainclass */ class ezcGraphRadarChart extends ezcGraphChart { /** * Store major grid color for child axis. * * @var ezcGraphColor */ protected $childAxisColor; /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->options = new ezcGraphRadarChartOptions( $options ); $this->options->highlightFont = $this->options->font; parent::__construct(); $this->elements['rotationAxis'] = new ezcGraphChartElementLabeledAxis(); $this->addElement( 'axis', new ezcGraphChartElementNumericAxis() ); $this->elements['axis']->position = ezcGraph::BOTTOM; $this->elements['axis']->axisLabelRenderer = new ezcGraphAxisRadarLabelRenderer(); $this->elements['axis']->axisLabelRenderer->outerStep = true; $this->addElement( 'rotationAxis', new ezcGraphChartElementLabeledAxis() ); // Do not render axis with default method, because we need an axis for // each label in dataset $this->renderElement['axis'] = false; $this->renderElement['rotationAxis'] = false; } /** * Set colors and border fro this element * * @param ezcGraphPalette $palette Palette * @return void */ public function setFromPalette( ezcGraphPalette $palette ) { $this->childAxisColor = $palette->majorGridColor; parent::setFromPalette( $palette ); } /** * Property write access * * @throws ezcBasePropertyNotFoundException * If Option could not be found * @throws ezcBaseValueException * If value is out of range * @param string $propertyName Option name * @param mixed $propertyValue Option value; * @return void * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'axis': if ( $propertyValue instanceof ezcGraphChartElementAxis ) { $this->addElement( 'axis', $propertyValue ); $this->elements['axis']->position = ezcGraph::BOTTOM; $this->elements['axis']->axisLabelRenderer = new ezcGraphAxisRadarLabelRenderer(); $this->renderElement['axis'] = false; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphChartElementAxis' ); } break; case 'rotationAxis': if ( $propertyValue instanceof ezcGraphChartElementAxis ) { $this->addElement( 'rotationAxis', $propertyValue ); $this->renderElement['rotationAxis'] = false; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphChartElementAxis' ); } break; case 'renderer': if ( $propertyValue instanceof ezcGraphRadarRenderer ) { parent::__set( $propertyName, $propertyValue ); } else { throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphRadarRenderer' ); } break; default: parent::__set( $propertyName, $propertyValue ); } } /** * Draws a single rotated axis * * Sets the axis label position depending on the axis rotation. * * @param ezcGraphChartElementAxis $axis * @param ezcGraphBoundings $boundings * @param ezcGraphCoordinate $center * @param float $position * @param float $lastPosition * @return void */ protected function drawRotatedAxis( ezcGraphChartElementAxis $axis, ezcGraphBoundings $boundings, ezcGraphCoordinate $center, $position, $lastPosition = null ) { // Set axis position depending on angle for better axis label // positioning $angle = $position * 2 * M_PI; switch ( (int) ( ( $position + .125 ) * 4 ) ) { case 0: case 4: $axis->position = ezcGraph::BOTTOM; break; case 1: $axis->position = ezcGraph::LEFT; break; case 2: $axis->position = ezcGraph::TOP; break; case 3: $axis->position = ezcGraph::RIGHT; break; } // Set last step to correctly draw grid if ( $axis->axisLabelRenderer instanceof ezcGraphAxisRadarLabelRenderer ) { $axis->axisLabelRenderer->lastStep = $lastPosition; } // Do not draw axis label for last step if ( abs( $position - 1 ) <= .001 ) { $axis->label = null; } $this->renderer->drawAxis( $boundings, clone $center, $dest = new ezcGraphCoordinate( $center->x + sin( $angle ) * ( $boundings->width / 2 ), $center->y - cos( $angle ) * ( $boundings->height / 2 ) ), clone $axis, clone $axis->axisLabelRenderer ); } /** * Render the assigned data * * Will renderer all charts data in the remaining boundings after drawing * all other chart elements. The data will be rendered depending on the * settings in the dataset. * * @param ezcGraphRenderer $renderer Renderer * @param ezcGraphBoundings $boundings Remaining boundings * @return void */ protected function renderData( ezcGraphRenderer $renderer, ezcGraphBoundings $boundings ) { // Apply axis space $xAxisSpace = ( $boundings->x1 - $boundings->x0 ) * $this->axis->axisSpace; $yAxisSpace = ( $boundings->y1 - $boundings->y0 ) * $this->axis->axisSpace; $center = new ezcGraphCoordinate( ( $boundings->width / 2 ), ( $boundings->height / 2 ) ); // We do not differentiate between display types in radar charts. $nr = $count = count( $this->data ); // Draw axis at major steps of virtual axis $steps = $this->elements['rotationAxis']->getSteps(); $lastStepPosition = null; $axisColor = $this->elements['axis']->border; foreach ( $steps as $step ) { $this->elements['axis']->label = $step->label; $this->drawRotatedAxis( $this->elements['axis'], $boundings, $center, $step->position, $lastStepPosition ); $lastStepPosition = $step->position; if ( count( $step->childs ) ) { foreach ( $step->childs as $childStep ) { $this->elements['axis']->label = null; $this->elements['axis']->border = $this->childAxisColor; $this->drawRotatedAxis( $this->elements['axis'], $boundings, $center, $childStep->position, $lastStepPosition ); $lastStepPosition = $childStep->position; } } $this->elements['axis']->border = $axisColor; } // Display data $this->elements['axis']->position = ezcGraph::TOP; foreach ( $this->data as $datasetName => $data ) { --$nr; // Determine fill color for dataset if ( $this->options->fillLines !== false ) { $fillColor = clone $data->color->default; $fillColor->alpha = (int) round( ( 255 - $fillColor->alpha ) * ( $this->options->fillLines / 255 ) ); } else { $fillColor = null; } // Draw lines for dataset $lastPoint = false; foreach ( $data as $key => $value ) { $point = new ezcGraphCoordinate( $this->elements['rotationAxis']->getCoordinate( $key ), $this->elements['axis']->getCoordinate( $value ) ); /* Transformation required for 3d like renderers ... * which axis should transform here? $point = $this->elements['xAxis']->axisLabelRenderer->modifyChartDataPosition( $this->elements['yAxis']->axisLabelRenderer->modifyChartDataPosition( new ezcGraphCoordinate( $this->elements['xAxis']->getCoordinate( $key ), $this->elements['yAxis']->getCoordinate( $value ) ) ) ); // */ $renderer->drawRadarDataLine( $boundings, new ezcGraphContext( $datasetName, $key, $data->url[$key] ), $data->color->default, clone $center, ( $lastPoint === false ? $point : $lastPoint ), $point, $nr, $count, $data->symbol[$key], $data->color[$key], $fillColor, $this->options->lineThickness ); $lastPoint = $point; } } } /** * Returns the default display type of the current chart type. * * @return int Display type */ public function getDefaultDisplayType() { return ezcGraph::LINE; } /** * Renders the basic elements of this chart type * * @param int $width * @param int $height * @return void */ protected function renderElements( $width, $height ) { if ( !count( $this->data ) ) { throw new ezcGraphNoDataException(); } // Set image properties in driver $this->driver->options->width = $width; $this->driver->options->height = $height; // Calculate axis scaling and labeling foreach ( $this->data as $dataset ) { $labels = array(); $values = array(); foreach ( $dataset as $label => $value ) { $labels[] = $label; $values[] = $value; } $this->elements['axis']->addData( $values ); $this->elements['rotationAxis']->addData( $labels ); } $this->elements['axis']->calculateAxisBoundings(); $this->elements['rotationAxis']->calculateAxisBoundings(); // Generate legend $this->elements['legend']->generateFromDataSets( $this->data ); // Get boundings from parameters $this->options->width = $width; $this->options->height = $height; // Render subelements $boundings = new ezcGraphBoundings(); $boundings->x1 = $this->options->width; $boundings->y1 = $this->options->height; // Render subelements foreach ( $this->elements as $name => $element ) { // Skip element, if it should not get rendered if ( $this->renderElement[$name] === false ) { continue; } $this->driver->options->font = $element->font; $boundings = $element->render( $this->renderer, $boundings ); } // Render graph $this->renderData( $this->renderer, $boundings ); } /** * Render the line chart * * Renders the chart into a file or stream. The width and height are * needed to specify the dimensions of the resulting image. For direct * output use 'php://stdout' as output file. * * @param int $width Image width * @param int $height Image height * @param string $file Output file * @apichange * @return void */ public function render( $width, $height, $file = null ) { $this->renderElements( $width, $height ); if ( !empty( $file ) ) { $this->renderer->render( $file ); } $this->renderedFile = $file; } /** * Renders this chart to direct output * * Does the same as ezcGraphChart::render(), but renders directly to * output and not into a file. * * @param int $width * @param int $height * @apichange * @return void */ public function renderToOutput( $width, $height ) { // @TODO: merge this function with render an deprecate ommit of third // argument in render() when API break is possible $this->renderElements( $width, $height ); $this->renderer->render( null ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/colors/000077500000000000000000000000001226600447100222445ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/colors/color.php000066400000000000000000000201401226600447100240700ustar00rootroot00000000000000properties['red'] = 0; $this->properties['green'] = 0; $this->properties['blue'] = 0; $this->properties['alpha'] = 0; parent::__construct( $options ); } /** * __set * * @param mixed $propertyName * @param mixed $propertyValue * @throws ezcBaseValueException * If a submitted parameter was out of range or type. * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return void * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'red': case 'green': case 'blue': case 'alpha': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) || ( $propertyValue > 255 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, '0 <= int <= 255' ); } $this->properties[$propertyName] = (int) $propertyValue; break; default: throw new ezcBasePropertyNotFoundException( $propertyName ); break; } } /** * Creates an ezcGraphColor object from a hexadecimal color representation * * @param mixed $string Hexadecimal color representation * @return ezcGraphColor */ static public function fromHex( $string ) { // Remove trailing # if ( $string[0] === '#' ) { $string = substr( $string, 1 ); } // Iterate over chunks and convert to integer $color = new ezcGraphColor(); $keys = array( 'red', 'green', 'blue', 'alpha' ); foreach ( str_split( $string, 2) as $nr => $hexValue ) { if ( isset( $keys[$nr] ) ) { $key = $keys[$nr]; $color->$key = hexdec( $hexValue ) % 256; } } // Set missing values to zero for ( ++$nr; $nr < count( $keys ); ++$nr ) { $key = $keys[$nr]; $color->$key = 0; } return $color; } /** * Creates an ezcGraphColor object from an array of integers * * @param array $array Array of integer color values * @return ezcGraphColor */ static public function fromIntegerArray( array $array ) { // Iterate over array elements $color = new ezcGraphColor(); $keys = array( 'red', 'green', 'blue', 'alpha' ); $nr = 0; foreach ( $array as $colorValue ) { if ( isset( $keys[$nr] ) ) { $key = $keys[$nr++]; $color->$key = ( (int) $colorValue ) % 256; } } // Set missing values to zero for ( $nr; $nr < count( $keys ); ++$nr ) { $key = $keys[$nr]; $color->$key = 0; } return $color; } /** * Creates an ezcGraphColor object from an array of floats * * @param array $array Array of float color values * @return ezcGraphColor */ static public function fromFloatArray( array $array ) { // Iterate over array elements $color = new ezcGraphColor(); $keys = array( 'red', 'green', 'blue', 'alpha' ); $nr = 0; foreach ( $array as $colorValue ) { if ( isset( $keys[$nr] ) ) { $key = $keys[$nr++]; $color->$key = ( (float) $colorValue * 255 ) % 256; } } // Set missing values to zero for ( $nr; $nr < count( $keys ); ++$nr ) { $key = $keys[$nr]; $color->$key = 0; } return $color; } /** * Tries to parse provided color value * * This method can be used to create a color struct from arbritrary color * representations. The following values are accepted * * - Hexadecimal color definitions, like known from HTML, CSS and SVG * * Color definitions like #FF0000, with and and without number sign, * where each pair of bytes is interpreted as a color value for the * channels RGB(A). These color values may contain up to 4 values, where * the last value is considered as the alpha channel. * * - Array of integers * * If an array of integers is provided as input teh value in each channel * may be in the span [0 - 255] and is assigned to the color channels * RGB(A). Up to four values are used from the array. * * - Array of floats * * If an array of floats is provided as input teh value in each channel * may be in the span [0 - 1] and is assigned to the color channels * RGB(A). Up to four values are used from the array. * * @param mixed $color Some kind of color definition * @return ezcGraphColor */ static public function create( $color ) { if ( $color instanceof ezcGraphColor ) { return $color; } elseif ( is_string( $color ) ) { return ezcGraphColor::fromHex( $color ); } elseif ( is_array( $color ) ) { $testElement = reset( $color ); if ( is_int( $testElement ) ) { return ezcGraphColor::fromIntegerArray( $color ); } else { return ezcGraphColor::fromFloatArray( $color ); } } else { throw new ezcGraphUnknownColorDefinitionException( $color ); } } /** * Returns a copy of the current color made more transparent by the given * factor * * @param mixed $value Percent to make color mor transparent * @return ezcGraphColor New color */ public function transparent( $value ) { $color = clone $this; $color->alpha = 255 - (int) round( ( 255 - $this->alpha ) * ( 1 - $value ) ); return $color; } /** * Inverts and returns a copy of the current color * * @return ezcGraphColor New Color */ public function invert() { $color = new ezcGraphColor(); $color->red = 255 - $this->red; $color->green = 255 - $this->green; $color->blue = 255 - $this->blue; $color->alpha = $this->alpha; return $color; } /** * Returns a copy of the current color darkened by the given factor * * @param float $value Percent to darken the color * @return ezcGraphColor New color */ public function darken( $value ) { $color = clone $this; $value = 1 - $value; $color->red = min( 255, max( 0, (int) round( $this->red * $value ) ) ); $color->green = min( 255, max( 0, (int) round( $this->green * $value ) ) ); $color->blue = min( 255, max( 0, (int) round( $this->blue * $value ) ) ); return $color; } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/colors/linear_gradient.php000066400000000000000000000112761226600447100261130ustar00rootroot00000000000000properties['startColor'] = $startColor; $this->properties['endColor'] = $endColor; $this->properties['startPoint'] = $startPoint; $this->properties['endPoint'] = $endPoint; } /** * __set * * @param mixed $propertyName * @param mixed $propertyValue * @throws ezcBaseValueException * If a submitted parameter was out of range or type. * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return void * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'startPoint': if ( !$propertyValue instanceof ezcGraphCoordinate ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphCoordinate' ); } else { $this->properties['startPoint'] = $propertyValue; } break; case 'endPoint': if ( !$propertyValue instanceof ezcGraphCoordinate ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphCoordinate' ); } else { $this->properties['endPoint'] = $propertyValue; } break; case 'startColor': $this->properties['startColor'] = ezcGraphColor::create( $propertyValue ); break; case 'endColor': $this->properties['endColor'] = ezcGraphColor::create( $propertyValue ); break; } } /** * __get * * @param mixed $propertyName * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return mixed * @ignore */ public function __get( $propertyName ) { switch ( $propertyName ) { case 'red': case 'green': case 'blue': case 'alpha': // Fallback to native color return $this->properties['startColor']->$propertyName; default: if ( isset( $this->properties[$propertyName] ) ) { return $this->properties[$propertyName]; } else { throw new ezcBasePropertyNotFoundException( $propertyName ); } } } /** * Returns a unique string representation for the gradient. * * @access public * @return void */ public function __toString() { return sprintf( 'LinearGradient_%d_%d_%d_%d_%02x%02x%02x%02x_%02x%02x%02x%02x', $this->properties['startPoint']->x, $this->properties['startPoint']->y, $this->properties['endPoint']->x, $this->properties['endPoint']->y, $this->properties['startColor']->red, $this->properties['startColor']->green, $this->properties['startColor']->blue, $this->properties['startColor']->alpha, $this->properties['endColor']->red, $this->properties['endColor']->green, $this->properties['endColor']->blue, $this->properties['endColor']->alpha ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/colors/radial_gradient.php000066400000000000000000000131021226600447100260630ustar00rootroot00000000000000properties['center'] = $center; $this->properties['width'] = (float) $width; $this->properties['height'] = (float) $height; $this->properties['offset'] = 0; $this->properties['startColor'] = $startColor; $this->properties['endColor'] = $endColor; } /** * __set * * @param mixed $propertyName * @param mixed $propertyValue * @throws ezcBaseValueException * If a submitted parameter was out of range or type. * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return void * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'center': if ( !$propertyValue instanceof ezcGraphCoordinate ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphCoordinate' ); } else { $this->properties['center'] = $propertyValue; } break; case 'width': if ( !is_numeric( $propertyValue ) || ( $propertyValue <= 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'float > 0' ); } $this->properties['width'] = (float) $propertyValue; break; case 'height': if ( !is_numeric( $propertyValue ) || ( $propertyValue <= 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'float > 0' ); } $this->properties['height'] = (float) $propertyValue; break; case 'offset': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) || ( $propertyValue > 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, '0 <= float <= 1' ); } $this->properties['offset'] = $propertyValue; break; case 'startColor': $this->properties['startColor'] = ezcGraphColor::create( $propertyValue ); break; case 'endColor': $this->properties['endColor'] = ezcGraphColor::create( $propertyValue ); break; } } /** * __get * * @param mixed $propertyName * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return mixed * @ignore */ public function __get( $propertyName ) { switch ( $propertyName ) { case 'red': case 'green': case 'blue': case 'alpha': // Fallback to native color return $this->properties['startColor']->$propertyName; default: if ( isset( $this->properties[$propertyName] ) ) { return $this->properties[$propertyName]; } else { throw new ezcBasePropertyNotFoundException( $propertyName ); } } } /** * Returns a unique string representation for the gradient. * * @access public * @return void */ public function __toString() { return sprintf( 'RadialGradient_%d_%d_%d_%d_%.2f_%02x%02x%02x%02x_%02x%02x%02x%02x', $this->properties['center']->x, $this->properties['center']->y, $this->properties['width'], $this->properties['height'], $this->properties['offset'], $this->properties['startColor']->red, $this->properties['startColor']->green, $this->properties['startColor']->blue, $this->properties['startColor']->alpha, $this->properties['endColor']->red, $this->properties['endColor']->green, $this->properties['endColor']->blue, $this->properties['endColor']->alpha ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/data_container/000077500000000000000000000000001226600447100237165ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/data_container/base.php000066400000000000000000000137021226600447100253440ustar00rootroot00000000000000chart = $chart; } /** * Adds a dataset to the charts data * * @param string $name Name of dataset * @param ezcGraphDataSet $dataSet * @param mixed $values Values to create dataset with * @throws ezcGraphTooManyDataSetExceptions * If too many datasets are created * @return ezcGraphDataSet */ protected function addDataSet( $name, ezcGraphDataSet $dataSet ) { $this->data[$name] = $dataSet; $this->data[$name]->label = $name; $this->data[$name]->palette = $this->chart->palette; $this->data[$name]->displayType = $this->chart->getDefaultDisplayType(); } /** * Returns if the given offset exists. * * This method is part of the ArrayAccess interface to allow access to the * data of this object as if it was an array. * * @param string $key Identifier of dataset. * @return bool True when the offset exists, otherwise false. */ public function offsetExists( $key ) { return isset( $this->data[$key] ); } /** * Returns the element with the given offset. * * This method is part of the ArrayAccess interface to allow access to the * data of this object as if it was an array. * * @param string $key Identifier of dataset. * @return ezcGraphDataSet * * @throws ezcGraphNoSuchDataSetException * If no dataset with identifier exists */ public function offsetGet( $key ) { if ( !isset( $this->data[$key] ) ) { throw new ezcGraphNoSuchDataSetException( $key ); } return $this->data[$key]; } /** * Set the element with the given offset. * * This method is part of the ArrayAccess interface to allow access to the * data of this object as if it was an array. * * @param string $key * @param ezcGraphDataSet $value * @return void * * @throws ezcBaseValueException * If supplied value is not an ezcGraphDataSet */ public function offsetSet( $key, $value ) { if ( !$value instanceof ezcGraphDataSet ) { throw new ezcBaseValueException( $key, $value, 'ezcGraphDataSet' ); } return $this->addDataSet( $key, $value ); } /** * Unset the element with the given offset. * * This method is part of the ArrayAccess interface to allow access to the * data of this object as if it was an array. * * @param string $key * @return void */ public function offsetUnset( $key ) { if ( !isset( $this->data[$key] ) ) { throw new ezcGraphNoSuchDataSetException( $key ); } unset( $this->data[$key] ); } /** * Returns the currently selected dataset. * * This method is part of the Iterator interface to allow access to the * datasets of this row by iterating over it like an array (e.g. using * foreach). * * @return ezcGraphDataSet The currently selected dataset. */ public function current() { return current( $this->data ); } /** * Returns the next dataset and selects it or false on the last dataset. * * This method is part of the Iterator interface to allow access to the * datasets of this row by iterating over it like an array (e.g. using * foreach). * * @return mixed ezcGraphDataSet if the next dataset exists, or false. */ public function next() { return next( $this->data ); } /** * Returns the key of the currently selected dataset. * * This method is part of the Iterator interface to allow access to the * datasets of this row by iterating over it like an array (e.g. using * foreach). * * @return int The key of the currently selected dataset. */ public function key() { return key( $this->data ); } /** * Returns if the current dataset is valid. * * This method is part of the Iterator interface to allow access to the * datasets of this row by iterating over it like an array (e.g. using * foreach). * * @return bool If the current dataset is valid */ public function valid() { return ( current( $this->data ) !== false ); } /** * Selects the very first dataset and returns it. * This method is part of the Iterator interface to allow access to the * datasets of this row by iterating over it like an array (e.g. using * foreach). * * @return ezcGraphDataSet The very first dataset. */ public function rewind() { return reset( $this->data ); } /** * Returns the number of datasets in the row. * * This method is part of the Countable interface to allow the usage of * PHP's count() function to check how many datasets exist. * * @return int Number of datasets. */ public function count() { return count( $this->data ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/data_container/single.php000066400000000000000000000026431226600447100257150ustar00rootroot00000000000000data ) >= 1 && !isset( $this->data[$name] ) ) { throw new ezcGraphTooManyDataSetsExceptions( $name ); } else { parent::addDataSet( $name, $dataSet ); // Resette palette color counter $this->chart->palette->resetColorCounter(); // Colorize each data element foreach ( $this->data[$name] as $label => $value ) { $this->data[$name]->color[$label] = $this->chart->palette->dataSetColor; } } } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/datasets/000077500000000000000000000000001226600447100225535ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/datasets/array.php000066400000000000000000000030631226600447100244040ustar00rootroot00000000000000createFromArray( $data ); parent::__construct(); } /** * setData * * Can handle data provided through an array or iterator. * * @param array|Iterator $data * @access public * @return void */ protected function createFromArray( $data = array() ) { if ( !is_array( $data ) && !( $data instanceof Traversable ) ) { throw new ezcGraphInvalidArrayDataSourceException( $data ); } $this->data = array(); foreach ( $data as $key => $value ) { $this->data[$key] = $value; } if ( !count( $this->data ) ) { throw new ezcGraphInvalidDataException( 'Data sets should contain some values.' ); } } /** * Returns the number of elements in this dataset * * @return int */ public function count() { return count( $this->data ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/datasets/average.php000066400000000000000000000226531226600447100247060ustar00rootroot00000000000000mixed) */ protected $properties; /** * Constructor * * @param ezcGraphDataSet $dataset Dataset to interpolate * @param int $order Maximum order of interpolating polynom * @return void * @ignore */ public function __construct( ezcGraphDataSet $dataset, $order = 3 ) { parent::__construct(); $this->properties['resolution'] = 100; $this->properties['polynomOrder'] = (int) $order; $this->source = $dataset; } /** * Options write access * * @throws ezcBasePropertyNotFoundException * If Option could not be found * @throws ezcBaseValueException * If value is out of range * @param mixed $propertyName Option name * @param mixed $propertyValue Option value; * @return mixed */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'polynomOrder': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int > 0' ); } $this->properties['polynomOrder'] = (int) $propertyValue; $this->polynom = false; break; case 'resolution': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int > 1' ); } $this->properties['resolution'] = (int) $propertyValue; break; default: parent::__set( $propertyName, $propertyValue ); break; } } /** * Property get access. * Simply returns a given option. * * @param string $propertyName The name of the option to get. * @return mixed The option value. * * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of */ public function __get( $propertyName ) { if ( array_key_exists( $propertyName, $this->properties ) ) { return $this->properties[$propertyName]; } return parent::__get( $propertyName ); } /** * Build the polynom based on the given points. * * @return void */ protected function buildPolynom() { $points = array(); foreach ( $this->source as $key => $value ) { if ( !is_numeric( $key ) ) { throw new ezcGraphDatasetAverageInvalidKeysException(); } if ( ( $this->min === false ) || ( $this->min > $key ) ) { $this->min = (float) $key; } if ( ( $this->max === false ) || ( $this->max < $key ) ) { $this->max = (float) $key; } $points[] = new ezcGraphCoordinate( (float) $key, (float) $value ); } // Build transposed and normal Matrix out of coordiantes $a = new ezcGraphMatrix( count( $points ), $this->polynomOrder + 1 ); $b = new ezcGraphMatrix( count( $points ), 1 ); for ( $i = 0; $i <= $this->properties['polynomOrder']; ++$i ) { foreach ( $points as $nr => $point ) { $a->set( $nr, $i, pow( $point->x, $i ) ); $b->set( $nr, 0, $point->y ); } } $at = clone $a; $at->transpose(); $left = $at->multiply( $a ); $right = $at->multiply( $b ); $this->polynom = $left->solveNonlinearEquatation( $right ); } /** * Returns a polynom of the defined order witch matches the datapoints * using the least squares algorithm. * * @return ezcGraphPolynom Polynom */ public function getPolynom() { if ( $this->polynom === false ) { $this->buildPolynom(); } return $this->polynom; } /** * Get the x coordinate for the current position * * @param int $position Position * @return float x coordinate */ protected function getKey() { $polynom = $this->getPolynom(); return $this->min + ( $this->max - $this->min ) / $this->resolution * $this->position; } /** * Returns true if the given datapoint exists * Allows isset() using ArrayAccess. * * @param string $key The key of the datapoint to get. * @return bool Wether the key exists. */ public function offsetExists( $key ) { $polynom = $this->getPolynom(); return ( ( $key >= $this->min ) && ( $key <= $this->max ) ); } /** * Returns the value for the given datapoint * Get an datapoint value by ArrayAccess. * * @param string $key The key of the datapoint to get. * @return float The datapoint value. */ public function offsetGet( $key ) { $polynom = $this->getPolynom(); return $polynom->evaluate( $key ); } /** * Throws a ezcBasePropertyPermissionException because single datapoints * cannot be set in average datasets. * * @param string $key The kex of a datapoint to set. * @param float $value The value for the datapoint. * @throws ezcBasePropertyPermissionException * Always, because access is readonly. * @return void */ public function offsetSet( $key, $value ) { throw new ezcBasePropertyPermissionException( $key, ezcBasePropertyPermissionException::READ ); } /** * Returns the currently selected datapoint. * * This method is part of the Iterator interface to allow access to the * datapoints of this row by iterating over it like an array (e.g. using * foreach). * * @return string The currently selected datapoint. */ final public function current() { $polynom = $this->getPolynom(); return $polynom->evaluate( $this->getKey() ); } /** * Returns the next datapoint and selects it or false on the last datapoint. * * This method is part of the Iterator interface to allow access to the * datapoints of this row by iterating over it like an array (e.g. using * foreach). * * @return float datapoint if it exists, or false. */ final public function next() { if ( ++$this->position >= $this->resolution ) { return false; } else { return $this->current(); } } /** * Returns the key of the currently selected datapoint. * * This method is part of the Iterator interface to allow access to the * datapoints of this row by iterating over it like an array (e.g. using * foreach). * * @return string The key of the currently selected datapoint. */ final public function key() { return (string) $this->getKey(); } /** * Returns if the current datapoint is valid. * * This method is part of the Iterator interface to allow access to the * datapoints of this row by iterating over it like an array (e.g. using * foreach). * * @return bool If the current datapoint is valid */ final public function valid() { $polynom = $this->getPolynom(); if ( $this->min >= $this->max ) { return false; } return ( ( $this->getKey() >= $this->min ) && ( $this->getKey() <= $this->max ) ); } /** * Selects the very first datapoint and returns it. * This method is part of the Iterator interface to allow access to the * datapoints of this row by iterating over it like an array (e.g. using * foreach). * * @return float The very first datapoint. */ final public function rewind() { $this->position = 0; } /** * Returns the number of elements in this dataset * * @return int */ public function count() { return $this->resolution; } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/datasets/base.php000066400000000000000000000205611226600447100242020ustar00rootroot00000000000000properties['label'] = new ezcGraphDataSetStringProperty( $this ); $this->properties['color'] = new ezcGraphDataSetColorProperty( $this ); $this->properties['symbol'] = new ezcGraphDataSetIntProperty( $this ); $this->properties['lineThickness'] = new ezcGraphDataSetIntProperty( $this ); $this->properties['highlight'] = new ezcGraphDataSetBooleanProperty( $this ); $this->properties['highlightValue'] = new ezcGraphDataSetStringProperty( $this ); $this->properties['displayType'] = new ezcGraphDataSetIntProperty( $this ); $this->properties['url'] = new ezcGraphDataSetStringProperty( $this ); $this->properties['xAxis'] = new ezcGraphDataSetAxisProperty( $this ); $this->properties['yAxis'] = new ezcGraphDataSetAxisProperty( $this ); $this->properties['highlight']->default = false; } /** * Options write access * * @throws ezcBasePropertyNotFoundException * If Option could not be found * @throws ezcBaseValueException * If value is out of range * @param mixed $propertyName Option name * @param mixed $propertyValue Option value; * @return void * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'hilight': $propertyName = 'highlight'; case 'label': case 'url': case 'color': case 'symbol': case 'lineThickness': case 'highlight': case 'highlightValue': case 'displayType': case 'xAxis': case 'yAxis': $this->properties[$propertyName]->default = $propertyValue; break; case 'palette': $this->palette = $propertyValue; $this->color->default = $this->palette->dataSetColor; $this->symbol->default = $this->palette->dataSetSymbol; break; default: throw new ezcBasePropertyNotFoundException( $propertyName ); break; } } /** * Property get access. * Simply returns a given option. * * @param string $propertyName The name of the option to get. * @return mixed The option value. * * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of */ public function __get( $propertyName ) { if ( array_key_exists( $propertyName, $this->properties ) ) { return $this->properties[$propertyName]; } else { throw new ezcBasePropertyNotFoundException( $propertyName ); } } /** * Returns true if the given datapoint exists * Allows isset() using ArrayAccess. * * @param string $key The key of the datapoint to get. * @return bool Wether the key exists. */ public function offsetExists( $key ) { return isset( $this->data[$key] ); } /** * Returns the value for the given datapoint * Get an datapoint value by ArrayAccess. * * @param string $key The key of the datapoint to get. * @return float The datapoint value. */ public function offsetGet( $key ) { return $this->data[$key]; } /** * Sets the value for a datapoint. * Sets an datapoint using ArrayAccess. * * @param string $key The kex of a datapoint to set. * @param float $value The value for the datapoint. * @return void */ public function offsetSet( $key, $value ) { $this->data[$key] = (float) $value; } /** * Unset an option. * Unsets an option using ArrayAccess. * * @param string $key The options to unset. * @return void * * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @throws ezcBaseValueException * If a the value for a property is out of range. */ public function offsetUnset( $key ) { unset( $this->data[$key] ); } /** * Returns the currently selected datapoint. * * This method is part of the Iterator interface to allow access to the * datapoints of this row by iterating over it like an array (e.g. using * foreach). * * @return string The currently selected datapoint. */ public function current() { if ( !isset( $this->current ) ) { $this->keys = array_keys( $this->data ); $this->current = 0; } return $this->data[$this->keys[$this->current]]; } /** * Returns the next datapoint and selects it or false on the last datapoint. * * This method is part of the Iterator interface to allow access to the * datapoints of this row by iterating over it like an array (e.g. using * foreach). * * @return float datapoint if it exists, or false. */ public function next() { if ( ++$this->current >= count( $this->keys ) ) { return false; } else { return $this->data[$this->keys[$this->current]]; } } /** * Returns the key of the currently selected datapoint. * * This method is part of the Iterator interface to allow access to the * datapoints of this row by iterating over it like an array (e.g. using * foreach). * * @return string The key of the currently selected datapoint. */ public function key() { return $this->keys[$this->current]; } /** * Returns if the current datapoint is valid. * * This method is part of the Iterator interface to allow access to the * datapoints of this row by iterating over it like an array (e.g. using * foreach). * * @return bool If the current datapoint is valid */ public function valid() { return isset( $this->keys[$this->current] ); } /** * Selects the very first datapoint and returns it. * This method is part of the Iterator interface to allow access to the * datapoints of this row by iterating over it like an array (e.g. using * foreach). * * @return float The very first datapoint. */ public function rewind() { $this->keys = array_keys( $this->data ); $this->current = 0; } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/datasets/numeric.php000066400000000000000000000176221226600447100247360ustar00rootroot00000000000000mixed) */ protected $properties; /** * Constructor * * @param float $start Start value for x axis values of function * @param float $end End value for x axis values of function * @param callback $callback Callback function * @return void * @ignore */ public function __construct( $start = null, $end = null, $callback = null ) { parent::__construct(); $this->properties['start'] = null; $this->properties['end'] = null; $this->properties['callback'] = null; if ( $start !== null ) { $this->start = $start; } if ( $end !== null ) { $this->end = $end; } if ( $callback !== null ) { $this->callback = $callback; } $this->properties['resolution'] = 100; } /** * Options write access * * @throws ezcBasePropertyNotFoundException * If Option could not be found * @throws ezcBaseValueException * If value is out of range * @param mixed $propertyName Option name * @param mixed $propertyValue Option value; * @return mixed */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'resolution': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int > 1' ); } $this->properties['resolution'] = (int) $propertyValue; break; case 'start': case 'end': if ( !is_numeric( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'float' ); } $this->properties[$propertyName] = (float) $propertyValue; break; case 'callback': if ( !is_callable( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'callback' ); } $this->properties[$propertyName] = $propertyValue; break; default: parent::__set( $propertyName, $propertyValue ); break; } } /** * Property get access. * Simply returns a given option. * * @param string $propertyName The name of the option to get. * @return mixed The option value. * * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of */ public function __get( $propertyName ) { if ( array_key_exists( $propertyName, $this->properties ) ) { return $this->properties[$propertyName]; } return parent::__get( $propertyName ); } /** * Get the x coordinate for the current position * * @param int $position Position * @return float x coordinate */ protected function getKey() { return $this->start + ( $this->end - $this->start ) / $this->resolution * $this->position; } /** * Returns true if the given datapoint exists * Allows isset() using ArrayAccess. * * @param string $key The key of the datapoint to get. * @return bool Wether the key exists. */ public function offsetExists( $key ) { return ( ( $key >= $this->start ) && ( $key <= $this->end ) ); } /** * Returns the value for the given datapoint * Get an datapoint value by ArrayAccess. * * @param string $key The key of the datapoint to get. * @return float The datapoint value. */ public function offsetGet( $key ) { return call_user_func( $this->callback, $key ); } /** * Throws a ezcBasePropertyPermissionException because single datapoints * cannot be set in average datasets. * * @param string $key The kex of a datapoint to set. * @param float $value The value for the datapoint. * @throws ezcBasePropertyPermissionException * Always, because access is readonly. * @return void */ public function offsetSet( $key, $value ) { throw new ezcBasePropertyPermissionException( $key, ezcBasePropertyPermissionException::READ ); } /** * Returns the currently selected datapoint. * * This method is part of the Iterator interface to allow access to the * datapoints of this row by iterating over it like an array (e.g. using * foreach). * * @return string The currently selected datapoint. */ final public function current() { return call_user_func( $this->callback, $this->getKey() ); } /** * Returns the next datapoint and selects it or false on the last datapoint. * * This method is part of the Iterator interface to allow access to the * datapoints of this row by iterating over it like an array (e.g. using * foreach). * * @return float datapoint if it exists, or false. */ final public function next() { if ( $this->start === $this->end ) { throw new ezcGraphDatasetAverageInvalidKeysException(); } if ( ++$this->position >= $this->resolution ) { return false; } else { return $this->current(); } } /** * Returns the key of the currently selected datapoint. * * This method is part of the Iterator interface to allow access to the * datapoints of this row by iterating over it like an array (e.g. using * foreach). * * @return string The key of the currently selected datapoint. */ final public function key() { return (string) $this->getKey(); } /** * Returns if the current datapoint is valid. * * This method is part of the Iterator interface to allow access to the * datapoints of this row by iterating over it like an array (e.g. using * foreach). * * @return bool If the current datapoint is valid */ final public function valid() { return ( ( $this->getKey() >= $this->start ) && ( $this->getKey() <= $this->end ) ); } /** * Selects the very first datapoint and returns it. * This method is part of the Iterator interface to allow access to the * datapoints of this row by iterating over it like an array (e.g. using * foreach). * * @return float The very first datapoint. */ final public function rewind() { $this->position = 0; } /** * Returns the number of elements in this dataset * * @return int */ public function count() { return $this->resolution + 1; } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/datasets/property/000077500000000000000000000000001226600447100244375ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/datasets/property/axis.php000066400000000000000000000030611226600447100261140ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/datasets/property/boolean.php000066400000000000000000000016021226600447100265660ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/datasets/property/color.php000066400000000000000000000016511226600447100262710ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/datasets/property/integer.php000066400000000000000000000015711226600447100266110ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/datasets/property/string.php000066400000000000000000000016001226600447100264530ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/driver/000077500000000000000000000000001226600447100222365ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/driver/cairo.php000066400000000000000000001025111226600447100240440ustar00rootroot00000000000000 * $graph = new ezcGraphPieChart(); * $graph->background->color = '#FFFFFFFF'; * $graph->title = 'Access statistics'; * $graph->legend = false; * * $graph->data['Access statistics'] = new ezcGraphArrayDataSet( array( * 'Mozilla' => 19113, * 'Explorer' => 10917, * 'Opera' => 1464, * 'Safari' => 652, * 'Konqueror' => 474, * ) ); * * $graph->renderer = new ezcGraphRenderer3d(); * $graph->renderer->options->pieChartShadowSize = 10; * $graph->renderer->options->pieChartGleam = .5; * $graph->renderer->options->dataBorder = false; * $graph->renderer->options->pieChartHeight = 16; * $graph->renderer->options->legendSymbolGleam = .5; * * // Use cairo driver * $graph->driver = new ezcGraphCairoDriver(); * * $graph->render( 400, 200, 'tutorial_driver_cairo.png' ); * * * @version 1.5 * @package Graph * @mainclass */ class ezcGraphCairoDriver extends ezcGraphDriver { /** * Surface for cairo * * @var resource */ protected $surface; /** * Current cairo context. * * @var resource */ protected $context; /** * List of strings to draw * array ( array( * 'text' => array( 'strings' ), * 'options' => ezcGraphFontOptions, * ) * * @var array */ protected $strings = array(); /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { ezcBase::checkDependency( 'Graph', ezcBase::DEP_PHP_EXTENSION, 'cairo_wrapper' ); $this->options = new ezcGraphCairoDriverOptions( $options ); } /** * Initilize cairo surface * * Initilize cairo surface from values provided in the options object, if * is has not been already initlized. * * @return void */ protected function initiliazeSurface() { // Immediatly exit, if surface already exists if ( $this->surface !== null ) { return; } $this->surface = cairo_image_surface_create( CAIRO_FORMAT_ARGB32, $this->options->width, $this->options->height ); $this->context = cairo_create( $this->surface ); cairo_set_line_width( $this->context, 1 ); } /** * Get SVG style definition * * Returns a string with SVG style definitions created from color, * fillstatus and line thickness. * * @param ezcGraphColor $color Color * @param mixed $filled Filled * @param float $thickness Line thickness. * @return string Formatstring */ protected function getStyle( ezcGraphColor $color, $filled = true, $thickness = 1. ) { switch ( true ) { case $color instanceof ezcGraphLinearGradient: $pattern = cairo_pattern_create_linear( $color->startPoint->x, $color->startPoint->y, $color->endPoint->x, $color->endPoint->y ); cairo_pattern_add_color_stop_rgba ( $pattern, 0, $color->startColor->red / 255, $color->startColor->green / 255, $color->startColor->blue / 255, 1 - $color->startColor->alpha / 255 ); cairo_pattern_add_color_stop_rgba ( $pattern, 1, $color->endColor->red / 255, $color->endColor->green / 255, $color->endColor->blue / 255, 1 - $color->endColor->alpha / 255 ); cairo_set_source( $this->context, $pattern ); cairo_fill( $this->context ); break; case $color instanceof ezcGraphRadialGradient: $pattern = cairo_pattern_create_radial( 0, 0, 0, 0, 0, 1 ); cairo_pattern_add_color_stop_rgba ( $pattern, 0, $color->startColor->red / 255, $color->startColor->green / 255, $color->startColor->blue / 255, 1 - $color->startColor->alpha / 255 ); cairo_pattern_add_color_stop_rgba ( $pattern, 1, $color->endColor->red / 255, $color->endColor->green / 255, $color->endColor->blue / 255, 1 - $color->endColor->alpha / 255 ); // Scale pattern, and move it to the correct position $matrix = cairo_matrix_multiply( $move = cairo_matrix_create_translate( -$color->center->x, -$color->center->y ), $scale = cairo_matrix_create_scale( 1 / $color->width, 1 / $color->height ) ); cairo_pattern_set_matrix( $pattern, $matrix ); cairo_set_source( $this->context, $pattern ); cairo_fill( $this->context ); break; default: cairo_set_source_rgba( $this->context, $color->red / 255, $color->green / 255, $color->blue / 255, 1 - $color->alpha / 255 ); break; } // Set line width cairo_set_line_width( $this->context, $thickness ); // Set requested fill state for context if ( $filled ) { cairo_fill_preserve( $this->context ); } } /** * Draws a single polygon. * * @param array $points Point array * @param ezcGraphColor $color Polygon color * @param mixed $filled Filled * @param float $thickness Line thickness * @return void */ public function drawPolygon( array $points, ezcGraphColor $color, $filled = true, $thickness = 1. ) { $this->initiliazeSurface(); $path = cairo_new_path( $this->context ); $lastPoint = end( $points ); cairo_move_to( $this->context, $lastPoint->x, $lastPoint->y ); foreach ( $points as $point ) { cairo_line_to( $this->context, $point->x, $point->y ); } cairo_close_path( $this->context ); $this->getStyle( $color, $filled, $thickness ); cairo_stroke( $this->context ); return $points; } /** * Draws a line * * @param ezcGraphCoordinate $start Start point * @param ezcGraphCoordinate $end End point * @param ezcGraphColor $color Line color * @param float $thickness Line thickness * @return void */ public function drawLine( ezcGraphCoordinate $start, ezcGraphCoordinate $end, ezcGraphColor $color, $thickness = 1. ) { $this->initiliazeSurface(); $path = cairo_new_path( $this->context ); cairo_move_to( $this->context, $start->x, $start->y ); cairo_line_to( $this->context, $end->x, $end->y ); $this->getStyle( $color, false, $thickness ); cairo_stroke( $this->context ); return array( $start, $end ); } /** * Returns boundings of text depending on the available font extension * * @param float $size Textsize * @param ezcGraphFontOptions $font Font * @param string $text Text * @return ezcGraphBoundings Boundings of text */ protected function getTextBoundings( $size, ezcGraphFontOptions $font, $text ) { cairo_select_font_face( $this->context, $font->name, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL ); cairo_set_font_size( $this->context, $size ); $extents = cairo_text_extents( $this->context, $text ); return new ezcGraphBoundings( 0, 0, $extents['width'], $extents['height'] ); } /** * Writes text in a box of desired size * * @param string $string Text * @param ezcGraphCoordinate $position Top left position * @param float $width Width of text box * @param float $height Height of text box * @param int $align Alignement of text * @param ezcGraphRotation $rotation * @return void */ public function drawTextBox( $string, ezcGraphCoordinate $position, $width, $height, $align, ezcGraphRotation $rotation = null ) { $this->initiliazeSurface(); $padding = $this->options->font->padding + ( $this->options->font->border !== false ? $this->options->font->borderWidth : 0 ); $width -= $padding * 2; $height -= $padding * 2; $textPosition = new ezcGraphCoordinate( $position->x + $padding, $position->y + $padding ); // Try to get a font size for the text to fit into the box $maxSize = min( $height, $this->options->font->maxFontSize ); $result = false; for ( $size = $maxSize; $size >= $this->options->font->minFontSize; ) { $result = $this->testFitStringInTextBox( $string, $position, $width, $height, $size ); if ( is_array( $result ) ) { break; } $size = ( ( $newsize = $size * ( $result ) ) >= $size ? $size - 1 : floor( $newsize ) ); } if ( !is_array( $result ) ) { if ( ( $height >= $this->options->font->minFontSize ) && ( $this->options->autoShortenString ) ) { $result = $this->tryFitShortenedString( $string, $position, $width, $height, $size = $this->options->font->minFontSize ); } else { throw new ezcGraphFontRenderingException( $string, $this->options->font->minFontSize, $width, $height ); } } $this->options->font->minimalUsedFont = $size; $this->strings[] = array( 'text' => $result, 'position' => $textPosition, 'width' => $width, 'height' => $height, 'align' => $align, 'font' => $this->options->font, 'rotation' => $rotation, ); return array( clone $position, new ezcGraphCoordinate( $position->x + $width, $position->y ), new ezcGraphCoordinate( $position->x + $width, $position->y + $height ), new ezcGraphCoordinate( $position->x, $position->y + $height ), ); } /** * Render text depending of font type and available font extensions * * @param string $id * @param string $text * @param string $font * @param ezcGraphColor $color * @param ezcGraphCoordinate $position * @param float $size * @param float $rotation * @return void */ protected function renderText( $text, $font, ezcGraphColor $color, ezcGraphCoordinate $position, $size, $rotation = null ) { cairo_select_font_face( $this->context, $font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL ); cairo_set_font_size( $this->context, $size ); // Store current state of context cairo_save( $this->context ); cairo_move_to( $this->context, 0, 0 ); if ( $rotation !== null ) { // Move to the center cairo_translate( $this->context, $rotation->getCenter()->x, $rotation->getCenter()->y ); // Rotate around text center cairo_rotate( $this->context, deg2rad( $rotation->getRotation() ) ); // Center the text cairo_translate( $this->context, $position->x - $rotation->getCenter()->x, $position->y - $rotation->getCenter()->y - $size * .15 ); } else { cairo_translate( $this->context, $position->x, $position->y - $size * .15 ); } cairo_new_path( $this->context ); $this->getStyle( $color, true ); cairo_show_text( $this->context, $text ); cairo_stroke( $this->context ); // Restore state of context cairo_restore( $this->context ); } /** * Draw all collected texts * * The texts are collected and their maximum possible font size is * calculated. This function finally draws the texts on the image, this * delayed drawing has two reasons: * * 1) This way the text strings are always on top of the image, what * results in better readable texts * 2) The maximum possible font size can be calculated for a set of texts * with the same font configuration. Strings belonging to one chart * element normally have the same font configuration, so that all texts * belonging to one element will have the same font size. * * @access protected * @return void */ protected function drawAllTexts() { $this->initiliazeSurface(); foreach ( $this->strings as $text ) { $size = $text['font']->minimalUsedFont; $completeHeight = count( $text['text'] ) * $size + ( count( $text['text'] ) - 1 ) * $this->options->lineSpacing; // Calculate y offset for vertical alignement switch ( true ) { case ( $text['align'] & ezcGraph::BOTTOM ): $yOffset = $text['height'] - $completeHeight; break; case ( $text['align'] & ezcGraph::MIDDLE ): $yOffset = ( $text['height'] - $completeHeight ) / 2; break; case ( $text['align'] & ezcGraph::TOP ): default: $yOffset = 0; break; } $padding = $text['font']->padding + $text['font']->borderWidth / 2; if ( $this->options->font->minimizeBorder === true ) { // Calculate maximum width of text rows $width = false; foreach ( $text['text'] as $line ) { $string = implode( ' ', $line ); $boundings = $this->getTextBoundings( $size, $text['font'], $string ); if ( ( $width === false) || ( $boundings->width > $width ) ) { $width = $boundings->width; } } switch ( true ) { case ( $text['align'] & ezcGraph::CENTER ): $xOffset = ( $text['width'] - $width ) / 2; break; case ( $text['align'] & ezcGraph::RIGHT ): $xOffset = $text['width'] - $width; break; case ( $text['align'] & ezcGraph::LEFT ): default: $xOffset = 0; break; } $borderPolygonArray = array( new ezcGraphCoordinate( $text['position']->x - $padding + $xOffset, $text['position']->y - $padding + $yOffset ), new ezcGraphCoordinate( $text['position']->x + $padding * 2 + $xOffset + $width, $text['position']->y - $padding + $yOffset ), new ezcGraphCoordinate( $text['position']->x + $padding * 2 + $xOffset + $width, $text['position']->y + $padding * 2 + $yOffset + $completeHeight ), new ezcGraphCoordinate( $text['position']->x - $padding + $xOffset, $text['position']->y + $padding * 2 + $yOffset + $completeHeight ), ); } else { $borderPolygonArray = array( new ezcGraphCoordinate( $text['position']->x - $padding, $text['position']->y - $padding ), new ezcGraphCoordinate( $text['position']->x + $padding * 2 + $text['width'], $text['position']->y - $padding ), new ezcGraphCoordinate( $text['position']->x + $padding * 2 + $text['width'], $text['position']->y + $padding * 2 + $text['height'] ), new ezcGraphCoordinate( $text['position']->x - $padding, $text['position']->y + $padding * 2 + $text['height'] ), ); } if ( $text['rotation'] !== null ) { foreach ( $borderPolygonArray as $nr => $point ) { $borderPolygonArray[$nr] = $text['rotation']->transformCoordinate( $point ); } } if ( $text['font']->background !== false ) { $this->drawPolygon( $borderPolygonArray, $text['font']->background, true ); } if ( $text['font']->border !== false ) { $this->drawPolygon( $borderPolygonArray, $text['font']->border, false, $text['font']->borderWidth ); } // Render text with evaluated font size $completeString = ''; foreach ( $text['text'] as $line ) { $string = implode( ' ', $line ); $completeString .= $string; $boundings = $this->getTextBoundings( $size, $text['font'], $string ); $text['position']->y += $size; switch ( true ) { case ( $text['align'] & ezcGraph::LEFT ): $position = new ezcGraphCoordinate( $text['position']->x, $text['position']->y + $yOffset ); break; case ( $text['align'] & ezcGraph::RIGHT ): $position = new ezcGraphCoordinate( $text['position']->x + ( $text['width'] - $boundings->width ), $text['position']->y + $yOffset ); break; case ( $text['align'] & ezcGraph::CENTER ): $position = new ezcGraphCoordinate( $text['position']->x + ( ( $text['width'] - $boundings->width ) / 2 ), $text['position']->y + $yOffset ); break; } // Optionally draw text shadow if ( $text['font']->textShadow === true ) { $this->renderText( $string, $text['font']->name, $text['font']->textShadowColor, new ezcGraphCoordinate( $position->x + $text['font']->textShadowOffset, $position->y + $text['font']->textShadowOffset ), $size, $text['rotation'] ); } // Finally draw text $this->renderText( $string, $text['font']->name, $text['font']->color, $position, $size, $text['rotation'] ); $text['position']->y += $size * $this->options->lineSpacing; } } } /** * Draws a sector of cirlce * * @param ezcGraphCoordinate $center Center of circle * @param mixed $width Width * @param mixed $height Height * @param mixed $startAngle Start angle of circle sector * @param mixed $endAngle End angle of circle sector * @param ezcGraphColor $color Color * @param mixed $filled Filled; * @return void */ public function drawCircleSector( ezcGraphCoordinate $center, $width, $height, $startAngle, $endAngle, ezcGraphColor $color, $filled = true ) { $this->initiliazeSurface(); // Normalize angles if ( $startAngle > $endAngle ) { $tmp = $startAngle; $startAngle = $endAngle; $endAngle = $tmp; } cairo_save( $this->context ); // Draw circular arc path $path = cairo_new_path( $this->context ); cairo_translate( $this->context, $center->x, $center->y ); cairo_scale( $this->context, 1, $height / $width ); cairo_move_to( $this->context, 0, 0 ); cairo_arc( $this->context, 0., 0., $width / 2, deg2rad( $startAngle ), deg2rad( $endAngle ) ); cairo_line_to( $this->context, 0, 0 ); cairo_restore( $this->context ); $this->getStyle( $color, $filled ); cairo_stroke( $this->context ); // Create polygon array to return $polygonArray = array( $center ); for ( $angle = $startAngle; $angle < $endAngle; $angle += $this->options->imageMapResolution ) { $polygonArray[] = new ezcGraphCoordinate( $center->x + ( ( cos( deg2rad( $angle ) ) * $width ) / 2 ), $center->y + ( ( sin( deg2rad( $angle ) ) * $height ) / 2 ) ); } $polygonArray[] = new ezcGraphCoordinate( $center->x + ( ( cos( deg2rad( $endAngle ) ) * $width ) / 2 ), $center->y + ( ( sin( deg2rad( $endAngle ) ) * $height ) / 2 ) ); return $polygonArray; } /** * Draws a circular arc consisting of several minor steps on the bounding * lines. * * @param ezcGraphCoordinate $center * @param mixed $width * @param mixed $height * @param mixed $size * @param mixed $startAngle * @param mixed $endAngle * @param ezcGraphColor $color * @param bool $filled * @return string Element id */ protected function simulateCircularArc( ezcGraphCoordinate $center, $width, $height, $size, $startAngle, $endAngle, ezcGraphColor $color, $filled ) { for ( $tmpAngle = min( ceil ( $startAngle / 180 ) * 180, $endAngle ); $tmpAngle <= $endAngle; $tmpAngle = min( ceil ( $startAngle / 180 + 1 ) * 180, $endAngle ) ) { $path = cairo_new_path( $this->context ); cairo_move_to( $this->context, $center->x + cos( deg2rad( $startAngle ) ) * $width / 2, $center->y + sin( deg2rad( $startAngle ) ) * $height / 2 ); // @TODO: Use cairo_curve_to() for( $angle = $startAngle; $angle <= $tmpAngle; $angle = min( $angle + $this->options->circleResolution, $tmpAngle ) ) { cairo_line_to( $this->context, $center->x + cos( deg2rad( $angle ) ) * $width / 2, $center->y + sin( deg2rad( $angle ) ) * $height / 2 + $size ); if ( $angle === $tmpAngle ) { break; } } for( $angle = $tmpAngle; $angle >= $startAngle; $angle = max( $angle - $this->options->circleResolution, $startAngle ) ) { cairo_line_to( $this->context, $center->x + cos( deg2rad( $angle ) ) * $width / 2, $center->y + sin( deg2rad( $angle ) ) * $height / 2 ); if ( $angle === $startAngle ) { break; } } cairo_close_path( $this->context ); $this->getStyle( $color, $filled ); cairo_stroke( $this->context ); $startAngle = $tmpAngle; if ( $tmpAngle === $endAngle ) { break; } } } /** * Draws a circular arc * * @param ezcGraphCoordinate $center Center of ellipse * @param integer $width Width of ellipse * @param integer $height Height of ellipse * @param integer $size Height of border * @param float $startAngle Starting angle of circle sector * @param float $endAngle Ending angle of circle sector * @param ezcGraphColor $color Color of Border * @param bool $filled * @return void */ public function drawCircularArc( ezcGraphCoordinate $center, $width, $height, $size, $startAngle, $endAngle, ezcGraphColor $color, $filled = true ) { $this->initiliazeSurface(); // Normalize angles if ( $startAngle > $endAngle ) { $tmp = $startAngle; $startAngle = $endAngle; $endAngle = $tmp; } $this->simulateCircularArc( $center, $width, $height, $size, $startAngle, $endAngle, $color, $filled ); if ( ( $this->options->shadeCircularArc !== false ) && $filled ) { $gradient = new ezcGraphLinearGradient( new ezcGraphCoordinate( $center->x - $width, $center->y ), new ezcGraphCoordinate( $center->x + $width, $center->y ), ezcGraphColor::fromHex( '#FFFFFF' )->transparent( $this->options->shadeCircularArc * 1.5 ), ezcGraphColor::fromHex( '#000000' )->transparent( $this->options->shadeCircularArc * 1.5 ) ); $this->simulateCircularArc( $center, $width, $height, $size, $startAngle, $endAngle, $gradient, $filled ); } // Create polygon array to return $polygonArray = array(); for ( $angle = $startAngle; $angle < $endAngle; $angle += $this->options->imageMapResolution ) { $polygonArray[] = new ezcGraphCoordinate( $center->x + ( ( cos( deg2rad( $angle ) ) * $width ) / 2 ), $center->y + ( ( sin( deg2rad( $angle ) ) * $height ) / 2 ) ); } $polygonArray[] = new ezcGraphCoordinate( $center->x + ( ( cos( deg2rad( $endAngle ) ) * $width ) / 2 ), $center->y + ( ( sin( deg2rad( $endAngle ) ) * $height ) / 2 ) ); for ( $angle = $endAngle; $angle > $startAngle; $angle -= $this->options->imageMapResolution ) { $polygonArray[] = new ezcGraphCoordinate( $center->x + ( ( cos( deg2rad( $angle ) ) * $width ) / 2 ) + $size, $center->y + ( ( sin( deg2rad( $angle ) ) * $height ) / 2 ) ); } $polygonArray[] = new ezcGraphCoordinate( $center->x + ( ( cos( deg2rad( $startAngle ) ) * $width ) / 2 ) + $size, $center->y + ( ( sin( deg2rad( $startAngle ) ) * $height ) / 2 ) ); return $polygonArray; } /** * Draw circle * * @param ezcGraphCoordinate $center Center of ellipse * @param mixed $width Width of ellipse * @param mixed $height height of ellipse * @param ezcGraphColor $color Color * @param mixed $filled Filled * @return void */ public function drawCircle( ezcGraphCoordinate $center, $width, $height, ezcGraphColor $color, $filled = true ) { $this->initiliazeSurface(); cairo_save( $this->context ); // Draw circular arc path $path = cairo_new_path( $this->context ); cairo_translate( $this->context, $center->x, $center->y ); cairo_scale( $this->context, 1, $height / $width ); cairo_arc( $this->context, 0., 0., $width / 2, 0, 2 * M_PI ); cairo_restore( $this->context ); $this->getStyle( $color, $filled ); cairo_stroke( $this->context ); // Create polygon array to return $polygonArray = array(); for ( $angle = 0; $angle < ( 2 * M_PI ); $angle += deg2rad( $this->options->imageMapResolution ) ) { $polygonArray[] = new ezcGraphCoordinate( $center->x + ( ( cos( $angle ) * $width ) / 2 ), $center->y + ( ( sin( $angle ) * $height ) / 2 ) ); } return $polygonArray; } /** * Draw an image * * The image will be inlined in the SVG document using data URL scheme. For * this the mime type and base64 encoded file content will be merged to * URL. * * @param mixed $file Image file * @param ezcGraphCoordinate $position Top left position * @param mixed $width Width of image in destination image * @param mixed $height Height of image in destination image * @return void */ public function drawImage( $file, ezcGraphCoordinate $position, $width, $height ) { $this->initiliazeSurface(); // Ensure given bitmap is a PNG image $data = getimagesize( $file ); if ( $data[2] !== IMAGETYPE_PNG ) { throw new Exception( 'Cairo only has support for PNGs.' ); } // Create new surface from given bitmap $imageSurface = cairo_image_surface_create_from_png( $file ); // Create pattern from source image to be able to transform it $pattern = cairo_pattern_create_for_surface( $imageSurface ); // Scale pattern to defined dimensions and move it to its destination position $matrix = cairo_matrix_multiply( $move = cairo_matrix_create_translate( -$position->x, -$position->y ), $scale = cairo_matrix_create_scale( $data[0] / $width, $data[1] / $height ) ); cairo_pattern_set_matrix( $pattern, $matrix ); // Merge surfaces cairo_set_source( $this->context, $pattern ); cairo_rectangle( $this->context, $position->x, $position->y, $width, $height ); cairo_fill( $this->context ); } /** * Return mime type for current image format * * @return string */ public function getMimeType() { return 'image/png'; } /** * Render image directly to output * * The method renders the image directly to the standard output. You * normally do not want to use this function, because it makes it harder * to proper cache the generated graphs. * * @return void */ public function renderToOutput() { $this->drawAllTexts(); header( 'Content-Type: ' . $this->getMimeType() ); // Write to tmp file, echo and remove tmp file again. $fileName = tempnam( '/tmp', 'ezc' ); // cairo_surface_write_to_png( $this->surface, $file ); cairo_surface_write_to_png( $this->surface, $fileName ); $contents = file_get_contents( $fileName ); unlink( $fileName ); // Directly echo contents echo $contents; } /** * Finally save image * * @param string $file Destination filename * @return void */ public function render( $file ) { $this->drawAllTexts(); cairo_surface_write_to_png( $this->surface, $file ); } /** * Get resource of rendered result * * Return the resource of the rendered result. You should not use this * method before you called either renderToOutput() or render(), as the * image may not be completely rendered until then. * * This method returns an array, containing the surface and the context in * a structure like: * * array( * 'surface' => resource, * 'context' => resource, * ) * * * @return array */ public function getResource() { return array( 'surface' => $this->surface, 'context' => $this->context, ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/driver/cairo_oo.php000066400000000000000000001012251226600447100245420ustar00rootroot00000000000000 * $graph = new ezcGraphPieChart(); * $graph->background->color = '#FFFFFFFF'; * $graph->title = 'Access statistics'; * $graph->legend = false; * * $graph->data['Access statistics'] = new ezcGraphArrayDataSet( array( * 'Mozilla' => 19113, * 'Explorer' => 10917, * 'Opera' => 1464, * 'Safari' => 652, * 'Konqueror' => 474, * ) ); * * $graph->renderer = new ezcGraphRenderer3d(); * $graph->renderer->options->pieChartShadowSize = 10; * $graph->renderer->options->pieChartGleam = .5; * $graph->renderer->options->dataBorder = false; * $graph->renderer->options->pieChartHeight = 16; * $graph->renderer->options->legendSymbolGleam = .5; * * // Use cairo driver * $graph->driver = new ezcGraphCairoOODriver(); * * $graph->render( 400, 200, 'tutorial_driver_cairo.png' ); * * * @version 1.5 * @package Graph * @mainclass */ class ezcGraphCairoOODriver extends ezcGraphDriver { /** * Surface for cairo * * @var CairoImageSurface */ protected $surface; /** * Current cairo context. * * @var CairoContext */ protected $context; /** * List of strings to draw * array ( array( * 'text' => array( 'strings' ), * 'options' => ezcGraphFontOptions, * ) * * @var array */ protected $strings = array(); /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { ezcBase::checkDependency( 'Graph', ezcBase::DEP_PHP_EXTENSION, 'cairo' ); $this->options = new ezcGraphCairoDriverOptions( $options ); } /** * Initilize cairo surface * * Initilize cairo surface from values provided in the options object, if * is has not been already initlized. * * @return void */ protected function initiliazeSurface() { // Immediatly exit, if surface already exists if ( $this->surface !== null ) { return; } $this->surface = new CairoImageSurface( CairoFormat::ARGB32, $this->options->width, $this->options->height ); $this->context = new CairoContext( $this->surface ); $this->context->setLineWidth( 1 ); } /** * Get SVG style definition * * Returns a string with SVG style definitions created from color, * fillstatus and line thickness. * * @param ezcGraphColor $color Color * @param mixed $filled Filled * @param float $thickness Line thickness. * @return string Formatstring */ protected function getStyle( ezcGraphColor $color, $filled = true, $thickness = 1. ) { switch ( true ) { case $color instanceof ezcGraphLinearGradient: $pattern = new CairoLinearGradient( $color->startPoint->x, $color->startPoint->y, $color->endPoint->x, $color->endPoint->y ); $pattern->addColorStopRgba( 0, $color->startColor->red / 255, $color->startColor->green / 255, $color->startColor->blue / 255, 1 - $color->startColor->alpha / 255 ); $pattern->addColorStopRgba( 1, $color->endColor->red / 255, $color->endColor->green / 255, $color->endColor->blue / 255, 1 - $color->endColor->alpha / 255 ); $this->context->setSource( $pattern ); $this->context->fill(); break; case $color instanceof ezcGraphRadialGradient: $pattern = new CairoRadialGradient( 0, 0, 0, 0, 0, 1 ); $pattern->addColorStopRgba( 0, $color->startColor->red / 255, $color->startColor->green / 255, $color->startColor->blue / 255, 1 - $color->startColor->alpha / 255 ); $pattern->addColorStopRgba( 1, $color->endColor->red / 255, $color->endColor->green / 255, $color->endColor->blue / 255, 1 - $color->endColor->alpha / 255 ); // Scale pattern, and move it to the correct position $matrix = CairoMatrix::multiply( $move = CairoMatrix::initTranslate( -$color->center->x, -$color->center->y ), $scale = CairoMatrix::initScale( 1 / $color->width, 1 / $color->height ) ); $pattern->setMatrix( $matrix ); $this->context->setSource( $pattern ); $this->context->fill(); break; default: $this->context->setSourceRgba( $color->red / 255, $color->green / 255, $color->blue / 255, 1 - $color->alpha / 255 ); break; } // Set line width $this->context->setLineWidth( $thickness ); // Set requested fill state for context if ( $filled ) { $this->context->fillPreserve(); } } /** * Draws a single polygon. * * @param array $points Point array * @param ezcGraphColor $color Polygon color * @param mixed $filled Filled * @param float $thickness Line thickness * @return void */ public function drawPolygon( array $points, ezcGraphColor $color, $filled = true, $thickness = 1. ) { $this->initiliazeSurface(); $this->context->newPath(); $lastPoint = end( $points ); $this->context->moveTo( $lastPoint->x, $lastPoint->y ); foreach ( $points as $point ) { $this->context->lineTo( $point->x, $point->y ); } $this->context->closePath(); $this->getStyle( $color, $filled, $thickness ); $this->context->stroke(); return $points; } /** * Draws a line * * @param ezcGraphCoordinate $start Start point * @param ezcGraphCoordinate $end End point * @param ezcGraphColor $color Line color * @param float $thickness Line thickness * @return void */ public function drawLine( ezcGraphCoordinate $start, ezcGraphCoordinate $end, ezcGraphColor $color, $thickness = 1. ) { $this->initiliazeSurface(); $this->context->newPath(); $this->context->moveTo( $start->x, $start->y ); $this->context->lineTo( $end->x, $end->y ); $this->getStyle( $color, false, $thickness ); $this->context->stroke(); return array( $start, $end ); } /** * Returns boundings of text depending on the available font extension * * @param float $size Textsize * @param ezcGraphFontOptions $font Font * @param string $text Text * @return ezcGraphBoundings Boundings of text */ protected function getTextBoundings( $size, ezcGraphFontOptions $font, $text ) { $this->context->selectFontFace( $font->name, CairoFontSlant::NORMAL, CairoFontWeight::NORMAL ); $this->context->setFontSize( $size ); $extents = $this->context->textExtents( $text ); return new ezcGraphBoundings( 0, 0, $extents['width'], $extents['height'] ); } /** * Writes text in a box of desired size * * @param string $string Text * @param ezcGraphCoordinate $position Top left position * @param float $width Width of text box * @param float $height Height of text box * @param int $align Alignement of text * @param ezcGraphRotation $rotation * @return void */ public function drawTextBox( $string, ezcGraphCoordinate $position, $width, $height, $align, ezcGraphRotation $rotation = null ) { $this->initiliazeSurface(); $padding = $this->options->font->padding + ( $this->options->font->border !== false ? $this->options->font->borderWidth : 0 ); $width -= $padding * 2; $height -= $padding * 2; $textPosition = new ezcGraphCoordinate( $position->x + $padding, $position->y + $padding ); // Try to get a font size for the text to fit into the box $maxSize = min( $height, $this->options->font->maxFontSize ); $result = false; for ( $size = $maxSize; $size >= $this->options->font->minFontSize; ) { $result = $this->testFitStringInTextBox( $string, $position, $width, $height, $size ); if ( is_array( $result ) ) { break; } $size = ( ( $newsize = $size * ( $result ) ) >= $size ? $size - 1 : floor( $newsize ) ); } if ( !is_array( $result ) ) { if ( ( $height >= $this->options->font->minFontSize ) && ( $this->options->autoShortenString ) ) { $result = $this->tryFitShortenedString( $string, $position, $width, $height, $size = $this->options->font->minFontSize ); } else { throw new ezcGraphFontRenderingException( $string, $this->options->font->minFontSize, $width, $height ); } } $this->options->font->minimalUsedFont = $size; $this->strings[] = array( 'text' => $result, 'position' => $textPosition, 'width' => $width, 'height' => $height, 'align' => $align, 'font' => $this->options->font, 'rotation' => $rotation, ); return array( clone $position, new ezcGraphCoordinate( $position->x + $width, $position->y ), new ezcGraphCoordinate( $position->x + $width, $position->y + $height ), new ezcGraphCoordinate( $position->x, $position->y + $height ), ); } /** * Render text depending of font type and available font extensions * * @param string $id * @param string $text * @param string $font * @param ezcGraphColor $color * @param ezcGraphCoordinate $position * @param float $size * @param float $rotation * @return void */ protected function renderText( $text, $font, ezcGraphColor $color, ezcGraphCoordinate $position, $size, $rotation = null ) { $this->context->selectFontFace( $font, CairoFontSlant::NORMAL, CairoFontWeight::NORMAL ); $this->context->setFontSize( $size ); // Store current state of context $this->context->save(); $this->context->moveTo( 0, 0 ); if ( $rotation !== null ) { // Move to the center $this->context->translate( $rotation->getCenter()->x, $rotation->getCenter()->y ); // Rotate around text center $this->context->rotate( deg2rad( $rotation->getRotation() ) ); // Center the text $this->context->translate( $position->x - $rotation->getCenter()->x, $position->y - $rotation->getCenter()->y - $size * .15 ); } else { $this->context->translate( $position->x, $position->y - $size * .15 ); } $this->context->newPath(); $this->getStyle( $color, true ); $this->context->showText( $text ); $this->context->stroke(); // Restore state of context $this->context->restore(); } /** * Draw all collected texts * * The texts are collected and their maximum possible font size is * calculated. This function finally draws the texts on the image, this * delayed drawing has two reasons: * * 1) This way the text strings are always on top of the image, what * results in better readable texts * 2) The maximum possible font size can be calculated for a set of texts * with the same font configuration. Strings belonging to one chart * element normally have the same font configuration, so that all texts * belonging to one element will have the same font size. * * @access protected * @return void */ protected function drawAllTexts() { $this->initiliazeSurface(); foreach ( $this->strings as $text ) { $size = $text['font']->minimalUsedFont; $completeHeight = count( $text['text'] ) * $size + ( count( $text['text'] ) - 1 ) * $this->options->lineSpacing; // Calculate y offset for vertical alignement switch ( true ) { case ( $text['align'] & ezcGraph::BOTTOM ): $yOffset = $text['height'] - $completeHeight; break; case ( $text['align'] & ezcGraph::MIDDLE ): $yOffset = ( $text['height'] - $completeHeight ) / 2; break; case ( $text['align'] & ezcGraph::TOP ): default: $yOffset = 0; break; } $padding = $text['font']->padding + $text['font']->borderWidth / 2; if ( $this->options->font->minimizeBorder === true ) { // Calculate maximum width of text rows $width = false; foreach ( $text['text'] as $line ) { $string = implode( ' ', $line ); $boundings = $this->getTextBoundings( $size, $text['font'], $string ); if ( ( $width === false) || ( $boundings->width > $width ) ) { $width = $boundings->width; } } switch ( true ) { case ( $text['align'] & ezcGraph::CENTER ): $xOffset = ( $text['width'] - $width ) / 2; break; case ( $text['align'] & ezcGraph::RIGHT ): $xOffset = $text['width'] - $width; break; case ( $text['align'] & ezcGraph::LEFT ): default: $xOffset = 0; break; } $borderPolygonArray = array( new ezcGraphCoordinate( $text['position']->x - $padding + $xOffset, $text['position']->y - $padding + $yOffset ), new ezcGraphCoordinate( $text['position']->x + $padding * 2 + $xOffset + $width, $text['position']->y - $padding + $yOffset ), new ezcGraphCoordinate( $text['position']->x + $padding * 2 + $xOffset + $width, $text['position']->y + $padding * 2 + $yOffset + $completeHeight ), new ezcGraphCoordinate( $text['position']->x - $padding + $xOffset, $text['position']->y + $padding * 2 + $yOffset + $completeHeight ), ); } else { $borderPolygonArray = array( new ezcGraphCoordinate( $text['position']->x - $padding, $text['position']->y - $padding ), new ezcGraphCoordinate( $text['position']->x + $padding * 2 + $text['width'], $text['position']->y - $padding ), new ezcGraphCoordinate( $text['position']->x + $padding * 2 + $text['width'], $text['position']->y + $padding * 2 + $text['height'] ), new ezcGraphCoordinate( $text['position']->x - $padding, $text['position']->y + $padding * 2 + $text['height'] ), ); } if ( $text['rotation'] !== null ) { foreach ( $borderPolygonArray as $nr => $point ) { $borderPolygonArray[$nr] = $text['rotation']->transformCoordinate( $point ); } } if ( $text['font']->background !== false ) { $this->drawPolygon( $borderPolygonArray, $text['font']->background, true ); } if ( $text['font']->border !== false ) { $this->drawPolygon( $borderPolygonArray, $text['font']->border, false, $text['font']->borderWidth ); } // Render text with evaluated font size $completeString = ''; foreach ( $text['text'] as $line ) { $string = implode( ' ', $line ); $completeString .= $string; $boundings = $this->getTextBoundings( $size, $text['font'], $string ); $text['position']->y += $size; switch ( true ) { case ( $text['align'] & ezcGraph::LEFT ): $position = new ezcGraphCoordinate( $text['position']->x, $text['position']->y + $yOffset ); break; case ( $text['align'] & ezcGraph::RIGHT ): $position = new ezcGraphCoordinate( $text['position']->x + ( $text['width'] - $boundings->width ), $text['position']->y + $yOffset ); break; case ( $text['align'] & ezcGraph::CENTER ): $position = new ezcGraphCoordinate( $text['position']->x + ( ( $text['width'] - $boundings->width ) / 2 ), $text['position']->y + $yOffset ); break; } // Optionally draw text shadow if ( $text['font']->textShadow === true ) { $this->renderText( $string, $text['font']->name, $text['font']->textShadowColor, new ezcGraphCoordinate( $position->x + $text['font']->textShadowOffset, $position->y + $text['font']->textShadowOffset ), $size, $text['rotation'] ); } // Finally draw text $this->renderText( $string, $text['font']->name, $text['font']->color, $position, $size, $text['rotation'] ); $text['position']->y += $size * $this->options->lineSpacing; } } } /** * Draws a sector of cirlce * * @param ezcGraphCoordinate $center Center of circle * @param mixed $width Width * @param mixed $height Height * @param mixed $startAngle Start angle of circle sector * @param mixed $endAngle End angle of circle sector * @param ezcGraphColor $color Color * @param mixed $filled Filled; * @return void */ public function drawCircleSector( ezcGraphCoordinate $center, $width, $height, $startAngle, $endAngle, ezcGraphColor $color, $filled = true ) { $this->initiliazeSurface(); // Normalize angles if ( $startAngle > $endAngle ) { $tmp = $startAngle; $startAngle = $endAngle; $endAngle = $tmp; } $this->context->save(); // Draw circular arc path $this->context->newPath(); $this->context->translate( $center->x, $center->y ); $this->context->scale( 1, $height / $width ); $this->context->moveTo( 0, 0 ); $this->context->arc( 0., 0., $width / 2, deg2rad( $startAngle ), deg2rad( $endAngle ) ); $this->context->lineTo( 0, 0 ); $this->context->restore(); $this->getStyle( $color, $filled ); $this->context->stroke(); // Create polygon array to return $polygonArray = array( $center ); for ( $angle = $startAngle; $angle < $endAngle; $angle += $this->options->imageMapResolution ) { $polygonArray[] = new ezcGraphCoordinate( $center->x + ( ( cos( deg2rad( $angle ) ) * $width ) / 2 ), $center->y + ( ( sin( deg2rad( $angle ) ) * $height ) / 2 ) ); } $polygonArray[] = new ezcGraphCoordinate( $center->x + ( ( cos( deg2rad( $endAngle ) ) * $width ) / 2 ), $center->y + ( ( sin( deg2rad( $endAngle ) ) * $height ) / 2 ) ); return $polygonArray; } /** * Draws a circular arc consisting of several minor steps on the bounding * lines. * * @param ezcGraphCoordinate $center * @param mixed $width * @param mixed $height * @param mixed $size * @param mixed $startAngle * @param mixed $endAngle * @param ezcGraphColor $color * @param bool $filled * @return string Element id */ protected function simulateCircularArc( ezcGraphCoordinate $center, $width, $height, $size, $startAngle, $endAngle, ezcGraphColor $color, $filled ) { for ( $tmpAngle = min( ceil ( $startAngle / 180 ) * 180, $endAngle ); $tmpAngle <= $endAngle; $tmpAngle = min( ceil ( $startAngle / 180 + 1 ) * 180, $endAngle ) ) { $this->context->newPath(); $this->context->moveTo( $center->x + cos( deg2rad( $startAngle ) ) * $width / 2, $center->y + sin( deg2rad( $startAngle ) ) * $height / 2 ); // @TODO: Use cairo_curve_to() for( $angle = $startAngle; $angle <= $tmpAngle; $angle = min( $angle + $this->options->circleResolution, $tmpAngle ) ) { $this->context->lineTo( $center->x + cos( deg2rad( $angle ) ) * $width / 2, $center->y + sin( deg2rad( $angle ) ) * $height / 2 + $size ); if ( $angle === $tmpAngle ) { break; } } for( $angle = $tmpAngle; $angle >= $startAngle; $angle = max( $angle - $this->options->circleResolution, $startAngle ) ) { $this->context->lineTo( $center->x + cos( deg2rad( $angle ) ) * $width / 2, $center->y + sin( deg2rad( $angle ) ) * $height / 2 ); if ( $angle === $startAngle ) { break; } } $this->context->closePath(); $this->getStyle( $color, $filled ); $this->context->stroke( ); $startAngle = $tmpAngle; if ( $tmpAngle === $endAngle ) { break; } } } /** * Draws a circular arc * * @param ezcGraphCoordinate $center Center of ellipse * @param integer $width Width of ellipse * @param integer $height Height of ellipse * @param integer $size Height of border * @param float $startAngle Starting angle of circle sector * @param float $endAngle Ending angle of circle sector * @param ezcGraphColor $color Color of Border * @param bool $filled * @return void */ public function drawCircularArc( ezcGraphCoordinate $center, $width, $height, $size, $startAngle, $endAngle, ezcGraphColor $color, $filled = true ) { $this->initiliazeSurface(); // Normalize angles if ( $startAngle > $endAngle ) { $tmp = $startAngle; $startAngle = $endAngle; $endAngle = $tmp; } $this->simulateCircularArc( $center, $width, $height, $size, $startAngle, $endAngle, $color, $filled ); if ( ( $this->options->shadeCircularArc !== false ) && $filled ) { $gradient = new ezcGraphLinearGradient( new ezcGraphCoordinate( $center->x - $width, $center->y ), new ezcGraphCoordinate( $center->x + $width, $center->y ), ezcGraphColor::fromHex( '#FFFFFF' )->transparent( $this->options->shadeCircularArc * 1.5 ), ezcGraphColor::fromHex( '#000000' )->transparent( $this->options->shadeCircularArc * 1.5 ) ); $this->simulateCircularArc( $center, $width, $height, $size, $startAngle, $endAngle, $gradient, $filled ); } // Create polygon array to return $polygonArray = array(); for ( $angle = $startAngle; $angle < $endAngle; $angle += $this->options->imageMapResolution ) { $polygonArray[] = new ezcGraphCoordinate( $center->x + ( ( cos( deg2rad( $angle ) ) * $width ) / 2 ), $center->y + ( ( sin( deg2rad( $angle ) ) * $height ) / 2 ) ); } $polygonArray[] = new ezcGraphCoordinate( $center->x + ( ( cos( deg2rad( $endAngle ) ) * $width ) / 2 ), $center->y + ( ( sin( deg2rad( $endAngle ) ) * $height ) / 2 ) ); for ( $angle = $endAngle; $angle > $startAngle; $angle -= $this->options->imageMapResolution ) { $polygonArray[] = new ezcGraphCoordinate( $center->x + ( ( cos( deg2rad( $angle ) ) * $width ) / 2 ) + $size, $center->y + ( ( sin( deg2rad( $angle ) ) * $height ) / 2 ) ); } $polygonArray[] = new ezcGraphCoordinate( $center->x + ( ( cos( deg2rad( $startAngle ) ) * $width ) / 2 ) + $size, $center->y + ( ( sin( deg2rad( $startAngle ) ) * $height ) / 2 ) ); return $polygonArray; } /** * Draw circle * * @param ezcGraphCoordinate $center Center of ellipse * @param mixed $width Width of ellipse * @param mixed $height height of ellipse * @param ezcGraphColor $color Color * @param mixed $filled Filled * @return void */ public function drawCircle( ezcGraphCoordinate $center, $width, $height, ezcGraphColor $color, $filled = true ) { $this->initiliazeSurface(); $this->context->save(); // Draw circular arc path $this->context->newPath(); $this->context->translate( $center->x, $center->y ); $this->context->scale( 1, $height / $width ); $this->context->arc( 0., 0., $width / 2, 0, 2 * M_PI ); $this->context->restore(); $this->getStyle( $color, $filled ); $this->context->stroke(); // Create polygon array to return $polygonArray = array(); for ( $angle = 0; $angle < ( 2 * M_PI ); $angle += deg2rad( $this->options->imageMapResolution ) ) { $polygonArray[] = new ezcGraphCoordinate( $center->x + ( ( cos( $angle ) * $width ) / 2 ), $center->y + ( ( sin( $angle ) * $height ) / 2 ) ); } return $polygonArray; } /** * Draw an image * * The image will be inlined in the SVG document using data URL scheme. For * this the mime type and base64 encoded file content will be merged to * URL. * * @param mixed $file Image file * @param ezcGraphCoordinate $position Top left position * @param mixed $width Width of image in destination image * @param mixed $height Height of image in destination image * @return void */ public function drawImage( $file, ezcGraphCoordinate $position, $width, $height ) { $this->initiliazeSurface(); // Ensure given bitmap is a PNG image $data = getimagesize( $file ); if ( $data[2] !== IMAGETYPE_PNG ) { throw new Exception( 'Cairo only has support for PNGs.' ); } // Create new surface from given bitmap $imageSurface = CairoImageSurface::createFromPng( $file ); // Create pattern from source image to be able to transform it $pattern = new CairoSurfacePattern( $imageSurface ); // Scale pattern to defined dimensions and move it to its destination position $matrix = CairoMatrix::multiply( $move = CairoMatrix::initTranslate( -$position->x, -$position->y ), $scale = CairoMatrix::initScale( $data[0] / $width, $data[1] / $height ) ); $pattern->setMatrix( $matrix ); // Merge surfaces $this->context->setSource( $pattern ); $this->context->rectangle( $position->x, $position->y, $width, $height ); $this->context->fill(); } /** * Return mime type for current image format * * @return string */ public function getMimeType() { return 'image/png'; } /** * Render image directly to output * * The method renders the image directly to the standard output. You * normally do not want to use this function, because it makes it harder * to proper cache the generated graphs. * * @return void */ public function renderToOutput() { $this->drawAllTexts(); header( 'Content-Type: ' . $this->getMimeType() ); // Write to tmp file, echo and remove tmp file again. $fileName = tempnam( '/tmp', 'ezc' ); // cairo_surface_write_to_png( $this->surface, $file ); $this->surface->writeToPng( $fileName ); $contents = file_get_contents( $fileName ); unlink( $fileName ); // Directly echo contents echo $contents; } /** * Finally save image * * @param string $file Destination filename * @return void */ public function render( $file ) { $this->drawAllTexts(); $this->surface->writeToPng( $file ); } /** * Get resource of rendered result * * Return the resource of the rendered result. You should not use this * method before you called either renderToOutput() or render(), as the * image may not be completely rendered until then. * * This method returns an array, containing the surface and the context in * a structure like: * * array( * 'surface' => resource, * 'context' => resource, * ) * * * @return array */ public function getResource() { return array( 'surface' => $this->surface, 'context' => $this->context, ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/driver/flash.php000066400000000000000000001023071226600447100240470ustar00rootroot00000000000000 * $graph = new ezcGraphPieChart(); * $graph->title = 'Access statistics'; * $graph->legend = false; * * $graph->driver = new ezcGraphFlashDriver(); * $graph->options->font = 'tutorial_font.fdb'; * * $graph->driver->options->compression = 7; * * $graph->data['Access statistics'] = new ezcGraphArrayDataSet( array( * 'Mozilla' => 19113, * 'Explorer' => 10917, * 'Opera' => 1464, * 'Safari' => 652, * 'Konqueror' => 474, * ) ); * * $graph->render( 400, 200, 'tutorial_driver_flash.swf' ); * * * * @version 1.5 * @package Graph * @mainclass */ class ezcGraphFlashDriver extends ezcGraphDriver { /** * Flash movie * * @var SWFMovie */ protected $movie; /** * Unique element id * * @var int */ protected $id = 1; /** * Array with strings to draw later * * @var array */ protected $strings = array(); /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { ezcBase::checkDependency( 'Graph', ezcBase::DEP_PHP_EXTENSION, 'ming' ); $this->options = new ezcGraphFlashDriverOptions( $options ); } /** * Returns unique movie object as a parent canvas for all swf objects. * * @return SWFMovie */ public function getDocument() { if ( $this->movie === null ) { ming_setscale( 1.0 ); $this->movie = new SWFMovie(); $this->movie->setDimension( $this->modifyCoordinate( $this->options->width ), $this->modifyCoordinate( $this->options->height ) ); $this->movie->setRate( 1 ); $this->movie->setBackground( 255, 255, 255 ); } return $this->movie; } /** * Set the fill and line properties for a SWWFShape according to the * given parameters. * * @param SWFShape $shape * @param ezcGraphColor $color * @param mixed $thickness * @param mixed $filled * @return void */ protected function setShapeColor( SWFShape $shape, ezcGraphColor $color, $thickness, $filled ) { if ( $filled ) { switch ( true ) { case ( $color instanceof ezcGraphLinearGradient ): $gradient = new SWFGradient(); $gradient->addEntry( 0, $color->startColor->red, $color->startColor->green, $color->startColor->blue, 255 - $color->startColor->alpha ); $gradient->addEntry( 1, $color->endColor->red, $color->endColor->green, $color->endColor->blue, 255 - $color->endColor->alpha ); $fill = $shape->addFill( $gradient, SWFFILL_LINEAR_GRADIENT ); // Calculate desired length of gradient $length = sqrt( pow( $color->endPoint->x - $color->startPoint->x, 2 ) + pow( $color->endPoint->y - $color->startPoint->y, 2 ) ); $fill->scaleTo( $this->modifyCoordinate( $length ) / 32768 , $this->modifyCoordinate( $length ) / 32768 ); $fill->rotateTo( rad2deg( asin( ( $color->endPoint->x - $color->startPoint->x ) / $length ) + 180 ) ); $fill->moveTo( $this->modifyCoordinate( ( $color->startPoint->x + $color->endPoint->x ) / 2 ), $this->modifyCoordinate( ( $color->startPoint->y + $color->endPoint->y ) / 2 ) ); $shape->setLeftFill( $fill ); break; case ( $color instanceof ezcGraphRadialGradient ): $gradient = new SWFGradient(); $gradient->addEntry( 0, $color->startColor->red, $color->startColor->green, $color->startColor->blue, 255 - $color->startColor->alpha ); $gradient->addEntry( 1, $color->endColor->red, $color->endColor->green, $color->endColor->blue, 255 - $color->endColor->alpha ); $fill = $shape->addFill( $gradient, SWFFILL_RADIAL_GRADIENT ); $fill->scaleTo( $this->modifyCoordinate( $color->width ) / 32768, $this->modifyCoordinate( $color->height ) / 32768 ); $fill->moveTo( $this->modifyCoordinate( $color->center->x ), $this->modifyCoordinate( $color->center->y ) ); $shape->setLeftFill( $fill ); break; default: $fill = $shape->addFill( $color->red, $color->green, $color->blue, 255 - $color->alpha ); $shape->setLeftFill( $fill ); break; } } else { $shape->setLine( $this->modifyCoordinate( $thickness ), $color->red, $color->green, $color->blue, 255 - $color->alpha ); } } /** * Modifies a coordinate value, as flash usally uses twips instead of * pixels for a higher solution, as it only accepts integer values. * * @param float $pointValue * @return float */ protected function modifyCoordinate( $pointValue ) { return $pointValue * 10; } /** * Demodifies a coordinate value, as flash usally uses twips instead of * pixels for a higher solution, as it only accepts integer values. * * @param float $pointValue * @return float */ protected function deModifyCoordinate( $pointValue ) { return $pointValue / 10; } /** * Draws a single polygon. * * @param array $points Point array * @param ezcGraphColor $color Polygon color * @param mixed $filled Filled * @param float $thickness Line thickness * @return void */ public function drawPolygon( array $points, ezcGraphColor $color, $filled = true, $thickness = 1. ) { $movie = $this->getDocument(); if ( !$filled ) { // The middle of the border is on the outline of a polygon in ming, // fix that: try { $points = $this->reducePolygonSize( $points, $thickness / 2 ); } catch ( ezcGraphReducementFailedException $e ) { return false; } } $shape = new SWFShape(); $this->setShapeColor( $shape, $color, $thickness, $filled ); $lastPoint = end( $points ); $shape->movePenTo( $this->modifyCoordinate( $lastPoint->x ), $this->modifyCoordinate( $lastPoint->y ) ); foreach ( $points as $point ) { $shape->drawLineTo( $this->modifyCoordinate( $point->x ), $this->modifyCoordinate( $point->y ) ); } $object = $movie->add( $shape ); $object->setName( $id = 'ezcGraphPolygon_' . $this->id++ ); return $id; } /** * Draws a line * * @param ezcGraphCoordinate $start Start point * @param ezcGraphCoordinate $end End point * @param ezcGraphColor $color Line color * @param float $thickness Line thickness * @return void */ public function drawLine( ezcGraphCoordinate $start, ezcGraphCoordinate $end, ezcGraphColor $color, $thickness = 1. ) { $movie = $this->getDocument(); $shape = new SWFShape(); $this->setShapeColor( $shape, $color, $thickness, false ); $shape->movePenTo( $this->modifyCoordinate( $start->x ), $this->modifyCoordinate( $start->y ) ); $shape->drawLineTo( $this->modifyCoordinate( $end->x ), $this->modifyCoordinate( $end->y ) ); $object = $movie->add( $shape ); $object->setName( $id = 'ezcGraphLine_' . $this->id++ ); return $id; } /** * Returns boundings of text depending on the available font extension * * @param float $size Textsize * @param ezcGraphFontOptions $font Font * @param string $text Text * @return ezcGraphBoundings Boundings of text */ protected function getTextBoundings( $size, ezcGraphFontOptions $font, $text ) { $t = new SWFText(); $t->setFont( new SWFFont( $font->path ) ); $t->setHeight( $size ); $boundings = new ezcGraphBoundings( 0, 0, $t->getWidth( $text ), $size ); return $boundings; } /** * Writes text in a box of desired size * * @param string $string Text * @param ezcGraphCoordinate $position Top left position * @param float $width Width of text box * @param float $height Height of text box * @param int $align Alignement of text * @param ezcGraphRotation $rotation * @return void */ public function drawTextBox( $string, ezcGraphCoordinate $position, $width, $height, $align, ezcGraphRotation $rotation = null ) { $padding = $this->options->font->padding + ( $this->options->font->border !== false ? $this->options->font->borderWidth : 0 ); $width = $this->modifyCoordinate( $width - $padding * 2 ); $height = $this->modifyCoordinate( $height - $padding * 2 ); $position = new ezcGraphCoordinate( $this->modifyCoordinate( $position->x + $padding ), $this->modifyCoordinate( $position->y + $padding ) ); // Try to get a font size for the text to fit into the box $maxSize = $this->modifyCoordinate( min( $height, $this->options->font->maxFontSize ) ); $minSize = $this->modifyCoordinate( $this->options->font->minFontSize ); $result = false; for ( $size = $maxSize; $size >= $minSize; ) { $result = $this->testFitStringInTextBox( $string, $position, $width, $height, $size ); if ( is_array( $result ) ) { break; } $size = $this->deModifyCoordinate( $size ); $size = $this->modifyCoordinate( floor( ( $newsize = $size * ( $result ) ) >= $size ? $size - 1 : $newsize ) ); } if ( !is_array( $result ) ) { if ( ( $height >= $this->options->font->minFontSize ) && ( $this->options->autoShortenString ) ) { $result = $this->tryFitShortenedString( $string, $position, $width, $height, $size = $this->modifyCoordinate( $this->options->font->minFontSize ) ); } else { throw new ezcGraphFontRenderingException( $string, $this->options->font->minFontSize, $width, $height ); } } $this->options->font->minimalUsedFont = $this->deModifyCoordinate( $size ); $this->strings[] = array( 'text' => $result, 'id' => $id = 'ezcGraphTextBox_' . $this->id++, 'position' => $position, 'width' => $width, 'height' => $height, 'align' => $align, 'font' => $this->options->font, 'rotation' => $rotation, ); return $id; } /** * Render text depending of font type and available font extensions * * @param string $id * @param string $text * @param string $chars * @param int $type * @param string $path * @param ezcGraphColor $color * @param ezcGraphCoordinate $position * @param float $size * @param float $rotation * @return void */ protected function renderText( $id, $text, $chars, $type, $path, ezcGraphColor $color, ezcGraphCoordinate $position, $size, $rotation = null ) { $movie = $this->getDocument(); $tb = new SWFTextField( SWFTEXTFIELD_NOEDIT ); $tb->setFont( new SWFFont( $path ) ); $tb->setHeight( $size ); $tb->setColor( $color->red, $color->green, $color->blue, 255 - $color->alpha ); $tb->addString( $text ); $tb->addChars( $chars ); $object = $movie->add( $tb ); $object->rotate( ( $rotation !== null ? -$rotation->getRotation() : 0 ) ); $object->moveTo( $position->x + ( $rotation === null ? 0 : $this->modifyCoordinate( $rotation->get( 0, 2 ) ) ), $position->y - $size * ( 1 + $this->options->lineSpacing ) + ( $rotation === null ? 0 : $this->modifyCoordinate( $rotation->get( 1, 2 ) ) ) ); $object->setName( $id ); } /** * Draw all collected texts * * The texts are collected and their maximum possible font size is * calculated. This function finally draws the texts on the image, this * delayed drawing has two reasons: * * 1) This way the text strings are always on top of the image, what * results in better readable texts * 2) The maximum possible font size can be calculated for a set of texts * with the same font configuration. Strings belonging to one chart * element normally have the same font configuration, so that all texts * belonging to one element will have the same font size. * * @access protected * @return void */ protected function drawAllTexts() { // Iterate over all strings to collect used chars per font $chars = array(); foreach ( $this->strings as $text ) { $completeString = ''; foreach ( $text['text'] as $line ) { $completeString .= implode( ' ', $line ); } // Collect chars for each font if ( !isset( $chars[$text['font']->path] ) ) { $chars[$text['font']->path] = $completeString; } else { $chars[$text['font']->path] .= $completeString; } } foreach ( $this->strings as $text ) { $size = $this->modifyCoordinate( $text['font']->minimalUsedFont ); $completeHeight = count( $text['text'] ) * $size + ( count( $text['text'] ) - 1 ) * $this->options->lineSpacing; // Calculate y offset for vertical alignement switch ( true ) { case ( $text['align'] & ezcGraph::BOTTOM ): $yOffset = $text['height'] - $completeHeight; break; case ( $text['align'] & ezcGraph::MIDDLE ): $yOffset = ( $text['height'] - $completeHeight ) / 2; break; case ( $text['align'] & ezcGraph::TOP ): default: $yOffset = 0; break; } $padding = $text['font']->padding + $text['font']->borderWidth / 2; if ( $this->options->font->minimizeBorder === true ) { // Calculate maximum width of text rows $width = false; foreach ( $text['text'] as $line ) { $string = implode( ' ', $line ); $boundings = $this->getTextBoundings( $size, $text['font'], $string ); if ( ( $width === false) || ( $boundings->width > $width ) ) { $width = $boundings->width; } } switch ( true ) { case ( $text['align'] & ezcGraph::LEFT ): $xOffset = 0; break; case ( $text['align'] & ezcGraph::CENTER ): $xOffset = ( $text['width'] - $width ) / 2; break; case ( $text['align'] & ezcGraph::RIGHT ): $xOffset = $text['width'] - $width; break; } $borderPolygonArray = array( new ezcGraphCoordinate( $this->deModifyCoordinate( $text['position']->x - $padding + $xOffset ), $this->deModifyCoordinate( $text['position']->y - $padding + $yOffset ) ), new ezcGraphCoordinate( $this->deModifyCoordinate( $text['position']->x + $padding * 2 + $xOffset + $width ), $this->deModifyCoordinate( $text['position']->y - $padding + $yOffset ) ), new ezcGraphCoordinate( $this->deModifyCoordinate( $text['position']->x + $padding * 2 + $xOffset + $width ), $this->deModifyCoordinate( $text['position']->y + $padding * 2 + $yOffset + $completeHeight ) ), new ezcGraphCoordinate( $this->deModifyCoordinate( $text['position']->x - $padding + $xOffset ), $this->deModifyCoordinate( $text['position']->y + $padding * 2 + $yOffset + $completeHeight ) ), ); } else { $borderPolygonArray = array( new ezcGraphCoordinate( $this->deModifyCoordinate( $text['position']->x - $padding ), $this->deModifyCoordinate( $text['position']->y - $padding ) ), new ezcGraphCoordinate( $this->deModifyCoordinate( $text['position']->x + $padding * 2 + $text['width'] ), $this->deModifyCoordinate( $text['position']->y - $padding ) ), new ezcGraphCoordinate( $this->deModifyCoordinate( $text['position']->x + $padding * 2 + $text['width'] ), $this->deModifyCoordinate( $text['position']->y + $padding * 2 + $text['height'] ) ), new ezcGraphCoordinate( $this->deModifyCoordinate( $text['position']->x - $padding ), $this->deModifyCoordinate( $text['position']->y + $padding * 2 + $text['height'] ) ), ); } if ( $text['rotation'] !== null ) { foreach ( $borderPolygonArray as $nr => $point ) { $borderPolygonArray[$nr] = $text['rotation']->transformCoordinate( $point ); } } if ( $text['font']->background !== false ) { $this->drawPolygon( $borderPolygonArray, $text['font']->background, true ); } if ( $text['font']->border !== false ) { $this->drawPolygon( $borderPolygonArray, $text['font']->border, false, $text['font']->borderWidth ); } // Render text with evaluated font size $completeString = ''; foreach ( $text['text'] as $line ) { $string = implode( ' ', $line ); $completeString .= $string; $boundings = $this->getTextBoundings( $size, $text['font'], $string ); $text['position']->y += $size; switch ( true ) { case ( $text['align'] & ezcGraph::LEFT ): $position = new ezcGraphCoordinate( $text['position']->x, $text['position']->y + $yOffset ); break; case ( $text['align'] & ezcGraph::RIGHT ): $position = new ezcGraphCoordinate( $text['position']->x + ( $text['width'] - $boundings->width ), $text['position']->y + $yOffset ); break; case ( $text['align'] & ezcGraph::CENTER ): $position = new ezcGraphCoordinate( $text['position']->x + ( ( $text['width'] - $boundings->width ) / 2 ), $text['position']->y + $yOffset ); break; } // Optionally draw text shadow if ( $text['font']->textShadow === true ) { $this->renderText( $text['id'], $string, $chars[$text['font']->path], $text['font']->type, $text['font']->path, $text['font']->textShadowColor, new ezcGraphCoordinate( $position->x + $this->modifyCoordinate( $text['font']->textShadowOffset ), $position->y + $this->modifyCoordinate( $text['font']->textShadowOffset ) ), $size, $text['rotation'] ); } // Finally draw text $this->renderText( $text['id'], $string, $chars[$text['font']->path], $text['font']->type, $text['font']->path, $text['font']->color, $position, $size, $text['rotation'] ); $text['position']->y += $size * $this->options->lineSpacing; } } } /** * Draws a sector of cirlce * * @param ezcGraphCoordinate $center Center of circle * @param mixed $width Width * @param mixed $height Height * @param mixed $startAngle Start angle of circle sector * @param mixed $endAngle End angle of circle sector * @param ezcGraphColor $color Color * @param mixed $filled Filled * @return void */ public function drawCircleSector( ezcGraphCoordinate $center, $width, $height, $startAngle, $endAngle, ezcGraphColor $color, $filled = true ) { if ( $startAngle > $endAngle ) { $tmp = $startAngle; $startAngle = $endAngle; $endAngle = $tmp; } $movie = $this->getDocument(); $shape = new SWFShape(); $this->setShapeColor( $shape, $color, 1, $filled ); if ( !$filled ) { try { $reduced = $this->reduceEllipseSize( $center, $width, $height, $startAngle, $endAngle, .5 ); } catch ( ezcGraphReducementFailedException $e ) { return false; } $startAngle = $reduced['startAngle']; $endAngle = $reduced['endAngle']; $width -= 1; $height -= 1; } $shape->movePenTo( $this->modifyCoordinate( $center->x ), $this->modifyCoordinate( $center->y ) ); // @TODO: User SWFShape::curveTo for( $angle = $startAngle; $angle <= $endAngle; $angle = min( $angle + $this->options->circleResolution, $endAngle ) ) { $shape->drawLineTo( $this->modifyCoordinate( $center->x + cos( deg2rad( $angle ) ) * $width / 2 ), $this->modifyCoordinate( $center->y + sin( deg2rad( $angle ) ) * $height / 2 ) ); if ( $angle === $endAngle ) { break; } } $shape->drawLineTo( $this->modifyCoordinate( $center->x ), $this->modifyCoordinate( $center->y ) ); $object = $movie->add( $shape ); $object->setName( $id = 'ezcGraphCircleSector_' . $this->id++ ); return $id; } /** * Draws a circular arc consisting of several minor steps on the bounding * lines. * * @param ezcGraphCoordinate $center * @param mixed $width * @param mixed $height * @param mixed $size * @param mixed $startAngle * @param mixed $endAngle * @param ezcGraphColor $color * @param bool $filled * @return string Element id */ protected function simulateCircularArc( ezcGraphCoordinate $center, $width, $height, $size, $startAngle, $endAngle, ezcGraphColor $color, $filled ) { $movie = $this->getDocument(); $id = 'ezcGraphCircularArc_' . $this->id++; for ( $tmpAngle = min( ceil ( $startAngle / 180 ) * 180, $endAngle ); $tmpAngle <= $endAngle; $tmpAngle = min( ceil ( $startAngle / 180 + 1 ) * 180, $endAngle ) ) { $shape = new SWFShape(); $this->setShapeColor( $shape, $color, 1, $filled ); $shape->movePenTo( $this->modifyCoordinate( $center->x + cos( deg2rad( $startAngle ) ) * $width / 2 ), $this->modifyCoordinate( $center->y + sin( deg2rad( $startAngle ) ) * $height / 2 ) ); // @TODO: Use SWFShape::curveTo for( $angle = $startAngle; $angle <= $tmpAngle; $angle = min( $angle + $this->options->circleResolution, $tmpAngle ) ) { $shape->drawLineTo( $this->modifyCoordinate( $center->x + cos( deg2rad( $angle ) ) * $width / 2 ), $this->modifyCoordinate( $center->y + sin( deg2rad( $angle ) ) * $height / 2 + $size ) ); if ( $angle === $tmpAngle ) { break; } } for( $angle = $tmpAngle; $angle >= $startAngle; $angle = max( $angle - $this->options->circleResolution, $startAngle ) ) { $shape->drawLineTo( $this->modifyCoordinate( $center->x + cos( deg2rad( $angle ) ) * $width / 2 ), $this->modifyCoordinate( $center->y + sin( deg2rad( $angle ) ) * $height / 2 ) ); if ( $angle === $startAngle ) { break; } } $object = $movie->add( $shape ); $object->setName( $id ); $startAngle = $tmpAngle; if ( $tmpAngle === $endAngle ) { break; } } return $id; } /** * Draws a circular arc * * @param ezcGraphCoordinate $center Center of ellipse * @param integer $width Width of ellipse * @param integer $height Height of ellipse * @param integer $size Height of border * @param float $startAngle Starting angle of circle sector * @param float $endAngle Ending angle of circle sector * @param ezcGraphColor $color Color of Border * @param bool $filled * @return void */ public function drawCircularArc( ezcGraphCoordinate $center, $width, $height, $size, $startAngle, $endAngle, ezcGraphColor $color, $filled = true ) { if ( $startAngle > $endAngle ) { $tmp = $startAngle; $startAngle = $endAngle; $endAngle = $tmp; } $id = $this->simulateCircularArc( $center, $width, $height, $size, $startAngle, $endAngle, $color, $filled ); if ( ( $this->options->shadeCircularArc !== false ) && $filled ) { $gradient = new ezcGraphLinearGradient( new ezcGraphCoordinate( $center->x - $width, $center->y ), new ezcGraphCoordinate( $center->x + $width, $center->y ), ezcGraphColor::fromHex( '#FFFFFF' )->transparent( $this->options->shadeCircularArc * 1.5 ), ezcGraphColor::fromHex( '#000000' )->transparent( $this->options->shadeCircularArc * 1.5 ) ); $this->simulateCircularArc( $center, $width, $height, $size, $startAngle, $endAngle, $gradient, $filled ); } return $id; } /** * Draw circle * * @param ezcGraphCoordinate $center Center of ellipse * @param mixed $width Width of ellipse * @param mixed $height height of ellipse * @param ezcGraphColor $color Color * @param mixed $filled Filled * @return void */ public function drawCircle( ezcGraphCoordinate $center, $width, $height, ezcGraphColor $color, $filled = true ) { $movie = $this->getDocument(); $shape = new SWFShape(); $this->setShapeColor( $shape, $color, 1, $filled ); // Reduce size if ( !$filled ) { $width -= 1; $height -= 1; } $shape->movePenTo( $this->modifyCoordinate( $center->x + $width / 2 ), $this->modifyCoordinate( $center->y ) ); // @TODO: User SWFShape::curveTo for ( $angle = $this->options->circleResolution; $angle < 360; $angle += $this->options->circleResolution ) { $shape->drawLineTo( $this->modifyCoordinate( $center->x + cos( deg2rad( $angle ) ) * $width / 2 ), $this->modifyCoordinate( $center->y + sin( deg2rad( $angle ) ) * $height / 2 ) ); } $shape->drawLineTo( $this->modifyCoordinate( $center->x + $width / 2 ), $this->modifyCoordinate( $center->y ) ); $object = $movie->add( $shape ); $object->setName( $id = 'ezcGraphCircle_' . $this->id++ ); return $id; } /** * Draw an image * * The image will be inlined in the SVG document using data URL scheme. For * this the mime type and base64 encoded file content will be merged to * URL. * * @param mixed $file Image file * @param ezcGraphCoordinate $position Top left position * @param float $width Width of image in destination image * @param float $height Height of image in destination image * @return void */ public function drawImage( $file, ezcGraphCoordinate $position, $width, $height ) { $movie = $this->getDocument(); $imageData = getimagesize( $file ); if ( ( $imageData[2] !== IMAGETYPE_JPEG ) && ( $imageData[2] !== IMAGETYPE_PNG ) ) { throw new ezcGraphFlashBitmapTypeException( $imageData[2] ); } // Try to create a new SWFBitmap object from provided file $bitmap = new SWFBitmap( fopen( $file, 'rb' ) ); // Add the image to the movie $object = $this->movie->add( $bitmap ); // Image size is calculated on the base of a tick size of 20, so // that we need to transform this, to our tick size. $factor = $this->modifyCoordinate( 1 ) / 20; $object->scale( $factor, $factor ); // Scale by ratio of requested and original image size $object->scale( $width / $imageData[0], $height / $imageData[1] ); // Move object to the right position $object->moveTo( $this->modifyCoordinate( $position->x ), $this->modifyCoordinate( $position->y ) ); // Create, set and return unique ID $object->setName( $id = 'ezcGraphImage_'. $this->id++ ); return $id; } /** * Return mime type for current image format * * @return string */ public function getMimeType() { return 'application/x-shockwave-flash'; } /** * Finally save image * * @param string $file Destination filename * @return void */ public function render( $file ) { $this->drawAllTexts(); $movie = $this->getDocument(); $movie->save( $file, $this->options->compression ); } /** * Get resource of rendered result * * Return the resource of the rendered result. You should not use this * method before you called either renderToOutput() or render(), as the * image may not be completely rendered until then. * * @return SWFMovie */ public function getResource() { return $this->movie; } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/driver/gd.php000066400000000000000000001230431226600447100233440ustar00rootroot00000000000000 * $graph = new ezcGraphPieChart(); * $graph->palette = new ezcGraphPaletteEzGreen(); * $graph->title = 'Access statistics'; * $graph->legend = false; * * $graph->driver = new ezcGraphGdDriver(); * $graph->options->font = 'tutorial_font.ttf'; * * // Generate a Jpeg with lower quality. The default settings result in a image * // with better quality. * // * // The reduction of the supersampling to 1 will result in no anti aliasing of * // the image. JPEG is not the optimal format for grapics, PNG is far better for * // this kind of images. * $graph->driver->options->supersampling = 1; * $graph->driver->options->jpegQuality = 100; * $graph->driver->options->imageFormat = IMG_JPEG; * * $graph->data['Access statistics'] = new ezcGraphArrayDataSet( array( * 'Mozilla' => 19113, * 'Explorer' => 10917, * 'Opera' => 1464, * 'Safari' => 652, * 'Konqueror' => 474, * ) ); * * $graph->render( 400, 200, 'tutorial_dirver_gd.jpg' ); * * * @version 1.5 * @package Graph * @mainclass */ class ezcGraphGdDriver extends ezcGraphDriver { /** * Image resource * * @var resource */ protected $image; /** * Array with image files to draw * * @var array */ protected $preProcessImages = array(); /** * List of strings to draw * array ( array( * 'text' => array( 'strings' ), * 'options' => ezcGraphFontOptions, * ) * * @var array */ protected $strings = array(); /** * Contains resources for already loaded ps fonts. * array( * path => resource * ) * * @var array */ protected $psFontResources = array(); /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { ezcBase::checkDependency( 'Graph', ezcBase::DEP_PHP_EXTENSION, 'gd' ); $this->options = new ezcGraphGdDriverOptions( $options ); } /** * Returns the image resource to draw on. * * If no resource exists the image will be created. The size of the * returned image depends on the supersampling factor and the size of the * chart. * * @return resource */ protected function getImage() { if ( !isset( $this->image ) ) { $this->image = imagecreatetruecolor( $this->supersample( $this->options->width ), $this->supersample( $this->options->height ) ); // Default to a transparent white background $bgColor = imagecolorallocatealpha( $this->image, 255, 255, 255, 127 ); imagealphablending( $this->image, true ); imagesavealpha( $this->image, true ); imagefill( $this->image, 1, 1, $bgColor ); imagesetthickness( $this->image, $this->options->supersampling ); } return $this->image; } /** * Allocates a color * * This function tries to allocate the requested color. If the color * already exists in the imaga it will be reused. * * @param ezcGraphColor $color * @return int Color index */ protected function allocate( ezcGraphColor $color ) { $image = $this->getImage(); if ( $color->alpha > 0 ) { $fetched = imagecolorexactalpha( $image, $color->red, $color->green, $color->blue, $color->alpha / 2 ); if ( $fetched < 0 ) { $fetched = imagecolorallocatealpha( $image, $color->red, $color->green, $color->blue, $color->alpha / 2 ); } return $fetched; } else { $fetched = imagecolorexact( $image, $color->red, $color->green, $color->blue ); if ( $fetched < 0 ) { $fetched = imagecolorallocate( $image, $color->red, $color->green, $color->blue ); } return $fetched; } } /** * Creates an image resource from an image file * * @param string $file Filename * @return resource Image */ protected function imageCreateFrom( $file ) { $data = getimagesize( $file ); switch ( $data[2] ) { case 1: return array( 'width' => $data[0], 'height' => $data[1], 'image' => imagecreatefromgif( $file ) ); case 2: return array( 'width' => $data[0], 'height' => $data[1], 'image' => imagecreatefromjpeg( $file ) ); case 3: return array( 'width' => $data[0], 'height' => $data[1], 'image' => imagecreatefrompng( $file ) ); default: throw new ezcGraphGdDriverUnsupportedImageTypeException( $data[2] ); } } /** * Supersamples a single coordinate value. * * Applies supersampling to a single coordinate value. * * @param float $value Coordinate value * @return float Supersampled coordinate value */ protected function supersample( $value ) { $mod = (int) floor( $this->options->supersampling / 2 ); return $value * $this->options->supersampling - $mod; } /** * Draws a single polygon. * * @param array $points Point array * @param ezcGraphColor $color Polygon color * @param mixed $filled Filled * @param float $thickness Line thickness * @return void */ public function drawPolygon( array $points, ezcGraphColor $color, $filled = true, $thickness = 1. ) { $image = $this->getImage(); $drawColor = $this->allocate( $color ); // Create point array $pointCount = count( $points ); $pointArray = array(); for ( $i = 0; $i < $pointCount; ++$i ) { $pointArray[] = $this->supersample( $points[$i]->x ); $pointArray[] = $this->supersample( $points[$i]->y ); } // Draw polygon if ( $filled ) { imagefilledpolygon( $image, $pointArray, $pointCount, $drawColor ); } else { imagepolygon( $image, $pointArray, $pointCount, $drawColor ); } return $points; } /** * Draws a line * * @param ezcGraphCoordinate $start Start point * @param ezcGraphCoordinate $end End point * @param ezcGraphColor $color Line color * @param float $thickness Line thickness * @return void */ public function drawLine( ezcGraphCoordinate $start, ezcGraphCoordinate $end, ezcGraphColor $color, $thickness = 1. ) { $image = $this->getImage(); $drawColor = $this->allocate( $color ); imagesetthickness( $this->image, $this->options->supersampling * $thickness ); imageline( $image, $this->supersample( $start->x ), $this->supersample( $start->y ), $this->supersample( $end->x ), $this->supersample( $end->y ), $drawColor ); imagesetthickness( $this->image, $this->options->supersampling ); return array(); } /** * Returns boundings of text depending on the available font extension * * @param float $size Textsize * @param ezcGraphFontOptions $font Font * @param string $text Text * @return ezcGraphBoundings Boundings of text */ protected function getTextBoundings( $size, ezcGraphFontOptions $font, $text ) { switch ( $font->type ) { case ezcGraph::PS_FONT: if ( !isset( $this->psFontResources[$font->path] ) ) { $this->psFontResources[$font->path] = imagePsLoadFont( $font->path ); } $boundings = imagePsBBox( $text, $this->psFontResources[$font->path], $size ); return new ezcGraphBoundings( $boundings[0], $boundings[1], $boundings[2], $boundings[3] ); case ezcGraph::TTF_FONT: switch ( true ) { case ezcBaseFeatures::hasFunction( 'imageftbbox' ) && !$this->options->forceNativeTTF: $boundings = imageFtBBox( $size, 0, $font->path, $text ); return new ezcGraphBoundings( $boundings[0], $boundings[1], $boundings[4], $boundings[5] ); case ezcBaseFeatures::hasFunction( 'imagettfbbox' ): $boundings = imageTtfBBox( $size, 0, $font->path, $text ); return new ezcGraphBoundings( $boundings[0], $boundings[1], $boundings[4], $boundings[5] ); } break; } } /** * Render text depending of font type and available font extensions * * @param resource $image Image resource * @param string $text Text * @param int $type Font type * @param string $path Font path * @param ezcGraphColor $color Font color * @param ezcGraphCoordinate $position Position * @param float $size Textsize * @param ezcGraphRotation $rotation * * @return void */ protected function renderText( $image, $text, $type, $path, ezcGraphColor $color, ezcGraphCoordinate $position, $size, ezcGraphRotation $rotation = null ) { if ( $rotation !== null ) { // Rotation is relative to top left point of text and not relative // to the bounding coordinate system $rotation = new ezcGraphRotation( $rotation->getRotation(), new ezcGraphCoordinate( $rotation->getCenter()->x - $position->x, $rotation->getCenter()->y - $position->y ) ); } switch ( $type ) { case ezcGraph::PS_FONT: imagePsText( $image, $text, $this->psFontResources[$path], $size, $this->allocate( $color ), 1, $position->x + ( $rotation === null ? 0 : $rotation->get( 0, 2 ) ), $position->y + ( $rotation === null ? 0 : $rotation->get( 1, 2 ) ), 0, 0, ( $rotation === null ? 0 : -$rotation->getRotation() ), 4 ); break; case ezcGraph::TTF_FONT: switch ( true ) { case ezcBaseFeatures::hasFunction( 'imagefttext' ) && !$this->options->forceNativeTTF: imageFtText( $image, $size, ( $rotation === null ? 0 : -$rotation->getRotation() ), $position->x + ( $rotation === null ? 0 : $rotation->get( 0, 2 ) ), $position->y + ( $rotation === null ? 0 : $rotation->get( 1, 2 ) ), $this->allocate( $color ), $path, $text ); break; case ezcBaseFeatures::hasFunction( 'imagettftext' ): imageTtfText( $image, $size, ( $rotation === null ? 0 : -$rotation->getRotation() ), $position->x + ( $rotation === null ? 0 : $rotation->get( 0, 2 ) ), $position->y + ( $rotation === null ? 0 : $rotation->get( 1, 2 ) ), $this->allocate( $color ), $path, $text ); break; } break; } } /** * Writes text in a box of desired size * * @param string $string Text * @param ezcGraphCoordinate $position Top left position * @param float $width Width of text box * @param float $height Height of text box * @param int $align Alignement of text * @param ezcGraphRotation $rotation * @return void */ public function drawTextBox( $string, ezcGraphCoordinate $position, $width, $height, $align, ezcGraphRotation $rotation = null ) { $padding = $this->options->font->padding + ( $this->options->font->border !== false ? $this->options->font->borderWidth : 0 ); $width -= $padding * 2; $height -= $padding * 2; $position->x += $padding; $position->y += $padding; // Try to get a font size for the text to fit into the box $maxSize = min( $height, $this->options->font->maxFontSize ); $result = false; for ( $size = $maxSize; $size >= $this->options->font->minFontSize; --$size ) { $result = $this->testFitStringInTextBox( $string, $position, $width, $height, $size ); if ( is_array( $result ) ) { break; } $size = floor( ( $newsize = $size * ( $result ) ) >= $size ? $size - 1 : $newsize ); } if ( !is_array( $result ) ) { if ( ( $height >= $this->options->font->minFontSize ) && ( $this->options->autoShortenString ) ) { $result = $this->tryFitShortenedString( $string, $position, $width, $height, $size = $this->options->font->minFontSize ); } else { throw new ezcGraphFontRenderingException( $string, $this->options->font->minFontSize, $width, $height ); } } $this->options->font->minimalUsedFont = $size; $this->strings[] = array( 'text' => $result, 'position' => $position, 'width' => $width, 'height' => $height, 'align' => $align, 'font' => $this->options->font, 'rotation' => $rotation, ); return array( clone $position, new ezcGraphCoordinate( $position->x + $width, $position->y ), new ezcGraphCoordinate( $position->x + $width, $position->y + $height ), new ezcGraphCoordinate( $position->x, $position->y + $height ), ); } /** * Draw all collected texts * * The texts are collected and their maximum possible font size is * calculated. This function finally draws the texts on the image, this * delayed drawing has two reasons: * * 1) This way the text strings are always on top of the image, what * results in better readable texts * 2) The maximum possible font size can be calculated for a set of texts * with the same font configuration. Strings belonging to one chart * element normally have the same font configuration, so that all texts * belonging to one element will have the same font size. * * @access protected * @return void */ protected function drawAllTexts() { $image = $this->getImage(); foreach ( $this->strings as $text ) { $size = $text['font']->minimalUsedFont; $completeHeight = count( $text['text'] ) * $size + ( count( $text['text'] ) - 1 ) * $this->options->lineSpacing; // Calculate y offset for vertical alignement switch ( true ) { case ( $text['align'] & ezcGraph::BOTTOM ): $yOffset = $text['height'] - $completeHeight; break; case ( $text['align'] & ezcGraph::MIDDLE ): $yOffset = ( $text['height'] - $completeHeight ) / 2; break; case ( $text['align'] & ezcGraph::TOP ): default: $yOffset = 0; break; } $padding = $text['font']->padding + $text['font']->borderWidth / 2; if ( $this->options->font->minimizeBorder === true ) { // Calculate maximum width of text rows $width = false; foreach ( $text['text'] as $line ) { $string = implode( ' ', $line ); $boundings = $this->getTextBoundings( $size, $text['font'], $string ); if ( ( $width === false) || ( $boundings->width > $width ) ) { $width = $boundings->width; } } switch ( true ) { case ( $text['align'] & ezcGraph::LEFT ): $xOffset = 0; break; case ( $text['align'] & ezcGraph::CENTER ): $xOffset = ( $text['width'] - $width ) / 2; break; case ( $text['align'] & ezcGraph::RIGHT ): $xOffset = $text['width'] - $width; break; } $borderPolygonArray = array( new ezcGraphCoordinate( $text['position']->x - $padding + $xOffset, $text['position']->y - $padding + $yOffset ), new ezcGraphCoordinate( $text['position']->x + $padding * 2 + $xOffset + $width, $text['position']->y - $padding + $yOffset ), new ezcGraphCoordinate( $text['position']->x + $padding * 2 + $xOffset + $width, $text['position']->y + $padding * 2 + $yOffset + $completeHeight ), new ezcGraphCoordinate( $text['position']->x - $padding + $xOffset, $text['position']->y + $padding * 2 + $yOffset + $completeHeight ), ); } else { $borderPolygonArray = array( new ezcGraphCoordinate( $text['position']->x - $padding, $text['position']->y - $padding ), new ezcGraphCoordinate( $text['position']->x + $padding * 2 + $text['width'], $text['position']->y - $padding ), new ezcGraphCoordinate( $text['position']->x + $padding * 2 + $text['width'], $text['position']->y + $padding * 2 + $text['height'] ), new ezcGraphCoordinate( $text['position']->x - $padding, $text['position']->y + $padding * 2 + $text['height'] ), ); } if ( $text['rotation'] !== null ) { foreach ( $borderPolygonArray as $nr => $point ) { $borderPolygonArray[$nr] = $text['rotation']->transformCoordinate( $point ); } } if ( $text['font']->background !== false ) { $this->drawPolygon( $borderPolygonArray, $text['font']->background, true ); } if ( $text['font']->border !== false ) { $this->drawPolygon( $borderPolygonArray, $text['font']->border, false, $text['font']->borderWidth ); } // Render text with evaluated font size foreach ( $text['text'] as $line ) { $string = implode( ' ', $line ); $boundings = $this->getTextBoundings( $size, $text['font'], $string ); $text['position']->y += $size; switch ( true ) { case ( $text['align'] & ezcGraph::LEFT ): $position = new ezcGraphCoordinate( $text['position']->x, $text['position']->y + $yOffset ); break; case ( $text['align'] & ezcGraph::RIGHT ): $position = new ezcGraphCoordinate( $text['position']->x + ( $text['width'] - $boundings->width ), $text['position']->y + $yOffset ); break; case ( $text['align'] & ezcGraph::CENTER ): $position = new ezcGraphCoordinate( $text['position']->x + ( ( $text['width'] - $boundings->width ) / 2 ), $text['position']->y + $yOffset ); break; } // Calculate relative modification of rotation center point if ( $text['rotation'] !== null ) { $rotation = new ezcGraphRotation( $text['rotation']->getRotation(), new ezcGraphCoordinate( $text['rotation']->getCenter()->x + $position->x - $text['position']->x, $text['rotation']->getCenter()->y + $position->y - $text['position']->y ) ); $rotation = $text['rotation']; } else { $rotation = null; } // Optionally draw text shadow if ( $text['font']->textShadow === true ) { $this->renderText( $image, $string, $text['font']->type, $text['font']->path, $text['font']->textShadowColor, new ezcGraphCoordinate( $position->x + $text['font']->textShadowOffset, $position->y + $text['font']->textShadowOffset ), $size, $rotation ); } // Finally draw text $this->renderText( $image, $string, $text['font']->type, $text['font']->path, $text['font']->color, $position, $size, $rotation ); $text['position']->y += $size * $this->options->lineSpacing; } } } /** * Draws a sector of cirlce * * @param ezcGraphCoordinate $center Center of circle * @param mixed $width Width * @param mixed $height Height * @param mixed $startAngle Start angle of circle sector * @param mixed $endAngle End angle of circle sector * @param ezcGraphColor $color Color * @param mixed $filled Filled * @return void */ public function drawCircleSector( ezcGraphCoordinate $center, $width, $height, $startAngle, $endAngle, ezcGraphColor $color, $filled = true ) { $image = $this->getImage(); $drawColor = $this->allocate( $color ); // Normalize angles if ( $startAngle > $endAngle ) { $tmp = $startAngle; $startAngle = $endAngle; $endAngle = $tmp; } if ( ( $endAngle - $startAngle ) > 359.99999 ) { return $this->drawCircle( $center, $width, $height, $color, $filled ); } // Because of bug #45552 in PHPs ext/GD we check for a minimal distance // on the outer border of the circle sector, and skip the drawing if // the distance is lower then 1. // // See also: http://bugs.php.net/45552 $startPoint = new ezcGraphVector( $center->x + ( ( cos( deg2rad( $startAngle ) ) * $width ) / 2 ), $center->y + ( ( sin( deg2rad( $startAngle ) ) * $height ) / 2 ) ); if ( $startPoint->sub( new ezcGraphVector( $center->x + ( ( cos( deg2rad( $endAngle ) ) * $width ) / 2 ), $center->y + ( ( sin( deg2rad( $endAngle ) ) * $height ) / 2 ) ) )->length() < 1 ) { // Skip this circle sector return array(); } if ( $filled ) { imagefilledarc( $image, $this->supersample( $center->x ), $this->supersample( $center->y ), $this->supersample( $width ), $this->supersample( $height ), $startAngle, $endAngle, $drawColor, IMG_ARC_PIE ); } else { imagefilledarc( $image, $this->supersample( $center->x ), $this->supersample( $center->y ), $this->supersample( $width ), $this->supersample( $height ), $startAngle, $endAngle, $drawColor, IMG_ARC_PIE | IMG_ARC_NOFILL | IMG_ARC_EDGED ); } // Create polygon array to return $polygonArray = array( $center ); for ( $angle = $startAngle; $angle < $endAngle; $angle += $this->options->imageMapResolution ) { $polygonArray[] = new ezcGraphCoordinate( $center->x + ( ( cos( deg2rad( $angle ) ) * $width ) / 2 ), $center->y + ( ( sin( deg2rad( $angle ) ) * $height ) / 2 ) ); } $polygonArray[] = new ezcGraphCoordinate( $center->x + ( ( cos( deg2rad( $endAngle ) ) * $width ) / 2 ), $center->y + ( ( sin( deg2rad( $endAngle ) ) * $height ) / 2 ) ); return $polygonArray; } /** * Draws a single element of a circular arc * * ext/gd itself does not support something like circular arcs, so that * this functions draws rectangular polygons as a part of circular arcs * to interpolate them. This way it is possible to apply a linear gradient * to the circular arc, because we draw single steps anyway. * * @param ezcGraphCoordinate $center Center of ellipse * @param integer $width Width of ellipse * @param integer $height Height of ellipse * @param integer $size Height of border * @param float $startAngle Starting angle of circle sector * @param float $endAngle Ending angle of circle sector * @param ezcGraphColor $color Color of Border * @return void */ protected function drawCircularArcStep( ezcGraphCoordinate $center, $width, $height, $size, $startAngle, $endAngle, ezcGraphColor $color ) { $this->drawPolygon( array( new ezcGraphCoordinate( $center->x + ( ( cos( deg2rad( $startAngle ) ) * $width ) / 2 ), $center->y + ( ( sin( deg2rad( $startAngle ) ) * $height ) / 2 ) ), new ezcGraphCoordinate( $center->x + ( ( cos( deg2rad( $startAngle ) ) * $width ) / 2 ), $center->y + ( ( sin( deg2rad( $startAngle ) ) * $height ) / 2 ) + $size ), new ezcGraphCoordinate( $center->x + ( ( cos( deg2rad( $endAngle ) ) * $width ) / 2 ), $center->y + ( ( sin( deg2rad( $endAngle ) ) * $height ) / 2 ) + $size ), new ezcGraphCoordinate( $center->x + ( ( cos( deg2rad( $endAngle ) ) * $width ) / 2 ), $center->y + ( ( sin( deg2rad( $endAngle ) ) * $height ) / 2 ) ), ), $color->darken( $this->options->shadeCircularArc * ( 1 + cos ( deg2rad( $startAngle ) ) ) / 2 ), true ); } /** * Draws a circular arc * * @param ezcGraphCoordinate $center Center of ellipse * @param integer $width Width of ellipse * @param integer $height Height of ellipse * @param integer $size Height of border * @param float $startAngle Starting angle of circle sector * @param float $endAngle Ending angle of circle sector * @param ezcGraphColor $color Color of Border * @param bool $filled * @return void */ public function drawCircularArc( ezcGraphCoordinate $center, $width, $height, $size, $startAngle, $endAngle, ezcGraphColor $color, $filled = true ) { $image = $this->getImage(); $drawColor = $this->allocate( $color ); // Normalize angles if ( $startAngle > $endAngle ) { $tmp = $startAngle; $startAngle = $endAngle; $endAngle = $tmp; } if ( $filled === true ) { $startIteration = ceil( $startAngle / $this->options->detail ) * $this->options->detail; $endIteration = floor( $endAngle / $this->options->detail ) * $this->options->detail; if ( $startAngle < $startIteration ) { // Draw initial step $this->drawCircularArcStep( $center, $width, $height, $size, $startAngle, $startIteration, $color ); } // Draw all steps for ( ; $startIteration < $endIteration; $startIteration += $this->options->detail ) { $this->drawCircularArcStep( $center, $width, $height, $size, $startIteration, $startIteration + $this->options->detail, $color ); } if ( $endIteration < $endAngle ) { // Draw closing step $this->drawCircularArcStep( $center, $width, $height, $size, $endIteration, $endAngle, $color ); } } else { imagefilledarc( $image, $this->supersample( $center->x ), $this->supersample( $center->y ), $this->supersample( $width ), $this->supersample( $height ), $startAngle, $endAngle, $drawColor, IMG_ARC_PIE | IMG_ARC_NOFILL ); } // Create polygon array to return $polygonArray = array(); for ( $angle = $startAngle; $angle < $endAngle; $angle += $this->options->imageMapResolution ) { $polygonArray[] = new ezcGraphCoordinate( $center->x + ( ( cos( deg2rad( $angle ) ) * $width ) / 2 ), $center->y + ( ( sin( deg2rad( $angle ) ) * $height ) / 2 ) ); } $polygonArray[] = new ezcGraphCoordinate( $center->x + ( ( cos( deg2rad( $endAngle ) ) * $width ) / 2 ), $center->y + ( ( sin( deg2rad( $endAngle ) ) * $height ) / 2 ) ); for ( $angle = $endAngle; $angle > $startAngle; $angle -= $this->options->imageMapResolution ) { $polygonArray[] = new ezcGraphCoordinate( $center->x + ( ( cos( deg2rad( $angle ) ) * $width ) / 2 ) + $size, $center->y + ( ( sin( deg2rad( $angle ) ) * $height ) / 2 ) ); } $polygonArray[] = new ezcGraphCoordinate( $center->x + ( ( cos( deg2rad( $startAngle ) ) * $width ) / 2 ) + $size, $center->y + ( ( sin( deg2rad( $startAngle ) ) * $height ) / 2 ) ); return $polygonArray; } /** * Draw circle * * @param ezcGraphCoordinate $center Center of ellipse * @param mixed $width Width of ellipse * @param mixed $height height of ellipse * @param ezcGraphColor $color Color * @param mixed $filled Filled * @return void */ public function drawCircle( ezcGraphCoordinate $center, $width, $height, ezcGraphColor $color, $filled = true ) { $image = $this->getImage(); $drawColor = $this->allocate( $color ); if ( $filled ) { imagefilledellipse( $image, $this->supersample( $center->x ), $this->supersample( $center->y ), $this->supersample( $width ), $this->supersample( $height ), $drawColor ); } else { imageellipse( $image, $this->supersample( $center->x ), $this->supersample( $center->y ), $this->supersample( $width ), $this->supersample( $height ), $drawColor ); } $polygonArray = array(); for ( $angle = 0; $angle < 360; $angle += $this->options->imageMapResolution ) { $polygonArray[] = new ezcGraphCoordinate( $center->x + ( ( cos( deg2rad( $angle ) ) * $width ) / 2 ), $center->y + ( ( sin( deg2rad( $angle ) ) * $height ) / 2 ) ); } return $polygonArray; } /** * Draw an image * * The actual drawing of the image is delayed, to not apply supersampling * to the image. The image will normally be resized using the gd function * imagecopyresampled, which provides nice antialiased scaling, so that * additional supersampling would make the image look blurred. The delayed * images will be pre-processed, so that they are draw in the back of * everything else. * * @param mixed $file Image file * @param ezcGraphCoordinate $position Top left position * @param mixed $width Width of image in destination image * @param mixed $height Height of image in destination image * @return void */ public function drawImage( $file, ezcGraphCoordinate $position, $width, $height ) { $this->preProcessImages[] = array( 'file' => $file, 'position' => clone $position, 'width' => $width, 'height' => $height, ); return array( $position, new ezcGraphCoordinate( $position->x + $width, $position->y ), new ezcGraphCoordinate( $position->x + $width, $position->y + $height ), new ezcGraphCoordinate( $position->x, $position->y + $height ), ); } /** * Draw all images to image resource handler * * @param resource $image Image to draw on * @return resource Updated image resource */ protected function addImages( $image ) { foreach ( $this->preProcessImages as $preImage ) { $preImageData = $this->imageCreateFrom( $preImage['file'] ); call_user_func_array( $this->options->resampleFunction, array( $image, $preImageData['image'], $preImage['position']->x, $preImage['position']->y, 0, 0, $preImage['width'], $preImage['height'], $preImageData['width'], $preImageData['height'], ) ); } return $image; } /** * Return mime type for current image format * * @return string */ public function getMimeType() { switch ( $this->options->imageFormat ) { case IMG_PNG: return 'image/png'; case IMG_JPEG: return 'image/jpeg'; } } /** * Render image directly to output * * The method renders the image directly to the standard output. You * normally do not want to use this function, because it makes it harder * to proper cache the generated graphs. * * @return void */ public function renderToOutput() { header( 'Content-Type: ' . $this->getMimeType() ); $this->render( null ); } /** * Finally save image * * @param string $file Destination filename * @return void */ public function render( $file ) { $destination = imagecreatetruecolor( $this->options->width, $this->options->height ); // Default to a transparent white background $bgColor = imagecolorallocatealpha( $destination, 255, 255, 255, 127 ); imagealphablending( $destination, true ); imagesavealpha( $destination, true ); imagefill( $destination, 1, 1, $bgColor ); // Apply background if one is defined if ( $this->options->background !== false ) { $background = $this->imageCreateFrom( $this->options->background ); call_user_func_array( $this->options->resampleFunction, array( $destination, $background['image'], 0, 0, 0, 0, $this->options->width, $this->options->height, $background['width'], $background['height'], ) ); } // Draw all images to exclude them from supersampling $destination = $this->addImages( $destination ); // Finally merge with graph $image = $this->getImage(); call_user_func_array( $this->options->resampleFunction, array( $destination, $image, 0, 0, 0, 0, $this->options->width, $this->options->height, $this->supersample( $this->options->width ), $this->supersample( $this->options->height ) ) ); $this->image = $destination; imagedestroy( $image ); // Draw all texts // Reset supersampling during text rendering $supersampling = $this->options->supersampling; $this->options->supersampling = 1; $this->drawAllTexts(); $this->options->supersampling = $supersampling; $image = $this->getImage(); switch ( $this->options->imageFormat ) { case IMG_PNG: if ( $file === null ) { imagepng( $image ); } else { imagepng( $image, $file ); } break; case IMG_JPEG: imagejpeg( $image, $file, $this->options->jpegQuality ); break; default: throw new ezcGraphGdDriverUnsupportedImageTypeException( $this->options->imageFormat ); } } /** * Get resource of rendered result * * Return the resource of the rendered result. You should not use this * method before you called either renderToOutput() or render(), as the * image may not be completely rendered until then. * * @return resource */ public function getResource() { return $this->image; } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/driver/svg.php000066400000000000000000001302031226600447100235450ustar00rootroot00000000000000 * $graph = new ezcGraphPieChart(); * $graph->background->color = '#FFFFFFFF'; * $graph->title = 'Access statistics'; * $graph->legend = false; * * $graph->data['Access statistics'] = new ezcGraphArrayDataSet( array( * 'Mozilla' => 19113, * 'Explorer' => 10917, * 'Opera' => 1464, * 'Safari' => 652, * 'Konqueror' => 474, * ) ); * * $graph->renderer = new ezcGraphRenderer3d(); * $graph->renderer->options->pieChartShadowSize = 10; * $graph->renderer->options->pieChartGleam = .5; * $graph->renderer->options->dataBorder = false; * $graph->renderer->options->pieChartHeight = 16; * $graph->renderer->options->legendSymbolGleam = .5; * * // SVG driver options * $graph->driver->options->templateDocument = dirname( __FILE__ ) . '/template.svg'; * $graph->driver->options->graphOffset = new ezcGraphCoordinate( 25, 40 ); * $graph->driver->options->insertIntoGroup = 'ezcGraph'; * * $graph->render( 400, 200, 'tutorial_driver_svg.svg' ); * * * @version 1.5 * @package Graph * @mainclass */ class ezcGraphSvgDriver extends ezcGraphDriver { /** * DOM tree of the svg document * * @var DOMDocument */ protected $dom; /** * DOMElement containing all svg style definitions * * @var DOMElement */ protected $defs; /** * DOMElement containing all svg objects * * @var DOMElement */ protected $elements; /** * List of strings to draw * array ( array( * 'text' => array( 'strings' ), * 'options' => ezcGraphFontOptions, * ) * * @var array */ protected $strings = array(); /** * List of already created gradients * * @var array */ protected $drawnGradients = array(); /** * Numeric unique element id * * @var int */ protected $elementID = 0; /** * Font storage for SVG font glyphs and kernings. * * @var ezcGraphSvgFont */ protected $font = null; /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { ezcBase::checkDependency( 'Graph', ezcBase::DEP_PHP_EXTENSION, 'dom' ); $this->options = new ezcGraphSvgDriverOptions( $options ); $this->font = new ezcGraphSvgFont(); } /** * Creates the DOM object to insert SVG nodes in. * * If the DOM document does not exists it will be created or loaded * according to the settings. * * @return void */ protected function createDocument() { if ( $this->dom === null ) { // Create encoding based dom document if ( $this->options->encoding !== null ) { $this->dom = new DOMDocument( '1.0', $this->options->encoding ); } else { $this->dom = new DOMDocument( '1.0' ); } if ( $this->options->templateDocument !== false ) { $this->dom->load( $this->options->templateDocument ); $this->defs = $this->dom->getElementsByTagName( 'defs' )->item( 0 ); $svg = $this->dom->getElementsByTagName( 'svg' )->item( 0 ); } else { $svg = $this->dom->createElementNS( 'http://www.w3.org/2000/svg', 'svg' ); $this->dom->appendChild( $svg ); $svg->setAttribute( 'width', $this->options->width ); $svg->setAttribute( 'height', $this->options->height ); $svg->setAttribute( 'version', '1.0' ); $svg->setAttribute( 'id', $this->options->idPrefix ); $this->defs = $this->dom->createElement( 'defs' ); $this->defs = $svg->appendChild( $this->defs ); } if ( $this->options->insertIntoGroup !== false ) { // getElementById only works for Documents validated against a certain // schema, so that the use of XPath should be faster in most cases. $xpath = new DomXPath( $this->dom ); $this->elements = $xpath->query( '//*[@id = \'' . $this->options->insertIntoGroup . '\']' )->item( 0 ); if ( !$this->elements ) { throw new ezcGraphSvgDriverInvalidIdException( $this->options->insertIntoGroup ); } } else { $this->elements = $this->dom->createElement( 'g' ); $this->elements->setAttribute( 'id', $this->options->idPrefix . 'Chart' ); $this->elements->setAttribute( 'color-rendering', $this->options->colorRendering ); $this->elements->setAttribute( 'shape-rendering', $this->options->shapeRendering ); $this->elements->setAttribute( 'text-rendering', $this->options->textRendering ); $this->elements = $svg->appendChild( $this->elements ); } } } /** * Return gradient URL * * Creates the definitions needed for a gradient, if a proper gradient does * not yet exists. In each case a URL referencing the correct gradient will * be returned. * * @param ezcGraphColor $color Gradient * @return string Gradient URL */ protected function getGradientUrl( ezcGraphColor $color ) { switch ( true ) { case ( $color instanceof ezcGraphLinearGradient ): if ( !in_array( $color->__toString(), $this->drawnGradients, true ) ) { $gradient = $this->dom->createElement( 'linearGradient' ); $gradient->setAttribute( 'id', 'Definition_' . $color->__toString() ); $this->defs->appendChild( $gradient ); // Start of linear gradient $stop = $this->dom->createElement( 'stop' ); $stop->setAttribute( 'offset', 0 ); $stop->setAttribute( 'style', sprintf( 'stop-color: #%02x%02x%02x; stop-opacity: %.2F;', $color->startColor->red, $color->startColor->green, $color->startColor->blue, 1 - ( $color->startColor->alpha / 255 ) ) ); $gradient->appendChild( $stop ); // End of linear gradient $stop = $this->dom->createElement( 'stop' ); $stop->setAttribute( 'offset', 1 ); $stop->setAttribute( 'style', sprintf( 'stop-color: #%02x%02x%02x; stop-opacity: %.2F;', $color->endColor->red, $color->endColor->green, $color->endColor->blue, 1 - ( $color->endColor->alpha / 255 ) ) ); $gradient->appendChild( $stop ); $gradient = $this->dom->createElement( 'linearGradient' ); $gradient->setAttribute( 'id', $color->__toString() ); $gradient->setAttribute( 'x1', sprintf( '%.4F', $color->startPoint->x ) ); $gradient->setAttribute( 'y1', sprintf( '%.4F', $color->startPoint->y ) ); $gradient->setAttribute( 'x2', sprintf( '%.4F', $color->endPoint->x ) ); $gradient->setAttribute( 'y2', sprintf( '%.4F', $color->endPoint->y ) ); $gradient->setAttribute( 'gradientUnits', 'userSpaceOnUse' ); $gradient->setAttributeNS( 'http://www.w3.org/1999/xlink', 'xlink:href', '#Definition_' . $color->__toString() ); $this->defs->appendChild( $gradient ); $this->drawnGradients[] = $color->__toString(); } return sprintf( 'url(#%s)', $color->__toString() ); case ( $color instanceof ezcGraphRadialGradient ): if ( !in_array( $color->__toString(), $this->drawnGradients, true ) ) { $gradient = $this->dom->createElement( 'linearGradient' ); $gradient->setAttribute( 'id', 'Definition_' . $color->__toString() ); $this->defs->appendChild( $gradient ); // Start of linear gradient $stop = $this->dom->createElement( 'stop' ); $stop->setAttribute( 'offset', 0 ); $stop->setAttribute( 'style', sprintf( 'stop-color: #%02x%02x%02x; stop-opacity: %.2F;', $color->startColor->red, $color->startColor->green, $color->startColor->blue, 1 - ( $color->startColor->alpha / 255 ) ) ); $gradient->appendChild( $stop ); // End of linear gradient $stop = $this->dom->createElement( 'stop' ); $stop->setAttribute( 'offset', 1 ); $stop->setAttribute( 'style', sprintf( 'stop-color: #%02x%02x%02x; stop-opacity: %.2F;', $color->endColor->red, $color->endColor->green, $color->endColor->blue, 1 - ( $color->endColor->alpha / 255 ) ) ); $gradient->appendChild( $stop ); $gradient = $this->dom->createElement( 'radialGradient' ); $gradient->setAttribute( 'id', $color->__toString() ); $gradient->setAttribute( 'cx', sprintf( '%.4F', $color->center->x ) ); $gradient->setAttribute( 'cy', sprintf( '%.4F', $color->center->y ) ); $gradient->setAttribute( 'fx', sprintf( '%.4F', $color->center->x ) ); $gradient->setAttribute( 'fy', sprintf( '%.4F', $color->center->y ) ); $gradient->setAttribute( 'r', max( $color->height, $color->width ) ); $gradient->setAttribute( 'gradientUnits', 'userSpaceOnUse' ); $gradient->setAttributeNS( 'http://www.w3.org/1999/xlink', 'xlink:href', '#Definition_' . $color->__toString() ); $this->defs->appendChild( $gradient ); $this->drawnGradients[] = $color->__toString(); } return sprintf( 'url(#%s)', $color->__toString() ); default: return false; } } /** * Get SVG style definition * * Returns a string with SVG style definitions created from color, * fillstatus and line thickness. * * @param ezcGraphColor $color Color * @param mixed $filled Filled * @param float $thickness Line thickness. * @return string Formatstring */ protected function getStyle( ezcGraphColor $color, $filled = true, $thickness = 1. ) { if ( $filled ) { if ( $url = $this->getGradientUrl( $color ) ) { return sprintf( 'fill: %s; stroke: none;', $url ); } else { return sprintf( 'fill: #%02x%02x%02x; fill-opacity: %.2F; stroke: none;', $color->red, $color->green, $color->blue, 1 - ( $color->alpha / 255 ) ); } } else { if ( $url = $this->getGradientUrl( $color ) ) { return sprintf( 'fill: none; stroke: %s;', $url ); } else { return sprintf( 'fill: none; stroke: #%02x%02x%02x; stroke-width: %d; stroke-opacity: %.2F; stroke-linecap: %s; stroke-linejoin: %s;', $color->red, $color->green, $color->blue, $thickness, 1 - ( $color->alpha / 255 ), $this->options->strokeLineCap, $this->options->strokeLineJoin ); } } } /** * Draws a single polygon. * * @param array $points Point array * @param ezcGraphColor $color Polygon color * @param mixed $filled Filled * @param float $thickness Line thickness * @return void */ public function drawPolygon( array $points, ezcGraphColor $color, $filled = true, $thickness = 1. ) { $this->createDocument(); if ( !$filled ) { // The middle of the border is on the outline of a polygon in SVG, // fix that: try { $points = $this->reducePolygonSize( $points, $thickness / 2 ); } catch ( ezcGraphReducementFailedException $e ) { return false; } } $lastPoint = end( $points ); $pointString = sprintf( ' M %.4F,%.4F', $lastPoint->x + $this->options->graphOffset->x, $lastPoint->y + $this->options->graphOffset->y ); foreach ( $points as $point ) { $pointString .= sprintf( ' L %.4F,%.4F', $point->x + $this->options->graphOffset->x, $point->y + $this->options->graphOffset->y ); } $pointString .= ' z '; $path = $this->dom->createElement( 'path' ); $path->setAttribute( 'd', $pointString ); $path->setAttribute( 'style', $this->getStyle( $color, $filled, $thickness ) ); $path->setAttribute( 'id', $id = ( $this->options->idPrefix . 'Polygon_' . ++$this->elementID ) ); $this->elements->appendChild( $path ); return $id; } /** * Draws a line * * @param ezcGraphCoordinate $start Start point * @param ezcGraphCoordinate $end End point * @param ezcGraphColor $color Line color * @param float $thickness Line thickness * @return void */ public function drawLine( ezcGraphCoordinate $start, ezcGraphCoordinate $end, ezcGraphColor $color, $thickness = 1. ) { $this->createDocument(); $pointString = sprintf( ' M %.4F,%.4F L %.4F,%.4F', $start->x + $this->options->graphOffset->x, $start->y + $this->options->graphOffset->y, $end->x + $this->options->graphOffset->x, $end->y + $this->options->graphOffset->y ); $path = $this->dom->createElement( 'path' ); $path->setAttribute( 'd', $pointString ); $path->setAttribute( 'style', $this->getStyle( $color, false, $thickness ) ); $path->setAttribute( 'id', $id = ( $this->options->idPrefix . 'Line_' . ++$this->elementID ) ); $this->elements->appendChild( $path ); return $id; } /** * Returns boundings of text depending on the available font extension * * @param float $size Textsize * @param ezcGraphFontOptions $font Font * @param string $text Text * @return ezcGraphBoundings Boundings of text */ protected function getTextBoundings( $size, ezcGraphFontOptions $font, $text ) { if ( $font->type === ezcGraph::SVG_FONT ) { return new ezcGraphBoundings( 0, 0, $this->font->calculateStringWidth( $font->path, $text ) * $size, $size ); } else { // If we didn't get a SVG font, continue guessing the font width. return new ezcGraphBoundings( 0, 0, $this->getTextWidth( $text, $size ), $size ); } } /** * Writes text in a box of desired size * * @param string $string Text * @param ezcGraphCoordinate $position Top left position * @param float $width Width of text box * @param float $height Height of text box * @param int $align Alignement of text * @param ezcGraphRotation $rotation * @return void */ public function drawTextBox( $string, ezcGraphCoordinate $position, $width, $height, $align, ezcGraphRotation $rotation = null ) { $padding = $this->options->font->padding + ( $this->options->font->border !== false ? $this->options->font->borderWidth : 0 ); $width -= $padding * 2; $height -= $padding * 2; $textPosition = new ezcGraphCoordinate( $position->x + $padding, $position->y + $padding ); // Try to get a font size for the text to fit into the box $maxSize = min( $height, $this->options->font->maxFontSize ); $result = false; for ( $size = $maxSize; $size >= $this->options->font->minFontSize; ) { $result = $this->testFitStringInTextBox( $string, $position, $width, $height, $size ); if ( is_array( $result ) ) { break; } $size = ( ( $newsize = $size * ( $result ) ) >= $size ? $size - 1 : floor( $newsize ) ); } if ( !is_array( $result ) ) { if ( ( $height >= $this->options->font->minFontSize ) && ( $this->options->autoShortenString ) ) { $result = $this->tryFitShortenedString( $string, $position, $width, $height, $size = $this->options->font->minFontSize ); } else { throw new ezcGraphFontRenderingException( $string, $this->options->font->minFontSize, $width, $height ); } } $this->options->font->minimalUsedFont = $size; $this->strings[] = array( 'text' => $result, 'id' => $id = ( $this->options->idPrefix . 'TextBox_' . ++$this->elementID ), 'position' => $textPosition, 'width' => $width, 'height' => $height, 'align' => $align, 'font' => $this->options->font, 'rotation' => $rotation, ); return $id; } /** * Guess text width for string * * The is no way to know the font or fontsize used by the SVG renderer to * render the string. We assume some character width defined in the SVG * driver options, tu guess the length of a string. We discern between * numeric an non numeric strings, because we often use only numeric * strings to display chart data and numbers tend to be a bit wider then * characters. * * @param mixed $string * @param mixed $size * @access protected * @return void */ protected function getTextWidth( $string, $size ) { switch ( strtolower( $this->options->encoding ) ) { case '': case 'utf-8': case 'utf-16': $string = utf8_decode( $string ); break; } if ( is_numeric( $string ) ) { return $size * strlen( $string ) * $this->options->assumedNumericCharacterWidth; } else { return $size * strlen( $string ) * $this->options->assumedTextCharacterWidth; } } /** * Encodes non-utf-8 strings * * Transforms non-utf-8 strings to their hex entities, because ext/DOM * fails here with conversion errors. * * @param string $string * @return string */ protected function encode( $string ) { $string = htmlspecialchars( $string ); switch ( strtolower( $this->options->encoding ) ) { case '': case 'utf-8': case 'utf-16': return $string; default: // Manual escaping of non ANSII characters, because ext/DOM fails here return preg_replace_callback( '/[\\x80-\\xFF]/', create_function( '$char', 'return sprintf( \'&#x%02x;\', ord( $char[0] ) );' ), $string ); } } /** * Draw all collected texts * * The texts are collected and their maximum possible font size is * calculated. This function finally draws the texts on the image, this * delayed drawing has two reasons: * * 1) This way the text strings are always on top of the image, what * results in better readable texts * 2) The maximum possible font size can be calculated for a set of texts * with the same font configuration. Strings belonging to one chart * element normally have the same font configuration, so that all texts * belonging to one element will have the same font size. * * @access protected * @return void */ protected function drawAllTexts() { $elementsRoot = $this->elements; foreach ( $this->strings as $text ) { // Add all text elements into one group $group = $this->dom->createElement( 'g' ); $group->setAttribute( 'id', $text['id'] ); if ( $text['rotation'] !== null ) { $group->setAttribute( 'transform', sprintf( 'rotate( %.2F %.4F %.4F )', $text['rotation']->getRotation(), $text['rotation']->getCenter()->x, $text['rotation']->getCenter()->y ) ); } $group = $elementsRoot->appendChild( $group ); $size = $text['font']->minimalUsedFont; $font = $text['font']->name; $completeHeight = count( $text['text'] ) * $size + ( count( $text['text'] ) - 1 ) * $this->options->lineSpacing; // Calculate y offset for vertical alignement switch ( true ) { case ( $text['align'] & ezcGraph::BOTTOM ): $yOffset = $text['height'] - $completeHeight; break; case ( $text['align'] & ezcGraph::MIDDLE ): $yOffset = ( $text['height'] - $completeHeight ) / 2; break; case ( $text['align'] & ezcGraph::TOP ): default: $yOffset = 0; break; } $padding = $text['font']->padding + $text['font']->borderWidth / 2; if ( $this->options->font->minimizeBorder === true ) { // Calculate maximum width of text rows $width = false; foreach ( $text['text'] as $line ) { $string = implode( ' ', $line ); if ( ( $strWidth = $this->getTextBoundings( $size, $text['font'], $string )->width ) > $width ) { $width = $strWidth; } } switch ( true ) { case ( $text['align'] & ezcGraph::LEFT ): $xOffset = 0; break; case ( $text['align'] & ezcGraph::CENTER ): $xOffset = ( $text['width'] - $width ) / 2; break; case ( $text['align'] & ezcGraph::RIGHT ): $xOffset = $text['width'] - $width; break; } $borderPolygonArray = array( new ezcGraphCoordinate( $text['position']->x - $padding + $xOffset, $text['position']->y - $padding + $yOffset ), new ezcGraphCoordinate( $text['position']->x + $padding * 2 + $xOffset + $width, $text['position']->y - $padding + $yOffset ), new ezcGraphCoordinate( $text['position']->x + $padding * 2 + $xOffset + $width, $text['position']->y + $padding * 2 + $yOffset + $completeHeight ), new ezcGraphCoordinate( $text['position']->x - $padding + $xOffset, $text['position']->y + $padding * 2 + $yOffset + $completeHeight ), ); } else { $borderPolygonArray = array( new ezcGraphCoordinate( $text['position']->x - $padding, $text['position']->y - $padding ), new ezcGraphCoordinate( $text['position']->x + $padding * 2 + $text['width'], $text['position']->y - $padding ), new ezcGraphCoordinate( $text['position']->x + $padding * 2 + $text['width'], $text['position']->y + $padding * 2 + $text['height'] ), new ezcGraphCoordinate( $text['position']->x - $padding, $text['position']->y + $padding * 2 + $text['height'] ), ); } // Set elements root temporary to local text group to ensure // background and border beeing elements of text group $this->elements = $group; if ( $text['font']->background !== false ) { $this->drawPolygon( $borderPolygonArray, $text['font']->background, true ); } else { // Always draw full tranparent background polygon as fallback, // to be able to click on complete font space, not only on // the text $this->drawPolygon( $borderPolygonArray, ezcGraphColor::fromHex( '#FFFFFFFF' ), true ); } if ( $text['font']->border !== false ) { $this->drawPolygon( $borderPolygonArray, $text['font']->border, false, $text['font']->borderWidth ); } $this->elements = $elementsRoot; // Bottom line for SVG fonts is lifted a bit $text['position']->y += $size * .85; // Render text with evaluated font size foreach ( $text['text'] as $line ) { $string = implode( ' ', $line ); switch ( true ) { case ( $text['align'] & ezcGraph::LEFT ): $position = new ezcGraphCoordinate( $text['position']->x, $text['position']->y + $yOffset ); break; case ( $text['align'] & ezcGraph::RIGHT ): $position = new ezcGraphCoordinate( $text['position']->x + ( $text['width'] - $this->getTextBoundings( $size, $text['font'], $string )->width ), $text['position']->y + $yOffset ); break; case ( $text['align'] & ezcGraph::CENTER ): $position = new ezcGraphCoordinate( $text['position']->x + ( ( $text['width'] - $this->getTextBoundings( $size, $text['font'], $string )->width ) / 2 ), $text['position']->y + $yOffset ); break; } // Optionally draw text shadow if ( $text['font']->textShadow === true ) { $textNode = $this->dom->createElement( 'text', $this->encode( $string ) ); $textNode->setAttribute( 'id', $text['id'] . '_shadow' ); $textNode->setAttribute( 'x', sprintf( '%.4F', $position->x + $this->options->graphOffset->x + $text['font']->textShadowOffset ) ); $textNode->setAttribute( 'text-length', sprintf( '%.4Fpx', $this->getTextBoundings( $size, $text['font'], $string )->width ) ); $textNode->setAttribute( 'y', sprintf( '%.4F', $position->y + $this->options->graphOffset->y + $text['font']->textShadowOffset ) ); $textNode->setAttribute( 'style', sprintf( 'font-size: %dpx; font-family: \'%s\'; fill: #%02x%02x%02x; fill-opacity: %.2F; stroke: none;', $size, $text['font']->name, $text['font']->textShadowColor->red, $text['font']->textShadowColor->green, $text['font']->textShadowColor->blue, 1 - ( $text['font']->textShadowColor->alpha / 255 ) ) ); $group->appendChild( $textNode ); } // Finally draw text $textNode = $this->dom->createElement( 'text', $this->encode( $string ) ); $textNode->setAttribute( 'id', $text['id'] . '_text' ); $textNode->setAttribute( 'x', sprintf( '%.4F', $position->x + $this->options->graphOffset->x ) ); $textNode->setAttribute( 'text-length', sprintf( '%.4Fpx', $this->getTextBoundings( $size, $text['font'], $string )->width ) ); $textNode->setAttribute( 'y', sprintf( '%.4F', $position->y + $this->options->graphOffset->y ) ); $textNode->setAttribute( 'style', sprintf( 'font-size: %dpx; font-family: \'%s\'; fill: #%02x%02x%02x; fill-opacity: %.2F; stroke: none;', $size, $text['font']->name, $text['font']->color->red, $text['font']->color->green, $text['font']->color->blue, 1 - ( $text['font']->color->alpha / 255 ) ) ); $group->appendChild( $textNode ); $text['position']->y += $size + $size * $this->options->lineSpacing; } } } /** * Draws a sector of cirlce * * @param ezcGraphCoordinate $center Center of circle * @param mixed $width Width * @param mixed $height Height * @param mixed $startAngle Start angle of circle sector * @param mixed $endAngle End angle of circle sector * @param ezcGraphColor $color Color * @param mixed $filled Filled; * @return void */ public function drawCircleSector( ezcGraphCoordinate $center, $width, $height, $startAngle, $endAngle, ezcGraphColor $color, $filled = true ) { $this->createDocument(); // Normalize angles if ( $startAngle > $endAngle ) { $tmp = $startAngle; $startAngle = $endAngle; $endAngle = $tmp; } if ( ( $endAngle - $startAngle ) >= 360 ) { return $this->drawCircle( $center, $width, $height, $color, $filled ); } // We need the radius $width /= 2; $height /= 2; // Apply offset to copy of center coordinate $center = clone $center; $center->x += $this->options->graphOffset->x; $center->y += $this->options->graphOffset->y; if ( $filled ) { $Xstart = $center->x + $width * cos( -deg2rad( $startAngle ) ); $Ystart = $center->y + $height * sin( deg2rad( $startAngle ) ); $Xend = $center->x + $width * cos( ( -deg2rad( $endAngle ) ) ); $Yend = $center->y + $height * sin( ( deg2rad( $endAngle ) ) ); $arc = $this->dom->createElement( 'path' ); $arc->setAttribute( 'd', sprintf( 'M %.2F,%.2F L %.2F,%.2F A %.2F,%.2F 0 %d,1 %.2F,%.2F z', // Middle $center->x, $center->y, // Startpoint $Xstart, $Ystart, // Radius $width, $height, // SVG-Stuff ( $endAngle - $startAngle ) > 180, // Endpoint $Xend, $Yend ) ); $arc->setAttribute( 'style', $this->getStyle( $color, $filled, 1 ) ); $arc->setAttribute( 'id', $id = ( $this->options->idPrefix . 'CircleSector_' . ++$this->elementID ) ); $this->elements->appendChild( $arc ); return $id; } else { try { $reduced = $this->reduceEllipseSize( $center, $width * 2, $height * 2, $startAngle, $endAngle, .5 ); } catch ( ezcGraphReducementFailedException $e ) { return false; } $arc = $this->dom->createElement( 'path' ); $arc->setAttribute( 'd', sprintf( 'M %.2F,%.2F L %.2F,%.2F A %.2F,%.2F 0 %d,1 %.2F,%.2F z', // Middle $reduced['center']->x, $reduced['center']->y, // Startpoint $reduced['start']->x, $reduced['start']->y, // Radius $width - .5, $height - .5, // SVG-Stuff ( $endAngle - $startAngle ) > 180, // Endpoint $reduced['end']->x, $reduced['end']->y ) ); $arc->setAttribute( 'style', $this->getStyle( $color, $filled, 1 ) ); $arc->setAttribute( 'id', $id = ( $this->options->idPrefix . 'CircleSector_' . ++$this->elementID ) ); $this->elements->appendChild( $arc ); return $id; } } /** * Draws a circular arc * * @param ezcGraphCoordinate $center Center of ellipse * @param integer $width Width of ellipse * @param integer $height Height of ellipse * @param integer $size Height of border * @param float $startAngle Starting angle of circle sector * @param float $endAngle Ending angle of circle sector * @param ezcGraphColor $color Color of Border * @param bool $filled * @return void */ public function drawCircularArc( ezcGraphCoordinate $center, $width, $height, $size, $startAngle, $endAngle, ezcGraphColor $color, $filled = true ) { $this->createDocument(); // Normalize angles if ( $startAngle > $endAngle ) { $tmp = $startAngle; $startAngle = $endAngle; $endAngle = $tmp; } if ( ( $endAngle - $startAngle > 180 ) || ( ( $startAngle % 180 != 0) && ( $endAngle % 180 != 0) && ( ( $startAngle % 360 > 180 ) XOR ( $endAngle % 360 > 180 ) ) ) ) { // Border crosses he 180 degrees border $intersection = floor( $endAngle / 180 ) * 180; while ( $intersection >= $endAngle ) { $intersection -= 180; } $this->drawCircularArc( $center, $width, $height, $size, $startAngle, $intersection, $color, $filled ); $this->drawCircularArc( $center, $width, $height, $size, $intersection, $endAngle, $color, $filled ); return; } // We need the radius $width /= 2; $height /= 2; $Xstart = $center->x + $this->options->graphOffset->x + $width * cos( -deg2rad( $startAngle ) ); $Ystart = $center->y + $this->options->graphOffset->y + $height * sin( deg2rad( $startAngle ) ); $Xend = $center->x + $this->options->graphOffset->x + $width * cos( ( -deg2rad( $endAngle ) ) ); $Yend = $center->y + $this->options->graphOffset->y + $height * sin( ( deg2rad( $endAngle ) ) ); if ( $filled === true ) { $arc = $this->dom->createElement( 'path' ); $arc->setAttribute( 'd', sprintf( 'M %.2F,%.2F A %.2F,%.2F 0 %d,0 %.2F,%.2F L %.2F,%.2F A %.2F,%2F 0 %d,1 %.2F,%.2F z', // Endpoint low $Xend, $Yend + $size, // Radius $width, $height, // SVG-Stuff ( $endAngle - $startAngle ) > 180, // Startpoint low $Xstart, $Ystart + $size, // Startpoint $Xstart, $Ystart, // Radius $width, $height, // SVG-Stuff ( $endAngle - $startAngle ) > 180, // Endpoint $Xend, $Yend ) ); } else { $arc = $this->dom->createElement( 'path' ); $arc->setAttribute( 'd', sprintf( 'M %.2F,%.2F A %.2F,%.2F 0 %d,1 %.2F,%.2F', // Startpoint $Xstart, $Ystart, // Radius $width, $height, // SVG-Stuff ( $endAngle - $startAngle ) > 180, // Endpoint $Xend, $Yend ) ); } $arc->setAttribute( 'style', $this->getStyle( $color, $filled ) ); $arc->setAttribute( 'id', $id = ( $this->options->idPrefix . 'CircularArc_' . ++$this->elementID ) ); $this->elements->appendChild( $arc ); if ( ( $this->options->shadeCircularArc !== false ) && $filled ) { $gradient = new ezcGraphLinearGradient( new ezcGraphCoordinate( $center->x - $width, $center->y ), new ezcGraphCoordinate( $center->x + $width, $center->y ), ezcGraphColor::fromHex( '#FFFFFF' )->transparent( $this->options->shadeCircularArc * 1.5 ), ezcGraphColor::fromHex( '#000000' )->transparent( $this->options->shadeCircularArc ) ); $arc = $this->dom->createElement( 'path' ); $arc->setAttribute( 'd', sprintf( 'M %.2F,%.2F A %.2F,%.2F 0 %d,0 %.2F,%.2F L %.2F,%.2F A %.2F,%2F 0 %d,1 %.2F,%.2F z', // Endpoint low $Xend, $Yend + $size, // Radius $width, $height, // SVG-Stuff ( $endAngle - $startAngle ) > 180, // Startpoint low $Xstart, $Ystart + $size, // Startpoint $Xstart, $Ystart, // Radius $width, $height, // SVG-Stuff ( $endAngle - $startAngle ) > 180, // Endpoint $Xend, $Yend ) ); $arc->setAttribute( 'style', $this->getStyle( $gradient, $filled ) ); $arc->setAttribute( 'id', $id = ( $this->options->idPrefix . 'CircularArc_' . ++$this->elementID ) ); $this->elements->appendChild( $arc ); } return $id; } /** * Draw circle * * @param ezcGraphCoordinate $center Center of ellipse * @param mixed $width Width of ellipse * @param mixed $height height of ellipse * @param ezcGraphColor $color Color * @param mixed $filled Filled * @return void */ public function drawCircle( ezcGraphCoordinate $center, $width, $height, ezcGraphColor $color, $filled = true ) { $this->createDocument(); $ellipse = $this->dom->createElement( 'ellipse' ); $ellipse->setAttribute( 'cx', sprintf( '%.4F', $center->x + $this->options->graphOffset->x ) ); $ellipse->setAttribute( 'cy', sprintf( '%.4F', $center->y + $this->options->graphOffset->y ) ); $ellipse->setAttribute( 'rx', sprintf( '%.4F', $width / 2 - ( $filled ? 0 : .5 ) ) ); $ellipse->setAttribute( 'ry', sprintf( '%.4F', $height / 2 - ( $filled ? 0 : .5 ) ) ); $ellipse->setAttribute( 'style', $this->getStyle( $color, $filled, 1 ) ); $ellipse->setAttribute( 'id', $id = ( $this->options->idPrefix . 'Circle_' . ++$this->elementID ) ); $this->elements->appendChild( $ellipse ); return $id; } /** * Draw an image * * The image will be inlined in the SVG document using data URL scheme. For * this the mime type and base64 encoded file content will be merged to * URL. * * @param mixed $file Image file * @param ezcGraphCoordinate $position Top left position * @param mixed $width Width of image in destination image * @param mixed $height Height of image in destination image * @return void */ public function drawImage( $file, ezcGraphCoordinate $position, $width, $height ) { $this->createDocument(); $data = getimagesize( $file ); $image = $this->dom->createElement( 'image' ); $image->setAttribute( 'x', sprintf( '%.4F', $position->x + $this->options->graphOffset->x ) ); $image->setAttribute( 'y', sprintf( '%.4F', $position->y + $this->options->graphOffset->y ) ); $image->setAttribute( 'width', sprintf( '%.4Fpx', $width ) ); $image->setAttribute( 'height', sprintf( '%.4Fpx', $height ) ); $image->setAttributeNS( 'http://www.w3.org/1999/xlink', 'xlink:href', sprintf( 'data:%s;base64,%s', $data['mime'], base64_encode( file_get_contents( $file ) ) ) ); $this->elements->appendChild( $image ); $image->setAttribute( 'id', $id = ( $this->options->idPrefix . 'Image_' . ++$this->elementID ) ); return $id; } /** * Return mime type for current image format * * @return string */ public function getMimeType() { return 'image/svg+xml'; } /** * Render image directly to output * * The method renders the image directly to the standard output. You * normally do not want to use this function, because it makes it harder * to proper cache the generated graphs. * * @return void */ public function renderToOutput() { $this->createDocument(); $this->drawAllTexts(); header( 'Content-Type: ' . $this->getMimeType() ); echo $this->dom->saveXML(); } /** * Finally save image * * @param string $file Destination filename * @return void */ public function render( $file ) { $this->createDocument(); $this->drawAllTexts(); // Embed used glyphs $this->font->addFontToDocument( $this->dom ); $this->dom->save( $file ); } /** * Get resource of rendered result * * Return the resource of the rendered result. You should not use this * method before you called either renderToOutput() or render(), as the * image may not be completely rendered until then. * * @return DOMDocument */ public function getResource() { return $this->dom; } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/driver/svg_font.php000066400000000000000000000205371226600447100246030ustar00rootroot00000000000000`. * * Usage: * * $font = new ezcGraphSvgFont(); * var_dump( * $font->calculateStringWidth( '../tests/data/font.svg', 'Just a test string.' ), * $font->calculateStringWidth( '../tests/data/font2.svg', 'Just a test string.' ) * ); * * * @version 1.5 * @package Graph * @mainclass */ class ezcGraphSvgFont { /** * Units per EM * * @var float */ protected $unitsPerEm; /** * Used glyphs * * @var array */ protected $usedGlyphs = array(); /** * Cache for glyph size to save XPath lookups. * * @var array */ protected $glyphCache = array(); /** * Used kernings * * @var array */ protected $usedKerns = array(); /** * Path to font * * @var string */ protected $fonts = array(); /** * Initialize SVG font * * Loads the SVG font $filename. This should be the path to the file * generated by ttf2svg. * * Returns the (normlized) name of the initilized font. * * @param string $fontPath * @return string */ protected function initializeFont( $fontPath ) { if ( isset( $this->fonts[$fontPath] ) ) { return $fontPath; } // Check for existance of font file if ( !is_file( $fontPath ) || !is_readable( $fontPath ) ) { throw new ezcBaseFileNotFoundException( $fontPath ); } $this->fonts[$fontPath] = simplexml_load_file( $fontPath )->defs->font; // SimpleXML requires us to register a namespace for XPath to work $this->fonts[$fontPath]->registerXPathNamespace( 'svg', 'http://www.w3.org/2000/svg' ); // Extract the number of units per Em $this->unitsPerEm[$fontPath] = (int) $this->fonts[$fontPath]->{'font-face'}['units-per-em']; return $fontPath; } /** * Get name of font * * Get the name of the given font, by extracting its font family from the * SVG font file. * * @param string $fontPath * @return string */ public static function getFontName( $fontPath ) { $font = simplexml_load_file( $fontPath )->defs->font; // SimpleXML requires us to register a namespace for XPath to work $font->registerXPathNamespace( 'svg', 'http://www.w3.org/2000/svg' ); // Extract the font family name return (string) $font->{'font-face'}['font-family']; } /** * XPath has no standard means of escaping ' and ", with the only solution * being to delimit your string with the opposite type of quote. ( And if * your string contains both concat( ) it ). * * This method will correctly delimit $char with the appropriate quote type * so that it can be used in an XPath expression. * * @param string $char * @return string */ protected static function xpathEscape( $char ) { return "'" . str_replace( array( '\'', '\\' ), array( '\\\'', '\\\\' ), $char ) . "'"; } /** * Returns the associated with $char. * * @param string $fontPath * @param string $char * @return float */ protected function getGlyph( $fontPath, $char ) { // Check if glyphwidth has already been calculated. if ( isset( $this->glyphCache[$fontPath][$char] ) ) { return $this->glyphCache[$fontPath][$char]; } $matches = $this->fonts[$fontPath]->xpath( $query = "glyph[@unicode=" . self::xpathEscape( $char ) . "]" ); if ( count( $matches ) === 0 ) { // Just ignore missing glyphs. The client will still render them // using a default font. We try to estimate some width by using a // common other character. return $this->glyphCache[$fontPath][$char] = ( $char === 'o' ? false : $this->getGlyph( $fontPath, 'o' ) ); } $glyph = $matches[0]; if ( !in_array( $glyph, $this->usedGlyphs ) ) { $this->usedGlyphs[$fontPath][] = $glyph; } // There should only ever be one match return $this->glyphCache[$fontPath][$char] = $glyph; } /** * Returns the amount of kerning to apply for glyphs $g1 and $g2. If no * valid kerning pair can be found 0 is returned. * * @param string $fontPath * @param SimpleXMLElement $g1 * @param SimpleXMLElement $g2 * @return int */ public function getKerning( $fontPath, SimpleXMLElement $glyph1, SimpleXMLElement $glyph2 ) { // Get the glyph names $g1Name = self::xpathEscape( ( string ) $glyph1['glyph-name'] ); $g2Name = self::xpathEscape( ( string ) $glyph2['glyph-name'] ); // Get the unicode character names $g1Uni = self::xpathEscape( ( string ) $glyph1['unicode'] ); $g2Uni = self::xpathEscape( ( string ) $glyph2['unicode'] ); // Search for kerning pairs $pair = $this->fonts[$fontPath]->xpath( "svg:hkern[( @g1=$g1Name and @g2=$g2Name ) or ( @u1=$g1Uni and @g2=$g2Uni )]" ); // If we found anything return it if ( count( $pair ) ) { if ( !in_array( $pair[0], $this->usedKerns ) ) { $this->usedKerns[$fontPath][] = $pair[0]; } return ( int ) $pair[0]['k']; } else { return 0; } } /** * Calculates the width of $string in the current font in Em's. * * @param string $fontPath * @param string $string * @return float */ public function calculateStringWidth( $fontPath, $string ) { // Ensure font is properly initilized $fontPath = $this->initializeFont( $fontPath ); $strlen = strlen( $string ); $prevCharInfo = null; $length = 0; // @TODO: Add UTF-8 support here - iterating over the bytes does not // really help. for ( $i = 0; $i < $strlen; ++$i ) { // Find the font information for the character $charInfo = $this->getGlyph( $fontPath, $string[$i] ); // Handle missing glyphs if ( $charInfo === false ) { $prevCharInfo = null; $length += .5 * $this->unitsPerEm[$fontPath]; continue; } // Add the horizontal advance for the character to the length $length += (float) $charInfo['horiz-adv-x']; // If we are not the first character, look for kerning pairs if ( $prevCharInfo !== null ) { // Apply kerning (if any) $length -= $this->getKerning( $fontPath, $prevCharInfo, $charInfo ); } $prevCharInfo = clone $charInfo; } // Divide by _unitsPerEm to get the length in Em return (float) $length / $this->unitsPerEm[$fontPath]; } /** * Add font definitions to SVG document * * Add the SVG font definition paths for all used glyphs and kernings to * the given SVG document. * * @param DOMDocument $document * @return void */ public function addFontToDocument( DOMDocument $document ) { $defs = $document->getElementsByTagName( 'defs' )->item( 0 ); $fontNr = 0; foreach ( $this->fonts as $path => $definition ) { // Just import complete font for now. // @TODO: Only import used characters. $font = dom_import_simplexml( $definition ); $font = $document->importNode( $font, true ); $font->setAttribute( 'id', 'Font' . ++$fontNr ); $defs->appendChild( $font ); } } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/driver/verbose.php000066400000000000000000000144041226600447100244170ustar00rootroot00000000000000options = new ezcGraphSvgDriverOptions( $options ); echo "\n"; } /** * Draws a single polygon * * @param array $points * @param ezcGraphColor $color * @param bool $filled * @param float $thickness * @return void */ public function drawPolygon( array $points, ezcGraphColor $color, $filled = true, $thickness = 1. ) { $pointString = ''; foreach ( $points as $point ) { $pointString .= sprintf( "\t( %.2f, %.2f )\n", $point->x, $point->y ); } printf( "% 4d: Draw %spolygon:\n%s", $this->call++, ( $filled ? 'filled ' : '' ), $pointString ); } /** * Draws a single line * * @param ezcGraphCoordinate $start * @param ezcGraphCoordinate $end * @param ezcGraphColor $color * @param float $thickness * @return void */ public function drawLine( ezcGraphCoordinate $start, ezcGraphCoordinate $end, ezcGraphColor $color, $thickness = 1. ) { printf( "% 4d: Draw line from ( %.2f, %.2f ) to ( %.2f, %.2f ) with thickness %d.\n", $this->call++, $start->x, $start->y, $end->x, $end->y, $thickness ); } /** * Returns boundings of text depending on the available font extension * * @param float $size Textsize * @param ezcGraphFontOptions $font Font * @param string $text Text * @return ezcGraphBoundings Boundings of text */ protected function getTextBoundings( $size, ezcGraphFontOptions $font, $text ) { return null; } /** * Wrties text in a box of desired size * * @param mixed $string * @param ezcGraphCoordinate $position * @param mixed $width * @param mixed $height * @param int $align * @param ezcGraphRotation $rotation * @return void */ public function drawTextBox( $string, ezcGraphCoordinate $position, $width, $height, $align, ezcGraphRotation $rotation = null ) { printf( "% 4d: Draw text '%s' at ( %.2f, %.2f ) with dimensions ( %d, %d ) and alignement %d.\n", $this->call++, $string, $position->x, $position->y, $width, $height, $align ); } /** * Draws a sector of cirlce * * @param ezcGraphCoordinate $center * @param mixed $width * @param mixed $height * @param mixed $startAngle * @param mixed $endAngle * @param ezcGraphColor $color * @param bool $filled * @return void */ public function drawCircleSector( ezcGraphCoordinate $center, $width, $height, $startAngle, $endAngle, ezcGraphColor $color, $filled = true ) { printf( "% 4d: Draw %scicle sector at ( %.2f, %.2f ) with dimensions ( %d, %d ) from %.2f to %.2f.\n", $this->call++, ( $filled ? 'filled ' : '' ), $center->x, $center->y, $width, $height, $startAngle, $endAngle ); } /** * Draws a circular arc * * @param ezcGraphCoordinate $center Center of ellipse * @param integer $width Width of ellipse * @param integer $height Height of ellipse * @param integer $size Height of border * @param float $startAngle Starting angle of circle sector * @param float $endAngle Ending angle of circle sector * @param ezcGraphColor $color Color of Border * @param bool $filled * @return void */ public function drawCircularArc( ezcGraphCoordinate $center, $width, $height, $size, $startAngle, $endAngle, ezcGraphColor $color, $filled = true ) { printf( "% 4d: Draw circular arc at ( %.2f, %.2f ) with dimensions ( %d, %d ) and size %.2f from %.2f to %.2f.\n", $this->call++, $center->x, $center->y, $width, $height, $size, $startAngle, $endAngle ); } /** * Draws a circle * * @param ezcGraphCoordinate $center * @param mixed $width * @param mixed $height * @param ezcGraphColor $color * @param bool $filled * * @return void */ public function drawCircle( ezcGraphCoordinate $center, $width, $height, ezcGraphColor $color, $filled = true ) { printf( "% 4d: Draw %scircle at ( %.2f, %.2f ) with dimensions ( %d, %d ).\n", $this->call++, ( $filled ? 'filled ' : '' ), $center->x, $center->y, $width, $height ); } /** * Draws a imagemap of desired size * * @param mixed $file * @param ezcGraphCoordinate $position * @param mixed $width * @param mixed $height * @return void */ public function drawImage( $file, ezcGraphCoordinate $position, $width, $height ) { printf( "% 4d: Draw image '%s' at ( %.2f, %.2f ) with dimensions ( %d, %d ).\n", $this->call++, $file, $position->x, $position->y, $width, $height ); } /** * Return mime type for current image format * * @return string */ public function getMimeType() { return 'text/plain'; } /** * Finally save image * * @param mixed $file * @return void */ public function render ( $file ) { printf( "Render image.\n" ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/element/000077500000000000000000000000001226600447100223745ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/element/axis.php000066400000000000000000000462551226600447100240650ustar00rootroot00000000000000 * $chart->xAxis->formatString = '%s %%'; * * * For more complex formatting operations for the label you may assign a custom * formatter function to the property $labelCallback. * * The orientation of labels and their position relatively to the axis ticks is * calcualted and rendered by the ezcGraphAxisLabelRenderer classes. You can * choose between different axis label renderer, or create you own, and assign * an instance of one to the property $axisLabelRenderer. Currently the * available axis label renderers are: * * - ezcGraphAxisBoxedLabelRenderer * * Renders grid and labels like commonly used in bar charts, with the label * between two grid lines. * * - ezcGraphAxisCenteredLabelRenderer * * Centers the label right next to a tick. Commonly used for labeled axis. * * - ezcGraphAxisExactLabelRenderer * * Put the label next to each tick. Commonly used for numeric axis. * * - ezcGraphAxisNoLabelRenderer * * Renders no labels. * * - ezcGraphAxisRadarLabelRenderer * * Special label renderer for radar charts. * * - ezcGraphAxisRotatedLabelRenderer * * Accepts a rotation angle for the texts put at some axis, which might be * useful for longer textual labels on the axis. * * The label renderer used by default is different depending on the axis type. * * @property float $nullPosition * The position of the null value. * @property float $axisSpace * Percent of the chart space used to display axis labels and * arrowheads instead of data values. * @property float $outerAxisSpace * Percent of the chart space used to display axis arrow at the outer * side of the axis. If set to null, the axisSpace will be used here. * @property ezcGraphColor $majorGrid * Color of major majorGrid. * @property ezcGraphColor $minorGrid * Color of minor majorGrid. * @property mixed $majorStep * Labeled major steps displayed on the axis. @TODO: Should be moved * to numeric axis. * @property mixed $minorStep * Non labeled minor steps on the axis. @TODO: Should be moved to * numeric axis. * @property string $formatString * Formatstring to use for labeling of the axis. * @property string $label * Axis label * @property int $labelSize * Size of axis label * @property int $labelMargin * Distance between label an axis * @property int $minArrowHeadSize * Minimum Size used to draw arrow heads. * @property int $maxArrowHeadSize * Maximum Size used to draw arrow heads. * @property ezcGraphAxisLabelRenderer $axisLabelRenderer * AxisLabelRenderer used to render labels and grid on this axis. * @property callback $labelCallback * Callback function to format chart labels. * Function will receive two parameters and should return a * reformatted label. * string function( label, step ) * @property float $chartPosition * Position of the axis in the chart. Only useful for additional * axis. The basic chart axis will be automatically positioned. * @property-read bool $initialized * Property indicating if some values were associated with axis, or a * scaling has been set manually. * @property float $labelRotation * Rotation of the axis label in degree * * @version 1.5 * @package Graph */ abstract class ezcGraphChartElementAxis extends ezcGraphChartElement { /** * Axis label renderer class * * @var ezcGraphAxisLabelRenderer */ protected $axisLabelRenderer; /** * Optionally set inner boundings. May be null depending on the used chart * implementation. * * @var ezcGraphBoundings */ protected $innerBoundings; /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->properties['nullPosition'] = false; $this->properties['axisSpace'] = .1; $this->properties['outerAxisSpace'] = null; $this->properties['majorGrid'] = false; $this->properties['minorGrid'] = false; $this->properties['majorStep'] = null; $this->properties['minorStep'] = null; $this->properties['formatString'] = '%s'; $this->properties['label'] = false; $this->properties['labelSize'] = 14; $this->properties['labelMargin'] = 2; $this->properties['minArrowHeadSize'] = 4; $this->properties['maxArrowHeadSize'] = 8; $this->properties['labelCallback'] = null; $this->properties['chartPosition'] = null; $this->properties['initialized'] = false; $this->properties['labelRotation'] = 0.; parent::__construct( $options ); if ( !isset( $this->axisLabelRenderer ) ) { $this->axisLabelRenderer = new ezcGraphAxisExactLabelRenderer(); } } /** * Set colors and border fro this element * * @param ezcGraphPalette $palette Palette * @return void */ public function setFromPalette( ezcGraphPalette $palette ) { $this->border = $palette->axisColor; $this->padding = $palette->padding; $this->margin = $palette->margin; $this->majorGrid = $palette->majorGridColor; $this->minorGrid = $palette->minorGridColor; } /** * __set * * @param mixed $propertyName * @param mixed $propertyValue * @throws ezcBaseValueException * If a submitted parameter was out of range or type. * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return void */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'nullPosition': $this->properties['nullPosition'] = (float) $propertyValue; break; case 'axisSpace': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) || ( $propertyValue >= 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, '0 <= float < 1' ); } $this->properties['axisSpace'] = (float) $propertyValue; break; case 'outerAxisSpace': if ( !is_null( $propertyValue ) && ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) || ( $propertyValue >= 1 ) ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'null, or 0 <= float < 1' ); } $this->properties['outerAxisSpace'] = $propertyValue; break; case 'majorGrid': $this->properties['majorGrid'] = ezcGraphColor::create( $propertyValue ); break; case 'minorGrid': $this->properties['minorGrid'] = ezcGraphColor::create( $propertyValue ); break; case 'majorStep': if ( !is_numeric( $propertyValue ) || ( $propertyValue <= 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'float > 0' ); } $this->properties['majorStep'] = (float) $propertyValue; break; case 'minorStep': if ( !is_numeric( $propertyValue ) || ( $propertyValue <= 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'float > 0' ); } $this->properties['minorStep'] = (float) $propertyValue; break; case 'formatString': $this->properties['formatString'] = (string) $propertyValue; break; case 'label': $this->properties['label'] = (string) $propertyValue; break; case 'labelSize': if ( !is_numeric( $propertyValue ) || ( $propertyValue <= 6 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 6' ); } $this->properties['labelSize'] = (int) $propertyValue; break; case 'labelMargin': if ( !is_numeric( $propertyValue ) || ( $propertyValue <= 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 0' ); } $this->properties['labelMargin'] = (int) $propertyValue; break; case 'maxArrowHeadSize': if ( !is_numeric( $propertyValue ) || ( $propertyValue <= 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 0' ); } $this->properties['maxArrowHeadSize'] = (int) $propertyValue; break; case 'minArrowHeadSize': if ( !is_numeric( $propertyValue ) || ( $propertyValue <= 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 0' ); } $this->properties['minArrowHeadSize'] = (int) $propertyValue; break; case 'axisLabelRenderer': if ( $propertyValue instanceof ezcGraphAxisLabelRenderer ) { $this->axisLabelRenderer = $propertyValue; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphAxisLabelRenderer' ); } break; case 'labelCallback': if ( is_callable( $propertyValue ) ) { $this->properties['labelCallback'] = $propertyValue; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, 'callback function' ); } break; case 'chartPosition': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) || ( $propertyValue > 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, '0 <= float <= 1' ); } $this->properties['chartPosition'] = (float) $propertyValue; break; case 'labelRotation': if ( !is_numeric( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'float' ); } $this->properties['labelRotation'] = fmod( (float) $propertyValue, 360. ); break; default: parent::__set( $propertyName, $propertyValue ); break; } } /** * __get * * @param mixed $propertyName * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return mixed * @ignore */ public function __get( $propertyName ) { switch ( $propertyName ) { case 'axisLabelRenderer': return $this->axisLabelRenderer; default: return parent::__get( $propertyName ); } } /** * Get coordinate for a dedicated value on the chart * * @param float $value Value to determine position for * @return float Position on chart */ abstract public function getCoordinate( $value ); /** * Return count of minor steps * * @return integer Count of minor steps */ abstract public function getMinorStepCount(); /** * Return count of major steps * * @return integer Count of major steps */ abstract public function getMajorStepCount(); /** * Get label for a dedicated step on the axis * * @param integer $step Number of step * @return string label */ abstract public function getLabel( $step ); /** * Return array of steps on this axis * * @return array( ezcGraphAxisStep ) */ public function getSteps() { $majorSteps = $this->getMajorStepCount(); $minorStepsPerMajorStepCount = ( $this->getMinorStepCount() / $majorSteps ); $majorStepSize = 1 / $majorSteps; $minorStepSize = ( $minorStepsPerMajorStepCount > 0 ? $majorStepSize / $minorStepsPerMajorStepCount : 0 ); $steps = array(); for ( $major = 0; $major <= $majorSteps; ++$major ) { $majorStep = new ezcGraphAxisStep( $majorStepSize * $major, $majorStepSize, $this->getLabel( $major ), array(), $this->isZeroStep( $major ), ( $major === $majorSteps ) ); if ( ( $minorStepsPerMajorStepCount > 0 ) && ( $major < $majorSteps ) ) { // Do not add minor steps at major steps positions for( $minor = 1; $minor < $minorStepsPerMajorStepCount; ++$minor ) { $majorStep->childs[] = new ezcGraphAxisStep( ( $majorStepSize * $major ) + ( $minorStepSize * $minor ), $minorStepSize ); } } $steps[] = $majorStep; } return $steps; } /** * Is zero step * * Returns true if the given step is the one on the initial axis position * * @param int $step Number of step * @return bool Status If given step is initial axis position */ abstract public function isZeroStep( $step ); /** * Add data for this axis * * @param array $values * @return void */ abstract public function addData( array $values ); /** * Calculate axis bounding values on base of the assigned values * * @abstract * @access public * @return void */ abstract public function calculateAxisBoundings(); /** * Render the axis * * @param ezcGraphRenderer $renderer Renderer * @param ezcGraphBoundings $boundings Boundings for the axis * @return ezcGraphBoundings Remaining boundings */ public function render( ezcGraphRenderer $renderer, ezcGraphBoundings $boundings, ezcGraphBoundings $innerBoundings = null ) { $this->innerBoundings = $innerBoundings; $startSpace = $this->axisSpace; $endSpace = $this->outerAxisSpace === null ? $this->axisSpace : $this->outerAxisSpace; switch ( $this->position ) { case ezcGraph::TOP: $start = new ezcGraphCoordinate( $boundings->width * $startSpace + $this->nullPosition * $boundings->width * ( 1 - ( $startSpace + $endSpace ) ), 0 ); $end = new ezcGraphCoordinate( $boundings->width * $startSpace + $this->nullPosition * $boundings->width * ( 1 - ( $startSpace + $endSpace ) ), $boundings->height ); break; case ezcGraph::BOTTOM: $start = new ezcGraphCoordinate( $boundings->width * $startSpace + $this->nullPosition * $boundings->width * ( 1 - ( $startSpace + $endSpace ) ), $boundings->height ); $end = new ezcGraphCoordinate( $boundings->width * $startSpace + $this->nullPosition * $boundings->width * ( 1 - ( $startSpace + $endSpace ) ), 0 ); break; case ezcGraph::LEFT: $start = new ezcGraphCoordinate( 0, $boundings->height * $endSpace + $this->nullPosition * $boundings->height * ( 1 - ( $startSpace + $endSpace ) ) ); $end = new ezcGraphCoordinate( $boundings->width, $boundings->height * $endSpace + $this->nullPosition * $boundings->height * ( 1 - ( $startSpace + $endSpace ) ) ); break; case ezcGraph::RIGHT: $start = new ezcGraphCoordinate( $boundings->width, $boundings->height * $endSpace + $this->nullPosition * $boundings->height * ( 1 - ( $startSpace + $endSpace ) ) ); $end = new ezcGraphCoordinate( 0, $boundings->height * $endSpace + $this->nullPosition * $boundings->height * ( 1 - ( $startSpace + $endSpace ) ) ); break; } $renderer->drawAxis( $boundings, $start, $end, $this, $this->axisLabelRenderer, $innerBoundings ); return $boundings; } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/element/background.php000066400000000000000000000156171226600447100252360ustar00rootroot00000000000000 * $chart = new ezcGraphPieChart(); * $chart->data['example'] = new ezcGraphArrayDataSet( array( * 'Foo' => 23, * 'Bar' => 42, * ) ); * * $chart->background->image = 'background.png'; * * // Image would be repeated horizontal at the top of the background * $chart->background->repeat = ezcGraph::HORIZONTAL; * $chart->background->postion = ezcGraph::TOP; * * // Image would be placed once in the center * $chart->background->repeat = ezcGraph::NO_REPEAT; // default; * $chart->background->position = ezcGraph::CENTER | ezcGraph::MIDDLE; * * // Image would be repeated all over the chart, the position is irrelevant * $chart->background->repeat = ezcGraph::HORIZONTAL | ezcGraph::VERTICAL; * * $graph->render( 400, 250, 'legend.svg' ); * * * @property string $image * Filename of the file to use for background * @property int $repeat * Defines how the background image gets repeated * * @version 1.5 * @package Graph * @mainclass */ class ezcGraphChartElementBackground extends ezcGraphChartElement { /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->properties['image'] = false; $this->properties['repeat'] = ezcGraph::NO_REPEAT; parent::__construct( $options ); } /** * __set * * @param mixed $propertyName * @param mixed $propertyValue * @throws ezcBaseValueException * If a submitted parameter was out of range or type. * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return void * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'image': // Check for existance of file if ( !is_file( $propertyValue ) || !is_readable( $propertyValue ) ) { throw new ezcBaseFileNotFoundException( $propertyValue ); } // Check for beeing an image file $data = getImageSize( $propertyValue ); if ( $data === false ) { throw new ezcGraphInvalidImageFileException( $propertyValue ); } // SWF files are useless.. if ( $data[2] === 4 ) { throw new ezcGraphInvalidImageFileException( 'We cant use SWF files like <' . $propertyValue . '>.' ); } $this->properties['image'] = $propertyValue; break; case 'repeat': if ( ( $propertyValue >= 0 ) && ( $propertyValue <= 3 ) ) { $this->properties['repeat'] = (int) $propertyValue; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, '0 <= int <= 3' ); } break; case 'position': // Overwrite parent position setter, to be able to use // combination of positions like // ezcGraph::TOP | ezcGraph::CENTER if ( is_int( $propertyValue ) ) { $this->properties['position'] = $propertyValue; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, 'integer' ); } break; case 'color': // Use color as an alias to set background color for background $this->__set( 'background', $propertyValue ); break; default: return parent::__set( $propertyName, $propertyValue ); } } /** * __get * * @param mixed $propertyName * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return mixed * @ignore */ public function __get( $propertyName ) { switch ( $propertyName ) { case 'color': // Use color as an alias to set background color for background return $this->properties['background']; default: return parent::__get( $propertyName ); } } /** * Set colors and border for this element * * Method is overwritten because we do not ant to apply the global padding * and margin here. * * @param ezcGraphPalette $palette Palette * @return void */ public function setFromPalette( ezcGraphPalette $palette ) { $this->border = $palette->chartBorderColor; $this->borderWidth = $palette->chartBorderWidth; $this->background = $palette->chartBackground; $this->padding = 0; $this->margin = 0; } /** * Render the background * * @param ezcGraphRenderer $renderer Renderer * @param ezcGraphBoundings $boundings Boundings * @return ezcGraphBoundings Remaining boundings */ public function render( ezcGraphRenderer $renderer, ezcGraphBoundings $boundings ) { $boundings = $renderer->drawBox( $boundings, $this->background, $this->border, $this->borderWidth, $this->margin, $this->padding ); if ( $this->image === false ) { return $boundings; } $renderer->drawBackgroundImage( $boundings, $this->image, $this->position, $this->repeat ); return $boundings; } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/element/legend.php000066400000000000000000000255301226600447100243500ustar00rootroot00000000000000 * $chart->legend = false; * * * The position of the legend in the chart can be influenced by the postion * property, set to one of the position constants from the ezcGraph base class, * like ezcGraph::BOTTOM, ezcGraph::LEFT, ezcGraph::RIGHT, ezcGraph::TOP. * * Depending on the position of the legend, either the $portraitSize (RIGHT, * LEFT) or the $landscapeSize (TOP, BOTTOM) defines how much space will be * aqquired for the legend. * * * $graph = new ezcGraphPieChart(); * $graph->data['example'] = new ezcGraphArrayDataSet( array( * 'Foo' => 23, * 'Bar' => 42, * ) ); * * // Format the legend element * $graph->legend->background = '#FFFFFF80'; * * // Place at the bottom of the chart, with a height of 5% of the remaining * // chart space. * $graph->legend->position = ezcGraph::BOTTOM; * $graph->legend->landscapeSize = .05; * * $graph->render( 400, 250, 'legend.svg' ); * * * @property float $portraitSize * Size of a portrait style legend in percent of the size of the * complete chart. * @property float $landscapeSize * Size of a landscape style legend in percent of the size of the * complete chart. * @property int $symbolSize * Standard size of symbols and text in legends. * @property float $minimumSymbolSize * Scale symbol size up to to percent of complete legends size for * very big legends. * @property int $spacing * Space between labels elements in pixel. * * @version 1.5 * @package Graph * @mainclass */ class ezcGraphChartElementLegend extends ezcGraphChartElement { /** * Contains data which should be shown in the legend * array( * array( * 'label' => (string) 'Label of data element', * 'color' => (ezcGraphColor) $color, * 'symbol' => (integer) ezcGraph::DIAMOND, * ), * ... * ) * * @var array */ protected $labels; /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->properties['portraitSize'] = .2; $this->properties['landscapeSize'] = .1; $this->properties['symbolSize'] = 14; $this->properties['padding'] = 1; $this->properties['minimumSymbolSize'] = .05; $this->properties['spacing'] = 2; parent::__construct( $options ); } /** * __set * * @param mixed $propertyName * @param mixed $propertyValue * @throws ezcBaseValueException * If a submitted parameter was out of range or type. * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return void * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'padding': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 0' ); } $this->properties['padding'] = (int) $propertyValue; break; case 'symbolSize': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 1' ); } $this->properties['symbolSize'] = (int) $propertyValue; break; case 'landscapeSize': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) || ( $propertyValue > 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, '0 <= int <= 1' ); } $this->properties['landscapeSize'] = (float) $propertyValue; break; case 'portraitSize': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) || ( $propertyValue > 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, '0 <= int <= 1' ); } $this->properties['portraitSize'] = (float) $propertyValue; break; case 'minimumSymbolSize': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) || ( $propertyValue > 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, '0 <= int <= 1' ); } $this->properties['minimumSymbolSize'] = (float) $propertyValue; break; case 'spacing': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 0' ); } $this->properties['spacing'] = (int) $propertyValue; break; default: parent::__set( $propertyName, $propertyValue ); break; } } /** * __get * * @param mixed $propertyName * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return mixed * @ignore */ public function __get( $propertyName ) { switch ( $propertyName ) { case 'labels': return $this->labels; default: return parent::__get( $propertyName ); } } /** * Generate legend from several datasets with on entry per dataset * * @param ezcGraphChartDataContainer $datasets * @return void */ public function generateFromDataSets( ezcGraphChartDataContainer $datasets ) { $this->labels = array(); foreach ( $datasets as $dataset ) { $this->labels[] = array( 'label' => $dataset->label->default, 'url' => $dataset->url->default, 'color' => $dataset->color->default, 'symbol' => ( $dataset->symbol->default === null ? ezcGraph::NO_SYMBOL : $dataset->symbol->default ), ); } } /** * Generate legend from single dataset with on entry per data element * * @param ezcGraphDataSet $dataset * @return void */ public function generateFromDataSet( ezcGraphDataSet $dataset ) { $this->labels = array(); foreach ( $dataset as $label => $data ) { $this->labels[] = array( 'label' => $label, 'url' => $dataset->url[$label], 'color' => $dataset->color[$label], 'symbol' => ( $dataset->symbol[$label] === null ? ezcGraph::NO_SYMBOL : $dataset->symbol[$label] ), ); } } /** * Calculated boundings needed for the legend. * * Uses the position and the configured horizontal or vertical size of a * legend to calculate the boundings for the legend. * * @param ezcGraphBoundings $boundings Avalable boundings * @return ezcGraphBoundings Remaining boundings */ protected function calculateBoundings( ezcGraphBoundings $boundings ) { $this->properties['boundings'] = clone $boundings; switch ( $this->position ) { case ezcGraph::LEFT: $size = ( $boundings->width ) * $this->portraitSize; $boundings->x0 += $size; $this->boundings->x1 = $boundings->x0; break; case ezcGraph::RIGHT: $size = ( $boundings->width ) * $this->portraitSize; $boundings->x1 -= $size; $this->boundings->x0 = $boundings->x1; break; case ezcGraph::TOP: $size = ( $boundings->height ) * $this->landscapeSize; $boundings->y0 += $size; $this->boundings->y1 = $boundings->y0; break; case ezcGraph::BOTTOM: $size = ( $boundings->height ) * $this->landscapeSize; $boundings->y1 -= $size; $this->boundings->y0 = $boundings->y1; break; } return $boundings; } /** * Render a legend * * @param ezcGraphRenderer $renderer Renderer * @param ezcGraphBoundings $boundings Boundings for the axis * @return ezcGraphBoundings Remaining boundings */ public function render( ezcGraphRenderer $renderer, ezcGraphBoundings $boundings ) { $boundings = $this->calculateBoundings( $boundings ); if ( $this->position === ezcGraph::LEFT || $this->position === ezcGraph::RIGHT ) { $type = ezcGraph::VERTICAL; } else { $type = ezcGraph::HORIZONTAL; } // Render standard elements $this->properties['boundings'] = $renderer->drawBox( $this->properties['boundings'], $this->properties['background'], $this->properties['border'], $this->properties['borderWidth'], $this->properties['margin'], $this->properties['padding'], $this->properties['title'], $this->getTitleSize( $this->properties['boundings'], $type ) ); // Render legend $renderer->drawLegend( $this->boundings, $this, $type ); return $boundings; } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/element/text.php000066400000000000000000000111631226600447100240730ustar00rootroot00000000000000 * $chart = new ezcGraphPieChart(); * $chart->data['example'] = new ezcGraphArrayDataSet( array( * 'Foo' => 23, * 'Bar' => 42, * ) ); * * $chart->title = 'Some pie chart'; * * // Use at maximum 5% of the chart height for the title. * $chart->title->maxHeight = .05; * * $graph->render( 400, 250, 'title.svg' ); * * * @property float $maxHeight * Maximum percent of bounding used to display the text. * * @version 1.5 * @package Graph * @mainclass */ class ezcGraphChartElementText extends ezcGraphChartElement { /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->properties['maxHeight'] = .1; parent::__construct( $options ); } /** * __set * * @param mixed $propertyName * @param mixed $propertyValue * @throws ezcBaseValueException * If a submitted parameter was out of range or type. * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return void */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'maxHeight': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) || ( $propertyValue > 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, '0 <= float <= 1' ); } $this->properties['maxHeight'] = (float) $propertyValue; break; default: parent::__set( $propertyName, $propertyValue ); break; } } /** * Render the text * * @param ezcGraphRenderer $renderer Renderer * @param ezcGraphBoundings $boundings Boundings for the axis * @return ezcGraphBoundings Remaining boundings */ public function render( ezcGraphRenderer $renderer, ezcGraphBoundings $boundings ) { $height = (int) min( round( $this->properties['maxHeight'] * ( $boundings->y1 - $boundings->y0 ) ), $this->properties['font']->maxFontSize + $this->padding * 2 + $this->margin * 2 ); switch ( $this->properties['position'] ) { case ezcGraph::TOP: $textBoundings = new ezcGraphBoundings( $boundings->x0, $boundings->y0, $boundings->x1, $boundings->y0 + $height ); $boundings->y0 += $height + $this->properties['margin']; break; case ezcGraph::BOTTOM: $textBoundings = new ezcGraphBoundings( $boundings->x0, $boundings->y1 - $height, $boundings->x1, $boundings->y1 ); $boundings->y1 -= $height + $this->properties['margin']; break; } $textBoundings = $renderer->drawBox( $textBoundings, $this->properties['background'], $this->properties['border'], $this->properties['borderWidth'], $this->properties['margin'], $this->properties['padding'] ); $renderer->drawText( $textBoundings, $this->properties['title'], ezcGraph::CENTER | ezcGraph::MIDDLE ); return $boundings; } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/exceptions/000077500000000000000000000000001226600447100231245ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/exceptions/date_parsing.php000066400000000000000000000013621226600447100262770ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/exceptions/exception.php000066400000000000000000000006071226600447100256360ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/exceptions/flash_bitmap_type.php000066400000000000000000000012161226600447100273270ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/exceptions/font_rendering.php000066400000000000000000000021161226600447100266400ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/exceptions/font_type.php000066400000000000000000000013111226600447100256400ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/exceptions/incompatible_driver.php000066400000000000000000000015101226600447100276530ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/exceptions/invalid_assignement.php000066400000000000000000000012611226600447100276600ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/exceptions/invalid_data.php000066400000000000000000000012621226600447100262550ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/exceptions/invalid_data_source.php000066400000000000000000000014051226600447100276340ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/exceptions/invalid_dimensions.php000066400000000000000000000015631226600447100275200ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/exceptions/invalid_display_type.php000066400000000000000000000020471226600447100300540ustar00rootroot00000000000000 'Pie', ezcGraph::LINE => 'Line', ezcGraph::BAR => 'Bar', ); if ( isset( $chartTypeNames[$type] ) ) { $chartTypeName = $chartTypeNames[$type]; } else { $chartTypeName = 'Unknown'; } parent::__construct( "Invalid data set display type '$type' ('$chartTypeName') for current chart." ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/exceptions/invalid_id.php000066400000000000000000000013021226600447100257330ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/exceptions/invalid_image_file.php000066400000000000000000000012261226600447100274250ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/exceptions/invalid_keys.php000066400000000000000000000012611226600447100263160ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/exceptions/invalid_step_size.php000066400000000000000000000013271226600447100273530ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/exceptions/no_data.php000066400000000000000000000011451226600447100252430ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/exceptions/no_such_data.php000066400000000000000000000012151226600447100262630ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/exceptions/no_such_dataset.php000066400000000000000000000012351226600447100270010ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/exceptions/no_such_element.php000066400000000000000000000012331226600447100270030ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/exceptions/not_rendered.php000066400000000000000000000013271226600447100263100ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/exceptions/out_of_boundings.php000066400000000000000000000015041226600447100272000ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/exceptions/out_of_logarithmical_boundings.php000066400000000000000000000013711226600447100321010ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/exceptions/reducement_failed.php000066400000000000000000000013071226600447100272750ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/exceptions/too_many_datasets.php000066400000000000000000000012131226600447100273470ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/exceptions/unknown_color_definition.php000066400000000000000000000013271226600447100307450ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/exceptions/unregular_steps.php000066400000000000000000000012451226600447100270610ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/exceptions/unsupported_image_type.php000066400000000000000000000024741226600447100304370ustar00rootroot00000000000000 'GIF', 2 => 'Jpeg', 3 => 'PNG', 4 => 'SWF', 5 => 'PSD', 6 => 'BMP', 7 => 'TIFF (intel)', 8 => 'TIFF (motorola)', 9 => 'JPC', 10 => 'JP2', 11 => 'JPX', 12 => 'JB2', 13 => 'SWC', 14 => 'IFF', 15 => 'WBMP', 16 => 'XBM', ); if ( isset( $typeName[$type] ) ) { $type = $typeName[$type]; } else { $type = 'Unknown'; } parent::__construct( "Unsupported image format '{$type}'." ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/graph.php000066400000000000000000000074171226600447100225660ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/interfaces/000077500000000000000000000000001226600447100230665ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/interfaces/axis_label_renderer.php000066400000000000000000000500751226600447100275770ustar00rootroot00000000000000properties['majorStepCount'] = false; $this->properties['minorStepCount'] = false; $this->properties['majorStepSize'] = 3; $this->properties['minorStepSize'] = 1; $this->properties['innerStep'] = true; $this->properties['outerStep'] = false; $this->properties['outerGrid'] = false; $this->properties['showLabels'] = true; $this->properties['labelPadding'] = 2; parent::__construct( $options ); } /** * __set * * @param mixed $propertyName * @param mixed $propertyValue * @throws ezcBaseValueException * If a submitted parameter was out of range or type. * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return void * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'driver': if ( $propertyValue instanceof ezcGraphDriver ) { $this->properties['driver'] = $propertyValue; } else { throw new ezcGraphInvalidDriverException( $propertyValue ); } break; case 'majorStepCount': if ( ( $propertyValue !== false ) && !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 0' ); } $this->properties['majorStepCount'] = (int) $propertyValue; break; case 'minorStepCount': if ( ( $propertyValue !== false ) && !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 0' ); } $this->properties['minorStepCount'] = (int) $propertyValue; break; case 'majorStepSize': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 0' ); } $this->properties['majorStepSize'] = (int) $propertyValue; break; case 'minorStepSize': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 0' ); } $this->properties['minorStepSize'] = (int) $propertyValue; break; case 'innerStep': if ( !is_bool( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'bool' ); } $this->properties['innerStep'] = (bool) $propertyValue; break; case 'outerStep': if ( !is_bool( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'bool' ); } $this->properties['outerStep'] = (bool) $propertyValue; break; case 'outerGrid': if ( !is_bool( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'bool' ); } $this->properties['outerGrid'] = (bool) $propertyValue; break; case 'showLabels': if ( !is_bool( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'bool' ); } $this->properties['showLabels'] = (bool) $propertyValue; break; case 'labelPadding': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 0' ); } $this->properties['labelPadding'] = (int) $propertyValue; break; default: throw new ezcBasePropertyNotFoundException( $propertyName ); } } /** * Checks for the cutting point of two lines. * * The lines are given by a start position and the direction of the line, * both as instances of {@link ezcGraphCoordinate}. If no cutting point * could be calculated, because the lines are parallel the function will * return false. Otherwise the factor returned can be used to calculate the * cutting point using the following equatation: * point = $aStart + $factor * $aDir; * * We return the factor instead of the resulting point because it can be * easily determined from the factor if the cutting point is in "behind" * the line starting point, or if the distance to the cutting point is * bigger then the direction vector is long ( $factor > 1 ). * * @param ezcGraphCoordinate $aStart * @param ezcGraphCoordinate $aDir * @param ezcGraphCoordinate $bStart * @param ezcGraphCoordinate $bDir * @return mixed */ public function determineLineCuttingPoint( ezcGraphCoordinate $aStart, ezcGraphCoordinate $aDir, ezcGraphCoordinate $bStart, ezcGraphCoordinate $bDir ) { // Check if lines are parallel if ( ( ( abs( $aDir->x ) < .000001 ) && ( abs( $bDir->x ) < .000001 ) ) || ( ( abs( $aDir->y ) < .000001 ) && ( abs( $bDir->y ) < .000001 ) ) || ( ( abs( $aDir->x * $bDir->x * $aDir->y * $bDir->y ) > .000001 ) && ( abs( ( $aDir->x / $aDir->y ) - ( $bDir->x / $bDir->y ) ) < .000001 ) ) ) { return false; } // Use ? : to prevent division by zero $denominator = ( abs( $aDir->y ) > .000001 ? $bDir->y / $aDir->y : .0 ) - ( abs( $aDir->x ) > .000001 ? $bDir->x / $aDir->x : .0 ); // Solve equatation if ( abs( $denominator ) < .000001 ) { return - ( ( abs( $aDir->y ) > .000001 ? $bStart->y / $aDir->y : .0 ) - ( abs( $aDir->y ) > .000001 ? $aStart->y / $aDir->y : .0 ) - ( abs( $aDir->x ) > .000001 ? $bStart->x / $aDir->x : .0 ) + ( abs( $aDir->x ) > .000001 ? $aStart->x / $aDir->x : .0 ) ); } else { return - ( ( abs( $aDir->y ) > .000001 ? $bStart->y / $aDir->y : .0 ) - ( abs( $aDir->y ) > .000001 ? $aStart->y / $aDir->y : .0 ) - ( abs( $aDir->x ) > .000001 ? $bStart->x / $aDir->x : .0 ) + ( abs( $aDir->x ) > .000001 ? $aStart->x / $aDir->x : .0 ) ) / $denominator; } } /** * Draw single step on a axis * * Draws a step on a axis at the current position * * @param ezcGraphRenderer $renderer Renderer to draw the step with * @param ezcGraphCoordinate $position Position of step * @param ezcGraphCoordinate $direction Direction of axis * @param int $axisPosition Position of axis * @param int $size Step size * @param ezcGraphColor $color Color of axis * @return void */ public function drawStep( ezcGraphRenderer $renderer, ezcGraphCoordinate $position, ezcGraphCoordinate $direction, $axisPosition, $size, ezcGraphColor $color ) { if ( ! ( $this->innerStep || $this->outerStep ) ) { return false; } $drawStep = false; if ( ( ( $axisPosition === ezcGraph::CENTER ) && $this->innerStep ) || ( ( $axisPosition === ezcGraph::BOTTOM ) && $this->outerStep ) || ( ( $axisPosition === ezcGraph::TOP ) && $this->innerStep ) || ( ( $axisPosition === ezcGraph::RIGHT ) && $this->outerStep ) || ( ( $axisPosition === ezcGraph::LEFT ) && $this->innerStep ) ) { // Turn direction vector to left by 90 degrees and multiply // with major step size $stepStart = new ezcGraphCoordinate( $position->x + $direction->y * $size, $position->y - $direction->x * $size ); $drawStep = true; } else { $stepStart = $position; } if ( ( ( $axisPosition === ezcGraph::CENTER ) && $this->innerStep ) || ( ( $axisPosition === ezcGraph::BOTTOM ) && $this->innerStep ) || ( ( $axisPosition === ezcGraph::TOP ) && $this->outerStep ) || ( ( $axisPosition === ezcGraph::RIGHT ) && $this->innerStep ) || ( ( $axisPosition === ezcGraph::LEFT ) && $this->outerStep ) ) { // Turn direction vector to right by 90 degrees and multiply // with major step size $stepEnd = new ezcGraphCoordinate( $position->x - $direction->y * $size, $position->y + $direction->x * $size ); $drawStep = true; } else { $stepEnd = $position; } if ( $drawStep ) { $renderer->drawStepLine( $stepStart, $stepEnd, $color ); } } /** * Draw non-rectangular grid lines grid * * Draws a grid line at the current position, for non-rectangular axis. * * @param ezcGraphRenderer $renderer Renderer to draw the grid with * @param ezcGraphBoundings $boundings Boundings of axis * @param ezcGraphCoordinate $position Position of step * @param ezcGraphCoordinate $direction Direction of axis * @param ezcGraphColor $color Color of axis * @return void */ protected function drawNonRectangularGrid( ezcGraphRenderer $renderer, ezcGraphBoundings $boundings, ezcGraphCoordinate $position, ezcGraphCoordinate $direction, ezcGraphColor $color ) { // Direction of grid line is direction of axis turned right by 90 // degrees $gridDirection = new ezcGraphCoordinate( $direction->y, - $direction->x ); $cuttingPoints = array(); foreach ( array( // Bounding lines array( 'start' => new ezcGraphCoordinate( $boundings->x0, $boundings->y0 ), 'dir' => new ezcGraphCoordinate( 0, $boundings->y1 - $boundings->y0 ) ), array( 'start' => new ezcGraphCoordinate( $boundings->x0, $boundings->y0 ), 'dir' => new ezcGraphCoordinate( $boundings->x1 - $boundings->x0, 0 ) ), array( 'start' => new ezcGraphCoordinate( $boundings->x1, $boundings->y1 ), 'dir' => new ezcGraphCoordinate( 0, $boundings->y0 - $boundings->y1 ) ), array( 'start' => new ezcGraphCoordinate( $boundings->x1, $boundings->y1 ), 'dir' => new ezcGraphCoordinate( $boundings->x0 - $boundings->x1, 0 ) ), ) as $boundingLine ) { // Test for cutting points with bounding lines, where cutting // position is between 0 and 1, which means, that the line is hit // on the bounding box rectangle. Use these points as a start and // ending point for the grid lines. There should *always* be // exactly two points returned. $cuttingPosition = $this->determineLineCuttingPoint( $boundingLine['start'], $boundingLine['dir'], $position, $gridDirection ); if ( $cuttingPosition === false ) { continue; } $cuttingPosition = abs( $cuttingPosition ); if ( ( $cuttingPosition >= 0 ) && ( $cuttingPosition <= 1 ) ) { $cuttingPoints[] = new ezcGraphCoordinate( $boundingLine['start']->x + $cuttingPosition * $boundingLine['dir']->x, $boundingLine['start']->y + $cuttingPosition * $boundingLine['dir']->y ); } } if ( count( $cuttingPoints ) < 2 ) { // This should not happpen return false; } // Finally draw grid line $renderer->drawGridLine( $cuttingPoints[0], $cuttingPoints[1], $color ); } /** * Draw rectangular grid * * Draws a grid line at the current position for rectangular directed axis. * * Method special for rectangularly directed axis to minimize the floating * point calculation inaccuracies. Those are not necessary for rectangles, * while for non-rectangular directed axis. * * @param ezcGraphRenderer $renderer Renderer to draw the grid with * @param ezcGraphBoundings $boundings Boundings of axis * @param ezcGraphCoordinate $position Position of step * @param ezcGraphCoordinate $direction Direction of axis * @param ezcGraphColor $color Color of axis * @return void */ protected function drawRectangularGrid( ezcGraphRenderer $renderer, ezcGraphBoundings $boundings, ezcGraphCoordinate $position, ezcGraphCoordinate $direction, ezcGraphColor $color ) { if ( abs( $direction->x ) < .00001 ) { $renderer->drawGridLine( new ezcGraphCoordinate( $boundings->x0, $position->y ), new ezcGraphCoordinate( $boundings->x1, $position->y ), $color ); } else { $renderer->drawGridLine( new ezcGraphCoordinate( $position->x, $boundings->y0 ), new ezcGraphCoordinate( $position->x, $boundings->y1 ), $color ); } } /** * Draw grid * * Draws a grid line at the current position * * @param ezcGraphRenderer $renderer Renderer to draw the grid with * @param ezcGraphBoundings $boundings Boundings of axis * @param ezcGraphCoordinate $position Position of step * @param ezcGraphCoordinate $direction Direction of axis * @param ezcGraphColor $color Color of axis * @return void */ protected function drawGrid( ezcGraphRenderer $renderer, ezcGraphBoundings $boundings, ezcGraphCoordinate $position, ezcGraphCoordinate $direction, ezcGraphColor $color ) { // Check if the axis direction is rectangular if ( ( abs( $direction->x ) < .00001 ) || ( abs( $direction->y ) < .00001 ) ) { return $this->drawRectangularGrid( $renderer, $boundings, $position, $direction, $color ); } else { return $this->drawNonRectangularGrid( $renderer, $boundings, $position, $direction, $color ); } } /** * Modify chart boundings * * Optionally modify boundings of chart data * * @param ezcGraphBoundings $boundings Current boundings of chart * @param ezcGraphCoordinate $direction Direction of the current axis * @return ezcGraphBoundings Modified boundings */ public function modifyChartBoundings( ezcGraphBoundings $boundings, ezcGraphCoordinate $direction ) { return $boundings; } /** * Modify chart data position * * Optionally additionally modify the coodinate of a data point * * @param ezcGraphCoordinate $coordinate Data point coordinate * @return ezcGraphCoordinate Modified coordinate */ public function modifyChartDataPosition( ezcGraphCoordinate $coordinate ) { return $coordinate; } /** * Get axis space values * * Get axis space values, depending on passed parameters. If * $innerBoundings is given it will be used to caclulat the axis spaces * available for label rendering. If not given the legacy method will be * used, which uses the xAxisSpace and yAxisSpace values calcualted by the * renderer. * * Returns an array( $xSpace, $ySpace ), containing the irespective size in * pixels. Additionally calculates the grid boundings passed by reference. * * @param ezcGraphRenderer $renderer * @param ezcGraphBoundings $boundings * @param mixed $innerBoundings * @return array */ protected function getAxisSpace( ezcGraphRenderer $renderer, ezcGraphBoundings $boundings, ezcGraphChartElementAxis $axis, $innerBoundings, &$gridBoundings ) { if ( $innerBoundings !== null ) { $gridBoundings = clone $innerBoundings; $xSpace = abs( $axis->position === ezcGraph::LEFT ? $innerBoundings->x0 - $boundings->x0 : $boundings->x1 - $innerBoundings->x1 ); $ySpace = abs( $axis->position === ezcGraph::TOP ? $innerBoundings->y0 - $boundings->y0 : $boundings->y1 - $innerBoundings->y1 ); } else { $gridBoundings = new ezcGraphBoundings( $boundings->x0 + ( $xSpace = abs( $renderer->xAxisSpace ) ), $boundings->y0 + ( $ySpace = abs( $renderer->yAxisSpace ) ), $boundings->x1 - $xSpace, $boundings->y1 - $ySpace ); } if ( $this->outerGrid ) { $gridBoundings = $boundings; } return array( $xSpace, $ySpace ); } /** * Render Axis labels * * Render labels for an axis. * * @param ezcGraphRenderer $renderer Renderer used to draw the chart * @param ezcGraphBoundings $boundings Boundings of the axis * @param ezcGraphCoordinate $start Axis starting point * @param ezcGraphCoordinate $end Axis ending point * @param ezcGraphChartElementAxis $axis Axis instance * @return void */ abstract public function renderLabels( ezcGraphRenderer $renderer, ezcGraphBoundings $boundings, ezcGraphCoordinate $start, ezcGraphCoordinate $end, ezcGraphChartElementAxis $axis ); } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/interfaces/chart.php000066400000000000000000000213271226600447100247050ustar00rootroot00000000000000palette = new ezcGraphPaletteTango(); $this->data = new ezcGraphChartDataContainer( $this ); // Add standard elements $this->addElement( 'background', new ezcGraphChartElementBackground() ); $this->elements['background']->position = ezcGraph::CENTER | ezcGraph::MIDDLE; $this->addElement( 'title', new ezcGraphChartElementText() ); $this->elements['title']->position = ezcGraph::TOP; $this->renderElement['title'] = false; $this->addElement( 'subtitle', new ezcGraphChartElementText() ); $this->elements['subtitle']->position = ezcGraph::TOP; $this->renderElement['subtitle'] = false; $this->addElement( 'legend', new ezcGraphChartElementLegend() ); $this->elements['legend']->position = ezcGraph::LEFT; // Define standard renderer and driver $this->properties['driver'] = new ezcGraphSvgDriver(); $this->properties['renderer'] = new ezcGraphRenderer2d(); $this->properties['renderer']->setDriver( $this->driver ); // Initialize other properties $this->properties['renderedFile'] = null; } /** * Add element to chart * * Add a chart element to the chart and perform the required configuration * tasks for the chart element. * * @param string $name Element name * @param ezcGraphChartElement $element Chart element * @return void */ protected function addElement( $name, ezcGraphChartElement $element ) { $this->elements[$name] = $element; $this->elements[$name]->font = $this->options->font; $this->elements[$name]->setFromPalette( $this->palette ); // Render element by default $this->renderElement[$name] = true; } /** * Options write access * * @throws ezcBasePropertyNotFoundException * If Option could not be found * @throws ezcBaseValueException * If value is out of range * @param mixed $propertyName Option name * @param mixed $propertyValue Option value; * @return void * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'title': case 'subtitle': $this->elements[$propertyName]->title = $propertyValue; $this->renderElement[$propertyName] = true; break; case 'background': $this->elements[$propertyName]->color = $propertyValue; break; case 'legend': if ( !is_bool( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'boolean' ); } $this->renderElement['legend'] = (bool) $propertyValue; break; case 'renderer': if ( $propertyValue instanceof ezcGraphRenderer ) { $this->properties['renderer'] = $propertyValue; $this->properties['renderer']->setDriver( $this->driver ); return $this->properties['renderer']; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphRenderer' ); } break; case 'driver': if ( $propertyValue instanceof ezcGraphDriver ) { $this->properties['driver'] = $propertyValue; $this->properties['renderer']->setDriver( $this->driver ); return $this->properties['driver']; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphDriver' ); } break; case 'palette': if ( $propertyValue instanceof ezcGraphPalette ) { $this->properties['palette'] = $propertyValue; $this->setFromPalette( $this->palette ); } else { throw new ezcBaseValueException( "palette", $propertyValue, "instanceof ezcGraphPalette" ); } break; case 'renderedFile': $this->properties['renderedFile'] = (string) $propertyValue; break; case 'options': if ( $propertyValue instanceof ezcGraphChartOptions ) { $this->options = $propertyValue; } else { throw new ezcBaseValueException( "options", $propertyValue, "instanceof ezcGraphOptions" ); } default: throw new ezcBasePropertyNotFoundException( $propertyName ); break; } } /** * Set colors and border fro this element * * @param ezcGraphPalette $palette Palette * @return void */ public function setFromPalette( ezcGraphPalette $palette ) { $this->options->font->name = $palette->fontName; $this->options->font->color = $palette->fontColor; foreach ( $this->elements as $element ) { $element->setFromPalette( $palette ); } } /** * __get * * @param mixed $propertyName * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return mixed * @ignore */ public function __get( $propertyName ) { if ( array_key_exists( $propertyName, $this->properties ) ) { return $this->properties[$propertyName]; } if ( isset( $this->elements[$propertyName] ) ) { return $this->elements[$propertyName]; } if ( ( $propertyName === 'options' ) || ( $propertyName === 'data' ) ) { return $this->$propertyName; } else { throw new ezcGraphNoSuchElementException( $propertyName ); } } /** * Returns the default display type of the current chart type. * * @return int Display type */ abstract public function getDefaultDisplayType(); /** * Return filename of rendered file, and false if no file was yet rendered. * * @return mixed */ public function getRenderedFile() { return ( $this->renderedFile !== null ? $this->renderedFile : false ); } /** * Renders this chart * * Creates basic visual chart elements from the chart to be processed by * the renderer. * * @param int $width * @param int $height * @param string $file * @return void */ abstract public function render( $width, $height, $file = null ); /** * Renders this chart to direct output * * Does the same as ezcGraphChart::render(), but renders directly to * output and not into a file. * * @param int $width * @param int $height * @return void */ abstract public function renderToOutput( $width, $height ); } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/interfaces/dataset_property.php000066400000000000000000000121301226600447100271650ustar00rootroot00000000000000 * $graph = new ezcGraphLineChart(); * $graph->data['example'] = new ezcGraphArrayDataSet( array( * 'Foo' => 23, * 'Bar' => 42, * ) ); * * // Set color for all data points in this data set * $graph->data['example']->color = '#a40000'; * * // Set different color for one special datapoint * $graph->data['example']->color['Foo'] = '#2e3436'; * * $graph->render( 400, 200, 'test.svg' ); * * * @version 1.5 * @package Graph */ abstract class ezcGraphDataSetProperty implements ArrayAccess { /** * Default value for this property * * @var mixed */ protected $defaultValue; /** * Contains specified values for single dataset elements * * @var array */ protected $dataValue; /** * Contains a reference to the dataset to check for availability of data * keys * * @var ezcGraphDataSet */ protected $dataset; /** * Abstract method to contain the check for validity of the value * * @param mixed $value * @return void */ abstract protected function checkValue( &$value ); /** * Constructor * * @param ezcGraphDataSet $dataset * @ignore * @return void */ public function __construct( ezcGraphDataSet $dataset ) { $this->dataset = $dataset; } /** * Set the default value for this property * * @param string $name Property name * @param mixed $value Property value * @return void */ public function __set( $name, $value ) { if ( $name === 'default' && $this->checkValue( $value ) ) { $this->defaultValue = $value; } } /** * Get the default value for this property * * @param string $name Property name * @return mixed */ public function __get( $name ) { if ( $name === 'default' ) { return $this->defaultValue; } } /** * Returns if an option exists. * Allows isset() using ArrayAccess. * * @param string $key The name of the option to get. * @return bool Wether the option exists. */ final public function offsetExists( $key ) { return isset( $this->dataset[$key] ); } /** * Returns an option value. * Get an option value by ArrayAccess. * * @param string $key The name of the option to get. * @return mixed The option value. * * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of */ final public function offsetGet( $key ) { if ( isset( $this->dataValue[$key] ) ) { return $this->dataValue[$key]; } elseif ( isset( $this->dataset[$key] ) ) { return $this->defaultValue; } else { throw new ezcGraphNoSuchDataException( $key ); } } /** * Set an option. * Sets an option using ArrayAccess. * * @param string $key The option to set. * @param mixed $value The value for the option. * @return void * * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @throws ezcBaseValueException * If a the value for a property is out of range. */ public function offsetSet( $key, $value ) { if ( isset( $this->dataset[$key] ) && $this->checkValue( $value ) ) { $this->dataValue[$key] = $value; } else { throw new ezcGraphNoSuchDataException( $key ); } } /** * Unset an option. * Unsets an option using ArrayAccess. * * @param string $key The options to unset. * @return void * * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @throws ezcBaseValueException * If a the value for a property is out of range. */ final public function offsetUnset( $key ) { if ( isset( $this->dataset[$key] ) ) { unset( $this->dataValue[$key] ); } else { throw new ezcGraphNoSuchDataException( $key ); } } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/interfaces/driver.php000066400000000000000000000621341226600447100251000ustar00rootroot00000000000000options = $propertyValue; } else { throw new ezcBaseValueException( "options", $propertyValue, "instanceof ezcGraphOptions" ); } break; default: throw new ezcBasePropertyNotFoundException( $propertyName ); break; } } /** * __get * * @param mixed $propertyName * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return mixed * @ignore */ public function __get( $propertyName ) { switch ( $propertyName ) { case 'options': return $this->options; default: throw new ezcBasePropertyNotFoundException( $propertyName ); } } /** * Reduces the size of a polygon * * The method takes a polygon defined by a list of points and reduces its * size by moving all lines to the middle by the given $size value. * * The detection of the inner side of the polygon depends on the angle at * each edge point. This method will always work for 3 edged polygones, * because the smaller angle will always be on the inner side. For * polygons with more then 3 edges this method may fail. For ezcGraph this * is a valid simplification, because we do not have any polygones which * have an inner angle >= 180 degrees. * * @param array(ezcGraphCoordinate) $points * @param float $size * @throws ezcGraphReducementFailedException * @return array( ezcGraphCoordinate ) */ protected function reducePolygonSize( array $points, $size ) { $pointCount = count( $points ); // Build normalized vectors between polygon edge points $vectors = array(); $vectorLength = array(); for ( $i = 0; $i < $pointCount; ++$i ) { $nextPoint = ( $i + 1 ) % $pointCount; $vectors[$i] = ezcGraphVector::fromCoordinate( $points[$nextPoint] ) ->sub( $points[$i] ); // Throw exception if polygon is too small to reduce $vectorLength[$i] = $vectors[$i]->length(); if ( $vectorLength[$i] < $size ) { throw new ezcGraphReducementFailedException(); } $vectors[$i]->unify(); // Remove point from list if it the same as the next point if ( ( $vectors[$i]->x == $vectors[$i]->y ) && ( $vectors[$i]->x == 0 ) ) { $pointCount--; if ( $i === 0 ) { $points = array_slice( $points, $i + 1 ); } else { $points = array_merge( array_slice( $points, 0, $i ), array_slice( $points, $i + 1 ) ); } $i--; } } // Remove vectors and appendant point, if local angle equals zero // dergrees. for ( $i = 0; $i < $pointCount; ++$i ) { $nextPoint = ( $i + 1 ) % $pointCount; if ( ( abs( $vectors[$i]->x - $vectors[$nextPoint]->x ) < .0001 ) && ( abs( $vectors[$i]->y - $vectors[$nextPoint]->y ) < .0001 ) ) { $pointCount--; $points = array_merge( array_slice( $points, 0, $i + 1 ), array_slice( $points, $i + 2 ) ); $vectors = array_merge( array_slice( $vectors, 0, $i + 1 ), array_slice( $vectors, $i + 2 ) ); $i--; } } // No reducements for lines if ( $pointCount <= 2 ) { return $points; } // Determine one of the angles - we need to know where the smaller // angle is, to determine if the inner side of the polygon is on // the left or right hand. // // This is a valid simplification for ezcGraph(, for now). // // The sign of the scalar products results indicates on which site // the smaller angle is, when comparing the orthogonale vector of // one of the vectors with the other. Why? .. use pen and paper .. // // It is sufficant to do this once before iterating over the points, // because the inner side of the polygon is on the same side of the // point for each point. $last = 0; $next = 1; $sign = ( -$vectors[$last]->y * $vectors[$next]->x + $vectors[$last]->x * $vectors[$next]->y ) < 0 ? 1 : -1; // Move points to center $newPoints = array(); for ( $i = 0; $i < $pointCount; ++$i ) { $last = $i; $next = ( $i + 1 ) % $pointCount; // Orthogonal vector with direction based on the side of the inner // angle $v = clone $vectors[$next]; if ( $sign > 0 ) { $v->rotateCounterClockwise()->scalar( $size ); } else { $v->rotateClockwise()->scalar( $size ); } // get last vector not pointing in reverse direction $lastVector = clone $vectors[$last]; $lastVector->scalar( -1 ); // Calculate new point: Move point to the center site of the // polygon using the normalized orthogonal vectors next to the // point and the size as distance to move. // point + v + size / tan( angle / 2 ) * startVector $newPoint = clone $vectors[$next]; $v ->add( $newPoint ->scalar( $size / tan( $lastVector->angle( $vectors[$next] ) / 2 ) ) ); // A fast guess: If the movement of the point exceeds the length of // the surrounding edge vectors the angle was to small to perform a // valid size reducement. In this case we just reduce the length of // the movement to the minimal length of the surrounding vectors. // This should fit in most cases. // // The correct way to check would be a test, if the calculated // point is still in the original polygon, but a test for a point // in a polygon is too expensive. $movement = $v->length(); if ( ( $movement > $vectorLength[$last] ) && ( $movement > $vectorLength[$next] ) ) { $v->unify()->scalar( min( $vectorLength[$last], $vectorLength[$next] ) ); } $newPoints[$next] = $v->add( $points[$next] ); } return $newPoints; } /** * Reduce the size of an ellipse * * The method returns a the edgepoints and angles for an ellipse where all * borders are moved to the inner side of the ellipse by the give $size * value. * * The method returns an * array ( * 'center' => (ezcGraphCoordinate) New center point, * 'start' => (ezcGraphCoordinate) New outer start point, * 'end' => (ezcGraphCoordinate) New outer end point, * ) * * @param ezcGraphCoordinate $center * @param float $width * @param float $height * @param float $startAngle * @param float $endAngle * @param float $size * @throws ezcGraphReducementFailedException * @return array */ protected function reduceEllipseSize( ezcGraphCoordinate $center, $width, $height, $startAngle, $endAngle, $size ) { $oldStartPoint = new ezcGraphVector( $width * cos( deg2rad( $startAngle ) ) / 2, $height * sin( deg2rad( $startAngle ) ) / 2 ); $oldEndPoint = new ezcGraphVector( $width * cos( deg2rad( $endAngle ) ) / 2, $height * sin( deg2rad( $endAngle ) ) / 2 ); // We always need radian values.. $degAngle = abs( $endAngle - $startAngle ); $startAngle = deg2rad( $startAngle ); $endAngle = deg2rad( $endAngle ); // Calculate normalized vectors for the lines spanning the ellipse $unifiedStartVector = ezcGraphVector::fromCoordinate( $oldStartPoint )->unify(); $unifiedEndVector = ezcGraphVector::fromCoordinate( $oldEndPoint )->unify(); $startVector = ezcGraphVector::fromCoordinate( $oldStartPoint ); $endVector = ezcGraphVector::fromCoordinate( $oldEndPoint ); $oldStartPoint->add( $center ); $oldEndPoint->add( $center ); // Use orthogonal vectors of normalized ellipse spanning vectors to $v = clone $unifiedStartVector; $v->rotateClockwise()->scalar( $size ); // calculate new center point // center + v + size / tan( angle / 2 ) * startVector $centerMovement = clone $unifiedStartVector; $newCenter = $v->add( $centerMovement->scalar( $size / tan( ( $endAngle - $startAngle ) / 2 ) ) )->add( $center ); // Test if center is still inside the ellipse, otherwise the sector // was to small to be reduced $innerBoundingBoxSize = 0.7 * min( $width, $height ); if ( ( $newCenter->x < ( $center->x + $innerBoundingBoxSize ) ) && ( $newCenter->x > ( $center->x - $innerBoundingBoxSize ) ) && ( $newCenter->y < ( $center->y + $innerBoundingBoxSize ) ) && ( $newCenter->y > ( $center->y - $innerBoundingBoxSize ) ) ) { // Point is in inner bounding box -> everything is OK } elseif ( ( $newCenter->x < ( $center->x - $width ) ) || ( $newCenter->x > ( $center->x + $width ) ) || ( $newCenter->y < ( $center->y - $height ) ) || ( $newCenter->y > ( $center->y + $height ) ) ) { // Quick outer boundings check if ( $degAngle > 180 ) { // Use old center for very big angles $newCenter = clone $center; } else { // Do not draw for very small angles throw new ezcGraphReducementFailedException(); } } else { // Perform exact check $distance = new ezcGraphVector( $newCenter->x - $center->x, $newCenter->y - $center->y ); // Convert elipse to circle for correct angle calculation $direction = clone $distance; $direction->y *= ( $width / $height ); $angle = $direction->angle( new ezcGraphVector( 0, 1 ) ); $outerPoint = new ezcGraphVector( sin( $angle ) * $width / 2, cos( $angle ) * $height / 2 ); // Point is not in ellipse any more if ( abs( $distance->x ) > abs( $outerPoint->x ) ) { if ( $degAngle > 180 ) { // Use old center for very big angles $newCenter = clone $center; } else { // Do not draw for very small angles throw new ezcGraphReducementFailedException(); } } } // Use start spanning vector and its orthogonal vector to calculate // new start point $newStartPoint = clone $oldStartPoint; // Create tangent vector from tangent angle // Ellipse tangent factor $ellipseTangentFactor = sqrt( pow( $height, 2 ) * pow( cos( $startAngle ), 2 ) + pow( $width, 2 ) * pow( sin( $startAngle ), 2 ) ); $ellipseTangentVector = new ezcGraphVector( $width * -sin( $startAngle ) / $ellipseTangentFactor, $height * cos( $startAngle ) / $ellipseTangentFactor ); // Reverse spanning vector $innerVector = clone $unifiedStartVector; $innerVector->scalar( $size )->scalar( -1 ); $newStartPoint->add( $innerVector)->add( $ellipseTangentVector->scalar( $size ) ); $newStartVector = clone $startVector; $newStartVector->add( $ellipseTangentVector ); // Use end spanning vector and its orthogonal vector to calculate // new end point $newEndPoint = clone $oldEndPoint; // Create tangent vector from tangent angle // Ellipse tangent factor $ellipseTangentFactor = sqrt( pow( $height, 2 ) * pow( cos( $endAngle ), 2 ) + pow( $width, 2 ) * pow( sin( $endAngle ), 2 ) ); $ellipseTangentVector = new ezcGraphVector( $width * -sin( $endAngle ) / $ellipseTangentFactor, $height * cos( $endAngle ) / $ellipseTangentFactor ); // Reverse spanning vector $innerVector = clone $unifiedEndVector; $innerVector->scalar( $size )->scalar( -1 ); $newEndPoint->add( $innerVector )->add( $ellipseTangentVector->scalar( $size )->scalar( -1 ) ); $newEndVector = clone $endVector; $newEndVector->add( $ellipseTangentVector ); return array( 'center' => $newCenter, 'start' => $newStartPoint, 'end' => $newEndPoint, 'startAngle' => rad2deg( $startAngle + $startVector->angle( $newStartVector ) ), 'endAngle' => rad2deg( $endAngle - $endVector->angle( $newEndVector ) ), ); } /** * Draws a single polygon. * * @param array $points Point array * @param ezcGraphColor $color Polygon color * @param mixed $filled Filled * @param float $thickness Line thickness * @return void */ abstract public function drawPolygon( array $points, ezcGraphColor $color, $filled = true, $thickness = 1. ); /** * Draws a line * * @param ezcGraphCoordinate $start Start point * @param ezcGraphCoordinate $end End point * @param ezcGraphColor $color Line color * @param float $thickness Line thickness * @return void */ abstract public function drawLine( ezcGraphCoordinate $start, ezcGraphCoordinate $end, ezcGraphColor $color, $thickness = 1. ); /** * Returns boundings of text depending on the available font extension * * @param float $size Textsize * @param ezcGraphFontOptions $font Font * @param string $text Text * @return ezcGraphBoundings Boundings of text */ abstract protected function getTextBoundings( $size, ezcGraphFontOptions $font, $text ); /** * Test if string fits in a box with given font size * * This method splits the text up into tokens and tries to wrap the text * in an optimal way to fit in the Box defined by width and height. * * If the text fits into the box an array with lines is returned, which * can be used to render the text later: * array( * // Lines * array( 'word', 'word', .. ), * ) * Otherwise the function will return false. * * @param string $string Text * @param ezcGraphCoordinate $position Topleft position of the text box * @param float $width Width of textbox * @param float $height Height of textbox * @param int $size Fontsize * @return mixed Array with lines or false on failure */ protected function testFitStringInTextBox( $string, ezcGraphCoordinate $position, $width, $height, $size ) { // Tokenize String $tokens = preg_split( '/\s+/', $string ); $initialHeight = $height; $lines = array( array() ); $line = 0; foreach ( $tokens as $nr => $token ) { // Add token to tested line $selectedLine = $lines[$line]; $selectedLine[] = $token; $boundings = $this->getTextBoundings( $size, $this->options->font, implode( ' ', $selectedLine ) ); // Check if line is too long if ( $boundings->width > $width ) { if ( count( $selectedLine ) == 1 ) { // Return false if one single word does not fit into one line // Scale down font size to fit this word in one line return $width / $boundings->width; } else { // Put word in next line instead and reduce available height by used space $lines[++$line][] = $token; $height -= $size * ( 1 + $this->options->lineSpacing ); } } else { // Everything is ok - put token in this line $lines[$line][] = $token; } // Return false if text exceeds vertical limit if ( $size > $height ) { return 1; } } // Check width of last line $boundings = $this->getTextBoundings( $size, $this->options->font, implode( ' ', $lines[$line] ) ); if ( $boundings->width > $width ) { return 1; } // It seems to fit - return line array return $lines; } /** * If it is allow to shortened the string, this method tries to extract as * many chars as possible to display a decent amount of characters. * * If no complete token (word) does fit, the largest possible amount of * chars from the first word are taken. If the amount of chars is bigger * then strlen( shortenedStringPostFix ) * 2 the last chars are replace by * the postfix. * * If one complete word fits the box as many words are taken as possible * including a appended shortenedStringPostFix. * * @param mixed $string * @param ezcGraphCoordinate $position * @param mixed $width * @param mixed $height * @param mixed $size * @access protected * @return void */ protected function tryFitShortenedString( $string, ezcGraphCoordinate $position, $width, $height, $size ) { $tokens = preg_split( '/\s+/', $string ); // Try to fit a complete word first $boundings = $this->getTextBoundings( $size, $this->options->font, reset( $tokens ) . ( $postfix = $this->options->autoShortenStringPostFix ) ); if ( $boundings->width > $width ) { // Not even one word fits the box $word = reset( $tokens ); // Test if first character fits the box $boundigs = $this->getTextBoundings( $size, $this->options->font, $hit = $word[0] ); if ( $boundigs->width > $width ) { // That is a really small box. throw new ezcGraphFontRenderingException( $string, $size, $width, $height ); } // Try to put more charactes in there $postLength = strlen( $postfix ); $wordLength = strlen( $word ); for ( $i = 2; $i <= $wordLength; ++$i ) { $string = substr( $word, 0, $i ); if ( strlen( $string ) > ( $postLength << 1 ) ) { $string = substr( $string, 0, -$postLength ) . $postfix; } $boundigs = $this->getTextBoundings( $size, $this->options->font, $string ); if ( $boundigs->width < $width ) { $hit = $string; } else { // Use last string which fit break; } } } else { // Try to use as many words as possible $hit = reset( $tokens ); for ( $i = 2; $i < count( $tokens ); ++$i ) { $string = implode( ' ', array_slice( $tokens, 0, $i ) ) . $postfix; $boundings = $this->getTextBoundings( $size, $this->options->font, $string ); if ( $boundings->width <= $width ) { $hit .= ' ' . $tokens[$i - 1]; } else { // Use last valid hit break; } } $hit .= $postfix; } return array( array( $hit ) ); } /** * Writes text in a box of desired size * * @param string $string Text * @param ezcGraphCoordinate $position Top left position * @param float $width Width of text box * @param float $height Height of text box * @param int $align Alignement of text * @param ezcGraphRotation $rotation * @return void */ abstract public function drawTextBox( $string, ezcGraphCoordinate $position, $width, $height, $align, ezcGraphRotation $rotation = null ); /** * Draws a sector of cirlce * * @param ezcGraphCoordinate $center Center of circle * @param mixed $width Width * @param mixed $height Height * @param mixed $startAngle Start angle of circle sector * @param mixed $endAngle End angle of circle sector * @param ezcGraphColor $color Color * @param mixed $filled Filled * @return void */ abstract public function drawCircleSector( ezcGraphCoordinate $center, $width, $height, $startAngle, $endAngle, ezcGraphColor $color, $filled = true ); /** * Draws a circular arc * * @param ezcGraphCoordinate $center Center of ellipse * @param integer $width Width of ellipse * @param integer $height Height of ellipse * @param integer $size Height of border * @param float $startAngle Starting angle of circle sector * @param float $endAngle Ending angle of circle sector * @param ezcGraphColor $color Color of Border * @param bool $filled Fill state * @return void */ abstract public function drawCircularArc( ezcGraphCoordinate $center, $width, $height, $size, $startAngle, $endAngle, ezcGraphColor $color, $filled = true ); /** * Draw circle * * @param ezcGraphCoordinate $center Center of ellipse * @param mixed $width Width of ellipse * @param mixed $height height of ellipse * @param ezcGraphColor $color Color * @param mixed $filled Filled * @return void */ abstract public function drawCircle( ezcGraphCoordinate $center, $width, $height, ezcGraphColor $color, $filled = true ); /** * Draw an image * * @param mixed $file Image file * @param ezcGraphCoordinate $position Top left position * @param mixed $width Width of image in destination image * @param mixed $height Height of image in destination image * @return void */ abstract public function drawImage( $file, ezcGraphCoordinate $position, $width, $height ); /** * Return mime type for current image format * * @return string */ abstract public function getMimeType(); /** * Render image directly to output * * The method renders the image directly to the standard output. You * normally do not want to use this function, because it makes it harder * to proper cache the generated graphs. * * @return void */ public function renderToOutput() { header( 'Content-Type: ' . $this->getMimeType() ); $this->render( 'php://output' ); } /** * Finally save image * * @param string $file Destination filename * @return void */ abstract public function render( $file ); } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/interfaces/element.php000066400000000000000000000276121226600447100252400ustar00rootroot00000000000000 * $graph = new ezcGraphPieChart(); * $graph->data['example'] = new ezcGraphArrayDataSet( array( * 'Foo' => 23, * 'Bar' => 42, * ) ); * * // Set a title and format the title element * $graph->title = 'Example formatted pie chart'; * $graph->title->margin = 2; * $graph->title->background = '#FFFFFF80'; * $graph->title->border = '#FFFFFF'; * $graph->title->borderWidth = 1; * $graph->title->margin = 1; * $graph->title->padding = 1; * * // Format the legend element * $graph->legend->margin = 2; * $graph->legend->background = '#FFFFFF80'; * $graph->legend->border = '#FFFFFF'; * $graph->legend->borderWidth = 1; * $graph->legend->margin = 1; * $graph->legend->padding = 1; * * $graph->background->background = '#888a85'; * * $graph->render( 400, 250, 'element.svg' ); * * * @property string $title * Title of chart element. * @property ezcGraphColor $background * Background color of chart element. * @property ezcGraphColor $border * Border color of chart element. * @property int $padding * Distance between border and content of element. * @property int $margin * Distance between outer boundings and border of an element. * @property int $borderWidth * Border width. * @property int $position * Integer defining the elements position in the chart. * @property int $maxTitleHeight * Maximum size of the title. * @property float $portraitTitleSize * Percentage of boundings which are used for the title with * position left, right or center. * @property float $landscapeTitleSize * Percentage of boundings which are used for the title with * position top or bottom. * @property ezcGraphFontOptions $font * Font used for this element. * @property-read bool $fontCloned * Indicates if font configuration was already cloned for this * specific element. * @property-read ezcGraphBoundings $boundings * Boundings of this elements. * * @version 1.5 * @package Graph */ abstract class ezcGraphChartElement extends ezcBaseOptions { /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->properties['title'] = false; $this->properties['background'] = false; $this->properties['boundings'] = new ezcGraphBoundings(); $this->properties['border'] = false; $this->properties['borderWidth'] = 0; $this->properties['padding'] = 0; $this->properties['margin'] = 0; $this->properties['position'] = ezcGraph::LEFT; $this->properties['maxTitleHeight'] = 16; $this->properties['portraitTitleSize'] = .15; $this->properties['landscapeTitleSize'] = .2; $this->properties['font'] = new ezcGraphFontOptions(); $this->properties['fontCloned'] = false; parent::__construct( $options ); } /** * Set colors and border fro this element * * @param ezcGraphPalette $palette Palette * @return void */ public function setFromPalette( ezcGraphPalette $palette ) { $this->properties['border'] = $palette->elementBorderColor; $this->properties['borderWidth'] = $palette->elementBorderWidth; $this->properties['background'] = $palette->elementBackground; $this->properties['padding'] = $palette->padding; $this->properties['margin'] = $palette->margin; } /** * __set * * @param mixed $propertyName * @param mixed $propertyValue * @throws ezcBaseValueException * If a submitted parameter was out of range or type. * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return void * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'title': $this->properties['title'] = (string) $propertyValue; break; case 'background': $this->properties['background'] = ezcGraphColor::create( $propertyValue ); break; case 'border': $this->properties['border'] = ezcGraphColor::create( $propertyValue ); break; case 'padding': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 0' ); } $this->properties['padding'] = (int) $propertyValue; break; case 'margin': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 0' ); } $this->properties['margin'] = (int) $propertyValue; break; case 'borderWidth': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 0' ); } $this->properties['borderWidth'] = (int) $propertyValue; break; case 'font': if ( $propertyValue instanceof ezcGraphFontOptions ) { $this->properties['font'] = $propertyValue; } elseif ( is_string( $propertyValue ) ) { if ( !$this->fontCloned ) { $this->properties['font'] = clone $this->font; $this->properties['fontCloned'] = true; } $this->properties['font']->path = $propertyValue; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphFontOptions' ); } break; case 'position': $positions = array( ezcGraph::TOP, ezcGraph::BOTTOM, ezcGraph::LEFT, ezcGraph::RIGHT, ); if ( in_array( $propertyValue, $positions, true ) ) { $this->properties['position'] = $propertyValue; } else { throw new ezcBaseValueException( 'position', $propertyValue, 'integer' ); } break; case 'maxTitleHeight': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 0' ); } $this->properties['maxTitleHeight'] = (int) $propertyValue; break; case 'portraitTitleSize': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) || ( $propertyValue > 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, '0 <= float <= 1' ); } $this->properties['portraitTitleSize'] = (float) $propertyValue; break; case 'landscapeTitleSize': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) || ( $propertyValue > 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, '0 <= float <= 1' ); } $this->properties['landscapeTitleSize'] = (float) $propertyValue; break; default: throw new ezcBasePropertyNotFoundException( $propertyName ); break; } } /** * __get * * @param mixed $propertyName * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return mixed * @ignore */ public function __get( $propertyName ) { switch ( $propertyName ) { case 'font': // Clone font configuration when requested for this element if ( !$this->fontCloned ) { $this->properties['font'] = clone $this->properties['font']; $this->properties['fontCloned'] = true; } return $this->properties['font']; default: return parent::__get( $propertyName ); } } /** * Renders this chart element * * This method receives and returns a part of the canvas where it can be * rendered on. * * @param ezcGraphRenderer $renderer * @param ezcGraphBoundings $boundings * @return ezcGraphBoundings Part of canvas, which is still free to draw on */ abstract public function render( ezcGraphRenderer $renderer, ezcGraphBoundings $boundings ); /** * Returns calculated boundings based on available percentual space of * given bounding box specified in the elements options and direction of * the box. * * @param ezcGraphBoundings $boundings * @param int $direction * @return ezcGraphBoundings */ protected function getTitleSize( ezcGraphBoundings $boundings, $direction = ezcGraph::HORIZONTAL ) { if ( $direction === ezcGraph::HORIZONTAL ) { return min( $this->maxTitleHeight, ( $boundings->y1 - $boundings->y0 ) * $this->landscapeTitleSize ); } else { return min( $this->maxTitleHeight, ( $boundings->y1 - $boundings->y0 ) * $this->portraitTitleSize ); } } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/interfaces/horizontal_bar_renderer.php000066400000000000000000000026131226600447100305040ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/interfaces/odometer_renderer.php000066400000000000000000000023171226600447100273060ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/interfaces/palette.php000066400000000000000000000152151226600447100252410ustar00rootroot00000000000000colorIndex = -1; $this->symbolIndex = -1; } /** * Returns the requested property * * @param string $propertyName Name of property * @return mixed * @ignore */ public function __get( $propertyName ) { switch ( $propertyName ) { case 'axisColor': case 'majorGridColor': case 'minorGridColor': case 'fontColor': case 'chartBackground': case 'chartBorderColor': case 'elementBackground': case 'elementBorderColor': return ( $this->$propertyName = $this->checkColor( $this->$propertyName ) ); case 'dataSetColor': $this->colorIndex = ( ( $this->colorIndex + 1 ) % count( $this->dataSetColor ) ); return $this->checkColor( $this->dataSetColor[ $this->colorIndex ] ); case 'dataSetSymbol': $this->symbolIndex = ( ( $this->symbolIndex + 1 ) % count( $this->dataSetSymbol ) ); return $this->dataSetSymbol[ $this->symbolIndex ]; case 'fontName': case 'chartBorderWidth': case 'elementBorderWidth': case 'padding': case 'margin': return $this->$propertyName; default: throw new ezcBasePropertyNotFoundException( $propertyName ); } } /** * __set * * @param mixed $propertyName Property name * @param mixed $propertyValue Property value * @access public * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'axisColor': case 'majorGridColor': case 'minorGridColor': case 'fontColor': case 'chartBackground': case 'chartBorderColor': case 'elementBackground': case 'elementBorderColor': $this->$propertyName = ezcGraphColor::create( $propertyValue ); break; case 'dataSetColor': if ( !is_array( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'array( ezcGraphColor )' ); } $this->dataSetColor = array(); foreach ( $propertyValue as $value ) { $this->dataSetColor[] = ezcGraphColor::create( $value ); } $this->colorIndex = -1; break; case 'dataSetSymbol': if ( !is_array( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'array( (int) ezcGraph::SYMBOL_TYPE )' ); } $this->dataSetSymbol = array(); foreach ( $propertyValue as $value ) { $this->dataSetSymbol[] = (int) $value; } $this->symbolIndex = -1; break; case 'fontName': $this->$propertyName = (string) $propertyValue; break; case 'chartBorderWidth': case 'elementBorderWidth': case 'padding': case 'margin': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 0' ); } $this->$propertyName = (int) $propertyValue; break; default: throw new ezcBasePropertyNotFoundException( $propertyName ); } } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/interfaces/radar_renderer.php000066400000000000000000000032201226600447100265530ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/interfaces/renderer.php000066400000000000000000000632261226600447100254160ustar00rootroot00000000000000 * $chart = new ezcGraphPieChart(); * $chart->driver = new ezcGraphSvgDriver(); * * * @param ezcGraphDriver $driver Output driver * @return void */ public function setDriver( ezcGraphDriver $driver ) { $this->driver = $driver; } /** * Adds a element reference for context * * @param ezcGraphContext $context Dataoint context * @param mixed $reference Driver dependant reference * @return void */ protected function addElementReference( ezcGraphContext $context, $reference ) { $this->elements['data'][$context->dataset][$context->datapoint][] = $reference; } /** * Return all chart element references * * Returns element references for the data sets in the chart, so the * created graphic may be enhanced later. * * The resulting array looks like: * * array ( * legend_url => array ( * $name => $url | null, * ... * ), * legend => array ( * $name => $data, * ... * ) * data => array ( * $dataset => array ( * $name => $data, * ... * ), * ... * ) * ) * * * The legend elements won't show up in the array, if there is no legend * redered. The URLs are only available, if the url property has been set * on the respective dataset. * * The data assigned to the legends and data elements is completely direver * dependent. In the SVG and Flash driver there will jsut be some IDs, * which allow you to reference the affected elements or element groups * inside the flash or SVG file. * * For bitmap formats, like in the Cairo or GD driver, $data will be an * array of ezcGraphCoordinate objects, which roughly describe the outline * of the referenced element. For circles and alike the resolution of this * outline can be configured in the respective driver. * * @return array */ public function getElementReferences() { return $this->elements; } /** * __get * * @param string $propertyName * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return mixed * @ignore */ public function __get( $propertyName ) { switch ( $propertyName ) { case 'xAxisSpace': case 'yAxisSpace': return $this->$propertyName; case 'elements': return $this->elements; default: throw new ezcBasePropertyNotFoundException( $propertyName ); } } /** * Draw pie segment * * Draws a single pie segment * * @param ezcGraphBoundings $boundings Chart boundings * @param ezcGraphContext $context Context of call * @param ezcGraphColor $color Color of pie segment * @param float $startAngle Start angle * @param float $endAngle End angle * @param mixed $label Label of pie segment * @param bool $moveOut Move out from middle for hilighting * @return void */ abstract public function drawPieSegment( ezcGraphBoundings $boundings, ezcGraphContext $context, ezcGraphColor $color, $startAngle = .0, $endAngle = 360., $label = false, $moveOut = false ); /** * Draw bar * * Draws a bar as a data element in a line chart * * @param ezcGraphBoundings $boundings Chart boundings * @param ezcGraphContext $context Context of call * @param ezcGraphColor $color Color of line * @param ezcGraphCoordinate $position Position of data point * @param float $stepSize Space which can be used for bars * @param int $dataNumber Number of dataset * @param int $dataCount Count of datasets in chart * @param int $symbol Symbol to draw for line * @param float $axisPosition Position of axis for drawing filled lines * @return void */ abstract public function drawBar( ezcGraphBoundings $boundings, ezcGraphContext $context, ezcGraphColor $color, ezcGraphCoordinate $position, $stepSize, $dataNumber = 1, $dataCount = 1, $symbol = ezcGraph::NO_SYMBOL, $axisPosition = 0. ); /** * Draw data line * * Draws a line as a data element in a line chart * * @param ezcGraphBoundings $boundings Chart boundings * @param ezcGraphContext $context Context of call * @param ezcGraphColor $color Color of line * @param ezcGraphCoordinate $start Starting point * @param ezcGraphCoordinate $end Ending point * @param int $dataNumber Number of dataset * @param int $dataCount Count of datasets in chart * @param int $symbol Symbol to draw for line * @param ezcGraphColor $symbolColor Color of the symbol, defaults to linecolor * @param ezcGraphColor $fillColor Color to fill line with * @param float $axisPosition Position of axis for drawing filled lines * @param float $thickness Line thickness * @return void */ abstract public function drawDataLine( ezcGraphBoundings $boundings, ezcGraphContext $context, ezcGraphColor $color, ezcGraphCoordinate $start, ezcGraphCoordinate $end, $dataNumber = 1, $dataCount = 1, $symbol = ezcGraph::NO_SYMBOL, ezcGraphColor $symbolColor = null, ezcGraphColor $fillColor = null, $axisPosition = 0., $thickness = 1. ); /** * Draws a highlight textbox for a datapoint. * * A highlight textbox for line and bar charts means a box with the current * value in the graph. * * @param ezcGraphBoundings $boundings Chart boundings * @param ezcGraphContext $context Context of call * @param ezcGraphCoordinate $end Ending point * @param float $axisPosition Position of axis for drawing filled lines * @param int $dataNumber Number of dataset * @param int $dataCount Count of datasets in chart * @param ezcGraphFontOptions $font Font used for highlight string * @param string $text Acutual value * @param int $size Size of highlight text * @param ezcGraphColor $markLines * @param int $xOffset * @param int $yOffset * @param float $stepSize * @param int $type * @return void */ abstract public function drawDataHighlightText( ezcGraphBoundings $boundings, ezcGraphContext $context, ezcGraphCoordinate $end, $axisPosition = 0., $dataNumber = 1, $dataCount = 1, ezcGraphFontOptions $font, $text, $size, ezcGraphColor $markLines = null, $xOffset = 0, $yOffset = 0, $stepSize = 0., $type = ezcGraph::LINE ); /** * Draw legend * * Will draw a legend in the bounding box * * @param ezcGraphBoundings $boundings Bounding of legend * @param ezcGraphChartElementLegend $legend Legend to draw * @param int $type Type of legend: Protrait or landscape * @return void */ abstract public function drawLegend( ezcGraphBoundings $boundings, ezcGraphChartElementLegend $legend, $type = ezcGraph::VERTICAL ); /** * Draw box * * Box are wrapping each major chart element and draw border, background * and title to each chart element. * * Optionally a padding and margin for each box can be defined. * * @param ezcGraphBoundings $boundings Boundings of the box * @param ezcGraphColor $background Background color * @param ezcGraphColor $borderColor Border color * @param int $borderWidth Border width * @param int $margin Margin * @param int $padding Padding * @param mixed $title Title of the box * @param int $titleSize Size of title in the box * @return ezcGraphBoundings Remaining inner boundings */ abstract public function drawBox( ezcGraphBoundings $boundings, ezcGraphColor $background = null, ezcGraphColor $borderColor = null, $borderWidth = 0, $margin = 0, $padding = 0, $title = false, $titleSize = 16 ); /** * Draw text * * Draws the provided text in the boundings * * @param ezcGraphBoundings $boundings Boundings of text * @param string $text Text * @param int $align Alignement of text * @param ezcGraphRotation $rotation * @return void */ abstract public function drawText( ezcGraphBoundings $boundings, $text, $align = ezcGraph::LEFT, ezcGraphRotation $rotation = null ); /** * Draw axis * * Draws an axis form the provided start point to the end point. A specific * angle of the axis is not required. * * For the labeleing of the axis a sorted array with major steps and an * array with minor steps is expected, which are build like this: * array( * array( * 'position' => (float), * 'label' => (string), * ) * ) * where the label is optional. * * The label renderer class defines how the labels are rendered. For more * documentation on this topic have a look at the basic label renderer * class. * * Additionally it can be specified if a major and minor grid are rendered * by defining a color for them. The axis label is used to add a caption * for the axis. * * @param ezcGraphBoundings $boundings Boundings of axis * @param ezcGraphCoordinate $start Start point of axis * @param ezcGraphCoordinate $end Endpoint of axis * @param ezcGraphChartElementAxis $axis Axis to render * @param ezcGraphAxisLabelRenderer $labelClass Used label renderer * @return void */ abstract public function drawAxis( ezcGraphBoundings $boundings, ezcGraphCoordinate $start, ezcGraphCoordinate $end, ezcGraphChartElementAxis $axis, ezcGraphAxisLabelRenderer $labelClass = null ); /** * Draw axis arrow head * * Draw an arrow head at the specified position using specified size * and direction of the error head. Repsects the axisEndStyle option in * the base renderer options class. * * @param ezcGraphCoordinate $position * @param ezcGraphVector $direction * @param float $size * @param ezcGraphColor $color * @return void */ protected function drawAxisArrowHead( ezcGraphCoordinate $position, ezcGraphVector $direction, $size, ezcGraphColor $color ) { $orthogonalDirection = clone $direction; $orthogonalDirection->rotateClockwise(); if ( $this->options->axisEndStyle === ezcGraph::ARROW ) { $this->driver->drawPolygon( array( new ezcGraphCoordinate( $position->x, $position->y ), new ezcGraphCoordinate( $position->x - $orthogonalDirection->x * $size / 2 + $direction->x * $size, $position->y - $orthogonalDirection->y * $size / 2 + $direction->y * $size ), new ezcGraphCoordinate( $position->x + $orthogonalDirection->x * $size / 2 + $direction->x * $size, $position->y + $orthogonalDirection->y * $size / 2 + $direction->y * $size ), ), $color, true ); } elseif ( $this->options->axisEndStyle !== ezcGraph::NO_SYMBOL ) { $topLeft = new ezcGraphCoordinate( $position->x + $orthogonalDirection->x * $size / 2 + $direction->x * $size, $position->y + $orthogonalDirection->y * $size / 2 + $direction->y * $size ); $bottomRight = new ezcGraphCoordinate( $position->x - $orthogonalDirection->x * $size / 2, $position->y - $orthogonalDirection->y * $size / 2 ); $this->drawSymbol( $boundings = new ezcGraphBoundings( min( $topLeft->x, $bottomRight->x ), min( $topLeft->y, $bottomRight->y ), max( $topLeft->x, $bottomRight->x ), max( $topLeft->y, $bottomRight->y ) ), $color, $this->options->axisEndStyle ); } } /** * Draw background image * * Draws a background image at the defined position. If repeat is set the * background image will be repeated like any texture. * * @param ezcGraphBoundings $boundings Boundings for the background image * @param string $file Filename of background image * @param int $position Position of background image * @param int $repeat Type of repetition * @return void */ abstract public function drawBackgroundImage( ezcGraphBoundings $boundings, $file, $position = 48, // ezcGraph::CENTER | ezcGraph::MIDDLE $repeat = ezcGraph::NO_REPEAT ); /** * Draw Symbol * * Draws a single symbol defined by the symbol constants in ezcGraph. for * NO_SYMBOL a rect will be drawn. * * @param ezcGraphBoundings $boundings Boundings of symbol * @param ezcGraphColor $color Color of symbol * @param int $symbol Type of symbol * @return void */ public function drawSymbol( ezcGraphBoundings $boundings, ezcGraphColor $color, $symbol = ezcGraph::NO_SYMBOL ) { switch ( $symbol ) { case ezcGraph::NO_SYMBOL: case ezcGraph::SQUARE: $return = $this->driver->drawPolygon( array( new ezcGraphCoordinate( $boundings->x0, $boundings->y0 ), new ezcGraphCoordinate( $boundings->x1, $boundings->y0 ), new ezcGraphCoordinate( $boundings->x1, $boundings->y1 ), new ezcGraphCoordinate( $boundings->x0, $boundings->y1 ), ), $color, true ); // Draw optional gleam if ( $this->options->legendSymbolGleam !== false ) { $return = $this->driver->drawPolygon( array( $topLeft = new ezcGraphCoordinate( $boundings->x0 + ( $boundings->x1 - $boundings->x0 ) * $this->options->legendSymbolGleamSize, $boundings->y0 + ( $boundings->y1 - $boundings->y0 ) * $this->options->legendSymbolGleamSize ), new ezcGraphCoordinate( $boundings->x1 - ( $boundings->x1 - $boundings->x0 ) * $this->options->legendSymbolGleamSize, $boundings->y0 + ( $boundings->y1 - $boundings->y0 ) * $this->options->legendSymbolGleamSize ), $bottomRight = new ezcGraphCoordinate( $boundings->x1 - ( $boundings->x1 - $boundings->x0 ) * $this->options->legendSymbolGleamSize, $boundings->y1 - ( $boundings->y1 - $boundings->y0 ) * $this->options->legendSymbolGleamSize ), new ezcGraphCoordinate( $boundings->x0 + ( $boundings->x1 - $boundings->x0 ) * $this->options->legendSymbolGleamSize, $boundings->y1 - ( $boundings->y1 - $boundings->y0 ) * $this->options->legendSymbolGleamSize ), ), new ezcGraphLinearGradient( $bottomRight, $topLeft, $color->darken( -$this->options->legendSymbolGleam ), $color->darken( $this->options->legendSymbolGleam ) ), true ); } return $return; case ezcGraph::BOX: $return = $this->driver->drawPolygon( array( new ezcGraphCoordinate( $boundings->x0, $boundings->y0 ), new ezcGraphCoordinate( $boundings->x1, $boundings->y0 ), new ezcGraphCoordinate( $boundings->x1, $boundings->y1 ), new ezcGraphCoordinate( $boundings->x0, $boundings->y1 ), ), $color, false ); return $return; case ezcGraph::DIAMOND: $return = $this->driver->drawPolygon( array( new ezcGraphCoordinate( $boundings->x0 + ( $boundings->x1 - $boundings->x0 ) / 2, $boundings->y0 ), new ezcGraphCoordinate( $boundings->x1, $boundings->y0 + ( $boundings->y1 - $boundings->y0 ) / 2 ), new ezcGraphCoordinate( $boundings->x0 + ( $boundings->x1 - $boundings->x0 ) / 2, $boundings->y1 ), new ezcGraphCoordinate( $boundings->x0, $boundings->y0 + ( $boundings->y1 - $boundings->y0 ) / 2 ), ), $color, true ); // Draw optional gleam if ( $this->options->legendSymbolGleam !== false ) { $return = $this->driver->drawPolygon( array( new ezcGraphCoordinate( $boundings->x0 + ( $boundings->x1 - $boundings->x0 ) / 2, $boundings->y0 + ( $boundings->y1 - $boundings->y0 ) * $this->options->legendSymbolGleamSize ), new ezcGraphCoordinate( $boundings->x1 - ( $boundings->x1 - $boundings->x0 ) * $this->options->legendSymbolGleamSize, $boundings->y0 + ( $boundings->y1 - $boundings->y0 ) / 2 ), new ezcGraphCoordinate( $boundings->x0 + ( $boundings->x1 - $boundings->x0 ) / 2, $boundings->y1 - ( $boundings->y1 - $boundings->y0 ) * $this->options->legendSymbolGleamSize ), new ezcGraphCoordinate( $boundings->x0 + ( $boundings->x1 - $boundings->x0 ) * $this->options->legendSymbolGleamSize, $boundings->y0 + ( $boundings->y1 - $boundings->y0 ) / 2 ), ), new ezcGraphLinearGradient( new ezcGraphCoordinate( $boundings->x0 + ( $boundings->x1 - $boundings->x0 ) * 0.353553391, $boundings->y0 + ( $boundings->y1 - $boundings->y0 ) * 0.353553391 ), new ezcGraphCoordinate( $boundings->x0 + ( $boundings->x1 - $boundings->x0 ) * ( 1 - 0.353553391 ), $boundings->y0 + ( $boundings->y1 - $boundings->y0 ) * ( 1 - 0.353553391 ) ), $color->darken( -$this->options->legendSymbolGleam ), $color->darken( $this->options->legendSymbolGleam ) ), true ); } return $return; case ezcGraph::BULLET: $return = $this->driver->drawCircle( new ezcGraphCoordinate( $boundings->x0 + ( $boundings->x1 - $boundings->x0 ) / 2, $boundings->y0 + ( $boundings->y1 - $boundings->y0 ) / 2 ), $boundings->x1 - $boundings->x0, $boundings->y1 - $boundings->y0, $color, true ); // Draw optional gleam if ( $this->options->legendSymbolGleam !== false ) { $return = $this->driver->drawCircle( new ezcGraphCoordinate( $boundings->x0 + ( $boundings->x1 - $boundings->x0 ) / 2, $boundings->y0 + ( $boundings->y1 - $boundings->y0 ) / 2 ), ( $boundings->x1 - $boundings->x0 ) * $this->options->legendSymbolGleamSize, ( $boundings->y1 - $boundings->y0 ) * $this->options->legendSymbolGleamSize, new ezcGraphLinearGradient( new ezcGraphCoordinate( $boundings->x0 + ( $boundings->x1 - $boundings->x0 ) * 0.292893219, $boundings->y0 + ( $boundings->y1 - $boundings->y0 ) * 0.292893219 ), new ezcGraphCoordinate( $boundings->x0 + ( $boundings->x1 - $boundings->x0 ) * 0.707106781, $boundings->y0 + ( $boundings->y1 - $boundings->y0 ) * 0.707106781 ), $color->darken( -$this->options->legendSymbolGleam ), $color->darken( $this->options->legendSymbolGleam ) ), true ); } return $return; case ezcGraph::CIRCLE: return $this->driver->drawCircle( new ezcGraphCoordinate( $boundings->x0 + ( $boundings->x1 - $boundings->x0 ) / 2, $boundings->y0 + ( $boundings->y1 - $boundings->y0 ) / 2 ), $boundings->x1 - $boundings->x0, $boundings->y1 - $boundings->y0, $color, false ); } } /** * Finish rendering * * Method is called before the final image is renderer, so that finishing * operations can be performed here. * * @return void */ abstract protected function finish(); /** * Reset renderer properties * * Reset all renderer properties, which were calculated during the * rendering process, to offer a clean environment for rerendering. * * @return void */ protected function resetRenderer() { $this->xAxisSpace = false; $this->yAxisSpace = false; // Reset driver, maintaining its configuration $driverClass = get_class( $this->driver ); $driverOptions = $this->driver->options; $this->driver = new $driverClass(); $this->driver->options = $driverOptions; } /** * Finally renders the image * * @param string $file Filename of destination file * @return void */ public function render( $file = null ) { $this->finish(); if ( $file === null ) { $this->driver->renderToOutput(); } else { $this->driver->render( $file ); } $this->resetRenderer(); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/interfaces/stacked_bar_renderer.php000066400000000000000000000024221226600447100277270ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/math/000077500000000000000000000000001226600447100216745ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/math/boundings.php000066400000000000000000000047141226600447100244030ustar00rootroot00000000000000x0 = $x0; $this->y0 = $y0; $this->x1 = $x1; $this->y1 = $y1; // Switch values to ensure correct order if ( $this->x0 > $this->x1 ) { $tmp = $this->x0; $this->x0 = $this->x1; $this->x1 = $tmp; } if ( $this->y0 > $this->y1 ) { $tmp = $this->y0; $this->y0 = $this->y1; $this->y1 = $tmp; } } /** * Getter for calculated values depending on the boundings. * - 'width': Width of bounding recangle * - 'height': Height of bounding recangle * * @param string $name Name of property to get * @return mixed Calculated value */ public function __get( $name ) { switch ( $name ) { case 'width': return $this->x1 - $this->x0; case 'height': return $this->y1 - $this->y0; default: throw new ezcBasePropertyNotFoundException( $name ); } } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/math/matrix.php000066400000000000000000000331601226600447100237140ustar00rootroot00000000000000rows = max( 1, (int) $rows ); $this->columns = max( 1, (int) $columns ); if ( $values !== null ) { $this->fromArray( $values ); } else { $this->init(); } } /** * Create matrix from array * * Use an array with float values to set matrix values. * * @param array $values Array with values * @return ezcGraphMatrix Modified matrix */ public function fromArray( array $values ) { for ( $i = 0; $i < $this->rows; ++$i ) { for ( $j = 0; $j < $this->columns; ++$j ) { $this->matrix[$i][$j] = ( isset( $values[$i][$j] ) ? (float) $values[$i][$j] : 0 ); } } return $this; } /** * Init matrix * * Sets matrix to identity matrix. * * @return ezcGraphMatrix Modified matrix */ public function init() { for ( $i = 0; $i < $this->rows; ++$i ) { for ( $j = 0; $j < $this->columns; ++$j ) { $this->matrix[$i][$j] = ( $i === $j ? 1 : 0 ); } } return $this; } /** * Returns number of rows * * @return int Number of rows */ public function rows() { return $this->rows; } /** * Returns number of columns * * @return int Number of columns */ public function columns() { return $this->columns; } /** * Get a single matrix value * * Returns the value of the matrix at the given position * * @param int $i Column * @param int $j Row * @return float Matrix value */ public function get( $i, $j ) { if ( ( $i < 0 ) || ( $i >= $this->rows ) || ( $j < 0 ) || ( $j >= $this->columns ) ) { throw new ezcGraphMatrixOutOfBoundingsException( $this->rows, $this->columns, $i, $j ); } return ( !isset( $this->matrix[$i][$j] ) ? .0 : $this->matrix[$i][$j] ); } /** * Set a single matrix value * * Sets the value of the matrix at the given position. * * @param int $i Column * @param int $j Row * @param float $value Value * @return ezcGraphMatrix Updated matrix */ public function set( $i, $j, $value ) { if ( ( $i < 0 ) || ( $i >= $this->rows ) || ( $j < 0 ) || ( $j >= $this->columns ) ) { throw new ezcGraphMatrixOutOfBoundingsException( $this->rows, $this->columns, $i, $j ); } $this->matrix[$i][$j] = $value; return $this; } /** * Adds one matrix to the current one * * Calculate the sum of two matrices and returns the resulting matrix. * * @param ezcGraphMatrix $matrix Matrix to sum with * @return ezcGraphMatrix Result matrix */ public function add( ezcGraphMatrix $matrix ) { if ( ( $this->rows !== $matrix->rows() ) || ( $this->columns !== $matrix->columns() ) ) { throw new ezcGraphMatrixInvalidDimensionsException( $this->rows, $this->columns, $matrix->rows(), $matrix->columns() ); } for ( $i = 0; $i < $this->rows; ++$i ) { for ( $j = 0; $j < $this->columns; ++$j ) { $this->matrix[$i][$j] += $matrix->get( $i, $j ); } } return $this; } /** * Subtracts matrix from current one * * Calculate the diffenrence of two matices and returns the result matrix. * * @param ezcGraphMatrix $matrix subtrahend * @return ezcGraphMatrix Result matrix */ public function diff( ezcGraphMatrix $matrix ) { if ( ( $this->rows !== $matrix->rows() ) || ( $this->columns !== $matrix->columns() ) ) { throw new ezcGraphMatrixInvalidDimensionsException( $this->rows, $this->columns, $matrix->rows(), $matrix->columns() ); } for ( $i = 0; $i < $this->rows; ++$i ) { for ( $j = 0; $j < $this->columns; ++$j ) { $this->matrix[$i][$j] -= $matrix->get( $i, $j ); } } return $this; } /** * Scalar multiplication * * Multiplies matrix with the given scalar and returns the result matrix * * @param float $scalar Scalar * @return ezcGraphMatrix Result matrix */ public function scalar( $scalar ) { $scalar = (float) $scalar; for ( $i = 0; $i < $this->rows; ++$i ) { for ( $j = 0; $j < $this->columns; ++$j ) { $this->matrix[$i][$j] *= $scalar; } } } /** * Transpose matrix * * @return ezcGraphMatrix Transposed matrix */ public function transpose() { $matrix = clone $this; $this->rows = $matrix->columns(); $this->columns = $matrix->rows(); $this->matrix = array(); for ( $i = 0; $i < $this->rows; ++$i ) { for ( $j = 0; $j < $this->columns; ++$j ) { $this->matrix[$i][$j] = $matrix->get( $j, $i ); } } return $this; } /** * Multiplies two matrices * * Multiply current matrix with another matrix and returns the result * matrix. * * @param ezcGraphMatrix $matrix Second factor * @return ezcGraphMatrix Result matrix */ public function multiply( ezcGraphMatrix $matrix ) { $mColumns = $matrix->columns(); if ( $this->columns !== ( $mRows = $matrix->rows() ) ) { throw new ezcGraphMatrixInvalidDimensionsException( $this->columns, $this->rows, $mColumns, $mRows ); } $result = new ezcGraphMatrix( $this->rows, $mColumns ); for ( $i = 0; $i < $this->rows; ++$i ) { for ( $j = 0; $j < $mColumns; ++$j ) { $sum = 0; for ( $k = 0; $k < $mRows; ++$k ) { $sum += $this->matrix[$i][$k] * $matrix->get( $k, $j ); } $result->set( $i, $j, $sum ); } } return $result; } /** * Solve nonlinear equatation * * Tries to solve equatation given by two matrices, with assumption, that: * A * x = B * where $this is A, and the paramenter B. x is cosnidered as a vector * x = ( x^n, x^(n-1), ..., x^2, x, 1 ) * * Will return a polynomial solution for x. * * See: http://en.wikipedia.org/wiki/Gauss-Newton_algorithm * * @param ezcGraphMatrix $matrix B * @return ezcGraphPolygon Solution of equatation */ public function solveNonlinearEquatation( ezcGraphMatrix $matrix ) { // Build complete equatation $equatation = new ezcGraphMatrix( $this->rows, $columns = ( $this->columns + 1 ) ); for ( $i = 0; $i < $this->rows; ++$i ) { for ( $j = 0; $j < $this->columns; ++$j ) { $equatation->set( $i, $j, $this->matrix[$i][$j] ); } $equatation->set( $i, $this->columns, $matrix->get( $i, 0 ) ); } // Compute upper triangular matrix on left side of equatation for ( $i = 0; $i < ( $this->rows - 1 ); ++$i ) { for ( $j = $i + 1; $j < $this->rows; ++$j ) { if ( $equatation->get( $j, $i ) !== 0 ) { if ( $equatation->get( $j, $i ) == 0 ) { continue; } else { $factor = -( $equatation->get( $i, $i ) / $equatation->get( $j, $i ) ); } for ( $k = $i; $k < $columns; ++$k ) { $equatation->set( $j, $k, $equatation->get( $i, $k ) + $factor * $equatation->get( $j, $k ) ); } } } } // Normalize values on left side matrix diagonale for ( $i = 0; $i < $this->rows; ++$i ) { if ( ( ( $value = $equatation->get( $i, $i ) ) != 1 ) && ( $value != 0 ) ) { $factor = 1 / $value; for ( $k = $i; $k < $columns; ++$k ) { $equatation->set( $i, $k, $equatation->get( $i, $k ) * $factor ); } } } // Build up solving polynom $polynom = new ezcGraphPolynom(); for ( $i = ( $this->rows - 1 ); $i >= 0; --$i ) { for ( $j = $i + 1; $j < $this->columns; ++$j ) { $equatation->set( $i, $this->columns, $equatation->get( $i, $this->columns ) + ( -$equatation->get( $i, $j ) * $polynom->get( $j ) ) ); $equatation->set( $i, $j, 0 ); } $polynom->set( $i, $equatation->get( $i, $this->columns ) ); } return $polynom; } /** * Build LR decomposition from matrix * * Use Cholesky-Crout algorithm to get LR decomposition of the current * matrix. * * Will return an array with two matrices: * array( * 'l' => (ezcGraphMatrix) $left, * 'r' => (ezcGraphMatrix) $right, * ) * * @return array( ezcGraphMatrix ) */ public function LRdecomposition() { /** * Use Cholesky-Crout algorithm to get LR decomposition * * Input: Matrix A ($this) * * For i = 1 To n * For j = i To n * R(i,j)=A(i,j) * For k = 1 TO i-1 * R(i,j)-=L(i,k)*R(k,j) * end * end * For j=i+1 To n * L(j,i)= A(j,i) * For k = 1 TO i-1 * L(j,i)-=L(j,k)*R(k,i) * end * L(j,i)/=R(i,i) * end * end * * Output: matrices L,R */ $l = new ezcGraphMatrix( $this->columns, $this->rows ); $r = new ezcGraphMatrix( $this->columns, $this->rows ); for ( $i = 0; $i < $this->columns; ++$i ) { for ( $j = $i; $j < $this->rows; ++$j ) { $r->set( $i, $j, $this->matrix[$i][$j] ); for ( $k = 0; $k <= ( $i - 1 ); ++$k ) { $r->set( $i, $j, $r->get( $i, $j ) - $l->get( $i, $k ) * $r->get( $k, $j ) ); } } for ( $j = $i + 1; $j < $this->rows; ++$j ) { $l->set( $j, $i, $this->matrix[$j][$i] ); for ( $k = 0; $k <= ( $i - 1 ); ++$k ) { $l->set( $j, $i, $l->get( $j, $i ) - $l->get( $j, $k ) * $r->get( $k, $i ) ); } $l->set( $j, $i, $l->get( $j, $i ) / $r->get( $i, $i ) ); } } return array( 'l' => $l, 'r' => $r, ); } /** * Returns a string representation of the matrix * * @return string */ public function __toString() { $string = sprintf( "%d x %d matrix:\n", $this->rows, $this->columns ); for ( $i = 0; $i < $this->rows; ++$i ) { $string .= '| '; for ( $j = 0; $j < $this->columns; ++$j ) { $string .= sprintf( '%04.2f ', $this->get( $i, $j ) ); } $string .= "|\n"; } return $string; } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/math/polynom.php000066400000000000000000000145021226600447100241040ustar00rootroot00000000000000 * // Equivalent to: x^2 + .5 * $polynom = new ezcGraphPolynom( array( 2 => 1, 0 => .5 ) ); * * // Calculate result for x = 1, echos: 1.5 * echo $polynom->evaluate( 1 ), PHP_EOL; * * // Build the sum with another polynom * $polynom->add( new ezcGraphPolynom( array( 1 => 1 ) ) ); * * // Print polynom, echos: * // x^2 + x + 5.00e-1 * echo $polynom, PHP_EOL; * * * @version 1.5 * @package Graph */ class ezcGraphPolynom { /** * Factors of the polynom * * An example: * Polynom: * 2 * x^3 + .5 * x - 3 * Array: * array ( * (int) 3 => (float) 2, * (int) 1 => (float) .5, * (int) 0 => (float) -3, * ) * * @var array */ protected $values; // @TODO: Introduce precision option for string output? /** * Constructor * * Constructs a polynom object from given array, where the key is the * exponent and the value the factor. * An example: * Polynom: * 2 * x^3 + .5 * x - 3 * Array: * array ( * (int) 3 => (float) 2, * (int) 1 => (float) .5, * (int) 0 => (float) -3, * ) * * @param array $values Array with values * @return ezcGraphPolynom */ public function __construct( array $values = array() ) { foreach ( $values as $exponent => $factor ) { $this->values[(int) $exponent] = (float) $factor; } } /** * Initialise a polygon * * Initialise a polygon of the given order. Sets all factors to 0. * * @param int $order Order of polygon * @return ezcGraphPolynom Created polynom */ public function init( $order ) { for ( $i = 0; $i <= $order; ++$i ) { $this->values[$i] = 0; } return $this; } /** * Return factor for one exponent * * @param int $exponent Exponent * @return float Factor */ public function get( $exponent ) { if ( !isset( $this->values[$exponent] ) ) { return 0; } else { return $this->values[$exponent]; } } /** * Set the factor for one exponent * * @param int $exponent Exponent * @param float $factor Factor * @return ezcGraphPolynom Modified polynom */ public function set( $exponent, $factor ) { $this->values[(int) $exponent] = (float) $factor; return $this; } /** * Returns the order of the polynom * * @return int Polynom order */ public function getOrder() { return max( array_keys( $this->values ) ); } /** * Adds polynom to current polynom * * @param ezcGraphPolynom $polynom Polynom to add * @return ezcGraphPolynom Modified polynom */ public function add( ezcGraphPolynom $polynom ) { $order = max( $this->getOrder(), $polynom->getOrder() ); for ( $i = 0; $i <= $order; ++$i ) { $this->set( $i, $this->get( $i ) + $polynom->get( $i ) ); } return $this; } /** * Evaluate Polynom with a given value * * @param float $x Value * @return float Result */ public function evaluate( $x ) { $value = 0; foreach ( $this->values as $exponent => $factor ) { $value += $factor * pow( $x, $exponent ); } return $value; } /** * Returns a string represenation of the polynom * * @return string String representation of polynom */ public function __toString() { krsort( $this->values ); $string = ''; foreach ( $this->values as $exponent => $factor ) { if ( $factor == 0 ) { continue; } $string .= ( $factor < 0 ? ' - ' : ' + ' ); $factor = abs( $factor ); switch ( true ) { case abs( 1 - $factor ) < .0001: // No not append, if factor is ~1 break; case $factor < 1: case $factor >= 1000: $string .= sprintf( '%.2e ', $factor ); break; case $factor >= 100: $string .= sprintf( '%.0f ', $factor ); break; case $factor >= 10: $string .= sprintf( '%.1f ', $factor ); break; default: $string .= sprintf( '%.2f ', $factor ); break; } switch ( true ) { case $exponent > 1: $string .= sprintf( 'x^%d', $exponent ); break; case $exponent === 1: $string .= 'x'; break; case $exponent === 0: if ( abs( 1 - $factor ) < .0001 ) { $string .= '1'; } break; } } if ( substr( $string, 0, 3 ) === ' + ' ) { $string = substr( $string, 3 ); } else { $string = '-' . substr( $string, 3 ); } return trim( $string ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/math/rotation.php000066400000000000000000000050211226600447100242420ustar00rootroot00000000000000rotation = (float) $rotation; if ( $center === null ) { $this->center = new ezcGraphCoordinate( 0, 0 ); $clockwiseRotation = deg2rad( $rotation ); $rotationMatrixArray = array( array( cos( $clockwiseRotation ), -sin( $clockwiseRotation ), 0 ), array( sin( $clockwiseRotation ), cos( $clockwiseRotation ), 0 ), array( 0, 0, 1 ), ); return parent::__construct( $rotationMatrixArray ); } parent::__construct(); $this->center = $center; $this->multiply( new ezcGraphTranslation( $center->x, $center->y ) ); $this->multiply( new ezcGraphRotation( $rotation ) ); $this->multiply( new ezcGraphTranslation( -$center->x, -$center->y ) ); } /** * Return rotaion angle in degrees * * @return float */ public function getRotation() { return $this->rotation; } /** * Return the center point of the current rotation * * @return ezcGraphCoordinate */ public function getCenter() { return $this->center; } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/math/transformation.php000066400000000000000000000054511226600447100254600ustar00rootroot00000000000000columns(); // We want to ensure, that the matrix stays 3x3 if ( ( $this->columns !== $matrix->rows() ) && ( $this->rows !== $mColumns ) ) { throw new ezcGraphMatrixInvalidDimensionsException( $this->columns, $this->rows, $mColumns, $matrix->rows() ); } $result = parent::multiply( $matrix ); // The matrix dimensions stay the same, so that we can modify $this. for ( $i = 0; $i < $this->rows; ++$i ) { for ( $j = 0; $j < $mColumns; ++$j ) { $this->set( $i, $j, $result->get( $i, $j ) ); } } return $this; } /** * Transform a coordinate with the current transformation matrix. * * @param ezcGraphCoordinate $coordinate * @return ezcGraphCoordinate */ public function transformCoordinate( ezcGraphCoordinate $coordinate ) { $vector = new ezcGraphMatrix( 3, 1, array( array( $coordinate->x ), array( $coordinate->y ), array( 1 ) ) ); $vector = parent::multiply( $vector ); return new ezcGraphCoordinate( $vector->get( 0, 0 ), $vector->get( 1, 0 ) ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/math/translation.php000066400000000000000000000022661226600447100247510ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/math/vector.php000066400000000000000000000101531226600447100237070ustar00rootroot00000000000000x; $this->x = $this->y; $this->y = -$tmp; return $this; } /** * Rotates vector to the right by 90 degrees * * @return void */ public function rotateClockwise() { $tmp = $this->x; $this->x = -$this->y; $this->y = $tmp; return $this; } /** * Unifies vector length to 1 * * @return void */ public function unify() { $length = $this->length(); if ( $length == 0 ) { return $this; } $this->x /= $length; $this->y /= $length; return $this; } /** * Returns length of vector * * @return float */ public function length() { return sqrt( pow( $this->x, 2 ) + pow( $this->y, 2 ) ); } /** * Multiplies vector with a scalar * * @param float $value * @return void */ public function scalar( $value ) { $this->x *= $value; $this->y *= $value; return $this; } /** * Calculates scalar product of two vectors * * @param ezcGraphCoordinate $vector * @return void */ public function mul( ezcGraphCoordinate $vector ) { return $this->x * $vector->x + $this->y * $vector->y; } /** * Returns the angle between two vectors in radian * * @param ezcGraphCoordinate $vector * @return float */ public function angle( ezcGraphCoordinate $vector ) { if ( !$vector instanceof ezcGraphVector ) { // Ensure beeing a vector for calling length() $vector = ezcGraphVector::fromCoordinate( $vector ); } $factor = $this->length() * $vector->length(); if ( $factor == 0 ) { return false; } else { return acos( $this->mul( $vector ) / $factor ); } } /** * Adds a vector to another vector * * @param ezcGraphCoordinate $vector * @return void */ public function add( ezcGraphCoordinate $vector ) { $this->x += $vector->x; $this->y += $vector->y; return $this; } /** * Subtracts a vector from another vector * * @param ezcGraphCoordinate $vector * @return void */ public function sub( ezcGraphCoordinate $vector ) { $this->x -= $vector->x; $this->y -= $vector->y; return $this; } /** * Creates a vector from a coordinate object * * @param ezcGraphCoordinate $coordinate * @return ezcGraphVector */ public static function fromCoordinate( ezcGraphCoordinate $coordinate ) { return new ezcGraphVector( $coordinate->x, $coordinate->y ); } /** * Transform vector using transformation matrix * * @param ezcGraphTransformation $transformation * @return ezcGraphVector */ public function transform( ezcGraphTransformation $transformation ) { $result = $transformation->transformCoordinate( $this ); $this->x = $result->x; $this->y = $result->y; return $this; } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/options/000077500000000000000000000000001226600447100224365ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/options/cairo_driver.php000066400000000000000000000054721226600447100256270ustar00rootroot00000000000000 * $graph = new ezcGraphPieChart(); * $graph->background->color = '#FFFFFFFF'; * $graph->title = 'Access statistics'; * $graph->legend = false; * * $graph->data['Access statistics'] = new ezcGraphArrayDataSet( array( * 'Mozilla' => 19113, * 'Explorer' => 10917, * 'Opera' => 1464, * 'Safari' => 652, * 'Konqueror' => 474, * ) ); * * $graph->driver = new ezcGraphCairoDriver(); * * // No options yet. * * $graph->render( 400, 200, 'tutorial_driver_cairo.png' ); * * * @property float $imageMapResolution * Degree step used to interpolate round image primitives by * polygons for image maps * @property float $circleResolution * Resolution for circles, until I understand how to draw ellipses * with SWFShape::curveTo() * * @version 1.5 * @package Graph */ class ezcGraphCairoDriverOptions extends ezcGraphDriverOptions { /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->properties['imageMapResolution'] = 10; $this->properties['circleResolution'] = 2.; parent::__construct( $options ); } /** * Set an option value * * @param string $propertyName * @param mixed $propertyValue * @throws ezcBasePropertyNotFoundException * If a property is not defined in this class * @return void * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'imageMapResolution': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 1' ); } $this->properties['imageMapResolution'] = (int) $propertyValue; break; case 'circleResolution': if ( !is_numeric( $propertyValue ) || ( $propertyValue <= 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'float > 0' ); } $this->properties['circleResolution'] = (float) $propertyValue; break; default: parent::__set( $propertyName, $propertyValue ); break; } } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/options/chart.php000066400000000000000000000057001226600447100242520ustar00rootroot00000000000000 * $graph = new ezcGraphPieChart(); * $graph->palette = new ezcGraphPaletteEzBlue(); * $graph->title = 'Access statistics'; * * // Global font options * $graph->options->font->name = 'serif'; * * // Special font options for sub elements * $graph->title->background = '#EEEEEC'; * $graph->title->font->name = 'sans-serif'; * * $graph->options->font->maxFontSize = 8; * * $graph->data['Access statistics'] = new ezcGraphArrayDataSet( array( * 'Mozilla' => 19113, * 'Explorer' => 10917, * 'Opera' => 1464, * 'Safari' => 652, * 'Konqueror' => 474, * ) ); * * $graph->render( 400, 150, 'tutorial_chart_title.svg' ); * * * @property int $width * Width of the chart. * @property int $height * Height of the chart. * @property ezcGraphFontOptions $font * Font used in the graph. * * @version 1.5 * @package Graph */ class ezcGraphChartOptions extends ezcBaseOptions { /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->properties['width'] = null; $this->properties['height'] = null; $this->properties['font'] = new ezcGraphFontOptions(); parent::__construct( $options ); } /** * Set an option value * * @param string $propertyName * @param mixed $propertyValue * @throws ezcBasePropertyNotFoundException * If a property is not defined in this class * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'width': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 1' ); } $this->properties['width'] = (int) $propertyValue; break; case 'height': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 1' ); } $this->properties['height'] = (int) $propertyValue; break; case 'font': $this->properties['font']->path = $propertyValue; break; default: throw new ezcBasePropertyNotFoundException( $propertyName ); break; } } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/options/driver.php000066400000000000000000000136701226600447100244510ustar00rootroot00000000000000 * require_once 'tutorial_autoload.php'; * * $graph = new ezcGraphPieChart(); * $graph->palette = new ezcGraphPaletteEzBlue(); * $graph->title = 'Access statistics'; * * $graph->data['Access statistics'] = new ezcGraphArrayDataSet( array( * 'Mozilla' => 19113, * 'Explorer' => 10917, * 'Opera' => 1464, * 'Safari' => 652, * 'Konqueror' => 474, * ) ); * * // Do not shorten strings automatically if they do not fit in the assigned * // space with the minimum font size. * $graph->driver->options->autoShortenString = false; * * $graph->render( 400, 150, 'tutorial_chart_title.svg' ); * * * @property int $width * Width of the chart. * @property int $height * Height of the chart. * @property float $shadeCircularArc * Percent to darken circular arcs at the sides * @property float $lineSpacing * Percent of font size used for line spacing * @property int $font * Font used in the graph. * @property bool $autoShortenString * Automatically shorten string if it do not fit into the available * space, even with the minimum font size used. Deactivating this * setting will result in ezcGraphFontRenderingException exceptions, * informing you about the actual string which did not fit. * @property string $autoShortenStringPostFix * String to append to shortened strings, if there is enough space * left for the postfix. * * @version 1.5 * @package Graph */ abstract class ezcGraphDriverOptions extends ezcBaseOptions { /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->properties['width'] = null; $this->properties['height'] = null; $this->properties['lineSpacing'] = .1; $this->properties['shadeCircularArc'] = .5; $this->properties['font'] = new ezcGraphFontOptions(); $this->properties['font']->color = ezcGraphColor::fromHex( '#000000' ); $this->properties['autoShortenString'] = true; $this->properties['autoShortenStringPostFix'] = '..'; parent::__construct( $options ); } /** * Set an option value * * @param string $propertyName * @param mixed $propertyValue * @throws ezcBasePropertyNotFoundException * If a property is not defined in this class * @return void */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'width': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 1' ); } $this->properties['width'] = (int) $propertyValue; break; case 'height': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 1' ); } $this->properties['height'] = (int) $propertyValue; break; case 'lineSpacing': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) || ( $propertyValue > 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, '0 <= float <= 1' ); } $this->properties['lineSpacing'] = (float) $propertyValue; break; case 'shadeCircularArc': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) || ( $propertyValue > 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, '0 <= float <= 1' ); } $this->properties['shadeCircularArc'] = (float) $propertyValue; break; case 'font': if ( $propertyValue instanceof ezcGraphFontOptions ) { $this->properties['font'] = $propertyValue; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphFontOptions' ); } break; case 'autoShortenString': if ( is_bool( $propertyValue ) ) { $this->properties['autoShortenString'] = $propertyValue; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, 'boolean' ); } break; case 'autoShortenStringPostFix': $this->properties['autoShortenStringPostFix'] = (string) $propertyValue; break; default: throw new ezcBasePropertyNotFoundException( $propertyName ); break; } } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/options/flash_driver.php000066400000000000000000000062421226600447100256230ustar00rootroot00000000000000 * $graph = new ezcGraphPieChart(); * $graph->title = 'Access statistics'; * $graph->legend = false; * * $graph->driver = new ezcGraphFlashDriver(); * $graph->driver->options->compresion = 0; * * $graph->options->font = 'tutorial_font.fdb'; * * $graph->driver->options->compression = 7; * * $graph->data['Access statistics'] = new ezcGraphArrayDataSet( array( * 'Mozilla' => 19113, * 'Explorer' => 10917, * 'Opera' => 1464, * 'Safari' => 652, * 'Konqueror' => 474, * ) ); * * $graph->render( 400, 200, 'tutorial_driver_flash.swf' ); * * * @property int $compression * Compression level used for generated flash file * @see http://php.net/manual/en/function.swfmovie.save.php * @property float $circleResolution * Resolution for circles, until I understand how to draw ellipses * with SWFShape::curveTo() * * @version 1.5 * @package Graph */ class ezcGraphFlashDriverOptions extends ezcGraphDriverOptions { /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->properties['compression'] = 9; $this->properties['circleResolution'] = 2.; parent::__construct( $options ); } /** * Set an option value * * @param string $propertyName * @param mixed $propertyValue * @throws ezcBasePropertyNotFoundException * If a property is not defined in this class * @return void * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'compression': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) || ( $propertyValue > 9 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, '0 <= int <= 9' ); } $this->properties['compression'] = max( 0, min( 9, (int) $propertyValue ) ); break; case 'circleResolution': if ( !is_numeric( $propertyValue ) || ( $propertyValue <= 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'float > 0' ); } $this->properties['circleResolution'] = (float) $propertyValue; break; default: parent::__set( $propertyName, $propertyValue ); break; } } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/options/font.php000066400000000000000000000267341226600447100241310ustar00rootroot00000000000000options->font. This takes effect on all chart * elements unless you intentionally access the font configuration of an * individual chart element. The following example shows, how this works. * * * $graph = new ezcGraphPieChart(); * $graph->title = 'Access statistics'; * * // Set the maximum font size to 8 for all chart elements * $graph->options->font->maxFontSize = 8; * * // Set the font size for the title independently to 14 * $graph->title->font->maxFontSize = 14; * * // The following only affects all elements except the // title element, * // which now has its own font configuration. * // * // Keep in mind that the specified font is driver specific. A pure name * // works for the SVG driver, used here. The GD driver for example * // requires a path to a TTF file. * $graph->options->font->name = 'serif'; * * $graph->data['Access statistics'] = new ezcGraphArrayDataSet( array( * 'Mozilla' => 19113, * 'Explorer' => 10917, * 'Opera' => 1464, * 'Safari' => 652, * 'Konqueror' => 474, * ) ); * * * @property string $name * Name of font. * @property string $path * Path to font file. * @property int $type * Type of used font. May be one of the following: * - TTF_FONT Native TTF fonts * - PS_FONT PostScript Type1 fonts * - FT2_FONT FreeType 2 fonts * The type is normally automatically detected when you set the path * to the font file. * @property float $minFontSize * Minimum font size for displayed texts. * @property float $maxFontSize * Maximum font size for displayed texts. * @property float $minimalUsedFont * The minimal used font size for the current element group. This * property is set by the driver to maintain this information and * should not be used to configure the apperance of the chart. See * $minFontSize instead. * @property ezcGraphColor $color * Font color. * @property ezcGraphColor $background * Background color. The actual area filled with the background color * is influenced by the settings $padding and $minimizeBorder. * @property ezcGraphColor $border * Border color for the text. The distance between the text and * border is defined by the properties $padding and $minimizeBorder. * @property int $borderWidth * With of the border. To enable the border you need to set the * $border property to some color. * @property int $padding * Padding between text and border. * @property bool $minimizeBorder * Fit the border exactly around the text, or use the complete * possible space. This setting is only relevant, when a border * color has been set for the font. * @property bool $textShadow * Draw shadow for texts. The color of the shadow is defined in * the property $textShadowColor. * @property int $textShadowOffset * Offset for text shadow. This defines the distance the shadow * is moved to the bottom left relative from the text position. * @property ezcGraphColor $textShadowColor * Color of text shadow. If left at the default value "false"" * the inverse color of the text color will be used. * * @version 1.5 * @package Graph */ class ezcGraphFontOptions extends ezcBaseOptions { /** * Indicates if path already has been checked for correct font * * @var bool */ protected $pathChecked = false; /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->properties['name'] = 'sans-serif'; // $this->properties['path'] = 'Graph/tests/data/font.ttf'; $this->properties['path'] = ''; $this->properties['type'] = ezcGraph::TTF_FONT; $this->properties['minFontSize'] = 6; $this->properties['maxFontSize'] = 96; $this->properties['minimalUsedFont'] = 96; $this->properties['color'] = ezcGraphColor::fromHex( '#000000' ); $this->properties['background'] = false; $this->properties['border'] = false; $this->properties['borderWidth'] = 1; $this->properties['padding'] = 0; $this->properties['minimizeBorder'] = true; $this->properties['textShadow'] = false; $this->properties['textShadowOffset'] = 1; $this->properties['textShadowColor'] = false; parent::__construct( $options ); } /** * Set an option value * * @param string $propertyName * @param mixed $propertyValue * @throws ezcBasePropertyNotFoundException * If a property is not defined in this class * @return void */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'minFontSize': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'float > 1' ); } // Ensure min font size is smaller or equal max font size. if ( $propertyValue > $this->properties['maxFontSize'] ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'float <= ' . $this->properties['maxFontSize'] ); } $this->properties[$propertyName] = (float) $propertyValue; break; case 'maxFontSize': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'float > 1' ); } // Ensure max font size is greater or equal min font size. if ( $propertyValue < $this->properties['minFontSize'] ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'float >= ' . $this->properties['minFontSize'] ); } $this->properties[$propertyName] = (float) $propertyValue; break; case 'minimalUsedFont': $propertyValue = (float) $propertyValue; if ( $propertyValue < $this->minimalUsedFont ) { $this->properties['minimalUsedFont'] = $propertyValue; } break; case 'color': case 'background': case 'border': case 'textShadowColor': $this->properties[$propertyName] = ezcGraphColor::create( $propertyValue ); break; case 'borderWidth': case 'padding': case 'textShadowOffset': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 0' ); } $this->properties[$propertyName] = (int) $propertyValue; break; case 'minimizeBorder': case 'textShadow': if ( !is_bool( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'bool' ); } $this->properties[$propertyName] = (bool) $propertyValue; break; case 'name': if ( is_string( $propertyValue ) ) { $this->properties['name'] = $propertyValue; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, 'string' ); } break; case 'path': if ( is_file( $propertyValue ) && is_readable( $propertyValue ) ) { $this->properties['path'] = $propertyValue; $parts = pathinfo( $this->properties['path'] ); switch ( strtolower( $parts['extension'] ) ) { case 'fdb': $this->properties['type'] = ezcGraph::PALM_FONT; break; case 'pfb': $this->properties['type'] = ezcGraph::PS_FONT; break; case 'ttf': $this->properties['type'] = ezcGraph::TTF_FONT; break; case 'svg': $this->properties['type'] = ezcGraph::SVG_FONT; $this->properties['name'] = ezcGraphSvgFont::getFontName( $propertyValue ); break; default: throw new ezcGraphUnknownFontTypeException( $propertyValue, $parts['extension'] ); } $this->pathChecked = true; } else { throw new ezcBaseFileNotFoundException( $propertyValue, 'font' ); } break; case 'type': if ( is_int( $propertyValue ) ) { $this->properties['type'] = $propertyValue; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int' ); } break; default: throw new ezcBasePropertyNotFoundException( $propertyName ); break; } } /** * __get * * @param mixed $propertyName * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return mixed * @ignore */ public function __get( $propertyName ) { switch ( $propertyName ) { case 'textShadowColor': // Use inverted font color if false if ( $this->properties['textShadowColor'] === false ) { $this->properties['textShadowColor'] = $this->properties['color']->invert(); } return $this->properties['textShadowColor']; case 'path': if ( $this->pathChecked === false ) { // Enforce call of path check $this->__set( 'path', $this->properties['path'] ); } // No break to use parent return default: return parent::__get( $propertyName ); } } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/options/gd_driver.php000066400000000000000000000143311226600447100251160ustar00rootroot00000000000000 * $graph = new ezcGraphPieChart(); * $graph->palette = new ezcGraphPaletteEzGreen(); * $graph->title = 'Access statistics'; * $graph->legend = false; * * $graph->driver = new ezcGraphGdDriver(); * $graph->options->font = 'tutorial_font.ttf'; * * // Generate a Jpeg with lower quality. The default settings result in a better * // quality image * $graph->driver->options->supersampling = 1; * $graph->driver->options->jpegQuality = 100; * $graph->driver->options->imageFormat = IMG_JPEG; * * $graph->data['Access statistics'] = new ezcGraphArrayDataSet( array( * 'Mozilla' => 19113, * 'Explorer' => 10917, * 'Opera' => 1464, * 'Safari' => 652, * 'Konqueror' => 474, * ) ); * * $graph->render( 400, 200, 'tutorial_dirver_gd.jpg' ); * * * @property int $imageFormat * Type of generated image. * Should be one of those: IMG_PNG, IMG_JPEG * @property int $jpegQuality * Quality of generated jpeg * @property int $detail * Count of degrees to render one polygon for in circular arcs * @property int $supersampling * Factor of supersampling used to simulate antialiasing * @property string $background * Background image to put the graph on * @property string $resampleFunction * Function used to resample / resize images * @property bool $forceNativeTTF * Force use of native ttf functions instead of free type 2 * @property float $imageMapResolution * Degree step used to interpolate round image primitives by * polygons for image maps * * @version 1.5 * @package Graph */ class ezcGraphGdDriverOptions extends ezcGraphDriverOptions { /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->properties['imageFormat'] = IMG_PNG; $this->properties['jpegQuality'] = 70; $this->properties['detail'] = 1; $this->properties['shadeCircularArc'] = .5; $this->properties['supersampling'] = 2; $this->properties['background'] = false; $this->properties['resampleFunction'] = 'imagecopyresampled'; $this->properties['forceNativeTTF'] = false; $this->properties['imageMapResolution'] = 10; parent::__construct( $options ); } /** * Set an option value * * @param string $propertyName * @param mixed $propertyValue * @throws ezcBasePropertyNotFoundException * If a property is not defined in this class * @return void */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'imageFormat': if ( imagetypes() & $propertyValue ) { $this->properties['imageFormat'] = (int) $propertyValue; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, 'Unsupported image type.' ); } break; case 'jpegQuality': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) || ( $propertyValue > 100 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, '0 <= int <= 100' ); } $this->properties['jpegQuality'] = (int) $propertyValue; break; case 'detail': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 1' ); } $this->properties['detail'] = (int) $propertyValue; break; case 'supersampling': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 1' ); } $this->properties['supersampling'] = (int) $propertyValue; break; case 'background': if ( $propertyValue === false || ( is_file( $propertyValue ) && is_readable( $propertyValue ) ) ) { $this->properties['background'] = realpath( $propertyValue ); } else { throw new ezcBaseValueException( $propertyName, $propertyValue, 'readable file' ); } break; case 'resampleFunction': if ( ezcBaseFeatures::hasFunction( $propertyValue ) ) { $this->properties['resampleFunction'] = $propertyValue; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, 'function' ); } break; case 'forceNativeTTF': if ( !is_bool( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'bool' ); } $this->properties['forceNativeTTF'] = (bool) $propertyValue; break; case 'imageMapResolution': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 1' ); } $this->properties['imageMapResolution'] = (int) $propertyValue; break; default: parent::__set( $propertyName, $propertyValue ); break; } } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/options/line_chart.php000066400000000000000000000166161226600447100252710ustar00rootroot00000000000000 * $graph = new ezcGraphLineChart(); * $graph->title = 'Wikipedia articles'; * * $graph->options->fillLines = 220; * $graph->options->lineThickness = 3; * * // Add data * foreach ( $wikidata as $language => $data ) * { * $graph->data[$language] = new ezcGraphArrayDataSet( $data ); * } * * $graph->render( 400, 150, 'tutorial_line_chart.svg' ); * * * @property float $lineThickness * Thickness of chart lines * @property mixed $fillLines * Status wheather the space between line and axis should get filled. * - FALSE to not fill the space at all. * - (int) Opacity used to fill up the space with the lines color. * @property int $symbolSize * Size of symbols in line chart. * @property ezcGraphFontOptions $highlightFont * Font configuration for highlight tests * @property int $highlightSize * Size of highlight blocks * @property bool $highlightLines * If true, it adds lines to highlight the values position on the * axis. * @property float $highlightXOffset * Horizontal offset for highlight strings, applied to all chart * highlight strings * @property float $highlightYOffset * Vertical offset for highlight strings, applied to all chart * highlight strings * @property true $stackBars * Stack bars * * @version 1.5 * @package Graph */ class ezcGraphLineChartOptions extends ezcGraphChartOptions { /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->properties['lineThickness'] = 1; $this->properties['fillLines'] = false; $this->properties['symbolSize'] = 8; $this->properties['highlightFont'] = new ezcGraphFontOptions(); $this->properties['highlightFontCloned'] = false; $this->properties['highlightSize'] = 14; $this->properties['highlightXOffset'] = 0; $this->properties['highlightYOffset'] = 0; $this->properties['highlightLines'] = false; $this->properties['stackBars'] = false; parent::__construct( $options ); } /** * Set an option value * * @param string $propertyName * @param mixed $propertyValue * @throws ezcBasePropertyNotFoundException * If a property is not defined in this class * @return void */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'lineThickness': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 0' ); } $this->properties[$propertyName] = (int) $propertyValue; break; case 'symbolSize': case 'highlightSize': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 1' ); } $this->properties[$propertyName] = (int) $propertyValue; break; case 'highlightXOffset': case 'highlightYOffset': if ( !is_numeric ( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int' ); } $this->properties[$propertyName] = (int) $propertyValue; break; case 'fillLines': if ( ( $propertyValue !== false ) && !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) || ( $propertyValue > 255 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'false OR 0 <= int <= 255' ); } $this->properties[$propertyName] = ( $propertyValue === false ? false : (int) $propertyValue ); break; case 'highlightFont': if ( $propertyValue instanceof ezcGraphFontOptions ) { $this->properties['highlightFont'] = $propertyValue; } elseif ( is_string( $propertyValue ) ) { if ( !$this->properties['highlightFontCloned'] ) { $this->properties['highlightFont'] = clone $this->font; $this->properties['highlightFontCloned'] = true; } $this->properties['highlightFont']->path = $propertyValue; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphFontOptions' ); } break; $this->properties['highlightSize'] = max( 1, (int) $propertyValue ); break; case 'highlightLines': if ( !is_bool( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'bool' ); } $this->properties['highlightLines'] = $propertyValue; break; case 'stackBars': if ( !is_bool( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'bool' ); } $this->properties['stackBars'] = $propertyValue; break; default: return parent::__set( $propertyName, $propertyValue ); } } /** * __get * * @param mixed $propertyName * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return mixed * @ignore */ public function __get( $propertyName ) { switch ( $propertyName ) { case 'highlightFont': // Clone font configuration when requested for this element if ( !$this->properties['highlightFontCloned'] ) { $this->properties['highlightFont'] = clone $this->properties['font']; $this->properties['highlightFontCloned'] = true; } return $this->properties['highlightFont']; default: return parent::__get( $propertyName ); } } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/options/odometer_chart.php000066400000000000000000000065151226600447100261550ustar00rootroot00000000000000 * $graph = new ezcGraphOdoMeterChart(); * * $graph->data['Test'] = new ezcGraphArrayDataSet( array( 0, 1, 23, 30 ) ); * * $graph->options->odometerHeight = .3; * $graph->options->borderColor = '#2e3436'; * * $graph->render( 150, 50, 'odometer.svg' ); * * * @property ezcGraphColor $borderColor * Color of border around odometer chart * @property int $borderWidth * Width of border around odometer chart * @property ezcGraphColor $startColor * Start color of grdient used as the odometer chart background. * @property ezcGraphColor $endColor * End color of grdient used as the odometer chart background. * @property int $markerWidth * Width of odometer markers * @property float $odometerHeight * Height consumed by odometer chart * * @version 1.5 * @package Graph */ class ezcGraphOdometerChartOptions extends ezcGraphChartOptions { /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->properties['borderColor'] = ezcGraphColor::create( '#000000' ); $this->properties['borderWidth'] = 0; $this->properties['startColor'] = ezcGraphColor::create( '#4e9a06A0' ); $this->properties['endColor'] = ezcGraphColor::create( '#A40000A0' ); $this->properties['markerWidth'] = 2; $this->properties['odometerHeight'] = 0.5; parent::__construct( $options ); } /** * Set an option value * * @param string $propertyName * @param mixed $propertyValue * @throws ezcBasePropertyNotFoundException * If a property is not defined in this class * @return void * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'borderWidth': case 'markerWidth': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 1' ); } $this->properties[$propertyName] = (int) $propertyValue; break; case 'borderColor': case 'startColor': case 'endColor': $this->properties[$propertyName] = ezcGraphColor::create( $propertyValue ); break; case 'odometerHeight': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) || ( $propertyValue > 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, '0 <= float <= 1' ); } $this->properties[$propertyName] = (float) $propertyValue; break; default: return parent::__set( $propertyName, $propertyValue ); } } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/options/pie_chart.php000066400000000000000000000116331226600447100251110ustar00rootroot00000000000000 * $graph = new ezcGraphPieChart(); * $graph->palette = new ezcGraphPaletteEzRed(); * $graph->title = 'Access statistics'; * $graph->legend = false; * * $graph->options->label = '%1$s (%3$.1f)'; * $graph->options->percentThreshold = .05; * * $graph->data['Access statistics'] = new ezcGraphArrayDataSet( array( * 'Mozilla' => 19113, * 'Explorer' => 10917, * 'Opera' => 1464, * 'Safari' => 652, * 'Konqueror' => 474, * ) ); * $graph->data['Access statistics']->highlight['Explorer'] = true; * * $graph->render( 400, 150, 'tutorial_pie_chart_options.svg' ); * * * @property string $label * String used to label pies * %1$s Name of pie * %2$d Value of pie * %3$.1f Percentage * @property callback $labelCallback * Callback function to format pie chart labels. * Function will receive 3 parameters: * string function( label, value, percent ) * @property float $sum * Fixed sum of values. This should be used for incomplete pie * charts. * @property float $percentThreshold * Values with a lower percentage value are aggregated. * @property float $absoluteThreshold * Values with a lower absolute value are aggregated. * @property string $summarizeCaption * Caption for values summarized because they are lower then the * configured tresh hold. * * @version 1.5 * @package Graph */ class ezcGraphPieChartOptions extends ezcGraphChartOptions { /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->properties['label'] = '%1$s: %2$d (%3$.1f%%)'; $this->properties['labelCallback'] = null; $this->properties['sum'] = false; $this->properties['percentThreshold'] = .0; $this->properties['absoluteThreshold'] = .0; $this->properties['summarizeCaption'] = 'Misc'; parent::__construct( $options ); } /** * Set an option value * * @param string $propertyName * @param mixed $propertyValue * @throws ezcBasePropertyNotFoundException * If a property is not defined in this class * @return void * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'label': $this->properties['label'] = (string) $propertyValue; break; case 'labelCallback': if ( is_callable( $propertyValue ) ) { $this->properties['labelCallback'] = $propertyValue; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, 'callback function' ); } break; case 'sum': if ( !is_numeric( $propertyValue ) || ( $propertyValue <= 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'float > 0' ); } $this->properties['sum'] = (float) $propertyValue; break; case 'percentThreshold': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) || ( $propertyValue > 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, '0 <= float <= 1' ); } $this->properties['percentThreshold'] = (float) $propertyValue; break; case 'absoluteThreshold': if ( !is_numeric( $propertyValue ) || ( $propertyValue <= 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'float > 0' ); } $this->properties['absoluteThreshold'] = (float) $propertyValue; break; case 'summarizeCaption': $this->properties['summarizeCaption'] = (string) $propertyValue; break; default: return parent::__set( $propertyName, $propertyValue ); } } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/options/radar_chart.php000066400000000000000000000132371226600447100254270ustar00rootroot00000000000000 * $wikidata = include 'tutorial_wikipedia_data.php'; * * $graph = new ezcGraphRadarChart(); * $graph->title = 'Wikipedia articles'; * * $graph->options->fillLines = 220; * * // Add data * foreach ( $wikidata as $language => $data ) * { * $graph->data[$language] = new ezcGraphArrayDataSet( $data ); * $graph->data[$language][] = reset( $data ); * } * * $graph->render( 400, 150, 'tutorial_radar_chart.svg' ); * * * @property float $lineThickness * Theickness of chart lines * @property mixed $fillLines * Status wheather the space between line and axis should get filled. * - FALSE to not fill the space at all. * - (int) Opacity used to fill up the space with the lines color. * @property int $symbolSize * Size of symbols in line chart. * @property ezcGraphFontOptions $highlightFont * Font configuration for highlight tests * @property int $highlightSize * Size of highlight blocks * @property bool $highlightRadars * If true, it adds lines to highlight the values position on the * axis. * * @version 1.5 * @package Graph */ class ezcGraphRadarChartOptions extends ezcGraphChartOptions { /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->properties['lineThickness'] = 1; $this->properties['fillLines'] = false; $this->properties['symbolSize'] = 8; $this->properties['highlightFont'] = new ezcGraphFontOptions(); $this->properties['highlightFontCloned'] = false; $this->properties['highlightSize'] = 14; $this->properties['highlightRadars'] = false; parent::__construct( $options ); } /** * Set an option value * * @param string $propertyName * @param mixed $propertyValue * @throws ezcBasePropertyNotFoundException * If a property is not defined in this class * @return void */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'lineThickness': case 'symbolSize': case 'highlightSize': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 1' ); } $this->properties[$propertyName] = (int) $propertyValue; break; case 'fillLines': if ( ( $propertyValue !== false ) && !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) || ( $propertyValue > 255 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'false OR 0 <= int <= 255' ); } $this->properties[$propertyName] = ( $propertyValue === false ? false : (int) $propertyValue ); break; case 'highlightFont': if ( $propertyValue instanceof ezcGraphFontOptions ) { $this->properties['highlightFont'] = $propertyValue; } elseif ( is_string( $propertyValue ) ) { if ( !$this->properties['highlightFontCloned'] ) { $this->properties['highlightFont'] = clone $this->font; $this->properties['highlightFontCloned'] = true; } $this->properties['highlightFont']->path = $propertyValue; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphFontOptions' ); } break; $this->properties['highlightSize'] = max( 1, (int) $propertyValue ); break; case 'highlightRadars': if ( !is_bool( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'bool' ); } $this->properties['highlightRadars'] = $propertyValue; break; default: return parent::__set( $propertyName, $propertyValue ); } } /** * __get * * @param mixed $propertyName * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return mixed * @ignore */ public function __get( $propertyName ) { switch ( $propertyName ) { case 'highlightFont': // Clone font configuration when requested for this element if ( !$this->properties['highlightFontCloned'] ) { $this->properties['highlightFont'] = clone $this->properties['font']; $this->properties['highlightFontCloned'] = true; } return $this->properties['highlightFont']; default: return parent::__get( $propertyName ); } } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/options/renderer.php000066400000000000000000000222421226600447100247570ustar00rootroot00000000000000 * $wikidata = include 'tutorial_wikipedia_data.php'; * * $graph = new ezcGraphBarChart(); * $graph->title = 'Wikipedia articles'; * * // Add data * foreach ( $wikidata as $language => $data ) * { * $graph->data[$language] = new ezcGraphArrayDataSet( $data ); * } * * // $graph->renderer = new ezcGraphRenderer2d(); * * $graph->renderer->options->barMargin = .2; * $graph->renderer->options->barPadding = .2; * * $graph->renderer->options->dataBorder = 0; * * $graph->render( 400, 150, 'tutorial_bar_chart_options.svg' ); * * * For additional options, which are special to some chart type you may * also want to check the option classes for the repective chart type you * are using and the elements of the chart. The chart type dependant option * classes are: * * - ezcGraphLineChartOptions * - ezcGraphPieChartOptions * - ezcGraphRadarChartOptions * * There may be additional options dependant on the renderer you are using. * You may want to check the extensions of this class: * * - ezcGraphRenderer2dOptions * - ezcGraphRenderer3dOptions * * @property float $maxLabelHeight * Percent of chart height used as maximum height for pie chart * labels. * @property bool $showSymbol * Indicates wheather to show the line between pie elements and * labels. * @property float $symbolSize * Size of symbols used to connect a label with a pie. * @property float $moveOut * Percent to move pie chart elements out of the middle on highlight. * @property int $titlePosition * Position of title in a box. * @property int $titleAlignement * Alignement of box titles. * @property float $dataBorder * Factor to darken border of data elements, like lines, bars and * pie segments. * @property float $barMargin * Percentual distance between bar blocks. * @property float $barPadding * Percentual distance between bars. * @property float $pieChartOffset * Offset for starting with first pie chart segment in degrees. * @property float $legendSymbolGleam * Opacity of gleam in legend symbols * @property float $legendSymbolGleamSize * Size of gleam in legend symbols * @property float $legendSymbolGleamColor * Color of gleam in legend symbols * @property float $pieVerticalSize * Percent of vertical space used for maximum pie chart size. * @property float $pieHorizontalSize * Percent of horizontal space used for maximum pie chart size. * @property float $pieChartSymbolColor * Color of pie chart symbols * @property float $pieChartGleam * Enhance pie chart with gleam on top. * @property float $pieChartGleamColor * Color used for gleam on pie charts. * @property float $pieChartGleamBorder * Do not draw gleam on an outer border of this size. * @property bool $syncAxisFonts * Synchronize fonts of axis. With the defaut true value, the only * the fonts of the yAxis will be used. * @property bool $axisEndStyle * Style of axis end markers. Defauls to arrow heads, but you may * also use all symbol constants defined ein the ezcGraph class, * especially ezcGraph::NO_SYMBOL. * @property bool $shortAxis * Defines wheather to render the axis extending the chart boundings * or stop them at the chart boundings. Deafults to false. * * @version 1.5 * @package Graph */ class ezcGraphRendererOptions extends ezcGraphChartOptions { /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->properties['maxLabelHeight'] = .10; $this->properties['showSymbol'] = true; $this->properties['symbolSize'] = 6; $this->properties['moveOut'] = .1; $this->properties['titlePosition'] = ezcGraph::TOP; $this->properties['titleAlignement'] = ezcGraph::MIDDLE | ezcGraph::CENTER; $this->properties['dataBorder'] = .5; $this->properties['barMargin'] = .1; $this->properties['barPadding'] = .05; $this->properties['pieChartOffset'] = 0; $this->properties['pieChartSymbolColor'] = ezcGraphColor::fromHex( '#000000' ); $this->properties['pieChartGleam'] = false; $this->properties['pieChartGleamColor'] = ezcGraphColor::fromHex( '#FFFFFF' ); $this->properties['pieChartGleamBorder'] = 0; $this->properties['legendSymbolGleam'] = false; $this->properties['legendSymbolGleamSize'] = .9; $this->properties['legendSymbolGleamColor'] = ezcGraphColor::fromHex( '#FFFFFF' ); $this->properties['pieVerticalSize'] = .5; $this->properties['pieHorizontalSize'] = .25; $this->properties['syncAxisFonts'] = true; $this->properties['axisEndStyle'] = ezcGraph::ARROW; $this->properties['shortAxis'] = false; parent::__construct( $options ); } /** * Set an option value * * @param string $propertyName * @param mixed $propertyValue * @throws ezcBasePropertyNotFoundException * If a property is not defined in this class * @return void * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'dataBorder': case 'pieChartGleam': case 'legendSymbolGleam': if ( $propertyValue !== false && !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) || ( $propertyValue > 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'false OR 0 <= float <= 1' ); } $this->properties[$propertyName] = ( $propertyValue === false ? false : (float) $propertyValue ); break; case 'maxLabelHeight': case 'moveOut': case 'barMargin': case 'barPadding': case 'legendSymbolGleamSize': case 'pieVerticalSize': case 'pieHorizontalSize': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) || ( $propertyValue > 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, '0 <= float <= 1' ); } $this->properties[$propertyName] = (float) $propertyValue; break; case 'symbolSize': case 'titlePosition': case 'titleAlignement': case 'pieChartGleamBorder': case 'axisEndStyle': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 0' ); } $this->properties[$propertyName] = (int) $propertyValue; break; case 'showSymbol': case 'syncAxisFonts': case 'shortAxis': if ( !is_bool( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'bool' ); } $this->properties[$propertyName] = (bool) $propertyValue; break; case 'pieChartOffset': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) || ( $propertyValue > 360 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, '0 <= float <= 360' ); } $this->properties[$propertyName] = (float) $propertyValue; break; case 'pieChartSymbolColor': case 'pieChartGleamColor': case 'legendSymbolGleamColor': $this->properties[$propertyName] = ezcGraphColor::create( $propertyValue ); break; default: return parent::__set( $propertyName, $propertyValue ); } } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/options/renderer_2d.php000066400000000000000000000075131226600447100253500ustar00rootroot00000000000000 * $graph = new ezcGraphPieChart(); * $graph->palette = new ezcGraphPaletteBlack(); * $graph->title = 'Access statistics'; * $graph->options->label = '%2$d (%3$.1f%%)'; * * $graph->data['Access statistics'] = new ezcGraphArrayDataSet( array( * 'Mozilla' => 19113, * 'Explorer' => 10917, * 'Opera' => 1464, * 'Safari' => 652, * 'Konqueror' => 474, * ) ); * $graph->data['Access statistics']->highlight['Explorer'] = true; * * // $graph->renderer = new ezcGraphRenderer2d(); * * $graph->renderer->options->moveOut = .2; * * $graph->renderer->options->pieChartOffset = 63; * * $graph->renderer->options->pieChartGleam = .3; * $graph->renderer->options->pieChartGleamColor = '#FFFFFF'; * $graph->renderer->options->pieChartGleamBorder = 2; * * $graph->renderer->options->pieChartShadowSize = 3; * $graph->renderer->options->pieChartShadowColor = '#000000'; * * $graph->renderer->options->legendSymbolGleam = .5; * $graph->renderer->options->legendSymbolGleamSize = .9; * $graph->renderer->options->legendSymbolGleamColor = '#FFFFFF'; * * $graph->renderer->options->pieChartSymbolColor = '#BABDB688'; * * $graph->render( 400, 150, 'tutorial_pie_chart_pimped.svg' ); * * * @property int $pieChartShadowSize * Size of shadows. * @property float $pieChartShadowTransparency * Used transparency for pie chart shadows. * @property float $pieChartShadowColor * Color used for pie chart shadows. * * @version 1.5 * @package Graph */ class ezcGraphRenderer2dOptions extends ezcGraphRendererOptions { /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->properties['pieChartShadowSize'] = 0; $this->properties['pieChartShadowTransparency'] = .3; $this->properties['pieChartShadowColor'] = ezcGraphColor::fromHex( '#000000' ); parent::__construct( $options ); } /** * Set an option value * * @param string $propertyName * @param mixed $propertyValue * @throws ezcBasePropertyNotFoundException * If a property is not defined in this class * @return void * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'pieChartShadowSize': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'float >= 0' ); } $this->properties['pieChartShadowSize'] = (int) $propertyValue; break; case 'pieChartShadowTransparency': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) || ( $propertyValue > 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, '0 <= float <= 1' ); } $this->properties['pieChartShadowTransparency'] = (float) $propertyValue; break; case 'pieChartShadowColor': $this->properties['pieChartShadowColor'] = ezcGraphColor::create( $propertyValue ); break; default: return parent::__set( $propertyName, $propertyValue ); } } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/options/renderer_3d.php000066400000000000000000000153111226600447100253440ustar00rootroot00000000000000 * $graph = new ezcGraphPieChart(); * $graph->palette = new ezcGraphPaletteEzRed(); * $graph->title = 'Access statistics'; * $graph->options->label = '%2$d (%3$.1f%%)'; * * $graph->data['Access statistics'] = new ezcGraphArrayDataSet( array( * 'Mozilla' => 19113, * 'Explorer' => 10917, * 'Opera' => 1464, * 'Safari' => 652, * 'Konqueror' => 474, * ) ); * $graph->data['Access statistics']->highlight['Explorer'] = true; * * $graph->renderer = new ezcGraphRenderer3d(); * * $graph->renderer->options->moveOut = .2; * * $graph->renderer->options->pieChartOffset = 63; * * $graph->renderer->options->pieChartGleam = .3; * $graph->renderer->options->pieChartGleamColor = '#FFFFFF'; * * $graph->renderer->options->pieChartShadowSize = 5; * $graph->renderer->options->pieChartShadowColor = '#000000'; * * $graph->renderer->options->legendSymbolGleam = .5; * $graph->renderer->options->legendSymbolGleamSize = .9; * $graph->renderer->options->legendSymbolGleamColor = '#FFFFFF'; * * $graph->renderer->options->pieChartSymbolColor = '#55575388'; * * $graph->renderer->options->pieChartHeight = 5; * $graph->renderer->options->pieChartRotation = .8; * * $graph->render( 400, 150, 'tutorial_pie_chart_3d.svg' ); * * * @property bool $seperateLines * Indicates wheather the full depth should be used for each line in * the chart, or beeing seperated by the count of lines. * @property float $fillAxis * Transparency used to fill the axis polygon. * @property float $fillGrid * Transparency used to fill the grid lines. * @property float $depth * Part of picture used to simulate depth of three dimensional chart. * @property float $pieChartHeight * Height of the pie charts border. * @property float $pieChartRotation * Rotation of pie chart. Defines the percent of width used to * calculate the height of the ellipse. * @property int $pieChartShadowSize * Size of shadows. * @property float $pieChartShadowTransparency * Used transparency for pie chart shadows. * @property float $pieChartShadowColor * Color used for pie chart shadows. * @property float $barDarkenSide * Factor to darken the color used for the bars side polygon. * @property float $barDarkenTop * Factor to darken the color used for the bars top polygon. * @property float $barChartGleam * Transparancy for gleam on bar charts * * @version 1.5 * @package Graph */ class ezcGraphRenderer3dOptions extends ezcGraphRendererOptions { /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->properties['seperateLines'] = true; $this->properties['fillAxis'] = .8; $this->properties['fillGrid'] = 0; $this->properties['depth'] = .1; $this->properties['pieChartHeight'] = 10.; $this->properties['pieChartRotation'] = .6; $this->properties['pieChartShadowSize'] = 0; $this->properties['pieChartShadowTransparency'] = .3; $this->properties['pieChartShadowColor'] = ezcGraphColor::fromHex( '#000000' ); $this->properties['pieChartGleam'] = false; $this->properties['pieChartGleamColor'] = ezcGraphColor::fromHex( '#FFFFFF' ); $this->properties['barDarkenSide'] = .2; $this->properties['barDarkenTop'] = .4; $this->properties['barChartGleam'] = false; parent::__construct( $options ); } /** * Set an option value * * @param string $propertyName * @param mixed $propertyValue * @throws ezcBasePropertyNotFoundException * If a property is not defined in this class * @return void * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'fillAxis': case 'fillGrid': if ( $propertyValue !== false && !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) || ( $propertyValue > 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'false OR 0 <= float <= 1' ); } $this->properties[$propertyName] = ( $propertyValue === false ? false : (float) $propertyValue ); break; case 'depth': case 'pieChartRotation': case 'pieChartShadowTransparency': case 'barDarkenSide': case 'barDarkenTop': case 'barChartGleam': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) || ( $propertyValue > 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, '0 <= float <= 1' ); } $this->properties[$propertyName] = (float) $propertyValue; break; case 'pieChartHeight': case 'pieChartShadowSize': if ( !is_numeric( $propertyValue ) || ( $propertyValue <= 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'float > 0' ); } $this->properties[$propertyName] = (float) $propertyValue; break; case 'seperateLines': if ( !is_bool( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'bool' ); } $this->properties['seperateLines'] = $propertyValue; break; case 'pieChartShadowColor': $this->properties['pieChartShadowColor'] = ezcGraphColor::create( $propertyValue ); break; default: return parent::__set( $propertyName, $propertyValue ); } } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/options/svg_driver.php000066400000000000000000000237361226600447100253340ustar00rootroot00000000000000 * $graph = new ezcGraphPieChart(); * $graph->background->color = '#FFFFFFFF'; * $graph->title = 'Access statistics'; * $graph->legend = false; * * $graph->data['Access statistics'] = new ezcGraphArrayDataSet( array( * 'Mozilla' => 19113, * 'Explorer' => 10917, * 'Opera' => 1464, * 'Safari' => 652, * 'Konqueror' => 474, * ) ); * * $graph->driver->options->templateDocument = dirname( __FILE__ ) . '/template.svg'; * $graph->driver->options->graphOffset = new ezcGraphCoordinate( 25, 40 ); * $graph->driver->options->insertIntoGroup = 'ezcGraph'; * * $graph->render( 400, 200, 'tutorial_driver_svg.svg' ); * * * @property string $encoding * Encoding of the SVG XML document * @property float $assumedNumericCharacterWidth * Assumed percentual average width of chars in numeric strings with * the used font. * @property float $assumedTextCharacterWidth * Assumed percentual average width of chars in non numeric strings * with the used font. * @property string $strokeLineCap * This specifies the shape to be used at the end of open subpaths * when they are stroked. * @property string $strokeLineJoin * This specifies the shape to be used at the edges of paths. * @property string $shapeRendering * "The creator of SVG content might want to provide a hint to the * implementation about what tradeoffs to make as it renders vector * graphics elements such as 'path' elements and basic shapes such as * circles and rectangles." * @property string $colorRendering * "The creator of SVG content might want to provide a hint to the * implementation about how to make speed vs. quality tradeoffs as it * performs color interpolation and compositing. The * 'color-rendering' property provides a hint to the SVG user agent * about how to optimize its color interpolation and compositing * operations." * @property string $textRendering * "The creator of SVG content might want to provide a hint to the * implementation about what tradeoffs to make as it renders text." * @property mixed $templateDocument * Use existing SVG document as template to insert graph into. If * insertIntoGroup is not set, a new group will be inserted in the * svg root node. * @property mixed $insertIntoGroup * ID of a SVG group node to insert the graph. Only works with a * custom template document. * @property ezcGraphCoordinate $graphOffset * Offset of the graph in the svg. * @property string $idPrefix * Prefix used for the ids in SVG documents. * @property string $linkCursor * CSS value for cursor property used for linked SVG elements * * @version 1.5 * @package Graph */ class ezcGraphSvgDriverOptions extends ezcGraphDriverOptions { /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->properties['encoding'] = null; $this->properties['assumedNumericCharacterWidth'] = .62; $this->properties['assumedTextCharacterWidth'] = .53; $this->properties['strokeLineJoin'] = 'round'; $this->properties['strokeLineCap'] = 'round'; $this->properties['shapeRendering'] = 'geometricPrecision'; $this->properties['colorRendering'] = 'optimizeQuality'; $this->properties['textRendering'] = 'optimizeLegibility'; $this->properties['templateDocument'] = false; $this->properties['insertIntoGroup'] = false; $this->properties['graphOffset'] = new ezcGraphCoordinate( 0, 0 ); $this->properties['idPrefix'] = 'ezcGraph'; $this->properties['linkCursor'] = 'pointer'; parent::__construct( $options ); } /** * Set an option value * * @param string $propertyName * @param mixed $propertyValue * @throws ezcBasePropertyNotFoundException * If a property is not defined in this class * @return void * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'assumedNumericCharacterWidth': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'float > 0' ); } $this->properties['assumedNumericCharacterWidth'] = (float) $propertyValue; break; case 'assumedTextCharacterWidth': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'float > 0' ); } $this->properties['assumedTextCharacterWidth'] = (float) $propertyValue; break; case 'strokeLineJoin': $values = array( 'round', 'miter', 'bevel', 'inherit', ); if ( in_array( $propertyValue, $values, true ) ) { $this->properties['strokeLineJoin'] = $propertyValue; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, implode( $values, ', ' ) ); } break; case 'strokeLineCap': $values = array( 'round', 'butt', 'square', 'inherit', ); if ( in_array( $propertyValue, $values, true ) ) { $this->properties['strokeLineCap'] = $propertyValue; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, implode( $values, ', ' ) ); } break; case 'shapeRendering': $values = array( 'auto', 'optimizeSpeed', 'crispEdges', 'geometricPrecision', 'inherit', ); if ( in_array( $propertyValue, $values, true ) ) { $this->properties['shapeRendering'] = $propertyValue; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, implode( $values, ', ' ) ); } break; case 'colorRendering': $values = array( 'auto', 'optimizeSpeed', 'optimizeQuality', 'inherit', ); if ( in_array( $propertyValue, $values, true ) ) { $this->properties['colorRendering'] = $propertyValue; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, implode( $values, ', ' ) ); } break; case 'textRendering': $values = array( 'auto', 'optimizeSpeed', 'optimizeLegibility', 'geometricPrecision', 'inherit', ); if ( in_array( $propertyValue, $values, true ) ) { $this->properties['textRendering'] = $propertyValue; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, implode( $values, ', ' ) ); } break; case 'templateDocument': if ( !is_file( $propertyValue ) || !is_readable( $propertyValue ) ) { throw new ezcBaseFileNotFoundException( $propertyValue ); } else { $this->properties['templateDocument'] = realpath( $propertyValue ); } break; case 'insertIntoGroup': if ( !is_string( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'string' ); } else { $this->properties['insertIntoGroup'] = $propertyValue; } break; case 'graphOffset': if ( $propertyValue instanceof ezcGraphCoordinate ) { $this->properties['graphOffset'] = $propertyValue; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphCoordinate' ); } break; case 'idPrefix': $this->properties['idPrefix'] = (string) $propertyValue; break; case 'encoding': $this->properties['encoding'] = (string) $propertyValue; break; case 'linkCursor': $this->properties['linkCursor'] = (string) $propertyValue; break; default: parent::__set( $propertyName, $propertyValue ); break; } } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/palette/000077500000000000000000000000001226600447100224015ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/palette/black.php000066400000000000000000000037221226600447100241720ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/palette/ez.php000066400000000000000000000032011226600447100235240ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/palette/ez_blue.php000066400000000000000000000030141226600447100245350ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/palette/ez_green.php000066400000000000000000000030201226600447100247030ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/palette/ez_red.php000066400000000000000000000030101226600447100243540ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/palette/tango.php000066400000000000000000000030151226600447100242210ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/renderer/000077500000000000000000000000001226600447100225515ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/renderer/2d.php000066400000000000000000001767511226600447100236100ustar00rootroot00000000000000 * $graph = new ezcGraphPieChart(); * $graph->palette = new ezcGraphPaletteBlack(); * $graph->title = 'Access statistics'; * $graph->options->label = '%2$d (%3$.1f%%)'; * * $graph->data['Access statistics'] = new ezcGraphArrayDataSet( array( * 'Mozilla' => 19113, * 'Explorer' => 10917, * 'Opera' => 1464, * 'Safari' => 652, * 'Konqueror' => 474, * ) ); * $graph->data['Access statistics']->highlight['Explorer'] = true; * * // $graph->renderer = new ezcGraphRenderer2d(); * * $graph->renderer->options->moveOut = .2; * * $graph->renderer->options->pieChartOffset = 63; * * $graph->renderer->options->pieChartGleam = .3; * $graph->renderer->options->pieChartGleamColor = '#FFFFFF'; * $graph->renderer->options->pieChartGleamBorder = 2; * * $graph->renderer->options->pieChartShadowSize = 3; * $graph->renderer->options->pieChartShadowColor = '#000000'; * * $graph->renderer->options->legendSymbolGleam = .5; * $graph->renderer->options->legendSymbolGleamSize = .9; * $graph->renderer->options->legendSymbolGleamColor = '#FFFFFF'; * * $graph->renderer->options->pieChartSymbolColor = '#BABDB688'; * * $graph->render( 400, 150, 'tutorial_pie_chart_pimped.svg' ); * * * @version 1.5 * @package Graph * @mainclass */ class ezcGraphRenderer2d extends ezcGraphRenderer implements ezcGraphRadarRenderer, ezcGraphStackedBarsRenderer, ezcGraphOdometerRenderer { /** * Pie segment labels divided into two array, containing the labels on the * left and right side of the pie chart center. * * @var array */ protected $pieSegmentLabels = array( 0 => array(), 1 => array(), ); /** * Contains the boundings used for pie segments * * @var ezcGraphBoundings */ protected $pieSegmentBoundings = false; /** * Array with symbols for post processing, which ensures, that the symbols * are rendered topmost. * * @var array */ protected $linePostSymbols = array(); /** * Options * * @var ezcGraphRenderer2dOptions */ protected $options; /** * Collect axis labels, so that the axis are drawn, when all axis spaces * are known. * * @var array */ protected $axisLabels = array(); /** * Collects circle sectors to draw shadow in background of all circle * sectors. * * @var array */ protected $circleSectors = array(); /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->options = new ezcGraphRenderer2dOptions( $options ); } /** * __get * * @param mixed $propertyName * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return mixed * @ignore */ public function __get( $propertyName ) { switch ( $propertyName ) { case 'options': return $this->options; default: return parent::__get( $propertyName ); } } /** * Draw pie segment * * Draws a single pie segment * * @param ezcGraphBoundings $boundings Chart boundings * @param ezcGraphContext $context Context of call * @param ezcGraphColor $color Color of pie segment * @param float $startAngle Start angle * @param float $endAngle End angle * @param mixed $label Label of pie segment * @param bool $moveOut Move out from middle for hilighting * @return void */ public function drawPieSegment( ezcGraphBoundings $boundings, ezcGraphContext $context, ezcGraphColor $color, $startAngle = .0, $endAngle = 360., $label = false, $moveOut = false ) { // Apply offset $startAngle += $this->options->pieChartOffset; $endAngle += $this->options->pieChartOffset; // Calculate position and size of pie $center = new ezcGraphCoordinate( $boundings->x0 + ( $boundings->width ) / 2, $boundings->y0 + ( $boundings->height ) / 2 ); // Limit radius to fourth of width and half of height at maximum $radius = min( ( $boundings->width ) * $this->options->pieHorizontalSize, ( $boundings->height ) * $this->options->pieVerticalSize ); // Move pie segment out of the center if ( $moveOut ) { $direction = ( $endAngle + $startAngle ) / 2; $center = new ezcGraphCoordinate( $center->x + $this->options->moveOut * $radius * cos( deg2rad( $direction ) ), $center->y + $this->options->moveOut * $radius * sin( deg2rad( $direction ) ) ); } // Add circle sector to queue $this->circleSectors[] = array( 'center' => $center, 'context' => $context, 'width' => $radius * 2 * ( 1 - $this->options->moveOut ), 'height' => $radius * 2 * ( 1 - $this->options->moveOut ), 'start' => $startAngle, 'end' => $endAngle, 'color' => $color, ); if ( $label ) { // Determine position of label $direction = ( $endAngle + $startAngle ) / 2; $pieSegmentCenter = new ezcGraphCoordinate( $center->x + cos( deg2rad( $direction ) ) * $radius, $center->y + sin( deg2rad( $direction ) ) * $radius ); // Split labels up into left an right size and index them on their // y position $this->pieSegmentLabels[(int) ($pieSegmentCenter->x > $center->x)][$pieSegmentCenter->y] = array( new ezcGraphCoordinate( $center->x + cos( deg2rad( $direction ) ) * $radius * 2 / 3, $center->y + sin( deg2rad( $direction ) ) * $radius * 2 / 3 ), $label, $context ); } if ( !$this->pieSegmentBoundings ) { $this->pieSegmentBoundings = $boundings; } } /** * Draws the collected circle sectors * * All circle sectors are collected and drawn later to be able to render * the shadows of the pie segments in the back of all pie segments. * * @return void */ protected function finishCircleSectors() { // Add circle sector sides to simple z buffer prioriry list if ( $this->options->pieChartShadowSize > 0 ) { foreach ( $this->circleSectors as $circleSector ) { $this->driver->drawCircleSector( new ezcGraphCoordinate( $circleSector['center']->x + $this->options->pieChartShadowSize, $circleSector['center']->y + $this->options->pieChartShadowSize ), $circleSector['width'], $circleSector['height'], $circleSector['start'], $circleSector['end'], $this->options->pieChartShadowColor->transparent( $this->options->pieChartShadowTransparency ), true ); } } foreach ( $this->circleSectors as $circleSector ) { // Draw circle sector $this->addElementReference( $circleSector['context'], $this->driver->drawCircleSector( $circleSector['center'], $circleSector['width'], $circleSector['height'], $circleSector['start'], $circleSector['end'], $circleSector['color'], true ) ); $darkenedColor = $circleSector['color']->darken( $this->options->dataBorder ); $this->driver->drawCircleSector( $circleSector['center'], $circleSector['width'], $circleSector['height'], $circleSector['start'], $circleSector['end'], $darkenedColor, false ); if ( $this->options->pieChartGleam !== false ) { $gradient = new ezcGraphLinearGradient( $circleSector['center'], new ezcGraphCoordinate( $circleSector['center']->x, $circleSector['center']->y - $circleSector['height'] / 2 ), $this->options->pieChartGleamColor->transparent( 1 ), $this->options->pieChartGleamColor->transparent( $this->options->pieChartGleam ) ); $this->addElementReference( $circleSector['context'], $this->driver->drawCircleSector( $circleSector['center'], $circleSector['width'] - $this->options->pieChartGleamBorder * 2, $circleSector['height'] - $this->options->pieChartGleamBorder * 2, $circleSector['start'], $circleSector['end'], $gradient, true ) ); $gradient = new ezcGraphLinearGradient( new ezcGraphCoordinate( $circleSector['center']->x, $circleSector['center']->y + $circleSector['height'] / 4 ), new ezcGraphCoordinate( $circleSector['center']->x, $circleSector['center']->y + $circleSector['height'] / 2 ), $this->options->pieChartGleamColor->transparent( 1 ), $this->options->pieChartGleamColor->transparent( $this->options->pieChartGleam ) ); $this->addElementReference( $circleSector['context'], $this->driver->drawCircleSector( $circleSector['center'], $circleSector['width'] - $this->options->pieChartGleamBorder * 2, $circleSector['height'] - $this->options->pieChartGleamBorder * 2, $circleSector['start'], $circleSector['end'], $gradient, true ) ); } } } /** * Draws the collected pie segment labels * * All labels are collected and drawn later to be able to partition the * available space for the labels woth knowledge of the overall label * count and their required size and optimal position. * * @return void */ protected function finishPieSegmentLabels() { if ( $this->pieSegmentBoundings === false ) { return true; } $boundings = $this->pieSegmentBoundings; // Calculate position and size of pie $center = new ezcGraphCoordinate( $boundings->x0 + ( $boundings->width ) / 2, $boundings->y0 + ( $boundings->height ) / 2 ); // Limit radius to fourth of width and half of height at maximum $radius = min( ( $boundings->width ) * $this->options->pieHorizontalSize, ( $boundings->height ) * $this->options->pieVerticalSize ); $pieChartHeight = min( $radius * 2 + $radius / max( 1, count ( $this->pieSegmentLabels[0] ), count( $this->pieSegmentLabels[1] ) ) * 4, $boundings->height ); $pieChartYPosition = $boundings->y0 + ( ( $boundings->height ) - $pieChartHeight ) / 2; // Calculate maximum height of labels $labelHeight = min( ( count( $this->pieSegmentLabels[0] ) ? $pieChartHeight / count( $this->pieSegmentLabels[0] ) : $pieChartHeight ), ( count( $this->pieSegmentLabels[1] ) ? $pieChartHeight / count( $this->pieSegmentLabels[1] ) : $pieChartHeight ), ( $pieChartHeight ) * $this->options->maxLabelHeight ); $symbolSize = $this->options->symbolSize; foreach ( $this->pieSegmentLabels as $side => $labelPart ) { $minHeight = $pieChartYPosition; $toShare = $pieChartHeight - count( $labelPart ) * $labelHeight; // Sort to draw topmost label first ksort( $labelPart ); $sign = ( $side ? -1 : 1 ); foreach ( $labelPart as $height => $label ) { if ( ( $height - $labelHeight / 2 ) > $minHeight ) { $share = min( $toShare, ( $height - $labelHeight / 2) - $minHeight ); $minHeight += $share; $toShare -= $share; } // Determine position of label $minHeight += max( 0, $height - $minHeight - $labelHeight ) / $pieChartHeight * $toShare; $verticalDistance = ( $center->y - $minHeight - $labelHeight / 2 ) / $radius; $labelPosition = new ezcGraphCoordinate( $center->x - $sign * ( abs( $verticalDistance ) > 1 // If vertical distance to center is greater then the // radius, use the centerline for the horizontal // position ? max ( 5, abs( $label[0]->x - $center->x ) ) // Else place the label outside of the pie chart : ( cos ( asin ( $verticalDistance ) ) * $radius + $symbolSize * (int) $this->options->showSymbol ) ), $minHeight + $labelHeight / 2 ); if ( $this->options->showSymbol ) { // Draw label $this->driver->drawLine( $label[0], $labelPosition, $this->options->pieChartSymbolColor, 1 ); $this->driver->drawCircle( $label[0], $symbolSize, $symbolSize, $this->options->pieChartSymbolColor, true ); $this->driver->drawCircle( $labelPosition, $symbolSize, $symbolSize, $this->options->pieChartSymbolColor, true ); } $this->addElementReference( $label[2], $this->driver->drawTextBox( $label[1], new ezcGraphCoordinate( ( !$side ? $boundings->x0 : $labelPosition->x + $symbolSize ), $minHeight ), ( !$side ? $labelPosition->x - $boundings->x0 - $symbolSize : $boundings->x1 - $labelPosition->x - $symbolSize ), $labelHeight, ( !$side ? ezcGraph::RIGHT : ezcGraph::LEFT ) | ezcGraph::MIDDLE ) ); // Add used space to minHeight $minHeight += $labelHeight; } } } /** * Draw the collected line symbols * * Symbols for the data lines are collected and delayed to ensure that * they are not covered and hidden by other data lines. * * @return void */ protected function finishLineSymbols() { foreach ( $this->linePostSymbols as $symbol ) { $this->addElementReference( $symbol['context'], $this->drawSymbol( $symbol['boundings'], $symbol['color'], $symbol['symbol'] ) ); } } /** * Draw bar * * Draws a bar as a data element in a line chart * * @param ezcGraphBoundings $boundings Chart boundings * @param ezcGraphContext $context Context of call * @param ezcGraphColor $color Color of line * @param ezcGraphCoordinate $position Position of data point * @param float $stepSize Space which can be used for bars * @param int $dataNumber Number of dataset * @param int $dataCount Count of datasets in chart * @param int $symbol Symbol to draw for line * @param float $axisPosition Position of axis for drawing filled lines * @return void */ public function drawBar( ezcGraphBoundings $boundings, ezcGraphContext $context, ezcGraphColor $color, ezcGraphCoordinate $position, $stepSize, $dataNumber = 1, $dataCount = 1, $symbol = ezcGraph::NO_SYMBOL, $axisPosition = 0. ) { // Apply margin $margin = $stepSize * $this->options->barMargin; $padding = $stepSize * $this->options->barPadding; $barWidth = ( $stepSize - $margin ) / $dataCount - $padding; $offset = - $stepSize / 2 + $margin / 2 + ( $dataCount - $dataNumber - 1 ) * ( $padding + $barWidth ) + $padding / 2; $barPointArray = array( new ezcGraphCoordinate( $boundings->x0 + ( $boundings->width ) * $position->x + $offset, $boundings->y0 + ( $boundings->height ) * $axisPosition ), new ezcGraphCoordinate( $boundings->x0 + ( $boundings->width ) * $position->x + $offset, $boundings->y0 + ( $boundings->height ) * $position->y ), new ezcGraphCoordinate( $boundings->x0 + ( $boundings->width ) * $position->x + $offset + $barWidth, $boundings->y0 + ( $boundings->height ) * $position->y ), new ezcGraphCoordinate( $boundings->x0 + ( $boundings->width ) * $position->x + $offset + $barWidth, $boundings->y0 + ( $boundings->height ) * $axisPosition ), ); $this->addElementReference( $context, $this->driver->drawPolygon( $barPointArray, $color, true ) ); if ( $this->options->dataBorder > 0 ) { $darkened = $color->darken( $this->options->dataBorder ); $this->driver->drawPolygon( $barPointArray, $darkened, false, 1 ); } } /** * Draw stacked bar * * Draws a stacked bar part as a data element in a line chart * * @param ezcGraphBoundings $boundings Chart boundings * @param ezcGraphContext $context Context of call * @param ezcGraphColor $color Color of line * @param ezcGraphCoordinate $start * @param ezcGraphCoordinate $position * @param float $stepSize Space which can be used for bars * @param int $symbol Symbol to draw for line * @param float $axisPosition Position of axis for drawing filled lines * @return void */ public function drawStackedBar( ezcGraphBoundings $boundings, ezcGraphContext $context, ezcGraphColor $color, ezcGraphCoordinate $start, ezcGraphCoordinate $position, $stepSize, $symbol = ezcGraph::NO_SYMBOL, $axisPosition = 0. ) { // Apply margin $margin = $stepSize * $this->options->barMargin; $barWidth = $stepSize - $margin; $offset = - $stepSize / 2 + $margin / 2; $barPointArray = array( new ezcGraphCoordinate( $boundings->x0 + ( $boundings->width ) * $position->x + $offset, $boundings->y0 + ( $boundings->height ) * $start->y ), new ezcGraphCoordinate( $boundings->x0 + ( $boundings->width ) * $position->x + $offset, $boundings->y0 + ( $boundings->height ) * $position->y ), new ezcGraphCoordinate( $boundings->x0 + ( $boundings->width ) * $position->x + $offset + $barWidth, $boundings->y0 + ( $boundings->height ) * $position->y ), new ezcGraphCoordinate( $boundings->x0 + ( $boundings->width ) * $position->x + $offset + $barWidth, $boundings->y0 + ( $boundings->height ) * $start->y ), ); $this->addElementReference( $context, $this->driver->drawPolygon( $barPointArray, $color, true ) ); if ( $this->options->dataBorder > 0 ) { $darkened = $color->darken( $this->options->dataBorder ); $this->driver->drawPolygon( $barPointArray, $darkened, false, 1 ); } } /** * Draw data line * * Draws a line as a data element in a line chart * * @param ezcGraphBoundings $boundings Chart boundings * @param ezcGraphContext $context Context of call * @param ezcGraphColor $color Color of line * @param ezcGraphCoordinate $start Starting point * @param ezcGraphCoordinate $end Ending point * @param int $dataNumber Number of dataset * @param int $dataCount Count of datasets in chart * @param int $symbol Symbol to draw for line * @param ezcGraphColor $symbolColor Color of the symbol, defaults to linecolor * @param ezcGraphColor $fillColor Color to fill line with * @param float $axisPosition Position of axis for drawing filled lines * @param float $thickness Line thickness * @return void */ public function drawDataLine( ezcGraphBoundings $boundings, ezcGraphContext $context, ezcGraphColor $color, ezcGraphCoordinate $start, ezcGraphCoordinate $end, $dataNumber = 1, $dataCount = 1, $symbol = ezcGraph::NO_SYMBOL, ezcGraphColor $symbolColor = null, ezcGraphColor $fillColor = null, $axisPosition = 0., $thickness = 1. ) { // Perhaps fill up line if ( $fillColor !== null && $start->x != $end->x ) { $startValue = $axisPosition - $start->y; $endValue = $axisPosition - $end->y; if ( ( $startValue == 0 ) || ( $endValue == 0 ) || ( $startValue / abs( $startValue ) == $endValue / abs( $endValue ) ) ) { // Values have the same sign or are on the axis $this->driver->drawPolygon( array( new ezcGraphCoordinate( $boundings->x0 + ( $boundings->width ) * $start->x, $boundings->y0 + ( $boundings->height ) * $start->y ), new ezcGraphCoordinate( $boundings->x0 + ( $boundings->width ) * $end->x, $boundings->y0 + ( $boundings->height ) * $end->y ), new ezcGraphCoordinate( $boundings->x0 + ( $boundings->width ) * $end->x, $boundings->y0 + ( $boundings->height ) * $axisPosition ), new ezcGraphCoordinate( $boundings->x0 + ( $boundings->width ) * $start->x, $boundings->y0 + ( $boundings->height ) * $axisPosition ), ), $fillColor, true ); } else { // values are on differente sides of the axis - split the filled polygon $startDiff = abs( $axisPosition - $start->y ); $endDiff = abs( $axisPosition - $end->y ); $cuttingPosition = $startDiff / ( $endDiff + $startDiff ); $cuttingPoint = new ezcGraphCoordinate( $start->x + ( $end->x - $start->x ) * $cuttingPosition, $axisPosition ); $this->driver->drawPolygon( array( new ezcGraphCoordinate( $boundings->x0 + ( $boundings->width ) * $start->x, $boundings->y0 + ( $boundings->height ) * $axisPosition ), new ezcGraphCoordinate( $boundings->x0 + ( $boundings->width ) * $start->x, $boundings->y0 + ( $boundings->height ) * $start->y ), new ezcGraphCoordinate( $boundings->x0 + ( $boundings->width ) * $cuttingPoint->x, $boundings->y0 + ( $boundings->height ) * $cuttingPoint->y ), ), $fillColor, true ); $this->driver->drawPolygon( array( new ezcGraphCoordinate( $boundings->x0 + ( $boundings->width ) * $end->x, $boundings->y0 + ( $boundings->height ) * $axisPosition ), new ezcGraphCoordinate( $boundings->x0 + ( $boundings->width ) * $end->x, $boundings->y0 + ( $boundings->height ) * $end->y ), new ezcGraphCoordinate( $boundings->x0 + ( $boundings->width ) * $cuttingPoint->x, $boundings->y0 + ( $boundings->height ) * $cuttingPoint->y ), ), $fillColor, true ); } } // Draw line $this->driver->drawLine( new ezcGraphCoordinate( $boundings->x0 + ( $boundings->width ) * $start->x, $boundings->y0 + ( $boundings->height ) * $start->y ), new ezcGraphCoordinate( $boundings->x0 + ( $boundings->width ) * $end->x, $boundings->y0 + ( $boundings->height ) * $end->y ), $color, $thickness ); // Draw line symbol if ( $symbol !== ezcGraph::NO_SYMBOL ) { if ( $symbolColor === null ) { $symbolColor = $color; } $this->linePostSymbols[] = array( 'boundings' => new ezcGraphBoundings( $boundings->x0 + ( $boundings->width ) * $end->x - $this->options->symbolSize / 2, $boundings->y0 + ( $boundings->height ) * $end->y - $this->options->symbolSize / 2, $boundings->x0 + ( $boundings->width ) * $end->x + $this->options->symbolSize / 2, $boundings->y0 + ( $boundings->height ) * $end->y + $this->options->symbolSize / 2 ), 'color' => $symbolColor, 'context' => $context, 'symbol' => $symbol, ); } } /** * Returns a coordinate in the given bounding box for the given angle * radius with the center as base point. * * @param ezcGraphBoundings $boundings * @param ezcGraphCoordinate $center * @param float $angle * @param float $radius * @return float */ protected function getCoordinateFromAngleAndRadius( ezcGraphBoundings $boundings, ezcGraphCoordinate $center, $angle, $radius ) { $direction = new ezcGraphCoordinate( sin( $angle ) * $boundings->width / 2, -cos( $angle ) * $boundings->height / 2 ); $offset = new ezcGraphCoordinate( sin( $angle ) * $this->xAxisSpace, -cos( $angle ) * $this->yAxisSpace ); $direction->x -= 2 * $offset->x; $direction->y -= 2 * $offset->y; return new ezcGraphCoordinate( $boundings->x0 + $center->x + $offset->x + $direction->x * $radius, $boundings->y0 + $center->y + $offset->y + $direction->y * $radius ); } /** * Draw radar chart data line * * Draws a line as a data element in a radar chart * * @param ezcGraphBoundings $boundings Chart boundings * @param ezcGraphContext $context Context of call * @param ezcGraphColor $color Color of line * @param ezcGraphCoordinate $center Center of radar chart * @param ezcGraphCoordinate $start Starting point * @param ezcGraphCoordinate $end Ending point * @param int $dataNumber Number of dataset * @param int $dataCount Count of datasets in chart * @param int $symbol Symbol to draw for line * @param ezcGraphColor $symbolColor Color of the symbol, defaults to linecolor * @param ezcGraphColor $fillColor Color to fill line with * @param float $thickness Line thickness * @return void */ public function drawRadarDataLine( ezcGraphBoundings $boundings, ezcGraphContext $context, ezcGraphColor $color, ezcGraphCoordinate $center, ezcGraphCoordinate $start, ezcGraphCoordinate $end, $dataNumber = 1, $dataCount = 1, $symbol = ezcGraph::NO_SYMBOL, ezcGraphColor $symbolColor = null, ezcGraphColor $fillColor = null, $thickness = 1. ) { // Calculate line points from chart coordinates $start = $this->getCoordinateFromAngleAndRadius( $boundings, $center, $start->x * 2 * M_PI, $start->y ); $end = $this->getCoordinateFromAngleAndRadius( $boundings, $center, $end->x * 2 * M_PI, $end->y ); // Fill line if ( $fillColor !== null ) { $this->driver->drawPolygon( array( $start, $end, new ezcGraphCoordinate( $boundings->x0 + $center->x, $boundings->y0 + $center->y ), ), $fillColor, true ); } // Draw line $this->driver->drawLine( $start, $end, $color, $thickness ); if ( $symbol !== ezcGraph::NO_SYMBOL ) { $this->drawSymbol( new ezcGraphBoundings( $end->x - $this->options->symbolSize / 2, $end->y - $this->options->symbolSize / 2, $end->x + $this->options->symbolSize / 2, $end->y + $this->options->symbolSize / 2 ), $symbolColor, $symbol ); } } /** * Draws a highlight textbox for a datapoint. * * A highlight textbox for line and bar charts means a box with the current * value in the graph. * * @param ezcGraphBoundings $boundings Chart boundings * @param ezcGraphContext $context Context of call * @param ezcGraphCoordinate $end Ending point * @param float $axisPosition Position of axis for drawing filled lines * @param int $dataNumber Number of dataset * @param int $dataCount Count of datasets in chart * @param ezcGraphFontOptions $font Font used for highlight string * @param string $text Acutual value * @param int $size Size of highlight text * @param ezcGraphColor $markLines * @param int $xOffset * @param int $yOffset * @param float $stepSize * @param int $type * @return void */ public function drawDataHighlightText( ezcGraphBoundings $boundings, ezcGraphContext $context, ezcGraphCoordinate $end, $axisPosition = 0., $dataNumber = 1, $dataCount = 1, ezcGraphFontOptions $font, $text, $size, ezcGraphColor $markLines = null, $xOffset = 0, $yOffset = 0, $stepSize = 0., $type = ezcGraph::LINE ) { // Bar specific calculations if ( $type !== ezcGraph::LINE ) { $margin = $stepSize * $this->options->barMargin; $padding = $stepSize * $this->options->barPadding; $barWidth = ( $stepSize - $margin ) / $dataCount - $padding; $offset = -( $dataNumber + ( $dataCount - 1 ) / -2 ) * ( $barWidth + $padding ); } $this->driver->options->font = $font; $width = $boundings->width / $dataCount; $dataPoint = new ezcGraphCoordinate( $boundings->x0 + ( $boundings->width ) * $end->x + $xOffset + ( $type === ezcGraph::LINE ? 0 : $offset ), $boundings->y0 + ( $boundings->height ) * $end->y + $yOffset ); if ( $end->y < $axisPosition ) { $this->driver->drawTextBox( $text, new ezcGraphCoordinate( $dataPoint->x - $width / 2, $dataPoint->y - $size - $font->padding - $this->options->symbolSize ), $width, $size, ezcGraph::CENTER | ezcGraph::BOTTOM ); } else { $this->driver->drawTextBox( $text, new ezcGraphCoordinate( $dataPoint->x - $width / 2, $dataPoint->y + $font->padding + $this->options->symbolSize ), $width, $size, ezcGraph::CENTER | ezcGraph::TOP ); } } /** * Draw legend * * Will draw a legend in the bounding box * * @param ezcGraphBoundings $boundings Bounding of legend * @param ezcGraphChartElementLegend $legend Legend to draw; * @param int $type Type of legend: Protrait or landscape * @return void */ public function drawLegend( ezcGraphBoundings $boundings, ezcGraphChartElementLegend $legend, $type = ezcGraph::VERTICAL ) { $labels = $legend->labels; // Calculate boundings of each label if ( $type & ezcGraph::VERTICAL ) { $labelWidth = $boundings->width; $labelHeight = min( ( $boundings->height ) / count( $labels ) - $legend->spacing, $legend->symbolSize + 2 * $legend->padding ); } else { $labelWidth = ( $boundings->width ) / count( $labels ) - $legend->spacing; $labelHeight = min( $boundings->height, $legend->symbolSize + 2 * $legend->padding ); } $symbolSize = $labelHeight - 2 * $legend->padding; // Draw all labels $labelPosition = new ezcGraphCoordinate( $boundings->x0, $boundings->y0 ); foreach ( $labels as $label ) { $this->elements['legend_url'][$label['label']] = $label['url']; $this->elements['legend'][$label['label']]['symbol'] = $this->drawSymbol( new ezcGraphBoundings( $labelPosition->x + $legend->padding, $labelPosition->y + $legend->padding, $labelPosition->x + $legend->padding + $symbolSize, $labelPosition->y + $legend->padding + $symbolSize ), $label['color'], $label['symbol'] ); $this->elements['legend'][$label['label']]['text'] = $this->driver->drawTextBox( $label['label'], new ezcGraphCoordinate( $labelPosition->x + 2 * $legend->padding + $symbolSize, $labelPosition->y + $legend->padding ), $labelWidth - $symbolSize - 3 * $legend->padding, $labelHeight - 2 * $legend->padding, ezcGraph::LEFT | ezcGraph::MIDDLE ); $labelPosition->x += ( $type === ezcGraph::VERTICAL ? 0 : $labelWidth + $legend->spacing ); $labelPosition->y += ( $type === ezcGraph::VERTICAL ? $labelHeight + $legend->spacing : 0 ); } } /** * Draw box * * Box are wrapping each major chart element and draw border, background * and title to each chart element. * * Optionally a padding and margin for each box can be defined. * * @param ezcGraphBoundings $boundings Boundings of the box * @param ezcGraphColor $background Background color * @param ezcGraphColor $borderColor Border color * @param int $borderWidth Border width * @param int $margin Margin * @param int $padding Padding * @param mixed $title Title of the box * @param int $titleSize Size of title in the box * @return ezcGraphBoundings Remaining inner boundings */ public function drawBox( ezcGraphBoundings $boundings, ezcGraphColor $background = null, ezcGraphColor $borderColor = null, $borderWidth = 0, $margin = 0, $padding = 0, $title = false, $titleSize = 16 ) { // Apply margin $boundings->x0 += $margin; $boundings->y0 += $margin; $boundings->x1 -= $margin; $boundings->y1 -= $margin; if ( $background instanceof ezcGraphColor ) { // Draw box background $this->driver->drawPolygon( array( new ezcGraphCoordinate( $boundings->x0, $boundings->y0 ), new ezcGraphCoordinate( $boundings->x1, $boundings->y0 ), new ezcGraphCoordinate( $boundings->x1, $boundings->y1 ), new ezcGraphCoordinate( $boundings->x0, $boundings->y1 ), ), $background, true ); } if ( ( $borderColor instanceof ezcGraphColor ) && ( $borderWidth > 0 ) ) { // Draw border $this->driver->drawPolygon( array( new ezcGraphCoordinate( $boundings->x0, $boundings->y0 ), new ezcGraphCoordinate( $boundings->x1, $boundings->y0 ), new ezcGraphCoordinate( $boundings->x1, $boundings->y1 ), new ezcGraphCoordinate( $boundings->x0, $boundings->y1 ), ), $borderColor, false, $borderWidth ); // Reduce local boundings by borderWidth $boundings->x0 += $borderWidth; $boundings->y0 += $borderWidth; $boundings->x1 -= $borderWidth; $boundings->y1 -= $borderWidth; } // Apply padding $boundings->x0 += $padding; $boundings->y0 += $padding; $boundings->x1 -= $padding; $boundings->y1 -= $padding; // Add box title if ( $title !== false ) { switch ( $this->options->titlePosition ) { case ezcGraph::TOP: $this->driver->drawTextBox( $title, new ezcGraphCoordinate( $boundings->x0, $boundings->y0 ), $boundings->width, $titleSize, $this->options->titleAlignement ); $boundings->y0 += $titleSize + $padding; $boundings->y1 -= $titleSize + $padding; break; case ezcGraph::BOTTOM: $this->driver->drawTextBox( $title, new ezcGraphCoordinate( $boundings->x0, $boundings->y1 - $titleSize ), $boundings->width, $titleSize, $this->options->titleAlignement ); $boundings->y1 -= $titleSize + $padding; break; } } return $boundings; } /** * Draw text * * Draws the provided text in the boundings * * @param ezcGraphBoundings $boundings Boundings of text * @param string $text Text * @param int $align Alignement of text * @param ezcGraphRotation $rotation * @return void */ public function drawText( ezcGraphBoundings $boundings, $text, $align = ezcGraph::LEFT, ezcGraphRotation $rotation = null ) { $this->driver->drawTextBox( $text, new ezcGraphCoordinate( $boundings->x0, $boundings->y0 ), $boundings->width, $boundings->height, $align, $rotation ); } /** * Draw grid line * * Draw line for the grid in the chart background * * @param ezcGraphCoordinate $start Start point * @param ezcGraphCoordinate $end End point * @param ezcGraphColor $color Color of the grid line * @return void */ public function drawGridLine( ezcGraphCoordinate $start, ezcGraphCoordinate $end, ezcGraphColor $color ) { $this->driver->drawLine( $start, $end, $color, 1 ); } /** * Draw step line * * Draw a step (marker for label position) on a axis. * * @param ezcGraphCoordinate $start Start point * @param ezcGraphCoordinate $end End point * @param ezcGraphColor $color Color of the grid line * @return void */ public function drawStepLine( ezcGraphCoordinate $start, ezcGraphCoordinate $end, ezcGraphColor $color ) { $this->driver->drawLine( $start, $end, $color, 1 ); } /** * Draw axis * * Draws an axis form the provided start point to the end point. A specific * angle of the axis is not required. * * For the labeleing of the axis a sorted array with major steps and an * array with minor steps is expected, which are build like this: * array( * array( * 'position' => (float), * 'label' => (string), * ) * ) * where the label is optional. * * The label renderer class defines how the labels are rendered. For more * documentation on this topic have a look at the basic label renderer * class. * * Additionally it can be specified if a major and minor grid are rendered * by defining a color for them. The axis label is used to add a caption * for the axis. * * @param ezcGraphBoundings $boundings Boundings of axis * @param ezcGraphCoordinate $start Start point of axis * @param ezcGraphCoordinate $end Endpoint of axis * @param ezcGraphChartElementAxis $axis Axis to render * @param ezcGraphAxisLabelRenderer $labelClass Used label renderer * @return void */ public function drawAxis( ezcGraphBoundings $boundings, ezcGraphCoordinate $start, ezcGraphCoordinate $end, ezcGraphChartElementAxis $axis, ezcGraphAxisLabelRenderer $labelClass = null, ezcGraphBoundings $innerBoundings = null ) { // Legacy axis drawing for BC reasons if ( $innerBoundings === null ) { return $this->legacyDrawAxis( $boundings, $start, $end, $axis, $labelClass ); } // Calculate axis start and end points depending on inner boundings if ( ( $axis->position === ezcGraph::TOP ) || ( $axis->position === ezcGraph::BOTTOM ) ) { $innerStart = new ezcGraphCoordinate( $start->x + $boundings->x0, ( $axis->position === ezcGraph::TOP ? $innerBoundings->y0 : $innerBoundings->y1 ) ); $innerEnd = new ezcGraphCoordinate( $end->x + $boundings->x0, ( $axis->position === ezcGraph::TOP ? $innerBoundings->y1 : $innerBoundings->y0 ) ); } else { $innerStart = new ezcGraphCoordinate( ( $axis->position === ezcGraph::LEFT ? $innerBoundings->x0 : $innerBoundings->x1 ), $start->y + $boundings->y0 ); $innerEnd = new ezcGraphCoordinate( ( $axis->position === ezcGraph::LEFT ? $innerBoundings->x1 : $innerBoundings->x0 ), $end->y + $boundings->y0 ); } // Shorten axis, if requested if ( $this->options->shortAxis ) { $start = clone $innerStart; $end = clone $innerEnd; } else { $start->x += $boundings->x0; $start->y += $boundings->y0; $end->x += $boundings->x0; $end->y += $boundings->y0; } // Determine normalized direction $direction = new ezcGraphVector( $start->x - $end->x, $start->y - $end->y ); $direction->unify(); // Draw axis $this->driver->drawLine( $start, $end, $axis->border, 1 ); // Draw small arrowhead $this->drawAxisArrowHead( $end, $direction, max( $axis->minArrowHeadSize, min( $axis->maxArrowHeadSize, abs( ceil( ( ( $end->x - $start->x ) + ( $end->y - $start->y ) ) * $axis->axisSpace / 4 ) ) ) ), $axis->border ); // Draw axis label, if set $this->drawAxisLabel( $end, $innerBoundings, $axis ); // If font should not be synchronized, use font configuration from // each axis if ( $this->options->syncAxisFonts === false ) { $this->driver->options->font = $axis->font; } $labelClass->renderLabels( $this, $boundings, $innerStart, $innerEnd, $axis, $innerBoundings ); } /** * Draw axis label * * Draw labels at the end of an axis. * * @param ezcGraphCoordinate $position * @param ezcGraphBoundings $boundings * @param ezcGraphChartElementAxis $axis * @return void */ protected function drawAxisLabel( ezcGraphCoordinate $position, ezcGraphBoundings $boundings, ezcGraphChartElementAxis $axis ) { if ( $axis->label === false ) { return; } $width = $boundings->width; switch ( $axis->position ) { case ezcGraph::TOP: $this->driver->drawTextBox( $axis->label, new ezcGraphCoordinate( $position->x + $axis->labelMargin - $width * ( 1 - $axis->axisSpace * 2 ), $position->y - $axis->labelMargin - $axis->labelSize ), $width * ( 1 - $axis->axisSpace * 2 ) - $axis->labelMargin, $axis->labelSize, ezcGraph::TOP | ezcGraph::RIGHT, new ezcGraphRotation( $axis->labelRotation, new ezcGraphCoordinate( $position->x + $axis->labelSize / 2, $position->y - $axis->labelSize / 2 ) ) ); break; case ezcGraph::BOTTOM: $this->driver->drawTextBox( $axis->label, new ezcGraphCoordinate( $position->x + $axis->labelMargin, $position->y + $axis->labelMargin ), $width * ( 1 - $axis->axisSpace * 2 ) - $axis->labelMargin, $axis->labelSize, ezcGraph::TOP | ezcGraph::LEFT, new ezcGraphRotation( $axis->labelRotation, new ezcGraphCoordinate( $position->x + $axis->labelSize / 2, $position->y + $axis->labelSize / 2 ) ) ); break; case ezcGraph::LEFT: $this->driver->drawTextBox( $axis->label, new ezcGraphCoordinate( $position->x - $width, $position->y - $axis->labelSize - $axis->labelMargin ), $width - $axis->labelMargin, $axis->labelSize, ezcGraph::BOTTOM | ezcGraph::RIGHT, new ezcGraphRotation( $axis->labelRotation, new ezcGraphCoordinate( $position->x - $axis->labelSize / 2, $position->y - $axis->labelSize / 2 ) ) ); break; case ezcGraph::RIGHT: $this->driver->drawTextBox( $axis->label, new ezcGraphCoordinate( $position->x, $position->y - $axis->labelSize - $axis->labelMargin ), $width - $axis->labelMargin, $axis->labelSize, ezcGraph::BOTTOM | ezcGraph::LEFT, new ezcGraphRotation( $axis->labelRotation, new ezcGraphCoordinate( $position->x + $axis->labelSize / 2, $position->y - $axis->labelSize / 2 ) ) ); break; } } /** * Draw axis * * Draws an axis form the provided start point to the end point. A specific * angle of the axis is not required. * * For the labeleing of the axis a sorted array with major steps and an * array with minor steps is expected, which are build like this: * array( * array( * 'position' => (float), * 'label' => (string), * ) * ) * where the label is optional. * * The label renderer class defines how the labels are rendered. For more * documentation on this topic have a look at the basic label renderer * class. * * Additionally it can be specified if a major and minor grid are rendered * by defining a color for them. The axis label is used to add a caption * for the axis. * * This function is deprecated and will be removed in favor of its * reimplementation using the innerBoundings parameter. * * @param ezcGraphBoundings $boundings Boundings of axis * @param ezcGraphCoordinate $start Start point of axis * @param ezcGraphCoordinate $end Endpoint of axis * @param ezcGraphChartElementAxis $axis Axis to render * @param ezcGraphAxisLabelRenderer $labelClass Used label renderer * @apichange * @return void */ protected function legacyDrawAxis( ezcGraphBoundings $boundings, ezcGraphCoordinate $start, ezcGraphCoordinate $end, ezcGraphChartElementAxis $axis, ezcGraphAxisLabelRenderer $labelClass = null ) { // Store axis space for use by label renderer switch ( $axis->position ) { case ezcGraph::TOP: case ezcGraph::BOTTOM: $this->xAxisSpace = ( $boundings->width ) * $axis->axisSpace; break; case ezcGraph::LEFT: case ezcGraph::RIGHT: $this->yAxisSpace = ( $boundings->height ) * $axis->axisSpace; break; } // Clone boundings because of internal modifications $boundings = clone $boundings; $start->x += $boundings->x0; $start->y += $boundings->y0; $end->x += $boundings->x0; $end->y += $boundings->y0; // Shorten drawn axis, if requested. if ( ( $this->options->shortAxis === true ) && ( ( $axis->position === ezcGraph::TOP ) || ( $axis->position === ezcGraph::BOTTOM ) ) ) { $axisStart = clone $start; $axisEnd = clone $end; $axisStart->y += $boundings->height * $axis->axisSpace * ( $axis->position === ezcGraph::TOP ? 1 : -1 ); $axisEnd->y -= $boundings->height * $axis->axisSpace * ( $axis->position === ezcGraph::TOP ? 1 : -1 ); } elseif ( ( $this->options->shortAxis === true ) && ( ( $axis->position === ezcGraph::LEFT ) || ( $axis->position === ezcGraph::RIGHT ) ) ) { $axisStart = clone $start; $axisEnd = clone $end; $axisStart->x += $boundings->width * $axis->axisSpace * ( $axis->position === ezcGraph::LEFT ? 1 : -1 ); $axisEnd->x -= $boundings->width * $axis->axisSpace * ( $axis->position === ezcGraph::LEFT ? 1 : -1 ); } else { $axisStart = $start; $axisEnd = $end; } // Determine normalized direction $direction = new ezcGraphVector( $start->x - $end->x, $start->y - $end->y ); $direction->unify(); // Draw axis $this->driver->drawLine( $axisStart, $axisEnd, $axis->border, 1 ); // Draw small arrowhead $this->drawAxisArrowHead( $axisEnd, $direction, max( $axis->minArrowHeadSize, min( $axis->maxArrowHeadSize, abs( ceil( ( ( $end->x - $start->x ) + ( $end->y - $start->y ) ) * $axis->axisSpace / 4 ) ) ) ), $axis->border ); // Draw axis label, if set $this->drawAxisLabel( $end, $boundings, $axis ); // Collect axis labels and draw, when all axisSpaces are collected $this->axisLabels[] = array( 'object' => $labelClass, 'boundings' => $boundings, 'start' => clone $start, 'end' => clone $end, 'axis' => $axis, ); if ( $this->xAxisSpace && $this->yAxisSpace ) { $this->drawAxisLabels(); } } /** * Draw all left axis labels * * @return void */ protected function drawAxisLabels() { foreach ( $this->axisLabels as $nr => $axisLabel ) { // If font should not be synchronized, use font configuration from // each axis if ( $this->options->syncAxisFonts === false ) { $this->driver->options->font = $axisLabel['axis']->font; } $start = $axisLabel['start']; $end = $axisLabel['end']; $direction = new ezcGraphVector( $end->x - $start->x, $end->y - $start->y ); $direction->unify(); // Convert elipse to circle for correct angle calculation $direction->y *= ( $this->xAxisSpace / $this->yAxisSpace ); $angle = $direction->angle( new ezcGraphVector( 0, 1 ) ); $movement = new ezcGraphVector( sin( $angle ) * $this->xAxisSpace * ( $direction->x < 0 ? -1 : 1 ), cos( $angle ) * $this->yAxisSpace ); $start->x += $movement->x; $start->y += $movement->y; $end->x -= $movement->x; $end->y -= $movement->y; $axisLabel['object']->renderLabels( $this, $axisLabel['boundings'], $start, $end, $axisLabel['axis'] ); // Prevent from redrawing axis on more then 2 axis. unset( $this->axisLabels[$nr] ); } } /** * Draw background image * * Draws a background image at the defined position. If repeat is set the * background image will be repeated like any texture. * * @param ezcGraphBoundings $boundings Boundings for the background image * @param string $file Filename of background image * @param int $position Position of background image * @param int $repeat Type of repetition * @return void */ public function drawBackgroundImage( ezcGraphBoundings $boundings, $file, $position = 48, // ezcGraph::CENTER | ezcGraph::MIDDLE $repeat = ezcGraph::NO_REPEAT ) { $imageData = getimagesize( $file ); $imageWidth = $imageData[0]; $imageHeight = $imageData[1]; $imageWidth = min( $imageWidth, $boundings->width ); $imageHeight = min( $imageHeight, $boundings->height ); $imagePosition = new ezcGraphCoordinate( $boundings->x0, $boundings->y0 ); // Determine x position switch ( true ) { case ( $repeat & ezcGraph::HORIZONTAL ): // If is repeated on this axis fall back to position zero case ( $position & ezcGraph::LEFT ): $imagePosition->x = $boundings->x0; break; case ( $position & ezcGraph::RIGHT ): $imagePosition->x = max( $boundings->x1 - $imageWidth, $boundings->x0 ); break; default: $imagePosition->x = max( $boundings->x0 + ( $boundings->width - $imageWidth ) / 2, $boundings->x0 ); break; } // Determine y position switch ( true ) { case ( $repeat & ezcGraph::VERTICAL ): // If is repeated on this axis fall back to position zero case ( $position & ezcGraph::TOP ): $imagePosition->y = $boundings->y0; break; case ( $position & ezcGraph::BOTTOM ): $imagePosition->y = max( $boundings->y1 - $imageHeight, $boundings->y0 ); break; default: $imagePosition->y = max( $boundings->y0 + ( $boundings->height - $imageHeight ) / 2, $boundings->y0 ); break; } // Texturize backround based on position and repetition $position = new ezcGraphCoordinate( $imagePosition->x, $imagePosition->y ); do { $position->y = $imagePosition->y; do { $this->driver->drawImage( $file, $position, $imageWidth, $imageHeight ); $position->y += $imageHeight; } while ( ( $position->y < $boundings->y1 ) && ( $repeat & ezcGraph::VERTICAL ) ); $position->x += $imageWidth; } while ( ( $position->x < $boundings->x1 ) && ( $repeat & ezcGraph::HORIZONTAL ) ); } /** * Call all postprocessing functions * * @return void */ protected function finish() { $this->finishCircleSectors(); $this->finishPieSegmentLabels(); $this->finishLineSymbols(); return true; } /** * Reset renderer properties * * Reset all renderer properties, which were calculated during the * rendering process, to offer a clean environment for rerendering. * * @return void */ protected function resetRenderer() { parent::resetRenderer(); // Also reset special 2D renderer options $this->pieSegmentLabels = array( 0 => array(), 1 => array(), ); $this->pieSegmentBoundings = false; $this->linePostSymbols = array(); $this->axisLabels = array(); $this->circleSectors = array(); } /** * Render odometer chart * * @param ezcGraphBoundings $boundings * @param ezcGraphChartElementAxis $axis * @param ezcGraphOdometerChartOptions $options * @return ezcGraphBoundings */ public function drawOdometer( ezcGraphBoundings $boundings, ezcGraphChartElementAxis $axis, ezcGraphOdometerChartOptions $options ) { $height = $boundings->height * $options->odometerHeight; // Draw axis $oldAxisSpace = $axis->axisSpace; $axis->axisSpace = 0; $axis->render( $this, $boundings ); // Reset axisspaces to correct values $this->xAxisSpace = $boundings->width * $oldAxisSpace; $this->yAxisSpace = ( $boundings->height - $height ) / 2; $this->drawAxisLabels(); // Reduce size of chart boundings respecting requested odometer height $boundings->x0 += $this->xAxisSpace; $boundings->x1 -= $this->xAxisSpace; $boundings->y0 += $this->yAxisSpace; $boundings->y1 -= $this->yAxisSpace; $gradient = new ezcGraphLinearGradient( new ezcGraphCoordinate( $boundings->x0, $boundings->y0 ), new ezcGraphCoordinate( $boundings->x1, $boundings->y0 ), $options->startColor, $options->endColor ); // Simply draw box with gradient and optional border $this->drawBox( $boundings, $gradient, $options->borderColor, $options->borderWidth ); // Return modified chart boundings return $boundings; } /** * Draw a single odometer marker. * * @param ezcGraphBoundings $boundings * @param ezcGraphCoordinate $position * @param int $symbol * @param ezcGraphColor $color * @param int $width */ public function drawOdometerMarker( ezcGraphBoundings $boundings, ezcGraphCoordinate $position, $symbol, ezcGraphColor $color, $width ) { $this->driver->drawLine( new ezcGraphCoordinate( $xPos = $boundings->x0 + ( $position->x * $boundings->width ), $boundings->y0 ), new ezcGraphCoordinate( $xPos, $boundings->y1 ), $color, $width ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/renderer/3d.php000066400000000000000000002560271226600447100236040ustar00rootroot00000000000000 * $graph = new ezcGraphPieChart(); * $graph->palette = new ezcGraphPaletteEzRed(); * $graph->title = 'Access statistics'; * $graph->options->label = '%2$d (%3$.1f%%)'; * * $graph->data['Access statistics'] = new ezcGraphArrayDataSet( array( * 'Mozilla' => 19113, * 'Explorer' => 10917, * 'Opera' => 1464, * 'Safari' => 652, * 'Konqueror' => 474, * ) ); * $graph->data['Access statistics']->highlight['Explorer'] = true; * * $graph->renderer = new ezcGraphRenderer3d(); * * $graph->renderer->options->moveOut = .2; * * $graph->renderer->options->pieChartOffset = 63; * * $graph->renderer->options->pieChartGleam = .3; * $graph->renderer->options->pieChartGleamColor = '#FFFFFF'; * * $graph->renderer->options->pieChartShadowSize = 5; * $graph->renderer->options->pieChartShadowColor = '#000000'; * * $graph->renderer->options->legendSymbolGleam = .5; * $graph->renderer->options->legendSymbolGleamSize = .9; * $graph->renderer->options->legendSymbolGleamColor = '#FFFFFF'; * * $graph->renderer->options->pieChartSymbolColor = '#55575388'; * * $graph->renderer->options->pieChartHeight = 5; * $graph->renderer->options->pieChartRotation = .8; * * $graph->render( 400, 150, 'tutorial_pie_chart_3d.svg' ); * * * @version 1.5 * @package Graph * @mainclass */ class ezcGraphRenderer3d extends ezcGraphRenderer implements ezcGraphStackedBarsRenderer { /** * Pie segment labels divided into two array, containing the labels on the * left and right side of the pie chart center. * * @var array */ protected $pieSegmentLabels = array( 0 => array(), 1 => array(), ); /** * Contains the boundings used for pie segments * * @var ezcGraphBoundings */ protected $pieSegmentBoundings = false; /** * Array with symbols for post processing, which ensures, that the symbols * are rendered topmost. * * @var array */ protected $linePostSymbols = array(); /** * Array containing lines from the axis and grid which should be redrawn on * top of the data. * * @var array */ protected $frontLines = array(); /** * Collects circle sectors to draw shadow in background of all circle * sectors. * * @var array */ protected $circleSectors = array(); /** * Collects bar sides to draw them in a post processing step to simulate * a simple z buffer. * array( * array( * 'index' => (int) // used for sorting * 'context' => ezcGraphContext // context of call * 'method' => (string) // method of driver to call * 'parameters' => array // parameters for method call * ), ... * ) * * @var array */ protected $barPostProcessing = array(); /** * Options * * @var ezcGraphRenderer3dOptions */ protected $options; /** * Depth of displayed pseudo three dimensional line chart elements. * * @var float */ protected $depth = false; /** * Factor to reduce the width according to depth * * @var float */ protected $xDepthFactor = false; /** * Factor to reduce the height according to depth * * @var float */ protected $yDepthFactor = false; /** * Boundings for the chart data * * @var ezcGraphBoundings */ protected $dataBoundings = false; /** * Collect axis labels, so that the axis are drawn, when all axis spaces * are known. * * @var array */ protected $axisLabels = array(); /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->options = new ezcGraphRenderer3dOptions( $options ); } /** * __get * * @param mixed $propertyName * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return mixed * @ignore */ public function __get( $propertyName ) { switch ( $propertyName ) { case 'options': return $this->options; default: return parent::__get( $propertyName ); } } /** * Calculate the display coordinate from a coordinate * * Calculates the display coordinate of a coordinate depending on the * depth setting and the distance of the coordinate to the front of the * chart. * * @param ezcGraphCoordinate $c Coordinate * @param float $front Distance to front (0 - 1) * @return ezcGraphCoordinate Resulting coordinate */ protected function get3dCoordinate( ezcGraphCoordinate $c, $front = 1. ) { return new ezcGraphCoordinate( ( $c->x - $this->dataBoundings->x0 ) * $this->xDepthFactor + $this->dataBoundings->x0 + $this->depth * $front, ( $c->y - $this->dataBoundings->y0 ) * $this->yDepthFactor + $this->dataBoundings->y0 + $this->depth * ( 1 - $front ) ); } /** * Draw pie segment * * Draws a single pie segment * * @param ezcGraphBoundings $boundings Chart boundings * @param ezcGraphContext $context Context of call * @param ezcGraphColor $color Color of pie segment * @param float $startAngle Start angle * @param float $endAngle End angle * @param mixed $label Label of pie segment * @param bool $moveOut Move out from middle for hilighting * @return void */ public function drawPieSegment( ezcGraphBoundings $boundings, ezcGraphContext $context, ezcGraphColor $color, $startAngle = .0, $endAngle = 360., $label = false, $moveOut = false ) { // Apply offset $startAngle += $this->options->pieChartOffset; $endAngle += $this->options->pieChartOffset; // Calculate position and size of pie $center = new ezcGraphCoordinate( $boundings->x0 + ( $boundings->x1 - $boundings->x0 ) / 2, $boundings->y0 + ( $boundings->y1 - $boundings->y0 ) / 2 - $this->options->pieChartHeight / 2 ); // Limit radius to fourth of width and half of height at maximum $radius = min( ( $boundings->x1 - $boundings->x0 ) * $this->options->pieHorizontalSize, ( $boundings->y1 - $boundings->y0 ) * $this->options->pieVerticalSize ); // Move pie segment out of the center if ( $moveOut ) { $direction = ( $endAngle + $startAngle ) / 2; $center = new ezcGraphCoordinate( $center->x + $this->options->moveOut * $radius * cos( deg2rad( $direction ) ), $center->y + $this->options->moveOut * $radius * sin( deg2rad( $direction ) ) * $this->options->pieChartRotation ); } // Add circle sector to queue $this->circleSectors[] = array( 'center' => $center, 'context' => $context, 'width' => $radius * 2 * ( 1 - $this->options->moveOut ), 'height' => $radius * 2 * ( 1 - $this->options->moveOut ) * $this->options->pieChartRotation - $this->options->pieChartHeight, 'start' => $startAngle, 'end' => $endAngle, 'color' => $color, ); if ( $label ) { // Determine position of label $direction = ( $endAngle + $startAngle ) / 2; $pieSegmentCenter = new ezcGraphCoordinate( $center->x + cos( deg2rad( $direction ) ) * $radius, $center->y + sin( deg2rad( $direction ) ) * $radius * $this->options->pieChartRotation ); // Split labels up into left a right site and index them on their // y position $this->pieSegmentLabels[(int) ($pieSegmentCenter->x > $center->x)][(int) ( $pieSegmentCenter->y * 100 )] = array( new ezcGraphCoordinate( $center->x + cos( deg2rad( $direction ) ) * $radius * 2 / 3 * ( 1 - $this->options->moveOut ), $center->y + sin( deg2rad( $direction ) ) * ( $radius - $this->options->pieChartHeight ) * 2 / 3 * ( 1 - $this->options->moveOut ) * $this->options->pieChartRotation ), $label, $context, ); } if ( !$this->pieSegmentBoundings ) { $this->pieSegmentBoundings = $boundings; } } /** * Draws the collected pie segment labels * * All labels are collected and drawn later to be able to partition the * available space for the labels woth knowledge of the overall label * count and their required size and optimal position. * * @return void */ protected function finishPieSegmentLabels() { if ( $this->pieSegmentBoundings === false ) { return true; } $boundings = $this->pieSegmentBoundings; // Calculate position and size of pie $center = new ezcGraphCoordinate( $boundings->x0 + ( $boundings->x1 - $boundings->x0 ) / 2, $boundings->y0 + ( $boundings->y1 - $boundings->y0 ) / 2 ); // Limit radius to fourth of width and half of height at maximum $radius = min( ( $boundings->width ) * $this->options->pieHorizontalSize, ( $boundings->height ) * $this->options->pieVerticalSize ); $pieChartHeight = min( $radius * 2 + $radius / max( 1, count ( $this->pieSegmentLabels[0] ), count( $this->pieSegmentLabels[1] ) ) * 4, $boundings->height ); $pieChartYPosition = $boundings->y0 + ( ( $boundings->height ) - $pieChartHeight ) / 2; // Calculate maximum height of labels $labelHeight = min( ( count( $this->pieSegmentLabels[0] ) ? $pieChartHeight / count( $this->pieSegmentLabels[0] ) : $pieChartHeight ), ( count( $this->pieSegmentLabels[1] ) ? $pieChartHeight / count( $this->pieSegmentLabels[1] ) : $pieChartHeight ), ( $pieChartHeight ) * $this->options->maxLabelHeight ); $symbolSize = $this->options->symbolSize; foreach ( $this->pieSegmentLabels as $side => $labelPart ) { $minHeight = $pieChartYPosition; $toShare = $pieChartHeight - count( $labelPart ) * $labelHeight; // Sort to draw topmost label first ksort( $labelPart ); $sign = ( $side ? -1 : 1 ); foreach ( $labelPart as $height => $label ) { $height = (int) ( $height / 100 ); if ( ( $height - $labelHeight / 2 ) > $minHeight ) { $share = min( $toShare, ( $height - $labelHeight / 2) - $minHeight ); $minHeight += $share; $toShare -= $share; } // Determine position of label $minHeight += max( 0, $height - $minHeight - $labelHeight ) / $pieChartHeight * $toShare; $verticalDistance = ( $center->y - $minHeight - $labelHeight / 2 ) / $radius; $labelPosition = new ezcGraphCoordinate( $center->x - $sign * ( abs( $verticalDistance ) > 1 // If vertical distance to center is greater then the // radius, use the centerline for the horizontal // position ? max ( 5, abs( $label[0]->x - $center->x ) ) // Else place the label outside of the pie chart : ( cos ( asin ( $verticalDistance ) ) * $radius + $symbolSize * (int) $this->options->showSymbol ) ), $minHeight + $labelHeight / 2 ); if ( $this->options->showSymbol ) { // Draw label $this->driver->drawLine( $label[0], $labelPosition, $this->options->pieChartSymbolColor, 1 ); $this->driver->drawCircle( $label[0], $symbolSize, $symbolSize, $this->options->pieChartSymbolColor, true ); $this->driver->drawCircle( $labelPosition, $symbolSize, $symbolSize, $this->options->pieChartSymbolColor, true ); } $this->addElementReference( $label[2], $this->driver->drawTextBox( $label[1], new ezcGraphCoordinate( ( !$side ? $boundings->x0 : $labelPosition->x + $symbolSize ), $minHeight ), ( !$side ? $labelPosition->x - $boundings->x0 - $symbolSize : $boundings->x1 - $labelPosition->x - $symbolSize ), $labelHeight, ( !$side ? ezcGraph::RIGHT : ezcGraph::LEFT ) | ezcGraph::MIDDLE ) ); // Add used space to minHeight $minHeight += $labelHeight; } } } /** * Draws the collected circle sectors * * All circle sectors are collected and drawn later to be able to render * the shadows of the pie segments in the back of all pie segments, and * ensure the correct drawing order for all pie segment elements. * * @return void */ protected function finishCirleSectors() { $zBuffer = array(); $shadows = array(); $shadowCenter = false; $shadowEndAngle = false; // Add circle sector sides to simple z buffer prioriry list foreach ( $this->circleSectors as $circleSector ) { // Draw shadow if wanted if ( $this->options->pieChartShadowSize > 0 ) { if ( $shadowEndAngle === false ) { $shadowStartAngle = $circleSector['start']; $shadowEndAngle = $circleSector['end']; $shadowCenter = $circleSector['center']; } elseif ( $circleSector['center'] == $shadowCenter ) { $shadowEndAngle = $circleSector['end']; } else { $shadows[] = array( 'center' => $shadowCenter, 'start' => $shadowStartAngle, 'end' => $shadowEndAngle, 'width' => $circleSector['width'], 'height' => $circleSector['height'], ); $shadowCenter = $circleSector['center']; $shadowStartAngle = $circleSector['start']; $shadowEndAngle = $circleSector['end']; } } $darkenedColor = $circleSector['color']->darken( $this->options->dataBorder ); $center = (int) ( $circleSector['center']->y + sin( deg2rad( $circleSector['start'] + ( $circleSector['end'] - $circleSector['start'] ) / 2 ) ) * $circleSector['height'] / 2 + $this->options->pieChartHeight / 2 + 1 ); $zBuffer[$center][] = array( 'method' => 'drawCircularArc', 'paramenters' => array( $circleSector['center'], $circleSector['width'], $circleSector['height'], $this->options->pieChartHeight, $circleSector['start'], $circleSector['end'], $circleSector['color'] ) ); // Left side $polygonPoints = array( $circleSector['center'], new ezcGraphCoordinate( $circleSector['center']->x, $circleSector['center']->y + $this->options->pieChartHeight ), new ezcGraphCoordinate( $circleSector['center']->x + cos( deg2rad( $circleSector['start'] ) ) * $circleSector['width'] / 2, $circleSector['center']->y + sin( deg2rad( $circleSector['start'] ) ) * $circleSector['height'] / 2 + $this->options->pieChartHeight ), new ezcGraphCoordinate( $circleSector['center']->x + cos( deg2rad( $circleSector['start'] ) ) * $circleSector['width'] / 2, $circleSector['center']->y + sin( deg2rad( $circleSector['start'] ) ) * $circleSector['height'] / 2 ), ); // Get average y coordinate for polygon to use for zBuffer $center = 0; foreach ( $polygonPoints as $point ) { $center += $point->y; } $center = (int) ( $center / count( $polygonPoints ) ); $zBuffer[$center][] = array( 'method' => 'drawPolygon', 'paramenters' => array( $polygonPoints, $circleSector['color'], true ), ); $zBuffer[$center][] = array( 'method' => 'drawPolygon', 'paramenters' => array( $polygonPoints, $darkenedColor, false ), ); // Right side $polygonPoints = array( $circleSector['center'], new ezcGraphCoordinate( $circleSector['center']->x, $circleSector['center']->y + $this->options->pieChartHeight ), new ezcGraphCoordinate( $circleSector['center']->x + cos( deg2rad( $circleSector['end'] ) ) * $circleSector['width'] / 2, $circleSector['center']->y + sin( deg2rad( $circleSector['end'] ) ) * $circleSector['height'] / 2 + $this->options->pieChartHeight ), new ezcGraphCoordinate( $circleSector['center']->x + cos( deg2rad( $circleSector['end'] ) ) * $circleSector['width'] / 2, $circleSector['center']->y + sin( deg2rad( $circleSector['end'] ) ) * $circleSector['height'] / 2 ), ); // Get average y coordinate for polygon to use for zBuffer $center = 0; foreach ( $polygonPoints as $point ) { $center += $point->y; } $center = (int) ( $center / count( $polygonPoints ) ); $zBuffer[$center][] = array( 'method' => 'drawPolygon', 'paramenters' => array( $polygonPoints, $circleSector['color'], true ), ); $zBuffer[$center][] = array( 'method' => 'drawPolygon', 'paramenters' => array( $polygonPoints, $darkenedColor, false ), ); } if ( $this->options->pieChartShadowSize > 0 ) { $shadows[] = array( 'center' => $shadowCenter, 'start' => $shadowStartAngle, 'end' => $shadowEndAngle, 'width' => $circleSector['width'], 'height' => $circleSector['height'], ); } // Draw collected shadows foreach ( $shadows as $circleSector ) { for ( $i = $this->options->pieChartShadowSize; $i > 0; --$i ) { $startAngle = $circleSector['start']; $endAngle = $circleSector['end']; $startAngle = $circleSector['start'] - ( $this->options->pieChartShadowSize - $i ); $endAngle = $circleSector['end'] + ( $this->options->pieChartShadowSize - $i ); if ( ( $endAngle - $startAngle ) >= 360 ) { $this->driver->drawCircle( new ezcGraphCoordinate( $circleSector['center']->x, $circleSector['center']->y + $this->options->pieChartHeight ), $circleSector['width'] + $i * 2, $circleSector['height'] + $i * 2, $this->options->pieChartShadowColor->transparent( 1 - ( $this->options->pieChartShadowTransparency / $this->options->pieChartShadowSize ) ), true ); } else { $this->driver->drawCircleSector( new ezcGraphCoordinate( $circleSector['center']->x, $circleSector['center']->y + $this->options->pieChartHeight ), $circleSector['width'] + $i * 2, $circleSector['height'] + $i * 2, $startAngle, $endAngle, $this->options->pieChartShadowColor->transparent( 1 - ( $this->options->pieChartShadowTransparency / $this->options->pieChartShadowSize ) ), true ); } } } ksort( $zBuffer ); foreach ( $zBuffer as $sides ) { foreach ( $sides as $side ) { call_user_func_array( array( $this->driver, $side['method'] ), $side['paramenters'] ); } } // Draw circle sector for front foreach ( $this->circleSectors as $circleSector ) { $this->addElementReference( $circleSector['context'], $this->driver->drawCircleSector( $circleSector['center'], $circleSector['width'], $circleSector['height'], $circleSector['start'], $circleSector['end'], $circleSector['color'], true ) ); if ( $this->options->pieChartGleam !== false ) { $gradient = new ezcGraphLinearGradient( $circleSector['center'], new ezcGraphCoordinate( $circleSector['center']->x - $circleSector['width'] / 2, $circleSector['center']->y - $circleSector['height'] / 2 ), $this->options->pieChartGleamColor->transparent( 1 ), $this->options->pieChartGleamColor->transparent( $this->options->pieChartGleam ) ); $this->addElementReference( $circleSector['context'], $this->driver->drawCircleSector( $circleSector['center'], $circleSector['width'] - $this->options->pieChartGleamBorder * 2, $circleSector['height'] - $this->options->pieChartGleamBorder * 2 * $this->options->pieChartRotation, $circleSector['start'], $circleSector['end'], $gradient, true ) ); } $darkenedColor = $circleSector['color']->darken( $this->options->dataBorder ); $this->driver->drawCircleSector( $circleSector['center'], $circleSector['width'], $circleSector['height'], $circleSector['start'], $circleSector['end'], $darkenedColor, false ); if ( $this->options->pieChartGleam !== false ) { $radialGradient = new ezcGraphRadialGradient( new ezcGraphCoordinate( $circleSector['center']->x + $circleSector['width'] / 2 * cos( deg2rad( 135 ) ), $circleSector['center']->y + $circleSector['height'] / 2 * sin( deg2rad( 135 ) ) ), $circleSector['width'], $circleSector['height'], $this->options->pieChartGleamColor->transparent( $this->options->pieChartGleam ), $this->options->pieChartGleamColor->transparent( .8 ) ); $this->driver->drawCircularArc( $circleSector['center'], $circleSector['width'], $circleSector['height'], 0, $circleSector['start'], $circleSector['end'], $radialGradient, false ); } } } /** * Draw collected front lines * * Draw all grid and axis lines, which should be redrawn in front of the * data. * * @return void */ protected function finishFrontLines() { foreach ( $this->frontLines as $line ) { $this->driver->drawLine( $line[0], $line[1], $line[2], $line[3] ); } } /** * Draw the collected line symbols * * Symbols for the data lines are collected and delayed to ensure that * they are not covered and hidden by other data lines. * * @return void */ protected function finishLineSymbols() { foreach ( $this->linePostSymbols as $symbol ) { $this->addElementReference( $symbol['context'], $this->drawSymbol( $symbol['boundings'], $symbol['color'], $symbol['symbol'] ) ); } } /** * Draws a bar with a rectangular ground shape. * * @param ezcGraphContext $context * @param ezcGraphColor $color * @param ezcGraphCoordinate $position * @param float $barWidth * @param float $offset * @param float $axisPosition * @param float $startDepth * @param float $midDepth * @param float $endDepth * @return void */ protected function drawRectangularBar( ezcGraphContext $context, ezcGraphColor $color, ezcGraphCoordinate $position, $barWidth, $offset, $axisPosition, $startDepth, $midDepth, $endDepth ) { $barPolygonArray = array( new ezcGraphCoordinate( $this->dataBoundings->x0 + $this->xAxisSpace + $position->x * ( $this->dataBoundings->x1 - ( $this->dataBoundings->x0 + 2 * $this->xAxisSpace ) ) + $offset, $this->dataBoundings->y0 + $this->yAxisSpace + $axisPosition * ( $this->dataBoundings->y1 - ( $this->dataBoundings->y0 + 2 * $this->yAxisSpace ) ) ), new ezcGraphCoordinate( $this->dataBoundings->x0 + $this->xAxisSpace + $position->x * ( $this->dataBoundings->x1 - ( $this->dataBoundings->x0 + 2 * $this->xAxisSpace ) ) + $offset, $this->dataBoundings->y0 + $this->yAxisSpace + $position->y * ( $this->dataBoundings->y1 - ( $this->dataBoundings->y0 + 2 * $this->yAxisSpace ) ) ), new ezcGraphCoordinate( $this->dataBoundings->x0 + $this->xAxisSpace + $position->x * ( $this->dataBoundings->x1 - ( $this->dataBoundings->x0 + 2 * $this->xAxisSpace ) ) + $offset + $barWidth, $this->dataBoundings->y0 + $this->yAxisSpace + $position->y * ( $this->dataBoundings->y1 - ( $this->dataBoundings->y0 + 2 * $this->yAxisSpace ) ) ), new ezcGraphCoordinate( $this->dataBoundings->x0 + $this->xAxisSpace + $position->x * ( $this->dataBoundings->x1 - ( $this->dataBoundings->x0 + 2 * $this->xAxisSpace ) ) + $offset + $barWidth, $this->dataBoundings->y0 + $this->yAxisSpace + $axisPosition * ( $this->dataBoundings->y1 - ( $this->dataBoundings->y0 + 2 * $this->yAxisSpace ) ) ), ); // Draw right bar side $this->barPostProcessing[] = array( 'index' => $barPolygonArray[2]->x + ( 1 - $position->y ), 'method' => 'drawPolygon', 'context' => $context, 'parameters' => array( array( $this->get3dCoordinate( $barPolygonArray[2], $startDepth ), $this->get3dCoordinate( $barPolygonArray[3], $startDepth ), $this->get3dCoordinate( $barPolygonArray[3], $endDepth ), $this->get3dCoordinate( $barPolygonArray[2], $endDepth ), ), $color->darken( $this->options->barDarkenSide ), true ), ); // Draw top side $this->barPostProcessing[] = array( 'index' => $barPolygonArray[1]->x + ( 1 - $position->y ), 'method' => 'drawPolygon', 'context' => $context, 'parameters' => array( ( $barPolygonArray[1]->y < $barPolygonArray[3]->y ? array( $this->get3dCoordinate( $barPolygonArray[1], $startDepth ), $this->get3dCoordinate( $barPolygonArray[2], $startDepth ), $this->get3dCoordinate( $barPolygonArray[2], $endDepth ), $this->get3dCoordinate( $barPolygonArray[1], $endDepth ), ) : array( $this->get3dCoordinate( $barPolygonArray[0], $startDepth ), $this->get3dCoordinate( $barPolygonArray[3], $startDepth ), $this->get3dCoordinate( $barPolygonArray[3], $endDepth ), $this->get3dCoordinate( $barPolygonArray[0], $endDepth ), ) ), $color->darken( $this->options->barDarkenTop ), true ), ); // Draw top side gleam if ( $this->options->barChartGleam !== false ) { $this->barPostProcessing[] = array( 'index' => $barPolygonArray[1]->x + 1 + ( 1 - $position->y ), 'method' => 'drawPolygon', 'context' => $context, 'parameters' => array( ( $barPolygonArray[1]->y < $barPolygonArray[3]->y ? array( $this->get3dCoordinate( $barPolygonArray[1], $startDepth ), $this->get3dCoordinate( $barPolygonArray[2], $startDepth ), $this->get3dCoordinate( $barPolygonArray[2], $endDepth ), $this->get3dCoordinate( $barPolygonArray[1], $endDepth ), ) : array( $this->get3dCoordinate( $barPolygonArray[0], $startDepth ), $this->get3dCoordinate( $barPolygonArray[3], $startDepth ), $this->get3dCoordinate( $barPolygonArray[3], $endDepth ), $this->get3dCoordinate( $barPolygonArray[0], $endDepth ), ) ), new ezcGraphLinearGradient( ( $barPolygonArray[1]->y < $barPolygonArray[3]->y ? $this->get3dCoordinate( $barPolygonArray[2], $endDepth ) : $this->get3dCoordinate( $barPolygonArray[3], $endDepth ) ), ( $barPolygonArray[1]->y < $barPolygonArray[3]->y ? $this->get3dCoordinate( $barPolygonArray[1], $startDepth ) : $this->get3dCoordinate( $barPolygonArray[0], $startDepth ) ), ezcGraphColor::fromHex( '#FFFFFFFF' ), ezcGraphColor::fromHex( '#FFFFFF' )->transparent( 1 - $this->options->barChartGleam ) ), true ), ); } // Draw front side $this->barPostProcessing[] = array( 'index' => $barPolygonArray[1]->x + ( 1 - $position->y ), 'method' => 'drawPolygon', 'context' => $context, 'parameters' => array( array( $this->get3dCoordinate( $barPolygonArray[0], $startDepth ), $this->get3dCoordinate( $barPolygonArray[1], $startDepth ), $this->get3dCoordinate( $barPolygonArray[2], $startDepth ), $this->get3dCoordinate( $barPolygonArray[3], $startDepth ), ), $color, true ), ); // Draw front side gleam if ( $this->options->barChartGleam !== false ) { $this->barPostProcessing[] = array( 'index' => $barPolygonArray[1]->x + 1 + ( 1 - $position->y ), 'method' => 'drawPolygon', 'context' => $context, 'parameters' => array( array( $this->get3dCoordinate( $barPolygonArray[0], $startDepth ), $this->get3dCoordinate( $barPolygonArray[1], $startDepth ), $this->get3dCoordinate( $barPolygonArray[2], $startDepth ), $this->get3dCoordinate( $barPolygonArray[3], $startDepth ), ), new ezcGraphLinearGradient( $this->get3dCoordinate( $barPolygonArray[3], $startDepth ), $this->get3dCoordinate( $barPolygonArray[1], $startDepth ), ezcGraphColor::fromHex( '#FFFFFFFF' ), ezcGraphColor::fromHex( '#FFFFFF' )->transparent( 1 - $this->options->barChartGleam ) ), true ), ); } } /** * Draws a bar with a diamond ground shape. * * @param ezcGraphContext $context * @param ezcGraphColor $color * @param ezcGraphCoordinate $position * @param float $barWidth * @param float $offset * @param float $axisPosition * @param float $startDepth * @param float $midDepth * @param float $endDepth * @return void */ protected function drawDiamondBar( ezcGraphContext $context, ezcGraphColor $color, ezcGraphCoordinate $position, $barWidth, $offset, $axisPosition, $startDepth, $midDepth, $endDepth ) { $barCoordinateArray = array( // The bottom point of the diamond is moved to .7 instead // of .5 because it looks more correct, even it is wrong... 'x' => array( $this->dataBoundings->x0 + $this->xAxisSpace + $position->x * ( $this->dataBoundings->x1 - ( $this->dataBoundings->x0 + 2 * $this->xAxisSpace ) ) + $offset, $this->dataBoundings->x0 + $this->xAxisSpace + $position->x * ( $this->dataBoundings->x1 - ( $this->dataBoundings->x0 + 2 * $this->xAxisSpace ) ) + $offset + $barWidth * .7, $this->dataBoundings->x0 + $this->xAxisSpace + $position->x * ( $this->dataBoundings->x1 - ( $this->dataBoundings->x0 + 2 * $this->xAxisSpace ) ) + $offset + $barWidth, $this->dataBoundings->x0 + $this->xAxisSpace + $position->x * ( $this->dataBoundings->x1 - ( $this->dataBoundings->x0 + 2 * $this->xAxisSpace ) ) + $offset + $barWidth * .3, ), 'y' => array( $this->dataBoundings->y0 + $this->yAxisSpace + $axisPosition * ( $this->dataBoundings->y1 - ( $this->dataBoundings->y0 + 2 * $this->yAxisSpace ) ), $this->dataBoundings->y0 + $this->yAxisSpace + $position->y * ( $this->dataBoundings->y1 - ( $this->dataBoundings->y0 + 2 * $this->yAxisSpace ) ), ), ); // Left side $this->barPostProcessing[] = array( 'index' => $barCoordinateArray['x'][0], 'method' => 'drawPolygon', 'context' => $context, 'parameters' => array( array( $this->get3dCoordinate( new ezcGraphCoordinate( $barCoordinateArray['x'][0], $barCoordinateArray['y'][0] ), $midDepth ), $this->get3dCoordinate( new ezcGraphCoordinate( $barCoordinateArray['x'][0], $barCoordinateArray['y'][1] ), $midDepth ), $this->get3dCoordinate( new ezcGraphCoordinate( $barCoordinateArray['x'][1], $barCoordinateArray['y'][1] ), $startDepth ), $this->get3dCoordinate( new ezcGraphCoordinate( $barCoordinateArray['x'][1], $barCoordinateArray['y'][0] ), $startDepth ), ), $color, true ), ); // Right side $this->barPostProcessing[] = array( 'index' => $barCoordinateArray['x'][1], 'method' => 'drawPolygon', 'context' => $context, 'parameters' => array( array( $this->get3dCoordinate( new ezcGraphCoordinate( $barCoordinateArray['x'][2], $barCoordinateArray['y'][0] ), $midDepth ), $this->get3dCoordinate( new ezcGraphCoordinate( $barCoordinateArray['x'][2], $barCoordinateArray['y'][1] ), $midDepth ), $this->get3dCoordinate( new ezcGraphCoordinate( $barCoordinateArray['x'][1], $barCoordinateArray['y'][1] ), $startDepth ), $this->get3dCoordinate( new ezcGraphCoordinate( $barCoordinateArray['x'][1], $barCoordinateArray['y'][0] ), $startDepth ), ), $color->darken( $this->options->barDarkenSide ), true ), ); $topLocation = min( $barCoordinateArray['y'][0], $barCoordinateArray['y'][1] ); // Top side $this->barPostProcessing[] = array( 'index' => $barCoordinateArray['x'][0], 'method' => 'drawPolygon', 'context' => $context, 'parameters' => array( array( $this->get3dCoordinate( new ezcGraphCoordinate( $barCoordinateArray['x'][1], $topLocation ), $startDepth ), $this->get3dCoordinate( new ezcGraphCoordinate( $barCoordinateArray['x'][2], $topLocation ), $midDepth ), $this->get3dCoordinate( new ezcGraphCoordinate( $barCoordinateArray['x'][3], $topLocation ), $endDepth ), $this->get3dCoordinate( new ezcGraphCoordinate( $barCoordinateArray['x'][0], $topLocation ), $midDepth ), ), $color->darken( $this->options->barDarkenTop ), true ), ); // Top side gleam if ( $this->options->barChartGleam !== false ) { $this->barPostProcessing[] = array( 'index' => $barCoordinateArray['x'][0] + 1, 'method' => 'drawPolygon', 'context' => $context, 'parameters' => array( array( $this->get3dCoordinate( new ezcGraphCoordinate( $barCoordinateArray['x'][1], $topLocation ), $startDepth ), $this->get3dCoordinate( new ezcGraphCoordinate( $barCoordinateArray['x'][2], $topLocation ), $midDepth ), $this->get3dCoordinate( new ezcGraphCoordinate( $barCoordinateArray['x'][3], $topLocation ), $endDepth ), $this->get3dCoordinate( new ezcGraphCoordinate( $barCoordinateArray['x'][0], $topLocation ), $midDepth ), ), new ezcGraphLinearGradient( $this->get3dCoordinate( new ezcGraphCoordinate( $barCoordinateArray['x'][2], $topLocation ), $midDepth ), $this->get3dCoordinate( new ezcGraphCoordinate( $barCoordinateArray['x'][0], $topLocation ), $midDepth ), ezcGraphColor::fromHex( '#FFFFFFFF' ), ezcGraphColor::fromHex( '#FFFFFF' )->transparent( 1 - $this->options->barChartGleam ) ), true ), ); } } /** * Draws a bar with a circular ground shape. * * @param ezcGraphContext $context * @param ezcGraphColor $color * @param ezcGraphCoordinate $position * @param float $barWidth * @param float $offset * @param float $axisPosition * @param float $startDepth * @param float $midDepth * @param float $endDepth * @param int $symbol * @return void */ protected function drawCircularBar( ezcGraphContext $context, ezcGraphColor $color, ezcGraphCoordinate $position, $barWidth, $offset, $axisPosition, $startDepth, $midDepth, $endDepth, $symbol ) { $barCenterTop = new ezcGraphCoordinate( $this->dataBoundings->x0 + $this->xAxisSpace + $position->x * ( $this->dataBoundings->x1 - ( $this->dataBoundings->x0 + 2 * $this->xAxisSpace ) ) + $offset + $barWidth / 2, $this->dataBoundings->y0 + $this->yAxisSpace + $position->y * ( $this->dataBoundings->y1 - ( $this->dataBoundings->y0 + 2 * $this->yAxisSpace ) ) ); $barCenterBottom = new ezcGraphCoordinate( $this->dataBoundings->x0 + $this->xAxisSpace + $position->x * ( $this->dataBoundings->x1 - ( $this->dataBoundings->x0 + 2 * $this->xAxisSpace ) ) + $offset + $barWidth / 2, $this->dataBoundings->y0 + $this->yAxisSpace + $axisPosition * ( $this->dataBoundings->y1 - ( $this->dataBoundings->y0 + 2 * $this->yAxisSpace ) ) ); if ( $barCenterTop->y > $barCenterBottom->y ) { $tmp = $barCenterTop; $barCenterTop = $barCenterBottom; $barCenterBottom = $tmp; } $this->barPostProcessing[] = array( 'index' => $barCenterBottom->x, 'method' => 'drawCircularArc', 'context' => $context, 'parameters' => array( $this->get3dCoordinate( $barCenterTop, $midDepth ), $barWidth, $barWidth / 2, ( $barCenterBottom->y - $barCenterTop->y ) * $this->yDepthFactor, 0, 180, $color ), ); $this->barPostProcessing[] = array( 'index' => $barCenterBottom->x + 1, 'method' => 'drawCircle', 'context' => $context, 'parameters' => array( $top = $this->get3dCoordinate( $barCenterTop, $midDepth ), $barWidth, $barWidth / 2, ( $symbol === ezcGraph::CIRCLE ? new ezcGraphLinearGradient( new ezcGraphCoordinate( $top->x - $barWidth / 2, $top->y ), new ezcGraphCoordinate( $top->x + $barWidth / 2, $top->y ), $color->darken( $this->options->barDarkenTop ), $color ) : $color ) ), ); } /** * Draw bar * * Draws a bar as a data element in a line chart * * @param ezcGraphBoundings $boundings Chart boundings * @param ezcGraphContext $context Context of call * @param ezcGraphColor $color Color of line * @param ezcGraphCoordinate $position Position of data point * @param float $stepSize Space which can be used for bars * @param int $dataNumber Number of dataset * @param int $dataCount Count of datasets in chart * @param int $symbol Symbol to draw for line * @param float $axisPosition Position of axis for drawing filled lines * @return void */ public function drawBar( ezcGraphBoundings $boundings, ezcGraphContext $context, ezcGraphColor $color, ezcGraphCoordinate $position, $stepSize, $dataNumber = 1, $dataCount = 1, $symbol = ezcGraph::NO_SYMBOL, $axisPosition = 0. ) { // Apply margin $margin = $stepSize * $this->options->barMargin; $padding = $stepSize * $this->options->barPadding; $barWidth = ( $stepSize - $margin ) / $dataCount - $padding; $offset = - $stepSize / 2 + $margin / 2 + ( $dataCount - $dataNumber - 1 ) * ( $padding + $barWidth ) + $padding / 2; if ( $barWidth < 0 ) { $offset -= $barWidth = abs( $barWidth ); } $startDepth = $this->options->barMargin; $midDepth = .5; $endDepth = 1 - $this->options->barMargin; switch ( $symbol ) { case ezcGraph::NO_SYMBOL: $this->drawRectangularBar( $context, $color, $position, $barWidth, $offset, $axisPosition, $startDepth, $midDepth, $endDepth ); break; case ezcGraph::DIAMOND: $this->drawDiamondBar( $context, $color, $position, $barWidth, $offset, $axisPosition, $startDepth, $midDepth, $endDepth ); break; case ezcGraph::BULLET: case ezcGraph::CIRCLE: $this->drawCircularBar( $context, $color, $position, $barWidth, $offset, $axisPosition, $startDepth, $midDepth, $endDepth, $symbol ); break; } } /** * Draw stacked bar * * Draws a stacked bar part as a data element in a line chart * * @param ezcGraphBoundings $boundings Chart boundings * @param ezcGraphContext $context Context of call * @param ezcGraphColor $color Color of line * @param ezcGraphCoordinate $start * @param ezcGraphCoordinate $position * @param float $stepSize Space which can be used for bars * @param int $symbol Symbol to draw for line * @param float $axisPosition Position of axis for drawing filled lines * @return void */ public function drawStackedBar( ezcGraphBoundings $boundings, ezcGraphContext $context, ezcGraphColor $color, ezcGraphCoordinate $start, ezcGraphCoordinate $position, $stepSize, $symbol = ezcGraph::NO_SYMBOL, $axisPosition = 0. ) { // Apply margin $margin = $stepSize * $this->options->barMargin; $barWidth = $stepSize - $margin; $offset = - $stepSize / 2 + $margin / 2; if ( $barWidth < 0 ) { $offset -= $barWidth = abs( $barWidth ); } $startDepth = $this->options->barMargin; $midDepth = .5; $endDepth = 1 - $this->options->barMargin; switch ( $symbol ) { case ezcGraph::NO_SYMBOL: case ezcGraph::DIAMOND: case ezcGraph::BULLET: case ezcGraph::CIRCLE: $this->drawRectangularBar( $context, $color, $position, $barWidth, $offset, $start->y, $startDepth, $midDepth, $endDepth ); break; } } /** * Draw all collected bar elements * * Draw all collected bar elements after sorting them depending of their * position to simulate simple z buffering. * * @access protected * @return void */ protected function finishBars() { if ( !count( $this->barPostProcessing ) ) { return true; } $zIndexArray = array(); foreach ( $this->barPostProcessing as $key => $barPolygon ) { $zIndexArray[$key] = $barPolygon['index']; } array_multisort( $zIndexArray, SORT_ASC, SORT_NUMERIC, $this->barPostProcessing ); foreach ( $this->barPostProcessing as $bar ) { $this->addElementReference( $bar['context'], call_user_func_array( array( $this->driver, $bar['method'] ), $bar['parameters'] ) ); } } /** * Draw data line * * Draws a line as a data element in a line chart * * @param ezcGraphBoundings $boundings Chart boundings * @param ezcGraphContext $context Context of call * @param ezcGraphColor $color Color of line * @param ezcGraphCoordinate $start Starting point * @param ezcGraphCoordinate $end Ending point * @param int $dataNumber Number of dataset * @param int $dataCount Count of datasets in chart * @param int $symbol Symbol to draw for line * @param ezcGraphColor $symbolColor Color of the symbol, defaults to linecolor * @param ezcGraphColor $fillColor Color to fill line with * @param float $axisPosition Position of axis for drawing filled lines * @param float $thickness Line thickness * @return void */ public function drawDataLine( ezcGraphBoundings $boundings, ezcGraphContext $context, ezcGraphColor $color, ezcGraphCoordinate $start, ezcGraphCoordinate $end, $dataNumber = 0, $dataCount = 1, $symbol = ezcGraph::NO_SYMBOL, ezcGraphColor $symbolColor = null, ezcGraphColor $fillColor = null, $axisPosition = 0., $thickness = 1. ) { // Calculate line width based on options if ( $this->options->seperateLines ) { $startDepth = ( 1 / $dataCount ) * $dataNumber; $endDepth = ( 1 / $dataCount ) * ( $dataNumber + 1 ); } else { $startDepth = false; $endDepth = true; } // Determine Coordinates depending on boundings and data point position $startCoord = new ezcGraphCoordinate( $this->dataBoundings->x0 + $this->xAxisSpace + $start->x * ( $this->dataBoundings->x1 - ( $this->dataBoundings->x0 + 2 * $this->xAxisSpace ) ), $this->dataBoundings->y0 + $this->yAxisSpace + $start->y * ( $this->dataBoundings->y1 - ( $this->dataBoundings->y0 + 2 * $this->yAxisSpace ) ) ); $endCoord = new ezcGraphCoordinate( $this->dataBoundings->x0 + $this->xAxisSpace + $end->x * ( $this->dataBoundings->x1 - ( $this->dataBoundings->x0 + 2 * $this->xAxisSpace ) ), $this->dataBoundings->y0 + $this->yAxisSpace + $end->y * ( $this->dataBoundings->y1 - ( $this->dataBoundings->y0 + 2 * $this->yAxisSpace ) ) ); // 3D-fy coordinates $linePolygonPoints = array( $this->get3dCoordinate( $startCoord, $startDepth ), $this->get3dCoordinate( $endCoord, $startDepth ), $this->get3dCoordinate( $endCoord, $endDepth ), $this->get3dCoordinate( $startCoord, $endDepth ), ); $startAxisCoord = new ezcGraphCoordinate( $this->dataBoundings->x0 + $this->xAxisSpace + $start->x * ( $this->dataBoundings->x1 - ( $this->dataBoundings->x0 + 2 * $this->xAxisSpace ) ), $this->dataBoundings->y0 + $this->yAxisSpace + $axisPosition * ( $this->dataBoundings->y1 - ( $this->dataBoundings->y0 + 2 * $this->yAxisSpace ) ) ); $endAxisCoord = new ezcGraphCoordinate( $this->dataBoundings->x0 + $this->xAxisSpace + $end->x * ( $this->dataBoundings->x1 - ( $this->dataBoundings->x0 + 2 * $this->xAxisSpace ) ), $this->dataBoundings->y0 + $this->yAxisSpace + $axisPosition * ( $this->dataBoundings->y1 - ( $this->dataBoundings->y0 + 2 * $this->yAxisSpace ) ) ); // 3D-fy coordinates $axisPolygonPoints = array( $this->get3dCoordinate( $startAxisCoord, $startDepth ), $this->get3dCoordinate( $endAxisCoord, $startDepth ), $this->get3dCoordinate( $endAxisCoord, $endDepth ), $this->get3dCoordinate( $startAxisCoord, $endDepth ), ); // Perhaps fill up line if ( $fillColor !== null && $start->x != $end->x ) { $startValue = $axisPosition - $start->y; $endValue = $axisPosition - $end->y; if ( ( $startValue == 0 ) || ( $endValue == 0 ) || ( $startValue / abs( $startValue ) == $endValue / abs( $endValue ) ) ) { // Values have the same sign or are on the axis $this->driver->drawPolygon( array( $linePolygonPoints[0], $linePolygonPoints[1], $this->get3dCoordinate( $endAxisCoord, $startDepth ), $this->get3dCoordinate( $startAxisCoord, $startDepth ), ), $fillColor, true ); } else { // values are on differente sides of the axis - split the filled polygon $startDiff = abs( $axisPosition - $start->y ); $endDiff = abs( $axisPosition - $end->y ); $cuttingPosition = $startDiff / ( $endDiff + $startDiff ); $cuttingPoint = new ezcGraphCoordinate( $startCoord->x + ( $endCoord->x - $startCoord->x ) * $cuttingPosition, $startAxisCoord->y ); $this->driver->drawPolygon( array( $this->get3dCoordinate( $startAxisCoord, $startDepth ), $linePolygonPoints[0], $this->get3dCoordinate( $cuttingPoint, $startDepth ), ), $fillColor, true ); $this->driver->drawPolygon( array( $this->get3dCoordinate( $endAxisCoord, $startDepth ), $linePolygonPoints[1], $this->get3dCoordinate( $cuttingPoint, $startDepth ), ), $fillColor, true ); } // Draw closing foo $this->driver->drawPolygon( array( $linePolygonPoints[2], $linePolygonPoints[1], $this->get3dCoordinate( $endAxisCoord, $startDepth ), $this->get3dCoordinate( $endAxisCoord, $endDepth ), ), $fillColor, true ); } // Draw line $this->driver->drawPolygon( $linePolygonPoints, $color, true, $thickness ); // Draw polygon border if ( $this->options->dataBorder > 0 ) { $this->driver->drawPolygon( $linePolygonPoints, $color->darken( $this->options->dataBorder ), false, $thickness ); } // Draw line symbol if ( $this->options->showSymbol && ( $symbol !== ezcGraph::NO_SYMBOL ) ) { if ( $symbolColor === null ) { $symbolColor = $color; } $this->linePostSymbols[] = array( 'boundings' => new ezcGraphBoundings( $linePolygonPoints[2]->x - $this->options->symbolSize / 2, $linePolygonPoints[2]->y - $this->options->symbolSize / 2, $linePolygonPoints[2]->x + $this->options->symbolSize / 2, $linePolygonPoints[2]->y + $this->options->symbolSize / 2 ), 'color' => $symbolColor, 'context' => $context, 'symbol' => $symbol, ); } } /** * Draws a highlight textbox for a datapoint. * * A highlight textbox for line and bar charts means a box with the current * value in the graph. * * @param ezcGraphBoundings $boundings Chart boundings * @param ezcGraphContext $context Context of call * @param ezcGraphCoordinate $end Ending point * @param float $axisPosition Position of axis for drawing filled lines * @param int $dataNumber Number of dataset * @param int $dataCount Count of datasets in chart * @param ezcGraphFontOptions $font Font used for highlight string * @param string $text Acutual value * @param int $size Size of highlight text * @param ezcGraphColor $markLines * @param int $xOffset * @param int $yOffset * @param float $stepSize * @param int $type * @return void */ public function drawDataHighlightText( ezcGraphBoundings $boundings, ezcGraphContext $context, ezcGraphCoordinate $end, $axisPosition = 0., $dataNumber = 1, $dataCount = 1, ezcGraphFontOptions $font, $text, $size, ezcGraphColor $markLines = null, $xOffset = 0, $yOffset = 0, $stepSize = 0., $type = ezcGraph::LINE ) { $this->driver->options->font = $font; $width = $this->dataBoundings->width / $dataCount; // Calculate line width based on options if ( $this->options->seperateLines ) { $endDepth = ( 1 / $dataCount ) * ( $dataNumber + 1 ); } else { $endDepth = true; } $dataPoint = new ezcGraphCoordinate( $this->dataBoundings->x0 + $this->xAxisSpace + $end->x * ( $this->dataBoundings->x1 - ( $this->dataBoundings->x0 + 2 * $this->xAxisSpace ) ), $this->dataBoundings->y0 + $this->yAxisSpace + $end->y * ( $this->dataBoundings->y1 - ( $this->dataBoundings->y0 + 2 * $this->yAxisSpace ) ) ); if ( $end->y < $axisPosition ) { $this->driver->drawTextBox( $text, $this->get3dCoordinate( new ezcGraphCoordinate( $dataPoint->x - $width / 2, $dataPoint->y - $size - $font->padding - $this->options->symbolSize ), $endDepth ), $width * $this->xDepthFactor, $size, ezcGraph::CENTER | ezcGraph::BOTTOM ); } else { $this->driver->drawTextBox( $text, $this->get3dCoordinate( new ezcGraphCoordinate( $dataPoint->x - $width / 2, $dataPoint->y + $font->padding + $this->options->symbolSize ), $endDepth ), $width * $this->xDepthFactor, $size, ezcGraph::CENTER | ezcGraph::TOP ); } } /** * Draw legend * * Will draw a legend in the bounding box * * @param ezcGraphBoundings $boundings Bounding of legend * @param ezcGraphChartElementLegend $legend Legend to draw; * @param int $type Type of legend: Protrait or landscape * @return void */ public function drawLegend( ezcGraphBoundings $boundings, ezcGraphChartElementLegend $legend, $type = ezcGraph::VERTICAL ) { $labels = $legend->labels; // Calculate boundings of each label if ( $type & ezcGraph::VERTICAL ) { $labelWidth = $boundings->x1 - $boundings->x0; $labelHeight = min( ( $boundings->y1 - $boundings->y0 ) / count( $labels ) - $legend->spacing, $legend->symbolSize + 2 * $legend->padding ); } else { $labelWidth = ( $boundings->x1 - $boundings->x0 ) / count( $labels ) - $legend->spacing; $labelHeight = min( $boundings->height, $legend->symbolSize + 2 * $legend->padding ); } $symbolSize = $labelHeight - 2 * $legend->padding; // Draw all labels $labelPosition = new ezcGraphCoordinate( $boundings->x0, $boundings->y0 ); foreach ( $labels as $label ) { $this->elements['legend_url'][$label['label']] = $label['url']; $this->elements['legend'][$label['label']]['symbol'] = $this->drawSymbol( new ezcGraphBoundings( $labelPosition->x + $legend->padding, $labelPosition->y + $legend->padding, $labelPosition->x + $legend->padding + $symbolSize, $labelPosition->y + $legend->padding + $symbolSize ), $label['color'], $label['symbol'] ); $this->elements['legend'][$label['label']]['text'] = $this->driver->drawTextBox( $label['label'], new ezcGraphCoordinate( $labelPosition->x + 2 * $legend->padding + $symbolSize, $labelPosition->y + $legend->padding ), $labelWidth - $symbolSize - 3 * $legend->padding, $labelHeight - 2 * $legend->padding, ezcGraph::LEFT | ezcGraph::MIDDLE ); $labelPosition->x += ( $type === ezcGraph::VERTICAL ? 0 : $labelWidth + $legend->spacing ); $labelPosition->y += ( $type === ezcGraph::VERTICAL ? $labelHeight + $legend->spacing : 0 ); } } /** * Draw box * * Box are wrapping each major chart element and draw border, background * and title to each chart element. * * Optionally a padding and margin for each box can be defined. * * @param ezcGraphBoundings $boundings Boundings of the box * @param ezcGraphColor $background Background color * @param ezcGraphColor $borderColor Border color * @param int $borderWidth Border width * @param int $margin Margin * @param int $padding Padding * @param mixed $title Title of the box * @param int $titleSize Size of title in the box * @return ezcGraphBoundings Remaining inner boundings */ public function drawBox( ezcGraphBoundings $boundings, ezcGraphColor $background = null, ezcGraphColor $borderColor = null, $borderWidth = 0, $margin = 0, $padding = 0, $title = false, $titleSize = 16 ) { // Apply margin $boundings->x0 += $margin; $boundings->y0 += $margin; $boundings->x1 -= $margin; $boundings->y1 -= $margin; if ( $background instanceof ezcGraphColor ) { // Draw box background $this->driver->drawPolygon( array( new ezcGraphCoordinate( $boundings->x0, $boundings->y0 ), new ezcGraphCoordinate( $boundings->x1, $boundings->y0 ), new ezcGraphCoordinate( $boundings->x1, $boundings->y1 ), new ezcGraphCoordinate( $boundings->x0, $boundings->y1 ), ), $background, true ); } if ( ( $borderColor instanceof ezcGraphColor ) && ( $borderWidth > 0 ) ) { // Draw border $this->driver->drawPolygon( array( new ezcGraphCoordinate( $boundings->x0, $boundings->y0 ), new ezcGraphCoordinate( $boundings->x1, $boundings->y0 ), new ezcGraphCoordinate( $boundings->x1, $boundings->y1 ), new ezcGraphCoordinate( $boundings->x0, $boundings->y1 ), ), $borderColor, false, $borderWidth ); // Reduce local boundings by borderWidth $boundings->x0 += $borderWidth; $boundings->y0 += $borderWidth; $boundings->x1 -= $borderWidth; $boundings->y1 -= $borderWidth; } // Apply padding $boundings->x0 += $padding; $boundings->y0 += $padding; $boundings->x1 -= $padding; $boundings->y1 -= $padding; // Add box title if ( $title !== false ) { switch ( $this->options->titlePosition ) { case ezcGraph::TOP: $this->driver->drawTextBox( $title, new ezcGraphCoordinate( $boundings->x0, $boundings->y0 ), $boundings->x1 - $boundings->x0, $titleSize, $this->options->titleAlignement ); $boundings->y0 += $titleSize + $padding; $boundings->y1 -= $titleSize + $padding; break; case ezcGraph::BOTTOM: $this->driver->drawTextBox( $title, new ezcGraphCoordinate( $boundings->x0, $boundings->y1 - $titleSize ), $boundings->x1 - $boundings->x0, $titleSize, $this->options->titleAlignement ); $boundings->y1 -= $titleSize + $padding; break; } } return $boundings; } /** * Draw text * * Draws the provided text in the boundings * * @param ezcGraphBoundings $boundings Boundings of text * @param string $text Text * @param int $align Alignement of text * @param ezcGraphRotation $rotation * @return void */ public function drawText( ezcGraphBoundings $boundings, $text, $align = ezcGraph::LEFT, ezcGraphRotation $rotation = null ) { if ( $this->depth === false ) { // We are not 3d for now, wg. rendering normal text boxes like the // title $topleft = new ezcGraphCoordinate( $boundings->x0, $boundings->y0 ); $bottomright = new ezcGraphCoordinate( $boundings->x1, $boundings->y1 ); } else { // The 3d part started $topleft = $this->get3dCoordinate( new ezcGraphCoordinate( $boundings->x0, $boundings->y0 ), false ); $bottomright = $this->get3dCoordinate( new ezcGraphCoordinate( $boundings->x1, $boundings->y1 ), false ); // Also modify rotation accordingly if ( $rotation !== null ) { $rotation = new ezcGraphRotation( $rotation->getRotation(), $this->get3dCoordinate( $rotation->getCenter(), false ) ); } } $this->driver->drawTextBox( $text, $topleft, $bottomright->x - $topleft->x, $bottomright->y - $topleft->y, $align, $rotation ); } /** * Draw grid line * * Draw line for the grid in the chart background * * * @param ezcGraphCoordinate $start Start point * @param ezcGraphCoordinate $end End point * @param ezcGraphColor $color Color of the grid line * @return void */ public function drawGridLine( ezcGraphCoordinate $start, ezcGraphCoordinate $end, ezcGraphColor $color ) { $gridPolygonCoordinates = array( $this->get3dCoordinate( $start, false ), $this->get3dCoordinate( $end, false ), $this->get3dCoordinate( $end, true ), $this->get3dCoordinate( $start, true ), ); // Draw grid polygon if ( $this->options->fillGrid === 0 ) { $this->driver->drawLine( $gridPolygonCoordinates[2], $gridPolygonCoordinates[3], $color ); } else { if ( $this->options->fillGrid === 1 ) { $this->driver->drawPolygon( $gridPolygonCoordinates, $color, true ); } else { $this->driver->drawPolygon( $gridPolygonCoordinates, $color->transparent( $this->options->fillGrid ), true ); } // Draw grid lines - scedule some for later to be drawn in front of // the data $this->frontLines[] = array( $gridPolygonCoordinates[0], $gridPolygonCoordinates[1], $color, 1 ); $this->frontLines[] = array( $gridPolygonCoordinates[1], $gridPolygonCoordinates[2], $color, 1 ); $this->driver->drawLine( $gridPolygonCoordinates[2], $gridPolygonCoordinates[3], $color, 1 ); $this->frontLines[] = array( $gridPolygonCoordinates[3], $gridPolygonCoordinates[0], $color, 1 ); } } /** * Draw step line * * Draw a step (marker for label position) on a axis. * * @param ezcGraphCoordinate $start Start point * @param ezcGraphCoordinate $end End point * @param ezcGraphColor $color Color of the grid line * @return void */ public function drawStepLine( ezcGraphCoordinate $start, ezcGraphCoordinate $end, ezcGraphColor $color ) { $stepPolygonCoordinates = array( $this->get3dCoordinate( $start, true ), $this->get3dCoordinate( $end, true ), $this->get3dCoordinate( $end, false ), $this->get3dCoordinate( $start, false ), ); // Draw step polygon if ( ( $this->options->fillAxis > 0 ) && ( $this->options->fillAxis < 1 ) ) { $this->driver->drawPolygon( $stepPolygonCoordinates, $color->transparent( $this->options->fillAxis ), true ); $this->driver->drawPolygon( $stepPolygonCoordinates, $color, false ); } else { $this->driver->drawPolygon( $stepPolygonCoordinates, $color, ! (bool) $this->options->fillAxis ); } } /** * Draw axis * * Draws an axis form the provided start point to the end point. A specific * angle of the axis is not required. * * For the labeleing of the axis a sorted array with major steps and an * array with minor steps is expected, which are build like this: * array( * array( * 'position' => (float), * 'label' => (string), * ) * ) * where the label is optional. * * The label renderer class defines how the labels are rendered. For more * documentation on this topic have a look at the basic label renderer * class. * * Additionally it can be specified if a major and minor grid are rendered * by defining a color for them. The axis label is used to add a caption * for the axis. * * @param ezcGraphBoundings $boundings Boundings of axis * @param ezcGraphCoordinate $start Start point of axis * @param ezcGraphCoordinate $end Endpoint of axis * @param ezcGraphChartElementAxis $axis Axis to render * @param ezcGraphAxisLabelRenderer $labelClass Used label renderer * @return void */ public function drawAxis( ezcGraphBoundings $boundings, ezcGraphCoordinate $start, ezcGraphCoordinate $end, ezcGraphChartElementAxis $axis, ezcGraphAxisLabelRenderer $labelClass = null ) { // Calculate used space for three dimensional effects if ( $this->depth === false ) { $this->depth = min( ( $boundings->x1 - $boundings->x0 ) * $this->options->depth, ( $boundings->y1 - $boundings->y0 ) * $this->options->depth ); $this->xDepthFactor = 1 - $this->depth / ( $boundings->x1 - $boundings->x0 ); $this->yDepthFactor = 1 - $this->depth / ( $boundings->y1 - $boundings->y0 ); $this->dataBoundings = clone $boundings; } // Clone boundings to not be affected by internal mofifications $boundings = clone $boundings; switch ( $axis->position ) { case ezcGraph::TOP: case ezcGraph::BOTTOM: $this->xAxisSpace = ( $this->dataBoundings->x1 - $this->dataBoundings->x0 ) * $axis->axisSpace; break; case ezcGraph::LEFT: case ezcGraph::RIGHT: $this->yAxisSpace = ( $this->dataBoundings->y1 - $this->dataBoundings->y0 ) * $axis->axisSpace; break; } // Determine normalized direction $direction = new ezcGraphVector( $start->x - $end->x, $start->y - $end->y ); $direction->unify(); $start->x += $boundings->x0; $start->y += $boundings->y0; $end->x += $boundings->x0; $end->y += $boundings->y0; // Shorten drawn axis, if requested. if ( ( $this->options->shortAxis === true ) && ( ( $axis->position === ezcGraph::TOP ) || ( $axis->position === ezcGraph::BOTTOM ) ) ) { $axisStart = clone $start; $axisEnd = clone $end; $axisStart->y += $boundings->height * $axis->axisSpace * ( $axis->position === ezcGraph::TOP ? 1 : -1 ); $axisEnd->y -= $boundings->height * $axis->axisSpace * ( $axis->position === ezcGraph::TOP ? 1 : -1 ); } elseif ( ( $this->options->shortAxis === true ) && ( ( $axis->position === ezcGraph::LEFT ) || ( $axis->position === ezcGraph::RIGHT ) ) ) { $axisStart = clone $start; $axisEnd = clone $end; $axisStart->x += $boundings->width * $axis->axisSpace * ( $axis->position === ezcGraph::LEFT ? 1 : -1 ); $axisEnd->x -= $boundings->width * $axis->axisSpace * ( $axis->position === ezcGraph::LEFT ? 1 : -1 ); } else { $axisStart = $start; $axisEnd = $end; } $axisPolygonCoordinates = array( $this->get3dCoordinate( $axisStart, true ), $this->get3dCoordinate( $axisEnd, true ), $this->get3dCoordinate( $axisEnd, false ), $this->get3dCoordinate( $axisStart, false ), ); // Draw axis if ( ( $this->options->fillAxis > 0 ) && ( $this->options->fillAxis < 1 ) ) { $this->driver->drawPolygon( $axisPolygonCoordinates, $axis->border->transparent( $this->options->fillAxis ), true ); } else { $this->driver->drawPolygon( $axisPolygonCoordinates, $axis->border, ! (bool) $this->options->fillAxis ); } // Draw axis lines - scedule some for later to be drawn in front of // the data $this->driver->drawLine( $axisPolygonCoordinates[0], $axisPolygonCoordinates[1], $axis->border, 1 ); $this->frontLines[] = array( $axisPolygonCoordinates[1], $axisPolygonCoordinates[2], $axis->border, 1 ); $this->frontLines[] = array( $axisPolygonCoordinates[2], $axisPolygonCoordinates[3], $axis->border, 1 ); $this->frontLines[] = array( $axisPolygonCoordinates[3], $axisPolygonCoordinates[0], $axis->border, 1 ); // Draw small arrowhead $this->drawAxisArrowHead( $axisPolygonCoordinates[1], $direction, max( $axis->minArrowHeadSize, min( $axis->maxArrowHeadSize, abs( ceil( ( ( $end->x - $start->x ) + ( $end->y - $start->y ) ) * $axis->axisSpace / 4 ) ) ) ), $axis->border ); // Draw axis label if ( $axis->label !== false ) { $width = $this->dataBoundings->x1 - $this->dataBoundings->x0; switch ( $axis->position ) { case ezcGraph::TOP: $this->driver->drawTextBox( $axis->label, new ezcGraphCoordinate( $axisPolygonCoordinates[2]->x + $axis->labelMargin - $width * ( 1 - $axis->axisSpace * 2 ), $axisPolygonCoordinates[2]->y - $axis->labelMargin - $axis->labelSize ), $width * ( 1 - $axis->axisSpace * 2 ) - $axis->labelMargin, $axis->labelSize, ezcGraph::TOP | ezcGraph::RIGHT ); break; case ezcGraph::BOTTOM: $this->driver->drawTextBox( $axis->label, new ezcGraphCoordinate( $axisPolygonCoordinates[1]->x + $axis->labelMargin, $axisPolygonCoordinates[1]->y + $axis->labelMargin ), $width * ( 1 - $axis->axisSpace * 2 ) - $axis->labelMargin, $axis->labelSize, ezcGraph::TOP | ezcGraph::LEFT ); break; case ezcGraph::LEFT: $this->driver->drawTextBox( $axis->label, new ezcGraphCoordinate( $axisPolygonCoordinates[1]->x - $width, $axisPolygonCoordinates[1]->y - $axis->labelSize - $axis->labelMargin ), $width - $axis->labelMargin, $axis->labelSize, ezcGraph::BOTTOM | ezcGraph::RIGHT ); break; case ezcGraph::RIGHT: $this->driver->drawTextBox( $axis->label, new ezcGraphCoordinate( $axisPolygonCoordinates[1]->x, $axisPolygonCoordinates[1]->y - $axis->labelSize - $axis->labelMargin ), $width - $axis->labelMargin, $axis->labelSize, ezcGraph::BOTTOM | ezcGraph::LEFT ); break; } } // Collect axis labels and draw, when all axisSpaces are collected $this->axisLabels[] = array( 'object' => $labelClass, 'boundings' => $boundings, 'start' => clone $start, 'end' => clone $end, 'axis' => $axis, ); if ( $this->xAxisSpace && $this->yAxisSpace ) { foreach ( $this->axisLabels as $axisLabel ) { // If font should not be synchronized, use font configuration from // each axis if ( $this->options->syncAxisFonts === false ) { $this->driver->options->font = $axisLabel['axis']->font; } switch ( $axisLabel['axis']->position ) { case ezcGraph::RIGHT: case ezcGraph::LEFT: $axisLabel['start']->x += $this->xAxisSpace * ( $axisLabel['start'] > $axisLabel['end'] ? -1 : 1 ); $axisLabel['end']->x -= $this->xAxisSpace * ( $axisLabel['start'] > $axisLabel['end'] ? -1 : 1 ); break; case ezcGraph::TOP: case ezcGraph::BOTTOM: $axisLabel['start']->y += $this->yAxisSpace * ( $axisLabel['start'] > $axisLabel['end'] ? -1 : 1 ); $axisLabel['end']->y -= $this->yAxisSpace * ( $axisLabel['start'] > $axisLabel['end'] ? -1 : 1 ); break; } $axisLabel['object']->renderLabels( $this, $axisLabel['boundings'], $axisLabel['start'], $axisLabel['end'], $axisLabel['axis'] ); } } } /** * Draw background image * * Draws a background image at the defined position. If repeat is set the * background image will be repeated like any texture. * * @param ezcGraphBoundings $boundings Boundings for the background image * @param string $file Filename of background image * @param int $position Position of background image * @param int $repeat Type of repetition * @return void */ public function drawBackgroundImage( ezcGraphBoundings $boundings, $file, $position = 48, // ezcGraph::CENTER | ezcGraph::MIDDLE $repeat = ezcGraph::NO_REPEAT ) { $imageData = getimagesize( $file ); $imageWidth = $imageData[0]; $imageHeight = $imageData[1]; $imageWidth = min( $imageWidth, $boundings->x1 - $boundings->x0 ); $imageHeight = min( $imageHeight, $boundings->y1 - $boundings->y0 ); $imagePosition = new ezcGraphCoordinate( $boundings->x0, $boundings->y0 ); // Determine x position switch ( true ) { case ( $repeat & ezcGraph::HORIZONTAL ): // If is repeated on this axis fall back to position zero case ( $position & ezcGraph::LEFT ): $imagePosition->x = $boundings->x0; break; case ( $position & ezcGraph::RIGHT ): $imagePosition->x = max( $boundings->x1 - $imageWidth, $boundings->x0 ); break; default: $imagePosition->x = max( $boundings->x0 + ( $boundings->x1 - $boundings->x0 - $imageWidth ) / 2, $boundings->x0 ); break; } // Determine y position switch ( true ) { case ( $repeat & ezcGraph::VERTICAL ): // If is repeated on this axis fall back to position zero case ( $position & ezcGraph::TOP ): $imagePosition->y = $boundings->y0; break; case ( $position & ezcGraph::BOTTOM ): $imagePosition->y = max( $boundings->y1 - $imageHeight, $boundings->y0 ); break; default: $imagePosition->y = max( $boundings->y0 + ( $boundings->y1 - $boundings->y0 - $imageHeight ) / 2, $boundings->y0 ); break; } // Texturize backround based on position and repetition $position = new ezcGraphCoordinate( $imagePosition->x, $imagePosition->y ); do { $position->y = $imagePosition->y; do { $this->driver->drawImage( $file, $position, $imageWidth, $imageHeight ); $position->y += $imageHeight; } while ( ( $position->y < $boundings->y1 ) && ( $repeat & ezcGraph::VERTICAL ) ); $position->x += $imageWidth; } while ( ( $position->x < $boundings->x1 ) && ( $repeat & ezcGraph::HORIZONTAL ) ); } /** * Call all postprocessing functions * * @return void */ protected function finish() { $this->finishCirleSectors(); $this->finishPieSegmentLabels(); $this->finishBars(); $this->finishLineSymbols(); $this->finishFrontLines(); return true; } /** * Reset renderer properties * * Reset all renderer properties, which were calculated during the * rendering process, to offer a clean environment for rerendering. * * @return void */ protected function resetRenderer() { parent::resetRenderer(); // Also reset special 3D renderer options $this->pieSegmentLabels = array( 0 => array(), 1 => array(), ); $this->pieSegmentBoundings = false; $this->linePostSymbols = array(); $this->frontLines = array(); $this->circleSectors = array(); $this->barPostProcessing = array(); $this->depth = false; $this->xDepthFactor = false; $this->yDepthFactor = false; $this->dataBoundings = false; $this->axisLabels = array(); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/renderer/axis_label_boxed.php000066400000000000000000000166341226600447100265600ustar00rootroot00000000000000 * $chart->xAxis->axisLabelRenderer = new ezcGraphAxisBoxedLabelRenderer(); * * * @version 1.5 * @package Graph * @mainclass */ class ezcGraphAxisBoxedLabelRenderer extends ezcGraphAxisLabelRenderer { /** * Store step array for later coordinate modifications * * @var array(ezcGraphStep) */ protected $steps; /** * Store direction for later coordinate modifications * * @var ezcGraphVector */ protected $direction; /** * Store coordinate width modifier for later coordinate modifications * * @var float */ protected $widthModifier; /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { parent::__construct( $options ); $this->properties['outerStep'] = true; } /** * Render Axis labels * * Render labels for an axis. * * @param ezcGraphRenderer $renderer Renderer used to draw the chart * @param ezcGraphBoundings $boundings Boundings of the axis * @param ezcGraphCoordinate $start Axis starting point * @param ezcGraphCoordinate $end Axis ending point * @param ezcGraphChartElementAxis $axis Axis instance * @return void */ public function renderLabels( ezcGraphRenderer $renderer, ezcGraphBoundings $boundings, ezcGraphCoordinate $start, ezcGraphCoordinate $end, ezcGraphChartElementAxis $axis, ezcGraphBoundings $innerBoundings = null ) { // receive rendering parameters from axis $steps = $axis->getSteps(); $this->steps = $steps; $axisBoundings = new ezcGraphBoundings( $start->x, $start->y, $end->x, $end->y ); // Determine normalized axis direction $this->direction = new ezcGraphVector( $end->x - $start->x, $end->y - $start->y ); $this->direction->unify(); // Get axis space $gridBoundings = null; list( $xSpace, $ySpace ) = $this->getAxisSpace( $renderer, $boundings, $axis, $innerBoundings, $gridBoundings ); // Determine additional required axis space by boxes $firstStep = reset( $steps ); $lastStep = end( $steps ); $this->widthModifier = 1 + $firstStep->width / 2 + $lastStep->width / 2; // Draw steps and grid foreach ( $steps as $nr => $step ) { $position = new ezcGraphCoordinate( $start->x + ( $end->x - $start->x ) * ( $step->position + $step->width ) / $this->widthModifier, $start->y + ( $end->y - $start->y ) * ( $step->position + $step->width ) / $this->widthModifier ); $stepWidth = $step->width / $this->widthModifier; $stepSize = new ezcGraphCoordinate( $axisBoundings->width * $stepWidth, $axisBoundings->height * $stepWidth ); if ( $this->showLabels ) { // Calculate label boundings switch ( true ) { case ( abs( $this->direction->x ) > abs( $this->direction->y ) ) && ( $this->direction->x > 0 ): $labelBoundings = new ezcGraphBoundings( $position->x - $stepSize->x + $this->labelPadding, $position->y + $this->labelPadding, $position->x - $this->labelPadding, $position->y + $ySpace - $this->labelPadding ); $alignement = ezcGraph::CENTER | ezcGraph::TOP; break; case ( abs( $this->direction->x ) > abs( $this->direction->y ) ) && ( $this->direction->x < 0 ): $labelBoundings = new ezcGraphBoundings( $position->x + $this->labelPadding, $position->y + $this->labelPadding, $position->x + $stepSize->x - $this->labelPadding, $position->y + $ySpace - $this->labelPadding ); $alignement = ezcGraph::CENTER | ezcGraph::TOP; break; case ( $this->direction->y > 0 ): $labelBoundings = new ezcGraphBoundings( $position->x - $xSpace + $this->labelPadding, $position->y - $stepSize->y + $this->labelPadding, $position->x - $this->labelPadding, $position->y - $this->labelPadding ); $alignement = ezcGraph::MIDDLE | ezcGraph::RIGHT; break; case ( $this->direction->y < 0 ): $labelBoundings = new ezcGraphBoundings( $position->x - $xSpace + $this->labelPadding, $position->y + $this->labelPadding, $position->x - $this->labelPadding, $position->y + $stepSize->y - $this->labelPadding ); $alignement = ezcGraph::MIDDLE | ezcGraph::RIGHT; break; } $renderer->drawText( $labelBoundings, $step->label, $alignement ); } // major grid if ( $axis->majorGrid ) { $this->drawGrid( $renderer, $gridBoundings, $position, $stepSize, $axis->majorGrid ); } // major step $this->drawStep( $renderer, $position, $this->direction, $axis->position, $this->majorStepSize, $axis->border ); } } /** * Modify chart data position * * Optionally additionally modify the coodinate of a data point * * @param ezcGraphCoordinate $coordinate Data point coordinate * @return ezcGraphCoordinate Modified coordinate */ public function modifyChartDataPosition( ezcGraphCoordinate $coordinate ) { $firstStep = reset( $this->steps ); $offset = $firstStep->width / 2 / $this->widthModifier; return new ezcGraphCoordinate( $coordinate->x * abs( $this->direction->y ) + ( $coordinate->x / $this->widthModifier + $offset ) * abs( $this->direction->x ), $coordinate->y * abs( $this->direction->x ) + ( $coordinate->y / $this->widthModifier + $offset ) * abs( $this->direction->y ) ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/renderer/axis_label_centered.php000066400000000000000000000220561226600447100272430ustar00rootroot00000000000000 * $chart->xAxis->axisLabelRenderer = new ezcGraphAxisCenteredLabelRenderer(); * * * @property bool $showZeroValue * Show the value at the zero point of an axis. This value might be * crossed by the other axis which would result in an unreadable * label. * * @version 1.5 * @package Graph * @mainclass */ class ezcGraphAxisCenteredLabelRenderer extends ezcGraphAxisLabelRenderer { /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->properties['showZeroValue'] = false; parent::__construct( $options ); } /** * __set * * @param mixed $propertyName * @param mixed $propertyValue * @throws ezcBaseValueException * If a submitted parameter was out of range or type. * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return void * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'showZeroValue': if ( !is_bool( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'bool' ); } $this->properties['showZeroValue'] = (bool) $propertyValue; break; default: return parent::__set( $propertyName, $propertyValue ); } } /** * Render Axis labels * * Render labels for an axis. * * @param ezcGraphRenderer $renderer Renderer used to draw the chart * @param ezcGraphBoundings $boundings Boundings of the axis * @param ezcGraphCoordinate $start Axis starting point * @param ezcGraphCoordinate $end Axis ending point * @param ezcGraphChartElementAxis $axis Axis instance * @return void */ public function renderLabels( ezcGraphRenderer $renderer, ezcGraphBoundings $boundings, ezcGraphCoordinate $start, ezcGraphCoordinate $end, ezcGraphChartElementAxis $axis, ezcGraphBoundings $innerBoundings = null ) { // receive rendering parameters from axis $steps = $axis->getSteps(); $axisBoundings = new ezcGraphBoundings( $start->x, $start->y, $end->x, $end->y ); // Determine normalized axis direction $direction = new ezcGraphVector( $end->x - $start->x, $end->y - $start->y ); $direction->unify(); // Get axis space $gridBoundings = null; list( $xSpace, $ySpace ) = $this->getAxisSpace( $renderer, $boundings, $axis, $innerBoundings, $gridBoundings ); // Draw steps and grid foreach ( $steps as $nr => $step ) { $position = new ezcGraphCoordinate( $start->x + ( $end->x - $start->x ) * $step->position, $start->y + ( $end->y - $start->y ) * $step->position ); $stepSize = new ezcGraphCoordinate( $axisBoundings->width * $step->width, $axisBoundings->height * $step->width ); if ( ! $step->isZero ) { // major grid if ( $axis->majorGrid ) { $this->drawGrid( $renderer, $gridBoundings, $position, $stepSize, $axis->majorGrid ); } // major step $this->drawStep( $renderer, $position, $direction, $axis->position, $this->majorStepSize, $axis->border ); } // draw label if ( $this->showLabels && ( $this->showZeroValue || ! $step->isZero ) ) { // Calculate label boundings if ( abs( $direction->x ) > abs( $direction->y ) ) { // Horizontal labels switch ( true ) { case ( $nr === 0 ): // First label $labelSize = min( $xSpace * 2, $step->width * $axisBoundings->width ); break; case ( $step->isLast ): // Last label $labelSize = min( $xSpace * 2, $steps[$nr - 1]->width * $axisBoundings->width ); break; default: $labelSize = min( $step->width * $axisBoundings->width, $steps[$nr - 1]->width * $axisBoundings->width ); break; } $labelBoundings = new ezcGraphBoundings( $position->x - $labelSize / 2 + $this->labelPadding, $position->y + $this->labelPadding, $position->x + $labelSize / 2 - $this->labelPadding, $position->y + $ySpace - $this->labelPadding ); $alignement = ezcGraph::CENTER | ezcGraph::TOP; } else { // Vertical labels switch ( true ) { case ( $nr === 0 ): // First label $labelSize = min( $ySpace * 2, $step->width * $axisBoundings->height ); break; case ( $step->isLast ): // Last label $labelSize = min( $ySpace * 2, $steps[$nr - 1]->width * $axisBoundings->height ); break; default: $labelSize = min( $step->width * $axisBoundings->height, $steps[$nr - 1]->width * $axisBoundings->height ); break; } $labelBoundings = new ezcGraphBoundings( $position->x - $xSpace + $this->labelPadding, $position->y - $labelSize / 2 + $this->labelPadding, $position->x - $this->labelPadding, $position->y + $labelSize / 2 - $this->labelPadding ); $alignement = ezcGraph::MIDDLE | ezcGraph::RIGHT; } $renderer->drawText( $labelBoundings, $step->label, $alignement ); } // Iterate over minor steps if ( !$step->isLast ) { foreach ( $step->childs as $minorStep ) { $minorStepPosition = new ezcGraphCoordinate( $start->x + ( $end->x - $start->x ) * $minorStep->position, $start->y + ( $end->y - $start->y ) * $minorStep->position ); $minorStepSize = new ezcGraphCoordinate( $axisBoundings->width * $minorStep->width, $axisBoundings->height * $minorStep->width ); if ( $axis->minorGrid ) { $this->drawGrid( $renderer, $gridBoundings, $minorStepPosition, $minorStepSize, $axis->minorGrid ); } // major step $this->drawStep( $renderer, $minorStepPosition, $direction, $axis->position, $this->minorStepSize, $axis->border ); } } } } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/renderer/axis_label_exact.php000066400000000000000000000266511226600447100265630ustar00rootroot00000000000000 * $chart->xAxis->axisLabelRenderer = new ezcGraphAxisExactLabelRenderer(); * * * @property bool $showLastValue * Show the last value on the axis, which will be aligned different * than all other values, to not interfere with the arrow head of * the axis. * @property bool $renderLastOutside * Render the last label outside of the normal axis label boundings * next to the chart boundings. This may interfere with axis labels * or cause small font size with a low axisSpace. * * @version 1.5 * @package Graph * @mainclass */ class ezcGraphAxisExactLabelRenderer extends ezcGraphAxisLabelRenderer { /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->properties['showLastValue'] = true; $this->properties['renderLastOutside'] = false; parent::__construct( $options ); } /** * __set * * @param mixed $propertyName * @param mixed $propertyValue * @throws ezcBaseValueException * If a submitted parameter was out of range or type. * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return void * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'showLastValue': case 'renderLastOutside': if ( !is_bool( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'bool' ); } $this->properties[$propertyName] = (bool) $propertyValue; break; default: return parent::__set( $propertyName, $propertyValue ); } } /** * Render Axis labels * * Render labels for an axis. * * @param ezcGraphRenderer $renderer Renderer used to draw the chart * @param ezcGraphBoundings $boundings Boundings of the axis * @param ezcGraphCoordinate $start Axis starting point * @param ezcGraphCoordinate $end Axis ending point * @param ezcGraphChartElementAxis $axis Axis instance * @return void */ public function renderLabels( ezcGraphRenderer $renderer, ezcGraphBoundings $boundings, ezcGraphCoordinate $start, ezcGraphCoordinate $end, ezcGraphChartElementAxis $axis, ezcGraphBoundings $innerBoundings = null ) { // receive rendering parameters from axis $steps = $axis->getSteps(); $axisBoundings = new ezcGraphBoundings( $start->x, $start->y, $end->x, $end->y ); // Determine normalized axis direction $direction = new ezcGraphVector( $end->x - $start->x, $end->y - $start->y ); $direction->unify(); // Get axis space $gridBoundings = null; list( $xSpace, $ySpace ) = $this->getAxisSpace( $renderer, $boundings, $axis, $innerBoundings, $gridBoundings ); // Draw steps and grid foreach ( $steps as $nr => $step ) { $position = new ezcGraphCoordinate( $start->x + ( $end->x - $start->x ) * $step->position, $start->y + ( $end->y - $start->y ) * $step->position ); $stepSize = new ezcGraphCoordinate( $axisBoundings->width * $step->width, $axisBoundings->height * $step->width ); if ( ! $step->isZero ) { // major grid if ( $axis->majorGrid ) { $this->drawGrid( $renderer, $gridBoundings, $position, $stepSize, $axis->majorGrid ); } // major step $this->drawStep( $renderer, $position, $direction, $axis->position, $this->majorStepSize, $axis->border ); } if ( $this->showLabels ) { switch ( $axis->position ) { case ezcGraph::RIGHT: case ezcGraph::LEFT: $labelWidth = $axisBoundings->width * $steps[$nr - $step->isLast]->width / ( $this->showLastValue + 1 ); $labelHeight = $ySpace; if ( ( $this->renderLastOutside === true ) && ( $step->isLast === true ) ) { $labelWidth = ( $boundings->width - $axisBoundings->width ) / 2; } break; case ezcGraph::BOTTOM: case ezcGraph::TOP: $labelWidth = $xSpace; $labelHeight = $axisBoundings->height * $steps[$nr - $step->isLast]->width / ( $this->showLastValue + 1 ); if ( ( $this->renderLastOutside === true ) && ( $step->isLast === true ) ) { $labelHeight = ( $boundings->height - $axisBoundings->height ) / 2; } break; } $showLabel = true; switch ( true ) { case ( !$this->showLastValue && $step->isLast ): // Skip last step if showLastValue is false $showLabel = false; break; // Draw label at top left of step case ( ( $axis->position === ezcGraph::BOTTOM ) && ( !$step->isLast ) ) || ( ( $axis->position === ezcGraph::BOTTOM ) && ( $step->isLast ) && ( $this->renderLastOutside ) ) || ( ( $axis->position === ezcGraph::TOP ) && ( $step->isLast ) && ( !$this->renderLastOutside ) ): $labelBoundings = new ezcGraphBoundings( $position->x - $labelWidth + $this->labelPadding, $position->y - $labelHeight + $this->labelPadding, $position->x - $this->labelPadding, $position->y - $this->labelPadding ); $alignement = ezcGraph::RIGHT | ezcGraph::BOTTOM; break; // Draw label at bottom right of step case ( ( $axis->position === ezcGraph::LEFT ) && ( !$step->isLast ) ) || ( ( $axis->position === ezcGraph::LEFT ) && ( $step->isLast ) && ( $this->renderLastOutside ) ) || ( ( $axis->position === ezcGraph::RIGHT ) && ( $step->isLast ) && ( !$this->renderLastOutside ) ): $labelBoundings = new ezcGraphBoundings( $position->x + $this->labelPadding, $position->y + $this->labelPadding, $position->x + $labelWidth - $this->labelPadding, $position->y + $labelHeight - $this->labelPadding ); $alignement = ezcGraph::LEFT | ezcGraph::TOP; break; // Draw label at bottom left of step case ( ( $axis->position === ezcGraph::TOP ) && ( !$step->isLast ) ) || ( ( $axis->position === ezcGraph::TOP ) && ( $step->isLast ) && ( $this->renderLastOutside ) ) || ( ( $axis->position === ezcGraph::RIGHT ) && ( !$step->isLast ) ) || ( ( $axis->position === ezcGraph::RIGHT ) && ( $step->isLast ) && ( $this->renderLastOutside ) ) || ( ( $axis->position === ezcGraph::BOTTOM ) && ( $step->isLast ) && ( !$this->renderLastOutside ) ) || ( ( $axis->position === ezcGraph::LEFT ) && ( $step->isLast ) && ( !$this->renderLastOutside ) ): $labelBoundings = new ezcGraphBoundings( $position->x - $labelWidth + $this->labelPadding, $position->y + $this->labelPadding, $position->x - $this->labelPadding, $position->y + $labelHeight - $this->labelPadding ); $alignement = ezcGraph::RIGHT | ezcGraph::TOP; break; } if ( $showLabel ) { $renderer->drawText( $labelBoundings, $step->label, $alignement ); } } if ( !$step->isLast ) { // Iterate over minor steps foreach ( $step->childs as $minorStep ) { $minorStepPosition = new ezcGraphCoordinate( $start->x + ( $end->x - $start->x ) * $minorStep->position, $start->y + ( $end->y - $start->y ) * $minorStep->position ); $minorStepSize = new ezcGraphCoordinate( $axisBoundings->width * $minorStep->width, $axisBoundings->height * $minorStep->width ); if ( $axis->minorGrid ) { $this->drawGrid( $renderer, $gridBoundings, $minorStepPosition, $minorStepSize, $axis->minorGrid ); } // major step $this->drawStep( $renderer, $minorStepPosition, $direction, $axis->position, $this->minorStepSize, $axis->border ); } } } } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/renderer/axis_label_none.php000066400000000000000000000022331226600447100264040ustar00rootroot00000000000000 * $chart->xAxis->axisLabelRenderer = new ezcGraphAxisNoLabelRenderer(); * * * @version 1.5 * @package Graph */ class ezcGraphAxisNoLabelRenderer extends ezcGraphAxisLabelRenderer { /** * Render Axis labels * * Render labels for an axis. * * @param ezcGraphRenderer $renderer Renderer used to draw the chart * @param ezcGraphBoundings $boundings Boundings of the axis * @param ezcGraphCoordinate $start Axis starting point * @param ezcGraphCoordinate $end Axis ending point * @param ezcGraphChartElementAxis $axis Axis instance * @return void */ public function renderLabels( ezcGraphRenderer $renderer, ezcGraphBoundings $boundings, ezcGraphCoordinate $start, ezcGraphCoordinate $end, ezcGraphChartElementAxis $axis ) { return true; } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/renderer/axis_label_radar.php000066400000000000000000000260371226600447100265460ustar00rootroot00000000000000 * $chart->xAxis->axisLabelRenderer = new ezcGraphAxisRadarLabelRenderer(); * * * @property float $lastStep * Position of last step on the axis to calculate the grid. * * @version 1.5 * @package Graph * @mainclass */ class ezcGraphAxisRadarLabelRenderer extends ezcGraphAxisLabelRenderer { /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { $this->properties['lastStep'] = null; parent::__construct( $options ); } /** * __set * * @param mixed $propertyName * @param mixed $propertyValue * @throws ezcBaseValueException * If a submitted parameter was out of range or type. * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return void * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'lastStep': if ( !is_null( $propertyValue ) && ( !is_float( $propertyValue ) || ( $propertyValue < 0 ) || ( $propertyValue > 1 ) ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, '0 <= float <= 1' ); } $this->properties['lastStep'] = $propertyValue; break; default: return parent::__set( $propertyName, $propertyValue ); } } /** * Render Axis labels * * Render labels for an axis. * * @param ezcGraphRenderer $renderer Renderer used to draw the chart * @param ezcGraphBoundings $boundings Boundings of the axis * @param ezcGraphCoordinate $start Axis starting point * @param ezcGraphCoordinate $end Axis ending point * @param ezcGraphChartElementAxis $axis Axis instance * @return void */ public function renderLabels( ezcGraphRenderer $renderer, ezcGraphBoundings $boundings, ezcGraphCoordinate $start, ezcGraphCoordinate $end, ezcGraphChartElementAxis $axis ) { // receive rendering parameters from axis $steps = $axis->getSteps(); $axisBoundings = new ezcGraphBoundings( $start->x, $start->y, $end->x, $end->y ); // Determine normalized axis direction $direction = new ezcGraphVector( $start->x - $end->x, $start->y - $end->y ); $direction->unify(); // Draw steps and grid foreach ( $steps as $nr => $step ) { $position = new ezcGraphCoordinate( $start->x + ( $end->x - $start->x ) * $step->position, $start->y + ( $end->y - $start->y ) * $step->position ); $stepSize = new ezcGraphCoordinate( $axisBoundings->width * $step->width, $axisBoundings->height * $step->width ); // Draw major grid if ( ( $this->lastStep !== null ) && $axis->majorGrid ) { $this->drawGrid( $renderer, $boundings, $position, $stepSize, $axis->majorGrid, $step->position ); } // major step $this->drawStep( $renderer, $position, $direction, $axis->position, $this->majorStepSize, $axis->border ); // draw label if ( $this->showLabels && ( $this->lastStep === null ) ) { // Calculate label boundings if ( abs( $direction->x ) > abs( $direction->y ) ) { // Horizontal labels switch ( true ) { case ( $nr === 0 ): // First label $labelSize = min( $renderer->xAxisSpace * 2, $step->width * $axisBoundings->width ); break; case ( $step->isLast ): // Last label $labelSize = min( $renderer->xAxisSpace * 2, $steps[$nr - 1]->width * $axisBoundings->width ); break; default: $labelSize = min( $step->width * $axisBoundings->width, $steps[$nr - 1]->width * $axisBoundings->width ); break; } $labelBoundings = new ezcGraphBoundings( $position->x - $labelSize / 2 + $this->labelPadding, $position->y + $this->labelPadding, $position->x + $labelSize / 2 - $this->labelPadding, $position->y + $renderer->yAxisSpace - $this->labelPadding ); $alignement = ezcGraph::CENTER | ezcGraph::TOP; } else { // Vertical labels switch ( true ) { case ( $nr === 0 ): // First label $labelSize = min( $renderer->yAxisSpace * 2, $step->width * $axisBoundings->height ); break; case ( $step->isLast ): // Last label $labelSize = min( $renderer->yAxisSpace * 2, $steps[$nr - 1]->width * $axisBoundings->height ); break; default: $labelSize = min( $step->width * $axisBoundings->height, $steps[$nr - 1]->width * $axisBoundings->height ); break; } $labelBoundings = new ezcGraphBoundings( $position->x - $renderer->xAxisSpace + $this->labelPadding, $position->y - $labelSize / 2 + $this->labelPadding, $position->x - $this->labelPadding, $position->y + $labelSize / 2 - $this->labelPadding ); $alignement = ezcGraph::MIDDLE | ezcGraph::RIGHT; } $renderer->drawText( $labelBoundings, $step->label, $alignement ); } // Iterate over minor steps if ( !$step->isLast ) { foreach ( $step->childs as $minorStep ) { $minorStepPosition = new ezcGraphCoordinate( $start->x + ( $end->x - $start->x ) * $minorStep->position, $start->y + ( $end->y - $start->y ) * $minorStep->position ); $minorStepSize = new ezcGraphCoordinate( $axisBoundings->width * $minorStep->width, $axisBoundings->height * $minorStep->width ); if ( ( $this->lastStep !== null ) && $axis->minorGrid ) { $this->drawGrid( $renderer, $boundings, $minorStepPosition, $minorStepSize, $axis->minorGrid, $minorStep->position ); } // major step $this->drawStep( $renderer, $minorStepPosition, $direction, $axis->position, $this->minorStepSize, $axis->border ); } } } } /** * Draw grid * * Draws a grid line at the current position * * @param ezcGraphRenderer $renderer Renderer to draw the grid with * @param ezcGraphBoundings $boundings Boundings of axis * @param ezcGraphCoordinate $position Position of step * @param ezcGraphCoordinate $direction Direction of axis * @param ezcGraphColor $color Color of axis * @param int $stepPosition * @return void */ protected function drawGrid( ezcGraphRenderer $renderer, ezcGraphBoundings $boundings, ezcGraphCoordinate $position, ezcGraphCoordinate $direction, ezcGraphColor $color, $stepPosition = null ) { // Calculate position on last axis $start = new ezcGraphCoordinate( $boundings->x0 + $width = ( $boundings->width / 2 ), $boundings->y0 + $height = ( $boundings->height / 2 ) ); $lastAngle = $this->lastStep * 2 * M_PI; $end = new ezcGraphCoordinate( $start->x + sin( $lastAngle ) * $width, $start->y - cos( $lastAngle ) * $height ); $direction = new ezcGraphVector( $end->x - $start->x, $end->y - $start->y ); $direction->unify(); // Convert elipse to circle for correct angle calculation $direction->y *= ( $renderer->xAxisSpace / $renderer->yAxisSpace ); $angle = $direction->angle( new ezcGraphVector( 0, 1 ) ); $movement = new ezcGraphVector( sin( $angle ) * $renderer->xAxisSpace * ( $direction->x < 0 ? -1 : 1 ), cos( $angle ) * $renderer->yAxisSpace ); $start->x += $movement->x; $start->y += $movement->y; $end->x -= $movement->x; $end->y -= $movement->y; $lastPosition = new ezcGraphCoordinate( $start->x + ( $end->x - $start->x ) * $stepPosition, $start->y + ( $end->y - $start->y ) * $stepPosition ); $renderer->drawGridLine( $position, $lastPosition, $color ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/renderer/axis_label_rotated.php000066400000000000000000000426771226600447100271270ustar00rootroot00000000000000 * $chart->xAxis->axisLabelRenderer = new ezcGraphAxisRotatedLabelRenderer(); * * // Define angle manually in degree * $chart->xAxis->axisLabelRenderer->angle = 45; * * // Increase axis space * $chart->xAxis->axisSpace = .2; * * * @property float $angle * Angle of labels on axis in degrees. * * @version 1.5 * @package Graph * @mainclass */ class ezcGraphAxisRotatedLabelRenderer extends ezcGraphAxisLabelRenderer { /** * Store step array for later coordinate modifications * * @var array(ezcGraphStep) */ protected $steps; /** * Store direction for later coordinate modifications * * @var ezcGraphVector */ protected $direction; /** * Store coordinate width modifier for later coordinate modifications * * @var float */ protected $widthModifier; /** * Store coordinate offset for later coordinate modifications * * @var float */ protected $offset; /** * Constructor * * @param array $options Default option array * @return void * @ignore */ public function __construct( array $options = array() ) { parent::__construct( $options ); $this->properties['angle'] = null; $this->properties['labelOffset'] = true; } /** * __set * * @param mixed $propertyName * @param mixed $propertyValue * @throws ezcBaseValueException * If a submitted parameter was out of range or type. * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return void * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'angle': if ( !is_numeric( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, '0 <= float < 360' ); } $reducement = (int) ( $propertyValue - $propertyValue % 360 ); $this->properties['angle'] = (float) $propertyValue - $reducement; break; case 'labelOffset': if ( !is_bool( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'bool' ); } $this->properties[$propertyName] = (bool) $propertyValue; break; default: return parent::__set( $propertyName, $propertyValue ); } } /** * Determine label angle * * Determine the optiomal angle for the axis labels, of no angle has been * provided by the user. * * @param array $steps * @return void */ protected function determineAngle( array $steps, $xSpace, $ySpace, ezcGraphBoundings $axisBoundings ) { if ( $this->angle === null ) { $minimumStepWidth = null; foreach ( $steps as $nr => $step ) { if ( ( $minimumStepWidth === null ) || ( $step->width < $minimumStepWidth ) ) { $minimumStepWidth = $step->width; } } $width = abs( $axisBoundings->width * $minimumStepWidth * $this->direction->x + $axisBoundings->height * $minimumStepWidth * $this->direction->y ); $height = abs( $ySpace * $this->direction->x + $xSpace * $this->direction->y ); $length = sqrt( pow( $width, 2 ) + pow( $height, 2 ) ); $this->angle = rad2deg( acos( $height / $length ) ); } } /** * Determine text offset. * * Calculate the label offset and angle, from the configured or evaluated * text angle. * * Returns the text angle in degrees. * * @param ezcGraphChartElementAxis $axis * @param array $steps * @return float */ protected function determineTextOffset( ezcGraphChartElementAxis $axis, array $steps ) { // Determine additional required axis space by boxes $firstStep = reset( $steps ); $lastStep = end( $steps ); $axisAngle = -$this->direction->angle( new ezcGraphVector( 1, 0 ) ); $textAngle = $axisAngle + deg2rad( $this->angle ) + ( $axis->position & ( ezcGraph::TOP | ezcGraph::BOTTOM ) ? deg2rad( 270 ) : deg2rad( 90 ) ); // Ensure angle between 0 and 360 degrees $degTextAngle = rad2deg( $textAngle ); while ( $degTextAngle < 0 ) { $degTextAngle += 360.; } if ( $this->properties['labelOffset'] ) { $this->offset = ( $this->angle < 0 ? -1 : 1 ) * ( $axis->position & ( ezcGraph::TOP | ezcGraph::LEFT ) ? 1 : -1 ) * ( 1 - cos( deg2rad( $this->angle * 2 ) ) ); } else { $this->offset = 0; } return $degTextAngle; } /** * Calculate label size * * Calculate the size of a single lable in a single step. * * @param array $steps * @param int $nr * @param array $step * @param float $xSpace * @param float $ySpace * @param ezcGraphBoundings $axisBoundings * @return float */ protected function calculateLabelSize( array $steps, $nr, $step, $xSpace, $ySpace, ezcGraphBoundings $axisBoundings ) { switch ( true ) { case ( $nr === 0 ): $labelSize = min( abs( $xSpace * 2 * $this->direction->y + $ySpace * 2 * $this->direction->x ), abs( $step->width * $axisBoundings->width * $this->direction->x + $step->width * $axisBoundings->height * $this->direction->y ) ); break; case ( $step->isLast ): $labelSize = min( abs( $xSpace * 2 * $this->direction->y + $ySpace * 2 * $this->direction->x ), abs( $steps[$nr - 1]->width * $axisBoundings->width * $this->direction->x + $steps[$nr - 1]->width * $axisBoundings->height * $this->direction->y ) ); break; default: $labelSize = abs( $step->width * $axisBoundings->width * $this->direction->x + $step->width * $axisBoundings->height * $this->direction->y ); break; } return $labelSize * cos( deg2rad( $this->angle ) ); } /** * Calculate general label length * * @param ezcGraphCoordinate $start * @param ezcGraphCoordinate $end * @param float $xSpace * @param float $ySpace * @param ezcGraphBoundings $axisBoundings * @return float */ protected function calculateLabelLength( ezcGraphCoordinate $start, ezcGraphCoordinate $end, $xSpace, $ySpace, ezcGraphBoundings $axisBoundings ) { $axisSpaceFactor = abs( ( $this->direction->x == 0 ? 0 : $this->direction->x * $ySpace / $axisBoundings->width ) + ( $this->direction->y == 0 ? 0 : $this->direction->y * $xSpace / $axisBoundings->height ) ); $axisWidth = $end->x - $start->x; $axisHeight = $end->y - $start->y; $start->x += max( 0., $axisSpaceFactor * $this->offset ) * $axisWidth; $start->y += max( 0., $axisSpaceFactor * $this->offset ) * $axisHeight; $end->x += min( 0., $axisSpaceFactor * $this->offset ) * $axisWidth; $end->y += min( 0., $axisSpaceFactor * $this->offset ) * $axisHeight; $labelLength = sqrt( pow( $xSpace * $this->direction->y + ( $this->labelOffset ? $axisSpaceFactor * $this->offset * ( $end->x - $start->x ) : $ySpace * 2 * $this->direction->x ), 2 ) + pow( $ySpace * $this->direction->x + ( $this->labelOffset ? $axisSpaceFactor * $this->offset * ( $end->y - $start->y ) : $xSpace * 2 * $this->direction->y ), 2 ) ); $this->offset *= $axisSpaceFactor; return $labelLength; } /** * Render label text. * * Render the text of a single label, depending on the position, length and * rotation of the label. * * @param ezcGraphRenderer $renderer * @param ezcGraphChartElementAxis $axis * @param ezcGraphCoordinate $position * @param string $label * @param float $degTextAngle * @param float $labelLength * @param float $labelSize * @param float $lengthReducement * @return void */ protected function renderLabelText( ezcGraphRenderer $renderer, ezcGraphChartElementAxis $axis, ezcGraphCoordinate $position, $label, $degTextAngle, $labelLength, $labelSize, $lengthReducement ) { switch ( true ) { case ( ( ( $degTextAngle >= 0 ) && ( $degTextAngle < 90 ) && ( ( $axis->position === ezcGraph::LEFT ) || ( $axis->position === ezcGraph::RIGHT ) ) ) || ( ( $degTextAngle >= 270 ) && ( $degTextAngle < 360 ) && ( ( $axis->position === ezcGraph::TOP ) || ( $axis->position === ezcGraph::BOTTOM ) ) ) ): $labelBoundings = new ezcGraphBoundings( $position->x, $position->y, $position->x + abs( $labelLength ) - $lengthReducement, $position->y + $labelSize ); $labelAlignement = ezcGraph::LEFT | ezcGraph::TOP; $labelRotation = $degTextAngle; break; case ( ( ( $degTextAngle >= 90 ) && ( $degTextAngle < 180 ) && ( ( $axis->position === ezcGraph::LEFT ) || ( $axis->position === ezcGraph::RIGHT ) ) ) || ( ( $degTextAngle >= 180 ) && ( $degTextAngle < 270 ) && ( ( $axis->position === ezcGraph::TOP ) || ( $axis->position === ezcGraph::BOTTOM ) ) ) ): $labelBoundings = new ezcGraphBoundings( $position->x - abs( $labelLength ) + $lengthReducement, $position->y, $position->x, $position->y + $labelSize ); $labelAlignement = ezcGraph::RIGHT | ezcGraph::TOP; $labelRotation = $degTextAngle - 180; break; case ( ( ( $degTextAngle >= 180 ) && ( $degTextAngle < 270 ) && ( ( $axis->position === ezcGraph::LEFT ) || ( $axis->position === ezcGraph::RIGHT ) ) ) || ( ( $degTextAngle >= 90 ) && ( $degTextAngle < 180 ) && ( ( $axis->position === ezcGraph::TOP ) || ( $axis->position === ezcGraph::BOTTOM ) ) ) ): $labelBoundings = new ezcGraphBoundings( $position->x - abs( $labelLength ) + $lengthReducement, $position->y - $labelSize, $position->x, $position->y ); $labelAlignement = ezcGraph::RIGHT | ezcGraph::BOTTOM; $labelRotation = $degTextAngle - 180; break; case ( ( ( $degTextAngle >= 270 ) && ( $degTextAngle < 360 ) && ( ( $axis->position === ezcGraph::LEFT ) || ( $axis->position === ezcGraph::RIGHT ) ) ) || ( ( $degTextAngle >= 0 ) && ( $degTextAngle < 90 ) && ( ( $axis->position === ezcGraph::TOP ) || ( $axis->position === ezcGraph::BOTTOM ) ) ) ): $labelBoundings = new ezcGraphBoundings( $position->x, $position->y, $position->x - abs( $labelLength ) + $lengthReducement, $position->y + $labelSize ); $labelAlignement = ezcGraph::LEFT | ezcGraph::TOP; $labelRotation = $degTextAngle; break; } $renderer->drawText( $labelBoundings, $label, $labelAlignement, new ezcGraphRotation( $labelRotation, $position ) ); } /** * Render Axis labels * * Render labels for an axis. * * @param ezcGraphRenderer $renderer Renderer used to draw the chart * @param ezcGraphBoundings $boundings Boundings of the axis * @param ezcGraphCoordinate $start Axis starting point * @param ezcGraphCoordinate $end Axis ending point * @param ezcGraphChartElementAxis $axis Axis instance * @return void */ public function renderLabels( ezcGraphRenderer $renderer, ezcGraphBoundings $boundings, ezcGraphCoordinate $start, ezcGraphCoordinate $end, ezcGraphChartElementAxis $axis, ezcGraphBoundings $innerBoundings = null ) { // receive rendering parameters from axis $steps = $axis->getSteps(); $axisBoundings = new ezcGraphBoundings( $start->x, $start->y, $end->x, $end->y ); // Determine normalized axis direction $this->direction = new ezcGraphVector( $end->x - $start->x, $end->y - $start->y ); $this->direction->unify(); // Get axis space $gridBoundings = null; list( $xSpace, $ySpace ) = $this->getAxisSpace( $renderer, $boundings, $axis, $innerBoundings, $gridBoundings ); // Determine optimal angle if none specified $this->determineAngle( $steps, $xSpace, $ySpace, $axisBoundings ); $degTextAngle = $this->determineTextOffset( $axis, $steps ); $labelLength = $this->calculateLabelLength( $start, $end, $xSpace, $ySpace, $axisBoundings ); // Draw steps and grid foreach ( $steps as $nr => $step ) { $position = new ezcGraphCoordinate( $start->x + ( $end->x - $start->x ) * $step->position * abs( $this->direction->x ), $start->y + ( $end->y - $start->y ) * $step->position * abs( $this->direction->y ) ); $stepSize = new ezcGraphCoordinate( ( $end->x - $start->x ) * $step->width, ( $end->y - $start->y ) * $step->width ); // Calculate label boundings $labelSize = $this->calculateLabelSize( $steps, $nr, $step, $xSpace, $ySpace, $axisBoundings ); $lengthReducement = min( abs( tan( deg2rad( $this->angle ) ) * ( $labelSize / 2 ) ), abs( $labelLength / 2 ) ); $this->renderLabelText( $renderer, $axis, $position, $step->label, $degTextAngle, $labelLength, $labelSize, $lengthReducement ); // Major grid if ( $axis->majorGrid ) { $this->drawGrid( $renderer, $gridBoundings, $position, $stepSize, $axis->majorGrid ); } // Major step $this->drawStep( $renderer, $position, $this->direction, $axis->position, $this->majorStepSize, $axis->border ); } } /** * Modify chart data position * * Optionally additionally modify the coodinate of a data point * * @param ezcGraphCoordinate $coordinate Data point coordinate * @return ezcGraphCoordinate Modified coordinate */ public function modifyChartDataPosition( ezcGraphCoordinate $coordinate ) { return new ezcGraphCoordinate( $coordinate->x * abs( $this->direction->y ) + ( $coordinate->x * ( 1 - abs( $this->offset ) ) * abs( $this->direction->x ) ) + ( abs( $this->offset ) * abs( $this->direction->x ) ), $coordinate->y * abs( $this->direction->x ) + ( $coordinate->y * ( 1 - abs( $this->offset ) ) * abs( $this->direction->y ) ) + ( abs( $this->offset ) * abs( $this->direction->y ) ) ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/renderer/axis_label_rotated_boxed.php000066400000000000000000000121441226600447100302720ustar00rootroot00000000000000 * $chart->xAxis->axisLabelRenderer = new ezcGraphAxisRotatedLabelRenderer(); * * // Define angle manually in degree * $chart->xAxis->axisLabelRenderer->angle = 45; * * // Increase axis space * $chart->xAxis->axisSpace = .2; * * * @property float $angle * Angle of labels on axis in degrees. * * @version 1.5 * @package Graph * @mainclass */ class ezcGraphAxisRotatedBoxedLabelRenderer extends ezcGraphAxisRotatedLabelRenderer { /** * Render Axis labels * * Render labels for an axis. * * @param ezcGraphRenderer $renderer Renderer used to draw the chart * @param ezcGraphBoundings $boundings Boundings of the axis * @param ezcGraphCoordinate $start Axis starting point * @param ezcGraphCoordinate $end Axis ending point * @param ezcGraphChartElementAxis $axis Axis instance * @return void */ public function renderLabels( ezcGraphRenderer $renderer, ezcGraphBoundings $boundings, ezcGraphCoordinate $start, ezcGraphCoordinate $end, ezcGraphChartElementAxis $axis, ezcGraphBoundings $innerBoundings = null ) { // receive rendering parameters from axis $this->steps = $steps = $axis->getSteps(); $axisBoundings = new ezcGraphBoundings( $start->x, $start->y, $end->x, $end->y ); // Determine normalized axis direction $this->direction = new ezcGraphVector( $end->x - $start->x, $end->y - $start->y ); $this->direction->unify(); // Get axis space $gridBoundings = null; list( $xSpace, $ySpace ) = $this->getAxisSpace( $renderer, $boundings, $axis, $innerBoundings, $gridBoundings ); // Determine optimal angle if none specified $this->determineAngle( $steps, $xSpace, $ySpace, $axisBoundings ); $degTextAngle = $this->determineTextOffset( $axis, $steps ); $labelLength = $this->calculateLabelLength( $start, $end, $xSpace, $ySpace, $axisBoundings ); // Determine additional required axis space by boxes $firstStep = reset( $steps ); $lastStep = end( $steps ); $this->widthModifier = 1 + $firstStep->width / 2 + $lastStep->width / 2; // Draw steps and grid foreach ( $steps as $nr => $step ) { $position = new ezcGraphCoordinate( $start->x + ( $end->x - $start->x ) * ( $step->position + $step->width ) / $this->widthModifier, $start->y + ( $end->y - $start->y ) * ( $step->position + $step->width ) / $this->widthModifier ); $stepWidth = $step->width / $this->widthModifier; $stepSize = new ezcGraphCoordinate( $axisBoundings->width * $stepWidth, $axisBoundings->height * $stepWidth ); // Calculate label boundings $labelSize = $this->calculateLabelSize( $steps, $nr, $step, $xSpace, $ySpace, $axisBoundings ); $lengthReducement = min( abs( tan( deg2rad( $this->angle ) ) * ( $labelSize / 2 ) ), abs( $labelLength / 2 ) ); $this->renderLabelText( $renderer, $axis, $position, $step->label, $degTextAngle, $labelLength, $labelSize, $lengthReducement ); // Major grid if ( $axis->majorGrid ) { $this->drawGrid( $renderer, $gridBoundings, $position, $stepSize, $axis->majorGrid ); } // Major step $this->drawStep( $renderer, $position, $this->direction, $axis->position, $this->majorStepSize, $axis->border ); } } /** * Modify chart data position * * Optionally additionally modify the coodinate of a data point * * @param ezcGraphCoordinate $coordinate Data point coordinate * @return ezcGraphCoordinate Modified coordinate */ public function modifyChartDataPosition( ezcGraphCoordinate $coordinate ) { $firstStep = reset( $this->steps ); $offset = $firstStep->width / 2 / $this->widthModifier; return new ezcGraphCoordinate( $coordinate->x * abs( $this->direction->y ) + ( $coordinate->x * ( 1 / $this->widthModifier ) * ( 1 - abs( $this->offset ) ) + abs( $this->offset ) + $offset ) * abs( $this->direction->x ), $coordinate->y * abs( $this->direction->x ) + ( $coordinate->y * ( 1 / $this->widthModifier ) * ( 1 - abs( $this->offset ) ) + abs( $this->offset ) + $offset ) * abs( $this->direction->y ) ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/renderer/horizontal_bar.php000066400000000000000000000137131226600447100263040ustar00rootroot00000000000000 * @TODO: Add example * * * @version 1.5 * @package Graph * @mainclass */ class ezcGraphHorizontalRenderer extends ezcGraphRenderer2d implements ezcGraphHorizontalBarRenderer { /** * Draw horizontal bar * * Draws a horizontal bar as a data element in a line chart * * @param ezcGraphBoundings $boundings Chart boundings * @param ezcGraphContext $context Context of call * @param ezcGraphColor $color Color of line * @param ezcGraphCoordinate $position Position of data point * @param float $stepSize Space which can be used for bars * @param int $dataNumber Number of dataset * @param int $dataCount Count of datasets in chart * @param int $symbol Symbol to draw for line * @param float $axisPosition Position of axis for drawing filled lines * @return void */ public function drawHorizontalBar( ezcGraphBoundings $boundings, ezcGraphContext $context, ezcGraphColor $color, ezcGraphCoordinate $position, $stepSize, $dataNumber = 1, $dataCount = 1, $symbol = ezcGraph::NO_SYMBOL, $axisPosition = 0. ) { // Apply margin $margin = $stepSize * $this->options->barMargin; $padding = $stepSize * $this->options->barPadding; $barHeight = ( $stepSize - $margin ) / $dataCount - $padding; $offset = - $stepSize / 2 + $margin / 2 + ( $dataCount - $dataNumber - 1 ) * ( $padding + $barHeight ) + $padding / 2; $barPointArray = array( new ezcGraphCoordinate( $boundings->x0 + ( $boundings->width ) * $axisPosition, $boundings->y0 + ( $boundings->height ) * $position->y + $offset ), new ezcGraphCoordinate( $boundings->x0 + ( $boundings->width ) * $position->x, $boundings->y0 + ( $boundings->height ) * $position->y + $offset ), new ezcGraphCoordinate( $boundings->x0 + ( $boundings->width ) * $position->x, $boundings->y0 + ( $boundings->height ) * $position->y + $offset + $barHeight ), new ezcGraphCoordinate( $boundings->x0 + ( $boundings->width ) * $axisPosition, $boundings->y0 + ( $boundings->height ) * $position->y + $offset + $barHeight ), ); $this->addElementReference( $context, $this->driver->drawPolygon( $barPointArray, $color, true ) ); if ( $this->options->dataBorder > 0 ) { $darkened = $color->darken( $this->options->dataBorder ); $this->driver->drawPolygon( $barPointArray, $darkened, false, 1 ); } } /** * Draw bar * * Draws a bar as a data element in a line chart * * @param ezcGraphBoundings $boundings Chart boundings * @param ezcGraphContext $context Context of call * @param ezcGraphColor $color Color of line * @param ezcGraphCoordinate $position Position of data point * @param float $stepSize Space which can be used for bars * @param int $dataNumber Number of dataset * @param int $dataCount Count of datasets in chart * @param int $symbol Symbol to draw for line * @param float $axisPosition Position of axis for drawing filled lines * @return void */ public function drawBar( ezcGraphBoundings $boundings, ezcGraphContext $context, ezcGraphColor $color, ezcGraphCoordinate $position, $stepSize, $dataNumber = 1, $dataCount = 1, $symbol = ezcGraph::NO_SYMBOL, $axisPosition = 0. ) { throw new ezcBaseFunctionalityNotSupportedException( "A normal bar chart", "Only horizontal bar charts can be renderered with the ezcGraphHorizontalRenderer" ); } /** * Draw data line * * Draws a line as a data element in a line chart * * @param ezcGraphBoundings $boundings Chart boundings * @param ezcGraphContext $context Context of call * @param ezcGraphColor $color Color of line * @param ezcGraphCoordinate $start Starting point * @param ezcGraphCoordinate $end Ending point * @param int $dataNumber Number of dataset * @param int $dataCount Count of datasets in chart * @param int $symbol Symbol to draw for line * @param ezcGraphColor $symbolColor Color of the symbol, defaults to linecolor * @param ezcGraphColor $fillColor Color to fill line with * @param float $axisPosition Position of axis for drawing filled lines * @param float $thickness Line thickness * @return void */ public function drawDataLine( ezcGraphBoundings $boundings, ezcGraphContext $context, ezcGraphColor $color, ezcGraphCoordinate $start, ezcGraphCoordinate $end, $dataNumber = 1, $dataCount = 1, $symbol = ezcGraph::NO_SYMBOL, ezcGraphColor $symbolColor = null, ezcGraphColor $fillColor = null, $axisPosition = 0., $thickness = 1. ) { throw new ezcBaseFunctionalityNotSupportedException( "A normal line chart", "Only horizontal bar charts can be renderered with the ezcGraphHorizontalRenderer" ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/structs/000077500000000000000000000000001226600447100224525ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/structs/context.php000066400000000000000000000045521226600447100246550ustar00rootroot00000000000000dataset = $dataset; $this->datapoint = $datapoint; $this->url = $url; } /** * __set_state * * @param array $properties Struct properties * @return void * @ignore */ public function __set_state( array $properties ) { $this->dataset = (string) $properties['dataset']; $this->datapoint = (string) $properties['datapoint']; // Check to keep BC // @TODO: Remvove unnesecary check on next major version if ( array_key_exists( 'url', $properties ) ) { $this->url = (string) $properties['url']; } } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/structs/coordinate.php000066400000000000000000000031751226600447100253200ustar00rootroot00000000000000x = $x; $this->y = $y; } /** * __set_state * * @param array $properties Struct properties * @return void * @ignore */ public function __set_state( array $properties ) { $this->x = $properties['x']; $this->y = $properties['y']; } /** * Returns simple string representation of coordinate * * @return string * @ignore */ public function __toString() { return sprintf( '( %.2f, %.2f )', $this->x, $this->y ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/structs/step.php000066400000000000000000000045441226600447100241450ustar00rootroot00000000000000position = (float) $position; $this->width = (float) $width; $this->label = $label; $this->childs = $childs; $this->isZero = (bool) $isZero; $this->isLast = (bool) $isLast; } /** * __set_state * * @param array $properties Struct properties * @return void * @ignore */ public function __set_state( array $properties ) { $this->position = $properties['position']; $this->width = $properties['width']; $this->label = $properties['label']; $this->childs = $properties['childs']; $this->isZero = $properties['isZero']; $this->isLast = $properties['isLast']; } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/Graph/src/tools.php000066400000000000000000000126361226600447100226240ustar00rootroot00000000000000driver instanceof ezcGraphGdDriver ) ) { throw new ezcGraphToolsIncompatibleDriverException( $chart->driver, 'ezcGraphGdDriver' ); } $elements = $chart->renderer->getElementReferences(); if ( !count( $elements ) ) { throw new ezcGraphToolsNotRenderedException( $chart ); } $imageMap = sprintf( "\n", $name ); // Iterate over legends elements if ( isset( $elements['legend'] ) ) { foreach ( $elements['legend'] as $objectName => $polygones ) { $url = $elements['legend_url'][$objectName]; if ( empty( $url ) ) { continue; } foreach ( $polygones as $shape => $polygone ) { $coordinateString = ''; foreach ( $polygone as $coordinate ) { $coordinateString .= sprintf( '%d,%d,', $coordinate->x, $coordinate->y ); } $imageMap .= sprintf( "\t\"%s\"\n", substr( $coordinateString, 0, -1 ), $url, $objectName ); } } } // Iterate over data foreach ( $elements['data'] as $dataset => $datapoints ) { foreach ( $datapoints as $datapoint => $polygones ) { $url = $chart->data[$dataset]->url[$datapoint]; if ( empty( $url ) ) { continue; } foreach ( $polygones as $polygon ) { $coordinateString = ''; foreach ( $polygon as $coordinate ) { $coordinateString .= sprintf( '%d,%d,', $coordinate->x, $coordinate->y ); } $imageMap .= sprintf( "\t\"%s\"\n", substr( $coordinateString, 0, -1 ), $url, $datapoint ); } } } return $imageMap . "\n"; } /** * Add links to clickable SVG elements in a chart with SVG driver. * * @param ezcGraphChart $chart * @return void */ public static function linkSvgElements( ezcGraphChart $chart ) { if ( ! ( $chart->driver instanceof ezcGraphSvgDriver ) ) { throw new ezcGraphToolsIncompatibleDriverException( $chart->driver, 'ezcGraphSvgDriver' ); } $fileName = $chart->getRenderedFile(); if ( !$fileName ) { throw new ezcGraphToolsNotRenderedException( $chart ); } $dom = new DOMDocument(); $dom->load( $fileName ); $xpath = new DomXPath( $dom ); $elements = $chart->renderer->getElementReferences(); // Link chart elements foreach ( $elements['data'] as $dataset => $datapoints ) { foreach ( $datapoints as $datapoint => $ids ) { $url = $chart->data[$dataset]->url[$datapoint]; if ( empty( $url ) ) { continue; } foreach ( $ids as $id ) { $element = $xpath->query( '//*[@id = \'' . $id . '\']' )->item( 0 ); $element->setAttribute( 'style', $element->getAttribute( 'style' ) . ' cursor: ' . $chart->driver->options->linkCursor . ';' ); $element->setAttribute( 'onclick', "top.location = '{$url}'" ); } } } // Link legend elements if ( isset( $elements['legend'] ) ) { foreach ( $elements['legend'] as $objectName => $ids ) { $url = $elements['legend_url'][$objectName]; if ( empty( $url ) ) { continue; } foreach ( $ids as $id ) { $element = $xpath->query( '//*[@id = \'' . $id . '\']' )->item( 0 ); $element->setAttribute( 'style', $element->getAttribute( 'style' ) . ' cursor: ' . $chart->driver->options->linkCursor . ';' ); $element->setAttribute( 'onclick', "top.location = '{$url}'" ); } } } $dom->save( $fileName ); } } ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/autoload/000077500000000000000000000000001226600447100207235ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/ezcomponents/autoload/base_autoload.php000066400000000000000000000061161226600447100242420ustar00rootroot00000000000000 'Base/exceptions/exception.php', 'ezcBaseFileException' => 'Base/exceptions/file_exception.php', 'ezcBaseAutoloadException' => 'Base/exceptions/autoload.php', 'ezcBaseDoubleClassRepositoryPrefixException' => 'Base/exceptions/double_class_repository_prefix.php', 'ezcBaseExtensionNotFoundException' => 'Base/exceptions/extension_not_found.php', 'ezcBaseFileIoException' => 'Base/exceptions/file_io.php', 'ezcBaseFileNotFoundException' => 'Base/exceptions/file_not_found.php', 'ezcBaseFilePermissionException' => 'Base/exceptions/file_permission.php', 'ezcBaseFunctionalityNotSupportedException' => 'Base/exceptions/functionality_not_supported.php', 'ezcBaseInitCallbackConfiguredException' => 'Base/exceptions/init_callback_configured.php', 'ezcBaseInitInvalidCallbackClassException' => 'Base/exceptions/invalid_callback_class.php', 'ezcBaseInvalidParentClassException' => 'Base/exceptions/invalid_parent_class.php', 'ezcBasePropertyNotFoundException' => 'Base/exceptions/property_not_found.php', 'ezcBasePropertyPermissionException' => 'Base/exceptions/property_permission.php', 'ezcBaseSettingNotFoundException' => 'Base/exceptions/setting_not_found.php', 'ezcBaseSettingValueException' => 'Base/exceptions/setting_value.php', 'ezcBaseValueException' => 'Base/exceptions/value.php', 'ezcBaseWhateverException' => 'Base/exceptions/whatever.php', 'ezcBaseOptions' => 'Base/options.php', 'ezcBaseStruct' => 'Base/struct.php', 'ezcBase' => 'Base/base.php', 'ezcBaseAutoloadOptions' => 'Base/options/autoload.php', 'ezcBaseConfigurationInitializer' => 'Base/interfaces/configuration_initializer.php', 'ezcBaseExportable' => 'Base/interfaces/exportable.php', 'ezcBaseFeatures' => 'Base/features.php', 'ezcBaseFile' => 'Base/file.php', 'ezcBaseFileFindContext' => 'Base/structs/file_find_context.php', 'ezcBaseInit' => 'Base/init.php', 'ezcBaseMetaData' => 'Base/metadata.php', 'ezcBaseMetaDataPearReader' => 'Base/metadata/pear.php', 'ezcBaseMetaDataTarballReader' => 'Base/metadata/tarball.php', 'ezcBasePersistable' => 'Base/interfaces/persistable.php', 'ezcBaseRepositoryDirectory' => 'Base/structs/repository_directory.php', ); ?> glpi-0.84.3+dfsg.1/lib/ezcomponents/autoload/graph_autoload.php000066400000000000000000000244371226600447100244370ustar00rootroot00000000000000 'Graph/exceptions/exception.php', 'ezcGraphDatasetAverageInvalidKeysException' => 'Graph/exceptions/invalid_keys.php', 'ezcGraphErrorParsingDateException' => 'Graph/exceptions/date_parsing.php', 'ezcGraphFlashBitmapTypeException' => 'Graph/exceptions/flash_bitmap_type.php', 'ezcGraphFontRenderingException' => 'Graph/exceptions/font_rendering.php', 'ezcGraphGdDriverUnsupportedImageTypeException' => 'Graph/exceptions/unsupported_image_type.php', 'ezcGraphInvalidArrayDataSourceException' => 'Graph/exceptions/invalid_data_source.php', 'ezcGraphInvalidAssignementException' => 'Graph/exceptions/invalid_assignement.php', 'ezcGraphInvalidDataException' => 'Graph/exceptions/invalid_data.php', 'ezcGraphInvalidDisplayTypeException' => 'Graph/exceptions/invalid_display_type.php', 'ezcGraphInvalidImageFileException' => 'Graph/exceptions/invalid_image_file.php', 'ezcGraphInvalidStepSizeException' => 'Graph/exceptions/invalid_step_size.php', 'ezcGraphMatrixInvalidDimensionsException' => 'Graph/exceptions/invalid_dimensions.php', 'ezcGraphMatrixOutOfBoundingsException' => 'Graph/exceptions/out_of_boundings.php', 'ezcGraphNoDataException' => 'Graph/exceptions/no_data.php', 'ezcGraphNoSuchDataException' => 'Graph/exceptions/no_such_data.php', 'ezcGraphNoSuchDataSetException' => 'Graph/exceptions/no_such_dataset.php', 'ezcGraphNoSuchElementException' => 'Graph/exceptions/no_such_element.php', 'ezcGraphOutOfLogithmicalBoundingsException' => 'Graph/exceptions/out_of_logarithmical_boundings.php', 'ezcGraphReducementFailedException' => 'Graph/exceptions/reducement_failed.php', 'ezcGraphSvgDriverInvalidIdException' => 'Graph/exceptions/invalid_id.php', 'ezcGraphTooManyDataSetsExceptions' => 'Graph/exceptions/too_many_datasets.php', 'ezcGraphToolsIncompatibleDriverException' => 'Graph/exceptions/incompatible_driver.php', 'ezcGraphToolsNotRenderedException' => 'Graph/exceptions/not_rendered.php', 'ezcGraphUnknownColorDefinitionException' => 'Graph/exceptions/unknown_color_definition.php', 'ezcGraphUnknownFontTypeException' => 'Graph/exceptions/font_type.php', 'ezcGraphUnregularStepsException' => 'Graph/exceptions/unregular_steps.php', 'ezcGraphChart' => 'Graph/interfaces/chart.php', 'ezcGraphChartElement' => 'Graph/interfaces/element.php', 'ezcGraphChartOptions' => 'Graph/options/chart.php', 'ezcGraphLineChart' => 'Graph/charts/line.php', 'ezcGraphMatrix' => 'Graph/math/matrix.php', 'ezcGraphOdometerRenderer' => 'Graph/interfaces/odometer_renderer.php', 'ezcGraphRadarRenderer' => 'Graph/interfaces/radar_renderer.php', 'ezcGraphRenderer' => 'Graph/interfaces/renderer.php', 'ezcGraphStackedBarsRenderer' => 'Graph/interfaces/stacked_bar_renderer.php', 'ezcGraphAxisLabelRenderer' => 'Graph/interfaces/axis_label_renderer.php', 'ezcGraphBarChart' => 'Graph/charts/bar.php', 'ezcGraphChartDataContainer' => 'Graph/data_container/base.php', 'ezcGraphChartElementAxis' => 'Graph/element/axis.php', 'ezcGraphColor' => 'Graph/colors/color.php', 'ezcGraphCoordinate' => 'Graph/structs/coordinate.php', 'ezcGraphDataSet' => 'Graph/datasets/base.php', 'ezcGraphDataSetProperty' => 'Graph/interfaces/dataset_property.php', 'ezcGraphDriver' => 'Graph/interfaces/driver.php', 'ezcGraphDriverOptions' => 'Graph/options/driver.php', 'ezcGraphHorizontalBarRenderer' => 'Graph/interfaces/horizontal_bar_renderer.php', 'ezcGraphPalette' => 'Graph/interfaces/palette.php', 'ezcGraphRenderer2d' => 'Graph/renderer/2d.php', 'ezcGraphRendererOptions' => 'Graph/options/renderer.php', 'ezcGraphTransformation' => 'Graph/math/transformation.php', 'ezcGraph' => 'Graph/graph.php', 'ezcGraphArrayDataSet' => 'Graph/datasets/array.php', 'ezcGraphAxisBoxedLabelRenderer' => 'Graph/renderer/axis_label_boxed.php', 'ezcGraphAxisCenteredLabelRenderer' => 'Graph/renderer/axis_label_centered.php', 'ezcGraphAxisContainer' => 'Graph/axis/container.php', 'ezcGraphAxisExactLabelRenderer' => 'Graph/renderer/axis_label_exact.php', 'ezcGraphAxisNoLabelRenderer' => 'Graph/renderer/axis_label_none.php', 'ezcGraphAxisRadarLabelRenderer' => 'Graph/renderer/axis_label_radar.php', 'ezcGraphAxisRotatedBoxedLabelRenderer' => 'Graph/renderer/axis_label_rotated_boxed.php', 'ezcGraphAxisRotatedLabelRenderer' => 'Graph/renderer/axis_label_rotated.php', 'ezcGraphAxisStep' => 'Graph/structs/step.php', 'ezcGraphBoundings' => 'Graph/math/boundings.php', 'ezcGraphCairoDriver' => 'Graph/driver/cairo.php', 'ezcGraphCairoDriverOptions' => 'Graph/options/cairo_driver.php', 'ezcGraphCairoOODriver' => 'Graph/driver/cairo_oo.php', 'ezcGraphChartElementBackground' => 'Graph/element/background.php', 'ezcGraphChartElementDateAxis' => 'Graph/axis/date.php', 'ezcGraphChartElementLabeledAxis' => 'Graph/axis/labeled.php', 'ezcGraphChartElementLegend' => 'Graph/element/legend.php', 'ezcGraphChartElementLogarithmicalAxis' => 'Graph/axis/logarithmic.php', 'ezcGraphChartElementNumericAxis' => 'Graph/axis/numeric.php', 'ezcGraphChartElementText' => 'Graph/element/text.php', 'ezcGraphChartSingleDataContainer' => 'Graph/data_container/single.php', 'ezcGraphContext' => 'Graph/structs/context.php', 'ezcGraphDataSetAveragePolynom' => 'Graph/datasets/average.php', 'ezcGraphDataSetAxisProperty' => 'Graph/datasets/property/axis.php', 'ezcGraphDataSetBooleanProperty' => 'Graph/datasets/property/boolean.php', 'ezcGraphDataSetColorProperty' => 'Graph/datasets/property/color.php', 'ezcGraphDataSetIntProperty' => 'Graph/datasets/property/integer.php', 'ezcGraphDataSetStringProperty' => 'Graph/datasets/property/string.php', 'ezcGraphFlashDriver' => 'Graph/driver/flash.php', 'ezcGraphFlashDriverOptions' => 'Graph/options/flash_driver.php', 'ezcGraphFontOptions' => 'Graph/options/font.php', 'ezcGraphGdDriver' => 'Graph/driver/gd.php', 'ezcGraphGdDriverOptions' => 'Graph/options/gd_driver.php', 'ezcGraphHorizontalBarChart' => 'Graph/charts/horizontal_bar.php', 'ezcGraphHorizontalRenderer' => 'Graph/renderer/horizontal_bar.php', 'ezcGraphLineChartOptions' => 'Graph/options/line_chart.php', 'ezcGraphLinearGradient' => 'Graph/colors/linear_gradient.php', 'ezcGraphNumericDataSet' => 'Graph/datasets/numeric.php', 'ezcGraphOdometerChart' => 'Graph/charts/odometer.php', 'ezcGraphOdometerChartOptions' => 'Graph/options/odometer_chart.php', 'ezcGraphPaletteBlack' => 'Graph/palette/black.php', 'ezcGraphPaletteEz' => 'Graph/palette/ez.php', 'ezcGraphPaletteEzBlue' => 'Graph/palette/ez_blue.php', 'ezcGraphPaletteEzGreen' => 'Graph/palette/ez_green.php', 'ezcGraphPaletteEzRed' => 'Graph/palette/ez_red.php', 'ezcGraphPaletteTango' => 'Graph/palette/tango.php', 'ezcGraphPieChart' => 'Graph/charts/pie.php', 'ezcGraphPieChartOptions' => 'Graph/options/pie_chart.php', 'ezcGraphPolynom' => 'Graph/math/polynom.php', 'ezcGraphRadarChart' => 'Graph/charts/radar.php', 'ezcGraphRadarChartOptions' => 'Graph/options/radar_chart.php', 'ezcGraphRadialGradient' => 'Graph/colors/radial_gradient.php', 'ezcGraphRenderer2dOptions' => 'Graph/options/renderer_2d.php', 'ezcGraphRenderer3d' => 'Graph/renderer/3d.php', 'ezcGraphRenderer3dOptions' => 'Graph/options/renderer_3d.php', 'ezcGraphRotation' => 'Graph/math/rotation.php', 'ezcGraphSvgDriver' => 'Graph/driver/svg.php', 'ezcGraphSvgDriverOptions' => 'Graph/options/svg_driver.php', 'ezcGraphSvgFont' => 'Graph/driver/svg_font.php', 'ezcGraphTools' => 'Graph/tools.php', 'ezcGraphTranslation' => 'Graph/math/translation.php', 'ezcGraphVector' => 'Graph/math/vector.php', 'ezcGraphVerboseDriver' => 'Graph/driver/verbose.php', ); ?> glpi-0.84.3+dfsg.1/lib/ezpdf/000077500000000000000000000000001226600447100154775ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/ezpdf/class.ezpdf.php000066400000000000000000001530471226600447100204360ustar00rootroot0000000000000010); // used for storing most of the page configuration parameters var $y; // this is the current vertical positon on the page of the writing point, very important var $ezPages=array(); // keep an array of the ids of the pages, making it easy to go back and add page numbers etc. var $ezPageCount=0; // ------------------------------------------------------------------------------ function Cezpdf($paper='a4',$orientation='portrait'){ // Assuming that people don't want to specify the paper size using the absolute coordinates // allow a couple of options: // orientation can be 'portrait' or 'landscape' // or, to actually set the coordinates, then pass an array in as the first parameter. // the defaults are as shown. // // ------------------------- // 2002-07-24 - Nicola Asuni (info@tecnick.com): // Added new page formats (45 standard ISO paper formats and 4 american common formats) // paper cordinates are calculated in this way: (inches * 72) where 1 inch = 2.54 cm // // Now you may also pass a 2 values array containing the page width and height in centimeters // ------------------------- if (!is_array($paper)){ switch (strtoupper($paper)){ case '4A0': {$size = array(0,0,4767.87,6740.79); break;} case '2A0': {$size = array(0,0,3370.39,4767.87); break;} case 'A0': {$size = array(0,0,2383.94,3370.39); break;} case 'A1': {$size = array(0,0,1683.78,2383.94); break;} case 'A2': {$size = array(0,0,1190.55,1683.78); break;} case 'A3': {$size = array(0,0,841.89,1190.55); break;} case 'A4': default: {$size = array(0,0,595.28,841.89); break;} case 'A5': {$size = array(0,0,419.53,595.28); break;} case 'A6': {$size = array(0,0,297.64,419.53); break;} case 'A7': {$size = array(0,0,209.76,297.64); break;} case 'A8': {$size = array(0,0,147.40,209.76); break;} case 'A9': {$size = array(0,0,104.88,147.40); break;} case 'A10': {$size = array(0,0,73.70,104.88); break;} case 'B0': {$size = array(0,0,2834.65,4008.19); break;} case 'B1': {$size = array(0,0,2004.09,2834.65); break;} case 'B2': {$size = array(0,0,1417.32,2004.09); break;} case 'B3': {$size = array(0,0,1000.63,1417.32); break;} case 'B4': {$size = array(0,0,708.66,1000.63); break;} case 'B5': {$size = array(0,0,498.90,708.66); break;} case 'B6': {$size = array(0,0,354.33,498.90); break;} case 'B7': {$size = array(0,0,249.45,354.33); break;} case 'B8': {$size = array(0,0,175.75,249.45); break;} case 'B9': {$size = array(0,0,124.72,175.75); break;} case 'B10': {$size = array(0,0,87.87,124.72); break;} case 'C0': {$size = array(0,0,2599.37,3676.54); break;} case 'C1': {$size = array(0,0,1836.85,2599.37); break;} case 'C2': {$size = array(0,0,1298.27,1836.85); break;} case 'C3': {$size = array(0,0,918.43,1298.27); break;} case 'C4': {$size = array(0,0,649.13,918.43); break;} case 'C5': {$size = array(0,0,459.21,649.13); break;} case 'C6': {$size = array(0,0,323.15,459.21); break;} case 'C7': {$size = array(0,0,229.61,323.15); break;} case 'C8': {$size = array(0,0,161.57,229.61); break;} case 'C9': {$size = array(0,0,113.39,161.57); break;} case 'C10': {$size = array(0,0,79.37,113.39); break;} case 'RA0': {$size = array(0,0,2437.80,3458.27); break;} case 'RA1': {$size = array(0,0,1729.13,2437.80); break;} case 'RA2': {$size = array(0,0,1218.90,1729.13); break;} case 'RA3': {$size = array(0,0,864.57,1218.90); break;} case 'RA4': {$size = array(0,0,609.45,864.57); break;} case 'SRA0': {$size = array(0,0,2551.18,3628.35); break;} case 'SRA1': {$size = array(0,0,1814.17,2551.18); break;} case 'SRA2': {$size = array(0,0,1275.59,1814.17); break;} case 'SRA3': {$size = array(0,0,907.09,1275.59); break;} case 'SRA4': {$size = array(0,0,637.80,907.09); break;} case 'LETTER': {$size = array(0,0,612.00,792.00); break;} case 'LEGAL': {$size = array(0,0,612.00,1008.00); break;} case 'EXECUTIVE': {$size = array(0,0,521.86,756.00); break;} case 'FOLIO': {$size = array(0,0,612.00,936.00); break;} } switch (strtolower($orientation)){ case 'landscape': $a=$size[3]; $size[3]=$size[2]; $size[2]=$a; break; } } else { if (count($paper)>2) { // then an array was sent it to set the size $size = $paper; } else { //size in centimeters has been passed $size[0] = 0; $size[1] = 0; $size[2] = ( $paper[0] / 2.54 ) * 72; $size[3] = ( $paper[1] / 2.54 ) * 72; } } $this->Cpdf($size); $this->ez['pageWidth']=$size[2]; $this->ez['pageHeight']=$size[3]; // also set the margins to some reasonable defaults $this->ez['topMargin']=30; $this->ez['bottomMargin']=30; $this->ez['leftMargin']=30; $this->ez['rightMargin']=30; // set the current writing position to the top of the first page $this->y = $this->ez['pageHeight']-$this->ez['topMargin']; // and get the ID of the page that was created during the instancing process. $this->ezPages[1]=$this->getFirstPageId(); $this->ezPageCount=1; } // ------------------------------------------------------------------------------ // 2002-07-24: Nicola Asuni (info@tecnick.com) // Set Margins in centimeters function ezSetCmMargins($top,$bottom,$left,$right){ $top = ( $top / 2.54 ) * 72; $bottom = ( $bottom / 2.54 ) * 72; $left = ( $left / 2.54 ) * 72; $right = ( $right / 2.54 ) * 72; $this->ezSetMargins($top,$bottom,$left,$right); } // ------------------------------------------------------------------------------ function ezColumnsStart($options=array()){ // start from the current y-position, make the set number of columne if (isset($this->ez['columns']) && $this->ez['columns']==1){ // if we are already in a column mode then just return. return; } $def=array('gap'=>10,'num'=>2); foreach($def as $k=>$v){ if (!isset($options[$k])){ $options[$k]=$v; } } // setup the columns $this->ez['columns']=array('on'=>1,'colNum'=>1); // store the current margins $this->ez['columns']['margins']=array( $this->ez['leftMargin'] ,$this->ez['rightMargin'] ,$this->ez['topMargin'] ,$this->ez['bottomMargin'] ); // and store the settings for the columns $this->ez['columns']['options']=$options; // then reset the margins to suit the new columns // safe enough to assume the first column here, but start from the current y-position $this->ez['topMargin']=$this->ez['pageHeight']-$this->y; $width=($this->ez['pageWidth']-$this->ez['leftMargin']-$this->ez['rightMargin']-($options['num']-1)*$options['gap'])/$options['num']; $this->ez['columns']['width']=$width; $this->ez['rightMargin']=$this->ez['pageWidth']-$this->ez['leftMargin']-$width; } // ------------------------------------------------------------------------------ function ezColumnsStop(){ if (isset($this->ez['columns']) && $this->ez['columns']['on']==1){ $this->ez['columns']['on']=0; $this->ez['leftMargin']=$this->ez['columns']['margins'][0]; $this->ez['rightMargin']=$this->ez['columns']['margins'][1]; $this->ez['topMargin']=$this->ez['columns']['margins'][2]; $this->ez['bottomMargin']=$this->ez['columns']['margins'][3]; } } // ------------------------------------------------------------------------------ function ezInsertMode($status=1,$pageNum=1,$pos='before'){ // puts the document into insert mode. new pages are inserted until this is re-called with status=0 // by default pages wil be inserted at the start of the document switch($status){ case '1': if (isset($this->ezPages[$pageNum])){ $this->ez['insertMode']=1; $this->ez['insertOptions']=array('id'=>$this->ezPages[$pageNum],'pos'=>$pos); } break; case '0': $this->ez['insertMode']=0; break; } } // ------------------------------------------------------------------------------ function ezNewPage(){ $pageRequired=1; if (isset($this->ez['columns']) && $this->ez['columns']['on']==1){ // check if this is just going to a new column // increment the column number //echo 'HERE
    '; $this->ez['columns']['colNum']++; //echo $this->ez['columns']['colNum'].'
    '; if ($this->ez['columns']['colNum'] <= $this->ez['columns']['options']['num']){ // then just reset to the top of the next column $pageRequired=0; } else { $this->ez['columns']['colNum']=1; $this->ez['topMargin']=$this->ez['columns']['margins'][2]; } $width = $this->ez['columns']['width']; $this->ez['leftMargin']=$this->ez['columns']['margins'][0]+($this->ez['columns']['colNum']-1)*($this->ez['columns']['options']['gap']+$width); $this->ez['rightMargin']=$this->ez['pageWidth']-$this->ez['leftMargin']-$width; } //echo 'left='.$this->ez['leftMargin'].' right='.$this->ez['rightMargin'].'
    '; if ($pageRequired){ // make a new page, setting the writing point back to the top $this->y = $this->ez['pageHeight']-$this->ez['topMargin']; // make the new page with a call to the basic class. $this->ezPageCount++; if (isset($this->ez['insertMode']) && $this->ez['insertMode']==1){ $id = $this->ezPages[$this->ezPageCount] = $this->newPage(1,$this->ez['insertOptions']['id'],$this->ez['insertOptions']['pos']); // then manipulate the insert options so that inserted pages follow each other $this->ez['insertOptions']['id']=$id; $this->ez['insertOptions']['pos']='after'; } else { $this->ezPages[$this->ezPageCount] = $this->newPage(); } } else { $this->y = $this->ez['pageHeight']-$this->ez['topMargin']; } } // ------------------------------------------------------------------------------ function ezSetMargins($top,$bottom,$left,$right){ // sets the margins to new values $this->ez['topMargin']=$top; $this->ez['bottomMargin']=$bottom; $this->ez['leftMargin']=$left; $this->ez['rightMargin']=$right; // check to see if this means that the current writing position is outside the // writable area if ($this->y > $this->ez['pageHeight']-$top){ // then move y down $this->y = $this->ez['pageHeight']-$top; } if ( $this->y < $bottom){ // then make a new page $this->ezNewPage(); } } // ------------------------------------------------------------------------------ function ezGetCurrentPageNumber(){ // return the strict numbering (1,2,3,4..) number of the current page return $this->ezPageCount; } // ------------------------------------------------------------------------------ function ezStartPageNumbers($x,$y,$size,$pos='left',$pattern='{PAGENUM} of {TOTALPAGENUM}',$num=''){ // put page numbers on the pages from here. // place then on the 'pos' side of the coordinates (x,y). // pos can be 'left' or 'right' // use the given 'pattern' for display, where (PAGENUM} and {TOTALPAGENUM} are replaced // as required. // if $num is set, then make the first page this number, the number of total pages will // be adjusted to account for this. // Adjust this function so that each time you 'start' page numbers then you effectively start a different batch // return the number of the batch, so that they can be stopped in a different order if required. if (!$pos || !strlen($pos)){ $pos='left'; } if (!$pattern || !strlen($pattern)){ $pattern='{PAGENUM} of {TOTALPAGENUM}'; } if (!isset($this->ez['pageNumbering'])){ $this->ez['pageNumbering']=array(); } $i = count($this->ez['pageNumbering']); $this->ez['pageNumbering'][$i][$this->ezPageCount]=array('x'=>$x,'y'=>$y,'pos'=>$pos,'pattern'=>$pattern,'num'=>$num,'size'=>$size); return $i; } // ------------------------------------------------------------------------------ function ezWhatPageNumber($pageNum,$i=0){ // given a particular generic page number (ie, document numbered sequentially from beginning), // return the page number under a particular page numbering scheme ($i) $num=0; $start=1; $startNum=1; if (!isset($this->ez['pageNumbering'])) { $this->addMessage('WARNING: page numbering called for and wasn\'t started with ezStartPageNumbers'); return 0; } foreach($this->ez['pageNumbering'][$i] as $k=>$v){ if ($k<=$pageNum){ if (is_array($v)){ // start block if (strlen($v['num'])){ // a start was specified $start=$v['num']; $startNum=$k; $num=$pageNum-$startNum+$start; } } else { // stop block $num=0; } } } return $num; } // ------------------------------------------------------------------------------ function ezStopPageNumbers($stopTotal=0,$next=0,$i=0){ // if stopTotal=1 then the totalling of pages for this number will stop too // if $next=1, then do this page, but not the next, else do not do this page either // if $i is set, then stop that particular pagenumbering sequence. if (!isset($this->ez['pageNumbering'])){ $this->ez['pageNumbering']=array(); } if ($next && isset($this->ez['pageNumbering'][$i][$this->ezPageCount]) && is_array($this->ez['pageNumbering'][$i][$this->ezPageCount])){ // then this has only just been started, this will over-write the start, and nothing will appear // add a special command to the start block, telling it to stop as well if ($stopTotal){ $this->ez['pageNumbering'][$i][$this->ezPageCount]['stoptn']=1; } else { $this->ez['pageNumbering'][$i][$this->ezPageCount]['stopn']=1; } } else { if ($stopTotal){ $this->ez['pageNumbering'][$i][$this->ezPageCount]='stopt'; } else { $this->ez['pageNumbering'][$i][$this->ezPageCount]='stop'; } if ($next){ $this->ez['pageNumbering'][$i][$this->ezPageCount].='n'; } } } // ------------------------------------------------------------------------------ function ezPRVTpageNumberSearch($lbl,&$tmp){ foreach($tmp as $i=>$v){ if (is_array($v)){ if (isset($v[$lbl])){ return $i; } } else { if ($v==$lbl){ return $i; } } } return 0; } // ------------------------------------------------------------------------------ function ezPRVTaddPageNumbers(){ // this will go through the pageNumbering array and add the page numbers are required if (isset($this->ez['pageNumbering'])){ $totalPages1 = $this->ezPageCount; $tmp1=$this->ez['pageNumbering']; $status=0; foreach($tmp1 as $i=>$tmp){ // do each of the page numbering systems // firstly, find the total pages for this one $k = $this->ezPRVTpageNumberSearch('stopt',$tmp); if ($k && $k>0){ $totalPages = $k-1; } else { $l = $this->ezPRVTpageNumberSearch('stoptn',$tmp); if ($l && $l>0){ $totalPages = $l; } else { $totalPages = $totalPages1; } } foreach ($this->ezPages as $pageNum=>$id){ if (isset($tmp[$pageNum])){ if (is_array($tmp[$pageNum])){ // then this must be starting page numbers $status=1; $info = $tmp[$pageNum]; $info['dnum']=$info['num']-$pageNum; // also check for the special case of the numbering stopping and starting on the same page if (isset($info['stopn']) || isset($info['stoptn']) ){ $status=2; } } else if ($tmp[$pageNum]=='stop' || $tmp[$pageNum]=='stopt'){ // then we are stopping page numbers $status=0; } else if ($status==1 && ($tmp[$pageNum]=='stoptn' || $tmp[$pageNum]=='stopn')){ // then we are stopping page numbers $status=2; } } if ($status){ // then add the page numbering to this page if (strlen($info['num'])){ $num=$pageNum+$info['dnum']; } else { $num=$pageNum; } $total = $totalPages+$num-$pageNum; $pat = str_replace('{PAGENUM}',$num,$info['pattern']); $pat = str_replace('{TOTALPAGENUM}',$total,$pat); $this->reopenObject($id); switch($info['pos']){ case 'right': $this->addText($info['x'],$info['y'],$info['size'],$pat); break; default: $w=$this->getTextWidth($info['size'],$pat); $this->addText($info['x']-$w,$info['y'],$info['size'],$pat); break; } $this->closeObject(); } if ($status==2){ $status=0; } } } } } // ------------------------------------------------------------------------------ function ezPRVTcleanUp(){ $this->ezPRVTaddPageNumbers(); } // ------------------------------------------------------------------------------ function ezStream($options=''){ $this->ezPRVTcleanUp(); $this->stream($options); } // ------------------------------------------------------------------------------ function ezOutput($options=0){ $this->ezPRVTcleanUp(); return $this->output($options); } // ------------------------------------------------------------------------------ function ezSetY($y){ // used to change the vertical position of the writing point. $this->y = $y; if ( $this->y < $this->ez['bottomMargin']){ // then make a new page $this->ezNewPage(); } } // ------------------------------------------------------------------------------ function ezSetDy($dy,$mod=''){ // used to change the vertical position of the writing point. // changes up by a positive increment, so enter a negative number to go // down the page // if $mod is set to 'makeSpace' and a new page is forced, then the pointed will be moved // down on the new page, this will allow space to be reserved for graphics etc. $this->y += $dy; if ( $this->y < $this->ez['bottomMargin']){ // then make a new page $this->ezNewPage(); if ($mod=='makeSpace'){ $this->y += $dy; } } } // ------------------------------------------------------------------------------ function ezPrvtTableDrawLines($pos,$gap,$x0,$x1,$y0,$y1,$y2,$col,$inner,$outer,$opt=1){ $x0=1000; $x1=0; $this->setStrokeColor($col[0],$col[1],$col[2]); $cnt=0; $n = count($pos); foreach($pos as $x){ $cnt++; if ($cnt==1 || $cnt==$n){ $this->setLineStyle($outer); } else { $this->setLineStyle($inner); } $this->line($x-$gap/2,$y0,$x-$gap/2,$y2); if ($x>$x1){ $x1=$x; }; if ($x<$x0){ $x0=$x; }; } $this->setLineStyle($outer); $this->line($x0-$gap/2-$outer/2,$y0,$x1-$gap/2+$outer/2,$y0); // only do the second line if it is different to the first, AND each row does not have // a line on it. if ($y0!=$y1 && $opt<2){ $this->line($x0-$gap/2,$y1,$x1-$gap/2,$y1); } $this->line($x0-$gap/2-$outer/2,$y2,$x1-$gap/2+$outer/2,$y2); } // ------------------------------------------------------------------------------ function ezPrvtTableColumnHeadings($cols,$pos,$maxWidth,$height,$decender,$gap,$size,&$y,$optionsAll=array()){ // uses ezText to add the text, and returns the height taken by the largest heading // this page will move the headings to a new page if they will not fit completely on this one // transaction support will be used to implement this if (isset($optionsAll['cols'])){ $options = $optionsAll['cols']; } else { $options = array(); } $mx=0; $startPage = $this->ezPageCount; $secondGo=0; // $y is the position at which the top of the table should start, so the base // of the first text, is $y-$height-$gap-$decender, but ezText starts by dropping $height // the return from this function is the total cell height, including gaps, and $y is adjusted // to be the postion of the bottom line // begin the transaction $this->transaction('start'); $ok=0; // $y-=$gap-$decender; $y-=$gap; while ($ok==0){ foreach($cols as $colName=>$colHeading){ $this->ezSetY($y); if (isset($options[$colName]) && isset($options[$colName]['justification'])){ $justification = $options[$colName]['justification']; } else { $justification = 'left'; } $this->ezText($colHeading,$size,array('aleft'=> $pos[$colName],'aright'=>($maxWidth[$colName]+$pos[$colName]),'justification'=>$justification)); $dy = $y-$this->y; if ($dy>$mx){ $mx=$dy; } } $y = $y - $mx - $gap + $decender; // $y -= $mx-$gap+$decender; // now, if this has moved to a new page, then abort the transaction, move to a new page, and put it there // do not check on the second time around, to avoid an infinite loop if ($this->ezPageCount != $startPage && $secondGo==0){ $this->transaction('rewind'); $this->ezNewPage(); $y = $this->y - $gap-$decender; $ok=0; $secondGo=1; // $y = $store_y; $mx=0; } else { $this->transaction('commit'); $ok=1; } } return $mx+$gap*2-$decender; } // ------------------------------------------------------------------------------ function ezPrvtGetTextWidth($size,$text){ // will calculate the maximum width, taking into account that the text may be broken // by line breaks. $mx=0; $lines = explode("\n",$text); foreach ($lines as $line){ $w = $this->getTextWidth($size,$line); if ($w>$mx){ $mx=$w; } } return $mx; } // ------------------------------------------------------------------------------ function ezTable(&$data,$cols='',$title='',$options=''){ // add a table of information to the pdf document // $data is a two dimensional array // $cols (optional) is an associative array, the keys are the names of the columns from $data // to be presented (and in that order), the values are the titles to be given to the columns // $title (optional) is the title to be put on the top of the table // // $options is an associative array which can contain: // 'showLines'=> 0,1,2, default is 1 (show outside and top lines only), 2=> lines on each row // 'showHeadings' => 0 or 1 // 'shaded'=> 0,1,2,3 default is 1 (1->alternate lines are shaded, 0->no shading, 2-> both shaded, second uses shadeCol2) // 'shadeCol' => (r,g,b) array, defining the colour of the shading, default is (0.8,0.8,0.8) // 'shadeCol2' => (r,g,b) array, defining the colour of the shading of the other blocks, default is (0.7,0.7,0.7) // 'fontSize' => 10 // 'textCol' => (r,g,b) array, text colour // 'titleFontSize' => 12 // 'rowGap' => 2 , the space added at the top and bottom of each row, between the text and the lines // 'colGap' => 5 , the space on the left and right sides of each cell // 'lineCol' => (r,g,b) array, defining the colour of the lines, default, black. // 'xPos' => 'left','right','center','centre',or coordinate, reference coordinate in the x-direction // 'xOrientation' => 'left','right','center','centre', position of the table w.r.t 'xPos' // 'width'=> which will specify the width of the table, if it turns out to not be this // wide, then it will stretch the table to fit, if it is wider then each cell will be made // proportionalty smaller, and the content may have to wrap. // 'maxWidth'=> similar to 'width', but will only make table smaller than it wants to be // 'options' => array(=>array('justification'=>'left','width'=>100,'link'=>linkDataName),=>....) // allow the setting of other paramaters for the individual columns // 'minRowSpace'=> the minimum space between the bottom of each row and the bottom margin, in which a new row will be started // if it is less, then a new page would be started, default=-100 // 'innerLineThickness'=>1 // 'outerLineThickness'=>1 // 'splitRows'=>0, 0 or 1, whether or not to allow the rows to be split across page boundaries // 'protectRows'=>number, the number of rows to hold with the heading on page, ie, if there less than this number of // rows on the page, then move the whole lot onto the next page, default=1 // // note that the user will have had to make a font selection already or this will not // produce a valid pdf file. if (!is_array($data)){ return; } if (!is_array($cols)){ // take the columns from the first row of the data set reset($data); list($k,$v)=each($data); if (!is_array($v)){ return; } $cols=array(); foreach($v as $k1=>$v1){ $cols[$k1]=$k1; } } if (!is_array($options)){ $options=array(); } $defaults = array( 'shaded'=>1,'showLines'=>1,'shadeCol'=>array(0.8,0.8,0.8),'shadeCol2'=>array(0.7,0.7,0.7),'fontSize'=>10,'titleFontSize'=>12 ,'titleGap'=>5,'lineCol'=>array(0,0,0),'gap'=>5,'xPos'=>'centre','xOrientation'=>'centre' ,'showHeadings'=>1,'textCol'=>array(0,0,0),'width'=>0,'maxWidth'=>0,'cols'=>array(),'minRowSpace'=>-100,'rowGap'=>2,'colGap'=>5 ,'innerLineThickness'=>1,'outerLineThickness'=>1,'splitRows'=>0,'protectRows'=>1 ); foreach($defaults as $key=>$value){ if (is_array($value)){ if (!isset($options[$key]) || !is_array($options[$key])){ $options[$key]=$value; } } else { if (!isset($options[$key])){ $options[$key]=$value; } } } $options['gap']=2*$options['colGap']; $middle = ($this->ez['pageWidth']-$this->ez['rightMargin'])/2+($this->ez['leftMargin'])/2; // figure out the maximum widths of the text within each column $maxWidth=array(); foreach($cols as $colName=>$colHeading){ $maxWidth[$colName]=0; } // find the maximum cell widths based on the data foreach($data as $row){ foreach($cols as $colName=>$colHeading){ $w = $this->ezPrvtGetTextWidth($options['fontSize'],(string)$row[$colName])*1.01; if ($w > $maxWidth[$colName]){ $maxWidth[$colName]=$w; } } } // and the maximum widths to fit in the headings foreach($cols as $colName=>$colTitle){ $w = $this->ezPrvtGetTextWidth($options['fontSize'],(string)$colTitle)*1.01; if ($w > $maxWidth[$colName]){ $maxWidth[$colName]=$w; } } // calculate the start positions of each of the columns $pos=array(); $x=0; $t=$x; $adjustmentWidth=0; $setWidth=0; foreach($maxWidth as $colName => $w){ $pos[$colName]=$t; // if the column width has been specified then set that here, also total the // width avaliable for adjustment if (isset($options['cols'][$colName]) && isset($options['cols'][$colName]['width']) && $options['cols'][$colName]['width']>0){ $t=$t+$options['cols'][$colName]['width']; $maxWidth[$colName] = $options['cols'][$colName]['width']-$options['gap']; $setWidth += $options['cols'][$colName]['width']; } else { $t=$t+$w+$options['gap']; $adjustmentWidth += $w; $setWidth += $options['gap']; } } $pos['_end_']=$t; // if maxWidth is specified, and the table is too wide, and the width has not been set, // then set the width. if ($options['width']==0 && $options['maxWidth'] && ($t-$x)>$options['maxWidth']){ // then need to make this one smaller $options['width']=$options['maxWidth']; } if ($options['width'] && $adjustmentWidth>0 && $setWidth<$options['width']){ // first find the current widths of the columns involved in this mystery $cols0 = array(); $cols1 = array(); $xq=0; $presentWidth=0; $last=''; foreach($pos as $colName=>$p){ if (!isset($options['cols'][$last]) || !isset($options['cols'][$last]['width']) || $options['cols'][$last]['width']<=0){ if (strlen($last)){ $cols0[$last]=$p-$xq -$options['gap']; $presentWidth += ($p-$xq - $options['gap']); } } else { $cols1[$last]=$p-$xq; } $last=$colName; $xq=$p; } // $cols0 contains the widths of all the columns which are not set $neededWidth = $options['width']-$setWidth; // if needed width is negative then add it equally to each column, else get more tricky if ($presentWidth<$neededWidth){ foreach($cols0 as $colName=>$w){ $cols0[$colName]+= ($neededWidth-$presentWidth)/count($cols0); } } else { $cnt=0; while ($presentWidth>$neededWidth && $cnt<100){ $cnt++; // insurance policy // find the widest columns, and the next to widest width $aWidest = array(); $nWidest=0; $widest=0; foreach($cols0 as $colName=>$w){ if ($w>$widest){ $aWidest=array($colName); $nWidest = $widest; $widest=$w; } else if ($w==$widest){ $aWidest[]=$colName; } else if ($w > $nWidest) { /// GLPI FIX : set nWidest if not set $nWidest = $w; } } // then figure out what the width of the widest columns would have to be to take up all the slack $newWidestWidth = $widest - ($presentWidth-$neededWidth)/count($aWidest); if ($newWidestWidth > $nWidest){ // then there is space to set them to this foreach($aWidest as $colName){ $cols0[$colName] = $newWidestWidth; } $presentWidth=$neededWidth; } else { // there is not space, reduce the size of the widest ones down to the next size down, and we // will go round again foreach($aWidest as $colName){ $cols0[$colName] = $nWidest; } $presentWidth=$presentWidth-($widest-$nWidest)*count($aWidest); } } } // $cols0 now contains the new widths of the constrained columns. // now need to update the $pos and $maxWidth arrays $xq=0; foreach($pos as $colName=>$p){ $pos[$colName]=$xq; if (!isset($options['cols'][$colName]) || !isset($options['cols'][$colName]['width']) || $options['cols'][$colName]['width']<=0){ if (isset($cols0[$colName])){ $xq += $cols0[$colName] + $options['gap']; $maxWidth[$colName]=$cols0[$colName]; } } else { if (isset($cols1[$colName])){ $xq += $cols1[$colName]; } } } $t=$x+$options['width']; $pos['_end_']=$t; } // now adjust the table to the correct location across the page switch ($options['xPos']){ case 'left': $xref = $this->ez['leftMargin']; break; case 'right': $xref = $this->ez['pageWidth'] - $this->ez['rightMargin']; break; case 'centre': case 'center': $xref = $middle; break; default: $xref = $options['xPos']; break; } switch ($options['xOrientation']){ case 'left': $dx = $xref-$t; break; case 'right': $dx = $xref; break; case 'centre': case 'center': $dx = $xref-$t/2; break; } foreach($pos as $k=>$v){ $pos[$k]=$v+$dx; } $x0=$x+$dx; $x1=$t+$dx; $baseLeftMargin = $this->ez['leftMargin']; $basePos = $pos; $baseX0 = $x0; $baseX1 = $x1; // ok, just about ready to make me a table $this->setColor($options['textCol'][0],$options['textCol'][1],$options['textCol'][2]); $this->setStrokeColor($options['shadeCol'][0],$options['shadeCol'][1],$options['shadeCol'][2]); $middle = ($x1+$x0)/2; // start a transaction which will be used to regress the table, if there are not enough rows protected if ($options['protectRows']>0){ $this->transaction('start'); $movedOnce=0; } $abortTable = 1; while ($abortTable){ $abortTable=0; $dm = $this->ez['leftMargin']-$baseLeftMargin; foreach($basePos as $k=>$v){ $pos[$k]=$v+$dm; } $x0=$baseX0+$dm; $x1=$baseX1+$dm; $middle = ($x1+$x0)/2; // if the title is set, then do that if (strlen($title)){ $w = $this->getTextWidth($options['titleFontSize'],$title); $this->y -= $this->getFontHeight($options['titleFontSize']); if ($this->y < $this->ez['bottomMargin']){ $this->ezNewPage(); // margins may have changed on the newpage $dm = $this->ez['leftMargin']-$baseLeftMargin; foreach($basePos as $k=>$v){ $pos[$k]=$v+$dm; } $x0=$baseX0+$dm; $x1=$baseX1+$dm; $middle = ($x1+$x0)/2; $this->y -= $this->getFontHeight($options['titleFontSize']); } $this->addText($middle-$w/2,$this->y,$options['titleFontSize'],$title); $this->y -= $options['titleGap']; } // margins may have changed on the newpage $dm = $this->ez['leftMargin']-$baseLeftMargin; foreach($basePos as $k=>$v){ $pos[$k]=$v+$dm; } $x0=$baseX0+$dm; $x1=$baseX1+$dm; $y=$this->y; // to simplify the code a bit // make the table $height = $this->getFontHeight($options['fontSize']); $decender = $this->getFontDecender($options['fontSize']); $y0=$y+$decender; $dy=0; if ($options['showHeadings']){ // this function will move the start of the table to a new page if it does not fit on this one $headingHeight = $this->ezPrvtTableColumnHeadings($cols,$pos,$maxWidth,$height,$decender,$options['rowGap'],$options['fontSize'],$y,$options); $y0 = $y+$headingHeight; $y1 = $y; $dm = $this->ez['leftMargin']-$baseLeftMargin; foreach($basePos as $k=>$v){ $pos[$k]=$v+$dm; } $x0=$baseX0+$dm; $x1=$baseX1+$dm; } else { $y1 = $y0; } $firstLine=1; // open an object here so that the text can be put in over the shading if ($options['shaded']){ $this->saveState(); $textObjectId = $this->openObject(); $this->closeObject(); $this->addObject($textObjectId); $this->reopenObject($textObjectId); } $cnt=0; $newPage=0; foreach($data as $row){ $cnt++; // the transaction support will be used to prevent rows being split if ($options['splitRows']==0){ $pageStart = $this->ezPageCount; if (isset($this->ez['columns']) && $this->ez['columns']['on']==1){ $columnStart = $this->ez['columns']['colNum']; } $this->transaction('start'); $row_orig = $row; $y_orig = $y; $y0_orig = $y0; $y1_orig = $y1; } $ok=0; $secondTurn=0; while(!$abortTable && $ok == 0){ $mx=0; $newRow=1; while(!$abortTable && ($newPage || $newRow)){ $y-=$height; if ($newPage || $y<$this->ez['bottomMargin'] || (isset($options['minRowSpace']) && $y<($this->ez['bottomMargin']+$options['minRowSpace'])) ){ // check that enough rows are with the heading if ($options['protectRows']>0 && $movedOnce==0 && $cnt<=$options['protectRows']){ // then we need to move the whole table onto the next page $movedOnce = 1; $abortTable = 1; } $y2=$y-$mx+2*$height+$decender-$newRow*$height; if ($options['showLines']){ if (!$options['showHeadings']){ $y0=$y1; } $this->ezPrvtTableDrawLines($pos,$options['gap'],$x0,$x1,$y0,$y1,$y2,$options['lineCol'],$options['innerLineThickness'],$options['outerLineThickness'],$options['showLines']); } if ($options['shaded']){ $this->closeObject(); $this->restoreState(); } $this->ezNewPage(); // and the margins may have changed, this is due to the possibility of the columns being turned on // as the columns are managed by manipulating the margins $dm = $this->ez['leftMargin']-$baseLeftMargin; foreach($basePos as $k=>$v){ $pos[$k]=$v+$dm; } // $x0=$x0+$dm; // $x1=$x1+$dm; $x0=$baseX0+$dm; $x1=$baseX1+$dm; if ($options['shaded']){ $this->saveState(); $textObjectId = $this->openObject(); $this->closeObject(); $this->addObject($textObjectId); $this->reopenObject($textObjectId); } $this->setColor($options['textCol'][0],$options['textCol'][1],$options['textCol'][2],1); $y = $this->ez['pageHeight']-$this->ez['topMargin']; $y0=$y+$decender; $mx=0; if ($options['showHeadings']){ $this->ezPrvtTableColumnHeadings($cols,$pos,$maxWidth,$height,$decender,$options['rowGap'],$options['fontSize'],$y,$options); $y1=$y; } else { $y1=$y0; } $firstLine=1; $y -= $height; } $newRow=0; // write the actual data // if these cells need to be split over a page, then $newPage will be set, and the remaining // text will be placed in $leftOvers $newPage=0; $leftOvers=array(); foreach($cols as $colName=>$colTitle){ $this->ezSetY($y+$height); $colNewPage=0; if (isset($row[$colName])){ if (isset($options['cols'][$colName]) && isset($options['cols'][$colName]['link']) && strlen($options['cols'][$colName]['link'])){ $lines = explode("\n",$row[$colName]); if (isset($row[$options['cols'][$colName]['link']]) && strlen($row[$options['cols'][$colName]['link']])){ foreach($lines as $k=>$v){ $lines[$k]=''.$v.''; } } } else { $lines = explode("\n",$row[$colName]); } } else { $lines = array(); } $this->y -= $options['rowGap']; foreach ($lines as $line){ $line = $this->ezProcessText($line); $start=1; while (strlen($line) || $start){ $start=0; if (!$colNewPage){ $this->y=$this->y-$height; } if ($this->y < $this->ez['bottomMargin']){ // $this->ezNewPage(); $newPage=1; // whether a new page is required for any of the columns $colNewPage=1; // whether a new page is required for this column } if ($colNewPage){ if (isset($leftOvers[$colName])){ $leftOvers[$colName].="\n".$line; } else { $leftOvers[$colName] = $line; } $line=''; } else { if (isset($options['cols'][$colName]) && isset($options['cols'][$colName]['justification']) ){ $just = $options['cols'][$colName]['justification']; } else { $just='left'; } $line=$this->addTextWrap($pos[$colName],$this->y,$maxWidth[$colName],$options['fontSize'],$line,$just); } } } $dy=$y+$height-$this->y+$options['rowGap']; if ($dy-$height*$newPage>$mx){ $mx=$dy-$height*$newPage; } } // set $row to $leftOvers so that they will be processed onto the new page $row = $leftOvers; // now add the shading underneath if ($options['shaded'] && $cnt%2==0){ $this->closeObject(); $this->setColor($options['shadeCol'][0],$options['shadeCol'][1],$options['shadeCol'][2],1); $this->filledRectangle($x0-$options['gap']/2,$y+$decender+$height-$mx,$x1-$x0,$mx); $this->reopenObject($textObjectId); } if ($options['shaded']==2 && $cnt%2==1){ $this->closeObject(); $this->setColor($options['shadeCol2'][0],$options['shadeCol2'][1],$options['shadeCol2'][2],1); $this->filledRectangle($x0-$options['gap']/2,$y+$decender+$height-$mx,$x1-$x0,$mx); $this->reopenObject($textObjectId); } if ($options['showLines']>1){ // then draw a line on the top of each block // $this->closeObject(); $this->saveState(); $this->setStrokeColor($options['lineCol'][0],$options['lineCol'][1],$options['lineCol'][2],1); // $this->line($x0-$options['gap']/2,$y+$decender+$height-$mx,$x1-$x0,$mx); if ($firstLine){ $this->setLineStyle($options['outerLineThickness']); $firstLine=0; } else { $this->setLineStyle($options['innerLineThickness']); } $this->line($x0-$options['gap']/2,$y+$decender+$height,$x1-$options['gap']/2,$y+$decender+$height); $this->restoreState(); // $this->reopenObject($textObjectId); } } // end of while $y=$y-$mx+$height; // checking row split over pages if ($options['splitRows']==0){ if ( ( ($this->ezPageCount != $pageStart) || (isset($this->ez['columns']) && $this->ez['columns']['on']==1 && $columnStart != $this->ez['columns']['colNum'] )) && $secondTurn==0){ // then we need to go back and try that again ! $newPage=1; $secondTurn=1; $this->transaction('rewind'); $row = $row_orig; $y = $y_orig; $y0 = $y0_orig; $y1 = $y1_orig; $ok=0; $dm = $this->ez['leftMargin']-$baseLeftMargin; foreach($basePos as $k=>$v){ $pos[$k]=$v+$dm; } $x0=$baseX0+$dm; $x1=$baseX1+$dm; } else { $this->transaction('commit'); $ok=1; } } else { $ok=1; // don't go round the loop if splitting rows is allowed } } // end of while to check for row splitting if ($abortTable){ if ($ok==0){ $this->transaction('abort'); } // only the outer transaction should be operational $this->transaction('rewind'); $this->ezNewPage(); break; } } // end of foreach ($data as $row) } // end of while ($abortTable) // table has been put on the page, the rows guarded as required, commit. $this->transaction('commit'); $y2=$y+$decender; if ($options['showLines']){ if (!$options['showHeadings']){ $y0=$y1; } $this->ezPrvtTableDrawLines($pos,$options['gap'],$x0,$x1,$y0,$y1,$y2,$options['lineCol'],$options['innerLineThickness'],$options['outerLineThickness'],$options['showLines']); } // close the object for drawing the text on top if ($options['shaded']){ $this->closeObject(); $this->restoreState(); } $this->y=$y; return $y; } // ------------------------------------------------------------------------------ function ezProcessText($text){ // this function will intially be used to implement underlining support, but could be used for a range of other // purposes $search = array('','','',''); $replace = array('','','',''); return str_replace($search,$replace,$text); } // ------------------------------------------------------------------------------ function ezText($text,$size=0,$options=array(),$test=0){ // this will add a string of text to the document, starting at the current drawing // position. // it will wrap to keep within the margins, including optional offsets from the left // and the right, if $size is not specified, then it will be the last one used, or // the default value (12 I think). // the text will go to the start of the next line when a return code "\n" is found. // possible options are: // 'left'=> number, gap to leave from the left margin // 'right'=> number, gap to leave from the right margin // 'aleft'=> number, absolute left position (overrides 'left') // 'aright'=> number, absolute right position (overrides 'right') // 'justification' => 'left','right','center','centre','full' // only set one of the next two items (leading overrides spacing) // 'leading' => number, defines the total height taken by the line, independent of the font height. // 'spacing' => a real number, though usually set to one of 1, 1.5, 2 (line spacing as used in word processing) // if $test is set then this should just check if the text is going to flow onto a new page or not, returning true or false // apply the filtering which will make the underlining function. $text = $this->ezProcessText($text); $newPage=false; $store_y = $this->y; if (is_array($options) && isset($options['aleft'])){ $left=$options['aleft']; } else { $left = $this->ez['leftMargin'] + ((is_array($options) && isset($options['left']))?$options['left']:0); } if (is_array($options) && isset($options['aright'])){ $right=$options['aright']; } else { $right = $this->ez['pageWidth'] - $this->ez['rightMargin'] - ((is_array($options) && isset($options['right']))?$options['right']:0); } if ($size<=0){ $size = $this->ez['fontSize']; } else { $this->ez['fontSize']=$size; } if (is_array($options) && isset($options['justification'])){ $just = $options['justification']; } else { $just = 'left'; } // modifications to give leading and spacing based on those given by Craig Heydenburg 1/1/02 if (is_array($options) && isset($options['leading'])) { ## use leading instead of spacing $height = $options['leading']; } else if (is_array($options) && isset($options['spacing'])) { $height = $this->getFontHeight($size) * $options['spacing']; } else { $height = $this->getFontHeight($size); } $lines = explode("\n",$text); foreach ($lines as $line){ $start=1; while (strlen($line) || $start){ $start=0; $this->y=$this->y-$height; if ($this->y < $this->ez['bottomMargin']){ if ($test){ $newPage=true; } else { $this->ezNewPage(); // and then re-calc the left and right, in case they have changed due to columns } } if (is_array($options) && isset($options['aleft'])){ $left=$options['aleft']; } else { $left = $this->ez['leftMargin'] + ((is_array($options) && isset($options['left']))?$options['left']:0); } if (is_array($options) && isset($options['aright'])){ $right=$options['aright']; } else { $right = $this->ez['pageWidth'] - $this->ez['rightMargin'] - ((is_array($options) && isset($options['right']))?$options['right']:0); } $line=$this->addTextWrap($left,$this->y,$right-$left,$size,$line,$just,0,$test); } } if ($test){ $this->y=$store_y; return $newPage; } else { return $this->y; } } // ------------------------------------------------------------------------------ function ezImage($image,$pad = 5,$width = 0,$resize = 'full',$just = 'center',$border = ''){ //beta ezimage function if (stristr($image,'://'))//copy to temp file { $fp = @fopen($image,"rb"); while(!feof($fp)) { $cont.= fread($fp,1024); } fclose($fp); $image = tempnam ("/tmp", "php-pdf"); $fp2 = @fopen($image,"w"); fwrite($fp2,$cont); fclose($fp2); $temp = true; } if (!(file_exists($image))) return false; //return immediately if image file does not exist $imageInfo = getimagesize($image); switch ($imageInfo[2]){ case 2: $type = "jpeg"; break; case 3: $type = "png"; break; default: return false; //return if file is not jpg or png } if ($width == 0) $width = $imageInfo[0]; //set width $ratio = $imageInfo[0]/$imageInfo[1]; //get maximum width of image if (isset($this->ez['columns']) && $this->ez['columns']['on'] == 1) { $bigwidth = $this->ez['columns']['width'] - ($pad * 2); } else { $bigwidth = $this->ez['pageWidth'] - ($pad * 2); } //fix width if larger than maximum or if $resize=full if ($resize == 'full' || $resize == 'width' || $width > $bigwidth) { $width = $bigwidth; } $height = ($width/$ratio); //set height //fix size if runs off page if ($height > ($this->y - $this->ez['bottomMargin'] - ($pad * 2))) { if ($resize != 'full') { $this->ezNewPage(); } else { $height = ($this->y - $this->ez['bottomMargin'] - ($pad * 2)); //shrink height $width = ($height*$ratio); //fix width } } //fix x-offset if image smaller than bigwidth if ($width < $bigwidth) { //center if justification=center if ($just == 'center') { $offset = ($bigwidth - $width) / 2; } //move to right if justification=right if ($just == 'right') { $offset = ($bigwidth - $width); } //leave at left if justification=left if ($just == 'left') { $offset = 0; } } //call appropriate function if ($type == "jpeg"){ $this->addJpegFromFile($image,$this->ez['leftMargin'] + $pad + $offset, $this->y + $this->getFontHeight($this->ez['fontSize']) - $pad - $height,$width); } if ($type == "png"){ $this->addPngFromFile($image,$this->ez['leftMargin'] + $pad + $offset, $this->y + $this->getFontHeight($this->ez['fontSize']) - $pad - $height,$width); } //draw border if ($border != '') { if (!(isset($border['color']))) { $border['color']['red'] = .5; $border['color']['blue'] = .5; $border['color']['green'] = .5; } if (!(isset($border['width']))) $border['width'] = 1; if (!(isset($border['cap']))) $border['cap'] = 'round'; if (!(isset($border['join']))) $border['join'] = 'round'; $this->setStrokeColor($border['color']['red'],$border['color']['green'],$border['color']['blue']); $this->setLineStyle($border['width'],$border['cap'],$border['join']); $this->rectangle($this->ez['leftMargin'] + $pad + $offset, $this->y + $this->getFontHeight($this->ez['fontSize']) - $pad - $height,$width,$height); } // move y below image $this->y = $this->y - $pad - $height; //remove tempfile for remote images if ($temp == true) unlink($image); } // ------------------------------------------------------------------------------ // note that templating code is still considered developmental - have not really figured // out a good way of doing this yet. function loadTemplate($templateFile){ // this function will load the requested template ($file includes full or relative pathname) // the code for the template will be modified to make it name safe, and then stored in // an array for later use // The id of the template will be returned for the user to operate on it later if (!file_exists($templateFile)){ return -1; } $code = implode('',file($templateFile)); if (!strlen($code)){ return; } $code = trim($code); if (substr($code,0,5)==''){ $code = substr($code,0,strlen($code)-2); } if (isset($this->ez['numTemplates'])){ $newNum = $this->ez['numTemplates']; $this->ez['numTemplates']++; } else { $newNum=0; $this->ez['numTemplates']=1; $this->ez['templates']=array(); } $this->ez['templates'][$newNum]['code']=$code; return $newNum; } // ------------------------------------------------------------------------------ function execTemplate($id,$data=array(),$options=array()){ // execute the given template on the current document. if (!isset($this->ez['templates'][$id])){ return; } eval($this->ez['templates'][$id]['code']); } // ------------------------------------------------------------------------------ function ilink($info){ $this->alink($info,1); } function alink($info,$internal=0){ // a callback function to support the formation of clickable links within the document $lineFactor=0.05; // the thickness of the line as a proportion of the height. also the drop of the line. switch($info['status']){ case 'start': case 'sol': // the beginning of the link // this should contain the URl for the link as the 'p' entry, and will also contain the value of 'nCallback' if (!isset($this->ez['links'])){ $this->ez['links']=array(); } $i = $info['nCallback']; $this->ez['links'][$i] = array('x'=>$info['x'],'y'=>$info['y'],'angle'=>$info['angle'],'decender'=>$info['decender'],'height'=>$info['height'],'url'=>$info['p']); if ($internal==0){ $this->saveState(); $this->setColor(0,0,1); $this->setStrokeColor(0,0,1); $thick = $info['height']*$lineFactor; $this->setLineStyle($thick); } break; case 'end': case 'eol': // the end of the link // assume that it is the most recent opening which has closed $i = $info['nCallback']; $start = $this->ez['links'][$i]; // add underlining if ($internal){ $this->addInternalLink($start['url'],$start['x'],$start['y']+$start['decender'],$info['x'],$start['y']+$start['decender']+$start['height']); } else { $a = deg2rad((float)$start['angle']-90.0); $drop = $start['height']*$lineFactor*1.5; $dropx = cos($a)*$drop; $dropy = -sin($a)*$drop; $this->line($start['x']-$dropx,$start['y']-$dropy,$info['x']-$dropx,$info['y']-$dropy); $this->addLink($start['url'],$start['x'],$start['y']+$start['decender'],$info['x'],$start['y']+$start['decender']+$start['height']); $this->restoreState(); } break; } } // ------------------------------------------------------------------------------ function uline($info){ // a callback function to support underlining $lineFactor=0.05; // the thickness of the line as a proportion of the height. also the drop of the line. switch($info['status']){ case 'start': case 'sol': // the beginning of the underline zone if (!isset($this->ez['links'])){ $this->ez['links']=array(); } $i = $info['nCallback']; $this->ez['links'][$i] = array('x'=>$info['x'],'y'=>$info['y'],'angle'=>$info['angle'],'decender'=>$info['decender'],'height'=>$info['height']); $this->saveState(); $thick = $info['height']*$lineFactor; $this->setLineStyle($thick); break; case 'end': case 'eol': // the end of the link // assume that it is the most recent opening which has closed $i = $info['nCallback']; $start = $this->ez['links'][$i]; // add underlining $a = deg2rad((float)$start['angle']-90.0); $drop = $start['height']*$lineFactor*1.5; $dropx = cos($a)*$drop; $dropy = -sin($a)*$drop; $this->line($start['x']-$dropx,$start['y']-$dropy,$info['x']-$dropx,$info['y']-$dropy); $this->restoreState(); break; } } // ------------------------------------------------------------------------------ } ?>glpi-0.84.3+dfsg.1/lib/ezpdf/class.pdf.php000066400000000000000000003047571226600447100201050ustar00rootroot00000000000000 * @version 009 * @package Cpdf */ class Cpdf { /** * the current number of pdf objects in the document */ var $numObj=0; /** * this array contains all of the pdf objects, ready for final assembly */ var $objects = array(); /** * the objectId (number within the objects array) of the document catalog */ var $catalogId; /** * array carrying information about the fonts that the system currently knows about * used to ensure that a font is not loaded twice, among other things */ var $fonts=array(); /** * a record of the current font */ var $currentFont=''; /** * the current base font */ var $currentBaseFont=''; /** * the number of the current font within the font array */ var $currentFontNum=0; /** * */ var $currentNode; /** * object number of the current page */ var $currentPage; /** * object number of the currently active contents block */ var $currentContents; /** * number of fonts within the system */ var $numFonts=0; /** * current colour for fill operations, defaults to inactive value, all three components should be between 0 and 1 inclusive when active */ var $currentColour=array('r'=>-1,'g'=>-1,'b'=>-1); /** * current colour for stroke operations (lines etc.) */ var $currentStrokeColour=array('r'=>-1,'g'=>-1,'b'=>-1); /** * current style that lines are drawn in */ var $currentLineStyle=''; /** * an array which is used to save the state of the document, mainly the colours and styles * it is used to temporarily change to another state, the change back to what it was before */ var $stateStack = array(); /** * number of elements within the state stack */ var $nStateStack = 0; /** * number of page objects within the document */ var $numPages=0; /** * object Id storage stack */ var $stack=array(); /** * number of elements within the object Id storage stack */ var $nStack=0; /** * an array which contains information about the objects which are not firmly attached to pages * these have been added with the addObject function */ var $looseObjects=array(); /** * array contains infomation about how the loose objects are to be added to the document */ var $addLooseObjects=array(); /** * the objectId of the information object for the document * this contains authorship, title etc. */ var $infoObject=0; /** * number of images being tracked within the document */ var $numImages=0; /** * an array containing options about the document * it defaults to turning on the compression of the objects */ var $options=array('compression'=>1); /** * the objectId of the first page of the document */ var $firstPageId; /** * used to track the last used value of the inter-word spacing, this is so that it is known * when the spacing is changed. */ var $wordSpaceAdjust=0; /** * the object Id of the procset object */ var $procsetObjectId; /** * store the information about the relationship between font families * this used so that the code knows which font is the bold version of another font, etc. * the value of this array is initialised in the constuctor function. */ var $fontFamilies = array(); /** * track if the current font is bolded or italicised */ var $currentTextState = ''; /** * messages are stored here during processing, these can be selected afterwards to give some useful debug information */ var $messages=''; /** * the ancryption array for the document encryption is stored here */ var $arc4=''; /** * the object Id of the encryption information */ var $arc4_objnum=0; /** * the file identifier, used to uniquely identify a pdf document */ var $fileIdentifier=''; /** * a flag to say if a document is to be encrypted or not */ var $encrypted=0; /** * the ancryption key for the encryption of all the document content (structure is not encrypted) */ var $encryptionKey=''; /** * array which forms a stack to keep track of nested callback functions */ var $callback = array(); /** * the number of callback functions in the callback array */ var $nCallback = 0; /** * store label->id pairs for named destinations, these will be used to replace internal links * done this way so that destinations can be defined after the location that links to them */ var $destinations = array(); /** * store the stack for the transaction commands, each item in here is a record of the values of all the * variables within the class, so that the user can rollback at will (from each 'start' command) * note that this includes the objects array, so these can be large. */ var $checkpoint = ''; /** * class constructor * this will start a new document * @var array array of 4 numbers, defining the bottom left and upper right corner of the page. first two are normally zero. */ function Cpdf ($pageSize=array(0,0,612,792)){ $this->newDocument($pageSize); // also initialize the font families that are known about already $this->setFontFamily('init'); // $this->fileIdentifier = md5('xxxxxxxx'.time()); } /** * Document object methods (internal use only) * * There is about one object method for each type of object in the pdf document * Each function has the same call list ($id,$action,$options). * $id = the object ID of the object, or what it is to be if it is being created * $action = a string specifying the action to be performed, though ALL must support: * 'new' - create the object with the id $id * 'out' - produce the output for the pdf object * $options = optional, a string or array containing the various parameters for the object * * These, in conjunction with the output function are the ONLY way for output to be produced * within the pdf 'file'. */ /** *destination object, used to specify the location for the user to jump to, presently on opening */ function o_destination($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch($action){ case 'new': $this->objects[$id]=array('t'=>'destination','info'=>array()); $tmp = ''; switch ($options['type']){ case 'XYZ': case 'FitR': $tmp = ' '.$options['p3'].$tmp; case 'FitH': case 'FitV': case 'FitBH': case 'FitBV': $tmp = ' '.$options['p1'].' '.$options['p2'].$tmp; case 'Fit': case 'FitB': $tmp = $options['type'].$tmp; $this->objects[$id]['info']['string']=$tmp; $this->objects[$id]['info']['page']=$options['page']; } break; case 'out': $tmp = $o['info']; $res="\n".$id." 0 obj\n".'['.$tmp['page'].' 0 R /'.$tmp['string']."]\nendobj\n"; return $res; break; } } /** * set the viewer preferences */ function o_viewerPreferences($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch ($action){ case 'new': $this->objects[$id]=array('t'=>'viewerPreferences','info'=>array()); break; case 'add': foreach($options as $k=>$v){ switch ($k){ case 'HideToolbar': case 'HideMenubar': case 'HideWindowUI': case 'FitWindow': case 'CenterWindow': case 'NonFullScreenPageMode': case 'Direction': $o['info'][$k]=$v; break; } } break; case 'out': $res="\n".$id." 0 obj\n".'<< '; foreach($o['info'] as $k=>$v){ $res.="\n/".$k.' '.$v; } $res.="\n>>\n"; return $res; break; } } /** * define the document catalog, the overall controller for the document */ function o_catalog($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch ($action){ case 'new': $this->objects[$id]=array('t'=>'catalog','info'=>array()); $this->catalogId=$id; break; case 'outlines': case 'pages': case 'openHere': $o['info'][$action]=$options; break; case 'viewerPreferences': if (!isset($o['info']['viewerPreferences'])){ $this->numObj++; $this->o_viewerPreferences($this->numObj,'new'); $o['info']['viewerPreferences']=$this->numObj; } $vp = $o['info']['viewerPreferences']; $this->o_viewerPreferences($vp,'add',$options); break; case 'out': $res="\n".$id." 0 obj\n".'<< /Type /Catalog'; foreach($o['info'] as $k=>$v){ switch($k){ case 'outlines': $res.="\n".'/Outlines '.$v.' 0 R'; break; case 'pages': $res.="\n".'/Pages '.$v.' 0 R'; break; case 'viewerPreferences': $res.="\n".'/ViewerPreferences '.$o['info']['viewerPreferences'].' 0 R'; break; case 'openHere': $res.="\n".'/OpenAction '.$o['info']['openHere'].' 0 R'; break; } } $res.=" >>\nendobj"; return $res; break; } } /** * object which is a parent to the pages in the document */ function o_pages($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch ($action){ case 'new': $this->objects[$id]=array('t'=>'pages','info'=>array()); $this->o_catalog($this->catalogId,'pages',$id); break; case 'page': if (!is_array($options)){ // then it will just be the id of the new page $o['info']['pages'][]=$options; } else { // then it should be an array having 'id','rid','pos', where rid=the page to which this one will be placed relative // and pos is either 'before' or 'after', saying where this page will fit. if (isset($options['id']) && isset($options['rid']) && isset($options['pos'])){ $i = array_search($options['rid'],$o['info']['pages']); if (isset($o['info']['pages'][$i]) && $o['info']['pages'][$i]==$options['rid']){ // then there is a match // make a space switch ($options['pos']){ case 'before': $k = $i; break; case 'after': $k=$i+1; break; default: $k=-1; break; } if ($k>=0){ for ($j=count($o['info']['pages'])-1;$j>=$k;$j--){ $o['info']['pages'][$j+1]=$o['info']['pages'][$j]; } $o['info']['pages'][$k]=$options['id']; } } } } break; case 'procset': $o['info']['procset']=$options; break; case 'mediaBox': $o['info']['mediaBox']=$options; // which should be an array of 4 numbers break; case 'font': $o['info']['fonts'][]=array('objNum'=>$options['objNum'],'fontNum'=>$options['fontNum']); break; case 'xObject': $o['info']['xObjects'][]=array('objNum'=>$options['objNum'],'label'=>$options['label']); break; case 'out': if (count($o['info']['pages'])){ $res="\n".$id." 0 obj\n<< /Type /Pages\n/Kids ["; foreach($o['info']['pages'] as $k=>$v){ $res.=$v." 0 R\n"; } $res.="]\n/Count ".count($this->objects[$id]['info']['pages']); if ((isset($o['info']['fonts']) && count($o['info']['fonts'])) || isset($o['info']['procset'])){ $res.="\n/Resources <<"; if (isset($o['info']['procset'])){ $res.="\n/ProcSet ".$o['info']['procset']." 0 R"; } if (isset($o['info']['fonts']) && count($o['info']['fonts'])){ $res.="\n/Font << "; foreach($o['info']['fonts'] as $finfo){ $res.="\n/F".$finfo['fontNum']." ".$finfo['objNum']." 0 R"; } $res.=" >>"; } if (isset($o['info']['xObjects']) && count($o['info']['xObjects'])){ $res.="\n/XObject << "; foreach($o['info']['xObjects'] as $finfo){ $res.="\n/".$finfo['label']." ".$finfo['objNum']." 0 R"; } $res.=" >>"; } $res.="\n>>"; if (isset($o['info']['mediaBox'])){ $tmp=$o['info']['mediaBox']; $res.="\n/MediaBox [".sprintf('%.3f',$tmp[0]).' '.sprintf('%.3f',$tmp[1]).' '.sprintf('%.3f',$tmp[2]).' '.sprintf('%.3f',$tmp[3]).']'; } } $res.="\n >>\nendobj"; } else { $res="\n".$id." 0 obj\n<< /Type /Pages\n/Count 0\n>>\nendobj"; } return $res; break; } } /** * define the outlines in the doc, empty for now */ function o_outlines($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch ($action){ case 'new': $this->objects[$id]=array('t'=>'outlines','info'=>array('outlines'=>array())); $this->o_catalog($this->catalogId,'outlines',$id); break; case 'outline': $o['info']['outlines'][]=$options; break; case 'out': if (count($o['info']['outlines'])){ $res="\n".$id." 0 obj\n<< /Type /Outlines /Kids ["; foreach($o['info']['outlines'] as $k=>$v){ $res.=$v." 0 R "; } $res.="] /Count ".count($o['info']['outlines'])." >>\nendobj"; } else { $res="\n".$id." 0 obj\n<< /Type /Outlines /Count 0 >>\nendobj"; } return $res; break; } } /** * an object to hold the font description */ function o_font($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch ($action){ case 'new': $this->objects[$id]=array('t'=>'font','info'=>array('name'=>$options['name'],'SubType'=>'Type1')); $fontNum=$this->numFonts; $this->objects[$id]['info']['fontNum']=$fontNum; // deal with the encoding and the differences if (isset($options['differences'])){ // then we'll need an encoding dictionary $this->numObj++; $this->o_fontEncoding($this->numObj,'new',$options); $this->objects[$id]['info']['encodingDictionary']=$this->numObj; } else if (isset($options['encoding'])){ // we can specify encoding here switch($options['encoding']){ case 'WinAnsiEncoding': case 'MacRomanEncoding': case 'MacExpertEncoding': $this->objects[$id]['info']['encoding']=$options['encoding']; break; case 'none': break; default: $this->objects[$id]['info']['encoding']='WinAnsiEncoding'; break; } } else { $this->objects[$id]['info']['encoding']='WinAnsiEncoding'; } // also tell the pages node about the new font $this->o_pages($this->currentNode,'font',array('fontNum'=>$fontNum,'objNum'=>$id)); break; case 'add': foreach ($options as $k=>$v){ switch ($k){ case 'BaseFont': $o['info']['name'] = $v; break; case 'FirstChar': case 'LastChar': case 'Widths': case 'FontDescriptor': case 'SubType': $this->addMessage('o_font '.$k." : ".$v); $o['info'][$k] = $v; break; } } break; case 'out': $res="\n".$id." 0 obj\n<< /Type /Font\n/Subtype /".$o['info']['SubType']."\n"; $res.="/Name /F".$o['info']['fontNum']."\n"; $res.="/BaseFont /".$o['info']['name']."\n"; if (isset($o['info']['encodingDictionary'])){ // then place a reference to the dictionary $res.="/Encoding ".$o['info']['encodingDictionary']." 0 R\n"; } else if (isset($o['info']['encoding'])){ // use the specified encoding $res.="/Encoding /".$o['info']['encoding']."\n"; } if (isset($o['info']['FirstChar'])){ $res.="/FirstChar ".$o['info']['FirstChar']."\n"; } if (isset($o['info']['LastChar'])){ $res.="/LastChar ".$o['info']['LastChar']."\n"; } if (isset($o['info']['Widths'])){ $res.="/Widths ".$o['info']['Widths']." 0 R\n"; } if (isset($o['info']['FontDescriptor'])){ $res.="/FontDescriptor ".$o['info']['FontDescriptor']." 0 R\n"; } $res.=">>\nendobj"; return $res; break; } } /** * a font descriptor, needed for including additional fonts */ function o_fontDescriptor($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch ($action){ case 'new': $this->objects[$id]=array('t'=>'fontDescriptor','info'=>$options); break; case 'out': $res="\n".$id." 0 obj\n<< /Type /FontDescriptor\n"; foreach ($o['info'] as $label => $value){ switch ($label){ case 'Ascent': case 'CapHeight': case 'Descent': case 'Flags': case 'ItalicAngle': case 'StemV': case 'AvgWidth': case 'Leading': case 'MaxWidth': case 'MissingWidth': case 'StemH': case 'XHeight': case 'CharSet': if (strlen($value)){ $res.='/'.$label.' '.$value."\n"; } break; case 'FontFile': case 'FontFile2': case 'FontFile3': $res.='/'.$label.' '.$value." 0 R\n"; break; case 'FontBBox': $res.='/'.$label.' ['.$value[0].' '.$value[1].' '.$value[2].' '.$value[3]."]\n"; break; case 'FontName': $res.='/'.$label.' /'.$value."\n"; break; } } $res.=">>\nendobj"; return $res; break; } } /** * the font encoding */ function o_fontEncoding($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch ($action){ case 'new': // the options array should contain 'differences' and maybe 'encoding' $this->objects[$id]=array('t'=>'fontEncoding','info'=>$options); break; case 'out': $res="\n".$id." 0 obj\n<< /Type /Encoding\n"; if (!isset($o['info']['encoding'])){ $o['info']['encoding']='WinAnsiEncoding'; } if ($o['info']['encoding']!='none'){ $res.="/BaseEncoding /".$o['info']['encoding']."\n"; } $res.="/Differences \n["; $onum=-100; foreach($o['info']['differences'] as $num=>$label){ if ($num!=$onum+1){ // we cannot make use of consecutive numbering $res.= "\n".$num." /".$label; } else { $res.= " /".$label; } $onum=$num; } $res.="\n]\n>>\nendobj"; return $res; break; } } /** * the document procset, solves some problems with printing to old PS printers */ function o_procset($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch ($action){ case 'new': $this->objects[$id]=array('t'=>'procset','info'=>array('PDF'=>1,'Text'=>1)); $this->o_pages($this->currentNode,'procset',$id); $this->procsetObjectId=$id; break; case 'add': // this is to add new items to the procset list, despite the fact that this is considered // obselete, the items are required for printing to some postscript printers switch ($options) { case 'ImageB': case 'ImageC': case 'ImageI': $o['info'][$options]=1; break; } break; case 'out': $res="\n".$id." 0 obj\n["; foreach ($o['info'] as $label=>$val){ $res.='/'.$label.' '; } $res.="]\nendobj"; return $res; break; } } /** * define the document information */ function o_info($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch ($action){ case 'new': $this->infoObject=$id; $date='D:'.date('Ymd'); $this->objects[$id]=array('t'=>'info','info'=>array('Creator'=>'R and OS php pdf writer, http://www.ros.co.nz','CreationDate'=>$date)); break; case 'Title': case 'Author': case 'Subject': case 'Keywords': case 'Creator': case 'Producer': case 'CreationDate': case 'ModDate': case 'Trapped': $o['info'][$action]=$options; break; case 'out': if ($this->encrypted){ $this->encryptInit($id); } $res="\n".$id." 0 obj\n<<\n"; foreach ($o['info'] as $k=>$v){ $res.='/'.$k.' ('; if ($this->encrypted){ $res.=$this->filterText($this->ARC4($v)); } else { $res.=$this->filterText($v); } $res.=")\n"; } $res.=">>\nendobj"; return $res; break; } } /** * an action object, used to link to URLS initially */ function o_action($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch ($action){ case 'new': if (is_array($options)){ $this->objects[$id]=array('t'=>'action','info'=>$options,'type'=>$options['type']); } else { // then assume a URI action $this->objects[$id]=array('t'=>'action','info'=>$options,'type'=>'URI'); } break; case 'out': if ($this->encrypted){ $this->encryptInit($id); } $res="\n".$id." 0 obj\n<< /Type /Action"; switch($o['type']){ case 'ilink': // there will be an 'label' setting, this is the name of the destination $res.="\n/S /GoTo\n/D ".$this->destinations[(string)$o['info']['label']]." 0 R"; break; case 'URI': $res.="\n/S /URI\n/URI ("; if ($this->encrypted){ $res.=$this->filterText($this->ARC4($o['info'])); } else { $res.=$this->filterText($o['info']); } $res.=")"; break; } $res.="\n>>\nendobj"; return $res; break; } } /** * an annotation object, this will add an annotation to the current page. * initially will support just link annotations */ function o_annotation($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch ($action){ case 'new': // add the annotation to the current page $pageId = $this->currentPage; $this->o_page($pageId,'annot',$id); // and add the action object which is going to be required switch($options['type']){ case 'link': $this->objects[$id]=array('t'=>'annotation','info'=>$options); $this->numObj++; $this->o_action($this->numObj,'new',$options['url']); $this->objects[$id]['info']['actionId']=$this->numObj; break; case 'ilink': // this is to a named internal link $label = $options['label']; $this->objects[$id]=array('t'=>'annotation','info'=>$options); $this->numObj++; $this->o_action($this->numObj,'new',array('type'=>'ilink','label'=>$label)); $this->objects[$id]['info']['actionId']=$this->numObj; break; } break; case 'out': $res="\n".$id." 0 obj\n<< /Type /Annot"; switch($o['info']['type']){ case 'link': case 'ilink': $res.= "\n/Subtype /Link"; break; } $res.="\n/A ".$o['info']['actionId']." 0 R"; $res.="\n/Border [0 0 0]"; $res.="\n/H /I"; $res.="\n/Rect [ "; foreach($o['info']['rect'] as $v){ $res.= sprintf("%.4f ",$v); } $res.="]"; $res.="\n>>\nendobj"; return $res; break; } } /** * a page object, it also creates a contents object to hold its contents */ function o_page($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch ($action){ case 'new': $this->numPages++; $this->objects[$id]=array('t'=>'page','info'=>array('parent'=>$this->currentNode,'pageNum'=>$this->numPages)); if (is_array($options)){ // then this must be a page insertion, array shoudl contain 'rid','pos'=[before|after] $options['id']=$id; $this->o_pages($this->currentNode,'page',$options); } else { $this->o_pages($this->currentNode,'page',$id); } $this->currentPage=$id; //make a contents object to go with this page $this->numObj++; $this->o_contents($this->numObj,'new',$id); $this->currentContents=$this->numObj; $this->objects[$id]['info']['contents']=array(); $this->objects[$id]['info']['contents'][]=$this->numObj; $match = ($this->numPages%2 ? 'odd' : 'even'); foreach($this->addLooseObjects as $oId=>$target){ if ($target=='all' || $match==$target){ $this->objects[$id]['info']['contents'][]=$oId; } } break; case 'content': $o['info']['contents'][]=$options; break; case 'annot': // add an annotation to this page if (!isset($o['info']['annot'])){ $o['info']['annot']=array(); } // $options should contain the id of the annotation dictionary $o['info']['annot'][]=$options; break; case 'out': $res="\n".$id." 0 obj\n<< /Type /Page"; $res.="\n/Parent ".$o['info']['parent']." 0 R"; if (isset($o['info']['annot'])){ $res.="\n/Annots ["; foreach($o['info']['annot'] as $aId){ $res.=" ".$aId." 0 R"; } $res.=" ]"; } $count = count($o['info']['contents']); if ($count==1){ $res.="\n/Contents ".$o['info']['contents'][0]." 0 R"; } else if ($count>1){ $res.="\n/Contents [\n"; foreach ($o['info']['contents'] as $cId){ $res.=$cId." 0 R\n"; } $res.="]"; } $res.="\n>>\nendobj"; return $res; break; } } /** * the contents objects hold all of the content which appears on pages */ function o_contents($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch ($action){ case 'new': $this->objects[$id]=array('t'=>'contents','c'=>'','info'=>array()); if (strlen($options) && intval($options)){ // then this contents is the primary for a page $this->objects[$id]['onPage']=$options; } else if ($options=='raw'){ // then this page contains some other type of system object $this->objects[$id]['raw']=1; } break; case 'add': // add more options to the decleration foreach ($options as $k=>$v){ $o['info'][$k]=$v; } case 'out': $tmp=$o['c']; $res= "\n".$id." 0 obj\n"; if (isset($this->objects[$id]['raw'])){ $res.=$tmp; } else { $res.= "<<"; if (function_exists('gzcompress') && $this->options['compression']){ // then implement ZLIB based compression on this content stream $res.=" /Filter /FlateDecode"; $tmp = gzcompress($tmp); } if ($this->encrypted){ $this->encryptInit($id); $tmp = $this->ARC4($tmp); } foreach($o['info'] as $k=>$v){ $res .= "\n/".$k.' '.$v; } $res.="\n/Length ".strlen($tmp)." >>\nstream\n".$tmp."\nendstream"; } $res.="\nendobj\n"; return $res; break; } } /** * an image object, will be an XObject in the document, includes description and data */ function o_image($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch($action){ case 'new': // make the new object $this->objects[$id]=array('t'=>'image','data'=>$options['data'],'info'=>array()); $this->objects[$id]['info']['Type']='/XObject'; $this->objects[$id]['info']['Subtype']='/Image'; $this->objects[$id]['info']['Width']=$options['iw']; $this->objects[$id]['info']['Height']=$options['ih']; if (!isset($options['type']) || $options['type']=='jpg'){ if (!isset($options['channels'])){ $options['channels']=3; } switch($options['channels']){ case 1: $this->objects[$id]['info']['ColorSpace']='/DeviceGray'; break; default: $this->objects[$id]['info']['ColorSpace']='/DeviceRGB'; break; } $this->objects[$id]['info']['Filter']='/DCTDecode'; $this->objects[$id]['info']['BitsPerComponent']=8; } else if ($options['type']=='png'){ $this->objects[$id]['info']['Filter']='/FlateDecode'; $this->objects[$id]['info']['DecodeParms']='<< /Predictor 15 /Colors '.$options['ncolor'].' /Columns '.$options['iw'].' /BitsPerComponent '.$options['bitsPerComponent'].'>>'; if (strlen($options['pdata'])){ $tmp = ' [ /Indexed /DeviceRGB '.(strlen($options['pdata'])/3-1).' '; $this->numObj++; $this->o_contents($this->numObj,'new'); $this->objects[$this->numObj]['c']=$options['pdata']; $tmp.=$this->numObj.' 0 R'; $tmp .=' ]'; $this->objects[$id]['info']['ColorSpace'] = $tmp; if (isset($options['transparency'])){ switch($options['transparency']['type']){ case 'indexed': $tmp=' [ '.$options['transparency']['data'].' '.$options['transparency']['data'].'] '; $this->objects[$id]['info']['Mask'] = $tmp; break; } } } else { $this->objects[$id]['info']['ColorSpace']='/'.$options['color']; } $this->objects[$id]['info']['BitsPerComponent']=$options['bitsPerComponent']; } // assign it a place in the named resource dictionary as an external object, according to // the label passed in with it. $this->o_pages($this->currentNode,'xObject',array('label'=>$options['label'],'objNum'=>$id)); // also make sure that we have the right procset object for it. $this->o_procset($this->procsetObjectId,'add','ImageC'); break; case 'out': $tmp=$o['data']; $res= "\n".$id." 0 obj\n<<"; foreach($o['info'] as $k=>$v){ $res.="\n/".$k.' '.$v; } if ($this->encrypted){ $this->encryptInit($id); $tmp = $this->ARC4($tmp); } $res.="\n/Length ".strlen($tmp)." >>\nstream\n".$tmp."\nendstream\nendobj\n"; return $res; break; } } /** * encryption object. */ function o_encryption($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch($action){ case 'new': // make the new object $this->objects[$id]=array('t'=>'encryption','info'=>$options); $this->arc4_objnum=$id; // figure out the additional paramaters required $pad = chr(0x28).chr(0xBF).chr(0x4E).chr(0x5E).chr(0x4E).chr(0x75).chr(0x8A).chr(0x41).chr(0x64).chr(0x00).chr(0x4E).chr(0x56).chr(0xFF).chr(0xFA).chr(0x01).chr(0x08).chr(0x2E).chr(0x2E).chr(0x00).chr(0xB6).chr(0xD0).chr(0x68).chr(0x3E).chr(0x80).chr(0x2F).chr(0x0C).chr(0xA9).chr(0xFE).chr(0x64).chr(0x53).chr(0x69).chr(0x7A); $len = strlen($options['owner']); if ($len>32){ $owner = substr($options['owner'],0,32); } else if ($len<32){ $owner = $options['owner'].substr($pad,0,32-$len); } else { $owner = $options['owner']; } $len = strlen($options['user']); if ($len>32){ $user = substr($options['user'],0,32); } else if ($len<32){ $user = $options['user'].substr($pad,0,32-$len); } else { $user = $options['user']; } $tmp = $this->md5_16($owner); $okey = substr($tmp,0,5); $this->ARC4_init($okey); $ovalue=$this->ARC4($user); $this->objects[$id]['info']['O']=$ovalue; // now make the u value, phew. $tmp = $this->md5_16($user.$ovalue.chr($options['p']).chr(255).chr(255).chr(255).$this->fileIdentifier); $ukey = substr($tmp,0,5); $this->ARC4_init($ukey); $this->encryptionKey = $ukey; $this->encrypted=1; $uvalue=$this->ARC4($pad); $this->objects[$id]['info']['U']=$uvalue; $this->encryptionKey=$ukey; // initialize the arc4 array break; case 'out': $res= "\n".$id." 0 obj\n<<"; $res.="\n/Filter /Standard"; $res.="\n/V 1"; $res.="\n/R 2"; $res.="\n/O (".$this->filterText($o['info']['O']).')'; $res.="\n/U (".$this->filterText($o['info']['U']).')'; // and the p-value needs to be converted to account for the twos-complement approach $o['info']['p'] = (($o['info']['p']^255)+1)*-1; $res.="\n/P ".($o['info']['p']); $res.="\n>>\nendobj\n"; return $res; break; } } /** * ARC4 functions * A series of function to implement ARC4 encoding in PHP */ /** * calculate the 16 byte version of the 128 bit md5 digest of the string */ function md5_16($string){ $tmp = md5($string); $out=''; for ($i=0;$i<=30;$i=$i+2){ $out.=chr(hexdec(substr($tmp,$i,2))); } return $out; } /** * initialize the encryption for processing a particular object */ function encryptInit($id){ $tmp = $this->encryptionKey; $hex = dechex($id); if (strlen($hex)<6){ $hex = substr('000000',0,6-strlen($hex)).$hex; } $tmp.= chr(hexdec(substr($hex,4,2))).chr(hexdec(substr($hex,2,2))).chr(hexdec(substr($hex,0,2))).chr(0).chr(0); $key = $this->md5_16($tmp); $this->ARC4_init(substr($key,0,10)); } /** * initialize the ARC4 encryption */ function ARC4_init($key=''){ $this->arc4 = ''; // setup the control array if (strlen($key)==0){ return; } $k = ''; while(strlen($k)<256){ $k.=$key; } $k=substr($k,0,256); for ($i=0;$i<256;$i++){ $this->arc4 .= chr($i); } $j=0; for ($i=0;$i<256;$i++){ $t = $this->arc4[$i]; $j = ($j + ord($t) + ord($k[$i]))%256; $this->arc4[$i]=$this->arc4[$j]; $this->arc4[$j]=$t; } } /** * ARC4 encrypt a text string */ function ARC4($text){ $len=strlen($text); $a=0; $b=0; $c = $this->arc4; $out=''; for ($i=0;$i<$len;$i++){ $a = ($a+1)%256; $t= $c[$a]; $b = ($b+ord($t))%256; $c[$a]=$c[$b]; $c[$b]=$t; $k = ord($c[(ord($c[$a])+ord($c[$b]))%256]); $out.=chr(ord($text[$i]) ^ $k); } return $out; } /** * functions which can be called to adjust or add to the document */ /** * add a link in the document to an external URL */ function addLink($url,$x0,$y0,$x1,$y1){ $this->numObj++; $info = array('type'=>'link','url'=>$url,'rect'=>array($x0,$y0,$x1,$y1)); $this->o_annotation($this->numObj,'new',$info); } /** * add a link in the document to an internal destination (ie. within the document) */ function addInternalLink($label,$x0,$y0,$x1,$y1){ $this->numObj++; $info = array('type'=>'ilink','label'=>$label,'rect'=>array($x0,$y0,$x1,$y1)); $this->o_annotation($this->numObj,'new',$info); } /** * set the encryption of the document * can be used to turn it on and/or set the passwords which it will have. * also the functions that the user will have are set here, such as print, modify, add */ function setEncryption($userPass='',$ownerPass='',$pc=array()){ $p=bindec(11000000); $options = array( 'print'=>4 ,'modify'=>8 ,'copy'=>16 ,'add'=>32 ); foreach($pc as $k=>$v){ if ($v && isset($options[$k])){ $p+=$options[$k]; } else if (isset($options[$v])){ $p+=$options[$v]; } } // implement encryption on the document if ($this->arc4_objnum == 0){ // then the block does not exist already, add it. $this->numObj++; if (strlen($ownerPass)==0){ $ownerPass=$userPass; } $this->o_encryption($this->numObj,'new',array('user'=>$userPass,'owner'=>$ownerPass,'p'=>$p)); } } /** * should be used for internal checks, not implemented as yet */ function checkAllHere(){ } /** * return the pdf stream as a string returned from the function */ function output($debug=0){ if ($debug){ // turn compression off $this->options['compression']=0; } if ($this->arc4_objnum){ $this->ARC4_init($this->encryptionKey); } $this->checkAllHere(); $xref=array(); $content="%PDF-1.3\n%\n"; // $content="%PDF-1.3\n"; $pos=strlen($content); foreach($this->objects as $k=>$v){ $tmp='o_'.$v['t']; $cont=$this->$tmp($k,'out'); $content.=$cont; $xref[]=$pos; $pos+=strlen($cont); } $content.="\nxref\n0 ".(count($xref)+1)."\n0000000000 65535 f \n"; foreach($xref as $p){ $content.=substr('0000000000',0,10-strlen($p)).$p." 00000 n \n"; } $content.="\ntrailer\n << /Size ".(count($xref)+1)."\n /Root 1 0 R\n /Info ".$this->infoObject." 0 R\n"; // if encryption has been applied to this document then add the marker for this dictionary if ($this->arc4_objnum > 0){ $content .= "/Encrypt ".$this->arc4_objnum." 0 R\n"; } if (strlen($this->fileIdentifier)){ $content .= "/ID[<".$this->fileIdentifier."><".$this->fileIdentifier.">]\n"; } $content .= " >>\nstartxref\n".$pos."\n%%EOF\n"; return $content; } /** * intialize a new document * if this is called on an existing document results may be unpredictable, but the existing document would be lost at minimum * this function is called automatically by the constructor function * * @access private */ function newDocument($pageSize=array(0,0,612,792)){ $this->numObj=0; $this->objects = array(); $this->numObj++; $this->o_catalog($this->numObj,'new'); $this->numObj++; $this->o_outlines($this->numObj,'new'); $this->numObj++; $this->o_pages($this->numObj,'new'); $this->o_pages($this->numObj,'mediaBox',$pageSize); $this->currentNode = 3; $this->numObj++; $this->o_procset($this->numObj,'new'); $this->numObj++; $this->o_info($this->numObj,'new'); $this->numObj++; $this->o_page($this->numObj,'new'); // need to store the first page id as there is no way to get it to the user during // startup $this->firstPageId = $this->currentContents; } /** * open the font file and return a php structure containing it. * first check if this one has been done before and saved in a form more suited to php * note that if a php serialized version does not exist it will try and make one, but will * require write access to the directory to do it... it is MUCH faster to have these serialized * files. * * @access private */ function openFont($font){ // assume that $font contains both the path and perhaps the extension to the file, split them $pos=strrpos($font,'/'); if ($pos===false){ $dir = './'; $name = $font; } else { $dir=substr($font,0,$pos+1); $name=substr($font,$pos+1); } if (substr($name,-4)=='.afm'){ $name=substr($name,0,strlen($name)-4); } $this->addMessage('openFont: '.$font.' - '.$name); if (file_exists($dir.'php_'.$name.'.afm')){ $this->addMessage('openFont: php file exists '.$dir.'php_'.$name.'.afm'); $tmp = file($dir.'php_'.$name.'.afm'); $this->fonts[$font]=unserialize($tmp[0]); if (!isset($this->fonts[$font]['_version_']) || $this->fonts[$font]['_version_']<1){ // if the font file is old, then clear it out and prepare for re-creation $this->addMessage('openFont: clear out, make way for new version.'); unset($this->fonts[$font]); } } if (!isset($this->fonts[$font]) && file_exists($dir.$name.'.afm')){ // then rebuild the php_.afm file from the .afm file $this->addMessage('openFont: build php file from '.$dir.$name.'.afm'); $data = array(); $file = file($dir.$name.'.afm'); foreach ($file as $rowA){ $row=trim($rowA); $pos=strpos($row,' '); if ($pos){ // then there must be some keyword $key = substr($row,0,$pos); switch ($key){ case 'FontName': case 'FullName': case 'FamilyName': case 'Weight': case 'ItalicAngle': case 'IsFixedPitch': case 'CharacterSet': case 'UnderlinePosition': case 'UnderlineThickness': case 'Version': case 'EncodingScheme': case 'CapHeight': case 'XHeight': case 'Ascender': case 'Descender': case 'StdHW': case 'StdVW': case 'StartCharMetrics': $data[$key]=trim(substr($row,$pos)); break; case 'FontBBox': $data[$key]=explode(' ',trim(substr($row,$pos))); break; case 'C': //C 39 ; WX 222 ; N quoteright ; B 53 463 157 718 ; $bits=explode(';',trim($row)); $dtmp=array(); foreach($bits as $bit){ $bits2 = explode(' ',trim($bit)); if (strlen($bits2[0])){ if (count($bits2)>2){ $dtmp[$bits2[0]]=array(); for ($i=1;$i=0){ $data['C'][$dtmp['C']]=$dtmp; $data['C'][$dtmp['N']]=$dtmp; } else { $data['C'][$dtmp['N']]=$dtmp; } break; case 'KPX': //KPX Adieresis yacute -40 $bits=explode(' ',trim($row)); $data['KPX'][$bits[1]][$bits[2]]=$bits[3]; break; } } } $data['_version_']=1; $this->fonts[$font]=$data; $fp = fopen($dir.'php_'.$name.'.afm','w'); fwrite($fp,serialize($data)); fclose($fp); } else if (!isset($this->fonts[$font])){ $this->addMessage('openFont: no font file found'); // echo 'Font not Found '.$font; } } /** * if the font is not loaded then load it and make the required object * else just make it the current font * the encoding array can contain 'encoding'=> 'none','WinAnsiEncoding','MacRomanEncoding' or 'MacExpertEncoding' * note that encoding='none' will need to be used for symbolic fonts * and 'differences' => an array of mappings between numbers 0->255 and character names. * */ function selectFont($fontName,$encoding='',$set=1){ if (!isset($this->fonts[$fontName])){ // load the file $this->openFont($fontName); if (isset($this->fonts[$fontName])){ $this->numObj++; $this->numFonts++; $pos=strrpos($fontName,'/'); // $dir=substr($fontName,0,$pos+1); $name=substr($fontName,$pos+1); if (substr($name,-4)=='.afm'){ $name=substr($name,0,strlen($name)-4); } $options=array('name'=>$name); if (is_array($encoding)){ // then encoding and differences might be set if (isset($encoding['encoding'])){ $options['encoding']=$encoding['encoding']; } if (isset($encoding['differences'])){ $options['differences']=$encoding['differences']; } } else if (strlen($encoding)){ // then perhaps only the encoding has been set $options['encoding']=$encoding; } $fontObj = $this->numObj; $this->o_font($this->numObj,'new',$options); $this->fonts[$fontName]['fontNum']=$this->numFonts; // if this is a '.afm' font, and there is a '.pfa' file to go with it ( as there // should be for all non-basic fonts), then load it into an object and put the // references into the font object $basefile = substr($fontName,0,strlen($fontName)-4); if (file_exists($basefile.'.pfb')){ $fbtype = 'pfb'; } else if (file_exists($basefile.'.ttf')){ $fbtype = 'ttf'; } else { $fbtype=''; } $fbfile = $basefile.'.'.$fbtype; // $pfbfile = substr($fontName,0,strlen($fontName)-4).'.pfb'; // $ttffile = substr($fontName,0,strlen($fontName)-4).'.ttf'; $this->addMessage('selectFont: checking for - '.$fbfile); if (substr($fontName,-4)=='.afm' && strlen($fbtype) ){ $adobeFontName = $this->fonts[$fontName]['FontName']; // $fontObj = $this->numObj; $this->addMessage('selectFont: adding font file - '.$fbfile.' - '.$adobeFontName); // find the array of fond widths, and put that into an object. $firstChar = -1; $lastChar = 0; $widths = array(); foreach ($this->fonts[$fontName]['C'] as $num=>$d){ if (intval($num)>0 || $num=='0'){ if ($lastChar>0 && $num>$lastChar+1){ for($i=$lastChar+1;$i<$num;$i++){ $widths[] = 0; } } $widths[] = $d['WX']; if ($firstChar==-1){ $firstChar = $num; } $lastChar = $num; } } // also need to adjust the widths for the differences array if (isset($options['differences'])){ foreach($options['differences'] as $charNum=>$charName){ if ($charNum>$lastChar){ for($i=$lastChar+1;$i<=$charNum;$i++){ $widths[]=0; } $lastChar=$charNum; } if (isset($this->fonts[$fontName]['C'][$charName])){ $widths[$charNum-$firstChar]=$this->fonts[$fontName]['C'][$charName]['WX']; } } } $this->addMessage('selectFont: FirstChar='.$firstChar); $this->addMessage('selectFont: LastChar='.$lastChar); $this->numObj++; $this->o_contents($this->numObj,'new','raw'); $this->objects[$this->numObj]['c'].='['; foreach($widths as $width){ $this->objects[$this->numObj]['c'].=' '.$width; } $this->objects[$this->numObj]['c'].=' ]'; $widthid = $this->numObj; // load the pfb file, and put that into an object too. // note that pdf supports only binary format type 1 font files, though there is a // simple utility to convert them from pfa to pfb. $fp = fopen($fbfile,'rb'); $tmp = get_magic_quotes_runtime(); if ($tmp) set_magic_quotes_runtime(0); $data = fread($fp,filesize($fbfile)); if ($tmp) set_magic_quotes_runtime($tmp); fclose($fp); // create the font descriptor $this->numObj++; $fontDescriptorId = $this->numObj; $this->numObj++; $pfbid = $this->numObj; // determine flags (more than a little flakey, hopefully will not matter much) $flags=0; if ($this->fonts[$fontName]['ItalicAngle']!=0){ $flags+=pow(2,6); } if ($this->fonts[$fontName]['IsFixedPitch']=='true'){ $flags+=1; } $flags+=pow(2,5); // assume non-sybolic $list = array('Ascent'=>'Ascender','CapHeight'=>'CapHeight','Descent'=>'Descender','FontBBox'=>'FontBBox','ItalicAngle'=>'ItalicAngle'); $fdopt = array( 'Flags'=>$flags ,'FontName'=>$adobeFontName ,'StemV'=>100 // don't know what the value for this should be! ); foreach($list as $k=>$v){ if (isset($this->fonts[$fontName][$v])){ $fdopt[$k]=$this->fonts[$fontName][$v]; } } if ($fbtype=='pfb'){ $fdopt['FontFile']=$pfbid; } else if ($fbtype=='ttf'){ $fdopt['FontFile2']=$pfbid; } $this->o_fontDescriptor($fontDescriptorId,'new',$fdopt); // embed the font program $this->o_contents($this->numObj,'new'); $this->objects[$pfbid]['c'].=$data; // determine the cruicial lengths within this file if ($fbtype=='pfb'){ $l1 = strpos($data,'eexec')+6; $l2 = strpos($data,'00000000')-$l1; $l3 = strlen($data)-$l2-$l1; $this->o_contents($this->numObj,'add',array('Length1'=>$l1,'Length2'=>$l2,'Length3'=>$l3)); } else if ($fbtype=='ttf'){ $l1 = strlen($data); $this->o_contents($this->numObj,'add',array('Length1'=>$l1)); } // tell the font object about all this new stuff $tmp = array('BaseFont'=>$adobeFontName,'Widths'=>$widthid ,'FirstChar'=>$firstChar,'LastChar'=>$lastChar ,'FontDescriptor'=>$fontDescriptorId); if ($fbtype=='ttf'){ $tmp['SubType']='TrueType'; } $this->addMessage('adding extra info to font.('.$fontObj.')'); foreach($tmp as $fk=>$fv){ $this->addMessage($fk." : ".$fv); } $this->o_font($fontObj,'add',$tmp); } else { $this->addMessage('selectFont: pfb or ttf file not found, ok if this is one of the 14 standard fonts'); } // also set the differences here, note that this means that these will take effect only the //first time that a font is selected, else they are ignored if (isset($options['differences'])){ $this->fonts[$fontName]['differences']=$options['differences']; } } } if ($set && isset($this->fonts[$fontName])){ // so if for some reason the font was not set in the last one then it will not be selected $this->currentBaseFont=$fontName; // the next line means that if a new font is selected, then the current text state will be // applied to it as well. $this->setCurrentFont(); } return $this->currentFontNum; } /** * sets up the current font, based on the font families, and the current text state * note that this system is quite flexible, a font can be completely different to a * font, and even will have to be defined within the family to have meaning * This function is to be called whenever the currentTextState is changed, it will update * the currentFont setting to whatever the appropriatte family one is. * If the user calls selectFont themselves then that will reset the currentBaseFont, and the currentFont * This function will change the currentFont to whatever it should be, but will not change the * currentBaseFont. * * @access private */ function setCurrentFont(){ if (strlen($this->currentBaseFont)==0){ // then assume an initial font $this->selectFont('./fonts/Helvetica.afm'); } $cf = substr($this->currentBaseFont,strrpos($this->currentBaseFont,'/')+1); if (strlen($this->currentTextState) && isset($this->fontFamilies[$cf]) && isset($this->fontFamilies[$cf][$this->currentTextState])){ // then we are in some state or another // and this font has a family, and the current setting exists within it // select the font, then return it $nf = substr($this->currentBaseFont,0,strrpos($this->currentBaseFont,'/')+1).$this->fontFamilies[$cf][$this->currentTextState]; $this->selectFont($nf,'',0); $this->currentFont = $nf; $this->currentFontNum = $this->fonts[$nf]['fontNum']; } else { // the this font must not have the right family member for the current state // simply assume the base font $this->currentFont = $this->currentBaseFont; $this->currentFontNum = $this->fonts[$this->currentFont]['fontNum']; } } /** * function for the user to find out what the ID is of the first page that was created during * startup - useful if they wish to add something to it later. */ function getFirstPageId(){ return $this->firstPageId; } /** * add content to the currently active object * * @access private */ function addContent($content){ $this->objects[$this->currentContents]['c'].=$content; } /** * sets the colour for fill operations */ function setColor($r,$g,$b,$force=0){ if ($r>=0 && ($force || $r!=$this->currentColour['r'] || $g!=$this->currentColour['g'] || $b!=$this->currentColour['b'])){ $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$r).' '.sprintf('%.3f',$g).' '.sprintf('%.3f',$b).' rg'; $this->currentColour=array('r'=>$r,'g'=>$g,'b'=>$b); } } /** * sets the colour for stroke operations */ function setStrokeColor($r,$g,$b,$force=0){ if ($r>=0 && ($force || $r!=$this->currentStrokeColour['r'] || $g!=$this->currentStrokeColour['g'] || $b!=$this->currentStrokeColour['b'])){ $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$r).' '.sprintf('%.3f',$g).' '.sprintf('%.3f',$b).' RG'; $this->currentStrokeColour=array('r'=>$r,'g'=>$g,'b'=>$b); } } /** * draw a line from one set of coordinates to another */ function line($x1,$y1,$x2,$y2){ $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$x1).' '.sprintf('%.3f',$y1).' m '.sprintf('%.3f',$x2).' '.sprintf('%.3f',$y2).' l S'; } /** * draw a bezier curve based on 4 control points */ function curve($x0,$y0,$x1,$y1,$x2,$y2,$x3,$y3){ // in the current line style, draw a bezier curve from (x0,y0) to (x3,y3) using the other two points // as the control points for the curve. $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$x0).' '.sprintf('%.3f',$y0).' m '.sprintf('%.3f',$x1).' '.sprintf('%.3f',$y1); $this->objects[$this->currentContents]['c'].= ' '.sprintf('%.3f',$x2).' '.sprintf('%.3f',$y2).' '.sprintf('%.3f',$x3).' '.sprintf('%.3f',$y3).' c S'; } /** * draw a part of an ellipse */ function partEllipse($x0,$y0,$astart,$afinish,$r1,$r2=0,$angle=0,$nSeg=8){ $this->ellipse($x0,$y0,$r1,$r2,$angle,$nSeg,$astart,$afinish,0); } /** * draw a filled ellipse */ function filledEllipse($x0,$y0,$r1,$r2=0,$angle=0,$nSeg=8,$astart=0,$afinish=360){ return $this->ellipse($x0,$y0,$r1,$r2=0,$angle,$nSeg,$astart,$afinish,1,1); } /** * draw an ellipse * note that the part and filled ellipse are just special cases of this function * * draws an ellipse in the current line style * centered at $x0,$y0, radii $r1,$r2 * if $r2 is not set, then a circle is drawn * nSeg is not allowed to be less than 2, as this will simply draw a line (and will even draw a * pretty crappy shape at 2, as we are approximating with bezier curves. */ function ellipse($x0,$y0,$r1,$r2=0,$angle=0,$nSeg=8,$astart=0,$afinish=360,$close=1,$fill=0){ if ($r1==0){ return; } if ($r2==0){ $r2=$r1; } if ($nSeg<2){ $nSeg=2; } $astart = deg2rad((float)$astart); $afinish = deg2rad((float)$afinish); $totalAngle =$afinish-$astart; $dt = $totalAngle/$nSeg; $dtm = $dt/3; if ($angle != 0){ $a = -1*deg2rad((float)$angle); $tmp = "\n q "; $tmp .= sprintf('%.3f',cos($a)).' '.sprintf('%.3f',(-1.0*sin($a))).' '.sprintf('%.3f',sin($a)).' '.sprintf('%.3f',cos($a)).' '; $tmp .= sprintf('%.3f',$x0).' '.sprintf('%.3f',$y0).' cm'; $this->objects[$this->currentContents]['c'].= $tmp; $x0=0; $y0=0; } $t1 = $astart; $a0 = $x0+$r1*cos($t1); $b0 = $y0+$r2*sin($t1); $c0 = -$r1*sin($t1); $d0 = $r2*cos($t1); $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$a0).' '.sprintf('%.3f',$b0).' m '; for ($i=1;$i<=$nSeg;$i++){ // draw this bit of the total curve $t1 = $i*$dt+$astart; $a1 = $x0+$r1*cos($t1); $b1 = $y0+$r2*sin($t1); $c1 = -$r1*sin($t1); $d1 = $r2*cos($t1); $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',($a0+$c0*$dtm)).' '.sprintf('%.3f',($b0+$d0*$dtm)); $this->objects[$this->currentContents]['c'].= ' '.sprintf('%.3f',($a1-$c1*$dtm)).' '.sprintf('%.3f',($b1-$d1*$dtm)).' '.sprintf('%.3f',$a1).' '.sprintf('%.3f',$b1).' c'; $a0=$a1; $b0=$b1; $c0=$c1; $d0=$d1; } if ($fill){ $this->objects[$this->currentContents]['c'].=' f'; } else { if ($close){ $this->objects[$this->currentContents]['c'].=' s'; // small 's' signifies closing the path as well } else { $this->objects[$this->currentContents]['c'].=' S'; } } if ($angle !=0){ $this->objects[$this->currentContents]['c'].=' Q'; } } /** * this sets the line drawing style. * width, is the thickness of the line in user units * cap is the type of cap to put on the line, values can be 'butt','round','square' * where the diffference between 'square' and 'butt' is that 'square' projects a flat end past the * end of the line. * join can be 'miter', 'round', 'bevel' * dash is an array which sets the dash pattern, is a series of length values, which are the lengths of the * on and off dashes. * (2) represents 2 on, 2 off, 2 on , 2 off ... * (2,1) is 2 on, 1 off, 2 on, 1 off.. etc * phase is a modifier on the dash pattern which is used to shift the point at which the pattern starts. */ function setLineStyle($width=1,$cap='',$join='',$dash='',$phase=0){ // this is quite inefficient in that it sets all the parameters whenever 1 is changed, but will fix another day $string = ''; if ($width>0){ $string.= $width.' w'; } $ca = array('butt'=>0,'round'=>1,'square'=>2); if (isset($ca[$cap])){ $string.= ' '.$ca[$cap].' J'; } $ja = array('miter'=>0,'round'=>1,'bevel'=>2); if (isset($ja[$join])){ $string.= ' '.$ja[$join].' j'; } if (is_array($dash)){ $string.= ' ['; foreach ($dash as $len){ $string.=' '.$len; } $string.= ' ] '.$phase.' d'; } $this->currentLineStyle = $string; $this->objects[$this->currentContents]['c'].="\n".$string; } /** * draw a polygon, the syntax for this is similar to the GD polygon command */ function polygon($p,$np,$f=0){ $this->objects[$this->currentContents]['c'].="\n"; $this->objects[$this->currentContents]['c'].=sprintf('%.3f',$p[0]).' '.sprintf('%.3f',$p[1]).' m '; for ($i=2;$i<$np*2;$i=$i+2){ $this->objects[$this->currentContents]['c'].= sprintf('%.3f',$p[$i]).' '.sprintf('%.3f',$p[$i+1]).' l '; } if ($f==1){ $this->objects[$this->currentContents]['c'].=' f'; } else { $this->objects[$this->currentContents]['c'].=' S'; } } /** * a filled rectangle, note that it is the width and height of the rectangle which are the secondary paramaters, not * the coordinates of the upper-right corner */ function filledRectangle($x1,$y1,$width,$height){ $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$x1).' '.sprintf('%.3f',$y1).' '.sprintf('%.3f',$width).' '.sprintf('%.3f',$height).' re f'; } /** * draw a rectangle, note that it is the width and height of the rectangle which are the secondary paramaters, not * the coordinates of the upper-right corner */ function rectangle($x1,$y1,$width,$height){ $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$x1).' '.sprintf('%.3f',$y1).' '.sprintf('%.3f',$width).' '.sprintf('%.3f',$height).' re S'; } /** * add a new page to the document * this also makes the new page the current active object */ function newPage($insert=0,$id=0,$pos='after'){ // if there is a state saved, then go up the stack closing them // then on the new page, re-open them with the right setings if ($this->nStateStack){ for ($i=$this->nStateStack;$i>=1;$i--){ $this->restoreState($i); } } $this->numObj++; if ($insert){ // the id from the ezPdf class is the od of the contents of the page, not the page object itself // query that object to find the parent $rid = $this->objects[$id]['onPage']; $opt= array('rid'=>$rid,'pos'=>$pos); $this->o_page($this->numObj,'new',$opt); } else { $this->o_page($this->numObj,'new'); } // if there is a stack saved, then put that onto the page if ($this->nStateStack){ for ($i=1;$i<=$this->nStateStack;$i++){ $this->saveState($i); } } // and if there has been a stroke or fill colour set, then transfer them if ($this->currentColour['r']>=0){ $this->setColor($this->currentColour['r'],$this->currentColour['g'],$this->currentColour['b'],1); } if ($this->currentStrokeColour['r']>=0){ $this->setStrokeColor($this->currentStrokeColour['r'],$this->currentStrokeColour['g'],$this->currentStrokeColour['b'],1); } // if there is a line style set, then put this in too if (strlen($this->currentLineStyle)){ $this->objects[$this->currentContents]['c'].="\n".$this->currentLineStyle; } // the call to the o_page object set currentContents to the present page, so this can be returned as the page id return $this->currentContents; } /** * output the pdf code, streaming it to the browser * the relevant headers are set so that hopefully the browser will recognise it */ function stream($options=''){ // setting the options allows the adjustment of the headers // values at the moment are: // 'Content-Disposition'=>'filename' - sets the filename, though not too sure how well this will // work as in my trial the browser seems to use the filename of the php file with .pdf on the end // 'Accept-Ranges'=>1 or 0 - if this is not set to 1, then this header is not included, off by default // this header seems to have caused some problems despite tha fact that it is supposed to solve // them, so I am leaving it off by default. // 'compress'=> 1 or 0 - apply content stream compression, this is on (1) by default if (!is_array($options)){ $options=array(); } if ( isset($options['compress']) && $options['compress']==0){ $tmp = $this->output(1); } else { $tmp = $this->output(); } header("Expires: Mon, 26 Nov 1962 00:00:00 GMT"); header('Pragma: private'); /// IE BUG + SSL //header('Pragma: no-cache'); header('Cache-control: private, must-revalidate'); /// IE BUG + SSL header("Content-type: application/pdf"); header("Content-Length: ".strlen(ltrim($tmp))); $fileName = (isset($options['Content-Disposition'])?$options['Content-Disposition']:'file.pdf'); header("Content-Disposition: inline; filename=".$fileName); if (isset($options['Accept-Ranges']) && $options['Accept-Ranges']==1){ header("Accept-Ranges: ".strlen(ltrim($tmp))); } echo ltrim($tmp); } /** * return the height in units of the current font in the given size */ function getFontHeight($size){ if (!$this->numFonts){ $this->selectFont('./fonts/Helvetica'); } // for the current font, and the given size, what is the height of the font in user units $h = $this->fonts[$this->currentFont]['FontBBox'][3]-$this->fonts[$this->currentFont]['FontBBox'][1]; return $size*$h/1000; } /** * return the font decender, this will normally return a negative number * if you add this number to the baseline, you get the level of the bottom of the font * it is in the pdf user units */ function getFontDecender($size){ // note that this will most likely return a negative value if (!$this->numFonts){ $this->selectFont('./fonts/Helvetica'); } $h = $this->fonts[$this->currentFont]['FontBBox'][1]; return $size*$h/1000; } /** * filter the text, this is applied to all text just before being inserted into the pdf document * it escapes the various things that need to be escaped, and so on * * @access private */ function filterText($text){ $text = str_replace('\\','\\\\',$text); $text = str_replace('(','\(',$text); $text = str_replace(')','\)',$text); $text = str_replace('<','<',$text); $text = str_replace('>','>',$text); $text = str_replace(''','\'',$text); $text = str_replace('"','"',$text); $text = str_replace('&','&',$text); return $text; } /** * given a start position and information about how text is to be laid out, calculate where * on the page the text will end * * @access private */ function PRVTgetTextPosition($x,$y,$angle,$size,$wa,$text){ // given this information return an array containing x and y for the end position as elements 0 and 1 $w = $this->getTextWidth($size,$text); // need to adjust for the number of spaces in this text $words = explode(' ',$text); $nspaces=count($words)-1; $w += $wa*$nspaces; $a = deg2rad((float)$angle); return array(cos($a)*$w+$x,-sin($a)*$w+$y); } /** * wrapper function for PRVTcheckTextDirective1 * * @access private */ function PRVTcheckTextDirective(&$text,$i,&$f){ $x=0; $y=0; return $this->PRVTcheckTextDirective1($text,$i,$f,0,$x,$y); } /** * checks if the text stream contains a control directive * if so then makes some changes and returns the number of characters involved in the directive * this has been re-worked to include everything neccesary to fins the current writing point, so that * the location can be sent to the callback function if required * if the directive does not require a font change, then $f should be set to 0 * * @access private */ function PRVTcheckTextDirective1(&$text,$i,&$f,$final,&$x,&$y,$size=0,$angle=0,$wordSpaceAdjust=0){ $directive = 0; $j=$i; if ($text[$j]=='<'){ $j++; switch($text[$j]){ case '/': $j++; if (strlen($text) <= $j){ return $directive; } switch($text[$j]){ case 'b': case 'i': $j++; if ($text[$j]=='>'){ $p = strrpos($this->currentTextState,$text[$j-1]); if ($p !== false){ // then there is one to remove $this->currentTextState = substr($this->currentTextState,0,$p).substr($this->currentTextState,$p+1); } $directive=$j-$i+1; } break; case 'c': // this this might be a callback function $j++; $k = strpos($text,'>',$j); if ($k!==false && $text[$j]==':'){ // then this will be treated as a callback directive $directive = $k-$i+1; $f=0; // split the remainder on colons to get the function name and the paramater $tmp = substr($text,$j+1,$k-$j-1); $b1 = strpos($tmp,':'); if ($b1!==false){ $func = substr($tmp,0,$b1); $parm = substr($tmp,$b1+1); } else { $func=$tmp; $parm=''; } if (!isset($func) || !strlen(trim($func))){ $directive=0; } else { // only call the function if this is the final call if ($final){ // need to assess the text position, calculate the text width to this point // can use getTextWidth to find the text width I think $tmp = $this->PRVTgetTextPosition($x,$y,$angle,$size,$wordSpaceAdjust,substr($text,0,$i)); $info = array('x'=>$tmp[0],'y'=>$tmp[1],'angle'=>$angle,'status'=>'end','p'=>$parm,'nCallback'=>$this->nCallback); $x=$tmp[0]; $y=$tmp[1]; $ret = $this->$func($info); if (is_array($ret)){ // then the return from the callback function could set the position, to start with, later will do font colour, and font foreach($ret as $rk=>$rv){ switch($rk){ case 'x': case 'y': $$rk=$rv; break; } } } // also remove from to the stack // for simplicity, just take from the end, fix this another day $this->nCallback--; if ($this->nCallback<0){ $this->nCallBack=0; } } } } break; } break; case 'b': case 'i': $j++; if ($text[$j]=='>'){ $this->currentTextState.=$text[$j-1]; $directive=$j-$i+1; } break; case 'C': $noClose=1; case 'c': // this this might be a callback function $j++; $k = strpos($text,'>',$j); if ($k!==false && $text[$j]==':'){ // then this will be treated as a callback directive $directive = $k-$i+1; $f=0; // split the remainder on colons to get the function name and the paramater // $bits = explode(':',substr($text,$j+1,$k-$j-1)); $tmp = substr($text,$j+1,$k-$j-1); $b1 = strpos($tmp,':'); if ($b1!==false){ $func = substr($tmp,0,$b1); $parm = substr($tmp,$b1+1); } else { $func=$tmp; $parm=''; } if (!isset($func) || !strlen(trim($func))){ $directive=0; } else { // only call the function if this is the final call, ie, the one actually doing printing, not measurement if ($final){ // need to assess the text position, calculate the text width to this point // can use getTextWidth to find the text width I think // also add the text height and decender $tmp = $this->PRVTgetTextPosition($x,$y,$angle,$size,$wordSpaceAdjust,substr($text,0,$i)); $info = array('x'=>$tmp[0],'y'=>$tmp[1],'angle'=>$angle,'status'=>'start','p'=>$parm,'f'=>$func,'height'=>$this->getFontHeight($size),'decender'=>$this->getFontDecender($size)); $x=$tmp[0]; $y=$tmp[1]; if (!isset($noClose) || !$noClose){ // only add to the stack if this is a small 'c', therefore is a start-stop pair $this->nCallback++; $info['nCallback']=$this->nCallback; $this->callback[$this->nCallback]=$info; } $ret = $this->$func($info); if (is_array($ret)){ // then the return from the callback function could set the position, to start with, later will do font colour, and font foreach($ret as $rk=>$rv){ switch($rk){ case 'x': case 'y': $$rk=$rv; break; } } } } } } break; } } return $directive; } /** * add text to the document, at a specified location, size and angle on the page */ function addText($x,$y,$size,$text,$angle=0,$wordSpaceAdjust=0){ if (!$this->numFonts){$this->selectFont('./fonts/Helvetica');} // if there are any open callbacks, then they should be called, to show the start of the line if ($this->nCallback>0){ for ($i=$this->nCallback;$i>0;$i--){ // call each function $info = array('x'=>$x,'y'=>$y,'angle'=>$angle,'status'=>'sol','p'=>$this->callback[$i]['p'],'nCallback'=>$this->callback[$i]['nCallback'],'height'=>$this->callback[$i]['height'],'decender'=>$this->callback[$i]['decender']); $func = $this->callback[$i]['f']; $this->$func($info); } } if ($angle==0){ $this->objects[$this->currentContents]['c'].="\n".'BT '.sprintf('%.3f',$x).' '.sprintf('%.3f',$y).' Td'; } else { $a = deg2rad((float)$angle); $tmp = "\n".'BT '; $tmp .= sprintf('%.3f',cos($a)).' '.sprintf('%.3f',(-1.0*sin($a))).' '.sprintf('%.3f',sin($a)).' '.sprintf('%.3f',cos($a)).' '; $tmp .= sprintf('%.3f',$x).' '.sprintf('%.3f',$y).' Tm'; $this->objects[$this->currentContents]['c'] .= $tmp; } if ($wordSpaceAdjust!=0 || $wordSpaceAdjust != $this->wordSpaceAdjust){ $this->wordSpaceAdjust=$wordSpaceAdjust; $this->objects[$this->currentContents]['c'].=' '.sprintf('%.3f',$wordSpaceAdjust).' Tw'; } $len=strlen($text); $start=0; for ($i=0;$i<$len;$i++){ $f=1; $directive = $this->PRVTcheckTextDirective($text,$i,$f); if ($directive){ // then we should write what we need to if ($i>$start){ $part = substr($text,$start,$i-$start); $this->objects[$this->currentContents]['c'].=' /F'.$this->currentFontNum.' '.sprintf('%.1f',$size).' Tf '; $this->objects[$this->currentContents]['c'].=' ('.$this->filterText($part).') Tj'; } if ($f){ // then there was nothing drastic done here, restore the contents $this->setCurrentFont(); } else { $this->objects[$this->currentContents]['c'] .= ' ET'; $f=1; $xp=$x; $yp=$y; $directive = $this->PRVTcheckTextDirective1($text,$i,$f,1,$xp,$yp,$size,$angle,$wordSpaceAdjust); // restart the text object if ($angle==0){ $this->objects[$this->currentContents]['c'].="\n".'BT '.sprintf('%.3f',$xp).' '.sprintf('%.3f',$yp).' Td'; } else { $a = deg2rad((float)$angle); $tmp = "\n".'BT '; $tmp .= sprintf('%.3f',cos($a)).' '.sprintf('%.3f',(-1.0*sin($a))).' '.sprintf('%.3f',sin($a)).' '.sprintf('%.3f',cos($a)).' '; $tmp .= sprintf('%.3f',$xp).' '.sprintf('%.3f',$yp).' Tm'; $this->objects[$this->currentContents]['c'] .= $tmp; } if ($wordSpaceAdjust!=0 || $wordSpaceAdjust != $this->wordSpaceAdjust){ $this->wordSpaceAdjust=$wordSpaceAdjust; $this->objects[$this->currentContents]['c'].=' '.sprintf('%.3f',$wordSpaceAdjust).' Tw'; } } // and move the writing point to the next piece of text $i=$i+$directive-1; $start=$i+1; } } if ($start<$len){ $part = substr($text,$start); $this->objects[$this->currentContents]['c'].=' /F'.$this->currentFontNum.' '.sprintf('%.1f',$size).' Tf '; $this->objects[$this->currentContents]['c'].=' ('.$this->filterText($part).') Tj'; } $this->objects[$this->currentContents]['c'].=' ET'; // if there are any open callbacks, then they should be called, to show the end of the line if ($this->nCallback>0){ for ($i=$this->nCallback;$i>0;$i--){ // call each function $tmp = $this->PRVTgetTextPosition($x,$y,$angle,$size,$wordSpaceAdjust,$text); $info = array('x'=>$tmp[0],'y'=>$tmp[1],'angle'=>$angle,'status'=>'eol','p'=>$this->callback[$i]['p'],'nCallback'=>$this->callback[$i]['nCallback'],'height'=>$this->callback[$i]['height'],'decender'=>$this->callback[$i]['decender']); $func = $this->callback[$i]['f']; $this->$func($info); } } } /** * calculate how wide a given text string will be on a page, at a given size. * this can be called externally, but is alse used by the other class functions */ function getTextWidth($size,$text){ // this function should not change any of the settings, though it will need to // track any directives which change during calculation, so copy them at the start // and put them back at the end. $store_currentTextState = $this->currentTextState; if (!$this->numFonts){ $this->selectFont('./fonts/Helvetica'); } // converts a number or a float to a string so it can get the width $text = "$text"; // hmm, this is where it all starts to get tricky - use the font information to // calculate the width of each character, add them up and convert to user units $w=0; $len=strlen($text); $cf = $this->currentFont; for ($i=0;$i<$len;$i++){ $f=1; $directive = $this->PRVTcheckTextDirective($text,$i,$f); if ($directive){ if ($f){ $this->setCurrentFont(); $cf = $this->currentFont; } $i=$i+$directive-1; } else { $char=ord($text[$i]); if (isset($this->fonts[$cf]['differences'][$char])){ // then this character is being replaced by another $name = $this->fonts[$cf]['differences'][$char]; if (isset($this->fonts[$cf]['C'][$name]['WX'])){ $w+=$this->fonts[$cf]['C'][$name]['WX']; } } else if (isset($this->fonts[$cf]['C'][$char]['WX'])){ $w+=$this->fonts[$cf]['C'][$char]['WX']; } else { /// GLPI fix add default width $w += 560; } } } $this->currentTextState = $store_currentTextState; $this->setCurrentFont(); return $w*$size/1000; } /** * do a part of the calculation for sorting out the justification of the text * * @access private */ function PRVTadjustWrapText($text,$actual,$width,&$x,&$adjust,$justification){ switch ($justification){ case 'left': return; break; case 'right': $x+=$width-$actual; break; case 'center': case 'centre': $x+=($width-$actual)/2; break; case 'full': // count the number of words $words = explode(' ',$text); $nspaces=count($words)-1; if ($nspaces>0){ $adjust = ($width-$actual)/$nspaces; } else { $adjust=0; } break; } } /** * add text to the page, but ensure that it fits within a certain width * if it does not fit then put in as much as possible, splitting at word boundaries * and return the remainder. * justification and angle can also be specified for the text */ function addTextWrap($x,$y,$width,$size,$text,$justification='left',$angle=0,$test=0){ // this will display the text, and if it goes beyond the width $width, will backtrack to the // previous space or hyphen, and return the remainder of the text. // $justification can be set to 'left','right','center','centre','full' // need to store the initial text state, as this will change during the width calculation // but will need to be re-set before printing, so that the chars work out right $store_currentTextState = $this->currentTextState; if (!$this->numFonts){$this->selectFont('./fonts/Helvetica');} if ($width<=0){ // error, pretend it printed ok, otherwise risking a loop return ''; } $w=0; $break=0; $breakWidth=0; $len=strlen($text); $cf = $this->currentFont; $tw = $width/$size*1000; for ($i=0;$i<$len;$i++){ $f=1; $directive = $this->PRVTcheckTextDirective($text,$i,$f); if ($directive){ if ($f){ $this->setCurrentFont(); $cf = $this->currentFont; } $i=$i+$directive-1; } else { $cOrd = ord($text[$i]); if (isset($this->fonts[$cf]['differences'][$cOrd])){ // then this character is being replaced by another $cOrd2 = $this->fonts[$cf]['differences'][$cOrd]; } else { $cOrd2 = $cOrd; } if (isset($this->fonts[$cf]['C'][$cOrd2]['WX'])){ $w+=$this->fonts[$cf]['C'][$cOrd2]['WX']; } else { /// GLPI fix add default width when not set $w+=560; } if ($w>$tw){ // then we need to truncate this line if ($break>0){ // then we have somewhere that we can split :) if ($text[$break]==' '){ $tmp = substr($text,0,$break); } else { $tmp = substr($text,0,$break+1); } $adjust=0; $this->PRVTadjustWrapText($tmp,$breakWidth,$width,$x,$adjust,$justification); // reset the text state $this->currentTextState = $store_currentTextState; $this->setCurrentFont(); if (!$test){ $this->addText($x,$y,$size,$tmp,$angle,$adjust); } return substr($text,$break+1); } else { // just split before the current character $tmp = substr($text,0,$i); $adjust=0; $ctmp=ord($text[$i]); if (isset($this->fonts[$cf]['differences'][$ctmp])){ $ctmp=$this->fonts[$cf]['differences'][$ctmp]; } $tmpw=($w-$this->fonts[$cf]['C'][$ctmp]['WX'])*$size/1000; $this->PRVTadjustWrapText($tmp,$tmpw,$width,$x,$adjust,$justification); // reset the text state $this->currentTextState = $store_currentTextState; $this->setCurrentFont(); if (!$test){ $this->addText($x,$y,$size,$tmp,$angle,$adjust); } return substr($text,$i); } } if ($text[$i]=='-'){ $break=$i; $breakWidth = $w*$size/1000; } if ($text[$i]==' '){ $break=$i; $ctmp=ord($text[$i]); if (isset($this->fonts[$cf]['differences'][$ctmp])){ $ctmp=$this->fonts[$cf]['differences'][$ctmp]; } $breakWidth = ($w-$this->fonts[$cf]['C'][$ctmp]['WX'])*$size/1000; } } } // then there was no need to break this line if ($justification=='full'){ $justification='left'; } $adjust=0; $tmpw=$w*$size/1000; $this->PRVTadjustWrapText($text,$tmpw,$width,$x,$adjust,$justification); // reset the text state $this->currentTextState = $store_currentTextState; $this->setCurrentFont(); if (!$test){ $this->addText($x,$y,$size,$text,$angle,$adjust,$angle); } return ''; } /** * this will be called at a new page to return the state to what it was on the * end of the previous page, before the stack was closed down * This is to get around not being able to have open 'q' across pages * */ function saveState($pageEnd=0){ if ($pageEnd){ // this will be called at a new page to return the state to what it was on the // end of the previous page, before the stack was closed down // This is to get around not being able to have open 'q' across pages $opt = $this->stateStack[$pageEnd]; // ok to use this as stack starts numbering at 1 $this->setColor($opt['col']['r'],$opt['col']['g'],$opt['col']['b'],1); $this->setStrokeColor($opt['str']['r'],$opt['str']['g'],$opt['str']['b'],1); $this->objects[$this->currentContents]['c'].="\n".$opt['lin']; // $this->currentLineStyle = $opt['lin']; } else { $this->nStateStack++; $this->stateStack[$this->nStateStack]=array( 'col'=>$this->currentColour ,'str'=>$this->currentStrokeColour ,'lin'=>$this->currentLineStyle ); } $this->objects[$this->currentContents]['c'].="\nq"; } /** * restore a previously saved state */ function restoreState($pageEnd=0){ if (!$pageEnd){ $n = $this->nStateStack; $this->currentColour = $this->stateStack[$n]['col']; $this->currentStrokeColour = $this->stateStack[$n]['str']; $this->objects[$this->currentContents]['c'].="\n".$this->stateStack[$n]['lin']; $this->currentLineStyle = $this->stateStack[$n]['lin']; unset($this->stateStack[$n]); $this->nStateStack--; } $this->objects[$this->currentContents]['c'].="\nQ"; } /** * make a loose object, the output will go into this object, until it is closed, then will revert to * the current one. * this object will not appear until it is included within a page. * the function will return the object number */ function openObject(){ $this->nStack++; $this->stack[$this->nStack]=array('c'=>$this->currentContents,'p'=>$this->currentPage); // add a new object of the content type, to hold the data flow $this->numObj++; $this->o_contents($this->numObj,'new'); $this->currentContents=$this->numObj; $this->looseObjects[$this->numObj]=1; return $this->numObj; } /** * open an existing object for editing */ function reopenObject($id){ $this->nStack++; $this->stack[$this->nStack]=array('c'=>$this->currentContents,'p'=>$this->currentPage); $this->currentContents=$id; // also if this object is the primary contents for a page, then set the current page to its parent if (isset($this->objects[$id]['onPage'])){ $this->currentPage = $this->objects[$id]['onPage']; } } /** * close an object */ function closeObject(){ // close the object, as long as there was one open in the first place, which will be indicated by // an objectId on the stack. if ($this->nStack>0){ $this->currentContents=$this->stack[$this->nStack]['c']; $this->currentPage=$this->stack[$this->nStack]['p']; $this->nStack--; // easier to probably not worry about removing the old entries, they will be overwritten // if there are new ones. } } /** * stop an object from appearing on pages from this point on */ function stopObject($id){ // if an object has been appearing on pages up to now, then stop it, this page will // be the last one that could contian it. if (isset($this->addLooseObjects[$id])){ $this->addLooseObjects[$id]=''; } } /** * after an object has been created, it wil only show if it has been added, using this function. */ function addObject($id,$options='add'){ // add the specified object to the page if (isset($this->looseObjects[$id]) && $this->currentContents!=$id){ // then it is a valid object, and it is not being added to itself switch($options){ case 'all': // then this object is to be added to this page (done in the next block) and // all future new pages. $this->addLooseObjects[$id]='all'; case 'add': if (isset($this->objects[$this->currentContents]['onPage'])){ // then the destination contents is the primary for the page // (though this object is actually added to that page) $this->o_page($this->objects[$this->currentContents]['onPage'],'content',$id); } break; case 'even': $this->addLooseObjects[$id]='even'; $pageObjectId=$this->objects[$this->currentContents]['onPage']; if ($this->objects[$pageObjectId]['info']['pageNum']%2==0){ $this->addObject($id); // hacky huh :) } break; case 'odd': $this->addLooseObjects[$id]='odd'; $pageObjectId=$this->objects[$this->currentContents]['onPage']; if ($this->objects[$pageObjectId]['info']['pageNum']%2==1){ $this->addObject($id); // hacky huh :) } break; case 'next': $this->addLooseObjects[$id]='all'; break; case 'nexteven': $this->addLooseObjects[$id]='even'; break; case 'nextodd': $this->addLooseObjects[$id]='odd'; break; } } } /** * add content to the documents info object */ function addInfo($label,$value=0){ // this will only work if the label is one of the valid ones. // modify this so that arrays can be passed as well. // if $label is an array then assume that it is key=>value pairs // else assume that they are both scalar, anything else will probably error if (is_array($label)){ foreach ($label as $l=>$v){ $this->o_info($this->infoObject,$l,$v); } } else { $this->o_info($this->infoObject,$label,$value); } } /** * set the viewer preferences of the document, it is up to the browser to obey these. */ function setPreferences($label,$value=0){ // this will only work if the label is one of the valid ones. if (is_array($label)){ foreach ($label as $l=>$v){ $this->o_catalog($this->catalogId,'viewerPreferences',array($l=>$v)); } } else { $this->o_catalog($this->catalogId,'viewerPreferences',array($label=>$value)); } } /** * extract an integer from a position in a byte stream * * @access private */ function PRVT_getBytes(&$data,$pos,$num){ // return the integer represented by $num bytes from $pos within $data $ret=0; for ($i=0;$i<$num;$i++){ $ret=$ret*256; $ret+=ord($data[$pos+$i]); } return $ret; } /** * add a PNG image into the document, from a file * this should work with remote files */ function addPngFromFile($file,$x,$y,$w=0,$h=0){ // read in a png file, interpret it, then add to the system $error=0; $tmp = get_magic_quotes_runtime(); if ($tmp) set_magic_quotes_runtime(0); $fp = @fopen($file,'rb'); if ($fp){ $data=''; while(!feof($fp)){ $data .= fread($fp,1024); } fclose($fp); } else { $error = 1; $errormsg = 'trouble opening file: '.$file; } if ($tmp) set_magic_quotes_runtime($tmp); if (!$error){ $header = chr(137).chr(80).chr(78).chr(71).chr(13).chr(10).chr(26).chr(10); if (substr($data,0,8)!=$header){ $error=1; $errormsg = 'this file does not have a valid header'; } } if (!$error){ // set pointer $p = 8; $len = strlen($data); // cycle through the file, identifying chunks $haveHeader=0; $info=array(); $idata=''; $pdata=''; while ($p<$len){ $chunkLen = $this->PRVT_getBytes($data,$p,4); $chunkType = substr($data,$p+4,4); // echo $chunkType.' - '.$chunkLen.'
    '; switch($chunkType){ case 'IHDR': // this is where all the file information comes from $info['width']=$this->PRVT_getBytes($data,$p+8,4); $info['height']=$this->PRVT_getBytes($data,$p+12,4); $info['bitDepth']=ord($data[$p+16]); $info['colorType']=ord($data[$p+17]); $info['compressionMethod']=ord($data[$p+18]); $info['filterMethod']=ord($data[$p+19]); $info['interlaceMethod']=ord($data[$p+20]); //print_r($info); $haveHeader=1; if ($info['compressionMethod']!=0){ $error=1; $errormsg = 'unsupported compression method'; } if ($info['filterMethod']!=0){ $error=1; $errormsg = 'unsupported filter method'; } break; case 'PLTE': $pdata.=substr($data,$p+8,$chunkLen); break; case 'IDAT': $idata.=substr($data,$p+8,$chunkLen); break; case 'tRNS': //this chunk can only occur once and it must occur after the PLTE chunk and before IDAT chunk //print "tRNS found, color type = ".$info['colorType']."
    "; $transparency = array(); if ($info['colorType'] == 3) { // indexed color, rbg /* corresponding to entries in the plte chunk Alpha for palette index 0: 1 byte Alpha for palette index 1: 1 byte ...etc... */ // there will be one entry for each palette entry. up until the last non-opaque entry. // set up an array, stretching over all palette entries which will be o (opaque) or 1 (transparent) $transparency['type']='indexed'; $numPalette = strlen($pdata)/3; $trans=0; for ($i=$chunkLen;$i>=0;$i--){ if (ord($data[$p+8+$i])==0){ $trans=$i; } } $transparency['data'] = $trans; } elseif($info['colorType'] == 0) { // grayscale /* corresponding to entries in the plte chunk Gray: 2 bytes, range 0 .. (2^bitdepth)-1 */ // $transparency['grayscale']=$this->PRVT_getBytes($data,$p+8,2); // g = grayscale $transparency['type']='indexed'; $transparency['data'] = ord($data[$p+8+1]); } elseif($info['colorType'] == 2) { // truecolor /* corresponding to entries in the plte chunk Red: 2 bytes, range 0 .. (2^bitdepth)-1 Green: 2 bytes, range 0 .. (2^bitdepth)-1 Blue: 2 bytes, range 0 .. (2^bitdepth)-1 */ $transparency['r']=$this->PRVT_getBytes($data,$p+8,2); // r from truecolor $transparency['g']=$this->PRVT_getBytes($data,$p+10,2); // g from truecolor $transparency['b']=$this->PRVT_getBytes($data,$p+12,2); // b from truecolor } else { //unsupported transparency type } // KS End new code break; default: break; } $p += $chunkLen+12; } if(!$haveHeader){ $error = 1; $errormsg = 'information header is missing'; } if (isset($info['interlaceMethod']) && $info['interlaceMethod']){ $error = 1; $errormsg = 'There appears to be no support for interlaced images in pdf.'; } } if (!$error && $info['bitDepth'] > 8){ $error = 1; $errormsg = 'only bit depth of 8 or less is supported'; } if (!$error){ if ($info['colorType']!=2 && $info['colorType']!=0 && $info['colorType']!=3){ $error = 1; $errormsg = 'transparancey alpha channel not supported, transparency only supported for palette images.'; } else { switch ($info['colorType']){ case 3: $color = 'DeviceRGB'; $ncolor=1; break; case 2: $color = 'DeviceRGB'; $ncolor=3; break; case 0: $color = 'DeviceGray'; $ncolor=1; break; } } } if ($error){ $this->addMessage('PNG error - ('.$file.') '.$errormsg); return; } if ($w==0){ $w=$h/$info['height']*$info['width']; } if ($h==0){ $h=$w*$info['height']/$info['width']; } //print_r($info); // so this image is ok... add it in. $this->numImages++; $im=$this->numImages; $label='I'.$im; $this->numObj++; // $this->o_image($this->numObj,'new',array('label'=>$label,'data'=>$idata,'iw'=>$w,'ih'=>$h,'type'=>'png','ic'=>$info['width'])); $options = array('label'=>$label,'data'=>$idata,'bitsPerComponent'=>$info['bitDepth'],'pdata'=>$pdata ,'iw'=>$info['width'],'ih'=>$info['height'],'type'=>'png','color'=>$color,'ncolor'=>$ncolor); if (isset($transparency)){ $options['transparency']=$transparency; } $this->o_image($this->numObj,'new',$options); $this->objects[$this->currentContents]['c'].="\nq"; $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$w)." 0 0 ".sprintf('%.3f',$h)." ".sprintf('%.3f',$x)." ".sprintf('%.3f',$y)." cm"; $this->objects[$this->currentContents]['c'].="\n/".$label.' Do'; $this->objects[$this->currentContents]['c'].="\nQ"; } /** * add a JPEG image into the document, from a file */ function addJpegFromFile($img,$x,$y,$w=0,$h=0){ // attempt to add a jpeg image straight from a file, using no GD commands // note that this function is unable to operate on a remote file. if (!file_exists($img)){ return; } $tmp=getimagesize($img); $imageWidth=$tmp[0]; $imageHeight=$tmp[1]; if (isset($tmp['channels'])){ $channels = $tmp['channels']; } else { $channels = 3; } if ($w<=0 && $h<=0){ $w=$imageWidth; } if ($w==0){ $w=$h/$imageHeight*$imageWidth; } if ($h==0){ $h=$w*$imageHeight/$imageWidth; } $fp=fopen($img,'rb'); $tmp = get_magic_quotes_runtime(); if ($tmp) set_magic_quotes_runtime(0); $data = fread($fp,filesize($img)); if ($tmp) set_magic_quotes_runtime($tmp); fclose($fp); $this->addJpegImage_common($data,$x,$y,$w,$h,$imageWidth,$imageHeight,$channels); } /** * add an image into the document, from a GD object * this function is not all that reliable, and I would probably encourage people to use * the file based functions */ function addImage(&$img,$x,$y,$w=0,$h=0,$quality=75){ // add a new image into the current location, as an external object // add the image at $x,$y, and with width and height as defined by $w & $h // note that this will only work with full colour images and makes them jpg images for display // later versions could present lossless image formats if there is interest. // there seems to be some problem here in that images that have quality set above 75 do not appear // not too sure why this is, but in the meantime I have restricted this to 75. if ($quality>75){ $quality=75; } // if the width or height are set to zero, then set the other one based on keeping the image // height/width ratio the same, if they are both zero, then give up :) $imageWidth=imagesx($img); $imageHeight=imagesy($img); if ($w<=0 && $h<=0){ return; } if ($w==0){ $w=$h/$imageHeight*$imageWidth; } if ($h==0){ $h=$w*$imageHeight/$imageWidth; } // gotta get the data out of the img.. // so I write to a temp file, and then read it back.. soo ugly, my apologies. $tmpDir='/tmp'; $tmpName=tempnam($tmpDir,'img'); imagejpeg($img,$tmpName,$quality); $fp=fopen($tmpName,'rb'); $tmp = get_magic_quotes_runtime(); if ($tmp) set_magic_quotes_runtime(0); $fp = @fopen($tmpName,'rb'); if ($fp){ $data=''; while(!feof($fp)){ $data .= fread($fp,1024); } fclose($fp); } else { $error = 1; $errormsg = 'trouble opening file'; } // $data = fread($fp,filesize($tmpName)); if ($tmp) set_magic_quotes_runtime($tmp); // fclose($fp); unlink($tmpName); $this->addJpegImage_common($data,$x,$y,$w,$h,$imageWidth,$imageHeight); } /** * common code used by the two JPEG adding functions * * @access private */ function addJpegImage_common(&$data,$x,$y,$w=0,$h=0,$imageWidth,$imageHeight,$channels=3){ // note that this function is not to be called externally // it is just the common code between the GD and the file options $this->numImages++; $im=$this->numImages; $label='I'.$im; $this->numObj++; $this->o_image($this->numObj,'new',array('label'=>$label,'data'=>$data,'iw'=>$imageWidth,'ih'=>$imageHeight,'channels'=>$channels)); $this->objects[$this->currentContents]['c'].="\nq"; $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$w)." 0 0 ".sprintf('%.3f',$h)." ".sprintf('%.3f',$x)." ".sprintf('%.3f',$y)." cm"; $this->objects[$this->currentContents]['c'].="\n/".$label.' Do'; $this->objects[$this->currentContents]['c'].="\nQ"; } /** * specify where the document should open when it first starts */ function openHere($style,$a=0,$b=0,$c=0){ // this function will open the document at a specified page, in a specified style // the values for style, and the required paramters are: // 'XYZ' left, top, zoom // 'Fit' // 'FitH' top // 'FitV' left // 'FitR' left,bottom,right // 'FitB' // 'FitBH' top // 'FitBV' left $this->numObj++; $this->o_destination($this->numObj,'new',array('page'=>$this->currentPage,'type'=>$style,'p1'=>$a,'p2'=>$b,'p3'=>$c)); $id = $this->catalogId; $this->o_catalog($id,'openHere',$this->numObj); } /** * create a labelled destination within the document */ function addDestination($label,$style,$a=0,$b=0,$c=0){ // associates the given label with the destination, it is done this way so that a destination can be specified after // it has been linked to // styles are the same as the 'openHere' function $this->numObj++; $this->o_destination($this->numObj,'new',array('page'=>$this->currentPage,'type'=>$style,'p1'=>$a,'p2'=>$b,'p3'=>$c)); $id = $this->numObj; // store the label->idf relationship, note that this means that labels can be used only once $this->destinations["$label"]=$id; } /** * define font families, this is used to initialize the font families for the default fonts * and for the user to add new ones for their fonts. The default bahavious can be overridden should * that be desired. */ function setFontFamily($family,$options=''){ if (!is_array($options)){ if ($family=='init'){ // set the known family groups // these font families will be used to enable bold and italic markers to be included // within text streams. html forms will be used... $this->fontFamilies['Helvetica.afm']=array( 'b'=>'Helvetica-Bold.afm' ,'i'=>'Helvetica-Oblique.afm' ,'bi'=>'Helvetica-BoldOblique.afm' ,'ib'=>'Helvetica-BoldOblique.afm' ); $this->fontFamilies['Courier.afm']=array( 'b'=>'Courier-Bold.afm' ,'i'=>'Courier-Oblique.afm' ,'bi'=>'Courier-BoldOblique.afm' ,'ib'=>'Courier-BoldOblique.afm' ); $this->fontFamilies['Times-Roman.afm']=array( 'b'=>'Times-Bold.afm' ,'i'=>'Times-Italic.afm' ,'bi'=>'Times-BoldItalic.afm' ,'ib'=>'Times-BoldItalic.afm' ); } } else { // the user is trying to set a font family // note that this can also be used to set the base ones to something else if (strlen($family)){ $this->fontFamilies[$family] = $options; } } } /** * used to add messages for use in debugging */ function addMessage($message){ $this->messages.=$message."\n"; } /** * a few functions which should allow the document to be treated transactionally. */ function transaction($action){ switch ($action){ case 'start': // store all the data away into the checkpoint variable $data = get_object_vars($this); $this->checkpoint = $data; unset($data); break; case 'commit': if (is_array($this->checkpoint) && isset($this->checkpoint['checkpoint'])){ $tmp = $this->checkpoint['checkpoint']; $this->checkpoint = $tmp; unset($tmp); } else { $this->checkpoint=''; } break; case 'rewind': // do not destroy the current checkpoint, but move us back to the state then, so that we can try again if (is_array($this->checkpoint)){ // can only abort if were inside a checkpoint $tmp = $this->checkpoint; foreach ($tmp as $k=>$v){ if ($k != 'checkpoint'){ $this->$k=$v; } } unset($tmp); } break; case 'abort': if (is_array($this->checkpoint)){ // can only abort if were inside a checkpoint $tmp = $this->checkpoint; foreach ($tmp as $k=>$v){ $this->$k=$v; } unset($tmp); } break; } } } // end of class ?> glpi-0.84.3+dfsg.1/lib/ezpdf/fonts/000077500000000000000000000000001226600447100166305ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/ezpdf/fonts/Helvetica.afm000066400000000000000000002210641226600447100212260ustar00rootroot00000000000000StartFontMetrics 4.1 Comment Copyright (c) 1985, 1987, 1989, 1990, 1997 Adobe Systems Incorporated. All Rights Reserved. Comment Creation Date: Thu May 1 12:38:23 1997 Comment UniqueID 43054 Comment VMusage 37069 48094 FontName Helvetica FullName Helvetica FamilyName Helvetica Weight Medium ItalicAngle 0 IsFixedPitch false CharacterSet ExtendedRoman FontBBox -166 -225 1000 931 UnderlinePosition -100 UnderlineThickness 50 Version 002.000 Notice Copyright (c) 1985, 1987, 1989, 1990, 1997 Adobe Systems Incorporated. All Rights Reserved.Helvetica is a trademark of Linotype-Hell AG and/or its subsidiaries. EncodingScheme AdobeStandardEncoding CapHeight 718 XHeight 523 Ascender 718 Descender -207 StdHW 76 StdVW 88 StartCharMetrics 315 C 32 ; WX 278 ; N space ; B 0 0 0 0 ; C 33 ; WX 278 ; N exclam ; B 90 0 187 718 ; C 34 ; WX 355 ; N quotedbl ; B 70 463 285 718 ; C 35 ; WX 556 ; N numbersign ; B 28 0 529 688 ; C 36 ; WX 556 ; N dollar ; B 32 -115 520 775 ; C 37 ; WX 889 ; N percent ; B 39 -19 850 703 ; C 38 ; WX 667 ; N ampersand ; B 44 -15 645 718 ; C 39 ; WX 222 ; N quoteright ; B 53 463 157 718 ; C 40 ; WX 333 ; N parenleft ; B 68 -207 299 733 ; C 41 ; WX 333 ; N parenright ; B 34 -207 265 733 ; C 42 ; WX 389 ; N asterisk ; B 39 431 349 718 ; C 43 ; WX 584 ; N plus ; B 39 0 545 505 ; C 44 ; WX 278 ; N comma ; B 87 -147 191 106 ; C 45 ; WX 333 ; N hyphen ; B 44 232 289 322 ; C 46 ; WX 278 ; N period ; B 87 0 191 106 ; C 47 ; WX 278 ; N slash ; B -17 -19 295 737 ; C 48 ; WX 556 ; N zero ; B 37 -19 519 703 ; C 49 ; WX 556 ; N one ; B 101 0 359 703 ; C 50 ; WX 556 ; N two ; B 26 0 507 703 ; C 51 ; WX 556 ; N three ; B 34 -19 522 703 ; C 52 ; WX 556 ; N four ; B 25 0 523 703 ; C 53 ; WX 556 ; N five ; B 32 -19 514 688 ; C 54 ; WX 556 ; N six ; B 38 -19 518 703 ; C 55 ; WX 556 ; N seven ; B 37 0 523 688 ; C 56 ; WX 556 ; N eight ; B 38 -19 517 703 ; C 57 ; WX 556 ; N nine ; B 42 -19 514 703 ; C 58 ; WX 278 ; N colon ; B 87 0 191 516 ; C 59 ; WX 278 ; N semicolon ; B 87 -147 191 516 ; C 60 ; WX 584 ; N less ; B 48 11 536 495 ; C 61 ; WX 584 ; N equal ; B 39 115 545 390 ; C 62 ; WX 584 ; N greater ; B 48 11 536 495 ; C 63 ; WX 556 ; N question ; B 56 0 492 727 ; C 64 ; WX 1015 ; N at ; B 147 -19 868 737 ; C 65 ; WX 667 ; N A ; B 14 0 654 718 ; C 66 ; WX 667 ; N B ; B 74 0 627 718 ; C 67 ; WX 722 ; N C ; B 44 -19 681 737 ; C 68 ; WX 722 ; N D ; B 81 0 674 718 ; C 69 ; WX 667 ; N E ; B 86 0 616 718 ; C 70 ; WX 611 ; N F ; B 86 0 583 718 ; C 71 ; WX 778 ; N G ; B 48 -19 704 737 ; C 72 ; WX 722 ; N H ; B 77 0 646 718 ; C 73 ; WX 278 ; N I ; B 91 0 188 718 ; C 74 ; WX 500 ; N J ; B 17 -19 428 718 ; C 75 ; WX 667 ; N K ; B 76 0 663 718 ; C 76 ; WX 556 ; N L ; B 76 0 537 718 ; C 77 ; WX 833 ; N M ; B 73 0 761 718 ; C 78 ; WX 722 ; N N ; B 76 0 646 718 ; C 79 ; WX 778 ; N O ; B 39 -19 739 737 ; C 80 ; WX 667 ; N P ; B 86 0 622 718 ; C 81 ; WX 778 ; N Q ; B 39 -56 739 737 ; C 82 ; WX 722 ; N R ; B 88 0 684 718 ; C 83 ; WX 667 ; N S ; B 49 -19 620 737 ; C 84 ; WX 611 ; N T ; B 14 0 597 718 ; C 85 ; WX 722 ; N U ; B 79 -19 644 718 ; C 86 ; WX 667 ; N V ; B 20 0 647 718 ; C 87 ; WX 944 ; N W ; B 16 0 928 718 ; C 88 ; WX 667 ; N X ; B 19 0 648 718 ; C 89 ; WX 667 ; N Y ; B 14 0 653 718 ; C 90 ; WX 611 ; N Z ; B 23 0 588 718 ; C 91 ; WX 278 ; N bracketleft ; B 63 -196 250 722 ; C 92 ; WX 278 ; N backslash ; B -17 -19 295 737 ; C 93 ; WX 278 ; N bracketright ; B 28 -196 215 722 ; C 94 ; WX 469 ; N asciicircum ; B -14 264 483 688 ; C 95 ; WX 556 ; N underscore ; B 0 -125 556 -75 ; C 96 ; WX 222 ; N quoteleft ; B 65 470 169 725 ; C 97 ; WX 556 ; N a ; B 36 -15 530 538 ; C 98 ; WX 556 ; N b ; B 58 -15 517 718 ; C 99 ; WX 500 ; N c ; B 30 -15 477 538 ; C 100 ; WX 556 ; N d ; B 35 -15 499 718 ; C 101 ; WX 556 ; N e ; B 40 -15 516 538 ; C 102 ; WX 278 ; N f ; B 14 0 262 728 ; L i fi ; L l fl ; C 103 ; WX 556 ; N g ; B 40 -220 499 538 ; C 104 ; WX 556 ; N h ; B 65 0 491 718 ; C 105 ; WX 222 ; N i ; B 67 0 155 718 ; C 106 ; WX 222 ; N j ; B -16 -210 155 718 ; C 107 ; WX 500 ; N k ; B 67 0 501 718 ; C 108 ; WX 222 ; N l ; B 67 0 155 718 ; C 109 ; WX 833 ; N m ; B 65 0 769 538 ; C 110 ; WX 556 ; N n ; B 65 0 491 538 ; C 111 ; WX 556 ; N o ; B 35 -14 521 538 ; C 112 ; WX 556 ; N p ; B 58 -207 517 538 ; C 113 ; WX 556 ; N q ; B 35 -207 494 538 ; C 114 ; WX 333 ; N r ; B 77 0 332 538 ; C 115 ; WX 500 ; N s ; B 32 -15 464 538 ; C 116 ; WX 278 ; N t ; B 14 -7 257 669 ; C 117 ; WX 556 ; N u ; B 68 -15 489 523 ; C 118 ; WX 500 ; N v ; B 8 0 492 523 ; C 119 ; WX 722 ; N w ; B 14 0 709 523 ; C 120 ; WX 500 ; N x ; B 11 0 490 523 ; C 121 ; WX 500 ; N y ; B 11 -214 489 523 ; C 122 ; WX 500 ; N z ; B 31 0 469 523 ; C 123 ; WX 334 ; N braceleft ; B 42 -196 292 722 ; C 124 ; WX 260 ; N bar ; B 94 -225 167 775 ; C 125 ; WX 334 ; N braceright ; B 42 -196 292 722 ; C 126 ; WX 584 ; N asciitilde ; B 61 180 523 326 ; C 161 ; WX 333 ; N exclamdown ; B 118 -195 215 523 ; C 162 ; WX 556 ; N cent ; B 51 -115 513 623 ; C 163 ; WX 556 ; N sterling ; B 33 -16 539 718 ; C 164 ; WX 167 ; N fraction ; B -166 -19 333 703 ; C 165 ; WX 556 ; N yen ; B 3 0 553 688 ; C 166 ; WX 556 ; N florin ; B -11 -207 501 737 ; C 167 ; WX 556 ; N section ; B 43 -191 512 737 ; C 168 ; WX 556 ; N currency ; B 28 99 528 603 ; C 169 ; WX 191 ; N quotesingle ; B 59 463 132 718 ; C 170 ; WX 333 ; N quotedblleft ; B 38 470 307 725 ; C 171 ; WX 556 ; N guillemotleft ; B 97 108 459 446 ; C 172 ; WX 333 ; N guilsinglleft ; B 88 108 245 446 ; C 173 ; WX 333 ; N guilsinglright ; B 88 108 245 446 ; C 174 ; WX 500 ; N fi ; B 14 0 434 728 ; C 175 ; WX 500 ; N fl ; B 14 0 432 728 ; C 177 ; WX 556 ; N endash ; B 0 240 556 313 ; C 178 ; WX 556 ; N dagger ; B 43 -159 514 718 ; C 179 ; WX 556 ; N daggerdbl ; B 43 -159 514 718 ; C 180 ; WX 278 ; N periodcentered ; B 77 190 202 315 ; C 182 ; WX 537 ; N paragraph ; B 18 -173 497 718 ; C 183 ; WX 350 ; N bullet ; B 18 202 333 517 ; C 184 ; WX 222 ; N quotesinglbase ; B 53 -149 157 106 ; C 185 ; WX 333 ; N quotedblbase ; B 26 -149 295 106 ; C 186 ; WX 333 ; N quotedblright ; B 26 463 295 718 ; C 187 ; WX 556 ; N guillemotright ; B 97 108 459 446 ; C 188 ; WX 1000 ; N ellipsis ; B 115 0 885 106 ; C 189 ; WX 1000 ; N perthousand ; B 7 -19 994 703 ; C 191 ; WX 611 ; N questiondown ; B 91 -201 527 525 ; C 193 ; WX 333 ; N grave ; B 14 593 211 734 ; C 194 ; WX 333 ; N acute ; B 122 593 319 734 ; C 195 ; WX 333 ; N circumflex ; B 21 593 312 734 ; C 196 ; WX 333 ; N tilde ; B -4 606 337 722 ; C 197 ; WX 333 ; N macron ; B 10 627 323 684 ; C 198 ; WX 333 ; N breve ; B 13 595 321 731 ; C 199 ; WX 333 ; N dotaccent ; B 121 604 212 706 ; C 200 ; WX 333 ; N dieresis ; B 40 604 293 706 ; C 202 ; WX 333 ; N ring ; B 75 572 259 756 ; C 203 ; WX 333 ; N cedilla ; B 45 -225 259 0 ; C 205 ; WX 333 ; N hungarumlaut ; B 31 593 409 734 ; C 206 ; WX 333 ; N ogonek ; B 73 -225 287 0 ; C 207 ; WX 333 ; N caron ; B 21 593 312 734 ; C 208 ; WX 1000 ; N emdash ; B 0 240 1000 313 ; C 225 ; WX 1000 ; N AE ; B 8 0 951 718 ; C 227 ; WX 370 ; N ordfeminine ; B 24 405 346 737 ; C 232 ; WX 556 ; N Lslash ; B -20 0 537 718 ; C 233 ; WX 778 ; N Oslash ; B 39 -19 740 737 ; C 234 ; WX 1000 ; N OE ; B 36 -19 965 737 ; C 235 ; WX 365 ; N ordmasculine ; B 25 405 341 737 ; C 241 ; WX 889 ; N ae ; B 36 -15 847 538 ; C 245 ; WX 278 ; N dotlessi ; B 95 0 183 523 ; C 248 ; WX 222 ; N lslash ; B -20 0 242 718 ; C 249 ; WX 611 ; N oslash ; B 28 -22 537 545 ; C 250 ; WX 944 ; N oe ; B 35 -15 902 538 ; C 251 ; WX 611 ; N germandbls ; B 67 -15 571 728 ; C -1 ; WX 278 ; N Idieresis ; B 13 0 266 901 ; C -1 ; WX 556 ; N eacute ; B 40 -15 516 734 ; C -1 ; WX 556 ; N abreve ; B 36 -15 530 731 ; C -1 ; WX 556 ; N uhungarumlaut ; B 68 -15 521 734 ; C -1 ; WX 556 ; N ecaron ; B 40 -15 516 734 ; C -1 ; WX 667 ; N Ydieresis ; B 14 0 653 901 ; C -1 ; WX 584 ; N divide ; B 39 -19 545 524 ; C -1 ; WX 667 ; N Yacute ; B 14 0 653 929 ; C -1 ; WX 667 ; N Acircumflex ; B 14 0 654 929 ; C -1 ; WX 556 ; N aacute ; B 36 -15 530 734 ; C -1 ; WX 722 ; N Ucircumflex ; B 79 -19 644 929 ; C -1 ; WX 500 ; N yacute ; B 11 -214 489 734 ; C -1 ; WX 500 ; N scommaaccent ; B 32 -225 464 538 ; C -1 ; WX 556 ; N ecircumflex ; B 40 -15 516 734 ; C -1 ; WX 722 ; N Uring ; B 79 -19 644 931 ; C -1 ; WX 722 ; N Udieresis ; B 79 -19 644 901 ; C -1 ; WX 556 ; N aogonek ; B 36 -220 547 538 ; C -1 ; WX 722 ; N Uacute ; B 79 -19 644 929 ; C -1 ; WX 556 ; N uogonek ; B 68 -225 519 523 ; C -1 ; WX 667 ; N Edieresis ; B 86 0 616 901 ; C -1 ; WX 722 ; N Dcroat ; B 0 0 674 718 ; C -1 ; WX 250 ; N commaaccent ; B 87 -225 181 -40 ; C -1 ; WX 737 ; N copyright ; B -14 -19 752 737 ; C -1 ; WX 667 ; N Emacron ; B 86 0 616 879 ; C -1 ; WX 500 ; N ccaron ; B 30 -15 477 734 ; C -1 ; WX 556 ; N aring ; B 36 -15 530 756 ; C -1 ; WX 722 ; N Ncommaaccent ; B 76 -225 646 718 ; C -1 ; WX 222 ; N lacute ; B 67 0 264 929 ; C -1 ; WX 556 ; N agrave ; B 36 -15 530 734 ; C -1 ; WX 611 ; N Tcommaaccent ; B 14 -225 597 718 ; C -1 ; WX 722 ; N Cacute ; B 44 -19 681 929 ; C -1 ; WX 556 ; N atilde ; B 36 -15 530 722 ; C -1 ; WX 667 ; N Edotaccent ; B 86 0 616 901 ; C -1 ; WX 500 ; N scaron ; B 32 -15 464 734 ; C -1 ; WX 500 ; N scedilla ; B 32 -225 464 538 ; C -1 ; WX 278 ; N iacute ; B 95 0 292 734 ; C -1 ; WX 471 ; N lozenge ; B 10 0 462 728 ; C -1 ; WX 722 ; N Rcaron ; B 88 0 684 929 ; C -1 ; WX 778 ; N Gcommaaccent ; B 48 -225 704 737 ; C -1 ; WX 556 ; N ucircumflex ; B 68 -15 489 734 ; C -1 ; WX 556 ; N acircumflex ; B 36 -15 530 734 ; C -1 ; WX 667 ; N Amacron ; B 14 0 654 879 ; C -1 ; WX 333 ; N rcaron ; B 61 0 352 734 ; C -1 ; WX 500 ; N ccedilla ; B 30 -225 477 538 ; C -1 ; WX 611 ; N Zdotaccent ; B 23 0 588 901 ; C -1 ; WX 667 ; N Thorn ; B 86 0 622 718 ; C -1 ; WX 778 ; N Omacron ; B 39 -19 739 879 ; C -1 ; WX 722 ; N Racute ; B 88 0 684 929 ; C -1 ; WX 667 ; N Sacute ; B 49 -19 620 929 ; C -1 ; WX 643 ; N dcaron ; B 35 -15 655 718 ; C -1 ; WX 722 ; N Umacron ; B 79 -19 644 879 ; C -1 ; WX 556 ; N uring ; B 68 -15 489 756 ; C -1 ; WX 333 ; N threesuperior ; B 5 270 325 703 ; C -1 ; WX 778 ; N Ograve ; B 39 -19 739 929 ; C -1 ; WX 667 ; N Agrave ; B 14 0 654 929 ; C -1 ; WX 667 ; N Abreve ; B 14 0 654 926 ; C -1 ; WX 584 ; N multiply ; B 39 0 545 506 ; C -1 ; WX 556 ; N uacute ; B 68 -15 489 734 ; C -1 ; WX 611 ; N Tcaron ; B 14 0 597 929 ; C -1 ; WX 476 ; N partialdiff ; B 13 -38 463 714 ; C -1 ; WX 500 ; N ydieresis ; B 11 -214 489 706 ; C -1 ; WX 722 ; N Nacute ; B 76 0 646 929 ; C -1 ; WX 278 ; N icircumflex ; B -6 0 285 734 ; C -1 ; WX 667 ; N Ecircumflex ; B 86 0 616 929 ; C -1 ; WX 556 ; N adieresis ; B 36 -15 530 706 ; C -1 ; WX 556 ; N edieresis ; B 40 -15 516 706 ; C -1 ; WX 500 ; N cacute ; B 30 -15 477 734 ; C -1 ; WX 556 ; N nacute ; B 65 0 491 734 ; C -1 ; WX 556 ; N umacron ; B 68 -15 489 684 ; C -1 ; WX 722 ; N Ncaron ; B 76 0 646 929 ; C -1 ; WX 278 ; N Iacute ; B 91 0 292 929 ; C -1 ; WX 584 ; N plusminus ; B 39 0 545 506 ; C -1 ; WX 260 ; N brokenbar ; B 94 -150 167 700 ; C -1 ; WX 737 ; N registered ; B -14 -19 752 737 ; C -1 ; WX 778 ; N Gbreve ; B 48 -19 704 926 ; C -1 ; WX 278 ; N Idotaccent ; B 91 0 188 901 ; C -1 ; WX 600 ; N summation ; B 15 -10 586 706 ; C -1 ; WX 667 ; N Egrave ; B 86 0 616 929 ; C -1 ; WX 333 ; N racute ; B 77 0 332 734 ; C -1 ; WX 556 ; N omacron ; B 35 -14 521 684 ; C -1 ; WX 611 ; N Zacute ; B 23 0 588 929 ; C -1 ; WX 611 ; N Zcaron ; B 23 0 588 929 ; C -1 ; WX 549 ; N greaterequal ; B 26 0 523 674 ; C -1 ; WX 722 ; N Eth ; B 0 0 674 718 ; C -1 ; WX 722 ; N Ccedilla ; B 44 -225 681 737 ; C -1 ; WX 222 ; N lcommaaccent ; B 67 -225 167 718 ; C -1 ; WX 317 ; N tcaron ; B 14 -7 329 808 ; C -1 ; WX 556 ; N eogonek ; B 40 -225 516 538 ; C -1 ; WX 722 ; N Uogonek ; B 79 -225 644 718 ; C -1 ; WX 667 ; N Aacute ; B 14 0 654 929 ; C -1 ; WX 667 ; N Adieresis ; B 14 0 654 901 ; C -1 ; WX 556 ; N egrave ; B 40 -15 516 734 ; C -1 ; WX 500 ; N zacute ; B 31 0 469 734 ; C -1 ; WX 222 ; N iogonek ; B -31 -225 183 718 ; C -1 ; WX 778 ; N Oacute ; B 39 -19 739 929 ; C -1 ; WX 556 ; N oacute ; B 35 -14 521 734 ; C -1 ; WX 556 ; N amacron ; B 36 -15 530 684 ; C -1 ; WX 500 ; N sacute ; B 32 -15 464 734 ; C -1 ; WX 278 ; N idieresis ; B 13 0 266 706 ; C -1 ; WX 778 ; N Ocircumflex ; B 39 -19 739 929 ; C -1 ; WX 722 ; N Ugrave ; B 79 -19 644 929 ; C -1 ; WX 612 ; N Delta ; B 6 0 608 688 ; C -1 ; WX 556 ; N thorn ; B 58 -207 517 718 ; C -1 ; WX 333 ; N twosuperior ; B 4 281 323 703 ; C -1 ; WX 778 ; N Odieresis ; B 39 -19 739 901 ; C -1 ; WX 556 ; N mu ; B 68 -207 489 523 ; C -1 ; WX 278 ; N igrave ; B -13 0 184 734 ; C -1 ; WX 556 ; N ohungarumlaut ; B 35 -14 521 734 ; C -1 ; WX 667 ; N Eogonek ; B 86 -220 633 718 ; C -1 ; WX 556 ; N dcroat ; B 35 -15 550 718 ; C -1 ; WX 834 ; N threequarters ; B 45 -19 810 703 ; C -1 ; WX 667 ; N Scedilla ; B 49 -225 620 737 ; C -1 ; WX 299 ; N lcaron ; B 67 0 311 718 ; C -1 ; WX 667 ; N Kcommaaccent ; B 76 -225 663 718 ; C -1 ; WX 556 ; N Lacute ; B 76 0 537 929 ; C -1 ; WX 1000 ; N trademark ; B 46 306 903 718 ; C -1 ; WX 556 ; N edotaccent ; B 40 -15 516 706 ; C -1 ; WX 278 ; N Igrave ; B -13 0 188 929 ; C -1 ; WX 278 ; N Imacron ; B -17 0 296 879 ; C -1 ; WX 556 ; N Lcaron ; B 76 0 537 718 ; C -1 ; WX 834 ; N onehalf ; B 43 -19 773 703 ; C -1 ; WX 549 ; N lessequal ; B 26 0 523 674 ; C -1 ; WX 556 ; N ocircumflex ; B 35 -14 521 734 ; C -1 ; WX 556 ; N ntilde ; B 65 0 491 722 ; C -1 ; WX 722 ; N Uhungarumlaut ; B 79 -19 644 929 ; C -1 ; WX 667 ; N Eacute ; B 86 0 616 929 ; C -1 ; WX 556 ; N emacron ; B 40 -15 516 684 ; C -1 ; WX 556 ; N gbreve ; B 40 -220 499 731 ; C -1 ; WX 834 ; N onequarter ; B 73 -19 756 703 ; C -1 ; WX 667 ; N Scaron ; B 49 -19 620 929 ; C -1 ; WX 667 ; N Scommaaccent ; B 49 -225 620 737 ; C -1 ; WX 778 ; N Ohungarumlaut ; B 39 -19 739 929 ; C -1 ; WX 400 ; N degree ; B 54 411 346 703 ; C -1 ; WX 556 ; N ograve ; B 35 -14 521 734 ; C -1 ; WX 722 ; N Ccaron ; B 44 -19 681 929 ; C -1 ; WX 556 ; N ugrave ; B 68 -15 489 734 ; C -1 ; WX 453 ; N radical ; B -4 -80 458 762 ; C -1 ; WX 722 ; N Dcaron ; B 81 0 674 929 ; C -1 ; WX 333 ; N rcommaaccent ; B 77 -225 332 538 ; C -1 ; WX 722 ; N Ntilde ; B 76 0 646 917 ; C -1 ; WX 556 ; N otilde ; B 35 -14 521 722 ; C -1 ; WX 722 ; N Rcommaaccent ; B 88 -225 684 718 ; C -1 ; WX 556 ; N Lcommaaccent ; B 76 -225 537 718 ; C -1 ; WX 667 ; N Atilde ; B 14 0 654 917 ; C -1 ; WX 667 ; N Aogonek ; B 14 -225 654 718 ; C -1 ; WX 667 ; N Aring ; B 14 0 654 931 ; C -1 ; WX 778 ; N Otilde ; B 39 -19 739 917 ; C -1 ; WX 500 ; N zdotaccent ; B 31 0 469 706 ; C -1 ; WX 667 ; N Ecaron ; B 86 0 616 929 ; C -1 ; WX 278 ; N Iogonek ; B -3 -225 211 718 ; C -1 ; WX 500 ; N kcommaaccent ; B 67 -225 501 718 ; C -1 ; WX 584 ; N minus ; B 39 216 545 289 ; C -1 ; WX 278 ; N Icircumflex ; B -6 0 285 929 ; C -1 ; WX 556 ; N ncaron ; B 65 0 491 734 ; C -1 ; WX 278 ; N tcommaaccent ; B 14 -225 257 669 ; C -1 ; WX 584 ; N logicalnot ; B 39 108 545 390 ; C -1 ; WX 556 ; N odieresis ; B 35 -14 521 706 ; C -1 ; WX 556 ; N udieresis ; B 68 -15 489 706 ; C -1 ; WX 549 ; N notequal ; B 12 -35 537 551 ; C -1 ; WX 556 ; N gcommaaccent ; B 40 -220 499 822 ; C -1 ; WX 556 ; N eth ; B 35 -15 522 737 ; C -1 ; WX 500 ; N zcaron ; B 31 0 469 734 ; C -1 ; WX 556 ; N ncommaaccent ; B 65 -225 491 538 ; C -1 ; WX 333 ; N onesuperior ; B 43 281 222 703 ; C -1 ; WX 278 ; N imacron ; B 5 0 272 684 ; C -1 ; WX 556 ; N Euro ; B 0 0 0 0 ; EndCharMetrics StartKernData StartKernPairs 2705 KPX A C -30 KPX A Cacute -30 KPX A Ccaron -30 KPX A Ccedilla -30 KPX A G -30 KPX A Gbreve -30 KPX A Gcommaaccent -30 KPX A O -30 KPX A Oacute -30 KPX A Ocircumflex -30 KPX A Odieresis -30 KPX A Ograve -30 KPX A Ohungarumlaut -30 KPX A Omacron -30 KPX A Oslash -30 KPX A Otilde -30 KPX A Q -30 KPX A T -120 KPX A Tcaron -120 KPX A Tcommaaccent -120 KPX A U -50 KPX A Uacute -50 KPX A Ucircumflex -50 KPX A Udieresis -50 KPX A Ugrave -50 KPX A Uhungarumlaut -50 KPX A Umacron -50 KPX A Uogonek -50 KPX A Uring -50 KPX A V -70 KPX A W -50 KPX A Y -100 KPX A Yacute -100 KPX A Ydieresis -100 KPX A u -30 KPX A uacute -30 KPX A ucircumflex -30 KPX A udieresis -30 KPX A ugrave -30 KPX A uhungarumlaut -30 KPX A umacron -30 KPX A uogonek -30 KPX A uring -30 KPX A v -40 KPX A w -40 KPX A y -40 KPX A yacute -40 KPX A ydieresis -40 KPX Aacute C -30 KPX Aacute Cacute -30 KPX Aacute Ccaron -30 KPX Aacute Ccedilla -30 KPX Aacute G -30 KPX Aacute Gbreve -30 KPX Aacute Gcommaaccent -30 KPX Aacute O -30 KPX Aacute Oacute -30 KPX Aacute Ocircumflex -30 KPX Aacute Odieresis -30 KPX Aacute Ograve -30 KPX Aacute Ohungarumlaut -30 KPX Aacute Omacron -30 KPX Aacute Oslash -30 KPX Aacute Otilde -30 KPX Aacute Q -30 KPX Aacute T -120 KPX Aacute Tcaron -120 KPX Aacute Tcommaaccent -120 KPX Aacute U -50 KPX Aacute Uacute -50 KPX Aacute Ucircumflex -50 KPX Aacute Udieresis -50 KPX Aacute Ugrave -50 KPX Aacute Uhungarumlaut -50 KPX Aacute Umacron -50 KPX Aacute Uogonek -50 KPX Aacute Uring -50 KPX Aacute V -70 KPX Aacute W -50 KPX Aacute Y -100 KPX Aacute Yacute -100 KPX Aacute Ydieresis -100 KPX Aacute u -30 KPX Aacute uacute -30 KPX Aacute ucircumflex -30 KPX Aacute udieresis -30 KPX Aacute ugrave -30 KPX Aacute uhungarumlaut -30 KPX Aacute umacron -30 KPX Aacute uogonek -30 KPX Aacute uring -30 KPX Aacute v -40 KPX Aacute w -40 KPX Aacute y -40 KPX Aacute yacute -40 KPX Aacute ydieresis -40 KPX Abreve C -30 KPX Abreve Cacute -30 KPX Abreve Ccaron -30 KPX Abreve Ccedilla -30 KPX Abreve G -30 KPX Abreve Gbreve -30 KPX Abreve Gcommaaccent -30 KPX Abreve O -30 KPX Abreve Oacute -30 KPX Abreve Ocircumflex -30 KPX Abreve Odieresis -30 KPX Abreve Ograve -30 KPX Abreve Ohungarumlaut -30 KPX Abreve Omacron -30 KPX Abreve Oslash -30 KPX Abreve Otilde -30 KPX Abreve Q -30 KPX Abreve T -120 KPX Abreve Tcaron -120 KPX Abreve Tcommaaccent -120 KPX Abreve U -50 KPX Abreve Uacute -50 KPX Abreve Ucircumflex -50 KPX Abreve Udieresis -50 KPX Abreve Ugrave -50 KPX Abreve Uhungarumlaut -50 KPX Abreve Umacron -50 KPX Abreve Uogonek -50 KPX Abreve Uring -50 KPX Abreve V -70 KPX Abreve W -50 KPX Abreve Y -100 KPX Abreve Yacute -100 KPX Abreve Ydieresis -100 KPX Abreve u -30 KPX Abreve uacute -30 KPX Abreve ucircumflex -30 KPX Abreve udieresis -30 KPX Abreve ugrave -30 KPX Abreve uhungarumlaut -30 KPX Abreve umacron -30 KPX Abreve uogonek -30 KPX Abreve uring -30 KPX Abreve v -40 KPX Abreve w -40 KPX Abreve y -40 KPX Abreve yacute -40 KPX Abreve ydieresis -40 KPX Acircumflex C -30 KPX Acircumflex Cacute -30 KPX Acircumflex Ccaron -30 KPX Acircumflex Ccedilla -30 KPX Acircumflex G -30 KPX Acircumflex Gbreve -30 KPX Acircumflex Gcommaaccent -30 KPX Acircumflex O -30 KPX Acircumflex Oacute -30 KPX Acircumflex Ocircumflex -30 KPX Acircumflex Odieresis -30 KPX Acircumflex Ograve -30 KPX Acircumflex Ohungarumlaut -30 KPX Acircumflex Omacron -30 KPX Acircumflex Oslash -30 KPX Acircumflex Otilde -30 KPX Acircumflex Q -30 KPX Acircumflex T -120 KPX Acircumflex Tcaron -120 KPX Acircumflex Tcommaaccent -120 KPX Acircumflex U -50 KPX Acircumflex Uacute -50 KPX Acircumflex Ucircumflex -50 KPX Acircumflex Udieresis -50 KPX Acircumflex Ugrave -50 KPX Acircumflex Uhungarumlaut -50 KPX Acircumflex Umacron -50 KPX Acircumflex Uogonek -50 KPX Acircumflex Uring -50 KPX Acircumflex V -70 KPX Acircumflex W -50 KPX Acircumflex Y -100 KPX Acircumflex Yacute -100 KPX Acircumflex Ydieresis -100 KPX Acircumflex u -30 KPX Acircumflex uacute -30 KPX Acircumflex ucircumflex -30 KPX Acircumflex udieresis -30 KPX Acircumflex ugrave -30 KPX Acircumflex uhungarumlaut -30 KPX Acircumflex umacron -30 KPX Acircumflex uogonek -30 KPX Acircumflex uring -30 KPX Acircumflex v -40 KPX Acircumflex w -40 KPX Acircumflex y -40 KPX Acircumflex yacute -40 KPX Acircumflex ydieresis -40 KPX Adieresis C -30 KPX Adieresis Cacute -30 KPX Adieresis Ccaron -30 KPX Adieresis Ccedilla -30 KPX Adieresis G -30 KPX Adieresis Gbreve -30 KPX Adieresis Gcommaaccent -30 KPX Adieresis O -30 KPX Adieresis Oacute -30 KPX Adieresis Ocircumflex -30 KPX Adieresis Odieresis -30 KPX Adieresis Ograve -30 KPX Adieresis Ohungarumlaut -30 KPX Adieresis Omacron -30 KPX Adieresis Oslash -30 KPX Adieresis Otilde -30 KPX Adieresis Q -30 KPX Adieresis T -120 KPX Adieresis Tcaron -120 KPX Adieresis Tcommaaccent -120 KPX Adieresis U -50 KPX Adieresis Uacute -50 KPX Adieresis Ucircumflex -50 KPX Adieresis Udieresis -50 KPX Adieresis Ugrave -50 KPX Adieresis Uhungarumlaut -50 KPX Adieresis Umacron -50 KPX Adieresis Uogonek -50 KPX Adieresis Uring -50 KPX Adieresis V -70 KPX Adieresis W -50 KPX Adieresis Y -100 KPX Adieresis Yacute -100 KPX Adieresis Ydieresis -100 KPX Adieresis u -30 KPX Adieresis uacute -30 KPX Adieresis ucircumflex -30 KPX Adieresis udieresis -30 KPX Adieresis ugrave -30 KPX Adieresis uhungarumlaut -30 KPX Adieresis umacron -30 KPX Adieresis uogonek -30 KPX Adieresis uring -30 KPX Adieresis v -40 KPX Adieresis w -40 KPX Adieresis y -40 KPX Adieresis yacute -40 KPX Adieresis ydieresis -40 KPX Agrave C -30 KPX Agrave Cacute -30 KPX Agrave Ccaron -30 KPX Agrave Ccedilla -30 KPX Agrave G -30 KPX Agrave Gbreve -30 KPX Agrave Gcommaaccent -30 KPX Agrave O -30 KPX Agrave Oacute -30 KPX Agrave Ocircumflex -30 KPX Agrave Odieresis -30 KPX Agrave Ograve -30 KPX Agrave Ohungarumlaut -30 KPX Agrave Omacron -30 KPX Agrave Oslash -30 KPX Agrave Otilde -30 KPX Agrave Q -30 KPX Agrave T -120 KPX Agrave Tcaron -120 KPX Agrave Tcommaaccent -120 KPX Agrave U -50 KPX Agrave Uacute -50 KPX Agrave Ucircumflex -50 KPX Agrave Udieresis -50 KPX Agrave Ugrave -50 KPX Agrave Uhungarumlaut -50 KPX Agrave Umacron -50 KPX Agrave Uogonek -50 KPX Agrave Uring -50 KPX Agrave V -70 KPX Agrave W -50 KPX Agrave Y -100 KPX Agrave Yacute -100 KPX Agrave Ydieresis -100 KPX Agrave u -30 KPX Agrave uacute -30 KPX Agrave ucircumflex -30 KPX Agrave udieresis -30 KPX Agrave ugrave -30 KPX Agrave uhungarumlaut -30 KPX Agrave umacron -30 KPX Agrave uogonek -30 KPX Agrave uring -30 KPX Agrave v -40 KPX Agrave w -40 KPX Agrave y -40 KPX Agrave yacute -40 KPX Agrave ydieresis -40 KPX Amacron C -30 KPX Amacron Cacute -30 KPX Amacron Ccaron -30 KPX Amacron Ccedilla -30 KPX Amacron G -30 KPX Amacron Gbreve -30 KPX Amacron Gcommaaccent -30 KPX Amacron O -30 KPX Amacron Oacute -30 KPX Amacron Ocircumflex -30 KPX Amacron Odieresis -30 KPX Amacron Ograve -30 KPX Amacron Ohungarumlaut -30 KPX Amacron Omacron -30 KPX Amacron Oslash -30 KPX Amacron Otilde -30 KPX Amacron Q -30 KPX Amacron T -120 KPX Amacron Tcaron -120 KPX Amacron Tcommaaccent -120 KPX Amacron U -50 KPX Amacron Uacute -50 KPX Amacron Ucircumflex -50 KPX Amacron Udieresis -50 KPX Amacron Ugrave -50 KPX Amacron Uhungarumlaut -50 KPX Amacron Umacron -50 KPX Amacron Uogonek -50 KPX Amacron Uring -50 KPX Amacron V -70 KPX Amacron W -50 KPX Amacron Y -100 KPX Amacron Yacute -100 KPX Amacron Ydieresis -100 KPX Amacron u -30 KPX Amacron uacute -30 KPX Amacron ucircumflex -30 KPX Amacron udieresis -30 KPX Amacron ugrave -30 KPX Amacron uhungarumlaut -30 KPX Amacron umacron -30 KPX Amacron uogonek -30 KPX Amacron uring -30 KPX Amacron v -40 KPX Amacron w -40 KPX Amacron y -40 KPX Amacron yacute -40 KPX Amacron ydieresis -40 KPX Aogonek C -30 KPX Aogonek Cacute -30 KPX Aogonek Ccaron -30 KPX Aogonek Ccedilla -30 KPX Aogonek G -30 KPX Aogonek Gbreve -30 KPX Aogonek Gcommaaccent -30 KPX Aogonek O -30 KPX Aogonek Oacute -30 KPX Aogonek Ocircumflex -30 KPX Aogonek Odieresis -30 KPX Aogonek Ograve -30 KPX Aogonek Ohungarumlaut -30 KPX Aogonek Omacron -30 KPX Aogonek Oslash -30 KPX Aogonek Otilde -30 KPX Aogonek Q -30 KPX Aogonek T -120 KPX Aogonek Tcaron -120 KPX Aogonek Tcommaaccent -120 KPX Aogonek U -50 KPX Aogonek Uacute -50 KPX Aogonek Ucircumflex -50 KPX Aogonek Udieresis -50 KPX Aogonek Ugrave -50 KPX Aogonek Uhungarumlaut -50 KPX Aogonek Umacron -50 KPX Aogonek Uogonek -50 KPX Aogonek Uring -50 KPX Aogonek V -70 KPX Aogonek W -50 KPX Aogonek Y -100 KPX Aogonek Yacute -100 KPX Aogonek Ydieresis -100 KPX Aogonek u -30 KPX Aogonek uacute -30 KPX Aogonek ucircumflex -30 KPX Aogonek udieresis -30 KPX Aogonek ugrave -30 KPX Aogonek uhungarumlaut -30 KPX Aogonek umacron -30 KPX Aogonek uogonek -30 KPX Aogonek uring -30 KPX Aogonek v -40 KPX Aogonek w -40 KPX Aogonek y -40 KPX Aogonek yacute -40 KPX Aogonek ydieresis -40 KPX Aring C -30 KPX Aring Cacute -30 KPX Aring Ccaron -30 KPX Aring Ccedilla -30 KPX Aring G -30 KPX Aring Gbreve -30 KPX Aring Gcommaaccent -30 KPX Aring O -30 KPX Aring Oacute -30 KPX Aring Ocircumflex -30 KPX Aring Odieresis -30 KPX Aring Ograve -30 KPX Aring Ohungarumlaut -30 KPX Aring Omacron -30 KPX Aring Oslash -30 KPX Aring Otilde -30 KPX Aring Q -30 KPX Aring T -120 KPX Aring Tcaron -120 KPX Aring Tcommaaccent -120 KPX Aring U -50 KPX Aring Uacute -50 KPX Aring Ucircumflex -50 KPX Aring Udieresis -50 KPX Aring Ugrave -50 KPX Aring Uhungarumlaut -50 KPX Aring Umacron -50 KPX Aring Uogonek -50 KPX Aring Uring -50 KPX Aring V -70 KPX Aring W -50 KPX Aring Y -100 KPX Aring Yacute -100 KPX Aring Ydieresis -100 KPX Aring u -30 KPX Aring uacute -30 KPX Aring ucircumflex -30 KPX Aring udieresis -30 KPX Aring ugrave -30 KPX Aring uhungarumlaut -30 KPX Aring umacron -30 KPX Aring uogonek -30 KPX Aring uring -30 KPX Aring v -40 KPX Aring w -40 KPX Aring y -40 KPX Aring yacute -40 KPX Aring ydieresis -40 KPX Atilde C -30 KPX Atilde Cacute -30 KPX Atilde Ccaron -30 KPX Atilde Ccedilla -30 KPX Atilde G -30 KPX Atilde Gbreve -30 KPX Atilde Gcommaaccent -30 KPX Atilde O -30 KPX Atilde Oacute -30 KPX Atilde Ocircumflex -30 KPX Atilde Odieresis -30 KPX Atilde Ograve -30 KPX Atilde Ohungarumlaut -30 KPX Atilde Omacron -30 KPX Atilde Oslash -30 KPX Atilde Otilde -30 KPX Atilde Q -30 KPX Atilde T -120 KPX Atilde Tcaron -120 KPX Atilde Tcommaaccent -120 KPX Atilde U -50 KPX Atilde Uacute -50 KPX Atilde Ucircumflex -50 KPX Atilde Udieresis -50 KPX Atilde Ugrave -50 KPX Atilde Uhungarumlaut -50 KPX Atilde Umacron -50 KPX Atilde Uogonek -50 KPX Atilde Uring -50 KPX Atilde V -70 KPX Atilde W -50 KPX Atilde Y -100 KPX Atilde Yacute -100 KPX Atilde Ydieresis -100 KPX Atilde u -30 KPX Atilde uacute -30 KPX Atilde ucircumflex -30 KPX Atilde udieresis -30 KPX Atilde ugrave -30 KPX Atilde uhungarumlaut -30 KPX Atilde umacron -30 KPX Atilde uogonek -30 KPX Atilde uring -30 KPX Atilde v -40 KPX Atilde w -40 KPX Atilde y -40 KPX Atilde yacute -40 KPX Atilde ydieresis -40 KPX B U -10 KPX B Uacute -10 KPX B Ucircumflex -10 KPX B Udieresis -10 KPX B Ugrave -10 KPX B Uhungarumlaut -10 KPX B Umacron -10 KPX B Uogonek -10 KPX B Uring -10 KPX B comma -20 KPX B period -20 KPX C comma -30 KPX C period -30 KPX Cacute comma -30 KPX Cacute period -30 KPX Ccaron comma -30 KPX Ccaron period -30 KPX Ccedilla comma -30 KPX Ccedilla period -30 KPX D A -40 KPX D Aacute -40 KPX D Abreve -40 KPX D Acircumflex -40 KPX D Adieresis -40 KPX D Agrave -40 KPX D Amacron -40 KPX D Aogonek -40 KPX D Aring -40 KPX D Atilde -40 KPX D V -70 KPX D W -40 KPX D Y -90 KPX D Yacute -90 KPX D Ydieresis -90 KPX D comma -70 KPX D period -70 KPX Dcaron A -40 KPX Dcaron Aacute -40 KPX Dcaron Abreve -40 KPX Dcaron Acircumflex -40 KPX Dcaron Adieresis -40 KPX Dcaron Agrave -40 KPX Dcaron Amacron -40 KPX Dcaron Aogonek -40 KPX Dcaron Aring -40 KPX Dcaron Atilde -40 KPX Dcaron V -70 KPX Dcaron W -40 KPX Dcaron Y -90 KPX Dcaron Yacute -90 KPX Dcaron Ydieresis -90 KPX Dcaron comma -70 KPX Dcaron period -70 KPX Dcroat A -40 KPX Dcroat Aacute -40 KPX Dcroat Abreve -40 KPX Dcroat Acircumflex -40 KPX Dcroat Adieresis -40 KPX Dcroat Agrave -40 KPX Dcroat Amacron -40 KPX Dcroat Aogonek -40 KPX Dcroat Aring -40 KPX Dcroat Atilde -40 KPX Dcroat V -70 KPX Dcroat W -40 KPX Dcroat Y -90 KPX Dcroat Yacute -90 KPX Dcroat Ydieresis -90 KPX Dcroat comma -70 KPX Dcroat period -70 KPX F A -80 KPX F Aacute -80 KPX F Abreve -80 KPX F Acircumflex -80 KPX F Adieresis -80 KPX F Agrave -80 KPX F Amacron -80 KPX F Aogonek -80 KPX F Aring -80 KPX F Atilde -80 KPX F a -50 KPX F aacute -50 KPX F abreve -50 KPX F acircumflex -50 KPX F adieresis -50 KPX F agrave -50 KPX F amacron -50 KPX F aogonek -50 KPX F aring -50 KPX F atilde -50 KPX F comma -150 KPX F e -30 KPX F eacute -30 KPX F ecaron -30 KPX F ecircumflex -30 KPX F edieresis -30 KPX F edotaccent -30 KPX F egrave -30 KPX F emacron -30 KPX F eogonek -30 KPX F o -30 KPX F oacute -30 KPX F ocircumflex -30 KPX F odieresis -30 KPX F ograve -30 KPX F ohungarumlaut -30 KPX F omacron -30 KPX F oslash -30 KPX F otilde -30 KPX F period -150 KPX F r -45 KPX F racute -45 KPX F rcaron -45 KPX F rcommaaccent -45 KPX J A -20 KPX J Aacute -20 KPX J Abreve -20 KPX J Acircumflex -20 KPX J Adieresis -20 KPX J Agrave -20 KPX J Amacron -20 KPX J Aogonek -20 KPX J Aring -20 KPX J Atilde -20 KPX J a -20 KPX J aacute -20 KPX J abreve -20 KPX J acircumflex -20 KPX J adieresis -20 KPX J agrave -20 KPX J amacron -20 KPX J aogonek -20 KPX J aring -20 KPX J atilde -20 KPX J comma -30 KPX J period -30 KPX J u -20 KPX J uacute -20 KPX J ucircumflex -20 KPX J udieresis -20 KPX J ugrave -20 KPX J uhungarumlaut -20 KPX J umacron -20 KPX J uogonek -20 KPX J uring -20 KPX K O -50 KPX K Oacute -50 KPX K Ocircumflex -50 KPX K Odieresis -50 KPX K Ograve -50 KPX K Ohungarumlaut -50 KPX K Omacron -50 KPX K Oslash -50 KPX K Otilde -50 KPX K e -40 KPX K eacute -40 KPX K ecaron -40 KPX K ecircumflex -40 KPX K edieresis -40 KPX K edotaccent -40 KPX K egrave -40 KPX K emacron -40 KPX K eogonek -40 KPX K o -40 KPX K oacute -40 KPX K ocircumflex -40 KPX K odieresis -40 KPX K ograve -40 KPX K ohungarumlaut -40 KPX K omacron -40 KPX K oslash -40 KPX K otilde -40 KPX K u -30 KPX K uacute -30 KPX K ucircumflex -30 KPX K udieresis -30 KPX K ugrave -30 KPX K uhungarumlaut -30 KPX K umacron -30 KPX K uogonek -30 KPX K uring -30 KPX K y -50 KPX K yacute -50 KPX K ydieresis -50 KPX Kcommaaccent O -50 KPX Kcommaaccent Oacute -50 KPX Kcommaaccent Ocircumflex -50 KPX Kcommaaccent Odieresis -50 KPX Kcommaaccent Ograve -50 KPX Kcommaaccent Ohungarumlaut -50 KPX Kcommaaccent Omacron -50 KPX Kcommaaccent Oslash -50 KPX Kcommaaccent Otilde -50 KPX Kcommaaccent e -40 KPX Kcommaaccent eacute -40 KPX Kcommaaccent ecaron -40 KPX Kcommaaccent ecircumflex -40 KPX Kcommaaccent edieresis -40 KPX Kcommaaccent edotaccent -40 KPX Kcommaaccent egrave -40 KPX Kcommaaccent emacron -40 KPX Kcommaaccent eogonek -40 KPX Kcommaaccent o -40 KPX Kcommaaccent oacute -40 KPX Kcommaaccent ocircumflex -40 KPX Kcommaaccent odieresis -40 KPX Kcommaaccent ograve -40 KPX Kcommaaccent ohungarumlaut -40 KPX Kcommaaccent omacron -40 KPX Kcommaaccent oslash -40 KPX Kcommaaccent otilde -40 KPX Kcommaaccent u -30 KPX Kcommaaccent uacute -30 KPX Kcommaaccent ucircumflex -30 KPX Kcommaaccent udieresis -30 KPX Kcommaaccent ugrave -30 KPX Kcommaaccent uhungarumlaut -30 KPX Kcommaaccent umacron -30 KPX Kcommaaccent uogonek -30 KPX Kcommaaccent uring -30 KPX Kcommaaccent y -50 KPX Kcommaaccent yacute -50 KPX Kcommaaccent ydieresis -50 KPX L T -110 KPX L Tcaron -110 KPX L Tcommaaccent -110 KPX L V -110 KPX L W -70 KPX L Y -140 KPX L Yacute -140 KPX L Ydieresis -140 KPX L quotedblright -140 KPX L quoteright -160 KPX L y -30 KPX L yacute -30 KPX L ydieresis -30 KPX Lacute T -110 KPX Lacute Tcaron -110 KPX Lacute Tcommaaccent -110 KPX Lacute V -110 KPX Lacute W -70 KPX Lacute Y -140 KPX Lacute Yacute -140 KPX Lacute Ydieresis -140 KPX Lacute quotedblright -140 KPX Lacute quoteright -160 KPX Lacute y -30 KPX Lacute yacute -30 KPX Lacute ydieresis -30 KPX Lcaron T -110 KPX Lcaron Tcaron -110 KPX Lcaron Tcommaaccent -110 KPX Lcaron V -110 KPX Lcaron W -70 KPX Lcaron Y -140 KPX Lcaron Yacute -140 KPX Lcaron Ydieresis -140 KPX Lcaron quotedblright -140 KPX Lcaron quoteright -160 KPX Lcaron y -30 KPX Lcaron yacute -30 KPX Lcaron ydieresis -30 KPX Lcommaaccent T -110 KPX Lcommaaccent Tcaron -110 KPX Lcommaaccent Tcommaaccent -110 KPX Lcommaaccent V -110 KPX Lcommaaccent W -70 KPX Lcommaaccent Y -140 KPX Lcommaaccent Yacute -140 KPX Lcommaaccent Ydieresis -140 KPX Lcommaaccent quotedblright -140 KPX Lcommaaccent quoteright -160 KPX Lcommaaccent y -30 KPX Lcommaaccent yacute -30 KPX Lcommaaccent ydieresis -30 KPX Lslash T -110 KPX Lslash Tcaron -110 KPX Lslash Tcommaaccent -110 KPX Lslash V -110 KPX Lslash W -70 KPX Lslash Y -140 KPX Lslash Yacute -140 KPX Lslash Ydieresis -140 KPX Lslash quotedblright -140 KPX Lslash quoteright -160 KPX Lslash y -30 KPX Lslash yacute -30 KPX Lslash ydieresis -30 KPX O A -20 KPX O Aacute -20 KPX O Abreve -20 KPX O Acircumflex -20 KPX O Adieresis -20 KPX O Agrave -20 KPX O Amacron -20 KPX O Aogonek -20 KPX O Aring -20 KPX O Atilde -20 KPX O T -40 KPX O Tcaron -40 KPX O Tcommaaccent -40 KPX O V -50 KPX O W -30 KPX O X -60 KPX O Y -70 KPX O Yacute -70 KPX O Ydieresis -70 KPX O comma -40 KPX O period -40 KPX Oacute A -20 KPX Oacute Aacute -20 KPX Oacute Abreve -20 KPX Oacute Acircumflex -20 KPX Oacute Adieresis -20 KPX Oacute Agrave -20 KPX Oacute Amacron -20 KPX Oacute Aogonek -20 KPX Oacute Aring -20 KPX Oacute Atilde -20 KPX Oacute T -40 KPX Oacute Tcaron -40 KPX Oacute Tcommaaccent -40 KPX Oacute V -50 KPX Oacute W -30 KPX Oacute X -60 KPX Oacute Y -70 KPX Oacute Yacute -70 KPX Oacute Ydieresis -70 KPX Oacute comma -40 KPX Oacute period -40 KPX Ocircumflex A -20 KPX Ocircumflex Aacute -20 KPX Ocircumflex Abreve -20 KPX Ocircumflex Acircumflex -20 KPX Ocircumflex Adieresis -20 KPX Ocircumflex Agrave -20 KPX Ocircumflex Amacron -20 KPX Ocircumflex Aogonek -20 KPX Ocircumflex Aring -20 KPX Ocircumflex Atilde -20 KPX Ocircumflex T -40 KPX Ocircumflex Tcaron -40 KPX Ocircumflex Tcommaaccent -40 KPX Ocircumflex V -50 KPX Ocircumflex W -30 KPX Ocircumflex X -60 KPX Ocircumflex Y -70 KPX Ocircumflex Yacute -70 KPX Ocircumflex Ydieresis -70 KPX Ocircumflex comma -40 KPX Ocircumflex period -40 KPX Odieresis A -20 KPX Odieresis Aacute -20 KPX Odieresis Abreve -20 KPX Odieresis Acircumflex -20 KPX Odieresis Adieresis -20 KPX Odieresis Agrave -20 KPX Odieresis Amacron -20 KPX Odieresis Aogonek -20 KPX Odieresis Aring -20 KPX Odieresis Atilde -20 KPX Odieresis T -40 KPX Odieresis Tcaron -40 KPX Odieresis Tcommaaccent -40 KPX Odieresis V -50 KPX Odieresis W -30 KPX Odieresis X -60 KPX Odieresis Y -70 KPX Odieresis Yacute -70 KPX Odieresis Ydieresis -70 KPX Odieresis comma -40 KPX Odieresis period -40 KPX Ograve A -20 KPX Ograve Aacute -20 KPX Ograve Abreve -20 KPX Ograve Acircumflex -20 KPX Ograve Adieresis -20 KPX Ograve Agrave -20 KPX Ograve Amacron -20 KPX Ograve Aogonek -20 KPX Ograve Aring -20 KPX Ograve Atilde -20 KPX Ograve T -40 KPX Ograve Tcaron -40 KPX Ograve Tcommaaccent -40 KPX Ograve V -50 KPX Ograve W -30 KPX Ograve X -60 KPX Ograve Y -70 KPX Ograve Yacute -70 KPX Ograve Ydieresis -70 KPX Ograve comma -40 KPX Ograve period -40 KPX Ohungarumlaut A -20 KPX Ohungarumlaut Aacute -20 KPX Ohungarumlaut Abreve -20 KPX Ohungarumlaut Acircumflex -20 KPX Ohungarumlaut Adieresis -20 KPX Ohungarumlaut Agrave -20 KPX Ohungarumlaut Amacron -20 KPX Ohungarumlaut Aogonek -20 KPX Ohungarumlaut Aring -20 KPX Ohungarumlaut Atilde -20 KPX Ohungarumlaut T -40 KPX Ohungarumlaut Tcaron -40 KPX Ohungarumlaut Tcommaaccent -40 KPX Ohungarumlaut V -50 KPX Ohungarumlaut W -30 KPX Ohungarumlaut X -60 KPX Ohungarumlaut Y -70 KPX Ohungarumlaut Yacute -70 KPX Ohungarumlaut Ydieresis -70 KPX Ohungarumlaut comma -40 KPX Ohungarumlaut period -40 KPX Omacron A -20 KPX Omacron Aacute -20 KPX Omacron Abreve -20 KPX Omacron Acircumflex -20 KPX Omacron Adieresis -20 KPX Omacron Agrave -20 KPX Omacron Amacron -20 KPX Omacron Aogonek -20 KPX Omacron Aring -20 KPX Omacron Atilde -20 KPX Omacron T -40 KPX Omacron Tcaron -40 KPX Omacron Tcommaaccent -40 KPX Omacron V -50 KPX Omacron W -30 KPX Omacron X -60 KPX Omacron Y -70 KPX Omacron Yacute -70 KPX Omacron Ydieresis -70 KPX Omacron comma -40 KPX Omacron period -40 KPX Oslash A -20 KPX Oslash Aacute -20 KPX Oslash Abreve -20 KPX Oslash Acircumflex -20 KPX Oslash Adieresis -20 KPX Oslash Agrave -20 KPX Oslash Amacron -20 KPX Oslash Aogonek -20 KPX Oslash Aring -20 KPX Oslash Atilde -20 KPX Oslash T -40 KPX Oslash Tcaron -40 KPX Oslash Tcommaaccent -40 KPX Oslash V -50 KPX Oslash W -30 KPX Oslash X -60 KPX Oslash Y -70 KPX Oslash Yacute -70 KPX Oslash Ydieresis -70 KPX Oslash comma -40 KPX Oslash period -40 KPX Otilde A -20 KPX Otilde Aacute -20 KPX Otilde Abreve -20 KPX Otilde Acircumflex -20 KPX Otilde Adieresis -20 KPX Otilde Agrave -20 KPX Otilde Amacron -20 KPX Otilde Aogonek -20 KPX Otilde Aring -20 KPX Otilde Atilde -20 KPX Otilde T -40 KPX Otilde Tcaron -40 KPX Otilde Tcommaaccent -40 KPX Otilde V -50 KPX Otilde W -30 KPX Otilde X -60 KPX Otilde Y -70 KPX Otilde Yacute -70 KPX Otilde Ydieresis -70 KPX Otilde comma -40 KPX Otilde period -40 KPX P A -120 KPX P Aacute -120 KPX P Abreve -120 KPX P Acircumflex -120 KPX P Adieresis -120 KPX P Agrave -120 KPX P Amacron -120 KPX P Aogonek -120 KPX P Aring -120 KPX P Atilde -120 KPX P a -40 KPX P aacute -40 KPX P abreve -40 KPX P acircumflex -40 KPX P adieresis -40 KPX P agrave -40 KPX P amacron -40 KPX P aogonek -40 KPX P aring -40 KPX P atilde -40 KPX P comma -180 KPX P e -50 KPX P eacute -50 KPX P ecaron -50 KPX P ecircumflex -50 KPX P edieresis -50 KPX P edotaccent -50 KPX P egrave -50 KPX P emacron -50 KPX P eogonek -50 KPX P o -50 KPX P oacute -50 KPX P ocircumflex -50 KPX P odieresis -50 KPX P ograve -50 KPX P ohungarumlaut -50 KPX P omacron -50 KPX P oslash -50 KPX P otilde -50 KPX P period -180 KPX Q U -10 KPX Q Uacute -10 KPX Q Ucircumflex -10 KPX Q Udieresis -10 KPX Q Ugrave -10 KPX Q Uhungarumlaut -10 KPX Q Umacron -10 KPX Q Uogonek -10 KPX Q Uring -10 KPX R O -20 KPX R Oacute -20 KPX R Ocircumflex -20 KPX R Odieresis -20 KPX R Ograve -20 KPX R Ohungarumlaut -20 KPX R Omacron -20 KPX R Oslash -20 KPX R Otilde -20 KPX R T -30 KPX R Tcaron -30 KPX R Tcommaaccent -30 KPX R U -40 KPX R Uacute -40 KPX R Ucircumflex -40 KPX R Udieresis -40 KPX R Ugrave -40 KPX R Uhungarumlaut -40 KPX R Umacron -40 KPX R Uogonek -40 KPX R Uring -40 KPX R V -50 KPX R W -30 KPX R Y -50 KPX R Yacute -50 KPX R Ydieresis -50 KPX Racute O -20 KPX Racute Oacute -20 KPX Racute Ocircumflex -20 KPX Racute Odieresis -20 KPX Racute Ograve -20 KPX Racute Ohungarumlaut -20 KPX Racute Omacron -20 KPX Racute Oslash -20 KPX Racute Otilde -20 KPX Racute T -30 KPX Racute Tcaron -30 KPX Racute Tcommaaccent -30 KPX Racute U -40 KPX Racute Uacute -40 KPX Racute Ucircumflex -40 KPX Racute Udieresis -40 KPX Racute Ugrave -40 KPX Racute Uhungarumlaut -40 KPX Racute Umacron -40 KPX Racute Uogonek -40 KPX Racute Uring -40 KPX Racute V -50 KPX Racute W -30 KPX Racute Y -50 KPX Racute Yacute -50 KPX Racute Ydieresis -50 KPX Rcaron O -20 KPX Rcaron Oacute -20 KPX Rcaron Ocircumflex -20 KPX Rcaron Odieresis -20 KPX Rcaron Ograve -20 KPX Rcaron Ohungarumlaut -20 KPX Rcaron Omacron -20 KPX Rcaron Oslash -20 KPX Rcaron Otilde -20 KPX Rcaron T -30 KPX Rcaron Tcaron -30 KPX Rcaron Tcommaaccent -30 KPX Rcaron U -40 KPX Rcaron Uacute -40 KPX Rcaron Ucircumflex -40 KPX Rcaron Udieresis -40 KPX Rcaron Ugrave -40 KPX Rcaron Uhungarumlaut -40 KPX Rcaron Umacron -40 KPX Rcaron Uogonek -40 KPX Rcaron Uring -40 KPX Rcaron V -50 KPX Rcaron W -30 KPX Rcaron Y -50 KPX Rcaron Yacute -50 KPX Rcaron Ydieresis -50 KPX Rcommaaccent O -20 KPX Rcommaaccent Oacute -20 KPX Rcommaaccent Ocircumflex -20 KPX Rcommaaccent Odieresis -20 KPX Rcommaaccent Ograve -20 KPX Rcommaaccent Ohungarumlaut -20 KPX Rcommaaccent Omacron -20 KPX Rcommaaccent Oslash -20 KPX Rcommaaccent Otilde -20 KPX Rcommaaccent T -30 KPX Rcommaaccent Tcaron -30 KPX Rcommaaccent Tcommaaccent -30 KPX Rcommaaccent U -40 KPX Rcommaaccent Uacute -40 KPX Rcommaaccent Ucircumflex -40 KPX Rcommaaccent Udieresis -40 KPX Rcommaaccent Ugrave -40 KPX Rcommaaccent Uhungarumlaut -40 KPX Rcommaaccent Umacron -40 KPX Rcommaaccent Uogonek -40 KPX Rcommaaccent Uring -40 KPX Rcommaaccent V -50 KPX Rcommaaccent W -30 KPX Rcommaaccent Y -50 KPX Rcommaaccent Yacute -50 KPX Rcommaaccent Ydieresis -50 KPX S comma -20 KPX S period -20 KPX Sacute comma -20 KPX Sacute period -20 KPX Scaron comma -20 KPX Scaron period -20 KPX Scedilla comma -20 KPX Scedilla period -20 KPX Scommaaccent comma -20 KPX Scommaaccent period -20 KPX T A -120 KPX T Aacute -120 KPX T Abreve -120 KPX T Acircumflex -120 KPX T Adieresis -120 KPX T Agrave -120 KPX T Amacron -120 KPX T Aogonek -120 KPX T Aring -120 KPX T Atilde -120 KPX T O -40 KPX T Oacute -40 KPX T Ocircumflex -40 KPX T Odieresis -40 KPX T Ograve -40 KPX T Ohungarumlaut -40 KPX T Omacron -40 KPX T Oslash -40 KPX T Otilde -40 KPX T a -120 KPX T aacute -120 KPX T abreve -60 KPX T acircumflex -120 KPX T adieresis -120 KPX T agrave -120 KPX T amacron -60 KPX T aogonek -120 KPX T aring -120 KPX T atilde -60 KPX T colon -20 KPX T comma -120 KPX T e -120 KPX T eacute -120 KPX T ecaron -120 KPX T ecircumflex -120 KPX T edieresis -120 KPX T edotaccent -120 KPX T egrave -60 KPX T emacron -60 KPX T eogonek -120 KPX T hyphen -140 KPX T o -120 KPX T oacute -120 KPX T ocircumflex -120 KPX T odieresis -120 KPX T ograve -120 KPX T ohungarumlaut -120 KPX T omacron -60 KPX T oslash -120 KPX T otilde -60 KPX T period -120 KPX T r -120 KPX T racute -120 KPX T rcaron -120 KPX T rcommaaccent -120 KPX T semicolon -20 KPX T u -120 KPX T uacute -120 KPX T ucircumflex -120 KPX T udieresis -120 KPX T ugrave -120 KPX T uhungarumlaut -120 KPX T umacron -60 KPX T uogonek -120 KPX T uring -120 KPX T w -120 KPX T y -120 KPX T yacute -120 KPX T ydieresis -60 KPX Tcaron A -120 KPX Tcaron Aacute -120 KPX Tcaron Abreve -120 KPX Tcaron Acircumflex -120 KPX Tcaron Adieresis -120 KPX Tcaron Agrave -120 KPX Tcaron Amacron -120 KPX Tcaron Aogonek -120 KPX Tcaron Aring -120 KPX Tcaron Atilde -120 KPX Tcaron O -40 KPX Tcaron Oacute -40 KPX Tcaron Ocircumflex -40 KPX Tcaron Odieresis -40 KPX Tcaron Ograve -40 KPX Tcaron Ohungarumlaut -40 KPX Tcaron Omacron -40 KPX Tcaron Oslash -40 KPX Tcaron Otilde -40 KPX Tcaron a -120 KPX Tcaron aacute -120 KPX Tcaron abreve -60 KPX Tcaron acircumflex -120 KPX Tcaron adieresis -120 KPX Tcaron agrave -120 KPX Tcaron amacron -60 KPX Tcaron aogonek -120 KPX Tcaron aring -120 KPX Tcaron atilde -60 KPX Tcaron colon -20 KPX Tcaron comma -120 KPX Tcaron e -120 KPX Tcaron eacute -120 KPX Tcaron ecaron -120 KPX Tcaron ecircumflex -120 KPX Tcaron edieresis -120 KPX Tcaron edotaccent -120 KPX Tcaron egrave -60 KPX Tcaron emacron -60 KPX Tcaron eogonek -120 KPX Tcaron hyphen -140 KPX Tcaron o -120 KPX Tcaron oacute -120 KPX Tcaron ocircumflex -120 KPX Tcaron odieresis -120 KPX Tcaron ograve -120 KPX Tcaron ohungarumlaut -120 KPX Tcaron omacron -60 KPX Tcaron oslash -120 KPX Tcaron otilde -60 KPX Tcaron period -120 KPX Tcaron r -120 KPX Tcaron racute -120 KPX Tcaron rcaron -120 KPX Tcaron rcommaaccent -120 KPX Tcaron semicolon -20 KPX Tcaron u -120 KPX Tcaron uacute -120 KPX Tcaron ucircumflex -120 KPX Tcaron udieresis -120 KPX Tcaron ugrave -120 KPX Tcaron uhungarumlaut -120 KPX Tcaron umacron -60 KPX Tcaron uogonek -120 KPX Tcaron uring -120 KPX Tcaron w -120 KPX Tcaron y -120 KPX Tcaron yacute -120 KPX Tcaron ydieresis -60 KPX Tcommaaccent A -120 KPX Tcommaaccent Aacute -120 KPX Tcommaaccent Abreve -120 KPX Tcommaaccent Acircumflex -120 KPX Tcommaaccent Adieresis -120 KPX Tcommaaccent Agrave -120 KPX Tcommaaccent Amacron -120 KPX Tcommaaccent Aogonek -120 KPX Tcommaaccent Aring -120 KPX Tcommaaccent Atilde -120 KPX Tcommaaccent O -40 KPX Tcommaaccent Oacute -40 KPX Tcommaaccent Ocircumflex -40 KPX Tcommaaccent Odieresis -40 KPX Tcommaaccent Ograve -40 KPX Tcommaaccent Ohungarumlaut -40 KPX Tcommaaccent Omacron -40 KPX Tcommaaccent Oslash -40 KPX Tcommaaccent Otilde -40 KPX Tcommaaccent a -120 KPX Tcommaaccent aacute -120 KPX Tcommaaccent abreve -60 KPX Tcommaaccent acircumflex -120 KPX Tcommaaccent adieresis -120 KPX Tcommaaccent agrave -120 KPX Tcommaaccent amacron -60 KPX Tcommaaccent aogonek -120 KPX Tcommaaccent aring -120 KPX Tcommaaccent atilde -60 KPX Tcommaaccent colon -20 KPX Tcommaaccent comma -120 KPX Tcommaaccent e -120 KPX Tcommaaccent eacute -120 KPX Tcommaaccent ecaron -120 KPX Tcommaaccent ecircumflex -120 KPX Tcommaaccent edieresis -120 KPX Tcommaaccent edotaccent -120 KPX Tcommaaccent egrave -60 KPX Tcommaaccent emacron -60 KPX Tcommaaccent eogonek -120 KPX Tcommaaccent hyphen -140 KPX Tcommaaccent o -120 KPX Tcommaaccent oacute -120 KPX Tcommaaccent ocircumflex -120 KPX Tcommaaccent odieresis -120 KPX Tcommaaccent ograve -120 KPX Tcommaaccent ohungarumlaut -120 KPX Tcommaaccent omacron -60 KPX Tcommaaccent oslash -120 KPX Tcommaaccent otilde -60 KPX Tcommaaccent period -120 KPX Tcommaaccent r -120 KPX Tcommaaccent racute -120 KPX Tcommaaccent rcaron -120 KPX Tcommaaccent rcommaaccent -120 KPX Tcommaaccent semicolon -20 KPX Tcommaaccent u -120 KPX Tcommaaccent uacute -120 KPX Tcommaaccent ucircumflex -120 KPX Tcommaaccent udieresis -120 KPX Tcommaaccent ugrave -120 KPX Tcommaaccent uhungarumlaut -120 KPX Tcommaaccent umacron -60 KPX Tcommaaccent uogonek -120 KPX Tcommaaccent uring -120 KPX Tcommaaccent w -120 KPX Tcommaaccent y -120 KPX Tcommaaccent yacute -120 KPX Tcommaaccent ydieresis -60 KPX U A -40 KPX U Aacute -40 KPX U Abreve -40 KPX U Acircumflex -40 KPX U Adieresis -40 KPX U Agrave -40 KPX U Amacron -40 KPX U Aogonek -40 KPX U Aring -40 KPX U Atilde -40 KPX U comma -40 KPX U period -40 KPX Uacute A -40 KPX Uacute Aacute -40 KPX Uacute Abreve -40 KPX Uacute Acircumflex -40 KPX Uacute Adieresis -40 KPX Uacute Agrave -40 KPX Uacute Amacron -40 KPX Uacute Aogonek -40 KPX Uacute Aring -40 KPX Uacute Atilde -40 KPX Uacute comma -40 KPX Uacute period -40 KPX Ucircumflex A -40 KPX Ucircumflex Aacute -40 KPX Ucircumflex Abreve -40 KPX Ucircumflex Acircumflex -40 KPX Ucircumflex Adieresis -40 KPX Ucircumflex Agrave -40 KPX Ucircumflex Amacron -40 KPX Ucircumflex Aogonek -40 KPX Ucircumflex Aring -40 KPX Ucircumflex Atilde -40 KPX Ucircumflex comma -40 KPX Ucircumflex period -40 KPX Udieresis A -40 KPX Udieresis Aacute -40 KPX Udieresis Abreve -40 KPX Udieresis Acircumflex -40 KPX Udieresis Adieresis -40 KPX Udieresis Agrave -40 KPX Udieresis Amacron -40 KPX Udieresis Aogonek -40 KPX Udieresis Aring -40 KPX Udieresis Atilde -40 KPX Udieresis comma -40 KPX Udieresis period -40 KPX Ugrave A -40 KPX Ugrave Aacute -40 KPX Ugrave Abreve -40 KPX Ugrave Acircumflex -40 KPX Ugrave Adieresis -40 KPX Ugrave Agrave -40 KPX Ugrave Amacron -40 KPX Ugrave Aogonek -40 KPX Ugrave Aring -40 KPX Ugrave Atilde -40 KPX Ugrave comma -40 KPX Ugrave period -40 KPX Uhungarumlaut A -40 KPX Uhungarumlaut Aacute -40 KPX Uhungarumlaut Abreve -40 KPX Uhungarumlaut Acircumflex -40 KPX Uhungarumlaut Adieresis -40 KPX Uhungarumlaut Agrave -40 KPX Uhungarumlaut Amacron -40 KPX Uhungarumlaut Aogonek -40 KPX Uhungarumlaut Aring -40 KPX Uhungarumlaut Atilde -40 KPX Uhungarumlaut comma -40 KPX Uhungarumlaut period -40 KPX Umacron A -40 KPX Umacron Aacute -40 KPX Umacron Abreve -40 KPX Umacron Acircumflex -40 KPX Umacron Adieresis -40 KPX Umacron Agrave -40 KPX Umacron Amacron -40 KPX Umacron Aogonek -40 KPX Umacron Aring -40 KPX Umacron Atilde -40 KPX Umacron comma -40 KPX Umacron period -40 KPX Uogonek A -40 KPX Uogonek Aacute -40 KPX Uogonek Abreve -40 KPX Uogonek Acircumflex -40 KPX Uogonek Adieresis -40 KPX Uogonek Agrave -40 KPX Uogonek Amacron -40 KPX Uogonek Aogonek -40 KPX Uogonek Aring -40 KPX Uogonek Atilde -40 KPX Uogonek comma -40 KPX Uogonek period -40 KPX Uring A -40 KPX Uring Aacute -40 KPX Uring Abreve -40 KPX Uring Acircumflex -40 KPX Uring Adieresis -40 KPX Uring Agrave -40 KPX Uring Amacron -40 KPX Uring Aogonek -40 KPX Uring Aring -40 KPX Uring Atilde -40 KPX Uring comma -40 KPX Uring period -40 KPX V A -80 KPX V Aacute -80 KPX V Abreve -80 KPX V Acircumflex -80 KPX V Adieresis -80 KPX V Agrave -80 KPX V Amacron -80 KPX V Aogonek -80 KPX V Aring -80 KPX V Atilde -80 KPX V G -40 KPX V Gbreve -40 KPX V Gcommaaccent -40 KPX V O -40 KPX V Oacute -40 KPX V Ocircumflex -40 KPX V Odieresis -40 KPX V Ograve -40 KPX V Ohungarumlaut -40 KPX V Omacron -40 KPX V Oslash -40 KPX V Otilde -40 KPX V a -70 KPX V aacute -70 KPX V abreve -70 KPX V acircumflex -70 KPX V adieresis -70 KPX V agrave -70 KPX V amacron -70 KPX V aogonek -70 KPX V aring -70 KPX V atilde -70 KPX V colon -40 KPX V comma -125 KPX V e -80 KPX V eacute -80 KPX V ecaron -80 KPX V ecircumflex -80 KPX V edieresis -80 KPX V edotaccent -80 KPX V egrave -80 KPX V emacron -80 KPX V eogonek -80 KPX V hyphen -80 KPX V o -80 KPX V oacute -80 KPX V ocircumflex -80 KPX V odieresis -80 KPX V ograve -80 KPX V ohungarumlaut -80 KPX V omacron -80 KPX V oslash -80 KPX V otilde -80 KPX V period -125 KPX V semicolon -40 KPX V u -70 KPX V uacute -70 KPX V ucircumflex -70 KPX V udieresis -70 KPX V ugrave -70 KPX V uhungarumlaut -70 KPX V umacron -70 KPX V uogonek -70 KPX V uring -70 KPX W A -50 KPX W Aacute -50 KPX W Abreve -50 KPX W Acircumflex -50 KPX W Adieresis -50 KPX W Agrave -50 KPX W Amacron -50 KPX W Aogonek -50 KPX W Aring -50 KPX W Atilde -50 KPX W O -20 KPX W Oacute -20 KPX W Ocircumflex -20 KPX W Odieresis -20 KPX W Ograve -20 KPX W Ohungarumlaut -20 KPX W Omacron -20 KPX W Oslash -20 KPX W Otilde -20 KPX W a -40 KPX W aacute -40 KPX W abreve -40 KPX W acircumflex -40 KPX W adieresis -40 KPX W agrave -40 KPX W amacron -40 KPX W aogonek -40 KPX W aring -40 KPX W atilde -40 KPX W comma -80 KPX W e -30 KPX W eacute -30 KPX W ecaron -30 KPX W ecircumflex -30 KPX W edieresis -30 KPX W edotaccent -30 KPX W egrave -30 KPX W emacron -30 KPX W eogonek -30 KPX W hyphen -40 KPX W o -30 KPX W oacute -30 KPX W ocircumflex -30 KPX W odieresis -30 KPX W ograve -30 KPX W ohungarumlaut -30 KPX W omacron -30 KPX W oslash -30 KPX W otilde -30 KPX W period -80 KPX W u -30 KPX W uacute -30 KPX W ucircumflex -30 KPX W udieresis -30 KPX W ugrave -30 KPX W uhungarumlaut -30 KPX W umacron -30 KPX W uogonek -30 KPX W uring -30 KPX W y -20 KPX W yacute -20 KPX W ydieresis -20 KPX Y A -110 KPX Y Aacute -110 KPX Y Abreve -110 KPX Y Acircumflex -110 KPX Y Adieresis -110 KPX Y Agrave -110 KPX Y Amacron -110 KPX Y Aogonek -110 KPX Y Aring -110 KPX Y Atilde -110 KPX Y O -85 KPX Y Oacute -85 KPX Y Ocircumflex -85 KPX Y Odieresis -85 KPX Y Ograve -85 KPX Y Ohungarumlaut -85 KPX Y Omacron -85 KPX Y Oslash -85 KPX Y Otilde -85 KPX Y a -140 KPX Y aacute -140 KPX Y abreve -70 KPX Y acircumflex -140 KPX Y adieresis -140 KPX Y agrave -140 KPX Y amacron -70 KPX Y aogonek -140 KPX Y aring -140 KPX Y atilde -140 KPX Y colon -60 KPX Y comma -140 KPX Y e -140 KPX Y eacute -140 KPX Y ecaron -140 KPX Y ecircumflex -140 KPX Y edieresis -140 KPX Y edotaccent -140 KPX Y egrave -140 KPX Y emacron -70 KPX Y eogonek -140 KPX Y hyphen -140 KPX Y i -20 KPX Y iacute -20 KPX Y iogonek -20 KPX Y o -140 KPX Y oacute -140 KPX Y ocircumflex -140 KPX Y odieresis -140 KPX Y ograve -140 KPX Y ohungarumlaut -140 KPX Y omacron -140 KPX Y oslash -140 KPX Y otilde -140 KPX Y period -140 KPX Y semicolon -60 KPX Y u -110 KPX Y uacute -110 KPX Y ucircumflex -110 KPX Y udieresis -110 KPX Y ugrave -110 KPX Y uhungarumlaut -110 KPX Y umacron -110 KPX Y uogonek -110 KPX Y uring -110 KPX Yacute A -110 KPX Yacute Aacute -110 KPX Yacute Abreve -110 KPX Yacute Acircumflex -110 KPX Yacute Adieresis -110 KPX Yacute Agrave -110 KPX Yacute Amacron -110 KPX Yacute Aogonek -110 KPX Yacute Aring -110 KPX Yacute Atilde -110 KPX Yacute O -85 KPX Yacute Oacute -85 KPX Yacute Ocircumflex -85 KPX Yacute Odieresis -85 KPX Yacute Ograve -85 KPX Yacute Ohungarumlaut -85 KPX Yacute Omacron -85 KPX Yacute Oslash -85 KPX Yacute Otilde -85 KPX Yacute a -140 KPX Yacute aacute -140 KPX Yacute abreve -70 KPX Yacute acircumflex -140 KPX Yacute adieresis -140 KPX Yacute agrave -140 KPX Yacute amacron -70 KPX Yacute aogonek -140 KPX Yacute aring -140 KPX Yacute atilde -70 KPX Yacute colon -60 KPX Yacute comma -140 KPX Yacute e -140 KPX Yacute eacute -140 KPX Yacute ecaron -140 KPX Yacute ecircumflex -140 KPX Yacute edieresis -140 KPX Yacute edotaccent -140 KPX Yacute egrave -140 KPX Yacute emacron -70 KPX Yacute eogonek -140 KPX Yacute hyphen -140 KPX Yacute i -20 KPX Yacute iacute -20 KPX Yacute iogonek -20 KPX Yacute o -140 KPX Yacute oacute -140 KPX Yacute ocircumflex -140 KPX Yacute odieresis -140 KPX Yacute ograve -140 KPX Yacute ohungarumlaut -140 KPX Yacute omacron -70 KPX Yacute oslash -140 KPX Yacute otilde -140 KPX Yacute period -140 KPX Yacute semicolon -60 KPX Yacute u -110 KPX Yacute uacute -110 KPX Yacute ucircumflex -110 KPX Yacute udieresis -110 KPX Yacute ugrave -110 KPX Yacute uhungarumlaut -110 KPX Yacute umacron -110 KPX Yacute uogonek -110 KPX Yacute uring -110 KPX Ydieresis A -110 KPX Ydieresis Aacute -110 KPX Ydieresis Abreve -110 KPX Ydieresis Acircumflex -110 KPX Ydieresis Adieresis -110 KPX Ydieresis Agrave -110 KPX Ydieresis Amacron -110 KPX Ydieresis Aogonek -110 KPX Ydieresis Aring -110 KPX Ydieresis Atilde -110 KPX Ydieresis O -85 KPX Ydieresis Oacute -85 KPX Ydieresis Ocircumflex -85 KPX Ydieresis Odieresis -85 KPX Ydieresis Ograve -85 KPX Ydieresis Ohungarumlaut -85 KPX Ydieresis Omacron -85 KPX Ydieresis Oslash -85 KPX Ydieresis Otilde -85 KPX Ydieresis a -140 KPX Ydieresis aacute -140 KPX Ydieresis abreve -70 KPX Ydieresis acircumflex -140 KPX Ydieresis adieresis -140 KPX Ydieresis agrave -140 KPX Ydieresis amacron -70 KPX Ydieresis aogonek -140 KPX Ydieresis aring -140 KPX Ydieresis atilde -70 KPX Ydieresis colon -60 KPX Ydieresis comma -140 KPX Ydieresis e -140 KPX Ydieresis eacute -140 KPX Ydieresis ecaron -140 KPX Ydieresis ecircumflex -140 KPX Ydieresis edieresis -140 KPX Ydieresis edotaccent -140 KPX Ydieresis egrave -140 KPX Ydieresis emacron -70 KPX Ydieresis eogonek -140 KPX Ydieresis hyphen -140 KPX Ydieresis i -20 KPX Ydieresis iacute -20 KPX Ydieresis iogonek -20 KPX Ydieresis o -140 KPX Ydieresis oacute -140 KPX Ydieresis ocircumflex -140 KPX Ydieresis odieresis -140 KPX Ydieresis ograve -140 KPX Ydieresis ohungarumlaut -140 KPX Ydieresis omacron -140 KPX Ydieresis oslash -140 KPX Ydieresis otilde -140 KPX Ydieresis period -140 KPX Ydieresis semicolon -60 KPX Ydieresis u -110 KPX Ydieresis uacute -110 KPX Ydieresis ucircumflex -110 KPX Ydieresis udieresis -110 KPX Ydieresis ugrave -110 KPX Ydieresis uhungarumlaut -110 KPX Ydieresis umacron -110 KPX Ydieresis uogonek -110 KPX Ydieresis uring -110 KPX a v -20 KPX a w -20 KPX a y -30 KPX a yacute -30 KPX a ydieresis -30 KPX aacute v -20 KPX aacute w -20 KPX aacute y -30 KPX aacute yacute -30 KPX aacute ydieresis -30 KPX abreve v -20 KPX abreve w -20 KPX abreve y -30 KPX abreve yacute -30 KPX abreve ydieresis -30 KPX acircumflex v -20 KPX acircumflex w -20 KPX acircumflex y -30 KPX acircumflex yacute -30 KPX acircumflex ydieresis -30 KPX adieresis v -20 KPX adieresis w -20 KPX adieresis y -30 KPX adieresis yacute -30 KPX adieresis ydieresis -30 KPX agrave v -20 KPX agrave w -20 KPX agrave y -30 KPX agrave yacute -30 KPX agrave ydieresis -30 KPX amacron v -20 KPX amacron w -20 KPX amacron y -30 KPX amacron yacute -30 KPX amacron ydieresis -30 KPX aogonek v -20 KPX aogonek w -20 KPX aogonek y -30 KPX aogonek yacute -30 KPX aogonek ydieresis -30 KPX aring v -20 KPX aring w -20 KPX aring y -30 KPX aring yacute -30 KPX aring ydieresis -30 KPX atilde v -20 KPX atilde w -20 KPX atilde y -30 KPX atilde yacute -30 KPX atilde ydieresis -30 KPX b b -10 KPX b comma -40 KPX b l -20 KPX b lacute -20 KPX b lcommaaccent -20 KPX b lslash -20 KPX b period -40 KPX b u -20 KPX b uacute -20 KPX b ucircumflex -20 KPX b udieresis -20 KPX b ugrave -20 KPX b uhungarumlaut -20 KPX b umacron -20 KPX b uogonek -20 KPX b uring -20 KPX b v -20 KPX b y -20 KPX b yacute -20 KPX b ydieresis -20 KPX c comma -15 KPX c k -20 KPX c kcommaaccent -20 KPX cacute comma -15 KPX cacute k -20 KPX cacute kcommaaccent -20 KPX ccaron comma -15 KPX ccaron k -20 KPX ccaron kcommaaccent -20 KPX ccedilla comma -15 KPX ccedilla k -20 KPX ccedilla kcommaaccent -20 KPX colon space -50 KPX comma quotedblright -100 KPX comma quoteright -100 KPX e comma -15 KPX e period -15 KPX e v -30 KPX e w -20 KPX e x -30 KPX e y -20 KPX e yacute -20 KPX e ydieresis -20 KPX eacute comma -15 KPX eacute period -15 KPX eacute v -30 KPX eacute w -20 KPX eacute x -30 KPX eacute y -20 KPX eacute yacute -20 KPX eacute ydieresis -20 KPX ecaron comma -15 KPX ecaron period -15 KPX ecaron v -30 KPX ecaron w -20 KPX ecaron x -30 KPX ecaron y -20 KPX ecaron yacute -20 KPX ecaron ydieresis -20 KPX ecircumflex comma -15 KPX ecircumflex period -15 KPX ecircumflex v -30 KPX ecircumflex w -20 KPX ecircumflex x -30 KPX ecircumflex y -20 KPX ecircumflex yacute -20 KPX ecircumflex ydieresis -20 KPX edieresis comma -15 KPX edieresis period -15 KPX edieresis v -30 KPX edieresis w -20 KPX edieresis x -30 KPX edieresis y -20 KPX edieresis yacute -20 KPX edieresis ydieresis -20 KPX edotaccent comma -15 KPX edotaccent period -15 KPX edotaccent v -30 KPX edotaccent w -20 KPX edotaccent x -30 KPX edotaccent y -20 KPX edotaccent yacute -20 KPX edotaccent ydieresis -20 KPX egrave comma -15 KPX egrave period -15 KPX egrave v -30 KPX egrave w -20 KPX egrave x -30 KPX egrave y -20 KPX egrave yacute -20 KPX egrave ydieresis -20 KPX emacron comma -15 KPX emacron period -15 KPX emacron v -30 KPX emacron w -20 KPX emacron x -30 KPX emacron y -20 KPX emacron yacute -20 KPX emacron ydieresis -20 KPX eogonek comma -15 KPX eogonek period -15 KPX eogonek v -30 KPX eogonek w -20 KPX eogonek x -30 KPX eogonek y -20 KPX eogonek yacute -20 KPX eogonek ydieresis -20 KPX f a -30 KPX f aacute -30 KPX f abreve -30 KPX f acircumflex -30 KPX f adieresis -30 KPX f agrave -30 KPX f amacron -30 KPX f aogonek -30 KPX f aring -30 KPX f atilde -30 KPX f comma -30 KPX f dotlessi -28 KPX f e -30 KPX f eacute -30 KPX f ecaron -30 KPX f ecircumflex -30 KPX f edieresis -30 KPX f edotaccent -30 KPX f egrave -30 KPX f emacron -30 KPX f eogonek -30 KPX f o -30 KPX f oacute -30 KPX f ocircumflex -30 KPX f odieresis -30 KPX f ograve -30 KPX f ohungarumlaut -30 KPX f omacron -30 KPX f oslash -30 KPX f otilde -30 KPX f period -30 KPX f quotedblright 60 KPX f quoteright 50 KPX g r -10 KPX g racute -10 KPX g rcaron -10 KPX g rcommaaccent -10 KPX gbreve r -10 KPX gbreve racute -10 KPX gbreve rcaron -10 KPX gbreve rcommaaccent -10 KPX gcommaaccent r -10 KPX gcommaaccent racute -10 KPX gcommaaccent rcaron -10 KPX gcommaaccent rcommaaccent -10 KPX h y -30 KPX h yacute -30 KPX h ydieresis -30 KPX k e -20 KPX k eacute -20 KPX k ecaron -20 KPX k ecircumflex -20 KPX k edieresis -20 KPX k edotaccent -20 KPX k egrave -20 KPX k emacron -20 KPX k eogonek -20 KPX k o -20 KPX k oacute -20 KPX k ocircumflex -20 KPX k odieresis -20 KPX k ograve -20 KPX k ohungarumlaut -20 KPX k omacron -20 KPX k oslash -20 KPX k otilde -20 KPX kcommaaccent e -20 KPX kcommaaccent eacute -20 KPX kcommaaccent ecaron -20 KPX kcommaaccent ecircumflex -20 KPX kcommaaccent edieresis -20 KPX kcommaaccent edotaccent -20 KPX kcommaaccent egrave -20 KPX kcommaaccent emacron -20 KPX kcommaaccent eogonek -20 KPX kcommaaccent o -20 KPX kcommaaccent oacute -20 KPX kcommaaccent ocircumflex -20 KPX kcommaaccent odieresis -20 KPX kcommaaccent ograve -20 KPX kcommaaccent ohungarumlaut -20 KPX kcommaaccent omacron -20 KPX kcommaaccent oslash -20 KPX kcommaaccent otilde -20 KPX m u -10 KPX m uacute -10 KPX m ucircumflex -10 KPX m udieresis -10 KPX m ugrave -10 KPX m uhungarumlaut -10 KPX m umacron -10 KPX m uogonek -10 KPX m uring -10 KPX m y -15 KPX m yacute -15 KPX m ydieresis -15 KPX n u -10 KPX n uacute -10 KPX n ucircumflex -10 KPX n udieresis -10 KPX n ugrave -10 KPX n uhungarumlaut -10 KPX n umacron -10 KPX n uogonek -10 KPX n uring -10 KPX n v -20 KPX n y -15 KPX n yacute -15 KPX n ydieresis -15 KPX nacute u -10 KPX nacute uacute -10 KPX nacute ucircumflex -10 KPX nacute udieresis -10 KPX nacute ugrave -10 KPX nacute uhungarumlaut -10 KPX nacute umacron -10 KPX nacute uogonek -10 KPX nacute uring -10 KPX nacute v -20 KPX nacute y -15 KPX nacute yacute -15 KPX nacute ydieresis -15 KPX ncaron u -10 KPX ncaron uacute -10 KPX ncaron ucircumflex -10 KPX ncaron udieresis -10 KPX ncaron ugrave -10 KPX ncaron uhungarumlaut -10 KPX ncaron umacron -10 KPX ncaron uogonek -10 KPX ncaron uring -10 KPX ncaron v -20 KPX ncaron y -15 KPX ncaron yacute -15 KPX ncaron ydieresis -15 KPX ncommaaccent u -10 KPX ncommaaccent uacute -10 KPX ncommaaccent ucircumflex -10 KPX ncommaaccent udieresis -10 KPX ncommaaccent ugrave -10 KPX ncommaaccent uhungarumlaut -10 KPX ncommaaccent umacron -10 KPX ncommaaccent uogonek -10 KPX ncommaaccent uring -10 KPX ncommaaccent v -20 KPX ncommaaccent y -15 KPX ncommaaccent yacute -15 KPX ncommaaccent ydieresis -15 KPX ntilde u -10 KPX ntilde uacute -10 KPX ntilde ucircumflex -10 KPX ntilde udieresis -10 KPX ntilde ugrave -10 KPX ntilde uhungarumlaut -10 KPX ntilde umacron -10 KPX ntilde uogonek -10 KPX ntilde uring -10 KPX ntilde v -20 KPX ntilde y -15 KPX ntilde yacute -15 KPX ntilde ydieresis -15 KPX o comma -40 KPX o period -40 KPX o v -15 KPX o w -15 KPX o x -30 KPX o y -30 KPX o yacute -30 KPX o ydieresis -30 KPX oacute comma -40 KPX oacute period -40 KPX oacute v -15 KPX oacute w -15 KPX oacute x -30 KPX oacute y -30 KPX oacute yacute -30 KPX oacute ydieresis -30 KPX ocircumflex comma -40 KPX ocircumflex period -40 KPX ocircumflex v -15 KPX ocircumflex w -15 KPX ocircumflex x -30 KPX ocircumflex y -30 KPX ocircumflex yacute -30 KPX ocircumflex ydieresis -30 KPX odieresis comma -40 KPX odieresis period -40 KPX odieresis v -15 KPX odieresis w -15 KPX odieresis x -30 KPX odieresis y -30 KPX odieresis yacute -30 KPX odieresis ydieresis -30 KPX ograve comma -40 KPX ograve period -40 KPX ograve v -15 KPX ograve w -15 KPX ograve x -30 KPX ograve y -30 KPX ograve yacute -30 KPX ograve ydieresis -30 KPX ohungarumlaut comma -40 KPX ohungarumlaut period -40 KPX ohungarumlaut v -15 KPX ohungarumlaut w -15 KPX ohungarumlaut x -30 KPX ohungarumlaut y -30 KPX ohungarumlaut yacute -30 KPX ohungarumlaut ydieresis -30 KPX omacron comma -40 KPX omacron period -40 KPX omacron v -15 KPX omacron w -15 KPX omacron x -30 KPX omacron y -30 KPX omacron yacute -30 KPX omacron ydieresis -30 KPX oslash a -55 KPX oslash aacute -55 KPX oslash abreve -55 KPX oslash acircumflex -55 KPX oslash adieresis -55 KPX oslash agrave -55 KPX oslash amacron -55 KPX oslash aogonek -55 KPX oslash aring -55 KPX oslash atilde -55 KPX oslash b -55 KPX oslash c -55 KPX oslash cacute -55 KPX oslash ccaron -55 KPX oslash ccedilla -55 KPX oslash comma -95 KPX oslash d -55 KPX oslash dcroat -55 KPX oslash e -55 KPX oslash eacute -55 KPX oslash ecaron -55 KPX oslash ecircumflex -55 KPX oslash edieresis -55 KPX oslash edotaccent -55 KPX oslash egrave -55 KPX oslash emacron -55 KPX oslash eogonek -55 KPX oslash f -55 KPX oslash g -55 KPX oslash gbreve -55 KPX oslash gcommaaccent -55 KPX oslash h -55 KPX oslash i -55 KPX oslash iacute -55 KPX oslash icircumflex -55 KPX oslash idieresis -55 KPX oslash igrave -55 KPX oslash imacron -55 KPX oslash iogonek -55 KPX oslash j -55 KPX oslash k -55 KPX oslash kcommaaccent -55 KPX oslash l -55 KPX oslash lacute -55 KPX oslash lcommaaccent -55 KPX oslash lslash -55 KPX oslash m -55 KPX oslash n -55 KPX oslash nacute -55 KPX oslash ncaron -55 KPX oslash ncommaaccent -55 KPX oslash ntilde -55 KPX oslash o -55 KPX oslash oacute -55 KPX oslash ocircumflex -55 KPX oslash odieresis -55 KPX oslash ograve -55 KPX oslash ohungarumlaut -55 KPX oslash omacron -55 KPX oslash oslash -55 KPX oslash otilde -55 KPX oslash p -55 KPX oslash period -95 KPX oslash q -55 KPX oslash r -55 KPX oslash racute -55 KPX oslash rcaron -55 KPX oslash rcommaaccent -55 KPX oslash s -55 KPX oslash sacute -55 KPX oslash scaron -55 KPX oslash scedilla -55 KPX oslash scommaaccent -55 KPX oslash t -55 KPX oslash tcommaaccent -55 KPX oslash u -55 KPX oslash uacute -55 KPX oslash ucircumflex -55 KPX oslash udieresis -55 KPX oslash ugrave -55 KPX oslash uhungarumlaut -55 KPX oslash umacron -55 KPX oslash uogonek -55 KPX oslash uring -55 KPX oslash v -70 KPX oslash w -70 KPX oslash x -85 KPX oslash y -70 KPX oslash yacute -70 KPX oslash ydieresis -70 KPX oslash z -55 KPX oslash zacute -55 KPX oslash zcaron -55 KPX oslash zdotaccent -55 KPX otilde comma -40 KPX otilde period -40 KPX otilde v -15 KPX otilde w -15 KPX otilde x -30 KPX otilde y -30 KPX otilde yacute -30 KPX otilde ydieresis -30 KPX p comma -35 KPX p period -35 KPX p y -30 KPX p yacute -30 KPX p ydieresis -30 KPX period quotedblright -100 KPX period quoteright -100 KPX period space -60 KPX quotedblright space -40 KPX quoteleft quoteleft -57 KPX quoteright d -50 KPX quoteright dcroat -50 KPX quoteright quoteright -57 KPX quoteright r -50 KPX quoteright racute -50 KPX quoteright rcaron -50 KPX quoteright rcommaaccent -50 KPX quoteright s -50 KPX quoteright sacute -50 KPX quoteright scaron -50 KPX quoteright scedilla -50 KPX quoteright scommaaccent -50 KPX quoteright space -70 KPX r a -10 KPX r aacute -10 KPX r abreve -10 KPX r acircumflex -10 KPX r adieresis -10 KPX r agrave -10 KPX r amacron -10 KPX r aogonek -10 KPX r aring -10 KPX r atilde -10 KPX r colon 30 KPX r comma -50 KPX r i 15 KPX r iacute 15 KPX r icircumflex 15 KPX r idieresis 15 KPX r igrave 15 KPX r imacron 15 KPX r iogonek 15 KPX r k 15 KPX r kcommaaccent 15 KPX r l 15 KPX r lacute 15 KPX r lcommaaccent 15 KPX r lslash 15 KPX r m 25 KPX r n 25 KPX r nacute 25 KPX r ncaron 25 KPX r ncommaaccent 25 KPX r ntilde 25 KPX r p 30 KPX r period -50 KPX r semicolon 30 KPX r t 40 KPX r tcommaaccent 40 KPX r u 15 KPX r uacute 15 KPX r ucircumflex 15 KPX r udieresis 15 KPX r ugrave 15 KPX r uhungarumlaut 15 KPX r umacron 15 KPX r uogonek 15 KPX r uring 15 KPX r v 30 KPX r y 30 KPX r yacute 30 KPX r ydieresis 30 KPX racute a -10 KPX racute aacute -10 KPX racute abreve -10 KPX racute acircumflex -10 KPX racute adieresis -10 KPX racute agrave -10 KPX racute amacron -10 KPX racute aogonek -10 KPX racute aring -10 KPX racute atilde -10 KPX racute colon 30 KPX racute comma -50 KPX racute i 15 KPX racute iacute 15 KPX racute icircumflex 15 KPX racute idieresis 15 KPX racute igrave 15 KPX racute imacron 15 KPX racute iogonek 15 KPX racute k 15 KPX racute kcommaaccent 15 KPX racute l 15 KPX racute lacute 15 KPX racute lcommaaccent 15 KPX racute lslash 15 KPX racute m 25 KPX racute n 25 KPX racute nacute 25 KPX racute ncaron 25 KPX racute ncommaaccent 25 KPX racute ntilde 25 KPX racute p 30 KPX racute period -50 KPX racute semicolon 30 KPX racute t 40 KPX racute tcommaaccent 40 KPX racute u 15 KPX racute uacute 15 KPX racute ucircumflex 15 KPX racute udieresis 15 KPX racute ugrave 15 KPX racute uhungarumlaut 15 KPX racute umacron 15 KPX racute uogonek 15 KPX racute uring 15 KPX racute v 30 KPX racute y 30 KPX racute yacute 30 KPX racute ydieresis 30 KPX rcaron a -10 KPX rcaron aacute -10 KPX rcaron abreve -10 KPX rcaron acircumflex -10 KPX rcaron adieresis -10 KPX rcaron agrave -10 KPX rcaron amacron -10 KPX rcaron aogonek -10 KPX rcaron aring -10 KPX rcaron atilde -10 KPX rcaron colon 30 KPX rcaron comma -50 KPX rcaron i 15 KPX rcaron iacute 15 KPX rcaron icircumflex 15 KPX rcaron idieresis 15 KPX rcaron igrave 15 KPX rcaron imacron 15 KPX rcaron iogonek 15 KPX rcaron k 15 KPX rcaron kcommaaccent 15 KPX rcaron l 15 KPX rcaron lacute 15 KPX rcaron lcommaaccent 15 KPX rcaron lslash 15 KPX rcaron m 25 KPX rcaron n 25 KPX rcaron nacute 25 KPX rcaron ncaron 25 KPX rcaron ncommaaccent 25 KPX rcaron ntilde 25 KPX rcaron p 30 KPX rcaron period -50 KPX rcaron semicolon 30 KPX rcaron t 40 KPX rcaron tcommaaccent 40 KPX rcaron u 15 KPX rcaron uacute 15 KPX rcaron ucircumflex 15 KPX rcaron udieresis 15 KPX rcaron ugrave 15 KPX rcaron uhungarumlaut 15 KPX rcaron umacron 15 KPX rcaron uogonek 15 KPX rcaron uring 15 KPX rcaron v 30 KPX rcaron y 30 KPX rcaron yacute 30 KPX rcaron ydieresis 30 KPX rcommaaccent a -10 KPX rcommaaccent aacute -10 KPX rcommaaccent abreve -10 KPX rcommaaccent acircumflex -10 KPX rcommaaccent adieresis -10 KPX rcommaaccent agrave -10 KPX rcommaaccent amacron -10 KPX rcommaaccent aogonek -10 KPX rcommaaccent aring -10 KPX rcommaaccent atilde -10 KPX rcommaaccent colon 30 KPX rcommaaccent comma -50 KPX rcommaaccent i 15 KPX rcommaaccent iacute 15 KPX rcommaaccent icircumflex 15 KPX rcommaaccent idieresis 15 KPX rcommaaccent igrave 15 KPX rcommaaccent imacron 15 KPX rcommaaccent iogonek 15 KPX rcommaaccent k 15 KPX rcommaaccent kcommaaccent 15 KPX rcommaaccent l 15 KPX rcommaaccent lacute 15 KPX rcommaaccent lcommaaccent 15 KPX rcommaaccent lslash 15 KPX rcommaaccent m 25 KPX rcommaaccent n 25 KPX rcommaaccent nacute 25 KPX rcommaaccent ncaron 25 KPX rcommaaccent ncommaaccent 25 KPX rcommaaccent ntilde 25 KPX rcommaaccent p 30 KPX rcommaaccent period -50 KPX rcommaaccent semicolon 30 KPX rcommaaccent t 40 KPX rcommaaccent tcommaaccent 40 KPX rcommaaccent u 15 KPX rcommaaccent uacute 15 KPX rcommaaccent ucircumflex 15 KPX rcommaaccent udieresis 15 KPX rcommaaccent ugrave 15 KPX rcommaaccent uhungarumlaut 15 KPX rcommaaccent umacron 15 KPX rcommaaccent uogonek 15 KPX rcommaaccent uring 15 KPX rcommaaccent v 30 KPX rcommaaccent y 30 KPX rcommaaccent yacute 30 KPX rcommaaccent ydieresis 30 KPX s comma -15 KPX s period -15 KPX s w -30 KPX sacute comma -15 KPX sacute period -15 KPX sacute w -30 KPX scaron comma -15 KPX scaron period -15 KPX scaron w -30 KPX scedilla comma -15 KPX scedilla period -15 KPX scedilla w -30 KPX scommaaccent comma -15 KPX scommaaccent period -15 KPX scommaaccent w -30 KPX semicolon space -50 KPX space T -50 KPX space Tcaron -50 KPX space Tcommaaccent -50 KPX space V -50 KPX space W -40 KPX space Y -90 KPX space Yacute -90 KPX space Ydieresis -90 KPX space quotedblleft -30 KPX space quoteleft -60 KPX v a -25 KPX v aacute -25 KPX v abreve -25 KPX v acircumflex -25 KPX v adieresis -25 KPX v agrave -25 KPX v amacron -25 KPX v aogonek -25 KPX v aring -25 KPX v atilde -25 KPX v comma -80 KPX v e -25 KPX v eacute -25 KPX v ecaron -25 KPX v ecircumflex -25 KPX v edieresis -25 KPX v edotaccent -25 KPX v egrave -25 KPX v emacron -25 KPX v eogonek -25 KPX v o -25 KPX v oacute -25 KPX v ocircumflex -25 KPX v odieresis -25 KPX v ograve -25 KPX v ohungarumlaut -25 KPX v omacron -25 KPX v oslash -25 KPX v otilde -25 KPX v period -80 KPX w a -15 KPX w aacute -15 KPX w abreve -15 KPX w acircumflex -15 KPX w adieresis -15 KPX w agrave -15 KPX w amacron -15 KPX w aogonek -15 KPX w aring -15 KPX w atilde -15 KPX w comma -60 KPX w e -10 KPX w eacute -10 KPX w ecaron -10 KPX w ecircumflex -10 KPX w edieresis -10 KPX w edotaccent -10 KPX w egrave -10 KPX w emacron -10 KPX w eogonek -10 KPX w o -10 KPX w oacute -10 KPX w ocircumflex -10 KPX w odieresis -10 KPX w ograve -10 KPX w ohungarumlaut -10 KPX w omacron -10 KPX w oslash -10 KPX w otilde -10 KPX w period -60 KPX x e -30 KPX x eacute -30 KPX x ecaron -30 KPX x ecircumflex -30 KPX x edieresis -30 KPX x edotaccent -30 KPX x egrave -30 KPX x emacron -30 KPX x eogonek -30 KPX y a -20 KPX y aacute -20 KPX y abreve -20 KPX y acircumflex -20 KPX y adieresis -20 KPX y agrave -20 KPX y amacron -20 KPX y aogonek -20 KPX y aring -20 KPX y atilde -20 KPX y comma -100 KPX y e -20 KPX y eacute -20 KPX y ecaron -20 KPX y ecircumflex -20 KPX y edieresis -20 KPX y edotaccent -20 KPX y egrave -20 KPX y emacron -20 KPX y eogonek -20 KPX y o -20 KPX y oacute -20 KPX y ocircumflex -20 KPX y odieresis -20 KPX y ograve -20 KPX y ohungarumlaut -20 KPX y omacron -20 KPX y oslash -20 KPX y otilde -20 KPX y period -100 KPX yacute a -20 KPX yacute aacute -20 KPX yacute abreve -20 KPX yacute acircumflex -20 KPX yacute adieresis -20 KPX yacute agrave -20 KPX yacute amacron -20 KPX yacute aogonek -20 KPX yacute aring -20 KPX yacute atilde -20 KPX yacute comma -100 KPX yacute e -20 KPX yacute eacute -20 KPX yacute ecaron -20 KPX yacute ecircumflex -20 KPX yacute edieresis -20 KPX yacute edotaccent -20 KPX yacute egrave -20 KPX yacute emacron -20 KPX yacute eogonek -20 KPX yacute o -20 KPX yacute oacute -20 KPX yacute ocircumflex -20 KPX yacute odieresis -20 KPX yacute ograve -20 KPX yacute ohungarumlaut -20 KPX yacute omacron -20 KPX yacute oslash -20 KPX yacute otilde -20 KPX yacute period -100 KPX ydieresis a -20 KPX ydieresis aacute -20 KPX ydieresis abreve -20 KPX ydieresis acircumflex -20 KPX ydieresis adieresis -20 KPX ydieresis agrave -20 KPX ydieresis amacron -20 KPX ydieresis aogonek -20 KPX ydieresis aring -20 KPX ydieresis atilde -20 KPX ydieresis comma -100 KPX ydieresis e -20 KPX ydieresis eacute -20 KPX ydieresis ecaron -20 KPX ydieresis ecircumflex -20 KPX ydieresis edieresis -20 KPX ydieresis edotaccent -20 KPX ydieresis egrave -20 KPX ydieresis emacron -20 KPX ydieresis eogonek -20 KPX ydieresis o -20 KPX ydieresis oacute -20 KPX ydieresis ocircumflex -20 KPX ydieresis odieresis -20 KPX ydieresis ograve -20 KPX ydieresis ohungarumlaut -20 KPX ydieresis omacron -20 KPX ydieresis oslash -20 KPX ydieresis otilde -20 KPX ydieresis period -100 KPX z e -15 KPX z eacute -15 KPX z ecaron -15 KPX z ecircumflex -15 KPX z edieresis -15 KPX z edotaccent -15 KPX z egrave -15 KPX z emacron -15 KPX z eogonek -15 KPX z o -15 KPX z oacute -15 KPX z ocircumflex -15 KPX z odieresis -15 KPX z ograve -15 KPX z ohungarumlaut -15 KPX z omacron -15 KPX z oslash -15 KPX z otilde -15 KPX zacute e -15 KPX zacute eacute -15 KPX zacute ecaron -15 KPX zacute ecircumflex -15 KPX zacute edieresis -15 KPX zacute edotaccent -15 KPX zacute egrave -15 KPX zacute emacron -15 KPX zacute eogonek -15 KPX zacute o -15 KPX zacute oacute -15 KPX zacute ocircumflex -15 KPX zacute odieresis -15 KPX zacute ograve -15 KPX zacute ohungarumlaut -15 KPX zacute omacron -15 KPX zacute oslash -15 KPX zacute otilde -15 KPX zcaron e -15 KPX zcaron eacute -15 KPX zcaron ecaron -15 KPX zcaron ecircumflex -15 KPX zcaron edieresis -15 KPX zcaron edotaccent -15 KPX zcaron egrave -15 KPX zcaron emacron -15 KPX zcaron eogonek -15 KPX zcaron o -15 KPX zcaron oacute -15 KPX zcaron ocircumflex -15 KPX zcaron odieresis -15 KPX zcaron ograve -15 KPX zcaron ohungarumlaut -15 KPX zcaron omacron -15 KPX zcaron oslash -15 KPX zcaron otilde -15 KPX zdotaccent e -15 KPX zdotaccent eacute -15 KPX zdotaccent ecaron -15 KPX zdotaccent ecircumflex -15 KPX zdotaccent edieresis -15 KPX zdotaccent edotaccent -15 KPX zdotaccent egrave -15 KPX zdotaccent emacron -15 KPX zdotaccent eogonek -15 KPX zdotaccent o -15 KPX zdotaccent oacute -15 KPX zdotaccent ocircumflex -15 KPX zdotaccent odieresis -15 KPX zdotaccent ograve -15 KPX zdotaccent ohungarumlaut -15 KPX zdotaccent omacron -15 KPX zdotaccent oslash -15 KPX zdotaccent otilde -15 EndKernPairs EndKernData EndFontMetrics glpi-0.84.3+dfsg.1/lib/ezpdf/fonts/php_Helvetica.afm000066400000000000000000004041331226600447100220750ustar00rootroot00000000000000a:22:{s:8:"FontName";s:9:"Helvetica";s:8:"FullName";s:9:"Helvetica";s:10:"FamilyName";s:9:"Helvetica";s:6:"Weight";s:6:"Medium";s:11:"ItalicAngle";s:1:"0";s:12:"IsFixedPitch";s:5:"false";s:12:"CharacterSet";s:13:"ExtendedRoman";s:8:"FontBBox";a:4:{i:0;s:4:"-166";i:1;s:4:"-225";i:2;s:4:"1000";i:3;s:3:"931";}s:17:"UnderlinePosition";s:4:"-100";s:18:"UnderlineThickness";s:2:"50";s:7:"Version";s:7:"002.000";s:14:"EncodingScheme";s:21:"AdobeStandardEncoding";s:9:"CapHeight";s:3:"718";s:7:"XHeight";s:3:"523";s:8:"Ascender";s:3:"718";s:9:"Descender";s:4:"-207";s:5:"StdHW";s:2:"76";s:5:"StdVW";s:2:"88";s:16:"StartCharMetrics";s:3:"315";s:1:"C";a:464:{i:32;a:4:{s:1:"C";s:2:"32";s:2:"WX";s:3:"278";s:1:"N";s:5:"space";s:1:"B";a:4:{i:0;s:1:"0";i:1;s:1:"0";i:2;s:1:"0";i:3;s:1:"0";}}s:5:"space";a:4:{s:1:"C";s:2:"32";s:2:"WX";s:3:"278";s:1:"N";s:5:"space";s:1:"B";a:4:{i:0;s:1:"0";i:1;s:1:"0";i:2;s:1:"0";i:3;s:1:"0";}}i:33;a:4:{s:1:"C";s:2:"33";s:2:"WX";s:3:"278";s:1:"N";s:6:"exclam";s:1:"B";a:4:{i:0;s:2:"90";i:1;s:1:"0";i:2;s:3:"187";i:3;s:3:"718";}}s:6:"exclam";a:4:{s:1:"C";s:2:"33";s:2:"WX";s:3:"278";s:1:"N";s:6:"exclam";s:1:"B";a:4:{i:0;s:2:"90";i:1;s:1:"0";i:2;s:3:"187";i:3;s:3:"718";}}i:34;a:4:{s:1:"C";s:2:"34";s:2:"WX";s:3:"355";s:1:"N";s:8:"quotedbl";s:1:"B";a:4:{i:0;s:2:"70";i:1;s:3:"463";i:2;s:3:"285";i:3;s:3:"718";}}s:8:"quotedbl";a:4:{s:1:"C";s:2:"34";s:2:"WX";s:3:"355";s:1:"N";s:8:"quotedbl";s:1:"B";a:4:{i:0;s:2:"70";i:1;s:3:"463";i:2;s:3:"285";i:3;s:3:"718";}}i:35;a:4:{s:1:"C";s:2:"35";s:2:"WX";s:3:"556";s:1:"N";s:10:"numbersign";s:1:"B";a:4:{i:0;s:2:"28";i:1;s:1:"0";i:2;s:3:"529";i:3;s:3:"688";}}s:10:"numbersign";a:4:{s:1:"C";s:2:"35";s:2:"WX";s:3:"556";s:1:"N";s:10:"numbersign";s:1:"B";a:4:{i:0;s:2:"28";i:1;s:1:"0";i:2;s:3:"529";i:3;s:3:"688";}}i:36;a:4:{s:1:"C";s:2:"36";s:2:"WX";s:3:"556";s:1:"N";s:6:"dollar";s:1:"B";a:4:{i:0;s:2:"32";i:1;s:4:"-115";i:2;s:3:"520";i:3;s:3:"775";}}s:6:"dollar";a:4:{s:1:"C";s:2:"36";s:2:"WX";s:3:"556";s:1:"N";s:6:"dollar";s:1:"B";a:4:{i:0;s:2:"32";i:1;s:4:"-115";i:2;s:3:"520";i:3;s:3:"775";}}i:37;a:4:{s:1:"C";s:2:"37";s:2:"WX";s:3:"889";s:1:"N";s:7:"percent";s:1:"B";a:4:{i:0;s:2:"39";i:1;s:3:"-19";i:2;s:3:"850";i:3;s:3:"703";}}s:7:"percent";a:4:{s:1:"C";s:2:"37";s:2:"WX";s:3:"889";s:1:"N";s:7:"percent";s:1:"B";a:4:{i:0;s:2:"39";i:1;s:3:"-19";i:2;s:3:"850";i:3;s:3:"703";}}i:38;a:4:{s:1:"C";s:2:"38";s:2:"WX";s:3:"667";s:1:"N";s:9:"ampersand";s:1:"B";a:4:{i:0;s:2:"44";i:1;s:3:"-15";i:2;s:3:"645";i:3;s:3:"718";}}s:9:"ampersand";a:4:{s:1:"C";s:2:"38";s:2:"WX";s:3:"667";s:1:"N";s:9:"ampersand";s:1:"B";a:4:{i:0;s:2:"44";i:1;s:3:"-15";i:2;s:3:"645";i:3;s:3:"718";}}i:39;a:4:{s:1:"C";s:2:"39";s:2:"WX";s:3:"222";s:1:"N";s:10:"quoteright";s:1:"B";a:4:{i:0;s:2:"53";i:1;s:3:"463";i:2;s:3:"157";i:3;s:3:"718";}}s:10:"quoteright";a:4:{s:1:"C";s:2:"39";s:2:"WX";s:3:"222";s:1:"N";s:10:"quoteright";s:1:"B";a:4:{i:0;s:2:"53";i:1;s:3:"463";i:2;s:3:"157";i:3;s:3:"718";}}i:40;a:4:{s:1:"C";s:2:"40";s:2:"WX";s:3:"333";s:1:"N";s:9:"parenleft";s:1:"B";a:4:{i:0;s:2:"68";i:1;s:4:"-207";i:2;s:3:"299";i:3;s:3:"733";}}s:9:"parenleft";a:4:{s:1:"C";s:2:"40";s:2:"WX";s:3:"333";s:1:"N";s:9:"parenleft";s:1:"B";a:4:{i:0;s:2:"68";i:1;s:4:"-207";i:2;s:3:"299";i:3;s:3:"733";}}i:41;a:4:{s:1:"C";s:2:"41";s:2:"WX";s:3:"333";s:1:"N";s:10:"parenright";s:1:"B";a:4:{i:0;s:2:"34";i:1;s:4:"-207";i:2;s:3:"265";i:3;s:3:"733";}}s:10:"parenright";a:4:{s:1:"C";s:2:"41";s:2:"WX";s:3:"333";s:1:"N";s:10:"parenright";s:1:"B";a:4:{i:0;s:2:"34";i:1;s:4:"-207";i:2;s:3:"265";i:3;s:3:"733";}}i:42;a:4:{s:1:"C";s:2:"42";s:2:"WX";s:3:"389";s:1:"N";s:8:"asterisk";s:1:"B";a:4:{i:0;s:2:"39";i:1;s:3:"431";i:2;s:3:"349";i:3;s:3:"718";}}s:8:"asterisk";a:4:{s:1:"C";s:2:"42";s:2:"WX";s:3:"389";s:1:"N";s:8:"asterisk";s:1:"B";a:4:{i:0;s:2:"39";i:1;s:3:"431";i:2;s:3:"349";i:3;s:3:"718";}}i:43;a:4:{s:1:"C";s:2:"43";s:2:"WX";s:3:"584";s:1:"N";s:4:"plus";s:1:"B";a:4:{i:0;s:2:"39";i:1;s:1:"0";i:2;s:3:"545";i:3;s:3:"505";}}s:4:"plus";a:4:{s:1:"C";s:2:"43";s:2:"WX";s:3:"584";s:1:"N";s:4:"plus";s:1:"B";a:4:{i:0;s:2:"39";i:1;s:1:"0";i:2;s:3:"545";i:3;s:3:"505";}}i:44;a:4:{s:1:"C";s:2:"44";s:2:"WX";s:3:"278";s:1:"N";s:5:"comma";s:1:"B";a:4:{i:0;s:2:"87";i:1;s:4:"-147";i:2;s:3:"191";i:3;s:3:"106";}}s:5:"comma";a:4:{s:1:"C";s:2:"44";s:2:"WX";s:3:"278";s:1:"N";s:5:"comma";s:1:"B";a:4:{i:0;s:2:"87";i:1;s:4:"-147";i:2;s:3:"191";i:3;s:3:"106";}}i:45;a:4:{s:1:"C";s:2:"45";s:2:"WX";s:3:"333";s:1:"N";s:6:"hyphen";s:1:"B";a:4:{i:0;s:2:"44";i:1;s:3:"232";i:2;s:3:"289";i:3;s:3:"322";}}s:6:"hyphen";a:4:{s:1:"C";s:2:"45";s:2:"WX";s:3:"333";s:1:"N";s:6:"hyphen";s:1:"B";a:4:{i:0;s:2:"44";i:1;s:3:"232";i:2;s:3:"289";i:3;s:3:"322";}}i:46;a:4:{s:1:"C";s:2:"46";s:2:"WX";s:3:"278";s:1:"N";s:6:"period";s:1:"B";a:4:{i:0;s:2:"87";i:1;s:1:"0";i:2;s:3:"191";i:3;s:3:"106";}}s:6:"period";a:4:{s:1:"C";s:2:"46";s:2:"WX";s:3:"278";s:1:"N";s:6:"period";s:1:"B";a:4:{i:0;s:2:"87";i:1;s:1:"0";i:2;s:3:"191";i:3;s:3:"106";}}i:47;a:4:{s:1:"C";s:2:"47";s:2:"WX";s:3:"278";s:1:"N";s:5:"slash";s:1:"B";a:4:{i:0;s:3:"-17";i:1;s:3:"-19";i:2;s:3:"295";i:3;s:3:"737";}}s:5:"slash";a:4:{s:1:"C";s:2:"47";s:2:"WX";s:3:"278";s:1:"N";s:5:"slash";s:1:"B";a:4:{i:0;s:3:"-17";i:1;s:3:"-19";i:2;s:3:"295";i:3;s:3:"737";}}i:48;a:4:{s:1:"C";s:2:"48";s:2:"WX";s:3:"556";s:1:"N";s:4:"zero";s:1:"B";a:4:{i:0;s:2:"37";i:1;s:3:"-19";i:2;s:3:"519";i:3;s:3:"703";}}s:4:"zero";a:4:{s:1:"C";s:2:"48";s:2:"WX";s:3:"556";s:1:"N";s:4:"zero";s:1:"B";a:4:{i:0;s:2:"37";i:1;s:3:"-19";i:2;s:3:"519";i:3;s:3:"703";}}i:49;a:4:{s:1:"C";s:2:"49";s:2:"WX";s:3:"556";s:1:"N";s:3:"one";s:1:"B";a:4:{i:0;s:3:"101";i:1;s:1:"0";i:2;s:3:"359";i:3;s:3:"703";}}s:3:"one";a:4:{s:1:"C";s:2:"49";s:2:"WX";s:3:"556";s:1:"N";s:3:"one";s:1:"B";a:4:{i:0;s:3:"101";i:1;s:1:"0";i:2;s:3:"359";i:3;s:3:"703";}}i:50;a:4:{s:1:"C";s:2:"50";s:2:"WX";s:3:"556";s:1:"N";s:3:"two";s:1:"B";a:4:{i:0;s:2:"26";i:1;s:1:"0";i:2;s:3:"507";i:3;s:3:"703";}}s:3:"two";a:4:{s:1:"C";s:2:"50";s:2:"WX";s:3:"556";s:1:"N";s:3:"two";s:1:"B";a:4:{i:0;s:2:"26";i:1;s:1:"0";i:2;s:3:"507";i:3;s:3:"703";}}i:51;a:4:{s:1:"C";s:2:"51";s:2:"WX";s:3:"556";s:1:"N";s:5:"three";s:1:"B";a:4:{i:0;s:2:"34";i:1;s:3:"-19";i:2;s:3:"522";i:3;s:3:"703";}}s:5:"three";a:4:{s:1:"C";s:2:"51";s:2:"WX";s:3:"556";s:1:"N";s:5:"three";s:1:"B";a:4:{i:0;s:2:"34";i:1;s:3:"-19";i:2;s:3:"522";i:3;s:3:"703";}}i:52;a:4:{s:1:"C";s:2:"52";s:2:"WX";s:3:"556";s:1:"N";s:4:"four";s:1:"B";a:4:{i:0;s:2:"25";i:1;s:1:"0";i:2;s:3:"523";i:3;s:3:"703";}}s:4:"four";a:4:{s:1:"C";s:2:"52";s:2:"WX";s:3:"556";s:1:"N";s:4:"four";s:1:"B";a:4:{i:0;s:2:"25";i:1;s:1:"0";i:2;s:3:"523";i:3;s:3:"703";}}i:53;a:4:{s:1:"C";s:2:"53";s:2:"WX";s:3:"556";s:1:"N";s:4:"five";s:1:"B";a:4:{i:0;s:2:"32";i:1;s:3:"-19";i:2;s:3:"514";i:3;s:3:"688";}}s:4:"five";a:4:{s:1:"C";s:2:"53";s:2:"WX";s:3:"556";s:1:"N";s:4:"five";s:1:"B";a:4:{i:0;s:2:"32";i:1;s:3:"-19";i:2;s:3:"514";i:3;s:3:"688";}}i:54;a:4:{s:1:"C";s:2:"54";s:2:"WX";s:3:"556";s:1:"N";s:3:"six";s:1:"B";a:4:{i:0;s:2:"38";i:1;s:3:"-19";i:2;s:3:"518";i:3;s:3:"703";}}s:3:"six";a:4:{s:1:"C";s:2:"54";s:2:"WX";s:3:"556";s:1:"N";s:3:"six";s:1:"B";a:4:{i:0;s:2:"38";i:1;s:3:"-19";i:2;s:3:"518";i:3;s:3:"703";}}i:55;a:4:{s:1:"C";s:2:"55";s:2:"WX";s:3:"556";s:1:"N";s:5:"seven";s:1:"B";a:4:{i:0;s:2:"37";i:1;s:1:"0";i:2;s:3:"523";i:3;s:3:"688";}}s:5:"seven";a:4:{s:1:"C";s:2:"55";s:2:"WX";s:3:"556";s:1:"N";s:5:"seven";s:1:"B";a:4:{i:0;s:2:"37";i:1;s:1:"0";i:2;s:3:"523";i:3;s:3:"688";}}i:56;a:4:{s:1:"C";s:2:"56";s:2:"WX";s:3:"556";s:1:"N";s:5:"eight";s:1:"B";a:4:{i:0;s:2:"38";i:1;s:3:"-19";i:2;s:3:"517";i:3;s:3:"703";}}s:5:"eight";a:4:{s:1:"C";s:2:"56";s:2:"WX";s:3:"556";s:1:"N";s:5:"eight";s:1:"B";a:4:{i:0;s:2:"38";i:1;s:3:"-19";i:2;s:3:"517";i:3;s:3:"703";}}i:57;a:4:{s:1:"C";s:2:"57";s:2:"WX";s:3:"556";s:1:"N";s:4:"nine";s:1:"B";a:4:{i:0;s:2:"42";i:1;s:3:"-19";i:2;s:3:"514";i:3;s:3:"703";}}s:4:"nine";a:4:{s:1:"C";s:2:"57";s:2:"WX";s:3:"556";s:1:"N";s:4:"nine";s:1:"B";a:4:{i:0;s:2:"42";i:1;s:3:"-19";i:2;s:3:"514";i:3;s:3:"703";}}i:58;a:4:{s:1:"C";s:2:"58";s:2:"WX";s:3:"278";s:1:"N";s:5:"colon";s:1:"B";a:4:{i:0;s:2:"87";i:1;s:1:"0";i:2;s:3:"191";i:3;s:3:"516";}}s:5:"colon";a:4:{s:1:"C";s:2:"58";s:2:"WX";s:3:"278";s:1:"N";s:5:"colon";s:1:"B";a:4:{i:0;s:2:"87";i:1;s:1:"0";i:2;s:3:"191";i:3;s:3:"516";}}i:59;a:4:{s:1:"C";s:2:"59";s:2:"WX";s:3:"278";s:1:"N";s:9:"semicolon";s:1:"B";a:4:{i:0;s:2:"87";i:1;s:4:"-147";i:2;s:3:"191";i:3;s:3:"516";}}s:9:"semicolon";a:4:{s:1:"C";s:2:"59";s:2:"WX";s:3:"278";s:1:"N";s:9:"semicolon";s:1:"B";a:4:{i:0;s:2:"87";i:1;s:4:"-147";i:2;s:3:"191";i:3;s:3:"516";}}i:60;a:4:{s:1:"C";s:2:"60";s:2:"WX";s:3:"584";s:1:"N";s:4:"less";s:1:"B";a:4:{i:0;s:2:"48";i:1;s:2:"11";i:2;s:3:"536";i:3;s:3:"495";}}s:4:"less";a:4:{s:1:"C";s:2:"60";s:2:"WX";s:3:"584";s:1:"N";s:4:"less";s:1:"B";a:4:{i:0;s:2:"48";i:1;s:2:"11";i:2;s:3:"536";i:3;s:3:"495";}}i:61;a:4:{s:1:"C";s:2:"61";s:2:"WX";s:3:"584";s:1:"N";s:5:"equal";s:1:"B";a:4:{i:0;s:2:"39";i:1;s:3:"115";i:2;s:3:"545";i:3;s:3:"390";}}s:5:"equal";a:4:{s:1:"C";s:2:"61";s:2:"WX";s:3:"584";s:1:"N";s:5:"equal";s:1:"B";a:4:{i:0;s:2:"39";i:1;s:3:"115";i:2;s:3:"545";i:3;s:3:"390";}}i:62;a:4:{s:1:"C";s:2:"62";s:2:"WX";s:3:"584";s:1:"N";s:7:"greater";s:1:"B";a:4:{i:0;s:2:"48";i:1;s:2:"11";i:2;s:3:"536";i:3;s:3:"495";}}s:7:"greater";a:4:{s:1:"C";s:2:"62";s:2:"WX";s:3:"584";s:1:"N";s:7:"greater";s:1:"B";a:4:{i:0;s:2:"48";i:1;s:2:"11";i:2;s:3:"536";i:3;s:3:"495";}}i:63;a:4:{s:1:"C";s:2:"63";s:2:"WX";s:3:"556";s:1:"N";s:8:"question";s:1:"B";a:4:{i:0;s:2:"56";i:1;s:1:"0";i:2;s:3:"492";i:3;s:3:"727";}}s:8:"question";a:4:{s:1:"C";s:2:"63";s:2:"WX";s:3:"556";s:1:"N";s:8:"question";s:1:"B";a:4:{i:0;s:2:"56";i:1;s:1:"0";i:2;s:3:"492";i:3;s:3:"727";}}i:64;a:4:{s:1:"C";s:2:"64";s:2:"WX";s:4:"1015";s:1:"N";s:2:"at";s:1:"B";a:4:{i:0;s:3:"147";i:1;s:3:"-19";i:2;s:3:"868";i:3;s:3:"737";}}s:2:"at";a:4:{s:1:"C";s:2:"64";s:2:"WX";s:4:"1015";s:1:"N";s:2:"at";s:1:"B";a:4:{i:0;s:3:"147";i:1;s:3:"-19";i:2;s:3:"868";i:3;s:3:"737";}}i:65;a:4:{s:1:"C";s:2:"65";s:2:"WX";s:3:"667";s:1:"N";s:1:"A";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:1:"0";i:2;s:3:"654";i:3;s:3:"718";}}s:1:"A";a:4:{s:1:"C";s:2:"65";s:2:"WX";s:3:"667";s:1:"N";s:1:"A";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:1:"0";i:2;s:3:"654";i:3;s:3:"718";}}i:66;a:4:{s:1:"C";s:2:"66";s:2:"WX";s:3:"667";s:1:"N";s:1:"B";s:1:"B";a:4:{i:0;s:2:"74";i:1;s:1:"0";i:2;s:3:"627";i:3;s:3:"718";}}s:1:"B";a:4:{s:1:"C";s:2:"66";s:2:"WX";s:3:"667";s:1:"N";s:1:"B";s:1:"B";a:4:{i:0;s:2:"74";i:1;s:1:"0";i:2;s:3:"627";i:3;s:3:"718";}}i:67;a:4:{s:1:"C";s:2:"67";s:2:"WX";s:3:"722";s:1:"N";s:1:"C";s:1:"B";a:4:{i:0;s:2:"44";i:1;s:3:"-19";i:2;s:3:"681";i:3;s:3:"737";}}s:1:"C";a:4:{s:1:"C";s:2:"67";s:2:"WX";s:3:"722";s:1:"N";s:1:"C";s:1:"B";a:4:{i:0;s:2:"44";i:1;s:3:"-19";i:2;s:3:"681";i:3;s:3:"737";}}i:68;a:4:{s:1:"C";s:2:"68";s:2:"WX";s:3:"722";s:1:"N";s:1:"D";s:1:"B";a:4:{i:0;s:2:"81";i:1;s:1:"0";i:2;s:3:"674";i:3;s:3:"718";}}s:1:"D";a:4:{s:1:"C";s:2:"68";s:2:"WX";s:3:"722";s:1:"N";s:1:"D";s:1:"B";a:4:{i:0;s:2:"81";i:1;s:1:"0";i:2;s:3:"674";i:3;s:3:"718";}}i:69;a:4:{s:1:"C";s:2:"69";s:2:"WX";s:3:"667";s:1:"N";s:1:"E";s:1:"B";a:4:{i:0;s:2:"86";i:1;s:1:"0";i:2;s:3:"616";i:3;s:3:"718";}}s:1:"E";a:4:{s:1:"C";s:2:"69";s:2:"WX";s:3:"667";s:1:"N";s:1:"E";s:1:"B";a:4:{i:0;s:2:"86";i:1;s:1:"0";i:2;s:3:"616";i:3;s:3:"718";}}i:70;a:4:{s:1:"C";s:2:"70";s:2:"WX";s:3:"611";s:1:"N";s:1:"F";s:1:"B";a:4:{i:0;s:2:"86";i:1;s:1:"0";i:2;s:3:"583";i:3;s:3:"718";}}s:1:"F";a:4:{s:1:"C";s:2:"70";s:2:"WX";s:3:"611";s:1:"N";s:1:"F";s:1:"B";a:4:{i:0;s:2:"86";i:1;s:1:"0";i:2;s:3:"583";i:3;s:3:"718";}}i:71;a:4:{s:1:"C";s:2:"71";s:2:"WX";s:3:"778";s:1:"N";s:1:"G";s:1:"B";a:4:{i:0;s:2:"48";i:1;s:3:"-19";i:2;s:3:"704";i:3;s:3:"737";}}s:1:"G";a:4:{s:1:"C";s:2:"71";s:2:"WX";s:3:"778";s:1:"N";s:1:"G";s:1:"B";a:4:{i:0;s:2:"48";i:1;s:3:"-19";i:2;s:3:"704";i:3;s:3:"737";}}i:72;a:4:{s:1:"C";s:2:"72";s:2:"WX";s:3:"722";s:1:"N";s:1:"H";s:1:"B";a:4:{i:0;s:2:"77";i:1;s:1:"0";i:2;s:3:"646";i:3;s:3:"718";}}s:1:"H";a:4:{s:1:"C";s:2:"72";s:2:"WX";s:3:"722";s:1:"N";s:1:"H";s:1:"B";a:4:{i:0;s:2:"77";i:1;s:1:"0";i:2;s:3:"646";i:3;s:3:"718";}}i:73;a:4:{s:1:"C";s:2:"73";s:2:"WX";s:3:"278";s:1:"N";s:1:"I";s:1:"B";a:4:{i:0;s:2:"91";i:1;s:1:"0";i:2;s:3:"188";i:3;s:3:"718";}}s:1:"I";a:4:{s:1:"C";s:2:"73";s:2:"WX";s:3:"278";s:1:"N";s:1:"I";s:1:"B";a:4:{i:0;s:2:"91";i:1;s:1:"0";i:2;s:3:"188";i:3;s:3:"718";}}i:74;a:4:{s:1:"C";s:2:"74";s:2:"WX";s:3:"500";s:1:"N";s:1:"J";s:1:"B";a:4:{i:0;s:2:"17";i:1;s:3:"-19";i:2;s:3:"428";i:3;s:3:"718";}}s:1:"J";a:4:{s:1:"C";s:2:"74";s:2:"WX";s:3:"500";s:1:"N";s:1:"J";s:1:"B";a:4:{i:0;s:2:"17";i:1;s:3:"-19";i:2;s:3:"428";i:3;s:3:"718";}}i:75;a:4:{s:1:"C";s:2:"75";s:2:"WX";s:3:"667";s:1:"N";s:1:"K";s:1:"B";a:4:{i:0;s:2:"76";i:1;s:1:"0";i:2;s:3:"663";i:3;s:3:"718";}}s:1:"K";a:4:{s:1:"C";s:2:"75";s:2:"WX";s:3:"667";s:1:"N";s:1:"K";s:1:"B";a:4:{i:0;s:2:"76";i:1;s:1:"0";i:2;s:3:"663";i:3;s:3:"718";}}i:76;a:4:{s:1:"C";s:2:"76";s:2:"WX";s:3:"556";s:1:"N";s:1:"L";s:1:"B";a:4:{i:0;s:2:"76";i:1;s:1:"0";i:2;s:3:"537";i:3;s:3:"718";}}s:1:"L";a:4:{s:1:"C";s:2:"76";s:2:"WX";s:3:"556";s:1:"N";s:1:"L";s:1:"B";a:4:{i:0;s:2:"76";i:1;s:1:"0";i:2;s:3:"537";i:3;s:3:"718";}}i:77;a:4:{s:1:"C";s:2:"77";s:2:"WX";s:3:"833";s:1:"N";s:1:"M";s:1:"B";a:4:{i:0;s:2:"73";i:1;s:1:"0";i:2;s:3:"761";i:3;s:3:"718";}}s:1:"M";a:4:{s:1:"C";s:2:"77";s:2:"WX";s:3:"833";s:1:"N";s:1:"M";s:1:"B";a:4:{i:0;s:2:"73";i:1;s:1:"0";i:2;s:3:"761";i:3;s:3:"718";}}i:78;a:4:{s:1:"C";s:2:"78";s:2:"WX";s:3:"722";s:1:"N";s:1:"N";s:1:"B";a:4:{i:0;s:2:"76";i:1;s:1:"0";i:2;s:3:"646";i:3;s:3:"718";}}s:1:"N";a:4:{s:1:"C";s:2:"78";s:2:"WX";s:3:"722";s:1:"N";s:1:"N";s:1:"B";a:4:{i:0;s:2:"76";i:1;s:1:"0";i:2;s:3:"646";i:3;s:3:"718";}}i:79;a:4:{s:1:"C";s:2:"79";s:2:"WX";s:3:"778";s:1:"N";s:1:"O";s:1:"B";a:4:{i:0;s:2:"39";i:1;s:3:"-19";i:2;s:3:"739";i:3;s:3:"737";}}s:1:"O";a:4:{s:1:"C";s:2:"79";s:2:"WX";s:3:"778";s:1:"N";s:1:"O";s:1:"B";a:4:{i:0;s:2:"39";i:1;s:3:"-19";i:2;s:3:"739";i:3;s:3:"737";}}i:80;a:4:{s:1:"C";s:2:"80";s:2:"WX";s:3:"667";s:1:"N";s:1:"P";s:1:"B";a:4:{i:0;s:2:"86";i:1;s:1:"0";i:2;s:3:"622";i:3;s:3:"718";}}s:1:"P";a:4:{s:1:"C";s:2:"80";s:2:"WX";s:3:"667";s:1:"N";s:1:"P";s:1:"B";a:4:{i:0;s:2:"86";i:1;s:1:"0";i:2;s:3:"622";i:3;s:3:"718";}}i:81;a:4:{s:1:"C";s:2:"81";s:2:"WX";s:3:"778";s:1:"N";s:1:"Q";s:1:"B";a:4:{i:0;s:2:"39";i:1;s:3:"-56";i:2;s:3:"739";i:3;s:3:"737";}}s:1:"Q";a:4:{s:1:"C";s:2:"81";s:2:"WX";s:3:"778";s:1:"N";s:1:"Q";s:1:"B";a:4:{i:0;s:2:"39";i:1;s:3:"-56";i:2;s:3:"739";i:3;s:3:"737";}}i:82;a:4:{s:1:"C";s:2:"82";s:2:"WX";s:3:"722";s:1:"N";s:1:"R";s:1:"B";a:4:{i:0;s:2:"88";i:1;s:1:"0";i:2;s:3:"684";i:3;s:3:"718";}}s:1:"R";a:4:{s:1:"C";s:2:"82";s:2:"WX";s:3:"722";s:1:"N";s:1:"R";s:1:"B";a:4:{i:0;s:2:"88";i:1;s:1:"0";i:2;s:3:"684";i:3;s:3:"718";}}i:83;a:4:{s:1:"C";s:2:"83";s:2:"WX";s:3:"667";s:1:"N";s:1:"S";s:1:"B";a:4:{i:0;s:2:"49";i:1;s:3:"-19";i:2;s:3:"620";i:3;s:3:"737";}}s:1:"S";a:4:{s:1:"C";s:2:"83";s:2:"WX";s:3:"667";s:1:"N";s:1:"S";s:1:"B";a:4:{i:0;s:2:"49";i:1;s:3:"-19";i:2;s:3:"620";i:3;s:3:"737";}}i:84;a:4:{s:1:"C";s:2:"84";s:2:"WX";s:3:"611";s:1:"N";s:1:"T";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:1:"0";i:2;s:3:"597";i:3;s:3:"718";}}s:1:"T";a:4:{s:1:"C";s:2:"84";s:2:"WX";s:3:"611";s:1:"N";s:1:"T";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:1:"0";i:2;s:3:"597";i:3;s:3:"718";}}i:85;a:4:{s:1:"C";s:2:"85";s:2:"WX";s:3:"722";s:1:"N";s:1:"U";s:1:"B";a:4:{i:0;s:2:"79";i:1;s:3:"-19";i:2;s:3:"644";i:3;s:3:"718";}}s:1:"U";a:4:{s:1:"C";s:2:"85";s:2:"WX";s:3:"722";s:1:"N";s:1:"U";s:1:"B";a:4:{i:0;s:2:"79";i:1;s:3:"-19";i:2;s:3:"644";i:3;s:3:"718";}}i:86;a:4:{s:1:"C";s:2:"86";s:2:"WX";s:3:"667";s:1:"N";s:1:"V";s:1:"B";a:4:{i:0;s:2:"20";i:1;s:1:"0";i:2;s:3:"647";i:3;s:3:"718";}}s:1:"V";a:4:{s:1:"C";s:2:"86";s:2:"WX";s:3:"667";s:1:"N";s:1:"V";s:1:"B";a:4:{i:0;s:2:"20";i:1;s:1:"0";i:2;s:3:"647";i:3;s:3:"718";}}i:87;a:4:{s:1:"C";s:2:"87";s:2:"WX";s:3:"944";s:1:"N";s:1:"W";s:1:"B";a:4:{i:0;s:2:"16";i:1;s:1:"0";i:2;s:3:"928";i:3;s:3:"718";}}s:1:"W";a:4:{s:1:"C";s:2:"87";s:2:"WX";s:3:"944";s:1:"N";s:1:"W";s:1:"B";a:4:{i:0;s:2:"16";i:1;s:1:"0";i:2;s:3:"928";i:3;s:3:"718";}}i:88;a:4:{s:1:"C";s:2:"88";s:2:"WX";s:3:"667";s:1:"N";s:1:"X";s:1:"B";a:4:{i:0;s:2:"19";i:1;s:1:"0";i:2;s:3:"648";i:3;s:3:"718";}}s:1:"X";a:4:{s:1:"C";s:2:"88";s:2:"WX";s:3:"667";s:1:"N";s:1:"X";s:1:"B";a:4:{i:0;s:2:"19";i:1;s:1:"0";i:2;s:3:"648";i:3;s:3:"718";}}i:89;a:4:{s:1:"C";s:2:"89";s:2:"WX";s:3:"667";s:1:"N";s:1:"Y";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:1:"0";i:2;s:3:"653";i:3;s:3:"718";}}s:1:"Y";a:4:{s:1:"C";s:2:"89";s:2:"WX";s:3:"667";s:1:"N";s:1:"Y";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:1:"0";i:2;s:3:"653";i:3;s:3:"718";}}i:90;a:4:{s:1:"C";s:2:"90";s:2:"WX";s:3:"611";s:1:"N";s:1:"Z";s:1:"B";a:4:{i:0;s:2:"23";i:1;s:1:"0";i:2;s:3:"588";i:3;s:3:"718";}}s:1:"Z";a:4:{s:1:"C";s:2:"90";s:2:"WX";s:3:"611";s:1:"N";s:1:"Z";s:1:"B";a:4:{i:0;s:2:"23";i:1;s:1:"0";i:2;s:3:"588";i:3;s:3:"718";}}i:91;a:4:{s:1:"C";s:2:"91";s:2:"WX";s:3:"278";s:1:"N";s:11:"bracketleft";s:1:"B";a:4:{i:0;s:2:"63";i:1;s:4:"-196";i:2;s:3:"250";i:3;s:3:"722";}}s:11:"bracketleft";a:4:{s:1:"C";s:2:"91";s:2:"WX";s:3:"278";s:1:"N";s:11:"bracketleft";s:1:"B";a:4:{i:0;s:2:"63";i:1;s:4:"-196";i:2;s:3:"250";i:3;s:3:"722";}}i:92;a:4:{s:1:"C";s:2:"92";s:2:"WX";s:3:"278";s:1:"N";s:9:"backslash";s:1:"B";a:4:{i:0;s:3:"-17";i:1;s:3:"-19";i:2;s:3:"295";i:3;s:3:"737";}}s:9:"backslash";a:4:{s:1:"C";s:2:"92";s:2:"WX";s:3:"278";s:1:"N";s:9:"backslash";s:1:"B";a:4:{i:0;s:3:"-17";i:1;s:3:"-19";i:2;s:3:"295";i:3;s:3:"737";}}i:93;a:4:{s:1:"C";s:2:"93";s:2:"WX";s:3:"278";s:1:"N";s:12:"bracketright";s:1:"B";a:4:{i:0;s:2:"28";i:1;s:4:"-196";i:2;s:3:"215";i:3;s:3:"722";}}s:12:"bracketright";a:4:{s:1:"C";s:2:"93";s:2:"WX";s:3:"278";s:1:"N";s:12:"bracketright";s:1:"B";a:4:{i:0;s:2:"28";i:1;s:4:"-196";i:2;s:3:"215";i:3;s:3:"722";}}i:94;a:4:{s:1:"C";s:2:"94";s:2:"WX";s:3:"469";s:1:"N";s:11:"asciicircum";s:1:"B";a:4:{i:0;s:3:"-14";i:1;s:3:"264";i:2;s:3:"483";i:3;s:3:"688";}}s:11:"asciicircum";a:4:{s:1:"C";s:2:"94";s:2:"WX";s:3:"469";s:1:"N";s:11:"asciicircum";s:1:"B";a:4:{i:0;s:3:"-14";i:1;s:3:"264";i:2;s:3:"483";i:3;s:3:"688";}}i:95;a:4:{s:1:"C";s:2:"95";s:2:"WX";s:3:"556";s:1:"N";s:10:"underscore";s:1:"B";a:4:{i:0;s:1:"0";i:1;s:4:"-125";i:2;s:3:"556";i:3;s:3:"-75";}}s:10:"underscore";a:4:{s:1:"C";s:2:"95";s:2:"WX";s:3:"556";s:1:"N";s:10:"underscore";s:1:"B";a:4:{i:0;s:1:"0";i:1;s:4:"-125";i:2;s:3:"556";i:3;s:3:"-75";}}i:96;a:4:{s:1:"C";s:2:"96";s:2:"WX";s:3:"222";s:1:"N";s:9:"quoteleft";s:1:"B";a:4:{i:0;s:2:"65";i:1;s:3:"470";i:2;s:3:"169";i:3;s:3:"725";}}s:9:"quoteleft";a:4:{s:1:"C";s:2:"96";s:2:"WX";s:3:"222";s:1:"N";s:9:"quoteleft";s:1:"B";a:4:{i:0;s:2:"65";i:1;s:3:"470";i:2;s:3:"169";i:3;s:3:"725";}}i:97;a:4:{s:1:"C";s:2:"97";s:2:"WX";s:3:"556";s:1:"N";s:1:"a";s:1:"B";a:4:{i:0;s:2:"36";i:1;s:3:"-15";i:2;s:3:"530";i:3;s:3:"538";}}s:1:"a";a:4:{s:1:"C";s:2:"97";s:2:"WX";s:3:"556";s:1:"N";s:1:"a";s:1:"B";a:4:{i:0;s:2:"36";i:1;s:3:"-15";i:2;s:3:"530";i:3;s:3:"538";}}i:98;a:4:{s:1:"C";s:2:"98";s:2:"WX";s:3:"556";s:1:"N";s:1:"b";s:1:"B";a:4:{i:0;s:2:"58";i:1;s:3:"-15";i:2;s:3:"517";i:3;s:3:"718";}}s:1:"b";a:4:{s:1:"C";s:2:"98";s:2:"WX";s:3:"556";s:1:"N";s:1:"b";s:1:"B";a:4:{i:0;s:2:"58";i:1;s:3:"-15";i:2;s:3:"517";i:3;s:3:"718";}}i:99;a:4:{s:1:"C";s:2:"99";s:2:"WX";s:3:"500";s:1:"N";s:1:"c";s:1:"B";a:4:{i:0;s:2:"30";i:1;s:3:"-15";i:2;s:3:"477";i:3;s:3:"538";}}s:1:"c";a:4:{s:1:"C";s:2:"99";s:2:"WX";s:3:"500";s:1:"N";s:1:"c";s:1:"B";a:4:{i:0;s:2:"30";i:1;s:3:"-15";i:2;s:3:"477";i:3;s:3:"538";}}i:100;a:4:{s:1:"C";s:3:"100";s:2:"WX";s:3:"556";s:1:"N";s:1:"d";s:1:"B";a:4:{i:0;s:2:"35";i:1;s:3:"-15";i:2;s:3:"499";i:3;s:3:"718";}}s:1:"d";a:4:{s:1:"C";s:3:"100";s:2:"WX";s:3:"556";s:1:"N";s:1:"d";s:1:"B";a:4:{i:0;s:2:"35";i:1;s:3:"-15";i:2;s:3:"499";i:3;s:3:"718";}}i:101;a:4:{s:1:"C";s:3:"101";s:2:"WX";s:3:"556";s:1:"N";s:1:"e";s:1:"B";a:4:{i:0;s:2:"40";i:1;s:3:"-15";i:2;s:3:"516";i:3;s:3:"538";}}s:1:"e";a:4:{s:1:"C";s:3:"101";s:2:"WX";s:3:"556";s:1:"N";s:1:"e";s:1:"B";a:4:{i:0;s:2:"40";i:1;s:3:"-15";i:2;s:3:"516";i:3;s:3:"538";}}i:102;a:5:{s:1:"C";s:3:"102";s:2:"WX";s:3:"278";s:1:"N";s:1:"f";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:1:"0";i:2;s:3:"262";i:3;s:3:"728";}s:1:"L";a:2:{i:0;s:1:"l";i:1;s:2:"fl";}}s:1:"f";a:5:{s:1:"C";s:3:"102";s:2:"WX";s:3:"278";s:1:"N";s:1:"f";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:1:"0";i:2;s:3:"262";i:3;s:3:"728";}s:1:"L";a:2:{i:0;s:1:"l";i:1;s:2:"fl";}}i:103;a:4:{s:1:"C";s:3:"103";s:2:"WX";s:3:"556";s:1:"N";s:1:"g";s:1:"B";a:4:{i:0;s:2:"40";i:1;s:4:"-220";i:2;s:3:"499";i:3;s:3:"538";}}s:1:"g";a:4:{s:1:"C";s:3:"103";s:2:"WX";s:3:"556";s:1:"N";s:1:"g";s:1:"B";a:4:{i:0;s:2:"40";i:1;s:4:"-220";i:2;s:3:"499";i:3;s:3:"538";}}i:104;a:4:{s:1:"C";s:3:"104";s:2:"WX";s:3:"556";s:1:"N";s:1:"h";s:1:"B";a:4:{i:0;s:2:"65";i:1;s:1:"0";i:2;s:3:"491";i:3;s:3:"718";}}s:1:"h";a:4:{s:1:"C";s:3:"104";s:2:"WX";s:3:"556";s:1:"N";s:1:"h";s:1:"B";a:4:{i:0;s:2:"65";i:1;s:1:"0";i:2;s:3:"491";i:3;s:3:"718";}}i:105;a:4:{s:1:"C";s:3:"105";s:2:"WX";s:3:"222";s:1:"N";s:1:"i";s:1:"B";a:4:{i:0;s:2:"67";i:1;s:1:"0";i:2;s:3:"155";i:3;s:3:"718";}}s:1:"i";a:4:{s:1:"C";s:3:"105";s:2:"WX";s:3:"222";s:1:"N";s:1:"i";s:1:"B";a:4:{i:0;s:2:"67";i:1;s:1:"0";i:2;s:3:"155";i:3;s:3:"718";}}i:106;a:4:{s:1:"C";s:3:"106";s:2:"WX";s:3:"222";s:1:"N";s:1:"j";s:1:"B";a:4:{i:0;s:3:"-16";i:1;s:4:"-210";i:2;s:3:"155";i:3;s:3:"718";}}s:1:"j";a:4:{s:1:"C";s:3:"106";s:2:"WX";s:3:"222";s:1:"N";s:1:"j";s:1:"B";a:4:{i:0;s:3:"-16";i:1;s:4:"-210";i:2;s:3:"155";i:3;s:3:"718";}}i:107;a:4:{s:1:"C";s:3:"107";s:2:"WX";s:3:"500";s:1:"N";s:1:"k";s:1:"B";a:4:{i:0;s:2:"67";i:1;s:1:"0";i:2;s:3:"501";i:3;s:3:"718";}}s:1:"k";a:4:{s:1:"C";s:3:"107";s:2:"WX";s:3:"500";s:1:"N";s:1:"k";s:1:"B";a:4:{i:0;s:2:"67";i:1;s:1:"0";i:2;s:3:"501";i:3;s:3:"718";}}i:108;a:4:{s:1:"C";s:3:"108";s:2:"WX";s:3:"222";s:1:"N";s:1:"l";s:1:"B";a:4:{i:0;s:2:"67";i:1;s:1:"0";i:2;s:3:"155";i:3;s:3:"718";}}s:1:"l";a:4:{s:1:"C";s:3:"108";s:2:"WX";s:3:"222";s:1:"N";s:1:"l";s:1:"B";a:4:{i:0;s:2:"67";i:1;s:1:"0";i:2;s:3:"155";i:3;s:3:"718";}}i:109;a:4:{s:1:"C";s:3:"109";s:2:"WX";s:3:"833";s:1:"N";s:1:"m";s:1:"B";a:4:{i:0;s:2:"65";i:1;s:1:"0";i:2;s:3:"769";i:3;s:3:"538";}}s:1:"m";a:4:{s:1:"C";s:3:"109";s:2:"WX";s:3:"833";s:1:"N";s:1:"m";s:1:"B";a:4:{i:0;s:2:"65";i:1;s:1:"0";i:2;s:3:"769";i:3;s:3:"538";}}i:110;a:4:{s:1:"C";s:3:"110";s:2:"WX";s:3:"556";s:1:"N";s:1:"n";s:1:"B";a:4:{i:0;s:2:"65";i:1;s:1:"0";i:2;s:3:"491";i:3;s:3:"538";}}s:1:"n";a:4:{s:1:"C";s:3:"110";s:2:"WX";s:3:"556";s:1:"N";s:1:"n";s:1:"B";a:4:{i:0;s:2:"65";i:1;s:1:"0";i:2;s:3:"491";i:3;s:3:"538";}}i:111;a:4:{s:1:"C";s:3:"111";s:2:"WX";s:3:"556";s:1:"N";s:1:"o";s:1:"B";a:4:{i:0;s:2:"35";i:1;s:3:"-14";i:2;s:3:"521";i:3;s:3:"538";}}s:1:"o";a:4:{s:1:"C";s:3:"111";s:2:"WX";s:3:"556";s:1:"N";s:1:"o";s:1:"B";a:4:{i:0;s:2:"35";i:1;s:3:"-14";i:2;s:3:"521";i:3;s:3:"538";}}i:112;a:4:{s:1:"C";s:3:"112";s:2:"WX";s:3:"556";s:1:"N";s:1:"p";s:1:"B";a:4:{i:0;s:2:"58";i:1;s:4:"-207";i:2;s:3:"517";i:3;s:3:"538";}}s:1:"p";a:4:{s:1:"C";s:3:"112";s:2:"WX";s:3:"556";s:1:"N";s:1:"p";s:1:"B";a:4:{i:0;s:2:"58";i:1;s:4:"-207";i:2;s:3:"517";i:3;s:3:"538";}}i:113;a:4:{s:1:"C";s:3:"113";s:2:"WX";s:3:"556";s:1:"N";s:1:"q";s:1:"B";a:4:{i:0;s:2:"35";i:1;s:4:"-207";i:2;s:3:"494";i:3;s:3:"538";}}s:1:"q";a:4:{s:1:"C";s:3:"113";s:2:"WX";s:3:"556";s:1:"N";s:1:"q";s:1:"B";a:4:{i:0;s:2:"35";i:1;s:4:"-207";i:2;s:3:"494";i:3;s:3:"538";}}i:114;a:4:{s:1:"C";s:3:"114";s:2:"WX";s:3:"333";s:1:"N";s:1:"r";s:1:"B";a:4:{i:0;s:2:"77";i:1;s:1:"0";i:2;s:3:"332";i:3;s:3:"538";}}s:1:"r";a:4:{s:1:"C";s:3:"114";s:2:"WX";s:3:"333";s:1:"N";s:1:"r";s:1:"B";a:4:{i:0;s:2:"77";i:1;s:1:"0";i:2;s:3:"332";i:3;s:3:"538";}}i:115;a:4:{s:1:"C";s:3:"115";s:2:"WX";s:3:"500";s:1:"N";s:1:"s";s:1:"B";a:4:{i:0;s:2:"32";i:1;s:3:"-15";i:2;s:3:"464";i:3;s:3:"538";}}s:1:"s";a:4:{s:1:"C";s:3:"115";s:2:"WX";s:3:"500";s:1:"N";s:1:"s";s:1:"B";a:4:{i:0;s:2:"32";i:1;s:3:"-15";i:2;s:3:"464";i:3;s:3:"538";}}i:116;a:4:{s:1:"C";s:3:"116";s:2:"WX";s:3:"278";s:1:"N";s:1:"t";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:2:"-7";i:2;s:3:"257";i:3;s:3:"669";}}s:1:"t";a:4:{s:1:"C";s:3:"116";s:2:"WX";s:3:"278";s:1:"N";s:1:"t";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:2:"-7";i:2;s:3:"257";i:3;s:3:"669";}}i:117;a:4:{s:1:"C";s:3:"117";s:2:"WX";s:3:"556";s:1:"N";s:1:"u";s:1:"B";a:4:{i:0;s:2:"68";i:1;s:3:"-15";i:2;s:3:"489";i:3;s:3:"523";}}s:1:"u";a:4:{s:1:"C";s:3:"117";s:2:"WX";s:3:"556";s:1:"N";s:1:"u";s:1:"B";a:4:{i:0;s:2:"68";i:1;s:3:"-15";i:2;s:3:"489";i:3;s:3:"523";}}i:118;a:4:{s:1:"C";s:3:"118";s:2:"WX";s:3:"500";s:1:"N";s:1:"v";s:1:"B";a:4:{i:0;s:1:"8";i:1;s:1:"0";i:2;s:3:"492";i:3;s:3:"523";}}s:1:"v";a:4:{s:1:"C";s:3:"118";s:2:"WX";s:3:"500";s:1:"N";s:1:"v";s:1:"B";a:4:{i:0;s:1:"8";i:1;s:1:"0";i:2;s:3:"492";i:3;s:3:"523";}}i:119;a:4:{s:1:"C";s:3:"119";s:2:"WX";s:3:"722";s:1:"N";s:1:"w";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:1:"0";i:2;s:3:"709";i:3;s:3:"523";}}s:1:"w";a:4:{s:1:"C";s:3:"119";s:2:"WX";s:3:"722";s:1:"N";s:1:"w";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:1:"0";i:2;s:3:"709";i:3;s:3:"523";}}i:120;a:4:{s:1:"C";s:3:"120";s:2:"WX";s:3:"500";s:1:"N";s:1:"x";s:1:"B";a:4:{i:0;s:2:"11";i:1;s:1:"0";i:2;s:3:"490";i:3;s:3:"523";}}s:1:"x";a:4:{s:1:"C";s:3:"120";s:2:"WX";s:3:"500";s:1:"N";s:1:"x";s:1:"B";a:4:{i:0;s:2:"11";i:1;s:1:"0";i:2;s:3:"490";i:3;s:3:"523";}}i:121;a:4:{s:1:"C";s:3:"121";s:2:"WX";s:3:"500";s:1:"N";s:1:"y";s:1:"B";a:4:{i:0;s:2:"11";i:1;s:4:"-214";i:2;s:3:"489";i:3;s:3:"523";}}s:1:"y";a:4:{s:1:"C";s:3:"121";s:2:"WX";s:3:"500";s:1:"N";s:1:"y";s:1:"B";a:4:{i:0;s:2:"11";i:1;s:4:"-214";i:2;s:3:"489";i:3;s:3:"523";}}i:122;a:4:{s:1:"C";s:3:"122";s:2:"WX";s:3:"500";s:1:"N";s:1:"z";s:1:"B";a:4:{i:0;s:2:"31";i:1;s:1:"0";i:2;s:3:"469";i:3;s:3:"523";}}s:1:"z";a:4:{s:1:"C";s:3:"122";s:2:"WX";s:3:"500";s:1:"N";s:1:"z";s:1:"B";a:4:{i:0;s:2:"31";i:1;s:1:"0";i:2;s:3:"469";i:3;s:3:"523";}}i:123;a:4:{s:1:"C";s:3:"123";s:2:"WX";s:3:"334";s:1:"N";s:9:"braceleft";s:1:"B";a:4:{i:0;s:2:"42";i:1;s:4:"-196";i:2;s:3:"292";i:3;s:3:"722";}}s:9:"braceleft";a:4:{s:1:"C";s:3:"123";s:2:"WX";s:3:"334";s:1:"N";s:9:"braceleft";s:1:"B";a:4:{i:0;s:2:"42";i:1;s:4:"-196";i:2;s:3:"292";i:3;s:3:"722";}}i:124;a:4:{s:1:"C";s:3:"124";s:2:"WX";s:3:"260";s:1:"N";s:3:"bar";s:1:"B";a:4:{i:0;s:2:"94";i:1;s:4:"-225";i:2;s:3:"167";i:3;s:3:"775";}}s:3:"bar";a:4:{s:1:"C";s:3:"124";s:2:"WX";s:3:"260";s:1:"N";s:3:"bar";s:1:"B";a:4:{i:0;s:2:"94";i:1;s:4:"-225";i:2;s:3:"167";i:3;s:3:"775";}}i:125;a:4:{s:1:"C";s:3:"125";s:2:"WX";s:3:"334";s:1:"N";s:10:"braceright";s:1:"B";a:4:{i:0;s:2:"42";i:1;s:4:"-196";i:2;s:3:"292";i:3;s:3:"722";}}s:10:"braceright";a:4:{s:1:"C";s:3:"125";s:2:"WX";s:3:"334";s:1:"N";s:10:"braceright";s:1:"B";a:4:{i:0;s:2:"42";i:1;s:4:"-196";i:2;s:3:"292";i:3;s:3:"722";}}i:126;a:4:{s:1:"C";s:3:"126";s:2:"WX";s:3:"584";s:1:"N";s:10:"asciitilde";s:1:"B";a:4:{i:0;s:2:"61";i:1;s:3:"180";i:2;s:3:"523";i:3;s:3:"326";}}s:10:"asciitilde";a:4:{s:1:"C";s:3:"126";s:2:"WX";s:3:"584";s:1:"N";s:10:"asciitilde";s:1:"B";a:4:{i:0;s:2:"61";i:1;s:3:"180";i:2;s:3:"523";i:3;s:3:"326";}}i:161;a:4:{s:1:"C";s:3:"161";s:2:"WX";s:3:"333";s:1:"N";s:10:"exclamdown";s:1:"B";a:4:{i:0;s:3:"118";i:1;s:4:"-195";i:2;s:3:"215";i:3;s:3:"523";}}s:10:"exclamdown";a:4:{s:1:"C";s:3:"161";s:2:"WX";s:3:"333";s:1:"N";s:10:"exclamdown";s:1:"B";a:4:{i:0;s:3:"118";i:1;s:4:"-195";i:2;s:3:"215";i:3;s:3:"523";}}i:162;a:4:{s:1:"C";s:3:"162";s:2:"WX";s:3:"556";s:1:"N";s:4:"cent";s:1:"B";a:4:{i:0;s:2:"51";i:1;s:4:"-115";i:2;s:3:"513";i:3;s:3:"623";}}s:4:"cent";a:4:{s:1:"C";s:3:"162";s:2:"WX";s:3:"556";s:1:"N";s:4:"cent";s:1:"B";a:4:{i:0;s:2:"51";i:1;s:4:"-115";i:2;s:3:"513";i:3;s:3:"623";}}i:163;a:4:{s:1:"C";s:3:"163";s:2:"WX";s:3:"556";s:1:"N";s:8:"sterling";s:1:"B";a:4:{i:0;s:2:"33";i:1;s:3:"-16";i:2;s:3:"539";i:3;s:3:"718";}}s:8:"sterling";a:4:{s:1:"C";s:3:"163";s:2:"WX";s:3:"556";s:1:"N";s:8:"sterling";s:1:"B";a:4:{i:0;s:2:"33";i:1;s:3:"-16";i:2;s:3:"539";i:3;s:3:"718";}}i:164;a:4:{s:1:"C";s:3:"164";s:2:"WX";s:3:"167";s:1:"N";s:8:"fraction";s:1:"B";a:4:{i:0;s:4:"-166";i:1;s:3:"-19";i:2;s:3:"333";i:3;s:3:"703";}}s:8:"fraction";a:4:{s:1:"C";s:3:"164";s:2:"WX";s:3:"167";s:1:"N";s:8:"fraction";s:1:"B";a:4:{i:0;s:4:"-166";i:1;s:3:"-19";i:2;s:3:"333";i:3;s:3:"703";}}i:165;a:4:{s:1:"C";s:3:"165";s:2:"WX";s:3:"556";s:1:"N";s:3:"yen";s:1:"B";a:4:{i:0;s:1:"3";i:1;s:1:"0";i:2;s:3:"553";i:3;s:3:"688";}}s:3:"yen";a:4:{s:1:"C";s:3:"165";s:2:"WX";s:3:"556";s:1:"N";s:3:"yen";s:1:"B";a:4:{i:0;s:1:"3";i:1;s:1:"0";i:2;s:3:"553";i:3;s:3:"688";}}i:166;a:4:{s:1:"C";s:3:"166";s:2:"WX";s:3:"556";s:1:"N";s:6:"florin";s:1:"B";a:4:{i:0;s:3:"-11";i:1;s:4:"-207";i:2;s:3:"501";i:3;s:3:"737";}}s:6:"florin";a:4:{s:1:"C";s:3:"166";s:2:"WX";s:3:"556";s:1:"N";s:6:"florin";s:1:"B";a:4:{i:0;s:3:"-11";i:1;s:4:"-207";i:2;s:3:"501";i:3;s:3:"737";}}i:167;a:4:{s:1:"C";s:3:"167";s:2:"WX";s:3:"556";s:1:"N";s:7:"section";s:1:"B";a:4:{i:0;s:2:"43";i:1;s:4:"-191";i:2;s:3:"512";i:3;s:3:"737";}}s:7:"section";a:4:{s:1:"C";s:3:"167";s:2:"WX";s:3:"556";s:1:"N";s:7:"section";s:1:"B";a:4:{i:0;s:2:"43";i:1;s:4:"-191";i:2;s:3:"512";i:3;s:3:"737";}}i:168;a:4:{s:1:"C";s:3:"168";s:2:"WX";s:3:"556";s:1:"N";s:8:"currency";s:1:"B";a:4:{i:0;s:2:"28";i:1;s:2:"99";i:2;s:3:"528";i:3;s:3:"603";}}s:8:"currency";a:4:{s:1:"C";s:3:"168";s:2:"WX";s:3:"556";s:1:"N";s:8:"currency";s:1:"B";a:4:{i:0;s:2:"28";i:1;s:2:"99";i:2;s:3:"528";i:3;s:3:"603";}}i:169;a:4:{s:1:"C";s:3:"169";s:2:"WX";s:3:"191";s:1:"N";s:11:"quotesingle";s:1:"B";a:4:{i:0;s:2:"59";i:1;s:3:"463";i:2;s:3:"132";i:3;s:3:"718";}}s:11:"quotesingle";a:4:{s:1:"C";s:3:"169";s:2:"WX";s:3:"191";s:1:"N";s:11:"quotesingle";s:1:"B";a:4:{i:0;s:2:"59";i:1;s:3:"463";i:2;s:3:"132";i:3;s:3:"718";}}i:170;a:4:{s:1:"C";s:3:"170";s:2:"WX";s:3:"333";s:1:"N";s:12:"quotedblleft";s:1:"B";a:4:{i:0;s:2:"38";i:1;s:3:"470";i:2;s:3:"307";i:3;s:3:"725";}}s:12:"quotedblleft";a:4:{s:1:"C";s:3:"170";s:2:"WX";s:3:"333";s:1:"N";s:12:"quotedblleft";s:1:"B";a:4:{i:0;s:2:"38";i:1;s:3:"470";i:2;s:3:"307";i:3;s:3:"725";}}i:171;a:4:{s:1:"C";s:3:"171";s:2:"WX";s:3:"556";s:1:"N";s:13:"guillemotleft";s:1:"B";a:4:{i:0;s:2:"97";i:1;s:3:"108";i:2;s:3:"459";i:3;s:3:"446";}}s:13:"guillemotleft";a:4:{s:1:"C";s:3:"171";s:2:"WX";s:3:"556";s:1:"N";s:13:"guillemotleft";s:1:"B";a:4:{i:0;s:2:"97";i:1;s:3:"108";i:2;s:3:"459";i:3;s:3:"446";}}i:172;a:4:{s:1:"C";s:3:"172";s:2:"WX";s:3:"333";s:1:"N";s:13:"guilsinglleft";s:1:"B";a:4:{i:0;s:2:"88";i:1;s:3:"108";i:2;s:3:"245";i:3;s:3:"446";}}s:13:"guilsinglleft";a:4:{s:1:"C";s:3:"172";s:2:"WX";s:3:"333";s:1:"N";s:13:"guilsinglleft";s:1:"B";a:4:{i:0;s:2:"88";i:1;s:3:"108";i:2;s:3:"245";i:3;s:3:"446";}}i:173;a:4:{s:1:"C";s:3:"173";s:2:"WX";s:3:"333";s:1:"N";s:14:"guilsinglright";s:1:"B";a:4:{i:0;s:2:"88";i:1;s:3:"108";i:2;s:3:"245";i:3;s:3:"446";}}s:14:"guilsinglright";a:4:{s:1:"C";s:3:"173";s:2:"WX";s:3:"333";s:1:"N";s:14:"guilsinglright";s:1:"B";a:4:{i:0;s:2:"88";i:1;s:3:"108";i:2;s:3:"245";i:3;s:3:"446";}}i:174;a:4:{s:1:"C";s:3:"174";s:2:"WX";s:3:"500";s:1:"N";s:2:"fi";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:1:"0";i:2;s:3:"434";i:3;s:3:"728";}}s:2:"fi";a:4:{s:1:"C";s:3:"174";s:2:"WX";s:3:"500";s:1:"N";s:2:"fi";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:1:"0";i:2;s:3:"434";i:3;s:3:"728";}}i:175;a:4:{s:1:"C";s:3:"175";s:2:"WX";s:3:"500";s:1:"N";s:2:"fl";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:1:"0";i:2;s:3:"432";i:3;s:3:"728";}}s:2:"fl";a:4:{s:1:"C";s:3:"175";s:2:"WX";s:3:"500";s:1:"N";s:2:"fl";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:1:"0";i:2;s:3:"432";i:3;s:3:"728";}}i:177;a:4:{s:1:"C";s:3:"177";s:2:"WX";s:3:"556";s:1:"N";s:6:"endash";s:1:"B";a:4:{i:0;s:1:"0";i:1;s:3:"240";i:2;s:3:"556";i:3;s:3:"313";}}s:6:"endash";a:4:{s:1:"C";s:3:"177";s:2:"WX";s:3:"556";s:1:"N";s:6:"endash";s:1:"B";a:4:{i:0;s:1:"0";i:1;s:3:"240";i:2;s:3:"556";i:3;s:3:"313";}}i:178;a:4:{s:1:"C";s:3:"178";s:2:"WX";s:3:"556";s:1:"N";s:6:"dagger";s:1:"B";a:4:{i:0;s:2:"43";i:1;s:4:"-159";i:2;s:3:"514";i:3;s:3:"718";}}s:6:"dagger";a:4:{s:1:"C";s:3:"178";s:2:"WX";s:3:"556";s:1:"N";s:6:"dagger";s:1:"B";a:4:{i:0;s:2:"43";i:1;s:4:"-159";i:2;s:3:"514";i:3;s:3:"718";}}i:179;a:4:{s:1:"C";s:3:"179";s:2:"WX";s:3:"556";s:1:"N";s:9:"daggerdbl";s:1:"B";a:4:{i:0;s:2:"43";i:1;s:4:"-159";i:2;s:3:"514";i:3;s:3:"718";}}s:9:"daggerdbl";a:4:{s:1:"C";s:3:"179";s:2:"WX";s:3:"556";s:1:"N";s:9:"daggerdbl";s:1:"B";a:4:{i:0;s:2:"43";i:1;s:4:"-159";i:2;s:3:"514";i:3;s:3:"718";}}i:180;a:4:{s:1:"C";s:3:"180";s:2:"WX";s:3:"278";s:1:"N";s:14:"periodcentered";s:1:"B";a:4:{i:0;s:2:"77";i:1;s:3:"190";i:2;s:3:"202";i:3;s:3:"315";}}s:14:"periodcentered";a:4:{s:1:"C";s:3:"180";s:2:"WX";s:3:"278";s:1:"N";s:14:"periodcentered";s:1:"B";a:4:{i:0;s:2:"77";i:1;s:3:"190";i:2;s:3:"202";i:3;s:3:"315";}}i:182;a:4:{s:1:"C";s:3:"182";s:2:"WX";s:3:"537";s:1:"N";s:9:"paragraph";s:1:"B";a:4:{i:0;s:2:"18";i:1;s:4:"-173";i:2;s:3:"497";i:3;s:3:"718";}}s:9:"paragraph";a:4:{s:1:"C";s:3:"182";s:2:"WX";s:3:"537";s:1:"N";s:9:"paragraph";s:1:"B";a:4:{i:0;s:2:"18";i:1;s:4:"-173";i:2;s:3:"497";i:3;s:3:"718";}}i:183;a:4:{s:1:"C";s:3:"183";s:2:"WX";s:3:"350";s:1:"N";s:6:"bullet";s:1:"B";a:4:{i:0;s:2:"18";i:1;s:3:"202";i:2;s:3:"333";i:3;s:3:"517";}}s:6:"bullet";a:4:{s:1:"C";s:3:"183";s:2:"WX";s:3:"350";s:1:"N";s:6:"bullet";s:1:"B";a:4:{i:0;s:2:"18";i:1;s:3:"202";i:2;s:3:"333";i:3;s:3:"517";}}i:184;a:4:{s:1:"C";s:3:"184";s:2:"WX";s:3:"222";s:1:"N";s:14:"quotesinglbase";s:1:"B";a:4:{i:0;s:2:"53";i:1;s:4:"-149";i:2;s:3:"157";i:3;s:3:"106";}}s:14:"quotesinglbase";a:4:{s:1:"C";s:3:"184";s:2:"WX";s:3:"222";s:1:"N";s:14:"quotesinglbase";s:1:"B";a:4:{i:0;s:2:"53";i:1;s:4:"-149";i:2;s:3:"157";i:3;s:3:"106";}}i:185;a:4:{s:1:"C";s:3:"185";s:2:"WX";s:3:"333";s:1:"N";s:12:"quotedblbase";s:1:"B";a:4:{i:0;s:2:"26";i:1;s:4:"-149";i:2;s:3:"295";i:3;s:3:"106";}}s:12:"quotedblbase";a:4:{s:1:"C";s:3:"185";s:2:"WX";s:3:"333";s:1:"N";s:12:"quotedblbase";s:1:"B";a:4:{i:0;s:2:"26";i:1;s:4:"-149";i:2;s:3:"295";i:3;s:3:"106";}}i:186;a:4:{s:1:"C";s:3:"186";s:2:"WX";s:3:"333";s:1:"N";s:13:"quotedblright";s:1:"B";a:4:{i:0;s:2:"26";i:1;s:3:"463";i:2;s:3:"295";i:3;s:3:"718";}}s:13:"quotedblright";a:4:{s:1:"C";s:3:"186";s:2:"WX";s:3:"333";s:1:"N";s:13:"quotedblright";s:1:"B";a:4:{i:0;s:2:"26";i:1;s:3:"463";i:2;s:3:"295";i:3;s:3:"718";}}i:187;a:4:{s:1:"C";s:3:"187";s:2:"WX";s:3:"556";s:1:"N";s:14:"guillemotright";s:1:"B";a:4:{i:0;s:2:"97";i:1;s:3:"108";i:2;s:3:"459";i:3;s:3:"446";}}s:14:"guillemotright";a:4:{s:1:"C";s:3:"187";s:2:"WX";s:3:"556";s:1:"N";s:14:"guillemotright";s:1:"B";a:4:{i:0;s:2:"97";i:1;s:3:"108";i:2;s:3:"459";i:3;s:3:"446";}}i:188;a:4:{s:1:"C";s:3:"188";s:2:"WX";s:4:"1000";s:1:"N";s:8:"ellipsis";s:1:"B";a:4:{i:0;s:3:"115";i:1;s:1:"0";i:2;s:3:"885";i:3;s:3:"106";}}s:8:"ellipsis";a:4:{s:1:"C";s:3:"188";s:2:"WX";s:4:"1000";s:1:"N";s:8:"ellipsis";s:1:"B";a:4:{i:0;s:3:"115";i:1;s:1:"0";i:2;s:3:"885";i:3;s:3:"106";}}i:189;a:4:{s:1:"C";s:3:"189";s:2:"WX";s:4:"1000";s:1:"N";s:11:"perthousand";s:1:"B";a:4:{i:0;s:1:"7";i:1;s:3:"-19";i:2;s:3:"994";i:3;s:3:"703";}}s:11:"perthousand";a:4:{s:1:"C";s:3:"189";s:2:"WX";s:4:"1000";s:1:"N";s:11:"perthousand";s:1:"B";a:4:{i:0;s:1:"7";i:1;s:3:"-19";i:2;s:3:"994";i:3;s:3:"703";}}i:191;a:4:{s:1:"C";s:3:"191";s:2:"WX";s:3:"611";s:1:"N";s:12:"questiondown";s:1:"B";a:4:{i:0;s:2:"91";i:1;s:4:"-201";i:2;s:3:"527";i:3;s:3:"525";}}s:12:"questiondown";a:4:{s:1:"C";s:3:"191";s:2:"WX";s:3:"611";s:1:"N";s:12:"questiondown";s:1:"B";a:4:{i:0;s:2:"91";i:1;s:4:"-201";i:2;s:3:"527";i:3;s:3:"525";}}i:193;a:4:{s:1:"C";s:3:"193";s:2:"WX";s:3:"333";s:1:"N";s:5:"grave";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:3:"593";i:2;s:3:"211";i:3;s:3:"734";}}s:5:"grave";a:4:{s:1:"C";s:3:"193";s:2:"WX";s:3:"333";s:1:"N";s:5:"grave";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:3:"593";i:2;s:3:"211";i:3;s:3:"734";}}i:194;a:4:{s:1:"C";s:3:"194";s:2:"WX";s:3:"333";s:1:"N";s:5:"acute";s:1:"B";a:4:{i:0;s:3:"122";i:1;s:3:"593";i:2;s:3:"319";i:3;s:3:"734";}}s:5:"acute";a:4:{s:1:"C";s:3:"194";s:2:"WX";s:3:"333";s:1:"N";s:5:"acute";s:1:"B";a:4:{i:0;s:3:"122";i:1;s:3:"593";i:2;s:3:"319";i:3;s:3:"734";}}i:195;a:4:{s:1:"C";s:3:"195";s:2:"WX";s:3:"333";s:1:"N";s:10:"circumflex";s:1:"B";a:4:{i:0;s:2:"21";i:1;s:3:"593";i:2;s:3:"312";i:3;s:3:"734";}}s:10:"circumflex";a:4:{s:1:"C";s:3:"195";s:2:"WX";s:3:"333";s:1:"N";s:10:"circumflex";s:1:"B";a:4:{i:0;s:2:"21";i:1;s:3:"593";i:2;s:3:"312";i:3;s:3:"734";}}i:196;a:4:{s:1:"C";s:3:"196";s:2:"WX";s:3:"333";s:1:"N";s:5:"tilde";s:1:"B";a:4:{i:0;s:2:"-4";i:1;s:3:"606";i:2;s:3:"337";i:3;s:3:"722";}}s:5:"tilde";a:4:{s:1:"C";s:3:"196";s:2:"WX";s:3:"333";s:1:"N";s:5:"tilde";s:1:"B";a:4:{i:0;s:2:"-4";i:1;s:3:"606";i:2;s:3:"337";i:3;s:3:"722";}}i:197;a:4:{s:1:"C";s:3:"197";s:2:"WX";s:3:"333";s:1:"N";s:6:"macron";s:1:"B";a:4:{i:0;s:2:"10";i:1;s:3:"627";i:2;s:3:"323";i:3;s:3:"684";}}s:6:"macron";a:4:{s:1:"C";s:3:"197";s:2:"WX";s:3:"333";s:1:"N";s:6:"macron";s:1:"B";a:4:{i:0;s:2:"10";i:1;s:3:"627";i:2;s:3:"323";i:3;s:3:"684";}}i:198;a:4:{s:1:"C";s:3:"198";s:2:"WX";s:3:"333";s:1:"N";s:5:"breve";s:1:"B";a:4:{i:0;s:2:"13";i:1;s:3:"595";i:2;s:3:"321";i:3;s:3:"731";}}s:5:"breve";a:4:{s:1:"C";s:3:"198";s:2:"WX";s:3:"333";s:1:"N";s:5:"breve";s:1:"B";a:4:{i:0;s:2:"13";i:1;s:3:"595";i:2;s:3:"321";i:3;s:3:"731";}}i:199;a:4:{s:1:"C";s:3:"199";s:2:"WX";s:3:"333";s:1:"N";s:9:"dotaccent";s:1:"B";a:4:{i:0;s:3:"121";i:1;s:3:"604";i:2;s:3:"212";i:3;s:3:"706";}}s:9:"dotaccent";a:4:{s:1:"C";s:3:"199";s:2:"WX";s:3:"333";s:1:"N";s:9:"dotaccent";s:1:"B";a:4:{i:0;s:3:"121";i:1;s:3:"604";i:2;s:3:"212";i:3;s:3:"706";}}i:200;a:4:{s:1:"C";s:3:"200";s:2:"WX";s:3:"333";s:1:"N";s:8:"dieresis";s:1:"B";a:4:{i:0;s:2:"40";i:1;s:3:"604";i:2;s:3:"293";i:3;s:3:"706";}}s:8:"dieresis";a:4:{s:1:"C";s:3:"200";s:2:"WX";s:3:"333";s:1:"N";s:8:"dieresis";s:1:"B";a:4:{i:0;s:2:"40";i:1;s:3:"604";i:2;s:3:"293";i:3;s:3:"706";}}i:202;a:4:{s:1:"C";s:3:"202";s:2:"WX";s:3:"333";s:1:"N";s:4:"ring";s:1:"B";a:4:{i:0;s:2:"75";i:1;s:3:"572";i:2;s:3:"259";i:3;s:3:"756";}}s:4:"ring";a:4:{s:1:"C";s:3:"202";s:2:"WX";s:3:"333";s:1:"N";s:4:"ring";s:1:"B";a:4:{i:0;s:2:"75";i:1;s:3:"572";i:2;s:3:"259";i:3;s:3:"756";}}i:203;a:4:{s:1:"C";s:3:"203";s:2:"WX";s:3:"333";s:1:"N";s:7:"cedilla";s:1:"B";a:4:{i:0;s:2:"45";i:1;s:4:"-225";i:2;s:3:"259";i:3;s:1:"0";}}s:7:"cedilla";a:4:{s:1:"C";s:3:"203";s:2:"WX";s:3:"333";s:1:"N";s:7:"cedilla";s:1:"B";a:4:{i:0;s:2:"45";i:1;s:4:"-225";i:2;s:3:"259";i:3;s:1:"0";}}i:205;a:4:{s:1:"C";s:3:"205";s:2:"WX";s:3:"333";s:1:"N";s:12:"hungarumlaut";s:1:"B";a:4:{i:0;s:2:"31";i:1;s:3:"593";i:2;s:3:"409";i:3;s:3:"734";}}s:12:"hungarumlaut";a:4:{s:1:"C";s:3:"205";s:2:"WX";s:3:"333";s:1:"N";s:12:"hungarumlaut";s:1:"B";a:4:{i:0;s:2:"31";i:1;s:3:"593";i:2;s:3:"409";i:3;s:3:"734";}}i:206;a:4:{s:1:"C";s:3:"206";s:2:"WX";s:3:"333";s:1:"N";s:6:"ogonek";s:1:"B";a:4:{i:0;s:2:"73";i:1;s:4:"-225";i:2;s:3:"287";i:3;s:1:"0";}}s:6:"ogonek";a:4:{s:1:"C";s:3:"206";s:2:"WX";s:3:"333";s:1:"N";s:6:"ogonek";s:1:"B";a:4:{i:0;s:2:"73";i:1;s:4:"-225";i:2;s:3:"287";i:3;s:1:"0";}}i:207;a:4:{s:1:"C";s:3:"207";s:2:"WX";s:3:"333";s:1:"N";s:5:"caron";s:1:"B";a:4:{i:0;s:2:"21";i:1;s:3:"593";i:2;s:3:"312";i:3;s:3:"734";}}s:5:"caron";a:4:{s:1:"C";s:3:"207";s:2:"WX";s:3:"333";s:1:"N";s:5:"caron";s:1:"B";a:4:{i:0;s:2:"21";i:1;s:3:"593";i:2;s:3:"312";i:3;s:3:"734";}}i:208;a:4:{s:1:"C";s:3:"208";s:2:"WX";s:4:"1000";s:1:"N";s:6:"emdash";s:1:"B";a:4:{i:0;s:1:"0";i:1;s:3:"240";i:2;s:4:"1000";i:3;s:3:"313";}}s:6:"emdash";a:4:{s:1:"C";s:3:"208";s:2:"WX";s:4:"1000";s:1:"N";s:6:"emdash";s:1:"B";a:4:{i:0;s:1:"0";i:1;s:3:"240";i:2;s:4:"1000";i:3;s:3:"313";}}i:225;a:4:{s:1:"C";s:3:"225";s:2:"WX";s:4:"1000";s:1:"N";s:2:"AE";s:1:"B";a:4:{i:0;s:1:"8";i:1;s:1:"0";i:2;s:3:"951";i:3;s:3:"718";}}s:2:"AE";a:4:{s:1:"C";s:3:"225";s:2:"WX";s:4:"1000";s:1:"N";s:2:"AE";s:1:"B";a:4:{i:0;s:1:"8";i:1;s:1:"0";i:2;s:3:"951";i:3;s:3:"718";}}i:227;a:4:{s:1:"C";s:3:"227";s:2:"WX";s:3:"370";s:1:"N";s:11:"ordfeminine";s:1:"B";a:4:{i:0;s:2:"24";i:1;s:3:"405";i:2;s:3:"346";i:3;s:3:"737";}}s:11:"ordfeminine";a:4:{s:1:"C";s:3:"227";s:2:"WX";s:3:"370";s:1:"N";s:11:"ordfeminine";s:1:"B";a:4:{i:0;s:2:"24";i:1;s:3:"405";i:2;s:3:"346";i:3;s:3:"737";}}i:232;a:4:{s:1:"C";s:3:"232";s:2:"WX";s:3:"556";s:1:"N";s:6:"Lslash";s:1:"B";a:4:{i:0;s:3:"-20";i:1;s:1:"0";i:2;s:3:"537";i:3;s:3:"718";}}s:6:"Lslash";a:4:{s:1:"C";s:3:"232";s:2:"WX";s:3:"556";s:1:"N";s:6:"Lslash";s:1:"B";a:4:{i:0;s:3:"-20";i:1;s:1:"0";i:2;s:3:"537";i:3;s:3:"718";}}i:233;a:4:{s:1:"C";s:3:"233";s:2:"WX";s:3:"778";s:1:"N";s:6:"Oslash";s:1:"B";a:4:{i:0;s:2:"39";i:1;s:3:"-19";i:2;s:3:"740";i:3;s:3:"737";}}s:6:"Oslash";a:4:{s:1:"C";s:3:"233";s:2:"WX";s:3:"778";s:1:"N";s:6:"Oslash";s:1:"B";a:4:{i:0;s:2:"39";i:1;s:3:"-19";i:2;s:3:"740";i:3;s:3:"737";}}i:234;a:4:{s:1:"C";s:3:"234";s:2:"WX";s:4:"1000";s:1:"N";s:2:"OE";s:1:"B";a:4:{i:0;s:2:"36";i:1;s:3:"-19";i:2;s:3:"965";i:3;s:3:"737";}}s:2:"OE";a:4:{s:1:"C";s:3:"234";s:2:"WX";s:4:"1000";s:1:"N";s:2:"OE";s:1:"B";a:4:{i:0;s:2:"36";i:1;s:3:"-19";i:2;s:3:"965";i:3;s:3:"737";}}i:235;a:4:{s:1:"C";s:3:"235";s:2:"WX";s:3:"365";s:1:"N";s:12:"ordmasculine";s:1:"B";a:4:{i:0;s:2:"25";i:1;s:3:"405";i:2;s:3:"341";i:3;s:3:"737";}}s:12:"ordmasculine";a:4:{s:1:"C";s:3:"235";s:2:"WX";s:3:"365";s:1:"N";s:12:"ordmasculine";s:1:"B";a:4:{i:0;s:2:"25";i:1;s:3:"405";i:2;s:3:"341";i:3;s:3:"737";}}i:241;a:4:{s:1:"C";s:3:"241";s:2:"WX";s:3:"889";s:1:"N";s:2:"ae";s:1:"B";a:4:{i:0;s:2:"36";i:1;s:3:"-15";i:2;s:3:"847";i:3;s:3:"538";}}s:2:"ae";a:4:{s:1:"C";s:3:"241";s:2:"WX";s:3:"889";s:1:"N";s:2:"ae";s:1:"B";a:4:{i:0;s:2:"36";i:1;s:3:"-15";i:2;s:3:"847";i:3;s:3:"538";}}i:245;a:4:{s:1:"C";s:3:"245";s:2:"WX";s:3:"278";s:1:"N";s:8:"dotlessi";s:1:"B";a:4:{i:0;s:2:"95";i:1;s:1:"0";i:2;s:3:"183";i:3;s:3:"523";}}s:8:"dotlessi";a:4:{s:1:"C";s:3:"245";s:2:"WX";s:3:"278";s:1:"N";s:8:"dotlessi";s:1:"B";a:4:{i:0;s:2:"95";i:1;s:1:"0";i:2;s:3:"183";i:3;s:3:"523";}}i:248;a:4:{s:1:"C";s:3:"248";s:2:"WX";s:3:"222";s:1:"N";s:6:"lslash";s:1:"B";a:4:{i:0;s:3:"-20";i:1;s:1:"0";i:2;s:3:"242";i:3;s:3:"718";}}s:6:"lslash";a:4:{s:1:"C";s:3:"248";s:2:"WX";s:3:"222";s:1:"N";s:6:"lslash";s:1:"B";a:4:{i:0;s:3:"-20";i:1;s:1:"0";i:2;s:3:"242";i:3;s:3:"718";}}i:249;a:4:{s:1:"C";s:3:"249";s:2:"WX";s:3:"611";s:1:"N";s:6:"oslash";s:1:"B";a:4:{i:0;s:2:"28";i:1;s:3:"-22";i:2;s:3:"537";i:3;s:3:"545";}}s:6:"oslash";a:4:{s:1:"C";s:3:"249";s:2:"WX";s:3:"611";s:1:"N";s:6:"oslash";s:1:"B";a:4:{i:0;s:2:"28";i:1;s:3:"-22";i:2;s:3:"537";i:3;s:3:"545";}}i:250;a:4:{s:1:"C";s:3:"250";s:2:"WX";s:3:"944";s:1:"N";s:2:"oe";s:1:"B";a:4:{i:0;s:2:"35";i:1;s:3:"-15";i:2;s:3:"902";i:3;s:3:"538";}}s:2:"oe";a:4:{s:1:"C";s:3:"250";s:2:"WX";s:3:"944";s:1:"N";s:2:"oe";s:1:"B";a:4:{i:0;s:2:"35";i:1;s:3:"-15";i:2;s:3:"902";i:3;s:3:"538";}}i:251;a:4:{s:1:"C";s:3:"251";s:2:"WX";s:3:"611";s:1:"N";s:10:"germandbls";s:1:"B";a:4:{i:0;s:2:"67";i:1;s:3:"-15";i:2;s:3:"571";i:3;s:3:"728";}}s:10:"germandbls";a:4:{s:1:"C";s:3:"251";s:2:"WX";s:3:"611";s:1:"N";s:10:"germandbls";s:1:"B";a:4:{i:0;s:2:"67";i:1;s:3:"-15";i:2;s:3:"571";i:3;s:3:"728";}}s:9:"Idieresis";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"278";s:1:"N";s:9:"Idieresis";s:1:"B";a:4:{i:0;s:2:"13";i:1;s:1:"0";i:2;s:3:"266";i:3;s:3:"901";}}s:6:"eacute";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:6:"eacute";s:1:"B";a:4:{i:0;s:2:"40";i:1;s:3:"-15";i:2;s:3:"516";i:3;s:3:"734";}}s:6:"abreve";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:6:"abreve";s:1:"B";a:4:{i:0;s:2:"36";i:1;s:3:"-15";i:2;s:3:"530";i:3;s:3:"731";}}s:13:"uhungarumlaut";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:13:"uhungarumlaut";s:1:"B";a:4:{i:0;s:2:"68";i:1;s:3:"-15";i:2;s:3:"521";i:3;s:3:"734";}}s:6:"ecaron";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:6:"ecaron";s:1:"B";a:4:{i:0;s:2:"40";i:1;s:3:"-15";i:2;s:3:"516";i:3;s:3:"734";}}s:9:"Ydieresis";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"667";s:1:"N";s:9:"Ydieresis";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:1:"0";i:2;s:3:"653";i:3;s:3:"901";}}s:6:"divide";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"584";s:1:"N";s:6:"divide";s:1:"B";a:4:{i:0;s:2:"39";i:1;s:3:"-19";i:2;s:3:"545";i:3;s:3:"524";}}s:6:"Yacute";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"667";s:1:"N";s:6:"Yacute";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:1:"0";i:2;s:3:"653";i:3;s:3:"929";}}s:11:"Acircumflex";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"667";s:1:"N";s:11:"Acircumflex";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:1:"0";i:2;s:3:"654";i:3;s:3:"929";}}s:6:"aacute";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:6:"aacute";s:1:"B";a:4:{i:0;s:2:"36";i:1;s:3:"-15";i:2;s:3:"530";i:3;s:3:"734";}}s:11:"Ucircumflex";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"722";s:1:"N";s:11:"Ucircumflex";s:1:"B";a:4:{i:0;s:2:"79";i:1;s:3:"-19";i:2;s:3:"644";i:3;s:3:"929";}}s:6:"yacute";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"500";s:1:"N";s:6:"yacute";s:1:"B";a:4:{i:0;s:2:"11";i:1;s:4:"-214";i:2;s:3:"489";i:3;s:3:"734";}}s:12:"scommaaccent";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"500";s:1:"N";s:12:"scommaaccent";s:1:"B";a:4:{i:0;s:2:"32";i:1;s:4:"-225";i:2;s:3:"464";i:3;s:3:"538";}}s:11:"ecircumflex";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:11:"ecircumflex";s:1:"B";a:4:{i:0;s:2:"40";i:1;s:3:"-15";i:2;s:3:"516";i:3;s:3:"734";}}s:5:"Uring";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"722";s:1:"N";s:5:"Uring";s:1:"B";a:4:{i:0;s:2:"79";i:1;s:3:"-19";i:2;s:3:"644";i:3;s:3:"931";}}s:9:"Udieresis";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"722";s:1:"N";s:9:"Udieresis";s:1:"B";a:4:{i:0;s:2:"79";i:1;s:3:"-19";i:2;s:3:"644";i:3;s:3:"901";}}s:7:"aogonek";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:7:"aogonek";s:1:"B";a:4:{i:0;s:2:"36";i:1;s:4:"-220";i:2;s:3:"547";i:3;s:3:"538";}}s:6:"Uacute";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"722";s:1:"N";s:6:"Uacute";s:1:"B";a:4:{i:0;s:2:"79";i:1;s:3:"-19";i:2;s:3:"644";i:3;s:3:"929";}}s:7:"uogonek";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:7:"uogonek";s:1:"B";a:4:{i:0;s:2:"68";i:1;s:4:"-225";i:2;s:3:"519";i:3;s:3:"523";}}s:9:"Edieresis";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"667";s:1:"N";s:9:"Edieresis";s:1:"B";a:4:{i:0;s:2:"86";i:1;s:1:"0";i:2;s:3:"616";i:3;s:3:"901";}}s:6:"Dcroat";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"722";s:1:"N";s:6:"Dcroat";s:1:"B";a:4:{i:0;s:1:"0";i:1;s:1:"0";i:2;s:3:"674";i:3;s:3:"718";}}s:11:"commaaccent";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"250";s:1:"N";s:11:"commaaccent";s:1:"B";a:4:{i:0;s:2:"87";i:1;s:4:"-225";i:2;s:3:"181";i:3;s:3:"-40";}}s:9:"copyright";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"737";s:1:"N";s:9:"copyright";s:1:"B";a:4:{i:0;s:3:"-14";i:1;s:3:"-19";i:2;s:3:"752";i:3;s:3:"737";}}s:7:"Emacron";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"667";s:1:"N";s:7:"Emacron";s:1:"B";a:4:{i:0;s:2:"86";i:1;s:1:"0";i:2;s:3:"616";i:3;s:3:"879";}}s:6:"ccaron";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"500";s:1:"N";s:6:"ccaron";s:1:"B";a:4:{i:0;s:2:"30";i:1;s:3:"-15";i:2;s:3:"477";i:3;s:3:"734";}}s:5:"aring";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:5:"aring";s:1:"B";a:4:{i:0;s:2:"36";i:1;s:3:"-15";i:2;s:3:"530";i:3;s:3:"756";}}s:12:"Ncommaaccent";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"722";s:1:"N";s:12:"Ncommaaccent";s:1:"B";a:4:{i:0;s:2:"76";i:1;s:4:"-225";i:2;s:3:"646";i:3;s:3:"718";}}s:6:"lacute";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"222";s:1:"N";s:6:"lacute";s:1:"B";a:4:{i:0;s:2:"67";i:1;s:1:"0";i:2;s:3:"264";i:3;s:3:"929";}}s:6:"agrave";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:6:"agrave";s:1:"B";a:4:{i:0;s:2:"36";i:1;s:3:"-15";i:2;s:3:"530";i:3;s:3:"734";}}s:12:"Tcommaaccent";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"611";s:1:"N";s:12:"Tcommaaccent";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:4:"-225";i:2;s:3:"597";i:3;s:3:"718";}}s:6:"Cacute";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"722";s:1:"N";s:6:"Cacute";s:1:"B";a:4:{i:0;s:2:"44";i:1;s:3:"-19";i:2;s:3:"681";i:3;s:3:"929";}}s:6:"atilde";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:6:"atilde";s:1:"B";a:4:{i:0;s:2:"36";i:1;s:3:"-15";i:2;s:3:"530";i:3;s:3:"722";}}s:10:"Edotaccent";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"667";s:1:"N";s:10:"Edotaccent";s:1:"B";a:4:{i:0;s:2:"86";i:1;s:1:"0";i:2;s:3:"616";i:3;s:3:"901";}}s:6:"scaron";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"500";s:1:"N";s:6:"scaron";s:1:"B";a:4:{i:0;s:2:"32";i:1;s:3:"-15";i:2;s:3:"464";i:3;s:3:"734";}}s:8:"scedilla";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"500";s:1:"N";s:8:"scedilla";s:1:"B";a:4:{i:0;s:2:"32";i:1;s:4:"-225";i:2;s:3:"464";i:3;s:3:"538";}}s:6:"iacute";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"278";s:1:"N";s:6:"iacute";s:1:"B";a:4:{i:0;s:2:"95";i:1;s:1:"0";i:2;s:3:"292";i:3;s:3:"734";}}s:7:"lozenge";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"471";s:1:"N";s:7:"lozenge";s:1:"B";a:4:{i:0;s:2:"10";i:1;s:1:"0";i:2;s:3:"462";i:3;s:3:"728";}}s:6:"Rcaron";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"722";s:1:"N";s:6:"Rcaron";s:1:"B";a:4:{i:0;s:2:"88";i:1;s:1:"0";i:2;s:3:"684";i:3;s:3:"929";}}s:12:"Gcommaaccent";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"778";s:1:"N";s:12:"Gcommaaccent";s:1:"B";a:4:{i:0;s:2:"48";i:1;s:4:"-225";i:2;s:3:"704";i:3;s:3:"737";}}s:11:"ucircumflex";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:11:"ucircumflex";s:1:"B";a:4:{i:0;s:2:"68";i:1;s:3:"-15";i:2;s:3:"489";i:3;s:3:"734";}}s:11:"acircumflex";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:11:"acircumflex";s:1:"B";a:4:{i:0;s:2:"36";i:1;s:3:"-15";i:2;s:3:"530";i:3;s:3:"734";}}s:7:"Amacron";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"667";s:1:"N";s:7:"Amacron";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:1:"0";i:2;s:3:"654";i:3;s:3:"879";}}s:6:"rcaron";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"333";s:1:"N";s:6:"rcaron";s:1:"B";a:4:{i:0;s:2:"61";i:1;s:1:"0";i:2;s:3:"352";i:3;s:3:"734";}}s:8:"ccedilla";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"500";s:1:"N";s:8:"ccedilla";s:1:"B";a:4:{i:0;s:2:"30";i:1;s:4:"-225";i:2;s:3:"477";i:3;s:3:"538";}}s:10:"Zdotaccent";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"611";s:1:"N";s:10:"Zdotaccent";s:1:"B";a:4:{i:0;s:2:"23";i:1;s:1:"0";i:2;s:3:"588";i:3;s:3:"901";}}s:5:"Thorn";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"667";s:1:"N";s:5:"Thorn";s:1:"B";a:4:{i:0;s:2:"86";i:1;s:1:"0";i:2;s:3:"622";i:3;s:3:"718";}}s:7:"Omacron";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"778";s:1:"N";s:7:"Omacron";s:1:"B";a:4:{i:0;s:2:"39";i:1;s:3:"-19";i:2;s:3:"739";i:3;s:3:"879";}}s:6:"Racute";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"722";s:1:"N";s:6:"Racute";s:1:"B";a:4:{i:0;s:2:"88";i:1;s:1:"0";i:2;s:3:"684";i:3;s:3:"929";}}s:6:"Sacute";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"667";s:1:"N";s:6:"Sacute";s:1:"B";a:4:{i:0;s:2:"49";i:1;s:3:"-19";i:2;s:3:"620";i:3;s:3:"929";}}s:6:"dcaron";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"643";s:1:"N";s:6:"dcaron";s:1:"B";a:4:{i:0;s:2:"35";i:1;s:3:"-15";i:2;s:3:"655";i:3;s:3:"718";}}s:7:"Umacron";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"722";s:1:"N";s:7:"Umacron";s:1:"B";a:4:{i:0;s:2:"79";i:1;s:3:"-19";i:2;s:3:"644";i:3;s:3:"879";}}s:5:"uring";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:5:"uring";s:1:"B";a:4:{i:0;s:2:"68";i:1;s:3:"-15";i:2;s:3:"489";i:3;s:3:"756";}}s:13:"threesuperior";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"333";s:1:"N";s:13:"threesuperior";s:1:"B";a:4:{i:0;s:1:"5";i:1;s:3:"270";i:2;s:3:"325";i:3;s:3:"703";}}s:6:"Ograve";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"778";s:1:"N";s:6:"Ograve";s:1:"B";a:4:{i:0;s:2:"39";i:1;s:3:"-19";i:2;s:3:"739";i:3;s:3:"929";}}s:6:"Agrave";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"667";s:1:"N";s:6:"Agrave";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:1:"0";i:2;s:3:"654";i:3;s:3:"929";}}s:6:"Abreve";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"667";s:1:"N";s:6:"Abreve";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:1:"0";i:2;s:3:"654";i:3;s:3:"926";}}s:8:"multiply";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"584";s:1:"N";s:8:"multiply";s:1:"B";a:4:{i:0;s:2:"39";i:1;s:1:"0";i:2;s:3:"545";i:3;s:3:"506";}}s:6:"uacute";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:6:"uacute";s:1:"B";a:4:{i:0;s:2:"68";i:1;s:3:"-15";i:2;s:3:"489";i:3;s:3:"734";}}s:6:"Tcaron";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"611";s:1:"N";s:6:"Tcaron";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:1:"0";i:2;s:3:"597";i:3;s:3:"929";}}s:11:"partialdiff";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"476";s:1:"N";s:11:"partialdiff";s:1:"B";a:4:{i:0;s:2:"13";i:1;s:3:"-38";i:2;s:3:"463";i:3;s:3:"714";}}s:9:"ydieresis";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"500";s:1:"N";s:9:"ydieresis";s:1:"B";a:4:{i:0;s:2:"11";i:1;s:4:"-214";i:2;s:3:"489";i:3;s:3:"706";}}s:6:"Nacute";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"722";s:1:"N";s:6:"Nacute";s:1:"B";a:4:{i:0;s:2:"76";i:1;s:1:"0";i:2;s:3:"646";i:3;s:3:"929";}}s:11:"icircumflex";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"278";s:1:"N";s:11:"icircumflex";s:1:"B";a:4:{i:0;s:2:"-6";i:1;s:1:"0";i:2;s:3:"285";i:3;s:3:"734";}}s:11:"Ecircumflex";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"667";s:1:"N";s:11:"Ecircumflex";s:1:"B";a:4:{i:0;s:2:"86";i:1;s:1:"0";i:2;s:3:"616";i:3;s:3:"929";}}s:9:"adieresis";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:9:"adieresis";s:1:"B";a:4:{i:0;s:2:"36";i:1;s:3:"-15";i:2;s:3:"530";i:3;s:3:"706";}}s:9:"edieresis";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:9:"edieresis";s:1:"B";a:4:{i:0;s:2:"40";i:1;s:3:"-15";i:2;s:3:"516";i:3;s:3:"706";}}s:6:"cacute";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"500";s:1:"N";s:6:"cacute";s:1:"B";a:4:{i:0;s:2:"30";i:1;s:3:"-15";i:2;s:3:"477";i:3;s:3:"734";}}s:6:"nacute";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:6:"nacute";s:1:"B";a:4:{i:0;s:2:"65";i:1;s:1:"0";i:2;s:3:"491";i:3;s:3:"734";}}s:7:"umacron";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:7:"umacron";s:1:"B";a:4:{i:0;s:2:"68";i:1;s:3:"-15";i:2;s:3:"489";i:3;s:3:"684";}}s:6:"Ncaron";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"722";s:1:"N";s:6:"Ncaron";s:1:"B";a:4:{i:0;s:2:"76";i:1;s:1:"0";i:2;s:3:"646";i:3;s:3:"929";}}s:6:"Iacute";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"278";s:1:"N";s:6:"Iacute";s:1:"B";a:4:{i:0;s:2:"91";i:1;s:1:"0";i:2;s:3:"292";i:3;s:3:"929";}}s:9:"plusminus";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"584";s:1:"N";s:9:"plusminus";s:1:"B";a:4:{i:0;s:2:"39";i:1;s:1:"0";i:2;s:3:"545";i:3;s:3:"506";}}s:9:"brokenbar";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"260";s:1:"N";s:9:"brokenbar";s:1:"B";a:4:{i:0;s:2:"94";i:1;s:4:"-150";i:2;s:3:"167";i:3;s:3:"700";}}s:10:"registered";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"737";s:1:"N";s:10:"registered";s:1:"B";a:4:{i:0;s:3:"-14";i:1;s:3:"-19";i:2;s:3:"752";i:3;s:3:"737";}}s:6:"Gbreve";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"778";s:1:"N";s:6:"Gbreve";s:1:"B";a:4:{i:0;s:2:"48";i:1;s:3:"-19";i:2;s:3:"704";i:3;s:3:"926";}}s:10:"Idotaccent";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"278";s:1:"N";s:10:"Idotaccent";s:1:"B";a:4:{i:0;s:2:"91";i:1;s:1:"0";i:2;s:3:"188";i:3;s:3:"901";}}s:9:"summation";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"600";s:1:"N";s:9:"summation";s:1:"B";a:4:{i:0;s:2:"15";i:1;s:3:"-10";i:2;s:3:"586";i:3;s:3:"706";}}s:6:"Egrave";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"667";s:1:"N";s:6:"Egrave";s:1:"B";a:4:{i:0;s:2:"86";i:1;s:1:"0";i:2;s:3:"616";i:3;s:3:"929";}}s:6:"racute";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"333";s:1:"N";s:6:"racute";s:1:"B";a:4:{i:0;s:2:"77";i:1;s:1:"0";i:2;s:3:"332";i:3;s:3:"734";}}s:7:"omacron";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:7:"omacron";s:1:"B";a:4:{i:0;s:2:"35";i:1;s:3:"-14";i:2;s:3:"521";i:3;s:3:"684";}}s:6:"Zacute";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"611";s:1:"N";s:6:"Zacute";s:1:"B";a:4:{i:0;s:2:"23";i:1;s:1:"0";i:2;s:3:"588";i:3;s:3:"929";}}s:6:"Zcaron";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"611";s:1:"N";s:6:"Zcaron";s:1:"B";a:4:{i:0;s:2:"23";i:1;s:1:"0";i:2;s:3:"588";i:3;s:3:"929";}}s:12:"greaterequal";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"549";s:1:"N";s:12:"greaterequal";s:1:"B";a:4:{i:0;s:2:"26";i:1;s:1:"0";i:2;s:3:"523";i:3;s:3:"674";}}s:3:"Eth";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"722";s:1:"N";s:3:"Eth";s:1:"B";a:4:{i:0;s:1:"0";i:1;s:1:"0";i:2;s:3:"674";i:3;s:3:"718";}}s:8:"Ccedilla";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"722";s:1:"N";s:8:"Ccedilla";s:1:"B";a:4:{i:0;s:2:"44";i:1;s:4:"-225";i:2;s:3:"681";i:3;s:3:"737";}}s:12:"lcommaaccent";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"222";s:1:"N";s:12:"lcommaaccent";s:1:"B";a:4:{i:0;s:2:"67";i:1;s:4:"-225";i:2;s:3:"167";i:3;s:3:"718";}}s:6:"tcaron";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"317";s:1:"N";s:6:"tcaron";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:2:"-7";i:2;s:3:"329";i:3;s:3:"808";}}s:7:"eogonek";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:7:"eogonek";s:1:"B";a:4:{i:0;s:2:"40";i:1;s:4:"-225";i:2;s:3:"516";i:3;s:3:"538";}}s:7:"Uogonek";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"722";s:1:"N";s:7:"Uogonek";s:1:"B";a:4:{i:0;s:2:"79";i:1;s:4:"-225";i:2;s:3:"644";i:3;s:3:"718";}}s:6:"Aacute";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"667";s:1:"N";s:6:"Aacute";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:1:"0";i:2;s:3:"654";i:3;s:3:"929";}}s:9:"Adieresis";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"667";s:1:"N";s:9:"Adieresis";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:1:"0";i:2;s:3:"654";i:3;s:3:"901";}}s:6:"egrave";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:6:"egrave";s:1:"B";a:4:{i:0;s:2:"40";i:1;s:3:"-15";i:2;s:3:"516";i:3;s:3:"734";}}s:6:"zacute";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"500";s:1:"N";s:6:"zacute";s:1:"B";a:4:{i:0;s:2:"31";i:1;s:1:"0";i:2;s:3:"469";i:3;s:3:"734";}}s:7:"iogonek";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"222";s:1:"N";s:7:"iogonek";s:1:"B";a:4:{i:0;s:3:"-31";i:1;s:4:"-225";i:2;s:3:"183";i:3;s:3:"718";}}s:6:"Oacute";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"778";s:1:"N";s:6:"Oacute";s:1:"B";a:4:{i:0;s:2:"39";i:1;s:3:"-19";i:2;s:3:"739";i:3;s:3:"929";}}s:6:"oacute";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:6:"oacute";s:1:"B";a:4:{i:0;s:2:"35";i:1;s:3:"-14";i:2;s:3:"521";i:3;s:3:"734";}}s:7:"amacron";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:7:"amacron";s:1:"B";a:4:{i:0;s:2:"36";i:1;s:3:"-15";i:2;s:3:"530";i:3;s:3:"684";}}s:6:"sacute";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"500";s:1:"N";s:6:"sacute";s:1:"B";a:4:{i:0;s:2:"32";i:1;s:3:"-15";i:2;s:3:"464";i:3;s:3:"734";}}s:9:"idieresis";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"278";s:1:"N";s:9:"idieresis";s:1:"B";a:4:{i:0;s:2:"13";i:1;s:1:"0";i:2;s:3:"266";i:3;s:3:"706";}}s:11:"Ocircumflex";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"778";s:1:"N";s:11:"Ocircumflex";s:1:"B";a:4:{i:0;s:2:"39";i:1;s:3:"-19";i:2;s:3:"739";i:3;s:3:"929";}}s:6:"Ugrave";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"722";s:1:"N";s:6:"Ugrave";s:1:"B";a:4:{i:0;s:2:"79";i:1;s:3:"-19";i:2;s:3:"644";i:3;s:3:"929";}}s:5:"Delta";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"612";s:1:"N";s:5:"Delta";s:1:"B";a:4:{i:0;s:1:"6";i:1;s:1:"0";i:2;s:3:"608";i:3;s:3:"688";}}s:5:"thorn";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:5:"thorn";s:1:"B";a:4:{i:0;s:2:"58";i:1;s:4:"-207";i:2;s:3:"517";i:3;s:3:"718";}}s:11:"twosuperior";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"333";s:1:"N";s:11:"twosuperior";s:1:"B";a:4:{i:0;s:1:"4";i:1;s:3:"281";i:2;s:3:"323";i:3;s:3:"703";}}s:9:"Odieresis";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"778";s:1:"N";s:9:"Odieresis";s:1:"B";a:4:{i:0;s:2:"39";i:1;s:3:"-19";i:2;s:3:"739";i:3;s:3:"901";}}s:2:"mu";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:2:"mu";s:1:"B";a:4:{i:0;s:2:"68";i:1;s:4:"-207";i:2;s:3:"489";i:3;s:3:"523";}}s:6:"igrave";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"278";s:1:"N";s:6:"igrave";s:1:"B";a:4:{i:0;s:3:"-13";i:1;s:1:"0";i:2;s:3:"184";i:3;s:3:"734";}}s:13:"ohungarumlaut";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:13:"ohungarumlaut";s:1:"B";a:4:{i:0;s:2:"35";i:1;s:3:"-14";i:2;s:3:"521";i:3;s:3:"734";}}s:7:"Eogonek";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"667";s:1:"N";s:7:"Eogonek";s:1:"B";a:4:{i:0;s:2:"86";i:1;s:4:"-220";i:2;s:3:"633";i:3;s:3:"718";}}s:6:"dcroat";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:6:"dcroat";s:1:"B";a:4:{i:0;s:2:"35";i:1;s:3:"-15";i:2;s:3:"550";i:3;s:3:"718";}}s:13:"threequarters";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"834";s:1:"N";s:13:"threequarters";s:1:"B";a:4:{i:0;s:2:"45";i:1;s:3:"-19";i:2;s:3:"810";i:3;s:3:"703";}}s:8:"Scedilla";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"667";s:1:"N";s:8:"Scedilla";s:1:"B";a:4:{i:0;s:2:"49";i:1;s:4:"-225";i:2;s:3:"620";i:3;s:3:"737";}}s:6:"lcaron";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"299";s:1:"N";s:6:"lcaron";s:1:"B";a:4:{i:0;s:2:"67";i:1;s:1:"0";i:2;s:3:"311";i:3;s:3:"718";}}s:12:"Kcommaaccent";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"667";s:1:"N";s:12:"Kcommaaccent";s:1:"B";a:4:{i:0;s:2:"76";i:1;s:4:"-225";i:2;s:3:"663";i:3;s:3:"718";}}s:6:"Lacute";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:6:"Lacute";s:1:"B";a:4:{i:0;s:2:"76";i:1;s:1:"0";i:2;s:3:"537";i:3;s:3:"929";}}s:9:"trademark";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:4:"1000";s:1:"N";s:9:"trademark";s:1:"B";a:4:{i:0;s:2:"46";i:1;s:3:"306";i:2;s:3:"903";i:3;s:3:"718";}}s:10:"edotaccent";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:10:"edotaccent";s:1:"B";a:4:{i:0;s:2:"40";i:1;s:3:"-15";i:2;s:3:"516";i:3;s:3:"706";}}s:6:"Igrave";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"278";s:1:"N";s:6:"Igrave";s:1:"B";a:4:{i:0;s:3:"-13";i:1;s:1:"0";i:2;s:3:"188";i:3;s:3:"929";}}s:7:"Imacron";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"278";s:1:"N";s:7:"Imacron";s:1:"B";a:4:{i:0;s:3:"-17";i:1;s:1:"0";i:2;s:3:"296";i:3;s:3:"879";}}s:6:"Lcaron";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:6:"Lcaron";s:1:"B";a:4:{i:0;s:2:"76";i:1;s:1:"0";i:2;s:3:"537";i:3;s:3:"718";}}s:7:"onehalf";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"834";s:1:"N";s:7:"onehalf";s:1:"B";a:4:{i:0;s:2:"43";i:1;s:3:"-19";i:2;s:3:"773";i:3;s:3:"703";}}s:9:"lessequal";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"549";s:1:"N";s:9:"lessequal";s:1:"B";a:4:{i:0;s:2:"26";i:1;s:1:"0";i:2;s:3:"523";i:3;s:3:"674";}}s:11:"ocircumflex";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:11:"ocircumflex";s:1:"B";a:4:{i:0;s:2:"35";i:1;s:3:"-14";i:2;s:3:"521";i:3;s:3:"734";}}s:6:"ntilde";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:6:"ntilde";s:1:"B";a:4:{i:0;s:2:"65";i:1;s:1:"0";i:2;s:3:"491";i:3;s:3:"722";}}s:13:"Uhungarumlaut";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"722";s:1:"N";s:13:"Uhungarumlaut";s:1:"B";a:4:{i:0;s:2:"79";i:1;s:3:"-19";i:2;s:3:"644";i:3;s:3:"929";}}s:6:"Eacute";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"667";s:1:"N";s:6:"Eacute";s:1:"B";a:4:{i:0;s:2:"86";i:1;s:1:"0";i:2;s:3:"616";i:3;s:3:"929";}}s:7:"emacron";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:7:"emacron";s:1:"B";a:4:{i:0;s:2:"40";i:1;s:3:"-15";i:2;s:3:"516";i:3;s:3:"684";}}s:6:"gbreve";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:6:"gbreve";s:1:"B";a:4:{i:0;s:2:"40";i:1;s:4:"-220";i:2;s:3:"499";i:3;s:3:"731";}}s:10:"onequarter";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"834";s:1:"N";s:10:"onequarter";s:1:"B";a:4:{i:0;s:2:"73";i:1;s:3:"-19";i:2;s:3:"756";i:3;s:3:"703";}}s:6:"Scaron";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"667";s:1:"N";s:6:"Scaron";s:1:"B";a:4:{i:0;s:2:"49";i:1;s:3:"-19";i:2;s:3:"620";i:3;s:3:"929";}}s:12:"Scommaaccent";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"667";s:1:"N";s:12:"Scommaaccent";s:1:"B";a:4:{i:0;s:2:"49";i:1;s:4:"-225";i:2;s:3:"620";i:3;s:3:"737";}}s:13:"Ohungarumlaut";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"778";s:1:"N";s:13:"Ohungarumlaut";s:1:"B";a:4:{i:0;s:2:"39";i:1;s:3:"-19";i:2;s:3:"739";i:3;s:3:"929";}}s:6:"degree";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"400";s:1:"N";s:6:"degree";s:1:"B";a:4:{i:0;s:2:"54";i:1;s:3:"411";i:2;s:3:"346";i:3;s:3:"703";}}s:6:"ograve";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:6:"ograve";s:1:"B";a:4:{i:0;s:2:"35";i:1;s:3:"-14";i:2;s:3:"521";i:3;s:3:"734";}}s:6:"Ccaron";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"722";s:1:"N";s:6:"Ccaron";s:1:"B";a:4:{i:0;s:2:"44";i:1;s:3:"-19";i:2;s:3:"681";i:3;s:3:"929";}}s:6:"ugrave";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:6:"ugrave";s:1:"B";a:4:{i:0;s:2:"68";i:1;s:3:"-15";i:2;s:3:"489";i:3;s:3:"734";}}s:7:"radical";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"453";s:1:"N";s:7:"radical";s:1:"B";a:4:{i:0;s:2:"-4";i:1;s:3:"-80";i:2;s:3:"458";i:3;s:3:"762";}}s:6:"Dcaron";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"722";s:1:"N";s:6:"Dcaron";s:1:"B";a:4:{i:0;s:2:"81";i:1;s:1:"0";i:2;s:3:"674";i:3;s:3:"929";}}s:12:"rcommaaccent";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"333";s:1:"N";s:12:"rcommaaccent";s:1:"B";a:4:{i:0;s:2:"77";i:1;s:4:"-225";i:2;s:3:"332";i:3;s:3:"538";}}s:6:"Ntilde";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"722";s:1:"N";s:6:"Ntilde";s:1:"B";a:4:{i:0;s:2:"76";i:1;s:1:"0";i:2;s:3:"646";i:3;s:3:"917";}}s:6:"otilde";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:6:"otilde";s:1:"B";a:4:{i:0;s:2:"35";i:1;s:3:"-14";i:2;s:3:"521";i:3;s:3:"722";}}s:12:"Rcommaaccent";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"722";s:1:"N";s:12:"Rcommaaccent";s:1:"B";a:4:{i:0;s:2:"88";i:1;s:4:"-225";i:2;s:3:"684";i:3;s:3:"718";}}s:12:"Lcommaaccent";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:12:"Lcommaaccent";s:1:"B";a:4:{i:0;s:2:"76";i:1;s:4:"-225";i:2;s:3:"537";i:3;s:3:"718";}}s:6:"Atilde";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"667";s:1:"N";s:6:"Atilde";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:1:"0";i:2;s:3:"654";i:3;s:3:"917";}}s:7:"Aogonek";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"667";s:1:"N";s:7:"Aogonek";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:4:"-225";i:2;s:3:"654";i:3;s:3:"718";}}s:5:"Aring";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"667";s:1:"N";s:5:"Aring";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:1:"0";i:2;s:3:"654";i:3;s:3:"931";}}s:6:"Otilde";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"778";s:1:"N";s:6:"Otilde";s:1:"B";a:4:{i:0;s:2:"39";i:1;s:3:"-19";i:2;s:3:"739";i:3;s:3:"917";}}s:10:"zdotaccent";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"500";s:1:"N";s:10:"zdotaccent";s:1:"B";a:4:{i:0;s:2:"31";i:1;s:1:"0";i:2;s:3:"469";i:3;s:3:"706";}}s:6:"Ecaron";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"667";s:1:"N";s:6:"Ecaron";s:1:"B";a:4:{i:0;s:2:"86";i:1;s:1:"0";i:2;s:3:"616";i:3;s:3:"929";}}s:7:"Iogonek";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"278";s:1:"N";s:7:"Iogonek";s:1:"B";a:4:{i:0;s:2:"-3";i:1;s:4:"-225";i:2;s:3:"211";i:3;s:3:"718";}}s:12:"kcommaaccent";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"500";s:1:"N";s:12:"kcommaaccent";s:1:"B";a:4:{i:0;s:2:"67";i:1;s:4:"-225";i:2;s:3:"501";i:3;s:3:"718";}}s:5:"minus";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"584";s:1:"N";s:5:"minus";s:1:"B";a:4:{i:0;s:2:"39";i:1;s:3:"216";i:2;s:3:"545";i:3;s:3:"289";}}s:11:"Icircumflex";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"278";s:1:"N";s:11:"Icircumflex";s:1:"B";a:4:{i:0;s:2:"-6";i:1;s:1:"0";i:2;s:3:"285";i:3;s:3:"929";}}s:6:"ncaron";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:6:"ncaron";s:1:"B";a:4:{i:0;s:2:"65";i:1;s:1:"0";i:2;s:3:"491";i:3;s:3:"734";}}s:12:"tcommaaccent";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"278";s:1:"N";s:12:"tcommaaccent";s:1:"B";a:4:{i:0;s:2:"14";i:1;s:4:"-225";i:2;s:3:"257";i:3;s:3:"669";}}s:10:"logicalnot";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"584";s:1:"N";s:10:"logicalnot";s:1:"B";a:4:{i:0;s:2:"39";i:1;s:3:"108";i:2;s:3:"545";i:3;s:3:"390";}}s:9:"odieresis";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:9:"odieresis";s:1:"B";a:4:{i:0;s:2:"35";i:1;s:3:"-14";i:2;s:3:"521";i:3;s:3:"706";}}s:9:"udieresis";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:9:"udieresis";s:1:"B";a:4:{i:0;s:2:"68";i:1;s:3:"-15";i:2;s:3:"489";i:3;s:3:"706";}}s:8:"notequal";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"549";s:1:"N";s:8:"notequal";s:1:"B";a:4:{i:0;s:2:"12";i:1;s:3:"-35";i:2;s:3:"537";i:3;s:3:"551";}}s:12:"gcommaaccent";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:12:"gcommaaccent";s:1:"B";a:4:{i:0;s:2:"40";i:1;s:4:"-220";i:2;s:3:"499";i:3;s:3:"822";}}s:3:"eth";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:3:"eth";s:1:"B";a:4:{i:0;s:2:"35";i:1;s:3:"-15";i:2;s:3:"522";i:3;s:3:"737";}}s:6:"zcaron";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"500";s:1:"N";s:6:"zcaron";s:1:"B";a:4:{i:0;s:2:"31";i:1;s:1:"0";i:2;s:3:"469";i:3;s:3:"734";}}s:12:"ncommaaccent";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:12:"ncommaaccent";s:1:"B";a:4:{i:0;s:2:"65";i:1;s:4:"-225";i:2;s:3:"491";i:3;s:3:"538";}}s:11:"onesuperior";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"333";s:1:"N";s:11:"onesuperior";s:1:"B";a:4:{i:0;s:2:"43";i:1;s:3:"281";i:2;s:3:"222";i:3;s:3:"703";}}s:7:"imacron";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"278";s:1:"N";s:7:"imacron";s:1:"B";a:4:{i:0;s:1:"5";i:1;s:1:"0";i:2;s:3:"272";i:3;s:3:"684";}}s:4:"Euro";a:4:{s:1:"C";s:2:"-1";s:2:"WX";s:3:"556";s:1:"N";s:4:"Euro";s:1:"B";a:4:{i:0;s:1:"0";i:1;s:1:"0";i:2;s:1:"0";i:3;s:1:"0";}}}s:3:"KPX";a:138:{s:1:"A";a:48:{s:1:"C";s:3:"-30";s:6:"Cacute";s:3:"-30";s:6:"Ccaron";s:3:"-30";s:8:"Ccedilla";s:3:"-30";s:1:"G";s:3:"-30";s:6:"Gbreve";s:3:"-30";s:12:"Gcommaaccent";s:3:"-30";s:1:"O";s:3:"-30";s:6:"Oacute";s:3:"-30";s:11:"Ocircumflex";s:3:"-30";s:9:"Odieresis";s:3:"-30";s:6:"Ograve";s:3:"-30";s:13:"Ohungarumlaut";s:3:"-30";s:7:"Omacron";s:3:"-30";s:6:"Oslash";s:3:"-30";s:6:"Otilde";s:3:"-30";s:1:"Q";s:3:"-30";s:1:"T";s:4:"-120";s:6:"Tcaron";s:4:"-120";s:12:"Tcommaaccent";s:4:"-120";s:1:"U";s:3:"-50";s:6:"Uacute";s:3:"-50";s:11:"Ucircumflex";s:3:"-50";s:9:"Udieresis";s:3:"-50";s:6:"Ugrave";s:3:"-50";s:13:"Uhungarumlaut";s:3:"-50";s:7:"Umacron";s:3:"-50";s:7:"Uogonek";s:3:"-50";s:5:"Uring";s:3:"-50";s:1:"V";s:3:"-70";s:1:"W";s:3:"-50";s:1:"Y";s:4:"-100";s:6:"Yacute";s:4:"-100";s:9:"Ydieresis";s:4:"-100";s:1:"u";s:3:"-30";s:6:"uacute";s:3:"-30";s:11:"ucircumflex";s:3:"-30";s:9:"udieresis";s:3:"-30";s:6:"ugrave";s:3:"-30";s:13:"uhungarumlaut";s:3:"-30";s:7:"umacron";s:3:"-30";s:7:"uogonek";s:3:"-30";s:5:"uring";s:3:"-30";s:1:"v";s:3:"-40";s:1:"w";s:3:"-40";s:1:"y";s:3:"-40";s:6:"yacute";s:3:"-40";s:9:"ydieresis";s:3:"-40";}s:6:"Aacute";a:48:{s:1:"C";s:3:"-30";s:6:"Cacute";s:3:"-30";s:6:"Ccaron";s:3:"-30";s:8:"Ccedilla";s:3:"-30";s:1:"G";s:3:"-30";s:6:"Gbreve";s:3:"-30";s:12:"Gcommaaccent";s:3:"-30";s:1:"O";s:3:"-30";s:6:"Oacute";s:3:"-30";s:11:"Ocircumflex";s:3:"-30";s:9:"Odieresis";s:3:"-30";s:6:"Ograve";s:3:"-30";s:13:"Ohungarumlaut";s:3:"-30";s:7:"Omacron";s:3:"-30";s:6:"Oslash";s:3:"-30";s:6:"Otilde";s:3:"-30";s:1:"Q";s:3:"-30";s:1:"T";s:4:"-120";s:6:"Tcaron";s:4:"-120";s:12:"Tcommaaccent";s:4:"-120";s:1:"U";s:3:"-50";s:6:"Uacute";s:3:"-50";s:11:"Ucircumflex";s:3:"-50";s:9:"Udieresis";s:3:"-50";s:6:"Ugrave";s:3:"-50";s:13:"Uhungarumlaut";s:3:"-50";s:7:"Umacron";s:3:"-50";s:7:"Uogonek";s:3:"-50";s:5:"Uring";s:3:"-50";s:1:"V";s:3:"-70";s:1:"W";s:3:"-50";s:1:"Y";s:4:"-100";s:6:"Yacute";s:4:"-100";s:9:"Ydieresis";s:4:"-100";s:1:"u";s:3:"-30";s:6:"uacute";s:3:"-30";s:11:"ucircumflex";s:3:"-30";s:9:"udieresis";s:3:"-30";s:6:"ugrave";s:3:"-30";s:13:"uhungarumlaut";s:3:"-30";s:7:"umacron";s:3:"-30";s:7:"uogonek";s:3:"-30";s:5:"uring";s:3:"-30";s:1:"v";s:3:"-40";s:1:"w";s:3:"-40";s:1:"y";s:3:"-40";s:6:"yacute";s:3:"-40";s:9:"ydieresis";s:3:"-40";}s:6:"Abreve";a:48:{s:1:"C";s:3:"-30";s:6:"Cacute";s:3:"-30";s:6:"Ccaron";s:3:"-30";s:8:"Ccedilla";s:3:"-30";s:1:"G";s:3:"-30";s:6:"Gbreve";s:3:"-30";s:12:"Gcommaaccent";s:3:"-30";s:1:"O";s:3:"-30";s:6:"Oacute";s:3:"-30";s:11:"Ocircumflex";s:3:"-30";s:9:"Odieresis";s:3:"-30";s:6:"Ograve";s:3:"-30";s:13:"Ohungarumlaut";s:3:"-30";s:7:"Omacron";s:3:"-30";s:6:"Oslash";s:3:"-30";s:6:"Otilde";s:3:"-30";s:1:"Q";s:3:"-30";s:1:"T";s:4:"-120";s:6:"Tcaron";s:4:"-120";s:12:"Tcommaaccent";s:4:"-120";s:1:"U";s:3:"-50";s:6:"Uacute";s:3:"-50";s:11:"Ucircumflex";s:3:"-50";s:9:"Udieresis";s:3:"-50";s:6:"Ugrave";s:3:"-50";s:13:"Uhungarumlaut";s:3:"-50";s:7:"Umacron";s:3:"-50";s:7:"Uogonek";s:3:"-50";s:5:"Uring";s:3:"-50";s:1:"V";s:3:"-70";s:1:"W";s:3:"-50";s:1:"Y";s:4:"-100";s:6:"Yacute";s:4:"-100";s:9:"Ydieresis";s:4:"-100";s:1:"u";s:3:"-30";s:6:"uacute";s:3:"-30";s:11:"ucircumflex";s:3:"-30";s:9:"udieresis";s:3:"-30";s:6:"ugrave";s:3:"-30";s:13:"uhungarumlaut";s:3:"-30";s:7:"umacron";s:3:"-30";s:7:"uogonek";s:3:"-30";s:5:"uring";s:3:"-30";s:1:"v";s:3:"-40";s:1:"w";s:3:"-40";s:1:"y";s:3:"-40";s:6:"yacute";s:3:"-40";s:9:"ydieresis";s:3:"-40";}s:11:"Acircumflex";a:48:{s:1:"C";s:3:"-30";s:6:"Cacute";s:3:"-30";s:6:"Ccaron";s:3:"-30";s:8:"Ccedilla";s:3:"-30";s:1:"G";s:3:"-30";s:6:"Gbreve";s:3:"-30";s:12:"Gcommaaccent";s:3:"-30";s:1:"O";s:3:"-30";s:6:"Oacute";s:3:"-30";s:11:"Ocircumflex";s:3:"-30";s:9:"Odieresis";s:3:"-30";s:6:"Ograve";s:3:"-30";s:13:"Ohungarumlaut";s:3:"-30";s:7:"Omacron";s:3:"-30";s:6:"Oslash";s:3:"-30";s:6:"Otilde";s:3:"-30";s:1:"Q";s:3:"-30";s:1:"T";s:4:"-120";s:6:"Tcaron";s:4:"-120";s:12:"Tcommaaccent";s:4:"-120";s:1:"U";s:3:"-50";s:6:"Uacute";s:3:"-50";s:11:"Ucircumflex";s:3:"-50";s:9:"Udieresis";s:3:"-50";s:6:"Ugrave";s:3:"-50";s:13:"Uhungarumlaut";s:3:"-50";s:7:"Umacron";s:3:"-50";s:7:"Uogonek";s:3:"-50";s:5:"Uring";s:3:"-50";s:1:"V";s:3:"-70";s:1:"W";s:3:"-50";s:1:"Y";s:4:"-100";s:6:"Yacute";s:4:"-100";s:9:"Ydieresis";s:4:"-100";s:1:"u";s:3:"-30";s:6:"uacute";s:3:"-30";s:11:"ucircumflex";s:3:"-30";s:9:"udieresis";s:3:"-30";s:6:"ugrave";s:3:"-30";s:13:"uhungarumlaut";s:3:"-30";s:7:"umacron";s:3:"-30";s:7:"uogonek";s:3:"-30";s:5:"uring";s:3:"-30";s:1:"v";s:3:"-40";s:1:"w";s:3:"-40";s:1:"y";s:3:"-40";s:6:"yacute";s:3:"-40";s:9:"ydieresis";s:3:"-40";}s:9:"Adieresis";a:48:{s:1:"C";s:3:"-30";s:6:"Cacute";s:3:"-30";s:6:"Ccaron";s:3:"-30";s:8:"Ccedilla";s:3:"-30";s:1:"G";s:3:"-30";s:6:"Gbreve";s:3:"-30";s:12:"Gcommaaccent";s:3:"-30";s:1:"O";s:3:"-30";s:6:"Oacute";s:3:"-30";s:11:"Ocircumflex";s:3:"-30";s:9:"Odieresis";s:3:"-30";s:6:"Ograve";s:3:"-30";s:13:"Ohungarumlaut";s:3:"-30";s:7:"Omacron";s:3:"-30";s:6:"Oslash";s:3:"-30";s:6:"Otilde";s:3:"-30";s:1:"Q";s:3:"-30";s:1:"T";s:4:"-120";s:6:"Tcaron";s:4:"-120";s:12:"Tcommaaccent";s:4:"-120";s:1:"U";s:3:"-50";s:6:"Uacute";s:3:"-50";s:11:"Ucircumflex";s:3:"-50";s:9:"Udieresis";s:3:"-50";s:6:"Ugrave";s:3:"-50";s:13:"Uhungarumlaut";s:3:"-50";s:7:"Umacron";s:3:"-50";s:7:"Uogonek";s:3:"-50";s:5:"Uring";s:3:"-50";s:1:"V";s:3:"-70";s:1:"W";s:3:"-50";s:1:"Y";s:4:"-100";s:6:"Yacute";s:4:"-100";s:9:"Ydieresis";s:4:"-100";s:1:"u";s:3:"-30";s:6:"uacute";s:3:"-30";s:11:"ucircumflex";s:3:"-30";s:9:"udieresis";s:3:"-30";s:6:"ugrave";s:3:"-30";s:13:"uhungarumlaut";s:3:"-30";s:7:"umacron";s:3:"-30";s:7:"uogonek";s:3:"-30";s:5:"uring";s:3:"-30";s:1:"v";s:3:"-40";s:1:"w";s:3:"-40";s:1:"y";s:3:"-40";s:6:"yacute";s:3:"-40";s:9:"ydieresis";s:3:"-40";}s:6:"Agrave";a:48:{s:1:"C";s:3:"-30";s:6:"Cacute";s:3:"-30";s:6:"Ccaron";s:3:"-30";s:8:"Ccedilla";s:3:"-30";s:1:"G";s:3:"-30";s:6:"Gbreve";s:3:"-30";s:12:"Gcommaaccent";s:3:"-30";s:1:"O";s:3:"-30";s:6:"Oacute";s:3:"-30";s:11:"Ocircumflex";s:3:"-30";s:9:"Odieresis";s:3:"-30";s:6:"Ograve";s:3:"-30";s:13:"Ohungarumlaut";s:3:"-30";s:7:"Omacron";s:3:"-30";s:6:"Oslash";s:3:"-30";s:6:"Otilde";s:3:"-30";s:1:"Q";s:3:"-30";s:1:"T";s:4:"-120";s:6:"Tcaron";s:4:"-120";s:12:"Tcommaaccent";s:4:"-120";s:1:"U";s:3:"-50";s:6:"Uacute";s:3:"-50";s:11:"Ucircumflex";s:3:"-50";s:9:"Udieresis";s:3:"-50";s:6:"Ugrave";s:3:"-50";s:13:"Uhungarumlaut";s:3:"-50";s:7:"Umacron";s:3:"-50";s:7:"Uogonek";s:3:"-50";s:5:"Uring";s:3:"-50";s:1:"V";s:3:"-70";s:1:"W";s:3:"-50";s:1:"Y";s:4:"-100";s:6:"Yacute";s:4:"-100";s:9:"Ydieresis";s:4:"-100";s:1:"u";s:3:"-30";s:6:"uacute";s:3:"-30";s:11:"ucircumflex";s:3:"-30";s:9:"udieresis";s:3:"-30";s:6:"ugrave";s:3:"-30";s:13:"uhungarumlaut";s:3:"-30";s:7:"umacron";s:3:"-30";s:7:"uogonek";s:3:"-30";s:5:"uring";s:3:"-30";s:1:"v";s:3:"-40";s:1:"w";s:3:"-40";s:1:"y";s:3:"-40";s:6:"yacute";s:3:"-40";s:9:"ydieresis";s:3:"-40";}s:7:"Amacron";a:48:{s:1:"C";s:3:"-30";s:6:"Cacute";s:3:"-30";s:6:"Ccaron";s:3:"-30";s:8:"Ccedilla";s:3:"-30";s:1:"G";s:3:"-30";s:6:"Gbreve";s:3:"-30";s:12:"Gcommaaccent";s:3:"-30";s:1:"O";s:3:"-30";s:6:"Oacute";s:3:"-30";s:11:"Ocircumflex";s:3:"-30";s:9:"Odieresis";s:3:"-30";s:6:"Ograve";s:3:"-30";s:13:"Ohungarumlaut";s:3:"-30";s:7:"Omacron";s:3:"-30";s:6:"Oslash";s:3:"-30";s:6:"Otilde";s:3:"-30";s:1:"Q";s:3:"-30";s:1:"T";s:4:"-120";s:6:"Tcaron";s:4:"-120";s:12:"Tcommaaccent";s:4:"-120";s:1:"U";s:3:"-50";s:6:"Uacute";s:3:"-50";s:11:"Ucircumflex";s:3:"-50";s:9:"Udieresis";s:3:"-50";s:6:"Ugrave";s:3:"-50";s:13:"Uhungarumlaut";s:3:"-50";s:7:"Umacron";s:3:"-50";s:7:"Uogonek";s:3:"-50";s:5:"Uring";s:3:"-50";s:1:"V";s:3:"-70";s:1:"W";s:3:"-50";s:1:"Y";s:4:"-100";s:6:"Yacute";s:4:"-100";s:9:"Ydieresis";s:4:"-100";s:1:"u";s:3:"-30";s:6:"uacute";s:3:"-30";s:11:"ucircumflex";s:3:"-30";s:9:"udieresis";s:3:"-30";s:6:"ugrave";s:3:"-30";s:13:"uhungarumlaut";s:3:"-30";s:7:"umacron";s:3:"-30";s:7:"uogonek";s:3:"-30";s:5:"uring";s:3:"-30";s:1:"v";s:3:"-40";s:1:"w";s:3:"-40";s:1:"y";s:3:"-40";s:6:"yacute";s:3:"-40";s:9:"ydieresis";s:3:"-40";}s:7:"Aogonek";a:48:{s:1:"C";s:3:"-30";s:6:"Cacute";s:3:"-30";s:6:"Ccaron";s:3:"-30";s:8:"Ccedilla";s:3:"-30";s:1:"G";s:3:"-30";s:6:"Gbreve";s:3:"-30";s:12:"Gcommaaccent";s:3:"-30";s:1:"O";s:3:"-30";s:6:"Oacute";s:3:"-30";s:11:"Ocircumflex";s:3:"-30";s:9:"Odieresis";s:3:"-30";s:6:"Ograve";s:3:"-30";s:13:"Ohungarumlaut";s:3:"-30";s:7:"Omacron";s:3:"-30";s:6:"Oslash";s:3:"-30";s:6:"Otilde";s:3:"-30";s:1:"Q";s:3:"-30";s:1:"T";s:4:"-120";s:6:"Tcaron";s:4:"-120";s:12:"Tcommaaccent";s:4:"-120";s:1:"U";s:3:"-50";s:6:"Uacute";s:3:"-50";s:11:"Ucircumflex";s:3:"-50";s:9:"Udieresis";s:3:"-50";s:6:"Ugrave";s:3:"-50";s:13:"Uhungarumlaut";s:3:"-50";s:7:"Umacron";s:3:"-50";s:7:"Uogonek";s:3:"-50";s:5:"Uring";s:3:"-50";s:1:"V";s:3:"-70";s:1:"W";s:3:"-50";s:1:"Y";s:4:"-100";s:6:"Yacute";s:4:"-100";s:9:"Ydieresis";s:4:"-100";s:1:"u";s:3:"-30";s:6:"uacute";s:3:"-30";s:11:"ucircumflex";s:3:"-30";s:9:"udieresis";s:3:"-30";s:6:"ugrave";s:3:"-30";s:13:"uhungarumlaut";s:3:"-30";s:7:"umacron";s:3:"-30";s:7:"uogonek";s:3:"-30";s:5:"uring";s:3:"-30";s:1:"v";s:3:"-40";s:1:"w";s:3:"-40";s:1:"y";s:3:"-40";s:6:"yacute";s:3:"-40";s:9:"ydieresis";s:3:"-40";}s:5:"Aring";a:48:{s:1:"C";s:3:"-30";s:6:"Cacute";s:3:"-30";s:6:"Ccaron";s:3:"-30";s:8:"Ccedilla";s:3:"-30";s:1:"G";s:3:"-30";s:6:"Gbreve";s:3:"-30";s:12:"Gcommaaccent";s:3:"-30";s:1:"O";s:3:"-30";s:6:"Oacute";s:3:"-30";s:11:"Ocircumflex";s:3:"-30";s:9:"Odieresis";s:3:"-30";s:6:"Ograve";s:3:"-30";s:13:"Ohungarumlaut";s:3:"-30";s:7:"Omacron";s:3:"-30";s:6:"Oslash";s:3:"-30";s:6:"Otilde";s:3:"-30";s:1:"Q";s:3:"-30";s:1:"T";s:4:"-120";s:6:"Tcaron";s:4:"-120";s:12:"Tcommaaccent";s:4:"-120";s:1:"U";s:3:"-50";s:6:"Uacute";s:3:"-50";s:11:"Ucircumflex";s:3:"-50";s:9:"Udieresis";s:3:"-50";s:6:"Ugrave";s:3:"-50";s:13:"Uhungarumlaut";s:3:"-50";s:7:"Umacron";s:3:"-50";s:7:"Uogonek";s:3:"-50";s:5:"Uring";s:3:"-50";s:1:"V";s:3:"-70";s:1:"W";s:3:"-50";s:1:"Y";s:4:"-100";s:6:"Yacute";s:4:"-100";s:9:"Ydieresis";s:4:"-100";s:1:"u";s:3:"-30";s:6:"uacute";s:3:"-30";s:11:"ucircumflex";s:3:"-30";s:9:"udieresis";s:3:"-30";s:6:"ugrave";s:3:"-30";s:13:"uhungarumlaut";s:3:"-30";s:7:"umacron";s:3:"-30";s:7:"uogonek";s:3:"-30";s:5:"uring";s:3:"-30";s:1:"v";s:3:"-40";s:1:"w";s:3:"-40";s:1:"y";s:3:"-40";s:6:"yacute";s:3:"-40";s:9:"ydieresis";s:3:"-40";}s:6:"Atilde";a:48:{s:1:"C";s:3:"-30";s:6:"Cacute";s:3:"-30";s:6:"Ccaron";s:3:"-30";s:8:"Ccedilla";s:3:"-30";s:1:"G";s:3:"-30";s:6:"Gbreve";s:3:"-30";s:12:"Gcommaaccent";s:3:"-30";s:1:"O";s:3:"-30";s:6:"Oacute";s:3:"-30";s:11:"Ocircumflex";s:3:"-30";s:9:"Odieresis";s:3:"-30";s:6:"Ograve";s:3:"-30";s:13:"Ohungarumlaut";s:3:"-30";s:7:"Omacron";s:3:"-30";s:6:"Oslash";s:3:"-30";s:6:"Otilde";s:3:"-30";s:1:"Q";s:3:"-30";s:1:"T";s:4:"-120";s:6:"Tcaron";s:4:"-120";s:12:"Tcommaaccent";s:4:"-120";s:1:"U";s:3:"-50";s:6:"Uacute";s:3:"-50";s:11:"Ucircumflex";s:3:"-50";s:9:"Udieresis";s:3:"-50";s:6:"Ugrave";s:3:"-50";s:13:"Uhungarumlaut";s:3:"-50";s:7:"Umacron";s:3:"-50";s:7:"Uogonek";s:3:"-50";s:5:"Uring";s:3:"-50";s:1:"V";s:3:"-70";s:1:"W";s:3:"-50";s:1:"Y";s:4:"-100";s:6:"Yacute";s:4:"-100";s:9:"Ydieresis";s:4:"-100";s:1:"u";s:3:"-30";s:6:"uacute";s:3:"-30";s:11:"ucircumflex";s:3:"-30";s:9:"udieresis";s:3:"-30";s:6:"ugrave";s:3:"-30";s:13:"uhungarumlaut";s:3:"-30";s:7:"umacron";s:3:"-30";s:7:"uogonek";s:3:"-30";s:5:"uring";s:3:"-30";s:1:"v";s:3:"-40";s:1:"w";s:3:"-40";s:1:"y";s:3:"-40";s:6:"yacute";s:3:"-40";s:9:"ydieresis";s:3:"-40";}s:1:"B";a:11:{s:1:"U";s:3:"-10";s:6:"Uacute";s:3:"-10";s:11:"Ucircumflex";s:3:"-10";s:9:"Udieresis";s:3:"-10";s:6:"Ugrave";s:3:"-10";s:13:"Uhungarumlaut";s:3:"-10";s:7:"Umacron";s:3:"-10";s:7:"Uogonek";s:3:"-10";s:5:"Uring";s:3:"-10";s:5:"comma";s:3:"-20";s:6:"period";s:3:"-20";}s:1:"C";a:2:{s:5:"comma";s:3:"-30";s:6:"period";s:3:"-30";}s:6:"Cacute";a:2:{s:5:"comma";s:3:"-30";s:6:"period";s:3:"-30";}s:6:"Ccaron";a:2:{s:5:"comma";s:3:"-30";s:6:"period";s:3:"-30";}s:8:"Ccedilla";a:2:{s:5:"comma";s:3:"-30";s:6:"period";s:3:"-30";}s:1:"D";a:17:{s:1:"A";s:3:"-40";s:6:"Aacute";s:3:"-40";s:6:"Abreve";s:3:"-40";s:11:"Acircumflex";s:3:"-40";s:9:"Adieresis";s:3:"-40";s:6:"Agrave";s:3:"-40";s:7:"Amacron";s:3:"-40";s:7:"Aogonek";s:3:"-40";s:5:"Aring";s:3:"-40";s:6:"Atilde";s:3:"-40";s:1:"V";s:3:"-70";s:1:"W";s:3:"-40";s:1:"Y";s:3:"-90";s:6:"Yacute";s:3:"-90";s:9:"Ydieresis";s:3:"-90";s:5:"comma";s:3:"-70";s:6:"period";s:3:"-70";}s:6:"Dcaron";a:17:{s:1:"A";s:3:"-40";s:6:"Aacute";s:3:"-40";s:6:"Abreve";s:3:"-40";s:11:"Acircumflex";s:3:"-40";s:9:"Adieresis";s:3:"-40";s:6:"Agrave";s:3:"-40";s:7:"Amacron";s:3:"-40";s:7:"Aogonek";s:3:"-40";s:5:"Aring";s:3:"-40";s:6:"Atilde";s:3:"-40";s:1:"V";s:3:"-70";s:1:"W";s:3:"-40";s:1:"Y";s:3:"-90";s:6:"Yacute";s:3:"-90";s:9:"Ydieresis";s:3:"-90";s:5:"comma";s:3:"-70";s:6:"period";s:3:"-70";}s:6:"Dcroat";a:17:{s:1:"A";s:3:"-40";s:6:"Aacute";s:3:"-40";s:6:"Abreve";s:3:"-40";s:11:"Acircumflex";s:3:"-40";s:9:"Adieresis";s:3:"-40";s:6:"Agrave";s:3:"-40";s:7:"Amacron";s:3:"-40";s:7:"Aogonek";s:3:"-40";s:5:"Aring";s:3:"-40";s:6:"Atilde";s:3:"-40";s:1:"V";s:3:"-70";s:1:"W";s:3:"-40";s:1:"Y";s:3:"-90";s:6:"Yacute";s:3:"-90";s:9:"Ydieresis";s:3:"-90";s:5:"comma";s:3:"-70";s:6:"period";s:3:"-70";}s:1:"F";a:44:{s:1:"A";s:3:"-80";s:6:"Aacute";s:3:"-80";s:6:"Abreve";s:3:"-80";s:11:"Acircumflex";s:3:"-80";s:9:"Adieresis";s:3:"-80";s:6:"Agrave";s:3:"-80";s:7:"Amacron";s:3:"-80";s:7:"Aogonek";s:3:"-80";s:5:"Aring";s:3:"-80";s:6:"Atilde";s:3:"-80";s:1:"a";s:3:"-50";s:6:"aacute";s:3:"-50";s:6:"abreve";s:3:"-50";s:11:"acircumflex";s:3:"-50";s:9:"adieresis";s:3:"-50";s:6:"agrave";s:3:"-50";s:7:"amacron";s:3:"-50";s:7:"aogonek";s:3:"-50";s:5:"aring";s:3:"-50";s:6:"atilde";s:3:"-50";s:5:"comma";s:4:"-150";s:1:"e";s:3:"-30";s:6:"eacute";s:3:"-30";s:6:"ecaron";s:3:"-30";s:11:"ecircumflex";s:3:"-30";s:9:"edieresis";s:3:"-30";s:10:"edotaccent";s:3:"-30";s:6:"egrave";s:3:"-30";s:7:"emacron";s:3:"-30";s:7:"eogonek";s:3:"-30";s:1:"o";s:3:"-30";s:6:"oacute";s:3:"-30";s:11:"ocircumflex";s:3:"-30";s:9:"odieresis";s:3:"-30";s:6:"ograve";s:3:"-30";s:13:"ohungarumlaut";s:3:"-30";s:7:"omacron";s:3:"-30";s:6:"oslash";s:3:"-30";s:6:"otilde";s:3:"-30";s:6:"period";s:4:"-150";s:1:"r";s:3:"-45";s:6:"racute";s:3:"-45";s:6:"rcaron";s:3:"-45";s:12:"rcommaaccent";s:3:"-45";}s:1:"J";a:31:{s:1:"A";s:3:"-20";s:6:"Aacute";s:3:"-20";s:6:"Abreve";s:3:"-20";s:11:"Acircumflex";s:3:"-20";s:9:"Adieresis";s:3:"-20";s:6:"Agrave";s:3:"-20";s:7:"Amacron";s:3:"-20";s:7:"Aogonek";s:3:"-20";s:5:"Aring";s:3:"-20";s:6:"Atilde";s:3:"-20";s:1:"a";s:3:"-20";s:6:"aacute";s:3:"-20";s:6:"abreve";s:3:"-20";s:11:"acircumflex";s:3:"-20";s:9:"adieresis";s:3:"-20";s:6:"agrave";s:3:"-20";s:7:"amacron";s:3:"-20";s:7:"aogonek";s:3:"-20";s:5:"aring";s:3:"-20";s:6:"atilde";s:3:"-20";s:5:"comma";s:3:"-30";s:6:"period";s:3:"-30";s:1:"u";s:3:"-20";s:6:"uacute";s:3:"-20";s:11:"ucircumflex";s:3:"-20";s:9:"udieresis";s:3:"-20";s:6:"ugrave";s:3:"-20";s:13:"uhungarumlaut";s:3:"-20";s:7:"umacron";s:3:"-20";s:7:"uogonek";s:3:"-20";s:5:"uring";s:3:"-20";}s:1:"K";a:39:{s:1:"O";s:3:"-50";s:6:"Oacute";s:3:"-50";s:11:"Ocircumflex";s:3:"-50";s:9:"Odieresis";s:3:"-50";s:6:"Ograve";s:3:"-50";s:13:"Ohungarumlaut";s:3:"-50";s:7:"Omacron";s:3:"-50";s:6:"Oslash";s:3:"-50";s:6:"Otilde";s:3:"-50";s:1:"e";s:3:"-40";s:6:"eacute";s:3:"-40";s:6:"ecaron";s:3:"-40";s:11:"ecircumflex";s:3:"-40";s:9:"edieresis";s:3:"-40";s:10:"edotaccent";s:3:"-40";s:6:"egrave";s:3:"-40";s:7:"emacron";s:3:"-40";s:7:"eogonek";s:3:"-40";s:1:"o";s:3:"-40";s:6:"oacute";s:3:"-40";s:11:"ocircumflex";s:3:"-40";s:9:"odieresis";s:3:"-40";s:6:"ograve";s:3:"-40";s:13:"ohungarumlaut";s:3:"-40";s:7:"omacron";s:3:"-40";s:6:"oslash";s:3:"-40";s:6:"otilde";s:3:"-40";s:1:"u";s:3:"-30";s:6:"uacute";s:3:"-30";s:11:"ucircumflex";s:3:"-30";s:9:"udieresis";s:3:"-30";s:6:"ugrave";s:3:"-30";s:13:"uhungarumlaut";s:3:"-30";s:7:"umacron";s:3:"-30";s:7:"uogonek";s:3:"-30";s:5:"uring";s:3:"-30";s:1:"y";s:3:"-50";s:6:"yacute";s:3:"-50";s:9:"ydieresis";s:3:"-50";}s:12:"Kcommaaccent";a:39:{s:1:"O";s:3:"-50";s:6:"Oacute";s:3:"-50";s:11:"Ocircumflex";s:3:"-50";s:9:"Odieresis";s:3:"-50";s:6:"Ograve";s:3:"-50";s:13:"Ohungarumlaut";s:3:"-50";s:7:"Omacron";s:3:"-50";s:6:"Oslash";s:3:"-50";s:6:"Otilde";s:3:"-50";s:1:"e";s:3:"-40";s:6:"eacute";s:3:"-40";s:6:"ecaron";s:3:"-40";s:11:"ecircumflex";s:3:"-40";s:9:"edieresis";s:3:"-40";s:10:"edotaccent";s:3:"-40";s:6:"egrave";s:3:"-40";s:7:"emacron";s:3:"-40";s:7:"eogonek";s:3:"-40";s:1:"o";s:3:"-40";s:6:"oacute";s:3:"-40";s:11:"ocircumflex";s:3:"-40";s:9:"odieresis";s:3:"-40";s:6:"ograve";s:3:"-40";s:13:"ohungarumlaut";s:3:"-40";s:7:"omacron";s:3:"-40";s:6:"oslash";s:3:"-40";s:6:"otilde";s:3:"-40";s:1:"u";s:3:"-30";s:6:"uacute";s:3:"-30";s:11:"ucircumflex";s:3:"-30";s:9:"udieresis";s:3:"-30";s:6:"ugrave";s:3:"-30";s:13:"uhungarumlaut";s:3:"-30";s:7:"umacron";s:3:"-30";s:7:"uogonek";s:3:"-30";s:5:"uring";s:3:"-30";s:1:"y";s:3:"-50";s:6:"yacute";s:3:"-50";s:9:"ydieresis";s:3:"-50";}s:1:"L";a:13:{s:1:"T";s:4:"-110";s:6:"Tcaron";s:4:"-110";s:12:"Tcommaaccent";s:4:"-110";s:1:"V";s:4:"-110";s:1:"W";s:3:"-70";s:1:"Y";s:4:"-140";s:6:"Yacute";s:4:"-140";s:9:"Ydieresis";s:4:"-140";s:13:"quotedblright";s:4:"-140";s:10:"quoteright";s:4:"-160";s:1:"y";s:3:"-30";s:6:"yacute";s:3:"-30";s:9:"ydieresis";s:3:"-30";}s:6:"Lacute";a:13:{s:1:"T";s:4:"-110";s:6:"Tcaron";s:4:"-110";s:12:"Tcommaaccent";s:4:"-110";s:1:"V";s:4:"-110";s:1:"W";s:3:"-70";s:1:"Y";s:4:"-140";s:6:"Yacute";s:4:"-140";s:9:"Ydieresis";s:4:"-140";s:13:"quotedblright";s:4:"-140";s:10:"quoteright";s:4:"-160";s:1:"y";s:3:"-30";s:6:"yacute";s:3:"-30";s:9:"ydieresis";s:3:"-30";}s:6:"Lcaron";a:13:{s:1:"T";s:4:"-110";s:6:"Tcaron";s:4:"-110";s:12:"Tcommaaccent";s:4:"-110";s:1:"V";s:4:"-110";s:1:"W";s:3:"-70";s:1:"Y";s:4:"-140";s:6:"Yacute";s:4:"-140";s:9:"Ydieresis";s:4:"-140";s:13:"quotedblright";s:4:"-140";s:10:"quoteright";s:4:"-160";s:1:"y";s:3:"-30";s:6:"yacute";s:3:"-30";s:9:"ydieresis";s:3:"-30";}s:12:"Lcommaaccent";a:13:{s:1:"T";s:4:"-110";s:6:"Tcaron";s:4:"-110";s:12:"Tcommaaccent";s:4:"-110";s:1:"V";s:4:"-110";s:1:"W";s:3:"-70";s:1:"Y";s:4:"-140";s:6:"Yacute";s:4:"-140";s:9:"Ydieresis";s:4:"-140";s:13:"quotedblright";s:4:"-140";s:10:"quoteright";s:4:"-160";s:1:"y";s:3:"-30";s:6:"yacute";s:3:"-30";s:9:"ydieresis";s:3:"-30";}s:6:"Lslash";a:13:{s:1:"T";s:4:"-110";s:6:"Tcaron";s:4:"-110";s:12:"Tcommaaccent";s:4:"-110";s:1:"V";s:4:"-110";s:1:"W";s:3:"-70";s:1:"Y";s:4:"-140";s:6:"Yacute";s:4:"-140";s:9:"Ydieresis";s:4:"-140";s:13:"quotedblright";s:4:"-140";s:10:"quoteright";s:4:"-160";s:1:"y";s:3:"-30";s:6:"yacute";s:3:"-30";s:9:"ydieresis";s:3:"-30";}s:1:"O";a:21:{s:1:"A";s:3:"-20";s:6:"Aacute";s:3:"-20";s:6:"Abreve";s:3:"-20";s:11:"Acircumflex";s:3:"-20";s:9:"Adieresis";s:3:"-20";s:6:"Agrave";s:3:"-20";s:7:"Amacron";s:3:"-20";s:7:"Aogonek";s:3:"-20";s:5:"Aring";s:3:"-20";s:6:"Atilde";s:3:"-20";s:1:"T";s:3:"-40";s:6:"Tcaron";s:3:"-40";s:12:"Tcommaaccent";s:3:"-40";s:1:"V";s:3:"-50";s:1:"W";s:3:"-30";s:1:"X";s:3:"-60";s:1:"Y";s:3:"-70";s:6:"Yacute";s:3:"-70";s:9:"Ydieresis";s:3:"-70";s:5:"comma";s:3:"-40";s:6:"period";s:3:"-40";}s:6:"Oacute";a:21:{s:1:"A";s:3:"-20";s:6:"Aacute";s:3:"-20";s:6:"Abreve";s:3:"-20";s:11:"Acircumflex";s:3:"-20";s:9:"Adieresis";s:3:"-20";s:6:"Agrave";s:3:"-20";s:7:"Amacron";s:3:"-20";s:7:"Aogonek";s:3:"-20";s:5:"Aring";s:3:"-20";s:6:"Atilde";s:3:"-20";s:1:"T";s:3:"-40";s:6:"Tcaron";s:3:"-40";s:12:"Tcommaaccent";s:3:"-40";s:1:"V";s:3:"-50";s:1:"W";s:3:"-30";s:1:"X";s:3:"-60";s:1:"Y";s:3:"-70";s:6:"Yacute";s:3:"-70";s:9:"Ydieresis";s:3:"-70";s:5:"comma";s:3:"-40";s:6:"period";s:3:"-40";}s:11:"Ocircumflex";a:21:{s:1:"A";s:3:"-20";s:6:"Aacute";s:3:"-20";s:6:"Abreve";s:3:"-20";s:11:"Acircumflex";s:3:"-20";s:9:"Adieresis";s:3:"-20";s:6:"Agrave";s:3:"-20";s:7:"Amacron";s:3:"-20";s:7:"Aogonek";s:3:"-20";s:5:"Aring";s:3:"-20";s:6:"Atilde";s:3:"-20";s:1:"T";s:3:"-40";s:6:"Tcaron";s:3:"-40";s:12:"Tcommaaccent";s:3:"-40";s:1:"V";s:3:"-50";s:1:"W";s:3:"-30";s:1:"X";s:3:"-60";s:1:"Y";s:3:"-70";s:6:"Yacute";s:3:"-70";s:9:"Ydieresis";s:3:"-70";s:5:"comma";s:3:"-40";s:6:"period";s:3:"-40";}s:9:"Odieresis";a:21:{s:1:"A";s:3:"-20";s:6:"Aacute";s:3:"-20";s:6:"Abreve";s:3:"-20";s:11:"Acircumflex";s:3:"-20";s:9:"Adieresis";s:3:"-20";s:6:"Agrave";s:3:"-20";s:7:"Amacron";s:3:"-20";s:7:"Aogonek";s:3:"-20";s:5:"Aring";s:3:"-20";s:6:"Atilde";s:3:"-20";s:1:"T";s:3:"-40";s:6:"Tcaron";s:3:"-40";s:12:"Tcommaaccent";s:3:"-40";s:1:"V";s:3:"-50";s:1:"W";s:3:"-30";s:1:"X";s:3:"-60";s:1:"Y";s:3:"-70";s:6:"Yacute";s:3:"-70";s:9:"Ydieresis";s:3:"-70";s:5:"comma";s:3:"-40";s:6:"period";s:3:"-40";}s:6:"Ograve";a:21:{s:1:"A";s:3:"-20";s:6:"Aacute";s:3:"-20";s:6:"Abreve";s:3:"-20";s:11:"Acircumflex";s:3:"-20";s:9:"Adieresis";s:3:"-20";s:6:"Agrave";s:3:"-20";s:7:"Amacron";s:3:"-20";s:7:"Aogonek";s:3:"-20";s:5:"Aring";s:3:"-20";s:6:"Atilde";s:3:"-20";s:1:"T";s:3:"-40";s:6:"Tcaron";s:3:"-40";s:12:"Tcommaaccent";s:3:"-40";s:1:"V";s:3:"-50";s:1:"W";s:3:"-30";s:1:"X";s:3:"-60";s:1:"Y";s:3:"-70";s:6:"Yacute";s:3:"-70";s:9:"Ydieresis";s:3:"-70";s:5:"comma";s:3:"-40";s:6:"period";s:3:"-40";}s:13:"Ohungarumlaut";a:21:{s:1:"A";s:3:"-20";s:6:"Aacute";s:3:"-20";s:6:"Abreve";s:3:"-20";s:11:"Acircumflex";s:3:"-20";s:9:"Adieresis";s:3:"-20";s:6:"Agrave";s:3:"-20";s:7:"Amacron";s:3:"-20";s:7:"Aogonek";s:3:"-20";s:5:"Aring";s:3:"-20";s:6:"Atilde";s:3:"-20";s:1:"T";s:3:"-40";s:6:"Tcaron";s:3:"-40";s:12:"Tcommaaccent";s:3:"-40";s:1:"V";s:3:"-50";s:1:"W";s:3:"-30";s:1:"X";s:3:"-60";s:1:"Y";s:3:"-70";s:6:"Yacute";s:3:"-70";s:9:"Ydieresis";s:3:"-70";s:5:"comma";s:3:"-40";s:6:"period";s:3:"-40";}s:7:"Omacron";a:21:{s:1:"A";s:3:"-20";s:6:"Aacute";s:3:"-20";s:6:"Abreve";s:3:"-20";s:11:"Acircumflex";s:3:"-20";s:9:"Adieresis";s:3:"-20";s:6:"Agrave";s:3:"-20";s:7:"Amacron";s:3:"-20";s:7:"Aogonek";s:3:"-20";s:5:"Aring";s:3:"-20";s:6:"Atilde";s:3:"-20";s:1:"T";s:3:"-40";s:6:"Tcaron";s:3:"-40";s:12:"Tcommaaccent";s:3:"-40";s:1:"V";s:3:"-50";s:1:"W";s:3:"-30";s:1:"X";s:3:"-60";s:1:"Y";s:3:"-70";s:6:"Yacute";s:3:"-70";s:9:"Ydieresis";s:3:"-70";s:5:"comma";s:3:"-40";s:6:"period";s:3:"-40";}s:6:"Oslash";a:21:{s:1:"A";s:3:"-20";s:6:"Aacute";s:3:"-20";s:6:"Abreve";s:3:"-20";s:11:"Acircumflex";s:3:"-20";s:9:"Adieresis";s:3:"-20";s:6:"Agrave";s:3:"-20";s:7:"Amacron";s:3:"-20";s:7:"Aogonek";s:3:"-20";s:5:"Aring";s:3:"-20";s:6:"Atilde";s:3:"-20";s:1:"T";s:3:"-40";s:6:"Tcaron";s:3:"-40";s:12:"Tcommaaccent";s:3:"-40";s:1:"V";s:3:"-50";s:1:"W";s:3:"-30";s:1:"X";s:3:"-60";s:1:"Y";s:3:"-70";s:6:"Yacute";s:3:"-70";s:9:"Ydieresis";s:3:"-70";s:5:"comma";s:3:"-40";s:6:"period";s:3:"-40";}s:6:"Otilde";a:21:{s:1:"A";s:3:"-20";s:6:"Aacute";s:3:"-20";s:6:"Abreve";s:3:"-20";s:11:"Acircumflex";s:3:"-20";s:9:"Adieresis";s:3:"-20";s:6:"Agrave";s:3:"-20";s:7:"Amacron";s:3:"-20";s:7:"Aogonek";s:3:"-20";s:5:"Aring";s:3:"-20";s:6:"Atilde";s:3:"-20";s:1:"T";s:3:"-40";s:6:"Tcaron";s:3:"-40";s:12:"Tcommaaccent";s:3:"-40";s:1:"V";s:3:"-50";s:1:"W";s:3:"-30";s:1:"X";s:3:"-60";s:1:"Y";s:3:"-70";s:6:"Yacute";s:3:"-70";s:9:"Ydieresis";s:3:"-70";s:5:"comma";s:3:"-40";s:6:"period";s:3:"-40";}s:1:"P";a:40:{s:1:"A";s:4:"-120";s:6:"Aacute";s:4:"-120";s:6:"Abreve";s:4:"-120";s:11:"Acircumflex";s:4:"-120";s:9:"Adieresis";s:4:"-120";s:6:"Agrave";s:4:"-120";s:7:"Amacron";s:4:"-120";s:7:"Aogonek";s:4:"-120";s:5:"Aring";s:4:"-120";s:6:"Atilde";s:4:"-120";s:1:"a";s:3:"-40";s:6:"aacute";s:3:"-40";s:6:"abreve";s:3:"-40";s:11:"acircumflex";s:3:"-40";s:9:"adieresis";s:3:"-40";s:6:"agrave";s:3:"-40";s:7:"amacron";s:3:"-40";s:7:"aogonek";s:3:"-40";s:5:"aring";s:3:"-40";s:6:"atilde";s:3:"-40";s:5:"comma";s:4:"-180";s:1:"e";s:3:"-50";s:6:"eacute";s:3:"-50";s:6:"ecaron";s:3:"-50";s:11:"ecircumflex";s:3:"-50";s:9:"edieresis";s:3:"-50";s:10:"edotaccent";s:3:"-50";s:6:"egrave";s:3:"-50";s:7:"emacron";s:3:"-50";s:7:"eogonek";s:3:"-50";s:1:"o";s:3:"-50";s:6:"oacute";s:3:"-50";s:11:"ocircumflex";s:3:"-50";s:9:"odieresis";s:3:"-50";s:6:"ograve";s:3:"-50";s:13:"ohungarumlaut";s:3:"-50";s:7:"omacron";s:3:"-50";s:6:"oslash";s:3:"-50";s:6:"otilde";s:3:"-50";s:6:"period";s:4:"-180";}s:1:"Q";a:9:{s:1:"U";s:3:"-10";s:6:"Uacute";s:3:"-10";s:11:"Ucircumflex";s:3:"-10";s:9:"Udieresis";s:3:"-10";s:6:"Ugrave";s:3:"-10";s:13:"Uhungarumlaut";s:3:"-10";s:7:"Umacron";s:3:"-10";s:7:"Uogonek";s:3:"-10";s:5:"Uring";s:3:"-10";}s:1:"R";a:26:{s:1:"O";s:3:"-20";s:6:"Oacute";s:3:"-20";s:11:"Ocircumflex";s:3:"-20";s:9:"Odieresis";s:3:"-20";s:6:"Ograve";s:3:"-20";s:13:"Ohungarumlaut";s:3:"-20";s:7:"Omacron";s:3:"-20";s:6:"Oslash";s:3:"-20";s:6:"Otilde";s:3:"-20";s:1:"T";s:3:"-30";s:6:"Tcaron";s:3:"-30";s:12:"Tcommaaccent";s:3:"-30";s:1:"U";s:3:"-40";s:6:"Uacute";s:3:"-40";s:11:"Ucircumflex";s:3:"-40";s:9:"Udieresis";s:3:"-40";s:6:"Ugrave";s:3:"-40";s:13:"Uhungarumlaut";s:3:"-40";s:7:"Umacron";s:3:"-40";s:7:"Uogonek";s:3:"-40";s:5:"Uring";s:3:"-40";s:1:"V";s:3:"-50";s:1:"W";s:3:"-30";s:1:"Y";s:3:"-50";s:6:"Yacute";s:3:"-50";s:9:"Ydieresis";s:3:"-50";}s:6:"Racute";a:26:{s:1:"O";s:3:"-20";s:6:"Oacute";s:3:"-20";s:11:"Ocircumflex";s:3:"-20";s:9:"Odieresis";s:3:"-20";s:6:"Ograve";s:3:"-20";s:13:"Ohungarumlaut";s:3:"-20";s:7:"Omacron";s:3:"-20";s:6:"Oslash";s:3:"-20";s:6:"Otilde";s:3:"-20";s:1:"T";s:3:"-30";s:6:"Tcaron";s:3:"-30";s:12:"Tcommaaccent";s:3:"-30";s:1:"U";s:3:"-40";s:6:"Uacute";s:3:"-40";s:11:"Ucircumflex";s:3:"-40";s:9:"Udieresis";s:3:"-40";s:6:"Ugrave";s:3:"-40";s:13:"Uhungarumlaut";s:3:"-40";s:7:"Umacron";s:3:"-40";s:7:"Uogonek";s:3:"-40";s:5:"Uring";s:3:"-40";s:1:"V";s:3:"-50";s:1:"W";s:3:"-30";s:1:"Y";s:3:"-50";s:6:"Yacute";s:3:"-50";s:9:"Ydieresis";s:3:"-50";}s:6:"Rcaron";a:26:{s:1:"O";s:3:"-20";s:6:"Oacute";s:3:"-20";s:11:"Ocircumflex";s:3:"-20";s:9:"Odieresis";s:3:"-20";s:6:"Ograve";s:3:"-20";s:13:"Ohungarumlaut";s:3:"-20";s:7:"Omacron";s:3:"-20";s:6:"Oslash";s:3:"-20";s:6:"Otilde";s:3:"-20";s:1:"T";s:3:"-30";s:6:"Tcaron";s:3:"-30";s:12:"Tcommaaccent";s:3:"-30";s:1:"U";s:3:"-40";s:6:"Uacute";s:3:"-40";s:11:"Ucircumflex";s:3:"-40";s:9:"Udieresis";s:3:"-40";s:6:"Ugrave";s:3:"-40";s:13:"Uhungarumlaut";s:3:"-40";s:7:"Umacron";s:3:"-40";s:7:"Uogonek";s:3:"-40";s:5:"Uring";s:3:"-40";s:1:"V";s:3:"-50";s:1:"W";s:3:"-30";s:1:"Y";s:3:"-50";s:6:"Yacute";s:3:"-50";s:9:"Ydieresis";s:3:"-50";}s:12:"Rcommaaccent";a:26:{s:1:"O";s:3:"-20";s:6:"Oacute";s:3:"-20";s:11:"Ocircumflex";s:3:"-20";s:9:"Odieresis";s:3:"-20";s:6:"Ograve";s:3:"-20";s:13:"Ohungarumlaut";s:3:"-20";s:7:"Omacron";s:3:"-20";s:6:"Oslash";s:3:"-20";s:6:"Otilde";s:3:"-20";s:1:"T";s:3:"-30";s:6:"Tcaron";s:3:"-30";s:12:"Tcommaaccent";s:3:"-30";s:1:"U";s:3:"-40";s:6:"Uacute";s:3:"-40";s:11:"Ucircumflex";s:3:"-40";s:9:"Udieresis";s:3:"-40";s:6:"Ugrave";s:3:"-40";s:13:"Uhungarumlaut";s:3:"-40";s:7:"Umacron";s:3:"-40";s:7:"Uogonek";s:3:"-40";s:5:"Uring";s:3:"-40";s:1:"V";s:3:"-50";s:1:"W";s:3:"-30";s:1:"Y";s:3:"-50";s:6:"Yacute";s:3:"-50";s:9:"Ydieresis";s:3:"-50";}s:1:"S";a:2:{s:5:"comma";s:3:"-20";s:6:"period";s:3:"-20";}s:6:"Sacute";a:2:{s:5:"comma";s:3:"-20";s:6:"period";s:3:"-20";}s:6:"Scaron";a:2:{s:5:"comma";s:3:"-20";s:6:"period";s:3:"-20";}s:8:"Scedilla";a:2:{s:5:"comma";s:3:"-20";s:6:"period";s:3:"-20";}s:12:"Scommaaccent";a:2:{s:5:"comma";s:3:"-20";s:6:"period";s:3:"-20";}s:1:"T";a:69:{s:1:"A";s:4:"-120";s:6:"Aacute";s:4:"-120";s:6:"Abreve";s:4:"-120";s:11:"Acircumflex";s:4:"-120";s:9:"Adieresis";s:4:"-120";s:6:"Agrave";s:4:"-120";s:7:"Amacron";s:4:"-120";s:7:"Aogonek";s:4:"-120";s:5:"Aring";s:4:"-120";s:6:"Atilde";s:4:"-120";s:1:"O";s:3:"-40";s:6:"Oacute";s:3:"-40";s:11:"Ocircumflex";s:3:"-40";s:9:"Odieresis";s:3:"-40";s:6:"Ograve";s:3:"-40";s:13:"Ohungarumlaut";s:3:"-40";s:7:"Omacron";s:3:"-40";s:6:"Oslash";s:3:"-40";s:6:"Otilde";s:3:"-40";s:1:"a";s:4:"-120";s:6:"aacute";s:4:"-120";s:6:"abreve";s:3:"-60";s:11:"acircumflex";s:4:"-120";s:9:"adieresis";s:4:"-120";s:6:"agrave";s:4:"-120";s:7:"amacron";s:3:"-60";s:7:"aogonek";s:4:"-120";s:5:"aring";s:4:"-120";s:6:"atilde";s:3:"-60";s:5:"colon";s:3:"-20";s:5:"comma";s:4:"-120";s:1:"e";s:4:"-120";s:6:"eacute";s:4:"-120";s:6:"ecaron";s:4:"-120";s:11:"ecircumflex";s:4:"-120";s:9:"edieresis";s:4:"-120";s:10:"edotaccent";s:4:"-120";s:6:"egrave";s:3:"-60";s:7:"emacron";s:3:"-60";s:7:"eogonek";s:4:"-120";s:6:"hyphen";s:4:"-140";s:1:"o";s:4:"-120";s:6:"oacute";s:4:"-120";s:11:"ocircumflex";s:4:"-120";s:9:"odieresis";s:4:"-120";s:6:"ograve";s:4:"-120";s:13:"ohungarumlaut";s:4:"-120";s:7:"omacron";s:3:"-60";s:6:"oslash";s:4:"-120";s:6:"otilde";s:3:"-60";s:6:"period";s:4:"-120";s:1:"r";s:4:"-120";s:6:"racute";s:4:"-120";s:6:"rcaron";s:4:"-120";s:12:"rcommaaccent";s:4:"-120";s:9:"semicolon";s:3:"-20";s:1:"u";s:4:"-120";s:6:"uacute";s:4:"-120";s:11:"ucircumflex";s:4:"-120";s:9:"udieresis";s:4:"-120";s:6:"ugrave";s:4:"-120";s:13:"uhungarumlaut";s:4:"-120";s:7:"umacron";s:3:"-60";s:7:"uogonek";s:4:"-120";s:5:"uring";s:4:"-120";s:1:"w";s:4:"-120";s:1:"y";s:4:"-120";s:6:"yacute";s:4:"-120";s:9:"ydieresis";s:3:"-60";}s:6:"Tcaron";a:69:{s:1:"A";s:4:"-120";s:6:"Aacute";s:4:"-120";s:6:"Abreve";s:4:"-120";s:11:"Acircumflex";s:4:"-120";s:9:"Adieresis";s:4:"-120";s:6:"Agrave";s:4:"-120";s:7:"Amacron";s:4:"-120";s:7:"Aogonek";s:4:"-120";s:5:"Aring";s:4:"-120";s:6:"Atilde";s:4:"-120";s:1:"O";s:3:"-40";s:6:"Oacute";s:3:"-40";s:11:"Ocircumflex";s:3:"-40";s:9:"Odieresis";s:3:"-40";s:6:"Ograve";s:3:"-40";s:13:"Ohungarumlaut";s:3:"-40";s:7:"Omacron";s:3:"-40";s:6:"Oslash";s:3:"-40";s:6:"Otilde";s:3:"-40";s:1:"a";s:4:"-120";s:6:"aacute";s:4:"-120";s:6:"abreve";s:3:"-60";s:11:"acircumflex";s:4:"-120";s:9:"adieresis";s:4:"-120";s:6:"agrave";s:4:"-120";s:7:"amacron";s:3:"-60";s:7:"aogonek";s:4:"-120";s:5:"aring";s:4:"-120";s:6:"atilde";s:3:"-60";s:5:"colon";s:3:"-20";s:5:"comma";s:4:"-120";s:1:"e";s:4:"-120";s:6:"eacute";s:4:"-120";s:6:"ecaron";s:4:"-120";s:11:"ecircumflex";s:4:"-120";s:9:"edieresis";s:4:"-120";s:10:"edotaccent";s:4:"-120";s:6:"egrave";s:3:"-60";s:7:"emacron";s:3:"-60";s:7:"eogonek";s:4:"-120";s:6:"hyphen";s:4:"-140";s:1:"o";s:4:"-120";s:6:"oacute";s:4:"-120";s:11:"ocircumflex";s:4:"-120";s:9:"odieresis";s:4:"-120";s:6:"ograve";s:4:"-120";s:13:"ohungarumlaut";s:4:"-120";s:7:"omacron";s:3:"-60";s:6:"oslash";s:4:"-120";s:6:"otilde";s:3:"-60";s:6:"period";s:4:"-120";s:1:"r";s:4:"-120";s:6:"racute";s:4:"-120";s:6:"rcaron";s:4:"-120";s:12:"rcommaaccent";s:4:"-120";s:9:"semicolon";s:3:"-20";s:1:"u";s:4:"-120";s:6:"uacute";s:4:"-120";s:11:"ucircumflex";s:4:"-120";s:9:"udieresis";s:4:"-120";s:6:"ugrave";s:4:"-120";s:13:"uhungarumlaut";s:4:"-120";s:7:"umacron";s:3:"-60";s:7:"uogonek";s:4:"-120";s:5:"uring";s:4:"-120";s:1:"w";s:4:"-120";s:1:"y";s:4:"-120";s:6:"yacute";s:4:"-120";s:9:"ydieresis";s:3:"-60";}s:12:"Tcommaaccent";a:69:{s:1:"A";s:4:"-120";s:6:"Aacute";s:4:"-120";s:6:"Abreve";s:4:"-120";s:11:"Acircumflex";s:4:"-120";s:9:"Adieresis";s:4:"-120";s:6:"Agrave";s:4:"-120";s:7:"Amacron";s:4:"-120";s:7:"Aogonek";s:4:"-120";s:5:"Aring";s:4:"-120";s:6:"Atilde";s:4:"-120";s:1:"O";s:3:"-40";s:6:"Oacute";s:3:"-40";s:11:"Ocircumflex";s:3:"-40";s:9:"Odieresis";s:3:"-40";s:6:"Ograve";s:3:"-40";s:13:"Ohungarumlaut";s:3:"-40";s:7:"Omacron";s:3:"-40";s:6:"Oslash";s:3:"-40";s:6:"Otilde";s:3:"-40";s:1:"a";s:4:"-120";s:6:"aacute";s:4:"-120";s:6:"abreve";s:3:"-60";s:11:"acircumflex";s:4:"-120";s:9:"adieresis";s:4:"-120";s:6:"agrave";s:4:"-120";s:7:"amacron";s:3:"-60";s:7:"aogonek";s:4:"-120";s:5:"aring";s:4:"-120";s:6:"atilde";s:3:"-60";s:5:"colon";s:3:"-20";s:5:"comma";s:4:"-120";s:1:"e";s:4:"-120";s:6:"eacute";s:4:"-120";s:6:"ecaron";s:4:"-120";s:11:"ecircumflex";s:4:"-120";s:9:"edieresis";s:4:"-120";s:10:"edotaccent";s:4:"-120";s:6:"egrave";s:3:"-60";s:7:"emacron";s:3:"-60";s:7:"eogonek";s:4:"-120";s:6:"hyphen";s:4:"-140";s:1:"o";s:4:"-120";s:6:"oacute";s:4:"-120";s:11:"ocircumflex";s:4:"-120";s:9:"odieresis";s:4:"-120";s:6:"ograve";s:4:"-120";s:13:"ohungarumlaut";s:4:"-120";s:7:"omacron";s:3:"-60";s:6:"oslash";s:4:"-120";s:6:"otilde";s:3:"-60";s:6:"period";s:4:"-120";s:1:"r";s:4:"-120";s:6:"racute";s:4:"-120";s:6:"rcaron";s:4:"-120";s:12:"rcommaaccent";s:4:"-120";s:9:"semicolon";s:3:"-20";s:1:"u";s:4:"-120";s:6:"uacute";s:4:"-120";s:11:"ucircumflex";s:4:"-120";s:9:"udieresis";s:4:"-120";s:6:"ugrave";s:4:"-120";s:13:"uhungarumlaut";s:4:"-120";s:7:"umacron";s:3:"-60";s:7:"uogonek";s:4:"-120";s:5:"uring";s:4:"-120";s:1:"w";s:4:"-120";s:1:"y";s:4:"-120";s:6:"yacute";s:4:"-120";s:9:"ydieresis";s:3:"-60";}s:1:"U";a:12:{s:1:"A";s:3:"-40";s:6:"Aacute";s:3:"-40";s:6:"Abreve";s:3:"-40";s:11:"Acircumflex";s:3:"-40";s:9:"Adieresis";s:3:"-40";s:6:"Agrave";s:3:"-40";s:7:"Amacron";s:3:"-40";s:7:"Aogonek";s:3:"-40";s:5:"Aring";s:3:"-40";s:6:"Atilde";s:3:"-40";s:5:"comma";s:3:"-40";s:6:"period";s:3:"-40";}s:6:"Uacute";a:12:{s:1:"A";s:3:"-40";s:6:"Aacute";s:3:"-40";s:6:"Abreve";s:3:"-40";s:11:"Acircumflex";s:3:"-40";s:9:"Adieresis";s:3:"-40";s:6:"Agrave";s:3:"-40";s:7:"Amacron";s:3:"-40";s:7:"Aogonek";s:3:"-40";s:5:"Aring";s:3:"-40";s:6:"Atilde";s:3:"-40";s:5:"comma";s:3:"-40";s:6:"period";s:3:"-40";}s:11:"Ucircumflex";a:12:{s:1:"A";s:3:"-40";s:6:"Aacute";s:3:"-40";s:6:"Abreve";s:3:"-40";s:11:"Acircumflex";s:3:"-40";s:9:"Adieresis";s:3:"-40";s:6:"Agrave";s:3:"-40";s:7:"Amacron";s:3:"-40";s:7:"Aogonek";s:3:"-40";s:5:"Aring";s:3:"-40";s:6:"Atilde";s:3:"-40";s:5:"comma";s:3:"-40";s:6:"period";s:3:"-40";}s:9:"Udieresis";a:12:{s:1:"A";s:3:"-40";s:6:"Aacute";s:3:"-40";s:6:"Abreve";s:3:"-40";s:11:"Acircumflex";s:3:"-40";s:9:"Adieresis";s:3:"-40";s:6:"Agrave";s:3:"-40";s:7:"Amacron";s:3:"-40";s:7:"Aogonek";s:3:"-40";s:5:"Aring";s:3:"-40";s:6:"Atilde";s:3:"-40";s:5:"comma";s:3:"-40";s:6:"period";s:3:"-40";}s:6:"Ugrave";a:12:{s:1:"A";s:3:"-40";s:6:"Aacute";s:3:"-40";s:6:"Abreve";s:3:"-40";s:11:"Acircumflex";s:3:"-40";s:9:"Adieresis";s:3:"-40";s:6:"Agrave";s:3:"-40";s:7:"Amacron";s:3:"-40";s:7:"Aogonek";s:3:"-40";s:5:"Aring";s:3:"-40";s:6:"Atilde";s:3:"-40";s:5:"comma";s:3:"-40";s:6:"period";s:3:"-40";}s:13:"Uhungarumlaut";a:12:{s:1:"A";s:3:"-40";s:6:"Aacute";s:3:"-40";s:6:"Abreve";s:3:"-40";s:11:"Acircumflex";s:3:"-40";s:9:"Adieresis";s:3:"-40";s:6:"Agrave";s:3:"-40";s:7:"Amacron";s:3:"-40";s:7:"Aogonek";s:3:"-40";s:5:"Aring";s:3:"-40";s:6:"Atilde";s:3:"-40";s:5:"comma";s:3:"-40";s:6:"period";s:3:"-40";}s:7:"Umacron";a:12:{s:1:"A";s:3:"-40";s:6:"Aacute";s:3:"-40";s:6:"Abreve";s:3:"-40";s:11:"Acircumflex";s:3:"-40";s:9:"Adieresis";s:3:"-40";s:6:"Agrave";s:3:"-40";s:7:"Amacron";s:3:"-40";s:7:"Aogonek";s:3:"-40";s:5:"Aring";s:3:"-40";s:6:"Atilde";s:3:"-40";s:5:"comma";s:3:"-40";s:6:"period";s:3:"-40";}s:7:"Uogonek";a:12:{s:1:"A";s:3:"-40";s:6:"Aacute";s:3:"-40";s:6:"Abreve";s:3:"-40";s:11:"Acircumflex";s:3:"-40";s:9:"Adieresis";s:3:"-40";s:6:"Agrave";s:3:"-40";s:7:"Amacron";s:3:"-40";s:7:"Aogonek";s:3:"-40";s:5:"Aring";s:3:"-40";s:6:"Atilde";s:3:"-40";s:5:"comma";s:3:"-40";s:6:"period";s:3:"-40";}s:5:"Uring";a:12:{s:1:"A";s:3:"-40";s:6:"Aacute";s:3:"-40";s:6:"Abreve";s:3:"-40";s:11:"Acircumflex";s:3:"-40";s:9:"Adieresis";s:3:"-40";s:6:"Agrave";s:3:"-40";s:7:"Amacron";s:3:"-40";s:7:"Aogonek";s:3:"-40";s:5:"Aring";s:3:"-40";s:6:"Atilde";s:3:"-40";s:5:"comma";s:3:"-40";s:6:"period";s:3:"-40";}s:1:"V";a:64:{s:1:"A";s:3:"-80";s:6:"Aacute";s:3:"-80";s:6:"Abreve";s:3:"-80";s:11:"Acircumflex";s:3:"-80";s:9:"Adieresis";s:3:"-80";s:6:"Agrave";s:3:"-80";s:7:"Amacron";s:3:"-80";s:7:"Aogonek";s:3:"-80";s:5:"Aring";s:3:"-80";s:6:"Atilde";s:3:"-80";s:1:"G";s:3:"-40";s:6:"Gbreve";s:3:"-40";s:12:"Gcommaaccent";s:3:"-40";s:1:"O";s:3:"-40";s:6:"Oacute";s:3:"-40";s:11:"Ocircumflex";s:3:"-40";s:9:"Odieresis";s:3:"-40";s:6:"Ograve";s:3:"-40";s:13:"Ohungarumlaut";s:3:"-40";s:7:"Omacron";s:3:"-40";s:6:"Oslash";s:3:"-40";s:6:"Otilde";s:3:"-40";s:1:"a";s:3:"-70";s:6:"aacute";s:3:"-70";s:6:"abreve";s:3:"-70";s:11:"acircumflex";s:3:"-70";s:9:"adieresis";s:3:"-70";s:6:"agrave";s:3:"-70";s:7:"amacron";s:3:"-70";s:7:"aogonek";s:3:"-70";s:5:"aring";s:3:"-70";s:6:"atilde";s:3:"-70";s:5:"colon";s:3:"-40";s:5:"comma";s:4:"-125";s:1:"e";s:3:"-80";s:6:"eacute";s:3:"-80";s:6:"ecaron";s:3:"-80";s:11:"ecircumflex";s:3:"-80";s:9:"edieresis";s:3:"-80";s:10:"edotaccent";s:3:"-80";s:6:"egrave";s:3:"-80";s:7:"emacron";s:3:"-80";s:7:"eogonek";s:3:"-80";s:6:"hyphen";s:3:"-80";s:1:"o";s:3:"-80";s:6:"oacute";s:3:"-80";s:11:"ocircumflex";s:3:"-80";s:9:"odieresis";s:3:"-80";s:6:"ograve";s:3:"-80";s:13:"ohungarumlaut";s:3:"-80";s:7:"omacron";s:3:"-80";s:6:"oslash";s:3:"-80";s:6:"otilde";s:3:"-80";s:6:"period";s:4:"-125";s:9:"semicolon";s:3:"-40";s:1:"u";s:3:"-70";s:6:"uacute";s:3:"-70";s:11:"ucircumflex";s:3:"-70";s:9:"udieresis";s:3:"-70";s:6:"ugrave";s:3:"-70";s:13:"uhungarumlaut";s:3:"-70";s:7:"umacron";s:3:"-70";s:7:"uogonek";s:3:"-70";s:5:"uring";s:3:"-70";}s:1:"W";a:62:{s:1:"A";s:3:"-50";s:6:"Aacute";s:3:"-50";s:6:"Abreve";s:3:"-50";s:11:"Acircumflex";s:3:"-50";s:9:"Adieresis";s:3:"-50";s:6:"Agrave";s:3:"-50";s:7:"Amacron";s:3:"-50";s:7:"Aogonek";s:3:"-50";s:5:"Aring";s:3:"-50";s:6:"Atilde";s:3:"-50";s:1:"O";s:3:"-20";s:6:"Oacute";s:3:"-20";s:11:"Ocircumflex";s:3:"-20";s:9:"Odieresis";s:3:"-20";s:6:"Ograve";s:3:"-20";s:13:"Ohungarumlaut";s:3:"-20";s:7:"Omacron";s:3:"-20";s:6:"Oslash";s:3:"-20";s:6:"Otilde";s:3:"-20";s:1:"a";s:3:"-40";s:6:"aacute";s:3:"-40";s:6:"abreve";s:3:"-40";s:11:"acircumflex";s:3:"-40";s:9:"adieresis";s:3:"-40";s:6:"agrave";s:3:"-40";s:7:"amacron";s:3:"-40";s:7:"aogonek";s:3:"-40";s:5:"aring";s:3:"-40";s:6:"atilde";s:3:"-40";s:5:"comma";s:3:"-80";s:1:"e";s:3:"-30";s:6:"eacute";s:3:"-30";s:6:"ecaron";s:3:"-30";s:11:"ecircumflex";s:3:"-30";s:9:"edieresis";s:3:"-30";s:10:"edotaccent";s:3:"-30";s:6:"egrave";s:3:"-30";s:7:"emacron";s:3:"-30";s:7:"eogonek";s:3:"-30";s:6:"hyphen";s:3:"-40";s:1:"o";s:3:"-30";s:6:"oacute";s:3:"-30";s:11:"ocircumflex";s:3:"-30";s:9:"odieresis";s:3:"-30";s:6:"ograve";s:3:"-30";s:13:"ohungarumlaut";s:3:"-30";s:7:"omacron";s:3:"-30";s:6:"oslash";s:3:"-30";s:6:"otilde";s:3:"-30";s:6:"period";s:3:"-80";s:1:"u";s:3:"-30";s:6:"uacute";s:3:"-30";s:11:"ucircumflex";s:3:"-30";s:9:"udieresis";s:3:"-30";s:6:"ugrave";s:3:"-30";s:13:"uhungarumlaut";s:3:"-30";s:7:"umacron";s:3:"-30";s:7:"uogonek";s:3:"-30";s:5:"uring";s:3:"-30";s:1:"y";s:3:"-20";s:6:"yacute";s:3:"-20";s:9:"ydieresis";s:3:"-20";}s:1:"Y";a:64:{s:1:"A";s:4:"-110";s:6:"Aacute";s:4:"-110";s:6:"Abreve";s:4:"-110";s:11:"Acircumflex";s:4:"-110";s:9:"Adieresis";s:4:"-110";s:6:"Agrave";s:4:"-110";s:7:"Amacron";s:4:"-110";s:7:"Aogonek";s:4:"-110";s:5:"Aring";s:4:"-110";s:6:"Atilde";s:4:"-110";s:1:"O";s:3:"-85";s:6:"Oacute";s:3:"-85";s:11:"Ocircumflex";s:3:"-85";s:9:"Odieresis";s:3:"-85";s:6:"Ograve";s:3:"-85";s:13:"Ohungarumlaut";s:3:"-85";s:7:"Omacron";s:3:"-85";s:6:"Oslash";s:3:"-85";s:6:"Otilde";s:3:"-85";s:1:"a";s:4:"-140";s:6:"aacute";s:4:"-140";s:6:"abreve";s:3:"-70";s:11:"acircumflex";s:4:"-140";s:9:"adieresis";s:4:"-140";s:6:"agrave";s:4:"-140";s:7:"amacron";s:3:"-70";s:7:"aogonek";s:4:"-140";s:5:"aring";s:4:"-140";s:6:"atilde";s:4:"-140";s:5:"colon";s:3:"-60";s:5:"comma";s:4:"-140";s:1:"e";s:4:"-140";s:6:"eacute";s:4:"-140";s:6:"ecaron";s:4:"-140";s:11:"ecircumflex";s:4:"-140";s:9:"edieresis";s:4:"-140";s:10:"edotaccent";s:4:"-140";s:6:"egrave";s:4:"-140";s:7:"emacron";s:3:"-70";s:7:"eogonek";s:4:"-140";s:6:"hyphen";s:4:"-140";s:1:"i";s:3:"-20";s:6:"iacute";s:3:"-20";s:7:"iogonek";s:3:"-20";s:1:"o";s:4:"-140";s:6:"oacute";s:4:"-140";s:11:"ocircumflex";s:4:"-140";s:9:"odieresis";s:4:"-140";s:6:"ograve";s:4:"-140";s:13:"ohungarumlaut";s:4:"-140";s:7:"omacron";s:4:"-140";s:6:"oslash";s:4:"-140";s:6:"otilde";s:4:"-140";s:6:"period";s:4:"-140";s:9:"semicolon";s:3:"-60";s:1:"u";s:4:"-110";s:6:"uacute";s:4:"-110";s:11:"ucircumflex";s:4:"-110";s:9:"udieresis";s:4:"-110";s:6:"ugrave";s:4:"-110";s:13:"uhungarumlaut";s:4:"-110";s:7:"umacron";s:4:"-110";s:7:"uogonek";s:4:"-110";s:5:"uring";s:4:"-110";}s:6:"Yacute";a:64:{s:1:"A";s:4:"-110";s:6:"Aacute";s:4:"-110";s:6:"Abreve";s:4:"-110";s:11:"Acircumflex";s:4:"-110";s:9:"Adieresis";s:4:"-110";s:6:"Agrave";s:4:"-110";s:7:"Amacron";s:4:"-110";s:7:"Aogonek";s:4:"-110";s:5:"Aring";s:4:"-110";s:6:"Atilde";s:4:"-110";s:1:"O";s:3:"-85";s:6:"Oacute";s:3:"-85";s:11:"Ocircumflex";s:3:"-85";s:9:"Odieresis";s:3:"-85";s:6:"Ograve";s:3:"-85";s:13:"Ohungarumlaut";s:3:"-85";s:7:"Omacron";s:3:"-85";s:6:"Oslash";s:3:"-85";s:6:"Otilde";s:3:"-85";s:1:"a";s:4:"-140";s:6:"aacute";s:4:"-140";s:6:"abreve";s:3:"-70";s:11:"acircumflex";s:4:"-140";s:9:"adieresis";s:4:"-140";s:6:"agrave";s:4:"-140";s:7:"amacron";s:3:"-70";s:7:"aogonek";s:4:"-140";s:5:"aring";s:4:"-140";s:6:"atilde";s:3:"-70";s:5:"colon";s:3:"-60";s:5:"comma";s:4:"-140";s:1:"e";s:4:"-140";s:6:"eacute";s:4:"-140";s:6:"ecaron";s:4:"-140";s:11:"ecircumflex";s:4:"-140";s:9:"edieresis";s:4:"-140";s:10:"edotaccent";s:4:"-140";s:6:"egrave";s:4:"-140";s:7:"emacron";s:3:"-70";s:7:"eogonek";s:4:"-140";s:6:"hyphen";s:4:"-140";s:1:"i";s:3:"-20";s:6:"iacute";s:3:"-20";s:7:"iogonek";s:3:"-20";s:1:"o";s:4:"-140";s:6:"oacute";s:4:"-140";s:11:"ocircumflex";s:4:"-140";s:9:"odieresis";s:4:"-140";s:6:"ograve";s:4:"-140";s:13:"ohungarumlaut";s:4:"-140";s:7:"omacron";s:3:"-70";s:6:"oslash";s:4:"-140";s:6:"otilde";s:4:"-140";s:6:"period";s:4:"-140";s:9:"semicolon";s:3:"-60";s:1:"u";s:4:"-110";s:6:"uacute";s:4:"-110";s:11:"ucircumflex";s:4:"-110";s:9:"udieresis";s:4:"-110";s:6:"ugrave";s:4:"-110";s:13:"uhungarumlaut";s:4:"-110";s:7:"umacron";s:4:"-110";s:7:"uogonek";s:4:"-110";s:5:"uring";s:4:"-110";}s:9:"Ydieresis";a:64:{s:1:"A";s:4:"-110";s:6:"Aacute";s:4:"-110";s:6:"Abreve";s:4:"-110";s:11:"Acircumflex";s:4:"-110";s:9:"Adieresis";s:4:"-110";s:6:"Agrave";s:4:"-110";s:7:"Amacron";s:4:"-110";s:7:"Aogonek";s:4:"-110";s:5:"Aring";s:4:"-110";s:6:"Atilde";s:4:"-110";s:1:"O";s:3:"-85";s:6:"Oacute";s:3:"-85";s:11:"Ocircumflex";s:3:"-85";s:9:"Odieresis";s:3:"-85";s:6:"Ograve";s:3:"-85";s:13:"Ohungarumlaut";s:3:"-85";s:7:"Omacron";s:3:"-85";s:6:"Oslash";s:3:"-85";s:6:"Otilde";s:3:"-85";s:1:"a";s:4:"-140";s:6:"aacute";s:4:"-140";s:6:"abreve";s:3:"-70";s:11:"acircumflex";s:4:"-140";s:9:"adieresis";s:4:"-140";s:6:"agrave";s:4:"-140";s:7:"amacron";s:3:"-70";s:7:"aogonek";s:4:"-140";s:5:"aring";s:4:"-140";s:6:"atilde";s:3:"-70";s:5:"colon";s:3:"-60";s:5:"comma";s:4:"-140";s:1:"e";s:4:"-140";s:6:"eacute";s:4:"-140";s:6:"ecaron";s:4:"-140";s:11:"ecircumflex";s:4:"-140";s:9:"edieresis";s:4:"-140";s:10:"edotaccent";s:4:"-140";s:6:"egrave";s:4:"-140";s:7:"emacron";s:3:"-70";s:7:"eogonek";s:4:"-140";s:6:"hyphen";s:4:"-140";s:1:"i";s:3:"-20";s:6:"iacute";s:3:"-20";s:7:"iogonek";s:3:"-20";s:1:"o";s:4:"-140";s:6:"oacute";s:4:"-140";s:11:"ocircumflex";s:4:"-140";s:9:"odieresis";s:4:"-140";s:6:"ograve";s:4:"-140";s:13:"ohungarumlaut";s:4:"-140";s:7:"omacron";s:4:"-140";s:6:"oslash";s:4:"-140";s:6:"otilde";s:4:"-140";s:6:"period";s:4:"-140";s:9:"semicolon";s:3:"-60";s:1:"u";s:4:"-110";s:6:"uacute";s:4:"-110";s:11:"ucircumflex";s:4:"-110";s:9:"udieresis";s:4:"-110";s:6:"ugrave";s:4:"-110";s:13:"uhungarumlaut";s:4:"-110";s:7:"umacron";s:4:"-110";s:7:"uogonek";s:4:"-110";s:5:"uring";s:4:"-110";}s:1:"a";a:5:{s:1:"v";s:3:"-20";s:1:"w";s:3:"-20";s:1:"y";s:3:"-30";s:6:"yacute";s:3:"-30";s:9:"ydieresis";s:3:"-30";}s:6:"aacute";a:5:{s:1:"v";s:3:"-20";s:1:"w";s:3:"-20";s:1:"y";s:3:"-30";s:6:"yacute";s:3:"-30";s:9:"ydieresis";s:3:"-30";}s:6:"abreve";a:5:{s:1:"v";s:3:"-20";s:1:"w";s:3:"-20";s:1:"y";s:3:"-30";s:6:"yacute";s:3:"-30";s:9:"ydieresis";s:3:"-30";}s:11:"acircumflex";a:5:{s:1:"v";s:3:"-20";s:1:"w";s:3:"-20";s:1:"y";s:3:"-30";s:6:"yacute";s:3:"-30";s:9:"ydieresis";s:3:"-30";}s:9:"adieresis";a:5:{s:1:"v";s:3:"-20";s:1:"w";s:3:"-20";s:1:"y";s:3:"-30";s:6:"yacute";s:3:"-30";s:9:"ydieresis";s:3:"-30";}s:6:"agrave";a:5:{s:1:"v";s:3:"-20";s:1:"w";s:3:"-20";s:1:"y";s:3:"-30";s:6:"yacute";s:3:"-30";s:9:"ydieresis";s:3:"-30";}s:7:"amacron";a:5:{s:1:"v";s:3:"-20";s:1:"w";s:3:"-20";s:1:"y";s:3:"-30";s:6:"yacute";s:3:"-30";s:9:"ydieresis";s:3:"-30";}s:7:"aogonek";a:5:{s:1:"v";s:3:"-20";s:1:"w";s:3:"-20";s:1:"y";s:3:"-30";s:6:"yacute";s:3:"-30";s:9:"ydieresis";s:3:"-30";}s:5:"aring";a:5:{s:1:"v";s:3:"-20";s:1:"w";s:3:"-20";s:1:"y";s:3:"-30";s:6:"yacute";s:3:"-30";s:9:"ydieresis";s:3:"-30";}s:6:"atilde";a:5:{s:1:"v";s:3:"-20";s:1:"w";s:3:"-20";s:1:"y";s:3:"-30";s:6:"yacute";s:3:"-30";s:9:"ydieresis";s:3:"-30";}s:1:"b";a:20:{s:1:"b";s:3:"-10";s:5:"comma";s:3:"-40";s:1:"l";s:3:"-20";s:6:"lacute";s:3:"-20";s:12:"lcommaaccent";s:3:"-20";s:6:"lslash";s:3:"-20";s:6:"period";s:3:"-40";s:1:"u";s:3:"-20";s:6:"uacute";s:3:"-20";s:11:"ucircumflex";s:3:"-20";s:9:"udieresis";s:3:"-20";s:6:"ugrave";s:3:"-20";s:13:"uhungarumlaut";s:3:"-20";s:7:"umacron";s:3:"-20";s:7:"uogonek";s:3:"-20";s:5:"uring";s:3:"-20";s:1:"v";s:3:"-20";s:1:"y";s:3:"-20";s:6:"yacute";s:3:"-20";s:9:"ydieresis";s:3:"-20";}s:1:"c";a:3:{s:5:"comma";s:3:"-15";s:1:"k";s:3:"-20";s:12:"kcommaaccent";s:3:"-20";}s:6:"cacute";a:3:{s:5:"comma";s:3:"-15";s:1:"k";s:3:"-20";s:12:"kcommaaccent";s:3:"-20";}s:6:"ccaron";a:3:{s:5:"comma";s:3:"-15";s:1:"k";s:3:"-20";s:12:"kcommaaccent";s:3:"-20";}s:8:"ccedilla";a:3:{s:5:"comma";s:3:"-15";s:1:"k";s:3:"-20";s:12:"kcommaaccent";s:3:"-20";}s:5:"colon";a:1:{s:5:"space";s:3:"-50";}s:5:"comma";a:2:{s:13:"quotedblright";s:4:"-100";s:10:"quoteright";s:4:"-100";}s:1:"e";a:8:{s:5:"comma";s:3:"-15";s:6:"period";s:3:"-15";s:1:"v";s:3:"-30";s:1:"w";s:3:"-20";s:1:"x";s:3:"-30";s:1:"y";s:3:"-20";s:6:"yacute";s:3:"-20";s:9:"ydieresis";s:3:"-20";}s:6:"eacute";a:8:{s:5:"comma";s:3:"-15";s:6:"period";s:3:"-15";s:1:"v";s:3:"-30";s:1:"w";s:3:"-20";s:1:"x";s:3:"-30";s:1:"y";s:3:"-20";s:6:"yacute";s:3:"-20";s:9:"ydieresis";s:3:"-20";}s:6:"ecaron";a:8:{s:5:"comma";s:3:"-15";s:6:"period";s:3:"-15";s:1:"v";s:3:"-30";s:1:"w";s:3:"-20";s:1:"x";s:3:"-30";s:1:"y";s:3:"-20";s:6:"yacute";s:3:"-20";s:9:"ydieresis";s:3:"-20";}s:11:"ecircumflex";a:8:{s:5:"comma";s:3:"-15";s:6:"period";s:3:"-15";s:1:"v";s:3:"-30";s:1:"w";s:3:"-20";s:1:"x";s:3:"-30";s:1:"y";s:3:"-20";s:6:"yacute";s:3:"-20";s:9:"ydieresis";s:3:"-20";}s:9:"edieresis";a:8:{s:5:"comma";s:3:"-15";s:6:"period";s:3:"-15";s:1:"v";s:3:"-30";s:1:"w";s:3:"-20";s:1:"x";s:3:"-30";s:1:"y";s:3:"-20";s:6:"yacute";s:3:"-20";s:9:"ydieresis";s:3:"-20";}s:10:"edotaccent";a:8:{s:5:"comma";s:3:"-15";s:6:"period";s:3:"-15";s:1:"v";s:3:"-30";s:1:"w";s:3:"-20";s:1:"x";s:3:"-30";s:1:"y";s:3:"-20";s:6:"yacute";s:3:"-20";s:9:"ydieresis";s:3:"-20";}s:6:"egrave";a:8:{s:5:"comma";s:3:"-15";s:6:"period";s:3:"-15";s:1:"v";s:3:"-30";s:1:"w";s:3:"-20";s:1:"x";s:3:"-30";s:1:"y";s:3:"-20";s:6:"yacute";s:3:"-20";s:9:"ydieresis";s:3:"-20";}s:7:"emacron";a:8:{s:5:"comma";s:3:"-15";s:6:"period";s:3:"-15";s:1:"v";s:3:"-30";s:1:"w";s:3:"-20";s:1:"x";s:3:"-30";s:1:"y";s:3:"-20";s:6:"yacute";s:3:"-20";s:9:"ydieresis";s:3:"-20";}s:7:"eogonek";a:8:{s:5:"comma";s:3:"-15";s:6:"period";s:3:"-15";s:1:"v";s:3:"-30";s:1:"w";s:3:"-20";s:1:"x";s:3:"-30";s:1:"y";s:3:"-20";s:6:"yacute";s:3:"-20";s:9:"ydieresis";s:3:"-20";}s:1:"f";a:33:{s:1:"a";s:3:"-30";s:6:"aacute";s:3:"-30";s:6:"abreve";s:3:"-30";s:11:"acircumflex";s:3:"-30";s:9:"adieresis";s:3:"-30";s:6:"agrave";s:3:"-30";s:7:"amacron";s:3:"-30";s:7:"aogonek";s:3:"-30";s:5:"aring";s:3:"-30";s:6:"atilde";s:3:"-30";s:5:"comma";s:3:"-30";s:8:"dotlessi";s:3:"-28";s:1:"e";s:3:"-30";s:6:"eacute";s:3:"-30";s:6:"ecaron";s:3:"-30";s:11:"ecircumflex";s:3:"-30";s:9:"edieresis";s:3:"-30";s:10:"edotaccent";s:3:"-30";s:6:"egrave";s:3:"-30";s:7:"emacron";s:3:"-30";s:7:"eogonek";s:3:"-30";s:1:"o";s:3:"-30";s:6:"oacute";s:3:"-30";s:11:"ocircumflex";s:3:"-30";s:9:"odieresis";s:3:"-30";s:6:"ograve";s:3:"-30";s:13:"ohungarumlaut";s:3:"-30";s:7:"omacron";s:3:"-30";s:6:"oslash";s:3:"-30";s:6:"otilde";s:3:"-30";s:6:"period";s:3:"-30";s:13:"quotedblright";s:2:"60";s:10:"quoteright";s:2:"50";}s:1:"g";a:4:{s:1:"r";s:3:"-10";s:6:"racute";s:3:"-10";s:6:"rcaron";s:3:"-10";s:12:"rcommaaccent";s:3:"-10";}s:6:"gbreve";a:4:{s:1:"r";s:3:"-10";s:6:"racute";s:3:"-10";s:6:"rcaron";s:3:"-10";s:12:"rcommaaccent";s:3:"-10";}s:12:"gcommaaccent";a:4:{s:1:"r";s:3:"-10";s:6:"racute";s:3:"-10";s:6:"rcaron";s:3:"-10";s:12:"rcommaaccent";s:3:"-10";}s:1:"h";a:3:{s:1:"y";s:3:"-30";s:6:"yacute";s:3:"-30";s:9:"ydieresis";s:3:"-30";}s:1:"k";a:18:{s:1:"e";s:3:"-20";s:6:"eacute";s:3:"-20";s:6:"ecaron";s:3:"-20";s:11:"ecircumflex";s:3:"-20";s:9:"edieresis";s:3:"-20";s:10:"edotaccent";s:3:"-20";s:6:"egrave";s:3:"-20";s:7:"emacron";s:3:"-20";s:7:"eogonek";s:3:"-20";s:1:"o";s:3:"-20";s:6:"oacute";s:3:"-20";s:11:"ocircumflex";s:3:"-20";s:9:"odieresis";s:3:"-20";s:6:"ograve";s:3:"-20";s:13:"ohungarumlaut";s:3:"-20";s:7:"omacron";s:3:"-20";s:6:"oslash";s:3:"-20";s:6:"otilde";s:3:"-20";}s:12:"kcommaaccent";a:18:{s:1:"e";s:3:"-20";s:6:"eacute";s:3:"-20";s:6:"ecaron";s:3:"-20";s:11:"ecircumflex";s:3:"-20";s:9:"edieresis";s:3:"-20";s:10:"edotaccent";s:3:"-20";s:6:"egrave";s:3:"-20";s:7:"emacron";s:3:"-20";s:7:"eogonek";s:3:"-20";s:1:"o";s:3:"-20";s:6:"oacute";s:3:"-20";s:11:"ocircumflex";s:3:"-20";s:9:"odieresis";s:3:"-20";s:6:"ograve";s:3:"-20";s:13:"ohungarumlaut";s:3:"-20";s:7:"omacron";s:3:"-20";s:6:"oslash";s:3:"-20";s:6:"otilde";s:3:"-20";}s:1:"m";a:12:{s:1:"u";s:3:"-10";s:6:"uacute";s:3:"-10";s:11:"ucircumflex";s:3:"-10";s:9:"udieresis";s:3:"-10";s:6:"ugrave";s:3:"-10";s:13:"uhungarumlaut";s:3:"-10";s:7:"umacron";s:3:"-10";s:7:"uogonek";s:3:"-10";s:5:"uring";s:3:"-10";s:1:"y";s:3:"-15";s:6:"yacute";s:3:"-15";s:9:"ydieresis";s:3:"-15";}s:1:"n";a:13:{s:1:"u";s:3:"-10";s:6:"uacute";s:3:"-10";s:11:"ucircumflex";s:3:"-10";s:9:"udieresis";s:3:"-10";s:6:"ugrave";s:3:"-10";s:13:"uhungarumlaut";s:3:"-10";s:7:"umacron";s:3:"-10";s:7:"uogonek";s:3:"-10";s:5:"uring";s:3:"-10";s:1:"v";s:3:"-20";s:1:"y";s:3:"-15";s:6:"yacute";s:3:"-15";s:9:"ydieresis";s:3:"-15";}s:6:"nacute";a:13:{s:1:"u";s:3:"-10";s:6:"uacute";s:3:"-10";s:11:"ucircumflex";s:3:"-10";s:9:"udieresis";s:3:"-10";s:6:"ugrave";s:3:"-10";s:13:"uhungarumlaut";s:3:"-10";s:7:"umacron";s:3:"-10";s:7:"uogonek";s:3:"-10";s:5:"uring";s:3:"-10";s:1:"v";s:3:"-20";s:1:"y";s:3:"-15";s:6:"yacute";s:3:"-15";s:9:"ydieresis";s:3:"-15";}s:6:"ncaron";a:13:{s:1:"u";s:3:"-10";s:6:"uacute";s:3:"-10";s:11:"ucircumflex";s:3:"-10";s:9:"udieresis";s:3:"-10";s:6:"ugrave";s:3:"-10";s:13:"uhungarumlaut";s:3:"-10";s:7:"umacron";s:3:"-10";s:7:"uogonek";s:3:"-10";s:5:"uring";s:3:"-10";s:1:"v";s:3:"-20";s:1:"y";s:3:"-15";s:6:"yacute";s:3:"-15";s:9:"ydieresis";s:3:"-15";}s:12:"ncommaaccent";a:13:{s:1:"u";s:3:"-10";s:6:"uacute";s:3:"-10";s:11:"ucircumflex";s:3:"-10";s:9:"udieresis";s:3:"-10";s:6:"ugrave";s:3:"-10";s:13:"uhungarumlaut";s:3:"-10";s:7:"umacron";s:3:"-10";s:7:"uogonek";s:3:"-10";s:5:"uring";s:3:"-10";s:1:"v";s:3:"-20";s:1:"y";s:3:"-15";s:6:"yacute";s:3:"-15";s:9:"ydieresis";s:3:"-15";}s:6:"ntilde";a:13:{s:1:"u";s:3:"-10";s:6:"uacute";s:3:"-10";s:11:"ucircumflex";s:3:"-10";s:9:"udieresis";s:3:"-10";s:6:"ugrave";s:3:"-10";s:13:"uhungarumlaut";s:3:"-10";s:7:"umacron";s:3:"-10";s:7:"uogonek";s:3:"-10";s:5:"uring";s:3:"-10";s:1:"v";s:3:"-20";s:1:"y";s:3:"-15";s:6:"yacute";s:3:"-15";s:9:"ydieresis";s:3:"-15";}s:1:"o";a:8:{s:5:"comma";s:3:"-40";s:6:"period";s:3:"-40";s:1:"v";s:3:"-15";s:1:"w";s:3:"-15";s:1:"x";s:3:"-30";s:1:"y";s:3:"-30";s:6:"yacute";s:3:"-30";s:9:"ydieresis";s:3:"-30";}s:6:"oacute";a:8:{s:5:"comma";s:3:"-40";s:6:"period";s:3:"-40";s:1:"v";s:3:"-15";s:1:"w";s:3:"-15";s:1:"x";s:3:"-30";s:1:"y";s:3:"-30";s:6:"yacute";s:3:"-30";s:9:"ydieresis";s:3:"-30";}s:11:"ocircumflex";a:8:{s:5:"comma";s:3:"-40";s:6:"period";s:3:"-40";s:1:"v";s:3:"-15";s:1:"w";s:3:"-15";s:1:"x";s:3:"-30";s:1:"y";s:3:"-30";s:6:"yacute";s:3:"-30";s:9:"ydieresis";s:3:"-30";}s:9:"odieresis";a:8:{s:5:"comma";s:3:"-40";s:6:"period";s:3:"-40";s:1:"v";s:3:"-15";s:1:"w";s:3:"-15";s:1:"x";s:3:"-30";s:1:"y";s:3:"-30";s:6:"yacute";s:3:"-30";s:9:"ydieresis";s:3:"-30";}s:6:"ograve";a:8:{s:5:"comma";s:3:"-40";s:6:"period";s:3:"-40";s:1:"v";s:3:"-15";s:1:"w";s:3:"-15";s:1:"x";s:3:"-30";s:1:"y";s:3:"-30";s:6:"yacute";s:3:"-30";s:9:"ydieresis";s:3:"-30";}s:13:"ohungarumlaut";a:8:{s:5:"comma";s:3:"-40";s:6:"period";s:3:"-40";s:1:"v";s:3:"-15";s:1:"w";s:3:"-15";s:1:"x";s:3:"-30";s:1:"y";s:3:"-30";s:6:"yacute";s:3:"-30";s:9:"ydieresis";s:3:"-30";}s:7:"omacron";a:8:{s:5:"comma";s:3:"-40";s:6:"period";s:3:"-40";s:1:"v";s:3:"-15";s:1:"w";s:3:"-15";s:1:"x";s:3:"-30";s:1:"y";s:3:"-30";s:6:"yacute";s:3:"-30";s:9:"ydieresis";s:3:"-30";}s:6:"oslash";a:94:{s:1:"a";s:3:"-55";s:6:"aacute";s:3:"-55";s:6:"abreve";s:3:"-55";s:11:"acircumflex";s:3:"-55";s:9:"adieresis";s:3:"-55";s:6:"agrave";s:3:"-55";s:7:"amacron";s:3:"-55";s:7:"aogonek";s:3:"-55";s:5:"aring";s:3:"-55";s:6:"atilde";s:3:"-55";s:1:"b";s:3:"-55";s:1:"c";s:3:"-55";s:6:"cacute";s:3:"-55";s:6:"ccaron";s:3:"-55";s:8:"ccedilla";s:3:"-55";s:5:"comma";s:3:"-95";s:1:"d";s:3:"-55";s:6:"dcroat";s:3:"-55";s:1:"e";s:3:"-55";s:6:"eacute";s:3:"-55";s:6:"ecaron";s:3:"-55";s:11:"ecircumflex";s:3:"-55";s:9:"edieresis";s:3:"-55";s:10:"edotaccent";s:3:"-55";s:6:"egrave";s:3:"-55";s:7:"emacron";s:3:"-55";s:7:"eogonek";s:3:"-55";s:1:"f";s:3:"-55";s:1:"g";s:3:"-55";s:6:"gbreve";s:3:"-55";s:12:"gcommaaccent";s:3:"-55";s:1:"h";s:3:"-55";s:1:"i";s:3:"-55";s:6:"iacute";s:3:"-55";s:11:"icircumflex";s:3:"-55";s:9:"idieresis";s:3:"-55";s:6:"igrave";s:3:"-55";s:7:"imacron";s:3:"-55";s:7:"iogonek";s:3:"-55";s:1:"j";s:3:"-55";s:1:"k";s:3:"-55";s:12:"kcommaaccent";s:3:"-55";s:1:"l";s:3:"-55";s:6:"lacute";s:3:"-55";s:12:"lcommaaccent";s:3:"-55";s:6:"lslash";s:3:"-55";s:1:"m";s:3:"-55";s:1:"n";s:3:"-55";s:6:"nacute";s:3:"-55";s:6:"ncaron";s:3:"-55";s:12:"ncommaaccent";s:3:"-55";s:6:"ntilde";s:3:"-55";s:1:"o";s:3:"-55";s:6:"oacute";s:3:"-55";s:11:"ocircumflex";s:3:"-55";s:9:"odieresis";s:3:"-55";s:6:"ograve";s:3:"-55";s:13:"ohungarumlaut";s:3:"-55";s:7:"omacron";s:3:"-55";s:6:"oslash";s:3:"-55";s:6:"otilde";s:3:"-55";s:1:"p";s:3:"-55";s:6:"period";s:3:"-95";s:1:"q";s:3:"-55";s:1:"r";s:3:"-55";s:6:"racute";s:3:"-55";s:6:"rcaron";s:3:"-55";s:12:"rcommaaccent";s:3:"-55";s:1:"s";s:3:"-55";s:6:"sacute";s:3:"-55";s:6:"scaron";s:3:"-55";s:8:"scedilla";s:3:"-55";s:12:"scommaaccent";s:3:"-55";s:1:"t";s:3:"-55";s:12:"tcommaaccent";s:3:"-55";s:1:"u";s:3:"-55";s:6:"uacute";s:3:"-55";s:11:"ucircumflex";s:3:"-55";s:9:"udieresis";s:3:"-55";s:6:"ugrave";s:3:"-55";s:13:"uhungarumlaut";s:3:"-55";s:7:"umacron";s:3:"-55";s:7:"uogonek";s:3:"-55";s:5:"uring";s:3:"-55";s:1:"v";s:3:"-70";s:1:"w";s:3:"-70";s:1:"x";s:3:"-85";s:1:"y";s:3:"-70";s:6:"yacute";s:3:"-70";s:9:"ydieresis";s:3:"-70";s:1:"z";s:3:"-55";s:6:"zacute";s:3:"-55";s:6:"zcaron";s:3:"-55";s:10:"zdotaccent";s:3:"-55";}s:6:"otilde";a:8:{s:5:"comma";s:3:"-40";s:6:"period";s:3:"-40";s:1:"v";s:3:"-15";s:1:"w";s:3:"-15";s:1:"x";s:3:"-30";s:1:"y";s:3:"-30";s:6:"yacute";s:3:"-30";s:9:"ydieresis";s:3:"-30";}s:1:"p";a:5:{s:5:"comma";s:3:"-35";s:6:"period";s:3:"-35";s:1:"y";s:3:"-30";s:6:"yacute";s:3:"-30";s:9:"ydieresis";s:3:"-30";}s:6:"period";a:3:{s:13:"quotedblright";s:4:"-100";s:10:"quoteright";s:4:"-100";s:5:"space";s:3:"-60";}s:13:"quotedblright";a:1:{s:5:"space";s:3:"-40";}s:9:"quoteleft";a:1:{s:9:"quoteleft";s:3:"-57";}s:10:"quoteright";a:13:{s:1:"d";s:3:"-50";s:6:"dcroat";s:3:"-50";s:10:"quoteright";s:3:"-57";s:1:"r";s:3:"-50";s:6:"racute";s:3:"-50";s:6:"rcaron";s:3:"-50";s:12:"rcommaaccent";s:3:"-50";s:1:"s";s:3:"-50";s:6:"sacute";s:3:"-50";s:6:"scaron";s:3:"-50";s:8:"scedilla";s:3:"-50";s:12:"scommaaccent";s:3:"-50";s:5:"space";s:3:"-70";}s:1:"r";a:49:{s:1:"a";s:3:"-10";s:6:"aacute";s:3:"-10";s:6:"abreve";s:3:"-10";s:11:"acircumflex";s:3:"-10";s:9:"adieresis";s:3:"-10";s:6:"agrave";s:3:"-10";s:7:"amacron";s:3:"-10";s:7:"aogonek";s:3:"-10";s:5:"aring";s:3:"-10";s:6:"atilde";s:3:"-10";s:5:"colon";s:2:"30";s:5:"comma";s:3:"-50";s:1:"i";s:2:"15";s:6:"iacute";s:2:"15";s:11:"icircumflex";s:2:"15";s:9:"idieresis";s:2:"15";s:6:"igrave";s:2:"15";s:7:"imacron";s:2:"15";s:7:"iogonek";s:2:"15";s:1:"k";s:2:"15";s:12:"kcommaaccent";s:2:"15";s:1:"l";s:2:"15";s:6:"lacute";s:2:"15";s:12:"lcommaaccent";s:2:"15";s:6:"lslash";s:2:"15";s:1:"m";s:2:"25";s:1:"n";s:2:"25";s:6:"nacute";s:2:"25";s:6:"ncaron";s:2:"25";s:12:"ncommaaccent";s:2:"25";s:6:"ntilde";s:2:"25";s:1:"p";s:2:"30";s:6:"period";s:3:"-50";s:9:"semicolon";s:2:"30";s:1:"t";s:2:"40";s:12:"tcommaaccent";s:2:"40";s:1:"u";s:2:"15";s:6:"uacute";s:2:"15";s:11:"ucircumflex";s:2:"15";s:9:"udieresis";s:2:"15";s:6:"ugrave";s:2:"15";s:13:"uhungarumlaut";s:2:"15";s:7:"umacron";s:2:"15";s:7:"uogonek";s:2:"15";s:5:"uring";s:2:"15";s:1:"v";s:2:"30";s:1:"y";s:2:"30";s:6:"yacute";s:2:"30";s:9:"ydieresis";s:2:"30";}s:6:"racute";a:49:{s:1:"a";s:3:"-10";s:6:"aacute";s:3:"-10";s:6:"abreve";s:3:"-10";s:11:"acircumflex";s:3:"-10";s:9:"adieresis";s:3:"-10";s:6:"agrave";s:3:"-10";s:7:"amacron";s:3:"-10";s:7:"aogonek";s:3:"-10";s:5:"aring";s:3:"-10";s:6:"atilde";s:3:"-10";s:5:"colon";s:2:"30";s:5:"comma";s:3:"-50";s:1:"i";s:2:"15";s:6:"iacute";s:2:"15";s:11:"icircumflex";s:2:"15";s:9:"idieresis";s:2:"15";s:6:"igrave";s:2:"15";s:7:"imacron";s:2:"15";s:7:"iogonek";s:2:"15";s:1:"k";s:2:"15";s:12:"kcommaaccent";s:2:"15";s:1:"l";s:2:"15";s:6:"lacute";s:2:"15";s:12:"lcommaaccent";s:2:"15";s:6:"lslash";s:2:"15";s:1:"m";s:2:"25";s:1:"n";s:2:"25";s:6:"nacute";s:2:"25";s:6:"ncaron";s:2:"25";s:12:"ncommaaccent";s:2:"25";s:6:"ntilde";s:2:"25";s:1:"p";s:2:"30";s:6:"period";s:3:"-50";s:9:"semicolon";s:2:"30";s:1:"t";s:2:"40";s:12:"tcommaaccent";s:2:"40";s:1:"u";s:2:"15";s:6:"uacute";s:2:"15";s:11:"ucircumflex";s:2:"15";s:9:"udieresis";s:2:"15";s:6:"ugrave";s:2:"15";s:13:"uhungarumlaut";s:2:"15";s:7:"umacron";s:2:"15";s:7:"uogonek";s:2:"15";s:5:"uring";s:2:"15";s:1:"v";s:2:"30";s:1:"y";s:2:"30";s:6:"yacute";s:2:"30";s:9:"ydieresis";s:2:"30";}s:6:"rcaron";a:49:{s:1:"a";s:3:"-10";s:6:"aacute";s:3:"-10";s:6:"abreve";s:3:"-10";s:11:"acircumflex";s:3:"-10";s:9:"adieresis";s:3:"-10";s:6:"agrave";s:3:"-10";s:7:"amacron";s:3:"-10";s:7:"aogonek";s:3:"-10";s:5:"aring";s:3:"-10";s:6:"atilde";s:3:"-10";s:5:"colon";s:2:"30";s:5:"comma";s:3:"-50";s:1:"i";s:2:"15";s:6:"iacute";s:2:"15";s:11:"icircumflex";s:2:"15";s:9:"idieresis";s:2:"15";s:6:"igrave";s:2:"15";s:7:"imacron";s:2:"15";s:7:"iogonek";s:2:"15";s:1:"k";s:2:"15";s:12:"kcommaaccent";s:2:"15";s:1:"l";s:2:"15";s:6:"lacute";s:2:"15";s:12:"lcommaaccent";s:2:"15";s:6:"lslash";s:2:"15";s:1:"m";s:2:"25";s:1:"n";s:2:"25";s:6:"nacute";s:2:"25";s:6:"ncaron";s:2:"25";s:12:"ncommaaccent";s:2:"25";s:6:"ntilde";s:2:"25";s:1:"p";s:2:"30";s:6:"period";s:3:"-50";s:9:"semicolon";s:2:"30";s:1:"t";s:2:"40";s:12:"tcommaaccent";s:2:"40";s:1:"u";s:2:"15";s:6:"uacute";s:2:"15";s:11:"ucircumflex";s:2:"15";s:9:"udieresis";s:2:"15";s:6:"ugrave";s:2:"15";s:13:"uhungarumlaut";s:2:"15";s:7:"umacron";s:2:"15";s:7:"uogonek";s:2:"15";s:5:"uring";s:2:"15";s:1:"v";s:2:"30";s:1:"y";s:2:"30";s:6:"yacute";s:2:"30";s:9:"ydieresis";s:2:"30";}s:12:"rcommaaccent";a:49:{s:1:"a";s:3:"-10";s:6:"aacute";s:3:"-10";s:6:"abreve";s:3:"-10";s:11:"acircumflex";s:3:"-10";s:9:"adieresis";s:3:"-10";s:6:"agrave";s:3:"-10";s:7:"amacron";s:3:"-10";s:7:"aogonek";s:3:"-10";s:5:"aring";s:3:"-10";s:6:"atilde";s:3:"-10";s:5:"colon";s:2:"30";s:5:"comma";s:3:"-50";s:1:"i";s:2:"15";s:6:"iacute";s:2:"15";s:11:"icircumflex";s:2:"15";s:9:"idieresis";s:2:"15";s:6:"igrave";s:2:"15";s:7:"imacron";s:2:"15";s:7:"iogonek";s:2:"15";s:1:"k";s:2:"15";s:12:"kcommaaccent";s:2:"15";s:1:"l";s:2:"15";s:6:"lacute";s:2:"15";s:12:"lcommaaccent";s:2:"15";s:6:"lslash";s:2:"15";s:1:"m";s:2:"25";s:1:"n";s:2:"25";s:6:"nacute";s:2:"25";s:6:"ncaron";s:2:"25";s:12:"ncommaaccent";s:2:"25";s:6:"ntilde";s:2:"25";s:1:"p";s:2:"30";s:6:"period";s:3:"-50";s:9:"semicolon";s:2:"30";s:1:"t";s:2:"40";s:12:"tcommaaccent";s:2:"40";s:1:"u";s:2:"15";s:6:"uacute";s:2:"15";s:11:"ucircumflex";s:2:"15";s:9:"udieresis";s:2:"15";s:6:"ugrave";s:2:"15";s:13:"uhungarumlaut";s:2:"15";s:7:"umacron";s:2:"15";s:7:"uogonek";s:2:"15";s:5:"uring";s:2:"15";s:1:"v";s:2:"30";s:1:"y";s:2:"30";s:6:"yacute";s:2:"30";s:9:"ydieresis";s:2:"30";}s:1:"s";a:3:{s:5:"comma";s:3:"-15";s:6:"period";s:3:"-15";s:1:"w";s:3:"-30";}s:6:"sacute";a:3:{s:5:"comma";s:3:"-15";s:6:"period";s:3:"-15";s:1:"w";s:3:"-30";}s:6:"scaron";a:3:{s:5:"comma";s:3:"-15";s:6:"period";s:3:"-15";s:1:"w";s:3:"-30";}s:8:"scedilla";a:3:{s:5:"comma";s:3:"-15";s:6:"period";s:3:"-15";s:1:"w";s:3:"-30";}s:12:"scommaaccent";a:3:{s:5:"comma";s:3:"-15";s:6:"period";s:3:"-15";s:1:"w";s:3:"-30";}s:9:"semicolon";a:1:{s:5:"space";s:3:"-50";}s:5:"space";a:10:{s:1:"T";s:3:"-50";s:6:"Tcaron";s:3:"-50";s:12:"Tcommaaccent";s:3:"-50";s:1:"V";s:3:"-50";s:1:"W";s:3:"-40";s:1:"Y";s:3:"-90";s:6:"Yacute";s:3:"-90";s:9:"Ydieresis";s:3:"-90";s:12:"quotedblleft";s:3:"-30";s:9:"quoteleft";s:3:"-60";}s:1:"v";a:30:{s:1:"a";s:3:"-25";s:6:"aacute";s:3:"-25";s:6:"abreve";s:3:"-25";s:11:"acircumflex";s:3:"-25";s:9:"adieresis";s:3:"-25";s:6:"agrave";s:3:"-25";s:7:"amacron";s:3:"-25";s:7:"aogonek";s:3:"-25";s:5:"aring";s:3:"-25";s:6:"atilde";s:3:"-25";s:5:"comma";s:3:"-80";s:1:"e";s:3:"-25";s:6:"eacute";s:3:"-25";s:6:"ecaron";s:3:"-25";s:11:"ecircumflex";s:3:"-25";s:9:"edieresis";s:3:"-25";s:10:"edotaccent";s:3:"-25";s:6:"egrave";s:3:"-25";s:7:"emacron";s:3:"-25";s:7:"eogonek";s:3:"-25";s:1:"o";s:3:"-25";s:6:"oacute";s:3:"-25";s:11:"ocircumflex";s:3:"-25";s:9:"odieresis";s:3:"-25";s:6:"ograve";s:3:"-25";s:13:"ohungarumlaut";s:3:"-25";s:7:"omacron";s:3:"-25";s:6:"oslash";s:3:"-25";s:6:"otilde";s:3:"-25";s:6:"period";s:3:"-80";}s:1:"w";a:30:{s:1:"a";s:3:"-15";s:6:"aacute";s:3:"-15";s:6:"abreve";s:3:"-15";s:11:"acircumflex";s:3:"-15";s:9:"adieresis";s:3:"-15";s:6:"agrave";s:3:"-15";s:7:"amacron";s:3:"-15";s:7:"aogonek";s:3:"-15";s:5:"aring";s:3:"-15";s:6:"atilde";s:3:"-15";s:5:"comma";s:3:"-60";s:1:"e";s:3:"-10";s:6:"eacute";s:3:"-10";s:6:"ecaron";s:3:"-10";s:11:"ecircumflex";s:3:"-10";s:9:"edieresis";s:3:"-10";s:10:"edotaccent";s:3:"-10";s:6:"egrave";s:3:"-10";s:7:"emacron";s:3:"-10";s:7:"eogonek";s:3:"-10";s:1:"o";s:3:"-10";s:6:"oacute";s:3:"-10";s:11:"ocircumflex";s:3:"-10";s:9:"odieresis";s:3:"-10";s:6:"ograve";s:3:"-10";s:13:"ohungarumlaut";s:3:"-10";s:7:"omacron";s:3:"-10";s:6:"oslash";s:3:"-10";s:6:"otilde";s:3:"-10";s:6:"period";s:3:"-60";}s:1:"x";a:9:{s:1:"e";s:3:"-30";s:6:"eacute";s:3:"-30";s:6:"ecaron";s:3:"-30";s:11:"ecircumflex";s:3:"-30";s:9:"edieresis";s:3:"-30";s:10:"edotaccent";s:3:"-30";s:6:"egrave";s:3:"-30";s:7:"emacron";s:3:"-30";s:7:"eogonek";s:3:"-30";}s:1:"y";a:30:{s:1:"a";s:3:"-20";s:6:"aacute";s:3:"-20";s:6:"abreve";s:3:"-20";s:11:"acircumflex";s:3:"-20";s:9:"adieresis";s:3:"-20";s:6:"agrave";s:3:"-20";s:7:"amacron";s:3:"-20";s:7:"aogonek";s:3:"-20";s:5:"aring";s:3:"-20";s:6:"atilde";s:3:"-20";s:5:"comma";s:4:"-100";s:1:"e";s:3:"-20";s:6:"eacute";s:3:"-20";s:6:"ecaron";s:3:"-20";s:11:"ecircumflex";s:3:"-20";s:9:"edieresis";s:3:"-20";s:10:"edotaccent";s:3:"-20";s:6:"egrave";s:3:"-20";s:7:"emacron";s:3:"-20";s:7:"eogonek";s:3:"-20";s:1:"o";s:3:"-20";s:6:"oacute";s:3:"-20";s:11:"ocircumflex";s:3:"-20";s:9:"odieresis";s:3:"-20";s:6:"ograve";s:3:"-20";s:13:"ohungarumlaut";s:3:"-20";s:7:"omacron";s:3:"-20";s:6:"oslash";s:3:"-20";s:6:"otilde";s:3:"-20";s:6:"period";s:4:"-100";}s:6:"yacute";a:30:{s:1:"a";s:3:"-20";s:6:"aacute";s:3:"-20";s:6:"abreve";s:3:"-20";s:11:"acircumflex";s:3:"-20";s:9:"adieresis";s:3:"-20";s:6:"agrave";s:3:"-20";s:7:"amacron";s:3:"-20";s:7:"aogonek";s:3:"-20";s:5:"aring";s:3:"-20";s:6:"atilde";s:3:"-20";s:5:"comma";s:4:"-100";s:1:"e";s:3:"-20";s:6:"eacute";s:3:"-20";s:6:"ecaron";s:3:"-20";s:11:"ecircumflex";s:3:"-20";s:9:"edieresis";s:3:"-20";s:10:"edotaccent";s:3:"-20";s:6:"egrave";s:3:"-20";s:7:"emacron";s:3:"-20";s:7:"eogonek";s:3:"-20";s:1:"o";s:3:"-20";s:6:"oacute";s:3:"-20";s:11:"ocircumflex";s:3:"-20";s:9:"odieresis";s:3:"-20";s:6:"ograve";s:3:"-20";s:13:"ohungarumlaut";s:3:"-20";s:7:"omacron";s:3:"-20";s:6:"oslash";s:3:"-20";s:6:"otilde";s:3:"-20";s:6:"period";s:4:"-100";}s:9:"ydieresis";a:30:{s:1:"a";s:3:"-20";s:6:"aacute";s:3:"-20";s:6:"abreve";s:3:"-20";s:11:"acircumflex";s:3:"-20";s:9:"adieresis";s:3:"-20";s:6:"agrave";s:3:"-20";s:7:"amacron";s:3:"-20";s:7:"aogonek";s:3:"-20";s:5:"aring";s:3:"-20";s:6:"atilde";s:3:"-20";s:5:"comma";s:4:"-100";s:1:"e";s:3:"-20";s:6:"eacute";s:3:"-20";s:6:"ecaron";s:3:"-20";s:11:"ecircumflex";s:3:"-20";s:9:"edieresis";s:3:"-20";s:10:"edotaccent";s:3:"-20";s:6:"egrave";s:3:"-20";s:7:"emacron";s:3:"-20";s:7:"eogonek";s:3:"-20";s:1:"o";s:3:"-20";s:6:"oacute";s:3:"-20";s:11:"ocircumflex";s:3:"-20";s:9:"odieresis";s:3:"-20";s:6:"ograve";s:3:"-20";s:13:"ohungarumlaut";s:3:"-20";s:7:"omacron";s:3:"-20";s:6:"oslash";s:3:"-20";s:6:"otilde";s:3:"-20";s:6:"period";s:4:"-100";}s:1:"z";a:18:{s:1:"e";s:3:"-15";s:6:"eacute";s:3:"-15";s:6:"ecaron";s:3:"-15";s:11:"ecircumflex";s:3:"-15";s:9:"edieresis";s:3:"-15";s:10:"edotaccent";s:3:"-15";s:6:"egrave";s:3:"-15";s:7:"emacron";s:3:"-15";s:7:"eogonek";s:3:"-15";s:1:"o";s:3:"-15";s:6:"oacute";s:3:"-15";s:11:"ocircumflex";s:3:"-15";s:9:"odieresis";s:3:"-15";s:6:"ograve";s:3:"-15";s:13:"ohungarumlaut";s:3:"-15";s:7:"omacron";s:3:"-15";s:6:"oslash";s:3:"-15";s:6:"otilde";s:3:"-15";}s:6:"zacute";a:18:{s:1:"e";s:3:"-15";s:6:"eacute";s:3:"-15";s:6:"ecaron";s:3:"-15";s:11:"ecircumflex";s:3:"-15";s:9:"edieresis";s:3:"-15";s:10:"edotaccent";s:3:"-15";s:6:"egrave";s:3:"-15";s:7:"emacron";s:3:"-15";s:7:"eogonek";s:3:"-15";s:1:"o";s:3:"-15";s:6:"oacute";s:3:"-15";s:11:"ocircumflex";s:3:"-15";s:9:"odieresis";s:3:"-15";s:6:"ograve";s:3:"-15";s:13:"ohungarumlaut";s:3:"-15";s:7:"omacron";s:3:"-15";s:6:"oslash";s:3:"-15";s:6:"otilde";s:3:"-15";}s:6:"zcaron";a:18:{s:1:"e";s:3:"-15";s:6:"eacute";s:3:"-15";s:6:"ecaron";s:3:"-15";s:11:"ecircumflex";s:3:"-15";s:9:"edieresis";s:3:"-15";s:10:"edotaccent";s:3:"-15";s:6:"egrave";s:3:"-15";s:7:"emacron";s:3:"-15";s:7:"eogonek";s:3:"-15";s:1:"o";s:3:"-15";s:6:"oacute";s:3:"-15";s:11:"ocircumflex";s:3:"-15";s:9:"odieresis";s:3:"-15";s:6:"ograve";s:3:"-15";s:13:"ohungarumlaut";s:3:"-15";s:7:"omacron";s:3:"-15";s:6:"oslash";s:3:"-15";s:6:"otilde";s:3:"-15";}s:10:"zdotaccent";a:18:{s:1:"e";s:3:"-15";s:6:"eacute";s:3:"-15";s:6:"ecaron";s:3:"-15";s:11:"ecircumflex";s:3:"-15";s:9:"edieresis";s:3:"-15";s:10:"edotaccent";s:3:"-15";s:6:"egrave";s:3:"-15";s:7:"emacron";s:3:"-15";s:7:"eogonek";s:3:"-15";s:1:"o";s:3:"-15";s:6:"oacute";s:3:"-15";s:11:"ocircumflex";s:3:"-15";s:9:"odieresis";s:3:"-15";s:6:"ograve";s:3:"-15";s:13:"ohungarumlaut";s:3:"-15";s:7:"omacron";s:3:"-15";s:6:"oslash";s:3:"-15";s:6:"otilde";s:3:"-15";}}s:9:"_version_";i:1;}glpi-0.84.3+dfsg.1/lib/htmlawed/000077500000000000000000000000001226600447100161745ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/htmlawed/htmLawed.php000077500000000000000000001363331226600447100204660ustar00rootroot000000000000001, 'abbr'=>1, 'acronym'=>1, 'address'=>1, 'applet'=>1, 'area'=>1, 'b'=>1, 'bdo'=>1, 'big'=>1, 'blockquote'=>1, 'br'=>1, 'button'=>1, 'caption'=>1, 'center'=>1, 'cite'=>1, 'code'=>1, 'col'=>1, 'colgroup'=>1, 'dd'=>1, 'del'=>1, 'dfn'=>1, 'dir'=>1, 'div'=>1, 'dl'=>1, 'dt'=>1, 'em'=>1, 'embed'=>1, 'fieldset'=>1, 'font'=>1, 'form'=>1, 'h1'=>1, 'h2'=>1, 'h3'=>1, 'h4'=>1, 'h5'=>1, 'h6'=>1, 'hr'=>1, 'i'=>1, 'iframe'=>1, 'img'=>1, 'input'=>1, 'ins'=>1, 'isindex'=>1, 'kbd'=>1, 'label'=>1, 'legend'=>1, 'li'=>1, 'map'=>1, 'menu'=>1, 'noscript'=>1, 'object'=>1, 'ol'=>1, 'optgroup'=>1, 'option'=>1, 'p'=>1, 'param'=>1, 'pre'=>1, 'q'=>1, 'rb'=>1, 'rbc'=>1, 'rp'=>1, 'rt'=>1, 'rtc'=>1, 'ruby'=>1, 's'=>1, 'samp'=>1, 'script'=>1, 'select'=>1, 'small'=>1, 'span'=>1, 'strike'=>1, 'strong'=>1, 'sub'=>1, 'sup'=>1, 'table'=>1, 'tbody'=>1, 'td'=>1, 'textarea'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1, 'tt'=>1, 'u'=>1, 'ul'=>1, 'var'=>1); // 86/deprecated+embed+ruby if(!empty($C['safe'])){ unset($e['applet'], $e['embed'], $e['iframe'], $e['object'], $e['script']); } $x = !empty($C['elements']) ? str_replace(array("\n", "\r", "\t", ' '), '', $C['elements']) : '*'; if($x == '-*'){$e = array();} elseif(strpos($x, '*') === false){$e = array_flip(explode(',', $x));} else{ if(isset($x[1])){ preg_match_all('`(?:^|-|\+)[^\-+]+?(?=-|\+|$)`', $x, $m, PREG_SET_ORDER); for($i=count($m); --$i>=0;){$m[$i] = $m[$i][0];} foreach($m as $v){ if($v[0] == '+'){$e[substr($v, 1)] = 1;} if($v[0] == '-' && isset($e[($v = substr($v, 1))]) && !in_array('+'. $v, $m)){unset($e[$v]);} } } } $C['elements'] =& $e; // config attrs $x = !empty($C['deny_attribute']) ? str_replace(array("\n", "\r", "\t", ' '), '', $C['deny_attribute']) : ''; $x = array_flip((isset($x[0]) && $x[0] == '*') ? explode('-', $x) : explode(',', $x. (!empty($C['safe']) ? ',on*' : ''))); if(isset($x['on*'])){ unset($x['on*']); $x += array('onblur'=>1, 'onchange'=>1, 'onclick'=>1, 'ondblclick'=>1, 'onfocus'=>1, 'onkeydown'=>1, 'onkeypress'=>1, 'onkeyup'=>1, 'onmousedown'=>1, 'onmousemove'=>1, 'onmouseout'=>1, 'onmouseover'=>1, 'onmouseup'=>1, 'onreset'=>1, 'onselect'=>1, 'onsubmit'=>1); } $C['deny_attribute'] = $x; // config URL $x = (isset($C['schemes'][2]) && strpos($C['schemes'], ':')) ? strtolower($C['schemes']) : 'href: aim, feed, file, ftp, gopher, http, https, irc, mailto, news, nntp, sftp, ssh, telnet; *:file, http, https'; $C['schemes'] = array(); foreach(explode(';', str_replace(array(' ', "\t", "\r", "\n"), '', $x)) as $v){ $x = $x2 = null; list($x, $x2) = explode(':', $v, 2); if($x2){$C['schemes'][$x] = array_flip(explode(',', $x2));} } if(!isset($C['schemes']['*'])){$C['schemes']['*'] = array('file'=>1, 'http'=>1, 'https'=>1,);} if(!empty($C['safe']) && empty($C['schemes']['style'])){$C['schemes']['style'] = array('!'=>1);} $C['abs_url'] = isset($C['abs_url']) ? $C['abs_url'] : 0; if(!isset($C['base_url']) or !preg_match('`^[a-zA-Z\d.+\-]+://[^/]+/(.+?/)?$`', $C['base_url'])){ $C['base_url'] = $C['abs_url'] = 0; } // config rest $C['and_mark'] = empty($C['and_mark']) ? 0 : 1; $C['anti_link_spam'] = (isset($C['anti_link_spam']) && is_array($C['anti_link_spam']) && count($C['anti_link_spam']) == 2 && (empty($C['anti_link_spam'][0]) or hl_regex($C['anti_link_spam'][0])) && (empty($C['anti_link_spam'][1]) or hl_regex($C['anti_link_spam'][1]))) ? $C['anti_link_spam'] : 0; $C['anti_mail_spam'] = isset($C['anti_mail_spam']) ? $C['anti_mail_spam'] : 0; $C['balance'] = isset($C['balance']) ? (bool)$C['balance'] : 1; $C['cdata'] = isset($C['cdata']) ? $C['cdata'] : (empty($C['safe']) ? 3 : 0); $C['clean_ms_char'] = empty($C['clean_ms_char']) ? 0 : $C['clean_ms_char']; $C['comment'] = isset($C['comment']) ? $C['comment'] : (empty($C['safe']) ? 3 : 0); $C['css_expression'] = empty($C['css_expression']) ? 0 : 1; $C['direct_list_nest'] = empty($C['direct_list_nest']) ? 0 : 1; $C['hexdec_entity'] = isset($C['hexdec_entity']) ? $C['hexdec_entity'] : 1; $C['hook'] = (!empty($C['hook']) && function_exists($C['hook'])) ? $C['hook'] : 0; $C['hook_tag'] = (!empty($C['hook_tag']) && function_exists($C['hook_tag'])) ? $C['hook_tag'] : 0; $C['keep_bad'] = isset($C['keep_bad']) ? $C['keep_bad'] : 6; $C['lc_std_val'] = isset($C['lc_std_val']) ? (bool)$C['lc_std_val'] : 1; $C['make_tag_strict'] = isset($C['make_tag_strict']) ? $C['make_tag_strict'] : 1; $C['named_entity'] = isset($C['named_entity']) ? (bool)$C['named_entity'] : 1; $C['no_deprecated_attr'] = isset($C['no_deprecated_attr']) ? $C['no_deprecated_attr'] : 1; $C['parent'] = isset($C['parent'][0]) ? strtolower($C['parent']) : 'body'; $C['show_setting'] = !empty($C['show_setting']) ? $C['show_setting'] : 0; $C['style_pass'] = empty($C['style_pass']) ? 0 : 1; $C['tidy'] = empty($C['tidy']) ? 0 : $C['tidy']; $C['unique_ids'] = isset($C['unique_ids']) ? $C['unique_ids'] : 1; $C['xml:lang'] = isset($C['xml:lang']) ? $C['xml:lang'] : 0; if(isset($GLOBALS['C'])){$reC = $GLOBALS['C'];} $GLOBALS['C'] = $C; $S = is_array($S) ? $S : hl_spec($S); if(isset($GLOBALS['S'])){$reS = $GLOBALS['S'];} $GLOBALS['S'] = $S; $t = preg_replace('`[\x00-\x08\x0b-\x0c\x0e-\x1f]`', '', $t); if($C['clean_ms_char']){ $x = array("\x7f"=>'', "\x80"=>'€', "\x81"=>'', "\x83"=>'ƒ', "\x85"=>'…', "\x86"=>'†', "\x87"=>'‡', "\x88"=>'ˆ', "\x89"=>'‰', "\x8a"=>'Š', "\x8b"=>'‹', "\x8c"=>'Œ', "\x8d"=>'', "\x8e"=>'Ž', "\x8f"=>'', "\x90"=>'', "\x95"=>'•', "\x96"=>'–', "\x97"=>'—', "\x98"=>'˜', "\x99"=>'™', "\x9a"=>'š', "\x9b"=>'›', "\x9c"=>'œ', "\x9d"=>'', "\x9e"=>'ž', "\x9f"=>'Ÿ'); $x = $x + ($C['clean_ms_char'] == 1 ? array("\x82"=>'‚', "\x84"=>'„', "\x91"=>'‘', "\x92"=>'’', "\x93"=>'“', "\x94"=>'”') : array("\x82"=>'\'', "\x84"=>'"', "\x91"=>'\'', "\x92"=>'\'', "\x93"=>'"', "\x94"=>'"')); $t = strtr($t, $x); } if($C['cdata'] or $C['comment']){$t = preg_replace_callback('``sm', 'hl_cmtcd', $t);} $t = preg_replace_callback('`&([A-Za-z][A-Za-z0-9]{1,30}|#(?:[0-9]{1,8}|[Xx][0-9A-Fa-f]{1,7}));`', 'hl_ent', str_replace('&', '&', $t)); if($C['unique_ids'] && !isset($GLOBALS['hl_Ids'])){$GLOBALS['hl_Ids'] = array();} if($C['hook']){$t = $C['hook']($t, $C, $S);} if($C['show_setting'] && preg_match('`^[a-z][a-z0-9_]*$`i', $C['show_setting'])){ $GLOBALS[$C['show_setting']] = array('config'=>$C, 'spec'=>$S, 'time'=>microtime()); } // main $t = preg_replace_callback('`<(?:(?:\s|$)|(?:[^>]*(?:>|$)))|>`m', 'hl_tag', $t); $t = $C['balance'] ? hl_bal($t, $C['keep_bad'], $C['parent']) : $t; $t = (($C['cdata'] or $C['comment']) && strpos($t, "\x01") !== false) ? str_replace(array("\x01", "\x02", "\x03", "\x04", "\x05"), array('', '', '&', '<', '>'), $t) : $t; $t = $C['tidy'] ? hl_tidy($t, $C['tidy'], $C['parent']) : $t; unset($C, $e); if(isset($reC)){$GLOBALS['C'] = $reC;} if(isset($reS)){$GLOBALS['S'] = $reS;} return $t; // eof } function hl_attrval($t, $p){ // check attr val against $S $o = 1; $l = strlen($t); foreach($p as $k=>$v){ switch($k){ case 'maxlen':if($l > $v){$o = 0;} break; case 'minlen': if($l < $v){$o = 0;} break; case 'maxval': if((float)($t) > $v){$o = 0;} break; case 'minval': if((float)($t) < $v){$o = 0;} break; case 'match': if(!preg_match($v, $t)){$o = 0;} break; case 'nomatch': if(preg_match($v, $t)){$o = 0;} break; case 'oneof': $m = 0; foreach(explode('|', $v) as $n){if($t == $n){$m = 1; break;}} $o = $m; break; case 'noneof': $m = 1; foreach(explode('|', $v) as $n){if($t == $n){$m = 0; break;}} $o = $m; break; default: break; } if(!$o){break;} } return ($o ? $t : (isset($p['default']) ? $p['default'] : 0)); // eof } function hl_bal($t, $do=1, $in='div'){ // balance tags // by content $cB = array('blockquote'=>1, 'form'=>1, 'map'=>1, 'noscript'=>1); // Block $cE = array('area'=>1, 'br'=>1, 'col'=>1, 'embed'=>1, 'hr'=>1, 'img'=>1, 'input'=>1, 'isindex'=>1, 'param'=>1); // Empty $cF = array('button'=>1, 'del'=>1, 'div'=>1, 'dd'=>1, 'fieldset'=>1, 'iframe'=>1, 'ins'=>1, 'li'=>1, 'noscript'=>1, 'object'=>1, 'td'=>1, 'th'=>1); // Flow; later context-wise dynamic move of ins & del to $cI $cI = array('a'=>1, 'abbr'=>1, 'acronym'=>1, 'address'=>1, 'b'=>1, 'bdo'=>1, 'big'=>1, 'caption'=>1, 'cite'=>1, 'code'=>1, 'dfn'=>1, 'dt'=>1, 'em'=>1, 'font'=>1, 'h1'=>1, 'h2'=>1, 'h3'=>1, 'h4'=>1, 'h5'=>1, 'h6'=>1, 'i'=>1, 'kbd'=>1, 'label'=>1, 'legend'=>1, 'p'=>1, 'pre'=>1, 'q'=>1, 'rb'=>1, 'rt'=>1, 's'=>1, 'samp'=>1, 'small'=>1, 'span'=>1, 'strike'=>1, 'strong'=>1, 'sub'=>1, 'sup'=>1, 'tt'=>1, 'u'=>1, 'var'=>1); // Inline $cN = array('a'=>array('a'=>1), 'button'=>array('a'=>1, 'button'=>1, 'fieldset'=>1, 'form'=>1, 'iframe'=>1, 'input'=>1, 'label'=>1, 'select'=>1, 'textarea'=>1), 'fieldset'=>array('fieldset'=>1), 'form'=>array('form'=>1), 'label'=>array('label'=>1), 'noscript'=>array('script'=>1), 'pre'=>array('big'=>1, 'font'=>1, 'img'=>1, 'object'=>1, 'script'=>1, 'small'=>1, 'sub'=>1, 'sup'=>1), 'rb'=>array('ruby'=>1), 'rt'=>array('ruby'=>1)); // Illegal $cN2 = array_keys($cN); $cR = array('blockquote'=>1, 'dir'=>1, 'dl'=>1, 'form'=>1, 'map'=>1, 'menu'=>1, 'noscript'=>1, 'ol'=>1, 'optgroup'=>1, 'rbc'=>1, 'rtc'=>1, 'ruby'=>1, 'select'=>1, 'table'=>1, 'tbody'=>1, 'tfoot'=>1, 'thead'=>1, 'tr'=>1, 'ul'=>1); $cS = array('colgroup'=>array('col'=>1), 'dir'=>array('li'=>1), 'dl'=>array('dd'=>1, 'dt'=>1), 'menu'=>array('li'=>1), 'ol'=>array('li'=>1), 'optgroup'=>array('option'=>1), 'option'=>array('#pcdata'=>1), 'rbc'=>array('rb'=>1), 'rp'=>array('#pcdata'=>1), 'rtc'=>array('rt'=>1), 'ruby'=>array('rb'=>1, 'rbc'=>1, 'rp'=>1, 'rt'=>1, 'rtc'=>1), 'select'=>array('optgroup'=>1, 'option'=>1), 'script'=>array('#pcdata'=>1), 'table'=>array('caption'=>1, 'col'=>1, 'colgroup'=>1, 'tfoot'=>1, 'tbody'=>1, 'tr'=>1, 'thead'=>1), 'tbody'=>array('tr'=>1), 'tfoot'=>array('tr'=>1), 'textarea'=>array('#pcdata'=>1), 'thead'=>array('tr'=>1), 'tr'=>array('td'=>1, 'th'=>1), 'ul'=>array('li'=>1)); // Specific - immediate parent-child if($GLOBALS['C']['direct_list_nest']){$cS['ol'] = $cS['ul'] += array('ol'=>1, 'ul'=>1);} $cO = array('address'=>array('p'=>1), 'applet'=>array('param'=>1), 'blockquote'=>array('script'=>1), 'fieldset'=>array('legend'=>1, '#pcdata'=>1), 'form'=>array('script'=>1), 'map'=>array('area'=>1), 'object'=>array('param'=>1, 'embed'=>1)); // Other $cT = array('colgroup'=>1, 'dd'=>1, 'dt'=>1, 'li'=>1, 'option'=>1, 'p'=>1, 'td'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1); // Omitable closing // block/inline type; ins & del both type; #pcdata: text $eB = array('address'=>1, 'blockquote'=>1, 'center'=>1, 'del'=>1, 'dir'=>1, 'dl'=>1, 'div'=>1, 'fieldset'=>1, 'form'=>1, 'ins'=>1, 'h1'=>1, 'h2'=>1, 'h3'=>1, 'h4'=>1, 'h5'=>1, 'h6'=>1, 'hr'=>1, 'isindex'=>1, 'menu'=>1, 'noscript'=>1, 'ol'=>1, 'p'=>1, 'pre'=>1, 'table'=>1, 'ul'=>1); $eI = array('#pcdata'=>1, 'a'=>1, 'abbr'=>1, 'acronym'=>1, 'applet'=>1, 'b'=>1, 'bdo'=>1, 'big'=>1, 'br'=>1, 'button'=>1, 'cite'=>1, 'code'=>1, 'del'=>1, 'dfn'=>1, 'em'=>1, 'embed'=>1, 'font'=>1, 'i'=>1, 'iframe'=>1, 'img'=>1, 'input'=>1, 'ins'=>1, 'kbd'=>1, 'label'=>1, 'map'=>1, 'object'=>1, 'q'=>1, 'ruby'=>1, 's'=>1, 'samp'=>1, 'select'=>1, 'script'=>1, 'small'=>1, 'span'=>1, 'strike'=>1, 'strong'=>1, 'sub'=>1, 'sup'=>1, 'textarea'=>1, 'tt'=>1, 'u'=>1, 'var'=>1); $eN = array('a'=>1, 'big'=>1, 'button'=>1, 'fieldset'=>1, 'font'=>1, 'form'=>1, 'iframe'=>1, 'img'=>1, 'input'=>1, 'label'=>1, 'object'=>1, 'ruby'=>1, 'script'=>1, 'select'=>1, 'small'=>1, 'sub'=>1, 'sup'=>1, 'textarea'=>1); // Exclude from specific ele; $cN values $eO = array('area'=>1, 'caption'=>1, 'col'=>1, 'colgroup'=>1, 'dd'=>1, 'dt'=>1, 'legend'=>1, 'li'=>1, 'optgroup'=>1, 'option'=>1, 'param'=>1, 'rb'=>1, 'rbc'=>1, 'rp'=>1, 'rt'=>1, 'rtc'=>1, 'script'=>1, 'tbody'=>1, 'td'=>1, 'tfoot'=>1, 'thead'=>1, 'th'=>1, 'tr'=>1); // Missing in $eB & $eI $eF = $eB + $eI; // $in sets allowed child $in = ((isset($eF[$in]) && $in != '#pcdata') or isset($eO[$in])) ? $in : 'div'; if(isset($cE[$in])){ return (!$do ? '' : str_replace(array('<', '>'), array('<', '>'), $t)); } if(isset($cS[$in])){$inOk = $cS[$in];} elseif(isset($cI[$in])){$inOk = $eI; $cI['del'] = 1; $cI['ins'] = 1;} elseif(isset($cF[$in])){$inOk = $eF; unset($cI['del'], $cI['ins']);} elseif(isset($cB[$in])){$inOk = $eB; unset($cI['del'], $cI['ins']);} if(isset($cO[$in])){$inOk = $inOk + $cO[$in];} if(isset($cN[$in])){$inOk = array_diff_assoc($inOk, $cN[$in]);} $t = explode('<', $t); $ok = $q = array(); // $q seq list of open non-empty ele ob_start(); for($i=-1, $ci=count($t); ++$i<$ci;){ // allowed $ok in parent $p if($ql = count($q)){ $p = array_pop($q); $q[] = $p; if(isset($cS[$p])){$ok = $cS[$p];} elseif(isset($cI[$p])){$ok = $eI; $cI['del'] = 1; $cI['ins'] = 1;} elseif(isset($cF[$p])){$ok = $eF; unset($cI['del'], $cI['ins']);} elseif(isset($cB[$p])){$ok = $eB; unset($cI['del'], $cI['ins']);} if(isset($cO[$p])){$ok = $ok + $cO[$p];} if(isset($cN[$p])){$ok = array_diff_assoc($ok, $cN[$p]);} }else{$ok = $inOk; unset($cI['del'], $cI['ins']);} // bad tags, & ele content if(isset($e) && ($do == 1 or (isset($ok['#pcdata']) && ($do == 3 or $do == 5)))){ echo '<', $s, $e, $a, '>'; } if(isset($x[0])){ if(strlen(trim($x)) && (($ql && isset($cB[$p])) or (isset($cB[$in]) && !$ql))){ echo '
    ', $x, '
    '; } elseif($do < 3 or isset($ok['#pcdata'])){echo $x;} elseif(strpos($x, "\x02\x04")){ foreach(preg_split('`(\x01\x02[^\x01\x02]+\x02\x01)`', $x, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY) as $v){ echo (substr($v, 0, 2) == "\x01\x02" ? $v : ($do > 4 ? preg_replace('`\S`', '', $v) : '')); } }elseif($do > 4){echo preg_replace('`\S`', '', $x);} } // get markup if(!preg_match('`^(/?)([a-z1-6]+)([^>]*)>(.*)`sm', $t[$i], $r)){$x = $t[$i]; continue;} $s = null; $e = null; $a = null; $x = null; list($all, $s, $e, $a, $x) = $r; // close tag if($s){ if(isset($cE[$e]) or !in_array($e, $q)){continue;} // Empty/unopen if($p == $e){array_pop($q); echo ''; unset($e); continue;} // Last open $add = ''; // Nesting - close open tags that need to be for($j=-1, $cj=count($q); ++$j<$cj;){ if(($d = array_pop($q)) == $e){break;} else{$add .= "";} } echo $add, ''; unset($e); continue; } // open tag // $cB ele needs $eB ele as child if(isset($cB[$e]) && strlen(trim($x))){ $t[$i] = "{$e}{$a}>"; array_splice($t, $i+1, 0, 'div>'. $x); unset($e, $x); ++$ci; --$i; continue; } if((($ql && isset($cB[$p])) or (isset($cB[$in]) && !$ql)) && !isset($eB[$e]) && !isset($ok[$e])){ array_splice($t, $i, 0, 'div>'); unset($e, $x); ++$ci; --$i; continue; } // if no open ele, $in = parent; mostly immediate parent-child relation should hold if(!$ql or !isset($eN[$e]) or !array_intersect($q, $cN2)){ if(!isset($ok[$e])){ if($ql && isset($cT[$p])){echo ''; unset($e, $x); --$i;} continue; } if(!isset($cE[$e])){$q[] = $e;} echo '<', $e, $a, '>'; unset($e); continue; } // specific parent-child if(isset($cS[$p][$e])){ if(!isset($cE[$e])){$q[] = $e;} echo '<', $e, $a, '>'; unset($e); continue; } // nesting $add = ''; $q2 = array(); for($k=-1, $kc=count($q); ++$k<$kc;){ $d = $q[$k]; $ok2 = array(); if(isset($cS[$d])){$q2[] = $d; continue;} $ok2 = isset($cI[$d]) ? $eI : $eF; if(isset($cO[$d])){$ok2 = $ok2 + $cO[$d];} if(isset($cN[$d])){$ok2 = array_diff_assoc($ok2, $cN[$d]);} if(!isset($ok2[$e])){ if(!$k && !isset($inOk[$e])){continue 2;} $add = ""; for(;++$k<$kc;){$add = "{$add}";} break; } else{$q2[] = $d;} } $q = $q2; if(!isset($cE[$e])){$q[] = $e;} echo $add, '<', $e, $a, '>'; unset($e); continue; } // end if($ql = count($q)){ $p = array_pop($q); $q[] = $p; if(isset($cS[$p])){$ok = $cS[$p];} elseif(isset($cI[$p])){$ok = $eI; $cI['del'] = 1; $cI['ins'] = 1;} elseif(isset($cF[$p])){$ok = $eF; unset($cI['del'], $cI['ins']);} elseif(isset($cB[$p])){$ok = $eB; unset($cI['del'], $cI['ins']);} if(isset($cO[$p])){$ok = $ok + $cO[$p];} if(isset($cN[$p])){$ok = array_diff_assoc($ok, $cN[$p]);} }else{$ok = $inOk; unset($cI['del'], $cI['ins']);} if(isset($e) && ($do == 1 or (isset($ok['#pcdata']) && ($do == 3 or $do == 5)))){ echo '<', $s, $e, $a, '>'; } if(isset($x[0])){ if(strlen(trim($x)) && (($ql && isset($cB[$p])) or (isset($cB[$in]) && !$ql))){ echo '
    ', $x, '
    '; } elseif($do < 3 or isset($ok['#pcdata'])){echo $x;} elseif(strpos($x, "\x02\x04")){ foreach(preg_split('`(\x01\x02[^\x01\x02]+\x02\x01)`', $x, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY) as $v){ echo (substr($v, 0, 2) == "\x01\x02" ? $v : ($do > 4 ? preg_replace('`\S`', '', $v) : '')); } }elseif($do > 4){echo preg_replace('`\S`', '', $x);} } while(!empty($q) && ($e = array_pop($q))){echo '';} $o = ob_get_contents(); ob_end_clean(); return $o; // eof } function hl_cmtcd($t){ // comment/CDATA sec handler $t = $t[0]; global $C; if(!($v = $C[$n = $t[3] == '-' ? 'comment' : 'cdata'])){return $t;} if($v == 1){return '';} if($n == 'comment'){ if(substr(($t = preg_replace('`--+`', '-', substr($t, 4, -3))), -1) != ' '){$t .= ' ';} } else{$t = substr($t, 1, -1);} $t = $v == 2 ? str_replace(array('&', '<', '>'), array('&', '<', '>'), $t) : $t; return str_replace(array('&', '<', '>'), array("\x03", "\x04", "\x05"), ($n == 'comment' ? "\x01\x02\x04!--$t--\x05\x02\x01" : "\x01\x01\x04$t\x05\x01\x01")); // eof } function hl_ent($t){ // entitity handler global $C; $t = $t[1]; static $U = array('quot'=>1,'amp'=>1,'lt'=>1,'gt'=>1); static $N = array('fnof'=>'402', 'Alpha'=>'913', 'Beta'=>'914', 'Gamma'=>'915', 'Delta'=>'916', 'Epsilon'=>'917', 'Zeta'=>'918', 'Eta'=>'919', 'Theta'=>'920', 'Iota'=>'921', 'Kappa'=>'922', 'Lambda'=>'923', 'Mu'=>'924', 'Nu'=>'925', 'Xi'=>'926', 'Omicron'=>'927', 'Pi'=>'928', 'Rho'=>'929', 'Sigma'=>'931', 'Tau'=>'932', 'Upsilon'=>'933', 'Phi'=>'934', 'Chi'=>'935', 'Psi'=>'936', 'Omega'=>'937', 'alpha'=>'945', 'beta'=>'946', 'gamma'=>'947', 'delta'=>'948', 'epsilon'=>'949', 'zeta'=>'950', 'eta'=>'951', 'theta'=>'952', 'iota'=>'953', 'kappa'=>'954', 'lambda'=>'955', 'mu'=>'956', 'nu'=>'957', 'xi'=>'958', 'omicron'=>'959', 'pi'=>'960', 'rho'=>'961', 'sigmaf'=>'962', 'sigma'=>'963', 'tau'=>'964', 'upsilon'=>'965', 'phi'=>'966', 'chi'=>'967', 'psi'=>'968', 'omega'=>'969', 'thetasym'=>'977', 'upsih'=>'978', 'piv'=>'982', 'bull'=>'8226', 'hellip'=>'8230', 'prime'=>'8242', 'Prime'=>'8243', 'oline'=>'8254', 'frasl'=>'8260', 'weierp'=>'8472', 'image'=>'8465', 'real'=>'8476', 'trade'=>'8482', 'alefsym'=>'8501', 'larr'=>'8592', 'uarr'=>'8593', 'rarr'=>'8594', 'darr'=>'8595', 'harr'=>'8596', 'crarr'=>'8629', 'lArr'=>'8656', 'uArr'=>'8657', 'rArr'=>'8658', 'dArr'=>'8659', 'hArr'=>'8660', 'forall'=>'8704', 'part'=>'8706', 'exist'=>'8707', 'empty'=>'8709', 'nabla'=>'8711', 'isin'=>'8712', 'notin'=>'8713', 'ni'=>'8715', 'prod'=>'8719', 'sum'=>'8721', 'minus'=>'8722', 'lowast'=>'8727', 'radic'=>'8730', 'prop'=>'8733', 'infin'=>'8734', 'ang'=>'8736', 'and'=>'8743', 'or'=>'8744', 'cap'=>'8745', 'cup'=>'8746', 'int'=>'8747', 'there4'=>'8756', 'sim'=>'8764', 'cong'=>'8773', 'asymp'=>'8776', 'ne'=>'8800', 'equiv'=>'8801', 'le'=>'8804', 'ge'=>'8805', 'sub'=>'8834', 'sup'=>'8835', 'nsub'=>'8836', 'sube'=>'8838', 'supe'=>'8839', 'oplus'=>'8853', 'otimes'=>'8855', 'perp'=>'8869', 'sdot'=>'8901', 'lceil'=>'8968', 'rceil'=>'8969', 'lfloor'=>'8970', 'rfloor'=>'8971', 'lang'=>'9001', 'rang'=>'9002', 'loz'=>'9674', 'spades'=>'9824', 'clubs'=>'9827', 'hearts'=>'9829', 'diams'=>'9830', 'apos'=>'39', 'OElig'=>'338', 'oelig'=>'339', 'Scaron'=>'352', 'scaron'=>'353', 'Yuml'=>'376', 'circ'=>'710', 'tilde'=>'732', 'ensp'=>'8194', 'emsp'=>'8195', 'thinsp'=>'8201', 'zwnj'=>'8204', 'zwj'=>'8205', 'lrm'=>'8206', 'rlm'=>'8207', 'ndash'=>'8211', 'mdash'=>'8212', 'lsquo'=>'8216', 'rsquo'=>'8217', 'sbquo'=>'8218', 'ldquo'=>'8220', 'rdquo'=>'8221', 'bdquo'=>'8222', 'dagger'=>'8224', 'Dagger'=>'8225', 'permil'=>'8240', 'lsaquo'=>'8249', 'rsaquo'=>'8250', 'euro'=>'8364', 'nbsp'=>'160', 'iexcl'=>'161', 'cent'=>'162', 'pound'=>'163', 'curren'=>'164', 'yen'=>'165', 'brvbar'=>'166', 'sect'=>'167', 'uml'=>'168', 'copy'=>'169', 'ordf'=>'170', 'laquo'=>'171', 'not'=>'172', 'shy'=>'173', 'reg'=>'174', 'macr'=>'175', 'deg'=>'176', 'plusmn'=>'177', 'sup2'=>'178', 'sup3'=>'179', 'acute'=>'180', 'micro'=>'181', 'para'=>'182', 'middot'=>'183', 'cedil'=>'184', 'sup1'=>'185', 'ordm'=>'186', 'raquo'=>'187', 'frac14'=>'188', 'frac12'=>'189', 'frac34'=>'190', 'iquest'=>'191', 'Agrave'=>'192', 'Aacute'=>'193', 'Acirc'=>'194', 'Atilde'=>'195', 'Auml'=>'196', 'Aring'=>'197', 'AElig'=>'198', 'Ccedil'=>'199', 'Egrave'=>'200', 'Eacute'=>'201', 'Ecirc'=>'202', 'Euml'=>'203', 'Igrave'=>'204', 'Iacute'=>'205', 'Icirc'=>'206', 'Iuml'=>'207', 'ETH'=>'208', 'Ntilde'=>'209', 'Ograve'=>'210', 'Oacute'=>'211', 'Ocirc'=>'212', 'Otilde'=>'213', 'Ouml'=>'214', 'times'=>'215', 'Oslash'=>'216', 'Ugrave'=>'217', 'Uacute'=>'218', 'Ucirc'=>'219', 'Uuml'=>'220', 'Yacute'=>'221', 'THORN'=>'222', 'szlig'=>'223', 'agrave'=>'224', 'aacute'=>'225', 'acirc'=>'226', 'atilde'=>'227', 'auml'=>'228', 'aring'=>'229', 'aelig'=>'230', 'ccedil'=>'231', 'egrave'=>'232', 'eacute'=>'233', 'ecirc'=>'234', 'euml'=>'235', 'igrave'=>'236', 'iacute'=>'237', 'icirc'=>'238', 'iuml'=>'239', 'eth'=>'240', 'ntilde'=>'241', 'ograve'=>'242', 'oacute'=>'243', 'ocirc'=>'244', 'otilde'=>'245', 'ouml'=>'246', 'divide'=>'247', 'oslash'=>'248', 'ugrave'=>'249', 'uacute'=>'250', 'ucirc'=>'251', 'uuml'=>'252', 'yacute'=>'253', 'thorn'=>'254', 'yuml'=>'255'); if($t[0] != '#'){ return ($C['and_mark'] ? "\x06" : '&'). (isset($U[$t]) ? $t : (isset($N[$t]) ? (!$C['named_entity'] ? '#'. ($C['hexdec_entity'] > 1 ? 'x'. dechex($N[$t]) : $N[$t]) : $t) : 'amp;'. $t)). ';'; } if(($n = ctype_digit($t = substr($t, 1)) ? intval($t) : hexdec(substr($t, 1))) < 9 or ($n > 13 && $n < 32) or $n == 11 or $n == 12 or ($n > 126 && $n < 160 && $n != 133) or ($n > 55295 && ($n < 57344 or ($n > 64975 && $n < 64992) or $n == 65534 or $n == 65535 or $n > 1114111))){ return ($C['and_mark'] ? "\x06" : '&'). "amp;#{$t};"; } return ($C['and_mark'] ? "\x06" : '&'). '#'. (((ctype_digit($t) && $C['hexdec_entity'] < 2) or !$C['hexdec_entity']) ? $n : 'x'. dechex($n)). ';'; // eof } function hl_prot($p, $c=null){ // check URL scheme global $C; $b = $a = ''; if($c == null){$c = 'style'; $b = $p[1]; $a = $p[3]; $p = trim($p[2]);} $c = isset($C['schemes'][$c]) ? $C['schemes'][$c] : $C['schemes']['*']; static $d = 'denied:'; if(isset($c['!']) && substr($p, 0, 7) != $d){$p = "$d$p";} if(isset($c['*']) or !strcspn($p, '#?;') or (substr($p, 0, 7) == $d)){return "{$b}{$p}{$a}";} // All ok, frag, query, param if(preg_match('`^([^:?[@!$()*,=/\'\]]+?)(:|&#(58|x3a);|%3a|\\\\0{0,4}3a).`i', $p, $m) && !isset($c[strtolower($m[1])])){ // Denied prot return "{$b}{$d}{$p}{$a}"; } if($C['abs_url']){ if($C['abs_url'] == -1 && strpos($p, $C['base_url']) === 0){ // Make url rel $p = substr($p, strlen($C['base_url'])); }elseif(empty($m[1])){ // Make URL abs if(substr($p, 0, 2) == '//'){$p = substr($C['base_url'], 0, strpos($C['base_url'], ':')+1). $p;} elseif($p[0] == '/'){$p = preg_replace('`(^.+?://[^/]+)(.*)`', '$1', $C['base_url']). $p;} elseif(strcspn($p, './')){$p = $C['base_url']. $p;} else{ preg_match('`^([a-zA-Z\d\-+.]+://[^/]+)(.*)`', $C['base_url'], $m); $p = preg_replace('`(?<=/)\./`', '', $m[2]. $p); while(preg_match('`(?<=/)([^/]{3,}|[^/.]+?|\.[^/.]|[^/.]\.)/\.\./`', $p)){ $p = preg_replace('`(?<=/)([^/]{3,}|[^/.]+?|\.[^/.]|[^/.]\.)/\.\./`', '', $p); } $p = $m[1]. $p; } } } return "{$b}{$p}{$a}"; // eof } function hl_regex($p){ // ?regex if(empty($p)){return 0;} if($t = ini_get('track_errors')){$o = isset($php_errormsg) ? $php_errormsg : null;} else{ini_set('track_errors', 1);} unset($php_errormsg); if(($d = ini_get('display_errors'))){ini_set('display_errors', 0);} preg_match($p, ''); if($d){ini_set('display_errors', 1);} $r = isset($php_errormsg) ? 0 : 1; if($t){$php_errormsg = isset($o) ? $o : null;} else{ini_set('track_errors', 0);} return $r; // eof } function hl_spec($t){ // final $spec $s = array(); $t = str_replace(array("\t", "\r", "\n", ' '), '', preg_replace('/"(?>(`.|[^"])*)"/sme', 'substr(str_replace(array(";", "|", "~", " ", ",", "/", "(", ")", \'`"\'), array("\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", "\x08", "\""), "$0"), 1, -1)', trim($t))); for($i = count(($t = explode(';', $t))); --$i>=0;){ $w = $t[$i]; if(empty($w) or ($e = strpos($w, '=')) === false or !strlen(($a = substr($w, $e+1)))){continue;} $y = $n = array(); foreach(explode(',', $a) as $v){ if(!preg_match('`^([a-z:\-\*]+)(?:\((.*?)\))?`i', $v, $m)){continue;} if(($x = strtolower($m[1])) == '-*'){$n['*'] = 1; continue;} if($x[0] == '-'){$n[substr($x, 1)] = 1; continue;} if(!isset($m[2])){$y[$x] = 1; continue;} foreach(explode('/', $m[2]) as $m){ if(empty($m) or ($p = strpos($m, '=')) == 0 or $p < 5){$y[$x] = 1; continue;} $y[$x][strtolower(substr($m, 0, $p))] = str_replace(array("\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", "\x08"), array(";", "|", "~", " ", ",", "/", "(", ")"), substr($m, $p+1)); } if(isset($y[$x]['match']) && !hl_regex($y[$x]['match'])){unset($y[$x]['match']);} if(isset($y[$x]['nomatch']) && !hl_regex($y[$x]['nomatch'])){unset($y[$x]['nomatch']);} } if(!count($y) && !count($n)){continue;} foreach(explode(',', substr($w, 0, $e)) as $v){ if(!strlen(($v = strtolower($v)))){continue;} if(count($y)){$s[$v] = $y;} if(count($n)){$s[$v]['n'] = $n;} } } return $s; // eof } function hl_tag($t){ // tag/attribute handler global $C; $t = $t[0]; // invalid < > if($t == '< '){return '< ';} if($t == '>'){return '>';} if(!preg_match('`^<(/?)([a-zA-Z][a-zA-Z1-6]*)([^>]*?)\s?>$`m', $t, $m)){ return str_replace(array('<', '>'), array('<', '>'), $t); }elseif(!isset($C['elements'][($e = strtolower($m[2]))])){ return (($C['keep_bad']%2) ? str_replace(array('<', '>'), array('<', '>'), $t) : ''); } // attr string $a = str_replace(array("\n", "\r", "\t"), ' ', trim($m[3])); // tag transform static $eD = array('applet'=>1, 'center'=>1, 'dir'=>1, 'embed'=>1, 'font'=>1, 'isindex'=>1, 'menu'=>1, 's'=>1, 'strike'=>1, 'u'=>1); // Deprecated if($C['make_tag_strict'] && isset($eD[$e])){ $trt = hl_tag2($e, $a, $C['make_tag_strict']); if(!$e){return (($C['keep_bad']%2) ? str_replace(array('<', '>'), array('<', '>'), $t) : '');} } // close tag static $eE = array('area'=>1, 'br'=>1, 'col'=>1, 'embed'=>1, 'hr'=>1, 'img'=>1, 'input'=>1, 'isindex'=>1, 'param'=>1); // Empty ele if(!empty($m[1])){ return (!isset($eE[$e]) ? (empty($C['hook_tag']) ? "" : $C['hook_tag']($e)) : (($C['keep_bad'])%2 ? str_replace(array('<', '>'), array('<', '>'), $t) : '')); } // open tag & attr static $aN = array('abbr'=>array('td'=>1, 'th'=>1), 'accept-charset'=>array('form'=>1), 'accept'=>array('form'=>1, 'input'=>1), 'accesskey'=>array('a'=>1, 'area'=>1, 'button'=>1, 'input'=>1, 'label'=>1, 'legend'=>1, 'textarea'=>1), 'action'=>array('form'=>1), 'align'=>array('caption'=>1, 'embed'=>1, 'applet'=>1, 'iframe'=>1, 'img'=>1, 'input'=>1, 'object'=>1, 'legend'=>1, 'table'=>1, 'hr'=>1, 'div'=>1, 'h1'=>1, 'h2'=>1, 'h3'=>1, 'h4'=>1, 'h5'=>1, 'h6'=>1, 'p'=>1, 'col'=>1, 'colgroup'=>1, 'tbody'=>1, 'td'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1), 'alt'=>array('applet'=>1, 'area'=>1, 'img'=>1, 'input'=>1), 'archive'=>array('applet'=>1, 'object'=>1), 'axis'=>array('td'=>1, 'th'=>1), 'bgcolor'=>array('embed'=>1, 'table'=>1, 'tr'=>1, 'td'=>1, 'th'=>1), 'border'=>array('table'=>1, 'img'=>1, 'object'=>1), 'bordercolor'=>array('table'=>1, 'td'=>1, 'tr'=>1), 'cellpadding'=>array('table'=>1), 'cellspacing'=>array('table'=>1), 'char'=>array('col'=>1, 'colgroup'=>1, 'tbody'=>1, 'td'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1), 'charoff'=>array('col'=>1, 'colgroup'=>1, 'tbody'=>1, 'td'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1), 'charset'=>array('a'=>1, 'script'=>1), 'checked'=>array('input'=>1), 'cite'=>array('blockquote'=>1, 'q'=>1, 'del'=>1, 'ins'=>1), 'classid'=>array('object'=>1), 'clear'=>array('br'=>1), 'code'=>array('applet'=>1), 'codebase'=>array('object'=>1, 'applet'=>1), 'codetype'=>array('object'=>1), 'color'=>array('font'=>1), 'cols'=>array('textarea'=>1), 'colspan'=>array('td'=>1, 'th'=>1), 'compact'=>array('dir'=>1, 'dl'=>1, 'menu'=>1, 'ol'=>1, 'ul'=>1), 'coords'=>array('area'=>1, 'a'=>1), 'data'=>array('object'=>1), 'datetime'=>array('del'=>1, 'ins'=>1), 'declare'=>array('object'=>1), 'defer'=>array('script'=>1), 'dir'=>array('bdo'=>1), 'disabled'=>array('button'=>1, 'input'=>1, 'optgroup'=>1, 'option'=>1, 'select'=>1, 'textarea'=>1), 'enctype'=>array('form'=>1), 'face'=>array('font'=>1), 'flashvars'=>array('embed'=>1), 'for'=>array('label'=>1), 'frame'=>array('table'=>1), 'frameborder'=>array('iframe'=>1), 'headers'=>array('td'=>1, 'th'=>1), 'height'=>array('embed'=>1, 'iframe'=>1, 'td'=>1, 'th'=>1, 'img'=>1, 'object'=>1, 'applet'=>1), 'href'=>array('a'=>1, 'area'=>1), 'hreflang'=>array('a'=>1), 'hspace'=>array('applet'=>1, 'img'=>1, 'object'=>1), 'ismap'=>array('img'=>1, 'input'=>1), 'label'=>array('option'=>1, 'optgroup'=>1), 'language'=>array('script'=>1), 'longdesc'=>array('img'=>1, 'iframe'=>1), 'marginheight'=>array('iframe'=>1), 'marginwidth'=>array('iframe'=>1), 'maxlength'=>array('input'=>1), 'method'=>array('form'=>1), 'model'=>array('embed'=>1), 'multiple'=>array('select'=>1), 'name'=>array('button'=>1, 'embed'=>1, 'textarea'=>1, 'applet'=>1, 'select'=>1, 'form'=>1, 'iframe'=>1, 'img'=>1, 'a'=>1, 'input'=>1, 'object'=>1, 'map'=>1, 'param'=>1), 'nohref'=>array('area'=>1), 'noshade'=>array('hr'=>1), 'nowrap'=>array('td'=>1, 'th'=>1), 'object'=>array('applet'=>1), 'onblur'=>array('a'=>1, 'area'=>1, 'button'=>1, 'input'=>1, 'label'=>1, 'select'=>1, 'textarea'=>1), 'onchange'=>array('input'=>1, 'select'=>1, 'textarea'=>1), 'onfocus'=>array('a'=>1, 'area'=>1, 'button'=>1, 'input'=>1, 'label'=>1, 'select'=>1, 'textarea'=>1), 'onreset'=>array('form'=>1), 'onselect'=>array('input'=>1, 'textarea'=>1), 'onsubmit'=>array('form'=>1), 'pluginspage'=>array('embed'=>1), 'pluginurl'=>array('embed'=>1), 'prompt'=>array('isindex'=>1), 'readonly'=>array('textarea'=>1, 'input'=>1), 'rel'=>array('a'=>1), 'rev'=>array('a'=>1), 'rows'=>array('textarea'=>1), 'rowspan'=>array('td'=>1, 'th'=>1), 'rules'=>array('table'=>1), 'scope'=>array('td'=>1, 'th'=>1), 'scrolling'=>array('iframe'=>1), 'selected'=>array('option'=>1), 'shape'=>array('area'=>1, 'a'=>1), 'size'=>array('hr'=>1, 'font'=>1, 'input'=>1, 'select'=>1), 'span'=>array('col'=>1, 'colgroup'=>1), 'src'=>array('embed'=>1, 'script'=>1, 'input'=>1, 'iframe'=>1, 'img'=>1), 'standby'=>array('object'=>1), 'start'=>array('ol'=>1), 'summary'=>array('table'=>1), 'tabindex'=>array('a'=>1, 'area'=>1, 'button'=>1, 'input'=>1, 'object'=>1, 'select'=>1, 'textarea'=>1), 'target'=>array('a'=>1, 'area'=>1, 'form'=>1), 'type'=>array('a'=>1, 'embed'=>1, 'object'=>1, 'param'=>1, 'script'=>1, 'input'=>1, 'li'=>1, 'ol'=>1, 'ul'=>1, 'button'=>1), 'usemap'=>array('img'=>1, 'input'=>1, 'object'=>1), 'valign'=>array('col'=>1, 'colgroup'=>1, 'tbody'=>1, 'td'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1), 'value'=>array('input'=>1, 'option'=>1, 'param'=>1, 'button'=>1, 'li'=>1), 'valuetype'=>array('param'=>1), 'vspace'=>array('applet'=>1, 'img'=>1, 'object'=>1), 'width'=>array('embed'=>1, 'hr'=>1, 'iframe'=>1, 'img'=>1, 'object'=>1, 'table'=>1, 'td'=>1, 'th'=>1, 'applet'=>1, 'col'=>1, 'colgroup'=>1, 'pre'=>1), 'wmode'=>array('embed'=>1), 'xml:space'=>array('pre'=>1, 'script'=>1, 'style'=>1)); // Ele-specific static $aNE = array('checked'=>1, 'compact'=>1, 'declare'=>1, 'defer'=>1, 'disabled'=>1, 'ismap'=>1, 'multiple'=>1, 'nohref'=>1, 'noresize'=>1, 'noshade'=>1, 'nowrap'=>1, 'readonly'=>1, 'selected'=>1); // Empty static $aNP = array('action'=>1, 'cite'=>1, 'classid'=>1, 'codebase'=>1, 'data'=>1, 'href'=>1, 'longdesc'=>1, 'model'=>1, 'pluginspage'=>1, 'pluginurl'=>1, 'usemap'=>1); // Need scheme check; excludes style, on* & src static $aNU = array('class'=>array('param'=>1, 'script'=>1), 'dir'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'iframe'=>1, 'param'=>1, 'script'=>1), 'id'=>array('script'=>1), 'lang'=>array('applet'=>1, 'br'=>1, 'iframe'=>1, 'param'=>1, 'script'=>1), 'xml:lang'=>array('applet'=>1, 'br'=>1, 'iframe'=>1, 'param'=>1, 'script'=>1), 'onclick'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'ondblclick'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onkeydown'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onkeypress'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onkeyup'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onmousedown'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onmousemove'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onmouseout'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onmouseover'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onmouseup'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'style'=>array('param'=>1, 'script'=>1), 'title'=>array('param'=>1, 'script'=>1)); // Univ & exceptions if($C['lc_std_val']){ // predef attr vals for $eAL & $aNE ele static $aNL = array('all'=>1, 'baseline'=>1, 'bottom'=>1, 'button'=>1, 'center'=>1, 'char'=>1, 'checkbox'=>1, 'circle'=>1, 'col'=>1, 'colgroup'=>1, 'cols'=>1, 'data'=>1, 'default'=>1, 'file'=>1, 'get'=>1, 'groups'=>1, 'hidden'=>1, 'image'=>1, 'justify'=>1, 'left'=>1, 'ltr'=>1, 'middle'=>1, 'none'=>1, 'object'=>1, 'password'=>1, 'poly'=>1, 'post'=>1, 'preserve'=>1, 'radio'=>1, 'rect'=>1, 'ref'=>1, 'reset'=>1, 'right'=>1, 'row'=>1, 'rowgroup'=>1, 'rows'=>1, 'rtl'=>1, 'submit'=>1, 'text'=>1, 'top'=>1); static $eAL = array('a'=>1, 'area'=>1, 'bdo'=>1, 'button'=>1, 'col'=>1, 'form'=>1, 'img'=>1, 'input'=>1, 'object'=>1, 'optgroup'=>1, 'option'=>1, 'param'=>1, 'script'=>1, 'select'=>1, 'table'=>1, 'td'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1, 'xml:space'=>1); $lcase = isset($eAL[$e]) ? 1 : 0; } $depTr = 0; if($C['no_deprecated_attr']){ // dep attr:applicable ele static $aND = array('align'=>array('caption'=>1, 'div'=>1, 'h1'=>1, 'h2'=>1, 'h3'=>1, 'h4'=>1, 'h5'=>1, 'h6'=>1, 'hr'=>1, 'img'=>1, 'input'=>1, 'legend'=>1, 'object'=>1, 'p'=>1, 'table'=>1), 'bgcolor'=>array('table'=>1, 'td'=>1, 'th'=>1, 'tr'=>1), 'border'=>array('img'=>1, 'object'=>1), 'bordercolor'=>array('table'=>1, 'td'=>1, 'tr'=>1), 'clear'=>array('br'=>1), 'compact'=>array('dl'=>1, 'ol'=>1, 'ul'=>1), 'height'=>array('td'=>1, 'th'=>1), 'hspace'=>array('img'=>1, 'object'=>1), 'language'=>array('script'=>1), 'name'=>array('a'=>1, 'form'=>1, 'iframe'=>1, 'img'=>1, 'map'=>1), 'noshade'=>array('hr'=>1), 'nowrap'=>array('td'=>1, 'th'=>1), 'size'=>array('hr'=>1), 'start'=>array('ol'=>1), 'type'=>array('li'=>1, 'ol'=>1, 'ul'=>1), 'value'=>array('li'=>1), 'vspace'=>array('img'=>1, 'object'=>1), 'width'=>array('hr'=>1, 'pre'=>1, 'td'=>1, 'th'=>1)); static $eAD = array('a'=>1, 'br'=>1, 'caption'=>1, 'div'=>1, 'dl'=>1, 'form'=>1, 'h1'=>1, 'h2'=>1, 'h3'=>1, 'h4'=>1, 'h5'=>1, 'h6'=>1, 'hr'=>1, 'iframe'=>1, 'img'=>1, 'input'=>1, 'legend'=>1, 'li'=>1, 'map'=>1, 'object'=>1, 'ol'=>1, 'p'=>1, 'pre'=>1, 'script'=>1, 'table'=>1, 'td'=>1, 'th'=>1, 'tr'=>1, 'ul'=>1); $depTr = isset($eAD[$e]) ? 1 : 0; } // attr name-vals if(strpos($a, "\x01") !== false){$a = preg_replace('`\x01[^\x01]*\x01`', '', $a);} // No comment/CDATA sec $mode = 0; $a = trim($a, ' /'); $aA = array(); while(strlen($a)){ $w = 0; switch($mode){ case 0: // Name if(preg_match('`^[a-zA-Z][\-a-zA-Z:]+`', $a, $m)){ $nm = strtolower($m[0]); $w = $mode = 1; $a = ltrim(substr_replace($a, '', 0, strlen($m[0]))); } break; case 1: if($a[0] == '='){ // = $w = 1; $mode = 2; $a = ltrim($a, '= '); }else{ // No val $w = 1; $mode = 0; $a = ltrim($a); $aA[$nm] = ''; } break; case 2: // Val if(preg_match('`^((?:"[^"]*")|(?:\'[^\']*\')|(?:\s*[^\s"\']+))(.*)`', $a, $m)){ $a = ltrim($m[2]); $m = $m[1]; $w = 1; $mode = 0; $aA[$nm] = trim(($m[0] == '"' or $m[0] == '\'') ? substr($m, 1, -1) : $m); } break; } if($w == 0){ // Parse errs, deal with space, " & ' $a = preg_replace('`^(?:"[^"]*("|$)|\'[^\']*(\'|$)|\S)*\s*`', '', $a); $mode = 0; } } if($mode == 1){$aA[$nm] = '';} // clean attrs global $S; $rl = isset($S[$e]) ? $S[$e] : array(); $a = array(); $nfr = 0; foreach($aA as $k=>$v){ if(((isset($C['deny_attribute']['*']) ? isset($C['deny_attribute'][$k]) : !isset($C['deny_attribute'][$k])) && (isset($aN[$k][$e]) or (isset($aNU[$k]) && !isset($aNU[$k][$e]))) && !isset($rl['n'][$k]) && !isset($rl['n']['*'])) or isset($rl[$k])){ if(isset($aNE[$k])){$v = $k;} elseif(!empty($lcase) && (($e != 'button' or $e != 'input') or $k == 'type')){ // Rather loose but ?not cause issues $v = (isset($aNL[($v2 = strtolower($v))])) ? $v2 : $v; } if($k == 'style' && !$C['style_pass']){ if(false !== strpos($v, '&#')){ static $sC = array(' '=>' ', ' '=>' ', 'E'=>'e', 'E'=>'e', 'e'=>'e', 'e'=>'e', 'X'=>'x', 'X'=>'x', 'x'=>'x', 'x'=>'x', 'P'=>'p', 'P'=>'p', 'p'=>'p', 'p'=>'p', 'S'=>'s', 'S'=>'s', 's'=>'s', 's'=>'s', 'I'=>'i', 'I'=>'i', 'i'=>'i', 'i'=>'i', 'O'=>'o', 'O'=>'o', 'o'=>'o', 'o'=>'o', 'N'=>'n', 'N'=>'n', 'n'=>'n', 'n'=>'n', 'U'=>'u', 'U'=>'u', 'u'=>'u', 'u'=>'u', 'R'=>'r', 'R'=>'r', 'r'=>'r', 'r'=>'r', 'L'=>'l', 'L'=>'l', 'l'=>'l', 'l'=>'l', '('=>'(', '('=>'(', ')'=>')', ')'=>')', ' '=>':', ' '=>':', '"'=>'"', '"'=>'"', '''=>"'", '''=>"'", '/'=>'/', '/'=>'/', '*'=>'*', '*'=>'*', '\'=>'\\', '\'=>'\\'); $v = strtr($v, $sC); } $v = preg_replace_callback('`(url(?:\()(?: )*(?:\'|"|&(?:quot|apos);)?)(.+?)((?:\'|"|&(?:quot|apos);)?(?: )*(?:\)))`iS', 'hl_prot', $v); $v = !$C['css_expression'] ? preg_replace('`expression`i', ' ', preg_replace('`\\\\\S|(/|(%2f))(\*|(%2a))`i', ' ', $v)) : $v; }elseif(isset($aNP[$k]) or strpos($k, 'src') !== false or $k[0] == 'o'){ $v = str_replace("\xad", ' ', (strpos($v, '&') !== false ? str_replace(array('­', '­', '­'), ' ', $v) : $v)); $v = hl_prot($v, $k); if($k == 'href'){ // X-spam if($C['anti_mail_spam'] && strpos($v, 'mailto:') === 0){ $v = str_replace('@', htmlspecialchars($C['anti_mail_spam']), $v); }elseif($C['anti_link_spam']){ $r1 = $C['anti_link_spam'][1]; if(!empty($r1) && preg_match($r1, $v)){continue;} $r0 = $C['anti_link_spam'][0]; if(!empty($r0) && preg_match($r0, $v)){ if(isset($a['rel'])){ if(!preg_match('`\bnofollow\b`i', $a['rel'])){$a['rel'] .= ' nofollow';} }elseif(isset($aA['rel'])){ if(!preg_match('`\bnofollow\b`i', $aA['rel'])){$nfr = 1;} }else{$a['rel'] = 'nofollow';} } } } } if(isset($rl[$k]) && is_array($rl[$k]) && ($v = hl_attrval($v, $rl[$k])) === 0){continue;} $a[$k] = str_replace('"', '"', $v); } } if($nfr){$a['rel'] = isset($a['rel']) ? $a['rel']. ' nofollow' : 'nofollow';} // rqd attr static $eAR = array('area'=>array('alt'=>'area'), 'bdo'=>array('dir'=>'ltr'), 'form'=>array('action'=>''), 'img'=>array('src'=>'', 'alt'=>'image'), 'map'=>array('name'=>''), 'optgroup'=>array('label'=>''), 'param'=>array('name'=>''), 'script'=>array('type'=>'text/javascript'), 'textarea'=>array('rows'=>'10', 'cols'=>'50')); if(isset($eAR[$e])){ foreach($eAR[$e] as $k=>$v){ if(!isset($a[$k])){$a[$k] = isset($v[0]) ? $v : $k;} } } // depr attrs if($depTr){ $c = array(); foreach($a as $k=>$v){ if($k == 'style' or !isset($aND[$k][$e])){continue;} if($k == 'align'){ unset($a['align']); if($e == 'img' && ($v == 'left' or $v == 'right')){$c[] = 'float: '. $v;} elseif(($e == 'div' or $e == 'table') && $v == 'center'){$c[] = 'margin: auto';} else{$c[] = 'text-align: '. $v;} }elseif($k == 'bgcolor'){ unset($a['bgcolor']); $c[] = 'background-color: '. $v; }elseif($k == 'border'){ unset($a['border']); $c[] = "border: {$v}px"; }elseif($k == 'bordercolor'){ unset($a['bordercolor']); $c[] = 'border-color: '. $v; }elseif($k == 'clear'){ unset($a['clear']); $c[] = 'clear: '. ($v != 'all' ? $v : 'both'); }elseif($k == 'compact'){ unset($a['compact']); $c[] = 'font-size: 85%'; }elseif($k == 'height' or $k == 'width'){ unset($a[$k]); $c[] = $k. ': '. ($v[0] != '*' ? $v. (ctype_digit($v) ? 'px' : '') : 'auto'); }elseif($k == 'hspace'){ unset($a['hspace']); $c[] = "margin-left: {$v}px; margin-right: {$v}px"; }elseif($k == 'language' && !isset($a['type'])){ unset($a['language']); $a['type'] = 'text/'. strtolower($v); }elseif($k == 'name'){ if($C['no_deprecated_attr'] == 2 or ($e != 'a' && $e != 'map')){unset($a['name']);} if(!isset($a['id']) && preg_match('`[a-zA-Z][a-zA-Z\d.:_\-]*`', $v)){$a['id'] = $v;} }elseif($k == 'noshade'){ unset($a['noshade']); $c[] = 'border-style: none; border: 0; background-color: gray; color: gray'; }elseif($k == 'nowrap'){ unset($a['nowrap']); $c[] = 'white-space: nowrap'; }elseif($k == 'size'){ unset($a['size']); $c[] = 'size: '. $v. 'px'; }elseif($k == 'start' or $k == 'value'){ unset($a[$k]); }elseif($k == 'type'){ unset($a['type']); static $ol_type = array('i'=>'lower-roman', 'I'=>'upper-roman', 'a'=>'lower-latin', 'A'=>'upper-latin', '1'=>'decimal'); $c[] = 'list-style-type: '. (isset($ol_type[$v]) ? $ol_type[$v] : 'decimal'); }elseif($k == 'vspace'){ unset($a['vspace']); $c[] = "margin-top: {$v}px; margin-bottom: {$v}px"; } } if(count($c)){ $c = implode('; ', $c); $a['style'] = isset($a['style']) ? rtrim($a['style'], ' ;'). '; '. $c. ';': $c. ';'; } } // unique ID if($C['unique_ids'] && isset($a['id'])){ if(!preg_match('`^[A-Za-z][A-Za-z0-9_\-.:]*$`', ($id = $a['id'])) or (isset($GLOBALS['hl_Ids'][$id]) && $C['unique_ids'] == 1)){unset($a['id']); }else{ while(isset($GLOBALS['hl_Ids'][$id])){$id = $C['unique_ids']. $id;} $GLOBALS['hl_Ids'][($a['id'] = $id)] = 1; } } // xml:lang if($C['xml:lang'] && isset($a['lang'])){ $a['xml:lang'] = isset($a['xml:lang']) ? $a['xml:lang'] : $a['lang']; if($C['xml:lang'] == 2){unset($a['lang']);} } // for transformed tag if(!empty($trt)){ $a['style'] = isset($a['style']) ? rtrim($a['style'], ' ;'). '; '. $trt : $trt; } // return with empty ele / if(empty($C['hook_tag'])){ $aA = ''; foreach($a as $k=>$v){$aA .= " {$k}=\"{$v}\"";} return "<{$e}{$aA}". (isset($eE[$e]) ? ' /' : ''). '>'; } else{return $C['hook_tag']($e, $a);} // eof } function hl_tag2(&$e, &$a, $t=1){ // transform tag if($e == 'center'){$e = 'div'; return 'text-align: center;';} if($e == 'dir' or $e == 'menu'){$e = 'ul'; return '';} if($e == 's' or $e == 'strike'){$e = 'span'; return 'text-decoration: line-through;';} if($e == 'u'){$e = 'span'; return 'text-decoration: underline;';} static $fs = array('0'=>'xx-small', '1'=>'xx-small', '2'=>'small', '3'=>'medium', '4'=>'large', '5'=>'x-large', '6'=>'xx-large', '7'=>'300%', '-1'=>'smaller', '-2'=>'60%', '+1'=>'larger', '+2'=>'150%', '+3'=>'200%', '+4'=>'300%'); if($e == 'font'){ $a2 = ''; if(preg_match('`face\s*=\s*(\'|")([^=]+?)\\1`i', $a, $m) or preg_match('`face\s*=(\s*)(\S+)`i', $a, $m)){ $a2 .= ' font-family: '. str_replace('"', '\'', trim($m[2])). ';'; } if(preg_match('`color\s*=\s*(\'|")?(.+?)(\\1|\s|$)`i', $a, $m)){ $a2 .= ' color: '. trim($m[2]). ';'; } if(preg_match('`size\s*=\s*(\'|")?(.+?)(\\1|\s|$)`i', $a, $m) && isset($fs[($m = trim($m[2]))])){ $a2 .= ' font-size: '. $fs[$m]. ';'; } $e = 'span'; return ltrim($a2); } if($t == 2){$e = 0; return 0;} return ''; // eof } function hl_tidy($t, $w, $p){ // Tidy/compact HTM if(strpos(' pre,script,textarea', "$p,")){return $t;} $t = preg_replace('`\s+`', ' ', preg_replace_callback(array('`(<(!\[CDATA\[))(.+?)(\]\]>)`sm', '`(<(!--))(.+?)(-->)`sm', '`(<(pre|script|textarea)[^>]*?>)(.+?)()`sm'), create_function('$m', 'return $m[1]. str_replace(array("<", ">", "\n", "\r", "\t", " "), array("\x01", "\x02", "\x03", "\x04", "\x05", "\x07"), $m[3]). $m[4];'), $t)); if(($w = strtolower($w)) == -1){ return str_replace(array("\x01", "\x02", "\x03", "\x04", "\x05", "\x07"), array('<', '>', "\n", "\r", "\t", ' '), $t); } $s = strpos(" $w", 't') ? "\t" : ' '; $s = preg_match('`\d`', $w, $m) ? str_repeat($s, $m[0]) : str_repeat($s, ($s == "\t" ? 1 : 2)); $N = preg_match('`[ts]([1-9])`', $w, $m) ? $m[1] : 0; $a = array('br'=>1); $b = array('button'=>1, 'input'=>1, 'option'=>1, 'param'=>1); $c = array('caption'=>1, 'dd'=>1, 'dt'=>1, 'h1'=>1, 'h2'=>1, 'h3'=>1, 'h4'=>1, 'h5'=>1, 'h6'=>1, 'isindex'=>1, 'label'=>1, 'legend'=>1, 'li'=>1, 'object'=>1, 'p'=>1, 'pre'=>1, 'td'=>1, 'textarea'=>1, 'th'=>1); $d = array('address'=>1, 'blockquote'=>1, 'center'=>1, 'colgroup'=>1, 'dir'=>1, 'div'=>1, 'dl'=>1, 'fieldset'=>1, 'form'=>1, 'hr'=>1, 'iframe'=>1, 'map'=>1, 'menu'=>1, 'noscript'=>1, 'ol'=>1, 'optgroup'=>1, 'rbc'=>1, 'rtc'=>1, 'ruby'=>1, 'script'=>1, 'select'=>1, 'table'=>1, 'tbody'=>1, 'tfoot'=>1, 'thead'=>1, 'tr'=>1, 'ul'=>1); $T = explode('<', $t); $X = 1; while($X){ $n = $N; $t = $T; ob_start(); if(isset($d[$p])){echo str_repeat($s, ++$n);} echo ltrim(array_shift($t)); for($i=-1, $j=count($t); ++$i<$j;){ $r = ''; list($e, $r) = explode('>', $t[$i]); $x = $e[0] == '/' ? 0 : (substr($e, -1) == '/' ? 1 : ($e[0] != '!' ? 2 : -1)); $y = !$x ? ltrim($e, '/') : ($x > 0 ? substr($e, 0, strcspn($e, ' ')) : 0); $e = "<$e>"; if(isset($d[$y])){ if(!$x){ if($n){echo "\n", str_repeat($s, --$n), "$e\n", str_repeat($s, $n);} else{++$N; ob_end_clean(); continue 2;} } else{echo "\n", str_repeat($s, $n), "$e\n", str_repeat($s, ($x != 1 ? ++$n : $n));} echo $r; continue; } $f = "\n". str_repeat($s, $n); if(isset($c[$y])){ if(!$x){echo $e, $f, $r;} else{echo $f, $e, $r;} }elseif(isset($b[$y])){echo $f, $e, $r; }elseif(isset($a[$y])){echo $e, $f, $r; }elseif(!$y){echo $f, $e, $f, $r; }else{echo $e, $r;} } $X = 0; } $t = str_replace(array("\n ", " \n"), "\n", preg_replace('`[\n]\s*?[\n]+`', "\n", ob_get_contents())); ob_end_clean(); if(($l = strpos(" $w", 'r') ? (strpos(" $w", 'n') ? "\r\n" : "\r") : 0)){ $t = str_replace("\n", $l, $t); } return str_replace(array("\x01", "\x02", "\x03", "\x04", "\x05", "\x07"), array('<', '>', "\n", "\r", "\t", ' '), $t); // eof } function hl_version(){ // rel return '1.1.16'; // eof } function kses($t, $h, $p=array('http', 'https', 'ftp', 'news', 'nntp', 'telnet', 'gopher', 'mailto')){ // kses compat foreach($h as $k=>$v){ $h[$k]['n']['*'] = 1; } $C['cdata'] = $C['comment'] = $C['make_tag_strict'] = $C['no_deprecated_attr'] = $C['unique_ids'] = 0; $C['keep_bad'] = 1; $C['elements'] = count($h) ? strtolower(implode(',', array_keys($h))) : '-*'; $C['hook'] = 'kses_hook'; $C['schemes'] = '*:'. implode(',', $p); return htmLawed($t, $C, $h); // eof } function kses_hook($t, &$C, &$S){ // kses compat return $t; // eof }glpi-0.84.3+dfsg.1/lib/icalcreator/000077500000000000000000000000001226600447100166575ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/icalcreator/iCalcreator.class.php000066400000000000000000015310041226600447100227300ustar00rootroot00000000000000 * @since 2.9.6 - 2011-05-14 */ class vcalendar { // calendar property variables var $calscale; var $method; var $prodid; var $version; var $xprop; // container for calendar components var $components; // component config variables var $allowEmpty; var $unique_id; var $language; var $directory; var $filename; var $url; var $delimiter; var $nl; var $format; var $dtzid; // component internal variables var $attributeDelimiter; var $valueInit; // component xCal declaration container var $xcaldecl; /** * constructor for calendar object * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.9.6 - 2011-05-14 * @param array $config * @return void */ function vcalendar ( $config = array()) { $this->_makeVersion(); $this->calscale = null; $this->method = null; $this->_makeUnique_id(); $this->prodid = null; $this->xprop = array(); $this->language = null; $this->directory = null; $this->filename = null; $this->url = null; $this->dtzid = null; /** * language = */ if( defined( 'ICAL_LANG' ) && !isset( $config['language'] )) $config['language'] = ICAL_LANG; if( !isset( $config['allowEmpty'] )) $config['allowEmpty'] = TRUE; if( !isset( $config['nl'] )) $config['nl'] = "\r\n"; if( !isset( $config['format'] )) $config['format'] = 'iCal'; if( !isset( $config['delimiter'] )) $config['delimiter'] = DIRECTORY_SEPARATOR; $this->setConfig( $config ); $this->xcaldecl = array(); $this->components = array(); } /*********************************************************************************/ /** * Property Name: CALSCALE */ /** * creates formatted output for calendar property calscale * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.10.16 - 2011-10-28 * @return string */ function createCalscale() { if( empty( $this->calscale )) return FALSE; switch( $this->format ) { case 'xcal': return $this->nl.' calscale="'.$this->calscale.'"'; break; default: return 'CALSCALE:'.$this->calscale.$this->nl; break; } } /** * set calendar property calscale * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-21 * @param string $value * @return void */ function setCalscale( $value ) { if( empty( $value )) return FALSE; $this->calscale = $value; } /*********************************************************************************/ /** * Property Name: METHOD */ /** * creates formatted output for calendar property method * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.10.16 - 2011-10-28 * @return string */ function createMethod() { if( empty( $this->method )) return FALSE; switch( $this->format ) { case 'xcal': return $this->nl.' method="'.$this->method.'"'; break; default: return 'METHOD:'.$this->method.$this->nl; break; } } /** * set calendar property method * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-20-23 * @param string $value * @return bool */ function setMethod( $value ) { if( empty( $value )) return FALSE; $this->method = $value; return TRUE; } /*********************************************************************************/ /** * Property Name: PRODID * * The identifier is RECOMMENDED to be the identical syntax to the * [RFC 822] addr-spec. A good method to assure uniqueness is to put the * domain name or a domain literal IP address of the host on which.. . */ /** * creates formatted output for calendar property prodid * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.12.11 - 2012-05-13 * @return string */ function createProdid() { if( !isset( $this->prodid )) $this->_makeProdid(); switch( $this->format ) { case 'xcal': return $this->nl.' prodid="'.$this->prodid.'"'; break; default: $toolbox = new calendarComponent(); $toolbox->setConfig( $this->getConfig()); return $toolbox->_createElement( 'PRODID', '', $this->prodid ); break; } } /** * make default value for calendar prodid * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.6.8 - 2009-12-30 * @return void */ function _makeProdid() { $this->prodid = '-//'.$this->unique_id.'//NONSGML kigkonsult.se '.ICALCREATOR_VERSION.'//'.strtoupper( $this->language ); } /** * Conformance: The property MUST be specified once in an iCalendar object. * Description: The vendor of the implementation SHOULD assure that this * is a globally unique identifier; using some technique such as an FPI * value, as defined in [ISO 9070]. */ /** * make default unique_id for calendar prodid * * @author Kjell-Inge Gustafsson, kigkonsult * @since 0.3.0 - 2006-08-10 * @return void */ function _makeUnique_id() { $this->unique_id = ( isset( $_SERVER['SERVER_NAME'] )) ? gethostbyname( $_SERVER['SERVER_NAME'] ) : 'localhost'; } /*********************************************************************************/ /** * Property Name: VERSION * * Description: A value of "2.0" corresponds to this memo. */ /** * creates formatted output for calendar property version * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.10.16 - 2011-10-28 * @return string */ function createVersion() { if( empty( $this->version )) $this->_makeVersion(); switch( $this->format ) { case 'xcal': return $this->nl.' version="'.$this->version.'"'; break; default: return 'VERSION:'.$this->version.$this->nl; break; } } /** * set default calendar version * * @author Kjell-Inge Gustafsson, kigkonsult * @since 0.3.0 - 2006-08-10 * @return void */ function _makeVersion() { $this->version = '2.0'; } /** * set calendar version * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-23 * @param string $value * @return void */ function setVersion( $value ) { if( empty( $value )) return FALSE; $this->version = $value; return TRUE; } /*********************************************************************************/ /** * Property Name: x-prop */ /** * creates formatted output for calendar property x-prop, iCal format only * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.10.16 - 2011-11-01 * @return string */ function createXprop() { if( empty( $this->xprop ) || !is_array( $this->xprop )) return FALSE; $output = null; $toolbox = new calendarComponent(); $toolbox->setConfig( $this->getConfig()); foreach( $this->xprop as $label => $xpropPart ) { if( !isset($xpropPart['value']) || ( empty( $xpropPart['value'] ) && !is_numeric( $xpropPart['value'] ))) { $output .= $toolbox->_createElement( $label ); continue; } $attributes = $toolbox->_createParams( $xpropPart['params'], array( 'LANGUAGE' )); if( is_array( $xpropPart['value'] )) { foreach( $xpropPart['value'] as $pix => $theXpart ) $xpropPart['value'][$pix] = $toolbox->_strrep( $theXpart ); $xpropPart['value'] = implode( ',', $xpropPart['value'] ); } else $xpropPart['value'] = $toolbox->_strrep( $xpropPart['value'] ); $output .= $toolbox->_createElement( $label, $attributes, $xpropPart['value'] ); if( is_array( $toolbox->xcaldecl ) && ( 0 < count( $toolbox->xcaldecl ))) { foreach( $toolbox->xcaldecl as $localxcaldecl ) $this->xcaldecl[] = $localxcaldecl; } } return $output; } /** * set calendar property x-prop * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.11.9 - 2012-01-16 * @param string $label * @param string $value * @param array $params optional * @return bool */ function setXprop( $label, $value, $params=FALSE ) { if( empty( $label )) return FALSE; if( 'X-' != strtoupper( substr( $label, 0, 2 ))) return FALSE; if( empty( $value ) && !is_numeric( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; $xprop = array( 'value' => $value ); $xprop['params'] = iCalUtilityFunctions::_setParams( $params ); if( !is_array( $this->xprop )) $this->xprop = array(); $this->xprop[strtoupper( $label )] = $xprop; return TRUE; } /*********************************************************************************/ /** * delete calendar property value * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.8.8 - 2011-03-15 * @param mixed $propName, bool FALSE => X-property * @param int $propix, optional, if specific property is wanted in case of multiply occurences * @return bool, if successfull delete */ function deleteProperty( $propName=FALSE, $propix=FALSE ) { $propName = ( $propName ) ? strtoupper( $propName ) : 'X-PROP'; if( !$propix ) $propix = ( isset( $this->propdelix[$propName] ) && ( 'X-PROP' != $propName )) ? $this->propdelix[$propName] + 2 : 1; $this->propdelix[$propName] = --$propix; $return = FALSE; switch( $propName ) { case 'CALSCALE': if( isset( $this->calscale )) { $this->calscale = null; $return = TRUE; } break; case 'METHOD': if( isset( $this->method )) { $this->method = null; $return = TRUE; } break; default: $reduced = array(); if( $propName != 'X-PROP' ) { if( !isset( $this->xprop[$propName] )) { unset( $this->propdelix[$propName] ); return FALSE; } foreach( $this->xprop as $k => $a ) { if(( $k != $propName ) && !empty( $a )) $reduced[$k] = $a; } } else { if( count( $this->xprop ) <= $propix ) return FALSE; $xpropno = 0; foreach( $this->xprop as $xpropkey => $xpropvalue ) { if( $propix != $xpropno ) $reduced[$xpropkey] = $xpropvalue; $xpropno++; } } $this->xprop = $reduced; if( empty( $this->xprop )) { unset( $this->propdelix[$propName] ); return FALSE; } return TRUE; } return $return; } /** * get calendar property value/params * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.13.4 - 2012-08-08 * @param string $propName, optional * @param int $propix, optional, if specific property is wanted in case of multiply occurences * @param bool $inclParam=FALSE * @return mixed */ function getProperty( $propName=FALSE, $propix=FALSE, $inclParam=FALSE ) { $propName = ( $propName ) ? strtoupper( $propName ) : 'X-PROP'; if( 'X-PROP' == $propName ) { if( !$propix ) $propix = ( isset( $this->propix[$propName] )) ? $this->propix[$propName] + 2 : 1; $this->propix[$propName] = --$propix; } else $mProps = array( 'ATTENDEE', 'CATEGORIES', 'CONTACT', 'RELATED-TO', 'RESOURCES' ); switch( $propName ) { case 'ATTENDEE': case 'CATEGORIES': case 'CONTACT': case 'DTSTART': case 'GEOLOCATION': case 'LOCATION': case 'ORGANIZER': case 'PRIORITY': case 'RESOURCES': case 'STATUS': case 'SUMMARY': case 'RECURRENCE-ID-UID': case 'RELATED-TO': case 'R-UID': case 'UID': case 'URL': $output = array(); foreach ( $this->components as $cix => $component) { if( !in_array( $component->objName, array('vevent', 'vtodo', 'vjournal', 'vfreebusy' ))) continue; if( in_array( strtoupper( $propName ), $mProps )) { $component->_getProperties( $propName, $output ); continue; } elseif(( 3 < strlen( $propName )) && ( 'UID' == substr( $propName, -3 ))) { if( FALSE !== ( $content = $component->getProperty( 'RECURRENCE-ID' ))) $content = $component->getProperty( 'UID' ); } elseif( 'GEOLOCATION' == $propName ) { $content = $component->getProperty( 'LOCATION' ); $content = ( !empty( $content )) ? $content.' ' : ''; if(( FALSE === ( $geo = $component->getProperty( 'GEO' ))) || empty( $geo )) continue; if( 0.0 < $geo['latitude'] ) $sign = '+'; else $sign = ( 0.0 > $geo['latitude'] ) ? '-' : ''; $content .= ' '.$sign.sprintf( "%09.6f", abs( $geo['latitude'] )); $content = rtrim( rtrim( $content, '0' ), '.' ); if( 0.0 < $geo['longitude'] ) $sign = '+'; else $sign = ( 0.0 > $geo['longitude'] ) ? '-' : ''; $content .= $sign.sprintf( '%8.6f', abs( $geo['longitude'] )).'/'; } elseif( FALSE === ( $content = $component->getProperty( $propName ))) continue; if(( FALSE === $content ) || empty( $content )) continue; elseif( is_array( $content )) { if( isset( $content['year'] )) { $key = sprintf( '%04d%02d%02d', $content['year'], $content['month'], $content['day'] ); if( !isset( $output[$key] )) $output[$key] = 1; else $output[$key] += 1; } else { foreach( $content as $partValue => $partCount ) { if( !isset( $output[$partValue] )) $output[$partValue] = $partCount; else $output[$partValue] += $partCount; } } } // end elseif( is_array( $content )) { elseif( !isset( $output[$content] )) $output[$content] = 1; else $output[$content] += 1; } // end foreach ( $this->components as $cix => $component) if( !empty( $output )) ksort( $output ); return $output; break; case 'CALSCALE': return ( !empty( $this->calscale )) ? $this->calscale : FALSE; break; case 'METHOD': return ( !empty( $this->method )) ? $this->method : FALSE; break; case 'PRODID': if( empty( $this->prodid )) $this->_makeProdid(); return $this->prodid; break; case 'VERSION': return ( !empty( $this->version )) ? $this->version : FALSE; break; default: if( $propName != 'X-PROP' ) { if( !isset( $this->xprop[$propName] )) return FALSE; return ( $inclParam ) ? array( $propName, $this->xprop[$propName] ) : array( $propName, $this->xprop[$propName]['value'] ); } else { if( empty( $this->xprop )) return FALSE; $xpropno = 0; foreach( $this->xprop as $xpropkey => $xpropvalue ) { if( $propix == $xpropno ) return ( $inclParam ) ? array( $xpropkey, $this->xprop[$xpropkey] ) : array( $xpropkey, $this->xprop[$xpropkey]['value'] ); else $xpropno++; } unset( $this->propix[$propName] ); return FALSE; // not found ?? } } return FALSE; } /** * general vcalendar property setting * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.2.13 - 2007-11-04 * @param mixed $args variable number of function arguments, * first argument is ALWAYS component name, * second ALWAYS component value! * @return bool */ function setProperty () { $numargs = func_num_args(); if( 1 > $numargs ) return FALSE; $arglist = func_get_args(); $arglist[0] = strtoupper( $arglist[0] ); switch( $arglist[0] ) { case 'CALSCALE': return $this->setCalscale( $arglist[1] ); case 'METHOD': return $this->setMethod( $arglist[1] ); case 'VERSION': return $this->setVersion( $arglist[1] ); default: if( !isset( $arglist[1] )) $arglist[1] = null; if( !isset( $arglist[2] )) $arglist[2] = null; return $this->setXprop( $arglist[0], $arglist[1], $arglist[2] ); } return FALSE; } /*********************************************************************************/ /** * get vcalendar config values or * calendar components * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.11.7 - 2012-01-12 * @param mixed $config * @return value */ function getConfig( $config = FALSE ) { if( !$config ) { $return = array(); $return['ALLOWEMPTY'] = $this->getConfig( 'ALLOWEMPTY' ); $return['DELIMITER'] = $this->getConfig( 'DELIMITER' ); $return['DIRECTORY'] = $this->getConfig( 'DIRECTORY' ); $return['FILENAME'] = $this->getConfig( 'FILENAME' ); $return['DIRFILE'] = $this->getConfig( 'DIRFILE' ); $return['FILESIZE'] = $this->getConfig( 'FILESIZE' ); $return['FORMAT'] = $this->getConfig( 'FORMAT' ); if( FALSE !== ( $lang = $this->getConfig( 'LANGUAGE' ))) $return['LANGUAGE'] = $lang; $return['NEWLINECHAR'] = $this->getConfig( 'NEWLINECHAR' ); $return['UNIQUE_ID'] = $this->getConfig( 'UNIQUE_ID' ); if( FALSE !== ( $url = $this->getConfig( 'URL' ))) $return['URL'] = $url; $return['TZID'] = $this->getConfig( 'TZID' ); return $return; } switch( strtoupper( $config )) { case 'ALLOWEMPTY': return $this->allowEmpty; break; case 'COMPSINFO': unset( $this->compix ); $info = array(); foreach( $this->components as $cix => $component ) { if( empty( $component )) continue; $info[$cix]['ordno'] = $cix + 1; $info[$cix]['type'] = $component->objName; $info[$cix]['uid'] = $component->getProperty( 'uid' ); $info[$cix]['props'] = $component->getConfig( 'propinfo' ); $info[$cix]['sub'] = $component->getConfig( 'compsinfo' ); } return $info; break; case 'DELIMITER': return $this->delimiter; break; case 'DIRECTORY': if( empty( $this->directory ) && ( '0' != $this->directory )) $this->directory = '.'; return $this->directory; break; case 'DIRFILE': return $this->getConfig( 'directory' ).$this->getConfig( 'delimiter' ).$this->getConfig( 'filename' ); break; case 'FILEINFO': return array( $this->getConfig( 'directory' ) , $this->getConfig( 'filename' ) , $this->getConfig( 'filesize' )); break; case 'FILENAME': if( empty( $this->filename ) && ( '0' != $this->filename )) { if( 'xcal' == $this->format ) $this->filename = date( 'YmdHis' ).'.xml'; // recommended xcs.. . else $this->filename = date( 'YmdHis' ).'.ics'; } return $this->filename; break; case 'FILESIZE': $size = 0; if( empty( $this->url )) { $dirfile = $this->getConfig( 'dirfile' ); if( !is_file( $dirfile ) || ( FALSE === ( $size = filesize( $dirfile )))) $size = 0; clearstatcache(); } return $size; break; case 'FORMAT': return ( $this->format == 'xcal' ) ? 'xCal' : 'iCal'; break; case 'LANGUAGE': /* get language for calendar component as defined in [RFC 1766] */ return $this->language; break; case 'NL': case 'NEWLINECHAR': return $this->nl; break; case 'TZID': return $this->dtzid; break; case 'UNIQUE_ID': return $this->unique_id; break; case 'URL': if( !empty( $this->url )) return $this->url; else return FALSE; break; } } /** * general vcalendar config setting * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.12.12 - 2012-05-13 * @param mixed $config * @param string $value * @return void */ function setConfig( $config, $value = FALSE) { if( is_array( $config )) { $ak = array_keys( $config ); foreach( $ak as $k ) { if( 'DIRECTORY' == strtoupper( $k )) { if( FALSE === $this->setConfig( 'DIRECTORY', $config[$k] )) return FALSE; unset( $config[$k] ); } elseif( 'NEWLINECHAR' == strtoupper( $k )) { if( FALSE === $this->setConfig( 'NEWLINECHAR', $config[$k] )) return FALSE; unset( $config[$k] ); } } foreach( $config as $cKey => $cValue ) { if( FALSE === $this->setConfig( $cKey, $cValue )) return FALSE; } return TRUE; } $res = FALSE; switch( strtoupper( $config )) { case 'ALLOWEMPTY': $this->allowEmpty = $value; $subcfg = array( 'ALLOWEMPTY' => $value ); $res = TRUE; break; case 'DELIMITER': $this->delimiter = $value; return TRUE; break; case 'DIRECTORY': $value = trim( $value ); $del = $this->getConfig('delimiter'); if( $del == substr( $value, ( 0 - strlen( $del )))) $value = substr( $value, 0, ( strlen( $value ) - strlen( $del ))); if( is_dir( $value )) { /* local directory */ clearstatcache(); $this->directory = $value; $this->url = null; return TRUE; } else return FALSE; break; case 'FILENAME': $value = trim( $value ); if( !empty( $this->url )) { /* remote directory+file -> URL */ $this->filename = $value; return TRUE; } $dirfile = $this->getConfig( 'directory' ).$this->getConfig( 'delimiter' ).$value; if( file_exists( $dirfile )) { /* local file exists */ if( is_readable( $dirfile ) || is_writable( $dirfile )) { clearstatcache(); $this->filename = $value; return TRUE; } else return FALSE; } elseif( is_readable($this->getConfig( 'directory' ) ) || is_writable( $this->getConfig( 'directory' ) )) { /* read- or writable directory */ $this->filename = $value; return TRUE; } else return FALSE; break; case 'FORMAT': $value = trim( strtolower( $value )); if( 'xcal' == $value ) { $this->format = 'xcal'; $this->attributeDelimiter = $this->nl; $this->valueInit = null; } else { $this->format = null; $this->attributeDelimiter = ';'; $this->valueInit = ':'; } $subcfg = array( 'FORMAT' => $value ); $res = TRUE; break; case 'LANGUAGE': // set language for calendar component as defined in [RFC 1766] $value = trim( $value ); $this->language = $value; $this->_makeProdid(); $subcfg = array( 'LANGUAGE' => $value ); $res = TRUE; break; case 'NL': case 'NEWLINECHAR': $this->nl = $value; if( 'xcal' == $value ) { $this->attributeDelimiter = $this->nl; $this->valueInit = null; } else { $this->attributeDelimiter = ';'; $this->valueInit = ':'; } $subcfg = array( 'NL' => $value ); $res = TRUE; break; case 'TZID': $this->dtzid = $value; $subcfg = array( 'TZID' => $value ); $res = TRUE; break; case 'UNIQUE_ID': $value = trim( $value ); $this->unique_id = $value; $this->_makeProdid(); $subcfg = array( 'UNIQUE_ID' => $value ); $res = TRUE; break; case 'URL': /* remote file - URL */ $value = trim( $value ); $value = str_replace( 'HTTP://', 'http://', $value ); $value = str_replace( 'WEBCAL://', 'http://', $value ); $value = str_replace( 'webcal://', 'http://', $value ); $this->url = $value; $this->directory = null; $parts = pathinfo( $value ); return $this->setConfig( 'filename', $parts['basename'] ); break; default: // any unvalid config key.. . return TRUE; } if( !$res ) return FALSE; if( isset( $subcfg ) && !empty( $this->components )) { foreach( $subcfg as $cfgkey => $cfgvalue ) { foreach( $this->components as $cix => $component ) { $res = $component->setConfig( $cfgkey, $cfgvalue, TRUE ); if( !$res ) break 2; $this->components[$cix] = $component->copy(); // PHP4 compliant } } } return $res; } /*********************************************************************************/ /** * add calendar component to container * * alias to setComponent * * @author Kjell-Inge Gustafsson, kigkonsult * @since 1.x.x - 2007-04-24 * @param object $component calendar component * @return void */ function addComponent( $component ) { $this->setComponent( $component ); } /** * delete calendar component from container * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.8.8 - 2011-03-15 * @param mixed $arg1 ordno / component type / component uid * @param mixed $arg2 optional, ordno if arg1 = component type * @return void */ function deleteComponent( $arg1, $arg2=FALSE ) { $argType = $index = null; if ( ctype_digit( (string) $arg1 )) { $argType = 'INDEX'; $index = (int) $arg1 - 1; } elseif(( strlen( $arg1 ) <= strlen( 'vfreebusy' )) && ( FALSE === strpos( $arg1, '@' ))) { $argType = strtolower( $arg1 ); $index = ( !empty( $arg2 ) && ctype_digit( (string) $arg2 )) ? (( int ) $arg2 - 1 ) : 0; } $cix1dC = 0; foreach ( $this->components as $cix => $component) { if( empty( $component )) continue; if(( 'INDEX' == $argType ) && ( $index == $cix )) { unset( $this->components[$cix] ); return TRUE; } elseif( $argType == $component->objName ) { if( $index == $cix1dC ) { unset( $this->components[$cix] ); return TRUE; } $cix1dC++; } elseif( !$argType && ($arg1 == $component->getProperty( 'uid' ))) { unset( $this->components[$cix] ); return TRUE; } } return FALSE; } /** * get calendar component from container * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.13.5 - 2012-08-08 * @param mixed $arg1 optional, ordno/component type/ component uid * @param mixed $arg2 optional, ordno if arg1 = component type * @return object */ function getComponent( $arg1=FALSE, $arg2=FALSE ) { $index = $argType = null; if ( !$arg1 ) { // first or next in component chain $argType = 'INDEX'; $index = $this->compix['INDEX'] = ( isset( $this->compix['INDEX'] )) ? $this->compix['INDEX'] + 1 : 1; } elseif ( ctype_digit( (string) $arg1 )) { // specific component in chain $argType = 'INDEX'; $index = (int) $arg1; unset( $this->compix ); } elseif( is_array( $arg1 )) { // array( *[propertyName => propertyValue] ) $arg2 = implode( '-', array_keys( $arg1 )); $index = $this->compix[$arg2] = ( isset( $this->compix[$arg2] )) ? $this->compix[$arg2] + 1 : 1; $dateProps = array( 'DTSTART', 'DTEND', 'DUE', 'CREATED', 'COMPLETED', 'DTSTAMP', 'LAST-MODIFIED', 'RECURRENCE-ID' ); $otherProps = array( 'ATTENDEE', 'CATEGORIES', 'CONTACT', 'LOCATION', 'ORGANIZER', 'PRIORITY', 'RELATED-TO', 'RESOURCES', 'STATUS', 'SUMMARY', 'UID', 'URL' ); $mProps = array( 'ATTENDEE', 'CATEGORIES', 'CONTACT', 'RELATED-TO', 'RESOURCES' ); } elseif(( strlen( $arg1 ) <= strlen( 'vfreebusy' )) && ( FALSE === strpos( $arg1, '@' ))) { // object class name unset( $this->compix['INDEX'] ); $argType = strtolower( $arg1 ); if( !$arg2 ) $index = $this->compix[$argType] = ( isset( $this->compix[$argType] )) ? $this->compix[$argType] + 1 : 1; elseif( isset( $arg2 ) && ctype_digit( (string) $arg2 )) $index = (int) $arg2; } elseif(( strlen( $arg1 ) > strlen( 'vfreebusy' )) && ( FALSE !== strpos( $arg1, '@' ))) { // UID as 1st argument if( !$arg2 ) $index = $this->compix[$arg1] = ( isset( $this->compix[$arg1] )) ? $this->compix[$arg1] + 1 : 1; elseif( isset( $arg2 ) && ctype_digit( (string) $arg2 )) $index = (int) $arg2; } if( isset( $index )) $index -= 1; $ckeys = array_keys( $this->components ); if( !empty( $index) && ( $index > end( $ckeys ))) return FALSE; $cix1gC = 0; foreach ( $this->components as $cix => $component) { if( empty( $component )) continue; if(( 'INDEX' == $argType ) && ( $index == $cix )) return $component->copy(); elseif( $argType == $component->objName ) { if( $index == $cix1gC ) return $component->copy(); $cix1gC++; } elseif( is_array( $arg1 )) { // array( *[propertyName => propertyValue] ) $hit = array(); foreach( $arg1 as $pName => $pValue ) { $pName = strtoupper( $pName ); if( !in_array( $pName, $dateProps ) && !in_array( $pName, $otherProps )) continue; if( in_array( $pName, $mProps )) { // multiple occurrence $propValues = array(); $component->_getProperties( $pName, $propValues ); $propValues = array_keys( $propValues ); $hit[] = ( in_array( $pValue, $propValues )) ? TRUE : FALSE; continue; } // end if(.. .// multiple occurrence if( FALSE === ( $value = $component->getProperty( $pName ))) { // single occurrence $hit[] = FALSE; // missing property continue; } if( 'SUMMARY' == $pName ) { // exists within (any case) $hit[] = ( FALSE !== stripos( $value, $pValue )) ? TRUE : FALSE; continue; } if( in_array( strtoupper( $pName ), $dateProps )) { $valuedate = sprintf( '%04d%02d%02d', $value['year'], $value['month'], $value['day'] ); if( 8 < strlen( $pValue )) { if( isset( $value['hour'] )) { if( 'T' == substr( $pValue, 8, 1 )) $pValue = str_replace( 'T', '', $pValue ); $valuedate .= sprintf( '%02d%02d%02d', $value['hour'], $value['min'], $value['sec'] ); } else $pValue = substr( $pValue, 0, 8 ); } $hit[] = ( $pValue == $valuedate ) ? TRUE : FALSE; continue; } elseif( !is_array( $value )) $value = array( $value ); foreach( $value as $part ) { $part = ( FALSE !== strpos( $part, ',' )) ? explode( ',', $part ) : array( $part ); foreach( $part as $subPart ) { if( $pValue == $subPart ) { $hit[] = TRUE; continue 3; } } } // end foreach( $value as $part ) $hit[] = FALSE; // no hit in property } // end foreach( $arg1 as $pName => $pValue ) if( in_array( TRUE, $hit )) { if( $index == $cix1gC ) return $component->copy(); $cix1gC++; } } // end elseif( is_array( $arg1 )) { // array( *[propertyName => propertyValue] ) elseif( !$argType && ($arg1 == $component->getProperty( 'uid' ))) { // UID if( $index == $cix1gC ) return $component->copy(); $cix1gC++; } } // end foreach ( $this->components.. . /* not found.. . */ unset( $this->compix ); return FALSE; } /** * create new calendar component, already included within calendar * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.6.33 - 2011-01-03 * @param string $compType component type * @return object (reference) */ function & newComponent( $compType ) { $config = $this->getConfig(); $keys = array_keys( $this->components ); $ix = end( $keys) + 1; switch( strtoupper( $compType )) { case 'EVENT': case 'VEVENT': $this->components[$ix] = new vevent( $config ); break; case 'TODO': case 'VTODO': $this->components[$ix] = new vtodo( $config ); break; case 'JOURNAL': case 'VJOURNAL': $this->components[$ix] = new vjournal( $config ); break; case 'FREEBUSY': case 'VFREEBUSY': $this->components[$ix] = new vfreebusy( $config ); break; case 'TIMEZONE': case 'VTIMEZONE': array_unshift( $this->components, new vtimezone( $config )); $ix = 0; break; default: return FALSE; } return $this->components[$ix]; } /** * select components from calendar on date or selectOption basis * * Ensure DTSTART is set for every component. * No date controls occurs. * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.11.22 - 2012-02-13 * @param mixed $startY optional, start Year, default current Year ALT. array selecOptions ( *[ => ] ) * @param int $startM optional, start Month, default current Month * @param int $startD optional, start Day, default current Day * @param int $endY optional, end Year, default $startY * @param int $endY optional, end Month, default $startM * @param int $endY optional, end Day, default $startD * @param mixed $cType optional, calendar component type(-s), default FALSE=all else string/array type(-s) * @param bool $flat optional, FALSE (default) => output : array[Year][Month][Day][] * TRUE => output : array[] (ignores split) * @param bool $any optional, TRUE (default) - select component(-s) that occurs within period * FALSE - only component(-s) that starts within period * @param bool $split optional, TRUE (default) - one component copy every DAY it occurs during the * period (implies flat=FALSE) * FALSE - one occurance of component only in output array * @return array or FALSE */ function selectComponents( $startY=FALSE, $startM=FALSE, $startD=FALSE, $endY=FALSE, $endM=FALSE, $endD=FALSE, $cType=FALSE, $flat=FALSE, $any=TRUE, $split=TRUE ) { /* check if empty calendar */ if( 0 >= count( $this->components )) return FALSE; if( is_array( $startY )) return $this->selectComponents2( $startY ); /* check default dates */ if( !$startY ) $startY = date( 'Y' ); if( !$startM ) $startM = date( 'm' ); if( !$startD ) $startD = date( 'd' ); $startDate = mktime( 0, 0, 0, $startM, $startD, $startY ); if( !$endY ) $endY = $startY; if( !$endM ) $endM = $startM; if( !$endD ) $endD = $startD; $endDate = mktime( 23, 59, 59, $endM, $endD, $endY ); //echo 'selectComp arg='.date( 'Y-m-d H:i:s', $startDate).' -- '.date( 'Y-m-d H:i:s', $endDate)."
    \n"; $tcnt = 0;// test ### /* check component types */ $validTypes = array('vevent', 'vtodo', 'vjournal', 'vfreebusy' ); if( is_array( $cType )) { foreach( $cType as $cix => $theType ) { $cType[$cix] = $theType = strtolower( $theType ); if( !in_array( $theType, $validTypes )) $cType[$cix] = 'vevent'; } $cType = array_unique( $cType ); } elseif( !empty( $cType )) { $cType = strtolower( $cType ); if( !in_array( $cType, $validTypes )) $cType = array( 'vevent' ); else $cType = array( $cType ); } else $cType = $validTypes; if( 0 >= count( $cType )) $cType = $validTypes; if(( FALSE === $flat ) && ( FALSE === $any )) // invalid combination $split = FALSE; if(( TRUE === $flat ) && ( TRUE === $split )) // invalid combination $split = FALSE; /* iterate components */ $result = array(); foreach ( $this->components as $cix => $component ) { if( empty( $component )) continue; unset( $start ); /* deselect unvalid type components */ if( !in_array( $component->objName, $cType )) continue; $start = $component->getProperty( 'dtstart' ); /* select due when dtstart is missing */ if( empty( $start ) && ( $component->objName == 'vtodo' ) && ( FALSE === ( $start = $component->getProperty( 'due' )))) continue; if( empty( $start )) continue; $dtendExist = $dueExist = $durationExist = $endAllDayEvent = $recurrid = FALSE; unset( $end, $startWdate, $endWdate, $rdurWsecs, $rdur, $exdatelist, $workstart, $workend, $endDateFormat ); // clean up $startWdate = iCalUtilityFunctions::_date2timestamp( $start ); $startDateFormat = ( isset( $start['hour'] )) ? 'Y-m-d H:i:s' : 'Y-m-d'; /* get end date from dtend/due/duration properties */ $end = $component->getProperty( 'dtend' ); if( !empty( $end )) { $dtendExist = TRUE; $endDateFormat = ( isset( $end['hour'] )) ? 'Y-m-d H:i:s' : 'Y-m-d'; } if( empty( $end ) && ( $component->objName == 'vtodo' )) { $end = $component->getProperty( 'due' ); if( !empty( $end )) { $dueExist = TRUE; $endDateFormat = ( isset( $end['hour'] )) ? 'Y-m-d H:i:s' : 'Y-m-d'; } } if( !empty( $end ) && !isset( $end['hour'] )) { /* a DTEND without time part regards an event that ends the day before, for an all-day event DTSTART=20071201 DTEND=20071202 (taking place 20071201!!! */ $endAllDayEvent = TRUE; $endWdate = mktime( 23, 59, 59, $end['month'], ($end['day'] - 1), $end['year'] ); $end['year'] = date( 'Y', $endWdate ); $end['month'] = date( 'm', $endWdate ); $end['day'] = date( 'd', $endWdate ); $end['hour'] = 23; $end['min'] = $end['sec'] = 59; } if( empty( $end )) { $end = $component->getProperty( 'duration', FALSE, FALSE, TRUE );// in dtend (array) format if( !empty( $end )) $durationExist = TRUE; $endDateFormat = ( isset( $start['hour'] )) ? 'Y-m-d H:i:s' : 'Y-m-d'; // if( !empty($end)) echo 'selectComp 4 start='.implode('-',$start).' end='.implode('-',$end)."
    \n"; // test ### } if( empty( $end )) { // assume one day duration if missing end date $end = array( 'year' => $start['year'], 'month' => $start['month'], 'day' => $start['day'], 'hour' => 23, 'min' => 59, 'sec' => 59 ); } // if( isset($end)) echo 'selectComp 5 start='.implode('-',$start).' end='.implode('-',$end)."
    \n"; // test ### $endWdate = iCalUtilityFunctions::_date2timestamp( $end ); if( $endWdate < $startWdate ) { // MUST be after start date!! $end = array( 'year' => $start['year'], 'month' => $start['month'], 'day' => $start['day'], 'hour' => 23, 'min' => 59, 'sec' => 59 ); $endWdate = iCalUtilityFunctions::_date2timestamp( $end ); } $rdurWsecs = $endWdate - $startWdate; // compute event (component) duration in seconds /* make a list of optional exclude dates for component occurence from exrule and exdate */ $exdatelist = array(); $workstart = iCalUtilityFunctions::_timestamp2date(( $startDate - $rdurWsecs ), 6); $workend = iCalUtilityFunctions::_timestamp2date(( $endDate + $rdurWsecs ), 6); while( FALSE !== ( $exrule = $component->getProperty( 'exrule' ))) // check exrule iCalUtilityFunctions::_recur2date( $exdatelist, $exrule, $start, $workstart, $workend ); while( FALSE !== ( $exdate = $component->getProperty( 'exdate' ))) { // check exdate foreach( $exdate as $theExdate ) { $exWdate = iCalUtilityFunctions::_date2timestamp( $theExdate ); $exWdate = mktime( 0, 0, 0, date( 'm', $exWdate ), date( 'd', $exWdate ), date( 'Y', $exWdate )); // on a day-basis !!! if((( $startDate - $rdurWsecs ) <= $exWdate ) && ( $endDate >= $exWdate )) $exdatelist[$exWdate] = TRUE; } // end - foreach( $exdate as $theExdate ) } // end - check exdate $compUID = $component->getProperty( 'UID' ); /* check recurrence-id (with sequence), remove hit with reccurr-id date */ if(( FALSE !== ( $recurrid = $component->getProperty( 'recurrence-id' ))) && ( FALSE !== ( $sequence = $component->getProperty( 'sequence' ))) ) { $recurrid = iCalUtilityFunctions::_date2timestamp( $recurrid ); $recurrid = mktime( 0, 0, 0, date( 'm', $recurrid ), date( 'd', $recurrid ), date( 'Y', $recurrid )); // on a day-basis !!! $endD = $recurrid + $rdurWsecs; do { if( date( 'Ymd', $startWdate ) != date( 'Ymd', $recurrid )) $exdatelist[$recurrid] = TRUE; // exclude all other days than startdate $wd = getdate( $recurrid ); if( isset( $result[$wd['year']][$wd['mon']][$wd['mday']][$compUID] )) unset( $result[$wd['year']][$wd['mon']][$wd['mday']][$compUID] ); // remove from output, dtstart etc added below if( $split && ( $recurrid <= $endD )) $recurrid = mktime( 0, 0, 0, date( 'm', $recurrid ), date( 'd', $recurrid ) + 1, date( 'Y', $recurrid )); // step one day else break; } while( TRUE ); } // end recurrence-id/sequence test /* select only components with.. . */ if(( !$any && ( $startWdate >= $startDate ) && ( $startWdate <= $endDate )) || // (dt)start within the period ( $any && ( $startWdate < $endDate ) && ( $endWdate >= $startDate ))) { // occurs within the period /* add the selected component (WITHIN valid dates) to output array */ if( $flat ) { // any=true/false, ignores split if( !$recurrid ) $result[$compUID] = $component->copy(); // copy original to output (but not anyone with recurrence-id) } elseif( $split ) { // split the original component if( $endWdate > $endDate ) $endWdate = $endDate; // use period end date $rstart = $startWdate; if( $rstart < $startDate ) $rstart = $startDate; // use period start date $startYMD = date( 'Ymd', $rstart ); $endYMD = date( 'Ymd', $endWdate ); $checkDate = mktime( 0, 0, 0, date( 'm', $rstart ), date( 'd', $rstart ), date( 'Y', $rstart ) ); // on a day-basis !!! while( date( 'Ymd', $rstart ) <= $endYMD ) { // iterate $checkDate = mktime( 0, 0, 0, date( 'm', $rstart ), date( 'd', $rstart ), date( 'Y', $rstart ) ); // on a day-basis !!! if( isset( $exdatelist[$checkDate] )) { // exclude any recurrence date, found in exdatelist $rstart = mktime( date( 'H', $rstart ), date( 'i', $rstart ), date( 's', $rstart ), date( 'm', $rstart ), date( 'd', $rstart ) + 1, date( 'Y', $rstart ) ); // step one day continue; } if( date( 'Ymd', $rstart ) > $startYMD ) // date after dtstart $datestring = date( $startDateFormat, mktime( 0, 0, 0, date( 'm', $rstart ), date( 'd', $rstart ), date( 'Y', $rstart ))); else $datestring = date( $startDateFormat, $rstart ); if( isset( $start['tz'] )) $datestring .= ' '.$start['tz']; // echo "X-CURRENT-DTSTART 3 = $datestring xRecurrence=$xRecurrence tcnt =".++$tcnt."
    ";$component->setProperty( 'X-CNT', $tcnt ); // test ### $component->setProperty( 'X-CURRENT-DTSTART', $datestring ); if( $dtendExist || $dueExist || $durationExist ) { if( date( 'Ymd', $rstart ) < $endYMD ) // not the last day $tend = mktime( 23, 59, 59, date( 'm', $rstart ), date( 'd', $rstart ), date( 'Y', $rstart )); else $tend = mktime( date( 'H', $endWdate ), date( 'i', $endWdate ), date( 's', $endWdate ), date( 'm', $rstart ), date( 'd', $rstart ), date( 'Y', $rstart ) ); // on a day-basis !!! if( $endAllDayEvent && $dtendExist ) $tend += ( 24 * 3600 ); // alldaysevents has an end date 'day after' meaning this day $datestring = date( $endDateFormat, $tend ); if( isset( $end['tz'] )) $datestring .= ' '.$end['tz']; $propName = ( !$dueExist ) ? 'X-CURRENT-DTEND' : 'X-CURRENT-DUE'; $component->setProperty( $propName, $datestring ); } // end if( $dtendExist || $dueExist || $durationExist ) $wd = getdate( $rstart ); $result[$wd['year']][$wd['mon']][$wd['mday']][$compUID] = $component->copy(); // copy to output $rstart = mktime( date( 'H', $rstart ), date( 'i', $rstart ), date( 's', $rstart ), date( 'm', $rstart ), date( 'd', $rstart ) + 1, date( 'Y', $rstart ) ); // step one day } // end while( $rstart <= $endWdate ) } // end if( $split ) - else use component date elseif( $recurrid && !$flat && !$any && !$split ) $continue = TRUE; else { // !$flat && !$split, i.e. no flat array and DTSTART within period $checkDate = mktime( 0, 0, 0, date( 'm', $startWdate ), date( 'd', $startWdate ), date( 'Y', $startWdate ) ); // on a day-basis !!! if( !$any || !isset( $exdatelist[$checkDate] )) { // exclude any recurrence date, found in exdatelist $wd = getdate( $startWdate ); $result[$wd['year']][$wd['mon']][$wd['mday']][$compUID] = $component->copy(); // copy to output } } } // end if(( $startWdate >= $startDate ) && ( $startWdate <= $endDate )) /* if 'any' components, check components with reccurrence rules, removing all excluding dates */ if( TRUE === $any ) { /* make a list of optional repeating dates for component occurence, rrule, rdate */ $recurlist = array(); while( FALSE !== ( $rrule = $component->getProperty( 'rrule' ))) // check rrule iCalUtilityFunctions::_recur2date( $recurlist, $rrule, $start, $workstart, $workend ); foreach( $recurlist as $recurkey => $recurvalue ) // key=match date as timestamp $recurlist[$recurkey] = $rdurWsecs; // add duration in seconds while( FALSE !== ( $rdate = $component->getProperty( 'rdate' ))) { // check rdate foreach( $rdate as $theRdate ) { if( is_array( $theRdate ) && ( 2 == count( $theRdate )) && // all days within PERIOD array_key_exists( '0', $theRdate ) && array_key_exists( '1', $theRdate )) { $rstart = iCalUtilityFunctions::_date2timestamp( $theRdate[0] ); if(( $rstart < ( $startDate - $rdurWsecs )) || ( $rstart > $endDate )) continue; if( isset( $theRdate[1]['year'] )) // date-date period $rend = iCalUtilityFunctions::_date2timestamp( $theRdate[1] ); else { // date-duration period $rend = iCalUtilityFunctions::_duration2date( $theRdate[0], $theRdate[1] ); $rend = iCalUtilityFunctions::_date2timestamp( $rend ); } while( $rstart < $rend ) { $recurlist[$rstart] = $rdurWsecs; // set start date for recurrence instance + rdate duration in seconds $rstart = mktime( date( 'H', $rstart ), date( 'i', $rstart ), date( 's', $rstart ), date( 'm', $rstart ), date( 'd', $rstart ) + 1, date( 'Y', $rstart ) ); // step one day } } // PERIOD end else { // single date $theRdate = iCalUtilityFunctions::_date2timestamp( $theRdate ); if((( $startDate - $rdurWsecs ) <= $theRdate ) && ( $endDate >= $theRdate )) $recurlist[$theRdate] = $rdurWsecs; // set start date for recurrence instance + event duration in seconds } } } // end - check rdate if( 0 < count( $recurlist )) { ksort( $recurlist ); $xRecurrence = 1; $component2 = $component->copy(); $compUID = $component2->getProperty( 'UID' ); foreach( $recurlist as $recurkey => $durvalue ) { // echo "recurKey=".date( 'Y-m-d H:i:s', $recurkey ).' dur='.iCalUtilityFunctions::offsetSec2His( $durvalue )."
    \n"; // test ###; if((( $startDate - $rdurWsecs ) > $recurkey ) || ( $endDate < $recurkey )) // not within period continue; $checkDate = mktime( 0, 0, 0, date( 'm', $recurkey ), date( 'd', $recurkey ), date( 'Y', $recurkey ) ); // on a day-basis !!! if( isset( $exdatelist[$checkDate] )) // check excluded dates continue; if( $startWdate >= $recurkey ) // exclude component start date continue; $rstart = $recurkey; $rend = $recurkey + $durvalue; /* add repeating components within valid dates to output array, only start date set */ if( $flat ) { if( !isset( $result[$compUID] )) // only one comp $result[$compUID] = $component2->copy(); // copy to output } /* add repeating components within valid dates to output array, one each day */ elseif( $split ) { if( $rend > $endDate ) $rend = $endDate; $startYMD = date( 'Ymd', $rstart ); $endYMD = date( 'Ymd', $rend ); // echo "splitStart=".date( 'Y-m-d H:i:s', $rstart ).' end='.date( 'Y-m-d H:i:s', $rend )."
    \n"; // test ###; while( $rstart <= $rend ) { // iterate.. . $checkDate = mktime( 0, 0, 0, date( 'm', $rstart ), date( 'd', $rstart ), date( 'Y', $rstart ) ); // on a day-basis !!! if( isset( $exdatelist[$checkDate] )) // exclude any recurrence START date, found in exdatelist break; // echo "checking date after startdate=".date( 'Y-m-d H:i:s', $rstart ).' mot '.date( 'Y-m-d H:i:s', $startDate )."
    "; // test ###; if( $rstart >= $startDate ) { // date after dtstart if( date( 'Ymd', $rstart ) > $startYMD ) // date after dtstart $datestring = date( $startDateFormat, $checkDate ); else $datestring = date( $startDateFormat, $rstart ); if( isset( $start['tz'] )) $datestring .= ' '.$start['tz']; //echo "X-CURRENT-DTSTART 1 = $datestring xRecurrence=$xRecurrence tcnt =".++$tcnt."
    ";$component2->setProperty( 'X-CNT', $tcnt ); // test ### $component2->setProperty( 'X-CURRENT-DTSTART', $datestring ); if( $dtendExist || $dueExist || $durationExist ) { if( date( 'Ymd', $rstart ) < $endYMD ) // not the last day $tend = mktime( 23, 59, 59, date( 'm', $rstart ), date( 'd', $rstart ), date( 'Y', $rstart )); else $tend = mktime( date( 'H', $endWdate ), date( 'i', $endWdate ), date( 's', $endWdate ), date( 'm', $rstart ), date( 'd', $rstart ), date( 'Y', $rstart ) ); // on a day-basis !!! if( $endAllDayEvent && $dtendExist ) $tend += ( 24 * 3600 ); // alldaysevents has an end date 'day after' meaning this day $datestring = date( $endDateFormat, $tend ); if( isset( $end['tz'] )) $datestring .= ' '.$end['tz']; $propName = ( !$dueExist ) ? 'X-CURRENT-DTEND' : 'X-CURRENT-DUE'; $component2->setProperty( $propName, $datestring ); } // end if( $dtendExist || $dueExist || $durationExist ) $component2->setProperty( 'X-RECURRENCE', $xRecurrence ); $wd = getdate( $rstart ); $result[$wd['year']][$wd['mon']][$wd['mday']][$compUID] = $component2->copy(); // copy to output } // end if( $checkDate > $startYMD ) { // date after dtstart $rstart = mktime( date( 'H', $rstart ), date( 'i', $rstart ), date( 's', $rstart ), date( 'm', $rstart ), date( 'd', $rstart ) + 1, date( 'Y', $rstart ) ); // step one day } // end while( $rstart <= $rend ) $xRecurrence += 1; } // end elseif( $split ) elseif( $rstart >= $startDate ) { // date within period //* flat=FALSE && split=FALSE => one comp every recur startdate *// $checkDate = mktime( 0, 0, 0, date( 'm', $rstart ), date( 'd', $rstart ), date( 'Y', $rstart ) ); // on a day-basis !!! if( !isset( $exdatelist[$checkDate] )) { // exclude any recurrence START date, found in exdatelist $xRecurrence += 1; $datestring = date( $startDateFormat, $rstart ); if( isset( $start['tz'] )) $datestring .= ' '.$start['tz']; //echo "X-CURRENT-DTSTART 2 = $datestring xRecurrence=$xRecurrence tcnt =".++$tcnt."
    ";$component2->setProperty( 'X-CNT', $tcnt ); // test ### $component2->setProperty( 'X-CURRENT-DTSTART', $datestring ); if( $dtendExist || $dueExist || $durationExist ) { $tend = $rstart + $rdurWsecs; if( date( 'Ymd', $tend ) < date( 'Ymd', $endWdate )) $tend = mktime( 23, 59, 59, date( 'm', $tend ), date( 'd', $tend ), date( 'Y', $tend )); else $tend = mktime( date( 'H', $endWdate ), date( 'i', $endWdate ), date( 's', $endWdate ), date( 'm', $tend ), date( 'd', $tend ), date( 'Y', $tend ) ); // on a day-basis !!! if( $endAllDayEvent && $dtendExist ) $tend += ( 24 * 3600 ); // alldaysevents has an end date 'day after' meaning this day $datestring = date( $endDateFormat, $tend ); if( isset( $end['tz'] )) $datestring .= ' '.$end['tz']; $propName = ( !$dueExist ) ? 'X-CURRENT-DTEND' : 'X-CURRENT-DUE'; $component2->setProperty( $propName, $datestring ); } // end if( $dtendExist || $dueExist || $durationExist ) $component2->setProperty( 'X-RECURRENCE', $xRecurrence ); $wd = getdate( $rstart ); $result[$wd['year']][$wd['mon']][$wd['mday']][$compUID] = $component2->copy(); // copy to output } // end if( !isset( $exdatelist[$checkDate] )) } // end elseif( $rstart >= $startDate ) } // end foreach( $recurlist as $recurkey => $durvalue ) } // end if( 0 < count( $recurlist )) /* deselect components with startdate/enddate not within period */ if(( $endWdate < $startDate ) || ( $startWdate > $endDate )) continue; } // end if( TRUE === $any ) } // end foreach ( $this->components as $cix => $component ) if( 0 >= count( $result )) return FALSE; elseif( !$flat ) { foreach( $result as $y => $yeararr ) { foreach( $yeararr as $m => $montharr ) { foreach( $montharr as $d => $dayarr ) { if( empty( $result[$y][$m][$d] )) unset( $result[$y][$m][$d] ); else $result[$y][$m][$d] = array_values( $dayarr ); // skip tricky UID-index, hoping they are in hour order.. . } if( empty( $result[$y][$m] )) unset( $result[$y][$m] ); else ksort( $result[$y][$m] ); } if( empty( $result[$y] )) unset( $result[$y] ); else ksort( $result[$y] ); } if( empty( $result )) unset( $result ); else ksort( $result ); } // end elseif( !$flat ) if( 0 >= count( $result )) return FALSE; return $result; } /** * select components from calendar on based on specific property value(-s) * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.13.4 - 2012-08-07 * @param array $selectOptions, (string) key => (mixed) value, (key=propertyName) * @return array */ function selectComponents2( $selectOptions ) { $output = array(); $allowedProperties = array( 'ATTENDEE', 'CATEGORIES', 'CONTACT', 'LOCATION', 'ORGANIZER', 'PRIORITY', 'RELATED-TO', 'RESOURCES', 'STATUS', 'SUMMARY', 'UID', 'URL' ); foreach( $this->components as $cix => $component3 ) { if( !in_array( $component3->objName, array('vevent', 'vtodo', 'vjournal', 'vfreebusy' ))) continue; $uid = $component3->getProperty( 'UID' ); foreach( $selectOptions as $propName => $pvalue ) { $propName = strtoupper( $propName ); if( !in_array( $propName, $allowedProperties )) continue; if( !is_array( $pvalue )) $pvalue = array( $pvalue ); if(( 'UID' == $propName ) && in_array( $uid, $pvalue )) { $output[] = $component3->copy(); continue; } elseif(( 'ATTENDEE' == $propName ) || ( 'CATEGORIES' == $propName ) || ( 'CONTACT' == $propName ) || ( 'RELATED-TO' == $propName ) || ( 'RESOURCES' == $propName )) { // multiple occurrence? $propValues = array(); $component3->_getProperties( $propName, $propValues ); $propValues = array_keys( $propValues ); foreach( $pvalue as $theValue ) { if( in_array( $theValue, $propValues ) && !isset( $output[$uid] )) { $output[$uid] = $component3->copy(); break; } } continue; } // end elseif( // multiple occurrence? elseif( FALSE === ( $d = $component3->getProperty( $propName ))) // single occurrence continue; if( is_array( $d )) { foreach( $d as $part ) { if( in_array( $part, $pvalue ) && !isset( $output[$uid] )) $output[$uid] = $component3->copy(); } } elseif(( 'SUMMARY' == $propName ) && !isset( $output[$uid] )) { foreach( $pvalue as $pval ) { if( FALSE !== stripos( $d, $pval )) { $output[$uid] = $component3->copy(); break; } } } elseif( in_array( $d, $pvalue ) && !isset( $output[$uid] )) $output[$uid] = $component3->copy(); } // end foreach( $selectOptions as $propName => $pvalue ) { } // end foreach( $this->components as $cix => $component3 ) { if( !empty( $output )) { ksort( $output ); $output = array_values( $output ); } return $output; } /** * add calendar component to container * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.8.8 - 2011-03-15 * @param object $component calendar component * @param mixed $arg1 optional, ordno/component type/ component uid * @param mixed $arg2 optional, ordno if arg1 = component type * @return void */ function setComponent( $component, $arg1=FALSE, $arg2=FALSE ) { $component->setConfig( $this->getConfig(), FALSE, TRUE ); if( !in_array( $component->objName, array( 'valarm', 'vtimezone' ))) { /* make sure dtstamp and uid is set */ $dummy1 = $component->getProperty( 'dtstamp' ); $dummy2 = $component->getProperty( 'uid' ); } if( !$arg1 ) { // plain insert, last in chain $this->components[] = $component->copy(); return TRUE; } $argType = $index = null; if ( ctype_digit( (string) $arg1 )) { // index insert/replace $argType = 'INDEX'; $index = (int) $arg1 - 1; } elseif( in_array( strtolower( $arg1 ), array( 'vevent', 'vtodo', 'vjournal', 'vfreebusy', 'valarm', 'vtimezone' ))) { $argType = strtolower( $arg1 ); $index = ( ctype_digit( (string) $arg2 )) ? ((int) $arg2) - 1 : 0; } // else if arg1 is set, arg1 must be an UID $cix1sC = 0; foreach ( $this->components as $cix => $component2) { if( empty( $component2 )) continue; if(( 'INDEX' == $argType ) && ( $index == $cix )) { // index insert/replace $this->components[$cix] = $component->copy(); return TRUE; } elseif( $argType == $component2->objName ) { // component Type index insert/replace if( $index == $cix1sC ) { $this->components[$cix] = $component->copy(); return TRUE; } $cix1sC++; } elseif( !$argType && ( $arg1 == $component2->getProperty( 'uid' ))) { // UID insert/replace $this->components[$cix] = $component->copy(); return TRUE; } } /* arg1=index and not found.. . insert at index .. .*/ if( 'INDEX' == $argType ) { $this->components[$index] = $component->copy(); ksort( $this->components, SORT_NUMERIC ); } else /* not found.. . insert last in chain anyway .. .*/ $this->components[] = $component->copy(); return TRUE; } /** * sort iCal compoments * * ascending sort on properties (if exist) x-current-dtstart, dtstart, * x-current-dtend, dtend, x-current-due, due, duration, created, dtstamp, uid if called without arguments, * otherwise sorting on specific (argument) property values * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.13.4 - 2012-08-07 * @param string $sortArg, optional * @return void * */ function sort( $sortArg=FALSE ) { if( is_array( $this->components )) { if( $sortArg ) { $sortArg = strtoupper( $sortArg ); if( !in_array( $sortArg, array( 'ATTENDEE', 'CATEGORIES', 'CONTACT', 'DTSTAMP', 'LOCATION', 'ORGANIZER', 'PRIORITY', 'RELATED-TO', 'RESOURCES', 'STATUS', 'SUMMARY', 'URL' ))) $sortArg = FALSE; } /* set sort parameters for each component */ foreach( $this->components as $cix => & $c ) { $c->srtk = array( '0', '0', '0', '0' ); if( 'vtimezone' == $c->objName ) { if( FALSE === ( $c->srtk[0] = $c->getProperty( 'tzid' ))) $c->srtk[0] = 0; continue; } elseif( $sortArg ) { if(( 'ATTENDEE' == $sortArg ) || ( 'CATEGORIES' == $sortArg ) || ( 'CONTACT' == $sortArg ) || ( 'RELATED-TO' == $sortArg ) || ( 'RESOURCES' == $sortArg )) { $propValues = array(); $c->_getProperties( $sortArg, $propValues ); if( !empty( $propValues )) { $sk = array_keys( $propValues ); $c->srtk[0] = $sk[0]; if( 'RELATED-TO' == $sortArg ) $c->srtk[0] .= $c->getProperty( 'uid' ); } elseif( 'RELATED-TO' == $sortArg ) $c->srtk[0] = $c->getProperty( 'uid' ); } elseif( FALSE !== ( $d = $c->getProperty( $sortArg ))) $c->srtk[0] = $d; continue; } if( FALSE !== ( $d = $c->getProperty( 'X-CURRENT-DTSTART' ))) { $c->srtk[0] = iCalUtilityFunctions::_date_time_string( $d[1] ); unset( $c->srtk[0]['unparsedtext'] ); } elseif( FALSE === ( $c->srtk[0] = $c->getProperty( 'dtstart' ))) $c->srtk[1] = 0; // sortkey 0 : dtstart if( FALSE !== ( $d = $c->getProperty( 'X-CURRENT-DTEND' ))) { $c->srtk[1] = iCalUtilityFunctions::_date_time_string( $d[1] ); // sortkey 1 : dtend/due(/dtstart+duration) unset( $c->srtk[1]['unparsedtext'] ); } elseif( FALSE === ( $c->srtk[1] = $c->getProperty( 'dtend' ))) { if( FALSE !== ( $d = $c->getProperty( 'X-CURRENT-DUE' ))) { $c->srtk[1] = iCalUtilityFunctions::_date_time_string( $d[1] ); unset( $c->srtk[1]['unparsedtext'] ); } elseif( FALSE === ( $c->srtk[1] = $c->getProperty( 'due' ))) if( FALSE === ( $c->srtk[1] = $c->getProperty( 'duration', FALSE, FALSE, TRUE ))) $c->srtk[1] = 0; } if( FALSE === ( $c->srtk[2] = $c->getProperty( 'created' ))) // sortkey 2 : created/dtstamp if( FALSE === ( $c->srtk[2] = $c->getProperty( 'dtstamp' ))) $c->srtk[2] = 0; if( FALSE === ( $c->srtk[3] = $c->getProperty( 'uid' ))) // sortkey 3 : uid $c->srtk[3] = 0; } // end foreach( $this->components as & $c /* sort */ usort( $this->components, array( $this, '_cmpfcn' )); } } function _cmpfcn( $a, $b ) { if( empty( $a )) return -1; if( empty( $b )) return 1; if( 'vtimezone' == $a->objName ) { if( 'vtimezone' != $b->objName ) return -1; elseif( $a->srtk[0] <= $b->srtk[0] ) return -1; else return 1; } elseif( 'vtimezone' == $b->objName ) return 1; $sortkeys = array( 'year', 'month', 'day', 'hour', 'min', 'sec' ); for( $k = 0; $k < 4 ; $k++ ) { if( empty( $a->srtk[$k] )) return -1; elseif( empty( $b->srtk[$k] )) return 1; if( is_array( $a->srtk[$k] )) { if( is_array( $b->srtk[$k] )) { foreach( $sortkeys as $key ) { if ( !isset( $a->srtk[$k][$key] )) return -1; elseif( !isset( $b->srtk[$k][$key] )) return 1; if ( empty( $a->srtk[$k][$key] )) return -1; elseif( empty( $b->srtk[$k][$key] )) return 1; if ( $a->srtk[$k][$key] == $b->srtk[$k][$key]) continue; if (( (int) $a->srtk[$k][$key] ) < ((int) $b->srtk[$k][$key] )) return -1; elseif(( (int) $a->srtk[$k][$key] ) > ((int) $b->srtk[$k][$key] )) return 1; } } else return -1; } elseif( is_array( $b->srtk[$k] )) return 1; elseif( $a->srtk[$k] < $b->srtk[$k] ) return -1; elseif( $a->srtk[$k] > $b->srtk[$k] ) return 1; } return 0; } /** * parse iCal text/file into vcalendar, components, properties and parameters * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.12.17 - 2012-07-12 * @param mixed $unparsedtext, optional, strict rfc2445 formatted, single property string or array of property strings * @return bool FALSE if error occurs during parsing * */ function parse( $unparsedtext=FALSE ) { $nl = $this->getConfig( 'nl' ); if(( FALSE === $unparsedtext ) || empty( $unparsedtext )) { /* directory+filename is set previously via setConfig directory+filename or url */ if( FALSE === ( $filename = $this->getConfig( 'url' ))) $filename = $this->getConfig( 'dirfile' ); /* READ FILE */ if( FALSE === ( $rows = file_get_contents( $filename ))) return FALSE; /* err 1 */ } elseif( is_array( $unparsedtext )) $rows = implode( '\n'.$nl, $unparsedtext ); else $rows = & $unparsedtext; /* fix line folding */ $rows = explode( $nl, iCalUtilityFunctions::convEolChar( $rows, $nl )); /* skip leading (empty/invalid) lines */ foreach( $rows as $lix => $line ) { if( FALSE !== stripos( $line, 'BEGIN:VCALENDAR' )) break; unset( $rows[$lix] ); } $rcnt = count( $rows ); if( 3 > $rcnt ) /* err 10 */ return FALSE; /* skip trailing empty lines and ensure an end row */ $lix = array_keys( $rows ); $lix = end( $lix ); while( 3 < $lix ) { $tst = trim( $rows[$lix] ); if(( '\n' == $tst ) || empty( $tst )) { unset( $rows[$lix] ); $lix--; continue; } if( FALSE === stripos( $rows[$lix], 'END:VCALENDAR' )) $rows[] = 'END:VCALENDAR'; break; } $comp = & $this; $calsync = $compsync = 0; /* identify components and update unparsed data within component */ $config = $this->getConfig(); $endtxt = array( 'END:VE', 'END:VF', 'END:VJ', 'END:VT' ); foreach( $rows as $lix => $line ) { if( 'BEGIN:VCALENDAR' == strtoupper( substr( $line, 0, 15 ))) { $calsync++; continue; } elseif( 'END:VCALENDAR' == strtoupper( substr( $line, 0, 13 ))) { if( 0 < $compsync ) $this->components[] = $comp->copy(); $compsync--; $calsync--; break; } elseif( 1 != $calsync ) return FALSE; /* err 20 */ elseif( in_array( strtoupper( substr( $line, 0, 6 )), $endtxt )) { $this->components[] = $comp->copy(); $compsync--; continue; } if( 'BEGIN:VEVENT' == strtoupper( substr( $line, 0, 12 ))) { $comp = new vevent( $config ); $compsync++; } elseif( 'BEGIN:VFREEBUSY' == strtoupper( substr( $line, 0, 15 ))) { $comp = new vfreebusy( $config ); $compsync++; } elseif( 'BEGIN:VJOURNAL' == strtoupper( substr( $line, 0, 14 ))) { $comp = new vjournal( $config ); $compsync++; } elseif( 'BEGIN:VTODO' == strtoupper( substr( $line, 0, 11 ))) { $comp = new vtodo( $config ); $compsync++; } elseif( 'BEGIN:VTIMEZONE' == strtoupper( substr( $line, 0, 15 ))) { $comp = new vtimezone( $config ); $compsync++; } else { /* update component with unparsed data */ $comp->unparsed[] = $line; } } // end foreach( $rows as $line ) unset( $config, $endtxt ); /* parse data for calendar (this) object */ if( isset( $this->unparsed ) && is_array( $this->unparsed ) && ( 0 < count( $this->unparsed ))) { /* concatenate property values spread over several lines */ $lastix = -1; $propnames = array( 'calscale','method','prodid','version','x-' ); $proprows = array(); foreach( $this->unparsed as $line ) { $newProp = FALSE; foreach ( $propnames as $propname ) { if( $propname == strtolower( substr( $line, 0, strlen( $propname )))) { $newProp = TRUE; break; } } if( $newProp ) { $newProp = FALSE; $lastix++; $proprows[$lastix] = $line; } else $proprows[$lastix] .= '!"#¤%&/()=?'.$line; } $paramMStz = array( 'utc-', 'utc+', 'gmt-', 'gmt+' ); $paramProto3 = array( 'fax:', 'cid:', 'sms:', 'tel:', 'urn:' ); $paramProto4 = array( 'crid:', 'news:', 'pres:' ); foreach( $proprows as $line ) { $line = str_replace( '!"#¤%&/()=? ', '', $line ); $line = str_replace( '!"#¤%&/()=?', '', $line ); if( '\n' == substr( $line, -2 )) $line = substr( $line, 0, -2 ); /* get property name */ $propname = null; $cix = 0; while( FALSE !== ( $char = substr( $line, $cix, 1 ))) { if( in_array( $char, array( ':', ';' ))) break; else $propname .= $char; $cix++; } /* ignore version/prodid properties */ if( in_array( strtoupper( $propname ), array( 'VERSION', 'PRODID' ))) continue; $line = substr( $line, $cix); /* separate attributes from value */ $attr = array(); $attrix = -1; $strlen = strlen( $line ); $WithinQuotes = FALSE; $cix = 0; while( FALSE !== substr( $line, $cix, 1 )) { if( ( ':' == $line[$cix] ) && ( substr( $line,$cix, 3 ) != '://' ) && ( !in_array( strtolower( substr( $line,$cix - 6, 4 )), $paramMStz )) && ( !in_array( strtolower( substr( $line,$cix - 3, 4 )), $paramProto3 )) && ( !in_array( strtolower( substr( $line,$cix - 4, 5 )), $paramProto4 )) && ( strtolower( substr( $line,$cix - 6, 7 )) != 'mailto:' ) && !$WithinQuotes ) { $attrEnd = TRUE; if(( $cix < ( $strlen - 4 )) && ctype_digit( substr( $line, $cix+1, 4 ))) { // an URI with a (4pos) portnr?? for( $c2ix = $cix; 3 < $c2ix; $c2ix-- ) { if( '://' == substr( $line, $c2ix - 2, 3 )) { $attrEnd = FALSE; break; // an URI with a portnr!! } } } if( $attrEnd) { $line = substr( $line, ( $cix + 1 )); break; } } if( '"' == $line[$cix] ) $WithinQuotes = ( FALSE === $WithinQuotes ) ? TRUE : FALSE; if( ';' == $line[$cix] ) $attr[++$attrix] = null; else $attr[$attrix] .= $line[$cix]; $cix++; } /* make attributes in array format */ $propattr = array(); foreach( $attr as $attribute ) { $attrsplit = explode( '=', $attribute, 2 ); if( 1 < count( $attrsplit )) $propattr[$attrsplit[0]] = $attrsplit[1]; else $propattr[] = $attribute; } /* update Property */ if( FALSE !== strpos( $line, ',' )) { $content = array( 0 => '' ); $cix = $lix = 0; while( FALSE !== substr( $line, $lix, 1 )) { if(( 0 < $lix ) && ( ',' == $line[$lix] ) && ( "\\" != $line[( $lix - 1 )])) { $cix++; $content[$cix] = ''; } else $content[$cix] .= $line[$lix]; $lix++; } if( 1 < count( $content )) { foreach( $content as $cix => $contentPart ) $content[$cix] = calendarComponent::_strunrep( $contentPart ); $this->setProperty( $propname, $content, $propattr ); continue; } else $line = reset( $content ); $line = calendarComponent::_strunrep( $line ); } $this->setProperty( $propname, rtrim( $line, "\x00..\x1F" ), $propattr ); } // end - foreach( $this->unparsed.. . } // end - if( is_array( $this->unparsed.. . unset( $unparsedtext, $rows, $this->unparsed, $proprows ); /* parse Components */ if( is_array( $this->components ) && ( 0 < count( $this->components ))) { $ckeys = array_keys( $this->components ); foreach( $ckeys as $ckey ) { if( !empty( $this->components[$ckey] ) && !empty( $this->components[$ckey]->unparsed )) { $this->components[$ckey]->parse(); } } } else return FALSE; /* err 91 or something.. . */ return TRUE; } /*********************************************************************************/ /** * creates formatted output for calendar object instance * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.10.16 - 2011-10-28 * @return string */ function createCalendar() { $calendarInit = $calendarxCaldecl = $calendarStart = $calendar = ''; switch( $this->format ) { case 'xcal': $calendarInit = ''.$this->nl. 'nl. '"http://www.ietf.org/internet-drafts/draft-ietf-calsch-many-xcal-01.txt"'; $calendarStart = '>'.$this->nl.'nl; break; } $calendarStart .= $this->createVersion(); $calendarStart .= $this->createProdid(); $calendarStart .= $this->createCalscale(); $calendarStart .= $this->createMethod(); if( 'xcal' == $this->format ) $calendarStart .= '>'.$this->nl; $calendar .= $this->createXprop(); foreach( $this->components as $component ) { if( empty( $component )) continue; $component->setConfig( $this->getConfig(), FALSE, TRUE ); $calendar .= $component->createComponent( $this->xcaldecl ); } if(( 'xcal' == $this->format ) && ( 0 < count( $this->xcaldecl ))) { // xCal only $calendarInit .= ' ['; $old_xcaldecl = array(); foreach( $this->xcaldecl as $declix => $declPart ) { if(( 0 < count( $old_xcaldecl)) && isset( $declPart['uri'] ) && isset( $declPart['external'] ) && isset( $old_xcaldecl['uri'] ) && isset( $old_xcaldecl['external'] ) && ( in_array( $declPart['uri'], $old_xcaldecl['uri'] )) && ( in_array( $declPart['external'], $old_xcaldecl['external'] ))) continue; // no duplicate uri and ext. references if(( 0 < count( $old_xcaldecl)) && !isset( $declPart['uri'] ) && !isset( $declPart['uri'] ) && isset( $declPart['ref'] ) && isset( $old_xcaldecl['ref'] ) && ( in_array( $declPart['ref'], $old_xcaldecl['ref'] ))) continue; // no duplicate element declarations $calendarxCaldecl .= $this->nl.' $declValue ) { switch( $declKey ) { // index case 'xmldecl': // no 1 $calendarxCaldecl .= $declValue.' '; break; case 'uri': // no 2 $calendarxCaldecl .= $declValue.' '; $old_xcaldecl['uri'][] = $declValue; break; case 'ref': // no 3 $calendarxCaldecl .= $declValue.' '; $old_xcaldecl['ref'][] = $declValue; break; case 'external': // no 4 $calendarxCaldecl .= '"'.$declValue.'" '; $old_xcaldecl['external'][] = $declValue; break; case 'type': // no 5 $calendarxCaldecl .= $declValue.' '; break; case 'type2': // no 6 $calendarxCaldecl .= $declValue; break; } } $calendarxCaldecl .= '>'; } $calendarxCaldecl .= $this->nl.']'; } switch( $this->format ) { case 'xcal': $calendar .= ''.$this->nl; break; default: $calendar .= 'END:VCALENDAR'.$this->nl; break; } return $calendarInit.$calendarxCaldecl.$calendarStart.$calendar; } /** * a HTTP redirect header is sent with created, updated and/or parsed calendar * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.10.24 - 2011-12-23 * @param bool $utf8Encode * @param bool $gzip * @return redirect */ function returnCalendar( $utf8Encode=FALSE, $gzip=FALSE ) { $filename = $this->getConfig( 'filename' ); $output = $this->createCalendar(); if( $utf8Encode ) $output = utf8_encode( $output ); if( $gzip ) { $output = gzencode( $output, 9 ); header( 'Content-Encoding: gzip' ); header( 'Vary: *' ); header( 'Content-Length: '.strlen( $output )); } if( 'xcal' == $this->format ) header( 'Content-Type: application/calendar+xml; charset=utf-8' ); else header( 'Content-Type: text/calendar; charset=utf-8' ); header( 'Content-Disposition: attachment; filename="'.$filename.'"' ); header( 'Cache-Control: max-age=10' ); die( $output ); } /** * save content in a file * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.2.12 - 2007-12-30 * @param string $directory optional * @param string $filename optional * @param string $delimiter optional * @return bool */ function saveCalendar( $directory=FALSE, $filename=FALSE, $delimiter=FALSE ) { if( $directory ) $this->setConfig( 'directory', $directory ); if( $filename ) $this->setConfig( 'filename', $filename ); if( $delimiter && ($delimiter != DIRECTORY_SEPARATOR )) $this->setConfig( 'delimiter', $delimiter ); if( FALSE === ( $dirfile = $this->getConfig( 'url' ))) $dirfile = $this->getConfig( 'dirfile' ); $iCalFile = @fopen( $dirfile, 'w' ); if( $iCalFile ) { if( FALSE === fwrite( $iCalFile, $this->createCalendar() )) return FALSE; fclose( $iCalFile ); return TRUE; } else return FALSE; } /** * if recent version of calendar file exists (default one hour), an HTTP redirect header is sent * else FALSE is returned * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.2.12 - 2007-10-28 * @param string $directory optional alt. int timeout * @param string $filename optional * @param string $delimiter optional * @param int timeout optional, default 3600 sec * @return redirect/FALSE */ function useCachedCalendar( $directory=FALSE, $filename=FALSE, $delimiter=FALSE, $timeout=3600) { if ( $directory && ctype_digit( (string) $directory ) && !$filename ) { $timeout = (int) $directory; $directory = FALSE; } if( $directory ) $this->setConfig( 'directory', $directory ); if( $filename ) $this->setConfig( 'filename', $filename ); if( $delimiter && ( $delimiter != DIRECTORY_SEPARATOR )) $this->setConfig( 'delimiter', $delimiter ); $filesize = $this->getConfig( 'filesize' ); if( 0 >= $filesize ) return FALSE; $dirfile = $this->getConfig( 'dirfile' ); if( time() - filemtime( $dirfile ) < $timeout) { clearstatcache(); $dirfile = $this->getConfig( 'dirfile' ); $filename = $this->getConfig( 'filename' ); // if( headers_sent( $filename, $linenum )) // die( "Headers already sent in $filename on line $linenum\n" ); if( 'xcal' == $this->format ) header( 'Content-Type: application/calendar+xml; charset=utf-8' ); else header( 'Content-Type: text/calendar; charset=utf-8' ); header( 'Content-Length: '.$filesize ); header( 'Content-Disposition: attachment; filename="'.$filename.'"' ); header( 'Cache-Control: max-age=10' ); $fp = @fopen( $dirfile, 'r' ); if( $fp ) { fpassthru( $fp ); fclose( $fp ); } die(); } else return FALSE; } } /*********************************************************************************/ /*********************************************************************************/ /** * abstract class for calendar components * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.9.6 - 2011-05-14 */ class calendarComponent { // component property variables var $uid; var $dtstamp; // component config variables var $allowEmpty; var $language; var $nl; var $unique_id; var $format; var $objName; // created automatically at instance creation var $dtzid; // default (local) timezone // component internal variables var $componentStart1; var $componentStart2; var $componentEnd1; var $componentEnd2; var $elementStart1; var $elementStart2; var $elementEnd1; var $elementEnd2; var $intAttrDelimiter; var $attributeDelimiter; var $valueInit; // component xCal declaration container var $xcaldecl; /** * constructor for calendar component object * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.9.6 - 2011-05-17 */ function calendarComponent() { $this->objName = ( isset( $this->timezonetype )) ? strtolower( $this->timezonetype ) : get_class ( $this ); $this->uid = array(); $this->dtstamp = array(); $this->language = null; $this->nl = null; $this->unique_id = null; $this->format = null; $this->dtzid = null; $this->allowEmpty = TRUE; $this->xcaldecl = array(); $this->_createFormat(); $this->_makeDtstamp(); } /*********************************************************************************/ /** * Property Name: ACTION */ /** * creates formatted output for calendar component property action * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-22 * @return string */ function createAction() { if( empty( $this->action )) return FALSE; if( empty( $this->action['value'] )) return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'ACTION' ) : FALSE; $attributes = $this->_createParams( $this->action['params'] ); return $this->_createElement( 'ACTION', $attributes, $this->action['value'] ); } /** * set calendar component property action * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-11-04 * @param string $value "AUDIO" / "DISPLAY" / "EMAIL" / "PROCEDURE" * @param mixed $params * @return bool */ function setAction( $value, $params=FALSE ) { if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; $this->action = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); return TRUE; } /*********************************************************************************/ /** * Property Name: ATTACH */ /** * creates formatted output for calendar component property attach * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.11.16 - 2012-02-04 * @return string */ function createAttach() { if( empty( $this->attach )) return FALSE; $output = null; foreach( $this->attach as $attachPart ) { if( !empty( $attachPart['value'] )) { $attributes = $this->_createParams( $attachPart['params'] ); if(( 'xcal' != $this->format ) && isset( $attachPart['params']['VALUE'] ) && ( 'BINARY' == $attachPart['params']['VALUE'] )) { $attributes = str_replace( $this->intAttrDelimiter, $this->attributeDelimiter, $attributes ); $str = 'ATTACH'.$attributes.$this->valueInit.$attachPart['value']; $output = substr( $str, 0, 75 ).$this->nl; $str = substr( $str, 75 ); $output .= ' '.chunk_split( $str, 74, $this->nl.' ' ); if( ' ' == substr( $output, -1 )) $output = rtrim( $output ); if( $this->nl != substr( $output, ( 0 - strlen( $this->nl )))) $output .= $this->nl; return $output; } $output .= $this->_createElement( 'ATTACH', $attributes, $attachPart['value'] ); } elseif( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'ATTACH' ); } return $output; } /** * set calendar component property attach * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.5.1 - 2008-11-06 * @param string $value * @param array $params, optional * @param integer $index, optional * @return bool */ function setAttach( $value, $params=FALSE, $index=FALSE ) { if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; iCalUtilityFunctions::_setMval( $this->attach, $value, $params, FALSE, $index ); return TRUE; } /*********************************************************************************/ /** * Property Name: ATTENDEE */ /** * creates formatted output for calendar component property attendee * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.11.12 - 2012-01-31 * @return string */ function createAttendee() { if( empty( $this->attendee )) return FALSE; $output = null; foreach( $this->attendee as $attendeePart ) { // start foreach 1 if( empty( $attendeePart['value'] )) { if( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'ATTENDEE' ); continue; } $attendee1 = $attendee2 = null; foreach( $attendeePart as $paramlabel => $paramvalue ) { // start foreach 2 if( 'value' == $paramlabel ) $attendee2 .= $paramvalue; elseif(( 'params' == $paramlabel ) && ( is_array( $paramvalue ))) { // start elseif $mParams = array( 'MEMBER', 'DELEGATED-TO', 'DELEGATED-FROM' ); foreach( $paramvalue as $pKey => $pValue ) { // fix (opt) quotes if( is_array( $pValue ) || in_array( $pKey, $mParams )) continue; if(( FALSE !== strpos( $pValue, ':' )) || ( FALSE !== strpos( $pValue, ';' )) || ( FALSE !== strpos( $pValue, ',' ))) $paramvalue[$pKey] = '"'.$pValue.'"'; } // set attenddee parameters in rfc2445 order if( isset( $paramvalue['CUTYPE'] )) $attendee1 .= $this->intAttrDelimiter.'CUTYPE='.$paramvalue['CUTYPE']; if( isset( $paramvalue['MEMBER'] )) { $attendee1 .= $this->intAttrDelimiter.'MEMBER='; foreach( $paramvalue['MEMBER'] as $cix => $opv ) $attendee1 .= ( $cix ) ? ',"'.$opv.'"' : '"'.$opv.'"' ; } if( isset( $paramvalue['ROLE'] )) $attendee1 .= $this->intAttrDelimiter.'ROLE='.$paramvalue['ROLE']; if( isset( $paramvalue['PARTSTAT'] )) $attendee1 .= $this->intAttrDelimiter.'PARTSTAT='.$paramvalue['PARTSTAT']; if( isset( $paramvalue['RSVP'] )) $attendee1 .= $this->intAttrDelimiter.'RSVP='.$paramvalue['RSVP']; if( isset( $paramvalue['DELEGATED-TO'] )) { $attendee1 .= $this->intAttrDelimiter.'DELEGATED-TO='; foreach( $paramvalue['DELEGATED-TO'] as $cix => $opv ) $attendee1 .= ( $cix ) ? ',"'.$opv.'"' : '"'.$opv.'"' ; } if( isset( $paramvalue['DELEGATED-FROM'] )) { $attendee1 .= $this->intAttrDelimiter.'DELEGATED-FROM='; foreach( $paramvalue['DELEGATED-FROM'] as $cix => $opv ) $attendee1 .= ( $cix ) ? ',"'.$opv.'"' : '"'.$opv.'"' ; } if( isset( $paramvalue['SENT-BY'] )) $attendee1 .= $this->intAttrDelimiter.'SENT-BY='.$paramvalue['SENT-BY']; if( isset( $paramvalue['CN'] )) $attendee1 .= $this->intAttrDelimiter.'CN='.$paramvalue['CN']; if( isset( $paramvalue['DIR'] )) { $delim = ( FALSE === strpos( $paramvalue['DIR'], '"' )) ? '"' : ''; $attendee1 .= $this->intAttrDelimiter.'DIR='.$delim.$paramvalue['DIR'].$delim; } if( isset( $paramvalue['LANGUAGE'] )) $attendee1 .= $this->intAttrDelimiter.'LANGUAGE='.$paramvalue['LANGUAGE']; $xparams = array(); foreach( $paramvalue as $optparamlabel => $optparamvalue ) { // start foreach 3 if( ctype_digit( (string) $optparamlabel )) { $xparams[] = $optparamvalue; continue; } if( !in_array( $optparamlabel, array( 'CUTYPE', 'MEMBER', 'ROLE', 'PARTSTAT', 'RSVP', 'DELEGATED-TO', 'DELEGATED-FROM', 'SENT-BY', 'CN', 'DIR', 'LANGUAGE' ))) $xparams[$optparamlabel] = $optparamvalue; } // end foreach 3 ksort( $xparams, SORT_STRING ); foreach( $xparams as $paramKey => $paramValue ) { if( ctype_digit( (string) $paramKey )) $attendee1 .= $this->intAttrDelimiter.$paramValue; else $attendee1 .= $this->intAttrDelimiter."$paramKey=$paramValue"; } // end foreach 3 } // end elseif(( 'params' == $paramlabel ) && ( is_array( $paramvalue ))) } // end foreach 2 $output .= $this->_createElement( 'ATTENDEE', $attendee1, $attendee2 ); } // end foreach 1 return $output; } /** * set calendar component property attach * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.12.18 - 2012-07-13 * @param string $value * @param array $params, optional * @param integer $index, optional * @return bool */ function setAttendee( $value, $params=FALSE, $index=FALSE ) { if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; // ftp://, http://, mailto:, file://, gopher://, news:, nntp://, telnet://, wais://, prospero:// may exist.. . also in params if( !empty( $value )) { if( FALSE === ( $pos = strpos( substr( $value, 0, 9 ), ':' ))) $value = 'MAILTO:'.$value; elseif( !empty( $value )) $value = strtolower( substr( $value, 0, $pos )).substr( $value, $pos ); $value = str_replace( 'mailto:', 'MAILTO:', $value ); } $params2 = array(); if( is_array($params )) { $optarrays = array(); foreach( $params as $optparamlabel => $optparamvalue ) { $optparamlabel = strtoupper( $optparamlabel ); switch( $optparamlabel ) { case 'MEMBER': case 'DELEGATED-TO': case 'DELEGATED-FROM': if( !is_array( $optparamvalue )) $optparamvalue = array( $optparamvalue ); foreach( $optparamvalue as $part ) { $part = trim( $part ); if(( '"' == substr( $part, 0, 1 )) && ( '"' == substr( $part, -1 ))) $part = substr( $part, 1, ( strlen( $part ) - 2 )); if( 'mailto:' != strtolower( substr( $part, 0, 7 ))) $part = "MAILTO:$part"; else $part = 'MAILTO:'.substr( $part, 7 ); $optarrays[$optparamlabel][] = $part; } break; default: if(( '"' == substr( $optparamvalue, 0, 1 )) && ( '"' == substr( $optparamvalue, -1 ))) $optparamvalue = substr( $optparamvalue, 1, ( strlen( $optparamvalue ) - 2 )); if( 'SENT-BY' == $optparamlabel ) { if( 'mailto:' != strtolower( substr( $optparamvalue, 0, 7 ))) $optparamvalue = "MAILTO:$optparamvalue"; else $optparamvalue = 'MAILTO:'.substr( $optparamvalue, 7 ); } $params2[$optparamlabel] = $optparamvalue; break; } // end switch( $optparamlabel.. . } // end foreach( $optparam.. . foreach( $optarrays as $optparamlabel => $optparams ) $params2[$optparamlabel] = $optparams; } // remove defaults iCalUtilityFunctions::_existRem( $params2, 'CUTYPE', 'INDIVIDUAL' ); iCalUtilityFunctions::_existRem( $params2, 'PARTSTAT', 'NEEDS-ACTION' ); iCalUtilityFunctions::_existRem( $params2, 'ROLE', 'REQ-PARTICIPANT' ); iCalUtilityFunctions::_existRem( $params2, 'RSVP', 'FALSE' ); // check language setting if( isset( $params2['CN' ] )) { $lang = $this->getConfig( 'language' ); if( !isset( $params2['LANGUAGE' ] ) && !empty( $lang )) $params2['LANGUAGE' ] = $lang; } iCalUtilityFunctions::_setMval( $this->attendee, $value, $params2, FALSE, $index ); return TRUE; } /*********************************************************************************/ /** * Property Name: CATEGORIES */ /** * creates formatted output for calendar component property categories * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-22 * @return string */ function createCategories() { if( empty( $this->categories )) return FALSE; $output = null; foreach( $this->categories as $category ) { if( empty( $category['value'] )) { if ( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'CATEGORIES' ); continue; } $attributes = $this->_createParams( $category['params'], array( 'LANGUAGE' )); if( is_array( $category['value'] )) { foreach( $category['value'] as $cix => $categoryPart ) $category['value'][$cix] = $this->_strrep( $categoryPart ); $content = implode( ',', $category['value'] ); } else $content = $this->_strrep( $category['value'] ); $output .= $this->_createElement( 'CATEGORIES', $attributes, $content ); } return $output; } /** * set calendar component property categories * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.5.1 - 2008-11-06 * @param mixed $value * @param array $params, optional * @param integer $index, optional * @return bool */ function setCategories( $value, $params=FALSE, $index=FALSE ) { if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; iCalUtilityFunctions::_setMval( $this->categories, $value, $params, FALSE, $index ); return TRUE; } /*********************************************************************************/ /** * Property Name: CLASS */ /** * creates formatted output for calendar component property class * * @author Kjell-Inge Gustafsson, kigkonsult * @since 0.9.7 - 2006-11-20 * @return string */ function createClass() { if( empty( $this->class )) return FALSE; if( empty( $this->class['value'] )) return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'CLASS' ) : FALSE; $attributes = $this->_createParams( $this->class['params'] ); return $this->_createElement( 'CLASS', $attributes, $this->class['value'] ); } /** * set calendar component property class * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-11-04 * @param string $value "PUBLIC" / "PRIVATE" / "CONFIDENTIAL" / iana-token / x-name * @param array $params optional * @return bool */ function setClass( $value, $params=FALSE ) { if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; $this->class = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); return TRUE; } /*********************************************************************************/ /** * Property Name: COMMENT */ /** * creates formatted output for calendar component property comment * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-22 * @return string */ function createComment() { if( empty( $this->comment )) return FALSE; $output = null; foreach( $this->comment as $commentPart ) { if( empty( $commentPart['value'] )) { if( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'COMMENT' ); continue; } $attributes = $this->_createParams( $commentPart['params'], array( 'ALTREP', 'LANGUAGE' )); $content = $this->_strrep( $commentPart['value'] ); $output .= $this->_createElement( 'COMMENT', $attributes, $content ); } return $output; } /** * set calendar component property comment * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.5.1 - 2008-11-06 * @param string $value * @param array $params, optional * @param integer $index, optional * @return bool */ function setComment( $value, $params=FALSE, $index=FALSE ) { if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; iCalUtilityFunctions::_setMval( $this->comment, $value, $params, FALSE, $index ); return TRUE; } /*********************************************************************************/ /** * Property Name: COMPLETED */ /** * creates formatted output for calendar component property completed * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-22 * @return string */ function createCompleted( ) { if( empty( $this->completed )) return FALSE; if( !isset( $this->completed['value']['year'] ) && !isset( $this->completed['value']['month'] ) && !isset( $this->completed['value']['day'] ) && !isset( $this->completed['value']['hour'] ) && !isset( $this->completed['value']['min'] ) && !isset( $this->completed['value']['sec'] )) if( $this->getConfig( 'allowEmpty' )) return $this->_createElement( 'COMPLETED' ); else return FALSE; $formatted = iCalUtilityFunctions::_format_date_time( $this->completed['value'], 7 ); $attributes = $this->_createParams( $this->completed['params'] ); return $this->_createElement( 'COMPLETED', $attributes, $formatted ); } /** * set calendar component property completed * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-23 * @param mixed $year * @param mixed $month optional * @param int $day optional * @param int $hour optional * @param int $min optional * @param int $sec optional * @param array $params optional * @return bool */ function setCompleted( $year, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $params=FALSE ) { if( empty( $year )) { if( $this->getConfig( 'allowEmpty' )) { $this->completed = array( 'value' => null, 'params' => iCalUtilityFunctions::_setParams( $params )); return TRUE; } else return FALSE; } $this->completed = iCalUtilityFunctions::_setDate2( $year, $month, $day, $hour, $min, $sec, $params ); return TRUE; } /*********************************************************************************/ /** * Property Name: CONTACT */ /** * creates formatted output for calendar component property contact * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-23 * @return string */ function createContact() { if( empty( $this->contact )) return FALSE; $output = null; foreach( $this->contact as $contact ) { if( !empty( $contact['value'] )) { $attributes = $this->_createParams( $contact['params'], array( 'ALTREP', 'LANGUAGE' )); $content = $this->_strrep( $contact['value'] ); $output .= $this->_createElement( 'CONTACT', $attributes, $content ); } elseif( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'CONTACT' ); } return $output; } /** * set calendar component property contact * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.5.1 - 2008-11-05 * @param string $value * @param array $params, optional * @param integer $index, optional * @return bool */ function setContact( $value, $params=FALSE, $index=FALSE ) { if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; iCalUtilityFunctions::_setMval( $this->contact, $value, $params, FALSE, $index ); return TRUE; } /*********************************************************************************/ /** * Property Name: CREATED */ /** * creates formatted output for calendar component property created * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-21 * @return string */ function createCreated() { if( empty( $this->created )) return FALSE; $formatted = iCalUtilityFunctions::_format_date_time( $this->created['value'], 7 ); $attributes = $this->_createParams( $this->created['params'] ); return $this->_createElement( 'CREATED', $attributes, $formatted ); } /** * set calendar component property created * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-23 * @param mixed $year optional * @param mixed $month optional * @param int $day optional * @param int $hour optional * @param int $min optional * @param int $sec optional * @param mixed $params optional * @return bool */ function setCreated( $year=FALSE, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $params=FALSE ) { if( !isset( $year )) { $year = date('Ymd\THis', mktime( date( 'H' ), date( 'i' ), date( 's' ) - date( 'Z'), date( 'm' ), date( 'd' ), date( 'Y' ))); } $this->created = iCalUtilityFunctions::_setDate2( $year, $month, $day, $hour, $min, $sec, $params ); return TRUE; } /*********************************************************************************/ /** * Property Name: DESCRIPTION */ /** * creates formatted output for calendar component property description * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-22 * @return string */ function createDescription() { if( empty( $this->description )) return FALSE; $output = null; foreach( $this->description as $description ) { if( !empty( $description['value'] )) { $attributes = $this->_createParams( $description['params'], array( 'ALTREP', 'LANGUAGE' )); $content = $this->_strrep( $description['value'] ); $output .= $this->_createElement( 'DESCRIPTION', $attributes, $content ); } elseif( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'DESCRIPTION' ); } return $output; } /** * set calendar component property description * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.6.24 - 2010-11-06 * @param string $value * @param array $params, optional * @param integer $index, optional * @return bool */ function setDescription( $value, $params=FALSE, $index=FALSE ) { if( empty( $value )) { if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; } if( 'vjournal' != $this->objName ) $index = 1; iCalUtilityFunctions::_setMval( $this->description, $value, $params, FALSE, $index ); return TRUE; } /*********************************************************************************/ /** * Property Name: DTEND */ /** * creates formatted output for calendar component property dtend * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.9.6 - 2011-05-14 * @return string */ function createDtend() { if( empty( $this->dtend )) return FALSE; if( !isset( $this->dtend['value']['year'] ) && !isset( $this->dtend['value']['month'] ) && !isset( $this->dtend['value']['day'] ) && !isset( $this->dtend['value']['hour'] ) && !isset( $this->dtend['value']['min'] ) && !isset( $this->dtend['value']['sec'] )) if( $this->getConfig( 'allowEmpty' )) return $this->_createElement( 'DTEND' ); else return FALSE; $formatted = iCalUtilityFunctions::_format_date_time( $this->dtend['value'] ); if(( FALSE !== ( $tzid = $this->getConfig( 'TZID' ))) && ( !isset( $this->dtend['params']['VALUE'] ) || ( $this->dtend['params']['VALUE'] != 'DATE' )) && !isset( $this->dtend['params']['TZID'] )) $this->dtend['params']['TZID'] = $tzid; $attributes = $this->_createParams( $this->dtend['params'] ); return $this->_createElement( 'DTEND', $attributes, $formatted ); } /** * set calendar component property dtend * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.9.6 - 2011-05-14 * @param mixed $year * @param mixed $month optional * @param int $day optional * @param int $hour optional * @param int $min optional * @param int $sec optional * @param string $tz optional * @param array params optional * @return bool */ function setDtend( $year, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $tz=FALSE, $params=FALSE ) { if( empty( $year )) { if( $this->getConfig( 'allowEmpty' )) { $this->dtend = array( 'value' => null, 'params' => iCalUtilityFunctions::_setParams( $params )); return TRUE; } else return FALSE; } $this->dtend = iCalUtilityFunctions::_setDate( $year, $month, $day, $hour, $min, $sec, $tz, $params, null, null, $this->getConfig( 'TZID' )); return TRUE; } /*********************************************************************************/ /** * Property Name: DTSTAMP */ /** * creates formatted output for calendar component property dtstamp * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.4 - 2008-03-07 * @return string */ function createDtstamp() { if( !isset( $this->dtstamp['value']['year'] ) && !isset( $this->dtstamp['value']['month'] ) && !isset( $this->dtstamp['value']['day'] ) && !isset( $this->dtstamp['value']['hour'] ) && !isset( $this->dtstamp['value']['min'] ) && !isset( $this->dtstamp['value']['sec'] )) $this->_makeDtstamp(); $formatted = iCalUtilityFunctions::_format_date_time( $this->dtstamp['value'], 7 ); $attributes = $this->_createParams( $this->dtstamp['params'] ); return $this->_createElement( 'DTSTAMP', $attributes, $formatted ); } /** * computes datestamp for calendar component object instance dtstamp * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.10.9 - 2011-08-10 * @return void */ function _makeDtstamp() { $d = mktime( date('H'), date('i'), (date('s') - date( 'Z' )), date('m'), date('d'), date('Y')); $this->dtstamp['value'] = array( 'year' => date( 'Y', $d ) , 'month' => date( 'm', $d ) , 'day' => date( 'd', $d ) , 'hour' => date( 'H', $d ) , 'min' => date( 'i', $d ) , 'sec' => date( 's', $d )); $this->dtstamp['params'] = null; } /** * set calendar component property dtstamp * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-23 * @param mixed $year * @param mixed $month optional * @param int $day optional * @param int $hour optional * @param int $min optional * @param int $sec optional * @param array $params optional * @return TRUE */ function setDtstamp( $year, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $params=FALSE ) { if( empty( $year )) $this->_makeDtstamp(); else $this->dtstamp = iCalUtilityFunctions::_setDate2( $year, $month, $day, $hour, $min, $sec, $params ); return TRUE; } /*********************************************************************************/ /** * Property Name: DTSTART */ /** * creates formatted output for calendar component property dtstart * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.9.6 - 2011-05-15 * @return string */ function createDtstart() { if( empty( $this->dtstart )) return FALSE; if( !isset( $this->dtstart['value']['year'] ) && !isset( $this->dtstart['value']['month'] ) && !isset( $this->dtstart['value']['day'] ) && !isset( $this->dtstart['value']['hour'] ) && !isset( $this->dtstart['value']['min'] ) && !isset( $this->dtstart['value']['sec'] )) { if( $this->getConfig( 'allowEmpty' )) return $this->_createElement( 'DTSTART' ); else return FALSE; } if( in_array( $this->objName, array( 'vtimezone', 'standard', 'daylight' ))) unset( $this->dtstart['value']['tz'], $this->dtstart['params']['TZID'] ); elseif(( FALSE !== ( $tzid = $this->getConfig( 'TZID' ))) && ( !isset( $this->dtstart['params']['VALUE'] ) || ( $this->dtstart['params']['VALUE'] != 'DATE' )) && !isset( $this->dtstart['params']['TZID'] )) $this->dtstart['params']['TZID'] = $tzid; $formatted = iCalUtilityFunctions::_format_date_time( $this->dtstart['value'] ); $attributes = $this->_createParams( $this->dtstart['params'] ); return $this->_createElement( 'DTSTART', $attributes, $formatted ); } /** * set calendar component property dtstart * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.6.22 - 2010-09-22 * @param mixed $year * @param mixed $month optional * @param int $day optional * @param int $hour optional * @param int $min optional * @param int $sec optional * @param string $tz optional * @param array $params optional * @return bool */ function setDtstart( $year, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $tz=FALSE, $params=FALSE ) { if( empty( $year )) { if( $this->getConfig( 'allowEmpty' )) { $this->dtstart = array( 'value' => null, 'params' => iCalUtilityFunctions::_setParams( $params )); return TRUE; } else return FALSE; } $this->dtstart = iCalUtilityFunctions::_setDate( $year, $month, $day, $hour, $min, $sec, $tz, $params, 'dtstart', $this->objName, $this->getConfig( 'TZID' )); return TRUE; } /*********************************************************************************/ /** * Property Name: DUE */ /** * creates formatted output for calendar component property due * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-22 * @return string */ function createDue() { if( empty( $this->due )) return FALSE; if( !isset( $this->due['value']['year'] ) && !isset( $this->due['value']['month'] ) && !isset( $this->due['value']['day'] ) && !isset( $this->due['value']['hour'] ) && !isset( $this->due['value']['min'] ) && !isset( $this->due['value']['sec'] )) { if( $this->getConfig( 'allowEmpty' )) return $this->_createElement( 'DUE' ); else return FALSE; } $formatted = iCalUtilityFunctions::_format_date_time( $this->due['value'] ); if(( FALSE !== ( $tzid = $this->getConfig( 'TZID' ))) && ( !isset( $this->due['params']['VALUE'] ) || ( $this->due['params']['VALUE'] != 'DATE' )) && !isset( $this->due['params']['TZID'] )) $this->due['params']['TZID'] = $tzid; $attributes = $this->_createParams( $this->due['params'] ); return $this->_createElement( 'DUE', $attributes, $formatted ); } /** * set calendar component property due * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-11-04 * @param mixed $year * @param mixed $month optional * @param int $day optional * @param int $hour optional * @param int $min optional * @param int $sec optional * @param array $params optional * @return bool */ function setDue( $year, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $tz=FALSE, $params=FALSE ) { if( empty( $year )) { if( $this->getConfig( 'allowEmpty' )) { $this->due = array( 'value' => null, 'params' => iCalUtilityFunctions::_setParams( $params )); return TRUE; } else return FALSE; } $this->due = iCalUtilityFunctions::_setDate( $year, $month, $day, $hour, $min, $sec, $tz, $params, null, null, $this->getConfig( 'TZID' )); return TRUE; } /*********************************************************************************/ /** * Property Name: DURATION */ /** * creates formatted output for calendar component property duration * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-21 * @return string */ function createDuration() { if( empty( $this->duration )) return FALSE; if( !isset( $this->duration['value']['week'] ) && !isset( $this->duration['value']['day'] ) && !isset( $this->duration['value']['hour'] ) && !isset( $this->duration['value']['min'] ) && !isset( $this->duration['value']['sec'] )) if( $this->getConfig( 'allowEmpty' )) return $this->_createElement( 'DURATION', array(), null ); else return FALSE; $attributes = $this->_createParams( $this->duration['params'] ); return $this->_createElement( 'DURATION', $attributes, iCalUtilityFunctions::_format_duration( $this->duration['value'] )); } /** * set calendar component property duration * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-11-04 * @param mixed $week * @param mixed $day optional * @param int $hour optional * @param int $min optional * @param int $sec optional * @param array $params optional * @return bool */ function setDuration( $week, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $params=FALSE ) { if( empty( $week )) if( $this->getConfig( 'allowEmpty' )) $week = null; else return FALSE; if( is_array( $week ) && ( 1 <= count( $week ))) $this->duration = array( 'value' => iCalUtilityFunctions::_duration_array( $week ), 'params' => iCalUtilityFunctions::_setParams( $day )); elseif( is_string( $week ) && ( 3 <= strlen( trim( $week )))) { $week = trim( $week ); if( in_array( substr( $week, 0, 1 ), array( '+', '-' ))) $week = substr( $week, 1 ); $this->duration = array( 'value' => iCalUtilityFunctions::_duration_string( $week ), 'params' => iCalUtilityFunctions::_setParams( $day )); } elseif( empty( $week ) && empty( $day ) && empty( $hour ) && empty( $min ) && empty( $sec )) return FALSE; else $this->duration = array( 'value' => iCalUtilityFunctions::_duration_array( array( $week, $day, $hour, $min, $sec )), 'params' => iCalUtilityFunctions::_setParams( $params )); return TRUE; } /*********************************************************************************/ /** * Property Name: EXDATE */ /** * creates formatted output for calendar component property exdate * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-22 * @return string */ function createExdate() { if( empty( $this->exdate )) return FALSE; $output = null; foreach( $this->exdate as $ex => $theExdate ) { if( empty( $theExdate['value'] )) { if( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'EXDATE' ); continue; } $content = $attributes = null; foreach( $theExdate['value'] as $eix => $exdatePart ) { $parno = count( $exdatePart ); $formatted = iCalUtilityFunctions::_format_date_time( $exdatePart, $parno ); if( isset( $theExdate['params']['TZID'] )) $formatted = str_replace( 'Z', '', $formatted); if( 0 < $eix ) { if( isset( $theExdate['value'][0]['tz'] )) { if( ctype_digit( substr( $theExdate['value'][0]['tz'], -4 )) || ( 'Z' == $theExdate['value'][0]['tz'] )) { if( 'Z' != substr( $formatted, -1 )) $formatted .= 'Z'; } else $formatted = str_replace( 'Z', '', $formatted ); } else $formatted = str_replace( 'Z', '', $formatted ); } $content .= ( 0 < $eix ) ? ','.$formatted : $formatted; } $attributes .= $this->_createParams( $theExdate['params'] ); $output .= $this->_createElement( 'EXDATE', $attributes, $content ); } return $output; } /** * set calendar component property exdate * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.11.8 - 2012-01-19 * @param array exdates * @param array $params, optional * @param integer $index, optional * @return bool */ function setExdate( $exdates, $params=FALSE, $index=FALSE ) { if( empty( $exdates )) { if( $this->getConfig( 'allowEmpty' )) { iCalUtilityFunctions::_setMval( $this->exdate, null, $params, FALSE, $index ); return TRUE; } else return FALSE; } $input = array( 'params' => iCalUtilityFunctions::_setParams( $params, array( 'VALUE' => 'DATE-TIME' ))); $toZ = ( isset( $input['params']['TZID'] ) && in_array( strtoupper( $input['params']['TZID'] ), array( 'GMT', 'UTC', 'Z' ))) ? TRUE : FALSE; /* ev. check 1:st date and save ev. timezone **/ iCalUtilityFunctions::_chkdatecfg( reset( $exdates ), $parno, $input['params'] ); iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE-TIME' ); // remove default parameter foreach( $exdates as $eix => $theExdate ) { iCalUtilityFunctions::_strDate2arr( $theExdate ); if( iCalUtilityFunctions::_isArrayTimestampDate( $theExdate )) $exdatea = iCalUtilityFunctions::_timestamp2date( $theExdate, $parno ); elseif( is_array( $theExdate )) $exdatea = iCalUtilityFunctions::_date_time_array( $theExdate, $parno ); elseif( 8 <= strlen( trim( $theExdate ))) { // ex. 2006-08-03 10:12:18 $exdatea = iCalUtilityFunctions::_date_time_string( $theExdate, $parno ); unset( $exdatea['unparsedtext'] ); } if( 3 == $parno ) unset( $exdatea['hour'], $exdatea['min'], $exdatea['sec'], $exdatea['tz'] ); elseif( isset( $exdatea['tz'] )) $exdatea['tz'] = (string) $exdatea['tz']; if( isset( $input['params']['TZID'] ) || ( isset( $exdatea['tz'] ) && !iCalUtilityFunctions::_isOffset( $exdatea['tz'] )) || ( isset( $input['value'][0] ) && ( !isset( $input['value'][0]['tz'] ))) || ( isset( $input['value'][0]['tz'] ) && !iCalUtilityFunctions::_isOffset( $input['value'][0]['tz'] ))) unset( $exdatea['tz'] ); if( $toZ ) // time zone Z $exdatea['tz'] = 'Z'; $input['value'][] = $exdatea; } if( 0 >= count( $input['value'] )) return FALSE; if( 3 == $parno ) { $input['params']['VALUE'] = 'DATE'; unset( $input['params']['TZID'] ); } if( $toZ ) // time zone Z unset( $input['params']['TZID'] ); iCalUtilityFunctions::_setMval( $this->exdate, $input['value'], $input['params'], FALSE, $index ); return TRUE; } /*********************************************************************************/ /** * Property Name: EXRULE */ /** * creates formatted output for calendar component property exrule * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-22 * @return string */ function createExrule() { if( empty( $this->exrule )) return FALSE; return $this->_format_recur( 'EXRULE', $this->exrule ); } /** * set calendar component property exdate * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.5.1 - 2008-11-05 * @param array $exruleset * @param array $params, optional * @param integer $index, optional * @return bool */ function setExrule( $exruleset, $params=FALSE, $index=FALSE ) { if( empty( $exruleset )) if( $this->getConfig( 'allowEmpty' )) $exruleset = null; else return FALSE; iCalUtilityFunctions::_setMval( $this->exrule, iCalUtilityFunctions::_setRexrule( $exruleset ), $params, FALSE, $index ); return TRUE; } /*********************************************************************************/ /** * Property Name: FREEBUSY */ /** * creates formatted output for calendar component property freebusy * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.1.23 - 2012-02-16 * @return string */ function createFreebusy() { if( empty( $this->freebusy )) return FALSE; $output = null; foreach( $this->freebusy as $freebusyPart ) { if( empty( $freebusyPart['value'] ) || (( 1 == count( $freebusyPart['value'] )) && isset( $freebusyPart['value']['fbtype'] ))) { if( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'FREEBUSY' ); continue; } $attributes = $content = null; if( isset( $freebusyPart['value']['fbtype'] )) { $attributes .= $this->intAttrDelimiter.'FBTYPE='.$freebusyPart['value']['fbtype']; unset( $freebusyPart['value']['fbtype'] ); $freebusyPart['value'] = array_values( $freebusyPart['value'] ); } else $attributes .= $this->intAttrDelimiter.'FBTYPE=BUSY'; $attributes .= $this->_createParams( $freebusyPart['params'] ); $fno = 1; $cnt = count( $freebusyPart['value']); foreach( $freebusyPart['value'] as $periodix => $freebusyPeriod ) { $formatted = iCalUtilityFunctions::_format_date_time( $freebusyPeriod[0] ); $content .= $formatted; $content .= '/'; $cnt2 = count( $freebusyPeriod[1]); if( array_key_exists( 'year', $freebusyPeriod[1] )) // date-time $cnt2 = 7; elseif( array_key_exists( 'week', $freebusyPeriod[1] )) // duration $cnt2 = 5; if(( 7 == $cnt2 ) && // period= -> date-time isset( $freebusyPeriod[1]['year'] ) && isset( $freebusyPeriod[1]['month'] ) && isset( $freebusyPeriod[1]['day'] )) { $content .= iCalUtilityFunctions::_format_date_time( $freebusyPeriod[1] ); } else { // period= -> dur-time $content .= iCalUtilityFunctions::_format_duration( $freebusyPeriod[1] ); } if( $fno < $cnt ) $content .= ','; $fno++; } $output .= $this->_createElement( 'FREEBUSY', $attributes, $content ); } return $output; } /** * set calendar component property freebusy * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.10.30 - 2012-01-16 * @param string $fbType * @param array $fbValues * @param array $params, optional * @param integer $index, optional * @return bool */ function setFreebusy( $fbType, $fbValues, $params=FALSE, $index=FALSE ) { if( empty( $fbValues )) { if( $this->getConfig( 'allowEmpty' )) { iCalUtilityFunctions::_setMval( $this->freebusy, null, $params, FALSE, $index ); return TRUE; } else return FALSE; } $fbType = strtoupper( $fbType ); if(( !in_array( $fbType, array( 'FREE', 'BUSY', 'BUSY-UNAVAILABLE', 'BUSY-TENTATIVE' ))) && ( 'X-' != substr( $fbType, 0, 2 ))) $fbType = 'BUSY'; $input = array( 'fbtype' => $fbType ); foreach( $fbValues as $fbPeriod ) { // periods => period if( empty( $fbPeriod )) continue; $freebusyPeriod = array(); foreach( $fbPeriod as $fbMember ) { // pairs => singlepart $freebusyPairMember = array(); if( is_array( $fbMember )) { if( iCalUtilityFunctions::_isArrayDate( $fbMember )) { // date-time value $freebusyPairMember = iCalUtilityFunctions::_date_time_array( $fbMember, 7 ); $freebusyPairMember['tz'] = 'Z'; } elseif( iCalUtilityFunctions::_isArrayTimestampDate( $fbMember )) { // timestamp value $freebusyPairMember = iCalUtilityFunctions::_timestamp2date( $fbMember['timestamp'], 7 ); $freebusyPairMember['tz'] = 'Z'; } else { // array format duration $freebusyPairMember = iCalUtilityFunctions::_duration_array( $fbMember ); } } elseif(( 3 <= strlen( trim( $fbMember ))) && // string format duration ( in_array( $fbMember{0}, array( 'P', '+', '-' )))) { if( 'P' != $fbMember{0} ) $fbmember = substr( $fbMember, 1 ); $freebusyPairMember = iCalUtilityFunctions::_duration_string( $fbMember ); } elseif( 8 <= strlen( trim( $fbMember ))) { // text date ex. 2006-08-03 10:12:18 $freebusyPairMember = iCalUtilityFunctions::_date_time_string( $fbMember, 7 ); unset( $freebusyPairMember['unparsedtext'] ); $freebusyPairMember['tz'] = 'Z'; } $freebusyPeriod[] = $freebusyPairMember; } $input[] = $freebusyPeriod; } iCalUtilityFunctions::_setMval( $this->freebusy, $input, $params, FALSE, $index ); return TRUE; } /*********************************************************************************/ /** * Property Name: GEO */ /** * creates formatted output for calendar component property geo * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.12.6 - 2012-04-21 * @return string */ function createGeo() { if( empty( $this->geo )) return FALSE; if( empty( $this->geo['value'] )) return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'GEO' ) : FALSE; $attributes = $this->_createParams( $this->geo['params'] ); if( 0.0 < $this->geo['value']['latitude'] ) $sign = '+'; else $sign = ( 0.0 > $this->geo['value']['latitude'] ) ? '-' : ''; $content = $sign.sprintf( "%09.6f", abs( $this->geo['value']['latitude'] )); // sprintf && lpad && float && sign !"#¤%&/( $content = rtrim( rtrim( $content, '0' ), '.' ); if( 0.0 < $this->geo['value']['longitude'] ) $sign = '+'; else $sign = ( 0.0 > $this->geo['value']['longitude'] ) ? '-' : ''; $content .= ';'.$sign.sprintf( '%8.6f', abs( $this->geo['value']['longitude'] )); // sprintf && lpad && float && sign !"#¤%&/( $content = rtrim( rtrim( $content, '0' ), '.' ); return $this->_createElement( 'GEO', $attributes, $content ); } /** * set calendar component property geo * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.12.5 - 2012-04-21 * @param float $latitude * @param float $longitude * @param array $params optional * @return bool */ function setGeo( $latitude, $longitude, $params=FALSE ) { if(( !empty( $latitude ) || ( 0 == $latitude )) && ( !empty( $longitude ) || ( 0 == $longitude ))) { if( !is_array( $this->geo )) $this->geo = array(); $this->geo['value']['latitude'] = (float) $latitude; $this->geo['value']['longitude'] = (float) $longitude; $this->geo['params'] = iCalUtilityFunctions::_setParams( $params ); } elseif( $this->getConfig( 'allowEmpty' )) $this->geo = array( 'value' => null, 'params' => iCalUtilityFunctions::_setParams( $params ) ); else return FALSE; return TRUE; } /*********************************************************************************/ /** * Property Name: LAST-MODIFIED */ /** * creates formatted output for calendar component property last-modified * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-21 * @return string */ function createLastModified() { if( empty( $this->lastmodified )) return FALSE; $attributes = $this->_createParams( $this->lastmodified['params'] ); $formatted = iCalUtilityFunctions::_format_date_time( $this->lastmodified['value'], 7 ); return $this->_createElement( 'LAST-MODIFIED', $attributes, $formatted ); } /** * set calendar component property completed * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-23 * @param mixed $year optional * @param mixed $month optional * @param int $day optional * @param int $hour optional * @param int $min optional * @param int $sec optional * @param array $params optional * @return boll */ function setLastModified( $year=FALSE, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $params=FALSE ) { if( empty( $year )) $year = date('Ymd\THis', mktime( date( 'H' ), date( 'i' ), date( 's' ) - date( 'Z'), date( 'm' ), date( 'd' ), date( 'Y' ))); $this->lastmodified = iCalUtilityFunctions::_setDate2( $year, $month, $day, $hour, $min, $sec, $params ); return TRUE; } /*********************************************************************************/ /** * Property Name: LOCATION */ /** * creates formatted output for calendar component property location * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-22 * @return string */ function createLocation() { if( empty( $this->location )) return FALSE; if( empty( $this->location['value'] )) return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'LOCATION' ) : FALSE; $attributes = $this->_createParams( $this->location['params'], array( 'ALTREP', 'LANGUAGE' )); $content = $this->_strrep( $this->location['value'] ); return $this->_createElement( 'LOCATION', $attributes, $content ); } /** * set calendar component property location ' * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-11-04 * @param string $value * @param array params optional * @return bool */ function setLocation( $value, $params=FALSE ) { if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; $this->location = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); return TRUE; } /*********************************************************************************/ /** * Property Name: ORGANIZER */ /** * creates formatted output for calendar component property organizer * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.6.33 - 2010-12-17 * @return string */ function createOrganizer() { if( empty( $this->organizer )) return FALSE; if( empty( $this->organizer['value'] )) return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'ORGANIZER' ) : FALSE; $attributes = $this->_createParams( $this->organizer['params'] , array( 'CN', 'DIR', 'SENT-BY', 'LANGUAGE' )); return $this->_createElement( 'ORGANIZER', $attributes, $this->organizer['value'] ); } /** * set calendar component property organizer * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.12.18 - 2012-07-13 * @param string $value * @param array params optional * @return bool */ function setOrganizer( $value, $params=FALSE ) { if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; if( !empty( $value )) { if( FALSE === ( $pos = strpos( substr( $value, 0, 9 ), ':' ))) $value = 'MAILTO:'.$value; elseif( !empty( $value )) $value = strtolower( substr( $value, 0, $pos )).substr( $value, $pos ); $value = str_replace( 'mailto:', 'MAILTO:', $value ); } $this->organizer = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); if( isset( $this->organizer['params']['SENT-BY'] )){ if( 'mailto:' !== strtolower( substr( $this->organizer['params']['SENT-BY'], 0, 7 ))) $this->organizer['params']['SENT-BY'] = 'MAILTO:'.$this->organizer['params']['SENT-BY']; else $this->organizer['params']['SENT-BY'] = 'MAILTO:'.substr( $this->organizer['params']['SENT-BY'], 7 ); } return TRUE; } /*********************************************************************************/ /** * Property Name: PERCENT-COMPLETE */ /** * creates formatted output for calendar component property percent-complete * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.9.3 - 2011-05-14 * @return string */ function createPercentComplete() { if( !isset($this->percentcomplete) || ( empty( $this->percentcomplete ) && !is_numeric( $this->percentcomplete ))) return FALSE; if( !isset( $this->percentcomplete['value'] ) || ( empty( $this->percentcomplete['value'] ) && !is_numeric( $this->percentcomplete['value'] ))) return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'PERCENT-COMPLETE' ) : FALSE; $attributes = $this->_createParams( $this->percentcomplete['params'] ); return $this->_createElement( 'PERCENT-COMPLETE', $attributes, $this->percentcomplete['value'] ); } /** * set calendar component property percent-complete * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.9.3 - 2011-05-14 * @param int $value * @param array $params optional * @return bool */ function setPercentComplete( $value, $params=FALSE ) { if( empty( $value ) && !is_numeric( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; $this->percentcomplete = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); return TRUE; } /*********************************************************************************/ /** * Property Name: PRIORITY */ /** * creates formatted output for calendar component property priority * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.9.3 - 2011-05-14 * @return string */ function createPriority() { if( !isset($this->priority) || ( empty( $this->priority ) && !is_numeric( $this->priority ))) return FALSE; if( !isset( $this->priority['value'] ) || ( empty( $this->priority['value'] ) && !is_numeric( $this->priority['value'] ))) return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'PRIORITY' ) : FALSE; $attributes = $this->_createParams( $this->priority['params'] ); return $this->_createElement( 'PRIORITY', $attributes, $this->priority['value'] ); } /** * set calendar component property priority * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.9.3 - 2011-05-14 * @param int $value * @param array $params optional * @return bool */ function setPriority( $value, $params=FALSE ) { if( empty( $value ) && !is_numeric( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; $this->priority = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); return TRUE; } /*********************************************************************************/ /** * Property Name: RDATE */ /** * creates formatted output for calendar component property rdate * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.16 - 2008-10-26 * @return string */ function createRdate() { if( empty( $this->rdate )) return FALSE; $utctime = ( in_array( $this->objName, array( 'vtimezone', 'standard', 'daylight' ))) ? TRUE : FALSE; $output = null; if( $utctime ) unset( $this->rdate['params']['TZID'] ); foreach( $this->rdate as $theRdate ) { if( empty( $theRdate['value'] )) { if( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'RDATE' ); continue; } if( $utctime ) unset( $theRdate['params']['TZID'] ); $attributes = $this->_createParams( $theRdate['params'] ); $cnt = count( $theRdate['value'] ); $content = null; $rno = 1; foreach( $theRdate['value'] as $rpix => $rdatePart ) { $contentPart = null; if( is_array( $rdatePart ) && isset( $theRdate['params']['VALUE'] ) && ( 'PERIOD' == $theRdate['params']['VALUE'] )) { // PERIOD if( $utctime ) unset( $rdatePart[0]['tz'] ); $formatted = iCalUtilityFunctions::_format_date_time( $rdatePart[0]); // PERIOD part 1 if( $utctime || !empty( $theRdate['params']['TZID'] )) $formatted = str_replace( 'Z', '', $formatted); if( 0 < $rpix ) { if( !empty( $rdatePart[0]['tz'] ) && iCalUtilityFunctions::_isOffset( $rdatePart[0]['tz'] )) { if( 'Z' != substr( $formatted, -1 )) $formatted .= 'Z'; } else $formatted = str_replace( 'Z', '', $formatted ); } $contentPart .= $formatted; $contentPart .= '/'; $cnt2 = count( $rdatePart[1]); if( array_key_exists( 'year', $rdatePart[1] )) { if( array_key_exists( 'hour', $rdatePart[1] )) $cnt2 = 7; // date-time else $cnt2 = 3; // date } elseif( array_key_exists( 'week', $rdatePart[1] )) // duration $cnt2 = 5; if(( 7 == $cnt2 ) && // period= -> date-time isset( $rdatePart[1]['year'] ) && isset( $rdatePart[1]['month'] ) && isset( $rdatePart[1]['day'] )) { if( $utctime ) unset( $rdatePart[1]['tz'] ); $formatted = iCalUtilityFunctions::_format_date_time( $rdatePart[1] ); // PERIOD part 2 if( $utctime || !empty( $theRdate['params']['TZID'] )) $formatted = str_replace( 'Z', '', $formatted); if( !empty( $rdatePart[0]['tz'] ) && iCalUtilityFunctions::_isOffset( $rdatePart[0]['tz'] )) { if( 'Z' != substr( $formatted, -1 )) $formatted .= 'Z'; } else $formatted = str_replace( 'Z', '', $formatted ); $contentPart .= $formatted; } else { // period= -> dur-time $contentPart .= iCalUtilityFunctions::_format_duration( $rdatePart[1] ); } } // PERIOD end else { // SINGLE date start if( $utctime ) unset( $rdatePart['tz'] ); $formatted = iCalUtilityFunctions::_format_date_time( $rdatePart); if( $utctime || !empty( $theRdate['params']['TZID'] )) $formatted = str_replace( 'Z', '', $formatted); if( !$utctime && ( 0 < $rpix )) { if( !empty( $theRdate['value'][0]['tz'] ) && iCalUtilityFunctions::_isOffset( $theRdate['value'][0]['tz'] )) { if( 'Z' != substr( $formatted, -1 )) $formatted .= 'Z'; } else $formatted = str_replace( 'Z', '', $formatted ); } $contentPart .= $formatted; } $content .= $contentPart; if( $rno < $cnt ) $content .= ','; $rno++; } $output .= $this->_createElement( 'RDATE', $attributes, $content ); } return $output; } /** * set calendar component property rdate * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.11.8 - 2012-01-31 * @param array $rdates * @param array $params, optional * @param integer $index, optional * @return bool */ function setRdate( $rdates, $params=FALSE, $index=FALSE ) { if( empty( $rdates )) { if( $this->getConfig( 'allowEmpty' )) { iCalUtilityFunctions::_setMval( $this->rdate, null, $params, FALSE, $index ); return TRUE; } else return FALSE; } $input = array( 'params' => iCalUtilityFunctions::_setParams( $params, array( 'VALUE' => 'DATE-TIME' ))); if( in_array( $this->objName, array( 'vtimezone', 'standard', 'daylight' ))) { unset( $input['params']['TZID'] ); $input['params']['VALUE'] = 'DATE-TIME'; } $zArr = array( 'GMT', 'UTC', 'Z' ); $toZ = ( isset( $params['TZID'] ) && in_array( strtoupper( $params['TZID'] ), $zArr )) ? TRUE : FALSE; /* check if PERIOD, if not set */ if((!isset( $input['params']['VALUE'] ) || !in_array( $input['params']['VALUE'], array( 'DATE', 'PERIOD' ))) && isset( $rdates[0] ) && is_array( $rdates[0] ) && ( 2 == count( $rdates[0] )) && isset( $rdates[0][0] ) && isset( $rdates[0][1] ) && !isset( $rdates[0]['timestamp'] ) && (( is_array( $rdates[0][0] ) && ( isset( $rdates[0][0]['timestamp'] ) || iCalUtilityFunctions::_isArrayDate( $rdates[0][0] ))) || ( is_string( $rdates[0][0] ) && ( 8 <= strlen( trim( $rdates[0][0] ))))) && ( is_array( $rdates[0][1] ) || ( is_string( $rdates[0][1] ) && ( 3 <= strlen( trim( $rdates[0][1] )))))) $input['params']['VALUE'] = 'PERIOD'; /* check 1:st date, upd. $parno (opt) and save ev. timezone **/ $date = reset( $rdates ); if( isset( $input['params']['VALUE'] ) && ( 'PERIOD' == $input['params']['VALUE'] )) // PERIOD $date = reset( $date ); iCalUtilityFunctions::_chkdatecfg( $date, $parno, $input['params'] ); iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE-TIME' ); // remove default foreach( $rdates as $rpix => $theRdate ) { $inputa = null; iCalUtilityFunctions::_strDate2arr( $theRdate ); if( is_array( $theRdate )) { if( isset( $input['params']['VALUE'] ) && ( 'PERIOD' == $input['params']['VALUE'] )) { // PERIOD foreach( $theRdate as $rix => $rPeriod ) { iCalUtilityFunctions::_strDate2arr( $theRdate ); if( is_array( $rPeriod )) { if( iCalUtilityFunctions::_isArrayTimestampDate( $rPeriod )) // timestamp $inputab = ( isset( $rPeriod['tz'] )) ? iCalUtilityFunctions::_timestamp2date( $rPeriod, $parno ) : iCalUtilityFunctions::_timestamp2date( $rPeriod, 6 ); elseif( iCalUtilityFunctions::_isArrayDate( $rPeriod )) $inputab = ( 3 < count ( $rPeriod )) ? iCalUtilityFunctions::_date_time_array( $rPeriod, $parno ) : iCalUtilityFunctions::_date_time_array( $rPeriod, 6 ); elseif (( 1 == count( $rPeriod )) && ( 8 <= strlen( reset( $rPeriod )))) { // text-date $inputab = iCalUtilityFunctions::_date_time_string( reset( $rPeriod ), $parno ); unset( $inputab['unparsedtext'] ); } else // array format duration $inputab = iCalUtilityFunctions::_duration_array( $rPeriod ); } elseif(( 3 <= strlen( trim( $rPeriod ))) && // string format duration ( in_array( $rPeriod[0], array( 'P', '+', '-' )))) { if( 'P' != $rPeriod[0] ) $rPeriod = substr( $rPeriod, 1 ); $inputab = iCalUtilityFunctions::_duration_string( $rPeriod ); } elseif( 8 <= strlen( trim( $rPeriod ))) { // text date ex. 2006-08-03 10:12:18 $inputab = iCalUtilityFunctions::_date_time_string( $rPeriod, $parno ); unset( $inputab['unparsedtext'] ); } if( isset( $input['params']['TZID'] ) || ( isset( $inputab['tz'] ) && !iCalUtilityFunctions::_isOffset( $inputab['tz'] )) || ( isset( $inputa[0] ) && ( !isset( $inputa[0]['tz'] ))) || ( isset( $inputa[0]['tz'] ) && !iCalUtilityFunctions::_isOffset( $inputa[0]['tz'] ))) unset( $inputab['tz'] ); if( $toZ ) $inputab['tz'] = 'Z'; $inputa[] = $inputab; } } // PERIOD end elseif ( iCalUtilityFunctions::_isArrayTimestampDate( $theRdate )) { // timestamp $inputa = iCalUtilityFunctions::_timestamp2date( $theRdate, $parno ); if( $toZ ) $inputa['tz'] = 'Z'; } else { // date[-time] $inputa = iCalUtilityFunctions::_date_time_array( $theRdate, $parno ); $toZ = ( isset( $inputa['tz'] ) && in_array( strtoupper( $inputa['tz'] ), $zArr )) ? TRUE : FALSE; if( $toZ ) $inputa['tz'] = 'Z'; } } elseif( 8 <= strlen( trim( $theRdate ))) { // text date ex. 2006-08-03 10:12:18 $inputa = iCalUtilityFunctions::_date_time_string( $theRdate, $parno ); unset( $inputa['unparsedtext'] ); if( $toZ ) $inputa['tz'] = 'Z'; } if( !isset( $input['params']['VALUE'] ) || ( 'PERIOD' != $input['params']['VALUE'] )) { // no PERIOD if( 3 == $parno ) unset( $inputa['hour'], $inputa['min'], $inputa['sec'], $inputa['tz'] ); elseif( isset( $inputa['tz'] )) $inputa['tz'] = (string) $inputa['tz']; if( isset( $input['params']['TZID'] ) || ( isset( $inputa['tz'] ) && !iCalUtilityFunctions::_isOffset( $inputa['tz'] )) || ( isset( $input['value'][0] ) && ( !isset( $input['value'][0]['tz'] ))) || ( isset( $input['value'][0]['tz'] ) && !iCalUtilityFunctions::_isOffset( $input['value'][0]['tz'] ))) if( !$toZ ) unset( $inputa['tz'] ); } $input['value'][] = $inputa; } if( 3 == $parno ) { $input['params']['VALUE'] = 'DATE'; unset( $input['params']['TZID'] ); } if( $toZ ) unset( $input['params']['TZID'] ); iCalUtilityFunctions::_setMval( $this->rdate, $input['value'], $input['params'], FALSE, $index ); return TRUE; } /*********************************************************************************/ /** * Property Name: RECURRENCE-ID */ /** * creates formatted output for calendar component property recurrence-id * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.9.6 - 2011-05-15 * @return string */ function createRecurrenceid() { if( empty( $this->recurrenceid )) return FALSE; if( empty( $this->recurrenceid['value'] )) return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'RECURRENCE-ID' ) : FALSE; $formatted = iCalUtilityFunctions::_format_date_time( $this->recurrenceid['value'] ); if(( FALSE !== ( $tzid = $this->getConfig( 'TZID' ))) && ( !isset( $this->recurrenceid['params']['VALUE'] ) || ( $this->recurrenceid['params']['VALUE'] != 'DATE' )) && !isset( $this->recurrenceid['params']['TZID'] )) $this->recurrenceid['params']['TZID'] = $tzid; $attributes = $this->_createParams( $this->recurrenceid['params'] ); return $this->_createElement( 'RECURRENCE-ID', $attributes, $formatted ); } /** * set calendar component property recurrence-id * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.9.6 - 2011-05-15 * @param mixed $year * @param mixed $month optional * @param int $day optional * @param int $hour optional * @param int $min optional * @param int $sec optional * @param array $params optional * @return bool */ function setRecurrenceid( $year, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $tz=FALSE, $params=FALSE ) { if( empty( $year )) { if( $this->getConfig( 'allowEmpty' )) { $this->recurrenceid = array( 'value' => null, 'params' => null ); return TRUE; } else return FALSE; } $this->recurrenceid = iCalUtilityFunctions::_setDate( $year, $month, $day, $hour, $min, $sec, $tz, $params, null, null, $this->getConfig( 'TZID' )); return TRUE; } /*********************************************************************************/ /** * Property Name: RELATED-TO */ /** * creates formatted output for calendar component property related-to * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.11.24 - 2012-02-23 * @return string */ function createRelatedTo() { if( empty( $this->relatedto )) return FALSE; $output = null; foreach( $this->relatedto as $relation ) { if( !empty( $relation['value'] )) $output .= $this->_createElement( 'RELATED-TO', $this->_createParams( $relation['params'] ), $this->_strrep( $relation['value'] ) ); elseif( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'RELATED-TO', $this->_createParams( $relation['params'] )); } return $output; } /** * set calendar component property related-to * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.11.24 - 2012-02-23 * @param float $relid * @param array $params, optional * @param index $index, optional * @return bool */ function setRelatedTo( $value, $params=FALSE, $index=FALSE ) { if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; iCalUtilityFunctions::_existRem( $params, 'RELTYPE', 'PARENT', TRUE ); // remove default iCalUtilityFunctions::_setMval( $this->relatedto, $value, $params, FALSE, $index ); return TRUE; } /*********************************************************************************/ /** * Property Name: REPEAT */ /** * creates formatted output for calendar component property repeat * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.9.3 - 2011-05-14 * @return string */ function createRepeat() { if( !isset( $this->repeat ) || ( empty( $this->repeat ) && !is_numeric( $this->repeat ))) return FALSE; if( !isset( $this->repeat['value']) || ( empty( $this->repeat['value'] ) && !is_numeric( $this->repeat['value'] ))) return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'REPEAT' ) : FALSE; $attributes = $this->_createParams( $this->repeat['params'] ); return $this->_createElement( 'REPEAT', $attributes, $this->repeat['value'] ); } /** * set calendar component property repeat * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.9.3 - 2011-05-14 * @param string $value * @param array $params optional * @return void */ function setRepeat( $value, $params=FALSE ) { if( empty( $value ) && !is_numeric( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; $this->repeat = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); return TRUE; } /*********************************************************************************/ /** * Property Name: REQUEST-STATUS */ /** * creates formatted output for calendar component property request-status * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-23 * @return string */ function createRequestStatus() { if( empty( $this->requeststatus )) return FALSE; $output = null; foreach( $this->requeststatus as $rstat ) { if( empty( $rstat['value']['statcode'] )) { if( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'REQUEST-STATUS' ); continue; } $attributes = $this->_createParams( $rstat['params'], array( 'LANGUAGE' )); $content = number_format( (float) $rstat['value']['statcode'], 2, '.', ''); $content .= ';'.$this->_strrep( $rstat['value']['text'] ); if( isset( $rstat['value']['extdata'] )) $content .= ';'.$this->_strrep( $rstat['value']['extdata'] ); $output .= $this->_createElement( 'REQUEST-STATUS', $attributes, $content ); } return $output; } /** * set calendar component property request-status * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.5.1 - 2008-11-05 * @param float $statcode * @param string $text * @param string $extdata, optional * @param array $params, optional * @param integer $index, optional * @return bool */ function setRequestStatus( $statcode, $text, $extdata=FALSE, $params=FALSE, $index=FALSE ) { if( empty( $statcode ) || empty( $text )) if( $this->getConfig( 'allowEmpty' )) $statcode = $text = null; else return FALSE; $input = array( 'statcode' => $statcode, 'text' => $text ); if( $extdata ) $input['extdata'] = $extdata; iCalUtilityFunctions::_setMval( $this->requeststatus, $input, $params, FALSE, $index ); return TRUE; } /*********************************************************************************/ /** * Property Name: RESOURCES */ /** * creates formatted output for calendar component property resources * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-23 * @return string */ function createResources() { if( empty( $this->resources )) return FALSE; $output = null; foreach( $this->resources as $resource ) { if( empty( $resource['value'] )) { if( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'RESOURCES' ); continue; } $attributes = $this->_createParams( $resource['params'], array( 'ALTREP', 'LANGUAGE' )); if( is_array( $resource['value'] )) { foreach( $resource['value'] as $rix => $resourcePart ) $resource['value'][$rix] = $this->_strrep( $resourcePart ); $content = implode( ',', $resource['value'] ); } else $content = $this->_strrep( $resource['value'] ); $output .= $this->_createElement( 'RESOURCES', $attributes, $content ); } return $output; } /** * set calendar component property recources * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.5.1 - 2008-11-05 * @param mixed $value * @param array $params, optional * @param integer $index, optional * @return bool */ function setResources( $value, $params=FALSE, $index=FALSE ) { if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; iCalUtilityFunctions::_setMval( $this->resources, $value, $params, FALSE, $index ); return TRUE; } /*********************************************************************************/ /** * Property Name: RRULE */ /** * creates formatted output for calendar component property rrule * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-21 * @return string */ function createRrule() { if( empty( $this->rrule )) return FALSE; return $this->_format_recur( 'RRULE', $this->rrule ); } /** * set calendar component property rrule * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.5.1 - 2008-11-05 * @param array $rruleset * @param array $params, optional * @param integer $index, optional * @return void */ function setRrule( $rruleset, $params=FALSE, $index=FALSE ) { if( empty( $rruleset )) if( $this->getConfig( 'allowEmpty' )) $rruleset = null; else return FALSE; iCalUtilityFunctions::_setMval( $this->rrule, iCalUtilityFunctions::_setRexrule( $rruleset ), $params, FALSE, $index ); return TRUE; } /*********************************************************************************/ /** * Property Name: SEQUENCE */ /** * creates formatted output for calendar component property sequence * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.9.3 - 2011-05-14 * @return string */ function createSequence() { if( !isset( $this->sequence ) || ( empty( $this->sequence ) && !is_numeric( $this->sequence ))) return FALSE; if(( !isset($this->sequence['value'] ) || ( empty( $this->sequence['value'] ) && !is_numeric( $this->sequence['value'] ))) && ( '0' != $this->sequence['value'] )) return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'SEQUENCE' ) : FALSE; $attributes = $this->_createParams( $this->sequence['params'] ); return $this->_createElement( 'SEQUENCE', $attributes, $this->sequence['value'] ); } /** * set calendar component property sequence * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.10.8 - 2011-09-19 * @param int $value optional * @param array $params optional * @return bool */ function setSequence( $value=FALSE, $params=FALSE ) { if(( empty( $value ) && !is_numeric( $value )) && ( '0' != $value )) $value = ( isset( $this->sequence['value'] ) && ( -1 < $this->sequence['value'] )) ? $this->sequence['value'] + 1 : '0'; $this->sequence = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); return TRUE; } /*********************************************************************************/ /** * Property Name: STATUS */ /** * creates formatted output for calendar component property status * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-21 * @return string */ function createStatus() { if( empty( $this->status )) return FALSE; if( empty( $this->status['value'] )) return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'STATUS' ) : FALSE; $attributes = $this->_createParams( $this->status['params'] ); return $this->_createElement( 'STATUS', $attributes, $this->status['value'] ); } /** * set calendar component property status * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-11-04 * @param string $value * @param array $params optional * @return bool */ function setStatus( $value, $params=FALSE ) { if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; $this->status = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); return TRUE; } /*********************************************************************************/ /** * Property Name: SUMMARY */ /** * creates formatted output for calendar component property summary * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-21 * @return string */ function createSummary() { if( empty( $this->summary )) return FALSE; if( empty( $this->summary['value'] )) return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'SUMMARY' ) : FALSE; $attributes = $this->_createParams( $this->summary['params'], array( 'ALTREP', 'LANGUAGE' )); $content = $this->_strrep( $this->summary['value'] ); return $this->_createElement( 'SUMMARY', $attributes, $content ); } /** * set calendar component property summary * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-11-04 * @param string $value * @param string $params optional * @return bool */ function setSummary( $value, $params=FALSE ) { if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; $this->summary = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); return TRUE; } /*********************************************************************************/ /** * Property Name: TRANSP */ /** * creates formatted output for calendar component property transp * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-21 * @return string */ function createTransp() { if( empty( $this->transp )) return FALSE; if( empty( $this->transp['value'] )) return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'TRANSP' ) : FALSE; $attributes = $this->_createParams( $this->transp['params'] ); return $this->_createElement( 'TRANSP', $attributes, $this->transp['value'] ); } /** * set calendar component property transp * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-11-04 * @param string $value * @param string $params optional * @return bool */ function setTransp( $value, $params=FALSE ) { if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; $this->transp = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); return TRUE; } /*********************************************************************************/ /** * Property Name: TRIGGER */ /** * creates formatted output for calendar component property trigger * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.16 - 2008-10-21 * @return string */ function createTrigger() { if( empty( $this->trigger )) return FALSE; if( empty( $this->trigger['value'] )) return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'TRIGGER' ) : FALSE; $content = $attributes = null; if( isset( $this->trigger['value']['year'] ) && isset( $this->trigger['value']['month'] ) && isset( $this->trigger['value']['day'] )) $content .= iCalUtilityFunctions::_format_date_time( $this->trigger['value'] ); else { if( TRUE !== $this->trigger['value']['relatedStart'] ) $attributes .= $this->intAttrDelimiter.'RELATED=END'; if( $this->trigger['value']['before'] ) $content .= '-'; $content .= iCalUtilityFunctions::_format_duration( $this->trigger['value'] ); } $attributes .= $this->_createParams( $this->trigger['params'] ); return $this->_createElement( 'TRIGGER', $attributes, $content ); } /** * set calendar component property trigger * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.10.30 - 2012-01-16 * @param mixed $year * @param mixed $month optional * @param int $day optional * @param int $week optional * @param int $hour optional * @param int $min optional * @param int $sec optional * @param bool $relatedStart optional * @param bool $before optional * @param array $params optional * @return bool */ function setTrigger( $year, $month=null, $day=null, $week=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $relatedStart=TRUE, $before=TRUE, $params=FALSE ) { if( empty( $year ) && empty( $month ) && empty( $day ) && empty( $week ) && empty( $hour ) && empty( $min ) && empty( $sec )) if( $this->getConfig( 'allowEmpty' )) { $this->trigger = array( 'value' => null, 'params' => iCalUtilityFunctions::_setParams( $params ) ); return TRUE; } else return FALSE; if( iCalUtilityFunctions::_isArrayTimestampDate( $year )) { // timestamp $params = iCalUtilityFunctions::_setParams( $month ); $date = iCalUtilityFunctions::_timestamp2date( $year, 7 ); foreach( $date as $k => $v ) $$k = $v; } elseif( is_array( $year ) && ( is_array( $month ) || empty( $month ))) { $params = iCalUtilityFunctions::_setParams( $month ); if(!(array_key_exists( 'year', $year ) && // exclude date-time array_key_exists( 'month', $year ) && array_key_exists( 'day', $year ))) { // when this must be a duration if( isset( $params['RELATED'] ) && ( 'END' == strtoupper( $params['RELATED'] ))) $relatedStart = FALSE; else $relatedStart = ( array_key_exists( 'relatedStart', $year ) && ( TRUE !== $year['relatedStart'] )) ? FALSE : TRUE; $before = ( array_key_exists( 'before', $year ) && ( TRUE !== $year['before'] )) ? FALSE : TRUE; } $SSYY = ( array_key_exists( 'year', $year )) ? $year['year'] : null; $month = ( array_key_exists( 'month', $year )) ? $year['month'] : null; $day = ( array_key_exists( 'day', $year )) ? $year['day'] : null; $week = ( array_key_exists( 'week', $year )) ? $year['week'] : null; $hour = ( array_key_exists( 'hour', $year )) ? $year['hour'] : 0; //null; $min = ( array_key_exists( 'min', $year )) ? $year['min'] : 0; //null; $sec = ( array_key_exists( 'sec', $year )) ? $year['sec'] : 0; //null; $year = $SSYY; } elseif(is_string( $year ) && ( is_array( $month ) || empty( $month ))) { // duration or date in a string $params = iCalUtilityFunctions::_setParams( $month ); if( in_array( $year[0], array( 'P', '+', '-' ))) { // duration $relatedStart = ( isset( $params['RELATED'] ) && ( 'END' == strtoupper( $params['RELATED'] ))) ? FALSE : TRUE; $before = ( '-' == $year[0] ) ? TRUE : FALSE; if( 'P' != $year[0] ) $year = substr( $year, 1 ); $date = iCalUtilityFunctions::_duration_string( $year); } else // date $date = iCalUtilityFunctions::_date_time_string( $year, 7 ); unset( $year, $month, $day, $date['unparsedtext'] ); if( empty( $date )) $sec = 0; else foreach( $date as $k => $v ) $$k = $v; } else // single values in function input parameters $params = iCalUtilityFunctions::_setParams( $params ); if( !empty( $year ) && !empty( $month ) && !empty( $day )) { // date $params['VALUE'] = 'DATE-TIME'; $hour = ( $hour ) ? $hour : 0; $min = ( $min ) ? $min : 0; $sec = ( $sec ) ? $sec : 0; $this->trigger = array( 'params' => $params ); $this->trigger['value'] = array( 'year' => $year , 'month' => $month , 'day' => $day , 'hour' => $hour , 'min' => $min , 'sec' => $sec , 'tz' => 'Z' ); return TRUE; } elseif(( empty( $year ) && empty( $month )) && // duration (( !empty( $week ) || ( 0 == $week )) || ( !empty( $day ) || ( 0 == $day )) || ( !empty( $hour ) || ( 0 == $hour )) || ( !empty( $min ) || ( 0 == $min )) || ( !empty( $sec ) || ( 0 == $sec )))) { unset( $params['RELATED'] ); // set at output creation (END only) unset( $params['VALUE'] ); // 'DURATION' default $this->trigger = array( 'params' => $params ); $this->trigger['value'] = array(); if( !empty( $week )) $this->trigger['value']['week'] = $week; if( !empty( $day )) $this->trigger['value']['day'] = $day; if( !empty( $hour )) $this->trigger['value']['hour'] = $hour; if( !empty( $min )) $this->trigger['value']['min'] = $min; if( !empty( $sec )) $this->trigger['value']['sec'] = $sec; if( empty( $this->trigger['value'] )) { $this->trigger['value']['sec'] = 0; $before = FALSE; } $relatedStart = ( FALSE !== $relatedStart ) ? TRUE : FALSE; $before = ( FALSE !== $before ) ? TRUE : FALSE; $this->trigger['value']['relatedStart'] = $relatedStart; $this->trigger['value']['before'] = $before; return TRUE; } return FALSE; } /*********************************************************************************/ /** * Property Name: TZID */ /** * creates formatted output for calendar component property tzid * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-21 * @return string */ function createTzid() { if( empty( $this->tzid )) return FALSE; if( empty( $this->tzid['value'] )) return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'TZID' ) : FALSE; $attributes = $this->_createParams( $this->tzid['params'] ); return $this->_createElement( 'TZID', $attributes, $this->_strrep( $this->tzid['value'] )); } /** * set calendar component property tzid * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-11-04 * @param string $value * @param array $params optional * @return bool */ function setTzid( $value, $params=FALSE ) { if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; $this->tzid = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); return TRUE; } /*********************************************************************************/ /** * .. . * Property Name: TZNAME */ /** * creates formatted output for calendar component property tzname * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-21 * @return string */ function createTzname() { if( empty( $this->tzname )) return FALSE; $output = null; foreach( $this->tzname as $theName ) { if( !empty( $theName['value'] )) { $attributes = $this->_createParams( $theName['params'], array( 'LANGUAGE' )); $output .= $this->_createElement( 'TZNAME', $attributes, $this->_strrep( $theName['value'] )); } elseif( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'TZNAME' ); } return $output; } /** * set calendar component property tzname * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.5.1 - 2008-11-05 * @param string $value * @param string $params, optional * @param integer $index, optional * @return bool */ function setTzname( $value, $params=FALSE, $index=FALSE ) { if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; iCalUtilityFunctions::_setMval( $this->tzname, $value, $params, FALSE, $index ); return TRUE; } /*********************************************************************************/ /** * Property Name: TZOFFSETFROM */ /** * creates formatted output for calendar component property tzoffsetfrom * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-21 * @return string */ function createTzoffsetfrom() { if( empty( $this->tzoffsetfrom )) return FALSE; if( empty( $this->tzoffsetfrom['value'] )) return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'TZOFFSETFROM' ) : FALSE; $attributes = $this->_createParams( $this->tzoffsetfrom['params'] ); return $this->_createElement( 'TZOFFSETFROM', $attributes, $this->tzoffsetfrom['value'] ); } /** * set calendar component property tzoffsetfrom * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-11-04 * @param string $value * @param string $params optional * @return bool */ function setTzoffsetfrom( $value, $params=FALSE ) { if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; $this->tzoffsetfrom = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); return TRUE; } /*********************************************************************************/ /** * Property Name: TZOFFSETTO */ /** * creates formatted output for calendar component property tzoffsetto * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-21 * @return string */ function createTzoffsetto() { if( empty( $this->tzoffsetto )) return FALSE; if( empty( $this->tzoffsetto['value'] )) return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'TZOFFSETTO' ) : FALSE; $attributes = $this->_createParams( $this->tzoffsetto['params'] ); return $this->_createElement( 'TZOFFSETTO', $attributes, $this->tzoffsetto['value'] ); } /** * set calendar component property tzoffsetto * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-11-04 * @param string $value * @param string $params optional * @return bool */ function setTzoffsetto( $value, $params=FALSE ) { if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; $this->tzoffsetto = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); return TRUE; } /*********************************************************************************/ /** * Property Name: TZURL */ /** * creates formatted output for calendar component property tzurl * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-21 * @return string */ function createTzurl() { if( empty( $this->tzurl )) return FALSE; if( empty( $this->tzurl['value'] )) return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'TZURL' ) : FALSE; $attributes = $this->_createParams( $this->tzurl['params'] ); return $this->_createElement( 'TZURL', $attributes, $this->tzurl['value'] ); } /** * set calendar component property tzurl * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-11-04 * @param string $value * @param string $params optional * @return boll */ function setTzurl( $value, $params=FALSE ) { if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; $this->tzurl = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); return TRUE; } /*********************************************************************************/ /** * Property Name: UID */ /** * creates formatted output for calendar component property uid * * @author Kjell-Inge Gustafsson, kigkonsult * @since 0.9.7 - 2006-11-20 * @return string */ function createUid() { if( 0 >= count( $this->uid )) $this->_makeuid(); $attributes = $this->_createParams( $this->uid['params'] ); return $this->_createElement( 'UID', $attributes, $this->uid['value'] ); } /** * create an unique id for this calendar component object instance * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.2.7 - 2007-09-04 * @return void */ function _makeUid() { $date = date('Ymd\THisT'); $unique = substr(microtime(), 2, 4); $base = 'aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPrRsStTuUvVxXuUvVwWzZ1234567890'; $start = 0; $end = strlen( $base ) - 1; $length = 6; $str = null; for( $p = 0; $p < $length; $p++ ) $unique .= $base{mt_rand( $start, $end )}; $this->uid = array( 'params' => null ); $this->uid['value'] = $date.'-'.$unique.'@'.$this->getConfig( 'unique_id' ); } /** * set calendar component property uid * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-11-04 * @param string $value * @param string $params optional * @return bool */ function setUid( $value, $params=FALSE ) { if( empty( $value )) return FALSE; // no allowEmpty check here !!!! $this->uid = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); return TRUE; } /*********************************************************************************/ /** * Property Name: URL */ /** * creates formatted output for calendar component property url * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-21 * @return string */ function createUrl() { if( empty( $this->url )) return FALSE; if( empty( $this->url['value'] )) return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'URL' ) : FALSE; $attributes = $this->_createParams( $this->url['params'] ); return $this->_createElement( 'URL', $attributes, $this->url['value'] ); } /** * set calendar component property url * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-11-04 * @param string $value * @param string $params optional * @return bool */ function setUrl( $value, $params=FALSE ) { if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; $this->url = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); return TRUE; } /*********************************************************************************/ /** * Property Name: x-prop */ /** * creates formatted output for calendar component property x-prop * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.9.3 - 2011-05-14 * @return string */ function createXprop() { if( empty( $this->xprop )) return FALSE; $output = null; foreach( $this->xprop as $label => $xpropPart ) { if( !isset($xpropPart['value']) || ( empty( $xpropPart['value'] ) && !is_numeric( $xpropPart['value'] ))) { if( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( $label ); continue; } $attributes = $this->_createParams( $xpropPart['params'], array( 'LANGUAGE' )); if( is_array( $xpropPart['value'] )) { foreach( $xpropPart['value'] as $pix => $theXpart ) $xpropPart['value'][$pix] = $this->_strrep( $theXpart ); $xpropPart['value'] = implode( ',', $xpropPart['value'] ); } else $xpropPart['value'] = $this->_strrep( $xpropPart['value'] ); $output .= $this->_createElement( $label, $attributes, $xpropPart['value'] ); } return $output; } /** * set calendar component property x-prop * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.11.9 - 2012-01-16 * @param string $label * @param mixed $value * @param array $params optional * @return bool */ function setXprop( $label, $value, $params=FALSE ) { if( empty( $label )) return FALSE; if( 'X-' != strtoupper( substr( $label, 0, 2 ))) return FALSE; if( empty( $value ) && !is_numeric( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; $xprop = array( 'value' => $value ); $xprop['params'] = iCalUtilityFunctions::_setParams( $params ); if( !is_array( $this->xprop )) $this->xprop = array(); $this->xprop[strtoupper( $label )] = $xprop; return TRUE; } /*********************************************************************************/ /*********************************************************************************/ /** * create element format parts * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.0.6 - 2006-06-20 * @return string */ function _createFormat() { $objectname = null; switch( $this->format ) { case 'xcal': $objectname = ( isset( $this->timezonetype )) ? strtolower( $this->timezonetype ) : strtolower( $this->objName ); $this->componentStart1 = $this->elementStart1 = '<'; $this->componentStart2 = $this->elementStart2 = '>'; $this->componentEnd1 = $this->elementEnd1 = 'componentEnd2 = $this->elementEnd2 = '>'.$this->nl; $this->intAttrDelimiter = ''; $this->attributeDelimiter = $this->nl; $this->valueInit = null; break; default: $objectname = ( isset( $this->timezonetype )) ? strtoupper( $this->timezonetype ) : strtoupper( $this->objName ); $this->componentStart1 = 'BEGIN:'; $this->componentStart2 = null; $this->componentEnd1 = 'END:'; $this->componentEnd2 = $this->nl; $this->elementStart1 = null; $this->elementStart2 = null; $this->elementEnd1 = null; $this->elementEnd2 = $this->nl; $this->intAttrDelimiter = ''; $this->attributeDelimiter = ';'; $this->valueInit = ':'; break; } return $objectname; } /** * creates formatted output for calendar component property * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.10.16 - 2011-10-28 * @param string $label property name * @param string $attributes property attributes * @param string $content property content (optional) * @return string */ function _createElement( $label, $attributes=null, $content=FALSE ) { switch( $this->format ) { case 'xcal': $label = strtolower( $label ); break; default: $label = strtoupper( $label ); break; } $output = $this->elementStart1.$label; $categoriesAttrLang = null; $attachInlineBinary = FALSE; $attachfmttype = null; if (( 'xcal' == $this->format) && ( 'x-' == substr( $label, 0, 2 ))) { $this->xcaldecl[] = array( 'xmldecl' => 'ELEMENT' , 'ref' => $label , 'type2' => '(#PCDATA)' ); } if( !empty( $attributes )) { $attributes = trim( $attributes ); if ( 'xcal' == $this->format ) { $attributes2 = explode( $this->intAttrDelimiter, $attributes ); $attributes = null; foreach( $attributes2 as $aix => $attribute ) { $attrKVarr = explode( '=', $attribute ); if( empty( $attrKVarr[0] )) continue; if( !isset( $attrKVarr[1] )) { $attrValue = $attrKVarr[0]; $attrKey = $aix; } elseif( 2 == count( $attrKVarr)) { $attrKey = strtolower( $attrKVarr[0] ); $attrValue = $attrKVarr[1]; } else { $attrKey = strtolower( $attrKVarr[0] ); unset( $attrKVarr[0] ); $attrValue = implode( '=', $attrKVarr ); } if(( 'attach' == $label ) && ( in_array( $attrKey, array( 'fmttype', 'encoding', 'value' )))) { $attachInlineBinary = TRUE; if( 'fmttype' == $attrKey ) $attachfmttype = $attrKey.'='.$attrValue; continue; } elseif(( 'categories' == $label ) && ( 'language' == $attrKey )) $categoriesAttrLang = $attrKey.'='.$attrValue; else { $attributes .= ( empty( $attributes )) ? ' ' : $this->attributeDelimiter.' '; $attributes .= ( !empty( $attrKey )) ? $attrKey.'=' : null; if(( '"' == substr( $attrValue, 0, 1 )) && ( '"' == substr( $attrValue, -1 ))) { $attrValue = substr( $attrValue, 1, ( strlen( $attrValue ) - 2 )); $attrValue = str_replace( '"', '', $attrValue ); } $attributes .= '"'.htmlspecialchars( $attrValue ).'"'; } } } else { $attributes = str_replace( $this->intAttrDelimiter, $this->attributeDelimiter, $attributes ); } } if(( 'xcal' == $this->format) && ((( 'attach' == $label ) && !$attachInlineBinary ) || ( in_array( $label, array( 'tzurl', 'url' ))))) { $pos = strrpos($content, "/"); $docname = ( $pos !== false) ? substr( $content, (1 - strlen( $content ) + $pos )) : $content; $this->xcaldecl[] = array( 'xmldecl' => 'ENTITY' , 'uri' => $docname , 'ref' => 'SYSTEM' , 'external' => $content , 'type' => 'NDATA' , 'type2' => 'BINERY' ); $attributes .= ( empty( $attributes )) ? ' ' : $this->attributeDelimiter.' '; $attributes .= 'uri="'.$docname.'"'; $content = null; if( 'attach' == $label ) { $attributes = str_replace( $this->attributeDelimiter, $this->intAttrDelimiter, $attributes ); $content = $this->nl.$this->_createElement( 'extref', $attributes, null ); $attributes = null; } } elseif(( 'xcal' == $this->format) && ( 'attach' == $label ) && $attachInlineBinary ) { $content = $this->nl.$this->_createElement( 'b64bin', $attachfmttype, $content ); // max one attribute } $output .= $attributes; if( !$content && ( '0' != $content )) { switch( $this->format ) { case 'xcal': $output .= ' /'; $output .= $this->elementStart2.$this->nl; return $output; break; default: $output .= $this->elementStart2.$this->valueInit; return $this->_size75( $output ); break; } } $output .= $this->elementStart2; $output .= $this->valueInit.$content; switch( $this->format ) { case 'xcal': return $output.$this->elementEnd1.$label.$this->elementEnd2; break; default: return $this->_size75( $output ); break; } } /** * creates formatted output for calendar component property parameters * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.10.27 - 2012-01-16 * @param array $params optional * @param array $ctrKeys optional * @return string */ function _createParams( $params=array(), $ctrKeys=array() ) { if( !is_array( $params ) || empty( $params )) $params = array(); $attrLANG = $attr1 = $attr2 = $lang = null; $CNattrKey = ( in_array( 'CN', $ctrKeys )) ? TRUE : FALSE ; $LANGattrKey = ( in_array( 'LANGUAGE', $ctrKeys )) ? TRUE : FALSE ; $CNattrExist = $LANGattrExist = FALSE; $xparams = array(); foreach( $params as $paramKey => $paramValue ) { if(( FALSE !== strpos( $paramValue, ':' )) || ( FALSE !== strpos( $paramValue, ';' )) || ( FALSE !== strpos( $paramValue, ',' ))) $paramValue = '"'.$paramValue.'"'; if( ctype_digit( (string) $paramKey )) { $xparams[] = $paramValue; continue; } $paramKey = strtoupper( $paramKey ); if( !in_array( $paramKey, array( 'ALTREP', 'CN', 'DIR', 'ENCODING', 'FMTTYPE', 'LANGUAGE', 'RANGE', 'RELTYPE', 'SENT-BY', 'TZID', 'VALUE' ))) $xparams[$paramKey] = $paramValue; else $params[$paramKey] = $paramValue; } ksort( $xparams, SORT_STRING ); foreach( $xparams as $paramKey => $paramValue ) { if( ctype_digit( (string) $paramKey )) $attr2 .= $this->intAttrDelimiter.$paramValue; else $attr2 .= $this->intAttrDelimiter."$paramKey=$paramValue"; } if( isset( $params['FMTTYPE'] ) && !in_array( 'FMTTYPE', $ctrKeys )) { $attr1 .= $this->intAttrDelimiter.'FMTTYPE='.$params['FMTTYPE'].$attr2; $attr2 = null; } if( isset( $params['ENCODING'] ) && !in_array( 'ENCODING', $ctrKeys )) { if( !empty( $attr2 )) { $attr1 .= $attr2; $attr2 = null; } $attr1 .= $this->intAttrDelimiter.'ENCODING='.$params['ENCODING']; } if( isset( $params['VALUE'] ) && !in_array( 'VALUE', $ctrKeys )) $attr1 .= $this->intAttrDelimiter.'VALUE='.$params['VALUE']; if( isset( $params['TZID'] ) && !in_array( 'TZID', $ctrKeys )) { $attr1 .= $this->intAttrDelimiter.'TZID='.$params['TZID']; } if( isset( $params['RANGE'] ) && !in_array( 'RANGE', $ctrKeys )) $attr1 .= $this->intAttrDelimiter.'RANGE='.$params['RANGE']; if( isset( $params['RELTYPE'] ) && !in_array( 'RELTYPE', $ctrKeys )) $attr1 .= $this->intAttrDelimiter.'RELTYPE='.$params['RELTYPE']; if( isset( $params['CN'] ) && $CNattrKey ) { $attr1 = $this->intAttrDelimiter.'CN='.$params['CN']; $CNattrExist = TRUE; } if( isset( $params['DIR'] ) && in_array( 'DIR', $ctrKeys )) { $delim = ( FALSE !== strpos( $params['DIR'], '"' )) ? '' : '"'; $attr1 .= $this->intAttrDelimiter.'DIR='.$delim.$params['DIR'].$delim; } if( isset( $params['SENT-BY'] ) && in_array( 'SENT-BY', $ctrKeys )) $attr1 .= $this->intAttrDelimiter.'SENT-BY='.$params['SENT-BY']; if( isset( $params['ALTREP'] ) && in_array( 'ALTREP', $ctrKeys )) { $delim = ( FALSE !== strpos( $params['ALTREP'], '"' )) ? '' : '"'; $attr1 .= $this->intAttrDelimiter.'ALTREP='.$delim.$params['ALTREP'].$delim; } if( isset( $params['LANGUAGE'] ) && $LANGattrKey ) { $attrLANG .= $this->intAttrDelimiter.'LANGUAGE='.$params['LANGUAGE']; $LANGattrExist = TRUE; } if( !$LANGattrExist ) { $lang = $this->getConfig( 'language' ); if(( $CNattrExist || $LANGattrKey ) && $lang ) $attrLANG .= $this->intAttrDelimiter.'LANGUAGE='.$lang; } return $attr1.$attrLANG.$attr2; } /** * creates formatted output for calendar component property data value type recur * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-22 * @param array $recurlabel * @param array $recurdata * @return string */ function _format_recur( $recurlabel, $recurdata ) { $output = null; foreach( $recurdata as $therule ) { if( empty( $therule['value'] )) { if( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( $recurlabel ); continue; } $attributes = ( isset( $therule['params'] )) ? $this->_createParams( $therule['params'] ) : null; $content1 = $content2 = null; foreach( $therule['value'] as $rulelabel => $rulevalue ) { switch( $rulelabel ) { case 'FREQ': { $content1 .= "FREQ=$rulevalue"; break; } case 'UNTIL': { $content2 .= ";UNTIL="; $content2 .= iCalUtilityFunctions::_format_date_time( $rulevalue ); break; } case 'COUNT': case 'INTERVAL': case 'WKST': { $content2 .= ";$rulelabel=$rulevalue"; break; } case 'BYSECOND': case 'BYMINUTE': case 'BYHOUR': case 'BYMONTHDAY': case 'BYYEARDAY': case 'BYWEEKNO': case 'BYMONTH': case 'BYSETPOS': { $content2 .= ";$rulelabel="; if( is_array( $rulevalue )) { foreach( $rulevalue as $vix => $valuePart ) { $content2 .= ( $vix ) ? ',' : null; $content2 .= $valuePart; } } else $content2 .= $rulevalue; break; } case 'BYDAY': { $content2 .= ";$rulelabel="; $bydaycnt = 0; foreach( $rulevalue as $vix => $valuePart ) { $content21 = $content22 = null; if( is_array( $valuePart )) { $content2 .= ( $bydaycnt ) ? ',' : null; foreach( $valuePart as $vix2 => $valuePart2 ) { if( 'DAY' != strtoupper( $vix2 )) $content21 .= $valuePart2; else $content22 .= $valuePart2; } $content2 .= $content21.$content22; $bydaycnt++; } else { $content2 .= ( $bydaycnt ) ? ',' : null; if( 'DAY' != strtoupper( $vix )) $content21 .= $valuePart; else { $content22 .= $valuePart; $bydaycnt++; } $content2 .= $content21.$content22; } } break; } default: { $content2 .= ";$rulelabel=$rulevalue"; break; } } } $output .= $this->_createElement( $recurlabel, $attributes, $content1.$content2 ); } return $output; } /** * check if property not exists within component * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.5.1 - 2008-10-15 * @param string $propName * @return bool */ function _notExistProp( $propName ) { if( empty( $propName )) return FALSE; // when deleting x-prop, an empty propName may be used=allowed $propName = strtolower( $propName ); if( 'last-modified' == $propName ) { if( !isset( $this->lastmodified )) return TRUE; } elseif( 'percent-complete' == $propName ) { if( !isset( $this->percentcomplete )) return TRUE; } elseif( 'recurrence-id' == $propName ) { if( !isset( $this->recurrenceid )) return TRUE; } elseif( 'related-to' == $propName ) { if( !isset( $this->relatedto )) return TRUE; } elseif( 'request-status' == $propName ) { if( !isset( $this->requeststatus )) return TRUE; } elseif(( 'x-' != substr($propName,0,2)) && !isset( $this->$propName )) return TRUE; return FALSE; } /*********************************************************************************/ /*********************************************************************************/ /** * get general component config variables or info about subcomponents * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.9.6 - 2011-05-14 * @param mixed $config * @return value */ function getConfig( $config = FALSE) { if( !$config ) { $return = array(); $return['ALLOWEMPTY'] = $this->getConfig( 'ALLOWEMPTY' ); $return['FORMAT'] = $this->getConfig( 'FORMAT' ); if( FALSE !== ( $lang = $this->getConfig( 'LANGUAGE' ))) $return['LANGUAGE'] = $lang; $return['NEWLINECHAR'] = $this->getConfig( 'NEWLINECHAR' ); $return['TZTD'] = $this->getConfig( 'TZID' ); $return['UNIQUE_ID'] = $this->getConfig( 'UNIQUE_ID' ); return $return; } switch( strtoupper( $config )) { case 'ALLOWEMPTY': return $this->allowEmpty; break; case 'COMPSINFO': unset( $this->compix ); $info = array(); if( isset( $this->components )) { foreach( $this->components as $cix => $component ) { if( empty( $component )) continue; $info[$cix]['ordno'] = $cix + 1; $info[$cix]['type'] = $component->objName; $info[$cix]['uid'] = $component->getProperty( 'uid' ); $info[$cix]['props'] = $component->getConfig( 'propinfo' ); $info[$cix]['sub'] = $component->getConfig( 'compsinfo' ); } } return $info; break; case 'FORMAT': return $this->format; break; case 'LANGUAGE': // get language for calendar component as defined in [RFC 1766] return $this->language; break; case 'NL': case 'NEWLINECHAR': return $this->nl; break; case 'PROPINFO': $output = array(); if( !in_array( $this->objName, array( 'valarm', 'vtimezone', 'standard', 'daylight' ))) { if( empty( $this->uid['value'] )) $this->_makeuid(); $output['UID'] = 1; } if( !empty( $this->dtstamp )) $output['DTSTAMP'] = 1; if( !empty( $this->summary )) $output['SUMMARY'] = 1; if( !empty( $this->description )) $output['DESCRIPTION'] = count( $this->description ); if( !empty( $this->dtstart )) $output['DTSTART'] = 1; if( !empty( $this->dtend )) $output['DTEND'] = 1; if( !empty( $this->due )) $output['DUE'] = 1; if( !empty( $this->duration )) $output['DURATION'] = 1; if( !empty( $this->rrule )) $output['RRULE'] = count( $this->rrule ); if( !empty( $this->rdate )) $output['RDATE'] = count( $this->rdate ); if( !empty( $this->exdate )) $output['EXDATE'] = count( $this->exdate ); if( !empty( $this->exrule )) $output['EXRULE'] = count( $this->exrule ); if( !empty( $this->action )) $output['ACTION'] = 1; if( !empty( $this->attach )) $output['ATTACH'] = count( $this->attach ); if( !empty( $this->attendee )) $output['ATTENDEE'] = count( $this->attendee ); if( !empty( $this->categories )) $output['CATEGORIES'] = count( $this->categories ); if( !empty( $this->class )) $output['CLASS'] = 1; if( !empty( $this->comment )) $output['COMMENT'] = count( $this->comment ); if( !empty( $this->completed )) $output['COMPLETED'] = 1; if( !empty( $this->contact )) $output['CONTACT'] = count( $this->contact ); if( !empty( $this->created )) $output['CREATED'] = 1; if( !empty( $this->freebusy )) $output['FREEBUSY'] = count( $this->freebusy ); if( !empty( $this->geo )) $output['GEO'] = 1; if( !empty( $this->lastmodified )) $output['LAST-MODIFIED'] = 1; if( !empty( $this->location )) $output['LOCATION'] = 1; if( !empty( $this->organizer )) $output['ORGANIZER'] = 1; if( !empty( $this->percentcomplete )) $output['PERCENT-COMPLETE'] = 1; if( !empty( $this->priority )) $output['PRIORITY'] = 1; if( !empty( $this->recurrenceid )) $output['RECURRENCE-ID'] = 1; if( !empty( $this->relatedto )) $output['RELATED-TO'] = count( $this->relatedto ); if( !empty( $this->repeat )) $output['REPEAT'] = 1; if( !empty( $this->requeststatus )) $output['REQUEST-STATUS'] = count( $this->requeststatus ); if( !empty( $this->resources )) $output['RESOURCES'] = count( $this->resources ); if( !empty( $this->sequence )) $output['SEQUENCE'] = 1; if( !empty( $this->sequence )) $output['SEQUENCE'] = 1; if( !empty( $this->status )) $output['STATUS'] = 1; if( !empty( $this->transp )) $output['TRANSP'] = 1; if( !empty( $this->trigger )) $output['TRIGGER'] = 1; if( !empty( $this->tzid )) $output['TZID'] = 1; if( !empty( $this->tzname )) $output['TZNAME'] = count( $this->tzname ); if( !empty( $this->tzoffsetfrom )) $output['TZOFFSETFROM'] = 1; if( !empty( $this->tzoffsetto )) $output['TZOFFSETTO'] = 1; if( !empty( $this->tzurl )) $output['TZURL'] = 1; if( !empty( $this->url )) $output['URL'] = 1; if( !empty( $this->xprop )) $output['X-PROP'] = count( $this->xprop ); return $output; break; case 'TZID': return $this->dtzid; break; case 'UNIQUE_ID': if( empty( $this->unique_id )) $this->unique_id = ( isset( $_SERVER['SERVER_NAME'] )) ? gethostbyname( $_SERVER['SERVER_NAME'] ) : 'localhost'; return $this->unique_id; break; } } /** * general component config setting * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.10.18 - 2011-10-28 * @param mixed $config * @param string $value * @param bool $softUpdate * @return void */ function setConfig( $config, $value = FALSE, $softUpdate = FALSE ) { if( is_array( $config )) { $ak = array_keys( $config ); foreach( $ak as $k ) { if( 'NEWLINECHAR' == strtoupper( $k )) { if( FALSE === $this->setConfig( 'NEWLINECHAR', $config[$k] )) return FALSE; unset( $config[$k] ); break; } } foreach( $config as $cKey => $cValue ) { if( FALSE === $this->setConfig( $cKey, $cValue, $softUpdate )) return FALSE; } return TRUE; } $res = FALSE; switch( strtoupper( $config )) { case 'ALLOWEMPTY': $this->allowEmpty = $value; $subcfg = array( 'ALLOWEMPTY' => $value ); $res = TRUE; break; case 'FORMAT': $value = trim( strtolower( $value )); $this->format = $value; $this->_createFormat(); $subcfg = array( 'FORMAT' => $value ); $res = TRUE; break; case 'LANGUAGE': // set language for calendar component as defined in [RFC 1766] $value = trim( $value ); if( empty( $this->language ) || !$softUpdate ) $this->language = $value; $subcfg = array( 'LANGUAGE' => $value ); $res = TRUE; break; case 'NL': case 'NEWLINECHAR': $this->nl = $value; $this->_createFormat(); $subcfg = array( 'NL' => $value ); $res = TRUE; break; case 'TZID': $this->dtzid = $value; $subcfg = array( 'TZID' => $value ); $res = TRUE; break; case 'UNIQUE_ID': $value = trim( $value ); $this->unique_id = $value; $subcfg = array( 'UNIQUE_ID' => $value ); $res = TRUE; break; default: // any unvalid config key.. . return TRUE; } if( !$res ) return FALSE; if( isset( $subcfg ) && !empty( $this->components )) { foreach( $subcfg as $cfgkey => $cfgvalue ) { foreach( $this->components as $cix => $component ) { $res = $component->setConfig( $cfgkey, $cfgvalue, $softUpdate ); if( !$res ) break 2; $this->components[$cix] = $component->copy(); // PHP4 compliant } } } return $res; } /*********************************************************************************/ /** * delete component property value * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.8.8 - 2011-03-15 * @param mixed $propName, bool FALSE => X-property * @param int $propix, optional, if specific property is wanted in case of multiply occurences * @return bool, if successfull delete TRUE */ function deleteProperty( $propName=FALSE, $propix=FALSE ) { if( $this->_notExistProp( $propName )) return FALSE; $propName = strtoupper( $propName ); if( in_array( $propName, array( 'ATTACH', 'ATTENDEE', 'CATEGORIES', 'COMMENT', 'CONTACT', 'DESCRIPTION', 'EXDATE', 'EXRULE', 'FREEBUSY', 'RDATE', 'RELATED-TO', 'RESOURCES', 'RRULE', 'REQUEST-STATUS', 'TZNAME', 'X-PROP' ))) { if( !$propix ) $propix = ( isset( $this->propdelix[$propName] ) && ( 'X-PROP' != $propName )) ? $this->propdelix[$propName] + 2 : 1; $this->propdelix[$propName] = --$propix; } $return = FALSE; switch( $propName ) { case 'ACTION': if( !empty( $this->action )) { $this->action = ''; $return = TRUE; } break; case 'ATTACH': return $this->deletePropertyM( $this->attach, $this->propdelix[$propName] ); break; case 'ATTENDEE': return $this->deletePropertyM( $this->attendee, $this->propdelix[$propName] ); break; case 'CATEGORIES': return $this->deletePropertyM( $this->categories, $this->propdelix[$propName] ); break; case 'CLASS': if( !empty( $this->class )) { $this->class = ''; $return = TRUE; } break; case 'COMMENT': return $this->deletePropertyM( $this->comment, $this->propdelix[$propName] ); break; case 'COMPLETED': if( !empty( $this->completed )) { $this->completed = ''; $return = TRUE; } break; case 'CONTACT': return $this->deletePropertyM( $this->contact, $this->propdelix[$propName] ); break; case 'CREATED': if( !empty( $this->created )) { $this->created = ''; $return = TRUE; } break; case 'DESCRIPTION': return $this->deletePropertyM( $this->description, $this->propdelix[$propName] ); break; case 'DTEND': if( !empty( $this->dtend )) { $this->dtend = ''; $return = TRUE; } break; case 'DTSTAMP': if( in_array( $this->objName, array( 'valarm', 'vtimezone', 'standard', 'daylight' ))) return FALSE; if( !empty( $this->dtstamp )) { $this->dtstamp = ''; $return = TRUE; } break; case 'DTSTART': if( !empty( $this->dtstart )) { $this->dtstart = ''; $return = TRUE; } break; case 'DUE': if( !empty( $this->due )) { $this->due = ''; $return = TRUE; } break; case 'DURATION': if( !empty( $this->duration )) { $this->duration = ''; $return = TRUE; } break; case 'EXDATE': return $this->deletePropertyM( $this->exdate, $this->propdelix[$propName] ); break; case 'EXRULE': return $this->deletePropertyM( $this->exrule, $this->propdelix[$propName] ); break; case 'FREEBUSY': return $this->deletePropertyM( $this->freebusy, $this->propdelix[$propName] ); break; case 'GEO': if( !empty( $this->geo )) { $this->geo = ''; $return = TRUE; } break; case 'LAST-MODIFIED': if( !empty( $this->lastmodified )) { $this->lastmodified = ''; $return = TRUE; } break; case 'LOCATION': if( !empty( $this->location )) { $this->location = ''; $return = TRUE; } break; case 'ORGANIZER': if( !empty( $this->organizer )) { $this->organizer = ''; $return = TRUE; } break; case 'PERCENT-COMPLETE': if( !empty( $this->percentcomplete )) { $this->percentcomplete = ''; $return = TRUE; } break; case 'PRIORITY': if( !empty( $this->priority )) { $this->priority = ''; $return = TRUE; } break; case 'RDATE': return $this->deletePropertyM( $this->rdate, $this->propdelix[$propName] ); break; case 'RECURRENCE-ID': if( !empty( $this->recurrenceid )) { $this->recurrenceid = ''; $return = TRUE; } break; case 'RELATED-TO': return $this->deletePropertyM( $this->relatedto, $this->propdelix[$propName] ); break; case 'REPEAT': if( !empty( $this->repeat )) { $this->repeat = ''; $return = TRUE; } break; case 'REQUEST-STATUS': return $this->deletePropertyM( $this->requeststatus, $this->propdelix[$propName] ); break; case 'RESOURCES': return $this->deletePropertyM( $this->resources, $this->propdelix[$propName] ); break; case 'RRULE': return $this->deletePropertyM( $this->rrule, $this->propdelix[$propName] ); break; case 'SEQUENCE': if( !empty( $this->sequence )) { $this->sequence = ''; $return = TRUE; } break; case 'STATUS': if( !empty( $this->status )) { $this->status = ''; $return = TRUE; } break; case 'SUMMARY': if( !empty( $this->summary )) { $this->summary = ''; $return = TRUE; } break; case 'TRANSP': if( !empty( $this->transp )) { $this->transp = ''; $return = TRUE; } break; case 'TRIGGER': if( !empty( $this->trigger )) { $this->trigger = ''; $return = TRUE; } break; case 'TZID': if( !empty( $this->tzid )) { $this->tzid = ''; $return = TRUE; } break; case 'TZNAME': return $this->deletePropertyM( $this->tzname, $this->propdelix[$propName] ); break; case 'TZOFFSETFROM': if( !empty( $this->tzoffsetfrom )) { $this->tzoffsetfrom = ''; $return = TRUE; } break; case 'TZOFFSETTO': if( !empty( $this->tzoffsetto )) { $this->tzoffsetto = ''; $return = TRUE; } break; case 'TZURL': if( !empty( $this->tzurl )) { $this->tzurl = ''; $return = TRUE; } break; case 'UID': if( in_array( $this->objName, array( 'valarm', 'vtimezone', 'standard', 'daylight' ))) return FALSE; if( !empty( $this->uid )) { $this->uid = ''; $return = TRUE; } break; case 'URL': if( !empty( $this->url )) { $this->url = ''; $return = TRUE; } break; default: $reduced = ''; if( $propName != 'X-PROP' ) { if( !isset( $this->xprop[$propName] )) return FALSE; foreach( $this->xprop as $k => $a ) { if(( $k != $propName ) && !empty( $a )) $reduced[$k] = $a; } } else { if( count( $this->xprop ) <= $propix ) { unset( $this->propdelix[$propName] ); return FALSE; } $xpropno = 0; foreach( $this->xprop as $xpropkey => $xpropvalue ) { if( $propix != $xpropno ) $reduced[$xpropkey] = $xpropvalue; $xpropno++; } } $this->xprop = $reduced; if( empty( $this->xprop )) { unset( $this->propdelix[$propName] ); return FALSE; } return TRUE; } return $return; } /*********************************************************************************/ /** * delete component property value, fixing components with multiple occurencies * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.8.8 - 2011-03-15 * @param array $multiprop, reference to a component property * @param int $propix, reference to removal counter * @return bool TRUE */ function deletePropertyM( & $multiprop, & $propix ) { if( isset( $multiprop[$propix] )) unset( $multiprop[$propix] ); if( empty( $multiprop )) { $multiprop = ''; unset( $propix ); return FALSE; } else return TRUE; } /** * get component property value/params * * if property has multiply values, consequtive function calls are needed * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.12.4 - 2012-04-22 * @param string $propName, optional * @param int @propix, optional, if specific property is wanted in case of multiply occurences * @param bool $inclParam=FALSE * @param bool $specform=FALSE * @return mixed */ function getProperty( $propName=FALSE, $propix=FALSE, $inclParam=FALSE, $specform=FALSE ) { if( 'GEOLOCATION' == strtoupper( $propName )) { $content = $this->getProperty( 'LOCATION' ); $content = ( !empty( $content )) ? $content.' ' : ''; if(( FALSE === ( $geo = $this->getProperty( 'GEO' ))) || empty( $geo )) return FALSE; if( 0.0 < $geo['latitude'] ) $sign = '+'; else $sign = ( 0.0 > $geo['latitude'] ) ? '-' : ''; $content .= $sign.sprintf( "%09.6f", abs( $geo['latitude'] )); // sprintf && lpad && float && sign !"#¤%&/( $content = rtrim( rtrim( $content, '0' ), '.' ); if( 0.0 < $geo['longitude'] ) $sign = '+'; else $sign = ( 0.0 > $geo['longitude'] ) ? '-' : ''; return $content.$sign.sprintf( '%8.6f', abs( $geo['longitude'] )).'/'; // sprintf && lpad && float && sign !"#¤%&/( } if( $this->_notExistProp( $propName )) return FALSE; $propName = ( $propName ) ? strtoupper( $propName ) : 'X-PROP'; if( in_array( $propName, array( 'ATTACH', 'ATTENDEE', 'CATEGORIES', 'COMMENT', 'CONTACT', 'DESCRIPTION', 'EXDATE', 'EXRULE', 'FREEBUSY', 'RDATE', 'RELATED-TO', 'RESOURCES', 'RRULE', 'REQUEST-STATUS', 'TZNAME', 'X-PROP' ))) { if( !$propix ) $propix = ( isset( $this->propix[$propName] )) ? $this->propix[$propName] + 2 : 1; $this->propix[$propName] = --$propix; } switch( $propName ) { case 'ACTION': if( !empty( $this->action['value'] )) return ( $inclParam ) ? $this->action : $this->action['value']; break; case 'ATTACH': $ak = ( is_array( $this->attach )) ? array_keys( $this->attach ) : array(); while( is_array( $this->attach ) && !isset( $this->attach[$propix] ) && ( 0 < count( $this->attach )) && ( $propix < end( $ak ))) $propix++; $this->propix[$propName] = $propix; if( !isset( $this->attach[$propix] )) { unset( $this->propix[$propName] ); return FALSE; } return ( $inclParam ) ? $this->attach[$propix] : $this->attach[$propix]['value']; break; case 'ATTENDEE': $ak = ( is_array( $this->attendee )) ? array_keys( $this->attendee ) : array(); while( is_array( $this->attendee ) && !isset( $this->attendee[$propix] ) && ( 0 < count( $this->attendee )) && ( $propix < end( $ak ))) $propix++; $this->propix[$propName] = $propix; if( !isset( $this->attendee[$propix] )) { unset( $this->propix[$propName] ); return FALSE; } return ( $inclParam ) ? $this->attendee[$propix] : $this->attendee[$propix]['value']; break; case 'CATEGORIES': $ak = ( is_array( $this->categories )) ? array_keys( $this->categories ) : array(); while( is_array( $this->categories ) && !isset( $this->categories[$propix] ) && ( 0 < count( $this->categories )) && ( $propix < end( $ak ))) $propix++; $this->propix[$propName] = $propix; if( !isset( $this->categories[$propix] )) { unset( $this->propix[$propName] ); return FALSE; } return ( $inclParam ) ? $this->categories[$propix] : $this->categories[$propix]['value']; break; case 'CLASS': if( !empty( $this->class['value'] )) return ( $inclParam ) ? $this->class : $this->class['value']; break; case 'COMMENT': $ak = ( is_array( $this->comment )) ? array_keys( $this->comment ) : array(); while( is_array( $this->comment ) && !isset( $this->comment[$propix] ) && ( 0 < count( $this->comment )) && ( $propix < end( $ak ))) $propix++; $this->propix[$propName] = $propix; if( !isset( $this->comment[$propix] )) { unset( $this->propix[$propName] ); return FALSE; } return ( $inclParam ) ? $this->comment[$propix] : $this->comment[$propix]['value']; break; case 'COMPLETED': if( !empty( $this->completed['value'] )) return ( $inclParam ) ? $this->completed : $this->completed['value']; break; case 'CONTACT': $ak = ( is_array( $this->contact )) ? array_keys( $this->contact ) : array(); while( is_array( $this->contact ) && !isset( $this->contact[$propix] ) && ( 0 < count( $this->contact )) && ( $propix < end( $ak ))) $propix++; $this->propix[$propName] = $propix; if( !isset( $this->contact[$propix] )) { unset( $this->propix[$propName] ); return FALSE; } return ( $inclParam ) ? $this->contact[$propix] : $this->contact[$propix]['value']; break; case 'CREATED': if( !empty( $this->created['value'] )) return ( $inclParam ) ? $this->created : $this->created['value']; break; case 'DESCRIPTION': $ak = ( is_array( $this->description )) ? array_keys( $this->description ) : array(); while( is_array( $this->description ) && !isset( $this->description[$propix] ) && ( 0 < count( $this->description )) && ( $propix < end( $ak ))) $propix++; $this->propix[$propName] = $propix; if( !isset( $this->description[$propix] )) { unset( $this->propix[$propName] ); return FALSE; } return ( $inclParam ) ? $this->description[$propix] : $this->description[$propix]['value']; break; case 'DTEND': if( !empty( $this->dtend['value'] )) return ( $inclParam ) ? $this->dtend : $this->dtend['value']; break; case 'DTSTAMP': if( in_array( $this->objName, array( 'valarm', 'vtimezone', 'standard', 'daylight' ))) return; if( !isset( $this->dtstamp['value'] )) $this->_makeDtstamp(); return ( $inclParam ) ? $this->dtstamp : $this->dtstamp['value']; break; case 'DTSTART': if( !empty( $this->dtstart['value'] )) return ( $inclParam ) ? $this->dtstart : $this->dtstart['value']; break; case 'DUE': if( !empty( $this->due['value'] )) return ( $inclParam ) ? $this->due : $this->due['value']; break; case 'DURATION': if( !isset( $this->duration['value'] )) return FALSE; $value = ( $specform && isset( $this->dtstart['value'] ) && isset( $this->duration['value'] )) ? iCalUtilityFunctions::_duration2date( $this->dtstart['value'], $this->duration['value'] ) : $this->duration['value']; return ( $inclParam ) ? array( 'value' => $value, 'params' => $this->duration['params'] ) : $value; break; case 'EXDATE': $ak = ( is_array( $this->exdate )) ? array_keys( $this->exdate ) : array(); while( is_array( $this->exdate ) && !isset( $this->exdate[$propix] ) && ( 0 < count( $this->exdate )) && ( $propix < end( $ak ))) $propix++; $this->propix[$propName] = $propix; if( !isset( $this->exdate[$propix] )) { unset( $this->propix[$propName] ); return FALSE; } return ( $inclParam ) ? $this->exdate[$propix] : $this->exdate[$propix]['value']; break; case 'EXRULE': $ak = ( is_array( $this->exrule )) ? array_keys( $this->exrule ) : array(); while( is_array( $this->exrule ) && !isset( $this->exrule[$propix] ) && ( 0 < count( $this->exrule )) && ( $propix < end( $ak ))) $propix++; $this->propix[$propName] = $propix; if( !isset( $this->exrule[$propix] )) { unset( $this->propix[$propName] ); return FALSE; } return ( $inclParam ) ? $this->exrule[$propix] : $this->exrule[$propix]['value']; break; case 'FREEBUSY': $ak = ( is_array( $this->freebusy )) ? array_keys( $this->freebusy ) : array(); while( is_array( $this->freebusy ) && !isset( $this->freebusy[$propix] ) && ( 0 < count( $this->freebusy )) && ( $propix < end( $ak ))) $propix++; $this->propix[$propName] = $propix; if( !isset( $this->freebusy[$propix] )) { unset( $this->propix[$propName] ); return FALSE; } return ( $inclParam ) ? $this->freebusy[$propix] : $this->freebusy[$propix]['value']; break; case 'GEO': if( !empty( $this->geo['value'] )) return ( $inclParam ) ? $this->geo : $this->geo['value']; break; case 'LAST-MODIFIED': if( !empty( $this->lastmodified['value'] )) return ( $inclParam ) ? $this->lastmodified : $this->lastmodified['value']; break; case 'LOCATION': if( !empty( $this->location['value'] )) return ( $inclParam ) ? $this->location : $this->location['value']; break; case 'ORGANIZER': if( !empty( $this->organizer['value'] )) return ( $inclParam ) ? $this->organizer : $this->organizer['value']; break; case 'PERCENT-COMPLETE': if( !empty( $this->percentcomplete['value'] ) || ( isset( $this->percentcomplete['value'] ) && ( '0' == $this->percentcomplete['value'] ))) return ( $inclParam ) ? $this->percentcomplete : $this->percentcomplete['value']; break; case 'PRIORITY': if( !empty( $this->priority['value'] ) || ( isset( $this->priority['value'] ) && ('0' == $this->priority['value'] ))) return ( $inclParam ) ? $this->priority : $this->priority['value']; break; case 'RDATE': $ak = ( is_array( $this->rdate )) ? array_keys( $this->rdate ) : array(); while( is_array( $this->rdate ) && !isset( $this->rdate[$propix] ) && ( 0 < count( $this->rdate )) && ( $propix < end( $ak ))) $propix++; $this->propix[$propName] = $propix; if( !isset( $this->rdate[$propix] )) { unset( $this->propix[$propName] ); return FALSE; } return ( $inclParam ) ? $this->rdate[$propix] : $this->rdate[$propix]['value']; break; case 'RECURRENCE-ID': if( !empty( $this->recurrenceid['value'] )) return ( $inclParam ) ? $this->recurrenceid : $this->recurrenceid['value']; break; case 'RELATED-TO': $ak = ( is_array( $this->relatedto )) ? array_keys( $this->relatedto ) : array(); while( is_array( $this->relatedto ) && !isset( $this->relatedto[$propix] ) && ( 0 < count( $this->relatedto )) && ( $propix < end( $ak ))) $propix++; $this->propix[$propName] = $propix; if( !isset( $this->relatedto[$propix] )) { unset( $this->propix[$propName] ); return FALSE; } return ( $inclParam ) ? $this->relatedto[$propix] : $this->relatedto[$propix]['value']; break; case 'REPEAT': if( !empty( $this->repeat['value'] ) || ( isset( $this->repeat['value'] ) && ( '0' == $this->repeat['value'] ))) return ( $inclParam ) ? $this->repeat : $this->repeat['value']; break; case 'REQUEST-STATUS': $ak = ( is_array( $this->requeststatus )) ? array_keys( $this->requeststatus ) : array(); while( is_array( $this->requeststatus ) && !isset( $this->requeststatus[$propix] ) && ( 0 < count( $this->requeststatus )) && ( $propix < end( $ak ))) $propix++; $this->propix[$propName] = $propix; if( !isset( $this->requeststatus[$propix] )) { unset( $this->propix[$propName] ); return FALSE; } return ( $inclParam ) ? $this->requeststatus[$propix] : $this->requeststatus[$propix]['value']; break; case 'RESOURCES': $ak = ( is_array( $this->resources )) ? array_keys( $this->resources ) : array(); while( is_array( $this->resources ) && !isset( $this->resources[$propix] ) && ( 0 < count( $this->resources )) && ( $propix < end( $ak ))) $propix++; $this->propix[$propName] = $propix; if( !isset( $this->resources[$propix] )) { unset( $this->propix[$propName] ); return FALSE; } return ( $inclParam ) ? $this->resources[$propix] : $this->resources[$propix]['value']; break; case 'RRULE': $ak = ( is_array( $this->rrule )) ? array_keys( $this->rrule ) : array(); while( is_array( $this->rrule ) && !isset( $this->rrule[$propix] ) && ( 0 < count( $this->rrule )) && ( $propix < end( $ak ))) $propix++; $this->propix[$propName] = $propix; if( !isset( $this->rrule[$propix] )) { unset( $this->propix[$propName] ); return FALSE; } return ( $inclParam ) ? $this->rrule[$propix] : $this->rrule[$propix]['value']; break; case 'SEQUENCE': if( isset( $this->sequence['value'] ) && ( isset( $this->sequence['value'] ) && ( '0' <= $this->sequence['value'] ))) return ( $inclParam ) ? $this->sequence : $this->sequence['value']; break; case 'STATUS': if( !empty( $this->status['value'] )) return ( $inclParam ) ? $this->status : $this->status['value']; break; case 'SUMMARY': if( !empty( $this->summary['value'] )) return ( $inclParam ) ? $this->summary : $this->summary['value']; break; case 'TRANSP': if( !empty( $this->transp['value'] )) return ( $inclParam ) ? $this->transp : $this->transp['value']; break; case 'TRIGGER': if( !empty( $this->trigger['value'] )) return ( $inclParam ) ? $this->trigger : $this->trigger['value']; break; case 'TZID': if( !empty( $this->tzid['value'] )) return ( $inclParam ) ? $this->tzid : $this->tzid['value']; break; case 'TZNAME': $ak = ( is_array( $this->tzname )) ? array_keys( $this->tzname ) : array(); while( is_array( $this->tzname ) && !isset( $this->tzname[$propix] ) && ( 0 < count( $this->tzname )) && ( $propix < end( $ak ))) $propix++; $this->propix[$propName] = $propix; if( !isset( $this->tzname[$propix] )) { unset( $this->propix[$propName] ); return FALSE; } return ( $inclParam ) ? $this->tzname[$propix] : $this->tzname[$propix]['value']; break; case 'TZOFFSETFROM': if( !empty( $this->tzoffsetfrom['value'] )) return ( $inclParam ) ? $this->tzoffsetfrom : $this->tzoffsetfrom['value']; break; case 'TZOFFSETTO': if( !empty( $this->tzoffsetto['value'] )) return ( $inclParam ) ? $this->tzoffsetto : $this->tzoffsetto['value']; break; case 'TZURL': if( !empty( $this->tzurl['value'] )) return ( $inclParam ) ? $this->tzurl : $this->tzurl['value']; break; case 'UID': if( in_array( $this->objName, array( 'valarm', 'vtimezone', 'standard', 'daylight' ))) return FALSE; if( empty( $this->uid['value'] )) $this->_makeuid(); return ( $inclParam ) ? $this->uid : $this->uid['value']; break; case 'URL': if( !empty( $this->url['value'] )) return ( $inclParam ) ? $this->url : $this->url['value']; break; default: if( $propName != 'X-PROP' ) { if( !isset( $this->xprop[$propName] )) return FALSE; return ( $inclParam ) ? array( $propName, $this->xprop[$propName] ) : array( $propName, $this->xprop[$propName]['value'] ); } else { if( empty( $this->xprop )) return FALSE; $xpropno = 0; foreach( $this->xprop as $xpropkey => $xpropvalue ) { if( $propix == $xpropno ) return ( $inclParam ) ? array( $xpropkey, $this->xprop[$xpropkey] ) : array( $xpropkey, $this->xprop[$xpropkey]['value'] ); else $xpropno++; } return FALSE; // not found ?? } } return FALSE; } /** * returns calendar property unique values for 'ATTENDEE', 'CATEGORIES', 'CONTACT', 'RELATED-TO' or 'RESOURCES' and for each, number of occurrence * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.13.4 - 2012-08-07 * @param string $propName * @param array $output, incremented result array */ function _getProperties( $propName, & $output ) { if( empty( $output )) $output = array(); if( !in_array( strtoupper( $propName ), array( 'ATTENDEE', 'CATEGORIES', 'CONTACT', 'RELATED-TO', 'RESOURCES' ))) return $output; while( FALSE !== ( $content = $this->getProperty( $propName ))) { if( empty( $content )) continue; if( is_array( $content )) { foreach( $content as $part ) { if( FALSE !== strpos( $part, ',' )) { $part = explode( ',', $part ); foreach( $part as $thePart ) { $thePart = trim( $thePart ); if( !empty( $thePart )) { if( !isset( $output[$thePart] )) $output[$thePart] = 1; else $output[$thePart] += 1; } } } else { $part = trim( $part ); if( !isset( $output[$part] )) $output[$part] = 1; else $output[$part] += 1; } } } // end if( is_array( $content )) elseif( FALSE !== strpos( $content, ',' )) { $content = explode( ',', $content ); foreach( $content as $thePart ) { $thePart = trim( $thePart ); if( !empty( $thePart )) { if( !isset( $output[$thePart] )) $output[$thePart] = 1; else $output[$thePart] += 1; } } } // end elseif( FALSE !== strpos( $content, ',' )) else { $content = trim( $content ); if( !empty( $content )) { if( !isset( $output[$content] )) $output[$content] = 1; else $output[$content] += 1; } } } ksort( $output ); } /** * general component property setting * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.5.1 - 2008-11-05 * @param mixed $args variable number of function arguments, * first argument is ALWAYS component name, * second ALWAYS component value! * @return void */ function setProperty() { $numargs = func_num_args(); if( 1 > $numargs ) return FALSE; $arglist = func_get_args(); if( $this->_notExistProp( $arglist[0] )) return FALSE; if( !$this->getConfig( 'allowEmpty' ) && ( !isset( $arglist[1] ) || empty( $arglist[1] ))) return FALSE; $arglist[0] = strtoupper( $arglist[0] ); for( $argix=$numargs; $argix < 12; $argix++ ) { if( !isset( $arglist[$argix] )) $arglist[$argix] = null; } switch( $arglist[0] ) { case 'ACTION': return $this->setAction( $arglist[1], $arglist[2] ); case 'ATTACH': return $this->setAttach( $arglist[1], $arglist[2], $arglist[3] ); case 'ATTENDEE': return $this->setAttendee( $arglist[1], $arglist[2], $arglist[3] ); case 'CATEGORIES': return $this->setCategories( $arglist[1], $arglist[2], $arglist[3] ); case 'CLASS': return $this->setClass( $arglist[1], $arglist[2] ); case 'COMMENT': return $this->setComment( $arglist[1], $arglist[2], $arglist[3] ); case 'COMPLETED': return $this->setCompleted( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7] ); case 'CONTACT': return $this->setContact( $arglist[1], $arglist[2], $arglist[3] ); case 'CREATED': return $this->setCreated( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7] ); case 'DESCRIPTION': return $this->setDescription( $arglist[1], $arglist[2], $arglist[3] ); case 'DTEND': return $this->setDtend( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7], $arglist[8] ); case 'DTSTAMP': return $this->setDtstamp( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7] ); case 'DTSTART': return $this->setDtstart( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7], $arglist[8] ); case 'DUE': return $this->setDue( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7], $arglist[8] ); case 'DURATION': return $this->setDuration( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6] ); case 'EXDATE': return $this->setExdate( $arglist[1], $arglist[2], $arglist[3] ); case 'EXRULE': return $this->setExrule( $arglist[1], $arglist[2], $arglist[3] ); case 'FREEBUSY': return $this->setFreebusy( $arglist[1], $arglist[2], $arglist[3], $arglist[4] ); case 'GEO': return $this->setGeo( $arglist[1], $arglist[2], $arglist[3] ); case 'LAST-MODIFIED': return $this->setLastModified( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7] ); case 'LOCATION': return $this->setLocation( $arglist[1], $arglist[2] ); case 'ORGANIZER': return $this->setOrganizer( $arglist[1], $arglist[2] ); case 'PERCENT-COMPLETE': return $this->setPercentComplete( $arglist[1], $arglist[2] ); case 'PRIORITY': return $this->setPriority( $arglist[1], $arglist[2] ); case 'RDATE': return $this->setRdate( $arglist[1], $arglist[2], $arglist[3] ); case 'RECURRENCE-ID': return $this->setRecurrenceid( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7], $arglist[8] ); case 'RELATED-TO': return $this->setRelatedTo( $arglist[1], $arglist[2], $arglist[3] ); case 'REPEAT': return $this->setRepeat( $arglist[1], $arglist[2] ); case 'REQUEST-STATUS': return $this->setRequestStatus( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5] ); case 'RESOURCES': return $this->setResources( $arglist[1], $arglist[2], $arglist[3] ); case 'RRULE': return $this->setRrule( $arglist[1], $arglist[2], $arglist[3] ); case 'SEQUENCE': return $this->setSequence( $arglist[1], $arglist[2] ); case 'STATUS': return $this->setStatus( $arglist[1], $arglist[2] ); case 'SUMMARY': return $this->setSummary( $arglist[1], $arglist[2] ); case 'TRANSP': return $this->setTransp( $arglist[1], $arglist[2] ); case 'TRIGGER': return $this->setTrigger( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7], $arglist[8], $arglist[9], $arglist[10], $arglist[11] ); case 'TZID': return $this->setTzid( $arglist[1], $arglist[2] ); case 'TZNAME': return $this->setTzname( $arglist[1], $arglist[2], $arglist[3] ); case 'TZOFFSETFROM': return $this->setTzoffsetfrom( $arglist[1], $arglist[2] ); case 'TZOFFSETTO': return $this->setTzoffsetto( $arglist[1], $arglist[2] ); case 'TZURL': return $this->setTzurl( $arglist[1], $arglist[2] ); case 'UID': return $this->setUid( $arglist[1], $arglist[2] ); case 'URL': return $this->setUrl( $arglist[1], $arglist[2] ); default: return $this->setXprop( $arglist[0], $arglist[1], $arglist[2] ); } return FALSE; } /*********************************************************************************/ /** * parse component unparsed data into properties * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.12.17 - 2012-07-15 * @param mixed $unparsedtext, optional, strict rfc2445 formatted, single property string or array of strings * @return bool FALSE if error occurs during parsing * */ function parse( $unparsedtext=null ) { if( !empty( $unparsedtext )) { $nl = $this->getConfig( 'nl' ); if( is_array( $unparsedtext )) $unparsedtext = implode( '\n'.$nl, $unparsedtext ); $unparsedtext = explode( $nl, iCalUtilityFunctions::convEolChar( $unparsedtext, $nl )); } elseif( !isset( $this->unparsed )) $unparsedtext = array(); else $unparsedtext = $this->unparsed; /* skip leading (empty/invalid) lines */ foreach( $unparsedtext as $lix => $line ) { $tst = trim( $line ); if(( '\n' == $tst ) || empty( $tst )) unset( $unparsedtext[$lix] ); else break; } $this->unparsed = array(); $comp = & $this; $config = $this->getConfig(); $compsync = $subsync = 0; foreach ( $unparsedtext as $lix => $line ) { if( 'END:VALARM' == strtoupper( substr( $line, 0, 10 ))) { if( 1 != $subsync ) return FALSE; $this->components[] = $comp->copy(); $subsync--; } elseif( 'END:DAYLIGHT' == strtoupper( substr( $line, 0, 12 ))) { if( 1 != $subsync ) return FALSE; $this->components[] = $comp->copy(); $subsync--; } elseif( 'END:STANDARD' == strtoupper( substr( $line, 0, 12 ))) { if( 1 != $subsync ) return FALSE; array_unshift( $this->components, $comp->copy()); $subsync--; } elseif( 'END:' == strtoupper( substr( $line, 0, 4 ))) { // end: if( 1 != $compsync ) return FALSE; if( 0 < $subsync ) $this->components[] = $comp->copy(); $compsync--; break; /* skip trailing empty lines */ } elseif( 'BEGIN:VALARM' == strtoupper( substr( $line, 0, 12 ))) { $comp = new valarm( $config); $subsync++; } elseif( 'BEGIN:STANDARD' == strtoupper( substr( $line, 0, 14 ))) { $comp = new vtimezone( 'standard', $config ); $subsync++; } elseif( 'BEGIN:DAYLIGHT' == strtoupper( substr( $line, 0, 14 ))) { $comp = new vtimezone( 'daylight', $config ); $subsync++; } elseif( 'BEGIN:' == strtoupper( substr( $line, 0, 6 ))) // begin: $compsync++; else $comp->unparsed[] = $line; } if( 0 < $subsync ) $this->components[] = $comp->copy(); unset( $config ); /* concatenate property values spread over several lines */ $lastix = -1; $propnames = array( 'action', 'attach', 'attendee', 'categories', 'comment', 'completed' , 'contact', 'class', 'created', 'description', 'dtend', 'dtstart' , 'dtstamp', 'due', 'duration', 'exdate', 'exrule', 'freebusy', 'geo' , 'last-modified', 'location', 'organizer', 'percent-complete' , 'priority', 'rdate', 'recurrence-id', 'related-to', 'repeat' , 'request-status', 'resources', 'rrule', 'sequence', 'status' , 'summary', 'transp', 'trigger', 'tzid', 'tzname', 'tzoffsetfrom' , 'tzoffsetto', 'tzurl', 'uid', 'url', 'x-' ); $proprows = array(); foreach( $this->unparsed as $line ) { $newProp = FALSE; foreach ( $propnames as $propname ) { if( $propname == strtolower( substr( $line, 0, strlen( $propname )))) { $newProp = TRUE; break; } } if( $newProp ) { $newProp = FALSE; $lastix++; $proprows[$lastix] = $line; } else $proprows[$lastix] .= '!"#¤%&/()=?'.$line; } /* parse each property 'line' */ $paramMStz = array( 'utc-', 'utc+', 'gmt-', 'gmt+' ); $paramProto3 = array( 'fax:', 'cid:', 'sms:', 'tel:', 'urn:' ); $paramProto4 = array( 'crid:', 'news:', 'pres:' ); foreach( $proprows as $line ) { $line = str_replace( '!"#¤%&/()=? ', '', $line ); $line = str_replace( '!"#¤%&/()=?', '', $line ); if( '\n' == substr( $line, -2 )) $line = substr( $line, 0, -2 ); /* get propname, (problem with x-properties, otherwise in previous loop) */ $propname = null; $cix = 0; while( isset( $line[$cix] )) { if( in_array( $line[$cix], array( ':', ';' ))) break; else $propname .= $line[$cix]; $cix++; } if(( 'x-' == substr( $propname, 0, 2 )) || ( 'X-' == substr( $propname, 0, 2 ))) { $propname2 = $propname; $propname = 'X-'; } /* rest of the line is opt.params and value */ $line = substr( $line, $cix ); /* separate attributes from value */ $attr = array(); $attrix = -1; $clen = strlen( $line ); $WithinQuotes = FALSE; $cix = 0; while( FALSE !== substr( $line, $cix, 1 )) { if( ( ':' == $line[$cix] ) && ( substr( $line,$cix, 3 ) != '://' ) && ( !in_array( strtolower( substr( $line,$cix - 6, 4 )), $paramMStz )) && ( !in_array( strtolower( substr( $line,$cix - 3, 4 )), $paramProto3 )) && ( !in_array( strtolower( substr( $line,$cix - 4, 5 )), $paramProto4 )) && ( strtolower( substr( $line,$cix - 6, 7 )) != 'mailto:' ) && !$WithinQuotes ) { $attrEnd = TRUE; if(( $cix < ( $clen - 4 )) && ctype_digit( substr( $line, $cix+1, 4 ))) { // an URI with a (4pos) portnr?? for( $c2ix = $cix; 3 < $c2ix; $c2ix-- ) { if( '://' == substr( $line, $c2ix - 2, 3 )) { $attrEnd = FALSE; break; // an URI with a portnr!! } } } if( $attrEnd) { $line = substr( $line, ( $cix + 1 )); break; } $cix++; } if( '"' == $line[$cix] ) $WithinQuotes = ( FALSE === $WithinQuotes ) ? TRUE : FALSE; if( ';' == $line[$cix] ) $attr[++$attrix] = null; else $attr[$attrix] .= $line[$cix]; $cix++; } /* make attributes in array format */ $propattr = array(); foreach( $attr as $attribute ) { $attrsplit = explode( '=', $attribute, 2 ); if( 1 < count( $attrsplit )) $propattr[$attrsplit[0]] = $attrsplit[1]; else $propattr[] = $attribute; } /* call setProperty( $propname.. . */ switch( strtoupper( $propname )) { case 'ATTENDEE': foreach( $propattr as $pix => $attr ) { if( !in_array( strtoupper( $pix ), array( 'MEMBER', 'DELEGATED-TO', 'DELEGATED-FROM' ))) continue; $attr2 = explode( ',', $attr ); if( 1 < count( $attr2 )) $propattr[$pix] = $attr2; } $this->setProperty( $propname, $line, $propattr ); break; case 'X-': $propname = ( isset( $propname2 )) ? $propname2 : $propname; unset( $propname2 ); case 'CATEGORIES': case 'RESOURCES': if( FALSE !== strpos( $line, ',' )) { $content = array( 0 => '' ); $cix = $lix = 0; while( FALSE !== substr( $line, $lix, 1 )) { if(( ',' == $line[$lix] ) && ( "\\" != $line[( $lix - 1 )])) { $cix++; $content[$cix] = ''; } else $content[$cix] .= $line[$lix]; $lix++; } if( 1 < count( $content )) { $content = array_values( $content ); foreach( $content as $cix => $contentPart ) $content[$cix] = calendarComponent::_strunrep( $contentPart ); $this->setProperty( $propname, $content, $propattr ); break; } else $line = reset( $content ); } case 'COMMENT': case 'CONTACT': case 'DESCRIPTION': case 'LOCATION': case 'SUMMARY': if( empty( $line )) $propattr = null; $this->setProperty( $propname, calendarComponent::_strunrep( $line ), $propattr ); break; case 'REQUEST-STATUS': $values = explode( ';', $line, 3 ); $values[1] = ( !isset( $values[1] )) ? null : calendarComponent::_strunrep( $values[1] ); $values[2] = ( !isset( $values[2] )) ? null : calendarComponent::_strunrep( $values[2] ); $this->setProperty( $propname , $values[0] // statcode , $values[1] // statdesc , $values[2] // extdata , $propattr ); break; case 'FREEBUSY': $fbtype = ( isset( $propattr['FBTYPE'] )) ? $propattr['FBTYPE'] : ''; // force setting default, if missing unset( $propattr['FBTYPE'] ); $values = explode( ',', $line ); foreach( $values as $vix => $value ) { $value2 = explode( '/', $value ); if( 1 < count( $value2 )) $values[$vix] = $value2; } $this->setProperty( $propname, $fbtype, $values, $propattr ); break; case 'GEO': $value = explode( ';', $line, 2 ); if( 2 > count( $value )) $value[1] = null; $this->setProperty( $propname, $value[0], $value[1], $propattr ); break; case 'EXDATE': $values = ( !empty( $line )) ? explode( ',', $line ) : null; $this->setProperty( $propname, $values, $propattr ); break; case 'RDATE': if( empty( $line )) { $this->setProperty( $propname, $line, $propattr ); break; } $values = explode( ',', $line ); foreach( $values as $vix => $value ) { $value2 = explode( '/', $value ); if( 1 < count( $value2 )) $values[$vix] = $value2; } $this->setProperty( $propname, $values, $propattr ); break; case 'EXRULE': case 'RRULE': $values = explode( ';', $line ); $recur = array(); foreach( $values as $value2 ) { if( empty( $value2 )) continue; // ;-char in ending position ??? $value3 = explode( '=', $value2, 2 ); $rulelabel = strtoupper( $value3[0] ); switch( $rulelabel ) { case 'BYDAY': { $value4 = explode( ',', $value3[1] ); if( 1 < count( $value4 )) { foreach( $value4 as $v5ix => $value5 ) { $value6 = array(); $dayno = $dayname = null; $value5 = trim( (string) $value5 ); if(( ctype_alpha( substr( $value5, -1 ))) && ( ctype_alpha( substr( $value5, -2, 1 )))) { $dayname = substr( $value5, -2, 2 ); if( 2 < strlen( $value5 )) $dayno = substr( $value5, 0, ( strlen( $value5 ) - 2 )); } if( $dayno ) $value6[] = $dayno; if( $dayname ) $value6['DAY'] = $dayname; $value4[$v5ix] = $value6; } } else { $value4 = array(); $dayno = $dayname = null; $value5 = trim( (string) $value3[1] ); if(( ctype_alpha( substr( $value5, -1 ))) && ( ctype_alpha( substr( $value5, -2, 1 )))) { $dayname = substr( $value5, -2, 2 ); if( 2 < strlen( $value5 )) $dayno = substr( $value5, 0, ( strlen( $value5 ) - 2 )); } if( $dayno ) $value4[] = $dayno; if( $dayname ) $value4['DAY'] = $dayname; } $recur[$rulelabel] = $value4; break; } default: { $value4 = explode( ',', $value3[1] ); if( 1 < count( $value4 )) $value3[1] = $value4; $recur[$rulelabel] = $value3[1]; break; } } // end - switch $rulelabel } // end - foreach( $values.. . $this->setProperty( $propname, $recur, $propattr ); break; case 'ACTION': case 'CLASSIFICATION': case 'STATUS': case 'TRANSP': case 'UID': case 'TZID': case 'RELATED-TO': case 'TZNAME': $line = calendarComponent::_strunrep( $line ); default: $this->setProperty( $propname, $line, $propattr ); break; } // end switch( $propname.. . } // end - foreach( $proprows.. . unset( $unparsedtext, $this->unparsed, $proprows ); if( isset( $this->components ) && is_array( $this->components ) && ( 0 < count( $this->components ))) { $ckeys = array_keys( $this->components ); foreach( $ckeys as $ckey ) { if( !empty( $this->components[$ckey] ) && !empty( $this->components[$ckey]->unparsed )) { $this->components[$ckey]->parse(); } } } return TRUE; } /*********************************************************************************/ /*********************************************************************************/ /** * return a copy of this component * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.8.8 - 2011-03-15 * @return object */ function copy() { $serialized_contents = serialize( $this ); $copy = unserialize( $serialized_contents ); return $copy; } /*********************************************************************************/ /*********************************************************************************/ /** * delete calendar subcomponent from component container * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.8.8 - 2011-03-15 * @param mixed $arg1 ordno / component type / component uid * @param mixed $arg2 optional, ordno if arg1 = component type * @return void */ function deleteComponent( $arg1, $arg2=FALSE ) { if( !isset( $this->components )) return FALSE; $argType = $index = null; if ( ctype_digit( (string) $arg1 )) { $argType = 'INDEX'; $index = (int) $arg1 - 1; } elseif(( strlen( $arg1 ) <= strlen( 'vfreebusy' )) && ( FALSE === strpos( $arg1, '@' ))) { $argType = strtolower( $arg1 ); $index = ( !empty( $arg2 ) && ctype_digit( (string) $arg2 )) ? (( int ) $arg2 - 1 ) : 0; } $cix2dC = 0; foreach ( $this->components as $cix => $component) { if( empty( $component )) continue; if(( 'INDEX' == $argType ) && ( $index == $cix )) { unset( $this->components[$cix] ); return TRUE; } elseif( $argType == $component->objName ) { if( $index == $cix2dC ) { unset( $this->components[$cix] ); return TRUE; } $cix2dC++; } elseif( !$argType && ($arg1 == $component->getProperty( 'uid' ))) { unset( $this->components[$cix] ); return TRUE; } } return FALSE; } /** * get calendar component subcomponent from component container * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.8.8 - 2011-03-15 * @param mixed $arg1 optional, ordno/component type/ component uid * @param mixed $arg2 optional, ordno if arg1 = component type * @return object */ function getComponent ( $arg1=FALSE, $arg2=FALSE ) { if( !isset( $this->components )) return FALSE; $index = $argType = null; if ( !$arg1 ) { $argType = 'INDEX'; $index = $this->compix['INDEX'] = ( isset( $this->compix['INDEX'] )) ? $this->compix['INDEX'] + 1 : 1; } elseif ( ctype_digit( (string) $arg1 )) { $argType = 'INDEX'; $index = (int) $arg1; unset( $this->compix ); } elseif(( strlen( $arg1 ) <= strlen( 'vfreebusy' )) && ( FALSE === strpos( $arg1, '@' ))) { unset( $this->compix['INDEX'] ); $argType = strtolower( $arg1 ); if( !$arg2 ) $index = $this->compix[$argType] = ( isset( $this->compix[$argType] )) ? $this->compix[$argType] + 1 : 1; else $index = (int) $arg2; } $index -= 1; $ckeys = array_keys( $this->components ); if( !empty( $index) && ( $index > end( $ckeys ))) return FALSE; $cix2gC = 0; foreach( $this->components as $cix => $component ) { if( empty( $component )) continue; if(( 'INDEX' == $argType ) && ( $index == $cix )) return $component->copy(); elseif( $argType == $component->objName ) { if( $index == $cix2gC ) return $component->copy(); $cix2gC++; } elseif( !$argType && ( $arg1 == $component->getProperty( 'uid' ))) return $component->copy(); } /* not found.. . */ unset( $this->compix ); return false; } /** * add calendar component as subcomponent to container for subcomponents * * @author Kjell-Inge Gustafsson, kigkonsult * @since 1.x.x - 2007-04-24 * @param object $component calendar component * @return void */ function addSubComponent ( $component ) { $this->setComponent( $component ); } /** * create new calendar component subcomponent, already included within component * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.6.33 - 2011-01-03 * @param string $compType subcomponent type * @return object (reference) */ function & newComponent( $compType ) { $config = $this->getConfig(); $keys = array_keys( $this->components ); $ix = end( $keys) + 1; switch( strtoupper( $compType )) { case 'ALARM': case 'VALARM': $this->components[$ix] = new valarm( $config ); break; case 'STANDARD': array_unshift( $this->components, new vtimezone( 'STANDARD', $config )); $ix = 0; break; case 'DAYLIGHT': $this->components[$ix] = new vtimezone( 'DAYLIGHT', $config ); break; default: return FALSE; } return $this->components[$ix]; } /** * add calendar component as subcomponent to container for subcomponents * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.8.8 - 2011-03-15 * @param object $component calendar component * @param mixed $arg1 optional, ordno/component type/ component uid * @param mixed $arg2 optional, ordno if arg1 = component type * @return bool */ function setComponent( $component, $arg1=FALSE, $arg2=FALSE ) { if( !isset( $this->components )) return FALSE; $component->setConfig( $this->getConfig(), FALSE, TRUE ); if( !in_array( $component->objName, array( 'valarm', 'vtimezone', 'standard', 'daylight' ))) { /* make sure dtstamp and uid is set */ $dummy = $component->getProperty( 'dtstamp' ); $dummy = $component->getProperty( 'uid' ); } if( !$arg1 ) { // plain insert, last in chain $this->components[] = $component->copy(); return TRUE; } $argType = $index = null; if ( ctype_digit( (string) $arg1 )) { // index insert/replace $argType = 'INDEX'; $index = (int) $arg1 - 1; } elseif( in_array( strtolower( $arg1 ), array( 'vevent', 'vtodo', 'vjournal', 'vfreebusy', 'valarm', 'vtimezone' ))) { $argType = strtolower( $arg1 ); $index = ( ctype_digit( (string) $arg2 )) ? ((int) $arg2) - 1 : 0; } // else if arg1 is set, arg1 must be an UID $cix2sC = 0; foreach ( $this->components as $cix => $component2 ) { if( empty( $component2 )) continue; if(( 'INDEX' == $argType ) && ( $index == $cix )) { // index insert/replace $this->components[$cix] = $component->copy(); return TRUE; } elseif( $argType == $component2->objName ) { // component Type index insert/replace if( $index == $cix2sC ) { $this->components[$cix] = $component->copy(); return TRUE; } $cix2sC++; } elseif( !$argType && ( $arg1 == $component2->getProperty( 'uid' ))) { // UID insert/replace $this->components[$cix] = $component->copy(); return TRUE; } } /* arg1=index and not found.. . insert at index .. .*/ if( 'INDEX' == $argType ) { $this->components[$index] = $component->copy(); ksort( $this->components, SORT_NUMERIC ); } else /* not found.. . insert last in chain anyway .. .*/ $this->components[] = $component->copy(); return TRUE; } /** * creates formatted output for subcomponents * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.11.20 - 2012-02-06 * @param array $xcaldecl * @return string */ function createSubComponent() { $output = null; if( 'vtimezone' == $this->objName ) { // sort subComponents, first standard, then daylight, in dtstart order $stdarr = $dlarr = array(); foreach( $this->components as $component ) { if( empty( $component )) continue; $dt = $component->getProperty( 'dtstart' ); $key = sprintf( '%04d%02d%02d%02d%02d%02d000', $dt['year'], $dt['month'], $dt['day'], $dt['hour'], $dt['min'], $dt['sec'] ); if( 'standard' == $component->objName ) { while( isset( $stdarr[$key] )) $key += 1; $stdarr[$key] = $component->copy(); } elseif( 'daylight' == $component->objName ) { while( isset( $dlarr[$key] )) $key += 1; $dlarr[$key] = $component->copy(); } } // end foreach( $this->components as $component ) $this->components = array(); ksort( $stdarr, SORT_NUMERIC ); foreach( $stdarr as $std ) $this->components[] = $std->copy(); unset( $stdarr ); ksort( $dlarr, SORT_NUMERIC ); foreach( $dlarr as $dl ) $this->components[] = $dl->copy(); unset( $dlarr ); } // end if( 'vtimezone' == $this->objName ) foreach( $this->components as $component ) { $component->setConfig( $this->getConfig(), FALSE, TRUE ); $output .= $component->createComponent( $this->xcaldecl ); } return $output; } /********************************************************************************/ /** * break lines at pos 75 * * Lines of text SHOULD NOT be longer than 75 octets, excluding the line * break. Long content lines SHOULD be split into a multiple line * representations using a line "folding" technique. That is, a long * line can be split between any two characters by inserting a CRLF * immediately followed by a single linear white space character (i.e., * SPACE, US-ASCII decimal 32 or HTAB, US-ASCII decimal 9). Any sequence * of CRLF followed immediately by a single linear white space character * is ignored (i.e., removed) when processing the content type. * * Edited 2007-08-26 by Anders Litzell, anders@litzell.se to fix bug where * the reserved expression "\n" in the arg $string could be broken up by the * folding of lines, causing ambiguity in the return string. * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.12.17 - 2012-07-15 * @param string $value * @return string */ function _size75( $string ) { $tmp = $string; $string = ''; $cCnt = $x = 0; while( TRUE ) { if( !isset( $tmp[$x] )) { $string .= $this->nl; // loop breakes here break; } elseif(( 74 <= $cCnt ) && ( '\\' == $tmp[$x] ) && ( 'n' == $tmp[$x+1] )) { $string .= $this->nl.' \n'; // don't break lines inside '\n' $x += 2; if( !isset( $tmp[$x] )) { $string .= $this->nl; break; } $cCnt = 3; } elseif( 75 <= $cCnt ) { $string .= $this->nl.' '; $cCnt = 1; } $byte = ord( $tmp[$x] ); $string .= $tmp[$x]; switch( TRUE ) { // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 case(( $byte >= 0x20 ) && ( $byte <= 0x7F )): // characters U-00000000 - U-0000007F (same as ASCII) $cCnt += 1; break; // add a one byte character case(( $byte & 0xE0) == 0xC0 ): // characters U-00000080 - U-000007FF, mask 110XXXXX if( isset( $tmp[$x+1] )) { $cCnt += 1; $string .= $tmp[$x+1]; $x += 1; // add a two bytes character } break; case(( $byte & 0xF0 ) == 0xE0 ): // characters U-00000800 - U-0000FFFF, mask 1110XXXX if( isset( $tmp[$x+2] )) { $cCnt += 1; $string .= $tmp[$x+1].$tmp[$x+2]; $x += 2; // add a three bytes character } break; case(( $byte & 0xF8 ) == 0xF0 ): // characters U-00010000 - U-001FFFFF, mask 11110XXX if( isset( $tmp[$x+3] )) { $cCnt += 1; $string .= $tmp[$x+1].$tmp[$x+2].$tmp[$x+3]; $x += 3; // add a four bytes character } break; case(( $byte & 0xFC ) == 0xF8 ): // characters U-00200000 - U-03FFFFFF, mask 111110XX if( isset( $tmp[$x+4] )) { $cCnt += 1; $string .= $tmp[$x+1].$tmp[$x+2].$tmp[$x+3].$tmp[$x+4]; $x += 4; // add a five bytes character } break; case(( $byte & 0xFE ) == 0xFC ): // characters U-04000000 - U-7FFFFFFF, mask 1111110X if( isset( $tmp[$x+5] )) { $cCnt += 1; $string .= $tmp[$x+1].$tmp[$x+2].$tmp[$x+3].$tmp[$x+4].$tmp[$x+5]; $x += 5; // add a six bytes character } default: // add any other byte without counting up $cCnt break; } // end switch( TRUE ) $x += 1; // next 'byte' to test } // end while( TRUE ) { return $string; } /** * special characters management output * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.12.16 - 2012-07-16 * @param string $string * @return string */ function _strrep( $string ) { switch( $this->format ) { case 'xcal': $string = str_replace( '\n', $this->nl, $string); $string = htmlspecialchars( strip_tags( stripslashes( urldecode ( $string )))); break; default: $pos = 0; $specChars = array( 'n', 'N', 'r', ',', ';' ); while( isset( $string[$pos] )) { if( FALSE === ( $pos = strpos( $string, "\\", $pos ))) break; if( !in_array( substr( $string, $pos, 1 ), $specChars )) { $string = substr( $string, 0, $pos )."\\".substr( $string, ( $pos + 1 )); $pos += 1; } $pos += 1; } if( FALSE !== strpos( $string, '"' )) $string = str_replace('"', "'", $string); if( FALSE !== strpos( $string, ',' )) $string = str_replace(',', '\,', $string); if( FALSE !== strpos( $string, ';' )) $string = str_replace(';', '\;', $string); if( FALSE !== strpos( $string, "\r\n" )) $string = str_replace( "\r\n", '\n', $string); elseif( FALSE !== strpos( $string, "\r" )) $string = str_replace( "\r", '\n', $string); elseif( FALSE !== strpos( $string, "\n" )) $string = str_replace( "\n", '\n', $string); if( FALSE !== strpos( $string, '\N' )) $string = str_replace( '\N', '\n', $string); // if( FALSE !== strpos( $string, $this->nl )) $string = str_replace( $this->nl, '\n', $string); break; } return $string; } /** * special characters management input (from iCal file) * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.6.22 - 2010-10-17 * @param string $string * @return string */ static function _strunrep( $string ) { $string = str_replace( '\\\\', '\\', $string); $string = str_replace( '\,', ',', $string); $string = str_replace( '\;', ';', $string); // $string = str_replace( '\n', $this->nl, $string); // ?? return $string; } } /*********************************************************************************/ /*********************************************************************************/ /** * class for calendar component VEVENT * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.5.1 - 2008-10-12 */ class vevent extends calendarComponent { var $attach; var $attendee; var $categories; var $comment; var $contact; var $class; var $created; var $description; var $dtend; var $dtstart; var $duration; var $exdate; var $exrule; var $geo; var $lastmodified; var $location; var $organizer; var $priority; var $rdate; var $recurrenceid; var $relatedto; var $requeststatus; var $resources; var $rrule; var $sequence; var $status; var $summary; var $transp; var $url; var $xprop; // component subcomponents container var $components; /** * constructor for calendar component VEVENT object * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.8.2 - 2011-05-01 * @param array $config * @return void */ function vevent( $config = array()) { $this->calendarComponent(); $this->attach = ''; $this->attendee = ''; $this->categories = ''; $this->class = ''; $this->comment = ''; $this->contact = ''; $this->created = ''; $this->description = ''; $this->dtstart = ''; $this->dtend = ''; $this->duration = ''; $this->exdate = ''; $this->exrule = ''; $this->geo = ''; $this->lastmodified = ''; $this->location = ''; $this->organizer = ''; $this->priority = ''; $this->rdate = ''; $this->recurrenceid = ''; $this->relatedto = ''; $this->requeststatus = ''; $this->resources = ''; $this->rrule = ''; $this->sequence = ''; $this->status = ''; $this->summary = ''; $this->transp = ''; $this->url = ''; $this->xprop = ''; $this->components = array(); if( defined( 'ICAL_LANG' ) && !isset( $config['language'] )) $config['language'] = ICAL_LANG; if( !isset( $config['allowEmpty'] )) $config['allowEmpty'] = TRUE; if( !isset( $config['nl'] )) $config['nl'] = "\r\n"; if( !isset( $config['format'] )) $config['format'] = 'iCal'; if( !isset( $config['delimiter'] )) $config['delimiter'] = DIRECTORY_SEPARATOR; $this->setConfig( $config ); } /** * create formatted output for calendar component VEVENT object instance * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.10.16 - 2011-10-28 * @param array $xcaldecl * @return string */ function createComponent( &$xcaldecl ) { $objectname = $this->_createFormat(); $component = $this->componentStart1.$objectname.$this->componentStart2.$this->nl; $component .= $this->createUid(); $component .= $this->createDtstamp(); $component .= $this->createAttach(); $component .= $this->createAttendee(); $component .= $this->createCategories(); $component .= $this->createComment(); $component .= $this->createContact(); $component .= $this->createClass(); $component .= $this->createCreated(); $component .= $this->createDescription(); $component .= $this->createDtstart(); $component .= $this->createDtend(); $component .= $this->createDuration(); $component .= $this->createExdate(); $component .= $this->createExrule(); $component .= $this->createGeo(); $component .= $this->createLastModified(); $component .= $this->createLocation(); $component .= $this->createOrganizer(); $component .= $this->createPriority(); $component .= $this->createRdate(); $component .= $this->createRrule(); $component .= $this->createRelatedTo(); $component .= $this->createRequestStatus(); $component .= $this->createRecurrenceid(); $component .= $this->createResources(); $component .= $this->createSequence(); $component .= $this->createStatus(); $component .= $this->createSummary(); $component .= $this->createTransp(); $component .= $this->createUrl(); $component .= $this->createXprop(); $component .= $this->createSubComponent(); $component .= $this->componentEnd1.$objectname.$this->componentEnd2; if( is_array( $this->xcaldecl ) && ( 0 < count( $this->xcaldecl ))) { foreach( $this->xcaldecl as $localxcaldecl ) $xcaldecl[] = $localxcaldecl; } return $component; } } /*********************************************************************************/ /*********************************************************************************/ /** * class for calendar component VTODO * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.5.1 - 2008-10-12 */ class vtodo extends calendarComponent { var $attach; var $attendee; var $categories; var $comment; var $completed; var $contact; var $class; var $created; var $description; var $dtstart; var $due; var $duration; var $exdate; var $exrule; var $geo; var $lastmodified; var $location; var $organizer; var $percentcomplete; var $priority; var $rdate; var $recurrenceid; var $relatedto; var $requeststatus; var $resources; var $rrule; var $sequence; var $status; var $summary; var $url; var $xprop; // component subcomponents container var $components; /** * constructor for calendar component VTODO object * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.8.2 - 2011-05-01 * @param array $config * @return void */ function vtodo( $config = array()) { $this->calendarComponent(); $this->attach = ''; $this->attendee = ''; $this->categories = ''; $this->class = ''; $this->comment = ''; $this->completed = ''; $this->contact = ''; $this->created = ''; $this->description = ''; $this->dtstart = ''; $this->due = ''; $this->duration = ''; $this->exdate = ''; $this->exrule = ''; $this->geo = ''; $this->lastmodified = ''; $this->location = ''; $this->organizer = ''; $this->percentcomplete = ''; $this->priority = ''; $this->rdate = ''; $this->recurrenceid = ''; $this->relatedto = ''; $this->requeststatus = ''; $this->resources = ''; $this->rrule = ''; $this->sequence = ''; $this->status = ''; $this->summary = ''; $this->url = ''; $this->xprop = ''; $this->components = array(); if( defined( 'ICAL_LANG' ) && !isset( $config['language'] )) $config['language'] = ICAL_LANG; if( !isset( $config['allowEmpty'] )) $config['allowEmpty'] = TRUE; if( !isset( $config['nl'] )) $config['nl'] = "\r\n"; if( !isset( $config['format'] )) $config['format'] = 'iCal'; if( !isset( $config['delimiter'] )) $config['delimiter'] = DIRECTORY_SEPARATOR; $this->setConfig( $config ); } /** * create formatted output for calendar component VTODO object instance * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.5.1 - 2008-11-07 * @param array $xcaldecl * @return string */ function createComponent( &$xcaldecl ) { $objectname = $this->_createFormat(); $component = $this->componentStart1.$objectname.$this->componentStart2.$this->nl; $component .= $this->createUid(); $component .= $this->createDtstamp(); $component .= $this->createAttach(); $component .= $this->createAttendee(); $component .= $this->createCategories(); $component .= $this->createClass(); $component .= $this->createComment(); $component .= $this->createCompleted(); $component .= $this->createContact(); $component .= $this->createCreated(); $component .= $this->createDescription(); $component .= $this->createDtstart(); $component .= $this->createDue(); $component .= $this->createDuration(); $component .= $this->createExdate(); $component .= $this->createExrule(); $component .= $this->createGeo(); $component .= $this->createLastModified(); $component .= $this->createLocation(); $component .= $this->createOrganizer(); $component .= $this->createPercentComplete(); $component .= $this->createPriority(); $component .= $this->createRdate(); $component .= $this->createRelatedTo(); $component .= $this->createRequestStatus(); $component .= $this->createRecurrenceid(); $component .= $this->createResources(); $component .= $this->createRrule(); $component .= $this->createSequence(); $component .= $this->createStatus(); $component .= $this->createSummary(); $component .= $this->createUrl(); $component .= $this->createXprop(); $component .= $this->createSubComponent(); $component .= $this->componentEnd1.$objectname.$this->componentEnd2; if( is_array( $this->xcaldecl ) && ( 0 < count( $this->xcaldecl ))) { foreach( $this->xcaldecl as $localxcaldecl ) $xcaldecl[] = $localxcaldecl; } return $component; } } /*********************************************************************************/ /*********************************************************************************/ /** * class for calendar component VJOURNAL * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.5.1 - 2008-10-12 */ class vjournal extends calendarComponent { var $attach; var $attendee; var $categories; var $comment; var $contact; var $class; var $created; var $description; var $dtstart; var $exdate; var $exrule; var $lastmodified; var $organizer; var $rdate; var $recurrenceid; var $relatedto; var $requeststatus; var $rrule; var $sequence; var $status; var $summary; var $url; var $xprop; /** * constructor for calendar component VJOURNAL object * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.8.2 - 2011-05-01 * @param array $config * @return void */ function vjournal( $config = array()) { $this->calendarComponent(); $this->attach = ''; $this->attendee = ''; $this->categories = ''; $this->class = ''; $this->comment = ''; $this->contact = ''; $this->created = ''; $this->description = ''; $this->dtstart = ''; $this->exdate = ''; $this->exrule = ''; $this->lastmodified = ''; $this->organizer = ''; $this->rdate = ''; $this->recurrenceid = ''; $this->relatedto = ''; $this->requeststatus = ''; $this->rrule = ''; $this->sequence = ''; $this->status = ''; $this->summary = ''; $this->url = ''; $this->xprop = ''; if( defined( 'ICAL_LANG' ) && !isset( $config['language'] )) $config['language'] = ICAL_LANG; if( !isset( $config['allowEmpty'] )) $config['allowEmpty'] = TRUE; if( !isset( $config['nl'] )) $config['nl'] = "\r\n"; if( !isset( $config['format'] )) $config['format'] = 'iCal'; if( !isset( $config['delimiter'] )) $config['delimiter'] = DIRECTORY_SEPARATOR; $this->setConfig( $config ); } /** * create formatted output for calendar component VJOURNAL object instance * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.5.1 - 2008-10-12 * @param array $xcaldecl * @return string */ function createComponent( &$xcaldecl ) { $objectname = $this->_createFormat(); $component = $this->componentStart1.$objectname.$this->componentStart2.$this->nl; $component .= $this->createUid(); $component .= $this->createDtstamp(); $component .= $this->createAttach(); $component .= $this->createAttendee(); $component .= $this->createCategories(); $component .= $this->createClass(); $component .= $this->createComment(); $component .= $this->createContact(); $component .= $this->createCreated(); $component .= $this->createDescription(); $component .= $this->createDtstart(); $component .= $this->createExdate(); $component .= $this->createExrule(); $component .= $this->createLastModified(); $component .= $this->createOrganizer(); $component .= $this->createRdate(); $component .= $this->createRequestStatus(); $component .= $this->createRecurrenceid(); $component .= $this->createRelatedTo(); $component .= $this->createRrule(); $component .= $this->createSequence(); $component .= $this->createStatus(); $component .= $this->createSummary(); $component .= $this->createUrl(); $component .= $this->createXprop(); $component .= $this->componentEnd1.$objectname.$this->componentEnd2; if( is_array( $this->xcaldecl ) && ( 0 < count( $this->xcaldecl ))) { foreach( $this->xcaldecl as $localxcaldecl ) $xcaldecl[] = $localxcaldecl; } return $component; } } /*********************************************************************************/ /*********************************************************************************/ /** * class for calendar component VFREEBUSY * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.5.1 - 2008-10-12 */ class vfreebusy extends calendarComponent { var $attendee; var $comment; var $contact; var $dtend; var $dtstart; var $duration; var $freebusy; var $organizer; var $requeststatus; var $url; var $xprop; // component subcomponents container var $components; /** * constructor for calendar component VFREEBUSY object * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.8.2 - 2011-05-01 * @param array $config * @return void */ function vfreebusy( $config = array()) { $this->calendarComponent(); $this->attendee = ''; $this->comment = ''; $this->contact = ''; $this->dtend = ''; $this->dtstart = ''; $this->duration = ''; $this->freebusy = ''; $this->organizer = ''; $this->requeststatus = ''; $this->url = ''; $this->xprop = ''; if( defined( 'ICAL_LANG' ) && !isset( $config['language'] )) $config['language'] = ICAL_LANG; if( !isset( $config['allowEmpty'] )) $config['allowEmpty'] = TRUE; if( !isset( $config['nl'] )) $config['nl'] = "\r\n"; if( !isset( $config['format'] )) $config['format'] = 'iCal'; if( !isset( $config['delimiter'] )) $config['delimiter'] = DIRECTORY_SEPARATOR; $this->setConfig( $config ); } /** * create formatted output for calendar component VFREEBUSY object instance * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.3.1 - 2007-11-19 * @param array $xcaldecl * @return string */ function createComponent( &$xcaldecl ) { $objectname = $this->_createFormat(); $component = $this->componentStart1.$objectname.$this->componentStart2.$this->nl; $component .= $this->createUid(); $component .= $this->createDtstamp(); $component .= $this->createAttendee(); $component .= $this->createComment(); $component .= $this->createContact(); $component .= $this->createDtstart(); $component .= $this->createDtend(); $component .= $this->createDuration(); $component .= $this->createFreebusy(); $component .= $this->createOrganizer(); $component .= $this->createRequestStatus(); $component .= $this->createUrl(); $component .= $this->createXprop(); $component .= $this->componentEnd1.$objectname.$this->componentEnd2; if( is_array( $this->xcaldecl ) && ( 0 < count( $this->xcaldecl ))) { foreach( $this->xcaldecl as $localxcaldecl ) $xcaldecl[] = $localxcaldecl; } return $component; } } /*********************************************************************************/ /*********************************************************************************/ /** * class for calendar component VALARM * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.5.1 - 2008-10-12 */ class valarm extends calendarComponent { var $action; var $attach; var $attendee; var $description; var $duration; var $repeat; var $summary; var $trigger; var $xprop; /** * constructor for calendar component VALARM object * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.8.2 - 2011-05-01 * @param array $config * @return void */ function valarm( $config = array()) { $this->calendarComponent(); $this->action = ''; $this->attach = ''; $this->attendee = ''; $this->description = ''; $this->duration = ''; $this->repeat = ''; $this->summary = ''; $this->trigger = ''; $this->xprop = ''; if( defined( 'ICAL_LANG' ) && !isset( $config['language'] )) $config['language'] = ICAL_LANG; if( !isset( $config['allowEmpty'] )) $config['allowEmpty'] = TRUE; if( !isset( $config['nl'] )) $config['nl'] = "\r\n"; if( !isset( $config['format'] )) $config['format'] = 'iCal'; if( !isset( $config['delimiter'] )) $config['delimiter'] = DIRECTORY_SEPARATOR; $this->setConfig( $config ); } /** * create formatted output for calendar component VALARM object instance * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.5.1 - 2008-10-22 * @param array $xcaldecl * @return string */ function createComponent( &$xcaldecl ) { $objectname = $this->_createFormat(); $component = $this->componentStart1.$objectname.$this->componentStart2.$this->nl; $component .= $this->createAction(); $component .= $this->createAttach(); $component .= $this->createAttendee(); $component .= $this->createDescription(); $component .= $this->createDuration(); $component .= $this->createRepeat(); $component .= $this->createSummary(); $component .= $this->createTrigger(); $component .= $this->createXprop(); $component .= $this->componentEnd1.$objectname.$this->componentEnd2; if( is_array( $this->xcaldecl ) && ( 0 < count( $this->xcaldecl ))) { foreach( $this->xcaldecl as $localxcaldecl ) $xcaldecl[] = $localxcaldecl; } return $component; } } /********************************************************************************** /*********************************************************************************/ /** * class for calendar component VTIMEZONE * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.5.1 - 2008-10-12 */ class vtimezone extends calendarComponent { var $timezonetype; var $comment; var $dtstart; var $lastmodified; var $rdate; var $rrule; var $tzid; var $tzname; var $tzoffsetfrom; var $tzoffsetto; var $tzurl; var $xprop; // component subcomponents container var $components; /** * constructor for calendar component VTIMEZONE object * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.8.2 - 2011-05-01 * @param mixed $timezonetype optional, default FALSE ( STANDARD / DAYLIGHT ) * @param array $config * @return void */ function vtimezone( $timezonetype=FALSE, $config = array()) { if( is_array( $timezonetype )) { $config = $timezonetype; $timezonetype = FALSE; } if( !$timezonetype ) $this->timezonetype = 'VTIMEZONE'; else $this->timezonetype = strtoupper( $timezonetype ); $this->calendarComponent(); $this->comment = ''; $this->dtstart = ''; $this->lastmodified = ''; $this->rdate = ''; $this->rrule = ''; $this->tzid = ''; $this->tzname = ''; $this->tzoffsetfrom = ''; $this->tzoffsetto = ''; $this->tzurl = ''; $this->xprop = ''; $this->components = array(); if( defined( 'ICAL_LANG' ) && !isset( $config['language'] )) $config['language'] = ICAL_LANG; if( !isset( $config['allowEmpty'] )) $config['allowEmpty'] = TRUE; if( !isset( $config['nl'] )) $config['nl'] = "\r\n"; if( !isset( $config['format'] )) $config['format'] = 'iCal'; if( !isset( $config['delimiter'] )) $config['delimiter'] = DIRECTORY_SEPARATOR; $this->setConfig( $config ); } /** * create formatted output for calendar component VTIMEZONE object instance * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.5.1 - 2008-10-25 * @param array $xcaldecl * @return string */ function createComponent( &$xcaldecl ) { $objectname = $this->_createFormat(); $component = $this->componentStart1.$objectname.$this->componentStart2.$this->nl; $component .= $this->createTzid(); $component .= $this->createLastModified(); $component .= $this->createTzurl(); $component .= $this->createDtstart(); $component .= $this->createTzoffsetfrom(); $component .= $this->createTzoffsetto(); $component .= $this->createComment(); $component .= $this->createRdate(); $component .= $this->createRrule(); $component .= $this->createTzname(); $component .= $this->createXprop(); $component .= $this->createSubComponent(); $component .= $this->componentEnd1.$objectname.$this->componentEnd2; if( is_array( $this->xcaldecl ) && ( 0 < count( $this->xcaldecl ))) { foreach( $this->xcaldecl as $localxcaldecl ) $xcaldecl[] = $localxcaldecl; } return $component; } } /*********************************************************************************/ /*********************************************************************************/ /** * moving all utility (static) functions to a utility class * 20111223 - move iCalUtilityFunctions class to the end of the iCalcreator class file * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.10.1 - 2011-07-16 * */ class iCalUtilityFunctions { // Store the single instance of iCalUtilityFunctions private static $m_pInstance; // Private constructor to limit object instantiation to within the class private function __construct() { $m_pInstance = FALSE; } // Getter method for creating/returning the single instance of this class public static function getInstance() { if (!self::$m_pInstance) self::$m_pInstance = new iCalUtilityFunctions(); return self::$m_pInstance; } /** * check a date(-time) for an opt. timezone and if it is a DATE-TIME or DATE * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.10.30 - 2012-01-16 * @param array $date, date to check * @param int $parno, no of date parts (i.e. year, month.. .) * @return array $params, property parameters */ public static function _chkdatecfg( $theDate, & $parno, & $params ) { if( isset( $params['TZID'] )) $parno = 6; elseif( isset( $params['VALUE'] ) && ( 'DATE' == $params['VALUE'] )) $parno = 3; else { if( isset( $params['VALUE'] ) && ( 'PERIOD' == $params['VALUE'] )) $parno = 7; if( is_array( $theDate )) { if( isset( $theDate['timestamp'] )) $tzid = ( isset( $theDate['tz'] )) ? $theDate['tz'] : null; else $tzid = ( isset( $theDate['tz'] )) ? $theDate['tz'] : ( 7 == count( $theDate )) ? end( $theDate ) : null; if( !empty( $tzid )) { $parno = 7; if( !iCalUtilityFunctions::_isOffset( $tzid )) $params['TZID'] = $tzid; // save only timezone } elseif( !$parno && ( 3 == count( $theDate )) && ( isset( $params['VALUE'] ) && ( 'DATE' == $params['VALUE'] ))) $parno = 3; else $parno = 6; } else { // string $date = trim( $theDate ); if( 'Z' == substr( $date, -1 )) $parno = 7; // UTC DATE-TIME elseif((( 8 == strlen( $date ) && ctype_digit( $date )) || ( 11 >= strlen( $date ))) && ( !isset( $params['VALUE'] ) || !in_array( $params['VALUE'], array( 'DATE-TIME', 'PERIOD' )))) $parno = 3; // DATE $date = iCalUtilityFunctions::_date_time_string( $date, $parno ); unset( $date['unparsedtext'] ); if( !empty( $date['tz'] )) { $parno = 7; if( !iCalUtilityFunctions::_isOffset( $date['tz'] )) $params['TZID'] = $date['tz']; // save only timezone } elseif( empty( $parno )) $parno = 6; } if( isset( $params['TZID'] )) $parno = 6; } } /** * byte oriented line folding fix * * remove any line-endings that include spaces or tabs * and convert all line endings to $nl value (that defaults to \r\n) * takes care of '\r\n', '\r' and '\n' and mixed '\r\n'+'\r', '\r\n'+'\n' * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.12.17 - 2012-07-12 * @param string $text * @param string $nl * @return string */ public static function convEolChar( & $text, $nl ) { $outp = ''; $cix = 0; while( isset( $text[$cix] )) { if( isset( $text[$cix + 2] ) && ( "\r" == $text[$cix] ) && ( "\n" == $text[$cix + 1] ) && (( " " == $text[$cix + 2] ) || ( "\t" == $text[$cix + 2] ))) // 2 pos eolchar + ' ' or '\t' $cix += 2; // skip 3 elseif( isset( $text[$cix + 1] ) && ( "\r" == $text[$cix] ) && ( "\n" == $text[$cix + 1] )) { $outp .= $nl; // 2 pos eolchar $cix += 1; // replace with $nl } elseif( isset( $text[$cix + 1] ) && (( "\r" == $text[$cix] ) || ( "\n" == $text[$cix] )) && (( " " == $text[$cix + 1] ) || ( "\t" == $text[$cix + 1] ))) // 1 pos eolchar + ' ' or '\t' $cix += 1; // skip 2 elseif(( "\r" == $text[$cix] ) || ( "\n" == $text[$cix] )) // 1 pos eolchar $outp .= $nl; // replace with $nl else $outp .= $text[$cix]; // add any other byte $cix += 1; } return $outp; } /** * create timezone and standard/daylight components * * Result when 'Europe/Stockholm' and no from/to arguments is used as timezone: * * BEGIN:VTIMEZONE * TZID:Europe/Stockholm * BEGIN:STANDARD * DTSTART:20101031T020000 * TZOFFSETFROM:+0200 * TZOFFSETTO:+0100 * TZNAME:CET * END:STANDARD * BEGIN:DAYLIGHT * DTSTART:20100328T030000 * TZOFFSETFROM:+0100 * TZOFFSETTO:+0200 * TZNAME:CEST * END:DAYLIGHT * END:VTIMEZONE * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.13.2 - 2012-07-28 * Generates components for all transitions in a date range, based on contribution by Yitzchok Lavi * Additional changes jpirkey * @param object $calendar, reference to an iCalcreator calendar instance * @param string $timezone, a PHP5 (DateTimeZone) valid timezone * @param array $xProp, *[x-propName => x-propValue], optional * @param int $from an unix timestamp * @param int $to an unix timestamp * @return bool */ public static function createTimezone( & $calendar, $timezone, $xProp=array(), $from=null, $to=null ) { if( substr( phpversion(), 0, 3 ) < '5.2' ) return FALSE; if( empty( $timezone )) return FALSE; try { $dtz = new DateTimeZone( $timezone ); $transitions = $dtz->getTransitions(); unset( $dtz ); $utcTz = new DateTimeZone( 'UTC' ); } catch( Exception $e ) { return FALSE; } if( empty( $to )) $dates = array_keys( $calendar->getProperty( 'dtstart' )); $transCnt = 2; // number of transitions in output if empty input $from/$to and an empty dates-array $dateFrom = new DateTime( 'now' ); $dateTo = new DateTime( 'now' ); if( !empty( $from )) $dateFrom->setTimestamp( $from ); else { if( !empty( $dates )) $dateFrom = new DateTime( reset( $dates )); // set lowest date to the lowest dtstart date $dateFrom->modify( '-1 month' ); // set $dateFrom to one month before the lowest date } $dateFrom->setTimezone( $utcTz ); // convert local date to UTC if( !empty( $to )) $dateTo->setTimestamp( $to ); else { if( !empty( $dates )) { $dateTo = new DateTime( end( $dates )); // set highest date to the highest dtstart date $to = $dateTo->getTimestamp(); // set mark that a highest date is found } $dateTo->modify( '+1 year' ); // set $dateTo to one year after the highest date } $dateTo->setTimezone( $utcTz ); // convert local date to UTC $transTemp = array(); $prevOffsetfrom = $stdCnt = $dlghtCnt = 0; $stdIx = $dlghtIx = null; $date = new DateTime( 'now', $utcTz ); $prevTrans = FALSE; foreach( $transitions as $tix => $trans ) { // all transitions in date-time order!! $date->setTimestamp( $trans['ts'] ); // set transition date (UTC) if ( $date < $dateFrom ) { $prevOffsetfrom = $trans['offset']; // previous trans offset will be 'next' trans offsetFrom $prevTrans = $trans; // save it in case we don't find any that match $prevTrans['offsetfrom'] = ( 0 < $tix ) ? $transitions[$tix-1]['offset'] : 0; continue; } if( $date > $dateTo ) break; // loop always (?) breaks here if( !empty( $prevOffsetfrom ) || ( 0 == $prevOffsetfrom )) { $trans['offsetfrom'] = $prevOffsetfrom; // i.e. set previous offsetto as offsetFrom $date->modify( $trans['offsetfrom'].'seconds' ); // convert utc date to local date $trans['time'] = array( 'year' => $date->format( 'Y' ) // set dtstart to array to ease up dtstart and (opt) rdate setting , 'month' => $date->format( 'n' ) , 'day' => $date->format( 'j' ) , 'hour' => $date->format( 'G' ) , 'min' => $date->format( 'i' ) , 'sec' => $date->format( 's' )); } $prevOffsetfrom = $trans['offset']; $trans['prevYear'] = $trans['time']['year']; if( TRUE !== $trans['isdst'] ) { // standard timezone if( !empty( $stdIx ) && isset( $transTemp[$stdIx]['offsetfrom'] ) && // check for any rdate's (in strict year order) ( $transTemp[$stdIx]['abbr'] == $trans['abbr'] ) && ( $transTemp[$stdIx]['offsetfrom'] == $trans['offsetfrom'] ) && ( $transTemp[$stdIx]['offset'] == $trans['offset'] ) && (($transTemp[$stdIx]['prevYear'] + 1) == $trans['time']['year'] )) { $transTemp[$stdIx]['prevYear'] = $trans['time']['year']; $transTemp[$stdIx]['rdate'][] = $trans['time']; continue; } $stdIx = $tix; $stdCnt += 1; } // end standard timezone else { // daylight timezone if( !empty( $dlghtIx ) && isset( $transTemp[$dlghtIx]['offsetfrom'] ) && // check for any rdate's (in strict year order) ( $transTemp[$dlghtIx]['abbr'] == $trans['abbr'] ) && ( $transTemp[$dlghtIx]['offsetfrom'] == $trans['offsetfrom'] ) && ( $transTemp[$dlghtIx]['offset'] == $trans['offset'] ) && (($transTemp[$dlghtIx]['prevYear'] + 1) == $trans['time']['year'] )) { $transTemp[$dlghtIx]['prevYear'] = $trans['time']['year']; $transTemp[$dlghtIx]['rdate'][] = $trans['time']; continue; } $dlghtIx = $tix; $dlghtCnt += 1; } // end daylight timezone if( empty( $to ) && ( $transCnt == count( $transTemp ))) { // store only $transCnt transitions if( TRUE !== $transTemp[0]['isdst'] ) $stdCnt -= 1; else $dlghtCnt -= 1; array_shift( $transTemp ); } // end if( empty( $to ) && ( $transCnt == count( $transTemp ))) $transTemp[$tix] = $trans; } // end foreach( $transitions as $tix => $trans ) $tz = & $calendar->newComponent( 'vtimezone' ); $tz->setproperty( 'tzid', $timezone ); if( !empty( $xProp )) { foreach( $xProp as $xPropName => $xPropValue ) if( 'x-' == strtolower( substr( $xPropName, 0, 2 ))) $tz->setproperty( $xPropName, $xPropValue ); } if( empty( $transTemp )) { // if no match found if( $prevTrans ) { // then we use the last transition (before startdate) for the tz info $date->setTimestamp( $prevTrans['ts'] ); // set transition date (UTC) $date->modify( $prevTrans['offsetfrom'].'seconds' ); // convert utc date to local date $prevTrans['time'] = array( 'year' => $date->format( 'Y' ) // set dtstart to array to ease up dtstart setting , 'month' => $date->format( 'n' ) , 'day' => $date->format( 'j' ) , 'hour' => $date->format( 'G' ) , 'min' => $date->format( 'i' ) , 'sec' => $date->format( 's' )); $transTemp[0] = $prevTrans; } else { // or we use the timezone identifier to BUILD the standard tz info (?) $date = new DateTime( $timezone ); $transTemp[0] = array( 'time' => $date->format( 'Y-m-d\TH:i:sO' ) , 'offset' => $date->format( 'Z' ) , 'offsetfrom' => $date->format( 'Z' ) , 'isdst' => false ); } } unset( $transitions, $date, $prevTrans ); foreach( $transTemp as $trans ) { $type = ( TRUE !== $trans['isdst'] ) ? 'standard' : 'daylight'; $scomp = & $tz->newComponent( $type ); $scomp->setProperty( 'dtstart', $trans['time'] ); // $scomp->setProperty( 'x-utc-timestamp', $trans['ts'] ); // test ### if( !empty( $trans['abbr'] )) $scomp->setProperty( 'tzname', $trans['abbr'] ); if( isset( $trans['offsetfrom'] )) $scomp->setProperty( 'tzoffsetfrom', iCalUtilityFunctions::offsetSec2His( $trans['offsetfrom'] )); $scomp->setProperty( 'tzoffsetto', iCalUtilityFunctions::offsetSec2His( $trans['offset'] )); if( isset( $trans['rdate'] )) $scomp->setProperty( 'RDATE', $trans['rdate'] ); } return TRUE; } /** * convert a date/datetime (array) to timestamp * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.8 - 2008-10-30 * @param array $datetime datetime/(date) * @param string $tz timezone * @return timestamp */ public static function _date2timestamp( $datetime, $tz=null ) { $output = null; if( !isset( $datetime['hour'] )) $datetime['hour'] = '0'; if( !isset( $datetime['min'] )) $datetime['min'] = '0'; if( !isset( $datetime['sec'] )) $datetime['sec'] = '0'; foreach( $datetime as $dkey => $dvalue ) { if( 'tz' != $dkey ) $datetime[$dkey] = (integer) $dvalue; } if( $tz ) $datetime['tz'] = $tz; $offset = ( isset( $datetime['tz'] ) && ( '' < trim ( $datetime['tz'] ))) ? iCalUtilityFunctions::_tz2offset( $datetime['tz'] ) : 0; $output = mktime( $datetime['hour'], $datetime['min'], ($datetime['sec'] + $offset), $datetime['month'], $datetime['day'], $datetime['year'] ); return $output; } /** * ensures internal date-time/date format for input date-time/date in array format * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.11.4 - 2012-03-18 * @param array $datetime * @param int $parno optional, default FALSE * @return array */ public static function _date_time_array( $datetime, $parno=FALSE ) { $output = array(); foreach( $datetime as $dateKey => $datePart ) { switch ( $dateKey ) { case '0': case 'year': $output['year'] = $datePart; break; case '1': case 'month': $output['month'] = $datePart; break; case '2': case 'day': $output['day'] = $datePart; break; } if( 3 != $parno ) { switch ( $dateKey ) { case '0': case '1': case '2': break; case '3': case 'hour': $output['hour'] = $datePart; break; case '4': case 'min' : $output['min'] = $datePart; break; case '5': case 'sec' : $output['sec'] = $datePart; break; case '6': case 'tz' : $output['tz'] = $datePart; break; } } } if( 3 != $parno ) { if( !isset( $output['hour'] )) $output['hour'] = 0; if( !isset( $output['min'] )) $output['min'] = 0; if( !isset( $output['sec'] )) $output['sec'] = 0; if( isset( $output['tz'] ) && ( 'Z' != $output['tz'] ) && (( '+0000' == $output['tz'] ) || ( '-0000' == $output['tz'] ) || ( '+000000' == $output['tz'] ) || ( '-000000' == $output['tz'] ))) $output['tz'] = 'Z'; } return $output; } /** * ensures internal date-time/date format for input date-time/date in string fromat * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.10.30 - 2012-01-06 * Modified to also return original string value by Yitzchok Lavi * @param array $datetime * @param int $parno optional, default FALSE * @return array */ public static function _date_time_string( $datetime, $parno=FALSE ) { // save original input string to return it later $unparseddatetime = $datetime; $datetime = (string) trim( $datetime ); $tz = null; $len = strlen( $datetime ) - 1; if( 'Z' == substr( $datetime, -1 )) { $tz = 'Z'; $datetime = trim( substr( $datetime, 0, $len )); } elseif( ( ctype_digit( substr( $datetime, -2, 2 ))) && // time or date ( '-' == substr( $datetime, -3, 1 )) || ( ':' == substr( $datetime, -3, 1 )) || ( '.' == substr( $datetime, -3, 1 ))) { $continue = TRUE; } elseif( ( ctype_digit( substr( $datetime, -4, 4 ))) && // 4 pos offset ( ' +' == substr( $datetime, -6, 2 )) || ( ' -' == substr( $datetime, -6, 2 ))) { $tz = substr( $datetime, -5, 5 ); $datetime = substr( $datetime, 0, ($len - 5)); } elseif( ( ctype_digit( substr( $datetime, -6, 6 ))) && // 6 pos offset ( ' +' == substr( $datetime, -8, 2 )) || ( ' -' == substr( $datetime, -8, 2 ))) { $tz = substr( $datetime, -7, 7 ); $datetime = substr( $datetime, 0, ($len - 7)); } elseif( ( 6 < $len ) && ( ctype_digit( substr( $datetime, -6, 6 )))) { $continue = TRUE; } elseif( 'T' == substr( $datetime, -7, 1 )) { $continue = TRUE; } else { $cx = $tx = 0; // 19970415T133000 US-Eastern for( $cx = -1; $cx > ( 9 - $len ); $cx-- ) { $char = substr( $datetime, $cx, 1 ); if(( ' ' == $char) || ctype_digit( $char)) break; // if exists, tz ends here.. . ? else $tx--; // tz length counter } if( 0 > $tx ) { $tz = substr( $datetime, $tx ); $datetime = trim( substr( $datetime, 0, $len + $tx + 1 )); } } if( 0 < substr_count( $datetime, '-' )) { $datetime = str_replace( '-', '/', $datetime ); } elseif( ctype_digit( substr( $datetime, 0, 8 )) && ( 'T' == substr( $datetime, 8, 1 )) && ctype_digit( substr( $datetime, 9, 6 ))) { } $datestring = date( 'Y-m-d H:i:s', strtotime( $datetime )); $tz = trim( $tz ); $output = array(); $output['year'] = substr( $datestring, 0, 4 ); $output['month'] = substr( $datestring, 5, 2 ); $output['day'] = substr( $datestring, 8, 2 ); if(( 6 == $parno ) || ( 7 == $parno ) || ( !$parno && ( 'Z' == $tz ))) { $output['hour'] = substr( $datestring, 11, 2 ); $output['min'] = substr( $datestring, 14, 2 ); $output['sec'] = substr( $datestring, 17, 2 ); if( !empty( $tz )) $output['tz'] = $tz; } elseif( 3 != $parno ) { if(( '00' < substr( $datestring, 11, 2 )) || ( '00' < substr( $datestring, 14, 2 )) || ( '00' < substr( $datestring, 17, 2 ))) { $output['hour'] = substr( $datestring, 11, 2 ); $output['min'] = substr( $datestring, 14, 2 ); $output['sec'] = substr( $datestring, 17, 2 ); } if( !empty( $tz )) $output['tz'] = $tz; } // return original string in the array in case strtotime failed to make sense of it $output['unparsedtext'] = $unparseddatetime; return $output; } /** * convert local startdate/enddate (Ymd[His]) to duration array * * uses this component dates if missing input dates * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.6.11 - 2010-10-21 * @param array $startdate * @param array $duration * @return array duration */ public static function _date2duration( $startdate, $enddate ) { $startWdate = mktime( 0, 0, 0, $startdate['month'], $startdate['day'], $startdate['year'] ); $endWdate = mktime( 0, 0, 0, $enddate['month'], $enddate['day'], $enddate['year'] ); $wduration = $endWdate - $startWdate; $dur = array(); $dur['week'] = (int) floor( $wduration / ( 7 * 24 * 60 * 60 )); $wduration = $wduration % ( 7 * 24 * 60 * 60 ); $dur['day'] = (int) floor( $wduration / ( 24 * 60 * 60 )); $wduration = $wduration % ( 24 * 60 * 60 ); $dur['hour'] = (int) floor( $wduration / ( 60 * 60 )); $wduration = $wduration % ( 60 * 60 ); $dur['min'] = (int) floor( $wduration / ( 60 )); $dur['sec'] = (int) $wduration % ( 60 ); return $dur; } /** * ensures internal duration format for input in array format * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.1.1 - 2007-06-24 * @param array $duration * @return array */ public static function _duration_array( $duration ) { $output = array(); if( is_array( $duration ) && ( 1 == count( $duration )) && isset( $duration['sec'] ) && ( 60 < $duration['sec'] )) { $durseconds = $duration['sec']; $output['week'] = floor( $durseconds / ( 60 * 60 * 24 * 7 )); $durseconds = $durseconds % ( 60 * 60 * 24 * 7 ); $output['day'] = floor( $durseconds / ( 60 * 60 * 24 )); $durseconds = $durseconds % ( 60 * 60 * 24 ); $output['hour'] = floor( $durseconds / ( 60 * 60 )); $durseconds = $durseconds % ( 60 * 60 ); $output['min'] = floor( $durseconds / ( 60 )); $output['sec'] = ( $durseconds % ( 60 )); } else { foreach( $duration as $durKey => $durValue ) { if( empty( $durValue )) continue; switch ( $durKey ) { case '0': case 'week': $output['week'] = $durValue; break; case '1': case 'day': $output['day'] = $durValue; break; case '2': case 'hour': $output['hour'] = $durValue; break; case '3': case 'min': $output['min'] = $durValue; break; case '4': case 'sec': $output['sec'] = $durValue; break; } } } if( isset( $output['week'] ) && ( 0 < $output['week'] )) { unset( $output['day'], $output['hour'], $output['min'], $output['sec'] ); return $output; } unset( $output['week'] ); if( empty( $output['day'] )) unset( $output['day'] ); if ( isset( $output['hour'] ) || isset( $output['min'] ) || isset( $output['sec'] )) { if( !isset( $output['hour'] )) $output['hour'] = 0; if( !isset( $output['min'] )) $output['min'] = 0; if( !isset( $output['sec'] )) $output['sec'] = 0; if(( 0 == $output['hour'] ) && ( 0 == $output['min'] ) && ( 0 == $output['sec'] )) unset( $output['hour'], $output['min'], $output['sec'] ); } return $output; } /** * ensures internal duration format for input in string format * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.0.5 - 2007-03-14 * @param string $duration * @return array */ public static function _duration_string( $duration ) { $duration = (string) trim( $duration ); while( 'P' != strtoupper( substr( $duration, 0, 1 ))) { if( 0 < strlen( $duration )) $duration = substr( $duration, 1 ); else return false; // no leading P !?!? } $duration = substr( $duration, 1 ); // skip P $duration = str_replace ( 't', 'T', $duration ); $duration = str_replace ( 'T', '', $duration ); $output = array(); $val = null; for( $ix=0; $ix < strlen( $duration ); $ix++ ) { switch( strtoupper( substr( $duration, $ix, 1 ))) { case 'W': $output['week'] = $val; $val = null; break; case 'D': $output['day'] = $val; $val = null; break; case 'H': $output['hour'] = $val; $val = null; break; case 'M': $output['min'] = $val; $val = null; break; case 'S': $output['sec'] = $val; $val = null; break; default: if( !ctype_digit( substr( $duration, $ix, 1 ))) return false; // unknown duration control character !?!? else $val .= substr( $duration, $ix, 1 ); } } return iCalUtilityFunctions::_duration_array( $output ); } /** * convert duration to date in array format * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.8.7 - 2011-03-03 * @param array $startdate * @param array $duration * @return array, date format */ public static function _duration2date( $startdate=null, $duration=null ) { if( empty( $startdate )) return FALSE; if( empty( $duration )) return FALSE; $dateOnly = ( isset( $startdate['hour'] ) || isset( $startdate['min'] ) || isset( $startdate['sec'] )) ? FALSE : TRUE; $startdate['hour'] = ( isset( $startdate['hour'] )) ? $startdate['hour'] : 0; $startdate['min'] = ( isset( $startdate['min'] )) ? $startdate['min'] : 0; $startdate['sec'] = ( isset( $startdate['sec'] )) ? $startdate['sec'] : 0; $dtend = 0; if( isset( $duration['week'] )) $dtend += ( $duration['week'] * 7 * 24 * 60 * 60 ); if( isset( $duration['day'] )) $dtend += ( $duration['day'] * 24 * 60 * 60 ); if( isset( $duration['hour'] )) $dtend += ( $duration['hour'] * 60 *60 ); if( isset( $duration['min'] )) $dtend += ( $duration['min'] * 60 ); if( isset( $duration['sec'] )) $dtend += $duration['sec']; $dtend = mktime( $startdate['hour'], $startdate['min'], ( $startdate['sec'] + $dtend ), $startdate['month'], $startdate['day'], $startdate['year'] ); $dtend2 = array(); $dtend2['year'] = date('Y', $dtend ); $dtend2['month'] = date('m', $dtend ); $dtend2['day'] = date('d', $dtend ); $dtend2['hour'] = date('H', $dtend ); $dtend2['min'] = date('i', $dtend ); $dtend2['sec'] = date('s', $dtend ); if( isset( $startdate['tz'] )) $dtend2['tz'] = $startdate['tz']; if( $dateOnly && (( 0 == $dtend2['hour'] ) && ( 0 == $dtend2['min'] ) && ( 0 == $dtend2['sec'] ))) unset( $dtend2['hour'], $dtend2['min'], $dtend2['sec'] ); return $dtend2; } /** * if not preSet, if exist, remove key with expected value from array and return hit value else return elseValue * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.16 - 2008-11-08 * @param array $array * @param string $expkey, expected key * @param string $expval, expected value * @param int $hitVal optional, return value if found * @param int $elseVal optional, return value if not found * @param int $preSet optional, return value if already preset * @return int */ public static function _existRem( &$array, $expkey, $expval=FALSE, $hitVal=null, $elseVal=null, $preSet=null ) { if( $preSet ) return $preSet; if( !is_array( $array ) || ( 0 == count( $array ))) return $elseVal; foreach( $array as $key => $value ) { if( strtoupper( $expkey ) == strtoupper( $key )) { if( !$expval || ( strtoupper( $expval ) == strtoupper( $array[$key] ))) { unset( $array[$key] ); return $hitVal; } } } return $elseVal; } /** * creates formatted output for calendar component property data value type date/date-time * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.11.8 - 2012-03-17 * @param array $datetime * @param int $parno, optional, default 6 * @return string */ public static function _format_date_time( $datetime, $parno=6 ) { if( !isset( $datetime['year'] ) && !isset( $datetime['month'] ) && !isset( $datetime['day'] ) && !isset( $datetime['hour'] ) && !isset( $datetime['min'] ) && !isset( $datetime['sec'] )) return ; $output = null; foreach( $datetime as $dkey => & $dvalue ) if( 'tz' != $dkey ) $dvalue = (integer) $dvalue; $output = sprintf( '%04d%02d%02d', $datetime['year'], $datetime['month'], $datetime['day'] ); if( isset( $datetime['hour'] ) || isset( $datetime['min'] ) || isset( $datetime['sec'] ) || isset( $datetime['tz'] )) { if( isset( $datetime['tz'] ) && !isset( $datetime['hour'] )) $datetime['hour'] = 0; if( isset( $datetime['hour'] ) && !isset( $datetime['min'] )) $datetime['min'] = 0; if( isset( $datetime['hour'] ) && isset( $datetime['min'] ) && !isset( $datetime['sec'] )) $datetime['sec'] = 0; $output .= sprintf( 'T%02d%02d%02d', $datetime['hour'], $datetime['min'], $datetime['sec'] ); if( isset( $datetime['tz'] ) && ( '' < trim( $datetime['tz'] ))) { $datetime['tz'] = trim( $datetime['tz'] ); if( 'Z' == $datetime['tz'] ) $output .= 'Z'; $offset = iCalUtilityFunctions::_tz2offset( $datetime['tz'] ); if( 0 != $offset ) { $date = mktime( $datetime['hour'], $datetime['min'], ($datetime['sec'] - $offset), $datetime['month'], $datetime['day'], $datetime['year']); $output = date( 'Ymd\THis\Z', $date ); } } elseif( 7 == $parno ) $output .= 'Z'; } return $output; } /** * creates formatted output for calendar component property data value type duration * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.9.9 - 2011-06-17 * @param array $duration ( week, day, hour, min, sec ) * @return string */ public static function _format_duration( $duration ) { if( isset( $duration['week'] ) || isset( $duration['day'] ) || isset( $duration['hour'] ) || isset( $duration['min'] ) || isset( $duration['sec'] )) $ok = TRUE; else return; if( isset( $duration['week'] ) && ( 0 < $duration['week'] )) return 'P'.$duration['week'].'W'; $output = 'P'; if( isset($duration['day'] ) && ( 0 < $duration['day'] )) $output .= $duration['day'].'D'; if(( isset( $duration['hour']) && ( 0 < $duration['hour'] )) || ( isset( $duration['min']) && ( 0 < $duration['min'] )) || ( isset( $duration['sec']) && ( 0 < $duration['sec'] ))) $output .= 'T'; $output .= ( isset( $duration['hour']) && ( 0 < $duration['hour'] )) ? $duration['hour'].'H' : ''; $output .= ( isset( $duration['min']) && ( 0 < $duration['min'] )) ? $duration['min']. 'M' : ''; $output .= ( isset( $duration['sec']) && ( 0 < $duration['sec'] )) ? $duration['sec']. 'S' : ''; if( 'P' == $output ) $output = 'PT0S'; return $output; } /** * checks if input array contains a date * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.11.8 - 2012-01-20 * @param array $input * @return bool */ public static function _isArrayDate( $input ) { if( !is_array( $input )) return FALSE; if( isset( $input['week'] ) || ( !in_array( count( $input ), array( 3, 6, 7 )))) return FALSE; if( 7 == count( $input )) return TRUE; if( isset( $input['year'] ) && isset( $input['month'] ) && isset( $input['day'] )) return checkdate( (int) $input['month'], (int) $input['day'], (int) $input['year'] ); if( isset( $input['day'] ) || isset( $input['hour'] ) || isset( $input['min'] ) || isset( $input['sec'] )) return FALSE; if( in_array( 0, $input )) return FALSE; if(( 1970 > $input[0] ) || ( 12 < $input[1] ) || ( 31 < $input[2] )) return FALSE; if(( isset( $input[0] ) && isset( $input[1] ) && isset( $input[2] )) && checkdate( (int) $input[1], (int) $input[2], (int) $input[0] )) return TRUE; $input = iCalUtilityFunctions::_date_time_string( $input[1].'/'.$input[2].'/'.$input[0], 3 ); // m - d - Y if( isset( $input['year'] ) && isset( $input['month'] ) && isset( $input['day'] )) return checkdate( (int) $input['month'], (int) $input['day'], (int) $input['year'] ); return FALSE; } /** * checks if input array contains a timestamp date * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.16 - 2008-10-18 * @param array $input * @return bool */ public static function _isArrayTimestampDate( $input ) { return ( is_array( $input ) && isset( $input['timestamp'] )) ? TRUE : FALSE ; } /** * controll if input string contains trailing UTC offset * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.16 - 2008-10-19 * @param string $input * @return bool */ public static function _isOffset( $input ) { $input = trim( (string) $input ); if( 'Z' == substr( $input, -1 )) return TRUE; elseif(( 5 <= strlen( $input )) && ( in_array( substr( $input, -5, 1 ), array( '+', '-' ))) && ( '0000' < substr( $input, -4 )) && ( '9999' >= substr( $input, -4 ))) return TRUE; elseif(( 7 <= strlen( $input )) && ( in_array( substr( $input, -7, 1 ), array( '+', '-' ))) && ( '000000' < substr( $input, -6 )) && ( '999999' >= substr( $input, -6 ))) return TRUE; return FALSE; } /** * (very simple) conversion of a MS timezone to a PHP5 valid (Date-)timezone * matching (MS) UCT offset and time zone descriptors * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.12.1 - 2012-04-06 * @param string $timezone, input/output variable reference * @return bool */ public static function ms2phpTZ( & $timezone ) { if( substr( phpversion(), 0, 3 ) < '5.2' ) return FALSE; if( empty( $timezone )) return FALSE; $search = str_replace( '"', '', $timezone ); $search = str_replace( array('GMT', 'gmt', 'utc' ), 'UTC', $search ); if( '(UTC' != substr( $search, 0, 4 )) return FALSE; if( FALSE === ( $pos = strpos( $search, ')' ))) return FALSE; $pos = strpos( $search, ')' ); $searchOffset = substr( $search, 4, ( $pos - 4 )); $searchOffset = iCalUtilityFunctions::_tz2offset( str_replace( ':', '', $searchOffset )); while( ' ' ==substr( $search, ( $pos + 1 ))) $pos += 1; $searchText = trim( str_replace( array( '(', ')', '&', ',', ' ' ), ' ', substr( $search, ( $pos + 1 )) )); $searchWords = explode( ' ', $searchText ); $timezone_abbreviations = DateTimeZone::listAbbreviations(); $hits = array(); foreach( $timezone_abbreviations as $name => $transitions ) { foreach( $transitions as $cnt => $transition ) { if( empty( $transition['offset'] ) || empty( $transition['timezone_id'] ) || ( $transition['offset'] != $searchOffset )) continue; $cWords = explode( '/', $transition['timezone_id'] ); $cPrio = $hitCnt = $rank = 0; foreach( $cWords as $cWord ) { if( empty( $cWord )) continue; $cPrio += 1; $sPrio = 0; foreach( $searchWords as $sWord ) { if( empty( $sWord ) || ( 'time' == strtolower( $sWord ))) continue; $sPrio += 1; if( strtolower( $cWord ) == strtolower( $sWord )) { $hitCnt += 1; $rank += ( $cPrio + $sPrio ); } else $rank += 10; } } if( 0 < $hitCnt ) { $hits[$rank][] = $transition['timezone_id']; } } } unset( $timezone_abbreviations ); if( empty( $hits )) return FALSE; ksort( $hits ); foreach( $hits as $rank => $tzs ) { if( !empty( $tzs )) { $timezone = reset( $tzs ); return TRUE; } } return FALSE; } /** * transform offset in seconds to [-/+]hhmm[ss] * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2011-05-02 * @param string $seconds * @return string */ public static function offsetSec2His( $seconds ) { if( '-' == substr( $seconds, 0, 1 )) { $prefix = '-'; $seconds = substr( $seconds, 1 ); } elseif( '+' == substr( $seconds, 0, 1 )) { $prefix = '+'; $seconds = substr( $seconds, 1 ); } else $prefix = '+'; $output = ''; $hour = (int) floor( $seconds / 3600 ); if( 10 > $hour ) $hour = '0'.$hour; $seconds = $seconds % 3600; $min = (int) floor( $seconds / 60 ); if( 10 > $min ) $min = '0'.$min; $output = $hour.$min; $seconds = $seconds % 60; if( 0 < $seconds) { if( 9 < $seconds) $output .= $seconds; else $output .= '0'.$seconds; } return $prefix.$output; } /** * remakes a recur pattern to an array of dates * * if missing, UNTIL is set 1 year from startdate (emergency break) * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.10.19 - 2011-10-31 * @param array $result, array to update, array([timestamp] => timestamp) * @param array $recur, pattern for recurrency (only value part, params ignored) * @param array $wdate, component start date * @param array $startdate, start date * @param array $enddate, optional * @return array of recurrence (start-)dates as index * @todo BYHOUR, BYMINUTE, BYSECOND, WEEKLY at year end/start */ public static function _recur2date( & $result, $recur, $wdate, $startdate, $enddate=FALSE ) { foreach( $wdate as $k => $v ) if( ctype_digit( $v )) $wdate[$k] = (int) $v; $wdateStart = $wdate; $wdatets = iCalUtilityFunctions::_date2timestamp( $wdate ); $startdatets = iCalUtilityFunctions::_date2timestamp( $startdate ); if( !$enddate ) { $enddate = $startdate; $enddate['year'] += 1; } // echo "recur __in_ comp start ".implode('-',$wdate)." period start ".implode('-',$startdate)." period end ".implode('-',$enddate)."
    \n";print_r($recur);echo "
    \n";//test### $endDatets = iCalUtilityFunctions::_date2timestamp( $enddate ); // fix break if( !isset( $recur['COUNT'] ) && !isset( $recur['UNTIL'] )) $recur['UNTIL'] = $enddate; // create break if( isset( $recur['UNTIL'] )) { $tdatets = iCalUtilityFunctions::_date2timestamp( $recur['UNTIL'] ); if( $endDatets > $tdatets ) { $endDatets = $tdatets; // emergency break $enddate = iCalUtilityFunctions::_timestamp2date( $endDatets, 6 ); } else $recur['UNTIL'] = iCalUtilityFunctions::_timestamp2date( $endDatets, 6 ); } if( $wdatets > $endDatets ) { // echo "recur out of date ".date('Y-m-d H:i:s',$wdatets)."
    \n";//test return array(); // nothing to do.. . } if( !isset( $recur['FREQ'] )) // "MUST be specified.. ." $recur['FREQ'] = 'DAILY'; // ?? $wkst = ( isset( $recur['WKST'] ) && ( 'SU' == $recur['WKST'] )) ? 24*60*60 : 0; // ?? $weekStart = (int) date( 'W', ( $wdatets + $wkst )); if( !isset( $recur['INTERVAL'] )) $recur['INTERVAL'] = 1; $countcnt = ( !isset( $recur['BYSETPOS'] )) ? 1 : 0; // DTSTART counts as the first occurrence /* find out how to step up dates and set index for interval count */ $step = array(); if( 'YEARLY' == $recur['FREQ'] ) $step['year'] = 1; elseif( 'MONTHLY' == $recur['FREQ'] ) $step['month'] = 1; elseif( 'WEEKLY' == $recur['FREQ'] ) $step['day'] = 7; else $step['day'] = 1; if( isset( $step['year'] ) && isset( $recur['BYMONTH'] )) $step = array( 'month' => 1 ); if( empty( $step ) && isset( $recur['BYWEEKNO'] )) // ?? $step = array( 'day' => 7 ); if( isset( $recur['BYYEARDAY'] ) || isset( $recur['BYMONTHDAY'] ) || isset( $recur['BYDAY'] )) $step = array( 'day' => 1 ); $intervalarr = array(); if( 1 < $recur['INTERVAL'] ) { $intervalix = iCalUtilityFunctions::_recurIntervalIx( $recur['FREQ'], $wdate, $wkst ); $intervalarr = array( $intervalix => 0 ); } if( isset( $recur['BYSETPOS'] )) { // save start date + weekno $bysetposymd1 = $bysetposymd2 = $bysetposw1 = $bysetposw2 = array(); // echo "bysetposXold_start=$bysetposYold $bysetposMold $bysetposDold
    \n"; // test ### if( is_array( $recur['BYSETPOS'] )) { foreach( $recur['BYSETPOS'] as $bix => $bval ) $recur['BYSETPOS'][$bix] = (int) $bval; } else $recur['BYSETPOS'] = array( (int) $recur['BYSETPOS'] ); if( 'YEARLY' == $recur['FREQ'] ) { $wdate['month'] = $wdate['day'] = 1; // start from beginning of year $wdatets = iCalUtilityFunctions::_date2timestamp( $wdate ); iCalUtilityFunctions::_stepdate( $enddate, $endDatets, array( 'year' => 1 )); // make sure to count whole last year } elseif( 'MONTHLY' == $recur['FREQ'] ) { $wdate['day'] = 1; // start from beginning of month $wdatets = iCalUtilityFunctions::_date2timestamp( $wdate ); iCalUtilityFunctions::_stepdate( $enddate, $endDatets, array( 'month' => 1 )); // make sure to count whole last month } else iCalUtilityFunctions::_stepdate( $enddate, $endDatets, $step); // make sure to count whole last period // echo "BYSETPOS endDat++ =".implode('-',$enddate).' step='.var_export($step,TRUE)."
    \n";//test### $bysetposWold = (int) date( 'W', ( $wdatets + $wkst )); $bysetposYold = $wdate['year']; $bysetposMold = $wdate['month']; $bysetposDold = $wdate['day']; } else iCalUtilityFunctions::_stepdate( $wdate, $wdatets, $step); $year_old = null; $daynames = array( 'SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA' ); /* MAIN LOOP */ // echo "recur start ".implode('-',$wdate)." end ".implode('-',$enddate)."
    \n";//test while( TRUE ) { if( isset( $endDatets ) && ( $wdatets > $endDatets )) break; if( isset( $recur['COUNT'] ) && ( $countcnt >= $recur['COUNT'] )) break; if( $year_old != $wdate['year'] ) { $year_old = $wdate['year']; $daycnts = array(); $yeardays = $weekno = 0; $yeardaycnt = array(); foreach( $daynames as $dn ) $yeardaycnt[$dn] = 0; for( $m = 1; $m <= 12; $m++ ) { // count up and update up-counters $daycnts[$m] = array(); $weekdaycnt = array(); foreach( $daynames as $dn ) $weekdaycnt[$dn] = 0; $mcnt = date( 't', mktime( 0, 0, 0, $m, 1, $wdate['year'] )); for( $d = 1; $d <= $mcnt; $d++ ) { $daycnts[$m][$d] = array(); if( isset( $recur['BYYEARDAY'] )) { $yeardays++; $daycnts[$m][$d]['yearcnt_up'] = $yeardays; } if( isset( $recur['BYDAY'] )) { $day = date( 'w', mktime( 0, 0, 0, $m, $d, $wdate['year'] )); $day = $daynames[$day]; $daycnts[$m][$d]['DAY'] = $day; $weekdaycnt[$day]++; $daycnts[$m][$d]['monthdayno_up'] = $weekdaycnt[$day]; $yeardaycnt[$day]++; $daycnts[$m][$d]['yeardayno_up'] = $yeardaycnt[$day]; } if( isset( $recur['BYWEEKNO'] ) || ( $recur['FREQ'] == 'WEEKLY' )) $daycnts[$m][$d]['weekno_up'] =(int)date('W',mktime(0,0,$wkst,$m,$d,$wdate['year'])); } } $daycnt = 0; $yeardaycnt = array(); if( isset( $recur['BYWEEKNO'] ) || ( $recur['FREQ'] == 'WEEKLY' )) { $weekno = null; for( $d=31; $d > 25; $d-- ) { // get last weekno for year if( !$weekno ) $weekno = $daycnts[12][$d]['weekno_up']; elseif( $weekno < $daycnts[12][$d]['weekno_up'] ) { $weekno = $daycnts[12][$d]['weekno_up']; break; } } } for( $m = 12; $m > 0; $m-- ) { // count down and update down-counters $weekdaycnt = array(); foreach( $daynames as $dn ) $yeardaycnt[$dn] = $weekdaycnt[$dn] = 0; $monthcnt = 0; $mcnt = date( 't', mktime( 0, 0, 0, $m, 1, $wdate['year'] )); for( $d = $mcnt; $d > 0; $d-- ) { if( isset( $recur['BYYEARDAY'] )) { $daycnt -= 1; $daycnts[$m][$d]['yearcnt_down'] = $daycnt; } if( isset( $recur['BYMONTHDAY'] )) { $monthcnt -= 1; $daycnts[$m][$d]['monthcnt_down'] = $monthcnt; } if( isset( $recur['BYDAY'] )) { $day = $daycnts[$m][$d]['DAY']; $weekdaycnt[$day] -= 1; $daycnts[$m][$d]['monthdayno_down'] = $weekdaycnt[$day]; $yeardaycnt[$day] -= 1; $daycnts[$m][$d]['yeardayno_down'] = $yeardaycnt[$day]; } if( isset( $recur['BYWEEKNO'] ) || ( $recur['FREQ'] == 'WEEKLY' )) $daycnts[$m][$d]['weekno_down'] = ($daycnts[$m][$d]['weekno_up'] - $weekno - 1); } } } /* check interval */ if( 1 < $recur['INTERVAL'] ) { /* create interval index */ $intervalix = iCalUtilityFunctions::_recurIntervalIx( $recur['FREQ'], $wdate, $wkst ); /* check interval */ $currentKey = array_keys( $intervalarr ); $currentKey = end( $currentKey ); // get last index if( $currentKey != $intervalix ) $intervalarr = array( $intervalix => ( $intervalarr[$currentKey] + 1 )); if(( $recur['INTERVAL'] != $intervalarr[$intervalix] ) && ( 0 != $intervalarr[$intervalix] )) { /* step up date */ // echo "skip: ".implode('-',$wdate)." ix=$intervalix old=$currentKey interval=".$intervalarr[$intervalix]."
    \n";//test iCalUtilityFunctions::_stepdate( $wdate, $wdatets, $step); continue; } else // continue within the selected interval $intervalarr[$intervalix] = 0; // echo "cont: ".implode('-',$wdate)." ix=$intervalix old=$currentKey interval=".$intervalarr[$intervalix]."
    \n";//test } $updateOK = TRUE; if( $updateOK && isset( $recur['BYMONTH'] )) $updateOK = iCalUtilityFunctions::_recurBYcntcheck( $recur['BYMONTH'] , $wdate['month'] ,($wdate['month'] - 13)); if( $updateOK && isset( $recur['BYWEEKNO'] )) $updateOK = iCalUtilityFunctions::_recurBYcntcheck( $recur['BYWEEKNO'] , $daycnts[$wdate['month']][$wdate['day']]['weekno_up'] , $daycnts[$wdate['month']][$wdate['day']]['weekno_down'] ); if( $updateOK && isset( $recur['BYYEARDAY'] )) $updateOK = iCalUtilityFunctions::_recurBYcntcheck( $recur['BYYEARDAY'] , $daycnts[$wdate['month']][$wdate['day']]['yearcnt_up'] , $daycnts[$wdate['month']][$wdate['day']]['yearcnt_down'] ); if( $updateOK && isset( $recur['BYMONTHDAY'] )) $updateOK = iCalUtilityFunctions::_recurBYcntcheck( $recur['BYMONTHDAY'] , $wdate['day'] , $daycnts[$wdate['month']][$wdate['day']]['monthcnt_down'] ); // echo "efter BYMONTHDAY: ".implode('-',$wdate).' status: '; echo ($updateOK) ? 'TRUE' : 'FALSE'; echo "
    \n";//test### if( $updateOK && isset( $recur['BYDAY'] )) { $updateOK = FALSE; $m = $wdate['month']; $d = $wdate['day']; if( isset( $recur['BYDAY']['DAY'] )) { // single day, opt with year/month day order no $daynoexists = $daynosw = $daynamesw = FALSE; if( $recur['BYDAY']['DAY'] == $daycnts[$m][$d]['DAY'] ) $daynamesw = TRUE; if( isset( $recur['BYDAY'][0] )) { $daynoexists = TRUE; if(( isset( $recur['FREQ'] ) && ( $recur['FREQ'] == 'MONTHLY' )) || isset( $recur['BYMONTH'] )) $daynosw = iCalUtilityFunctions::_recurBYcntcheck( $recur['BYDAY'][0] , $daycnts[$m][$d]['monthdayno_up'] , $daycnts[$m][$d]['monthdayno_down'] ); elseif( isset( $recur['FREQ'] ) && ( $recur['FREQ'] == 'YEARLY' )) $daynosw = iCalUtilityFunctions::_recurBYcntcheck( $recur['BYDAY'][0] , $daycnts[$m][$d]['yeardayno_up'] , $daycnts[$m][$d]['yeardayno_down'] ); } if(( $daynoexists && $daynosw && $daynamesw ) || ( !$daynoexists && !$daynosw && $daynamesw )) { $updateOK = TRUE; // echo "m=$m d=$d day=".$daycnts[$m][$d]['DAY']." yeardayno_up=".$daycnts[$m][$d]['yeardayno_up']." daynoexists:$daynoexists daynosw:$daynosw daynamesw:$daynamesw updateOK:$updateOK
    \n"; // test ### } //echo "m=$m d=$d day=".$daycnts[$m][$d]['DAY']." yeardayno_up=".$daycnts[$m][$d]['yeardayno_up']." daynoexists:$daynoexists daynosw:$daynosw daynamesw:$daynamesw updateOK:$updateOK
    \n"; // test ### } else { foreach( $recur['BYDAY'] as $bydayvalue ) { $daynoexists = $daynosw = $daynamesw = FALSE; if( isset( $bydayvalue['DAY'] ) && ( $bydayvalue['DAY'] == $daycnts[$m][$d]['DAY'] )) $daynamesw = TRUE; if( isset( $bydayvalue[0] )) { $daynoexists = TRUE; if(( isset( $recur['FREQ'] ) && ( $recur['FREQ'] == 'MONTHLY' )) || isset( $recur['BYMONTH'] )) $daynosw = iCalUtilityFunctions::_recurBYcntcheck( $bydayvalue['0'] , $daycnts[$m][$d]['monthdayno_up'] , $daycnts[$m][$d]['monthdayno_down'] ); elseif( isset( $recur['FREQ'] ) && ( $recur['FREQ'] == 'YEARLY' )) $daynosw = iCalUtilityFunctions::_recurBYcntcheck( $bydayvalue['0'] , $daycnts[$m][$d]['yeardayno_up'] , $daycnts[$m][$d]['yeardayno_down'] ); } // echo "daynoexists:$daynoexists daynosw:$daynosw daynamesw:$daynamesw
    \n"; // test ### if(( $daynoexists && $daynosw && $daynamesw ) || ( !$daynoexists && !$daynosw && $daynamesw )) { $updateOK = TRUE; break; } } } } // echo "efter BYDAY: ".implode('-',$wdate).' status: '; echo ($updateOK) ? 'TRUE' : 'FALSE'; echo "
    \n"; // test ### /* check BYSETPOS */ if( $updateOK ) { if( isset( $recur['BYSETPOS'] ) && ( in_array( $recur['FREQ'], array( 'YEARLY', 'MONTHLY', 'WEEKLY', 'DAILY' )))) { if( isset( $recur['WEEKLY'] )) { if( $bysetposWold == $daycnts[$wdate['month']][$wdate['day']]['weekno_up'] ) $bysetposw1[] = $wdatets; else $bysetposw2[] = $wdatets; } else { if(( isset( $recur['FREQ'] ) && ( 'YEARLY' == $recur['FREQ'] ) && ( $bysetposYold == $wdate['year'] )) || ( isset( $recur['FREQ'] ) && ( 'MONTHLY' == $recur['FREQ'] ) && (( $bysetposYold == $wdate['year'] ) && ( $bysetposMold == $wdate['month'] ))) || ( isset( $recur['FREQ'] ) && ( 'DAILY' == $recur['FREQ'] ) && (( $bysetposYold == $wdate['year'] ) && ( $bysetposMold == $wdate['month']) && ( $bysetposDold == $wdate['day'] )))) { // echo "bysetposymd1[]=".date('Y-m-d H:i:s',$wdatets)."
    \n";//test $bysetposymd1[] = $wdatets; } else { // echo "bysetposymd2[]=".date('Y-m-d H:i:s',$wdatets)."
    \n";//test $bysetposymd2[] = $wdatets; } } } else { /* update result array if BYSETPOS is set */ $countcnt++; if( $startdatets <= $wdatets ) { // only output within period $result[$wdatets] = TRUE; // echo "recur ".date('Y-m-d H:i:s',$wdatets)."
    \n";//test } // echo "recur undate ".date('Y-m-d H:i:s',$wdatets)." okdatstart ".date('Y-m-d H:i:s',$startdatets)."
    \n";//test $updateOK = FALSE; } } /* step up date */ iCalUtilityFunctions::_stepdate( $wdate, $wdatets, $step); /* check if BYSETPOS is set for updating result array */ if( $updateOK && isset( $recur['BYSETPOS'] )) { $bysetpos = FALSE; if( isset( $recur['FREQ'] ) && ( 'YEARLY' == $recur['FREQ'] ) && ( $bysetposYold != $wdate['year'] )) { $bysetpos = TRUE; $bysetposYold = $wdate['year']; } elseif( isset( $recur['FREQ'] ) && ( 'MONTHLY' == $recur['FREQ'] && (( $bysetposYold != $wdate['year'] ) || ( $bysetposMold != $wdate['month'] )))) { $bysetpos = TRUE; $bysetposYold = $wdate['year']; $bysetposMold = $wdate['month']; } elseif( isset( $recur['FREQ'] ) && ( 'WEEKLY' == $recur['FREQ'] )) { $weekno = (int) date( 'W', mktime( 0, 0, $wkst, $wdate['month'], $wdate['day'], $wdate['year'])); if( $bysetposWold != $weekno ) { $bysetposWold = $weekno; $bysetpos = TRUE; } } elseif( isset( $recur['FREQ'] ) && ( 'DAILY' == $recur['FREQ'] ) && (( $bysetposYold != $wdate['year'] ) || ( $bysetposMold != $wdate['month'] ) || ( $bysetposDold != $wdate['day'] ))) { $bysetpos = TRUE; $bysetposYold = $wdate['year']; $bysetposMold = $wdate['month']; $bysetposDold = $wdate['day']; } if( $bysetpos ) { if( isset( $recur['BYWEEKNO'] )) { $bysetposarr1 = & $bysetposw1; $bysetposarr2 = & $bysetposw2; } else { $bysetposarr1 = & $bysetposymd1; $bysetposarr2 = & $bysetposymd2; } // echo 'test före out startYMD (weekno)='.$wdateStart['year'].':'.$wdateStart['month'].':'.$wdateStart['day']." ($weekStart) "; // test ### foreach( $recur['BYSETPOS'] as $ix ) { if( 0 > $ix ) // both positive and negative BYSETPOS allowed $ix = ( count( $bysetposarr1 ) + $ix + 1); $ix--; if( isset( $bysetposarr1[$ix] )) { if( $startdatets <= $bysetposarr1[$ix] ) { // only output within period // $testdate = iCalUtilityFunctions::_timestamp2date( $bysetposarr1[$ix], 6 ); // test ### // $testweekno = (int) date( 'W', mktime( 0, 0, $wkst, $testdate['month'], $testdate['day'], $testdate['year'] )); // test ### // echo " testYMD (weekno)=".$testdate['year'].':'.$testdate['month'].':'.$testdate['day']." ($testweekno)"; // test ### $result[$bysetposarr1[$ix]] = TRUE; // echo " recur ".date('Y-m-d H:i:s',$bysetposarr1[$ix]); // test ### } $countcnt++; } if( isset( $recur['COUNT'] ) && ( $countcnt >= $recur['COUNT'] )) break; } // echo "
    \n"; // test ### $bysetposarr1 = $bysetposarr2; $bysetposarr2 = array(); } } } } public static function _recurBYcntcheck( $BYvalue, $upValue, $downValue ) { if( is_array( $BYvalue ) && ( in_array( $upValue, $BYvalue ) || in_array( $downValue, $BYvalue ))) return TRUE; elseif(( $BYvalue == $upValue ) || ( $BYvalue == $downValue )) return TRUE; else return FALSE; } public static function _recurIntervalIx( $freq, $date, $wkst ) { /* create interval index */ switch( $freq ) { case 'YEARLY': $intervalix = $date['year']; break; case 'MONTHLY': $intervalix = $date['year'].'-'.$date['month']; break; case 'WEEKLY': $wdatets = iCalUtilityFunctions::_date2timestamp( $date ); $intervalix = (int) date( 'W', ( $wdatets + $wkst )); break; case 'DAILY': default: $intervalix = $date['year'].'-'.$date['month'].'-'.$date['day']; break; } return $intervalix; } /** * convert input format for exrule and rrule to internal format * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.11.15 - 2012-01-31 * @param array $rexrule * @return array */ public static function _setRexrule( $rexrule ) { $input = array(); if( empty( $rexrule )) return $input; foreach( $rexrule as $rexrulelabel => $rexrulevalue ) { $rexrulelabel = strtoupper( $rexrulelabel ); if( 'UNTIL' != $rexrulelabel ) $input[$rexrulelabel] = $rexrulevalue; else { iCalUtilityFunctions::_strDate2arr( $rexrulevalue ); if( iCalUtilityFunctions::_isArrayTimestampDate( $rexrulevalue )) // timestamp, always date-time $input[$rexrulelabel] = iCalUtilityFunctions::_timestamp2date( $rexrulevalue, 6 ); elseif( iCalUtilityFunctions::_isArrayDate( $rexrulevalue )) { // date or date-time $parno = ( isset( $rexrulevalue['hour'] ) || isset( $rexrulevalue[4] )) ? 6 : 3; $input[$rexrulelabel] = iCalUtilityFunctions::_date_time_array( $rexrulevalue, $parno ); } elseif( 8 <= strlen( trim( $rexrulevalue ))) { // ex. textual datetime/date 2006-08-03 10:12:18 $input[$rexrulelabel] = iCalUtilityFunctions::_date_time_string( $rexrulevalue ); unset( $input['$rexrulelabel']['unparsedtext'] ); } if(( 3 < count( $input[$rexrulelabel] )) && !isset( $input[$rexrulelabel]['tz'] )) $input[$rexrulelabel]['tz'] = 'Z'; } } /* set recurrence rule specification in rfc2445 order */ $input2 = array(); if( isset( $input['FREQ'] )) $input2['FREQ'] = $input['FREQ']; if( isset( $input['UNTIL'] )) $input2['UNTIL'] = $input['UNTIL']; elseif( isset( $input['COUNT'] )) $input2['COUNT'] = $input['COUNT']; if( isset( $input['INTERVAL'] )) $input2['INTERVAL'] = $input['INTERVAL']; if( isset( $input['BYSECOND'] )) $input2['BYSECOND'] = $input['BYSECOND']; if( isset( $input['BYMINUTE'] )) $input2['BYMINUTE'] = $input['BYMINUTE']; if( isset( $input['BYHOUR'] )) $input2['BYHOUR'] = $input['BYHOUR']; if( isset( $input['BYDAY'] )) { if( !is_array( $input['BYDAY'] )) // ensure upper case.. . $input2['BYDAY'] = strtoupper( $input['BYDAY'] ); else { foreach( $input['BYDAY'] as $BYDAYx => $BYDAYv ) { if( 'DAY' == strtoupper( $BYDAYx )) $input2['BYDAY']['DAY'] = strtoupper( $BYDAYv ); elseif( !is_array( $BYDAYv )) { $input2['BYDAY'][$BYDAYx] = $BYDAYv; } else { foreach( $BYDAYv as $BYDAYx2 => $BYDAYv2 ) { if( 'DAY' == strtoupper( $BYDAYx2 )) $input2['BYDAY'][$BYDAYx]['DAY'] = strtoupper( $BYDAYv2 ); else $input2['BYDAY'][$BYDAYx][$BYDAYx2] = $BYDAYv2; } } } } } if( isset( $input['BYMONTHDAY'] )) $input2['BYMONTHDAY'] = $input['BYMONTHDAY']; if( isset( $input['BYYEARDAY'] )) $input2['BYYEARDAY'] = $input['BYYEARDAY']; if( isset( $input['BYWEEKNO'] )) $input2['BYWEEKNO'] = $input['BYWEEKNO']; if( isset( $input['BYMONTH'] )) $input2['BYMONTH'] = $input['BYMONTH']; if( isset( $input['BYSETPOS'] )) $input2['BYSETPOS'] = $input['BYSETPOS']; if( isset( $input['WKST'] )) $input2['WKST'] = $input['WKST']; return $input2; } /** * convert format for input date to internal date with parameters * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.11.8 - 2012-03-18 * @param mixed $year * @param mixed $month optional * @param int $day optional * @param int $hour optional * @param int $min optional * @param int $sec optional * @param string $tz optional * @param array $params optional * @param string $caller optional * @param string $objName optional * @param string $tzid optional * @return array */ public static function _setDate( $year, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $tz=FALSE, $params=FALSE, $caller=null, $objName=null, $tzid=FALSE ) { $input = $parno = null; $localtime = (( 'dtstart' == $caller ) && in_array( $objName, array( 'vtimezone', 'standard', 'daylight' ))) ? TRUE : FALSE; iCalUtilityFunctions::_strDate2arr( $year ); if( iCalUtilityFunctions::_isArrayDate( $year )) { if( $localtime ) unset ( $month['VALUE'], $month['TZID'] ); $input['params'] = iCalUtilityFunctions::_setParams( $month, array( 'VALUE' => 'DATE-TIME' )); if( isset( $input['params']['TZID'] )) { $input['params']['VALUE'] = 'DATE-TIME'; unset( $year['tz'] ); } $hitval = ( isset( $year['tz'] ) || isset( $year[6] )) ? 7 : 6; $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE-TIME', $hitval ); $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE', 3, count( $year ), $parno ); $input['value'] = iCalUtilityFunctions::_date_time_array( $year, $parno ); } elseif( iCalUtilityFunctions::_isArrayTimestampDate( $year )) { if( $localtime ) unset ( $month['VALUE'], $month['TZID'] ); $input['params'] = iCalUtilityFunctions::_setParams( $month, array( 'VALUE' => 'DATE-TIME' )); if( isset( $input['params']['TZID'] )) { $input['params']['VALUE'] = 'DATE-TIME'; unset( $year['tz'] ); } $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE', 3 ); $hitval = ( isset( $year['tz'] )) ? 7 : 6; $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE-TIME', $hitval, $parno ); $input['value'] = iCalUtilityFunctions::_timestamp2date( $year, $parno ); } elseif( 8 <= strlen( trim( $year ))) { // ex. 2006-08-03 10:12:18 if( $localtime ) unset ( $month['VALUE'], $month['TZID'] ); $input['params'] = iCalUtilityFunctions::_setParams( $month, array( 'VALUE' => 'DATE-TIME' )); if( isset( $input['params']['TZID'] )) { $input['params']['VALUE'] = 'DATE-TIME'; $parno = 6; } elseif( $tzid && iCalUtilityFunctions::_isOffset( substr( $year, -7 ))) { if(( in_array( substr( $year, -5, 1 ), array( '+', '-' ))) && ( '0000' < substr( $year, -4 )) && ( '9999' >= substr( $year, -4 ))) $year = substr( $year, 0, ( strlen( $year ) - 5 )); elseif(( in_array( substr( $input, -7, 1 ), array( '+', '-' ))) && ( '000000' < substr( $input, -6 )) && ( '999999' >= substr( $input, -6 ))) $year = substr( $year, 0, ( strlen( $year ) - 7 )); $parno = 6; } $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE-TIME', 7, $parno ); $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE', 3, $parno, $parno ); $input['value'] = iCalUtilityFunctions::_date_time_string( $year, $parno ); unset( $input['value']['unparsedtext'] ); } else { if( is_array( $params )) { if( $localtime ) unset ( $params['VALUE'], $params['TZID'] ); $input['params'] = iCalUtilityFunctions::_setParams( $params, array( 'VALUE' => 'DATE-TIME' )); } elseif( is_array( $tz )) { $input['params'] = iCalUtilityFunctions::_setParams( $tz, array( 'VALUE' => 'DATE-TIME' )); $tz = FALSE; } elseif( is_array( $hour )) { $input['params'] = iCalUtilityFunctions::_setParams( $hour, array( 'VALUE' => 'DATE-TIME' )); $hour = $min = $sec = $tz = FALSE; } if( isset( $input['params']['TZID'] )) { $tz = null; $input['params']['VALUE'] = 'DATE-TIME'; } $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE', 3 ); $hitval = ( !empty( $tz )) ? 7 : 6; $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE-TIME', $hitval, $parno, $parno ); $input['value'] = array( 'year' => $year, 'month' => $month, 'day' => $day ); if( 3 != $parno ) { $input['value']['hour'] = ( $hour ) ? $hour : '0'; $input['value']['min'] = ( $min ) ? $min : '0'; $input['value']['sec'] = ( $sec ) ? $sec : '0'; if( !empty( $tz )) $input['value']['tz'] = $tz; } } if( 3 == $parno ) { $input['params']['VALUE'] = 'DATE'; unset( $input['value']['tz'] ); unset( $input['params']['TZID'] ); } elseif( isset( $input['params']['TZID'] )) unset( $input['value']['tz'] ); if( $localtime ) unset( $input['value']['tz'], $input['params']['TZID'] ); elseif(( !isset( $input['params']['VALUE'] ) || ( $input['params']['VALUE'] != 'DATE' )) && !isset( $input['params']['TZID'] ) && $tzid ) $input['params']['TZID'] = $tzid; if( isset( $input['value']['tz'] )) $input['value']['tz'] = (string) $input['value']['tz']; if( !empty( $input['value']['tz'] ) && ( 'Z' != $input['value']['tz'] ) && // real time zone in tz to TZID ( !iCalUtilityFunctions::_isOffset( $input['value']['tz'] ))) { $input['params']['TZID'] = $input['value']['tz']; unset( $input['value']['tz'] ); } if( isset( $input['params']['TZID'] ) && !empty( $input['params']['TZID'] )) { if(( 'Z' != $input['params']['TZID'] ) && iCalUtilityFunctions::_isOffset( $input['params']['TZID'] )) { // utc offset in TZID to tz $input['value']['tz'] = $input['params']['TZID']; unset( $input['params']['TZID'] ); } elseif( in_array( strtoupper( $input['params']['TZID'] ), array( 'GMT', 'UTC', 'Z' ))) { // time zone Z $input['value']['tz'] = 'Z'; unset( $input['params']['TZID'] ); } } return $input; } /** * convert format for input date (UTC) to internal date with parameters * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.11.8 - 2012-01-19 * @param mixed $year * @param mixed $month optional * @param int $day optional * @param int $hour optional * @param int $min optional * @param int $sec optional * @param array $params optional * @return array */ public static function _setDate2( $year, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $params=FALSE ) { $input = null; iCalUtilityFunctions::_strDate2arr( $year ); if( iCalUtilityFunctions::_isArrayDate( $year )) { $input['value'] = iCalUtilityFunctions::_date_time_array( $year, 7 ); $input['params'] = iCalUtilityFunctions::_setParams( $month, array( 'VALUE' => 'DATE-TIME' ) ); } elseif( iCalUtilityFunctions::_isArrayTimestampDate( $year )) { $input['value'] = iCalUtilityFunctions::_timestamp2date( $year, 7 ); $input['params'] = iCalUtilityFunctions::_setParams( $month, array( 'VALUE' => 'DATE-TIME' ) ); } elseif( 8 <= strlen( trim( $year ))) { // ex. 2006-08-03 10:12:18 $input['value'] = iCalUtilityFunctions::_date_time_string( $year, 7 ); unset( $input['value']['unparsedtext'] ); $input['params'] = iCalUtilityFunctions::_setParams( $month, array( 'VALUE' => 'DATE-TIME' ) ); } else { $input['value'] = array( 'year' => $year , 'month' => $month , 'day' => $day , 'hour' => $hour , 'min' => $min , 'sec' => $sec ); $input['params'] = iCalUtilityFunctions::_setParams( $params, array( 'VALUE' => 'DATE-TIME' )); } $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE-TIME', 7 ); // remove default if( !isset( $input['value']['hour'] )) $input['value']['hour'] = 0; if( !isset( $input['value']['min'] )) $input['value']['min'] = 0; if( !isset( $input['value']['sec'] )) $input['value']['sec'] = 0; if( isset( $input['params']['TZID'] ) && !empty( $input['params']['TZID'] )) { if(( 'Z' != $input['params']['TZID'] ) && iCalUtilityFunctions::_isOffset( $input['params']['TZID'] )) { // utc offset in TZID to tz $input['value']['tz'] = $input['params']['TZID']; unset( $input['params']['TZID'] ); } elseif( in_array( strtoupper( $input['params']['TZID'] ), array( 'GMT', 'UTC', 'Z' ))) { // time zone Z $input['value']['tz'] = 'Z'; unset( $input['params']['TZID'] ); } } if( !isset( $input['value']['tz'] ) || !iCalUtilityFunctions::_isOffset( $input['value']['tz'] )) $input['value']['tz'] = 'Z'; return $input; } /** * check index and set (an indexed) content in multiple value array * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.6.12 - 2011-01-03 * @param array $valArr * @param mixed $value * @param array $params * @param array $defaults * @param int $index * @return void */ public static function _setMval( & $valArr, $value, $params=FALSE, $defaults=FALSE, $index=FALSE ) { if( !is_array( $valArr )) $valArr = array(); if( $index ) $index = $index - 1; elseif( 0 < count( $valArr )) { $keys = array_keys( $valArr ); $index = end( $keys ) + 1; } else $index = 0; $valArr[$index] = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params, $defaults )); ksort( $valArr ); } /** * set input (formatted) parameters- component property attributes * * default parameters can be set, if missing * * @author Kjell-Inge Gustafsson, kigkonsult * @since 1.x.x - 2007-05-01 * @param array $params * @param array $defaults * @return array */ public static function _setParams( $params, $defaults=FALSE ) { if( !is_array( $params)) $params = array(); $input = array(); foreach( $params as $paramKey => $paramValue ) { if( is_array( $paramValue )) { foreach( $paramValue as $pkey => $pValue ) { if(( '"' == substr( $pValue, 0, 1 )) && ( '"' == substr( $pValue, -1 ))) $paramValue[$pkey] = substr( $pValue, 1, ( strlen( $pValue ) - 2 )); } } elseif(( '"' == substr( $paramValue, 0, 1 )) && ( '"' == substr( $paramValue, -1 ))) $paramValue = substr( $paramValue, 1, ( strlen( $paramValue ) - 2 )); if( 'VALUE' == strtoupper( $paramKey )) $input['VALUE'] = strtoupper( $paramValue ); else $input[strtoupper( $paramKey )] = $paramValue; } if( is_array( $defaults )) { foreach( $defaults as $paramKey => $paramValue ) { if( !isset( $input[$paramKey] )) $input[$paramKey] = $paramValue; } } return (0 < count( $input )) ? $input : null; } /** * step date, return updated date, array and timpstamp * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.16 - 2008-10-18 * @param array $date, date to step * @param int $timestamp * @param array $step, default array( 'day' => 1 ) * @return void */ public static function _stepdate( &$date, &$timestamp, $step=array( 'day' => 1 )) { foreach( $step as $stepix => $stepvalue ) $date[$stepix] += $stepvalue; $timestamp = iCalUtilityFunctions::_date2timestamp( $date ); $date = iCalUtilityFunctions::_timestamp2date( $timestamp, 6 ); foreach( $date as $k => $v ) { if( ctype_digit( $v )) $date[$k] = (int) $v; } } /** * convert a date from specific string to array format * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.11.8 - 2012-01-27 * @param mixed $input * @return bool, TRUE on success */ public static function _strDate2arr( & $input ) { if( is_array( $input )) return FALSE; if( 5 > strlen( (string) $input )) return FALSE; $work = $input; if( 2 == substr_count( $work, '-' )) $work = str_replace( '-', '', $work ); if( 2 == substr_count( $work, '/' )) $work = str_replace( '/', '', $work ); if( !ctype_digit( substr( $work, 0, 8 ))) return FALSE; if( !checkdate( (int) substr( $work, 4, 2 ), (int) substr( $work, 6, 2 ), (int) substr( $work, 0, 4 ))) return FALSE; $temp = array( 'year' => substr( $work, 0, 4 ) , 'month' => substr( $work, 4, 2 ) , 'day' => substr( $work, 6, 2 )); if( 8 == strlen( $work )) { $input = $temp; return TRUE; } if(( ' ' == substr( $work, 8, 1 )) || ( 'T' == substr( $work, 8, 1 )) || ( 't' == substr( $work, 8, 1 ))) $work = substr( $work, 9 ); elseif( ctype_digit( substr( $work, 8, 1 ))) $work = substr( $work, 8 ); else return FALSE; if( 2 == substr_count( $work, ':' )) $work = str_replace( ':', '', $work ); if( !ctype_digit( substr( $work, 0, 4 ))) return FALSE; $temp['hour'] = substr( $work, 0, 2 ); $temp['min'] = substr( $work, 2, 2 ); if((( 0 > $temp['hour'] ) || ( $temp['hour'] > 23 )) || (( 0 > $temp['min'] ) || ( $temp['min'] > 59 ))) return FALSE; if( ctype_digit( substr( $work, 4, 2 ))) { $temp['sec'] = substr( $work, 4, 2 ); if(( 0 > $temp['sec'] ) || ( $temp['sec'] > 59 )) return FALSE; $len = 6; } else { $temp['sec'] = 0; $len = 4; } if( $len < strlen( $work)) $temp['tz'] = trim( substr( $work, 6 )); $input = $temp; return TRUE; } /** * convert timestamp to date array * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.4.16 - 2008-11-01 * @param mixed $timestamp * @param int $parno * @return array */ public static function _timestamp2date( $timestamp, $parno=6 ) { if( is_array( $timestamp )) { if(( 7 == $parno ) && !empty( $timestamp['tz'] )) $tz = $timestamp['tz']; $timestamp = $timestamp['timestamp']; } $output = array( 'year' => date( 'Y', $timestamp ) , 'month' => date( 'm', $timestamp ) , 'day' => date( 'd', $timestamp )); if( 3 != $parno ) { $output['hour'] = date( 'H', $timestamp ); $output['min'] = date( 'i', $timestamp ); $output['sec'] = date( 's', $timestamp ); if( isset( $tz )) $output['tz'] = $tz; } return $output; } /** * convert timestamp to duration in array format * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.6.23 - 2010-10-23 * @param int $timestamp * @return array, duration format */ public static function _timestamp2duration( $timestamp ) { $dur = array(); $dur['week'] = (int) floor( $timestamp / ( 7 * 24 * 60 * 60 )); $timestamp = $timestamp % ( 7 * 24 * 60 * 60 ); $dur['day'] = (int) floor( $timestamp / ( 24 * 60 * 60 )); $timestamp = $timestamp % ( 24 * 60 * 60 ); $dur['hour'] = (int) floor( $timestamp / ( 60 * 60 )); $timestamp = $timestamp % ( 60 * 60 ); $dur['min'] = (int) floor( $timestamp / ( 60 )); $dur['sec'] = (int) $timestamp % ( 60 ); return $dur; } /** * transforms a dateTime from a timezone to another using PHP DateTime and DateTimeZone class (PHP >= PHP 5.2.0) * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.12.1 - 2012-04-1 * @param mixed $date, date to alter * @param string $tzFrom, PHP valid old timezone * @param string $tzTo, PHP valid new timezone, default 'UTC' * @param string $format, date output format, default 'Ymd\THis' * @return bool */ public static function transformDateTime( & $date, $tzFrom, $tzTo='UTC', $format = 'Ymd\THis' ) { if( substr( phpversion(), 0, 3 ) < '5.2' ) return FALSE; if( is_array( $date ) && isset( $date['timestamp'] )) $timestamp = $date['timestamp']; elseif( iCalUtilityFunctions::_isArrayDate( $date )) { if(isset( $date['tz'] )) unset( $date['tz'] ); $date = iCalUtilityFunctions::_format_date_time( iCalUtilityFunctions::_date_time_array( $date )); if( 'Z' == substr( $date, -1 )) $date = substr( $date, 0, ( strlen( $date ) - 2 )); if( FALSE === ( $timestamp = strtotime( $date ))) return FALSE; } elseif( FALSE === ( $timestamp = @strtotime( $date ))) return FALSE; try { $d = new DateTime( date( 'Y-m-d H:i:s', $timestamp ), new DateTimeZone( $tzFrom )); $d->setTimezone( new DateTimeZone( $tzTo )); } catch (Exception $e) { return FALSE; } $date = $d->format( $format ); return TRUE; } /** * convert (numeric) local time offset, ("+" / "-")HHmm[ss], to seconds correcting localtime to GMT * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.11.4 - 2012-01-11 * @param string $offset * @return integer */ public static function _tz2offset( $tz ) { $tz = trim( (string) $tz ); $offset = 0; if((( 5 != strlen( $tz )) && ( 7 != strlen( $tz ))) || (( '+' != substr( $tz, 0, 1 )) && ( '-' != substr( $tz, 0, 1 ))) || (( '0000' >= substr( $tz, 1, 4 )) && ( '9999' < substr( $tz, 1, 4 ))) || (( 7 == strlen( $tz )) && ( '00' > substr( $tz, 5, 2 )) && ( '99' < substr( $tz, 5, 2 )))) return $offset; $hours2sec = (int) substr( $tz, 1, 2 ) * 3600; $min2sec = (int) substr( $tz, 3, 2 ) * 60; $sec = ( 7 == strlen( $tz )) ? (int) substr( $tz, -2 ) : '00'; $offset = $hours2sec + $min2sec + $sec; $offset = ('-' == substr( $tz, 0, 1 )) ? $offset * -1 : $offset; return $offset; } } /*********************************************************************************/ /* iCalcreator vCard helper functions */ /*********************************************************************************/ /** * convert single ATTENDEE, CONTACT or ORGANIZER (in email format) to vCard * returns vCard/TRUE or if directory (if set) or file write is unvalid, FALSE * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.12.2 - 2012-07-11 * @param object $email * $param string $version, vCard version (default 2.1) * $param string $directory, where to save vCards (default FALSE) * $param string $ext, vCard file extension (default 'vcf') * @return mixed */ function iCal2vCard( $email, $version='2.1', $directory=FALSE, $ext='vcf' ) { if( FALSE === ( $pos = strpos( $email, '@' ))) return FALSE; if( $directory ) { if( DIRECTORY_SEPARATOR != substr( $directory, ( 0 - strlen( DIRECTORY_SEPARATOR )))) $directory .= DIRECTORY_SEPARATOR; if( !is_dir( $directory ) || !is_writable( $directory )) return FALSE; } /* prepare vCard */ $email = str_replace( 'MAILTO:', '', $email ); $name = $person = substr( $email, 0, $pos ); if( ctype_upper( $name ) || ctype_lower( $name )) $name = array( $name ); else { if( FALSE !== ( $pos = strpos( $name, '.' ))) { $name = explode( '.', $name ); foreach( $name as $k => $part ) $name[$k] = ucfirst( $part ); } else { // split camelCase $chars = $name; $name = array( $chars[0] ); $k = 0; $x = 1; while( FALSE !== ( $char = substr( $chars, $x, 1 ))) { if( ctype_upper( $char )) { $k += 1; $name[$k] = ''; } $name[$k] .= $char; $x++; } } } $nl = "\r\n"; $FN = 'FN:'.implode( ' ', $name ).$nl; $name = array_reverse( $name ); $N = 'N:'.array_shift( $name ); $scCnt = 0; while( NULL != ( $part = array_shift( $name ))) { if(( '4.0' != $version ) || ( 4 > $scCnt )) $scCnt += 1; $N .= ';'.$part; } while(( '4.0' == $version ) && ( 4 > $scCnt )) { $N .= ';'; $scCnt += 1; } $N .= $nl; $EMAIL = 'EMAIL:'.$email.$nl; /* create vCard */ $vCard = 'BEGIN:VCARD'.$nl; $vCard .= "VERSION:$version$nl"; $vCard .= 'PRODID:-//kigkonsult.se '.ICALCREATOR_VERSION."//$nl"; $vCard .= $N; $vCard .= $FN; $vCard .= $EMAIL; $vCard .= 'REV:'.gmdate( 'Ymd\THis\Z' ).$nl; $vCard .= 'END:VCARD'.$nl; /* save each vCard as (unique) single file */ if( $directory ) { $fname = $directory.preg_replace( '/[^a-z0-9.]/i', '', $email ); $cnt = 1; $dbl = ''; while( is_file ( $fname.$dbl.'.'.$ext )) { $cnt += 1; $dbl = "_$cnt"; } if( FALSE === file_put_contents( $fname, $fname.$dbl.'.'.$ext )) return FALSE; return TRUE; } /* return vCard */ else return $vCard; } /** * convert ATTENDEEs, CONTACTs and ORGANIZERs (in email format) to vCards * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.12.2 - 2012-05-07 * @param object $calendar, iCalcreator vcalendar instance reference * $param string $version, vCard version (default 2.1) * $param string $directory, where to save vCards (default FALSE) * $param string $ext, vCard file extension (default 'vcf') * @return mixed */ function iCal2vCards( & $calendar, $version='2.1', $directory=FALSE, $ext='vcf' ) { $hits = array(); $vCardP = array( 'ATTENDEE', 'CONTACT', 'ORGANIZER' ); foreach( $vCardP as $prop ) { $hits2 = $calendar->getProperty( $prop ); foreach( $hits2 as $propValue => $occCnt ) { if( FALSE === ( $pos = strpos( $propValue, '@' ))) continue; $propValue = str_replace( 'MAILTO:', '', $propValue ); if( isset( $hits[$propValue] )) $hits[$propValue] += $occCnt; else $hits[$propValue] = $occCnt; } } if( empty( $hits )) return FALSE; ksort( $hits ); $output = ''; foreach( $hits as $email => $skip ) { $res = iCal2vCard( $email, $version, $directory, $ext ); if( $directory && !$res ) return FALSE; elseif( !$res ) return $res; else $output .= $res; } if( $directory ) return TRUE; if( !empty( $output )) return $output; return FALSE; } /*********************************************************************************/ /* iCalcreator XML (rfc6321) helper functions */ /*********************************************************************************/ /** * format iCal XML output, rfc6321, using PHP SimpleXMLElement * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.12.3 - 2012-04-19 * @param object $calendar, iCalcreator vcalendar instance reference * @return string */ function iCal2XML( & $calendar ) { /** fix an SimpleXMLElement instance and create root element */ $xmlstr = ''; $xmlstr .= ''; $xmlstr .= ''; $xml = new SimpleXMLElement( $xmlstr ); $vcalendar = $xml->addChild( 'vcalendar' ); /** fix calendar properties */ $properties = $vcalendar->addChild( 'properties' ); $calProps = array( 'prodid', 'version', 'calscale', 'method' ); foreach( $calProps as $calProp ) { if( FALSE !== ( $content = $calendar->getProperty( $calProp ))) _addXMLchild( $properties, $calProp, 'text', $content ); } while( FALSE !== ( $content = $calendar->getProperty( FALSE, FALSE, TRUE ))) _addXMLchild( $properties, $content[0], 'unknown', $content[1]['value'], $content[1]['params'] ); $langCal = $calendar->getConfig( 'language' ); /** prepare to fix components with properties */ $components = $vcalendar->addChild( 'components' ); $comps = array( 'vtimezone', 'vevent', 'vtodo', 'vjournal', 'vfreebusy' ); $eventProps = array( 'dtstamp', 'dtstart', 'uid', 'class', 'created', 'description', 'geo', 'last-modified', 'location', 'organizer', 'priority', 'sequence', 'status', 'summary', 'transp', 'url', 'recurrence-id', 'rrule', 'dtend', 'duration', 'attach', 'attendee', 'categories', 'comment', 'contact', 'exdate', 'request-status', 'related-to', 'resources', 'rdate', 'x-prop' ); $todoProps = array( 'dtstamp', 'uid', 'class', 'completed', 'created', 'description', 'geo', 'last-modified', 'location', 'organizer', 'percent-complete', 'priority', 'recurrence-id', 'sequence', 'status', 'summary', 'url', 'rrule', 'dtstart', 'due', 'duration', 'attach', 'attendee', 'categories', 'comment', 'contact', 'exdate', 'request-status', 'related-to', 'resources', 'rdate', 'x-prop' ); $journalProps = array( 'dtstamp', 'uid', 'class', 'created', 'dtstart', 'last-modified', 'organizer', 'recurrence-id', 'sequence', 'status', 'summary', 'url', 'rrule', 'attach', 'attendee', 'categories', 'comment', 'contact', 'description', 'exdate', 'related-to', 'rdate', 'request-status', 'x-prop' ); $freebusyProps = array( 'dtstamp', 'uid', 'contact', 'dtstart', 'dtend', 'duration', 'organizer', 'url', 'attendee', 'comment', 'freebusy', 'request-status', 'x-prop' ); $timezoneProps = array( 'tzid', 'last-modified', 'tzurl', 'x-prop' ); $alarmProps = array( 'action', 'description', 'trigger', 'summary', 'attendee', 'duration', 'repeat', 'attach', 'x-prop' ); $stddghtProps = array( 'dtstart', 'tzoffsetto', 'tzoffsetfrom', 'rrule', 'comment', 'rdate', 'tzname', 'x-prop' ); foreach( $comps as $compName ) { switch( $compName ) { case 'vevent': $props = & $eventProps; $subComps = array( 'valarm' ); $subCompProps = & $alarmProps; break; case 'vtodo': $props = & $todoProps; $subComps = array( 'valarm' ); $subCompProps = & $alarmProps; break; case 'vjournal': $props = & $journalProps; $subComps = array(); $subCompProps = array(); break; case 'vfreebusy': $props = & $freebusyProps; $subComps = array(); $subCompProps = array(); break; case 'vtimezone': $props = & $timezoneProps; $subComps = array( 'standard', 'daylight' ); $subCompProps = & $stddghtProps; break; } // end switch( $compName ) /** fix component properties */ while( FALSE !== ( $component = $calendar->getComponent( $compName ))) { $child = $components->addChild( $compName ); $properties = $child->addChild( 'properties' ); $langComp = $component->getConfig( 'language' ); foreach( $props as $prop ) { switch( $prop ) { case 'attach': // may occur multiple times, below while( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) { $type = ( isset( $content['params']['VALUE'] ) && ( 'BINARY' == $content['params']['VALUE'] )) ? 'binary' : 'uri'; unset( $content['params']['VALUE'] ); _addXMLchild( $properties, $prop, $type, $content['value'], $content['params'] ); } break; case 'attendee': while( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) { if( isset( $content['params']['CN'] ) && !isset( $content['params']['LANGUAGE'] )) { if( $langComp ) $content['params']['LANGUAGE'] = $langComp; elseif( $langCal ) $content['params']['LANGUAGE'] = $langCal; } _addXMLchild( $properties, $prop, 'cal-address', $content['value'], $content['params'] ); } break; case 'exdate': while( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) { $type = ( isset( $content['params']['VALUE'] ) && ( 'DATE' == $content['params']['VALUE'] )) ? 'date' : 'date-time'; unset( $content['params']['VALUE'] ); foreach( $content['value'] as & $exDate ) { if( ( isset( $exDate['tz'] ) && // fix UTC-date if offset set iCalUtilityFunctions::_isOffset( $exDate['tz'] ) && ( 'Z' != $exDate['tz'] )) || ( isset( $content['params']['TZID'] ) && iCalUtilityFunctions::_isOffset( $content['params']['TZID'] ) && ( 'Z' != $content['params']['TZID'] ))) { $offset = isset( $exDate['tz'] ) ? $exDate['tz'] : $content['params']['TZID']; $date = mktime( (int) $exDate['hour'], (int) $exDate['min'], (int) ($exDate['sec'] + iCalUtilityFunctions::_tz2offset( $offset )), (int) $exDate['month'], (int) $exDate['day'], (int) $exDate['year'] ); unset( $exDate['tz'] ); $exDate = iCalUtilityFunctions::_date_time_string( date( 'Ymd\THis\Z', $date ), 6 ); unset( $exDate['unparsedtext'] ); } } _addXMLchild( $properties, $prop, $type, $content['value'], $content['params'] ); } break; case 'freebusy': while( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) _addXMLchild( $properties, $prop, 'period', $content['value'], $content['params'] ); break; case 'request-status': while( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) { if( !isset( $content['params']['LANGUAGE'] )) { if( $langComp ) $content['params']['LANGUAGE'] = $langComp; elseif( $langCal ) $content['params']['LANGUAGE'] = $langCal; } _addXMLchild( $properties, $prop, 'rstatus', $content['value'], $content['params'] ); } break; case 'rdate': while( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) { $type = 'date-time'; if( isset( $content['params']['VALUE'] )) { if( 'DATE' == $content['params']['VALUE'] ) $type = 'date'; elseif( 'PERIOD' == $content['params']['VALUE'] ) $type = 'period'; } if( 'period' == $type ) { foreach( $content['value'] as & $rDates ) { if( ( isset( $rDates[0]['tz'] ) && // fix UTC-date if offset set iCalUtilityFunctions::_isOffset( $rDates[0]['tz'] ) && ( 'Z' != $rDates[0]['tz'] )) || ( isset( $content['params']['TZID'] ) && iCalUtilityFunctions::_isOffset( $content['params']['TZID'] ) && ( 'Z' != $content['params']['TZID'] ))) { $offset = isset( $rDates[0]['tz'] ) ? $rDates[0]['tz'] : $content['params']['TZID']; $date = mktime( (int) $rDates[0]['hour'], (int) $rDates[0]['min'], (int) ($rDates[0]['sec'] + iCalUtilityFunctions::_tz2offset( $offset )), (int) $rDates[0]['month'], (int) $rDates[0]['day'], (int) $rDates[0]['year'] ); unset( $rDates[0]['tz'] ); $rDates[0] = iCalUtilityFunctions::_date_time_string( date( 'Ymd\THis\Z', $date ), 6 ); unset( $rDates[0]['unparsedtext'] ); } if( isset( $rDates[1]['year'] )) { if( ( isset( $rDates[1]['tz'] ) && // fix UTC-date if offset set iCalUtilityFunctions::_isOffset( $rDates[1]['tz'] ) && ( 'Z' != $rDates[1]['tz'] )) || ( isset( $content['params']['TZID'] ) && iCalUtilityFunctions::_isOffset( $content['params']['TZID'] ) && ( 'Z' != $content['params']['TZID'] ))) { $offset = isset( $rDates[1]['tz'] ) ? $rDates[1]['tz'] : $content['params']['TZID']; $date = mktime( (int) $rDates[1]['hour'], (int) $rDates[1]['min'], (int) ($rDates[1]['sec'] + iCalUtilityFunctions::_tz2offset( $offset )), (int) $rDates[1]['month'], (int) $rDates[1]['day'], (int) $rDates[1]['year'] ); unset( $rDates[1]['tz'] ); $rDates[1] = iCalUtilityFunctions::_date_time_string( date( 'Ymd\THis\Z', $date ), 6 ); unset( $rDates[1]['unparsedtext'] ); } } } } elseif( 'date-time' == $type ) { foreach( $content['value'] as & $rDate ) { if( ( isset( $rDate['tz'] ) && // fix UTC-date if offset set iCalUtilityFunctions::_isOffset( $rDate['tz'] ) && ( 'Z' != $rDate['tz'] )) || ( isset( $content['params']['TZID'] ) && iCalUtilityFunctions::_isOffset( $content['params']['TZID'] ) && ( 'Z' != $content['params']['TZID'] ))) { $offset = isset( $rDate['tz'] ) ? $rDate['tz'] : $content['params']['TZID']; $date = mktime( (int) $rDate['hour'], (int) $rDate['min'], (int) ($rDate['sec'] + iCalUtilityFunctions::_tz2offset( $offset )), (int) $rDate['month'], (int) $rDate['day'], (int) $rDate['year'] ); unset( $rDate['tz'] ); $rDate = iCalUtilityFunctions::_date_time_string( date( 'Ymd\THis\Z', $date ), 6 ); unset( $rDate['unparsedtext'] ); } } } unset( $content['params']['VALUE'] ); _addXMLchild( $properties, $prop, $type, $content['value'], $content['params'] ); } break; case 'categories': case 'comment': case 'contact': case 'description': case 'related-to': case 'resources': while( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) { if(( 'related-to' != $prop ) && !isset( $content['params']['LANGUAGE'] )) { if( $langComp ) $content['params']['LANGUAGE'] = $langComp; elseif( $langCal ) $content['params']['LANGUAGE'] = $langCal; } _addXMLchild( $properties, $prop, 'text', $content['value'], $content['params'] ); } break; case 'x-prop': while( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) _addXMLchild( $properties, $content[0], 'unknown', $content[1]['value'], $content[1]['params'] ); break; case 'created': // single occurence below, if set case 'completed': case 'dtstamp': case 'last-modified': $utcDate = TRUE; case 'dtstart': case 'dtend': case 'due': case 'recurrence-id': if( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) { if( isset( $content['params']['VALUE'] ) && ( 'DATE' == $content['params']['VALUE'] )) { $type = 'date'; unset( $content['value']['hour'], $content['value']['min'], $content['value']['sec'] ); } else { $type = 'date-time'; if( isset( $utcDate ) && !isset( $content['value']['tz'] )) $content['value']['tz'] = 'Z'; if( ( isset( $content['value']['tz'] ) && // fix UTC-date if offset set iCalUtilityFunctions::_isOffset( $content['value']['tz'] ) && ( 'Z' != $content['value']['tz'] )) || ( isset( $content['params']['TZID'] ) && iCalUtilityFunctions::_isOffset( $content['params']['TZID'] ) && ( 'Z' != $content['params']['TZID'] ))) { $offset = isset( $content['value']['tz'] ) ? $content['value']['tz'] : $content['params']['TZID']; $date = mktime( (int) $content['value']['hour'], (int) $content['value']['min'], (int) ($content['value']['sec'] + iCalUtilityFunctions::_tz2offset( $offset )), (int) $content['value']['month'], (int) $content['value']['day'], (int) $content['value']['year'] ); unset( $content['value']['tz'], $content['params']['TZID'] ); $content['value'] = iCalUtilityFunctions::_date_time_string( date( 'Ymd\THis\Z', $date ), 6 ); unset( $content['value']['unparsedtext'] ); } elseif( isset( $content['value']['tz'] ) && !empty( $content['value']['tz'] ) && ( 'Z' != $content['value']['tz'] ) && !isset( $content['params']['TZID'] )) { $content['params']['TZID'] = $content['value']['tz']; unset( $content['value']['tz'] ); } } unset( $content['params']['VALUE'] ); if(( isset( $content['params']['TZID'] ) && empty( $content['params']['TZID'] )) || @is_null( $content['params']['TZID'] )) unset( $content['params']['TZID'] ); _addXMLchild( $properties, $prop, $type, $content['value'], $content['params'] ); } unset( $utcDate ); break; case 'duration': if( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) _addXMLchild( $properties, $prop, 'duration', $content['value'], $content['params'] ); break; case 'rrule': while( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) _addXMLchild( $properties, $prop, 'recur', $content['value'], $content['params'] ); break; case 'class': case 'location': case 'status': case 'summary': case 'transp': case 'tzid': case 'uid': if( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) { if((( 'location' == $prop ) || ( 'summary' == $prop )) && !isset( $content['params']['LANGUAGE'] )) { if( $langComp ) $content['params']['LANGUAGE'] = $langComp; elseif( $langCal ) $content['params']['LANGUAGE'] = $langCal; } _addXMLchild( $properties, $prop, 'text', $content['value'], $content['params'] ); } break; case 'geo': if( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) _addXMLchild( $properties, $prop, 'geo', $content['value'], $content['params'] ); break; case 'organizer': if( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) { if( isset( $content['params']['CN'] ) && !isset( $content['params']['LANGUAGE'] )) { if( $langComp ) $content['params']['LANGUAGE'] = $langComp; elseif( $langCal ) $content['params']['LANGUAGE'] = $langCal; } _addXMLchild( $properties, $prop, 'cal-address', $content['value'], $content['params'] ); } break; case 'percent-complete': case 'priority': case 'sequence': if( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) _addXMLchild( $properties, $prop, 'integer', $content['value'], $content['params'] ); break; case 'tzurl': case 'url': if( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) _addXMLchild( $properties, $prop, 'uri', $content['value'], $content['params'] ); break; } // end switch( $prop ) } // end foreach( $props as $prop ) /** fix subComponent properties, if any */ foreach( $subComps as $subCompName ) { while( FALSE !== ( $subcomp = $component->getComponent( $subCompName ))) { $child2 = $child->addChild( $subCompName ); $properties = $child2->addChild( 'properties' ); $langComp = $subcomp->getConfig( 'language' ); foreach( $subCompProps as $prop ) { switch( $prop ) { case 'attach': // may occur multiple times, below while( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE ))) { $type = ( isset( $content['params']['VALUE'] ) && ( 'BINARY' == $content['params']['VALUE'] )) ? 'binary' : 'uri'; unset( $content['params']['VALUE'] ); _addXMLchild( $properties, $prop, $type, $content['value'], $content['params'] ); } break; case 'attendee': while( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE ))) { if( isset( $content['params']['CN'] ) && !isset( $content['params']['LANGUAGE'] )) { if( $langComp ) $content['params']['LANGUAGE'] = $langComp; elseif( $langCal ) $content['params']['LANGUAGE'] = $langCal; } _addXMLchild( $properties, $prop, 'cal-address', $content['value'], $content['params'] ); } break; case 'comment': case 'tzname': while( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE ))) { if( !isset( $content['params']['LANGUAGE'] )) { if( $langComp ) $content['params']['LANGUAGE'] = $langComp; elseif( $langCal ) $content['params']['LANGUAGE'] = $langCal; } _addXMLchild( $properties, $prop, 'text', $content['value'], $content['params'] ); } break; case 'rdate': while( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE ))) { $type = 'date-time'; if( isset( $content['params']['VALUE'] )) { if( 'DATE' == $content['params']['VALUE'] ) $type = 'date'; elseif( 'PERIOD' == $content['params']['VALUE'] ) $type = 'period'; } if( 'period' == $type ) { foreach( $content['value'] as & $rDates ) { if( ( isset( $rDates[0]['tz'] ) && // fix UTC-date if offset set iCalUtilityFunctions::_isOffset( $rDates[0]['tz'] ) && ( 'Z' != $rDates[0]['tz'] )) || ( isset( $content['params']['TZID'] ) && iCalUtilityFunctions::_isOffset( $content['params']['TZID'] ) && ( 'Z' != $content['params']['TZID'] ))) { $offset = isset( $rDates[0]['tz'] ) ? $rDates[0]['tz'] : $content['params']['TZID']; $date = mktime( (int) $rDates[0]['hour'], (int) $rDates[0]['min'], (int) ($rDates[0]['sec'] + iCalUtilityFunctions::_tz2offset( $offset )), (int) $rDates[0]['month'], (int) $rDates[0]['day'], (int) $rDates[0]['year'] ); unset( $rDates[0]['tz'] ); $rDates[0] = iCalUtilityFunctions::_date_time_string( date( 'Ymd\THis\Z', $date ), 6 ); unset( $rDates[0]['unparsedtext'] ); } if( isset( $rDates[1]['year'] )) { if( ( isset( $rDates[1]['tz'] ) && // fix UTC-date if offset set iCalUtilityFunctions::_isOffset( $rDates[1]['tz'] ) && ( 'Z' != $rDates[1]['tz'] )) || ( isset( $content['params']['TZID'] ) && iCalUtilityFunctions::_isOffset( $content['params']['TZID'] ) && ( 'Z' != $content['params']['TZID'] ))) { $offset = isset( $rDates[1]['tz'] ) ? $rDates[1]['tz'] : $content['params']['TZID']; $date = mktime( (int) $rDates[1]['hour'], (int) $rDates[1]['min'], (int) ($rDates[1]['sec'] + iCalUtilityFunctions::_tz2offset( $offset )), (int) $rDates[1]['month'], (int) $rDates[1]['day'], (int) $rDates[1]['year'] ); unset( $rDates[1]['tz'] ); $rDates[1] = iCalUtilityFunctions::_date_time_string( date( 'Ymd\THis\Z', $date ), 6 ); unset( $rDates[1]['unparsedtext'] ); } } } } elseif( 'date-time' == $type ) { foreach( $content['value'] as & $rDate ) { if( ( isset( $rDate['tz'] ) && // fix UTC-date if offset set iCalUtilityFunctions::_isOffset( $rDate['tz'] ) && ( 'Z' != $rDate['tz'] )) || ( isset( $content['params']['TZID'] ) && iCalUtilityFunctions::_isOffset( $content['params']['TZID'] ) && ( 'Z' != $content['params']['TZID'] ))) { $offset = isset( $rDate['tz'] ) ? $rDate['tz'] : $content['params']['TZID']; $date = mktime( (int) $rDate['hour'], (int) $rDate['min'], (int) ($rDate['sec'] + iCalUtilityFunctions::_tz2offset( $offset )), (int) $rDate['month'], (int) $rDate['day'], (int) $rDate['year'] ); unset( $rDate['tz'] ); $rDate = iCalUtilityFunctions::_date_time_string( date( 'Ymd\THis\Z', $date ), 6 ); unset( $rDate['unparsedtext'] ); } } } unset( $content['params']['VALUE'] ); _addXMLchild( $properties, $prop, $type, $content['value'], $content['params'] ); } break; case 'x-prop': while( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE ))) _addXMLchild( $properties, $content[0], 'unknown', $content[1]['value'], $content[1]['params'] ); break; case 'action': // single occurence below, if set case 'description': case 'summary': if( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE ))) { if(( 'action' != $prop ) && !isset( $content['params']['LANGUAGE'] )) { if( $langComp ) $content['params']['LANGUAGE'] = $langComp; elseif( $langCal ) $content['params']['LANGUAGE'] = $langCal; } _addXMLchild( $properties, $prop, 'text', $content['value'], $content['params'] ); } break; case 'dtstart': if( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE ))) { unset( $content['value']['tz'], $content['params']['VALUE'] ); // always local time _addXMLchild( $properties, $prop, 'date-time', $content['value'], $content['params'] ); } break; case 'duration': if( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE ))) _addXMLchild( $properties, $prop, 'duration', $content['value'], $content['params'] ); break; case 'repeat': if( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE ))) _addXMLchild( $properties, $prop, 'integer', $content['value'], $content['params'] ); break; case 'trigger': if( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE ))) { if( isset( $content['value']['year'] ) && isset( $content['value']['month'] ) && isset( $content['value']['day'] )) $type = 'date-time'; else $type = 'duration'; _addXMLchild( $properties, $prop, $type, $content['value'], $content['params'] ); } break; case 'tzoffsetto': case 'tzoffsetfrom': if( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE ))) _addXMLchild( $properties, $prop, 'utc-offset', $content['value'], $content['params'] ); break; case 'rrule': while( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE ))) _addXMLchild( $properties, $prop, 'recur', $content['value'], $content['params'] ); break; } // switch( $prop ) } // end foreach( $subCompProps as $prop ) } // end while( FALSE !== ( $subcomp = $component->getComponent( subCompName ))) } // end foreach( $subCombs as $subCompName ) } // end while( FALSE !== ( $component = $calendar->getComponent( $compName ))) } // end foreach( $comps as $compName) return $xml->asXML(); } /** * Add children to a SimpleXMLelement * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.11.1 - 2012-01-16 * @param object $parent, reference to a SimpleXMLelement node * @param string $name, new element node name * @param string $type, content type, subelement(-s) name * @param string $content, new subelement content * @param array $params, new element 'attributes' * @return void */ function _addXMLchild( & $parent, $name, $type, $content, $params=array()) { /** create new child node */ $child = $parent->addChild( strtolower( $name )); /** fix attributes */ if( is_array( $content ) && isset( $content['fbtype'] )) { $params['FBTYPE'] = $content['fbtype']; unset( $content['fbtype'] ); } if( isset( $params['VALUE'] )) unset( $params['VALUE'] ); if(( 'trigger' == $name ) && ( 'duration' == $type ) && ( TRUE !== $content['relatedStart'] )) $params['RELATED'] = 'END'; if( !empty( $params )) { $parameters = $child->addChild( 'parameters' ); foreach( $params as $param => $parVal ) { $param = strtolower( $param ); if( 'x-' == substr( $param, 0, 2 )) { $p1 = $parameters->addChild( $param ); $p2 = $p1->addChild( 'unknown', htmlspecialchars( $parVal )); } else { $p1 = $parameters->addChild( $param ); switch( $param ) { case 'altrep': case 'dir': $ptype = 'uri'; break; case 'delegated-from': case 'delegated-to': case 'member': case 'sent-by': $ptype = 'cal-address'; break; case 'rsvp': $ptype = 'boolean'; break ; default: $ptype = 'text'; break; } if( is_array( $parVal )) { foreach( $parVal as $pV ) $p2 = $p1->addChild( $ptype, htmlspecialchars( $pV )); } else $p2 = $p1->addChild( $ptype, htmlspecialchars( $parVal )); } } } if( empty( $content ) && ( '0' != $content )) return; /** store content */ switch( $type ) { case 'binary': $v = $child->addChild( $type, $content ); break; case 'boolean': break; case 'cal-address': $v = $child->addChild( $type, $content ); break; case 'date': if( array_key_exists( 'year', $content )) $content = array( $content ); foreach( $content as $date ) { $str = sprintf( '%04d-%02d-%02d', $date['year'], $date['month'], $date['day'] ); $v = $child->addChild( $type, $str ); } break; case 'date-time': if( array_key_exists( 'year', $content )) $content = array( $content ); foreach( $content as $dt ) { if( !isset( $dt['hour'] )) $dt['hour'] = 0; if( !isset( $dt['min'] )) $dt['min'] = 0; if( !isset( $dt['sec'] )) $dt['sec'] = 0; $str = sprintf( '%04d-%02d-%02dT%02d:%02d:%02d', $dt['year'], $dt['month'], $dt['day'], $dt['hour'], $dt['min'], $dt['sec'] ); if( isset( $dt['tz'] ) && ( 'Z' == $dt['tz'] )) $str .= 'Z'; $v = $child->addChild( $type, $str ); } break; case 'duration': $output = (( 'trigger' == $name ) && ( FALSE !== $content['before'] )) ? '-' : ''; $v = $child->addChild( $type, $output.iCalUtilityFunctions::_format_duration( $content ) ); break; case 'geo': $v1 = $child->addChild( 'latitude', number_format( (float) $content['latitude'], 6, '.', '' )); $v1 = $child->addChild( 'longitude', number_format( (float) $content['longitude'], 6, '.', '' )); break; case 'integer': $v = $child->addChild( $type, $content ); break; case 'period': if( !is_array( $content )) break; foreach( $content as $period ) { $v1 = $child->addChild( $type ); $str = sprintf( '%04d-%02d-%02dT%02d:%02d:%02d', $period[0]['year'], $period[0]['month'], $period[0]['day'], $period[0]['hour'], $period[0]['min'], $period[0]['sec'] ); if( isset( $period[0]['tz'] ) && ( 'Z' == $period[0]['tz'] )) $str .= 'Z'; $v2 = $v1->addChild( 'start', $str ); if( array_key_exists( 'year', $period[1] )) { $str = sprintf( '%04d-%02d-%02dT%02d:%02d:%02d', $period[1]['year'], $period[1]['month'], $period[1]['day'], $period[1]['hour'], $period[1]['min'], $period[1]['sec'] ); if( isset($period[1]['tz'] ) && ( 'Z' == $period[1]['tz'] )) $str .= 'Z'; $v2 = $v1->addChild( 'end', $str ); } else $v2 = $v1->addChild( 'duration', iCalUtilityFunctions::_format_duration( $period[1] )); } break; case 'recur': foreach( $content as $rulelabel => $rulevalue ) { $rulelabel = strtolower( $rulelabel ); switch( $rulelabel ) { case 'until': if( isset( $rulevalue['hour'] )) $str = sprintf( '%04d-%02d-%02dT%02d:%02d:%02dZ', $rulevalue['year'], $rulevalue['month'], $rulevalue['day'], $rulevalue['hour'], $rulevalue['min'], $rulevalue['sec'] ); else $str = sprintf( '%04d-%02d-%02d', $rulevalue['year'], $rulevalue['month'], $rulevalue['day'] ); $v = $child->addChild( $rulelabel, $str ); break; case 'bysecond': case 'byminute': case 'byhour': case 'bymonthday': case 'byyearday': case 'byweekno': case 'bymonth': case 'bysetpos': { if( is_array( $rulevalue )) { foreach( $rulevalue as $vix => $valuePart ) $v = $child->addChild( $rulelabel, $valuePart ); } else $v = $child->addChild( $rulelabel, $rulevalue ); break; } case 'byday': { if( isset( $rulevalue['DAY'] )) { $str = ( isset( $rulevalue[0] )) ? $rulevalue[0] : ''; $str .= $rulevalue['DAY']; $p = $child->addChild( $rulelabel, $str ); } else { foreach( $rulevalue as $valuePart ) { if( isset( $valuePart['DAY'] )) { $str = ( isset( $valuePart[0] )) ? $valuePart[0] : ''; $str .= $valuePart['DAY']; $p = $child->addChild( $rulelabel, $str ); } else $p = $child->addChild( $rulelabel, $valuePart ); } } break; } case 'freq': case 'count': case 'interval': case 'wkst': default: $p = $child->addChild( $rulelabel, $rulevalue ); break; } // end switch( $rulelabel ) } // end foreach( $content as $rulelabel => $rulevalue ) break; case 'rstatus': $v = $child->addChild( 'code', number_format( (float) $content['statcode'], 2, '.', '')); $v = $child->addChild( 'description', htmlspecialchars( $content['text'] )); if( isset( $content['extdata'] )) $v = $child->addChild( 'data', htmlspecialchars( $content['extdata'] )); break; case 'text': if( !is_array( $content )) $content = array( $content ); foreach( $content as $part ) $v = $child->addChild( $type, htmlspecialchars( $part )); break; case 'time': break; case 'uri': $v = $child->addChild( $type, $content ); break; case 'utc-offset': if( in_array( substr( $content, 0, 1 ), array( '-', '+' ))) { $str = substr( $content, 0, 1 ); $content = substr( $content, 1 ); } else $str = '+'; $str .= substr( $content, 0, 2 ).':'.substr( $content, 2, 2 ); if( 4 < strlen( $content )) $str .= ':'.substr( $content, 4 ); $v = $child->addChild( $type, $str ); break; case 'unknown': default: if( is_array( $content )) $content = implode( '', $content ); $v = $child->addChild( 'unknown', htmlspecialchars( $content )); break; } } /** * parse xml string into iCalcreator instance * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.11.2 - 2012-01-31 * @param string $xmlstr * @param array $iCalcfg iCalcreator config array (opt) * @return mixed iCalcreator instance or FALSE on error */ function & XMLstr2iCal( $xmlstr, $iCalcfg=array()) { libxml_use_internal_errors( TRUE ); $xml = simplexml_load_string( $xmlstr ); if( !$xml ) { $str = ''; $return = FALSE; foreach( libxml_get_errors() as $error ) { switch ( $error->level ) { case LIBXML_ERR_FATAL: $str .= ' FATAL '; break; case LIBXML_ERR_ERROR: $str .= ' ERROR '; break; case LIBXML_ERR_WARNING: default: $str .= ' WARNING '; break; } $str .= PHP_EOL.'Error when loading XML'; if( !empty( $error->file )) $str .= ', file:'.$error->file.', '; $str .= ', line:'.$error->line; $str .= ', ('.$error->code.') '.$error->message; } error_log( $str ); if( LIBXML_ERR_WARNING != $error->level ) return $return; libxml_clear_errors(); } return xml2iCal( $xml, $iCalcfg ); } /** * parse xml file into iCalcreator instance * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.11.2 - 2012-01-20 * @param string $xmlfile * @param array$iCalcfg iCalcreator config array (opt) * @return mixediCalcreator instance or FALSE on error */ function & XMLfile2iCal( $xmlfile, $iCalcfg=array()) { libxml_use_internal_errors( TRUE ); $xml = simplexml_load_file( $xmlfile ); if( !$xml ) { $str = ''; foreach( libxml_get_errors() as $error ) { switch ( $error->level ) { case LIBXML_ERR_FATAL: $str .= 'FATAL '; break; case LIBXML_ERR_ERROR: $str .= 'ERROR '; break; case LIBXML_ERR_WARNING: default: $str .= 'WARNING '; break; } $str .= 'Failed loading XML'.PHP_EOL; if( !empty( $error->file )) $str .= ' file:'.$error->file.', '; $str .= 'line:'.$error->line.PHP_EOL; $str .= '('.$error->code.') '.$error->message.PHP_EOL; } error_log( $str ); if( LIBXML_ERR_WARNING != $error->level ) return FALSE; libxml_clear_errors(); } return xml2iCal( $xml, $iCalcfg ); } /** * parse SimpleXMLElement instance into iCalcreator instance * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.11.2 - 2012-01-27 * @param object $xmlobj SimpleXMLElement * @param array $iCalcfg iCalcreator config array (opt) * @return mixed iCalcreator instance or FALSE on error */ function & XML2iCal( $xmlobj, $iCalcfg=array()) { $iCal = new vcalendar( $iCalcfg ); foreach( $xmlobj->children() as $icalendar ) { // vcalendar foreach( $icalendar->children() as $calPart ) { // calendar properties and components if( 'components' == $calPart->getName()) { foreach( $calPart->children() as $component ) { // single components if( 0 < $component->count()) _getXMLComponents( $iCal, $component ); } } elseif(( 'properties' == $calPart->getName()) && ( 0 < $calPart->count())) { foreach( $calPart->children() as $calProp ) { // calendar properties $propName = $calProp->getName(); if(( 'calscale' != $propName ) && ( 'method' != $propName ) && ( 'x-' != substr( $propName,0,2 ))) continue; $params = array(); foreach( $calProp->children() as $calPropElem ) { // single calendar property if( 'parameters' == $calPropElem->getName()) $params = _getXMLParams( $calPropElem ); else $iCal->setProperty( $propName, reset( $calPropElem ), $params ); } // end foreach( $calProp->children() as $calPropElem ) } // end foreach( $calPart->properties->children() as $calProp ) } // end if( 0 < $calPart->properties->count()) } // end foreach( $icalendar->children() as $calPart ) } // end foreach( $xmlobj->children() as $icalendar ) return $iCal; } /** * parse SimpleXMLElement instance property parameters and return iCalcreator property parameter array * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.11.2 - 2012-01-15 * @param object $parameters SimpleXMLElement * @return array iCalcreator property parameter array */ function _getXMLParams( & $parameters ) { if( 1 > $parameters->count()) return array(); $params = array(); foreach( $parameters->children() as $parameter ) { // single parameter key $key = strtoupper( $parameter->getName()); $value = array(); foreach( $parameter->children() as $paramValue ) // skip parameter value type $value[] = reset( $paramValue ); if( 2 > count( $value )) $params[$key] = html_entity_decode( reset( $value )); else $params[$key] = $value; } return $params; } /** * parse SimpleXMLElement instance components, create iCalcreator component and update * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.11.2 - 2012-01-15 * @param array $iCal iCalcreator calendar instance * @param object $component SimpleXMLElement * @return void */ function _getXMLComponents( & $iCal, & $component ) { $compName = $component->getName(); $comp = & $iCal->newComponent( $compName ); $subComponents = array( 'valarm', 'standard', 'daylight' ); foreach( $component->children() as $compPart ) { // properties and (opt) subComponents if( 1 > $compPart->count()) continue; if( in_array( $compPart->getName(), $subComponents )) _getXMLComponents( $comp, $compPart ); elseif( 'properties' == $compPart->getName()) { foreach( $compPart->children() as $property ) // properties as single property _getXMLProperties( $comp, $property ); } } // end foreach( $component->children() as $compPart ) } /** * parse SimpleXMLElement instance property, create iCalcreator component property * * @author Kjell-Inge Gustafsson, kigkonsult * @since 2.11.2 - 2012-01-27 * @param array $iCal iCalcreator calendar instance * @param object $component SimpleXMLElement * @return void */ function _getXMLProperties( & $iCal, & $property ) { $propName = $property->getName(); $value = $params = array(); $valueType = ''; foreach( $property->children() as $propPart ) { // calendar property parameters (opt) and value(-s) $valueType = $propPart->getName(); if( 'parameters' == $valueType) { $params = _getXMLParams( $propPart ); continue; } switch( $valueType ) { case 'binary': $value = reset( $propPart ); break; case 'boolean': break; case 'cal-address': $value = reset( $propPart ); break; case 'date': $params['VALUE'] = 'DATE'; case 'date-time': if(( 'exdate' == $propName ) || ( 'rdate' == $propName )) $value[] = reset( $propPart ); else $value = reset( $propPart ); break; case 'duration': $value = reset( $propPart ); break; // case 'geo': case 'latitude': case 'longitude': $value[$valueType] = reset( $propPart ); break; case 'integer': $value = reset( $propPart ); break; case 'period': if( 'rdate' == $propName ) $params['VALUE'] = 'PERIOD'; $pData = array(); foreach( $propPart->children() as $periodPart ) $pData[] = reset( $periodPart ); if( !empty( $pData )) $value[] = $pData; break; // case 'rrule': case 'freq': case 'count': case 'until': case 'interval': case 'wkst': $value[$valueType] = reset( $propPart ); break; case 'bysecond': case 'byminute': case 'byhour': case 'bymonthday': case 'byyearday': case 'byweekno': case 'bymonth': case 'bysetpos': $value[$valueType][] = reset( $propPart ); break; case 'byday': $byday = reset( $propPart ); if( 2 == strlen( $byday )) $value[$valueType][] = array( 'DAY' => $byday ); else { $day = substr( $byday, -2 ); $key = substr( $byday, 0, ( strlen( $byday ) - 2 )); $value[$valueType][] = array( $key, 'DAY' => $day ); } break; // case 'rstatus': case 'code': $value[0] = reset( $propPart ); break; case 'description': $value[1] = reset( $propPart ); break; case 'data': $value[2] = reset( $propPart ); break; case 'text': $text = str_replace( array( "\r\n", "\n\r", "\r", "\n"), '\n', reset( $propPart )); $value['text'][] = html_entity_decode( $text ); break; case 'time': break; case 'uri': $value = reset( $propPart ); break; case 'utc-offset': $value = str_replace( ':', '', reset( $propPart )); break; case 'unknown': default: $value = html_entity_decode( reset( $propPart )); break; } // end switch( $valueType ) } // end foreach( $property->children() as $propPart ) if( 'freebusy' == $propName ) { $fbtype = $params['FBTYPE']; unset( $params['FBTYPE'] ); $iCal->setProperty( $propName, $fbtype, $value, $params ); } elseif( 'geo' == $propName ) $iCal->setProperty( $propName, $value['latitude'], $value['longitude'], $params ); elseif( 'request-status' == $propName ) { if( !isset( $value[2] )) $value[2] = FALSE; $iCal->setProperty( $propName, $value[0], $value[1], $value[2], $params ); } else { if( isset( $value['text'] ) && is_array( $value['text'] )) { if(( 'categories' == $propName ) || ( 'resources' == $propName )) $value = $value['text']; else $value = reset( $value['text'] ); } $iCal->setProperty( $propName, $value, $params ); } } /** * Additional functions to use with vtimezone components * For use with * iCalcreator (kigkonsult.se/iCalcreator/index.php) * copyright (c) 2011 Yitzchok Lavi * icalcreator@onebigsystem.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * Additional functions to use with vtimezone components * * Before calling the functions, set time zone 'GMT' ('date_default_timezone_set')! * * @author Yitzchok Lavi * adjusted for iCalcreator Kjell-Inge Gustafsson, kigkonsult * @version 1.0.2 - 2011-02-24 * */ /** * Returns array with the offset information from UTC for a (UTC) datetime/timestamp in the * timezone, according to the VTIMEZONE information in the input array. * * $param array $timezonesarray, output from function getTimezonesAsDateArrays (below) * $param string $tzid, time zone identifier * $param mixed $timestamp, timestamp or a UTC datetime (in array format) * @return array, time zone data with keys for 'offsetHis', 'offsetSec' and 'tzname' * */ function getTzOffsetForDate($timezonesarray, $tzid, $timestamp) { if( is_array( $timestamp )) { //$disp = sprintf( '%04d%02d%02d %02d%02d%02d', $timestamp['year'], $timestamp['month'], $timestamp['day'], $timestamp['hour'], $timestamp['min'], $timestamp['sec'] ); // test ### $timestamp = gmmktime( $timestamp['hour'], $timestamp['min'], $timestamp['sec'], $timestamp['month'], $timestamp['day'], $timestamp['year'] ) ; //echo ' '."\n".' '.$timestamp.''.$disp.' '."\n".' '; // test ### } $tzoffset = array(); // something to return if all goes wrong (such as if $tzid doesn't find us an array of dates) $tzoffset['offsetHis'] = '+0000'; $tzoffset['offsetSec'] = 0; $tzoffset['tzname'] = '?'; if( !isset( $timezonesarray[$tzid] )) return $tzoffset; $tzdatearray = $timezonesarray[$tzid]; if ( is_array($tzdatearray) ) { sort($tzdatearray); // just in case if ( $timestamp < $tzdatearray[0]['timestamp'] ) { // our date is before the first change $tzoffset['offsetHis'] = $tzdatearray[0]['tzbefore']['offsetHis'] ; $tzoffset['offsetSec'] = $tzdatearray[0]['tzbefore']['offsetSec'] ; $tzoffset['tzname'] = $tzdatearray[0]['tzbefore']['offsetHis'] ; // we don't know the tzname in this case } elseif ( $timestamp >= $tzdatearray[count($tzdatearray)-1]['timestamp'] ) { // our date is after the last change (we do this so our scan can stop at the last record but one) $tzoffset['offsetHis'] = $tzdatearray[count($tzdatearray)-1]['tzafter']['offsetHis'] ; $tzoffset['offsetSec'] = $tzdatearray[count($tzdatearray)-1]['tzafter']['offsetSec'] ; $tzoffset['tzname'] = $tzdatearray[count($tzdatearray)-1]['tzafter']['tzname'] ; } else { // our date somewhere in between // loop through the list of dates and stop at the one where the timestamp is before our date and the next one is after it // we don't include the last date in our loop as there isn't one after it to check for ( $i = 0 ; $i <= count($tzdatearray)-2 ; $i++ ) { if(( $timestamp >= $tzdatearray[$i]['timestamp'] ) && ( $timestamp < $tzdatearray[$i+1]['timestamp'] )) { $tzoffset['offsetHis'] = $tzdatearray[$i]['tzafter']['offsetHis'] ; $tzoffset['offsetSec'] = $tzdatearray[$i]['tzafter']['offsetSec'] ; $tzoffset['tzname'] = $tzdatearray[$i]['tzafter']['tzname'] ; break; } } } } return $tzoffset; } /** * Returns an array containing all the timezone data in the vcalendar object * * @param object $vcalendar, iCalcreator calendar instance * @return array, time zone transition timestamp, array before(offsetHis, offsetSec), array after(offsetHis, offsetSec, tzname) * based on the timezone data in the vcalendar object * */ function getTimezonesAsDateArrays($vcalendar) { $timezonedata = array(); while( $vtz = $vcalendar->getComponent( 'vtimezone' )) { $tzid = $vtz->getProperty('tzid'); $alltzdates = array(); while ( $vtzc = $vtz->getComponent( 'standard' )) { $newtzdates = expandTimezoneDates($vtzc); $alltzdates = array_merge($alltzdates, $newtzdates); } while ( $vtzc = $vtz->getComponent( 'daylight' )) { $newtzdates = expandTimezoneDates($vtzc); $alltzdates = array_merge($alltzdates, $newtzdates); } sort($alltzdates); $timezonedata[$tzid] = $alltzdates; } return $timezonedata; } /** * Returns an array containing time zone data from vtimezone standard/daylight instances * * @param object $vtzc, an iCalcreator calendar standard/daylight instance * @return array, time zone data; array before(offsetHis, offsetSec), array after(offsetHis, offsetSec, tzname) * */ function expandTimezoneDates($vtzc) { $tzdates = array(); // prepare time zone "description" to attach to each change $tzbefore = array(); $tzbefore['offsetHis'] = $vtzc->getProperty('tzoffsetfrom') ; $tzbefore['offsetSec'] = iCalUtilityFunctions::_tz2offset($tzbefore['offsetHis']); if(( '-' != substr( (string) $tzbefore['offsetSec'], 0, 1 )) && ( '+' != substr( (string) $tzbefore['offsetSec'], 0, 1 ))) $tzbefore['offsetSec'] = '+'.$tzbefore['offsetSec']; $tzafter = array(); $tzafter['offsetHis'] = $vtzc->getProperty('tzoffsetto') ; $tzafter['offsetSec'] = iCalUtilityFunctions::_tz2offset($tzafter['offsetHis']); if(( '-' != substr( (string) $tzafter['offsetSec'], 0, 1 )) && ( '+' != substr( (string) $tzafter['offsetSec'], 0, 1 ))) $tzafter['offsetSec'] = '+'.$tzafter['offsetSec']; if( FALSE === ( $tzafter['tzname'] = $vtzc->getProperty('tzname'))) $tzafter['tzname'] = $tzafter['offsetHis']; // find out where to start from $dtstart = $vtzc->getProperty('dtstart'); $dtstarttimestamp = mktime( $dtstart['hour'], $dtstart['min'], $dtstart['sec'], $dtstart['month'], $dtstart['day'], $dtstart['year'] ) ; if( !isset( $dtstart['unparsedtext'] )) // ?? $dtstart['unparsedtext'] = sprintf( '%04d%02d%02dT%02d%02d%02d', $dtstart['year'], $dtstart['month'], $dtstart['day'], $dtstart['hour'], $dtstart['min'], $dtstart['sec'] ); if ( $dtstarttimestamp == 0 ) { // it seems that the dtstart string may not have parsed correctly // let's set a timestamp starting from 1902, using the time part of the original string // so that the time will change at the right time of day // at worst we'll get midnight again $origdtstartsplit = explode('T',$dtstart['unparsedtext']) ; $dtstarttimestamp = strtotime("19020101",0); $dtstarttimestamp = strtotime($origdtstartsplit[1],$dtstarttimestamp); } // the date (in dtstart and opt RDATE/RRULE) is ALWAYS LOCAL (not utc!!), adjust from 'utc' to 'local' timestamp $diff = -1 * $tzbefore['offsetSec']; $dtstarttimestamp += $diff; // add this (start) change to the array of changes $tzdates[] = array( 'timestamp' => $dtstarttimestamp, 'tzbefore' => $tzbefore, 'tzafter' => $tzafter ); $datearray = getdate($dtstarttimestamp); // save original array to use time parts, because strtotime (used below) apparently loses the time $changetime = $datearray ; // generate dates according to an RRULE line $rrule = $vtzc->getProperty('rrule') ; if ( is_array($rrule) ) { if ( $rrule['FREQ'] == 'YEARLY' ) { // calculate transition dates starting from DTSTART $offsetchangetimestamp = $dtstarttimestamp; // calculate transition dates until 10 years in the future $stoptimestamp = strtotime("+10 year",time()); // if UNTIL is set, calculate until then (however far ahead) if ( isset( $rrule['UNTIL'] ) && ( $rrule['UNTIL'] != '' )) { $stoptimestamp = mktime( $rrule['UNTIL']['hour'], $rrule['UNTIL']['min'], $rrule['UNTIL']['sec'], $rrule['UNTIL']['month'], $rrule['UNTIL']['day'], $rrule['UNTIL']['year'] ) ; } $count = 0 ; $stopcount = isset( $rrule['COUNT'] ) ? $rrule['COUNT'] : 0 ; $daynames = array( 'SU' => 'Sunday', 'MO' => 'Monday', 'TU' => 'Tuesday', 'WE' => 'Wednesday', 'TH' => 'Thursday', 'FR' => 'Friday', 'SA' => 'Saturday' ); // repeat so long as we're between DTSTART and UNTIL, or we haven't prepared COUNT dates while ( $offsetchangetimestamp < $stoptimestamp && ( $stopcount == 0 || $count < $stopcount ) ) { // break up the timestamp into its parts $datearray = getdate($offsetchangetimestamp); if ( isset( $rrule['BYMONTH'] ) && ( $rrule['BYMONTH'] != 0 )) { // set the month $datearray['mon'] = $rrule['BYMONTH'] ; } if ( isset( $rrule['BYMONTHDAY'] ) && ( $rrule['BYMONTHDAY'] != 0 )) { // set specific day of month $datearray['mday'] = $rrule['BYMONTHDAY']; } elseif ( is_array($rrule['BYDAY']) ) { // find the Xth WKDAY in the month // the starting point for this process is the first of the month set above $datearray['mday'] = 1 ; // turn $datearray as it is now back into a timestamp $offsetchangetimestamp = mktime( $datearray['hours'], $datearray['minutes'], $datearray['seconds'], $datearray['mon'], $datearray['mday'], $datearray['year'] ); if ($rrule['BYDAY'][0] > 0) { // to find Xth WKDAY in month, we find last WKDAY in month before // we do that by finding first WKDAY in this month and going back one week // then we add X weeks (below) $offsetchangetimestamp = strtotime($daynames[$rrule['BYDAY']['DAY']],$offsetchangetimestamp); $offsetchangetimestamp = strtotime("-1 week",$offsetchangetimestamp); } else { // to find Xth WKDAY before the end of the month, we find the first WKDAY in the following month // we do that by going forward one month and going to WKDAY there // then we subtract X weeks (below) $offsetchangetimestamp = strtotime("+1 month",$offsetchangetimestamp); $offsetchangetimestamp = strtotime($daynames[$rrule['BYDAY']['DAY']],$offsetchangetimestamp); } // now move forward or back the appropriate number of weeks, into the month we want $offsetchangetimestamp = strtotime($rrule['BYDAY'][0] . " week",$offsetchangetimestamp); $datearray = getdate($offsetchangetimestamp); } // convert the date parts back into a timestamp, setting the time parts according to the // original time data which we stored $offsetchangetimestamp = mktime( $changetime['hours'], $changetime['minutes'], $changetime['seconds'] + $diff, $datearray['mon'], $datearray['mday'], $datearray['year'] ); // add this change to the array of changes $tzdates[] = array( 'timestamp' => $offsetchangetimestamp, 'tzbefore' => $tzbefore, 'tzafter' => $tzafter ); // update counters (timestamp and count) $offsetchangetimestamp = strtotime("+" . (( isset( $rrule['INTERVAL'] ) && ( $rrule['INTERVAL'] != 0 )) ? $rrule['INTERVAL'] : 1 ) . " year",$offsetchangetimestamp); $count += 1 ; } } } // generate dates according to RDATE lines while ($rdates = $vtzc->getProperty('rdate')) { if ( is_array($rdates) ) { foreach ( $rdates as $rdate ) { // convert the explicit change date to a timestamp $offsetchangetimestamp = mktime( $rdate['hour'], $rdate['min'], $rdate['sec'] + $diff, $rdate['month'], $rdate['day'], $rdate['year'] ) ; // add this change to the array of changes $tzdates[] = array( 'timestamp' => $offsetchangetimestamp, 'tzbefore' => $tzbefore, 'tzafter' => $tzafter ); } } } return $tzdates; } ?> glpi-0.84.3+dfsg.1/lib/icalcreator/lgpl.txt000066400000000000000000000635041226600447100203660ustar00rootroot00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! glpi-0.84.3+dfsg.1/lib/index.php000066400000000000000000000022431226600447100162100ustar00rootroot00000000000000 glpi-0.84.3+dfsg.1/lib/phpcas/000077500000000000000000000000001226600447100156455ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/phpcas/CAS.php000066400000000000000000002145071226600447100167750ustar00rootroot00000000000000 * @author Olivier Berger * @author Brett Bieber * @author Joachim Fritschi * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS * @ingroup public */ // // hack by Vangelis Haniotakis to handle the absence of $_SERVER['REQUEST_URI'] // in IIS // if (php_sapi_name() != 'cli') { if (!isset($_SERVER['REQUEST_URI'])) { $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING']; } } // Add a E_USER_DEPRECATED for php versions <= 5.2 if (!defined('E_USER_DEPRECATED')) { define('E_USER_DEPRECATED', E_USER_NOTICE); } // ######################################################################## // CONSTANTS // ######################################################################## // ------------------------------------------------------------------------ // CAS VERSIONS // ------------------------------------------------------------------------ /** * phpCAS version. accessible for the user by phpCAS::getVersion(). */ define('PHPCAS_VERSION', '1.3.2'); /** * @addtogroup public * @{ */ /** * CAS version 1.0 */ define("CAS_VERSION_1_0", '1.0'); /*! * CAS version 2.0 */ define("CAS_VERSION_2_0", '2.0'); // ------------------------------------------------------------------------ // SAML defines // ------------------------------------------------------------------------ /** * SAML protocol */ define("SAML_VERSION_1_1", 'S1'); /** * XML header for SAML POST */ define("SAML_XML_HEADER", ''); /** * SOAP envelope for SAML POST */ define("SAML_SOAP_ENV", ''); /** * SOAP body for SAML POST */ define("SAML_SOAP_BODY", ''); /** * SAMLP request */ define("SAMLP_REQUEST", ''); define("SAMLP_REQUEST_CLOSE", ''); /** * SAMLP artifact tag (for the ticket) */ define("SAML_ASSERTION_ARTIFACT", ''); /** * SAMLP close */ define("SAML_ASSERTION_ARTIFACT_CLOSE", ''); /** * SOAP body close */ define("SAML_SOAP_BODY_CLOSE", ''); /** * SOAP envelope close */ define("SAML_SOAP_ENV_CLOSE", ''); /** * SAML Attributes */ define("SAML_ATTRIBUTES", 'SAMLATTRIBS'); /** @} */ /** * @addtogroup publicPGTStorage * @{ */ // ------------------------------------------------------------------------ // FILE PGT STORAGE // ------------------------------------------------------------------------ /** * Default path used when storing PGT's to file */ define("CAS_PGT_STORAGE_FILE_DEFAULT_PATH", session_save_path()); /** @} */ // ------------------------------------------------------------------------ // SERVICE ACCESS ERRORS // ------------------------------------------------------------------------ /** * @addtogroup publicServices * @{ */ /** * phpCAS::service() error code on success */ define("PHPCAS_SERVICE_OK", 0); /** * phpCAS::service() error code when the PT could not retrieve because * the CAS server did not respond. */ define("PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE", 1); /** * phpCAS::service() error code when the PT could not retrieve because * the response of the CAS server was ill-formed. */ define("PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE", 2); /** * phpCAS::service() error code when the PT could not retrieve because * the CAS server did not want to. */ define("PHPCAS_SERVICE_PT_FAILURE", 3); /** * phpCAS::service() error code when the service was not available. */ define("PHPCAS_SERVICE_NOT_AVAILABLE", 4); // ------------------------------------------------------------------------ // SERVICE TYPES // ------------------------------------------------------------------------ /** * phpCAS::getProxiedService() type for HTTP GET */ define("PHPCAS_PROXIED_SERVICE_HTTP_GET", 'CAS_ProxiedService_Http_Get'); /** * phpCAS::getProxiedService() type for HTTP POST */ define("PHPCAS_PROXIED_SERVICE_HTTP_POST", 'CAS_ProxiedService_Http_Post'); /** * phpCAS::getProxiedService() type for IMAP */ define("PHPCAS_PROXIED_SERVICE_IMAP", 'CAS_ProxiedService_Imap'); /** @} */ // ------------------------------------------------------------------------ // LANGUAGES // ------------------------------------------------------------------------ /** * @addtogroup publicLang * @{ */ define("PHPCAS_LANG_ENGLISH", 'CAS_Languages_English'); define("PHPCAS_LANG_FRENCH", 'CAS_Languages_French'); define("PHPCAS_LANG_GREEK", 'CAS_Languages_Greek'); define("PHPCAS_LANG_GERMAN", 'CAS_Languages_German'); define("PHPCAS_LANG_JAPANESE", 'CAS_Languages_Japanese'); define("PHPCAS_LANG_SPANISH", 'CAS_Languages_Spanish'); define("PHPCAS_LANG_CATALAN", 'CAS_Languages_Catalan'); /** @} */ /** * @addtogroup internalLang * @{ */ /** * phpCAS default language (when phpCAS::setLang() is not used) */ define("PHPCAS_LANG_DEFAULT", PHPCAS_LANG_ENGLISH); /** @} */ // ------------------------------------------------------------------------ // DEBUG // ------------------------------------------------------------------------ /** * @addtogroup publicDebug * @{ */ /** * The default directory for the debug file under Unix. */ define('DEFAULT_DEBUG_DIR', '/tmp/'); /** @} */ // include the class autoloader require_once dirname(__FILE__) . '/CAS/Autoload.php'; /** * The phpCAS class is a simple container for the phpCAS library. It provides CAS * authentication for web applications written in PHP. * * @ingroup public * @class phpCAS * @category Authentication * @package PhpCAS * @author Pascal Aubry * @author Olivier Berger * @author Brett Bieber * @author Joachim Fritschi * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ class phpCAS { /** * This variable is used by the interface class phpCAS. * * @hideinitializer */ private static $_PHPCAS_CLIENT; /** * This variable is used to store where the initializer is called from * (to print a comprehensive error in case of multiple calls). * * @hideinitializer */ private static $_PHPCAS_INIT_CALL; /** * This variable is used to store phpCAS debug mode. * * @hideinitializer */ private static $_PHPCAS_DEBUG; // ######################################################################## // INITIALIZATION // ######################################################################## /** * @addtogroup publicInit * @{ */ /** * phpCAS client initializer. * * @param string $server_version the version of the CAS server * @param string $server_hostname the hostname of the CAS server * @param string $server_port the port the CAS server is running on * @param string $server_uri the URI the CAS server is responding on * @param bool $changeSessionID Allow phpCAS to change the session_id (Single * Sign Out/handleLogoutRequests is based on that change) * * @return a newly created CAS_Client object * @note Only one of the phpCAS::client() and phpCAS::proxy functions should be * called, only once, and before all other methods (except phpCAS::getVersion() * and phpCAS::setDebug()). */ public static function client($server_version, $server_hostname, $server_port, $server_uri, $changeSessionID = true ) { phpCAS :: traceBegin(); if (is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error(self::$_PHPCAS_INIT_CALL['method'] . '() has already been called (at ' . self::$_PHPCAS_INIT_CALL['file'] . ':' . self::$_PHPCAS_INIT_CALL['line'] . ')'); } if (gettype($server_version) != 'string') { phpCAS :: error('type mismatched for parameter $server_version (should be `string\')'); } if (gettype($server_hostname) != 'string') { phpCAS :: error('type mismatched for parameter $server_hostname (should be `string\')'); } if (gettype($server_port) != 'integer') { phpCAS :: error('type mismatched for parameter $server_port (should be `integer\')'); } if (gettype($server_uri) != 'string') { phpCAS :: error('type mismatched for parameter $server_uri (should be `string\')'); } // store where the initializer is called from $dbg = debug_backtrace(); self::$_PHPCAS_INIT_CALL = array ( 'done' => true, 'file' => $dbg[0]['file'], 'line' => $dbg[0]['line'], 'method' => __CLASS__ . '::' . __FUNCTION__ ); // initialize the object $_PHPCAS_CLIENT self::$_PHPCAS_CLIENT = new CAS_Client( $server_version, false, $server_hostname, $server_port, $server_uri, $changeSessionID ); phpCAS :: traceEnd(); } /** * phpCAS proxy initializer. * * @param string $server_version the version of the CAS server * @param string $server_hostname the hostname of the CAS server * @param string $server_port the port the CAS server is running on * @param string $server_uri the URI the CAS server is responding on * @param bool $changeSessionID Allow phpCAS to change the session_id (Single * Sign Out/handleLogoutRequests is based on that change) * * @return a newly created CAS_Client object * @note Only one of the phpCAS::client() and phpCAS::proxy functions should be * called, only once, and before all other methods (except phpCAS::getVersion() * and phpCAS::setDebug()). */ public static function proxy($server_version, $server_hostname, $server_port, $server_uri, $changeSessionID = true ) { phpCAS :: traceBegin(); if (is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error(self::$_PHPCAS_INIT_CALL['method'] . '() has already been called (at ' . self::$_PHPCAS_INIT_CALL['file'] . ':' . self::$_PHPCAS_INIT_CALL['line'] . ')'); } if (gettype($server_version) != 'string') { phpCAS :: error('type mismatched for parameter $server_version (should be `string\')'); } if (gettype($server_hostname) != 'string') { phpCAS :: error('type mismatched for parameter $server_hostname (should be `string\')'); } if (gettype($server_port) != 'integer') { phpCAS :: error('type mismatched for parameter $server_port (should be `integer\')'); } if (gettype($server_uri) != 'string') { phpCAS :: error('type mismatched for parameter $server_uri (should be `string\')'); } // store where the initialzer is called from $dbg = debug_backtrace(); self::$_PHPCAS_INIT_CALL = array ( 'done' => true, 'file' => $dbg[0]['file'], 'line' => $dbg[0]['line'], 'method' => __CLASS__ . '::' . __FUNCTION__ ); // initialize the object $_PHPCAS_CLIENT self::$_PHPCAS_CLIENT = new CAS_Client( $server_version, true, $server_hostname, $server_port, $server_uri, $changeSessionID ); phpCAS :: traceEnd(); } /** @} */ // ######################################################################## // DEBUGGING // ######################################################################## /** * @addtogroup publicDebug * @{ */ /** * Set/unset debug mode * * @param string $filename the name of the file used for logging, or false * to stop debugging. * * @return void */ public static function setDebug($filename = '') { if ($filename != false && gettype($filename) != 'string') { phpCAS :: error('type mismatched for parameter $dbg (should be false or the name of the log file)'); } if ($filename === false) { self::$_PHPCAS_DEBUG['filename'] = false; } else { if (empty ($filename)) { if (preg_match('/^Win.*/', getenv('OS'))) { if (isset ($_ENV['TMP'])) { $debugDir = $_ENV['TMP'] . '/'; } else { $debugDir = ''; } } else { $debugDir = DEFAULT_DEBUG_DIR; } $filename = $debugDir . 'phpCAS.log'; } if (empty (self::$_PHPCAS_DEBUG['unique_id'])) { self::$_PHPCAS_DEBUG['unique_id'] = substr(strtoupper(md5(uniqid(''))), 0, 4); } self::$_PHPCAS_DEBUG['filename'] = $filename; self::$_PHPCAS_DEBUG['indent'] = 0; phpCAS :: trace('START phpCAS-' . PHPCAS_VERSION . ' ******************'); } } /** * Logs a string in debug mode. * * @param string $str the string to write * * @return void * @private */ public static function log($str) { $indent_str = "."; if (!empty(self::$_PHPCAS_DEBUG['filename'])) { // Check if file exists and modifiy file permissions to be only // readable by the webserver if (!file_exists(self::$_PHPCAS_DEBUG['filename'])) { touch(self::$_PHPCAS_DEBUG['filename']); // Chmod will fail on windows @chmod(self::$_PHPCAS_DEBUG['filename'], 0600); } for ($i = 0; $i < self::$_PHPCAS_DEBUG['indent']; $i++) { $indent_str .= '| '; } // allow for multiline output with proper identing. Usefull for // dumping cas answers etc. $str2 = str_replace("\n", "\n" . self::$_PHPCAS_DEBUG['unique_id'] . ' ' . $indent_str, $str); error_log(self::$_PHPCAS_DEBUG['unique_id'] . ' ' . $indent_str . $str2 . "\n", 3, self::$_PHPCAS_DEBUG['filename']); } } /** * This method is used by interface methods to print an error and where the * function was originally called from. * * @param string $msg the message to print * * @return void * @private */ public static function error($msg) { $dbg = debug_backtrace(); $function = '?'; $file = '?'; $line = '?'; if (is_array($dbg)) { for ($i = 1; $i < sizeof($dbg); $i++) { if (is_array($dbg[$i]) && isset($dbg[$i]['class']) ) { if ($dbg[$i]['class'] == __CLASS__) { $function = $dbg[$i]['function']; $file = $dbg[$i]['file']; $line = $dbg[$i]['line']; } } } } echo "
    \nphpCAS error: " . __CLASS__ . "::" . $function . '(): ' . htmlentities($msg) . " in " . $file . " on line " . $line . "
    \n"; phpCAS :: trace($msg); phpCAS :: traceEnd(); throw new CAS_GracefullTerminationException(__CLASS__ . "::" . $function . '(): ' . $msg); } /** * This method is used to log something in debug mode. * * @param string $str string to log * * @return void */ public static function trace($str) { $dbg = debug_backtrace(); phpCAS :: log($str . ' [' . basename($dbg[0]['file']) . ':' . $dbg[0]['line'] . ']'); } /** * This method is used to indicate the start of the execution of a function in debug mode. * * @return void */ public static function traceBegin() { $dbg = debug_backtrace(); $str = '=> '; if (!empty ($dbg[1]['class'])) { $str .= $dbg[1]['class'] . '::'; } $str .= $dbg[1]['function'] . '('; if (is_array($dbg[1]['args'])) { foreach ($dbg[1]['args'] as $index => $arg) { if ($index != 0) { $str .= ', '; } if (is_object($arg)) { $str .= get_class($arg); } else { $str .= str_replace(array("\r\n", "\n", "\r"), "", var_export($arg, true)); } } } if (isset($dbg[1]['file'])) { $file = basename($dbg[1]['file']); } else { $file = 'unknown_file'; } if (isset($dbg[1]['line'])) { $line = $dbg[1]['line']; } else { $line = 'unknown_line'; } $str .= ') [' . $file . ':' . $line . ']'; phpCAS :: log($str); if (!isset(self::$_PHPCAS_DEBUG['indent'])) { self::$_PHPCAS_DEBUG['indent'] = 0; } else { self::$_PHPCAS_DEBUG['indent']++; } } /** * This method is used to indicate the end of the execution of a function in * debug mode. * * @param string $res the result of the function * * @return void */ public static function traceEnd($res = '') { if (empty(self::$_PHPCAS_DEBUG['indent'])) { self::$_PHPCAS_DEBUG['indent'] = 0; } else { self::$_PHPCAS_DEBUG['indent']--; } $dbg = debug_backtrace(); $str = ''; if (is_object($res)) { $str .= '<= ' . get_class($res); } else { $str .= '<= ' . str_replace(array("\r\n", "\n", "\r"), "", var_export($res, true)); } phpCAS :: log($str); } /** * This method is used to indicate the end of the execution of the program * * @return void */ public static function traceExit() { phpCAS :: log('exit()'); while (self::$_PHPCAS_DEBUG['indent'] > 0) { phpCAS :: log('-'); self::$_PHPCAS_DEBUG['indent']--; } } /** @} */ // ######################################################################## // INTERNATIONALIZATION // ######################################################################## /** * @addtogroup publicLang * @{ */ /** * This method is used to set the language used by phpCAS. * * @param string $lang string representing the language. * * @return void * * @sa PHPCAS_LANG_FRENCH, PHPCAS_LANG_ENGLISH * @note Can be called only once. */ public static function setLang($lang) { if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); } if (gettype($lang) != 'string') { phpCAS :: error('type mismatched for parameter $lang (should be `string\')'); } self::$_PHPCAS_CLIENT->setLang($lang); } /** @} */ // ######################################################################## // VERSION // ######################################################################## /** * @addtogroup public * @{ */ /** * This method returns the phpCAS version. * * @return the phpCAS version. */ public static function getVersion() { return PHPCAS_VERSION; } /** @} */ // ######################################################################## // HTML OUTPUT // ######################################################################## /** * @addtogroup publicOutput * @{ */ /** * This method sets the HTML header used for all outputs. * * @param string $header the HTML header. * * @return void */ public static function setHTMLHeader($header) { if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); } if (gettype($header) != 'string') { phpCAS :: error('type mismatched for parameter $header (should be `string\')'); } self::$_PHPCAS_CLIENT->setHTMLHeader($header); } /** * This method sets the HTML footer used for all outputs. * * @param string $footer the HTML footer. * * @return void */ public static function setHTMLFooter($footer) { if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); } if (gettype($footer) != 'string') { phpCAS :: error('type mismatched for parameter $footer (should be `string\')'); } self::$_PHPCAS_CLIENT->setHTMLFooter($footer); } /** @} */ // ######################################################################## // PGT STORAGE // ######################################################################## /** * @addtogroup publicPGTStorage * @{ */ /** * This method can be used to set a custom PGT storage object. * * @param CAS_PGTStorage $storage a PGT storage object that inherits from the * CAS_PGTStorage class * * @return void */ public static function setPGTStorage($storage) { phpCAS :: traceBegin(); if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); } if (!self::$_PHPCAS_CLIENT->isProxy()) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); } if (self::$_PHPCAS_CLIENT->wasAuthenticationCalled()) { phpCAS :: error('this method should only be called before ' . self::$_PHPCAS_CLIENT->getAuthenticationCallerMethod() . '() (called at ' . self::$_PHPCAS_CLIENT->getAuthenticationCallerFile() . ':' . self::$_PHPCAS_CLIENT->getAuthenticationCallerLine() . ')'); } if ( !($storage instanceof CAS_PGTStorage) ) { phpCAS :: error('type mismatched for parameter $storage (should be a CAS_PGTStorage `object\')'); } self::$_PHPCAS_CLIENT->setPGTStorage($storage); phpCAS :: traceEnd(); } /** * This method is used to tell phpCAS to store the response of the * CAS server to PGT requests in a database. * * @param string $dsn_or_pdo a dsn string to use for creating a PDO * object or a PDO object * @param string $username the username to use when connecting to the * database * @param string $password the password to use when connecting to the * database * @param string $table the table to use for storing and retrieving * PGT's * @param string $driver_options any driver options to use when connecting * to the database * * @return void */ public static function setPGTStorageDb($dsn_or_pdo, $username='', $password='', $table='', $driver_options=null ) { phpCAS :: traceBegin(); if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); } if (!self::$_PHPCAS_CLIENT->isProxy()) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); } if (self::$_PHPCAS_CLIENT->wasAuthenticationCalled()) { phpCAS :: error('this method should only be called before ' . self::$_PHPCAS_CLIENT->getAuthenticationCallerMethod() . '() (called at ' . self::$_PHPCAS_CLIENT->getAuthenticationCallerFile() . ':' . self::$_PHPCAS_CLIENT->getAuthenticationCallerLine() . ')'); } if (gettype($username) != 'string') { phpCAS :: error('type mismatched for parameter $username (should be `string\')'); } if (gettype($password) != 'string') { phpCAS :: error('type mismatched for parameter $password (should be `string\')'); } if (gettype($table) != 'string') { phpCAS :: error('type mismatched for parameter $table (should be `string\')'); } self::$_PHPCAS_CLIENT->setPGTStorageDb($dsn_or_pdo, $username, $password, $table, $driver_options); phpCAS :: traceEnd(); } /** * This method is used to tell phpCAS to store the response of the * CAS server to PGT requests onto the filesystem. * * @param string $path the path where the PGT's should be stored * * @return void */ public static function setPGTStorageFile($path = '') { phpCAS :: traceBegin(); if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); } if (!self::$_PHPCAS_CLIENT->isProxy()) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); } if (self::$_PHPCAS_CLIENT->wasAuthenticationCalled()) { phpCAS :: error('this method should only be called before ' . self::$_PHPCAS_CLIENT->getAuthenticationCallerMethod() . '() (called at ' . self::$_PHPCAS_CLIENT->getAuthenticationCallerFile() . ':' . self::$_PHPCAS_CLIENT->getAuthenticationCallerLine() . ')'); } if (gettype($path) != 'string') { phpCAS :: error('type mismatched for parameter $path (should be `string\')'); } self::$_PHPCAS_CLIENT->setPGTStorageFile($path); phpCAS :: traceEnd(); } /** @} */ // ######################################################################## // ACCESS TO EXTERNAL SERVICES // ######################################################################## /** * @addtogroup publicServices * @{ */ /** * Answer a proxy-authenticated service handler. * * @param string $type The service type. One of * PHPCAS_PROXIED_SERVICE_HTTP_GET; PHPCAS_PROXIED_SERVICE_HTTP_POST; * PHPCAS_PROXIED_SERVICE_IMAP * * @return CAS_ProxiedService * @throws InvalidArgumentException If the service type is unknown. */ public static function getProxiedService ($type) { phpCAS :: traceBegin(); if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); } if (!self::$_PHPCAS_CLIENT->isProxy()) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); } if (!self::$_PHPCAS_CLIENT->wasAuthenticationCalled()) { phpCAS :: error('this method should only be called after the programmer is sure the user has been authenticated (by calling ' . __CLASS__ . '::checkAuthentication() or ' . __CLASS__ . '::forceAuthentication()'); } if (!self::$_PHPCAS_CLIENT->wasAuthenticationCallSuccessful()) { phpCAS :: error('authentication was checked (by ' . self::$_PHPCAS_CLIENT->getAuthenticationCallerMethod() . '() at ' . self::$_PHPCAS_CLIENT->getAuthenticationCallerFile() . ':' . self::$_PHPCAS_CLIENT->getAuthenticationCallerLine() . ') but the method returned false'); } if (gettype($type) != 'string') { phpCAS :: error('type mismatched for parameter $type (should be `string\')'); } $res = self::$_PHPCAS_CLIENT->getProxiedService($type); phpCAS :: traceEnd(); return $res; } /** * Initialize a proxied-service handler with the proxy-ticket it should use. * * @param CAS_ProxiedService $proxiedService Proxied Service Handler * * @return void * @throws CAS_ProxyTicketException If there is a proxy-ticket failure. * The code of the Exception will be one of: * PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE * PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE * PHPCAS_SERVICE_PT_FAILURE */ public static function initializeProxiedService (CAS_ProxiedService $proxiedService) { if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); } if (!self::$_PHPCAS_CLIENT->isProxy()) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); } if (!self::$_PHPCAS_CLIENT->wasAuthenticationCalled()) { phpCAS :: error('this method should only be called after the programmer is sure the user has been authenticated (by calling ' . __CLASS__ . '::checkAuthentication() or ' . __CLASS__ . '::forceAuthentication()'); } if (!self::$_PHPCAS_CLIENT->wasAuthenticationCallSuccessful()) { phpCAS :: error('authentication was checked (by ' . self::$_PHPCAS_CLIENT->getAuthenticationCallerMethod() . '() at ' . self::$_PHPCAS_CLIENT->getAuthenticationCallerFile() . ':' . self::$_PHPCAS_CLIENT->getAuthenticationCallerLine() . ') but the method returned false'); } self::$_PHPCAS_CLIENT->initializeProxiedService($proxiedService); } /** * This method is used to access an HTTP[S] service. * * @param string $url the service to access. * @param string &$err_code an error code Possible values are * PHPCAS_SERVICE_OK (on success), PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE, * PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE, PHPCAS_SERVICE_PT_FAILURE, * PHPCAS_SERVICE_NOT_AVAILABLE. * @param string &$output the output of the service (also used to give an * error message on failure). * * @return bool true on success, false otherwise (in this later case, * $err_code gives the reason why it failed and $output contains an error * message). */ public static function serviceWeb($url, & $err_code, & $output) { phpCAS :: traceBegin(); if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); } if (!self::$_PHPCAS_CLIENT->isProxy()) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); } if (!self::$_PHPCAS_CLIENT->wasAuthenticationCalled()) { phpCAS :: error('this method should only be called after the programmer is sure the user has been authenticated (by calling ' . __CLASS__ . '::checkAuthentication() or ' . __CLASS__ . '::forceAuthentication()'); } if (!self::$_PHPCAS_CLIENT->wasAuthenticationCallSuccessful()) { phpCAS :: error('authentication was checked (by ' . self::$_PHPCAS_CLIENT->getAuthenticationCallerMethod() . '() at ' . self::$_PHPCAS_CLIENT->getAuthenticationCallerFile() . ':' . self::$_PHPCAS_CLIENT->getAuthenticationCallerLine() . ') but the method returned false'); } if (gettype($url) != 'string') { phpCAS :: error('type mismatched for parameter $url (should be `string\')'); } $res = self::$_PHPCAS_CLIENT->serviceWeb($url, $err_code, $output); phpCAS :: traceEnd($res); return $res; } /** * This method is used to access an IMAP/POP3/NNTP service. * * @param string $url a string giving the URL of the service, * including the mailing box for IMAP URLs, as accepted by imap_open(). * @param string $service a string giving for CAS retrieve Proxy ticket * @param string $flags options given to imap_open(). * @param string &$err_code an error code Possible values are * PHPCAS_SERVICE_OK (on success), PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE, * PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE, PHPCAS_SERVICE_PT_FAILURE, * PHPCAS_SERVICE_NOT_AVAILABLE. * @param string &$err_msg an error message on failure * @param string &$pt the Proxy Ticket (PT) retrieved from the CAS * server to access the URL on success, false on error). * * @return object IMAP stream on success, false otherwise (in this later * case, $err_code gives the reason why it failed and $err_msg contains an * error message). */ public static function serviceMail($url, $service, $flags, & $err_code, & $err_msg, & $pt) { phpCAS :: traceBegin(); if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); } if (!self::$_PHPCAS_CLIENT->isProxy()) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); } if (!self::$_PHPCAS_CLIENT->wasAuthenticationCalled()) { phpCAS :: error('this method should only be called after the programmer is sure the user has been authenticated (by calling ' . __CLASS__ . '::checkAuthentication() or ' . __CLASS__ . '::forceAuthentication()'); } if (!self::$_PHPCAS_CLIENT->wasAuthenticationCallSuccessful()) { phpCAS :: error('authentication was checked (by ' . self::$_PHPCAS_CLIENT->getAuthenticationCallerMethod() . '() at ' . self::$_PHPCAS_CLIENT->getAuthenticationCallerFile() . ':' . self::$_PHPCAS_CLIENT->getAuthenticationCallerLine() . ') but the method returned false'); } if (gettype($url) != 'string') { phpCAS :: error('type mismatched for parameter $url (should be `string\')'); } if (gettype($flags) != 'integer') { phpCAS :: error('type mismatched for parameter $flags (should be `integer\')'); } $res = self::$_PHPCAS_CLIENT->serviceMail($url, $service, $flags, $err_code, $err_msg, $pt); phpCAS :: traceEnd($res); return $res; } /** @} */ // ######################################################################## // AUTHENTICATION // ######################################################################## /** * @addtogroup publicAuth * @{ */ /** * Set the times authentication will be cached before really accessing the * CAS server in gateway mode: * - -1: check only once, and then never again (until you pree login) * - 0: always check * - n: check every "n" time * * @param int $n an integer. * * @return void */ public static function setCacheTimesForAuthRecheck($n) { if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); } if (gettype($n) != 'integer') { phpCAS :: error('type mismatched for parameter $n (should be `integer\')'); } self::$_PHPCAS_CLIENT->setCacheTimesForAuthRecheck($n); } /** * Set a callback function to be run when a user authenticates. * * The callback function will be passed a $logoutTicket as its first * parameter, followed by any $additionalArgs you pass. The $logoutTicket * parameter is an opaque string that can be used to map the session-id to * logout request in order to support single-signout in applications that * manage their own sessions (rather than letting phpCAS start the session). * * phpCAS::forceAuthentication() will always exit and forward client unless * they are already authenticated. To perform an action at the moment the user * logs in (such as registering an account, performing logging, etc), register * a callback function here. * * @param string $function Callback function * @param array $additionalArgs optional array of arguments * * @return void */ public static function setPostAuthenticateCallback ($function, array $additionalArgs = array()) { if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); } self::$_PHPCAS_CLIENT->setPostAuthenticateCallback($function, $additionalArgs); } /** * Set a callback function to be run when a single-signout request is * received. The callback function will be passed a $logoutTicket as its * first parameter, followed by any $additionalArgs you pass. The * $logoutTicket parameter is an opaque string that can be used to map a * session-id to the logout request in order to support single-signout in * applications that manage their own sessions (rather than letting phpCAS * start and destroy the session). * * @param string $function Callback function * @param array $additionalArgs optional array of arguments * * @return void */ public static function setSingleSignoutCallback ($function, array $additionalArgs = array()) { if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); } self::$_PHPCAS_CLIENT->setSingleSignoutCallback($function, $additionalArgs); } /** * This method is called to check if the user is already authenticated * locally or has a global cas session. A already existing cas session is * determined by a cas gateway call.(cas login call without any interactive * prompt) * * @return true when the user is authenticated, false when a previous * gateway login failed or the function will not return if the user is * redirected to the cas server for a gateway login attempt */ public static function checkAuthentication() { phpCAS :: traceBegin(); if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); } $auth = self::$_PHPCAS_CLIENT->checkAuthentication(); // store where the authentication has been checked and the result self::$_PHPCAS_CLIENT->markAuthenticationCall($auth); phpCAS :: traceEnd($auth); return $auth; } /** * This method is called to force authentication if the user was not already * authenticated. If the user is not authenticated, halt by redirecting to * the CAS server. * * @return bool Authentication */ public static function forceAuthentication() { phpCAS :: traceBegin(); if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); } $auth = self::$_PHPCAS_CLIENT->forceAuthentication(); // store where the authentication has been checked and the result self::$_PHPCAS_CLIENT->markAuthenticationCall($auth); /* if (!$auth) { phpCAS :: trace('user is not authenticated, redirecting to the CAS server'); self::$_PHPCAS_CLIENT->forceAuthentication(); } else { phpCAS :: trace('no need to authenticate (user `' . phpCAS :: getUser() . '\' is already authenticated)'); }*/ phpCAS :: traceEnd(); return $auth; } /** * This method is called to renew the authentication. * * @return void **/ public static function renewAuthentication() { phpCAS :: traceBegin(); if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should not be called before' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); } $auth = self::$_PHPCAS_CLIENT->renewAuthentication(); // store where the authentication has been checked and the result self::$_PHPCAS_CLIENT->markAuthenticationCall($auth); //self::$_PHPCAS_CLIENT->renewAuthentication(); phpCAS :: traceEnd(); } /** * This method is called to check if the user is authenticated (previously or by * tickets given in the URL). * * @return true when the user is authenticated. */ public static function isAuthenticated() { phpCAS :: traceBegin(); if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); } // call the isAuthenticated method of the $_PHPCAS_CLIENT object $auth = self::$_PHPCAS_CLIENT->isAuthenticated(); // store where the authentication has been checked and the result self::$_PHPCAS_CLIENT->markAuthenticationCall($auth); phpCAS :: traceEnd($auth); return $auth; } /** * Checks whether authenticated based on $_SESSION. Useful to avoid * server calls. * * @return bool true if authenticated, false otherwise. * @since 0.4.22 by Brendan Arnold */ public static function isSessionAuthenticated() { if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); } return (self::$_PHPCAS_CLIENT->isSessionAuthenticated()); } /** * This method returns the CAS user's login name. * * @return string the login name of the authenticated user * @warning should not be called only after phpCAS::forceAuthentication() * or phpCAS::checkAuthentication(). * */ public static function getUser() { if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); } if (!self::$_PHPCAS_CLIENT->wasAuthenticationCalled()) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::forceAuthentication() or ' . __CLASS__ . '::isAuthenticated()'); } if (!self::$_PHPCAS_CLIENT->wasAuthenticationCallSuccessful()) { phpCAS :: error('authentication was checked (by ' . self::$_PHPCAS_CLIENT->getAuthenticationCallerMethod() . '() at ' . self::$_PHPCAS_CLIENT->getAuthenticationCallerFile() . ':' . self::$_PHPCAS_CLIENT->getAuthenticationCallerLine() . ') but the method returned false'); } return self::$_PHPCAS_CLIENT->getUser(); } /** * Answer attributes about the authenticated user. * * @warning should not be called only after phpCAS::forceAuthentication() * or phpCAS::checkAuthentication(). * * @return array */ public static function getAttributes() { if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); } if (!self::$_PHPCAS_CLIENT->wasAuthenticationCalled()) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::forceAuthentication() or ' . __CLASS__ . '::isAuthenticated()'); } if (!self::$_PHPCAS_CLIENT->wasAuthenticationCallSuccessful()) { phpCAS :: error('authentication was checked (by ' . self::$_PHPCAS_CLIENT->getAuthenticationCallerMethod() . '() at ' . self::$_PHPCAS_CLIENT->getAuthenticationCallerFile() . ':' . self::$_PHPCAS_CLIENT->getAuthenticationCallerLine() . ') but the method returned false'); } return self::$_PHPCAS_CLIENT->getAttributes(); } /** * Answer true if there are attributes for the authenticated user. * * @warning should not be called only after phpCAS::forceAuthentication() * or phpCAS::checkAuthentication(). * * @return bool */ public static function hasAttributes() { if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); } if (!self::$_PHPCAS_CLIENT->wasAuthenticationCalled()) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::forceAuthentication() or ' . __CLASS__ . '::isAuthenticated()'); } if (!self::$_PHPCAS_CLIENT->wasAuthenticationCallSuccessful()) { phpCAS :: error('authentication was checked (by ' . self::$_PHPCAS_CLIENT->getAuthenticationCallerMethod() . '() at ' . self::$_PHPCAS_CLIENT->getAuthenticationCallerFile() . ':' . self::$_PHPCAS_CLIENT->getAuthenticationCallerLine() . ') but the method returned false'); } return self::$_PHPCAS_CLIENT->hasAttributes(); } /** * Answer true if an attribute exists for the authenticated user. * * @param string $key attribute name * * @return bool * @warning should not be called only after phpCAS::forceAuthentication() * or phpCAS::checkAuthentication(). */ public static function hasAttribute($key) { if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); } if (!self::$_PHPCAS_CLIENT->wasAuthenticationCalled()) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::forceAuthentication() or ' . __CLASS__ . '::isAuthenticated()'); } if (!self::$_PHPCAS_CLIENT->wasAuthenticationCallSuccessful()) { phpCAS :: error('authentication was checked (by ' . self::$_PHPCAS_CLIENT->getAuthenticationCallerMethod() . '() at ' . self::$_PHPCAS_CLIENT->getAuthenticationCallerFile() . ':' . self::$_PHPCAS_CLIENT->getAuthenticationCallerLine() . ') but the method returned false'); } return self::$_PHPCAS_CLIENT->hasAttribute($key); } /** * Answer an attribute for the authenticated user. * * @param string $key attribute name * * @return mixed string for a single value or an array if multiple values exist. * @warning should not be called only after phpCAS::forceAuthentication() * or phpCAS::checkAuthentication(). */ public static function getAttribute($key) { if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); } if (!self::$_PHPCAS_CLIENT->wasAuthenticationCalled()) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::forceAuthentication() or ' . __CLASS__ . '::isAuthenticated()'); } if (!self::$_PHPCAS_CLIENT->wasAuthenticationCallSuccessful()) { phpCAS :: error('authentication was checked (by ' . self::$_PHPCAS_CLIENT->getAuthenticationCallerMethod() . '() at ' . self::$_PHPCAS_CLIENT->getAuthenticationCallerFile() . ':' . self::$_PHPCAS_CLIENT->getAuthenticationCallerLine() . ') but the method returned false'); } return self::$_PHPCAS_CLIENT->getAttribute($key); } /** * Handle logout requests. * * @param bool $check_client additional safety check * @param array $allowed_clients array of allowed clients * * @return void */ public static function handleLogoutRequests($check_client = true, $allowed_clients = false) { if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); } return (self::$_PHPCAS_CLIENT->handleLogoutRequests($check_client, $allowed_clients)); } /** * This method returns the URL to be used to login. * or phpCAS::isAuthenticated(). * * @return the login name of the authenticated user */ public static function getServerLoginURL() { if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); } return self::$_PHPCAS_CLIENT->getServerLoginURL(); } /** * Set the login URL of the CAS server. * * @param string $url the login URL * * @return void * @since 0.4.21 by Wyman Chan */ public static function setServerLoginURL($url = '') { phpCAS :: traceBegin(); if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should only be called after' . __CLASS__ . '::client()'); } if (gettype($url) != 'string') { phpCAS :: error('type mismatched for parameter $url (should be `string`)'); } self::$_PHPCAS_CLIENT->setServerLoginURL($url); phpCAS :: traceEnd(); } /** * Set the serviceValidate URL of the CAS server. * Used only in CAS 1.0 validations * * @param string $url the serviceValidate URL * * @return void */ public static function setServerServiceValidateURL($url = '') { phpCAS :: traceBegin(); if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should only be called after' . __CLASS__ . '::client()'); } if (gettype($url) != 'string') { phpCAS :: error('type mismatched for parameter $url (should be `string`)'); } self::$_PHPCAS_CLIENT->setServerServiceValidateURL($url); phpCAS :: traceEnd(); } /** * Set the proxyValidate URL of the CAS server. * Used for all CAS 2.0 validations * * @param string $url the proxyValidate URL * * @return void */ public static function setServerProxyValidateURL($url = '') { phpCAS :: traceBegin(); if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should only be called after' . __CLASS__ . '::client()'); } if (gettype($url) != 'string') { phpCAS :: error('type mismatched for parameter $url (should be `string`)'); } self::$_PHPCAS_CLIENT->setServerProxyValidateURL($url); phpCAS :: traceEnd(); } /** * Set the samlValidate URL of the CAS server. * * @param string $url the samlValidate URL * * @return void */ public static function setServerSamlValidateURL($url = '') { phpCAS :: traceBegin(); if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should only be called after' . __CLASS__ . '::client()'); } if (gettype($url) != 'string') { phpCAS :: error('type mismatched for parameter $url (should be`string\')'); } self::$_PHPCAS_CLIENT->setServerSamlValidateURL($url); phpCAS :: traceEnd(); } /** * This method returns the URL to be used to login. * or phpCAS::isAuthenticated(). * * @return the login name of the authenticated user */ public static function getServerLogoutURL() { if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); } return self::$_PHPCAS_CLIENT->getServerLogoutURL(); } /** * Set the logout URL of the CAS server. * * @param string $url the logout URL * * @return void * @since 0.4.21 by Wyman Chan */ public static function setServerLogoutURL($url = '') { phpCAS :: traceBegin(); if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error( 'this method should only be called after' . __CLASS__ . '::client()' ); } if (gettype($url) != 'string') { phpCAS :: error( 'type mismatched for parameter $url (should be `string`)' ); } self::$_PHPCAS_CLIENT->setServerLogoutURL($url); phpCAS :: traceEnd(); } /** * This method is used to logout from CAS. * * @param string $params an array that contains the optional url and * service parameters that will be passed to the CAS server * * @return void */ public static function logout($params = "") { phpCAS :: traceBegin(); if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()'); } $parsedParams = array (); if ($params != "") { if (is_string($params)) { phpCAS :: error('method `phpCAS::logout($url)\' is now deprecated, use `phpCAS::logoutWithUrl($url)\' instead'); } if (!is_array($params)) { phpCAS :: error('type mismatched for parameter $params (should be `array\')'); } foreach ($params as $key => $value) { if ($key != "service" && $key != "url") { phpCAS :: error('only `url\' and `service\' parameters are allowed for method `phpCAS::logout($params)\''); } $parsedParams[$key] = $value; } } self::$_PHPCAS_CLIENT->logout($parsedParams); // never reached phpCAS :: traceEnd(); } /** * This method is used to logout from CAS. Halts by redirecting to the CAS * server. * * @param service $service a URL that will be transmitted to the CAS server * * @return void */ public static function logoutWithRedirectService($service) { phpCAS :: traceBegin(); if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()'); } if (!is_string($service)) { phpCAS :: error('type mismatched for parameter $service (should be `string\')'); } self::$_PHPCAS_CLIENT->logout(array ( "service" => $service )); // never reached phpCAS :: traceEnd(); } /** * This method is used to logout from CAS. Halts by redirecting to the CAS * server. * * @param string $url a URL that will be transmitted to the CAS server * * @return void * @deprecated The url parameter has been removed from the CAS server as of * version 3.3.5.1 */ public static function logoutWithUrl($url) { trigger_error('Function deprecated for cas servers >= 3.3.5.1', E_USER_DEPRECATED); phpCAS :: traceBegin(); if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()'); } if (!is_string($url)) { phpCAS :: error('type mismatched for parameter $url (should be `string\')'); } self::$_PHPCAS_CLIENT->logout(array ( "url" => $url )); // never reached phpCAS :: traceEnd(); } /** * This method is used to logout from CAS. Halts by redirecting to the CAS * server. * * @param string $service a URL that will be transmitted to the CAS server * @param string $url a URL that will be transmitted to the CAS server * * @return void * * @deprecated The url parameter has been removed from the CAS server as of * version 3.3.5.1 */ public static function logoutWithRedirectServiceAndUrl($service, $url) { trigger_error('Function deprecated for cas servers >= 3.3.5.1', E_USER_DEPRECATED); phpCAS :: traceBegin(); if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()'); } if (!is_string($service)) { phpCAS :: error('type mismatched for parameter $service (should be `string\')'); } if (!is_string($url)) { phpCAS :: error('type mismatched for parameter $url (should be `string\')'); } self::$_PHPCAS_CLIENT->logout( array ( "service" => $service, "url" => $url ) ); // never reached phpCAS :: traceEnd(); } /** * Set the fixed URL that will be used by the CAS server to transmit the * PGT. When this method is not called, a phpCAS script uses its own URL * for the callback. * * @param string $url the URL * * @return void */ public static function setFixedCallbackURL($url = '') { phpCAS :: traceBegin(); if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); } if (!self::$_PHPCAS_CLIENT->isProxy()) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); } if (gettype($url) != 'string') { phpCAS :: error('type mismatched for parameter $url (should be `string\')'); } self::$_PHPCAS_CLIENT->setCallbackURL($url); phpCAS :: traceEnd(); } /** * Set the fixed URL that will be set as the CAS service parameter. When this * method is not called, a phpCAS script uses its own URL. * * @param string $url the URL * * @return void */ public static function setFixedServiceURL($url) { phpCAS :: traceBegin(); if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); } if (gettype($url) != 'string') { phpCAS :: error('type mismatched for parameter $url (should be `string\')'); } self::$_PHPCAS_CLIENT->setURL($url); phpCAS :: traceEnd(); } /** * Get the URL that is set as the CAS service parameter. * * @return string Service Url */ public static function getServiceURL() { if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); } return (self::$_PHPCAS_CLIENT->getURL()); } /** * Retrieve a Proxy Ticket from the CAS server. * * @param string $target_service Url string of service to proxy * @param string &$err_code error code * @param string &$err_msg error message * * @return string Proxy Ticket */ public static function retrievePT($target_service, & $err_code, & $err_msg) { if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()'); } if (gettype($target_service) != 'string') { phpCAS :: error('type mismatched for parameter $target_service(should be `string\')'); } return (self::$_PHPCAS_CLIENT->retrievePT($target_service, $err_code, $err_msg)); } /** * Set the certificate of the CAS server CA and if the CN should be properly * verified. * * @param string $cert CA certificate file name * @param bool $validate_cn Validate CN in certificate (default true) * * @return void */ public static function setCasServerCACert($cert, $validate_cn = true) { phpCAS :: traceBegin(); if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()'); } if (gettype($cert) != 'string') { phpCAS :: error('type mismatched for parameter $cert (should be `string\')'); } if (gettype($validate_cn) != 'boolean') { phpCAS :: error('type mismatched for parameter $validate_cn (should be `boolean\')'); } self::$_PHPCAS_CLIENT->setCasServerCACert($cert, $validate_cn); phpCAS :: traceEnd(); } /** * Set no SSL validation for the CAS server. * * @return void */ public static function setNoCasServerValidation() { phpCAS :: traceBegin(); if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()'); } phpCAS :: trace('You have configured no validation of the legitimacy of the cas server. This is not recommended for production use.'); self::$_PHPCAS_CLIENT->setNoCasServerValidation(); phpCAS :: traceEnd(); } /** * Disable the removal of a CAS-Ticket from the URL when authenticating * DISABLING POSES A SECURITY RISK: * We normally remove the ticket by an additional redirect as a security * precaution to prevent a ticket in the HTTP_REFERRER or be carried over in * the URL parameter * * @return void */ public static function setNoClearTicketsFromUrl() { phpCAS :: traceBegin(); if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()'); } self::$_PHPCAS_CLIENT->setNoClearTicketsFromUrl(); phpCAS :: traceEnd(); } /** @} */ /** * Change CURL options. * CURL is used to connect through HTTPS to CAS server * * @param string $key the option key * @param string $value the value to set * * @return void */ public static function setExtraCurlOption($key, $value) { phpCAS :: traceBegin(); if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()'); } self::$_PHPCAS_CLIENT->setExtraCurlOption($key, $value); phpCAS :: traceEnd(); } /** * If you want your service to be proxied you have to enable it (default * disabled) and define an accepable list of proxies that are allowed to * proxy your service. * * Add each allowed proxy definition object. For the normal CAS_ProxyChain * class, the constructor takes an array of proxies to match. The list is in * reverse just as seen from the service. Proxies have to be defined in reverse * from the service to the user. If a user hits service A and gets proxied via * B to service C the list of acceptable on C would be array(B,A). The definition * of an individual proxy can be either a string or a regexp (preg_match is used) * that will be matched against the proxy list supplied by the cas server * when validating the proxy tickets. The strings are compared starting from * the beginning and must fully match with the proxies in the list. * Example: * phpCAS::allowProxyChain(new CAS_ProxyChain(array( * 'https://app.example.com/' * ))); * phpCAS::allowProxyChain(new CAS_ProxyChain(array( * '/^https:\/\/app[0-9]\.example\.com\/rest\//', * 'http://client.example.com/' * ))); * * For quick testing or in certain production screnarios you might want to * allow allow any other valid service to proxy your service. To do so, add * the "Any" chain: * phpcas::allowProxyChain(new CAS_ProxyChain_Any); * THIS SETTING IS HOWEVER NOT RECOMMENDED FOR PRODUCTION AND HAS SECURITY * IMPLICATIONS: YOU ARE ALLOWING ANY SERVICE TO ACT ON BEHALF OF A USER * ON THIS SERVICE. * * @param CAS_ProxyChain_Interface $proxy_chain A proxy-chain that will be * matched against the proxies requesting access * * @return void */ public static function allowProxyChain(CAS_ProxyChain_Interface $proxy_chain) { phpCAS :: traceBegin(); if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()'); } if (self::$_PHPCAS_CLIENT->getServerVersion() !== CAS_VERSION_2_0) { phpCAS :: error('this method can only be used with the cas 2.0 protool'); } self::$_PHPCAS_CLIENT->getAllowedProxyChains()->allowProxyChain($proxy_chain); phpCAS :: traceEnd(); } /** * Answer an array of proxies that are sitting in front of this application. * This method will only return a non-empty array if we have received and * validated a Proxy Ticket. * * @return array * @access public * @since 6/25/09 */ public static function getProxies () { if ( !is_object(self::$_PHPCAS_CLIENT) ) { phpCAS::error('this method should only be called after '.__CLASS__.'::client()'); } return(self::$_PHPCAS_CLIENT->getProxies()); } // ######################################################################## // PGTIOU/PGTID and logoutRequest rebroadcasting // ######################################################################## /** * Add a pgtIou/pgtId and logoutRequest rebroadcast node. * * @param string $rebroadcastNodeUrl The rebroadcast node URL. Can be * hostname or IP. * * @return void */ public static function addRebroadcastNode($rebroadcastNodeUrl) { phpCAS::traceBegin(); phpCAS::log('rebroadcastNodeUrl:'.$rebroadcastNodeUrl); if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()'); } if ( !(bool)preg_match("/^(http|https):\/\/([A-Z0-9][A-Z0-9_-]*(?:\.[A-Z0-9][A-Z0-9_-]*)+):?(\d+)?\/?/i", $rebroadcastNodeUrl)) { phpCAS::error('type mismatched for parameter $rebroadcastNodeUrl (should be `url\')'); } self::$_PHPCAS_CLIENT->addRebroadcastNode($rebroadcastNodeUrl); phpCAS::traceEnd(); } /** * This method is used to add header parameters when rebroadcasting * pgtIou/pgtId or logoutRequest. * * @param String $header Header to send when rebroadcasting. * * @return void */ public static function addRebroadcastHeader($header) { phpCAS :: traceBegin(); if (!is_object(self::$_PHPCAS_CLIENT)) { phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()'); } self::$_PHPCAS_CLIENT->addRebroadcastHeader($header); phpCAS :: traceEnd(); } } // ######################################################################## // DOCUMENTATION // ######################################################################## // ######################################################################## // MAIN PAGE /** * @mainpage * * The following pages only show the source documentation. * */ // ######################################################################## // MODULES DEFINITION /** @defgroup public User interface */ /** @defgroup publicInit Initialization * @ingroup public */ /** @defgroup publicAuth Authentication * @ingroup public */ /** @defgroup publicServices Access to external services * @ingroup public */ /** @defgroup publicConfig Configuration * @ingroup public */ /** @defgroup publicLang Internationalization * @ingroup publicConfig */ /** @defgroup publicOutput HTML output * @ingroup publicConfig */ /** @defgroup publicPGTStorage PGT storage * @ingroup publicConfig */ /** @defgroup publicDebug Debugging * @ingroup public */ /** @defgroup internal Implementation */ /** @defgroup internalAuthentication Authentication * @ingroup internal */ /** @defgroup internalBasic CAS Basic client features (CAS 1.0, Service Tickets) * @ingroup internal */ /** @defgroup internalProxy CAS Proxy features (CAS 2.0, Proxy Granting Tickets) * @ingroup internal */ /** @defgroup internalSAML CAS SAML features (SAML 1.1) * @ingroup internal */ /** @defgroup internalPGTStorage PGT storage * @ingroup internalProxy */ /** @defgroup internalPGTStorageDb PGT storage in a database * @ingroup internalPGTStorage */ /** @defgroup internalPGTStorageFile PGT storage on the filesystem * @ingroup internalPGTStorage */ /** @defgroup internalCallback Callback from the CAS server * @ingroup internalProxy */ /** @defgroup internalProxyServices Proxy other services * @ingroup internalProxy */ /** @defgroup internalService CAS client features (CAS 2.0, Proxied service) * @ingroup internal */ /** @defgroup internalConfig Configuration * @ingroup internal */ /** @defgroup internalBehave Internal behaviour of phpCAS * @ingroup internalConfig */ /** @defgroup internalOutput HTML output * @ingroup internalConfig */ /** @defgroup internalLang Internationalization * @ingroup internalConfig * * To add a new language: * - 1. define a new constant PHPCAS_LANG_XXXXXX in CAS/CAS.php * - 2. copy any file from CAS/languages to CAS/languages/XXXXXX.php * - 3. Make the translations */ /** @defgroup internalDebug Debugging * @ingroup internal */ /** @defgroup internalMisc Miscellaneous * @ingroup internal */ // ######################################################################## // EXAMPLES /** * @example example_simple.php */ /** * @example example_service.php */ /** * @example example_service_that_proxies.php */ /** * @example example_service_POST.php */ /** * @example example_proxy_serviceWeb.php */ /** * @example example_proxy_serviceWeb_chaining.php */ /** * @example example_proxy_POST.php */ /** * @example example_proxy_GET.php */ /** * @example example_lang.php */ /** * @example example_html.php */ /** * @example example_pgt_storage_file.php */ /** * @example example_pgt_storage_db.php */ /** * @example example_gateway.php */ /** * @example example_logout.php */ /** * @example example_rebroadcast.php */ /** * @example example_custom_urls.php */ /** * @example example_advanced_saml11.php */ ?> glpi-0.84.3+dfsg.1/lib/phpcas/CAS/000077500000000000000000000000001226600447100162535ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/phpcas/CAS/AuthenticationException.php000066400000000000000000000100311226600447100236150ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * This interface defines methods that allow proxy-authenticated service handlers * to interact with phpCAS. * * Proxy service handlers must implement this interface as well as call * phpCAS::initializeProxiedService($this) at some point in their implementation. * * While not required, proxy-authenticated service handlers are encouraged to * implement the CAS_ProxiedService_Testable interface to facilitate unit testing. * * @class CAS_AuthenticationException * @category Authentication * @package PhpCAS * @author Joachim Fritschi * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ class CAS_AuthenticationException extends RuntimeException implements CAS_Exception { /** * This method is used to print the HTML output when the user was not * authenticated. * * @param CAS_Client $client phpcas client * @param string $failure the failure that occured * @param string $cas_url the URL the CAS server was asked for * @param bool $no_response the response from the CAS server (other * parameters are ignored if TRUE) * @param bool $bad_response bad response from the CAS server ($err_code * and $err_msg ignored if TRUE) * @param string $cas_response the response of the CAS server * @param int $err_code the error code given by the CAS server * @param string $err_msg the error message given by the CAS server */ public function __construct($client,$failure,$cas_url,$no_response, $bad_response='',$cas_response='',$err_code='',$err_msg='' ) { phpCAS::traceBegin(); $lang = $client->getLangObj(); $client->printHTMLHeader($lang->getAuthenticationFailed()); printf( $lang->getYouWereNotAuthenticated(), htmlentities($client->getURL()), $_SERVER['SERVER_ADMIN'] ); phpCAS::trace('CAS URL: '.$cas_url); phpCAS::trace('Authentication failure: '.$failure); if ( $no_response ) { phpCAS::trace('Reason: no response from the CAS server'); } else { if ( $bad_response ) { phpCAS::trace('Reason: bad response from the CAS server'); } else { switch ($client->getServerVersion()) { case CAS_VERSION_1_0: phpCAS::trace('Reason: CAS error'); break; case CAS_VERSION_2_0: if ( empty($err_code) ) { phpCAS::trace('Reason: no CAS error'); } else { phpCAS::trace('Reason: ['.$err_code.'] CAS error: '.$err_msg); } break; } } phpCAS::trace('CAS response: '.$cas_response); } $client->printHTMLFooter(); phpCAS::traceExit(); } } ?> glpi-0.84.3+dfsg.1/lib/phpcas/CAS/Autoload.php000066400000000000000000000052471226600447100205440ustar00rootroot00000000000000 * @copyright 2008 Regents of the University of Nebraska * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License * @link http://code.google.com/p/simplecas/ **/ /** * Autoload a class * * @param string $class Classname to load * * @return bool */ function CAS_autoload($class) { // Static to hold the Include Path to CAS static $include_path; // Setup the include path if it's not already set from a previous call if (!$include_path) { $include_path = dirname(dirname(__FILE__)); } if (substr($class, 0, 4) !== 'CAS_') { return false; } // Declare local variable to store the expected full path to the file $file_path = $include_path . '/' . str_replace('_', '/', $class) . '.php'; $fp = @fopen($file_path, 'r', true); if ($fp) { fclose($fp); include $file_path; if (!class_exists($class, false) && !interface_exists($class, false)) { die( new Exception( 'Class ' . $class . ' was not present in ' . $file_path . ' [CAS_autoload]' ) ); } return true; } $e = new Exception( 'Class ' . $class . ' could not be loaded from ' . $file_path . ', file does not exist (Path="' . $include_path .'") [CAS_autoload]' ); $trace = $e->getTrace(); if (isset($trace[2]) && isset($trace[2]['function']) && in_array($trace[2]['function'], array('class_exists', 'interface_exists')) ) { return false; } if (isset($trace[1]) && isset($trace[1]['function']) && in_array($trace[1]['function'], array('class_exists', 'interface_exists')) ) { return false; } die ((string) $e); } // set up __autoload if (function_exists('spl_autoload_register')) { if (!(spl_autoload_functions()) || !in_array('CAS_autoload', spl_autoload_functions())) { spl_autoload_register('CAS_autoload'); if (function_exists('__autoload') && !in_array('__autoload', spl_autoload_functions())) { // __autoload() was being used, but now would be ignored, add // it to the autoload stack spl_autoload_register('__autoload'); } } } elseif (!function_exists('__autoload')) { /** * Autoload a class * * @param string $class Class name * * @return bool */ function __autoload($class) { return CAS_autoload($class); } } ?>glpi-0.84.3+dfsg.1/lib/phpcas/CAS/Client.php000066400000000000000000003574751226600447100202270ustar00rootroot00000000000000 * @author Olivier Berger * @author Brett Bieber * @author Joachim Fritschi * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * The CAS_Client class is a client interface that provides CAS authentication * to PHP applications. * * @class CAS_Client * @category Authentication * @package PhpCAS * @author Pascal Aubry * @author Olivier Berger * @author Brett Bieber * @author Joachim Fritschi * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS * */ class CAS_Client { // ######################################################################## // HTML OUTPUT // ######################################################################## /** * @addtogroup internalOutput * @{ */ /** * This method filters a string by replacing special tokens by appropriate values * and prints it. The corresponding tokens are taken into account: * - __CAS_VERSION__ * - __PHPCAS_VERSION__ * - __SERVER_BASE_URL__ * * Used by CAS_Client::PrintHTMLHeader() and CAS_Client::printHTMLFooter(). * * @param string $str the string to filter and output * * @return void */ private function _htmlFilterOutput($str) { $str = str_replace('__CAS_VERSION__', $this->getServerVersion(), $str); $str = str_replace('__PHPCAS_VERSION__', phpCAS::getVersion(), $str); $str = str_replace('__SERVER_BASE_URL__', $this->_getServerBaseURL(), $str); echo $str; } /** * A string used to print the header of HTML pages. Written by * CAS_Client::setHTMLHeader(), read by CAS_Client::printHTMLHeader(). * * @hideinitializer * @see CAS_Client::setHTMLHeader, CAS_Client::printHTMLHeader() */ private $_output_header = ''; /** * This method prints the header of the HTML output (after filtering). If * CAS_Client::setHTMLHeader() was not used, a default header is output. * * @param string $title the title of the page * * @return void * @see _htmlFilterOutput() */ public function printHTMLHeader($title) { $this->_htmlFilterOutput( str_replace( '__TITLE__', $title, (empty($this->_output_header) ? '__TITLE__

    __TITLE__

    ' : $this->_output_header) ) ); } /** * A string used to print the footer of HTML pages. Written by * CAS_Client::setHTMLFooter(), read by printHTMLFooter(). * * @hideinitializer * @see CAS_Client::setHTMLFooter, CAS_Client::printHTMLFooter() */ private $_output_footer = ''; /** * This method prints the footer of the HTML output (after filtering). If * CAS_Client::setHTMLFooter() was not used, a default footer is output. * * @return void * @see _htmlFilterOutput() */ public function printHTMLFooter() { $lang = $this->getLangObj(); $this->_htmlFilterOutput( empty($this->_output_footer)? ('
    phpCAS __PHPCAS_VERSION__ ' .$lang->getUsingServer() .' __SERVER_BASE_URL__ (CAS __CAS_VERSION__)
    ') :$this->_output_footer ); } /** * This method set the HTML header used for all outputs. * * @param string $header the HTML header. * * @return void */ public function setHTMLHeader($header) { $this->_output_header = $header; } /** * This method set the HTML footer used for all outputs. * * @param string $footer the HTML footer. * * @return void */ public function setHTMLFooter($footer) { $this->_output_footer = $footer; } /** @} */ // ######################################################################## // INTERNATIONALIZATION // ######################################################################## /** * @addtogroup internalLang * @{ */ /** * A string corresponding to the language used by phpCAS. Written by * CAS_Client::setLang(), read by CAS_Client::getLang(). * @note debugging information is always in english (debug purposes only). */ private $_lang = PHPCAS_LANG_DEFAULT; /** * This method is used to set the language used by phpCAS. * * @param string $lang representing the language. * * @return void */ public function setLang($lang) { phpCAS::traceBegin(); $obj = new $lang(); if (!($obj instanceof CAS_Languages_LanguageInterface)) { throw new CAS_InvalidArgumentException('$className must implement the CAS_Languages_LanguageInterface'); } $this->_lang = $lang; phpCAS::traceEnd(); } /** * Create the language * * @return CAS_Languages_LanguageInterface object implementing the class */ public function getLangObj() { $classname = $this->_lang; return new $classname(); } /** @} */ // ######################################################################## // CAS SERVER CONFIG // ######################################################################## /** * @addtogroup internalConfig * @{ */ /** * a record to store information about the CAS server. * - $_server['version']: the version of the CAS server * - $_server['hostname']: the hostname of the CAS server * - $_server['port']: the port the CAS server is running on * - $_server['uri']: the base URI the CAS server is responding on * - $_server['base_url']: the base URL of the CAS server * - $_server['login_url']: the login URL of the CAS server * - $_server['service_validate_url']: the service validating URL of the * CAS server * - $_server['proxy_url']: the proxy URL of the CAS server * - $_server['proxy_validate_url']: the proxy validating URL of the CAS server * - $_server['logout_url']: the logout URL of the CAS server * * $_server['version'], $_server['hostname'], $_server['port'] and * $_server['uri'] are written by CAS_Client::CAS_Client(), read by * CAS_Client::getServerVersion(), CAS_Client::_getServerHostname(), * CAS_Client::_getServerPort() and CAS_Client::_getServerURI(). * * The other fields are written and read by CAS_Client::_getServerBaseURL(), * CAS_Client::getServerLoginURL(), CAS_Client::getServerServiceValidateURL(), * CAS_Client::getServerProxyValidateURL() and CAS_Client::getServerLogoutURL(). * * @hideinitializer */ private $_server = array( 'version' => -1, 'hostname' => 'none', 'port' => -1, 'uri' => 'none'); /** * This method is used to retrieve the version of the CAS server. * * @return string the version of the CAS server. */ public function getServerVersion() { return $this->_server['version']; } /** * This method is used to retrieve the hostname of the CAS server. * * @return string the hostname of the CAS server. */ private function _getServerHostname() { return $this->_server['hostname']; } /** * This method is used to retrieve the port of the CAS server. * * @return string the port of the CAS server. */ private function _getServerPort() { return $this->_server['port']; } /** * This method is used to retrieve the URI of the CAS server. * * @return string a URI. */ private function _getServerURI() { return $this->_server['uri']; } /** * This method is used to retrieve the base URL of the CAS server. * * @return string a URL. */ private function _getServerBaseURL() { // the URL is build only when needed if ( empty($this->_server['base_url']) ) { $this->_server['base_url'] = 'https://' . $this->_getServerHostname(); if ($this->_getServerPort()!=443) { $this->_server['base_url'] .= ':' .$this->_getServerPort(); } $this->_server['base_url'] .= $this->_getServerURI(); } return $this->_server['base_url']; } /** * This method is used to retrieve the login URL of the CAS server. * * @param bool $gateway true to check authentication, false to force it * @param bool $renew true to force the authentication with the CAS server * * @return a URL. * @note It is recommended that CAS implementations ignore the "gateway" * parameter if "renew" is set */ public function getServerLoginURL($gateway=false,$renew=false) { phpCAS::traceBegin(); // the URL is build only when needed if ( empty($this->_server['login_url']) ) { $this->_server['login_url'] = $this->_getServerBaseURL(); $this->_server['login_url'] .= 'login?service='; $this->_server['login_url'] .= urlencode($this->getURL()); } $url = $this->_server['login_url']; if ($renew) { // It is recommended that when the "renew" parameter is set, its // value be "true" $url = $this->_buildQueryUrl($url, 'renew=true'); } elseif ($gateway) { // It is recommended that when the "gateway" parameter is set, its // value be "true" $url = $this->_buildQueryUrl($url, 'gateway=true'); } phpCAS::traceEnd($url); return $url; } /** * This method sets the login URL of the CAS server. * * @param string $url the login URL * * @return string login url */ public function setServerLoginURL($url) { return $this->_server['login_url'] = $url; } /** * This method sets the serviceValidate URL of the CAS server. * * @param string $url the serviceValidate URL * * @return string serviceValidate URL */ public function setServerServiceValidateURL($url) { return $this->_server['service_validate_url'] = $url; } /** * This method sets the proxyValidate URL of the CAS server. * * @param string $url the proxyValidate URL * * @return string proxyValidate URL */ public function setServerProxyValidateURL($url) { return $this->_server['proxy_validate_url'] = $url; } /** * This method sets the samlValidate URL of the CAS server. * * @param string $url the samlValidate URL * * @return string samlValidate URL */ public function setServerSamlValidateURL($url) { return $this->_server['saml_validate_url'] = $url; } /** * This method is used to retrieve the service validating URL of the CAS server. * * @return string serviceValidate URL. */ public function getServerServiceValidateURL() { phpCAS::traceBegin(); // the URL is build only when needed if ( empty($this->_server['service_validate_url']) ) { switch ($this->getServerVersion()) { case CAS_VERSION_1_0: $this->_server['service_validate_url'] = $this->_getServerBaseURL() .'validate'; break; case CAS_VERSION_2_0: $this->_server['service_validate_url'] = $this->_getServerBaseURL() .'serviceValidate'; break; } } $url = $this->_buildQueryUrl($this->_server['service_validate_url'], 'service='.urlencode($this->getURL())); phpCAS::traceEnd($url); return $url; } /** * This method is used to retrieve the SAML validating URL of the CAS server. * * @return string samlValidate URL. */ public function getServerSamlValidateURL() { phpCAS::traceBegin(); // the URL is build only when needed if ( empty($this->_server['saml_validate_url']) ) { switch ($this->getServerVersion()) { case SAML_VERSION_1_1: $this->_server['saml_validate_url'] = $this->_getServerBaseURL().'samlValidate'; break; } } $url = $this->_buildQueryUrl($this->_server['saml_validate_url'], 'TARGET='.urlencode($this->getURL())); phpCAS::traceEnd($url); return $url; } /** * This method is used to retrieve the proxy validating URL of the CAS server. * * @return string proxyValidate URL. */ public function getServerProxyValidateURL() { phpCAS::traceBegin(); // the URL is build only when needed if ( empty($this->_server['proxy_validate_url']) ) { switch ($this->getServerVersion()) { case CAS_VERSION_1_0: $this->_server['proxy_validate_url'] = ''; break; case CAS_VERSION_2_0: $this->_server['proxy_validate_url'] = $this->_getServerBaseURL().'proxyValidate'; break; } } $url = $this->_buildQueryUrl($this->_server['proxy_validate_url'], 'service='.urlencode($this->getURL())); phpCAS::traceEnd($url); return $url; } /** * This method is used to retrieve the proxy URL of the CAS server. * * @return string proxy URL. */ public function getServerProxyURL() { // the URL is build only when needed if ( empty($this->_server['proxy_url']) ) { switch ($this->getServerVersion()) { case CAS_VERSION_1_0: $this->_server['proxy_url'] = ''; break; case CAS_VERSION_2_0: $this->_server['proxy_url'] = $this->_getServerBaseURL().'proxy'; break; } } return $this->_server['proxy_url']; } /** * This method is used to retrieve the logout URL of the CAS server. * * @return string logout URL. */ public function getServerLogoutURL() { // the URL is build only when needed if ( empty($this->_server['logout_url']) ) { $this->_server['logout_url'] = $this->_getServerBaseURL().'logout'; } return $this->_server['logout_url']; } /** * This method sets the logout URL of the CAS server. * * @param string $url the logout URL * * @return string logout url */ public function setServerLogoutURL($url) { return $this->_server['logout_url'] = $url; } /** * An array to store extra curl options. */ private $_curl_options = array(); /** * This method is used to set additional user curl options. * * @param string $key name of the curl option * @param string $value value of the curl option * * @return void */ public function setExtraCurlOption($key, $value) { $this->_curl_options[$key] = $value; } /** @} */ // ######################################################################## // Change the internal behaviour of phpcas // ######################################################################## /** * @addtogroup internalBehave * @{ */ /** * The class to instantiate for making web requests in readUrl(). * The class specified must implement the CAS_Request_RequestInterface. * By default CAS_Request_CurlRequest is used, but this may be overridden to * supply alternate request mechanisms for testing. */ private $_requestImplementation = 'CAS_Request_CurlRequest'; /** * Override the default implementation used to make web requests in readUrl(). * This class must implement the CAS_Request_RequestInterface. * * @param string $className name of the RequestImplementation class * * @return void */ public function setRequestImplementation ($className) { $obj = new $className; if (!($obj instanceof CAS_Request_RequestInterface)) { throw new CAS_InvalidArgumentException('$className must implement the CAS_Request_RequestInterface'); } $this->_requestImplementation = $className; } /** * @var boolean $_clearTicketsFromUrl; If true, phpCAS will clear session * tickets from the URL after a successful authentication. */ private $_clearTicketsFromUrl = true; /** * Configure the client to not send redirect headers and call exit() on * authentication success. The normal redirect is used to remove the service * ticket from the client's URL, but for running unit tests we need to * continue without exiting. * * Needed for testing authentication * * @return void */ public function setNoClearTicketsFromUrl () { $this->_clearTicketsFromUrl = false; } /** * @var callback $_postAuthenticateCallbackFunction; */ private $_postAuthenticateCallbackFunction = null; /** * @var array $_postAuthenticateCallbackArgs; */ private $_postAuthenticateCallbackArgs = array(); /** * Set a callback function to be run when a user authenticates. * * The callback function will be passed a $logoutTicket as its first parameter, * followed by any $additionalArgs you pass. The $logoutTicket parameter is an * opaque string that can be used to map a session-id to the logout request * in order to support single-signout in applications that manage their own * sessions (rather than letting phpCAS start the session). * * phpCAS::forceAuthentication() will always exit and forward client unless * they are already authenticated. To perform an action at the moment the user * logs in (such as registering an account, performing logging, etc), register * a callback function here. * * @param string $function callback function to call * @param array $additionalArgs optional array of arguments * * @return void */ public function setPostAuthenticateCallback ($function, array $additionalArgs = array()) { $this->_postAuthenticateCallbackFunction = $function; $this->_postAuthenticateCallbackArgs = $additionalArgs; } /** * @var callback $_signoutCallbackFunction; */ private $_signoutCallbackFunction = null; /** * @var array $_signoutCallbackArgs; */ private $_signoutCallbackArgs = array(); /** * Set a callback function to be run when a single-signout request is received. * * The callback function will be passed a $logoutTicket as its first parameter, * followed by any $additionalArgs you pass. The $logoutTicket parameter is an * opaque string that can be used to map a session-id to the logout request in * order to support single-signout in applications that manage their own sessions * (rather than letting phpCAS start and destroy the session). * * @param string $function callback function to call * @param array $additionalArgs optional array of arguments * * @return void */ public function setSingleSignoutCallback ($function, array $additionalArgs = array()) { $this->_signoutCallbackFunction = $function; $this->_signoutCallbackArgs = $additionalArgs; } // ######################################################################## // Methods for supplying code-flow feedback to integrators. // ######################################################################## /** * Mark the caller of authentication. This will help client integraters determine * problems with their code flow if they call a function such as getUser() before * authentication has occurred. * * @param bool $auth True if authentication was successful, false otherwise. * * @return null */ public function markAuthenticationCall ($auth) { // store where the authentication has been checked and the result $dbg = debug_backtrace(); $this->_authentication_caller = array ( 'file' => $dbg[1]['file'], 'line' => $dbg[1]['line'], 'method' => $dbg[1]['class'] . '::' . $dbg[1]['function'], 'result' => (boolean)$auth ); } private $_authentication_caller; /** * Answer true if authentication has been checked. * * @return bool */ public function wasAuthenticationCalled () { return !empty($this->_authentication_caller); } /** * Answer the result of the authentication call. * * Throws a CAS_OutOfSequenceException if wasAuthenticationCalled() is false * and markAuthenticationCall() didn't happen. * * @return bool */ public function wasAuthenticationCallSuccessful () { if (empty($this->_authentication_caller)) { throw new CAS_OutOfSequenceException('markAuthenticationCall() hasn\'t happened.'); } return $this->_authentication_caller['result']; } /** * Answer information about the authentication caller. * * Throws a CAS_OutOfSequenceException if wasAuthenticationCalled() is false * and markAuthenticationCall() didn't happen. * * @return array Keys are 'file', 'line', and 'method' */ public function getAuthenticationCallerFile () { if (empty($this->_authentication_caller)) { throw new CAS_OutOfSequenceException('markAuthenticationCall() hasn\'t happened.'); } return $this->_authentication_caller['file']; } /** * Answer information about the authentication caller. * * Throws a CAS_OutOfSequenceException if wasAuthenticationCalled() is false * and markAuthenticationCall() didn't happen. * * @return array Keys are 'file', 'line', and 'method' */ public function getAuthenticationCallerLine () { if (empty($this->_authentication_caller)) { throw new CAS_OutOfSequenceException('markAuthenticationCall() hasn\'t happened.'); } return $this->_authentication_caller['line']; } /** * Answer information about the authentication caller. * * Throws a CAS_OutOfSequenceException if wasAuthenticationCalled() is false * and markAuthenticationCall() didn't happen. * * @return array Keys are 'file', 'line', and 'method' */ public function getAuthenticationCallerMethod () { if (empty($this->_authentication_caller)) { throw new CAS_OutOfSequenceException('markAuthenticationCall() hasn\'t happened.'); } return $this->_authentication_caller['method']; } /** @} */ // ######################################################################## // CONSTRUCTOR // ######################################################################## /** * @addtogroup internalConfig * @{ */ /** * CAS_Client constructor. * * @param string $server_version the version of the CAS server * @param bool $proxy true if the CAS client is a CAS proxy * @param string $server_hostname the hostname of the CAS server * @param int $server_port the port the CAS server is running on * @param string $server_uri the URI the CAS server is responding on * @param bool $changeSessionID Allow phpCAS to change the session_id (Single Sign Out/handleLogoutRequests is based on that change) * * @return a newly created CAS_Client object */ public function __construct( $server_version, $proxy, $server_hostname, $server_port, $server_uri, $changeSessionID = true ) { phpCAS::traceBegin(); $this->_setChangeSessionID($changeSessionID); // true : allow to change the session_id(), false session_id won't be change and logout won't be handle because of that // skip Session Handling for logout requests and if don't want it' if (session_id()=="" && !$this->_isLogoutRequest()) { phpCAS :: trace("Starting a new session"); session_start(); } // are we in proxy mode ? $this->_proxy = $proxy; // Make cookie handling available. if ($this->isProxy()) { if (!isset($_SESSION['phpCAS'])) { $_SESSION['phpCAS'] = array(); } if (!isset($_SESSION['phpCAS']['service_cookies'])) { $_SESSION['phpCAS']['service_cookies'] = array(); } $this->_serviceCookieJar = new CAS_CookieJar($_SESSION['phpCAS']['service_cookies']); } //check version switch ($server_version) { case CAS_VERSION_1_0: if ( $this->isProxy() ) { phpCAS::error( 'CAS proxies are not supported in CAS '.$server_version ); } break; case CAS_VERSION_2_0: break; case SAML_VERSION_1_1: break; default: phpCAS::error( 'this version of CAS (`'.$server_version .'\') is not supported by phpCAS '.phpCAS::getVersion() ); } $this->_server['version'] = $server_version; // check hostname if ( empty($server_hostname) || !preg_match('/[\.\d\-abcdefghijklmnopqrstuvwxyz]*/', $server_hostname) ) { phpCAS::error('bad CAS server hostname (`'.$server_hostname.'\')'); } $this->_server['hostname'] = $server_hostname; // check port if ( $server_port == 0 || !is_int($server_port) ) { phpCAS::error('bad CAS server port (`'.$server_hostname.'\')'); } $this->_server['port'] = $server_port; // check URI if ( !preg_match('/[\.\d\-_abcdefghijklmnopqrstuvwxyz\/]*/', $server_uri) ) { phpCAS::error('bad CAS server URI (`'.$server_uri.'\')'); } // add leading and trailing `/' and remove doubles $server_uri = preg_replace('/\/\//', '/', '/'.$server_uri.'/'); $this->_server['uri'] = $server_uri; // set to callback mode if PgtIou and PgtId CGI GET parameters are provided if ( $this->isProxy() ) { $this->_setCallbackMode(!empty($_GET['pgtIou'])&&!empty($_GET['pgtId'])); } if ( $this->_isCallbackMode() ) { //callback mode: check that phpCAS is secured if ( !$this->_isHttps() ) { phpCAS::error('CAS proxies must be secured to use phpCAS; PGT\'s will not be received from the CAS server'); } } else { //normal mode: get ticket and remove it from CGI parameters for // developers $ticket = (isset($_GET['ticket']) ? $_GET['ticket'] : null); if (preg_match('/^[SP]T-/', $ticket) ) { phpCAS::trace('Ticket \''.$ticket.'\' found'); $this->setTicket($ticket); unset($_GET['ticket']); } else if ( !empty($ticket) ) { //ill-formed ticket, halt phpCAS::error('ill-formed ticket found in the URL (ticket=`'.htmlentities($ticket).'\')'); } } phpCAS::traceEnd(); } /** @} */ // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX // XX XX // XX Session Handling XX // XX XX // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX /** * @addtogroup internalConfig * @{ */ /** * A variable to whether phpcas will use its own session handling. Default = true * @hideinitializer */ private $_change_session_id = true; /** * Set a parameter whether to allow phpCas to change session_id * * @param bool $allowed allow phpCas to change session_id * * @return void */ private function _setChangeSessionID($allowed) { $this->_change_session_id = $allowed; } /** * Get whether phpCas is allowed to change session_id * * @return bool */ public function getChangeSessionID() { return $this->_change_session_id; } /** @} */ // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX // XX XX // XX AUTHENTICATION XX // XX XX // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX /** * @addtogroup internalAuthentication * @{ */ /** * The Authenticated user. Written by CAS_Client::_setUser(), read by * CAS_Client::getUser(). * * @hideinitializer */ private $_user = ''; /** * This method sets the CAS user's login name. * * @param string $user the login name of the authenticated user. * * @return void */ private function _setUser($user) { $this->_user = $user; } /** * This method returns the CAS user's login name. * * @return string the login name of the authenticated user * * @warning should be called only after CAS_Client::forceAuthentication() or * CAS_Client::isAuthenticated(), otherwise halt with an error. */ public function getUser() { if ( empty($this->_user) ) { phpCAS::error( 'this method should be used only after '.__CLASS__ .'::forceAuthentication() or '.__CLASS__.'::isAuthenticated()' ); } return $this->_user; } /** * The Authenticated users attributes. Written by * CAS_Client::setAttributes(), read by CAS_Client::getAttributes(). * @attention client applications should use phpCAS::getAttributes(). * * @hideinitializer */ private $_attributes = array(); /** * Set an array of attributes * * @param array $attributes a key value array of attributes * * @return void */ public function setAttributes($attributes) { $this->_attributes = $attributes; } /** * Get an key values arry of attributes * * @return arry of attributes */ public function getAttributes() { if ( empty($this->_user) ) { // if no user is set, there shouldn't be any attributes also... phpCAS::error( 'this method should be used only after '.__CLASS__ .'::forceAuthentication() or '.__CLASS__.'::isAuthenticated()' ); } return $this->_attributes; } /** * Check whether attributes are available * * @return bool attributes available */ public function hasAttributes() { return !empty($this->_attributes); } /** * Check whether a specific attribute with a name is available * * @param string $key name of attribute * * @return bool is attribute available */ public function hasAttribute($key) { return (is_array($this->_attributes) && array_key_exists($key, $this->_attributes)); } /** * Get a specific attribute by name * * @param string $key name of attribute * * @return string attribute values */ public function getAttribute($key) { if ($this->hasAttribute($key)) { return $this->_attributes[$key]; } } /** * This method is called to renew the authentication of the user * If the user is authenticated, renew the connection * If not, redirect to CAS * * @return void */ public function renewAuthentication() { phpCAS::traceBegin(); // Either way, the user is authenticated by CAS if (isset( $_SESSION['phpCAS']['auth_checked'])) { unset($_SESSION['phpCAS']['auth_checked']); } if ( $this->isAuthenticated() ) { phpCAS::trace('user already authenticated; renew'); $this->redirectToCas(false, true); } else { $this->redirectToCas(); } phpCAS::traceEnd(); } /** * This method is called to be sure that the user is authenticated. When not * authenticated, halt by redirecting to the CAS server; otherwise return true. * * @return true when the user is authenticated; otherwise halt. */ public function forceAuthentication() { phpCAS::traceBegin(); if ( $this->isAuthenticated() ) { // the user is authenticated, nothing to be done. phpCAS::trace('no need to authenticate'); $res = true; } else { // the user is not authenticated, redirect to the CAS server if (isset($_SESSION['phpCAS']['auth_checked'])) { unset($_SESSION['phpCAS']['auth_checked']); } $this->redirectToCas(false/* no gateway */); // never reached $res = false; } phpCAS::traceEnd($res); return $res; } /** * An integer that gives the number of times authentication will be cached * before rechecked. * * @hideinitializer */ private $_cache_times_for_auth_recheck = 0; /** * Set the number of times authentication will be cached before rechecked. * * @param int $n number of times to wait for a recheck * * @return void */ public function setCacheTimesForAuthRecheck($n) { $this->_cache_times_for_auth_recheck = $n; } /** * This method is called to check whether the user is authenticated or not. * * @return true when the user is authenticated, false when a previous * gateway login failed or the function will not return if the user is * redirected to the cas server for a gateway login attempt */ public function checkAuthentication() { phpCAS::traceBegin(); $res = false; if ( $this->isAuthenticated() ) { phpCAS::trace('user is authenticated'); /* The 'auth_checked' variable is removed just in case it's set. */ unset($_SESSION['phpCAS']['auth_checked']); $res = true; } else if (isset($_SESSION['phpCAS']['auth_checked'])) { // the previous request has redirected the client to the CAS server // with gateway=true unset($_SESSION['phpCAS']['auth_checked']); $res = false; } else { // avoid a check against CAS on every request if (!isset($_SESSION['phpCAS']['unauth_count'])) { $_SESSION['phpCAS']['unauth_count'] = -2; // uninitialized } if (($_SESSION['phpCAS']['unauth_count'] != -2 && $this->_cache_times_for_auth_recheck == -1) || ($_SESSION['phpCAS']['unauth_count'] >= 0 && $_SESSION['phpCAS']['unauth_count'] < $this->_cache_times_for_auth_recheck) ) { $res = false; if ($this->_cache_times_for_auth_recheck != -1) { $_SESSION['phpCAS']['unauth_count']++; phpCAS::trace( 'user is not authenticated (cached for ' .$_SESSION['phpCAS']['unauth_count'].' times of ' .$this->_cache_times_for_auth_recheck.')' ); } else { phpCAS::trace('user is not authenticated (cached for until login pressed)'); } } else { $_SESSION['phpCAS']['unauth_count'] = 0; $_SESSION['phpCAS']['auth_checked'] = true; phpCAS::trace('user is not authenticated (cache reset)'); $this->redirectToCas(true/* gateway */); // never reached $res = false; } } phpCAS::traceEnd($res); return $res; } /** * This method is called to check if the user is authenticated (previously or by * tickets given in the URL). * * @return true when the user is authenticated. Also may redirect to the * same URL without the ticket. */ public function isAuthenticated() { phpCAS::traceBegin(); $res = false; $validate_url = ''; if ( $this->_wasPreviouslyAuthenticated() ) { if ($this->hasTicket()) { // User has a additional ticket but was already authenticated phpCAS::trace('ticket was present and will be discarded, use renewAuthenticate()'); if ($this->_clearTicketsFromUrl) { phpCAS::trace("Prepare redirect to : ".$this->getURL()); header('Location: '.$this->getURL()); flush(); phpCAS::traceExit(); throw new CAS_GracefullTerminationException(); } else { phpCAS::trace('Already authenticated, but skipping ticket clearing since setNoClearTicketsFromUrl() was used.'); $res = true; } } else { // the user has already (previously during the session) been // authenticated, nothing to be done. phpCAS::trace('user was already authenticated, no need to look for tickets'); $res = true; } } else { if ($this->hasTicket()) { switch ($this->getServerVersion()) { case CAS_VERSION_1_0: // if a Service Ticket was given, validate it phpCAS::trace('CAS 1.0 ticket `'.$this->getTicket().'\' is present'); $this->validateCAS10($validate_url, $text_response, $tree_response); // if it fails, it halts phpCAS::trace('CAS 1.0 ticket `'.$this->getTicket().'\' was validated'); $_SESSION['phpCAS']['user'] = $this->getUser(); $res = true; $logoutTicket = $this->getTicket(); break; case CAS_VERSION_2_0: // if a Proxy Ticket was given, validate it phpCAS::trace('CAS 2.0 ticket `'.$this->getTicket().'\' is present'); $this->validateCAS20($validate_url, $text_response, $tree_response); // note: if it fails, it halts phpCAS::trace('CAS 2.0 ticket `'.$this->getTicket().'\' was validated'); if ( $this->isProxy() ) { $this->_validatePGT($validate_url, $text_response, $tree_response); // idem phpCAS::trace('PGT `'.$this->_getPGT().'\' was validated'); $_SESSION['phpCAS']['pgt'] = $this->_getPGT(); } $_SESSION['phpCAS']['user'] = $this->getUser(); if ($this->hasAttributes()) { $_SESSION['phpCAS']['attributes'] = $this->getAttributes(); } $proxies = $this->getProxies(); if (!empty($proxies)) { $_SESSION['phpCAS']['proxies'] = $this->getProxies(); } $res = true; $logoutTicket = $this->getTicket(); break; case SAML_VERSION_1_1: // if we have a SAML ticket, validate it. phpCAS::trace('SAML 1.1 ticket `'.$this->getTicket().'\' is present'); $this->validateSA($validate_url, $text_response, $tree_response); // if it fails, it halts phpCAS::trace('SAML 1.1 ticket `'.$this->getTicket().'\' was validated'); $_SESSION['phpCAS']['user'] = $this->getUser(); $_SESSION['phpCAS']['attributes'] = $this->getAttributes(); $res = true; $logoutTicket = $this->getTicket(); break; default: phpCAS::trace('Protocoll error'); break; } } else { // no ticket given, not authenticated phpCAS::trace('no ticket found'); } if ($res) { // Mark the auth-check as complete to allow post-authentication // callbacks to make use of phpCAS::getUser() and similar methods $this->markAuthenticationCall($res); // call the post-authenticate callback if registered. if ($this->_postAuthenticateCallbackFunction) { $args = $this->_postAuthenticateCallbackArgs; array_unshift($args, $logoutTicket); call_user_func_array($this->_postAuthenticateCallbackFunction, $args); } // if called with a ticket parameter, we need to redirect to the // app without the ticket so that CAS-ification is transparent // to the browser (for later POSTS) most of the checks and // errors should have been made now, so we're safe for redirect // without masking error messages. remove the ticket as a // security precaution to prevent a ticket in the HTTP_REFERRER if ($this->_clearTicketsFromUrl) { phpCAS::trace("Prepare redirect to : ".$this->getURL()); header('Location: '.$this->getURL()); flush(); phpCAS::traceExit(); throw new CAS_GracefullTerminationException(); } } } phpCAS::traceEnd($res); return $res; } /** * This method tells if the current session is authenticated. * * @return true if authenticated based soley on $_SESSION variable */ public function isSessionAuthenticated () { return !empty($_SESSION['phpCAS']['user']); } /** * This method tells if the user has already been (previously) authenticated * by looking into the session variables. * * @note This function switches to callback mode when needed. * * @return true when the user has already been authenticated; false otherwise. */ private function _wasPreviouslyAuthenticated() { phpCAS::traceBegin(); if ( $this->_isCallbackMode() ) { // Rebroadcast the pgtIou and pgtId to all nodes if ($this->_rebroadcast&&!isset($_POST['rebroadcast'])) { $this->_rebroadcast(self::PGTIOU); } $this->_callback(); } $auth = false; if ( $this->isProxy() ) { // CAS proxy: username and PGT must be present if ( $this->isSessionAuthenticated() && !empty($_SESSION['phpCAS']['pgt']) ) { // authentication already done $this->_setUser($_SESSION['phpCAS']['user']); if (isset($_SESSION['phpCAS']['attributes'])) { $this->setAttributes($_SESSION['phpCAS']['attributes']); } $this->_setPGT($_SESSION['phpCAS']['pgt']); phpCAS::trace('user = `'.$_SESSION['phpCAS']['user'].'\', PGT = `'.$_SESSION['phpCAS']['pgt'].'\''); // Include the list of proxies if (isset($_SESSION['phpCAS']['proxies'])) { $this->_setProxies($_SESSION['phpCAS']['proxies']); phpCAS::trace('proxies = "'.implode('", "', $_SESSION['phpCAS']['proxies']).'"'); } $auth = true; } elseif ( $this->isSessionAuthenticated() && empty($_SESSION['phpCAS']['pgt']) ) { // these two variables should be empty or not empty at the same time phpCAS::trace('username found (`'.$_SESSION['phpCAS']['user'].'\') but PGT is empty'); // unset all tickets to enforce authentication unset($_SESSION['phpCAS']); $this->setTicket(''); } elseif ( !$this->isSessionAuthenticated() && !empty($_SESSION['phpCAS']['pgt']) ) { // these two variables should be empty or not empty at the same time phpCAS::trace('PGT found (`'.$_SESSION['phpCAS']['pgt'].'\') but username is empty'); // unset all tickets to enforce authentication unset($_SESSION['phpCAS']); $this->setTicket(''); } else { phpCAS::trace('neither user nor PGT found'); } } else { // `simple' CAS client (not a proxy): username must be present if ( $this->isSessionAuthenticated() ) { // authentication already done $this->_setUser($_SESSION['phpCAS']['user']); if (isset($_SESSION['phpCAS']['attributes'])) { $this->setAttributes($_SESSION['phpCAS']['attributes']); } phpCAS::trace('user = `'.$_SESSION['phpCAS']['user'].'\''); // Include the list of proxies if (isset($_SESSION['phpCAS']['proxies'])) { $this->_setProxies($_SESSION['phpCAS']['proxies']); phpCAS::trace('proxies = "'.implode('", "', $_SESSION['phpCAS']['proxies']).'"'); } $auth = true; } else { phpCAS::trace('no user found'); } } phpCAS::traceEnd($auth); return $auth; } /** * This method is used to redirect the client to the CAS server. * It is used by CAS_Client::forceAuthentication() and * CAS_Client::checkAuthentication(). * * @param bool $gateway true to check authentication, false to force it * @param bool $renew true to force the authentication with the CAS server * * @return void */ public function redirectToCas($gateway=false,$renew=false) { phpCAS::traceBegin(); $cas_url = $this->getServerLoginURL($gateway, $renew); if (php_sapi_name() === 'cli') { @header('Location: '.$cas_url); } else { header('Location: '.$cas_url); } phpCAS::trace("Redirect to : ".$cas_url); $lang = $this->getLangObj(); $this->printHTMLHeader($lang->getAuthenticationWanted()); printf('

    '. $lang->getShouldHaveBeenRedirected(). '

    ', $cas_url); $this->printHTMLFooter(); phpCAS::traceExit(); throw new CAS_GracefullTerminationException(); } /** * This method is used to logout from CAS. * * @param array $params an array that contains the optional url and service * parameters that will be passed to the CAS server * * @return void */ public function logout($params) { phpCAS::traceBegin(); $cas_url = $this->getServerLogoutURL(); $paramSeparator = '?'; if (isset($params['url'])) { $cas_url = $cas_url . $paramSeparator . "url=" . urlencode($params['url']); $paramSeparator = '&'; } if (isset($params['service'])) { $cas_url = $cas_url . $paramSeparator . "service=" . urlencode($params['service']); } header('Location: '.$cas_url); phpCAS::trace("Prepare redirect to : ".$cas_url); session_unset(); session_destroy(); $lang = $this->getLangObj(); $this->printHTMLHeader($lang->getLogout()); printf('

    '.$lang->getShouldHaveBeenRedirected(). '

    ', $cas_url); $this->printHTMLFooter(); phpCAS::traceExit(); throw new CAS_GracefullTerminationException(); } /** * Check of the current request is a logout request * * @return bool is logout request. */ private function _isLogoutRequest() { return !empty($_POST['logoutRequest']); } /** * This method handles logout requests. * * @param bool $check_client true to check the client bofore handling * the request, false not to perform any access control. True by default. * @param bool $allowed_clients an array of host names allowed to send * logout requests. * * @return void */ public function handleLogoutRequests($check_client=true, $allowed_clients=false) { phpCAS::traceBegin(); if (!$this->_isLogoutRequest()) { phpCAS::trace("Not a logout request"); phpCAS::traceEnd(); return; } if (!$this->getChangeSessionID() && is_null($this->_signoutCallbackFunction)) { phpCAS::trace("phpCAS can't handle logout requests if it is not allowed to change session_id."); } phpCAS::trace("Logout requested"); $decoded_logout_rq = urldecode($_POST['logoutRequest']); phpCAS::trace("SAML REQUEST: ".$decoded_logout_rq); $allowed = false; if ($check_client) { if (!$allowed_clients) { $allowed_clients = array( $this->_getServerHostname() ); } $client_ip = $_SERVER['REMOTE_ADDR']; $client = gethostbyaddr($client_ip); phpCAS::trace("Client: ".$client."/".$client_ip); foreach ($allowed_clients as $allowed_client) { if (($client == $allowed_client) or ($client_ip == $allowed_client)) { phpCAS::trace("Allowed client '".$allowed_client."' matches, logout request is allowed"); $allowed = true; break; } else { phpCAS::trace("Allowed client '".$allowed_client."' does not match"); } } } else { phpCAS::trace("No access control set"); $allowed = true; } // If Logout command is permitted proceed with the logout if ($allowed) { phpCAS::trace("Logout command allowed"); // Rebroadcast the logout request if ($this->_rebroadcast && !isset($_POST['rebroadcast'])) { $this->_rebroadcast(self::LOGOUT); } // Extract the ticket from the SAML Request preg_match("|(.*)|", $decoded_logout_rq, $tick, PREG_OFFSET_CAPTURE, 3); $wrappedSamlSessionIndex = preg_replace('||', '', $tick[0][0]); $ticket2logout = preg_replace('||', '', $wrappedSamlSessionIndex); phpCAS::trace("Ticket to logout: ".$ticket2logout); // call the post-authenticate callback if registered. if ($this->_signoutCallbackFunction) { $args = $this->_signoutCallbackArgs; array_unshift($args, $ticket2logout); call_user_func_array($this->_signoutCallbackFunction, $args); } // If phpCAS is managing the session_id, destroy session thanks to session_id. if ($this->getChangeSessionID()) { $session_id = preg_replace('/[^a-zA-Z0-9\-]/', '', $ticket2logout); phpCAS::trace("Session id: ".$session_id); // destroy a possible application session created before phpcas if (session_id() !== "") { session_unset(); session_destroy(); } // fix session ID session_id($session_id); $_COOKIE[session_name()]=$session_id; $_GET[session_name()]=$session_id; // Overwrite session session_start(); session_unset(); session_destroy(); phpCAS::trace("Session ". $session_id . " destroyed"); } } else { phpCAS::error("Unauthorized logout request from client '".$client."'"); phpCAS::trace("Unauthorized logout request from client '".$client."'"); } flush(); phpCAS::traceExit(); throw new CAS_GracefullTerminationException(); } /** @} */ // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX // XX XX // XX BASIC CLIENT FEATURES (CAS 1.0) XX // XX XX // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX // ######################################################################## // ST // ######################################################################## /** * @addtogroup internalBasic * @{ */ /** * The Ticket provided in the URL of the request if present * (empty otherwise). Written by CAS_Client::CAS_Client(), read by * CAS_Client::getTicket() and CAS_Client::_hasPGT(). * * @hideinitializer */ private $_ticket = ''; /** * This method returns the Service Ticket provided in the URL of the request. * * @return string service ticket. */ public function getTicket() { return $this->_ticket; } /** * This method stores the Service Ticket. * * @param string $st The Service Ticket. * * @return void */ public function setTicket($st) { $this->_ticket = $st; } /** * This method tells if a Service Ticket was stored. * * @return bool if a Service Ticket has been stored. */ public function hasTicket() { return !empty($this->_ticket); } /** @} */ // ######################################################################## // ST VALIDATION // ######################################################################## /** * @addtogroup internalBasic * @{ */ /** * the certificate of the CAS server CA. * * @hideinitializer */ private $_cas_server_ca_cert = null; /** * validate CN of the CAS server certificate * * @hideinitializer */ private $_cas_server_cn_validate = true; /** * Set to true not to validate the CAS server. * * @hideinitializer */ private $_no_cas_server_validation = false; /** * Set the CA certificate of the CAS server. * * @param string $cert the PEM certificate file name of the CA that emited * the cert of the server * @param bool $validate_cn valiate CN of the CAS server certificate * * @return void */ public function setCasServerCACert($cert, $validate_cn) { $this->_cas_server_ca_cert = $cert; $this->_cas_server_cn_validate = $validate_cn; } /** * Set no SSL validation for the CAS server. * * @return void */ public function setNoCasServerValidation() { $this->_no_cas_server_validation = true; } /** * This method is used to validate a CAS 1,0 ticket; halt on failure, and * sets $validate_url, $text_reponse and $tree_response on success. * * @param string &$validate_url reference to the the URL of the request to * the CAS server. * @param string &$text_response reference to the response of the CAS * server, as is (XML text). * @param string &$tree_response reference to the response of the CAS * server, as a DOM XML tree. * * @return bool true when successfull and issue a CAS_AuthenticationException * and false on an error */ public function validateCAS10(&$validate_url,&$text_response,&$tree_response) { phpCAS::traceBegin(); $result = false; // build the URL to validate the ticket $validate_url = $this->getServerServiceValidateURL().'&ticket='.$this->getTicket(); // open and read the URL if ( !$this->_readURL($validate_url, $headers, $text_response, $err_msg) ) { phpCAS::trace('could not open URL \''.$validate_url.'\' to validate ('.$err_msg.')'); throw new CAS_AuthenticationException( $this, 'CAS 1.0 ticket not validated', $validate_url, true/*$no_response*/ ); $result = false; } if (preg_match('/^no\n/', $text_response)) { phpCAS::trace('Ticket has not been validated'); throw new CAS_AuthenticationException( $this, 'ST not validated', $validate_url, false/*$no_response*/, false/*$bad_response*/, $text_response ); $result = false; } else if (!preg_match('/^yes\n/', $text_response)) { phpCAS::trace('ill-formed response'); throw new CAS_AuthenticationException( $this, 'Ticket not validated', $validate_url, false/*$no_response*/, true/*$bad_response*/, $text_response ); $result = false; } // ticket has been validated, extract the user name $arr = preg_split('/\n/', $text_response); $this->_setUser(trim($arr[1])); $result = true; if ($result) { $this->_renameSession($this->getTicket()); } // at this step, ticket has been validated and $this->_user has been set, phpCAS::traceEnd(true); return true; } /** @} */ // ######################################################################## // SAML VALIDATION // ######################################################################## /** * @addtogroup internalSAML * @{ */ /** * This method is used to validate a SAML TICKET; halt on failure, and sets * $validate_url, $text_reponse and $tree_response on success. These * parameters are used later by CAS_Client::_validatePGT() for CAS proxies. * * @param string &$validate_url reference to the the URL of the request to * the CAS server. * @param string &$text_response reference to the response of the CAS * server, as is (XML text). * @param string &$tree_response reference to the response of the CAS * server, as a DOM XML tree. * * @return bool true when successfull and issue a CAS_AuthenticationException * and false on an error */ public function validateSA(&$validate_url,&$text_response,&$tree_response) { phpCAS::traceBegin(); $result = false; // build the URL to validate the ticket $validate_url = $this->getServerSamlValidateURL(); // open and read the URL if ( !$this->_readURL($validate_url, $headers, $text_response, $err_msg) ) { phpCAS::trace('could not open URL \''.$validate_url.'\' to validate ('.$err_msg.')'); throw new CAS_AuthenticationException($this, 'SA not validated', $validate_url, true/*$no_response*/); } phpCAS::trace('server version: '.$this->getServerVersion()); // analyze the result depending on the version switch ($this->getServerVersion()) { case SAML_VERSION_1_1: // create new DOMDocument Object $dom = new DOMDocument(); // Fix possible whitspace problems $dom->preserveWhiteSpace = false; // read the response of the CAS server into a DOM object if (!($dom->loadXML($text_response))) { phpCAS::trace('dom->loadXML() failed'); throw new CAS_AuthenticationException( $this, 'SA not validated', $validate_url, false/*$no_response*/, true/*$bad_response*/, $text_response ); $result = false; } // read the root node of the XML tree if (!($tree_response = $dom->documentElement)) { phpCAS::trace('documentElement() failed'); throw new CAS_AuthenticationException( $this, 'SA not validated', $validate_url, false/*$no_response*/, true/*$bad_response*/, $text_response ); $result = false; } else if ( $tree_response->localName != 'Envelope' ) { // insure that tag name is 'Envelope' phpCAS::trace('bad XML root node (should be `Envelope\' instead of `'.$tree_response->localName.'\''); throw new CAS_AuthenticationException( $this, 'SA not validated', $validate_url, false/*$no_response*/, true/*$bad_response*/, $text_response ); $result = false; } else if ($tree_response->getElementsByTagName("NameIdentifier")->length != 0) { // check for the NameIdentifier tag in the SAML response $success_elements = $tree_response->getElementsByTagName("NameIdentifier"); phpCAS::trace('NameIdentifier found'); $user = trim($success_elements->item(0)->nodeValue); phpCAS::trace('user = `'.$user.'`'); $this->_setUser($user); $this->_setSessionAttributes($text_response); $result = true; } else { phpCAS::trace('no tag found in SAML payload'); throw new CAS_AuthenticationException( $this, 'SA not validated', $validate_url, false/*$no_response*/, true/*$bad_response*/, $text_response ); $result = false; } } if ($result) { $this->_renameSession($this->getTicket()); } // at this step, ST has been validated and $this->_user has been set, phpCAS::traceEnd($result); return $result; } /** * This method will parse the DOM and pull out the attributes from the SAML * payload and put them into an array, then put the array into the session. * * @param string $text_response the SAML payload. * * @return bool true when successfull and false if no attributes a found */ private function _setSessionAttributes($text_response) { phpCAS::traceBegin(); $result = false; $attr_array = array(); // create new DOMDocument Object $dom = new DOMDocument(); // Fix possible whitspace problems $dom->preserveWhiteSpace = false; if (($dom->loadXML($text_response))) { $xPath = new DOMXpath($dom); $xPath->registerNamespace('samlp', 'urn:oasis:names:tc:SAML:1.0:protocol'); $xPath->registerNamespace('saml', 'urn:oasis:names:tc:SAML:1.0:assertion'); $nodelist = $xPath->query("//saml:Attribute"); if ($nodelist) { foreach ($nodelist as $node) { $xres = $xPath->query("saml:AttributeValue", $node); $name = $node->getAttribute("AttributeName"); $value_array = array(); foreach ($xres as $node2) { $value_array[] = $node2->nodeValue; } $attr_array[$name] = $value_array; } // UGent addition... foreach ($attr_array as $attr_key => $attr_value) { if (count($attr_value) > 1) { $this->_attributes[$attr_key] = $attr_value; phpCAS::trace("* " . $attr_key . "=" . $attr_value); } else { $this->_attributes[$attr_key] = $attr_value[0]; phpCAS::trace("* " . $attr_key . "=" . $attr_value[0]); } } $result = true; } else { phpCAS::trace("SAML Attributes are empty"); $result = false; } } phpCAS::traceEnd($result); return $result; } /** @} */ // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX // XX XX // XX PROXY FEATURES (CAS 2.0) XX // XX XX // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX // ######################################################################## // PROXYING // ######################################################################## /** * @addtogroup internalProxy * @{ */ /** * A boolean telling if the client is a CAS proxy or not. Written by * CAS_Client::CAS_Client(), read by CAS_Client::isProxy(). */ private $_proxy; /** * Handler for managing service cookies. */ private $_serviceCookieJar; /** * Tells if a CAS client is a CAS proxy or not * * @return true when the CAS client is a CAs proxy, false otherwise */ public function isProxy() { return $this->_proxy; } /** @} */ // ######################################################################## // PGT // ######################################################################## /** * @addtogroup internalProxy * @{ */ /** * the Proxy Grnting Ticket given by the CAS server (empty otherwise). * Written by CAS_Client::_setPGT(), read by CAS_Client::_getPGT() and * CAS_Client::_hasPGT(). * * @hideinitializer */ private $_pgt = ''; /** * This method returns the Proxy Granting Ticket given by the CAS server. * * @return string the Proxy Granting Ticket. */ private function _getPGT() { return $this->_pgt; } /** * This method stores the Proxy Granting Ticket. * * @param string $pgt The Proxy Granting Ticket. * * @return void */ private function _setPGT($pgt) { $this->_pgt = $pgt; } /** * This method tells if a Proxy Granting Ticket was stored. * * @return true if a Proxy Granting Ticket has been stored. */ private function _hasPGT() { return !empty($this->_pgt); } /** @} */ // ######################################################################## // CALLBACK MODE // ######################################################################## /** * @addtogroup internalCallback * @{ */ /** * each PHP script using phpCAS in proxy mode is its own callback to get the * PGT back from the CAS server. callback_mode is detected by the constructor * thanks to the GET parameters. */ /** * a boolean to know if the CAS client is running in callback mode. Written by * CAS_Client::setCallBackMode(), read by CAS_Client::_isCallbackMode(). * * @hideinitializer */ private $_callback_mode = false; /** * This method sets/unsets callback mode. * * @param bool $callback_mode true to set callback mode, false otherwise. * * @return void */ private function _setCallbackMode($callback_mode) { $this->_callback_mode = $callback_mode; } /** * This method returns true when the CAs client is running i callback mode, * false otherwise. * * @return A boolean. */ private function _isCallbackMode() { return $this->_callback_mode; } /** * the URL that should be used for the PGT callback (in fact the URL of the * current request without any CGI parameter). Written and read by * CAS_Client::_getCallbackURL(). * * @hideinitializer */ private $_callback_url = ''; /** * This method returns the URL that should be used for the PGT callback (in * fact the URL of the current request without any CGI parameter, except if * phpCAS::setFixedCallbackURL() was used). * * @return The callback URL */ private function _getCallbackURL() { // the URL is built when needed only if ( empty($this->_callback_url) ) { $final_uri = ''; // remove the ticket if present in the URL $final_uri = 'https://'; $final_uri .= $this->_getServerUrl(); $request_uri = $_SERVER['REQUEST_URI']; $request_uri = preg_replace('/\?.*$/', '', $request_uri); $final_uri .= $request_uri; $this->setCallbackURL($final_uri); } return $this->_callback_url; } /** * This method sets the callback url. * * @param string $url url to set callback * * @return void */ public function setCallbackURL($url) { return $this->_callback_url = $url; } /** * This method is called by CAS_Client::CAS_Client() when running in callback * mode. It stores the PGT and its PGT Iou, prints its output and halts. * * @return void */ private function _callback() { phpCAS::traceBegin(); if (preg_match('/PGTIOU-[\.\-\w]/', $_GET['pgtIou'])) { if (preg_match('/[PT]GT-[\.\-\w]/', $_GET['pgtId'])) { $this->printHTMLHeader('phpCAS callback'); $pgt_iou = $_GET['pgtIou']; $pgt = $_GET['pgtId']; phpCAS::trace('Storing PGT `'.$pgt.'\' (id=`'.$pgt_iou.'\')'); echo '

    Storing PGT `'.$pgt.'\' (id=`'.$pgt_iou.'\').

    '; $this->_storePGT($pgt, $pgt_iou); $this->printHTMLFooter(); phpCAS::traceExit("Successfull Callback"); } else { phpCAS::error('PGT format invalid' . $_GET['pgtId']); phpCAS::traceExit('PGT format invalid' . $_GET['pgtId']); } } else { phpCAS::error('PGTiou format invalid' . $_GET['pgtIou']); phpCAS::traceExit('PGTiou format invalid' . $_GET['pgtIou']); } // Flush the buffer to prevent from sending anything other then a 200 // Success Status back to the CAS Server. The Exception would normally // report as a 500 error. flush(); throw new CAS_GracefullTerminationException(); } /** @} */ // ######################################################################## // PGT STORAGE // ######################################################################## /** * @addtogroup internalPGTStorage * @{ */ /** * an instance of a class inheriting of PGTStorage, used to deal with PGT * storage. Created by CAS_Client::setPGTStorageFile(), used * by CAS_Client::setPGTStorageFile() and CAS_Client::_initPGTStorage(). * * @hideinitializer */ private $_pgt_storage = null; /** * This method is used to initialize the storage of PGT's. * Halts on error. * * @return void */ private function _initPGTStorage() { // if no SetPGTStorageXxx() has been used, default to file if ( !is_object($this->_pgt_storage) ) { $this->setPGTStorageFile(); } // initializes the storage $this->_pgt_storage->init(); } /** * This method stores a PGT. Halts on error. * * @param string $pgt the PGT to store * @param string $pgt_iou its corresponding Iou * * @return void */ private function _storePGT($pgt,$pgt_iou) { // ensure that storage is initialized $this->_initPGTStorage(); // writes the PGT $this->_pgt_storage->write($pgt, $pgt_iou); } /** * This method reads a PGT from its Iou and deletes the corresponding * storage entry. * * @param string $pgt_iou the PGT Iou * * @return mul The PGT corresponding to the Iou, false when not found. */ private function _loadPGT($pgt_iou) { // ensure that storage is initialized $this->_initPGTStorage(); // read the PGT return $this->_pgt_storage->read($pgt_iou); } /** * This method can be used to set a custom PGT storage object. * * @param CAS_PGTStorage_AbstractStorage $storage a PGT storage object that * inherits from the CAS_PGTStorage_AbstractStorage class * * @return void */ public function setPGTStorage($storage) { // check that the storage has not already been set if ( is_object($this->_pgt_storage) ) { phpCAS::error('PGT storage already defined'); } // check to make sure a valid storage object was specified if ( !($storage instanceof CAS_PGTStorage_AbstractStorage) ) { phpCAS::error('Invalid PGT storage object'); } // store the PGTStorage object $this->_pgt_storage = $storage; } /** * This method is used to tell phpCAS to store the response of the * CAS server to PGT requests in a database. * * @param string $dsn_or_pdo a dsn string to use for creating a PDO * object or a PDO object * @param string $username the username to use when connecting to the * database * @param string $password the password to use when connecting to the * database * @param string $table the table to use for storing and retrieving * PGTs * @param string $driver_options any driver options to use when connecting * to the database * * @return void */ public function setPGTStorageDb($dsn_or_pdo, $username='', $password='', $table='', $driver_options=null) { // create the storage object $this->setPGTStorage(new CAS_PGTStorage_Db($this, $dsn_or_pdo, $username, $password, $table, $driver_options)); } /** * This method is used to tell phpCAS to store the response of the * CAS server to PGT requests onto the filesystem. * * @param string $path the path where the PGT's should be stored * * @return void */ public function setPGTStorageFile($path='') { // create the storage object $this->setPGTStorage(new CAS_PGTStorage_File($this, $path)); } // ######################################################################## // PGT VALIDATION // ######################################################################## /** * This method is used to validate a PGT; halt on failure. * * @param string &$validate_url the URL of the request to the CAS server. * @param string $text_response the response of the CAS server, as is * (XML text); result of CAS_Client::validateCAS10() or CAS_Client::validateCAS20(). * @param string $tree_response the response of the CAS server, as a DOM XML * tree; result of CAS_Client::validateCAS10() or CAS_Client::validateCAS20(). * * @return bool true when successfull and issue a CAS_AuthenticationException * and false on an error */ private function _validatePGT(&$validate_url,$text_response,$tree_response) { phpCAS::traceBegin(); if ( $tree_response->getElementsByTagName("proxyGrantingTicket")->length == 0) { phpCAS::trace(' not found'); // authentication succeded, but no PGT Iou was transmitted throw new CAS_AuthenticationException( $this, 'Ticket validated but no PGT Iou transmitted', $validate_url, false/*$no_response*/, false/*$bad_response*/, $text_response ); } else { // PGT Iou transmitted, extract it $pgt_iou = trim($tree_response->getElementsByTagName("proxyGrantingTicket")->item(0)->nodeValue); if (preg_match('/PGTIOU-[\.\-\w]/', $pgt_iou)) { $pgt = $this->_loadPGT($pgt_iou); if ( $pgt == false ) { phpCAS::trace('could not load PGT'); throw new CAS_AuthenticationException( $this, 'PGT Iou was transmitted but PGT could not be retrieved', $validate_url, false/*$no_response*/, false/*$bad_response*/, $text_response ); } $this->_setPGT($pgt); } else { phpCAS::trace('PGTiou format error'); throw new CAS_AuthenticationException( $this, 'PGT Iou was transmitted but has wrong format', $validate_url, false/*$no_response*/, false/*$bad_response*/, $text_response ); } } phpCAS::traceEnd(true); return true; } // ######################################################################## // PGT VALIDATION // ######################################################################## /** * This method is used to retrieve PT's from the CAS server thanks to a PGT. * * @param string $target_service the service to ask for with the PT. * @param string &$err_code an error code (PHPCAS_SERVICE_OK on success). * @param string &$err_msg an error message (empty on success). * * @return a Proxy Ticket, or false on error. */ public function retrievePT($target_service,&$err_code,&$err_msg) { phpCAS::traceBegin(); // by default, $err_msg is set empty and $pt to true. On error, $pt is // set to false and $err_msg to an error message. At the end, if $pt is false // and $error_msg is still empty, it is set to 'invalid response' (the most // commonly encountered error). $err_msg = ''; // build the URL to retrieve the PT $cas_url = $this->getServerProxyURL().'?targetService='.urlencode($target_service).'&pgt='.$this->_getPGT(); // open and read the URL if ( !$this->_readURL($cas_url, $headers, $cas_response, $err_msg) ) { phpCAS::trace('could not open URL \''.$cas_url.'\' to validate ('.$err_msg.')'); $err_code = PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE; $err_msg = 'could not retrieve PT (no response from the CAS server)'; phpCAS::traceEnd(false); return false; } $bad_response = false; if ( !$bad_response ) { // create new DOMDocument object $dom = new DOMDocument(); // Fix possible whitspace problems $dom->preserveWhiteSpace = false; // read the response of the CAS server into a DOM object if ( !($dom->loadXML($cas_response))) { phpCAS::trace('dom->loadXML() failed'); // read failed $bad_response = true; } } if ( !$bad_response ) { // read the root node of the XML tree if ( !($root = $dom->documentElement) ) { phpCAS::trace('documentElement failed'); // read failed $bad_response = true; } } if ( !$bad_response ) { // insure that tag name is 'serviceResponse' if ( $root->localName != 'serviceResponse' ) { phpCAS::trace('localName failed'); // bad root node $bad_response = true; } } if ( !$bad_response ) { // look for a proxySuccess tag if ( $root->getElementsByTagName("proxySuccess")->length != 0) { $proxy_success_list = $root->getElementsByTagName("proxySuccess"); // authentication succeded, look for a proxyTicket tag if ( $proxy_success_list->item(0)->getElementsByTagName("proxyTicket")->length != 0) { $err_code = PHPCAS_SERVICE_OK; $err_msg = ''; $pt = trim($proxy_success_list->item(0)->getElementsByTagName("proxyTicket")->item(0)->nodeValue); phpCAS::trace('original PT: '.trim($pt)); phpCAS::traceEnd($pt); return $pt; } else { phpCAS::trace(' was found, but not '); } } else if ($root->getElementsByTagName("proxyFailure")->length != 0) { // look for a proxyFailure tag $proxy_failure_list = $root->getElementsByTagName("proxyFailure"); // authentication failed, extract the error $err_code = PHPCAS_SERVICE_PT_FAILURE; $err_msg = 'PT retrieving failed (code=`' .$proxy_failure_list->item(0)->getAttribute('code') .'\', message=`' .trim($proxy_failure_list->item(0)->nodeValue) .'\')'; phpCAS::traceEnd(false); return false; } else { phpCAS::trace('neither nor found'); } } // at this step, we are sure that the response of the CAS server was // illformed $err_code = PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE; $err_msg = 'Invalid response from the CAS server (response=`'.$cas_response.'\')'; phpCAS::traceEnd(false); return false; } /** @} */ // ######################################################################## // READ CAS SERVER ANSWERS // ######################################################################## /** * @addtogroup internalMisc * @{ */ /** * This method is used to acces a remote URL. * * @param string $url the URL to access. * @param string &$headers an array containing the HTTP header lines of the * response (an empty array on failure). * @param string &$body the body of the response, as a string (empty on * failure). * @param string &$err_msg an error message, filled on failure. * * @return true on success, false otherwise (in this later case, $err_msg * contains an error message). */ private function _readURL($url, &$headers, &$body, &$err_msg) { phpCAS::traceBegin(); $className = $this->_requestImplementation; $request = new $className(); if (count($this->_curl_options)) { $request->setCurlOptions($this->_curl_options); } $request->setUrl($url); if (empty($this->_cas_server_ca_cert) && !$this->_no_cas_server_validation) { phpCAS::error('one of the methods phpCAS::setCasServerCACert() or phpCAS::setNoCasServerValidation() must be called.'); } if ($this->_cas_server_ca_cert != '') { $request->setSslCaCert($this->_cas_server_ca_cert, $this->_cas_server_cn_validate); } // add extra stuff if SAML if ($this->getServerVersion() == SAML_VERSION_1_1) { $request->addHeader("soapaction: http://www.oasis-open.org/committees/security"); $request->addHeader("cache-control: no-cache"); $request->addHeader("pragma: no-cache"); $request->addHeader("accept: text/xml"); $request->addHeader("connection: keep-alive"); $request->addHeader("content-type: text/xml"); $request->makePost(); $request->setPostBody($this->_buildSAMLPayload()); } if ($request->send()) { $headers = $request->getResponseHeaders(); $body = $request->getResponseBody(); $err_msg = ''; phpCAS::traceEnd(true); return true; } else { $headers = ''; $body = ''; $err_msg = $request->getErrorMessage(); phpCAS::traceEnd(false); return false; } } /** * This method is used to build the SAML POST body sent to /samlValidate URL. * * @return the SOAP-encased SAMLP artifact (the ticket). */ private function _buildSAMLPayload() { phpCAS::traceBegin(); //get the ticket $sa = $this->getTicket(); $body=SAML_SOAP_ENV.SAML_SOAP_BODY.SAMLP_REQUEST.SAML_ASSERTION_ARTIFACT.$sa.SAML_ASSERTION_ARTIFACT_CLOSE.SAMLP_REQUEST_CLOSE.SAML_SOAP_BODY_CLOSE.SAML_SOAP_ENV_CLOSE; phpCAS::traceEnd($body); return ($body); } /** @} **/ // ######################################################################## // ACCESS TO EXTERNAL SERVICES // ######################################################################## /** * @addtogroup internalProxyServices * @{ */ /** * Answer a proxy-authenticated service handler. * * @param string $type The service type. One of: * PHPCAS_PROXIED_SERVICE_HTTP_GET, PHPCAS_PROXIED_SERVICE_HTTP_POST, * PHPCAS_PROXIED_SERVICE_IMAP * * @return CAS_ProxiedService * @throws InvalidArgumentException If the service type is unknown. */ public function getProxiedService ($type) { switch ($type) { case PHPCAS_PROXIED_SERVICE_HTTP_GET: case PHPCAS_PROXIED_SERVICE_HTTP_POST: $requestClass = $this->_requestImplementation; $request = new $requestClass(); if (count($this->_curl_options)) { $request->setCurlOptions($this->_curl_options); } $proxiedService = new $type($request, $this->_serviceCookieJar); if ($proxiedService instanceof CAS_ProxiedService_Testable) { $proxiedService->setCasClient($this); } return $proxiedService; case PHPCAS_PROXIED_SERVICE_IMAP; $proxiedService = new CAS_ProxiedService_Imap($this->getUser()); if ($proxiedService instanceof CAS_ProxiedService_Testable) { $proxiedService->setCasClient($this); } return $proxiedService; default: throw new CAS_InvalidArgumentException("Unknown proxied-service type, $type."); } } /** * Initialize a proxied-service handler with the proxy-ticket it should use. * * @param CAS_ProxiedService $proxiedService service handler * * @return void * * @throws CAS_ProxyTicketException If there is a proxy-ticket failure. * The code of the Exception will be one of: * PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE * PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE * PHPCAS_SERVICE_PT_FAILURE * @throws CAS_ProxiedService_Exception If there is a failure getting the * url from the proxied service. */ public function initializeProxiedService (CAS_ProxiedService $proxiedService) { $url = $proxiedService->getServiceUrl(); if (!is_string($url)) { throw new CAS_ProxiedService_Exception("Proxied Service ".get_class($proxiedService)."->getServiceUrl() should have returned a string, returned a ".gettype($url)." instead."); } $pt = $this->retrievePT($url, $err_code, $err_msg); if (!$pt) { throw new CAS_ProxyTicketException($err_msg, $err_code); } $proxiedService->setProxyTicket($pt); } /** * This method is used to access an HTTP[S] service. * * @param string $url the service to access. * @param int &$err_code an error code Possible values are * PHPCAS_SERVICE_OK (on success), PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE, * PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE, PHPCAS_SERVICE_PT_FAILURE, * PHPCAS_SERVICE_NOT_AVAILABLE. * @param string &$output the output of the service (also used to give an error * message on failure). * * @return true on success, false otherwise (in this later case, $err_code * gives the reason why it failed and $output contains an error message). */ public function serviceWeb($url,&$err_code,&$output) { try { $service = $this->getProxiedService(PHPCAS_PROXIED_SERVICE_HTTP_GET); $service->setUrl($url); $service->send(); $output = $service->getResponseBody(); $err_code = PHPCAS_SERVICE_OK; return true; } catch (CAS_ProxyTicketException $e) { $err_code = $e->getCode(); $output = $e->getMessage(); return false; } catch (CAS_ProxiedService_Exception $e) { $lang = $this->getLangObj(); $output = sprintf($lang->getServiceUnavailable(), $url, $e->getMessage()); $err_code = PHPCAS_SERVICE_NOT_AVAILABLE; return false; } } /** * This method is used to access an IMAP/POP3/NNTP service. * * @param string $url a string giving the URL of the service, including * the mailing box for IMAP URLs, as accepted by imap_open(). * @param string $serviceUrl a string giving for CAS retrieve Proxy ticket * @param string $flags options given to imap_open(). * @param int &$err_code an error code Possible values are * PHPCAS_SERVICE_OK (on success), PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE, * PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE, PHPCAS_SERVICE_PT_FAILURE, * PHPCAS_SERVICE_NOT_AVAILABLE. * @param string &$err_msg an error message on failure * @param string &$pt the Proxy Ticket (PT) retrieved from the CAS * server to access the URL on success, false on error). * * @return object an IMAP stream on success, false otherwise (in this later * case, $err_code gives the reason why it failed and $err_msg contains an * error message). */ public function serviceMail($url,$serviceUrl,$flags,&$err_code,&$err_msg,&$pt) { try { $service = $this->getProxiedService(PHPCAS_PROXIED_SERVICE_IMAP); $service->setServiceUrl($serviceUrl); $service->setMailbox($url); $service->setOptions($flags); $stream = $service->open(); $err_code = PHPCAS_SERVICE_OK; $pt = $service->getImapProxyTicket(); return $stream; } catch (CAS_ProxyTicketException $e) { $err_msg = $e->getMessage(); $err_code = $e->getCode(); $pt = false; return false; } catch (CAS_ProxiedService_Exception $e) { $lang = $this->getLangObj(); $err_msg = sprintf( $lang->getServiceUnavailable(), $url, $e->getMessage() ); $err_code = PHPCAS_SERVICE_NOT_AVAILABLE; $pt = false; return false; } } /** @} **/ // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX // XX XX // XX PROXIED CLIENT FEATURES (CAS 2.0) XX // XX XX // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX // ######################################################################## // PT // ######################################################################## /** * @addtogroup internalService * @{ */ /** * This array will store a list of proxies in front of this application. This * property will only be populated if this script is being proxied rather than * accessed directly. * * It is set in CAS_Client::validateCAS20() and can be read by * CAS_Client::getProxies() * * @access private */ private $_proxies = array(); /** * Answer an array of proxies that are sitting in front of this application. * * This method will only return a non-empty array if we have received and * validated a Proxy Ticket. * * @return array * @access public */ public function getProxies() { return $this->_proxies; } /** * Set the Proxy array, probably from persistant storage. * * @param array $proxies An array of proxies * * @return void * @access private */ private function _setProxies($proxies) { $this->_proxies = $proxies; if (!empty($proxies)) { // For proxy-authenticated requests people are not viewing the URL // directly since the client is another application making a // web-service call. // Because of this, stripping the ticket from the URL is unnecessary // and causes another web-service request to be performed. Additionally, // if session handling on either the client or the server malfunctions // then the subsequent request will not complete successfully. $this->setNoClearTicketsFromUrl(); } } /** * A container of patterns to be allowed as proxies in front of the cas client. * * @var CAS_ProxyChain_AllowedList */ private $_allowed_proxy_chains; /** * Answer the CAS_ProxyChain_AllowedList object for this client. * * @return CAS_ProxyChain_AllowedList */ public function getAllowedProxyChains () { if (empty($this->_allowed_proxy_chains)) { $this->_allowed_proxy_chains = new CAS_ProxyChain_AllowedList(); } return $this->_allowed_proxy_chains; } /** @} */ // ######################################################################## // PT VALIDATION // ######################################################################## /** * @addtogroup internalProxied * @{ */ /** * This method is used to validate a cas 2.0 ST or PT; halt on failure * Used for all CAS 2.0 validations * * @param string &$validate_url the url of the reponse * @param string &$text_response the text of the repsones * @param string &$tree_response the domxml tree of the respones * * @return bool true when successfull and issue a CAS_AuthenticationException * and false on an error */ public function validateCAS20(&$validate_url,&$text_response,&$tree_response) { phpCAS::traceBegin(); phpCAS::trace($text_response); $result = false; // build the URL to validate the ticket if ($this->getAllowedProxyChains()->isProxyingAllowed()) { $validate_url = $this->getServerProxyValidateURL().'&ticket='.$this->getTicket(); } else { $validate_url = $this->getServerServiceValidateURL().'&ticket='.$this->getTicket(); } if ( $this->isProxy() ) { // pass the callback url for CAS proxies $validate_url .= '&pgtUrl='.urlencode($this->_getCallbackURL()); } // open and read the URL if ( !$this->_readURL($validate_url, $headers, $text_response, $err_msg) ) { phpCAS::trace('could not open URL \''.$validate_url.'\' to validate ('.$err_msg.')'); throw new CAS_AuthenticationException( $this, 'Ticket not validated', $validate_url, true/*$no_response*/ ); $result = false; } // create new DOMDocument object $dom = new DOMDocument(); // Fix possible whitspace problems $dom->preserveWhiteSpace = false; // CAS servers should only return data in utf-8 $dom->encoding = "utf-8"; // read the response of the CAS server into a DOMDocument object if ( !($dom->loadXML($text_response))) { // read failed throw new CAS_AuthenticationException( $this, 'Ticket not validated', $validate_url, false/*$no_response*/, true/*$bad_response*/, $text_response ); $result = false; } else if ( !($tree_response = $dom->documentElement) ) { // read the root node of the XML tree // read failed throw new CAS_AuthenticationException( $this, 'Ticket not validated', $validate_url, false/*$no_response*/, true/*$bad_response*/, $text_response ); $result = false; } else if ($tree_response->localName != 'serviceResponse') { // insure that tag name is 'serviceResponse' // bad root node throw new CAS_AuthenticationException( $this, 'Ticket not validated', $validate_url, false/*$no_response*/, true/*$bad_response*/, $text_response ); $result = false; } else if ($tree_response->getElementsByTagName("authenticationSuccess")->length != 0) { // authentication succeded, extract the user name $success_elements = $tree_response->getElementsByTagName("authenticationSuccess"); if ( $success_elements->item(0)->getElementsByTagName("user")->length == 0) { // no user specified => error throw new CAS_AuthenticationException( $this, 'Ticket not validated', $validate_url, false/*$no_response*/, true/*$bad_response*/, $text_response ); $result = false; } else { $this->_setUser(trim($success_elements->item(0)->getElementsByTagName("user")->item(0)->nodeValue)); $this->_readExtraAttributesCas20($success_elements); // Store the proxies we are sitting behind for authorization checking $proxyList = array(); if ( sizeof($arr = $success_elements->item(0)->getElementsByTagName("proxy")) > 0) { foreach ($arr as $proxyElem) { phpCAS::trace("Found Proxy: ".$proxyElem->nodeValue); $proxyList[] = trim($proxyElem->nodeValue); } $this->_setProxies($proxyList); phpCAS::trace("Storing Proxy List"); } // Check if the proxies in front of us are allowed if (!$this->getAllowedProxyChains()->isProxyListAllowed($proxyList)) { throw new CAS_AuthenticationException( $this, 'Proxy not allowed', $validate_url, false/*$no_response*/, true/*$bad_response*/, $text_response ); $result = false; } else { $result = true; } } } else if ( $tree_response->getElementsByTagName("authenticationFailure")->length != 0) { // authentication succeded, extract the error code and message $auth_fail_list = $tree_response->getElementsByTagName("authenticationFailure"); throw new CAS_AuthenticationException( $this, 'Ticket not validated', $validate_url, false/*$no_response*/, false/*$bad_response*/, $text_response, $auth_fail_list->item(0)->getAttribute('code')/*$err_code*/, trim($auth_fail_list->item(0)->nodeValue)/*$err_msg*/ ); $result = false; } else { throw new CAS_AuthenticationException( $this, 'Ticket not validated', $validate_url, false/*$no_response*/, true/*$bad_response*/, $text_response ); $result = false; } if ($result) { $this->_renameSession($this->getTicket()); } // at this step, Ticket has been validated and $this->_user has been set, phpCAS::traceEnd($result); return $result; } /** * This method will parse the DOM and pull out the attributes from the XML * payload and put them into an array, then put the array into the session. * * @param string $success_elements payload of the response * * @return bool true when successfull, halt otherwise by calling * CAS_Client::_authError(). */ private function _readExtraAttributesCas20($success_elements) { phpCAS::traceBegin(); $extra_attributes = array(); // "Jasig Style" Attributes: // // // // jsmith // // RubyCAS // Smith // John // CN=Staff,OU=Groups,DC=example,DC=edu // CN=Spanish Department,OU=Departments,OU=Groups,DC=example,DC=edu // // PGTIOU-84678-8a9d2sfa23casd // // // if ( $success_elements->item(0)->getElementsByTagName("attributes")->length != 0) { $attr_nodes = $success_elements->item(0)->getElementsByTagName("attributes"); phpCas :: trace("Found nested jasig style attributes"); if ($attr_nodes->item(0)->hasChildNodes()) { // Nested Attributes foreach ($attr_nodes->item(0)->childNodes as $attr_child) { phpCas :: trace("Attribute [".$attr_child->localName."] = ".$attr_child->nodeValue); $this->_addAttributeToArray($extra_attributes, $attr_child->localName, $attr_child->nodeValue); } } } else { // "RubyCAS Style" attributes // // // // jsmith // // RubyCAS // Smith // John // CN=Staff,OU=Groups,DC=example,DC=edu // CN=Spanish Department,OU=Departments,OU=Groups,DC=example,DC=edu // // PGTIOU-84678-8a9d2sfa23casd // // // phpCas :: trace("Testing for rubycas style attributes"); $childnodes = $success_elements->item(0)->childNodes; foreach ($childnodes as $attr_node) { switch ($attr_node->localName) { case 'user': case 'proxies': case 'proxyGrantingTicket': continue; default: if (strlen(trim($attr_node->nodeValue))) { phpCas :: trace("Attribute [".$attr_node->localName."] = ".$attr_node->nodeValue); $this->_addAttributeToArray($extra_attributes, $attr_node->localName, $attr_node->nodeValue); } } } } // "Name-Value" attributes. // // Attribute format from these mailing list thread: // http://jasig.275507.n4.nabble.com/CAS-attributes-and-how-they-appear-in-the-CAS-response-td264272.html // Note: This is a less widely used format, but in use by at least two institutions. // // // // jsmith // // // // // // // // PGTIOU-84678-8a9d2sfa23casd // // // if (!count($extra_attributes) && $success_elements->item(0)->getElementsByTagName("attribute")->length != 0) { $attr_nodes = $success_elements->item(0)->getElementsByTagName("attribute"); $firstAttr = $attr_nodes->item(0); if (!$firstAttr->hasChildNodes() && $firstAttr->hasAttribute('name') && $firstAttr->hasAttribute('value')) { phpCas :: trace("Found Name-Value style attributes"); // Nested Attributes foreach ($attr_nodes as $attr_node) { if ($attr_node->hasAttribute('name') && $attr_node->hasAttribute('value')) { phpCas :: trace("Attribute [".$attr_node->getAttribute('name')."] = ".$attr_node->getAttribute('value')); $this->_addAttributeToArray($extra_attributes, $attr_node->getAttribute('name'), $attr_node->getAttribute('value')); } } } } $this->setAttributes($extra_attributes); phpCAS::traceEnd(); return true; } /** * Add an attribute value to an array of attributes. * * @param array &$attributeArray reference to array * @param string $name name of attribute * @param string $value value of attribute * * @return void */ private function _addAttributeToArray(array &$attributeArray, $name, $value) { // If multiple attributes exist, add as an array value if (isset($attributeArray[$name])) { // Initialize the array with the existing value if (!is_array($attributeArray[$name])) { $existingValue = $attributeArray[$name]; $attributeArray[$name] = array($existingValue); } $attributeArray[$name][] = trim($value); } else { $attributeArray[$name] = trim($value); } } /** @} */ // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX // XX XX // XX MISC XX // XX XX // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX /** * @addtogroup internalMisc * @{ */ // ######################################################################## // URL // ######################################################################## /** * the URL of the current request (without any ticket CGI parameter). Written * and read by CAS_Client::getURL(). * * @hideinitializer */ private $_url = ''; /** * This method sets the URL of the current request * * @param string $url url to set for service * * @return void */ public function setURL($url) { $this->_url = $url; } /** * This method returns the URL of the current request (without any ticket * CGI parameter). * * @return The URL */ public function getURL() { phpCAS::traceBegin(); // the URL is built when needed only if ( empty($this->_url) ) { $final_uri = ''; // remove the ticket if present in the URL $final_uri = ($this->_isHttps()) ? 'https' : 'http'; $final_uri .= '://'; $final_uri .= $this->_getServerUrl(); $request_uri = explode('?', $_SERVER['REQUEST_URI'], 2); $final_uri .= $request_uri[0]; if (isset($request_uri[1]) && $request_uri[1]) { $query_string= $this->_removeParameterFromQueryString('ticket', $request_uri[1]); // If the query string still has anything left, append it to the final URI if ($query_string !== '') { $final_uri .= "?$query_string"; } } phpCAS::trace("Final URI: $final_uri"); $this->setURL($final_uri); } phpCAS::traceEnd($this->_url); return $this->_url; } /** * Try to figure out the server URL with possible Proxys / Ports etc. * * @return string Server URL with domain:port */ private function _getServerUrl() { $server_url = ''; if (!empty($_SERVER['HTTP_X_FORWARDED_HOST'])) { // explode the host list separated by comma and use the first host $hosts = explode(',', $_SERVER['HTTP_X_FORWARDED_HOST']); $server_url = $hosts[0]; } else if (!empty($_SERVER['HTTP_X_FORWARDED_SERVER'])) { $server_url = $_SERVER['HTTP_X_FORWARDED_SERVER']; } else { if (empty($_SERVER['SERVER_NAME'])) { $server_url = $_SERVER['HTTP_HOST']; } else { $server_url = $_SERVER['SERVER_NAME']; } } if (!strpos($server_url, ':')) { if (empty($_SERVER['HTTP_X_FORWARDED_PORT'])) { $server_port = $_SERVER['SERVER_PORT']; } else { $server_port = $_SERVER['HTTP_X_FORWARDED_PORT']; } if ( ($this->_isHttps() && $server_port!=443) || (!$this->_isHttps() && $server_port!=80) ) { $server_url .= ':'; $server_url .= $server_port; } } return $server_url; } /** * This method checks to see if the request is secured via HTTPS * * @return bool true if https, false otherwise */ private function _isHttps() { if ( isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') { return true; } else { return false; } } /** * Removes a parameter from a query string * * @param string $parameterName name of parameter * @param string $queryString query string * * @return string new query string * * @link http://stackoverflow.com/questions/1842681/regular-expression-to-remove-one-parameter-from-query-string */ private function _removeParameterFromQueryString($parameterName, $queryString) { $parameterName = preg_quote($parameterName); return preg_replace("/&$parameterName(=[^&]*)?|^$parameterName(=[^&]*)?&?/", '', $queryString); } /** * This method is used to append query parameters to an url. Since the url * might already contain parameter it has to be detected and to build a proper * URL * * @param string $url base url to add the query params to * @param string $query params in query form with & separated * * @return url with query params */ private function _buildQueryUrl($url, $query) { $url .= (strstr($url, '?') === false) ? '?' : '&'; $url .= $query; return $url; } /** * Renaming the session * * @param string $ticket name of the ticket * * @return void */ private function _renameSession($ticket) { phpCAS::traceBegin(); if ($this->getChangeSessionID()) { if (!empty($this->_user)) { $old_session = $_SESSION; session_destroy(); // set up a new session, of name based on the ticket $session_id = preg_replace('/[^a-zA-Z0-9\-]/', '', $ticket); phpCAS :: trace("Session ID: ".$session_id); session_id($session_id); session_start(); phpCAS :: trace("Restoring old session vars"); $_SESSION = $old_session; } else { phpCAS :: error('Session should only be renamed after successfull authentication'); } } else { phpCAS :: trace("Skipping session rename since phpCAS is not handling the session."); } phpCAS::traceEnd(); } // ######################################################################## // AUTHENTICATION ERROR HANDLING // ######################################################################## /** * This method is used to print the HTML output when the user was not * authenticated. * * @param string $failure the failure that occured * @param string $cas_url the URL the CAS server was asked for * @param bool $no_response the response from the CAS server (other * parameters are ignored if true) * @param bool $bad_response bad response from the CAS server ($err_code * and $err_msg ignored if true) * @param string $cas_response the response of the CAS server * @param int $err_code the error code given by the CAS server * @param string $err_msg the error message given by the CAS server * * @return void */ private function _authError( $failure, $cas_url, $no_response, $bad_response='', $cas_response='', $err_code='', $err_msg='' ) { phpCAS::traceBegin(); $lang = $this->getLangObj(); $this->printHTMLHeader($lang->getAuthenticationFailed()); printf($lang->getYouWereNotAuthenticated(), htmlentities($this->getURL()), $_SERVER['SERVER_ADMIN']); phpCAS::trace('CAS URL: '.$cas_url); phpCAS::trace('Authentication failure: '.$failure); if ( $no_response ) { phpCAS::trace('Reason: no response from the CAS server'); } else { if ( $bad_response ) { phpCAS::trace('Reason: bad response from the CAS server'); } else { switch ($this->getServerVersion()) { case CAS_VERSION_1_0: phpCAS::trace('Reason: CAS error'); break; case CAS_VERSION_2_0: if ( empty($err_code) ) { phpCAS::trace('Reason: no CAS error'); } else { phpCAS::trace('Reason: ['.$err_code.'] CAS error: '.$err_msg); } break; } } phpCAS::trace('CAS response: '.$cas_response); } $this->printHTMLFooter(); phpCAS::traceExit(); throw new CAS_GracefullTerminationException(); } // ######################################################################## // PGTIOU/PGTID and logoutRequest rebroadcasting // ######################################################################## /** * Boolean of whether to rebroadcast pgtIou/pgtId and logoutRequest, and * array of the nodes. */ private $_rebroadcast = false; private $_rebroadcast_nodes = array(); /** * Constants used for determining rebroadcast node type. */ const HOSTNAME = 0; const IP = 1; /** * Determine the node type from the URL. * * @param String $nodeURL The node URL. * * @return string hostname * */ private function _getNodeType($nodeURL) { phpCAS::traceBegin(); if (preg_match("/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/", $nodeURL)) { phpCAS::traceEnd(self::IP); return self::IP; } else { phpCAS::traceEnd(self::HOSTNAME); return self::HOSTNAME; } } /** * Store the rebroadcast node for pgtIou/pgtId and logout requests. * * @param string $rebroadcastNodeUrl The rebroadcast node URL. * * @return void */ public function addRebroadcastNode($rebroadcastNodeUrl) { // Store the rebroadcast node and set flag $this->_rebroadcast = true; $this->_rebroadcast_nodes[] = $rebroadcastNodeUrl; } /** * An array to store extra rebroadcast curl options. */ private $_rebroadcast_headers = array(); /** * This method is used to add header parameters when rebroadcasting * pgtIou/pgtId or logoutRequest. * * @param string $header Header to send when rebroadcasting. * * @return void */ public function addRebroadcastHeader($header) { $this->_rebroadcast_headers[] = $header; } /** * Constants used for determining rebroadcast type (logout or pgtIou/pgtId). */ const LOGOUT = 0; const PGTIOU = 1; /** * This method rebroadcasts logout/pgtIou requests. Can be LOGOUT,PGTIOU * * @param int $type type of rebroadcasting. * * @return void */ private function _rebroadcast($type) { phpCAS::traceBegin(); $rebroadcast_curl_options = array( CURLOPT_FAILONERROR => 1, CURLOPT_FOLLOWLOCATION => 1, CURLOPT_RETURNTRANSFER => 1, CURLOPT_CONNECTTIMEOUT => 1, CURLOPT_TIMEOUT => 4); // Try to determine the IP address of the server if (!empty($_SERVER['SERVER_ADDR'])) { $ip = $_SERVER['SERVER_ADDR']; } else if (!empty($_SERVER['LOCAL_ADDR'])) { // IIS 7 $ip = $_SERVER['LOCAL_ADDR']; } // Try to determine the DNS name of the server if (!empty($ip)) { $dns = gethostbyaddr($ip); } $multiClassName = 'CAS_Request_CurlMultiRequest'; $multiRequest = new $multiClassName(); for ($i = 0; $i < sizeof($this->_rebroadcast_nodes); $i++) { if ((($this->_getNodeType($this->_rebroadcast_nodes[$i]) == self::HOSTNAME) && !empty($dns) && (stripos($this->_rebroadcast_nodes[$i], $dns) === false)) || (($this->_getNodeType($this->_rebroadcast_nodes[$i]) == self::IP) && !empty($ip) && (stripos($this->_rebroadcast_nodes[$i], $ip) === false))) { phpCAS::trace('Rebroadcast target URL: '.$this->_rebroadcast_nodes[$i].$_SERVER['REQUEST_URI']); $className = $this->_requestImplementation; $request = new $className(); $url = $this->_rebroadcast_nodes[$i].$_SERVER['REQUEST_URI']; $request->setUrl($url); if (count($this->_rebroadcast_headers)) { $request->addHeaders($this->_rebroadcast_headers); } $request->makePost(); if ($type == self::LOGOUT) { // Logout request $request->setPostBody('rebroadcast=false&logoutRequest='.$_POST['logoutRequest']); } else if ($type == self::PGTIOU) { // pgtIou/pgtId rebroadcast $request->setPostBody('rebroadcast=false'); } $request->setCurlOptions($rebroadcast_curl_options); $multiRequest->addRequest($request); } else { phpCAS::trace('Rebroadcast not sent to self: '.$this->_rebroadcast_nodes[$i].' == '.(!empty($ip)?$ip:'').'/'.(!empty($dns)?$dns:'')); } } // We need at least 1 request if ($multiRequest->getNumRequests() > 0) { $multiRequest->send(); } phpCAS::traceEnd(); } /** @} */ } ?> glpi-0.84.3+dfsg.1/lib/phpcas/CAS/CookieJar.php000066400000000000000000000275751226600447100206520ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * This class provides access to service cookies and handles parsing of response * headers to pull out cookie values. * * @class CAS_CookieJar * @category Authentication * @package PhpCAS * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ class CAS_CookieJar { private $_cookies; /** * Create a new cookie jar by passing it a reference to an array in which it * should store cookies. * * @param array &$storageArray Array to store cookies * * @return void */ public function __construct (array &$storageArray) { $this->_cookies =& $storageArray; } /** * Store cookies for a web service request. * Cookie storage is based on RFC 2965: http://www.ietf.org/rfc/rfc2965.txt * * @param string $request_url The URL that generated the response headers. * @param array $response_headers An array of the HTTP response header strings. * * @return void * * @access private */ public function storeCookies ($request_url, $response_headers) { $urlParts = parse_url($request_url); $defaultDomain = $urlParts['host']; $cookies = $this->parseCookieHeaders($response_headers, $defaultDomain); // var_dump($cookies); foreach ($cookies as $cookie) { // Enforce the same-origin policy by verifying that the cookie // would match the url that is setting it if (!$this->cookieMatchesTarget($cookie, $urlParts)) { continue; } // store the cookie $this->storeCookie($cookie); phpCAS::trace($cookie['name'].' -> '.$cookie['value']); } } /** * Retrieve cookies applicable for a web service request. * Cookie applicability is based on RFC 2965: http://www.ietf.org/rfc/rfc2965.txt * * @param string $request_url The url that the cookies will be for. * * @return array An array containing cookies. E.g. array('name' => 'val'); * * @access private */ public function getCookies ($request_url) { if (!count($this->_cookies)) { return array(); } // If our request URL can't be parsed, no cookies apply. $target = parse_url($request_url); if ($target === false) { return array(); } $this->expireCookies(); $matching_cookies = array(); foreach ($this->_cookies as $key => $cookie) { if ($this->cookieMatchesTarget($cookie, $target)) { $matching_cookies[$cookie['name']] = $cookie['value']; } } return $matching_cookies; } /** * Parse Cookies without PECL * From the comments in http://php.net/manual/en/function.http-parse-cookie.php * * @param array $header array of header lines. * @param string $defaultDomain The domain to use if none is specified in * the cookie. * * @return array of cookies */ protected function parseCookieHeaders( $header, $defaultDomain ) { phpCAS::traceBegin(); $cookies = array(); foreach ( $header as $line ) { if ( preg_match('/^Set-Cookie2?: /i', $line)) { $cookies[] = $this->parseCookieHeader($line, $defaultDomain); } } phpCAS::traceEnd($cookies); return $cookies; } /** * Parse a single cookie header line. * * Based on RFC2965 http://www.ietf.org/rfc/rfc2965.txt * * @param string $line The header line. * @param string $defaultDomain The domain to use if none is specified in * the cookie. * * @return array */ protected function parseCookieHeader ($line, $defaultDomain) { if (!$defaultDomain) { throw new CAS_InvalidArgumentException('$defaultDomain was not provided.'); } // Set our default values $cookie = array( 'domain' => $defaultDomain, 'path' => '/', 'secure' => false, ); $line = preg_replace('/^Set-Cookie2?: /i', '', trim($line)); // trim any trailing semicolons. $line = trim($line, ';'); phpCAS::trace("Cookie Line: $line"); // This implementation makes the assumption that semicolons will not // be present in quoted attribute values. While attribute values that // contain semicolons are allowed by RFC2965, they are hopefully rare // enough to ignore for our purposes. Most browsers make the same // assumption. $attributeStrings = explode(';', $line); foreach ( $attributeStrings as $attributeString ) { // split on the first equals sign and use the rest as value $attributeParts = explode('=', $attributeString, 2); $attributeName = trim($attributeParts[0]); $attributeNameLC = strtolower($attributeName); if (isset($attributeParts[1])) { $attributeValue = trim($attributeParts[1]); // Values may be quoted strings. if (strpos($attributeValue, '"') === 0) { $attributeValue = trim($attributeValue, '"'); // unescape any escaped quotes: $attributeValue = str_replace('\"', '"', $attributeValue); } } else { $attributeValue = null; } switch ($attributeNameLC) { case 'expires': $cookie['expires'] = strtotime($attributeValue); break; case 'max-age': $cookie['max-age'] = (int)$attributeValue; // Set an expiry time based on the max-age if ($cookie['max-age']) { $cookie['expires'] = time() + $cookie['max-age']; } else { // If max-age is zero, then the cookie should be removed // imediately so set an expiry before now. $cookie['expires'] = time() - 1; } break; case 'secure': $cookie['secure'] = true; break; case 'domain': case 'path': case 'port': case 'version': case 'comment': case 'commenturl': case 'discard': case 'httponly': $cookie[$attributeNameLC] = $attributeValue; break; default: $cookie['name'] = $attributeName; $cookie['value'] = $attributeValue; } } return $cookie; } /** * Add, update, or remove a cookie. * * @param array $cookie A cookie array as created by parseCookieHeaders() * * @return void * * @access protected */ protected function storeCookie ($cookie) { // Discard any old versions of this cookie. $this->discardCookie($cookie); $this->_cookies[] = $cookie; } /** * Discard an existing cookie * * @param array $cookie An cookie * * @return void * * @access protected */ protected function discardCookie ($cookie) { if (!isset($cookie['domain']) || !isset($cookie['path']) || !isset($cookie['path']) ) { throw new CAS_InvalidArgumentException('Invalid Cookie array passed.'); } foreach ($this->_cookies as $key => $old_cookie) { if ( $cookie['domain'] == $old_cookie['domain'] && $cookie['path'] == $old_cookie['path'] && $cookie['name'] == $old_cookie['name'] ) { unset($this->_cookies[$key]); } } } /** * Go through our stored cookies and remove any that are expired. * * @return void * * @access protected */ protected function expireCookies () { foreach ($this->_cookies as $key => $cookie) { if (isset($cookie['expires']) && $cookie['expires'] < time()) { unset($this->_cookies[$key]); } } } /** * Answer true if cookie is applicable to a target. * * @param array $cookie An array of cookie attributes. * @param array $target An array of URL attributes as generated by parse_url(). * * @return bool * * @access private */ protected function cookieMatchesTarget ($cookie, $target) { if (!is_array($target)) { throw new CAS_InvalidArgumentException('$target must be an array of URL attributes as generated by parse_url().'); } if (!isset($target['host'])) { throw new CAS_InvalidArgumentException('$target must be an array of URL attributes as generated by parse_url().'); } // Verify that the scheme matches if ($cookie['secure'] && $target['scheme'] != 'https') { return false; } // Verify that the host matches // Match domain and mulit-host cookies if (strpos($cookie['domain'], '.') === 0) { // .host.domain.edu cookies are valid for host.domain.edu if (substr($cookie['domain'], 1) == $target['host']) { // continue with other checks } else { // non-exact host-name matches. // check that the target host a.b.c.edu is within .b.c.edu $pos = strripos($target['host'], $cookie['domain']); if (!$pos) { return false; } // verify that the cookie domain is the last part of the host. if ($pos + strlen($cookie['domain']) != strlen($target['host'])) { return false; } // verify that the host name does not contain interior dots as per // RFC 2965 section 3.3.2 Rejecting Cookies // http://www.ietf.org/rfc/rfc2965.txt $hostname = substr($target['host'], 0, $pos); if (strpos($hostname, '.') !== false) { return false; } } } else { // If the cookie host doesn't begin with '.', the host must case-insensitive // match exactly if (strcasecmp($target['host'], $cookie['domain']) !== 0) { return false; } } // Verify that the port matches if (isset($cookie['ports']) && !in_array($target['port'], $cookie['ports'])) { return false; } // Verify that the path matches if (strpos($target['path'], $cookie['path']) !== 0) { return false; } return true; } } ?> glpi-0.84.3+dfsg.1/lib/phpcas/CAS/Exception.php000066400000000000000000000036761226600447100207360ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * A root exception interface for all exceptions in phpCAS. * * All exceptions thrown in phpCAS should implement this interface to allow them * to be caught as a category by clients. Each phpCAS exception should extend * an appropriate SPL exception class that best fits its type. * * For example, an InvalidArgumentException in phpCAS should be defined as * * class CAS_InvalidArgumentException * extends InvalidArgumentException * implements CAS_Exception * { } * * This definition allows the CAS_InvalidArgumentException to be caught as either * an InvalidArgumentException or as a CAS_Exception. * * @class CAS_Exception * @category Authentication * @package PhpCAS * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS * */ interface CAS_Exception { } ?>glpi-0.84.3+dfsg.1/lib/phpcas/CAS/GracefullTerminationException.php000066400000000000000000000055671226600447100247760ustar00rootroot00000000000000 * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * An exception for terminatinating execution or to throw for unit testing * * @class CAS_GracefullTerminationException.php * @category Authentication * @package PhpCAS * @author Joachim Fritschi * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ class CAS_GracefullTerminationException extends RuntimeException implements CAS_Exception { /** * Test if exceptions should be thrown or if we should just exit. * In production usage we want to just exit cleanly when prompting the user * for a redirect without filling the error logs with uncaught exceptions. * In unit testing scenarios we cannot exit or we won't be able to continue * with our tests. * * @param string $message Message Text * @param string $code Error code * * @return void */ public function __construct ($message = 'Terminate Gracefully', $code = 0) { // Exit cleanly to avoid filling up the logs with uncaught exceptions. if (self::$_exitWhenThrown) { exit; } else { // Throw exceptions to allow unit testing to continue; parent::__construct($message, $code); } } private static $_exitWhenThrown = true; /** * Force phpcas to thow Exceptions instead of calling exit() * Needed for unit testing. Generally shouldn't be used in production due to * an increase in Apache error logging if CAS_GracefulTerminiationExceptions * are not caught and handled. * * @return void */ public static function throwInsteadOfExiting() { self::$_exitWhenThrown = false; } } ?>glpi-0.84.3+dfsg.1/lib/phpcas/CAS/InvalidArgumentException.php000066400000000000000000000027531226600447100237430ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * Exception that denotes invalid arguments were passed. * * @class CAS_InvalidArgumentException * @category Authentication * @package PhpCAS * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ class CAS_InvalidArgumentException extends InvalidArgumentException implements CAS_Exception { } ?>glpi-0.84.3+dfsg.1/lib/phpcas/CAS/Languages/000077500000000000000000000000001226600447100201615ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/phpcas/CAS/Languages/Catalan.php000066400000000000000000000062731226600447100222450ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * Catalan language class * * @class CAS_Languages_Catalan * @category Authentication * @package PhpCAS * @author Iván-Benjamín García Torà * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS * * @sa @link internalLang Internationalization @endlink * @ingroup internalLang */ class CAS_Languages_Catalan implements CAS_Languages_LanguageInterface { /** * Get the using server string * * @return string using server */ public function getUsingServer() { return 'usant servidor'; } /** * Get authentication wanted string * * @return string authentication wanted */ public function getAuthenticationWanted() { return 'Autentificació CAS necessària!'; } /** * Get logout string * * @return string logout */ public function getLogout() { return 'Sortida de CAS necessària!'; } /** * Get the should have been redirected string * * @return string should habe been redirected */ public function getShouldHaveBeenRedirected() { return 'Ja hauria d\ haver estat redireccionat al servidor CAS. Feu click aquí per a continuar.'; } /** * Get authentication failed string * * @return string authentication failed */ public function getAuthenticationFailed() { return 'Autentificació CAS fallida!'; } /** * Get the your were not authenticated string * * @return string not authenticated */ public function getYouWereNotAuthenticated() { return '

    No estàs autentificat.

    Pots tornar a intentar-ho fent click aquí.

    Si el problema persisteix hauría de contactar amb l\'administrador d\'aquest llocc.

    '; } /** * Get the service unavailable string * * @return string service unavailable */ public function getServiceUnavailable() { return 'El servei `%s\' no està disponible (%s).'; } } glpi-0.84.3+dfsg.1/lib/phpcas/CAS/Languages/English.php000066400000000000000000000062361226600447100222720ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * English language class * * @class CAS_Languages_English * @category Authentication * @package PhpCAS * @author Pascal Aubry * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS * * @sa @link internalLang Internationalization @endlink * @ingroup internalLang */ class CAS_Languages_English implements CAS_Languages_LanguageInterface { /** * Get the using server string * * @return string using server */ public function getUsingServer() { return 'using server'; } /** * Get authentication wanted string * * @return string authentication wanted */ public function getAuthenticationWanted() { return 'CAS Authentication wanted!'; } /** * Get logout string * * @return string logout */ public function getLogout() { return 'CAS logout wanted!'; } /** * Get the should have been redirected string * * @return string should habe been redirected */ public function getShouldHaveBeenRedirected() { return 'You should already have been redirected to the CAS server. Click here to continue.'; } /** * Get authentication failed string * * @return string authentication failed */ public function getAuthenticationFailed() { return 'CAS Authentication failed!'; } /** * Get the your were not authenticated string * * @return string not authenticated */ public function getYouWereNotAuthenticated() { return '

    You were not authenticated.

    You may submit your request again by clicking here.

    If the problem persists, you may contact the administrator of this site.

    '; } /** * Get the service unavailable string * * @return string service unavailable */ public function getServiceUnavailable() { return 'The service `%s\' is not available (%s).'; } }glpi-0.84.3+dfsg.1/lib/phpcas/CAS/Languages/French.php000066400000000000000000000063601226600447100221040ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * French language class * * @class CAS_Languages_French * @category Authentication * @package PhpCAS * @author Pascal Aubry * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS * * @sa @link internalLang Internationalization @endlink * @ingroup internalLang */ class CAS_Languages_French implements CAS_Languages_LanguageInterface { /** * Get the using server string * * @return string using server */ public function getUsingServer() { return 'utilisant le serveur'; } /** * Get authentication wanted string * * @return string authentication wanted */ public function getAuthenticationWanted() { return 'Authentication CAS nécessaire !'; } /** * Get logout string * * @return string logout */ public function getLogout() { return 'Déconnexion demandée !'; } /** * Get the should have been redirected string * * @return string should habe been redirected */ public function getShouldHaveBeenRedirected() { return 'Vous auriez du etre redirigé(e) vers le serveur CAS. Cliquez ici pour continuer.'; } /** * Get authentication failed string * * @return string authentication failed */ public function getAuthenticationFailed() { return 'Authentification CAS infructueuse !'; } /** * Get the your were not authenticated string * * @return string not authenticated */ public function getYouWereNotAuthenticated() { return '

    Vous n\'avez pas été authentifié(e).

    Vous pouvez soumettre votre requete à nouveau en cliquant ici.

    Si le problème persiste, vous pouvez contacter l\'administrateur de ce site.

    '; } /** * Get the service unavailable string * * @return string service unavailable */ public function getServiceUnavailable() { return 'Le service `%s\' est indisponible (%s)'; } } ?>glpi-0.84.3+dfsg.1/lib/phpcas/CAS/Languages/German.php000066400000000000000000000063051226600447100221070ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * German language class * * @class CAS_Languages_German * @category Authentication * @package PhpCAS * @author Henrik Genssen * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS * * @sa @link internalLang Internationalization @endlink * @ingroup internalLang */ class CAS_Languages_German implements CAS_Languages_LanguageInterface { /** * Get the using server string * * @return string using server */ public function getUsingServer() { return 'via Server'; } /** * Get authentication wanted string * * @return string authentication wanted */ public function getAuthenticationWanted() { return 'CAS Authentifizierung erforderlich!'; } /** * Get logout string * * @return string logout */ public function getLogout() { return 'CAS Abmeldung!'; } /** * Get the should have been redirected string * * @return string should habe been redirected */ public function getShouldHaveBeenRedirected() { return 'eigentlich häten Sie zum CAS Server weitergeleitet werden sollen. Drücken Sie hier um fortzufahren.'; } /** * Get authentication failed string * * @return string authentication failed */ public function getAuthenticationFailed() { return 'CAS Anmeldung fehlgeschlagen!'; } /** * Get the your were not authenticated string * * @return string not authenticated */ public function getYouWereNotAuthenticated() { return '

    Sie wurden nicht angemeldet.

    Um es erneut zu versuchen klicken Sie hier.

    Wenn das Problem bestehen bleibt, kontkatieren Sie den Administrator dieser Seite.

    '; } /** * Get the service unavailable string * * @return string service unavailable */ public function getServiceUnavailable() { return 'Der Dienst `%s\' ist nicht verfügbar (%s).'; } } ?>glpi-0.84.3+dfsg.1/lib/phpcas/CAS/Languages/Greek.php000066400000000000000000000067511226600447100217400ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * Greek language class * * @class CAS_Languages_Greek * @category Authentication * @package PhpCAS * @author Vangelis Haniotakis * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS * * @sa @link internalLang Internationalization @endlink * @ingroup internalLang */ class CAS_Languages_Greek implements CAS_Languages_LanguageInterface { /** * Get the using server string * * @return string using server */ public function getUsingServer() { return '÷ñçóéìïðïéåßôáé ï åîõðçñåôçôÞò'; } /** * Get authentication wanted string * * @return string authentication wanted */ public function getAuthenticationWanted() { return 'Áðáéôåßôáé ç ôáõôïðïßçóç CAS!'; } /** * Get logout string * * @return string logout */ public function getLogout() { return 'Áðáéôåßôáé ç áðïóýíäåóç áðü CAS!'; } /** * Get the should have been redirected string * * @return string should habe been redirected */ public function getShouldHaveBeenRedirected() { return 'Èá Ýðñåðå íá åß÷áôå áíáêáôåõèõíèåß óôïí åîõðçñåôçôÞ CAS. ÊÜíôå êëßê åäþ ãéá íá óõíå÷ßóåôå.'; } /** * Get authentication failed string * * @return string authentication failed */ public function getAuthenticationFailed() { return 'Ç ôáõôïðïßçóç CAS áðÝôõ÷å!'; } /** * Get the your were not authenticated string * * @return string not authenticated */ public function getYouWereNotAuthenticated() { return '

    Äåí ôáõôïðïéçèÞêáôå.

    Ìðïñåßôå íá îáíáðñïóðáèÞóåôå, êÜíïíôáò êëßê åäþ.

    Åáí ôï ðñüâëçìá åðéìåßíåé, åëÜôå óå åðáöÞ ìå ôïí äéá÷åéñéóôÞ.

    '; } /** * Get the service unavailable string * * @return string service unavailable */ public function getServiceUnavailable() { return 'Ç õðçñåóßá `%s\' äåí åßíáé äéáèÝóéìç (%s).'; } } ?>glpi-0.84.3+dfsg.1/lib/phpcas/CAS/Languages/Japanese.php000066400000000000000000000066301226600447100224250ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * Japanese language class. Now Encoding is EUC-JP and LF * * @class CAS_Languages_Japanese * @category Authentication * @package PhpCAS * @author fnorif * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS * **/ class CAS_Languages_Japanese implements CAS_Languages_LanguageInterface { /** * Get the using server string * * @return string using server */ public function getUsingServer() { return 'using server'; } /** * Get authentication wanted string * * @return string authentication wanted */ public function getAuthenticationWanted() { return 'CAS�ˤ��ǧ�ڤ�Ԥ��ޤ�'; } /** * Get logout string * * @return string logout */ public function getLogout() { return 'CAS����?�����Ȥ��ޤ�!'; } /** * Get the should have been redirected string * * @return string should habe been redirected */ public function getShouldHaveBeenRedirected() { return 'CAS�����Ф˹Ԥ�ɬ�פ�����ޤ�����ưŪ��ž������ʤ����� ������ �򥯥�å�����³�Ԥ��ޤ��'; } /** * Get authentication failed string * * @return string authentication failed */ public function getAuthenticationFailed() { return 'CAS�ˤ��ǧ�ڤ˼��Ԥ��ޤ���'; } /** * Get the your were not authenticated string * * @return string not authenticated */ public function getYouWereNotAuthenticated() { return '

    ǧ�ڤǤ��ޤ���Ǥ���.

    �⤦���٥ꥯ�����Ȥ�������������������򥯥�å�.

    ���꤬��褷�ʤ����� ���Υ����Ȥδ�������䤤��碌�Ƥ�������.

    '; } /** * Get the service unavailable string * * @return string service unavailable */ public function getServiceUnavailable() { return '�����ӥ� `%s\' �����ѤǤ��ޤ��� (%s).'; } } ?>glpi-0.84.3+dfsg.1/lib/phpcas/CAS/Languages/LanguageInterface.php000066400000000000000000000050621226600447100242410ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * Language Interface class for all internationalization files * * @class CAS_Languages_LanguageInterface * @category Authentication * @package PhpCAS * @author Joachim Fritschi * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS * * @sa @link internalLang Internationalization @endlink * @ingroup internalLang */ interface CAS_Languages_LanguageInterface { /** * Get the using server string * * @return string using server */ public function getUsingServer(); /** * Get authentication wanted string * * @return string authentication wanted */ public function getAuthenticationWanted(); /** * Get logout string * * @return string logout */ public function getLogout(); /** * Get the should have been redirected string * * @return string should habe been redirected */ public function getShouldHaveBeenRedirected(); /** * Get authentication failed string * * @return string authentication failed */ public function getAuthenticationFailed(); /** * Get the your were not authenticated string * * @return string not authenticated */ public function getYouWereNotAuthenticated(); /** * Get the service unavailable string * * @return string service unavailable */ public function getServiceUnavailable(); } ?>glpi-0.84.3+dfsg.1/lib/phpcas/CAS/Languages/Spanish.php000066400000000000000000000063361226600447100223070ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * Spanish language class * * @class CAS_Languages_Spanish * @category Authentication * @package PhpCAS * @author Iván-Benjamín García Torà * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS * * @sa @link internalLang Internationalization @endlink * @ingroup internalLang */ class CAS_Languages_Spanish implements CAS_Languages_LanguageInterface { /** * Get the using server string * * @return string using server */ public function getUsingServer() { return 'usando servidor'; } /** * Get authentication wanted string * * @return string authentication wanted */ public function getAuthenticationWanted() { return '¡Autentificación CAS necesaria!'; } /** * Get logout string * * @return string logout */ public function getLogout() { return '¡Salida CAS necesaria!'; } /** * Get the should have been redirected string * * @return string should habe been redirected */ public function getShouldHaveBeenRedirected() { return 'Ya debería haber sido redireccionado al servidor CAS. Haga click aquí para continuar.'; } /** * Get authentication failed string * * @return string authentication failed */ public function getAuthenticationFailed() { return '¡Autentificación CAS fallida!'; } /** * Get the your were not authenticated string * * @return string not authenticated */ public function getYouWereNotAuthenticated() { return '

    No estás autentificado.

    Puedes volver a intentarlo haciendo click aquí.

    Si el problema persiste debería contactar con el administrador de este sitio.

    '; } /** * Get the service unavailable string * * @return string service unavailable */ public function getServiceUnavailable() { return 'El servicio `%s\' no está disponible (%s).'; } } ?> glpi-0.84.3+dfsg.1/lib/phpcas/CAS/OutOfSequenceException.php000066400000000000000000000032321226600447100233700ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * This class defines Exceptions that should be thrown when the sequence of * operations is invalid. Examples are: * - Requesting the response before executing a request. * - Changing the URL of a request after executing the request. * * @class CAS_OutOfSequenceException * @category Authentication * @package PhpCAS * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ class CAS_OutOfSequenceException extends BadMethodCallException implements CAS_Exception { } glpi-0.84.3+dfsg.1/lib/phpcas/CAS/PGTStorage/000077500000000000000000000000001226600447100202325ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/phpcas/CAS/PGTStorage/AbstractStorage.php000066400000000000000000000137411226600447100240410ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * Basic class for PGT storage * The CAS_PGTStorage_AbstractStorage class is a generic class for PGT storage. * This class should not be instanciated itself but inherited by specific PGT * storage classes. * * @class CAS_PGTStorage_AbstractStorage * @category Authentication * @package PhpCAS * @author Pascal Aubry * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS * * @ingroup internalPGTStorage */ abstract class CAS_PGTStorage_AbstractStorage { /** * @addtogroup internalPGTStorage * @{ */ // ######################################################################## // CONSTRUCTOR // ######################################################################## /** * The constructor of the class, should be called only by inherited classes. * * @param CAS_Client $cas_parent the CAS _client instance that creates the * current object. * * @return void * * @protected */ function __construct($cas_parent) { phpCAS::traceBegin(); if ( !$cas_parent->isProxy() ) { phpCAS::error('defining PGT storage makes no sense when not using a CAS proxy'); } phpCAS::traceEnd(); } // ######################################################################## // DEBUGGING // ######################################################################## /** * This virtual method returns an informational string giving the type of storage * used by the object (used for debugging purposes). * * @return void * * @public */ function getStorageType() { phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called'); } /** * This virtual method returns an informational string giving informations on the * parameters of the storage.(used for debugging purposes). * * @return void * * @public */ function getStorageInfo() { phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called'); } // ######################################################################## // ERROR HANDLING // ######################################################################## /** * string used to store an error message. Written by * PGTStorage::setErrorMessage(), read by PGTStorage::getErrorMessage(). * * @hideinitializer * @deprecated not used. */ var $_error_message=false; /** * This method sets en error message, which can be read later by * PGTStorage::getErrorMessage(). * * @param string $error_message an error message * * @return void * * @deprecated not used. */ function setErrorMessage($error_message) { $this->_error_message = $error_message; } /** * This method returns an error message set by PGTStorage::setErrorMessage(). * * @return an error message when set by PGTStorage::setErrorMessage(), FALSE * otherwise. * * @deprecated not used. */ function getErrorMessage() { return $this->_error_message; } // ######################################################################## // INITIALIZATION // ######################################################################## /** * a boolean telling if the storage has already been initialized. Written by * PGTStorage::init(), read by PGTStorage::isInitialized(). * * @hideinitializer */ var $_initialized = false; /** * This method tells if the storage has already been intialized. * * @return a boolean * * @protected */ function isInitialized() { return $this->_initialized; } /** * This virtual method initializes the object. * * @return void */ function init() { $this->_initialized = true; } // ######################################################################## // PGT I/O // ######################################################################## /** * This virtual method stores a PGT and its corresponding PGT Iuo. * * @param string $pgt the PGT * @param string $pgt_iou the PGT iou * * @return void * * @note Should never be called. * */ function write($pgt,$pgt_iou) { phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called'); } /** * This virtual method reads a PGT corresponding to a PGT Iou and deletes * the corresponding storage entry. * * @param string $pgt_iou the PGT iou * * @return void * * @note Should never be called. */ function read($pgt_iou) { phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called'); } /** @} */ } ?> glpi-0.84.3+dfsg.1/lib/phpcas/CAS/PGTStorage/Db.php000066400000000000000000000310271226600447100212730ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ define('CAS_PGT_STORAGE_DB_DEFAULT_TABLE', 'cas_pgts'); /** * Basic class for PGT database storage * The CAS_PGTStorage_Db class is a class for PGT database storage. * * @class CAS_PGTStorage_Db * @category Authentication * @package PhpCAS * @author Daniel Frett * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS * * @ingroup internalPGTStorageDb */ class CAS_PGTStorage_Db extends CAS_PGTStorage_AbstractStorage { /** * @addtogroup internalCAS_PGTStorageDb * @{ */ /** * the PDO object to use for database interactions */ private $_pdo; /** * This method returns the PDO object to use for database interactions. * * @return the PDO object */ private function _getPdo() { return $this->_pdo; } /** * database connection options to use when creating a new PDO object */ private $_dsn; private $_username; private $_password; private $_table_options; /** * the table to use for storing/retrieving pgt's */ private $_table; /** * This method returns the table to use when storing/retrieving PGT's * * @return the name of the pgt storage table. */ private function _getTable() { return $this->_table; } // ######################################################################## // DEBUGGING // ######################################################################## /** * This method returns an informational string giving the type of storage * used by the object (used for debugging purposes). * * @return an informational string. */ public function getStorageType() { return "db"; } /** * This method returns an informational string giving informations on the * parameters of the storage.(used for debugging purposes). * * @return an informational string. * @public */ public function getStorageInfo() { return 'table=`'.$this->_getTable().'\''; } // ######################################################################## // CONSTRUCTOR // ######################################################################## /** * The class constructor. * * @param CAS_Client $cas_parent the CAS_Client instance that creates * the object. * @param string $dsn_or_pdo a dsn string to use for creating a PDO * object or a PDO object * @param string $username the username to use when connecting to * the database * @param string $password the password to use when connecting to * the database * @param string $table the table to use for storing and * retrieving PGT's * @param string $driver_options any driver options to use when * connecting to the database */ public function __construct($cas_parent, $dsn_or_pdo, $username='', $password='', $table='', $driver_options=null) { phpCAS::traceBegin(); // call the ancestor's constructor parent::__construct($cas_parent); // set default values if ( empty($table) ) { $table = CAS_PGT_STORAGE_DB_DEFAULT_TABLE; } if ( !is_array($driver_options) ) { $driver_options = array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION); } // store the specified parameters if ($dsn_or_pdo instanceof PDO) { $this->_pdo = $dsn_or_pdo; } else { $this->_dsn = $dsn_or_pdo; $this->_username = $username; $this->_password = $password; $this->_driver_options = $driver_options; } // store the table name $this->_table = $table; phpCAS::traceEnd(); } // ######################################################################## // INITIALIZATION // ######################################################################## /** * This method is used to initialize the storage. Halts on error. * * @return void */ public function init() { phpCAS::traceBegin(); // if the storage has already been initialized, return immediatly if ($this->isInitialized()) { return; } // initialize the base object parent::init(); // create the PDO object if it doesn't exist already if (!($this->_pdo instanceof PDO)) { try { $this->_pdo = new PDO($this->_dsn, $this->_username, $this->_password, $this->_driver_options); } catch(PDOException $e) { phpCAS::error('Database connection error: ' . $e->getMessage()); } } phpCAS::traceEnd(); } // ######################################################################## // PDO database interaction // ######################################################################## /** * attribute that stores the previous error mode for the PDO handle while * processing a transaction */ private $_errMode; /** * This method will enable the Exception error mode on the PDO object * * @return void */ private function _setErrorMode() { // get PDO object and enable exception error mode $pdo = $this->_getPdo(); $this->_errMode = $pdo->getAttribute(PDO::ATTR_ERRMODE); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } /** * this method will reset the error mode on the PDO object * * @return void */ private function _resetErrorMode() { // get PDO object and reset the error mode to what it was originally $pdo = $this->_getPdo(); $pdo->setAttribute(PDO::ATTR_ERRMODE, $this->_errMode); } // ######################################################################## // database queries // ######################################################################## // these queries are potentially unsafe because the person using this library // can set the table to use, but there is no reliable way to escape SQL // fieldnames in PDO yet /** * This method returns the query used to create a pgt storage table * * @return the create table SQL, no bind params in query */ protected function createTableSql() { return 'CREATE TABLE ' . $this->_getTable() . ' (pgt_iou VARCHAR(255) NOT NULL PRIMARY KEY, pgt VARCHAR(255) NOT NULL)'; } /** * This method returns the query used to store a pgt * * @return the store PGT SQL, :pgt and :pgt_iou are the bind params contained in the query */ protected function storePgtSql() { return 'INSERT INTO ' . $this->_getTable() . ' (pgt_iou, pgt) VALUES (:pgt_iou, :pgt)'; } /** * This method returns the query used to retrieve a pgt. the first column of the first row should contain the pgt * * @return the retrieve PGT SQL, :pgt_iou is the only bind param contained in the query */ protected function retrievePgtSql() { return 'SELECT pgt FROM ' . $this->_getTable() . ' WHERE pgt_iou = :pgt_iou'; } /** * This method returns the query used to delete a pgt. * * @return the delete PGT SQL, :pgt_iou is the only bind param contained in the query */ protected function deletePgtSql() { return 'DELETE FROM ' . $this->_getTable() . ' WHERE pgt_iou = :pgt_iou'; } // ######################################################################## // PGT I/O // ######################################################################## /** * This method creates the database table used to store pgt's and pgtiou's * * @return void */ public function createTable() { phpCAS::traceBegin(); // initialize this PGTStorage object if it hasn't been initialized yet if ( !$this->isInitialized() ) { $this->init(); } // initialize the PDO object for this method $pdo = $this->_getPdo(); $this->_setErrorMode(); try { $pdo->beginTransaction(); $query = $pdo->query($this->createTableSQL()); $query->closeCursor(); $pdo->commit(); } catch(PDOException $e) { // attempt rolling back the transaction before throwing a phpCAS error try { $pdo->rollBack(); } catch(PDOException $e) { } phpCAS::error('error creating PGT storage table: ' . $e->getMessage()); } // reset the PDO object $this->_resetErrorMode(); phpCAS::traceEnd(); } /** * This method stores a PGT and its corresponding PGT Iou in the database. * Echoes a warning on error. * * @param string $pgt the PGT * @param string $pgt_iou the PGT iou * * @return void */ public function write($pgt, $pgt_iou) { phpCAS::traceBegin(); // initialize the PDO object for this method $pdo = $this->_getPdo(); $this->_setErrorMode(); try { $pdo->beginTransaction(); $query = $pdo->prepare($this->storePgtSql()); $query->bindValue(':pgt', $pgt, PDO::PARAM_STR); $query->bindValue(':pgt_iou', $pgt_iou, PDO::PARAM_STR); $query->execute(); $query->closeCursor(); $pdo->commit(); } catch(PDOException $e) { // attempt rolling back the transaction before throwing a phpCAS error try { $pdo->rollBack(); } catch(PDOException $e) { } phpCAS::error('error writing PGT to database: ' . $e->getMessage()); } // reset the PDO object $this->_resetErrorMode(); phpCAS::traceEnd(); } /** * This method reads a PGT corresponding to a PGT Iou and deletes the * corresponding db entry. * * @param string $pgt_iou the PGT iou * * @return the corresponding PGT, or FALSE on error */ public function read($pgt_iou) { phpCAS::traceBegin(); $pgt = false; // initialize the PDO object for this method $pdo = $this->_getPdo(); $this->_setErrorMode(); try { $pdo->beginTransaction(); // fetch the pgt for the specified pgt_iou $query = $pdo->prepare($this->retrievePgtSql()); $query->bindValue(':pgt_iou', $pgt_iou, PDO::PARAM_STR); $query->execute(); $pgt = $query->fetchColumn(0); $query->closeCursor(); // delete the specified pgt_iou from the database $query = $pdo->prepare($this->deletePgtSql()); $query->bindValue(':pgt_iou', $pgt_iou, PDO::PARAM_STR); $query->execute(); $query->closeCursor(); $pdo->commit(); } catch(PDOException $e) { // attempt rolling back the transaction before throwing a phpCAS error try { $pdo->rollBack(); } catch(PDOException $e) { } phpCAS::trace('error reading PGT from database: ' . $e->getMessage()); } // reset the PDO object $this->_resetErrorMode(); phpCAS::traceEnd(); return $pgt; } /** @} */ } ?> glpi-0.84.3+dfsg.1/lib/phpcas/CAS/PGTStorage/File.php000066400000000000000000000166701226600447100216340ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * The CAS_PGTStorage_File class is a class for PGT file storage. An instance of * this class is returned by CAS_Client::SetPGTStorageFile(). * * @class CAS_PGTStorage_File * @category Authentication * @package PhpCAS * @author Pascal Aubry * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS * * * @ingroup internalPGTStorageFile */ class CAS_PGTStorage_File extends CAS_PGTStorage_AbstractStorage { /** * @addtogroup internalPGTStorageFile * @{ */ /** * a string telling where PGT's should be stored on the filesystem. Written by * PGTStorageFile::PGTStorageFile(), read by getPath(). * * @private */ var $_path; /** * This method returns the name of the directory where PGT's should be stored * on the filesystem. * * @return the name of a directory (with leading and trailing '/') * * @private */ function getPath() { return $this->_path; } // ######################################################################## // DEBUGGING // ######################################################################## /** * This method returns an informational string giving the type of storage * used by the object (used for debugging purposes). * * @return an informational string. * @public */ function getStorageType() { return "file"; } /** * This method returns an informational string giving informations on the * parameters of the storage.(used for debugging purposes). * * @return an informational string. * @public */ function getStorageInfo() { return 'path=`'.$this->getPath().'\''; } // ######################################################################## // CONSTRUCTOR // ######################################################################## /** * The class constructor, called by CAS_Client::SetPGTStorageFile(). * * @param CAS_Client $cas_parent the CAS_Client instance that creates the object. * @param string $path the path where the PGT's should be stored * * @return void * * @public */ function __construct($cas_parent,$path) { phpCAS::traceBegin(); // call the ancestor's constructor parent::__construct($cas_parent); if (empty($path)) { $path = CAS_PGT_STORAGE_FILE_DEFAULT_PATH; } // check that the path is an absolute path if (getenv("OS")=="Windows_NT") { if (!preg_match('`^[a-zA-Z]:`', $path)) { phpCAS::error('an absolute path is needed for PGT storage to file'); } } else { if ( $path[0] != '/' ) { phpCAS::error('an absolute path is needed for PGT storage to file'); } // store the path (with a leading and trailing '/') $path = preg_replace('|[/]*$|', '/', $path); $path = preg_replace('|^[/]*|', '/', $path); } $this->_path = $path; phpCAS::traceEnd(); } // ######################################################################## // INITIALIZATION // ######################################################################## /** * This method is used to initialize the storage. Halts on error. * * @return void * @public */ function init() { phpCAS::traceBegin(); // if the storage has already been initialized, return immediatly if ($this->isInitialized()) { return; } // call the ancestor's method (mark as initialized) parent::init(); phpCAS::traceEnd(); } // ######################################################################## // PGT I/O // ######################################################################## /** * This method returns the filename corresponding to a PGT Iou. * * @param string $pgt_iou the PGT iou. * * @return a filename * @private */ function getPGTIouFilename($pgt_iou) { phpCAS::traceBegin(); $filename = $this->getPath().$pgt_iou.'.plain'; phpCAS::traceEnd($filename); return $filename; } /** * This method stores a PGT and its corresponding PGT Iou into a file. Echoes a * warning on error. * * @param string $pgt the PGT * @param string $pgt_iou the PGT iou * * @return void * * @public */ function write($pgt,$pgt_iou) { phpCAS::traceBegin(); $fname = $this->getPGTIouFilename($pgt_iou); if (!file_exists($fname)) { touch($fname); // Chmod will fail on windows @chmod($fname, 0600); if ($f=fopen($fname, "w")) { if (fputs($f, $pgt) === false) { phpCAS::error('could not write PGT to `'.$fname.'\''); } phpCAS::trace('Successful write of PGT to `'.$fname.'\''); fclose($f); } else { phpCAS::error('could not open `'.$fname.'\''); } } else { phpCAS::error('File exists: `'.$fname.'\''); } phpCAS::traceEnd(); } /** * This method reads a PGT corresponding to a PGT Iou and deletes the * corresponding file. * * @param string $pgt_iou the PGT iou * * @return the corresponding PGT, or FALSE on error * * @public */ function read($pgt_iou) { phpCAS::traceBegin(); $pgt = false; $fname = $this->getPGTIouFilename($pgt_iou); if (file_exists($fname)) { if (!($f=fopen($fname, "r"))) { phpCAS::error('could not open `'.$fname.'\''); } else { if (($pgt=fgets($f)) === false) { phpCAS::error('could not read PGT from `'.$fname.'\''); } phpCAS::trace('Successful read of PGT to `'.$fname.'\''); fclose($f); } // delete the PGT file @unlink($fname); } else { phpCAS::error('No such file `'.$fname.'\''); } phpCAS::traceEnd($pgt); return $pgt; } /** @} */ } ?>glpi-0.84.3+dfsg.1/lib/phpcas/CAS/ProxiedService.php000066400000000000000000000046471226600447100217320ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * This interface defines methods that allow proxy-authenticated service handlers * to interact with phpCAS. * * Proxy service handlers must implement this interface as well as call * phpCAS::initializeProxiedService($this) at some point in their implementation. * * While not required, proxy-authenticated service handlers are encouraged to * implement the CAS_ProxiedService_Testable interface to facilitate unit testing. * * @class CAS_ProxiedService * @category Authentication * @package PhpCAS * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ interface CAS_ProxiedService { /** * Answer a service identifier (URL) for whom we should fetch a proxy ticket. * * @return string * @throws Exception If no service url is available. */ public function getServiceUrl (); /** * Register a proxy ticket with the ProxiedService that it can use when * making requests. * * @param string $proxyTicket Proxy ticket string * * @return void * @throws InvalidArgumentException If the $proxyTicket is invalid. * @throws CAS_OutOfSequenceException If called after a proxy ticket has * already been initialized/set. */ public function setProxyTicket ($proxyTicket); } ?> glpi-0.84.3+dfsg.1/lib/phpcas/CAS/ProxiedService/000077500000000000000000000000001226600447100212065ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/phpcas/CAS/ProxiedService/Abstract.php000066400000000000000000000107341226600447100234670ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * This class implements common methods for ProxiedService implementations included * with phpCAS. * * @class CAS_ProxiedService_Abstract * @category Authentication * @package PhpCAS * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ abstract class CAS_ProxiedService_Abstract implements CAS_ProxiedService, CAS_ProxiedService_Testable { /** * The proxy ticket that can be used when making service requests. * @var string $_proxyTicket; */ private $_proxyTicket; /** * Register a proxy ticket with the Proxy that it can use when making requests. * * @param string $proxyTicket proxy ticket * * @return void * @throws InvalidArgumentException If the $proxyTicket is invalid. * @throws CAS_OutOfSequenceException If called after a proxy ticket has already been initialized/set. */ public function setProxyTicket ($proxyTicket) { if (empty($proxyTicket)) { throw new CAS_InvalidArgumentException("Trying to initialize with an empty proxy ticket."); } if (!empty($this->_proxyTicket)) { throw new CAS_OutOfSequenceException('Already initialized, cannot change the proxy ticket.'); } $this->_proxyTicket = $proxyTicket; } /** * Answer the proxy ticket to be used when making requests. * * @return string * @throws CAS_OutOfSequenceException If called before a proxy ticket has * already been initialized/set. */ protected function getProxyTicket () { if (empty($this->_proxyTicket)) { throw new CAS_OutOfSequenceException('No proxy ticket yet. Call $this->initializeProxyTicket() to aquire the proxy ticket.'); } return $this->_proxyTicket; } /** * @var CAS_Client $_casClient; */ private $_casClient; /** * Use a particular CAS_Client->initializeProxiedService() rather than the * static phpCAS::initializeProxiedService(). * * This method should not be called in standard operation, but is needed for unit * testing. * * @param CAS_Client $casClient cas client * * @return void * @throws CAS_OutOfSequenceException If called after a proxy ticket has * already been initialized/set. */ public function setCasClient (CAS_Client $casClient) { if (!empty($this->_proxyTicket)) { throw new CAS_OutOfSequenceException('Already initialized, cannot change the CAS_Client.'); } $this->_casClient = $casClient; } /** * Fetch our proxy ticket. * * Descendent classes should call this method once their service URL is available * to initialize their proxy ticket. * * @return void * @throws CAS_OutOfSequenceException If called after a proxy ticket has * already been initialized. */ protected function initializeProxyTicket() { if (!empty($this->_proxyTicket)) { throw new CAS_OutOfSequenceException('Already initialized, cannot initialize again.'); } // Allow usage of a particular CAS_Client for unit testing. if (empty($this->_casClient)) { phpCAS::initializeProxiedService($this); } else { $this->_casClient->initializeProxiedService($this); } } } ?> glpi-0.84.3+dfsg.1/lib/phpcas/CAS/ProxiedService/Exception.php000066400000000000000000000027471226600447100236670ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * An Exception for problems communicating with a proxied service. * * @class CAS_ProxiedService_Exception * @category Authentication * @package PhpCAS * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ class CAS_ProxiedService_Exception extends Exception implements CAS_Exception { } ?> glpi-0.84.3+dfsg.1/lib/phpcas/CAS/ProxiedService/Http.php000066400000000000000000000055001226600447100226360ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * This interface defines methods that clients should use for configuring, sending, * and receiving proxied HTTP requests. * * @class CAS_ProxiedService_Http * @category Authentication * @package PhpCAS * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ interface CAS_ProxiedService_Http { /********************************************************* * Configure the Request *********************************************************/ /** * Set the URL of the Request * * @param string $url Url to set * * @return void * @throws CAS_OutOfSequenceException If called after the Request has been sent. */ public function setUrl ($url); /********************************************************* * 2. Send the Request *********************************************************/ /** * Perform the request. * * @return bool TRUE on success, FALSE on failure. * @throws CAS_OutOfSequenceException If called multiple times. */ public function send (); /********************************************************* * 3. Access the response *********************************************************/ /** * Answer the headers of the response. * * @return array An array of header strings. * @throws CAS_OutOfSequenceException If called before the Request has been sent. */ public function getResponseHeaders (); /** * Answer the body of response. * * @return string * @throws CAS_OutOfSequenceException If called before the Request has been sent. */ public function getResponseBody (); } ?> glpi-0.84.3+dfsg.1/lib/phpcas/CAS/ProxiedService/Http/000077500000000000000000000000001226600447100221255ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/phpcas/CAS/ProxiedService/Http/Abstract.php000066400000000000000000000243501226600447100244050ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * This class implements common methods for ProxiedService implementations included * with phpCAS. * * @class CAS_ProxiedService_Http_Abstract * @category Authentication * @package PhpCAS * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ abstract class CAS_ProxiedService_Http_Abstract extends CAS_ProxiedService_Abstract implements CAS_ProxiedService_Http { /** * The HTTP request mechanism talking to the target service. * * @var CAS_Request_RequestInterface $requestHandler */ protected $requestHandler; /** * The storage mechanism for cookies set by the target service. * * @var CAS_CookieJar $_cookieJar */ private $_cookieJar; /** * Constructor. * * @param CAS_Request_RequestInterface $requestHandler request handler object * @param CAS_CookieJar $cookieJar cookieJar object * * @return void */ public function __construct (CAS_Request_RequestInterface $requestHandler, CAS_CookieJar $cookieJar) { $this->requestHandler = $requestHandler; $this->_cookieJar = $cookieJar; } /** * The target service url. * @var string $_url; */ private $_url; /** * Answer a service identifier (URL) for whom we should fetch a proxy ticket. * * @return string * @throws Exception If no service url is available. */ public function getServiceUrl () { if (empty($this->_url)) { throw new CAS_ProxiedService_Exception('No URL set via '.get_class($this).'->setUrl($url).'); } return $this->_url; } /********************************************************* * Configure the Request *********************************************************/ /** * Set the URL of the Request * * @param string $url url to set * * @return void * @throws CAS_OutOfSequenceException If called after the Request has been sent. */ public function setUrl ($url) { if ($this->hasBeenSent()) { throw new CAS_OutOfSequenceException('Cannot set the URL, request already sent.'); } if (!is_string($url)) { throw new CAS_InvalidArgumentException('$url must be a string.'); } $this->_url = $url; } /********************************************************* * 2. Send the Request *********************************************************/ /** * Perform the request. * * @return void * @throws CAS_OutOfSequenceException If called multiple times. * @throws CAS_ProxyTicketException If there is a proxy-ticket failure. * The code of the Exception will be one of: * PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE * PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE * PHPCAS_SERVICE_PT_FAILURE * @throws CAS_ProxiedService_Exception If there is a failure sending the * request to the target service. */ public function send () { if ($this->hasBeenSent()) { throw new CAS_OutOfSequenceException('Cannot send, request already sent.'); } phpCAS::traceBegin(); // Get our proxy ticket and append it to our URL. $this->initializeProxyTicket(); $url = $this->getServiceUrl(); if (strstr($url, '?') === false) { $url = $url.'?ticket='.$this->getProxyTicket(); } else { $url = $url.'&ticket='.$this->getProxyTicket(); } try { $this->makeRequest($url); } catch (Exception $e) { phpCAS::traceEnd(); throw $e; } } /** * Indicator of the number of requests (including redirects performed. * * @var int $_numRequests; */ private $_numRequests = 0; /** * The response headers. * * @var array $_responseHeaders; */ private $_responseHeaders = array(); /** * The response status code. * * @var string $_responseStatusCode; */ private $_responseStatusCode = ''; /** * The response headers. * * @var string $_responseBody; */ private $_responseBody = ''; /** * Build and perform a request, following redirects * * @param string $url url for the request * * @return void * @throws CAS_ProxyTicketException If there is a proxy-ticket failure. * The code of the Exception will be one of: * PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE * PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE * PHPCAS_SERVICE_PT_FAILURE * @throws CAS_ProxiedService_Exception If there is a failure sending the * request to the target service. */ protected function makeRequest ($url) { // Verify that we are not in a redirect loop $this->_numRequests++; if ($this->_numRequests > 4) { $message = 'Exceeded the maximum number of redirects (3) in proxied service request.'; phpCAS::trace($message); throw new CAS_ProxiedService_Exception($message); } // Create a new request. $request = clone $this->requestHandler; $request->setUrl($url); // Add any cookies to the request. $request->addCookies($this->_cookieJar->getCookies($url)); // Add any other parts of the request needed by concrete classes $this->populateRequest($request); // Perform the request. phpCAS::trace('Performing proxied service request to \''.$url.'\''); if (!$request->send()) { $message = 'Could not perform proxied service request to URL`'.$url.'\'. '.$request->getErrorMessage(); phpCAS::trace($message); throw new CAS_ProxiedService_Exception($message); } // Store any cookies from the response; $this->_cookieJar->storeCookies($url, $request->getResponseHeaders()); // Follow any redirects if ($redirectUrl = $this->getRedirectUrl($request->getResponseHeaders())) { phpCAS :: trace('Found redirect:'.$redirectUrl); $this->makeRequest($redirectUrl); } else { $this->_responseHeaders = $request->getResponseHeaders(); $this->_responseBody = $request->getResponseBody(); $this->_responseStatusCode = $request->getResponseStatusCode(); } } /** * Add any other parts of the request needed by concrete classes * * @param CAS_Request_RequestInterface $request request interface object * * @return void */ abstract protected function populateRequest (CAS_Request_RequestInterface $request); /** * Answer a redirect URL if a redirect header is found, otherwise null. * * @param array $responseHeaders response header to extract a redirect from * * @return string or null */ protected function getRedirectUrl (array $responseHeaders) { // Check for the redirect after authentication foreach ($responseHeaders as $header) { if (preg_match('/^(Location:|URI:)\s*([^\s]+.*)$/', $header, $matches)) { return trim(array_pop($matches)); } } return null; } /********************************************************* * 3. Access the response *********************************************************/ /** * Answer true if our request has been sent yet. * * @return bool */ protected function hasBeenSent () { return ($this->_numRequests > 0); } /** * Answer the headers of the response. * * @return array An array of header strings. * @throws CAS_OutOfSequenceException If called before the Request has been sent. */ public function getResponseHeaders () { if (!$this->hasBeenSent()) { throw new CAS_OutOfSequenceException('Cannot access response, request not sent yet.'); } return $this->_responseHeaders; } /** * Answer HTTP status code of the response * * @return int * @throws CAS_OutOfSequenceException If called before the Request has been sent. */ public function getResponseStatusCode () { if (!$this->hasBeenSent()) { throw new CAS_OutOfSequenceException('Cannot access response, request not sent yet.'); } return $this->_responseStatusCode; } /** * Answer the body of response. * * @return string * @throws CAS_OutOfSequenceException If called before the Request has been sent. */ public function getResponseBody () { if (!$this->hasBeenSent()) { throw new CAS_OutOfSequenceException('Cannot access response, request not sent yet.'); } return $this->_responseBody; } /** * Answer the cookies from the response. This may include cookies set during * redirect responses. * * @return array An array containing cookies. E.g. array('name' => 'val'); */ public function getCookies () { return $this->_cookieJar->getCookies($this->getServiceUrl()); } } ?> glpi-0.84.3+dfsg.1/lib/phpcas/CAS/ProxiedService/Http/Get.php000066400000000000000000000057661226600447100233730ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * This class is used to make proxied service requests via the HTTP GET method. * * Usage Example: * * try { * $service = phpCAS::getProxiedService(PHPCAS_PROXIED_SERVICE_HTTP_GET); * $service->setUrl('http://www.example.com/path/'); * $service->send(); * if ($service->getResponseStatusCode() == 200) * return $service->getResponseBody(); * else * // The service responded with an error code 404, 500, etc. * throw new Exception('The service responded with an error.'); * * } catch (CAS_ProxyTicketException $e) { * if ($e->getCode() == PHPCAS_SERVICE_PT_FAILURE) * return "Your login has timed out. You need to log in again."; * else * // Other proxy ticket errors are from bad request format (shouldn't happen) * // or CAS server failure (unlikely) so lets just stop if we hit those. * throw $e; * } catch (CAS_ProxiedService_Exception $e) { * // Something prevented the service request from being sent or received. * // We didn't even get a valid error response (404, 500, etc), so this * // might be caused by a network error or a DNS resolution failure. * // We could handle it in some way, but for now we will just stop. * throw $e; * } * * @class CAS_ProxiedService_Http_Get * @category Authentication * @package PhpCAS * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ class CAS_ProxiedService_Http_Get extends CAS_ProxiedService_Http_Abstract { /** * Add any other parts of the request needed by concrete classes * * @param CAS_Request_RequestInterface $request request interface * * @return void */ protected function populateRequest (CAS_Request_RequestInterface $request) { // do nothing, since the URL has already been sent and that is our // only data. } } ?> glpi-0.84.3+dfsg.1/lib/phpcas/CAS/ProxiedService/Http/Post.php000066400000000000000000000113151226600447100235640ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * This class is used to make proxied service requests via the HTTP POST method. * * Usage Example: * * try { * $service = phpCAS::getProxiedService(PHPCAS_PROXIED_SERVICE_HTTP_POST); * $service->setUrl('http://www.example.com/path/'); * $service->setContentType('text/xml'); * $service->setBody(''example.search'); * $service->send(); * if ($service->getResponseStatusCode() == 200) * return $service->getResponseBody(); * else * // The service responded with an error code 404, 500, etc. * throw new Exception('The service responded with an error.'); * * } catch (CAS_ProxyTicketException $e) { * if ($e->getCode() == PHPCAS_SERVICE_PT_FAILURE) * return "Your login has timed out. You need to log in again."; * else * // Other proxy ticket errors are from bad request format (shouldn't happen) * // or CAS server failure (unlikely) so lets just stop if we hit those. * throw $e; * } catch (CAS_ProxiedService_Exception $e) { * // Something prevented the service request from being sent or received. * // We didn't even get a valid error response (404, 500, etc), so this * // might be caused by a network error or a DNS resolution failure. * // We could handle it in some way, but for now we will just stop. * throw $e; * } * * @class CAS_ProxiedService_Http_Post * @category Authentication * @package PhpCAS * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ class CAS_ProxiedService_Http_Post extends CAS_ProxiedService_Http_Abstract { /** * The content-type of this request * * @var string $_contentType */ private $_contentType; /** * The body of the this request * * @var string $_body */ private $_body; /** * Set the content type of this POST request. * * @param string $contentType content type * * @return void * @throws CAS_OutOfSequenceException If called after the Request has been sent. */ public function setContentType ($contentType) { if ($this->hasBeenSent()) { throw new CAS_OutOfSequenceException('Cannot set the content type, request already sent.'); } $this->_contentType = $contentType; } /** * Set the body of this POST request. * * @param string $body body to set * * @return void * @throws CAS_OutOfSequenceException If called after the Request has been sent. */ public function setBody ($body) { if ($this->hasBeenSent()) { throw new CAS_OutOfSequenceException('Cannot set the body, request already sent.'); } $this->_body = $body; } /** * Add any other parts of the request needed by concrete classes * * @param CAS_Request_RequestInterface $request request interface class * * @return void */ protected function populateRequest (CAS_Request_RequestInterface $request) { if (empty($this->_contentType) && !empty($this->_body)) { throw new CAS_ProxiedService_Exception("If you pass a POST body, you must specify a content type via ".get_class($this).'->setContentType($contentType).'); } $request->makePost(); if (!empty($this->_body)) { $request->addHeader('Content-Type: '.$this->_contentType); $request->addHeader('Content-Length: '.strlen($this->_body)); $request->setPostBody($this->_body); } } } ?> glpi-0.84.3+dfsg.1/lib/phpcas/CAS/ProxiedService/Imap.php000066400000000000000000000172461226600447100226170ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * Provides access to a proxy-authenticated IMAP stream * * @class CAS_ProxiedService_Imap * @category Authentication * @package PhpCAS * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ class CAS_ProxiedService_Imap extends CAS_ProxiedService_Abstract { /** * The username to send via imap_open. * * @var string $_username; */ private $_username; /** * Constructor. * * @param string $username Username * * @return void */ public function __construct ($username) { if (!is_string($username) || !strlen($username)) { throw new CAS_InvalidArgumentException('Invalid username.'); } $this->_username = $username; } /** * The target service url. * @var string $_url; */ private $_url; /** * Answer a service identifier (URL) for whom we should fetch a proxy ticket. * * @return string * @throws Exception If no service url is available. */ public function getServiceUrl () { if (empty($this->_url)) { throw new CAS_ProxiedService_Exception('No URL set via '.get_class($this).'->getServiceUrl($url).'); } return $this->_url; } /********************************************************* * Configure the Stream *********************************************************/ /** * Set the URL of the service to pass to CAS for proxy-ticket retrieval. * * @param string $url Url to set * * @return void * @throws CAS_OutOfSequenceException If called after the stream has been opened. */ public function setServiceUrl ($url) { if ($this->hasBeenOpened()) { throw new CAS_OutOfSequenceException('Cannot set the URL, stream already opened.'); } if (!is_string($url) || !strlen($url)) { throw new CAS_InvalidArgumentException('Invalid url.'); } $this->_url = $url; } /** * The mailbox to open. See the $mailbox parameter of imap_open(). * * @var string $_mailbox */ private $_mailbox; /** * Set the mailbox to open. See the $mailbox parameter of imap_open(). * * @param string $mailbox Mailbox to set * * @return void * @throws CAS_OutOfSequenceException If called after the stream has been opened. */ public function setMailbox ($mailbox) { if ($this->hasBeenOpened()) { throw new CAS_OutOfSequenceException('Cannot set the mailbox, stream already opened.'); } if (!is_string($mailbox) || !strlen($mailbox)) { throw new CAS_InvalidArgumentException('Invalid mailbox.'); } $this->_mailbox = $mailbox; } /** * A bit mask of options to pass to imap_open() as the $options parameter. * * @var int $_options */ private $_options = null; /** * Set the options for opening the stream. See the $options parameter of * imap_open(). * * @param int $options Options for the stream * * @return void * @throws CAS_OutOfSequenceException If called after the stream has been opened. */ public function setOptions ($options) { if ($this->hasBeenOpened()) { throw new CAS_OutOfSequenceException('Cannot set options, stream already opened.'); } if (!is_int($options)) { throw new CAS_InvalidArgumentException('Invalid options.'); } $this->_options = $options; } /********************************************************* * 2. Open the stream *********************************************************/ /** * Open the IMAP stream (similar to imap_open()). * * @return resource Returns an IMAP stream on success * @throws CAS_OutOfSequenceException If called multiple times. * @throws CAS_ProxyTicketException If there is a proxy-ticket failure. * The code of the Exception will be one of: * PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE * PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE * PHPCAS_SERVICE_PT_FAILURE * @throws CAS_ProxiedService_Exception If there is a failure sending the request to the target service. */ public function open () { if ($this->hasBeenOpened()) { throw new CAS_OutOfSequenceException('Stream already opened.'); } if (empty($this->_mailbox)) { throw new CAS_ProxiedService_Exception('You must specify a mailbox via '.get_class($this).'->setMailbox($mailbox)'); } phpCAS::traceBegin(); // Get our proxy ticket and append it to our URL. $this->initializeProxyTicket(); phpCAS::trace('opening IMAP mailbox `'.$this->_mailbox.'\'...'); $this->_stream = @imap_open($this->_mailbox, $this->_username, $this->getProxyTicket(), $this->_options); if ($this->_stream) { phpCAS::trace('ok'); } else { phpCAS::trace('could not open mailbox'); // @todo add localization integration. $message = 'IMAP Error: '.$url.' '. var_export(imap_errors(), true); phpCAS::trace($message); throw new CAS_ProxiedService_Exception($message); } phpCAS::traceEnd(); return $this->_stream; } /** * Answer true if our request has been sent yet. * * @return bool */ protected function hasBeenOpened () { return !empty($this->_stream); } /********************************************************* * 3. Access the result *********************************************************/ /** * The IMAP stream * * @var resource $_stream */ private $_stream; /** * Answer the IMAP stream * * @return resource */ public function getStream () { if (!$this->hasBeenOpened()) { throw new CAS_OutOfSequenceException('Cannot access stream, not opened yet.'); } return $this->_stream; } /** * CAS_Client::serviceMail() needs to return the proxy ticket for some reason, * so this method provides access to it. * * @return string * @throws CAS_OutOfSequenceException If called before the stream has been * opened. */ public function getImapProxyTicket () { if (!$this->hasBeenOpened()) { throw new CAS_OutOfSequenceException('Cannot access errors, stream not opened yet.'); } return $this->getProxyTicket(); } } ?> glpi-0.84.3+dfsg.1/lib/phpcas/CAS/ProxiedService/Testable.php000066400000000000000000000047331226600447100234710ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * This interface defines methods that allow proxy-authenticated service handlers * to be tested in unit tests. * * Classes implementing this interface SHOULD store the CAS_Client passed and initialize * themselves with that client rather than via the static phpCAS method. For example: * * / ** * * Fetch our proxy ticket. * * / * protected function initializeProxyTicket() { * // Allow usage of a particular CAS_Client for unit testing. * if (is_null($this->casClient)) * phpCAS::initializeProxiedService($this); * else * $this->casClient->initializeProxiedService($this); * } * * @class CAS_ProxiedService_Testabel * @category Authentication * @package PhpCAS * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ interface CAS_ProxiedService_Testable { /** * Use a particular CAS_Client->initializeProxiedService() rather than the * static phpCAS::initializeProxiedService(). * * This method should not be called in standard operation, but is needed for unit * testing. * * @param CAS_Client $casClient Cas client object * * @return void * @throws CAS_OutOfSequenceException If called after a proxy ticket has already been initialized/set. */ public function setCasClient (CAS_Client $casClient); } ?> glpi-0.84.3+dfsg.1/lib/phpcas/CAS/ProxyChain.php000066400000000000000000000100421226600447100210450ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * A normal proxy-chain definition that lists each level of the chain as either * a string or regular expression. * * @class CAS_ProxyChain * @category Authentication * @package PhpCAS * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ class CAS_ProxyChain implements CAS_ProxyChain_Interface { protected $chain = array(); /** * A chain is an array of strings or regexp strings that will be matched * against. Regexp will be matched with preg_match and strings will be * matched from the beginning. A string must fully match the beginning of * an proxy url. So you can define a full domain as acceptable or go further * down. * Proxies have to be defined in reverse from the service to the user. If a * user hits service A get proxied via B to service C the list of acceptable * proxies on C would be array(B,A); * * @param array $chain A chain of proxies */ public function __construct(array $chain) { $this->chain = array_values($chain); // Ensure that we have an indexed array } /** * Match a list of proxies. * * @param array $list The list of proxies in front of this service. * * @return bool */ public function matches(array $list) { $list = array_values($list); // Ensure that we have an indexed array if ($this->isSizeValid($list)) { $mismatch = false; foreach ($this->chain as $i => $search) { $proxy_url = $list[$i]; if (preg_match('/^\/.*\/[ixASUXu]*$/s', $search)) { if (preg_match($search, $proxy_url)) { phpCAS::trace("Found regexp " . $search . " matching " . $proxy_url); } else { phpCAS::trace("No regexp match " . $search . " != " . $proxy_url); $mismatch = true; break; } } else { if (strncasecmp($search, $proxy_url, strlen($search)) == 0) { phpCAS::trace("Found string " . $search . " matching " . $proxy_url); } else { phpCAS::trace("No match " . $search . " != " . $proxy_url); $mismatch = true; break; } } } if (!$mismatch) { phpCAS::trace("Proxy chain matches"); return true; } } else { phpCAS::trace("Proxy chain skipped: size mismatch"); } return false; } /** * Validate the size of the the list as compared to our chain. * * @param array $list List of proxies * * @return bool */ protected function isSizeValid (array $list) { return (sizeof($this->chain) == sizeof($list)); } } glpi-0.84.3+dfsg.1/lib/phpcas/CAS/ProxyChain/000077500000000000000000000000001226600447100203375ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/phpcas/CAS/ProxyChain/AllowedList.php000066400000000000000000000067361226600447100233070ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * ProxyChain is a container for storing chains of valid proxies that can * be used to validate proxied requests to a service * * @class CAS_ProxyChain_AllowedList * @category Authentication * @package PhpCAS * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ class CAS_ProxyChain_AllowedList { private $_chains = array(); /** * Check whether proxies are allowed by configuration * * @return bool */ public function isProxyingAllowed() { return (count($this->_chains) > 0); } /** * Add a chain of proxies to the list of possible chains * * @param CAS_ProxyChain_Interface $chain A chain of proxies * * @return void */ public function allowProxyChain(CAS_ProxyChain_Interface $chain) { $this->_chains[] = $chain; } /** * Check if the proxies found in the response match the allowed proxies * * @param array $proxies list of proxies to check * * @return bool whether the proxies match the allowed proxies */ public function isProxyListAllowed(array $proxies) { phpCAS::traceBegin(); if (empty($proxies)) { phpCAS::trace("No proxies were found in the response"); phpCAS::traceEnd(true); return true; } elseif (!$this->isProxyingAllowed()) { phpCAS::trace("Proxies are not allowed"); phpCAS::traceEnd(false); return false; } else { $res = $this->contains($proxies); phpCAS::traceEnd($res); return $res; } } /** * Validate the proxies from the proxy ticket validation against the * chains that were definded. * * @param array $list List of proxies from the proxy ticket validation. * * @return if any chain fully matches the supplied list */ public function contains(array $list) { phpCAS::traceBegin(); $count = 0; foreach ($this->_chains as $chain) { phpCAS::trace("Checking chain ". $count++); if ($chain->matches($list)) { phpCAS::traceEnd(true); return true; } } phpCAS::trace("No proxy chain matches."); phpCAS::traceEnd(false); return false; } } ?> glpi-0.84.3+dfsg.1/lib/phpcas/CAS/ProxyChain/Any.php000066400000000000000000000040741226600447100216040ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * A proxy-chain definition that will match any list of proxies. * * Use this class for quick testing or in certain production screnarios you * might want to allow allow any other valid service to proxy your service. * * THIS CLASS IS HOWEVER NOT RECOMMENDED FOR PRODUCTION AND HAS SECURITY * IMPLICATIONS: YOU ARE ALLOWING ANY SERVICE TO ACT ON BEHALF OF A USER * ON THIS SERVICE. * * @class CAS_ProxyChain_Any * @category Authentication * @package PhpCAS * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ class CAS_ProxyChain_Any implements CAS_ProxyChain_Interface { /** * Match a list of proxies. * * @param array $list The list of proxies in front of this service. * * @return bool */ public function matches(array $list) { phpCAS::trace("Using CAS_ProxyChain_Any. No proxy validation is performed."); return true; } } glpi-0.84.3+dfsg.1/lib/phpcas/CAS/ProxyChain/Interface.php000066400000000000000000000032341226600447100227520ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * An interface for classes that define a list of allowed proxies in front of * the current application. * * @class CAS_ProxyChain_Interface * @category Authentication * @package PhpCAS * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ interface CAS_ProxyChain_Interface { /** * Match a list of proxies. * * @param array $list The list of proxies in front of this service. * * @return bool */ public function matches(array $list); }glpi-0.84.3+dfsg.1/lib/phpcas/CAS/ProxyChain/Trusted.php000066400000000000000000000035341226600447100225070ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * A proxy-chain definition that defines a chain up to a trusted proxy and * delegates the resposibility of validating the rest of the chain to that * trusted proxy. * * @class CAS_ProxyChain_Trusted * @category Authentication * @package PhpCAS * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ class CAS_ProxyChain_Trusted extends CAS_ProxyChain implements CAS_ProxyChain_Interface { /** * Validate the size of the the list as compared to our chain. * * @param array $list list of proxies * * @return bool */ protected function isSizeValid (array $list) { return (sizeof($this->chain) <= sizeof($list)); } } glpi-0.84.3+dfsg.1/lib/phpcas/CAS/ProxyTicketException.php000066400000000000000000000043321226600447100231320ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS * */ /** * An Exception for errors related to fetching or validating proxy tickets. * * @class CAS_ProxyTicketException * @category Authentication * @package PhpCAS * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ class CAS_ProxyTicketException extends BadMethodCallException implements CAS_Exception { /** * Constructor * * @param string $message Message text * @param int $code Error code * * @return void */ public function __construct ($message, $code = PHPCAS_SERVICE_PT_FAILURE) { // Warn if the code is not in our allowed list $ptCodes = array( PHPCAS_SERVICE_PT_FAILURE, PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE, PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE, ); if (!in_array($code, $ptCodes)) { trigger_error('Invalid code '.$code.' passed. Must be one of PHPCAS_SERVICE_PT_FAILURE, PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE, or PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE.'); } parent::__construct($message, $code); } } glpi-0.84.3+dfsg.1/lib/phpcas/CAS/Request/000077500000000000000000000000001226600447100177035ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/phpcas/CAS/Request/AbstractRequest.php000066400000000000000000000236321226600447100235360ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * Provides support for performing web-requests via curl * * @class CAS_Request_AbstractRequest * @category Authentication * @package PhpCAS * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ abstract class CAS_Request_AbstractRequest implements CAS_Request_RequestInterface { protected $url = null; protected $cookies = array(); protected $headers = array(); protected $isPost = false; protected $postBody = null; protected $caCertPath = null; protected $validateCN = true; private $_sent = false; private $_responseHeaders = array(); private $_responseBody = null; private $_errorMessage = ''; /********************************************************* * Configure the Request *********************************************************/ /** * Set the URL of the Request * * @param string $url Url to set * * @return void * @throws CAS_OutOfSequenceException If called after the Request has been sent. */ public function setUrl ($url) { if ($this->_sent) { throw new CAS_OutOfSequenceException('Request has already been sent cannot '.__METHOD__); } $this->url = $url; } /** * Add a cookie to the request. * * @param string $name Name of entry * @param string $value value of entry * * @return void * @throws CAS_OutOfSequenceException If called after the Request has been sent. */ public function addCookie ($name, $value) { if ($this->_sent) { throw new CAS_OutOfSequenceException('Request has already been sent cannot '.__METHOD__); } $this->cookies[$name] = $value; } /** * Add an array of cookies to the request. * The cookie array is of the form * array('cookie_name' => 'cookie_value', 'cookie_name2' => cookie_value2') * * @param array $cookies cookies to add * * @return void * @throws CAS_OutOfSequenceException If called after the Request has been sent. */ public function addCookies (array $cookies) { if ($this->_sent) { throw new CAS_OutOfSequenceException('Request has already been sent cannot '.__METHOD__); } $this->cookies = array_merge($this->cookies, $cookies); } /** * Add a header string to the request. * * @param string $header Header to add * * @return void * @throws CAS_OutOfSequenceException If called after the Request has been sent. */ public function addHeader ($header) { if ($this->_sent) { throw new CAS_OutOfSequenceException('Request has already been sent cannot '.__METHOD__); } $this->headers[] = $header; } /** * Add an array of header strings to the request. * * @param array $headers headers to add * * @return void * @throws CAS_OutOfSequenceException If called after the Request has been sent. */ public function addHeaders (array $headers) { if ($this->_sent) { throw new CAS_OutOfSequenceException('Request has already been sent cannot '.__METHOD__); } $this->headers = array_merge($this->headers, $headers); } /** * Make the request a POST request rather than the default GET request. * * @return void * @throws CAS_OutOfSequenceException If called after the Request has been sent. */ public function makePost () { if ($this->_sent) { throw new CAS_OutOfSequenceException('Request has already been sent cannot '.__METHOD__); } $this->isPost = true; } /** * Add a POST body to the request * * @param string $body body to add * * @return void * @throws CAS_OutOfSequenceException If called after the Request has been sent. */ public function setPostBody ($body) { if ($this->_sent) { throw new CAS_OutOfSequenceException('Request has already been sent cannot '.__METHOD__); } if (!$this->isPost) { throw new CAS_OutOfSequenceException('Cannot add a POST body to a GET request, use makePost() first.'); } $this->postBody = $body; } /** * Specify the path to an SSL CA certificate to validate the server with. * * @param string $caCertPath path to cert * @param bool $validate_cn valdiate CN of certificate * * @return void * @throws CAS_OutOfSequenceException If called after the Request has been sent. */ public function setSslCaCert ($caCertPath,$validate_cn=true) { if ($this->_sent) { throw new CAS_OutOfSequenceException('Request has already been sent cannot '.__METHOD__); } $this->caCertPath = $caCertPath; $this->validateCN = $validate_cn; } /********************************************************* * 2. Send the Request *********************************************************/ /** * Perform the request. * * @return bool TRUE on success, FALSE on failure. * @throws CAS_OutOfSequenceException If called multiple times. */ public function send () { if ($this->_sent) { throw new CAS_OutOfSequenceException('Request has already been sent cannot send again.'); } if (is_null($this->url) || !$this->url) { throw new CAS_OutOfSequenceException('A url must be specified via setUrl() before the request can be sent.'); } $this->_sent = true; return $this->sendRequest(); } /** * Send the request and store the results. * * @return bool TRUE on success, FALSE on failure. */ abstract protected function sendRequest (); /** * Store the response headers. * * @param array $headers headers to store * * @return void */ protected function storeResponseHeaders (array $headers) { $this->_responseHeaders = array_merge($this->_responseHeaders, $headers); } /** * Store a single response header to our array. * * @param string $header header to store * * @return void */ protected function storeResponseHeader ($header) { $this->_responseHeaders[] = $header; } /** * Store the response body. * * @param string $body body to store * * @return void */ protected function storeResponseBody ($body) { $this->_responseBody = $body; } /** * Add a string to our error message. * * @param string $message message to add * * @return void */ protected function storeErrorMessage ($message) { $this->_errorMessage .= $message; } /********************************************************* * 3. Access the response *********************************************************/ /** * Answer the headers of the response. * * @return array An array of header strings. * @throws CAS_OutOfSequenceException If called before the Request has been sent. */ public function getResponseHeaders () { if (!$this->_sent) { throw new CAS_OutOfSequenceException('Request has not been sent yet. Cannot '.__METHOD__); } return $this->_responseHeaders; } /** * Answer HTTP status code of the response * * @return int * @throws CAS_OutOfSequenceException If called before the Request has been sent. */ public function getResponseStatusCode () { if (!$this->_sent) { throw new CAS_OutOfSequenceException('Request has not been sent yet. Cannot '.__METHOD__); } if (!preg_match('/HTTP\/[0-9.]+\s+([0-9]+)\s*(.*)/', $this->_responseHeaders[0], $matches)) { throw new CAS_Request_Exception("Bad response, no status code was found in the first line."); } return intval($matches[1]); } /** * Answer the body of response. * * @return string * @throws CAS_OutOfSequenceException If called before the Request has been sent. */ public function getResponseBody () { if (!$this->_sent) { throw new CAS_OutOfSequenceException('Request has not been sent yet. Cannot '.__METHOD__); } return $this->_responseBody; } /** * Answer a message describing any errors if the request failed. * * @return string * @throws CAS_OutOfSequenceException If called before the Request has been sent. */ public function getErrorMessage () { if (!$this->_sent) { throw new CAS_OutOfSequenceException('Request has not been sent yet. Cannot '.__METHOD__); } return $this->_errorMessage; } } glpi-0.84.3+dfsg.1/lib/phpcas/CAS/Request/CurlMultiRequest.php000066400000000000000000000113721226600447100237110ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * This interface defines a class library for performing multiple web requests * in batches. Implementations of this interface may perform requests serially * or in parallel. * * @class CAS_Request_CurlMultiRequest * @category Authentication * @package PhpCAS * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ class CAS_Request_CurlMultiRequest implements CAS_Request_MultiRequestInterface { private $_requests = array(); private $_sent = false; /********************************************************* * Add Requests *********************************************************/ /** * Add a new Request to this batch. * Note, implementations will likely restrict requests to their own concrete * class hierarchy. * * @param CAS_Request_RequestInterface $request reqest to add * * @return void * @throws CAS_OutOfSequenceException If called after the Request has been sent. * @throws CAS_InvalidArgumentException If passed a Request of the wrong * implmentation. */ public function addRequest (CAS_Request_RequestInterface $request) { if ($this->_sent) { throw new CAS_OutOfSequenceException('Request has already been sent cannot '.__METHOD__); } if (!$request instanceof CAS_Request_CurlRequest) { throw new CAS_InvalidArgumentException('As a CAS_Request_CurlMultiRequest, I can only work with CAS_Request_CurlRequest objects.'); } $this->_requests[] = $request; } /** * Retrieve the number of requests added to this batch. * * @return number of request elements */ public function getNumRequests() { if ($this->_sent) { throw new CAS_OutOfSequenceException('Request has already been sent cannot '.__METHOD__); } return count($this->_requests); } /********************************************************* * 2. Send the Request *********************************************************/ /** * Perform the request. After sending, all requests will have their * responses poulated. * * @return bool TRUE on success, FALSE on failure. * @throws CAS_OutOfSequenceException If called multiple times. */ public function send () { if ($this->_sent) { throw new CAS_OutOfSequenceException('Request has already been sent cannot send again.'); } if (!count($this->_requests)) { throw new CAS_OutOfSequenceException('At least one request must be added via addRequest() before the multi-request can be sent.'); } $this->_sent = true; // Initialize our handles and configure all requests. $handles = array(); $multiHandle = curl_multi_init(); foreach ($this->_requests as $i => $request) { $handle = $request->_initAndConfigure(); curl_setopt($handle, CURLOPT_RETURNTRANSFER, true); $handles[$i] = $handle; curl_multi_add_handle($multiHandle, $handle); } // Execute the requests in parallel. do { curl_multi_exec($multiHandle, $running); } while ($running > 0); // Populate all of the responses or errors back into the request objects. foreach ($this->_requests as $i => $request) { $buf = curl_multi_getcontent($handles[$i]); $request->_storeResponseBody($buf); curl_multi_remove_handle($multiHandle, $handles[$i]); curl_close($handles[$i]); } curl_multi_close($multiHandle); } } glpi-0.84.3+dfsg.1/lib/phpcas/CAS/Request/CurlRequest.php000066400000000000000000000146451226600447100227040ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * Provides support for performing web-requests via curl * * @class CAS_Request_CurlRequest * @category Authentication * @package PhpCAS * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ class CAS_Request_CurlRequest extends CAS_Request_AbstractRequest implements CAS_Request_RequestInterface { /** * Set additional curl options * * @param array $options option to set * * @return void */ public function setCurlOptions (array $options) { $this->_curlOptions = $options; } private $_curlOptions = array(); /** * Send the request and store the results. * * @return bool true on success, false on failure. */ protected function sendRequest () { phpCAS::traceBegin(); /********************************************************* * initialize the CURL session *********************************************************/ $ch = $this->_initAndConfigure(); /********************************************************* * Perform the query *********************************************************/ $buf = curl_exec($ch); if ( $buf === false ) { phpCAS::trace('curl_exec() failed'); $this->storeErrorMessage('CURL error #'.curl_errno($ch).': '.curl_error($ch)); $res = false; } else { $this->storeResponseBody($buf); phpCAS::trace("Response Body: \n".$buf."\n"); $res = true; } // close the CURL session curl_close($ch); phpCAS::traceEnd($res); return $res; } /** * Internal method to initialize our cURL handle and configure the request. * This method should NOT be used outside of the CurlRequest or the * CurlMultiRequest. * * @return resource The cURL handle on success, false on failure */ private function _initAndConfigure() { /********************************************************* * initialize the CURL session *********************************************************/ $ch = curl_init($this->url); if (version_compare(PHP_VERSION, '5.1.3', '>=')) { //only avaible in php5 curl_setopt_array($ch, $this->_curlOptions); } else { foreach ($this->_curlOptions as $key => $value) { curl_setopt($ch, $key, $value); } } /********************************************************* * Set SSL configuration *********************************************************/ if ($this->caCertPath) { if ($this->validateCN) { curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); } else { curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1); } curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); curl_setopt($ch, CURLOPT_CAINFO, $this->caCertPath); phpCAS::trace('CURL: Set CURLOPT_CAINFO ' . $this->caCertPath); } else { curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); } /********************************************************* * Configure curl to capture our output. *********************************************************/ // return the CURL output into a variable curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // get the HTTP header with a callback curl_setopt($ch, CURLOPT_HEADERFUNCTION, array($this, '_curlReadHeaders')); /********************************************************* * Add cookie headers to our request. *********************************************************/ if (count($this->cookies)) { $cookieStrings = array(); foreach ($this->cookies as $name => $val) { $cookieStrings[] = $name.'='.$val; } curl_setopt($ch, CURLOPT_COOKIE, implode(';', $cookieStrings)); } /********************************************************* * Add any additional headers *********************************************************/ if (count($this->headers)) { curl_setopt($ch, CURLOPT_HTTPHEADER, $this->headers); } /********************************************************* * Flag and Body for POST requests *********************************************************/ if ($this->isPost) { curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $this->postBody); } return $ch; } /** * Store the response body. * This method should NOT be used outside of the CurlRequest or the * CurlMultiRequest. * * @param string $body body to stor * * @return void */ private function _storeResponseBody ($body) { $this->storeResponseBody($body); } /** * Internal method for capturing the headers from a curl request. * * @param handle $ch handle of curl * @param string $header header * * @return void */ private function _curlReadHeaders ($ch, $header) { $this->storeResponseHeader($header); return strlen($header); } } glpi-0.84.3+dfsg.1/lib/phpcas/CAS/Request/Exception.php000066400000000000000000000026751226600447100223640ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * An Exception for problems performing requests * * @class CAS_Request_Exception * @category Authentication * @package PhpCAS * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ class CAS_Request_Exception extends Exception implements CAS_Exception { } glpi-0.84.3+dfsg.1/lib/phpcas/CAS/Request/MultiRequestInterface.php000066400000000000000000000054571226600447100247130ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * This interface defines a class library for performing multiple web requests * in batches. Implementations of this interface may perform requests serially * or in parallel. * * @class CAS_Request_MultiRequestInterface * @category Authentication * @package PhpCAS * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ interface CAS_Request_MultiRequestInterface { /********************************************************* * Add Requests *********************************************************/ /** * Add a new Request to this batch. * Note, implementations will likely restrict requests to their own concrete * class hierarchy. * * @param CAS_Request_RequestInterface $request request interface * * @return void * @throws CAS_OutOfSequenceException If called after the Request has been * sent. * @throws CAS_InvalidArgumentException If passed a Request of the wrong * implmentation. */ public function addRequest (CAS_Request_RequestInterface $request); /** * Retrieve the number of requests added to this batch. * * @return number of request elements */ public function getNumRequests (); /********************************************************* * 2. Send the Request *********************************************************/ /** * Perform the request. After sending, all requests will have their * responses poulated. * * @return bool TRUE on success, FALSE on failure. * @throws CAS_OutOfSequenceException If called multiple times. */ public function send (); } glpi-0.84.3+dfsg.1/lib/phpcas/CAS/Request/RequestInterface.php000066400000000000000000000125111226600447100236650ustar00rootroot00000000000000 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ /** * This interface defines a class library for performing web requests. * * @class CAS_Request_RequestInterface * @category Authentication * @package PhpCAS * @author Adam Franco * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://wiki.jasig.org/display/CASC/phpCAS */ interface CAS_Request_RequestInterface { /********************************************************* * Configure the Request *********************************************************/ /** * Set the URL of the Request * * @param string $url url to set * * @return void * @throws CAS_OutOfSequenceException If called after the Request has been sent. */ public function setUrl ($url); /** * Add a cookie to the request. * * @param string $name name of cookie * @param string $value value of cookie * * @return void * @throws CAS_OutOfSequenceException If called after the Request has been sent. */ public function addCookie ($name, $value); /** * Add an array of cookies to the request. * The cookie array is of the form * array('cookie_name' => 'cookie_value', 'cookie_name2' => cookie_value2') * * @param array $cookies cookies to add * * @return void * @throws CAS_OutOfSequenceException If called after the Request has been sent. */ public function addCookies (array $cookies); /** * Add a header string to the request. * * @param string $header header to add * * @return void * @throws CAS_OutOfSequenceException If called after the Request has been sent. */ public function addHeader ($header); /** * Add an array of header strings to the request. * * @param array $headers headers to add * * @return void * @throws CAS_OutOfSequenceException If called after the Request has been sent. */ public function addHeaders (array $headers); /** * Make the request a POST request rather than the default GET request. * * @return void * @throws CAS_OutOfSequenceException If called after the Request has been sent. */ public function makePost (); /** * Add a POST body to the request * * @param string $body body to add * * @return void * @throws CAS_OutOfSequenceException If called after the Request has been sent. */ public function setPostBody ($body); /** * Specify the path to an SSL CA certificate to validate the server with. * * @param string $caCertPath path to cert file * @param boolean $validate_cn validate CN of SSL certificate * * @return void * @throws CAS_OutOfSequenceException If called after the Request has been sent. */ public function setSslCaCert ($caCertPath, $validate_cn = true); /********************************************************* * 2. Send the Request *********************************************************/ /** * Perform the request. * * @return bool TRUE on success, FALSE on failure. * @throws CAS_OutOfSequenceException If called multiple times. */ public function send (); /********************************************************* * 3. Access the response *********************************************************/ /** * Answer the headers of the response. * * @return array An array of header strings. * @throws CAS_OutOfSequenceException If called before the Request has been sent. */ public function getResponseHeaders (); /** * Answer HTTP status code of the response * * @return int * @throws CAS_OutOfSequenceException If called before the Request has been sent. */ public function getResponseStatusCode (); /** * Answer the body of response. * * @return string * @throws CAS_OutOfSequenceException If called before the Request has been sent. */ public function getResponseBody (); /** * Answer a message describing any errors if the request failed. * * @return string * @throws CAS_OutOfSequenceException If called before the Request has been sent. */ public function getErrorMessage (); } glpi-0.84.3+dfsg.1/lib/phpcas/LICENSE000066400000000000000000000261351226600447100166610ustar00rootroot00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. glpi-0.84.3+dfsg.1/lib/phpcas/NOTICE000066400000000000000000000075171226600447100165630ustar00rootroot00000000000000Copyright 2007-2011, JA-SIG, Inc. This project includes software developed by Jasig. http://www.jasig.org/ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License. You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. =========================================================================== Copyright © 2003-2007, The ESUP-Portail consortium Requirements for sources originally licensed under the New BSD License: Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of JA-SIG, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. =========================================================================== Copyright (c) 2009, Regents of the University of Nebraska All rights reserved. Requirements for CAS_Autloader originally licensed under the New BSD License: Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the University of Nebraska nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. glpi-0.84.3+dfsg.1/lib/phpcas/README.md000066400000000000000000000016151226600447100171270ustar00rootroot00000000000000phpCAS ======= phpCAS is an authentication library that allows PHP applications to easily authenticate users via a Central Authentication Service (CAS) server. Please see the phpCAS website for more information: https://wiki.jasig.org/display/CASC/phpCAS LICENSE ------- Copyright 2007-2011, JA-SIG, Inc. This project includes software developed by Jasig. http://www.jasig.org/ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License. You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. glpi-0.84.3+dfsg.1/lib/phpmailer/000077500000000000000000000000001226600447100163505ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/phpmailer/LICENSE000066400000000000000000000634651226600447100173730ustar00rootroot00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! glpi-0.84.3+dfsg.1/lib/phpmailer/README000066400000000000000000000211471226600447100172350ustar00rootroot00000000000000/******************************************************************* * http://code.google.com/a/apache-extras.org/p/phpmailer/ * ********************************************************************/ PHPMailer Full Featured Email Transfer Class for PHP ========================================== Version 5.2.1 (January 16, 2012) Patch release (see changelog.txt). Version 5.2.0 (July 19, 2011) With the release of this version, PHPMailer has moved to Apache Extras: http://code.google.com/a/apache-extras.org/p/phpmailer/ Version 5.0.0 (April 02, 2009) With the release of this version, we are initiating a new version numbering system to differentiate from the PHP4 version of PHPMailer. Most notable in this release is fully object oriented code. We now have available the PHPDocumentor (phpdocs) documentation. This is separate from the regular download to keep file sizes down. Please see the download area of http://phpmailer.codeworxtech.com. We also have created a new test script (see /test_script) that you can use right out of the box. Copy the /test_script folder directly to your server (in the same structure ... with class.phpmailer.php and class.smtp.php in the folder above it. Then launch the test script with: http://www.yourdomain.com/phpmailer/test_script/index.php from this one script, you can test your server settings for mail(), sendmail (or qmail), and SMTP. This will email you a sample email (using contents.html for the email body) and two attachments. One of the attachments is used as an inline image to demonstrate how PHPMailer will automatically detect if attachments are the same source as inline graphics and only include one version. Once you click the Submit button, the results will be displayed including any SMTP debug information and send status. We will also display a version of the script that you can cut and paste to include in your projects. Enjoy! Version 2.3 (November 08, 2008) We have removed the /phpdoc from the downloads. All documentation is now on the http://phpmailer.codeworxtech.com website. The phpunit.php has been updated to support PHP5. For all other changes and notes, please see the changelog. Donations are accepted at PayPal with our id "paypal@worxteam.com". Version 2.2 (July 15 2008) - see the changelog. Version 2.1 (June 04 2008) With this release, we are announcing that the development of PHPMailer for PHP5 will be our focus from this date on. We have implemented all the enhancements and fixes from the latest release of PHPMailer for PHP4. Far more important, though, is that this release of PHPMailer (v2.1) is fully tested with E_STRICT error checking enabled. ** NOTE: WE HAVE A NEW LANGUAGE VARIABLE FOR DIGITALLY SIGNED S/MIME EMAILS. IF YOU CAN HELP WITH LANGUAGES OTHER THAN ENGLISH AND SPANISH, IT WOULD BE APPRECIATED. We have now added S/MIME functionality (ability to digitally sign emails). BIG THANKS TO "sergiocambra" for posting this patch back in November 2007. The "Signed Emails" functionality adds the Sign method to pass the private key filename and the password to read it, and then email will be sent with content-type multipart/signed and with the digital signature attached. A quick note on E_STRICT: - In about half the test environments the development version was subjected to, an error was thrown for the date() functions (used at line 1565 and 1569). This is NOT a PHPMailer error, it is the result of an incorrectly configured PHP5 installation. The fix is to modify your 'php.ini' file and include the date.timezone = America/New York directive, (for your own server timezone) - If you do get this error, and are unable to access your php.ini file, there is a workaround. In your PHP script, add date_default_timezone_set('America/Toronto'); * do NOT try to use $myVar = date_default_timezone_get(); as a test, it will throw an error. We have also included more example files to show the use of "sendmail", "mail()", "smtp", and "gmail". We are also looking for more programmers to join the volunteer development team. If you have an interest in this, please let us know. Enjoy! Version 2.1.0beta1 & beta2 please note, this is BETA software ** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS INTENDED STRICTLY FOR TESTING ** NOTE: As of November 2007, PHPMailer has a new project team headed by industry veteran Andy Prevost (codeworxtech). The first release in more than two years will focus on fixes, adding ease-of-use enhancements, provide basic compatibility with PHP4 and PHP5 using PHP5 backwards compatibility features. A new release is planned before year-end 2007 that will provide full compatiblity with PHP4 and PHP5, as well as more bug fixes. We are looking for project developers to assist in restoring PHPMailer to its leadership position. Our goals are to simplify use of PHPMailer, provide good documentation and examples, and retain backward compatibility to level 1.7.3 standards. If you are interested in helping out, visit http://sourceforge.net/projects/phpmailer and indicate your interest. ** http://phpmailer.sourceforge.net/ This software is licenced under the LGPL. Please read LICENSE for information on the software availability and distribution. Class Features: - Send emails with multiple TOs, CCs, BCCs and REPLY-TOs - Redundant SMTP servers - Multipart/alternative emails for mail clients that do not read HTML email - Support for 8bit, base64, binary, and quoted-printable encoding - Uses the same methods as the very popular AspEmail active server (COM) component - SMTP authentication - Native language support - Word wrap, and more! Why you might need it: Many PHP developers utilize email in their code. The only PHP function that supports this is the mail() function. However, it does not expose any of the popular features that many email clients use nowadays like HTML-based emails and attachments. There are two proprietary development tools out there that have all the functionality built into easy to use classes: AspEmail(tm) and AspMail. Both of these programs are COM components only available on Windows. They are also a little pricey for smaller projects. Since I do Linux development I�ve missed these tools for my PHP coding. So I built a version myself that implements the same methods (object calls) that the Windows-based components do. It is open source and the LGPL license allows you to place the class in your proprietary PHP projects. Installation: Copy class.phpmailer.php into your php.ini include_path. If you are using the SMTP mailer then place class.smtp.php in your path as well. In the language directory you will find several files like phpmailer.lang-en.php. If you look right before the .php extension that there are two letters. These represent the language type of the translation file. For instance "en" is the English file and "br" is the Portuguese file. Chose the file that best fits with your language and place it in the PHP include path. If your language is English then you have nothing more to do. If it is a different language then you must point PHPMailer to the correct translation. To do this, call the PHPMailer SetLanguage method like so: // To load the Portuguese version $mail->SetLanguage("br", "/optional/path/to/language/directory/"); That's it. You should now be ready to use PHPMailer! A Simple Example: IsSMTP(); // set mailer to use SMTP $mail->Host = "smtp1.example.com;smtp2.example.com"; // specify main and backup server $mail->SMTPAuth = true; // turn on SMTP authentication $mail->Username = "jswan"; // SMTP username $mail->Password = "secret"; // SMTP password $mail->From = "from@example.com"; $mail->FromName = "Mailer"; $mail->AddAddress("josh@example.net", "Josh Adams"); $mail->AddAddress("ellen@example.com"); // name is optional $mail->AddReplyTo("info@example.com", "Information"); $mail->WordWrap = 50; // set word wrap to 50 characters $mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments $mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name $mail->IsHTML(true); // set email format to HTML $mail->Subject = "Here is the subject"; $mail->Body = "This is the HTML message body in bold!"; $mail->AltBody = "This is the body in plain text for non-HTML mail clients"; if(!$mail->Send()) { echo "Message could not be sent.

    "; echo "Mailer Error: " . $mail->ErrorInfo; exit; } echo "Message has been sent"; ?> CHANGELOG See ChangeLog.txt Download: http://sourceforge.net/project/showfiles.php?group_id=26031 Andy Prevost glpi-0.84.3+dfsg.1/lib/phpmailer/changelog.txt000066400000000000000000000414111226600447100210410ustar00rootroot00000000000000ChangeLog NOTE: THIS VERSION OF PHPMAILER IS DESIGNED FOR PHP5/PHP6. IT WILL NOT WORK WITH PHP4. Version 5.2.1 (January 16, 2012) * Closed several bugs * Performance improvements * MsgHTML() now returns the message as required. * New method: GetSentMIMEMessage() (returns full copy of sent message) Version 5.2 (July 19, 2011) * protected MIME body and header * better DKIM DNS Resource Record support * better aly handling * htmlfilter class added to extras * moved to Apache Extras Version 5.1 (October 20, 2009) * fixed filename issue with AddStringAttachment (thanks to Tony) * fixed "SingleTo" property, now works with Senmail, Qmail, and SMTP in addition to PHP mail() * added DKIM digital signing functionality New properties: - DKIM_domain (sets the domain name) - DKIM_private (holds DKIM private key) - DKIM_passphrase (holds your DKIM passphrase) - DKIM_selector (holds the DKIM "selector") - DKIM_identity (holds the identifying email address) * added callback function support - callback function parameters include: result, to, cc, bcc, subject and body * see the test/test_callback.php file for usage. * added "auto" identity functionality - can automatically add: - Return-path (if Sender not set) - Reply-To (if ReplyTo not set) - can be disabled: - $mail->SetFrom('yourname@yourdomain.com','First Last',false); - or by adding the $mail->Sender and/or $mail->ReplyTo properties Note: "auto" identity added to help with emails ending up in spam or junk boxes because of missing headers Version 5.0.2 (May 24, 2009) * Fix for missing attachments when inline graphics are present * Fix for missing Cc in header when using SMTP (mail was sent, but not displayed in header -- Cc receiver only saw email To: line and no Cc line, but did get the email (To receiver saw same) Version 5.0.1 (April 05, 2009) * Temporary fix for missing attachments Version 5.0.0 (April 02, 2009) * With the release of this version, we are initiating a new version numbering system to differentiate from the PHP4 version of PHPMailer. * Most notable in this release is fully object oriented code. class.smtp.php: * Refactored class.smtp.php to support new exception handling code size reduced from 29.2 Kb to 25.6 Kb * Removed unnecessary functions from class.smtp.php: public function Expand($name) { public function Help($keyword="") { public function Noop() { public function Send($from) { public function SendOrMail($from) { public function Verify($name) { class.phpmailer.php: * Refactored class.phpmailer.php with new exception handling * Changed processing functionality of Sendmail and Qmail so they cannot be inadvertently used * removed getFile() function, just became a simple wrapper for file_get_contents() * added check for PHP version (will gracefully exit if not at least PHP 5.0) class.phpmailer.php enhancements * enhanced code to check if an attachment source is the same as an embedded or inline graphic source to eliminate duplicate attachments New /test_script * We have written a test script you can use to test the script as part of your installation. Once you press submit, the test script will send a multi-mime email with either the message you type in or an HTML email with an inline graphic. Two attachments are included in the email (one of the attachments is also the inline graphic so you can see that only one copy of the graphic is sent in the email). The test script will also display the functional script that you can copy/paste to your editor to duplicate the functionality. New examples * All new examples in both basic and advanced modes. Advanced examples show Exception handling. PHPDocumentator (phpdocs) documentation for PHPMailer version 5.0.0 * all new documentation Please note: the website has been updated to reflect the changes in PHPMailer version 5.0.0. http://phpmailer.codeworxtech.com/ Version 2.3 (November 06, 2008) * added Arabic language (many thanks to Bahjat Al Mostafa) * removed English language from language files and made it a default within class.phpmailer.php - if no language is found, it will default to use the english language translation * fixed public/private declarations * corrected line 1728, $basedir to $directory * added $sign_cert_file to avoid improper duplicate use of $sign_key_file * corrected $this->Hello on line 612 to $this->Helo * changed default of $LE to "\r\n" to comply with RFC 2822. Can be set by the user if default is not acceptable * removed trim() from return results in EncodeQP * /test and three files it contained are removed from version 2.3 * fixed phpunit.php for compliance with PHP5 * changed $this->AltBody = $textMsg; to $this->AltBody = html_entity_decode($textMsg); * We have removed the /phpdoc from the downloads. All documentation is now on the http://phpmailer.codeworxtech.com website. Version 2.2.1 () July 19 2008 * fixed line 1092 in class.smtp.php (my apologies, error on my part) Version 2.2 () July 15 2008 * Fixed redirect issue (display of UTF-8 in thank you redirect) * fixed error in getResponse function declaration (class.pop3.php) * PHPMailer now PHP6 compliant * fixed line 1092 in class.smtp.php (endless loop from missing = sign) Version 2.1 (Wed, June 04 2008) ** NOTE: WE HAVE A NEW LANGUAGE VARIABLE FOR DIGITALLY SIGNED S/MIME EMAILS. IF YOU CAN HELP WITH LANGUAGES OTHER THAN ENGLISH AND SPANISH, IT WOULD BE APPRECIATED. * added S/MIME functionality (ability to digitally sign emails) BIG THANKS TO "sergiocambra" for posting this patch back in November 2007. The "Signed Emails" functionality adds the Sign method to pass the private key filename and the password to read it, and then email will be sent with content-type multipart/signed and with the digital signature attached. * fully compatible with E_STRICT error level - Please note: In about half the test environments this development version was subjected to, an error was thrown for the date() functions used (line 1565 and 1569). This is NOT a PHPMailer error, it is the result of an incorrectly configured PHP5 installation. The fix is to modify your 'php.ini' file and include the date.timezone = America/New York directive, to your own server timezone - If you do get this error, and are unable to access your php.ini file: In your PHP script, add date_default_timezone_set('America/Toronto'); - do not try to use $myVar = date_default_timezone_get(); as a test, it will throw an error. * added ability to define path (mainly for embedded images) function MsgHTML($message,$basedir='') ... where: $basedir is the fully qualified path * fixed MsgHTML() function: - Embedded Images where images are specified by :// will not be altered or embedded * fixed the return value of SMTP exit code ( pclose ) * addressed issue of multibyte characters in subject line and truncating * added ability to have user specified Message ID (default is still that PHPMailer create a unique Message ID) * corrected unidentified message type to 'application/octet-stream' * fixed chunk_split() multibyte issue (thanks to Colin Brown, et al). * added check for added attachments * enhanced conversion of HTML to text in MsgHTML (thanks to "brunny") Version 2.1.0beta2 (Sun, Dec 02 2007) * implemented updated EncodeQP (thanks to coolbru, aka Marcus Bointon) * finished all testing, all known bugs corrected, enhancements tested - note: will NOT work with PHP4. please note, this is BETA software ** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS INTENDED STRICTLY FOR TESTING Version 2.1.0beta1 please note, this is BETA software ** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS INTENDED STRICTLY FOR TESTING Version 2.0.0 rc2 (Fri, Nov 16 2007), interim release * implements new property to control VERP in class.smtp.php example (requires instantiating class.smtp.php): $mail->do_verp = true; * POP-before-SMTP functionality included, thanks to Richard Davey (see class.pop3.php & pop3_before_smtp_test.php for examples) * included example showing how to use PHPMailer with GMAIL * fixed the missing Cc in SendMail() and Mail() ****************** A note on sending bulk emails: If the email you are sending is not personalized, consider using the "undisclosed-recipient:;" strategy. That is, put all of your recipients in the Bcc field and set the To field to "undisclosed-recipients:;". It's a lot faster (only one send) and saves quite a bit on resources. Contrary to some opinions, this will not get you listed in spam engines - it's a legitimate way for you to send emails. A partial example for use with PHPMailer: $mail->AddAddress("undisclosed-recipients:;"); $mail->AddBCC("email1@anydomain.com,email2@anyotherdomain.com,email3@anyalternatedomain.com"); Many email service providers restrict the number of emails that can be sent in any given time period. Often that is between 50 - 60 emails maximum per hour or per send session. If that's the case, then break up your Bcc lists into chunks that are one less than your limit, and put a pause in your script. ******************* Version 2.0.0 rc1 (Thu, Nov 08 2007), interim release * dramatically simplified using inline graphics ... it's fully automated and requires no user input * added automatic document type detection for attachments and pictures * added MsgHTML() function to replace Body tag for HTML emails * fixed the SendMail security issues (input validation vulnerability) * enhanced the AddAddresses functionality so that the "Name" portion is used in the email address * removed the need to use the AltBody method (set from the HTML, or default text used) * set the PHP Mail() function as the default (still support SendMail, SMTP Mail) * removed the need to set the IsHTML property (set automatically) * added Estonian language file by Indrek Päri * added header injection patch * added "set" method to permit users to create their own pseudo-properties like 'X-Headers', etc. example of use: $mail->set('X-Priority', '3'); $mail->set('X-MSMail-Priority', 'Normal'); * fixed warning message in SMTP get_lines method * added TLS/SSL SMTP support example of use: $mail = new PHPMailer(); $mail->Mailer = "smtp"; $mail->Host = "smtp.example.com"; $mail->SMTPSecure = "tls"; // option //$mail->SMTPSecure = "ssl"; // option ... $mail->Send(); * PHPMailer has been tested with PHP4 (4.4.7) and PHP5 (5.2.7) * Works with PHP installed as a module or as CGI-PHP - NOTE: will NOT work with PHP5 in E_STRICT error mode Version 1.73 (Sun, Jun 10 2005) * Fixed denial of service bug: http://www.cybsec.com/vuln/PHPMailer-DOS.pdf * Now has a total of 20 translations * Fixed alt attachments bug: http://tinyurl.com/98u9k Version 1.72 (Wed, May 25 2004) * Added Dutch, Swedish, Czech, Norwegian, and Turkish translations. * Received: Removed this method because spam filter programs like SpamAssassin reject this header. * Fixed error count bug. * SetLanguage default is now "language/". * Fixed magic_quotes_runtime bug. Version 1.71 (Tue, Jul 28 2003) * Made several speed enhancements * Added German and Italian translation files * Fixed HELO/AUTH bugs on keep-alive connects * Now provides an error message if language file does not load * Fixed attachment EOL bug * Updated some unclear documentation * Added additional tests and improved others Version 1.70 (Mon, Jun 20 2003) * Added SMTP keep-alive support * Added IsError method for error detection * Added error message translation support (SetLanguage) * Refactored many methods to increase library performance * Hello now sends the newer EHLO message before HELO as per RFC 2821 * Removed the boundary class and replaced it with GetBoundary * Removed queue support methods * New $Hostname variable * New Message-ID header * Received header reformat * Helo variable default changed to $Hostname * Removed extra spaces in Content-Type definition (#667182) * Return-Path should be set to Sender when set * Adds Q or B encoding to headers when necessary * quoted-encoding should now encode NULs \000 * Fixed encoding of body/AltBody (#553370) * Adds "To: undisclosed-recipients:;" when all recipients are hidden (BCC) * Multiple bug fixes Version 1.65 (Fri, Aug 09 2002) * Fixed non-visible attachment bug (#585097) for Outlook * SMTP connections are now closed after each transaction * Fixed SMTP::Expand return value * Converted SMTP class documentation to phpDocumentor format Version 1.62 (Wed, Jun 26 2002) * Fixed multi-attach bug * Set proper word wrapping * Reduced memory use with attachments * Added more debugging * Changed documentation to phpDocumentor format Version 1.60 (Sat, Mar 30 2002) * Sendmail pipe and address patch (Christian Holtje) * Added embedded image and read confirmation support (A. Ognio) * Added unit tests * Added SMTP timeout support (*nix only) * Added possibly temporary PluginDir variable for SMTP class * Added LE message line ending variable * Refactored boundary and attachment code * Eliminated SMTP class warnings * Added SendToQueue method for future queuing support Version 1.54 (Wed, Dec 19 2001) * Add some queuing support code * Fixed a pesky multi/alt bug * Messages are no longer forced to have "To" addresses Version 1.50 (Thu, Nov 08 2001) * Fix extra lines when not using SMTP mailer * Set WordWrap variable to int with a zero default Version 1.47 (Tue, Oct 16 2001) * Fixed Received header code format * Fixed AltBody order error * Fixed alternate port warning Version 1.45 (Tue, Sep 25 2001) * Added enhanced SMTP debug support * Added support for multiple ports on SMTP * Added Received header for tracing * Fixed AddStringAttachment encoding * Fixed possible header name quote bug * Fixed wordwrap() trim bug * Couple other small bug fixes Version 1.41 (Wed, Aug 22 2001) * Fixed AltBody bug w/o attachments * Fixed rfc_date() for certain mail servers Version 1.40 (Sun, Aug 12 2001) * Added multipart/alternative support (AltBody) * Documentation update * Fixed bug in Mercury MTA Version 1.29 (Fri, Aug 03 2001) * Added AddStringAttachment() method * Added SMTP authentication support Version 1.28 (Mon, Jul 30 2001) * Fixed a typo in SMTP class * Fixed header issue with Imail (win32) SMTP server * Made fopen() calls for attachments use "rb" to fix win32 error Version 1.25 (Mon, Jul 02 2001) * Added RFC 822 date fix (Patrice) * Added improved error handling by adding a $ErrorInfo variable * Removed MailerDebug variable (obsolete with new error handler) Version 1.20 (Mon, Jun 25 2001) * Added quoted-printable encoding (Patrice) * Set Version as public and removed PrintVersion() * Changed phpdoc to only display public variables and methods Version 1.19 (Thu, Jun 21 2001) * Fixed MS Mail header bug * Added fix for Bcc problem with mail(). *Does not work on Win32* (See PHP bug report: http://www.php.net/bugs.php?id=11616) * mail() no longer passes a fifth parameter when not needed Version 1.15 (Fri, Jun 15 2001) [Note: these changes contributed by Patrice Fournier] * Changed all remaining \n to \r\n * Bcc: header no longer writen to message except when sent directly to sendmail * Added a small message to non-MIME compliant mail reader * Added Sender variable to change the Sender email used in -f for sendmail/mail and in 'MAIL FROM' for smtp mode * Changed boundary setting to a place it will be set only once * Removed transfer encoding for whole message when using multipart * Message body now uses Encoding in multipart messages * Can set encoding and type to attachments 7bit, 8bit and binary attachment are sent as is, base64 are encoded * Can set Encoding to base64 to send 8 bits body through 7 bits servers Version 1.10 (Tue, Jun 12 2001) * Fixed win32 mail header bug (printed out headers in message body) Version 1.09 (Fri, Jun 08 2001) * Changed date header to work with Netscape mail programs * Altered phpdoc documentation Version 1.08 (Tue, Jun 05 2001) * Added enhanced error-checking * Added phpdoc documentation to source Version 1.06 (Fri, Jun 01 2001) * Added optional name for file attachments Version 1.05 (Tue, May 29 2001) * Code cleanup * Eliminated sendmail header warning message * Fixed possible SMTP error Version 1.03 (Thu, May 24 2001) * Fixed problem where qmail sends out duplicate messages Version 1.02 (Wed, May 23 2001) * Added multiple recipient and attachment Clear* methods * Added Sendmail public variable * Fixed problem with loading SMTP library multiple times Version 0.98 (Tue, May 22 2001) * Fixed problem with redundant mail hosts sending out multiple messages * Added additional error handler code * Added AddCustomHeader() function * Added support for Microsoft mail client headers (affects priority) * Fixed small bug with Mailer variable * Added PrintVersion() function Version 0.92 (Tue, May 15 2001) * Changed file names to class.phpmailer.php and class.smtp.php to match current PHP class trend. * Fixed problem where body not being printed when a message is attached * Several small bug fixes Version 0.90 (Tue, April 17 2001) * Intial public release glpi-0.84.3+dfsg.1/lib/phpmailer/class.phpmailer.php000066400000000000000000002375241226600447100221630ustar00rootroot00000000000000exceptions = ($exceptions == true); } /** * Sets message type to HTML. * @param bool $ishtml * @return void */ public function IsHTML($ishtml = true) { if ($ishtml) { $this->ContentType = 'text/html'; } else { $this->ContentType = 'text/plain'; } } /** * Sets Mailer to send message using SMTP. * @return void */ public function IsSMTP() { $this->Mailer = 'smtp'; } /** * Sets Mailer to send message using PHP mail() function. * @return void */ public function IsMail() { $this->Mailer = 'mail'; } /** * Sets Mailer to send message using the $Sendmail program. * @return void */ public function IsSendmail() { if (!stristr(ini_get('sendmail_path'), 'sendmail')) { $this->Sendmail = '/var/qmail/bin/sendmail'; } $this->Mailer = 'sendmail'; } /** * Sets Mailer to send message using the qmail MTA. * @return void */ public function IsQmail() { if (stristr(ini_get('sendmail_path'), 'qmail')) { $this->Sendmail = '/var/qmail/bin/sendmail'; } $this->Mailer = 'sendmail'; } ///////////////////////////////////////////////// // METHODS, RECIPIENTS ///////////////////////////////////////////////// /** * Adds a "To" address. * @param string $address * @param string $name * @return boolean true on success, false if address already used */ public function AddAddress($address, $name = '') { return $this->AddAnAddress('to', $address, $name); } /** * Adds a "Cc" address. * Note: this function works with the SMTP mailer on win32, not with the "mail" mailer. * @param string $address * @param string $name * @return boolean true on success, false if address already used */ public function AddCC($address, $name = '') { return $this->AddAnAddress('cc', $address, $name); } /** * Adds a "Bcc" address. * Note: this function works with the SMTP mailer on win32, not with the "mail" mailer. * @param string $address * @param string $name * @return boolean true on success, false if address already used */ public function AddBCC($address, $name = '') { return $this->AddAnAddress('bcc', $address, $name); } /** * Adds a "Reply-to" address. * @param string $address * @param string $name * @return boolean */ public function AddReplyTo($address, $name = '') { return $this->AddAnAddress('Reply-To', $address, $name); } /** * Adds an address to one of the recipient arrays * Addresses that have been added already return false, but do not throw exceptions * @param string $kind One of 'to', 'cc', 'bcc', 'ReplyTo' * @param string $address The email address to send to * @param string $name * @return boolean true on success, false if address already used or invalid in some way * @access protected */ protected function AddAnAddress($kind, $address, $name = '') { if (!preg_match('/^(to|cc|bcc|Reply-To)$/', $kind)) { $this->SetError($this->Lang('Invalid recipient array').': '.$kind); if ($this->exceptions) { throw new phpmailerException('Invalid recipient array: ' . $kind); } if ($this->SMTPDebug) { echo $this->Lang('Invalid recipient array').': '.$kind; } return false; } $address = trim($address); $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim if (!self::ValidateAddress($address)) { $this->SetError($this->Lang('invalid_address').': '. $address); if ($this->exceptions) { throw new phpmailerException($this->Lang('invalid_address').': '.$address); } if ($this->SMTPDebug) { echo $this->Lang('invalid_address').': '.$address; } return false; } if ($kind != 'Reply-To') { if (!isset($this->all_recipients[strtolower($address)])) { array_push($this->$kind, array($address, $name)); $this->all_recipients[strtolower($address)] = true; return true; } } else { if (!array_key_exists(strtolower($address), $this->ReplyTo)) { $this->ReplyTo[strtolower($address)] = array($address, $name); return true; } } return false; } /** * Set the From and FromName properties * @param string $address * @param string $name * @return boolean */ public function SetFrom($address, $name = '', $auto = 1) { $address = trim($address); $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim if (!self::ValidateAddress($address)) { $this->SetError($this->Lang('invalid_address').': '. $address); if ($this->exceptions) { throw new phpmailerException($this->Lang('invalid_address').': '.$address); } if ($this->SMTPDebug) { echo $this->Lang('invalid_address').': '.$address; } return false; } $this->From = $address; $this->FromName = $name; if ($auto) { if (empty($this->ReplyTo)) { $this->AddAnAddress('Reply-To', $address, $name); } if (empty($this->Sender)) { $this->Sender = $address; } } return true; } /** * Check that a string looks roughly like an email address should * Static so it can be used without instantiation * Tries to use PHP built-in validator in the filter extension (from PHP 5.2), falls back to a reasonably competent regex validator * Conforms approximately to RFC2822 * @link http://www.hexillion.com/samples/#Regex Original pattern found here * @param string $address The email address to check * @return boolean * @static * @access public */ public static function ValidateAddress($address) { if (function_exists('filter_var')) { //Introduced in PHP 5.2 if(filter_var($address, FILTER_VALIDATE_EMAIL) === FALSE) { return false; } else { return true; } } else { return preg_match('/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!\.)){0,61}[a-zA-Z0-9_-]?\.)+[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!$)){0,61}[a-zA-Z0-9_]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/', $address); } } ///////////////////////////////////////////////// // METHODS, MAIL SENDING ///////////////////////////////////////////////// /** * Creates message and assigns Mailer. If the message is * not sent successfully then it returns false. Use the ErrorInfo * variable to view description of the error. * @return bool */ public function Send() { try { if(!$this->PreSend()) return false; return $this->PostSend(); } catch (phpmailerException $e) { $this->SentMIMEMessage = ''; $this->SetError($e->getMessage()); if ($this->exceptions) { throw $e; } return false; } } protected function PreSend() { try { $mailHeader = ""; if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) { throw new phpmailerException($this->Lang('provide_address'), self::STOP_CRITICAL); } // Set whether the message is multipart/alternative if(!empty($this->AltBody)) { $this->ContentType = 'multipart/alternative'; } $this->error_count = 0; // reset errors $this->SetMessageType(); //Refuse to send an empty message if (empty($this->Body)) { throw new phpmailerException($this->Lang('empty_message'), self::STOP_CRITICAL); } $this->MIMEHeader = $this->CreateHeader(); $this->MIMEBody = $this->CreateBody(); // To capture the complete message when using mail(), create // an extra header list which CreateHeader() doesn't fold in if ($this->Mailer == 'mail') { if (count($this->to) > 0) { $mailHeader .= $this->AddrAppend("To", $this->to); } else { $mailHeader .= $this->HeaderLine("To", "undisclosed-recipients:;"); } $mailHeader .= $this->HeaderLine('Subject', $this->EncodeHeader($this->SecureHeader(trim($this->Subject)))); // if(count($this->cc) > 0) { // $mailHeader .= $this->AddrAppend("Cc", $this->cc); // } } // digitally sign with DKIM if enabled if ($this->DKIM_domain && $this->DKIM_private) { $header_dkim = $this->DKIM_Add($this->MIMEHeader, $this->EncodeHeader($this->SecureHeader($this->Subject)), $this->MIMEBody); $this->MIMEHeader = str_replace("\r\n", "\n", $header_dkim) . $this->MIMEHeader; } $this->SentMIMEMessage = sprintf("%s%s\r\n\r\n%s",$this->MIMEHeader,$mailHeader,$this->MIMEBody); return true; } catch (phpmailerException $e) { $this->SetError($e->getMessage()); if ($this->exceptions) { throw $e; } return false; } } protected function PostSend() { try { // Choose the mailer and send through it switch($this->Mailer) { case 'sendmail': return $this->SendmailSend($this->MIMEHeader, $this->MIMEBody); case 'smtp': return $this->SmtpSend($this->MIMEHeader, $this->MIMEBody); case 'mail': return $this->MailSend($this->MIMEHeader, $this->MIMEBody); default: return $this->MailSend($this->MIMEHeader, $this->MIMEBody); } } catch (phpmailerException $e) { $this->SetError($e->getMessage()); if ($this->exceptions) { throw $e; } if ($this->SMTPDebug) { echo $e->getMessage()."\n"; } return false; } } /** * Sends mail using the $Sendmail program. * @param string $header The message headers * @param string $body The message body * @access protected * @return bool */ protected function SendmailSend($header, $body) { if ($this->Sender != '') { $sendmail = sprintf("%s -oi -f %s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender)); } else { $sendmail = sprintf("%s -oi -t", escapeshellcmd($this->Sendmail)); } if ($this->SingleTo === true) { foreach ($this->SingleToArray as $key => $val) { if(!@$mail = popen($sendmail, 'w')) { throw new phpmailerException($this->Lang('execute') . $this->Sendmail, self::STOP_CRITICAL); } fputs($mail, "To: " . $val . "\n"); fputs($mail, $header); fputs($mail, $body); $result = pclose($mail); // implement call back function if it exists $isSent = ($result == 0) ? 1 : 0; $this->doCallback($isSent, $val, $this->cc, $this->bcc, $this->Subject, $body); if($result != 0) { throw new phpmailerException($this->Lang('execute') . $this->Sendmail, self::STOP_CRITICAL); } } } else { if(!@$mail = popen($sendmail, 'w')) { throw new phpmailerException($this->Lang('execute') . $this->Sendmail, self::STOP_CRITICAL); } fputs($mail, $header); fputs($mail, $body); $result = pclose($mail); // implement call back function if it exists $isSent = ($result == 0) ? 1 : 0; $this->doCallback($isSent, $this->to, $this->cc, $this->bcc, $this->Subject, $body); if($result != 0) { throw new phpmailerException($this->Lang('execute') . $this->Sendmail, self::STOP_CRITICAL); } } return true; } /** * Sends mail using the PHP mail() function. * @param string $header The message headers * @param string $body The message body * @access protected * @return bool */ protected function MailSend($header, $body) { $toArr = array(); foreach($this->to as $t) { $toArr[] = $this->AddrFormat($t); } $to = implode(', ', $toArr); if (empty($this->Sender)) { $params = "-oi "; } else { $params = sprintf("-oi -f %s", $this->Sender); } if ($this->Sender != '' and !ini_get('safe_mode')) { $old_from = ini_get('sendmail_from'); ini_set('sendmail_from', $this->Sender); if ($this->SingleTo === true && count($toArr) > 1) { foreach ($toArr as $key => $val) { $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params); // implement call back function if it exists $isSent = ($rt == 1) ? 1 : 0; $this->doCallback($isSent, $val, $this->cc, $this->bcc, $this->Subject, $body); } } else { $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params); // implement call back function if it exists $isSent = ($rt == 1) ? 1 : 0; $this->doCallback($isSent, $to, $this->cc, $this->bcc, $this->Subject, $body); } } else { if ($this->SingleTo === true && count($toArr) > 1) { foreach ($toArr as $key => $val) { $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params); // implement call back function if it exists $isSent = ($rt == 1) ? 1 : 0; $this->doCallback($isSent, $val, $this->cc, $this->bcc, $this->Subject, $body); } } else { $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params); // implement call back function if it exists $isSent = ($rt == 1) ? 1 : 0; $this->doCallback($isSent, $to, $this->cc, $this->bcc, $this->Subject, $body); } } if (isset($old_from)) { ini_set('sendmail_from', $old_from); } if(!$rt) { throw new phpmailerException($this->Lang('instantiate'), self::STOP_CRITICAL); } return true; } /** * Sends mail via SMTP using PhpSMTP * Returns false if there is a bad MAIL FROM, RCPT, or DATA input. * @param string $header The message headers * @param string $body The message body * @uses SMTP * @access protected * @return bool */ protected function SmtpSend($header, $body) { require_once $this->PluginDir . 'class.smtp.php'; $bad_rcpt = array(); if(!$this->SmtpConnect()) { throw new phpmailerException($this->Lang('smtp_connect_failed'), self::STOP_CRITICAL); } $smtp_from = ($this->Sender == '') ? $this->From : $this->Sender; if(!$this->smtp->Mail($smtp_from)) { throw new phpmailerException($this->Lang('from_failed') . $smtp_from, self::STOP_CRITICAL); } // Attempt to send attach all recipients foreach($this->to as $to) { if (!$this->smtp->Recipient($to[0])) { $bad_rcpt[] = $to[0]; // implement call back function if it exists $isSent = 0; $this->doCallback($isSent, $to[0], '', '', $this->Subject, $body); } else { // implement call back function if it exists $isSent = 1; $this->doCallback($isSent, $to[0], '', '', $this->Subject, $body); } } foreach($this->cc as $cc) { if (!$this->smtp->Recipient($cc[0])) { $bad_rcpt[] = $cc[0]; // implement call back function if it exists $isSent = 0; $this->doCallback($isSent, '', $cc[0], '', $this->Subject, $body); } else { // implement call back function if it exists $isSent = 1; $this->doCallback($isSent, '', $cc[0], '', $this->Subject, $body); } } foreach($this->bcc as $bcc) { if (!$this->smtp->Recipient($bcc[0])) { $bad_rcpt[] = $bcc[0]; // implement call back function if it exists $isSent = 0; $this->doCallback($isSent, '', '', $bcc[0], $this->Subject, $body); } else { // implement call back function if it exists $isSent = 1; $this->doCallback($isSent, '', '', $bcc[0], $this->Subject, $body); } } if (count($bad_rcpt) > 0 ) { //Create error message for any bad addresses $badaddresses = implode(', ', $bad_rcpt); throw new phpmailerException($this->Lang('recipients_failed') . $badaddresses); } if(!$this->smtp->Data($header . $body)) { throw new phpmailerException($this->Lang('data_not_accepted'), self::STOP_CRITICAL); } if($this->SMTPKeepAlive == true) { $this->smtp->Reset(); } return true; } /** * Initiates a connection to an SMTP server. * Returns false if the operation failed. * @uses SMTP * @access public * @return bool */ public function SmtpConnect() { if(is_null($this->smtp)) { $this->smtp = new SMTP(); } $this->smtp->do_debug = $this->SMTPDebug; $hosts = explode(';', $this->Host); $index = 0; $connection = $this->smtp->Connected(); // Retry while there is no connection try { while($index < count($hosts) && !$connection) { $hostinfo = array(); if (preg_match('/^(.+):([0-9]+)$/', $hosts[$index], $hostinfo)) { $host = $hostinfo[1]; $port = $hostinfo[2]; } else { $host = $hosts[$index]; $port = $this->Port; } $tls = ($this->SMTPSecure == 'tls'); $ssl = ($this->SMTPSecure == 'ssl'); if ($this->smtp->Connect(($ssl ? 'ssl://':'').$host, $port, $this->Timeout)) { $hello = ($this->Helo != '' ? $this->Helo : $this->ServerHostname()); $this->smtp->Hello($hello); if ($tls) { if (!$this->smtp->StartTLS()) { throw new phpmailerException($this->Lang('tls')); } //We must resend HELO after tls negotiation $this->smtp->Hello($hello); } $connection = true; if ($this->SMTPAuth) { if (!$this->smtp->Authenticate($this->Username, $this->Password)) { throw new phpmailerException($this->Lang('authenticate')); } } } $index++; if (!$connection) { throw new phpmailerException($this->Lang('connect_host')); } } } catch (phpmailerException $e) { $this->smtp->Reset(); if ($this->exceptions) { throw $e; } } return true; } /** * Closes the active SMTP session if one exists. * @return void */ public function SmtpClose() { if(!is_null($this->smtp)) { if($this->smtp->Connected()) { $this->smtp->Quit(); $this->smtp->Close(); } } } /** * Sets the language for all class error messages. * Returns false if it cannot load the language file. The default language is English. * @param string $langcode ISO 639-1 2-character language code (e.g. Portuguese: "br") * @param string $lang_path Path to the language file directory * @access public */ function SetLanguage($langcode = 'en', $lang_path = 'language/') { //Define full set of translatable strings $PHPMAILER_LANG = array( 'provide_address' => 'You must provide at least one recipient email address.', 'mailer_not_supported' => ' mailer is not supported.', 'execute' => 'Could not execute: ', 'instantiate' => 'Could not instantiate mail function.', 'authenticate' => 'SMTP Error: Could not authenticate.', 'from_failed' => 'The following From address failed: ', 'recipients_failed' => 'SMTP Error: The following recipients failed: ', 'data_not_accepted' => 'SMTP Error: Data not accepted.', 'connect_host' => 'SMTP Error: Could not connect to SMTP host.', 'file_access' => 'Could not access file: ', 'file_open' => 'File Error: Could not open file: ', 'encoding' => 'Unknown encoding: ', 'signing' => 'Signing Error: ', 'smtp_error' => 'SMTP server error: ', 'empty_message' => 'Message body empty', 'invalid_address' => 'Invalid address', 'variable_set' => 'Cannot set or reset variable: ' ); //Overwrite language-specific strings. This way we'll never have missing translations - no more "language string failed to load"! $l = true; if ($langcode != 'en') { //There is no English translation file $l = @include $lang_path.'phpmailer.lang-'.$langcode.'.php'; } $this->language = $PHPMAILER_LANG; return ($l == true); //Returns false if language not found } /** * Return the current array of language strings * @return array */ public function GetTranslations() { return $this->language; } ///////////////////////////////////////////////// // METHODS, MESSAGE CREATION ///////////////////////////////////////////////// /** * Creates recipient headers. * @access public * @return string */ public function AddrAppend($type, $addr) { $addr_str = $type . ': '; $addresses = array(); foreach ($addr as $a) { $addresses[] = $this->AddrFormat($a); } $addr_str .= implode(', ', $addresses); $addr_str .= $this->LE; return $addr_str; } /** * Formats an address correctly. * @access public * @return string */ public function AddrFormat($addr) { if (empty($addr[1])) { return $this->SecureHeader($addr[0]); } else { return $this->EncodeHeader($this->SecureHeader($addr[1]), 'phrase') . " <" . $this->SecureHeader($addr[0]) . ">"; } } /** * Wraps message for use with mailers that do not * automatically perform wrapping and for quoted-printable. * Original written by philippe. * @param string $message The message to wrap * @param integer $length The line length to wrap to * @param boolean $qp_mode Whether to run in Quoted-Printable mode * @access public * @return string */ public function WrapText($message, $length, $qp_mode = false) { $soft_break = ($qp_mode) ? sprintf(" =%s", $this->LE) : $this->LE; // If utf-8 encoding is used, we will need to make sure we don't // split multibyte characters when we wrap $is_utf8 = (strtolower($this->CharSet) == "utf-8"); $message = $this->FixEOL($message); if (substr($message, -1) == $this->LE) { $message = substr($message, 0, -1); } $line = explode($this->LE, $message); $message = ''; for ($i = 0 ;$i < count($line); $i++) { $line_part = explode(' ', $line[$i]); $buf = ''; for ($e = 0; $e $length)) { $space_left = $length - strlen($buf) - 1; if ($e != 0) { if ($space_left > 20) { $len = $space_left; if ($is_utf8) { $len = $this->UTF8CharBoundary($word, $len); } elseif (substr($word, $len - 1, 1) == "=") { $len--; } elseif (substr($word, $len - 2, 1) == "=") { $len -= 2; } $part = substr($word, 0, $len); $word = substr($word, $len); $buf .= ' ' . $part; $message .= $buf . sprintf("=%s", $this->LE); } else { $message .= $buf . $soft_break; } $buf = ''; } while (strlen($word) > 0) { $len = $length; if ($is_utf8) { $len = $this->UTF8CharBoundary($word, $len); } elseif (substr($word, $len - 1, 1) == "=") { $len--; } elseif (substr($word, $len - 2, 1) == "=") { $len -= 2; } $part = substr($word, 0, $len); $word = substr($word, $len); if (strlen($word) > 0) { $message .= $part . sprintf("=%s", $this->LE); } else { $buf = $part; } } } else { $buf_o = $buf; $buf .= ($e == 0) ? $word : (' ' . $word); if (strlen($buf) > $length and $buf_o != '') { $message .= $buf_o . $soft_break; $buf = $word; } } } $message .= $buf . $this->LE; } return $message; } /** * Finds last character boundary prior to maxLength in a utf-8 * quoted (printable) encoded string. * Original written by Colin Brown. * @access public * @param string $encodedText utf-8 QP text * @param int $maxLength find last character boundary prior to this length * @return int */ public function UTF8CharBoundary($encodedText, $maxLength) { $foundSplitPos = false; $lookBack = 3; while (!$foundSplitPos) { $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack); $encodedCharPos = strpos($lastChunk, "="); if ($encodedCharPos !== false) { // Found start of encoded character byte within $lookBack block. // Check the encoded byte value (the 2 chars after the '=') $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2); $dec = hexdec($hex); if ($dec < 128) { // Single byte character. // If the encoded char was found at pos 0, it will fit // otherwise reduce maxLength to start of the encoded char $maxLength = ($encodedCharPos == 0) ? $maxLength : $maxLength - ($lookBack - $encodedCharPos); $foundSplitPos = true; } elseif ($dec >= 192) { // First byte of a multi byte character // Reduce maxLength to split at start of character $maxLength = $maxLength - ($lookBack - $encodedCharPos); $foundSplitPos = true; } elseif ($dec < 192) { // Middle byte of a multi byte character, look further back $lookBack += 3; } } else { // No encoded character found $foundSplitPos = true; } } return $maxLength; } /** * Set the body wrapping. * @access public * @return void */ public function SetWordWrap() { if($this->WordWrap < 1) { return; } switch($this->message_type) { case 'alt': case 'alt_inline': case 'alt_attach': case 'alt_inline_attach': $this->AltBody = $this->WrapText($this->AltBody, $this->WordWrap); break; default: $this->Body = $this->WrapText($this->Body, $this->WordWrap); break; } } /** * Assembles message header. * @access public * @return string The assembled header */ public function CreateHeader() { $result = ''; // Set the boundaries $uniq_id = md5(uniqid(time())); $this->boundary[1] = 'b1_' . $uniq_id; $this->boundary[2] = 'b2_' . $uniq_id; $this->boundary[3] = 'b3_' . $uniq_id; $result .= $this->HeaderLine('Date', self::RFCDate()); if($this->Sender == '') { $result .= $this->HeaderLine('Return-Path', trim($this->From)); } else { $result .= $this->HeaderLine('Return-Path', trim($this->Sender)); } // To be created automatically by mail() if($this->Mailer != 'mail') { if ($this->SingleTo === true) { foreach($this->to as $t) { $this->SingleToArray[] = $this->AddrFormat($t); } } else { if(count($this->to) > 0) { $result .= $this->AddrAppend('To', $this->to); } elseif (count($this->cc) == 0) { $result .= $this->HeaderLine('To', 'undisclosed-recipients:;'); } } } $from = array(); $from[0][0] = trim($this->From); $from[0][1] = $this->FromName; $result .= $this->AddrAppend('From', $from); // sendmail and mail() extract Cc from the header before sending if(count($this->cc) > 0) { $result .= $this->AddrAppend('Cc', $this->cc); } // sendmail and mail() extract Bcc from the header before sending if((($this->Mailer == 'sendmail') || ($this->Mailer == 'mail')) && (count($this->bcc) > 0)) { $result .= $this->AddrAppend('Bcc', $this->bcc); } if(count($this->ReplyTo) > 0) { $result .= $this->AddrAppend('Reply-To', $this->ReplyTo); } // mail() sets the subject itself if($this->Mailer != 'mail') { $result .= $this->HeaderLine('Subject', $this->EncodeHeader($this->SecureHeader($this->Subject))); } if($this->MessageID != '') { $result .= $this->HeaderLine('Message-ID', $this->MessageID); } else { $result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE); } $result .= $this->HeaderLine('X-Priority', $this->Priority); if($this->XMailer) { $result .= $this->HeaderLine('X-Mailer', $this->XMailer); } else { $result .= $this->HeaderLine('X-Mailer', 'PHPMailer '.$this->Version.' (http://code.google.com/a/apache-extras.org/p/phpmailer/)'); } if($this->ConfirmReadingTo != '') { $result .= $this->HeaderLine('Disposition-Notification-To', '<' . trim($this->ConfirmReadingTo) . '>'); } // Add custom headers for($index = 0; $index < count($this->CustomHeader); $index++) { $result .= $this->HeaderLine(trim($this->CustomHeader[$index][0]), $this->EncodeHeader(trim($this->CustomHeader[$index][1]))); } if (!$this->sign_key_file) { $result .= $this->HeaderLine('MIME-Version', '1.0'); $result .= $this->GetMailMIME(); } return $result; } /** * Returns the message MIME. * @access public * @return string */ public function GetMailMIME() { $result = ''; switch($this->message_type) { case 'plain': $result .= $this->HeaderLine('Content-Transfer-Encoding', $this->Encoding); $result .= $this->TextLine('Content-Type: '.$this->ContentType.'; charset="'.$this->CharSet.'"'); break; case 'inline': $result .= $this->HeaderLine('Content-Type', 'multipart/related;'); $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"'); break; case 'attach': case 'inline_attach': case 'alt_attach': case 'alt_inline_attach': $result .= $this->HeaderLine('Content-Type', 'multipart/mixed;'); $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"'); break; case 'alt': case 'alt_inline': $result .= $this->HeaderLine('Content-Type', 'multipart/alternative;'); $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"'); break; } if($this->Mailer != 'mail') { $result .= $this->LE.$this->LE; } return $result; } /** * Returns the MIME message (headers and body). Only really valid post PreSend(). * @access public * @return string */ public function GetSentMIMEMessage() { return $this->SentMIMEMessage; } /** * Assembles the message body. Returns an empty string on failure. * @access public * @return string The assembled message body */ public function CreateBody() { $body = ''; if ($this->sign_key_file) { $body .= $this->GetMailMIME(); } $this->SetWordWrap(); switch($this->message_type) { case 'plain': $body .= $this->EncodeString($this->Body, $this->Encoding); break; case 'inline': $body .= $this->GetBoundary($this->boundary[1], '', '', ''); $body .= $this->EncodeString($this->Body, $this->Encoding); $body .= $this->LE.$this->LE; $body .= $this->AttachAll("inline", $this->boundary[1]); break; case 'attach': $body .= $this->GetBoundary($this->boundary[1], '', '', ''); $body .= $this->EncodeString($this->Body, $this->Encoding); $body .= $this->LE.$this->LE; $body .= $this->AttachAll("attachment", $this->boundary[1]); break; case 'inline_attach': $body .= $this->TextLine("--" . $this->boundary[1]); $body .= $this->HeaderLine('Content-Type', 'multipart/related;'); $body .= $this->TextLine("\tboundary=\"" . $this->boundary[2] . '"'); $body .= $this->LE; $body .= $this->GetBoundary($this->boundary[2], '', '', ''); $body .= $this->EncodeString($this->Body, $this->Encoding); $body .= $this->LE.$this->LE; $body .= $this->AttachAll("inline", $this->boundary[2]); $body .= $this->LE; $body .= $this->AttachAll("attachment", $this->boundary[1]); break; case 'alt': $body .= $this->GetBoundary($this->boundary[1], '', 'text/plain', ''); $body .= $this->EncodeString($this->AltBody, $this->Encoding); $body .= $this->LE.$this->LE; $body .= $this->GetBoundary($this->boundary[1], '', 'text/html', ''); $body .= $this->EncodeString($this->Body, $this->Encoding); $body .= $this->LE.$this->LE; $body .= $this->EndBoundary($this->boundary[1]); break; case 'alt_inline': $body .= $this->GetBoundary($this->boundary[1], '', 'text/plain', ''); $body .= $this->EncodeString($this->AltBody, $this->Encoding); $body .= $this->LE.$this->LE; $body .= $this->TextLine("--" . $this->boundary[1]); $body .= $this->HeaderLine('Content-Type', 'multipart/related;'); $body .= $this->TextLine("\tboundary=\"" . $this->boundary[2] . '"'); $body .= $this->LE; $body .= $this->GetBoundary($this->boundary[2], '', 'text/html', ''); $body .= $this->EncodeString($this->Body, $this->Encoding); $body .= $this->LE.$this->LE; $body .= $this->AttachAll("inline", $this->boundary[2]); $body .= $this->LE; $body .= $this->EndBoundary($this->boundary[1]); break; case 'alt_attach': $body .= $this->TextLine("--" . $this->boundary[1]); $body .= $this->HeaderLine('Content-Type', 'multipart/alternative;'); $body .= $this->TextLine("\tboundary=\"" . $this->boundary[2] . '"'); $body .= $this->LE; $body .= $this->GetBoundary($this->boundary[2], '', 'text/plain', ''); $body .= $this->EncodeString($this->AltBody, $this->Encoding); $body .= $this->LE.$this->LE; $body .= $this->GetBoundary($this->boundary[2], '', 'text/html', ''); $body .= $this->EncodeString($this->Body, $this->Encoding); $body .= $this->LE.$this->LE; $body .= $this->EndBoundary($this->boundary[2]); $body .= $this->LE; $body .= $this->AttachAll("attachment", $this->boundary[1]); break; case 'alt_inline_attach': $body .= $this->TextLine("--" . $this->boundary[1]); $body .= $this->HeaderLine('Content-Type', 'multipart/alternative;'); $body .= $this->TextLine("\tboundary=\"" . $this->boundary[2] . '"'); $body .= $this->LE; $body .= $this->GetBoundary($this->boundary[2], '', 'text/plain', ''); $body .= $this->EncodeString($this->AltBody, $this->Encoding); $body .= $this->LE.$this->LE; $body .= $this->TextLine("--" . $this->boundary[2]); $body .= $this->HeaderLine('Content-Type', 'multipart/related;'); $body .= $this->TextLine("\tboundary=\"" . $this->boundary[3] . '"'); $body .= $this->LE; $body .= $this->GetBoundary($this->boundary[3], '', 'text/html', ''); $body .= $this->EncodeString($this->Body, $this->Encoding); $body .= $this->LE.$this->LE; $body .= $this->AttachAll("inline", $this->boundary[3]); $body .= $this->LE; $body .= $this->EndBoundary($this->boundary[2]); $body .= $this->LE; $body .= $this->AttachAll("attachment", $this->boundary[1]); break; } if ($this->IsError()) { $body = ''; } elseif ($this->sign_key_file) { try { $file = tempnam('', 'mail'); file_put_contents($file, $body); //TODO check this worked $signed = tempnam("", "signed"); if (@openssl_pkcs7_sign($file, $signed, "file://".$this->sign_cert_file, array("file://".$this->sign_key_file, $this->sign_key_pass), NULL)) { @unlink($file); $body = file_get_contents($signed); @unlink($signed); } else { @unlink($file); @unlink($signed); throw new phpmailerException($this->Lang("signing").openssl_error_string()); } } catch (phpmailerException $e) { $body = ''; if ($this->exceptions) { throw $e; } } } return $body; } /** * Returns the start of a message boundary. * @access protected * @return string */ protected function GetBoundary($boundary, $charSet, $contentType, $encoding) { $result = ''; if($charSet == '') { $charSet = $this->CharSet; } if($contentType == '') { $contentType = $this->ContentType; } if($encoding == '') { $encoding = $this->Encoding; } $result .= $this->TextLine('--' . $boundary); $result .= sprintf("Content-Type: %s; charset=\"%s\"", $contentType, $charSet); $result .= $this->LE; $result .= $this->HeaderLine('Content-Transfer-Encoding', $encoding); $result .= $this->LE; return $result; } /** * Returns the end of a message boundary. * @access protected * @return string */ protected function EndBoundary($boundary) { return $this->LE . '--' . $boundary . '--' . $this->LE; } /** * Sets the message type. * @access protected * @return void */ protected function SetMessageType() { $this->message_type = array(); if($this->AlternativeExists()) $this->message_type[] = "alt"; if($this->InlineImageExists()) $this->message_type[] = "inline"; if($this->AttachmentExists()) $this->message_type[] = "attach"; $this->message_type = implode("_", $this->message_type); if($this->message_type == "") $this->message_type = "plain"; } /** * Returns a formatted header line. * @access public * @return string */ public function HeaderLine($name, $value) { return $name . ': ' . $value . $this->LE; } /** * Returns a formatted mail line. * @access public * @return string */ public function TextLine($value) { return $value . $this->LE; } ///////////////////////////////////////////////// // CLASS METHODS, ATTACHMENTS ///////////////////////////////////////////////// /** * Adds an attachment from a path on the filesystem. * Returns false if the file could not be found * or accessed. * @param string $path Path to the attachment. * @param string $name Overrides the attachment name. * @param string $encoding File encoding (see $Encoding). * @param string $type File extension (MIME) type. * @return bool */ public function AddAttachment($path, $name = '', $encoding = 'base64', $type = 'application/octet-stream') { try { if ( !@is_file($path) ) { throw new phpmailerException($this->Lang('file_access') . $path, self::STOP_CONTINUE); } $filename = basename($path); if ( $name == '' ) { $name = $filename; } $this->attachment[] = array( 0 => $path, 1 => $filename, 2 => $name, 3 => $encoding, 4 => $type, 5 => false, // isStringAttachment 6 => 'attachment', 7 => 0 ); } catch (phpmailerException $e) { $this->SetError($e->getMessage()); if ($this->exceptions) { throw $e; } if ($this->SMTPDebug) { echo $e->getMessage()."\n"; } if ( $e->getCode() == self::STOP_CRITICAL ) { return false; } } return true; } /** * Return the current array of attachments * @return array */ public function GetAttachments() { return $this->attachment; } /** * Attaches all fs, string, and binary attachments to the message. * Returns an empty string on failure. * @access protected * @return string */ protected function AttachAll($disposition_type, $boundary) { // Return text of body $mime = array(); $cidUniq = array(); $incl = array(); // Add all attachments foreach ($this->attachment as $attachment) { // CHECK IF IT IS A VALID DISPOSITION_FILTER if($attachment[6] == $disposition_type) { // Check for string attachment $bString = $attachment[5]; if ($bString) { $string = $attachment[0]; } else { $path = $attachment[0]; } $inclhash = md5(serialize($attachment)); if (in_array($inclhash, $incl)) { continue; } $incl[] = $inclhash; $filename = $attachment[1]; $name = $attachment[2]; $encoding = $attachment[3]; $type = $attachment[4]; $disposition = $attachment[6]; $cid = $attachment[7]; if ( $disposition == 'inline' && isset($cidUniq[$cid]) ) { continue; } $cidUniq[$cid] = true; $mime[] = sprintf("--%s%s", $boundary, $this->LE); $mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $this->EncodeHeader($this->SecureHeader($name)), $this->LE); $mime[] = sprintf("Content-Transfer-Encoding: %s%s", $encoding, $this->LE); if($disposition == 'inline') { $mime[] = sprintf("Content-ID: <%s>%s", $cid, $this->LE); } $mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s", $disposition, $this->EncodeHeader($this->SecureHeader($name)), $this->LE.$this->LE); // Encode as string attachment if($bString) { $mime[] = $this->EncodeString($string, $encoding); if($this->IsError()) { return ''; } $mime[] = $this->LE.$this->LE; } else { $mime[] = $this->EncodeFile($path, $encoding); if($this->IsError()) { return ''; } $mime[] = $this->LE.$this->LE; } } } $mime[] = sprintf("--%s--%s", $boundary, $this->LE); return implode("", $mime); } /** * Encodes attachment in requested format. * Returns an empty string on failure. * @param string $path The full path to the file * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' * @see EncodeFile() * @access protected * @return string */ protected function EncodeFile($path, $encoding = 'base64') { try { if (!is_readable($path)) { throw new phpmailerException($this->Lang('file_open') . $path, self::STOP_CONTINUE); } if (function_exists('get_magic_quotes')) { function get_magic_quotes() { return false; } } $magic_quotes = get_magic_quotes_runtime(); if ($magic_quotes) { if (version_compare(PHP_VERSION, '5.3.0', '<')) { set_magic_quotes_runtime(0); } else { ini_set('magic_quotes_runtime', 0); } } $file_buffer = file_get_contents($path); $file_buffer = $this->EncodeString($file_buffer, $encoding); if ($magic_quotes) { if (version_compare(PHP_VERSION, '5.3.0', '<')) { set_magic_quotes_runtime($magic_quotes); } else { ini_set('magic_quotes_runtime', $magic_quotes); } } return $file_buffer; } catch (Exception $e) { $this->SetError($e->getMessage()); return ''; } } /** * Encodes string to requested format. * Returns an empty string on failure. * @param string $str The text to encode * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' * @access public * @return string */ public function EncodeString($str, $encoding = 'base64') { $encoded = ''; switch(strtolower($encoding)) { case 'base64': $encoded = chunk_split(base64_encode($str), 76, $this->LE); break; case '7bit': case '8bit': $encoded = $this->FixEOL($str); //Make sure it ends with a line break if (substr($encoded, -(strlen($this->LE))) != $this->LE) $encoded .= $this->LE; break; case 'binary': $encoded = $str; break; case 'quoted-printable': $encoded = $this->EncodeQP($str); break; default: $this->SetError($this->Lang('encoding') . $encoding); break; } return $encoded; } /** * Encode a header string to best (shortest) of Q, B, quoted or none. * @access public * @return string */ public function EncodeHeader($str, $position = 'text') { $x = 0; switch (strtolower($position)) { case 'phrase': if (!preg_match('/[\200-\377]/', $str)) { // Can't use addslashes as we don't know what value has magic_quotes_sybase $encoded = addcslashes($str, "\0..\37\177\\\""); if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) { return ($encoded); } else { return ("\"$encoded\""); } } $x = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches); break; case 'comment': $x = preg_match_all('/[()"]/', $str, $matches); // Fall-through case 'text': default: $x += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches); break; } if ($x == 0) { return ($str); } $maxlen = 75 - 7 - strlen($this->CharSet); // Try to select the encoding which should produce the shortest output if (strlen($str)/3 < $x) { $encoding = 'B'; if (function_exists('mb_strlen') && $this->HasMultiBytes($str)) { // Use a custom function which correctly encodes and wraps long // multibyte strings without breaking lines within a character $encoded = $this->Base64EncodeWrapMB($str); } else { $encoded = base64_encode($str); $maxlen -= $maxlen % 4; $encoded = trim(chunk_split($encoded, $maxlen, "\n")); } } else { $encoding = 'Q'; $encoded = $this->EncodeQ($str, $position); $encoded = $this->WrapText($encoded, $maxlen, true); $encoded = str_replace('='.$this->LE, "\n", trim($encoded)); } $encoded = preg_replace('/^(.*)$/m', " =?".$this->CharSet."?$encoding?\\1?=", $encoded); $encoded = trim(str_replace("\n", $this->LE, $encoded)); return $encoded; } /** * Checks if a string contains multibyte characters. * @access public * @param string $str multi-byte text to wrap encode * @return bool */ public function HasMultiBytes($str) { if (function_exists('mb_strlen')) { return (strlen($str) > mb_strlen($str, $this->CharSet)); } else { // Assume no multibytes (we can't handle without mbstring functions anyway) return false; } } /** * Correctly encodes and wraps long multibyte strings for mail headers * without breaking lines within a character. * Adapted from a function by paravoid at http://uk.php.net/manual/en/function.mb-encode-mimeheader.php * @access public * @param string $str multi-byte text to wrap encode * @return string */ public function Base64EncodeWrapMB($str) { $start = "=?".$this->CharSet."?B?"; $end = "?="; $encoded = ""; $mb_length = mb_strlen($str, $this->CharSet); // Each line must have length <= 75, including $start and $end $length = 75 - strlen($start) - strlen($end); // Average multi-byte ratio $ratio = $mb_length / strlen($str); // Base64 has a 4:3 ratio $offset = $avgLength = floor($length * $ratio * .75); for ($i = 0; $i < $mb_length; $i += $offset) { $lookBack = 0; do { $offset = $avgLength - $lookBack; $chunk = mb_substr($str, $i, $offset, $this->CharSet); $chunk = base64_encode($chunk); $lookBack++; } while (strlen($chunk) > $length); $encoded .= $chunk . $this->LE; } // Chomp the last linefeed $encoded = substr($encoded, 0, -strlen($this->LE)); return $encoded; } /** * Encode string to quoted-printable. * Only uses standard PHP, slow, but will always work * @access public * @param string $string the text to encode * @param integer $line_max Number of chars allowed on a line before wrapping * @return string */ public function EncodeQPphp( $input = '', $line_max = 76, $space_conv = false) { $hex = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'); $lines = preg_split('/(?:\r\n|\r|\n)/', $input); $eol = "\r\n"; $escape = '='; $output = ''; while( list(, $line) = each($lines) ) { $linlen = strlen($line); $newline = ''; for($i = 0; $i < $linlen; $i++) { $c = substr( $line, $i, 1 ); $dec = ord( $c ); if ( ( $i == 0 ) && ( $dec == 46 ) ) { // convert first point in the line into =2E $c = '=2E'; } if ( $dec == 32 ) { if ( $i == ( $linlen - 1 ) ) { // convert space at eol only $c = '=20'; } else if ( $space_conv ) { $c = '=20'; } } elseif ( ($dec == 61) || ($dec < 32 ) || ($dec > 126) ) { // always encode "\t", which is *not* required $h2 = floor($dec/16); $h1 = floor($dec%16); $c = $escape.$hex[$h2].$hex[$h1]; } if ( (strlen($newline) + strlen($c)) >= $line_max ) { // CRLF is not counted $output .= $newline.$escape.$eol; // soft line break; " =\r\n" is okay $newline = ''; // check if newline first character will be point or not if ( $dec == 46 ) { $c = '=2E'; } } $newline .= $c; } // end of for $output .= $newline.$eol; } // end of while return $output; } /** * Encode string to RFC2045 (6.7) quoted-printable format * Uses a PHP5 stream filter to do the encoding about 64x faster than the old version * Also results in same content as you started with after decoding * @see EncodeQPphp() * @access public * @param string $string the text to encode * @param integer $line_max Number of chars allowed on a line before wrapping * @param boolean $space_conv Dummy param for compatibility with existing EncodeQP function * @return string * @author Marcus Bointon */ public function EncodeQP($string, $line_max = 76, $space_conv = false) { if (function_exists('quoted_printable_encode')) { //Use native function if it's available (>= PHP5.3) return quoted_printable_encode($string); } $filters = stream_get_filters(); if (!in_array('convert.*', $filters)) { //Got convert stream filter? return $this->EncodeQPphp($string, $line_max, $space_conv); //Fall back to old implementation } $fp = fopen('php://temp/', 'r+'); $string = preg_replace('/\r\n?/', $this->LE, $string); //Normalise line breaks $params = array('line-length' => $line_max, 'line-break-chars' => $this->LE); $s = stream_filter_append($fp, 'convert.quoted-printable-encode', STREAM_FILTER_READ, $params); fputs($fp, $string); rewind($fp); $out = stream_get_contents($fp); stream_filter_remove($s); $out = preg_replace('/^\./m', '=2E', $out); //Encode . if it is first char on a line, workaround for bug in Exchange fclose($fp); return $out; } /** * Encode string to q encoding. * @link http://tools.ietf.org/html/rfc2047 * @param string $str the text to encode * @param string $position Where the text is going to be used, see the RFC for what that means * @access public * @return string */ public function EncodeQ($str, $position = 'text') { // There should not be any EOL in the string $encoded = preg_replace('/[\r\n]*/', '', $str); switch (strtolower($position)) { case 'phrase': $encoded = preg_replace("/([^A-Za-z0-9!*+\/ -])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded); break; case 'comment': $encoded = preg_replace("/([\(\)\"])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded); case 'text': default: // Replace every high ascii, control =, ? and _ characters //TODO using /e (equivalent to eval()) is probably not a good idea $encoded = preg_replace('/([\000-\011\013\014\016-\037\075\077\137\177-\377])/e', "'='.sprintf('%02X', ord(stripslashes('\\1')))", $encoded); break; } // Replace every spaces to _ (more readable than =20) $encoded = str_replace(' ', '_', $encoded); return $encoded; } /** * Adds a string or binary attachment (non-filesystem) to the list. * This method can be used to attach ascii or binary data, * such as a BLOB record from a database. * @param string $string String attachment data. * @param string $filename Name of the attachment. * @param string $encoding File encoding (see $Encoding). * @param string $type File extension (MIME) type. * @return void */ public function AddStringAttachment($string, $filename, $encoding = 'base64', $type = 'application/octet-stream') { // Append to $attachment array $this->attachment[] = array( 0 => $string, 1 => $filename, 2 => basename($filename), 3 => $encoding, 4 => $type, 5 => true, // isStringAttachment 6 => 'attachment', 7 => 0 ); } /** * Adds an embedded attachment. This can include images, sounds, and * just about any other document. Make sure to set the $type to an * image type. For JPEG images use "image/jpeg" and for GIF images * use "image/gif". * @param string $path Path to the attachment. * @param string $cid Content ID of the attachment. Use this to identify * the Id for accessing the image in an HTML form. * @param string $name Overrides the attachment name. * @param string $encoding File encoding (see $Encoding). * @param string $type File extension (MIME) type. * @return bool */ public function AddEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = 'application/octet-stream') { if ( !@is_file($path) ) { $this->SetError($this->Lang('file_access') . $path); return false; } $filename = basename($path); if ( $name == '' ) { $name = $filename; } // Append to $attachment array $this->attachment[] = array( 0 => $path, 1 => $filename, 2 => $name, 3 => $encoding, 4 => $type, 5 => false, // isStringAttachment 6 => 'inline', 7 => $cid ); return true; } public function AddStringEmbeddedImage($string, $cid, $filename = '', $encoding = 'base64', $type = 'application/octet-stream') { // Append to $attachment array $this->attachment[] = array( 0 => $string, 1 => $filename, 2 => basename($filename), 3 => $encoding, 4 => $type, 5 => true, // isStringAttachment 6 => 'inline', 7 => $cid ); } /** * Returns true if an inline attachment is present. * @access public * @return bool */ public function InlineImageExists() { foreach($this->attachment as $attachment) { if ($attachment[6] == 'inline') { return true; } } return false; } public function AttachmentExists() { foreach($this->attachment as $attachment) { if ($attachment[6] == 'attachment') { return true; } } return false; } public function AlternativeExists() { return strlen($this->AltBody)>0; } ///////////////////////////////////////////////// // CLASS METHODS, MESSAGE RESET ///////////////////////////////////////////////// /** * Clears all recipients assigned in the TO array. Returns void. * @return void */ public function ClearAddresses() { foreach($this->to as $to) { unset($this->all_recipients[strtolower($to[0])]); } $this->to = array(); } /** * Clears all recipients assigned in the CC array. Returns void. * @return void */ public function ClearCCs() { foreach($this->cc as $cc) { unset($this->all_recipients[strtolower($cc[0])]); } $this->cc = array(); } /** * Clears all recipients assigned in the BCC array. Returns void. * @return void */ public function ClearBCCs() { foreach($this->bcc as $bcc) { unset($this->all_recipients[strtolower($bcc[0])]); } $this->bcc = array(); } /** * Clears all recipients assigned in the ReplyTo array. Returns void. * @return void */ public function ClearReplyTos() { $this->ReplyTo = array(); } /** * Clears all recipients assigned in the TO, CC and BCC * array. Returns void. * @return void */ public function ClearAllRecipients() { $this->to = array(); $this->cc = array(); $this->bcc = array(); $this->all_recipients = array(); } /** * Clears all previously set filesystem, string, and binary * attachments. Returns void. * @return void */ public function ClearAttachments() { $this->attachment = array(); } /** * Clears all custom headers. Returns void. * @return void */ public function ClearCustomHeaders() { $this->CustomHeader = array(); } ///////////////////////////////////////////////// // CLASS METHODS, MISCELLANEOUS ///////////////////////////////////////////////// /** * Adds the error message to the error container. * @access protected * @return void */ protected function SetError($msg) { $this->error_count++; if ($this->Mailer == 'smtp' and !is_null($this->smtp)) { $lasterror = $this->smtp->getError(); if (!empty($lasterror) and array_key_exists('smtp_msg', $lasterror)) { $msg .= '

    ' . $this->Lang('smtp_error') . $lasterror['smtp_msg'] . "

    \n"; } } $this->ErrorInfo = $msg; } /** * Returns the proper RFC 822 formatted date. * @access public * @return string * @static */ public static function RFCDate() { $tz = date('Z'); $tzs = ($tz < 0) ? '-' : '+'; $tz = abs($tz); $tz = (int)($tz/3600)*100 + ($tz%3600)/60; $result = sprintf("%s %s%04d", date('D, j M Y H:i:s'), $tzs, $tz); return $result; } /** * Returns the server hostname or 'localhost.localdomain' if unknown. * @access protected * @return string */ protected function ServerHostname() { if (!empty($this->Hostname)) { $result = $this->Hostname; } elseif (isset($_SERVER['SERVER_NAME'])) { $result = $_SERVER['SERVER_NAME']; } else { $result = 'localhost.localdomain'; } return $result; } /** * Returns a message in the appropriate language. * @access protected * @return string */ protected function Lang($key) { if(count($this->language) < 1) { $this->SetLanguage('en'); // set the default language } if(isset($this->language[$key])) { return $this->language[$key]; } else { return 'Language string failed to load: ' . $key; } } /** * Returns true if an error occurred. * @access public * @return bool */ public function IsError() { return ($this->error_count > 0); } /** * Changes every end of line from CR or LF to CRLF. * @access public * @return string */ public function FixEOL($str) { $str = str_replace("\r\n", "\n", $str); $str = str_replace("\r", "\n", $str); $str = str_replace("\n", $this->LE, $str); return $str; } /** * Adds a custom header. * @access public * @return void */ public function AddCustomHeader($custom_header) { $this->CustomHeader[] = explode(':', $custom_header, 2); } /** * Evaluates the message and returns modifications for inline images and backgrounds * @access public * @return $message */ public function MsgHTML($message, $basedir = '') { preg_match_all("/(src|background)=[\"'](.*)[\"']/Ui", $message, $images); if(isset($images[2])) { foreach($images[2] as $i => $url) { // do not change urls for absolute images (thanks to corvuscorax) if (!preg_match('#^[A-z]+://#', $url)) { $filename = basename($url); $directory = dirname($url); ($directory == '.') ? $directory='': ''; $cid = 'cid:' . md5($filename); $ext = pathinfo($filename, PATHINFO_EXTENSION); $mimeType = self::_mime_types($ext); if ( strlen($basedir) > 1 && substr($basedir, -1) != '/') { $basedir .= '/'; } if ( strlen($directory) > 1 && substr($directory, -1) != '/') { $directory .= '/'; } if ( $this->AddEmbeddedImage($basedir.$directory.$filename, md5($filename), $filename, 'base64', $mimeType) ) { $message = preg_replace("/".$images[1][$i]."=[\"']".preg_quote($url, '/')."[\"']/Ui", $images[1][$i]."=\"".$cid."\"", $message); } } } } $this->IsHTML(true); $this->Body = $message; if (empty($this->AltBody)) { $textMsg = trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/s', '', $message))); if (!empty($textMsg)) { $this->AltBody = html_entity_decode($textMsg, ENT_QUOTES, $this->CharSet); } } if (empty($this->AltBody)) { $this->AltBody = 'To view this email message, open it in a program that understands HTML!' . "\n\n"; } return $message; } /** * Gets the MIME type of the embedded or inline image * @param string File extension * @access public * @return string MIME type of ext * @static */ public static function _mime_types($ext = '') { $mimes = array( 'hqx' => 'application/mac-binhex40', 'cpt' => 'application/mac-compactpro', 'doc' => 'application/msword', 'bin' => 'application/macbinary', 'dms' => 'application/octet-stream', 'lha' => 'application/octet-stream', 'lzh' => 'application/octet-stream', 'exe' => 'application/octet-stream', 'class' => 'application/octet-stream', 'psd' => 'application/octet-stream', 'so' => 'application/octet-stream', 'sea' => 'application/octet-stream', 'dll' => 'application/octet-stream', 'oda' => 'application/oda', 'pdf' => 'application/pdf', 'ai' => 'application/postscript', 'eps' => 'application/postscript', 'ps' => 'application/postscript', 'smi' => 'application/smil', 'smil' => 'application/smil', 'mif' => 'application/vnd.mif', 'xls' => 'application/vnd.ms-excel', 'ppt' => 'application/vnd.ms-powerpoint', 'wbxml' => 'application/vnd.wap.wbxml', 'wmlc' => 'application/vnd.wap.wmlc', 'dcr' => 'application/x-director', 'dir' => 'application/x-director', 'dxr' => 'application/x-director', 'dvi' => 'application/x-dvi', 'gtar' => 'application/x-gtar', 'php' => 'application/x-httpd-php', 'php4' => 'application/x-httpd-php', 'php3' => 'application/x-httpd-php', 'phtml' => 'application/x-httpd-php', 'phps' => 'application/x-httpd-php-source', 'js' => 'application/x-javascript', 'swf' => 'application/x-shockwave-flash', 'sit' => 'application/x-stuffit', 'tar' => 'application/x-tar', 'tgz' => 'application/x-tar', 'xhtml' => 'application/xhtml+xml', 'xht' => 'application/xhtml+xml', 'zip' => 'application/zip', 'mid' => 'audio/midi', 'midi' => 'audio/midi', 'mpga' => 'audio/mpeg', 'mp2' => 'audio/mpeg', 'mp3' => 'audio/mpeg', 'aif' => 'audio/x-aiff', 'aiff' => 'audio/x-aiff', 'aifc' => 'audio/x-aiff', 'ram' => 'audio/x-pn-realaudio', 'rm' => 'audio/x-pn-realaudio', 'rpm' => 'audio/x-pn-realaudio-plugin', 'ra' => 'audio/x-realaudio', 'rv' => 'video/vnd.rn-realvideo', 'wav' => 'audio/x-wav', 'bmp' => 'image/bmp', 'gif' => 'image/gif', 'jpeg' => 'image/jpeg', 'jpg' => 'image/jpeg', 'jpe' => 'image/jpeg', 'png' => 'image/png', 'tiff' => 'image/tiff', 'tif' => 'image/tiff', 'css' => 'text/css', 'html' => 'text/html', 'htm' => 'text/html', 'shtml' => 'text/html', 'txt' => 'text/plain', 'text' => 'text/plain', 'log' => 'text/plain', 'rtx' => 'text/richtext', 'rtf' => 'text/rtf', 'xml' => 'text/xml', 'xsl' => 'text/xml', 'mpeg' => 'video/mpeg', 'mpg' => 'video/mpeg', 'mpe' => 'video/mpeg', 'qt' => 'video/quicktime', 'mov' => 'video/quicktime', 'avi' => 'video/x-msvideo', 'movie' => 'video/x-sgi-movie', 'doc' => 'application/msword', 'word' => 'application/msword', 'xl' => 'application/excel', 'eml' => 'message/rfc822' ); return (!isset($mimes[strtolower($ext)])) ? 'application/octet-stream' : $mimes[strtolower($ext)]; } /** * Set (or reset) Class Objects (variables) * * Usage Example: * $page->set('X-Priority', '3'); * * @access public * @param string $name Parameter Name * @param mixed $value Parameter Value * NOTE: will not work with arrays, there are no arrays to set/reset * @todo Should this not be using __set() magic function? */ public function set($name, $value = '') { try { if (isset($this->$name) ) { $this->$name = $value; } else { throw new phpmailerException($this->Lang('variable_set') . $name, self::STOP_CRITICAL); } } catch (Exception $e) { $this->SetError($e->getMessage()); if ($e->getCode() == self::STOP_CRITICAL) { return false; } } return true; } /** * Strips newlines to prevent header injection. * @access public * @param string $str String * @return string */ public function SecureHeader($str) { $str = str_replace("\r", '', $str); $str = str_replace("\n", '', $str); return trim($str); } /** * Set the private key file and password to sign the message. * * @access public * @param string $key_filename Parameter File Name * @param string $key_pass Password for private key */ public function Sign($cert_filename, $key_filename, $key_pass) { $this->sign_cert_file = $cert_filename; $this->sign_key_file = $key_filename; $this->sign_key_pass = $key_pass; } /** * Set the private key file and password to sign the message. * * @access public * @param string $key_filename Parameter File Name * @param string $key_pass Password for private key */ public function DKIM_QP($txt) { $tmp = ''; $line = ''; for ($i = 0; $i < strlen($txt); $i++) { $ord = ord($txt[$i]); if ( ((0x21 <= $ord) && ($ord <= 0x3A)) || $ord == 0x3C || ((0x3E <= $ord) && ($ord <= 0x7E)) ) { $line .= $txt[$i]; } else { $line .= "=".sprintf("%02X", $ord); } } return $line; } /** * Generate DKIM signature * * @access public * @param string $s Header */ public function DKIM_Sign($s) { $privKeyStr = file_get_contents($this->DKIM_private); if ($this->DKIM_passphrase != '') { $privKey = openssl_pkey_get_private($privKeyStr, $this->DKIM_passphrase); } else { $privKey = $privKeyStr; } if (openssl_sign($s, $signature, $privKey)) { return base64_encode($signature); } } /** * Generate DKIM Canonicalization Header * * @access public * @param string $s Header */ public function DKIM_HeaderC($s) { $s = preg_replace("/\r\n\s+/", " ", $s); $lines = explode("\r\n", $s); foreach ($lines as $key => $line) { list($heading, $value) = explode(":", $line, 2); $heading = strtolower($heading); $value = preg_replace("/\s+/", " ", $value) ; // Compress useless spaces $lines[$key] = $heading.":".trim($value) ; // Don't forget to remove WSP around the value } $s = implode("\r\n", $lines); return $s; } /** * Generate DKIM Canonicalization Body * * @access public * @param string $body Message Body */ public function DKIM_BodyC($body) { if ($body == '') return "\r\n"; // stabilize line endings $body = str_replace("\r\n", "\n", $body); $body = str_replace("\n", "\r\n", $body); // END stabilize line endings while (substr($body, strlen($body) - 4, 4) == "\r\n\r\n") { $body = substr($body, 0, strlen($body) - 2); } return $body; } /** * Create the DKIM header, body, as new header * * @access public * @param string $headers_line Header lines * @param string $subject Subject * @param string $body Body */ public function DKIM_Add($headers_line, $subject, $body) { $DKIMsignatureType = 'rsa-sha1'; // Signature & hash algorithms $DKIMcanonicalization = 'relaxed/simple'; // Canonicalization of header/body $DKIMquery = 'dns/txt'; // Query method $DKIMtime = time() ; // Signature Timestamp = seconds since 00:00:00 - Jan 1, 1970 (UTC time zone) $subject_header = "Subject: $subject"; $headers = explode($this->LE, $headers_line); foreach($headers as $header) { if (strpos($header, 'From:') === 0) { $from_header = $header; } elseif (strpos($header, 'To:') === 0) { $to_header = $header; } } $from = str_replace('|', '=7C', $this->DKIM_QP($from_header)); $to = str_replace('|', '=7C', $this->DKIM_QP($to_header)); $subject = str_replace('|', '=7C', $this->DKIM_QP($subject_header)) ; // Copied header fields (dkim-quoted-printable $body = $this->DKIM_BodyC($body); $DKIMlen = strlen($body) ; // Length of body $DKIMb64 = base64_encode(pack("H*", sha1($body))) ; // Base64 of packed binary SHA-1 hash of body $ident = ($this->DKIM_identity == '')? '' : " i=" . $this->DKIM_identity . ";"; $dkimhdrs = "DKIM-Signature: v=1; a=" . $DKIMsignatureType . "; q=" . $DKIMquery . "; l=" . $DKIMlen . "; s=" . $this->DKIM_selector . ";\r\n". "\tt=" . $DKIMtime . "; c=" . $DKIMcanonicalization . ";\r\n". "\th=From:To:Subject;\r\n". "\td=" . $this->DKIM_domain . ";" . $ident . "\r\n". "\tz=$from\r\n". "\t|$to\r\n". "\t|$subject;\r\n". "\tbh=" . $DKIMb64 . ";\r\n". "\tb="; $toSign = $this->DKIM_HeaderC($from_header . "\r\n" . $to_header . "\r\n" . $subject_header . "\r\n" . $dkimhdrs); $signed = $this->DKIM_Sign($toSign); return "X-PHPMAILER-DKIM: phpmailer.worxware.com\r\n".$dkimhdrs.$signed."\r\n"; } protected function doCallback($isSent, $to, $cc, $bcc, $subject, $body) { if (!empty($this->action_function) && function_exists($this->action_function)) { $params = array($isSent, $to, $cc, $bcc, $subject, $body); call_user_func_array($this->action_function, $params); } } } class phpmailerException extends Exception { public function errorMessage() { $errorMsg = '' . $this->getMessage() . "
    \n"; return $errorMsg; } } ?> glpi-0.84.3+dfsg.1/lib/phpmailer/class.pop3.php000066400000000000000000000242211226600447100210470ustar00rootroot00000000000000pop_conn = 0; $this->connected = false; $this->error = null; } /** * Combination of public events - connect, login, disconnect * @access public * @param string $host * @param integer $port * @param integer $tval * @param string $username * @param string $password */ public function Authorise ($host, $port = false, $tval = false, $username, $password, $debug_level = 0) { $this->host = $host; // If no port value is passed, retrieve it if ($port == false) { $this->port = $this->POP3_PORT; } else { $this->port = $port; } // If no port value is passed, retrieve it if ($tval == false) { $this->tval = $this->POP3_TIMEOUT; } else { $this->tval = $tval; } $this->do_debug = $debug_level; $this->username = $username; $this->password = $password; // Refresh the error log $this->error = null; // Connect $result = $this->Connect($this->host, $this->port, $this->tval); if ($result) { $login_result = $this->Login($this->username, $this->password); if ($login_result) { $this->Disconnect(); return true; } } // We need to disconnect regardless if the login succeeded $this->Disconnect(); return false; } /** * Connect to the POP3 server * @access public * @param string $host * @param integer $port * @param integer $tval * @return boolean */ public function Connect ($host, $port = false, $tval = 30) { // Are we already connected? if ($this->connected) { return true; } /* On Windows this will raise a PHP Warning error if the hostname doesn't exist. Rather than supress it with @fsockopen, let's capture it cleanly instead */ set_error_handler(array(&$this, 'catchWarning')); // Connect to the POP3 server $this->pop_conn = fsockopen($host, // POP3 Host $port, // Port # $errno, // Error Number $errstr, // Error Message $tval); // Timeout (seconds) // Restore the error handler restore_error_handler(); // Does the Error Log now contain anything? if ($this->error && $this->do_debug >= 1) { $this->displayErrors(); } // Did we connect? if ($this->pop_conn == false) { // It would appear not... $this->error = array( 'error' => "Failed to connect to server $host on port $port", 'errno' => $errno, 'errstr' => $errstr ); if ($this->do_debug >= 1) { $this->displayErrors(); } return false; } // Increase the stream time-out // Check for PHP 4.3.0 or later if (version_compare(phpversion(), '5.0.0', 'ge')) { stream_set_timeout($this->pop_conn, $tval, 0); } else { // Does not work on Windows if (substr(PHP_OS, 0, 3) !== 'WIN') { socket_set_timeout($this->pop_conn, $tval, 0); } } // Get the POP3 server response $pop3_response = $this->getResponse(); // Check for the +OK if ($this->checkResponse($pop3_response)) { // The connection is established and the POP3 server is talking $this->connected = true; return true; } } /** * Login to the POP3 server (does not support APOP yet) * @access public * @param string $username * @param string $password * @return boolean */ public function Login ($username = '', $password = '') { if ($this->connected == false) { $this->error = 'Not connected to POP3 server'; if ($this->do_debug >= 1) { $this->displayErrors(); } } if (empty($username)) { $username = $this->username; } if (empty($password)) { $password = $this->password; } $pop_username = "USER $username" . $this->CRLF; $pop_password = "PASS $password" . $this->CRLF; // Send the Username $this->sendString($pop_username); $pop3_response = $this->getResponse(); if ($this->checkResponse($pop3_response)) { // Send the Password $this->sendString($pop_password); $pop3_response = $this->getResponse(); if ($this->checkResponse($pop3_response)) { return true; } else { return false; } } else { return false; } } /** * Disconnect from the POP3 server * @access public */ public function Disconnect () { $this->sendString('QUIT'); fclose($this->pop_conn); } ///////////////////////////////////////////////// // Private Methods ///////////////////////////////////////////////// /** * Get the socket response back. * $size is the maximum number of bytes to retrieve * @access private * @param integer $size * @return string */ private function getResponse ($size = 128) { $pop3_response = fgets($this->pop_conn, $size); return $pop3_response; } /** * Send a string down the open socket connection to the POP3 server * @access private * @param string $string * @return integer */ private function sendString ($string) { $bytes_sent = fwrite($this->pop_conn, $string, strlen($string)); return $bytes_sent; } /** * Checks the POP3 server response for +OK or -ERR * @access private * @param string $string * @return boolean */ private function checkResponse ($string) { if (substr($string, 0, 3) !== '+OK') { $this->error = array( 'error' => "Server reported an error: $string", 'errno' => 0, 'errstr' => '' ); if ($this->do_debug >= 1) { $this->displayErrors(); } return false; } else { return true; } } /** * If debug is enabled, display the error message array * @access private */ private function displayErrors () { echo '
    ';
    
        foreach ($this->error as $single_error) {
          print_r($single_error);
        }
    
        echo '
    '; } /** * Takes over from PHP for the socket warning handler * @access private * @param integer $errno * @param string $errstr * @param string $errfile * @param integer $errline */ private function catchWarning ($errno, $errstr, $errfile, $errline) { $this->error[] = array( 'error' => "Connecting to the POP3 server raised a PHP warning: ", 'errno' => $errno, 'errstr' => $errstr ); } // End of class } ?> glpi-0.84.3+dfsg.1/lib/phpmailer/class.smtp.php000066400000000000000000000600521226600447100211530ustar00rootroot00000000000000smtp_conn = 0; $this->error = null; $this->helo_rply = null; $this->do_debug = 0; } ///////////////////////////////////////////////// // CONNECTION FUNCTIONS ///////////////////////////////////////////////// /** * Connect to the server specified on the port specified. * If the port is not specified use the default SMTP_PORT. * If tval is specified then a connection will try and be * established with the server for that number of seconds. * If tval is not specified the default is 30 seconds to * try on the connection. * * SMTP CODE SUCCESS: 220 * SMTP CODE FAILURE: 421 * @access public * @return bool */ public function Connect($host, $port = 0, $tval = 30) { // set the error val to null so there is no confusion $this->error = null; // make sure we are __not__ connected if($this->connected()) { // already connected, generate error $this->error = array("error" => "Already connected to a server"); return false; } if(empty($port)) { $port = $this->SMTP_PORT; } // connect to the smtp server $this->smtp_conn = @fsockopen($host, // the host of the server $port, // the port to use $errno, // error number if any $errstr, // error message if any $tval); // give up after ? secs // verify we connected properly if(empty($this->smtp_conn)) { $this->error = array("error" => "Failed to connect to server", "errno" => $errno, "errstr" => $errstr); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": $errstr ($errno)" . $this->CRLF . '
    '; } return false; } // SMTP server can take longer to respond, give longer timeout for first read // Windows does not have support for this timeout function if(substr(PHP_OS, 0, 3) != "WIN") socket_set_timeout($this->smtp_conn, $tval, 0); // get any announcement $announce = $this->get_lines(); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $announce . $this->CRLF . '
    '; } return true; } /** * Initiate a TLS communication with the server. * * SMTP CODE 220 Ready to start TLS * SMTP CODE 501 Syntax error (no parameters allowed) * SMTP CODE 454 TLS not available due to temporary reason * @access public * @return bool success */ public function StartTLS() { $this->error = null; # to avoid confusion if(!$this->connected()) { $this->error = array("error" => "Called StartTLS() without being connected"); return false; } fputs($this->smtp_conn,"STARTTLS" . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
    '; } if($code != 220) { $this->error = array("error" => "STARTTLS not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; } return false; } // Begin encrypted connection if(!stream_socket_enable_crypto($this->smtp_conn, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) { return false; } return true; } /** * Performs SMTP authentication. Must be run after running the * Hello() method. Returns true if successfully authenticated. * @access public * @return bool */ public function Authenticate($username, $password) { // Start authentication fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($code != 334) { $this->error = array("error" => "AUTH not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; } return false; } // Send encoded username fputs($this->smtp_conn, base64_encode($username) . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($code != 334) { $this->error = array("error" => "Username not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; } return false; } // Send encoded password fputs($this->smtp_conn, base64_encode($password) . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($code != 235) { $this->error = array("error" => "Password not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; } return false; } return true; } /** * Returns true if connected to a server otherwise false * @access public * @return bool */ public function Connected() { if(!empty($this->smtp_conn)) { $sock_status = socket_get_status($this->smtp_conn); if($sock_status["eof"]) { // the socket is valid but we are not connected if($this->do_debug >= 1) { echo "SMTP -> NOTICE:" . $this->CRLF . "EOF caught while checking if connected"; } $this->Close(); return false; } return true; // everything looks good } return false; } /** * Closes the socket and cleans up the state of the class. * It is not considered good to use this function without * first trying to use QUIT. * @access public * @return void */ public function Close() { $this->error = null; // so there is no confusion $this->helo_rply = null; if(!empty($this->smtp_conn)) { // close the connection and cleanup fclose($this->smtp_conn); $this->smtp_conn = 0; } } ///////////////////////////////////////////////// // SMTP COMMANDS ///////////////////////////////////////////////// /** * Issues a data command and sends the msg_data to the server * finializing the mail transaction. $msg_data is the message * that is to be send with the headers. Each header needs to be * on a single line followed by a with the message headers * and the message body being seperated by and additional . * * Implements rfc 821: DATA * * SMTP CODE INTERMEDIATE: 354 * [data] * . * SMTP CODE SUCCESS: 250 * SMTP CODE FAILURE: 552,554,451,452 * SMTP CODE FAILURE: 451,554 * SMTP CODE ERROR : 500,501,503,421 * @access public * @return bool */ public function Data($msg_data) { $this->error = null; // so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called Data() without being connected"); return false; } fputs($this->smtp_conn,"DATA" . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
    '; } if($code != 354) { $this->error = array("error" => "DATA command not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; } return false; } /* the server is ready to accept data! * according to rfc 821 we should not send more than 1000 * including the CRLF * characters on a single line so we will break the data up * into lines by \r and/or \n then if needed we will break * each of those into smaller lines to fit within the limit. * in addition we will be looking for lines that start with * a period '.' and append and additional period '.' to that * line. NOTE: this does not count towards limit. */ // normalize the line breaks so we know the explode works $msg_data = str_replace("\r\n","\n",$msg_data); $msg_data = str_replace("\r","\n",$msg_data); $lines = explode("\n",$msg_data); /* we need to find a good way to determine is headers are * in the msg_data or if it is a straight msg body * currently I am assuming rfc 822 definitions of msg headers * and if the first field of the first line (':' sperated) * does not contain a space then it _should_ be a header * and we can process all lines before a blank "" line as * headers. */ $field = substr($lines[0],0,strpos($lines[0],":")); $in_headers = false; if(!empty($field) && !strstr($field," ")) { $in_headers = true; } $max_line_length = 998; // used below; set here for ease in change while(list(,$line) = @each($lines)) { $lines_out = null; if($line == "" && $in_headers) { $in_headers = false; } // ok we need to break this line up into several smaller lines while(strlen($line) > $max_line_length) { $pos = strrpos(substr($line,0,$max_line_length)," "); // Patch to fix DOS attack if(!$pos) { $pos = $max_line_length - 1; $lines_out[] = substr($line,0,$pos); $line = substr($line,$pos); } else { $lines_out[] = substr($line,0,$pos); $line = substr($line,$pos + 1); } /* if processing headers add a LWSP-char to the front of new line * rfc 822 on long msg headers */ if($in_headers) { $line = "\t" . $line; } } $lines_out[] = $line; // send the lines to the server while(list(,$line_out) = @each($lines_out)) { if(strlen($line_out) > 0) { if(substr($line_out, 0, 1) == ".") { $line_out = "." . $line_out; } } fputs($this->smtp_conn,$line_out . $this->CRLF); } } // message data has been sent fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
    '; } if($code != 250) { $this->error = array("error" => "DATA not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; } return false; } return true; } /** * Sends the HELO command to the smtp server. * This makes sure that we and the server are in * the same known state. * * Implements from rfc 821: HELO * * SMTP CODE SUCCESS: 250 * SMTP CODE ERROR : 500, 501, 504, 421 * @access public * @return bool */ public function Hello($host = '') { $this->error = null; // so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called Hello() without being connected"); return false; } // if hostname for HELO was not specified send default if(empty($host)) { // determine appropriate default to send to server $host = "localhost"; } // Send extended hello first (RFC 2821) if(!$this->SendHello("EHLO", $host)) { if(!$this->SendHello("HELO", $host)) { return false; } } return true; } /** * Sends a HELO/EHLO command. * @access private * @return bool */ private function SendHello($hello, $host) { fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER: " . $rply . $this->CRLF . '
    '; } if($code != 250) { $this->error = array("error" => $hello . " not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; } return false; } $this->helo_rply = $rply; return true; } /** * Starts a mail transaction from the email address specified in * $from. Returns true if successful or false otherwise. If True * the mail transaction is started and then one or more Recipient * commands may be called followed by a Data command. * * Implements rfc 821: MAIL FROM: * * SMTP CODE SUCCESS: 250 * SMTP CODE SUCCESS: 552,451,452 * SMTP CODE SUCCESS: 500,501,421 * @access public * @return bool */ public function Mail($from) { $this->error = null; // so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called Mail() without being connected"); return false; } $useVerp = ($this->do_verp ? "XVERP" : ""); fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $useVerp . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
    '; } if($code != 250) { $this->error = array("error" => "MAIL not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; } return false; } return true; } /** * Sends the quit command to the server and then closes the socket * if there is no error or the $close_on_error argument is true. * * Implements from rfc 821: QUIT * * SMTP CODE SUCCESS: 221 * SMTP CODE ERROR : 500 * @access public * @return bool */ public function Quit($close_on_error = true) { $this->error = null; // so there is no confusion if(!$this->connected()) { $this->error = array( "error" => "Called Quit() without being connected"); return false; } // send the quit command to the server fputs($this->smtp_conn,"quit" . $this->CRLF); // get any good-bye messages $byemsg = $this->get_lines(); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $byemsg . $this->CRLF . '
    '; } $rval = true; $e = null; $code = substr($byemsg,0,3); if($code != 221) { // use e as a tmp var cause Close will overwrite $this->error $e = array("error" => "SMTP server rejected quit command", "smtp_code" => $code, "smtp_rply" => substr($byemsg,4)); $rval = false; if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $e["error"] . ": " . $byemsg . $this->CRLF . '
    '; } } if(empty($e) || $close_on_error) { $this->Close(); } return $rval; } /** * Sends the command RCPT to the SMTP server with the TO: argument of $to. * Returns true if the recipient was accepted false if it was rejected. * * Implements from rfc 821: RCPT TO: * * SMTP CODE SUCCESS: 250,251 * SMTP CODE FAILURE: 550,551,552,553,450,451,452 * SMTP CODE ERROR : 500,501,503,421 * @access public * @return bool */ public function Recipient($to) { $this->error = null; // so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called Recipient() without being connected"); return false; } fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
    '; } if($code != 250 && $code != 251) { $this->error = array("error" => "RCPT not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; } return false; } return true; } /** * Sends the RSET command to abort and transaction that is * currently in progress. Returns true if successful false * otherwise. * * Implements rfc 821: RSET * * SMTP CODE SUCCESS: 250 * SMTP CODE ERROR : 500,501,504,421 * @access public * @return bool */ public function Reset() { $this->error = null; // so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called Reset() without being connected"); return false; } fputs($this->smtp_conn,"RSET" . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
    '; } if($code != 250) { $this->error = array("error" => "RSET failed", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; } return false; } return true; } /** * Starts a mail transaction from the email address specified in * $from. Returns true if successful or false otherwise. If True * the mail transaction is started and then one or more Recipient * commands may be called followed by a Data command. This command * will send the message to the users terminal if they are logged * in and send them an email. * * Implements rfc 821: SAML FROM: * * SMTP CODE SUCCESS: 250 * SMTP CODE SUCCESS: 552,451,452 * SMTP CODE SUCCESS: 500,501,502,421 * @access public * @return bool */ public function SendAndMail($from) { $this->error = null; // so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called SendAndMail() without being connected"); return false; } fputs($this->smtp_conn,"SAML FROM:" . $from . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
    '; } if($code != 250) { $this->error = array("error" => "SAML not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; } return false; } return true; } /** * This is an optional command for SMTP that this class does not * support. This method is here to make the RFC821 Definition * complete for this class and __may__ be implimented in the future * * Implements from rfc 821: TURN * * SMTP CODE SUCCESS: 250 * SMTP CODE FAILURE: 502 * SMTP CODE ERROR : 500, 503 * @access public * @return bool */ public function Turn() { $this->error = array("error" => "This method, TURN, of the SMTP ". "is not implemented"); if($this->do_debug >= 1) { echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF . '
    '; } return false; } /** * Get the current error * @access public * @return array */ public function getError() { return $this->error; } ///////////////////////////////////////////////// // INTERNAL FUNCTIONS ///////////////////////////////////////////////// /** * Read in as many lines as possible * either before eof or socket timeout occurs on the operation. * With SMTP we can tell if we have more lines to read if the * 4th character is '-' symbol. If it is a space then we don't * need to read anything else. * @access private * @return string */ private function get_lines() { $data = ""; while(!feof($this->smtp_conn)) { $str = @fgets($this->smtp_conn,515); if($this->do_debug >= 4) { echo "SMTP -> get_lines(): \$data was \"$data\"" . $this->CRLF . '
    '; echo "SMTP -> get_lines(): \$str is \"$str\"" . $this->CRLF . '
    '; } $data .= $str; if($this->do_debug >= 4) { echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF . '
    '; } // if 4th character is a space, we are done reading, break the loop if(substr($str,3,1) == " ") { break; } } return $data; } } ?> glpi-0.84.3+dfsg.1/lib/phpmailer/extras/000077500000000000000000000000001226600447100176565ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/phpmailer/extras/htmlfilter.php000066400000000000000000000544101226600447100225450ustar00rootroot00000000000000 * @Version 1.1 ($Date: 2012-03-22 19:02:59 +0100 (jeu. 22 mars 2012) $) */ /** * @Author Jim Jagielski */ /** * This function returns the final tag out of the tag name, an array * of attributes, and the type of the tag. This function is called by * tln_sanitize internally. * * @param $tagname the name of the tag. * @param $attary the array of attributes and their values * @param $tagtype The type of the tag (see in comments). * @return a string with the final tag representation. */ function tln_tagprint($tagname, $attary, $tagtype){ $me = 'tln_tagprint'; if ($tagtype == 2){ $fulltag = ''; } else { $fulltag = '<' . $tagname; if (is_array($attary) && sizeof($attary)){ $atts = Array(); while (list($attname, $attvalue) = each($attary)){ array_push($atts, "$attname=$attvalue"); } $fulltag .= ' ' . join(' ', $atts); } if ($tagtype == 3){ $fulltag .= ' /'; } $fulltag .= '>'; } return $fulltag; } /** * A small helper function to use with array_walk. Modifies a by-ref * value and makes it lowercase. * * @param $val a value passed by-ref. * @return void since it modifies a by-ref value. */ function tln_casenormalize(&$val){ $val = strtolower($val); } /** * This function skips any whitespace from the current position within * a string and to the next non-whitespace value. * * @param $body the string * @param $offset the offset within the string where we should start * looking for the next non-whitespace character. * @return the location within the $body where the next * non-whitespace char is located. */ function tln_skipspace($body, $offset){ $me = 'tln_skipspace'; preg_match('/^(\s*)/s', substr($body, $offset), $matches); if (sizeof($matches[1])){ $count = strlen($matches[1]); $offset += $count; } return $offset; } /** * This function looks for the next character within a string. It's * really just a glorified "strpos", except it catches the failures * nicely. * * @param $body The string to look for needle in. * @param $offset Start looking from this position. * @param $needle The character/string to look for. * @return location of the next occurance of the needle, or * strlen($body) if needle wasn't found. */ function tln_findnxstr($body, $offset, $needle){ $me = 'tln_findnxstr'; $pos = strpos($body, $needle, $offset); if ($pos === FALSE){ $pos = strlen($body); } return $pos; } /** * This function takes a PCRE-style regexp and tries to match it * within the string. * * @param $body The string to look for needle in. * @param $offset Start looking from here. * @param $reg A PCRE-style regex to match. * @return Returns a false if no matches found, or an array * with the following members: * - integer with the location of the match within $body * - string with whatever content between offset and the match * - string with whatever it is we matched */ function tln_findnxreg($body, $offset, $reg){ $me = 'tln_findnxreg'; $matches = Array(); $retarr = Array(); $preg_rule = '%^(.*?)(' . $reg . ')%s'; preg_match($preg_rule, substr($body, $offset), $matches); if (!isset($matches[0])){ $retarr = false; } else { $retarr[0] = $offset + strlen($matches[1]); $retarr[1] = $matches[1]; $retarr[2] = $matches[2]; } return $retarr; } /** * This function looks for the next tag. * * @param $body String where to look for the next tag. * @param $offset Start looking from here. * @return false if no more tags exist in the body, or * an array with the following members: * - string with the name of the tag * - array with attributes and their values * - integer with tag type (1, 2, or 3) * - integer where the tag starts (starting "<") * - integer where the tag ends (ending ">") * first three members will be false, if the tag is invalid. */ function tln_getnxtag($body, $offset){ $me = 'tln_getnxtag'; if ($offset > strlen($body)){ return false; } $lt = tln_findnxstr($body, $offset, '<'); if ($lt == strlen($body)){ return false; } /** * We are here: * blah blah * \---------^ */ $pos = tln_skipspace($body, $lt + 1); if ($pos >= strlen($body)){ return Array(false, false, false, $lt, strlen($body)); } /** * There are 3 kinds of tags: * 1. Opening tag, e.g.: * * 2. Closing tag, e.g.: * * 3. XHTML-style content-less tag, e.g.: * */ $tagtype = false; switch (substr($body, $pos, 1)){ case '/': $tagtype = 2; $pos++; break; case '!': /** * A comment or an SGML declaration. */ if (substr($body, $pos+1, 2) == '--'){ $gt = strpos($body, '-->', $pos); if ($gt === false){ $gt = strlen($body); } else { $gt += 2; } return Array(false, false, false, $lt, $gt); } else { $gt = tln_findnxstr($body, $pos, '>'); return Array(false, false, false, $lt, $gt); } break; default: /** * Assume tagtype 1 for now. If it's type 3, we'll switch values * later. */ $tagtype = 1; break; } $tag_start = $pos; $tagname = ''; /** * Look for next [\W-_], which will indicate the end of the tag name. */ $regary = tln_findnxreg($body, $pos, '[^\w\-_]'); if ($regary == false){ return Array(false, false, false, $lt, strlen($body)); } list($pos, $tagname, $match) = $regary; $tagname = strtolower($tagname); /** * $match can be either of these: * '>' indicating the end of the tag entirely. * '\s' indicating the end of the tag name. * '/' indicating that this is type-3 xhtml tag. * * Whatever else we find there indicates an invalid tag. */ switch ($match){ case '/': /** * This is an xhtml-style tag with a closing / at the * end, like so: . Check if it's followed * by the closing bracket. If not, then this tag is invalid */ if (substr($body, $pos, 2) == '/>'){ $pos++; $tagtype = 3; } else { $gt = tln_findnxstr($body, $pos, '>'); $retary = Array(false, false, false, $lt, $gt); return $retary; } case '>': return Array($tagname, false, $tagtype, $lt, $pos); break; default: /** * Check if it's whitespace */ if (preg_match('/\s/', $match)){ } else { /** * This is an invalid tag! Look for the next closing ">". */ $gt = tln_findnxstr($body, $lt, '>'); return Array(false, false, false, $lt, $gt); } } /** * At this point we're here: * * \-------^ * * At this point we loop in order to find all attributes. */ $attname = ''; $atttype = false; $attary = Array(); while ($pos <= strlen($body)){ $pos = tln_skipspace($body, $pos); if ($pos == strlen($body)){ /** * Non-closed tag. */ return Array(false, false, false, $lt, $pos); } /** * See if we arrived at a ">" or "/>", which means that we reached * the end of the tag. */ $matches = Array(); preg_match('%^(\s*)(>|/>)%s', substr($body, $pos), $matches); if (isset($matches[0]) && $matches[0]){ /** * Yep. So we did. */ $pos += strlen($matches[1]); if ($matches[2] == '/>'){ $tagtype = 3; $pos++; } return Array($tagname, $attary, $tagtype, $lt, $pos); } /** * There are several types of attributes, with optional * [:space:] between members. * Type 1: * attrname[:space:]=[:space:]'CDATA' * Type 2: * attrname[:space:]=[:space:]"CDATA" * Type 3: * attr[:space:]=[:space:]CDATA * Type 4: * attrname * * We leave types 1 and 2 the same, type 3 we check for * '"' and convert to """ if needed, then wrap in * double quotes. Type 4 we convert into: * attrname="yes". */ $regary = tln_findnxreg($body, $pos, '[^\w\-_]'); if ($regary == false){ /** * Looks like body ended before the end of tag. */ return Array(false, false, false, $lt, strlen($body)); } list($pos, $attname, $match) = $regary; $attname = strtolower($attname); /** * We arrived at the end of attribute name. Several things possible * here: * '>' means the end of the tag and this is attribute type 4 * '/' if followed by '>' means the same thing as above * '\s' means a lot of things -- look what it's followed by. * anything else means the attribute is invalid. */ switch($match){ case '/': /** * This is an xhtml-style tag with a closing / at the * end, like so: . Check if it's followed * by the closing bracket. If not, then this tag is invalid */ if (substr($body, $pos, 2) == '/>'){ $pos++; $tagtype = 3; } else { $gt = tln_findnxstr($body, $pos, '>'); $retary = Array(false, false, false, $lt, $gt); return $retary; } case '>': $attary{$attname} = '"yes"'; return Array($tagname, $attary, $tagtype, $lt, $pos); break; default: /** * Skip whitespace and see what we arrive at. */ $pos = tln_skipspace($body, $pos); $char = substr($body, $pos, 1); /** * Two things are valid here: * '=' means this is attribute type 1 2 or 3. * \w means this was attribute type 4. * anything else we ignore and re-loop. End of tag and * invalid stuff will be caught by our checks at the beginning * of the loop. */ if ($char == '='){ $pos++; $pos = tln_skipspace($body, $pos); /** * Here are 3 possibilities: * "'" attribute type 1 * '"' attribute type 2 * everything else is the content of tag type 3 */ $quot = substr($body, $pos, 1); if ($quot == '\''){ $regary = tln_findnxreg($body, $pos+1, '\''); if ($regary == false){ return Array(false, false, false, $lt, strlen($body)); } list($pos, $attval, $match) = $regary; $pos++; $attary{$attname} = '\'' . $attval . '\''; } else if ($quot == '"'){ $regary = tln_findnxreg($body, $pos+1, '\"'); if ($regary == false){ return Array(false, false, false, $lt, strlen($body)); } list($pos, $attval, $match) = $regary; $pos++; $attary{$attname} = '"' . $attval . '"'; } else { /** * These are hateful. Look for \s, or >. */ $regary = tln_findnxreg($body, $pos, '[\s>]'); if ($regary == false){ return Array(false, false, false, $lt, strlen($body)); } list($pos, $attval, $match) = $regary; /** * If it's ">" it will be caught at the top. */ $attval = preg_replace('/\"/s', '"', $attval); $attary{$attname} = '"' . $attval . '"'; } } else if (preg_match('|[\w/>]|', $char)) { /** * That was attribute type 4. */ $attary{$attname} = '"yes"'; } else { /** * An illegal character. Find next '>' and return. */ $gt = tln_findnxstr($body, $pos, '>'); return Array(false, false, false, $lt, $gt); } } } /** * The fact that we got here indicates that the tag end was never * found. Return invalid tag indication so it gets stripped. */ return Array(false, false, false, $lt, strlen($body)); } /** * Translates entities into literal values so they can be checked. * * @param $attvalue the by-ref value to check. * @param $regex the regular expression to check against. * @param $hex whether the entites are hexadecimal. * @return True or False depending on whether there were matches. */ function tln_deent(&$attvalue, $regex, $hex=false){ $me = 'tln_deent'; $ret_match = false; preg_match_all($regex, $attvalue, $matches); if (is_array($matches) && sizeof($matches[0]) > 0){ $repl = Array(); for ($i = 0; $i < sizeof($matches[0]); $i++){ $numval = $matches[1][$i]; if ($hex){ $numval = hexdec($numval); } $repl{$matches[0][$i]} = chr($numval); } $attvalue = strtr($attvalue, $repl); return true; } else { return false; } } /** * This function checks attribute values for entity-encoded values * and returns them translated into 8-bit strings so we can run * checks on them. * * @param $attvalue A string to run entity check against. * @return Nothing, modifies a reference value. */ function tln_defang(&$attvalue){ $me = 'tln_defang'; /** * Skip this if there aren't ampersands or backslashes. */ if (strpos($attvalue, '&') === false && strpos($attvalue, '\\') === false){ return; } $m = false; do { $m = false; $m = $m || tln_deent($attvalue, '/\�*(\d+);*/s'); $m = $m || tln_deent($attvalue, '/\�*((\d|[a-f])+);*/si', true); $m = $m || tln_deent($attvalue, '/\\\\(\d+)/s', true); } while ($m == true); $attvalue = stripslashes($attvalue); } /** * Kill any tabs, newlines, or carriage returns. Our friends the * makers of the browser with 95% market value decided that it'd * be funny to make "java[tab]script" be just as good as "javascript". * * @param attvalue The attribute value before extraneous spaces removed. * @return attvalue Nothing, modifies a reference value. */ function tln_unspace(&$attvalue){ $me = 'tln_unspace'; if (strcspn($attvalue, "\t\r\n\0 ") != strlen($attvalue)){ $attvalue = str_replace(Array("\t", "\r", "\n", "\0", " "), Array('', '', '', '', ''), $attvalue); } } /** * This function runs various checks against the attributes. * * @param $tagname String with the name of the tag. * @param $attary Array with all tag attributes. * @param $rm_attnames See description for tln_sanitize * @param $bad_attvals See description for tln_sanitize * @param $add_attr_to_tag See description for tln_sanitize * @return Array with modified attributes. */ function tln_fixatts($tagname, $attary, $rm_attnames, $bad_attvals, $add_attr_to_tag ){ $me = 'tln_fixatts'; while (list($attname, $attvalue) = each($attary)){ /** * See if this attribute should be removed. */ foreach ($rm_attnames as $matchtag=>$matchattrs){ if (preg_match($matchtag, $tagname)){ foreach ($matchattrs as $matchattr){ if (preg_match($matchattr, $attname)){ unset($attary{$attname}); continue; } } } } /** * Remove any backslashes, entities, or extraneous whitespace. */ tln_defang($attvalue); tln_unspace($attvalue); /** * Now let's run checks on the attvalues. * I don't expect anyone to comprehend this. If you do, * get in touch with me so I can drive to where you live and * shake your hand personally. :) */ foreach ($bad_attvals as $matchtag=>$matchattrs){ if (preg_match($matchtag, $tagname)){ foreach ($matchattrs as $matchattr=>$valary){ if (preg_match($matchattr, $attname)){ /** * There are two arrays in valary. * First is matches. * Second one is replacements */ list($valmatch, $valrepl) = $valary; $newvalue = preg_replace($valmatch,$valrepl,$attvalue); if ($newvalue != $attvalue){ $attary{$attname} = $newvalue; } } } } } } /** * See if we need to append any attributes to this tag. */ foreach ($add_attr_to_tag as $matchtag=>$addattary){ if (preg_match($matchtag, $tagname)){ $attary = array_merge($attary, $addattary); } } return $attary; } /** * * @param $body the string with HTML you wish to filter * @param $tag_list see description above * @param $rm_tags_with_content see description above * @param $self_closing_tags see description above * @param $force_tag_closing see description above * @param $rm_attnames see description above * @param $bad_attvals see description above * @param $add_attr_to_tag see description above * @return tln_sanitized html safe to show on your pages. */ function tln_sanitize($body, $tag_list, $rm_tags_with_content, $self_closing_tags, $force_tag_closing, $rm_attnames, $bad_attvals, $add_attr_to_tag ) { $me = 'tln_sanitize'; /** * Normalize rm_tags and rm_tags_with_content. */ $rm_tags = array_shift($tag_list); @array_walk($tag_list, 'tln_casenormalize'); @array_walk($rm_tags_with_content, 'tln_casenormalize'); @array_walk($self_closing_tags, 'tln_casenormalize'); /** * See if tag_list is of tags to remove or tags to allow. * false means remove these tags * true means allow these tags */ $curpos = 0; $open_tags = Array(); $trusted = "\n"; $skip_content = false; /** * Take care of netscape's stupid javascript entities like * &{alert('boo')}; */ $body = preg_replace('/&(\{.*?\};)/si', '&\\1', $body); while (($curtag = tln_getnxtag($body, $curpos)) != FALSE){ list($tagname, $attary, $tagtype, $lt, $gt) = $curtag; $free_content = substr($body, $curpos, $lt - $curpos); if ($skip_content == false){ $trusted .= $free_content; } else { } if ($tagname != FALSE){ if ($tagtype == 2){ if ($skip_content == $tagname){ /** * Got to the end of tag we needed to remove. */ $tagname = false; $skip_content = false; } else { if ($skip_content == false){ if (isset($open_tags{$tagname}) && $open_tags{$tagname} > 0){ $open_tags{$tagname}--; } else { $tagname = false; } } else { } } } else { /** * $rm_tags_with_content */ if ($skip_content == false){ /** * See if this is a self-closing type and change * tagtype appropriately. */ if ($tagtype == 1 && in_array($tagname, $self_closing_tags)){ $tagtype = 3; } /** * See if we should skip this tag and any content * inside it. */ if ($tagtype == 1 && in_array($tagname, $rm_tags_with_content)){ $skip_content = $tagname; } else { if (($rm_tags == false && in_array($tagname, $tag_list)) || ($rm_tags == true && !in_array($tagname, $tag_list))){ $tagname = false; } else { if ($tagtype == 1){ if (isset($open_tags{$tagname})){ $open_tags{$tagname}++; } else { $open_tags{$tagname} = 1; } } /** * This is where we run other checks. */ if (is_array($attary) && sizeof($attary) > 0){ $attary = tln_fixatts($tagname, $attary, $rm_attnames, $bad_attvals, $add_attr_to_tag); } } } } else { } } if ($tagname != false && $skip_content == false){ $trusted .= tln_tagprint($tagname, $attary, $tagtype); } } else { } $curpos = $gt + 1; } $trusted .= substr($body, $curpos, strlen($body) - $curpos); if ($force_tag_closing == true){ foreach ($open_tags as $tagname=>$opentimes){ while ($opentimes > 0){ $trusted .= ''; $opentimes--; } } $trusted .= "\n"; } $trusted .= "\n"; return $trusted; } // // Use the nifty htmlfilter library // function HTMLFilter($body, $trans_image_path, $block_external_images = false) { $tag_list = Array( false, "object", "meta", "html", "head", "base", "link", "frame", "iframe", "plaintext", "marquee" ); $rm_tags_with_content = Array( "script", "applet", "embed", "title", "frameset", "xmp", "xml" ); $self_closing_tags = Array( "img", "br", "hr", "input", "outbind" ); $force_tag_closing = true; $rm_attnames = Array( "/.*/" => Array( // "/target/i", "/^on.*/i", "/^dynsrc/i", "/^data.*/i", "/^lowsrc.*/i" ) ); $bad_attvals = Array( "/.*/" => Array( "/^src|background/i" => Array( Array( "/^([\'\"])\s*\S+script\s*:.*([\'\"])/si", "/^([\'\"])\s*mocha\s*:*.*([\'\"])/si", "/^([\'\"])\s*about\s*:.*([\'\"])/si" ), Array( "\\1$trans_image_path\\2", "\\1$trans_image_path\\2", "\\1$trans_image_path\\2", "\\1$trans_image_path\\2" ) ), "/^href|action/i" => Array( Array( "/^([\'\"])\s*\S+script\s*:.*([\'\"])/si", "/^([\'\"])\s*mocha\s*:*.*([\'\"])/si", "/^([\'\"])\s*about\s*:.*([\'\"])/si" ), Array( "\\1#\\1", "\\1#\\1", "\\1#\\1", "\\1#\\1" ) ), "/^style/i" => Array( Array( "/expression/i", "/binding/i", "/behaviou*r/i", "/include-source/i", "/position\s*:\s*absolute/i", "/url\s*\(\s*([\'\"])\s*\S+script\s*:.*([\'\"])\s*\)/si", "/url\s*\(\s*([\'\"])\s*mocha\s*:.*([\'\"])\s*\)/si", "/url\s*\(\s*([\'\"])\s*about\s*:.*([\'\"])\s*\)/si", "/(.*)\s*:\s*url\s*\(\s*([\'\"]*)\s*\S+script\s*:.*([\'\"]*)\s*\)/si" ), Array( "idiocy", "idiocy", "idiocy", "idiocy", "", "url(\\1#\\1)", "url(\\1#\\1)", "url(\\1#\\1)", "url(\\1#\\1)", "url(\\1#\\1)", "\\1:url(\\2#\\3)" ) ) ) ); if ($block_external_images){ array_push($bad_attvals{'/.*/'}{'/^src|background/i'}[0], '/^([\'\"])\s*https*:.*([\'\"])/si'); array_push($bad_attvals{'/.*/'}{'/^src|background/i'}[1], "\\1$trans_image_path\\1"); array_push($bad_attvals{'/.*/'}{'/^style/i'}[0], '/url\(([\'\"])\s*https*:.*([\'\"])\)/si'); array_push($bad_attvals{'/.*/'}{'/^style/i'}[1], "url(\\1$trans_image_path\\1)"); } $add_attr_to_tag = Array( "/^a$/i" => Array('target'=>'"_blank"') ); $trusted = tln_sanitize($body, $tag_list, $rm_tags_with_content, $self_closing_tags, $force_tag_closing, $rm_attnames, $bad_attvals, $add_attr_to_tag ); return $trusted; } ?> glpi-0.84.3+dfsg.1/lib/phpmailer/language/000077500000000000000000000000001226600447100201335ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/phpmailer/language/phpmailer.lang-ar.php000066400000000000000000000034141226600447100241470ustar00rootroot00000000000000 */ $PHPMAILER_LANG['authenticate'] = 'SMTP Error: لم نستطع تأكيد الهوية.'; $PHPMAILER_LANG['connect_host'] = 'SMTP Error: لم نستطع الاتصال بمخدم SMTP.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: لم يتم قبول المعلومات .'; //$PHPMAILER_LANG['empty_message'] = 'Message body empty'; $PHPMAILER_LANG['encoding'] = 'ترميز غير معروف: '; $PHPMAILER_LANG['execute'] = 'لم أستطع تنفيذ : '; $PHPMAILER_LANG['file_access'] = 'لم نستطع الوصول للملف: '; $PHPMAILER_LANG['file_open'] = 'File Error: لم نستطع فتح الملف: '; $PHPMAILER_LANG['from_failed'] = 'البريد التالي لم نستطع ارسال البريد له : '; $PHPMAILER_LANG['instantiate'] = 'لم نستطع توفير خدمة البريد.'; //$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer غير مدعوم.'; //$PHPMAILER_LANG['provide_address'] = 'You must provide at least one recipient email address.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: الأخطاء التالية ' . 'فشل في الارسال لكل من : '; $PHPMAILER_LANG['signing'] = 'خطأ في التوقيع: '; //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; //$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; ?>glpi-0.84.3+dfsg.1/lib/phpmailer/language/phpmailer.lang-br.php000066400000000000000000000032311226600447100241450ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/phpmailer/language/phpmailer.lang-ca.php000066400000000000000000000031131226600447100241240ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/phpmailer/language/phpmailer.lang-ch.php000066400000000000000000000026541226600447100241440ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/phpmailer/language/phpmailer.lang-cz.php000066400000000000000000000030001226600447100241500ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/phpmailer/language/phpmailer.lang-de.php000066400000000000000000000032571226600447100241420ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/phpmailer/language/phpmailer.lang-dk.php000066400000000000000000000030171226600447100241420ustar00rootroot00000000000000 */ $PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Kunne ikke logge på.'; $PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Kunne ikke tilslutte SMTP serveren.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data kunne ikke accepteres.'; //$PHPMAILER_LANG['empty_message'] = 'Message body empty'; $PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: '; $PHPMAILER_LANG['execute'] = 'Kunne ikke køre: '; $PHPMAILER_LANG['file_access'] = 'Ingen adgang til fil: '; $PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke åbne filen: '; $PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: '; $PHPMAILER_LANG['instantiate'] = 'Kunne ikke initialisere email funktionen.'; //$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.'; $PHPMAILER_LANG['provide_address'] = 'Du skal indtaste mindst en modtagers emailadresse.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere er forkerte: '; //$PHPMAILER_LANG['signing'] = 'Signing Error: '; //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; //$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; ?>glpi-0.84.3+dfsg.1/lib/phpmailer/language/phpmailer.lang-es.php000066400000000000000000000030721226600447100241540ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/phpmailer/language/phpmailer.lang-et.php000066400000000000000000000030701226600447100241530ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/phpmailer/language/phpmailer.lang-fi.php000066400000000000000000000032031226600447100241370ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/phpmailer/language/phpmailer.lang-fo.php000066400000000000000000000031721226600447100241520ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/phpmailer/language/phpmailer.lang-fr.php000066400000000000000000000031001226600447100241440ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/phpmailer/language/phpmailer.lang-hu.php000066400000000000000000000030401226600447100241540ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/phpmailer/language/phpmailer.lang-it.php000066400000000000000000000032021226600447100241540ustar00rootroot00000000000000 */ $PHPMAILER_LANG['authenticate'] = 'SMTP Error: Impossibile autenticarsi.'; $PHPMAILER_LANG['connect_host'] = 'SMTP Error: Impossibile connettersi all\'host SMTP.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Data non accettati dal server.'; //$PHPMAILER_LANG['empty_message'] = 'Message body empty'; $PHPMAILER_LANG['encoding'] = 'Encoding set dei caratteri sconosciuto: '; $PHPMAILER_LANG['execute'] = 'Impossibile eseguire l\'operazione: '; $PHPMAILER_LANG['file_access'] = 'Impossibile accedere al file: '; $PHPMAILER_LANG['file_open'] = 'File Error: Impossibile aprire il file: '; $PHPMAILER_LANG['from_failed'] = 'I seguenti indirizzi mittenti hanno generato errore: '; $PHPMAILER_LANG['instantiate'] = 'Impossibile istanziare la funzione mail'; //$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['provide_address'] = 'Deve essere fornito almeno un indirizzo ricevente'; $PHPMAILER_LANG['mailer_not_supported'] = 'Mailer non supportato'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: I seguenti indirizzi destinatari hanno generato errore: '; //$PHPMAILER_LANG['signing'] = 'Signing Error: '; //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; //$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; ?>glpi-0.84.3+dfsg.1/lib/phpmailer/language/phpmailer.lang-ja.php000066400000000000000000000032511226600447100241360ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/phpmailer/language/phpmailer.lang-nl.php000066400000000000000000000027751226600447100241670ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/phpmailer/language/phpmailer.lang-no.php000066400000000000000000000027071226600447100241650ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/phpmailer/language/phpmailer.lang-pl.php000066400000000000000000000030151226600447100241550ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/phpmailer/language/phpmailer.lang-ro.php000066400000000000000000000031371226600447100241670ustar00rootroot00000000000000 */ $PHPMAILER_LANG['authenticate'] = 'Eroare SMTP: Nu a functionat autentificarea.'; $PHPMAILER_LANG['connect_host'] = 'Eroare SMTP: Nu m-am putut conecta la adresa SMTP.'; $PHPMAILER_LANG['data_not_accepted'] = 'Eroare SMTP: Continutul mailului nu a fost acceptat.'; //$PHPMAILER_LANG['empty_message'] = 'Message body empty'; $PHPMAILER_LANG['encoding'] = 'Encodare necunoscuta: '; $PHPMAILER_LANG['execute'] = 'Nu pot executa: '; $PHPMAILER_LANG['file_access'] = 'Nu pot accesa fisierul: '; $PHPMAILER_LANG['file_open'] = 'Eroare de fisier: Nu pot deschide fisierul: '; $PHPMAILER_LANG['from_failed'] = 'Urmatoarele adrese From au dat eroare: '; $PHPMAILER_LANG['instantiate'] = 'Nu am putut instantia functia mail.'; //$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer nu este suportat.'; $PHPMAILER_LANG['provide_address'] = 'Trebuie sa adaugati cel putin un recipient (adresa de mail).'; $PHPMAILER_LANG['recipients_failed'] = 'Eroare SMTP: Urmatoarele adrese de mail au dat eroare: '; //$PHPMAILER_LANG['signing'] = 'Signing Error: '; //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; //$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; ?>glpi-0.84.3+dfsg.1/lib/phpmailer/language/phpmailer.lang-ru.php000066400000000000000000000036251226600447100241770ustar00rootroot00000000000000 */ $PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: ошибка авторизации.'; $PHPMAILER_LANG['connect_host'] = 'Ошибка SMTP: не удается подключиться к серверу SMTP.'; $PHPMAILER_LANG['data_not_accepted'] = 'Ошибка SMTP: данные не приняты.'; //$PHPMAILER_LANG['empty_message'] = 'Message body empty'; $PHPMAILER_LANG['encoding'] = 'Неизвестный вид кодировки: '; $PHPMAILER_LANG['execute'] = 'Невозможно выполнить команду: '; $PHPMAILER_LANG['file_access'] = 'Нет доступа к файлу: '; $PHPMAILER_LANG['file_open'] = 'Файловая ошибка: не удается открыть файл: '; $PHPMAILER_LANG['from_failed'] = 'Неверный адрес отправителя: '; $PHPMAILER_LANG['instantiate'] = 'Невозможно запустить функцию mail.'; //$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['provide_address'] = 'Пожалуйста, введите хотя бы один адрес e-mail получателя.'; $PHPMAILER_LANG['mailer_not_supported'] = ' - почтовый сервер не поддерживается.'; $PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: отправка по следующим адресам получателей не удалась: '; //$PHPMAILER_LANG['signing'] = 'Signing Error: '; //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; //$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; ?>glpi-0.84.3+dfsg.1/lib/phpmailer/language/phpmailer.lang-se.php000066400000000000000000000027741226600447100241640ustar00rootroot00000000000000 */ $PHPMAILER_LANG['authenticate'] = 'SMTP fel: Kunde inte autentisera.'; $PHPMAILER_LANG['connect_host'] = 'SMTP fel: Kunde inte ansluta till SMTP-server.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP fel: Data accepterades inte.'; //$PHPMAILER_LANG['empty_message'] = 'Message body empty'; $PHPMAILER_LANG['encoding'] = 'Okänt encode-format: '; $PHPMAILER_LANG['execute'] = 'Kunde inte köra: '; $PHPMAILER_LANG['file_access'] = 'Ingen åtkomst till fil: '; $PHPMAILER_LANG['file_open'] = 'Fil fel: Kunde inte öppna fil: '; $PHPMAILER_LANG['from_failed'] = 'Följande avsändaradress är felaktig: '; $PHPMAILER_LANG['instantiate'] = 'Kunde inte initiera e-postfunktion.'; //$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['provide_address'] = 'Du måste ange minst en mottagares e-postadress.'; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP fel: Följande mottagare är felaktig: '; //$PHPMAILER_LANG['signing'] = 'Signing Error: '; //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; //$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; ?>glpi-0.84.3+dfsg.1/lib/phpmailer/language/phpmailer.lang-tr.php000066400000000000000000000031111226600447100241640ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/phpmailer/language/phpmailer.lang-zh.php000066400000000000000000000025661226600447100241750ustar00rootroot00000000000000 */ $PHPMAILER_LANG['authenticate'] = 'SMTP 錯誤:登錄失敗。'; $PHPMAILER_LANG['connect_host'] = 'SMTP 錯誤:無法連接到 SMTP 主機。'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP 錯誤:數據不被接受。'; //$PHPMAILER_LANG['empty_message'] = 'Message body empty'; $PHPMAILER_LANG['encoding'] = '未知編碼: '; $PHPMAILER_LANG['file_access'] = '無法訪問文件:'; $PHPMAILER_LANG['file_open'] = '文件錯誤:無法打開文件:'; $PHPMAILER_LANG['from_failed'] = '發送地址錯誤:'; $PHPMAILER_LANG['execute'] = '無法執行:'; $PHPMAILER_LANG['instantiate'] = '未知函數調用。'; //$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['provide_address'] = '必須提供至少一個收件人地址。'; $PHPMAILER_LANG['mailer_not_supported'] = '發信客戶端不被支持。'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP 錯誤:收件人地址錯誤:'; //$PHPMAILER_LANG['signing'] = 'Signing Error: '; //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; //$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; ?>glpi-0.84.3+dfsg.1/lib/phpmailer/language/phpmailer.lang-zh_cn.php000066400000000000000000000025671226600447100246560ustar00rootroot00000000000000 */ $PHPMAILER_LANG['authenticate'] = 'SMTP 错误:登录失败。'; $PHPMAILER_LANG['connect_host'] = 'SMTP 错误:无法连接到 SMTP 主机。'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误:数据不被接受。'; //$P$PHPMAILER_LANG['empty_message'] = 'Message body empty'; $PHPMAILER_LANG['encoding'] = '未知编码: '; $PHPMAILER_LANG['execute'] = '无法执行:'; $PHPMAILER_LANG['file_access'] = '无法访问文件:'; $PHPMAILER_LANG['file_open'] = '文件错误:无法打开文件:'; $PHPMAILER_LANG['from_failed'] = '发送地址错误:'; $PHPMAILER_LANG['instantiate'] = '未知函数调用。'; //$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['mailer_not_supported'] = '发信客户端不被支持。'; $PHPMAILER_LANG['provide_address'] = '必须提供至少一个收件人地址。'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误:收件人地址错误:'; //$PHPMAILER_LANG['signing'] = 'Signing Error: '; //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; //$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; ?>glpi-0.84.3+dfsg.1/lib/simplepie/000077500000000000000000000000001226600447100163565ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/simplepie/LICENSE.txt000066400000000000000000000030011226600447100201730ustar00rootroot00000000000000Copyright (c) 2004-2007, Ryan Parman and Geoffrey Sneddon. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the SimplePie Team nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.glpi-0.84.3+dfsg.1/lib/simplepie/README.markdown000066400000000000000000000075471226600447100210740ustar00rootroot00000000000000SimplePie ========= SimplePie is a very fast and easy-to-use class, written in PHP, that puts the 'simple' back into 'really simple syndication'. Flexible enough to suit beginners and veterans alike, SimplePie is focused on [speed, ease of use, compatibility and standards compliance][what_is]. [what_is]: http://simplepie.org/wiki/faq/what_is_simplepie Requirements ------------ * PHP 5.2.0 or newer * libxml2 (certain 2.7.x releases are too buggy for words, and will crash) * Either the iconv or mbstring extension * cURL or fsockopen() * PCRE support If you're looking for PHP 4.x support, pull the "one-dot-two" branch, as that's the last version to support PHP 4.x. What comes in the package? -------------------------- 1. `library/` - SimplePie classes for use with the autoloader 2. `autoloader.php` - The SimplePie Autoloader if you want to use the separate file version. 3. `README.markdown` - This document. 4. `LICENSE.txt` - A copy of the BSD license. 5. `compatibility_test/` - The SimplePie compatibility test that checks your server for required settings. 6. `demo/` - A basic feed reader demo that shows off some of SimplePie's more noticeable features. 7. `idn/` - A third-party library that SimplePie can optionally use to understand Internationalized Domain Names (IDNs). 8. `build/` - Scripts related to generating pieces of SimplePie 9. `test/` - SimplePie's unit test suite. ### Where's `simplepie.inc`? For SimplePie 1.3, we've split the classes into separate files to make it easier to maintain and use. If you'd like a single monolithic file, you can run `php build/compile.php` to generate `SimplePie.compiled.php`, or grab a copy from [dev.simplepie.org][dev_compiled] (this is kept up-to-date with the latest code from Git). [dev_compiled]: http://dev.simplepie.org/SimplePie.compiled.php To start the demo ----------------- 1. Upload this package to your webserver. 2. Make sure that the cache folder inside of the demo folder is server-writable. 3. Navigate your browser to the demo folder. Need support? ------------- For further setup and install documentation, function references, etc., visit [the wiki][wiki]. If you're using the latest version off GitHub, you can also check out the [API documentation][]. If you can't find an answer to your question in the documentation, head on over to one of our [support channels][]. For bug reports and feature requests, visit the [issue tracker][]. [API documentation]: http://dev.simplepie.org/api/ [wiki]: http://simplepie.org/wiki/ [support channels]: http://simplepie.org/support/ [issue tracker]: http://github.com/simplepie/simplepie/issues Project status -------------- SimplePie is currently maintained by Ryan McCue. As an open source project, SimplePie is maintained on a somewhat sporadic basis. This means that feature requests may not be fulfilled straight away, as time has to be prioritized. If you'd like to contribute to SimplePie, the best way to get started is to fork the project on GitHub and send pull requests for patches. When doing so, please be aware of our [coding standards][]. [coding standards]: http://simplepie.org/wiki/misc/coding_standards Authors and contributors ------------------------ ### Current * [Ryan McCue][] (Maintainer, support) ### Alumni * [Ryan Parman][] (Creator, developer, evangelism, support) * [Geoffrey Sneddon][] (Lead developer) * [Michael Shipley][] (Submitter of patches, support) * [Steve Minutillo][] (Submitter of patches) [Ryan McCue]: http://ryanmccue.info [Ryan Parman]: http://ryanparman.com [Geoffrey Sneddon]: http://gsnedders.com [Michael Shipley]: http://michaelpshipley.com [Steve Minutillo]: http://minutillo.com/steve/ ### Contributors For a complete list of contributors: 1. Pull down the latest SimplePie code 2. In the `simplepie` directory, run `git shortlog -ns` License ------- [New BSD license](http://www.opensource.org/licenses/BSD-3-Clause) glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie.php000066400000000000000000002540751226600447100207730ustar00rootroot00000000000000' . SIMPLEPIE_NAME . ''); /** * No Autodiscovery * @see SimplePie::set_autodiscovery_level() */ define('SIMPLEPIE_LOCATOR_NONE', 0); /** * Feed Link Element Autodiscovery * @see SimplePie::set_autodiscovery_level() */ define('SIMPLEPIE_LOCATOR_AUTODISCOVERY', 1); /** * Local Feed Extension Autodiscovery * @see SimplePie::set_autodiscovery_level() */ define('SIMPLEPIE_LOCATOR_LOCAL_EXTENSION', 2); /** * Local Feed Body Autodiscovery * @see SimplePie::set_autodiscovery_level() */ define('SIMPLEPIE_LOCATOR_LOCAL_BODY', 4); /** * Remote Feed Extension Autodiscovery * @see SimplePie::set_autodiscovery_level() */ define('SIMPLEPIE_LOCATOR_REMOTE_EXTENSION', 8); /** * Remote Feed Body Autodiscovery * @see SimplePie::set_autodiscovery_level() */ define('SIMPLEPIE_LOCATOR_REMOTE_BODY', 16); /** * All Feed Autodiscovery * @see SimplePie::set_autodiscovery_level() */ define('SIMPLEPIE_LOCATOR_ALL', 31); /** * No known feed type */ define('SIMPLEPIE_TYPE_NONE', 0); /** * RSS 0.90 */ define('SIMPLEPIE_TYPE_RSS_090', 1); /** * RSS 0.91 (Netscape) */ define('SIMPLEPIE_TYPE_RSS_091_NETSCAPE', 2); /** * RSS 0.91 (Userland) */ define('SIMPLEPIE_TYPE_RSS_091_USERLAND', 4); /** * RSS 0.91 (both Netscape and Userland) */ define('SIMPLEPIE_TYPE_RSS_091', 6); /** * RSS 0.92 */ define('SIMPLEPIE_TYPE_RSS_092', 8); /** * RSS 0.93 */ define('SIMPLEPIE_TYPE_RSS_093', 16); /** * RSS 0.94 */ define('SIMPLEPIE_TYPE_RSS_094', 32); /** * RSS 1.0 */ define('SIMPLEPIE_TYPE_RSS_10', 64); /** * RSS 2.0 */ define('SIMPLEPIE_TYPE_RSS_20', 128); /** * RDF-based RSS */ define('SIMPLEPIE_TYPE_RSS_RDF', 65); /** * Non-RDF-based RSS (truly intended as syndication format) */ define('SIMPLEPIE_TYPE_RSS_SYNDICATION', 190); /** * All RSS */ define('SIMPLEPIE_TYPE_RSS_ALL', 255); /** * Atom 0.3 */ define('SIMPLEPIE_TYPE_ATOM_03', 256); /** * Atom 1.0 */ define('SIMPLEPIE_TYPE_ATOM_10', 512); /** * All Atom */ define('SIMPLEPIE_TYPE_ATOM_ALL', 768); /** * All feed types */ define('SIMPLEPIE_TYPE_ALL', 1023); /** * No construct */ define('SIMPLEPIE_CONSTRUCT_NONE', 0); /** * Text construct */ define('SIMPLEPIE_CONSTRUCT_TEXT', 1); /** * HTML construct */ define('SIMPLEPIE_CONSTRUCT_HTML', 2); /** * XHTML construct */ define('SIMPLEPIE_CONSTRUCT_XHTML', 4); /** * base64-encoded construct */ define('SIMPLEPIE_CONSTRUCT_BASE64', 8); /** * IRI construct */ define('SIMPLEPIE_CONSTRUCT_IRI', 16); /** * A construct that might be HTML */ define('SIMPLEPIE_CONSTRUCT_MAYBE_HTML', 32); /** * All constructs */ define('SIMPLEPIE_CONSTRUCT_ALL', 63); /** * Don't change case */ define('SIMPLEPIE_SAME_CASE', 1); /** * Change to lowercase */ define('SIMPLEPIE_LOWERCASE', 2); /** * Change to uppercase */ define('SIMPLEPIE_UPPERCASE', 4); /** * PCRE for HTML attributes */ define('SIMPLEPIE_PCRE_HTML_ATTRIBUTE', '((?:[\x09\x0A\x0B\x0C\x0D\x20]+[^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3D\x3E]*(?:[\x09\x0A\x0B\x0C\x0D\x20]*=[\x09\x0A\x0B\x0C\x0D\x20]*(?:"(?:[^"]*)"|\'(?:[^\']*)\'|(?:[^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?)*)[\x09\x0A\x0B\x0C\x0D\x20]*'); /** * PCRE for XML attributes */ define('SIMPLEPIE_PCRE_XML_ATTRIBUTE', '((?:\s+(?:(?:[^\s:]+:)?[^\s:]+)\s*=\s*(?:"(?:[^"]*)"|\'(?:[^\']*)\'))*)\s*'); /** * XML Namespace */ define('SIMPLEPIE_NAMESPACE_XML', 'http://www.w3.org/XML/1998/namespace'); /** * Atom 1.0 Namespace */ define('SIMPLEPIE_NAMESPACE_ATOM_10', 'http://www.w3.org/2005/Atom'); /** * Atom 0.3 Namespace */ define('SIMPLEPIE_NAMESPACE_ATOM_03', 'http://purl.org/atom/ns#'); /** * RDF Namespace */ define('SIMPLEPIE_NAMESPACE_RDF', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'); /** * RSS 0.90 Namespace */ define('SIMPLEPIE_NAMESPACE_RSS_090', 'http://my.netscape.com/rdf/simple/0.9/'); /** * RSS 1.0 Namespace */ define('SIMPLEPIE_NAMESPACE_RSS_10', 'http://purl.org/rss/1.0/'); /** * RSS 1.0 Content Module Namespace */ define('SIMPLEPIE_NAMESPACE_RSS_10_MODULES_CONTENT', 'http://purl.org/rss/1.0/modules/content/'); /** * RSS 2.0 Namespace * (Stupid, I know, but I'm certain it will confuse people less with support.) */ define('SIMPLEPIE_NAMESPACE_RSS_20', ''); /** * DC 1.0 Namespace */ define('SIMPLEPIE_NAMESPACE_DC_10', 'http://purl.org/dc/elements/1.0/'); /** * DC 1.1 Namespace */ define('SIMPLEPIE_NAMESPACE_DC_11', 'http://purl.org/dc/elements/1.1/'); /** * W3C Basic Geo (WGS84 lat/long) Vocabulary Namespace */ define('SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO', 'http://www.w3.org/2003/01/geo/wgs84_pos#'); /** * GeoRSS Namespace */ define('SIMPLEPIE_NAMESPACE_GEORSS', 'http://www.georss.org/georss'); /** * Media RSS Namespace */ define('SIMPLEPIE_NAMESPACE_MEDIARSS', 'http://search.yahoo.com/mrss/'); /** * Wrong Media RSS Namespace. Caused by a long-standing typo in the spec. */ define('SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG', 'http://search.yahoo.com/mrss'); /** * Wrong Media RSS Namespace #2. New namespace introduced in Media RSS 1.5. */ define('SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG2', 'http://video.search.yahoo.com/mrss'); /** * Wrong Media RSS Namespace #3. A possible typo of the Media RSS 1.5 namespace. */ define('SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG3', 'http://video.search.yahoo.com/mrss/'); /** * Wrong Media RSS Namespace #4. New spec location after the RSS Advisory Board takes it over, but not a valid namespace. */ define('SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG4', 'http://www.rssboard.org/media-rss'); /** * Wrong Media RSS Namespace #5. A possible typo of the RSS Advisory Board URL. */ define('SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG5', 'http://www.rssboard.org/media-rss/'); /** * iTunes RSS Namespace */ define('SIMPLEPIE_NAMESPACE_ITUNES', 'http://www.itunes.com/dtds/podcast-1.0.dtd'); /** * XHTML Namespace */ define('SIMPLEPIE_NAMESPACE_XHTML', 'http://www.w3.org/1999/xhtml'); /** * IANA Link Relations Registry */ define('SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY', 'http://www.iana.org/assignments/relation/'); /** * No file source */ define('SIMPLEPIE_FILE_SOURCE_NONE', 0); /** * Remote file source */ define('SIMPLEPIE_FILE_SOURCE_REMOTE', 1); /** * Local file source */ define('SIMPLEPIE_FILE_SOURCE_LOCAL', 2); /** * fsockopen() file source */ define('SIMPLEPIE_FILE_SOURCE_FSOCKOPEN', 4); /** * cURL file source */ define('SIMPLEPIE_FILE_SOURCE_CURL', 8); /** * file_get_contents() file source */ define('SIMPLEPIE_FILE_SOURCE_FILE_GET_CONTENTS', 16); /** * SimplePie * * @package SimplePie * @subpackage API */ class SimplePie { /** * @var array Raw data * @access private */ public $data = array(); /** * @var mixed Error string * @access private */ public $error; /** * @var object Instance of SimplePie_Sanitize (or other class) * @see SimplePie::set_sanitize_class() * @access private */ public $sanitize; /** * @var string SimplePie Useragent * @see SimplePie::set_useragent() * @access private */ public $useragent = SIMPLEPIE_USERAGENT; /** * @var string Feed URL * @see SimplePie::set_feed_url() * @access private */ public $feed_url; /** * @var object Instance of SimplePie_File to use as a feed * @see SimplePie::set_file() * @access private */ public $file; /** * @var string Raw feed data * @see SimplePie::set_raw_data() * @access private */ public $raw_data; /** * @var int Timeout for fetching remote files * @see SimplePie::set_timeout() * @access private */ public $timeout = 10; /** * @var bool Forces fsockopen() to be used for remote files instead * of cURL, even if a new enough version is installed * @see SimplePie::force_fsockopen() * @access private */ public $force_fsockopen = false; /** * @var bool Force the given data/URL to be treated as a feed no matter what * it appears like * @see SimplePie::force_feed() * @access private */ public $force_feed = false; /** * @var bool Enable/Disable Caching * @see SimplePie::enable_cache() * @access private */ public $cache = true; /** * @var int Cache duration (in seconds) * @see SimplePie::set_cache_duration() * @access private */ public $cache_duration = 3600; /** * @var int Auto-discovery cache duration (in seconds) * @see SimplePie::set_autodiscovery_cache_duration() * @access private */ public $autodiscovery_cache_duration = 604800; // 7 Days. /** * @var string Cache location (relative to executing script) * @see SimplePie::set_cache_location() * @access private */ public $cache_location = './cache'; /** * @var string Function that creates the cache filename * @see SimplePie::set_cache_name_function() * @access private */ public $cache_name_function = 'md5'; /** * @var bool Reorder feed by date descending * @see SimplePie::enable_order_by_date() * @access private */ public $order_by_date = true; /** * @var mixed Force input encoding to be set to the follow value * (false, or anything type-cast to false, disables this feature) * @see SimplePie::set_input_encoding() * @access private */ public $input_encoding = false; /** * @var int Feed Autodiscovery Level * @see SimplePie::set_autodiscovery_level() * @access private */ public $autodiscovery = SIMPLEPIE_LOCATOR_ALL; /** * Class registry object * * @var SimplePie_Registry */ public $registry; /** * @var int Maximum number of feeds to check with autodiscovery * @see SimplePie::set_max_checked_feeds() * @access private */ public $max_checked_feeds = 10; /** * @var array All the feeds found during the autodiscovery process * @see SimplePie::get_all_discovered_feeds() * @access private */ public $all_discovered_feeds = array(); /** * @var string Web-accessible path to the handler_image.php file. * @see SimplePie::set_image_handler() * @access private */ public $image_handler = ''; /** * @var array Stores the URLs when multiple feeds are being initialized. * @see SimplePie::set_feed_url() * @access private */ public $multifeed_url = array(); /** * @var array Stores SimplePie objects when multiple feeds initialized. * @access private */ public $multifeed_objects = array(); /** * @var array Stores the get_object_vars() array for use with multifeeds. * @see SimplePie::set_feed_url() * @access private */ public $config_settings = null; /** * @var integer Stores the number of items to return per-feed with multifeeds. * @see SimplePie::set_item_limit() * @access private */ public $item_limit = 0; /** * @var array Stores the default attributes to be stripped by strip_attributes(). * @see SimplePie::strip_attributes() * @access private */ public $strip_attributes = array('bgsound', 'class', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc'); /** * @var array Stores the default tags to be stripped by strip_htmltags(). * @see SimplePie::strip_htmltags() * @access private */ public $strip_htmltags = array('base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style'); /** * The SimplePie class contains feed level data and options * * To use SimplePie, create the SimplePie object with no parameters. You can * then set configuration options using the provided methods. After setting * them, you must initialise the feed using $feed->init(). At that point the * object's methods and properties will be available to you. * * Previously, it was possible to pass in the feed URL along with cache * options directly into the constructor. This has been removed as of 1.3 as * it caused a lot of confusion. * * @since 1.0 Preview Release */ public function __construct() { if (version_compare(PHP_VERSION, '5.2', '<')) { trigger_error('PHP 4.x, 5.0 and 5.1 are no longer supported. Please upgrade to PHP 5.2 or newer.'); die(); } // Other objects, instances created here so we can set options on them $this->sanitize = new SimplePie_Sanitize(); $this->registry = new SimplePie_Registry(); if (func_num_args() > 0) { $level = defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_WARNING; trigger_error('Passing parameters to the constructor is no longer supported. Please use set_feed_url(), set_cache_location(), and set_cache_location() directly.', $level); $args = func_get_args(); switch (count($args)) { case 3: $this->set_cache_duration($args[2]); case 2: $this->set_cache_location($args[1]); case 1: $this->set_feed_url($args[0]); $this->init(); } } } /** * Used for converting object to a string */ public function __toString() { return md5(serialize($this->data)); } /** * Remove items that link back to this before destroying this object */ public function __destruct() { if ((version_compare(PHP_VERSION, '5.3', '<') || !gc_enabled()) && !ini_get('zend.ze1_compatibility_mode')) { if (!empty($this->data['items'])) { foreach ($this->data['items'] as $item) { $item->__destruct(); } unset($item, $this->data['items']); } if (!empty($this->data['ordered_items'])) { foreach ($this->data['ordered_items'] as $item) { $item->__destruct(); } unset($item, $this->data['ordered_items']); } } } /** * Force the given data/URL to be treated as a feed * * This tells SimplePie to ignore the content-type provided by the server. * Be careful when using this option, as it will also disable autodiscovery. * * @since 1.1 * @param bool $enable Force the given data/URL to be treated as a feed */ public function force_feed($enable = false) { $this->force_feed = (bool) $enable; } /** * Set the URL of the feed you want to parse * * This allows you to enter the URL of the feed you want to parse, or the * website you want to try to use auto-discovery on. This takes priority * over any set raw data. * * You can set multiple feeds to mash together by passing an array instead * of a string for the $url. Remember that with each additional feed comes * additional processing and resources. * * @since 1.0 Preview Release * @see set_raw_data() * @param string|array $url This is the URL (or array of URLs) that you want to parse. */ public function set_feed_url($url) { $this->multifeed_url = array(); if (is_array($url)) { foreach ($url as $value) { $this->multifeed_url[] = $this->registry->call('Misc', 'fix_protocol', array($value, 1)); } } else { $this->feed_url = $this->registry->call('Misc', 'fix_protocol', array($url, 1)); } } /** * Set an instance of {@see SimplePie_File} to use as a feed * * @param SimplePie_File &$file * @return bool True on success, false on failure */ public function set_file(&$file) { if ($file instanceof SimplePie_File) { $this->feed_url = $file->url; $this->file =& $file; return true; } return false; } /** * Set the raw XML data to parse * * Allows you to use a string of RSS/Atom data instead of a remote feed. * * If you have a feed available as a string in PHP, you can tell SimplePie * to parse that data string instead of a remote feed. Any set feed URL * takes precedence. * * @since 1.0 Beta 3 * @param string $data RSS or Atom data as a string. * @see set_feed_url() */ public function set_raw_data($data) { $this->raw_data = $data; } /** * Set the the default timeout for fetching remote feeds * * This allows you to change the maximum time the feed's server to respond * and send the feed back. * * @since 1.0 Beta 3 * @param int $timeout The maximum number of seconds to spend waiting to retrieve a feed. */ public function set_timeout($timeout = 10) { $this->timeout = (int) $timeout; } /** * Force SimplePie to use fsockopen() instead of cURL * * @since 1.0 Beta 3 * @param bool $enable Force fsockopen() to be used */ public function force_fsockopen($enable = false) { $this->force_fsockopen = (bool) $enable; } /** * Enable/disable caching in SimplePie. * * This option allows you to disable caching all-together in SimplePie. * However, disabling the cache can lead to longer load times. * * @since 1.0 Preview Release * @param bool $enable Enable caching */ public function enable_cache($enable = true) { $this->cache = (bool) $enable; } /** * Set the length of time (in seconds) that the contents of a feed will be * cached * * @param int $seconds The feed content cache duration */ public function set_cache_duration($seconds = 3600) { $this->cache_duration = (int) $seconds; } /** * Set the length of time (in seconds) that the autodiscovered feed URL will * be cached * * @param int $seconds The autodiscovered feed URL cache duration. */ public function set_autodiscovery_cache_duration($seconds = 604800) { $this->autodiscovery_cache_duration = (int) $seconds; } /** * Set the file system location where the cached files should be stored * * @param string $location The file system location. */ public function set_cache_location($location = './cache') { $this->cache_location = (string) $location; } /** * Set whether feed items should be sorted into reverse chronological order * * @param bool $enable Sort as reverse chronological order. */ public function enable_order_by_date($enable = true) { $this->order_by_date = (bool) $enable; } /** * Set the character encoding used to parse the feed * * This overrides the encoding reported by the feed, however it will fall * back to the normal encoding detection if the override fails * * @param string $encoding Character encoding */ public function set_input_encoding($encoding = false) { if ($encoding) { $this->input_encoding = (string) $encoding; } else { $this->input_encoding = false; } } /** * Set how much feed autodiscovery to do * * @see SIMPLEPIE_LOCATOR_NONE * @see SIMPLEPIE_LOCATOR_AUTODISCOVERY * @see SIMPLEPIE_LOCATOR_LOCAL_EXTENSION * @see SIMPLEPIE_LOCATOR_LOCAL_BODY * @see SIMPLEPIE_LOCATOR_REMOTE_EXTENSION * @see SIMPLEPIE_LOCATOR_REMOTE_BODY * @see SIMPLEPIE_LOCATOR_ALL * @param int $level Feed Autodiscovery Level (level can be a combination of the above constants, see bitwise OR operator) */ public function set_autodiscovery_level($level = SIMPLEPIE_LOCATOR_ALL) { $this->autodiscovery = (int) $level; } /** * Get the class registry * * Use this to override SimplePie's default classes * @see SimplePie_Registry * @return SimplePie_Registry */ public function &get_registry() { return $this->registry; } /**#@+ * Useful when you are overloading or extending SimplePie's default classes. * * @deprecated Use {@see get_registry()} instead * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation * @param string $class Name of custom class * @return boolean True on success, false otherwise */ /** * Set which class SimplePie uses for caching */ public function set_cache_class($class = 'SimplePie_Cache') { return $this->registry->register('Cache', $class, true); } /** * Set which class SimplePie uses for auto-discovery */ public function set_locator_class($class = 'SimplePie_Locator') { return $this->registry->register('Locator', $class, true); } /** * Set which class SimplePie uses for XML parsing */ public function set_parser_class($class = 'SimplePie_Parser') { return $this->registry->register('Parser', $class, true); } /** * Set which class SimplePie uses for remote file fetching */ public function set_file_class($class = 'SimplePie_File') { return $this->registry->register('File', $class, true); } /** * Set which class SimplePie uses for data sanitization */ public function set_sanitize_class($class = 'SimplePie_Sanitize') { return $this->registry->register('Sanitize', $class, true); } /** * Set which class SimplePie uses for handling feed items */ public function set_item_class($class = 'SimplePie_Item') { return $this->registry->register('Item', $class, true); } /** * Set which class SimplePie uses for handling author data */ public function set_author_class($class = 'SimplePie_Author') { return $this->registry->register('Author', $class, true); } /** * Set which class SimplePie uses for handling category data */ public function set_category_class($class = 'SimplePie_Category') { return $this->registry->register('Category', $class, true); } /** * Set which class SimplePie uses for feed enclosures */ public function set_enclosure_class($class = 'SimplePie_Enclosure') { return $this->registry->register('Enclosure', $class, true); } /** * Set which class SimplePie uses for `` captions */ public function set_caption_class($class = 'SimplePie_Caption') { return $this->registry->register('Caption', $class, true); } /** * Set which class SimplePie uses for `` */ public function set_copyright_class($class = 'SimplePie_Copyright') { return $this->registry->register('Copyright', $class, true); } /** * Set which class SimplePie uses for `` */ public function set_credit_class($class = 'SimplePie_Credit') { return $this->registry->register('Credit', $class, true); } /** * Set which class SimplePie uses for `` */ public function set_rating_class($class = 'SimplePie_Rating') { return $this->registry->register('Rating', $class, true); } /** * Set which class SimplePie uses for `` */ public function set_restriction_class($class = 'SimplePie_Restriction') { return $this->registry->register('Restriction', $class, true); } /** * Set which class SimplePie uses for content-type sniffing */ public function set_content_type_sniffer_class($class = 'SimplePie_Content_Type_Sniffer') { return $this->registry->register('Content_Type_Sniffer', $class, true); } /** * Set which class SimplePie uses item sources */ public function set_source_class($class = 'SimplePie_Source') { return $this->registry->register('Source', $class, true); } /**#@-*/ /** * Set the user agent string * * @param string $ua New user agent string. */ public function set_useragent($ua = SIMPLEPIE_USERAGENT) { $this->useragent = (string) $ua; } /** * Set callback function to create cache filename with * * @param mixed $function Callback function */ public function set_cache_name_function($function = 'md5') { if (is_callable($function)) { $this->cache_name_function = $function; } } /** * Set options to make SP as fast as possible * * Forgoes a substantial amount of data sanitization in favor of speed. This * turns SimplePie into a dumb parser of feeds. * * @param bool $set Whether to set them or not */ public function set_stupidly_fast($set = false) { if ($set) { $this->enable_order_by_date(false); $this->remove_div(false); $this->strip_comments(false); $this->strip_htmltags(false); $this->strip_attributes(false); $this->set_image_handler(false); } } /** * Set maximum number of feeds to check with autodiscovery * * @param int $max Maximum number of feeds to check */ public function set_max_checked_feeds($max = 10) { $this->max_checked_feeds = (int) $max; } public function remove_div($enable = true) { $this->sanitize->remove_div($enable); } public function strip_htmltags($tags = '', $encode = null) { if ($tags === '') { $tags = $this->strip_htmltags; } $this->sanitize->strip_htmltags($tags); if ($encode !== null) { $this->sanitize->encode_instead_of_strip($tags); } } public function encode_instead_of_strip($enable = true) { $this->sanitize->encode_instead_of_strip($enable); } public function strip_attributes($attribs = '') { if ($attribs === '') { $attribs = $this->strip_attributes; } $this->sanitize->strip_attributes($attribs); } /** * Set the output encoding * * Allows you to override SimplePie's output to match that of your webpage. * This is useful for times when your webpages are not being served as * UTF-8. This setting will be obeyed by {@see handle_content_type()}, and * is similar to {@see set_input_encoding()}. * * It should be noted, however, that not all character encodings can support * all characters. If your page is being served as ISO-8859-1 and you try * to display a Japanese feed, you'll likely see garbled characters. * Because of this, it is highly recommended to ensure that your webpages * are served as UTF-8. * * The number of supported character encodings depends on whether your web * host supports {@link http://php.net/mbstring mbstring}, * {@link http://php.net/iconv iconv}, or both. See * {@link http://simplepie.org/wiki/faq/Supported_Character_Encodings} for * more information. * * @param string $encoding */ public function set_output_encoding($encoding = 'UTF-8') { $this->sanitize->set_output_encoding($encoding); } public function strip_comments($strip = false) { $this->sanitize->strip_comments($strip); } /** * Set element/attribute key/value pairs of HTML attributes * containing URLs that need to be resolved relative to the feed * * Defaults to |a|@href, |area|@href, |blockquote|@cite, |del|@cite, * |form|@action, |img|@longdesc, |img|@src, |input|@src, |ins|@cite, * |q|@cite * * @since 1.0 * @param array|null $element_attribute Element/attribute key/value pairs, null for default */ public function set_url_replacements($element_attribute = null) { $this->sanitize->set_url_replacements($element_attribute); } /** * Set the handler to enable the display of cached images. * * @param str $page Web-accessible path to the handler_image.php file. * @param str $qs The query string that the value should be passed to. */ public function set_image_handler($page = false, $qs = 'i') { if ($page !== false) { $this->sanitize->set_image_handler($page . '?' . $qs . '='); } else { $this->image_handler = ''; } } /** * Set the limit for items returned per-feed with multifeeds * * @param integer $limit The maximum number of items to return. */ public function set_item_limit($limit = 0) { $this->item_limit = (int) $limit; } /** * Initialize the feed object * * This is what makes everything happen. Period. This is where all of the * configuration options get processed, feeds are fetched, cached, and * parsed, and all of that other good stuff. * * @return boolean True if successful, false otherwise */ public function init() { // Check absolute bare minimum requirements. if (!extension_loaded('xml') || !extension_loaded('pcre')) { return false; } // Then check the xml extension is sane (i.e., libxml 2.7.x issue on PHP < 5.2.9 and libxml 2.7.0 to 2.7.2 on any version) if we don't have xmlreader. elseif (!extension_loaded('xmlreader')) { static $xml_is_sane = null; if ($xml_is_sane === null) { $parser_check = xml_parser_create(); xml_parse_into_struct($parser_check, '&', $values); xml_parser_free($parser_check); $xml_is_sane = isset($values[0]['value']); } if (!$xml_is_sane) { return false; } } if (method_exists($this->sanitize, 'set_registry')) { $this->sanitize->set_registry($this->registry); } // Pass whatever was set with config options over to the sanitizer. // Pass the classes in for legacy support; new classes should use the registry instead $this->sanitize->pass_cache_data($this->cache, $this->cache_location, $this->cache_name_function, $this->registry->get_class('Cache')); $this->sanitize->pass_file_data($this->registry->get_class('File'), $this->timeout, $this->useragent, $this->force_fsockopen); if (!empty($this->multifeed_url)) { $i = 0; $success = 0; $this->multifeed_objects = array(); $this->error = array(); foreach ($this->multifeed_url as $url) { $this->multifeed_objects[$i] = clone $this; $this->multifeed_objects[$i]->set_feed_url($url); $single_success = $this->multifeed_objects[$i]->init(); $success |= $single_success; if (!$single_success) { $this->error[$i] = $this->multifeed_objects[$i]->error(); } $i++; } return (bool) $success; } elseif ($this->feed_url === null && $this->raw_data === null) { return false; } $this->error = null; $this->data = array(); $this->multifeed_objects = array(); $cache = false; if ($this->feed_url !== null) { $parsed_feed_url = $this->registry->call('Misc', 'parse_url', array($this->feed_url)); // Decide whether to enable caching if ($this->cache && $parsed_feed_url['scheme'] !== '') { $cache = $this->registry->call('Cache', 'get_handler', array($this->cache_location, call_user_func($this->cache_name_function, $this->feed_url), 'spc')); } // Fetch the data via SimplePie_File into $this->raw_data if (($fetched = $this->fetch_data($cache)) === true) { return true; } elseif ($fetched === false) { return false; } list($headers, $sniffed) = $fetched; } // Set up array of possible encodings $encodings = array(); // First check to see if input has been overridden. if ($this->input_encoding !== false) { $encodings[] = $this->input_encoding; } $application_types = array('application/xml', 'application/xml-dtd', 'application/xml-external-parsed-entity'); $text_types = array('text/xml', 'text/xml-external-parsed-entity'); // RFC 3023 (only applies to sniffed content) if (isset($sniffed)) { if (in_array($sniffed, $application_types) || substr($sniffed, 0, 12) === 'application/' && substr($sniffed, -4) === '+xml') { if (isset($headers['content-type']) && preg_match('/;\x20?charset=([^;]*)/i', $headers['content-type'], $charset)) { $encodings[] = strtoupper($charset[1]); } $encodings = array_merge($encodings, $this->registry->call('Misc', 'xml_encoding', array($this->raw_data, &$this->registry))); $encodings[] = 'UTF-8'; } elseif (in_array($sniffed, $text_types) || substr($sniffed, 0, 5) === 'text/' && substr($sniffed, -4) === '+xml') { if (isset($headers['content-type']) && preg_match('/;\x20?charset=([^;]*)/i', $headers['content-type'], $charset)) { $encodings[] = $charset[1]; } $encodings[] = 'US-ASCII'; } // Text MIME-type default elseif (substr($sniffed, 0, 5) === 'text/') { $encodings[] = 'US-ASCII'; } } // Fallback to XML 1.0 Appendix F.1/UTF-8/ISO-8859-1 $encodings = array_merge($encodings, $this->registry->call('Misc', 'xml_encoding', array($this->raw_data, &$this->registry))); $encodings[] = 'UTF-8'; $encodings[] = 'ISO-8859-1'; // There's no point in trying an encoding twice $encodings = array_unique($encodings); // Loop through each possible encoding, till we return something, or run out of possibilities foreach ($encodings as $encoding) { // Change the encoding to UTF-8 (as we always use UTF-8 internally) if ($utf8_data = $this->registry->call('Misc', 'change_encoding', array($this->raw_data, $encoding, 'UTF-8'))) { // Create new parser $parser = $this->registry->create('Parser'); // If it's parsed fine if ($parser->parse($utf8_data, 'UTF-8')) { $this->data = $parser->get_data(); if (!($this->get_type() & ~SIMPLEPIE_TYPE_NONE)) { $this->error = "A feed could not be found at $this->feed_url. This does not appear to be a valid RSS or Atom feed."; $this->registry->call('Misc', 'error', array($this->error, E_USER_NOTICE, __FILE__, __LINE__)); return false; } if (isset($headers)) { $this->data['headers'] = $headers; } $this->data['build'] = SIMPLEPIE_BUILD; // Cache the file if caching is enabled if ($cache && !$cache->save($this)) { trigger_error("$this->cache_location is not writeable. Make sure you've set the correct relative or absolute path, and that the location is server-writable.", E_USER_WARNING); } return true; } } } if (isset($parser)) { // We have an error, just set SimplePie_Misc::error to it and quit $this->error = sprintf('This XML document is invalid, likely due to invalid characters. XML error: %s at line %d, column %d', $parser->get_error_string(), $parser->get_current_line(), $parser->get_current_column()); } else { $this->error = 'The data could not be converted to UTF-8. You MUST have either the iconv or mbstring extension installed. Upgrading to PHP 5.x (which includes iconv) is highly recommended.'; } $this->registry->call('Misc', 'error', array($this->error, E_USER_NOTICE, __FILE__, __LINE__)); return false; } /** * Fetch the data via SimplePie_File * * If the data is already cached, attempt to fetch it from there instead * @param SimplePie_Cache|false $cache Cache handler, or false to not load from the cache * @return array|true Returns true if the data was loaded from the cache, or an array of HTTP headers and sniffed type */ protected function fetch_data(&$cache) { // If it's enabled, use the cache if ($cache) { // Load the Cache $this->data = $cache->load(); if (!empty($this->data)) { // If the cache is for an outdated build of SimplePie if (!isset($this->data['build']) || $this->data['build'] !== SIMPLEPIE_BUILD) { $cache->unlink(); $this->data = array(); } // If we've hit a collision just rerun it with caching disabled elseif (isset($this->data['url']) && $this->data['url'] !== $this->feed_url) { $cache = false; $this->data = array(); } // If we've got a non feed_url stored (if the page isn't actually a feed, or is a redirect) use that URL. elseif (isset($this->data['feed_url'])) { // If the autodiscovery cache is still valid use it. if ($cache->mtime() + $this->autodiscovery_cache_duration > time()) { // Do not need to do feed autodiscovery yet. if ($this->data['feed_url'] !== $this->data['url']) { $this->set_feed_url($this->data['feed_url']); return $this->init(); } $cache->unlink(); $this->data = array(); } } // Check if the cache has been updated elseif ($cache->mtime() + $this->cache_duration < time()) { // If we have last-modified and/or etag set if (isset($this->data['headers']['last-modified']) || isset($this->data['headers']['etag'])) { $headers = array( 'Accept' => 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9, application/xml;q=0.8, text/xml;q=0.8, text/html;q=0.7, unknown/unknown;q=0.1, application/unknown;q=0.1, */*;q=0.1', ); if (isset($this->data['headers']['last-modified'])) { $headers['if-modified-since'] = $this->data['headers']['last-modified']; } if (isset($this->data['headers']['etag'])) { $headers['if-none-match'] = $this->data['headers']['etag']; } $file = $this->registry->create('File', array($this->feed_url, $this->timeout/10, 5, $headers, $this->useragent, $this->force_fsockopen)); if ($file->success) { if ($file->status_code === 304) { $cache->touch(); return true; } } else { unset($file); } } } // If the cache is still valid, just return true else { $this->raw_data = false; return true; } } // If the cache is empty, delete it else { $cache->unlink(); $this->data = array(); } } // If we don't already have the file (it'll only exist if we've opened it to check if the cache has been modified), open it. if (!isset($file)) { if ($this->file instanceof SimplePie_File && $this->file->url === $this->feed_url) { $file =& $this->file; } else { $headers = array( 'Accept' => 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9, application/xml;q=0.8, text/xml;q=0.8, text/html;q=0.7, unknown/unknown;q=0.1, application/unknown;q=0.1, */*;q=0.1', ); $file = $this->registry->create('File', array($this->feed_url, $this->timeout, 5, $headers, $this->useragent, $this->force_fsockopen)); } } // If the file connection has an error, set SimplePie::error to that and quit if (!$file->success && !($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300))) { $this->error = $file->error; return !empty($this->data); } if (!$this->force_feed) { // Check if the supplied URL is a feed, if it isn't, look for it. $locate = $this->registry->create('Locator', array(&$file, $this->timeout, $this->useragent, $this->max_checked_feeds)); if (!$locate->is_feed($file)) { // We need to unset this so that if SimplePie::set_file() has been called that object is untouched unset($file); try { if (!($file = $locate->find($this->autodiscovery, $this->all_discovered_feeds))) { $this->error = "A feed could not be found at $this->feed_url. A feed with an invalid mime type may fall victim to this error, or " . SIMPLEPIE_NAME . " was unable to auto-discover it.. Use force_feed() if you are certain this URL is a real feed."; $this->registry->call('Misc', 'error', array($this->error, E_USER_NOTICE, __FILE__, __LINE__)); return false; } } catch (SimplePie_Exception $e) { // This is usually because DOMDocument doesn't exist $this->error = $e->getMessage(); $this->registry->call('Misc', 'error', array($this->error, E_USER_NOTICE, $e->getFile(), $e->getLine())); return false; } if ($cache) { $this->data = array('url' => $this->feed_url, 'feed_url' => $file->url, 'build' => SIMPLEPIE_BUILD); if (!$cache->save($this)) { trigger_error("$this->cache_location is not writeable. Make sure you've set the correct relative or absolute path, and that the location is server-writable.", E_USER_WARNING); } $cache = $this->registry->call('Cache', 'get_handler', array($this->cache_location, call_user_func($this->cache_name_function, $file->url), 'spc')); } $this->feed_url = $file->url; } $locate = null; } $this->raw_data = $file->body; $headers = $file->headers; $sniffer = $this->registry->create('Content_Type_Sniffer', array(&$file)); $sniffed = $sniffer->get_type(); return array($headers, $sniffed); } /** * Get the error message for the occured error * * @return string|array Error message, or array of messages for multifeeds */ public function error() { return $this->error; } /** * Get the raw XML * * This is the same as the old `$feed->enable_xml_dump(true)`, but returns * the data instead of printing it. * * @return string|boolean Raw XML data, false if the cache is used */ public function get_raw_data() { return $this->raw_data; } /** * Get the character encoding used for output * * @since Preview Release * @return string */ public function get_encoding() { return $this->sanitize->output_encoding; } /** * Send the content-type header with correct encoding * * This method ensures that the SimplePie-enabled page is being served with * the correct {@link http://www.iana.org/assignments/media-types/ mime-type} * and character encoding HTTP headers (character encoding determined by the * {@see set_output_encoding} config option). * * This won't work properly if any content or whitespace has already been * sent to the browser, because it relies on PHP's * {@link http://php.net/header header()} function, and these are the * circumstances under which the function works. * * Because it's setting these settings for the entire page (as is the nature * of HTTP headers), this should only be used once per page (again, at the * top). * * @param string $mime MIME type to serve the page as */ public function handle_content_type($mime = 'text/html') { if (!headers_sent()) { $header = "Content-type: $mime;"; if ($this->get_encoding()) { $header .= ' charset=' . $this->get_encoding(); } else { $header .= ' charset=UTF-8'; } header($header); } } /** * Get the type of the feed * * This returns a SIMPLEPIE_TYPE_* constant, which can be tested against * using {@link http://php.net/language.operators.bitwise bitwise operators} * * @since 0.8 (usage changed to using constants in 1.0) * @see SIMPLEPIE_TYPE_NONE Unknown. * @see SIMPLEPIE_TYPE_RSS_090 RSS 0.90. * @see SIMPLEPIE_TYPE_RSS_091_NETSCAPE RSS 0.91 (Netscape). * @see SIMPLEPIE_TYPE_RSS_091_USERLAND RSS 0.91 (Userland). * @see SIMPLEPIE_TYPE_RSS_091 RSS 0.91. * @see SIMPLEPIE_TYPE_RSS_092 RSS 0.92. * @see SIMPLEPIE_TYPE_RSS_093 RSS 0.93. * @see SIMPLEPIE_TYPE_RSS_094 RSS 0.94. * @see SIMPLEPIE_TYPE_RSS_10 RSS 1.0. * @see SIMPLEPIE_TYPE_RSS_20 RSS 2.0.x. * @see SIMPLEPIE_TYPE_RSS_RDF RDF-based RSS. * @see SIMPLEPIE_TYPE_RSS_SYNDICATION Non-RDF-based RSS (truly intended as syndication format). * @see SIMPLEPIE_TYPE_RSS_ALL Any version of RSS. * @see SIMPLEPIE_TYPE_ATOM_03 Atom 0.3. * @see SIMPLEPIE_TYPE_ATOM_10 Atom 1.0. * @see SIMPLEPIE_TYPE_ATOM_ALL Any version of Atom. * @see SIMPLEPIE_TYPE_ALL Any known/supported feed type. * @return int SIMPLEPIE_TYPE_* constant */ public function get_type() { if (!isset($this->data['type'])) { $this->data['type'] = SIMPLEPIE_TYPE_ALL; if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'])) { $this->data['type'] &= SIMPLEPIE_TYPE_ATOM_10; } elseif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'])) { $this->data['type'] &= SIMPLEPIE_TYPE_ATOM_03; } elseif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'])) { if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_10]['channel']) || isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_10]['image']) || isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_10]['item']) || isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_10]['textinput'])) { $this->data['type'] &= SIMPLEPIE_TYPE_RSS_10; } if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_090]['channel']) || isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_090]['image']) || isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_090]['item']) || isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_090]['textinput'])) { $this->data['type'] &= SIMPLEPIE_TYPE_RSS_090; } } elseif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'])) { $this->data['type'] &= SIMPLEPIE_TYPE_RSS_ALL; if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['attribs']['']['version'])) { switch (trim($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['attribs']['']['version'])) { case '0.91': $this->data['type'] &= SIMPLEPIE_TYPE_RSS_091; if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['skiphours']['hour'][0]['data'])) { switch (trim($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['skiphours']['hour'][0]['data'])) { case '0': $this->data['type'] &= SIMPLEPIE_TYPE_RSS_091_NETSCAPE; break; case '24': $this->data['type'] &= SIMPLEPIE_TYPE_RSS_091_USERLAND; break; } } break; case '0.92': $this->data['type'] &= SIMPLEPIE_TYPE_RSS_092; break; case '0.93': $this->data['type'] &= SIMPLEPIE_TYPE_RSS_093; break; case '0.94': $this->data['type'] &= SIMPLEPIE_TYPE_RSS_094; break; case '2.0': $this->data['type'] &= SIMPLEPIE_TYPE_RSS_20; break; } } } else { $this->data['type'] = SIMPLEPIE_TYPE_NONE; } } return $this->data['type']; } /** * Get the URL for the feed * * May or may not be different from the URL passed to {@see set_feed_url()}, * depending on whether auto-discovery was used. * * @since Preview Release (previously called `get_feed_url()` since SimplePie 0.8.) * @todo If we have a perm redirect we should return the new URL * @todo When we make the above change, let's support as well * @todo Also, |atom:link|@rel=self * @return string|null */ public function subscribe_url() { if ($this->feed_url !== null) { return $this->sanitize($this->feed_url, SIMPLEPIE_CONSTRUCT_IRI); } else { return null; } } /** * Get data for an feed-level element * * This method allows you to get access to ANY element/attribute that is a * sub-element of the opening feed tag. * * The return value is an indexed array of elements matching the given * namespace and tag name. Each element has `attribs`, `data` and `child` * subkeys. For `attribs` and `child`, these contain namespace subkeys. * `attribs` then has one level of associative name => value data (where * `value` is a string) after the namespace. `child` has tag-indexed keys * after the namespace, each member of which is an indexed array matching * this same format. * * For example: *
    	 * // This is probably a bad example because we already support
    	 * //  natively, but it shows you how to parse through
    	 * // the nodes.
    	 * $group = $item->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'group');
    	 * $content = $group[0]['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content'];
    	 * $file = $content[0]['attribs']['']['url'];
    	 * echo $file;
    	 * 
    * * @since 1.0 * @see http://simplepie.org/wiki/faq/supported_xml_namespaces * @param string $namespace The URL of the XML namespace of the elements you're trying to access * @param string $tag Tag name * @return array */ public function get_feed_tags($namespace, $tag) { $type = $this->get_type(); if ($type & SIMPLEPIE_TYPE_ATOM_10) { if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]['child'][$namespace][$tag])) { return $this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]['child'][$namespace][$tag]; } } if ($type & SIMPLEPIE_TYPE_ATOM_03) { if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]['child'][$namespace][$tag])) { return $this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]['child'][$namespace][$tag]; } } if ($type & SIMPLEPIE_TYPE_RSS_RDF) { if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][$namespace][$tag])) { return $this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][$namespace][$tag]; } } if ($type & SIMPLEPIE_TYPE_RSS_SYNDICATION) { if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][$namespace][$tag])) { return $this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][$namespace][$tag]; } } return null; } /** * Get data for an channel-level element * * This method allows you to get access to ANY element/attribute in the * channel/header section of the feed. * * See {@see SimplePie::get_feed_tags()} for a description of the return value * * @since 1.0 * @see http://simplepie.org/wiki/faq/supported_xml_namespaces * @param string $namespace The URL of the XML namespace of the elements you're trying to access * @param string $tag Tag name * @return array */ public function get_channel_tags($namespace, $tag) { $type = $this->get_type(); if ($type & SIMPLEPIE_TYPE_ATOM_ALL) { if ($return = $this->get_feed_tags($namespace, $tag)) { return $return; } } if ($type & SIMPLEPIE_TYPE_RSS_10) { if ($channel = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'channel')) { if (isset($channel[0]['child'][$namespace][$tag])) { return $channel[0]['child'][$namespace][$tag]; } } } if ($type & SIMPLEPIE_TYPE_RSS_090) { if ($channel = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'channel')) { if (isset($channel[0]['child'][$namespace][$tag])) { return $channel[0]['child'][$namespace][$tag]; } } } if ($type & SIMPLEPIE_TYPE_RSS_SYNDICATION) { if ($channel = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'channel')) { if (isset($channel[0]['child'][$namespace][$tag])) { return $channel[0]['child'][$namespace][$tag]; } } } return null; } /** * Get data for an channel-level element * * This method allows you to get access to ANY element/attribute in the * image/logo section of the feed. * * See {@see SimplePie::get_feed_tags()} for a description of the return value * * @since 1.0 * @see http://simplepie.org/wiki/faq/supported_xml_namespaces * @param string $namespace The URL of the XML namespace of the elements you're trying to access * @param string $tag Tag name * @return array */ public function get_image_tags($namespace, $tag) { $type = $this->get_type(); if ($type & SIMPLEPIE_TYPE_RSS_10) { if ($image = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'image')) { if (isset($image[0]['child'][$namespace][$tag])) { return $image[0]['child'][$namespace][$tag]; } } } if ($type & SIMPLEPIE_TYPE_RSS_090) { if ($image = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'image')) { if (isset($image[0]['child'][$namespace][$tag])) { return $image[0]['child'][$namespace][$tag]; } } } if ($type & SIMPLEPIE_TYPE_RSS_SYNDICATION) { if ($image = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'image')) { if (isset($image[0]['child'][$namespace][$tag])) { return $image[0]['child'][$namespace][$tag]; } } } return null; } /** * Get the base URL value from the feed * * Uses `` if available, otherwise uses the first link in the * feed, or failing that, the URL of the feed itself. * * @see get_link * @see subscribe_url * * @param array $element * @return string */ public function get_base($element = array()) { if (!($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION) && !empty($element['xml_base_explicit']) && isset($element['xml_base'])) { return $element['xml_base']; } elseif ($this->get_link() !== null) { return $this->get_link(); } else { return $this->subscribe_url(); } } /** * Sanitize feed data * * @access private * @see SimplePie_Sanitize::sanitize() * @param string $data Data to sanitize * @param int $type One of the SIMPLEPIE_CONSTRUCT_* constants * @param string $base Base URL to resolve URLs against * @return string Sanitized data */ public function sanitize($data, $type, $base = '') { return $this->sanitize->sanitize($data, $type, $base); } /** * Get the title of the feed * * Uses ``, `` or `<dc:title>` * * @since 1.0 (previously called `get_feed_title` since 0.8) * @return string|null */ public function get_title() { if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title')) { return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'title')) { return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_10, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } else { return null; } } /** * Get a category for the feed * * @since Unknown * @param int $key The category that you want to return. Remember that arrays begin with 0, not 1 * @return SimplePie_Category|null */ public function get_category($key = 0) { $categories = $this->get_categories(); if (isset($categories[$key])) { return $categories[$key]; } else { return null; } } /** * Get all categories for the feed * * Uses `<atom:category>`, `<category>` or `<dc:subject>` * * @since Unknown * @return array|null List of {@see SimplePie_Category} objects */ public function get_categories() { $categories = array(); foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'category') as $category) { $term = null; $scheme = null; $label = null; if (isset($category['attribs']['']['term'])) { $term = $this->sanitize($category['attribs']['']['term'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($category['attribs']['']['scheme'])) { $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($category['attribs']['']['label'])) { $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT); } $categories[] = $this->registry->create('Category', array($term, $scheme, $label)); } foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'category') as $category) { // This is really the label, but keep this as the term also for BC. // Label will also work on retrieving because that falls back to term. $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT); if (isset($category['attribs']['']['domain'])) { $scheme = $this->sanitize($category['attribs']['']['domain'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $scheme = null; } $categories[] = $this->registry->create('Category', array($term, $scheme, null)); } foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'subject') as $category) { $categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null)); } foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_10, 'subject') as $category) { $categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null)); } if (!empty($categories)) { return array_unique($categories); } else { return null; } } /** * Get an author for the feed * * @since 1.1 * @param int $key The author that you want to return. Remember that arrays begin with 0, not 1 * @return SimplePie_Author|null */ public function get_author($key = 0) { $authors = $this->get_authors(); if (isset($authors[$key])) { return $authors[$key]; } else { return null; } } /** * Get all authors for the feed * * Uses `<atom:author>`, `<author>`, `<dc:creator>` or `<itunes:author>` * * @since 1.1 * @return array|null List of {@see SimplePie_Author} objects */ public function get_authors() { $authors = array(); foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'author') as $author) { $name = null; $uri = null; $email = null; if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'])) { $name = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'])) { $uri = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0])); } if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'])) { $email = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $uri !== null) { $authors[] = $this->registry->create('Author', array($name, $uri, $email)); } } if ($author = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author')) { $name = null; $url = null; $email = null; if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'])) { $name = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'])) { $url = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0])); } if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'])) { $email = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $url !== null) { $authors[] = $this->registry->create('Author', array($name, $url, $email)); } } foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'creator') as $author) { $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null)); } foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_10, 'creator') as $author) { $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null)); } foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'author') as $author) { $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null)); } if (!empty($authors)) { return array_unique($authors); } else { return null; } } /** * Get a contributor for the feed * * @since 1.1 * @param int $key The contrbutor that you want to return. Remember that arrays begin with 0, not 1 * @return SimplePie_Author|null */ public function get_contributor($key = 0) { $contributors = $this->get_contributors(); if (isset($contributors[$key])) { return $contributors[$key]; } else { return null; } } /** * Get all contributors for the feed * * Uses `<atom:contributor>` * * @since 1.1 * @return array|null List of {@see SimplePie_Author} objects */ public function get_contributors() { $contributors = array(); foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'contributor') as $contributor) { $name = null; $uri = null; $email = null; if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'])) { $name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'])) { $uri = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0])); } if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'])) { $email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $uri !== null) { $contributors[] = $this->registry->create('Author', array($name, $uri, $email)); } } foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'contributor') as $contributor) { $name = null; $url = null; $email = null; if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'])) { $name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'])) { $url = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0])); } if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'])) { $email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $url !== null) { $contributors[] = $this->registry->create('Author', array($name, $url, $email)); } } if (!empty($contributors)) { return array_unique($contributors); } else { return null; } } /** * Get a single link for the feed * * @since 1.0 (previously called `get_feed_link` since Preview Release, `get_feed_permalink()` since 0.8) * @param int $key The link that you want to return. Remember that arrays begin with 0, not 1 * @param string $rel The relationship of the link to return * @return string|null Link URL */ public function get_link($key = 0, $rel = 'alternate') { $links = $this->get_links($rel); if (isset($links[$key])) { return $links[$key]; } else { return null; } } /** * Get the permalink for the item * * Returns the first link available with a relationship of "alternate". * Identical to {@see get_link()} with key 0 * * @see get_link * @since 1.0 (previously called `get_feed_link` since Preview Release, `get_feed_permalink()` since 0.8) * @internal Added for parity between the parent-level and the item/entry-level. * @return string|null Link URL */ public function get_permalink() { return $this->get_link(0); } /** * Get all links for the feed * * Uses `<atom:link>` or `<link>` * * @since Beta 2 * @param string $rel The relationship of links to return * @return array|null Links found for the feed (strings) */ public function get_links($rel = 'alternate') { if (!isset($this->data['links'])) { $this->data['links'] = array(); if ($links = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link')) { foreach ($links as $link) { if (isset($link['attribs']['']['href'])) { $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate'; $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link)); } } } if ($links = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link')) { foreach ($links as $link) { if (isset($link['attribs']['']['href'])) { $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate'; $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link)); } } } if ($links = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'link')) { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } if ($links = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'link')) { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } if ($links = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link')) { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } $keys = array_keys($this->data['links']); foreach ($keys as $key) { if ($this->registry->call('Misc', 'is_isegment_nz_nc', array($key))) { if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key])) { $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]); $this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]; } else { $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key]; } } elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY) { $this->data['links'][substr($key, 41)] =& $this->data['links'][$key]; } $this->data['links'][$key] = array_unique($this->data['links'][$key]); } } if (isset($this->data['links'][$rel])) { return $this->data['links'][$rel]; } else { return null; } } public function get_all_discovered_feeds() { return $this->all_discovered_feeds; } /** * Get the content for the item * * Uses `<atom:subtitle>`, `<atom:tagline>`, `<description>`, * `<dc:description>`, `<itunes:summary>` or `<itunes:subtitle>` * * @since 1.0 (previously called `get_feed_description()` since 0.8) * @return string|null */ public function get_description() { if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'subtitle')) { return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'tagline')) { return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_10, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'summary')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'subtitle')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0])); } else { return null; } } /** * Get the copyright info for the feed * * Uses `<atom:rights>`, `<atom:copyright>` or `<dc:rights>` * * @since 1.0 (previously called `get_feed_copyright()` since 0.8) * @return string|null */ public function get_copyright() { if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'rights')) { return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'copyright')) { return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'copyright')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'rights')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_10, 'rights')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } else { return null; } } /** * Get the language for the feed * * Uses `<language>`, `<dc:language>`, or @xml_lang * * @since 1.0 (previously called `get_feed_language()` since 0.8) * @return string|null */ public function get_language() { if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'language')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'language')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_10, 'language')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]['xml_lang'])) { return $this->sanitize($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]['xml_lang'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]['xml_lang'])) { return $this->sanitize($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]['xml_lang'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['xml_lang'])) { return $this->sanitize($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['xml_lang'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif (isset($this->data['headers']['content-language'])) { return $this->sanitize($this->data['headers']['content-language'], SIMPLEPIE_CONSTRUCT_TEXT); } else { return null; } } /** * Get the latitude coordinates for the item * * Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications * * Uses `<geo:lat>` or `<georss:point>` * * @since 1.0 * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo * @link http://www.georss.org/ GeoRSS * @return string|null */ public function get_latitude() { if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lat')) { return (float) $return[0]['data']; } elseif (($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match)) { return (float) $match[1]; } else { return null; } } /** * Get the longitude coordinates for the feed * * Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications * * Uses `<geo:long>`, `<geo:lon>` or `<georss:point>` * * @since 1.0 * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo * @link http://www.georss.org/ GeoRSS * @return string|null */ public function get_longitude() { if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'long')) { return (float) $return[0]['data']; } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lon')) { return (float) $return[0]['data']; } elseif (($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match)) { return (float) $match[2]; } else { return null; } } /** * Get the feed logo's title * * RSS 0.9.0, 1.0 and 2.0 feeds are allowed to have a "feed logo" title. * * Uses `<image><title>` or `<image><dc:title>` * * @return string|null */ public function get_image_title() { if ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_DC_11, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_DC_10, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } else { return null; } } /** * Get the feed logo's URL * * RSS 0.9.0, 2.0, Atom 1.0, and feeds with iTunes RSS tags are allowed to * have a "feed logo" URL. This points directly to the image itself. * * Uses `<itunes:image>`, `<atom:logo>`, `<atom:icon>`, * `<image><title>` or `<image><dc:title>` * * @return string|null */ public function get_image_url() { if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'image')) { return $this->sanitize($return[0]['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'logo')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'icon')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); } elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'url')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); } elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'url')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); } elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); } else { return null; } } /** * Get the feed logo's link * * RSS 0.9.0, 1.0 and 2.0 feeds are allowed to have a "feed logo" link. This * points to a human-readable page that the image should link to. * * Uses `<itunes:image>`, `<atom:logo>`, `<atom:icon>`, * `<image><title>` or `<image><dc:title>` * * @return string|null */ public function get_image_link() { if ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'link')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); } elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'link')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); } elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); } else { return null; } } /** * Get the feed logo's link * * RSS 2.0 feeds are allowed to have a "feed logo" width. * * Uses `<image><width>` or defaults to 88.0 if no width is specified and * the feed is an RSS 2.0 feed. * * @return int|float|null */ public function get_image_width() { if ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'width')) { return round($return[0]['data']); } elseif ($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url')) { return 88.0; } else { return null; } } /** * Get the feed logo's height * * RSS 2.0 feeds are allowed to have a "feed logo" height. * * Uses `<image><height>` or defaults to 31.0 if no height is specified and * the feed is an RSS 2.0 feed. * * @return int|float|null */ public function get_image_height() { if ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'height')) { return round($return[0]['data']); } elseif ($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url')) { return 31.0; } else { return null; } } /** * Get the number of items in the feed * * This is well-suited for {@link http://php.net/for for()} loops with * {@see get_item()} * * @param int $max Maximum value to return. 0 for no limit * @return int Number of items in the feed */ public function get_item_quantity($max = 0) { $max = (int) $max; $qty = count($this->get_items()); if ($max === 0) { return $qty; } else { return ($qty > $max) ? $max : $qty; } } /** * Get a single item from the feed * * This is better suited for {@link http://php.net/for for()} loops, whereas * {@see get_items()} is better suited for * {@link http://php.net/foreach foreach()} loops. * * @see get_item_quantity() * @since Beta 2 * @param int $key The item that you want to return. Remember that arrays begin with 0, not 1 * @return SimplePie_Item|null */ public function get_item($key = 0) { $items = $this->get_items(); if (isset($items[$key])) { return $items[$key]; } else { return null; } } /** * Get all items from the feed * * This is better suited for {@link http://php.net/for for()} loops, whereas * {@see get_items()} is better suited for * {@link http://php.net/foreach foreach()} loops. * * @see get_item_quantity * @since Beta 2 * @param int $start Index to start at * @param int $end Number of items to return. 0 for all items after `$start` * @return array|null List of {@see SimplePie_Item} objects */ public function get_items($start = 0, $end = 0) { if (!isset($this->data['items'])) { if (!empty($this->multifeed_objects)) { $this->data['items'] = SimplePie::merge_items($this->multifeed_objects, $start, $end, $this->item_limit); } else { $this->data['items'] = array(); if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'entry')) { $keys = array_keys($items); foreach ($keys as $key) { $this->data['items'][] = $this->registry->create('Item', array($this, $items[$key])); } } if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'entry')) { $keys = array_keys($items); foreach ($keys as $key) { $this->data['items'][] = $this->registry->create('Item', array($this, $items[$key])); } } if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'item')) { $keys = array_keys($items); foreach ($keys as $key) { $this->data['items'][] = $this->registry->create('Item', array($this, $items[$key])); } } if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'item')) { $keys = array_keys($items); foreach ($keys as $key) { $this->data['items'][] = $this->registry->create('Item', array($this, $items[$key])); } } if ($items = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'item')) { $keys = array_keys($items); foreach ($keys as $key) { $this->data['items'][] = $this->registry->create('Item', array($this, $items[$key])); } } } } if (!empty($this->data['items'])) { // If we want to order it by date, check if all items have a date, and then sort it if ($this->order_by_date && empty($this->multifeed_objects)) { if (!isset($this->data['ordered_items'])) { $do_sort = true; foreach ($this->data['items'] as $item) { if (!$item->get_date('U')) { $do_sort = false; break; } } $item = null; $this->data['ordered_items'] = $this->data['items']; if ($do_sort) { usort($this->data['ordered_items'], array(get_class($this), 'sort_items')); } } $items = $this->data['ordered_items']; } else { $items = $this->data['items']; } // Slice the data as desired if ($end === 0) { return array_slice($items, $start); } else { return array_slice($items, $start, $end); } } else { return array(); } } /** * Set the favicon handler * * @deprecated Use your own favicon handling instead */ public function set_favicon_handler($page = false, $qs = 'i') { $level = defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_WARNING; trigger_error('Favicon handling has been removed, please use your own handling', $level); return false; } /** * Get the favicon for the current feed * * @deprecated Use your own favicon handling instead */ public function get_favicon() { $level = defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_WARNING; trigger_error('Favicon handling has been removed, please use your own handling', $level); if (($url = $this->get_link()) !== null) { return 'http://g.etfv.co/' . urlencode($url); } return false; } /** * Magic method handler * * @param string $method Method name * @param array $args Arguments to the method * @return mixed */ public function __call($method, $args) { if (strpos($method, 'subscribe_') === 0) { $level = defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_WARNING; trigger_error('subscribe_*() has been deprecated, implement the callback yourself', $level); return ''; } if ($method === 'enable_xml_dump') { $level = defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_WARNING; trigger_error('enable_xml_dump() has been deprecated, use get_raw_data() instead', $level); return false; } $class = get_class($this); $trace = debug_backtrace(); $file = $trace[0]['file']; $line = $trace[0]['line']; trigger_error("Call to undefined method $class::$method() in $file on line $line", E_USER_ERROR); } /** * Sorting callback for items * * @access private * @param SimplePie $a * @param SimplePie $b * @return boolean */ public static function sort_items($a, $b) { return $a->get_date('U') <= $b->get_date('U'); } /** * Merge items from several feeds into one * * If you're merging multiple feeds together, they need to all have dates * for the items or else SimplePie will refuse to sort them. * * @link http://simplepie.org/wiki/tutorial/sort_multiple_feeds_by_time_and_date#if_feeds_require_separate_per-feed_settings * @param array $urls List of SimplePie feed objects to merge * @param int $start Starting item * @param int $end Number of items to return * @param int $limit Maximum number of items per feed * @return array */ public static function merge_items($urls, $start = 0, $end = 0, $limit = 0) { if (is_array($urls) && sizeof($urls) > 0) { $items = array(); foreach ($urls as $arg) { if ($arg instanceof SimplePie) { $items = array_merge($items, $arg->get_items(0, $limit)); } else { trigger_error('Arguments must be SimplePie objects', E_USER_WARNING); } } $do_sort = true; foreach ($items as $item) { if (!$item->get_date('U')) { $do_sort = false; break; } } $item = null; if ($do_sort) { usort($items, array(get_class($urls[0]), 'sort_items')); } if ($end === 0) { return array_slice($items, $start); } else { return array_slice($items, $start, $end); } } else { trigger_error('Cannot merge zero SimplePie objects', E_USER_WARNING); return array(); } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/���������������������������������������������������������0000775�0000000�0000000�00000000000�12266004471�0020245�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Author.php�����������������������������������������������0000664�0000000�0000000�00000007010�12266004471�0022216�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Manages all author-related data * * Used by {@see SimplePie_Item::get_author()} and {@see SimplePie::get_authors()} * * This class can be overloaded with {@see SimplePie::set_author_class()} * * @package SimplePie * @subpackage API */ class SimplePie_Author { /** * Author's name * * @var string * @see get_name() */ var $name; /** * Author's link * * @var string * @see get_link() */ var $link; /** * Author's email address * * @var string * @see get_email() */ var $email; /** * Constructor, used to input the data * * @param string $name * @param string $link * @param string $email */ public function __construct($name = null, $link = null, $email = null) { $this->name = $name; $this->link = $link; $this->email = $email; } /** * String-ified version * * @return string */ public function __toString() { // There is no $this->data here return md5(serialize($this)); } /** * Author's name * * @return string|null */ public function get_name() { if ($this->name !== null) { return $this->name; } else { return null; } } /** * Author's link * * @return string|null */ public function get_link() { if ($this->link !== null) { return $this->link; } else { return null; } } /** * Author's email address * * @return string|null */ public function get_email() { if ($this->email !== null) { return $this->email; } else { return null; } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Cache.php������������������������������������������������0000664�0000000�0000000�00000010310�12266004471�0021754�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Used to create cache objects * * This class can be overloaded with {@see SimplePie::set_cache_class()}, * although the preferred way is to create your own handler * via {@see register()} * * @package SimplePie * @subpackage Caching */ class SimplePie_Cache { /** * Cache handler classes * * These receive 3 parameters to their constructor, as documented in * {@see register()} * @var array */ protected static $handlers = array( 'mysql' => 'SimplePie_Cache_MySQL', 'memcache' => 'SimplePie_Cache_Memcache', ); /** * Don't call the constructor. Please. */ private function __construct() { } /** * Create a new SimplePie_Cache object * * @param string $location URL location (scheme is used to determine handler) * @param string $filename Unique identifier for cache object * @param string $extension 'spi' or 'spc' * @return SimplePie_Cache_Base Type of object depends on scheme of `$location` */ public static function get_handler($location, $filename, $extension) { $type = explode(':', $location, 2); $type = $type[0]; if (!empty(self::$handlers[$type])) { $class = self::$handlers[$type]; return new $class($location, $filename, $extension); } return new SimplePie_Cache_File($location, $filename, $extension); } /** * Create a new SimplePie_Cache object * * @deprecated Use {@see get_handler} instead */ public function create($location, $filename, $extension) { trigger_error('Cache::create() has been replaced with Cache::get_handler(). Switch to the registry system to use this.', E_USER_DEPRECATED); return self::get_handler($location, $filename, $extension); } /** * Register a handler * * @param string $type DSN type to register for * @param string $class Name of handler class. Must implement SimplePie_Cache_Base */ public static function register($type, $class) { self::$handlers[$type] = $class; } /** * Parse a URL into an array * * @param string $url * @return array */ public static function parse_URL($url) { $params = parse_url($url); $params['extras'] = array(); if (isset($params['query'])) { parse_str($params['query'], $params['extras']); } return $params; } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Cache/���������������������������������������������������0000775�0000000�0000000�00000000000�12266004471�0021250�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Cache/Base.php�������������������������������������������0000664�0000000�0000000�00000006574�12266004471�0022647�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Base for cache objects * * Classes to be used with {@see SimplePie_Cache::register()} are expected * to implement this interface. * * @package SimplePie * @subpackage Caching */ interface SimplePie_Cache_Base { /** * Feed cache type * * @var string */ const TYPE_FEED = 'spc'; /** * Image cache type * * @var string */ const TYPE_IMAGE = 'spi'; /** * Create a new cache object * * @param string $location Location string (from SimplePie::$cache_location) * @param string $name Unique ID for the cache * @param string $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data */ public function __construct($location, $name, $type); /** * Save data to the cache * * @param array|SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property * @return bool Successfulness */ public function save($data); /** * Retrieve the data saved to the cache * * @return array Data for SimplePie::$data */ public function load(); /** * Retrieve the last modified time for the cache * * @return int Timestamp */ public function mtime(); /** * Set the last modified time to the current time * * @return bool Success status */ public function touch(); /** * Remove the cache * * @return bool Success status */ public function unlink(); } ������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Cache/DB.php���������������������������������������������0000664�0000000�0000000�00000011166�12266004471�0022253�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Base class for database-based caches * * @package SimplePie * @subpackage Caching */ abstract class SimplePie_Cache_DB implements SimplePie_Cache_Base { /** * Helper for database conversion * * Converts a given {@see SimplePie} object into data to be stored * * @param SimplePie $data * @return array First item is the serialized data for storage, second item is the unique ID for this item */ protected static function prepare_simplepie_object_for_cache($data) { $items = $data->get_items(); $items_by_id = array(); if (!empty($items)) { foreach ($items as $item) { $items_by_id[$item->get_id()] = $item; } if (count($items_by_id) !== count($items)) { $items_by_id = array(); foreach ($items as $item) { $items_by_id[$item->get_id(true)] = $item; } } if (isset($data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0])) { $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]; } elseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0])) { $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]; } elseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0])) { $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]; } elseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['channel'][0])) { $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['channel'][0]; } else { $channel = null; } if ($channel !== null) { if (isset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['entry'])) { unset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['entry']); } if (isset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['entry'])) { unset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['entry']); } if (isset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_10]['item'])) { unset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_10]['item']); } if (isset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_090]['item'])) { unset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_090]['item']); } if (isset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_20]['item'])) { unset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_20]['item']); } } if (isset($data->data['items'])) { unset($data->data['items']); } if (isset($data->data['ordered_items'])) { unset($data->data['ordered_items']); } } return array(serialize($data->data), $items_by_id); } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Cache/File.php�������������������������������������������0000664�0000000�0000000�00000010510�12266004471�0022635�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Caches data to the filesystem * * @package SimplePie * @subpackage Caching */ class SimplePie_Cache_File implements SimplePie_Cache_Base { /** * Location string * * @see SimplePie::$cache_location * @var string */ protected $location; /** * Filename * * @var string */ protected $filename; /** * File extension * * @var string */ protected $extension; /** * File path * * @var string */ protected $name; /** * Create a new cache object * * @param string $location Location string (from SimplePie::$cache_location) * @param string $name Unique ID for the cache * @param string $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data */ public function __construct($location, $name, $type) { $this->location = $location; $this->filename = $name; $this->extension = $type; $this->name = "$this->location/$this->filename.$this->extension"; } /** * Save data to the cache * * @param array|SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property * @return bool Successfulness */ public function save($data) { if (file_exists($this->name) && is_writeable($this->name) || file_exists($this->location) && is_writeable($this->location)) { if ($data instanceof SimplePie) { $data = $data->data; } $data = serialize($data); return (bool) file_put_contents($this->name, $data); } return false; } /** * Retrieve the data saved to the cache * * @return array Data for SimplePie::$data */ public function load() { if (file_exists($this->name) && is_readable($this->name)) { return unserialize(file_get_contents($this->name)); } return false; } /** * Retrieve the last modified time for the cache * * @return int Timestamp */ public function mtime() { if (file_exists($this->name)) { return filemtime($this->name); } return false; } /** * Set the last modified time to the current time * * @return bool Success status */ public function touch() { if (file_exists($this->name)) { return touch($this->name); } return false; } /** * Remove the cache * * @return bool Success status */ public function unlink() { if (file_exists($this->name)) { return unlink($this->name); } return false; } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Cache/Memcache.php���������������������������������������0000664�0000000�0000000�00000012025�12266004471�0023463�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Caches data to memcache * * Registered for URLs with the "memcache" protocol * * For example, `memcache://localhost:11211/?timeout=3600&prefix=sp_` will * connect to memcache on `localhost` on port 11211. All tables will be * prefixed with `sp_` and data will expire after 3600 seconds * * @package SimplePie * @subpackage Caching * @uses Memcache */ class SimplePie_Cache_Memcache implements SimplePie_Cache_Base { /** * Memcache instance * * @var Memcache */ protected $cache; /** * Options * * @var array */ protected $options; /** * Cache name * * @var string */ protected $name; /** * Create a new cache object * * @param string $location Location string (from SimplePie::$cache_location) * @param string $name Unique ID for the cache * @param string $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data */ public function __construct($location, $name, $type) { $this->options = array( 'host' => '127.0.0.1', 'port' => 11211, 'extras' => array( 'timeout' => 3600, // one hour 'prefix' => 'simplepie_', ), ); $parsed = SimplePie_Cache::parse_URL($location); $this->options['host'] = empty($parsed['host']) ? $this->options['host'] : $parsed['host']; $this->options['port'] = empty($parsed['port']) ? $this->options['port'] : $parsed['port']; $this->options['extras'] = array_merge($this->options['extras'], $parsed['extras']); $this->name = $this->options['extras']['prefix'] . md5("$name:$type"); $this->cache = new Memcache(); $this->cache->addServer($this->options['host'], (int) $this->options['port']); } /** * Save data to the cache * * @param array|SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property * @return bool Successfulness */ public function save($data) { if ($data instanceof SimplePie) { $data = $data->data; } return $this->cache->set($this->name, serialize($data), MEMCACHE_COMPRESSED, (int) $this->options['extras']['timeout']); } /** * Retrieve the data saved to the cache * * @return array Data for SimplePie::$data */ public function load() { $data = $this->cache->get($this->name); if ($data !== false) { return unserialize($data); } return false; } /** * Retrieve the last modified time for the cache * * @return int Timestamp */ public function mtime() { $data = $this->cache->get($this->name); if ($data !== false) { // essentially ignore the mtime because Memcache expires on it's own return time(); } return false; } /** * Set the last modified time to the current time * * @return bool Success status */ public function touch() { $data = $this->cache->get($this->name); if ($data !== false) { return $this->cache->set($this->name, $data, MEMCACHE_COMPRESSED, (int) $this->duration); } return false; } /** * Remove the cache * * @return bool Success status */ public function unlink() { return $this->cache->delete($this->name, 0); } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Cache/MySQL.php������������������������������������������0000664�0000000�0000000�00000027770�12266004471�0022743�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Caches data to a MySQL database * * Registered for URLs with the "mysql" protocol * * For example, `mysql://root:password@localhost:3306/mydb?prefix=sp_` will * connect to the `mydb` database on `localhost` on port 3306, with the user * `root` and the password `password`. All tables will be prefixed with `sp_` * * @package SimplePie * @subpackage Caching */ class SimplePie_Cache_MySQL extends SimplePie_Cache_DB { /** * PDO instance * * @var PDO */ protected $mysql; /** * Options * * @var array */ protected $options; /** * Cache ID * * @var string */ protected $id; /** * Create a new cache object * * @param string $location Location string (from SimplePie::$cache_location) * @param string $name Unique ID for the cache * @param string $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data */ public function __construct($location, $name, $type) { $this->options = array( 'user' => null, 'pass' => null, 'host' => '127.0.0.1', 'port' => '3306', 'path' => '', 'extras' => array( 'prefix' => '', ), ); $this->options = array_merge_recursive($this->options, SimplePie_Cache::parse_URL($location)); // Path is prefixed with a "/" $this->options['dbname'] = substr($this->options['path'], 1); try { $this->mysql = new PDO("mysql:dbname={$this->options['dbname']};host={$this->options['host']};port={$this->options['port']}", $this->options['user'], $this->options['pass'], array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8')); } catch (PDOException $e) { $this->mysql = null; return; } $this->id = $name . $type; if (!$query = $this->mysql->query('SHOW TABLES')) { $this->mysql = null; return; } $db = array(); while ($row = $query->fetchColumn()) { $db[] = $row; } if (!in_array($this->options['extras']['prefix'] . 'cache_data', $db)) { $query = $this->mysql->exec('CREATE TABLE `' . $this->options['extras']['prefix'] . 'cache_data` (`id` TEXT CHARACTER SET utf8 NOT NULL, `items` SMALLINT NOT NULL DEFAULT 0, `data` BLOB NOT NULL, `mtime` INT UNSIGNED NOT NULL, UNIQUE (`id`(125)))'); if ($query === false) { $this->mysql = null; } } if (!in_array($this->options['extras']['prefix'] . 'items', $db)) { $query = $this->mysql->exec('CREATE TABLE `' . $this->options['extras']['prefix'] . 'items` (`feed_id` TEXT CHARACTER SET utf8 NOT NULL, `id` TEXT CHARACTER SET utf8 NOT NULL, `data` TEXT CHARACTER SET utf8 NOT NULL, `posted` INT UNSIGNED NOT NULL, INDEX `feed_id` (`feed_id`(125)))'); if ($query === false) { $this->mysql = null; } } } /** * Save data to the cache * * @param array|SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property * @return bool Successfulness */ public function save($data) { if ($this->mysql === null) { return false; } if ($data instanceof SimplePie) { $data = clone $data; $prepared = self::prepare_simplepie_object_for_cache($data); $query = $this->mysql->prepare('SELECT COUNT(*) FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :feed'); $query->bindValue(':feed', $this->id); if ($query->execute()) { if ($query->fetchColumn() > 0) { $items = count($prepared[1]); if ($items) { $sql = 'UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `items` = :items, `data` = :data, `mtime` = :time WHERE `id` = :feed'; $query = $this->mysql->prepare($sql); $query->bindValue(':items', $items); } else { $sql = 'UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `data` = :data, `mtime` = :time WHERE `id` = :feed'; $query = $this->mysql->prepare($sql); } $query->bindValue(':data', $prepared[0]); $query->bindValue(':time', time()); $query->bindValue(':feed', $this->id); if (!$query->execute()) { return false; } } else { $query = $this->mysql->prepare('INSERT INTO `' . $this->options['extras']['prefix'] . 'cache_data` (`id`, `items`, `data`, `mtime`) VALUES(:feed, :count, :data, :time)'); $query->bindValue(':feed', $this->id); $query->bindValue(':count', count($prepared[1])); $query->bindValue(':data', $prepared[0]); $query->bindValue(':time', time()); if (!$query->execute()) { return false; } } $ids = array_keys($prepared[1]); if (!empty($ids)) { foreach ($ids as $id) { $database_ids[] = $this->mysql->quote($id); } $query = $this->mysql->prepare('SELECT `id` FROM `' . $this->options['extras']['prefix'] . 'items` WHERE `id` = ' . implode(' OR `id` = ', $database_ids) . ' AND `feed_id` = :feed'); $query->bindValue(':feed', $this->id); if ($query->execute()) { $existing_ids = array(); while ($row = $query->fetchColumn()) { $existing_ids[] = $row; } $new_ids = array_diff($ids, $existing_ids); foreach ($new_ids as $new_id) { if (!($date = $prepared[1][$new_id]->get_date('U'))) { $date = time(); } $query = $this->mysql->prepare('INSERT INTO `' . $this->options['extras']['prefix'] . 'items` (`feed_id`, `id`, `data`, `posted`) VALUES(:feed, :id, :data, :date)'); $query->bindValue(':feed', $this->id); $query->bindValue(':id', $new_id); $query->bindValue(':data', serialize($prepared[1][$new_id]->data)); $query->bindValue(':date', $date); if (!$query->execute()) { return false; } } return true; } } else { return true; } } } else { $query = $this->mysql->prepare('SELECT `id` FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :feed'); $query->bindValue(':feed', $this->id); if ($query->execute()) { if ($query->rowCount() > 0) { $query = $this->mysql->prepare('UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `items` = 0, `data` = :data, `mtime` = :time WHERE `id` = :feed'); $query->bindValue(':data', serialize($data)); $query->bindValue(':time', time()); $query->bindValue(':feed', $this->id); if ($this->execute()) { return true; } } else { $query = $this->mysql->prepare('INSERT INTO `' . $this->options['extras']['prefix'] . 'cache_data` (`id`, `items`, `data`, `mtime`) VALUES(:id, 0, :data, :time)'); $query->bindValue(':id', $this->id); $query->bindValue(':data', serialize($data)); $query->bindValue(':time', time()); if ($query->execute()) { return true; } } } } return false; } /** * Retrieve the data saved to the cache * * @return array Data for SimplePie::$data */ public function load() { if ($this->mysql === null) { return false; } $query = $this->mysql->prepare('SELECT `items`, `data` FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :id'); $query->bindValue(':id', $this->id); if ($query->execute() && ($row = $query->fetch())) { $data = unserialize($row[1]); if (isset($this->options['items'][0])) { $items = (int) $this->options['items'][0]; } else { $items = (int) $row[0]; } if ($items !== 0) { if (isset($data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0])) { $feed =& $data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]; } elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0])) { $feed =& $data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]; } elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0])) { $feed =& $data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]; } elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0])) { $feed =& $data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]; } else { $feed = null; } if ($feed !== null) { $sql = 'SELECT `data` FROM `' . $this->options['extras']['prefix'] . 'items` WHERE `feed_id` = :feed ORDER BY `posted` DESC'; if ($items > 0) { $sql .= ' LIMIT ' . $items; } $query = $this->mysql->prepare($sql); $query->bindValue(':feed', $this->id); if ($query->execute()) { while ($row = $query->fetchColumn()) { $feed['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['entry'][] = unserialize($row); } } else { return false; } } } return $data; } return false; } /** * Retrieve the last modified time for the cache * * @return int Timestamp */ public function mtime() { if ($this->mysql === null) { return false; } $query = $this->mysql->prepare('SELECT `mtime` FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :id'); $query->bindValue(':id', $this->id); if ($query->execute() && ($time = $query->fetchColumn())) { return $time; } else { return false; } } /** * Set the last modified time to the current time * * @return bool Success status */ public function touch() { if ($this->mysql === null) { return false; } $query = $this->mysql->prepare('UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `mtime` = :time WHERE `id` = :id'); $query->bindValue(':time', time()); $query->bindValue(':id', $this->id); if ($query->execute() && $query->rowCount() > 0) { return true; } else { return false; } } /** * Remove the cache * * @return bool Success status */ public function unlink() { if ($this->mysql === null) { return false; } $query = $this->mysql->prepare('DELETE FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :id'); $query->bindValue(':id', $this->id); $query2 = $this->mysql->prepare('DELETE FROM `' . $this->options['extras']['prefix'] . 'items` WHERE `feed_id` = :id'); $query2->bindValue(':id', $this->id); if ($query->execute() && $query2->execute()) { return true; } else { return false; } } } ��������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Caption.php����������������������������������������������0000664�0000000�0000000�00000010636�12266004471�0022361�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Handles `<media:text>` captions as defined in Media RSS. * * Used by {@see SimplePie_Enclosure::get_caption()} and {@see SimplePie_Enclosure::get_captions()} * * This class can be overloaded with {@see SimplePie::set_caption_class()} * * @package SimplePie * @subpackage API */ class SimplePie_Caption { /** * Content type * * @var string * @see get_type() */ var $type; /** * Language * * @var string * @see get_language() */ var $lang; /** * Start time * * @var string * @see get_starttime() */ var $startTime; /** * End time * * @var string * @see get_endtime() */ var $endTime; /** * Caption text * * @var string * @see get_text() */ var $text; /** * Constructor, used to input the data * * For documentation on all the parameters, see the corresponding * properties and their accessors */ public function __construct($type = null, $lang = null, $startTime = null, $endTime = null, $text = null) { $this->type = $type; $this->lang = $lang; $this->startTime = $startTime; $this->endTime = $endTime; $this->text = $text; } /** * String-ified version * * @return string */ public function __toString() { // There is no $this->data here return md5(serialize($this)); } /** * Get the end time * * @return string|null Time in the format 'hh:mm:ss.SSS' */ public function get_endtime() { if ($this->endTime !== null) { return $this->endTime; } else { return null; } } /** * Get the language * * @link http://tools.ietf.org/html/rfc3066 * @return string|null Language code as per RFC 3066 */ public function get_language() { if ($this->lang !== null) { return $this->lang; } else { return null; } } /** * Get the start time * * @return string|null Time in the format 'hh:mm:ss.SSS' */ public function get_starttime() { if ($this->startTime !== null) { return $this->startTime; } else { return null; } } /** * Get the text of the caption * * @return string|null */ public function get_text() { if ($this->text !== null) { return $this->text; } else { return null; } } /** * Get the content type (not MIME type) * * @return string|null Either 'text' or 'html' */ public function get_type() { if ($this->type !== null) { return $this->type; } else { return null; } } } ��������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Category.php���������������������������������������������0000664�0000000�0000000�00000007173�12266004471�0022543�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Manages all category-related data * * Used by {@see SimplePie_Item::get_category()} and {@see SimplePie_Item::get_categories()} * * This class can be overloaded with {@see SimplePie::set_category_class()} * * @package SimplePie * @subpackage API */ class SimplePie_Category { /** * Category identifier * * @var string * @see get_term */ var $term; /** * Categorization scheme identifier * * @var string * @see get_scheme() */ var $scheme; /** * Human readable label * * @var string * @see get_label() */ var $label; /** * Constructor, used to input the data * * @param string $term * @param string $scheme * @param string $label */ public function __construct($term = null, $scheme = null, $label = null) { $this->term = $term; $this->scheme = $scheme; $this->label = $label; } /** * String-ified version * * @return string */ public function __toString() { // There is no $this->data here return md5(serialize($this)); } /** * Get the category identifier * * @return string|null */ public function get_term() { if ($this->term !== null) { return $this->term; } else { return null; } } /** * Get the categorization scheme identifier * * @return string|null */ public function get_scheme() { if ($this->scheme !== null) { return $this->scheme; } else { return null; } } /** * Get the human readable label * * @return string|null */ public function get_label() { if ($this->label !== null) { return $this->label; } else { return $this->get_term(); } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Content/�������������������������������������������������0000775�0000000�0000000�00000000000�12266004471�0021657�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Content/Type/��������������������������������������������0000775�0000000�0000000�00000000000�12266004471�0022600�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Content/Type/Sniffer.php���������������������������������0000664�0000000�0000000�00000017711�12266004471�0024714�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Content-type sniffing * * Based on the rules in http://tools.ietf.org/html/draft-abarth-mime-sniff-06 * * This is used since we can't always trust Content-Type headers, and is based * upon the HTML5 parsing rules. * * * This class can be overloaded with {@see SimplePie::set_content_type_sniffer_class()} * * @package SimplePie * @subpackage HTTP */ class SimplePie_Content_Type_Sniffer { /** * File object * * @var SimplePie_File */ var $file; /** * Create an instance of the class with the input file * * @param SimplePie_Content_Type_Sniffer $file Input file */ public function __construct($file) { $this->file = $file; } /** * Get the Content-Type of the specified file * * @return string Actual Content-Type */ public function get_type() { if (isset($this->file->headers['content-type'])) { if (!isset($this->file->headers['content-encoding']) && ($this->file->headers['content-type'] === 'text/plain' || $this->file->headers['content-type'] === 'text/plain; charset=ISO-8859-1' || $this->file->headers['content-type'] === 'text/plain; charset=iso-8859-1' || $this->file->headers['content-type'] === 'text/plain; charset=UTF-8')) { return $this->text_or_binary(); } if (($pos = strpos($this->file->headers['content-type'], ';')) !== false) { $official = substr($this->file->headers['content-type'], 0, $pos); } else { $official = $this->file->headers['content-type']; } $official = trim(strtolower($official)); if ($official === 'unknown/unknown' || $official === 'application/unknown') { return $this->unknown(); } elseif (substr($official, -4) === '+xml' || $official === 'text/xml' || $official === 'application/xml') { return $official; } elseif (substr($official, 0, 6) === 'image/') { if ($return = $this->image()) { return $return; } else { return $official; } } elseif ($official === 'text/html') { return $this->feed_or_html(); } else { return $official; } } else { return $this->unknown(); } } /** * Sniff text or binary * * @return string Actual Content-Type */ public function text_or_binary() { if (substr($this->file->body, 0, 2) === "\xFE\xFF" || substr($this->file->body, 0, 2) === "\xFF\xFE" || substr($this->file->body, 0, 4) === "\x00\x00\xFE\xFF" || substr($this->file->body, 0, 3) === "\xEF\xBB\xBF") { return 'text/plain'; } elseif (preg_match('/[\x00-\x08\x0E-\x1A\x1C-\x1F]/', $this->file->body)) { return 'application/octect-stream'; } else { return 'text/plain'; } } /** * Sniff unknown * * @return string Actual Content-Type */ public function unknown() { $ws = strspn($this->file->body, "\x09\x0A\x0B\x0C\x0D\x20"); if (strtolower(substr($this->file->body, $ws, 14)) === '<!doctype html' || strtolower(substr($this->file->body, $ws, 5)) === '<html' || strtolower(substr($this->file->body, $ws, 7)) === '<script') { return 'text/html'; } elseif (substr($this->file->body, 0, 5) === '%PDF-') { return 'application/pdf'; } elseif (substr($this->file->body, 0, 11) === '%!PS-Adobe-') { return 'application/postscript'; } elseif (substr($this->file->body, 0, 6) === 'GIF87a' || substr($this->file->body, 0, 6) === 'GIF89a') { return 'image/gif'; } elseif (substr($this->file->body, 0, 8) === "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A") { return 'image/png'; } elseif (substr($this->file->body, 0, 3) === "\xFF\xD8\xFF") { return 'image/jpeg'; } elseif (substr($this->file->body, 0, 2) === "\x42\x4D") { return 'image/bmp'; } elseif (substr($this->file->body, 0, 4) === "\x00\x00\x01\x00") { return 'image/vnd.microsoft.icon'; } else { return $this->text_or_binary(); } } /** * Sniff images * * @return string Actual Content-Type */ public function image() { if (substr($this->file->body, 0, 6) === 'GIF87a' || substr($this->file->body, 0, 6) === 'GIF89a') { return 'image/gif'; } elseif (substr($this->file->body, 0, 8) === "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A") { return 'image/png'; } elseif (substr($this->file->body, 0, 3) === "\xFF\xD8\xFF") { return 'image/jpeg'; } elseif (substr($this->file->body, 0, 2) === "\x42\x4D") { return 'image/bmp'; } elseif (substr($this->file->body, 0, 4) === "\x00\x00\x01\x00") { return 'image/vnd.microsoft.icon'; } else { return false; } } /** * Sniff HTML * * @return string Actual Content-Type */ public function feed_or_html() { $len = strlen($this->file->body); $pos = strspn($this->file->body, "\x09\x0A\x0D\x20"); while ($pos < $len) { switch ($this->file->body[$pos]) { case "\x09": case "\x0A": case "\x0D": case "\x20": $pos += strspn($this->file->body, "\x09\x0A\x0D\x20", $pos); continue 2; case '<': $pos++; break; default: return 'text/html'; } if (substr($this->file->body, $pos, 3) === '!--') { $pos += 3; if ($pos < $len && ($pos = strpos($this->file->body, '-->', $pos)) !== false) { $pos += 3; } else { return 'text/html'; } } elseif (substr($this->file->body, $pos, 1) === '!') { if ($pos < $len && ($pos = strpos($this->file->body, '>', $pos)) !== false) { $pos++; } else { return 'text/html'; } } elseif (substr($this->file->body, $pos, 1) === '?') { if ($pos < $len && ($pos = strpos($this->file->body, '?>', $pos)) !== false) { $pos += 2; } else { return 'text/html'; } } elseif (substr($this->file->body, $pos, 3) === 'rss' || substr($this->file->body, $pos, 7) === 'rdf:RDF') { return 'application/rss+xml'; } elseif (substr($this->file->body, $pos, 4) === 'feed') { return 'application/atom+xml'; } else { return 'text/html'; } } return 'text/html'; } } �������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Copyright.php��������������������������������������������0000664�0000000�0000000�00000006447�12266004471�0022741�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Manages `<media:copyright>` copyright tags as defined in Media RSS * * Used by {@see SimplePie_Enclosure::get_copyright()} * * This class can be overloaded with {@see SimplePie::set_copyright_class()} * * @package SimplePie * @subpackage API */ class SimplePie_Copyright { /** * Copyright URL * * @var string * @see get_url() */ var $url; /** * Attribution * * @var string * @see get_attribution() */ var $label; /** * Constructor, used to input the data * * For documentation on all the parameters, see the corresponding * properties and their accessors */ public function __construct($url = null, $label = null) { $this->url = $url; $this->label = $label; } /** * String-ified version * * @return string */ public function __toString() { // There is no $this->data here return md5(serialize($this)); } /** * Get the copyright URL * * @return string|null URL to copyright information */ public function get_url() { if ($this->url !== null) { return $this->url; } else { return null; } } /** * Get the attribution text * * @return string|null */ public function get_attribution() { if ($this->label !== null) { return $this->label; } else { return null; } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Core.php�������������������������������������������������0000664�0000000�0000000�00000004334�12266004471�0021652�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2009, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * SimplePie class. * * Class for backward compatibility. * * @deprecated Use {@see SimplePie} directly * @package SimplePie * @subpackage API */ class SimplePie_Core extends SimplePie { }����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Credit.php�����������������������������������������������0000664�0000000�0000000�00000007211�12266004471�0022171�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Handles `<media:credit>` as defined in Media RSS * * Used by {@see SimplePie_Enclosure::get_credit()} and {@see SimplePie_Enclosure::get_credits()} * * This class can be overloaded with {@see SimplePie::set_credit_class()} * * @package SimplePie * @subpackage API */ class SimplePie_Credit { /** * Credited role * * @var string * @see get_role() */ var $role; /** * Organizational scheme * * @var string * @see get_scheme() */ var $scheme; /** * Credited name * * @var string * @see get_name() */ var $name; /** * Constructor, used to input the data * * For documentation on all the parameters, see the corresponding * properties and their accessors */ public function __construct($role = null, $scheme = null, $name = null) { $this->role = $role; $this->scheme = $scheme; $this->name = $name; } /** * String-ified version * * @return string */ public function __toString() { // There is no $this->data here return md5(serialize($this)); } /** * Get the role of the person receiving credit * * @return string|null */ public function get_role() { if ($this->role !== null) { return $this->role; } else { return null; } } /** * Get the organizational scheme * * @return string|null */ public function get_scheme() { if ($this->scheme !== null) { return $this->scheme; } else { return null; } } /** * Get the credited person/entity's name * * @return string|null */ public function get_name() { if ($this->name !== null) { return $this->name; } else { return null; } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Decode/��������������������������������������������������0000775�0000000�0000000�00000000000�12266004471�0021430�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Decode/HTML/���������������������������������������������0000775�0000000�0000000�00000000000�12266004471�0022174�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Decode/HTML/Entities.php���������������������������������0000664�0000000�0000000�00000041651�12266004471�0024500�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Decode HTML Entities * * This implements HTML5 as of revision 967 (2007-06-28) * * @deprecated Use DOMDocument instead! * @package SimplePie */ class SimplePie_Decode_HTML_Entities { /** * Data to be parsed * * @access private * @var string */ var $data = ''; /** * Currently consumed bytes * * @access private * @var string */ var $consumed = ''; /** * Position of the current byte being parsed * * @access private * @var int */ var $position = 0; /** * Create an instance of the class with the input data * * @access public * @param string $data Input data */ public function __construct($data) { $this->data = $data; } /** * Parse the input data * * @access public * @return string Output data */ public function parse() { while (($this->position = strpos($this->data, '&', $this->position)) !== false) { $this->consume(); $this->entity(); $this->consumed = ''; } return $this->data; } /** * Consume the next byte * * @access private * @return mixed The next byte, or false, if there is no more data */ public function consume() { if (isset($this->data[$this->position])) { $this->consumed .= $this->data[$this->position]; return $this->data[$this->position++]; } else { return false; } } /** * Consume a range of characters * * @access private * @param string $chars Characters to consume * @return mixed A series of characters that match the range, or false */ public function consume_range($chars) { if ($len = strspn($this->data, $chars, $this->position)) { $data = substr($this->data, $this->position, $len); $this->consumed .= $data; $this->position += $len; return $data; } else { return false; } } /** * Unconsume one byte * * @access private */ public function unconsume() { $this->consumed = substr($this->consumed, 0, -1); $this->position--; } /** * Decode an entity * * @access private */ public function entity() { switch ($this->consume()) { case "\x09": case "\x0A": case "\x0B": case "\x0B": case "\x0C": case "\x20": case "\x3C": case "\x26": case false: break; case "\x23": switch ($this->consume()) { case "\x78": case "\x58": $range = '0123456789ABCDEFabcdef'; $hex = true; break; default: $range = '0123456789'; $hex = false; $this->unconsume(); break; } if ($codepoint = $this->consume_range($range)) { static $windows_1252_specials = array(0x0D => "\x0A", 0x80 => "\xE2\x82\xAC", 0x81 => "\xEF\xBF\xBD", 0x82 => "\xE2\x80\x9A", 0x83 => "\xC6\x92", 0x84 => "\xE2\x80\x9E", 0x85 => "\xE2\x80\xA6", 0x86 => "\xE2\x80\xA0", 0x87 => "\xE2\x80\xA1", 0x88 => "\xCB\x86", 0x89 => "\xE2\x80\xB0", 0x8A => "\xC5\xA0", 0x8B => "\xE2\x80\xB9", 0x8C => "\xC5\x92", 0x8D => "\xEF\xBF\xBD", 0x8E => "\xC5\xBD", 0x8F => "\xEF\xBF\xBD", 0x90 => "\xEF\xBF\xBD", 0x91 => "\xE2\x80\x98", 0x92 => "\xE2\x80\x99", 0x93 => "\xE2\x80\x9C", 0x94 => "\xE2\x80\x9D", 0x95 => "\xE2\x80\xA2", 0x96 => "\xE2\x80\x93", 0x97 => "\xE2\x80\x94", 0x98 => "\xCB\x9C", 0x99 => "\xE2\x84\xA2", 0x9A => "\xC5\xA1", 0x9B => "\xE2\x80\xBA", 0x9C => "\xC5\x93", 0x9D => "\xEF\xBF\xBD", 0x9E => "\xC5\xBE", 0x9F => "\xC5\xB8"); if ($hex) { $codepoint = hexdec($codepoint); } else { $codepoint = intval($codepoint); } if (isset($windows_1252_specials[$codepoint])) { $replacement = $windows_1252_specials[$codepoint]; } else { $replacement = SimplePie_Misc::codepoint_to_utf8($codepoint); } if (!in_array($this->consume(), array(';', false), true)) { $this->unconsume(); } $consumed_length = strlen($this->consumed); $this->data = substr_replace($this->data, $replacement, $this->position - $consumed_length, $consumed_length); $this->position += strlen($replacement) - $consumed_length; } break; default: static $entities = array( 'Aacute' => "\xC3\x81", 'aacute' => "\xC3\xA1", 'Aacute;' => "\xC3\x81", 'aacute;' => "\xC3\xA1", 'Acirc' => "\xC3\x82", 'acirc' => "\xC3\xA2", 'Acirc;' => "\xC3\x82", 'acirc;' => "\xC3\xA2", 'acute' => "\xC2\xB4", 'acute;' => "\xC2\xB4", 'AElig' => "\xC3\x86", 'aelig' => "\xC3\xA6", 'AElig;' => "\xC3\x86", 'aelig;' => "\xC3\xA6", 'Agrave' => "\xC3\x80", 'agrave' => "\xC3\xA0", 'Agrave;' => "\xC3\x80", 'agrave;' => "\xC3\xA0", 'alefsym;' => "\xE2\x84\xB5", 'Alpha;' => "\xCE\x91", 'alpha;' => "\xCE\xB1", 'AMP' => "\x26", 'amp' => "\x26", 'AMP;' => "\x26", 'amp;' => "\x26", 'and;' => "\xE2\x88\xA7", 'ang;' => "\xE2\x88\xA0", 'apos;' => "\x27", 'Aring' => "\xC3\x85", 'aring' => "\xC3\xA5", 'Aring;' => "\xC3\x85", 'aring;' => "\xC3\xA5", 'asymp;' => "\xE2\x89\x88", 'Atilde' => "\xC3\x83", 'atilde' => "\xC3\xA3", 'Atilde;' => "\xC3\x83", 'atilde;' => "\xC3\xA3", 'Auml' => "\xC3\x84", 'auml' => "\xC3\xA4", 'Auml;' => "\xC3\x84", 'auml;' => "\xC3\xA4", 'bdquo;' => "\xE2\x80\x9E", 'Beta;' => "\xCE\x92", 'beta;' => "\xCE\xB2", 'brvbar' => "\xC2\xA6", 'brvbar;' => "\xC2\xA6", 'bull;' => "\xE2\x80\xA2", 'cap;' => "\xE2\x88\xA9", 'Ccedil' => "\xC3\x87", 'ccedil' => "\xC3\xA7", 'Ccedil;' => "\xC3\x87", 'ccedil;' => "\xC3\xA7", 'cedil' => "\xC2\xB8", 'cedil;' => "\xC2\xB8", 'cent' => "\xC2\xA2", 'cent;' => "\xC2\xA2", 'Chi;' => "\xCE\xA7", 'chi;' => "\xCF\x87", 'circ;' => "\xCB\x86", 'clubs;' => "\xE2\x99\xA3", 'cong;' => "\xE2\x89\x85", 'COPY' => "\xC2\xA9", 'copy' => "\xC2\xA9", 'COPY;' => "\xC2\xA9", 'copy;' => "\xC2\xA9", 'crarr;' => "\xE2\x86\xB5", 'cup;' => "\xE2\x88\xAA", 'curren' => "\xC2\xA4", 'curren;' => "\xC2\xA4", 'Dagger;' => "\xE2\x80\xA1", 'dagger;' => "\xE2\x80\xA0", 'dArr;' => "\xE2\x87\x93", 'darr;' => "\xE2\x86\x93", 'deg' => "\xC2\xB0", 'deg;' => "\xC2\xB0", 'Delta;' => "\xCE\x94", 'delta;' => "\xCE\xB4", 'diams;' => "\xE2\x99\xA6", 'divide' => "\xC3\xB7", 'divide;' => "\xC3\xB7", 'Eacute' => "\xC3\x89", 'eacute' => "\xC3\xA9", 'Eacute;' => "\xC3\x89", 'eacute;' => "\xC3\xA9", 'Ecirc' => "\xC3\x8A", 'ecirc' => "\xC3\xAA", 'Ecirc;' => "\xC3\x8A", 'ecirc;' => "\xC3\xAA", 'Egrave' => "\xC3\x88", 'egrave' => "\xC3\xA8", 'Egrave;' => "\xC3\x88", 'egrave;' => "\xC3\xA8", 'empty;' => "\xE2\x88\x85", 'emsp;' => "\xE2\x80\x83", 'ensp;' => "\xE2\x80\x82", 'Epsilon;' => "\xCE\x95", 'epsilon;' => "\xCE\xB5", 'equiv;' => "\xE2\x89\xA1", 'Eta;' => "\xCE\x97", 'eta;' => "\xCE\xB7", 'ETH' => "\xC3\x90", 'eth' => "\xC3\xB0", 'ETH;' => "\xC3\x90", 'eth;' => "\xC3\xB0", 'Euml' => "\xC3\x8B", 'euml' => "\xC3\xAB", 'Euml;' => "\xC3\x8B", 'euml;' => "\xC3\xAB", 'euro;' => "\xE2\x82\xAC", 'exist;' => "\xE2\x88\x83", 'fnof;' => "\xC6\x92", 'forall;' => "\xE2\x88\x80", 'frac12' => "\xC2\xBD", 'frac12;' => "\xC2\xBD", 'frac14' => "\xC2\xBC", 'frac14;' => "\xC2\xBC", 'frac34' => "\xC2\xBE", 'frac34;' => "\xC2\xBE", 'frasl;' => "\xE2\x81\x84", 'Gamma;' => "\xCE\x93", 'gamma;' => "\xCE\xB3", 'ge;' => "\xE2\x89\xA5", 'GT' => "\x3E", 'gt' => "\x3E", 'GT;' => "\x3E", 'gt;' => "\x3E", 'hArr;' => "\xE2\x87\x94", 'harr;' => "\xE2\x86\x94", 'hearts;' => "\xE2\x99\xA5", 'hellip;' => "\xE2\x80\xA6", 'Iacute' => "\xC3\x8D", 'iacute' => "\xC3\xAD", 'Iacute;' => "\xC3\x8D", 'iacute;' => "\xC3\xAD", 'Icirc' => "\xC3\x8E", 'icirc' => "\xC3\xAE", 'Icirc;' => "\xC3\x8E", 'icirc;' => "\xC3\xAE", 'iexcl' => "\xC2\xA1", 'iexcl;' => "\xC2\xA1", 'Igrave' => "\xC3\x8C", 'igrave' => "\xC3\xAC", 'Igrave;' => "\xC3\x8C", 'igrave;' => "\xC3\xAC", 'image;' => "\xE2\x84\x91", 'infin;' => "\xE2\x88\x9E", 'int;' => "\xE2\x88\xAB", 'Iota;' => "\xCE\x99", 'iota;' => "\xCE\xB9", 'iquest' => "\xC2\xBF", 'iquest;' => "\xC2\xBF", 'isin;' => "\xE2\x88\x88", 'Iuml' => "\xC3\x8F", 'iuml' => "\xC3\xAF", 'Iuml;' => "\xC3\x8F", 'iuml;' => "\xC3\xAF", 'Kappa;' => "\xCE\x9A", 'kappa;' => "\xCE\xBA", 'Lambda;' => "\xCE\x9B", 'lambda;' => "\xCE\xBB", 'lang;' => "\xE3\x80\x88", 'laquo' => "\xC2\xAB", 'laquo;' => "\xC2\xAB", 'lArr;' => "\xE2\x87\x90", 'larr;' => "\xE2\x86\x90", 'lceil;' => "\xE2\x8C\x88", 'ldquo;' => "\xE2\x80\x9C", 'le;' => "\xE2\x89\xA4", 'lfloor;' => "\xE2\x8C\x8A", 'lowast;' => "\xE2\x88\x97", 'loz;' => "\xE2\x97\x8A", 'lrm;' => "\xE2\x80\x8E", 'lsaquo;' => "\xE2\x80\xB9", 'lsquo;' => "\xE2\x80\x98", 'LT' => "\x3C", 'lt' => "\x3C", 'LT;' => "\x3C", 'lt;' => "\x3C", 'macr' => "\xC2\xAF", 'macr;' => "\xC2\xAF", 'mdash;' => "\xE2\x80\x94", 'micro' => "\xC2\xB5", 'micro;' => "\xC2\xB5", 'middot' => "\xC2\xB7", 'middot;' => "\xC2\xB7", 'minus;' => "\xE2\x88\x92", 'Mu;' => "\xCE\x9C", 'mu;' => "\xCE\xBC", 'nabla;' => "\xE2\x88\x87", 'nbsp' => "\xC2\xA0", 'nbsp;' => "\xC2\xA0", 'ndash;' => "\xE2\x80\x93", 'ne;' => "\xE2\x89\xA0", 'ni;' => "\xE2\x88\x8B", 'not' => "\xC2\xAC", 'not;' => "\xC2\xAC", 'notin;' => "\xE2\x88\x89", 'nsub;' => "\xE2\x8A\x84", 'Ntilde' => "\xC3\x91", 'ntilde' => "\xC3\xB1", 'Ntilde;' => "\xC3\x91", 'ntilde;' => "\xC3\xB1", 'Nu;' => "\xCE\x9D", 'nu;' => "\xCE\xBD", 'Oacute' => "\xC3\x93", 'oacute' => "\xC3\xB3", 'Oacute;' => "\xC3\x93", 'oacute;' => "\xC3\xB3", 'Ocirc' => "\xC3\x94", 'ocirc' => "\xC3\xB4", 'Ocirc;' => "\xC3\x94", 'ocirc;' => "\xC3\xB4", 'OElig;' => "\xC5\x92", 'oelig;' => "\xC5\x93", 'Ograve' => "\xC3\x92", 'ograve' => "\xC3\xB2", 'Ograve;' => "\xC3\x92", 'ograve;' => "\xC3\xB2", 'oline;' => "\xE2\x80\xBE", 'Omega;' => "\xCE\xA9", 'omega;' => "\xCF\x89", 'Omicron;' => "\xCE\x9F", 'omicron;' => "\xCE\xBF", 'oplus;' => "\xE2\x8A\x95", 'or;' => "\xE2\x88\xA8", 'ordf' => "\xC2\xAA", 'ordf;' => "\xC2\xAA", 'ordm' => "\xC2\xBA", 'ordm;' => "\xC2\xBA", 'Oslash' => "\xC3\x98", 'oslash' => "\xC3\xB8", 'Oslash;' => "\xC3\x98", 'oslash;' => "\xC3\xB8", 'Otilde' => "\xC3\x95", 'otilde' => "\xC3\xB5", 'Otilde;' => "\xC3\x95", 'otilde;' => "\xC3\xB5", 'otimes;' => "\xE2\x8A\x97", 'Ouml' => "\xC3\x96", 'ouml' => "\xC3\xB6", 'Ouml;' => "\xC3\x96", 'ouml;' => "\xC3\xB6", 'para' => "\xC2\xB6", 'para;' => "\xC2\xB6", 'part;' => "\xE2\x88\x82", 'permil;' => "\xE2\x80\xB0", 'perp;' => "\xE2\x8A\xA5", 'Phi;' => "\xCE\xA6", 'phi;' => "\xCF\x86", 'Pi;' => "\xCE\xA0", 'pi;' => "\xCF\x80", 'piv;' => "\xCF\x96", 'plusmn' => "\xC2\xB1", 'plusmn;' => "\xC2\xB1", 'pound' => "\xC2\xA3", 'pound;' => "\xC2\xA3", 'Prime;' => "\xE2\x80\xB3", 'prime;' => "\xE2\x80\xB2", 'prod;' => "\xE2\x88\x8F", 'prop;' => "\xE2\x88\x9D", 'Psi;' => "\xCE\xA8", 'psi;' => "\xCF\x88", 'QUOT' => "\x22", 'quot' => "\x22", 'QUOT;' => "\x22", 'quot;' => "\x22", 'radic;' => "\xE2\x88\x9A", 'rang;' => "\xE3\x80\x89", 'raquo' => "\xC2\xBB", 'raquo;' => "\xC2\xBB", 'rArr;' => "\xE2\x87\x92", 'rarr;' => "\xE2\x86\x92", 'rceil;' => "\xE2\x8C\x89", 'rdquo;' => "\xE2\x80\x9D", 'real;' => "\xE2\x84\x9C", 'REG' => "\xC2\xAE", 'reg' => "\xC2\xAE", 'REG;' => "\xC2\xAE", 'reg;' => "\xC2\xAE", 'rfloor;' => "\xE2\x8C\x8B", 'Rho;' => "\xCE\xA1", 'rho;' => "\xCF\x81", 'rlm;' => "\xE2\x80\x8F", 'rsaquo;' => "\xE2\x80\xBA", 'rsquo;' => "\xE2\x80\x99", 'sbquo;' => "\xE2\x80\x9A", 'Scaron;' => "\xC5\xA0", 'scaron;' => "\xC5\xA1", 'sdot;' => "\xE2\x8B\x85", 'sect' => "\xC2\xA7", 'sect;' => "\xC2\xA7", 'shy' => "\xC2\xAD", 'shy;' => "\xC2\xAD", 'Sigma;' => "\xCE\xA3", 'sigma;' => "\xCF\x83", 'sigmaf;' => "\xCF\x82", 'sim;' => "\xE2\x88\xBC", 'spades;' => "\xE2\x99\xA0", 'sub;' => "\xE2\x8A\x82", 'sube;' => "\xE2\x8A\x86", 'sum;' => "\xE2\x88\x91", 'sup;' => "\xE2\x8A\x83", 'sup1' => "\xC2\xB9", 'sup1;' => "\xC2\xB9", 'sup2' => "\xC2\xB2", 'sup2;' => "\xC2\xB2", 'sup3' => "\xC2\xB3", 'sup3;' => "\xC2\xB3", 'supe;' => "\xE2\x8A\x87", 'szlig' => "\xC3\x9F", 'szlig;' => "\xC3\x9F", 'Tau;' => "\xCE\xA4", 'tau;' => "\xCF\x84", 'there4;' => "\xE2\x88\xB4", 'Theta;' => "\xCE\x98", 'theta;' => "\xCE\xB8", 'thetasym;' => "\xCF\x91", 'thinsp;' => "\xE2\x80\x89", 'THORN' => "\xC3\x9E", 'thorn' => "\xC3\xBE", 'THORN;' => "\xC3\x9E", 'thorn;' => "\xC3\xBE", 'tilde;' => "\xCB\x9C", 'times' => "\xC3\x97", 'times;' => "\xC3\x97", 'TRADE;' => "\xE2\x84\xA2", 'trade;' => "\xE2\x84\xA2", 'Uacute' => "\xC3\x9A", 'uacute' => "\xC3\xBA", 'Uacute;' => "\xC3\x9A", 'uacute;' => "\xC3\xBA", 'uArr;' => "\xE2\x87\x91", 'uarr;' => "\xE2\x86\x91", 'Ucirc' => "\xC3\x9B", 'ucirc' => "\xC3\xBB", 'Ucirc;' => "\xC3\x9B", 'ucirc;' => "\xC3\xBB", 'Ugrave' => "\xC3\x99", 'ugrave' => "\xC3\xB9", 'Ugrave;' => "\xC3\x99", 'ugrave;' => "\xC3\xB9", 'uml' => "\xC2\xA8", 'uml;' => "\xC2\xA8", 'upsih;' => "\xCF\x92", 'Upsilon;' => "\xCE\xA5", 'upsilon;' => "\xCF\x85", 'Uuml' => "\xC3\x9C", 'uuml' => "\xC3\xBC", 'Uuml;' => "\xC3\x9C", 'uuml;' => "\xC3\xBC", 'weierp;' => "\xE2\x84\x98", 'Xi;' => "\xCE\x9E", 'xi;' => "\xCE\xBE", 'Yacute' => "\xC3\x9D", 'yacute' => "\xC3\xBD", 'Yacute;' => "\xC3\x9D", 'yacute;' => "\xC3\xBD", 'yen' => "\xC2\xA5", 'yen;' => "\xC2\xA5", 'yuml' => "\xC3\xBF", 'Yuml;' => "\xC5\xB8", 'yuml;' => "\xC3\xBF", 'Zeta;' => "\xCE\x96", 'zeta;' => "\xCE\xB6", 'zwj;' => "\xE2\x80\x8D", 'zwnj;' => "\xE2\x80\x8C" ); for ($i = 0, $match = null; $i < 9 && $this->consume() !== false; $i++) { $consumed = substr($this->consumed, 1); if (isset($entities[$consumed])) { $match = $consumed; } } if ($match !== null) { $this->data = substr_replace($this->data, $entities[$match], $this->position - strlen($consumed) - 1, strlen($match) + 1); $this->position += strlen($entities[$match]) - strlen($consumed) - 1; } break; } } } ���������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Enclosure.php��������������������������������������������0000664�0000000�0000000�00000065537�12266004471�0022735�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Handles everything related to enclosures (including Media RSS and iTunes RSS) * * Used by {@see SimplePie_Item::get_enclosure()} and {@see SimplePie_Item::get_enclosures()} * * This class can be overloaded with {@see SimplePie::set_enclosure_class()} * * @package SimplePie * @subpackage API */ class SimplePie_Enclosure { /** * @var string * @see get_bitrate() */ var $bitrate; /** * @var array * @see get_captions() */ var $captions; /** * @var array * @see get_categories() */ var $categories; /** * @var int * @see get_channels() */ var $channels; /** * @var SimplePie_Copyright * @see get_copyright() */ var $copyright; /** * @var array * @see get_credits() */ var $credits; /** * @var string * @see get_description() */ var $description; /** * @var int * @see get_duration() */ var $duration; /** * @var string * @see get_expression() */ var $expression; /** * @var string * @see get_framerate() */ var $framerate; /** * @var string * @see get_handler() */ var $handler; /** * @var array * @see get_hashes() */ var $hashes; /** * @var string * @see get_height() */ var $height; /** * @deprecated * @var null */ var $javascript; /** * @var array * @see get_keywords() */ var $keywords; /** * @var string * @see get_language() */ var $lang; /** * @var string * @see get_length() */ var $length; /** * @var string * @see get_link() */ var $link; /** * @var string * @see get_medium() */ var $medium; /** * @var string * @see get_player() */ var $player; /** * @var array * @see get_ratings() */ var $ratings; /** * @var array * @see get_restrictions() */ var $restrictions; /** * @var string * @see get_sampling_rate() */ var $samplingrate; /** * @var array * @see get_thumbnails() */ var $thumbnails; /** * @var string * @see get_title() */ var $title; /** * @var string * @see get_type() */ var $type; /** * @var string * @see get_width() */ var $width; /** * Constructor, used to input the data * * For documentation on all the parameters, see the corresponding * properties and their accessors * * @uses idna_convert If available, this will convert an IDN */ public function __construct($link = null, $type = null, $length = null, $javascript = null, $bitrate = null, $captions = null, $categories = null, $channels = null, $copyright = null, $credits = null, $description = null, $duration = null, $expression = null, $framerate = null, $hashes = null, $height = null, $keywords = null, $lang = null, $medium = null, $player = null, $ratings = null, $restrictions = null, $samplingrate = null, $thumbnails = null, $title = null, $width = null) { $this->bitrate = $bitrate; $this->captions = $captions; $this->categories = $categories; $this->channels = $channels; $this->copyright = $copyright; $this->credits = $credits; $this->description = $description; $this->duration = $duration; $this->expression = $expression; $this->framerate = $framerate; $this->hashes = $hashes; $this->height = $height; $this->keywords = $keywords; $this->lang = $lang; $this->length = $length; $this->link = $link; $this->medium = $medium; $this->player = $player; $this->ratings = $ratings; $this->restrictions = $restrictions; $this->samplingrate = $samplingrate; $this->thumbnails = $thumbnails; $this->title = $title; $this->type = $type; $this->width = $width; if (class_exists('idna_convert')) { $idn = new idna_convert(); $parsed = SimplePie_Misc::parse_url($link); $this->link = SimplePie_Misc::compress_parse_url($parsed['scheme'], $idn->encode($parsed['authority']), $parsed['path'], $parsed['query'], $parsed['fragment']); } $this->handler = $this->get_handler(); // Needs to load last } /** * String-ified version * * @return string */ public function __toString() { // There is no $this->data here return md5(serialize($this)); } /** * Get the bitrate * * @return string|null */ public function get_bitrate() { if ($this->bitrate !== null) { return $this->bitrate; } else { return null; } } /** * Get a single caption * * @param int $key * @return SimplePie_Caption|null */ public function get_caption($key = 0) { $captions = $this->get_captions(); if (isset($captions[$key])) { return $captions[$key]; } else { return null; } } /** * Get all captions * * @return array|null Array of {@see SimplePie_Caption} objects */ public function get_captions() { if ($this->captions !== null) { return $this->captions; } else { return null; } } /** * Get a single category * * @param int $key * @return SimplePie_Category|null */ public function get_category($key = 0) { $categories = $this->get_categories(); if (isset($categories[$key])) { return $categories[$key]; } else { return null; } } /** * Get all categories * * @return array|null Array of {@see SimplePie_Category} objects */ public function get_categories() { if ($this->categories !== null) { return $this->categories; } else { return null; } } /** * Get the number of audio channels * * @return int|null */ public function get_channels() { if ($this->channels !== null) { return $this->channels; } else { return null; } } /** * Get the copyright information * * @return SimplePie_Copyright|null */ public function get_copyright() { if ($this->copyright !== null) { return $this->copyright; } else { return null; } } /** * Get a single credit * * @param int $key * @return SimplePie_Credit|null */ public function get_credit($key = 0) { $credits = $this->get_credits(); if (isset($credits[$key])) { return $credits[$key]; } else { return null; } } /** * Get all credits * * @return array|null Array of {@see SimplePie_Credit} objects */ public function get_credits() { if ($this->credits !== null) { return $this->credits; } else { return null; } } /** * Get the description of the enclosure * * @return string|null */ public function get_description() { if ($this->description !== null) { return $this->description; } else { return null; } } /** * Get the duration of the enclosure * * @param string $convert Convert seconds into hh:mm:ss * @return string|int|null 'hh:mm:ss' string if `$convert` was specified, otherwise integer (or null if none found) */ public function get_duration($convert = false) { if ($this->duration !== null) { if ($convert) { $time = SimplePie_Misc::time_hms($this->duration); return $time; } else { return $this->duration; } } else { return null; } } /** * Get the expression * * @return string Probably one of 'sample', 'full', 'nonstop', 'clip'. Defaults to 'full' */ public function get_expression() { if ($this->expression !== null) { return $this->expression; } else { return 'full'; } } /** * Get the file extension * * @return string|null */ public function get_extension() { if ($this->link !== null) { $url = SimplePie_Misc::parse_url($this->link); if ($url['path'] !== '') { return pathinfo($url['path'], PATHINFO_EXTENSION); } } return null; } /** * Get the framerate (in frames-per-second) * * @return string|null */ public function get_framerate() { if ($this->framerate !== null) { return $this->framerate; } else { return null; } } /** * Get the preferred handler * * @return string|null One of 'flash', 'fmedia', 'quicktime', 'wmedia', 'mp3' */ public function get_handler() { return $this->get_real_type(true); } /** * Get a single hash * * @link http://www.rssboard.org/media-rss#media-hash * @param int $key * @return string|null Hash as per `media:hash`, prefixed with "$algo:" */ public function get_hash($key = 0) { $hashes = $this->get_hashes(); if (isset($hashes[$key])) { return $hashes[$key]; } else { return null; } } /** * Get all credits * * @return array|null Array of strings, see {@see get_hash()} */ public function get_hashes() { if ($this->hashes !== null) { return $this->hashes; } else { return null; } } /** * Get the height * * @return string|null */ public function get_height() { if ($this->height !== null) { return $this->height; } else { return null; } } /** * Get the language * * @link http://tools.ietf.org/html/rfc3066 * @return string|null Language code as per RFC 3066 */ public function get_language() { if ($this->lang !== null) { return $this->lang; } else { return null; } } /** * Get a single keyword * * @param int $key * @return string|null */ public function get_keyword($key = 0) { $keywords = $this->get_keywords(); if (isset($keywords[$key])) { return $keywords[$key]; } else { return null; } } /** * Get all keywords * * @return array|null Array of strings */ public function get_keywords() { if ($this->keywords !== null) { return $this->keywords; } else { return null; } } /** * Get length * * @return float Length in bytes */ public function get_length() { if ($this->length !== null) { return $this->length; } else { return null; } } /** * Get the URL * * @return string|null */ public function get_link() { if ($this->link !== null) { return urldecode($this->link); } else { return null; } } /** * Get the medium * * @link http://www.rssboard.org/media-rss#media-content * @return string|null Should be one of 'image', 'audio', 'video', 'document', 'executable' */ public function get_medium() { if ($this->medium !== null) { return $this->medium; } else { return null; } } /** * Get the player URL * * Typically the same as {@see get_permalink()} * @return string|null Player URL */ public function get_player() { if ($this->player !== null) { return $this->player; } else { return null; } } /** * Get a single rating * * @param int $key * @return SimplePie_Rating|null */ public function get_rating($key = 0) { $ratings = $this->get_ratings(); if (isset($ratings[$key])) { return $ratings[$key]; } else { return null; } } /** * Get all ratings * * @return array|null Array of {@see SimplePie_Rating} objects */ public function get_ratings() { if ($this->ratings !== null) { return $this->ratings; } else { return null; } } /** * Get a single restriction * * @param int $key * @return SimplePie_Restriction|null */ public function get_restriction($key = 0) { $restrictions = $this->get_restrictions(); if (isset($restrictions[$key])) { return $restrictions[$key]; } else { return null; } } /** * Get all restrictions * * @return array|null Array of {@see SimplePie_Restriction} objects */ public function get_restrictions() { if ($this->restrictions !== null) { return $this->restrictions; } else { return null; } } /** * Get the sampling rate (in kHz) * * @return string|null */ public function get_sampling_rate() { if ($this->samplingrate !== null) { return $this->samplingrate; } else { return null; } } /** * Get the file size (in MiB) * * @return float|null File size in mebibytes (1048 bytes) */ public function get_size() { $length = $this->get_length(); if ($length !== null) { return round($length/1048576, 2); } else { return null; } } /** * Get a single thumbnail * * @param int $key * @return string|null Thumbnail URL */ public function get_thumbnail($key = 0) { $thumbnails = $this->get_thumbnails(); if (isset($thumbnails[$key])) { return $thumbnails[$key]; } else { return null; } } /** * Get all thumbnails * * @return array|null Array of thumbnail URLs */ public function get_thumbnails() { if ($this->thumbnails !== null) { return $this->thumbnails; } else { return null; } } /** * Get the title * * @return string|null */ public function get_title() { if ($this->title !== null) { return $this->title; } else { return null; } } /** * Get mimetype of the enclosure * * @see get_real_type() * @return string|null MIME type */ public function get_type() { if ($this->type !== null) { return $this->type; } else { return null; } } /** * Get the width * * @return string|null */ public function get_width() { if ($this->width !== null) { return $this->width; } else { return null; } } /** * Embed the enclosure using `<embed>` * * @deprecated Use the second parameter to {@see embed} instead * * @param array|string $options See first paramter to {@see embed} * @return string HTML string to output */ public function native_embed($options='') { return $this->embed($options, true); } /** * Embed the enclosure using Javascript * * `$options` is an array or comma-separated key:value string, with the * following properties: * * - `alt` (string): Alternate content for when an end-user does not have * the appropriate handler installed or when a file type is * unsupported. Can be any text or HTML. Defaults to blank. * - `altclass` (string): If a file type is unsupported, the end-user will * see the alt text (above) linked directly to the content. That link * will have this value as its class name. Defaults to blank. * - `audio` (string): This is an image that should be used as a * placeholder for audio files before they're loaded (QuickTime-only). * Can be any relative or absolute URL. Defaults to blank. * - `bgcolor` (string): The background color for the media, if not * already transparent. Defaults to `#ffffff`. * - `height` (integer): The height of the embedded media. Accepts any * numeric pixel value (such as `360`) or `auto`. Defaults to `auto`, * and it is recommended that you use this default. * - `loop` (boolean): Do you want the media to loop when its done? * Defaults to `false`. * - `mediaplayer` (string): The location of the included * `mediaplayer.swf` file. This allows for the playback of Flash Video * (`.flv`) files, and is the default handler for non-Odeo MP3's. * Defaults to blank. * - `video` (string): This is an image that should be used as a * placeholder for video files before they're loaded (QuickTime-only). * Can be any relative or absolute URL. Defaults to blank. * - `width` (integer): The width of the embedded media. Accepts any * numeric pixel value (such as `480`) or `auto`. Defaults to `auto`, * and it is recommended that you use this default. * - `widescreen` (boolean): Is the enclosure widescreen or standard? * This applies only to video enclosures, and will automatically resize * the content appropriately. Defaults to `false`, implying 4:3 mode. * * Note: Non-widescreen (4:3) mode with `width` and `height` set to `auto` * will default to 480x360 video resolution. Widescreen (16:9) mode with * `width` and `height` set to `auto` will default to 480x270 video resolution. * * @todo If the dimensions for media:content are defined, use them when width/height are set to 'auto'. * @param array|string $options Comma-separated key:value list, or array * @param bool $native Use `<embed>` * @return string HTML string to output */ public function embed($options = '', $native = false) { // Set up defaults $audio = ''; $video = ''; $alt = ''; $altclass = ''; $loop = 'false'; $width = 'auto'; $height = 'auto'; $bgcolor = '#ffffff'; $mediaplayer = ''; $widescreen = false; $handler = $this->get_handler(); $type = $this->get_real_type(); // Process options and reassign values as necessary if (is_array($options)) { extract($options); } else { $options = explode(',', $options); foreach($options as $option) { $opt = explode(':', $option, 2); if (isset($opt[0], $opt[1])) { $opt[0] = trim($opt[0]); $opt[1] = trim($opt[1]); switch ($opt[0]) { case 'audio': $audio = $opt[1]; break; case 'video': $video = $opt[1]; break; case 'alt': $alt = $opt[1]; break; case 'altclass': $altclass = $opt[1]; break; case 'loop': $loop = $opt[1]; break; case 'width': $width = $opt[1]; break; case 'height': $height = $opt[1]; break; case 'bgcolor': $bgcolor = $opt[1]; break; case 'mediaplayer': $mediaplayer = $opt[1]; break; case 'widescreen': $widescreen = $opt[1]; break; } } } } $mime = explode('/', $type, 2); $mime = $mime[0]; // Process values for 'auto' if ($width === 'auto') { if ($mime === 'video') { if ($height === 'auto') { $width = 480; } elseif ($widescreen) { $width = round((intval($height)/9)*16); } else { $width = round((intval($height)/3)*4); } } else { $width = '100%'; } } if ($height === 'auto') { if ($mime === 'audio') { $height = 0; } elseif ($mime === 'video') { if ($width === 'auto') { if ($widescreen) { $height = 270; } else { $height = 360; } } elseif ($widescreen) { $height = round((intval($width)/16)*9); } else { $height = round((intval($width)/4)*3); } } else { $height = 376; } } elseif ($mime === 'audio') { $height = 0; } // Set proper placeholder value if ($mime === 'audio') { $placeholder = $audio; } elseif ($mime === 'video') { $placeholder = $video; } $embed = ''; // Flash if ($handler === 'flash') { if ($native) { $embed .= "<embed src=\"" . $this->get_link() . "\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"$type\" quality=\"high\" width=\"$width\" height=\"$height\" bgcolor=\"$bgcolor\" loop=\"$loop\"></embed>"; } else { $embed .= "<script type='text/javascript'>embed_flash('$bgcolor', '$width', '$height', '" . $this->get_link() . "', '$loop', '$type');</script>"; } } // Flash Media Player file types. // Preferred handler for MP3 file types. elseif ($handler === 'fmedia' || ($handler === 'mp3' && $mediaplayer !== '')) { $height += 20; if ($native) { $embed .= "<embed src=\"$mediaplayer\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" quality=\"high\" width=\"$width\" height=\"$height\" wmode=\"transparent\" flashvars=\"file=" . rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension()) . "&autostart=false&repeat=$loop&showdigits=true&showfsbutton=false\"></embed>"; } else { $embed .= "<script type='text/javascript'>embed_flv('$width', '$height', '" . rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension()) . "', '$placeholder', '$loop', '$mediaplayer');</script>"; } } // QuickTime 7 file types. Need to test with QuickTime 6. // Only handle MP3's if the Flash Media Player is not present. elseif ($handler === 'quicktime' || ($handler === 'mp3' && $mediaplayer === '')) { $height += 16; if ($native) { if ($placeholder !== '') { $embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" href=\"" . $this->get_link() . "\" src=\"$placeholder\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"false\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>"; } else { $embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" src=\"" . $this->get_link() . "\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"true\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>"; } } else { $embed .= "<script type='text/javascript'>embed_quicktime('$type', '$bgcolor', '$width', '$height', '" . $this->get_link() . "', '$placeholder', '$loop');</script>"; } } // Windows Media elseif ($handler === 'wmedia') { $height += 45; if ($native) { $embed .= "<embed type=\"application/x-mplayer2\" src=\"" . $this->get_link() . "\" autosize=\"1\" width=\"$width\" height=\"$height\" showcontrols=\"1\" showstatusbar=\"0\" showdisplay=\"0\" autostart=\"0\"></embed>"; } else { $embed .= "<script type='text/javascript'>embed_wmedia('$width', '$height', '" . $this->get_link() . "');</script>"; } } // Everything else else $embed .= '<a href="' . $this->get_link() . '" class="' . $altclass . '">' . $alt . '</a>'; return $embed; } /** * Get the real media type * * Often, feeds lie to us, necessitating a bit of deeper inspection. This * converts types to their canonical representations based on the file * extension * * @see get_type() * @param bool $find_handler Internal use only, use {@see get_handler()} instead * @return string MIME type */ public function get_real_type($find_handler = false) { // Mime-types by handler. $types_flash = array('application/x-shockwave-flash', 'application/futuresplash'); // Flash $types_fmedia = array('video/flv', 'video/x-flv','flv-application/octet-stream'); // Flash Media Player $types_quicktime = array('audio/3gpp', 'audio/3gpp2', 'audio/aac', 'audio/x-aac', 'audio/aiff', 'audio/x-aiff', 'audio/mid', 'audio/midi', 'audio/x-midi', 'audio/mp4', 'audio/m4a', 'audio/x-m4a', 'audio/wav', 'audio/x-wav', 'video/3gpp', 'video/3gpp2', 'video/m4v', 'video/x-m4v', 'video/mp4', 'video/mpeg', 'video/x-mpeg', 'video/quicktime', 'video/sd-video'); // QuickTime $types_wmedia = array('application/asx', 'application/x-mplayer2', 'audio/x-ms-wma', 'audio/x-ms-wax', 'video/x-ms-asf-plugin', 'video/x-ms-asf', 'video/x-ms-wm', 'video/x-ms-wmv', 'video/x-ms-wvx'); // Windows Media $types_mp3 = array('audio/mp3', 'audio/x-mp3', 'audio/mpeg', 'audio/x-mpeg'); // MP3 if ($this->get_type() !== null) { $type = strtolower($this->type); } else { $type = null; } // If we encounter an unsupported mime-type, check the file extension and guess intelligently. if (!in_array($type, array_merge($types_flash, $types_fmedia, $types_quicktime, $types_wmedia, $types_mp3))) { switch (strtolower($this->get_extension())) { // Audio mime-types case 'aac': case 'adts': $type = 'audio/acc'; break; case 'aif': case 'aifc': case 'aiff': case 'cdda': $type = 'audio/aiff'; break; case 'bwf': $type = 'audio/wav'; break; case 'kar': case 'mid': case 'midi': case 'smf': $type = 'audio/midi'; break; case 'm4a': $type = 'audio/x-m4a'; break; case 'mp3': case 'swa': $type = 'audio/mp3'; break; case 'wav': $type = 'audio/wav'; break; case 'wax': $type = 'audio/x-ms-wax'; break; case 'wma': $type = 'audio/x-ms-wma'; break; // Video mime-types case '3gp': case '3gpp': $type = 'video/3gpp'; break; case '3g2': case '3gp2': $type = 'video/3gpp2'; break; case 'asf': $type = 'video/x-ms-asf'; break; case 'flv': $type = 'video/x-flv'; break; case 'm1a': case 'm1s': case 'm1v': case 'm15': case 'm75': case 'mp2': case 'mpa': case 'mpeg': case 'mpg': case 'mpm': case 'mpv': $type = 'video/mpeg'; break; case 'm4v': $type = 'video/x-m4v'; break; case 'mov': case 'qt': $type = 'video/quicktime'; break; case 'mp4': case 'mpg4': $type = 'video/mp4'; break; case 'sdv': $type = 'video/sd-video'; break; case 'wm': $type = 'video/x-ms-wm'; break; case 'wmv': $type = 'video/x-ms-wmv'; break; case 'wvx': $type = 'video/x-ms-wvx'; break; // Flash mime-types case 'spl': $type = 'application/futuresplash'; break; case 'swf': $type = 'application/x-shockwave-flash'; break; } } if ($find_handler) { if (in_array($type, $types_flash)) { return 'flash'; } elseif (in_array($type, $types_fmedia)) { return 'fmedia'; } elseif (in_array($type, $types_quicktime)) { return 'quicktime'; } elseif (in_array($type, $types_wmedia)) { return 'wmedia'; } elseif (in_array($type, $types_mp3)) { return 'mp3'; } else { return null; } } else { return $type; } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Exception.php��������������������������������������������0000664�0000000�0000000�00000004213�12266004471�0022714�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.4-dev * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * General SimplePie exception class * * @package SimplePie */ class SimplePie_Exception extends Exception { }�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/File.php�������������������������������������������������0000664�0000000�0000000�00000023465�12266004471�0021647�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Used for fetching remote files and reading local files * * Supports HTTP 1.0 via cURL or fsockopen, with spotty HTTP 1.1 support * * This class can be overloaded with {@see SimplePie::set_file_class()} * * @package SimplePie * @subpackage HTTP * @todo Move to properly supporting RFC2616 (HTTP/1.1) */ class SimplePie_File { var $url; var $useragent; var $success = true; var $headers = array(); var $body; var $status_code; var $redirects = 0; var $error; var $method = SIMPLEPIE_FILE_SOURCE_NONE; public function __construct($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false) { /// Patch GLPI global $CFG_GLPI; if (class_exists('idna_convert')) { $idn = new idna_convert(); $parsed = SimplePie_Misc::parse_url($url); $url = SimplePie_Misc::compress_parse_url($parsed['scheme'], $idn->encode($parsed['authority']), $parsed['path'], $parsed['query'], $parsed['fragment']); } $this->url = $url; $this->useragent = $useragent; if (preg_match('/^http(s)?:\/\//i', $url)) { if ($useragent === null) { $useragent = ini_get('user_agent'); $this->useragent = $useragent; } if (!is_array($headers)) { $headers = array(); } if (!$force_fsockopen && function_exists('curl_exec')) { $this->method = SIMPLEPIE_FILE_SOURCE_REMOTE | SIMPLEPIE_FILE_SOURCE_CURL; $fp = curl_init(); $headers2 = array(); foreach ($headers as $key => $value) { $headers2[] = "$key: $value"; } if (version_compare(SimplePie_Misc::get_curl_version(), '7.10.5', '>=')) { curl_setopt($fp, CURLOPT_ENCODING, ''); } curl_setopt($fp, CURLOPT_URL, $url); curl_setopt($fp, CURLOPT_HEADER, 1); curl_setopt($fp, CURLOPT_RETURNTRANSFER, 1); curl_setopt($fp, CURLOPT_TIMEOUT, $timeout); curl_setopt($fp, CURLOPT_CONNECTTIMEOUT, $timeout); curl_setopt($fp, CURLOPT_REFERER, $url); curl_setopt($fp, CURLOPT_USERAGENT, $useragent); curl_setopt($fp, CURLOPT_HTTPHEADER, $headers2); /// Patch GLPI if (!empty($CFG_GLPI["proxy_name"])) { curl_setopt($fp, CURLOPT_PROXY, $CFG_GLPI["proxy_name"]); curl_setopt($fp, CURLOPT_PROXYPORT, $CFG_GLPI["proxy_port"]); } if (!ini_get('open_basedir') && !ini_get('safe_mode') && version_compare(SimplePie_Misc::get_curl_version(), '7.15.2', '>=')) { curl_setopt($fp, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($fp, CURLOPT_MAXREDIRS, $redirects); } $this->headers = curl_exec($fp); if (curl_errno($fp) === 23 || curl_errno($fp) === 61) { curl_setopt($fp, CURLOPT_ENCODING, 'none'); $this->headers = curl_exec($fp); } if (curl_errno($fp)) { $this->error = 'cURL error ' . curl_errno($fp) . ': ' . curl_error($fp); $this->success = false; } else { $info = curl_getinfo($fp); curl_close($fp); $this->headers = explode("\r\n\r\n", $this->headers, $info['redirect_count'] + 1); $this->headers = array_pop($this->headers); $parser = new SimplePie_HTTP_Parser($this->headers); if ($parser->parse()) { $this->headers = $parser->headers; $this->body = $parser->body; $this->status_code = $parser->status_code; if ((in_array($this->status_code, array(300, 301, 302, 303, 307)) || $this->status_code > 307 && $this->status_code < 400) && isset($this->headers['location']) && $this->redirects < $redirects) { $this->redirects++; $location = SimplePie_Misc::absolutize_url($this->headers['location'], $url); return $this->__construct($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen); } } } } else { $this->method = SIMPLEPIE_FILE_SOURCE_REMOTE | SIMPLEPIE_FILE_SOURCE_FSOCKOPEN; $url_parts = parse_url($url); $socket_host = $url_parts['host']; if (isset($url_parts['scheme']) && strtolower($url_parts['scheme']) === 'https') { $socket_host = "ssl://$url_parts[host]"; $url_parts['port'] = 443; } if (!isset($url_parts['port'])) { $url_parts['port'] = 80; } $fp = @fsockopen($socket_host, $url_parts['port'], $errno, $errstr, $timeout); if (!$fp) { $this->error = 'fsockopen error: ' . $errstr; $this->success = false; } else { stream_set_timeout($fp, $timeout); if (isset($url_parts['path'])) { if (isset($url_parts['query'])) { $get = "$url_parts[path]?$url_parts[query]"; } else { $get = $url_parts['path']; } } else { $get = '/'; } $out = "GET $get HTTP/1.1\r\n"; $out .= "Host: $url_parts[host]\r\n"; $out .= "User-Agent: $useragent\r\n"; if (extension_loaded('zlib')) { $out .= "Accept-Encoding: x-gzip,gzip,deflate\r\n"; } if (isset($url_parts['user']) && isset($url_parts['pass'])) { $out .= "Authorization: Basic " . base64_encode("$url_parts[user]:$url_parts[pass]") . "\r\n"; } foreach ($headers as $key => $value) { $out .= "$key: $value\r\n"; } $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); $info = stream_get_meta_data($fp); $this->headers = ''; while (!$info['eof'] && !$info['timed_out']) { $this->headers .= fread($fp, 1160); $info = stream_get_meta_data($fp); } if (!$info['timed_out']) { $parser = new SimplePie_HTTP_Parser($this->headers); if ($parser->parse()) { $this->headers = $parser->headers; $this->body = $parser->body; $this->status_code = $parser->status_code; if ((in_array($this->status_code, array(300, 301, 302, 303, 307)) || $this->status_code > 307 && $this->status_code < 400) && isset($this->headers['location']) && $this->redirects < $redirects) { $this->redirects++; $location = SimplePie_Misc::absolutize_url($this->headers['location'], $url); return $this->__construct($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen); } if (isset($this->headers['content-encoding'])) { // Hey, we act dumb elsewhere, so let's do that here too switch (strtolower(trim($this->headers['content-encoding'], "\x09\x0A\x0D\x20"))) { case 'gzip': case 'x-gzip': $decoder = new SimplePie_gzdecode($this->body); if (!$decoder->parse()) { $this->error = 'Unable to decode HTTP "gzip" stream'; $this->success = false; } else { $this->body = $decoder->data; } break; case 'deflate': if (($decompressed = gzinflate($this->body)) !== false) { $this->body = $decompressed; } else if (($decompressed = gzuncompress($this->body)) !== false) { $this->body = $decompressed; } else if (function_exists('gzdecode') && ($decompressed = gzdecode($this->body)) !== false) { $this->body = $decompressed; } else { $this->error = 'Unable to decode HTTP "deflate" stream'; $this->success = false; } break; default: $this->error = 'Unknown content coding'; $this->success = false; } } } } else { $this->error = 'fsocket timed out'; $this->success = false; } fclose($fp); } } } else { $this->method = SIMPLEPIE_FILE_SOURCE_LOCAL | SIMPLEPIE_FILE_SOURCE_FILE_GET_CONTENTS; if (!$this->body = file_get_contents($url)) { $this->error = 'file_get_contents could not read the file'; $this->success = false; } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/HTTP/����������������������������������������������������0000775�0000000�0000000�00000000000�12266004471�0021024�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/HTTP/Parser.php������������������������������������������0000664�0000000�0000000�00000025202�12266004471�0022772�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * HTTP Response Parser * * @package SimplePie * @subpackage HTTP */ class SimplePie_HTTP_Parser { /** * HTTP Version * * @var float */ public $http_version = 0.0; /** * Status code * * @var int */ public $status_code = 0; /** * Reason phrase * * @var string */ public $reason = ''; /** * Key/value pairs of the headers * * @var array */ public $headers = array(); /** * Body of the response * * @var string */ public $body = ''; /** * Current state of the state machine * * @var string */ protected $state = 'http_version'; /** * Input data * * @var string */ protected $data = ''; /** * Input data length (to avoid calling strlen() everytime this is needed) * * @var int */ protected $data_length = 0; /** * Current position of the pointer * * @var int */ protected $position = 0; /** * Name of the hedaer currently being parsed * * @var string */ protected $name = ''; /** * Value of the hedaer currently being parsed * * @var string */ protected $value = ''; /** * Create an instance of the class with the input data * * @param string $data Input data */ public function __construct($data) { $this->data = $data; $this->data_length = strlen($this->data); } /** * Parse the input data * * @return bool true on success, false on failure */ public function parse() { while ($this->state && $this->state !== 'emit' && $this->has_data()) { $state = $this->state; $this->$state(); } $this->data = ''; if ($this->state === 'emit' || $this->state === 'body') { return true; } else { $this->http_version = ''; $this->status_code = ''; $this->reason = ''; $this->headers = array(); $this->body = ''; return false; } } /** * Check whether there is data beyond the pointer * * @return bool true if there is further data, false if not */ protected function has_data() { return (bool) ($this->position < $this->data_length); } /** * See if the next character is LWS * * @return bool true if the next character is LWS, false if not */ protected function is_linear_whitespace() { return (bool) ($this->data[$this->position] === "\x09" || $this->data[$this->position] === "\x20" || ($this->data[$this->position] === "\x0A" && isset($this->data[$this->position + 1]) && ($this->data[$this->position + 1] === "\x09" || $this->data[$this->position + 1] === "\x20"))); } /** * Parse the HTTP version */ protected function http_version() { if (strpos($this->data, "\x0A") !== false && strtoupper(substr($this->data, 0, 5)) === 'HTTP/') { $len = strspn($this->data, '0123456789.', 5); $this->http_version = substr($this->data, 5, $len); $this->position += 5 + $len; if (substr_count($this->http_version, '.') <= 1) { $this->http_version = (float) $this->http_version; $this->position += strspn($this->data, "\x09\x20", $this->position); $this->state = 'status'; } else { $this->state = false; } } else { $this->state = false; } } /** * Parse the status code */ protected function status() { if ($len = strspn($this->data, '0123456789', $this->position)) { $this->status_code = (int) substr($this->data, $this->position, $len); $this->position += $len; $this->state = 'reason'; } else { $this->state = false; } } /** * Parse the reason phrase */ protected function reason() { $len = strcspn($this->data, "\x0A", $this->position); $this->reason = trim(substr($this->data, $this->position, $len), "\x09\x0D\x20"); $this->position += $len + 1; $this->state = 'new_line'; } /** * Deal with a new line, shifting data around as needed */ protected function new_line() { $this->value = trim($this->value, "\x0D\x20"); if ($this->name !== '' && $this->value !== '') { $this->name = strtolower($this->name); // We should only use the last Content-Type header. c.f. issue #1 if (isset($this->headers[$this->name]) && $this->name !== 'content-type') { $this->headers[$this->name] .= ', ' . $this->value; } else { $this->headers[$this->name] = $this->value; } } $this->name = ''; $this->value = ''; if (substr($this->data[$this->position], 0, 2) === "\x0D\x0A") { $this->position += 2; $this->state = 'body'; } elseif ($this->data[$this->position] === "\x0A") { $this->position++; $this->state = 'body'; } else { $this->state = 'name'; } } /** * Parse a header name */ protected function name() { $len = strcspn($this->data, "\x0A:", $this->position); if (isset($this->data[$this->position + $len])) { if ($this->data[$this->position + $len] === "\x0A") { $this->position += $len; $this->state = 'new_line'; } else { $this->name = substr($this->data, $this->position, $len); $this->position += $len + 1; $this->state = 'value'; } } else { $this->state = false; } } /** * Parse LWS, replacing consecutive LWS characters with a single space */ protected function linear_whitespace() { do { if (substr($this->data, $this->position, 2) === "\x0D\x0A") { $this->position += 2; } elseif ($this->data[$this->position] === "\x0A") { $this->position++; } $this->position += strspn($this->data, "\x09\x20", $this->position); } while ($this->has_data() && $this->is_linear_whitespace()); $this->value .= "\x20"; } /** * See what state to move to while within non-quoted header values */ protected function value() { if ($this->is_linear_whitespace()) { $this->linear_whitespace(); } else { switch ($this->data[$this->position]) { case '"': // Workaround for ETags: we have to include the quotes as // part of the tag. if (strtolower($this->name) === 'etag') { $this->value .= '"'; $this->position++; $this->state = 'value_char'; break; } $this->position++; $this->state = 'quote'; break; case "\x0A": $this->position++; $this->state = 'new_line'; break; default: $this->state = 'value_char'; break; } } } /** * Parse a header value while outside quotes */ protected function value_char() { $len = strcspn($this->data, "\x09\x20\x0A\"", $this->position); $this->value .= substr($this->data, $this->position, $len); $this->position += $len; $this->state = 'value'; } /** * See what state to move to while within quoted header values */ protected function quote() { if ($this->is_linear_whitespace()) { $this->linear_whitespace(); } else { switch ($this->data[$this->position]) { case '"': $this->position++; $this->state = 'value'; break; case "\x0A": $this->position++; $this->state = 'new_line'; break; case '\\': $this->position++; $this->state = 'quote_escaped'; break; default: $this->state = 'quote_char'; break; } } } /** * Parse a header value while within quotes */ protected function quote_char() { $len = strcspn($this->data, "\x09\x20\x0A\"\\", $this->position); $this->value .= substr($this->data, $this->position, $len); $this->position += $len; $this->state = 'value'; } /** * Parse an escaped character within quotes */ protected function quote_escaped() { $this->value .= $this->data[$this->position]; $this->position++; $this->state = 'quote'; } /** * Parse the body */ protected function body() { $this->body = substr($this->data, $this->position); if (!empty($this->headers['transfer-encoding'])) { unset($this->headers['transfer-encoding']); $this->state = 'chunked'; } else { $this->state = 'emit'; } } /** * Parsed a "Transfer-Encoding: chunked" body */ protected function chunked() { if (!preg_match('/^([0-9a-f]+)[^\r\n]*\r\n/i', trim($this->body))) { $this->state = 'emit'; return; } $decoded = ''; $encoded = $this->body; while (true) { $is_chunked = (bool) preg_match( '/^([0-9a-f]+)[^\r\n]*\r\n/i', $encoded, $matches ); if (!$is_chunked) { // Looks like it's not chunked after all $this->state = 'emit'; return; } $length = hexdec(trim($matches[1])); if ($length === 0) { // Ignore trailer headers $this->state = 'emit'; $this->body = $decoded; return; } $chunk_length = strlen($matches[0]); $decoded .= $part = substr($encoded, $chunk_length, $length); $encoded = substr($encoded, $chunk_length + $length + 2); if (trim($encoded) === '0' || empty($encoded)) { $this->state = 'emit'; $this->body = $decoded; return; } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/IRI.php��������������������������������������������������0000664�0000000�0000000�00000067307�12266004471�0021416�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * IRI parser/serialiser/normaliser * * @package SimplePie * @subpackage HTTP * @author Geoffrey Sneddon * @author Steve Minutillo * @author Ryan McCue * @copyright 2007-2012 Geoffrey Sneddon, Steve Minutillo, Ryan McCue * @license http://www.opensource.org/licenses/bsd-license.php */ class SimplePie_IRI { /** * Scheme * * @var string */ protected $scheme = null; /** * User Information * * @var string */ protected $iuserinfo = null; /** * ihost * * @var string */ protected $ihost = null; /** * Port * * @var string */ protected $port = null; /** * ipath * * @var string */ protected $ipath = ''; /** * iquery * * @var string */ protected $iquery = null; /** * ifragment * * @var string */ protected $ifragment = null; /** * Normalization database * * Each key is the scheme, each value is an array with each key as the IRI * part and value as the default value for that part. */ protected $normalization = array( 'acap' => array( 'port' => 674 ), 'dict' => array( 'port' => 2628 ), 'file' => array( 'ihost' => 'localhost' ), 'http' => array( 'port' => 80, 'ipath' => '/' ), 'https' => array( 'port' => 443, 'ipath' => '/' ), ); /** * Return the entire IRI when you try and read the object as a string * * @return string */ public function __toString() { return $this->get_iri(); } /** * Overload __set() to provide access via properties * * @param string $name Property name * @param mixed $value Property value */ public function __set($name, $value) { if (method_exists($this, 'set_' . $name)) { call_user_func(array($this, 'set_' . $name), $value); } elseif ( $name === 'iauthority' || $name === 'iuserinfo' || $name === 'ihost' || $name === 'ipath' || $name === 'iquery' || $name === 'ifragment' ) { call_user_func(array($this, 'set_' . substr($name, 1)), $value); } } /** * Overload __get() to provide access via properties * * @param string $name Property name * @return mixed */ public function __get($name) { // isset() returns false for null, we don't want to do that // Also why we use array_key_exists below instead of isset() $props = get_object_vars($this); if ( $name === 'iri' || $name === 'uri' || $name === 'iauthority' || $name === 'authority' ) { $return = $this->{"get_$name"}(); } elseif (array_key_exists($name, $props)) { $return = $this->$name; } // host -> ihost elseif (($prop = 'i' . $name) && array_key_exists($prop, $props)) { $name = $prop; $return = $this->$prop; } // ischeme -> scheme elseif (($prop = substr($name, 1)) && array_key_exists($prop, $props)) { $name = $prop; $return = $this->$prop; } else { trigger_error('Undefined property: ' . get_class($this) . '::' . $name, E_USER_NOTICE); $return = null; } if ($return === null && isset($this->normalization[$this->scheme][$name])) { return $this->normalization[$this->scheme][$name]; } else { return $return; } } /** * Overload __isset() to provide access via properties * * @param string $name Property name * @return bool */ public function __isset($name) { if (method_exists($this, 'get_' . $name) || isset($this->$name)) { return true; } else { return false; } } /** * Overload __unset() to provide access via properties * * @param string $name Property name */ public function __unset($name) { if (method_exists($this, 'set_' . $name)) { call_user_func(array($this, 'set_' . $name), ''); } } /** * Create a new IRI object, from a specified string * * @param string $iri */ public function __construct($iri = null) { $this->set_iri($iri); } /** * Create a new IRI object by resolving a relative IRI * * Returns false if $base is not absolute, otherwise an IRI. * * @param IRI|string $base (Absolute) Base IRI * @param IRI|string $relative Relative IRI * @return IRI|false */ public static function absolutize($base, $relative) { if (!($relative instanceof SimplePie_IRI)) { $relative = new SimplePie_IRI($relative); } if (!$relative->is_valid()) { return false; } elseif ($relative->scheme !== null) { return clone $relative; } else { if (!($base instanceof SimplePie_IRI)) { $base = new SimplePie_IRI($base); } if ($base->scheme !== null && $base->is_valid()) { if ($relative->get_iri() !== '') { if ($relative->iuserinfo !== null || $relative->ihost !== null || $relative->port !== null) { $target = clone $relative; $target->scheme = $base->scheme; } else { $target = new SimplePie_IRI; $target->scheme = $base->scheme; $target->iuserinfo = $base->iuserinfo; $target->ihost = $base->ihost; $target->port = $base->port; if ($relative->ipath !== '') { if ($relative->ipath[0] === '/') { $target->ipath = $relative->ipath; } elseif (($base->iuserinfo !== null || $base->ihost !== null || $base->port !== null) && $base->ipath === '') { $target->ipath = '/' . $relative->ipath; } elseif (($last_segment = strrpos($base->ipath, '/')) !== false) { $target->ipath = substr($base->ipath, 0, $last_segment + 1) . $relative->ipath; } else { $target->ipath = $relative->ipath; } $target->ipath = $target->remove_dot_segments($target->ipath); $target->iquery = $relative->iquery; } else { $target->ipath = $base->ipath; if ($relative->iquery !== null) { $target->iquery = $relative->iquery; } elseif ($base->iquery !== null) { $target->iquery = $base->iquery; } } $target->ifragment = $relative->ifragment; } } else { $target = clone $base; $target->ifragment = null; } $target->scheme_normalization(); return $target; } else { return false; } } } /** * Parse an IRI into scheme/authority/path/query/fragment segments * * @param string $iri * @return array */ protected function parse_iri($iri) { $iri = trim($iri, "\x20\x09\x0A\x0C\x0D"); if (preg_match('/^((?P<scheme>[^:\/?#]+):)?(\/\/(?P<authority>[^\/?#]*))?(?P<path>[^?#]*)(\?(?P<query>[^#]*))?(#(?P<fragment>.*))?$/', $iri, $match)) { if ($match[1] === '') { $match['scheme'] = null; } if (!isset($match[3]) || $match[3] === '') { $match['authority'] = null; } if (!isset($match[5])) { $match['path'] = ''; } if (!isset($match[6]) || $match[6] === '') { $match['query'] = null; } if (!isset($match[8]) || $match[8] === '') { $match['fragment'] = null; } return $match; } else { // This can occur when a paragraph is accidentally parsed as a URI return false; } } /** * Remove dot segments from a path * * @param string $input * @return string */ protected function remove_dot_segments($input) { $output = ''; while (strpos($input, './') !== false || strpos($input, '/.') !== false || $input === '.' || $input === '..') { // A: If the input buffer begins with a prefix of "../" or "./", then remove that prefix from the input buffer; otherwise, if (strpos($input, '../') === 0) { $input = substr($input, 3); } elseif (strpos($input, './') === 0) { $input = substr($input, 2); } // B: if the input buffer begins with a prefix of "/./" or "/.", where "." is a complete path segment, then replace that prefix with "/" in the input buffer; otherwise, elseif (strpos($input, '/./') === 0) { $input = substr($input, 2); } elseif ($input === '/.') { $input = '/'; } // C: if the input buffer begins with a prefix of "/../" or "/..", where ".." is a complete path segment, then replace that prefix with "/" in the input buffer and remove the last segment and its preceding "/" (if any) from the output buffer; otherwise, elseif (strpos($input, '/../') === 0) { $input = substr($input, 3); $output = substr_replace($output, '', strrpos($output, '/')); } elseif ($input === '/..') { $input = '/'; $output = substr_replace($output, '', strrpos($output, '/')); } // D: if the input buffer consists only of "." or "..", then remove that from the input buffer; otherwise, elseif ($input === '.' || $input === '..') { $input = ''; } // E: move the first path segment in the input buffer to the end of the output buffer, including the initial "/" character (if any) and any subsequent characters up to, but not including, the next "/" character or the end of the input buffer elseif (($pos = strpos($input, '/', 1)) !== false) { $output .= substr($input, 0, $pos); $input = substr_replace($input, '', 0, $pos); } else { $output .= $input; $input = ''; } } return $output . $input; } /** * Replace invalid character with percent encoding * * @param string $string Input string * @param string $extra_chars Valid characters not in iunreserved or * iprivate (this is ASCII-only) * @param bool $iprivate Allow iprivate * @return string */ protected function replace_invalid_with_pct_encoding($string, $extra_chars, $iprivate = false) { // Normalize as many pct-encoded sections as possible $string = preg_replace_callback('/(?:%[A-Fa-f0-9]{2})+/', array($this, 'remove_iunreserved_percent_encoded'), $string); // Replace invalid percent characters $string = preg_replace('/%(?![A-Fa-f0-9]{2})/', '%25', $string); // Add unreserved and % to $extra_chars (the latter is safe because all // pct-encoded sections are now valid). $extra_chars .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~%'; // Now replace any bytes that aren't allowed with their pct-encoded versions $position = 0; $strlen = strlen($string); while (($position += strspn($string, $extra_chars, $position)) < $strlen) { $value = ord($string[$position]); // Start position $start = $position; // By default we are valid $valid = true; // No one byte sequences are valid due to the while. // Two byte sequence: if (($value & 0xE0) === 0xC0) { $character = ($value & 0x1F) << 6; $length = 2; $remaining = 1; } // Three byte sequence: elseif (($value & 0xF0) === 0xE0) { $character = ($value & 0x0F) << 12; $length = 3; $remaining = 2; } // Four byte sequence: elseif (($value & 0xF8) === 0xF0) { $character = ($value & 0x07) << 18; $length = 4; $remaining = 3; } // Invalid byte: else { $valid = false; $length = 1; $remaining = 0; } if ($remaining) { if ($position + $length <= $strlen) { for ($position++; $remaining; $position++) { $value = ord($string[$position]); // Check that the byte is valid, then add it to the character: if (($value & 0xC0) === 0x80) { $character |= ($value & 0x3F) << (--$remaining * 6); } // If it is invalid, count the sequence as invalid and reprocess the current byte: else { $valid = false; $position--; break; } } } else { $position = $strlen - 1; $valid = false; } } // Percent encode anything invalid or not in ucschar if ( // Invalid sequences !$valid // Non-shortest form sequences are invalid || $length > 1 && $character <= 0x7F || $length > 2 && $character <= 0x7FF || $length > 3 && $character <= 0xFFFF // Outside of range of ucschar codepoints // Noncharacters || ($character & 0xFFFE) === 0xFFFE || $character >= 0xFDD0 && $character <= 0xFDEF || ( // Everything else not in ucschar $character > 0xD7FF && $character < 0xF900 || $character < 0xA0 || $character > 0xEFFFD ) && ( // Everything not in iprivate, if it applies !$iprivate || $character < 0xE000 || $character > 0x10FFFD ) ) { // If we were a character, pretend we weren't, but rather an error. if ($valid) $position--; for ($j = $start; $j <= $position; $j++) { $string = substr_replace($string, sprintf('%%%02X', ord($string[$j])), $j, 1); $j += 2; $position += 2; $strlen += 2; } } } return $string; } /** * Callback function for preg_replace_callback. * * Removes sequences of percent encoded bytes that represent UTF-8 * encoded characters in iunreserved * * @param array $match PCRE match * @return string Replacement */ protected function remove_iunreserved_percent_encoded($match) { // As we just have valid percent encoded sequences we can just explode // and ignore the first member of the returned array (an empty string). $bytes = explode('%', $match[0]); // Initialize the new string (this is what will be returned) and that // there are no bytes remaining in the current sequence (unsurprising // at the first byte!). $string = ''; $remaining = 0; // Loop over each and every byte, and set $value to its value for ($i = 1, $len = count($bytes); $i < $len; $i++) { $value = hexdec($bytes[$i]); // If we're the first byte of sequence: if (!$remaining) { // Start position $start = $i; // By default we are valid $valid = true; // One byte sequence: if ($value <= 0x7F) { $character = $value; $length = 1; } // Two byte sequence: elseif (($value & 0xE0) === 0xC0) { $character = ($value & 0x1F) << 6; $length = 2; $remaining = 1; } // Three byte sequence: elseif (($value & 0xF0) === 0xE0) { $character = ($value & 0x0F) << 12; $length = 3; $remaining = 2; } // Four byte sequence: elseif (($value & 0xF8) === 0xF0) { $character = ($value & 0x07) << 18; $length = 4; $remaining = 3; } // Invalid byte: else { $valid = false; $remaining = 0; } } // Continuation byte: else { // Check that the byte is valid, then add it to the character: if (($value & 0xC0) === 0x80) { $remaining--; $character |= ($value & 0x3F) << ($remaining * 6); } // If it is invalid, count the sequence as invalid and reprocess the current byte as the start of a sequence: else { $valid = false; $remaining = 0; $i--; } } // If we've reached the end of the current byte sequence, append it to Unicode::$data if (!$remaining) { // Percent encode anything invalid or not in iunreserved if ( // Invalid sequences !$valid // Non-shortest form sequences are invalid || $length > 1 && $character <= 0x7F || $length > 2 && $character <= 0x7FF || $length > 3 && $character <= 0xFFFF // Outside of range of iunreserved codepoints || $character < 0x2D || $character > 0xEFFFD // Noncharacters || ($character & 0xFFFE) === 0xFFFE || $character >= 0xFDD0 && $character <= 0xFDEF // Everything else not in iunreserved (this is all BMP) || $character === 0x2F || $character > 0x39 && $character < 0x41 || $character > 0x5A && $character < 0x61 || $character > 0x7A && $character < 0x7E || $character > 0x7E && $character < 0xA0 || $character > 0xD7FF && $character < 0xF900 ) { for ($j = $start; $j <= $i; $j++) { $string .= '%' . strtoupper($bytes[$j]); } } else { for ($j = $start; $j <= $i; $j++) { $string .= chr(hexdec($bytes[$j])); } } } } // If we have any bytes left over they are invalid (i.e., we are // mid-way through a multi-byte sequence) if ($remaining) { for ($j = $start; $j < $len; $j++) { $string .= '%' . strtoupper($bytes[$j]); } } return $string; } protected function scheme_normalization() { if (isset($this->normalization[$this->scheme]['iuserinfo']) && $this->iuserinfo === $this->normalization[$this->scheme]['iuserinfo']) { $this->iuserinfo = null; } if (isset($this->normalization[$this->scheme]['ihost']) && $this->ihost === $this->normalization[$this->scheme]['ihost']) { $this->ihost = null; } if (isset($this->normalization[$this->scheme]['port']) && $this->port === $this->normalization[$this->scheme]['port']) { $this->port = null; } if (isset($this->normalization[$this->scheme]['ipath']) && $this->ipath === $this->normalization[$this->scheme]['ipath']) { $this->ipath = ''; } if (isset($this->normalization[$this->scheme]['iquery']) && $this->iquery === $this->normalization[$this->scheme]['iquery']) { $this->iquery = null; } if (isset($this->normalization[$this->scheme]['ifragment']) && $this->ifragment === $this->normalization[$this->scheme]['ifragment']) { $this->ifragment = null; } } /** * Check if the object represents a valid IRI. This needs to be done on each * call as some things change depending on another part of the IRI. * * @return bool */ public function is_valid() { $isauthority = $this->iuserinfo !== null || $this->ihost !== null || $this->port !== null; if ($this->ipath !== '' && ( $isauthority && ( $this->ipath[0] !== '/' || substr($this->ipath, 0, 2) === '//' ) || ( $this->scheme === null && !$isauthority && strpos($this->ipath, ':') !== false && (strpos($this->ipath, '/') === false ? true : strpos($this->ipath, ':') < strpos($this->ipath, '/')) ) ) ) { return false; } return true; } /** * Set the entire IRI. Returns true on success, false on failure (if there * are any invalid characters). * * @param string $iri * @return bool */ public function set_iri($iri) { static $cache; if (!$cache) { $cache = array(); } if ($iri === null) { return true; } elseif (isset($cache[$iri])) { list($this->scheme, $this->iuserinfo, $this->ihost, $this->port, $this->ipath, $this->iquery, $this->ifragment, $return) = $cache[$iri]; return $return; } else { $parsed = $this->parse_iri((string) $iri); if (!$parsed) { return false; } $return = $this->set_scheme($parsed['scheme']) && $this->set_authority($parsed['authority']) && $this->set_path($parsed['path']) && $this->set_query($parsed['query']) && $this->set_fragment($parsed['fragment']); $cache[$iri] = array($this->scheme, $this->iuserinfo, $this->ihost, $this->port, $this->ipath, $this->iquery, $this->ifragment, $return); return $return; } } /** * Set the scheme. Returns true on success, false on failure (if there are * any invalid characters). * * @param string $scheme * @return bool */ public function set_scheme($scheme) { if ($scheme === null) { $this->scheme = null; } elseif (!preg_match('/^[A-Za-z][0-9A-Za-z+\-.]*$/', $scheme)) { $this->scheme = null; return false; } else { $this->scheme = strtolower($scheme); } return true; } /** * Set the authority. Returns true on success, false on failure (if there are * any invalid characters). * * @param string $authority * @return bool */ public function set_authority($authority) { static $cache; if (!$cache) $cache = array(); if ($authority === null) { $this->iuserinfo = null; $this->ihost = null; $this->port = null; return true; } elseif (isset($cache[$authority])) { list($this->iuserinfo, $this->ihost, $this->port, $return) = $cache[$authority]; return $return; } else { $remaining = $authority; if (($iuserinfo_end = strrpos($remaining, '@')) !== false) { $iuserinfo = substr($remaining, 0, $iuserinfo_end); $remaining = substr($remaining, $iuserinfo_end + 1); } else { $iuserinfo = null; } if (($port_start = strpos($remaining, ':', strpos($remaining, ']'))) !== false) { if (($port = substr($remaining, $port_start + 1)) === false) { $port = null; } $remaining = substr($remaining, 0, $port_start); } else { $port = null; } $return = $this->set_userinfo($iuserinfo) && $this->set_host($remaining) && $this->set_port($port); $cache[$authority] = array($this->iuserinfo, $this->ihost, $this->port, $return); return $return; } } /** * Set the iuserinfo. * * @param string $iuserinfo * @return bool */ public function set_userinfo($iuserinfo) { if ($iuserinfo === null) { $this->iuserinfo = null; } else { $this->iuserinfo = $this->replace_invalid_with_pct_encoding($iuserinfo, '!$&\'()*+,;=:'); $this->scheme_normalization(); } return true; } /** * Set the ihost. Returns true on success, false on failure (if there are * any invalid characters). * * @param string $ihost * @return bool */ public function set_host($ihost) { if ($ihost === null) { $this->ihost = null; return true; } elseif (substr($ihost, 0, 1) === '[' && substr($ihost, -1) === ']') { if (SimplePie_Net_IPv6::check_ipv6(substr($ihost, 1, -1))) { $this->ihost = '[' . SimplePie_Net_IPv6::compress(substr($ihost, 1, -1)) . ']'; } else { $this->ihost = null; return false; } } else { $ihost = $this->replace_invalid_with_pct_encoding($ihost, '!$&\'()*+,;='); // Lowercase, but ignore pct-encoded sections (as they should // remain uppercase). This must be done after the previous step // as that can add unescaped characters. $position = 0; $strlen = strlen($ihost); while (($position += strcspn($ihost, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ%', $position)) < $strlen) { if ($ihost[$position] === '%') { $position += 3; } else { $ihost[$position] = strtolower($ihost[$position]); $position++; } } $this->ihost = $ihost; } $this->scheme_normalization(); return true; } /** * Set the port. Returns true on success, false on failure (if there are * any invalid characters). * * @param string $port * @return bool */ public function set_port($port) { if ($port === null) { $this->port = null; return true; } elseif (strspn($port, '0123456789') === strlen($port)) { $this->port = (int) $port; $this->scheme_normalization(); return true; } else { $this->port = null; return false; } } /** * Set the ipath. * * @param string $ipath * @return bool */ public function set_path($ipath) { static $cache; if (!$cache) { $cache = array(); } $ipath = (string) $ipath; if (isset($cache[$ipath])) { $this->ipath = $cache[$ipath][(int) ($this->scheme !== null)]; } else { $valid = $this->replace_invalid_with_pct_encoding($ipath, '!$&\'()*+,;=@:/'); $removed = $this->remove_dot_segments($valid); $cache[$ipath] = array($valid, $removed); $this->ipath = ($this->scheme !== null) ? $removed : $valid; } $this->scheme_normalization(); return true; } /** * Set the iquery. * * @param string $iquery * @return bool */ public function set_query($iquery) { if ($iquery === null) { $this->iquery = null; } else { $this->iquery = $this->replace_invalid_with_pct_encoding($iquery, '!$&\'()*+,;=:@/?', true); $this->scheme_normalization(); } return true; } /** * Set the ifragment. * * @param string $ifragment * @return bool */ public function set_fragment($ifragment) { if ($ifragment === null) { $this->ifragment = null; } else { $this->ifragment = $this->replace_invalid_with_pct_encoding($ifragment, '!$&\'()*+,;=:@/?'); $this->scheme_normalization(); } return true; } /** * Convert an IRI to a URI (or parts thereof) * * @return string */ public function to_uri($string) { static $non_ascii; if (!$non_ascii) { $non_ascii = implode('', range("\x80", "\xFF")); } $position = 0; $strlen = strlen($string); while (($position += strcspn($string, $non_ascii, $position)) < $strlen) { $string = substr_replace($string, sprintf('%%%02X', ord($string[$position])), $position, 1); $position += 3; $strlen += 2; } return $string; } /** * Get the complete IRI * * @return string */ public function get_iri() { if (!$this->is_valid()) { return false; } $iri = ''; if ($this->scheme !== null) { $iri .= $this->scheme . ':'; } if (($iauthority = $this->get_iauthority()) !== null) { $iri .= '//' . $iauthority; } if ($this->ipath !== '') { $iri .= $this->ipath; } elseif (!empty($this->normalization[$this->scheme]['ipath']) && $iauthority !== null && $iauthority !== '') { $iri .= $this->normalization[$this->scheme]['ipath']; } if ($this->iquery !== null) { $iri .= '?' . $this->iquery; } if ($this->ifragment !== null) { $iri .= '#' . $this->ifragment; } return $iri; } /** * Get the complete URI * * @return string */ public function get_uri() { return $this->to_uri($this->get_iri()); } /** * Get the complete iauthority * * @return string */ protected function get_iauthority() { if ($this->iuserinfo !== null || $this->ihost !== null || $this->port !== null) { $iauthority = ''; if ($this->iuserinfo !== null) { $iauthority .= $this->iuserinfo . '@'; } if ($this->ihost !== null) { $iauthority .= $this->ihost; } if ($this->port !== null) { $iauthority .= ':' . $this->port; } return $iauthority; } else { return null; } } /** * Get the complete authority * * @return string */ protected function get_authority() { $iauthority = $this->get_iauthority(); if (is_string($iauthority)) return $this->to_uri($iauthority); else return $iauthority; } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Item.php�������������������������������������������������0000664�0000000�0000000�00000277773�12266004471�0021703�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Manages all item-related data * * Used by {@see SimplePie::get_item()} and {@see SimplePie::get_items()} * * This class can be overloaded with {@see SimplePie::set_item_class()} * * @package SimplePie * @subpackage API */ class SimplePie_Item { /** * Parent feed * * @access private * @var SimplePie */ var $feed; /** * Raw data * * @access private * @var array */ var $data = array(); /** * Registry object * * @see set_registry * @var SimplePie_Registry */ protected $registry; /** * Create a new item object * * This is usually used by {@see SimplePie::get_items} and * {@see SimplePie::get_item}. Avoid creating this manually. * * @param SimplePie $feed Parent feed * @param array $data Raw data */ public function __construct($feed, $data) { $this->feed = $feed; $this->data = $data; } /** * Set the registry handler * * This is usually used by {@see SimplePie_Registry::create} * * @since 1.3 * @param SimplePie_Registry $registry */ public function set_registry(SimplePie_Registry $registry) { $this->registry = $registry; } /** * Get a string representation of the item * * @return string */ public function __toString() { return md5(serialize($this->data)); } /** * Remove items that link back to this before destroying this object */ public function __destruct() { if ((version_compare(PHP_VERSION, '5.3', '<') || !gc_enabled()) && !ini_get('zend.ze1_compatibility_mode')) { unset($this->feed); } } /** * Get data for an item-level element * * This method allows you to get access to ANY element/attribute that is a * sub-element of the item/entry tag. * * See {@see SimplePie::get_feed_tags()} for a description of the return value * * @since 1.0 * @see http://simplepie.org/wiki/faq/supported_xml_namespaces * @param string $namespace The URL of the XML namespace of the elements you're trying to access * @param string $tag Tag name * @return array */ public function get_item_tags($namespace, $tag) { if (isset($this->data['child'][$namespace][$tag])) { return $this->data['child'][$namespace][$tag]; } else { return null; } } /** * Get the base URL value from the parent feed * * Uses `<xml:base>` * * @param array $element * @return string */ public function get_base($element = array()) { return $this->feed->get_base($element); } /** * Sanitize feed data * * @access private * @see SimplePie::sanitize() * @param string $data Data to sanitize * @param int $type One of the SIMPLEPIE_CONSTRUCT_* constants * @param string $base Base URL to resolve URLs against * @return string Sanitized data */ public function sanitize($data, $type, $base = '') { return $this->feed->sanitize($data, $type, $base); } /** * Get the parent feed * * Note: this may not work as you think for multifeeds! * * @link http://simplepie.org/faq/typical_multifeed_gotchas#missing_data_from_feed * @since 1.0 * @return SimplePie */ public function get_feed() { return $this->feed; } /** * Get the unique identifier for the item * * This is usually used when writing code to check for new items in a feed. * * Uses `<atom:id>`, `<guid>`, `<dc:identifier>` or the `about` attribute * for RDF. If none of these are supplied (or `$hash` is true), creates an * MD5 hash based on the permalink and title. If either of those are not * supplied, creates a hash based on the full feed data. * * @since Beta 2 * @param boolean $hash Should we force using a hash instead of the supplied ID? * @return string */ public function get_id($hash = false) { if (!$hash) { if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'id')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'id')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'guid')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'identifier')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'identifier')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif (isset($this->data['attribs'][SIMPLEPIE_NAMESPACE_RDF]['about'])) { return $this->sanitize($this->data['attribs'][SIMPLEPIE_NAMESPACE_RDF]['about'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif (($return = $this->get_permalink()) !== null) { return $return; } elseif (($return = $this->get_title()) !== null) { return $return; } } if ($this->get_permalink() !== null || $this->get_title() !== null) { return md5($this->get_permalink() . $this->get_title()); } else { return md5(serialize($this->data)); } } /** * Get the title of the item * * Uses `<atom:title>`, `<title>` or `<dc:title>` * * @since Beta 2 (previously called `get_item_title` since 0.8) * @return string|null */ public function get_title() { if (!isset($this->data['title'])) { if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title')) { $this->data['title'] = $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'title')) { $this->data['title'] = $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'title')) { $this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'title')) { $this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title')) { $this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'title')) { $this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'title')) { $this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $this->data['title'] = null; } } return $this->data['title']; } /** * Get the content for the item * * Prefers summaries over full content , but will return full content if a * summary does not exist. * * To prefer full content instead, use {@see get_content} * * Uses `<atom:summary>`, `<description>`, `<dc:description>` or * `<itunes:subtitle>` * * @since 0.8 * @param boolean $description_only Should we avoid falling back to the content? * @return string|null */ public function get_description($description_only = false) { if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'summary')) { return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'summary')) { return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'summary')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'subtitle')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML); } elseif (!$description_only) { return $this->get_content(true); } else { return null; } } /** * Get the content for the item * * Prefers full content over summaries, but will return a summary if full * content does not exist. * * To prefer summaries instead, use {@see get_description} * * Uses `<atom:content>` or `<content:encoded>` (RSS 1.0 Content Module) * * @since 1.0 * @param boolean $content_only Should we avoid falling back to the description? * @return string|null */ public function get_content($content_only = false) { if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'content')) { return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_content_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'content')) { return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10_MODULES_CONTENT, 'encoded')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0])); } elseif (!$content_only) { return $this->get_description(true); } else { return null; } } /** * Get a category for the item * * @since Beta 3 (previously called `get_categories()` since Beta 2) * @param int $key The category that you want to return. Remember that arrays begin with 0, not 1 * @return SimplePie_Category|null */ public function get_category($key = 0) { $categories = $this->get_categories(); if (isset($categories[$key])) { return $categories[$key]; } else { return null; } } /** * Get all categories for the item * * Uses `<atom:category>`, `<category>` or `<dc:subject>` * * @since Beta 3 * @return array|null List of {@see SimplePie_Category} objects */ public function get_categories() { $categories = array(); foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'category') as $category) { $term = null; $scheme = null; $label = null; if (isset($category['attribs']['']['term'])) { $term = $this->sanitize($category['attribs']['']['term'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($category['attribs']['']['scheme'])) { $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($category['attribs']['']['label'])) { $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT); } $categories[] = $this->registry->create('Category', array($term, $scheme, $label)); } foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'category') as $category) { // This is really the label, but keep this as the term also for BC. // Label will also work on retrieving because that falls back to term. $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT); if (isset($category['attribs']['']['domain'])) { $scheme = $this->sanitize($category['attribs']['']['domain'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $scheme = null; } $categories[] = $this->registry->create('Category', array($term, $scheme, null)); } foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'subject') as $category) { $categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null)); } foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'subject') as $category) { $categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null)); } if (!empty($categories)) { return array_unique($categories); } else { return null; } } /** * Get an author for the item * * @since Beta 2 * @param int $key The author that you want to return. Remember that arrays begin with 0, not 1 * @return SimplePie_Author|null */ public function get_author($key = 0) { $authors = $this->get_authors(); if (isset($authors[$key])) { return $authors[$key]; } else { return null; } } /** * Get a contributor for the item * * @since 1.1 * @param int $key The contrbutor that you want to return. Remember that arrays begin with 0, not 1 * @return SimplePie_Author|null */ public function get_contributor($key = 0) { $contributors = $this->get_contributors(); if (isset($contributors[$key])) { return $contributors[$key]; } else { return null; } } /** * Get all contributors for the item * * Uses `<atom:contributor>` * * @since 1.1 * @return array|null List of {@see SimplePie_Author} objects */ public function get_contributors() { $contributors = array(); foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'contributor') as $contributor) { $name = null; $uri = null; $email = null; if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'])) { $name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'])) { $uri = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0])); } if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'])) { $email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $uri !== null) { $contributors[] = $this->registry->create('Author', array($name, $uri, $email)); } } foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'contributor') as $contributor) { $name = null; $url = null; $email = null; if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'])) { $name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'])) { $url = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0])); } if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'])) { $email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $url !== null) { $contributors[] = $this->registry->create('Author', array($name, $url, $email)); } } if (!empty($contributors)) { return array_unique($contributors); } else { return null; } } /** * Get all authors for the item * * Uses `<atom:author>`, `<author>`, `<dc:creator>` or `<itunes:author>` * * @since Beta 2 * @return array|null List of {@see SimplePie_Author} objects */ public function get_authors() { $authors = array(); foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'author') as $author) { $name = null; $uri = null; $email = null; if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'])) { $name = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'])) { $uri = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0])); } if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'])) { $email = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $uri !== null) { $authors[] = $this->registry->create('Author', array($name, $uri, $email)); } } if ($author = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author')) { $name = null; $url = null; $email = null; if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'])) { $name = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'])) { $url = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0])); } if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'])) { $email = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $url !== null) { $authors[] = $this->registry->create('Author', array($name, $url, $email)); } } if ($author = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'author')) { $authors[] = $this->registry->create('Author', array(null, null, $this->sanitize($author[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT))); } foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'creator') as $author) { $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null)); } foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'creator') as $author) { $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null)); } foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'author') as $author) { $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null)); } if (!empty($authors)) { return array_unique($authors); } elseif (($source = $this->get_source()) && ($authors = $source->get_authors())) { return $authors; } elseif ($authors = $this->feed->get_authors()) { return $authors; } else { return null; } } /** * Get the copyright info for the item * * Uses `<atom:rights>` or `<dc:rights>` * * @since 1.1 * @return string */ public function get_copyright() { if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'rights')) { return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'rights')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'rights')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } else { return null; } } /** * Get the posting date/time for the item * * Uses `<atom:published>`, `<atom:updated>`, `<atom:issued>`, * `<atom:modified>`, `<pubDate>` or `<dc:date>` * * Note: obeys PHP's timezone setting. To get a UTC date/time, use * {@see get_gmdate} * * @since Beta 2 (previously called `get_item_date` since 0.8) * * @param string $date_format Supports any PHP date format from {@see http://php.net/date} (empty for the raw data) * @return int|string|null */ public function get_date($date_format = 'j F Y, g:i a') { if (!isset($this->data['date'])) { if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'published')) { $this->data['date']['raw'] = $return[0]['data']; } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'updated')) { $this->data['date']['raw'] = $return[0]['data']; } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'issued')) { $this->data['date']['raw'] = $return[0]['data']; } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'created')) { $this->data['date']['raw'] = $return[0]['data']; } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'modified')) { $this->data['date']['raw'] = $return[0]['data']; } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'pubDate')) { $this->data['date']['raw'] = $return[0]['data']; } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'date')) { $this->data['date']['raw'] = $return[0]['data']; } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'date')) { $this->data['date']['raw'] = $return[0]['data']; } if (!empty($this->data['date']['raw'])) { $parser = $this->registry->call('Parse_Date', 'get'); $this->data['date']['parsed'] = $parser->parse($this->data['date']['raw']); } else { $this->data['date'] = null; } } if ($this->data['date']) { $date_format = (string) $date_format; switch ($date_format) { case '': return $this->sanitize($this->data['date']['raw'], SIMPLEPIE_CONSTRUCT_TEXT); case 'U': return $this->data['date']['parsed']; default: return date($date_format, $this->data['date']['parsed']); } } else { return null; } } /** * Get the update date/time for the item * * Uses `<atom:updated>` * * Note: obeys PHP's timezone setting. To get a UTC date/time, use * {@see get_gmdate} * * @param string $date_format Supports any PHP date format from {@see http://php.net/date} (empty for the raw data) * @return int|string|null */ public function get_updated_date($date_format = 'j F Y, g:i a') { if (!isset($this->data['updated'])) { if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'updated')) { $this->data['updated']['raw'] = $return[0]['data']; } if (!empty($this->data['updated']['raw'])) { $parser = $this->registry->call('Parse_Date', 'get'); $this->data['updated']['parsed'] = $parser->parse($this->data['date']['raw']); } else { $this->data['updated'] = null; } } if ($this->data['updated']) { $date_format = (string) $date_format; switch ($date_format) { case '': return $this->sanitize($this->data['updated']['raw'], SIMPLEPIE_CONSTRUCT_TEXT); case 'U': return $this->data['updated']['parsed']; default: return date($date_format, $this->data['updated']['parsed']); } } else { return null; } } /** * Get the localized posting date/time for the item * * Returns the date formatted in the localized language. To display in * languages other than the server's default, you need to change the locale * with {@link http://php.net/setlocale setlocale()}. The available * localizations depend on which ones are installed on your web server. * * @since 1.0 * * @param string $date_format Supports any PHP date format from {@see http://php.net/strftime} (empty for the raw data) * @return int|string|null */ public function get_local_date($date_format = '%c') { if (!$date_format) { return $this->sanitize($this->get_date(''), SIMPLEPIE_CONSTRUCT_TEXT); } elseif (($date = $this->get_date('U')) !== null && $date !== false) { return strftime($date_format, $date); } else { return null; } } /** * Get the posting date/time for the item (UTC time) * * @see get_date * @param string $date_format Supports any PHP date format from {@see http://php.net/date} * @return int|string|null */ public function get_gmdate($date_format = 'j F Y, g:i a') { $date = $this->get_date('U'); if ($date === null) { return null; } return gmdate($date_format, $date); } /** * Get the update date/time for the item (UTC time) * * @see get_updated_date * @param string $date_format Supports any PHP date format from {@see http://php.net/date} * @return int|string|null */ public function get_updated_gmdate($date_format = 'j F Y, g:i a') { $date = $this->get_updated_date('U'); if ($date === null) { return null; } return gmdate($date_format, $date); } /** * Get the permalink for the item * * Returns the first link available with a relationship of "alternate". * Identical to {@see get_link()} with key 0 * * @see get_link * @since 0.8 * @return string|null Permalink URL */ public function get_permalink() { $link = $this->get_link(); $enclosure = $this->get_enclosure(0); if ($link !== null) { return $link; } elseif ($enclosure !== null) { return $enclosure->get_link(); } else { return null; } } /** * Get a single link for the item * * @since Beta 3 * @param int $key The link that you want to return. Remember that arrays begin with 0, not 1 * @param string $rel The relationship of the link to return * @return string|null Link URL */ public function get_link($key = 0, $rel = 'alternate') { $links = $this->get_links($rel); if ($links[$key] !== null) { return $links[$key]; } else { return null; } } /** * Get all links for the item * * Uses `<atom:link>`, `<link>` or `<guid>` * * @since Beta 2 * @param string $rel The relationship of links to return * @return array|null Links found for the item (strings) */ public function get_links($rel = 'alternate') { if (!isset($this->data['links'])) { $this->data['links'] = array(); foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link') as $link) { if (isset($link['attribs']['']['href'])) { $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate'; $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link)); } } foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link') as $link) { if (isset($link['attribs']['']['href'])) { $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate'; $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link)); } } if ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'link')) { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } if ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'link')) { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } if ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link')) { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } if ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'guid')) { if (!isset($links[0]['attribs']['']['isPermaLink']) || strtolower(trim($links[0]['attribs']['']['isPermaLink'])) === 'true') { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } } $keys = array_keys($this->data['links']); foreach ($keys as $key) { if ($this->registry->call('Misc', 'is_isegment_nz_nc', array($key))) { if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key])) { $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]); $this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]; } else { $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key]; } } elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY) { $this->data['links'][substr($key, 41)] =& $this->data['links'][$key]; } $this->data['links'][$key] = array_unique($this->data['links'][$key]); } } if (isset($this->data['links'][$rel])) { return $this->data['links'][$rel]; } else { return null; } } /** * Get an enclosure from the item * * Supports the <enclosure> RSS tag, as well as Media RSS and iTunes RSS. * * @since Beta 2 * @todo Add ability to prefer one type of content over another (in a media group). * @param int $key The enclosure that you want to return. Remember that arrays begin with 0, not 1 * @return SimplePie_Enclosure|null */ public function get_enclosure($key = 0, $prefer = null) { $enclosures = $this->get_enclosures(); if (isset($enclosures[$key])) { return $enclosures[$key]; } else { return null; } } /** * Get all available enclosures (podcasts, etc.) * * Supports the <enclosure> RSS tag, as well as Media RSS and iTunes RSS. * * At this point, we're pretty much assuming that all enclosures for an item * are the same content. Anything else is too complicated to * properly support. * * @since Beta 2 * @todo Add support for end-user defined sorting of enclosures by type/handler (so we can prefer the faster-loading FLV over MP4). * @todo If an element exists at a level, but it's value is empty, we should fall back to the value from the parent (if it exists). * @return array|null List of SimplePie_Enclosure items */ public function get_enclosures() { if (!isset($this->data['enclosures'])) { $this->data['enclosures'] = array(); // Elements $captions_parent = null; $categories_parent = null; $copyrights_parent = null; $credits_parent = null; $description_parent = null; $duration_parent = null; $hashes_parent = null; $keywords_parent = null; $player_parent = null; $ratings_parent = null; $restrictions_parent = null; $thumbnails_parent = null; $title_parent = null; // Let's do the channel and item-level ones first, and just re-use them if we need to. $parent = $this->get_feed(); // CAPTIONS if ($captions = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'text')) { foreach ($captions as $caption) { $caption_type = null; $caption_lang = null; $caption_startTime = null; $caption_endTime = null; $caption_text = null; if (isset($caption['attribs']['']['type'])) { $caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['lang'])) { $caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['start'])) { $caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['end'])) { $caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['data'])) { $caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $captions_parent[] = $this->registry->create('Caption', array($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text)); } } elseif ($captions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'text')) { foreach ($captions as $caption) { $caption_type = null; $caption_lang = null; $caption_startTime = null; $caption_endTime = null; $caption_text = null; if (isset($caption['attribs']['']['type'])) { $caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['lang'])) { $caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['start'])) { $caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['end'])) { $caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['data'])) { $caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $captions_parent[] = $this->registry->create('Caption', array($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text)); } } if (is_array($captions_parent)) { $captions_parent = array_values(array_unique($captions_parent)); } // CATEGORIES foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'category') as $category) { $term = null; $scheme = null; $label = null; if (isset($category['data'])) { $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($category['attribs']['']['scheme'])) { $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $scheme = 'http://search.yahoo.com/mrss/category_schema'; } if (isset($category['attribs']['']['label'])) { $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT); } $categories_parent[] = $this->registry->create('Category', array($term, $scheme, $label)); } foreach ((array) $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'category') as $category) { $term = null; $scheme = null; $label = null; if (isset($category['data'])) { $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($category['attribs']['']['scheme'])) { $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $scheme = 'http://search.yahoo.com/mrss/category_schema'; } if (isset($category['attribs']['']['label'])) { $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT); } $categories_parent[] = $this->registry->create('Category', array($term, $scheme, $label)); } foreach ((array) $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'category') as $category) { $term = null; $scheme = 'http://www.itunes.com/dtds/podcast-1.0.dtd'; $label = null; if (isset($category['attribs']['']['text'])) { $label = $this->sanitize($category['attribs']['']['text'], SIMPLEPIE_CONSTRUCT_TEXT); } $categories_parent[] = $this->registry->create('Category', array($term, $scheme, $label)); if (isset($category['child'][SIMPLEPIE_NAMESPACE_ITUNES]['category'])) { foreach ((array) $category['child'][SIMPLEPIE_NAMESPACE_ITUNES]['category'] as $subcategory) { if (isset($subcategory['attribs']['']['text'])) { $label = $this->sanitize($subcategory['attribs']['']['text'], SIMPLEPIE_CONSTRUCT_TEXT); } $categories_parent[] = $this->registry->create('Category', array($term, $scheme, $label)); } } } if (is_array($categories_parent)) { $categories_parent = array_values(array_unique($categories_parent)); } // COPYRIGHT if ($copyright = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'copyright')) { $copyright_url = null; $copyright_label = null; if (isset($copyright[0]['attribs']['']['url'])) { $copyright_url = $this->sanitize($copyright[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($copyright[0]['data'])) { $copyright_label = $this->sanitize($copyright[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $copyrights_parent = $this->registry->create('Copyright', array($copyright_url, $copyright_label)); } elseif ($copyright = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'copyright')) { $copyright_url = null; $copyright_label = null; if (isset($copyright[0]['attribs']['']['url'])) { $copyright_url = $this->sanitize($copyright[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($copyright[0]['data'])) { $copyright_label = $this->sanitize($copyright[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $copyrights_parent = $this->registry->create('Copyright', array($copyright_url, $copyright_label)); } // CREDITS if ($credits = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'credit')) { foreach ($credits as $credit) { $credit_role = null; $credit_scheme = null; $credit_name = null; if (isset($credit['attribs']['']['role'])) { $credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($credit['attribs']['']['scheme'])) { $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $credit_scheme = 'urn:ebu'; } if (isset($credit['data'])) { $credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $credits_parent[] = $this->registry->create('Credit', array($credit_role, $credit_scheme, $credit_name)); } } elseif ($credits = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'credit')) { foreach ($credits as $credit) { $credit_role = null; $credit_scheme = null; $credit_name = null; if (isset($credit['attribs']['']['role'])) { $credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($credit['attribs']['']['scheme'])) { $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $credit_scheme = 'urn:ebu'; } if (isset($credit['data'])) { $credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $credits_parent[] = $this->registry->create('Credit', array($credit_role, $credit_scheme, $credit_name)); } } if (is_array($credits_parent)) { $credits_parent = array_values(array_unique($credits_parent)); } // DESCRIPTION if ($description_parent = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'description')) { if (isset($description_parent[0]['data'])) { $description_parent = $this->sanitize($description_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } } elseif ($description_parent = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'description')) { if (isset($description_parent[0]['data'])) { $description_parent = $this->sanitize($description_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } } // DURATION if ($duration_parent = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'duration')) { $seconds = null; $minutes = null; $hours = null; if (isset($duration_parent[0]['data'])) { $temp = explode(':', $this->sanitize($duration_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)); if (sizeof($temp) > 0) { $seconds = (int) array_pop($temp); } if (sizeof($temp) > 0) { $minutes = (int) array_pop($temp); $seconds += $minutes * 60; } if (sizeof($temp) > 0) { $hours = (int) array_pop($temp); $seconds += $hours * 3600; } unset($temp); $duration_parent = $seconds; } } // HASHES if ($hashes_iterator = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'hash')) { foreach ($hashes_iterator as $hash) { $value = null; $algo = null; if (isset($hash['data'])) { $value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($hash['attribs']['']['algo'])) { $algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $algo = 'md5'; } $hashes_parent[] = $algo.':'.$value; } } elseif ($hashes_iterator = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'hash')) { foreach ($hashes_iterator as $hash) { $value = null; $algo = null; if (isset($hash['data'])) { $value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($hash['attribs']['']['algo'])) { $algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $algo = 'md5'; } $hashes_parent[] = $algo.':'.$value; } } if (is_array($hashes_parent)) { $hashes_parent = array_values(array_unique($hashes_parent)); } // KEYWORDS if ($keywords = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'keywords')) { if (isset($keywords[0]['data'])) { $temp = explode(',', $this->sanitize($keywords[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)); foreach ($temp as $word) { $keywords_parent[] = trim($word); } } unset($temp); } elseif ($keywords = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'keywords')) { if (isset($keywords[0]['data'])) { $temp = explode(',', $this->sanitize($keywords[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)); foreach ($temp as $word) { $keywords_parent[] = trim($word); } } unset($temp); } elseif ($keywords = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'keywords')) { if (isset($keywords[0]['data'])) { $temp = explode(',', $this->sanitize($keywords[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)); foreach ($temp as $word) { $keywords_parent[] = trim($word); } } unset($temp); } elseif ($keywords = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'keywords')) { if (isset($keywords[0]['data'])) { $temp = explode(',', $this->sanitize($keywords[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)); foreach ($temp as $word) { $keywords_parent[] = trim($word); } } unset($temp); } if (is_array($keywords_parent)) { $keywords_parent = array_values(array_unique($keywords_parent)); } // PLAYER if ($player_parent = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'player')) { if (isset($player_parent[0]['attribs']['']['url'])) { $player_parent = $this->sanitize($player_parent[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); } } elseif ($player_parent = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'player')) { if (isset($player_parent[0]['attribs']['']['url'])) { $player_parent = $this->sanitize($player_parent[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); } } // RATINGS if ($ratings = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'rating')) { foreach ($ratings as $rating) { $rating_scheme = null; $rating_value = null; if (isset($rating['attribs']['']['scheme'])) { $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $rating_scheme = 'urn:simple'; } if (isset($rating['data'])) { $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $ratings_parent[] = $this->registry->create('Rating', array($rating_scheme, $rating_value)); } } elseif ($ratings = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'explicit')) { foreach ($ratings as $rating) { $rating_scheme = 'urn:itunes'; $rating_value = null; if (isset($rating['data'])) { $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $ratings_parent[] = $this->registry->create('Rating', array($rating_scheme, $rating_value)); } } elseif ($ratings = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'rating')) { foreach ($ratings as $rating) { $rating_scheme = null; $rating_value = null; if (isset($rating['attribs']['']['scheme'])) { $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $rating_scheme = 'urn:simple'; } if (isset($rating['data'])) { $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $ratings_parent[] = $this->registry->create('Rating', array($rating_scheme, $rating_value)); } } elseif ($ratings = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'explicit')) { foreach ($ratings as $rating) { $rating_scheme = 'urn:itunes'; $rating_value = null; if (isset($rating['data'])) { $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $ratings_parent[] = $this->registry->create('Rating', array($rating_scheme, $rating_value)); } } if (is_array($ratings_parent)) { $ratings_parent = array_values(array_unique($ratings_parent)); } // RESTRICTIONS if ($restrictions = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'restriction')) { foreach ($restrictions as $restriction) { $restriction_relationship = null; $restriction_type = null; $restriction_value = null; if (isset($restriction['attribs']['']['relationship'])) { $restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($restriction['attribs']['']['type'])) { $restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($restriction['data'])) { $restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $restrictions_parent[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value)); } } elseif ($restrictions = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'block')) { foreach ($restrictions as $restriction) { $restriction_relationship = 'allow'; $restriction_type = null; $restriction_value = 'itunes'; if (isset($restriction['data']) && strtolower($restriction['data']) === 'yes') { $restriction_relationship = 'deny'; } $restrictions_parent[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value)); } } elseif ($restrictions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'restriction')) { foreach ($restrictions as $restriction) { $restriction_relationship = null; $restriction_type = null; $restriction_value = null; if (isset($restriction['attribs']['']['relationship'])) { $restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($restriction['attribs']['']['type'])) { $restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($restriction['data'])) { $restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $restrictions_parent[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value)); } } elseif ($restrictions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'block')) { foreach ($restrictions as $restriction) { $restriction_relationship = 'allow'; $restriction_type = null; $restriction_value = 'itunes'; if (isset($restriction['data']) && strtolower($restriction['data']) === 'yes') { $restriction_relationship = 'deny'; } $restrictions_parent[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value)); } } if (is_array($restrictions_parent)) { $restrictions_parent = array_values(array_unique($restrictions_parent)); } else { $restrictions_parent = array(new SimplePie_Restriction('allow', null, 'default')); } // THUMBNAILS if ($thumbnails = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'thumbnail')) { foreach ($thumbnails as $thumbnail) { if (isset($thumbnail['attribs']['']['url'])) { $thumbnails_parent[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); } } } elseif ($thumbnails = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'thumbnail')) { foreach ($thumbnails as $thumbnail) { if (isset($thumbnail['attribs']['']['url'])) { $thumbnails_parent[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); } } } // TITLES if ($title_parent = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'title')) { if (isset($title_parent[0]['data'])) { $title_parent = $this->sanitize($title_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } } elseif ($title_parent = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'title')) { if (isset($title_parent[0]['data'])) { $title_parent = $this->sanitize($title_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } } // Clear the memory unset($parent); // Attributes $bitrate = null; $channels = null; $duration = null; $expression = null; $framerate = null; $height = null; $javascript = null; $lang = null; $length = null; $medium = null; $samplingrate = null; $type = null; $url = null; $width = null; // Elements $captions = null; $categories = null; $copyrights = null; $credits = null; $description = null; $hashes = null; $keywords = null; $player = null; $ratings = null; $restrictions = null; $thumbnails = null; $title = null; // If we have media:group tags, loop through them. foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'group') as $group) { if(isset($group['child']) && isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content'])) { // If we have media:content tags, loop through them. foreach ((array) $group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content'] as $content) { if (isset($content['attribs']['']['url'])) { // Attributes $bitrate = null; $channels = null; $duration = null; $expression = null; $framerate = null; $height = null; $javascript = null; $lang = null; $length = null; $medium = null; $samplingrate = null; $type = null; $url = null; $width = null; // Elements $captions = null; $categories = null; $copyrights = null; $credits = null; $description = null; $hashes = null; $keywords = null; $player = null; $ratings = null; $restrictions = null; $thumbnails = null; $title = null; // Start checking the attributes of media:content if (isset($content['attribs']['']['bitrate'])) { $bitrate = $this->sanitize($content['attribs']['']['bitrate'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['channels'])) { $channels = $this->sanitize($content['attribs']['']['channels'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['duration'])) { $duration = $this->sanitize($content['attribs']['']['duration'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $duration = $duration_parent; } if (isset($content['attribs']['']['expression'])) { $expression = $this->sanitize($content['attribs']['']['expression'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['framerate'])) { $framerate = $this->sanitize($content['attribs']['']['framerate'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['height'])) { $height = $this->sanitize($content['attribs']['']['height'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['lang'])) { $lang = $this->sanitize($content['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['fileSize'])) { $length = ceil($content['attribs']['']['fileSize']); } if (isset($content['attribs']['']['medium'])) { $medium = $this->sanitize($content['attribs']['']['medium'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['samplingrate'])) { $samplingrate = $this->sanitize($content['attribs']['']['samplingrate'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['type'])) { $type = $this->sanitize($content['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['width'])) { $width = $this->sanitize($content['attribs']['']['width'], SIMPLEPIE_CONSTRUCT_TEXT); } $url = $this->sanitize($content['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); // Checking the other optional media: elements. Priority: media:content, media:group, item, channel // CAPTIONS if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'])) { foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'] as $caption) { $caption_type = null; $caption_lang = null; $caption_startTime = null; $caption_endTime = null; $caption_text = null; if (isset($caption['attribs']['']['type'])) { $caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['lang'])) { $caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['start'])) { $caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['end'])) { $caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['data'])) { $caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $captions[] = $this->registry->create('Caption', array($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text)); } if (is_array($captions)) { $captions = array_values(array_unique($captions)); } } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'])) { foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'] as $caption) { $caption_type = null; $caption_lang = null; $caption_startTime = null; $caption_endTime = null; $caption_text = null; if (isset($caption['attribs']['']['type'])) { $caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['lang'])) { $caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['start'])) { $caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['end'])) { $caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['data'])) { $caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $captions[] = $this->registry->create('Caption', array($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text)); } if (is_array($captions)) { $captions = array_values(array_unique($captions)); } } else { $captions = $captions_parent; } // CATEGORIES if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category'])) { foreach ((array) $content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category'] as $category) { $term = null; $scheme = null; $label = null; if (isset($category['data'])) { $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($category['attribs']['']['scheme'])) { $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $scheme = 'http://search.yahoo.com/mrss/category_schema'; } if (isset($category['attribs']['']['label'])) { $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT); } $categories[] = $this->registry->create('Category', array($term, $scheme, $label)); } } if (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category'])) { foreach ((array) $group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category'] as $category) { $term = null; $scheme = null; $label = null; if (isset($category['data'])) { $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($category['attribs']['']['scheme'])) { $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $scheme = 'http://search.yahoo.com/mrss/category_schema'; } if (isset($category['attribs']['']['label'])) { $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT); } $categories[] = $this->registry->create('Category', array($term, $scheme, $label)); } } if (is_array($categories) && is_array($categories_parent)) { $categories = array_values(array_unique(array_merge($categories, $categories_parent))); } elseif (is_array($categories)) { $categories = array_values(array_unique($categories)); } elseif (is_array($categories_parent)) { $categories = array_values(array_unique($categories_parent)); } // COPYRIGHTS if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'])) { $copyright_url = null; $copyright_label = null; if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'])) { $copyright_url = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'])) { $copyright_label = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $copyrights = $this->registry->create('Copyright', array($copyright_url, $copyright_label)); } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'])) { $copyright_url = null; $copyright_label = null; if (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'])) { $copyright_url = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'])) { $copyright_label = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $copyrights = $this->registry->create('Copyright', array($copyright_url, $copyright_label)); } else { $copyrights = $copyrights_parent; } // CREDITS if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'])) { foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'] as $credit) { $credit_role = null; $credit_scheme = null; $credit_name = null; if (isset($credit['attribs']['']['role'])) { $credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($credit['attribs']['']['scheme'])) { $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $credit_scheme = 'urn:ebu'; } if (isset($credit['data'])) { $credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $credits[] = $this->registry->create('Credit', array($credit_role, $credit_scheme, $credit_name)); } if (is_array($credits)) { $credits = array_values(array_unique($credits)); } } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'])) { foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'] as $credit) { $credit_role = null; $credit_scheme = null; $credit_name = null; if (isset($credit['attribs']['']['role'])) { $credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($credit['attribs']['']['scheme'])) { $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $credit_scheme = 'urn:ebu'; } if (isset($credit['data'])) { $credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $credits[] = $this->registry->create('Credit', array($credit_role, $credit_scheme, $credit_name)); } if (is_array($credits)) { $credits = array_values(array_unique($credits)); } } else { $credits = $credits_parent; } // DESCRIPTION if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'])) { $description = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'])) { $description = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $description = $description_parent; } // HASHES if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'])) { foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'] as $hash) { $value = null; $algo = null; if (isset($hash['data'])) { $value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($hash['attribs']['']['algo'])) { $algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $algo = 'md5'; } $hashes[] = $algo.':'.$value; } if (is_array($hashes)) { $hashes = array_values(array_unique($hashes)); } } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'])) { foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'] as $hash) { $value = null; $algo = null; if (isset($hash['data'])) { $value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($hash['attribs']['']['algo'])) { $algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $algo = 'md5'; } $hashes[] = $algo.':'.$value; } if (is_array($hashes)) { $hashes = array_values(array_unique($hashes)); } } else { $hashes = $hashes_parent; } // KEYWORDS if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'])) { if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data'])) { $temp = explode(',', $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)); foreach ($temp as $word) { $keywords[] = trim($word); } unset($temp); } if (is_array($keywords)) { $keywords = array_values(array_unique($keywords)); } } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'])) { if (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data'])) { $temp = explode(',', $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)); foreach ($temp as $word) { $keywords[] = trim($word); } unset($temp); } if (is_array($keywords)) { $keywords = array_values(array_unique($keywords)); } } else { $keywords = $keywords_parent; } // PLAYER if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'])) { $player = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'])) { $player = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); } else { $player = $player_parent; } // RATINGS if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'])) { foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'] as $rating) { $rating_scheme = null; $rating_value = null; if (isset($rating['attribs']['']['scheme'])) { $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $rating_scheme = 'urn:simple'; } if (isset($rating['data'])) { $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $ratings[] = $this->registry->create('Rating', array($rating_scheme, $rating_value)); } if (is_array($ratings)) { $ratings = array_values(array_unique($ratings)); } } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'])) { foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'] as $rating) { $rating_scheme = null; $rating_value = null; if (isset($rating['attribs']['']['scheme'])) { $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $rating_scheme = 'urn:simple'; } if (isset($rating['data'])) { $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $ratings[] = $this->registry->create('Rating', array($rating_scheme, $rating_value)); } if (is_array($ratings)) { $ratings = array_values(array_unique($ratings)); } } else { $ratings = $ratings_parent; } // RESTRICTIONS if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'])) { foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'] as $restriction) { $restriction_relationship = null; $restriction_type = null; $restriction_value = null; if (isset($restriction['attribs']['']['relationship'])) { $restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($restriction['attribs']['']['type'])) { $restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($restriction['data'])) { $restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $restrictions[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value)); } if (is_array($restrictions)) { $restrictions = array_values(array_unique($restrictions)); } } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'])) { foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'] as $restriction) { $restriction_relationship = null; $restriction_type = null; $restriction_value = null; if (isset($restriction['attribs']['']['relationship'])) { $restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($restriction['attribs']['']['type'])) { $restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($restriction['data'])) { $restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $restrictions[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value)); } if (is_array($restrictions)) { $restrictions = array_values(array_unique($restrictions)); } } else { $restrictions = $restrictions_parent; } // THUMBNAILS if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'])) { foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail) { $thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); } if (is_array($thumbnails)) { $thumbnails = array_values(array_unique($thumbnails)); } } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'])) { foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail) { $thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); } if (is_array($thumbnails)) { $thumbnails = array_values(array_unique($thumbnails)); } } else { $thumbnails = $thumbnails_parent; } // TITLES if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'])) { $title = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'])) { $title = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $title = $title_parent; } $this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions, $categories, $channels, $copyrights, $credits, $description, $duration, $expression, $framerate, $hashes, $height, $keywords, $lang, $medium, $player, $ratings, $restrictions, $samplingrate, $thumbnails, $title, $width)); } } } } // If we have standalone media:content tags, loop through them. if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content'])) { foreach ((array) $this->data['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content'] as $content) { if (isset($content['attribs']['']['url']) || isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'])) { // Attributes $bitrate = null; $channels = null; $duration = null; $expression = null; $framerate = null; $height = null; $javascript = null; $lang = null; $length = null; $medium = null; $samplingrate = null; $type = null; $url = null; $width = null; // Elements $captions = null; $categories = null; $copyrights = null; $credits = null; $description = null; $hashes = null; $keywords = null; $player = null; $ratings = null; $restrictions = null; $thumbnails = null; $title = null; // Start checking the attributes of media:content if (isset($content['attribs']['']['bitrate'])) { $bitrate = $this->sanitize($content['attribs']['']['bitrate'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['channels'])) { $channels = $this->sanitize($content['attribs']['']['channels'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['duration'])) { $duration = $this->sanitize($content['attribs']['']['duration'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $duration = $duration_parent; } if (isset($content['attribs']['']['expression'])) { $expression = $this->sanitize($content['attribs']['']['expression'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['framerate'])) { $framerate = $this->sanitize($content['attribs']['']['framerate'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['height'])) { $height = $this->sanitize($content['attribs']['']['height'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['lang'])) { $lang = $this->sanitize($content['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['fileSize'])) { $length = ceil($content['attribs']['']['fileSize']); } if (isset($content['attribs']['']['medium'])) { $medium = $this->sanitize($content['attribs']['']['medium'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['samplingrate'])) { $samplingrate = $this->sanitize($content['attribs']['']['samplingrate'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['type'])) { $type = $this->sanitize($content['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['width'])) { $width = $this->sanitize($content['attribs']['']['width'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['url'])) { $url = $this->sanitize($content['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); } // Checking the other optional media: elements. Priority: media:content, media:group, item, channel // CAPTIONS if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'])) { foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'] as $caption) { $caption_type = null; $caption_lang = null; $caption_startTime = null; $caption_endTime = null; $caption_text = null; if (isset($caption['attribs']['']['type'])) { $caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['lang'])) { $caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['start'])) { $caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['end'])) { $caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['data'])) { $caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $captions[] = $this->registry->create('Caption', array($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text)); } if (is_array($captions)) { $captions = array_values(array_unique($captions)); } } else { $captions = $captions_parent; } // CATEGORIES if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category'])) { foreach ((array) $content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category'] as $category) { $term = null; $scheme = null; $label = null; if (isset($category['data'])) { $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($category['attribs']['']['scheme'])) { $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $scheme = 'http://search.yahoo.com/mrss/category_schema'; } if (isset($category['attribs']['']['label'])) { $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT); } $categories[] = $this->registry->create('Category', array($term, $scheme, $label)); } } if (is_array($categories) && is_array($categories_parent)) { $categories = array_values(array_unique(array_merge($categories, $categories_parent))); } elseif (is_array($categories)) { $categories = array_values(array_unique($categories)); } elseif (is_array($categories_parent)) { $categories = array_values(array_unique($categories_parent)); } else { $categories = null; } // COPYRIGHTS if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'])) { $copyright_url = null; $copyright_label = null; if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'])) { $copyright_url = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'])) { $copyright_label = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $copyrights = $this->registry->create('Copyright', array($copyright_url, $copyright_label)); } else { $copyrights = $copyrights_parent; } // CREDITS if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'])) { foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'] as $credit) { $credit_role = null; $credit_scheme = null; $credit_name = null; if (isset($credit['attribs']['']['role'])) { $credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($credit['attribs']['']['scheme'])) { $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $credit_scheme = 'urn:ebu'; } if (isset($credit['data'])) { $credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $credits[] = $this->registry->create('Credit', array($credit_role, $credit_scheme, $credit_name)); } if (is_array($credits)) { $credits = array_values(array_unique($credits)); } } else { $credits = $credits_parent; } // DESCRIPTION if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'])) { $description = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $description = $description_parent; } // HASHES if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'])) { foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'] as $hash) { $value = null; $algo = null; if (isset($hash['data'])) { $value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($hash['attribs']['']['algo'])) { $algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $algo = 'md5'; } $hashes[] = $algo.':'.$value; } if (is_array($hashes)) { $hashes = array_values(array_unique($hashes)); } } else { $hashes = $hashes_parent; } // KEYWORDS if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'])) { if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data'])) { $temp = explode(',', $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)); foreach ($temp as $word) { $keywords[] = trim($word); } unset($temp); } if (is_array($keywords)) { $keywords = array_values(array_unique($keywords)); } } else { $keywords = $keywords_parent; } // PLAYER if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'])) { $player = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); } else { $player = $player_parent; } // RATINGS if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'])) { foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'] as $rating) { $rating_scheme = null; $rating_value = null; if (isset($rating['attribs']['']['scheme'])) { $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $rating_scheme = 'urn:simple'; } if (isset($rating['data'])) { $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $ratings[] = $this->registry->create('Rating', array($rating_scheme, $rating_value)); } if (is_array($ratings)) { $ratings = array_values(array_unique($ratings)); } } else { $ratings = $ratings_parent; } // RESTRICTIONS if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'])) { foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'] as $restriction) { $restriction_relationship = null; $restriction_type = null; $restriction_value = null; if (isset($restriction['attribs']['']['relationship'])) { $restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($restriction['attribs']['']['type'])) { $restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($restriction['data'])) { $restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $restrictions[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value)); } if (is_array($restrictions)) { $restrictions = array_values(array_unique($restrictions)); } } else { $restrictions = $restrictions_parent; } // THUMBNAILS if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'])) { foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail) { $thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); } if (is_array($thumbnails)) { $thumbnails = array_values(array_unique($thumbnails)); } } else { $thumbnails = $thumbnails_parent; } // TITLES if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'])) { $title = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $title = $title_parent; } $this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions, $categories, $channels, $copyrights, $credits, $description, $duration, $expression, $framerate, $hashes, $height, $keywords, $lang, $medium, $player, $ratings, $restrictions, $samplingrate, $thumbnails, $title, $width)); } } } foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link') as $link) { if (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] === 'enclosure') { // Attributes $bitrate = null; $channels = null; $duration = null; $expression = null; $framerate = null; $height = null; $javascript = null; $lang = null; $length = null; $medium = null; $samplingrate = null; $type = null; $url = null; $width = null; $url = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link)); if (isset($link['attribs']['']['type'])) { $type = $this->sanitize($link['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($link['attribs']['']['length'])) { $length = ceil($link['attribs']['']['length']); } // Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor $this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width)); } } foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link') as $link) { if (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] === 'enclosure') { // Attributes $bitrate = null; $channels = null; $duration = null; $expression = null; $framerate = null; $height = null; $javascript = null; $lang = null; $length = null; $medium = null; $samplingrate = null; $type = null; $url = null; $width = null; $url = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link)); if (isset($link['attribs']['']['type'])) { $type = $this->sanitize($link['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($link['attribs']['']['length'])) { $length = ceil($link['attribs']['']['length']); } // Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor $this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width)); } } if ($enclosure = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'enclosure')) { if (isset($enclosure[0]['attribs']['']['url'])) { // Attributes $bitrate = null; $channels = null; $duration = null; $expression = null; $framerate = null; $height = null; $javascript = null; $lang = null; $length = null; $medium = null; $samplingrate = null; $type = null; $url = null; $width = null; $url = $this->sanitize($enclosure[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($enclosure[0])); if (isset($enclosure[0]['attribs']['']['type'])) { $type = $this->sanitize($enclosure[0]['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($enclosure[0]['attribs']['']['length'])) { $length = ceil($enclosure[0]['attribs']['']['length']); } // Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor $this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width)); } } if (sizeof($this->data['enclosures']) === 0 && ($url || $type || $length || $bitrate || $captions_parent || $categories_parent || $channels || $copyrights_parent || $credits_parent || $description_parent || $duration_parent || $expression || $framerate || $hashes_parent || $height || $keywords_parent || $lang || $medium || $player_parent || $ratings_parent || $restrictions_parent || $samplingrate || $thumbnails_parent || $title_parent || $width)) { // Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor $this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width)); } $this->data['enclosures'] = array_values(array_unique($this->data['enclosures'])); } if (!empty($this->data['enclosures'])) { return $this->data['enclosures']; } else { return null; } } /** * Get the latitude coordinates for the item * * Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications * * Uses `<geo:lat>` or `<georss:point>` * * @since 1.0 * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo * @link http://www.georss.org/ GeoRSS * @return string|null */ public function get_latitude() { if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lat')) { return (float) $return[0]['data']; } elseif (($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match)) { return (float) $match[1]; } else { return null; } } /** * Get the longitude coordinates for the item * * Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications * * Uses `<geo:long>`, `<geo:lon>` or `<georss:point>` * * @since 1.0 * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo * @link http://www.georss.org/ GeoRSS * @return string|null */ public function get_longitude() { if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'long')) { return (float) $return[0]['data']; } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lon')) { return (float) $return[0]['data']; } elseif (($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match)) { return (float) $match[2]; } else { return null; } } /** * Get the `<atom:source>` for the item * * @since 1.1 * @return SimplePie_Source|null */ public function get_source() { if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'source')) { return $this->registry->create('Source', array($this, $return[0])); } else { return null; } } } �����glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Locator.php����������������������������������������������0000664�0000000�0000000�00000025614�12266004471�0022371�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Used for feed auto-discovery * * * This class can be overloaded with {@see SimplePie::set_locator_class()} * * @package SimplePie */ class SimplePie_Locator { var $useragent; var $timeout; var $file; var $local = array(); var $elsewhere = array(); var $cached_entities = array(); var $http_base; var $base; var $base_location = 0; var $checked_feeds = 0; var $max_checked_feeds = 10; protected $registry; public function __construct(SimplePie_File $file, $timeout = 10, $useragent = null, $max_checked_feeds = 10) { $this->file = $file; $this->useragent = $useragent; $this->timeout = $timeout; $this->max_checked_feeds = $max_checked_feeds; if (class_exists('DOMDocument')) { $this->dom = new DOMDocument(); set_error_handler(array('SimplePie_Misc', 'silence_errors')); $this->dom->loadHTML($this->file->body); restore_error_handler(); } else { $this->dom = null; } } public function set_registry(SimplePie_Registry $registry) { $this->registry = $registry; } public function find($type = SIMPLEPIE_LOCATOR_ALL, &$working) { if ($this->is_feed($this->file)) { return $this->file; } if ($this->file->method & SIMPLEPIE_FILE_SOURCE_REMOTE) { $sniffer = $this->registry->create('Content_Type_Sniffer', array($this->file)); if ($sniffer->get_type() !== 'text/html') { return null; } } if ($type & ~SIMPLEPIE_LOCATOR_NONE) { $this->get_base(); } if ($type & SIMPLEPIE_LOCATOR_AUTODISCOVERY && $working = $this->autodiscovery()) { return $working[0]; } if ($type & (SIMPLEPIE_LOCATOR_LOCAL_EXTENSION | SIMPLEPIE_LOCATOR_LOCAL_BODY | SIMPLEPIE_LOCATOR_REMOTE_EXTENSION | SIMPLEPIE_LOCATOR_REMOTE_BODY) && $this->get_links()) { if ($type & SIMPLEPIE_LOCATOR_LOCAL_EXTENSION && $working = $this->extension($this->local)) { return $working; } if ($type & SIMPLEPIE_LOCATOR_LOCAL_BODY && $working = $this->body($this->local)) { return $working; } if ($type & SIMPLEPIE_LOCATOR_REMOTE_EXTENSION && $working = $this->extension($this->elsewhere)) { return $working; } if ($type & SIMPLEPIE_LOCATOR_REMOTE_BODY && $working = $this->body($this->elsewhere)) { return $working; } } return null; } public function is_feed($file) { if ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE) { $sniffer = $this->registry->create('Content_Type_Sniffer', array($file)); $sniffed = $sniffer->get_type(); if (in_array($sniffed, array('application/rss+xml', 'application/rdf+xml', 'text/rdf', 'application/atom+xml', 'text/xml', 'application/xml'))) { return true; } else { return false; } } elseif ($file->method & SIMPLEPIE_FILE_SOURCE_LOCAL) { return true; } else { return false; } } public function get_base() { if ($this->dom === null) { throw new SimplePie_Exception('DOMDocument not found, unable to use locator'); } $this->http_base = $this->file->url; $this->base = $this->http_base; $elements = $this->dom->getElementsByTagName('base'); foreach ($elements as $element) { if ($element->hasAttribute('href')) { $base = $this->registry->call('Misc', 'absolutize_url', array(trim($element->getAttribute('href')), $this->http_base)); if ($base === false) { continue; } $this->base = $base; $this->base_location = method_exists($element, 'getLineNo') ? $element->getLineNo() : 0; break; } } } public function autodiscovery() { $done = array(); $feeds = array(); $feeds = array_merge($feeds, $this->search_elements_by_tag('link', $done, $feeds)); $feeds = array_merge($feeds, $this->search_elements_by_tag('a', $done, $feeds)); $feeds = array_merge($feeds, $this->search_elements_by_tag('area', $done, $feeds)); if (!empty($feeds)) { return array_values($feeds); } else { return null; } } protected function search_elements_by_tag($name, &$done, $feeds) { if ($this->dom === null) { throw new SimplePie_Exception('DOMDocument not found, unable to use locator'); } $links = $this->dom->getElementsByTagName($name); foreach ($links as $link) { if ($this->checked_feeds === $this->max_checked_feeds) { break; } if ($link->hasAttribute('href') && $link->hasAttribute('rel')) { $rel = array_unique($this->registry->call('Misc', 'space_seperated_tokens', array(strtolower($link->getAttribute('rel'))))); $line = method_exists($link, 'getLineNo') ? $link->getLineNo() : 1; if ($this->base_location < $line) { $href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->base)); } else { $href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->http_base)); } if ($href === false) { continue; } if (!in_array($href, $done) && in_array('feed', $rel) || (in_array('alternate', $rel) && !in_array('stylesheet', $rel) && $link->hasAttribute('type') && in_array(strtolower($this->registry->call('Misc', 'parse_mime', array($link->getAttribute('type')))), array('application/rss+xml', 'application/atom+xml'))) && !isset($feeds[$href])) { $this->checked_feeds++; $headers = array( 'Accept' => 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9, application/xml;q=0.8, text/xml;q=0.8, text/html;q=0.7, unknown/unknown;q=0.1, application/unknown;q=0.1, */*;q=0.1', ); $feed = $this->registry->create('File', array($href, $this->timeout, 5, $headers, $this->useragent)); if ($feed->success && ($feed->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed)) { $feeds[$href] = $feed; } } $done[] = $href; } } return $feeds; } public function get_links() { if ($this->dom === null) { throw new SimplePie_Exception('DOMDocument not found, unable to use locator'); } $links = $this->dom->getElementsByTagName('a'); foreach ($links as $link) { if ($link->hasAttribute('href')) { $href = trim($link->getAttribute('href')); $parsed = $this->registry->call('Misc', 'parse_url', array($href)); if ($parsed['scheme'] === '' || preg_match('/^(http(s)|feed)?$/i', $parsed['scheme'])) { if ($this->base_location < $link->getLineNo()) { $href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->base)); } else { $href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->http_base)); } if ($href === false) { continue; } $current = $this->registry->call('Misc', 'parse_url', array($this->file->url)); if ($parsed['authority'] === '' || $parsed['authority'] === $current['authority']) { $this->local[] = $href; } else { $this->elsewhere[] = $href; } } } } $this->local = array_unique($this->local); $this->elsewhere = array_unique($this->elsewhere); if (!empty($this->local) || !empty($this->elsewhere)) { return true; } return null; } public function extension(&$array) { foreach ($array as $key => $value) { if ($this->checked_feeds === $this->max_checked_feeds) { break; } if (in_array(strtolower(strrchr($value, '.')), array('.rss', '.rdf', '.atom', '.xml'))) { $this->checked_feeds++; $headers = array( 'Accept' => 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9, application/xml;q=0.8, text/xml;q=0.8, text/html;q=0.7, unknown/unknown;q=0.1, application/unknown;q=0.1, */*;q=0.1', ); $feed = $this->registry->create('File', array($value, $this->timeout, 5, $headers, $this->useragent)); if ($feed->success && ($feed->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed)) { return $feed; } else { unset($array[$key]); } } } return null; } public function body(&$array) { foreach ($array as $key => $value) { if ($this->checked_feeds === $this->max_checked_feeds) { break; } if (preg_match('/(rss|rdf|atom|xml)/i', $value)) { $this->checked_feeds++; $headers = array( 'Accept' => 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9, application/xml;q=0.8, text/xml;q=0.8, text/html;q=0.7, unknown/unknown;q=0.1, application/unknown;q=0.1, */*;q=0.1', ); $feed = $this->registry->create('File', array($value, $this->timeout, 5, null, $this->useragent)); if ($feed->success && ($feed->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed)) { return $feed; } else { unset($array[$key]); } } } return null; } } ��������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Misc.php�������������������������������������������������0000664�0000000�0000000�00000144547�12266004471�0021670�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Miscellanous utilities * * @package SimplePie */ class SimplePie_Misc { public static function time_hms($seconds) { $time = ''; $hours = floor($seconds / 3600); $remainder = $seconds % 3600; if ($hours > 0) { $time .= $hours.':'; } $minutes = floor($remainder / 60); $seconds = $remainder % 60; if ($minutes < 10 && $hours > 0) { $minutes = '0' . $minutes; } if ($seconds < 10) { $seconds = '0' . $seconds; } $time .= $minutes.':'; $time .= $seconds; return $time; } public static function absolutize_url($relative, $base) { $iri = SimplePie_IRI::absolutize(new SimplePie_IRI($base), $relative); if ($iri === false) { return false; } return $iri->get_uri(); } /** * Get a HTML/XML element from a HTML string * * @deprecated Use DOMDocument instead (parsing HTML with regex is bad!) * @param string $realname Element name (including namespace prefix if applicable) * @param string $string HTML document * @return array */ public static function get_element($realname, $string) { $return = array(); $name = preg_quote($realname, '/'); if (preg_match_all("/<($name)" . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . "(>(.*)<\/$name>|(\/)?>)/siU", $string, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)) { for ($i = 0, $total_matches = count($matches); $i < $total_matches; $i++) { $return[$i]['tag'] = $realname; $return[$i]['full'] = $matches[$i][0][0]; $return[$i]['offset'] = $matches[$i][0][1]; if (strlen($matches[$i][3][0]) <= 2) { $return[$i]['self_closing'] = true; } else { $return[$i]['self_closing'] = false; $return[$i]['content'] = $matches[$i][4][0]; } $return[$i]['attribs'] = array(); if (isset($matches[$i][2][0]) && preg_match_all('/[\x09\x0A\x0B\x0C\x0D\x20]+([^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3D\x3E]*)(?:[\x09\x0A\x0B\x0C\x0D\x20]*=[\x09\x0A\x0B\x0C\x0D\x20]*(?:"([^"]*)"|\'([^\']*)\'|([^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?/', ' ' . $matches[$i][2][0] . ' ', $attribs, PREG_SET_ORDER)) { for ($j = 0, $total_attribs = count($attribs); $j < $total_attribs; $j++) { if (count($attribs[$j]) === 2) { $attribs[$j][2] = $attribs[$j][1]; } $return[$i]['attribs'][strtolower($attribs[$j][1])]['data'] = SimplePie_Misc::entities_decode(end($attribs[$j]), 'UTF-8'); } } } } return $return; } public static function element_implode($element) { $full = "<$element[tag]"; foreach ($element['attribs'] as $key => $value) { $key = strtolower($key); $full .= " $key=\"" . htmlspecialchars($value['data']) . '"'; } if ($element['self_closing']) { $full .= ' />'; } else { $full .= ">$element[content]</$element[tag]>"; } return $full; } public static function error($message, $level, $file, $line) { if ((ini_get('error_reporting') & $level) > 0) { switch ($level) { case E_USER_ERROR: $note = 'PHP Error'; break; case E_USER_WARNING: $note = 'PHP Warning'; break; case E_USER_NOTICE: $note = 'PHP Notice'; break; default: $note = 'Unknown Error'; break; } $log_error = true; if (!function_exists('error_log')) { $log_error = false; } $log_file = @ini_get('error_log'); if (!empty($log_file) && ('syslog' !== $log_file) && !@is_writable($log_file)) { $log_error = false; } if ($log_error) { @error_log("$note: $message in $file on line $line", 0); } } return $message; } public static function fix_protocol($url, $http = 1) { $url = SimplePie_Misc::normalize_url($url); $parsed = SimplePie_Misc::parse_url($url); if ($parsed['scheme'] !== '' && $parsed['scheme'] !== 'http' && $parsed['scheme'] !== 'https') { return SimplePie_Misc::fix_protocol(SimplePie_Misc::compress_parse_url('http', $parsed['authority'], $parsed['path'], $parsed['query'], $parsed['fragment']), $http); } if ($parsed['scheme'] === '' && $parsed['authority'] === '' && !file_exists($url)) { return SimplePie_Misc::fix_protocol(SimplePie_Misc::compress_parse_url('http', $parsed['path'], '', $parsed['query'], $parsed['fragment']), $http); } if ($http === 2 && $parsed['scheme'] !== '') { return "feed:$url"; } elseif ($http === 3 && strtolower($parsed['scheme']) === 'http') { return substr_replace($url, 'podcast', 0, 4); } elseif ($http === 4 && strtolower($parsed['scheme']) === 'http') { return substr_replace($url, 'itpc', 0, 4); } else { return $url; } } public static function parse_url($url) { $iri = new SimplePie_IRI($url); return array( 'scheme' => (string) $iri->scheme, 'authority' => (string) $iri->authority, 'path' => (string) $iri->path, 'query' => (string) $iri->query, 'fragment' => (string) $iri->fragment ); } public static function compress_parse_url($scheme = '', $authority = '', $path = '', $query = '', $fragment = '') { $iri = new SimplePie_IRI(''); $iri->scheme = $scheme; $iri->authority = $authority; $iri->path = $path; $iri->query = $query; $iri->fragment = $fragment; return $iri->get_uri(); } public static function normalize_url($url) { $iri = new SimplePie_IRI($url); return $iri->get_uri(); } public static function percent_encoding_normalization($match) { $integer = hexdec($match[1]); if ($integer >= 0x41 && $integer <= 0x5A || $integer >= 0x61 && $integer <= 0x7A || $integer >= 0x30 && $integer <= 0x39 || $integer === 0x2D || $integer === 0x2E || $integer === 0x5F || $integer === 0x7E) { return chr($integer); } else { return strtoupper($match[0]); } } /** * Converts a Windows-1252 encoded string to a UTF-8 encoded string * * @static * @param string $string Windows-1252 encoded string * @return string UTF-8 encoded string */ public static function windows_1252_to_utf8($string) { static $convert_table = array("\x80" => "\xE2\x82\xAC", "\x81" => "\xEF\xBF\xBD", "\x82" => "\xE2\x80\x9A", "\x83" => "\xC6\x92", "\x84" => "\xE2\x80\x9E", "\x85" => "\xE2\x80\xA6", "\x86" => "\xE2\x80\xA0", "\x87" => "\xE2\x80\xA1", "\x88" => "\xCB\x86", "\x89" => "\xE2\x80\xB0", "\x8A" => "\xC5\xA0", "\x8B" => "\xE2\x80\xB9", "\x8C" => "\xC5\x92", "\x8D" => "\xEF\xBF\xBD", "\x8E" => "\xC5\xBD", "\x8F" => "\xEF\xBF\xBD", "\x90" => "\xEF\xBF\xBD", "\x91" => "\xE2\x80\x98", "\x92" => "\xE2\x80\x99", "\x93" => "\xE2\x80\x9C", "\x94" => "\xE2\x80\x9D", "\x95" => "\xE2\x80\xA2", "\x96" => "\xE2\x80\x93", "\x97" => "\xE2\x80\x94", "\x98" => "\xCB\x9C", "\x99" => "\xE2\x84\xA2", "\x9A" => "\xC5\xA1", "\x9B" => "\xE2\x80\xBA", "\x9C" => "\xC5\x93", "\x9D" => "\xEF\xBF\xBD", "\x9E" => "\xC5\xBE", "\x9F" => "\xC5\xB8", "\xA0" => "\xC2\xA0", "\xA1" => "\xC2\xA1", "\xA2" => "\xC2\xA2", "\xA3" => "\xC2\xA3", "\xA4" => "\xC2\xA4", "\xA5" => "\xC2\xA5", "\xA6" => "\xC2\xA6", "\xA7" => "\xC2\xA7", "\xA8" => "\xC2\xA8", "\xA9" => "\xC2\xA9", "\xAA" => "\xC2\xAA", "\xAB" => "\xC2\xAB", "\xAC" => "\xC2\xAC", "\xAD" => "\xC2\xAD", "\xAE" => "\xC2\xAE", "\xAF" => "\xC2\xAF", "\xB0" => "\xC2\xB0", "\xB1" => "\xC2\xB1", "\xB2" => "\xC2\xB2", "\xB3" => "\xC2\xB3", "\xB4" => "\xC2\xB4", "\xB5" => "\xC2\xB5", "\xB6" => "\xC2\xB6", "\xB7" => "\xC2\xB7", "\xB8" => "\xC2\xB8", "\xB9" => "\xC2\xB9", "\xBA" => "\xC2\xBA", "\xBB" => "\xC2\xBB", "\xBC" => "\xC2\xBC", "\xBD" => "\xC2\xBD", "\xBE" => "\xC2\xBE", "\xBF" => "\xC2\xBF", "\xC0" => "\xC3\x80", "\xC1" => "\xC3\x81", "\xC2" => "\xC3\x82", "\xC3" => "\xC3\x83", "\xC4" => "\xC3\x84", "\xC5" => "\xC3\x85", "\xC6" => "\xC3\x86", "\xC7" => "\xC3\x87", "\xC8" => "\xC3\x88", "\xC9" => "\xC3\x89", "\xCA" => "\xC3\x8A", "\xCB" => "\xC3\x8B", "\xCC" => "\xC3\x8C", "\xCD" => "\xC3\x8D", "\xCE" => "\xC3\x8E", "\xCF" => "\xC3\x8F", "\xD0" => "\xC3\x90", "\xD1" => "\xC3\x91", "\xD2" => "\xC3\x92", "\xD3" => "\xC3\x93", "\xD4" => "\xC3\x94", "\xD5" => "\xC3\x95", "\xD6" => "\xC3\x96", "\xD7" => "\xC3\x97", "\xD8" => "\xC3\x98", "\xD9" => "\xC3\x99", "\xDA" => "\xC3\x9A", "\xDB" => "\xC3\x9B", "\xDC" => "\xC3\x9C", "\xDD" => "\xC3\x9D", "\xDE" => "\xC3\x9E", "\xDF" => "\xC3\x9F", "\xE0" => "\xC3\xA0", "\xE1" => "\xC3\xA1", "\xE2" => "\xC3\xA2", "\xE3" => "\xC3\xA3", "\xE4" => "\xC3\xA4", "\xE5" => "\xC3\xA5", "\xE6" => "\xC3\xA6", "\xE7" => "\xC3\xA7", "\xE8" => "\xC3\xA8", "\xE9" => "\xC3\xA9", "\xEA" => "\xC3\xAA", "\xEB" => "\xC3\xAB", "\xEC" => "\xC3\xAC", "\xED" => "\xC3\xAD", "\xEE" => "\xC3\xAE", "\xEF" => "\xC3\xAF", "\xF0" => "\xC3\xB0", "\xF1" => "\xC3\xB1", "\xF2" => "\xC3\xB2", "\xF3" => "\xC3\xB3", "\xF4" => "\xC3\xB4", "\xF5" => "\xC3\xB5", "\xF6" => "\xC3\xB6", "\xF7" => "\xC3\xB7", "\xF8" => "\xC3\xB8", "\xF9" => "\xC3\xB9", "\xFA" => "\xC3\xBA", "\xFB" => "\xC3\xBB", "\xFC" => "\xC3\xBC", "\xFD" => "\xC3\xBD", "\xFE" => "\xC3\xBE", "\xFF" => "\xC3\xBF"); return strtr($string, $convert_table); } /** * Change a string from one encoding to another * * @param string $data Raw data in $input encoding * @param string $input Encoding of $data * @param string $output Encoding you want * @return string|boolean False if we can't convert it */ public static function change_encoding($data, $input, $output) { $input = SimplePie_Misc::encoding($input); $output = SimplePie_Misc::encoding($output); // We fail to fail on non US-ASCII bytes if ($input === 'US-ASCII') { static $non_ascii_octects = ''; if (!$non_ascii_octects) { for ($i = 0x80; $i <= 0xFF; $i++) { $non_ascii_octects .= chr($i); } } $data = substr($data, 0, strcspn($data, $non_ascii_octects)); } // This is first, as behaviour of this is completely predictable if ($input === 'windows-1252' && $output === 'UTF-8') { return SimplePie_Misc::windows_1252_to_utf8($data); } // This is second, as behaviour of this varies only with PHP version (the middle part of this expression checks the encoding is supported). elseif (function_exists('mb_convert_encoding') && ($return = SimplePie_Misc::change_encoding_mbstring($data, $input, $output))) { return $return; } // This is last, as behaviour of this varies with OS userland and PHP version elseif (function_exists('iconv') && ($return = SimplePie_Misc::change_encoding_iconv($data, $input, $output))) { return $return; } // If we can't do anything, just fail else { return false; } } protected static function change_encoding_mbstring($data, $input, $output) { if ($input === 'windows-949') { $input = 'EUC-KR'; } if ($output === 'windows-949') { $output = 'EUC-KR'; } if ($input === 'Windows-31J') { $input = 'SJIS'; } if ($output === 'Windows-31J') { $output = 'SJIS'; } // Check that the encoding is supported if (@mb_convert_encoding("\x80", 'UTF-16BE', $input) === "\x00\x80") { return false; } if (!in_array($input, mb_list_encodings())) { return false; } // Let's do some conversion if ($return = @mb_convert_encoding($data, $output, $input)) { return $return; } return false; } protected static function change_encoding_iconv($data, $input, $output) { return @iconv($input, $output, $data); } /** * Normalize an encoding name * * This is automatically generated by create.php * * To generate it, run `php create.php` on the command line, and copy the * output to replace this function. * * @param string $charset Character set to standardise * @return string Standardised name */ public static function encoding($charset) { // Normalization from UTS #22 switch (strtolower(preg_replace('/(?:[^a-zA-Z0-9]+|([^0-9])0+)/', '\1', $charset))) { case 'adobestandardencoding': case 'csadobestandardencoding': return 'Adobe-Standard-Encoding'; case 'adobesymbolencoding': case 'cshppsmath': return 'Adobe-Symbol-Encoding'; case 'ami1251': case 'amiga1251': return 'Amiga-1251'; case 'ansix31101983': case 'csat5001983': case 'csiso99naplps': case 'isoir99': case 'naplps': return 'ANSI_X3.110-1983'; case 'arabic7': case 'asmo449': case 'csiso89asmo449': case 'iso9036': case 'isoir89': return 'ASMO_449'; case 'big5': case 'csbig5': return 'Big5'; case 'big5hkscs': return 'Big5-HKSCS'; case 'bocu1': case 'csbocu1': return 'BOCU-1'; case 'brf': case 'csbrf': return 'BRF'; case 'bs4730': case 'csiso4unitedkingdom': case 'gb': case 'iso646gb': case 'isoir4': case 'uk': return 'BS_4730'; case 'bsviewdata': case 'csiso47bsviewdata': case 'isoir47': return 'BS_viewdata'; case 'cesu8': case 'cscesu8': return 'CESU-8'; case 'ca': case 'csa71': case 'csaz243419851': case 'csiso121canadian1': case 'iso646ca': case 'isoir121': return 'CSA_Z243.4-1985-1'; case 'csa72': case 'csaz243419852': case 'csiso122canadian2': case 'iso646ca2': case 'isoir122': return 'CSA_Z243.4-1985-2'; case 'csaz24341985gr': case 'csiso123csaz24341985gr': case 'isoir123': return 'CSA_Z243.4-1985-gr'; case 'csiso139csn369103': case 'csn369103': case 'isoir139': return 'CSN_369103'; case 'csdecmcs': case 'dec': case 'decmcs': return 'DEC-MCS'; case 'csiso21german': case 'de': case 'din66003': case 'iso646de': case 'isoir21': return 'DIN_66003'; case 'csdkus': case 'dkus': return 'dk-us'; case 'csiso646danish': case 'dk': case 'ds2089': case 'iso646dk': return 'DS_2089'; case 'csibmebcdicatde': case 'ebcdicatde': return 'EBCDIC-AT-DE'; case 'csebcdicatdea': case 'ebcdicatdea': return 'EBCDIC-AT-DE-A'; case 'csebcdiccafr': case 'ebcdiccafr': return 'EBCDIC-CA-FR'; case 'csebcdicdkno': case 'ebcdicdkno': return 'EBCDIC-DK-NO'; case 'csebcdicdknoa': case 'ebcdicdknoa': return 'EBCDIC-DK-NO-A'; case 'csebcdices': case 'ebcdices': return 'EBCDIC-ES'; case 'csebcdicesa': case 'ebcdicesa': return 'EBCDIC-ES-A'; case 'csebcdicess': case 'ebcdicess': return 'EBCDIC-ES-S'; case 'csebcdicfise': case 'ebcdicfise': return 'EBCDIC-FI-SE'; case 'csebcdicfisea': case 'ebcdicfisea': return 'EBCDIC-FI-SE-A'; case 'csebcdicfr': case 'ebcdicfr': return 'EBCDIC-FR'; case 'csebcdicit': case 'ebcdicit': return 'EBCDIC-IT'; case 'csebcdicpt': case 'ebcdicpt': return 'EBCDIC-PT'; case 'csebcdicuk': case 'ebcdicuk': return 'EBCDIC-UK'; case 'csebcdicus': case 'ebcdicus': return 'EBCDIC-US'; case 'csiso111ecmacyrillic': case 'ecmacyrillic': case 'isoir111': case 'koi8e': return 'ECMA-cyrillic'; case 'csiso17spanish': case 'es': case 'iso646es': case 'isoir17': return 'ES'; case 'csiso85spanish2': case 'es2': case 'iso646es2': case 'isoir85': return 'ES2'; case 'cseucpkdfmtjapanese': case 'eucjp': case 'extendedunixcodepackedformatforjapanese': return 'EUC-JP'; case 'cseucfixwidjapanese': case 'extendedunixcodefixedwidthforjapanese': return 'Extended_UNIX_Code_Fixed_Width_for_Japanese'; case 'gb18030': return 'GB18030'; case 'chinese': case 'cp936': case 'csgb2312': case 'csiso58gb231280': case 'gb2312': case 'gb231280': case 'gbk': case 'isoir58': case 'ms936': case 'windows936': return 'GBK'; case 'cn': case 'csiso57gb1988': case 'gb198880': case 'iso646cn': case 'isoir57': return 'GB_1988-80'; case 'csiso153gost1976874': case 'gost1976874': case 'isoir153': case 'stsev35888': return 'GOST_19768-74'; case 'csiso150': case 'csiso150greekccitt': case 'greekccitt': case 'isoir150': return 'greek-ccitt'; case 'csiso88greek7': case 'greek7': case 'isoir88': return 'greek7'; case 'csiso18greek7old': case 'greek7old': case 'isoir18': return 'greek7-old'; case 'cshpdesktop': case 'hpdesktop': return 'HP-DeskTop'; case 'cshplegal': case 'hplegal': return 'HP-Legal'; case 'cshpmath8': case 'hpmath8': return 'HP-Math8'; case 'cshppifont': case 'hppifont': return 'HP-Pi-font'; case 'cshproman8': case 'hproman8': case 'r8': case 'roman8': return 'hp-roman8'; case 'hzgb2312': return 'HZ-GB-2312'; case 'csibmsymbols': case 'ibmsymbols': return 'IBM-Symbols'; case 'csibmthai': case 'ibmthai': return 'IBM-Thai'; case 'cp37': case 'csibm37': case 'ebcdiccpca': case 'ebcdiccpnl': case 'ebcdiccpus': case 'ebcdiccpwt': case 'ibm37': return 'IBM037'; case 'cp38': case 'csibm38': case 'ebcdicint': case 'ibm38': return 'IBM038'; case 'cp273': case 'csibm273': case 'ibm273': return 'IBM273'; case 'cp274': case 'csibm274': case 'ebcdicbe': case 'ibm274': return 'IBM274'; case 'cp275': case 'csibm275': case 'ebcdicbr': case 'ibm275': return 'IBM275'; case 'csibm277': case 'ebcdiccpdk': case 'ebcdiccpno': case 'ibm277': return 'IBM277'; case 'cp278': case 'csibm278': case 'ebcdiccpfi': case 'ebcdiccpse': case 'ibm278': return 'IBM278'; case 'cp280': case 'csibm280': case 'ebcdiccpit': case 'ibm280': return 'IBM280'; case 'cp281': case 'csibm281': case 'ebcdicjpe': case 'ibm281': return 'IBM281'; case 'cp284': case 'csibm284': case 'ebcdiccpes': case 'ibm284': return 'IBM284'; case 'cp285': case 'csibm285': case 'ebcdiccpgb': case 'ibm285': return 'IBM285'; case 'cp290': case 'csibm290': case 'ebcdicjpkana': case 'ibm290': return 'IBM290'; case 'cp297': case 'csibm297': case 'ebcdiccpfr': case 'ibm297': return 'IBM297'; case 'cp420': case 'csibm420': case 'ebcdiccpar1': case 'ibm420': return 'IBM420'; case 'cp423': case 'csibm423': case 'ebcdiccpgr': case 'ibm423': return 'IBM423'; case 'cp424': case 'csibm424': case 'ebcdiccphe': case 'ibm424': return 'IBM424'; case '437': case 'cp437': case 'cspc8codepage437': case 'ibm437': return 'IBM437'; case 'cp500': case 'csibm500': case 'ebcdiccpbe': case 'ebcdiccpch': case 'ibm500': return 'IBM500'; case 'cp775': case 'cspc775baltic': case 'ibm775': return 'IBM775'; case '850': case 'cp850': case 'cspc850multilingual': case 'ibm850': return 'IBM850'; case '851': case 'cp851': case 'csibm851': case 'ibm851': return 'IBM851'; case '852': case 'cp852': case 'cspcp852': case 'ibm852': return 'IBM852'; case '855': case 'cp855': case 'csibm855': case 'ibm855': return 'IBM855'; case '857': case 'cp857': case 'csibm857': case 'ibm857': return 'IBM857'; case 'ccsid858': case 'cp858': case 'ibm858': case 'pcmultilingual850euro': return 'IBM00858'; case '860': case 'cp860': case 'csibm860': case 'ibm860': return 'IBM860'; case '861': case 'cp861': case 'cpis': case 'csibm861': case 'ibm861': return 'IBM861'; case '862': case 'cp862': case 'cspc862latinhebrew': case 'ibm862': return 'IBM862'; case '863': case 'cp863': case 'csibm863': case 'ibm863': return 'IBM863'; case 'cp864': case 'csibm864': case 'ibm864': return 'IBM864'; case '865': case 'cp865': case 'csibm865': case 'ibm865': return 'IBM865'; case '866': case 'cp866': case 'csibm866': case 'ibm866': return 'IBM866'; case 'cp868': case 'cpar': case 'csibm868': case 'ibm868': return 'IBM868'; case '869': case 'cp869': case 'cpgr': case 'csibm869': case 'ibm869': return 'IBM869'; case 'cp870': case 'csibm870': case 'ebcdiccproece': case 'ebcdiccpyu': case 'ibm870': return 'IBM870'; case 'cp871': case 'csibm871': case 'ebcdiccpis': case 'ibm871': return 'IBM871'; case 'cp880': case 'csibm880': case 'ebcdiccyrillic': case 'ibm880': return 'IBM880'; case 'cp891': case 'csibm891': case 'ibm891': return 'IBM891'; case 'cp903': case 'csibm903': case 'ibm903': return 'IBM903'; case '904': case 'cp904': case 'csibbm904': case 'ibm904': return 'IBM904'; case 'cp905': case 'csibm905': case 'ebcdiccptr': case 'ibm905': return 'IBM905'; case 'cp918': case 'csibm918': case 'ebcdiccpar2': case 'ibm918': return 'IBM918'; case 'ccsid924': case 'cp924': case 'ebcdiclatin9euro': case 'ibm924': return 'IBM00924'; case 'cp1026': case 'csibm1026': case 'ibm1026': return 'IBM1026'; case 'ibm1047': return 'IBM1047'; case 'ccsid1140': case 'cp1140': case 'ebcdicus37euro': case 'ibm1140': return 'IBM01140'; case 'ccsid1141': case 'cp1141': case 'ebcdicde273euro': case 'ibm1141': return 'IBM01141'; case 'ccsid1142': case 'cp1142': case 'ebcdicdk277euro': case 'ebcdicno277euro': case 'ibm1142': return 'IBM01142'; case 'ccsid1143': case 'cp1143': case 'ebcdicfi278euro': case 'ebcdicse278euro': case 'ibm1143': return 'IBM01143'; case 'ccsid1144': case 'cp1144': case 'ebcdicit280euro': case 'ibm1144': return 'IBM01144'; case 'ccsid1145': case 'cp1145': case 'ebcdices284euro': case 'ibm1145': return 'IBM01145'; case 'ccsid1146': case 'cp1146': case 'ebcdicgb285euro': case 'ibm1146': return 'IBM01146'; case 'ccsid1147': case 'cp1147': case 'ebcdicfr297euro': case 'ibm1147': return 'IBM01147'; case 'ccsid1148': case 'cp1148': case 'ebcdicinternational500euro': case 'ibm1148': return 'IBM01148'; case 'ccsid1149': case 'cp1149': case 'ebcdicis871euro': case 'ibm1149': return 'IBM01149'; case 'csiso143iecp271': case 'iecp271': case 'isoir143': return 'IEC_P27-1'; case 'csiso49inis': case 'inis': case 'isoir49': return 'INIS'; case 'csiso50inis8': case 'inis8': case 'isoir50': return 'INIS-8'; case 'csiso51iniscyrillic': case 'iniscyrillic': case 'isoir51': return 'INIS-cyrillic'; case 'csinvariant': case 'invariant': return 'INVARIANT'; case 'iso2022cn': return 'ISO-2022-CN'; case 'iso2022cnext': return 'ISO-2022-CN-EXT'; case 'csiso2022jp': case 'iso2022jp': return 'ISO-2022-JP'; case 'csiso2022jp2': case 'iso2022jp2': return 'ISO-2022-JP-2'; case 'csiso2022kr': case 'iso2022kr': return 'ISO-2022-KR'; case 'cswindows30latin1': case 'iso88591windows30latin1': return 'ISO-8859-1-Windows-3.0-Latin-1'; case 'cswindows31latin1': case 'iso88591windows31latin1': return 'ISO-8859-1-Windows-3.1-Latin-1'; case 'csisolatin2': case 'iso88592': case 'iso885921987': case 'isoir101': case 'l2': case 'latin2': return 'ISO-8859-2'; case 'cswindows31latin2': case 'iso88592windowslatin2': return 'ISO-8859-2-Windows-Latin-2'; case 'csisolatin3': case 'iso88593': case 'iso885931988': case 'isoir109': case 'l3': case 'latin3': return 'ISO-8859-3'; case 'csisolatin4': case 'iso88594': case 'iso885941988': case 'isoir110': case 'l4': case 'latin4': return 'ISO-8859-4'; case 'csisolatincyrillic': case 'cyrillic': case 'iso88595': case 'iso885951988': case 'isoir144': return 'ISO-8859-5'; case 'arabic': case 'asmo708': case 'csisolatinarabic': case 'ecma114': case 'iso88596': case 'iso885961987': case 'isoir127': return 'ISO-8859-6'; case 'csiso88596e': case 'iso88596e': return 'ISO-8859-6-E'; case 'csiso88596i': case 'iso88596i': return 'ISO-8859-6-I'; case 'csisolatingreek': case 'ecma118': case 'elot928': case 'greek': case 'greek8': case 'iso88597': case 'iso885971987': case 'isoir126': return 'ISO-8859-7'; case 'csisolatinhebrew': case 'hebrew': case 'iso88598': case 'iso885981988': case 'isoir138': return 'ISO-8859-8'; case 'csiso88598e': case 'iso88598e': return 'ISO-8859-8-E'; case 'csiso88598i': case 'iso88598i': return 'ISO-8859-8-I'; case 'cswindows31latin5': case 'iso88599windowslatin5': return 'ISO-8859-9-Windows-Latin-5'; case 'csisolatin6': case 'iso885910': case 'iso8859101992': case 'isoir157': case 'l6': case 'latin6': return 'ISO-8859-10'; case 'iso885913': return 'ISO-8859-13'; case 'iso885914': case 'iso8859141998': case 'isoceltic': case 'isoir199': case 'l8': case 'latin8': return 'ISO-8859-14'; case 'iso885915': case 'latin9': return 'ISO-8859-15'; case 'iso885916': case 'iso8859162001': case 'isoir226': case 'l10': case 'latin10': return 'ISO-8859-16'; case 'iso10646j1': return 'ISO-10646-J-1'; case 'csunicode': case 'iso10646ucs2': return 'ISO-10646-UCS-2'; case 'csucs4': case 'iso10646ucs4': return 'ISO-10646-UCS-4'; case 'csunicodeascii': case 'iso10646ucsbasic': return 'ISO-10646-UCS-Basic'; case 'csunicodelatin1': case 'iso10646': case 'iso10646unicodelatin1': return 'ISO-10646-Unicode-Latin1'; case 'csiso10646utf1': case 'iso10646utf1': return 'ISO-10646-UTF-1'; case 'csiso115481': case 'iso115481': case 'isotr115481': return 'ISO-11548-1'; case 'csiso90': case 'isoir90': return 'iso-ir-90'; case 'csunicodeibm1261': case 'isounicodeibm1261': return 'ISO-Unicode-IBM-1261'; case 'csunicodeibm1264': case 'isounicodeibm1264': return 'ISO-Unicode-IBM-1264'; case 'csunicodeibm1265': case 'isounicodeibm1265': return 'ISO-Unicode-IBM-1265'; case 'csunicodeibm1268': case 'isounicodeibm1268': return 'ISO-Unicode-IBM-1268'; case 'csunicodeibm1276': case 'isounicodeibm1276': return 'ISO-Unicode-IBM-1276'; case 'csiso646basic1983': case 'iso646basic1983': case 'ref': return 'ISO_646.basic:1983'; case 'csiso2intlrefversion': case 'irv': case 'iso646irv1983': case 'isoir2': return 'ISO_646.irv:1983'; case 'csiso2033': case 'e13b': case 'iso20331983': case 'isoir98': return 'ISO_2033-1983'; case 'csiso5427cyrillic': case 'iso5427': case 'isoir37': return 'ISO_5427'; case 'iso5427cyrillic1981': case 'iso54271981': case 'isoir54': return 'ISO_5427:1981'; case 'csiso5428greek': case 'iso54281980': case 'isoir55': return 'ISO_5428:1980'; case 'csiso6937add': case 'iso6937225': case 'isoir152': return 'ISO_6937-2-25'; case 'csisotextcomm': case 'iso69372add': case 'isoir142': return 'ISO_6937-2-add'; case 'csiso8859supp': case 'iso8859supp': case 'isoir154': case 'latin125': return 'ISO_8859-supp'; case 'csiso10367box': case 'iso10367box': case 'isoir155': return 'ISO_10367-box'; case 'csiso15italian': case 'iso646it': case 'isoir15': case 'it': return 'IT'; case 'csiso13jisc6220jp': case 'isoir13': case 'jisc62201969': case 'jisc62201969jp': case 'katakana': case 'x2017': return 'JIS_C6220-1969-jp'; case 'csiso14jisc6220ro': case 'iso646jp': case 'isoir14': case 'jisc62201969ro': case 'jp': return 'JIS_C6220-1969-ro'; case 'csiso42jisc62261978': case 'isoir42': case 'jisc62261978': return 'JIS_C6226-1978'; case 'csiso87jisx208': case 'isoir87': case 'jisc62261983': case 'jisx2081983': case 'x208': return 'JIS_C6226-1983'; case 'csiso91jisc62291984a': case 'isoir91': case 'jisc62291984a': case 'jpocra': return 'JIS_C6229-1984-a'; case 'csiso92jisc62991984b': case 'iso646jpocrb': case 'isoir92': case 'jisc62291984b': case 'jpocrb': return 'JIS_C6229-1984-b'; case 'csiso93jis62291984badd': case 'isoir93': case 'jisc62291984badd': case 'jpocrbadd': return 'JIS_C6229-1984-b-add'; case 'csiso94jis62291984hand': case 'isoir94': case 'jisc62291984hand': case 'jpocrhand': return 'JIS_C6229-1984-hand'; case 'csiso95jis62291984handadd': case 'isoir95': case 'jisc62291984handadd': case 'jpocrhandadd': return 'JIS_C6229-1984-hand-add'; case 'csiso96jisc62291984kana': case 'isoir96': case 'jisc62291984kana': return 'JIS_C6229-1984-kana'; case 'csjisencoding': case 'jisencoding': return 'JIS_Encoding'; case 'cshalfwidthkatakana': case 'jisx201': case 'x201': return 'JIS_X0201'; case 'csiso159jisx2121990': case 'isoir159': case 'jisx2121990': case 'x212': return 'JIS_X0212-1990'; case 'csiso141jusib1002': case 'iso646yu': case 'isoir141': case 'js': case 'jusib1002': case 'yu': return 'JUS_I.B1.002'; case 'csiso147macedonian': case 'isoir147': case 'jusib1003mac': case 'macedonian': return 'JUS_I.B1.003-mac'; case 'csiso146serbian': case 'isoir146': case 'jusib1003serb': case 'serbian': return 'JUS_I.B1.003-serb'; case 'koi7switched': return 'KOI7-switched'; case 'cskoi8r': case 'koi8r': return 'KOI8-R'; case 'koi8u': return 'KOI8-U'; case 'csksc5636': case 'iso646kr': case 'ksc5636': return 'KSC5636'; case 'cskz1048': case 'kz1048': case 'rk1048': case 'strk10482002': return 'KZ-1048'; case 'csiso19latingreek': case 'isoir19': case 'latingreek': return 'latin-greek'; case 'csiso27latingreek1': case 'isoir27': case 'latingreek1': return 'Latin-greek-1'; case 'csiso158lap': case 'isoir158': case 'lap': case 'latinlap': return 'latin-lap'; case 'csmacintosh': case 'mac': case 'macintosh': return 'macintosh'; case 'csmicrosoftpublishing': case 'microsoftpublishing': return 'Microsoft-Publishing'; case 'csmnem': case 'mnem': return 'MNEM'; case 'csmnemonic': case 'mnemonic': return 'MNEMONIC'; case 'csiso86hungarian': case 'hu': case 'iso646hu': case 'isoir86': case 'msz77953': return 'MSZ_7795.3'; case 'csnatsdano': case 'isoir91': case 'natsdano': return 'NATS-DANO'; case 'csnatsdanoadd': case 'isoir92': case 'natsdanoadd': return 'NATS-DANO-ADD'; case 'csnatssefi': case 'isoir81': case 'natssefi': return 'NATS-SEFI'; case 'csnatssefiadd': case 'isoir82': case 'natssefiadd': return 'NATS-SEFI-ADD'; case 'csiso151cuba': case 'cuba': case 'iso646cu': case 'isoir151': case 'ncnc1081': return 'NC_NC00-10:81'; case 'csiso69french': case 'fr': case 'iso646fr': case 'isoir69': case 'nfz62010': return 'NF_Z_62-010'; case 'csiso25french': case 'iso646fr1': case 'isoir25': case 'nfz620101973': return 'NF_Z_62-010_(1973)'; case 'csiso60danishnorwegian': case 'csiso60norwegian1': case 'iso646no': case 'isoir60': case 'no': case 'ns45511': return 'NS_4551-1'; case 'csiso61norwegian2': case 'iso646no2': case 'isoir61': case 'no2': case 'ns45512': return 'NS_4551-2'; case 'osdebcdicdf3irv': return 'OSD_EBCDIC_DF03_IRV'; case 'osdebcdicdf41': return 'OSD_EBCDIC_DF04_1'; case 'osdebcdicdf415': return 'OSD_EBCDIC_DF04_15'; case 'cspc8danishnorwegian': case 'pc8danishnorwegian': return 'PC8-Danish-Norwegian'; case 'cspc8turkish': case 'pc8turkish': return 'PC8-Turkish'; case 'csiso16portuguese': case 'iso646pt': case 'isoir16': case 'pt': return 'PT'; case 'csiso84portuguese2': case 'iso646pt2': case 'isoir84': case 'pt2': return 'PT2'; case 'cp154': case 'csptcp154': case 'cyrillicasian': case 'pt154': case 'ptcp154': return 'PTCP154'; case 'scsu': return 'SCSU'; case 'csiso10swedish': case 'fi': case 'iso646fi': case 'iso646se': case 'isoir10': case 'se': case 'sen850200b': return 'SEN_850200_B'; case 'csiso11swedishfornames': case 'iso646se2': case 'isoir11': case 'se2': case 'sen850200c': return 'SEN_850200_C'; case 'csiso102t617bit': case 'isoir102': case 't617bit': return 'T.61-7bit'; case 'csiso103t618bit': case 'isoir103': case 't61': case 't618bit': return 'T.61-8bit'; case 'csiso128t101g2': case 'isoir128': case 't101g2': return 'T.101-G2'; case 'cstscii': case 'tscii': return 'TSCII'; case 'csunicode11': case 'unicode11': return 'UNICODE-1-1'; case 'csunicode11utf7': case 'unicode11utf7': return 'UNICODE-1-1-UTF-7'; case 'csunknown8bit': case 'unknown8bit': return 'UNKNOWN-8BIT'; case 'ansix341968': case 'ansix341986': case 'ascii': case 'cp367': case 'csascii': case 'ibm367': case 'iso646irv1991': case 'iso646us': case 'isoir6': case 'us': case 'usascii': return 'US-ASCII'; case 'csusdk': case 'usdk': return 'us-dk'; case 'utf7': return 'UTF-7'; case 'utf8': return 'UTF-8'; case 'utf16': return 'UTF-16'; case 'utf16be': return 'UTF-16BE'; case 'utf16le': return 'UTF-16LE'; case 'utf32': return 'UTF-32'; case 'utf32be': return 'UTF-32BE'; case 'utf32le': return 'UTF-32LE'; case 'csventurainternational': case 'venturainternational': return 'Ventura-International'; case 'csventuramath': case 'venturamath': return 'Ventura-Math'; case 'csventuraus': case 'venturaus': return 'Ventura-US'; case 'csiso70videotexsupp1': case 'isoir70': case 'videotexsuppl': return 'videotex-suppl'; case 'csviqr': case 'viqr': return 'VIQR'; case 'csviscii': case 'viscii': return 'VISCII'; case 'csshiftjis': case 'cswindows31j': case 'mskanji': case 'shiftjis': case 'windows31j': return 'Windows-31J'; case 'iso885911': case 'tis620': return 'windows-874'; case 'cseuckr': case 'csksc56011987': case 'euckr': case 'isoir149': case 'korean': case 'ksc5601': case 'ksc56011987': case 'ksc56011989': case 'windows949': return 'windows-949'; case 'windows1250': return 'windows-1250'; case 'windows1251': return 'windows-1251'; case 'cp819': case 'csisolatin1': case 'ibm819': case 'iso88591': case 'iso885911987': case 'isoir100': case 'l1': case 'latin1': case 'windows1252': return 'windows-1252'; case 'windows1253': return 'windows-1253'; case 'csisolatin5': case 'iso88599': case 'iso885991989': case 'isoir148': case 'l5': case 'latin5': case 'windows1254': return 'windows-1254'; case 'windows1255': return 'windows-1255'; case 'windows1256': return 'windows-1256'; case 'windows1257': return 'windows-1257'; case 'windows1258': return 'windows-1258'; default: return $charset; } } public static function get_curl_version() { if (is_array($curl = curl_version())) { $curl = $curl['version']; } elseif (substr($curl, 0, 5) === 'curl/') { $curl = substr($curl, 5, strcspn($curl, "\x09\x0A\x0B\x0C\x0D", 5)); } elseif (substr($curl, 0, 8) === 'libcurl/') { $curl = substr($curl, 8, strcspn($curl, "\x09\x0A\x0B\x0C\x0D", 8)); } else { $curl = 0; } return $curl; } /** * Strip HTML comments * * @param string $data Data to strip comments from * @return string Comment stripped string */ public static function strip_comments($data) { $output = ''; while (($start = strpos($data, '<!--')) !== false) { $output .= substr($data, 0, $start); if (($end = strpos($data, '-->', $start)) !== false) { $data = substr_replace($data, '', 0, $end + 3); } else { $data = ''; } } return $output . $data; } public static function parse_date($dt) { $parser = SimplePie_Parse_Date::get(); return $parser->parse($dt); } /** * Decode HTML entities * * @deprecated Use DOMDocument instead * @param string $data Input data * @return string Output data */ public static function entities_decode($data) { $decoder = new SimplePie_Decode_HTML_Entities($data); return $decoder->parse(); } /** * Remove RFC822 comments * * @param string $data Data to strip comments from * @return string Comment stripped string */ public static function uncomment_rfc822($string) { $string = (string) $string; $position = 0; $length = strlen($string); $depth = 0; $output = ''; while ($position < $length && ($pos = strpos($string, '(', $position)) !== false) { $output .= substr($string, $position, $pos - $position); $position = $pos + 1; if ($string[$pos - 1] !== '\\') { $depth++; while ($depth && $position < $length) { $position += strcspn($string, '()', $position); if ($string[$position - 1] === '\\') { $position++; continue; } elseif (isset($string[$position])) { switch ($string[$position]) { case '(': $depth++; break; case ')': $depth--; break; } $position++; } else { break; } } } else { $output .= '('; } } $output .= substr($string, $position); return $output; } public static function parse_mime($mime) { if (($pos = strpos($mime, ';')) === false) { return trim($mime); } else { return trim(substr($mime, 0, $pos)); } } public static function atom_03_construct_type($attribs) { if (isset($attribs['']['mode']) && strtolower(trim($attribs['']['mode']) === 'base64')) { $mode = SIMPLEPIE_CONSTRUCT_BASE64; } else { $mode = SIMPLEPIE_CONSTRUCT_NONE; } if (isset($attribs['']['type'])) { switch (strtolower(trim($attribs['']['type']))) { case 'text': case 'text/plain': return SIMPLEPIE_CONSTRUCT_TEXT | $mode; case 'html': case 'text/html': return SIMPLEPIE_CONSTRUCT_HTML | $mode; case 'xhtml': case 'application/xhtml+xml': return SIMPLEPIE_CONSTRUCT_XHTML | $mode; default: return SIMPLEPIE_CONSTRUCT_NONE | $mode; } } else { return SIMPLEPIE_CONSTRUCT_TEXT | $mode; } } public static function atom_10_construct_type($attribs) { if (isset($attribs['']['type'])) { switch (strtolower(trim($attribs['']['type']))) { case 'text': return SIMPLEPIE_CONSTRUCT_TEXT; case 'html': return SIMPLEPIE_CONSTRUCT_HTML; case 'xhtml': return SIMPLEPIE_CONSTRUCT_XHTML; default: return SIMPLEPIE_CONSTRUCT_NONE; } } return SIMPLEPIE_CONSTRUCT_TEXT; } public static function atom_10_content_construct_type($attribs) { if (isset($attribs['']['type'])) { $type = strtolower(trim($attribs['']['type'])); switch ($type) { case 'text': return SIMPLEPIE_CONSTRUCT_TEXT; case 'html': return SIMPLEPIE_CONSTRUCT_HTML; case 'xhtml': return SIMPLEPIE_CONSTRUCT_XHTML; } if (in_array(substr($type, -4), array('+xml', '/xml')) || substr($type, 0, 5) === 'text/') { return SIMPLEPIE_CONSTRUCT_NONE; } else { return SIMPLEPIE_CONSTRUCT_BASE64; } } else { return SIMPLEPIE_CONSTRUCT_TEXT; } } public static function is_isegment_nz_nc($string) { return (bool) preg_match('/^([A-Za-z0-9\-._~\x{A0}-\x{D7FF}\x{F900}-\x{FDCF}\x{FDF0}-\x{FFEF}\x{10000}-\x{1FFFD}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}\x{40000}-\x{4FFFD}\x{50000}-\x{5FFFD}\x{60000}-\x{6FFFD}\x{70000}-\x{7FFFD}\x{80000}-\x{8FFFD}\x{90000}-\x{9FFFD}\x{A0000}-\x{AFFFD}\x{B0000}-\x{BFFFD}\x{C0000}-\x{CFFFD}\x{D0000}-\x{DFFFD}\x{E1000}-\x{EFFFD}!$&\'()*+,;=@]|(%[0-9ABCDEF]{2}))+$/u', $string); } public static function space_seperated_tokens($string) { $space_characters = "\x20\x09\x0A\x0B\x0C\x0D"; $string_length = strlen($string); $position = strspn($string, $space_characters); $tokens = array(); while ($position < $string_length) { $len = strcspn($string, $space_characters, $position); $tokens[] = substr($string, $position, $len); $position += $len; $position += strspn($string, $space_characters, $position); } return $tokens; } /** * Converts a unicode codepoint to a UTF-8 character * * @static * @param int $codepoint Unicode codepoint * @return string UTF-8 character */ public static function codepoint_to_utf8($codepoint) { $codepoint = (int) $codepoint; if ($codepoint < 0) { return false; } else if ($codepoint <= 0x7f) { return chr($codepoint); } else if ($codepoint <= 0x7ff) { return chr(0xc0 | ($codepoint >> 6)) . chr(0x80 | ($codepoint & 0x3f)); } else if ($codepoint <= 0xffff) { return chr(0xe0 | ($codepoint >> 12)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f)); } else if ($codepoint <= 0x10ffff) { return chr(0xf0 | ($codepoint >> 18)) . chr(0x80 | (($codepoint >> 12) & 0x3f)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f)); } else { // U+FFFD REPLACEMENT CHARACTER return "\xEF\xBF\xBD"; } } /** * Similar to parse_str() * * Returns an associative array of name/value pairs, where the value is an * array of values that have used the same name * * @static * @param string $str The input string. * @return array */ public static function parse_str($str) { $return = array(); $str = explode('&', $str); foreach ($str as $section) { if (strpos($section, '=') !== false) { list($name, $value) = explode('=', $section, 2); $return[urldecode($name)][] = urldecode($value); } else { $return[urldecode($section)][] = null; } } return $return; } /** * Detect XML encoding, as per XML 1.0 Appendix F.1 * * @todo Add support for EBCDIC * @param string $data XML data * @param SimplePie_Registry $registry Class registry * @return array Possible encodings */ public static function xml_encoding($data, $registry) { // UTF-32 Big Endian BOM if (substr($data, 0, 4) === "\x00\x00\xFE\xFF") { $encoding[] = 'UTF-32BE'; } // UTF-32 Little Endian BOM elseif (substr($data, 0, 4) === "\xFF\xFE\x00\x00") { $encoding[] = 'UTF-32LE'; } // UTF-16 Big Endian BOM elseif (substr($data, 0, 2) === "\xFE\xFF") { $encoding[] = 'UTF-16BE'; } // UTF-16 Little Endian BOM elseif (substr($data, 0, 2) === "\xFF\xFE") { $encoding[] = 'UTF-16LE'; } // UTF-8 BOM elseif (substr($data, 0, 3) === "\xEF\xBB\xBF") { $encoding[] = 'UTF-8'; } // UTF-32 Big Endian Without BOM elseif (substr($data, 0, 20) === "\x00\x00\x00\x3C\x00\x00\x00\x3F\x00\x00\x00\x78\x00\x00\x00\x6D\x00\x00\x00\x6C") { if ($pos = strpos($data, "\x00\x00\x00\x3F\x00\x00\x00\x3E")) { $parser = $registry->create('XML_Declaration_Parser', array(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32BE', 'UTF-8'))); if ($parser->parse()) { $encoding[] = $parser->encoding; } } $encoding[] = 'UTF-32BE'; } // UTF-32 Little Endian Without BOM elseif (substr($data, 0, 20) === "\x3C\x00\x00\x00\x3F\x00\x00\x00\x78\x00\x00\x00\x6D\x00\x00\x00\x6C\x00\x00\x00") { if ($pos = strpos($data, "\x3F\x00\x00\x00\x3E\x00\x00\x00")) { $parser = $registry->create('XML_Declaration_Parser', array(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32LE', 'UTF-8'))); if ($parser->parse()) { $encoding[] = $parser->encoding; } } $encoding[] = 'UTF-32LE'; } // UTF-16 Big Endian Without BOM elseif (substr($data, 0, 10) === "\x00\x3C\x00\x3F\x00\x78\x00\x6D\x00\x6C") { if ($pos = strpos($data, "\x00\x3F\x00\x3E")) { $parser = $registry->create('XML_Declaration_Parser', array(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16BE', 'UTF-8'))); if ($parser->parse()) { $encoding[] = $parser->encoding; } } $encoding[] = 'UTF-16BE'; } // UTF-16 Little Endian Without BOM elseif (substr($data, 0, 10) === "\x3C\x00\x3F\x00\x78\x00\x6D\x00\x6C\x00") { if ($pos = strpos($data, "\x3F\x00\x3E\x00")) { $parser = $registry->create('XML_Declaration_Parser', array(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16LE', 'UTF-8'))); if ($parser->parse()) { $encoding[] = $parser->encoding; } } $encoding[] = 'UTF-16LE'; } // US-ASCII (or superset) elseif (substr($data, 0, 5) === "\x3C\x3F\x78\x6D\x6C") { if ($pos = strpos($data, "\x3F\x3E")) { $parser = $registry->create('XML_Declaration_Parser', array(substr($data, 5, $pos - 5))); if ($parser->parse()) { $encoding[] = $parser->encoding; } } $encoding[] = 'UTF-8'; } // Fallback to UTF-8 else { $encoding[] = 'UTF-8'; } return $encoding; } public static function output_javascript() { if (function_exists('ob_gzhandler')) { ob_start('ob_gzhandler'); } header('Content-type: text/javascript; charset: UTF-8'); header('Cache-Control: must-revalidate'); header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 604800) . ' GMT'); // 7 days ?> function embed_quicktime(type, bgcolor, width, height, link, placeholder, loop) { if (placeholder != '') { document.writeln('<embed type="'+type+'" style="cursor:hand; cursor:pointer;" href="'+link+'" src="'+placeholder+'" width="'+width+'" height="'+height+'" autoplay="false" target="myself" controller="false" loop="'+loop+'" scale="aspect" bgcolor="'+bgcolor+'" pluginspage="http://www.apple.com/quicktime/download/"></embed>'); } else { document.writeln('<embed type="'+type+'" style="cursor:hand; cursor:pointer;" src="'+link+'" width="'+width+'" height="'+height+'" autoplay="false" target="myself" controller="true" loop="'+loop+'" scale="aspect" bgcolor="'+bgcolor+'" pluginspage="http://www.apple.com/quicktime/download/"></embed>'); } } function embed_flash(bgcolor, width, height, link, loop, type) { document.writeln('<embed src="'+link+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="'+type+'" quality="high" width="'+width+'" height="'+height+'" bgcolor="'+bgcolor+'" loop="'+loop+'"></embed>'); } function embed_flv(width, height, link, placeholder, loop, player) { document.writeln('<embed src="'+player+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="high" width="'+width+'" height="'+height+'" wmode="transparent" flashvars="file='+link+'&autostart=false&repeat='+loop+'&showdigits=true&showfsbutton=false"></embed>'); } function embed_wmedia(width, height, link) { document.writeln('<embed type="application/x-mplayer2" src="'+link+'" autosize="1" width="'+width+'" height="'+height+'" showcontrols="1" showstatusbar="0" showdisplay="0" autostart="0"></embed>'); } <?php } /** * Get the SimplePie build timestamp * * Uses the git index if it exists, otherwise uses the modification time * of the newest file. */ public static function get_build() { $root = dirname(dirname(__FILE__)); if (file_exists($root . '/.git/index')) { return filemtime($root . '/.git/index'); } elseif (file_exists($root . '/SimplePie')) { $time = 0; foreach (glob($root . '/SimplePie/*.php') as $file) { if (($mtime = filemtime($file)) > $time) { $time = $mtime; } } return $time; } elseif (file_exists(dirname(__FILE__) . '/Core.php')) { return filemtime(dirname(__FILE__) . '/Core.php'); } else { return filemtime(__FILE__); } } /** * Format debugging information */ public static function debug(&$sp) { $info = 'SimplePie ' . SIMPLEPIE_VERSION . ' Build ' . SIMPLEPIE_BUILD . "\n"; $info .= 'PHP ' . PHP_VERSION . "\n"; if ($sp->error() !== null) { $info .= 'Error occurred: ' . $sp->error() . "\n"; } else { $info .= "No error found.\n"; } $info .= "Extensions:\n"; $extensions = array('pcre', 'curl', 'zlib', 'mbstring', 'iconv', 'xmlreader', 'xml'); foreach ($extensions as $ext) { if (extension_loaded($ext)) { $info .= " $ext loaded\n"; switch ($ext) { case 'pcre': $info .= ' Version ' . PCRE_VERSION . "\n"; break; case 'curl': $version = curl_version(); $info .= ' Version ' . $version['version'] . "\n"; break; case 'mbstring': $info .= ' Overloading: ' . mb_get_info('func_overload') . "\n"; break; case 'iconv': $info .= ' Version ' . ICONV_VERSION . "\n"; break; case 'xml': $info .= ' Version ' . LIBXML_DOTTED_VERSION . "\n"; break; } } else { $info .= " $ext not loaded\n"; } } return $info; } public static function silence_errors($num, $str) { // No-op } } ���������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Net/�����������������������������������������������������0000775�0000000�0000000�00000000000�12266004471�0020773�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Net/IPv6.php���������������������������������������������0000664�0000000�0000000�00000016630�12266004471�0022276�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Class to validate and to work with IPv6 addresses. * * @package SimplePie * @subpackage HTTP * @copyright 2003-2005 The PHP Group * @license http://www.opensource.org/licenses/bsd-license.php * @link http://pear.php.net/package/Net_IPv6 * @author Alexander Merz <alexander.merz@web.de> * @author elfrink at introweb dot nl * @author Josh Peck <jmp at joshpeck dot org> * @author Geoffrey Sneddon <geoffers@gmail.com> */ class SimplePie_Net_IPv6 { /** * Uncompresses an IPv6 address * * RFC 4291 allows you to compress concecutive zero pieces in an address to * '::'. This method expects a valid IPv6 address and expands the '::' to * the required number of zero pieces. * * Example: FF01::101 -> FF01:0:0:0:0:0:0:101 * ::1 -> 0:0:0:0:0:0:0:1 * * @author Alexander Merz <alexander.merz@web.de> * @author elfrink at introweb dot nl * @author Josh Peck <jmp at joshpeck dot org> * @copyright 2003-2005 The PHP Group * @license http://www.opensource.org/licenses/bsd-license.php * @param string $ip An IPv6 address * @return string The uncompressed IPv6 address */ public static function uncompress($ip) { $c1 = -1; $c2 = -1; if (substr_count($ip, '::') === 1) { list($ip1, $ip2) = explode('::', $ip); if ($ip1 === '') { $c1 = -1; } else { $c1 = substr_count($ip1, ':'); } if ($ip2 === '') { $c2 = -1; } else { $c2 = substr_count($ip2, ':'); } if (strpos($ip2, '.') !== false) { $c2++; } // :: if ($c1 === -1 && $c2 === -1) { $ip = '0:0:0:0:0:0:0:0'; } // ::xxx else if ($c1 === -1) { $fill = str_repeat('0:', 7 - $c2); $ip = str_replace('::', $fill, $ip); } // xxx:: else if ($c2 === -1) { $fill = str_repeat(':0', 7 - $c1); $ip = str_replace('::', $fill, $ip); } // xxx::xxx else { $fill = ':' . str_repeat('0:', 6 - $c2 - $c1); $ip = str_replace('::', $fill, $ip); } } return $ip; } /** * Compresses an IPv6 address * * RFC 4291 allows you to compress concecutive zero pieces in an address to * '::'. This method expects a valid IPv6 address and compresses consecutive * zero pieces to '::'. * * Example: FF01:0:0:0:0:0:0:101 -> FF01::101 * 0:0:0:0:0:0:0:1 -> ::1 * * @see uncompress() * @param string $ip An IPv6 address * @return string The compressed IPv6 address */ public static function compress($ip) { // Prepare the IP to be compressed $ip = self::uncompress($ip); $ip_parts = self::split_v6_v4($ip); // Replace all leading zeros $ip_parts[0] = preg_replace('/(^|:)0+([0-9])/', '\1\2', $ip_parts[0]); // Find bunches of zeros if (preg_match_all('/(?:^|:)(?:0(?::|$))+/', $ip_parts[0], $matches, PREG_OFFSET_CAPTURE)) { $max = 0; $pos = null; foreach ($matches[0] as $match) { if (strlen($match[0]) > $max) { $max = strlen($match[0]); $pos = $match[1]; } } $ip_parts[0] = substr_replace($ip_parts[0], '::', $pos, $max); } if ($ip_parts[1] !== '') { return implode(':', $ip_parts); } else { return $ip_parts[0]; } } /** * Splits an IPv6 address into the IPv6 and IPv4 representation parts * * RFC 4291 allows you to represent the last two parts of an IPv6 address * using the standard IPv4 representation * * Example: 0:0:0:0:0:0:13.1.68.3 * 0:0:0:0:0:FFFF:129.144.52.38 * * @param string $ip An IPv6 address * @return array [0] contains the IPv6 represented part, and [1] the IPv4 represented part */ private static function split_v6_v4($ip) { if (strpos($ip, '.') !== false) { $pos = strrpos($ip, ':'); $ipv6_part = substr($ip, 0, $pos); $ipv4_part = substr($ip, $pos + 1); return array($ipv6_part, $ipv4_part); } else { return array($ip, ''); } } /** * Checks an IPv6 address * * Checks if the given IP is a valid IPv6 address * * @param string $ip An IPv6 address * @return bool true if $ip is a valid IPv6 address */ public static function check_ipv6($ip) { $ip = self::uncompress($ip); list($ipv6, $ipv4) = self::split_v6_v4($ip); $ipv6 = explode(':', $ipv6); $ipv4 = explode('.', $ipv4); if (count($ipv6) === 8 && count($ipv4) === 1 || count($ipv6) === 6 && count($ipv4) === 4) { foreach ($ipv6 as $ipv6_part) { // The section can't be empty if ($ipv6_part === '') return false; // Nor can it be over four characters if (strlen($ipv6_part) > 4) return false; // Remove leading zeros (this is safe because of the above) $ipv6_part = ltrim($ipv6_part, '0'); if ($ipv6_part === '') $ipv6_part = '0'; // Check the value is valid $value = hexdec($ipv6_part); if (dechex($value) !== strtolower($ipv6_part) || $value < 0 || $value > 0xFFFF) return false; } if (count($ipv4) === 4) { foreach ($ipv4 as $ipv4_part) { $value = (int) $ipv4_part; if ((string) $value !== $ipv4_part || $value < 0 || $value > 0xFF) return false; } } return true; } else { return false; } } /** * Checks if the given IP is a valid IPv6 address * * @codeCoverageIgnore * @deprecated Use {@see SimplePie_Net_IPv6::check_ipv6()} instead * @see check_ipv6 * @param string $ip An IPv6 address * @return bool true if $ip is a valid IPv6 address */ public static function checkIPv6($ip) { return self::check_ipv6($ip); } } ��������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Parse/���������������������������������������������������0000775�0000000�0000000�00000000000�12266004471�0021317�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Parse/Date.php�������������������������������������������0000664�0000000�0000000�00000046343�12266004471�0022717�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Date Parser * * @package SimplePie * @subpackage Parsing */ class SimplePie_Parse_Date { /** * Input data * * @access protected * @var string */ var $date; /** * List of days, calendar day name => ordinal day number in the week * * @access protected * @var array */ var $day = array( // English 'mon' => 1, 'monday' => 1, 'tue' => 2, 'tuesday' => 2, 'wed' => 3, 'wednesday' => 3, 'thu' => 4, 'thursday' => 4, 'fri' => 5, 'friday' => 5, 'sat' => 6, 'saturday' => 6, 'sun' => 7, 'sunday' => 7, // Dutch 'maandag' => 1, 'dinsdag' => 2, 'woensdag' => 3, 'donderdag' => 4, 'vrijdag' => 5, 'zaterdag' => 6, 'zondag' => 7, // French 'lundi' => 1, 'mardi' => 2, 'mercredi' => 3, 'jeudi' => 4, 'vendredi' => 5, 'samedi' => 6, 'dimanche' => 7, // German 'montag' => 1, 'dienstag' => 2, 'mittwoch' => 3, 'donnerstag' => 4, 'freitag' => 5, 'samstag' => 6, 'sonnabend' => 6, 'sonntag' => 7, // Italian 'lunedì' => 1, 'martedì' => 2, 'mercoledì' => 3, 'giovedì' => 4, 'venerdì' => 5, 'sabato' => 6, 'domenica' => 7, // Spanish 'lunes' => 1, 'martes' => 2, 'miércoles' => 3, 'jueves' => 4, 'viernes' => 5, 'sábado' => 6, 'domingo' => 7, // Finnish 'maanantai' => 1, 'tiistai' => 2, 'keskiviikko' => 3, 'torstai' => 4, 'perjantai' => 5, 'lauantai' => 6, 'sunnuntai' => 7, // Hungarian 'hétfő' => 1, 'kedd' => 2, 'szerda' => 3, 'csütörtok' => 4, 'péntek' => 5, 'szombat' => 6, 'vasárnap' => 7, // Greek 'Δευ' => 1, 'Τρι' => 2, 'Τετ' => 3, 'Πεμ' => 4, 'Παρ' => 5, 'Σαβ' => 6, 'Κυρ' => 7, ); /** * List of months, calendar month name => calendar month number * * @access protected * @var array */ var $month = array( // English 'jan' => 1, 'january' => 1, 'feb' => 2, 'february' => 2, 'mar' => 3, 'march' => 3, 'apr' => 4, 'april' => 4, 'may' => 5, // No long form of May 'jun' => 6, 'june' => 6, 'jul' => 7, 'july' => 7, 'aug' => 8, 'august' => 8, 'sep' => 9, 'september' => 8, 'oct' => 10, 'october' => 10, 'nov' => 11, 'november' => 11, 'dec' => 12, 'december' => 12, // Dutch 'januari' => 1, 'februari' => 2, 'maart' => 3, 'april' => 4, 'mei' => 5, 'juni' => 6, 'juli' => 7, 'augustus' => 8, 'september' => 9, 'oktober' => 10, 'november' => 11, 'december' => 12, // French 'janvier' => 1, 'février' => 2, 'mars' => 3, 'avril' => 4, 'mai' => 5, 'juin' => 6, 'juillet' => 7, 'août' => 8, 'septembre' => 9, 'octobre' => 10, 'novembre' => 11, 'décembre' => 12, // German 'januar' => 1, 'februar' => 2, 'märz' => 3, 'april' => 4, 'mai' => 5, 'juni' => 6, 'juli' => 7, 'august' => 8, 'september' => 9, 'oktober' => 10, 'november' => 11, 'dezember' => 12, // Italian 'gennaio' => 1, 'febbraio' => 2, 'marzo' => 3, 'aprile' => 4, 'maggio' => 5, 'giugno' => 6, 'luglio' => 7, 'agosto' => 8, 'settembre' => 9, 'ottobre' => 10, 'novembre' => 11, 'dicembre' => 12, // Spanish 'enero' => 1, 'febrero' => 2, 'marzo' => 3, 'abril' => 4, 'mayo' => 5, 'junio' => 6, 'julio' => 7, 'agosto' => 8, 'septiembre' => 9, 'setiembre' => 9, 'octubre' => 10, 'noviembre' => 11, 'diciembre' => 12, // Finnish 'tammikuu' => 1, 'helmikuu' => 2, 'maaliskuu' => 3, 'huhtikuu' => 4, 'toukokuu' => 5, 'kesäkuu' => 6, 'heinäkuu' => 7, 'elokuu' => 8, 'suuskuu' => 9, 'lokakuu' => 10, 'marras' => 11, 'joulukuu' => 12, // Hungarian 'január' => 1, 'február' => 2, 'március' => 3, 'április' => 4, 'május' => 5, 'június' => 6, 'július' => 7, 'augusztus' => 8, 'szeptember' => 9, 'október' => 10, 'november' => 11, 'december' => 12, // Greek 'Ιαν' => 1, 'Φεβ' => 2, 'Μάώ' => 3, 'Μαώ' => 3, 'Απρ' => 4, 'Μάι' => 5, 'Μαϊ' => 5, 'Μαι' => 5, 'Ιούν' => 6, 'Ιον' => 6, 'Ιούλ' => 7, 'Ιολ' => 7, 'Αύγ' => 8, 'Αυγ' => 8, 'Σεπ' => 9, 'Οκτ' => 10, 'Νοέ' => 11, 'Δεκ' => 12, ); /** * List of timezones, abbreviation => offset from UTC * * @access protected * @var array */ var $timezone = array( 'ACDT' => 37800, 'ACIT' => 28800, 'ACST' => 34200, 'ACT' => -18000, 'ACWDT' => 35100, 'ACWST' => 31500, 'AEDT' => 39600, 'AEST' => 36000, 'AFT' => 16200, 'AKDT' => -28800, 'AKST' => -32400, 'AMDT' => 18000, 'AMT' => -14400, 'ANAST' => 46800, 'ANAT' => 43200, 'ART' => -10800, 'AZOST' => -3600, 'AZST' => 18000, 'AZT' => 14400, 'BIOT' => 21600, 'BIT' => -43200, 'BOT' => -14400, 'BRST' => -7200, 'BRT' => -10800, 'BST' => 3600, 'BTT' => 21600, 'CAST' => 18000, 'CAT' => 7200, 'CCT' => 23400, 'CDT' => -18000, 'CEDT' => 7200, 'CET' => 3600, 'CGST' => -7200, 'CGT' => -10800, 'CHADT' => 49500, 'CHAST' => 45900, 'CIST' => -28800, 'CKT' => -36000, 'CLDT' => -10800, 'CLST' => -14400, 'COT' => -18000, 'CST' => -21600, 'CVT' => -3600, 'CXT' => 25200, 'DAVT' => 25200, 'DTAT' => 36000, 'EADT' => -18000, 'EAST' => -21600, 'EAT' => 10800, 'ECT' => -18000, 'EDT' => -14400, 'EEST' => 10800, 'EET' => 7200, 'EGT' => -3600, 'EKST' => 21600, 'EST' => -18000, 'FJT' => 43200, 'FKDT' => -10800, 'FKST' => -14400, 'FNT' => -7200, 'GALT' => -21600, 'GEDT' => 14400, 'GEST' => 10800, 'GFT' => -10800, 'GILT' => 43200, 'GIT' => -32400, 'GST' => 14400, 'GST' => -7200, 'GYT' => -14400, 'HAA' => -10800, 'HAC' => -18000, 'HADT' => -32400, 'HAE' => -14400, 'HAP' => -25200, 'HAR' => -21600, 'HAST' => -36000, 'HAT' => -9000, 'HAY' => -28800, 'HKST' => 28800, 'HMT' => 18000, 'HNA' => -14400, 'HNC' => -21600, 'HNE' => -18000, 'HNP' => -28800, 'HNR' => -25200, 'HNT' => -12600, 'HNY' => -32400, 'IRDT' => 16200, 'IRKST' => 32400, 'IRKT' => 28800, 'IRST' => 12600, 'JFDT' => -10800, 'JFST' => -14400, 'JST' => 32400, 'KGST' => 21600, 'KGT' => 18000, 'KOST' => 39600, 'KOVST' => 28800, 'KOVT' => 25200, 'KRAST' => 28800, 'KRAT' => 25200, 'KST' => 32400, 'LHDT' => 39600, 'LHST' => 37800, 'LINT' => 50400, 'LKT' => 21600, 'MAGST' => 43200, 'MAGT' => 39600, 'MAWT' => 21600, 'MDT' => -21600, 'MESZ' => 7200, 'MEZ' => 3600, 'MHT' => 43200, 'MIT' => -34200, 'MNST' => 32400, 'MSDT' => 14400, 'MSST' => 10800, 'MST' => -25200, 'MUT' => 14400, 'MVT' => 18000, 'MYT' => 28800, 'NCT' => 39600, 'NDT' => -9000, 'NFT' => 41400, 'NMIT' => 36000, 'NOVST' => 25200, 'NOVT' => 21600, 'NPT' => 20700, 'NRT' => 43200, 'NST' => -12600, 'NUT' => -39600, 'NZDT' => 46800, 'NZST' => 43200, 'OMSST' => 25200, 'OMST' => 21600, 'PDT' => -25200, 'PET' => -18000, 'PETST' => 46800, 'PETT' => 43200, 'PGT' => 36000, 'PHOT' => 46800, 'PHT' => 28800, 'PKT' => 18000, 'PMDT' => -7200, 'PMST' => -10800, 'PONT' => 39600, 'PST' => -28800, 'PWT' => 32400, 'PYST' => -10800, 'PYT' => -14400, 'RET' => 14400, 'ROTT' => -10800, 'SAMST' => 18000, 'SAMT' => 14400, 'SAST' => 7200, 'SBT' => 39600, 'SCDT' => 46800, 'SCST' => 43200, 'SCT' => 14400, 'SEST' => 3600, 'SGT' => 28800, 'SIT' => 28800, 'SRT' => -10800, 'SST' => -39600, 'SYST' => 10800, 'SYT' => 7200, 'TFT' => 18000, 'THAT' => -36000, 'TJT' => 18000, 'TKT' => -36000, 'TMT' => 18000, 'TOT' => 46800, 'TPT' => 32400, 'TRUT' => 36000, 'TVT' => 43200, 'TWT' => 28800, 'UYST' => -7200, 'UYT' => -10800, 'UZT' => 18000, 'VET' => -14400, 'VLAST' => 39600, 'VLAT' => 36000, 'VOST' => 21600, 'VUT' => 39600, 'WAST' => 7200, 'WAT' => 3600, 'WDT' => 32400, 'WEST' => 3600, 'WFT' => 43200, 'WIB' => 25200, 'WIT' => 32400, 'WITA' => 28800, 'WKST' => 18000, 'WST' => 28800, 'YAKST' => 36000, 'YAKT' => 32400, 'YAPT' => 36000, 'YEKST' => 21600, 'YEKT' => 18000, ); /** * Cached PCRE for SimplePie_Parse_Date::$day * * @access protected * @var string */ var $day_pcre; /** * Cached PCRE for SimplePie_Parse_Date::$month * * @access protected * @var string */ var $month_pcre; /** * Array of user-added callback methods * * @access private * @var array */ var $built_in = array(); /** * Array of user-added callback methods * * @access private * @var array */ var $user = array(); /** * Create new SimplePie_Parse_Date object, and set self::day_pcre, * self::month_pcre, and self::built_in * * @access private */ public function __construct() { $this->day_pcre = '(' . implode(array_keys($this->day), '|') . ')'; $this->month_pcre = '(' . implode(array_keys($this->month), '|') . ')'; static $cache; if (!isset($cache[get_class($this)])) { $all_methods = get_class_methods($this); foreach ($all_methods as $method) { if (strtolower(substr($method, 0, 5)) === 'date_') { $cache[get_class($this)][] = $method; } } } foreach ($cache[get_class($this)] as $method) { $this->built_in[] = $method; } } /** * Get the object * * @access public */ public static function get() { static $object; if (!$object) { $object = new SimplePie_Parse_Date; } return $object; } /** * Parse a date * * @final * @access public * @param string $date Date to parse * @return int Timestamp corresponding to date string, or false on failure */ public function parse($date) { foreach ($this->user as $method) { if (($returned = call_user_func($method, $date)) !== false) { return $returned; } } foreach ($this->built_in as $method) { if (($returned = call_user_func(array($this, $method), $date)) !== false) { return $returned; } } return false; } /** * Add a callback method to parse a date * * @final * @access public * @param callback $callback */ public function add_callback($callback) { if (is_callable($callback)) { $this->user[] = $callback; } else { trigger_error('User-supplied function must be a valid callback', E_USER_WARNING); } } /** * Parse a superset of W3C-DTF (allows hyphens and colons to be omitted, as * well as allowing any of upper or lower case "T", horizontal tabs, or * spaces to be used as the time seperator (including more than one)) * * @access protected * @return int Timestamp */ public function date_w3cdtf($date) { static $pcre; if (!$pcre) { $year = '([0-9]{4})'; $month = $day = $hour = $minute = $second = '([0-9]{2})'; $decimal = '([0-9]*)'; $zone = '(?:(Z)|([+\-])([0-9]{1,2}):?([0-9]{1,2}))'; $pcre = '/^' . $year . '(?:-?' . $month . '(?:-?' . $day . '(?:[Tt\x09\x20]+' . $hour . '(?::?' . $minute . '(?::?' . $second . '(?:.' . $decimal . ')?)?)?' . $zone . ')?)?)?$/'; } if (preg_match($pcre, $date, $match)) { /* Capturing subpatterns: 1: Year 2: Month 3: Day 4: Hour 5: Minute 6: Second 7: Decimal fraction of a second 8: Zulu 9: Timezone ± 10: Timezone hours 11: Timezone minutes */ // Fill in empty matches for ($i = count($match); $i <= 3; $i++) { $match[$i] = '1'; } for ($i = count($match); $i <= 7; $i++) { $match[$i] = '0'; } // Numeric timezone if (isset($match[9]) && $match[9] !== '') { $timezone = $match[10] * 3600; $timezone += $match[11] * 60; if ($match[9] === '-') { $timezone = 0 - $timezone; } } else { $timezone = 0; } // Convert the number of seconds to an integer, taking decimals into account $second = round($match[6] + $match[7] / pow(10, strlen($match[7]))); return gmmktime($match[4], $match[5], $second, $match[2], $match[3], $match[1]) - $timezone; } else { return false; } } /** * Remove RFC822 comments * * @access protected * @param string $data Data to strip comments from * @return string Comment stripped string */ public function remove_rfc2822_comments($string) { $string = (string) $string; $position = 0; $length = strlen($string); $depth = 0; $output = ''; while ($position < $length && ($pos = strpos($string, '(', $position)) !== false) { $output .= substr($string, $position, $pos - $position); $position = $pos + 1; if ($string[$pos - 1] !== '\\') { $depth++; while ($depth && $position < $length) { $position += strcspn($string, '()', $position); if ($string[$position - 1] === '\\') { $position++; continue; } elseif (isset($string[$position])) { switch ($string[$position]) { case '(': $depth++; break; case ')': $depth--; break; } $position++; } else { break; } } } else { $output .= '('; } } $output .= substr($string, $position); return $output; } /** * Parse RFC2822's date format * * @access protected * @return int Timestamp */ public function date_rfc2822($date) { static $pcre; if (!$pcre) { $wsp = '[\x09\x20]'; $fws = '(?:' . $wsp . '+|' . $wsp . '*(?:\x0D\x0A' . $wsp . '+)+)'; $optional_fws = $fws . '?'; $day_name = $this->day_pcre; $month = $this->month_pcre; $day = '([0-9]{1,2})'; $hour = $minute = $second = '([0-9]{2})'; $year = '([0-9]{2,4})'; $num_zone = '([+\-])([0-9]{2})([0-9]{2})'; $character_zone = '([A-Z]{1,5})'; $zone = '(?:' . $num_zone . '|' . $character_zone . ')'; $pcre = '/(?:' . $optional_fws . $day_name . $optional_fws . ',)?' . $optional_fws . $day . $fws . $month . $fws . $year . $fws . $hour . $optional_fws . ':' . $optional_fws . $minute . '(?:' . $optional_fws . ':' . $optional_fws . $second . ')?' . $fws . $zone . '/i'; } if (preg_match($pcre, $this->remove_rfc2822_comments($date), $match)) { /* Capturing subpatterns: 1: Day name 2: Day 3: Month 4: Year 5: Hour 6: Minute 7: Second 8: Timezone ± 9: Timezone hours 10: Timezone minutes 11: Alphabetic timezone */ // Find the month number $month = $this->month[strtolower($match[3])]; // Numeric timezone if ($match[8] !== '') { $timezone = $match[9] * 3600; $timezone += $match[10] * 60; if ($match[8] === '-') { $timezone = 0 - $timezone; } } // Character timezone elseif (isset($this->timezone[strtoupper($match[11])])) { $timezone = $this->timezone[strtoupper($match[11])]; } // Assume everything else to be -0000 else { $timezone = 0; } // Deal with 2/3 digit years if ($match[4] < 50) { $match[4] += 2000; } elseif ($match[4] < 1000) { $match[4] += 1900; } // Second is optional, if it is empty set it to zero if ($match[7] !== '') { $second = $match[7]; } else { $second = 0; } return gmmktime($match[5], $match[6], $second, $month, $match[2], $match[4]) - $timezone; } else { return false; } } /** * Parse RFC850's date format * * @access protected * @return int Timestamp */ public function date_rfc850($date) { static $pcre; if (!$pcre) { $space = '[\x09\x20]+'; $day_name = $this->day_pcre; $month = $this->month_pcre; $day = '([0-9]{1,2})'; $year = $hour = $minute = $second = '([0-9]{2})'; $zone = '([A-Z]{1,5})'; $pcre = '/^' . $day_name . ',' . $space . $day . '-' . $month . '-' . $year . $space . $hour . ':' . $minute . ':' . $second . $space . $zone . '$/i'; } if (preg_match($pcre, $date, $match)) { /* Capturing subpatterns: 1: Day name 2: Day 3: Month 4: Year 5: Hour 6: Minute 7: Second 8: Timezone */ // Month $month = $this->month[strtolower($match[3])]; // Character timezone if (isset($this->timezone[strtoupper($match[8])])) { $timezone = $this->timezone[strtoupper($match[8])]; } // Assume everything else to be -0000 else { $timezone = 0; } // Deal with 2 digit year if ($match[4] < 50) { $match[4] += 2000; } else { $match[4] += 1900; } return gmmktime($match[5], $match[6], $match[7], $month, $match[2], $match[4]) - $timezone; } else { return false; } } /** * Parse C99's asctime()'s date format * * @access protected * @return int Timestamp */ public function date_asctime($date) { static $pcre; if (!$pcre) { $space = '[\x09\x20]+'; $wday_name = $this->day_pcre; $mon_name = $this->month_pcre; $day = '([0-9]{1,2})'; $hour = $sec = $min = '([0-9]{2})'; $year = '([0-9]{4})'; $terminator = '\x0A?\x00?'; $pcre = '/^' . $wday_name . $space . $mon_name . $space . $day . $space . $hour . ':' . $min . ':' . $sec . $space . $year . $terminator . '$/i'; } if (preg_match($pcre, $date, $match)) { /* Capturing subpatterns: 1: Day name 2: Month 3: Day 4: Hour 5: Minute 6: Second 7: Year */ $month = $this->month[strtolower($match[2])]; return gmmktime($match[4], $match[5], $match[6], $month, $match[3], $match[7]); } else { return false; } } /** * Parse dates using strtotime() * * @access protected * @return int Timestamp */ public function date_strtotime($date) { $strtotime = strtotime($date); if ($strtotime === -1 || $strtotime === false) { return false; } else { return $strtotime; } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Parser.php�����������������������������������������������0000664�0000000�0000000�00000027113�12266004471�0022216�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Parses XML into something sane * * * This class can be overloaded with {@see SimplePie::set_parser_class()} * * @package SimplePie * @subpackage Parsing */ class SimplePie_Parser { var $error_code; var $error_string; var $current_line; var $current_column; var $current_byte; var $separator = ' '; var $namespace = array(''); var $element = array(''); var $xml_base = array(''); var $xml_base_explicit = array(false); var $xml_lang = array(''); var $data = array(); var $datas = array(array()); var $current_xhtml_construct = -1; var $encoding; protected $registry; public function set_registry(SimplePie_Registry $registry) { $this->registry = $registry; } public function parse(&$data, $encoding) { // Use UTF-8 if we get passed US-ASCII, as every US-ASCII character is a UTF-8 character if (strtoupper($encoding) === 'US-ASCII') { $this->encoding = 'UTF-8'; } else { $this->encoding = $encoding; } // Strip BOM: // UTF-32 Big Endian BOM if (substr($data, 0, 4) === "\x00\x00\xFE\xFF") { $data = substr($data, 4); } // UTF-32 Little Endian BOM elseif (substr($data, 0, 4) === "\xFF\xFE\x00\x00") { $data = substr($data, 4); } // UTF-16 Big Endian BOM elseif (substr($data, 0, 2) === "\xFE\xFF") { $data = substr($data, 2); } // UTF-16 Little Endian BOM elseif (substr($data, 0, 2) === "\xFF\xFE") { $data = substr($data, 2); } // UTF-8 BOM elseif (substr($data, 0, 3) === "\xEF\xBB\xBF") { $data = substr($data, 3); } if (substr($data, 0, 5) === '<?xml' && strspn(substr($data, 5, 1), "\x09\x0A\x0D\x20") && ($pos = strpos($data, '?>')) !== false) { $declaration = $this->registry->create('XML_Declaration_Parser', array(substr($data, 5, $pos - 5))); if ($declaration->parse()) { $data = substr($data, $pos + 2); $data = '<?xml version="' . $declaration->version . '" encoding="' . $encoding . '" standalone="' . (($declaration->standalone) ? 'yes' : 'no') . '"?>' . $data; } else { $this->error_string = 'SimplePie bug! Please report this!'; return false; } } $return = true; static $xml_is_sane = null; if ($xml_is_sane === null) { $parser_check = xml_parser_create(); xml_parse_into_struct($parser_check, '<foo>&</foo>', $values); xml_parser_free($parser_check); $xml_is_sane = isset($values[0]['value']); } // Create the parser if ($xml_is_sane) { $xml = xml_parser_create_ns($this->encoding, $this->separator); xml_parser_set_option($xml, XML_OPTION_SKIP_WHITE, 1); xml_parser_set_option($xml, XML_OPTION_CASE_FOLDING, 0); xml_set_object($xml, $this); xml_set_character_data_handler($xml, 'cdata'); xml_set_element_handler($xml, 'tag_open', 'tag_close'); // Parse! if (!xml_parse($xml, $data, true)) { $this->error_code = xml_get_error_code($xml); $this->error_string = xml_error_string($this->error_code); $return = false; } $this->current_line = xml_get_current_line_number($xml); $this->current_column = xml_get_current_column_number($xml); $this->current_byte = xml_get_current_byte_index($xml); xml_parser_free($xml); return $return; } else { libxml_clear_errors(); $xml = new XMLReader(); $xml->xml($data); while (@$xml->read()) { switch ($xml->nodeType) { case constant('XMLReader::END_ELEMENT'): if ($xml->namespaceURI !== '') { $tagName = $xml->namespaceURI . $this->separator . $xml->localName; } else { $tagName = $xml->localName; } $this->tag_close(null, $tagName); break; case constant('XMLReader::ELEMENT'): $empty = $xml->isEmptyElement; if ($xml->namespaceURI !== '') { $tagName = $xml->namespaceURI . $this->separator . $xml->localName; } else { $tagName = $xml->localName; } $attributes = array(); while ($xml->moveToNextAttribute()) { if ($xml->namespaceURI !== '') { $attrName = $xml->namespaceURI . $this->separator . $xml->localName; } else { $attrName = $xml->localName; } $attributes[$attrName] = $xml->value; } $this->tag_open(null, $tagName, $attributes); if ($empty) { $this->tag_close(null, $tagName); } break; case constant('XMLReader::TEXT'): case constant('XMLReader::CDATA'): $this->cdata(null, $xml->value); break; } } if ($error = libxml_get_last_error()) { $this->error_code = $error->code; $this->error_string = $error->message; $this->current_line = $error->line; $this->current_column = $error->column; return false; } else { return true; } } } public function get_error_code() { return $this->error_code; } public function get_error_string() { return $this->error_string; } public function get_current_line() { return $this->current_line; } public function get_current_column() { return $this->current_column; } public function get_current_byte() { return $this->current_byte; } public function get_data() { return $this->data; } public function tag_open($parser, $tag, $attributes) { list($this->namespace[], $this->element[]) = $this->split_ns($tag); $attribs = array(); foreach ($attributes as $name => $value) { list($attrib_namespace, $attribute) = $this->split_ns($name); $attribs[$attrib_namespace][$attribute] = $value; } if (isset($attribs[SIMPLEPIE_NAMESPACE_XML]['base'])) { $base = $this->registry->call('Misc', 'absolutize_url', array($attribs[SIMPLEPIE_NAMESPACE_XML]['base'], end($this->xml_base))); if ($base !== false) { $this->xml_base[] = $base; $this->xml_base_explicit[] = true; } } else { $this->xml_base[] = end($this->xml_base); $this->xml_base_explicit[] = end($this->xml_base_explicit); } if (isset($attribs[SIMPLEPIE_NAMESPACE_XML]['lang'])) { $this->xml_lang[] = $attribs[SIMPLEPIE_NAMESPACE_XML]['lang']; } else { $this->xml_lang[] = end($this->xml_lang); } if ($this->current_xhtml_construct >= 0) { $this->current_xhtml_construct++; if (end($this->namespace) === SIMPLEPIE_NAMESPACE_XHTML) { $this->data['data'] .= '<' . end($this->element); if (isset($attribs[''])) { foreach ($attribs[''] as $name => $value) { $this->data['data'] .= ' ' . $name . '="' . htmlspecialchars($value, ENT_COMPAT, $this->encoding) . '"'; } } $this->data['data'] .= '>'; } } else { $this->datas[] =& $this->data; $this->data =& $this->data['child'][end($this->namespace)][end($this->element)][]; $this->data = array('data' => '', 'attribs' => $attribs, 'xml_base' => end($this->xml_base), 'xml_base_explicit' => end($this->xml_base_explicit), 'xml_lang' => end($this->xml_lang)); if ((end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_03 && in_array(end($this->element), array('title', 'tagline', 'copyright', 'info', 'summary', 'content')) && isset($attribs['']['mode']) && $attribs['']['mode'] === 'xml') || (end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_10 && in_array(end($this->element), array('rights', 'subtitle', 'summary', 'info', 'title', 'content')) && isset($attribs['']['type']) && $attribs['']['type'] === 'xhtml') || (end($this->namespace) === SIMPLEPIE_NAMESPACE_RSS_20 && in_array(end($this->element), array('title'))) || (end($this->namespace) === SIMPLEPIE_NAMESPACE_RSS_090 && in_array(end($this->element), array('title'))) || (end($this->namespace) === SIMPLEPIE_NAMESPACE_RSS_10 && in_array(end($this->element), array('title')))) { $this->current_xhtml_construct = 0; } } } public function cdata($parser, $cdata) { if ($this->current_xhtml_construct >= 0) { $this->data['data'] .= htmlspecialchars($cdata, ENT_QUOTES, $this->encoding); } else { $this->data['data'] .= $cdata; } } public function tag_close($parser, $tag) { if ($this->current_xhtml_construct >= 0) { $this->current_xhtml_construct--; if (end($this->namespace) === SIMPLEPIE_NAMESPACE_XHTML && !in_array(end($this->element), array('area', 'base', 'basefont', 'br', 'col', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param'))) { $this->data['data'] .= '</' . end($this->element) . '>'; } } if ($this->current_xhtml_construct === -1) { $this->data =& $this->datas[count($this->datas) - 1]; array_pop($this->datas); } array_pop($this->element); array_pop($this->namespace); array_pop($this->xml_base); array_pop($this->xml_base_explicit); array_pop($this->xml_lang); } public function split_ns($string) { static $cache = array(); if (!isset($cache[$string])) { if ($pos = strpos($string, $this->separator)) { static $separator_length; if (!$separator_length) { $separator_length = strlen($this->separator); } $namespace = substr($string, 0, $pos); $local_name = substr($string, $pos + $separator_length); if (strtolower($namespace) === SIMPLEPIE_NAMESPACE_ITUNES) { $namespace = SIMPLEPIE_NAMESPACE_ITUNES; } // Normalize the Media RSS namespaces if ($namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG || $namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG2 || $namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG3 || $namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG4 || $namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG5 ) { $namespace = SIMPLEPIE_NAMESPACE_MEDIARSS; } $cache[$string] = array($namespace, $local_name); } else { $cache[$string] = array('', $string); } } return $cache[$string]; } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Rating.php�����������������������������������������������0000664�0000000�0000000�00000006573�12266004471�0022215�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Handles `<media:rating>` or `<itunes:explicit>` tags as defined in Media RSS and iTunes RSS respectively * * Used by {@see SimplePie_Enclosure::get_rating()} and {@see SimplePie_Enclosure::get_ratings()} * * This class can be overloaded with {@see SimplePie::set_rating_class()} * * @package SimplePie * @subpackage API */ class SimplePie_Rating { /** * Rating scheme * * @var string * @see get_scheme() */ var $scheme; /** * Rating value * * @var string * @see get_value() */ var $value; /** * Constructor, used to input the data * * For documentation on all the parameters, see the corresponding * properties and their accessors */ public function __construct($scheme = null, $value = null) { $this->scheme = $scheme; $this->value = $value; } /** * String-ified version * * @return string */ public function __toString() { // There is no $this->data here return md5(serialize($this)); } /** * Get the organizational scheme for the rating * * @return string|null */ public function get_scheme() { if ($this->scheme !== null) { return $this->scheme; } else { return null; } } /** * Get the value of the rating * * @return string|null */ public function get_value() { if ($this->value !== null) { return $this->value; } else { return null; } } } �������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Registry.php���������������������������������������������0000775�0000000�0000000�00000013547�12266004471�0022603�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Handles creating objects and calling methods * * Access this via {@see SimplePie::get_registry()} * * @package SimplePie */ class SimplePie_Registry { /** * Default class mapping * * Overriding classes *must* subclass these. * * @var array */ protected $default = array( 'Cache' => 'SimplePie_Cache', 'Locator' => 'SimplePie_Locator', 'Parser' => 'SimplePie_Parser', 'File' => 'SimplePie_File', 'Sanitize' => 'SimplePie_Sanitize', 'Item' => 'SimplePie_Item', 'Author' => 'SimplePie_Author', 'Category' => 'SimplePie_Category', 'Enclosure' => 'SimplePie_Enclosure', 'Caption' => 'SimplePie_Caption', 'Copyright' => 'SimplePie_Copyright', 'Credit' => 'SimplePie_Credit', 'Rating' => 'SimplePie_Rating', 'Restriction' => 'SimplePie_Restriction', 'Content_Type_Sniffer' => 'SimplePie_Content_Type_Sniffer', 'Source' => 'SimplePie_Source', 'Misc' => 'SimplePie_Misc', 'XML_Declaration_Parser' => 'SimplePie_XML_Declaration_Parser', 'Parse_Date' => 'SimplePie_Parse_Date', ); /** * Class mapping * * @see register() * @var array */ protected $classes = array(); /** * Legacy classes * * @see register() * @var array */ protected $legacy = array(); /** * Constructor * * No-op */ public function __construct() { } /** * Register a class * * @param string $type See {@see $default} for names * @param string $class Class name, must subclass the corresponding default * @param bool $legacy Whether to enable legacy support for this class * @return bool Successfulness */ public function register($type, $class, $legacy = false) { if (!is_subclass_of($class, $this->default[$type])) { return false; } $this->classes[$type] = $class; if ($legacy) { $this->legacy[] = $class; } return true; } /** * Get the class registered for a type * * Where possible, use {@see create()} or {@see call()} instead * * @param string $type * @return string|null */ public function get_class($type) { if (!empty($this->classes[$type])) { return $this->classes[$type]; } if (!empty($this->default[$type])) { return $this->default[$type]; } return null; } /** * Create a new instance of a given type * * @param string $type * @param array $parameters Parameters to pass to the constructor * @return object Instance of class */ public function &create($type, $parameters = array()) { $class = $this->get_class($type); if (in_array($class, $this->legacy)) { switch ($type) { case 'locator': // Legacy: file, timeout, useragent, file_class, max_checked_feeds, content_type_sniffer_class // Specified: file, timeout, useragent, max_checked_feeds $replacement = array($this->get_class('file'), $parameters[3], $this->get_class('content_type_sniffer')); array_splice($parameters, 3, 1, $replacement); break; } } if (!method_exists($class, '__construct')) { $instance = new $class; } else { $reflector = new ReflectionClass($class); $instance = $reflector->newInstanceArgs($parameters); } if (method_exists($instance, 'set_registry')) { $instance->set_registry($this); } return $instance; } /** * Call a static method for a type * * @param string $type * @param string $method * @param array $parameters * @return mixed */ public function &call($type, $method, $parameters = array()) { $class = $this->get_class($type); if (in_array($class, $this->legacy)) { switch ($type) { case 'Cache': // For backwards compatibility with old non-static // Cache::create() methods if ($method === 'get_handler') { $result = @call_user_func_array(array($class, 'create'), $parameters); return $result; } break; } } $result = call_user_func_array(array($class, $method), $parameters); return $result; } }���������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Restriction.php������������������������������������������0000664�0000000�0000000�00000007330�12266004471�0023266�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Handles `<media:restriction>` as defined in Media RSS * * Used by {@see SimplePie_Enclosure::get_restriction()} and {@see SimplePie_Enclosure::get_restrictions()} * * This class can be overloaded with {@see SimplePie::set_restriction_class()} * * @package SimplePie * @subpackage API */ class SimplePie_Restriction { /** * Relationship ('allow'/'deny') * * @var string * @see get_relationship() */ var $relationship; /** * Type of restriction * * @var string * @see get_type() */ var $type; /** * Restricted values * * @var string * @see get_value() */ var $value; /** * Constructor, used to input the data * * For documentation on all the parameters, see the corresponding * properties and their accessors */ public function __construct($relationship = null, $type = null, $value = null) { $this->relationship = $relationship; $this->type = $type; $this->value = $value; } /** * String-ified version * * @return string */ public function __toString() { // There is no $this->data here return md5(serialize($this)); } /** * Get the relationship * * @return string|null Either 'allow' or 'deny' */ public function get_relationship() { if ($this->relationship !== null) { return $this->relationship; } else { return null; } } /** * Get the type * * @return string|null */ public function get_type() { if ($this->type !== null) { return $this->type; } else { return null; } } /** * Get the list of restricted things * * @return string|null */ public function get_value() { if ($this->value !== null) { return $this->value; } else { return null; } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Sanitize.php���������������������������������������������0000664�0000000�0000000�00000036213�12266004471�0022551�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Used for data cleanup and post-processing * * * This class can be overloaded with {@see SimplePie::set_sanitize_class()} * * @package SimplePie * @todo Move to using an actual HTML parser (this will allow tags to be properly stripped, and to switch between HTML and XHTML), this will also make it easier to shorten a string while preserving HTML tags */ class SimplePie_Sanitize { // Private vars var $base; // Options var $remove_div = true; var $image_handler = ''; var $strip_htmltags = array('base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style'); var $encode_instead_of_strip = false; var $strip_attributes = array('bgsound', 'class', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc'); var $strip_comments = false; var $output_encoding = 'UTF-8'; var $enable_cache = true; var $cache_location = './cache'; var $cache_name_function = 'md5'; var $timeout = 10; var $useragent = ''; var $force_fsockopen = false; var $replace_url_attributes = null; public function __construct() { // Set defaults $this->set_url_replacements(null); } public function remove_div($enable = true) { $this->remove_div = (bool) $enable; } public function set_image_handler($page = false) { if ($page) { $this->image_handler = (string) $page; } else { $this->image_handler = false; } } public function set_registry(SimplePie_Registry $registry) { $this->registry = $registry; } public function pass_cache_data($enable_cache = true, $cache_location = './cache', $cache_name_function = 'md5', $cache_class = 'SimplePie_Cache') { if (isset($enable_cache)) { $this->enable_cache = (bool) $enable_cache; } if ($cache_location) { $this->cache_location = (string) $cache_location; } if ($cache_name_function) { $this->cache_name_function = (string) $cache_name_function; } } public function pass_file_data($file_class = 'SimplePie_File', $timeout = 10, $useragent = '', $force_fsockopen = false) { if ($timeout) { $this->timeout = (string) $timeout; } if ($useragent) { $this->useragent = (string) $useragent; } if ($force_fsockopen) { $this->force_fsockopen = (string) $force_fsockopen; } } public function strip_htmltags($tags = array('base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style')) { if ($tags) { if (is_array($tags)) { $this->strip_htmltags = $tags; } else { $this->strip_htmltags = explode(',', $tags); } } else { $this->strip_htmltags = false; } } public function encode_instead_of_strip($encode = false) { $this->encode_instead_of_strip = (bool) $encode; } public function strip_attributes($attribs = array('bgsound', 'class', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc')) { if ($attribs) { if (is_array($attribs)) { $this->strip_attributes = $attribs; } else { $this->strip_attributes = explode(',', $attribs); } } else { $this->strip_attributes = false; } } public function strip_comments($strip = false) { $this->strip_comments = (bool) $strip; } public function set_output_encoding($encoding = 'UTF-8') { $this->output_encoding = (string) $encoding; } /** * Set element/attribute key/value pairs of HTML attributes * containing URLs that need to be resolved relative to the feed * * Defaults to |a|@href, |area|@href, |blockquote|@cite, |del|@cite, * |form|@action, |img|@longdesc, |img|@src, |input|@src, |ins|@cite, * |q|@cite * * @since 1.0 * @param array|null $element_attribute Element/attribute key/value pairs, null for default */ public function set_url_replacements($element_attribute = null) { if ($element_attribute === null) { $element_attribute = array( 'a' => 'href', 'area' => 'href', 'blockquote' => 'cite', 'del' => 'cite', 'form' => 'action', 'img' => array( 'longdesc', 'src' ), 'input' => 'src', 'ins' => 'cite', 'q' => 'cite' ); } $this->replace_url_attributes = (array) $element_attribute; } public function sanitize($data, $type, $base = '') { $data = trim($data); if ($data !== '' || $type & SIMPLEPIE_CONSTRUCT_IRI) { if ($type & SIMPLEPIE_CONSTRUCT_MAYBE_HTML) { if (preg_match('/(&(#(x[0-9a-fA-F]+|[0-9]+)|[a-zA-Z0-9]+)|<\/[A-Za-z][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E]*' . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . '>)/', $data)) { $type |= SIMPLEPIE_CONSTRUCT_HTML; } else { $type |= SIMPLEPIE_CONSTRUCT_TEXT; } } if ($type & SIMPLEPIE_CONSTRUCT_BASE64) { $data = base64_decode($data); } if ($type & (SIMPLEPIE_CONSTRUCT_HTML | SIMPLEPIE_CONSTRUCT_XHTML)) { $document = new DOMDocument(); $document->encoding = 'UTF-8'; $data = $this->preprocess($data, $type); set_error_handler(array('SimplePie_Misc', 'silence_errors')); $document->loadHTML($data); restore_error_handler(); // Strip comments if ($this->strip_comments) { $xpath = new DOMXPath($document); $comments = $xpath->query('//comment()'); foreach ($comments as $comment) { $comment->parentNode->removeChild($comment); } } // Strip out HTML tags and attributes that might cause various security problems. // Based on recommendations by Mark Pilgrim at: // http://diveintomark.org/archives/2003/06/12/how_to_consume_rss_safely if ($this->strip_htmltags) { foreach ($this->strip_htmltags as $tag) { $this->strip_tag($tag, $document, $type); } } if ($this->strip_attributes) { foreach ($this->strip_attributes as $attrib) { $this->strip_attr($attrib, $document); } } // Replace relative URLs $this->base = $base; foreach ($this->replace_url_attributes as $element => $attributes) { $this->replace_urls($document, $element, $attributes); } // If image handling (caching, etc.) is enabled, cache and rewrite all the image tags. if (isset($this->image_handler) && ((string) $this->image_handler) !== '' && $this->enable_cache) { $images = $document->getElementsByTagName('img'); foreach ($images as $img) { if ($img->hasAttribute('src')) { $image_url = call_user_func($this->cache_name_function, $img->getAttribute('src')); $cache = $this->registry->call('Cache', 'get_handler', array($this->cache_location, $image_url, 'spi')); if ($cache->load()) { $img->setAttribute('src', $this->image_handler . $image_url); } else { $file = $this->registry->create('File', array($img['attribs']['src']['data'], $this->timeout, 5, array('X-FORWARDED-FOR' => $_SERVER['REMOTE_ADDR']), $this->useragent, $this->force_fsockopen)); $headers = $file->headers; if ($file->success && ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300))) { if ($cache->save(array('headers' => $file->headers, 'body' => $file->body))) { $img->setAttribute('src', $this->image_handler . $image_url); } else { trigger_error("$this->cache_location is not writeable. Make sure you've set the correct relative or absolute path, and that the location is server-writable.", E_USER_WARNING); } } } } } } // Remove the DOCTYPE // Seems to cause segfaulting if we don't do this if ($document->firstChild instanceof DOMDocumentType) { $document->removeChild($document->firstChild); } // Move everything from the body to the root $real_body = $document->getElementsByTagName('body')->item(0)->childNodes->item(0); $document->replaceChild($real_body, $document->firstChild); // Finally, convert to a HTML string $data = trim($document->saveHTML()); if ($this->remove_div) { $data = preg_replace('/^<div' . SIMPLEPIE_PCRE_XML_ATTRIBUTE . '>/', '', $data); $data = preg_replace('/<\/div>$/', '', $data); } else { $data = preg_replace('/^<div' . SIMPLEPIE_PCRE_XML_ATTRIBUTE . '>/', '<div>', $data); } } if ($type & SIMPLEPIE_CONSTRUCT_IRI) { $absolute = $this->registry->call('Misc', 'absolutize_url', array($data, $base)); if ($absolute !== false) { $data = $absolute; } } if ($type & (SIMPLEPIE_CONSTRUCT_TEXT | SIMPLEPIE_CONSTRUCT_IRI)) { $data = htmlspecialchars($data, ENT_COMPAT, 'UTF-8'); } if ($this->output_encoding !== 'UTF-8') { $data = $this->registry->call('Misc', 'change_encoding', array($data, 'UTF-8', $this->output_encoding)); } } return $data; } protected function preprocess($html, $type) { $ret = ''; if ($type & ~SIMPLEPIE_CONSTRUCT_XHTML) { // Atom XHTML constructs are wrapped with a div by default // Note: No protection if $html contains a stray </div>! $html = '<div>' . $html . '</div>'; $ret .= '<!DOCTYPE html>'; $content_type = 'text/html'; } else { $ret .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'; $content_type = 'application/xhtml+xml'; } $ret .= '<html><head>'; $ret .= '<meta http-equiv="Content-Type" content="' . $content_type . '; charset=utf-8" />'; $ret .= '</head><body>' . $html . '</body></html>'; return $ret; } public function replace_urls($document, $tag, $attributes) { if (!is_array($attributes)) { $attributes = array($attributes); } if (!is_array($this->strip_htmltags) || !in_array($tag, $this->strip_htmltags)) { $elements = $document->getElementsByTagName($tag); foreach ($elements as $element) { foreach ($attributes as $attribute) { if ($element->hasAttribute($attribute)) { $value = $this->registry->call('Misc', 'absolutize_url', array($element->getAttribute($attribute), $this->base)); if ($value !== false) { $element->setAttribute($attribute, $value); } } } } } } public function do_strip_htmltags($match) { if ($this->encode_instead_of_strip) { if (isset($match[4]) && !in_array(strtolower($match[1]), array('script', 'style'))) { $match[1] = htmlspecialchars($match[1], ENT_COMPAT, 'UTF-8'); $match[2] = htmlspecialchars($match[2], ENT_COMPAT, 'UTF-8'); return "<$match[1]$match[2]>$match[3]</$match[1]>"; } else { return htmlspecialchars($match[0], ENT_COMPAT, 'UTF-8'); } } elseif (isset($match[4]) && !in_array(strtolower($match[1]), array('script', 'style'))) { return $match[4]; } else { return ''; } } protected function strip_tag($tag, $document, $type) { $xpath = new DOMXPath($document); $elements = $xpath->query('body//' . $tag); if ($this->encode_instead_of_strip) { foreach ($elements as $element) { $fragment = $document->createDocumentFragment(); // For elements which aren't script or style, include the tag itself if (!in_array($tag, array('script', 'style'))) { $text = '<' . $tag; if ($element->hasAttributes()) { $attrs = array(); foreach ($element->attributes as $name => $attr) { $value = $attr->value; // In XHTML, empty values should never exist, so we repeat the value if (empty($value) && ($type & SIMPLEPIE_CONSTRUCT_XHTML)) { $value = $name; } // For HTML, empty is fine elseif (empty($value) && ($type & SIMPLEPIE_CONSTRUCT_HTML)) { $attrs[] = $name; continue; } // Standard attribute text $attrs[] = $name . '="' . $attr->value . '"'; } $text .= ' ' . implode(' ', $attrs); } $text .= '>'; $fragment->appendChild(new DOMText($text)); } $number = $element->childNodes->length; for ($i = $number; $i > 0; $i--) { $child = $element->childNodes->item(0); $fragment->appendChild($child); } if (!in_array($tag, array('script', 'style'))) { $fragment->appendChild(new DOMText('</' . $tag . '>')); } $element->parentNode->replaceChild($fragment, $element); } return; } elseif (in_array($tag, array('script', 'style'))) { foreach ($elements as $element) { $element->parentNode->removeChild($element); } return; } else { foreach ($elements as $element) { $fragment = $document->createDocumentFragment(); $number = $element->childNodes->length; for ($i = $number; $i > 0; $i--) { $child = $element->childNodes->item(0); $fragment->appendChild($child); } $element->parentNode->replaceChild($fragment, $element); } } } protected function strip_attr($attrib, $document) { $xpath = new DOMXPath($document); $elements = $xpath->query('//*[@' . $attrib . ']'); foreach ($elements as $element) { $element->removeAttribute($attrib); } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/Source.php�����������������������������������������������0000664�0000000�0000000�00000050073�12266004471�0022223�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Handles `<atom:source>` * * Used by {@see SimplePie_Item::get_source()} * * This class can be overloaded with {@see SimplePie::set_source_class()} * * @package SimplePie * @subpackage API */ class SimplePie_Source { var $item; var $data = array(); protected $registry; public function __construct($item, $data) { $this->item = $item; $this->data = $data; } public function set_registry(SimplePie_Registry $registry) { $this->registry = $registry; } public function __toString() { return md5(serialize($this->data)); } public function get_source_tags($namespace, $tag) { if (isset($this->data['child'][$namespace][$tag])) { return $this->data['child'][$namespace][$tag]; } else { return null; } } public function get_base($element = array()) { return $this->item->get_base($element); } public function sanitize($data, $type, $base = '') { return $this->item->sanitize($data, $type, $base); } public function get_item() { return $this->item; } public function get_title() { if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title')) { return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'title')) { return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } else { return null; } } public function get_category($key = 0) { $categories = $this->get_categories(); if (isset($categories[$key])) { return $categories[$key]; } else { return null; } } public function get_categories() { $categories = array(); foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'category') as $category) { $term = null; $scheme = null; $label = null; if (isset($category['attribs']['']['term'])) { $term = $this->sanitize($category['attribs']['']['term'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($category['attribs']['']['scheme'])) { $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($category['attribs']['']['label'])) { $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT); } $categories[] = $this->registry->create('Category', array($term, $scheme, $label)); } foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'category') as $category) { // This is really the label, but keep this as the term also for BC. // Label will also work on retrieving because that falls back to term. $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT); if (isset($category['attribs']['']['domain'])) { $scheme = $this->sanitize($category['attribs']['']['domain'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $scheme = null; } $categories[] = $this->registry->create('Category', array($term, $scheme, null)); } foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'subject') as $category) { $categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null)); } foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'subject') as $category) { $categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null)); } if (!empty($categories)) { return array_unique($categories); } else { return null; } } public function get_author($key = 0) { $authors = $this->get_authors(); if (isset($authors[$key])) { return $authors[$key]; } else { return null; } } public function get_authors() { $authors = array(); foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'author') as $author) { $name = null; $uri = null; $email = null; if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'])) { $name = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'])) { $uri = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0])); } if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'])) { $email = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $uri !== null) { $authors[] = $this->registry->create('Author', array($name, $uri, $email)); } } if ($author = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author')) { $name = null; $url = null; $email = null; if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'])) { $name = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'])) { $url = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0])); } if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'])) { $email = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $url !== null) { $authors[] = $this->registry->create('Author', array($name, $url, $email)); } } foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'creator') as $author) { $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null)); } foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'creator') as $author) { $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null)); } foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'author') as $author) { $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null)); } if (!empty($authors)) { return array_unique($authors); } else { return null; } } public function get_contributor($key = 0) { $contributors = $this->get_contributors(); if (isset($contributors[$key])) { return $contributors[$key]; } else { return null; } } public function get_contributors() { $contributors = array(); foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'contributor') as $contributor) { $name = null; $uri = null; $email = null; if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'])) { $name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'])) { $uri = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0])); } if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'])) { $email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $uri !== null) { $contributors[] = $this->registry->create('Author', array($name, $uri, $email)); } } foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'contributor') as $contributor) { $name = null; $url = null; $email = null; if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'])) { $name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'])) { $url = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0])); } if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'])) { $email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $url !== null) { $contributors[] = $this->registry->create('Author', array($name, $url, $email)); } } if (!empty($contributors)) { return array_unique($contributors); } else { return null; } } public function get_link($key = 0, $rel = 'alternate') { $links = $this->get_links($rel); if (isset($links[$key])) { return $links[$key]; } else { return null; } } /** * Added for parity between the parent-level and the item/entry-level. */ public function get_permalink() { return $this->get_link(0); } public function get_links($rel = 'alternate') { if (!isset($this->data['links'])) { $this->data['links'] = array(); if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link')) { foreach ($links as $link) { if (isset($link['attribs']['']['href'])) { $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate'; $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link)); } } } if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link')) { foreach ($links as $link) { if (isset($link['attribs']['']['href'])) { $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate'; $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link)); } } } if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'link')) { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'link')) { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link')) { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } $keys = array_keys($this->data['links']); foreach ($keys as $key) { if ($this->registry->call('Misc', 'is_isegment_nz_nc', array($key))) { if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key])) { $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]); $this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]; } else { $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key]; } } elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY) { $this->data['links'][substr($key, 41)] =& $this->data['links'][$key]; } $this->data['links'][$key] = array_unique($this->data['links'][$key]); } } if (isset($this->data['links'][$rel])) { return $this->data['links'][$rel]; } else { return null; } } public function get_description() { if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'subtitle')) { return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'tagline')) { return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'summary')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'subtitle')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0])); } else { return null; } } public function get_copyright() { if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'rights')) { return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'copyright')) { return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'copyright')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'rights')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'rights')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } else { return null; } } public function get_language() { if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'language')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'language')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'language')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif (isset($this->data['xml_lang'])) { return $this->sanitize($this->data['xml_lang'], SIMPLEPIE_CONSTRUCT_TEXT); } else { return null; } } public function get_latitude() { if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lat')) { return (float) $return[0]['data']; } elseif (($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match)) { return (float) $match[1]; } else { return null; } } public function get_longitude() { if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'long')) { return (float) $return[0]['data']; } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lon')) { return (float) $return[0]['data']; } elseif (($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match)) { return (float) $match[2]; } else { return null; } } public function get_image_url() { if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'image')) { return $this->sanitize($return[0]['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'logo')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'icon')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); } else { return null; } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/XML/�����������������������������������������������������0000775�0000000�0000000�00000000000�12266004471�0020705�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/XML/Declaration/�����������������������������������������0000775�0000000�0000000�00000000000�12266004471�0023132�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/XML/Declaration/Parser.php�������������������������������0000664�0000000�0000000�00000015755�12266004471�0025114�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Parses the XML Declaration * * @package SimplePie * @subpackage Parsing */ class SimplePie_XML_Declaration_Parser { /** * XML Version * * @access public * @var string */ var $version = '1.0'; /** * Encoding * * @access public * @var string */ var $encoding = 'UTF-8'; /** * Standalone * * @access public * @var bool */ var $standalone = false; /** * Current state of the state machine * * @access private * @var string */ var $state = 'before_version_name'; /** * Input data * * @access private * @var string */ var $data = ''; /** * Input data length (to avoid calling strlen() everytime this is needed) * * @access private * @var int */ var $data_length = 0; /** * Current position of the pointer * * @var int * @access private */ var $position = 0; /** * Create an instance of the class with the input data * * @access public * @param string $data Input data */ public function __construct($data) { $this->data = $data; $this->data_length = strlen($this->data); } /** * Parse the input data * * @access public * @return bool true on success, false on failure */ public function parse() { while ($this->state && $this->state !== 'emit' && $this->has_data()) { $state = $this->state; $this->$state(); } $this->data = ''; if ($this->state === 'emit') { return true; } else { $this->version = ''; $this->encoding = ''; $this->standalone = ''; return false; } } /** * Check whether there is data beyond the pointer * * @access private * @return bool true if there is further data, false if not */ public function has_data() { return (bool) ($this->position < $this->data_length); } /** * Advance past any whitespace * * @return int Number of whitespace characters passed */ public function skip_whitespace() { $whitespace = strspn($this->data, "\x09\x0A\x0D\x20", $this->position); $this->position += $whitespace; return $whitespace; } /** * Read value */ public function get_value() { $quote = substr($this->data, $this->position, 1); if ($quote === '"' || $quote === "'") { $this->position++; $len = strcspn($this->data, $quote, $this->position); if ($this->has_data()) { $value = substr($this->data, $this->position, $len); $this->position += $len + 1; return $value; } } return false; } public function before_version_name() { if ($this->skip_whitespace()) { $this->state = 'version_name'; } else { $this->state = false; } } public function version_name() { if (substr($this->data, $this->position, 7) === 'version') { $this->position += 7; $this->skip_whitespace(); $this->state = 'version_equals'; } else { $this->state = false; } } public function version_equals() { if (substr($this->data, $this->position, 1) === '=') { $this->position++; $this->skip_whitespace(); $this->state = 'version_value'; } else { $this->state = false; } } public function version_value() { if ($this->version = $this->get_value()) { $this->skip_whitespace(); if ($this->has_data()) { $this->state = 'encoding_name'; } else { $this->state = 'emit'; } } else { $this->state = false; } } public function encoding_name() { if (substr($this->data, $this->position, 8) === 'encoding') { $this->position += 8; $this->skip_whitespace(); $this->state = 'encoding_equals'; } else { $this->state = 'standalone_name'; } } public function encoding_equals() { if (substr($this->data, $this->position, 1) === '=') { $this->position++; $this->skip_whitespace(); $this->state = 'encoding_value'; } else { $this->state = false; } } public function encoding_value() { if ($this->encoding = $this->get_value()) { $this->skip_whitespace(); if ($this->has_data()) { $this->state = 'standalone_name'; } else { $this->state = 'emit'; } } else { $this->state = false; } } public function standalone_name() { if (substr($this->data, $this->position, 10) === 'standalone') { $this->position += 10; $this->skip_whitespace(); $this->state = 'standalone_equals'; } else { $this->state = false; } } public function standalone_equals() { if (substr($this->data, $this->position, 1) === '=') { $this->position++; $this->skip_whitespace(); $this->state = 'standalone_value'; } else { $this->state = false; } } public function standalone_value() { if ($standalone = $this->get_value()) { switch ($standalone) { case 'yes': $this->standalone = true; break; case 'no': $this->standalone = false; break; default: $this->state = false; return; } $this->skip_whitespace(); if ($this->has_data()) { $this->state = false; } else { $this->state = 'emit'; } } else { $this->state = false; } } } �������������������glpi-0.84.3+dfsg.1/lib/simplepie/SimplePie/gzdecode.php���������������������������������������������0000664�0000000�0000000�00000020574�12266004471�0022552�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Decode 'gzip' encoded HTTP data * * @package SimplePie * @subpackage HTTP * @link http://www.gzip.org/format.txt */ class SimplePie_gzdecode { /** * Compressed data * * @access private * @var string * @see gzdecode::$data */ var $compressed_data; /** * Size of compressed data * * @access private * @var int */ var $compressed_size; /** * Minimum size of a valid gzip string * * @access private * @var int */ var $min_compressed_size = 18; /** * Current position of pointer * * @access private * @var int */ var $position = 0; /** * Flags (FLG) * * @access private * @var int */ var $flags; /** * Uncompressed data * * @access public * @see gzdecode::$compressed_data * @var string */ var $data; /** * Modified time * * @access public * @var int */ var $MTIME; /** * Extra Flags * * @access public * @var int */ var $XFL; /** * Operating System * * @access public * @var int */ var $OS; /** * Subfield ID 1 * * @access public * @see gzdecode::$extra_field * @see gzdecode::$SI2 * @var string */ var $SI1; /** * Subfield ID 2 * * @access public * @see gzdecode::$extra_field * @see gzdecode::$SI1 * @var string */ var $SI2; /** * Extra field content * * @access public * @see gzdecode::$SI1 * @see gzdecode::$SI2 * @var string */ var $extra_field; /** * Original filename * * @access public * @var string */ var $filename; /** * Human readable comment * * @access public * @var string */ var $comment; /** * Don't allow anything to be set * * @param string $name * @param mixed $value */ public function __set($name, $value) { trigger_error("Cannot write property $name", E_USER_ERROR); } /** * Set the compressed string and related properties * * @param string $data */ public function __construct($data) { $this->compressed_data = $data; $this->compressed_size = strlen($data); } /** * Decode the GZIP stream * * @return bool Successfulness */ public function parse() { if ($this->compressed_size >= $this->min_compressed_size) { // Check ID1, ID2, and CM if (substr($this->compressed_data, 0, 3) !== "\x1F\x8B\x08") { return false; } // Get the FLG (FLaGs) $this->flags = ord($this->compressed_data[3]); // FLG bits above (1 << 4) are reserved if ($this->flags > 0x1F) { return false; } // Advance the pointer after the above $this->position += 4; // MTIME $mtime = substr($this->compressed_data, $this->position, 4); // Reverse the string if we're on a big-endian arch because l is the only signed long and is machine endianness if (current(unpack('S', "\x00\x01")) === 1) { $mtime = strrev($mtime); } $this->MTIME = current(unpack('l', $mtime)); $this->position += 4; // Get the XFL (eXtra FLags) $this->XFL = ord($this->compressed_data[$this->position++]); // Get the OS (Operating System) $this->OS = ord($this->compressed_data[$this->position++]); // Parse the FEXTRA if ($this->flags & 4) { // Read subfield IDs $this->SI1 = $this->compressed_data[$this->position++]; $this->SI2 = $this->compressed_data[$this->position++]; // SI2 set to zero is reserved for future use if ($this->SI2 === "\x00") { return false; } // Get the length of the extra field $len = current(unpack('v', substr($this->compressed_data, $this->position, 2))); $this->position += 2; // Check the length of the string is still valid $this->min_compressed_size += $len + 4; if ($this->compressed_size >= $this->min_compressed_size) { // Set the extra field to the given data $this->extra_field = substr($this->compressed_data, $this->position, $len); $this->position += $len; } else { return false; } } // Parse the FNAME if ($this->flags & 8) { // Get the length of the filename $len = strcspn($this->compressed_data, "\x00", $this->position); // Check the length of the string is still valid $this->min_compressed_size += $len + 1; if ($this->compressed_size >= $this->min_compressed_size) { // Set the original filename to the given string $this->filename = substr($this->compressed_data, $this->position, $len); $this->position += $len + 1; } else { return false; } } // Parse the FCOMMENT if ($this->flags & 16) { // Get the length of the comment $len = strcspn($this->compressed_data, "\x00", $this->position); // Check the length of the string is still valid $this->min_compressed_size += $len + 1; if ($this->compressed_size >= $this->min_compressed_size) { // Set the original comment to the given string $this->comment = substr($this->compressed_data, $this->position, $len); $this->position += $len + 1; } else { return false; } } // Parse the FHCRC if ($this->flags & 2) { // Check the length of the string is still valid $this->min_compressed_size += $len + 2; if ($this->compressed_size >= $this->min_compressed_size) { // Read the CRC $crc = current(unpack('v', substr($this->compressed_data, $this->position, 2))); // Check the CRC matches if ((crc32(substr($this->compressed_data, 0, $this->position)) & 0xFFFF) === $crc) { $this->position += 2; } else { return false; } } else { return false; } } // Decompress the actual data if (($this->data = gzinflate(substr($this->compressed_data, $this->position, -8))) === false) { return false; } else { $this->position = $this->compressed_size - 8; } // Check CRC of data $crc = current(unpack('V', substr($this->compressed_data, $this->position, 4))); $this->position += 4; /*if (extension_loaded('hash') && sprintf('%u', current(unpack('V', hash('crc32b', $this->data)))) !== sprintf('%u', $crc)) { return false; }*/ // Check ISIZE of data $isize = current(unpack('V', substr($this->compressed_data, $this->position, 4))); $this->position += 4; if (sprintf('%u', strlen($this->data) & 0xFFFFFFFF) !== sprintf('%u', $isize)) { return false; } // Wow, against all odds, we've actually got a valid gzip string return true; } else { return false; } } } ������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/simplepie/autoloader.php�����������������������������������������������������0000664�0000000�0000000�00000005467�12266004471�0021242�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2009, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ // autoloader spl_autoload_register(array(new SimplePie_Autoloader(), 'autoload')); if (!class_exists('SimplePie')) { trigger_error('Autoloader not registered properly', E_USER_ERROR); } /** * Autoloader class * * @package SimplePie * @subpackage API */ class SimplePie_Autoloader { /** * Constructor */ public function __construct() { $this->path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'library'; } /** * Autoloader * * @param string $class The name of the class to attempt to load. */ public function autoload($class) { // Only load the class if it starts with "SimplePie" if (strpos($class, 'SimplePie') !== 0) { return; } $filename = $this->path . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php'; include $filename; } }���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/��������������������������������������������������������������������0000775�0000000�0000000�00000000000�12266004471�0016176�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/��������������������������������������������������������������0000775�0000000�0000000�00000000000�12266004471�0017302�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/ar.js���������������������������������������������������������0000664�0000000�0000000�00000007763�12266004471�0020257�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({ar:{ common:{ edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?", apply:"Apply", insert:"Insert", update:"Update", cancel:"Cancel", close:"Close", browse:"Browse", class_name:"Class", not_set:"-- Not set --", clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?", clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.", popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.", invalid_data:"Error: Invalid values entered, these are marked in red.", more_colors:"More colors" }, contextmenu:{ align:"Alignment", left:"Left", center:"Center", right:"Right", full:"Full" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"Insert date", inserttime_desc:"Insert time", months_long:"January,February,March,April,May,June,July,August,September,October,November,December", months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun" }, print:{ print_desc:"Print" }, preview:{ preview_desc:"Preview" }, directionality:{ ltr_desc:"Direction left to right", rtl_desc:"Direction right to left" }, layer:{ insertlayer_desc:"Insert new layer", forward_desc:"Move forward", backward_desc:"Move backward", absolute_desc:"Toggle absolute positioning", content:"New layer..." }, save:{ save_desc:"Save", cancel_desc:"Cancel all changes" }, nonbreaking:{ nonbreaking_desc:"Insert non-breaking space character" }, iespell:{ iespell_desc:"Run spell checking", download:"ieSpell not detected. Do you want to install it now?" }, advhr:{ advhr_desc:"Horizontal rule" }, emotions:{ emotions_desc:"Emotions" }, searchreplace:{ search_desc:"Find", replace_desc:"Find/Replace" }, advimage:{ image_desc:"Insert/edit image" }, advlink:{ link_desc:"Insert/edit link" }, xhtmlxtras:{ cite_desc:"Citation", abbr_desc:"Abbreviation", acronym_desc:"Acronym", del_desc:"Deletion", ins_desc:"Insertion", attribs_desc:"Insert/Edit Attributes" }, style:{ desc:"Edit CSS Style" }, paste:{ paste_text_desc:"Paste as Plain Text", paste_word_desc:"Paste from Word", selectall_desc:"Select All" }, paste_dlg:{ text_title:"Use CTRL+V on your keyboard to paste the text into the window.", text_linebreaks:"Keep linebreaks", word_title:"Use CTRL+V on your keyboard to paste the text into the window." }, table:{ desc:"Inserts a new table", row_before_desc:"Insert row before", row_after_desc:"Insert row after", delete_row_desc:"Delete row", col_before_desc:"Insert column before", col_after_desc:"Insert column after", delete_col_desc:"Remove column", split_cells_desc:"Split merged table cells", merge_cells_desc:"Merge table cells", row_desc:"Table row properties", cell_desc:"Table cell properties", props_desc:"Table properties", paste_row_before_desc:"Paste table row before", paste_row_after_desc:"Paste table row after", cut_row_desc:"Cut table row", copy_row_desc:"Copy table row", del:"Delete table", row:"Row", col:"Column", cell:"Cell" }, autosave:{ unload_msg:"The changes you made will be lost if you navigate away from this page." }, fullscreen:{ desc:"Toggle fullscreen mode" }, media:{ desc:"Insert / edit embedded media", edit:"Edit embedded media" }, fullpage:{ desc:"Document properties" }, template:{ desc:"Insert predefined template content" }, visualchars:{ desc:"Visual control characters on/off." }, spellchecker:{ desc:"Toggle spellchecker", menu:"Spellchecker settings", ignore_word:"Ignore word", ignore_words:"Ignore all", langs:"Languages", wait:"Please wait...", sug:"Suggestions", no_sug:"No suggestions", no_mpell:"No misspellings found." }, pagebreak:{ desc:"Insert page break." }}});�������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/az.js���������������������������������������������������������0000664�0000000�0000000�00000014005�12266004471�0020252�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({az:{ common:{ edit_confirm:"Siz haz\u0131rki m\u0259tn sah\u0259si \u00FC\u00E7\u00FCn WYSIWYG rejimi istifad\u0259 etm\u0259k ist\u0259yirsiniz?", apply:"T\u0259tbiq et", insert:"\u018Flav\u0259 et", update:"Yenil\u0259", cancel:"L\u0259\u011Fv et", close:"Ba\u011Fla", browse:"G\u00F6zd\u0259n ke\u00E7ir", class_name:"Sinif", not_set:"-- M\u00FC\u0259yy\u0259n edilm\u0259yib --", clipboard_msg:"Kopyalama/\u018Flav\u0259 et Mozilla v\u0259 Firefox-da i\u015Fl\u0259mir.\nN\u0259 ba\u015F verdiyi haqda daha \u0259trafl\u0131 \u00F6yr\u0259nm\u0259k ist\u0259yirsiniz?", clipboard_no_support:"Hal-haz\u0131rda b\u0259l\u0259d\u00E7iniz t\u0259r\u0259find\u0259n d\u0259st\u0259kl\u0259nmir. Klaviatura q\u0131saldmas\u0131ndan istifad\u0259 edin.", popup_blocked:"Ba\u011F\u0131\u015Flay\u0131n, lakin sizin \u00FCz\u0259 \u00E7\u0131xan p\u0259nc\u0259r\u0259l\u0259riniz funksiya p\u0259nc\u0259r\u0259sinin qar\u015F\u0131s\u0131n\u0131 ald\u0131. G\u0259r\u0259k \u00FCz\u0259 \u00E7\u0131xan p\u0259nc\u0259r\u0259l\u0259rin bloklama nizamlamas\u0131n\u0131 l\u0259\u011Fv ed\u0259siniz ki, al\u0259td\u0259n tam istifad\u0259 ed\u0259 bil\u0259siniz.", invalid_data:"X\u0259ta: Q\u0131rm\u0131z\u0131 il\u0259 qeyd edilmi\u015Fl\u0259r s\u0259hv daxil edilib.", more_colors:"Daha \u00E7ox r\u0259ng" }, contextmenu:{ align:"Tarazla\u015Fd\u0131r", left:"Sola", center:"M\u0259rk\u0259z il\u0259", right:"Sa\u011Fa", full:"Tam" }, insertdatetime:{ date_fmt:"%d-%m-%Y", time_fmt:"%H:%M:%S", insertdate_desc:"Tarix \u0259lav\u0259 et", inserttime_desc:"Vaxt \u0259lav\u0259 et", months_long:"Yanvar,Fevral,Mart,Aprel,May,\u0130yun,\u0130yul,Avqust,Sentyabr,Oktyabr,Noyabr,Dekabr", months_short:"Yan,Fev,Mar,Apr,May,\u0130yu,\u0130yl,Avq,Sen,Okt,Noy,Dek", day_long:"Bazar,Bazar ert\u0259si,\u00C7\u0259r\u015F\u0259nb\u0259 ax\u015Fam\u0131,\u00C7\u0259r\u015F\u0259nb\u0259,C\u00FCm\u0259 ax\u015Fam\u0131,C\u00FCm\u0259,\u015E\u0259nb\u0259,Bazar", day_short:"B,Be,\u00C7a,\u00C7,Ca,C,\u015E,B" }, print:{ print_desc:"\u00C7ap et" }, preview:{ preview_desc:"\u0130lkin bax\u0131\u015F" }, directionality:{ ltr_desc:"\u0130stiqam\u0259t soldan-sa\u011Fa", rtl_desc:"\u0130stiqam\u0259t sa\u011Fdan-sola" }, layer:{ insertlayer_desc:"Yeni qat \u0259lav\u0259 et", forward_desc:"\u0130r\u0259li k\u00F6\u00E7\u00FCr", backward_desc:"Geri k\u00F6\u00E7\u00FCr", absolute_desc:"M\u00FCtl\u0259q m\u00F6vqeni yand\u0131r/s\u00F6nd\u00FCr", content:"Yeni qat..." }, save:{ save_desc:"Yadda saxla", cancel_desc:"B\u00FCt\u00FCn d\u0259yi\u015Fiklikl\u0259ri l\u0259\u011Fv et" }, nonbreaking:{ nonbreaking_desc:"Q\u0131r\u0131lmaz bo\u015Fluq \u0259lav\u0259 et" }, iespell:{ iespell_desc:"Orfoqrafiyan\u0131 yoxla", download:"ieSpell a\u015Fkar edilm\u0259yib. Y\u00FCkl\u0259nilsin?" }, advhr:{ advhr_desc:"\u00DCf\u00FCqi x\u0259tt" }, emotions:{ emotions_desc:"Smayllar" }, searchreplace:{ search_desc:"Axtar", replace_desc:"Axtar/D\u0259yi\u015F" }, advimage:{ image_desc:"\u015E\u0259kli \u0259lav\u0259/redakt\u0259 et" }, advlink:{ link_desc:"Ke\u00E7idi \u0259lav\u0259/redakt\u0259 et" }, xhtmlxtras:{ cite_desc:"Sitat", abbr_desc:"Abbreviatura", acronym_desc:"Akronim", del_desc:"Silinmi\u015F m\u0259tn", ins_desc:"\u018Flav\u0259 edilmi\u015F m\u0259tn", attribs_desc:"Atribut \u0259lav\u0259/redakt\u0259 et" }, style:{ desc:"CSS stili redakt\u0259 et", delta_width:"35" }, paste:{ paste_text_desc:"Sad\u0259 m\u0259tn kimi \u0259lav\u0259 et", paste_word_desc:"Word-d\u0259n \u0259lav\u0259 et", selectall_desc:"Ham\u0131s\u0131n\u0131 se\u00E7" }, paste_dlg:{ text_title:"P\u0259nc\u0259r\u0259y\u0259 m\u0259tn \u0259lav\u0259 etm\u0259k \u00FC\u00E7\u00FCn CTRL+V klavi\u015F birl\u0259\u015Fm\u0259sini istifad\u0259 edin.", text_linebreaks:"S\u0259tr s\u0131nmalar\u0131n\u0131 saxla", word_title:"P\u0259nc\u0259r\u0259y\u0259 s\u00F6z \u0259lav\u0259 etm\u0259k \u00FC\u00E7\u00FCn CTRL+V klavi\u015F birl\u0259\u015Fm\u0259sini istifad\u0259 edin." }, table:{ desc:"Yeni c\u0259dv\u0259l \u0259lav\u0259 et", row_before_desc:"S\u0259tri \u0259vv\u0259l \u0259lav\u0259 et:", row_after_desc:"S\u0259tri sonra \u0259vv\u0259l et:", delete_row_desc:"S\u0259tri sil", col_before_desc:"S\u00FCtunu \u0259vv\u0259l \u0259lav\u0259 et:", col_after_desc:"S\u00FCtunu sonra \u0259lav\u0259 et:", delete_col_desc:"S\u00FCtunu sil", split_cells_desc:"S\u00FCz\u00FClm\u00FC\u015F \u00F6z\u0259kl\u0259ri ay\u0131r", merge_cells_desc:"\u00D6z\u0259kl\u0259ri s\u00FCz", row_desc:"S\u0259tr x\u00FCsusiyy\u0259tl\u0259ri", cell_desc:"\u00D6z\u0259k x\u00FCsusiyy\u0259tl\u0259ri", props_desc:"C\u0259dv\u0259l x\u00FCsusiyy\u0259tl\u0259ri", paste_row_before_desc:"S\u0259tr c\u0259dv\u0259lini \u0259vv\u0259l \u0259lav\u0259 et:", paste_row_after_desc:"S\u0259tr c\u0259dv\u0259lini sonra \u0259lav\u0259 et:", cut_row_desc:"S\u0259tri k\u0259s", copy_row_desc:"S\u0259tri kopyala", del:"C\u0259dv\u0259li sil", row:"S\u0259tr", col:"S\u00FCtun", cell:"\u00D6z\u0259k" }, autosave:{ unload_msg:"\u018Fg\u0259r s\u0259hif\u0259d\u0259n gets\u0259niz b\u00FCt\u00FCn d\u0259yi\u015Fiklikl\u0259r itiril\u0259c\u0259k." }, fullscreen:{ desc:"Tamekran rejimini yand\u0131r/s\u00F6nd\u00FCr" }, media:{ desc:"mediya-obyekti \u0259lav\u0259/redakt\u0259 et", edit:"Mediya-obyekti redakt\u0259 et" }, fullpage:{ desc:"S\u0259n\u0259d nizamlamalar\u0131" }, template:{ desc:"\u018Fvv\u0259ld\u0259n m\u00FC\u0259yy\u0259n edil\u0259n \u015Fablon daxil et" }, visualchars:{ desc:"Vizual idar\u0259 xarakterl\u0259rini yand\u0131r/s\u00F6nd\u00FCr." }, spellchecker:{ desc:"Orfoqraf\u0131 yoxla", menu:"Orfoqrafiya nizamlamas\u0131n\u0131", ignore_word:"S\u00F6zl\u00FC iqnor et", ignore_words:"H\u0259r \u015Feyi iqnor et", langs:"Dill\u0259r", wait:"Z\u0259hm\u0259t olmasa, g\u00F6zl\u0259yin...", sug:"Variantlar", no_sug:"Variantlar yoxdur", no_mpell:"X\u0259ta a\u015Fkar edilm\u0259di." }, pagebreak:{ desc:"S\u0259hif\u0259 b\u00F6l\u0259nini \u0259lav\u0259 et." }}});���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/be.js���������������������������������������������������������0000664�0000000�0000000�00000033622�12266004471�0020234�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({be:{ common:{ edit_confirm:"\u0412\u044B \u0436\u0430\u0434\u0430\u0435\u0446\u0435 \u0432\u044B\u043A\u0430\u0440\u044B\u0441\u0442\u0430\u0446\u044C \u0434\u043B\u044F \u0433\u044D\u0442\u0430\u0439 \u0442\u044D\u043A\u0441\u0442\u0430\u0432\u0430\u0439 \u0432\u043E\u0431\u043B\u0430\u0441\u0446\u0456 \u0440\u044D\u0436\u044B\u043C WYSIWYG?", apply:"\u0423\u0436\u044B\u0446\u044C", insert:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044C", update:"\u0410\u0431\u043D\u0430\u0432\u0456\u0446\u044C", cancel:"\u0410\u0434\u043C\u044F\u043D\u0456\u0446\u044C", close:"\u0417\u0430\u0447\u044B\u043D\u0456\u0446\u044C", browse:"\u041F\u0440\u0430\u0433\u043B\u0435\u0434\u0437\u0435\u0446\u044C", class_name:"\u041A\u043B\u0430\u0441", not_set:"-- \u041D\u0435 \u045E\u0441\u0442\u0430\u043B\u044F\u0432\u0430\u043D\u0430 --", clipboard_msg:"\u041A\u0430\u043F\u0456\u044F\u0432\u0430\u043D\u043D\u0435/\u0423\u0441\u0442\u0430\u045E\u043A\u0430 \u043D\u0435 \u043F\u0440\u0430\u0446\u0443\u0435 \u045E Mozilla \u0456 Firefox.\n\u0416\u0430\u0434\u0430\u0435\u0446\u0435 \u043F\u0430\u0434\u0440\u0430\u0431\u044F\u0437\u043D\u0435\u0439 \u043F\u0430\u0437\u043D\u0430\u0446\u044C, \u0443 \u0447\u044B\u043C \u0441\u043F\u0440\u0430\u0432\u0430?", clipboard_no_support:"\u041D\u0435 \u043F\u0430\u0434\u0442\u0440\u044B\u043C\u043B\u0456\u0432\u0430\u0435\u0446\u0446\u0430 \u0432\u0430\u0448\u044B\u043C \u0431\u0440\u0430\u045E\u0437\u044D\u0440\u0430\u043C \u0443 \u0441\u0430\u043F\u0440\u0430\u045E\u0434\u043D\u044B \u043C\u043E\u043C\u0430\u043D\u0442, \u0432\u044B\u043A\u0430\u0440\u044B\u0441\u0442\u0430\u0439\u0446\u0435 \u043A\u043B\u0430\u0432\u0456\u044F\u0442\u0443\u0440\u043D\u044B\u044F \u0441\u043A\u0430\u0440\u0430\u0447\u044D\u043D\u043D\u0456.", popup_blocked:"\u0412\u044B\u0431\u0430\u0447\u044B\u0446\u0435, \u0430\u043B\u0435 \u0432\u0430\u0448 \u0431\u043B\u0430\u043A\u0430\u0432\u0430\u043B\u044C\u043D\u0456\u043A \u0443\u0441\u043F\u043B\u044B\u0432\u0430\u043B\u044C\u043D\u044B\u0445 \u0432\u043E\u043A\u043D\u0430\u045E \u0437\u0430\u0431\u043B\u0430\u043A\u0430\u0432\u0430\u045E \u0430\u043A\u043D\u043E, \u044F\u043A\u043E\u0435 \u043F\u0440\u0430\u0434\u0441\u0442\u0430\u045E\u043B\u044F\u0435 \u0444\u0443\u043D\u043A\u0446\u044B\u0456 \u043F\u0440\u044B\u043A\u043B\u0430\u0434\u0430\u043D\u043D\u044F. \u0412\u0430\u043C \u0442\u0440\u044D\u0431\u0430 \u0430\u0434\u043A\u043B\u044E\u0447\u044B\u0446\u044C \u0431\u043B\u0430\u043A\u0430\u0432\u0430\u043D\u043D\u0435 \u045E\u0441\u043F\u043B\u044B\u0432\u0430\u043B\u044C\u043D\u044B\u0445 \u0432\u043E\u043A\u043D\u0430\u045E \u043D\u0430 \u0433\u044D\u0442\u044B\u043C \u0441\u0430\u0439\u0446\u0435, \u043A\u0430\u0431 \u043F\u0430\u045E\u043D\u0430\u0432\u0430\u0440\u0442\u0430\u0441\u043D\u0430 \u0441\u043A\u0430\u0440\u044B\u0441\u0442\u0430\u0446\u0446\u0430 \u0433\u044D\u0442\u0430\u0439 \u043F\u0440\u044B\u043B\u0430\u0434\u0430\u0439.", invalid_data:"\u041F\u0430\u043C\u044B\u043B\u043A\u0430: \u0410\u0434\u0437\u043D\u0430\u0447\u0430\u043D\u044B\u044F \u0447\u044B\u0440\u0432\u043E\u043D\u044B\u043C \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0456 \u045E\u0432\u0435\u0434\u0437\u0435\u043D\u044B\u044F \u043D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430.", more_colors:"\u0411\u043E\u043B\u044C\u0448 \u043A\u043E\u043B\u0435\u0440\u0430\u045E" }, contextmenu:{ align:"\u0412\u044B\u0440\u0430\u045E\u043D\u043E\u045E\u0432\u0430\u043D\u043D\u0435", left:"\u041D\u0430\u043B\u0435\u0432\u0430", center:"\u041F\u0430 \u0446\u044D\u043D\u0442\u0440\u044B", right:"\u041D\u0430\u043F\u0440\u0430\u0432\u0430", full:"\u0426\u0430\u043B\u043A\u0430\u043C" }, insertdatetime:{ date_fmt:"%d.%m.%Y", time_fmt:"%H:%M:%S", insertdate_desc:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044C \u0434\u0430\u0442\u0443", inserttime_desc:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044C \u0447\u0430\u0441", months_long:"\u0421\u0442\u0443\u0434\u0437\u0435\u043D\u044C,\u041B\u044E\u0442\u044B,\u0421\u0430\u043A\u0430\u0432\u0456\u043A,\u041A\u0440\u0430\u0441\u0430\u0432\u0456\u043A,\u0422\u0440\u0430\u0432\u0435\u043D\u044C,\u0427\u044D\u0440\u0432\u0435\u043D\u044C,\u041B\u0456\u043F\u0435\u043D\u044C,\u0410\u045E\u0433\u0443\u0441\u0442,\u0412\u0435\u0440\u0430\u0441\u0435\u043D\u044C,\u041A\u0430\u0441\u0442\u0440\u044B\u0447\u043D\u0456\u043A,\u041B\u0456\u0441\u0442\u0430\u043F\u0430\u0434,\u0421\u043D\u0435\u0436\u0430\u043D\u044C", months_short:"\u0421\u0442\u0443,\u041B\u044E\u0442,\u0421\u0430\u043A,\u041A\u0440\u0430,\u0422\u0440\u0430,\u0427\u044D\u0440,\u041B\u0456\u043F,\u0410\u045E\u0433,\u0412\u0435\u0440,\u041A\u0430\u0441,\u041B\u0456\u0441,\u0421\u043D\u0435", day_long:"\u041D\u044F\u0434\u0437\u0435\u043B\u044F,\u041F\u0430\u043D\u044F\u0434\u0437\u0435\u043B\u0430\u043A,\u0410\u045E\u0442\u043E\u0440\u0430\u043A,\u0410\u0441\u044F\u0440\u043E\u0434\u0434\u0437\u0435,\u0427\u0430\u0446\u0432\u0435\u0440,\u041F\u044F\u0442\u043D\u0456\u0446\u0430,\u0421\u0443\u0431\u043E\u0442\u0430,\u041D\u044F\u0434\u0437\u0435\u043B\u044F", day_short:"\u041D\u0434,\u041F\u043D,\u0410\u0442,\u0410\u0441,\u0427\u0446,\u041F\u0442,\u0421\u0431,\u041D\u0434" }, print:{ print_desc:"\u0414\u0440\u0443\u043A" }, preview:{ preview_desc:"\u041F\u0430\u043F\u044F\u0440\u044D\u0434\u043D\u0456 \u043F\u0440\u0430\u0433\u043B\u044F\u0434" }, directionality:{ ltr_desc:"\u041A\u0456\u0440\u0443\u043D\u0430\u043A \u0437\u043B\u0435\u0432\u0430 \u043D\u0430\u043F\u0440\u0430\u0432\u0430", rtl_desc:"\u041A\u0456\u0440\u0443\u043D\u0430\u043A \u0441\u043F\u0440\u0430\u0432\u0430 \u043D\u0430\u043B\u0435\u0432\u0430" }, layer:{ insertlayer_desc:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044C \u043D\u043E\u0432\u044B \u043F\u043B\u0430\u0441\u0442", forward_desc:"\u041F\u0435\u0440\u0430\u043D\u0435\u0441\u0446\u0456 \u043D\u0430\u043F\u0435\u0440\u0430\u0434", backward_desc:"\u041F\u0435\u0440\u0430\u043D\u0435\u0441\u0446\u0456 \u043D\u0430\u0437\u0430\u0434", absolute_desc:"\u0423\u043B\u0443\u0447\u044B\u0446\u044C/\u0432\u044B\u043A\u043B\u044E\u0447\u044B\u0446\u044C \u0430\u0431\u0441\u0430\u043B\u044E\u0442\u043D\u0430\u0435 \u043F\u0430\u0437\u0456\u0446\u044B\u044F\u043D\u0430\u0432\u0430\u043D\u043D\u0435", content:"\u041D\u043E\u0432\u044B \u043F\u043B\u0430\u0441\u0442\u2026" }, save:{ save_desc:"\u0417\u0430\u0445\u0430\u0432\u0430\u0446\u044C", cancel_desc:"\u0410\u0434\u043C\u044F\u043D\u0456\u0446\u044C \u0443\u0441\u0435 \u0437\u043C\u0435\u043D\u044B" }, nonbreaking:{ nonbreaking_desc:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044C \u043D\u0435\u043F\u0430\u0440\u044B\u045E\u043D\u044B \u043F\u0440\u0430\u0431\u0435\u043B" }, iespell:{ iespell_desc:"\u041F\u0440\u0430\u0432\u0435\u0440\u044B\u0446\u044C \u0430\u0440\u0444\u0430\u0433\u0440\u0430\u0444\u0456\u044E", download:"ieSpell \u043D\u0435 \u0432\u044B\u044F\u045E\u043B\u0435\u043D\u044B. \u0423\u0441\u0442\u0430\u043B\u044F\u0432\u0430\u0446\u044C?" }, advhr:{ advhr_desc:"\u0413\u0430\u0440\u044B\u0437\u0430\u043D\u0442\u0430\u043B\u044C\u043D\u0430\u044F \u043B\u0456\u043D\u0456\u044F" }, emotions:{ emotions_desc:"\u0421\u043C\u0430\u0439\u043B\u0456\u043A\u0456" }, searchreplace:{ search_desc:"\u0417\u043D\u0430\u0439\u0441\u0446\u0456", replace_desc:"\u0417\u043D\u0430\u0439\u0441\u0446\u0456/\u0417\u0430\u043C\u044F\u043D\u0456\u0446\u044C" }, advimage:{ image_desc:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044C/\u0440\u044D\u0434\u0430\u0433\u0430\u0432\u0430\u0446\u044C \u043C\u0430\u043B\u044E\u043D\u0430\u043A" }, advlink:{ link_desc:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044C/\u0440\u044D\u0434\u0430\u0433\u0430\u0432\u0430\u0446\u044C \u0441\u043F\u0430\u0441\u044B\u043B\u043A\u0443" }, xhtmlxtras:{ cite_desc:"\u0412\u044B\u043D\u044F\u0442\u043A\u0430", abbr_desc:"\u0410\u0431\u0440\u044D\u0432\u0456\u044F\u0442\u0443\u0440\u0430", acronym_desc:"\u0410\u043A\u0440\u043E\u043D\u0456\u043C", del_desc:"\u0412\u044B\u0434\u0430\u043B\u0435\u043D\u044B \u0442\u044D\u043A\u0441\u0442", ins_desc:"\u0414\u0430\u0434\u0430\u0434\u0437\u0435\u043D\u044B \u0442\u044D\u043A\u0441\u0442", attribs_desc:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044C/\u0440\u044D\u0434\u0430\u0433\u0430\u0432\u0430\u0446\u044C \u0430\u0442\u0440\u044B\u0431\u0443\u0442\u044B" }, style:{ desc:"\u0420\u044D\u0434\u0430\u0433\u0430\u0432\u0430\u0446\u044C \u0441\u0442\u044B\u043B\u044C CSS", delta_width:"35" }, paste:{ paste_text_desc:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044C \u044F\u043A \u043F\u0440\u043E\u0441\u0442\u044B \u0442\u044D\u043A\u0441\u0442", paste_word_desc:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044C \u0437 Word", selectall_desc:"\u0412\u044B\u043B\u0443\u0447\u044B\u0446\u044C \u0443\u0441\u0451" }, paste_dlg:{ text_title:"\u0412\u044B\u043A\u0430\u0440\u044B\u0441\u0442\u0430\u0439\u0446\u0435 \u0441\u043F\u0430\u043B\u0443\u0447\u044D\u043D\u043D\u0435 \u043A\u043B\u0430\u0432\u0456\u0448 CTRL+V \u043A\u0430\u0431 \u0443\u0441\u0442\u0430\u0432\u0456\u0446\u044C \u0442\u044D\u043A\u0441\u0442 \u0443 \u0430\u043A\u043D\u043E.", text_linebreaks:"\u0417\u0430\u0445\u043E\u045E\u0432\u0430\u0446\u044C \u043F\u0430\u0440\u044B\u0432\u044B \u0440\u0430\u0434\u043A\u043E\u045E", word_title:"\u0412\u044B\u043A\u0430\u0440\u044B\u0441\u0442\u0430\u0439\u0446\u0435 \u0441\u043F\u0430\u043B\u0443\u0447\u044D\u043D\u043D\u0435 \u043A\u043B\u0430\u0432\u0456\u0448 CTRL+V \u043A\u0430\u0431 \u0443\u0441\u0442\u0430\u0432\u0456\u0446\u044C \u0442\u044D\u043A\u0441\u0442 \u0443 \u0430\u043A\u043D\u043E." }, table:{ desc:"\u0423\u0441\u0442\u0430\u045E\u043B\u044F\u0435 \u043D\u043E\u0432\u0443\u044E \u0442\u0430\u0431\u043B\u0456\u0446\u0443", row_before_desc:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044C \u0440\u0430\u0434\u043E\u043A \u043F\u0435\u0440\u0430\u0434", row_after_desc:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044C \u0440\u0430\u0434\u043E\u043A \u043F\u0430\u0441\u043B\u044F", delete_row_desc:"\u0412\u044B\u0434\u0430\u043B\u0456\u0446\u044C \u0440\u0430\u0434\u043E\u043A", col_before_desc:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044C \u0441\u043B\u0443\u043F\u043E\u043A \u043F\u0435\u0440\u0430\u0434", col_after_desc:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044C \u0441\u043B\u0443\u043F\u043E\u043A \u043F\u0430\u0441\u043B\u044F", delete_col_desc:"\u0412\u044B\u0434\u0430\u043B\u0456\u0446\u044C \u0441\u043B\u0443\u043F\u043E\u043A", split_cells_desc:"\u041F\u0430\u0434\u0437\u044F\u043B\u0456\u0446\u044C \u0437\u043B\u0435\u043F\u043B\u0435\u043D\u044B\u044F \u0432\u043E\u0447\u043A\u0456", merge_cells_desc:"\u0421\u043A\u043B\u0435\u0456\u0446\u044C \u0432\u043E\u0447\u043A\u0456", row_desc:"\u0423\u043B\u0430\u0441\u0446\u0456\u0432\u0430\u0441\u0446\u0456 \u0440\u0430\u0434\u043A\u0430", cell_desc:"\u0423\u043B\u0430\u0441\u0446\u0456\u0432\u0430\u0441\u0446\u0456 \u0432\u043E\u0447\u043A\u0430", props_desc:"\u0423\u043B\u0430\u0441\u0446\u0456\u0432\u0430\u0441\u0446\u0456 \u0442\u0430\u0431\u043B\u0456\u0446\u044B", paste_row_before_desc:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044C \u0440\u0430\u0434\u043E\u043A \u0442\u0430\u0431\u043B\u0456\u0446\u044B \u043F\u0435\u0440\u0430\u0434", paste_row_after_desc:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044C \u0440\u0430\u0434\u043E\u043A \u0442\u0430\u0431\u043B\u0456\u0446\u044B \u043F\u0430\u0441\u043B\u044F", cut_row_desc:"\u0412\u044B\u0440\u0430\u0437\u0430\u0446\u044C \u0440\u0430\u0434\u043E\u043A", copy_row_desc:"\u041A\u0430\u043F\u0456\u044F\u0432\u0430\u0446\u044C \u0440\u0430\u0434\u043E\u043A", del:"\u0412\u044B\u0434\u0430\u043B\u0456\u0446\u044C \u0442\u0430\u0431\u043B\u0456\u0446\u0443", row:"\u0420\u0430\u0434\u043E\u043A", col:"\u0421\u043B\u0443\u043F\u043E\u043A", cell:"\u0412\u043E\u0447\u043A\u0430" }, autosave:{ unload_msg:"\u0417\u0430\u043D\u0435\u0441\u0435\u043D\u044B\u044F \u0437\u043C\u0435\u043D\u044B \u0431\u0443\u0434\u0443\u0446\u044C \u0441\u0442\u0440\u0430\u0447\u0430\u043D\u044B\u044F, \u043A\u0430\u043B\u0456 \u0432\u044B \u0441\u044B\u0434\u0437\u0435\u0446\u0435 \u0437 \u0433\u044D\u0442\u0430\u0439 \u0441\u0442\u0430\u0440\u043E\u043D\u043A\u0456." }, fullscreen:{ desc:"\u0423\u043B\u0443\u0447\u044B\u0446\u044C/\u0432\u044B\u043A\u043B\u044E\u0447\u044B\u0446\u044C \u043F\u043E\u045E\u043D\u0430\u044D\u043A\u0440\u0430\u043D\u043D\u044B \u0440\u044D\u0436\u044B\u043C" }, media:{ desc:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044C/\u0440\u044D\u0434\u0430\u0433\u0430\u0432\u0430\u0446\u044C \u043C\u0435\u0434\u044B\u044F-\u0430\u0431'\u0435\u043A\u0442", edit:"\u0420\u044D\u0434\u0430\u0433\u0430\u0432\u0430\u0446\u044C \u043C\u0435\u0434\u044B\u044F-\u0430\u0431'\u0435\u043A\u0442" }, fullpage:{ desc:"Document properties" }, template:{ desc:"Insert predefined template content" }, visualchars:{ desc:"Visual control characters on/off." }, spellchecker:{ desc:"\u041F\u0440\u0430\u0432\u0435\u0440\u044B\u0446\u044C \u0430\u0440\u0444\u0430\u0433\u0440\u0430\u0444\u0456\u044E", menu:"\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u043F\u0440\u0430\u0432\u0435\u0440\u043A\u0456 \u0430\u0440\u0444\u0430\u0433\u0440\u0430\u0444\u0456\u0456", ignore_word:"\u0406\u0433\u043D\u0430\u0440\u0430\u0432\u0430\u0446\u044C \u0441\u043B\u043E\u0432\u0430", ignore_words:"\u0406\u0433\u043D\u0430\u0440\u0430\u0432\u0430\u0446\u044C \u0443\u0441\u0451", langs:"\u041C\u043E\u0432\u044B", wait:"\u041A\u0430\u043B\u0456 \u043B\u0430\u0441\u043A\u0430, \u043F\u0430\u0447\u0430\u043A\u0430\u0439\u0446\u0435...", sug:"\u0412\u0430\u0440\u044B\u044F\u043D\u0442\u044B", no_sug:"\u041D\u044F\u043C\u0430 \u0432\u0430\u0440\u044B\u044F\u043D\u0442\u0430\u045E", no_mpell:"\u041F\u0430\u043C\u044B\u043B\u0430\u043A \u043D\u0435 \u0432\u044B\u044F\u045E\u043B\u0435\u043D\u0430." }, pagebreak:{ desc:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044C \u043F\u0430\u0434\u0437\u0435\u043B\u044C\u043D\u0456\u043A \u0441\u0442\u0430\u0440\u043E\u043D\u043A\u0456." }}});��������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/bg.js���������������������������������������������������������0000664�0000000�0000000�00000032163�12266004471�0020235�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({bg:{ common:{ edit_confirm:"\u0418\u0441\u043A\u0430\u0442\u0435 \u043B\u0438 \u0434\u0430 \u0438\u0437\u043F\u043E\u043B\u0437\u0432\u0430\u0442\u0435 WYSIWYG \u0440\u0435\u0436\u0438\u043C \u0437\u0430 \u0442\u043E\u0432\u0430 \u0442\u0435\u043A\u0441\u0442\u043E\u0432\u043E \u043F\u043E\u043B\u0435?", apply:"\u041F\u043E\u0442\u0432\u044A\u0440\u0434\u0438", insert:"\u0412\u043C\u044A\u043A\u043D\u0438", update:"\u041E\u0431\u043D\u043E\u0432\u0438", cancel:"\u041E\u0442\u043A\u0430\u0436\u0438", close:"\u0417\u0430\u0442\u0432\u043E\u0440\u0438", browse:"Browse", class_name:"\u041A\u043B\u0430\u0441", not_set:"-- \u041D\u0435\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0435\u043D\u043E --", clipboard_msg:"\u041A\u043E\u043F\u0438\u0440\u0430\u043D\u0435/\u041E\u0442\u0440\u044F\u0437\u0432\u0430\u043D\u0435/\u041F\u043E\u0441\u0442\u0430\u0432\u044F\u043D\u0435 \u043D\u0435 \u0435 \u0434\u043E\u0441\u0442\u044A\u043F\u043D\u043E \u043F\u043E\u0434 Mozilla \u0438 Firefox.\n\u0416\u0435\u043B\u0430\u0435\u0442\u0435 \u043B\u0438 \u043F\u043E\u0432\u0435\u0447\u0435 \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u0437\u0430 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0430?", clipboard_no_support:"\u041D\u0435 \u0441\u0435 \u043F\u043E\u0434\u0434\u044A\u0440\u0436\u0430 \u043E\u0442 \u0432\u0430\u0448\u0438\u044F\u0442 \u0431\u0440\u0430\u0443\u0437\u044A\u0440, \u0438\u0437\u043F\u043E\u043B\u0437\u0432\u0430\u0439\u0442\u0435 \u043A\u043B\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u043D\u0438 \u043A\u043E\u043C\u0430\u043D\u0434\u0438.", popup_blocked:"\u0421\u044A\u0436\u0430\u043B\u044F\u0432\u0430\u043C\u0435, \u043D\u043E \u0437\u0430\u0431\u0435\u043B\u044F\u0437\u0430\u0445\u043C\u0435, \u0447\u0435 \u0432\u0430\u0448\u0438\u044F\u0442 popup-blocker \u0435 \u0441\u043F\u0440\u044F\u043B \u043F\u0440\u043E\u0437\u043E\u0440\u0435\u0446 \u043A\u043E\u0439\u0442\u043E \u0441\u0435 \u0438\u0437\u043F\u043E\u043B\u0437\u0432\u0430 \u043E\u0442 \u043F\u0440\u043E\u0433\u0440\u0430\u043C\u0430\u0442\u0430. \u0429\u0435 \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0438\u0437\u043A\u043B\u044E\u0447\u0438\u0442\u0435 \u0431\u043B\u043E\u043A\u0438\u0440\u0430\u043D\u0435\u0442\u043E \u043D\u0430 \u043F\u043E\u043F\u044A\u043F\u0438 \u0437\u0430 \u0442\u043E\u0437\u0438 \u0441\u0430\u0439\u0442 \u0437\u0430 \u0434\u0430 \u0438\u0437\u043F\u043E\u043B\u0437\u0432\u0430\u0442\u0435 \u043F\u044A\u043B\u043D\u0430\u0442\u0430 \u0444\u0443\u043D\u043A\u0446\u0438\u043E\u043D\u0430\u043B\u043D\u043E\u0441\u0442.", invalid_data:"\u0413\u0440\u0435\u0448\u043A\u0430: \u0412\u044A\u0432\u0435\u0434\u0435\u043D\u0438 \u0441\u0430 \u043D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0438 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442\u0438, \u0442\u0435 \u0441\u0430 \u043C\u0430\u0440\u043A\u0438\u0440\u0430\u043D\u0438 \u0432 \u0447\u0435\u0440\u0432\u0435\u043D\u043E.", more_colors:"\u041E\u0449\u0435 \u0446\u0432\u0435\u0442\u043E\u0432\u0435" }, contextmenu:{ align:"\u041F\u043E\u0434\u0440\u0430\u0432\u043D\u044F\u0432\u0430\u043D\u0435", left:"\u041B\u044F\u0432\u043E", center:"\u0426\u0435\u043D\u0442\u044A\u0440", right:"\u0414\u044F\u0441\u043D\u043E", full:"\u0414\u0432\u0443\u0441\u0442\u0440\u0430\u043D\u043D\u043E" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"\u0412\u043C\u044A\u043A\u043D\u0438 \u0434\u0430\u0442\u0430", inserttime_desc:"\u0412\u043C\u044A\u043A\u043D\u0438 \u0432\u0440\u0435\u043C\u0435", months_long:"\u042F\u043D\u0443\u0430\u0440\u0438,\u0424\u0435\u0432\u0440\u0443\u0430\u0440\u0438,\u041C\u0430\u0440\u0442,\u0410\u043F\u0440\u0438\u043B,\u041C\u0430\u0439,\u042E\u043D\u0438,\u042E\u043B\u0438,\u0410\u0432\u0433\u0443\u0441\u0442,\u0421\u0435\u043F\u0442\u0435\u043C\u0432\u0440\u0438,\u041E\u043A\u0442\u043E\u043C\u0432\u0440\u0438,\u041D\u043E\u0435\u043C\u0432\u0440\u0438,\u0414\u0435\u043A\u0435\u043C\u0432\u0440\u0438", months_short:"\u042F\u043D\u0443,\u0424\u0435\u0432,\u041C\u0430\u0440,\u0410\u043F\u0440,\u041C\u0430\u0439,\u042E\u043D\u0438,\u042E\u043B\u0438,\u0410\u0432\u0433,\u0421\u0435\u043F,\u041E\u043A\u0442,\u041D\u043E\u0435,\u0414\u0435\u043A", day_long:"\u041D\u0435\u0434\u0435\u043B\u044F,\u041F\u043E\u043D\u0435\u0434\u0435\u043B\u043D\u0438\u043A,\u0412\u0442\u043E\u0440\u043D\u0438\u043A,\u0421\u0440\u044F\u0434\u0430,\u0427\u0435\u0442\u0432\u044A\u0440\u0442\u044A\u043A,\u041F\u0435\u0442\u044A\u043A,\u0421\u044A\u0431\u043E\u0442\u0430,\u041D\u0435\u0434\u0435\u043B\u044F", day_short:"\u041D\u0434,\u041F\u043D,\u0412\u0442,\u0421\u0440,\u0427\u0442,\u041F\u0442,\u0421\u0431,\u041D\u0434" }, print:{ print_desc:"\u041E\u0442\u043F\u0435\u0447\u0430\u0442\u0430\u0439" }, preview:{ preview_desc:"\u041F\u0440\u0435\u0433\u043B\u0435\u0434" }, directionality:{ ltr_desc:"\u041F\u043E\u0441\u043E\u043A\u0430 \u043E\u0442\u043B\u044F\u0432\u043E \u043D\u0430 \u0434\u044F\u0441\u043D\u043E", rtl_desc:"\u041F\u043E\u0441\u043E\u043A\u0430 \u043E\u0442\u0434\u044F\u0441\u043D\u043E \u043D\u0430 \u043B\u044F\u0432\u043E" }, layer:{ insertlayer_desc:"\u0412\u043C\u044A\u043A\u043D\u0438 \u043D\u043E\u0432 \u0441\u043B\u043E\u0439", forward_desc:"\u041F\u043E\u043A\u0430\u0436\u0438 \u043E\u0442\u043F\u0440\u0435\u0434", backward_desc:"\u041F\u043E\u043A\u0430\u0436\u0438 \u043E\u0442\u0437\u0430\u0434", absolute_desc:"\u0412\u043A\u043B\u044E\u0447\u0438 \u0430\u0431\u0441\u043E\u043B\u044E\u0442\u043D\u043E \u043F\u043E\u0437\u0438\u0446\u0438\u043E\u043D\u0438\u0440\u0430\u043D\u0435", content:"\u041D\u043E\u0432 \u0441\u043B\u043E\u0439..." }, save:{ save_desc:"\u0417\u0430\u043F\u0438\u0448\u0438", cancel_desc:"\u041E\u0442\u043A\u0430\u0436\u0438 \u0432\u0441\u0438\u0447\u043A\u0438 \u043F\u0440\u043E\u043C\u0435\u043D\u0438" }, nonbreaking:{ nonbreaking_desc:"\u0412\u043C\u044A\u043A\u043D\u0438 \u043D\u0435\u043F\u0440\u0435\u043A\u044A\u0441\u0432\u0430\u0435\u043C \u0438\u043D\u0442\u0435\u0440\u0432\u0430\u043B" }, iespell:{ iespell_desc:"\u041F\u0440\u043E\u0432\u0435\u0440\u0438 \u043F\u0440\u0430\u0432\u043E\u043F\u0438\u0441\u0430", download:"ieSpell \u043D\u0435 \u0435 \u043E\u0442\u043A\u0440\u0438\u0442. \u0416\u0435\u043B\u0430\u0435\u0442\u0435 \u043B\u0438 \u0434\u0430 \u0433\u043E \u0438\u043D\u0441\u0442\u0430\u043B\u0438\u0440\u0430\u0442\u0435 \u0441\u0435\u0433\u0430?" }, advhr:{ advhr_desc:"\u0425\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u043D\u0430 \u043B\u0438\u043D\u0438\u044F" }, emotions:{ emotions_desc:"\u0415\u043C\u043E\u0442\u0438\u043A\u043E\u043D\u0438" }, searchreplace:{ search_desc:"\u0422\u044A\u0440\u0441\u0438", replace_desc:"\u0422\u044A\u0440\u0441\u0438/\u0417\u0430\u043C\u0435\u0441\u0442\u0438" }, advimage:{ image_desc:"\u0412\u043C\u044A\u043A\u043D\u0438/\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u0430\u0439 \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0430" }, advlink:{ link_desc:"\u0412\u043C\u044A\u043A\u043D\u0438/\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u0430\u0439 \u0445\u0438\u043F\u0435\u0440\u0432\u0440\u044A\u0437\u043A\u0430" }, xhtmlxtras:{ cite_desc:"\u0426\u0438\u0442\u0430\u0442", abbr_desc:"\u0421\u044A\u043A\u0440\u0430\u0449\u0435\u043D\u0438\u0435", acronym_desc:"\u0410\u043A\u0440\u043E\u043D\u0438\u043C", del_desc:"\u0418\u0437\u0442\u0440\u0438\u0432\u0430\u043D\u0435", ins_desc:"\u0412\u043C\u044A\u043A\u0432\u0430\u043D\u0435", attribs_desc:"\u0412\u043C\u044A\u043A\u043D\u0438/\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u0430\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0438" }, style:{ desc:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u0430\u0439 CSS \u0441\u0442\u0438\u043B" }, paste:{ paste_text_desc:"\u041F\u043E\u0441\u0442\u0430\u0432\u0438 \u043A\u0430\u0442\u043E \u0442\u0435\u043A\u0441\u0442", paste_word_desc:"\u041F\u043E\u0441\u0442\u0430\u0432\u0438 \u043E\u0442 Word", selectall_desc:"\u0418\u0437\u0431\u0435\u0440\u0438 \u0432\u0441\u0438\u0447\u043A\u0438" }, paste_dlg:{ text_title:"\u0418\u0437\u043F\u043E\u043B\u0437\u0432\u0430\u0439\u0442\u0435 CTRL+V \u043D\u0430 \u043A\u043B\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0430\u0442\u0430 \u0437\u0430 \u0434\u0430 \u043F\u043E\u0441\u0442\u0430\u0432\u0438\u0442\u0435 \u0442\u0435\u043A\u0441\u0442\u0430 \u0432 \u043F\u0440\u043E\u0437\u043E\u0440\u0435\u0446\u0430.", text_linebreaks:"\u0417\u0430\u043F\u0430\u0437\u0438 \u043D\u043E\u0432\u0438\u0442\u0435 \u0440\u0435\u0434\u043E\u0432\u0435", word_title:"\u0418\u0437\u043F\u043E\u043B\u0437\u0432\u0430\u0439\u0442\u0435 CTRL+V \u043D\u0430 \u043A\u043B\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0430\u0442\u0430 \u0437\u0430 \u0434\u0430 \u043F\u043E\u0441\u0442\u0430\u0432\u0438\u0442\u0435 \u0442\u0435\u043A\u0441\u0442\u0430 \u0432 \u043F\u0440\u043E\u0437\u043E\u0440\u0435\u0446\u0430." }, table:{ desc:"\u0412\u043C\u044A\u043A\u043D\u0438 \u043D\u043E\u0432\u0430 \u0442\u0430\u0431\u043B\u0438\u0446\u0430", row_before_desc:"\u0412\u043C\u044A\u043A\u043D\u0438 \u0440\u0435\u0434 \u043F\u0440\u0435\u0434\u0438", row_after_desc:"\u0412\u043C\u044A\u043A\u043D\u0438 \u0440\u0435\u0434 \u0441\u043B\u0435\u0434", delete_row_desc:"\u0418\u0437\u0442\u0440\u0438\u0439 \u0440\u0435\u0434", col_before_desc:"\u0412\u043C\u044A\u043A\u043D\u0438 \u043A\u043E\u043B\u043E\u043D\u0430 \u043F\u0440\u0435\u0434\u0438", col_after_desc:"\u0412\u043C\u044A\u043A\u043D\u0438 \u043A\u043E\u043B\u043E\u043D\u0430 \u0441\u043B\u0435\u0434", delete_col_desc:"\u0418\u0437\u0442\u0440\u0438\u0439 \u043A\u043E\u043B\u043E\u043D\u0430", split_cells_desc:"\u0420\u0430\u0437\u0434\u0435\u043B\u0438 \u0441\u043B\u0435\u0442\u0438 \u043A\u043B\u0435\u0442\u043A\u0438", merge_cells_desc:"\u0421\u043B\u0435\u0439 \u043A\u043B\u0435\u0442\u043A\u0438", row_desc:"\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u043D\u0430 \u0440\u0435\u0434\u0430", cell_desc:"\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u043D\u0430 \u043A\u043B\u0435\u0442\u043A\u0430\u0442\u0430", props_desc:"\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u043D\u0430 \u0442\u0430\u0431\u043B\u0438\u0446\u0430\u0442\u0430", paste_row_before_desc:"\u041F\u043E\u0441\u0442\u0430\u0432\u0438 \u0440\u0435\u0434 \u043F\u0440\u0435\u0434\u0438", paste_row_after_desc:"\u041F\u043E\u0441\u0442\u0430\u0432\u0438 \u0440\u0435\u0434 \u0441\u043B\u0435\u0434", cut_row_desc:"\u041E\u0442\u0440\u0435\u0436\u0438 \u0440\u0435\u0434", copy_row_desc:"\u041A\u043E\u043F\u0438\u0440\u0430\u0439 \u0440\u0435\u0434", del:"\u0418\u0437\u0442\u0440\u0438\u0439 \u0442\u0430\u0431\u043B\u0438\u0446\u0430", row:"\u0420\u0435\u0434", col:"\u041A\u043E\u043B\u043E\u043D\u0430", cell:"\u041A\u043B\u0435\u0442\u043A\u0430" }, autosave:{ unload_msg:"\u041F\u0440\u043E\u043C\u0435\u043D\u0438\u0442\u0435 \u043A\u043E\u0438\u0442\u043E \u043D\u0430\u043F\u0440\u0430\u0432\u0438\u0445\u0442\u0435 \u0449\u0435 \u0441\u0435 \u0437\u0430\u0433\u0443\u0431\u044F\u0442 \u0430\u043A\u043E \u043E\u0442\u0438\u0434\u0435\u0442\u0435 \u043D\u0430 \u0434\u0440\u0443\u0433\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430." }, fullscreen:{ desc:"\u0412\u043A\u043B./\u0418\u0437\u043A\u043B. \u0446\u044F\u043B \u0435\u043A\u0440\u0430\u043D" }, media:{ desc:"\u0412\u043C\u044A\u043A\u043D\u0438/\u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u0430\u0439 \u043C\u0435\u0434\u0438\u0430\u0442\u0430", edit:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u0430\u043A \u043C\u0435\u0434\u0438\u0430" }, fullpage:{ desc:"\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u043D\u0430 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430" }, template:{ desc:"\u0412\u043C\u044A\u043A\u043D\u0438 \u0441\u044A\u0434\u044A\u0440\u0436\u0430\u043D\u0438\u0435\u0442\u043E \u043D\u0430 \u0442\u0435\u043C\u043F\u043B\u0435\u0439\u0442" }, visualchars:{ desc:"\u0412\u043A\u043B./\u0418\u0437\u043A\u043B. \u043D\u0430 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u043D\u0438\u0442\u0435 \u0441\u0438\u043C\u0432\u043E\u043B\u0438." }, spellchecker:{ desc:"\u0412\u043A\u043B./\u0418\u0437\u043A\u043B. \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0430 \u043D\u0430 \u043F\u0440\u0430\u0432\u043E\u043F\u0438\u0441\u0430", menu:"\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u043D\u0430 \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0430\u0442\u0430 \u043D\u0430 \u043F\u0440\u0430\u0432\u043E\u043F\u0438\u0441", ignore_word:"\u0418\u0433\u043D\u043E\u0440\u0438\u0440\u0430\u0439 \u0434\u0443\u043C\u0430", ignore_words:"\u0418\u0433\u043D\u043E\u0440\u0438\u0440\u0430\u0439 \u0432\u0441\u0438\u0447\u043A\u0438", langs:"\u0415\u0437\u0438\u0446\u0438", wait:"\u041C\u043E\u043B\u044F \u0438\u0437\u0447\u0430\u043A\u0430\u0439\u0442\u0435...", sug:"\u041F\u0440\u0435\u0434\u043B\u043E\u0436\u0435\u043D\u0438\u044F", no_sug:"\u041D\u044F\u043C\u0430 \u043F\u0440\u0435\u0434\u043B\u043E\u0436\u0435\u043D\u0438\u044F", no_mpell:"\u041D\u044F\u043C\u0430 \u0433\u0440\u0435\u0448\u043D\u043E \u043D\u0430\u043F\u0438\u0441\u0430\u043D\u0438 \u0434\u0443\u043C\u0438." }, pagebreak:{ desc:"\u0412\u043C\u044A\u043A\u043D\u0438 \u043D\u043E\u0432\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430." }}});�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/bn.js���������������������������������������������������������0000664�0000000�0000000�00000014463�12266004471�0020247�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({bn:{ common:{ edit_confirm:"\u0986\u09AA\u09A8\u09BF \u0995\u09BF \u098F\u0987 textarea\u099F\u09BF\u09B0 \u099C\u09A8\u09CD\u09AF WYSIWYG \u09AE\u09CB\u09A1 \u09AC\u09CD\u09AF\u09AC\u09B9\u09BE\u09B0 \u0995\u09B0\u09A4\u09C7 \u099A\u09BE\u09A8?", apply:"\u098F\u09AA\u09CD\u09B2\u09CD\u09AF\u09BE\u0987", insert:"\u0987\u09A8\u09B8\u09BE\u09B0\u09CD\u099F", update:"\u0986\u09AA\u09A1\u09C7\u099F", cancel:"\u0995\u09CD\u09AF\u09BE\u09A8\u09B8\u09C7\u09B2", close:"\u09AC\u09A8\u09CD\u09A7", browse:"\u09AC\u09CD\u09B0\u09BE\u0989\u099C", class_name:"\u0995\u09CD\u09B2\u09BE\u09B8", not_set:"-- \u09B8\u09C7\u099F \u09A8\u09DF --", clipboard_msg:"\u0995\u09AA\u09BF/\u0995\u09BE\u099F/\u09AA\u09C7\u09B7\u09CD\u099F \u09AE\u099C\u09BF\u09B2\u09BE \u098F\u09AC\u0982 \u09AB\u09BE\u09DF\u09BE\u09B0\u09AB\u0995\u09CD\u09B8 \u098F \u09B8\u09AE\u09CD\u09AD\u09AC \u09A8\u09DF\n\u0986\u09AA\u09A8\u09BF \u0995\u09BF \u098F\u0987 \u09AC\u09BF\u09B7\u09DF\u099F\u09BF\u09B0 \u09B8\u09AE\u09CD\u09AC\u09A8\u09CD\u09A7\u09C7 \u0986\u09B0\u0993 \u09AC\u09C7\u09B6\u09BF \u09A4\u09A5\u09CD\u09AF \u099A\u09BE\u09A8", clipboard_no_support:"\u0986\u09AA\u09A8\u09BE\u09B0 \u09AC\u09CD\u09B0\u09BE\u0989\u099C\u09BE\u09B0\u09C7\u09B0 \u09A6\u09CD\u09AC\u09BE\u09B0\u09BE \u09AC\u09B0\u09CD\u09A4\u09AE\u09BE\u09A8\u09C7 \u09B8\u09AE\u09B0\u09CD\u09A5\u09BF\u09A4 \u09A8\u09BE, \u09AA\u09B0\u09BF\u09AC\u09B0\u09CD\u09A4\u09C7 \u0995\u09C0\u09AC\u09CB\u09B0\u09CD\u09A1 \u09B6\u09B0\u09CD\u099F\u0995\u09BE\u099F \u09AC\u09CD\u09AF\u09AC\u09B9\u09BE\u09B0 \u0995\u09B0\u09C1\u09A8\u0964", popup_blocked:"\u09A6\u09C1\u0983\u0996\u09BF\u09A4, \u0995\u09BF\u09A8\u09CD\u09A4\u09C1 \u0986\u09AE\u09B0\u09BE \u09B2\u0995\u09CD\u09B7\u09CD\u09AF \u0995\u09B0\u09C7\u099B\u09BF \u09AF\u09C7 \u0986\u09AA\u09A8\u09BE\u09B0 \u09AA\u09AA-\u0986\u09AA \u09AC\u09CD\u09B2\u0995\u09BE\u09B0 \u098F\u0995\u099F\u09BF \u0989\u0987\u09A8\u09CD\u09A1\u09CB \u09A8\u09BF\u09B7\u09CD\u0995\u09CD\u09B0\u09BF\u09DF \u0995\u09B0\u09C7\u099B\u09C7 \u09AF\u09BE \u0985\u09CD\u09AF\u09BE\u09AA\u09B2\u09BF\u0995\u09C7\u09B6\u09A8 \u098F\u09B0 \u09AB\u09BE\u0982\u09B6\u09A8\u09BE\u09B2\u09BF\u099F\u09BF\u09B0 \u099C\u09A8\u09CD\u09AF \u09AA\u09CD\u09B0\u09DF\u09CB\u099C\u09A8\u09C0\u09DF\u0964\u0986\u09AA\u09A8\u09BF \u098F\u0987 \u099F\u09C1\u09B2\u099F\u09BF \u09B8\u09AE\u09CD\u09AA\u09C2\u09B0\u09CD\u09A3\u09AD\u09BE\u09AC\u09C7 \u09AC\u09CD\u09AF\u09BE\u09AC\u09B9\u09BE\u09B0 \u0995\u09B0\u09A4\u09C7 \u099A\u09BE\u0987\u09B2\u09C7 \u098F\u0987 \u09B8\u09BE\u0987\u099F\u099F\u09BF \u09A5\u09C7\u0995\u09C7 \u09AA\u09AA-\u0986\u09AA \u09AC\u09CD\u09B2\u0995\u09BF\u0982 \u09A8\u09BF\u09B7\u09CD\u0995\u09CD\u09B0\u09BF\u09DF \u0995\u09B0\u09A4\u09C7 \u09B9\u09AC\u09C7\u0964", invalid_data:"\u09A4\u09CD\u09B0\u09C1\u099F\u09BF: \u09AC\u09C7\u09A0\u09BF\u0995 \u09AE\u09BE\u09A8 \u09A2\u09C1\u0995\u09BE\u09A8\u09CB \u09B9\u09DF\u09C7\u099B\u09C7, \u098F\u0987\u0997\u09C1\u09B2\u09BF \u09B2\u09BE\u09B2 \u099A\u09BF\u09B9\u09CD\u09A8\u09BF\u09A4 \u0995\u09B0\u09BE \u09B9\u09B2\u0964", more_colors:"\u0986\u09B0\u0993 \u09AC\u09C7\u09B6\u09BF \u09B0\u0982" }, contextmenu:{ align:"Alignment", left:"Left", center:"Center", right:"Right", full:"Full" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"Insert date", inserttime_desc:"Insert time", months_long:"January,February,March,April,May,June,July,August,September,October,November,December", months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun" }, print:{ print_desc:"Print" }, preview:{ preview_desc:"Preview" }, directionality:{ ltr_desc:"Direction left to right", rtl_desc:"Direction right to left" }, layer:{ insertlayer_desc:"Insert new layer", forward_desc:"Move forward", backward_desc:"Move backward", absolute_desc:"Toggle absolute positioning", content:"New layer..." }, save:{ save_desc:"Save", cancel_desc:"Cancel all changes" }, nonbreaking:{ nonbreaking_desc:"Insert non-breaking space character" }, iespell:{ iespell_desc:"Run spell checking", download:"ieSpell not detected. Do you want to install it now?" }, advhr:{ advhr_desc:"Horizontal rule" }, emotions:{ emotions_desc:"Emotions" }, searchreplace:{ search_desc:"Find", replace_desc:"Find/Replace" }, advimage:{ image_desc:"Insert/edit image" }, advlink:{ link_desc:"Insert/edit link" }, xhtmlxtras:{ cite_desc:"Citation", abbr_desc:"Abbreviation", acronym_desc:"Acronym", del_desc:"Deletion", ins_desc:"Insertion", attribs_desc:"Insert/Edit Attributes" }, style:{ desc:"Edit CSS Style" }, paste:{ paste_text_desc:"Paste as Plain Text", paste_word_desc:"Paste from Word", selectall_desc:"Select All" }, paste_dlg:{ text_title:"Use CTRL+V on your keyboard to paste the text into the window.", text_linebreaks:"Keep linebreaks", word_title:"Use CTRL+V on your keyboard to paste the text into the window." }, table:{ desc:"Inserts a new table", row_before_desc:"Insert row before", row_after_desc:"Insert row after", delete_row_desc:"Delete row", col_before_desc:"Insert column before", col_after_desc:"Insert column after", delete_col_desc:"Remove column", split_cells_desc:"Split merged table cells", merge_cells_desc:"Merge table cells", row_desc:"Table row properties", cell_desc:"Table cell properties", props_desc:"Table properties", paste_row_before_desc:"Paste table row before", paste_row_after_desc:"Paste table row after", cut_row_desc:"Cut table row", copy_row_desc:"Copy table row", del:"Delete table", row:"Row", col:"Column", cell:"Cell" }, autosave:{ unload_msg:"The changes you made will be lost if you navigate away from this page." }, fullscreen:{ desc:"Toggle fullscreen mode" }, media:{ desc:"Insert / edit embedded media", edit:"Edit embedded media" }, fullpage:{ desc:"Document properties" }, template:{ desc:"Insert predefined template content" }, visualchars:{ desc:"Visual control characters on/off." }, spellchecker:{ desc:"Toggle spellchecker", menu:"Spellchecker settings", ignore_word:"Ignore word", ignore_words:"Ignore all", langs:"Languages", wait:"Please wait...", sug:"Suggestions", no_sug:"No suggestions", no_mpell:"No misspellings found." }, pagebreak:{ desc:"Insert page break." }}});�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/br.js���������������������������������������������������������0000664�0000000�0000000�00000010535�12266004471�0020247�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({br:{ common:{ edit_confirm:"Deseja usar o modo de edi\u00E7\u00E3o avan\u00E7ado neste campo de texto?", apply:"Aplicar", insert:"Inserir", update:"Atualizar", cancel:"Cancelar", close:"Fechar", browse:"Procurar", class_name:"Classe", not_set:"-- N\u00E3o especificado --", clipboard_msg:"Copiar/cortar/colar n\u00E3o est\u00E1 dispon\u00EDvel no Mozilla/Firefox.\nDeseja mais informa\u00E7\u00F5es sobre este problema?", clipboard_no_support:"O seu navegador n\u00E3o tem suporte para esta fun\u00E7\u00E3o, use os atalhos do teclado.", popup_blocked:"Detectamos que o seu bloqueador de popups bloqueou uma janela que \u00E9 essencial para o aplicativo. Voc\u00EA precisa desativar o bloqueador de popups para utilizar esta ferramenta.", invalid_data:"Erro: Valores inv\u00E1lidos est\u00E3o marcados em vermelho.", more_colors:"Mais Cores" }, contextmenu:{ align:"Alinhamento", left:"Esquerda", center:"Centro", right:"Direita", full:"Justificar" }, insertdatetime:{ date_fmt:"%d-%m-%Y", time_fmt:"%H:%M:%S", insertdate_desc:"Inserir data", inserttime_desc:"Inserir hora", months_long:"Janeiro,Fevereiro,Mar\u00E7o,Abril,Maio,Junho,Julho,Agosto,Setembro,Outubro,Novembro,Dezembro", months_short:"Jan,Fev,Mar,Abr,Mai,Jun,Jul,Ago,Set,Out,Nov,Dez", day_long:"Domingo,Segunda-Feira,Ter\u00E7a-Feira,Quarta-Feira,Quinta-Feira,Sexta-Feira,S\u00E1bado,Domingo", day_short:"Dom,Seg,Ter,Qua,Qui,Sex,Sab,Dom" }, print:{ print_desc:"Imprimir" }, preview:{ preview_desc:"Pr\u00E9-Visualizar" }, directionality:{ ltr_desc:"Da esquerda para direita", rtl_desc:"Da direita para esquerda" }, layer:{ insertlayer_desc:"Inserir nova camada", forward_desc:"Mover para frente", backward_desc:"Mover para tr\u00E1s", absolute_desc:"Alternar posicionamento absoluto", content:"Nova camada..." }, save:{ save_desc:"Salvar", cancel_desc:"Cancelar todas as altera\u00E7\u00F5es" }, nonbreaking:{ nonbreaking_desc:"Inserir um espa\u00E7o" }, iespell:{ iespell_desc:"Verificar ortografia", download:"Aplicativo de ortografia n\u00E3o-detectado. Deseja instal\u00E1-lo agora?" }, advhr:{ advhr_desc:"Separador horizontal" }, emotions:{ emotions_desc:"Emoticons" }, searchreplace:{ search_desc:"Localizar", replace_desc:"Localizar/substituir" }, advimage:{ image_desc:"Inserir/editar imagem" }, advlink:{ link_desc:"Inserir/editar hyperlink" }, xhtmlxtras:{ cite_desc:"Cita\u00E7\u00E3o", abbr_desc:"Abrevia\u00E7\u00E3o", acronym_desc:"Acr\u00F4nimo", del_desc:"Apagar", ins_desc:"Inserir", attribs_desc:"Inserir/Editar atributos" }, style:{ desc:"Editar CSS" }, paste:{ paste_text_desc:"Colar como texto simples", paste_word_desc:"Colar (copiado do WORD)", selectall_desc:"Selecionar tudo" }, paste_dlg:{ text_title:"Use CTRL+V para colar o texto na janela.", text_linebreaks:"Manter quebras de linha", word_title:"Use CTRL+V para colar o texto na janela." }, table:{ desc:"Inserir nova tabela", row_before_desc:"Inserir linha antes", row_after_desc:"Inserir linha depois", delete_row_desc:"Apagar linha", col_before_desc:"Inserir coluna antes", col_after_desc:"Inserir coluna depois", delete_col_desc:"Remover coluna", split_cells_desc:"Dividir c\u00E9lulas", merge_cells_desc:"Unir c\u00E9lulas", row_desc:"Propriedades das linhas", cell_desc:"Propriedades das c\u00E9lulas", props_desc:"Propriedades da tabela", paste_row_before_desc:"Colar linha antes", paste_row_after_desc:"Colar linha depois", cut_row_desc:"Cortar linha", copy_row_desc:"Copiar linha", del:"Apagar tabela", row:"Linha", col:"Coluna", cell:"C\u00E9lula" }, autosave:{ unload_msg:"As mudan\u00E7as efetuadas ser\u00E3o perdidas se sair desta p\u00E1gina." }, fullscreen:{ desc:"Tela Inteira" }, media:{ desc:"Inserir/Editar m\u00EDdia incorporada", edit:"Editar m\u00EDdia incorporada" }, fullpage:{ desc:"Propriedades do Documento" }, template:{ desc:"Inserir template" }, visualchars:{ desc:"Caracteres de controle visual ligado/desligado" }, spellchecker:{ desc:"Alternar verifica\u00E7\u00E3o ortogr\u00E1fica", menu:"Configura\u00E7\u00F5es de ortografia", ignore_word:"Ignorar palavra", ignore_words:"Ignorar tudo", langs:"Linguagens", wait:"Aguarde...", sug:"Sugest\u00F5es", no_sug:"Sem sugest\u00F5es", no_mpell:"N\u00E3o foram detectados erros de ortografia." }, pagebreak:{ desc:"Inserir quebra de p\u00E1gina." }}});�������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/bs.js���������������������������������������������������������0000664�0000000�0000000�00000010462�12266004471�0020247�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({bs:{ common:{ edit_confirm:"\u017Delite li koristiti WYSIWYG na\u010Din rada za ovo tekstualno polje?", apply:"Primjeni", insert:"Umetni", update:"Obnovi", cancel:"Odustani", close:"Zatvori", browse:"Pregled", class_name:"Klasa", not_set:"-- Nije postavljeno --", clipboard_msg:"Kopiraj/Izre\u017Ei/Zalijepi nije dostupno Mozilla i Firefox preglednicima.\nVi\u0161e informacija?", clipboard_no_support:"Trenuta\u010Dno va\u0161 preglednik ne podr\u017Eava ovu opciju, poku\u0161ajte koristiti tipkovni\u010Dku kraticu.", popup_blocked:"Oprostite, izgleda da je va\u0161 popup-blocker onemogu\u0107io prozor u sklopu ovog programa. Morate onemogu\u0107iti blokiranje popup prozora da bi u potpunosti iskoristili ovaj alat.", invalid_data:"Gre\u0161ka: Une\u0161ene su nevaljane vrijednosti, ozna\u010Dene su crvenom bojom.", more_colors:"Vi\u0161e boja" }, contextmenu:{ align:"Poravnavanje", left:"Lijevo", center:"Sredina", right:"Desno", full:"Puno" }, insertdatetime:{ date_fmt:"%d.%m.%Y.", time_fmt:"%H:%M:%S", insertdate_desc:"Umetni datum", inserttime_desc:"Umetni vrijeme", months_long:"sije\u010Danj,velja\u010Da,o\u017Eujak,travanj,svibanj,lipanj,srpanj,kolovoz,rujan,listopad,studeni,prosinac", months_short:"sij,velj,o\u017Eu,tra,svi,lip,srp,kol,ruj,lis,stu,pro", day_long:"nedjelja,ponedjeljak,utorak,srijeda,\u010Detvrtak,petak,subota,nedjelja", day_short:"ned,pon,uto,sri,\u010Det,pet,sub,ned" }, print:{ print_desc:"Ispis" }, preview:{ preview_desc:"Prikaz" }, directionality:{ ltr_desc:"S lijeva na desno", rtl_desc:"S desna na lijevo" }, layer:{ insertlayer_desc:"Umetni novi sloj", forward_desc:"Pomakni naprijed", backward_desc:"Pomakni natrag", absolute_desc:"Uklju\u010Di/isklju\u010Di apsolutno pozicioniranje", content:"Novi sloj..." }, save:{ save_desc:"Spremi", cancel_desc:"Odustani od svih promjena" }, nonbreaking:{ nonbreaking_desc:"Umetni razmak" }, iespell:{ iespell_desc:"Pokreni provjeru pravopisa", download:"Provjera pravopisa nije postaljena. Postaviti sada?" }, advhr:{ advhr_desc:"Vodoravna crta" }, emotions:{ emotions_desc:"Emocije" }, searchreplace:{ search_desc:"Prona\u0111i", replace_desc:"Prona\u0111i/Zamijeni" }, advimage:{ image_desc:"Umetni/uredi sliku" }, advlink:{ link_desc:"Insert/edit link" }, xhtmlxtras:{ cite_desc:"Citat", abbr_desc:"Kratica", acronym_desc:"Akronim", del_desc:"Brisanje", ins_desc:"Unos", attribs_desc:"Umetni/uredi atribute" }, style:{ desc:"Uredi CSS" }, paste:{ paste_text_desc:"Zalijepi kao obi\u010Dni tekst", paste_word_desc:"Zalijepi iz Worda", selectall_desc:"Odaberi sve" }, paste_dlg:{ text_title:"Koristite CTRL+V na tipkovnici da zalijepite tekst u prozor.", text_linebreaks:"Zadr\u017Ei prijelome", word_title:"Koristite CTRL+V na tipkovnici da zalijepite tekst u prozor." }, table:{ desc:"Nova tablica", row_before_desc:"Umetni redak iznad", row_after_desc:"Umetni redak ispod", delete_row_desc:"Izbri\u0161i redak", col_before_desc:"Umetni stupac lijevo", col_after_desc:"Umetni stupac desno", delete_col_desc:"Ukloni stupac", split_cells_desc:"Razdvoji spojene \u0107elije", merge_cells_desc:"Spoji \u0107elije", row_desc:"Svojstva retka", cell_desc:"Svojstva \u0107elije", props_desc:"Svojstva tablice", paste_row_before_desc:"Zalijepi redak iznad", paste_row_after_desc:"Zalijepi redak ispod", cut_row_desc:"Izre\u017Ei redak", copy_row_desc:"Kopiraj redak", del:"Izbri\u0161i tablicu", row:"Redak", col:"Stupac", cell:"\u0106elija" }, autosave:{ unload_msg:"Promjene u dokumentu \u0107e biti izgubljene ako iza\u0111ete s ove stranice." }, fullscreen:{ desc:"Uklju\u010Di/isklju\u010Di prikaz preko cijelog ekrana" }, media:{ desc:"Insert / edit embedded media", edit:"Edit embedded media" }, fullpage:{ desc:"Svojstva dokumenta" }, template:{ desc:"Umetni sadr\u017Eaj iz predlo\u017Eak" }, visualchars:{ desc:"Vizualni kontrolni znakovi uklju\u010Deni/isklju\u010Deni." }, spellchecker:{ desc:"Uklju\u010Di/isklju\u010Di provjeru pravopisa", menu:"Postavke provjere pravopisa", ignore_word:"Zanemari rije\u010D", ignore_words:"Zanemari sver", langs:"Jezici", wait:"Pri\u010Dekajte...", sug:"Prijedlozi", no_sug:"Nema prijedloga", no_mpell:"Nije prona\u0111ena nijedna pravopisna gre\u0161ke." }, pagebreak:{ desc:"Umetni prijelom." }}});��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/ca.js���������������������������������������������������������0000664�0000000�0000000�00000011027�12266004471�0020224�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({ca:{ common:{ edit_confirm:"Voleu utilitzar el mode WYSIWYG?", apply:"Aplica", insert:"Insereix", update:"Actualitza", cancel:"Cancel\u00B7la", close:"Tanca", browse:"Explora", class_name:"Classe", not_set:"-- No definit --", clipboard_msg:"Copia/Retalla/Enganxa no es troba disponible al Mozilla ni al Firefox.\nVoleu m\u00E9s informaci\u00F3 sobre aquesta q\u00FCesti\u00F3?", clipboard_no_support:"El vostre navegador actualment no ho admet, utilitzeu les dreceres de teclat.", popup_blocked:"El bloqueig de finestres emergents ha inhabilitat una finestra que proporciona funcionalitat a l\'aplicaci\u00F3. Cal que desactiveu el bloqueig de finestres emergents en aquest lloc per tal de poder utilitzar de forma completa aquesta eina.", invalid_data:"Error: heu introdu\u00EFt valors no v\u00E0lids, els marcats en vermell.", more_colors:"M\u00E9s colors" }, contextmenu:{ align:"Alineaci\u00F3", left:"Esquerra", center:"Centre", right:"Dreta", full:"Justificat" }, insertdatetime:{ date_fmt:"%d-%m-%Y", time_fmt:"%H:%M:%S", insertdate_desc:"Insereix la data", inserttime_desc:"Insereix l\'hora", months_long:"Jgener,febrer,mar\u00E7,abril,maig,juny,juliol,agost,setembre,octubre,novembre,desembre", months_short:"gen.,febr.,mar\u00E7,abr.,maig,juny,jul.,ag.,set.,oct.,nov.,des.", day_long:"diumenge,dilluns,dimarts,dimecres,dijous,divendres,dissabte,diumenge", day_short:"dg.,dl.,dt.,dc.,dj.,dv.,ds.,dg." }, print:{ print_desc:"Imprimeix" }, preview:{ preview_desc:"Previsualitzaci\u00F3" }, directionality:{ ltr_desc:"Direcci\u00F3 esquerra a dreta", rtl_desc:"Direcci\u00F3 dreta a esquerra" }, layer:{ insertlayer_desc:"Insereix una nova capa", forward_desc:"Mou endavant", backward_desc:"Mou endarrera", absolute_desc:"Conmuta el posicionament absolut", content:"Nova Capa..." }, save:{ save_desc:"Desa", cancel_desc:"Cancel\u00B7la tots els canvis" }, nonbreaking:{ nonbreaking_desc:"Insereix un car\u00E0cter espai en blanc" }, iespell:{ iespell_desc:"Executa la correcci\u00F3 ortogr\u00E0fica", download:"no he detectat l\'ieSpell. Voleu instal\u00B7lar-ho?" }, advhr:{ advhr_desc:"Filet horitzontal" }, emotions:{ emotions_desc:"Emoticones" }, searchreplace:{ search_desc:"Cerca", replace_desc:"Cerca/Reempla\u00E7a" }, advimage:{ image_desc:"Insereix/edita imatge" }, advlink:{ link_desc:"Insert/edit link" }, xhtmlxtras:{ cite_desc:"Citaci\u00F3", abbr_desc:"Abreviaci\u00F3", acronym_desc:"Acr\u00F2nim", del_desc:"Eliminaci\u00F3", ins_desc:"Inserci\u00F3", attribs_desc:"Insereix/edita atributs" }, style:{ desc:"Edita l\'estil CSS" }, paste:{ paste_text_desc:"Enganxa com a text pla", paste_word_desc:"Enganxa des del Word", selectall_desc:"Selecciona-ho tot" }, paste_dlg:{ text_title:"Amb el teclat utilitzeu CTRL+V per a enganxar el text dins la finestra.", text_linebreaks:"Conserva els salts de l\u00EDnia", word_title:"Amb el teclat utilitzeu CTRL+V per a enganxar el text dins la finestra." }, table:{ desc:"Insereix una nova taula", row_before_desc:"Insereix una fila abans", row_after_desc:"Insereix una fila despr\u00E9s", delete_row_desc:"Elimina la fila", col_before_desc:"Insereix una columna abans", col_after_desc:"Insereix una columna despr\u00E9s", delete_col_desc:"Elimina la columna", split_cells_desc:"Divideix les cel\u00B7les fusionades", merge_cells_desc:"Fusiona les cel\u00B7les", row_desc:"Propietats de la fila", cell_desc:"Propietats de la cel\u00B7la", props_desc:"Propietats de la taula", paste_row_before_desc:"Enganxa la fila abans", paste_row_after_desc:"Enganxa la fila despr\u00E9s", cut_row_desc:"Retalla la fila", copy_row_desc:"Copia la fila", del:"Elimina la taula", row:"Fila", col:"Columna", cell:"Cel\u00B7la" }, autosave:{ unload_msg:"Els canvis que heu fet es perdran si navegueu a fora d\'aquesta p\u00E0gina." }, fullscreen:{ desc:"Commuta a mode de pantalla completa" }, media:{ desc:"Insereix / edita multim\u00E8dia incrustat", edit:"Edita multim\u00E8dia incrustat" }, fullpage:{ desc:"Propietats del document" }, template:{ desc:"Insereix un contingut predefinit" }, visualchars:{ desc:"Activa/desactiva els car\u00E0cters de control visual." }, spellchecker:{ desc:"Corrector ortogr\u00E0fic", menu:"Configuraci\u00F3 del corrector", ignore_word:"Ignora el mot", ignore_words:"Ignora\'ls tots", langs:"Idiomes", wait:"Espereu...", sug:"Suggeriments", no_sug:"Cap suggeriment", no_mpell:"No s\'ha trobat cap falta d\'ortografia." }, pagebreak:{ desc:"Insereix un salt de p\u00E0gina." }}});���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/ch.js���������������������������������������������������������0000664�0000000�0000000�00000013254�12266004471�0020237�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({ch:{ common:{ edit_confirm:"\u662F\u5426\u5207\u6362\u5230\u300C\u6240\u89C1\u5373\u6240\u5F97\u300D\u6A21\u5F0F\uFF1F", apply:"\u5E94\u7528", insert:"\u63D2\u5165", update:"\u66F4\u65B0", cancel:"\u53D6\u6D88", close:"\u5173\u95ED", browse:"\u6D4F\u89C8", class_name:"\u6837\u5F0F", not_set:"--\u672A\u8BBE\u7F6E--", clipboard_msg:"\u590D\u5236\u3001\u526A\u5207\u3001\u7C98\u8D34\u529F\u80FD\u5728Mozilla\u548CFirefox\u4E2D\u65E0\u6CD5\u4F7F\u7528\u3002\n\u662F\u5426\u9700\u8981\u4E86\u89E3\u66F4\u591A\u6709\u5173\u6B64\u95EE\u9898\u7684\u4FE1\u606F\uFF1F", clipboard_no_support:"\u672A\u652F\u6301\u60A8\u7684\u6D4F\u89C8\u5668\uFF0C\u8BF7\u4F7F\u7528\u952E\u76D8\u5FEB\u901F\u952E", popup_blocked:"\u62B1\u6B49\uFF01\u5FEB\u663E\u7A97\u53E3\u5DF2\u88AB\u963B\u6B62\uFF0C\u8BF7\u8C03\u6574\u6D4F\u89C8\u5668\u8BBE\u7F6E\uFF0C\u5141\u8BB8\u6B64\u7F51\u7AD9\u53EF\u5F39\u51FA\u65B0\u7A97\u53E3\uFF0C\u4EE5\u4FBF\u4F7F\u7528\u6B64\u5DE5\u5177", invalid_data:"\u9519\u8BEF:\u65E0\u6548\u8F93\u5165\u503C\uFF0C\u5DF2\u6807\u8BB0\u4E3A\u7EA2\u8272\u3002", more_colors:"\u66F4\u591A\u989C\u8272" }, contextmenu:{ align:"\u5BF9\u9F50\u65B9\u5F0F", left:"\u5C45\u5DE6", center:"\u5C45\u4E2D", right:"\u5C45\u53F3", full:"\u4E24\u7AEF\u5BF9\u9F50" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"\u63D2\u5165\u4ECA\u5929\u65E5\u671F", inserttime_desc:"\u63D2\u5165\u73B0\u5728\u65F6\u95F4", months_long:"\u4E00\u6708,\u4E8C\u6708,\u4E09\u6708,\u56DB\u6708,\u4E94\u6708,\u516D\u6708,\u4E03\u6708,\u516B\u6708,\u4E5D\u6708,\u5341\u6708,\u5341\u4E00\u6708,\u5341\u4E8C\u6708", months_short:"1\u6708,2\u6708,3\u6708,4\u6708,5\u6708,6\u6708,7\u6708,8\u6708,9\u6708,10\u6708,11\u6708,12\u6708", day_long:"\u661F\u671F\u65E5,\u661F\u671F\u4E00,\u661F\u671F\u4E8C,\u661F\u671F\u4E09,\u661F\u671F\u56DB,\u661F\u671F\u4E94,\u661F\u671F\u516D,\u661F\u671F\u65E5", day_short:"\u5468\u65E5,\u5468\u4E00,\u5468\u4E8C,\u5468\u4E09,\u5468\u56DB,\u5468\u4E94,\u5468\u516D,\u5468\u65E5" }, print:{ print_desc:"\u6253\u5370" }, preview:{ preview_desc:"\u9884\u89C8" }, directionality:{ ltr_desc:"\u6587\u5B57\u4ECE\u5DE6\u5230\u53F3", rtl_desc:"\u6587\u5B57\u4ECE\u53F3\u5230\u5DE6" }, layer:{ insertlayer_desc:"\u63D2\u5165\u56FE\u5C42", forward_desc:"\u7F6E\u524D", backward_desc:"\u7F6E\u540E", absolute_desc:"\u5F00\u5173\u7EDD\u5BF9\u4F4D\u7F6E", content:"\u65B0\u5EFA\u56FE\u5C42..." }, save:{ save_desc:"\u4FDD\u5B58", cancel_desc:"\u53D6\u6D88\u66F4\u6539" }, nonbreaking:{ nonbreaking_desc:"\u63D2\u5165\u7A7A\u683C" }, iespell:{ iespell_desc:"\u62FC\u5B57\u68C0\u67E5", download:"\u672A\u68C0\u6D4B\u5230ieSpell\u7684\u5B58\u5728\u3002\u662F\u5426\u73B0\u5728\u7ACB\u5373\u5B89\u88C5\uFF1F" }, advhr:{ advhr_desc:"\u6C34\u5E73\u7EBF" }, emotions:{ emotions_desc:"\u8868\u60C5\u56FE\u50CF" }, searchreplace:{ search_desc:"\u67E5\u627E", replace_desc:"\u67E5\u627E/\u66FF\u6362" }, advimage:{ image_desc:"\u63D2\u5165/\u7F16\u8F91\u56FE\u50CF" }, advlink:{ link_desc:"\u63D2\u5165/\u7F16\u8F91\u94FE\u63A5" }, xhtmlxtras:{ cite_desc:"\u5F15\u6587", abbr_desc:"\u7F29\u5199", acronym_desc:"\u9996\u5B57\u7F29\u5199", del_desc:"\u5220\u9664", ins_desc:"\u63D2\u5165", attribs_desc:"\u63D2\u5165/\u7F16\u8F91\u5C5E\u6027" }, style:{ desc:"\u7F16\u8F91CSS\u6837\u5F0F\u8868" }, paste:{ paste_text_desc:"\u4EE5\u7EAF\u6587\u5B57\u7C98\u8D34", paste_word_desc:"\u4ECEWord\u7C98\u8D34", selectall_desc:"\u5168\u9009" }, paste_dlg:{ text_title:"\u5728\u952E\u76D8\u4E0A\u540C\u65F6\u6309\u4E0BCTRL\u548CV\u952E\uFF0C\u4EE5\u7C98\u8D34\u6587\u5B57\u5230\u6B64\u7A97\u53E3\u3002", text_linebreaks:"\u4FDD\u7559\u5206\u884C\u7B26\u53F7\u53F7", word_title:"\u5728\u952E\u76D8\u4E0A\u540C\u65F6\u6309\u4E0BCTRL\u548CV\u952E\uFF0C\u4EE5\u7C98\u8D34\u6587\u5B57\u5230\u6B64\u7A97\u53E3\u3002" }, table:{ desc:"\u63D2\u5165\u65B0\u8868\u683C", row_before_desc:"\u5728\u4E0A\u65B9\u63D2\u5165\u884C", row_after_desc:"\u5728\u4E0B\u65B9\u63D2\u5165\u884C", delete_row_desc:"\u5220\u9664\u5F53\u524D\u884C", col_before_desc:"\u5728\u5DE6\u4FA7\u63D2\u5165\u5217", col_after_desc:"\u5728\u53F3\u4FA7\u63D2\u5165\u5217", delete_col_desc:"\u5220\u9664\u5F53\u524D\u5217", split_cells_desc:"\u62C6\u5206\u5355\u5143\u683C", merge_cells_desc:"\u5408\u5E76\u5355\u5143\u683C", row_desc:"\u884C\u5C5E\u6027", cell_desc:"\u5355\u5143\u683C\u5C5E\u6027", props_desc:"\u8868\u683C\u5C5E\u6027", paste_row_before_desc:"\u5728\u4E0A\u65B9\u7C98\u8D34\u884C", paste_row_after_desc:"\u5728\u4E0B\u65B9\u7C98\u8D34\u884C", cut_row_desc:"\u526A\u5207\u9009\u5B9A\u884C", copy_row_desc:"\u590D\u5236\u9009\u5B9A\u884C", del:"\u5220\u9664\u8868\u683C", row:"\u884C", col:"\u5217", cell:"\u5355\u5143\u683C" }, autosave:{ unload_msg:"\u5982\u679C\u79BB\u5F00\u6B64\u9875\u9762\u5C06\u5BFC\u81F4\u6240\u505A\u7684\u66F4\u6539\u5168\u90E8\u9057\u5931\u3002" }, fullscreen:{ desc:"\u5F00\u5173\u5168\u7A97\u53E3\u6A21\u5F0F" }, media:{ desc:"\u63D2\u5165/\u7F16\u8F91\u5D4C\u5165\u5A92\u4F53", edit:"\u7F16\u8F91\u5D4C\u5165\u5A92\u4F53" }, fullpage:{ desc:"\u6587\u6863\u5C5E\u6027" }, template:{ desc:"\u63D2\u5165\u9884\u5B9A\u7684\u8303\u672C\u5185\u5BB9" }, visualchars:{ desc:"\u663E\u793A/\u9690\u85CF\u4E0D\u53EF\u89C1\u5B57\u7B26" }, spellchecker:{ desc:"\u5F00\u5173\u62FC\u5B57\u68C0\u67E5", menu:"\u62FC\u5B57\u68C0\u67E5\u8BBE\u7F6E", ignore_word:"\u7565\u8FC7", ignore_words:"\u5168\u90E8\u7565\u8FC7", langs:"\u8BED\u8A00", wait:"\u8BF7\u7A0D\u5019...", sug:"\u63A8\u8350\u5B57\u8BCD", no_sug:"\u65E0\u62FC\u5199\u63A8\u8350", no_mpell:"\u672A\u53D1\u73B0\u62FC\u5199\u9519\u8BEF" }, pagebreak:{ desc:"\u63D2\u5165\u5206\u9875\u7B26\u53F7" }}});����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/cs.js���������������������������������������������������������0000664�0000000�0000000�00000011610�12266004471�0020244�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({cs:{ common:{ edit_confirm:"Chcete pou\u017E\u00EDt pro tento text WYSIWYG editaci?", apply:"Pou\u017E\u00EDt", insert:"Vlo\u017Eit", update:"Aktualizovat", cancel:"Zru\u0161it", close:"Zav\u0159\u00EDt", browse:"Proch\u00E1zet", class_name:"T\u0159\u00EDda", not_set:"- Nenastaveno -", clipboard_msg:"Funkce kop\u00EDrovat/vyjmout/vlo\u017Eit nejsou pou\u017Eiteln\u00E9 v Mozille a Firefoxu.\nChcete v\u00EDce informac\u00ED?", clipboard_no_support:"Tato funkce nen\u00ED va\u0161\u00EDm prohl\u00ED\u017Ee\u010Dem podporov\u00E1na. Pou\u017Eijte kl\u00E1vesov\u00E9 zkratky.", popup_blocked:"Blokov\u00E1n\u00ED vyskakovac\u00EDch oken neumo\u017Enilo otev\u0159\u00EDt okno, nutn\u00E9 pro funkci aplikace. Pro pln\u00E9 vyu\u017Eit\u00ED mo\u017Enost\u00ED vypn\u011Bte blokov\u00E1n\u00ED vyskakovac\u00EDch oken pro tento web.", invalid_data:"Chyba: Vlo\u017Een\u00E1 chybn\u00E1 data jsou ozna\u010Dena \u010Derven\u011B.", more_colors:"V\u00EDce barev" }, contextmenu:{ align:"Zarovn\u00E1n\u00ED", left:"Doleva", center:"Na st\u0159ed", right:"Doprava", full:"Do bloku" }, insertdatetime:{ date_fmt:"%d.%m.%Y", time_fmt:"%H:%M:%S", insertdate_desc:"Vlo\u017Eit datum", inserttime_desc:"Vlo\u017Eit \u010Das", months_long:"Leden,\u00DAnor,B\u0159ezen,Duben,Kv\u011Bten,\u010Cerven,\u010Cervenec,Srpen,Z\u00E1\u0159\u00ED,\u0158\u00EDjen,Listopad,Prosinec", months_short:"Led,\u00DAno,B\u0159e,Dub,Kv\u011B,\u010Cer,\u010Cvc,Srp,Z\u00E1\u0159,\u0158\u00EDj,Lis,Pro", day_long:"Ned\u011Ble,Pond\u011Bl\u00ED,\u00DAter\u00FD,St\u0159eda,\u010Ctvrtek,P\u00E1tek,Sobota,Ned\u011Ble", day_short:"Ne,Po,\u00DAt,St,\u010Ct,P\u00E1,So,Ne" }, print:{ print_desc:"Tisknout" }, preview:{ preview_desc:"N\u00E1hled" }, directionality:{ ltr_desc:"Sm\u011Br zleva doprava", rtl_desc:"Sm\u011Br zprava doleva" }, layer:{ insertlayer_desc:"Vlo\u017Eit novou vrstvu", forward_desc:"P\u0159esunout dop\u0159edu", backward_desc:"P\u0159esunout dozadu", absolute_desc:"P\u0159epnout absolutn\u00ED pozici", content:"Nov\u00E1 vrstva..." }, save:{ save_desc:"Ulo\u017Eit", cancel_desc:"Zru\u0161it v\u0161echny zm\u011Bny" }, nonbreaking:{ nonbreaking_desc:"Vlo\u017Eit ned\u011Blitelnou mezeru" }, iespell:{ iespell_desc:"Kontrolovat pravopis", download:"ieSpell nebyl detekov\u00E1n. Chcete ho nainstalovat?" }, advhr:{ advhr_desc:"Vodorovn\u00FD odd\u011Blova\u010D" }, emotions:{ emotions_desc:"Emotikony" }, searchreplace:{ search_desc:"Hledat", replace_desc:"Naj\u00EDt/nahradit" }, advimage:{ image_desc:"Vlo\u017Eit/upravit obr\u00E1zek" }, advlink:{ link_desc:"Vlo\u017Eit/upravit odkaz" }, xhtmlxtras:{ cite_desc:"Citace", abbr_desc:"Zkratka", acronym_desc:"Akronym", del_desc:"Vymaz\u00E1n\u00ED", ins_desc:"Vlo\u017Een\u00ED", attribs_desc:"Vlo\u017Eit/upravit atributy" }, style:{ desc:"Upravit CSS styl" }, paste:{ paste_text_desc:"Vlo\u017Eit prost\u00FD text", paste_word_desc:"Vlo\u017Eit z Wordu", selectall_desc:"Vybrat v\u0161e" }, paste_dlg:{ text_title:"Pou\u017Eijte CTRL+V pro vlo\u017Een\u00ED textu do okna.", text_linebreaks:"Zachovat \u0159\u00E1dkov\u00E1n\u00ED", word_title:"Pou\u017Eijte CTRL+V pro vlo\u017Een\u00ED textu do okna." }, table:{ desc:"Vlo\u017Eit novou tabulku", row_before_desc:"Vlo\u017Eit \u0159\u00E1dek p\u0159ed", row_after_desc:"Vlo\u017Eit \u0159\u00E1dek za", delete_row_desc:"Odstranit \u0159\u00E1dek", col_before_desc:"Vlo\u017Eit sloupec p\u0159ed", col_after_desc:"Vlo\u017Eit sloupec za", delete_col_desc:"Odstranit sloupec", split_cells_desc:"Rozd\u011Blit bu\u0148ky", merge_cells_desc:"Slou\u010Dit bu\u0148ky", row_desc:"Vlastnosti \u0159\u00E1dku", cell_desc:"Vlastnosti bu\u0148ky", props_desc:"Vlastnosti tabulky", paste_row_before_desc:"Vlo\u017Eit \u0159\u00E1dek p\u0159ed", paste_row_after_desc:"Vlo\u017Eit \u0159\u00E1dek za", cut_row_desc:"Vyjmout \u0159\u00E1dek", copy_row_desc:"Kop\u00EDrovat \u0159\u00E1dek", del:"Odstranit tabulku", row:"\u0158\u00E1dek", col:"Sloupec", cell:"Bu\u0148ka" }, autosave:{ unload_msg:"Proveden\u00E9 zm\u011Bny mohou b\u00FDt ztraceny, jestli\u017Ee opust\u00EDte tuto str\u00E1nku." }, fullscreen:{ desc:"P\u0159epnout na celostr\u00E1nkov\u00E9 zobrazen\u00ED" }, media:{ desc:"Vlo\u017Eit/upravit m\u00E9dia", edit:"Upravit m\u00E9dia" }, fullpage:{ desc:"Vlastnosti dokumentu" }, template:{ desc:"Vlo\u017Eit p\u0159eddefinovan\u00FD obsah ze \u0161ablony" }, visualchars:{ desc:"Zobrazen\u00ED skryt\u00FDch znak\u016F zap/vyp" }, spellchecker:{ desc:"Zapnout kontrolu textu", menu:"Nastaven\u00ED kontroly pravopisu", ignore_word:"Ignorovat slovo", ignore_words:"Ignorovat v\u0161e", langs:"Jazyky", wait:"\u010Cekejte pros\u00EDm...", sug:"N\u00E1pov\u011Bda", no_sug:"\u017D\u00E1dn\u00E1 n\u00E1pov\u011Bda", no_mpell:"Nebyly nalezeny \u017E\u00E1dn\u00E9 chyby." }, pagebreak:{ desc:"Vlo\u017Eit konec str\u00E1nky" }}});������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/cy.js���������������������������������������������������������0000664�0000000�0000000�00000010352�12266004471�0020254�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({cy:{ common:{ edit_confirm:"Ydych chi eisiau defnyddio'r modd WYSIWYG ar gyfer y textarea yma?", apply:"Gosod", insert:"Mewnosod", update:"Diweddaru", cancel:"Diddymu", close:"Cau", browse:"Pori", class_name:"Dosbarth", not_set:"-- Nid wedi osod --", clipboard_msg:"Nid yw Cop\u00EFo/Torri/Gludo ar gael mewn Mozilla a Firefox.\nYdych chi eisiau mwy o wybodaeth am y mater yma?", clipboard_no_support:"Dim wedi'i gynnal gan eich porwr, defnyddiwch Currently not supported by your browser, use keyboard shortcuts instead.", popup_blocked:"Rydym wedi sylwi fod eich popup-blocker wedi analluogi ffenest sy'n darparu swyddogaeth cymhwysiad. Bydd rhaid i chi analluogi blocio popups ar gyfer y safle yma i ddefnyddio'r offeryn yma.", invalid_data:"Gwall: Gwerthau allilys wedi mewnbynnu, mae'r gwerthau yma wedi eu marcio mewn coch.", more_colors:"Mwy o liwiau" }, contextmenu:{ align:"Aliniad", left:"Chwith", center:"Canol", right:"De", full:"Llawn" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"Mewnosod dyddiad", inserttime_desc:"Mewnosod amser", months_long:"Ionawr,Chwefror,Mawrth,Ebrill,Mai,Mehefin,Goffennaf,Awst,Medi,Hydref,Tachwedd,Rhagfyr", months_short:"Ion,Chw,Maw,Ebr,Mai,Meh,Gor,Aws,Med,Hyd,Tac,Rha", day_long:"Sul,Llun,Mawrth,Mercher,Iau,Gwener,Sadwrn,Sul", day_short:"Sul,Llu,Maw,Mer,Iau,Gwe,Sad,Sul" }, print:{ print_desc:"Argraffu" }, preview:{ preview_desc:"Rhagolygu" }, directionality:{ ltr_desc:"Cyfeiriad chwith i'r dde", rtl_desc:"Cyfeiriad de i'r chwith" }, layer:{ insertlayer_desc:"Mewnosod haen newydd", forward_desc:"Symud ymlaen", backward_desc:"Symud n\u00F4l", absolute_desc:"Toglu lleoli absoliwt", content:"Haen newydd..." }, save:{ save_desc:"Cadw", cancel_desc:"Cadw pob newidiad" }, nonbreaking:{ nonbreaking_desc:"Mewnosod n\u00F4d bwlch do-doriad" }, iespell:{ iespell_desc:"Rhedeg gwirio sillafu", download:"ieSpell dim wedi'i canfod. A ydych eisiau ei gosod rwan?" }, advhr:{ advhr_desc:"Mesurydd llorweddol" }, emotions:{ emotions_desc:"Emosiwn" }, searchreplace:{ search_desc:"Canfod", replace_desc:"Canfod/Amnewid" }, advimage:{ image_desc:"Mewnosod/golygu delwedd" }, advlink:{ link_desc:"Mewnosod/Golygu cyswllt" }, xhtmlxtras:{ cite_desc:"Dyfyniad", abbr_desc:"Talfyriad", acronym_desc:"Acronym", del_desc:"Dilead", ins_desc:"Mewnosodiad", attribs_desc:"Mewnosod/Golygu Priodoleddau" }, style:{ desc:"Golygu Arddull CSS" }, paste:{ paste_text_desc:"Gludo fel Testun Plaen", paste_word_desc:"Gludo o Word", selectall_desc:"Dewis Pobpeth" }, paste_dlg:{ text_title:"Defnyddiwch CTRL+V ar eich bysellfwrdd i ludo'r testun i fewn i'r ffenest.", text_linebreaks:"Cadw toriadau llinell", word_title:"Defnyddiwch CTRL+V ar eich bysellfwrdd i ludo'r testun i fewn i'r ffenest." }, table:{ desc:"Mewnosod tabl newydd", row_before_desc:"Mewnosod rhes cyn", row_after_desc:"Mewnosod rhes ar \u00F4l", delete_row_desc:"Dileu rhes", col_before_desc:"Mewnosod colofn cyn", col_after_desc:"Mewnosod colofn ar \u00F4l", delete_col_desc:"Tynnu colofn", split_cells_desc:"Hollti celloedd tabl cyfuniedig", merge_cells_desc:"Cyfuno celloedd tabl", row_desc:"Priodweddau rhes tabl", cell_desc:"Priodweddau cell tabl", props_desc:"Priodweddau tabl", paste_row_before_desc:"Gludo rhes tabl cyn", paste_row_after_desc:"Gludo rhes tabl ar \u00F4l", cut_row_desc:"Torri rhes tabl", copy_row_desc:"Cop\u00EFo rhes tabl", del:"Dileu tabl", row:"Rhes", col:"Colofn", cell:"Cell" }, autosave:{ unload_msg:"Bydd eich newidiadau yn cael eu colli os byddwch yn llywio i ffwrdd o'r tudalen yma." }, fullscreen:{ desc:"Toglu modd sgrin llawn" }, media:{ desc:"Mewnosod / golygu cyfrwng planedig", edit:"Golygu cyfrwng planedig" }, fullpage:{ desc:"Priodweddau dogfen" }, template:{ desc:"Mewnosod cynnwys templed rhagosodol" }, visualchars:{ desc:"Nodau rheolaeth ymlaen/i ffwrdd." }, spellchecker:{ desc:"Toglu cywiriadau", menu:"Gosodiadau cywiriadau", ignore_word:"Anwybyddu gair", ignore_words:"Anwybyddu pob un", langs:"Ieithoedd", wait:"Aroswch, os gwelwch yn dda...", sug:"Awgrymiadau", no_sug:"Dim awgrymiadau", no_mpell:"Dim camsillafiadau wedi'i canfod." }, pagebreak:{ desc:"Mewnosod toriad tudalen." }}});��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/da.js���������������������������������������������������������0000664�0000000�0000000�00000010615�12266004471�0020227�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({da:{ common:{ edit_confirm:"Vil du bruge den avancerede tekstredigering?", apply:"Anvend", insert:"Inds\u00E6t", update:"Opdater", cancel:"Annuller", close:"Luk", browse:"Gennemse", class_name:"Klasse", not_set:"-- Ikke sat --", clipboard_msg:"Kopier/Klip/inds\u00E6t er ikke muligt i Mozilla eller Firefox.\nVil du have mere information om dette emne?", clipboard_no_support:"P\u00E5 nuv\u00E6rende tidspunkt ikke supporteret af din browser. Anvend i stedet genvejene p\u00E5 tastaturet.", popup_blocked:"Undskyld, men vi har noteret os, at din popup-blocker har forhindret et vindue, der giver programmet funktionalitet, at \u00E5bne op. Hvis du vil have den fulde funktionalitet, m\u00E5 du sl\u00E5 popup-blockeren fra for dette websted.", invalid_data:"Fejl: Forkerte v\u00E6rdier indtastet i felter markeret med r\u00F8d.", more_colors:"Flere farver" }, contextmenu:{ align:"Justering", left:"Venstre", center:"Centreret", right:"H\u00F8jre", full:"Lige marginer" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"Inds\u00E6t dato", inserttime_desc:"Inds\u00E6t klokkeslet", months_long:"Januar,Februar,Marts,April,Maj,Juni,Juli,August,September,Oktober,November,December", months_short:"Jan,Feb,Mar,Apr,Maj,Jun,Jul,Aug,Sep,Okt,Nov,Dec", day_long:"S\u00F8ndag,Mandag,Tirsdag,Onsdag,Torsdag,Fredag,L\u00F8rdag,S\u00F8ndag", day_short:"S\u00F8n,Man,Tir,Ons,Tors,Fre,L\u00F8r,S\u00F8n" }, print:{ print_desc:"Udskriv" }, preview:{ preview_desc:"Vis udskrift" }, directionality:{ ltr_desc:"Retning venstre mod h\u00F8jre", rtl_desc:"Retning h\u00F8jre mod venstre" }, layer:{ insertlayer_desc:"Inds\u00E6t nyt lag", forward_desc:"Flyt fremad", backward_desc:"Flyt bagud", absolute_desc:"Sl\u00E5 absolut positionering til/fra", content:"Nyt lag..." }, save:{ save_desc:"Gem", cancel_desc:"Annuller alle \u00E6ndringer" }, nonbreaking:{ nonbreaking_desc:"Inds\u00E6t et blanktegn" }, iespell:{ iespell_desc:"Udf\u00F8r stavekontrol", download:"ieSpell blev ikke fundet. Vil du installere det nu?" }, advhr:{ advhr_desc:"Horisontal linie" }, emotions:{ emotions_desc:"Hum\u00F8rikoner" }, searchreplace:{ search_desc:"S\u00F8g", replace_desc:"S\u00F8g/erstat" }, advimage:{ image_desc:"Inds\u00E6t/rediger billede" }, advlink:{ link_desc:"Inds\u00E6t/rediger link", delta_width:"40" }, xhtmlxtras:{ cite_desc:"Citat", abbr_desc:"Forkortelse", acronym_desc:"Akronym", del_desc:"Sletning", ins_desc:"Inds\u00E6ttelse", attribs_desc:"Inds\u00E6t/rediger attributter" }, style:{ desc:"Rediger CSS stil" }, paste:{ paste_text_desc:"Inds\u00E6t ikke-formatteret tekst", paste_word_desc:"Inds\u00E6t fra Word", selectall_desc:"V\u00E6lg alle" }, paste_dlg:{ text_title:"Anvend CTRL+V p\u00E5 tastaturet for at inds\u00E6tte teksten.", text_linebreaks:"Bevar linieskift", word_title:"Anvend CTRL+V p\u00E5 tastaturet for at inds\u00E6tte teksten." }, table:{ desc:"Inds\u00E6t tabel", row_before_desc:"Inds\u00E6t r\u00E6kke f\u00F8r", row_after_desc:"Inds\u00E6t r\u00E6kke efter", delete_row_desc:"Slet r\u00E6kke", col_before_desc:"Inds\u00E6t kolonne f\u00F8r", col_after_desc:"Inds\u00E6t kolonne efter", delete_col_desc:"Slet kolonne", split_cells_desc:"Opdel flettede celler", merge_cells_desc:"Flet celler", row_desc:"R\u00E6kkeegenskaber", cell_desc:"Celleegenskaber", props_desc:"Tabelegenskaber", paste_row_before_desc:"Inds\u00E6t r\u00E6kke f\u00F8r", paste_row_after_desc:"Inds\u00E6t r\u00E6kke efter", cut_row_desc:"Klip r\u00E6kke", copy_row_desc:"Kopier r\u00E6kke", del:"Slet tabel", row:"R\u00E6kke", col:"Kolonne", cell:"Celle" }, autosave:{ unload_msg:"Har du foretaget nogle \u00E6ndringer, vil de g\u00E5 tabt, hvis du navigerer v\u00E6k fra denne side." }, fullscreen:{ desc:"Vis/skjul fuldsk\u00E6rmstilstand" }, media:{ desc:"Inds\u00E6t/rediger indlejret mediefil", edit:"Rediger indlejret mediefil" }, fullpage:{ desc:"Dokumentegenskaber" }, template:{ desc:"Inds\u00E6t pr\u00E6defineret skabelonindhold" }, visualchars:{ desc:"Vis/Skjul visuelle kontroltegn." }, spellchecker:{ desc:"Vis/skjul stavekontrol", menu:"Indstillinger for stavekontrol", ignore_word:"Ignorer ord", ignore_words:"Ignorer alle", langs:"Sprog", wait:"Vent venligst...", sug:"Forslag", no_sug:"Ingen forslag", no_mpell:"Ingen stavefejl fundet." }, pagebreak:{ desc:"Inds\u00E6t sideskift." }}});�������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/de.js���������������������������������������������������������0000664�0000000�0000000�00000011221�12266004471�0020225�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({de:{ common:{ edit_confirm:"Wollen Sie diesen Textbereich mit WYSIWYG bearbeiten?", apply:"\u00DCbernehmen", insert:"Einf\u00FCgen", update:"Aktualisieren", cancel:"Abbrechen", close:"Schlie\u00DFen", browse:"Durchsuchen", class_name:"CSS-Klasse", not_set:"- unbestimmt -", clipboard_msg:"Kopieren, Ausschneiden und Einf\u00FCgen sind im Mozilla Firefox nicht m\u00F6glich.\nM\u00F6chten Sie mehr \u00FCber dieses Problem erfahren?", clipboard_no_support:"Wird derzeit in Ihrem Browser nicht unterst\u00FCtzt. Bitte benutzen Sie stattdessen die Tastenk\u00FCrzel.", popup_blocked:"Leider hat Ihr Popup-Blocker ein Fenster unterbunden, das f\u00FCr den Betrieb dieses Programms n\u00F6tig ist. Bitte deaktivieren Sie den Popup-Blocker f\u00FCr diese Seite.", invalid_data:"Fehler: Sie haben ung\u00FCltige Werte eingegeben (rot markiert).", more_colors:"Weitere Farben" }, contextmenu:{ align:"Ausrichtung", left:"Linksb\u00FCndig", center:"Zentriert", right:"Rechtsb\u00FCndig", full:"Blocksatz" }, insertdatetime:{ date_fmt:"%d.%m.%Y", time_fmt:"%H:%M:%S", insertdate_desc:"Datum einf\u00FCgen", inserttime_desc:"Zeit einf\u00FCgen", months_long:"Januar,Februar,M\u00E4rz,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember", months_short:"Jan,Feb,M\u00E4rz,Apr,Mai,Juni,Juli,Aug,Sept,Okt,Nov,Dez", day_long:"Sonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag,Sonntag", day_short:"So,Mo,Di,Mi,Do,Fr,Sa,So" }, print:{ print_desc:"Drucken" }, preview:{ preview_desc:"Vorschau" }, directionality:{ ltr_desc:"Schrift von links nach rechts", rtl_desc:"Schrift von rechts nach links" }, layer:{ insertlayer_desc:"Neue Ebene einf\u00FCgen", forward_desc:"Vor verschieben", backward_desc:"Zur\u00FCck verschieben", absolute_desc:"Absolute Positionierung", content:"Neue Ebene..." }, save:{ save_desc:"Speichern", cancel_desc:"Alle \u00C4nderungen verwerfen" }, nonbreaking:{ nonbreaking_desc:"Gesch\u00FCtztes Leerzeichen einf\u00FCgen" }, iespell:{ iespell_desc:"Rechtschreibpr\u00FCfung", download:"ieSpell konnte nicht gefunden werden. Wollen Sie es installieren?" }, advhr:{ advhr_desc:"Trennlinie" }, emotions:{ emotions_desc:"Smilies" }, searchreplace:{ search_desc:"Suchen", replace_desc:"Suchen/Ersetzen" }, advimage:{ image_desc:"Bild einf\u00FCgen/ersetzen" }, advlink:{ link_desc:"Link einf\u00FCgen/bearbeiten" }, xhtmlxtras:{ cite_desc:"Quellenangabe", abbr_desc:"Abk\u00FCrzung", acronym_desc:"Akronym", del_desc:"Entfernter Text", ins_desc:"Eingef\u00FCgter Text", attribs_desc:"Attribute einf\u00FCgen/bearbeiten" }, style:{ desc:"CSS-Styles bearbeiten" }, paste:{ paste_text_desc:"Als normalen Text einf\u00FCgen", paste_word_desc:"Mit Formatierungen (aus Word) einf\u00FCgen", selectall_desc:"Alles ausw\u00E4hlen" }, paste_dlg:{ text_title:"Dr\u00FCcken Sie auf Ihrer Tastatur Strg+V, um den Text einzuf\u00FCgen.", text_linebreaks:"Zeilenumbr\u00FCche beibehalten", word_title:"Dr\u00FCcken Sie auf Ihrer Tastatur Strg+V, um den Text einzuf\u00FCgen." }, table:{ desc:"Tabelle erstellen/bearbeiten", row_before_desc:"Zeile oberhalb einf\u00FCgen", row_after_desc:"Zeile unterhalb einf\u00FCgen", delete_row_desc:"Zeile l\u00F6schen", col_before_desc:"Spalte links einf\u00FCgen", col_after_desc:"Spalte rechts einf\u00FCgen", delete_col_desc:"Spalte l\u00F6schen", split_cells_desc:"Verbundene Zellen trennen", merge_cells_desc:"Zellen verbinden", row_desc:"Eigenschaften der Zeile", cell_desc:"Eigenschaften der Zelle", props_desc:"Eigenschaften der Tabelle", paste_row_before_desc:"Zeile oberhalb aus der Zwischenablage einf\u00FCgen", paste_row_after_desc:"Zeile unterhalb aus der Zwischenablage einf\u00FCgen", cut_row_desc:"Zeile ausschneiden", copy_row_desc:"Zeile kopieren", del:"Tabelle l\u00F6schen", row:"Zeile", col:"Spalte", cell:"Zelle", cellprops_delta_width:"150" }, autosave:{ unload_msg:"Ihre \u00C4nderungen werden verloren gehen, wenn Sie die Seite verlassen." }, fullscreen:{ desc:"Vollbildschirm" }, media:{ desc:"Multimedia einbetten/bearbeiten", edit:"Multimediaeinbettung bearbeiten" }, fullpage:{ desc:"Dokument-Eigenschaften" }, template:{ desc:"Vorgefertigter Vorlageninhalt einf\u00FCgen" }, visualchars:{ desc:"Sichtbarkeit der Steuerzeichen an/aus" }, spellchecker:{ desc:"Rechtschreibpr\u00FCfung an/aus", menu:"Einstellungen der Rechtschreibpr\u00FCfung", ignore_word:"Wort ignorieren", ignore_words:"Alle ignorieren", langs:"Sprachen", wait:"Bitte warten...", sug:"Vorschl\u00E4ge", no_sug:"Keine Vorschl\u00E4ge", no_mpell:"Keine Rechtschreibfehler gefunden." }, pagebreak:{ desc:"Seitenumbruch einf\u00FCgen" }}});�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/dv.js���������������������������������������������������������0000664�0000000�0000000�00000012766�12266004471�0020265�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({dv:{ common:{ edit_confirm:"\u0789\u07A8\u0793\u07AC\u0786\u07B0\u0793\u07B0\u0790\u07B0\u0784\u07AE\u0786\u07B0\u0790\u07B0\u078E\u07A6\u0787\u07A8 \u0787\u07AC\u0791\u07A8\u0793\u07A7\u0783 \u0784\u07AD\u0782\u07AA\u0782\u07B0\u0786\u07AA\u0783\u07A6\u0782\u07B0 \u0784\u07AD\u0782\u07AA\u0782\u07B0\u078A\u07AA\u0785\u07AA\u078C\u07AF\u061F", apply:"\u0790\u07AD\u0788\u07B0", insert:"\u0787\u07A8\u078C\u07AA\u0783\u07AA\u0786\u07AA\u0783\u07A6\u0787\u07B0\u0788\u07A7", update:"\u0784\u07A6\u078B\u07A6\u078D\u07AA\u0786\u07AA\u0783\u07A6\u0787\u07B0\u0788\u07A7", cancel:"\u0786\u07AC\u0782\u07B0\u0790\u07A6\u078D\u07B0", close:"\u0782\u07A8\u0789\u07AA\u0782\u07A9", browse:"\u0784\u07A6\u0787\u07B0\u078D\u07A6\u0788\u07A7", class_name:"\u0786\u07B0\u078D\u07A7\u0790\u07B0", not_set:"-- \u0780\u07A6\u0789\u07A6\u0787\u07AC\u0787\u07B0 \u0782\u07AA\u0796\u07AC\u0780\u07AC --", clipboard_msg:"\u0789\u07AE\u0792\u07A8\u0787\u07B0\u078D\u07A7 \u0787\u07A6\u078B\u07A8 \u078A\u07A6\u0794\u07A7\u0783\u078A\u07AE\u0786\u07B0\u0790\u07B0\u078E\u07A6\u0787\u07A8 \u0786\u07AE\u0795\u07A9/\u0786\u07A6\u0793\u07B0/\u0795\u07AD\u0790\u07B0\u0793\u07B0 \u0782\u07AA\u0786\u07AA\u0783\u07AC\u0788\u07AC.\n \u0789\u07A8\u0789\u07A6\u0787\u07B0\u0790\u07A6\u078D\u07A6 \u0787\u07A8\u078C\u07AA\u0783\u07A6\u0781\u07B0 \u0787\u07AE\u0785\u07AA\u0782\u07B0\u078A\u07A8\u078D\u07AA\u0788\u07AA\u0789\u07A6\u0781\u07B0 \u0784\u07AD\u0782\u07AA\u0782\u07B0\u078A\u07AA\u0785\u07AA\u0788\u07AD\u078C\u07A6\u061F", clipboard_no_support:"\u0789\u07A8\u0788\u07A6\u078E\u07AA\u078C\u07AA \u078C\u07A8\u0794\u07A6\u0784\u07AD\u078A\u07AA\u0785\u07A7\u078E\u07AC \u0784\u07B0\u0783\u07A6\u0787\u07AA\u0792\u07A6\u0783\u07AA \u0790\u07A6\u0795\u07AF\u0793\u07B0 \u0782\u07AA\u0786\u07AA\u0783\u07A7\u078C\u07A9\u0788\u07AC \u0786\u07A9\u0784\u07AF\u0791\u07B0\u078E\u07AC \u0786\u07A9\u078C\u07A6\u0787\u07B0 \u0784\u07AD\u0782\u07AA\u0782\u07B0\u0786\u07AA\u0783\u07A6\u0787\u07B0\u0788\u07A7.", popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.", invalid_data:"Error: Invalid values entered, these are marked in red.", more_colors:"More colors" }, contextmenu:{ align:"Alignment", left:"Left", center:"Center", right:"Right", full:"Full" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"Insert date", inserttime_desc:"Insert time", months_long:"January,February,March,April,May,June,July,August,September,October,November,December", months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun" }, print:{ print_desc:"Print" }, preview:{ preview_desc:"Preview" }, directionality:{ ltr_desc:"Direction left to right", rtl_desc:"Direction right to left" }, layer:{ insertlayer_desc:"Insert new layer", forward_desc:"Move forward", backward_desc:"Move backward", absolute_desc:"Toggle absolute positioning", content:"New layer..." }, save:{ save_desc:"Save", cancel_desc:"Cancel all changes" }, nonbreaking:{ nonbreaking_desc:"Insert non-breaking space character" }, iespell:{ iespell_desc:"Run spell checking", download:"ieSpell not detected. Do you want to install it now?" }, advhr:{ advhr_desc:"Horizontal rule" }, emotions:{ emotions_desc:"Emotions" }, searchreplace:{ search_desc:"Find", replace_desc:"Find/Replace" }, advimage:{ image_desc:"Insert/edit image" }, advlink:{ link_desc:"Insert/edit link" }, xhtmlxtras:{ cite_desc:"Citation", abbr_desc:"Abbreviation", acronym_desc:"Acronym", del_desc:"Deletion", ins_desc:"Insertion", attribs_desc:"Insert/Edit Attributes" }, style:{ desc:"Edit CSS Style" }, paste:{ paste_text_desc:"Paste as Plain Text", paste_word_desc:"Paste from Word", selectall_desc:"Select All" }, paste_dlg:{ text_title:"Use CTRL+V on your keyboard to paste the text into the window.", text_linebreaks:"Keep linebreaks", word_title:"Use CTRL+V on your keyboard to paste the text into the window." }, table:{ desc:"Inserts a new table", row_before_desc:"Insert row before", row_after_desc:"Insert row after", delete_row_desc:"Delete row", col_before_desc:"Insert column before", col_after_desc:"Insert column after", delete_col_desc:"Remove column", split_cells_desc:"Split merged table cells", merge_cells_desc:"Merge table cells", row_desc:"Table row properties", cell_desc:"Table cell properties", props_desc:"Table properties", paste_row_before_desc:"Paste table row before", paste_row_after_desc:"Paste table row after", cut_row_desc:"Cut table row", copy_row_desc:"Copy table row", del:"Delete table", row:"Row", col:"Column", cell:"Cell" }, autosave:{ unload_msg:"The changes you made will be lost if you navigate away from this page." }, fullscreen:{ desc:"Toggle fullscreen mode" }, media:{ desc:"Insert / edit embedded media", edit:"Edit embedded media" }, fullpage:{ desc:"Document properties" }, template:{ desc:"Insert predefined template content" }, visualchars:{ desc:"Visual control characters on/off." }, spellchecker:{ desc:"Toggle spellchecker", menu:"Spellchecker settings", ignore_word:"Ignore word", ignore_words:"Ignore all", langs:"Languages", wait:"Please wait...", sug:"Suggestions", no_sug:"No suggestions", no_mpell:"No misspellings found." }, pagebreak:{ desc:"Insert page break." }}});����������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/el.js���������������������������������������������������������0000664�0000000�0000000�00000034774�12266004471�0020257�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({el:{ common:{ edit_confirm:"\u0398\u03AD\u03BB\u03B5\u03C4\u03B5 \u03BD\u03B1 \u03C7\u03C1\u03B7\u03C3\u03B9\u03BC\u03BF\u03C0\u03BF\u03B9\u03AE\u03C3\u03B5\u03C4\u03B5 \u03C4\u03B7\u03BD \u03BB\u03B5\u03B9\u03C4\u03BF\u03C5\u03C1\u03B3\u03AF\u03B1 WYSIWYG ;", apply:"\u0395\u03C6\u03B1\u03C1\u03BC\u03BF\u03B3\u03AE", insert:"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE", update:"\u0395\u03BD\u03B7\u03BC\u03AD\u03C1\u03C9\u03C3\u03B7", cancel:"\u0386\u03BA\u03C5\u03C1\u03BF", close:"\u039A\u03BB\u03B5\u03AF\u03C3\u03B9\u03BC\u03BF", browse:"\u0395\u03CD\u03C1\u03B5\u03C3\u03B7", class_name:"\u039A\u03BB\u03AC\u03C3\u03B7", not_set:"-- \u039C\u03B7 \u03BF\u03C1\u03B9\u03C3\u03BC\u03AD\u03BD\u03BF --", clipboard_msg:"\u039F\u03B9 \u03BB\u03B5\u03B9\u03C4\u03BF\u03C5\u03C1\u03B3\u03AF\u03B5\u03C2 \u0391\u03BD\u03C4\u03B9\u03B3\u03C1\u03B1\u03C6\u03AE/\u0391\u03C0\u03BF\u03BA\u03BF\u03C0\u03AE/\u0395\u03C0\u03B9\u03BA\u03CC\u03BB\u03BB\u03B7\u03C3\u03B7 \u03B4\u03B5\u03BD \u03B5\u03AF\u03BD\u03B1\u03B9 \u03B4\u03B9\u03B1\u03B8\u03AD\u03C3\u03B9\u03BC\u03B5\u03C2 \u03C3\u03B5 Mozilla \u03BA\u03B1\u03B9 Firefox.\n\u0398\u03AD\u03BB\u03B5\u03C4\u03B5 \u03C0\u03B5\u03C1\u03B9\u03C3\u03C3\u03CC\u03C4\u03B5\u03C1\u03B5\u03C2 \u03C0\u03BB\u03B7\u03C1\u03BF\u03C6\u03BF\u03C1\u03AF\u03B5\u03C2 ;", clipboard_no_support:"\u0394\u03B5\u03BD \u03C5\u03C0\u03BF\u03C3\u03C4\u03B7\u03C1\u03AF\u03B6\u03B5\u03C4\u03B1\u03B9 \u03B1\u03C0\u03CC \u03C4\u03BF\u03BD \u03C6\u03C5\u03BB\u03BB\u03BF\u03BC\u03B5\u03C4\u03C1\u03B7\u03C4\u03AE \u03C3\u03B1\u03C2, \u03C7\u03C1\u03B7\u03C3\u03B9\u03BC\u03BF\u03C0\u03BF\u03B9\u03AE\u03C3\u03C4\u03B5 \u03C4\u03B9\u03C2 \u03C3\u03C5\u03BD\u03C4\u03BF\u03BC\u03B5\u03CD\u03C3\u03B5\u03B9\u03C2 \u03C0\u03BB\u03B7\u03BA\u03C4\u03C1\u03BF\u03BB\u03BF\u03B3\u03AF\u03BF\u03C5.", popup_blocked:"\u0388\u03BD\u03B1 popup-blocker \u03C0\u03C1\u03CC\u03B3\u03C1\u03B1\u03BC\u03BC\u03B1 \u03AD\u03C7\u03B5\u03B9 \u03B1\u03C0\u03B5\u03BD\u03B5\u03C1\u03B3\u03BF\u03C0\u03BF\u03B9\u03AE\u03C3\u03B5\u03B9 \u03AD\u03BD\u03B1 \u03C0\u03B1\u03C1\u03AC\u03B8\u03C5\u03C1\u03BF \u03B1\u03C0\u03B1\u03C1\u03B1\u03AF\u03C4\u03B7\u03C4\u03BF \u03B3\u03B9\u03B1 \u03C4\u03B7\u03BD \u03B5\u03C6\u03B1\u03C1\u03BC\u03BF\u03B3\u03AE. \u03A0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03BF \u03B1\u03C0\u03B5\u03BD\u03B5\u03C1\u03B3\u03BF\u03C0\u03BF\u03B9\u03AE\u03C3\u03B5\u03C4\u03B5 \u03B3\u03B9\u03B1 \u03C4\u03B7\u03BD \u03B9\u03C3\u03C4\u03BF\u03C3\u03B5\u03BB\u03AF\u03B4\u03B1 \u03B1\u03C5\u03C4\u03AE \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03C7\u03C1\u03B7\u03C3\u03B9\u03BC\u03BF\u03C0\u03BF\u03B9\u03AE\u03C3\u03B5\u03C4\u03B5 \u03C0\u03BB\u03AE\u03C1\u03C9\u03C2 \u03C4\u03B7\u03BD \u03B5\u03C6\u03B1\u03C1\u03BC\u03BF\u03B3\u03AE.", invalid_data:"Error: Invalid values entered, these are marked in red.", more_colors:"\u03A0\u03B5\u03C1\u03B9\u03C3\u03C3\u03CC\u03C4\u03B5\u03C1\u03B1 \u03C7\u03C1\u03CE\u03BC\u03B1\u03C4\u03B1" }, contextmenu:{ align:"\u03A3\u03C4\u03BF\u03AF\u03C7\u03B9\u03C3\u03B7", left:"\u0391\u03C1\u03B9\u03C3\u03C4\u03B5\u03C1\u03AC", center:"\u039A\u03AD\u03BD\u03C4\u03C1\u03BF", right:"\u0394\u03B5\u03BE\u03B9\u03AC", full:"\u03A0\u03BB\u03AE\u03C1\u03B7\u03C2" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE \u03B7\u03BC\u03AD\u03C1\u03B1\u03C2", inserttime_desc:"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE \u03CE\u03C1\u03B1\u03C2", months_long:"\u0399\u03B1\u03BD\u03BF\u03C5\u03AC\u03C1\u03B9\u03BF\u03C2,\u03A6\u03B5\u03B2\u03C1\u03BF\u03C5\u03AC\u03C1\u03B9\u03BF\u03C2,\u039C\u03AC\u03C1\u03C4\u03B9\u03BF\u03C2,\u0391\u03C0\u03C1\u03AF\u03BB\u03B9\u03BF\u03C2,\u039C\u03AC\u03B9\u03BF\u03C2,\u0399\u03BF\u03CD\u03BD\u03B9\u03BF\u03C2,\u0399\u03BF\u03CD\u03BB\u03B9\u03BF\u03C2,\u0391\u03CD\u03B3\u03BF\u03C5\u03C3\u03C4\u03BF\u03C2,\u03A3\u03B5\u03C0\u03C4\u03AD\u03BC\u03B2\u03C1\u03B9\u03BF\u03C2,\u039F\u03BA\u03C4\u03CE\u03B2\u03C1\u03B9\u03BF\u03C2,\u039D\u03BF\u03AD\u03BC\u03B2\u03C1\u03B9\u03BF\u03C2,\u0394\u03B5\u03BA\u03AD\u03BC\u03B2\u03C1\u03B9\u03BF\u03C2", months_short:"\u0399\u03B1\u03BD,\u03A6\u03B5\u03B2,\u039C\u03AC\u03C1,\u0391\u03C0\u03C1,\u039C\u03AC\u03B9,\u0399\u03BF\u03CD\u03BD,\u0399\u03BF\u03CD\u03BB,\u0391\u03CD\u03B3,\u03A3\u03B5\u03C0,\u039F\u03BA\u03C4,\u039D\u03BF\u03AD,\u0394\u03B5\u03BA", day_long:"\u039A\u03C5\u03C1\u03B9\u03B1\u03BA\u03AE,\u0394\u03B5\u03C5\u03C4\u03AD\u03C1\u03B1,\u03A4\u03C1\u03AF\u03C4\u03B7,\u03A4\u03B5\u03C4\u03AC\u03C1\u03C4\u03B7,\u03A0\u03AD\u03BC\u03C0\u03C4\u03B7,\u03A0\u03B1\u03C1\u03B1\u03C3\u03BA\u03B5\u03C5\u03AE,\u03A3\u03AC\u03B2\u03B2\u03B1\u03C4\u03BF", day_short:"\u039A\u03C5,\u0394\u03B5,\u03A4\u03C1,\u03A4\u03B5\u03C4,\u03A0\u03AD\u03BC,\u03A0\u03B1\u03C1,\u03A3\u03B1\u03B2" }, print:{ print_desc:"\u0395\u03BA\u03C4\u03CD\u03C0\u03C9\u03C3\u03B7" }, preview:{ preview_desc:"\u03A0\u03C1\u03BF\u03B5\u03C0\u03B9\u03C3\u03BA\u03CC\u03C0\u03B7\u03C3\u03B7" }, directionality:{ ltr_desc:"\u039A\u03B1\u03C4\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 \u03B1\u03C1\u03B9\u03C3\u03C4\u03B5\u03C1\u03AC \u03C0\u03C1\u03BF\u03C2 \u03B4\u03B5\u03BE\u03B9\u03AC", rtl_desc:"\u039A\u03B1\u03C4\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 \u03B4\u03B5\u03BE\u03B9\u03AC \u03C0\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03C3\u03C4\u03B5\u03C1\u03AC" }, layer:{ insertlayer_desc:"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE \u03BD\u03AD\u03BF\u03C5 layer", forward_desc:"\u039C\u03B5\u03C4\u03B1\u03BA\u03AF\u03BD\u03B7\u03C3\u03B7 \u03C3\u03C4\u03BF \u03C0\u03C1\u03BF\u03C3\u03BA\u03AE\u03BD\u03B9\u03BF", backward_desc:"\u039C\u03B5\u03C4\u03B1\u03BA\u03AF\u03BD\u03B7\u03C3\u03B7 \u03C3\u03C4\u03BF \u03C0\u03B1\u03C1\u03B1\u03C3\u03BA\u03AE\u03BD\u03B9\u03BF", absolute_desc:"\u0391\u03C0\u03CC\u03BB\u03C5\u03C4\u03B7/\u03A3\u03C7\u03B5\u03C4\u03B9\u03BA\u03AE \u03C4\u03BF\u03C0\u03BF\u03B8\u03AD\u03C4\u03B7\u03C3\u03B7", content:"\u039D\u03AD\u03BF layer..." }, save:{ save_desc:"\u0391\u03C0\u03BF\u03B8\u03AE\u03BA\u03B5\u03C5\u03C3\u03B7", cancel_desc:"\u0391\u03BA\u03CD\u03C1\u03C9\u03C3\u03B7 \u03CC\u03BB\u03C9\u03BD \u03C4\u03C9\u03BD \u03B1\u03BB\u03BB\u03B1\u03B3\u03CE\u03BD" }, nonbreaking:{ nonbreaking_desc:"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE non-breaking \u03BA\u03B5\u03BD\u03BF\u03CD \u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B1" }, iespell:{ iespell_desc:"\u0395\u03BA\u03C4\u03AD\u03BB\u03B5\u03C3\u03B7 \u03B5\u03BB\u03AD\u03B3\u03C7\u03BF\u03C5 \u03BF\u03C1\u03B8\u03BF\u03B3\u03C1\u03B1\u03C6\u03AF\u03B1\u03C2", download:"\u03A4\u03BF ieSpell \u03B4\u03B5\u03BD \u03B2\u03C1\u03AD\u03B8\u03B7\u03BA\u03B5. \u039D\u03B1 \u03BA\u03B1\u03C4\u03AD\u03B2\u03B5\u03B9 \u03C4\u03CE\u03C1\u03B1 ;" }, advhr:{ advhr_desc:"\u039F\u03C1\u03B9\u03B6\u03CC\u03BD\u03C4\u03B9\u03B1 \u03B3\u03C1\u03B1\u03BC\u03BC\u03AE" }, emotions:{ emotions_desc:"\u03A3\u03C5\u03BD\u03B1\u03B9\u03C3\u03B8\u03AE\u03BC\u03B1\u03C4\u03B1" }, searchreplace:{ search_desc:"\u0395\u03CD\u03C1\u03B5\u03C3\u03B7", replace_desc:"\u0395\u03CD\u03C1\u03B5\u03C3\u03B7/\u0391\u03BD\u03C4\u03B9\u03BA\u03B1\u03C4\u03AC\u03C3\u03C4\u03B1\u03C3\u03B7" }, advimage:{ image_desc:"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE/\u03B5\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1 \u03B5\u03B9\u03BA\u03CC\u03BD\u03B1\u03C2" }, advlink:{ link_desc:"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE/\u03B5\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1 \u03C3\u03C5\u03BD\u03B4\u03AD\u03C3\u03BC\u03BF\u03C5", delta_width:"50" }, xhtmlxtras:{ cite_desc:"Citation", abbr_desc:"\u03A3\u03C5\u03BD\u03C4\u03BF\u03BC\u03BF\u03B3\u03C1\u03B1\u03C6\u03AF\u03B1", acronym_desc:"\u0391\u03BA\u03C1\u03BF\u03BD\u03CD\u03BC\u03B9\u03BF", del_desc:"\u0394\u03B9\u03B1\u03B3\u03C1\u03B1\u03C6\u03AE", ins_desc:"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE", attribs_desc:"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE/\u03B5\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1 \u03B9\u03B4\u03B9\u03BF\u03C4\u03AE\u03C4\u03C9\u03BD" }, style:{ desc:"\u0395\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1 \u03A3\u03C4\u03C5\u03BB CSS" }, paste:{ paste_text_desc:"\u0395\u03C0\u03B9\u03BA\u03CC\u03BB\u03BB\u03B7\u03C3\u03B7 \u03C9\u03C2 \u03B1\u03C0\u03BB\u03CC \u03BA\u03B5\u03AF\u03BC\u03B5\u03BD\u03BF", paste_word_desc:"\u0395\u03C0\u03B9\u03BA\u03CC\u03BB\u03BB\u03B7\u03C3\u03B7 \u03B1\u03C0\u03CC \u03C4\u03BF Word", selectall_desc:"\u0395\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE \u03CC\u03BB\u03C9\u03BD" }, paste_dlg:{ text_title:"\u03A7\u03C1\u03B7\u03C3\u03B9\u03BC\u03BF\u03C0\u03BF\u03B9\u03AE\u03C3\u03C4\u03B5 CTRL+V \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03BA\u03AC\u03BD\u03B5\u03C4\u03B5 \u03B5\u03C0\u03B9\u03BA\u03CC\u03BB\u03BB\u03B7\u03C3\u03B7 \u03BA\u03B5\u03B9\u03BC\u03AD\u03BD\u03BF\u03C5 \u03C3\u03C4\u03BF \u03C0\u03B1\u03C1\u03AC\u03B8\u03C5\u03C1\u03BF.", text_linebreaks:"\u039D\u03B1 \u03BA\u03C1\u03B1\u03C4\u03B7\u03B8\u03BF\u03CD\u03BD \u03C4\u03B1 linebreaks", word_title:"\u03A7\u03C1\u03B7\u03C3\u03B9\u03BC\u03BF\u03C0\u03BF\u03B9\u03AE\u03C3\u03C4\u03B5 CTRL+V \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03BA\u03AC\u03BD\u03B5\u03C4\u03B5 \u03B5\u03C0\u03B9\u03BA\u03CC\u03BB\u03BB\u03B7\u03C3\u03B7 \u03BA\u03B5\u03B9\u03BC\u03AD\u03BD\u03BF\u03C5 \u03C3\u03C4\u03BF \u03C0\u03B1\u03C1\u03AC\u03B8\u03C5\u03C1\u03BF." }, table:{ desc:"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE \u03BD\u03AD\u03BF\u03C5 \u03C0\u03AF\u03BD\u03B1\u03BA\u03B1", row_before_desc:"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE \u03B3\u03C1\u03B1\u03BC\u03BC\u03AE\u03C2 \u03C0\u03C1\u03B9\u03BD", row_after_desc:"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE \u03B3\u03C1\u03B1\u03BC\u03BC\u03AE\u03C2 \u03BC\u03B5\u03C4\u03AC", delete_row_desc:"\u0394\u03B9\u03B1\u03B3\u03C1\u03B1\u03C6\u03AE \u03B3\u03C1\u03B1\u03BC\u03BC\u03AE\u03C2", col_before_desc:"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE \u03C3\u03C4\u03AE\u03BB\u03B7\u03C2 \u03C0\u03C1\u03B9\u03BD", col_after_desc:"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE \u03C3\u03C4\u03AE\u03BB\u03B7\u03C2 \u03BC\u03B5\u03C4\u03AC", delete_col_desc:"\u0394\u03B9\u03B1\u03B3\u03C1\u03B1\u03C6\u03AE \u03C3\u03C4\u03AE\u03BB\u03B7\u03C2", split_cells_desc:"\u0394\u03B9\u03B1\u03C7\u03C9\u03C1\u03B9\u03C3\u03BC\u03CC\u03C2 \u03C3\u03C5\u03B3\u03C7\u03C9\u03BD\u03B5\u03C5\u03BC\u03AD\u03BD\u03C9\u03BD \u03BA\u03B5\u03BB\u03B9\u03CE\u03BD \u03C0\u03AF\u03BD\u03B1\u03BA\u03B1", merge_cells_desc:"\u03A3\u03C5\u03B3\u03C7\u03CE\u03BD\u03B5\u03C5\u03C3\u03B7 \u03BA\u03B5\u03BB\u03B9\u03CE\u03BD \u03C0\u03AF\u03BD\u03B1\u03BA\u03B1", row_desc:"\u0399\u03B4\u03B9\u03CC\u03C4\u03B7\u03C4\u03B5\u03C2 \u03B3\u03C1\u03B1\u03BC\u03BC\u03AE\u03C2 \u03C0\u03AF\u03BD\u03B1\u03BA\u03B1", cell_desc:"\u0399\u03B4\u03B9\u03CC\u03C4\u03B7\u03C4\u03B5\u03C2 \u03BA\u03B5\u03BB\u03B9\u03BF\u03CD \u03C0\u03AF\u03BD\u03B1\u03BA\u03B1", props_desc:"\u0399\u03B4\u03B9\u03CC\u03C4\u03B7\u03C4\u03B5\u03C2 \u03C0\u03AF\u03BD\u03B1\u03BA\u03B1", paste_row_before_desc:"\u0395\u03C0\u03B9\u03BA\u03CC\u03BB\u03BB\u03B7\u03C3\u03B7 \u03B3\u03C1\u03B1\u03BC\u03BC\u03AE\u03C2 \u03C0\u03AF\u03BD\u03B1\u03BA\u03B1 \u03C0\u03C1\u03B9\u03BD", paste_row_after_desc:"\u0395\u03C0\u03B9\u03BA\u03CC\u03BB\u03BB\u03B7\u03C3\u03B7 \u03B3\u03C1\u03B1\u03BC\u03BC\u03AE\u03C2 \u03C0\u03AF\u03BD\u03B1\u03BA\u03B1 \u03BC\u03B5\u03C4\u03AC", cut_row_desc:"\u0391\u03C0\u03BF\u03BA\u03BF\u03C0\u03AE \u03B3\u03C1\u03B1\u03BC\u03BC\u03AE\u03C2 \u03C0\u03AF\u03BD\u03B1\u03BA\u03B1", copy_row_desc:"\u0391\u03BD\u03C4\u03B9\u03B3\u03C1\u03B1\u03C6\u03AE \u03B3\u03C1\u03B1\u03BC\u03BC\u03AE\u03C2 \u03C0\u03AF\u03BD\u03B1\u03BA\u03B1", del:"\u0394\u03B9\u03B1\u03B3\u03C1\u03B1\u03C6\u03AE \u03C0\u03AF\u03BD\u03B1\u03BA\u03B1", row:"\u0393\u03C1\u03B1\u03BC\u03BC\u03AE", col:"\u03A3\u03C4\u03AE\u03BB\u03B7", cell:"\u039A\u03B5\u03BB\u03AF", cellprops_delta_width:"60" }, autosave:{ unload_msg:"\u039F\u03B9 \u03B1\u03BB\u03BB\u03B1\u03B3\u03AD\u03C2 \u03C0\u03BF\u03C5 \u03BA\u03AC\u03BD\u03B1\u03C4\u03B5 \u03B8\u03B1 \u03C7\u03B1\u03B8\u03BF\u03CD\u03BD \u03B1\u03BD \u03C6\u03CD\u03B3\u03B5\u03C4\u03B5 \u03C3\u03B5 \u03AC\u03BB\u03BB\u03B7 \u03C3\u03B5\u03BB\u03AF\u03B4\u03B1." }, fullscreen:{ desc:"\u0395\u03BD\u03B1\u03BB\u03BB\u03B1\u03B3\u03AE \u03C0\u03BB\u03AE\u03C1\u03BF\u03C5\u03C2 \u03BF\u03B8\u03CC\u03BD\u03B7\u03C2" }, media:{ desc:"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE/\u03B5\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1 \u03B5\u03BD\u03C3\u03C9\u03BC\u03B1\u03C4\u03C9\u03BC\u03AD\u03BD\u03C9\u03BD media", edit:"\u0395\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1 \u03B5\u03BD\u03C3\u03C9\u03BC\u03B1\u03C4\u03C9\u03BC\u03AD\u03BD\u03C9\u03BD media", delta_width:"50" }, fullpage:{ desc:"\u0399\u03B4\u03B9\u03CC\u03C4\u03B7\u03C4\u03B5\u03C2 \u03B5\u03B3\u03B3\u03C1\u03AC\u03C6\u03BF\u03C5", delta_width:"140" }, template:{ desc:"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE \u03C0\u03B5\u03C1\u03B9\u03B5\u03C7\u03BF\u03BC\u03AD\u03BD\u03BF\u03C5 \u03B3\u03B9\u03B1 \u03C0\u03C1\u03BF\u03BA\u03B1\u03B8\u03BF\u03C1\u03B9\u03C3\u03BC\u03AD\u03BD\u03BF \u03C0\u03C1\u03CC\u03C4\u03C5\u03C0\u03BF" }, visualchars:{ desc:"\u039F\u03C0\u03C4\u03B9\u03BA\u03BF\u03AF \u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2 \u03B5\u03BB\u03AD\u03B3\u03C7\u03BF\u03C5 \u03BD\u03B1\u03B9/\u03CC\u03C7\u03B9." }, spellchecker:{ desc:"\u0395\u03BD\u03B1\u03BB\u03BB\u03B1\u03B3\u03AE \u03BF\u03C1\u03B8\u03BF\u03B3\u03C1\u03B1\u03C6\u03B9\u03BA\u03BF\u03CD \u03B5\u03BB\u03AD\u03B3\u03C7\u03BF\u03C5", menu:"\u03A1\u03C5\u03B8\u03BC\u03AF\u03C3\u03B5\u03B9\u03C2 \u03BF\u03C1\u03B8\u03BF\u03B3\u03C1\u03B1\u03C6\u03B9\u03BA\u03BF\u03CD \u03B5\u03BB\u03AD\u03B3\u03C7\u03BF\u03C5", ignore_word:"\u03A0\u03B1\u03C1\u03AC\u03B2\u03BB\u03B5\u03C8\u03B7 \u03BB\u03AD\u03BE\u03B7\u03C2", ignore_words:"\u03A0\u03B1\u03C1\u03AC\u03B2\u03BB\u03B5\u03C8\u03B7 \u03CC\u03BB\u03C9\u03BD", langs:"\u0393\u03BB\u03CE\u03C3\u03C3\u03B5\u03C2", wait:"\u03A0\u03B1\u03C1\u03B1\u03BA\u03B1\u03BB\u03CE \u03C0\u03B5\u03C1\u03B9\u03BC\u03AD\u03BD\u03B5\u03C4\u03B5...", sug:"\u03A0\u03C1\u03BF\u03C4\u03AC\u03C3\u03B5\u03B9\u03C2", no_sug:"\u03A7\u03C9\u03C1\u03AF\u03C2 \u03C0\u03C1\u03BF\u03C4\u03AC\u03C3\u03B5\u03B9\u03C2", no_mpell:"\u03A3\u03C9\u03C3\u03C4\u03AE \u03BF\u03C1\u03B8\u03BF\u03B3\u03C1\u03C6\u03AF\u03B1." }, pagebreak:{ desc:"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE \u03B1\u03BB\u03BB\u03B1\u03B3\u03AE\u03C2 \u03C3\u03B5\u03BB\u03AF\u03B4\u03B1\u03C2." }}});����glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/en.js���������������������������������������������������������0000664�0000000�0000000�00000014563�12266004471�0020253�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({en:{common:{"more_colors":"More Colors...","invalid_data":"Error: Invalid values entered, these are marked in red.","popup_blocked":"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.","clipboard_no_support":"Currently not supported by your browser, use keyboard shortcuts instead.","clipboard_msg":"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?","not_set":"-- Not Set --","class_name":"Class",browse:"Browse",close:"Close",cancel:"Cancel",update:"Update",insert:"Insert",apply:"Apply","edit_confirm":"Do you want to use the WYSIWYG mode for this textarea?","invalid_data_number":"{#field} must be a number","invalid_data_min":"{#field} must be a number greater than {#min}","invalid_data_size":"{#field} must be a number or percentage",value:"(value)"},contextmenu:{full:"Full",right:"Right",center:"Center",left:"Left",align:"Alignment"},insertdatetime:{"day_short":"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun","day_long":"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday","months_short":"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec","months_long":"January,February,March,April,May,June,July,August,September,October,November,December","inserttime_desc":"Insert Time","insertdate_desc":"Insert Date","time_fmt":"%H:%M:%S","date_fmt":"%Y-%m-%d"},print:{"print_desc":"Print"},preview:{"preview_desc":"Preview"},directionality:{"rtl_desc":"Direction Right to Left","ltr_desc":"Direction Left to Right"},layer:{content:"New layer...","absolute_desc":"Toggle Absolute Positioning","backward_desc":"Move Backward","forward_desc":"Move Forward","insertlayer_desc":"Insert New Layer"},save:{"save_desc":"Save","cancel_desc":"Cancel All Changes"},nonbreaking:{"nonbreaking_desc":"Insert Non-Breaking Space Character"},iespell:{download:"ieSpell not detected. Do you want to install it now?","iespell_desc":"Check Spelling"},advhr:{"delta_height":"","delta_width":"","advhr_desc":"Insert Horizontal Line"},emotions:{"delta_height":"","delta_width":"","emotions_desc":"Emotions"},searchreplace:{"replace_desc":"Find/Replace","delta_width":"","delta_height":"","search_desc":"Find"},advimage:{"delta_width":"","image_desc":"Insert/Edit Image","delta_height":""},advlink:{"delta_height":"","delta_width":"","link_desc":"Insert/Edit Link"},xhtmlxtras:{"attribs_delta_height":"","attribs_delta_width":"","ins_delta_height":"","ins_delta_width":"","del_delta_height":"","del_delta_width":"","acronym_delta_height":"","acronym_delta_width":"","abbr_delta_height":"","abbr_delta_width":"","cite_delta_height":"","cite_delta_width":"","attribs_desc":"Insert/Edit Attributes","ins_desc":"Insertion","del_desc":"Deletion","acronym_desc":"Acronym","abbr_desc":"Abbreviation","cite_desc":"Citation"},style:{"delta_height":"","delta_width":"",desc:"Edit CSS Style"},paste:{"plaintext_mode_stick":"Paste is now in plain text mode. Click again to toggle back to regular paste mode.","plaintext_mode":"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.","selectall_desc":"Select All","paste_word_desc":"Paste from Word","paste_text_desc":"Paste as Plain Text"},"paste_dlg":{"word_title":"Use Ctrl+V on your keyboard to paste the text into the window.","text_linebreaks":"Keep Linebreaks","text_title":"Use Ctrl+V on your keyboard to paste the text into the window."},table:{"merge_cells_delta_height":"","merge_cells_delta_width":"","table_delta_height":"","table_delta_width":"","cellprops_delta_height":"","cellprops_delta_width":"","rowprops_delta_height":"","rowprops_delta_width":"",cell:"Cell",col:"Column",row:"Row",del:"Delete Table","copy_row_desc":"Copy Table Row","cut_row_desc":"Cut Table Row","paste_row_after_desc":"Paste Table Row After","paste_row_before_desc":"Paste Table Row Before","props_desc":"Table Properties","cell_desc":"Table Cell Properties","row_desc":"Table Row Properties","merge_cells_desc":"Merge Table Cells","split_cells_desc":"Split Merged Table Cells","delete_col_desc":"Delete Column","col_after_desc":"Insert Column After","col_before_desc":"Insert Column Before","delete_row_desc":"Delete Row","row_after_desc":"Insert Row After","row_before_desc":"Insert Row Before",desc:"Insert/Edit Table"},autosave:{"warning_message":"If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?","restore_content":"Restore auto-saved content.","unload_msg":"The changes you made will be lost if you navigate away from this page."},fullscreen:{desc:"Toggle Full Screen Mode"},media:{"delta_height":"","delta_width":"",edit:"Edit Embedded Media",desc:"Insert/Edit Embedded Media"},fullpage:{desc:"Document Properties","delta_width":"","delta_height":""},template:{desc:"Insert Predefined Template Content"},visualchars:{desc:"Show/Hide Visual Control Characters"},spellchecker:{desc:"Toggle Spell Checker",menu:"Spell Checker Settings","ignore_word":"Ignore Word","ignore_words":"Ignore All",langs:"Languages",wait:"Please wait...",sug:"Suggestions","no_sug":"No Suggestions","no_mpell":"No misspellings found.","learn_word":"Learn word"},pagebreak:{desc:"Insert Page Break for Printing"},advlist:{types:"Types",def:"Default","lower_alpha":"Lower Alpha","lower_greek":"Lower Greek","lower_roman":"Lower Roman","upper_alpha":"Upper Alpha","upper_roman":"Upper Roman",circle:"Circle",disc:"Disc",square:"Square"},colors:{"333300":"Dark olive","993300":"Burnt orange","000000":"Black","003300":"Dark green","003366":"Dark azure","000080":"Navy Blue","333399":"Indigo","333333":"Very dark gray","800000":"Maroon",FF6600:"Orange","808000":"Olive","008000":"Green","008080":"Teal","0000FF":"Blue","666699":"Grayish blue","808080":"Gray",FF0000:"Red",FF9900:"Amber","99CC00":"Yellow green","339966":"Sea green","33CCCC":"Turquoise","3366FF":"Royal blue","800080":"Purple","999999":"Medium gray",FF00FF:"Magenta",FFCC00:"Gold",FFFF00:"Yellow","00FF00":"Lime","00FFFF":"Aqua","00CCFF":"Sky blue","993366":"Brown",C0C0C0:"Silver",FF99CC:"Pink",FFCC99:"Peach",FFFF99:"Light yellow",CCFFCC:"Pale green",CCFFFF:"Pale cyan","99CCFF":"Light sky blue",CC99FF:"Plum",FFFFFF:"White"},aria:{"rich_text_area":"Rich Text Area"},wordcount:{words:"Words:"},visualblocks:{desc:'Show/hide block elements'}}});���������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/es.js���������������������������������������������������������0000664�0000000�0000000�00000010530�12266004471�0020246�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({es:{ common:{ edit_confirm:" \u00BFDesea utilizar el modo WYSIWYG para esta caja de texto?", apply:"Aplicar", insert:"Insertar", update:"Actualizar", cancel:"Cancelar", close:"Cerrar", browse:"Examinar", class_name:"Clase", not_set:"-- Ninguno --", clipboard_msg:"Copiar/Cortar/Pegar no se encuentra disponible en Mozilla y Firefox.\n \u00BFDesea obtener m\u00E1s informaci\u00F3n acerca de este tema?", clipboard_no_support:"Su navegador no soporta las funciones de cortapapeles, use los accesos por teclado.", popup_blocked:"Lo sentimos, su bloqueo de ventanas emergentes ha deshabilitado una ventana que provee funcionalidades a la aplicaci\u00F3n. Necesita deshabilitar este bloqueo en este sitio para poder utilizar todas las funciones.", invalid_data:"Error: Introdujo un valor no v\u00E1lido, est\u00E1n marcados en rojo.", more_colors:"M\u00E1s colores" }, contextmenu:{ align:"Alineaci\u00F3n", left:"Izquierda", center:"Centrado", right:"Derecha", full:"Justificado" }, insertdatetime:{ date_fmt:"%d-%m-%Y", time_fmt:"%H:%M:%S", insertdate_desc:"Insertar fecha", inserttime_desc:"Insertar hora", months_long:"Enero,Febrero,Marzo,Abril,Mayo,Junio,Julio,Agosto,Septiembre,Octubre,Noviembre,Diciembre", months_short:"Ene,Feb,Mar,Abr,May,Jun,Jul,Ago,Sep,Oct,Nov,Dic", day_long:"Domingo,Lunes,Martes,Mi\u00E9rcoles,Jueves,Viernes,S\u00E1bado,Domingo", day_short:"Dom,Lun,Mar,Mie,Jue,Vie,Sab,Dom" }, print:{ print_desc:"Imprimir" }, preview:{ preview_desc:"Vista previa" }, directionality:{ ltr_desc:"Direcci\u00F3n izquierda a derecha", rtl_desc:"Direcci\u00F3n derecha a izquierda" }, layer:{ insertlayer_desc:"Insertar nueva capa", forward_desc:"Avanzar", backward_desc:"Retroceder", absolute_desc:"Cambiar a posici\u00F3n absoluta", content:"Nueva capa..." }, save:{ save_desc:"Guardar", cancel_desc:"Cancelar todos los cambios" }, nonbreaking:{ nonbreaking_desc:"Insertar caracter de espacio 'non-breaking'" }, iespell:{ iespell_desc:"Corrector ortogr\u00E1fico", download:"No se detect\u00F3 'ieSpell'. \u00BFDesea instalarlo ahora?" }, advhr:{ advhr_desc:"Regla horizontal" }, emotions:{ emotions_desc:"Emoticones" }, searchreplace:{ search_desc:"Buscar", replace_desc:"Buscar/Reemplazar" }, advimage:{ image_desc:"Insertar/editar imagen" }, advlink:{ link_desc:"Insertar/editar hiperv\u00EDnculo" }, xhtmlxtras:{ cite_desc:"Cita", abbr_desc:"Abreviatura", acronym_desc:"Acr\u00F3nimo", del_desc:"Borrado", ins_desc:"Inserci\u00F3n", attribs_desc:"Insertar/Editar atributos" }, style:{ desc:"Editar Estilo CSS" }, paste:{ paste_text_desc:"Pegar como texto plano", paste_word_desc:"Pegar desde Word", selectall_desc:"Elegir todo" }, paste_dlg:{ text_title:"Use CTRL+V en su teclado para pegar el texto en la ventana.", text_linebreaks:"Keep linebreaks", word_title:"Use CTRL+V en su teclado para pegar el texto en la ventana." }, table:{ desc:"Inserta una nueva tabla", row_before_desc:"Insertar fila (antes)", row_after_desc:"Insertar fila (despu\u00E9s)", delete_row_desc:"Suprimir fila", col_before_desc:"Insertar columna (antes)", col_after_desc:"Insertar columna (despu\u00E9s)", delete_col_desc:"Suprimir columna", split_cells_desc:"Dividir celdas", merge_cells_desc:"Vincular celdas", row_desc:"Propiedades de la fila", cell_desc:"Propiedades de la celda", props_desc:"Propiedades de la tabla", paste_row_before_desc:"Pegar filas (antes)", paste_row_after_desc:"Pegar filas (despu\u00E9s)", cut_row_desc:"Cortar fila", copy_row_desc:"Copiar fila", del:"Eliminar tabla", row:"Fila", col:"Columna", cell:"Celda" }, autosave:{ unload_msg:"Los cambios realizados se perder\u00E1n si sale de esta p\u00E1gina." }, fullscreen:{ desc:"Cambiar a modo Pantalla Completa" }, media:{ desc:"Insertar/editar medio embebido", edit:"Editar medio embebido" }, fullpage:{ desc:"Propiedades del documento" }, template:{ desc:"Insertar contenido de plantilla predefinida" }, visualchars:{ desc:"Caracteres de control ON/OFF." }, spellchecker:{ desc:"Cambiar a corrector ortogr\u00E1fico", menu:"Configuraci\u00F3n de corrector ortogr\u00E1fico", ignore_word:"Ignorar", ignore_words:"Ignorar todo", langs:"Idiomas", wait:"Espere...", sug:"Sugerencias", no_sug:"Sin sugerencias", no_mpell:"No se encontraron errores." }, pagebreak:{ desc:"Insertar fin de p\u00E1gina" }}});������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/et.js���������������������������������������������������������0000664�0000000�0000000�00000010645�12266004471�0020256�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({et:{ common:{ edit_confirm:"Kas soovite kasutada WYSIWYG re\u017Eiimi sellel tekstialal?", apply:"Rakenda", insert:"Sisesta", update:"Uuenda", cancel:"T\u00FChista", close:"Sule", browse:"Sirvi", class_name:"Klass", not_set:"-- Seadmata --", clipboard_msg:"Kopeeri/L\u00F5ika/Kleebi ei ole saadaval Mozillas ja Firefoxis.\nKas soovite rohkem infot selle probleemi kohta?", clipboard_no_support:"Hetkel ei ole toetatud Teie lehitseja poolt, kasutage klaviatuuri otseteid selle asemel.", popup_blocked:"Vabandust, aga Teie h\u00FCpikakna t\u00F5kestaja on blokeerinud akna, mis varustab rakenduse funktsionaalsust. Palun lubage h\u00FCpikaknad sellel kodulehel, et t\u00E4ielikult kasutada seda vahendit.", invalid_data:"Viga: Kehtetud v\u00E4\u00E4rtused sisestatud, need on m\u00E4rgitud punasega.", more_colors:"Rohkem v\u00E4rve" }, contextmenu:{ align:"Joondus", left:"Vasak", center:"Kesk", right:"Parem", full:"T\u00E4is" }, insertdatetime:{ date_fmt:"%A-%k-%p", time_fmt:"%T:%M:%S", insertdate_desc:"Sisesta kuup\u00E4ev", inserttime_desc:"Sisesta aeg", months_long:"Jaanuar,Veebruar,M\u00E4rts,Aprill,Mai,Juuni,Juuli,August,September,Oktoober,November,Detsember", months_short:"Jaan,Veeb,M\u00E4rts,Apr,Mai,Juuni,Juuli,Aug,Sept,Okt,Nov,Dets", day_long:"P\u00FChap\u00E4ev,Esmasp\u00E4ev,Teisip\u00E4ev,Kolmap\u00E4ev,Neljap\u00E4ev,Reede,Laup\u00E4ev,P\u00FChap\u00E4ev", day_short:"P,E,T,K,N,R,L,P" }, print:{ print_desc:"Print" }, preview:{ preview_desc:"Eelvaade" }, directionality:{ ltr_desc:"Suund vasakult paremale", rtl_desc:"Suund paremalt vasakule" }, layer:{ insertlayer_desc:"Sisesta uus kiht", forward_desc:"Liiguta edasi", backward_desc:"Liiguta tagasi", absolute_desc:"L\u00FClita \u00FCmber absoluutne positsioneerimine", content:"Uus kiht..." }, save:{ save_desc:"Salvesta", cancel_desc:"T\u00FChista k\u00F5ik muudatused" }, nonbreaking:{ nonbreaking_desc:"Sisesta mittekatkestav t\u00FChik" }, iespell:{ iespell_desc:"\u00D5igekirja kontroll", download:"ie\u00D5igekiri tuvastamata. Kas soovite paigaldada n\u00FC\u00FCd?" }, advhr:{ advhr_desc:"Horisontaalne joonlaud" }, emotions:{ emotions_desc:"Emotsioonid" }, searchreplace:{ search_desc:"Otsi", replace_desc:"Otsi/Asenda" }, advimage:{ image_desc:"Sisesta/redigeeri pilt" }, advlink:{ link_desc:"Sisesta/redigeeri link" }, xhtmlxtras:{ cite_desc:"Tsitaat", abbr_desc:"L\u00FChend", acronym_desc:"Akron\u00FC\u00FCm", del_desc:"Kustutus", ins_desc:"Lisandus", attribs_desc:"Sisesta muuda atribuute" }, style:{ desc:"Redigeeri CSS stiili" }, paste:{ paste_text_desc:"Kleebi tavalise tekstina", paste_word_desc:"Kleebi Wordist", selectall_desc:"Vali k\u00F5ik" }, paste_dlg:{ text_title:"Vajuta CTRL+V oma klaviatuuril teksti aknasse kleepimiseks.", text_linebreaks:"J\u00E4ta reavahetused", word_title:"Vajuta CTRL+V oma klaviatuuril teksti aknasse kleepimiseks." }, table:{ desc:"Sisestab uue tabeli", row_before_desc:"Sisesta rida ette", row_after_desc:"Sisesta rida j\u00E4rgi", delete_row_desc:"Kustuta rida", col_before_desc:"Sisesta veerg ette", col_after_desc:"Sisesta veerg j\u00E4rgi", delete_col_desc:"Kustuta veerg", split_cells_desc:"Eralda \u00FChendatud tabeli lahtrid", merge_cells_desc:"\u00DChenda tabeli lahtrid", row_desc:"Tabeli rea omadused", cell_desc:"Tabeli lahtri omadused", props_desc:"Tabeli omadused", paste_row_before_desc:"Kleebi tabeli rida ette", paste_row_after_desc:"Kleebi tabeli rida j\u00E4rgi", cut_row_desc:"L\u00F5ika tabeli rida", copy_row_desc:"Kopeeri tabeli rida", del:"Kustuta tabel", row:"Rida", col:"Veerg", cell:"Lahter" }, autosave:{ unload_msg:"Tehtud muudatused kaovad, kui lahkute siit lehelt." }, fullscreen:{ desc:"L\u00FClita \u00FCmber t\u00E4isekraani re\u017Eiim" }, media:{ desc:"Sisesta / redigeeri manustatud meedia", edit:"Redigeeri manustatud meedia" }, fullpage:{ desc:"Dokumendi omadused" }, template:{ desc:"Sisesta eeldefineeritud \u0161ablooni sisu" }, visualchars:{ desc:"Visuaalsed kontrollt\u00E4hem\u00E4rgid sisse/v\u00E4lja" }, spellchecker:{ desc:"L\u00FClita \u00FCmber \u00F5igekirja kontroll", menu:"\u00D5igekirja kontrolli seaded", ignore_word:"J\u00E4ta s\u00F5na vahele", ignore_words:"J\u00E4ra k\u00F5ik vahele", langs:"Keeled", wait:"Palun oota...", sug:"Soovitused", no_sug:"Soovitusi pole", no_mpell:"Valesti kirjutamisi ei leitud." }, pagebreak:{ desc:"Sisesta lehevahetus." }}});�������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/fa.js���������������������������������������������������������0000664�0000000�0000000�00000031621�12266004471�0020231�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({fa:{ common:{ edit_confirm:"\u0622\u06CC\u0627 \u0634\u0645\u0627 \u0645\u0627\u06CC\u0644\u06CC\u062F \u062A\u0627 \u0627\u0632 \u062D\u0627\u0644\u062A \u0648\u06CC\u0631\u0627\u06CC\u0634\u06AF\u0631 WYSIWYG \u0628\u0631\u0627\u06CC \u0627\u06CC\u0646 \u0646\u0627\u062D\u06CC\u0647 \u0645\u062A\u0646\u06CC \u0627\u0633\u062A\u0641\u0627\u062F\u0647 \u0646\u0645\u0627\u0626\u06CC\u062F\u061F", apply:"\u0628\u0643\u0627\u0631\u06AF\u06CC\u0631\u06CC", insert:"\u062F\u0631\u062C", update:"\u0628\u0631\u0648\u0632\u0631\u0633\u0627\u0646\u06CC", cancel:"\u0627\u0646\u0635\u0631\u0627\u0641", close:"\u0628\u0633\u062A\u0646", browse:"\u0627\u0646\u062A\u062E\u0627\u0628 \u0627\u0632 \u0633\u0631\u0648\u0631", class_name:"\u0643\u0644\u0627\u0633", not_set:"-- \u062A\u0646\u0638\u06CC\u0645 \u0646\u0634\u062F\u0647 --", clipboard_msg:"\u0643\u067E\u06CC/\u0628\u0631\u0634 (Cut)/\u0686\u0633\u0628\u0627\u0646\u062F\u0646 (Paste) \u062F\u0631 Mozilla \u0648 Firefox \u0642\u0627\u0628\u0644 \u062F\u0633\u062A\u0631\u0633 \u0646\u0645\u06CC \u0628\u0627\u0634\u062F.\n\u0622\u06CC\u0627 \u0634\u0645\u0627 \u0627\u0637\u0644\u0627\u0639\u0627\u062A \u0628\u06CC\u0634\u062A\u0631\u06CC \u062F\u0631\u0628\u0627\u0631\u0647 \u0627\u06CC\u0646 \u0645\u0648\u0636\u0648\u0639 \u0645\u06CC \u062E\u0648\u0627\u0647\u06CC\u062F\u061F", clipboard_no_support:"\u062F\u0631 \u062D\u0627\u0644 \u062D\u0627\u0636\u0631 \u062A\u0648\u0633\u0637 \u0645\u0631\u0648\u0631\u06AF\u0631 \u0634\u0645\u0627 \u067E\u0634\u062A\u06CC\u0628\u0627\u0646\u06CC \u0646\u0645\u06CC \u0634\u0648\u062F \u060C \u0628\u0647 \u062C\u0627\u06CC \u0622\u0646 \u0627\u0632 \u0645\u06CC\u0627\u0646\u0628\u0631\u0647\u0627\u06CC (Shortcut) \u0635\u0641\u062D\u0647 \u0643\u0644\u06CC\u062F \u0627\u0633\u062A\u0641\u0627\u062F\u0647 \u0646\u0645\u0627\u0626\u06CC\u062F.", popup_blocked:"\u0628\u0627 \u0639\u0631\u0636 \u067E\u0648\u0632\u0634 \u060C \u0645\u0627 \u0627\u0637\u0644\u0627\u0639 \u062F\u0627\u062F\u0647 \u0628\u0648\u062F\u06CC\u0645 \u0643\u0647 \u0645\u062F\u0627\u0641\u0639 \u067E\u0646\u062C\u0631\u0647 \u0628\u0627\u0632 \u0634\u0648\u06CC (Popup) \u0634\u0645\u0627 \u060C \u067E\u0646\u062C\u0631\u0647 \u0627\u06CC \u0631\u0627 \u0643\u0647 \u0642\u0627\u0628\u0644\u06CC\u062A \u0628\u0631\u0646\u0627\u0645\u0647 \u0643\u0627\u0631\u0628\u0631\u062F\u06CC \u0631\u0627 \u0627\u0631\u0627\u0626\u0647 \u0645\u06CC \u0643\u0631\u062F \u060C \u063A\u06CC\u0631 \u0641\u0639\u0627\u0644 \u0643\u0631\u062F\u0647 \u0627\u0633\u062A. \u0634\u0645\u0627 \u0646\u06CC\u0627\u0632 \u0628\u0647 \u063A\u06CC\u0631 \u0641\u0639\u0627\u0644 \u0643\u0631\u062F\u0646 \u0645\u062F\u0627\u0641\u0639 \u067E\u0646\u062C\u0631\u0647 \u0628\u0627\u0632 \u0634\u0648 (Popup) \u062F\u0631 \u0627\u06CC\u0646 \u0633\u0627\u06CC\u062A \u0631\u0627 \u062F\u0627\u0631\u06CC\u062F \u062A\u0627 \u0627\u0632 \u0627\u06CC\u0646 \u0627\u0628\u0632\u0627\u0631 \u0628\u0647 \u0635\u0648\u0631\u062A \u0643\u0627\u0645\u0644 \u0627\u0633\u062A\u0641\u0627\u062F\u0647 \u0646\u0645\u0627\u0626\u06CC\u062F.", invalid_data:"\u062E\u0637\u0627: \u0645\u0642\u0627\u062F\u06CC\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u0648\u0627\u0631\u062F \u0634\u062F \u060C \u0622\u0646\u0647\u0627 \u0628\u0647 \u0631\u0646\u06AF \u0642\u0631\u0645\u0632 \u0639\u0644\u0627\u0645\u062A \u062E\u0648\u0631\u062F\u0647 \u0627\u0646\u062F.", more_colors:"\u0631\u0646\u06AF \u0647\u0627\u06CC \u0628\u06CC\u0634\u062A\u0631" }, contextmenu:{ align:"\u062A\u0631\u0627\u0632", left:"\u0686\u067E", center:"\u0648\u0633\u0637", right:"\u0631\u0627\u0633\u062A", full:"\u0643\u0627\u0645\u0644" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"\u062F\u0631\u062C \u062A\u0627\u0631\u06CC\u062E", inserttime_desc:"\u062F\u0631\u062C \u0632\u0645\u0627\u0646", months_long:"\u0698\u0627\u0646\u0648\u06CC\u0647,\u0641\u0648\u0631\u06CC\u0647,\u0645\u0627\u0631\u0633,\u0622\u0648\u0631\u06CC\u0644,\u0645\u0647,\u0698\u0648\u0626\u0646,\u0698\u0648\u0626\u06CC\u0647,\u0627\u0648\u062A,\u0633\u067E\u062A\u0627\u0645\u0628\u0631,\u0627\u0643\u062A\u0628\u0631,\u0646\u0648\u0627\u0645\u0628\u0631,\u062F\u0633\u0627\u0645\u0628\u0631", months_short:"\u0698\u0627\u0646\u0648\u06CC\u0647,\u0641\u0648\u0631\u06CC\u0647,\u0645\u0627\u0631\u0633,\u0622\u0648\u0631\u06CC\u0644,\u0645\u0647,\u0698\u0648\u0626\u0646,\u0698\u0648\u0626\u06CC\u0647,\u0627\u0648\u062A,\u0633\u067E\u062A\u0627\u0645\u0628\u0631,\u0627\u0643\u062A\u0628\u0631,\u0646\u0648\u0627\u0645\u0628\u0631,\u062F\u0633\u0627\u0645\u0628\u0631", day_long:"\u06CC\u0643\u0634\u0646\u0628\u0647,\u062F\u0648\u0634\u0646\u0628\u0647,\u0633\u0647 \u0634\u0646\u0628\u0647,\u0686\u0647\u0627\u0631\u0634\u0646\u0628\u0647,\u067E\u0646\u062C \u0634\u0646\u0628\u0647,\u062C\u0645\u0639\u0647,\u0634\u0646\u0628\u0647,\u06CC\u0643\u0634\u0646\u0628\u0647", day_short:"\u06CC\u0643\u0634\u0646\u0628\u0647,\u062F\u0648\u0634\u0646\u0628\u0647,\u0633\u0647 \u0634\u0646\u0628\u0647,\u0686\u0647\u0627\u0631\u0634\u0646\u0628\u0647,\u067E\u0646\u062C \u0634\u0646\u0628\u0647,\u062C\u0645\u0639\u0647,\u0634\u0646\u0628\u0647,\u06CC\u0643\u0634\u0646\u0628\u0647" }, print:{ print_desc:"\u0686\u0627\u067E" }, preview:{ preview_desc:"\u067E\u06CC\u0634 \u0646\u0645\u0627\u06CC\u0634" }, directionality:{ ltr_desc:"\u062C\u0647\u062A \u0686\u067E \u0628\u0647 \u0631\u0627\u0633\u062A", rtl_desc:"\u062C\u0647\u062A \u0631\u0627\u0633\u062A \u0628\u0647 \u0686\u067E" }, layer:{ insertlayer_desc:"\u062F\u0631\u062C \u0644\u0627\u06CC\u0647 \u062C\u062F\u06CC\u062F", forward_desc:"\u0627\u0646\u062A\u0642\u0627\u0644 \u0628\u0647 \u062C\u0644\u0648", backward_desc:"\u0627\u0646\u062A\u0642\u0627\u0644 \u0628\u0647 \u067E\u0634\u062A", absolute_desc:"\u062A\u0639\u0648\u06CC\u0636 \u0645\u0648\u0642\u0639\u06CC\u062A \u0645\u0637\u0644\u0642", content:"\u0644\u0627\u06CC\u0647 \u062C\u062F\u06CC\u062F..." }, save:{ save_desc:"\u0630\u062E\u06CC\u0631\u0647", cancel_desc:"\u0644\u063A\u0648 \u062A\u0645\u0627\u0645\u06CC \u062A\u063A\u06CC\u06CC\u0631\u0627\u062A" }, nonbreaking:{ nonbreaking_desc:"\u062F\u0631\u062C \u0643\u0627\u0631\u0627\u0643\u062A\u0631 \u0641\u0627\u0635\u0644\u0647 \u0628\u062F\u0648\u0646 \u0642\u0637\u0639 \u0634\u062F\u06AF\u06CC" }, iespell:{ iespell_desc:"\u0627\u062C\u0631\u0627\u06CC \u0628\u0631\u0631\u0633\u06CC \u0627\u0645\u0644\u0627\u0621", download:"ieSpell \u062A\u0634\u062E\u06CC\u0635 \u062F\u0627\u062F\u0647 \u0646\u0634\u062F. \u0622\u06CC\u0627 \u0634\u0645\u0627 \u0645\u0627\u06CC\u0644 \u0628\u0647 \u0646\u0635\u0628 \u0622\u0646 \u0647\u0633\u062A\u06CC\u062F\u061F" }, advhr:{ advhr_desc:"\u062E\u0637 \u0627\u0641\u0642\u06CC" }, emotions:{ emotions_desc:"\u0634\u0643\u0644\u0643" }, searchreplace:{ search_desc:"\u062C\u0633\u062A\u062C\u0648", replace_desc:"\u062C\u0633\u062A\u062C\u0648/\u062A\u0639\u0648\u06CC\u0636" }, advimage:{ image_desc:"\u062F\u0631\u062C/\u0648\u06CC\u0631\u0627\u06CC\u0634 \u062A\u0635\u0648\u06CC\u0631" }, advlink:{ link_desc:"\u062F\u0631\u062C/\u0648\u06CC\u0631\u0627\u06CC\u0634 \u0644\u06CC\u0646\u0643" }, xhtmlxtras:{ cite_desc:"\u0646\u0642\u0644 \u0642\u0648\u0644", abbr_desc:"\u0627\u062E\u062A\u0635\u0627\u0631", acronym_desc:"\u0645\u062E\u0641\u0641", del_desc:"\u062D\u0630\u0641", ins_desc:"\u062F\u0631\u062C", attribs_desc:"\u062F\u0631\u062C/\u0648\u06CC\u0631\u0627\u06CC\u0634 \u0635\u0641\u0627\u062A" }, style:{ desc:"\u0648\u06CC\u0631\u0627\u06CC\u0634 \u0627\u0633\u062A\u06CC\u0644 CSS" }, paste:{ paste_text_desc:"\u0686\u0633\u0628\u0627\u0646\u062F\u0646 (Paste) \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u0645\u062A\u0646 \u0633\u0627\u062F\u0647", paste_word_desc:"\u0686\u0633\u0628\u0627\u0646\u062F\u0646 (Paste) \u0627\u0632 Word", selectall_desc:"\u0627\u0646\u062A\u062E\u0627\u0628 \u0647\u0645\u0647" }, paste_dlg:{ text_title:"\u062C\u0647\u062A \u0686\u0633\u0628\u0627\u0646\u062F\u0646 (Paste) \u0643\u0631\u062F\u0646 \u0645\u062A\u0646 \u062F\u0631 \u067E\u0646\u062C\u0631\u0647 \u0627\u0632 CTRL+V \u0628\u0631 \u0631\u0648\u06CC \u0635\u0641\u062D\u0647 \u0643\u0644\u06CC\u062F \u062E\u0648\u062F \u0627\u0633\u062A\u0641\u0627\u062F\u0647 \u0646\u0645\u0627\u0626\u06CC\u062F.", text_linebreaks:"\u062D\u0641\u0638 \u0642\u0637\u0639 \u062E\u0637\u0648\u0637", word_title:"\u062C\u0647\u062A \u0686\u0633\u0628\u0627\u0646\u062F\u0646 (Paste) \u0643\u0631\u062F\u0646 \u0645\u062A\u0646 \u062F\u0631 \u067E\u0646\u062C\u0631\u0647 \u0627\u0632 CTRL+V \u0628\u0631 \u0631\u0648\u06CC \u0635\u0641\u062D\u0647 \u0643\u0644\u06CC\u062F \u062E\u0648\u062F \u0627\u0633\u062A\u0641\u0627\u062F\u0647 \u0646\u0645\u0627\u0626\u06CC\u062F." }, table:{ desc:"\u06CC\u0643 \u062C\u062F\u0648\u0644 \u062C\u062F\u06CC\u062F \u062F\u0631\u062C \u0645\u06CC \u0643\u0646\u062F", row_before_desc:"\u062F\u0631\u062C \u0633\u0637\u0631 \u062F\u0631 \u0642\u0628\u0644", row_after_desc:"\u062F\u0631\u062C \u0633\u0637\u0631 \u062F\u0631 \u0628\u0639\u062F", delete_row_desc:"\u062D\u0630\u0641 \u0633\u0637\u0631", col_before_desc:"\u062F\u0631\u062C \u0633\u062A\u0648\u0646 \u062F\u0631 \u0642\u0628\u0644", col_after_desc:"\u062F\u0631\u062C \u0633\u062A\u0648\u0646 \u062F\u0631 \u0628\u0639\u062F", delete_col_desc:"\u062D\u0630\u0641 \u0633\u062A\u0648\u0646", split_cells_desc:"\u062A\u0642\u0633\u06CC\u0645 \u0633\u0644\u0648\u0644 \u0647\u0627\u06CC \u062C\u062F\u0648\u0644 \u0627\u062F\u063A\u0627\u0645 \u0634\u062F\u0647", merge_cells_desc:"\u0627\u062F\u063A\u0627\u0645 \u0633\u0644\u0648\u0644 \u0647\u0627\u06CC \u062C\u062F\u0648\u0644", row_desc:"\u0645\u0634\u062E\u0635\u0627\u062A \u0633\u0637\u0631 \u062C\u062F\u0648\u0644", cell_desc:"\u0645\u0634\u062E\u0635\u0627\u062A \u0633\u0644\u0648\u0644 \u062C\u062F\u0648\u0644", props_desc:"\u0645\u0634\u062E\u0635\u0627\u062A \u062C\u062F\u0648\u0644", paste_row_before_desc:"\u0686\u0633\u0628\u0627\u0646\u062F\u0646 (Paste) \u0633\u0637\u0631 \u062C\u062F\u0648\u0644 \u062F\u0631 \u0642\u0628\u0644", paste_row_after_desc:"\u0686\u0633\u0628\u0627\u0646\u062F\u0646 (Paste) \u0633\u0637\u0631 \u062C\u062F\u0648\u0644 \u062F\u0631 \u0628\u0639\u062F", cut_row_desc:"\u0628\u0631\u0634 (Cut) \u0633\u0637\u0631 \u062C\u062F\u0648\u0644", copy_row_desc:"\u0643\u067E\u06CC \u0633\u0637\u0631 \u062C\u062F\u0648\u0644", del:"\u062D\u0630\u0641 \u062C\u062F\u0648\u0644", row:"\u0633\u0637\u0631", col:"\u0633\u062A\u0648\u0646", cell:"\u0633\u0644\u0648\u0644" }, autosave:{ unload_msg:"\u062F\u0631 \u0635\u0648\u0631\u062A\u06CC \u0643\u0647 \u0634\u0645\u0627 \u0627\u0632 \u0627\u06CC\u0646 \u0635\u0641\u062D\u0647 \u0628\u0647 \u062C\u0627\u06CC \u062F\u06CC\u06AF\u0631\u06CC \u0646\u0627\u0648\u0628\u0631\u06CC (Navigate) \u0643\u0646\u06CC\u062F \u060C \u062A\u063A\u06CC\u06CC\u0631\u0627\u062A\u06CC \u0643\u0647 \u0627\u06CC\u062C\u0627\u062F \u0646\u0645\u0648\u062F\u0647 \u0627\u06CC\u062F \u0627\u0632 \u062F\u0633\u062A \u062E\u0648\u0627\u0647\u062F \u0631\u0641\u062A." }, fullscreen:{ desc:"\u062A\u0639\u0648\u06CC\u0636 \u0628\u0647 \u062D\u0627\u0644\u062A \u0635\u0641\u062D\u0647 \u0643\u0627\u0645\u0644" }, media:{ desc:"\u062F\u0631\u062C / \u0648\u06CC\u0631\u0627\u06CC\u0634 \u0631\u0633\u0627\u0646\u0647 \u062C\u0627\u0633\u0627\u0632\u06CC \u0634\u062F\u0647 (Embeded Media)", edit:"\u0648\u06CC\u0631\u0627\u06CC\u0634 \u0631\u0633\u0627\u0646\u0647 \u062C\u0627\u0633\u0627\u0632\u06CC \u0634\u062F\u0647 (Embeded Media)" }, fullpage:{ desc:"\u0645\u0634\u062E\u0635\u0627\u062A \u0633\u0646\u062F" }, template:{ desc:"\u062F\u0631\u062C \u0645\u062D\u062A\u0648\u0627\u06CC \u0642\u0627\u0644\u0628 \u0627\u0632 \u067E\u06CC\u0634 \u062A\u0639\u0631\u06CC\u0641 \u0634\u062F\u0647" }, visualchars:{ desc:"\u0631\u0648\u0634\u0646/\u062E\u0627\u0645\u0648\u0634 \u0643\u0631\u062F\u0646 \u0643\u0627\u0631\u0627\u0643\u062A\u0631 \u0647\u0627\u06CC \u0643\u0646\u062A\u0631\u0644 \u0628\u0635\u0631\u06CC (Visual)." }, spellchecker:{ desc:"\u062A\u0639\u0648\u06CC\u0636 \u0628\u0631\u0631\u0633\u06CC \u0643\u0646\u0646\u062F\u0647 \u0627\u0645\u0644\u0627\u0621", menu:"\u062A\u0646\u0638\u06CC\u0645\u0627\u062A \u0628\u0631\u0631\u0633\u06CC \u0643\u0646\u0646\u062F\u0647 \u0627\u0645\u0644\u0627\u0621", ignore_word:"\u0686\u0634\u0645 \u067E\u0648\u0634\u06CC \u0627\u0632 \u0643\u0644\u0645\u0647", ignore_words:"\u0686\u0634\u0645 \u067E\u0648\u0634\u06CC \u0627\u0632 \u0647\u0645\u0647", langs:"\u0632\u0628\u0627\u0646 \u0647\u0627", wait:"\u0644\u0637\u0641\u0627 \u0645\u0646\u062A\u0638\u0631 \u0628\u0645\u0627\u0646\u06CC\u062F...", sug:"\u067E\u06CC\u0634\u0646\u0647\u0627\u062F\u0627\u062A", no_sug:"\u0628\u062F\u0648\u0646 \u067E\u06CC\u0634\u0646\u0647\u0627\u062F", no_mpell:"\u0647\u06CC\u0686 \u062E\u0637\u0627\u06CC \u0627\u0645\u0644\u0627\u0626\u06CC \u06CC\u0627\u0641\u062A\u0647 \u0646\u0634\u062F." }, pagebreak:{ desc:"\u062F\u0631\u062C \u0642\u0637\u0639 \u0635\u0641\u062D\u0647." }}});���������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/fi.js���������������������������������������������������������0000664�0000000�0000000�00000011466�12266004471�0020246�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({fi:{ common:{ edit_confirm:"Haluatko k\u00E4ytt\u00E4\u00E4 WYSIWYG-tilaa t\u00E4ss\u00E4 tekstikent\u00E4ss\u00E4?", apply:"K\u00E4yt\u00E4", insert:"Lis\u00E4\u00E4", update:"P\u00E4ivit\u00E4", cancel:"Peruuta", close:"Sulje", browse:"Selaa", class_name:"Luokka", not_set:"-- Ei m\u00E4\u00E4ritetty --", clipboard_msg:"Kopioi/Leikkaa/Liit\u00E4 ei ole k\u00E4ytett\u00E4viss\u00E4 Mozilla ja Firefox -selaimilla.\nHaluatko lis\u00E4tietoa t\u00E4st\u00E4 ongelmasta?", clipboard_no_support:"Selaimesi ei ole tuettu, k\u00E4yt\u00E4 sen sijaan n\u00E4pp\u00E4inoikoteit\u00E4.", popup_blocked:"Sinulla on k\u00E4yt\u00F6ss\u00E4si ohjelma, joka est\u00E4\u00E4 ponnahdusikkunoiden n\u00E4yt\u00F6n. Sinun t\u00E4ytyy kytke\u00E4 ponnahdusikkunoiden esto pois p\u00E4\u00E4lt\u00E4 voidaksesi hy\u00F6dynt\u00E4\u00E4 t\u00E4ysin t\u00E4t\u00E4 ty\u00F6kalua.", invalid_data:"Virhe: Sy\u00F6tit virheellisi\u00E4 arvoja, ne n\u00E4kyv\u00E4t punaisina.", more_colors:"Enemm\u00E4n v\u00E4rej\u00E4" }, contextmenu:{ align:"Tasaus", left:"Vasemmalle", center:"Keskelle", right:"Oikealle", full:"Molemmille puolille" }, insertdatetime:{ date_fmt:"%d.%m.%Y", time_fmt:"%H:%M:%S", insertdate_desc:"Lis\u00E4\u00E4 p\u00E4iv\u00E4m\u00E4\u00E4r\u00E4", inserttime_desc:"Lis\u00E4\u00E4 kellonaika", months_long:"Tammikuu,Helmikuu,Maaliskuu,Huhtikuu,Toukokuu,Kes\u00E4kuu,Hein\u00E4kuu,Elokuu,Syyskuu,Lokakuu,Marraskuu,Joulukuu", months_short:"Tammi,Helmi,Maalis,Huhti,Touko,Kes\u00E4,Hein\u00E4,Elo,Syys,Loka,Marras,Joulu", day_long:"sunnuntai,maanantai,tiistai,keskiviikko,torstai,perjantai,lauantai,sunnuntai", day_short:"su,ma,ti,ke,to,pe,la,su" }, print:{ print_desc:"Tulosta" }, preview:{ preview_desc:"Esikatselu" }, directionality:{ ltr_desc:"Suunta vasemmalta oikealle", rtl_desc:"Suunta oikealta vasemmalle" }, layer:{ insertlayer_desc:"Lis\u00E4\u00E4 uusi taso", forward_desc:"Siirr\u00E4 eteenp\u00E4in", backward_desc:"Siirr\u00E4 taaksep\u00E4in", absolute_desc:"Absoluuttinen sijainti", content:"Uusi taso..." }, save:{ save_desc:"Tallenna", cancel_desc:"Peruuta kaikki muutokset" }, nonbreaking:{ nonbreaking_desc:"Lis\u00E4\u00E4 tyhj\u00E4 merkki (nbsp)" }, iespell:{ iespell_desc:"Oikeinkirjoituksen tarkistus", download:"ieSpell-ohjelmaa ei havaittu. Haluatko asentaa sen nyt?" }, advhr:{ advhr_desc:"Vaakatasoviivain" }, emotions:{ emotions_desc:"Hymi\u00F6t" }, searchreplace:{ search_desc:"Etsi", replace_desc:"Etsi ja korvaa" }, advimage:{ image_desc:"Lis\u00E4\u00E4/muokkaa kuvaa" }, advlink:{ link_desc:"Lis\u00E4\u00E4/muokkaa linkki\u00E4" }, xhtmlxtras:{ cite_desc:"Sitaatti", abbr_desc:"Lyhenne", acronym_desc:"Kirjainlyhenne", del_desc:"Poisto", ins_desc:"Lis\u00E4ys", attribs_desc:"Lis\u00E4\u00E4/muokkaa attribuutteja" }, style:{ desc:"Muokkaa CSS-tyylej\u00E4" }, paste:{ paste_text_desc:"Liit\u00E4 pelkk\u00E4n\u00E4 tekstin\u00E4", paste_word_desc:"Liit\u00E4 Wordist\u00E4", selectall_desc:"Valitse kaikki" }, paste_dlg:{ text_title:"Paina CTRL+V liitt\u00E4\u00E4ksesi sis\u00E4ll\u00F6n ikkunaan.", text_linebreaks:"S\u00E4ilyt\u00E4 rivinvaihdot", word_title:"Paina CTRL+V liitt\u00E4\u00E4ksesi sis\u00E4ll\u00F6n ikkunaan." }, table:{ desc:"Lis\u00E4\u00E4 uusi taulukko", row_before_desc:"Lis\u00E4\u00E4 rivi ennen", row_after_desc:"Lis\u00E4\u00E4 rivi j\u00E4lkeen", delete_row_desc:"Poista rivi", col_before_desc:"Lis\u00E4\u00E4 sarake ennen", col_after_desc:"Lis\u00E4\u00E4 sarake j\u00E4lkeen", delete_col_desc:"Poista sarake", split_cells_desc:"Jaa yhdistetyt taulukon solut", merge_cells_desc:"Yhdist\u00E4 taulukon solut", row_desc:"Taulukon rivin asetukset", cell_desc:"Taulukon solun asetukset", props_desc:"Taulukon asetukset", paste_row_before_desc:"Liit\u00E4 taulukon rivi ennen", paste_row_after_desc:"Liit\u00E4 taulukon rivi j\u00E4lkeen", cut_row_desc:"Leikkaa taulukon rivi", copy_row_desc:"Kopioi taulukon rivi", del:"Poista taulukko", row:"Rivi", col:"Sarake", cell:"Solu", cellprops_delta_width:"80" }, autosave:{ unload_msg:"Tekem\u00E4si muutokset menetet\u00E4\u00E4n jos poistut t\u00E4lt\u00E4 sivulta." }, fullscreen:{ desc:"Kokoruututila" }, media:{ desc:"Lis\u00E4\u00E4/muokkaa upotettua mediaa", edit:"Muokkaa upotettua mediaa" }, fullpage:{ desc:"Tiedoston asetukset" }, template:{ desc:"Lis\u00E4\u00E4 esim\u00E4\u00E4ritetty\u00E4 sivupohjasis\u00E4lt\u00F6\u00E4" }, visualchars:{ desc:"N\u00E4yt\u00E4/piilota muotoilumerkit." }, spellchecker:{ desc:"Oikeinkirjoituksen tarkistus", menu:"Oikeinkirjoituksen asetukset", ignore_word:"Ohita sana", ignore_words:"Ohita kaikki", langs:"Kielet", wait:"Odota ole hyv\u00E4...", sug:"Ehdotukset", no_sug:"Ei ehdotuksia", no_mpell:"Virheit\u00E4 ei l\u00F6ytynyt." }, pagebreak:{ desc:"Lis\u00E4\u00E4 sivunvaihto." }}});����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/fr.js���������������������������������������������������������0000664�0000000�0000000�00000011674�12266004471�0020260�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({fr:{ common:{ edit_confirm:"souhaitez-vous utiliser le mode WYSIWYG pour cette zone de texte ?", apply:"Appliquer", insert:"Ins\u00E9rer", update:"Mettre \u00E0 jour", cancel:"Annuler", close:"Fermer", browse:"parcourir", class_name:"Class", not_set:"-- non d\u00E9fini --", clipboard_msg:"Les fonctions Copier/Couper/Coller ne sont pas valables sur Mozilla et Firefox.\nSouhaitez-vous avoir plus d'informations sur ce sujet ?", clipboard_no_support:"Actuellement pas pris en charge par votre navigateur. Veuillez tiliser les raccourcis clavier \u00E0 la place.", popup_blocked:"D\u00E9sol\u00E9, nous avons d\u00E9tect\u00E9 que votre bloqueur de popup a bloqu\u00E9 une fen\u00EAtre dont l'application a besoin. Vous devez d\u00E9sactiver votre bloqueur de popup pour pouvoir utiliser cet outil.", invalid_data:"Erreur : saisie de valeurs incorrectes. Elles sont mises en \u00E9vidence en rouge.", more_colors:"Plus de couleurs" }, contextmenu:{ align:"Alignement", left:"Gauche", center:"Centr\u00E9", right:"Droite", full:"Justifi\u00E9" }, insertdatetime:{ date_fmt:"%d-%m-%Y", time_fmt:"%H:%M:%S", insertdate_desc:"Ins\u00E9rer la date", inserttime_desc:"Ins\u00E9rer l'heure", months_long:"Janvier,F\u00E9vrier,Mars,Avril,Mai,Juin,Juillet,Ao\u00FBt,Septembre,Octobre,Novembre,D\u00E9cembre", months_short:"Jan,F\u00E9v,Mar,Avr,Mai,Juin,Juil,Ao\u00FBt,Sep,Oct,Nov,D\u00E9c", day_long:"Dimanche,Lundi,Mardi,Mercredi,Jeudi,Vendredi,Samedi,Dimanche", day_short:"Dim,Lun,Mar,Mer,Jeu,Ven,Sam,Dim" }, print:{ print_desc:"Imprimer" }, preview:{ preview_desc:"Pr\u00E9visualiser" }, directionality:{ ltr_desc:"\u00C9criture de gauche \u00E0 droite", rtl_desc:"\u00C9criture de droite \u00E0 gauche" }, layer:{ insertlayer_desc:"Ins\u00E9rer une nouvelle couche", forward_desc:"D\u00E9placer vers l'avant", backward_desc:"D\u00E9placer vers l'arri\u00E8re", absolute_desc:"Activer le positionnement absolu", content:"Nouvelle couche\u2026" }, save:{ save_desc:"Enregistrer", cancel_desc:"Annuler toutes les modifications" }, nonbreaking:{ nonbreaking_desc:"Ins\u00E9rer une espace ins\u00E9cable" }, iespell:{ iespell_desc:"Lancer le v\u00E9rificateur d'orthographe", download:"ieSpell n'est pas install\u00E9. Souhaitez-vous l'installer maintenant ?" }, advhr:{ advhr_desc:"Ins\u00E9rer un trait horizontal" }, emotions:{ emotions_desc:"\u00C9motic\u00F4nes" }, searchreplace:{ search_desc:"Rechercher", replace_desc:"Rechercher / remplacer" }, advimage:{ image_desc:"Ins\u00E9rer / \u00E9diter une image" }, advlink:{ link_desc:"Ins\u00E9rer / \u00E9diter un lien" }, xhtmlxtras:{ cite_desc:"Citation", abbr_desc:"Abr\u00E9viation", acronym_desc:"Acronyme", del_desc:"Barr\u00E9", ins_desc:"Ins\u00E9r\u00E9", attribs_desc:"Ins\u00E9rer / \u00E9diter les attributs" }, style:{ desc:"\u00C9diter la feuille de style (CSS)" }, paste:{ paste_text_desc:"Coller comme texte brut", paste_word_desc:"Coller un texte cr\u00E9\u00E9 sous Word", selectall_desc:"Tout s\u00E9lectionner" }, paste_dlg:{ text_title:"Utilisez CTRL+V sur votre clavier pour coller le texte dans la fen\u00EAtre.", text_linebreaks:"Conserver les retours \u00E0 la ligne", word_title:"Utilisez CTRL+V sur votre clavier pour coller le texte dans la fen\u00EAtre." }, table:{ desc:"Ins\u00E9rer un nouveau tableau", row_before_desc:"Ins\u00E9rer une ligne avant", row_after_desc:"Ins\u00E9rer une ligne apr\u00E8s", delete_row_desc:"Effacer la ligne", col_before_desc:"Ins\u00E9rer une colonne avant", col_after_desc:"Ins\u00E9rer une colonne apr\u00E8s", delete_col_desc:"Effacer la colonne", split_cells_desc:"Scinder les cellules fusionn\u00E9es", merge_cells_desc:"Fusionner les cellules", row_desc:"Propri\u00E9t\u00E9s de la ligne", cell_desc:"Propri\u00E9t\u00E9s de la cellule", props_desc:"Propri\u00E9t\u00E9s du tableau", paste_row_before_desc:"Coller la ligne avant", paste_row_after_desc:"Coller la ligne apr\u00E8s", cut_row_desc:"Couper la ligne", copy_row_desc:"Copier la ligne", del:"Effacer le tableau", row:"Ligne", col:"Colonne", cell:"Cellule" }, autosave:{ unload_msg:"Les modifications apport\u00E9es seront perdus si vous quittez cette page." }, fullscreen:{ desc:"Passer en mode plein \u00E9cran" }, media:{ desc:"Ins\u00E9rer / \u00E9diter un m\u00E9dia incorpor\u00E9", edit:"\u00C9diter un m\u00E9dia incorpor\u00E9" }, fullpage:{ desc:"Propri\u00E9t\u00E9s du document" }, template:{ desc:"Ins\u00E9rer un mod\u00E8le pr\u00E9d\u00E9fini." }, visualchars:{ desc:"Activer les caract\u00E8res de mise en page." }, spellchecker:{ desc:"Activer le v\u00E9rificateur d'orthographe", menu:"Param\u00E8tres du v\u00E9rificateur d'orthographe", ignore_word:"Ignorer le mot", ignore_words:"Tout ignorer", langs:"Langues", wait:"Veuillez patienter\u2026", sug:"Suggestions", no_sug:"Aucune suggestion", no_mpell:"Aucune erreur trouv\u00E9e." }, pagebreak:{ desc:"Ins\u00E9rer un saut de page." }}});��������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/gl.js���������������������������������������������������������0000664�0000000�0000000�00000010504�12266004471�0020242�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({gl:{ common:{ edit_confirm:"\u00BFDesexa utiliza-lo modo WYSIWYG pra esta caixa de texto?", apply:"Apricar", insert:"Insertar", update:"Actualizar", cancel:"Cancelar", close:"Cerrar", browse:"Examinar", class_name:"Clase", not_set:"-- Ning\u00FAn --", clipboard_msg:"Copiar/Cortar/Pegar non est\u00E1 disponible en Mozilla e Firefox.\n\u00BFDesexa obter mais informaci\u00F3n sobre de este asunto?", clipboard_no_support:"O seu navegador non soporta estas funci\u00F3ns, use os atallos de teclado.", popup_blocked:"O seu bloqueador de vent\u00E1s emerxentes deshabilitou unha vent\u00E1 que precisa pra o funcionamento da aplicaci\u00F3n. Precisa deshabilita-lo bloqueo de `popups` neste sitio pra utilizar \u00F3 m\u00E1ximo esta ferramenta.", invalid_data:"Error: Introducidos valores non v\u00E1lidos, est\u00E1n marcados en vermello.", more_colors:"Mais cores" }, contextmenu:{ align:"Ali\u00F1amento", left:"Esquerda", center:"Centrado", right:"Dereita", full:"Xustificado" }, insertdatetime:{ date_fmt:"%d-%m-%Y", time_fmt:"%H:%M:%S", insertdate_desc:"Insertar data", inserttime_desc:"Insertar hora", months_long:"Xaneito,Febreiro,Marzo,Abril,Maio,Xu\u00F1o,Xullo,Agosto,Setembro,Outubro,Novembro,Decembro", months_short:"Xan,Feb,Mar,Abr,Mai,Xu\u00F1,Xul,Ago,Set,Out,Nov,Dec", day_long:"Domingo,Luns,Martes,M\u00E9rcores,Xoves,Venres,S\u00E1bado,Domingo", day_short:"Dom,Lun,Mar,M\u00E9r,Xov,Ver,S\u00E1b,Dom" }, print:{ print_desc:"Imprimir" }, preview:{ preview_desc:"Vista previa" }, directionality:{ ltr_desc:"Direcci\u00F3n esquerda a dereita", rtl_desc:"Direcci\u00F3n dereita a esquerda" }, layer:{ insertlayer_desc:"Insertar nova capa", forward_desc:"Avanzar", backward_desc:"Recuar", absolute_desc:"Posici\u00F3n absoluta", content:"Nova capa..." }, save:{ save_desc:"Gardar", cancel_desc:"Cancelar todo-los cambios" }, nonbreaking:{ nonbreaking_desc:"Insertar espacio non colapsable" }, iespell:{ iespell_desc:"Corrector ortogr\u00E1fico", download:"Non se detectou 'ieSpell'. \u00BFDesexa instala-lo agora?" }, advhr:{ advhr_desc:"Regra horizontal" }, emotions:{ emotions_desc:"Emoticones" }, searchreplace:{ search_desc:"Buscar", replace_desc:"Buscar/Reemplazar" }, advimage:{ image_desc:"Insertar/editar imaxe" }, advlink:{ link_desc:"Insertar/editar hiperv\u00EDnculo" }, xhtmlxtras:{ cite_desc:"Cita", abbr_desc:"Abreviatura", acronym_desc:"Acr\u00F3nimo", del_desc:"Borrado", ins_desc:"Inserci\u00F3n", attribs_desc:"Insertar/Editar atributos" }, style:{ desc:"Editar Estilo CSS" }, paste:{ paste_text_desc:"Pegar como texto simple", paste_word_desc:"Pegar desde Word", selectall_desc:"Seleccionar todo" }, paste_dlg:{ text_title:"Use CTRL+V no teclado pra pega-lo texto na vent\u00E1.", text_linebreaks:"Manter salto de li\u00F1as", word_title:"Use CTRL+V no teclado pra pega-lo texto na vent\u00E1." }, table:{ desc:"Inserta unha nova t\u00E1boa", row_before_desc:"Insertar fila (antes)", row_after_desc:"Insertar fila (desp\u00F3is)", delete_row_desc:"Suprimir fila", col_before_desc:"Insertar columna (antes)", col_after_desc:"Insertar columna (desp\u00F3is)", delete_col_desc:"Suprimir columna", split_cells_desc:"Dividir celdas", merge_cells_desc:"Vincular celdas", row_desc:"Propiedades da fila", cell_desc:"Propiedades da celda", props_desc:"Propiedades da t\u00E1boa", paste_row_before_desc:"Pegar filas (antes)", paste_row_after_desc:"Pegar filas (desp\u00F3is)", cut_row_desc:"Cortar fila", copy_row_desc:"Copiar fila", del:"Eliminar t\u00E1boa", row:"Fila", col:"Columna", cell:"Celda" }, autosave:{ unload_msg:"Os cambios realizados perderanse se sae desta p\u00E1xina." }, fullscreen:{ desc:"Cambiar a modo Pantalla Completa" }, media:{ desc:"Insertar/editar medio embebido", edit:"Editar medio embebido" }, fullpage:{ desc:"Propiedades do documento" }, template:{ desc:"Insertar contido de plantilla predefinida" }, visualchars:{ desc:"Caracteres de control ON/OFF." }, spellchecker:{ desc:"Conmutar corrector ortogr\u00E1fico", menu:"Configuraci\u00F3n de corrector ortogr\u00E1fico", ignore_word:"Ignorar verba", ignore_words:"Ignorar todo", langs:"Idiomas", wait:"Agarde...", sug:"Suxerencias", no_sug:"Sen suxerencias", no_mpell:"Non se atoparon erros." }, pagebreak:{ desc:"Insertar fin de p\u00E1xina" }}});��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/gu.js���������������������������������������������������������0000664�0000000�0000000�00000007763�12266004471�0020270�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({gu:{ common:{ edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?", apply:"Apply", insert:"Insert", update:"Update", cancel:"Cancel", close:"Close", browse:"Browse", class_name:"Class", not_set:"-- Not set --", clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?", clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.", popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.", invalid_data:"Error: Invalid values entered, these are marked in red.", more_colors:"More colors" }, contextmenu:{ align:"Alignment", left:"Left", center:"Center", right:"Right", full:"Full" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"Insert date", inserttime_desc:"Insert time", months_long:"January,February,March,April,May,June,July,August,September,October,November,December", months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun" }, print:{ print_desc:"Print" }, preview:{ preview_desc:"Preview" }, directionality:{ ltr_desc:"Direction left to right", rtl_desc:"Direction right to left" }, layer:{ insertlayer_desc:"Insert new layer", forward_desc:"Move forward", backward_desc:"Move backward", absolute_desc:"Toggle absolute positioning", content:"New layer..." }, save:{ save_desc:"Save", cancel_desc:"Cancel all changes" }, nonbreaking:{ nonbreaking_desc:"Insert non-breaking space character" }, iespell:{ iespell_desc:"Run spell checking", download:"ieSpell not detected. Do you want to install it now?" }, advhr:{ advhr_desc:"Horizontal rule" }, emotions:{ emotions_desc:"Emotions" }, searchreplace:{ search_desc:"Find", replace_desc:"Find/Replace" }, advimage:{ image_desc:"Insert/edit image" }, advlink:{ link_desc:"Insert/edit link" }, xhtmlxtras:{ cite_desc:"Citation", abbr_desc:"Abbreviation", acronym_desc:"Acronym", del_desc:"Deletion", ins_desc:"Insertion", attribs_desc:"Insert/Edit Attributes" }, style:{ desc:"Edit CSS Style" }, paste:{ paste_text_desc:"Paste as Plain Text", paste_word_desc:"Paste from Word", selectall_desc:"Select All" }, paste_dlg:{ text_title:"Use CTRL+V on your keyboard to paste the text into the window.", text_linebreaks:"Keep linebreaks", word_title:"Use CTRL+V on your keyboard to paste the text into the window." }, table:{ desc:"Inserts a new table", row_before_desc:"Insert row before", row_after_desc:"Insert row after", delete_row_desc:"Delete row", col_before_desc:"Insert column before", col_after_desc:"Insert column after", delete_col_desc:"Remove column", split_cells_desc:"Split merged table cells", merge_cells_desc:"Merge table cells", row_desc:"Table row properties", cell_desc:"Table cell properties", props_desc:"Table properties", paste_row_before_desc:"Paste table row before", paste_row_after_desc:"Paste table row after", cut_row_desc:"Cut table row", copy_row_desc:"Copy table row", del:"Delete table", row:"Row", col:"Column", cell:"Cell" }, autosave:{ unload_msg:"The changes you made will be lost if you navigate away from this page." }, fullscreen:{ desc:"Toggle fullscreen mode" }, media:{ desc:"Insert / edit embedded media", edit:"Edit embedded media" }, fullpage:{ desc:"Document properties" }, template:{ desc:"Insert predefined template content" }, visualchars:{ desc:"Visual control characters on/off." }, spellchecker:{ desc:"Toggle spellchecker", menu:"Spellchecker settings", ignore_word:"Ignore word", ignore_words:"Ignore all", langs:"Languages", wait:"Please wait...", sug:"Suggestions", no_sug:"No suggestions", no_mpell:"No misspellings found." }, pagebreak:{ desc:"Insert page break." }}});�������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/he.js���������������������������������������������������������0000664�0000000�0000000�00000024330�12266004471�0020236�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({he:{ common:{ edit_confirm:"\u05D1\u05E8\u05E6\u05D5\u05E0\u05DA \u05DC\u05D4\u05E9\u05EA\u05DE\u05E9 \u05D1\u05E2\u05D5\u05E8\u05DA \u05D4\u05DE\u05EA\u05E7\u05D3\u05DD?", apply:"\u05D0\u05D9\u05E9\u05D5\u05E8", insert:"\u05D4\u05D5\u05E1\u05E4\u05D4", update:"\u05E2\u05D3\u05DB\u05D5\u05DF", cancel:"\u05D1\u05D9\u05D8\u05D5\u05DC", close:"\u05E1\u05D2\u05D9\u05E8\u05D4", browse:"\u05E2\u05D9\u05D5\u05DF", class_name:"\u05DE\u05D7\u05DC\u05E7\u05D4", not_set:"-- \u05DC\u05D0 \u05D4\u05D5\u05D2\u05D3\u05E8 --", clipboard_msg:"\r\n \u05D4\u05E2\u05EA\u05E7\u05D4/\u05D2\u05D6\u05D9\u05E8\u05D4 \u05D5\u05D4\u05D3\u05D1\u05E7\u05D4 \u05D0\u05D9\u05E0\u05DD \u05D6\u05DE\u05D9\u05E0\u05D9\u05DD \u05D1 Mozilla \u05D5\u05D1-Firefox.\r\n \u05D4\u05D0\u05DD \u05D1\u05E8\u05E6\u05D5\u05E0\u05DA \u05DC\u05E7\u05D1\u05DC \u05DE\u05D9\u05D3\u05E2 \u05E0\u05D5\u05E1\u05E3 \u05E2\u05DC \u05D4\u05E0\u05D5\u05E9\u05D0?\r\n ", clipboard_no_support:"\u05DB\u05E8\u05D2\u05E2 \u05DC\u05D0 \u05E0\u05EA\u05DE\u05DA \u05E2\u05DC \u05D9\u05D3\u05D9 \u05D4\u05D3\u05E4\u05D3\u05E4\u05DF \u05E9\u05DC\u05DA. \u05D4\u05E9\u05EA\u05DE\u05E9 \u05D1\u05E7\u05D9\u05E6\u05D5\u05E8\u05D9 \u05D4\u05DE\u05E7\u05DC\u05D3\u05EA.", popup_blocked:"\u05D7\u05D5\u05E1\u05DD \u05E4\u05E8\u05D9\u05D8\u05D9\u05DD \u05DE\u05D5\u05E7\u05E4\u05E6\u05D9\u05DD \u05DE\u05E0\u05E2 \u05DE\u05D7\u05DC\u05D5\u05DF \u05D7\u05E9\u05D5\u05D1 \u05DE\u05DC\u05D4\u05E4\u05EA\u05D7,\u05D0\u05DD \u05D1\u05E8\u05E6\u05D5\u05E0\u05DA \u05DC\u05D4\u05E9\u05EA\u05DE\u05E9 \u05D1\u05DB\u05DC\u05D9 \u05D6\u05D4 \u05E2\u05DC\u05D9\u05DA \u05DC\u05D1\u05D8\u05DC \u05D0\u05EA \u05D7\u05D5\u05E1\u05DD \u05D4\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD", invalid_data:"\u05E9\u05D2\u05D9\u05D0\u05D4: \u05D4\u05D5\u05E7\u05DC\u05D3 \u05DE\u05D9\u05D3\u05E2 \u05DC\u05D0 \u05EA\u05E7\u05E0\u05D9. \u05D4\u05DE\u05D9\u05D3\u05E2 \u05E1\u05D5\u05DE\u05DF \u05D1\u05D0\u05D3\u05D5\u05DD.", more_colors:"\u05E2\u05D5\u05D3 \u05E6\u05D1\u05E2\u05D9\u05DD" }, contextmenu:{ align:"\u05D9\u05D9\u05E9\u05D5\u05E8", left:"\u05E9\u05DE\u05D0\u05DC", center:"\u05D0\u05DE\u05E6\u05E2", right:"\u05D9\u05DE\u05D9\u05DF", full:"\u05E9\u05E0\u05D9 \u05D4\u05E6\u05D3\u05D3\u05D9\u05DD" }, insertdatetime:{ date_fmt:"%d-%m-%Y", time_fmt:"%H:%M:%S", insertdate_desc:"\u05D4\u05D5\u05E1\u05E4\u05EA \u05EA\u05D0\u05E8\u05D9\u05DA", inserttime_desc:"\u05D4\u05D5\u05E1\u05E4\u05EA \u05D6\u05DE\u05DF", months_long:"\u05D9\u05E0\u05D5\u05D0\u05E8,\u05E4\u05D1\u05E8\u05D5\u05D0\u05E8,\u05DE\u05E8\u05E5,\u05D0\u05E4\u05E8\u05D9\u05DC,\u05DE\u05D0\u05D9,\u05D9\u05D5\u05E0\u05E2,\u05D9\u05D5\u05DC\u05D9,\u05D0\u05D5\u05D2\u05D5\u05E1\u05D8,\u05E1\u05E4\u05D8\u05DE\u05D1\u05E8,\u05D0\u05D5\u05E7\u05D8\u05D5\u05D1\u05E8,\u05E0\u05D5\u05D1\u05DE\u05D1\u05E8,\u05D3\u05E6\u05DE\u05D1\u05E8", months_short:"\u05D9\u05E0\u05D5\u05D0\u05E8,\u05E4\u05D1\u05E8\u05D5\u05D0\u05E8,\u05DE\u05E8\u05E5,\u05D0\u05E4\u05E8\u05D9\u05DC,\u05DE\u05D0\u05D9,\u05D9\u05D5\u05E0\u05E2,\u05D9\u05D5\u05DC\u05D9,\u05D0\u05D5\u05D2\u05D5\u05E1\u05D8,\u05E1\u05E4\u05D8\u05DE\u05D1\u05E8,\u05D0\u05D5\u05E7\u05D8\u05D5\u05D1\u05E8,\u05E0\u05D5\u05D1\u05DE\u05D1\u05E8,\u05D3\u05E6\u05DE\u05D1\u05E8", day_long:"\u05D9\u05D5\u05DD \u05E8\u05D0\u05E9\u05D5\u05DF,\u05D9\u05D5\u05DD \u05E9\u05E0\u05D9,\u05D9\u05D5\u05DD \u05E9\u05DC\u05D9\u05E9\u05D9,\u05D9\u05D5\u05DD \u05E8\u05D1\u05D9\u05E2\u05D9,\u05D9\u05D5\u05DD \u05D7\u05DE\u05D9\u05E9\u05D9,\u05D9\u05D5\u05DD \u05E9\u05D9\u05E9,\u05D9\u05D5\u05DD \u05E9\u05D1\u05EA,\u05D9\u05D5\u05DD \u05E8\u05D0\u05E9\u05D5\u05DF", day_short:"\u05D9\u05D5\u05DD \u05D0',\u05D9\u05D5\u05DD \u05D1',\u05D9\u05D5\u05DD \u05D2',\u05D9\u05D5\u05DD \u05D3',\u05D9\u05D5\u05DD \u05D4',\u05D9\u05D5\u05DD \u05D5',\u05E9\u05D1\u05EA,\u05D9\u05D5\u05DD \u05D0'" }, print:{ print_desc:"\u05D4\u05D3\u05E4\u05E1\u05D4" }, preview:{ preview_desc:"\u05EA\u05E6\u05D5\u05D2\u05D4 \u05DE\u05E7\u05D3\u05D9\u05DE\u05D4" }, directionality:{ ltr_desc:"\u05DB\u05D9\u05D5\u05D5\u05DF \u05D8\u05E7\u05E1\u05D8 \u05DE\u05E9\u05DE\u05D0\u05DC \u05DC\u05D9\u05DE\u05D9\u05DF", rtl_desc:"\u05DB\u05D9\u05D5\u05D5\u05DF \u05D8\u05E7\u05E1\u05D8 \u05DE\u05D9\u05DE\u05D9\u05DF \u05DC\u05E9\u05DE\u05D0\u05DC" }, layer:{ insertlayer_desc:"\u05D4\u05D5\u05E1\u05E4\u05EA \u05E9\u05DB\u05D1\u05D4 \u05D7\u05D3\u05E9\u05D4", forward_desc:"\u05D4\u05E2\u05D1\u05E8\u05D4 \u05E7\u05D3\u05D9\u05DE\u05D4", backward_desc:"\u05D4\u05E2\u05D1\u05E8\u05D4 \u05D0\u05D7\u05D5\u05E8\u05D4", absolute_desc:"\u05D1\u05D7\u05D9\u05E8\u05EA \u05DE\u05D9\u05E7\u05D5\u05DD \u05DE\u05D5\u05D7\u05DC\u05D8", content:"\u05E9\u05DB\u05D1\u05D4 \u05D7\u05D3\u05E9\u05D4..." }, save:{ save_desc:"\u05E9\u05DE\u05D9\u05E8\u05D4", cancel_desc:"\u05D1\u05D9\u05D8\u05D5\u05DC \u05DB\u05DC \u05D4\u05E9\u05D9\u05E0\u05D5\u05D9\u05DD" }, nonbreaking:{ nonbreaking_desc:"\u05D4\u05D5\u05E1\u05E4\u05EA \u05E8\u05D5\u05D5\u05D7" }, iespell:{ iespell_desc:"\u05D1\u05D3\u05D9\u05E7\u05EA \u05D0\u05D9\u05D5\u05EA \u05D1\u05D0\u05E0\u05D2\u05DC\u05D9\u05EA", download:" \u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0 ieSpell. \u05D4\u05D0\u05DD \u05D1\u05E8\u05E6\u05D5\u05E0\u05DA \u05DC\u05D4\u05EA\u05E7\u05D9\u05DF?" }, advhr:{ advhr_desc:"\u05E7\u05D5 \u05D0\u05D5\u05E4\u05E7\u05D9" }, emotions:{ emotions_desc:"\u05E1\u05DE\u05D9\u05D9\u05DC\u05D9\u05DD" }, searchreplace:{ search_desc:"\u05D7\u05D9\u05E4\u05D5\u05E9", replace_desc:"\u05D4\u05D7\u05DC\u05E4\u05D4" }, advimage:{ image_desc:"\u05D4\u05D5\u05E1\u05E4\u05D4/\u05E2\u05E8\u05D9\u05DB\u05EA \u05EA\u05DE\u05D5\u05E0\u05D4" }, advlink:{ link_desc:"\u05D4\u05D5\u05E1\u05E4\u05EA/\u05E2\u05E8\u05D9\u05DB\u05EA \u05E7\u05D9\u05E9\u05D5\u05E8" }, xhtmlxtras:{ cite_desc:"\u05E6\u05D9\u05D8\u05D5\u05D8", abbr_desc:"\u05E7\u05D9\u05E6\u05D5\u05E8", acronym_desc:"\u05E8\u05D0\u05E9\u05D9 \u05EA\u05D9\u05D1\u05D5\u05EA", del_desc:"\u05DE\u05D7\u05D9\u05E7\u05D4", ins_desc:"\u05D4\u05DB\u05E0\u05E1\u05D4", attribs_desc:"\u05D4\u05DB\u05E0\u05E1/\u05E2\u05E8\u05D5\u05DA \u05EA\u05DB\u05D5\u05E0\u05D5\u05EA" }, style:{ desc:"\u05E2\u05D3\u05DB\u05D5\u05DF \u05D4\u05D2\u05D3\u05E8\u05D5\u05EA CSS" }, paste:{ paste_text_desc:"\u05D4\u05D3\u05D1\u05E7\u05D4 \u05DB\u05D8\u05E7\u05E1\u05D8 \u05D1\u05DC\u05D1\u05D3", paste_word_desc:"\u05D4\u05D3\u05D1\u05E7\u05D4 \u05DE-WORD", selectall_desc:"\u05D1\u05D7\u05E8 \u05D4\u05DB\u05DC" }, paste_dlg:{ text_title:"\u05D4\u05D3\u05D1\u05D9\u05E7\u05D5 \u05D1\u05D7\u05DC\u05D5\u05DF \u05D6\u05D4 \u05D0\u05EA \u05D4\u05D8\u05E7\u05E1\u05D8 \u05D1\u05D0\u05DE\u05E6\u05E2\u05D5\u05EA \u05D4\u05DE\u05E7\u05E9\u05D9\u05DD CTRL+V.", text_linebreaks:"\u05D4\u05E9\u05D0\u05E8 \u05D0\u05EA \u05E9\u05D5\u05E8\u05D5\u05EA \u05D4\u05E8\u05D5\u05D5\u05D7", word_title:"\u05D4\u05D3\u05D1\u05D9\u05E7\u05D5 \u05D1\u05D7\u05DC\u05D5\u05DF \u05D6\u05D4 \u05D0\u05EA \u05D4\u05D8\u05E7\u05E1\u05D8 \u05D1\u05D0\u05DE\u05E6\u05E2\u05D5\u05EA \u05D4\u05DE\u05E7\u05E9\u05D9\u05DD CTRL+V." }, table:{ desc:"\u05D4\u05DB\u05E0\u05E1\u05EA \u05D8\u05D1\u05DC\u05D4 \u05D7\u05D3\u05E9\u05D4", row_before_desc:"\u05D4\u05DB\u05E0\u05E1\u05EA \u05E9\u05D5\u05E8\u05D4 \u05DE\u05E2\u05DC", row_after_desc:"\u05D4\u05DB\u05E0\u05E1\u05EA \u05E9\u05D5\u05E8\u05D4 \u05DE\u05EA\u05D7\u05EA", delete_row_desc:"\u05DE\u05D7\u05D9\u05E7\u05EA \u05E9\u05D5\u05E8\u05D4", col_before_desc:"\u05D4\u05DB\u05E0\u05E1\u05EA \u05E2\u05DE\u05D5\u05D3\u05D4 \u05DE\u05D9\u05DE\u05D9\u05DF", col_after_desc:"\u05D4\u05DB\u05E0\u05E1\u05EA \u05E2\u05DE\u05D5\u05D3\u05D4 \u05DE\u05E9\u05DE\u05D0\u05DC", delete_col_desc:"\u05D4\u05E1\u05E8\u05EA \u05E2\u05DE\u05D5\u05D3\u05D4", split_cells_desc:"\u05E4\u05D9\u05E6\u05D5\u05DC \u05EA\u05D0\u05D9\u05DD \u05D1\u05D8\u05D1\u05DC\u05D4", merge_cells_desc:"\u05D0\u05D9\u05D7\u05D5\u05D3 \u05EA\u05D0\u05D9\u05DD \u05D1\u05D8\u05D1\u05DC\u05D4", row_desc:"\u05EA\u05DB\u05D5\u05E0\u05D5\u05EA \u05E9\u05D5\u05E8\u05D4 \u05D1\u05D8\u05D1\u05DC\u05D4", cell_desc:"\u05EA\u05DB\u05D5\u05E0\u05D5\u05EA \u05EA\u05D0 \u05D1\u05D8\u05D1\u05DC\u05D4", props_desc:"\u05EA\u05DB\u05D5\u05E0\u05D5\u05EA \u05D4\u05D8\u05D1\u05DC\u05D4", paste_row_before_desc:"\u05D4\u05D3\u05D1\u05E7\u05EA \u05E9\u05D5\u05E8\u05D4 \u05D1\u05D8\u05D1\u05DC\u05D4 \u05DC\u05E4\u05E0\u05D9", paste_row_after_desc:"\u05D4\u05D3\u05D1\u05E7\u05EA \u05E9\u05D5\u05E8\u05D4 \u05D1\u05D8\u05D1\u05DC\u05D4 \u05D0\u05D7\u05E8\u05D9", cut_row_desc:"\u05D2\u05D6\u05D9\u05E8\u05EA \u05E9\u05D5\u05E8\u05D4 \u05D1\u05D8\u05D1\u05DC\u05D4", copy_row_desc:"\u05D4\u05E2\u05EA\u05E7\u05EA \u05E9\u05D5\u05E8\u05D4 \u05D1\u05D8\u05D1\u05DC\u05D4", del:"\u05DE\u05D7\u05D9\u05E7\u05EA \u05D8\u05D1\u05DC\u05D4", row:"\u05E9\u05D5\u05E8\u05D4", col:"\u05E2\u05DE\u05D5\u05D3\u05D4", cell:"\u05EA\u05D0" }, autosave:{ unload_msg:"\u05D4\u05E9\u05D9\u05E0\u05D5\u05D9\u05D9\u05DD \u05E9\u05D1\u05D9\u05E6\u05E2\u05EA \u05DC\u05D0 \u05D9\u05E9\u05DE\u05E8\u05D5 \u05D0\u05DD \u05EA\u05E2\u05D1\u05D5\u05E8 \u05DE\u05D3\u05E3 \u05D6\u05D4" }, fullscreen:{ desc:"\u05DE\u05E2\u05D1\u05E8 \u05DC\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0/\u05D7\u05DC\u05E7\u05D9" }, media:{ desc:"\u05D4\u05D5\u05E1\u05E4\u05EA/\u05E2\u05E8\u05D9\u05DB\u05EA \u05E1\u05E8\u05D8\u05D5\u05DF", edit:"\u05E2\u05E8\u05D9\u05DB\u05EA \u05E1\u05E8\u05D8\u05D5\u05DF" }, fullpage:{ desc:"\u05DE\u05D0\u05E4\u05D9\u05D9\u05E0\u05D9 \u05E2\u05DE\u05D5\u05D3" }, template:{ desc:"Insert predefined template content" }, visualchars:{ desc:"Visual control characters on/off." }, spellchecker:{ desc:"\u05D4\u05E4\u05E2\u05DC\u05EA \u05D1\u05D5\u05D3\u05E7 \u05D0\u05D9\u05D5\u05EA", menu:"\u05D4\u05D2\u05D3\u05E8\u05D5\u05EA \u05D1\u05D5\u05D3\u05E7 \u05D0\u05D9\u05D5\u05EA", ignore_word:"\u05DC\u05D4\u05EA\u05E2\u05DC\u05DD \u05DE\u05D4\u05DE\u05D9\u05DC\u05D4", ignore_words:"\u05DC\u05D4\u05EA\u05E2\u05DC\u05DD \u05DE\u05D4\u05DB\u05DC", langs:"\u05E9\u05E4\u05D5\u05EA", wait:"\u05E0\u05D0 \u05DC\u05D4\u05DE\u05EA\u05D9\u05DF..", sug:"\u05D4\u05E6\u05E2\u05D5\u05EA", no_sug:"\u05D0\u05D9\u05DF \u05D4\u05E6\u05E2\u05D5\u05EA", no_mpell:"\u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0\u05D5 \u05E9\u05D2\u05D9\u05D0\u05D5\u05EA \u05D0\u05D9\u05D5\u05EA" }, pagebreak:{ desc:"\u05D4\u05D5\u05E1\u05E4\u05EA \u05DE\u05E2\u05D1\u05E8 \u05D3\u05E3" }}});��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/hi.js���������������������������������������������������������0000664�0000000�0000000�00000007763�12266004471�0020255�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({hi:{ common:{ edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?", apply:"Apply", insert:"Insert", update:"Update", cancel:"Cancel", close:"Close", browse:"Browse", class_name:"Class", not_set:"-- Not set --", clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?", clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.", popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.", invalid_data:"Error: Invalid values entered, these are marked in red.", more_colors:"More colors" }, contextmenu:{ align:"Alignment", left:"Left", center:"Center", right:"Right", full:"Full" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"Insert date", inserttime_desc:"Insert time", months_long:"January,February,March,April,May,June,July,August,September,October,November,December", months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun" }, print:{ print_desc:"Print" }, preview:{ preview_desc:"Preview" }, directionality:{ ltr_desc:"Direction left to right", rtl_desc:"Direction right to left" }, layer:{ insertlayer_desc:"Insert new layer", forward_desc:"Move forward", backward_desc:"Move backward", absolute_desc:"Toggle absolute positioning", content:"New layer..." }, save:{ save_desc:"Save", cancel_desc:"Cancel all changes" }, nonbreaking:{ nonbreaking_desc:"Insert non-breaking space character" }, iespell:{ iespell_desc:"Run spell checking", download:"ieSpell not detected. Do you want to install it now?" }, advhr:{ advhr_desc:"Horizontal rule" }, emotions:{ emotions_desc:"Emotions" }, searchreplace:{ search_desc:"Find", replace_desc:"Find/Replace" }, advimage:{ image_desc:"Insert/edit image" }, advlink:{ link_desc:"Insert/edit link" }, xhtmlxtras:{ cite_desc:"Citation", abbr_desc:"Abbreviation", acronym_desc:"Acronym", del_desc:"Deletion", ins_desc:"Insertion", attribs_desc:"Insert/Edit Attributes" }, style:{ desc:"Edit CSS Style" }, paste:{ paste_text_desc:"Paste as Plain Text", paste_word_desc:"Paste from Word", selectall_desc:"Select All" }, paste_dlg:{ text_title:"Use CTRL+V on your keyboard to paste the text into the window.", text_linebreaks:"Keep linebreaks", word_title:"Use CTRL+V on your keyboard to paste the text into the window." }, table:{ desc:"Inserts a new table", row_before_desc:"Insert row before", row_after_desc:"Insert row after", delete_row_desc:"Delete row", col_before_desc:"Insert column before", col_after_desc:"Insert column after", delete_col_desc:"Remove column", split_cells_desc:"Split merged table cells", merge_cells_desc:"Merge table cells", row_desc:"Table row properties", cell_desc:"Table cell properties", props_desc:"Table properties", paste_row_before_desc:"Paste table row before", paste_row_after_desc:"Paste table row after", cut_row_desc:"Cut table row", copy_row_desc:"Copy table row", del:"Delete table", row:"Row", col:"Column", cell:"Cell" }, autosave:{ unload_msg:"The changes you made will be lost if you navigate away from this page." }, fullscreen:{ desc:"Toggle fullscreen mode" }, media:{ desc:"Insert / edit embedded media", edit:"Edit embedded media" }, fullpage:{ desc:"Document properties" }, template:{ desc:"Insert predefined template content" }, visualchars:{ desc:"Visual control characters on/off." }, spellchecker:{ desc:"Toggle spellchecker", menu:"Spellchecker settings", ignore_word:"Ignore word", ignore_words:"Ignore all", langs:"Languages", wait:"Please wait...", sug:"Suggestions", no_sug:"No suggestions", no_mpell:"No misspellings found." }, pagebreak:{ desc:"Insert page break." }}});�������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/hr.js���������������������������������������������������������0000664�0000000�0000000�00000010506�12266004471�0020253�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({hr:{ common:{ edit_confirm:"\u017Delite li koristiti WYSIWYG na\u010Din rada za ovo tekstualno polje?", apply:"Primjeni", insert:"Umetni", update:"Obnovi", cancel:"Odustani", close:"Zatvori", browse:"Pregled", class_name:"Klasa", not_set:"-- Nije postavljeno --", clipboard_msg:"Kopiraj/Izre\u017Ei/Zalijepi nije dostupno Mozilla i Firefox preglednicima.\nVi\u0161e informacija?", clipboard_no_support:"Trenuta\u010Dno va\u0161 preglednik ne podr\u017Eava ovu opciju, poku\u0161ajte koristiti tipkovni\u010Dku kraticu.", popup_blocked:"Oprostite, izgleda da je va\u0161 popup-blocker onemogu\u0107io prozor u sklopu ovog programa. Morate onemogu\u0107iti blokiranje popup prozora da bi u potpunosti iskoristili ovaj alat.", invalid_data:"Gre\u0161ka: Une\u0161ene su nevaljane vrijednosti, ozna\u010Dene su crvenom bojom.", more_colors:"Vi\u0161e boja" }, contextmenu:{ align:"Poravnavanje", left:"Lijevo", center:"Sredina", right:"Desno", full:"Puno" }, insertdatetime:{ date_fmt:"%d.%m.%Y.", time_fmt:"%H:%M:%S", insertdate_desc:"Umetni datum", inserttime_desc:"Umetni vrijeme", months_long:"sije\u010Danj,velja\u010Da,o\u017Eujak,travanj,svibanj,lipanj,srpanj,kolovoz,rujan,listopad,studeni,prosinac", months_short:"sij,velj,o\u017Eu,tra,svi,lip,srp,kol,ruj,lis,stu,pro", day_long:"nedjelja,ponedjeljak,utorak,srijeda,\u010Detvrtak,petak,subota,nedjelja", day_short:"ned,pon,uto,sri,\u010Det,pet,sub,ned" }, print:{ print_desc:"Ispis" }, preview:{ preview_desc:"Prikaz" }, directionality:{ ltr_desc:"S lijeva na desno", rtl_desc:"S desna na lijevo" }, layer:{ insertlayer_desc:"Umetni novi sloj", forward_desc:"Pomakni naprijed", backward_desc:"Pomakni natrag", absolute_desc:"Uklju\u010Di/isklju\u010Di apsolutno pozicioniranje", content:"Novi sloj..." }, save:{ save_desc:"Spremi", cancel_desc:"Odustani od svih promjena" }, nonbreaking:{ nonbreaking_desc:"Umetni razmak" }, iespell:{ iespell_desc:"Pokreni provjeru pravopisa", download:"Provjera pravopisa nije postaljena. Postaviti sada?" }, advhr:{ advhr_desc:"Vodoravna crta" }, emotions:{ emotions_desc:"Emocije" }, searchreplace:{ search_desc:"Prona\u0111i", replace_desc:"Prona\u0111i/Zamijeni" }, advimage:{ image_desc:"Umetni/uredi sliku" }, advlink:{ link_desc:"Insert/edit link", delta_width:"100" }, xhtmlxtras:{ cite_desc:"Citat", abbr_desc:"Kratica", acronym_desc:"Akronim", del_desc:"Brisanje", ins_desc:"Unos", attribs_desc:"Umetni/uredi atribute" }, style:{ desc:"Uredi CSS" }, paste:{ paste_text_desc:"Zalijepi kao obi\u010Dni tekst", paste_word_desc:"Zalijepi iz Worda", selectall_desc:"Odaberi sve" }, paste_dlg:{ text_title:"Koristite CTRL+V na tipkovnici da zalijepite tekst u prozor.", text_linebreaks:"Zadr\u017Ei prijelome", word_title:"Koristite CTRL+V na tipkovnici da zalijepite tekst u prozor." }, table:{ desc:"Nova tablica", row_before_desc:"Umetni redak iznad", row_after_desc:"Umetni redak ispod", delete_row_desc:"Izbri\u0161i redak", col_before_desc:"Umetni stupac lijevo", col_after_desc:"Umetni stupac desno", delete_col_desc:"Ukloni stupac", split_cells_desc:"Razdvoji spojene \u0107elije", merge_cells_desc:"Spoji \u0107elije", row_desc:"Svojstva retka", cell_desc:"Svojstva \u0107elije", props_desc:"Svojstva tablice", paste_row_before_desc:"Zalijepi redak iznad", paste_row_after_desc:"Zalijepi redak ispod", cut_row_desc:"Izre\u017Ei redak", copy_row_desc:"Kopiraj redak", del:"Izbri\u0161i tablicu", row:"Redak", col:"Stupac", cell:"\u0106elija" }, autosave:{ unload_msg:"Promjene u dokumentu \u0107e biti izgubljene ako iza\u0111ete s ove stranice." }, fullscreen:{ desc:"Uklju\u010Di/isklju\u010Di prikaz preko cijelog ekrana" }, media:{ desc:"Insert / edit embedded media", edit:"Edit embedded media" }, fullpage:{ desc:"Svojstva dokumenta" }, template:{ desc:"Umetni sadr\u017Eaj iz predlo\u017Eak" }, visualchars:{ desc:"Vizualni kontrolni znakovi uklju\u010Deni/isklju\u010Deni." }, spellchecker:{ desc:"Uklju\u010Di/isklju\u010Di provjeru pravopisa", menu:"Postavke provjere pravopisa", ignore_word:"Zanemari rije\u010D", ignore_words:"Zanemari sver", langs:"Jezici", wait:"Pri\u010Dekajte...", sug:"Prijedlozi", no_sug:"Nema prijedloga", no_mpell:"Nije prona\u0111ena nijedna pravopisna gre\u0161ke." }, pagebreak:{ desc:"Umetni prijelom." }}});������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/hu.js���������������������������������������������������������0000664�0000000�0000000�00000012660�12266004471�0020261�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({hu:{ common:{ edit_confirm:"Haszn\u00E1lni k\u00EDv\u00E1nja a WYSIWYG m\u00F3dot ebben a sz\u00F6vegdobozban?", apply:"Alkalmaz\u00E1s", insert:"Besz\u00FAr\u00E1s", update:"Friss\u00EDt\u00E9s", cancel:"M\u00E9gsem", close:"Bez\u00E1r\u00E1s", browse:"Tall\u00F3z\u00E1s", class_name:"Oszt\u00E1ly", not_set:"-- Nincs megadva --", clipboard_msg:"A M\u00E1sol\u00E1s/Kiv\u00E1g\u00E1s/Besz\u00FAr\u00E1s funkci\u00F3k nem \u00E9rhet\u0151ek el Mozilla \u00E9s Firefox alatt.\nK\u00EDv\u00E1n t\u00F6bbet tudni err\u0151l a t\u00E9m\u00E1r\u00F3l?", clipboard_no_support:"Jelenleg nem t\u00E1mogatja a b\u00F6ng\u00E9sz\u0151je, haszn\u00E1lja a billenty\u0171kombin\u00E1ci\u00F3kat helyette.", popup_blocked:"A felugr\u00F3 ablakok tilt\u00E1sa miatt nem siker\u00FClt megjelen\u00EDteni egy, az alkalmaz\u00E1shoz sz\u00FCks\u00E9ges ablakot. Enged\u00E9lyezze a b\u00F6ng\u00E9sz\u0151j\u00E9ben a felugr\u00F3 ablakokat, hogy minden funkci\u00F3t haszn\u00E1lhasson.", invalid_data:"Hiba: \u00C9rv\u00E9nytelen adatok, pirossal jel\u00F6lve.", more_colors:"T\u00F6bb sz\u00EDn" }, contextmenu:{ align:"Igaz\u00EDt\u00E1s", left:"Balra", center:"K\u00F6z\u00E9pre", right:"Jobbra", full:"Sorkiz\u00E1r\u00E1s" }, insertdatetime:{ date_fmt:"%Y.%m.%d.", time_fmt:"%H:%M:%S", insertdate_desc:"D\u00E1tum besz\u00FAr\u00E1sa", inserttime_desc:"Id\u0151 besz\u00FAr\u00E1sa", months_long:"janu\u00E1r,febru\u00E1r,m\u00E1rcius,\u00E1prilis,m\u00E1jus,j\u00FAnius,j\u00FAlius,augusztus,szeptember,okt\u00F3ber,november,december", months_short:"jan,feb,m\u00E1r,\u00E1pr,m\u00E1j,j\u00FAn,j\u00FAl,aug,szept,okt,nov,dec", day_long:"vas\u00E1rnap,h\u00E9tf\u0151,kedd,szerda,cs\u00FCt\u00F6rt\u00F6k,p\u00E9ntek,szombat,vas\u00E1rnap", day_short:"V,H,K,Sze,Cs,P,Szo,V" }, print:{ print_desc:"Nyomtat\u00E1s" }, preview:{ preview_desc:"El\u0151n\u00E9zet" }, directionality:{ ltr_desc:"Balr\u00F3l jobbra", rtl_desc:"Jobbr\u00F3l balra" }, layer:{ insertlayer_desc:"\u00DAj r\u00E9teg besz\u00FAr\u00E1sa", forward_desc:"Mozgat\u00E1s el\u0151re", backward_desc:"Mozgat\u00E1s h\u00E1tra", absolute_desc:"Abszol\u00FAt poz\u00EDci\u00F3 ki-/bekapcsol\u00E1sa", content:"\u00DAj r\u00E9teg..." }, save:{ save_desc:"Ment\u00E9s", cancel_desc:"\u00D6sszes v\u00E1ltoz\u00E1s visszavon\u00E1sa" }, nonbreaking:{ nonbreaking_desc:"Nemsort\u00F6r\u0151 sz\u00F3k\u00F6z besz\u00FAr\u00E1sa" }, iespell:{ iespell_desc:"Helyes\u00EDr\u00E1s-ellen\u0151rz\u00E9s futtat\u00E1sa", download:"ieSpell nem tal\u00E1lhat\u00F3. Telep\u00EDti most?" }, advhr:{ advhr_desc:"V\u00EDzszintes vonal" }, emotions:{ emotions_desc:"Hangulatjelek" }, searchreplace:{ search_desc:"Keres\u00E9s", replace_desc:"Keres\u00E9s/Csere" }, advimage:{ image_desc:"K\u00E9p besz\u00FAr\u00E1sa/szerkeszt\u00E9se" }, advlink:{ link_desc:"Link besz\u00FAr\u00E1sa/szerkeszt\u00E9s" }, xhtmlxtras:{ cite_desc:"Id\u00E9zet", abbr_desc:"R\u00F6vid\u00EDt\u00E9s", acronym_desc:"Bet\u0171sz\u00F3", del_desc:"T\u00F6r\u00F6lt", ins_desc:"Besz\u00FArt", attribs_desc:"Tulajdons\u00E1gok besz\u00FAr\u00E1sa/szerkeszt\u00E9se" }, style:{ desc:"CSS st\u00EDlus szerkeszt\u00E9se" }, paste:{ paste_text_desc:"Besz\u00FAr\u00E1s sz\u00F6vegk\u00E9nt", paste_word_desc:"Besz\u00FAr\u00E1s Wordb\u0151l", selectall_desc:"Mindent kijel\u00F6l" }, paste_dlg:{ text_title:"Haszn\u00E1lja a Ctrl+V-t a billenty\u0171zet\u00E9n a beilleszt\u00E9shez.", text_linebreaks:"Sort\u00F6r\u00E9sek megtart\u00E1sa", word_title:"Haszn\u00E1lja a Ctrl+V-t a billenty\u0171zet\u00E9n a beilleszt\u00E9shez." }, table:{ desc:"T\u00E1bl\u00E1zat besz\u00FAr\u00E1sa/szerkeszt\u00E9se", row_before_desc:"Sor besz\u00FAr\u00E1sa el\u00E9", row_after_desc:"Sor besz\u00FAr\u00E1sa ut\u00E1na", delete_row_desc:"Sor t\u00F6rl\u00E9se", col_before_desc:"Oszlop besz\u00FAr\u00E1sa el\u00E9", col_after_desc:"Oszlop besz\u00FAr\u00E1sa ut\u00E1na", delete_col_desc:"Oszlop t\u00F6rl\u00E9se", split_cells_desc:"Cell\u00E1k feloszt\u00E1sa", merge_cells_desc:"Cell\u00E1k \u00F6sszevon\u00E1sa", row_desc:"Sor tulajdons\u00E1gai", cell_desc:"Cella tulajdons\u00E1gai", props_desc:"T\u00E1bl\u00E1zat tulajdons\u00E1gai", paste_row_before_desc:"Sor bem\u00E1sol\u00E1sa el\u00E9", paste_row_after_desc:"Sor bem\u00E1sol\u00E1sa ut\u00E1na", cut_row_desc:"Sor kiv\u00E1g\u00E1sa", copy_row_desc:"Sor m\u00E1sol\u00E1sa", del:"T\u00E1bl\u00E1zat t\u00F6rl\u00E9se", row:"Sor", col:"Oszlop", cell:"Cella" }, autosave:{ unload_msg:"A m\u00F3dos\u00EDt\u00E1sok nem lesznek mentve, ha elhagyja az oldalt." }, fullscreen:{ desc:"Teljesk\u00E9perny\u0151s m\u00F3d ki-/bekapcsol\u00E1sa" }, media:{ desc:"Be\u00E1gyazott m\u00E9dia besz\u00FAr\u00E1sa/szerkeszt\u00E9se", edit:"Be\u00E1gyazott m\u00E9dia szerkeszt\u00E9se" }, fullpage:{ desc:"Dokumentum tulajdons\u00E1gai" }, template:{ desc:"Sablon beilleszt\u00E9se" }, visualchars:{ desc:"Vizu\u00E1lis vez\u00E9rl\u0151karakterek be/ki." }, spellchecker:{ desc:"Helyes\u00EDr\u00E1s-ellen\u0151rz\u0151 ki-/bekapcsol\u00E1sa", menu:"Helyes\u00EDr\u00E1s-ellen\u0151rz\u0151 tulajdons\u00E1gai", ignore_word:"Sz\u00F3 kihagy\u00E1sa", ignore_words:"Mindet kihagy", langs:"Nyelvek", wait:"K\u00E9rem, v\u00E1rjon...", sug:"Aj\u00E1nl\u00E1sok", no_sug:"Nincs aj\u00E1nl\u00E1s", no_mpell:"Nem tal\u00E1ltam helyes\u00EDr\u00E1si hib\u00E1t." }, pagebreak:{ desc:"Oldalt\u00F6r\u00E9s besz\u00FAr\u00E1sa." }}});��������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/hy.js���������������������������������������������������������0000664�0000000�0000000�00000031001�12266004471�0020253�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({hy:{ common:{ edit_confirm:"\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044F \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C WYSIWYG \u0440\u0435\u0436\u0438\u043C \u0434\u043B\u044F \u044D\u0442\u043E\u0433\u043E \u043F\u043E\u043B\u044F?", apply:"\u0540\u0561\u057D\u057F\u0561\u057F\u0565\u056C", insert:"\u054F\u0565\u0572\u0561\u0564\u0580\u0565\u056C", update:"\u0539\u0561\u0580\u0574\u0561\u0581\u0576\u0565\u056C", cancel:"\u0549\u0565\u0572\u0575\u0561\u056C", close:"\u0553\u0561\u056F\u0565\u056C", browse:"\u0534\u056B\u057F\u0565\u056C", class_name:"\u0534\u0561\u057D", not_set:"- \u0568\u0576\u057F\u0580\u0565\u056C -", clipboard_msg:"\u054A\u0561\u057F\u0573\u0565\u0576\u0565\u056C / \u053F\u057F\u0580\u0565\u056C / \u054F\u0565\u0572\u0561\u0564\u0580\u0565\u056C (\u0574\u0561\u057F\u0579\u0565\u056C\u056B \u0579\u0567 Mozilla \u0587 Firefox \u0562\u0580\u0561\u0578\u0582\u0566\u0565\u0580\u0576\u0565\u0580\u0578\u0582\u0574) \ n \u0541\u0565\u0566 \u0570\u0565\u057F\u0561\u0584\u0580\u0584\u056B\u055E\u0580 \u0567 \u0561\u0575\u0564 \u056B\u0576\u0586\u0578\u0580\u0574\u0561\u0581\u056B\u0561\u0576", clipboard_no_support:"\u054F\u057E\u0575\u0561\u056C \u057A\u0561\u0570\u056B\u0576 \u0579\u056B \u0568\u0576\u0564\u0578\u0582\u0576\u057E\u0578\u0582\u0574 \u0541\u0565\u0580 \u0562\u0580\u0561\u0578\u0582\u0566\u0565\u0580\u056B \u056F\u0578\u0572\u0574\u056B\u0581, \u0585\u0563\u057F\u0561\u0563\u0578\u0580\u056E\u0565\u0584 \u0570\u0561\u057A\u0561\u057E\u0578\u0582\u0574\u0576\u0565\u0580", popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool", invalid_data:"\u054D\u056D\u0561\u056C: \u0546\u0565\u0580\u0561\u056E\u057E\u0561\u056E \u0567 \u057D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584, \u0563\u0578\u0582\u0576\u0561\u0576\u0577\u057E\u0561\u056E \u0567 \u056F\u0561\u0580\u0574\u056B\u0580\u0578\u057E", more_colors:"\u0547\u0561\u057F \u0563\u0578\u0582\u0575\u0576\u0565\u0580" }, contextmenu:{ align:"\u0540\u0561\u057E\u0561\u057D\u0561\u0580\u0565\u0581\u0578\u0582\u0574", left:"\u0538\u057D\u057F \u0571\u0561\u056D \u0565\u0566\u0580\u056B", center:"\u053F\u0565\u0576\u057F\u0580\u0578\u0576\u0561\u0581\u0576\u0565\u056C", right:"\u0538\u057D\u057F \u0561\u057B \u0565\u0566\u0580\u056B", full:"\u0538\u057D\u057F \u056C\u0561\u0575\u0576\u0578\u0582\u0569\u0575\u0561\u0576" }, insertdatetime:{ date_fmt:"% d.% m.% Y", time_fmt:"% H:% M:% S", insertdate_desc:"\u054F\u0565\u0572\u0561\u0564\u0580\u0565\u056C \u0561\u0574\u057D\u0561\u0569\u056B\u057E", inserttime_desc:"\u054F\u0565\u0572\u0561\u0564\u0580\u0565\u056C \u056A\u0561\u0574\u0561\u0576\u0561\u056F", months_long:"\u0570\u0578\u0582\u0576\u057E\u0561\u0580, \u0583\u0565\u057F\u0580\u057E\u0561\u0580, \u0574\u0561\u0580\u057F, \u0561\u057A\u0580\u056B\u056C, \u0574\u0561\u0575\u056B\u057D, \u0570\u0578\u0582\u0576\u056B\u057D, \u0570\u0578\u0582\u056C\u056B\u057D, \u0585\u0563\u0578\u057D\u057F\u0578\u057D, \u057D\u0565\u057A\u057F\u0565\u0574\u0562\u0565\u0580, \u0570\u0578\u056F\u057F\u0565\u0574\u0562\u0565\u0580, \u0576\u0578\u0575\u0565\u0574\u0562\u0565\u0580, \u0564\u0565\u056F\u057F\u0565\u0574\u0562\u0565\u0580", months_short:"\u0570\u0578\u0582\u0576, \u0583\u0565\u057F, \u0574\u0561\u0580\u057F, \u0561\u057A\u0580, \u0574\u0561\u0575\u056B\u057D, \u0570\u0578\u0582\u0576, \u0570\u0578\u0582\u056C, \u0585\u0563\u057D\u057F, \u057D\u0565\u057A\u057F, \u0570\u0578\u056F\u057F, \u0576\u0578\u0575, \u0564\u0565\u056F", day_long:"\u056F\u056B\u0580\u0561\u056F\u056B, \u0565\u0580\u056F\u0578\u0582\u0577\u0561\u0562\u0569\u056B, \u0565\u0580\u0565\u0584\u0577\u0561\u0562\u0569\u056B, \u0579\u0578\u0580\u0565\u0584\u0577\u0561\u0562\u0569\u056B, \u0570\u056B\u0576\u0563\u0577\u0561\u0562\u0569\u056B, \u0578\u0582\u0580\u0562\u0561\u0569, \u0577\u0561\u0562\u0561\u0569, \u056F\u056B\u0580\u0561\u056F\u056B", day_short:"\u053F\u056B\u0580, \u0535\u0580\u056F, \u0535\u0580\u0584, \u0549\u0580\u0584, \u0540\u0576\u0563, \u0548\u0582\u0580\u0562, \u0547\u0562\u0569, \u053F\u056B\u0580" }, print:{ print_desc:"\u054F\u057A\u0565\u056C" }, preview:{ preview_desc:"\u0534\u056B\u057F\u0565\u056C" }, directionality:{ ltr_desc:"\u0548\u0582\u0572\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576\u0568\u055D \u0571\u0561\u056D\u056B\u0581 \u0561\u057B", rtl_desc:"\u0548\u0582\u0572\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576\u0568\u055D \u0561\u057B\u056B\u0581 \u0571\u0561\u056D" }, layer:{ insertlayer_desc:"\u054F\u0565\u0572\u0561\u0564\u0580\u0565\u056C \u0576\u0578\u0580 \u0577\u0565\u0580\u057F", forward_desc:"\u054E\u0565\u0580\u0587", backward_desc:"\u054F\u0565\u0572\u0561\u0583\u0578\u056D\u0565\u056C \u0565\u057F", absolute_desc:"\u053F\u056B\u0580\u0561\u057C\u0565\u056C \u0562\u0561\u0581\u0561\u0580\u0571\u0561\u056F \u057F\u0565\u0572\u0561\u056F\u0561\u0575\u0578\u0582\u0574", content:"\u0546\u0578\u0580 \u0577\u0565\u0580\u057F ..." }, save:{ save_desc:"\u054A\u0561\u0570\u057A\u0561\u0576\u0565\u056C", cancel_desc:"\u0549\u0565\u0572\u0561\u0580\u056F\u0565\u056C \u0562\u0561\u056C\u0561\u0580 \u0583\u0578\u0583\u0578\u056D\u0578\u0582\u0569\u0575\u0578\u0582\u0576\u0576\u0565\u0580\u0568" }, nonbreaking:{ nonbreaking_desc:"\u054F\u0565\u0572\u0561\u0564\u0580\u0565\u056C \u0562\u0561\u0581\u0561\u0580\u056F" }, iespell:{ iespell_desc:"\u054F\u0561\u057C\u0561\u057D\u056D\u0561\u056C\u0576\u0565\u0580\u056B \u057D\u057F\u0578\u0582\u0563\u0578\u0582\u0574", download:"ieSpell \u057A\u056C\u0561\u0563\u056B\u0576\u0568 \u0579\u056B \u0563\u057F\u0576\u057E\u0565\u056C\u0589 \u0551\u0561\u0576\u056F\u0561\u0576\u0578\u0582\u055E\u0574 \u0565\u0584 \u057F\u0565\u0572\u0561\u0564\u0580\u0565\u056C" }, advhr:{ advhr_desc:"\u0540\u0561\u0580\u056B\u0566\u0578\u0576\u0561\u056F\u0561\u0576 \u0562\u0561\u056A\u0561\u0576\u056B\u0579" }, emotions:{ emotions_desc:"\u054D\u0574\u0561\u0575\u056C\u056B\u056F\u0576\u0565\u0580" }, searchreplace:{ search_desc:"\u0548\u0580\u0578\u0576\u0565\u056C", replace_desc:"\u0548\u0580\u0578\u0576\u0565\u056C / \u0553\u0578\u0583\u0578\u056D\u0565\u056C" }, advimage:{ image_desc:"\u054F\u0565\u0572\u0561\u0564\u0580\u0565\u056C / \u0583\u0578\u0583\u0578\u056D\u0565\u056C \u0576\u056F\u0561\u0580", delta_width:"200" }, advlink:{ link_desc:"\u054F\u0565\u0572\u0561\u0564\u0580\u0565\u056C / \u0583\u0578\u0583\u0578\u056D\u0565\u056C \u0570\u0572\u0578\u0582\u0574", delta_width:"200" }, xhtmlxtras:{ cite_desc:"Citation", abbr_desc:"Abbreviation", acronym_desc:"Acronym", del_desc:"Deletion", ins_desc:"Insertion", attribs_desc:"\u054F\u0565\u0572\u0561\u0564\u0580\u0565\u056C / \u0583\u0578\u0583\u0578\u056D\u0565\u056C \u0561\u057F\u0580\u056B\u0562\u0578\u0582\u057F\u0576\u0565\u0580\u0568" }, style:{ desc:"\u053D\u0574\u0562\u0561\u0563\u0580\u0565\u056C CSS \u0578\u0573\u0565\u0580\u0568" }, paste:{ paste_text_desc:"\u054F\u0565\u0572\u0561\u0564\u0580\u0565\u056C \u0578\u0580\u057A\u0565\u057D \u057F\u0565\u0584\u057D\u057F", paste_word_desc:"\u054F\u0565\u0572\u0561\u0564\u0580\u0565\u056C Word \u056E\u0580\u0561\u0563\u0580\u056B\u0581", selectall_desc:"\u0538\u0576\u057F\u0580\u0565\u056C \u0562\u0578\u056C\u0578\u0580\u0568" }, paste_dlg:{ text_title:"\u0555\u0563\u057F\u0561\u0563\u0578\u0580\u056E\u0565\u0584 CTRL + V \u057A\u0561\u057F\u0573\u0565\u0576\u057E\u0561\u056E \u057F\u0565\u0584\u057D\u057F\u056B \u057F\u0565\u0572\u0561\u0564\u0580\u0574\u0561\u0576 \u0570\u0561\u0574\u0561\u0580", text_linebreaks:"\u054A\u0561\u0570\u057A\u0561\u0576\u0565\u056C \u057F\u0578\u0572\u0561\u0564\u0561\u0580\u0571\u0565\u0580\u0568", word_title:"\u0555\u0563\u057F\u0561\u0563\u0578\u0580\u056E\u0565\u0584 CTRL + V \u057A\u0561\u057F\u0573\u0565\u0576\u057E\u0561\u056E \u057F\u0565\u0584\u057D\u057F\u056B \u057F\u0565\u0572\u0561\u0564\u0580\u0574\u0561\u0576 \u0570\u0561\u0574\u0561\u0580" }, table:{ desc:"\u054F\u0565\u0572\u0561\u0564\u0580\u0565\u056C \u0576\u0578\u0580 \u0561\u0572\u0575\u0578\u0582\u057D\u0561\u056F", row_before_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u0441\u0442\u0440\u043E\u043A\u0443 \u0434\u043E", row_after_desc:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0441\u0442\u0440\u043E\u043A\u0443 \u043F\u043E\u0441\u043B\u0435", delete_row_desc:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0442\u0440\u043E\u043A\u0443", col_before_desc:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0441\u0442\u043E\u043B\u0431\u0435\u0446 \u0434\u043E", col_after_desc:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0441\u0442\u043E\u043B\u0431\u0435\u0446 \u043F\u043E\u0441\u043B\u0435", delete_col_desc:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0442\u043E\u043B\u0431\u0435\u0446", split_cells_desc:"\u0420\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u044C \u044F\u0447\u0435\u0439\u043A\u0438", merge_cells_desc:"\u041E\u0431\u044A\u0435\u0434\u0438\u043D\u0438\u0442\u044C \u044F\u0447\u0435\u0439\u043A\u0438", row_desc:"\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u043E\u043A\u0435 \u0442\u0430\u0431\u043B\u0438\u0446\u044B", cell_desc:"\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u044F\u0447\u0435\u0439\u043A\u0438 \u0442\u0430\u0431\u043B\u0438\u0446\u044B", props_desc:"\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u0442\u0430\u0431\u043B\u0438\u0446\u044B", paste_row_before_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u0441\u0442\u0440\u043E\u043A\u0443 \u0434\u043E", paste_row_after_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u0441\u0442\u0440\u043E\u043A\u0443 \u043F\u043E\u0441\u043B\u0435", cut_row_desc:"\u0412\u044B\u0440\u0435\u0437\u0430\u0442\u044C \u0441\u0442\u0440\u043E\u043A\u0443 \u0442\u0430\u0431\u043B\u0438\u0446\u044B", copy_row_desc:"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0442\u0440\u043E\u043A\u0443 \u0442\u0430\u0431\u043B\u0438\u0446\u044B", del:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0442\u0430\u0431\u043B\u0438\u0446\u0443", row:"\u0421\u0442\u0440\u043E\u043A\u0430", col:"\u041F\u043E\u043B\u0435", cell:"\u042F\u0447\u0435\u0439\u043A\u0430", cellprops_delta_width:"30" }, autosave:{ unload_msg:"\u0418\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0432\u044B \u0441\u0434\u0435\u043B\u0430\u043B\u0438, \u0431\u0443\u0434\u0443\u0442 \u043F\u043E\u0442\u0435\u0440\u044F\u043D\u044B, \u0435\u0441\u043B\u0438 \u0432\u044B \u043F\u0435\u0440\u0435\u0439\u0434\u0435\u0442\u0435 \u0441 \u044D\u0442\u043E\u0439 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B." }, fullscreen:{ desc:"\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u0441\u044F \u043D\u0430 \u0432\u0435\u0441\u044C \u044D\u043A\u0440\u0430\u043D" }, media:{ desc:"\u054F\u0565\u0572\u0561\u0564\u0580\u0565\u056C / \u0583\u0578\u0583\u0578\u056D\u0565\u056C \u0574\u0565\u0564\u056B\u0561", edit:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C embedded media" }, fullpage:{ desc:"\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430" }, template:{ desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u043D\u044B\u0439 \u043A\u043E\u043D\u0442\u0435\u043D\u0442" }, visualchars:{ desc:"Visual control characters on / off" }, spellchecker:{ desc:"\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0443", menu:"\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438", ignore_word:"\u0418\u0433\u043D\u043E\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u043B\u043E\u0432\u043E", ignore_words:"\u0418\u0433\u043D\u043E\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435", langs:"\u042F\u0437\u044B\u043A\u0438", wait:"\u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u043F\u043E\u0434\u043E\u0436\u0434\u0438\u0442\u0435 ...", sug:"\u0412\u0430\u0440\u0438\u0430\u043D\u0442\u044B", no_sug:"\u041D\u0435\u0442 \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u043E\u0432", no_mpell:"\u041E\u0448\u0438\u0431\u043E\u043A \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E" }, pagebreak:{ desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u0440\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u0435\u043B\u044C \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B" }}});�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/ia.js���������������������������������������������������������0000664�0000000�0000000�00000013054�12266004471�0020234�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({ia:{ common:{ edit_confirm:"\u662F\u5426\u5728\u8BE5text area\u5185\u542F\u7528\u6240\u89C1\u5373\u6240\u5F97\u6A21\u5F0F\uFF1F", apply:"\u5E94\u7528", insert:"\u63D2\u5165", update:"\u66F4\u65B0", cancel:"\u53D6\u6D88", close:"\u5173\u95ED", browse:"\u6D4F\u89C8", class_name:"\u6837\u5F0F\u7C7B\u540D", not_set:"-- \u672A\u8BBE\u7F6E --", clipboard_msg:"\u590D\u5236\u3001\u526A\u5207\u548C\u7C98\u8D34\u529F\u80FD\u5728Mozilla \u548C Firefox\u4E2D\u65E0\u6CD5\u4F7F\u7528", clipboard_no_support:"\u5C1A\u4E0D\u652F\u6301\u60A8\u6240\u4F7F\u7528\u7684\u6D4F\u89C8\u5668\uFF0C\u8BF7\u4F7F\u7528\u952E\u76D8\u65B9\u5F0F\u64CD\u4F5C", popup_blocked:"\u5BF9\u4E0D\u8D77\uFF0C\u60A8\u7684\u5FEB\u663E\u7A97\u53E3\u963B\u6B62\u7A0B\u5E8F\u5DF2\u7ECF\u963B\u6B62\u4E86\u672C\u5FEB\u663E\u7A97\u53E3\uFF0C\u8BF7\u8C03\u6574\u4F60\u7684\u6D4F\u89C8\u5668\u8BBE\u7F6E\uFF0C\u5141\u8BB8\u672C\u7F51\u7AD9\u5F39\u51FA\u65B0\u7A97\u53E3\uFF0C\u4EE5\u4FBF\u4F7F\u7528\u6B64\u529F\u80FD", invalid_data:"\u9519\u8BEF\uFF1A\u8F93\u5165\u4E86\u65E0\u6548\u7684\u503C\uFF0C\u5DF2\u6807\u8BB0\u4E3A\u7EA2\u8272\u3002", more_colors:"\u66F4\u591A\u989C\u8272" }, contextmenu:{ align:"\u5BF9\u9F50\u65B9\u5F0F", left:"\u5DE6\u5BF9\u9F50", center:"\u5C45\u4E2D", right:"\u53F3\u5BF9\u9F50", full:"\u4E24\u7AEF\u5BF9\u9F50" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"\u63D2\u5165\u4ECA\u5929\u65E5\u671F", inserttime_desc:"\u63D2\u5165\u73B0\u5728\u65F6\u95F4", months_long:"\u4E00\u6708,\u4E8C\u6708,\u4E09\u6708,\u56DB\u6708,\u4E94\u6708,\u516D\u6708,\u4E03\u6708,\u516B\u6708,\u4E5D\u6708,\u5341\u6708,\u5341\u4E00\u6708,\u5341\u4E8C\u6708", months_short:"1\u6708,2\u6708,3\u6708,4\u6708,5\u6708,6\u6708,7\u6708,8\u6708,9\u6708,10\u6708,11\u6708,12\u6708", day_long:"\u661F\u671F\u65E5,\u661F\u671F\u4E00,\u661F\u671F\u4E8C,\u661F\u671F\u4E09,\u661F\u671F\u56DB,\u661F\u671F\u4E94,\u661F\u671F\u516D,\u661F\u671F\u65E5", day_short:"\u5468\u65E5,\u5468\u4E00,\u5468\u4E8C,\u5468\u4E09,\u5468\u56DB,\u5468\u4E94,\u5468\u516D,\u5468\u65E5" }, print:{ print_desc:"\u6253\u5370" }, preview:{ preview_desc:"\u9884\u89C8" }, directionality:{ ltr_desc:"\u6587\u5B57\u4ECE\u5DE6\u5230\u53F3", rtl_desc:"\u6587\u5B57\u4ECE\u53F3\u5230\u5DE6" }, layer:{ insertlayer_desc:"\u63D2\u5165\u5C42", forward_desc:"\u524D\u7F6E", backward_desc:"\u540E\u7F6E", absolute_desc:"\u7EDD\u5BF9\u4F4D\u7F6E", content:"\u65B0\u589E\u5C42..." }, save:{ save_desc:"\u4FDD\u5B58", cancel_desc:"\u653E\u5F03\u6240\u6709\u66F4\u6539" }, nonbreaking:{ nonbreaking_desc:"\u63D2\u5165\u7A7A\u683C\u7B26" }, iespell:{ iespell_desc:"\u6267\u884C\u62FC\u5199\u68C0\u67E5", download:"\u672A\u68C0\u6D4B\u5230ieSpell\u7EC4\u4EF6\uFF0C\u662F\u5426\u73B0\u5728\u5B89\u88C5 ?" }, advhr:{ advhr_desc:"\u5206\u9694\u7EBF" }, emotions:{ emotions_desc:"\u8868\u60C5" }, searchreplace:{ search_desc:"\u67E5\u627E", replace_desc:"\u67E5\u627E/\u66FF\u6362" }, advimage:{ image_desc:"\u63D2\u5165/\u7F16\u8F91 \u56FE\u7247" }, advlink:{ link_desc:"\u63D2\u5165/\u7F16\u8F91 \u8FDE\u7ED3" }, xhtmlxtras:{ cite_desc:"\u5F15\u7528", abbr_desc:"\u7F29\u5199", acronym_desc:"\u9996\u5B57\u6BCD\u7F29\u5199", del_desc:"\u5220\u9664", ins_desc:"\u63D2\u5165", attribs_desc:"\u63D2\u5165/\u7F16\u8F91 \u5C5E\u6027" }, style:{ desc:"\u7F16\u8F91 CSS \u6837\u5F0F\u8868" }, paste:{ paste_text_desc:"\u7C98\u8D34\u4E3A\u7EAF\u6587\u5B57", paste_word_desc:"\u7C98\u8D34\u4E3AWord\u683C\u5F0F", selectall_desc:"\u5168\u9009" }, paste_dlg:{ text_title:"\u5C06\u590D\u5236(CTRL + C)\u7684\u5185\u5BB9\u7C98\u8D34(CTRL + V)\u5230\u7A97\u53E3\u3002", text_linebreaks:"\u4FDD\u7559\u5206\u884C\u7B26\u53F7\u53F7", word_title:"\u5C06\u590D\u5236(CTRL + C)\u7684\u5185\u5BB9\u7C98\u8D34(CTRL + V)\u5230\u7A97\u53E3\u3002" }, table:{ desc:"\u63D2\u5165\u65B0\u8868\u683C", row_before_desc:"\u5728\u4E0A\u65B9\u63D2\u5165\u884C", row_after_desc:"\u5728\u4E0B\u65B9\u63D2\u5165\u884C", delete_row_desc:"\u5220\u9664\u5F53\u524D\u884C", col_before_desc:"\u5728\u5DE6\u4FA7\u63D2\u5165\u5217", col_after_desc:"\u5728\u53F3\u4FA7\u63D2\u5165\u5217", delete_col_desc:"\u5220\u9664\u5F53\u524D\u5217", split_cells_desc:"\u62C6\u5206\u50A8\u5B58\u683C", merge_cells_desc:"\u5408\u5E76\u50A8\u5B58\u683C", row_desc:"\u5217 \u5C5E\u6027", cell_desc:"\u50A8\u5B58\u683C \u5C5E\u6027", props_desc:"\u8868\u683C \u5C5E\u6027", paste_row_before_desc:"\u7C98\u8D34\u884C\u5230\u4E0A\u65B9", paste_row_after_desc:"\u7C98\u8D34\u884C\u5230\u4E0B\u65B9", cut_row_desc:"\u526A\u5207\u5F53\u524D\u5217", copy_row_desc:"\u590D\u5236\u5F53\u524D\u5217", del:"\u5220\u9664\u8868\u683C", row:"\u884C", col:"\u5217", cell:"\u50A8\u5B58\u683C" }, autosave:{ unload_msg:"\u5982\u679C\u79BB\u5F00\u8BE5\u9875\u5C06\u5BFC\u81F4\u6240\u6709\u4FEE\u6539\u5168\u90E8\u4E22\u5931\u3002" }, fullscreen:{ desc:"\u5168\u5C4F\u6A21\u5F0F" }, media:{ desc:"\u63D2\u5165/\u7F16\u8F91 \u5A92\u4F53", edit:"\u7F16\u8F91 \u5A92\u4F53" }, fullpage:{ desc:"\u6587\u4EF6" }, template:{ desc:"\u63D2\u5165\u9009\u5B9A\u7684\u8303\u672C" }, visualchars:{ desc:"\u663E\u793A\u63A7\u5236\u7B26\u53F7\u3002" }, spellchecker:{ desc:"\u62FC\u5199\u68C0\u67E5", menu:"\u62FC\u5199\u68C0\u67E5 \u8BBE\u7F6E", ignore_word:"\u5FFD\u7565", ignore_words:"\u5168\u90E8\u5FFD\u7565", langs:"\u8BED\u8A00\u6E05\u5355", wait:"\u8BF7\u7A0D\u5019...", sug:"\u5EFA\u8BAE\u8BCD", no_sug:"\u65E0\u62FC\u5199\u5EFA\u8BAE", no_mpell:"\u65E0\u62FC\u5199\u9519\u8BEF" }, pagebreak:{ desc:"\u63D2\u5165\u5206\u9875\u7B26\u53F7" }}});������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/id.js���������������������������������������������������������0000664�0000000�0000000�00000007621�12266004471�0020242�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({id:{ common:{ edit_confirm:"Gunakan mode WYSIWYG untuk textarea ini?", apply:"Apply", insert:"Insert", update:"Update", cancel:"Cancel", close:"Close", browse:"Browse", class_name:"Class", not_set:"-- Not set --", clipboard_msg:"Copy/Cut/Paste tidak tersedia pada Mozilla dan Firefox.\nButuh info selengkapnya?", clipboard_no_support:"Tidak didukung Browser, gunakan shortcut dari keyboard.", popup_blocked:"Maaf, popup-blocker anda telah menonaktifkan jendela aplikasi yang menyediakan fungsionalitas. Nonaktifkan popup-blocker untuk sepenuhnya memanfaatkan alat ini.", invalid_data:"Error: nilai invalid, ditandai dengan dengan warna merah", more_colors:"More colors" }, contextmenu:{ align:"Alignment", left:"Kiri", center:"Tengah", right:"Kanan", full:"Penuh" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"sisipkan tanggal", inserttime_desc:"sisipkan waktu", months_long:"Januari,Februari,Maren,April,Mei,Juni,Juli,Agustus,September,Oktober,November,Desember", months_short:"Jan,Feb,Mar,Apr,Mei,Jun,Jul,Ags,Sep,Okt,Nov,Des", day_long:"Minggu,Senin,Selasa,Rabu,Kamis,Jumat,Sabtu,Minggu", day_short:"Min,Sen,Sel,Rab,Kam,Jum,Sab,Min" }, print:{ print_desc:"Cetak" }, preview:{ preview_desc:"Preview" }, directionality:{ ltr_desc:"Arah kiri ke kanan", rtl_desc:"Arah kanan ke kiri" }, layer:{ insertlayer_desc:"sisipkan layer Baru", forward_desc:"Pindah ke depan", backward_desc:"Pindah ke belakang", absolute_desc:"Beralih posisi absolut", content:"Layer baru..." }, save:{ save_desc:"Simpan", cancel_desc:"Batalkan semua perubahan" }, nonbreaking:{ nonbreaking_desc:"sisipkan karakter non-breaking space" }, iespell:{ iespell_desc:"Jalankan spell checking", download:"ieSpell tidak terdeteksi. Instal sekarang?" }, advhr:{ advhr_desc:"Horizontal rule" }, emotions:{ emotions_desc:"Emotions" }, searchreplace:{ search_desc:"Cari", replace_desc:"Cari/Ganti" }, advimage:{ image_desc:"sisipkan/Ubah Gambar" }, advlink:{ link_desc:"Sisipkan/Ubah link" }, xhtmlxtras:{ cite_desc:"Kutipan", abbr_desc:"Singkatan/Kependekan Kata", acronym_desc:"Akronim", del_desc:"Penghapusan", ins_desc:"Penyisipan", attribs_desc:"Sisip/Ubah Atribut" }, style:{ desc:"Ubah CSS Style" }, paste:{ paste_text_desc:"Paste as Plain Text", paste_word_desc:"Paste from Word", selectall_desc:"Select All" }, paste_dlg:{ text_title:"Gunakan CTRL+V pada keyboard untuk paste.", text_linebreaks:"Keep linebreaks", word_title:"Gunakan CTRL+V pada keyboard untuk paste." }, table:{ desc:"Sisipkan tabel baru", row_before_desc:"Sisipkan row sebelum", row_after_desc:"Sisipkan row sesudah", delete_row_desc:"Hapus row", col_before_desc:"Sisipkan column sebelum", col_after_desc:"Sisipkan column setelah", delete_col_desc:"Hapus column", split_cells_desc:"Pisahkan cell tabel yang di-merge", merge_cells_desc:"Merge cell tabel", row_desc:"Properti row tabel", cell_desc:"Properti cell tabel", props_desc:"Properti tabel", paste_row_before_desc:"Paste row tabel sebelum", paste_row_after_desc:"Paste row tabel sesudah", cut_row_desc:"Cut row tabel", copy_row_desc:"Copy row tabel", del:"Hapus Tabel", row:"Row", col:"Column", cell:"Cell" }, autosave:{ unload_msg:"Perubahan yang dilakukan akan hilang jika Anda pindah dari halaman ini." }, fullscreen:{ desc:"Toggle fullscreen mode" }, media:{ desc:"Insert / edit embedded media", edit:"Edit embedded media" }, fullpage:{ desc:"Properti Dokumen" }, template:{ desc:"Menyisipkan template standar isi" }, visualchars:{ desc:"Pengendalian visual karakter on/off" }, spellchecker:{ desc:"Toggle spellchecker", menu:"Pengaturan Spellchecker ", ignore_word:"Abaikan kata", ignore_words:"Abaikan semua", langs:"Bahasa", wait:"Harap tunggu...", sug:"Saran", no_sug:"Tidak ada saran", no_mpell:"Tidak ada misspellings ditemukan." }, pagebreak:{ desc:"Sisipkan page break." }}});���������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/ii.js���������������������������������������������������������0000664�0000000�0000000�00000013627�12266004471�0020252�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({ii:{ common:{ edit_confirm:"\u662F\u5426\u5728\u6B64textarea\u6807\u7B7E\u5185\u4F7F\u7528\"\u6240\u89C1\u5373\u6240\u5F97\"\u6A21\u5F0F\uFF1F", apply:"\u5E94\u7528", insert:"\u63D2\u5165", update:"\u66F4\u65B0", cancel:"\u53D6\u6D88", close:"\u5173\u95ED", browse:"\u6D41\u89C8", class_name:"\u6837\u5F0F", not_set:"--\u672A\u8BBE\u7F6E--", clipboard_msg:"\u590D\u5236\u3001\u526A\u5207\u3001\u7C98\u8D34\u529F\u80FD\u5728Mozilla\u548CFirefox\u4E2D\u4E0D\u80FD\u4F7F\u7528\u3002 \n\u662F\u5426\u9700\u8981\u4E86\u89E3\u66F4\u591A\u6709\u5173\u6B64\u95EE\u9898\u7684\u8D44\u8BAF\uFF1F", clipboard_no_support:"\u8FD8\u4E0D\u652F\u63F4\u60A8\u7684\u6D41\u89C8\u5668\uFF0C\u8BF7\u4F7F\u7528\u952E\u76D8\u5FEB\u901F\u952E", popup_blocked:"\u62B1\u6B49\uFF01\u5F39\u51FA\u7A97\u53E3\u5DF2\u88AB\u963B\u6B62\uFF0C\u8BF7\u8C03\u6574\u6D41\u89C8\u5668\u8BBE\u7F6E\uFF0C\u5141\u8BB8\u6B64\u7F51\u7AD9\u53EF\u5F39\u51FA\u65B0\u7A97\u53E3\uFF0C\u4EE5\u4FBF\u4F7F\u7528\u6B64\u5DE5\u5177", invalid_data:"\u9519\u8BEF:\u65E0\u6548\u8F93\u5165\u503C\uFF0C\u5DF2\u6807\u8BB0\u4E3A\u7EA2\u8272\u3002", more_colors:"\u66F4\u591A\u989C\u8272" }, contextmenu:{ align:"\u5BF9\u9F50\u65B9\u5F0F", left:"\u9760\u5DE6\u5BF9\u9F50", center:"\u5C45\u4E2D\u5BF9\u9F50", right:"\u9760\u53F3\u5BF9\u9F50", full:"\u4E24\u7AEF\u5BF9\u9F50" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"\u63D2\u5165\u4ECA\u5929\u65E5\u671F", inserttime_desc:"\u63D2\u5165\u73B0\u5728\u65F6\u95F4", months_long:"\u4E00\u6708,\u4E8C\u6708,\u4E09\u6708,\u56DB\u6708,\u4E94\u6708,\u516D\u6708,\u4E03\u6708,\u516B\u6708,\u4E5D\u6708,\u5341\u6708,\u5341\u4E00\u6708,\u5341\u4E8C\u6708", months_short:"1\u6708,2\u6708,3\u6708,4\u6708,5\u6708,6\u6708,7\u6708,8\u6708,9\u6708,10\u6708,11\u6708,12\u6708", day_long:"\u661F\u671F\u65E5,\u661F\u671F\u4E00,\u661F\u671F\u4E8C,\u661F\u671F\u4E09,\u661F\u671F\u56DB,\u661F\u671F\u4E94,\u661F\u671F\u516D,\u661F\u671F\u65E5", day_short:"\u5468\u65E5,\u5468\u4E00,\u5468\u4E8C,\u5468\u4E09,\u5468\u56DB,\u5468\u4E94,\u5468\u516D,\u5468\u65E5" }, print:{ print_desc:"\u5217\u5370" }, preview:{ preview_desc:"\u9884\u89C8" }, directionality:{ ltr_desc:"\u6587\u5B57\u4ECE\u5DE6\u5230\u53F3", rtl_desc:"\u6587\u5B57\u4ECE\u53F3\u5230\u5DE6" }, layer:{ insertlayer_desc:"\u63D2\u5165\u5C42", forward_desc:"\u7F6E\u524D", backward_desc:"\u7F6E\u540E", absolute_desc:"\u5F00\u5173\u7EDD\u5BF9\u4F4D\u7F6E", content:"\u65B0\u589E\u5C42..." }, save:{ save_desc:"\u4FDD\u5B58", cancel_desc:"\u53D6\u6D88\u6240\u6709\u66F4\u6539" }, nonbreaking:{ nonbreaking_desc:"\u63D2\u5165\u7A7A\u767D\u683C" }, iespell:{ iespell_desc:"\u62FC\u5199\u68C0\u67E5", download:"\u672A\u68C0\u6D4B\u5230ieSpell\u7684\u5B58\u5728\u3002\u662F\u5426\u73B0\u5728\u7ACB\u5373\u5B89\u88C5\uFF1F" }, advhr:{ advhr_desc:"\u6C34\u5E73\u7EBF" }, emotions:{ emotions_desc:"\u56FE\u91CA" }, searchreplace:{ search_desc:"\u67E5\u627E", replace_desc:"\u67E5\u627E/\u66FF\u6362" }, advimage:{ image_desc:"\u63D2\u5165/\u7F16\u8F91\u56FE\u7247" }, advlink:{ link_desc:"\u63D2\u5165/\u7F16\u8F91\u8FDE\u7ED3" }, xhtmlxtras:{ cite_desc:"\u5F15\u6587", abbr_desc:"\u7F29\u5199", acronym_desc:"\u9996\u5B57\u7F29\u5199", del_desc:"\u5220\u9664", ins_desc:"\u63D2\u5165", attribs_desc:"\u63D2\u5165/\u7F16\u8F91\u5C5E\u6027", attribs_delta_width:"40", attribs_delta_height:"60" }, style:{ desc:"\u7F16\u8F91CSS\u6837\u5F0F\u8868" }, paste:{ paste_text_desc:"\u4EE5\u7EAF\u6587\u5B57\u7C98\u8D34", paste_word_desc:"\u4ECEWord\u7C98\u8D34", selectall_desc:"\u5168\u9009" }, paste_dlg:{ text_title:"\u5728\u952E\u76D8\u4E0A\u540C\u65F6\u6309\u4E0BCTRL\u548CV\u952E\uFF0C\u4EE5\u7C98\u8D34\u6587\u5B57\u5230\u6B64\u7A97\u53E3\u3002", text_linebreaks:"\u4FDD\u7559\u5206\u884C\u7B26\u53F7\u53F7", word_title:"\u5728\u952E\u76D8\u4E0A\u540C\u65F6\u6309\u4E0BCTRL\u548CV\u952E\uFF0C\u4EE5\u7C98\u8D34\u6587\u5B57\u5230\u6B64\u7A97\u53E3\u3002" }, table:{ desc:"\u63D2\u5165\u65B0\u8868\u683C", row_before_desc:"\u63D2\u5165\u4E0A\u65B9\u884C", row_after_desc:"\u63D2\u5165\u4E0B\u65B9\u884C", delete_row_desc:"\u5220\u9664\u6240\u5728\u884C", col_before_desc:"\u63D2\u5165\u5DE6\u65B9\u5217", col_after_desc:"\u63D2\u5165\u53F3\u65B9\u5217", delete_col_desc:"\u5220\u9664\u6240\u5728\u5217", split_cells_desc:"\u5206\u5272\u50A8\u5B58\u683C", merge_cells_desc:"\u5408\u5E76\u50A8\u5B58\u683C", row_desc:"\u884C\u5C5E\u6027", cell_desc:"\u50A8\u5B58\u683C\u5C5E\u6027", props_desc:"\u8868\u683C\u5C5E\u6027", paste_row_before_desc:"\u8D34\u5728\u4E0A\u884C", paste_row_after_desc:"\u8D34\u5728\u4E0B\u884C", cut_row_desc:"\u526A\u5207\u9009\u62E9\u884C", copy_row_desc:"\u590D\u5236\u9009\u62E9\u884C", del:"\u5220\u9664\u8868\u683C", row:"\u884C", col:"\u5217", cell:"\u50A8\u5B58\u683C", cellprops_delta_width:"10", cellprops_delta_height:"10", table_delta_width:"40", table_delta_height:"60", merge_cells_delta_width:"40", merge_cells_delta_height:"40" }, autosave:{ unload_msg:"\u5982\u679C\u79BB\u5F00\u6B64\u9875\u9762\u5C06\u5BFC\u81F4\u6240\u505A\u7684\u66F4\u6539\u5168\u90E8\u4E22\u5931\u3002" }, fullscreen:{ desc:"\u5F00\u5173\u5168\u5C4F\u6A21\u5F0F" }, media:{ desc:"\u63D2\u5165/\u7F16\u8F91\u5D4C\u5165\u5A92\u4F53", edit:"\u7F16\u8F91\u5D4C\u5165\u5A92\u4F53" }, fullpage:{ desc:"\u6863\u6848\u5C5E\u6027" }, template:{ desc:"\u63D2\u5165\u9884\u5B9A\u7684\u8303\u672C\u5185\u5BB9" }, visualchars:{ desc:"\u663E\u793A\u63A7\u5236\u7B26\u53F7\u5F00/\u5173\u3002" }, spellchecker:{ desc:"\u5F00\u5173\u62FC\u5199\u68C0\u67E5", menu:"\u62FC\u5199\u68C0\u67E5\u8BBE\u7F6E", ignore_word:"\u7565\u8FC7", ignore_words:"\u5168\u90E8\u7565\u8FC7", langs:"\u8BED\u8A00", wait:"\u8BF7\u7A0D\u5019...", sug:"\u63A8\u8350\u5B57\u8BCD", no_sug:"\u65E0\u62FC\u5199\u63A8\u8350", no_mpell:"\u672A\u53D1\u73B0\u62FC\u5199\u9519\u8BEF" }, pagebreak:{ desc:"\u63D2\u5165\u5206\u9875\u7B26\u53F7" }}});���������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/is.js���������������������������������������������������������0000664�0000000�0000000�00000010637�12266004471�0020262�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({is:{ common:{ edit_confirm:"Viltu nota WYSIWYG ritil fyrir \u00FEetta textasv\u00E6\u00F0i?", apply:"Sta\u00F0festa", insert:"Setja inn", update:"Uppf\u00E6ra", cancel:"H\u00E6tta vi\u00F0", close:"Loka", browse:"Gramsa", class_name:"Klasi", not_set:"-- Ekki skilgreint --", clipboard_msg:"Afrita/Klippa/L\u00EDma er ekki a\u00F0gengilegt \u00ED Mozilla og Firefox eins og er.\nViltu f\u00E1 n\u00E1nari uppl\u00FDsingar?", clipboard_no_support:"Ekki stutt \u00ED \u00FE\u00EDnum vefsko\u00F0ara, nota\u00F0ur fl\u00FDtilykla \u00ED sta\u00F0inn.", popup_blocked:"Afsaki\u00F0, uppsprettuv\u00F6rnin \u00FE\u00EDn (popup blocker) hefur blokka\u00F0 glugga sem er hluti af ritlinum. \u00DE\u00FA ver\u00F0ur a\u00F0 sl\u00F6kkva \u00E1 uppsprettuv\u00F6rn til a\u00F0 geta nota\u00F0 \u00FEennan ritil.", invalid_data:"Villa: Vitlaus gildi slegin inn, \u00FEau eru merkt me\u00F0 rau\u00F0u.", more_colors:"Fleiri litir" }, contextmenu:{ align:"J\u00F6fnun", left:"Vinstri", center:"Mi\u00F0ja", right:"H\u00E6gri", full:"Full" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"Setja inn dagsetningu", inserttime_desc:"Setja inn t\u00EDmasetningu", months_long:"Jan\u00FAar,Febr\u00FAar,Mars,Apr\u00EDl,Ma\u00ED,J\u00FAn\u00ED,J\u00FAl\u00ED,\u00C1g\u00FAst,September,Okt\u00F3ber,N\u00F3vember,Desember", months_short:"Jan,Feb,Mar,Apr,Ma\u00ED,J\u00FAn,J\u00FAl,\u00C1gs,Sep,Okt,N\u00F3v,Des", day_long:"Sunnudagur,M\u00E1nudagur,\u00DEri\u00F0judagur,Mi\u00F0vikudagur,Fimmtudagur,F\u00F6studagur,Laugardagur,Sunnudagur", day_short:"Sun,M\u00E1n,\u00DEri,Mi\u00F0,Fim,F\u00F6s,Lau,Sun" }, print:{ print_desc:"Prenta" }, preview:{ preview_desc:"Forsko\u00F0a" }, directionality:{ ltr_desc:"Fr\u00E1 vinstri til h\u00E6gri", rtl_desc:"Fr\u00E1 h\u00E6gri til vinstri" }, layer:{ insertlayer_desc:"Setja inn n\u00FDtt lag", forward_desc:"F\u00E6ra framfyrir", backward_desc:"F\u00E6ra afturfyrir", absolute_desc:"Taka af/setja \u00E1 absolute positioning", content:"N\u00FDtt lag..." }, save:{ save_desc:"Vista", cancel_desc:"H\u00E6tta vi\u00F0 allar breytingar" }, nonbreaking:{ nonbreaking_desc:"Setja inn bil staf" }, iespell:{ iespell_desc:"Lesa yfir", download:"ieSpell fannst ekki. Viltu setja \u00FEa\u00F0 inn n\u00FAna?" }, advhr:{ advhr_desc:"Horizontal rule" }, emotions:{ emotions_desc:"Broskarlar" }, searchreplace:{ search_desc:"Finna", replace_desc:"Finna/Skipta \u00FAt" }, advimage:{ image_desc:"Setja inn/breyta mynd" }, advlink:{ link_desc:"Insert/edit link" }, xhtmlxtras:{ cite_desc:"Citation", abbr_desc:"Abbreviation", acronym_desc:"Acronym", del_desc:"Deletion", ins_desc:"Insertion", attribs_desc:"Insert/Edit Attributes" }, style:{ desc:"Edit CSS Style" }, paste:{ paste_text_desc:"Paste as Plain Text", paste_word_desc:"Paste from Word", selectall_desc:"Select All" }, paste_dlg:{ text_title:"Use CTRL+V on your keyboard to paste the text into the window.", text_linebreaks:"Keep linebreaks", word_title:"Use CTRL+V on your keyboard to paste the text into the window." }, table:{ desc:"Inserts a new table", row_before_desc:"Insert row before", row_after_desc:"Insert row after", delete_row_desc:"Delete row", col_before_desc:"Insert column before", col_after_desc:"Insert column after", delete_col_desc:"Remove column", split_cells_desc:"Split merged table cells", merge_cells_desc:"Merge table cells", row_desc:"Table row properties", cell_desc:"Table cell properties", props_desc:"Table properties", paste_row_before_desc:"Paste table row before", paste_row_after_desc:"Paste table row after", cut_row_desc:"Cut table row", copy_row_desc:"Copy table row", del:"Delete table", row:"Row", col:"Column", cell:"Cell" }, autosave:{ unload_msg:"The changes you made will be lost if you navigate away from this page." }, fullscreen:{ desc:"Toggle fullscreen mode" }, media:{ desc:"Insert / edit embedded media", edit:"Edit embedded media" }, fullpage:{ desc:"Document properties" }, template:{ desc:"Insert predefined template content" }, visualchars:{ desc:"Visual control characters on/off." }, spellchecker:{ desc:"Toggle spellchecker", menu:"Spellchecker settings", ignore_word:"Ignore word", ignore_words:"Ignore all", langs:"Languages", wait:"Please wait...", sug:"Suggestions", no_sug:"No suggestions", no_mpell:"No misspellings found." }, pagebreak:{ desc:"Insert page break." }}});�������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/it.js���������������������������������������������������������0000664�0000000�0000000�00000010605�12266004471�0020256�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({it:{ common:{ edit_confirm:"Usare la modalit\u00E0 WYSIWYG per questa textarea?", apply:"Applica", insert:"Inserisci", update:"Aggiorna", cancel:"Annulla", close:"Chiudi", browse:"Sfoglia", class_name:"Classe", not_set:"-- Non impostato --", clipboard_msg:"Copia/Taglia/Incolla non \u00E8 disponibile in Mozilla e Firefox.\nSi desidera avere maggiori informazioni su questo problema?", clipboard_no_support:"Attualmente non supportato dal browser in uso, usare le scorciatoie da tastiera.", popup_blocked:"Spiacente, ma il blocco delle popup ha disabilitato una finestra che fornisce funzionalit\u00E0 dell'applicazione. Si deve disabilitare il blocco delle popup per questo sito per poter utlizzare appieno questo strumento.", invalid_data:"Errore: valori inseriti non validi, sono marcati in rosso.", more_colors:"Colori aggiuntivi" }, contextmenu:{ align:"Allineamento", left:"Allinea a sinistra", center:"Centra", right:"Allinea a destra", full:"Giustifica" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"Inserisci data", inserttime_desc:"Inserisci ora", months_long:"Gennaio,Febbraio,Marzo,Aprile,Maggio,Giugno,Luglio,Agosto,Settembre,Ottobre,Novembre,Dicembre", months_short:"Gen,Feb,Mar,Apr,Mag,Giu,Lug,Ago,Set,Ott,Nov,Dic", day_long:"Domenica,Luned\u00EC,Marted\u00EC,Mercoled\u00EC,Gioved\u00EC,Venerd\u00EC,Sabato,Domenica", day_short:"Dom,Lun,Mar,Mer,Gio,Ven,Sab,Dom" }, print:{ print_desc:"Stampa" }, preview:{ preview_desc:"Anteprima" }, directionality:{ ltr_desc:"Direzione da sinistra a destra", rtl_desc:"Direzione da destra a sinistra" }, layer:{ insertlayer_desc:"Inserisci nuovo layer", forward_desc:"Porta in rilievo", backward_desc:"Porta in sfondo", absolute_desc:"Attiva/Disattiva posizionamento assoluto", content:"Nuovo layer..." }, save:{ save_desc:"Save", cancel_desc:"Cancella tutte le modifiche" }, nonbreaking:{ nonbreaking_desc:"Inserisci uno spazio" }, iespell:{ iespell_desc:"Esegui controllo ortografico", download:"ieSpell non rilevato. Installarlo ora?" }, advhr:{ advhr_desc:"Riga orizzontale" }, emotions:{ emotions_desc:"Faccine" }, searchreplace:{ search_desc:"Trova", replace_desc:"Trova/Sostituisci" }, advimage:{ image_desc:"Inserisci/modifica immagine" }, advlink:{ link_desc:"Inserisci/modifica collegamento" }, xhtmlxtras:{ cite_desc:"Citazione", abbr_desc:"Abbreviazione", acronym_desc:"Acronimo", del_desc:"Cancellamento", ins_desc:"Inserimento", attribs_desc:"Inserisci/modifica attributi" }, style:{ desc:"Modifica stile CSS" }, paste:{ paste_text_desc:"Incolla come testo semplice", paste_word_desc:"Incolla da Word", selectall_desc:"Seleziona tutto" }, paste_dlg:{ text_title:"Premere CTRL+V sulla tastiera per incollare il testo nella finestra.", text_linebreaks:"Mantieni interruzioni di riga", word_title:"Premere CTRL+V sulla tastiera per incollare il testo nella finestra." }, table:{ desc:"Inserisci una nuova tabella", row_before_desc:"Inserisci riga prima", row_after_desc:"Inserisci riga dopo", delete_row_desc:"Elimina riga", col_before_desc:"Inserisci colonna prima", col_after_desc:"Inserisci colonna dopo", delete_col_desc:"Elimina colonna", split_cells_desc:"Separa celle", merge_cells_desc:"Unisci celle", row_desc:"Propriet\u00E0 riga", cell_desc:"Propriet\u00E0 cella", props_desc:"Propriet\u00E0 tabella", paste_row_before_desc:"Incolla riga prima", paste_row_after_desc:"Incolla riga dopo", cut_row_desc:"Taglia riga", copy_row_desc:"Copia riga", del:"Elimina tabella", row:"Riga", col:"Colonna", cell:"Cella" }, autosave:{ unload_msg:"I cambiamenti effettuati saranno persi se si abbandona la pagina corrente." }, fullscreen:{ desc:"Attiva/disattiva modalit\u00E0 a tutto schermo" }, media:{ desc:"Inserisci/modifica file multimediale", edit:"Modifica file multimediale" }, fullpage:{ desc:"Propriet\u00E0 Documento" }, template:{ desc:"Inserisci contenuto da modello predefinito" }, visualchars:{ desc:"Attiva/disattiva caratteri di controllo visuale." }, spellchecker:{ desc:"Attiva/disattiva controllo ortografico", menu:"Impostazioni controllo ortografico", ignore_word:"Ignora parola", ignore_words:"Ignora tutto", langs:"Lingue", wait:"Attendere prego...", sug:"Suggerimenti", no_sug:"Nessun suggerimento", no_mpell:"Nessun errore rilevato." }, pagebreak:{ desc:"Inserisci intterruzione di pagina." }}});���������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/ja.js���������������������������������������������������������0000664�0000000�0000000�00000014765�12266004471�0020247�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({ja:{ common:{ edit_confirm:"WYSIWYG\u30E2\u30FC\u30C9\u306B\u5207\u308A\u66FF\u3048\u307E\u3059\u304B\uFF1F", apply:"\u9069\u7528", insert:"\u633F\u5165", update:"\u66F4\u65B0", cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB", close:"\u9589\u3058\u308B", browse:"\u53C2\u7167", class_name:"\u30AF\u30E9\u30B9", not_set:"-- \u672A\u8A2D\u5B9A --", clipboard_msg:"\u30B3\u30D4\u30FC/\u5207\u308A\u53D6\u308A/\u8CBC\u308A\u4ED8\u3051\u306FMozilla\u53CA\u3073Firefox\u3067\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002\n\u8A73\u7D30\u306F\u3053\u3061\u3089", clipboard_no_support:"\u30AF\u30EA\u30C3\u30D7\u30DC\u30FC\u30C9\u64CD\u4F5C\u306F\u304A\u4F7F\u3044\u306E\u30D6\u30E9\u30A6\u30B6\u306B\u306F\u5BFE\u5FDC\u3057\u3066\u304A\u308A\u307E\u305B\u3093\u3002\u4EE3\u308F\u308A\u306B\u30AD\u30FC\u30DC\u30FC\u30C9\u306E\u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8\u30AD\u30FC\u3092\u304A\u4F7F\u3044\u4E0B\u3055\u3044\u3002", popup_blocked:"\u30DD\u30C3\u30D7\u30A2\u30C3\u30D7\u304C\u30D6\u30ED\u30C3\u30AF\u3055\u308C\u307E\u3057\u305F\u3002\u3059\u3079\u3066\u306E\u6A5F\u80FD\u3092\u3054\u5229\u7528\u306B\u306A\u308B\u306B\u306F\u30DD\u30C3\u30D7\u30A2\u30C3\u30D7\u3092\u8A31\u53EF\u3057\u3066\u4E0B\u3055\u3044\u3002", invalid_data:"\u30A8\u30E9\u30FC: \u5165\u529B\u306B\u8AA4\u308A\u304C\u3042\u308A\u307E\u3059\u3002\uFF08\u8D64\u5B57\u306E\u9805\u76EE\uFF09", more_colors:"\u305D\u306E\u4ED6\u306E\u8272" }, contextmenu:{ align:"\u914D\u7F6E", left:"\u5DE6\u63C3\u3048", center:"\u4E2D\u592E\u63C3\u3048", right:"\u53F3\u63C3\u3048", full:"\u5747\u7B49\u5272\u4ED8" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"\u65E5\u4ED8\u306E\u633F\u5165", inserttime_desc:"\u6642\u523B\u306E\u633F\u5165", months_long:"January,February,March,April,May,June,July,August,September,October,November,December", months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", day_long:"\u65E5\u66DC\u65E5,\u6708\u66DC\u65E5,\u706B\u66DC\u65E5,\u6C34\u66DC\u65E5,\u6728\u66DC\u65E5,\u91D1\u66DC\u65E5,\u571F\u66DC\u65E5,\u65E5\u66DC\u65E5", day_short:"(\u65E5),(\u6708),(\u706B),(\u6C34),(\u6728),(\u91D1),(\u571F),(\u65E5)" }, print:{ print_desc:"\u5370\u5237" }, preview:{ preview_desc:"\u30D7\u30EC\u30D3\u30E5\u30FC" }, directionality:{ ltr_desc:"\u5DE6\u304B\u3089\u53F3", rtl_desc:"\u53F3\u304B\u3089\u5DE6" }, layer:{ insertlayer_desc:"\u65B0\u898F\u30EC\u30A4\u30E4\u30FC\u306E\u633F\u5165", forward_desc:"\u524D\u9762\u3078\u79FB\u52D5", backward_desc:"\u80CC\u9762\u3078\u79FB\u52D5", absolute_desc:"\u7D76\u5BFE\u4F4D\u7F6E\u6307\u5B9A\u306E\u5207\u66FF", content:"\u65B0\u898F\u30EC\u30A4\u30E4\u30FC" }, save:{ save_desc:"\u4FDD\u5B58", cancel_desc:"\u5168\u3066\u306E\u5909\u66F4\u3092\u7834\u68C4" }, nonbreaking:{ nonbreaking_desc:"\u6539\u884C\u306A\u3057\u30B9\u30DA\u30FC\u30B9\u306E\u633F\u5165" }, iespell:{ iespell_desc:"\u30B9\u30DA\u30EB\u30C1\u30A7\u30C3\u30AF", download:"ieSpell\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002\u4ECA\u3059\u3050\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u307E\u3059\u304B\uFF1F" }, advhr:{ advhr_desc:"\u6C34\u5E73\u7DDA" }, emotions:{ emotions_desc:"\u8868\u60C5\u30A2\u30A4\u30B3\u30F3" }, searchreplace:{ search_desc:"\u691C\u7D22", replace_desc:"\u691C\u7D22/\u7F6E\u63DB" }, advimage:{ image_desc:"\u753B\u50CF\u306E\u633F\u5165/\u7DE8\u96C6" }, advlink:{ link_desc:"\u30EA\u30F3\u30AF\u306E\u633F\u5165/\u7DE8\u96C6" }, xhtmlxtras:{ cite_desc:"\u5F15\u7528", abbr_desc:"\u7565\u8A9E", acronym_desc:"\u982D\u5B57\u8A9E", del_desc:"\u524A\u9664", ins_desc:"\u633F\u5165", attribs_desc:"\u5C5E\u6027\u306E\u633F\u5165/\u7DE8\u96C6" }, style:{ desc:"CSS\u7DE8\u96C6" }, paste:{ paste_text_desc:"\u30C6\u30AD\u30B9\u30C8\u3068\u3057\u3066\u8CBC\u308A\u4ED8\u3051", paste_word_desc:"Word\u304B\u3089\u8CBC\u308A\u4ED8\u3051", selectall_desc:"\u5168\u3066\u9078\u629E" }, paste_dlg:{ text_title:"\u30AD\u30FC\u30DC\u30FC\u30C9\u3067CTRL+V\u3068\u5165\u529B\u3057\u30C6\u30AD\u30B9\u30C8\u3092\u8CBC\u308A\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044\u3002", text_linebreaks:"\u6539\u884C\u3092\u4FDD\u6301\u3059\u308B", word_title:"\u30AD\u30FC\u30DC\u30FC\u30C9\u3067CTRL+V\u3068\u5165\u529B\u3057\u30C6\u30AD\u30B9\u30C8\u3092\u8CBC\u308A\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044\u3002" }, table:{ desc:"\u8868\u3092\u633F\u5165", row_before_desc:"\u884C\u3092\u4E0A\u306B\u633F\u5165", row_after_desc:"\u884C\u3092\u4E0B\u306B\u633F\u5165", delete_row_desc:"\u884C\u3092\u524A\u9664", col_before_desc:"\u5217\u3092\u5DE6\u306B\u633F\u5165", col_after_desc:"\u5217\u3092\u53F3\u306B\u633F\u5165", delete_col_desc:"\u5217\u3092\u524A\u9664", split_cells_desc:"\u30BB\u30EB\u306E\u7D50\u5408\u3092\u89E3\u9664", merge_cells_desc:"\u30BB\u30EB\u3092\u7D50\u5408", row_desc:"\u884C\u306E\u30D7\u30ED\u30D1\u30C6\u30A3", cell_desc:"\u30BB\u30EB\u306E\u30D7\u30ED\u30D1\u30C6\u30A3", props_desc:"\u8868\u306E\u30D7\u30ED\u30D1\u30C6\u30A3", paste_row_before_desc:"\u884C\u3092\u4E0A\u306B\u8CBC\u308A\u4ED8\u3051", paste_row_after_desc:"\u884C\u3092\u4E0B\u306B\u8CBC\u308A\u4ED8\u3051", cut_row_desc:"\u884C\u306E\u5207\u308A\u53D6\u308A", copy_row_desc:"\u884C\u306E\u30B3\u30D4\u30FC", del:"\u8868\u3092\u524A\u9664", row:"\u884C", col:"\u5217", cell:"\u30BB\u30EB" }, autosave:{ unload_msg:"\u4ED6\u306E\u30DA\u30FC\u30B8\u3078\u79FB\u52D5\u3059\u308B\u3068\u7DE8\u96C6\u30C7\u30FC\u30BF\u306F\u3059\u3079\u3066\u7834\u68C4\u3055\u308C\u307E\u3059\u3002" }, fullscreen:{ desc:"\u30D5\u30EB\u30B9\u30AF\u30EA\u30FC\u30F3" }, media:{ desc:"\u57CB\u3081\u8FBC\u307F\u30E1\u30C7\u30A3\u30A2\u306E\u633F\u5165/\u7DE8\u96C6", edit:"\u57CB\u3081\u8FBC\u307F\u30E1\u30C7\u30A3\u30A2\u306E\u7DE8\u96C6" }, fullpage:{ desc:"\u30DA\u30FC\u30B8\u8A2D\u5B9A" }, template:{ desc:"\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306E\u633F\u5165" }, visualchars:{ desc:"\u5236\u5FA1\u6587\u5B57\u306E\u8868\u793A" }, spellchecker:{ desc:"\u30B9\u30DA\u30EB\u30C1\u30A7\u30C3\u30AFOn/Off", menu:"\u30B9\u30DA\u30EB\u30C1\u30A7\u30C3\u30AF\u8A2D\u5B9A", ignore_word:"\u3053\u306E\u5358\u8A9E\u3092\u7121\u8996", ignore_words:"\u5168\u3066\u7121\u8996", langs:"\u8A00\u8A9E", wait:"\u3057\u3070\u3089\u304F\u304A\u5F85\u3061\u304F\u3060\u3055\u3044...", sug:"\u5019\u88DC", no_sug:"\u5019\u88DC\u306F\u6709\u308A\u307E\u305B\u3093\u3002", no_mpell:"\u30B9\u30DA\u30EB\u30DF\u30B9\u306F\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002" }, pagebreak:{ desc:"\u6539\u30DA\u30FC\u30B8\u633F\u5165" }}});�����������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/ko.js���������������������������������������������������������0000664�0000000�0000000�00000013743�12266004471�0020261�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({ko:{ common:{ edit_confirm:"WYSIWYG\uBAA8\uB4DC\uB85C \uC804\uD658\uD569\uB2C8\uAE4C?", apply:"\uC801\uC6A9", insert:"\uC0BD\uC785", update:"\uAC31\uC2E0", cancel:"\uCDE8\uC18C", close:"\uB2EB\uAE30", browse:"\uBE0C\uB77C\uC6B0\uC988", class_name:"\uD074\uB798\uC2A4", not_set:"-- \uC5C6\uC74C --", clipboard_msg:"\uBCF5\uC0AC/\uC798\uB77C\uB0B4\uAE30/\uBD99\uC774\uAE30\uB294 Mozilla \uBC0FFirefox \uC5D0\uC11C \uC0AC\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n\uC0C1\uC138\uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uAE4C?", clipboard_no_support:"\uC774 \uAE30\uB2A5\uC740 \uBE0C\uB77C\uC6B0\uC800\uC5D0 \uC758\uD574 \uC81C\uD55C\uB418\uACE0 \uC788\uC2B5\uB2C8\uB2E4. \uB2E8\uCD95\uD0A4\uC744 \uC774\uC6A9\uD558\uC2ED\uC2DC\uC624.", popup_blocked:"\uD31D\uC5C5\uC774 \uCC28\uB2E8\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uBAA8\uB4E0 \uAE30\uB2A5\uC744 \uC774\uC6A9\uD558\uC2DC\uAE30 \uC704\uD574\uC11C\uB294 \uD31D\uC5C5\uCC28\uB2E8\uC744 \uD574\uC81C\uD574 \uC8FC\uC138\uC694.", invalid_data:"\uC5D0\uB7EC: \uC720\uD6A8\uD558\uC9C0 \uC54A\uB294 \uAE00\uC790\uAC00 \uC788\uC2B5\uB2C8\uB2E4. \uBE68\uAC04\uC0C9\uC73C\uB85C \uD45C\uC2DC\uB429\uB2C8\uB2E4.", more_colors:"\uADF8 \uC678\uC758 \uC0C9" }, contextmenu:{ align:"\uC815\uB82C", left:"\uC67C\uCABD \uC815\uB82C", center:"\uAC00\uC6B4\uB370 \uC815\uB82C", right:"\uC624\uB978\uCABD \uC815\uB82C", full:"\uBC30\uBD84 \uC815\uB82C" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"\uB0A0\uC9DC \uC0BD\uC785", inserttime_desc:"\uC2DC\uAC04 \uC0BD\uC785", months_long:"1\uC6D4,2\uC6D4,3\uC6D4,4\uC6D4,5\uC6D4,6\uC6D4,7\uC6D4,8\uC6D4,9\uC6D4,10\uC6D4,11\uC6D4,12\uC6D4", months_short:"1,2,3,4,5,6,7,8,9,10,11,12", day_long:"\uC77C\uC694\uC77C,\uC6D4\uC694\uC77C,\uD654\uC694\uC77C,\uC218\uC694\uC77C,\uBAA9\uC694\uC77C,\uAE08\uC694\uC77C,\uD1A0\uC694\uC77C,\uC77C\uC694\uC77C", day_short:"\uC77C,\uC6D4,\uD654,\uC218,\uBAA9,\uAE08,\uD1A0,\uC77C" }, print:{ print_desc:"\uC778\uC1C4" }, preview:{ preview_desc:"\uBBF8\uB9AC\uBCF4\uAE30" }, directionality:{ ltr_desc:"\uBB38\uC790\uBC29\uD5A5\uC744 \uC67C\uCABD\uC5D0\uC11C \uC624\uB978\uCABD\uC73C\uB85C", rtl_desc:"\uBB38\uC790\uBC29\uD5A5\uC744 \uC624\uB978\uCABD\uC5D0\uC11C \uC67C\uCABD\uC73C\uB85C" }, layer:{ insertlayer_desc:"\uC0C8 \uB808\uC774\uC5B4", forward_desc:"\uC55E\uC73C\uB85C \uC774\uB3D9", backward_desc:"\uB4A4\uB85C \uC774\uB3D9", absolute_desc:"\uC808\uB300\uC704\uCE58\uB85C \uC804\uD658", content:"\uC0C8 \uB808\uC774\uC5B4..." }, save:{ save_desc:"\uC800\uC7A5", cancel_desc:"\uBAA8\uB450 \uCDE8\uC18C" }, nonbreaking:{ nonbreaking_desc:"\uBE48\uCE78 \uC0BD\uC785" }, iespell:{ iespell_desc:"\uCCA0\uC790 \uAC80\uC0AC", download:"ieSpell\uC774 \uBC1C\uACAC\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.\n\uC778\uC2A4\uD1A8 \uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?" }, advhr:{ advhr_desc:"\uAD6C\uBD84\uC120" }, emotions:{ emotions_desc:"\uC774\uBAA8\uD2F0\uCF58" }, searchreplace:{ search_desc:"\uAC80\uC0C9", replace_desc:"\uAC80\uC0C9/\uCE58\uD658" }, advimage:{ image_desc:"\uC774\uBBF8\uC9C0\uC758 \uC0BD\uC785/\uD3B8\uC9D1" }, advlink:{ link_desc:"\uB9C1\uD06C\uC758 \uC0BD\uC785/\uD3B8\uC9D1" }, xhtmlxtras:{ cite_desc:"\uC778\uC6A9\uCC98", abbr_desc:"\uC57D\uAE30", acronym_desc:"\uBA38\uB9AC \uAE00\uC790\uC5B4", del_desc:"\uC0AD\uC81C", ins_desc:"\uC0BD\uC785", attribs_desc:"\uC18D\uC131 \uC0BD\uC785/\uD3B8\uC9D1" }, style:{ desc:"CSS\uD3B8\uC9D1" }, paste:{ paste_text_desc:"\uD14D\uC2A4\uD2B8\uCC98\uB7FC \uBD99\uC5EC\uB123\uAE30", paste_word_desc:"Word\uB85C\uBD80\uD130 \uBD99\uC5EC\uB123\uAE30", selectall_desc:"\uBAA8\uB450 \uC120\uD0DD" }, paste_dlg:{ text_title:"\uC708\uB3C4\uC6B0\uC5D0 \uD14D\uC2A4\uD2B8\uB97C \uBD99\uC774\uB824\uBA74 \uD0A4\uBCF4\uB4DC\uB85C Ctrl+V\uB97C \uC785\uB825\uD574 \uC8FC\uC138\uC694.", text_linebreaks:"\uAC1C\uD589\uC744 \uBCF4\uAD00 \uC720\uC9C0", word_title:"\uC708\uB3C4\uC6B0\uC5D0 \uD14D\uC2A4\uD2B8\uB97C \uBD99\uC774\uB824\uBA74 \uD0A4\uBCF4\uB4DC\uB85CCtrl+V\uB97C \uC785\uB825\uD574 \uC8FC\uC138\uC694." }, table:{ desc:"\uC0C8 \uD14C\uC774\uBE14 \uC0BD\uC785", row_before_desc:"\uC55E\uC5D0 \uD589 \uC0BD\uC785", row_after_desc:"\uB4A4\uC5D0 \uD589 \uC0BD\uC785", delete_row_desc:"\uD589 \uC0AD\uC81C", col_before_desc:"\uC55E\uC5D0 \uC5F4\uC0BD\uC785", col_after_desc:"\uB4A4\uC5D0 \uC5F4\uC0BD\uC785", delete_col_desc:"\uC5F4\uC0AD\uC81C", split_cells_desc:"\uACB0\uD569\uB41C \uC140\uC744 \uBD84\uD560", merge_cells_desc:"\uC140\uC744 \uACB0\uD569", row_desc:"\uD589\uC758 \uC18D\uC131", cell_desc:"\uC140\uC758 \uC18D\uC131", props_desc:"\uD14C\uC774\uBE14 \uC18D\uC131", paste_row_before_desc:"\uC55E\uC5D0 \uD589\uC744 \uBD99\uC5EC\uB123\uAE30", paste_row_after_desc:"\uB4A4\uB85C \uD589\uC744 \uBD99\uC5EC\uB123\uAE30", cut_row_desc:"\uD589\uC744 \uC798\uB77C\uB0B4\uAE30", copy_row_desc:"\uD589\uC744 \uBCF5\uC0AC", del:"\uD14C\uC774\uBE14 \uC0AD\uC81C", row:"\uD589", col:"\uC5F4", cell:"\uC140" }, autosave:{ unload_msg:"\uB2E4\uB978 \uD398\uC774\uC9C0\uB85C \uC774\uB3D9\uD558\uBA74 \uD3B8\uC9D1\uD55C \uB0B4\uC6A9\uC774 \uCDE8\uC18C\uB429\uB2C8\uB2E4." }, fullscreen:{ desc:"\uC804\uCCB4\uD654\uBA74" }, media:{ desc:"\uBBF8\uB514\uC5B4\uC758 \uC0BD\uC785/\uD3B8\uC9D1", edit:"\uBBF8\uB514\uC5B4\uC758 \uD3B8\uC9D1" }, fullpage:{ desc:"\uD398\uC774\uC9C0\uC758 \uC18D\uC131" }, template:{ desc:"\uC815\uC758\uAC00 \uB05D\uB09C \uD15C\uD50C\uB9BF\uC758 \uC0BD\uC785" }, visualchars:{ desc:"\uC81C\uC5B4 \uBB38\uC790\uC758 \uD45C\uC2DC \uC804\uD658" }, spellchecker:{ desc:"\uC2A4\uD3A0\uB9C1 \uC804\uD658", menu:"\uC2A4\uD3A0\uB9C1 \uC124\uC815", ignore_word:"\uC774 \uC5B4\uAD6C\uB97C \uBB34\uC2DC", ignore_words:"\uBAA8\uB450 \uBB34\uC2DC", langs:"\uC5B8\uC5B4", wait:"\uAE30\uB2E4\uB824 \uC8FC\uC138\uC694...", sug:"\uD6C4\uBCF4", no_sug:"\uD6C4\uBCF4 \uC5C6\uC74C", no_mpell:"\uC624\uD0C8\uC790\uAC00 \uBC1C\uACAC\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4." }, pagebreak:{ desc:"\uC0C8\uD398\uC774\uC9C0 \uC0BD\uC785" }}});�����������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/lt.js���������������������������������������������������������0000664�0000000�0000000�00000013754�12266004471�0020271�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({lt:{ common:{ edit_confirm:"Ar norite naudoti tekst\u0173 redaktoriaus re\u017Eim\u0105 \u0161iam teksto redagavimo langui?", apply:"Taikyti", insert:"\u012Eterpti", update:"Atnaujinti", cancel:"Atsisakyti", close:"U\u017Everti", browse:"Nar\u0161yti", class_name:"Klas\u0117", not_set:"-- Nenurodyta --", clipboard_msg:"Kopijavimas/i\u0161kirpimas/\u012Fd\u0117jimas paspaudus \u0161\u012F mygtuk\u0105 negalimas Mozilla ir Firefox nar\u0161ykl\u0117se.\nNukopijuoti galima paspaudus: Ctrl + C, i\u0161kirpti: Ctrl + X, \u012Fd\u0117ti: Ctrl + V.\nAr norite daugiau informacijos apie \u0161i\u0105 problem\u0105?", clipboard_no_support:"\u0160i nar\u0161ykl\u0117 nepalaiko \u0161io veikimo, tod\u0117l naudokite klaviat\u016Bros spar\u010Diuosius klavi\u0161us.", popup_blocked:"Atsipra\u0161ome, ta\u010Diau pasteb\u0117jome, kad j\u016Bs\u0173 i\u0161kylan\u010Di\u0173 lang\u0173 blokavimo programa i\u0161jung\u0117 lang\u0105, kuris teikia aplikacijai funkcionalum\u0105. Tur\u0117tum\u0117te atjungti i\u0161kylan\u010Di\u0173 lang\u0173 blokavim\u0105 \u0161iam tinklalapiui, kad i\u0161naudotum\u0117te visas galimybes.", invalid_data:"Klaida: Blogai \u012Fvestos reik\u0161m\u0117s, kurios pa\u017Eym\u0117tos raudonai.", more_colors:"Daugiau spalv\u0173" }, contextmenu:{ align:"Lygiavimas", left:"Kair\u0117je", center:"Centre", right:"De\u0161in\u0117je", full:"I\u0161 abiej\u0173 pusi\u0173" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"\u012Eterpti dat\u0105", inserttime_desc:"\u012Eterpti laik\u0105", months_long:"Sausis,Vasaris,Kovas,Balandis,Gegu\u017E\u0117,Bir\u017Eelis,Liepa,Rugpj\u016Btis,Rugs\u0117jis,Spalis,Lapkritis,Gruodis", months_short:"Sau,Vas,Kov,Bal,Geg,Bir,Lie,Rugpj,Rugs,Spa,Lapkr,Gruo", day_long:"Sekmadienis,Pirmadienis,Antradienis,Tre\u010Diadienis,Ketvirtadienis,Penktadienis,\u0160e\u0161tadienis,Sekmadienis", day_short:"Sekm,Pirm,Antr,Tre\u010D,Ketv,Penk,\u0160e\u0161t,Sekm" }, print:{ print_desc:"Spausdinti" }, preview:{ preview_desc:"Per\u017Ei\u016Bra" }, directionality:{ ltr_desc:"Kryptis i\u0161 kair\u0117s \u012F de\u0161in\u0119", rtl_desc:"Kryptis i\u0161 de\u0161in\u0117s \u012F kair\u0119" }, layer:{ insertlayer_desc:"\u012Eterpti nauj\u0105 sluoksn\u012F", forward_desc:"Perkelti \u012F priek\u012F", backward_desc:"Perkelti atgal", absolute_desc:"Perjungti absoliut\u0173 pozicionavim\u0105", content:"Naujas sluoksnis..." }, save:{ save_desc:"I\u0161saugoti", cancel_desc:"Atsisakyti vis\u0173 pakeitim\u0173" }, nonbreaking:{ nonbreaking_desc:"\u012Eterpti jungiamojo tarpo simbol\u012F" }, iespell:{ iespell_desc:"Paleisti ra\u0161ybos tikrintuv\u0119", download:"ieSpell neaptiktas. Ar norite dabar j\u012F \u012Fdiegti?" }, advhr:{ advhr_desc:"Horizontali linija", delta_width:"10" }, emotions:{ emotions_desc:"Jaustukai" }, searchreplace:{ search_desc:"Ie\u0161koti", replace_desc:"Ie\u0161koti/Pakeisti", delta_width:"10", delta_height:"20" }, advimage:{ image_desc:"\u012Eterpti/Redaguoti paveiksl\u0117l\u012F", delta_width:"10" }, advlink:{ link_desc:"\u012Eterpti/Redaguoti nuorod\u0105", delta_width:"10" }, xhtmlxtras:{ cite_desc:"Citavimas", abbr_desc:"Santrumpa", acronym_desc:"Akronimas", del_desc:"Panaikinimas", ins_desc:"\u012Eterpimas", attribs_desc:"\u012Eterpti/Redaguoti atributus", cite_delta_width:"10", abbr_delta_width:"10", acronym_delta_width:"10", del_delta_width:"10", ins_delta_width:"10", attribs_delta_width:"10" }, style:{ desc:"Redaguoti CSS stili\u0173", delta_width:"40" }, paste:{ paste_text_desc:"\u012Ed\u0117ti kaip paprast\u0105 tekst\u0105", paste_word_desc:"\u012Ed\u0117ti i\u0161 Word", selectall_desc:"Visk\u0105 pa\u017Eym\u0117ti" }, paste_dlg:{ text_title:"Naudokite CTRL+V tekstui \u012Fd\u0117ti \u012F \u0161\u012F lang\u0105.", text_linebreaks:"Palikti eilu\u010Di\u0173 l\u016B\u017Eius", word_title:"Naudokite CTRL+V tekstui \u012Fd\u0117ti \u012F \u0161\u012F lang\u0105." }, table:{ desc:"\u012Eterpia nauj\u0105 lentel\u0119", row_before_desc:"\u012Eterpti eilut\u0119 prie\u0161", row_after_desc:"\u012Eterpti eilut\u0119 po", delete_row_desc:"\u0160alinti eilut\u0119", col_before_desc:"\u012Eterpti stulpel\u012F prie\u0161", col_after_desc:"\u012Eterpti stulpel\u012F po", delete_col_desc:"\u0160alinti stulpel\u012F", split_cells_desc:"Skaidyti sulietus lentel\u0117s langelius", merge_cells_desc:"Sujungti lentel\u0117s langelius", row_desc:"Lentel\u0117s eilut\u0117s nustatymai", cell_desc:"Lentel\u0117s langeli\u0173 nustatymai", props_desc:"Lentel\u0117s nustatymai", paste_row_before_desc:"\u012Ed\u0117ti lentel\u0117s eilut\u0119 prie\u0161", paste_row_after_desc:"\u012Ed\u0117ti lentel\u0117s eilut\u0119 po", cut_row_desc:"I\u0161kirpti lentel\u0117s eilut\u0119", copy_row_desc:"Kopijuoti lentel\u0117s eilut\u0119", del:"\u0160alinti lentel\u0119", row:"Eilut\u0117", col:"Stulpelis", cell:"Langelis", rowprops_delta_width:"10", cellprops_delta_width:"10", table_delta_width:"10", merge_cells_delta_width:"10" }, autosave:{ unload_msg:"Visi pakeitimai bus prarasti, jei i\u0161eisite i\u0161 \u0161io puslapio." }, fullscreen:{ desc:"Perjungti viso ekrano re\u017Eim\u0105" }, media:{ desc:"\u012Eterpti/redaguoti integruot\u0105 daugialyp\u0119 terp\u0119", edit:"Redaguoti integruot\u0105 daugialyp\u0119 terp\u0119", delta_width:"10" }, fullpage:{ desc:"Dokumento nustatymai", delta_width:"10" }, template:{ desc:"\u012Eterpti numatyt\u0105 \u0161ablono turin\u012F" }, visualchars:{ desc:"Vizualiniai valdymo simboliai \u012Fjungti/i\u0161jungti." }, spellchecker:{ desc:"Perjungti ra\u0161ybos tikrintuv\u0119", menu:"Ra\u0161ybos tikrintuv\u0117s nustatymai", ignore_word:"Ignoruoti \u017Eod\u012F", ignore_words:"Ignoruoti visk\u0105", langs:"Kalbos", wait:"Pra\u0161ome palaukti...", sug:"Pasi\u016Blymai", no_sug:"Pasi\u016Blym\u0173 nerasta", no_mpell:"Klaid\u0173 nerasta." }, pagebreak:{ desc:"\u012Eterpti puslapio pabaigos \u017Eym\u0119." }}});��������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/lv.js���������������������������������������������������������0000664�0000000�0000000�00000012070�12266004471�0020261�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({lv:{ common:{ edit_confirm:"Vai tu v\u0113lies izmantot WYSIWYG \u0161im teksta laukam?", apply:"Apstiprin\u0101t", insert:"Ievietot", update:"Atjaunin\u0101t", cancel:"Atcelt", close:"Aizv\u0113rt", browse:"P\u0101rl\u016Bkot", class_name:"Klase", not_set:"-- Nav nor\u0101d\u012Bts --", clipboard_msg:"Iesp\u0113ja Kop\u0113t/Izgriezt/Iekop\u0113t nav pieejama p\u0101rl\u016Bkiem Mozilla and Firefox.\nVai J\u016Bs v\u0113laties uzzin\u0101t vair\u0101k par \u0161o probl\u0113mu?", clipboard_no_support:"\u0160obr\u012Bd J\u016Bsu p\u0101rl\u016Bks neatbalsta \u0161o iesp\u0113ju, t\u0101 viet\u0101 l\u016Bdzu izmantotjiet tastat\u016Bras sa\u012Bsin\u0101jumtausti\u0146us.", popup_blocked:"Atvainojiet, bet m\u0113s esam konstat\u0113ju\u0161i, ka J\u016Bsu uzleco\u0161o logu blo\u0137\u0113t\u0101js ir atsp\u0113jojis logu, kas nodro\u0161ina programmas funkcionalit\u0101ti. Lai piln\u012Bb\u0101 izmantotu \u0161o r\u012Bku, Jums ir j\u0101atsl\u0113dz uzleco\u0161o logu blo\u0137\u0113tajs \u0161ai vietnei. ", invalid_data:"K\u013C\u016Bda: Ievad\u012Btas neder\u012Bgas v\u0113rt\u012Bbas. T\u0101s ir atz\u012Bm\u0113tas sarkan\u0101 kr\u0101s\u0101.", more_colors:"Vair\u0101k kr\u0101su" }, contextmenu:{ align:"Novietojums", left:"Pa kreisi", center:"Centr\u0113ts", right:"Pa labi", full:"Pilns" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"Ievietot datumu", inserttime_desc:"Ievietot laiku", months_long:"Janv\u0101ris,Febru\u0101ris,Marts,Apr\u012Blis,Maijs,J\u016Bnijs,J\u016Blijs,Augusts,Seprembris,Oktobris,Novembris,Decembris", months_short:"Jan,Feb,Mar,Apr,Mai,J\u016Bn,J\u016Bl,Aug,Sep,Okt,Nov,Dec", day_long:"Sv\u0113tdiena,Pirmdiena,Otrdiena,Tre\u0161diena,Ceturtdiena,Piektdiena,Sestdiena,Sv\u0113tdiena", day_short:"Sv\u0113,Pir,Otr,Tre,Cet,Pie,Ses,Sv\u0113" }, print:{ print_desc:"Druk\u0101t" }, preview:{ preview_desc:"Priek\u0161skat\u012Bt" }, directionality:{ ltr_desc:"Virziens no kreis\u0101s uz labo", rtl_desc:"Virziens no lab\u0101s uz kreiso" }, layer:{ insertlayer_desc:"Ievietot jaunu sl\u0101ni", forward_desc:"Uz priek\u0161u", backward_desc:"Atpaka\u013C", absolute_desc:"Iestat\u012Bt/Nov\u0101kt absol\u016Bto novietojumu ", content:"Jauns sl\u0101nis..." }, save:{ save_desc:"Saglab\u0101t", cancel_desc:"Atcelt visas izmai\u0146as" }, nonbreaking:{ nonbreaking_desc:"Ievietot tuk\u0161uma simbolu" }, iespell:{ iespell_desc:"Uzs\u0101kt pareizrakst\u012Bbas p\u0101rbaudi", download:"ieSpell netika atrasts. Vai J\u016Bs v\u0113laties to uzst\u0101d\u012Bt?" }, advhr:{ advhr_desc:"Horizont\u0101la sv\u012Btra" }, emotions:{ emotions_desc:"Smaidi\u0146i" }, searchreplace:{ search_desc:"Mekl\u0113t", replace_desc:"Mekl\u0113t/Aizvietot" }, advimage:{ image_desc:"Ievietot/Redi\u0123\u0113t att\u0113lu" }, advlink:{ link_desc:"Ievietot/Redi\u0123\u0113t saiti" }, xhtmlxtras:{ cite_desc:"Cit\u0101ts", abbr_desc:"Sa\u012Bsin\u0101jums", acronym_desc:"Acronym", del_desc:"Deletion", ins_desc:"Insertion", attribs_desc:"Pielikt/redi\u0123\u0113t \u012Bpa\u0161\u012Bbas" }, style:{ desc:"Edit CSS Style" }, paste:{ paste_text_desc:"Iekop\u0113t ka parasto tekstu", paste_word_desc:"Iekop\u0113t no Word", selectall_desc:"Iez\u012Bm\u0113t visu" }, paste_dlg:{ text_title:"Izmantojiet CTRL+V uz j\u016Bsu tastat\u016Bras lai iekop\u0113t tekstu log\u0101.", text_linebreaks:"Sagl\u0101b\u0101t l\u012Bniju sadal\u012Bt\u0101jus", word_title:"Izmantojiet CTRL+V uz j\u016Bsu tastat\u016Bras lai iekop\u0113t tekstu log\u0101." }, table:{ desc:"Ielikt jaunu tabulu", row_before_desc:"Ielikt jaunu rindu priek\u0161\u0101", row_after_desc:"Ielikt jaunu rindu aiz", delete_row_desc:"Izdz\u0113st rindu", col_before_desc:"Ielikt jaunu stabu priek\u0161\u0101", col_after_desc:"Ielikt jaunu stabu aiz", delete_col_desc:"Izdz\u0113st stabu", split_cells_desc:"Sadal\u012Bt apvienotas tabules ailes", merge_cells_desc:"Apvienot tabulas ailes", row_desc:"Tabulas rindas \u012Bpa\u0161\u012Bbas", cell_desc:"Tabulas ailes \u012Bpa\u0161\u012Bbas", props_desc:"Tabulas \u012Bpa\u0161\u012Bbas", paste_row_before_desc:"Ielikt tabulas rindu priek\u0161\u0101", paste_row_after_desc:"Ielikt tabulas rindu aiz", cut_row_desc:"Izgriezt tabulas rindu", copy_row_desc:"Kop\u0113t tabulas rindu", del:"Izdz\u0113st tabulu", row:"Rinda", col:"St\u0101bs", cell:"Aile" }, autosave:{ unload_msg:"The changes you made will be lost if you navigate away from this page." }, fullscreen:{ desc:"Toggle fullscreen mode" }, media:{ desc:"Insert / edit embedded media", edit:"Edit embedded media" }, fullpage:{ desc:"Document properties" }, template:{ desc:"Insert predefined template content" }, visualchars:{ desc:"Visual control characters on/off." }, spellchecker:{ desc:"Toggle spellchecker", menu:"Spellchecker settings", ignore_word:"Ignore word", ignore_words:"Ignore all", langs:"Languages", wait:"Please wait...", sug:"Suggestions", no_sug:"No suggestions", no_mpell:"No misspellings found." }, pagebreak:{ desc:"Insert page break." }}});������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/mk.js���������������������������������������������������������0000664�0000000�0000000�00000012146�12266004471�0020253�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({mk:{ common:{ edit_confirm:"\u017Delite li koristiti WYSIWYG na\u010Din rada za ovo tekstualno polje?", apply:"Primjeni", insert:"\u0412\u043C\u0435\u0442\u043D\u0438", update:"\u041E\u0431\u043D\u043E\u0432\u0438", cancel:"\u041E\u0442\u043A\u0430\u0436\u0438", close:"\u0417\u0430\u0442\u0432\u043E\u0440\u0438", browse:"\u041F\u0440\u0435\u0432\u0437\u0435\u043C\u0438", class_name:"\u041A\u043B\u0430\u0441\u0430", not_set:"-- \u041D\u0435 \u0435 \u043F\u043E\u0441\u0442\u0430\u0432\u0435\u043D\u043E --", clipboard_msg:"\u041A\u043E\u043F\u0438\u0440\u0430\u0458/\u0421\u043D\u0438\u043C\u0438/\u0417\u0430\u043B\u0435\u043F\u0438 \u043D\u0435 \u0435 \u0434\u043E\u0437\u0432\u043E\u043B\u0435\u043D\u043E \u043D\u0430 Mozilla \u0438 Firefox \u043F\u0440\u0435\u0431\u0430\u0440\u0443\u0432\u0430\u0447\u0438.\n\u041F\u043E\u0432\u0435\u045C\u0435 \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u0438?", clipboard_no_support:"Trenuta\u010Dno va\u0161 preglednik ne podr\u017Eava ovu opciju, poku\u0161ajte koristiti tipkovni\u010Dku kraticu.", popup_blocked:"Oprostite, izgleda da je va\u0161 popup-blocker onemogu\u0107io prozor u sklopu ovog programa. Morate onemogu\u0107iti blokiranje popup prozora da bi u potpunosti iskoristili ovaj alat.", invalid_data:"Gre\u0161ka: Une\u0161ene su nevaljane vrednosti, ozna\u010Dene su crvenom bojom.", more_colors:"Vi\u0161e boja" }, contextmenu:{ align:"Poravnavanje", left:"Levo", center:"Sredina", right:"Desno", full:"Puno" }, insertdatetime:{ date_fmt:"%d.%m.%Y.", time_fmt:"%H:%M:%S", insertdate_desc:"\u0412\u043C\u0435\u0442\u043D\u0438 datum", inserttime_desc:"\u0412\u043C\u0435\u0442\u043D\u0438 vreme", months_long:"januar,februar,mart,april,maj,juni,juli,avgust,septembar,oktobar,novembar,decembar", months_short:"jan,feb,mar,apr,maj,jun,jul,avg,sep,okt,nov,dec", day_long:"nedelja,ponedjeljak,utorak,sreda,\u010Detvrtak,petak,subota,nedelja", day_short:"ned,pon,uto,sre,\u010Det,pet,sub,ned" }, print:{ print_desc:"Ispis" }, preview:{ preview_desc:"Prikaz" }, directionality:{ ltr_desc:"S leva na desno", rtl_desc:"S desna na levo" }, layer:{ insertlayer_desc:"\u0412\u043C\u0435\u0442\u043D\u0438 novi sloj", forward_desc:"Pomakni napred", backward_desc:"Pomakni natrag", absolute_desc:"Uklju\u010Di/isklju\u010Di apsolutno pozicioniranje", content:"Novi sloj..." }, save:{ save_desc:"Spremi", cancel_desc:"Odustani od svih promjena" }, nonbreaking:{ nonbreaking_desc:"\u0412\u043C\u0435\u0442\u043D\u0438 razmak" }, iespell:{ iespell_desc:"Pokreni provjeru pravopisa", download:"Provjera pravopisa nije postavljena. Postaviti sada?" }, advhr:{ advhr_desc:"Vodoravna crta" }, emotions:{ emotions_desc:"Emocije" }, searchreplace:{ search_desc:"Prona\u0111i", replace_desc:"Prona\u0111i/Zameni" }, advimage:{ image_desc:"\u0412\u043C\u0435\u0442\u043D\u0438/uredi sliku" }, advlink:{ link_desc:"Insert/edit link" }, xhtmlxtras:{ cite_desc:"Citat", abbr_desc:"Kratica", acronym_desc:"Akronim", del_desc:"Brisanje", ins_desc:"Unos", attribs_desc:"\u0412\u043C\u0435\u0442\u043D\u0438/uredi atribute" }, style:{ desc:"Uredi CSS" }, paste:{ paste_text_desc:"Zalepi kao obi\u010Dni tekst", paste_word_desc:"Zalepi iz Worda", selectall_desc:"Odaberi sve" }, paste_dlg:{ text_title:"Koristite CTRL+V na tipkovnici da zalepite tekst u prozor.", text_linebreaks:"Zadr\u017Ei prelome", word_title:"Koristite CTRL+V na tipkovnici da zalepite tekst u prozor." }, table:{ desc:"Nova tablica", row_before_desc:"\u0412\u043C\u0435\u0442\u043D\u0438 redak iznad", row_after_desc:"\u0412\u043C\u0435\u0442\u043D\u0438 redak ispod", delete_row_desc:"Izbri\u0161i redak", col_before_desc:"\u0412\u043C\u0435\u0442\u043D\u0438 stupac levo", col_after_desc:"\u0412\u043C\u0435\u0442\u043D\u0438 stupac desno", delete_col_desc:"Ukloni stupac", split_cells_desc:"Razdvoji spojene \u0107elije", merge_cells_desc:"Spoji \u0107elije", row_desc:"Svojstva retka", cell_desc:"Svojstva \u0107elije", props_desc:"Svojstva tablice", paste_row_before_desc:"Zalepi redak iznad", paste_row_after_desc:"Zalepi redak ispod", cut_row_desc:"Izre\u017Ei redak", copy_row_desc:"Kopiraj redak", del:"Izbri\u0161i tablicu", row:"Redak", col:"Stupac", cell:"\u0106elija" }, autosave:{ unload_msg:"Promjene u dokumentu \u0107e biti izgubljene ako iza\u0111ete s ove stranice." }, fullscreen:{ desc:"Uklju\u010Di/isklju\u010Di prikaz preko celog ekrana" }, media:{ desc:"Insert / edit embedded media", edit:"Edit embedded media" }, fullpage:{ desc:"Svojstva dokumenta" }, template:{ desc:"\u0412\u043C\u0435\u0442\u043D\u0438 sadr\u017Eaj iz predlo\u017Eak" }, visualchars:{ desc:"Vizuelni kontrolni znakovi uklju\u010Deni/isklju\u010Deni." }, spellchecker:{ desc:"Uklju\u010Di/isklju\u010Di provjeru pravopisa", menu:"Postavke provere pravopisa", ignore_word:"Zanemari re\u010D", ignore_words:"Zanemari sve", langs:"Jezici", wait:"Pri\u010Dekajte...", sug:"Predlozi", no_sug:"Nema predloga", no_mpell:"Nije prona\u0111ena nijedna pravopisna gre\u0161ka." }, pagebreak:{ desc:"\u0412\u043C\u0435\u0442\u043D\u0438 prelom." }}});��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/ml.js���������������������������������������������������������0000664�0000000�0000000�00000016270�12266004471�0020256�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({ml:{ common:{ edit_confirm:"\u0D08 \u0D0E\u0D34\u0D41\u0D24\u0D4D\u0D24\u0D3F\u0D1F\u0D02 \u0D15\u0D3E\u0D23\u0D41\u0D02\u0D35\u0D3F\u0D27\u0D02 \u0D0E\u0D34\u0D41\u0D24\u0D41\u0D28\u0D4D\u0D28\u0D24\u0D3E\u0D15\u0D4D\u0D15\u0D23\u0D4B ?", apply:"\u0D2A\u0D4D\u0D30\u0D2F\u0D4B\u0D17\u0D3F\u0D15\u0D4D\u0D15\u0D41\u0D15", insert:"\u0D24\u0D3F\u0D30\u0D41\u0D15\u0D41\u0D15", update:"\u0D2E\u0D3E\u0D31\u0D4D\u0D31\u0D02 \u0D35\u0D30\u0D41\u0D24\u0D4D\u0D24\u0D41\u0D15", cancel:"\u0D35\u0D47\u0D23\u0D4D\u0D1F\u0D46\u0D28\u0D4D\u0D28\u0D41\u0D35\u0D46\u0D15\u0D4D\u0D15\u0D15", close:"\u0D05\u0D1F\u0D15\u0D4D\u0D15\u0D41\u0D15", browse:"\u0D2E\u0D47\u0D2F\u0D41\u0D15", class_name:"\u0D24\u0D30\u0D02", not_set:"-- Not set --", clipboard_msg:"\u0D2E\u0D41\u0D31\u0D3F\u0D15\u0D4D\u0D15\u0D32\u0D4D\u200D/\u0D2A\u0D15\u0D30\u0D4D\u200D\u0D24\u0D4D\u0D24\u0D32\u0D4D\u200D/\u0D12\u0D1F\u0D4D\u0D1F\u0D3F\u0D15\u0D4D\u0D15\u0D32\u0D4D\u200D \u0D0E\u0D28\u0D4D\u0D28\u0D3F\u0D35 '\u0D2E\u0D4B\u0D38\u0D3F\u0D32\u0D4D\u0D32'\u0D2F\u0D3F\u0D32\u0D41\u0D02 '\u0D2B\u0D2F\u0D30\u0D4D\u200D\u0D2B\u0D4B\u0D15\u0D4D\u0D38\u0D4D'\u0D32\u0D41\u0D02 \u0D32\u0D2D\u0D4D\u0D2F\u0D2E\u0D32\u0D4D\u0D32. \u200C\n\u0D24\u0D3E\u0D19\u0D4D\u0D15\u0D33\u0D4D\u200D\u0D15\u0D4D\u0D15\u0D41 \u0D07\u0D24\u0D3F\u0D28\u0D46 \u0D15\u0D41\u0D31\u0D3F\u0D1A\u0D4D\u0D1A\u0D41\u0D4D \u0D15\u0D42\u0D1F\u0D41\u0D24\u0D32\u0D4D\u200D \u0D05\u0D31\u0D3F\u0D2F\u0D23\u0D4B ?", clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.", popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.", invalid_data:"\u0D2A\u0D3F\u0D34\u0D35\u0D41\u0D4D: Invalid values entered, these are marked in red.", more_colors:"\u0D15\u0D42\u0D1F\u0D41\u0D24\u0D32\u0D4D\u200D \u0D28\u0D3F\u0D31\u0D19\u0D4D\u0D19\u0D33\u0D4D\u200D" }, contextmenu:{ align:"Alignment", left:"Left", center:"Center", right:"Right", full:"Full" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"Insert date", inserttime_desc:"Insert time", months_long:"\u0D1C\u0D28\u0D41\u0D35\u0D30\u0D3F, \u0D2B\u0D46\u0D2C\u0D4D\u0D30\u0D41\u0D35\u0D30\u0D3F, \u0D2E\u0D3E\u0D30\u0D4D\u200D\u0D1A\u0D4D\u0D1A\u0D41\u0D4D, \u0D0F\u0D2A\u0D4D\u0D30\u0D3F\u0D32\u0D4D\u200D, \u0D2E\u0D46\u0D2F\u0D4D, \u0D1C\u0D41\u0D23\u0D4D\u200D, \u0D1C\u0D42\u0D32\u0D3E\u0D2F\u0D4D, \u0D06\u0D17\u0D38\u0D4D\u0D24\u0D4D, \u0D38\u0D46\u0D2A\u0D4D\u0D24\u0D02\u0D2C\u0D30\u0D4D\u200D, \u0D12\u0D15\u0D4D\u0D1F\u0D4B\u0D2C\u0D30\u0D4D\u200D, \u0D28\u0D35\u0D02\u0D2C\u0D30\u0D4D\u200D, \u0D21\u0D3F\u0D38\u0D02\u0D2C\u0D30\u0D4D\u200D", months_short:"\u0D1C\u0D28\u0D41, \u0D2B\u0D46\u0D2C\u0D4D\u0D30\u0D41, \u0D2E\u0D3E\u0D30\u0D4D\u200D, \u0D0F\u0D2A\u0D4D\u0D30\u0D3F, \u0D2E\u0D46, \u0D1C\u0D41\u0D23\u0D4D\u200D, \u0D1C\u0D42\u0D32\u0D3E, \u0D06\u0D17, \u0D38\u0D46\u0D2A\u0D4D\u0D24\u0D02, \u0D12\u0D15\u0D4D\u0D1F\u0D4B, \u0D28\u0D35\u0D02, \u0D21\u0D3F\u0D38\u0D02", day_long:"\u0D1E\u0D3E\u0D2F\u0D30\u0D4D\u200D, \u0D24\u0D3F\u0D19\u0D4D\u0D15\u0D33\u0D4D\u200D, \u0D1A\u0D4A\u0D35\u0D4D\u0D35, \u0D2C\u0D41\u0D27\u0D28\u0D4D\u200D, \u0D35\u0D4D\u0D2F\u0D3E\u0D34\u0D02, \u0D35\u0D46\u0D33\u0D4D\u0D33\u0D3F, \u0D36\u0D28\u0D3F, \u0D1E\u0D3E\u0D2F\u0D30\u0D4D\u200D", day_short:"\u0D1E\u0D3E, \u0D24\u0D3F, \u0D1A\u0D4A, \u0D2C\u0D41, \u0D35\u0D4D\u0D2F\u0D3E, \u0D35\u0D46, \u0D36, \u0D1E\u0D3E" }, print:{ print_desc:"Print" }, preview:{ preview_desc:"Preview" }, directionality:{ ltr_desc:"Direction left to right", rtl_desc:"Direction right to left" }, layer:{ insertlayer_desc:"Insert new layer", forward_desc:"Move forward", backward_desc:"Move backward", absolute_desc:"Toggle absolute positioning", content:"New layer..." }, save:{ save_desc:"Save", cancel_desc:"Cancel all changes" }, nonbreaking:{ nonbreaking_desc:"Insert non-breaking space character" }, iespell:{ iespell_desc:"Run spell checking", download:"ieSpell not detected. Do you want to install it now?" }, advhr:{ advhr_desc:"Horizontal rule" }, emotions:{ emotions_desc:"Emotions" }, searchreplace:{ search_desc:"Find", replace_desc:"Find/Replace" }, advimage:{ image_desc:"Insert/edit image" }, advlink:{ link_desc:"Insert/edit link" }, xhtmlxtras:{ cite_desc:"Citation", abbr_desc:"Abbreviation", acronym_desc:"Acronym", del_desc:"Deletion", ins_desc:"Insertion", attribs_desc:"Insert/Edit Attributes" }, style:{ desc:"Edit CSS Style" }, paste:{ paste_text_desc:"Paste as Plain Text", paste_word_desc:"Paste from Word", selectall_desc:"Select All" }, paste_dlg:{ text_title:"Use CTRL+V on your keyboard to paste the text into the window.", text_linebreaks:"Keep linebreaks", word_title:"Use CTRL+V on your keyboard to paste the text into the window." }, table:{ desc:"Inserts a new table", row_before_desc:"Insert row before", row_after_desc:"Insert row after", delete_row_desc:"Delete row", col_before_desc:"Insert column before", col_after_desc:"Insert column after", delete_col_desc:"Remove column", split_cells_desc:"Split merged table cells", merge_cells_desc:"Merge table cells", row_desc:"Table row properties", cell_desc:"Table cell properties", props_desc:"Table properties", paste_row_before_desc:"Paste table row before", paste_row_after_desc:"Paste table row after", cut_row_desc:"Cut table row", copy_row_desc:"Copy table row", del:"Delete table", row:"Row", col:"Column", cell:"Cell" }, autosave:{ unload_msg:"The changes you made will be lost if you navigate away from this page." }, fullscreen:{ desc:"Toggle fullscreen mode" }, media:{ desc:"Insert / edit embedded media", edit:"Edit embedded media" }, fullpage:{ desc:"Document properties" }, template:{ desc:"Insert predefined template content" }, visualchars:{ desc:"\u0D26\u0D43\u0D36\u0D4D\u0D2F \u0D28\u0D3F\u0D2F\u0D28\u0D4D\u0D24\u0D4D\u0D30\u0D23 \u0D05\u0D15\u0D4D\u0D37\u0D30\u0D19\u0D4D\u0D19\u0D33\u0D4D\u200D \u0D2E\u0D3E\u0D31\u0D4D\u0D31\u0D41\u0D15." }, spellchecker:{ desc:"\u0D05\u0D15\u0D4D\u0D37\u0D30\u0D2A\u0D30\u0D3F\u0D36\u0D4B\u0D27\u0D28 \u0D28\u0D3F\u0D2F\u0D28\u0D4D\u0D24\u0D4D\u0D30\u0D23\u0D02", menu:"\u0D05\u0D15\u0D4D\u0D37\u0D30\u0D2A\u0D30\u0D3F\u0D36\u0D4B\u0D27\u0D28\u0D3E \u0D15\u0D4D\u0D30\u0D2E\u0D40\u0D15\u0D30\u0D23\u0D19\u0D4D\u0D19\u0D33\u0D4D\u200D", ignore_word:"\u0D35\u0D3E\u0D15\u0D4D\u0D15\u0D41\u0D4D \u0D05\u0D35\u0D17\u0D23\u0D3F\u0D15\u0D4D\u0D15\u0D42", ignore_words:"\u0D0E\u0D32\u0D4D\u0D32\u0D3E\u0D02 \u0D05\u0D35\u0D17\u0D23\u0D3F\u0D15\u0D4D\u0D15\u0D42", langs:"\u0D2D\u0D3E\u0D37\u0D15\u0D33\u0D4D\u200D", wait:"\u0D26\u0D2F\u0D35\u0D3E\u0D2F\u0D3F \u0D15\u0D3E\u0D24\u0D4D\u0D24\u0D41\u0D28\u0D3F\u0D32\u0D4D\u0D15\u0D41...", sug:"\u0D05\u0D2D\u0D3F\u0D2A\u0D4D\u0D30\u0D3E\u0D2F\u0D19\u0D4D\u0D19\u0D33\u0D4D\u200D", no_sug:"\u0D05\u0D2D\u0D3F\u0D2A\u0D4D\u0D30\u0D3E\u0D2F\u0D2E\u0D3F\u0D32\u0D4D\u0D32", no_mpell:"\u0D05\u0D15\u0D4D\u0D37\u0D30\u0D24\u0D4D\u0D24\u0D46\u0D31\u0D4D\u0D31\u0D3F\u0D32\u0D4D\u0D32." }, pagebreak:{ desc:"\u0D2A\u0D47\u0D1C\u0D41\u0D4D \u0D24\u0D3F\u0D30\u0D3F\u0D15\u0D4D\u0D15\u0D41\u0D15" }}});����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/mn.js���������������������������������������������������������0000664�0000000�0000000�00000032013�12266004471�0020251�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({mn:{ common:{ edit_confirm:"\u0422\u0430 \u044D\u043D\u044D \u0431\u0438\u0447\u0432\u044D\u0440\u0438\u0439\u043D \u043C\u0443\u0436\u0438\u0439\u0433 WYSIWYG \u0437\u0430\u0441\u0432\u0430\u0440\u043B\u0430\u0445\u044B\u0433 \u0445\u04AF\u0441\u044D\u0436 \u0431\u0430\u0439\u043D\u0430 \u0443\u0443?", apply:"\u0425\u044D\u0440\u044D\u0433\u043B\u044D\u0445", insert:"\u041E\u0440\u0443\u0443\u043B\u0430\u0445", update:"\u0428\u0438\u043D\u044D\u0447\u043B\u044D\u0445", cancel:"\u0426\u0443\u0446\u043B\u0430\u0445", close:"\u0425\u0430\u0430\u0445", browse:"\u0413\u04AF\u0439\u043B\u0433\u044D\u043D \u04AF\u0437\u044D\u0445", class_name:"\u0410\u043D\u0433\u0438", not_set:"-- \u041E\u043B\u0433\u043E\u0433\u0434\u043E\u043E\u0433\u04AF\u0439 --", clipboard_msg:"\u0425\u0443\u0443\u043B\u0430\u0445, \u0442\u0430\u0441\u043B\u0430\u043D \u0430\u0432\u0430\u0445 \u0431\u0443\u0443\u043B\u0433\u0430\u0445 \u043D\u044C \u041C\u043E\u0437\u0438\u043B\u043B\u0430 \u0424\u0430\u0439\u0440\u0444\u043E\u043A\u0441 \u0434\u044D\u044D\u0440 \u0431\u043E\u043B\u043E\u043C\u0436\u0433\u04AF\u0439.\n\u0422\u0430 \u044D\u043D\u044D \u0430\u0441\u0443\u0443\u0434\u043B\u044B\u043D \u0442\u0430\u043B\u0430\u0430\u0440 \u0434\u044D\u043B\u0433\u044D\u0440\u044D\u043D\u0433\u04AF\u0439 \u043C\u044D\u0434\u044D\u0445\u0438\u0439\u0433 \u0445\u04AF\u0441\u044D\u0436 \u0431\u0430\u0439\u043D\u0430 \u0443\u0443?", clipboard_no_support:"\u041E\u0434\u043E\u043E\u0433\u043E\u043E\u0440 \u0442\u0430\u043D\u044B \u0445\u04E9\u0442\u04E9\u0447 \u0434\u044D\u044D\u0440 \u0434\u044D\u043C\u0436\u0438\u0433\u0434\u044D\u044D\u0433\u04AF\u0439 \u0431\u0430\u0439\u043D\u0430. \u0422\u0430 \u04AF\u04AF\u043D\u0438\u0439 \u043E\u0440\u043E\u043D\u0434 \u0442\u043E\u0432\u0447\u0438\u043B\u0431\u043E\u0440 \u0445\u044D\u0440\u044D\u0433\u043B\u044D\u043D\u044D \u04AF\u04AF.", popup_blocked:"\u0425\u0430\u0440\u0430\u043C\u0441\u0430\u043B\u0442\u0430\u0439 \u043D\u044C \u0442\u0430\u043D\u044B \u043F\u043E\u043F\u0430\u043F \u0445\u0430\u0430\u043B\u0442 \u044D\u043D\u044D \u043F\u0440\u043E\u0433\u0440\u0430\u043C\u0434 \u0448\u0430\u0430\u0440\u0434\u043B\u0430\u0433\u0430\u0442\u0430\u0439 \u0446\u043E\u043D\u0445\u044B\u0433 \u0445\u0430\u0430\u043B\u0430\u0430. \u0411\u04AF\u0440\u044D\u043D \u0434\u04AF\u04AF\u0440\u044D\u043D \u0430\u0436\u0438\u043B\u043B\u0430\u0433\u0430\u0430\u0433 \u0445\u0430\u043D\u0433\u0430\u0445\u044B\u0433 \u0445\u04AF\u0441\u0432\u044D\u043B \u043F\u043E\u043F\u0430\u043F \u0445\u0430\u0430\u043B\u0442\u0430\u0430 \u0438\u0434\u044D\u0432\u0445\u0433\u04AF\u0439\u0436\u04AF\u04AF\u043B\u043D\u044D \u04AF\u04AF.", invalid_data:"\u0410\u043B\u0434\u0430\u0430: \u0422\u0430 \u0445\u04AF\u0447\u0438\u043D\u0433\u04AF\u0439 \u0443\u0442\u0433\u0430 \u043E\u0440\u0443\u0443\u043B\u0441\u0430\u043D. (\u0443\u043B\u0430\u0430\u043D\u0430\u0430\u0440 \u0442\u044D\u043C\u0434\u044D\u0433\u043B\u044D\u0441\u044D\u043D).", more_colors:"\u0411\u0443\u0441\u0430\u0434 \u04E9\u043D\u0433\u04E9" }, contextmenu:{ align:"\u0416\u0438\u0433\u0434\u0440\u04AF\u04AF\u043B\u044D\u043B\u0442", left:"\u0417\u04AF\u04AF\u043D", center:"\u0414\u0443\u043D\u0434", right:"\u0411\u0430\u0440\u0443\u0443\u043D", full:"\u0422\u044D\u0433\u0448\u0438\u043B\u0441\u044D\u043D" }, insertdatetime:{ date_fmt:"%Y.%m.%d", time_fmt:"%H:%M:%S", insertdate_desc:"\u041E\u0433\u043D\u043E\u043E \u043E\u0440\u0443\u0443\u043B\u0430\u0445", inserttime_desc:"\u0425\u0443\u0433\u0430\u0446\u0430\u0430 \u043E\u0440\u0443\u0443\u043B\u0430\u0445", months_long:"\u0425\u0443\u043B\u0433\u0430\u043D\u0430,\u04AE\u0445\u044D\u0440,\u0411\u0430\u0440,\u0422\u0443\u0443\u043B\u0430\u0439,\u041B\u0443\u0443,\u041C\u043E\u0433\u043E\u0439,\u041C\u043E\u0440\u044C,\u0425\u043E\u043D\u044C,\u0411\u0438\u0447,\u0422\u0430\u0445\u0438\u0430,\u041D\u043E\u0445\u043E\u0439,\u0413\u0430\u0445\u0430\u0439", months_short:"\u0425\u0443\u043B,\u04AE\u0445\u044D,\u0411\u0430\u0440,\u0422\u0443\u0443,\u041B\u0443\u0443,\u041C\u043E\u0433,\u041C\u043E\u0440,\u0425\u043E\u043D,\u0411\u0438\u0447,\u0422\u0430\u0445,\u041D\u043E\u0445,\u0413\u0430\u0445", day_long:"\u041D\u044F\u043C,\u0414\u0430\u0432\u0430\u0430,\u041C\u044F\u0433\u043C\u0430\u0440,\u041B\u0445\u0430\u0433\u0432\u0430,\u041F\u04AF\u0440\u044D\u0432,\u0411\u0430\u0430\u0441\u0430\u043D,\u0411\u044F\u043C\u0431\u0430,\u041D\u044F\u043C", day_short:"\u041D\u044F,\u0414\u0430,\u041C\u044F,\u041B\u0445,\u041F\u04AF,\u0411\u0430,\u0411\u044F,\u041D\u044F" }, print:{ print_desc:"\u0425\u044D\u0432\u043B\u044D\u0445" }, preview:{ preview_desc:"\u041D\u044F\u0433\u0442\u043B\u0430\u0445" }, directionality:{ ltr_desc:"\u0417\u04AF\u04AF\u043D\u044D\u044D\u0441 \u0431\u0430\u0440\u0443\u0443\u043D \u0431\u0438\u0447\u0438\u043B\u0442", rtl_desc:"\u0411\u0430\u0440\u0443\u0443\u043D \u0437\u04AF\u04AF\u043D \u0431\u0438\u0447\u0438\u043B\u0442" }, layer:{ insertlayer_desc:"\u0428\u0438\u043D\u044D \u0434\u0430\u0432\u0445\u0430\u0440\u0433\u0430 \u043E\u0440\u0443\u0443\u043B\u0430\u0445", forward_desc:"\u041D\u0430\u0430\u0448\u043B\u0443\u0443\u043B\u0430\u0445", backward_desc:"\u0426\u0430\u0430\u0448\u043B\u0443\u0443\u043B\u0430\u0445", absolute_desc:"\u0410\u0431\u0441\u043E\u043B\u044E\u0442 \u0431\u0430\u0439\u0440\u0448\u0443\u0443\u043B\u0430\u043B\u0442", content:"\u0428\u0438\u043D\u044D \u0434\u0430\u0432\u0445\u0430\u0440\u0433\u0430..." }, save:{ save_desc:"\u0425\u0430\u0434\u0433\u0430\u043B\u0430\u0445", cancel_desc:"\u0411\u04AF\u0445 \u04E9\u04E9\u0440\u0447\u043B\u04E9\u043B\u0442\u0438\u0439\u0433 \u0445\u0430\u044F\u0445" }, nonbreaking:{ nonbreaking_desc:"\u0425\u0430\u043C\u0433\u0430\u0430\u043B\u0430\u043B\u0442\u0442\u0430\u0439 \u0445\u043E\u043E\u0441\u043E\u043D \u0437\u0430\u0439 \u043E\u0440\u0443\u0443\u043B\u0430\u0445" }, iespell:{ iespell_desc:"\u0414\u04AF\u0440\u043C\u0438\u0439\u043D \u0430\u043B\u0434\u0430\u0430 \u0448\u0430\u043B\u0433\u0430\u043B\u0442", download:"ieSpell \u043E\u043B\u0434\u0441\u043E\u043D\u0433\u04AF\u0439. \u0422\u0430 \u0441\u0443\u0443\u043B\u0433\u0430\u0445\u044B\u0433 \u0445\u04AF\u0441\u044D\u0436 \u0431\u0430\u0439\u043D\u0430 \u0443\u0443?" }, advhr:{ advhr_desc:"\u0422\u0443\u0441\u0433\u0430\u0430\u0440\u043B\u0430\u0433\u0447" }, emotions:{ emotions_desc:"\u0421\u044D\u0442\u0433\u044D\u043B \u0445\u04E9\u0434\u043B\u04E9\u043B" }, searchreplace:{ search_desc:"\u0425\u0430\u0439\u0445", replace_desc:"\u0425\u0430\u0439\u0445/\u043E\u0440\u043B\u0443\u0443\u043B\u0430\u0445" }, advimage:{ image_desc:"\u0417\u0443\u0440\u0430\u0433 \u043E\u0440\u0443\u0443\u043B\u0430\u0445/\u043E\u0440\u043B\u0443\u0443\u043B\u0430\u0445" }, advlink:{ link_desc:"\u0425\u043E\u043B\u0431\u043E\u043E\u0441 \u043E\u0440\u0443\u0443\u043B\u0430\u0445/\u0437\u0430\u0441\u0430\u0445" }, xhtmlxtras:{ cite_desc:"\u0418\u0448\u043B\u044D\u043B", abbr_desc:"\u0422\u043E\u0432\u0447\u043B\u043E\u043B", acronym_desc:"\u0422\u043E\u0432\u0447\u0438\u043B\u0441\u043E\u043D \u04AF\u0433", del_desc:"\u0423\u0441\u0442\u0441\u0430\u043D \u0431\u0438\u0447\u0432\u044D\u0440 Text", ins_desc:"\u041E\u0440\u0441\u043E\u043D \u0431\u0438\u0447\u0432\u044D\u0440", attribs_desc:"\u0410\u0442\u0440\u0438\u0431\u0443\u0442 \u043E\u0440\u0443\u0443\u043B\u0430\u0445/\u0437\u0430\u0441\u0430\u0445" }, style:{ desc:"CSS-Styles \u0437\u0430\u0441\u0430\u0445" }, paste:{ paste_text_desc:"\u042D\u043D\u0433\u0438\u0439\u043D \u0431\u0438\u0447\u0432\u044D\u0440\u044D\u044D\u0440 \u0431\u0443\u0443\u043B\u0433\u0430\u0445", paste_word_desc:"\u0425\u044D\u043B\u0431\u044D\u0440\u0436\u04AF\u04AF\u043B\u044D\u043B\u0442\u0442\u044D\u0439 \u0431\u0443\u0443\u043B\u0433\u0430\u0445 (Word-\u0441)", selectall_desc:"\u0411\u04AF\u0433\u0434\u0438\u0439\u0433 \u0441\u043E\u043D\u0433\u043E\u0445" }, paste_dlg:{ text_title:"\u0422\u0430 \u0431\u0438\u0447\u0432\u044D\u0440 \u043E\u0440\u0443\u0443\u043B\u0430\u0445\u044B\u0433 \u0445\u04AF\u0441\u0432\u044D\u043B Ctrl+V \u0434\u044D\u044D\u0440 \u0434\u0430\u0440\u043D\u0430 \u0443\u0443.", text_linebreaks:"\u041C\u04E9\u0440 \u0442\u0430\u0441\u043B\u0430\u043B\u0442\u044B\u0433 \u04AF\u043B\u0434\u044D\u044D\u043D\u044D", word_title:"\u0422\u0430 \u0431\u0438\u0447\u0432\u044D\u0440 \u043E\u0440\u0443\u0443\u043B\u0430\u0445\u044B\u0433 \u0445\u04AF\u0441\u0432\u044D\u043B Ctrl+V \u0434\u044D\u044D\u0440 \u0434\u0430\u0440\u043D\u0430 \u0443\u0443." }, table:{ desc:"\u0425\u04AF\u0441\u043D\u044D\u0433\u0442 \u04AF\u04AF\u0441\u0433\u044D\u0445", row_before_desc:"\u0414\u044D\u044D\u0440 \u043D\u044C \u043C\u04E9\u0440 \u043E\u0440\u0443\u0443\u043B\u0430\u0445", row_after_desc:"\u0414\u043E\u043E\u0440 \u043D\u044C \u043C\u04E9\u0440 \u043E\u0440\u0443\u0443\u043B\u0430\u0445", delete_row_desc:"\u041C\u04E9\u0440 \u0443\u0441\u0442\u0433\u0430\u0445", col_before_desc:"\u0417\u04AF\u04AF\u043D \u0442\u0430\u043B\u0434 \u043D\u044C \u0431\u0430\u0433\u0430\u043D\u0430 \u043E\u0440\u0443\u0443\u043B\u0430\u0445", col_after_desc:"\u0411\u0430\u0440\u0443\u0443\u043D \u0442\u0430\u043B\u0434 \u043D\u044C \u0431\u0430\u0433\u0430\u043D\u0430 \u043E\u0440\u0443\u0443\u043B\u0430\u0445", delete_col_desc:"\u0411\u0430\u0433\u0430\u043D\u0430 \u0443\u0441\u0442\u0433\u0430\u0445", split_cells_desc:"\u041D\u044D\u0433\u0442\u0433\u044D\u0441\u044D\u043D \u043D\u04AF\u0434\u0438\u0439\u0433 \u0441\u0430\u043B\u0433\u0430\u0445", merge_cells_desc:"\u041D\u04AF\u0434 \u043D\u044D\u0433\u0442\u0433\u044D\u0445", row_desc:"\u041C\u04E9\u0440\u0438\u0439\u043D \u0448\u0438\u043D\u0436\u04AF\u04AF\u0434", cell_desc:"\u041D\u04AF\u0434\u043D\u0438\u0439 \u0448\u0438\u043D\u0436\u04AF\u04AF\u0434", props_desc:"\u0425\u04AF\u0441\u043D\u044D\u0433\u0442\u0438\u0439\u043D \u0448\u0438\u043D\u0436\u04AF\u04AF\u0434", paste_row_before_desc:"\u0417\u0430\u0432\u0441\u0440\u044B\u043D \u0445\u0430\u0434\u0433\u0430\u043B\u0430\u0433\u0447\u0430\u0430\u0441 \u043C\u04E9\u0440\u0438\u0439\u0433 \u0434\u044D\u044D\u0440 \u043D\u044C \u0431\u0443\u0443\u043B\u0433\u0430\u0445", paste_row_after_desc:"\u0417\u0430\u0432\u0441\u0440\u044B\u043D \u0445\u0430\u0434\u0433\u0430\u043B\u0430\u0433\u0447\u0430\u0430\u0441 \u043C\u04E9\u0440\u0438\u0439\u0433 \u0434\u043E\u043E\u0440 \u043D\u044C \u0431\u0443\u0443\u043B\u0433\u0430\u0445", cut_row_desc:"\u041C\u04E9\u0440 \u0442\u0430\u0441\u0434\u0430\u0436 \u0430\u0432\u0430\u0445 \u0443\u0443?", copy_row_desc:"\u041C\u04E9\u0440 \u0445\u0443\u0443\u043B\u0430\u0445", del:"\u0425\u04AF\u0441\u043D\u044D\u0433\u0442 \u0443\u0441\u0442\u0433\u0430\u0445", row:"\u041C\u04E9\u0440", col:"\u0411\u0430\u0433\u0430\u043D\u0430", cell:"\u041D\u04AF\u0434" }, autosave:{ unload_msg:"\u0425\u044D\u0440\u044D\u0432 \u0442\u0430 \u0445\u0443\u0443\u0434\u0441\u044B\u0433 \u043E\u0440\u0445\u0438\u0432\u043E\u043B \u0442\u0430\u043D\u044B \u04E9\u04E9\u0440\u0447\u043B\u04E9\u043B\u0442\u04AF\u04AF\u0434 \u0445\u0430\u044F\u0433\u0434\u0430\u043D\u0430." }, fullscreen:{ desc:"\u0414\u044D\u043B\u0433\u044D\u0446 \u0434\u04AF\u04AF\u0440\u044D\u043D" }, media:{ desc:"\u041C\u0443\u043B\u044C\u0442\u0438\u043C\u0435\u0434\u0438\u0430 \u0448\u0438\u0433\u0442\u0433\u044D\u0445/\u0437\u0430\u0441\u0430\u0445", edit:"\u041C\u0443\u043B\u044C\u0442\u0438\u043C\u0435\u0434\u0438\u0430 \u0448\u0438\u0433\u0442\u0433\u044D\u044D \u0437\u0430\u0441\u0430\u0445" }, fullpage:{ desc:"\u0411\u0430\u0440\u0438\u043C\u0442\u044B\u043D \u0442\u043E\u0434\u0440\u0443\u0443\u043B\u0433\u0430" }, template:{ desc:"\u04E8\u043C\u043D\u04E9 \u0431\u044D\u043B\u0442\u0433\u044D\u0441\u044D\u043D \u0445\u044D\u0432\u0438\u0439\u043D \u0430\u0433\u0443\u0443\u043B\u0433\u044B\u0433 \u0431\u0443\u0443\u043B\u0433\u0430\u0445" }, visualchars:{ desc:"\u0423\u0434\u0438\u0440\u0434\u0430\u0445 \u0442\u044D\u043C\u0434\u044D\u0433\u0442 \u0445\u0430\u0440\u0443\u0443\u043B\u0430\u0445/\u044D\u0441 \u0445\u0430\u0440\u0443\u0443\u043B\u0430\u0445." }, spellchecker:{ desc:"\u0414\u04AF\u0440\u043C\u0438\u0439\u043D \u0430\u043B\u0434\u0430\u0430 \u0448\u0430\u043B\u0433\u0430\u0433\u0447 \u043D\u044D\u044D\u043B\u0442\u0442\u044D\u0439/\u0445\u0430\u0430\u043B\u0442\u0442\u0430\u0439", menu:"\u0414\u04AF\u0440\u043C\u0438\u0439\u043D \u0430\u043B\u0434\u0430\u0430 \u0448\u0430\u043B\u0433\u0430\u0433\u0447\u0438\u0439\u043D \u0442\u043E\u0445\u0438\u0440\u0433\u043E\u043E", ignore_word:"\u04AE\u0433 \u04AF\u043B \u0445\u044D\u0440\u044D\u0433\u0441\u044D\u0445", ignore_words:"\u0411\u04AF\u0433\u0434\u0438\u0439\u0433 \u04AF\u043B \u0445\u044D\u0440\u044D\u0433\u0441\u044D\u0445", langs:"\u0425\u044D\u043B", wait:"\u0422\u04AF\u0440 \u0445\u04AF\u043B\u044D\u044D\u043D\u044D \u04AF\u04AF...", sug:"\u0421\u0430\u043D\u0430\u043B", no_sug:"\u0421\u0430\u043D\u0430\u043B \u0430\u043B\u0433\u0430", no_mpell:"\u0414\u04AF\u0440\u043C\u0438\u0439\u043D \u0430\u043B\u0434\u0430\u0430 \u043E\u043B\u0434\u0441\u043E\u043D\u0433\u04AF\u0439." }, pagebreak:{ desc:"\u0425\u0443\u0443\u0434\u0430\u0441 \u0442\u0430\u0441\u043B\u0430\u043B\u0442 \u043E\u0440\u0443\u0443\u043B\u0430\u0445." }}});���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/ms.js���������������������������������������������������������0000664�0000000�0000000�00000010035�12266004471�0020256�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({ms:{ common:{ edit_confirm:"Guna WYSIWYG mod untuk \"textarea\" ini?", apply:"Guna", insert:"Sisip", update:"Kemaskini", cancel:"Batal", close:"Tutup", browse:"Semak seimbas", class_name:"Kelas", not_set:"-- Tidak set --", clipboard_msg:"Salin/Potong/Tempel tidak disediakan untuk Mozilla dan Firefox.\nAdakah anda mahu informasi lanjut tentang isu ini?", clipboard_no_support:"Perisian browser anda tidak disokong pada masa ini, sila guna papan kekunci.", popup_blocked:"Maaf, kami dapati \"popup-blocker\" telah melumpuhkan tetingkap yang memberikan fungsi kepada perisian anda. Anda perlu mematikan \"popup-blocker\" untuk laman web ini bagi menggunakan semua alatan.", invalid_data:"Ralat: Nilai dimasukkan tidak sah, lihat tanda merah.", more_colors:"Warna lain-lain" }, contextmenu:{ align:"Penyelarian", left:"Kiri", center:"Tengah", right:"Kanan", full:"Penuh" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"Sisip tarikh", inserttime_desc:"Sisip masa", months_long:"Januari,Febuari,Mac,April,Mei,Jun,Julai,Ogos,September,Oktober,November,Disember", months_short:"Jan,Feb,Mac,Apr,Mei,Jun,Jul,Ogo,Sep,Okt,Nov,Dis", day_long:"Ahad,Isnin,Selasa,Rabu,Khamis,Jumaat,Sabtu,Ahad", day_short:"Aha,Isn,Sel,Rab,Kha,Jum,Sab,Aha" }, print:{ print_desc:"Cetak" }, preview:{ preview_desc:"Pratonton" }, directionality:{ ltr_desc:"Arah kiri ke kanan", rtl_desc:"Arah kanan ke kiri" }, layer:{ insertlayer_desc:"Sisip lapisan baru", forward_desc:"Gerak kehadapan", backward_desc:"Gerak kebelakang", absolute_desc:"Alih posisi mutlak", content:"Lapisan baru..." }, save:{ save_desc:"Simpan", cancel_desc:"Batal semua pertukaran" }, nonbreaking:{ nonbreaking_desc:"Masukkan aksara ruang [nbsp]" }, iespell:{ iespell_desc:"Larikan pembetulan ejaan", download:"ieSpell tiada. Pasang sekarang?" }, advhr:{ advhr_desc:"Garis mengufuk" }, emotions:{ emotions_desc:"Simbol Emosi" }, searchreplace:{ search_desc:"Cari", replace_desc:"Cari/Ganti" }, advimage:{ image_desc:"Sisip/sunting imej" }, advlink:{ link_desc:"Sisip/sunting pautan" }, xhtmlxtras:{ cite_desc:"Kutipan", abbr_desc:"Singkatan", acronym_desc:"Akronim", del_desc:"Pemadaman", ins_desc:"Kemasukan", attribs_desc:"Masukkan/Sunting Ciri-ciri" }, style:{ desc:"Sunting Gaya CSS" }, paste:{ paste_text_desc:"Tempel sebagai teks", paste_word_desc:"Tempel dari Word", selectall_desc:"Pilih semua" }, paste_dlg:{ text_title:"Guna CTRL+V pada papan kekunci anda untuk Tempel teks ke dalam tetingkap.", text_linebreaks:"Biarkan garisan pemisah", word_title:"Guna CTRL+V pada papan kekunci anda untuk teks ke dalam tetingkap." }, table:{ desc:"Masukkan jadual baru", row_before_desc:"Masukkan row sebelumnya", row_after_desc:"Masukkan row selepasnya", delete_row_desc:"Padam row", col_before_desc:"Masukkan kolum sebelumnya", col_after_desc:"Masukkan kolum selepasnya", delete_col_desc:"Alih kolum", split_cells_desc:"Bahagi sel jadual", merge_cells_desc:"Gabung sel jadual", row_desc:"Alatan jadual row", cell_desc:"Alatan jadual sel", props_desc:"Alatan jadual", paste_row_before_desc:"Tempel jadual row sebelumnya", paste_row_after_desc:"Tempel jadual row selepasnya", cut_row_desc:"Potong jadual row", copy_row_desc:"Salin jadual row", del:"Padam jadual", row:"Row", col:"Kolum", cell:"Sel" }, autosave:{ unload_msg:"Pertukaran akan terbatal sekiranya anda meninggalkan halaman ini." }, fullscreen:{ desc:"Alih mod skrin penuh" }, media:{ desc:"Masukkan / sunting media", edit:"Sunting media" }, fullpage:{ desc:"Alatan dokumen" }, template:{ desc:"Masukkan pra takrifan kandungan templet" }, visualchars:{ desc:"Pengendali grafik huruf Buka/Tutup." }, spellchecker:{ desc:"Alih pembetul perkataan", menu:"Alatan pembetul perkataan", ignore_word:"Endahkan perkataan", ignore_words:"Endahkan kesemuanya", langs:"Bahasa-bahasa", wait:"Sila tunggu...", sug:"Cadangan", no_sug:"Tiada cadangan", no_mpell:"Tiada kesalahan ejaan." }, pagebreak:{ desc:"Masukkan penghenti-halaman." }}});���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/nb.js���������������������������������������������������������0000664�0000000�0000000�00000010216�12266004471�0020237�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({nb:{ common:{ edit_confirm:"Vil du benytte WYSIWYG-editoren for dette tekstfeltet?", apply:"Legg til", insert:"Sett inn", update:"Oppdater", cancel:"Avbryt", close:"Stop", browse:"Bla gjennom", class_name:"Klasse", not_set:"--ikke satt--", clipboard_msg:"Klipp ut / Kopier /Lim inn fungerer ikke i Mozilla og Firefox. Vil du vite mer om dette?", clipboard_no_support:"For tiden ikke st\u00F8ttet av din nettleser, benytt tastatursnarveier i stedet.", popup_blocked:"Beklager, det er registrert at du har en popup-sperre aktivert i nettleseren. Du m\u00E5 oppheve popup-sperren for nettstedet for \u00E5 f\u00E5 tilgang til dette verkt\u00F8yet", invalid_data:"Feil: Ugyldige verdier er skrevet inn, disse er merket med r\u00F8dt.", more_colors:"Flere farger" }, contextmenu:{ align:"Justering", left:"Venstre", center:"Midtstill", right:"H\u00F8yre", full:"Full" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"Sett inn dato", inserttime_desc:"Sett inn tidspunkt", months_long:"januar,februar,mars,april,mai,juni,juli,august,september,oktober,november,desember", months_short:"jan,feb,mar,apr,mai,jun,jul,aug,sep,oct,nov,des", day_long:"s\u00F8ndag,mandag,tirsdag,onsdag,torsdag,fredag,l\u00F8rdag,s\u00F8ndag", day_short:"s\u00F8n,man,tir,ons,tor,fre,l\u00F8r,s\u00F8n" }, print:{ print_desc:"Skriv u" }, preview:{ preview_desc:"Forh\u00E5ndsvisning" }, directionality:{ ltr_desc:"Retning venstre mot h\u00F8yre", rtl_desc:"Retning h\u00F8yre mot venstre" }, layer:{ insertlayer_desc:"Sett inn nytt lag", forward_desc:"Flytt framover", backward_desc:"Flytt bakover", absolute_desc:"Sl\u00E5 p\u00E5/av absolutt plassering", content:"Nytt lag..." }, save:{ save_desc:"Lagre", cancel_desc:"Kanseller alle endringer" }, nonbreaking:{ nonbreaking_desc:"Sett inn hardt mellomrom" }, iespell:{ iespell_desc:"Kj\u00F8rer rettskrivningskontroll", download:"ieSpell ikke funnet. \u00D8nsker du \u00E5 installere ieSpell n\u00E5?" }, advhr:{ advhr_desc:"Horisontal linje" }, emotions:{ emotions_desc:"Hum\u00F8rfjes" }, searchreplace:{ search_desc:"S\u00F8k", replace_desc:"S\u00F8k/Erstatt" }, advimage:{ image_desc:"Sett inn / endre bilde" }, advlink:{ link_desc:"Sett inn / endre lenke" }, xhtmlxtras:{ cite_desc:"Sitat", abbr_desc:"Forkortelse", acronym_desc:"Akronym", del_desc:"Sletting", ins_desc:"Innsetting", attribs_desc:"Sett inn / endre Egenskaper" }, style:{ desc:"Rediger CSS-stil" }, paste:{ paste_text_desc:"Lim inn som vanlig tekst", paste_word_desc:"Lim inn fra Word", selectall_desc:"Marker al" }, paste_dlg:{ text_title:"Bruk CTRL+V p\u00E5 tastaturet for \u00E5 lime inn i dette vinduet.", text_linebreaks:"Behold tekstbryting", word_title:"Bruk CTRL+V p\u00E5 tastaturet for \u00E5 lime inn i dette vinduet." }, table:{ desc:"Sett inn ny tabell", row_before_desc:"Sett inn rad foran", row_after_desc:"Sett inn rad etter etter", delete_row_desc:"Fjern rad", col_before_desc:"Sett inn kolonne foran", col_after_desc:"Sett inn kolonne etter", delete_col_desc:"Fjern kolonne", split_cells_desc:"Del celler", merge_cells_desc:"Sl\u00E5 sammen celler", row_desc:"Radegenskaper", cell_desc:"Celleegenskaper", props_desc:"Tabellegenskaper", paste_row_before_desc:"Lim inn rad foran", paste_row_after_desc:"Lim inn rad etter", cut_row_desc:"Fjern rad", copy_row_desc:"Kopier rad", del:"Slett tabell", row:"Rad", col:"Kolonne", cell:"Celle" }, autosave:{ unload_msg:"Endringene du gjorde g\u00E5r tapt dersom du velger \u00E5 forlate denne siden!" }, fullscreen:{ desc:"Skift til/fra fullskjermmodus" }, media:{ desc:"Sett inn / rediger inkludert objekt", edit:"Endre inkludert objekt" }, fullpage:{ desc:"Dokumentegenskaper" }, template:{ desc:"Sett inn forh\u00E5ndsdefinert malinnhold" }, visualchars:{ desc:"Visuelle kontrolltegn p\u00E5/av" }, spellchecker:{ desc:"Stavekontroll p\u00E5/av", menu:"Vis meny", ignore_word:"Ignorer ord", ignore_words:"Ignorer alt", langs:"Spr\u00E5k", wait:"Vennligst vent...", sug:"Forslag", no_sug:"Ingen forslag", no_mpell:"Ingen stavefeil funnet" }, pagebreak:{ desc:"Sett inn sideskift" }}});����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/nl.js���������������������������������������������������������0000664�0000000�0000000�00000010056�12266004471�0020253�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({nl:{ common:{ edit_confirm:"Weet u zeker dat u tekst in WYSIWYG mode wilt bewerken in dit tekstveld?", apply:"Toepassen", insert:"Invoegen", update:"Bijwerken", cancel:"Annuleren", close:"Sluiten", browse:"Bladeren", class_name:"Klasse", not_set:"- Standaard -", clipboard_msg:"Kopi\u00EBren/knippen/plakken is niet beschikbaar in Mozilla en Firefox.\nWilt u meer informatie over deze beperking?", clipboard_no_support:"Kopi\u00EBren/knippen/plakken wordt niet ondersteund door uw browser, gebruik hiervoor de sneltoetsen.", popup_blocked:"U zult uw popup-blocker tijdelijk moeten uitschakelen voor deze website om gebruik te kunnen maken van alle functies van deze teksteditor.", invalid_data:"Fout: Er zijn ongeldige waardes ingevoerd, deze zijn rood gemarkeerd.", more_colors:"Meer kleuren" }, contextmenu:{ align:"Uitlijning", left:"Links", center:"Centreren", right:"Rechts", full:"Uitvullen" }, insertdatetime:{ date_fmt:"%d-%m-%Y", time_fmt:"%H:%M:%S", insertdate_desc:"Datum invoegen", inserttime_desc:"Tijd invoegen", months_long:"Januari,Februari,Maart,April,Mei,Juni,Juli,Augustus,September,Oktober,November,December", months_short:"Jan,Feb,Mar,Apr,Mei,Jun,Jul,Aug,Sep,Okt,Nov,Dec", day_long:"Zondag,Maandag,Dinsdag,Woensdag,Donderdag,Vrijdag,Zaterdag,Zondag", day_short:"zo,ma,di,wo,do,vr,za,zo" }, print:{ print_desc:"Afdrukken" }, preview:{ preview_desc:"Voorbeeld" }, directionality:{ ltr_desc:"Van links naar rechts", rtl_desc:"Van rechts naar links" }, layer:{ insertlayer_desc:"Nieuwe laag invoegen", forward_desc:"Volgende laag", backward_desc:"Vorige laag", absolute_desc:"Absoluut positioneren inschakelen", content:"Nieuwe laag..." }, save:{ save_desc:"Opslaan", cancel_desc:"Alle wijzigingen annuleren" }, nonbreaking:{ nonbreaking_desc:"Open ruimte invoegen" }, iespell:{ iespell_desc:"Spellingcontrole", download:"ieSpell niet gevonden. Wilt u deze nu installeren?" }, advhr:{ advhr_desc:"Scheidingslijn" }, emotions:{ emotions_desc:"Emoties" }, searchreplace:{ search_desc:"Zoeken", replace_desc:"Zoeken/Vervangen" }, advimage:{ image_desc:"Afbeelding invoegen/bewerken" }, advlink:{ link_desc:"Link invoegen/bewerken" }, xhtmlxtras:{ cite_desc:"Citaat", abbr_desc:"Afkorting", acronym_desc:"Synoniem", del_desc:"Verwijderd", ins_desc:"Ingevoegd", attribs_desc:"Attributen invoegen/bewerken" }, style:{ desc:"CSS Stijl bewerken" }, paste:{ paste_text_desc:"Als platte tekst plakken", paste_word_desc:"Vanuit Word plakken", selectall_desc:"Alles selecteren" }, paste_dlg:{ text_title:"Gebruik Ctrl+V om tekst in het venster te plakken.", text_linebreaks:"Regelafbreking bewaren", word_title:"Gebruik Ctrl+V om tekst in het venster te plakken." }, table:{ desc:"Nieuwe tabel invoegen", row_before_desc:"Rij boven invoegen", row_after_desc:"Rij onder invoegen", delete_row_desc:"Rij verwijderen", col_before_desc:"Kolom links invoegen", col_after_desc:"Kolom rechts invoegen", delete_col_desc:"Kolom verwijderen", split_cells_desc:"Cellen splitsen", merge_cells_desc:"Cellen samenvoegen", row_desc:"Rij-eigenschappen", cell_desc:"Cel-eigenschappen", props_desc:"Tabeleigenschappen", paste_row_before_desc:"Rij boven plakken", paste_row_after_desc:"Rij onder plakken", cut_row_desc:"Rij knippen", copy_row_desc:"Rij kopi\u00EBren", del:"Tabel verwijderen", row:"Rij", col:"Kolom", cell:"Cel" }, autosave:{ unload_msg:"De wijzigingen zullen verloren gaan als u nu deze pagina verlaat." }, fullscreen:{ desc:"Volledig scherm" }, media:{ desc:"Media invoegen/bewerken", edit:"Media bewerken" }, fullpage:{ desc:"Documenteigenschappen" }, template:{ desc:"Voorgedefinieerd sjabloon invoegen" }, visualchars:{ desc:"Zichtbare symbolen" }, spellchecker:{ desc:"Spellingcontrole", menu:"Instellingen spellingcontrole", ignore_word:"Woord negeren", ignore_words:"Alles negeren", langs:"Talen", wait:"Een ogenblik geduld\u2026", sug:"Suggesties", no_sug:"Geen suggesties", no_mpell:"Geen spelfouten gevonden." }, pagebreak:{ desc:"Pagina-einde invoegen" }}});����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/nn.js���������������������������������������������������������0000664�0000000�0000000�00000010124�12266004471�0020251�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({nn:{ common:{ edit_confirm:"Vil du bruke WYSIWYG-editoren for dette tekstfeltet?", apply:"Legg til", insert:"Set inn", update:"Oppdater", cancel:"Avbryt", close:"Stopp", browse:"Bla gjennom", class_name:"Klasse", not_set:"--ikkje sett--", clipboard_msg:"Klipp ut / Kopier /Lim inn fungerer ikkje i Mozilla og Firefox. Vil du vite meir om dette?", clipboard_no_support:"For tida ikkje st\u00F8tta av nettlesaren din, bruk tastatursnarveger i staden.", popup_blocked:"Orsak, det er registrert at du har popup-sperre aktivert i nettlesaren. Du m\u00E5 oppheve popup-sperra for nettstaden for \u00E5 f\u00E5 tilgang til dette verktyet", invalid_data:"Feil: Ugyldige verdiar er skrivne inn, desse er merka med raudt", more_colors:"Fleire fargar" }, contextmenu:{ align:"Justering", left:"Venstre", center:"Midtstill", right:"H\u00F8gre", full:"Full" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"Lim inn dato", inserttime_desc:"Lim inn tid", months_long:"januar,februar,mars,april,mai,juni,juli,august,september,oktober,november,desember", months_short:"jan,feb,mar,apr,mai,jun,jul,aug,sep,oct,nov,des", day_long:"sundag,mandag,tirsdag,onsdag,torsdag,fredag,laurdag,sundag", day_short:"sun,man,tir,ons,tor,fre,lau,sun" }, print:{ print_desc:"Skriv u" }, preview:{ preview_desc:"F\u00F8rehandsvisni" }, directionality:{ ltr_desc:"Retning venstre mot h\u00F8gre", rtl_desc:"Retning h\u00F8gre mot venstre" }, layer:{ insertlayer_desc:"Set inn nytt lag", forward_desc:"Flytt framover", backward_desc:"Flytt bakover", absolute_desc:"Sl\u00E5 p\u00E5/av absolutt plassering", content:"Nytt lag..." }, save:{ save_desc:"Lagre", cancel_desc:"Kanseller alle endringar" }, nonbreaking:{ nonbreaking_desc:"Set inn hardt mellomrom" }, iespell:{ iespell_desc:"K\u00F8yrer kontroll av rettskriving", download:"ieSpell ikkje funnen. \u00D8nskjer du \u00E5 installere ieSpell no?" }, advhr:{ advhr_desc:"Horisontal linje" }, emotions:{ emotions_desc:"Hum\u00F8rfjes" }, searchreplace:{ search_desc:"S\u00F8k", replace_desc:"S\u00F8k/Erstatt" }, advimage:{ image_desc:"Set inn / endre bilete" }, advlink:{ link_desc:"Set inn / endre lenkje" }, xhtmlxtras:{ cite_desc:"Sitat", abbr_desc:"Forkorting", acronym_desc:"Akronym", del_desc:"Sletting", ins_desc:"Innsetjing", attribs_desc:"Set inn / Endre eigenskapar" }, style:{ desc:"Rediger CSS-stil" }, paste:{ paste_text_desc:"Lim inn som vanleg tekst", paste_word_desc:"Lim inn fr\u00E5 Word", selectall_desc:"Marker al" }, paste_dlg:{ text_title:"Bruk CTRL+V p\u00E5 tastaturet for \u00E5 lime inn i dette vindauget.", text_linebreaks:"Behald tekstbryting", word_title:"Bruk CTRL+V p\u00E5 tastaturet for \u00E5 lime inn i dette vindauget." }, table:{ desc:"Set inn ein ny tabell", row_before_desc:"Set inn rad framfor", row_after_desc:"Set inn rad etter", delete_row_desc:"Fjern rad", col_before_desc:"Set inn kolonne framfor", col_after_desc:"Set inn kolonne etter", delete_col_desc:"Fjern kolonne", split_cells_desc:"Del celler", merge_cells_desc:"Sl\u00E5 saman celler", row_desc:"Radeigenskapar", cell_desc:"Celleegenskapar", props_desc:"Tabelleigenskapar", paste_row_before_desc:"Lim inn rad framfor", paste_row_after_desc:"Lim inn rad etter", cut_row_desc:"Fjern rad", copy_row_desc:"Kopier rad", del:"Slett tabell", row:"Rad", col:"Kolonne", cell:"Celle" }, autosave:{ unload_msg:"Endringane du gjorde g\u00E5r tapt om du forl\u00E8t denne sida!" }, fullscreen:{ desc:"Skift til/fr\u00E5 fullskjermmodus" }, media:{ desc:"Set inn / rediger inkludert objekt", edit:"Endre innsett objekt" }, fullpage:{ desc:"Dokumenteigenskapar" }, template:{ desc:"Set inn f\u00F8rehandsdefinert malinnhald" }, visualchars:{ desc:"Visuelle konktrollteikn p\u00E5/av" }, spellchecker:{ desc:"Stavekontroll p\u00E5/av", menu:"Vis meny", ignore_word:"Ignorer ord", ignore_words:"Ignorer alt", langs:"Spr\u00E5k", wait:"Ver venleg og vent...", sug:"Framlegg", no_sug:"Inga framlegg", no_mpell:"Inga stavefeil funne." }, pagebreak:{ desc:"Set inn sideskift" }}});��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/no.js���������������������������������������������������������0000664�0000000�0000000�00000010144�12266004471�0020254�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({no:{ common:{ edit_confirm:"Vil du bruke WYSIWYG-editoren for dette tekstfeltet?", apply:"Legg til", insert:"Sett inn", update:"Oppdater", cancel:"Avbryt", close:"Stopp", browse:"Bla gjennom", class_name:"Klasse", not_set:"--ikke sett--", clipboard_msg:"Klipp ut / Kopier /Lim inn fungerer ikke i Mozilla og Firefox. Vil du vite mer om dette?", clipboard_no_support:"For tiden ikke st\u00F8ttet av nettleseren din, bruk tastatursnarveier i stedet.", popup_blocked:"Beklager, det er registrert at du har popup-sperre aktivert i nettleseren. Du m\u00E5 oppheve popup-sperren for nettstedet for \u00E5 f\u00E5 tilgang til dette verkt\u00F8yet", invalid_data:"Feil: Ugyldige verdier er skrevet inn, disse er merket med r\u00F8dt", more_colors:"Flere farger" }, contextmenu:{ align:"Justering", left:"Venstre", center:"Midtstill", right:"H\u00F8yre", full:"Full" }, insertdatetime:{ date_fmt:"%d-%m-%Y", time_fmt:"%H:%M:%S", insertdate_desc:"Lim inn dato", inserttime_desc:"Lim inn tid", months_long:"januar,februar,mars,april,mai,juni,juli,august,september,oktober,november,desember", months_short:"jan,feb,mar,apr,mai,jun,jul,aug,sep,oct,nov,des", day_long:"s\u00F8ndag,mandag,tirsdag,onsdag,torsdag,fredag,l\u00F8rdag,s\u00F8ndag", day_short:"s\u00F8n,man,tir,ons,tor,fre,l\u00F8r,s\u00F8n" }, print:{ print_desc:"Skriv ut" }, preview:{ preview_desc:"Forh\u00E5ndsvisning" }, directionality:{ ltr_desc:"Retning venstre mot h\u00F8yre", rtl_desc:"Retning h\u00F8yre mot venstre" }, layer:{ insertlayer_desc:"Sett inn nytt lag", forward_desc:"Flytt framover", backward_desc:"Flytt bakover", absolute_desc:"Sl\u00E5 p\u00E5/av absolutt plassering", content:"Nytt lag..." }, save:{ save_desc:"Lagre", cancel_desc:"Kanseller alle endringer" }, nonbreaking:{ nonbreaking_desc:"Sett inn hardt mellomrom" }, iespell:{ iespell_desc:"Kontroller rettskriving", download:"ieSpell ikke funnet. \u00D8nsker du \u00E5 installere ieSpell?" }, advhr:{ advhr_desc:"Horisontal linje" }, emotions:{ emotions_desc:"Hum\u00F8rfjes" }, searchreplace:{ search_desc:"S\u00F8k", replace_desc:"S\u00F8k/Erstatt" }, advimage:{ image_desc:"Sett inn / endre bilde" }, advlink:{ link_desc:"Sett inn / endre lenke" }, xhtmlxtras:{ cite_desc:"Sitat", abbr_desc:"Forkortning", acronym_desc:"Akronym", del_desc:"Sletting", ins_desc:"Innsetting", attribs_desc:"Sett inn / Endre egenskaper" }, style:{ desc:"Rediger CSS-stil" }, paste:{ paste_text_desc:"Lim inn som vanlig tekst", paste_word_desc:"Lim inn fra Word", selectall_desc:"Marker alt" }, paste_dlg:{ text_title:"Bruk CTRL+V p\u00E5 tastaturet for \u00E5 lime inn i dette vinduet.", text_linebreaks:"Behold tekstbryting", word_title:"Bruk CTRL+V p\u00E5 tastaturet for \u00E5 lime inn i dette vinduet." }, table:{ desc:"Sett inn en ny tabell", row_before_desc:"Sett inn rad framfor", row_after_desc:"Sett inn rad etter", delete_row_desc:"Fjern rad", col_before_desc:"Sett inn kolonne framfor", col_after_desc:"Sett inn kolonne etter", delete_col_desc:"Fjern kolonne", split_cells_desc:"Del celler", merge_cells_desc:"Sl\u00E5 sammen celler", row_desc:"Radegenskaper", cell_desc:"Celleegenskaper", props_desc:"Tabellegenskaper", paste_row_before_desc:"Lim inn rad framfor", paste_row_after_desc:"Lim inn rad etter", cut_row_desc:"Fjern rad", copy_row_desc:"Kopier rad", del:"Slett tabell", row:"Rad", col:"Kolonne", cell:"Celle" }, autosave:{ unload_msg:"Endringene du gjorde g\u00E5r tapt om du forlater denne siden!" }, fullscreen:{ desc:"Skift til/fra fullskjermmodus" }, media:{ desc:"Sett inn / rediger inkludert objekt", edit:"Endre innsatt objekt" }, fullpage:{ desc:"Dokumentegenskaper" }, template:{ desc:"Sett inn forh\u00E5ndsdefinert malinnhold" }, visualchars:{ desc:"Visuelle konktrolltegn p\u00E5/av" }, spellchecker:{ desc:"Stavekontroll p\u00E5/av", menu:"Vis meny", ignore_word:"Ignorer ord", ignore_words:"Ignorer alt", langs:"Spr\u00E5k", wait:"Vennligst vent...", sug:"Framlegg", no_sug:"Ingen framlegg", no_mpell:"Ingen stavefeil funnet." }, pagebreak:{ desc:"Sett inn sideskift" }}});����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/pl.js���������������������������������������������������������0000664�0000000�0000000�00000011441�12266004471�0020254�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({pl:{ common:{ edit_confirm:"Czy chcesz usu trybu WYSIWYG dla tego pola formularza?", apply:"Zastosuj", insert:"Wstaw", update:"Aktualizuj", cancel:"Anuluj", close:"Zamknij", browse:"Przegl\u0105daj", class_name:"Klasa", not_set:"-- Brak --", clipboard_msg:"Akcje Kopiuj/Wytnij/Wklej nie s\u0105 dost\u0119pne w Mozilli i Firefox.\nCzy chcesz wi\u0119cej informacji o tym problemie?", clipboard_no_support:"Aktualnie nie jest wspomagany przez Twoj\u0105 przegl\u0105dark\u0119, u\u017Cyj skr\u00F3t\u00F3w klawiaturowych w zamian.", popup_blocked:"Zauwa\u017Cyli\u015Bmy, \u017Ce Twoje blokowanie wyskakuj\u0105cych okienek wy\u0142\u0105czy\u0142o okno, kt\u00F3re dostarcza funkcjonalno\u015B\u0107 aplikacji. B\u0119dziesz potrzebowa\u0142 wy\u0142\u0105czy\u0107 blokowanie wyskakuj\u0105cych okienek na tej stronie aby w pe\u0142ni wykorzysta\u0107 to narz\u0119dzie.", invalid_data:"B\u0142\u0105d: Zosta\u0142y wprowadzone b\u0142\u0119dne dane, s\u0105 zaznaczone na czerwono.", more_colors:"Wi\u0119cej kolor\u00F3w" }, contextmenu:{ align:"Wyr\u00F3wnanie", left:"Lewy", center:"\u015Arodkowy", right:"Prawy", full:"Wyjustuj" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"Wstaw dat\u0119", inserttime_desc:"Wstaw czas", months_long:"Stycze\u0144, Luty, Marzec, Kwiecie\u0144, Maj, Czerwiec, Lipiec, Sierpie\u0144, Wrzesie\u0144, Pa\u017Adziernik, Listopad, Grudzie\u0144", months_short:"Sty,Lut,Mar,Kwi,Maj,Cze,Lip,Sie,Wrz,Pa\u017A,Lis,Gru", day_long:"Niedziela, Poniedzia\u0142ek, Wtorek, \u015Aroda, Czwartek, Pi\u0105tek, Sobota, Niedziela", day_short:"N,Pn,Wt,\u015Ar,Cz,Pt,So,N" }, print:{ print_desc:"Drukuj" }, preview:{ preview_desc:"Podgl\u0105d" }, directionality:{ ltr_desc:"Kierunek od lewej do prawej", rtl_desc:"Kierunek od prawej do lewej" }, layer:{ insertlayer_desc:"Wklej now\u0105 warstw\u0119", forward_desc:"Przesu\u0144 do przodu", backward_desc:"Przesu\u0144 w ty\u0142", absolute_desc:"Prze\u0142\u0105cz pozycjonowanie absolutne", content:"Nowa warstwa..." }, save:{ save_desc:"Zachowaj", cancel_desc:"Anuluj wszystkie zmiany" }, nonbreaking:{ nonbreaking_desc:"Wklej tward\u0105 spacj\u0119" }, iespell:{ iespell_desc:"Sprawd\u017A pisowni\u0119", download:"ieSpell nie wykryte. Czy przeprowadzi\u0107 instalacj\u0119 tego komponentu?" }, advhr:{ advhr_desc:"Pozioma linia" }, emotions:{ emotions_desc:"Emotikony" }, searchreplace:{ search_desc:"Znajd\u017A", replace_desc:"Znajd\u017A/Zamie\u0144" }, advimage:{ image_desc:"Wstaw/edytuj obraz" }, advlink:{ link_desc:"Wstaw/edytuj link" }, xhtmlxtras:{ cite_desc:"Cytat", abbr_desc:"Skr\u00F3t", acronym_desc:"Akronim", del_desc:"Usuni\u0119cie", ins_desc:"Wstawienie", attribs_desc:"Wstaw / Edytuj atrybuty" }, style:{ desc:"Edytuj Style CSS" }, paste:{ paste_text_desc:"Wklej jako zwyk\u0142y tekst", paste_word_desc:"Wklej z Worda", selectall_desc:"Zaznacz wszystko" }, paste_dlg:{ text_title:"U\u017Cyj CTRL+V na swojej klawiaturze \u017Ceby wklei\u0107 tekst do okna.", text_linebreaks:"Zachowaj ko\u0144ce linii.", word_title:"U\u017Cyj CTRL+V na swojej klawiaturze \u017Ceby wklei\u0107 tekst do okna." }, table:{ desc:"Wstaw now\u0105 tabel\u0119", row_before_desc:"Wstaw nowy wiersz przed...", row_after_desc:"Wstaw nowy wiersz po...", delete_row_desc:"Usu\u0144 wiersz", col_before_desc:"Wstaw kolumn\u0119 przed...", col_after_desc:"Wstaw kolumn\u0119 po...", delete_col_desc:"Usu\u0144 kolumn\u0119", split_cells_desc:"Podziel kom\u00F3rk\u0119", merge_cells_desc:"Po\u0142\u0105cz kom\u00F3rki", row_desc:"W\u0142a\u015Bciwo\u015Bci wiersza", cell_desc:"W\u0142a\u015Bciwo\u015Bci kom\u00F3rki", props_desc:"W\u0142a\u015Bciwo\u015Bci tabeli", paste_row_before_desc:"Wklej wiersz przed...", paste_row_after_desc:"Wklej wiersz po...", cut_row_desc:"Wytnij wiersz...", copy_row_desc:"Kopiuj wiersz...", del:"Usu\u0144 tabel\u0119", row:"Wiersz", col:"Kolumna", cell:"Kom\u00F3rka" }, autosave:{ unload_msg:"Zmiany, kt\u00F3re zrobi\u0142e\u015B zostan\u0105 utracone je\u015Bli opu\u015Bcisz t\u0119 stron\u0119." }, fullscreen:{ desc:"Prze\u0142\u0105cz tryb pe\u0142noekranowy" }, media:{ desc:"Wstaw/Edytuj wbudowane media", edit:"Edytuj wbudowane media" }, fullpage:{ desc:"W\u0142a\u015Bciwo\u015Bci dokumentu" }, template:{ desc:"Wstaw szablon dokumentu" }, visualchars:{ desc:"Graficzna kontrola pisma w\u0142\u0105cz/wy\u0142\u0105cz." }, spellchecker:{ desc:"Sprawdzanie pisowni", menu:"Ustawienia sprawdzania pisowni", ignore_word:"Ignoruj s\u0142owo", ignore_words:"Ignoruj wszystkie", langs:"J\u0119zyki", wait:"Prosz\u0119 poczeka\u0107...", sug:"Sugestie", no_sug:"Brak sugestii", no_mpell:"\u017Badnych brakuj\u0105cych nie znaleziono." }, pagebreak:{ desc:"Wstaw lini\u0119." }}});�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/ps.js���������������������������������������������������������0000664�0000000�0000000�00000007763�12266004471�0020277�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({ps:{ common:{ edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?", apply:"Apply", insert:"Insert", update:"Update", cancel:"Cancel", close:"Close", browse:"Browse", class_name:"Class", not_set:"-- Not set --", clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?", clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.", popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.", invalid_data:"Error: Invalid values entered, these are marked in red.", more_colors:"More colors" }, contextmenu:{ align:"Alignment", left:"Left", center:"Center", right:"Right", full:"Full" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"Insert date", inserttime_desc:"Insert time", months_long:"January,February,March,April,May,June,July,August,September,October,November,December", months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun" }, print:{ print_desc:"Print" }, preview:{ preview_desc:"Preview" }, directionality:{ ltr_desc:"Direction left to right", rtl_desc:"Direction right to left" }, layer:{ insertlayer_desc:"Insert new layer", forward_desc:"Move forward", backward_desc:"Move backward", absolute_desc:"Toggle absolute positioning", content:"New layer..." }, save:{ save_desc:"Save", cancel_desc:"Cancel all changes" }, nonbreaking:{ nonbreaking_desc:"Insert non-breaking space character" }, iespell:{ iespell_desc:"Run spell checking", download:"ieSpell not detected. Do you want to install it now?" }, advhr:{ advhr_desc:"Horizontal rule" }, emotions:{ emotions_desc:"Emotions" }, searchreplace:{ search_desc:"Find", replace_desc:"Find/Replace" }, advimage:{ image_desc:"Insert/edit image" }, advlink:{ link_desc:"Insert/edit link" }, xhtmlxtras:{ cite_desc:"Citation", abbr_desc:"Abbreviation", acronym_desc:"Acronym", del_desc:"Deletion", ins_desc:"Insertion", attribs_desc:"Insert/Edit Attributes" }, style:{ desc:"Edit CSS Style" }, paste:{ paste_text_desc:"Paste as Plain Text", paste_word_desc:"Paste from Word", selectall_desc:"Select All" }, paste_dlg:{ text_title:"Use CTRL+V on your keyboard to paste the text into the window.", text_linebreaks:"Keep linebreaks", word_title:"Use CTRL+V on your keyboard to paste the text into the window." }, table:{ desc:"Inserts a new table", row_before_desc:"Insert row before", row_after_desc:"Insert row after", delete_row_desc:"Delete row", col_before_desc:"Insert column before", col_after_desc:"Insert column after", delete_col_desc:"Remove column", split_cells_desc:"Split merged table cells", merge_cells_desc:"Merge table cells", row_desc:"Table row properties", cell_desc:"Table cell properties", props_desc:"Table properties", paste_row_before_desc:"Paste table row before", paste_row_after_desc:"Paste table row after", cut_row_desc:"Cut table row", copy_row_desc:"Copy table row", del:"Delete table", row:"Row", col:"Column", cell:"Cell" }, autosave:{ unload_msg:"The changes you made will be lost if you navigate away from this page." }, fullscreen:{ desc:"Toggle fullscreen mode" }, media:{ desc:"Insert / edit embedded media", edit:"Edit embedded media" }, fullpage:{ desc:"Document properties" }, template:{ desc:"Insert predefined template content" }, visualchars:{ desc:"Visual control characters on/off." }, spellchecker:{ desc:"Toggle spellchecker", menu:"Spellchecker settings", ignore_word:"Ignore word", ignore_words:"Ignore all", langs:"Languages", wait:"Please wait...", sug:"Suggestions", no_sug:"No suggestions", no_mpell:"No misspellings found." }, pagebreak:{ desc:"Insert page break." }}});�������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/pt.js���������������������������������������������������������0000664�0000000�0000000�00000010526�12266004471�0020267�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({pt:{ common:{ edit_confirm:"Deseja usar o modo de edi\u00E7\u00E3o avan\u00E7ado neste campo de texto?", apply:"Aplicar", insert:"Inserir", update:"Atualizar", cancel:"Cancelar", close:"Fechar", browse:"Procurar", class_name:"Classe", not_set:"-- N/A --", clipboard_msg:"Copiar/recortar/colar n\u00E3o est\u00E1 dispon\u00EDvel no Mozilla e Firefox.\nDeseja mais informa\u00E7\u00F5es sobre este problema?", clipboard_no_support:"O seu browser n\u00E3o suporta esta fun\u00E7\u00E3o, use os atalhos do teclado.", popup_blocked:"Detectamos que o seu bloqueador de popups bloqueou uma janela que \u00E9 essencial para a aplica\u00E7\u00E3o. Voc\u00EA precisa desativar o bloqueador de janelas de popups para utilizar esta ferramenta.", invalid_data:"Erro: Valores inv\u00E1lidos marcados em vermelho.", more_colors:"Mais Cores" }, contextmenu:{ align:"Alinhamento", left:"Esquerda", center:"Centro", right:"Direita", full:"Justificado" }, insertdatetime:{ date_fmt:"%d-%m-%Y", time_fmt:"%H:%M:%S", insertdate_desc:"Inserir data", inserttime_desc:"Inserir hora", months_long:"Janeiro,Fevereiro,Mar\u00E7o,Abril,Maio,Junho,Julho,Agosto,Setembro,Outubro,Novembro,Dezembro", months_short:"Jan,Fev,Mar,Abr,Mai,Jun,Jul,Ago,Set,Out,Nov,Dez", day_long:"Domingo,Segunda-feira,Ter\u00E7a-feira,Quarta-feira,Quinta-feira,Sexta-feira,S\u00E1bado,Domingo", day_short:"Dom,Seg,Ter,Qua,Qui,Sex,Sab,Dom" }, print:{ print_desc:"Imprimir" }, preview:{ preview_desc:"Pr\u00E9-visualizar" }, directionality:{ ltr_desc:"Da esquerda para direita", rtl_desc:"Da direita para esquerda" }, layer:{ insertlayer_desc:"Inserir nova camada", forward_desc:"Mover para frente", backward_desc:"Mover para tr\u00E1s", absolute_desc:"Alternar o posicionamento absoluto", content:"Nova camada..." }, save:{ save_desc:"Salvar", cancel_desc:"Cancelar todas as altera\u00E7\u00F5es" }, nonbreaking:{ nonbreaking_desc:"Inserir um espa\u00E7o \"sem quebra\"" }, iespell:{ iespell_desc:"Verificar ortografia", download:"Plugin de ortografia n\u00E3o-detectado. Deseja instalar agora?" }, advhr:{ advhr_desc:"Separador horizontal" }, emotions:{ emotions_desc:"Emoticons" }, searchreplace:{ search_desc:"Localizar", replace_desc:"Localizar/substituir" }, advimage:{ image_desc:"Inserir/editar imagem" }, advlink:{ link_desc:"Inserir/editar hyperlink" }, xhtmlxtras:{ cite_desc:"Cita\u00E7\u00E3o", abbr_desc:"Abrevia\u00E7\u00E3o", acronym_desc:"Acr\u00F4nimo", del_desc:"Apagar", ins_desc:"Inserir", attribs_desc:"Inserir/Editar atributos" }, style:{ desc:"Editar CSS" }, paste:{ paste_text_desc:"Colar como texto simples", paste_word_desc:"Colar (copiado do WORD)", selectall_desc:"Selecionar tudo" }, paste_dlg:{ text_title:"Use CTRL+V para colar o texto na janela.", text_linebreaks:"Manter quebras de linha", word_title:"Use CTRL+V para colar o texto na janela." }, table:{ desc:"Inserir nova tabela", row_before_desc:"Inserir linha antes", row_after_desc:"Inserir linha depois", delete_row_desc:"Apagar linha", col_before_desc:"Inserir coluna antes", col_after_desc:"Inserir coluna depois", delete_col_desc:"Remover coluna", split_cells_desc:"Dividir c\u00E9lulas", merge_cells_desc:"Unir c\u00E9lulas", row_desc:"Propriedades das linhas", cell_desc:"Propriedades das c\u00E9lulas", props_desc:"Propriedades da tabela", paste_row_before_desc:"Colar linha antes", paste_row_after_desc:"Colar linha depois", cut_row_desc:"Recortar linha", copy_row_desc:"Copiar linha", del:"Apagar tabela", row:"Linha", col:"Coluna", cell:"C\u00E9lula" }, autosave:{ unload_msg:"As mudan\u00E7as efetuadas ser\u00E3o perdidas se sair desta p\u00E1gina." }, fullscreen:{ desc:"Tela Inteira" }, media:{ desc:"Inserir/Editar m\u00EDdia incorporada", edit:"Editar m\u00EDdia incorporada" }, fullpage:{ desc:"Propriedades do Documento" }, template:{ desc:"Inserir template" }, visualchars:{ desc:"Caracteres de controle visual ligado/desligado" }, spellchecker:{ desc:"Alternar verifica\u00E7\u00E3o ortogr\u00E1fica", menu:"Configura\u00E7\u00F5es de ortografia", ignore_word:"Ignorar palavra", ignore_words:"Ignorar tudo", langs:"Linguagens", wait:"Aguarde...", sug:"Sugest\u00F5es", no_sug:"Sem sugest\u00F5es", no_mpell:"N\u00E3o foram detectados erros de ortografia." }, pagebreak:{ desc:"Inserir quebra de p\u00E1gina." }}});��������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/ro.js���������������������������������������������������������0000664�0000000�0000000�00000011447�12266004471�0020267�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({ro:{ common:{ edit_confirm:"Dori\u0163i s\u0103 folosi\u0163i un editor avansat pentru aceast\u0103 zon\u0103d de text?", apply:"Aplic\u0103", insert:"Insereaz\u0103", update:"Actualizeaz\u0103", cancel:"Anulare", close:"\u00CEnchide", browse:"R\u0103sfoie\u015Fte", class_name:"Clas\u0103", not_set:"-- Nestat\u0103 --", clipboard_msg:"Copiere/T\u0103iere/Lipire nu sunt disponibile \u00EEn Mozilla \u015Fi Firefox.\nDori\u0163i mai multe informa\u0163ii despre aceast\u0103 problem\u0103?", clipboard_no_support:"Deocamdat\u0103 nu este suportat\u0103 de browser. V\u0103 rug\u0103m s\u0103 folosi\u0163i combina\u0163ii de taste.", popup_blocked:"Ne pare r\u0103u, dar un popup-blocker a dezativat o fereastr\u0103 care d\u0103 func\u0163ionalitate aplica\u0163iei.Trebuie s\u0103 dezactiva\u0163i acel popup-blocker pentru acest site pentru a folosi aplica\u0163ia la capacitate maxim\u0103.", invalid_data:"Ave\u0163i erori. Datele gre\u015Fite sunt \u00EEn ro\u015Fu.", more_colors:"Mai multe culori" }, contextmenu:{ align:"Aliniere", left:"St\u00E2nga", center:"Centru", right:"Dreapta", full:"Justify" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"Insereaz\u0103 dat\u0103", inserttime_desc:"Insereaz\u0103 or\u0103", months_long:"Ianuarie,Februarie,Martie,Aprilie,Mai,Iunie,Iulie,August,Septembrie,Octombrie,Noiembrie,Decembrie ", months_short:"Ian,Feb,Mar,Apr,Mai,Iun,Iul,Aug,Sep,Oct,Noi,Dec", day_long:"Duminic\u0103,Luni,Mar\u0163i,Miercuri,Joi,Vineri,S\u00E2mb\u0103t\u0103,Duminic\u0103", day_short:"Dum,Lun,Mar,Mie,Joi,Vin,S\u00E2m,Dum" }, print:{ print_desc:"Imprimare" }, preview:{ preview_desc:"Previzualizare" }, directionality:{ ltr_desc:"Direc\u0163ia de la st\u00E2nga la dreapta", rtl_desc:"Direc\u0163ia de la dreapta la st\u00E2nga" }, layer:{ insertlayer_desc:"Insereaz\u0103 stat nou", forward_desc:"Mut\u0103 \u00EEnainte", backward_desc:"Mut\u0103 \u00EEnapoi", absolute_desc:"Pozi\u0163ionare absolut\u0103", content:"Strat nou ..." }, save:{ save_desc:"Salveaz\u0103", cancel_desc:"Anuleaz\u0103 toate schimb\u0103rile" }, nonbreaking:{ nonbreaking_desc:"Insereaz\u0103 caracterul spa\u0163iu" }, iespell:{ iespell_desc:"Ruleaz\u0103 corectorul de limb\u0103", download:"ieSpell nu a fost detectat. Dori\u0163i s\u0103-l instala\u0163i?" }, advhr:{ advhr_desc:"Linie orizontal\u0103" }, emotions:{ emotions_desc:"Figurine" }, searchreplace:{ search_desc:"Caut\u0103", replace_desc:"Caut\u0103/\u00CEnlocuie\u015Fte" }, advimage:{ image_desc:"Inserare/editare imagine" }, advlink:{ link_desc:"Inserare/editare leg\u0103tur\u0103" }, xhtmlxtras:{ cite_desc:"Citat", abbr_desc:"Abreviere", acronym_desc:"Acronim", del_desc:"\u015Etergere", ins_desc:"Inserare", attribs_desc:"Insereaz\u0103/editeaz\u0103 atribute" }, style:{ desc:"Editare CSS" }, paste:{ paste_text_desc:"Lipire ca text simplu", paste_word_desc:"Lipire din Word", selectall_desc:"Selecteaz\u0103 tot" }, paste_dlg:{ text_title:"Folosi\u0163i CTRL+V pentru a lipi \u00EEn aceast\u0103 zon\u0103.", text_linebreaks:"P\u0103streaz\u0103 separatoarele de linii.", word_title:"Folosi\u0163i CTRL+V pentru a lipi \u00EEn aceast\u0103 zon\u0103." }, table:{ desc:"Insereaz\u0103 tabel nou", row_before_desc:"Inserare r\u00E2nd \u00EEnainte", row_after_desc:"Inserare r\u00E2nd dup\u0103", delete_row_desc:"\u015Eterge r\u00E2nd", col_before_desc:"Inserare coloan\u0103 \u00EEnainte", col_after_desc:"Inserare coloan\u0103 dup\u0103", delete_col_desc:"\u015Eterge coloan\u0103", split_cells_desc:"Separa\u0163i celule unite", merge_cells_desc:"Uni\u0163i celule", row_desc:"Propriet\u0103\u0163i r\u00E2nd", cell_desc:"Propriet\u0103\u0163i celul\u0103", props_desc:"Propriet\u0103\u0163i tabel", paste_row_before_desc:"Lipe\u015Fte r\u00E2nd \u00EEnainte", paste_row_after_desc:"Lipe\u015Fte r\u00E2nd dup\u0103", cut_row_desc:"Taie r\u00E2nd", copy_row_desc:"Copiaz\u0103 r\u00E2nd", del:"\u015Eterge tabel", row:"R\u00E2nd", col:"Coloan\u0103", cell:"Celul\u0103" }, autosave:{ unload_msg:"Modific\u0103rile nu vor fi salvate." }, fullscreen:{ desc:"Mod ecran complet" }, media:{ desc:"Insereaz\u0103 / editeaz\u0103 media", edit:"Editeaz\u0103 media" }, fullpage:{ desc:"Propriet\u0103\u0163i document" }, template:{ desc:"Insereaz\u0103 un \u015Fablon predefinit" }, visualchars:{ desc:"Comut\u0103 caracterele vizuale de control" }, spellchecker:{ desc:"Activare/dezactivare dic\u0163ionar", menu:"Set\u0103ri dic\u0163ionar", ignore_word:"Ignor\u0103 cuv\u00E2nt", ignore_words:"Ignor\u0103 toate", langs:"Limbi", wait:"V\u0103 rog a\u015Ftepta\u0163i...", sug:"Sugestii", no_sug:"Nu sunt sugestii.", no_mpell:"Nu sunt gre\u015Feli." }, pagebreak:{ desc:"Insereaz\u0103 un separator de pagin\u0103" }}});�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/ru.js���������������������������������������������������������0000664�0000000�0000000�00000031370�12266004471�0020272�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({ru:{ common:{ edit_confirm:"\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044F \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C WYSIWYG \u0440\u0435\u0436\u0438\u043C \u0434\u043B\u044F \u044D\u0442\u043E\u0433\u043E \u043F\u043E\u043B\u044F?", apply:"\u041F\u0440\u0438\u043C\u0435\u043D\u0438\u0442\u044C", insert:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C", update:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C", cancel:"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C", close:"\u0417\u0430\u043A\u0440\u044B\u0442\u044C", browse:"\u041F\u0440\u043E\u0441\u043C\u043E\u0442\u0440", class_name:"\u041A\u043B\u0430\u0441\u0441", not_set:"- \u043D\u0435 \u0432\u044B\u0431\u0440\u0430\u043D\u043E -", clipboard_msg:"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C / \u0412\u044B\u0440\u0435\u0437\u0430\u0442\u044C / \u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C (\u043D\u0435 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E \u0432 Mozilla \u0438 Firefox) \ n \u0412\u0430\u043C \u0438\u043D\u0442\u0435\u0440\u0435\u0441\u043D\u0430\u044F \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043E\u0431 \u044D\u0442\u043E\u043C?", clipboard_no_support:"\u0412 \u0434\u0430\u043D\u043D\u044B\u0439 \u043C\u043E\u043C\u0435\u043D\u0442 \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u0412\u0430\u0448\u0438\u043C \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043E\u043C, \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \u0433\u043E\u0440\u044F\u0447\u0438\u0435 \u043A\u043B\u0430\u0432\u0438\u0448\u0438", popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool", invalid_data:"\u041E\u0448\u0438\u0431\u043A\u0430: \u0412\u0432\u0435\u0434\u0435\u043D \u043E\u0448\u0438\u0431\u043E\u0447\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435, \u043E\u0442\u043C\u0435\u0447\u0435\u043D\u043E \u043A\u0440\u0430\u0441\u043D\u044B\u043C", more_colors:"\u0411\u043E\u043B\u044C\u0448\u0435 \u0446\u0432\u0435\u0442\u043E\u0432" }, contextmenu:{ align:"\u0412\u044B\u0440\u0430\u0432\u043D\u0438\u0432\u0430\u043D\u0438\u0435", left:"\u041F\u043E \u043B\u0435\u0432\u043E\u043C\u0443 \u043A\u0440\u0430\u044E", center:"\u041F\u043E \u0446\u0435\u043D\u0442\u0440\u0443", right:"\u041F\u043E \u043F\u0440\u0430\u0432\u043E\u043C\u0443 \u043A\u0440\u0430\u044E", full:"\u041F\u043E \u0448\u0438\u0440\u0438\u043D\u0435" }, insertdatetime:{ date_fmt:"% d.% m.% Y", time_fmt:"% H:% M:% S", insertdate_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u0434\u0430\u0442\u0443", inserttime_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u0432\u0440\u0435\u043C\u044F", months_long:"\u044F\u043D\u0432\u0430\u0440\u044C, \u0444\u0435\u0432\u0440\u0430\u043B\u044C, \u043C\u0430\u0440\u0442, \u0430\u043F\u0440\u0435\u043B\u044C, \u043C\u0430\u0439, \u0438\u044E\u043D\u044C, \u0438\u044E\u043B\u044C, \u0430\u0432\u0433\u0443\u0441\u0442, \u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044C, \u043E\u043A\u0442\u044F\u0431\u0440\u044C, \u043D\u043E\u044F\u0431\u0440\u044C, \u0434\u0435\u043A\u0430\u0431\u0440\u044C", months_short:"\u044F\u043D\u0432\u0430\u0440\u044C, \u0444\u0435\u0432\u0440\u0430\u043B\u044C, \u043C\u0430\u0440\u0442, \u0430\u043F\u0440\u0435\u043B\u044C, \u043C\u0430\u0439, \u0438\u044E\u043D\u044C, \u0438\u044E\u043B\u044C, \u0430\u0432\u0433\u0443\u0441\u0442, \u0421\u0435\u043D\u0442\u044F\u0431\u0440\u044C, \u041E\u043A\u0442\u044F\u0431\u0440\u044C, \u041D\u043E\u044F\u0431\u0440\u044C, \u0414\u0435\u043A\u0430\u0431\u0440\u044C", day_long:"\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435, \u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A, \u0432\u0442\u043E\u0440\u043D\u0438\u043A, \u0441\u0440\u0435\u0434\u0430, \u0447\u0435\u0442\u0432\u0435\u0440\u0433, \u043F\u044F\u0442\u043D\u0438\u0446\u0443, \u0441\u0443\u0431\u0431\u043E\u0442\u0443, \u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435", day_short:"\u0412\u0441, \u041F\u043D, \u0412\u0442, \u0421\u0440, \u0427\u0442, \u041F\u0442, \u0421\u0431, \u0412\u0441" }, print:{ print_desc:"\u041F\u0435\u0447\u0430\u0442\u044C" }, preview:{ preview_desc:"\u041F\u0440\u043E\u0441\u043C\u043E\u0442\u0440" }, directionality:{ ltr_desc:"\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u043B\u0435\u0432\u0430 \u043D\u0430\u043F\u0440\u0430\u0432\u043E", rtl_desc:"\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u043F\u0440\u0430\u0432\u0430 \u043D\u0430\u043B\u0435\u0432\u043E" }, layer:{ insertlayer_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u043D\u043E\u0432\u044B\u0439 \u0441\u043B\u043E\u0439", forward_desc:"\u0412\u0432\u0435\u0440\u0445", backward_desc:"\u041F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C \u043D\u0430\u0437\u0430\u0434", absolute_desc:"Toggle absolute positioning", content:"\u041D\u043E\u0432\u044B\u0439 \u0441\u043B\u043E\u0439 ..." }, save:{ save_desc:"\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C", cancel_desc:"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u0432\u0441\u0435 \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F" }, nonbreaking:{ nonbreaking_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u043D\u0435\u0440\u0430\u0437\u0440\u044B\u0432\u043D\u044B\u0439 \u043F\u0440\u043E\u0431\u0435\u043B" }, iespell:{ iespell_desc:"\u0417\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u044C \u043E\u0440\u0444\u043E\u0433\u0440\u0430\u0444\u0438\u044E", download:"ieSpell \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E. \u0425\u043E\u0442\u0438\u0442\u0435 \u043F\u0440\u043E\u0438\u043D\u0441\u0442\u0430\u043B\u043B\u0438\u0440\u043E\u0432\u0430\u0442\u044C?" }, advhr:{ advhr_desc:"\u0413\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u0435\u043B\u044C" }, emotions:{ emotions_desc:"\u0421\u043C\u0430\u0439\u043B\u0438\u043A\u0438" }, searchreplace:{ search_desc:"\u041D\u0430\u0439\u0442\u0438", replace_desc:"\u041D\u0430\u0439\u0442\u0438 / \u0417\u0430\u043C\u0435\u043D\u0438\u0442\u044C" }, advimage:{ image_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C / \u0438\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435", delta_width:"200" }, advlink:{ link_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C / \u0438\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u0443", delta_width:"200" }, xhtmlxtras:{ cite_desc:"Citation", abbr_desc:"Abbreviation", acronym_desc:"Acronym", del_desc:"Deletion", ins_desc:"Insertion", attribs_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C / \u0438\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044B" }, style:{ desc:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C CSS \u0441\u0442\u0438\u043B\u044C" }, paste:{ paste_text_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u043A\u0430\u043A \u0442\u0435\u043A\u0441\u0442", paste_word_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u0438\u0437 Word", selectall_desc:"\u0412\u044B\u0434\u0435\u043B\u0438\u0442\u044C \u0432\u0441\u0435" }, paste_dlg:{ text_title:"\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 CTRL + V \u0434\u043B\u044F \u0432\u0441\u0442\u0430\u0432\u043A\u0438 \u0442\u0435\u043A\u0441\u0442\u0430 \u0432 \u043E\u043A\u043D\u043E", text_linebreaks:"\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u043F\u0435\u0440\u0435\u043D\u043E\u0441\u044B \u0441\u0442\u0440\u043E\u043A", word_title:"\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 CTRL + V \u0434\u043B\u044F \u0432\u0441\u0442\u0430\u0432\u043A\u0438 \u0442\u0435\u043A\u0441\u0442\u0430 \u0432 \u043E\u043A\u043D\u043E" }, table:{ desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u043D\u043E\u0432\u0443\u044E \u0442\u0430\u0431\u043B\u0438\u0446\u0443", row_before_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u0441\u0442\u0440\u043E\u043A\u0443 \u0434\u043E", row_after_desc:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0441\u0442\u0440\u043E\u043A\u0443 \u043F\u043E\u0441\u043B\u0435", delete_row_desc:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0442\u0440\u043E\u043A\u0443", col_before_desc:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0441\u0442\u043E\u043B\u0431\u0435\u0446 \u0434\u043E", col_after_desc:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0441\u0442\u043E\u043B\u0431\u0435\u0446 \u043F\u043E\u0441\u043B\u0435", delete_col_desc:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0442\u043E\u043B\u0431\u0435\u0446", split_cells_desc:"\u0420\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u044C \u044F\u0447\u0435\u0439\u043A\u0438", merge_cells_desc:"\u041E\u0431\u044A\u0435\u0434\u0438\u043D\u0438\u0442\u044C \u044F\u0447\u0435\u0439\u043A\u0438", row_desc:"\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u043E\u043A\u0435 \u0442\u0430\u0431\u043B\u0438\u0446\u044B", cell_desc:"\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u044F\u0447\u0435\u0439\u043A\u0438 \u0442\u0430\u0431\u043B\u0438\u0446\u044B", props_desc:"\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u0442\u0430\u0431\u043B\u0438\u0446\u044B", paste_row_before_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u0441\u0442\u0440\u043E\u043A\u0443 \u0434\u043E", paste_row_after_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u0441\u0442\u0440\u043E\u043A\u0443 \u043F\u043E\u0441\u043B\u0435", cut_row_desc:"\u0412\u044B\u0440\u0435\u0437\u0430\u0442\u044C \u0441\u0442\u0440\u043E\u043A\u0443 \u0442\u0430\u0431\u043B\u0438\u0446\u044B", copy_row_desc:"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0442\u0440\u043E\u043A\u0443 \u0442\u0430\u0431\u043B\u0438\u0446\u044B", del:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0442\u0430\u0431\u043B\u0438\u0446\u0443", row:"\u0421\u0442\u0440\u043E\u043A\u0430", col:"\u041F\u043E\u043B\u0435", cell:"\u042F\u0447\u0435\u0439\u043A\u0430", cellprops_delta_width:"30" }, autosave:{ unload_msg:"\u0418\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0432\u044B \u0441\u0434\u0435\u043B\u0430\u043B\u0438, \u0431\u0443\u0434\u0443\u0442 \u043F\u043E\u0442\u0435\u0440\u044F\u043D\u044B, \u0435\u0441\u043B\u0438 \u0432\u044B \u043F\u0435\u0440\u0435\u0439\u0434\u0435\u0442\u0435 \u0441 \u044D\u0442\u043E\u0439 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B." }, fullscreen:{ desc:"\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u0441\u044F \u043D\u0430 \u0432\u0435\u0441\u044C \u044D\u043A\u0440\u0430\u043D" }, media:{ desc:"\u0412\u0441\u0442\u0440\u043E\u0435\u043D\u043D\u043E\u0435 \u043C\u0435\u0434\u0438\u0430-\u0441\u043E\u0434\u0435\u0440\u0436\u0430\u043D\u0438\u0435", edit:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043C\u0435\u0434\u0438\u0430-\u0441\u043E\u0434\u0435\u0440\u0436\u0430\u043D\u0438\u0435" }, fullpage:{ desc:"\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430" }, template:{ desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u043D\u044B\u0439 \u043A\u043E\u043D\u0442\u0435\u043D\u0442" }, visualchars:{ desc:"\u0412\u0438\u0437\u0443\u0430\u043B\u044C\u043D\u044B\u0435 \u0441\u0438\u043C\u0432\u043E\u043B\u044B" }, spellchecker:{ desc:"\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0443", menu:"\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438", ignore_word:"\u0418\u0433\u043D\u043E\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u043B\u043E\u0432\u043E", ignore_words:"\u0418\u0433\u043D\u043E\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435", langs:"\u042F\u0437\u044B\u043A\u0438", wait:"\u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u043F\u043E\u0434\u043E\u0436\u0434\u0438\u0442\u0435 ...", sug:"\u0412\u0430\u0440\u0438\u0430\u043D\u0442\u044B", no_sug:"\u041D\u0435\u0442 \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u043E\u0432", no_mpell:"\u041E\u0448\u0438\u0431\u043E\u043A \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E" }, pagebreak:{ desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u0440\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u0435\u043B\u044C \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B" }}});������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/sc.js���������������������������������������������������������0000664�0000000�0000000�00000013617�12266004471�0020255�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({sc:{ common:{ edit_confirm:"\u662F\u5426\u5728\u6B64textarea\u6807\u7B7E\u5185\u4F7F\u7528\u300C\u6240\u89C1\u5373\u6240\u5F97\u300D\u6A21\u5F0F\uFF1F ", apply:"\u5E94\u7528", insert:"\u63D2\u5165", update:"\u66F4\u65B0", cancel:"\u53D6\u6D88", close:"\u5173\u95ED", browse:"\u6D41\u89C8", class_name:"\u6837\u5F0F", not_set:"--\u672A\u8BBE\u7F6E--", clipboard_msg:"\u590D\u5236\u3001\u526A\u4E0B\u3001\u8D34\u4E0A\u529F\u80FD\u5728Mozilla\u548CFirefox\u4E2D\u4E0D\u80FD\u4F7F\u7528\u3002 \n\u662F\u5426\u9700\u8981\u4E86\u89E3\u66F4\u591A\u6709\u5173\u6B64\u95EE\u9898\u7684\u8D44\u8BAF\uFF1F ", clipboard_no_support:"\u8FD8\u4E0D\u652F\u63F4\u60A8\u7684\u6D41\u89C8\u5668\uFF0C\u8BF7\u4F7F\u7528\u952E\u76D8\u5FEB\u6377\u65B9\u5F0F", popup_blocked:"\u62B1\u6B49\uFF01\u5F39\u51FA\u89C6\u7A97\u5DF2\u88AB\u963B\u6B62\uFF0C\u8BF7\u8C03\u6574\u6D41\u89C8\u5668\u8BBE\u7F6E\uFF0C\u5141\u8BB8\u6B64\u7F51\u7AD9\u53EF\u5F39\u51FA\u65B0\u89C6\u7A97\uFF0C\u4EE5\u4FBF\u4F7F\u7528\u6B64\u5DE5\u5177", invalid_data:"\u9519\u8BEF:\u65E0\u6548\u8F93\u5165\u503C\uFF0C\u5DF2\u6807\u8BB0\u4E3A\u7EA2\u8272\u3002 ", more_colors:"\u66F4\u591A\u989C\u8272" }, contextmenu:{ align:"\u5BF9\u9F50\u65B9\u5F0F", left:"\u9760\u5DE6\u5BF9\u9F50", center:"\u5C45\u4E2D\u5BF9\u9F50", right:"\u9760\u53F3\u5BF9\u9F50", full:"\u4E24\u7AEF\u5BF9\u9F50" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"\u63D2\u5165\u4ECA\u5929\u65E5\u671F", inserttime_desc:"\u63D2\u5165\u73B0\u5728\u65F6\u95F4", months_long:"\u4E00\u6708,\u4E8C\u6708,\u4E09\u6708,\u56DB\u6708,\u4E94\u6708,\u516D\u6708,\u4E03\u6708,\u516B\u6708,\u4E5D\u6708,\u5341\u6708,\u5341\u4E00\u6708,\u5341\u4E8C\u6708", months_short:"1\u6708,2\u6708,3\u6708,4\u6708,5\u6708,6\u6708,7\u6708,8\u6708,9\u6708,10\u6708,11\u6708,12\u6708", day_long:"\u661F\u671F\u65E5,\u661F\u671F\u4E00,\u661F\u671F\u4E8C,\u661F\u671F\u4E09,\u661F\u671F\u56DB,\u661F\u671F\u4E94,\u661F\u671F\u516D,\u661F\u671F\u65E5", day_short:"\u5468\u65E5,\u5468\u4E00,\u5468\u4E8C,\u5468\u4E09,\u5468\u56DB,\u5468\u4E94,\u5468\u516D,\u5468\u65E5" }, print:{ print_desc:"\u5217\u5370" }, preview:{ preview_desc:"\u9884\u89C8" }, directionality:{ ltr_desc:"\u6587\u5B57\u4ECE\u5DE6\u5230\u53F3", rtl_desc:"\u6587\u5B57\u4ECE\u53F3\u5230\u5DE6" }, layer:{ insertlayer_desc:"\u63D2\u5165\u5C42", forward_desc:"\u7F6E\u524D", backward_desc:"\u7F6E\u540E", absolute_desc:"\u5F00\u5173\u7EDD\u5BF9\u4F4D\u7F6E", content:"\u65B0\u589E\u5C42..." }, save:{ save_desc:"\u4FDD\u5B58", cancel_desc:"\u53D6\u6D88\u6240\u6709\u66F4\u6539" }, nonbreaking:{ nonbreaking_desc:"\u63D2\u5165\u7A7A\u767D\u683C" }, iespell:{ iespell_desc:"\u62FC\u5199\u68C0\u67E5", download:"\u672A\u68C0\u6D4B\u5230ieSpell\u7684\u5B58\u5728\u3002\u662F\u5426\u73B0\u5728\u7ACB\u5373\u5B89\u88C5\uFF1F " }, advhr:{ advhr_desc:"\u6C34\u5E73\u7EBF" }, emotions:{ emotions_desc:"\u56FE\u91CA" }, searchreplace:{ search_desc:"\u67E5\u627E", replace_desc:"\u67E5\u627E/\u66FF\u6362" }, advimage:{ image_desc:"\u63D2\u5165/\u7F16\u8F91\u56FE\u7247" }, advlink:{ link_desc:"\u63D2\u5165/\u7F16\u8F91\u8FDE\u7ED3" }, xhtmlxtras:{ cite_desc:"\u5F15\u6587", abbr_desc:"\u7F29\u5199", acronym_desc:"\u9996\u5B57\u7F29\u5199", del_desc:"\u5220\u9664", ins_desc:"\u63D2\u5165", attribs_desc:"\u63D2\u5165/\u7F16\u8F91\u5C5E\u6027", attribs_delta_width:"40", attribs_delta_height:"60" }, style:{ desc:"\u7F16\u8F91CSS\u6837\u5F0F\u8868\u5355" }, paste:{ paste_text_desc:"\u4EE5\u7EAF\u6587\u672C\u8D34\u4E0A", paste_word_desc:"\u4ECEWord\u8D34\u4E0A", selectall_desc:"\u5168\u9009" }, paste_dlg:{ text_title:"\u5728\u952E\u76D8\u4E0A\u540C\u65F6\u6309\u4E0BCTRL\u548CV\u952E\uFF0C\u4EE5\u8D34\u4E0A\u6587\u5B57\u5230\u6B64\u89C6\u7A97\u3002 ", text_linebreaks:"\u4FDD\u7559\u6362\u884C\u7B26\u53F7", word_title:"\u5728\u952E\u76D8\u4E0A\u540C\u65F6\u6309\u4E0BCTRL\u548CV\u952E\uFF0C\u4EE5\u8D34\u4E0A\u6587\u5B57\u5230\u6B64\u89C6\u7A97\u3002 " }, table:{ desc:"\u63D2\u5165\u65B0\u8868\u683C", row_before_desc:"\u63D2\u5165\u4E0A\u65B9\u884C", row_after_desc:"\u63D2\u5165\u4E0B\u65B9\u884C", delete_row_desc:"\u5220\u9664\u6240\u5728\u884C", col_before_desc:"\u63D2\u5165\u5DE6\u65B9\u5217", col_after_desc:"\u63D2\u5165\u53F3\u65B9\u5217", delete_col_desc:"\u5220\u9664\u6240\u5728\u5217", split_cells_desc:"\u5206\u5272\u5355\u683C", merge_cells_desc:"\u5408\u5E76\u5355\u683C", row_desc:"\u884C\u5C5E\u6027", cell_desc:"\u5355\u683C\u5C5E\u6027", props_desc:"\u8868\u683C\u5C5E\u6027", paste_row_before_desc:"\u8D34\u5728\u4E0A\u884C", paste_row_after_desc:"\u8D34\u5728\u4E0B\u884C", cut_row_desc:"\u526A\u4E0B\u9009\u62E9\u884C", copy_row_desc:"\u590D\u5236\u9009\u62E9\u884C", del:"\u5220\u9664\u8868\u683C", row:"\u884C", col:"\u5217", cell:"\u5355\u683C", cellprops_delta_width:"10", cellprops_delta_height:"10", table_delta_width:"40", table_delta_height:"60", merge_cells_delta_width:"40", merge_cells_delta_height:"40" }, autosave:{ unload_msg:"\u5982\u679C\u79BB\u5F00\u6B64\u9875\u9762\u5C06\u5BFC\u81F4\u6240\u505A\u7684\u66F4\u6539\u5168\u90E8\u4E22\u5931\u3002 " }, fullscreen:{ desc:"\u5F00\u5173\u5168\u5C4F\u6A21\u5F0F" }, media:{ desc:"\u63D2\u5165/\u7F16\u8F91\u5D4C\u5165\u5A92\u4F53", edit:"\u7F16\u8F91\u5D4C\u5165\u5A92\u4F53" }, fullpage:{ desc:"\u6863\u5C5E\u6027" }, template:{ desc:"\u63D2\u5165\u9884\u5B9A\u7684\u8303\u672C\u5185\u5BB9" }, visualchars:{ desc:"\u663E\u793A\u63A7\u5236\u7B26\u53F7\u5F00/\u5173\u3002 " }, spellchecker:{ desc:"\u5F00\u5173\u62FC\u5199\u68C0\u67E5", menu:"\u62FC\u5199\u68C0\u67E5\u8BBE\u7F6E", ignore_word:"\u7565\u8FC7", ignore_words:"\u5168\u90E8\u7565\u8FC7", langs:"\u8BED\u8A00", wait:"\u8BF7\u7A0D\u5019...", sug:"\u63A8\u8350\u5B57\u8BCD", no_sug:"\u65E0\u62FC\u5199\u63A8\u8350", no_mpell:"\u672A\u53D1\u73B0\u62FC\u5199\u9519\u8BEF" }, pagebreak:{ desc:"\u63D2\u5165\u5206\u9875\u7B26\u53F7" }}});�����������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/se.js���������������������������������������������������������0000664�0000000�0000000�00000010712�12266004471�0020250�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({se:{ common:{ edit_confirm:"Vill du anv\u00E4nda WYSIWYG l\u00E4get f\u00F6r denna textarea.", apply:"Applicera", insert:"Infoga", update:"Uppdatera", cancel:"Avbryt", close:"St\u00E4ng", browse:"Bl\u00E4ddra", class_name:"Klass", not_set:"-- Inte satt --", clipboard_msg:"Kopiera/klipp ut/klistra in \u00E4r inte tillg\u00E4ngligt i din webbl\u00E4sare.\nVill du veta mer?", clipboard_no_support:"Funktionen \u00E4r inte tillg\u00E4nglig i din webbl\u00E4sare, anv\u00E4nd tangentbordsgenv\u00E4garna i st\u00E4llet.", popup_blocked:"Popup blockerare detekterad. St\u00E4ng av den s\u00E5 att dialogerna kan \u00F6ppnas.", invalid_data:"Fel: Inkorrekta v\u00E4rden har matats in, dessa \u00E4r markerade i r\u00F6tt.", more_colors:"Fler f\u00E4rger" }, contextmenu:{ align:"Justering", left:"V\u00E4nster", center:"Centrerad", right:"H\u00F6ger", full:"Utfyllnad" }, insertdatetime:{ date_fmt:"%Y-%m-%d ", time_fmt:"%H:%M:%S", insertdate_desc:"Infoga datum", inserttime_desc:"Infoga tid", months_long:"Januari,Februari,Mars,April,Maj,Juni,Juli,Augusti,September,Oktober,November,December", months_short:"Jan,Feb,Mar,Apr,Maj,Jun,Jul,Aug,Sep,Okt,Nov,Dec", day_long:"S\u00F6ndag,M\u00E5ndag,Tisdag,Onsdag,Torsdag,Fredag,L\u00F6rdag,S\u00F6ndag", day_short:"S\u00F6n,M\u00E5n,Tis,Ons,Tors,Fre,L\u00F6r,S\u00F6n" }, print:{ print_desc:"Skriv ut" }, preview:{ preview_desc:"F\u00F6rhandsgranska" }, directionality:{ ltr_desc:"Skriftl\u00E4ge - v\u00E4nster till h\u00F6ger", rtl_desc:"Skriftl\u00E4ge - h\u00F6ger till v\u00E4nster" }, layer:{ insertlayer_desc:"Infoga nytt lager", forward_desc:"Flytta fram\u00E5t", backward_desc:"Flytta bak\u00E5t", absolute_desc:"Sl\u00E5 av/p\u00E5 absolut positionering", content:"Nytt lager..." }, save:{ save_desc:"Spara", cancel_desc:"Hoppa \u00F6ver alla f\u00F6r\u00E4ndringar" }, nonbreaking:{ nonbreaking_desc:"Infoga icke radbrytande mellanslag" }, iespell:{ iespell_desc:"R\u00E4ttstava", download:"ieSpell kunde inte hittas, vill du installera denna nu?" }, advhr:{ advhr_desc:"Horisontell skiljelinje" }, emotions:{ emotions_desc:"Smileys" }, searchreplace:{ search_desc:"S\u00F6k", replace_desc:"S\u00F6k/ers\u00E4tt" }, advimage:{ image_desc:"Infoga/redigera bild" }, advlink:{ link_desc:"Infoga/redigera l\u00E4nk" }, xhtmlxtras:{ cite_desc:"citat", abbr_desc:"F\u00F6rkortning", acronym_desc:"Akronym", del_desc:"Markera som struket", ins_desc:"Markera som tillagt", attribs_desc:"Redigera attribut" }, style:{ desc:"Redigera inline CSS" }, paste:{ paste_text_desc:"Klistra in som text", paste_word_desc:"Klistra in fr\u00E5n Word", selectall_desc:"Markera allt" }, paste_dlg:{ text_title:"Anv\u00E4nd ctrl-v p\u00E5 ditt tangentbord f\u00F6r att klistra in i detta f\u00F6nster.", text_linebreaks:"Spara radbrytningar", word_title:"Anv\u00E4nd ctrl-v p\u00E5 ditt tangentbord f\u00F6r att klistra in i detta f\u00F6nster." }, table:{ desc:"Infoga/redigera ny tabell", row_before_desc:"Infoga ny rad f\u00F6re", row_after_desc:"Infoga ny rad efter", delete_row_desc:"Radera rad", col_before_desc:"Infoga kolumn f\u00F6re", col_after_desc:"Infoga kolumn efter", delete_col_desc:"Radera kolumn", split_cells_desc:"Separera sammansatta celler", merge_cells_desc:"Sammanfoga celler", row_desc:"Tabellradsinst\u00E4llningar", cell_desc:"Tabellcellsinst\u00E4llningar", props_desc:"Tabellinst\u00E4llningar", paste_row_before_desc:"Klistra in rad ovanf\u00F6r", paste_row_after_desc:"Klistra in rad efter", cut_row_desc:"Klipp ut rad", copy_row_desc:"Klistra in rad", del:"Radera tabell", row:"Rad", col:"Kolumn", cell:"Cell" }, autosave:{ unload_msg:"F\u00F6r\u00E4ndringarna du gjorde kommer att g\u00E5 f\u00F6rlorade om du v\u00E4ljer att l\u00E4mna denna sida." }, fullscreen:{ desc:"Sl\u00E5 av/p\u00E5 fullsk\u00E4rmsl\u00E4ge" }, media:{ desc:"Infoga/redigera inb\u00E4ddad media", edit:"Redigera inb\u00E4ddad media" }, fullpage:{ desc:"Dokumentinst\u00E4llningar" }, template:{ desc:"Infoga en f\u00E4rdig mall" }, visualchars:{ desc:"Visa osynliga tecken" }, spellchecker:{ desc:"Sl\u00E5 av/p\u00E5 r\u00E4ttstavningskontroll", menu:"R\u00E4ttstavningsinst\u00E4llningar", ignore_word:"Ignorera ord", ignore_words:"Ignorera alla", langs:"Spr\u00E5k", wait:"Var god v\u00E4nta...", sug:"F\u00F6rslag", no_sug:"Inga f\u00F6rslag", no_mpell:"Kunde inte finna n\u00E5gra felstavningar." }, pagebreak:{ desc:"Infoga sidbrytning" }}});������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/si.js���������������������������������������������������������0000664�0000000�0000000�00000020304�12266004471�0020252�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({si:{ common:{ edit_confirm:"\u0D94\u0DB6\u0DA7 \u0DB8\u0DD9\u0DB8 \u0DB4\u0DCF\u0DA8\u0DBA\u0DB1\u0DCA \u0DC3\u0DB3\u0DC4\u0DCF WYSIWYG \u0D86\u0D9A\u0DCF\u0DBB\u0DBA?", apply:"\u0DBA\u0DDC\u0DAF\u0DB1\u0DCA\u0DB1", insert:"\u0D87\u0DAD\u0DD4\u0DC5\u0DAD\u0DCA \u0D9A\u0DBB\u0DB1\u0DCA\u0DB1", update:"\u0D85\u0DBD\u0DD4\u0DAD\u0DCA \u0D9A\u0DBB\u0DB1\u0DCA\u0DB1", cancel:"\u0D85\u0DC0\u0DBD\u0D82\u0D9C\u0DD4 \u0D9A\u0DBB\u0DB1\u0DCA\u0DB1", close:"\u0D89\u0DC0\u0DAD\u0DCA\u0DC0\u0DB1\u0DCA\u0DB1", browse:"Browse", class_name:"\u0DC3\u0DB8\u0DD6\u0DC4\u0DBA", not_set:"-- Not set --", clipboard_msg:"\u0DB4\u0DD2\u0DA7\u0DB4\u0DAD\u0DCA \u0D9A\u0DD2\u0DBB\u0DD3\u0DB8/\u0D89\u0DC0\u0DAD\u0DCA \u0D9A\u0DD2\u0DBB\u0DD3\u0DB8/\u0D87\u0DBD\u0DC0\u0DD3\u0DB8 \u0DB8\u0DDC\u0DC3\u0DD2\u0DBD\u0DCA\u0DBD\u0DCF \u0DC4\u0DCF \u0DC6\u0DBA\u0DBB\u0DCA \u0DC6\u0DDC\u0D9A\u0DCA\u0DC3\u0DCA \u0DC4\u0DD2 \u0D87\u0DAD\u0DD4\u0DC5\u0DAD\u0DCA \u0DB1\u0DDC\u0DC0\u0DDA.\n\u0D94\u0DB6\u0DA7 \u0DB8\u0DDA \u0DB4\u0DD2\u0DC5\u0DD2\u0DB6\u0DB3\u0DC0 \u0DAD\u0DA0\u0DAF\u0DD4\u0DBB\u0DA7\u0DAD\u0DCA \u0DAD\u0DDC\u0DBB\u0DAD\u0DD4\u0DBB\u0DD4 \u0D85\u0DC0\u0DC1\u0DCA\u200D\u0DBA \u0DC0\u0DDA\u0DAF?", clipboard_no_support:"\u0DAF\u0DD0\u0DB1\u0DA7 \u0DB4\u0DCA\u200D\u0DBB\u0DAF\u0DBB\u0DCA\u0DC1\u0D9A\u0DBA \u0DB8\u0D9F\u0DD2\u0DB1\u0DCA \u0DB8\u0DD9\u0DB8 \u0DC3\u0DDA\u0DC0\u0DBA \u0DC3\u0DB4\u0DBA\u0DCF \u0DB1\u0DD0\u0DAD,\u0D91\u0DB6\u0DD0\u0DC0\u0DD2\u0DB1\u0DCA \u0DBA\u0DAD\u0DD4\u0DBB\u0DD4\u0DB4\u0DD4\u0DC0\u0DBB\u0DD4\u0DC0 \u0DB7\u0DCF\u0DC0\u0DD2\u0DAD\u0DCF \u0D9A\u0DBB\u0DB1\u0DCA\u0DB1.", popup_blocked:"\u0D94\u0DB6\u0D9C\u0DDA popup-blocker \u0DB8\u0D9F\u0DD2\u0DB1\u0DCA \u0D8B\u0DB4\u0DBA\u0DDD\u0D9C\u0DD2 \u0DC3\u0DDA\u0DC0\u0DCF\u0DC0\u0DB1\u0DCA \u0DC3\u0DB4\u0DBA\u0DB1 \u0D9A\u0DC0\u0DD4\u0DBD\u0DD4\u0DC0\u0D9A\u0DCA \u0D85\u0DB6\u0DBD \u0D9A\u0DBB \u0D87\u0DAD.\u0D91\u0DB6\u0DD0\u0DC0\u0DD2\u0DB1\u0DCA \u0D94\u0DB6\u0DA7 popup-blocker \u0DBA \u0D85\u0D9A\u0DCA\u200D\u0DBB\u0DD3\u0DBA \u0D9A\u0DD2\u0DBB\u0DD3\u0DB8\u0DA7 \u0DC3\u0DD2\u0DAF\u0DD4\u0DC0\u0DDA. ", invalid_data:"\u0DC0\u0DBB\u0DAF: \u0DC0\u0DBD\u0D82\u0D9C\u0DD4 \u0DB1\u0DDC\u0DB8\u0DD0\u0DAD\u0DD2 \u0D85\u0D9C\u0DBA\u0DB1\u0DCA \u0D87\u0DAD\u0DD4\u0DC5\u0DAD\u0DCA \u0D9A\u0DBB \u0D87\u0DAD,\u0D91\u0DB8 \u0D85\u0D9C\u0DBA\u0DB1\u0DCA \u0DBB\u0DAD\u0DD4 \u0DB4\u0DCF\u0DA7\u0DD2\u0DB1\u0DCA \u0DC3\u0DC5\u0D9A\u0DD4\u0DAB\u0DD4 \u0D9A\u0DBB \u0D87\u0DAD.", more_colors:"\u0DAD\u0DC0\u0DAD\u0DCA \u0DC0\u0DBB\u0DCA\u0DAB" }, contextmenu:{ align:"\u0DB4\u0DD9\u0DC5 \u0D9C\u0DD0\u0DB1\u0DCA\u0DC0\u0DD4\u0DB8", left:"\u0DC0\u0DB8\u0DA7", center:"\u0DB8\u0DD0\u0DAF\u0DA7", right:"\u0DAF\u0D9A\u0DD4\u0DAB\u0DA7", full:"\u0DB4\u0DD6\u0DBB\u0DCA\u0DAB\u0DC0" }, insertdatetime:{ date_fmt:"%\u0D85\u0DC0\u0DD4-%\u0DB8\u0DCF\u0DC3-%\u0DAF\u0DD2\u0DB1", time_fmt:"%\u0DB4\u0DD0\u0DBA:%\u0DB8\u0DD2\u0DC3:%\u0DAD\u0DAD\u0DCA", insertdate_desc:"\u0DAF\u0DD2\u0DB1\u0DBA \u0D87\u0DAD\u0DD4\u0DC5\u0DAD\u0DCA \u0D9A\u0DBB\u0DB1\u0DCA\u0DB1", inserttime_desc:"\u0DC0\u0DDA\u0DBD\u0DCF\u0DC0 \u0D87\u0DAD\u0DD4\u0DC5\u0DAD\u0DCA \u0D9A\u0DBB\u0DB1\u0DCA\u0DB1", months_long:"\u0DA2\u0DB1\u0DC0\u0DCF\u0DBB\u0DD2,\u0DB4\u0DD9\u0DB6\u0DBB\u0DC0\u0DCF\u0DBB\u0DD2,\u0DB8\u0DCF\u0DBB\u0DCA\u0DAD\u0DD4,\u0D85\u0DB4\u0DCA\u200D\u0DBB\u0DDA\u0DBD\u0DCA,\u0DB8\u0DD0\u0DBA\u0DD2,\u0DA2\u0DD6\u0DB1\u0DD2,\u0DA2\u0DD6\u0DBD\u0DD2,\u0D85\u0D9C\u0DDD\u0DC3\u0DCA\u0DAD\u0DD4,\u0DC3\u0DD0\u0DCA\u0DAD\u0DD0\u0DB8\u0DCA\u0DB6\u0DBB\u0DCA,\u0D94\u0D9A\u0DCA\u0DAD\u0DDD\u0DB6\u0DBB\u0DCA,\u200D\u0DB1\u0DDC\u0DC0\u0DD0\u0DB8\u0DCA\u0DB6\u0DBB\u0DCA,\u0DAF\u0DD9\u0DC3\u0DD0\u0DB8\u0DCA\u0DB6\u0DBB\u0DCA", months_short:"\u0DA2\u0DB1.,\u0DB4\u0DD9\u0DB6.,\u0DB8\u0DCF\u0DBB\u0DCA\u0DAD\u0DD4,\u0D85\u0DB4\u0DCA\u200D\u0DBB\u0DDA\u0DBD\u0DCA,\u0DB8\u0DD0\u0DBA\u0DD2,\u0DA2\u0DD6\u0DB1\u0DD2,\u0DA2\u0DD6\u0DBD\u0DD2,\u0D85\u0D9C\u0DDD.,\u0DC3\u0DD0\u0DCA.,\u0D94\u0D9A\u0DCA.,\u200D\u0DB1\u0DDC\u0DC0\u0DD0.,\u0DAF\u0DD9\u0DC3\u0DD0.", day_long:"\u0D89\u0DBB\u0DD2\u0DAF\u0DCF,\u0DC3\u0DB3\u0DD4\u0DAF\u0DCF,\u0D85\u0D9F\u0DC4\u0DBB\u0DD0\u0DC0\u0DCF\u0DAF\u0DCF,\u0DB6\u0DAF\u0DCF\u0DAF\u0DCF,\u0DB6\u0DCA\u200D\u0DBB\u0DC4\u0DC3\u0DCA\u0DB4\u0DAD\u0DD2\u0DB1\u0DCA\u0DAF\u0DCF,\u0DC3\u0DD2\u0D9A\u0DD4\u0DBB\u0DCF\u0DAF\u0DCF,\u0DC3\u0DD9\u0DB1\u0DC3\u0DD4\u0DBB\u0DCF\u0DAF\u0DCF", day_short:"\u0D89\u0DBB\u0DD2\u0DAF\u0DCF,\u0DC3\u0DB3\u0DD4\u0DAF\u0DCF,\u0D85\u0D9F.,\u0DB6\u0DAF\u0DCF\u0DAF\u0DCF,\u0DB6\u0DCA\u200D\u0DBB\u0DC4\u0DC3\u0DCA.,\u0DC3\u0DD2\u0D9A\u0DD4.,\u0DC3\u0DD9\u0DB1." }, print:{ print_desc:"\u0DB8\u0DD4\u0DAF\u0DCA\u200D\u0DBB\u0DAB\u0DBA \u0D9A\u0DBB\u0DB1\u0DC0\u0DCF" }, preview:{ preview_desc:"\u0DB4\u0DD6\u0DBB\u0DCA\u0DC0 \u0DAF\u0DBB\u0DCA\u0DC1\u0DB1\u0DBA" }, directionality:{ ltr_desc:"\u0DC0\u0DB8\u0DDA \u0DC3\u0DD2\u0DA7 \u0DAF\u0D9A\u0DD4\u0DAB\u0DA7 \u0DAF\u0DD2\u0DC1\u0DCF\u0DC0", rtl_desc:"\u0DAF\u0D9A\u0DD4\u0DAB\u0DDA \u0DC3\u0DD2\u0DA7 \u0DC0\u0DB8\u0DA7 \u0DAF\u0DD2\u0DC1\u0DCF\u0DC0" }, layer:{ insertlayer_desc:"\u0D85\u0DB5\u0DAD\u0DCA \u0DC3\u0DCA\u0DAE\u0DBB\u0DBA\u0D9A\u0DCA \u0D87\u0DAD\u0DD4\u0DC5\u0DAD\u0DCA \u0D9A\u0DBB\u0DB1\u0DCA\u0DB1", forward_desc:"\u0D89\u0DAF\u0DD2\u0DBB\u0DD2\u0DBA\u0DA7 \u0D9C\u0DD9\u0DB1\u0DBA\u0DB1\u0DCA\u0DB1", backward_desc:"\u0DB4\u0DC3\u0DD4\u0DB4\u0DC3\u0DA7 \u0D9C\u0DD9\u0DB1\u0DBA\u0DB1\u0DCA\u0DB1", absolute_desc:"Toggle absolute positioning", content:"\u0D85\u0DBD\u0DD4\u0DAD\u0DCA \u0DC3\u0DCA\u0DAE\u0DBB\u0DBA\u0D9A\u0DCA..." }, save:{ save_desc:"\u0DC3\u0DD4\u0DBB\u0D9A\u0DD2\u0DB1\u0DCA\u0DB1", cancel_desc:"\u0D85\u0DC0\u0DBD\u0D82\u0D9C\u0DD4 \u0D9A\u0DBB\u0DB1\u0DCA\u0DB1" }, nonbreaking:{ nonbreaking_desc:"Insert non-breaking space character" }, iespell:{ iespell_desc:"\u0D85\u0D9A\u0DCA\u0DC2\u0DBB \u0DC0\u0DD2\u0DB1\u0DCA\u200D\u0DBA\u0DCF\u0DC3\u0DBA \u0DB4\u0DBB\u0DD3\u0D9A\u0DC2\u0DCF \u0D9A\u0DBB\u0DB1\u0DCA\u0DB1", download:"ieSpell \u0D85\u0DB1\u0DCF\u0DC0\u0DBB\u0DB1\u0DBA \u0DC0\u0DD6\u0DBA\u0DDA \u0DB1\u0DD0\u0DAD. \u0D94\u0DB6\u0DA7 \u0D91\u0DBA \u0DB4\u0DD2\u0DC4\u0DD2\u0DA7\u0DD4\u0DC0\u0DD3\u0DB8\u0DA7 \u0D85\u0DC0\u0DC1\u0DCA\u200D\u0DBA \u0DAF?" }, advhr:{ advhr_desc:"Horizontale rule" }, emotions:{ emotions_desc:"Emotions" }, searchreplace:{ search_desc:"Find", replace_desc:"Find/Replace" }, advimage:{ image_desc:"Insert/edit image" }, advlink:{ link_desc:"Insert/edit link" }, xhtmlxtras:{ cite_desc:"Citation", abbr_desc:"Abbreviation", acronym_desc:"Acronym", del_desc:"Deletion", ins_desc:"Insertion", attribs_desc:"Insert/Edit Attributes" }, style:{ desc:"Edit CSS Style" }, paste:{ paste_text_desc:"Paste as Plain Text", paste_word_desc:"Paste from Word", selectall_desc:"Select All" }, paste_dlg:{ text_title:"Use CTRL+V on your keyboard to paste the text into the window.", text_linebreaks:"Keep linebreaks", word_title:"Use CTRL+V on your keyboard to paste the text into the window." }, table:{ desc:"Inserts a new table", row_before_desc:"Insert row before", row_after_desc:"Insert row after", delete_row_desc:"Delete row", col_before_desc:"Insert column before", col_after_desc:"Insert column after", delete_col_desc:"Remove column", split_cells_desc:"Split merged table cells", merge_cells_desc:"Merge table cells", row_desc:"Table row properties", cell_desc:"Table cell properties", props_desc:"Table properties", paste_row_before_desc:"Paste table row before", paste_row_after_desc:"Paste table row after", cut_row_desc:"Cut table row", copy_row_desc:"Copy table row", del:"Delete table", row:"Row", col:"Column", cell:"Cell" }, autosave:{ unload_msg:"The changes you made will be lost if you navigate away from this page." }, fullscreen:{ desc:"Toggle fullscreen mode" }, media:{ desc:"Insert / edit embedded media", edit:"Edit embedded media" }, fullpage:{ desc:"Document properties" }, template:{ desc:"Insert predefined template content" }, visualchars:{ desc:"Visual control characters on/off." }, spellchecker:{ desc:"Toggle spellchecker", menu:"Spellchecker settings", ignore_word:"Ignore word", ignore_words:"Ignore all", langs:"Languages", wait:"Please wait...", sug:"Suggestions", no_sug:"No suggestions", no_mpell:"No misspellings found." }, pagebreak:{ desc:"Insert page break." }}});����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/sk.js���������������������������������������������������������0000664�0000000�0000000�00000012417�12266004471�0020262�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({sk:{ common:{ edit_confirm:"Chcete pou\u017Ei\u0165 WYSIWYG m\u00F3d pre tento text?", apply:"Pou\u017Ei\u0165", insert:"Vlo\u017Ei\u0165", update:"Aktualizova\u0165", cancel:"Zru\u0161i\u0165", close:"Zavrie\u0165", browse:"Prech\u00E1dza\u0165", class_name:"Trieda", not_set:"-- Nezadan\u00E9 --", clipboard_msg:"Funkcie kop\u00EDrova\u0165/vysrihn\u00FA\u0165/vlo\u017Ei\u0165 nie su podporovan\u00E9 prehliada\u010Dmi Mozilla a Firefox.\nChcete viac inform\u00E1ci\u00ED o tomto probl\u00E9me?", clipboard_no_support:"Moment\u00E1lne nie je podporovan\u00E9 va\u0161\u00EDm prehliada\u010Dom. Miesto toho pou\u017Eite kl\u00E1vesov\u00FA skratku.", popup_blocked:"Ospravedl\u0148ujeme sa, ale v\u00E1\u0161 blokova\u010D vyskakovac\u00EDch okien neumo\u017Enil otvori\u0165 okno, ktor\u00E9 sprostredkov\u00E1va funk\u010Dnos\u0165 aplik\u00E1cie. Mus\u00EDte vypn\u00FA\u0165 blokovanie vyskakovac\u00EDch okien pre tento web, aby bolo mo\u017En\u00E9 pou\u017Ei\u0165 t\u00FAto funkciu.", invalid_data:"Chyba: Boli zadan\u00E9 neplatn\u00E9 hodnoty (zv\u00FDraznen\u00E9 \u010Dervenou)", more_colors:"Viac farieb" }, contextmenu:{ align:"Umiestnenie", left:"V\u013Eavo", center:"Na stred", right:"Vpravo", full:"Do bloku" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"Vlo\u017Ei\u0165 d\u00E1tum", inserttime_desc:"Vlo\u017Ei\u0165 \u010Das", months_long:"Janu\u00E1r,Febru\u00E1r,Marec,Apr\u00EDl,M\u00E1j,J\u00FAn,J\u00FAl,August,September,Okt\u00F3ber,November,December", months_short:"Jan,Feb,Mar,Apr,M\u00E1j,J\u00FAn,J\u00FAl,Aug,Sep,Okt,Nov,Dec", day_long:"Nede\u013Ea,Pondelok,Utorok,Streda,\u0160tvrtok,Piatok,Sobota,Nede\u013Ea", day_short:"Ned,Pon,Ut,Str,\u0160tvr,Pia,Sob,Ned" }, print:{ print_desc:"Vytla\u010Di\u0165" }, preview:{ preview_desc:"N\u00E1h\u013Ead" }, directionality:{ ltr_desc:"Smer textu z \u013Eava do prava", rtl_desc:"Smer textu z prava do \u013Eava" }, layer:{ insertlayer_desc:"Vlo\u017Ei\u0165 nov\u00FA vrstvu", forward_desc:"Posun\u00FA\u0165 dopredu", backward_desc:"Posun\u00FA\u0165 dozadu", absolute_desc:"Prepn\u00FA\u0165 na absol\u00FAtne poziciovanie", content:"Nov\u00E1 vrstva..." }, save:{ save_desc:"Ulo\u017Ei\u0165", cancel_desc:"Zru\u0161i\u0165 v\u0161etky zmeny" }, nonbreaking:{ nonbreaking_desc:"Vlo\u017Ei\u0165 znak nezalomen\u00E1 medzera (non-breaking space)" }, iespell:{ iespell_desc:"Spusti\u0165 kontrolu pravopisu", download:"ieSpell nebol n\u00E1jden\u00FD. Chcete ho nain\u0161talova\u0165?" }, advhr:{ advhr_desc:"Horizont\u00E1lny odde\u013Eova\u010D" }, emotions:{ emotions_desc:"Emotikony" }, searchreplace:{ search_desc:"N\u00E1jdi", replace_desc:"N\u00E1jdi/nahra\u010F" }, advimage:{ image_desc:"Vlo\u017Ei\u0165/upravi\u0165 obr\u00E1zok" }, advlink:{ link_desc:"Vlo\u017Ei\u0165/upravi\u0165 odkaz" }, xhtmlxtras:{ cite_desc:"Cit\u00E1cia", abbr_desc:"Skratka", acronym_desc:"Acronym", del_desc:"Zru\u0161enie", ins_desc:"Vlo\u017Eenie", attribs_desc:"Vlo\u017Ei\u0165/upravi\u0165 atrib\u00FAty" }, style:{ desc:"Upravi\u0165 CSS" }, paste:{ paste_text_desc:"Vlo\u017Ei\u0165 ako neformatovan\u00FD text", paste_word_desc:"Vlo\u017Ei\u0165 text z aplik\u00E1cie Word", selectall_desc:"Ozna\u010Di\u0165 v\u0161etko" }, paste_dlg:{ text_title:"Pou\u017Eite CTRL+V na kl\u00E1vesnici pre vlo\u017Eenie textu do okna.", text_linebreaks:"Zachova\u0165 zalamovanie riadkov", word_title:"Pou\u017Eite CTRL+V na kl\u00E1vesnici pre vlo\u017Eenie textu do okna." }, table:{ desc:"Vlo\u017Ei\u0165 nov\u00FA tabu\u013Eku", row_before_desc:"Vlo\u017Ei\u0165 riadok pred", row_after_desc:"Vlo\u017Ei\u0165 riadok za", delete_row_desc:"Odstr\u00E1ni\u0165 riadok", col_before_desc:"Vlo\u017Ei\u0165 st\u013Apec pred", col_after_desc:"Vlo\u017Ei\u0165 st\u013Apec za", delete_col_desc:"Odstr\u00E1ni\u0165 st\u013Apec", split_cells_desc:"Rozdeli\u0165 zl\u00FA\u010Den\u00E9 bunky", merge_cells_desc:"Zl\u00FA\u010Di\u0165 bunky", row_desc:"Vlastnosti riadky tabu\u013Eky", cell_desc:"Vlastnosti bunky tabu\u013Eky", props_desc:"Vlastnosti tabu\u013Eky", paste_row_before_desc:"Vlo\u017Ei\u0165 riadok pred", paste_row_after_desc:"Vlo\u017Ei\u0165 riadok za", cut_row_desc:"Vystrihn\u00FA\u0165 riadok", copy_row_desc:"Kop\u00EDrova\u0165 riadok", del:"Zmaza\u0165 tabu\u013Eku", row:"Riadok", col:"St\u013Apec", cell:"Bunka" }, autosave:{ unload_msg:"Ak opust\u00EDte t\u00FAto str\u00E1nku, vykonan\u00E9 zmeny bud\u00FA straten\u00E9." }, fullscreen:{ desc:"Prepn\u00FA\u0165 zobrazenie na cel\u00FA obrazovku" }, media:{ desc:"Vlo\u017Ei\u0165/upravi\u0165 vnoren\u00E9 m\u00E9di\u00E1", edit:"Upravi\u0165 vnoren\u00E9 m\u00E9di\u00E1" }, fullpage:{ desc:"Vlastnosti dokumentu" }, template:{ desc:"Vlo\u017Ei\u0165 obsah z preddefinovanej \u0161abl\u00F3ny" }, visualchars:{ desc:"Vizu\u00E1lne ovl\u00E1dacie znaky zap/vyp." }, spellchecker:{ desc:"Prepn\u00FA\u0165 na kontrolu pravopisu", menu:"Nastavenie kontroly pravopisu", ignore_word:"Vynecha\u0165 slovo", ignore_words:"Vynecha\u0165 v\u0161etky", langs:"Jazyky", wait:"\u010Cakaj pros\u00EDm...", sug:"Ponuky", no_sug:"\u017Diadne ponuky", no_mpell:"Bez pravopisn\u00FDch ch\u00FDb." }, pagebreak:{ desc:"Vlo\u017Ei\u0165 zalomenie str\u00E1nky." }}});�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/sl.js���������������������������������������������������������0000664�0000000�0000000�00000010514�12266004471�0020257�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({sl:{ common:{ edit_confirm:"\u017Delite uporabiti na\u010Din \'videz ne vara\' (WYSIWYG) za to vnosno polje?", apply:"Uporabi", insert:"Vstavi", update:"Posodobi", cancel:"Prekli\u010Di", close:"Zapri", browse:"Prebrskaj", class_name:"Razred", not_set:"-- ni nastavljeno --", clipboard_msg:"Delo z odlo\u017Ei\u0161\u010Dem ni mogo\u010De v tem brskalniku. Lahko uporabljate kombinacije tipk Ctrl+X, Ctrl+C, Ctrl+V.\n\u017Delite ve\u010D informacij o tem?", clipboard_no_support:"Trenutno ni podporto v va\u0161em brskalniku. Uporabite bli\u017Enjice tipkovnice.", popup_blocked:"\u017Dal va\u0161e orodje za prepre\u010Devanje odpiranja neza\u017Eelenih oken (popup-blocker) ne omogo\u010Da prikaza pomo\u017Enega okna izbranega orodja. Prepre\u010Devanje odpiranja oken morate onemogo\u010Diti.", invalid_data:"Napaka: vne\u0161ene so bile nepravilne vrednosti, ozna\u010Dene so z rde\u010Do.", more_colors:"Ve\u010D barv" }, contextmenu:{ align:"Poravnava", left:"Levo", center:"Sredina", right:"Desno", full:"Polno" }, insertdatetime:{ date_fmt:"%d.%m.%Y", time_fmt:"%H:%M:%S", insertdate_desc:"Vstavi datum", inserttime_desc:"Vstavi \u010Das", months_long:"januar,februar,marec,april,maj,junij,julij,avgust,september,oktober,november,december", months_short:"jan,feb,mar,apr,maj,jun,jul,avg,sep,okt,nov,dec", day_long:"nedelja,ponedeljek,torek,sreda,\u010Detrtek,petek,sobota,nedelja", day_short:"ned,pon,tor,sre,\u010Det,pet,sob,ned" }, print:{ print_desc:"Natisni" }, preview:{ preview_desc:"Predogled" }, directionality:{ ltr_desc:"Smer od leve proti desni", rtl_desc:"Smer od desne proti levi" }, layer:{ insertlayer_desc:"Vstavi nov sloj", forward_desc:"Premakni v ospredje", backward_desc:"Premakni v ozadje", absolute_desc:"Preklop absolutnega polo\u017Eaja", content:"Nov sloj..." }, save:{ save_desc:"Shrani", cancel_desc:"Prekli\u010Di vse spremembe" }, nonbreaking:{ nonbreaking_desc:"Vstavi nedeljivi presledek" }, iespell:{ iespell_desc:"Za\u017Eeni preverjanje \u010Drkovanja", download:"ieSpell ni zaznan. \u017Delite, da ga namestim?" }, advhr:{ advhr_desc:"Vodoravna \u010Drta" }, emotions:{ emotions_desc:"Sme\u0161ki" }, searchreplace:{ search_desc:"Najdi", replace_desc:"Najdi/zamenjaj" }, advimage:{ image_desc:"Vstavi/uredi sliko" }, advlink:{ link_desc:"Vstavi/uredi povezavo" }, xhtmlxtras:{ cite_desc:"Citat", abbr_desc:"Okraj\u0161ava", acronym_desc:"Kratica", del_desc:"Izbrisano", ins_desc:"Vstavljeno", attribs_desc:"Vstavi/uredi atribute" }, style:{ desc:"Uredi sloge CSS" }, paste:{ paste_text_desc:"Prilepi kot golo besedilo", paste_word_desc:"Prilepi iz Word-a", selectall_desc:"Izberi vse" }, paste_dlg:{ text_title:"Uporabite kombinacijo tipk CTRL+V, da prilepite vsebino v okno.", text_linebreaks:"Obdr\u017Ei prelome vrstic", word_title:"Uporabite kombinacijo tipk CTRL+V, da prilepite vsebino v okno." }, table:{ desc:"Vstavi/posodobi tabelo", row_before_desc:"Vstavi vrstico nad", row_after_desc:"Vstavi vrstico pod", delete_row_desc:"Odstrani vrstico", col_before_desc:"Vstavi stolpec pred", col_after_desc:"Vstavi stolpec po", delete_col_desc:"Odstrani stolpec", split_cells_desc:"Razcepi celico", merge_cells_desc:"Spoji celice", row_desc:"Lastnosti vrstice", cell_desc:"Lastnosti celice", props_desc:"Lastnosti tabele", paste_row_before_desc:"Prilepi vrstico pred", paste_row_after_desc:"Prilepi vrstico po", cut_row_desc:"Izre\u017Ei vrstico", copy_row_desc:"Kopiraj vrstico", del:"Odstrani tabelo", row:"Vrstica", col:"Stolpec", cell:"Celica", cellprops_delta_width:"100" }, autosave:{ unload_msg:"Ce se premaknete na drugo stran, bodo narejene spremembe izgubljene!" }, fullscreen:{ desc:"Preklopi celozaslonski na\u010Din" }, media:{ desc:"Vstavi / uredi multimedijsko vsebino", edit:"Uredi multimedijsko vsebino" }, fullpage:{ desc:"Lastnosti dokumenta" }, template:{ desc:"Vstavi pripravljeno vsebino predloge" }, visualchars:{ desc:"Preklopi prikaz nadzornih znakov." }, spellchecker:{ desc:"Preklopi \u010Drkovalnik", menu:"Nastavitve \u010Drkovalnika", ignore_word:"Prezri besedo", ignore_words:"Prezri vse", langs:"Jeziki", wait:"Prosim po\u010Dakaj...", sug:"Predlogi", no_sug:"Ni predlogov", no_mpell:"Napa\u010Dnega \u010Drkovanja nisem na\u0161el." }, pagebreak:{ desc:"Vstavi lom strani." }}});������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/sq.js���������������������������������������������������������0000664�0000000�0000000�00000011001�12266004471�0020254�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({sq:{ common:{ edit_confirm:"Doni t\u00EB p\u00EBrdorni m\u00EBnyr\u00EBn WYSIWYG p\u00EBr k\u00EBt\u00EB tekst?", apply:"Zbato", insert:"Fut", update:"Rifresko", cancel:"Anulo", close:"Mbyll", browse:"Shfleto", class_name:"Klasa", not_set:"-- pa v\u00EBn\u00EB --", clipboard_msg:"Kopja/Prerja/Ngjitja nuk suportohen n\u00EB Mozilla dhe Firefox.\nD\u00EBshironi m\u00EB shum\u00EB informacione p\u00EBr k\u00EBt\u00EB \u00E7\u00EBshtje?", clipboard_no_support:"Aktualisht nuk suportohet nga Shfletuesi juaj, p\u00EBrdorni tastjer\u00EBn.", popup_blocked:"Ju k\u00EBrkojm\u00EB ndjes\u00EB, por bllokuesi i popup-eve ka bllokuar nj\u00EB dritare q\u00EB ofron funksjonalitet p\u00EBr programin. Duhet t'a \u00E7aktivizoni bllokuesin e popup-eve n\u00EB m\u00EBnyr\u00EB q\u00EB t'i p\u00EBrdorni opsionet.", invalid_data:"Gabim: Keni futur vlera t\u00EB pavlefshme, t\u00EB cilat jan\u00EB sh\u00EBnuar me t\u00EB kuqe.", more_colors:"M\u00EB shum\u00EB ngjyra" }, contextmenu:{ align:"Drejtimi", left:"Majtas", center:"Qend\u00EBr", right:"Djathtas", full:"I Plot\u00EB" }, insertdatetime:{ date_fmt:"%d-%m-%y", time_fmt:"%H:%M:%S", insertdate_desc:"Fut dat\u00EBn", inserttime_desc:"Fut or\u00EBn", months_long:"Janar,Shkurt,Mars,Prill,Maj,Qershor,Korrik,Gusht,Shtator,Tetor,N\u00EBntor,Dhjetor", months_short:"Jan,Shk,Mar,Pri,Maj,Qer,Kor,Gus,Sht,Tet,N\u00EBn,Dhj", day_long:"E Djel\u00EB,E H\u00EBn\u00EB,E Mart\u00EB,E M\u00EBrkur\u00EB,E Enjte,E Premte,E Shtun\u00EB,E Djel\u00EB", day_short:"Dje,H\u00EBn,Mar,M\u00EBr,Enj,Pre,Sht,Dje" }, print:{ print_desc:"Printo" }, preview:{ preview_desc:"Paraqitje" }, directionality:{ ltr_desc:"Drejtimi majtas-djathtas", rtl_desc:"Drejtimi djathtas-majtas" }, layer:{ insertlayer_desc:"Fut shtres\u00EB t\u00EB re", forward_desc:"L\u00EBviz para", backward_desc:"L\u00EBviz prapa", absolute_desc:"Aktivizo/\u00E7aktivizo pozicionimin absolut", content:"Shtres\u00EB e re..." }, save:{ save_desc:"Ruaj", cancel_desc:"Anuloji t\u00EB gjitha ndryshimet" }, nonbreaking:{ nonbreaking_desc:"Fut hap\u00EBsir\u00EB" }, iespell:{ iespell_desc:"Kontrollo p\u00EBr gabime drejt\u00EBshkrimore", download:"ieSpell nuk u detektua. D\u00EBshironi ta instaloni?" }, advhr:{ advhr_desc:"Linj\u00EB horizontale" }, emotions:{ emotions_desc:"Emocionet" }, searchreplace:{ search_desc:"K\u00EBrko", replace_desc:"K\u00EBrko/Z\u00EBvend\u00EBso" }, advimage:{ image_desc:"Fut/edito foto" }, advlink:{ link_desc:"Fut/edito lidhje" }, xhtmlxtras:{ cite_desc:"Citat", abbr_desc:"Shkurtim", acronym_desc:"Akronim", del_desc:"Fshirje", ins_desc:"Futje", attribs_desc:"Fut/Edito Tipare" }, style:{ desc:"Edito Stilet CSS" }, paste:{ paste_text_desc:"Ngjit si Tekst", paste_word_desc:"Ngjit nga Word", selectall_desc:"Zgjidhi t\u00EB gjitha" }, paste_dlg:{ text_title:"P\u00EBrdor CTRL+V p\u00EBr t\u00EB ngjitur tekstin.", text_linebreaks:"Ruaj linjat e reja", word_title:"P\u00EBrdor CTRL+V p\u00EBr t\u00EB ngjitur tekstin." }, table:{ desc:"Fut nj\u00EB tabel\u00EB t\u00EB re", row_before_desc:"Fut rresht p\u00EBrpara", row_after_desc:"Fut rresht pas", delete_row_desc:"Fshi rreshtin", col_before_desc:"Fut kolon\u00EB p\u00EBrpara", col_after_desc:"Fut kolon\u00EB pas", delete_col_desc:"Fshi kolon\u00EBn", split_cells_desc:"Ndaji qelizat e bashkuara", merge_cells_desc:"Bashkoji qelizat", row_desc:"Tiparet e rreshtit", cell_desc:"Tiparet e qeliz\u00EBs", props_desc:"Tiparet e tabel\u00EBs", paste_row_before_desc:"Ngjite rreshtin p\u00EBrpara", paste_row_after_desc:"Ngjite rreshtin pas", cut_row_desc:"Prit rreshtin", copy_row_desc:"Kopjo rreshtin", del:"Fshi tabel\u00EBn", row:"Rresht", col:"Kolon\u00EB", cell:"Qeliz\u00EB" }, autosave:{ unload_msg:"Ndryshimet q\u00EB keni b\u00EBr\u00EB do t\u00EB humbasin n\u00EBse largoheni nga kjo faqe." }, fullscreen:{ desc:"Aktivizo/\u00E7aktivizo pamjen e plot\u00EB" }, media:{ desc:"Fut / edito media", edit:"Edito media" }, fullpage:{ desc:"Tiparet e dokumentit" }, template:{ desc:"Fut p\u00EBrmbajtje shabllon" }, visualchars:{ desc:"Karakteret e kontrollit vizual: on/off." }, spellchecker:{ desc:"Aktivizo/\u00E7aktivizo kontrolluesin e gabimeve", menu:"Tiparet e kontrolluesit t\u00EB gabimeve", ignore_word:"Injoro fjal\u00EBn", ignore_words:"Injoroji t\u00EB gjitha", langs:"Gjuh\u00EBt", wait:"Ju lutem prisni...", sug:"Sygjerimet", no_sug:"Asnj\u00EB sygjerim", no_mpell:"Nuk u gjet asnj\u00EB gabim." }, pagebreak:{ desc:"Fut thyerje faqeje." }}});�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/sr.js���������������������������������������������������������0000664�0000000�0000000�00000010342�12266004471�0020264�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({sr:{ common:{ edit_confirm:"\u017Delite li koristiti WYSIWYG na\u010Din rada za ovo tekstualno polje?", apply:"Primjeni", insert:"Ubaci", update:"Obnovi", cancel:"Odustani", close:"Zatvori", browse:"Pregled", class_name:"Klasa", not_set:"-- Nije postavljeno --", clipboard_msg:"Kopiraj/Izre\u017Ei/Zalepi nije dostupno Mozilla i Firefox preglednicima.\nVi\u0161e informacija?", clipboard_no_support:"Trenuta\u010Dno va\u0161 preglednik ne podr\u017Eava ovu opciju, poku\u0161ajte koristiti tipkovni\u010Dku kraticu.", popup_blocked:"Oprostite, izgleda da je va\u0161 popup-blocker onemogu\u0107io prozor u sklopu ovog programa. Morate onemogu\u0107iti blokiranje popup prozora da bi u potpunosti iskoristili ovaj alat.", invalid_data:"Gre\u0161ka: Une\u0161ene su nevaljane vrednosti, ozna\u010Dene su crvenom bojom.", more_colors:"Vi\u0161e boja" }, contextmenu:{ align:"Poravnavanje", left:"Levo", center:"Sredina", right:"Desno", full:"Puno" }, insertdatetime:{ date_fmt:"%d.%m.%Y.", time_fmt:"%H:%M:%S", insertdate_desc:"Umetni datum", inserttime_desc:"Umetni vreme", months_long:"januar,februar,mart,april,maj,juni,juli,avgust,septembar,oktobar,novembar,decembar", months_short:"jan,feb,mar,apr,maj,jun,jul,avg,sep,okt,nov,dec", day_long:"nedelja,ponedjeljak,utorak,sreda,\u010Detvrtak,petak,subota,nedelja", day_short:"ned,pon,uto,sre,\u010Det,pet,sub,ned" }, print:{ print_desc:"Ispis" }, preview:{ preview_desc:"Prikaz" }, directionality:{ ltr_desc:"S leva na desno", rtl_desc:"S desna na levo" }, layer:{ insertlayer_desc:"Umetni novi sloj", forward_desc:"Pomakni napred", backward_desc:"Pomakni natrag", absolute_desc:"Uklju\u010Di/isklju\u010Di apsolutno pozicioniranje", content:"Novi sloj..." }, save:{ save_desc:"Spremi", cancel_desc:"Odustani od svih promjena" }, nonbreaking:{ nonbreaking_desc:"Umetni razmak" }, iespell:{ iespell_desc:"Pokreni provjeru pravopisa", download:"Provjera pravopisa nije postavljena. Postaviti sada?" }, advhr:{ advhr_desc:"Vodoravna crta" }, emotions:{ emotions_desc:"Emocije" }, searchreplace:{ search_desc:"Prona\u0111i", replace_desc:"Prona\u0111i/Zameni" }, advimage:{ image_desc:"Umetni/uredi sliku" }, advlink:{ link_desc:"Insert/edit link" }, xhtmlxtras:{ cite_desc:"Citat", abbr_desc:"Kratica", acronym_desc:"Akronim", del_desc:"Brisanje", ins_desc:"Unos", attribs_desc:"Umetni/uredi atribute" }, style:{ desc:"Uredi CSS" }, paste:{ paste_text_desc:"Zalepi kao obi\u010Dni tekst", paste_word_desc:"Zalepi iz Worda", selectall_desc:"Odaberi sve" }, paste_dlg:{ text_title:"Koristite CTRL+V na tipkovnici da zalepite tekst u prozor.", text_linebreaks:"Zadr\u017Ei prelome", word_title:"Koristite CTRL+V na tipkovnici da zalepite tekst u prozor." }, table:{ desc:"Nova tablica", row_before_desc:"Umetni redak iznad", row_after_desc:"Umetni redak ispod", delete_row_desc:"Izbri\u0161i redak", col_before_desc:"Umetni stupac levo", col_after_desc:"Umetni stupac desno", delete_col_desc:"Ukloni stupac", split_cells_desc:"Razdvoji spojene \u0107elije", merge_cells_desc:"Spoji \u0107elije", row_desc:"Svojstva retka", cell_desc:"Svojstva \u0107elije", props_desc:"Svojstva tablice", paste_row_before_desc:"Zalepi redak iznad", paste_row_after_desc:"Zalepi redak ispod", cut_row_desc:"Izre\u017Ei redak", copy_row_desc:"Kopiraj redak", del:"Izbri\u0161i tablicu", row:"Redak", col:"Stupac", cell:"\u0106elija" }, autosave:{ unload_msg:"Promjene u dokumentu \u0107e biti izgubljene ako iza\u0111ete s ove stranice." }, fullscreen:{ desc:"Uklju\u010Di/isklju\u010Di prikaz preko celog ekrana" }, media:{ desc:"Insert / edit embedded media", edit:"Edit embedded media" }, fullpage:{ desc:"Svojstva dokumenta" }, template:{ desc:"Umetni sadr\u017Eaj iz predlo\u017Eak" }, visualchars:{ desc:"Vizuelni kontrolni znakovi uklju\u010Deni/isklju\u010Deni." }, spellchecker:{ desc:"Uklju\u010Di/isklju\u010Di provjeru pravopisa", menu:"Postavke provere pravopisa", ignore_word:"Zanemari re\u010D", ignore_words:"Zanemari sve", langs:"Jezici", wait:"Pri\u010Dekajte...", sug:"Predlozi", no_sug:"Nema predloga", no_mpell:"Nije prona\u0111ena nijedna pravopisna gre\u0161ka." }, pagebreak:{ desc:"Umetni prelom." }}});����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/sv.js���������������������������������������������������������0000664�0000000�0000000�00000010636�12266004471�0020276�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({sv:{ common:{ edit_confirm:"Vill du anv\u00E4nda WYSIWYG f\u00F6r denna textarea?", apply:"Applicera", insert:"Infoga", update:"Uppdatera", cancel:"Avbryt", close:"St\u00E4ng", browse:"Bl\u00E4ddra", class_name:"Klass", not_set:"-- Inte satt --", clipboard_msg:"Kopiera/klipp ut/klistra in \u00E4r inte tillg\u00E4ngligt i din webbl\u00E4sare.\nVill du veta mer?", clipboard_no_support:"Funktionen \u00E4r inte tillg\u00E4nglig i din webbl\u00E4sare, anv\u00E4nd tangentbordsgenv\u00E4garna i st\u00E4llet.", popup_blocked:"Popup blockerare detekterad. St\u00E4ng av den s\u00E5 att dialogerna kan \u00F6ppnas.", invalid_data:"Fel: Inkorrekta v\u00E4rden har matats in, dessa \u00E4r markerade i r\u00F6tt.", more_colors:"Fler f\u00E4rger" }, contextmenu:{ align:"Justering", left:"V\u00E4nster", center:"Centrerad", right:"H\u00F6ger", full:"Utfyllnad" }, insertdatetime:{ date_fmt:"%Y-%m-%d ", time_fmt:"%H:%M:%S", insertdate_desc:"Infoga datum", inserttime_desc:"Infoga tid", months_long:"Januari,Februari,Mars,April,Maj,Juni,Juli,Augusti,September,Oktober,November,December", months_short:"Jan,Feb,Mar,Apr,Maj,Jun,Jul,Aug,Sep,Okt,Nov,Dec", day_long:"S\u00F6ndag,M\u00E5ndag,Tisdag,Onsdag,Torsdag,Fredag,L\u00F6rdag,S\u00F6ndag", day_short:"S\u00F6n,M\u00E5n,Tis,Ons,Tors,Fre,L\u00F6r,S\u00F6n" }, print:{ print_desc:"Skriv ut" }, preview:{ preview_desc:"F\u00F6rhandsgranska" }, directionality:{ ltr_desc:"Skriftl\u00E4ge - v\u00E4nster till h\u00F6ger", rtl_desc:"Skriftl\u00E4ge - h\u00F6ger till v\u00E4nster" }, layer:{ insertlayer_desc:"Infoga nytt lager", forward_desc:"Flytta fram\u00E5t", backward_desc:"Flytta bak\u00E5t", absolute_desc:"Sl\u00E5 av/p\u00E5 absolut positionering", content:"Nytt lager..." }, save:{ save_desc:"Spara", cancel_desc:"Hoppa \u00F6ver alla f\u00F6r\u00E4ndringar" }, nonbreaking:{ nonbreaking_desc:"Infoga icke radbrytande mellanslag" }, iespell:{ iespell_desc:"R\u00E4ttstava", download:"ieSpell kunde inte hittas, vill du installera denna nu?" }, advhr:{ advhr_desc:"Horisontell skiljelinje" }, emotions:{ emotions_desc:"Smileys" }, searchreplace:{ search_desc:"S\u00F6k", replace_desc:"S\u00F6k/ers\u00E4tt" }, advimage:{ image_desc:"Infoga/redigera bild" }, advlink:{ link_desc:"Infoga/redigera l\u00E4nk" }, xhtmlxtras:{ cite_desc:"citat", abbr_desc:"F\u00F6rkortning", acronym_desc:"Akronym", del_desc:"Markera som struket", ins_desc:"Markera som tillagt", attribs_desc:"Redigera attribut" }, style:{ desc:"Redigera inline CSS" }, paste:{ paste_text_desc:"Klistra in som text", paste_word_desc:"Klistra in fr\u00E5n Word", selectall_desc:"Markera allt" }, paste_dlg:{ text_title:"Anv\u00E4nd ctrl-v p\u00E5 ditt tangentbord f\u00F6r att klistra in i detta f\u00F6nster.", text_linebreaks:"Spara radbrytningar", word_title:"Anv\u00E4nd ctrl-v p\u00E5 ditt tangentbord f\u00F6r att klistra in i detta f\u00F6nster." }, table:{ desc:"Infoga/redigera ny tabell", row_before_desc:"Infoga ny rad f\u00F6re", row_after_desc:"Infoga ny rad efter", delete_row_desc:"Radera rad", col_before_desc:"Infoga kolumn f\u00F6re", col_after_desc:"Infoga kolumn efter", delete_col_desc:"Radera kolumn", split_cells_desc:"Separera sammansatta celler", merge_cells_desc:"Sammanfoga celler", row_desc:"Tabellradsinst\u00E4llningar", cell_desc:"Tabellcellsinst\u00E4llningar", props_desc:"Tabellinst\u00E4llningar", paste_row_before_desc:"Klistra in rad ovanf\u00F6r", paste_row_after_desc:"Klistra in rad efter", cut_row_desc:"Klipp ut rad", copy_row_desc:"Klistra in rad", del:"Radera tabell", row:"Rad", col:"Kolumn", cell:"Cell" }, autosave:{ unload_msg:"De f\u00F6r\u00E4ndringar som du gjort kommer att g\u00E5 f\u00F6rlorade om du l\u00E4mnar sidan." }, fullscreen:{ desc:"Sl\u00E5 av/p\u00E5 fullsk\u00E4rmsl\u00E4ge" }, media:{ desc:"Infoga/redigera inb\u00E4ddad media", edit:"Redigera inb\u00E4ddad media" }, fullpage:{ desc:"Dokumentinst\u00E4llningar" }, template:{ desc:"Infoga en f\u00E4rdig mall" }, visualchars:{ desc:"Visa osynliga tecken" }, spellchecker:{ desc:"Sl\u00E5 av/p\u00E5 r\u00E4ttstavningskontroll", menu:"R\u00E4ttstavningsinst\u00E4llningar", ignore_word:"Ignorera ord", ignore_words:"Ignorera alla", langs:"Spr\u00E5k", wait:"Var god v\u00E4nta...", sug:"F\u00F6rslag", no_sug:"Inga f\u00F6rslag", no_mpell:"Inga felstavningar funna." }, pagebreak:{ desc:"Infoga sidbrytning" }}});��������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/ta.js���������������������������������������������������������0000664�0000000�0000000�00000007763�12266004471�0020261�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({ta:{ common:{ edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?", apply:"Apply", insert:"Insert", update:"Update", cancel:"Cancel", close:"Close", browse:"Browse", class_name:"Class", not_set:"-- Not set --", clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?", clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.", popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.", invalid_data:"Error: Invalid values entered, these are marked in red.", more_colors:"More colors" }, contextmenu:{ align:"Alignment", left:"Left", center:"Center", right:"Right", full:"Full" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"Insert date", inserttime_desc:"Insert time", months_long:"January,February,March,April,May,June,July,August,September,October,November,December", months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun" }, print:{ print_desc:"Print" }, preview:{ preview_desc:"Preview" }, directionality:{ ltr_desc:"Direction left to right", rtl_desc:"Direction right to left" }, layer:{ insertlayer_desc:"Insert new layer", forward_desc:"Move forward", backward_desc:"Move backward", absolute_desc:"Toggle absolute positioning", content:"New layer..." }, save:{ save_desc:"Save", cancel_desc:"Cancel all changes" }, nonbreaking:{ nonbreaking_desc:"Insert non-breaking space character" }, iespell:{ iespell_desc:"Run spell checking", download:"ieSpell not detected. Do you want to install it now?" }, advhr:{ advhr_desc:"Horizontal rule" }, emotions:{ emotions_desc:"Emotions" }, searchreplace:{ search_desc:"Find", replace_desc:"Find/Replace" }, advimage:{ image_desc:"Insert/edit image" }, advlink:{ link_desc:"Insert/edit link" }, xhtmlxtras:{ cite_desc:"Citation", abbr_desc:"Abbreviation", acronym_desc:"Acronym", del_desc:"Deletion", ins_desc:"Insertion", attribs_desc:"Insert/Edit Attributes" }, style:{ desc:"Edit CSS Style" }, paste:{ paste_text_desc:"Paste as Plain Text", paste_word_desc:"Paste from Word", selectall_desc:"Select All" }, paste_dlg:{ text_title:"Use CTRL+V on your keyboard to paste the text into the window.", text_linebreaks:"Keep linebreaks", word_title:"Use CTRL+V on your keyboard to paste the text into the window." }, table:{ desc:"Inserts a new table", row_before_desc:"Insert row before", row_after_desc:"Insert row after", delete_row_desc:"Delete row", col_before_desc:"Insert column before", col_after_desc:"Insert column after", delete_col_desc:"Remove column", split_cells_desc:"Split merged table cells", merge_cells_desc:"Merge table cells", row_desc:"Table row properties", cell_desc:"Table cell properties", props_desc:"Table properties", paste_row_before_desc:"Paste table row before", paste_row_after_desc:"Paste table row after", cut_row_desc:"Cut table row", copy_row_desc:"Copy table row", del:"Delete table", row:"Row", col:"Column", cell:"Cell" }, autosave:{ unload_msg:"The changes you made will be lost if you navigate away from this page." }, fullscreen:{ desc:"Toggle fullscreen mode" }, media:{ desc:"Insert / edit embedded media", edit:"Edit embedded media" }, fullpage:{ desc:"Document properties" }, template:{ desc:"Insert predefined template content" }, visualchars:{ desc:"Visual control characters on/off." }, spellchecker:{ desc:"Toggle spellchecker", menu:"Spellchecker settings", ignore_word:"Ignore word", ignore_words:"Ignore all", langs:"Languages", wait:"Please wait...", sug:"Suggestions", no_sug:"No suggestions", no_mpell:"No misspellings found." }, pagebreak:{ desc:"Insert page break." }}});�������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/te.js���������������������������������������������������������0000664�0000000�0000000�00000007763�12266004471�0020265�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({te:{ common:{ edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?", apply:"Apply", insert:"Insert", update:"Update", cancel:"Cancel", close:"Close", browse:"Browse", class_name:"Class", not_set:"-- Not set --", clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?", clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.", popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.", invalid_data:"Error: Invalid values entered, these are marked in red.", more_colors:"More colors" }, contextmenu:{ align:"Alignment", left:"Left", center:"Center", right:"Right", full:"Full" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"Insert date", inserttime_desc:"Insert time", months_long:"January,February,March,April,May,June,July,August,September,October,November,December", months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun" }, print:{ print_desc:"Print" }, preview:{ preview_desc:"Preview" }, directionality:{ ltr_desc:"Direction left to right", rtl_desc:"Direction right to left" }, layer:{ insertlayer_desc:"Insert new layer", forward_desc:"Move forward", backward_desc:"Move backward", absolute_desc:"Toggle absolute positioning", content:"New layer..." }, save:{ save_desc:"Save", cancel_desc:"Cancel all changes" }, nonbreaking:{ nonbreaking_desc:"Insert non-breaking space character" }, iespell:{ iespell_desc:"Run spell checking", download:"ieSpell not detected. Do you want to install it now?" }, advhr:{ advhr_desc:"Horizontal rule" }, emotions:{ emotions_desc:"Emotions" }, searchreplace:{ search_desc:"Find", replace_desc:"Find/Replace" }, advimage:{ image_desc:"Insert/edit image" }, advlink:{ link_desc:"Insert/edit link" }, xhtmlxtras:{ cite_desc:"Citation", abbr_desc:"Abbreviation", acronym_desc:"Acronym", del_desc:"Deletion", ins_desc:"Insertion", attribs_desc:"Insert/Edit Attributes" }, style:{ desc:"Edit CSS Style" }, paste:{ paste_text_desc:"Paste as Plain Text", paste_word_desc:"Paste from Word", selectall_desc:"Select All" }, paste_dlg:{ text_title:"Use CTRL+V on your keyboard to paste the text into the window.", text_linebreaks:"Keep linebreaks", word_title:"Use CTRL+V on your keyboard to paste the text into the window." }, table:{ desc:"Inserts a new table", row_before_desc:"Insert row before", row_after_desc:"Insert row after", delete_row_desc:"Delete row", col_before_desc:"Insert column before", col_after_desc:"Insert column after", delete_col_desc:"Remove column", split_cells_desc:"Split merged table cells", merge_cells_desc:"Merge table cells", row_desc:"Table row properties", cell_desc:"Table cell properties", props_desc:"Table properties", paste_row_before_desc:"Paste table row before", paste_row_after_desc:"Paste table row after", cut_row_desc:"Cut table row", copy_row_desc:"Copy table row", del:"Delete table", row:"Row", col:"Column", cell:"Cell" }, autosave:{ unload_msg:"The changes you made will be lost if you navigate away from this page." }, fullscreen:{ desc:"Toggle fullscreen mode" }, media:{ desc:"Insert / edit embedded media", edit:"Edit embedded media" }, fullpage:{ desc:"Document properties" }, template:{ desc:"Insert predefined template content" }, visualchars:{ desc:"Visual control characters on/off." }, spellchecker:{ desc:"Toggle spellchecker", menu:"Spellchecker settings", ignore_word:"Ignore word", ignore_words:"Ignore all", langs:"Languages", wait:"Please wait...", sug:"Suggestions", no_sug:"No suggestions", no_mpell:"No misspellings found." }, pagebreak:{ desc:"Insert page break." }}});�������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/th.js���������������������������������������������������������0000664�0000000�0000000�00000023166�12266004471�0020263�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({th:{ common:{ edit_confirm:"\u0E04\u0E38\u0E13\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E43\u0E0A\u0E49\u0E42\u0E2B\u0E21\u0E14 WYSIWYG \u0E43\u0E19\u0E01\u0E32\u0E23\u0E40\u0E02\u0E35\u0E22\u0E19\u0E1A\u0E17\u0E04\u0E27\u0E32\u0E21\u0E2B\u0E23\u0E37\u0E2D\u0E44\u0E21\u0E48 ?", apply:"\u0E43\u0E0A\u0E49\u0E07\u0E32\u0E19", insert:"\u0E40\u0E1E\u0E34\u0E48\u0E21", update:"\u0E2D\u0E31\u0E1E\u0E40\u0E14\u0E15", cancel:"\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01", close:"\u0E1B\u0E34\u0E14", browse:"\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E1F\u0E25\u0E4C", class_name:"css \u0E04\u0E25\u0E32\u0E2A", not_set:"-- \u0E44\u0E21\u0E48\u0E44\u0E14\u0E49\u0E15\u0E31\u0E49\u0E07\u0E04\u0E48\u0E32 --", clipboard_msg:"\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01 / \u0E15\u0E31\u0E14 / \u0E27\u0E32\u0E07\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E21\u0E35\u0E43\u0E2B\u0E49\u0E1A\u0E23\u0E34\u0E01\u0E32\u0E23\u0E43\u0E19 Mozilla \u0E41\u0E25\u0E30 Firefox.\nDo \u0E04\u0E38\u0E13\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E15\u0E34\u0E21\u0E40\u0E01\u0E35\u0E48\u0E22\u0E27\u0E01\u0E31\u0E1A\u0E1B\u0E31\u0E0D\u0E2B\u0E32\u0E19\u0E35\u0E49\u0E2B\u0E23\u0E37\u0E2D\u0E44\u0E21\u0E48?", clipboard_no_support:"\u0E02\u0E13\u0E30\u0E19\u0E35\u0E49\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E2A\u0E19\u0E31\u0E1A\u0E2A\u0E19\u0E38\u0E19\u0E40\u0E1A\u0E23\u0E32\u0E40\u0E0B\u0E2D\u0E23\u0E4C\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13 \u0E43\u0E2B\u0E49\u0E43\u0E0A\u0E49\u0E41\u0E1B\u0E49\u0E19\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E25\u0E31\u0E14\u0E41\u0E17\u0E19", popup_blocked:"\u0E02\u0E2D\u0E2D\u0E20\u0E31\u0E22\u0E41\u0E15\u0E48\u0E40\u0E23\u0E32\u0E1E\u0E1A\u0E27\u0E48\u0E32\u0E04\u0E38\u0E13\u0E21\u0E35\u0E23\u0E30\u0E1A\u0E1A\u0E1B\u0E49\u0E2D\u0E07\u0E01\u0E31\u0E19\u0E1B\u0E4A\u0E2D\u0E1B\u0E2D\u0E31\u0E1B \u0E04\u0E38\u0E13\u0E08\u0E30\u0E15\u0E49\u0E2D\u0E07\u0E1B\u0E34\u0E14\u0E01\u0E32\u0E23\u0E43\u0E0A\u0E49\u0E07\u0E32\u0E19\u0E01\u0E32\u0E23\u0E1A\u0E25\u0E47\u0E2D\u0E04\u0E1B\u0E4A\u0E2D\u0E1B\u0E2D\u0E31\u0E1B", invalid_data:"\u0E02\u0E49\u0E2D\u0E1C\u0E34\u0E14\u0E1E\u0E25\u0E32\u0E14: \u0E1B\u0E49\u0E2D\u0E19\u0E04\u0E48\u0E32\u0E43\u0E19\u0E0A\u0E49\u0E2D\u0E07\u0E2A\u0E35\u0E41\u0E14\u0E07\u0E43\u0E2B\u0E49\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07", more_colors:"\u0E2A\u0E35\u0E2D\u0E37\u0E48\u0E19\u0E46" }, contextmenu:{ align:"\u0E15\u0E33\u0E41\u0E2B\u0E19\u0E48\u0E07\u0E08\u0E31\u0E14\u0E27\u0E32\u0E07", left:"\u0E0B\u0E49\u0E32\u0E22", center:"\u0E01\u0E25\u0E32\u0E07", right:"\u0E02\u0E27\u0E32", full:"\u0E40\u0E15\u0E47\u0E21" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"Insert date", inserttime_desc:"Insert time", months_long:"\u0E21\u0E01\u0E23\u0E32\u0E04\u0E21,\u0E01\u0E38\u0E21\u0E20\u0E32\u0E1E\u0E31\u0E19\u0E18\u0E4C,\u0E21\u0E35\u0E19\u0E32\u0E04\u0E21,\u0E40\u0E21\u0E29\u0E32\u0E22\u0E19,\u0E1E\u0E24\u0E29\u0E20\u0E32\u0E04\u0E21,\u0E21\u0E34\u0E16\u0E38\u0E19\u0E32\u0E22\u0E19,\u0E01\u0E23\u0E01\u0E0E\u0E32\u0E04\u0E21,\u0E2A\u0E34\u0E07\u0E2B\u0E32\u0E04\u0E21,\u0E01\u0E31\u0E19\u0E22\u0E32\u0E22\u0E19,\u0E15\u0E38\u0E25\u0E32\u0E04\u0E21,\u0E1E\u0E24\u0E28\u0E08\u0E34\u0E01\u0E32\u0E22\u0E19,\u0E18\u0E31\u0E19\u0E27\u0E32\u0E04\u0E21", months_short:"\u0E21.\u0E04.,\u0E01.\u0E1E.,\u0E21\u0E35.\u0E04.,\u0E40\u0E21.\u0E22.,\u0E1E.\u0E04.,\u0E21\u0E34.\u0E22.,\u0E01.\u0E04.,\u0E2A.\u0E04.,\u0E01.\u0E22.,\u0E15.\u0E04.,\u0E1E.\u0E22.,\u0E18.\u0E04.", day_long:"\u0E27\u0E31\u0E19\u0E2D\u0E32\u0E17\u0E34\u0E15\u0E22\u0E4C,\u0E27\u0E31\u0E19\u0E08\u0E31\u0E19\u0E17\u0E23\u0E4C,\u0E27\u0E31\u0E19\u0E2D\u0E31\u0E07\u0E04\u0E32\u0E23,\u0E27\u0E31\u0E19\u0E1E\u0E38\u0E18,\u0E27\u0E31\u0E19\u0E1E\u0E24\u0E2B\u0E31\u0E2A\u0E1A\u0E14\u0E35,\u0E27\u0E31\u0E19\u0E28\u0E38\u0E01\u0E23\u0E4C,\u0E27\u0E31\u0E19\u0E40\u0E2A\u0E32\u0E23\u0E4C,\u0E2D\u0E32\u0E17\u0E34\u0E15\u0E22\u0E4C", day_short:"\u0E2D\u0E32,\u0E08,\u0E2D\u0E31\u0E07,\u0E1E,\u0E1E\u0E24,\u0E28,\u0E2A,\u0E2D" }, print:{ print_desc:"\u0E1E\u0E34\u0E21\u0E1E\u0E4C" }, preview:{ preview_desc:"\u0E14\u0E39\u0E15\u0E31\u0E27\u0E2D\u0E22\u0E48\u0E32\u0E07" }, directionality:{ ltr_desc:"\u0E2D\u0E48\u0E32\u0E19\u0E08\u0E32\u0E01\u0E0B\u0E49\u0E32\u0E22\u0E44\u0E1B\u0E02\u0E27\u0E32", rtl_desc:"\u0E2D\u0E48\u0E32\u0E19\u0E08\u0E32\u0E01\u0E02\u0E27\u0E32\u0E44\u0E1B\u0E0B\u0E49\u0E32\u0E22" }, layer:{ insertlayer_desc:"\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E25\u0E40\u0E22\u0E2D\u0E23\u0E4C\u0E43\u0E2B\u0E21\u0E48", forward_desc:"\u0E22\u0E49\u0E32\u0E22\u0E44\u0E1B\u0E02\u0E49\u0E32\u0E07\u0E2B\u0E19\u0E49\u0E32", backward_desc:"\u0E22\u0E49\u0E32\u0E22\u0E44\u0E1B\u0E02\u0E49\u0E32\u0E07\u0E2B\u0E25\u0E31\u0E07", absolute_desc:"\u0E2A\u0E25\u0E31\u0E1A\u0E01\u0E32\u0E23\u0E27\u0E32\u0E07", content:"\u0E40\u0E25\u0E40\u0E22\u0E2D\u0E23\u0E4C\u0E43\u0E2B\u0E21\u0E48..." }, save:{ save_desc:"\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01", cancel_desc:"\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01\u0E17\u0E38\u0E01\u0E2D\u0E22\u0E48\u0E32\u0E07" }, nonbreaking:{ nonbreaking_desc:"\u0E41\u0E17\u0E23\u0E01\u0E2D\u0E31\u0E01\u0E02\u0E23\u0E30\u0E27\u0E48\u0E32\u0E07" }, iespell:{ iespell_desc:"\u0E40\u0E23\u0E35\u0E22\u0E01\u0E43\u0E0A\u0E49\u0E15\u0E23\u0E27\u0E08\u0E01\u0E32\u0E23\u0E2A\u0E30\u0E01\u0E14", download:"\u0E2B\u0E32\u0E01\u0E23\u0E30\u0E1A\u0E1A\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A\u0E04\u0E33\u0E1C\u0E34\u0E14\u0E44\u0E21\u0E48\u0E1E\u0E1A \u0E04\u0E38\u0E13\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E15\u0E34\u0E14\u0E15\u0E31\u0E49\u0E07\u0E40\u0E14\u0E35\u0E4B\u0E22\u0E27\u0E19\u0E35\u0E49 ?" }, advhr:{ advhr_desc:"\u0E40\u0E2A\u0E49\u0E19\u0E1A\u0E23\u0E23\u0E17\u0E31\u0E14" }, emotions:{ emotions_desc:"Emotions" }, searchreplace:{ search_desc:"\u0E04\u0E49\u0E19\u0E2B\u0E32", replace_desc:"\u0E04\u0E49\u0E19\u0E2B\u0E32/\u0E41\u0E17\u0E19\u0E17\u0E35\u0E48" }, advimage:{ image_desc:"\u0E40\u0E1E\u0E34\u0E48\u0E21/\u0E41\u0E01\u0E49\u0E44\u0E02 \u0E23\u0E39\u0E1B" }, advlink:{ link_desc:"\u0E40\u0E1E\u0E34\u0E48\u0E21/\u0E41\u0E01\u0E49\u0E44\u0E02 \u0E25\u0E34\u0E49\u0E07\u0E04\u0E4C" }, xhtmlxtras:{ cite_desc:"\u0E01\u0E32\u0E23\u0E2D\u0E49\u0E32\u0E07\u0E2D\u0E34\u0E07", abbr_desc:"\u0E15\u0E31\u0E27\u0E22\u0E48\u0E2D", acronym_desc:"\u0E2D\u0E31\u0E01\u0E29\u0E23\u0E22\u0E48\u0E2D", del_desc:"\u0E25\u0E1A", ins_desc:"\u0E40\u0E1E\u0E34\u0E48\u0E21", attribs_desc:"\u0E40\u0E1E\u0E34\u0E48\u0E21/\u0E41\u0E01\u0E49\u0E44\u0E02 \u0E41\u0E2D\u0E17\u0E17\u0E23\u0E34\u0E1A\u0E34\u0E27" }, style:{ desc:"\u0E41\u0E01\u0E49\u0E44\u0E02 CSS" }, paste:{ paste_text_desc:"\u0E27\u0E32\u0E07\u0E42\u0E14\u0E22\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E18\u0E23\u0E23\u0E21\u0E14\u0E32", paste_word_desc:"\u0E27\u0E32\u0E07\u0E08\u0E32\u0E01\u0E42\u0E1B\u0E23\u0E41\u0E01\u0E23\u0E21 Word", selectall_desc:"\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14" }, paste_dlg:{ text_title:"Use CTRL+V on your keyboard to paste the text into the window.", text_linebreaks:"Keep linebreaks", word_title:"Use CTRL+V on your keyboard to paste the text into the window." }, table:{ desc:"Inserts a new table", row_before_desc:"Insert row before", row_after_desc:"Insert row after", delete_row_desc:"Delete row", col_before_desc:"Insert column before", col_after_desc:"Insert column after", delete_col_desc:"Remove column", split_cells_desc:"Split merged table cells", merge_cells_desc:"Merge table cells", row_desc:"Table row properties", cell_desc:"Table cell properties", props_desc:"Table properties", paste_row_before_desc:"Paste table row before", paste_row_after_desc:"Paste table row after", cut_row_desc:"Cut table row", copy_row_desc:"Copy table row", del:"Delete table", row:"Row", col:"Column", cell:"Cell" }, autosave:{ unload_msg:"\u0E01\u0E32\u0E23\u0E40\u0E1B\u0E25\u0E35\u0E48\u0E22\u0E19\u0E41\u0E1B\u0E25\u0E07\u0E17\u0E35\u0E48\u0E04\u0E38\u0E13\u0E17\u0E33\u0E08\u0E30\u0E2B\u0E32\u0E22\u0E44\u0E1B\u0E2B\u0E32\u0E01\u0E04\u0E38\u0E13\u0E2D\u0E2D\u0E01\u0E08\u0E32\u0E01\u0E2B\u0E19\u0E49\u0E32\u0E19\u0E35\u0E49" }, fullscreen:{ desc:"\u0E2A\u0E25\u0E31\u0E1A\u0E44\u0E1B\u0E41\u0E2A\u0E14\u0E07\u0E41\u0E1A\u0E1A\u0E40\u0E15\u0E47\u0E21\u0E2B\u0E19\u0E49\u0E32" }, media:{ desc:"\u0E40\u0E1E\u0E34\u0E48\u0E21 / \u0E41\u0E01\u0E49\u0E44\u0E02 \u0E21\u0E35\u0E40\u0E14\u0E35\u0E22", edit:"\u0E41\u0E01\u0E49\u0E44\u0E02\u0E21\u0E35\u0E40\u0E14\u0E35\u0E22" }, fullpage:{ desc:"\u0E04\u0E38\u0E13\u0E2A\u0E21\u0E1A\u0E31\u0E15\u0E34\u0E40\u0E2D\u0E01\u0E2A\u0E32\u0E23" }, template:{ desc:"\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E41\u0E21\u0E48\u0E41\u0E1A\u0E1A\u0E40\u0E2D\u0E01\u0E2A\u0E32\u0E23" }, visualchars:{ desc:"\u0E01\u0E32\u0E23\u0E04\u0E27\u0E1A\u0E04\u0E38\u0E21\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23 \u0E40\u0E1B\u0E34\u0E14/\u0E1B\u0E34\u0E14" }, spellchecker:{ desc:"\u0E1B\u0E34\u0E14\u0E01\u0E32\u0E23\u0E2A\u0E30\u0E01\u0E14\u0E04\u0E33", menu:"\u0E15\u0E31\u0E49\u0E07\u0E04\u0E48\u0E32\u0E01\u0E32\u0E23\u0E2A\u0E30\u0E01\u0E14\u0E04\u0E33", ignore_word:"\u0E25\u0E30\u0E40\u0E27\u0E49\u0E19\u0E1A\u0E32\u0E07\u0E04\u0E33", ignore_words:"\u0E25\u0E30\u0E40\u0E27\u0E49\u0E19\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14", langs:"\u0E20\u0E32\u0E29\u0E32", wait:"\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E2D...", sug:"\u0E04\u0E33\u0E41\u0E19\u0E30\u0E19\u0E33", no_sug:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E33\u0E41\u0E19\u0E30\u0E19\u0E33", no_mpell:"\u0E44\u0E21\u0E48\u0E1E\u0E1A\u0E23\u0E30\u0E1A\u0E1A\u0E2A\u0E30\u0E01\u0E14\u0E04\u0E33\u0E1C\u0E34\u0E14" }, pagebreak:{ desc:"\u0E43\u0E2A\u0E48\u0E40\u0E2A\u0E49\u0E19\u0E41\u0E1A\u0E48\u0E07\u0E2B\u0E19\u0E49\u0E32" }}});����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/tr.js���������������������������������������������������������0000664�0000000�0000000�00000011037�12266004471�0020267�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({tr:{ common:{ edit_confirm:"Bu metin b\u00F6lgesi i\u00E7in WYSIWYG modunu kullanmak istiyor musu", apply:"Uygula", insert:"Ekle", update:"G\u00FCncel", cancel:"\u0130pt", close:"Kapat", browse:"G\u00F6z", class_name:"S\u0131", not_set:"-- se\u00E7iniz ", clipboard_msg:"Kopyala/Kes/Yap\u0131\u015Ft\u0131r Mozilla ve Firefox'ta kullan\u0131lamaz.\nBu konuda daha fazla bilgi edinmek ister ", clipboard_no_support:"\u015Eimdilik taray\u0131c\u0131n\u0131z taraf\u0131ndan desteklenmemektedir, bunun yerine k\u0131sayol tu\u015Fla", popup_blocked:"\u00DCzg\u00FCn\u00FCz, fakat popup-engelleyiciniz uygulama i\u00E7in gerekli bir pencerenin a\u00E7\u0131lmas\u0131na izin vermedi. Bu arac\u0131 tam olarak kullanabilmek i\u00E7in popup engelleyicinizi kapa", invalid_data:"Hata: Ge\u00E7ersiz de\u011Ferler girildi, bunlar k\u0131rm\u0131z\u0131yla i", more_colors:"Daha fazla renk" }, contextmenu:{ align:"Hizalama", left:"Sola", center:"Ortala", right:"Sae", full:"\u0130ki ya" }, insertdatetime:{ date_fmt:"%d-%m-%Y", time_fmt:"%H:%M:%S", insertdate_desc:"Tarih ekle", inserttime_desc:"Zaman ekle", months_long:"Ocak,\u015Eubat,Mart,Nisan,May\u0131s,Haziran,Temmuz,A\u011Fustos,Eyl\u00FCl,Ekim,Kas", months_short:"Oca,\u015Eub,Mar,Nis,May,Haz,Tem,A\u011Fu,Eyl,Eki,Kas", day_long:"Pazar,Pazartesi,Sal\u0131,\u00C7ar\u015Famba,Per\u015Fembe,Cuma,Cumarte", day_short:"Paz,Pzt,Sal,\u00C7r\u015F,Per,Cum,Cts" }, print:{ print_desc:"Yazd" }, preview:{ preview_desc:"\u00D6nizle" }, directionality:{ ltr_desc:"Sa\u011Fdan sola y\u00F6nel", rtl_desc:"Soldan sa\u011Fa y\u00F6nel" }, layer:{ insertlayer_desc:"Yeni katman ekle", forward_desc:"\u00D6ne ", backward_desc:"Arkaya al", absolute_desc:"Mutlak konumland\u0131rmay\u0131 a", content:"Yeni katman..." }, save:{ save_desc:"Kaydet", cancel_desc:"T\u00FCm de\u011Fi\u015Fiklikleri ip" }, nonbreaking:{ nonbreaking_desc:"K\u0131r\u0131l\u0131ms\u0131z bo\u015Fluk kara" }, iespell:{ iespell_desc:"\u0130mla kontrol\u00FCn\u00FC ", download:"ieSpell bulunamad\u0131. \u015Eimdi kurmak ister misi" }, advhr:{ advhr_desc:"Yatay \u00E7iz" }, emotions:{ emotions_desc:"\u0130fadel" }, searchreplace:{ search_desc:"Bul", replace_desc:"Bul/De\u011Fi" }, advimage:{ image_desc:"Resim ekle/d\u00FCzen" }, advlink:{ link_desc:"Ba\u011Flant\u0131 ekle/d" }, xhtmlxtras:{ cite_desc:"Kaynak", abbr_desc:"K\u0131salt", acronym_desc:"K\u0131sa ", del_desc:"Silme", ins_desc:"Ekleme", attribs_desc:"Nitelik ekle/d\u00FCzen" }, style:{ desc:"CSS Stili D\u00FCzen" }, paste:{ paste_text_desc:"Sade Metin olarak yap\u0131", paste_word_desc:"Word'den yap\u0131", selectall_desc:"T\u00FCm\u00FCn" }, paste_dlg:{ text_title:"Pencereye metin yap\u0131\u015Ft\u0131rmak i\u00E7in CTRL+V tu\u015Funu k", text_linebreaks:"Sat\u0131r k\u0131r\u0131l\u0131mla", word_title:"Pencereye metin yap\u0131\u015Ft\u0131rmak i\u00E7in CTRL+V tu\u015Funu k" }, table:{ desc:"Yeni bir tablo ekler", row_before_desc:"\u00DCst\u00FCne bir sat\u0131", row_after_desc:"Alt\u0131na bir sat\u0131r ", delete_row_desc:"Sat\u0131r\u0131", col_before_desc:"Soluna bir kolon ekle", col_after_desc:"Sa\u011F\u0131na bir kolon ", delete_col_desc:"Kolonu sil", split_cells_desc:"Birle\u015Fitirilmi\u015F tablo h\u00FCcrelerin", merge_cells_desc:"Tablo h\u00FCcrelerini birleo", row_desc:"Tablo sat\u0131r \u00F6zellik", cell_desc:"Tablo h\u00FCcre \u00F6zelli", props_desc:"Tablo \u00F6zellikle", paste_row_before_desc:"\u00DCst\u00FCne tablo sat\u0131r\u0131no", paste_row_after_desc:"Alt\u0131na tablo sat\u0131r\u0131n\u0131 ", cut_row_desc:"Tablo sat\u0131r\u0131n", copy_row_desc:"Tablo sat\u0131r\u0131n\u0131 k", del:"Tabloyu sil", row:"Satm", col:"Kolon", cell:"H\u00FCc" }, autosave:{ unload_msg:"Bu sayfadan \u00E7\u0131karsan\u0131z yapt\u0131\u011F\u0131n\u0131z de\u011Fi\u015Fikli" }, fullscreen:{ desc:"Tam ekran modunu a\u00E7/ka" }, media:{ desc:"T\u00FCmle\u015Fik medya ekle/d", edit:"T\u00FCmle\u015Fik medya dk" }, fullpage:{ desc:"Belge \u00F6zellikle" }, template:{ desc:"\u00D6ntan\u0131ml\u0131 \u015Fablon i" }, visualchars:{ desc:"G\u00F6rsel kontrol karakterleri a\u00E7\u0131k/k" }, spellchecker:{ desc:"\u0130mla kontrol\u00FCn\u00FC ", menu:"\u0130mla kontrol ayarla", ignore_word:"S\u00F6zc\u00FC\u011F\u00FC", ignore_words:"Hi\u00E7birini \u00F6nem", langs:"Diller", wait:"L\u00FCtfen bekleyiniz.", sug:"\u00D6neril", no_sug:"\u00D6neri y", no_mpell:"Bir imla hatas\u0131 bulunamad" }, pagebreak:{ desc:"Sayfa k\u0131r\u0131l\u0131m" }}});�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/tt.js���������������������������������������������������������0000664�0000000�0000000�00000013104�12266004471�0020266�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({tt:{ common:{ edit_confirm:"\u662F\u5426\u5728\u8A72text area\u5167\u5553\u7528\u6240\u898B\u5373\u6240\u5F97\u6A21\u5F0F\uFF1F", apply:"\u61C9\u7528", insert:"\u63D2\u5165", update:"\u66F4\u65B0", cancel:"\u53D6\u6D88", close:"\u95DC\u9589", browse:"\u700F\u89BD", class_name:"\u6A23\u5F0F\u985E\u540D", not_set:"-- \u672A\u8A2D\u5B9A --", clipboard_msg:"\u8907\u88FD\u3001\u526A\u4E0B\u548C\u8CBC\u4E0A\u529F\u80FD\u5728Mozilla \u548C Firefox\u4E2D\u7121\u6CD5\u4F7F\u7528", clipboard_no_support:"\u5C1A\u4E0D\u652F\u63F4\u60A8\u6240\u4F7F\u7528\u7684\u700F\u89BD\u5668\uFF0C\u8ACB\u4F7F\u7528\u9375\u76E4\u65B9\u5F0F\u64CD\u4F5C", popup_blocked:"\u5C0D\u4E0D\u8D77\uFF0C\u60A8\u7684\u5FEB\u986F\u8996\u7A97\u963B\u6B62\u7A0B\u5F0F\u5DF2\u7D93\u963B\u6B62\u4E86\u672C\u5FEB\u986F\u8996\u7A97\uFF0C\u8ACB\u8ABF\u6574\u4F60\u7684\u700F\u89BD\u5668\u8A2D\u5B9A\uFF0C\u5141\u8A31\u672C\u7DB2\u7AD9\u5F48\u51FA\u65B0\u7A97\u53E3\uFF0C\u4EE5\u4FBF\u4F7F\u7528\u6B64\u529F\u80FD", invalid_data:"\u932F\u8AA4\uFF1A\u8F38\u5165\u4E86\u7121\u6548\u7684\u503C\uFF0C\u5DF2\u6A19\u8A18\u7232\u7D05\u8272\u3002", more_colors:"\u66F4\u591A\u9854\u8272" }, contextmenu:{ align:"\u5C0D\u9F4A\u65B9\u5F0F", left:"\u9760\u5DE6\u5C0D\u9F4A", center:"\u7F6E\u4E2D", right:"\u9760\u53F3\u5C0D\u9F4A", full:"\u5169\u7AEF\u5C0D\u9F4A" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"\u63D2\u5165\u4ECA\u5929\u65E5\u671F", inserttime_desc:"\u63D2\u5165\u73FE\u5728\u6642\u9593", months_long:"\u4E00\u6708,\u4E8C\u6708,\u4E09\u6708,\u56DB\u6708,\u4E94\u6708,\u516D\u6708,\u4E03\u6708,\u516B\u6708,\u4E5D\u6708,\u5341\u6708,\u5341\u4E00\u6708,\u5341\u4E8C\u6708", months_short:"1\u6708,2\u6708,3\u6708,4\u6708,5\u6708,6\u6708,7\u6708,8\u6708,9\u6708,10\u6708,11\u6708,12\u6708", day_long:"\u661F\u671F\u65E5,\u661F\u671F\u4E00,\u661F\u671F\u4E8C,\u661F\u671F\u4E09,\u661F\u671F\u56DB,\u661F\u671F\u4E94,\u661F\u671F\u516D,\u661F\u671F\u65E5", day_short:"\u9031\u65E5,\u9031\u4E00,\u9031\u4E8C,\u9031\u4E09,\u9031\u56DB,\u9031\u4E94,\u9031\u516D,\u9031\u65E5" }, print:{ print_desc:"\u5217\u5370" }, preview:{ preview_desc:"\u9810\u89BD" }, directionality:{ ltr_desc:"\u6587\u5B57\u5F9E\u5DE6\u5230\u53F3", rtl_desc:"\u6587\u5B57\u5F9E\u53F3\u5230\u5DE6" }, layer:{ insertlayer_desc:"\u63D2\u5165\u5C64", forward_desc:"\u524D\u7F6E", backward_desc:"\u5F8C\u7F6E", absolute_desc:"\u7D55\u5C0D\u4F4D\u7F6E", content:"\u65B0\u589E\u5C64..." }, save:{ save_desc:"\u5B58\u6A94", cancel_desc:"\u653E\u68C4\u6240\u6709\u66F4\u6539" }, nonbreaking:{ nonbreaking_desc:"\u63D2\u5165\u7A7A\u767D\u5B57\u5143" }, iespell:{ iespell_desc:"\u57F7\u884C\u62FC\u5B57\u6AA2\u67E5", download:"\u672A\u6AA2\u6E2C\u5230ieSpell\u5143\u4EF6\uFF0C\u662F\u5426\u73FE\u5728\u5B89\u88DD ?" }, advhr:{ advhr_desc:"\u5206\u9694\u7DDA" }, emotions:{ emotions_desc:"\u8868\u60C5" }, searchreplace:{ search_desc:"\u641C\u5C0B", replace_desc:"\u641C\u5C0B/\u53D6\u4EE3" }, advimage:{ image_desc:"\u63D2\u5165/\u7DE8\u8F2F \u5716\u7247" }, advlink:{ link_desc:"\u63D2\u5165/\u7DE8\u8F2F \u9023\u7D50" }, xhtmlxtras:{ cite_desc:"\u5F15\u7528", abbr_desc:"\u7E2E\u5BEB", acronym_desc:"\u9996\u5B57\u6BCD\u7E2E\u5BEB", del_desc:"\u522A\u9664", ins_desc:"\u63D2\u5165", attribs_desc:"\u63D2\u5165/\u7DE8\u8F2F \u5C6C\u6027" }, style:{ desc:"\u7DE8\u8F2F CSS \u6A23\u5F0F\u8868" }, paste:{ paste_text_desc:"\u8CBC\u4E0A\u7232\u7D14\u6587\u5B57", paste_word_desc:"\u8CBC\u4E0A\u7232Word\u683C\u5F0F", selectall_desc:"\u5168\u9078" }, paste_dlg:{ text_title:"\u5C07\u8907\u88FD(CTRL + C)\u7684\u5167\u5BB9\u8CBC\u4E0A(CTRL + V)\u5230\u8996\u7A97\u3002", text_linebreaks:"\u4FDD\u7559\u5206\u884C\u7B26\u865F\u865F", word_title:"\u5C07\u8907\u88FD(CTRL + C)\u7684\u5167\u5BB9\u8CBC\u4E0A(CTRL + V)\u5230\u8996\u7A97\u3002" }, table:{ desc:"\u63D2\u5165\u65B0\u8868\u683C", row_before_desc:"\u5728\u4E0A\u65B9\u63D2\u5165\u884C", row_after_desc:"\u5728\u4E0B\u65B9\u63D2\u5165\u884C", delete_row_desc:"\u522A\u9664\u7576\u524D\u884C", col_before_desc:"\u5728\u5DE6\u5074\u63D2\u5165\u5217", col_after_desc:"\u5728\u53F3\u5074\u63D2\u5165\u5217", delete_col_desc:"\u522A\u9664\u7576\u524D\u5217", split_cells_desc:"\u62C6\u5206\u5132\u5B58\u683C", merge_cells_desc:"\u5408\u4F75\u5132\u5B58\u683C", row_desc:"\u5217 \u5C6C\u6027", cell_desc:"\u5132\u5B58\u683C \u5C6C\u6027", props_desc:"\u8868\u683C \u5C6C\u6027", paste_row_before_desc:"\u8CBC\u4E0A\u884C\u5230\u4E0A\u65B9", paste_row_after_desc:"\u8CBC\u4E0A\u884C\u5230\u4E0B\u65B9", cut_row_desc:"\u526A\u4E0B\u7576\u524D\u5217", copy_row_desc:"\u8907\u88FD\u7576\u524D\u5217", del:"\u522A\u9664\u8868\u683C", row:"\u884C", col:"\u5217", cell:"\u5132\u5B58\u683C" }, autosave:{ unload_msg:"\u5982\u679C\u96E2\u958B\u8A72\u9801\u5C07\u5C0E\u81F4\u6240\u6709\u4FEE\u6539\u5168\u90E8\u907A\u5931\u3002" }, fullscreen:{ desc:"\u5168\u87A2\u5E55\u6A21\u5F0F" }, media:{ desc:"\u63D2\u5165/\u7DE8\u8F2F \u5A92\u9AD4", edit:"\u7DE8\u8F2F \u5A92\u9AD4" }, fullpage:{ desc:"\u6587\u4EF6" }, template:{ desc:"\u63D2\u5165\u9078\u5B9A\u7684\u7BC4\u672C" }, visualchars:{ desc:"\u986F\u793A\u63A7\u5236\u7B26\u865F\u3002" }, spellchecker:{ desc:"\u62FC\u5B57\u6AA2\u67E5", menu:"\u62FC\u5B57\u6AA2\u67E5 \u8A2D\u5B9A", ignore_word:"\u5FFD\u7565", ignore_words:"\u5168\u90E8\u5FFD\u7565", langs:"\u8A9E\u8A00\u6E05\u55AE", wait:"\u8ACB\u7A0D\u5019...", sug:"\u5EFA\u8B70\u8A5E", no_sug:"\u7121\u62FC\u5B57\u5EFA\u8B70", no_mpell:"\u7121\u62FC\u5B57\u932F\u8AA4" }, pagebreak:{ desc:"\u63D2\u5165\u5206\u9801\u7B26\u865F" }}});������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/tw.js���������������������������������������������������������0000664�0000000�0000000�00000014014�12266004471�0020272�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({tw:{ common:{ edit_confirm:"\u662F\u5426\u5728\u6B64textarea\u6A19\u7C64\u5167\u4F7F\u7528\u201C\u6240\u898B\u5373\u6240\u5F97\u201D\u6A21\u5F0F\uFF1F", apply:"\u61C9\u7528", insert:"\u63D2\u5165", update:"\u66F4\u65B0", cancel:"\u53D6\u6D88", close:"\u95DC\u9589", browse:"\u700F\u89BD", class_name:"\u6A23\u5F0F", not_set:"--\u672A\u8A2D\u7F6E--", clipboard_msg:"\u8907\u88FD\u3001\u526A\u4E0B\u3001\u8CBC\u4E0A\u529F\u80FD\u5728Mozilla\u548CFirefox\u4E2D\u4E0D\u80FD\u4F7F\u7528\u3002 \n\u662F\u5426\u9700\u8981\u77AD\u89E3\u66F4\u591A\u6709\u95DC\u6B64\u554F\u984C\u7684\u8CC7\u8A0A\uFF1F", clipboard_no_support:"\u9084\u4E0D\u652F\u63F4\u60A8\u7684\u700F\u89BD\u5668\uFF0C\u8ACB\u4F7F\u7528\u9375\u76E4\u5FEB\u901F\u9375", popup_blocked:"\u62B1\u6B49\uFF01\u5F48\u51FA\u8996\u7A97\u5DF2\u88AB\u963B\u6B62\uFF0C\u8ACB\u8ABF\u6574\u700F\u89BD\u5668\u8A2D\u7F6E\uFF0C\u5141\u8A31\u6B64\u7DB2\u7AD9\u53EF\u5F48\u51FA\u65B0\u8996\u7A97\uFF0C\u4EE5\u4FBF\u4F7F\u7528\u6B64\u5DE5\u5177", invalid_data:"\u932F\u8AA4:\u7121\u6548\u8F38\u5165\u503C\uFF0C\u5DF2\u6A19\u8A18\u70BA\u7D05\u8272\u3002", more_colors:"\u66F4\u591A\u984F\u8272" }, contextmenu:{ align:"\u5C0D\u9F4A\u65B9\u5F0F", left:"\u9760\u5DE6\u5C0D\u9F4A", center:"\u7F6E\u4E2D\u5C0D\u9F4A", right:"\u9760\u53F3\u5C0D\u9F4A", full:"\u5DE6\u53F3\u5C0D\u9F4A" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"\u63D2\u5165\u4ECA\u5929\u65E5\u671F", inserttime_desc:"\u63D2\u5165\u73FE\u5728\u6642\u9593", months_long:"\u4E00\u6708,\u4E8C\u6708,\u4E09\u6708,\u56DB\u6708,\u4E94\u6708,\u516D\u6708,\u4E03\u6708,\u516B\u6708,\u4E5D\u6708,\u5341\u6708,\u5341\u4E00\u6708,\u5341\u4E8C\u6708", months_short:"1\u6708,2\u6708,3\u6708,4\u6708,5\u6708,6\u6708,7\u6708,8\u6708,9\u6708,10\u6708,11\u6708,12\u6708", day_long:"\u661F\u671F\u65E5,\u661F\u671F\u4E00,\u661F\u671F\u4E8C,\u661F\u671F\u4E09,\u661F\u671F\u56DB,\u661F\u671F\u4E94,\u661F\u671F\u516D,\u661F\u671F\u65E5", day_short:"\u9031\u65E5,\u9031\u4E00,\u9031\u4E8C,\u9031\u4E09,\u9031\u56DB,\u9031\u4E94,\u9031\u516D,\u9031\u65E5" }, print:{ print_desc:"\u5217\u5370" }, preview:{ preview_desc:"\u9810\u89BD\u5217\u5370" }, directionality:{ ltr_desc:"\u6587\u5B57\u5F9E\u5DE6\u5230\u53F3", rtl_desc:"\u6587\u5B57\u5F9E\u53F3\u5230\u5DE6" }, layer:{ insertlayer_desc:"\u63D2\u5165\u5716\u5C64", forward_desc:"\u4E0A\u79FB\u4E00\u5C64", backward_desc:"\u4E0B\u79FB\u4E00\u5C64", absolute_desc:"\u958B\u95DC\u7D55\u5C0D\u4F4D\u7F6E", content:"\u65B0\u589E\u5716\u5C64..." }, save:{ save_desc:"\u5132\u5B58", cancel_desc:"\u53D6\u6D88\u6240\u6709\u66F4\u6539" }, nonbreaking:{ nonbreaking_desc:"\u63D2\u5165\u4E0D\u65B7\u884C\u7A7A\u767D" }, iespell:{ iespell_desc:"\u62FC\u5B57\u6AA2\u67E5", download:"\u672A\u6AA2\u6E2C\u5230ieSpell\u7684\u5B58\u5728\u3002\u662F\u5426\u73FE\u5728\u7ACB\u5373\u5B89\u88DD\uFF1F" }, advhr:{ advhr_desc:"\u6C34\u5E73\u7DDA" }, emotions:{ emotions_desc:"\u5716\u793A" }, searchreplace:{ search_desc:"\u5C0B\u627E", replace_desc:"\u5C0B\u627E/\u53D6\u4EE3" }, advimage:{ image_desc:"\u63D2\u5165/\u7DE8\u8F2F\u5716\u7247" }, advlink:{ link_desc:"\u63D2\u5165/\u7DE8\u8F2F\u9023\u7D50" }, xhtmlxtras:{ cite_desc:"\u5F15\u6587", abbr_desc:"\u7E2E\u5BEB", acronym_desc:"\u9996\u5B57\u7E2E\u5BEB", del_desc:"\u522A\u9664", ins_desc:"\u63D2\u5165", attribs_desc:"\u63D2\u5165/\u7DE8\u8F2F\u5C6C\u6027", ins_delta_width:"300", ins_delta_height:"200", attribs_delta_width:"40", attribs_delta_height:"60" }, style:{ desc:"\u7DE8\u8F2FCSS\u6A23\u5F0F\u8868" }, paste:{ paste_text_desc:"\u4EE5\u7D14\u6587\u5B57\u8CBC\u4E0A", paste_word_desc:"\u5F9EWord\u8CBC\u4E0A", selectall_desc:"\u5168\u9078" }, paste_dlg:{ text_title:"\u5728\u9375\u76E4\u4E0A\u540C\u6642\u6309\u4E0BCTRL\u548CV\u9375\uFF0C\u4EE5\u8CBC\u4E0A\u6587\u5B57\u5230\u6B64\u8996\u7A97\u3002", text_linebreaks:"\u4FDD\u7559\u5206\u884C\u7B26\u865F", word_title:"\u5728\u9375\u76E4\u4E0A\u540C\u6642\u6309\u4E0BCTRL\u548CV\u9375\uFF0C\u4EE5\u8CBC\u4E0A\u6587\u5B57\u5230\u6B64\u8996\u7A97\u3002" }, table:{ desc:"\u63D2\u5165\u65B0\u8868\u683C", row_before_desc:"\u63D2\u5165\u4E0A\u65B9\u5217", row_after_desc:"\u63D2\u5165\u4E0B\u65B9\u5217", delete_row_desc:"\u522A\u9664\u6240\u5728\u5217", col_before_desc:"\u63D2\u5165\u5DE6\u65B9\u6B04", col_after_desc:"\u63D2\u5165\u53F3\u65B9\u6B04", delete_col_desc:"\u522A\u9664\u6240\u5728\u6B04", split_cells_desc:"\u5206\u5272\u5132\u5B58\u683C", merge_cells_desc:"\u5408\u4F75\u5132\u5B58\u683C", row_desc:"\u5217\u5C6C\u6027", cell_desc:"\u5132\u5B58\u683C\u5C6C\u6027", props_desc:"\u8868\u683C\u5C6C\u6027", paste_row_before_desc:"\u8CBC\u5728\u4E0A\u65B9\u5217", paste_row_after_desc:"\u8CBC\u5728\u4E0B\u65B9\u5217", cut_row_desc:"\u526A\u4E0B\u9078\u64C7\u5217", copy_row_desc:"\u8907\u88FD\u9078\u64C7\u5217", del:"\u522A\u9664\u8868\u683C", row:"\u5217", col:"\u6B04", cell:"\u5132\u5B58\u683C", cellprops_delta_width:"10", cellprops_delta_height:"10", table_delta_width:"40", table_delta_height:"60", merge_cells_delta_width:"40", merge_cells_delta_height:"40" }, autosave:{ unload_msg:"\u5982\u679C\u96E2\u958B\u6B64\u9801\u9762\u5C07\u5C0E\u81F4\u6240\u505A\u7684\u66F4\u6539\u5168\u90E8\u4E1F\u5931\u3002" }, fullscreen:{ desc:"\u958B\u95DC\u5168\u87A2\u5E55\u6A21\u5F0F" }, media:{ desc:"\u63D2\u5165/\u7DE8\u8F2F\u5D4C\u5165\u5A92\u9AD4", edit:"\u7DE8\u8F2F\u5D4C\u5165\u5A92\u9AD4" }, fullpage:{ desc:"\u5C6C\u6027" }, template:{ desc:"\u63D2\u5165\u9810\u5B9A\u7684\u7BC4\u672C\u5167\u5BB9" }, visualchars:{ desc:"\u986F\u793A\u63A7\u5236\u7B26\u865F\u958B/\u95DC\u3002" }, spellchecker:{ desc:"\u958B\u95DC\u62FC\u5BEB\u6AA2\u67E5", menu:"\u62FC\u5BEB\u6AA2\u67E5\u8A2D\u7F6E", ignore_word:"\u7565\u904E", ignore_words:"\u5168\u90E8\u7565\u904E", langs:"\u8A9E\u8A00", wait:"\u8ACB\u7A0D\u5019...", sug:"\u63A8\u85A6\u5B57\u8A5E", no_sug:"\u7121\u62FC\u5BEB\u63A8\u85A6", no_mpell:"\u672A\u767C\u73FE\u62FC\u5BEB\u932F\u8AA4" }, pagebreak:{ desc:"\u63D2\u5165\u5206\u9801\u7B26\u865F" }}});��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/uk.js���������������������������������������������������������0000664�0000000�0000000�00000031374�12266004471�0020267�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({uk:{ common:{ edit_confirm:"\u0412\u0438 \u0431\u0430\u0436\u0430\u0454\u0442\u0435 \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0432\u0430\u0442\u0438 WYSIWYG \u0440\u0435\u0436\u0438\u043C \u0434\u043B\u044F \u0446\u044C\u043E\u0433\u043E \u043F\u043E\u043B\u044F?", apply:"\u0417\u0430\u0441\u0442\u043E\u0441\u0443\u0432\u0430\u0442\u0438", insert:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438", update:"\u041E\u043D\u043E\u0432\u0438\u0442\u0438", cancel:"\u0412\u0456\u0434\u043C\u0456\u043D\u0438\u0442\u0438", close:"\u0417\u0430\u043A\u0440\u0438\u0442\u0438", browse:"\u041F\u0435\u0440\u0435\u0433\u043B\u044F\u0434", class_name:"\u041A\u043B\u0430\u0441", not_set:"-- \u043D\u0435 \u0432\u0438\u0431\u0440\u0430\u043D\u043E --", clipboard_msg:"\u041A\u043E\u043F\u0456\u044E\u0432\u0430\u0442\u0438/\u0412\u0438\u0440\u0456\u0437\u0430\u0442\u0438/\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438 \u043D\u0435 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E \u0432 Mozilla \u0442\u0430 Firefox.\n\u0412\u0430\u043C \u0446\u0456\u043A\u0430\u0432\u0430 \u0456\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0456\u044F \u043F\u0440\u043E \u0446\u0435?", clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.", popup_blocked:"\u0414\u0443\u0436\u0435 \u043F\u0440\u0438\u043A\u0440\u043E, \u0430\u043B\u0435 \u0432\u0430\u0448 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0437\u0430\u0431\u043B\u043E\u043A\u0443\u0432\u0430\u0432 \u0432\u0438\u0440\u0438\u043D\u0430\u044E\u0447\u0435 \u0432\u0456\u043A\u043D\u043E. \u0411\u0443\u0434\u044C \u043B\u0430\u0441\u043A\u0430, \u043D\u0430\u043B\u0430\u0448\u0442\u0443\u0439\u0442\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0442\u0430\u043A, \u0449\u043E\u0431 \u0432\u0456\u043D \u0434\u043E\u0437\u0432\u043E\u043B\u044F\u0432 \u0432\u0438\u0440\u0438\u043D\u0430\u044E\u0447\u0456 \u0432\u0456\u043A\u043D\u0430 \u0437 \u0446\u044C\u043E\u0433\u043E \u0441\u0430\u0439\u0442\u0443.", invalid_data:"\u041F\u043E\u043C\u0438\u043B\u043A\u0430: \u0412\u0432\u0435\u0434\u0435\u043D\u043E \u043F\u043E\u043C\u0438\u043B\u043A\u043E\u0432\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F, \u0432\u0456\u0434\u043C\u0456\u0447\u0435\u043D\u0435 \u0447\u0435\u0440\u0432\u043E\u043D\u0438\u043C.", more_colors:"\u0411\u0456\u043B\u044C\u0448\u0435 \u043A\u043E\u043B\u044C\u043E\u0440\u0456\u0432" }, contextmenu:{ align:"\u0412\u0438\u0440\u0456\u0432\u043D\u044E\u0432\u0430\u043D\u043D\u044F", left:"\u041F\u043E \u043B\u0456\u0432\u043E\u043C\u0443 \u043A\u0440\u0430\u044E", center:"\u041F\u043E \u0446\u0435\u043D\u0442\u0440\u0443", right:"\u041F\u043E \u043F\u0440\u0430\u0432\u043E\u043C\u0443 \u043A\u0440\u0430\u044E", full:"\u041F\u043E \u0448\u0438\u0440\u0438\u043D\u0456" }, insertdatetime:{ date_fmt:"%d.%m.%Y", time_fmt:"%H:%M:%S", insertdate_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438 \u0434\u0430\u0442\u0443", inserttime_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438 \u0447\u0430\u0441", months_long:"\u0421\u0456\u0447\u0435\u043D\u044C,\u041B\u044E\u0442\u0438\u0439,\u0411\u0435\u0440\u0435\u0437\u0435\u043D\u044C,\u041A\u0432\u0456\u0442\u0435\u043D\u044C,\u0422\u0440\u0430\u0432\u0435\u043D\u044C,\u0427\u0435\u0440\u0432\u0435\u043D\u044C,\u041B\u0438\u043F\u0435\u043D\u044C,\u0421\u0435\u0440\u043F\u0435\u043D\u044C,\u0412\u0435\u0440\u0435\u0441\u0435\u043D\u044C,\u0416\u043E\u0432\u0442\u0435\u043D\u044C,\u041B\u0438\u0441\u0442\u043E\u043F\u0430\u0434,\u0413\u0440\u0443\u0434\u0435\u043D\u044C", months_short:"\u0421\u0456\u0447,\u041B\u044E\u0442,\u0411\u0435\u0440,\u041A\u0432\u0456,\u0422\u0440\u0430,\u0427\u0435\u0440,\u041B\u0438\u043F,\u0421\u0435\u0440,\u0412\u0435\u0440,\u0416\u043E\u0432,\u041B\u0438\u0441,\u0413\u0440\u0443", day_long:"\u041D\u0435\u0434\u0456\u043B\u044F,\u041F\u043E\u043D\u0435\u0434\u0456\u043B\u043E\u043A,\u0412\u0456\u0432\u0442\u043E\u0440\u043E\u043A,\u0421\u0435\u0440\u0435\u0434\u0430,\u0427\u0435\u0442\u0432\u0435\u0440,\u041F'\u044F\u0442\u043D\u0438\u0446\u044F,\u0421\u0443\u0431\u043E\u0442\u0430,\u041D\u0435\u0434\u0456\u043B\u044F", day_short:"\u041D\u0434,\u041F\u043D,\u0412\u0442,\u0421\u0440,\u0427\u0442,\u041F\u0442,\u0421\u0431,\u041D\u0434" }, print:{ print_desc:"\u0414\u0440\u0443\u043A" }, preview:{ preview_desc:"\u041F\u0435\u0440\u0435\u0433\u043B\u044F\u0434" }, directionality:{ ltr_desc:"\u041D\u0430\u043F\u0440\u044F\u043C \u0437\u043B\u0456\u0432\u0430 \u043F\u0440\u0430\u0432\u043E\u0440\u0443\u0447", rtl_desc:"\u041D\u0430\u043F\u0440\u044F\u043C \u0441\u043F\u0440\u0430\u0432\u0430 \u043B\u0456\u0432\u043E\u0440\u0443\u0447" }, layer:{ insertlayer_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438 \u043D\u043E\u0432\u0438\u0439 \u0441\u043B\u043E\u0439", forward_desc:"\u041F\u0435\u0440\u0435\u043C\u0456\u0441\u0442\u0438\u0442\u0438 \u0432\u0433\u043E\u0440\u0443", backward_desc:"\u041F\u0435\u0440\u0435\u043C\u0456\u0441\u0442\u0438\u0442\u0438 \u043D\u0430\u0437\u0430\u0434", absolute_desc:"Toggle absolute positioning", content:"\u041D\u043E\u0432\u0438\u0439 \u0441\u043B\u043E\u0439..." }, save:{ save_desc:"\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438", cancel_desc:"\u0412\u0456\u0434\u043C\u0456\u043D\u0438\u0442\u0438 \u0432\u0441\u0456 \u0437\u043C\u0456\u043D\u0438" }, nonbreaking:{ nonbreaking_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438 \u043D\u0435\u0440\u043E\u0437\u0440\u0438\u0432\u043D\u0438\u0439 \u043F\u0440\u043E\u0431\u0456\u043B" }, iespell:{ iespell_desc:"\u0417\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u0438 \u043E\u0440\u0444\u043E\u0433\u0440\u0430\u0444\u0456\u044E", download:"ieSpell \u043D\u0435 \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E. \u0411\u0430\u0436\u0430\u0454\u0442\u0435 \u043F\u0440\u043E\u0456\u043D\u0441\u0442\u0430\u043B\u044E\u0432\u0430\u0442\u0438?" }, advhr:{ advhr_desc:"\u0413\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u0438\u0439 \u0440\u043E\u0437\u0434\u0456\u043B\u044C\u043D\u0438\u043A" }, emotions:{ emotions_desc:"\u0421\u043C\u0430\u0439\u043B\u0438" }, searchreplace:{ search_desc:"\u0417\u043D\u0430\u0439\u0442\u0438", replace_desc:"\u0417\u043D\u0430\u0439\u0442\u0438/\u0417\u0430\u043C\u0456\u043D\u0438\u0442\u0438" }, advimage:{ image_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438/\u0437\u043C\u0456\u043D\u0438\u0442\u0438 \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F", delta_width:"200" }, advlink:{ link_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438/\u0437\u043C\u0456\u043D\u0438\u0442\u0438 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F", delta_width:"200" }, xhtmlxtras:{ cite_desc:"\u0426\u0438\u0442\u0430\u0442\u0430", abbr_desc:"\u0410\u043A\u0440\u043E\u043D\u0456\u043C", acronym_desc:"Acronym", del_desc:"\u0412\u0438\u0434\u0430\u043B\u0435\u043D\u043D\u044F", ins_desc:"\u0412\u0441\u0442\u0430\u0432\u043A\u0430", attribs_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438/\u0437\u043C\u0456\u043D\u0438\u0442\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0438" }, style:{ desc:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 CSS \u0441\u0442\u0438\u043B\u044C" }, paste:{ paste_text_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438 \u044F\u043A \u0442\u0435\u043A\u0441\u0442", paste_word_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438 \u0437 Word", selectall_desc:"\u0412\u0438\u0434\u0456\u043B\u0438\u0442\u0438 \u0432\u0441\u0435" }, paste_dlg:{ text_title:"\u0412\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0439\u0442\u0435 CTRL+V \u0434\u043B\u044F \u0432\u0441\u0442\u0430\u0432\u043A\u0438 \u0442\u0435\u043A\u0441\u0442\u0443 \u0443 \u0432\u0456\u043A\u043D\u043E.", text_linebreaks:"\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438 \u043F\u0435\u0440\u0435\u043D\u043E\u0441\u044B \u0441\u0442\u0440\u043E\u043A", word_title:"\u0412\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0439\u0442\u0435 CTRL+V \u0434\u043B\u044F \u0432\u0441\u0442\u0430\u0432\u043A\u0438 \u0442\u0435\u043A\u0441\u0442\u0443 \u0443 \u0432\u0456\u043A\u043D\u043E." }, table:{ desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438 \u043D\u043E\u0432\u0443 \u0442\u0430\u0431\u043B\u0438\u0446\u044E", row_before_desc:"\u0414\u043E\u0434\u0430\u0442\u0438 \u0440\u044F\u0434\u043E\u043A \u0434\u043E", row_after_desc:"\u0414\u043E\u0434\u0430\u0442\u0438 \u0440\u044F\u0434\u043E\u043A \u043F\u0456\u0441\u043B\u044F", delete_row_desc:"\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0440\u044F\u0434\u043E\u043A", col_before_desc:"\u0414\u043E\u0434\u0430\u0442\u0438 \u0441\u0442\u043E\u0432\u0431\u0435\u0446\u044C \u0434\u043E", col_after_desc:"\u0414\u043E\u0434\u0430\u0442\u0438 \u0441\u0442\u043E\u0432\u0431\u0435\u0446\u044C \u043F\u0456\u0441\u043B\u044F", delete_col_desc:"\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0441\u0442\u043E\u0432\u0431\u0435\u0446\u044C", split_cells_desc:"\u0420\u043E\u0437\u0434\u0456\u043B\u0438\u0442\u0438 \u043A\u043E\u043C\u0456\u0440\u043A\u0438", merge_cells_desc:"\u041E\u0431'\u0454\u0434\u043D\u0430\u0442\u0438 \u043A\u043E\u043C\u0456\u0440\u043A\u0438", row_desc:"\u0412\u043B\u0430\u0441\u0442\u0438\u0432\u043E\u0441\u0442\u0456 \u0440\u044F\u0434\u043A\u0443 \u0442\u0430\u0431\u043B\u0438\u0446\u0456", cell_desc:"\u0412\u043B\u0430\u0441\u0442\u0438\u0432\u043E\u0441\u0442\u0456 \u043A\u043E\u043C\u0456\u0440\u043A\u0438 \u0442\u0430\u0431\u043B\u0438\u0446\u0456", props_desc:"\u0412\u043B\u0430\u0441\u0442\u0438\u0432\u043E\u0441\u0442\u0456 \u0442\u0430\u0431\u043B\u0438\u0446\u0456", paste_row_before_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438 \u0440\u044F\u0434\u043E\u043A \u0434\u043E", paste_row_after_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438 \u0440\u044F\u0434\u043E\u043A \u043F\u0456\u0441\u043B\u044F", cut_row_desc:"\u0412\u0438\u0440\u0456\u0437\u0430\u0442\u0438 \u0440\u044F\u0434\u043E\u043A \u0442\u0430\u0431\u043B\u0438\u0446\u0456", copy_row_desc:"\u041A\u043E\u043F\u0456\u044E\u0432\u0430\u0442\u0438 \u0440\u044F\u0434\u043E\u043A \u0442\u0430\u0431\u043B\u0438\u0446\u0456", del:"\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0442\u0430\u0431\u043B\u0438\u0446\u044E", row:"\u0420\u044F\u0434\u043E\u043A", col:"\u0421\u0442\u043E\u0432\u0431\u0435\u0446\u044C", cell:"\u041A\u043E\u043C\u0456\u0440\u043A\u0430", cellprops_delta_width:"30" }, autosave:{ unload_msg:"\u0417\u043C\u0456\u043D\u0438, \u044F\u043A\u0456 \u0432\u0438 \u0437\u0440\u043E\u0431\u0438\u043B\u0438, \u0431\u0443\u0434\u0443\u0442\u044C \u0432\u0442\u0440\u0430\u0447\u0435\u043D\u0456, \u044F\u043A\u0449\u043E \u0432\u0438 \u043F\u0435\u0440\u0435\u0439\u0434\u0435\u0442\u0435 \u0437 \u0446\u0456\u0454\u0457 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438." }, fullscreen:{ desc:"\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u0438\u0441\u044F \u043D\u0430 \u0432\u0435\u0441\u044C \u0435\u043A\u0440\u0430\u043D" }, media:{ desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438 / \u0440\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 \u0432\u0431\u0443\u0434\u043E\u0432\u0430\u043D\u0456 \u043C\u0435\u0434\u0456\u044F", edit:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 \u0432\u0431\u0443\u0434\u043E\u0432\u0430\u043D\u0456 \u043C\u0435\u0434\u0456\u044F" }, fullpage:{ desc:"\u0412\u043B\u0430\u0441\u0442\u0438\u0432\u043E\u0441\u0442\u0456 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430" }, template:{ desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u043D\u0438\u0439 \u043A\u043E\u043D\u0442\u0435\u043D\u0442" }, visualchars:{ desc:"Visual control characters on/off." }, spellchecker:{ desc:"\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u0438 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0443", menu:"\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0438", ignore_word:"\u0406\u0433\u043D\u043E\u0440\u0443\u0432\u0430\u0442\u0438 \u0441\u043B\u043E\u0432\u043E", ignore_words:"\u0406\u0433\u043D\u043E\u0440\u0443\u0432\u0430\u0442\u0438 \u0432\u0441\u0435", langs:"\u041C\u043E\u0432\u0438", wait:"\u0411\u0443\u0434\u044C \u043B\u0430\u0441\u043A\u0430 \u0437\u0430\u0447\u0435\u043A\u0430\u0439\u0442\u0435...", sug:"\u0412\u0430\u0440\u0456\u0430\u043D\u0442\u0438", no_sug:"\u041D\u0435\u043C\u0430\u0454 \u0432\u0430\u0440\u0456\u0430\u043D\u0442\u0456\u0432", no_mpell:"\u041F\u043E\u043C\u0438\u043B\u043E\u043A \u043D\u0435 \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E." }, pagebreak:{ desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438 \u0440\u043E\u0437\u0434\u0456\u043B\u044C\u043D\u0438\u043A \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438." }}});��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/ur.js���������������������������������������������������������0000664�0000000�0000000�00000011303�12266004471�0020264�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({ur:{ common:{ edit_confirm:"\u06A9\u06CC\u0627 \u0627\u0653\u067E \u0627\u0633 \u0679\u06CC\u06A9\u0633\u0679 \u0627\u06CC\u0631\u06CC\u0627 \u06A9\u06CC\u0644\u0626\u06D2 \u0648\u0632\u06CC \u0648\u06AF \u0645\u0648\u0688 \u0627\u0633\u062A\u0639\u0645\u0627\u0644 \u06A9\u0631\u0646\u0627 \u0686\u0627\u06C1\u062A\u06D2 \u06C1\u06CC\u06BA\u061F", apply:"\u0627\u067E\u0644\u0627\u0626\u06CC", insert:"\u062F\u0627\u062E\u0644 \u06A9\u0631\u06CC\u06BA", update:"\u0627\u067E \u0688\u06CC\u0679", cancel:"\u06A9\u06CC\u0646\u0633\u0644", close:"\u0628\u0646\u062F", browse:"\u0628\u0631\u0627\u0624\u0632", class_name:"\u06A9\u0644\u0627\u0633", not_set:"-- \u0646\u0627\u0679 \u0633\u06CC\u0679 --", clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?", clipboard_no_support:"\u0627\u0653\u067E \u06A9\u06D2 \u0628\u0631\u0627\u0624\u0632\u0631 \u0645\u06CC\u06BA \u06CC\u06C1 \u0633\u06C1\u0648\u0644\u062A \u0645\u06CC\u0633\u0631 \u0646\u06C1\u06CC\u06BA\u06D4 \u06A9\u06CC \u0628\u0648\u0631\u0688 \u0634\u0627\u0631\u0679 \u06A9\u0679 \u0645\u0646\u062A\u062E\u0628 \u06A9\u0631\u06CC\u06BA", popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.", invalid_data:"Error: Invalid values entered, these are marked in red.", more_colors:"More colors" }, contextmenu:{ align:"Alignment", left:"Left", center:"Center", right:"Right", full:"Full" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"Insert date", inserttime_desc:"Insert time", months_long:"January,February,March,April,May,June,July,August,September,October,November,December", months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun" }, print:{ print_desc:"Print" }, preview:{ preview_desc:"Preview" }, directionality:{ ltr_desc:"Direction left to right", rtl_desc:"Direction right to left" }, layer:{ insertlayer_desc:"Insert new layer", forward_desc:"Move forward", backward_desc:"Move backward", absolute_desc:"Toggle absolute positioning", content:"New layer..." }, save:{ save_desc:"Save", cancel_desc:"Cancel all changes" }, nonbreaking:{ nonbreaking_desc:"Insert non-breaking space character" }, iespell:{ iespell_desc:"Run spell checking", download:"ieSpell not detected. Do you want to install it now?" }, advhr:{ advhr_desc:"Horizontal rule" }, emotions:{ emotions_desc:"Emotions" }, searchreplace:{ search_desc:"Find", replace_desc:"Find/Replace" }, advimage:{ image_desc:"Insert/edit image" }, advlink:{ link_desc:"Insert/edit link" }, xhtmlxtras:{ cite_desc:"Citation", abbr_desc:"Abbreviation", acronym_desc:"Acronym", del_desc:"Deletion", ins_desc:"Insertion", attribs_desc:"Insert/Edit Attributes" }, style:{ desc:"Edit CSS Style" }, paste:{ paste_text_desc:"Paste as Plain Text", paste_word_desc:"Paste from Word", selectall_desc:"Select All" }, paste_dlg:{ text_title:"Use CTRL+V on your keyboard to paste the text into the window.", text_linebreaks:"Keep linebreaks", word_title:"Use CTRL+V on your keyboard to paste the text into the window." }, table:{ desc:"Inserts a new table", row_before_desc:"Insert row before", row_after_desc:"Insert row after", delete_row_desc:"Delete row", col_before_desc:"Insert column before", col_after_desc:"Insert column after", delete_col_desc:"Remove column", split_cells_desc:"Split merged table cells", merge_cells_desc:"Merge table cells", row_desc:"Table row properties", cell_desc:"Table cell properties", props_desc:"Table properties", paste_row_before_desc:"Paste table row before", paste_row_after_desc:"Paste table row after", cut_row_desc:"Cut table row", copy_row_desc:"Copy table row", del:"Delete table", row:"Row", col:"Column", cell:"Cell" }, autosave:{ unload_msg:"The changes you made will be lost if you navigate away from this page." }, fullscreen:{ desc:"Toggle fullscreen mode" }, media:{ desc:"Insert / edit embedded media", edit:"Edit embedded media" }, fullpage:{ desc:"Document properties" }, template:{ desc:"Insert predefined template content" }, visualchars:{ desc:"Visual control characters on/off." }, spellchecker:{ desc:"Toggle spellchecker", menu:"Spellchecker settings", ignore_word:"Ignore word", ignore_words:"Ignore all", langs:"Languages", wait:"Please wait...", sug:"Suggestions", no_sug:"No suggestions", no_mpell:"No misspellings found." }, pagebreak:{ desc:"Insert page break." }}});�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/vi.js���������������������������������������������������������0000664�0000000�0000000�00000010715�12266004471�0020262�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({vi:{ common:{ edit_confirm:"B\u1EA1n c\u00F3 mu\u1ED1n s\u1EED d\u1EE5ng ch\u1EBF \u0111\u1ED9 WYSIWYG cho textarea n\u00E0y?", apply:"Thay \u0111\u1ED5i", insert:"Th\u00EAm", update:"C\u1EADp nh\u1EADt", cancel:"H\u1EE7y b\u1ECF", close:"Tho\u00E1t", browse:"T\u00ECm", class_name:"L\u1EDBp", not_set:"-- Ch\u01B0a \u0111\u1EB7t --", clipboard_msg:"Copy/Cut/Paste kh\u00F4ng \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3 trong tr\u00ECnh duy\u1EC7t web n\u00E0y.\nB\u1EA1n c\u00F3 mu\u1ED1n bi\u1EBFt th\u00EAm th\u00F4ng tin v\u1EC1 v\u1EA5n \u0111\u1EC1 n\u00E0y kh\u00F4ng??", clipboard_no_support:"S\u1EED d\u1EE5ng ph\u00EDm t\u1EAFt kh\u00F4ng \u0111\u01B0\u1EE3c s\u1EED d\u1EE5ng trong tr\u00ECnh duy\u1EC7t hi\u1EC7n t\u1EA1i.", popup_blocked:"Xin l\u1ED7i, Nh\u01B0ng ch\u1EBF \u0111\u1ED9 c\u1EEDa s\u1ED5 popup \u0111\u00E3 b\u1ECB v\u00F4 hi\u1EC7u ho\u00E1. B\u1EA1n s\u1EBD c\u1EA7n ph\u1EA3i t\u1EAFt ch\u1EE9c n\u0103ng ch\u1EB7n popup tr\u00EAn trang web n\u00E0y \u0111\u1EC3 s\u1EED d\u1EE5ng c\u00F4ng c\u1EE5 n\u00E0y ho\u00E0n to\u00E0n.", invalid_data:"L\u1ED7i: Gi\u00E1 tr\u1ECB nh\u1EADp v\u00E0o kh\u00F4ng h\u1EE3p l\u1EC7. (\u0110\u01B0\u1EE3c \u0111\u00E1nh d\u1EA5u \u0111\u1ECF)", more_colors:"M\u00E0u kh\u00E1c" }, contextmenu:{ align:"Alignment", left:"Left", center:"Center", right:"Right", full:"Full" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"Insert date", inserttime_desc:"Insert time", months_long:"January,February,March,April,May,June,July,August,September,October,November,December", months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun" }, print:{ print_desc:"Print" }, preview:{ preview_desc:"Preview" }, directionality:{ ltr_desc:"Direction left to right", rtl_desc:"Direction right to left" }, layer:{ insertlayer_desc:"Insert new layer", forward_desc:"Move forward", backward_desc:"Move backward", absolute_desc:"Toggle absolute positioning", content:"New layer..." }, save:{ save_desc:"Save", cancel_desc:"Cancel all changes" }, nonbreaking:{ nonbreaking_desc:"Insert non-breaking space character" }, iespell:{ iespell_desc:"Run spell checking", download:"ieSpell not detected. Do you want to install it now?" }, advhr:{ advhr_desc:"Horizontal rule" }, emotions:{ emotions_desc:"Emotions" }, searchreplace:{ search_desc:"Find", replace_desc:"Find/Replace" }, advimage:{ image_desc:"Insert/edit image" }, advlink:{ link_desc:"Insert/edit link" }, xhtmlxtras:{ cite_desc:"Citation", abbr_desc:"Abbreviation", acronym_desc:"Acronym", del_desc:"Deletion", ins_desc:"Insertion", attribs_desc:"Insert/Edit Attributes" }, style:{ desc:"Edit CSS Style" }, paste:{ paste_text_desc:"Paste as Plain Text", paste_word_desc:"Paste from Word", selectall_desc:"Select All" }, paste_dlg:{ text_title:"Use CTRL+V on your keyboard to paste the text into the window.", text_linebreaks:"Keep linebreaks", word_title:"Use CTRL+V on your keyboard to paste the text into the window." }, table:{ desc:"Inserts a new table", row_before_desc:"Insert row before", row_after_desc:"Insert row after", delete_row_desc:"Delete row", col_before_desc:"Insert column before", col_after_desc:"Insert column after", delete_col_desc:"Remove column", split_cells_desc:"Split merged table cells", merge_cells_desc:"Merge table cells", row_desc:"Table row properties", cell_desc:"Table cell properties", props_desc:"Table properties", paste_row_before_desc:"Paste table row before", paste_row_after_desc:"Paste table row after", cut_row_desc:"Cut table row", copy_row_desc:"Copy table row", del:"Delete table", row:"Row", col:"Column", cell:"Cell" }, autosave:{ unload_msg:"The changes you made will be lost if you navigate away from this page." }, fullscreen:{ desc:"Toggle fullscreen mode" }, media:{ desc:"Insert / edit embedded media", edit:"Edit embedded media" }, fullpage:{ desc:"Document properties" }, template:{ desc:"Insert predefined template content" }, visualchars:{ desc:"Visual control characters on/off." }, spellchecker:{ desc:"Toggle spellchecker", menu:"Spellchecker settings", ignore_word:"Ignore word", ignore_words:"Ignore all", langs:"Languages", wait:"Please wait...", sug:"Suggestions", no_sug:"No suggestions", no_mpell:"No misspellings found." }, pagebreak:{ desc:"Insert page break." }}});���������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/zh.js���������������������������������������������������������0000664�0000000�0000000�00000013520�12266004471�0020262�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({zh:{ common:{ edit_confirm:"\u662F\u5426\u5728\u6B64textarea\u6A19\u7C64\u5167\u4F7F\u7528\u300C\u6240\u898B\u5373\u6240\u5F97\u300D\u6A21\u5F0F\uFF1F", apply:"\u61C9\u7528", insert:"\u63D2\u5165", update:"\u66F4\u65B0", cancel:"\u53D6\u6D88", close:"\u95DC\u9589", browse:"\u700F\u89BD", class_name:"\u6A23\u5F0F", not_set:"--\u672A\u8A2D\u7F6E--", clipboard_msg:"\u8907\u88FD\u3001\u526A\u4E0B\u3001\u8CBC\u4E0A\u529F\u80FD\u5728Mozilla\u548CFirefox\u4E2D\u4E0D\u80FD\u4F7F\u7528\u3002 \n\u662F\u5426\u9700\u8981\u77AD\u89E3\u66F4\u591A\u6709\u95DC\u6B64\u554F\u984C\u7684\u4FE1\u606F\uFF1F", clipboard_no_support:"\u9084\u4E0D\u652F\u6301\u60A8\u7684\u700F\u89BD\u5668\uFF0C\u8ACB\u4F7F\u7528\u9375\u76E4\u5FEB\u6377\u65B9\u5F0F", popup_blocked:"\u62B1\u6B49\uFF01\u5F48\u51FA\u7A97\u53E3\u5DF2\u88AB\u963B\u6B62\uFF0C\u8ACB\u8ABF\u6574\u700F\u89BD\u5668\u8A2D\u7F6E\uFF0C\u5141\u8A31\u6B64\u7DB2\u7AD9\u53EF\u5F48\u51FA\u65B0\u7A97\u53E3\uFF0C\u4EE5\u4FBF\u4F7F\u7528\u6B64\u5DE5\u5177", invalid_data:"\u932F\u8AA4:\u7121\u6548\u8F38\u5165\u503C\uFF0C\u5DF2\u6A19\u8A18\u70BA\u7D05\u8272\u3002", more_colors:"\u66F4\u591A\u984F\u8272" }, contextmenu:{ align:"\u5C0D\u9F4A\u65B9\u5F0F", left:"\u9760\u5DE6\u5C0D\u9F4A", center:"\u7F6E\u4E2D\u5C0D\u9F4A", right:"\u9760\u53F3\u5C0D\u9F4A", full:"\u5DE6\u53F3\u5C0D\u9F4A" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"\u63D2\u5165\u4ECA\u5929\u65E5\u671F", inserttime_desc:"\u63D2\u5165\u73FE\u5728\u6642\u9593", months_long:"\u4E00\u6708,\u4E8C\u6708,\u4E09\u6708,\u56DB\u6708,\u4E94\u6708,\u516D\u6708,\u4E03\u6708,\u516B\u6708,\u4E5D\u6708,\u5341\u6708,\u5341\u4E00\u6708,\u5341\u4E8C\u6708", months_short:"1,2,3,4,5,6,7,8,9,10,11,12", day_long:"\u661F\u671F\u65E5,\u661F\u671F\u4E00,\u661F\u671F\u4E8C,\u661F\u671F\u4E09,\u661F\u671F\u56DB,\u661F\u671F\u4E94,\u661F\u671F\u516D,\u661F\u671F\u65E5", day_short:"\u9031\u65E5,\u9031\u4E00,\u9031\u4E8C,\u9031\u4E09,\u9031\u56DB,\u9031\u4E94,\u9031\u516D,\u9031\u65E5" }, print:{ print_desc:"\u6253\u5370" }, preview:{ preview_desc:"\u9810\u89BD" }, directionality:{ ltr_desc:"\u6587\u5B57\u5F9E\u5DE6\u5230\u53F3", rtl_desc:"\u6587\u5B57\u5F9E\u53F3\u5230\u5DE6" }, layer:{ insertlayer_desc:"\u63D2\u5165\u5C64", forward_desc:"\u4E0A\u79FB\u4E00\u5C64", backward_desc:"\u4E0B\u79FB\u4E00\u5C64", absolute_desc:"\u958B\u95DC\u7D55\u5C0D\u4F4D\u7F6E", content:"\u65B0\u589E\u5C64..." }, save:{ save_desc:"\u4FDD\u5B58", cancel_desc:"\u53D6\u6D88\u6240\u6709\u66F4\u6539" }, nonbreaking:{ nonbreaking_desc:"\u63D2\u5165\u4E0D\u65B7\u884C\u7A7A\u767D" }, iespell:{ iespell_desc:"\u62FC\u5B57\u6AA2\u67E5", download:"\u672A\u6AA2\u6E2C\u5230ieSpell\u7684\u5B58\u5728\u3002\u662F\u5426\u73FE\u5728\u7ACB\u5373\u5B89\u88DD\uFF1F" }, advhr:{ advhr_desc:"\u6C34\u5E73\u7DDA" }, emotions:{ emotions_desc:"\u5716\u793A" }, searchreplace:{ search_desc:"\u67E5\u627E", replace_desc:"\u67E5\u627E/\u66FF\u63DB" }, advimage:{ image_desc:"\u63D2\u5165/\u7DE8\u8F2F\u5716\u7247" }, advlink:{ link_desc:"\u63D2\u5165/\u7DE8\u8F2F\u9023\u7D50" }, xhtmlxtras:{ cite_desc:"\u5F15\u6587", abbr_desc:"\u7E2E\u5BEB", acronym_desc:"\u9996\u5B57\u7E2E\u5BEB", del_desc:"\u522A\u9664", ins_desc:"\u63D2\u5165", attribs_desc:"\u63D2\u5165/\u7DE8\u8F2F\u5C6C\u6027", attribs_delta_width:"40", attribs_delta_height:"60" }, style:{ desc:"\u7DE8\u8F2FCSS\u6A23\u5F0F\u8868\u55AE" }, paste:{ paste_text_desc:"\u7D14\u6587\u672C\u7C98\u8CBC", paste_word_desc:"\u5F9EWord\u7C98\u8CBC", selectall_desc:"\u5168\u9078" }, paste_dlg:{ text_title:"\u5728\u9375\u76E4\u4E0A\u540C\u6642\u6309\u4E0BCTRL\u548CV\u9375\uFF0C\u4EE5\u8CBC\u4E0A\u6587\u5B57\u5230\u6B64\u7A97\u53E3\u3002", text_linebreaks:"\u4FDD\u7559\u63DB\u884C\u7B26", word_title:"\u5728\u9375\u76E4\u4E0A\u540C\u6642\u6309\u4E0BCTRL\u548CV\u9375\uFF0C\u4EE5\u8CBC\u4E0A\u6587\u5B57\u5230\u6B64\u7A97\u53E3\u3002" }, table:{ desc:"\u63D2\u5165\u65B0\u8868\u683C", row_before_desc:"\u63D2\u5165\u4E0A\u65B9\u884C", row_after_desc:"\u63D2\u5165\u4E0B\u65B9\u884C", delete_row_desc:"\u522A\u9664\u6240\u5728\u884C", col_before_desc:"\u63D2\u5165\u5DE6\u65B9\u5217", col_after_desc:"\u63D2\u5165\u53F3\u65B9\u5217", delete_col_desc:"\u522A\u9664\u6240\u5728\u5217", split_cells_desc:"\u5206\u5272\u55AE\u5143\u683C", merge_cells_desc:"\u5408\u4F75\u55AE\u5143\u683C", row_desc:"\u884C\u5C6C\u6027", cell_desc:"\u55AE\u5143\u683C\u5C6C\u6027", props_desc:"\u8868\u683C\u5C6C\u6027", paste_row_before_desc:"\u8CBC\u5728\u4E0A\u65B9\u884C", paste_row_after_desc:"\u8CBC\u5728\u4E0B\u65B9\u884C", cut_row_desc:"\u526A\u4E0B\u9078\u64C7\u884C", copy_row_desc:"\u8907\u88FD\u9078\u64C7\u884C", del:"\u522A\u9664\u8868\u683C", row:"\u884C", col:"\u5217", cell:"\u55AE\u5143\u683C", cellprops_delta_width:"10", cellprops_delta_height:"10", table_delta_width:"40", table_delta_height:"60", merge_cells_delta_width:"40", merge_cells_delta_height:"40" }, autosave:{ unload_msg:"\u5982\u679C\u96E2\u958B\u6B64\u9801\u9762\u5C07\u5C0E\u81F4\u6240\u505A\u7684\u66F4\u6539\u5168\u90E8\u4E1F\u5931\u3002" }, fullscreen:{ desc:"\u5168\u5C4F\u5E55\u6A21\u5F0F" }, media:{ desc:"\u63D2\u5165/\u7DE8\u8F2F\u5D4C\u5165\u5A92\u9AD4", edit:"\u7DE8\u8F2F\u5D4C\u5165\u5A92\u9AD4" }, fullpage:{ desc:"\u5C6C\u6027" }, template:{ desc:"\u63D2\u5165\u9810\u5B9A\u7684\u7BC4\u672C\u5167\u5BB9" }, visualchars:{ desc:"\u986F\u793A\u63A7\u5236\u7B26\u865F" }, spellchecker:{ desc:"\u62FC\u5BEB\u6AA2\u67E5", menu:"\u62FC\u5BEB\u6AA2\u67E5\u8A2D\u7F6E", ignore_word:"\u7565\u904E", ignore_words:"\u5168\u90E8\u7565\u904E", langs:"\u8A9E\u8A00", wait:"\u8ACB\u7A0D\u5019...", sug:"\u63A8\u85A6\u5B57\u8A5E", no_sug:"\u7121\u62FC\u5BEB\u63A8\u85A6", no_mpell:"\u672A\u767C\u73FE\u62FC\u5BEB\u932F\u8AA4" }, pagebreak:{ desc:"\u63D2\u5165\u5206\u9801\u7B26\u865F" }}});��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/langs/zu.js���������������������������������������������������������0000664�0000000�0000000�00000013604�12266004471�0020302�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n({zu:{ common:{ edit_confirm:"\u662F\u5426\u5728\u6B64textarea\u6807\u7B7E\u5185\u4F7F\u7528\"\u6240\u89C1\u5373\u6240\u5F97\"\u6A21\u5F0F\uFF1F", apply:"\u5E94\u7528", insert:"\u63D2\u5165", update:"\u66F4\u65B0", cancel:"\u53D6\u6D88", close:"\u5173\u95ED", browse:"\u6D4F\u89C8", class_name:"\u6837\u5F0F", not_set:"--\u672A\u8BBE\u7F6E--", clipboard_msg:"\u590D\u5236\u3001\u526A\u5207\u3001\u7C98\u8D34\u529F\u80FD\u5728Mozilla\u548CFirefox\u4E2D\u4E0D\u80FD\u4F7F\u7528\u3002 \n\u662F\u5426\u9700\u8981\u4E86\u89E3\u66F4\u591A\u6709\u5173\u6B64\u95EE\u9898\u7684\u4FE1\u606F\uFF1F", clipboard_no_support:"\u8FD8\u4E0D\u652F\u6301\u60A8\u7684\u6D4F\u89C8\u5668\uFF0C\u8BF7\u4F7F\u7528\u952E\u76D8\u5FEB\u901F\u952E", popup_blocked:"\u62B1\u6B49\uFF01\u5F39\u51FA\u7A97\u53E3\u5DF2\u88AB\u963B\u6B62\uFF0C\u8BF7\u8C03\u6574\u6D4F\u89C8\u5668\u8BBE\u7F6E\uFF0C\u5141\u8BB8\u6B64\u7F51\u7AD9\u53EF\u5F39\u51FA\u65B0\u7A97\u53E3\uFF0C\u4EE5\u4FBF\u4F7F\u7528\u6B64\u5DE5\u5177", invalid_data:"\u9519\u8BEF:\u65E0\u6548\u8F93\u5165\u503C\uFF0C\u5DF2\u6807\u8BB0\u4E3A\u7EA2\u8272\u3002", more_colors:"\u66F4\u591A\u989C\u8272" }, contextmenu:{ align:"\u5BF9\u9F50\u65B9\u5F0F", left:"\u9760\u5DE6\u5BF9\u9F50", center:"\u5C45\u4E2D\u5BF9\u9F50", right:"\u9760\u53F3\u5BF9\u9F50", full:"\u4E24\u7AEF\u5BF9\u9F50" }, insertdatetime:{ date_fmt:"%Y-%m-%d", time_fmt:"%H:%M:%S", insertdate_desc:"\u63D2\u5165\u4ECA\u5929\u65E5\u671F", inserttime_desc:"\u63D2\u5165\u73B0\u5728\u65F6\u95F4", months_long:"\u4E00\u6708,\u4E8C\u6708,\u4E09\u6708,\u56DB\u6708,\u4E94\u6708,\u516D\u6708,\u4E03\u6708,\u516B\u6708,\u4E5D\u6708,\u5341\u6708,\u5341\u4E00\u6708,\u5341\u4E8C\u6708", months_short:"1\u6708,2\u6708,3\u6708,4\u6708,5\u6708,6\u6708,7\u6708,8\u6708,9\u6708,10\u6708,11\u6708,12\u6708", day_long:"\u661F\u671F\u65E5,\u661F\u671F\u4E00,\u661F\u671F\u4E8C,\u661F\u671F\u4E09,\u661F\u671F\u56DB,\u661F\u671F\u4E94,\u661F\u671F\u516D,\u661F\u671F\u65E5", day_short:"\u5468\u65E5,\u5468\u4E00,\u5468\u4E8C,\u5468\u4E09,\u5468\u56DB,\u5468\u4E94,\u5468\u516D,\u5468\u65E5" }, print:{ print_desc:"\u6253\u5370" }, preview:{ preview_desc:"\u9884\u89C8" }, directionality:{ ltr_desc:"\u6587\u5B57\u4ECE\u5DE6\u5230\u53F3", rtl_desc:"\u6587\u5B57\u4ECE\u53F3\u5230\u5DE6" }, layer:{ insertlayer_desc:"\u63D2\u5165\u5C42", forward_desc:"\u7F6E\u524D", backward_desc:"\u7F6E\u540E", absolute_desc:"\u5F00\u5173\u7EDD\u5BF9\u4F4D\u7F6E", content:"\u65B0\u589E\u5C42..." }, save:{ save_desc:"\u4FDD\u5B58", cancel_desc:"\u53D6\u6D88\u6240\u6709\u66F4\u6539" }, nonbreaking:{ nonbreaking_desc:"\u63D2\u5165\u7A7A\u767D" }, iespell:{ iespell_desc:"\u62FC\u5199\u68C0\u67E5", download:"\u672A\u68C0\u6D4B\u5230ieSpell\u7684\u5B58\u5728\u3002\u662F\u5426\u73B0\u5728\u7ACB\u5373\u5B89\u88C5\uFF1F" }, advhr:{ advhr_desc:"\u6C34\u5E73\u7EBF" }, emotions:{ emotions_desc:"\u56FE\u91CA" }, searchreplace:{ search_desc:"\u67E5\u627E", replace_desc:"\u67E5\u627E/\u66FF\u6362" }, advimage:{ image_desc:"\u63D2\u5165/\u7F16\u8F91\u56FE\u7247" }, advlink:{ link_desc:"\u63D2\u5165/\u7F16\u8F91\u94FE\u63A5" }, xhtmlxtras:{ cite_desc:"\u5F15\u6587", abbr_desc:"\u7F29\u5199", acronym_desc:"\u9996\u5B57\u7F29\u5199", del_desc:"\u5220\u9664", ins_desc:"\u63D2\u5165", attribs_desc:"\u63D2\u5165/\u7F16\u8F91\u5C5E\u6027", attribs_delta_width:"40", attribs_delta_height:"60" }, style:{ desc:"\u7F16\u8F91CSS\u6837\u5F0F\u8868" }, paste:{ paste_text_desc:"\u4EE5\u7EAF\u6587\u5B57\u7C98\u8D34", paste_word_desc:"\u4ECEWord\u7C98\u8D34", selectall_desc:"\u5168\u9009" }, paste_dlg:{ text_title:"\u5728\u952E\u76D8\u4E0A\u540C\u65F6\u6309\u4E0BCTRL\u548CV\u952E\uFF0C\u4EE5\u7C98\u8D34\u6587\u5B57\u5230\u6B64\u7A97\u53E3\u3002", text_linebreaks:"\u4FDD\u7559\u5206\u884C\u7B26\u53F7\u53F7", word_title:"\u5728\u952E\u76D8\u4E0A\u540C\u65F6\u6309\u4E0BCTRL\u548CV\u952E\uFF0C\u4EE5\u7C98\u8D34\u6587\u5B57\u5230\u6B64\u7A97\u53E3\u3002" }, table:{ desc:"\u63D2\u5165\u65B0\u8868\u683C", row_before_desc:"\u63D2\u5165\u4E0A\u65B9\u884C", row_after_desc:"\u63D2\u5165\u4E0B\u65B9\u884C", delete_row_desc:"\u5220\u9664\u6240\u5728\u884C", col_before_desc:"\u63D2\u5165\u5DE6\u65B9\u5217", col_after_desc:"\u63D2\u5165\u53F3\u65B9\u5217", delete_col_desc:"\u5220\u9664\u6240\u5728\u5217", split_cells_desc:"\u5206\u5272\u5355\u5143\u683C", merge_cells_desc:"\u5408\u5E76\u5355\u5143\u683C", row_desc:"\u884C\u5C5E\u6027", cell_desc:"\u5355\u5143\u683C\u5C5E\u6027", props_desc:"\u8868\u683C\u5C5E\u6027", paste_row_before_desc:"\u8D34\u5728\u4E0A\u884C", paste_row_after_desc:"\u8D34\u5728\u4E0B\u884C", cut_row_desc:"\u526A\u5207\u9009\u62E9\u884C", copy_row_desc:"\u590D\u5236\u9009\u62E9\u884C", del:"\u5220\u9664\u8868\u683C", row:"\u884C", col:"\u5217", cell:"\u5355\u5143\u683C", cellprops_delta_width:"10", cellprops_delta_height:"10", table_delta_width:"40", table_delta_height:"60", merge_cells_delta_width:"40", merge_cells_delta_height:"40" }, autosave:{ unload_msg:"\u5982\u679C\u79BB\u5F00\u6B64\u9875\u9762\u5C06\u5BFC\u81F4\u6240\u505A\u7684\u66F4\u6539\u5168\u90E8\u4E22\u5931\u3002" }, fullscreen:{ desc:"\u5F00\u5173\u5168\u5C4F\u6A21\u5F0F" }, media:{ desc:"\u63D2\u5165/\u7F16\u8F91\u5D4C\u5165\u5A92\u4F53", edit:"\u7F16\u8F91\u5D4C\u5165\u5A92\u4F53" }, fullpage:{ desc:"\u6807\u9898" }, template:{ desc:"\u63D2\u5165\u9884\u5B9A\u7684\u8303\u672C\u5185\u5BB9" }, visualchars:{ desc:"\u662F\u5426\u663E\u793A\u63A7\u5236\u7B26\u53F7\u3002" }, spellchecker:{ desc:"\u5F00\u5173\u62FC\u5199\u68C0\u67E5", menu:"\u62FC\u5199\u68C0\u67E5\u8BBE\u7F6E", ignore_word:"\u7565\u8FC7", ignore_words:"\u5168\u90E8\u7565\u8FC7", langs:"\u8BED\u8A00", wait:"\u8BF7\u7A0D\u5019...", sug:"\u63A8\u8350\u5B57\u8BCD", no_sug:"\u65E0\u62FC\u5199\u63A8\u8350", no_mpell:"\u672A\u53D1\u73B0\u62FC\u5199\u9519\u8BEF" }, pagebreak:{ desc:"\u63D2\u5165\u5206\u9875\u7B26\u53F7" }}});����������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/license.txt���������������������������������������������������������0000664�0000000�0000000�00000063473�12266004471�0020376�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the library's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. <signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice That's all there is to it! �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/������������������������������������������������������������0000775�0000000�0000000�00000000000�12266004471�0017657�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/directionality/���������������������������������������������0000775�0000000�0000000�00000000000�12266004471�0022702�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/directionality/editor_plugin.js�����������������������������0000664�0000000�0000000�00000002353�12266004471�0026107�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������(function(){tinymce.create("tinymce.plugins.Directionality",{init:function(b,c){var d=this;d.editor=b;function a(e){var h=b.dom,g,f=b.selection.getSelectedBlocks();if(f.length){g=h.getAttrib(f[0],"dir");tinymce.each(f,function(i){if(!h.getParent(i.parentNode,"*[dir='"+e+"']",h.getRoot())){if(g!=e){h.setAttrib(i,"dir",e)}else{h.setAttrib(i,"dir",null)}}});b.nodeChanged()}}b.addCommand("mceDirectionLTR",function(){a("ltr")});b.addCommand("mceDirectionRTL",function(){a("rtl")});b.addButton("ltr",{title:"directionality.ltr_desc",cmd:"mceDirectionLTR"});b.addButton("rtl",{title:"directionality.rtl_desc",cmd:"mceDirectionRTL"});b.onNodeChange.add(d._nodeChange,d)},getInfo:function(){return{longname:"Directionality",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var d=b.dom,c;e=d.getParent(e,d.isBlock);if(!e){a.setDisabled("ltr",1);a.setDisabled("rtl",1);return}c=d.getAttrib(e,"dir");a.setActive("ltr",c=="ltr");a.setDisabled("ltr",0);a.setActive("rtl",c=="rtl");a.setDisabled("rtl",0)}});tinymce.PluginManager.add("directionality",tinymce.plugins.Directionality)})();�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/directionality/editor_plugin_src.js�������������������������0000664�0000000�0000000�00000004215�12266004471�0026755�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * editor_plugin_src.js * * Copyright 2009, Moxiecode Systems AB * Released under LGPL License. * * License: http://tinymce.moxiecode.com/license * Contributing: http://tinymce.moxiecode.com/contributing */ (function() { tinymce.create('tinymce.plugins.Directionality', { init : function(ed, url) { var t = this; t.editor = ed; function setDir(dir) { var dom = ed.dom, curDir, blocks = ed.selection.getSelectedBlocks(); if (blocks.length) { curDir = dom.getAttrib(blocks[0], "dir"); tinymce.each(blocks, function(block) { // Add dir to block if the parent block doesn't already have that dir if (!dom.getParent(block.parentNode, "*[dir='" + dir + "']", dom.getRoot())) { if (curDir != dir) { dom.setAttrib(block, "dir", dir); } else { dom.setAttrib(block, "dir", null); } } }); ed.nodeChanged(); } } ed.addCommand('mceDirectionLTR', function() { setDir("ltr"); }); ed.addCommand('mceDirectionRTL', function() { setDir("rtl"); }); ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'}); ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'}); ed.onNodeChange.add(t._nodeChange, t); }, getInfo : function() { return { longname : 'Directionality', author : 'Moxiecode Systems AB', authorurl : 'http://tinymce.moxiecode.com', infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality', version : tinymce.majorVersion + "." + tinymce.minorVersion }; }, // Private methods _nodeChange : function(ed, cm, n) { var dom = ed.dom, dir; n = dom.getParent(n, dom.isBlock); if (!n) { cm.setDisabled('ltr', 1); cm.setDisabled('rtl', 1); return; } dir = dom.getAttrib(n, 'dir'); cm.setActive('ltr', dir == "ltr"); cm.setDisabled('ltr', 0); cm.setActive('rtl', dir == "rtl"); cm.setDisabled('rtl', 0); } }); // Register plugin tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality); })();�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/����������������������������������������������0000775�0000000�0000000�00000000000�12266004471�0022460�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/css/������������������������������������������0000775�0000000�0000000�00000000000�12266004471�0023250�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/css/searchreplace.css�������������������������0000664�0000000�0000000�00000000260�12266004471�0026561�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.panel_wrapper {height:85px;} .panel_wrapper div.current {height:85px;} /* IE */ * html .panel_wrapper {height:100px;} * html .panel_wrapper div.current {height:100px;} ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/editor_plugin.js������������������������������0000664�0000000�0000000�00000002026�12266004471�0025662�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������(function(){tinymce.create("tinymce.plugins.SearchReplacePlugin",{init:function(a,c){function b(d){window.focus();a.windowManager.open({file:c+"/searchreplace.htm",width:420+parseInt(a.getLang("searchreplace.delta_width",0)),height:170+parseInt(a.getLang("searchreplace.delta_height",0)),inline:1,auto_focus:0},{mode:d,search_string:a.selection.getContent({format:"text"}),plugin_url:c})}a.addCommand("mceSearch",function(){b("search")});a.addCommand("mceReplace",function(){b("replace")});a.addButton("search",{title:"searchreplace.search_desc",cmd:"mceSearch"});a.addButton("replace",{title:"searchreplace.replace_desc",cmd:"mceReplace"});a.addShortcut("ctrl+f","searchreplace.search_desc","mceSearch")},getInfo:function(){return{longname:"Search/Replace",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("searchreplace",tinymce.plugins.SearchReplacePlugin)})();����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/editor_plugin_src.js��������������������������0000664�0000000�0000000�00000003403�12266004471�0026531�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * editor_plugin_src.js * * Copyright 2009, Moxiecode Systems AB * Released under LGPL License. * * License: http://tinymce.moxiecode.com/license * Contributing: http://tinymce.moxiecode.com/contributing */ (function() { tinymce.create('tinymce.plugins.SearchReplacePlugin', { init : function(ed, url) { function open(m) { // Keep IE from writing out the f/r character to the editor // instance while initializing a new dialog. See: #3131190 window.focus(); ed.windowManager.open({ file : url + '/searchreplace.htm', width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)), height : 170 + parseInt(ed.getLang('searchreplace.delta_height', 0)), inline : 1, auto_focus : 0 }, { mode : m, search_string : ed.selection.getContent({format : 'text'}), plugin_url : url }); }; // Register commands ed.addCommand('mceSearch', function() { open('search'); }); ed.addCommand('mceReplace', function() { open('replace'); }); // Register buttons ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'}); ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'}); ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch'); }, getInfo : function() { return { longname : 'Search/Replace', author : 'Moxiecode Systems AB', authorurl : 'http://tinymce.moxiecode.com', infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace', version : tinymce.majorVersion + "." + tinymce.minorVersion }; } }); // Register plugin tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin); })();�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/js/�������������������������������������������0000775�0000000�0000000�00000000000�12266004471�0023074�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/js/searchreplace.js���������������������������0000664�0000000�0000000�00000007150�12266004471�0026236�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCEPopup.requireLangPack(); var SearchReplaceDialog = { init : function(ed) { var t = this, f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode"); t.switchMode(m); f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string"); // Focus input field f[m + '_panel_searchstring'].focus(); mcTabs.onChange.add(function(tab_id, panel_id) { t.switchMode(tab_id.substring(0, tab_id.indexOf('_'))); }); }, switchMode : function(m) { var f, lm = this.lastMode; if (lm != m) { f = document.forms[0]; if (lm) { f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value; f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked; f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked; f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked; } mcTabs.displayTab(m + '_tab', m + '_panel'); document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none"; document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none"; this.lastMode = m; } }, searchNext : function(a) { var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0; // Get input f = document.forms[0]; s = f[m + '_panel_searchstring'].value; b = f[m + '_panel_backwardsu'].checked; ca = f[m + '_panel_casesensitivebox'].checked; rs = f['replace_panel_replacestring'].value; if (tinymce.isIE) { r = ed.getDoc().selection.createRange(); } if (s == '') return; function fix() { // Correct Firefox graphics glitches // TODO: Verify if this is actually needed any more, maybe it was for very old FF versions? r = se.getRng().cloneRange(); ed.getDoc().execCommand('SelectAll', false, null); se.setRng(r); }; function replace() { ed.selection.setContent(rs); // Needs to be duplicated due to selection bug in IE }; // IE flags if (ca) fl = fl | 4; switch (a) { case 'all': // Move caret to beginning of text ed.execCommand('SelectAll'); ed.selection.collapse(true); if (tinymce.isIE) { ed.focus(); r = ed.getDoc().selection.createRange(); while (r.findText(s, b ? -1 : 1, fl)) { r.scrollIntoView(); r.select(); replace(); fo = 1; if (b) { r.moveEnd("character", -(rs.length)); // Otherwise will loop forever } } tinyMCEPopup.storeSelection(); } else { while (w.find(s, ca, b, false, false, false, false)) { replace(); fo = 1; } } if (fo) tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced')); else tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); return; case 'current': if (!ed.selection.isCollapsed()) replace(); break; } se.collapse(b); r = se.getRng(); // Whats the point if (!s) return; if (tinymce.isIE) { ed.focus(); r = ed.getDoc().selection.createRange(); if (r.findText(s, b ? -1 : 1, fl)) { r.scrollIntoView(); r.select(); } else tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); tinyMCEPopup.storeSelection(); } else { if (!w.find(s, ca, b, false, false, false, false)) tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); else fix(); } } }; tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/����������������������������������������0000775�0000000�0000000�00000000000�12266004471�0023564�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/ar_dlg.js�������������������������������0000664�0000000�0000000�00000000725�12266004471�0025356�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('ar.searchreplace_dlg',{ searchnext_desc:"Find again", notfound:"The search has been completed. The search string could not be found.", search_title:"Find", replace_title:"Find/Replace", allreplaced:"All occurrences of the search string were replaced.", findwhat:"Find what", replacewith:"Replace with", direction:"Direction", up:"Up", down:"Down", mcase:"Match case", findnext:"Find next", replace:"Replace", replaceall:"Replace all" });�������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/az_dlg.js�������������������������������0000664�0000000�0000000�00000001271�12266004471�0025363�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('az.searchreplace_dlg',{ searchnext_desc:"S\u00F6zl\u0259ri axtar", notfound:"Axtar\u0131\u015F bitdi. S\u0259tr tap\u0131lmad\u0131.", search_title:"Axtar", replace_title:"Axtar/D\u0259yi\u015F", allreplaced:"B\u00FCt\u00FCn qar\u015F\u0131la\u015Fm\u0131\u015F s\u0259trl\u0259r d\u0259yi\u015Fdirildi.", findwhat:"N\u0259 axtar\u0131ls\u0131n", replacewith:"N\u0259y\u0259 d\u0259yi\u015Filsin", direction:"\u0130stiqam\u0259tl\u0259ndirm\u0259", up:"Yuxar\u0131", down:"A\u015Fa\u011F\u0131", mcase:"Registr\u0131 n\u0259z\u0259r\u0259 al", findnext:"Sonrak\u0131n\u0131 axtar", replace:"D\u0259yi\u015F", replaceall:"Ham\u0131s\u0131n\u0131 d\u0259yi\u015F" });���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/be_dlg.js�������������������������������0000664�0000000�0000000�00000002521�12266004471�0025336�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('be.searchreplace_dlg',{ searchnext_desc:"\u0417\u043D\u0430\u0439\u0441\u0446\u0456 \u0437\u043D\u043E\u045E", notfound:"\u041F\u043E\u0448\u0443\u043A \u0441\u043A\u043E\u043D\u0447\u0430\u043D\u044B. \u0420\u0430\u0434\u043E\u043A \u043D\u0435 \u0437\u043D\u043E\u0439\u0434\u0437\u0435\u043D\u0430\u044F.", search_title:"\u0417\u043D\u0430\u0439\u0441\u0446\u0456", replace_title:"\u0417\u043D\u0430\u0439\u0441\u0446\u0456/\u0417\u0430\u043C\u044F\u043D\u0456\u0446\u044C", allreplaced:"\u0423\u0441\u0435 \u0441\u0443\u0441\u0442\u0440\u0430\u043A\u0430\u0435\u043C\u044B\u044F \u0440\u0430\u0434\u043A\u0456 \u0431\u044B\u043B\u0456 \u0437\u0430\u043C\u0435\u043D\u0435\u043D\u044B\u044F.", findwhat:"\u0428\u0442\u043E \u0437\u043D\u0430\u0439\u0441\u0446\u0456", replacewith:"\u0417\u0430\u043C\u044F\u043D\u0456\u0446\u044C \u043D\u0430", direction:"\u041A\u0456\u0440\u0443\u043D\u0430\u043A", up:"\u0423\u0432\u0435\u0440\u0445", down:"\u0423\u043D\u0456\u0437", mcase:"\u0423\u043B\u0456\u0447\u0432\u0430\u0446\u044C \u0440\u044D\u0433\u0456\u0441\u0442\u0440", findnext:"\u0417\u043D\u0430\u0439\u0441\u0446\u0456 \u043D\u0430\u0441\u0442\u0443\u043F\u043D\u0443\u044E", replace:"\u0417\u0430\u043C\u044F\u043D\u0456\u0446\u044C", replaceall:"\u0417\u0430\u043C\u044F\u043D\u0456\u0446\u044C \u0443\u0441\u0451" });�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/bg_dlg.js�������������������������������0000664�0000000�0000000�00000002553�12266004471�0025345�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('bg.searchreplace_dlg',{ searchnext_desc:"\u0422\u044A\u0440\u0441\u0438 \u043E\u0442\u043D\u043E\u0432\u043E", notfound:"\u0422\u044A\u0440\u0441\u0435\u043D\u0435\u0442\u043E \u0437\u0430\u0432\u044A\u0440\u0448\u0438. \u0422\u044A\u0440\u0441\u0435\u043D\u0438\u0442\u0435 \u0434\u0443\u043C\u0438 \u043D\u0435 \u0431\u044F\u0445\u0430 \u043E\u0442\u043A\u0440\u0438\u0442\u0438.", search_title:"\u0422\u044A\u0440\u0441\u0438", replace_title:"\u0422\u044A\u0440\u0441\u0438/\u0417\u0430\u043C\u0435\u0441\u0442\u0438", allreplaced:"\u0412\u0441\u0438\u0447\u043A\u0438 \u043D\u0430\u043C\u0435\u0440\u0435\u043D\u0438 \u0434\u0443\u043C\u0438 \u0431\u044F\u0445\u0430 \u0437\u0430\u043C\u0435\u0441\u0442\u0435\u043D\u0438.", findwhat:"\u0422\u044A\u0440\u0441\u0438", replacewith:"\u0417\u0430\u043C\u0435\u0441\u0442\u0438 \u0441", direction:"\u041F\u043E\u0441\u043E\u043A\u0430", up:"\u041D\u0430\u0433\u043E\u0440\u0435", down:"\u041D\u0430\u0434\u043E\u043B\u0443", mcase:"\u0421\u044A\u0432\u043F\u0430\u0434\u0435\u043D\u0438\u0435 \u043D\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u044A\u0440\u0430", findnext:"\u0422\u044A\u0440\u0441\u0438 \u0441\u043B\u0435\u0434\u0432\u0430\u0449\u0438", replace:"\u0417\u0430\u043C\u0435\u0441\u0442\u0438", replaceall:"\u0417\u0430\u043C\u0435\u0441\u0442\u0438 \u0432\u0441\u0438\u0447\u043A\u0438" });�����������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/bn_dlg.js�������������������������������0000664�0000000�0000000�00000000725�12266004471�0025353�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('bn.searchreplace_dlg',{ searchnext_desc:"Find again", notfound:"The search has been completed. The search string could not be found.", search_title:"Find", replace_title:"Find/Replace", allreplaced:"All occurrences of the search string were replaced.", findwhat:"Find what", replacewith:"Replace with", direction:"Direction", up:"Up", down:"Down", mcase:"Match case", findnext:"Find next", replace:"Replace", replaceall:"Replace all" });�������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/br_dlg.js�������������������������������0000664�0000000�0000000�00000001027�12266004471�0025353�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('br.searchreplace_dlg',{ searchnext_desc:"Localizar novamente", notfound:"A pesquisa foi conclu\u00EDda sem resultados.", search_title:"Localizar", replace_title:"Localizar/substituir", allreplaced:"Todas as substitui\u00E7\u00F5es foram efetuadas.", findwhat:"Localizar", replacewith:"Substituir com", direction:"Dire\u00E7\u00E3o", up:"Acima", down:"Abaixo", mcase:"Diferenciar mai\u00FAsculas/min\u00FAsculas", findnext:"Localizar pr\u00F3ximo", replace:"Substituir", replaceall:"Substituir todos" });���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/bs_dlg.js�������������������������������0000664�0000000�0000000�00000001021�12266004471�0025346�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('bs.searchreplace_dlg',{ searchnext_desc:"Prona\u0111i opet", notfound:"Pretra\u017Eivanje je zavr\u0161eno. Tra\u017Eeni tekst nije prona\u0111en.", search_title:"Prona\u0111i", replace_title:"Prona\u0111i/Zamijeni", allreplaced:"Sva pojavljivanja tra\u017Eenog teksta su zamijenjena.", findwhat:"Prona\u0111i tekst", replacewith:"Zamijeni sa", direction:"Smjer", up:"Gore", down:"Dolje", mcase:"Match case", findnext:"Prona\u0111i sljede\u0107e", replace:"Zamijeni", replaceall:"Zamijeni sve" });���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/ca_dlg.js�������������������������������0000664�0000000�0000000�00000001052�12266004471�0025331�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('ca.searchreplace_dlg',{ searchnext_desc:"Cerca de nou", notfound:"S\'ha completat la cerca. No s\'ha trobat la cadena cercada.", search_title:"Cerca", replace_title:"Cerca/Reempla\u00E7a", allreplaced:"S\'han reempla\u00E7at totes les ocurr\u00E8ncies de la cadena cercada.", findwhat:"Cerca", replacewith:"Reempla\u00E7a amb", direction:"Direcci\u00F3", up:"Amunt", down:"Avall", mcase:"Distingeix maj\u00FAscules/min\u00FAscules", findnext:"Seg\u00FCent", replace:"Reempla\u00E7a", replaceall:"Reempla\u00E7a-ho tot" });��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/ch_dlg.js�������������������������������0000664�0000000�0000000�00000001161�12266004471�0025341�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('ch.searchreplace_dlg',{ searchnext_desc:"\u518D\u6B21\u67E5\u627E", notfound:"\u67E5\u627E\u5DF2\u5B8C\u6210!\u6CA1\u6709\u627E\u5230\u5339\u914D\u9879\u3002", search_title:"\u67E5\u627E", replace_title:"\u67E5\u627E/\u66FF\u6362", allreplaced:"\u5DF2\u66FF\u6362\u6240\u6709\u5339\u914D\u7684\u5B57\u7B26\u4E32\u3002", findwhat:"\u67E5\u627E\u76EE\u6807", replacewith:"\u66FF\u6362\u4E3A", direction:"\u65B9\u5411", up:"\u5411\u4E0A", down:"\u5411\u4E0B", mcase:"\u5927\u5C0F\u5199\u76F8\u7B26", findnext:"\u4E0B\u4E00\u4E2A", replace:"\u66FF\u6362", replaceall:"\u66FF\u6362\u5168\u90E8" });���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/cs_dlg.js�������������������������������0000664�0000000�0000000�00000001044�12266004471�0025354�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('cs.searchreplace_dlg',{ searchnext_desc:"Naj\u00EDt dal\u0161\u00ED", notfound:"Hled\u00E1n\u00ED bylo dokon\u010Deno. Hledan\u00FD text nebyl nalezen.", search_title:"Naj\u00EDt", replace_title:"Naj\u00EDt/nahradit", allreplaced:"V\u0161echny v\u00FDskyty byly nahrazeny.", findwhat:"Co hledat", replacewith:"\u010C\u00EDm nahradit", direction:"Sm\u011Br", up:"Nahoru", down:"Dol\u016F", mcase:"Rozli\u0161ovat velikost", findnext:"Naj\u00EDt dal\u0161\u00ED", replace:"Nahradit", replaceall:"Nahradit v\u0161e" });��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/cy_dlg.js�������������������������������0000664�0000000�0000000�00000000750�12266004471�0025365�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('cy.searchreplace_dlg',{ searchnext_desc:"Canfod eto", notfound:"Mae'r chwiliad wedi cwblhau. Methu canfod y llinyn chwiliad.", search_title:"Canfod", replace_title:"Canfod/Amnewid", allreplaced:"Amnewidwyd pob digwyddiad o'r llinyn chwiliad.", findwhat:"Canfod beth", replacewith:"Adnewid gyda", direction:"Cyfeiriad", up:"I fyny", down:"I lawr", mcase:"Cydweddu priflythrennedd", findnext:"Canfod nesaf", replace:"Amnewid", replaceall:"Amnewid pob un" });������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/da_dlg.js�������������������������������0000664�0000000�0000000�00000000745�12266004471�0025342�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('da.searchreplace_dlg',{ searchnext_desc:"S\u00F8g igen", notfound:"S\u00F8gningen gav intet resultat.", search_title:"S\u00F8g", replace_title:"S\u00F8g / erstat", allreplaced:"Alle forekomster af s\u00F8gestrengen er erstattet.", findwhat:"S\u00F8g efter", replacewith:"Erstat med", direction:"Retning", up:"Op", down:"Ned", mcase:"Forskel p\u00E5 store og sm\u00E5 bogstaver", findnext:"Find n\u00E6ste", replace:"Erstat", replaceall:"Erstat alle" });���������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/de_dlg.js�������������������������������0000664�0000000�0000000�00000001042�12266004471�0025335�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('de.searchreplace_dlg',{ searchnext_desc:"Weitersuchen", notfound:"Die Suche ist am Ende angelangt. Die Zeichenkette konnte nicht gefunden werden.", search_title:"Suchen", replace_title:"Suchen/Ersetzen", allreplaced:"Alle Vorkommen der Zeichenkette wurden ersetzt.", findwhat:"Zu suchender Text", replacewith:"Ersetzen durch", direction:"Suchrichtung", up:"Aufw\u00E4rts", down:"Abw\u00E4rts", mcase:"Gro\u00DF-/Kleinschreibung beachten", findnext:"Weitersuchen", replace:"Ersetzen", replaceall:"Alle ersetzen" });����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/dv_dlg.js�������������������������������0000664�0000000�0000000�00000000725�12266004471�0025365�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('dv.searchreplace_dlg',{ searchnext_desc:"Find again", notfound:"The search has been completed. The search string could not be found.", search_title:"Find", replace_title:"Find/Replace", allreplaced:"All occurrences of the search string were replaced.", findwhat:"Find what", replacewith:"Replace with", direction:"Direction", up:"Up", down:"Down", mcase:"Match case", findnext:"Find next", replace:"Replace", replaceall:"Replace all" });�������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/el_dlg.js�������������������������������0000664�0000000�0000000�00000003162�12266004471�0025352�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('el.searchreplace_dlg',{ searchnext_desc:"\u0395\u03CD\u03C1\u03B5\u03C3\u03B7 \u03BE\u03B1\u03BD\u03AC", notfound:"\u0397 \u03B1\u03BD\u03B1\u03B6\u03AE\u03C4\u03B7\u03C3\u03B7 \u03C4\u03B5\u03BB\u03B5\u03AF\u03C9\u03C3\u03B5. \u03A4\u03BF \u03B6\u03B7\u03C4\u03BF\u03CD\u03BC\u03B5\u03BD\u03BF \u03BA\u03B5\u03AF\u03BC\u03B5\u03BD\u03BF \u03B4\u03B5\u03BD \u03B2\u03C1\u03AD\u03B8\u03B7\u03BA\u03B5.", search_title:"\u0395\u03CD\u03C1\u03B5\u03C3\u03B7", replace_title:"\u0395\u03CD\u03C1\u03B5\u03C3\u03B7/\u0391\u03BD\u03B1\u03B6\u03AE\u03C4\u03B7\u03C3\u03B7", allreplaced:"\u038C\u03BB\u03B5\u03C2 \u03BF\u03B9 \u03B5\u03BC\u03C6\u03B1\u03BD\u03AF\u03C3\u03B5\u03B9\u03C2 \u03C4\u03BF\u03C5 \u03B6\u03B7\u03C4\u03BF\u03CD\u03BC\u03B5\u03BD\u03BF\u03C5 \u03BA\u03B5\u03B9\u03BC\u03AD\u03BD\u03BF\u03C5 \u03B1\u03BD\u03C4\u03B9\u03BA\u03B1\u03C4\u03B1\u03C3\u03C4\u03AC\u03B8\u03B7\u03BA\u03B1\u03BD.", findwhat:"\u0395\u03CD\u03C1\u03B5\u03C3\u03B7 \u03C4\u03BF\u03C5", replacewith:"\u0391\u03BD\u03C4\u03B9\u03BA\u03B1\u03C4\u03AC\u03C3\u03C4\u03B1\u03C3\u03B7 \u03BC\u03B5", direction:"\u039A\u03B1\u03C4\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7", up:"\u03A0\u03AC\u03BD\u03C9", down:"\u039A\u03AC\u03C4\u03C9", mcase:"\u03A4\u03B1\u03AF\u03C1\u03B9\u03B1\u03C3\u03BC\u03B1 \u03BA\u03B5\u03C6\u03B1\u03BB\u03B1\u03AF\u03B1/\u03BC\u03B9\u03BA\u03C1\u03AC", findnext:"\u0392\u03C1\u03B5\u03C2 \u03B5\u03C0\u03CC\u03BC\u03B5\u03BD\u03BF", replace:"\u0391\u03BD\u03C4\u03B9\u03BA\u03B1\u03C4\u03AC\u03C3\u03C4\u03B1\u03C3\u03B7", replaceall:"\u0391\u03BD\u03C4\u03B9\u03BA\u03B1\u03C4. \u03CC\u03BB\u03C9\u03BD" });��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/en_dlg.js�������������������������������0000664�0000000�0000000�00000000675�12266004471�0025362�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('en.searchreplace_dlg',{findwhat:"Find What",replacewith:"Replace with",direction:"Direction",up:"Up",down:"Down",mcase:"Match Case",findnext:"Find Next",allreplaced:"All occurrences of the search string were replaced.","searchnext_desc":"Find Again",notfound:"The search has been completed. The search string could not be found.","search_title":"Find","replace_title":"Find/Replace",replaceall:"Replace All",replace:"Replace"});�������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/es_dlg.js�������������������������������0000664�0000000�0000000�00000000776�12266004471�0025371�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('es.searchreplace_dlg',{ searchnext_desc:"Buscar de nuevo", notfound:"La b\u00FAsqueda se ha completado. No se encontr\u00F3 el texto introducido.", search_title:"Buscar", replace_title:"Buscar/Reemplazar", allreplaced:"Se ha reemplazado el texto.", findwhat:"Qu\u00E9 buscar", replacewith:"Reemplazar por", direction:"Direcci\u00F3n", up:"Arriba", down:"Abajo", mcase:"Min\u00FAs./May\u00FAs.", findnext:"Buscar siguiente", replace:"Reemplazar", replaceall:"Reemplazar todo" });��glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/et_dlg.js�������������������������������0000664�0000000�0000000�00000000725�12266004471�0025364�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('et.searchreplace_dlg',{ searchnext_desc:"Otsi uuesti", notfound:"Otsing on l\u00F5petatud. Otsis\u00F5na ei leitud.", search_title:"Otsi", replace_title:"Otsi/Asenda", allreplaced:"K\u00F5ik otsis\u00F5na ilmingud on asendatud.", findwhat:"Otsi mida", replacewith:"Asenda millega", direction:"Suund", up:"\u00DCles", down:"Alla", mcase:"Vasta suurusele", findnext:"Otsi j\u00E4rgmine", replace:"Asenda", replaceall:"Asenda k\u00F5ik" });�������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/fa_dlg.js�������������������������������0000664�0000000�0000000�00000002225�12266004471�0025337�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('fa.searchreplace_dlg',{ searchnext_desc:"\u062C\u0633\u062A\u062C\u0648\u06CC \u0645\u062C\u062F\u062F", notfound:"\u062C\u0633\u062A\u062C\u0648 \u0643\u0627\u0645\u0644 \u0634\u062F. \u06A9\u0644\u0645\u0647 \u062C\u0633\u062A\u062C\u0648 \u0634\u062F\u0647 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F", search_title:"\u062C\u0633\u062A\u062C\u0648", replace_title:"\u062C\u0633\u062A\u062C\u0648/\u062A\u0639\u0648\u06CC\u0636", allreplaced:"\u062A\u0645\u0627\u0645\u06CC \u06A9\u0644\u0645\u0627\u062A \u06CC\u0627\u0641\u062A \u0634\u062F\u0647 \u062A\u063A\u06CC\u06CC\u0631 \u06CC\u0627\u0641\u062A\u0646\u062F", findwhat:"\u062C\u0633\u062A\u062C\u0648\u06CC \u0686\u0647 \u0686\u06CC\u0632\u06CC", replacewith:"\u062A\u0639\u0648\u06CC\u0636 \u0628\u0627", direction:"\u062C\u0647\u062A", up:"\u0628\u0627\u0644\u0627", down:"\u067E\u0627\u06CC\u06CC\u0646", mcase:"\u0647\u0645\u0633\u0627\u0646 \u0628\u0648\u062F\u0646 \u062D\u0631\u0648\u0641", findnext:"\u062C\u0633\u062A\u062C\u0648\u06CC \u0628\u0639\u062F\u06CC", replace:"\u062A\u0639\u0648\u06CC\u0636", replaceall:"\u062A\u0639\u0648\u06CC\u0636 \u0647\u0645\u0647" });���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/fi_dlg.js�������������������������������0000664�0000000�0000000�00000000754�12266004471�0025354�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('fi.searchreplace_dlg',{ searchnext_desc:"Etsi uudestaan", notfound:"Haku on valmis. Haettua teksti\u00E4 ei l\u00F6ytynyt.", search_title:"Haku", replace_title:"Etsi ja korvaa", allreplaced:"Kaikki l\u00F6ydetyt merkkijonot korvattiin.", findwhat:"Etsit\u00E4\u00E4n", replacewith:"Korvataan", direction:"Suunta", up:"Yl\u00F6s", down:"Alas", mcase:"Huomioi isot ja pienet kirjaimet", findnext:"Etsi seuraavaa", replace:"Korvaa", replaceall:"Korvaa kaikki" });��������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/fr_dlg.js�������������������������������0000664�0000000�0000000�00000001137�12266004471�0025361�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('fr.searchreplace_dlg',{ searchnext_desc:"Suivant", notfound:"La recherche est termin\u00E9e. La cha\u00EEne recherch\u00E9e n'a pas \u00E9t\u00E9 trouv\u00E9e.", search_title:"Rechercher", replace_title:"Rechercher / remplacer", allreplaced:"Toutes les occurrences de la cha\u00EEne recherch\u00E9e ont \u00E9t\u00E9 remplac\u00E9es.", findwhat:"Rechercher ceci", replacewith:"Remplacer par", direction:"Direction", up:"Vers le haut", down:"Vers le bas", mcase:"Sensible \u00E0 la casse", findnext:"Rechercher le suivant", replace:"Remplacer", replaceall:"Tout remplacer" });���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/gl_dlg.js�������������������������������0000664�0000000�0000000�00000000777�12266004471�0025365�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('gl.searchreplace_dlg',{ searchnext_desc:"Buscar outra vez", notfound:"A busca rematou. No se atopou o texto buscado.", search_title:"Buscar", replace_title:"Buscar/Reemplazar", allreplaced:"T\u00F3da-las coincidencias do texto buscado foron reemplazadas.", findwhat:"Localizar", replacewith:"Reemplazar por", direction:"Direcci\u00F3n", up:"Arriba", down:"Abaixo", mcase:"Min\u00FAs./Mai\u00FAs.", findnext:"Buscar seginte", replace:"Reemplazar", replaceall:"Reemplazar todo" });�glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/gu_dlg.js�������������������������������0000664�0000000�0000000�00000000725�12266004471�0025367�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('gu.searchreplace_dlg',{ searchnext_desc:"Find again", notfound:"The search has been completed. The search string could not be found.", search_title:"Find", replace_title:"Find/Replace", allreplaced:"All occurrences of the search string were replaced.", findwhat:"Find what", replacewith:"Replace with", direction:"Direction", up:"Up", down:"Down", mcase:"Match case", findnext:"Find next", replace:"Replace", replaceall:"Replace all" });�������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/he_dlg.js�������������������������������0000664�0000000�0000000�00000002070�12266004471�0025343�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('he.searchreplace_dlg',{ searchnext_desc:"\u05D7\u05D9\u05E4\u05D5\u05E9 \u05D4\u05D1\u05D0", notfound:"\u05D4\u05D7\u05D9\u05E4\u05D5\u05E9 \u05D4\u05E1\u05EA\u05D9\u05D9\u05DD. \u05E4\u05E8\u05D9\u05D8 \u05D4\u05D7\u05D9\u05E4\u05D5\u05E9 \u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0.", search_title:"\u05D7\u05D9\u05E4\u05D5\u05E9", replace_title:"\u05D7\u05D9\u05E4\u05D5\u05E9 \u05D5\u05D4\u05D7\u05DC\u05E4\u05D4", allreplaced:"\u05DB\u05DC \u05E4\u05E8\u05D9\u05D8\u05D9 \u05D4\u05D7\u05D9\u05E4\u05D5\u05E9 \u05D4\u05D5\u05D7\u05DC\u05E4\u05D5", findwhat:"\u05DC\u05D7\u05E4\u05E9 \u05D0\u05EA", replacewith:"\u05DC\u05D4\u05D7\u05DC\u05D9\u05E3 \u05D1", direction:"\u05DB\u05D9\u05D5\u05D5\u05DF", up:"\u05DC\u05DE\u05E2\u05DC\u05D4", down:"\u05DC\u05DE\u05D8\u05D4", mcase:"\u05D4\u05EA\u05D0\u05DD \u05D0\u05D5\u05EA\u05D9\u05D5\u05EA \u05E8\u05D9\u05E9\u05D9\u05D5\u05EA", findnext:"\u05D7\u05E4\u05E9 \u05D0\u05EA \u05D4\u05D1\u05D0", replace:"\u05D4\u05D7\u05DC\u05E4\u05D4", replaceall:"\u05D4\u05D7\u05DC\u05E4\u05EA \u05D4\u05DB\u05DC" });������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/hi_dlg.js�������������������������������0000664�0000000�0000000�00000000725�12266004471�0025354�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('hi.searchreplace_dlg',{ searchnext_desc:"Find again", notfound:"The search has been completed. The search string could not be found.", search_title:"Find", replace_title:"Find/Replace", allreplaced:"All occurrences of the search string were replaced.", findwhat:"Find what", replacewith:"Replace with", direction:"Direction", up:"Up", down:"Down", mcase:"Match case", findnext:"Find next", replace:"Replace", replaceall:"Replace all" });�������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/hr_dlg.js�������������������������������0000664�0000000�0000000�00000001021�12266004471�0025353�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('hr.searchreplace_dlg',{ searchnext_desc:"Prona\u0111i opet", notfound:"Pretra\u017Eivanje je zavr\u0161eno. Tra\u017Eeni tekst nije prona\u0111en.", search_title:"Prona\u0111i", replace_title:"Prona\u0111i/Zamijeni", allreplaced:"Sva pojavljivanja tra\u017Eenog teksta su zamijenjena.", findwhat:"Prona\u0111i tekst", replacewith:"Zamijeni sa", direction:"Smjer", up:"Gore", down:"Dolje", mcase:"Match case", findnext:"Prona\u0111i sljede\u0107e", replace:"Zamijeni", replaceall:"Zamijeni sve" });���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/hu_dlg.js�������������������������������0000664�0000000�0000000�00000001171�12266004471�0025364�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('hu.searchreplace_dlg',{ searchnext_desc:"Keres\u00E9s megint", notfound:"A keres\u00E9s v\u00E9get \u00E9rt. A keresett sz\u00F6vegr\u00E9sz nem tal\u00E1lhat\u00F3.", search_title:"Keres\u00E9s", replace_title:"Keres\u00E9s/Csere", allreplaced:"A keresett r\u00E9szsz\u00F6veg minden el\u0151fordul\u00E1sa cser\u00E9lve lett.", findwhat:"Mit cser\u00E9l", replacewith:"Mire cser\u00E9l", direction:"Ir\u00E1ny", up:"Fel", down:"Le", mcase:"Kis- \u00E9s nagybet\u0171k megk\u00FCl\u00F6nb\u00F6ztet\u00E9se", findnext:"Keres\u00E9s", replace:"Csere", replaceall:"Minden tal\u00E1lat cser\u00E9je" });�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/hy_dlg.js�������������������������������0000664�0000000�0000000�00000002400�12266004471�0025364�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('hy.searchreplace_dlg',{ searchnext_desc:"\u0546\u0578\u0580\u056B\u0581 \u0578\u0580\u0578\u0576\u0565\u056C", notfound:"\u0548\u0580\u0578\u0576\u0578\u0582\u0574\u0568 \u0561\u057E\u0561\u0580\u057F\u057E\u0565\u0581\u0589 \u0548\u0579\u056B\u0576\u0579 \u0579\u056B \u0563\u057F\u0576\u057E\u0565\u056C", search_title:"\u0548\u0580\u0578\u0576\u0565\u056C", replace_title:"\u0548\u0580\u0578\u0576\u0565\u056C / \u0553\u0578\u0583\u0578\u056D\u0565\u056C", allreplaced:"\u0532\u0578\u056C\u0578\u0580 \u0563\u057F\u0576\u057E\u0561\u056E\u0576\u0565\u0580\u0568 \u0583\u0578\u0583\u0578\u056D\u057E\u0565\u0581\u056B\u0576", findwhat:"\u0548\u0580\u0578\u0576\u0565\u056C", replacewith:"\u0553\u0578\u0583\u0578\u056D\u0565\u056C", direction:"\u0548\u0582\u0572\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576", up:"\u054E\u0565\u0580\u0587 ", down:"\u0546\u0565\u0580\u0584\u0587", mcase:"\u0540\u0561\u0577\u057E\u056B \u0561\u057C\u0576\u0565\u056C \u057C\u0565\u0563\u056B\u057D\u057F\u0578\u0580\u0568", findnext:"\u0533\u057F\u0576\u0565\u056C \u0570\u0561\u057B\u0578\u0580\u0564\u0568", replace:"\u0553\u0578\u0583\u0578\u056D\u0565\u056C", replaceall:"\u0553\u0578\u0583\u0578\u056D\u0565\u056C \u0562\u0561\u056C\u0578\u0580\u0568" });����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/ia_dlg.js�������������������������������0000664�0000000�0000000�00000001173�12266004471�0025343�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('ia.searchreplace_dlg',{ searchnext_desc:"\u518D\u6B21\u67E5\u627E", notfound:"\u67E5\u627E\u5DF2\u5B8C\u6210 ! \u627E\u4E0D\u5230\u4EFB\u4F55\u76EE\u6807\u3002 ", search_title:"\u67E5\u627E", replace_title:"\u67E5\u627E/\u66FF\u6362", allreplaced:"\u5DF2\u66FF\u6362\u6240\u6709\u5339\u914D\u7684\u5B57\u7B26\u4E32.", findwhat:"\u67E5\u627E\u76EE\u6807", replacewith:"\u66FF\u6362\u4E3A", direction:"\u65B9\u5411", up:"\u5411\u4E0A", down:"\u5411\u4E0B", mcase:"\u533A\u5206\u5927\u5C0F\u5199", findnext:"\u67E5\u627E\u4E0B\u4E00\u4E2A", replace:"\u66FF\u6362", replaceall:"\u5168\u90E8\u66FF\u6362" });�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/id_dlg.js�������������������������������0000664�0000000�0000000�00000000677�12266004471�0025356�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('id.searchreplace_dlg',{ searchnext_desc:"Cari Lagi", notfound:"Pencarian selesai. Hasil tidak ditemukan.", search_title:"Cari", replace_title:"Cari/Ganti", allreplaced:"Seluruh kata dari string pencarian telah digantikan", findwhat:"Cari apa...", replacewith:"Ganti dengan...", direction:"Arah", up:"Atas", down:"Bawah", mcase:"Match case", findnext:"Cari selanjutnya", replace:"Ganti", replaceall:"Ganti semua" });�����������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/ii_dlg.js�������������������������������0000664�0000000�0000000�00000001146�12266004471�0025353�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('ii.searchreplace_dlg',{ searchnext_desc:"\u518D\u6B21\u67E5\u627E", notfound:"\u67E5\u627E\u5DF2\u5B8C\u6210!\u627E\u4E0D\u5230\u4EFB\u4F55\u76EE\u6807\u3002", search_title:"\u67E5\u627E", replace_title:"\u67E5\u627E/\u66FF\u6362", allreplaced:"\u5DF2\u66FF\u6362\u6240\u6709\u5339\u914D\u7684\u7B26\u4E32.", findwhat:"\u67E5\u627E\u76EE\u6807", replacewith:"\u66FF\u6362\u4E3A", direction:"\u65B9\u5411", up:"\u5411\u4E0A", down:"\u5411\u4E0B", mcase:"\u5927\u5C0F\u5199\u5339\u914D", findnext:"\u4E0B\u4E00\u4E2A", replace:"\u66FF\u6362", replaceall:"\u66FF\u6362\u5168\u90E8" });��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/is_dlg.js�������������������������������0000664�0000000�0000000�00000001017�12266004471�0025362�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('is.searchreplace_dlg',{ searchnext_desc:"Finna aftur", notfound:"Leitinni er loki\u00F0. Leitarstrengurinn fannst ekki.", search_title:"Finna", replace_title:"Finna/Skipta \u00FAt", allreplaced:"\u00D6llum ni\u00F0urst\u00F6\u00F0um leitar var skipt \u00FAt.", findwhat:"Finna hva\u00F0", replacewith:"Skipta \u00FAt me\u00F0", direction:"\u00C1tt", up:"Upp", down:"Ni\u00F0ur", mcase:"Match case", findnext:"Finna n\u00E6sta", replace:"Skipta \u00FAt", replaceall:"Skipta \u00FAt \u00F6llu" });�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/it_dlg.js�������������������������������0000664�0000000�0000000�00000000761�12266004471�0025370�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('it.searchreplace_dlg',{ searchnext_desc:"Trova successivo", notfound:"Ricerca completata. Nessun risultato trovato.", search_title:"Trova", replace_title:"Trova/Sostituisci", allreplaced:"Tutte le occorrenze del criterio di ricerca sono state sostituite.", findwhat:"Trova:", replacewith:"Sostituisci con:", direction:"Direzione", up:"Avanti", down:"Indietro", mcase:"Maiuscole/minuscole", findnext:"Trova succ.", replace:"Sostituisci", replaceall:"Sost. tutto" });���������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/ja_dlg.js�������������������������������0000664�0000000�0000000�00000001357�12266004471�0025350�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('ja.searchreplace_dlg',{ searchnext_desc:"\u518D\u691C\u7D22", notfound:"\u6700\u5F8C\u307E\u3067\u691C\u7D22\u3057\u307E\u3057\u305F\u304C\u3001\u691C\u7D22\u6587\u5B57\u5217\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002", search_title:"\u691C\u7D22", replace_title:"\u691C\u7D22/\u7F6E\u63DB", allreplaced:"\u5168\u3066\u7F6E\u63DB\u3055\u308C\u307E\u3057\u305F\u3002", findwhat:"\u691C\u7D22\u6587\u5B57\u5217", replacewith:"\u7F6E\u63DB\u6587\u5B57\u5217", direction:"\u65B9\u5411", up:"\u4E0A\u3078", down:"\u4E0B\u3078", mcase:"\u5927\u6587\u5B57/\u5C0F\u6587\u5B57\u3092\u533A\u5225\u3059\u308B", findnext:"\u6B21\u3078", replace:"\u7F6E\u63DB", replaceall:"\u5168\u3066\u7F6E\u63DB" });���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/ko_dlg.js�������������������������������0000664�0000000�0000000�00000001322�12266004471�0025357�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('ko.searchreplace_dlg',{ searchnext_desc:"\uC7AC\uAC80\uC0C9", notfound:"\uAC80\uC0C9\uC774 \uC644\uB8CC\uD588\uC2B5\uB2C8\uB2E4. \uAC80\uC0C9 \uBB38\uC790\uC5F4\uC740 \uBC1C\uACAC\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.", search_title:"\uAC80\uC0C9", replace_title:"\uAC80\uC0C9/\uCE58\uD658", allreplaced:"\uBAA8\uB450 \uCE58\uD658\uB418\uC5C8\uC2B5\uB2C8\uB2E4.", findwhat:"\uAC80\uC0C9 \uBB38\uC790\uC5F4", replacewith:"\uCE58\uD658 \uBB38\uC790\uC5F4", direction:"\uBC29\uD5A5", up:"\uC704\uC5D0", down:"\uC544\uB798\uC5D0", mcase:"\uB300\uBB38\uC790/\uC18C\uBB38\uC790\uB97C \uAD6C\uBCC4", findnext:"\uAC80\uC0C9", replace:"\uCE58\uD658", replaceall:"\uBAA8\uB450 \uCE58\uD658" });��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/lt_dlg.js�������������������������������0000664�0000000�0000000�00000001062�12266004471�0025366�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('lt.searchreplace_dlg',{ searchnext_desc:"Ie\u0161koti dar kart\u0105", notfound:"Paie\u0161ka baigta. Paie\u0161kos fraz\u0117 nerasta.", search_title:"Ie\u0161koti", replace_title:"Ie\u0161koti/Pakeisti", allreplaced:"Visi paie\u0161kos fraz\u0117s pasikartojimai pakeisti.", findwhat:"Ko ie\u0161koti", replacewith:"Kuo pakeisti", direction:"Kryptis", up:"\u012E vir\u0161\u0173", down:"\u012E apa\u010Di\u0105", mcase:"Visi\u0161kas atitikimas", findnext:"Ie\u0161koti sek.", replace:"Pakeisti", replaceall:"Pakeisti visus" });������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/lv_dlg.js�������������������������������0000664�0000000�0000000�00000001077�12266004471�0025376�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('lv.searchreplace_dlg',{ searchnext_desc:"Mekl\u0113t v\u0113lreiz", notfound:"Mekl\u0113\u0161ana pabeigta. Mekl\u0113t\u0101 fr\u0101ze/v\u0101rds netika atrasta.", search_title:"Mekl\u0113t", replace_title:"Mekl\u0113t/Aizvietot", allreplaced:"Visas fr\u0101zes/v\u0101rdi tika veiksm\u012Bgi aizvietoti.", findwhat:"Ko atrast", replacewith:"Aizvietot ar", direction:"Virziens", up:"Uz aug\u0161u", down:"Uz leju", mcase:"Re\u0123istrj\u016Bt\u012Bgs", findnext:"Mekl\u0113t n\u0101kamo", replace:"Aizvietot", replaceall:"Aizvietot visu" });�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/mk_dlg.js�������������������������������0000664�0000000�0000000�00000001007�12266004471�0025355�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('mk.searchreplace_dlg',{ searchnext_desc:"Prona\u0111i opet", notfound:"Pretra\u017Eivanje je zavr\u0161eno. Tra\u017Eeni tekst nije prona\u0111en.", search_title:"Prona\u0111i", replace_title:"Prona\u0111i/Zameni", allreplaced:"Sva pojavljivanja tra\u017Eenog teksta su zamenjena.", findwhat:"Prona\u0111i tekst", replacewith:"Zameni sa", direction:"Smjer", up:"Gore", down:"Dolje", mcase:"Match case", findnext:"Prona\u0111i sljede\u0107e", replace:"Zameni", replaceall:"Zameni sve" });�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/ml_dlg.js�������������������������������0000664�0000000�0000000�00000000725�12266004471�0025364�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('ml.searchreplace_dlg',{ searchnext_desc:"Find again", notfound:"The search has been completed. The search string could not be found.", search_title:"Find", replace_title:"Find/Replace", allreplaced:"All occurrences of the search string were replaced.", findwhat:"Find what", replacewith:"Replace with", direction:"Direction", up:"Up", down:"Down", mcase:"Match case", findnext:"Find next", replace:"Replace", replaceall:"Replace all" });�������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/mn_dlg.js�������������������������������0000664�0000000�0000000�00000002546�12266004471�0025371�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('mn.searchreplace_dlg',{ searchnext_desc:"\u0426\u0430\u0430\u0448 \u0445\u0430\u0439\u0445", notfound:"\u0425\u0430\u0439\u043B\u0442 \u0442\u04E9\u0433\u0441\u0433\u04E9\u043B\u0434 \u0445\u04AF\u0440\u044D\u0432. \u0422\u044D\u043C\u0434\u044D\u0433\u0442 \u043C\u04E9\u0440 \u043E\u043B\u0434\u0441\u043E\u043D\u0433\u04AF\u0439.", search_title:"\u0425\u0430\u0439\u0445", replace_title:"\u0425\u0430\u0439\u0445/\u043E\u0440\u043B\u0443\u0443\u043B\u0430\u0445", allreplaced:"\u0422\u044D\u043C\u0434\u044D\u0433\u0442 \u043C\u04E9\u0440\u0438\u0439\u043D \u0431\u04AF\u0445 \u0442\u043E\u0445\u0438\u043E\u043B\u0434\u043B\u0443\u0443\u0434 \u043E\u0440\u043B\u0443\u0443\u043B\u0430\u0433\u0434\u0441\u0430\u043D.", findwhat:"\u0425\u0430\u0439\u0445 \u0431\u0438\u0447\u0432\u044D\u0440", replacewith:"\u041E\u0440\u043B\u0443\u0443\u043B\u0430\u0433\u0430", direction:"\u0425\u0430\u0439\u0445 \u0447\u0438\u0433\u043B\u044D\u043B", up:"\u0413\u044D\u0434\u0440\u044D\u0433", down:"\u0426\u0430\u0430\u0448", mcase:"\u0422\u043E\u043C/\u0416\u0438\u0436\u0438\u0433 \u0431\u0438\u0447\u0438\u043B\u0442 \u044F\u043B\u0433\u0430\u0445", findnext:"\u0426\u0430\u0430\u0448 \u0445\u0430\u0439\u0445", replace:"\u041E\u0440\u043B\u0443\u0443\u043B", replaceall:"\u0411\u04AF\u0433\u0434\u0438\u0439\u0433 \u043E\u0440\u043B\u0443\u0443\u043B" });����������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/ms_dlg.js�������������������������������0000664�0000000�0000000�00000000661�12266004471�0025372�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('ms.searchreplace_dlg',{ searchnext_desc:"Cari lagi", notfound:"Carian tamat. Perkataan yang dicari tiada.", search_title:"Cari", replace_title:"Cari/Ganti", allreplaced:"Kesemua perkataan telah digantikan.", findwhat:"Cari apa", replacewith:"Ganti dengan", direction:"Arah", up:"Atas", down:"Bawah", mcase:"Samakan kes", findnext:"Carian seterusnya", replace:"Ganti", replaceall:"Ganti kesemuanya" });�������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/nb_dlg.js�������������������������������0000664�0000000�0000000�00000000760�12266004471�0025352�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('nb.searchreplace_dlg',{ searchnext_desc:"S\u00F8k igjen", notfound:"S\u00F8ket er avsluttet. Fant ikke s\u00F8kestrengen.", search_title:"S\u00F8k", replace_title:"S\u00F8k/Erstatt", allreplaced:"Alle forekomster av s\u00F8kestrengen er erstattet.", findwhat:"Finn hva", replacewith:"Erstatt med", direction:"Retning", up:"Oppover", down:"Nedover", mcase:"Skill mellom store og sm\u00E5 tegn", findnext:"Finn neste", replace:"Erstatt", replaceall:"Erstatt alt" });����������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/nl_dlg.js�������������������������������0000664�0000000�0000000�00000001000�12266004471�0025350�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('nl.searchreplace_dlg',{ searchnext_desc:"Opnieuw zoeken", notfound:"Het doorzoeken is voltooid. De zoekterm kon niet meer worden gevonden.", search_title:"Zoeken", replace_title:"Zoeken/Vervangen", allreplaced:"Alle instanties van de zoekterm zijn vervangen.", findwhat:"Zoeken naar", replacewith:"Vervangen door", direction:"Richting", up:"Omhoog", down:"Omlaag", mcase:"Identieke hoofdletters/kleine letters", findnext:"Zoeken", replace:"Vervangen", replaceall:"Alles verv." });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/nn_dlg.js�������������������������������0000664�0000000�0000000�00000000764�12266004471�0025372�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('nn.searchreplace_dlg',{ searchnext_desc:"S\u00F8k igjen", notfound:"S\u00F8ket avslutta. Fann ikkje s\u00F8kjestrengen.", search_title:"S\u00F8k", replace_title:"S\u00F8k/Erstatt", allreplaced:"Alle f\u00F8rekomstar av s\u00F8kjestrengen er erstatta.", findwhat:"Finn kva", replacewith:"Erstatt med", direction:"Retning", up:"Oppover", down:"Nedover", mcase:"Skill mellom store og sm\u00E5 teikn", findnext:"Finn neste", replace:"Erstatt", replaceall:"Erstatt alt" });������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/no_dlg.js�������������������������������0000664�0000000�0000000�00000000755�12266004471�0025373�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('no.searchreplace_dlg',{ searchnext_desc:"S\u00F8k igjen", notfound:"S\u00F8ket avsluttet. Fant ikke s\u00F8kestrengen.", search_title:"S\u00F8k", replace_title:"S\u00F8k/Erstatt", allreplaced:"Alle forekomster av s\u00F8kestrengen er erstattet.", findwhat:"Finn hva", replacewith:"Erstatt med", direction:"Retning", up:"Oppover", down:"Nedover", mcase:"Skill mellom store og sm\u00E5 tegn", findnext:"Finn neste", replace:"Erstatt", replaceall:"Erstatt alt" });�������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/pl_dlg.js�������������������������������0000664�0000000�0000000�00000001117�12266004471�0025363�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('pl.searchreplace_dlg',{ searchnext_desc:"Znajd\u017A ponownie", notfound:"Wyszukiwanie zako\u0144czone. Poszukiwany fragment nie zosta\u0142 znaleziony.", search_title:"Znajd\u017A", replace_title:"Znajd\u017A/Zamie\u0144", allreplaced:"Wszystkie wyst\u0105pienia szukanego fragmentu zosta\u0142y zast\u0105pione.", findwhat:"Znajd\u017A...", replacewith:"Zamie\u0144 z...", direction:"Kierunek", up:"W g\u00F3r\u0119", down:"W d\u00F3\u0142", mcase:"Dopasuj case", findnext:"Znajd\u017A nast\u0119pny", replace:"Zamie\u0144", replaceall:"Zamien wszystko" });�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/ps_dlg.js�������������������������������0000664�0000000�0000000�00000000725�12266004471�0025376�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('ps.searchreplace_dlg',{ searchnext_desc:"Find again", notfound:"The search has been completed. The search string could not be found.", search_title:"Find", replace_title:"Find/Replace", allreplaced:"All occurrences of the search string were replaced.", findwhat:"Find what", replacewith:"Replace with", direction:"Direction", up:"Up", down:"Down", mcase:"Match case", findnext:"Find next", replace:"Replace", replaceall:"Replace all" });�������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/pt_dlg.js�������������������������������0000664�0000000�0000000�00000001007�12266004471�0025371�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('pt.searchreplace_dlg',{ searchnext_desc:"Localizar novamente", notfound:"A pesquisa foi conclu\u00EDda sem resultados.", search_title:"Localizar", replace_title:"Localizar/substituir", allreplaced:"Todas as substitui\u00E7\u00F5es foram efetuadas.", findwhat:"Localizar", replacewith:"Substituir com", direction:"Dire\u00E7\u00E3o", up:"Acima", down:"Abaixo", mcase:"Diferenciar mai\u00FAsculas", findnext:"Localizar pr\u00F3ximo", replace:"Substituir", replaceall:"Substituir todos" });�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/ro_dlg.js�������������������������������0000664�0000000�0000000�00000001175�12266004471�0025374�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('ro.searchreplace_dlg',{ searchnext_desc:"Caut\u0103 din nou", notfound:"C\u0103utarea a fost terminat\u0103. Nu am g\u0103sit termenul c\u0103utat.", search_title:"Caut\u0103", replace_title:"Caut\u0103/\u00EEnlocuie\u015Fte", allreplaced:"Toate instan\u0163ele termenului c\u0103utat au fost \u00EEnlocuite.", findwhat:"Termen c\u0103utat:", replacewith:"\u00CEnlocuie\u015Fte cu:", direction:"Direc\u0163ia", up:"\u00CEn sus", down:"\u00CEn jos", mcase:"Conteaz\u0103 litere mici/mari?", findnext:"Caut\u0103 urm\u0103torul", replace:"\u00CEnlocuie\u015Fte", replaceall:"\u00CEnlocuie\u015Fte toate" });���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/ru_dlg.js�������������������������������0000664�0000000�0000000�00000002404�12266004471�0025376�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('ru.searchreplace_dlg',{ searchnext_desc:"\u041D\u0430\u0439\u0442\u0438 \u0435\u0449\u0435", notfound:"\u041F\u043E\u0438\u0441\u043A \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D. \u041F\u043E\u0438\u0441\u043A\u043E\u0432\u044B\u0439 \u0440\u044F\u0434 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D", search_title:"\u041D\u0430\u0439\u0442\u0438", replace_title:"\u041D\u0430\u0439\u0442\u0438 / \u0417\u0430\u043C\u0435\u043D\u0438\u0442\u044C", allreplaced:"\u0412\u0441\u0435 \u0432\u0445\u043E\u0436\u0434\u0435\u043D\u0438\u044F \u0441\u0442\u0440\u043E\u043A\u0438 \u0431\u044B\u043B\u0438 \u0437\u0430\u043C\u0435\u043D\u0435\u043D\u044B", findwhat:"\u041D\u0430\u0439\u0442\u0438", replacewith:"\u0417\u0430\u043C\u0435\u043D\u0438\u0442\u044C \u043D\u0430", direction:"\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435", up:"\u0412\u0432\u0435\u0440\u0445 ", down:"\u0412\u043D\u0438\u0437", mcase:"\u0423\u0447\u0438\u0442\u044B\u0432\u0430\u0442\u044C \u0440\u0435\u0433\u0438\u0441\u0442\u0440", findnext:"\u041D\u0430\u0439\u0442\u0438 \u0434\u0430\u043B\u0435\u0435", replace:"\u0417\u0430\u043C\u0435\u043D\u0438\u0442\u044C", replaceall:"\u0417\u0430\u043C\u0435\u043D\u0438\u0442\u044C \u0432\u0441\u0435" });������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/sc_dlg.js�������������������������������0000664�0000000�0000000�00000001147�12266004471�0025360�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('sc.searchreplace_dlg',{ searchnext_desc:"\u518D\u6B21\u67E5\u627E", notfound:"\u67E5\u627E\u5DF2\u5B8C\u6210!\u627E\u4E0D\u5230\u4EFB\u4F55\u76EE\u6807\u3002 ", search_title:"\u67E5\u627E", replace_title:"\u67E5\u627E/\u66FF\u6362", allreplaced:"\u5DF2\u66FF\u6362\u6240\u6709\u5339\u914D\u7684\u7B26\u4E32.", findwhat:"\u67E5\u627E\u76EE\u6807", replacewith:"\u66FF\u6362\u4E3A", direction:"\u65B9\u5411", up:"\u5411\u4E0A", down:"\u5411\u4E0B", mcase:"\u5927\u5C0F\u5199\u5339\u914D", findnext:"\u4E0B\u4E00\u4E2A", replace:"\u66FF\u6362", replaceall:"\u66FF\u6362\u5168\u90E8" });�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/se_dlg.js�������������������������������0000664�0000000�0000000�00000001057�12266004471�0025362�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('se.searchreplace_dlg',{ searchnext_desc:"S\u00F6k igen", notfound:"S\u00F6kningen har slutf\u00F6rts. S\u00F6kstr\u00E4ngen kunde inte hittas.", search_title:"S\u00F6k", replace_title:"S\u00F6k/ers\u00E4tt", allreplaced:"Alla st\u00E4llen d\u00E4r s\u00F6kstr\u00E4ngen kunde hittas har ersatts.", findwhat:"Hitta vad", replacewith:"Ers\u00E4tt med", direction:"Riktning", up:"Upp\u00E5t", down:"Ner\u00E5t", mcase:"Matcha gemener/versaler", findnext:"Hitta n\u00E4sta", replace:"Ers\u00E4tt", replaceall:"Ers\u00E4tt alla" });���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/si_dlg.js�������������������������������0000664�0000000�0000000�00000000725�12266004471�0025367�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('si.searchreplace_dlg',{ searchnext_desc:"Find again", notfound:"The search has been completed. The search string could not be found.", search_title:"Find", replace_title:"Find/Replace", allreplaced:"All occurrences of the search string were replaced.", findwhat:"Find what", replacewith:"Replace with", direction:"Direction", up:"Up", down:"Down", mcase:"Match case", findnext:"Find next", replace:"Replace", replaceall:"Replace all" });�������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/sk_dlg.js�������������������������������0000664�0000000�0000000�00000001101�12266004471�0025356�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('sk.searchreplace_dlg',{ searchnext_desc:"N\u00E1jdi znova", notfound:"Vyh\u013Ead\u00E1vanie ukon\u010Den\u00E9. Re\u0165azec nemusel by\u0165 n\u00E1jden\u00FD.", search_title:"N\u00E1jdi", replace_title:"N\u00E1jdi/nahra\u010F", allreplaced:"V\u0161etky v\u00FDskyty re\u0165azca boli zmenen\u00E9.", findwhat:"N\u00E1jdi v\u00FDraz", replacewith:"Nahra\u010F s", direction:"Smer", up:"Nahor", down:"Dolu", mcase:"Presn\u00E1 zhoda", findnext:"N\u00E1jdi \u010Fal\u0161\u00ED", replace:"Nahra\u010F", replaceall:"Nahradi\u0165 v\u0161etko" });���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/sl_dlg.js�������������������������������0000664�0000000�0000000�00000000755�12266004471�0025375�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('sl.searchreplace_dlg',{ searchnext_desc:"Najdi znova", notfound:"Preiskovanje zaklju\u010Deno. Iskanega besedila nisem na\u0161el.", search_title:"Najdi", replace_title:"Najdi/zamenjaj", allreplaced:"Vse pojavitve iskanega besedila so bile zamenjane.", findwhat:"I\u0161\u010Dem za", replacewith:"Zamenjam z", direction:"Smer", up:"navzgor", down:"navzdol", mcase:"ujemanje velikosti", findnext:"Najdi nasled.", replace:"Zamenjaj", replaceall:"Zamenjaj vse" });�������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/sq_dlg.js�������������������������������0000664�0000000�0000000�00000001154�12266004471�0025374�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('sq.searchreplace_dlg',{ searchnext_desc:"K\u00EBrko p\u00EBrs\u00EBri", notfound:"K\u00EBrkimi p\u00EBrfundoi dhe nuk ktheu asnj\u00EB rezultat.", search_title:"K\u00EBrko", replace_title:"K\u00EBrko/Z\u00EBvend\u00EBso", allreplaced:"T\u00EB gjitha tekstet e gjetura u z\u00EBvend\u00EBsuan.", findwhat:"K\u00EBrko p\u00EBr", replacewith:"Z\u00EBvend\u00EBso me", direction:"Drejtimi", up:"Lart", down:"Posht\u00EB", mcase:"P\u00EBrshtat madh\u00EBsin\u00EB e g\u00EBrm\u00EBs", findnext:"K\u00EBrko tjetr\u00EBn", replace:"Z\u00EBvend\u00EBso", replaceall:"Z\u00EBv. t\u00EB gjitha" });��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/sr_dlg.js�������������������������������0000664�0000000�0000000�00000001007�12266004471�0025372�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('sr.searchreplace_dlg',{ searchnext_desc:"Prona\u0111i opet", notfound:"Pretra\u017Eivanje je zavr\u0161eno. Tra\u017Eeni tekst nije prona\u0111en.", search_title:"Prona\u0111i", replace_title:"Prona\u0111i/Zameni", allreplaced:"Sva pojavljivanja tra\u017Eenog teksta su zamenjena.", findwhat:"Prona\u0111i tekst", replacewith:"Zameni sa", direction:"Smjer", up:"Gore", down:"Dolje", mcase:"Match case", findnext:"Prona\u0111i sljede\u0107e", replace:"Zameni", replaceall:"Zameni sve" });�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/sv_dlg.js�������������������������������0000664�0000000�0000000�00000001057�12266004471�0025403�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('sv.searchreplace_dlg',{ searchnext_desc:"S\u00F6k igen", notfound:"S\u00F6kningen har slutf\u00F6rts. S\u00F6kstr\u00E4ngen kunde inte hittas.", search_title:"S\u00F6k", replace_title:"S\u00F6k/ers\u00E4tt", allreplaced:"Alla st\u00E4llen d\u00E4r s\u00F6kstr\u00E4ngen kunde hittas har ersatts.", findwhat:"Hitta vad", replacewith:"Ers\u00E4tt med", direction:"Riktning", up:"Upp\u00E5t", down:"Ner\u00E5t", mcase:"Matcha gemener/versaler", findnext:"Hitta n\u00E4sta", replace:"Ers\u00E4tt", replaceall:"Ers\u00E4tt alla" });���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/ta_dlg.js�������������������������������0000664�0000000�0000000�00000000725�12266004471�0025360�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('ta.searchreplace_dlg',{ searchnext_desc:"Find again", notfound:"The search has been completed. The search string could not be found.", search_title:"Find", replace_title:"Find/Replace", allreplaced:"All occurrences of the search string were replaced.", findwhat:"Find what", replacewith:"Replace with", direction:"Direction", up:"Up", down:"Down", mcase:"Match case", findnext:"Find next", replace:"Replace", replaceall:"Replace all" });�������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/te_dlg.js�������������������������������0000664�0000000�0000000�00000000725�12266004471�0025364�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('te.searchreplace_dlg',{ searchnext_desc:"Find again", notfound:"The search has been completed. The search string could not be found.", search_title:"Find", replace_title:"Find/Replace", allreplaced:"All occurrences of the search string were replaced.", findwhat:"Find what", replacewith:"Replace with", direction:"Direction", up:"Up", down:"Down", mcase:"Match case", findnext:"Find next", replace:"Replace", replaceall:"Replace all" });�������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/th_dlg.js�������������������������������0000664�0000000�0000000�00000002231�12266004471�0025361�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('th.searchreplace_dlg',{ searchnext_desc:"\u0E04\u0E49\u0E19\u0E2B\u0E32\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07", notfound:"\u0E01\u0E32\u0E23\u0E04\u0E49\u0E19\u0E2B\u0E32\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14 \u0E40\u0E23\u0E32\u0E44\u0E21\u0E48\u0E1E\u0E1A\u0E2D\u0E30\u0E44\u0E23\u0E40\u0E25\u0E22", search_title:"\u0E04\u0E49\u0E19\u0E2B\u0E32", replace_title:"\u0E04\u0E49\u0E19\u0E2B\u0E32/\u0E41\u0E17\u0E19\u0E17\u0E35\u0E48", allreplaced:"\u0E17\u0E38\u0E01\u0E04\u0E33\u0E17\u0E35\u0E48\u0E43\u0E2A\u0E48\u0E16\u0E39\u0E01\u0E41\u0E17\u0E19\u0E17\u0E35\u0E48\u0E41\u0E25\u0E49\u0E27", findwhat:"\u0E04\u0E49\u0E19\u0E2B\u0E32", replacewith:"\u0E41\u0E17\u0E19\u0E17\u0E35\u0E48\u0E14\u0E49\u0E27\u0E22", direction:"\u0E15\u0E33\u0E41\u0E2B\u0E19\u0E48\u0E07", up:"\u0E1A\u0E19", down:"\u0E25\u0E48\u0E32\u0E07", mcase:"\u0E40\u0E2B\u0E21\u0E37\u0E2D\u0E19\u0E17\u0E38\u0E01\u0E2D\u0E22\u0E48\u0E32\u0E07", findnext:"\u0E04\u0E49\u0E19\u0E2B\u0E32\u0E15\u0E48\u0E2D\u0E44\u0E1B", replace:"\u0E41\u0E17\u0E19\u0E17\u0E35\u0E48", replaceall:"\u0E41\u0E17\u0E19\u0E17\u0E35\u0E48\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14" });�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/tr_dlg.js�������������������������������0000664�0000000�0000000�00000000763�12266004471�0025403�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('tr.searchreplace_dlg',{ searchnext_desc:"Tekrar ara", notfound:"Arama tamamland\u0131. Aranan metin bulunamad", search_title:"Bul", replace_title:"Bul/De\u011Fi", allreplaced:"Aranan metin bulundu\u011Fu yerlerde de\u011Fi\u015Fti", findwhat:"Aranacak", replacewith:"De\u011Fi\u015Ftiril", direction:"Yt", up:"Yukar", down:"A\u015F", mcase:"B\u00FCy\u00FCk/k\u00FC\u00E7\u00FCk", findnext:"Sonrakini bul", replace:"De\u011Fi", replaceall:"T\u00FCm\u00FCn\u00FC d" });�������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/tt_dlg.js�������������������������������0000664�0000000�0000000�00000001165�12266004471�0025402�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('tt.searchreplace_dlg',{ searchnext_desc:"\u518D\u6B21\u641C\u5C0B", notfound:"\u641C\u5C0B\u5DF2\u5B8C\u6210 ! \u627E\u4E0D\u5230\u4EFB\u4F55\u76EE\u6A19\u3002 ", search_title:"\u641C\u5C0B", replace_title:"\u641C\u5C0B/\u53D6\u4EE3", allreplaced:"\u5DF2\u53D6\u4EE3\u6240\u6709\u5339\u914D\u7684\u5B57\u4E32.", findwhat:"\u641C\u5C0B\u76EE\u6A19", replacewith:"\u53D6\u4EE3\u7232", direction:"\u65B9\u5411", up:"\u5411\u4E0A", down:"\u5411\u4E0B", mcase:"\u5340\u5206\u5927\u5C0F\u5BEB", findnext:"\u641C\u5C0B\u4E0B\u4E00\u500B", replace:"\u53D6\u4EE3", replaceall:"\u5168\u90E8\u53D6\u4EE3" });�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/tw_dlg.js�������������������������������0000664�0000000�0000000�00000001146�12266004471�0025404�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('tw.searchreplace_dlg',{ searchnext_desc:"\u518D\u6B21\u5C0B\u627E", notfound:"\u5C0B\u627E\u5DF2\u5B8C\u6210!\u627E\u4E0D\u5230\u4EFB\u4F55\u76EE\u6A19\u3002", search_title:"\u5C0B\u627E", replace_title:"\u5C0B\u627E/\u53D6\u4EE3", allreplaced:"\u5DF2\u53D6\u4EE3\u6240\u6709\u7B26\u5408\u7684\u5B57\u4E32.", findwhat:"\u5C0B\u627E\u76EE\u6A19", replacewith:"\u53D6\u4EE3\u70BA", direction:"\u65B9\u5411", up:"\u5411\u4E0A", down:"\u5411\u4E0B", mcase:"\u5927\u5C0F\u5BEB\u7B26\u5408", findnext:"\u4E0B\u4E00\u500B", replace:"\u53D6\u4EE3", replaceall:"\u53D6\u4EE3\u5168\u90E8" });��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/uk_dlg.js�������������������������������0000664�0000000�0000000�00000002455�12266004471�0025375�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('uk.searchreplace_dlg',{ searchnext_desc:"\u0417\u043D\u0430\u0439\u0442\u0438 \u0449\u0435", notfound:"\u041F\u043E\u0448\u0443\u043A \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043E. \u041F\u043E\u0448\u0443\u043A\u043E\u0432\u0438\u0439 \u0440\u044F\u0434\u043E \u043D\u0435 \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E.", search_title:"\u0417\u043D\u0430\u0439\u0442\u0438", replace_title:"\u0417\u043D\u0430\u0439\u0442\u0438/\u0417\u0430\u043C\u0456\u043D\u0438\u0442\u0438", allreplaced:"\u0412\u0441\u0456 \u0432\u0445\u043E\u0434\u0436\u0435\u043D\u043D\u044F \u0440\u044F\u0434\u043A\u0430 \u0431\u0443\u043B\u0438 \u0437\u0430\u043C\u0456\u043D\u0435\u043D\u0456.", findwhat:"\u0417\u043D\u0430\u0439\u0442\u0438", replacewith:"\u0417\u0430\u043C\u0456\u043D\u0438\u0442\u0438 \u043D\u0430", direction:"\u041D\u0430\u043F\u0440\u044F\u043C", up:"\u0412\u0433\u043E\u0440\u0443", down:"\u0412\u043D\u0438\u0437", mcase:"\u0412\u0440\u0430\u0445\u043E\u0432\u0443\u0432\u0430\u0442\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440", findnext:"\u0417\u043D\u0430\u0439\u0442\u0438 \u043D\u0430\u0441\u0442\u0443\u043F\u043D\u0435", replace:"\u0417\u0430\u043C\u0456\u043D\u0438\u0442\u0438", replaceall:"\u0417\u0430\u043C\u0456\u043D\u0438\u0442\u0438 \u0432\u0441\u0435" });�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/ur_dlg.js�������������������������������0000664�0000000�0000000�00000000725�12266004471�0025402�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('ur.searchreplace_dlg',{ searchnext_desc:"Find again", notfound:"The search has been completed. The search string could not be found.", search_title:"Find", replace_title:"Find/Replace", allreplaced:"All occurrences of the search string were replaced.", findwhat:"Find what", replacewith:"Replace with", direction:"Direction", up:"Up", down:"Down", mcase:"Match case", findnext:"Find next", replace:"Replace", replaceall:"Replace all" });�������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/vi_dlg.js�������������������������������0000664�0000000�0000000�00000000725�12266004471�0025372�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('vi.searchreplace_dlg',{ searchnext_desc:"Find again", notfound:"The search has been completed. The search string could not be found.", search_title:"Find", replace_title:"Find/Replace", allreplaced:"All occurrences of the search string were replaced.", findwhat:"Find what", replacewith:"Replace with", direction:"Direction", up:"Up", down:"Down", mcase:"Match case", findnext:"Find next", replace:"Replace", replaceall:"Replace all" });�������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/zh_dlg.js�������������������������������0000664�0000000�0000000�00000001154�12266004471�0025372�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('zh.searchreplace_dlg',{ searchnext_desc:"\u518D\u6B21\u67E5\u627E", notfound:"\u67E5\u627E\u5DF2\u5B8C\u6210!\u627E\u4E0D\u5230\u4EFB\u4F55\u76EE\u6A19\u3002", search_title:"\u67E5\u627E", replace_title:"\u67E5\u627E/\u66FF\u63DB", allreplaced:"\u5DF2\u66FF\u63DB\u6240\u6709\u7B26\u5408\u7684\u5B57\u7B26\u4E32.", findwhat:"\u67E5\u627E\u76EE\u6A19", replacewith:"\u66FF\u63DB\u70BA", direction:"\u65B9\u5411", up:"\u5411\u4E0A", down:"\u5411\u4E0B", mcase:"\u5927\u5C0F\u5BEB\u7B26\u5408", findnext:"\u4E0B\u4E00\u500B", replace:"\u66FF\u63DB", replaceall:"\u66FF\u63DB\u5168\u90E8" });��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/langs/zu_dlg.js�������������������������������0000664�0000000�0000000�00000001160�12266004471�0025404�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tinyMCE.addI18n('zu.searchreplace_dlg',{ searchnext_desc:"\u518D\u6B21\u67E5\u627E", notfound:"\u67E5\u627E\u5DF2\u5B8C\u6210\uFF01\u627E\u4E0D\u5230\u4EFB\u4F55\u76EE\u6807\u3002", search_title:"\u67E5\u627E", replace_title:"\u67E5\u627E/\u66FF\u6362", allreplaced:"\u5DF2\u66FF\u6362\u6240\u6709\u5339\u914D\u7684\u7B26\u4E32\u3002", findwhat:"\u67E5\u627E\u76EE\u6807", replacewith:"\u66FF\u6362\u4E3A", direction:"\u65B9\u5411", up:"\u5411\u4E0A", down:"\u5411\u4E0B", mcase:"\u5927\u5C0F\u5199\u5339\u914D", findnext:"\u4E0B\u4E00\u4E2A", replace:"\u66FF\u6362", replaceall:"\u66FF\u6362\u5168\u90E8" });����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/searchreplace/searchreplace.htm�����������������������������0000664�0000000�0000000�00000012326�12266004471�0025777�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>{#searchreplace_dlg.replace_title}
    glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/000077500000000000000000000000001226600447100207465ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/cell.htm000066400000000000000000000161741226600447100224100ustar00rootroot00000000000000 {#table_dlg.cell_title}
    {#table_dlg.general_props}
    {#table_dlg.advanced_props}
     
     
     
    glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/css/000077500000000000000000000000001226600447100215365ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/css/cell.css000066400000000000000000000003151226600447100231660ustar00rootroot00000000000000/* CSS file for cell dialog in the table plugin */ .panel_wrapper div.current { height: 200px; } .advfield { width: 200px; } #action { margin-bottom: 3px; } #class { width: 150px; }glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/css/row.css000066400000000000000000000004621226600447100230610ustar00rootroot00000000000000/* CSS file for row dialog in the table plugin */ .panel_wrapper div.current { height: 200px; } .advfield { width: 200px; } #action { margin-bottom: 3px; } #rowtype,#align,#valign,#class,#height { width: 150px; } #height { width: 50px; } .col2 { padding-left: 20px; } glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/css/table.css000066400000000000000000000002521226600447100233360ustar00rootroot00000000000000/* CSS file for table dialog in the table plugin */ .panel_wrapper div.current { height: 245px; } .advfield { width: 200px; } #class { width: 150px; } glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/editor_plugin.js000066400000000000000000000423431226600447100241560ustar00rootroot00000000000000(function(d){var e=d.each;function c(g,h){var j=h.ownerDocument,f=j.createRange(),k;f.setStartBefore(h);f.setEnd(g.endContainer,g.endOffset);k=j.createElement("body");k.appendChild(f.cloneContents());return k.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length==0}function a(g,f){return parseInt(g.getAttribute(f)||1)}function b(H,G,K){var g,L,D,o;t();o=G.getParent(K.getStart(),"th,td");if(o){L=F(o);D=I();o=z(L.x,L.y)}function A(N,M){N=N.cloneNode(M);N.removeAttribute("id");return N}function t(){var M=0;g=[];e(["thead","tbody","tfoot"],function(N){var O=G.select("> "+N+" tr",H);e(O,function(P,Q){Q+=M;e(G.select("> td, > th",P),function(W,R){var S,T,U,V;if(g[Q]){while(g[Q][R]){R++}}U=a(W,"rowspan");V=a(W,"colspan");for(T=Q;T'}return false}},"childNodes");M=A(M,false);s(M,"rowSpan",1);s(M,"colSpan",1);if(N){M.appendChild(N)}else{if(!d.isIE){M.innerHTML='
    '}}return M}function q(){var M=G.createRng();e(G.select("tr",H),function(N){if(N.cells.length==0){G.remove(N)}});if(G.select("tr",H).length==0){M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H);return}e(G.select("thead,tbody,tfoot",H),function(N){if(N.rows.length==0){G.remove(N)}});t();row=g[Math.min(g.length-1,L.y)];if(row){K.select(row[Math.min(row.length-1,L.x)].elm,true);K.collapse(true)}}function u(S,Q,U,R){var P,N,M,O,T;P=g[Q][S].elm.parentNode;for(M=1;M<=U;M++){P=G.getNext(P,"tr");if(P){for(N=S;N>=0;N--){T=g[Q+M][N].elm;if(T.parentNode==P){for(O=1;O<=R;O++){G.insertAfter(f(T),T)}break}}if(N==-1){for(O=1;O<=R;O++){P.insertBefore(f(P.cells[0]),P.cells[0])}}}}}function C(){e(g,function(M,N){e(M,function(P,O){var S,R,T,Q;if(j(P)){P=P.elm;S=a(P,"colspan");R=a(P,"rowspan");if(S>1||R>1){s(P,"rowSpan",1);s(P,"colSpan",1);for(Q=0;Q1){s(S,"rowSpan",O+1);continue}}else{if(M>0&&g[M-1][R]){V=g[M-1][R].elm;O=a(V,"rowSpan");if(O>1){s(V,"rowSpan",O+1);continue}}}N=f(S);s(N,"colSpan",S.colSpan);U.appendChild(N);P=S}}if(U.hasChildNodes()){if(!Q){G.insertAfter(U,T)}else{T.parentNode.insertBefore(U,T)}}}function h(N){var O,M;e(g,function(P,Q){e(P,function(S,R){if(j(S)){O=R;if(N){return false}}});if(N){return !O}});e(g,function(S,T){var P,Q,R;if(!S[O]){return}P=S[O].elm;if(P!=M){R=a(P,"colspan");Q=a(P,"rowspan");if(R==1){if(!N){G.insertAfter(f(P),P);u(O,T,Q-1,R)}else{P.parentNode.insertBefore(f(P),P);u(O,T,Q-1,R)}}else{s(P,"colSpan",P.colSpan+1)}M=P}})}function n(){var M=[];e(g,function(N,O){e(N,function(Q,P){if(j(Q)&&d.inArray(M,P)===-1){e(g,function(T){var R=T[P].elm,S;S=a(R,"colSpan");if(S>1){s(R,"colSpan",S-1)}else{G.remove(R)}});M.push(P)}})});q()}function m(){var N;function M(Q){var P,R,O;P=G.getNext(Q,"tr");e(Q.cells,function(S){var T=a(S,"rowSpan");if(T>1){s(S,"rowSpan",T-1);R=F(S);u(R.x,R.y,1,1)}});R=F(Q.cells[0]);e(g[R.y],function(S){var T;S=S.elm;if(S!=O){T=a(S,"rowSpan");if(T<=1){G.remove(S)}else{s(S,"rowSpan",T-1)}O=S}})}N=k();e(N.reverse(),function(O){M(O)});q()}function E(){var M=k();G.remove(M);q();return M}function J(){var M=k();e(M,function(O,N){M[N]=A(O,true)});return M}function B(O,N){if(!O){return}var P=k(),M=P[N?0:P.length-1],Q=M.cells.length;e(g,function(S){var R;Q=0;e(S,function(U,T){if(U.real){Q+=U.colspan}if(U.elm.parentNode==M){R=1}});if(R){return false}});if(!N){O.reverse()}e(O,function(T){var S=T.cells.length,R;for(i=0;iN){N=R}if(Q>M){M=Q}if(S.real){U=S.colspan-1;T=S.rowspan-1;if(U){if(R+U>N){N=R+U}}if(T){if(Q+T>M){M=Q+T}}}}})});return{x:N,y:M}}function v(S){var P,O,U,T,N,M,Q,R;D=F(S);if(L&&D){P=Math.min(L.x,D.x);O=Math.min(L.y,D.y);U=Math.max(L.x,D.x);T=Math.max(L.y,D.y);N=U;M=T;for(y=O;y<=M;y++){S=g[y][P];if(!S.real){if(P-(S.colspan-1)N){N=x+Q}}if(R){if(y+R>M){M=y+R}}}}}G.removeClass(G.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=O;y<=M;y++){for(x=P;x<=N;x++){if(g[y][x]){G.addClass(g[y][x].elm,"mceSelected")}}}}}d.extend(this,{deleteTable:r,split:C,merge:p,insertRow:l,insertCol:h,deleteCols:n,deleteRows:m,cutRows:E,copyRows:J,pasteRows:B,getPos:F,setStartCell:w,setEndCell:v})}d.create("tinymce.plugins.TablePlugin",{init:function(g,h){var f,m,j=true;function l(p){var o=g.selection,n=g.dom.getParent(p||o.getNode(),"table");if(n){return new b(n,g.dom,o)}}function k(){g.getBody().style.webkitUserSelect="";if(j){g.dom.removeClass(g.dom.select("td.mceSelected,th.mceSelected"),"mceSelected");j=false}}e([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(n){g.addButton(n[0],{title:n[1],cmd:n[2],ui:n[3]})});if(!d.isIE){g.onClick.add(function(n,o){o=o.target;if(o.nodeName==="TABLE"){n.selection.select(o);n.nodeChanged()}})}g.onPreProcess.add(function(o,p){var n,q,r,t=o.dom,s;n=t.select("table",p.node);q=n.length;while(q--){r=n[q];t.setAttrib(r,"data-mce-style","");if((s=t.getAttrib(r,"width"))){t.setStyle(r,"width",s);t.setAttrib(r,"width","")}if((s=t.getAttrib(r,"height"))){t.setStyle(r,"height",s);t.setAttrib(r,"height","")}}});g.onNodeChange.add(function(q,o,s){var r;s=q.selection.getStart();r=q.dom.getParent(s,"td,th,caption");o.setActive("table",s.nodeName==="TABLE"||!!r);if(r&&r.nodeName==="CAPTION"){r=0}o.setDisabled("delete_table",!r);o.setDisabled("delete_col",!r);o.setDisabled("delete_table",!r);o.setDisabled("delete_row",!r);o.setDisabled("col_after",!r);o.setDisabled("col_before",!r);o.setDisabled("row_after",!r);o.setDisabled("row_before",!r);o.setDisabled("row_props",!r);o.setDisabled("cell_props",!r);o.setDisabled("split_cells",!r);o.setDisabled("merge_cells",!r)});g.onInit.add(function(r){var p,t,q=r.dom,u;f=r.windowManager;r.onMouseDown.add(function(w,z){if(z.button!=2){k();t=q.getParent(z.target,"td,th");p=q.getParent(t,"table")}});q.bind(r.getDoc(),"mouseover",function(C){var A,z,B=C.target;if(t&&(u||B!=t)&&(B.nodeName=="TD"||B.nodeName=="TH")){z=q.getParent(B,"table");if(z==p){if(!u){u=l(z);u.setStartCell(t);r.getBody().style.webkitUserSelect="none"}u.setEndCell(B);j=true}A=r.selection.getSel();try{if(A.removeAllRanges){A.removeAllRanges()}else{A.empty()}}catch(w){}C.preventDefault()}});r.onMouseUp.add(function(F,G){var z,B=F.selection,H,I=B.getSel(),w,C,A,E;if(t){if(u){F.getBody().style.webkitUserSelect=""}function D(J,L){var K=new d.dom.TreeWalker(J,J);do{if(J.nodeType==3&&d.trim(J.nodeValue).length!=0){if(L){z.setStart(J,0)}else{z.setEnd(J,J.nodeValue.length)}return}if(J.nodeName=="BR"){if(L){z.setStartBefore(J)}else{z.setEndBefore(J)}return}}while(J=(L?K.next():K.prev()))}H=q.select("td.mceSelected,th.mceSelected");if(H.length>0){z=q.createRng();C=H[0];E=H[H.length-1];z.setStartBefore(C);z.setEndAfter(C);D(C,1);w=new d.dom.TreeWalker(C,q.getParent(H[0],"table"));do{if(C.nodeName=="TD"||C.nodeName=="TH"){if(!q.hasClass(C,"mceSelected")){break}A=C}}while(C=w.next());D(A);B.setRng(z)}F.nodeChanged();t=u=p=null}});r.onKeyUp.add(function(w,z){k()});r.onKeyDown.add(function(w,z){n(w)});r.onMouseDown.add(function(w,z){if(z.button!=2){n(w)}});function o(D,z,A,F){var B=3,G=D.dom.getParent(z.startContainer,"TABLE"),C,w,E;if(G){C=G.parentNode}w=z.startContainer.nodeType==B&&z.startOffset==0&&z.endOffset==0&&F&&(A.nodeName=="TR"||A==C);E=(A.nodeName=="TD"||A.nodeName=="TH")&&!F;return w||E}function n(A){if(!d.isWebKit){return}var z=A.selection.getRng();var C=A.selection.getNode();var B=A.dom.getParent(z.startContainer,"TD,TH");if(!o(A,z,C,B)){return}if(!B){B=C}var w=B.lastChild;while(w.lastChild){w=w.lastChild}z.setEnd(w,w.nodeValue.length);A.selection.setRng(z)}r.plugins.table.fixTableCellSelection=n;if(r&&r.plugins.contextmenu){r.plugins.contextmenu.onContextMenu.add(function(A,w,C){var D,B=r.selection,z=B.getNode()||r.getBody();if(r.dom.getParent(C,"td")||r.dom.getParent(C,"th")||r.dom.select("td.mceSelected,th.mceSelected").length){w.removeAll();if(z.nodeName=="A"&&!r.dom.getAttrib(z,"name")){w.add({title:"advanced.link_desc",icon:"link",cmd:r.plugins.advlink?"mceAdvLink":"mceLink",ui:true});w.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});w.addSeparator()}if(z.nodeName=="IMG"&&z.className.indexOf("mceItem")==-1){w.add({title:"advanced.image_desc",icon:"image",cmd:r.plugins.advimage?"mceAdvImage":"mceImage",ui:true});w.addSeparator()}w.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}});w.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"});w.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"});w.addSeparator();D=w.addMenu({title:"table.cell"});D.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"});D.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells"});D.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"});D=w.addMenu({title:"table.row"});D.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"});D.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});D.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});D.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});D.addSeparator();D.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});D.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});D.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!m);D.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!m);D=w.addMenu({title:"table.col"});D.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});D.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});D.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{w.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})}})}if(d.isWebKit){function v(C,N){var L=d.VK;var Q=N.keyCode;function O(Y,U,S){var T=Y?"previousSibling":"nextSibling";var Z=C.dom.getParent(U,"tr");var X=Z[T];if(X){z(C,U,X,Y);d.dom.Event.cancel(S);return true}else{var aa=C.dom.getParent(Z,"table");var W=Z.parentNode;var R=W.nodeName.toLowerCase();if(R==="tbody"||R===(Y?"tfoot":"thead")){var V=w(Y,aa,W,"tbody");if(V!==null){return K(Y,V,U,S)}}return M(Y,Z,T,aa,S)}}function w(V,T,U,X){var S=C.dom.select(">"+X,T);var R=S.indexOf(U);if(V&&R===0||!V&&R===S.length-1){return B(V,T)}else{if(R===-1){var W=U.tagName.toLowerCase()==="thead"?0:S.length-1;return S[W]}else{return S[R+(V?-1:1)]}}}function B(U,T){var S=U?"thead":"tfoot";var R=C.dom.select(">"+S,T);return R.length!==0?R[0]:null}function K(V,T,S,U){var R=J(T,V);R&&z(C,S,R,V);d.dom.Event.cancel(U);return true}function M(Y,U,R,X,W){var S=X[R];if(S){F(S);return true}else{var V=C.dom.getParent(X,"td,th");if(V){return O(Y,V,W)}else{var T=J(U,!Y);F(T);return d.dom.Event.cancel(W)}}}function J(S,R){var T=S&&S[R?"lastChild":"firstChild"];return T&&T.nodeName==="BR"?C.dom.getParent(T,"td,th"):T}function F(R){C.selection.setCursorLocation(R,0)}function A(){return Q==L.UP||Q==L.DOWN}function D(R){var T=R.selection.getNode();var S=R.dom.getParent(T,"tr");return S!==null}function P(S){var R=0;var T=S;while(T.previousSibling){T=T.previousSibling;R=R+a(T,"colspan")}return R}function E(T,R){var U=0;var S=0;e(T.children,function(V,W){U=U+a(V,"colspan");S=W;if(U>R){return false}});return S}function z(T,W,Y,V){var X=P(T.dom.getParent(W,"td,th"));var S=E(Y,X);var R=Y.childNodes[S];var U=J(R,V);F(U||R)}function H(R){var T=C.selection.getNode();var U=C.dom.getParent(T,"td,th");var S=C.dom.getParent(R,"td,th");return U&&U!==S&&I(U,S)}function I(S,R){return C.dom.getParent(S,"TABLE")===C.dom.getParent(R,"TABLE")}if(A()&&D(C)){var G=C.selection.getNode();setTimeout(function(){if(H(G)){O(!N.shiftKey&&Q===L.UP,G,N)}},0)}}r.onKeyDown.add(v)}function s(){var w;for(w=r.getBody().lastChild;w&&w.nodeType==3&&!w.nodeValue.length;w=w.previousSibling){}if(w&&w.nodeName=="TABLE"){if(r.settings.forced_root_block){r.dom.add(r.getBody(),r.settings.forced_root_block,null,d.isIE?" ":'
    ')}else{r.dom.add(r.getBody(),"br",{"data-mce-bogus":"1"})}}}if(d.isGecko){r.onKeyDown.add(function(z,B){var w,A,C=z.dom;if(B.keyCode==37||B.keyCode==38){w=z.selection.getRng();A=C.getParent(w.startContainer,"table");if(A&&z.getBody().firstChild==A){if(c(w,A)){w=C.createRng();w.setStartBefore(A);w.setEndBefore(A);z.selection.setRng(w);B.preventDefault()}}}})}r.onKeyUp.add(s);r.onSetContent.add(s);r.onVisualAid.add(s);r.onPreProcess.add(function(w,A){var z=A.node.lastChild;if(z&&(z.nodeName=="BR"||(z.childNodes.length==1&&(z.firstChild.nodeName=="BR"||z.firstChild.nodeValue=="\u00a0")))&&z.previousSibling&&z.previousSibling.nodeName=="TABLE"){w.dom.remove(z)}});s();r.startContent=r.getContent({format:"raw"})});e({mceTableSplitCells:function(n){n.split()},mceTableMergeCells:function(o){var p,q,n;n=g.dom.getParent(g.selection.getNode(),"th,td");if(n){p=n.rowSpan;q=n.colSpan}if(!g.dom.select("td.mceSelected,th.mceSelected").length){f.open({url:h+"/merge_cells.htm",width:240+parseInt(g.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(g.getLang("table.merge_cells_delta_height",0)),inline:1},{rows:p,cols:q,onaction:function(r){o.merge(n,r.cols,r.rows)},plugin_url:h})}else{o.merge()}},mceTableInsertRowBefore:function(n){n.insertRow(true)},mceTableInsertRowAfter:function(n){n.insertRow()},mceTableInsertColBefore:function(n){n.insertCol(true)},mceTableInsertColAfter:function(n){n.insertCol()},mceTableDeleteCol:function(n){n.deleteCols()},mceTableDeleteRow:function(n){n.deleteRows()},mceTableCutRow:function(n){m=n.cutRows()},mceTableCopyRow:function(n){m=n.copyRows()},mceTablePasteRowBefore:function(n){n.pasteRows(m,true)},mceTablePasteRowAfter:function(n){n.pasteRows(m)},mceTableDelete:function(n){n.deleteTable()}},function(o,n){g.addCommand(n,function(){var p=l();if(p){o(p);g.execCommand("mceRepaint");k()}})});e({mceInsertTable:function(n){f.open({url:h+"/table.htm",width:400+parseInt(g.getLang("table.table_delta_width",0)),height:320+parseInt(g.getLang("table.table_delta_height",0)),inline:1},{plugin_url:h,action:n?n.action:0})},mceTableRowProps:function(){f.open({url:h+"/row.htm",width:400+parseInt(g.getLang("table.rowprops_delta_width",0)),height:295+parseInt(g.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:h})},mceTableCellProps:function(){f.open({url:h+"/cell.htm",width:400+parseInt(g.getLang("table.cellprops_delta_width",0)),height:295+parseInt(g.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:h})}},function(o,n){g.addCommand(n,function(p,q){o(q)})})}});d.PluginManager.add("table",d.plugins.TablePlugin)})(tinymce);glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/editor_plugin_src.js000066400000000000000000001147531226600447100250320ustar00rootroot00000000000000/** * editor_plugin_src.js * * Copyright 2009, Moxiecode Systems AB * Released under LGPL License. * * License: http://tinymce.moxiecode.com/license * Contributing: http://tinymce.moxiecode.com/contributing */ (function(tinymce) { var each = tinymce.each; // Checks if the selection/caret is at the start of the specified block element function isAtStart(rng, par) { var doc = par.ownerDocument, rng2 = doc.createRange(), elm; rng2.setStartBefore(par); rng2.setEnd(rng.endContainer, rng.endOffset); elm = doc.createElement('body'); elm.appendChild(rng2.cloneContents()); // Check for text characters of other elements that should be treated as content return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length == 0; }; function getSpanVal(td, name) { return parseInt(td.getAttribute(name) || 1); } /** * Table Grid class. */ function TableGrid(table, dom, selection) { var grid, startPos, endPos, selectedCell; buildGrid(); selectedCell = dom.getParent(selection.getStart(), 'th,td'); if (selectedCell) { startPos = getPos(selectedCell); endPos = findEndPos(); selectedCell = getCell(startPos.x, startPos.y); } function cloneNode(node, children) { node = node.cloneNode(children); node.removeAttribute('id'); return node; } function buildGrid() { var startY = 0; grid = []; each(['thead', 'tbody', 'tfoot'], function(part) { var rows = dom.select('> ' + part + ' tr', table); each(rows, function(tr, y) { y += startY; each(dom.select('> td, > th', tr), function(td, x) { var x2, y2, rowspan, colspan; // Skip over existing cells produced by rowspan if (grid[y]) { while (grid[y][x]) x++; } // Get col/rowspan from cell rowspan = getSpanVal(td, 'rowspan'); colspan = getSpanVal(td, 'colspan'); // Fill out rowspan/colspan right and down for (y2 = y; y2 < y + rowspan; y2++) { if (!grid[y2]) grid[y2] = []; for (x2 = x; x2 < x + colspan; x2++) { grid[y2][x2] = { part : part, real : y2 == y && x2 == x, elm : td, rowspan : rowspan, colspan : colspan }; } } }); }); startY += rows.length; }); }; function getCell(x, y) { var row; row = grid[y]; if (row) return row[x]; }; function setSpanVal(td, name, val) { if (td) { val = parseInt(val); if (val === 1) td.removeAttribute(name, 1); else td.setAttribute(name, val, 1); } } function isCellSelected(cell) { return cell && (dom.hasClass(cell.elm, 'mceSelected') || cell == selectedCell); }; function getSelectedRows() { var rows = []; each(table.rows, function(row) { each(row.cells, function(cell) { if (dom.hasClass(cell, 'mceSelected') || cell == selectedCell.elm) { rows.push(row); return false; } }); }); return rows; }; function deleteTable() { var rng = dom.createRng(); rng.setStartAfter(table); rng.setEndAfter(table); selection.setRng(rng); dom.remove(table); }; function cloneCell(cell) { var formatNode; // Clone formats tinymce.walk(cell, function(node) { var curNode; if (node.nodeType == 3) { each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) { node = cloneNode(node, false); if (!formatNode) formatNode = curNode = node; else if (curNode) curNode.appendChild(node); curNode = node; }); // Add something to the inner node if (curNode) curNode.innerHTML = tinymce.isIE ? ' ' : '
    '; return false; } }, 'childNodes'); cell = cloneNode(cell, false); setSpanVal(cell, 'rowSpan', 1); setSpanVal(cell, 'colSpan', 1); if (formatNode) { cell.appendChild(formatNode); } else { if (!tinymce.isIE) cell.innerHTML = '
    '; } return cell; }; function cleanup() { var rng = dom.createRng(); // Empty rows each(dom.select('tr', table), function(tr) { if (tr.cells.length == 0) dom.remove(tr); }); // Empty table if (dom.select('tr', table).length == 0) { rng.setStartAfter(table); rng.setEndAfter(table); selection.setRng(rng); dom.remove(table); return; } // Empty header/body/footer each(dom.select('thead,tbody,tfoot', table), function(part) { if (part.rows.length == 0) dom.remove(part); }); // Restore selection to start position if it still exists buildGrid(); // Restore the selection to the closest table position row = grid[Math.min(grid.length - 1, startPos.y)]; if (row) { selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true); selection.collapse(true); } }; function fillLeftDown(x, y, rows, cols) { var tr, x2, r, c, cell; tr = grid[y][x].elm.parentNode; for (r = 1; r <= rows; r++) { tr = dom.getNext(tr, 'tr'); if (tr) { // Loop left to find real cell for (x2 = x; x2 >= 0; x2--) { cell = grid[y + r][x2].elm; if (cell.parentNode == tr) { // Append clones after for (c = 1; c <= cols; c++) dom.insertAfter(cloneCell(cell), cell); break; } } if (x2 == -1) { // Insert nodes before first cell for (c = 1; c <= cols; c++) tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]); } } } }; function split() { each(grid, function(row, y) { each(row, function(cell, x) { var colSpan, rowSpan, newCell, i; if (isCellSelected(cell)) { cell = cell.elm; colSpan = getSpanVal(cell, 'colspan'); rowSpan = getSpanVal(cell, 'rowspan'); if (colSpan > 1 || rowSpan > 1) { setSpanVal(cell, 'rowSpan', 1); setSpanVal(cell, 'colSpan', 1); // Insert cells right for (i = 0; i < colSpan - 1; i++) dom.insertAfter(cloneCell(cell), cell); fillLeftDown(x, y, rowSpan - 1, colSpan); } } }); }); }; function merge(cell, cols, rows) { var startX, startY, endX, endY, x, y, startCell, endCell, cell, children, count; // Use specified cell and cols/rows if (cell) { pos = getPos(cell); startX = pos.x; startY = pos.y; endX = startX + (cols - 1); endY = startY + (rows - 1); } else { startPos = endPos = null; // Calculate start/end pos by checking for selected cells in grid works better with context menu each(grid, function(row, y) { each(row, function(cell, x) { if (isCellSelected(cell)) { if (!startPos) { startPos = {x: x, y: y}; } endPos = {x: x, y: y}; } }); }); // Use selection startX = startPos.x; startY = startPos.y; endX = endPos.x; endY = endPos.y; } // Find start/end cells startCell = getCell(startX, startY); endCell = getCell(endX, endY); // Check if the cells exists and if they are of the same part for example tbody = tbody if (startCell && endCell && startCell.part == endCell.part) { // Split and rebuild grid split(); buildGrid(); // Set row/col span to start cell startCell = getCell(startX, startY).elm; setSpanVal(startCell, 'colSpan', (endX - startX) + 1); setSpanVal(startCell, 'rowSpan', (endY - startY) + 1); // Remove other cells and add it's contents to the start cell for (y = startY; y <= endY; y++) { for (x = startX; x <= endX; x++) { if (!grid[y] || !grid[y][x]) continue; cell = grid[y][x].elm; if (cell != startCell) { // Move children to startCell children = tinymce.grep(cell.childNodes); each(children, function(node) { startCell.appendChild(node); }); // Remove bogus nodes if there is children in the target cell if (children.length) { children = tinymce.grep(startCell.childNodes); count = 0; each(children, function(node) { if (node.nodeName == 'BR' && dom.getAttrib(node, 'data-mce-bogus') && count++ < children.length - 1) startCell.removeChild(node); }); } // Remove cell dom.remove(cell); } } } // Remove empty rows etc and restore caret location cleanup(); } }; function insertRow(before) { var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell, rowSpan; // Find first/last row each(grid, function(row, y) { each(row, function(cell, x) { if (isCellSelected(cell)) { cell = cell.elm; rowElm = cell.parentNode; newRow = cloneNode(rowElm, false); posY = y; if (before) return false; } }); if (before) return !posY; }); for (x = 0; x < grid[0].length; x++) { // Cell not found could be because of an invalid table structure if (!grid[posY][x]) continue; cell = grid[posY][x].elm; if (cell != lastCell) { if (!before) { rowSpan = getSpanVal(cell, 'rowspan'); if (rowSpan > 1) { setSpanVal(cell, 'rowSpan', rowSpan + 1); continue; } } else { // Check if cell above can be expanded if (posY > 0 && grid[posY - 1][x]) { otherCell = grid[posY - 1][x].elm; rowSpan = getSpanVal(otherCell, 'rowSpan'); if (rowSpan > 1) { setSpanVal(otherCell, 'rowSpan', rowSpan + 1); continue; } } } // Insert new cell into new row newCell = cloneCell(cell); setSpanVal(newCell, 'colSpan', cell.colSpan); newRow.appendChild(newCell); lastCell = cell; } } if (newRow.hasChildNodes()) { if (!before) dom.insertAfter(newRow, rowElm); else rowElm.parentNode.insertBefore(newRow, rowElm); } }; function insertCol(before) { var posX, lastCell; // Find first/last column each(grid, function(row, y) { each(row, function(cell, x) { if (isCellSelected(cell)) { posX = x; if (before) return false; } }); if (before) return !posX; }); each(grid, function(row, y) { var cell, rowSpan, colSpan; if (!row[posX]) return; cell = row[posX].elm; if (cell != lastCell) { colSpan = getSpanVal(cell, 'colspan'); rowSpan = getSpanVal(cell, 'rowspan'); if (colSpan == 1) { if (!before) { dom.insertAfter(cloneCell(cell), cell); fillLeftDown(posX, y, rowSpan - 1, colSpan); } else { cell.parentNode.insertBefore(cloneCell(cell), cell); fillLeftDown(posX, y, rowSpan - 1, colSpan); } } else setSpanVal(cell, 'colSpan', cell.colSpan + 1); lastCell = cell; } }); }; function deleteCols() { var cols = []; // Get selected column indexes each(grid, function(row, y) { each(row, function(cell, x) { if (isCellSelected(cell) && tinymce.inArray(cols, x) === -1) { each(grid, function(row) { var cell = row[x].elm, colSpan; colSpan = getSpanVal(cell, 'colSpan'); if (colSpan > 1) setSpanVal(cell, 'colSpan', colSpan - 1); else dom.remove(cell); }); cols.push(x); } }); }); cleanup(); }; function deleteRows() { var rows; function deleteRow(tr) { var nextTr, pos, lastCell; nextTr = dom.getNext(tr, 'tr'); // Move down row spanned cells each(tr.cells, function(cell) { var rowSpan = getSpanVal(cell, 'rowSpan'); if (rowSpan > 1) { setSpanVal(cell, 'rowSpan', rowSpan - 1); pos = getPos(cell); fillLeftDown(pos.x, pos.y, 1, 1); } }); // Delete cells pos = getPos(tr.cells[0]); each(grid[pos.y], function(cell) { var rowSpan; cell = cell.elm; if (cell != lastCell) { rowSpan = getSpanVal(cell, 'rowSpan'); if (rowSpan <= 1) dom.remove(cell); else setSpanVal(cell, 'rowSpan', rowSpan - 1); lastCell = cell; } }); }; // Get selected rows and move selection out of scope rows = getSelectedRows(); // Delete all selected rows each(rows.reverse(), function(tr) { deleteRow(tr); }); cleanup(); }; function cutRows() { var rows = getSelectedRows(); dom.remove(rows); cleanup(); return rows; }; function copyRows() { var rows = getSelectedRows(); each(rows, function(row, i) { rows[i] = cloneNode(row, true); }); return rows; }; function pasteRows(rows, before) { // If we don't have any rows in the clipboard, return immediately if(!rows) return; var selectedRows = getSelectedRows(), targetRow = selectedRows[before ? 0 : selectedRows.length - 1], targetCellCount = targetRow.cells.length; // Calc target cell count each(grid, function(row) { var match; targetCellCount = 0; each(row, function(cell, x) { if (cell.real) targetCellCount += cell.colspan; if (cell.elm.parentNode == targetRow) match = 1; }); if (match) return false; }); if (!before) rows.reverse(); each(rows, function(row) { var cellCount = row.cells.length, cell; // Remove col/rowspans for (i = 0; i < cellCount; i++) { cell = row.cells[i]; setSpanVal(cell, 'colSpan', 1); setSpanVal(cell, 'rowSpan', 1); } // Needs more cells for (i = cellCount; i < targetCellCount; i++) row.appendChild(cloneCell(row.cells[cellCount - 1])); // Needs less cells for (i = targetCellCount; i < cellCount; i++) dom.remove(row.cells[i]); // Add before/after if (before) targetRow.parentNode.insertBefore(row, targetRow); else dom.insertAfter(row, targetRow); }); // Remove current selection dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); }; function getPos(target) { var pos; each(grid, function(row, y) { each(row, function(cell, x) { if (cell.elm == target) { pos = {x : x, y : y}; return false; } }); return !pos; }); return pos; }; function setStartCell(cell) { startPos = getPos(cell); }; function findEndPos() { var pos, maxX, maxY; maxX = maxY = 0; each(grid, function(row, y) { each(row, function(cell, x) { var colSpan, rowSpan; if (isCellSelected(cell)) { cell = grid[y][x]; if (x > maxX) maxX = x; if (y > maxY) maxY = y; if (cell.real) { colSpan = cell.colspan - 1; rowSpan = cell.rowspan - 1; if (colSpan) { if (x + colSpan > maxX) maxX = x + colSpan; } if (rowSpan) { if (y + rowSpan > maxY) maxY = y + rowSpan; } } } }); }); return {x : maxX, y : maxY}; }; function setEndCell(cell) { var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan; endPos = getPos(cell); if (startPos && endPos) { // Get start/end positions startX = Math.min(startPos.x, endPos.x); startY = Math.min(startPos.y, endPos.y); endX = Math.max(startPos.x, endPos.x); endY = Math.max(startPos.y, endPos.y); // Expand end positon to include spans maxX = endX; maxY = endY; // Expand startX for (y = startY; y <= maxY; y++) { cell = grid[y][startX]; if (!cell.real) { if (startX - (cell.colspan - 1) < startX) startX -= cell.colspan - 1; } } // Expand startY for (x = startX; x <= maxX; x++) { cell = grid[startY][x]; if (!cell.real) { if (startY - (cell.rowspan - 1) < startY) startY -= cell.rowspan - 1; } } // Find max X, Y for (y = startY; y <= endY; y++) { for (x = startX; x <= endX; x++) { cell = grid[y][x]; if (cell.real) { colSpan = cell.colspan - 1; rowSpan = cell.rowspan - 1; if (colSpan) { if (x + colSpan > maxX) maxX = x + colSpan; } if (rowSpan) { if (y + rowSpan > maxY) maxY = y + rowSpan; } } } } // Remove current selection dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); // Add new selection for (y = startY; y <= maxY; y++) { for (x = startX; x <= maxX; x++) { if (grid[y][x]) dom.addClass(grid[y][x].elm, 'mceSelected'); } } } }; // Expose to public tinymce.extend(this, { deleteTable : deleteTable, split : split, merge : merge, insertRow : insertRow, insertCol : insertCol, deleteCols : deleteCols, deleteRows : deleteRows, cutRows : cutRows, copyRows : copyRows, pasteRows : pasteRows, getPos : getPos, setStartCell : setStartCell, setEndCell : setEndCell }); }; tinymce.create('tinymce.plugins.TablePlugin', { init : function(ed, url) { var winMan, clipboardRows, hasCellSelection = true; // Might be selected cells on reload function createTableGrid(node) { var selection = ed.selection, tblElm = ed.dom.getParent(node || selection.getNode(), 'table'); if (tblElm) return new TableGrid(tblElm, ed.dom, selection); }; function cleanup() { // Restore selection possibilities ed.getBody().style.webkitUserSelect = ''; if (hasCellSelection) { ed.dom.removeClass(ed.dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); hasCellSelection = false; } }; // Register buttons each([ ['table', 'table.desc', 'mceInsertTable', true], ['delete_table', 'table.del', 'mceTableDelete'], ['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'], ['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'], ['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'], ['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'], ['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'], ['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'], ['row_props', 'table.row_desc', 'mceTableRowProps', true], ['cell_props', 'table.cell_desc', 'mceTableCellProps', true], ['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true], ['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true] ], function(c) { ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]}); }); // Select whole table is a table border is clicked if (!tinymce.isIE) { ed.onClick.add(function(ed, e) { e = e.target; if (e.nodeName === 'TABLE') { ed.selection.select(e); ed.nodeChanged(); } }); } ed.onPreProcess.add(function(ed, args) { var nodes, i, node, dom = ed.dom, value; nodes = dom.select('table', args.node); i = nodes.length; while (i--) { node = nodes[i]; dom.setAttrib(node, 'data-mce-style', ''); if ((value = dom.getAttrib(node, 'width'))) { dom.setStyle(node, 'width', value); dom.setAttrib(node, 'width', ''); } if ((value = dom.getAttrib(node, 'height'))) { dom.setStyle(node, 'height', value); dom.setAttrib(node, 'height', ''); } } }); // Handle node change updates ed.onNodeChange.add(function(ed, cm, n) { var p; n = ed.selection.getStart(); p = ed.dom.getParent(n, 'td,th,caption'); cm.setActive('table', n.nodeName === 'TABLE' || !!p); // Disable table tools if we are in caption if (p && p.nodeName === 'CAPTION') p = 0; cm.setDisabled('delete_table', !p); cm.setDisabled('delete_col', !p); cm.setDisabled('delete_table', !p); cm.setDisabled('delete_row', !p); cm.setDisabled('col_after', !p); cm.setDisabled('col_before', !p); cm.setDisabled('row_after', !p); cm.setDisabled('row_before', !p); cm.setDisabled('row_props', !p); cm.setDisabled('cell_props', !p); cm.setDisabled('split_cells', !p); cm.setDisabled('merge_cells', !p); }); ed.onInit.add(function(ed) { var startTable, startCell, dom = ed.dom, tableGrid; winMan = ed.windowManager; // Add cell selection logic ed.onMouseDown.add(function(ed, e) { if (e.button != 2) { cleanup(); startCell = dom.getParent(e.target, 'td,th'); startTable = dom.getParent(startCell, 'table'); } }); dom.bind(ed.getDoc(), 'mouseover', function(e) { var sel, table, target = e.target; if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) { table = dom.getParent(target, 'table'); if (table == startTable) { if (!tableGrid) { tableGrid = createTableGrid(table); tableGrid.setStartCell(startCell); ed.getBody().style.webkitUserSelect = 'none'; } tableGrid.setEndCell(target); hasCellSelection = true; } // Remove current selection sel = ed.selection.getSel(); try { if (sel.removeAllRanges) sel.removeAllRanges(); else sel.empty(); } catch (ex) { // IE9 might throw errors here } e.preventDefault(); } }); ed.onMouseUp.add(function(ed, e) { var rng, sel = ed.selection, selectedCells, nativeSel = sel.getSel(), walker, node, lastNode, endNode; // Move selection to startCell if (startCell) { if (tableGrid) ed.getBody().style.webkitUserSelect = ''; function setPoint(node, start) { var walker = new tinymce.dom.TreeWalker(node, node); do { // Text node if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) { if (start) rng.setStart(node, 0); else rng.setEnd(node, node.nodeValue.length); return; } // BR element if (node.nodeName == 'BR') { if (start) rng.setStartBefore(node); else rng.setEndBefore(node); return; } } while (node = (start ? walker.next() : walker.prev())); } // Try to expand text selection as much as we can only Gecko supports cell selection selectedCells = dom.select('td.mceSelected,th.mceSelected'); if (selectedCells.length > 0) { rng = dom.createRng(); node = selectedCells[0]; endNode = selectedCells[selectedCells.length - 1]; rng.setStartBefore(node); rng.setEndAfter(node); setPoint(node, 1); walker = new tinymce.dom.TreeWalker(node, dom.getParent(selectedCells[0], 'table')); do { if (node.nodeName == 'TD' || node.nodeName == 'TH') { if (!dom.hasClass(node, 'mceSelected')) break; lastNode = node; } } while (node = walker.next()); setPoint(lastNode); sel.setRng(rng); } ed.nodeChanged(); startCell = tableGrid = startTable = null; } }); ed.onKeyUp.add(function(ed, e) { cleanup(); }); ed.onKeyDown.add(function (ed, e) { fixTableCellSelection(ed); }); ed.onMouseDown.add(function (ed, e) { if (e.button != 2) { fixTableCellSelection(ed); } }); function tableCellSelected(ed, rng, n, currentCell) { // The decision of when a table cell is selected is somewhat involved. The fact that this code is // required is actually a pointer to the root cause of this bug. A cell is selected when the start // and end offsets are 0, the start container is a text, and the selection node is either a TR (most cases) // or the parent of the table (in the case of the selection containing the last cell of a table). var TEXT_NODE = 3, table = ed.dom.getParent(rng.startContainer, 'TABLE'), tableParent, allOfCellSelected, tableCellSelection; if (table) tableParent = table.parentNode; allOfCellSelected =rng.startContainer.nodeType == TEXT_NODE && rng.startOffset == 0 && rng.endOffset == 0 && currentCell && (n.nodeName=="TR" || n==tableParent); tableCellSelection = (n.nodeName=="TD"||n.nodeName=="TH")&& !currentCell; return allOfCellSelected || tableCellSelection; // return false; } // this nasty hack is here to work around some WebKit selection bugs. function fixTableCellSelection(ed) { if (!tinymce.isWebKit) return; var rng = ed.selection.getRng(); var n = ed.selection.getNode(); var currentCell = ed.dom.getParent(rng.startContainer, 'TD,TH'); if (!tableCellSelected(ed, rng, n, currentCell)) return; if (!currentCell) { currentCell=n; } // Get the very last node inside the table cell var end = currentCell.lastChild; while (end.lastChild) end = end.lastChild; // Select the entire table cell. Nothing outside of the table cell should be selected. rng.setEnd(end, end.nodeValue.length); ed.selection.setRng(rng); } ed.plugins.table.fixTableCellSelection=fixTableCellSelection; // Add context menu if (ed && ed.plugins.contextmenu) { ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) { var sm, se = ed.selection, el = se.getNode() || ed.getBody(); if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th') || ed.dom.select('td.mceSelected,th.mceSelected').length) { m.removeAll(); if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) { m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); m.addSeparator(); } if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) { m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); m.addSeparator(); } m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', value : {action : 'insert'}}); m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable'}); m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete'}); m.addSeparator(); // Cell menu sm = m.addMenu({title : 'table.cell'}); sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps'}); sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells'}); sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells'}); // Row menu sm = m.addMenu({title : 'table.row'}); sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps'}); sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'}); sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'}); sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'}); sm.addSeparator(); sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'}); sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'}); sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}).setDisabled(!clipboardRows); sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}).setDisabled(!clipboardRows); // Column menu sm = m.addMenu({title : 'table.col'}); sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'}); sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'}); sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'}); } else m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable'}); }); } // Fix to allow navigating up and down in a table in WebKit browsers. if (tinymce.isWebKit) { function moveSelection(ed, e) { var VK = tinymce.VK; var key = e.keyCode; function handle(upBool, sourceNode, event) { var siblingDirection = upBool ? 'previousSibling' : 'nextSibling'; var currentRow = ed.dom.getParent(sourceNode, 'tr'); var siblingRow = currentRow[siblingDirection]; if (siblingRow) { moveCursorToRow(ed, sourceNode, siblingRow, upBool); tinymce.dom.Event.cancel(event); return true; } else { var tableNode = ed.dom.getParent(currentRow, 'table'); var middleNode = currentRow.parentNode; var parentNodeName = middleNode.nodeName.toLowerCase(); if (parentNodeName === 'tbody' || parentNodeName === (upBool ? 'tfoot' : 'thead')) { var targetParent = getTargetParent(upBool, tableNode, middleNode, 'tbody'); if (targetParent !== null) { return moveToRowInTarget(upBool, targetParent, sourceNode, event); } } return escapeTable(upBool, currentRow, siblingDirection, tableNode, event); } } function getTargetParent(upBool, topNode, secondNode, nodeName) { var tbodies = ed.dom.select('>' + nodeName, topNode); var position = tbodies.indexOf(secondNode); if (upBool && position === 0 || !upBool && position === tbodies.length - 1) { return getFirstHeadOrFoot(upBool, topNode); } else if (position === -1) { var topOrBottom = secondNode.tagName.toLowerCase() === 'thead' ? 0 : tbodies.length - 1; return tbodies[topOrBottom]; } else { return tbodies[position + (upBool ? -1 : 1)]; } } function getFirstHeadOrFoot(upBool, parent) { var tagName = upBool ? 'thead' : 'tfoot'; var headOrFoot = ed.dom.select('>' + tagName, parent); return headOrFoot.length !== 0 ? headOrFoot[0] : null; } function moveToRowInTarget(upBool, targetParent, sourceNode, event) { var targetRow = getChildForDirection(targetParent, upBool); targetRow && moveCursorToRow(ed, sourceNode, targetRow, upBool); tinymce.dom.Event.cancel(event); return true; } function escapeTable(upBool, currentRow, siblingDirection, table, event) { var tableSibling = table[siblingDirection]; if (tableSibling) { moveCursorToStartOfElement(tableSibling); return true; } else { var parentCell = ed.dom.getParent(table, 'td,th'); if (parentCell) { return handle(upBool, parentCell, event); } else { var backUpSibling = getChildForDirection(currentRow, !upBool); moveCursorToStartOfElement(backUpSibling); return tinymce.dom.Event.cancel(event); } } } function getChildForDirection(parent, up) { var child = parent && parent[up ? 'lastChild' : 'firstChild']; // BR is not a valid table child to return in this case we return the table cell return child && child.nodeName === 'BR' ? ed.dom.getParent(child, 'td,th') : child; } function moveCursorToStartOfElement(n) { ed.selection.setCursorLocation(n, 0); } function isVerticalMovement() { return key == VK.UP || key == VK.DOWN; } function isInTable(ed) { var node = ed.selection.getNode(); var currentRow = ed.dom.getParent(node, 'tr'); return currentRow !== null; } function columnIndex(column) { var colIndex = 0; var c = column; while (c.previousSibling) { c = c.previousSibling; colIndex = colIndex + getSpanVal(c, "colspan"); } return colIndex; } function findColumn(rowElement, columnIndex) { var c = 0; var r = 0; each(rowElement.children, function(cell, i) { c = c + getSpanVal(cell, "colspan"); r = i; if (c > columnIndex) return false; }); return r; } function moveCursorToRow(ed, node, row, upBool) { var srcColumnIndex = columnIndex(ed.dom.getParent(node, 'td,th')); var tgtColumnIndex = findColumn(row, srcColumnIndex); var tgtNode = row.childNodes[tgtColumnIndex]; var rowCellTarget = getChildForDirection(tgtNode, upBool); moveCursorToStartOfElement(rowCellTarget || tgtNode); } function shouldFixCaret(preBrowserNode) { var newNode = ed.selection.getNode(); var newParent = ed.dom.getParent(newNode, 'td,th'); var oldParent = ed.dom.getParent(preBrowserNode, 'td,th'); return newParent && newParent !== oldParent && checkSameParentTable(newParent, oldParent) } function checkSameParentTable(nodeOne, NodeTwo) { return ed.dom.getParent(nodeOne, 'TABLE') === ed.dom.getParent(NodeTwo, 'TABLE'); } if (isVerticalMovement() && isInTable(ed)) { var preBrowserNode = ed.selection.getNode(); setTimeout(function() { if (shouldFixCaret(preBrowserNode)) { handle(!e.shiftKey && key === VK.UP, preBrowserNode, e); } }, 0); } } ed.onKeyDown.add(moveSelection); } // Fixes an issue on Gecko where it's impossible to place the caret behind a table // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled function fixTableCaretPos() { var last; // Skip empty text nodes form the end for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ; if (last && last.nodeName == 'TABLE') { if (ed.settings.forced_root_block) ed.dom.add(ed.getBody(), ed.settings.forced_root_block, null, tinymce.isIE ? ' ' : '
    '); else ed.dom.add(ed.getBody(), 'br', {'data-mce-bogus': '1'}); } }; // Fixes an bug where it's impossible to place the caret before a table in Gecko // this fix solves it by detecting when the caret is at the beginning of such a table // and then manually moves the caret infront of the table if (tinymce.isGecko) { ed.onKeyDown.add(function(ed, e) { var rng, table, dom = ed.dom; // On gecko it's not possible to place the caret before a table if (e.keyCode == 37 || e.keyCode == 38) { rng = ed.selection.getRng(); table = dom.getParent(rng.startContainer, 'table'); if (table && ed.getBody().firstChild == table) { if (isAtStart(rng, table)) { rng = dom.createRng(); rng.setStartBefore(table); rng.setEndBefore(table); ed.selection.setRng(rng); e.preventDefault(); } } } }); } ed.onKeyUp.add(fixTableCaretPos); ed.onSetContent.add(fixTableCaretPos); ed.onVisualAid.add(fixTableCaretPos); ed.onPreProcess.add(function(ed, o) { var last = o.node.lastChild; if (last && (last.nodeName == "BR" || (last.childNodes.length == 1 && (last.firstChild.nodeName == 'BR' || last.firstChild.nodeValue == '\u00a0'))) && last.previousSibling && last.previousSibling.nodeName == "TABLE") { ed.dom.remove(last); } }); /** * Fixes bug in Gecko where shift-enter in table cell does not place caret on new line * * Removed: Since the new enter logic seems to fix this one. */ /* if (tinymce.isGecko) { ed.onKeyDown.add(function(ed, e) { if (e.keyCode === tinymce.VK.ENTER && e.shiftKey) { var node = ed.selection.getRng().startContainer; var tableCell = dom.getParent(node, 'td,th'); if (tableCell) { var zeroSizedNbsp = ed.getDoc().createTextNode("\uFEFF"); dom.insertAfter(zeroSizedNbsp, node); } } }); } */ fixTableCaretPos(); ed.startContent = ed.getContent({format : 'raw'}); }); // Register action commands each({ mceTableSplitCells : function(grid) { grid.split(); }, mceTableMergeCells : function(grid) { var rowSpan, colSpan, cell; cell = ed.dom.getParent(ed.selection.getNode(), 'th,td'); if (cell) { rowSpan = cell.rowSpan; colSpan = cell.colSpan; } if (!ed.dom.select('td.mceSelected,th.mceSelected').length) { winMan.open({ url : url + '/merge_cells.htm', width : 240 + parseInt(ed.getLang('table.merge_cells_delta_width', 0)), height : 110 + parseInt(ed.getLang('table.merge_cells_delta_height', 0)), inline : 1 }, { rows : rowSpan, cols : colSpan, onaction : function(data) { grid.merge(cell, data.cols, data.rows); }, plugin_url : url }); } else grid.merge(); }, mceTableInsertRowBefore : function(grid) { grid.insertRow(true); }, mceTableInsertRowAfter : function(grid) { grid.insertRow(); }, mceTableInsertColBefore : function(grid) { grid.insertCol(true); }, mceTableInsertColAfter : function(grid) { grid.insertCol(); }, mceTableDeleteCol : function(grid) { grid.deleteCols(); }, mceTableDeleteRow : function(grid) { grid.deleteRows(); }, mceTableCutRow : function(grid) { clipboardRows = grid.cutRows(); }, mceTableCopyRow : function(grid) { clipboardRows = grid.copyRows(); }, mceTablePasteRowBefore : function(grid) { grid.pasteRows(clipboardRows, true); }, mceTablePasteRowAfter : function(grid) { grid.pasteRows(clipboardRows); }, mceTableDelete : function(grid) { grid.deleteTable(); } }, function(func, name) { ed.addCommand(name, function() { var grid = createTableGrid(); if (grid) { func(grid); ed.execCommand('mceRepaint'); cleanup(); } }); }); // Register dialog commands each({ mceInsertTable : function(val) { winMan.open({ url : url + '/table.htm', width : 400 + parseInt(ed.getLang('table.table_delta_width', 0)), height : 320 + parseInt(ed.getLang('table.table_delta_height', 0)), inline : 1 }, { plugin_url : url, action : val ? val.action : 0 }); }, mceTableRowProps : function() { winMan.open({ url : url + '/row.htm', width : 400 + parseInt(ed.getLang('table.rowprops_delta_width', 0)), height : 295 + parseInt(ed.getLang('table.rowprops_delta_height', 0)), inline : 1 }, { plugin_url : url }); }, mceTableCellProps : function() { winMan.open({ url : url + '/cell.htm', width : 400 + parseInt(ed.getLang('table.cellprops_delta_width', 0)), height : 295 + parseInt(ed.getLang('table.cellprops_delta_height', 0)), inline : 1 }, { plugin_url : url }); } }, function(func, name) { ed.addCommand(name, function(ui, val) { func(val); }); }); } }); // Register plugin tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin); })(tinymce); glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/js/000077500000000000000000000000001226600447100213625ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/js/cell.js000066400000000000000000000223621226600447100226440ustar00rootroot00000000000000tinyMCEPopup.requireLangPack(); var ed; function init() { ed = tinyMCEPopup.editor; tinyMCEPopup.resizeToInnerSize(); document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor') var inst = ed; var tdElm = ed.dom.getParent(ed.selection.getStart(), "td,th"); var formObj = document.forms[0]; var st = ed.dom.parseStyle(ed.dom.getAttrib(tdElm, "style")); // Get table cell data var celltype = tdElm.nodeName.toLowerCase(); var align = ed.dom.getAttrib(tdElm, 'align'); var valign = ed.dom.getAttrib(tdElm, 'valign'); var width = trimSize(getStyle(tdElm, 'width', 'width')); var height = trimSize(getStyle(tdElm, 'height', 'height')); var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor')); var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor')); var className = ed.dom.getAttrib(tdElm, 'class'); var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); var id = ed.dom.getAttrib(tdElm, 'id'); var lang = ed.dom.getAttrib(tdElm, 'lang'); var dir = ed.dom.getAttrib(tdElm, 'dir'); var scope = ed.dom.getAttrib(tdElm, 'scope'); // Setup form addClassesToList('class', 'table_cell_styles'); TinyMCE_EditableSelects.init(); if (!ed.dom.hasClass(tdElm, 'mceSelected')) { formObj.bordercolor.value = bordercolor; formObj.bgcolor.value = bgcolor; formObj.backgroundimage.value = backgroundimage; formObj.width.value = width; formObj.height.value = height; formObj.id.value = id; formObj.lang.value = lang; formObj.style.value = ed.dom.serializeStyle(st); selectByValue(formObj, 'align', align); selectByValue(formObj, 'valign', valign); selectByValue(formObj, 'class', className, true, true); selectByValue(formObj, 'celltype', celltype); selectByValue(formObj, 'dir', dir); selectByValue(formObj, 'scope', scope); // Resize some elements if (isVisible('backgroundimagebrowser')) document.getElementById('backgroundimage').style.width = '180px'; updateColor('bordercolor_pick', 'bordercolor'); updateColor('bgcolor_pick', 'bgcolor'); } else tinyMCEPopup.dom.hide('action'); } function updateAction() { var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0]; if (!AutoValidator.validate(formObj)) { tinyMCEPopup.alert(AutoValidator.getErrorMessages(formObj).join('. ') + '.'); return false; } tinyMCEPopup.restoreSelection(); el = ed.selection.getStart(); tdElm = ed.dom.getParent(el, "td,th"); trElm = ed.dom.getParent(el, "tr"); tableElm = ed.dom.getParent(el, "table"); // Cell is selected if (ed.dom.hasClass(tdElm, 'mceSelected')) { // Update all selected sells tinymce.each(ed.dom.select('td.mceSelected,th.mceSelected'), function(td) { updateCell(td); }); ed.addVisual(); ed.nodeChanged(); inst.execCommand('mceEndUndoLevel'); tinyMCEPopup.close(); return; } switch (getSelectValue(formObj, 'action')) { case "cell": var celltype = getSelectValue(formObj, 'celltype'); var scope = getSelectValue(formObj, 'scope'); function doUpdate(s) { if (s) { updateCell(tdElm); ed.addVisual(); ed.nodeChanged(); inst.execCommand('mceEndUndoLevel'); tinyMCEPopup.close(); } }; if (ed.getParam("accessibility_warnings", 1)) { if (celltype == "th" && scope == "") tinyMCEPopup.confirm(ed.getLang('table_dlg.missing_scope', '', true), doUpdate); else doUpdate(1); return; } updateCell(tdElm); break; case "row": var cell = trElm.firstChild; if (cell.nodeName != "TD" && cell.nodeName != "TH") cell = nextCell(cell); do { cell = updateCell(cell, true); } while ((cell = nextCell(cell)) != null); break; case "col": var curr, col = 0, cell = trElm.firstChild, rows = tableElm.getElementsByTagName("tr"); if (cell.nodeName != "TD" && cell.nodeName != "TH") cell = nextCell(cell); do { if (cell == tdElm) break; col += cell.getAttribute("colspan")?cell.getAttribute("colspan"):1; } while ((cell = nextCell(cell)) != null); for (var i=0; i 0) { tinymce.each(tableElm.rows, function(tr) { var i; for (i = 0; i < tr.cells.length; i++) { if (dom.hasClass(tr.cells[i], 'mceSelected')) { updateRow(tr, true); return; } } }); inst.addVisual(); inst.nodeChanged(); inst.execCommand('mceEndUndoLevel'); tinyMCEPopup.close(); return; } switch (action) { case "row": updateRow(trElm); break; case "all": var rows = tableElm.getElementsByTagName("tr"); for (var i=0; i colLimit) { tinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit)); return false; } else if (rowLimit && rows > rowLimit) { tinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit)); return false; } else if (cellLimit && cols * rows > cellLimit) { tinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit)); return false; } // Update table if (action == "update") { dom.setAttrib(elm, 'cellPadding', cellpadding, true); dom.setAttrib(elm, 'cellSpacing', cellspacing, true); if (!isCssSize(border)) { dom.setAttrib(elm, 'border', border); } else { dom.setAttrib(elm, 'border', ''); } if (border == '') { dom.setStyle(elm, 'border-width', ''); dom.setStyle(elm, 'border', ''); dom.setAttrib(elm, 'border', ''); } dom.setAttrib(elm, 'align', align); dom.setAttrib(elm, 'frame', frame); dom.setAttrib(elm, 'rules', rules); dom.setAttrib(elm, 'class', className); dom.setAttrib(elm, 'style', style); dom.setAttrib(elm, 'id', id); dom.setAttrib(elm, 'summary', summary); dom.setAttrib(elm, 'dir', dir); dom.setAttrib(elm, 'lang', lang); capEl = inst.dom.select('caption', elm)[0]; if (capEl && !caption) capEl.parentNode.removeChild(capEl); if (!capEl && caption) { capEl = elm.ownerDocument.createElement('caption'); if (!tinymce.isIE) capEl.innerHTML = '
    '; elm.insertBefore(capEl, elm.firstChild); } if (width && inst.settings.inline_styles) { dom.setStyle(elm, 'width', width); dom.setAttrib(elm, 'width', ''); } else { dom.setAttrib(elm, 'width', width, true); dom.setStyle(elm, 'width', ''); } // Remove these since they are not valid XHTML dom.setAttrib(elm, 'borderColor', ''); dom.setAttrib(elm, 'bgColor', ''); dom.setAttrib(elm, 'background', ''); if (height && inst.settings.inline_styles) { dom.setStyle(elm, 'height', height); dom.setAttrib(elm, 'height', ''); } else { dom.setAttrib(elm, 'height', height, true); dom.setStyle(elm, 'height', ''); } if (background != '') elm.style.backgroundImage = "url('" + background + "')"; else elm.style.backgroundImage = ''; /* if (tinyMCEPopup.getParam("inline_styles")) { if (width != '') elm.style.width = getCSSSize(width); }*/ if (bordercolor != "") { elm.style.borderColor = bordercolor; elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle; elm.style.borderWidth = cssSize(border); } else elm.style.borderColor = ''; elm.style.backgroundColor = bgcolor; elm.style.height = getCSSSize(height); inst.addVisual(); // Fix for stange MSIE align bug //elm.outerHTML = elm.outerHTML; inst.nodeChanged(); inst.execCommand('mceEndUndoLevel', false, {}, {skip_undo: true}); // Repaint if dimensions changed if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight) inst.execCommand('mceRepaint'); tinyMCEPopup.close(); return true; } // Create new table html += ''); tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','), function(n) { if (patt) patt += ','; patt += n + ' ._mce_marker'; }); tinymce.each(inst.dom.select(patt), function(n) { inst.dom.split(inst.dom.getParent(n, 'h1,h2,h3,h4,h5,h6,p'), n); }); dom.setOuterHTML(dom.select('br._mce_marker')[0], html); } else inst.execCommand('mceInsertContent', false, html); tinymce.each(dom.select('table[data-mce-new]'), function(node) { var tdorth = dom.select('td,th', node); // Fixes a bug in IE where the caret cannot be placed after the table if the table is at the end of the document if (tinymce.isIE && node.nextSibling == null) { if (inst.settings.forced_root_block) dom.insertAfter(dom.create(inst.settings.forced_root_block), node); else dom.insertAfter(dom.create('br', {'data-mce-bogus': '1'}), node); } try { // IE9 might fail to do this selection inst.selection.setCursorLocation(tdorth[0], 0); } catch (ex) { // Ignore } dom.setAttrib(node, 'data-mce-new', ''); }); inst.addVisual(); inst.execCommand('mceEndUndoLevel', false, {}, {skip_undo: true}); tinyMCEPopup.close(); } function makeAttrib(attrib, value) { var formObj = document.forms[0]; var valueElm = formObj.elements[attrib]; if (typeof(value) == "undefined" || value == null) { value = ""; if (valueElm) value = valueElm.value; } if (value == "") return ""; // XML encode it value = value.replace(/&/g, '&'); value = value.replace(/\"/g, '"'); value = value.replace(//g, '>'); return ' ' + attrib + '="' + value + '"'; } function init() { tinyMCEPopup.resizeToInnerSize(); document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', ''); var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = ""; var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules = "", frame = ""; var inst = tinyMCEPopup.editor, dom = inst.dom; var formObj = document.forms[0]; var elm = dom.getParent(inst.selection.getNode(), "table"); // Hide advanced fields that isn't available in the schema tinymce.each("summary id rules dir style frame".split(" "), function(name) { var tr = tinyMCEPopup.dom.getParent(name, "tr") || tinyMCEPopup.dom.getParent("t" + name, "tr"); if (tr && !tinyMCEPopup.editor.schema.isValid("table", name)) { tr.style.display = 'none'; } }); action = tinyMCEPopup.getWindowArg('action'); if (!action) action = elm ? "update" : "insert"; if (elm && action != "insert") { var rowsAr = elm.rows; var cols = 0; for (var i=0; i cols) cols = rowsAr[i].cells.length; cols = cols; rows = rowsAr.length; st = dom.parseStyle(dom.getAttrib(elm, "style")); border = trimSize(getStyle(elm, 'border', 'borderWidth')); cellpadding = dom.getAttrib(elm, 'cellpadding', ""); cellspacing = dom.getAttrib(elm, 'cellspacing', ""); width = trimSize(getStyle(elm, 'width', 'width')); height = trimSize(getStyle(elm, 'height', 'height')); bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor')); bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor')); align = dom.getAttrib(elm, 'align', align); frame = dom.getAttrib(elm, 'frame'); rules = dom.getAttrib(elm, 'rules'); className = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, '')); id = dom.getAttrib(elm, 'id'); summary = dom.getAttrib(elm, 'summary'); style = dom.serializeStyle(st); dir = dom.getAttrib(elm, 'dir'); lang = dom.getAttrib(elm, 'lang'); background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); formObj.caption.checked = elm.getElementsByTagName('caption').length > 0; orgTableWidth = width; orgTableHeight = height; action = "update"; formObj.insert.value = inst.getLang('update'); } addClassesToList('class', "table_styles"); TinyMCE_EditableSelects.init(); // Update form selectByValue(formObj, 'align', align); selectByValue(formObj, 'tframe', frame); selectByValue(formObj, 'rules', rules); selectByValue(formObj, 'class', className, true, true); formObj.cols.value = cols; formObj.rows.value = rows; formObj.border.value = border; formObj.cellpadding.value = cellpadding; formObj.cellspacing.value = cellspacing; formObj.width.value = width; formObj.height.value = height; formObj.bordercolor.value = bordercolor; formObj.bgcolor.value = bgcolor; formObj.id.value = id; formObj.summary.value = summary; formObj.style.value = style; formObj.dir.value = dir; formObj.lang.value = lang; formObj.backgroundimage.value = background; updateColor('bordercolor_pick', 'bordercolor'); updateColor('bgcolor_pick', 'bgcolor'); // Resize some elements if (isVisible('backgroundimagebrowser')) document.getElementById('backgroundimage').style.width = '180px'; // Disable some fields in update mode if (action == "update") { formObj.cols.disabled = true; formObj.rows.disabled = true; } } function changedSize() { var formObj = document.forms[0]; var st = dom.parseStyle(formObj.style.value); /* var width = formObj.width.value; if (width != "") st['width'] = tinyMCEPopup.getParam("inline_styles") ? getCSSSize(width) : ""; else st['width'] = "";*/ var height = formObj.height.value; if (height != "") st['height'] = getCSSSize(height); else st['height'] = ""; formObj.style.value = dom.serializeStyle(st); } function isCssSize(value) { return /^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)$/.test(value); } function cssSize(value, def) { value = tinymce.trim(value || def); if (!isCssSize(value)) { return parseInt(value, 10) + 'px'; } return value; } function changedBackgroundImage() { var formObj = document.forms[0]; var st = dom.parseStyle(formObj.style.value); st['background-image'] = "url('" + formObj.backgroundimage.value + "')"; formObj.style.value = dom.serializeStyle(st); } function changedBorder() { var formObj = document.forms[0]; var st = dom.parseStyle(formObj.style.value); // Update border width if the element has a color if (formObj.border.value != "" && (isCssSize(formObj.border.value) || formObj.bordercolor.value != "")) st['border-width'] = cssSize(formObj.border.value); else { if (!formObj.border.value) { st['border'] = ''; st['border-width'] = ''; } } formObj.style.value = dom.serializeStyle(st); } function changedColor() { var formObj = document.forms[0]; var st = dom.parseStyle(formObj.style.value); st['background-color'] = formObj.bgcolor.value; if (formObj.bordercolor.value != "") { st['border-color'] = formObj.bordercolor.value; // Add border-width if it's missing if (!st['border-width']) st['border-width'] = cssSize(formObj.border.value, 1); } formObj.style.value = dom.serializeStyle(st); } function changedStyle() { var formObj = document.forms[0]; var st = dom.parseStyle(formObj.style.value); if (st['background-image']) formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); else formObj.backgroundimage.value = ''; if (st['width']) formObj.width.value = trimSize(st['width']); if (st['height']) formObj.height.value = trimSize(st['height']); if (st['background-color']) { formObj.bgcolor.value = st['background-color']; updateColor('bgcolor_pick','bgcolor'); } if (st['border-color']) { formObj.bordercolor.value = st['border-color']; updateColor('bordercolor_pick','bordercolor'); } } tinyMCEPopup.onInit.add(init); glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/000077500000000000000000000000001226600447100220525ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/ar_dlg.js000066400000000000000000000041311226600447100236370ustar00rootroot00000000000000tinyMCE.addI18n('ar.table_dlg',{ general_tab:"General", advanced_tab:"Advanced", general_props:"General properties", advanced_props:"Advanced properties", rowtype:"Row in table part", title:"Insert/Modify table", width:"Width", height:"Height", cols:"Cols", rows:"Rows", cellspacing:"Cellspacing", cellpadding:"Cellpadding", border:"Border", align:"Alignment", align_default:"Default", align_left:"Left", align_right:"Right", align_middle:"Center", row_title:"Table row properties", cell_title:"Table cell properties", cell_type:"Cell type", valign:"Vertical alignment", align_top:"Top", align_bottom:"Bottom", bordercolor:"Border color", bgcolor:"Background color", merge_cells_title:"Merge table cells", id:"Id", style:"Style", langdir:"Language direction", langcode:"Language code", mime:"Target MIME type", ltr:"Left to right", rtl:"Right to left", bgimage:"Background image", summary:"Summary", td:"Data", th:"Header", cell_cell:"Update current cell", cell_row:"Update all cells in row", cell_all:"Update all cells in table", row_row:"Update current row", row_odd:"Update odd rows in table", row_even:"Update even rows in table", row_all:"Update all rows in table", thead:"Table Head", tbody:"Table Body", tfoot:"Table Foot", scope:"Scope", rowgroup:"Row Group", colgroup:"Col Group", col_limit:"You've exceeded the maximum number of columns of {$cols}.", row_limit:"You've exceeded the maximum number of rows of {$rows}.", cell_limit:"You've exceeded the maximum number of cells of {$cells}.", missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.", caption:"Table caption", frame:"Frame", frame_none:"none", frame_groups:"groups", frame_rows:"rows", frame_cols:"cols", frame_all:"all", rules:"Rules", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/az_dlg.js000066400000000000000000000067251226600447100236620ustar00rootroot00000000000000tinyMCE.addI18n('az.table_dlg',{ general_tab:"\u00DCmumi", advanced_tab:"\u018Flav\u0259l\u0259r", general_props:"\u00DCmumi x\u00FCsusiyy\u0259tl\u0259r", advanced_props:"\u018Flav\u0259 x\u00FCsusiyy\u0259tl\u0259r", rowtype:"C\u0259dv\u0259l hiss\u0259sind\u0259ki s\u0259tr", title:"C\u0259dv\u0259li \u0259lav\u0259 et/d\u0259yi\u015Fdir", width:"Eni", height:"H\u00FCnd\u00FCrl\u00FCy\u00FC", cols:"S\u00FCtunlar", rows:"S\u0259trl\u0259r", cellspacing:"\u00D6z\u0259kl\u0259r aras\u0131ndak\u0131 m\u0259saf\u0259", cellpadding:"\u00D6z\u0259kl\u0259rd\u0259 doldurma", border:"S\u0259rh\u0259d", align:"Tarazla\u015Fd\u0131rma", align_default:"Default", align_left:"Sola", align_right:"Sa\u011Fa", align_middle:"M\u0259rk\u0259z il\u0259", row_title:"S\u0259tr x\u00FCsusiyy\u0259ti", cell_title:"\u00D6z\u0259k x\u00FCsusiyy\u0259ti", cell_type:"\u00D6z\u0259k n\u00F6v\u00FC", valign:"\u015Eaquli tarazla\u015Fma", align_top:"Yuxar\u0131 il\u0259", align_bottom:"A\u015Fa\u011F\u0131 il\u0259", bordercolor:"S\u0259rh\u0259d r\u0259ngi", bgcolor:"Fon r\u0259ngi", merge_cells_title:"\u00D6z\u0259k stili", id:"\u0130dentifikator", style:"Stil", langdir:"Dil istiqam\u0259ti", langcode:"Dil kodu", mime:"H\u0259d\u0259fli MIME-n\u00F6v", ltr:"Solda-sa\u011Fa", rtl:"Sa\u011Fda-sola", bgimage:"Fon \u015F\u0259kli", summary:"X\u00FClas\u0259", td:"Veril\u0259nl\u0259r", th:"Ba\u015Fl\u0131q", cell_cell:"Haz\u0131rki \u00F6z\u0259yi yenil\u0259", cell_row:"S\u0259trd\u0259ki b\u00FCt\u00FCn \u00F6z\u0259kl\u0259ri yenil\u0259", cell_all:"C\u0259dv\u0259ld\u0259ki b\u00FCt\u00FCn \u00F6z\u0259kl\u0259ri yenil\u0259", row_row:"Haz\u0131rki s\u0259tri yenil\u0259", row_odd:"C\u0259d\u0259ld\u0259ki t\u0259k (\u0259d\u0259d) s\u0259trl\u0259ri yenil\u0259", row_even:"C\u0259dv\u0259ld\u0259ki c\u00FCt (\u0259d\u0259d) s\u0259trl\u0259ri yenil\u0259", row_all:"C\u0259dv\u0259ld\u0259ki b\u00FCt\u00FCn s\u0259trl\u0259ri yenil\u0259", thead:"C\u0259dv\u0259lin yuxar\u0131 hiss\u0259si", tbody:"C\u0259dv\u0259lin \u0259sas hiss\u0259si", tfoot:"C\u0259dv\u0259lin a\u015Fa\u011F\u0131 hiss\u0259si", scope:"H\u0259dd", rowgroup:"S\u0259tr qrupu", colgroup:"S\u00FCtun qrupu", col_limit:"Siz s\u00FCtunlarda {$cols} maksimum say\u0131 a\u015Fd\u0131n\u0131z.", row_limit:"Siz s\u0259trl\u0259rd\u0259 {$rows} maksimum say\u0131 a\u015Fd\u0131n\u0131z.", cell_limit:"Siz \u00F6z\u0259kl\u0259rd\u0259 {$cells} maksimum say\u0131 a\u015Fd\u0131n\u0131z.", missing_scope:"\u018Fminsiniz ki, ba\u015Fl\u0131q \u00F6z\u0259yinin h\u0259ddini g\u00F6st\u0259rm\u0259d\u0259n davam etm\u0259k ist\u0259yirsiniz? Bunsuz b\u0259zi i\u015F qabiliyy\u0259ti a\u015Fa\u011F\u0131 olan istifad\u0259\u00E7il\u0259r\u0259 c\u0259dv\u0259lin m\u0259lumatlar\u0131 v\u0259 t\u0259rkibini anlamaq \u00E7\u0259tin olacaq.", caption:"C\u0259dv\u0259l ba\u015Fl\u0131\u011F\u0131", frame:"\u00C7\u0259r\u00E7iv\u0259", frame_none:"he\u00E7n\u0259", frame_groups:"qruplar", frame_rows:"s\u0259trl\u0259r", frame_cols:"s\u00FCtunlar", frame_all:"ham\u0131s\u0131", rules:"X\u0259ttl\u0259r", rules_void:"he\u00E7 n\u0259", rules_above:"yuxar\u0131dan", rules_below:"a\u015Fa\u011F\u0131dan", rules_hsides:"\u00FCf\u00FCqi t\u0259r\u0259fl\u0259r", rules_lhs:"sol \u00FCf\u00FCqi t\u0259r\u0259fl\u0259r", rules_rhs:"sa\u011F \u00FCf\u00FCqi t\u0259r\u0259fl\u0259r", rules_vsides:"\u015Faquli t\u0259r\u0259fl\u0259r", rules_box:"konteyner", rules_border:"s\u0259rh\u0259d" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/be_dlg.js000066400000000000000000000173631226600447100236360ustar00rootroot00000000000000tinyMCE.addI18n('be.table_dlg',{ general_tab:"\u0410\u0433\u0443\u043B\u044C\u043D\u044B\u044F", advanced_tab:"\u0414\u0430\u0434\u0430\u0442\u043A\u043E\u0432\u044B\u044F", general_props:"\u0410\u0433\u0443\u043B\u044C\u043D\u044B\u044F \u045E\u043B\u0430\u0441\u0446\u0456\u0432\u0430\u0441\u0446\u0456", advanced_props:"\u0414\u0430\u0434\u0430\u0442\u043A\u043E\u0432\u044B\u044F \u045E\u043B\u0430\u0441\u0446\u0456\u0432\u0430\u0441\u0446\u0456", rowtype:"\u0420\u0430\u0434\u043E\u043A \u0443 \u0447\u0430\u0441\u0442\u043A\u0456 \u0442\u0430\u0431\u043B\u0456\u0446\u044B", title:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044C/\u0437\u043C\u044F\u043D\u0456\u0446\u044C \u0442\u0430\u0431\u043B\u0456\u0446\u0443", width:"\u0428\u044B\u0440\u044B\u043D\u044F", height:"\u0412\u044B\u0448\u044B\u043D\u044F", cols:"\u0421\u043B\u0443\u043F\u043A\u0456", rows:"\u0420\u0430\u0434\u043A\u0456", cellspacing:"\u0410\u0434\u043B\u0435\u0433\u043B\u0430\u0441\u0446\u044C \u043F\u0430\u043C\u0456\u0436 \u0432\u043E\u0447\u043A\u0430\u043C\u0456", cellpadding:"\u041D\u0430\u0431\u0456\u0432\u0430\u043D\u043D\u0435 \u045E \u0432\u043E\u0447\u043A\u0430\u0445", border:"\u041C\u044F\u0436\u0430", align:"\u0412\u044B\u0440\u0430\u045E\u043D\u043E\u045E\u0432\u0430\u043D\u043D\u0435", align_default:"\u041F\u0430 \u0437\u043C\u0430\u045E\u0447\u0430\u043D\u043D\u0456", align_left:"\u041D\u0430\u043B\u0435\u0432\u0430", align_right:"\u041D\u0430\u043F\u0440\u0430\u0432\u0430", align_middle:"\u041F\u0430 \u0446\u044D\u043D\u0442\u0440\u044B", row_title:"\u0423\u043B\u0430\u0441\u0446\u0456\u0432\u0430\u0441\u0446\u0456 \u0440\u0430\u0434\u043A\u0430", cell_title:"\u0423\u043B\u0430\u0441\u0446\u0456\u0432\u0430\u0441\u0446\u0456 \u0432\u043E\u0447\u043A\u0430", cell_type:"\u0422\u044B\u043F \u0432\u043E\u0447\u043A\u0430", valign:"\u0412\u0435\u0440\u0442\u044B\u043A\u0430\u043B\u044C\u043D\u0430\u0435 \u0432\u044B\u0440\u0430\u045E\u043D\u043E\u045E\u0432\u0430\u043D\u043D\u0435", align_top:"\u041F\u0430 \u0432\u0435\u0440\u0441\u0435", align_bottom:"\u041F\u0430 \u043D\u0456\u0437\u0435", bordercolor:"\u041A\u043E\u043B\u0435\u0440 \u043C\u044F\u0436\u044B", bgcolor:"\u041A\u043E\u043B\u0435\u0440 \u0444\u043E\u043D\u0443", merge_cells_title:"\u0417\u043B\u0456\u0446\u044C \u0432\u043E\u0447\u043A\u0456", id:"\u0406\u0434\u044D\u043D\u0442\u044B\u0444\u0456\u043A\u0430\u0442\u0430\u0440", style:"\u0421\u0442\u044B\u043B\u044C", langdir:"\u041A\u0456\u0440\u0443\u043D\u0430\u043A \u043C\u043E\u0432\u044B", langcode:"\u041A\u043E\u0434 \u043C\u043E\u0432\u044B", mime:"\u041C\u044D\u0442\u0430\u0432\u044B MIME-\u0442\u044B\u043F", ltr:"\u0417\u043B\u0435\u0432\u0430 \u043D\u0430\u043F\u0440\u0430\u0432\u0430", rtl:"\u0421\u043F\u0440\u0430\u0432\u0430 \u043D\u0430\u043B\u0435\u0432\u0430", bgimage:"\u0424\u043E\u043D\u0430\u0432\u044B \u043C\u0430\u043B\u044E\u043D\u0430\u043A", summary:"\u0417\u0432\u043E\u0434\u043A\u0430", td:"\u0414\u0430\u0434\u0437\u0435\u043D\u044B\u044F", th:"\u0417\u0430\u0433\u0430\u043B\u043E\u0432\u0430\u043A", cell_cell:"\u0410\u0431\u043D\u0430\u0432\u0456\u0446\u044C \u0431\u044F\u0433\u0443\u0447\u0430\u0435 \u0432\u043E\u0447\u043A\u0430", cell_row:"\u0410\u0431\u043D\u0430\u0432\u0456\u0446\u044C \u0443\u0441\u0435 \u0432\u043E\u0447\u043A\u0456 \u045E \u0440\u0430\u0434\u043A\u0443", cell_all:"\u0410\u0431\u043D\u0430\u0432\u0456\u0446\u044C \u0443\u0441\u0435 \u0432\u043E\u0447\u043A\u0456 \u045E \u0442\u0430\u0431\u043B\u0456\u0446\u044B", row_row:"\u0410\u0431\u043D\u0430\u0432\u0456\u0446\u044C \u0431\u044F\u0433\u0443\u0447\u044B \u0440\u0430\u0434\u043E\u043A", row_odd:"\u0410\u0431\u043D\u0430\u0432\u0456\u0446\u044C \u043D\u044F\u0446\u043E\u0442\u043D\u044B\u044F \u0440\u0430\u0434\u043A\u0456 \u045E \u0442\u0430\u0431\u043B\u0456\u0446\u044B", row_even:"\u0410\u0431\u043D\u0430\u0432\u0456\u0446\u044C \u0446\u043E\u0442\u043D\u044B\u044F \u0440\u0430\u0434\u043A\u0456 \u045E \u0442\u0430\u0431\u043B\u0456\u0446\u044B", row_all:"\u0410\u0431\u043D\u0430\u0432\u0456\u0446\u044C \u0443\u0441\u0435 \u0440\u0430\u0434\u043A\u0456 \u045E \u0442\u0430\u0431\u043B\u0456\u0446\u044B", thead:"\u0412\u0435\u0440\u0445\u043D\u044F\u044F \u0447\u0430\u0441\u0442\u043A\u0430 \u0442\u0430\u0431\u043B\u0456\u0446\u044B", tbody:"\u0410\u0441\u043D\u043E\u045E\u043D\u0430\u044F \u0447\u0430\u0441\u0442\u043A\u0430 \u0442\u0430\u0431\u043B\u0456\u0446\u044B", tfoot:"\u041D\u0456\u0436\u043D\u044F\u044F \u0447\u0430\u0441\u0442\u043A\u0430 \u0442\u0430\u0431\u043B\u0456\u0446\u044B", scope:"\u041C\u0435\u0436\u044B", rowgroup:"\u0413\u0440\u0443\u043F\u0430 \u0440\u0430\u0434\u043A\u043E\u045E", colgroup:"\u0413\u0440\u0443\u043F\u0430 \u0441\u043B\u0443\u043F\u043A\u043E\u045E", col_limit:"\u0412\u044B \u043F\u0435\u0440\u0430\u0432\u044B\u0441\u0456\u043B\u0456 \u043C\u0430\u043A\u0441\u0456\u043C\u0430\u043B\u044C\u043D\u0443\u044E \u043A\u043E\u043B\u044C\u043A\u0430\u0441\u0446\u044C \u0443 {$cols} \u0441\u043B\u0443\u043F\u043A\u043E\u045E.", row_limit:"\u0412\u044B \u043F\u0435\u0440\u0430\u0432\u044B\u0441\u0456\u043B\u0456 \u043C\u0430\u043A\u0441\u0456\u043C\u0430\u043B\u044C\u043D\u0443\u044E \u043A\u043E\u043B\u044C\u043A\u0430\u0441\u0446\u044C \u0443 {$rows} \u0440\u0430\u0434\u043A\u043E\u045E.", cell_limit:"\u0412\u044B \u043F\u0435\u0440\u0430\u0432\u044B\u0441\u0456\u043B\u0456 \u043C\u0430\u043A\u0441\u0456\u043C\u0430\u043B\u044C\u043D\u0443\u044E \u043A\u043E\u043B\u044C\u043A\u0430\u0441\u0446\u044C \u0443 {$cells} \u0432\u043E\u0447\u0430\u043A.", missing_scope:"\u0412\u044B \u0441\u0430\u043F\u0440\u0430\u045E\u0434\u044B \u0436\u0430\u0434\u0430\u0435\u0446\u0435 \u043F\u0440\u0430\u0446\u044F\u0433\u043D\u0443\u0446\u044C \u0431\u0435\u0437 \u0443\u043A\u0430\u0437\u0430\u043D\u043D\u044F \u043C\u0435\u0436 \u0433\u044D\u0442\u0430\u0433\u0430 \u0432\u043E\u0447\u043A\u0430 \u0437\u0430\u0433\u0430\u043B\u043E\u045E\u043A\u0430? \u0411\u0435\u0437 \u0433\u044D\u0442\u0430\u0433\u0430 \u043D\u0435\u043A\u0430\u0442\u043E\u0440\u044B\u043C \u043A\u0430\u0440\u044B\u0441\u0442\u0430\u0447\u0430\u043C \u0437 \u0430\u0431\u043C\u0435\u0436\u0430\u0432\u0430\u043D\u0430\u0439 \u043F\u0440\u0430\u0446\u0430\u0437\u0434\u043E\u043B\u044C\u043D\u0430\u0441\u0446\u044E \u043C\u043E\u0436\u0430 \u0431\u044B\u0446\u044C \u0446\u044F\u0436\u043A\u0430 \u0437\u0440\u0430\u0437\u0443\u043C\u0435\u0446\u044C \u0443\u0442\u0440\u044B\u043C\u0430\u043D\u043D\u0435 \u0430\u0431\u043E \u0434\u0430\u0434\u0437\u0435\u043D\u044B\u044F \u0442\u0430\u0431\u043B\u0456\u0446\u044B.", caption:"\u0417\u0430\u0433\u0430\u043B\u043E\u0432\u0430\u043A \u0442\u0430\u0431\u043B\u0456\u0446\u044B", frame:"\u0420\u0430\u043C\u043A\u0430", frame_none:"\u043D\u0456\u0447\u043E\u0433\u0430", frame_groups:"\u0433\u0440\u0443\u043F\u044B", frame_rows:"\u0440\u0430\u0434\u043A\u0456", frame_cols:"\u0441\u043B\u0443\u043F\u043A\u0456", frame_all:"\u0443\u0441\u0451", rules:"\u041B\u0456\u043D\u0435\u0439\u043A\u0456", rules_void:"\u043D\u0456\u0448\u0442\u043E", rules_above:"\u0437\u0432\u0435\u0440\u0445\u0443", rules_below:"\u0437\u043D\u0456\u0437\u0443", rules_hsides:"\u0433\u0430\u0440\u044B\u0437\u0430\u043D\u0442\u0430\u043B\u044C\u043D\u044B\u044F \u0431\u0430\u043A\u0456", rules_lhs:"\u043B\u0435\u0432\u044B\u044F \u0433\u0430\u0440\u044B\u0437\u0430\u043D\u0442\u0430\u043B\u044C\u043D\u044B\u044F \u0431\u0430\u043A\u0456", rules_rhs:"\u043F\u0440\u0430\u0432\u044B\u044F \u0433\u0430\u0440\u044B\u0437\u0430\u043D\u0442\u0430\u043B\u044C\u043D\u044B\u044F \u0431\u0430\u043A\u0456", rules_vsides:"\u0432\u0435\u0440\u0442\u044B\u043A\u0430\u043B\u044C\u043D\u044B\u044F \u0431\u0430\u043A\u0456", rules_box:"\u043A\u0430\u043D\u0442\u044D\u0439\u043D\u0435\u0440", rules_border:"\u043C\u044F\u0436\u0430" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/bg_dlg.js000066400000000000000000000154671226600447100236430ustar00rootroot00000000000000tinyMCE.addI18n('bg.table_dlg',{ general_tab:"\u041E\u0431\u0449\u0438", advanced_tab:"\u0417\u0430 \u043D\u0430\u043F\u0440\u0435\u0434\u043D\u0430\u043B\u0438", general_props:"\u041E\u0431\u0449\u0438 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438", advanced_props:"\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u0437\u0430 \u043D\u0430\u043F\u0440\u0435\u0434\u043D\u0430\u043B\u0438", rowtype:"\u0420\u043E\u043B\u044F \u043D\u0430 \u0440\u0435\u0434\u0430", title:"\u0412\u043C\u044A\u043A\u043D\u0438/\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u0430\u0439 \u0442\u0430\u0431\u043B\u0438\u0446\u0430", width:"\u0428\u0438\u0440\u0438\u043D\u0430", height:"\u0412\u0438\u0441\u043E\u0447\u0438\u043D\u0430", cols:"\u041A\u043E\u043B\u043E\u043D\u0438", rows:"\u0420\u0435\u0434\u043E\u0432\u0435", cellspacing:"\u0420\u0430\u0437\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u043C\u044A\u0436\u0434\u0443 \u043A\u043B\u0435\u0442\u043A\u0438\u0442\u0435", cellpadding:"Padding \u043D\u0430 \u043A\u043B\u0435\u0442\u043A\u0438\u0442\u0435", border:"\u0420\u0430\u043C\u043A\u0430", align:"\u041F\u043E\u0434\u0440\u0430\u0432\u043D\u044F\u0432\u0430\u043D\u0435", align_default:"\u041F\u043E \u043F\u043E\u0434\u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043D\u0435", align_left:"\u041B\u044F\u0432\u043E", align_right:"\u0414\u044F\u0441\u043D\u043E", align_middle:"\u0426\u0435\u043D\u0442\u044A\u0440", row_title:"\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u043D\u0430 \u0440\u0435\u0434\u0430", cell_title:"\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u043D\u0430 \u043A\u043B\u0435\u0442\u043A\u0430\u0442\u0430", cell_type:"\u0422\u0438\u043F \u043D\u0430 \u043A\u043B\u0435\u0442\u043A\u0430\u0442\u0430", valign:"\u0412\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u043D\u043E \u043F\u043E\u0434\u0440\u0430\u0432\u043D\u044F\u0432\u0430\u043D\u0435", align_top:"\u0413\u043E\u0440\u0435", align_bottom:"\u0414\u043E\u043B\u0443", bordercolor:"\u0426\u0432\u044F\u0442 \u043D\u0430 \u0440\u0430\u043C\u043A\u0430\u0442\u0430", bgcolor:"\u0426\u0432\u044F\u0442 \u043D\u0430 \u0444\u043E\u043D\u0430", merge_cells_title:"\u0421\u043B\u0435\u0439 \u043A\u043B\u0435\u0442\u043A\u0438\u0442\u0435", id:"Id", style:"\u0421\u0442\u0438\u043B", langdir:"\u041F\u043E\u0441\u043E\u043A\u0430 \u043D\u0430 \u0435\u0437\u0438\u043A\u0430", langcode:"\u041A\u043E\u0434 \u043D\u0430 \u0435\u0437\u0438\u043A\u0430", mime:"MIME \u0442\u0438\u043F", ltr:"\u041E\u0442\u043B\u044F\u0432\u043E \u043D\u0430 \u0434\u044F\u0441\u043D\u043E", rtl:"\u041E\u0442\u0434\u044F\u0441\u043D\u043E \u043D\u0430 \u043B\u044F\u0432\u043E", bgimage:"\u0424\u043E\u043D\u043E\u0432\u0430 \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0430", summary:"\u041E\u0431\u043E\u0431\u0449\u0435\u043D\u0438\u0435", td:"\u0414\u0430\u043D\u0438\u043D", th:"\u0413\u043B\u0430\u0432\u0430", cell_cell:"\u041E\u0431\u043D\u043E\u0432\u0438 \u0442\u0435\u043A\u0443\u0449\u0430\u0442\u0430 \u043A\u043B\u0435\u0442\u043A\u0430Update current cell", cell_row:"\u041E\u0431\u043D\u043E\u0432\u0438 \u0432\u0441\u0438\u0447\u043A\u0438 \u043A\u043B\u0435\u0442\u043A\u0438 \u043D\u0430 \u0440\u0435\u0434\u0430", cell_all:"\u041E\u0431\u043D\u043E\u0432\u0438 \u0432\u0441\u0438\u0447\u043A\u0438 \u043A\u043B\u0435\u0442\u043A\u0438 \u0432 \u0442\u0430\u0431\u043B\u0438\u0446\u0430\u0442\u0430", row_row:"\u041E\u0431\u043D\u043E\u0432\u0438 \u0442\u0435\u043A\u0443\u0449\u0438\u044F \u0440\u0435\u0434", row_odd:"\u041E\u0431\u043D\u043E\u0432\u0438 \u043D\u0435\u0447\u0435\u0442\u043D\u0438\u0442\u0435 \u0440\u0435\u0434\u043E\u0432\u0435 \u0432 \u0442\u0430\u043B\u0438\u0446\u0430\u0442\u0430", row_even:"\u041E\u0431\u043D\u043E\u0432\u0438 \u0447\u0435\u0442\u043D\u0438\u0442\u0435 \u0440\u0435\u0434\u043E\u0432\u0435 \u0432 \u0442\u0430\u0431\u043B\u0438\u0446\u0430\u0442\u0430", row_all:"\u041E\u0431\u043D\u043E\u0432\u0438 \u0432\u0441\u0438\u0447\u043A\u0438 \u0440\u0435\u0434\u043E\u0432\u0435 \u0432 \u0442\u0430\u0431\u043B\u0438\u0446\u0430\u0442\u0430", thead:"\u0413\u043B\u0430\u0432\u0430 \u043D\u0430 \u0442\u0430\u0431\u043B\u0438\u0446\u0430\u0442\u0430", tbody:"\u0422\u044F\u043B\u043E \u043D\u0430 \u0442\u0430\u0431\u043B\u0438\u0446\u0430\u0442\u0430", tfoot:"\u0414\u044A\u043D\u043E \u043D\u0430 \u0442\u0430\u0431\u043B\u0438\u0446\u0430\u0442\u0430", scope:"\u041E\u0431\u0445\u0432\u0430\u0442", rowgroup:"\u0413\u0440\u0443\u043F\u0430 \u0440\u0435\u0434\u043E\u0432\u0435", colgroup:"\u0413\u0440\u0443\u043F\u0430 \u043A\u043E\u043B\u043E\u043D\u0438", col_limit:"\u041F\u0440\u0435\u0432\u0438\u0448\u0438\u0445\u0442\u0435 \u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u043D\u0430\u0442\u0430 \u0431\u0440\u043E\u0439\u043A\u0430 \u043A\u043E\u043B\u043E\u043D\u0438: {$cols}.", row_limit:"\u041F\u0440\u0435\u0432\u0438\u0448\u0438\u0445\u0442\u0435 \u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u043D\u0430\u0442\u0430 \u0431\u0440\u043E\u0439\u043A\u0430 \u0440\u0435\u0434\u043E\u0432\u0435: {$rows}.", cell_limit:"\u041F\u0440\u0435\u0432\u0438\u0448\u0438\u0445\u0442\u0435 \u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u043D\u0430\u0442\u0430 \u0431\u0440\u043E\u0439\u043A\u0430 \u043A\u043B\u0435\u0442\u043A\u0438: {$cells}.", missing_scope:"\u0421\u0438\u0433\u0443\u0440\u0435\u043D \u043B\u0438 \u0441\u0442\u0435 \u0447\u0435 \u0436\u0435\u043B\u0430\u0435\u0442\u0435 \u0434\u0430 \u043F\u0440\u043E\u0434\u0443\u043B\u0436\u0438\u0442\u0435 \u0431\u0435\u0437 \u0434\u0430 \u0441\u043B\u043E\u0436\u0438\u0442\u0435 \u043E\u0431\u0445\u0432\u0430\u0442 \u043D\u0430 \u0433\u043B\u0430\u0432\u0430\u0442\u0430 \u043D\u0430 \u043A\u043B\u0435\u0442\u043A\u0430\u0442\u0430. \u0411\u0435\u0437 \u043D\u0435\u0433\u043E, \u043D\u044F\u043A\u043E\u0438 \u043F\u043E\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043B\u0438 \u0441 \u043D\u0435\u0434\u044A\u0437\u0438 \u043C\u043E\u0433\u0430\u0442 \u0434\u0430 \u0438\u043C\u0430\u0442 \u043F\u0440\u043E\u0431\u043B\u0435\u043C \u0434\u0430 \u0440\u0430\u0437\u0431\u0435\u0440\u0430\u0442 \u0434\u0430\u043D\u043D\u0438\u0442\u0435 \u043F\u043E\u043A\u0430\u0437\u0430\u043D\u0438 \u0432 \u0442\u0430\u0431\u043B\u0438\u0446\u0430\u0442\u0430.", caption:"\u0417\u0430\u0433\u043B\u0430\u0432\u0438\u0435 \u043D\u0430 \u0442\u0430\u0431\u043B\u0438\u0446\u0430\u0442\u0430", frame:"\u0424\u0440\u0435\u0439\u043C", frame_none:"\u0431\u0435\u0437", frame_groups:"\u0433\u0440\u0443\u043F\u0438", frame_rows:"\u0440\u0435\u0434\u043E\u0432\u0435", frame_cols:"\u043A\u043E\u043B\u043E\u043D\u0438", frame_all:"\u0432\u0441\u0438\u0447\u043A\u0438", rules:"\u041F\u0440\u0430\u0432\u0438\u043B\u0430", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/bn_dlg.js000066400000000000000000000041311226600447100236340ustar00rootroot00000000000000tinyMCE.addI18n('bn.table_dlg',{ general_tab:"General", advanced_tab:"Advanced", general_props:"General properties", advanced_props:"Advanced properties", rowtype:"Row in table part", title:"Insert/Modify table", width:"Width", height:"Height", cols:"Cols", rows:"Rows", cellspacing:"Cellspacing", cellpadding:"Cellpadding", border:"Border", align:"Alignment", align_default:"Default", align_left:"Left", align_right:"Right", align_middle:"Center", row_title:"Table row properties", cell_title:"Table cell properties", cell_type:"Cell type", valign:"Vertical alignment", align_top:"Top", align_bottom:"Bottom", bordercolor:"Border color", bgcolor:"Background color", merge_cells_title:"Merge table cells", id:"Id", style:"Style", langdir:"Language direction", langcode:"Language code", mime:"Target MIME type", ltr:"Left to right", rtl:"Right to left", bgimage:"Background image", summary:"Summary", td:"Data", th:"Header", cell_cell:"Update current cell", cell_row:"Update all cells in row", cell_all:"Update all cells in table", row_row:"Update current row", row_odd:"Update odd rows in table", row_even:"Update even rows in table", row_all:"Update all rows in table", thead:"Table Head", tbody:"Table Body", tfoot:"Table Foot", scope:"Scope", rowgroup:"Row Group", colgroup:"Col Group", col_limit:"You've exceeded the maximum number of columns of {$cols}.", row_limit:"You've exceeded the maximum number of rows of {$rows}.", cell_limit:"You've exceeded the maximum number of cells of {$cells}.", missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.", caption:"Table caption", frame:"Frame", frame_none:"none", frame_groups:"groups", frame_rows:"rows", frame_cols:"cols", frame_all:"all", rules:"Rules", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/br_dlg.js000066400000000000000000000043541226600447100236470ustar00rootroot00000000000000tinyMCE.addI18n('br.table_dlg',{ general_tab:"Geral", advanced_tab:"Avan\u00E7ado", general_props:"Propriedades gerais", advanced_props:"Propriedades avan\u00E7adas", rowtype:"Linha na parte da tabela", title:"Inserir/modificar tabela", width:"Largura", height:"Altura", cols:"Colunas", rows:"Linhas", cellspacing:"Cellspacing", cellpadding:"Cellpadding", border:"Limites", align:"Alinhamento", align_default:"Padr\u00E3o", align_left:"Esquerda", align_right:"Direita", align_middle:"Centro", row_title:"Propriedades de linhas", cell_title:"Propriedades de c\u00E9lulas", cell_type:"Tipo de c\u00E9lula", valign:"Alinhamento vertical", align_top:"Topo", align_bottom:"Abaixo", bordercolor:"Cor dos limites", bgcolor:"Cor de fundo", merge_cells_title:"Unir c\u00E9lulas", id:"Id", style:"Estilo", langdir:"Dire\u00E7\u00E3o do texto", langcode:"C\u00F3digo da linguagem", mime:"MIME alvo", ltr:"Da esquerda para a direita", rtl:"Da direita para a esquerda", bgimage:"Imagem de fundo", summary:"Sum\u00E1rio", td:"Dados", th:"Campo", cell_cell:"Atualizar esta c\u00E9lula", cell_row:"Atualizar todas as c\u00E9lulas na linha", cell_all:"Atualizar todas as c\u00E9lulas na tabela", row_row:"Atcualizar esta linha", row_odd:"Atualizar linhas \u00EDmpares", row_even:"Atualizar linhas pares", row_all:"Atualizar todas as linhas", thead:"Topo da tabela", tbody:"Corpo da tabela", tfoot:"Rodap\u00E9 da tabela", scope:"Alcance", rowgroup:"Grupo linhas", colgroup:"Grupo colunas", col_limit:"Excedeu o n\u00FAmero m\u00E1ximo de colunas de {$cols}.", row_limit:"Excedeu o n\u00FAmero m\u00E1ximo de linhas de {$rows}.", cell_limit:"Excedeu o n\u00FAmero m\u00E1ximo de c\u00E9lulas de {$cells}.", missing_scope:"Tem certeza de que quer continuar sem especificar um escopo para esta c\u00E9lula? (Isso poder\u00E1 causar dificuldades a usu\u00E1rios deficientes)", caption:"T\u00EDtulo da tabela", frame:"Frame", frame_none:"Nenhum", frame_groups:"Grupos", frame_rows:"Linhas", frame_cols:"colunas", frame_all:"Todos", rules:"Regras", rules_void:"void", rules_above:"acima", rules_below:"abaixo", rules_hsides:"Hsides", rules_lhs:"Lhs", rules_rhs:"Rhs", rules_vsides:"Vsides", rules_box:"Box", rules_border:"Limites" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/bs_dlg.js000066400000000000000000000043211226600447100236420ustar00rootroot00000000000000tinyMCE.addI18n('bs.table_dlg',{ general_tab:"Osnovno", advanced_tab:"Napredno", general_props:"Osnovna svojstva", advanced_props:"Napredna svojstva", rowtype:"Row in table part", title:"Umetni/uredi tablicu", width:"\u0160irina", height:"Visina", cols:"Stupaca", rows:"Redaka", cellspacing:"Razmak \u0107elija", cellpadding:"Dopuna \u0107elije", border:"Obrub", align:"Poravnavanje", align_default:"Zadano", align_left:"Lijevo", align_right:"Desno", align_middle:"Sredina", row_title:"Svojstva retka", cell_title:"Svojstva \u0107elije", cell_type:"Tip \u0107elije", valign:"Okomito poravnavanje", align_top:"Vrh", align_bottom:"Dno", bordercolor:"Boja obruba", bgcolor:"Background color", merge_cells_title:"Spoji \u0107elije", id:"Id", style:"Stil", langdir:"Smjer jezika", langcode:"Kod jezika", mime:"MIME tip", ltr:"S lijeva na desno", rtl:"S desna na lijevo", bgimage:"Slika pozadine", summary:"Sa\u017Eetak", td:"Podatkovna", th:"Zaglavlje", cell_cell:"Primjeni na odabranu \u0107eliju", cell_row:"Primjeni na sve \u0107elije u retku", cell_all:"Primjeni na sve \u0107elije u tablici", row_row:"Primjeni na odabrani redak", row_odd:"Primjeni na neparne retke u tablici", row_even:"Primjeni na parne retke u tablici", row_all:"Primjeni na sve retke u tablici", thead:"Zaglavlje tablice", tbody:"Tijelo tablice", tfoot:"Podno\u017Eje tablice", scope:"Domet", rowgroup:"Grupa redaka", colgroup:"Grupa stupaca", col_limit:"Prema\u0161ili ste maksimalni broj stupaca ({$cols}).", row_limit:"Prema\u0161ili ste maksimalni broj redaka ({$rows}).", cell_limit:"Prema\u0161ili ste maksimalni broj \u0107elija ({$cells}).", missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.", caption:"Opis tablice", frame:"Frame", frame_none:"none", frame_groups:"groups", frame_rows:"rows", frame_cols:"cols", frame_all:"all", rules:"Rules", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/ca_dlg.js000066400000000000000000000044731226600447100236310ustar00rootroot00000000000000tinyMCE.addI18n('ca.table_dlg',{ general_tab:"General", advanced_tab:"Avan\u00E7at", general_props:"Propietats generals", advanced_props:"Propietats avan\u00E7ades", rowtype:"Fila", title:"Insereix/Modifica taula", width:"Amplada", height:"Al\u00E7ada", cols:"Columnes", rows:"Files", cellspacing:"Espaiat de cel\u00B7la", cellpadding:"Separaci\u00F3 de cel\u00B7la", border:"Vora", align:"Alineaci\u00F3", align_default:"Per defecte", align_left:"Esquerra", align_right:"Dreta", align_middle:"Centre", row_title:"Propietats de fila", cell_title:"Propietats de cel\u00B7la", cell_type:"Tipus de cel\u00B7la", valign:"Alineaci\u00F3 vertical", align_top:"A dalt", align_bottom:"A baix", bordercolor:"Color de vora", bgcolor:"Color de fons", merge_cells_title:"Fusiona cel\u00B7les", id:"Id", style:"Estil", langdir:"Direcci\u00F3 de l\'idioma", langcode:"Codi de l\'idioma", mime:"Tipus MIME", ltr:"D\'esquerra a dreta", rtl:"De dreta a esquerra", bgimage:"Imatge de fons", summary:"Resum", td:"Dades", th:"Cap\u00E7alera", cell_cell:"Actualitza la cel\u00B7la", cell_row:"Actualitza totes les cel\u00B7les de la fila", cell_all:"Actualitza totes les cel\u00B7les de la taula", row_row:"Actualitza la fila", row_odd:"Actualitza les files senars", row_even:"Actualitza les files parells", row_all:"Actualitza totes les files", thead:"Cap\u00E7alera de la taula", tbody:"Cos de la taula", tfoot:"Peu de la taula", scope:"Abast", rowgroup:"Grup de files", colgroup:"Grup de columnes", col_limit:"Heu superat el nombre m\u00E0xim de columnes de {$cols}.", row_limit:"Heu superat el nombre m\u00E0xim de files de {$rows}.", cell_limit:"Heu superat el nombre m\u00E0xim de cel\u00B7les de {$cells}..", missing_scope:"Esteu segur que voleu continuar sense indicar un abast per a aquesta cel\u00B7la de cap\u00E7alera. Pot ser dif\u00EDcil per a alguns usuaris amb discapacitats entendre el contingut o les dades mostrades a la taula.", caption:"T\u00EDtol de la taula", frame:"Marc", frame_none:"cap", frame_groups:"grups", frame_rows:"files", frame_cols:"columnes", frame_all:"tot", rules:"Regles", rules_void:"buit", rules_above:"per damunt de", rules_below:"per sota de", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"quadre", rules_border:"vora" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/ch_dlg.js000066400000000000000000000054171226600447100236370ustar00rootroot00000000000000tinyMCE.addI18n('ch.table_dlg',{ general_tab:"\u5E38\u89C4", advanced_tab:"\u9AD8\u7EA7", general_props:"\u5E38\u89C4\u5C5E\u6027", advanced_props:"\u9AD8\u7EA7\u5C5E\u6027", rowtype:"\u884C\u6240\u5728\u7684\u8868\u683C\u4F4D\u7F6E", title:"\u63D2\u5165/\u7F16\u8F91\u8868\u683C", width:"\u5BBD\u5EA6", height:"\u9AD8\u5EA6", cols:"\u5217\u6570", rows:"\u884C\u6570", cellspacing:"\u5355\u5143\u683C\u95F4\u8DDD", cellpadding:"\u5355\u5143\u683C\u7559\u767D", border:"\u8FB9\u6846", align:"\u5BF9\u9F50\u65B9\u5F0F", align_default:"\u9884\u8BBE", align_left:"\u5C45\u5DE6", align_right:"\u5C45\u53F3", align_middle:"\u5C45\u4E2D", row_title:"\u884C\u5C5E\u6027", cell_title:"\u5355\u5143\u683C\u5C5E\u6027", cell_type:"\u5355\u5143\u683C\u522B", valign:"\u6C34\u5E73\u5BF9\u9F50\u65B9\u5F0F", align_top:"\u4E0A\u65B9", align_bottom:"\u4E0B\u65B9", bordercolor:"\u8FB9\u6846\u989C\u8272", bgcolor:"\u80CC\u666F\u989C\u8272", merge_cells_title:"\u5408\u5E76\u5355\u5143\u683C", id:"Id", style:"\u6837\u5F0F", langdir:"\u8BED\u8A00\u4E66\u5199\u65B9\u5411", langcode:"\u8BED\u8A00\u7F16\u7801", mime:"\u76EE\u6807MIME\u7C7B\u578B", ltr:"\u7531\u5DE6\u5230\u53F3", rtl:"\u7531\u53F3\u5230\u5DE6", bgimage:"\u80CC\u666F\u56FE\u50CF", summary:"\u6982\u8981", td:"\u6570\u636E", th:"\u8868\u5934", cell_cell:"\u66F4\u65B0\u6240\u7684\u5355\u5143\u683C", cell_row:"\u66F4\u65B0\u6240\u5728\u884C\u7684\u5168\u90E8\u5355\u5143\u683C", cell_all:"\u66F4\u65B0\u8868\u683C\u5185\u7684\u5168\u90E8\u5355\u5143\u683C", row_row:"\u66F4\u65B0\u6240\u5728\u884C", row_odd:"\u66F4\u65B0\u8868\u683C\u5185\u7684\u5947\u6570\u884C", row_even:"\u66F4\u65B0\u8868\u683C\u5185\u7684\u5076\u6570\u884C", row_all:"\u66F4\u65B0\u8868\u683C\u5185\u5168\u90E8\u884C", thead:"\u8868\u5934", tbody:"\u8868\u8EAB", tfoot:"\u8868\u5C3E", scope:"\u8303\u56F4", rowgroup:"\u884C\u5206\u7EC4", colgroup:"\u5217\u5206\u7EC4", col_limit:"\u5DF2\u8D85\u8FC7\u53EF\u7528\u6570\uFF0C\u6700\u9AD8\u7684\u5217\u6570\u4E3A{$cols}\u5217\u3002", row_limit:"\u5DF2\u8D85\u8FC7\u53EF\u7528\u6570\uFF0C\u6700\u9AD8\u7684\u884C\u6570\u4E3A{$rows}\u884C\u3002", cell_limit:"\u5DF2\u8D85\u8FC7\u53EF\u7528\u6570\uFF0C\u6700\u9AD8\u7684\u5355\u5143\u683C\u6570\u4E3A{$cells}\u683C\u3002", missing_scope:"\u672A\u6307\u5B9A\u6B64\u8868\u683C\u6807\u9898\u884C\uFF01", caption:"\u8868\u683C\u6807\u9898", frame:"\u8FB9\u6846", frame_none:"\u65E0", frame_groups:"\u5206\u7EC4", frame_rows:"\u884C", frame_cols:"\u5217", frame_all:"\u5168\u90E8", rules:"\u7EBF\u6761", rules_void:"\u7A7A", rules_above:"\u4E0A", rules_below:"\u4E0B", rules_hsides:"\u6C34\u5E73\u8FB9", rules_lhs:"\u5DE6\u8FB9", rules_rhs:"\u53F3\u8FB9", rules_vsides:"\u5782\u76F4\u8FB9", rules_box:"\u533A\u5757", rules_border:"\u8FB9\u6846" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/cs_dlg.js000066400000000000000000000053511226600447100236470ustar00rootroot00000000000000tinyMCE.addI18n('cs.table_dlg',{ general_tab:"Hlavn\u00ED", advanced_tab:"Pokro\u010Dil\u00E9", general_props:"Hlavn\u00ED nastaven\u00ED", advanced_props:"Pokro\u010Dil\u00E9 nastaven\u00ED", rowtype:"Typ \u0159\u00E1dku", title:"Vlo\u017Eit/upravit tabulku", width:"\u0160\u00ED\u0159ka", height:"V\u00FD\u0161ka", cols:"Sloupce", rows:"\u0158\u00E1dky", cellspacing:"Rozestup bun\u011Bk", cellpadding:"Odsazen\u00ED obsahu", border:"R\u00E1me\u010Dek", align:"Zarovn\u00E1n\u00ED", align_default:"V\u00FDchoz\u00ED", align_left:"Vlevo", align_right:"Vpravo", align_middle:"Doprost\u0159ed", row_title:"Vlastnosti \u0159\u00E1dku", cell_title:"Vlastnosti bu\u0148ky", cell_type:"Typ bu\u0148ky", valign:"Vertik\u00E1ln\u00ED zarovn\u00E1n\u00ED", align_top:"Nahoru", align_bottom:"Dol\u016F", bordercolor:"Barva r\u00E1me\u010Dku", bgcolor:"Barva pozad\u00ED", merge_cells_title:"Spojit bu\u0148ky", id:"ID", style:"Styl", langdir:"Sm\u011Br textu", langcode:"K\u00F3d jazyka", mime:"MIME typ c\u00EDle", ltr:"Zleva doprava", rtl:"Zprava doleva", bgimage:"Obr\u00E1zek pozad\u00ED", summary:"Sum\u00E1\u0159", td:"Data", th:"Z\u00E1hlav\u00ED", cell_cell:"Aktualizovat zvolenou bu\u0148ku", cell_row:"Aktualizovat v\u0161echny bu\u0148ky v \u0159\u00E1dku", cell_all:"Aktualizovat v\u0161echny bu\u0148ky v tabulce", row_row:"Aktualizovat zvolen\u00FD \u0159\u00E1dek", row_odd:"Aktualizovat lich\u00E9 \u0159\u00E1dky tabulky", row_even:"Aktualizovat sud\u00E9 \u0159\u00E1dky tabulky", row_all:"Aktualizovat v\u0161echny \u0159\u00E1dky tabulky", thead:"Hlavi\u010Dka tabulky", tbody:"T\u011Blo tabulky", tfoot:"Pata tabulky", scope:"Zv\u00FDrazn\u011Bn\u00ED", rowgroup:"Skupina \u0159\u00E1dk\u016F", colgroup:"Skupina sloupc\u016F", col_limit:"P\u0159ekro\u010Dili jste maxim\u00E1ln\u00ED po\u010Det sloupc\u016F {$cols}.", row_limit:"P\u0159ekro\u010Dili jste maxim\u00E1ln\u00ED po\u010Det \u0159\u00E1dk\u016F {$rows}.", cell_limit:"P\u0159ekro\u010Dili jste maxim\u00E1ln\u00ED po\u010Det bun\u011Bk {$cells}.", missing_scope:"Jste si jist\u00ED, \u017Ee nechcete definovat zv\u00FDrazn\u011Bn\u00ED pro tuto hlavi\u010Dkovou bu\u0148ku (hlavi\u010Dku \u0159\u00E1dku nebo sloupce)? Bez n\u011Bj mo\u017En\u00E1 nebude mo\u017En\u00E9 spr\u00E1vn\u011B pochopit zobrazen\u00FD obsah \u010Di data tabulky.", caption:"Nadpis tabulky", frame:"R\u00E1m (frame)", frame_none:"\u017E\u00E1dn\u00FD", frame_groups:"skupiny", frame_rows:"\u0159\u00E1dky", frame_cols:"sloupce", frame_all:"v\u0161e", rules:"Pravidla (rules)", rules_void:"void", rules_above:"nad", rules_below:"pod", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"r\u00E1me\u010Dek" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/cy_dlg.js000066400000000000000000000042411226600447100236520ustar00rootroot00000000000000tinyMCE.addI18n('cy.table_dlg',{ general_tab:"Cyffredinol", advanced_tab:"Uwch", general_props:"Priodweddau cyffredinol", advanced_props:"Priodweddau uwch", rowtype:"Rhes mewn rhan tabl", title:"Mewnosod/Golygu tabl", width:"Lled", height:"Uchder", cols:"Colofnau", rows:"Rhesi", cellspacing:"Bylchiad celloedd", cellpadding:"Padio celloedd", border:"Border", align:"Aliniad", align_default:"Rhagosodedig", align_left:"Chwith", align_right:"De", align_middle:"Canol", row_title:"Priodweddau rhes tabl", cell_title:"Priodweddau cell tabl", cell_type:"Math cell", valign:"Aliniad ferigol", align_top:"Pen", align_bottom:"Gwaelod", bordercolor:"Lliw border", bgcolor:"Lliw cefndir", merge_cells_title:"Cyfuno celloedd tabl", id:"Id", style:"Arddull", langdir:"Cyfeiriad iaith", langcode:"Cod iaith", mime:"Math MIME targed", ltr:"Chwith i'r dde", rtl:"De i'r chwith", bgimage:"Delwedd cefndir", summary:"Crynodeb", td:"Data", th:"Pennyn", cell_cell:"Diweddaru cell cyfredol", cell_row:"Diweddaru pob cell yn y rhes", cell_all:"Diweddaru pob cell yn y tabl", row_row:"Diweddaru rhes cyfredol", row_odd:"Diweddaru rhesi odrif yn y tabl", row_even:"Diweddaru rhesi eilrif yn y tabl", row_all:"Diweddaru pob rhes yn y tabl", thead:"Pen Tabl", tbody:"Corff Tabl", tfoot:"Troed Tabl", scope:"Cwmpas", rowgroup:"Gr\u0175p Rhesi", colgroup:"Gr\u0175p Colofnau", col_limit:"Rydych wedi mynd tu twnt i'r nifer uchafswm {$cols} o golofnau.", row_limit:"Rydych wedi mynd tu twnt i'r nifer uchafswm {$rows} o rhesi.", cell_limit:"Rydych wedi mynd tu twnt i'r nifer uchafswm {$cells} o celloedd.", missing_scope:"A ydych chi'n si\u0175r eich bod eisiau parhau heb penodi cwmpas i'r cell pennyn yma? Hebddo fo, efallai fydd o'n anodd i rhai ddefnyddwyr gyda anableddau i ddeallt y cynnwys neu'r data yn y tabl.", caption:"Egluryn tabl", frame:"Ffr\u00E2m", frame_none:"none", frame_groups:"groups", frame_rows:"rows", frame_cols:"cols", frame_all:"all", rules:"Rheolau", rules_void:"void", rules_above:"above", rules_below:"o dan", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/da_dlg.js000066400000000000000000000043371226600447100236310ustar00rootroot00000000000000tinyMCE.addI18n('da.table_dlg',{ general_tab:"Generelt", advanced_tab:"Avanceret", general_props:"Generelle egenskaber", advanced_props:"Avancerede egenskaber", rowtype:"Row in table part", title:"Inds\u00E6t/rediger tabel", width:"Bredde", height:"H\u00F8jde", cols:"Kolonner", rows:"R\u00E6kker", cellspacing:"Afstand mellem celler", cellpadding:"Afstand til celleindhold", border:"Kant", align:"Justering", align_default:"Standard", align_left:"Venstre", align_right:"H\u00F8jre", align_middle:"Centreret", row_title:"R\u00E6kkeegenskaber", cell_title:"Celleegenskaber", cell_type:"Celletype", valign:"Vertikal justering", align_top:"Top", align_bottom:"Bund", bordercolor:"Kantfarve", bgcolor:"Baggrundsfarve", merge_cells_title:"Flet celler", id:"Id", style:"Style", langdir:"Sprogretning", langcode:"Sprogkode", mime:"Destinations-MIME-type", ltr:"Venstre mod h\u00F8jre", rtl:"H\u00F8jre mod venstre", bgimage:"Baggrundsbillede", summary:"Beskrivelse", td:"Data", th:"Hoved", cell_cell:"Opdater aktuelle celle", cell_row:"Opdater alle celler i r\u00E6kken", cell_all:"Opdater alle celler i tabellen", row_row:"Opdater aktuelle celle", row_odd:"Opdater ulige r\u00E6kker", row_even:"Opdater lige r\u00E6kker", row_all:"Opdater alle r\u00E6kker", thead:"Tabelhoved", tbody:"Tabelkrop", tfoot:"Tabelfod", scope:"Forklaring", rowgroup:"R\u00E6kkegruppe", colgroup:"Kolonnegruppe", col_limit:"Du har overskredet antallet af tilladte kolonner p\u00E5 {$cols}.", row_limit:"Du har overskredet antallet af tilladte r\u00E6kker p\u00E5 {$rows}.", cell_limit:"Du har overskredet antallet af tilladte celler p\u00E5 {$cells}.", missing_scope:"Er du sikker p\u00E5, du vil forts\u00E6tte uden at angive forklaring for denne overskriftscelle? Uden forklaring vil v\u00E6re sv\u00E6rt for f.ek.s blinde at l\u00E6se og forst\u00E5 indholdet i tabellen.", caption:"Tabeloverskrift", frame:"Ramme", frame_none:"ingen", frame_groups:"grupper", frame_rows:"r\u00E6kker", frame_cols:"kolonner", frame_all:"alle", rules:"Regler", rules_void:"void", rules_above:"over", rules_below:"under", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"boks", rules_border:"kant" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/de_dlg.js000066400000000000000000000046521226600447100236350ustar00rootroot00000000000000tinyMCE.addI18n('de.table_dlg',{ general_tab:"Allgemein", advanced_tab:"Erweitert", general_props:"Allgemeine Einstellungen", advanced_props:"Erweiterte Einstellungen", rowtype:"Gruppierung", title:"Tabelle einf\u00FCgen/bearbeiten", width:"Breite", height:"H\u00F6he", cols:"Spalten", rows:"Zeilen", cellspacing:"Zellenabstand", cellpadding:"Abstand innerhalb der Zellen", border:"Rahmen", align:"Ausrichtung", align_default:"Standard", align_left:"Links", align_right:"Rechts", align_middle:"Mittig", row_title:"Eigenschaften der Zeile", cell_title:"Eigenschaften der Zelle", cell_type:"Zellentyp", valign:"Vertikale Ausrichtung", align_top:"Oben", align_bottom:"Unten", bordercolor:"Rahmenfarbe", bgcolor:"Hintergrundfarbe", merge_cells_title:"Zellen vereinen", id:"ID", style:"Format", langdir:"Schriftrichtung", langcode:"Sprachcode", mime:"MIME-Type des Inhalts", ltr:"Links nach rechts", rtl:"Rechts nach links", bgimage:"Hintergrundbild", summary:"Zusammenfassung", td:"Textzelle", th:"\u00DCberschrift", cell_cell:"Diese Zelle ver\u00E4ndern", cell_row:"Alle Zellen in dieser Zeile ver\u00E4ndern", cell_all:"Alle Zellen der Tabelle ver\u00E4ndern", row_row:"Diese Zeile ver\u00E4ndern", row_odd:"Ungerade Zeilen ver\u00E4ndern", row_even:"Gerade Zeilen ver\u00E4ndern", row_all:"Alle Zeilen ver\u00E4ndern", thead:"Tabellenkopf", tbody:"Tabelleninhalt", tfoot:"Tabellenfu\u00DF", scope:"Bezug", rowgroup:"Vertikal gruppieren", colgroup:"Horizontal gruppieren", col_limit:"Sie haben die maximale Spaltenzahl von {$cols} \u00FCberschritten.", row_limit:"Sie haben die maximale Zeilenzahl von {$rows} \u00FCberschritten.", cell_limit:"Sie haben die maximale Zellenzahl von {$cells} \u00FCberschritten.", missing_scope:"Wollen Sie wirklich keine Beziehung f\u00FCr diese \u00DCberschrift angeben? Benutzer mit k\u00F6rperlichen Einschr\u00E4nkungen k\u00F6nnten Schwierigkeiten haben, den Inhalt der Tabelle zu verstehen.", caption:"Beschriftung der Tabelle", frame:"Rahmen", frame_none:"keine", frame_groups:"zwischen Gruppen", frame_rows:"zwischen Zeilen", frame_cols:"zwischen Spalten", frame_all:"zwischen allen Zellen", rules:"Gitter", rules_void:"keins", rules_above:"nur oben", rules_below:"nur unten", rules_hsides:"oben und unten", rules_lhs:"nur links", rules_rhs:"nur rechts", rules_vsides:"links und rechts", rules_box:"alle 4 Seiten (Box)", rules_border:"alle 4 Seiten (Border)" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/dv_dlg.js000066400000000000000000000041311226600447100236460ustar00rootroot00000000000000tinyMCE.addI18n('dv.table_dlg',{ general_tab:"General", advanced_tab:"Advanced", general_props:"General properties", advanced_props:"Advanced properties", rowtype:"Row in table part", title:"Insert/Modify table", width:"Width", height:"Height", cols:"Cols", rows:"Rows", cellspacing:"Cellspacing", cellpadding:"Cellpadding", border:"Border", align:"Alignment", align_default:"Default", align_left:"Left", align_right:"Right", align_middle:"Center", row_title:"Table row properties", cell_title:"Table cell properties", cell_type:"Cell type", valign:"Vertical alignment", align_top:"Top", align_bottom:"Bottom", bordercolor:"Border color", bgcolor:"Background color", merge_cells_title:"Merge table cells", id:"Id", style:"Style", langdir:"Language direction", langcode:"Language code", mime:"Target MIME type", ltr:"Left to right", rtl:"Right to left", bgimage:"Background image", summary:"Summary", td:"Data", th:"Header", cell_cell:"Update current cell", cell_row:"Update all cells in row", cell_all:"Update all cells in table", row_row:"Update current row", row_odd:"Update odd rows in table", row_even:"Update even rows in table", row_all:"Update all rows in table", thead:"Table Head", tbody:"Table Body", tfoot:"Table Foot", scope:"Scope", rowgroup:"Row Group", colgroup:"Col Group", col_limit:"You've exceeded the maximum number of columns of {$cols}.", row_limit:"You've exceeded the maximum number of rows of {$rows}.", cell_limit:"You've exceeded the maximum number of cells of {$cells}.", missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.", caption:"Table caption", frame:"Frame", frame_none:"none", frame_groups:"groups", frame_rows:"rows", frame_cols:"cols", frame_all:"all", rules:"Rules", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/el_dlg.js000066400000000000000000000200251226600447100236350ustar00rootroot00000000000000tinyMCE.addI18n('el.table_dlg',{ general_tab:"\u0393\u03B5\u03BD\u03B9\u03BA\u03AC", advanced_tab:"\u0393\u03B9\u03B1 \u03C0\u03C1\u03BF\u03C7\u03C9\u03C1\u03B7\u03BC\u03AD\u03BD\u03BF\u03C5\u03C2", general_props:"\u0393\u03B5\u03BD\u03B9\u03BA\u03AD\u03C2 \u03B9\u03B4\u03B9\u03CC\u03C4\u03B7\u03C4\u03B5\u03C2", advanced_props:"\u03A0\u03C1\u03BF\u03C7\u03C9\u03C1\u03B7\u03BC\u03AD\u03BD\u03B5\u03C2 \u03B9\u03B4\u03B9\u03CC\u03C4\u03B7\u03C4\u03B5\u03C2", rowtype:"\u0393\u03C1\u03B1\u03BC\u03BC\u03AE \u03C3\u03B5 \u03BC\u03AD\u03C1\u03BF\u03C2 \u03C0\u03AF\u03BD\u03B1\u03BA\u03B1", title:"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE/\u03B5\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1 \u03C0\u03AF\u03BD\u03B1\u03BA\u03B1", width:"\u03A0\u03BB\u03AC\u03C4\u03BF\u03C2", height:"\u038E\u03C8\u03BF\u03C2", cols:"\u03A3\u03C4\u03AE\u03BB\u03B5\u03C2", rows:"\u0393\u03C1\u03B1\u03BC\u03BC\u03AD\u03C2", cellspacing:"\u0391\u03C0\u03CC\u03C3\u03C4\u03B1\u03C3\u03B7 \u03BA\u03B5\u03BB\u03B9\u03CE\u03BD", cellpadding:"\u0393\u03AD\u03BC\u03B9\u03C3\u03BC\u03B1 \u03BA\u03B5\u03BB\u03B9\u03CE\u03BD", border:"\u03A0\u03BB\u03B1\u03AF\u03C3\u03B9\u03BF", align:"\u03A3\u03C4\u03BF\u03AF\u03C7\u03B9\u03C3\u03B7", align_default:"\u03A0\u03C1\u03BF\u03B5\u03C0\u03B9\u03BB\u03B5\u03B3\u03BC\u03AD\u03BD\u03B7", align_left:"\u0391\u03C1\u03B9\u03C3\u03C4\u03B5\u03C1\u03AC", align_right:"\u0394\u03B5\u03BE\u03B9\u03AC", align_middle:"\u039A\u03AD\u03BD\u03C4\u03C1\u03BF", row_title:"\u0399\u03B4\u03B9\u03CC\u03C4\u03B7\u03C4\u03B5\u03C2 \u03B3\u03C1\u03B1\u03BC\u03BC\u03AE\u03C2 \u03C0\u03AF\u03BD\u03B1\u03BA\u03B1", cell_title:"\u0399\u03B4\u03B9\u03CC\u03C4\u03B7\u03C4\u03B5\u03C2 \u03BA\u03B5\u03BB\u03B9\u03BF\u03CD \u03C0\u03AF\u03BD\u03B1\u03BA\u03B1", cell_type:"\u03A4\u03CD\u03C0\u03BF\u03C2 \u03BA\u03B5\u03BB\u03B9\u03BF\u03CD", valign:"\u039A\u03B1\u03C4\u03B1\u03BA\u03CC\u03C1\u03C5\u03C6\u03B7 \u03C3\u03C4\u03BF\u03AF\u03C7\u03B9\u03C3\u03B7", align_top:"\u03A0\u03AC\u03BD\u03C9", align_bottom:"\u039A\u03AC\u03C4\u03C9", bordercolor:"\u03A7\u03C1\u03CE\u03BC\u03B1 \u03C0\u03BB\u03B1\u03B9\u03C3\u03AF\u03BF\u03C5", bgcolor:"\u03A7\u03C1\u03CE\u03BC\u03B1 \u03C6\u03CC\u03BD\u03C4\u03BF\u03C5", merge_cells_title:"\u03A3\u03C5\u03B3\u03C7\u03CE\u03BD\u03B5\u03C5\u03C3\u03B7 \u03BA\u03B5\u03BB\u03B9\u03CE\u03BD \u03C0\u03AF\u03BD\u03B1\u03BA\u03B1", id:"Id", style:"\u03A3\u03C4\u03C5\u03BB", langdir:"\u039A\u03B1\u03C4\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 \u03B3\u03BB\u03CE\u03C3\u03C3\u03B1\u03C2", langcode:"\u039A\u03C9\u03B4\u03B9\u03BA\u03CC\u03C2 \u03B3\u03BB\u03CE\u03C3\u03C3\u03B1\u03C2", mime:"\u03A4\u03CD\u03C0\u03BF\u03C2 MIME \u03C3\u03C4\u03CC\u03C7\u03BF\u03C5", ltr:"\u0391\u03C1\u03B9\u03C3\u03C4\u03B5\u03C1\u03AC \u03C0\u03C1\u03BF\u03C2 \u03B4\u03B5\u03BE\u03B9\u03AC", rtl:"\u0394\u03B5\u03BE\u03B9\u03AC \u03C0\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03C3\u03C4\u03B5\u03C1\u03AC", bgimage:"\u0395\u03B9\u03BA\u03CC\u03BD\u03B1 \u03C6\u03CC\u03BD\u03C4\u03BF\u03C5", summary:"\u03A0\u03B5\u03C1\u03AF\u03BB\u03B7\u03C8\u03B7", td:"\u0394\u03B5\u03B4\u03BF\u03BC\u03AD\u03BD\u03B1", th:"\u0395\u03C0\u03B9\u03BA\u03B5\u03C6\u03B1\u03BB\u03AF\u03B4\u03B1", cell_cell:"\u0395\u03BD\u03B7\u03BC\u03AD\u03C1\u03C9\u03C3\u03B7 \u03C4\u03C1\u03AD\u03C7\u03BF\u03BD\u03C4\u03BF\u03C2 \u03BA\u03B5\u03BB\u03B9\u03BF\u03CD", cell_row:"\u0395\u03BD\u03B7\u03BC\u03AD\u03C1\u03C9\u03C3\u03B7 \u03CC\u03BB\u03C9\u03BD \u03C4\u03C9\u03BD \u03BA\u03B5\u03BB\u03B9\u03CE\u03BD \u03C4\u03B7\u03C2 \u03B3\u03C1\u03B1\u03BC\u03BC\u03AE\u03C2", cell_all:"\u0395\u03BD\u03B7\u03BC\u03AD\u03C1\u03C9\u03C3\u03B7 \u03CC\u03BB\u03C9\u03BD \u03C4\u03C9\u03BD \u03BA\u03B5\u03BB\u03B9\u03CE\u03BD \u03C4\u03BF\u03C5 \u03C0\u03AF\u03BD\u03B1\u03BA\u03B1", row_row:"\u0395\u03BD\u03B7\u03BC\u03AD\u03C1\u03C9\u03C3\u03B7 \u03C4\u03B7\u03C2 \u03C4\u03C1\u03AD\u03C7\u03BF\u03C5\u03C3\u03B1\u03C2 \u03B3\u03C1\u03B1\u03BC\u03BC\u03AE\u03C2", row_odd:"\u0395\u03BD\u03B7\u03BC\u03AD\u03C1\u03C9\u03C3\u03B7 \u03C4\u03C9\u03BD \u03BC\u03BF\u03BD\u03CE\u03BD \u03B3\u03C1\u03B1\u03BC\u03BC\u03CE\u03BD \u03C4\u03BF\u03C5 \u03C0\u03AF\u03BD\u03B1\u03BA\u03B1", row_even:"\u0395\u03BD\u03B7\u03BC\u03AD\u03C1\u03C9\u03C3\u03B7 \u03C4\u03C9\u03BD \u03B6\u03C5\u03B3\u03CE\u03BD \u03B3\u03C1\u03B1\u03BC\u03BC\u03CE\u03BD \u03C4\u03BF\u03C5 \u03C0\u03AF\u03BD\u03B1\u03BA\u03B1", row_all:"\u0395\u03BD\u03B7\u03BC\u03AD\u03C1\u03C9\u03C3\u03B7 \u03CC\u03BB\u03C9\u03BD \u03C4\u03C9\u03BD \u03B3\u03C1\u03B1\u03BC\u03BC\u03CE\u03BD \u03C4\u03BF\u03C5 \u03C0\u03AF\u03BD\u03B1\u03BA\u03B1", thead:"\u039A\u03BF\u03C1\u03C5\u03C6\u03AE \u03C0\u03AF\u03BD\u03B1\u03BA\u03B1", tbody:"\u03A3\u03CE\u03BC\u03B1 \u03C0\u03AF\u03BD\u03B1\u03BA\u03B1", tfoot:"\u0392\u03AC\u03C3\u03B7 \u03C0\u03AF\u03BD\u03B1\u03BA\u03B1", scope:"\u0395\u03BC\u03B2\u03AD\u03BB\u03B5\u03B9\u03B1", rowgroup:"\u039F\u03BC\u03AC\u03B4\u03B1 \u03B3\u03C1\u03B1\u03BC\u03BC\u03CE\u03BD", colgroup:"\u039F\u03BC\u03AC\u03B4\u03B1 \u03C3\u03C4\u03B7\u03BB\u03CE\u03BD", col_limit:"\u0388\u03C7\u03B5\u03C4\u03B5 \u03BE\u03B5\u03C0\u03B5\u03C1\u03AC\u03C3\u03B5\u03B9 \u03C4\u03BF \u03CC\u03C1\u03B9\u03BF \u03C4\u03C9\u03BD \u03C3\u03C4\u03B7\u03BB\u03C9\u03BD \u03C0\u03BF\u03C5 \u03B5\u03AF\u03BD\u03B1\u03B9 {$cols}.", row_limit:"\u0388\u03C7\u03B5\u03C4\u03B5 \u03BE\u03B5\u03C0\u03B5\u03C1\u03AC\u03C3\u03B5\u03B9 \u03C4\u03BF \u03CC\u03C1\u03B9\u03BF \u03C4\u03C9\u03BD \u03B3\u03C1\u03B1\u03BC\u03BC\u03CE\u03BD \u03C0\u03BF\u03C5 \u03B5\u03AF\u03BD\u03B1\u03B9 {$rows}.", cell_limit:"\u0388\u03C7\u03B5\u03C4\u03B5 \u03BE\u03B5\u03C0\u03B5\u03C1\u03AC\u03C3\u03B5\u03B9 \u03C4\u03BF \u03CC\u03C1\u03B9\u03BF \u03C4\u03C9\u03BD \u03BA\u03B5\u03BB\u03B9\u03CE\u03BD \u03C0\u03BF\u03C5 \u03B5\u03AF\u03BD\u03B1\u03B9 {$cells}.", missing_scope:"\u03A3\u03AF\u03B3\u03BF\u03C5\u03C1\u03B1 \u03B8\u03AD\u03BB\u03B5\u03C4\u03B5 \u03BD\u03B1 \u03C3\u03C5\u03BD\u03B5\u03C7\u03AF\u03C3\u03B5\u03C4\u03B5 \u03C7\u03C9\u03C1\u03AF\u03C2 \u03BD\u03B1 \u03AD\u03C7\u03B5\u03C4\u03B5 \u03BA\u03B1\u03B8\u03BF\u03C1\u03AF\u03C3\u03B5\u03B9 \u03C4\u03B7\u03BD \u03B5\u03BC\u03B2\u03AD\u03BB\u03B5\u03B9\u03B1 \u03C4\u03BF\u03C5 \u03BA\u03B5\u03BB\u03B9\u03BF\u03CD \u03C4\u03B7\u03C2 \u03BA\u03BF\u03C1\u03C5\u03C6\u03AE\u03C2 \u03C0\u03AF\u03BD\u03B1\u03BA\u03B1. \u03A7\u03C9\u03C1\u03AF\u03C2 \u03B1\u03C5\u03C4\u03AE, \u03BC\u03C0\u03BF\u03C1\u03B5\u03AF \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03B4\u03CD\u03C3\u03BA\u03BF\u03BB\u03BF \u03B3\u03B9\u03B1 \u03BA\u03AC\u03C0\u03BF\u03B9\u03BF\u03C5\u03C2 \u03C7\u03C1\u03AE\u03C3\u03C4\u03B5\u03C2 \u03BC\u03B5 \u03C0\u03C1\u03BF\u03B2\u03BB\u03AE\u03BC\u03B1\u03C4\u03B1 \u03BD\u03B1 \u03BA\u03B1\u03C4\u03B1\u03BB\u03AC\u03B2\u03BF\u03C5\u03BD \u03C4\u03BF \u03C0\u03B5\u03C1\u03B9\u03B5\u03C7\u03CC\u03BC\u03B5\u03BD\u03BF \u03C4\u03BF\u03C5 \u03C0\u03AF\u03BD\u03B1\u03BA\u03B1.", caption:"\u0395\u03C0\u03B9\u03BA\u03B5\u03C6\u03B1\u03BB\u03AF\u03B4\u03B1 \u03C0\u03AF\u03BD\u03B1\u03BA\u03B1", frame:"Frame", frame_none:"\u03BA\u03B1\u03BD\u03AD\u03BD\u03B1", frame_groups:"\u03BF\u03BC\u03AC\u03B4\u03B5\u03C2", frame_rows:"\u03B3\u03C1\u03B1\u03BC\u03BC\u03AD\u03C2", frame_cols:"\u03C3\u03C4\u03AE\u03BB\u03B5\u03C2", frame_all:"\u03CC\u03BB\u03B1", rules:"\u039A\u03B1\u03BD\u03CC\u03BD\u03B5\u03C2", rules_void:"\u03BA\u03B5\u03BD\u03CC", rules_above:"\u03B1\u03C0\u03CC \u03C0\u03AC\u03BD\u03C9", rules_below:"\u03B1\u03C0\u03CC \u03BA\u03AC\u03C4\u03C9", rules_hsides:"\u03BF\u03C1\u03B9\u03B6\u03CC\u03BD\u03C4\u03B9\u03B5\u03C2 \u03C0\u03BB\u03B5\u03C5\u03C1\u03AD\u03C2", rules_lhs:"\u03B1\u03C1\u03B9\u03C3\u03C4\u03B5\u03C1\u03AE \u03BF\u03C1\u03B9\u03B6\u03CC\u03BD\u03C4\u03B9\u03B1 \u03C0\u03BB\u03B5\u03C5\u03C1\u03AC", rules_rhs:"\u03B4\u03B5\u03BE\u03B9\u03AC \u03BF\u03C1\u03B9\u03B6\u03CC\u03BD\u03C4\u03B9\u03B1 \u03C0\u03BB\u03B5\u03C5\u03C1\u03AC", rules_vsides:"\u03BA\u03AC\u03B8\u03B5\u03C4\u03B5\u03C2 \u03C0\u03BB\u03B5\u03C5\u03C1\u03AD\u03C2", rules_box:"\u03BA\u03BF\u03C5\u03C4\u03AF", rules_border:"\u03C0\u03BB\u03B1\u03AF\u03C3\u03B9\u03BF" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/en_dlg.js000066400000000000000000000040541226600447100236430ustar00rootroot00000000000000tinyMCE.addI18n('en.table_dlg',{"rules_border":"border","rules_box":"box","rules_vsides":"vsides","rules_rhs":"rhs","rules_lhs":"lhs","rules_hsides":"hsides","rules_below":"below","rules_above":"above","rules_void":"void",rules:"Rules","frame_all":"all","frame_cols":"cols","frame_rows":"rows","frame_groups":"groups","frame_none":"none",frame:"Frame",caption:"Table Caption","missing_scope":"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.","cell_limit":"You\'ve exceeded the maximum number of cells of {$cells}.","row_limit":"You\'ve exceeded the maximum number of rows of {$rows}.","col_limit":"You\'ve exceeded the maximum number of columns of {$cols}.",colgroup:"Col Group",rowgroup:"Row Group",scope:"Scope",tfoot:"Footer",tbody:"Body",thead:"Header","row_all":"Update All Rows in Table","row_even":"Update Even Rows in Table","row_odd":"Update Odd Rows in Table","row_row":"Update Current Row","cell_all":"Update All Cells in Table","cell_row":"Update All Cells in Row","cell_cell":"Update Current Cell",th:"Header",td:"Data",summary:"Summary",bgimage:"Background Image",rtl:"Right to Left",ltr:"Left to Right",mime:"Target MIME Type",langcode:"Language Code",langdir:"Language Direction",style:"Style",id:"ID","merge_cells_title":"Merge Table Cells",bgcolor:"Background Color",bordercolor:"Border Color","align_bottom":"Bottom","align_top":"Top",valign:"Vertical Alignment","cell_type":"Cell Type","cell_title":"Table Cell Properties","row_title":"Table Row Properties","align_middle":"Center","align_right":"Right","align_left":"Left","align_default":"Default",align:"Alignment",border:"Border",cellpadding:"Cell Padding",cellspacing:"Cell Spacing",rows:"Rows",cols:"Columns",height:"Height",width:"Width",title:"Insert/Edit Table",rowtype:"Row Type","advanced_props":"Advanced Properties","general_props":"General Properties","advanced_tab":"Advanced","general_tab":"General","cell_col":"Update all cells in column"});glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/es_dlg.js000066400000000000000000000044341226600447100236520ustar00rootroot00000000000000tinyMCE.addI18n('es.table_dlg',{ general_tab:"General", advanced_tab:"Avanzado", general_props:"Propiedades generales", advanced_props:"Propiedades avanzadas", rowtype:"Tipo de fila", title:"Insertar/Modificar tabla", width:"Ancho", height:"Alto", cols:"Cols", rows:"Filas", cellspacing:"Espaciado de celda", cellpadding:"Relleno de celda", border:"Borde", align:"Alineaci\u00F3n", align_default:"Predet.", align_left:"Izquierda", align_right:"Derecha", align_middle:"Centrado", row_title:"Propiedades de la fila", cell_title:"Propiedades de la celda", cell_type:"Tipo de celda", valign:"Alineaci\u00F3n vertical", align_top:"Arriba", align_bottom:"Debajo", bordercolor:"Color del borde", bgcolor:"Color de fondo", merge_cells_title:"Vincular celdas", id:"Id", style:"Estilo", langdir:"Direcci\u00F3n del lenguaje", langcode:"C\u00F3digo del lenguaje", mime:"Tipo MIME", ltr:"Izquierda a derecha", rtl:"Derecha a izquierda", bgimage:"Imagen de fondo", summary:"Resumen", td:"Datos", th:"Encabezado", cell_cell:"Actualizar celda actual", cell_row:"Actualizar todas las celdas en la fila", cell_all:"Actualizar todas las celdas en la tabla", row_row:"Actualizar fila actual", row_odd:"Actualizar filas impares", row_even:"Actualizar filas pares", row_all:"Actualizar todas las filas", thead:"Encabezado de la tabla", tbody:"Cuerpo de la tabla", tfoot:"Pie de la tabla", scope:"Alcance", rowgroup:"Grupo de filas", colgroup:"Grupo de columnas", col_limit:"Ha superado el n\u00FAmero m\u00E1ximo de columnas: {$cols}.", row_limit:"Ha superado el n\u00FAmero m\u00E1ximo de filas: {$rows}.", cell_limit:"Ha superado el n\u00FAmero m\u00E1ximo de celdas: {$cells}.", missing_scope:" \u00BFEst\u00E1 seguro que desea continuar sin especificar el alcance del encabezado de celda? Sin \u00E9l podr\u00EDa ser dificultoso para algunos usuarios entender el contenido o los datos mostrados en la tabla.", caption:"Subt\u00EDtulo de la tabla", frame:"Recuadro", frame_none:"ninguno", frame_groups:"grupos", frame_rows:"filas", frame_cols:"cols", frame_all:"todos", rules:"Reglas", rules_void:"vac\u00EDo", rules_above:"encima", rules_below:"debajo", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/et_dlg.js000066400000000000000000000040771226600447100236560ustar00rootroot00000000000000tinyMCE.addI18n('et.table_dlg',{ general_tab:"\u00DCldine", advanced_tab:"T\u00E4psustatud", general_props:"\u00DCldised seaded", advanced_props:"T\u00E4psustatud seaded", rowtype:"Rida rea osas", title:"Sisesta/muuda tabelit", width:"Laius", height:"K\u00F5rgus", cols:"Veerge", rows:"Ridu", cellspacing:"Veeru laius", cellpadding:"Veeru t\u00E4ide", border:"Raam", align:"Joondus", align_default:"Vaikimisi", align_left:"Vasak", align_right:"Parem", align_middle:"Keskel", row_title:"Tabeli rea seaded", cell_title:"Tabeli veeru seaded", cell_type:"Veeru t\u00FC\u00FCp", valign:"Vertikaalne joondus", align_top:"\u00DCleval", align_bottom:"All", bordercolor:"Raami v\u00E4rv", bgcolor:"Tausta v\u00E4rv", merge_cells_title:"\u00DChenda lahtrid", id:"ID", style:"Stiil", langdir:"Keele suund", langcode:"Keele kood", mime:"M\u00E4rgista MIME t\u00FC\u00FCp", ltr:"Vasakult paremale", rtl:"Paremalt vasakule", bgimage:"Tausta pilt", summary:"Kokkuv\u00F5te", td:"Info", th:"P\u00E4is", cell_cell:"Uuenda antud lahtrit", cell_row:"Uuenda k\u00F5iki lahtreid reas", cell_all:"Uuenda k\u00F5iki lahtreid tabelis", row_row:"Uuenda antud rida", row_odd:"Uuenda paarituid ridu tabelis", row_even:"Uuenda paaris ridu tabelis", row_all:"Uuenda k\u00F5iki ridu tabelis", thead:"Tabeli p\u00E4is", tbody:"Tabeli sisu", tfoot:"Tabeli jalus", scope:"Ulatus", rowgroup:"Rea grupp", colgroup:"Veeru grupp", col_limit:"Oled j\u00F5udnud maksemaalse arvu veegudeni.", row_limit:"Oled j\u00F5udnud maksimaalse arvu ridadeni", cell_limit:"Oled j\u00F5udnud maksimaalse arvu elementideni", missing_scope:"Oled kindel, et soovid j\u00E4tkata t\u00E4psustamata antud tabeli p\u00E4ise nime?", caption:"Tabeli seletus", frame:"Raam", frame_none:"mitte \u00FCkski", frame_groups:"grupid", frame_rows:"read", frame_cols:"veerud", frame_all:"k\u00F5ik", rules:"Reeglid", rules_void:"t\u00FChi", rules_above:"\u00FCleval", rules_below:"all", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"kast", rules_border:"raam" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/fa_dlg.js000066400000000000000000000135361226600447100236340ustar00rootroot00000000000000tinyMCE.addI18n('fa.table_dlg',{ general_tab:"\u0639\u0645\u0648\u0645\u06CC", advanced_tab:"\u067E\u06CC\u0634\u0631\u0641\u062A\u0647", general_props:"\u0645\u0634\u062E\u0635\u0627\u062A \u0639\u0645\u0648\u0645\u06CC", advanced_props:"\u0645\u0634\u062E\u0635\u0627\u062A \u067E\u06CC\u0634\u0631\u0641\u062A\u0647", rowtype:"\u0633\u0637\u0631 \u062F\u0631 \u0628\u062E\u0634 \u062C\u062F\u0648\u0644", title:"\u062F\u0631\u062C/\u0627\u0635\u0644\u0627\u062D \u062C\u062F\u0648\u0644", width:"\u067E\u0647\u0646\u0627", height:"\u0627\u0631\u062A\u0641\u0627\u0639", cols:"\u0633\u062A\u0648\u0646 \u0647\u0627", rows:"\u0633\u0637\u0631\u0647\u0627", cellspacing:"\u0641\u0627\u0635\u0644\u0647 \u0633\u0644\u0648\u0644 \u0647\u0627", cellpadding:"\u0644\u0627\u06CC\u0647 \u06AF\u0630\u0627\u0631\u06CC \u0633\u0644\u0648\u0644 \u0647\u0627", border:"\u062D\u0627\u0634\u06CC\u0647", align:"\u062A\u0631\u0627\u0632", align_default:"\u067E\u06CC\u0634\u0641\u0631\u0636", align_left:"\u0686\u067E", align_right:"\u0631\u0627\u0633\u062A", align_middle:"\u0648\u0633\u0637", row_title:"\u0645\u0634\u062E\u0635\u0627\u062A \u0633\u0637\u0631 \u062C\u062F\u0648\u0644", cell_title:"\u0645\u0634\u062E\u0635\u0627\u062A \u0633\u0644\u0648\u0644 \u062C\u062F\u0648\u0644", cell_type:"\u0646\u0648\u0639 \u0633\u0644\u0648\u0644", valign:"\u062A\u0631\u0627\u0632 \u0639\u0645\u0648\u062F\u06CC", align_top:"\u0628\u0627\u0644\u0627", align_bottom:"\u067E\u0627\u06CC\u06CC\u0646", bordercolor:"\u0631\u0646\u06AF \u062D\u0627\u0634\u06CC\u0647", bgcolor:"\u0631\u0646\u06AF \u0632\u0645\u06CC\u0646\u0647", merge_cells_title:"\u0627\u062F\u063A\u0627\u0645 \u0633\u0644\u0648\u0644 \u0647\u0627\u06CC \u062C\u062F\u0648\u0644", id:"\u0634\u0646\u0627\u0633\u0647", style:"\u0627\u0633\u062A\u06CC\u0644", langdir:"\u062C\u0647\u062A \u0632\u0628\u0627\u0646", langcode:"\u0643\u062F \u0632\u0628\u0627\u0646", mime:"\u0646\u0648\u0639 MIME \u0645\u0642\u0635\u062F (Target)", ltr:"\u0686\u067E \u0628\u0647 \u0631\u0627\u0633\u062A", rtl:"\u0631\u0627\u0633\u062A \u0628\u0647 \u0686\u067E", bgimage:"\u062A\u0635\u0648\u06CC\u0631 \u0632\u0645\u06CC\u0646\u0647", summary:"\u062E\u0644\u0627\u0635\u0647", td:"\u062F\u0627\u062F\u0647", th:"\u0633\u0631 \u062C\u062F\u0648\u0644", cell_cell:"\u0628\u0631\u0648\u0632\u0631\u0633\u0627\u0646\u06CC \u0633\u0644\u0648\u0644 \u0641\u0639\u0644\u06CC", cell_row:"\u0628\u0631\u0648\u0632\u0631\u0633\u0627\u0646\u06CC \u062A\u0645\u0627\u0645\u06CC \u0633\u0644\u0648\u0644 \u0647\u0627\u06CC \u0633\u0637\u0631", cell_all:"\u0628\u0631\u0648\u0632\u0631\u0633\u0627\u0646\u06CC \u062A\u0645\u0627\u0645\u06CC \u0633\u0644\u0648\u0644 \u0647\u0627\u06CC \u062C\u062F\u0648\u0644", row_row:"\u0628\u0631\u0648\u0632\u0631\u0633\u0627\u0646\u06CC \u0633\u0637\u0631 \u0641\u0639\u0644\u06CC", row_odd:"\u0628\u0631\u0648\u0632\u0631\u0633\u0627\u0646\u06CC \u0633\u0637\u0631\u0647\u0627\u06CC \u0641\u0631\u062F \u062F\u0631 \u062C\u062F\u0648\u0644", row_even:"\u0628\u0631\u0648\u0632\u0631\u0633\u0627\u0646\u06CC \u0633\u0637\u0631\u0647\u0627\u06CC \u0632\u0648\u062C \u062F\u0631 \u062C\u062F\u0648\u0644", row_all:"\u0628\u0631\u0648\u0632\u0631\u0633\u0627\u0646\u06CC \u062A\u0645\u0627\u0645\u06CC \u0633\u0637\u0631\u0647\u0627 \u062F\u0631 \u062C\u062F\u0648\u0644", thead:"\u0628\u0627\u0644\u0627\u06CC \u062C\u062F\u0648\u0644", tbody:"\u0628\u062F\u0646\u0647 \u062C\u062F\u0648\u0644", tfoot:"\u067E\u0627\u06CC\u06CC\u0646 \u062C\u062F\u0648\u0644", scope:"\u0645\u062D\u062F\u0648\u062F\u0647", rowgroup:"\u06AF\u0631\u0648\u0647 \u0633\u0637\u0631", colgroup:"\u06AF\u0631\u0648\u0647 \u0633\u062A\u0648\u0646", col_limit:"\u0634\u0645\u0627 \u0627\u0632 \u062A\u0639\u062F\u0627\u062F \u062D\u062F\u0627\u0643\u062B\u0631 {$cols} \u0633\u062A\u0648\u0646 \u062A\u062C\u0627\u0648\u0632 \u0643\u0631\u062F\u06CC\u062F.", row_limit:"\u0634\u0645\u0627 \u0627\u0632 \u062A\u0639\u062F\u0627\u062F \u062D\u062F\u0627\u0643\u062B\u0631 {$rows} \u0633\u0637\u0631 \u062A\u062C\u0627\u0648\u0632 \u0643\u0631\u062F\u06CC\u062F.", cell_limit:"\u0634\u0645\u0627 \u0627\u0632 \u062A\u0639\u062F\u0627\u062F \u062D\u062F\u0627\u0643\u062B\u0631 {$cells} \u0633\u0644\u0648\u0644 \u062A\u062C\u0627\u0648\u0632 \u0643\u0631\u062F\u06CC\u062F.", missing_scope:"\u0622\u06CC\u0627 \u0634\u0645\u0627 \u0627\u0632 \u0627\u062F\u0627\u0645\u0647 \u062F\u0627\u062F\u0646 \u0628\u062F\u0648\u0646 \u062A\u0639\u06CC\u06CC\u0646 \u0645\u062D\u062F\u0648\u062F\u0647 \u0628\u0631\u0627\u06CC \u0627\u06CC\u0646 \u0633\u0644\u0648\u0644 \u0628\u0627\u0644\u0627\u06CC \u062C\u062F\u0648\u0644 \u0627\u0637\u0645\u06CC\u0646\u0627\u0646 \u062F\u0627\u0631\u06CC\u062F\u061F. \u0628\u062F\u0648\u0646 \u0622\u0646 \u060C \u0645\u0645\u0643\u0646 \u0627\u0633\u062A \u0628\u0631\u0627\u06CC \u0628\u0631\u062E\u06CC \u0643\u0627\u0631\u0628\u0631\u0627\u0646 \u0639\u0627\u062C\u0632 \u0627\u0632 \u0641\u0647\u0645 \u0645\u062D\u062A\u0648\u0627 \u06CC\u0627 \u062F\u0631 \u062F\u0627\u062F\u0647 \u0647\u0627\u06CC \u0646\u0645\u0627\u06CC\u0634 \u062F\u0627\u062F\u0647 \u0634\u062F\u0647 \u062C\u062F\u0648\u0644 \u0645\u0634\u0643\u0644\u06CC \u067E\u06CC\u0634 \u0622\u06CC\u062F.", caption:"\u0639\u0646\u0648\u0627\u0646 \u062C\u062F\u0648\u0644", frame:"\u0642\u0627\u0628 (Frame)", frame_none:"\u0647\u06CC\u0686 \u0643\u062F\u0627\u0645", frame_groups:"\u06AF\u0631\u0648\u0647 \u0647\u0627", frame_rows:"\u0633\u0637\u0631\u0647\u0627", frame_cols:"\u0633\u062A\u0648\u0646 \u0647\u0627", frame_all:"\u0647\u0645\u0647", rules:"\u062E\u0637 \u0647\u0627", rules_void:"\u062E\u0627\u0644\u06CC", rules_above:"\u0628\u0627\u0644\u0627", rules_below:"\u067E\u0627\u06CC\u06CC\u0646", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"\u062C\u0639\u0628\u0647", rules_border:"\u062D\u0627\u0634\u06CC\u0647" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/fi_dlg.js000066400000000000000000000047421226600447100236430ustar00rootroot00000000000000tinyMCE.addI18n('fi.table_dlg',{ general_tab:"Yleiset", advanced_tab:"Edistynyt", general_props:"Yleiset asetukset", advanced_props:"Edistyneet asetukset", rowtype:"Rivi taulukon osassa", title:"Lis\u00E4\u00E4/muokkaa taulukkoa", width:"Leveys", height:"Korkeus", cols:"Sarakkeet", rows:"Rivit", cellspacing:"Solun v\u00E4li", cellpadding:"Solun tyhj\u00E4 tila", border:"Kehys", align:"Tasaus", align_default:"Oletus", align_left:"Vasen", align_right:"Oikea", align_middle:"Keskitetty", row_title:"Taulukon rivin asetukset", cell_title:"Taulukon solun asetukset", cell_type:"Solun tyyppi", valign:"Pystysuunnan tasaus", align_top:"Yl\u00F6s", align_bottom:"Alas", bordercolor:"Kehyksen v\u00E4ri", bgcolor:"Taustan v\u00E4ri", merge_cells_title:"Yhdist\u00E4 taulukon solut", id:"Id", style:"Tyyli", langdir:"Kielen suunta", langcode:"Kielen koodi", mime:"Kohteen MIME-tyyppi", ltr:"Vasemmalta oikealle", rtl:"Oikealta vasemmalle", bgimage:"Taustakuva", summary:"Yhteenveto", td:"Tietue", th:"Otsake", cell_cell:"P\u00E4ivit\u00E4 solu", cell_row:"P\u00E4ivit\u00E4 kaikki rivin solut", cell_all:"P\u00E4ivit\u00E4 kaikki taulukon solut", row_row:"P\u00E4ivit\u00E4 rivi", row_odd:"P\u00E4ivit\u00E4 taulukon parittomat rivit", row_even:"P\u00E4ivit\u00E4 taulukon parilliset rivit", row_all:"P\u00E4ivit\u00E4 kaikki taulukon rivit", thead:"Taulukon otsake", tbody:"Taulukon runko", tfoot:"Taulukon alaosa", scope:"Tila", rowgroup:"Rivi ryhm\u00E4", colgroup:"Sarake ryhm\u00E4", col_limit:"Olet ylitt\u00E4nyt suurimman sallitun m\u00E4\u00E4r\u00E4n sarakkeita {$cols}.", row_limit:"Olet ylitt\u00E4nyt suurimman sallitun m\u00E4\u00E4r\u00E4n rivej\u00E4 {$rows}.", cell_limit:"Olet ylitt\u00E4nyt suurimman sallitun m\u00E4\u00E4r\u00E4n soluja {$cells}.", missing_scope:"Haluatko varmasti jatkaa m\u00E4\u00E4ritt\u00E4m\u00E4tt\u00E4 tilaa t\u00E4lle taulukon otsakesolulle? Ilman sit\u00E4 joidenkin k\u00E4ytt\u00E4jien voi olla vaikea ymm\u00E4rt\u00E4\u00E4 taulukon sis\u00E4lt\u00E4m\u00E4\u00E4 informaatiota.", caption:"Taulukon seloste", frame:"kehys", frame_none:"ei mit\u00E4\u00E4n", frame_groups:"ryhm\u00E4t", frame_rows:"rivit", frame_cols:"sarakkeet", frame_all:"kaikki", rules:"S\u00E4\u00E4nn\u00F6t", rules_void:"tyhj\u00E4", rules_above:"yl\u00E4puoli", rules_below:"alapuoli", rules_hsides:"vaakasuorat reunat", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"pystysuorat reunat", rules_box:"laatikko", rules_border:"kehys" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/fr_dlg.js000066400000000000000000000052161226600447100236510ustar00rootroot00000000000000tinyMCE.addI18n('fr.table_dlg',{ general_tab:"G\u00E9n\u00E9ral", advanced_tab:"Avanc\u00E9", general_props:"Propri\u00E9t\u00E9s g\u00E9n\u00E9rales", advanced_props:"Propri\u00E9t\u00E9s avanc\u00E9es", rowtype:"Type de ligne", title:"Ins\u00E9rer / modifier un tableau", width:"Largeur", height:"Hauteur", cols:"Colonnes", rows:"Lignes", cellspacing:"Espacement entre les cellules", cellpadding:"Espacement dans les cellules", border:"Bordure", align:"Alignement", align_default:"Par d\u00E9faut", align_left:"Gauche", align_right:"Droite", align_middle:"Centr\u00E9", row_title:"Propri\u00E9t\u00E9s de la ligne", cell_title:"Propri\u00E9t\u00E9s de la cellule", cell_type:"Type de cellule", valign:"Alignement vertical", align_top:"Haut", align_bottom:"Bas", bordercolor:"Couleur de la bordure", bgcolor:"Couleur du fond", merge_cells_title:"Fusionner les cellules", id:"Id", style:"Style", langdir:"Sens de lecture", langcode:"Code de la langue", mime:"Type MIME de la cible", ltr:"De gauche \u00E0 droite", rtl:"de droite \u00E0 gauche", bgimage:"Image de fond", summary:"R\u00E9sum\u00E9", td:"Donn\u00E9es", th:"Titre", cell_cell:"Mettre \u00E0 jour la cellule courante", cell_row:"Mettre \u00E0 jour toutes les cellules de la ligne", cell_all:"Mettre \u00E0 jour toutes les cellules du tableau", row_row:"Mettre \u00E0 jour la ligne courante", row_odd:"Mettre \u00E0 jour les lignes impaires", row_even:"Mettre \u00E0 jour les lignes paires", row_all:"Mettre \u00E0 jour toutes les lignes du tableau", thead:"En-t\u00EAtes de tableau", tbody:"Corps de tableau", tfoot:"Pied de tableau", scope:"Port\u00E9e", rowgroup:"Groupe de lignes", colgroup:"Groupe de colonnes", col_limit:"Vous avez d\u00E9pass\u00E9 le nombre maximum de colonnes ({$cols}).", row_limit:"Vous avez d\u00E9pass\u00E9 le nombre maximum de lignes ({$rows}).", cell_limit:"Vous avez d\u00E9pass\u00E9 le nombre maximum de cellules ({$cells}).", missing_scope:"Souhaitez-vous vraiment continuer sans sp\u00E9cifier de port\u00E9e pour cette cellule de titre ? Sans port\u00E9e, cela peut \u00EAtre difficile pour certains usagers \u00E0 probl\u00E8mes de comprendre le contenu ou les donn\u00E9es affich\u00E9es dans le tableau.", caption:"Afficher la l\u00E9gende du tableau", frame:"Cadre", frame_none:"aucun", frame_groups:"groupe", frame_rows:"lignes", frame_cols:"colonnes", frame_all:"tous", rules:"R\u00E8gles", rules_void:"aucune", rules_above:"au-dessus", rules_below:"au-dessous", rules_hsides:"horizontales", rules_lhs:"\u00E0 gauche", rules_rhs:"\u00E0 droite", rules_vsides:"verticales", rules_box:"bo\u00EEte", rules_border:"bordure" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/gl_dlg.js000066400000000000000000000044401226600447100236420ustar00rootroot00000000000000tinyMCE.addI18n('gl.table_dlg',{ general_tab:"Xeral", advanced_tab:"Avanzado", general_props:"Propiedades xerales", advanced_props:"Propiedades avanzadas", rowtype:"Tipo de fila", title:"Insertar/Modificar t\u00E1boa", width:"Ancho", height:"Alto", cols:"Cols", rows:"Filas", cellspacing:"Espaciado de celda", cellpadding:"Relleno de celda", border:"Borde", align:"Ali\u00F1aci\u00F3n", align_default:"Predet.", align_left:"Esquerda", align_right:"Dereita", align_middle:"Centrado", row_title:"Propiedades da fila", cell_title:"Propiedades da celda", cell_type:"Tipo de celda", valign:"Ali\u00F1aci\u00F3n vertical", align_top:"Arriba", align_bottom:"Abaixo", bordercolor:"Cor do borde", bgcolor:"Cor de fondo", merge_cells_title:"Unir celdas", id:"Id", style:"Estilo", langdir:"Direcci\u00F3n da lenguaxe", langcode:"C\u00F3digo da lenguaxe", mime:"Tipo MIME", ltr:"Esquerda a dereita", rtl:"Dereita a esquerda", bgimage:"Imaxe de fondo", summary:"Resumen", td:"Datos", th:"Encabezamento", cell_cell:"Actualizar celda actual", cell_row:"Actualizar todalas celdas na fila", cell_all:"Actualizar todalas celdas na t\u00E1boa", row_row:"Actualizar fila actual", row_odd:"Actualizar filas impares", row_even:"Actualizar filas pares", row_all:"Actualizar todalas filas", thead:"Encabezamento da t\u00E1boa", tbody:"Corpo da t\u00E1boa", tfoot:"Pe da t\u00E1boa", scope:"\u00C1mbito", rowgroup:"Grupo de filas", colgroup:"Grupo de columnas", col_limit:"Super\u00F3u o n\u00FAmero m\u00E1ximo de columnas: {$cols}.", row_limit:"Super\u00F3u o n\u00FAmero m\u00E1ximo de filas: {$rows}.", cell_limit:"Super\u00F3u o n\u00FAmero m\u00E1ximo de celdas: {$cells}.", missing_scope:"\u00BFEst\u00E1 seguro que desexa continuar sen especifica-lo \u00E1mbito do encabezado de celda? Sen \u00E9l podr\u00EDa ser dificultoso pra algunos usuarios entende-lo contido ou os datos mostrados na t\u00E1boa.", caption:"Subt\u00EDtulo da t\u00E1boa", frame:"Recadro", frame_none:"ning\u00FAn", frame_groups:"grupos", frame_rows:"filas", frame_cols:"columnas", frame_all:"todos", rules:"Regras", rules_void:"vac\u00EDo", rules_above:"encima", rules_below:"debaixo", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"borde" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/gu_dlg.js000066400000000000000000000041311226600447100236500ustar00rootroot00000000000000tinyMCE.addI18n('gu.table_dlg',{ general_tab:"General", advanced_tab:"Advanced", general_props:"General properties", advanced_props:"Advanced properties", rowtype:"Row in table part", title:"Insert/Modify table", width:"Width", height:"Height", cols:"Cols", rows:"Rows", cellspacing:"Cellspacing", cellpadding:"Cellpadding", border:"Border", align:"Alignment", align_default:"Default", align_left:"Left", align_right:"Right", align_middle:"Center", row_title:"Table row properties", cell_title:"Table cell properties", cell_type:"Cell type", valign:"Vertical alignment", align_top:"Top", align_bottom:"Bottom", bordercolor:"Border color", bgcolor:"Background color", merge_cells_title:"Merge table cells", id:"Id", style:"Style", langdir:"Language direction", langcode:"Language code", mime:"Target MIME type", ltr:"Left to right", rtl:"Right to left", bgimage:"Background image", summary:"Summary", td:"Data", th:"Header", cell_cell:"Update current cell", cell_row:"Update all cells in row", cell_all:"Update all cells in table", row_row:"Update current row", row_odd:"Update odd rows in table", row_even:"Update even rows in table", row_all:"Update all rows in table", thead:"Table Head", tbody:"Table Body", tfoot:"Table Foot", scope:"Scope", rowgroup:"Row Group", colgroup:"Col Group", col_limit:"You've exceeded the maximum number of columns of {$cols}.", row_limit:"You've exceeded the maximum number of rows of {$rows}.", cell_limit:"You've exceeded the maximum number of cells of {$cells}.", missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.", caption:"Table caption", frame:"Frame", frame_none:"none", frame_groups:"groups", frame_rows:"rows", frame_cols:"cols", frame_all:"all", rules:"Rules", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/he_dlg.js000066400000000000000000000111301226600447100236260ustar00rootroot00000000000000tinyMCE.addI18n('he.table_dlg',{ general_tab:"\u05DB\u05DC\u05DC\u05D9", advanced_tab:"\u05DE\u05EA\u05E7\u05D3\u05DD", general_props:"\u05EA\u05DB\u05D5\u05E0\u05D5\u05EA \u05DB\u05DC\u05DC\u05D9\u05D5\u05EA", advanced_props:"\u05EA\u05DB\u05D5\u05E0\u05D5\u05EA \u05DE\u05EA\u05E7\u05D3\u05DE\u05D5\u05EA", rowtype:"\u05E1\u05D5\u05D2 \u05D4\u05E9\u05D5\u05E8\u05D4 \u05D1\u05D8\u05D1\u05DC\u05D4", title:"\u05D4\u05D5\u05E1\u05E4\u05EA/\u05E2\u05E8\u05D9\u05DB\u05EA \u05D8\u05D1\u05DC\u05D4", width:"\u05E8\u05D5\u05D7\u05D1", height:"\u05D2\u05D5\u05D1\u05D4", cols:"\u05E2\u05DE\u05D5\u05D3\u05D5\u05EA", rows:"\u05E9\u05D5\u05E8\u05D5\u05EA", cellspacing:"Cellspacing", cellpadding:"Cellpadding", border:"\u05D2\u05D1\u05D5\u05DC", align:"\u05D9\u05E9\u05D5\u05E8 \u05D0\u05D5\u05E4\u05E7\u05D9", align_default:"Default", align_left:"\u05DC\u05E9\u05DE\u05D0\u05DC", align_right:"\u05DC\u05D9\u05DE\u05D9\u05DF", align_middle:"\u05D0\u05DE\u05E6\u05E2", row_title:"\u05EA\u05DB\u05D5\u05E0\u05D5\u05EA \u05E9\u05D5\u05E8\u05D4 \u05D1\u05D8\u05D1\u05DC\u05D4", cell_title:"\u05EA\u05DB\u05D5\u05E0\u05D5\u05EA \u05EA\u05D0 \u05D1\u05D8\u05D1\u05DC\u05D4", cell_type:"\u05E1\u05D2\u05E0\u05D5\u05DF \u05D4\u05EA\u05D0", valign:"\u05D9\u05E9\u05D5\u05E8 \u05D0\u05E0\u05DB\u05D9", align_top:"\u05E2\u05DC\u05D9\u05D5\u05DF", align_bottom:"\u05EA\u05D7\u05EA\u05D9\u05EA", bordercolor:"\u05E6\u05D1\u05E2 \u05D4\u05D2\u05D1\u05D5\u05DC", bgcolor:"\u05E6\u05D1\u05E2 \u05D4\u05E8\u05E7\u05E2", merge_cells_title:"\u05D0\u05D7\u05D3 \u05EA\u05D0\u05D9\u05DD \u05D1\u05D8\u05D1\u05DC\u05D4", id:"Id", style:"\u05E2\u05D9\u05E6\u05D5\u05D1", langdir:"\u05DB\u05D9\u05D5\u05D5\u05DF \u05D4\u05E9\u05E4\u05D4", langcode:"\u05E7\u05D5\u05D3 \u05D4\u05E9\u05E4\u05D4", mime:"Target MIME type", ltr:"\u05DE\u05E9\u05DE\u05D0\u05DC \u05DC\u05D9\u05DE\u05D9\u05DF", rtl:"\u05DE\u05D9\u05DE\u05D9\u05DF \u05DC\u05E9\u05DE\u05D0\u05DC", bgimage:"\u05EA\u05DE\u05D5\u05E0\u05EA \u05E8\u05E7\u05E2", summary:"\u05EA\u05DE\u05E6\u05D9\u05EA", td:"\u05EA\u05D0 \u05DE\u05D9\u05D3\u05E2", th:"\u05DB\u05D5\u05EA\u05E8\u05EA", cell_cell:"\u05E2\u05D3\u05DB\u05D5\u05DF \u05EA\u05D0 \u05E0\u05D5\u05DB\u05D7\u05D9", cell_row:"\u05E2\u05D3\u05DB\u05D5\u05DF \u05DB\u05DC \u05EA\u05D0\u05D9 \u05D4\u05E9\u05D5\u05E8\u05D4", cell_all:"\u05E2\u05D3\u05DB\u05D5\u05DF \u05DB\u05DC \u05EA\u05D0\u05D9 \u05D4\u05D8\u05D1\u05DC\u05D4", row_row:"\u05E2\u05D3\u05DB\u05D5\u05DF \u05E9\u05D5\u05E8\u05D4 \u05E0\u05D5\u05DB\u05D7\u05D9\u05EA", row_odd:"\u05E2\u05D3\u05DB\u05D5\u05DF \u05E9\u05D5\u05E8\u05D5\u05EA \u05D0\u05D9-\u05D6\u05D5\u05D2\u05D9\u05D5\u05EA \u05D1\u05D8\u05D1\u05DC\u05D4", row_even:"\u05E2\u05D3\u05DB\u05D5\u05DF \u05E9\u05D5\u05E8\u05D5\u05EA \u05D6\u05D5\u05D2\u05D9\u05D5\u05EA \u05D1\u05D8\u05D1\u05DC\u05D4", row_all:"\u05E2\u05D3\u05DB\u05D5\u05DF\u05DB\u05DC \u05D4\u05E9\u05D5\u05E8\u05D5\u05EA \u05D1\u05D8\u05D1\u05DC\u05D4", thead:"\u05E9\u05D5\u05E8\u05EA \u05DB\u05D5\u05EA\u05E8\u05EA", tbody:"\u05E9\u05D5\u05E8\u05D4 \u05E8\u05D2\u05D9\u05DC\u05D4", tfoot:"\u05E9\u05D5\u05E8\u05D4 \u05EA\u05D7\u05EA\u05D9\u05EA", scope:"Scope", rowgroup:"Row Group", colgroup:"Col Group", col_limit:"\u05D7\u05E8\u05D9\u05D2\u05D4 \u05DE\u05DE\u05E1\u05E4\u05E8 \u05D4\u05E2\u05DE\u05D5\u05D3\u05D5\u05EA \u05D4\u05DE\u05E7\u05E1\u05D9\u05DE\u05D0\u05DC\u05D9 \u05E9\u05DC {$cols}.", row_limit:"\u05D7\u05E8\u05D9\u05D2\u05D4 \u05DE\u05DE\u05E1\u05E4\u05E8 \u05D4\u05DE\u05E7\u05E1\u05D9\u05DE\u05D0\u05DC\u05D9 \u05E9\u05DC \u05D4\u05E9\u05D5\u05E8\u05D5\u05EA \u05E9\u05DC {$rows}.", cell_limit:"\u05D7\u05E8\u05D9\u05D2\u05D4 \u05DE\u05DE\u05E1\u05E4\u05E8 \u05D4\u05DE\u05E7\u05E1\u05D9\u05DE\u05D0\u05DC\u05D9 \u05E9\u05DC \u05D4\u05EA\u05D0\u05D9\u05DD \u05D1\u05D8\u05D1\u05DC\u05D4 \u05E9\u05DC {$cells}.", missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.", caption:"\u05DB\u05D5\u05EA\u05E8\u05EA \u05D4\u05D8\u05D1\u05DC\u05D4", frame:"Frame", frame_none:"\u05DC\u05DC\u05D0", frame_groups:"\u05E7\u05D1\u05D5\u05E6\u05D5\u05EA", frame_rows:"\u05E9\u05D5\u05E8\u05D5\u05EA", frame_cols:"\u05E2\u05DE\u05D5\u05D3\u05D5\u05EA", frame_all:"\u05D4\u05DB\u05D5\u05DC", rules:"\u05D7\u05D5\u05E7\u05D9\u05DD", rules_void:"void", rules_above:"\u05DE\u05E2\u05DC", rules_below:"\u05DE\u05EA\u05D7\u05EA", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"\u05D2\u05D1\u05D5\u05DC" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/hi_dlg.js000066400000000000000000000041311226600447100236350ustar00rootroot00000000000000tinyMCE.addI18n('hi.table_dlg',{ general_tab:"General", advanced_tab:"Advanced", general_props:"General properties", advanced_props:"Advanced properties", rowtype:"Row in table part", title:"Insert/Modify table", width:"Width", height:"Height", cols:"Cols", rows:"Rows", cellspacing:"Cellspacing", cellpadding:"Cellpadding", border:"Border", align:"Alignment", align_default:"Default", align_left:"Left", align_right:"Right", align_middle:"Center", row_title:"Table row properties", cell_title:"Table cell properties", cell_type:"Cell type", valign:"Vertical alignment", align_top:"Top", align_bottom:"Bottom", bordercolor:"Border color", bgcolor:"Background color", merge_cells_title:"Merge table cells", id:"Id", style:"Style", langdir:"Language direction", langcode:"Language code", mime:"Target MIME type", ltr:"Left to right", rtl:"Right to left", bgimage:"Background image", summary:"Summary", td:"Data", th:"Header", cell_cell:"Update current cell", cell_row:"Update all cells in row", cell_all:"Update all cells in table", row_row:"Update current row", row_odd:"Update odd rows in table", row_even:"Update even rows in table", row_all:"Update all rows in table", thead:"Table Head", tbody:"Table Body", tfoot:"Table Foot", scope:"Scope", rowgroup:"Row Group", colgroup:"Col Group", col_limit:"You've exceeded the maximum number of columns of {$cols}.", row_limit:"You've exceeded the maximum number of rows of {$rows}.", cell_limit:"You've exceeded the maximum number of cells of {$cells}.", missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.", caption:"Table caption", frame:"Frame", frame_none:"none", frame_groups:"groups", frame_rows:"rows", frame_cols:"cols", frame_all:"all", rules:"Rules", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/hr_dlg.js000066400000000000000000000043211226600447100236470ustar00rootroot00000000000000tinyMCE.addI18n('hr.table_dlg',{ general_tab:"Osnovno", advanced_tab:"Napredno", general_props:"Osnovna svojstva", advanced_props:"Napredna svojstva", rowtype:"Row in table part", title:"Umetni/uredi tablicu", width:"\u0160irina", height:"Visina", cols:"Stupaca", rows:"Redaka", cellspacing:"Razmak \u0107elija", cellpadding:"Dopuna \u0107elije", border:"Obrub", align:"Poravnavanje", align_default:"Zadano", align_left:"Lijevo", align_right:"Desno", align_middle:"Sredina", row_title:"Svojstva retka", cell_title:"Svojstva \u0107elije", cell_type:"Tip \u0107elije", valign:"Okomito poravnavanje", align_top:"Vrh", align_bottom:"Dno", bordercolor:"Boja obruba", bgcolor:"Background color", merge_cells_title:"Spoji \u0107elije", id:"Id", style:"Stil", langdir:"Smjer jezika", langcode:"Kod jezika", mime:"MIME tip", ltr:"S lijeva na desno", rtl:"S desna na lijevo", bgimage:"Slika pozadine", summary:"Sa\u017Eetak", td:"Podatkovna", th:"Zaglavlje", cell_cell:"Primjeni na odabranu \u0107eliju", cell_row:"Primjeni na sve \u0107elije u retku", cell_all:"Primjeni na sve \u0107elije u tablici", row_row:"Primjeni na odabrani redak", row_odd:"Primjeni na neparne retke u tablici", row_even:"Primjeni na parne retke u tablici", row_all:"Primjeni na sve retke u tablici", thead:"Zaglavlje tablice", tbody:"Tijelo tablice", tfoot:"Podno\u017Eje tablice", scope:"Domet", rowgroup:"Grupa redaka", colgroup:"Grupa stupaca", col_limit:"Prema\u0161ili ste maksimalni broj stupaca ({$cols}).", row_limit:"Prema\u0161ili ste maksimalni broj redaka ({$rows}).", cell_limit:"Prema\u0161ili ste maksimalni broj \u0107elija ({$cells}).", missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.", caption:"Opis tablice", frame:"Frame", frame_none:"none", frame_groups:"groups", frame_rows:"rows", frame_cols:"cols", frame_all:"all", rules:"Rules", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/hu_dlg.js000066400000000000000000000052021226600447100236510ustar00rootroot00000000000000tinyMCE.addI18n('hu.table_dlg',{ general_tab:"\u00C1ltal\u00E1nos", advanced_tab:"Halad\u00F3", general_props:"\u00C1ltal\u00E1nos tulajdons\u00E1gok", advanced_props:"Halad\u00F3 tulajdons\u00E1gok", rowtype:"Sor a t\u00E1bl\u00E1ban", title:"T\u00E1bl\u00E1zat besz\u00FAr\u00E1sa/szerkeszt\u00E9se", width:"Sz\u00E9less\u00E9g", height:"Magass\u00E1g", cols:"Oszlopok", rows:"Sorok", cellspacing:"Cellak\u00F6z", cellpadding:"Cella bels\u0151k\u00F6z", border:"Keret", align:"Igaz\u00EDt\u00E1s", align_default:"Alap\u00E9rtelmezett", align_left:"Balra", align_right:"Jobbra", align_middle:"K\u00F6z\u00E9pre", row_title:"Sor tulajdons\u00E1gai", cell_title:"Cella tulajdons\u00E1gai", cell_type:"Cellat\u00EDpus", valign:"F\u00FCgg\u0151leges igaz\u00EDt\u00E1s", align_top:"Fel", align_bottom:"Le", bordercolor:"Keretsz\u00EDn", bgcolor:"H\u00E1tt\u00E9rsz\u00EDn", merge_cells_title:"Cell\u00E1k \u00F6sszevon\u00E1sa", id:"Id", style:"St\u00EDlus", langdir:"\u00CDr\u00E1s ir\u00E1ny", langcode:"Nyelvk\u00F3d", mime:"C\u00E9l MIME t\u00EDpus", ltr:"Balr\u00F3l jobbra", rtl:"Jobbr\u00F3l balra", bgimage:"H\u00E1tt\u00E9rk\u00E9p", summary:"\u00D6sszegz\u00E9s", td:"Adat", th:"Fejl\u00E9c", cell_cell:"Cella friss\u00EDt\u00E9se", cell_row:"Sor \u00F6sszes cell\u00E1j\u00E1nak friss\u00EDt\u00E9se", cell_all:"T\u00E1bl\u00E1zat \u00F6sszes cell\u00E1j\u00E1nak friss\u00EDt\u00E9se", row_row:"Sor friss\u00EDt\u00E9se", row_odd:"P\u00E1ratlan sorok friss\u00EDt\u00E9se", row_even:"P\u00E1ros sorok friss\u00EDt\u00E9se", row_all:"Minden sor friss\u00EDt\u00E9se", thead:"T\u00E1bl\u00E1zat fej", tbody:"T\u00E1bl\u00E1zat test", tfoot:"T\u00E1bl\u00E1zat l\u00E1b", scope:"Hat\u00F3k\u00F6r", rowgroup:"Sor csoport", colgroup:"Oszlop csoport", col_limit:"T\u00FAll\u00E9pte a maxim\u00E1lis oszlopsz\u00E1mot, ami {$cols}.", row_limit:"T\u00FAll\u00E9pte a maxim\u00E1lis sorsz\u00E1mot, ami {$rows}.", cell_limit:"T\u00FAll\u00E9pte a maxim\u00E1lis cellasz\u00E1mot, ami {$cells}.", missing_scope:"Biztosan folytatni akarja an\u00E9lk\u00FCl, hogy hat\u00F3k\u00F6rt adna ennek a fejl\u00E9ccell\u00E1nak? Korl\u00E1toz\u00E1sokkal \u00E9l\u0151k sz\u00E1m\u00E1ra neh\u00E9z lesz meg\u00E9rteni a t\u00E1bl\u00E1zat tartalm\u00E1t.", caption:"C\u00EDmsor", frame:"Keret", frame_none:"nincs", frame_groups:"csoportok", frame_rows:"sorok", frame_cols:"oszlopok", frame_all:"mind", rules:"Vonalak", rules_void:"sehol", rules_above:"f\u00F6l\u00F6tte", rules_below:"alatta", rules_hsides:"v. oldalak", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"f. oldalak", rules_box:"doboz", rules_border:"keret" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/hy_dlg.js000066400000000000000000000126521226600447100236640ustar00rootroot00000000000000tinyMCE.addI18n('hy.table_dlg',{ general_tab:"\u041E\u0431\u0449\u0435\u0435", advanced_tab:"\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E", general_props:"\u041E\u0431\u0449\u0438\u0435 \u0441\u0432\u043E\u0439\u0441\u0442\u0432\u0430", advanced_props:"\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u043D\u044B\u0435 \u0441\u0432\u043E\u0439\u0441\u0442\u0432\u0430", rowtype:"Row in table part", title:"\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u0435 / \u0418\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0435 \u0442\u0430\u0431\u043B\u0438\u0446\u044B", width:"\u0428\u0438\u0440\u0438\u043D\u0430", height:"\u0412\u044B\u0441\u043E\u0442\u0430", cols:"\u0421\u0442\u043E\u043B\u0431\u0446\u044B", rows:"\u0421\u0440\u043E\u043A\u0438", cellspacing:"\u0420\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u043C\u0435\u0436\u0434\u0443 \u044F\u0447\u0435\u0439\u043A\u0430\u043C\u0438", cellpadding:"\u041E\u0442\u0441\u0442\u0443\u043F\u044B \u0432 \u044F\u0447\u0435\u0439\u043A\u0430\u0445", border:"\u0413\u0440\u0430\u043D\u0438\u0446\u0430", align:"\u0412\u044B\u0440\u0430\u0432\u043D\u0438\u0432\u0430\u043D\u0438\u0435", align_default:"\u041F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E", align_left:"\u041F\u043E \u043B\u0435\u0432\u043E\u043C\u0443 \u043A\u0440\u0430\u044E", align_right:"\u041F\u043E \u043F\u0440\u0430\u0432\u043E\u043C\u0443 \u043A\u0440\u0430\u044E", align_middle:"\u041F\u043E \u0446\u0435\u043D\u0442\u0440\u0443", row_title:"\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u043E\u043A\u0435 \u0442\u0430\u0431\u043B\u0438\u0446\u044B", cell_title:"\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u044F\u0447\u0435\u0439\u043A\u0438 \u0442\u0430\u0431\u043B\u0438\u0446\u044B", cell_type:"\u0422\u0438\u043F \u044F\u0447\u0435\u0439\u043A\u0438", valign:"\u0412\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E\u0435 \u0432\u044B\u0440\u0430\u0432\u043D\u0438\u0432\u0430\u043D\u0438\u0435", align_top:"\u041F\u043E \u0432\u0435\u0440\u0445\u043D\u0435\u043C\u0443 \u043A\u0440\u0430\u044E", align_bottom:"\u041F\u043E \u043D\u0438\u0436\u043D\u0435\u043C\u0443 \u043A\u0440\u0430\u044E", bordercolor:"\u0446\u0432\u0435\u0442 \u0433\u0440\u0430\u043D\u0438\u0446\u044B", bgcolor:"\u0446\u0432\u0435\u0442 \u0444\u043E\u043D\u0430", merge_cells_title:"\u041E\u0431\u044A\u0435\u0434\u0438\u043D\u0438\u0442\u044C \u044F\u0447\u0435\u0439\u043A\u0438", id:"Id", style:"\u0421\u0442\u0438\u043B\u044C", langdir:"\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u044F\u0437\u044B\u043A\u0430", langcode:"\u041A\u043E\u0434 \u044F\u0437\u044B\u043A\u0430", mime:"Target MIME-\u0442\u0438\u043F", ltr:"\u0421\u043B\u0435\u0432\u0430 \u043D\u0430\u043F\u0440\u0430\u0432\u043E", rtl:"\u0421\u043F\u0440\u0430\u0432\u0430 \u043D\u0430\u043B\u0435\u0432\u043E", bgimage:"\u0424\u043E\u043D\u043E\u0432\u043E\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435", summary:"\u041E\u0431\u0449\u0435\u0435", td:"\u0414\u0430\u043D\u043D\u044B\u0435", th:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A", cell_cell:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0442\u0435\u043A\u0443\u0449\u0443\u044E \u044F\u0447\u0435\u0439\u043A\u0443", cell_row:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435 \u044F\u0447\u0435\u0439\u043A\u0438 \u0432 \u0441\u0442\u0440\u043E\u043A\u0435", cell_all:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435 \u044F\u0447\u0435\u0439\u043A\u0438 \u0432 \u0442\u0430\u0431\u043B\u0438\u0446\u0435", row_row:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0442\u0435\u043A\u0443\u0449\u0443\u044E \u0441\u0442\u0440\u043E\u043A\u0443", row_odd:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u043D\u0435\u0447\u0435\u0442\u043D\u044B\u0435 \u0441\u0442\u0440\u043E\u043A\u0438 \u0432 \u0442\u0430\u0431\u043B\u0438\u0446\u0435", row_even:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0447\u0435\u0442\u043D\u044B\u0435 \u0441\u0442\u0440\u043E\u043A\u0438 \u0432 \u0442\u0430\u0431\u043B\u0438\u0446\u0435", row_all:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435 \u0441\u0442\u0440\u043E\u043A\u0438 \u0432 \u0442\u0430\u0431\u043B\u0438\u0446\u0435", thead:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A \u0442\u0430\u0431\u043B\u0438\u0446\u044B", tbody:"\u0422\u0435\u043B\u043E \u0442\u0430\u0431\u043B\u0438\u0446\u044B", tfoot:"\u041D\u0438\u0436\u043D\u044F\u044F \u0447\u0430\u0441\u0442\u0441\u0438\u043D\u0430", scope:"Scope", rowgroup:"Row Group", colgroup:"Col Group", col_limit:"You've exceeded the maximum number of columns of ($ cols)", row_limit:"You've exceeded the maximum number of rows of ($ rows)", cell_limit:"You've exceeded the maximum number of cells of ($ cells)", missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table", caption:"Table caption", frame:"\u0424\u0440\u0435\u0439\u043C", frame_none:"none", frame_groups:"groups", frame_rows:"rows", frame_cols:"cols", frame_all:"all", rules:"Rules", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/ia_dlg.js000066400000000000000000000054711226600447100236360ustar00rootroot00000000000000tinyMCE.addI18n('ia.table_dlg',{ general_tab:"\u57FA\u672C", advanced_tab:"\u9AD8\u7EA7", general_props:"\u57FA\u672C \u5C5E\u6027", advanced_props:"\u9AD8\u7EA7\u5C5E\u6027", rowtype:"\u884C\u6240\u5728\u7684\u8868\u683C\u4F4D\u7F6E", title:"\u63D2\u5165/\u7F16\u8F91 \u8868\u683C", width:"\u5BBD\u5EA6", height:"\u9AD8\u5EA6", cols:"\u5217\u6570", rows:"\u884C\u6570", cellspacing:"\u50A8\u5B58\u683C\u95F4\u8DDD", cellpadding:"\u50A8\u5B58\u683C\u5185\u8DDD", border:"\u8FB9\u6846", align:"\u5BF9\u9F50\u65B9\u5F0F", align_default:"\u9ED8\u8BA4", align_left:"\u5C45\u5DE6", align_right:"\u5C45\u53F3", align_middle:"\u5C45\u4E2D", row_title:"\u884C \u5C5E\u6027", cell_title:"\u50A8\u5B58\u683C \u5C5E\u6027", cell_type:"\u50A8\u5B58\u683C \u7C7B\u522B", valign:"\u5782\u76F4\u5BF9\u9F50\u65B9\u5F0F", align_top:"\u9876\u90E8", align_bottom:"\u5E95\u90E8", bordercolor:"\u8FB9\u6846\u989C\u8272", bgcolor:"\u80CC\u666F\u989C\u8272", merge_cells_title:"\u5408\u5E76\u50A8\u5B58\u683C", id:"Id", style:"\u6837\u5F0F", langdir:"\u8BED\u8A00\u4E66\u5199\u65B9\u5411", langcode:"\u8BED\u8A00\u7F16\u7801", mime:"\u76EE\u6807 MIME \u7C7B\u578B", ltr:"\u4ECE\u5DE6\u5230\u53F3", rtl:"\u4ECE\u53F3\u5230\u5DE6", bgimage:"\u80CC\u666F\u56FE\u7247", summary:"\u6458\u8981", td:"\u8868\u683C", th:"\u8868\u5934", cell_cell:"\u66F4\u65B0\u76EE\u524D\u7684\u50A8\u5B58\u683C", cell_row:"\u66F4\u65B0\u5F53\u524D\u884C\u7684\u50A8\u5B58\u683C", cell_all:"\u66F4\u65B0\u5168\u90E8\u50A8\u5B58\u683C", row_row:"\u66F4\u65B0\u6240\u5728\u884C", row_odd:"\u66F4\u65B0\u8868\u683C\u7684\u5947\u6570\u884C", row_even:"\u66F4\u65B0\u8868\u683C\u7684\u5076\u6570\u884C", row_all:"\u66F4\u65B0\u8868\u683C\u7684\u5168\u90E8\u884C", thead:"\u8868\u5934", tbody:"\u8868\u4F53", tfoot:"\u8868\u811A", scope:"\u8303\u56F4", rowgroup:"\u884C\u7EC4", colgroup:"\u5217\u7EC4", col_limit:"\u5DF2\u8D85\u8FC7\u9650\u5236\uFF0C\u6700\u591A\u4E3A {$cols} \u5217\u3002", row_limit:"\u5DF2\u8D85\u8FC7\u9650\u5236\uFF0C\u6700\u591A\u4E3A {$rows} \u884C\u3002", cell_limit:"\u5DF2\u8D85\u8FC7\u9650\u5236\uFF0C\u6700\u591A\u4E3A{$cells} \u50A8\u5B58\u683C\u3002", missing_scope:"\u60A8\u786E\u5B9A\u4E0D\u6307\u5B9A\u8868\u5934\u50A8\u5B58\u683C\u7684\u8303\u56F4\u5417\uFF1F\u5982\u679C\u4E0D\u6307\u5B9A\uFF0C\u90E8\u5206\u4F7F\u7528\u8005\u5C06\u5F88\u96BE\u67E5\u770B\u8868\u683C\u5185\u5BB9", caption:"\u8868\u683C\u6807\u9898", frame:"\u8FB9\u6846", frame_none:"\u65E0", frame_groups:"\u7EC4", frame_rows:"\u884C", frame_cols:"\u5217", frame_all:"\u5168\u90E8", rules:"\u6807\u5C3A", rules_void:"\u7A7A", rules_above:"\u4E4B\u4E0A", rules_below:"\u4E4B\u4E0B", rules_hsides:"\u6C34\u5E73\u5927\u5C0F", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"\u5782\u76F4\u5927\u5C0F", rules_box:"\u76D2", rules_border:"\u8FB9\u6846" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/id_dlg.js000066400000000000000000000040421226600447100236320ustar00rootroot00000000000000tinyMCE.addI18n('id.table_dlg',{ general_tab:"Umum", advanced_tab:"Advanced", general_props:"Properti Umum", advanced_props:"Properti Advanced", rowtype:"Row in table part", title:"Sisipkan/Ubah Tabel", width:"Lebar", height:"Tinggi", cols:"Cols", rows:"Rows", cellspacing:"Cellspacing", cellpadding:"Cellpadding", border:"Border", align:"Alignment", align_default:"Default", align_left:"Kiri", align_right:"Kanan", align_middle:"Tengah", row_title:"Properti row tabel", cell_title:"Properti cell tabel", cell_type:"Cell type", valign:"Vertical alignment", align_top:"Atas", align_bottom:"Bawah", bordercolor:"Warna Border", bgcolor:"Warna Background", merge_cells_title:"Merge cell tabel", id:"Id", style:"Style", langdir:"Bahasa", langcode:"Kode Bahasa", mime:"Target MIME type", ltr:"Kiri ke kanan", rtl:"Kanan ke kiri", bgimage:"Gambar Background", summary:"Summary", td:"Data", th:"Header", cell_cell:"Update current cell", cell_row:"Update all cells in row", cell_all:"Update all cells in table", row_row:"Update current row", row_odd:"Update odd rows in table", row_even:"Update even rows in table", row_all:"Update all rows in table", thead:"Table Head", tbody:"Table Body", tfoot:"Table Foot", scope:"Scope", rowgroup:"Row Group", colgroup:"Col Group", col_limit:"Anda telah melebihi jumlah maksimum kolom {$cols}.", row_limit:"Anda telah melebihi jumlah maksimum row {$rows}.", cell_limit:"Anda telah melebihi jumlah maksimum cell {$cells}.", missing_scope:"Yakin ingin melanjutkan tanpa menetapkan cakupan sel header tabel ini. Tanpa itu, mungkin sulit bagi beberapa pengguna yang memiliki keterbatasan untuk memahami isi atau data yang ditampilkan dari tabel.", caption:"Table caption", frame:"Frame", frame_none:"none", frame_groups:"groups", frame_rows:"rows", frame_cols:"cols", frame_all:"all", rules:"Rules", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/ii_dlg.js000066400000000000000000000053671226600447100236520ustar00rootroot00000000000000tinyMCE.addI18n('ii.table_dlg',{ general_tab:"\u4E00\u822C", advanced_tab:"\u9AD8\u7EA7", general_props:"\u4E00\u822C\u5C5E\u6027", advanced_props:"\u9AD8\u7EA7\u5C5E\u6027", rowtype:"\u884C\u6240\u5728\u7684\u8868\u683C\u4F4D\u7F6E", title:"\u63D2\u5165/\u7F16\u8F91\u8868\u683C", width:"\u5BBD\u5EA6", height:"\u9AD8\u5EA6", cols:"\u5217\u6570", rows:"\u884C\u6570", cellspacing:"\u50A8\u5B58\u683C\u95F4\u8DDD", cellpadding:"\u50A8\u5B58\u683C\u7559\u767D", border:"\u8FB9\u6846", align:"\u5BF9\u9F50\u65B9\u5F0F", align_default:"\u9884\u8BBE", align_left:"\u9760\u5DE6", align_right:"\u9760\u53F3", align_middle:"\u5C45\u4E2D", row_title:"\u884C\u5C5E\u6027", cell_title:"\u50A8\u5B58\u683C\u5C5E\u6027", cell_type:"\u50A8\u5B58\u683C\u522B", valign:"\u6C34\u51C6\u5BF9\u9F50\u65B9\u5F0F", align_top:"\u4E0A\u65B9", align_bottom:"\u4E0B\u65B9", bordercolor:"\u8FB9\u6846\u989C\u8272", bgcolor:"\u80CC\u666F\u989C\u8272", merge_cells_title:"\u5408\u5E76\u50A8\u5B58\u683C", id:"Id", style:"\u6837\u5F0F", langdir:"\u8BED\u8A00\u4E66\u5199\u65B9\u5411", langcode:"\u8BED\u8A00\u7F16\u7801", mime:"\u76EE\u6807MIME\u7C7B\u578B", ltr:"\u7531\u5DE6\u5230\u53F3", rtl:"\u7531\u53F3\u5230\u5DE6", bgimage:"\u80CC\u666F\u56FE\u7247", summary:"\u6982\u8981", td:"\u6570\u636E", th:"\u8868\u5934", cell_cell:"\u66F4\u65B0\u6240\u7684\u50A8\u5B58\u683C", cell_row:"\u66F4\u65B0\u6240\u5728\u884C\u7684\u5168\u90E8\u50A8\u5B58\u683C", cell_all:"\u66F4\u65B0\u8868\u683C\u5185\u7684\u5168\u90E8\u50A8\u5B58\u683C", row_row:"\u66F4\u65B0\u6240\u5728\u884C", row_odd:"\u66F4\u65B0\u8868\u683C\u5185\u7684\u5947\u6570\u884C", row_even:"\u66F4\u65B0\u8868\u683C\u5185\u7684\u5076\u6570\u884C", row_all:"\u66F4\u65B0\u8868\u683C\u5185\u5168\u90E8\u884C", thead:"\u8868\u5934", tbody:"\u8868\u8EAB", tfoot:"\u8868\u5C3E", scope:"\u8303\u56F4", rowgroup:"\u884C\u7FA4\u7EC4", colgroup:"\u5217\u7FA4\u7EC4", col_limit:"\u5DF2\u8D85\u8FC7\u53EF\u7528\u6570\uFF0C\u6700\u9AD8\u7684\u5217\u6570\u4E3A{$cols}\u5217\u3002", row_limit:"\u5DF2\u8D85\u8FC7\u53EF\u7528\u6570\uFF0C\u6700\u9AD8\u7684\u884C\u6570\u4E3A{$rows}\u884C\u3002", cell_limit:"\u5DF2\u8D85\u8FC7\u53EF\u7528\u6570\uFF0C\u6700\u9AD8\u7684\u50A8\u5B58\u683C\u6570\u4E3A{$cells}\u683C\u3002", missing_scope:"\u6807\u9898\u884C\u7F3A\u5931\uFF01", caption:"\u8868\u683C\u6807\u9898", frame:"\u8FB9\u6846", frame_none:"\u65E0", frame_groups:"\u7FA4\u7EC4", frame_rows:"\u884C", frame_cols:"\u5217", frame_all:"\u5168\u90E8", rules:"\u7EBF\u6761", rules_void:"\u7A7A", rules_above:"\u4E0A", rules_below:"\u4E0B", rules_hsides:"\u6C34\u51C6\u8FB9", rules_lhs:"\u5DE6\u8FB9", rules_rhs:"\u53F3\u8FB9", rules_vsides:"\u5782\u76F4\u8FB9", rules_box:"\u76D2\u578B", rules_border:"\u5916\u6846" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/is_dlg.js000066400000000000000000000041311226600447100236500ustar00rootroot00000000000000tinyMCE.addI18n('is.table_dlg',{ general_tab:"General", advanced_tab:"Advanced", general_props:"General properties", advanced_props:"Advanced properties", rowtype:"Row in table part", title:"Insert/Modify table", width:"Width", height:"Height", cols:"Cols", rows:"Rows", cellspacing:"Cellspacing", cellpadding:"Cellpadding", border:"Border", align:"Alignment", align_default:"Default", align_left:"Left", align_right:"Right", align_middle:"Center", row_title:"Table row properties", cell_title:"Table cell properties", cell_type:"Cell type", valign:"Vertical alignment", align_top:"Top", align_bottom:"Bottom", bordercolor:"Border color", bgcolor:"Background color", merge_cells_title:"Merge table cells", id:"Id", style:"Style", langdir:"Language direction", langcode:"Language code", mime:"Target MIME type", ltr:"Left to right", rtl:"Right to left", bgimage:"Background image", summary:"Summary", td:"Data", th:"Header", cell_cell:"Update current cell", cell_row:"Update all cells in row", cell_all:"Update all cells in table", row_row:"Update current row", row_odd:"Update odd rows in table", row_even:"Update even rows in table", row_all:"Update all rows in table", thead:"Table Head", tbody:"Table Body", tfoot:"Table Foot", scope:"Scope", rowgroup:"Row Group", colgroup:"Col Group", col_limit:"You've exceeded the maximum number of columns of {$cols}.", row_limit:"You've exceeded the maximum number of rows of {$rows}.", cell_limit:"You've exceeded the maximum number of cells of {$cells}.", missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.", caption:"Table caption", frame:"Frame", frame_none:"none", frame_groups:"groups", frame_rows:"rows", frame_cols:"cols", frame_all:"all", rules:"Rules", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/it_dlg.js000066400000000000000000000043771226600447100236650ustar00rootroot00000000000000tinyMCE.addI18n('it.table_dlg',{ general_tab:"Generale", advanced_tab:"Avanzate", general_props:"Propriet\u00E0 generali", advanced_props:"Propriet\u00E0 avanzate", rowtype:"Riga in una parte di tabella", title:"Inserisci/Modifica tabella", width:"Larghezza", height:"Altezza", cols:"Colonne", rows:"Righe", cellspacing:"Spaziatura celle", cellpadding:"Padding celle", border:"Bordo", align:"Allineamento", align_default:"Predefinito", align_left:"A sinistra", align_right:"A destra", align_middle:"Centra", row_title:"Propriet\u00E0 riga", cell_title:"Propriet\u00E0 cella", cell_type:"Tipo cella", valign:"Allineamento verticale", align_top:"In alto", align_bottom:"In basso", bordercolor:"Colore bordo", bgcolor:"Colore sfondo", merge_cells_title:"Unisci celle", id:"Id", style:"Stile", langdir:"Direzione testo", langcode:"Lingua", mime:"Tipo MIME del target", ltr:"Sinistra verso destra", rtl:"Destra verso sinistra", bgimage:"Immagine sfondo", summary:"Sommario", td:"Data", th:"Intestazione", cell_cell:"Aggiorna cella corrente", cell_row:"Aggiorna tutte le celle della riga", cell_all:"Aggiorna tutte le celle della tabella", row_row:"Aggiorna riga corrente", row_odd:"Aggiorna righe dispari della tabella", row_even:"Aggiorna righe pari della tabella", row_all:"Update tutte le righe della tabella", thead:"Intestazione tabella", tbody:"Corpo tabella", tfoot:"Pedice tabella", scope:"Scope", rowgroup:"Gruppo riga", colgroup:"Gruppo colonna", col_limit:"Superato il numero massimo di colonne di {$cols}.", row_limit:"Superato il numero massimo di righe di {$rows}.", cell_limit:"Superato il numero massimo di celle di {$cells}.", missing_scope:"Sicuro di proseguire senza aver specificato uno scope per l'intestazione di questa tabella? Senza di esso, potrebbe essere difficoltoso per alcuni utenti con disabilit\u00E0 capire il contenuto o i dati mostrati nella tabella.", caption:"Table caption", frame:"Cornice", frame_none:"nessuna", frame_groups:"gruppi", frame_rows:"righe", frame_cols:"colonne", frame_all:"tutte", rules:"Regole", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/ja_dlg.js000066400000000000000000000056701226600447100236400ustar00rootroot00000000000000tinyMCE.addI18n('ja.table_dlg',{ general_tab:"\u4E00\u822C", advanced_tab:"\u4E0A\u7D1A\u8005\u5411\u3051", general_props:"\u4E00\u822C", advanced_props:"\u4E0A\u7D1A\u8005\u5411\u3051", rowtype:"\u884C", title:"\u8868\u306E\u633F\u5165/\u7DE8\u96C6", width:"\u5E45", height:"\u9AD8\u3055", cols:"\u5217", rows:"\u884C", cellspacing:"Cellspacing", cellpadding:"Cellpadding", border:"\u67A0\u7DDA", align:"\u914D\u7F6E", align_default:"\u30C7\u30D5\u30A9\u30EB\u30C8", align_left:"\u5DE6\u63C3\u3048", align_right:"\u53F3\u63C3\u3048", align_middle:"\u4E2D\u592E\u63C3\u3048", row_title:"\u884C\u306E\u30D7\u30ED\u30D1\u30C6\u30A3", cell_title:"\u30BB\u30EB\u306E\u30D7\u30ED\u30D1\u30C6\u30A3", cell_type:"\u30BB\u30EB\u7A2E\u5225", valign:"\u5782\u76F4\u65B9\u5411\u306E\u914D\u7F6E", align_top:"\u4E0A\u63C3\u3048", align_bottom:"\u4E0B\u63C3\u3048", bordercolor:"\u67A0\u7DDA\u306E\u8272", bgcolor:"\u80CC\u666F\u8272", merge_cells_title:"\u30BB\u30EB\u306E\u7D50\u5408", id:"ID", style:"\u30B9\u30BF\u30A4\u30EB", langdir:"\u6587\u7AE0\u306E\u65B9\u5411", langcode:"\u8A00\u8A9E\u30B3\u30FC\u30C9", mime:"\u30BF\u30FC\u30B2\u30C3\u30C8\u306EMIME\u30BF\u30A4\u30D7", ltr:"\u5DE6\u304B\u3089\u53F3", rtl:"\u53F3\u304B\u3089\u5DE6", bgimage:"\u80CC\u666F\u753B\u50CF", summary:"\u30B5\u30DE\u30EA\u30FC", td:"\u65E5\u4ED8", th:"\u30D8\u30C3\u30C0", cell_cell:"\u9078\u629E\u30BB\u30EB\u306E\u66F4\u65B0", cell_row:"\u884C\u5185\u306E\u30BB\u30EB\u306E\u66F4\u65B0", cell_all:"\u5168\u3066\u306E\u30BB\u30EB\u306E\u66F4\u65B0", row_row:"\u9078\u629E\u884C\u306E\u66F4\u65B0", row_odd:"\u5947\u6570\u884C\u306E\u66F4\u65B0", row_even:"\u5076\u6570\u884C\u306E\u66F4\u65B0", row_all:"\u5168\u3066\u306E\u884C\u306E\u66F4\u65B0", thead:"\u8868\u30D8\u30C3\u30C0", tbody:"\u8868\u30DC\u30C7\u30A3", tfoot:"\u8868\u30D5\u30C3\u30BF", scope:"\u30B9\u30B3\u30FC\u30D7", rowgroup:"\u884C\u30B0\u30EB\u30FC\u30D7", colgroup:"\u5217\u30B0\u30EB\u30FC\u30D7", col_limit:"\u5217\u306E\u6700\u5927\u6570\u3092\u8D85\u3048\u307E\u3057\u305F\u3002", row_limit:"\u884C\u306E\u6700\u5927\u6570\u3092\u8D85\u3048\u307E\u3057\u305F\u3002", cell_limit:"\u30BB\u30EB\u306E\u6700\u5927\u6570\u3092\u8D85\u3048\u307E\u3057\u305F\u3002", missing_scope:"\u8868\u306E\u30B9\u30B3\u30FC\u30D7\u5C5E\u6027\u3092\u8A2D\u5B9A\u3057\u3066\u3044\u307E\u305B\u3093\u304C\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F", caption:"\u8868\u306B\u898B\u51FA\u3057\u3092\u4ED8\u3051\u308B", frame:"\u30BB\u30EB\u67A0\u7DDA", frame_none:"\u306A\u3057", frame_groups:"\u30B0\u30EB\u30FC\u30D7\u6BCE", frame_rows:"\u884C", frame_cols:"\u5217", frame_all:"\u5168\u3066", rules:"\u8868\u306E\u5916\u67A0", rules_void:"\u306A\u3057", rules_above:"\u4E0A", rules_below:"\u4E0B", rules_hsides:"\u4E0A\u4E0B", rules_lhs:"\u5DE6", rules_rhs:"\u53F3", rules_vsides:"\u5DE6\u53F3", rules_box:"\u4E0A\u4E0B\u5DE6\u53F3(box)", rules_border:"\u4E0A\u4E0B\u5DE6\u53F3(border)" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/ko_dlg.js000066400000000000000000000057341226600447100236600ustar00rootroot00000000000000tinyMCE.addI18n('ko.table_dlg',{ general_tab:"\uC77C\uBC18", advanced_tab:"\uACE0\uAE09", general_props:"\uC77C\uBC18 \uC124\uC815", advanced_props:"\uACE0\uAE09 \uC124\uC815", rowtype:"\uD589", title:"\uD14C\uC774\uBE14\uC758 \uC0BD\uC785/\uD3B8\uC9D1", width:"\uD3ED", height:"\uB192\uC774", cols:"\uB82C", rows:"\uD589", cellspacing:"\uC140 \uAC04\uACA9", cellpadding:"\uC140\uB0B4 \uC5EC\uBC31", border:"\uD14C\uB450\uB9AC\uC120", align:"\uC815\uB82C", align_default:"\uAE30\uBCF8\uAC12", align_left:"\uC67C\uCABD \uB9DE\uCDA4", align_right:"\uC624\uB978\uCABD \uB9DE\uCDA4", align_middle:"\uAC00\uC6B4\uB370 \uB9DE\uCDA4", row_title:"\uD589 \uC124\uC815", cell_title:"\uC140 \uC124\uC815", cell_type:"\uC140 \uC885\uB958", valign:"\uC218\uC9C1 \uC704\uCE58", align_top:"\uC0C1", align_bottom:"\uD558", bordercolor:"\uD14C\uB450\uB9AC\uC120\uC0C9", bgcolor:"\uBC30\uACBD\uC0C9", merge_cells_title:"\uC140 \uACB0\uD569", id:"Id", style:"\uC2A4\uD0C0\uC77C", langdir:"\uBB38\uC790 \uBC29\uD5A5", langcode:"\uC5B8\uC5B4 \uCF54\uB4DC", mime:"Target MIME \uD0C0\uC785", ltr:"\uC67C\uCABD\uC5D0\uC11C \uC624\uB978\uCABD", rtl:"\uC624\uB978\uCABD\uC5D0\uC11C \uC67C\uCABD", bgimage:"\uBC30\uACBD \uC774\uBBF8\uC9C0", summary:"\uC694\uC57D", td:"Data", th:"Header", cell_cell:"\uD604\uC7AC\uC758 \uC140\uC744 \uAC31\uC2E0", cell_row:"\uD589\uC758 \uC804\uC140\uC744 \uAC31\uC2E0", cell_all:"\uD14C\uC774\uBE14\uC758 \uBAA8\uB4E0 \uC140\uC744 \uAC31\uC2E0", row_row:"\uD604\uC7AC\uC758 \uD589\uC744 \uAC31\uC2E0", row_odd:"\uD640\uC218\uD589\uC744 \uAC31\uC2E0", row_even:"\uC9DD\uC218\uD589\uC744 \uAC31\uC2E0", row_all:"\uC804\uD589\uC744 \uAC31\uC2E0", thead:"Table Head", tbody:"Table Body", tfoot:"\uD14C\uC774\uBE14 \uD48B\uD130", scope:"Scope", rowgroup:"\uD589\uADF8\uB8F9", colgroup:"\uC5F4\uADF8\uB8F9", col_limit:"\uB82C\uC218\uC758 \uC0C1\uD55C{$cols}\uB97C \uB118\uC5C8\uC2B5\uB2C8\uB2E4.", row_limit:"\uD589\uC218\uC758 \uC0C1\uD55C{$rows}\uB97C \uB118\uC5C8\uC2B5\uB2C8\uB2E4.", cell_limit:"\uC140\uC218\uC758 \uC0C1\uD55C{$cells}\uB97C \uB118\uC5C8\uC2B5\uB2C8\uB2E4.", missing_scope:"\uC774 \uD45C \uD5E4\uB354\uC140\uC5D0 scope\uC18D\uC131\uC744 \uC9C0\uC815\uD558\uC9C0\uC54A\uC544\uB3C4 \uAD1C\uCC2E\uC2B5\uB2C8\uAE4C? \uC9C0\uC815\uD558\uC9C0 \uC54A\uB294 \uACBD\uC6B0, \uC2DC\uAC04\uC801\uC73C\uB85C \uD14C\uC774\uBE14\uC758 \uAD6C\uC870\uB97C \uD30C\uC545\uD558\uB294 \uAC83\uC774 \uC5B4\uB824\uC6B4 \uBD84\uC758 \uC811\uADFC\uC131\uC774 \uC800\uD558\uD569\uB2C8\uB2E4.", caption:"\uD45C\uC81C", frame:"Frame", frame_none:"\uC5C6\uC74C", frame_groups:"\uADF8\uB8F9", frame_rows:"\uD589", frame_cols:"\uC5F4", frame_all:"\uBAA8\uB450", rules:"Rules", rules_void:"Void", rules_above:"\uC704", rules_below:"\uC544\uB798", rules_hsides:"\uC0C1\uD558\uBC94\uC704\uB9CC", rules_lhs:"\uC88C\uCE21 \uBC94\uC704\uB9CC", rules_rhs:"\uC6B0\uCE21 \uBC94\uC704\uB9CC", rules_vsides:"\uC88C\uC6B0\uBC94\uC704\uB9CC", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/lt_dlg.js000066400000000000000000000054551226600447100236660ustar00rootroot00000000000000tinyMCE.addI18n('lt.table_dlg',{ general_tab:"Bendra", advanced_tab:"I\u0161pl\u0117sta", general_props:"Bendri nustatymai", advanced_props:"I\u0161pl\u0117stiniai nustatymai", rowtype:"Eilut\u0117 lentel\u0117s dalyje", title:"\u012Eterpti/modifikuoti lentel\u0119", width:"Ilgis", height:"Auk\u0161tis", cols:"Stulpeliai", rows:"Eilut\u0117s", cellspacing:"Tarpas tarp langeli\u0173", cellpadding:"Tarpas langelio viduje", border:"R\u0117melis", align:"Lygiavimas", align_default:"Standartinis", align_left:"Lygiuoti kair\u0117je", align_right:"Lygiuoti de\u0161in\u0117je", align_middle:"Centruoti", row_title:"Lentel\u0117s eilut\u0117s nustatymai", cell_title:"Lentel\u0117s langeli\u0173 nustatymai", cell_type:"Langelio tipas", valign:"Vertikalus lygiavimas", align_top:"Vir\u0161uje", align_bottom:"Apa\u010Dioje", bordercolor:"R\u0117melio spalva", bgcolor:"Fono spalva", merge_cells_title:"Sujungti lentel\u0117s langelius", id:"Id", style:"Stilius", langdir:"Kalbos kryptis", langcode:"Kalbos kodas", mime:"Paskirties MIME tipas", ltr:"I\u0161 kair\u0117s \u012F de\u0161in\u0119", rtl:"I\u0161 de\u0161in\u0117s \u012F kair\u0119", bgimage:"Fono paveiksl\u0117lis", summary:"Apibendrinimas", td:"Duomenys", th:"Antra\u0161t\u0117", cell_cell:"Atnaujinti dabartin\u012F langel\u012F", cell_row:"Atnaujinti visus eilut\u0117s langelius", cell_all:"Atnaujinti visus lentel\u0117s langelius", row_row:"Atnaujinti dabartin\u0119 eilut\u0119", row_odd:"Atnaujinti nelygines lentel\u0117s eilutes", row_even:"Atnaujinti lygines lentel\u0117s eilutes", row_all:"Atnaujinti visas lentel\u0117s eilutes", thead:"Lentel\u0117s vir\u0161us", tbody:"Lentel\u0117s vidus", tfoot:"Lentel\u0117s apa\u010Dia", scope:"Galiojimo sritis", rowgroup:"Eilu\u010Di\u0173 grup\u0117", colgroup:"Stulpeli\u0173 grup\u0117", col_limit:"Vir\u0161ijote did\u017Eiausi\u0105 ({$cols}) stulpeli\u0173 kiek\u012F.", row_limit:"Vir\u0161ijote did\u017Eiausi\u0105 ({$rows}) eilu\u010Di\u0173 kiek\u012F.", cell_limit:"Vir\u0161ijote did\u017Eiausi\u0105 ({$cells}) langeli\u0173 kiek\u012F.", missing_scope:"Ar norite t\u0119sti nenurod\u0119 galiojimo srities \u0161iam lentel\u0117s vir\u0161utiniam langeliui. Be nurodymo, kai kuriems naudotojams su negalia gali b\u016Bti sunku suprasti lentel\u0117je atvaizduojam\u0173 duomen\u0173 turin\u012F.", caption:"Lentel\u0117s antra\u0161t\u0117", frame:"R\u0117melis", frame_none:"joks", frame_groups:"grup\u0117s", frame_rows:"eilut\u0117s", frame_cols:"stulpeliai", frame_all:"visi", rules:"Taisykl\u0117s", rules_void:"negaliojantis", rules_above:"vir\u0161utinis", rules_below:"apatinis", rules_hsides:"hor. pus\u0117s", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vert. pus\u0117s", rules_box:"d\u0117\u017Eut\u0117", rules_border:"r\u0117melis" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/lv_dlg.js000066400000000000000000000041311226600447100236560ustar00rootroot00000000000000tinyMCE.addI18n('lv.table_dlg',{ general_tab:"General", advanced_tab:"Advanced", general_props:"General properties", advanced_props:"Advanced properties", rowtype:"Row in table part", title:"Insert/Modify table", width:"Width", height:"Height", cols:"Cols", rows:"Rows", cellspacing:"Cellspacing", cellpadding:"Cellpadding", border:"Border", align:"Alignment", align_default:"Default", align_left:"Left", align_right:"Right", align_middle:"Center", row_title:"Table row properties", cell_title:"Table cell properties", cell_type:"Cell type", valign:"Vertical alignment", align_top:"Top", align_bottom:"Bottom", bordercolor:"Border color", bgcolor:"Background color", merge_cells_title:"Merge table cells", id:"Id", style:"Style", langdir:"Language direction", langcode:"Language code", mime:"Target MIME type", ltr:"Left to right", rtl:"Right to left", bgimage:"Background image", summary:"Summary", td:"Data", th:"Header", cell_cell:"Update current cell", cell_row:"Update all cells in row", cell_all:"Update all cells in table", row_row:"Update current row", row_odd:"Update odd rows in table", row_even:"Update even rows in table", row_all:"Update all rows in table", thead:"Table Head", tbody:"Table Body", tfoot:"Table Foot", scope:"Scope", rowgroup:"Row Group", colgroup:"Col Group", col_limit:"You've exceeded the maximum number of columns of {$cols}.", row_limit:"You've exceeded the maximum number of rows of {$rows}.", cell_limit:"You've exceeded the maximum number of cells of {$cells}.", missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.", caption:"Table caption", frame:"Frame", frame_none:"none", frame_groups:"groups", frame_rows:"rows", frame_cols:"cols", frame_all:"all", rules:"Rules", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/mk_dlg.js000066400000000000000000000043471226600447100236550ustar00rootroot00000000000000tinyMCE.addI18n('mk.table_dlg',{ general_tab:"Osnovno", advanced_tab:"Napredno", general_props:"Osnovna svojstva", advanced_props:"Napredna svojstva", rowtype:"Row in table part", title:"\u0412\u043C\u0435\u0442\u043D\u0438/uredi tablicu", width:"\u0160irina", height:"Visina", cols:"Stupaca", rows:"Redaka", cellspacing:"Razmak \u0107elija", cellpadding:"Dopuna \u0107elije", border:"Obrub", align:"Poravnavanje", align_default:"Zadano", align_left:"Levo", align_right:"Desno", align_middle:"Sredina", row_title:"Svojstva retka", cell_title:"Svojstva \u0107elije", cell_type:"Tip \u0107elije", valign:"Okomito poravnavanje", align_top:"Vrh", align_bottom:"Dno", bordercolor:"Boja obruba", bgcolor:"Background color", merge_cells_title:"Spoji \u0107elije", id:"Id", style:"Stil", langdir:"Smjer jezika", langcode:"Kod jezika", mime:"MIME tip", ltr:"S leva na desno", rtl:"S desna na levo", bgimage:"Slika pozadine", summary:"Sa\u017Eetak", td:"Podatkovna", th:"Zaglavlje", cell_cell:"Primjeni na odabranu \u0107eliju", cell_row:"Primjeni na sve \u0107elije u retku", cell_all:"Primjeni na sve \u0107elije u tablici", row_row:"Primjeni na odabrani redak", row_odd:"Primjeni na neparne retke u tablici", row_even:"Primjeni na parne retke u tablici", row_all:"Primjeni na sve retke u tablici", thead:"Zaglavlje tablice", tbody:"Telo tablice", tfoot:"Podno\u017Eje tablice", scope:"Domet", rowgroup:"Grupa redaka", colgroup:"Grupa stupaca", col_limit:"Prema\u0161ili ste maksimalni broj stupaca ({$cols}).", row_limit:"Prema\u0161ili ste maksimalni broj redaka ({$rows}).", cell_limit:"Prema\u0161ili ste maksimalni broj \u0107elija ({$cells}).", missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.", caption:"Opis tablice", frame:"Frame", frame_none:"none", frame_groups:"groups", frame_rows:"rows", frame_cols:"cols", frame_all:"all", rules:"Rules", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/ml_dlg.js000066400000000000000000000043261226600447100236530ustar00rootroot00000000000000tinyMCE.addI18n('ml.table_dlg',{ general_tab:"General", advanced_tab:"Advanced", general_props:"General properties", advanced_props:"Advanced properties", rowtype:"Row in table part", title:"Insert/Modify table", width:"Width", height:"Height", cols:"Cols", rows:"Rows", cellspacing:"Cellspacing", cellpadding:"Cellpadding", border:"Border", align:"Alignment", align_default:"Default", align_left:"Left", align_right:"Right", align_middle:"Center", row_title:"Table row properties", cell_title:"Table cell properties", cell_type:"Cell type", valign:"Vertical alignment", align_top:"Top", align_bottom:"Bottom", bordercolor:"Border color", bgcolor:"Background color", merge_cells_title:"Merge table cells", id:"Id", style:"Style", langdir:"Language direction", langcode:"Language code", mime:"Target MIME type", ltr:"Left to right", rtl:"Right to left", bgimage:"Background image", summary:"Summary", td:"Data", th:"Header", cell_cell:"Update current cell", cell_row:"Update all cells in row", cell_all:"Update all cells in table", row_row:"Update current row", row_odd:"Update odd rows in table", row_even:"Update even rows in table", row_all:"Update all rows in table", thead:"Table Head", tbody:"Table Body", tfoot:"Table Foot", scope:"Scope", rowgroup:"Row Group", colgroup:"Col Group", col_limit:"You've exceeded the maximum number of columns of {$cols}.", row_limit:"You've exceeded the maximum number of rows of {$rows}.", cell_limit:"You've exceeded the maximum number of cells of {$cells}.", missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.", caption:"Table caption", frame:"Frame", frame_none:"none", frame_groups:"groups", frame_rows:"rows", frame_cols:"cols", frame_all:"\u0D0E\u0D32\u0D4D\u0D32\u0D3E\u0D02", rules:"Rules", rules_void:"void", rules_above:"\u0D2E\u0D41\u0D15\u0D33\u0D3F\u0D32\u0D4D\u200D", rules_below:"\u0D24\u0D3E\u0D34\u0D46", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"\u0D05\u0D24\u0D3F\u0D30\u0D41\u0D4D" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/mn_dlg.js000066400000000000000000000143601226600447100236540ustar00rootroot00000000000000tinyMCE.addI18n('mn.table_dlg',{ general_tab:"\u0415\u0440\u04E9\u043D\u0445\u0438\u0439", advanced_tab:"\u04E8\u0440\u0433\u04E9\u0442\u0433\u04E9\u0441\u04E9\u043D", general_props:"\u0415\u0440\u04E9\u043D\u0445\u0438\u0439 \u0442\u043E\u0445\u0438\u0440\u0433\u043E\u043E", advanced_props:"\u04E8\u0440\u0433\u04E9\u0442\u0433\u04E9\u0441\u04E9\u043D \u0442\u043E\u0445\u0438\u0440\u0433\u043E\u043E", rowtype:"\u041C\u04E9\u0440\u0438\u0439\u043D \u0442\u04E9\u0440\u04E9\u043B", title:"\u0425\u04AF\u0441\u043D\u044D\u0433\u0442 \u043E\u0440\u0443\u0443\u043B\u0430\u0445/\u0437\u0430\u0441\u0430\u0445", width:"\u04E8\u0440\u0433\u04E9\u043D", height:"\u04E8\u043D\u0434\u04E9\u0440", cols:"\u0411\u0430\u0433\u0430\u043D\u0430", rows:"\u041C\u04E9\u0440", cellspacing:"\u041D\u04AF\u0434\u043D\u0438\u0439 \u0430\u043B\u0441\u043B\u0430\u043B\u0442", cellpadding:"\u041D\u04AF\u0434\u043D\u0438\u0439 \u0434\u043E\u0442\u043E\u043E\u0434 \u0430\u043B\u0441\u043B\u0430\u043B\u0442", border:"\u0425\u04AF\u0440\u044D\u044D", align:"\u0416\u0438\u0433\u0434\u0440\u04AF\u04AF\u043B\u044D\u043B\u0442", align_default:"\u04E8\u0433\u04E9\u0433\u0434\u043C\u04E9\u043B", align_left:"\u0417\u04AF\u04AF\u043D", align_right:"\u0411\u0430\u0440\u0443\u0443\u043D", align_middle:"\u0413\u043E\u043B\u0434", row_title:"\u041C\u04E9\u0440\u0438\u0439\u043D \u0448\u0438\u043D\u0436", cell_title:"\u041D\u04AF\u0434\u043D\u0438\u0439 \u0448\u0438\u043D\u0436", cell_type:"\u041D\u04AF\u0434\u043D\u0438\u0439 \u0442\u04E9\u0440\u04E9\u043B", valign:"\u0411\u043E\u0441\u043E\u043E \u0436\u0438\u0433\u0434\u0440\u04AF\u04AF\u043B\u044D\u043B\u0442", align_top:"\u0414\u044D\u044D\u0440", align_bottom:"\u0414\u043E\u043E\u0440", bordercolor:"\u0425\u04AF\u0440\u044D\u044D\u043D\u0438\u0439 \u04E9\u043D\u0433\u04E9", bgcolor:"\u0414\u044D\u0432\u0441\u0433\u044D\u0440 \u04E9\u043D\u0433\u04E9", merge_cells_title:"\u041D\u04AF\u0434 \u043D\u044D\u0433\u0442\u0433\u044D\u0445", id:"\u0422\u0422", style:"\u0425\u044D\u043B\u0431\u044D\u0440\u0436\u04AF\u04AF\u043B\u044D\u043B\u0442", langdir:"\u0411\u0438\u0447\u0433\u0438\u0439\u043D \u0447\u0438\u0433\u043B\u044D\u043B", langcode:"\u0425\u044D\u043B\u043D\u0438\u0439 \u043A\u043E\u0434", mime:"\u0410\u0433\u0443\u0443\u043B\u0433\u044B\u043D MIME-\u0442\u04E9\u0440\u04E9\u043B", ltr:"\u0417\u04AF\u04AF\u043D\u044D\u044D\u0441 \u0431\u0430\u0440\u0443\u0443\u043D", rtl:"\u0411\u0430\u0440\u0443\u0443\u043D\u0430\u0430\u0441 \u0437\u04AF\u04AF\u043D", bgimage:"\u0414\u044D\u0432\u0441\u0433\u044D\u0440 \u0437\u0443\u0440\u0430\u0433", summary:"\u0414\u04AF\u0433\u043D\u044D\u043B\u0442", td:"\u0411\u0438\u0447\u0432\u044D\u0440 \u043D\u04AF\u0434", th:"\u0413\u0430\u0440\u0447\u0438\u0433", cell_cell:"\u042D\u043D\u044D \u043D\u04AF\u0434\u0438\u0439\u0433 \u04E9\u04E9\u0440\u0447\u043B\u04E9\u0445", cell_row:"\u042D\u043D\u044D \u043C\u04E9\u0440\u04E9\u043D \u0434\u04E9\u0445 \u0431\u04AF\u0445 \u043D\u04AF\u0434\u0438\u0439\u0433 \u04E9\u04E9\u0440\u0447\u043B\u04E9\u0445", cell_all:"\u0425\u04AF\u0441\u043D\u044D\u0433\u0442\u0438\u0439\u043D \u0431\u04AF\u0445 \u043D\u04AF\u0434\u0438\u0439\u0433 \u04E9\u04E9\u0440\u0447\u043B\u04E9\u0445", row_row:"\u042D\u043D\u044D \u043C\u04E9\u0440\u0438\u0439\u0433 \u04E9\u04E9\u0440\u0447\u043B\u04E9\u0445", row_odd:"\u0421\u043E\u043D\u0434\u0433\u043E\u0439 \u043C\u04E9\u0440\u04AF\u04AF\u0434\u0438\u0439\u0433 \u04E9\u04E9\u0440\u0447\u043B\u04E9\u0445", row_even:"\u0422\u044D\u0433\u0448 \u043C\u04E9\u0440\u04AF\u04AF\u0434\u0438\u0439\u0433 \u04E9\u04E9\u0440\u0447\u043B\u04E9\u0445", row_all:"\u0411\u04AF\u0445 \u043C\u04E9\u0440\u0438\u0439\u043D \u04E9\u04E9\u0440\u0447\u043B\u04E9\u0445", thead:"\u0425\u04AF\u0441\u043D\u044D\u0433\u0442\u0438\u0439\u043D \u0442\u043E\u043B\u0433\u043E\u0439", tbody:"\u0425\u04AF\u0441\u043D\u044D\u0433\u0442\u0438\u0439\u043D \u0430\u0433\u0443\u0443\u043B\u0433\u0430", tfoot:"\u0425\u04AF\u0441\u043D\u044D\u0433\u0442\u0438\u0439\u043D \u0445\u04E9\u043B", scope:"\u0423\u044F\u043B\u0434\u0430\u0430", rowgroup:"\u0411\u043E\u0441\u043E\u043E \u0431\u04AF\u043B\u044D\u0433\u043B\u044D\u0445", colgroup:"\u0425\u044D\u0432\u0442\u044D\u044D \u0431\u04AF\u043B\u044D\u0433\u043B\u044D\u0445", col_limit:"\u0411\u0430\u0433\u0430\u043D\u044B\u043D \u0442\u043E\u043E\u043D\u044B \u0445\u044F\u0437\u0433\u0430\u0430\u0440 {$cols}-\u0441 \u0445\u044D\u0442\u044D\u0440\u043B\u044D\u044D.", row_limit:"\u041C\u04E9\u0440\u0438\u0439\u043D \u0442\u043E\u043E\u043D\u044B \u0445\u044F\u0437\u0433\u0430\u0430\u0440 {$rows}-\u0441 \u0445\u044D\u0442\u044D\u0440\u043B\u044D\u044D.", cell_limit:"\u041D\u04AF\u0434\u043D\u0438\u0439 \u0442\u043E\u043E\u043D\u044B \u0445\u044F\u0437\u0433\u0430\u0430\u0440 {$cells}-\u0441 \u0445\u044D\u0442\u044D\u0440\u043B\u044D\u044D.", missing_scope:"\u0422\u0430 \u044D\u043D\u044D \u0433\u0430\u0440\u0447\u0433\u0438\u0439\u043D \u0445\u0443\u0432\u044C\u0434 \u04AF\u043D\u044D\u0445\u044D\u044D\u0440 \u0442\u0430\u0439\u043B\u0431\u0430\u0440 \u0445\u0438\u0439\u0445\u0433\u04AF\u0439 \u0431\u0430\u0439\u0445\u044B\u0433 \u0445\u04AF\u0441\u044D\u0436 \u0431\u0430\u0439\u043D\u0430 \u0443\u0443? \u0417\u0430\u0440\u0438\u043C \u0445\u04E9\u0433\u0436\u043B\u0438\u0439\u043D \u0431\u044D\u0440\u0445\u0448\u044D\u044D\u043B\u0442\u044D\u0439 \u0445\u04AF\u043C\u04AF\u04AF\u0441 \u0445\u04AF\u0441\u043D\u044D\u0433\u0442\u0438\u0439\u043D \u0430\u0433\u0443\u0443\u043B\u0433\u044B\u0433 \u043E\u0439\u043B\u0433\u043E\u0445\u043E\u0434 \u0445\u04AF\u043D\u0434\u0440\u044D\u043B\u0442\u044D\u0439 \u0431\u0430\u0439\u0445 \u0431\u043E\u043B\u043D\u043E.", caption:"\u0425\u04AF\u0441\u043D\u044D\u0433\u0442\u0438\u0439\u043D \u0442\u0430\u0439\u043B\u0431\u0430\u0440", frame:"\u0424\u0440\u044D\u0439\u043C", frame_none:"\u0431\u0430\u0439\u0445\u0433\u04AF\u0439", frame_groups:"\u0411\u04AF\u043B\u044D\u0433", frame_rows:"\u041C\u04E9\u0440", frame_cols:"\u0411\u0430\u0433\u0430\u043D\u0430", frame_all:"\u0431\u04AF\u0445", rules:"\u0428\u0443\u0433\u0430\u043C", rules_void:"void", rules_above:"\u0434\u044D\u044D\u0440", rules_below:"\u0434\u043E\u043E\u0440", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/ms_dlg.js000066400000000000000000000040141226600447100236540ustar00rootroot00000000000000tinyMCE.addI18n('ms.table_dlg',{ general_tab:"Am", advanced_tab:"Lanjutan", general_props:"Alatan am", advanced_props:"Alatan lanjutan", rowtype:"Row dalam jadual", title:"Masuk/Ubah jadual", width:"Lebar", height:"Tinggi", cols:"Kol", rows:"Row", cellspacing:"Ruang sel", cellpadding:"Lapisan sel", border:"Sempadan", align:"Penyelarian", align_default:"Asal", align_left:"Kiri", align_right:"Kanan", align_middle:"Tengah", row_title:"Alatan row jadual", cell_title:"Alatan sel jadual", cell_type:"Jenis sel", valign:"Penjajaran tegak", align_top:"Atas", align_bottom:"Bawah", bordercolor:"Warna sempadan", bgcolor:"Warna latar", merge_cells_title:"Gabung sel jadual", id:"Id", style:"Gaya", langdir:"Arah bahasa", langcode:"Kod bahasa", mime:"Sasaran jenis MIME", ltr:"Kiri ke kanan", rtl:"Kanan ke kiri", bgimage:"Imej latar", summary:"Kesimpulan", td:"Data", th:"Kepala", cell_cell:"Baharui sel ini", cell_row:"Baharui semua sel dalam row", cell_all:"Baharui semua sel dalam jadual", row_row:"Baharui row semasa", row_odd:"Baharui row ganjil dalam jadual", row_even:"Baharui row genap dalam jadual", row_all:"Baharui semua row dalam jadual", thead:"Pembuka jadual", tbody:"Isi jadual", tfoot:"Penutup jadual Foot", scope:"Skop", rowgroup:"Kumpulan row", colgroup:"Kumpulan kol", col_limit:"Anda telah melebihi maxima kolum dibenarkan iaitu {$cols}.", row_limit:"Anda telah melebihi maxima row dibenarkan iaitu {$rows}.", cell_limit:"Anda telah melebihi maxima sel dibenarkan iaitu {$cells}.", missing_scope:"Adakah anda pasti terhadap skop sel jadual ini. Ia mungkin memberi kesan kepada OKU memahami isi jadual.", caption:"Tajuk jadual", frame:"Bingkai", frame_none:"tiada", frame_groups:"kumpulan", frame_rows:"row", frame_cols:"kol", frame_all:"semua", rules:"Peraturan", rules_void:"batal", rules_above:"atas", rules_below:"bawah", rules_hsides:"tepian datar", rules_lhs:"hs-kiri", rules_rhs:"hs-kanan", rules_vsides:"tepian tegak", rules_box:"kotak", rules_border:"sempadan" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/nb_dlg.js000066400000000000000000000042721226600447100236420ustar00rootroot00000000000000tinyMCE.addI18n('nb.table_dlg',{ general_tab:"Generelt", advanced_tab:"Avansert", general_props:"Generelt", advanced_props:"Generelle egenskaper", rowtype:"Rad i tabell", title:"Sett inn / rediger tabell", width:"Bredde", height:"H\u00F8yde", cols:"Kolonner", rows:"Rader", cellspacing:"Celleavstand", cellpadding:"Cellefylling", border:"Ramme", align:"Justering", align_default:"Standard", align_left:"Venstre", align_right:"H\u00F8yre", align_middle:"Midtstilt", row_title:"Radegenskaper", cell_title:"Celleegenskaper", cell_type:"Celletype", valign:"Vertikal justering", align_top:"Topp", align_bottom:"Bunn", bordercolor:"Rammefarge", bgcolor:"Bakgrunn", merge_cells_title:"Sl\u00E5 sammen celler", id:"Id", style:"Stil", langdir:"Skriftretning", langcode:"Spr\u00E5kkode", mime:"M\u00E5lets MIME-type", ltr:"Venstre mot h\u00F8yre", rtl:"H\u00F8yre mot venstre", bgimage:"Bakgrunnsbilde", summary:"Sammendrag", td:"Data", th:"Overskrift", cell_cell:"Oppdater aktuell celle", cell_row:"Oppdater alle celler i raden", cell_all:"Oppdater alle celler i tabellen", row_row:"Oppdater aktuell rad", row_odd:"Oppdater oddetallsrader", row_even:"Oppdater partallsrader", row_all:"Oppdater alle rader", thead:"Tabellhode", tbody:"Tabellkropp", tfoot:"Tabellfot", scope:"Omr\u00E5de", rowgroup:"Radgruppe", colgroup:"Kolonnegruppe", col_limit:"Du har overskredet maksimalt antall kolonner p\u00E5 {$cols}.", row_limit:"Du har overskredet maksimalt antall rader p\u00E5 {$rows}.", cell_limit:"Du har overskredet maksimalt antall celler p\u00E5 {$cells}.", missing_scope:"Er du sikker p\u00E5 at du vil fortsette uten \u00E5 angi et omr\u00E5de for denne overskrifscellen? Uten dette kan det bli vanskelig for enkelte funksjonshemmede brukere \u00E5 forst\u00E5 innholdet eller dataene som blir presentert i tabellen.", caption:"Tabelloverskrift", frame:"Ramme", frame_none:"ingen", frame_groups:"grupper", frame_rows:"rader", frame_cols:"kolonner", frame_all:"alle", rules:"Streker", rules_void:"ingen", rules_above:"over", rules_below:"under", rules_hsides:"hsider", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"boks", rules_border:"ramme" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/nl_dlg.js000066400000000000000000000042541226600447100236540ustar00rootroot00000000000000tinyMCE.addI18n('nl.table_dlg',{ general_tab:"Algemeen", advanced_tab:"Geavanceerd", general_props:"Algemene eigenschappen", advanced_props:"Geavanceerde eigenschappen", rowtype:"Rijtype", title:"Tabel invoegen/bewerken", width:"Breedte", height:"Hoogte", cols:"Kolommen", rows:"Rijen", cellspacing:"Ruimte om cel", cellpadding:"Ruimte in cel", border:"Rand", align:"Uitlijning", align_default:"Standaard", align_left:"Links", align_right:"Rechts", align_middle:"Centreren", row_title:"Rij-eigenschappen", cell_title:"Celeigenschappen", cell_type:"Celtype", valign:"Verticale uitlijning", align_top:"Boven", align_bottom:"Onder", bordercolor:"Randkleur", bgcolor:"Achtergrondkleur", merge_cells_title:"Cellen samenvoegen", id:"Id", style:"Stijl", langdir:"Taalrichting", langcode:"Taalcode", mime:"Doel MIME type", ltr:"Van links naar rechts", rtl:"Van rechts naar links", bgimage:"Achtergrondafbeelding", summary:"Samenvatting", td:"Gegevens", th:"Kop", cell_cell:"Huidige cel bijwerken", cell_row:"Alle cellen in rij bijwerken", cell_all:"Alle cellen in tabel bijwerken", row_row:"Huidige rij bijwerken", row_odd:"Oneven rijen bijwerken", row_even:"Even rijen bijwerken", row_all:"Alle rijen bijwerken", thead:"Tabelkop", tbody:"Tabellichaam", tfoot:"Tabelvoet", scope:"Bereik", rowgroup:"Rijgroep", colgroup:"Kolomgroep", col_limit:"U heeft het maximale aantal kolommen van {$cols} overschreden.", row_limit:"U heeft hebt het maximale aantal rijen van {$rows} overschreden.", cell_limit:"U heeft het maximale aantal cellen van {$cells} overschreden.", missing_scope:"Weet u zeker dat u door wilt gaan met het toewijzen van een kop zonder een bereik op te geven? Mensen met een visuele handicap kunnen hierdoor waarschijnlijk slecht bij de gegevens.", caption:"Tabelbeschrijving", frame:"Frame", frame_none:"Geen", frame_groups:"Groepen", frame_rows:"Rijen", frame_cols:"Kolommen", frame_all:"Alles", rules:"Hulplijnen", rules_void:"Geen", rules_above:"Boven", rules_below:"Onder", rules_hsides:"Horizontale zijden", rules_lhs:"Linkerzijkant", rules_rhs:"Rechterzijkant", rules_vsides:"Verticale zijden", rules_box:"Box", rules_border:"Rand" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/nn_dlg.js000066400000000000000000000042561226600447100236600ustar00rootroot00000000000000tinyMCE.addI18n('nn.table_dlg',{ general_tab:"Generelt", advanced_tab:"Avansert", general_props:"Generelt", advanced_props:"Generelle eigenskapar", rowtype:"Rad i tabell", title:"Set inn / rediger tabell", width:"Breidd", height:"H\u00F8gd", cols:"Kolonner", rows:"Rader", cellspacing:"Celleavstand", cellpadding:"Cellefylling", border:"Ramme", align:"Justering", align_default:"Standard", align_left:"Venstre", align_right:"H\u00F8gre", align_middle:"Midtstilt", row_title:"Radeigenskapar", cell_title:"Celleeigenskapar", cell_type:"Celletype", valign:"Vertikal justering", align_top:"Topp", align_bottom:"Botn", bordercolor:"Rammefarge", bgcolor:"Bakgrunn", merge_cells_title:"Sl\u00E5 saman celler", id:"Id", style:"Stil", langdir:"Skriftretning", langcode:"Spr\u00E5kkode", mime:"M\u00E5let sin MIME-type", ltr:"Venstre mot h\u00F8gre", rtl:"H\u00F8gre mot venstre", bgimage:"Bakgrunnsbilete", summary:"Samandrag", td:"Data", th:"Overskrift", cell_cell:"Oppdater aktuell celle", cell_row:"Oppdater alle celler i rada", cell_all:"Oppdater alle celler i tabellen", row_row:"Oppdater aktuell rad", row_odd:"Oppdater oddetallrader", row_even:"Oppdater partallrader", row_all:"Oppdater alle rader", thead:"Tabellhovud", tbody:"Tabellkropp", tfoot:"Tabellfot", scope:"Omr\u00E5de", rowgroup:"Radgruppe", colgroup:"Kolonnegruppe", col_limit:"Du har fleire enn maksimalt tal kolonner p\u00E5 {$cols}.", row_limit:"Du har fleire enn maksimalt tal rader p\u00E5 {$rows}.", cell_limit:"Du har fleire enn maksimalt tal celler p\u00E5 {$cells}.", missing_scope:"Er du sikker p\u00E5 at du vil fortsetje utan \u00E5 angi eit omr\u00E5de for denne overskrifscella? Utan dette kan det bli vanskeleg for enkelte funksjonshemma brukarar \u00E5 forst\u00E5 innhaldet eller dataane som blir presenterte i tabellen.", caption:"Tabelloverskrift", frame:"Ramme", frame_none:"ingen", frame_groups:"grupper", frame_rows:"rader", frame_cols:"kolonnar", frame_all:"alle", rules:"Strekar", rules_void:"ingen", rules_above:"over", rules_below:"under", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"boks", rules_border:"ramme" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/no_dlg.js000066400000000000000000000042651226600447100236610ustar00rootroot00000000000000tinyMCE.addI18n('no.table_dlg',{ general_tab:"Generelt", advanced_tab:"Avansert", general_props:"Generelt", advanced_props:"Generelle egenskaper", rowtype:"Rad i tabell", title:"Sett inn / rediger tabell", width:"Bredde", height:"H\u00F8yde", cols:"Kolonner", rows:"Rader", cellspacing:"Celleavstand", cellpadding:"Cellefylling", border:"Ramme", align:"Justering", align_default:"Standard", align_left:"Venstre", align_right:"H\u00F8yre", align_middle:"Midtstilt", row_title:"Radegenskaper", cell_title:"Celleegenskaper", cell_type:"Celletype", valign:"Vertikal justering", align_top:"Topp", align_bottom:"Bunn", bordercolor:"Rammefarge", bgcolor:"Bakgrunn", merge_cells_title:"Sl\u00E5 sammen celler", id:"Id", style:"Stil", langdir:"Skriftretning", langcode:"Spr\u00E5kkode", mime:"M\u00E5let sin MIME-type", ltr:"Venstre mot h\u00F8yre", rtl:"H\u00F8yre mot venstre", bgimage:"Bakgrunnsbilde", summary:"Sammendrag", td:"Data", th:"Overskrift", cell_cell:"Oppdater aktuell celle", cell_row:"Oppdater alle celler i raden", cell_all:"Oppdater alle celler i tabellen", row_row:"Oppdater aktuell rad", row_odd:"Oppdater oddetallrader", row_even:"Oppdater partallrader", row_all:"Oppdater alle rader", thead:"Tabellhode", tbody:"Tabellkropp", tfoot:"Tabellfot", scope:"Omr\u00E5de", rowgroup:"Radgruppe", colgroup:"Kolonnegruppe", col_limit:"Du har flere enn maksimalt tillatt kolonner p\u00E5 {$cols}.", row_limit:"Du har flere enn maksimalt tillatt rader p\u00E5 {$rows}.", cell_limit:"Du har flere enn maksimalt tillatt celler p\u00E5 {$cells}.", missing_scope:"Er du sikker p\u00E5 at du vil fortsette uten \u00E5 angi et omr\u00E5de for denne overskrifscella? Uten dette kan det bli vanskelig for enkelte funksjonshemmede brukere \u00E5 forst\u00E5 innholdet eller dataene som blir presenterte i tabellen.", caption:"Tabelloverskrift", frame:"Ramme", frame_none:"ingen", frame_groups:"grupper", frame_rows:"rader", frame_cols:"kolonner", frame_all:"alle", rules:"Streker", rules_void:"ingen", rules_above:"over", rules_below:"under", rules_hsides:"hside", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vside", rules_box:"boks", rules_border:"ramme" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/pl_dlg.js000066400000000000000000000051331226600447100236530ustar00rootroot00000000000000tinyMCE.addI18n('pl.table_dlg',{ general_tab:"G\u0142\u00F3wna", advanced_tab:"Zaawansowana", general_props:"G\u0142\u00F3wne w\u0142a\u015Bciwo\u015Bci", advanced_props:"Zaawansowane w\u0142a\u015Bciwo\u015Bci", rowtype:"Row in table part", title:"Wklej/Zmie\u0144 tabel\u0119", width:"Szeroko\u015B\u0107", height:"Wysoko\u015B\u0107", cols:"Kolumny", rows:"Wiersze", cellspacing:"Cellspacing", cellpadding:"Cellpadding", border:"Ramka", align:"Wyr\u00F3wnanie", align_default:"Domy\u015Blnie", align_left:"Lewy", align_right:"Prawy", align_middle:"\u015Arodek", row_title:"W\u0142a\u015Bciwo\u015Bci wiersza", cell_title:"W\u0142a\u015Bciwo\u015Bci kom\u00F3rki", cell_type:"Cell type", valign:"Pionowe wyr\u00F3wnanie", align_top:"G\u00F3ra", align_bottom:"D\u00F3\u0142", bordercolor:"Kolor ramki", bgcolor:"Kolor t\u0142a", merge_cells_title:"Po\u0142\u0105cz kom\u00F3rki", id:"Id", style:"Styl", langdir:"Kierunek czytania tekstu", langcode:"Oznaczenie kodowe j\u0119zyka", mime:"Docelowy typ MIME", ltr:"Kierunek z lewej do prawej", rtl:"Kierunek z prawej do lewej", bgimage:"Obrazek t\u0142a", summary:"Podsumowanie", td:"Data", th:"Nag\u0142owek", cell_cell:"Zmie\u0144 aktualn\u0105 kom\u00F3rk\u0119", cell_row:"Zmie\u0144 wszytkie kom\u00F3rki w wierszu", cell_all:"Zmie\u0144 wszytkie kom\u00F3rki w tabeli", row_row:"Zmie\u0144 aktualny wiersz", row_odd:"Zmie\u0144 nieparzyste wiersze", row_even:"Zmie\u0144 parzyste wiersze", row_all:"Zmie\u0144 wszystkie wiersze", thead:"Nag\u0142\u00F3wek tabeli", tbody:"Cia\u0142o tabeli", tfoot:"Stopka tabeli", scope:"Zakres", rowgroup:"Grupa wierszy", colgroup:"Grupa kolumn", col_limit:"Przekroczy\u0142e\u015B maksymaln\u0105 liczb\u0119 kolumn kt\u00F3ra wynosi {$cols}.", row_limit:"Przekroczy\u0142e\u015B maksymaln\u0105 liczb\u0119 wierszy kt\u00F3ra wynosi {$rows}.", cell_limit:"Przekroczy\u0142e\u015B maksymaln\u0105 liczb\u0119 kom\u00F3rek kt\u00F3ra wynosi {$cells}.", missing_scope:"Jeste\u015B pewny \u017Ce chcesz kontynuowa\u0107 bez definiowania zasi\u0119gu dla kom\u00F3rki tabeli. Bez niej, mo\u017Ce by\u0107 trudne dla niekt\u00F3rych u\u017Cytkownik\u00F3w zrozuminie zawarto\u015Bci albo danych wy\u015Bwietlanych poza tabel\u0105.", caption:"Nag\u0142\u00F3wek tabeli", frame:"Ramka", frame_none:"brak", frame_groups:"grupy", frame_rows:"wiersze", frame_cols:"kolumny", frame_all:"wszystkie", rules:"Prowadnice", rules_void:"void", rules_above:"nad", rules_below:"pod", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/ps_dlg.js000066400000000000000000000041311226600447100236570ustar00rootroot00000000000000tinyMCE.addI18n('ps.table_dlg',{ general_tab:"General", advanced_tab:"Advanced", general_props:"General properties", advanced_props:"Advanced properties", rowtype:"Row in table part", title:"Insert/Modify table", width:"Width", height:"Height", cols:"Cols", rows:"Rows", cellspacing:"Cellspacing", cellpadding:"Cellpadding", border:"Border", align:"Alignment", align_default:"Default", align_left:"Left", align_right:"Right", align_middle:"Center", row_title:"Table row properties", cell_title:"Table cell properties", cell_type:"Cell type", valign:"Vertical alignment", align_top:"Top", align_bottom:"Bottom", bordercolor:"Border color", bgcolor:"Background color", merge_cells_title:"Merge table cells", id:"Id", style:"Style", langdir:"Language direction", langcode:"Language code", mime:"Target MIME type", ltr:"Left to right", rtl:"Right to left", bgimage:"Background image", summary:"Summary", td:"Data", th:"Header", cell_cell:"Update current cell", cell_row:"Update all cells in row", cell_all:"Update all cells in table", row_row:"Update current row", row_odd:"Update odd rows in table", row_even:"Update even rows in table", row_all:"Update all rows in table", thead:"Table Head", tbody:"Table Body", tfoot:"Table Foot", scope:"Scope", rowgroup:"Row Group", colgroup:"Col Group", col_limit:"You've exceeded the maximum number of columns of {$cols}.", row_limit:"You've exceeded the maximum number of rows of {$rows}.", cell_limit:"You've exceeded the maximum number of cells of {$cells}.", missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.", caption:"Table caption", frame:"Frame", frame_none:"none", frame_groups:"groups", frame_rows:"rows", frame_cols:"cols", frame_all:"all", rules:"Rules", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/pt_dlg.js000066400000000000000000000043721226600447100236670ustar00rootroot00000000000000tinyMCE.addI18n('pt.table_dlg',{ general_tab:"Geral", advanced_tab:"Avan\u00E7ado", general_props:"Propriedades gerais", advanced_props:"Propriedades avan\u00E7adas", rowtype:"Linha na parte da tabela", title:"Inserir/modificar tabela", width:"Largura", height:"Altura", cols:"Colunas", rows:"Linhas", cellspacing:"Espa\u00E7amento da C\u00E9lula", cellpadding:"Enchimento da C\u00E9lula", border:"Limites", align:"Alinha.", align_default:"Padr\u00E3o", align_left:"Esquerda", align_right:"Direita", align_middle:"Centro", row_title:"Propriedades de linhas", cell_title:"Propriedades de c\u00E9lulas", cell_type:"Tipo c\u00E9l.", valign:"Alinha. vert.", align_top:"Topo", align_bottom:"Abaixo", bordercolor:"Cor dos limites", bgcolor:"Cor de fundo", merge_cells_title:"Unir c\u00E9lulas", id:"Id", style:"Estilo", langdir:"Dire\u00E7\u00E3o do texto", langcode:"C\u00F3digo do idioma", mime:"MIME alvo", ltr:"Da esquerda para a direita", rtl:"Da direita para a esquerda", bgimage:"Imagem de fundo", summary:"Sum\u00E1rio", td:"Dados", th:"Campo", cell_cell:"Atualizar esta c\u00E9lula", cell_row:"Atualizar todas as c\u00E9lulas na linha", cell_all:"Atualizar todas as c\u00E9lulas na tabela", row_row:"Atualizar esta linha", row_odd:"Atualizar linhas \u00EDmpares", row_even:"Atualizar linhas pares", row_all:"Atualizar todas as linhas", thead:"Topo da tabela", tbody:"Corpo da tabela", tfoot:"Rodap\u00E9 da tabela", scope:"Alcance", rowgroup:"Grupo linhas", colgroup:"Grupo colunas", col_limit:"Excedeu o n\u00FAmero m\u00E1ximo de colunas de {$cols}.", row_limit:"Excedeu o n\u00FAmero m\u00E1ximo de linhas de {$rows}.", cell_limit:"Excedeu o n\u00FAmero m\u00E1ximo de c\u00E9lulas de {$cells}.", missing_scope:"Tem certeza de que quer continuar sem especificar um escopo para esta c\u00E9lula? (Isso poder\u00E1 causar dificuldades a usu\u00E1rios deficientes)", caption:"T\u00EDtulo da tabela", frame:"Frame", frame_none:"Nenhum", frame_groups:"Grupos", frame_rows:"Linhas", frame_cols:"colunas", frame_all:"Todos", rules:"Regras", rules_void:"void", rules_above:"acima", rules_below:"abaixo", rules_hsides:"Hsides", rules_lhs:"Lhs", rules_rhs:"Rhs", rules_vsides:"Vsides", rules_box:"Box", rules_border:"Limites" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/ro_dlg.js000066400000000000000000000045401226600447100236610ustar00rootroot00000000000000tinyMCE.addI18n('ro.table_dlg',{ general_tab:"General", advanced_tab:"Avansat", general_props:"Propriet\u0103\u0163i generale", advanced_props:"Propriet\u0103\u0163i avansate", rowtype:"R\u0103nd \u00EEn tabel", title:"Inserare/modificare tabel", width:"L\u0103\u0163ime", height:"\u00CEn\u0103l\u0163ime", cols:"Coloane", rows:"R\u00E2nduri", cellspacing:"Spa\u0163iu \u00EEntre celule", cellpadding:"Spa\u0163iu \u00EEn celule", border:"Bordur\u0103", align:"Aliniere", align_default:"Implicit\u0103", align_left:"St\u00E2nga", align_right:"Dreapta", align_middle:"Centru", row_title:"Propriet\u0103\u0163i r\u00E2nd", cell_title:"Propriet\u0103\u0163i celul\u0103", cell_type:"Tip celul\u0103", valign:"Aliniere vertical\u0103", align_top:"Sus", align_bottom:"Jos", bordercolor:"Culoare bordur\u0103", bgcolor:"Culoare fundal", merge_cells_title:"Uni\u0163i celulele", id:"Id", style:"Stil", langdir:"Direc\u0163ie limb\u0103", langcode:"Cod limb\u0103", mime:"MIME type \u0163int\u0103", ltr:"De la st\u00E2nga la dreapta", rtl:"De la dreapta la st\u00E2nga", bgimage:"Imagine de fundal", summary:"Sumar", td:"Date", th:"Antet", cell_cell:"Actualizeaz\u0103 celula curent\u0103", cell_row:"Actualizeaz\u0103 toate celulele din r\u00E2nd", cell_all:"Actualizeaz\u0103 toate celulele din tabel", row_row:"Actualizeaz\u0103 r\u00E2nd curent", row_odd:"Actualizeaz\u0103 r\u00E2ndurile impare", row_even:"Actualizeaz\u0103 r\u00E2ndurile pare", row_all:"Actualizeaz\u0103 toate r\u00E2ndurile", thead:"Antet tabel", tbody:"Corp tabel", tfoot:"Subsol tabel", scope:"Scop", rowgroup:"Grupeaz\u0103 r\u00E2nduri", colgroup:"Grupeaz\u0103 celule", col_limit:"A\u0163i dep\u0103\u015Fit num\u0103rul maxim de coloane: {$cols}.", row_limit:"A\u0163i dep\u0103\u015Fit num\u0103rul maxim de r\u00E2nduri: {$rows}.", cell_limit:"A\u0163i dep\u0103\u015Fit num\u0103rul maxim de celule: {$cells}.", missing_scope:"Sigur dori\u0163i s\u0103 l\u0103sa\u0163i scopul necompletat? ", caption:"Titlu tabel", frame:"Frame", frame_none:"niciuna", frame_groups:"grupuri", frame_rows:"r\u00E2nduri", frame_cols:"coloane", frame_all:"toate", rules:"Reguli", rules_void:"gol", rules_above:"deasupra", rules_below:"dedesubt", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/ru_dlg.js000066400000000000000000000127621226600447100236740ustar00rootroot00000000000000tinyMCE.addI18n('ru.table_dlg',{ general_tab:"\u041E\u0431\u0449\u0435\u0435", advanced_tab:"\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E", general_props:"\u041E\u0431\u0449\u0438\u0435 \u0441\u0432\u043E\u0439\u0441\u0442\u0432\u0430", advanced_props:"\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u043D\u044B\u0435 \u0441\u0432\u043E\u0439\u0441\u0442\u0432\u0430", rowtype:"Row in table part", title:"\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u0435 / \u0418\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0435 \u0442\u0430\u0431\u043B\u0438\u0446\u044B", width:"\u0428\u0438\u0440\u0438\u043D\u0430", height:"\u0412\u044B\u0441\u043E\u0442\u0430", cols:"\u0421\u0442\u043E\u043B\u0431\u0446\u044B", rows:"\u0421\u0440\u043E\u043A\u0438", cellspacing:"\u0420\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u043C\u0435\u0436\u0434\u0443 \u044F\u0447\u0435\u0439\u043A\u0430\u043C\u0438", cellpadding:"\u041E\u0442\u0441\u0442\u0443\u043F\u044B \u0432 \u044F\u0447\u0435\u0439\u043A\u0430\u0445", border:"\u0413\u0440\u0430\u043D\u0438\u0446\u0430", align:"\u0412\u044B\u0440\u0430\u0432\u043D\u0438\u0432\u0430\u043D\u0438\u0435", align_default:"\u041F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E", align_left:"\u041F\u043E \u043B\u0435\u0432\u043E\u043C\u0443 \u043A\u0440\u0430\u044E", align_right:"\u041F\u043E \u043F\u0440\u0430\u0432\u043E\u043C\u0443 \u043A\u0440\u0430\u044E", align_middle:"\u041F\u043E \u0446\u0435\u043D\u0442\u0440\u0443", row_title:"\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u043E\u043A\u0435 \u0442\u0430\u0431\u043B\u0438\u0446\u044B", cell_title:"\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u044F\u0447\u0435\u0439\u043A\u0438 \u0442\u0430\u0431\u043B\u0438\u0446\u044B", cell_type:"\u0422\u0438\u043F \u044F\u0447\u0435\u0439\u043A\u0438", valign:"\u0412\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E\u0435 \u0432\u044B\u0440\u0430\u0432\u043D\u0438\u0432\u0430\u043D\u0438\u0435", align_top:"\u041F\u043E \u0432\u0435\u0440\u0445\u043D\u0435\u043C\u0443 \u043A\u0440\u0430\u044E", align_bottom:"\u041F\u043E \u043D\u0438\u0436\u043D\u0435\u043C\u0443 \u043A\u0440\u0430\u044E", bordercolor:"\u0446\u0432\u0435\u0442 \u0433\u0440\u0430\u043D\u0438\u0446\u044B", bgcolor:"\u0446\u0432\u0435\u0442 \u0444\u043E\u043D\u0430", merge_cells_title:"\u041E\u0431\u044A\u0435\u0434\u0438\u043D\u0438\u0442\u044C \u044F\u0447\u0435\u0439\u043A\u0438", id:"Id", style:"\u0421\u0442\u0438\u043B\u044C", langdir:"\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u044F\u0437\u044B\u043A\u0430", langcode:"\u041A\u043E\u0434 \u044F\u0437\u044B\u043A\u0430", mime:"Target MIME-\u0442\u0438\u043F", ltr:"\u0421\u043B\u0435\u0432\u0430 \u043D\u0430\u043F\u0440\u0430\u0432\u043E", rtl:"\u0421\u043F\u0440\u0430\u0432\u0430 \u043D\u0430\u043B\u0435\u0432\u043E", bgimage:"\u0424\u043E\u043D\u043E\u0432\u043E\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435", summary:"\u041E\u0431\u0449\u0435\u0435", td:"\u0414\u0430\u043D\u043D\u044B\u0435", th:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A", cell_cell:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0442\u0435\u043A\u0443\u0449\u0443\u044E \u044F\u0447\u0435\u0439\u043A\u0443", cell_row:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435 \u044F\u0447\u0435\u0439\u043A\u0438 \u0432 \u0441\u0442\u0440\u043E\u043A\u0435", cell_all:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435 \u044F\u0447\u0435\u0439\u043A\u0438 \u0432 \u0442\u0430\u0431\u043B\u0438\u0446\u0435", row_row:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0442\u0435\u043A\u0443\u0449\u0443\u044E \u0441\u0442\u0440\u043E\u043A\u0443", row_odd:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u043D\u0435\u0447\u0435\u0442\u043D\u044B\u0435 \u0441\u0442\u0440\u043E\u043A\u0438 \u0432 \u0442\u0430\u0431\u043B\u0438\u0446\u0435", row_even:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0447\u0435\u0442\u043D\u044B\u0435 \u0441\u0442\u0440\u043E\u043A\u0438 \u0432 \u0442\u0430\u0431\u043B\u0438\u0446\u0435", row_all:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435 \u0441\u0442\u0440\u043E\u043A\u0438 \u0432 \u0442\u0430\u0431\u043B\u0438\u0446\u0435", thead:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A \u0442\u0430\u0431\u043B\u0438\u0446\u044B", tbody:"\u0422\u0435\u043B\u043E \u0442\u0430\u0431\u043B\u0438\u0446\u044B", tfoot:"\u041D\u0438\u0436\u043D\u044F\u044F \u0447\u0430\u0441\u0442\u0441\u0438\u043D\u0430", scope:"Scope", rowgroup:"Row Group", colgroup:"Col Group", col_limit:"You've exceeded the maximum number of columns of ($ cols)", row_limit:"You've exceeded the maximum number of rows of ($ rows)", cell_limit:"You've exceeded the maximum number of cells of ($ cells)", missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table", caption:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432 \u0442\u0430\u0431\u043B\u0438\u0446\u044B", frame:"\u0424\u0440\u0435\u0439\u043C", frame_none:"none", frame_groups:"groups", frame_rows:"rows", frame_cols:"cols", frame_all:"all", rules:"Rules", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/sc_dlg.js000066400000000000000000000053051226600447100236460ustar00rootroot00000000000000tinyMCE.addI18n('sc.table_dlg',{ general_tab:"\u4E00\u822C", advanced_tab:"\u9AD8\u7EA7", general_props:"\u4E00\u822C\u5C5E\u6027", advanced_props:"\u9AD8\u7EA7\u5C5E\u6027", rowtype:"\u884C\u6240\u5728\u7684\u8868\u683C\u4F4D\u7F6E", title:"\u63D2\u5165/\u7F16\u8F91\u8868\u683C", width:"\u5BBD\u5EA6", height:"\u9AD8\u5EA6", cols:"\u5217\u6570", rows:"\u884C\u6570", cellspacing:"\u5355\u683C\u95F4\u8DDD", cellpadding:"\u5355\u683C\u7559\u767D", border:"\u8FB9\u6846", align:"\u5BF9\u9F50\u65B9\u5F0F", align_default:"\u9884\u8BBE", align_left:"\u9760\u5DE6", align_right:"\u9760\u53F3", align_middle:"\u5C45\u4E2D", row_title:"\u884C\u5C5E\u6027", cell_title:"\u5355\u683C\u5C5E\u6027", cell_type:"\u5355\u683C\u522B", valign:"\u6C34\u51C6\u5BF9\u9F50\u65B9\u5F0F", align_top:"\u4E0A\u65B9", align_bottom:"\u4E0B\u65B9", bordercolor:"\u8FB9\u6846\u989C\u8272", bgcolor:"\u80CC\u666F\u989C\u8272", merge_cells_title:"\u5408\u5E76\u5355\u683C", id:"Id", style:"\u6837\u5F0F", langdir:"\u8BED\u8A00\u4E66\u5199\u65B9\u5411", langcode:"\u8BED\u8A00\u7F16\u7801", mime:"\u76EE\u6807MIME\u7C7B\u578B", ltr:"\u7531\u5DE6\u5230\u53F3", rtl:"\u7531\u53F3\u5230\u5DE6", bgimage:"\u80CC\u666F\u56FE\u7247", summary:"\u6982\u8981", td:"\u6570\u636E", th:"\u8868\u5934", cell_cell:"\u66F4\u65B0\u6240\u7684\u5355\u683C", cell_row:"\u66F4\u65B0\u6240\u5728\u884C\u7684\u5168\u90E8\u5355\u683C", cell_all:"\u66F4\u65B0\u8868\u683C\u5185\u7684\u5168\u90E8\u5355\u683C", row_row:"\u66F4\u65B0\u6240\u5728\u884C", row_odd:"\u66F4\u65B0\u8868\u683C\u5185\u7684\u5947\u6570\u884C", row_even:"\u66F4\u65B0\u8868\u683C\u5185\u7684\u5076\u6570\u884C", row_all:"\u66F4\u65B0\u8868\u683C\u5185\u5168\u90E8\u884C", thead:"\u8868\u5934", tbody:"\u8868\u8EAB", tfoot:"\u8868\u5C3E", scope:"\u8303\u56F4", rowgroup:"\u884C\u7FA4\u7EC4", colgroup:"\u5217\u7FA4\u7EC4", col_limit:"\u5DF2\u8D85\u8FC7\u53EF\u7528\u6570\uFF0C\u6700\u9AD8\u7684\u5217\u6570\u4E3A{$cols}\u5217\u3002 ", row_limit:"\u5DF2\u8D85\u8FC7\u53EF\u7528\u6570\uFF0C\u6700\u9AD8\u7684\u884C\u6570\u4E3A{$rows}\u884C\u3002 ", cell_limit:"\u5DF2\u8D85\u8FC7\u53EF\u7528\u6570\uFF0C\u6700\u9AD8\u7684\u5355\u683C\u6570\u4E3A{$cells}\u683C\u3002 ", missing_scope:"\u6807\u9898\u884C\u7F3A\u5931\uFF01 ", caption:"\u8868\u683C\u6807\u9898", frame:"\u8FB9\u6846", frame_none:"\u65E0", frame_groups:"\u7FA4\u7EC4", frame_rows:"\u884C", frame_cols:"\u5217", frame_all:"\u5168\u90E8", rules:"\u7EBF\u6761", rules_void:"\u7A7A", rules_above:"\u4E0A", rules_below:"\u4E0B", rules_hsides:"\u6C34\u51C6\u8FB9", rules_lhs:"\u5DE6\u8FB9", rules_rhs:"\u53F3\u8FB9", rules_vsides:"\u5782\u76F4\u8FB9", rules_box:"\u76D2\u578B", rules_border:"\u5916\u6846" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/se_dlg.js000066400000000000000000000041731226600447100236520ustar00rootroot00000000000000tinyMCE.addI18n('se.table_dlg',{ general_tab:"Generellt", advanced_tab:"Avancerat", general_props:"Generella inst\u00E4llningar", advanced_props:"Avancerade inst\u00E4llningar", rowtype:"Radtyp", title:"Infoga/redigera ny tabell", width:"Bredd", height:"H\u00F6jd", cols:"Kolumner", rows:"Rader", cellspacing:"Cellspacing", cellpadding:"Cellpadding", border:"Ram", align:"Justering", align_default:"Ingen", align_left:"V\u00E4nster", align_right:"H\u00F6ger", align_middle:"Mitten", row_title:"Tabellradsinst\u00E4llningar", cell_title:"Tabellcellsinst\u00E4llningar", cell_type:"Celltyp", valign:"Vertikal justering", align_top:"Toppen", align_bottom:"Botten", bordercolor:"Ramf\u00E4rg", bgcolor:"Bakgrundsf\u00E4rg", merge_cells_title:"Sammanfoga celler", id:"Id", style:"Stil", langdir:"Skriftriktning", langcode:"Spr\u00E5kkod", ltr:"V\u00E4nster till h\u00F6ger", rtl:"H\u00F6ger till v\u00E4nster", bgimage:"Bakgrundsbild", summary:"Sammanfattning", td:"Data", th:"Huvud", cell_cell:"Uppdatera nuvarande cell", cell_row:"Uppdatera alla celler i raden", cell_all:"Uppdatera alla celler i tabellen", row_row:"Uppdatera nuvarande rad", row_odd:"Uppdatera udda rader i tabellen", row_even:"Uppdatera j\u00E4mna rader i tabellen", row_all:"Uppdatera alla rader i tabellen", thead:"tabellhuvud", tbody:"tabellkropp", tfoot:"tabellfot", scope:"Omfattning", rowgroup:"Radgrupp", colgroup:"Kolumngrupp", col_limit:"Du kan inte ange fler \u00E4n {$cols} kolumner.", row_limit:"Du kan inte ange fler \u00E4n {$rows} rader.", cell_limit:"Du kan inte skapa en tabell med fler \u00E4n {$cells} celler.", missing_scope:"\u00C4r du s\u00E4ker p\u00E5 att du vill forts\u00E4tta utan att ange en omfattning, denna underl\u00E4ttar f\u00F6r icke-grafiska webbl\u00E4sare.", caption:"\u00D6verskrift", frame:"Ram", frame_none:"none", frame_groups:"groups", frame_rows:"rows", frame_cols:"cols", frame_all:"all", rules:"Regler", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/si_dlg.js000066400000000000000000000041311226600447100236500ustar00rootroot00000000000000tinyMCE.addI18n('si.table_dlg',{ general_tab:"General", advanced_tab:"Advanced", general_props:"General properties", advanced_props:"Advanced properties", rowtype:"Row in table part", title:"Insert/Modify table", width:"Width", height:"Height", cols:"Cols", rows:"Rows", cellspacing:"Cellspacing", cellpadding:"Cellpadding", border:"Border", align:"Alignment", align_default:"Default", align_left:"Left", align_right:"Right", align_middle:"Center", row_title:"Table row properties", cell_title:"Table cell properties", cell_type:"Cell type", valign:"Vertical alignment", align_top:"Top", align_bottom:"Bottom", bordercolor:"Border color", bgcolor:"Background color", merge_cells_title:"Merge table cells", id:"Id", style:"Style", langdir:"Language direction", langcode:"Language code", mime:"Target MIME type", ltr:"Left to right", rtl:"Right to left", bgimage:"Background image", summary:"Summary", td:"Data", th:"Header", cell_cell:"Update current cell", cell_row:"Update all cells in row", cell_all:"Update all cells in table", row_row:"Update current row", row_odd:"Update odd rows in table", row_even:"Update even rows in table", row_all:"Update all rows in table", thead:"Table Head", tbody:"Table Body", tfoot:"Table Foot", scope:"Scope", rowgroup:"Row Group", colgroup:"Col Group", col_limit:"You've exceeded the maximum number of columns of {$cols}.", row_limit:"You've exceeded the maximum number of rows of {$rows}.", cell_limit:"You've exceeded the maximum number of cells of {$cells}.", missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.", caption:"Table caption", frame:"Frame", frame_none:"none", frame_groups:"groups", frame_rows:"rows", frame_cols:"cols", frame_all:"all", rules:"Rules", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/sk_dlg.js000066400000000000000000000051671226600447100236640ustar00rootroot00000000000000tinyMCE.addI18n('sk.table_dlg',{ general_tab:"Hlavn\u00E9", advanced_tab:"Roz\u0161\u00EDren\u00E9", general_props:"Hlavn\u00E9 vlastnosti", advanced_props:"Roz\u0161\u00EDren\u00E9 vlastnosti", rowtype:"Row in table part", title:"Vlo\u017Ei\u0165/Upravi\u0165 tabu\u013Eku", width:"\u0160\u00EDrka", height:"V\u00FD\u0161ka", cols:"St\u013Apce", rows:"Riadky", cellspacing:"Cellspacing", cellpadding:"Cellpadding", border:"R\u00E1m\u010Dek", align:"Poloha", align_default:"Predvolen\u00E9", align_left:"V\u013Eavo", align_right:"Vpravo", align_middle:"Na stred", row_title:"Vlastnosti riadkov tabu\u013Eky", cell_title:"Vlastnosti buniek tabu\u013Eky", cell_type:"Typ bunky", valign:"Vertik\u00E1lna poloha", align_top:"Hore", align_bottom:"Dolu", bordercolor:"Farba or\u00E1movania", bgcolor:"Farba pozadia", merge_cells_title:"Zl\u00FA\u010Di\u0165 bunky tabu\u013Eky", id:"ID", style:"CSS \u0160t\u00FDl", langdir:"Smer textu", langcode:"K\u00F3d jazyka", mime:"Cie\u013Eov\u00FD typ MIME", ltr:"Z \u013Eava do prava", rtl:"Z prava do \u013Eava", bgimage:"Obr\u00E1zok pozadia", summary:"Popis tabu\u013Eky", td:"D\u00E1ta", th:"Hlavi\u010Dka", cell_cell:"Aktualizova\u0165 aktu\u00E1lnu bunku", cell_row:"Aktualizova\u0165 v\u0161etky bunky v riadku", cell_all:"Aktualizova\u0165 v\u0161etky bunky v tebu\u013Eke", row_row:"Aktualizova\u0165 aktu\u00E1lny riadok", row_odd:"Aktualizova\u0165 odd rows in table", row_even:"Aktualizova\u0165 nep\u00E1rne riadky v tabu\u013Eke", row_all:"Aktualizova\u0165 v\u0161etky riadky v tabu\u013Eke", thead:"Hlavi\u010Dka tabu\u013Eky", tbody:"Telo tabu\u013Eky", tfoot:"P\u00E4ta tabu\u013Eky", scope:"Scope", rowgroup:"Skupina riadkov", colgroup:"Skupina st\u013Apcov", col_limit:"Bol presiahnut\u00FD maxim\u00E1lny po\u010Det st\u013Apcov {$cols}.", row_limit:"Bol presiahnut\u00FD maxim\u00E1lny po\u010Det riadkov {$rows}.", cell_limit:"Bol presiahnut\u00FD maxim\u00E1lny po\u010Det buniek {$cells}.", missing_scope:"Skuto\u010Dne chcete pokra\u010Dova\u0165 bez ur\u010Denia oblasti hlavi\u010Dky tejto tabu\u013Eky. Bez nej toti\u017E m\u00F4\u017Ee d\u00F4js\u0165 k ur\u010Dit\u00FDm probl\u00E9mom pri intepret\u00E1cii a zobrazovan\u00ED d\u00E1t v tabu\u013Eke.", caption:"Nadpis tabu\u013Eky", frame:"R\u00E1m\u010Dek", frame_none:"\u017Eiadne", frame_groups:"skupiny", frame_rows:"riadky", frame_cols:"st\u013Apce", frame_all:"v\u0161etky", rules:"Pravidl\u00E1", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"okraj" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/sl_dlg.js000066400000000000000000000041371226600447100236610ustar00rootroot00000000000000tinyMCE.addI18n('sl.table_dlg',{ general_tab:"Splo\u0161no", advanced_tab:"Napredno", general_props:"Splo\u0161ne lastnosti", advanced_props:"Napredne lastnosti", rowtype:"Vrstica v tabeli", title:"Vstavi/posodobi tabelo", width:"\u0160irina", height:"Vi\u0161ina", cols:"Stolpcev", rows:"Vrstic", cellspacing:"Razmik celic", cellpadding:"Podlaganje celic", border:"Obroba", align:"Poravnava", align_default:"Privzeto", align_left:"Levo", align_right:"Desno", align_middle:"Sredina", row_title:"Lastnosti vrstice", cell_title:"Lastnosti celice", cell_type:"Tip celice", valign:"Navpi\u010Dna poravnava", align_top:"Vrh", align_bottom:"Dno", bordercolor:"Barva obrobe", bgcolor:"Barva ozadja", merge_cells_title:"Spoji celice", id:"Oznaka", style:"Slog", langdir:"Smer pisave", langcode:"Koda jezika", mime:"Ciljni tip MIME", ltr:"Od leve proti desni", rtl:"Od desne proti levi", bgimage:"Slika ozadja", summary:"Povzetek", td:"Podatek", th:"Glava", cell_cell:"Posodobi trenutno celico", cell_row:"Posodobi vse celice vrstice", cell_all:"Posodobi vse celice tabele", row_row:"Posodobi trenutno vrstico", row_odd:"Posodobi lihe vrstice", row_even:"Posodobi sode vrstice", row_all:"Posodobi vse vrstice", thead:"Glava tabele", tbody:"Telo tabele", tfoot:"Noga tabele", scope:"Doseg", rowgroup:"Skup. vrst.", colgroup:"Skup. stolp.", col_limit:"Presegli ste dovoljeno \u0161tevilo stolpcev: {$cols}.", row_limit:"Presegli ste dovoljeno \u0161tevilo vrstic: {$rows}.", cell_limit:"Presegli ste dovoljeno \u0161tevilo celic: {$cells}.", missing_scope:"Ste prepri\u010Dani, da \u017Eelite nadaljevati brez dolo\u010Denega dosega? Brez dosega je razumevanje tabele lahko ote\u017Eeno ljudem s slab\u0161o zaznavo!", caption:"Opis tabele", frame:"Okvir", frame_none:"brez", frame_groups:"skupine", frame_rows:"vrstice", frame_cols:"stolpci", frame_all:"vse", rules:"Pravila", rules_void:"prazno", rules_above:"nad", rules_below:"pod", rules_hsides:"v-strani", rules_lhs:"l-strani", rules_rhs:"d-strani", rules_vsides:"n-strani", rules_box:"\u0161katla", rules_border:"obroba" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/sq_dlg.js000066400000000000000000000050611226600447100236630ustar00rootroot00000000000000tinyMCE.addI18n('sq.table_dlg',{ general_tab:"T\u00EB p\u00EBrgjithshme", advanced_tab:"T\u00EB avancuara", general_props:"Tipare t\u00EB p\u00EBrgjithshme", advanced_props:"Tipare t\u00EB avancuara", rowtype:"Rresht n\u00EB", title:"Fut/Edito tabel\u00EB", width:"Gjer\u00EBsia", height:"Gjat\u00EBsia", cols:"Kolona", rows:"Rreshta", cellspacing:"Hap\u00EBsira midis qelizave", cellpadding:"Hap\u00EBsira e br\u00EBndshme", border:"Korniza", align:"Drejtimi", align_default:"Paracaktuar", align_left:"Majtas", align_right:"Djathtas", align_middle:"Qend\u00EBr", row_title:"Tiparet e rreshtit", cell_title:"Tiparet e qeliz\u00EBs", cell_type:"Tipi i qeliz\u00EBs", valign:"Drejtimi vertikal", align_top:"Krye", align_bottom:"Fund", bordercolor:"Ngjyra e korniz\u00EBs", bgcolor:"Ngjyra e fush\u00EBs", merge_cells_title:"Bashko qelizat", id:"Id", style:"Stili", langdir:"Drejtimi i gjuh\u00EBs", langcode:"Kodi i gjuh\u00EBs", mime:"Tipi MIME i sh\u00EBnjestr\u00EBs", ltr:"Majtas-Djathtas", rtl:"Djathtas-Majtas", bgimage:"Foto e fush\u00EBs", summary:"P\u00EBrmbledhja", td:"T\u00EB dh\u00EBna", th:"Kok\u00EB", cell_cell:"Rifresko qeliz\u00EBn aktuale", cell_row:"Rifresko t\u00EB gjitha qelizat n\u00EB rresht", cell_all:"Rifresko t\u00EB gjitha qelizat", row_row:"Rifresko rreshtin aktual", row_odd:"Rifresko rreshtat tek", row_even:"Rifresko rreshtat \u00E7ift", row_all:"Rifresko t\u00EB gjitha rreshtat n\u00EB tabel\u00EB", thead:"Kok\u00EBn e Tabel\u00EBs", tbody:"Trupin e Tabel\u00EBs", tfoot:"K\u00EBmb\u00EBt e Tabel\u00EBs", scope:"Objektivi", rowgroup:"Grup Rreshtash", colgroup:"Grup Kolonash", col_limit:"Keni kaluar numrin maksimal t\u00EB kolonave: {$cols}.", row_limit:"Keni kaluar numrin maksimal t\u00EB rreshtave: {$rows}.", cell_limit:"Keni kaluar numrin maksimal t\u00EB qelizave {$cells}.", missing_scope:"Jeni t\u00EB sigurt q\u00EB nuk doni t\u00EB vendosni objektiv p\u00EBr k\u00EBt\u00EB qeliz\u00EB t\u00EB kok\u00EBs. Pa t\u00EB mund t\u00EB jet\u00EB e v\u00EBshtir\u00EB p\u00EBr disa p\u00EBrdorues me aft\u00EBsi t\u00EB kufizuara t\u00EB lexojn\u00EB p\u00EBrmbajtjen e tabel\u00EBs.", caption:"Krijo hap\u00EBsir\u00EB p\u00EBr titull", frame:"Korniza", frame_none:"asnj\u00EB", frame_groups:"grupe", frame_rows:"rreshta", frame_cols:"kolona", frame_all:"t\u00EB gjitha", rules:"Rregullat", rules_void:"zbrazur", rules_above:"sip\u00EBr", rules_below:"posht\u00EB", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"kuti", rules_border:"korniz\u00EB" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/sr_dlg.js000066400000000000000000000043111226600447100236610ustar00rootroot00000000000000tinyMCE.addI18n('sr.table_dlg',{ general_tab:"Osnovno", advanced_tab:"Napredno", general_props:"Osnovna svojstva", advanced_props:"Napredna svojstva", rowtype:"Row in table part", title:"Umetni/uredi tablicu", width:"\u0160irina", height:"Visina", cols:"Stupaca", rows:"Redaka", cellspacing:"Razmak \u0107elija", cellpadding:"Dopuna \u0107elije", border:"Obrub", align:"Poravnavanje", align_default:"Zadano", align_left:"Levo", align_right:"Desno", align_middle:"Sredina", row_title:"Svojstva retka", cell_title:"Svojstva \u0107elije", cell_type:"Tip \u0107elije", valign:"Okomito poravnavanje", align_top:"Vrh", align_bottom:"Dno", bordercolor:"Boja obruba", bgcolor:"Background color", merge_cells_title:"Spoji \u0107elije", id:"Id", style:"Stil", langdir:"Smjer jezika", langcode:"Kod jezika", mime:"MIME tip", ltr:"S leva na desno", rtl:"S desna na levo", bgimage:"Slika pozadine", summary:"Sa\u017Eetak", td:"Podatkovna", th:"Zaglavlje", cell_cell:"Primjeni na odabranu \u0107eliju", cell_row:"Primjeni na sve \u0107elije u retku", cell_all:"Primjeni na sve \u0107elije u tablici", row_row:"Primjeni na odabrani redak", row_odd:"Primjeni na neparne retke u tablici", row_even:"Primjeni na parne retke u tablici", row_all:"Primjeni na sve retke u tablici", thead:"Zaglavlje tablice", tbody:"Telo tablice", tfoot:"Podno\u017Eje tablice", scope:"Domet", rowgroup:"Grupa redaka", colgroup:"Grupa stupaca", col_limit:"Prema\u0161ili ste maksimalni broj stupaca ({$cols}).", row_limit:"Prema\u0161ili ste maksimalni broj redaka ({$rows}).", cell_limit:"Prema\u0161ili ste maksimalni broj \u0107elija ({$cells}).", missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.", caption:"Opis tablice", frame:"Frame", frame_none:"none", frame_groups:"groups", frame_rows:"rows", frame_cols:"cols", frame_all:"all", rules:"Rules", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/sv_dlg.js000066400000000000000000000042011226600447100236630ustar00rootroot00000000000000tinyMCE.addI18n('sv.table_dlg',{ general_tab:"Generellt", advanced_tab:"Avancerat", general_props:"Generella inst\u00E4llningar", advanced_props:"Avancerade inst\u00E4llningar", rowtype:"Radtyp", title:"Infoga/redigera ny tabell", width:"Bredd", height:"H\u00F6jd", cols:"Kolumner", rows:"Rader", cellspacing:"Cellspacing", cellpadding:"Cellpadding", border:"Ram", align:"Justering", align_default:"Ingen", align_left:"V\u00E4nster", align_right:"H\u00F6ger", align_middle:"Mitten", row_title:"Tabellradsinst\u00E4llningar", cell_title:"Tabellcellsinst\u00E4llningar", cell_type:"Celltyp", valign:"Vertikal justering", align_top:"Toppen", align_bottom:"Botten", bordercolor:"Ramf\u00E4rg", bgcolor:"Bakgrundsf\u00E4rg", merge_cells_title:"Sammanfoga celler", id:"Id", style:"Stil", langdir:"Skriftriktning", langcode:"Spr\u00E5kkod", ltr:"V\u00E4nster till h\u00F6ger", rtl:"H\u00F6ger till v\u00E4nster", bgimage:"Bakgrundsbild", summary:"Sammanfattning", td:"Data", th:"Huvud", cell_cell:"Uppdatera nuvarande cell", cell_row:"Uppdatera alla celler i raden", cell_all:"Uppdatera alla celler i tabellen", row_row:"Uppdatera nuvarande rad", row_odd:"Uppdatera udda rader i tabellen", row_even:"Uppdatera j\u00E4mna rader i tabellen", row_all:"Uppdatera alla rader i tabellen", thead:"tabellhuvud", tbody:"tabellkropp", tfoot:"tabellfot", scope:"Omfattning", rowgroup:"Radgrupp", colgroup:"Kolumngrupp", col_limit:"Du kan inte ange fler \u00E4n {$cols} kolumner.", row_limit:"Du kan inte ange fler \u00E4n {$rows} rader.", cell_limit:"Du kan inte skapa en tabell med fler \u00E4n {$cells} celler.", missing_scope:"\u00D6\u0084r du s\u00E4ker p\u00E5 att du vill forts\u00E4tta utan att ange en omfattning, denna underl\u00E4ttar f\u00F6r icke-grafiska webbl\u00E4sare.", caption:"\u00D6verskrift", frame:"Ram", frame_none:"none", frame_groups:"groups", frame_rows:"rows", frame_cols:"cols", frame_all:"all", rules:"Regler", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/ta_dlg.js000066400000000000000000000041311226600447100236410ustar00rootroot00000000000000tinyMCE.addI18n('ta.table_dlg',{ general_tab:"General", advanced_tab:"Advanced", general_props:"General properties", advanced_props:"Advanced properties", rowtype:"Row in table part", title:"Insert/Modify table", width:"Width", height:"Height", cols:"Cols", rows:"Rows", cellspacing:"Cellspacing", cellpadding:"Cellpadding", border:"Border", align:"Alignment", align_default:"Default", align_left:"Left", align_right:"Right", align_middle:"Center", row_title:"Table row properties", cell_title:"Table cell properties", cell_type:"Cell type", valign:"Vertical alignment", align_top:"Top", align_bottom:"Bottom", bordercolor:"Border color", bgcolor:"Background color", merge_cells_title:"Merge table cells", id:"Id", style:"Style", langdir:"Language direction", langcode:"Language code", mime:"Target MIME type", ltr:"Left to right", rtl:"Right to left", bgimage:"Background image", summary:"Summary", td:"Data", th:"Header", cell_cell:"Update current cell", cell_row:"Update all cells in row", cell_all:"Update all cells in table", row_row:"Update current row", row_odd:"Update odd rows in table", row_even:"Update even rows in table", row_all:"Update all rows in table", thead:"Table Head", tbody:"Table Body", tfoot:"Table Foot", scope:"Scope", rowgroup:"Row Group", colgroup:"Col Group", col_limit:"You've exceeded the maximum number of columns of {$cols}.", row_limit:"You've exceeded the maximum number of rows of {$rows}.", cell_limit:"You've exceeded the maximum number of cells of {$cells}.", missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.", caption:"Table caption", frame:"Frame", frame_none:"none", frame_groups:"groups", frame_rows:"rows", frame_cols:"cols", frame_all:"all", rules:"Rules", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/te_dlg.js000066400000000000000000000041311226600447100236450ustar00rootroot00000000000000tinyMCE.addI18n('te.table_dlg',{ general_tab:"General", advanced_tab:"Advanced", general_props:"General properties", advanced_props:"Advanced properties", rowtype:"Row in table part", title:"Insert/Modify table", width:"Width", height:"Height", cols:"Cols", rows:"Rows", cellspacing:"Cellspacing", cellpadding:"Cellpadding", border:"Border", align:"Alignment", align_default:"Default", align_left:"Left", align_right:"Right", align_middle:"Center", row_title:"Table row properties", cell_title:"Table cell properties", cell_type:"Cell type", valign:"Vertical alignment", align_top:"Top", align_bottom:"Bottom", bordercolor:"Border color", bgcolor:"Background color", merge_cells_title:"Merge table cells", id:"Id", style:"Style", langdir:"Language direction", langcode:"Language code", mime:"Target MIME type", ltr:"Left to right", rtl:"Right to left", bgimage:"Background image", summary:"Summary", td:"Data", th:"Header", cell_cell:"Update current cell", cell_row:"Update all cells in row", cell_all:"Update all cells in table", row_row:"Update current row", row_odd:"Update odd rows in table", row_even:"Update even rows in table", row_all:"Update all rows in table", thead:"Table Head", tbody:"Table Body", tfoot:"Table Foot", scope:"Scope", rowgroup:"Row Group", colgroup:"Col Group", col_limit:"You've exceeded the maximum number of columns of {$cols}.", row_limit:"You've exceeded the maximum number of rows of {$rows}.", cell_limit:"You've exceeded the maximum number of cells of {$cells}.", missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.", caption:"Table caption", frame:"Frame", frame_none:"none", frame_groups:"groups", frame_rows:"rows", frame_cols:"cols", frame_all:"all", rules:"Rules", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/th_dlg.js000066400000000000000000000063241226600447100236560ustar00rootroot00000000000000tinyMCE.addI18n('th.table_dlg',{ general_tab:"\u0E17\u0E31\u0E48\u0E27\u0E44\u0E1B", advanced_tab:"\u0E02\u0E31\u0E49\u0E19\u0E2A\u0E39\u0E07", general_props:"\u0E04\u0E38\u0E13\u0E2A\u0E21\u0E1A\u0E31\u0E15\u0E34\u0E17\u0E31\u0E48\u0E27\u0E44\u0E1B", advanced_props:"\u0E04\u0E38\u0E13\u0E2A\u0E21\u0E1A\u0E31\u0E15\u0E34\u0E02\u0E31\u0E49\u0E19\u0E2A\u0E39\u0E07", rowtype:"Row in table part", title:"\u0E40\u0E1E\u0E34\u0E48\u0E21/\u0E41\u0E01\u0E49\u0E44\u0E02 \u0E15\u0E32\u0E23\u0E32\u0E07", width:"\u0E01\u0E27\u0E49\u0E32\u0E07", height:"\u0E2A\u0E39\u0E07", cols:"\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E1E\u0E4C", rows:"\u0E41\u0E16\u0E27", cellspacing:"Cellspacing", cellpadding:"Cellpadding", border:"\u0E01\u0E23\u0E2D\u0E1A", align:"\u0E15\u0E33\u0E41\u0E2B\u0E19\u0E48\u0E07\u0E08\u0E31\u0E14\u0E27\u0E32\u0E07", align_default:"\u0E04\u0E48\u0E32\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19", align_left:"\u0E0B\u0E49\u0E32\u0E22", align_right:"\u0E02\u0E27\u0E32", align_middle:"\u0E01\u0E25\u0E32\u0E07", row_title:"\u0E04\u0E38\u0E13\u0E2A\u0E21\u0E1A\u0E31\u0E15\u0E34\u0E41\u0E16\u0E27\u0E43\u0E19\u0E15\u0E32\u0E23\u0E32\u0E07", cell_title:"\u0E04\u0E38\u0E13\u0E2A\u0E21\u0E1A\u0E31\u0E15\u0E34\u0E40\u0E0B\u0E25\u0E25\u0E4C\u0E43\u0E19\u0E32\u0E23\u0E32\u0E07", cell_type:"Cell type", valign:"Vertical alignment", align_top:"\u0E1A\u0E19", align_bottom:"\u0E25\u0E48\u0E32\u0E07", bordercolor:"\u0E2A\u0E35\u0E01\u0E23\u0E2D\u0E1A", bgcolor:"\u0E2A\u0E35\u0E1E\u0E37\u0E49\u0E19\u0E2B\u0E25\u0E31\u0E07", merge_cells_title:"Merge table cells", id:"Id", style:"\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A", langdir:"\u0E17\u0E34\u0E28\u0E17\u0E32\u0E07\u0E01\u0E32\u0E23\u0E2D\u0E48\u0E32\u0E19", langcode:"\u0E42\u0E04\u0E4A\u0E14\u0E20\u0E32\u0E29\u0E32", mime:"\u0E40\u0E1B\u0E49\u0E32\u0E2B\u0E21\u0E32\u0E22 MIME type", ltr:"\u0E0B\u0E49\u0E32\u0E22\u0E44\u0E1B\u0E02\u0E27\u0E32", rtl:"\u0E02\u0E27\u0E32\u0E44\u0E1B\u0E0B\u0E49\u0E32\u0E22", bgimage:"\u0E1E\u0E37\u0E49\u0E19\u0E2B\u0E25\u0E31\u0E07 image", summary:"Summary", td:"Data", th:"Header", cell_cell:"Update current cell", cell_row:"Update all cells in row", cell_all:"Update all cells in table", row_row:"Update current row", row_odd:"Update odd rows in table", row_even:"Update even rows in table", row_all:"Update all rows in table", thead:"Table Head", tbody:"Table Body", tfoot:"Table Foot", scope:"Scope", rowgroup:"Row Group", colgroup:"Col Group", col_limit:"You've exceeded the maximum number of columns of {$cols}.", row_limit:"You've exceeded the maximum number of rows of {$rows}.", cell_limit:"You've exceeded the maximum number of cells of {$cells}.", missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.", caption:"Table caption", frame:"Frame", frame_none:"none", frame_groups:"groups", frame_rows:"rows", frame_cols:"cols", frame_all:"all", rules:"Rules", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/tr_dlg.js000066400000000000000000000046321226600447100236700ustar00rootroot00000000000000tinyMCE.addI18n('tr.table_dlg',{ general_tab:"Genel", advanced_tab:"Geli\u015Fm", general_props:"Genel \u00F6zellikl", advanced_props:"Geli\u015Fmi\u015F \u00F6zel", rowtype:"Tablo par\u00E7as\u0131ndaki s", title:"Tablo ekle/d\u00FCzen", width:"Geni\u015Fl", height:"Y\u00FCksekl", cols:"Kolonlar", rows:"Sat\u0131rl", cellspacing:"H\u00FCcre arala", cellpadding:"H\u00FCcre dolgu", border:"Kenarl ", align:"Hizalama", align_default:"Varsay\u0131l", align_left:"Sola", align_right:"Sae", align_middle:"Ortala", row_title:"Tablo sat\u0131r \u00F6zellik", cell_title:"Tablo h\u00FCcre \u00F6zellik", cell_type:"H\u00FCcre ti", valign:"Dikey hizalama", align_top:"\u00DC", align_bottom:"Alt", bordercolor:"Kenarl\u0131k ren", bgcolor:"Arkaplan rengi", merge_cells_title:"Tablo h\u00FCcrelerini birlei", id:"Id", style:"Stil", langdir:"Dil y\u00F6neli", langcode:"Dil kodu", mime:"Hedef MIME tipi", ltr:"Soldan sa", rtl:"Sa\u011Fdan so", bgimage:"Arkaplan resmi", summary:"\u00D6z", td:"Veri", th:"Ba\u015F", cell_cell:"Se\u00E7ili h\u00FCcreyi g\u00FC", cell_row:"Sat\u0131rdaki t\u00FCm h\u00FCcreleri g", cell_all:"Tablodaki t\u00FCm h\u00FCcreleri g\u00FC", row_row:"Se\u00E7ili sat\u0131r\u0131 g", row_odd:"Tablodaki tek nolu sat\u0131rlar\u0131 g\u00FC", row_even:"Tablodaki \u00E7ift nolu sat\u0131rlar\u0131 ", row_all:"Tablodaki t\u00FCm sat\u0131rlar\u0131 g", thead:"Tablo Ba\u015Fl", tbody:"Table G\u00F6vde", tfoot:"Table Altl\u0131", scope:"Kapsam", rowgroup:"Sat\u0131r Gru", colgroup:"Kolon Grubu", col_limit:"Maksimum kolon say\u0131s\u0131 olan {$cols} de\u011Ferini a", row_limit:"Maksimum sat\u0131r say\u0131s\u0131 olan {$rows} de\u011Ferini", cell_limit:"Maksimum h\u00FCcre say\u0131s\u0131 olan {$cells} de\u011Ferini", missing_scope:"Bu tablo ba\u015Fl\u0131k h\u00FCcresi i\u00E7in bir kapsam belirlemeden devam etmek istedi\u011Finizden emin misiniz? Bu de\u011Fer olmadan, engelli kullan\u0131c\u0131lar\u0131n tabloda g\u00F6r\u00FCnt\u00FClenen i\u00E7eri\u011F", caption:"Tablo ba\u015Fl", frame:"\u00C7er", frame_none:"hi\u00E7bi", frame_groups:"gruplar", frame_rows:"sat\u0131rl", frame_cols:"kolonlar", frame_all:"t\u00FC", rules:"\u00C7izgil", rules_void:"yok", rules_above:"\u00FCst", rules_below:"alt\u0131n", rules_hsides:"solsa", rules_lhs:"soltaraf", rules_rhs:"sa\u011Ftar", rules_vsides:"\u00FCsta", rules_box:"kutu", rules_border:"kenarl " });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/tt_dlg.js000066400000000000000000000054711226600447100236740ustar00rootroot00000000000000tinyMCE.addI18n('tt.table_dlg',{ general_tab:"\u57FA\u672C", advanced_tab:"\u9032\u968E", general_props:"\u57FA\u672C \u5C6C\u6027", advanced_props:"\u9032\u968E\u5C6C\u6027", rowtype:"\u884C\u6240\u5728\u7684\u8868\u683C\u4F4D\u7F6E", title:"\u63D2\u5165/\u7DE8\u8F2F \u8868\u683C", width:"\u5BEC\u5EA6", height:"\u9AD8\u5EA6", cols:"\u5217\u6578", rows:"\u884C\u6578", cellspacing:"\u5132\u5B58\u683C\u9593\u8DDD", cellpadding:"\u5132\u5B58\u683C\u5167\u8DDD", border:"\u908A\u6846", align:"\u5C0D\u9F4A\u65B9\u5F0F", align_default:"\u9810\u8A2D", align_left:"\u5C45\u5DE6", align_right:"\u5C45\u53F3", align_middle:"\u7F6E\u4E2D", row_title:"\u884C \u5C6C\u6027", cell_title:"\u5132\u5B58\u683C \u5C6C\u6027", cell_type:"\u5132\u5B58\u683C \u985E\u5225", valign:"\u5782\u76F4\u5C0D\u9F4A\u65B9\u5F0F", align_top:"\u9802\u90E8", align_bottom:"\u5E95\u90E8", bordercolor:"\u908A\u6846\u9854\u8272", bgcolor:"\u80CC\u666F\u9854\u8272", merge_cells_title:"\u5408\u4F75\u5132\u5B58\u683C", id:"Id", style:"\u6A23\u5F0F", langdir:"\u8A9E\u8A00\u66F8\u5BEB\u65B9\u5411", langcode:"\u8A9E\u8A00\u7DE8\u78BC", mime:"\u76EE\u6A19 MIME \u985E\u578B", ltr:"\u5F9E\u5DE6\u5230\u53F3", rtl:"\u5F9E\u53F3\u5230\u5DE6", bgimage:"\u80CC\u666F\u5716\u7247", summary:"\u6458\u8981", td:"\u8868\u683C", th:"\u8868\u982D", cell_cell:"\u66F4\u65B0\u76EE\u524D\u7684\u5132\u5B58\u683C", cell_row:"\u66F4\u65B0\u7576\u524D\u884C\u7684\u5132\u5B58\u683C", cell_all:"\u66F4\u65B0\u5168\u90E8\u5132\u5B58\u683C", row_row:"\u66F4\u65B0\u6240\u5728\u884C", row_odd:"\u66F4\u65B0\u8868\u683C\u7684\u5947\u6578\u884C", row_even:"\u66F4\u65B0\u8868\u683C\u7684\u5076\u6578\u884C", row_all:"\u66F4\u65B0\u8868\u683C\u7684\u5168\u90E8\u884C", thead:"\u8868\u982D", tbody:"\u8868\u9AD4", tfoot:"\u8868\u8173", scope:"\u7BC4\u570D", rowgroup:"\u884C\u7D44", colgroup:"\u5217\u7D44", col_limit:"\u5DF2\u8D85\u904E\u9650\u5236\uFF0C\u6700\u591A\u7232 {$cols} \u5217\u3002", row_limit:"\u5DF2\u8D85\u904E\u9650\u5236\uFF0C\u6700\u591A\u7232 {$rows} \u884C\u3002", cell_limit:"\u5DF2\u8D85\u904E\u9650\u5236\uFF0C\u6700\u591A\u7232{$cells} \u5132\u5B58\u683C\u3002", missing_scope:"\u60A8\u78BA\u5B9A\u4E0D\u6307\u5B9A\u8868\u982D\u5132\u5B58\u683C\u7684\u7BC4\u570D\u55CE\uFF1F\u5982\u679C\u4E0D\u6307\u5B9A\uFF0C\u90E8\u5206\u4F7F\u7528\u8005\u5C07\u5F88\u96E3\u67E5\u770B\u8868\u683C\u5167\u5BB9", caption:"\u8868\u683C\u6A19\u984C", frame:"\u908A\u6846", frame_none:"\u7121", frame_groups:"\u7D44", frame_rows:"\u884C", frame_cols:"\u5217", frame_all:"\u5168\u90E8", rules:"\u5C3A\u898F", rules_void:"\u7A7A", rules_above:"\u4E4B\u4E0A", rules_below:"\u4E4B\u4E0B", rules_hsides:"\u6C34\u5E73\u5927\u5C0F", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"\u5782\u76F4\u5927\u5C0F", rules_box:"\u76D2", rules_border:"\u908A\u6846" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/tw_dlg.js000066400000000000000000000053531226600447100236760ustar00rootroot00000000000000tinyMCE.addI18n('tw.table_dlg',{ general_tab:"\u4E00\u822C", advanced_tab:"\u9032\u968E", general_props:"\u4E00\u822C\u5C6C\u6027", advanced_props:"\u9032\u968E\u5C6C\u6027", rowtype:"\u5217\u6240\u5728\u7684\u8868\u683C\u4F4D\u7F6E", title:"\u63D2\u5165/\u7DE8\u8F2F\u8868\u683C", width:"\u5BEC\u5EA6", height:"\u9AD8\u5EA6", cols:"\u6B04\u6578", rows:"\u5217\u6578", cellspacing:"\u5132\u5B58\u683C\u5167\u8DDD", cellpadding:"\u5132\u5B58\u683C\u9593\u8DDD", border:"\u908A\u6846", align:"\u5C0D\u9F4A\u65B9\u5F0F", align_default:"\u9810\u8A2D", align_left:"\u9760\u5DE6", align_right:"\u9760\u53F3", align_middle:"\u7F6E\u4E2D", row_title:"\u5217\u5C6C\u6027", cell_title:"\u5132\u5B58\u683C\u5C6C\u6027", cell_type:"\u5132\u5B58\u683C\u985E\u578B", valign:"\u6C34\u5E73\u5C0D\u9F4A\u65B9\u5F0F", align_top:"\u9760\u4E0A", align_bottom:"\u9760\u4E0B", bordercolor:"\u908A\u6846\u984F\u8272", bgcolor:"\u80CC\u666F\u984F\u8272", merge_cells_title:"\u5408\u4F75\u5132\u5B58\u683C", id:"Id", style:"\u6A23\u5F0F", langdir:"\u66F8\u5BEB\u65B9\u5411", langcode:"\u8A9E\u8A00\u7DE8\u78BC", mime:"\u76EE\u6A19MIME\u985E\u578B", ltr:"\u7531\u5DE6\u5230\u53F3", rtl:"\u7531\u53F3\u5230\u5DE6", bgimage:"\u80CC\u666F\u5716\u7247", summary:"\u6982\u8981", td:"\u5132\u5B58\u683C", th:"\u8868\u982D", cell_cell:"\u66F4\u65B0\u6240\u5728\u7684\u5132\u5B58\u683C", cell_row:"\u66F4\u65B0\u6240\u5728\u5217\u7684\u5168\u90E8\u5132\u5B58\u683C", cell_all:"\u66F4\u65B0\u8868\u683C\u5167\u7684\u5168\u90E8\u5132\u5B58\u683C", row_row:"\u66F4\u65B0\u6240\u5728\u5217", row_odd:"\u66F4\u65B0\u8868\u683C\u5167\u7684\u5947\u6578\u5217", row_even:"\u66F4\u65B0\u8868\u683C\u5167\u7684\u5076\u6578\u5217", row_all:"\u66F4\u65B0\u8868\u683C\u5167\u5168\u90E8\u5217", thead:"\u8868\u982D", tbody:"\u8868\u8EAB", tfoot:"\u8868\u5C3E", scope:"\u7BC4\u570D", rowgroup:"\u5217\u7FA4\u7D44", colgroup:"\u6B04\u7FA4\u7D44", col_limit:"\u5DF2\u8D85\u904E\u9650\u5236\uFF0C\u6700\u9AD8\u7684\u6B04\u6578\u70BA{$cols}\u6B04\u3002", row_limit:"\u5DF2\u8D85\u904E\u9650\u5236\uFF0C\u6700\u9AD8\u7684\u5217\u6578\u70BA{$rows}\u5217\u3002", cell_limit:"\u5DF2\u8D85\u904E\u9650\u5236\uFF0C\u6700\u9AD8\u7684\u5132\u5B58\u683C\u6578\u70BA{$cells}\u683C\u3002", missing_scope:"\u6A19\u984C\u5217\u907A\u5931\uFF01", caption:"\u8868\u683C\u8A3B\u89E3", frame:"\u908A\u6846", frame_none:"\u7121", frame_groups:"\u7FA4\u7D44", frame_rows:"\u5217", frame_cols:"\u6B04", frame_all:"\u5168\u90E8", rules:"\u7DDA\u689D", rules_void:"\u7A7A", rules_above:"\u4E0A", rules_below:"\u4E0B", rules_hsides:"\u6C34\u5E73\u908A", rules_lhs:"\u5DE6\u908A", rules_rhs:"\u53F3\u908A", rules_vsides:"\u5782\u76F4\u908A", rules_box:"\u65B9\u6846", rules_border:"\u5916\u6846" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/uk_dlg.js000066400000000000000000000161001226600447100236530ustar00rootroot00000000000000tinyMCE.addI18n('uk.table_dlg',{ general_tab:"\u0417\u0430\u0433\u0430\u043B\u044C\u043D\u0435", advanced_tab:"\u0414\u043E\u0434\u0430\u0442\u043A\u043E\u0432\u043E", general_props:"\u0417\u0430\u0433\u0430\u043B\u044C\u043D\u0456 \u0432\u043B\u0430\u0441\u0442\u0438\u0432\u043E\u0441\u0442\u0456", advanced_props:"\u0420\u043E\u0437\u0448\u0438\u0440\u0435\u043D\u0456 \u0432\u043B\u0430\u0441\u0442\u0438\u0432\u043E\u0441\u0442\u0456", rowtype:"Row in table part", title:"\u0414\u043E\u0434\u0430\u0432\u0430\u043D\u043D\u044F/\u0417\u043C\u0456\u043D\u0430 \u0442\u0430\u0431\u043B\u0438\u0446\u0456", width:"\u0428\u0438\u0440\u0438\u043D\u0430", height:"\u0412\u0438\u0441\u043E\u0442\u0430", cols:"\u0421\u0442\u043E\u043B\u0431\u0446\u044B", rows:"\u0421\u0442\u0440\u043E\u043A\u0438", cellspacing:"\u0412\u0456\u0434\u0441\u0442\u0430\u043D\u044C \u043C\u0456\u0436 \u043A\u043E\u043C\u0456\u0440\u043A\u0430\u043C\u0438", cellpadding:"\u0412\u0456\u0434\u0441\u0442\u0443\u043F\u0438 \u0443 \u043A\u043E\u043C\u0456\u0440\u043A\u0430\u0445", border:"\u0420\u0430\u043C\u043A\u0430", align:"\u0412\u0438\u0440\u0456\u0432\u043D\u044E\u0432\u0430\u043D\u043D\u044F", align_default:"\u0417\u0430 \u0437\u0430\u043C\u043E\u0432\u0447\u0430\u043D\u043D\u044F\u043C", align_left:"\u041F\u043E \u043B\u0456\u0432\u043E\u043C\u0443 \u043A\u0440\u0430\u044E", align_right:"\u041F\u043E \u043F\u0440\u0430\u0432\u043E\u043C\u0443 \u043A\u0440\u0430\u044E", align_middle:"\u041F\u043E \u0446\u0435\u043D\u0442\u0440\u0443", row_title:"\u0412\u043B\u0430\u0441\u0442\u0438\u0432\u043E\u0441\u0442\u0456 \u0440\u044F\u0434\u043A\u0443 \u0442\u0430\u0431\u043B\u0438\u0446\u0456", cell_title:"\u0412\u043B\u0430\u0441\u0442\u0438\u0432\u043E\u0441\u0442\u0456 \u043A\u043E\u043C\u0456\u0440\u043A\u0438 \u0442\u0430\u0431\u043B\u0438\u0446\u0456", cell_type:"\u0422\u0438\u043F \u043A\u043E\u043C\u0456\u0440\u043A\u0438", valign:"\u0412\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E\u0435 \u0432\u044B\u0440\u0430\u0432\u043D\u0438\u0432\u0430\u043D\u0438\u0435", align_top:"\u041F\u043E \u0432\u0435\u0440\u0445\u043D\u0435\u043C\u0443 \u043A\u0440\u0430\u044E", align_bottom:"\u041F\u043E \u043D\u0438\u0436\u043D\u044C\u043E\u043C\u0443 \u043A\u0440\u0430\u044E", bordercolor:"\u043A\u043E\u043B\u0456\u0440 \u0433\u0440\u0430\u043D\u0438\u0446\u044B", bgcolor:"\u043A\u043E\u043B\u0456\u0440 \u0444\u043E\u043D\u0443", merge_cells_title:"\u041E\u0431'\u0454\u0434\u043D\u0430\u0442\u0438 \u043A\u043E\u043C\u0456\u0440\u043A\u0438", id:"Id", style:"\u0421\u0442\u0438\u043B\u044C", langdir:"\u041D\u0430\u043F\u0440\u044F\u043C \u043C\u043E\u0432\u0438", langcode:"\u041A\u043E\u0434 \u043C\u043E\u0432\u0438", mime:"MIME-\u0442\u0438\u043F \u0446\u0456\u043B\u0456", ltr:"\u0417\u043B\u0456\u0432\u0430 \u043F\u0440\u0430\u0432\u043E\u0440\u0443\u0447", rtl:"\u0421\u043F\u0440\u0430\u0432\u0430 \u043B\u0456\u0432\u043E\u0440\u0443\u0447", bgimage:"\u0424\u043E\u043D\u043E\u0432\u0435 \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F", summary:"\u0417\u0430\u0433\u0430\u043B\u044C\u043D\u0435", td:"\u0414\u0430\u043D\u043D\u0456", th:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A", cell_cell:"\u041E\u043D\u043E\u0432\u0438\u0442\u0438 \u043F\u043E\u0442\u043E\u0447\u043D\u0443 \u043A\u043E\u043C\u0456\u0440\u043A\u0443", cell_row:"\u041E\u043D\u043E\u0432\u0438\u0442\u0438 \u0432\u0441\u0456 \u043A\u043E\u043C\u0456\u0440\u043A\u0438 \u0432 \u0440\u044F\u0434\u043A\u0443", cell_all:"\u041E\u043D\u043E\u0432\u0438\u0442\u0438 \u0432\u0441\u0456 \u043A\u043E\u043C\u0456\u0440\u043A\u0438 \u0432 \u0442\u0430\u0431\u043B\u0438\u0446\u0456", row_row:"\u041E\u043D\u043E\u0432\u0438\u0442\u0438 \u043F\u043E\u0442\u043E\u0447\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A", row_odd:"\u041E\u043D\u043E\u0432\u0438\u0442\u0438 \u043D\u0435\u043F\u0430\u0440\u043D\u0456 \u0440\u044F\u0434\u043A\u0438 \u0432 \u0442\u0430\u0431\u043B\u0438\u0446", row_even:"\u041E\u043D\u043E\u0432\u0438\u0442\u0438 \u043F\u0430\u0440\u043D\u0456 \u0440\u044F\u0434\u043A\u0438 \u0432 \u0442\u0430\u0431\u043B\u0438\u0446\u0456", row_all:"\u043D\u043E\u0432\u0438\u0442\u0438 \u0432\u0441\u0456 \u0440\u044F\u0434\u043A\u0438 \u0432 \u0442\u0430\u0431\u043B\u0438\u0446\u0456", thead:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A \u0442\u0430\u0431\u043B\u0438\u0446\u0456", tbody:"\u0422\u0456\u043B\u043E \u0442\u0430\u0431\u043B\u0438\u0446\u0456", tfoot:"\u041D\u0438\u0436\u043D\u044F \u0447\u0430\u0441\u0442\u0441\u0438\u043D\u0430", scope:"Scope", rowgroup:"\u0413\u0440\u0443\u043F\u0430 \u043A\u043E\u043C\u0456\u0440\u043E\u043A", colgroup:"\u0413\u0440\u0443\u043F\u0430 \u0441\u0442\u043E\u0432\u0431\u0446\u0456\u0432", col_limit:"\u0412\u0438 \u043F\u0435\u0440\u0435\u0432\u0438\u0449\u0438\u043B\u0438 \u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0443 \u043A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C \u0441\u0442\u043E\u0432\u0431\u0446\u0456\u0432: {$cols}.", row_limit:"\u0412\u0438 \u043F\u0435\u0440\u0435\u0432\u0438\u0449\u0438\u043B\u0438 \u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0443 \u043A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C \u0440\u044F\u0434\u043A\u0456\u0432: {$rows}.", cell_limit:"\u0412\u0438 \u043F\u0435\u0440\u0435\u0432\u0438\u0449\u0438\u043B\u0438 \u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0443 \u043A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C \u043A\u043E\u043C\u0456\u0440\u043E\u043A: {$cells}.", missing_scope:"\u0412\u0438 \u0432\u043F\u0435\u0432\u043D\u0435\u043D\u0456, \u0449\u043E \u0431\u0430\u0436\u0430\u0454\u0442\u0435 \u043F\u0440\u043E\u0434\u043E\u0432\u0436\u0438\u0442\u0438, \u043D\u0435 \u0432\u043A\u0430\u0437\u0430\u0432\u0448\u0438 \u043C\u0435\u0436\u0456 \u0434\u043B\u044F \u0446\u0456\u0454\u0457 \u043A\u043E\u043C\u0456\u0440\u043A\u0438 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0443. \u0411\u0435\u0437 \u0446\u044C\u043E\u0433\u043E \u0434\u0435\u044F\u043A\u0438\u043C \u043A\u043E\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0447\u0430\u043C \u0431\u0443\u0434\u0435 \u0432\u0430\u0436\u043A\u043E \u0437\u0440\u043E\u0437\u0443\u043C\u0456\u0442\u0438 \u0437\u043C\u0456\u0441\u0442 \u0442\u0430\u0431\u043B\u0438\u0446\u0456.", caption:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A \u0442\u0430\u0431\u043B\u0438\u0446\u0456", frame:"\u0424\u0440\u0435\u0439\u043C", frame_none:"\u043D\u0456\u044F\u043A\u0438\u0439", frame_groups:"\u0433\u0440\u0443\u043F\u0438", frame_rows:"\u0440\u044F\u0434\u043A\u0438", frame_cols:"\u0441\u0442\u043E\u0432\u0431\u0446\u0456", frame_all:"\u0432\u0441\u0456", rules:"\u041F\u0440\u0430\u0432\u0438\u043B\u0430", rules_void:"\u043F\u0443\u0441\u0442\u043E", rules_above:"\u0437\u0432\u0435\u0440\u0445\u0443", rules_below:"\u0437\u043D\u0438\u0437\u0443", rules_hsides:"h-\u0441\u0442\u043E\u0440\u043E\u043D\u0438", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"v-\u0441\u0442\u043E\u0440\u043E\u043D\u0438", rules_box:"\u0431\u043E\u043A\u0441", rules_border:"\u0440\u0430\u043C\u043A\u0430" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/ur_dlg.js000066400000000000000000000041311226600447100236630ustar00rootroot00000000000000tinyMCE.addI18n('ur.table_dlg',{ general_tab:"General", advanced_tab:"Advanced", general_props:"General properties", advanced_props:"Advanced properties", rowtype:"Row in table part", title:"Insert/Modify table", width:"Width", height:"Height", cols:"Cols", rows:"Rows", cellspacing:"Cellspacing", cellpadding:"Cellpadding", border:"Border", align:"Alignment", align_default:"Default", align_left:"Left", align_right:"Right", align_middle:"Center", row_title:"Table row properties", cell_title:"Table cell properties", cell_type:"Cell type", valign:"Vertical alignment", align_top:"Top", align_bottom:"Bottom", bordercolor:"Border color", bgcolor:"Background color", merge_cells_title:"Merge table cells", id:"Id", style:"Style", langdir:"Language direction", langcode:"Language code", mime:"Target MIME type", ltr:"Left to right", rtl:"Right to left", bgimage:"Background image", summary:"Summary", td:"Data", th:"Header", cell_cell:"Update current cell", cell_row:"Update all cells in row", cell_all:"Update all cells in table", row_row:"Update current row", row_odd:"Update odd rows in table", row_even:"Update even rows in table", row_all:"Update all rows in table", thead:"Table Head", tbody:"Table Body", tfoot:"Table Foot", scope:"Scope", rowgroup:"Row Group", colgroup:"Col Group", col_limit:"You've exceeded the maximum number of columns of {$cols}.", row_limit:"You've exceeded the maximum number of rows of {$rows}.", cell_limit:"You've exceeded the maximum number of cells of {$cells}.", missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.", caption:"Table caption", frame:"Frame", frame_none:"none", frame_groups:"groups", frame_rows:"rows", frame_cols:"cols", frame_all:"all", rules:"Rules", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/vi_dlg.js000066400000000000000000000041311226600447100236530ustar00rootroot00000000000000tinyMCE.addI18n('vi.table_dlg',{ general_tab:"General", advanced_tab:"Advanced", general_props:"General properties", advanced_props:"Advanced properties", rowtype:"Row in table part", title:"Insert/Modify table", width:"Width", height:"Height", cols:"Cols", rows:"Rows", cellspacing:"Cellspacing", cellpadding:"Cellpadding", border:"Border", align:"Alignment", align_default:"Default", align_left:"Left", align_right:"Right", align_middle:"Center", row_title:"Table row properties", cell_title:"Table cell properties", cell_type:"Cell type", valign:"Vertical alignment", align_top:"Top", align_bottom:"Bottom", bordercolor:"Border color", bgcolor:"Background color", merge_cells_title:"Merge table cells", id:"Id", style:"Style", langdir:"Language direction", langcode:"Language code", mime:"Target MIME type", ltr:"Left to right", rtl:"Right to left", bgimage:"Background image", summary:"Summary", td:"Data", th:"Header", cell_cell:"Update current cell", cell_row:"Update all cells in row", cell_all:"Update all cells in table", row_row:"Update current row", row_odd:"Update odd rows in table", row_even:"Update even rows in table", row_all:"Update all rows in table", thead:"Table Head", tbody:"Table Body", tfoot:"Table Foot", scope:"Scope", rowgroup:"Row Group", colgroup:"Col Group", col_limit:"You've exceeded the maximum number of columns of {$cols}.", row_limit:"You've exceeded the maximum number of rows of {$rows}.", cell_limit:"You've exceeded the maximum number of cells of {$cells}.", missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.", caption:"Table caption", frame:"Frame", frame_none:"none", frame_groups:"groups", frame_rows:"rows", frame_cols:"cols", frame_all:"all", rules:"Rules", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/zh_dlg.js000066400000000000000000000053531226600447100236650ustar00rootroot00000000000000tinyMCE.addI18n('zh.table_dlg',{ general_tab:"\u4E00\u822C", advanced_tab:"\u9AD8\u7D1A", general_props:"\u4E00\u822C\u5C6C\u6027", advanced_props:"\u9AD8\u7D1A\u5C6C\u6027", rowtype:"\u884C\u6240\u5728\u7684\u8868\u683C\u4F4D\u7F6E", title:"\u63D2\u5165/\u7DE8\u8F2F\u8868\u683C", width:"\u5BEC\u5EA6", height:"\u9AD8\u5EA6", cols:"\u5217\u6578", rows:"\u884C\u6578", cellspacing:"\u55AE\u5143\u683C\u908A\u8DDD", cellpadding:"\u55AE\u5143\u683C\u9593\u8DDD", border:"\u908A\u6846", align:"\u5C0D\u9F4A\u65B9\u5F0F", align_default:"\u9810\u8A2D", align_left:"\u9760\u5DE6", align_right:"\u9760\u53F3", align_middle:"\u7F6E\u4E2D", row_title:"\u884C\u5C6C\u6027", cell_title:"\u55AE\u5143\u683C\u5C6C\u6027", cell_type:"\u55AE\u5143\u683C\u985E\u578B", valign:"\u6C34\u5E73\u5C0D\u9F4A\u65B9\u5F0F", align_top:"\u9760\u4E0A", align_bottom:"\u9760\u4E0B", bordercolor:"\u908A\u6846\u984F\u8272", bgcolor:"\u80CC\u666F\u984F\u8272", merge_cells_title:"\u5408\u4F75\u55AE\u5143\u683C", id:"Id", style:"\u6A23\u5F0F", langdir:"\u66F8\u5BEB\u65B9\u5411", langcode:"\u8A9E\u8A00\u7DE8\u78BC", mime:"\u76EE\u6A19MIME\u985E\u578B", ltr:"\u7531\u5DE6\u5230\u53F3", rtl:"\u7531\u53F3\u5230\u5DE6", bgimage:"\u80CC\u666F\u5716\u7247", summary:"\u6982\u8981", td:"\u55AE\u5143\u683C", th:"\u8868\u982D", cell_cell:"\u66F4\u65B0\u6240\u5728\u7684\u55AE\u5143\u683C", cell_row:"\u66F4\u65B0\u6240\u5728\u884C\u7684\u5168\u90E8\u55AE\u5143\u683C", cell_all:"\u66F4\u65B0\u8868\u683C\u5167\u7684\u5168\u90E8\u55AE\u5143\u683C", row_row:"\u66F4\u65B0\u6240\u5728\u884C", row_odd:"\u66F4\u65B0\u8868\u683C\u5167\u7684\u5947\u6578\u884C", row_even:"\u66F4\u65B0\u8868\u683C\u5167\u7684\u5076\u6578\u884C", row_all:"\u66F4\u65B0\u8868\u683C\u5167\u5168\u90E8\u884C", thead:"\u8868\u982D", tbody:"\u8868\u8EAB", tfoot:"\u8868\u5C3E", scope:"\u7BC4\u570D", rowgroup:"\u884C\u7FA4\u7D44", colgroup:"\u5217\u7FA4\u7D44", col_limit:"\u5DF2\u8D85\u904E\u9650\u5236\uFF0C\u6700\u9AD8\u7684\u5217\u6578\u70BA{$cols}\u5217\u3002", row_limit:"\u5DF2\u8D85\u904E\u9650\u5236\uFF0C\u6700\u9AD8\u7684\u884C\u6578\u70BA{$rows}\u884C\u3002", cell_limit:"\u5DF2\u8D85\u904E\u9650\u5236\uFF0C\u6700\u9AD8\u7684\u55AE\u5143\u683C\u6578\u70BA{$cells}\u683C\u3002", missing_scope:"\u6A19\u984C\u6B04\u907A\u5931\uFF01", caption:"\u8868\u683C\u6279\u6CE8", frame:"\u908A\u6846", frame_none:"\u7121", frame_groups:"\u7FA4\u7D44", frame_rows:"\u884C", frame_cols:"\u5217", frame_all:"\u5168\u90E8", rules:"\u7DDA\u689D", rules_void:"\u7A7A", rules_above:"\u4E0A", rules_below:"\u4E0B", rules_hsides:"\u6C34\u5E73\u908A", rules_lhs:"\u5DE6\u908A", rules_rhs:"\u53F3\u908A", rules_vsides:"\u5782\u76F4\u908A", rules_box:"\u65B9\u6846", rules_border:"\u5916\u6846" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/langs/zu_dlg.js000066400000000000000000000053671226600447100237070ustar00rootroot00000000000000tinyMCE.addI18n('zu.table_dlg',{ general_tab:"\u4E00\u822C", advanced_tab:"\u9AD8\u7EA7", general_props:"\u4E00\u822C\u5C5E\u6027", advanced_props:"\u9AD8\u7EA7\u5C5E\u6027", rowtype:"\u884C\u6240\u5728\u7684\u8868\u683C\u4F4D\u7F6E", title:"\u63D2\u5165/\u7F16\u8F91\u8868\u683C", width:"\u5BBD\u5EA6", height:"\u9AD8\u5EA6", cols:"\u5217\u6570", rows:"\u884C\u6570", cellspacing:"\u5355\u5143\u683C\u95F4\u8DDD", cellpadding:"\u5355\u5143\u683C\u7559\u767D", border:"\u8FB9\u6846", align:"\u5BF9\u9F50\u65B9\u5F0F", align_default:"\u9884\u8BBE", align_left:"\u9760\u5DE6", align_right:"\u9760\u53F3", align_middle:"\u5C45\u4E2D", row_title:"\u884C\u5C5E\u6027", cell_title:"\u5355\u5143\u683C\u5C5E\u6027", cell_type:"\u5355\u5143\u683C\u522B", valign:"\u6C34\u51C6\u5BF9\u9F50\u65B9\u5F0F", align_top:"\u4E0A\u65B9", align_bottom:"\u4E0B\u65B9", bordercolor:"\u8FB9\u6846\u989C\u8272", bgcolor:"\u80CC\u666F\u989C\u8272", merge_cells_title:"\u5408\u5E76\u5355\u5143\u683C", id:"Id", style:"\u6837\u5F0F", langdir:"\u8BED\u8A00\u4E66\u5199\u65B9\u5411", langcode:"\u8BED\u8A00\u7F16\u7801", mime:"\u76EE\u6807MIME\u7C7B\u578B", ltr:"\u7531\u5DE6\u5230\u53F3", rtl:"\u7531\u53F3\u5230\u5DE6", bgimage:"\u80CC\u666F\u56FE\u7247", summary:"\u6982\u8981", td:"\u6570\u636E", th:"\u8868\u5934", cell_cell:"\u66F4\u65B0\u6240\u7684\u5355\u5143\u683C", cell_row:"\u66F4\u65B0\u6240\u5728\u884C\u7684\u5168\u90E8\u5355\u5143\u683C", cell_all:"\u66F4\u65B0\u8868\u683C\u5185\u7684\u5168\u90E8\u5355\u5143\u683C", row_row:"\u66F4\u65B0\u6240\u5728\u884C", row_odd:"\u66F4\u65B0\u8868\u683C\u5185\u7684\u5947\u6570\u884C", row_even:"\u66F4\u65B0\u8868\u683C\u5185\u7684\u5076\u6570\u884C", row_all:"\u66F4\u65B0\u8868\u683C\u5185\u5168\u90E8\u884C", thead:"\u8868\u5934", tbody:"\u8868\u8EAB", tfoot:"\u8868\u5C3E", scope:"\u8303\u56F4", rowgroup:"\u884C\u7FA4\u7EC4", colgroup:"\u5217\u7FA4\u7EC4", col_limit:"\u5DF2\u8D85\u8FC7\u53EF\u7528\u6570\uFF0C\u6700\u9AD8\u7684\u5217\u6570\u4E3A{$cols}\u5217\u3002", row_limit:"\u5DF2\u8D85\u8FC7\u53EF\u7528\u6570\uFF0C\u6700\u9AD8\u7684\u884C\u6570\u4E3A{$rows}\u884C\u3002", cell_limit:"\u5DF2\u8D85\u8FC7\u53EF\u7528\u6570\uFF0C\u6700\u9AD8\u7684\u5355\u5143\u683C\u6570\u4E3A{$cells}\u683C\u3002", missing_scope:"\u6807\u9898\u884C\u7F3A\u5931\uFF01", caption:"\u8868\u683C\u6807\u9898", frame:"\u8FB9\u6846", frame_none:"\u65E0", frame_groups:"\u7FA4\u7EC4", frame_rows:"\u884C", frame_cols:"\u5217", frame_all:"\u5168\u90E8", rules:"\u7EBF\u6761", rules_void:"\u7A7A", rules_above:"\u4E0A", rules_below:"\u4E0B", rules_hsides:"\u6C34\u51C6\u8FB9", rules_lhs:"\u5DE6\u8FB9", rules_rhs:"\u53F3\u8FB9", rules_vsides:"\u5782\u76F4\u8FB9", rules_box:"\u76D2\u578B", rules_border:"\u5916\u6846" });glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/merge_cells.htm000066400000000000000000000027441226600447100237500ustar00rootroot00000000000000 {#table_dlg.merge_cells_title}
    {#table_dlg.merge_cells_title}
    :
    :
    glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/row.htm000066400000000000000000000141671226600447100223000ustar00rootroot00000000000000 {#table_dlg.row_title}
    {#table_dlg.general_props}
    {#table_dlg.advanced_props}
     
     
    glpi-0.84.3+dfsg.1/lib/tiny_mce/plugins/table/table.htm000066400000000000000000000215131226600447100225510ustar00rootroot00000000000000 {#table_dlg.title}
    {#table_dlg.general_props}
    {#table_dlg.advanced_props}
     
     
     
    glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/000077500000000000000000000000001226600447100174635ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/000077500000000000000000000000001226600447100212305ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/about.htm000066400000000000000000000052151226600447100230570ustar00rootroot00000000000000 {#advanced_dlg.about_title}

    {#advanced_dlg.about_title}

    Version: ()

    TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.

    Copyright © 2003-2008, Moxiecode Systems AB, All rights reserved.

    For more information about this software visit the TinyMCE website.

    Got Moxie?

    {#advanced_dlg.about_loaded}

     

    glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/anchor.htm000066400000000000000000000022171226600447100232160ustar00rootroot00000000000000 {#advanced_dlg.anchor_title}
    {#advanced_dlg.anchor_title}
    glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/charmap.htm000066400000000000000000000043131226600447100233560ustar00rootroot00000000000000 {#advanced_dlg.charmap_title}
     
     
     
     
     
    {#advanced_dlg.charmap_usage}
    glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/color_picker.htm000066400000000000000000000063651226600447100244270ustar00rootroot00000000000000 {#advanced_dlg.colorpicker_title}
    {#advanced_dlg.colorpicker_picker_title}

    {#advanced_dlg.colorpicker_palette_title}

    {#advanced_dlg.colorpicker_named_title}

    {#advanced_dlg.colorpicker_name}
    glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/editor_template.js000066400000000000000000000641561226600447100247630ustar00rootroot00000000000000(function(h){var i=h.DOM,g=h.dom.Event,c=h.extend,f=h.each,a=h.util.Cookie,e,d=h.explode;function b(p,m){var k,l,o=p.dom,j="",n,r;previewStyles=p.settings.preview_styles;if(previewStyles===false){return""}if(!previewStyles){previewStyles="font-family font-size font-weight text-decoration text-transform color background-color"}function q(s){return s.replace(/%(\w+)/g,"")}k=m.block||m.inline||"span";l=o.create(k);f(m.styles,function(t,s){t=q(t);if(t){o.setStyle(l,s,t)}});f(m.attributes,function(t,s){t=q(t);if(t){o.setAttrib(l,s,t)}});f(m.classes,function(s){s=q(s);if(!o.hasClass(l,s)){o.addClass(l,s)}});o.setStyles(l,{position:"absolute",left:-65535});p.getBody().appendChild(l);n=o.getStyle(p.getBody(),"fontSize",true);n=/px$/.test(n)?parseInt(n,10):0;f(previewStyles.split(" "),function(s){var t=o.getStyle(l,s,true);if(s=="background-color"&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)){t=o.getStyle(p.getBody(),s,true);if(o.toHex(t).toLowerCase()=="#ffffff"){return}}if(s=="font-size"){if(/em|%$/.test(t)){if(n===0){return}t=parseFloat(t,10)/(/%$/.test(t)?100:1);t=(t*n)+"px"}}j+=s+":"+t+";"});o.remove(l);return j}h.ThemeManager.requireLangPack("advanced");h.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["help_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],newdocument:["newdocument_desc","mceNewDocument"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(k,l){var m=this,n,j,p;m.editor=k;m.url=l;m.onResolveName=new h.util.Dispatcher(this);n=k.settings;k.forcedHighContrastMode=k.settings.detect_highcontrast&&m._isHighContrast();k.settings.skin=k.forcedHighContrastMode?"highcontrast":k.settings.skin;if(!n.theme_advanced_buttons1){n=c({theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap"},n)}m.settings=n=c({theme_advanced_path:true,theme_advanced_toolbar_location:"top",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"left",theme_advanced_statusbar_location:"bottom",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",theme_advanced_font_selector:"span",theme_advanced_show_current_color:0,readonly:k.settings.readonly},n);if(!n.font_size_style_values){n.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(h.is(n.theme_advanced_font_sizes,"string")){n.font_size_style_values=h.explode(n.font_size_style_values);n.font_size_classes=h.explode(n.font_size_classes||"");p={};k.settings.theme_advanced_font_sizes=n.theme_advanced_font_sizes;f(k.getParam("theme_advanced_font_sizes","","hash"),function(r,q){var o;if(q==r&&r>=1&&r<=7){q=r+" ("+m.sizes[r-1]+"pt)";o=n.font_size_classes[r-1];r=n.font_size_style_values[r-1]||(m.sizes[r-1]+"pt")}if(/^\s*\./.test(r)){o=r.replace(/\./g,"")}p[q]=o?{"class":o}:{fontSize:r}});n.theme_advanced_font_sizes=p}if((j=n.theme_advanced_path_location)&&j!="none"){n.theme_advanced_statusbar_location=n.theme_advanced_path_location}if(n.theme_advanced_statusbar_location=="none"){n.theme_advanced_statusbar_location=0}if(k.settings.content_css!==false){k.contentCSS.push(k.baseURI.toAbsolute(l+"/skins/"+k.settings.skin+"/content.css"))}k.onInit.add(function(){if(!k.settings.readonly){k.onNodeChange.add(m._nodeChanged,m);k.onKeyUp.add(m._updateUndoStatus,m);k.onMouseUp.add(m._updateUndoStatus,m);k.dom.bind(k.dom.getRoot(),"dragend",function(){m._updateUndoStatus(k)})}});k.onSetProgressState.add(function(r,o,s){var t,u=r.id,q;if(o){m.progressTimer=setTimeout(function(){t=r.getContainer();t=t.insertBefore(i.create("DIV",{style:"position:relative"}),t.firstChild);q=i.get(r.id+"_tbl");i.add(t,"div",{id:u+"_blocker","class":"mceBlocker",style:{width:q.clientWidth+2,height:q.clientHeight+2}});i.add(t,"div",{id:u+"_progress","class":"mceProgress",style:{left:q.clientWidth/2,top:q.clientHeight/2}})},s||0)}else{i.remove(u+"_blocker");i.remove(u+"_progress");clearTimeout(m.progressTimer)}});i.loadCSS(n.editor_css?k.documentBaseURI.toAbsolute(n.editor_css):l+"/skins/"+k.settings.skin+"/ui.css");if(n.skin_variant){i.loadCSS(l+"/skins/"+k.settings.skin+"/ui_"+n.skin_variant+".css")}},_isHighContrast:function(){var j,k=i.add(i.getRoot(),"div",{style:"background-color: rgb(171,239,86);"});j=(i.getStyle(k,"background-color",true)+"").toLowerCase().replace(/ /g,"");i.remove(k);return j!="rgb(171,239,86)"&&j!="#abef56"},createControl:function(m,j){var k,l;if(l=j.createControl(m)){return l}switch(m){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((k=this.controls[m])){return j.createButton(m,{title:"advanced."+k[0],cmd:k[1],ui:k[2],value:k[3]})}},execCommand:function(l,k,m){var j=this["_"+l];if(j){j.call(this,k,m);return true}return false},_importClasses:function(l){var j=this.editor,k=j.controlManager.get("styleselect");if(k.getLength()==0){f(j.dom.getClasses(),function(q,m){var p="style_"+m,n;n={inline:"span",attributes:{"class":q["class"]},selector:"*"};j.formatter.register(p,n);k.add(q["class"],p,{style:function(){return b(j,n)}})})}},_createStyleSelect:function(o){var l=this,j=l.editor,k=j.controlManager,m;m=k.createListBox("styleselect",{title:"advanced.style_select",onselect:function(q){var r,n=[],p;f(m.items,function(s){n.push(s.value)});j.focus();j.undoManager.add();r=j.formatter.matchAll(n);h.each(r,function(s){if(!q||s==q){if(s){j.formatter.remove(s)}p=true}});if(!p){j.formatter.apply(q)}j.undoManager.add();j.nodeChanged();return false}});j.onPreInit.add(function(){var p=0,n=j.getParam("style_formats");if(n){f(n,function(q){var r,s=0;f(q,function(){s++});if(s>1){r=q.name=q.name||"style_"+(p++);j.formatter.register(r,q);m.add(q.title,r,{style:function(){return b(j,q)}})}else{m.add(q.title)}})}else{f(j.getParam("theme_advanced_styles","","hash"),function(t,s){var r,q;if(t){r="style_"+(p++);q={inline:"span",classes:t,selector:"*"};j.formatter.register(r,q);m.add(l.editor.translate(s),r,{style:function(){return b(j,q)}})}})}});if(m.getLength()==0){m.onPostRender.add(function(p,q){if(!m.NativeListBox){g.add(q.id+"_text","focus",l._importClasses,l);g.add(q.id+"_text","mousedown",l._importClasses,l);g.add(q.id+"_open","focus",l._importClasses,l);g.add(q.id+"_open","mousedown",l._importClasses,l)}else{g.add(q.id,"focus",l._importClasses,l)}})}return m},_createFontSelect:function(){var l,k=this,j=k.editor;l=j.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(m){var n=l.items[l.selectedIndex];if(!m&&n){j.execCommand("FontName",false,n.value);return}j.execCommand("FontName",false,m);l.select(function(o){return m==o});if(n&&n.value==m){l.select(null)}return false}});if(l){f(j.getParam("theme_advanced_fonts",k.settings.theme_advanced_fonts,"hash"),function(n,m){l.add(j.translate(m),n,{style:n.indexOf("dings")==-1?"font-family:"+n:""})})}return l},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(o){var p=n.items[n.selectedIndex];if(!o&&p){p=p.value;if(p["class"]){k.formatter.toggle("fontsize_class",{value:p["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,p.fontSize)}return}if(o["class"]){k.focus();k.undoManager.add();k.formatter.toggle("fontsize_class",{value:o["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,o.fontSize)}n.select(function(q){return o==q});if(p&&(p.value.fontSize==o.fontSize||p.value["class"]&&p.value["class"]==o["class"])){n.select(null)}return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(p,o){var q=p.fontSize;if(q>=1&&q<=7){q=m.sizes[parseInt(q)-1]+"pt"}n.add(o,p,{style:"font-size:"+q,"class":"mceFontSize"+(l++)+(" "+(p["class"]||""))})})}return n},_createBlockFormats:function(){var l,j={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},k=this;l=k.editor.controlManager.createListBox("formatselect",{title:"advanced.block",onselect:function(m){k.editor.execCommand("FormatBlock",false,m);return false}});if(l){f(k.editor.getParam("theme_advanced_blockformats",k.settings.theme_advanced_blockformats,"hash"),function(n,m){l.add(k.editor.translate(m!=n?m:j[n]),n,{"class":"mce_formatPreview mce_"+n,style:function(){return b(k.editor,{block:n})}})})}return l},_createForeColorMenu:function(){var n,k=this,l=k.settings,m={},j;if(l.theme_advanced_more_colors){m.more_colors_func=function(){k._mceColorPicker(0,{color:n.value,func:function(o){n.setColor(o)}})}}if(j=l.theme_advanced_text_colors){m.colors=j}if(l.theme_advanced_default_foreground_color){m.default_color=l.theme_advanced_default_foreground_color}m.title="advanced.forecolor_desc";m.cmd="ForeColor";m.scope=this;n=k.editor.controlManager.createColorSplitButton("forecolor",m);return n},_createBackColorMenu:function(){var n,k=this,l=k.settings,m={},j;if(l.theme_advanced_more_colors){m.more_colors_func=function(){k._mceColorPicker(0,{color:n.value,func:function(o){n.setColor(o)}})}}if(j=l.theme_advanced_background_colors){m.colors=j}if(l.theme_advanced_default_background_color){m.default_color=l.theme_advanced_default_background_color}m.title="advanced.backcolor_desc";m.cmd="HiliteColor";m.scope=this;n=k.editor.controlManager.createColorSplitButton("backcolor",m);return n},renderUI:function(l){var q,m,r,w=this,u=w.editor,x=w.settings,v,k,j;if(u.settings){u.settings.aria_label=x.aria_label+u.getLang("advanced.help_shortcut")}q=k=i.create("span",{role:"application","aria-labelledby":u.id+"_voice",id:u.id+"_parent","class":"mceEditor "+u.settings.skin+"Skin"+(x.skin_variant?" "+u.settings.skin+"Skin"+w._ufirst(x.skin_variant):"")+(u.settings.directionality=="rtl"?" mceRtl":"")});i.add(q,"span",{"class":"mceVoiceLabel",style:"display:none;",id:u.id+"_voice"},x.aria_label);if(!i.boxModel){q=i.add(q,"div",{"class":"mceOldBoxModel"})}q=v=i.add(q,"table",{role:"presentation",id:u.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});q=r=i.add(q,"tbody");switch((x.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":m=w._rowLayout(x,r,l);break;case"customlayout":m=u.execCallback("theme_advanced_custom_layout",x,r,l,k);break;default:m=w._simpleLayout(x,r,l,k)}q=l.targetNode;j=v.rows;i.addClass(j[0],"mceFirst");i.addClass(j[j.length-1],"mceLast");f(i.select("tr",r),function(o){i.addClass(o.firstChild,"mceFirst");i.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(i.get(x.theme_advanced_toolbar_container)){i.get(x.theme_advanced_toolbar_container).appendChild(k)}else{i.insertAfter(k,q)}g.add(u.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){w._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return false}});if(!u.getParam("accessibility_focus")){g.add(i.add(k,"a",{href:"#"},""),"focus",function(){tinyMCE.get(u.id).focus()})}if(x.theme_advanced_toolbar_location=="external"){l.deltaHeight=0}w.deltaHeight=l.deltaHeight;l.targetNode=null;u.onKeyDown.add(function(p,n){var s=121,o=122;if(n.altKey){if(n.keyCode===s){if(h.isWebKit){window.focus()}w.toolbarGroup.focus();return g.cancel(n)}else{if(n.keyCode===o){i.get(p.id+"_path_row").focus();return g.cancel(n)}}}});u.addShortcut("alt+0","","mceShortcuts",w);return{iframeContainer:m,editorContainer:u.id+"_parent",sizeContainer:v,deltaHeight:l.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:h.majorVersion+"."+h.minorVersion}},resizeBy:function(j,k){var l=i.get(this.editor.id+"_ifr");this.resizeTo(l.clientWidth+j,l.clientHeight+k)},resizeTo:function(j,n,l){var k=this.editor,m=this.settings,o=i.get(k.id+"_tbl"),p=i.get(k.id+"_ifr");j=Math.max(m.theme_advanced_resizing_min_width||100,j);n=Math.max(m.theme_advanced_resizing_min_height||100,n);j=Math.min(m.theme_advanced_resizing_max_width||65535,j);n=Math.min(m.theme_advanced_resizing_max_height||65535,n);i.setStyle(o,"height","");i.setStyle(p,"height",n);if(m.theme_advanced_resize_horizontal){i.setStyle(o,"width","");i.setStyle(p,"width",j);if(j"));i.setHTML(l,r.join(""))},_addStatusBar:function(p,k){var l,w=this,q=w.editor,x=w.settings,j,u,v,m;l=i.add(p,"tr");l=m=i.add(l,"td",{"class":"mceStatusbar"});l=i.add(l,"div",{id:q.id+"_path_row",role:"group","aria-labelledby":q.id+"_path_voice"});if(x.theme_advanced_path){i.add(l,"span",{id:q.id+"_path_voice"},q.translate("advanced.path"));i.add(l,"span",{},": ")}else{i.add(l,"span",{}," ")}if(x.theme_advanced_resizing){i.add(m,"a",{id:q.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize",tabIndex:"-1"});if(x.theme_advanced_resizing_use_cookie){q.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+q.id+"_size"),r=i.get(q.id+"_tbl");if(!n){return}w.resizeTo(n.cw,n.ch)})}q.onPostRender.add(function(){g.add(q.id+"_resize","click",function(n){n.preventDefault()});g.add(q.id+"_resize","mousedown",function(E){var t,r,s,o,D,A,B,G,n,F,y;function z(H){H.preventDefault();n=B+(H.screenX-D);F=G+(H.screenY-A);w.resizeTo(n,F)}function C(H){g.remove(i.doc,"mousemove",t);g.remove(q.getDoc(),"mousemove",r);g.remove(i.doc,"mouseup",s);g.remove(q.getDoc(),"mouseup",o);n=B+(H.screenX-D);F=G+(H.screenY-A);w.resizeTo(n,F,true);q.nodeChanged()}E.preventDefault();D=E.screenX;A=E.screenY;y=i.get(w.editor.id+"_ifr");B=n=y.clientWidth;G=F=y.clientHeight;t=g.add(i.doc,"mousemove",z);r=g.add(q.getDoc(),"mousemove",z);s=g.add(i.doc,"mouseup",C);o=g.add(q.getDoc(),"mouseup",C)})})}k.deltaHeight-=21;l=p=null},_updateUndoStatus:function(k){var j=k.controlManager,l=k.undoManager;j.setDisabled("undo",!l.hasUndo()&&!l.typing);j.setDisabled("redo",!l.hasRedo())},_nodeChanged:function(o,u,E,r,F){var z=this,D,G=0,y,H,A=z.settings,x,l,w,C,m,k,j;h.each(z.stateControls,function(n){u.setActive(n,o.queryCommandState(z.controls[n][1]))});function q(p){var s,n=F.parents,t=p;if(typeof(p)=="string"){t=function(v){return v.nodeName==p}}for(s=0;s0){H.mark(p)}})}if(H=u.get("formatselect")){D=q(o.dom.isBlock);if(D){H.select(D.nodeName.toLowerCase())}}q(function(p){if(p.nodeName==="SPAN"){if(!x&&p.className){x=p.className}}if(o.dom.is(p,A.theme_advanced_font_selector)){if(!l&&p.style.fontSize){l=p.style.fontSize}if(!w&&p.style.fontFamily){w=p.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()}if(!C&&p.style.color){C=p.style.color}if(!m&&p.style.backgroundColor){m=p.style.backgroundColor}}return false});if(H=u.get("fontselect")){H.select(function(n){return n.replace(/^([^,]+).*/,"$1").toLowerCase()==w})}if(H=u.get("fontsizeselect")){if(A.theme_advanced_runtime_fontsize&&!l&&!x){l=o.dom.getStyle(E,"fontSize",true)}H.select(function(n){if(n.fontSize&&n.fontSize===l){return true}if(n["class"]&&n["class"]===x){return true}})}if(A.theme_advanced_show_current_color){function B(p,n){if(H=u.get(p)){if(!n){n=H.settings.default_color}if(n!==H.value){H.displayColor(n)}}}B("forecolor",C);B("backcolor",m)}if(A.theme_advanced_show_current_color){function B(p,n){if(H=u.get(p)){if(!n){n=H.settings.default_color}if(n!==H.value){H.displayColor(n)}}}B("forecolor",C);B("backcolor",m)}if(A.theme_advanced_path&&A.theme_advanced_statusbar_location){D=i.get(o.id+"_path")||i.add(o.id+"_path_row","span",{id:o.id+"_path"});if(z.statusKeyboardNavigation){z.statusKeyboardNavigation.destroy();z.statusKeyboardNavigation=null}i.setHTML(D,"");q(function(I){var p=I.nodeName.toLowerCase(),s,v,t="";if(I.nodeType!=1||p==="br"||I.getAttribute("data-mce-bogus")||i.hasClass(I,"mceItemHidden")||i.hasClass(I,"mceItemRemoved")){return}if(h.isIE&&I.scopeName!=="HTML"&&I.scopeName){p=I.scopeName+":"+p}p=p.replace(/mce\:/g,"");switch(p){case"b":p="strong";break;case"i":p="em";break;case"img":if(y=i.getAttrib(I,"src")){t+="src: "+y+" "}break;case"a":if(y=i.getAttrib(I,"name")){t+="name: "+y+" ";p+="#"+y}if(y=i.getAttrib(I,"href")){t+="href: "+y+" "}break;case"font":if(y=i.getAttrib(I,"face")){t+="font: "+y+" "}if(y=i.getAttrib(I,"size")){t+="size: "+y+" "}if(y=i.getAttrib(I,"color")){t+="color: "+y+" "}break;case"span":if(y=i.getAttrib(I,"style")){t+="style: "+y+" "}break}if(y=i.getAttrib(I,"id")){t+="id: "+y+" "}if(y=I.className){y=y.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g,"");if(y){t+="class: "+y+" ";if(o.dom.isBlock(I)||p=="img"||p=="span"){p+="."+y}}}p=p.replace(/(html:)/g,"");p={name:p,node:I,title:t};z.onResolveName.dispatch(z,p);t=p.title;p=p.name;v=i.create("a",{href:"javascript:;",role:"button",onmousedown:"return false;",title:t,"class":"mcePath_"+(G++)},p);if(D.hasChildNodes()){D.insertBefore(i.create("span",{"aria-hidden":"true"},"\u00a0\u00bb "),D.firstChild);D.insertBefore(v,D.firstChild)}else{D.appendChild(v)}},o.getBody());if(i.select("a",D).length>0){z.statusKeyboardNavigation=new h.ui.KeyboardNavigation({root:o.id+"_path_row",items:i.select("a",D),excludeFromTabOrder:true,onCancel:function(){o.focus()}},i)}}},_sel:function(j){this.editor.execCommand("mceSelectNodeDepth",false,j)},_mceInsertAnchor:function(l,k){var j=this.editor;j.windowManager.open({url:this.url+"/anchor.htm",width:320+parseInt(j.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(j.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var j=this.editor;j.windowManager.open({url:this.url+"/charmap.htm",width:550+parseInt(j.getLang("advanced.charmap_delta_width",0)),height:265+parseInt(j.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var j=this.editor;j.windowManager.open({url:this.url+"/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceShortcuts:function(){var j=this.editor;j.windowManager.open({url:this.url+"/shortcuts.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(l,k){var j=this.editor;k=k||{};j.windowManager.open({url:this.url+"/color_picker.htm",width:375+parseInt(j.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(j.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:k.color,func:k.func,theme_url:this.url})},_mceCodeEditor:function(k,l){var j=this.editor;j.windowManager.open({url:this.url+"/source_editor.htm",width:parseInt(j.getParam("theme_advanced_source_editor_width",720)),height:parseInt(j.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(k,l){var j=this.editor;if(j.dom.getAttrib(j.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}j.windowManager.open({url:this.url+"/image.htm",width:355+parseInt(j.getLang("advanced.image_delta_width",0)),height:275+parseInt(j.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(k,l){var j=this.editor;j.windowManager.open({url:this.url+"/link.htm",width:310+parseInt(j.getLang("advanced.link_delta_width",0)),height:200+parseInt(j.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var j=this.editor;j.windowManager.confirm("advanced.newdocument",function(k){if(k){j.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var j=this;this._mceColorPicker(0,{color:j.fgColor,func:function(k){j.fgColor=k;j.editor.execCommand("ForeColor",false,k)}})},_mceBackColor:function(){var j=this;this._mceColorPicker(0,{color:j.bgColor,func:function(k){j.bgColor=k;j.editor.execCommand("HiliteColor",false,k)}})},_ufirst:function(j){return j.substring(0,1).toUpperCase()+j.substring(1)}});h.ThemeManager.add("advanced",h.themes.AdvancedTheme)}(tinymce));glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/editor_template_src.js000066400000000000000000001246331226600447100256270ustar00rootroot00000000000000/** * editor_template_src.js * * Copyright 2009, Moxiecode Systems AB * Released under LGPL License. * * License: http://tinymce.moxiecode.com/license * Contributing: http://tinymce.moxiecode.com/contributing */ (function(tinymce) { var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID, explode = tinymce.explode; // Generates a preview for a format function getPreviewCss(ed, fmt) { var name, previewElm, dom = ed.dom, previewCss = '', parentFontSize, previewStylesName; previewStyles = ed.settings.preview_styles; // No preview forced if (previewStyles === false) return ''; // Default preview if (!previewStyles) previewStyles = 'font-family font-size font-weight text-decoration text-transform color background-color'; // Removes any variables since these can't be previewed function removeVars(val) { return val.replace(/%(\w+)/g, ''); }; // Create block/inline element to use for preview name = fmt.block || fmt.inline || 'span'; previewElm = dom.create(name); // Add format styles to preview element each(fmt.styles, function(value, name) { value = removeVars(value); if (value) dom.setStyle(previewElm, name, value); }); // Add attributes to preview element each(fmt.attributes, function(value, name) { value = removeVars(value); if (value) dom.setAttrib(previewElm, name, value); }); // Add classes to preview element each(fmt.classes, function(value) { value = removeVars(value); if (!dom.hasClass(previewElm, value)) dom.addClass(previewElm, value); }); // Add the previewElm outside the visual area dom.setStyles(previewElm, {position: 'absolute', left: -0xFFFF}); ed.getBody().appendChild(previewElm); // Get parent container font size so we can compute px values out of em/% for older IE:s parentFontSize = dom.getStyle(ed.getBody(), 'fontSize', true); parentFontSize = /px$/.test(parentFontSize) ? parseInt(parentFontSize, 10) : 0; each(previewStyles.split(' '), function(name) { var value = dom.getStyle(previewElm, name, true); // If background is transparent then check if the body has a background color we can use if (name == 'background-color' && /transparent|rgba\s*\([^)]+,\s*0\)/.test(value)) { value = dom.getStyle(ed.getBody(), name, true); // Ignore white since it's the default color, not the nicest fix if (dom.toHex(value).toLowerCase() == '#ffffff') { return; } } // Old IE won't calculate the font size so we need to do that manually if (name == 'font-size') { if (/em|%$/.test(value)) { if (parentFontSize === 0) { return; } // Convert font size from em/% to px value = parseFloat(value, 10) / (/%$/.test(value) ? 100 : 1); value = (value * parentFontSize) + 'px'; } } previewCss += name + ':' + value + ';'; }); dom.remove(previewElm); return previewCss; }; // Tell it to load theme specific language pack(s) tinymce.ThemeManager.requireLangPack('advanced'); tinymce.create('tinymce.themes.AdvancedTheme', { sizes : [8, 10, 12, 14, 18, 24, 36], // Control name lookup, format: title, command controls : { bold : ['bold_desc', 'Bold'], italic : ['italic_desc', 'Italic'], underline : ['underline_desc', 'Underline'], strikethrough : ['striketrough_desc', 'Strikethrough'], justifyleft : ['justifyleft_desc', 'JustifyLeft'], justifycenter : ['justifycenter_desc', 'JustifyCenter'], justifyright : ['justifyright_desc', 'JustifyRight'], justifyfull : ['justifyfull_desc', 'JustifyFull'], bullist : ['bullist_desc', 'InsertUnorderedList'], numlist : ['numlist_desc', 'InsertOrderedList'], outdent : ['outdent_desc', 'Outdent'], indent : ['indent_desc', 'Indent'], cut : ['cut_desc', 'Cut'], copy : ['copy_desc', 'Copy'], paste : ['paste_desc', 'Paste'], undo : ['undo_desc', 'Undo'], redo : ['redo_desc', 'Redo'], link : ['link_desc', 'mceLink'], unlink : ['unlink_desc', 'unlink'], image : ['image_desc', 'mceImage'], cleanup : ['cleanup_desc', 'mceCleanup'], help : ['help_desc', 'mceHelp'], code : ['code_desc', 'mceCodeEditor'], hr : ['hr_desc', 'InsertHorizontalRule'], removeformat : ['removeformat_desc', 'RemoveFormat'], sub : ['sub_desc', 'subscript'], sup : ['sup_desc', 'superscript'], forecolor : ['forecolor_desc', 'ForeColor'], forecolorpicker : ['forecolor_desc', 'mceForeColor'], backcolor : ['backcolor_desc', 'HiliteColor'], backcolorpicker : ['backcolor_desc', 'mceBackColor'], charmap : ['charmap_desc', 'mceCharMap'], visualaid : ['visualaid_desc', 'mceToggleVisualAid'], anchor : ['anchor_desc', 'mceInsertAnchor'], newdocument : ['newdocument_desc', 'mceNewDocument'], blockquote : ['blockquote_desc', 'mceBlockQuote'] }, stateControls : ['bold', 'italic', 'underline', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'sub', 'sup', 'blockquote'], init : function(ed, url) { var t = this, s, v, o; t.editor = ed; t.url = url; t.onResolveName = new tinymce.util.Dispatcher(this); s = ed.settings; ed.forcedHighContrastMode = ed.settings.detect_highcontrast && t._isHighContrast(); ed.settings.skin = ed.forcedHighContrastMode ? 'highcontrast' : ed.settings.skin; // Setup default buttons if (!s.theme_advanced_buttons1) { s = extend({ theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect", theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code", theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap" }, s); } // Default settings t.settings = s = extend({ theme_advanced_path : true, theme_advanced_toolbar_location : 'top', theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats", theme_advanced_more_colors : 1, theme_advanced_row_height : 23, theme_advanced_resize_horizontal : 1, theme_advanced_resizing_use_cookie : 1, theme_advanced_font_sizes : "1,2,3,4,5,6,7", theme_advanced_font_selector : "span", theme_advanced_show_current_color: 0, readonly : ed.settings.readonly }, s); // Setup default font_size_style_values if (!s.font_size_style_values) s.font_size_style_values = "8pt,10pt,12pt,14pt,18pt,24pt,36pt"; if (tinymce.is(s.theme_advanced_font_sizes, 'string')) { s.font_size_style_values = tinymce.explode(s.font_size_style_values); s.font_size_classes = tinymce.explode(s.font_size_classes || ''); // Parse string value o = {}; ed.settings.theme_advanced_font_sizes = s.theme_advanced_font_sizes; each(ed.getParam('theme_advanced_font_sizes', '', 'hash'), function(v, k) { var cl; if (k == v && v >= 1 && v <= 7) { k = v + ' (' + t.sizes[v - 1] + 'pt)'; cl = s.font_size_classes[v - 1]; v = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt'); } if (/^\s*\./.test(v)) cl = v.replace(/\./g, ''); o[k] = cl ? {'class' : cl} : {fontSize : v}; }); s.theme_advanced_font_sizes = o; } if ((v = s.theme_advanced_path_location) && v != 'none') s.theme_advanced_statusbar_location = s.theme_advanced_path_location; if (s.theme_advanced_statusbar_location == 'none') s.theme_advanced_statusbar_location = 0; if (ed.settings.content_css !== false) ed.contentCSS.push(ed.baseURI.toAbsolute(url + "/skins/" + ed.settings.skin + "/content.css")); // Init editor ed.onInit.add(function() { if (!ed.settings.readonly) { ed.onNodeChange.add(t._nodeChanged, t); ed.onKeyUp.add(t._updateUndoStatus, t); ed.onMouseUp.add(t._updateUndoStatus, t); ed.dom.bind(ed.dom.getRoot(), 'dragend', function() { t._updateUndoStatus(ed); }); } }); ed.onSetProgressState.add(function(ed, b, ti) { var co, id = ed.id, tb; if (b) { t.progressTimer = setTimeout(function() { co = ed.getContainer(); co = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild); tb = DOM.get(ed.id + '_tbl'); DOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}}); DOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}}); }, ti || 0); } else { DOM.remove(id + '_blocker'); DOM.remove(id + '_progress'); clearTimeout(t.progressTimer); } }); DOM.loadCSS(s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : url + "/skins/" + ed.settings.skin + "/ui.css"); if (s.skin_variant) DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css"); }, _isHighContrast : function() { var actualColor, div = DOM.add(DOM.getRoot(), 'div', {'style': 'background-color: rgb(171,239,86);'}); actualColor = (DOM.getStyle(div, 'background-color', true) + '').toLowerCase().replace(/ /g, ''); DOM.remove(div); return actualColor != 'rgb(171,239,86)' && actualColor != '#abef56'; }, createControl : function(n, cf) { var cd, c; if (c = cf.createControl(n)) return c; switch (n) { case "styleselect": return this._createStyleSelect(); case "formatselect": return this._createBlockFormats(); case "fontselect": return this._createFontSelect(); case "fontsizeselect": return this._createFontSizeSelect(); case "forecolor": return this._createForeColorMenu(); case "backcolor": return this._createBackColorMenu(); } if ((cd = this.controls[n])) return cf.createButton(n, {title : "advanced." + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]}); }, execCommand : function(cmd, ui, val) { var f = this['_' + cmd]; if (f) { f.call(this, ui, val); return true; } return false; }, _importClasses : function(e) { var ed = this.editor, ctrl = ed.controlManager.get('styleselect'); if (ctrl.getLength() == 0) { each(ed.dom.getClasses(), function(o, idx) { var name = 'style_' + idx, fmt; fmt = { inline : 'span', attributes : {'class' : o['class']}, selector : '*' }; ed.formatter.register(name, fmt); ctrl.add(o['class'], name, { style: function() { return getPreviewCss(ed, fmt); } }); }); } }, _createStyleSelect : function(n) { var t = this, ed = t.editor, ctrlMan = ed.controlManager, ctrl; // Setup style select box ctrl = ctrlMan.createListBox('styleselect', { title : 'advanced.style_select', onselect : function(name) { var matches, formatNames = [], removedFormat; each(ctrl.items, function(item) { formatNames.push(item.value); }); ed.focus(); ed.undoManager.add(); // Toggle off the current format(s) matches = ed.formatter.matchAll(formatNames); tinymce.each(matches, function(match) { if (!name || match == name) { if (match) ed.formatter.remove(match); removedFormat = true; } }); if (!removedFormat) ed.formatter.apply(name); ed.undoManager.add(); ed.nodeChanged(); return false; // No auto select } }); // Handle specified format ed.onPreInit.add(function() { var counter = 0, formats = ed.getParam('style_formats'); if (formats) { each(formats, function(fmt) { var name, keys = 0; each(fmt, function() {keys++;}); if (keys > 1) { name = fmt.name = fmt.name || 'style_' + (counter++); ed.formatter.register(name, fmt); ctrl.add(fmt.title, name, { style: function() { return getPreviewCss(ed, fmt); } }); } else ctrl.add(fmt.title); }); } else { each(ed.getParam('theme_advanced_styles', '', 'hash'), function(val, key) { var name, fmt; if (val) { name = 'style_' + (counter++); fmt = { inline : 'span', classes : val, selector : '*' }; ed.formatter.register(name, fmt); ctrl.add(t.editor.translate(key), name, { style: function() { return getPreviewCss(ed, fmt); } }); } }); } }); // Auto import classes if the ctrl box is empty if (ctrl.getLength() == 0) { ctrl.onPostRender.add(function(ed, n) { if (!ctrl.NativeListBox) { Event.add(n.id + '_text', 'focus', t._importClasses, t); Event.add(n.id + '_text', 'mousedown', t._importClasses, t); Event.add(n.id + '_open', 'focus', t._importClasses, t); Event.add(n.id + '_open', 'mousedown', t._importClasses, t); } else Event.add(n.id, 'focus', t._importClasses, t); }); } return ctrl; }, _createFontSelect : function() { var c, t = this, ed = t.editor; c = ed.controlManager.createListBox('fontselect', { title : 'advanced.fontdefault', onselect : function(v) { var cur = c.items[c.selectedIndex]; if (!v && cur) { ed.execCommand('FontName', false, cur.value); return; } ed.execCommand('FontName', false, v); // Fake selection, execCommand will fire a nodeChange and update the selection c.select(function(sv) { return v == sv; }); if (cur && cur.value == v) { c.select(null); } return false; // No auto select } }); if (c) { each(ed.getParam('theme_advanced_fonts', t.settings.theme_advanced_fonts, 'hash'), function(v, k) { c.add(ed.translate(k), v, {style : v.indexOf('dings') == -1 ? 'font-family:' + v : ''}); }); } return c; }, _createFontSizeSelect : function() { var t = this, ed = t.editor, c, i = 0, cl = []; c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) { var cur = c.items[c.selectedIndex]; if (!v && cur) { cur = cur.value; if (cur['class']) { ed.formatter.toggle('fontsize_class', {value : cur['class']}); ed.undoManager.add(); ed.nodeChanged(); } else { ed.execCommand('FontSize', false, cur.fontSize); } return; } if (v['class']) { ed.focus(); ed.undoManager.add(); ed.formatter.toggle('fontsize_class', {value : v['class']}); ed.undoManager.add(); ed.nodeChanged(); } else ed.execCommand('FontSize', false, v.fontSize); // Fake selection, execCommand will fire a nodeChange and update the selection c.select(function(sv) { return v == sv; }); if (cur && (cur.value.fontSize == v.fontSize || cur.value['class'] && cur.value['class'] == v['class'])) { c.select(null); } return false; // No auto select }}); if (c) { each(t.settings.theme_advanced_font_sizes, function(v, k) { var fz = v.fontSize; if (fz >= 1 && fz <= 7) fz = t.sizes[parseInt(fz) - 1] + 'pt'; c.add(k, v, {'style' : 'font-size:' + fz, 'class' : 'mceFontSize' + (i++) + (' ' + (v['class'] || ''))}); }); } return c; }, _createBlockFormats : function() { var c, fmts = { p : 'advanced.paragraph', address : 'advanced.address', pre : 'advanced.pre', h1 : 'advanced.h1', h2 : 'advanced.h2', h3 : 'advanced.h3', h4 : 'advanced.h4', h5 : 'advanced.h5', h6 : 'advanced.h6', div : 'advanced.div', blockquote : 'advanced.blockquote', code : 'advanced.code', dt : 'advanced.dt', dd : 'advanced.dd', samp : 'advanced.samp' }, t = this; c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', onselect : function(v) { t.editor.execCommand('FormatBlock', false, v); return false; }}); if (c) { each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) { c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v, style: function() { return getPreviewCss(t.editor, {block: v}); }}); }); } return c; }, _createForeColorMenu : function() { var c, t = this, s = t.settings, o = {}, v; if (s.theme_advanced_more_colors) { o.more_colors_func = function() { t._mceColorPicker(0, { color : c.value, func : function(co) { c.setColor(co); } }); }; } if (v = s.theme_advanced_text_colors) o.colors = v; if (s.theme_advanced_default_foreground_color) o.default_color = s.theme_advanced_default_foreground_color; o.title = 'advanced.forecolor_desc'; o.cmd = 'ForeColor'; o.scope = this; c = t.editor.controlManager.createColorSplitButton('forecolor', o); return c; }, _createBackColorMenu : function() { var c, t = this, s = t.settings, o = {}, v; if (s.theme_advanced_more_colors) { o.more_colors_func = function() { t._mceColorPicker(0, { color : c.value, func : function(co) { c.setColor(co); } }); }; } if (v = s.theme_advanced_background_colors) o.colors = v; if (s.theme_advanced_default_background_color) o.default_color = s.theme_advanced_default_background_color; o.title = 'advanced.backcolor_desc'; o.cmd = 'HiliteColor'; o.scope = this; c = t.editor.controlManager.createColorSplitButton('backcolor', o); return c; }, renderUI : function(o) { var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl; if (ed.settings) { ed.settings.aria_label = s.aria_label + ed.getLang('advanced.help_shortcut'); } // TODO: ACC Should have an aria-describedby attribute which is user-configurable to describe what this field is actually for. // Maybe actually inherit it from the original textara? n = p = DOM.create('span', {role : 'application', 'aria-labelledby' : ed.id + '_voice', id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '') + (ed.settings.directionality == "rtl" ? ' mceRtl' : '')}); DOM.add(n, 'span', {'class': 'mceVoiceLabel', 'style': 'display:none;', id: ed.id + '_voice'}, s.aria_label); if (!DOM.boxModel) n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'}); n = sc = DOM.add(n, 'table', {role : "presentation", id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0}); n = tb = DOM.add(n, 'tbody'); switch ((s.theme_advanced_layout_manager || '').toLowerCase()) { case "rowlayout": ic = t._rowLayout(s, tb, o); break; case "customlayout": ic = ed.execCallback("theme_advanced_custom_layout", s, tb, o, p); break; default: ic = t._simpleLayout(s, tb, o, p); } n = o.targetNode; // Add classes to first and last TRs nl = sc.rows; DOM.addClass(nl[0], 'mceFirst'); DOM.addClass(nl[nl.length - 1], 'mceLast'); // Add classes to first and last TDs each(DOM.select('tr', tb), function(n) { DOM.addClass(n.firstChild, 'mceFirst'); DOM.addClass(n.childNodes[n.childNodes.length - 1], 'mceLast'); }); if (DOM.get(s.theme_advanced_toolbar_container)) DOM.get(s.theme_advanced_toolbar_container).appendChild(p); else DOM.insertAfter(p, n); Event.add(ed.id + '_path_row', 'click', function(e) { e = e.target; if (e.nodeName == 'A') { t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/, '$1')); return false; } }); /* if (DOM.get(ed.id + '_path_row')) { Event.add(ed.id + '_tbl', 'mouseover', function(e) { var re; e = e.target; if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) { re = DOM.get(ed.id + '_path_row'); t.lastPath = re.innerHTML; DOM.setHTML(re, e.parentNode.title); } }); Event.add(ed.id + '_tbl', 'mouseout', function(e) { if (t.lastPath) { DOM.setHTML(ed.id + '_path_row', t.lastPath); t.lastPath = 0; } }); } */ if (!ed.getParam('accessibility_focus')) Event.add(DOM.add(p, 'a', {href : '#'}, ''), 'focus', function() {tinyMCE.get(ed.id).focus();}); if (s.theme_advanced_toolbar_location == 'external') o.deltaHeight = 0; t.deltaHeight = o.deltaHeight; o.targetNode = null; ed.onKeyDown.add(function(ed, evt) { var DOM_VK_F10 = 121, DOM_VK_F11 = 122; if (evt.altKey) { if (evt.keyCode === DOM_VK_F10) { // Make sure focus is given to toolbar in Safari. // We can't do this in IE as it prevents giving focus to toolbar when editor is in a frame if (tinymce.isWebKit) { window.focus(); } t.toolbarGroup.focus(); return Event.cancel(evt); } else if (evt.keyCode === DOM_VK_F11) { DOM.get(ed.id + '_path_row').focus(); return Event.cancel(evt); } } }); // alt+0 is the UK recommended shortcut for accessing the list of access controls. ed.addShortcut('alt+0', '', 'mceShortcuts', t); return { iframeContainer : ic, editorContainer : ed.id + '_parent', sizeContainer : sc, deltaHeight : o.deltaHeight }; }, getInfo : function() { return { longname : 'Advanced theme', author : 'Moxiecode Systems AB', authorurl : 'http://tinymce.moxiecode.com', version : tinymce.majorVersion + "." + tinymce.minorVersion } }, resizeBy : function(dw, dh) { var e = DOM.get(this.editor.id + '_ifr'); this.resizeTo(e.clientWidth + dw, e.clientHeight + dh); }, resizeTo : function(w, h, store) { var ed = this.editor, s = this.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr'); // Boundery fix box w = Math.max(s.theme_advanced_resizing_min_width || 100, w); h = Math.max(s.theme_advanced_resizing_min_height || 100, h); w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w); h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h); // Resize iframe and container DOM.setStyle(e, 'height', ''); DOM.setStyle(ifr, 'height', h); if (s.theme_advanced_resize_horizontal) { DOM.setStyle(e, 'width', ''); DOM.setStyle(ifr, 'width', w); // Make sure that the size is never smaller than the over all ui if (w < e.clientWidth) { w = e.clientWidth; DOM.setStyle(ifr, 'width', e.clientWidth); } } // Store away the size if (store && s.theme_advanced_resizing_use_cookie) { Cookie.setHash("TinyMCE_" + ed.id + "_size", { cw : w, ch : h }); } }, destroy : function() { var id = this.editor.id; Event.clear(id + '_resize'); Event.clear(id + '_path_row'); Event.clear(id + '_external_close'); }, // Internal functions _simpleLayout : function(s, tb, o, p) { var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c; if (s.readonly) { n = DOM.add(tb, 'tr'); n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); return ic; } // Create toolbar container at top if (lo == 'top') t._addToolbars(tb, o); // Create external toolbar if (lo == 'external') { n = c = DOM.create('div', {style : 'position:relative'}); n = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'}); DOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'}); n = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0}); etb = DOM.add(n, 'tbody'); if (p.firstChild.className == 'mceOldBoxModel') p.firstChild.appendChild(c); else p.insertBefore(c, p.firstChild); t._addToolbars(etb, o); ed.onMouseUp.add(function() { var e = DOM.get(ed.id + '_external'); DOM.show(e); DOM.hide(lastExtID); var f = Event.add(ed.id + '_external_close', 'click', function() { DOM.hide(ed.id + '_external'); Event.remove(ed.id + '_external_close', 'click', f); return false; }); DOM.show(e); DOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1); // Fixes IE rendering bug DOM.hide(e); DOM.show(e); e.style.filter = ''; lastExtID = ed.id + '_external'; e = null; }); } if (sl == 'top') t._addStatusBar(tb, o); // Create iframe container if (!s.theme_advanced_toolbar_container) { n = DOM.add(tb, 'tr'); n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); } // Create toolbar container at bottom if (lo == 'bottom') t._addToolbars(tb, o); if (sl == 'bottom') t._addStatusBar(tb, o); return ic; }, _rowLayout : function(s, tb, o) { var t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to, a; dc = s.theme_advanced_containers_default_class || ''; da = s.theme_advanced_containers_default_align || 'center'; each(explode(s.theme_advanced_containers || ''), function(c, i) { var v = s['theme_advanced_container_' + c] || ''; switch (c.toLowerCase()) { case 'mceeditor': n = DOM.add(tb, 'tr'); n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); break; case 'mceelementpath': t._addStatusBar(tb, o); break; default: a = (s['theme_advanced_container_' + c + '_align'] || da).toLowerCase(); a = 'mce' + t._ufirst(a); n = DOM.add(DOM.add(tb, 'tr'), 'td', { 'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc) + ' ' + a || da }); to = cf.createToolbar("toolbar" + i); t._addControls(v, to); DOM.setHTML(n, to.renderHTML()); o.deltaHeight -= s.theme_advanced_row_height; } }); return ic; }, _addControls : function(v, tb) { var t = this, s = t.settings, di, cf = t.editor.controlManager; if (s.theme_advanced_disable && !t._disabled) { di = {}; each(explode(s.theme_advanced_disable), function(v) { di[v] = 1; }); t._disabled = di; } else di = t._disabled; each(explode(v), function(n) { var c; if (di && di[n]) return; // Compatiblity with 2.x if (n == 'tablecontrols') { each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"], function(n) { n = t.createControl(n, cf); if (n) tb.add(n); }); return; } c = t.createControl(n, cf); if (c) tb.add(c); }); }, _addToolbars : function(c, o) { var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a, toolbarGroup, toolbarsExist = false; toolbarGroup = cf.createToolbarGroup('toolbargroup', { 'name': ed.getLang('advanced.toolbar'), 'tab_focus_toolbar':ed.getParam('theme_advanced_tab_focus_toolbar') }); t.toolbarGroup = toolbarGroup; a = s.theme_advanced_toolbar_align.toLowerCase(); a = 'mce' + t._ufirst(a); n = DOM.add(DOM.add(c, 'tr', {role: 'presentation'}), 'td', {'class' : 'mceToolbar ' + a, "role":"toolbar"}); // Create toolbar and add the controls for (i=1; (v = s['theme_advanced_buttons' + i]); i++) { toolbarsExist = true; tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i}); if (s['theme_advanced_buttons' + i + '_add']) v += ',' + s['theme_advanced_buttons' + i + '_add']; if (s['theme_advanced_buttons' + i + '_add_before']) v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v; t._addControls(v, tb); toolbarGroup.add(tb); o.deltaHeight -= s.theme_advanced_row_height; } // Handle case when there are no toolbar buttons and ensure editor height is adjusted accordingly if (!toolbarsExist) o.deltaHeight -= s.theme_advanced_row_height; h.push(toolbarGroup.renderHTML()); h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '')); DOM.setHTML(n, h.join('')); }, _addStatusBar : function(tb, o) { var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td; n = DOM.add(tb, 'tr'); n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'}); n = DOM.add(n, 'div', {id : ed.id + '_path_row', 'role': 'group', 'aria-labelledby': ed.id + '_path_voice'}); if (s.theme_advanced_path) { DOM.add(n, 'span', {id: ed.id + '_path_voice'}, ed.translate('advanced.path')); DOM.add(n, 'span', {}, ': '); } else { DOM.add(n, 'span', {}, ' '); } if (s.theme_advanced_resizing) { DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize', tabIndex:"-1"}); if (s.theme_advanced_resizing_use_cookie) { ed.onPostRender.add(function() { var o = Cookie.getHash("TinyMCE_" + ed.id + "_size"), c = DOM.get(ed.id + '_tbl'); if (!o) return; t.resizeTo(o.cw, o.ch); }); } ed.onPostRender.add(function() { Event.add(ed.id + '_resize', 'click', function(e) { e.preventDefault(); }); Event.add(ed.id + '_resize', 'mousedown', function(e) { var mouseMoveHandler1, mouseMoveHandler2, mouseUpHandler1, mouseUpHandler2, startX, startY, startWidth, startHeight, width, height, ifrElm; function resizeOnMove(e) { e.preventDefault(); width = startWidth + (e.screenX - startX); height = startHeight + (e.screenY - startY); t.resizeTo(width, height); }; function endResize(e) { // Stop listening Event.remove(DOM.doc, 'mousemove', mouseMoveHandler1); Event.remove(ed.getDoc(), 'mousemove', mouseMoveHandler2); Event.remove(DOM.doc, 'mouseup', mouseUpHandler1); Event.remove(ed.getDoc(), 'mouseup', mouseUpHandler2); width = startWidth + (e.screenX - startX); height = startHeight + (e.screenY - startY); t.resizeTo(width, height, true); ed.nodeChanged(); }; e.preventDefault(); // Get the current rect size startX = e.screenX; startY = e.screenY; ifrElm = DOM.get(t.editor.id + '_ifr'); startWidth = width = ifrElm.clientWidth; startHeight = height = ifrElm.clientHeight; // Register envent handlers mouseMoveHandler1 = Event.add(DOM.doc, 'mousemove', resizeOnMove); mouseMoveHandler2 = Event.add(ed.getDoc(), 'mousemove', resizeOnMove); mouseUpHandler1 = Event.add(DOM.doc, 'mouseup', endResize); mouseUpHandler2 = Event.add(ed.getDoc(), 'mouseup', endResize); }); }); } o.deltaHeight -= 21; n = tb = null; }, _updateUndoStatus : function(ed) { var cm = ed.controlManager, um = ed.undoManager; cm.setDisabled('undo', !um.hasUndo() && !um.typing); cm.setDisabled('redo', !um.hasRedo()); }, _nodeChanged : function(ed, cm, n, co, ob) { var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn, fc, bc, formatNames, matches; tinymce.each(t.stateControls, function(c) { cm.setActive(c, ed.queryCommandState(t.controls[c][1])); }); function getParent(name) { var i, parents = ob.parents, func = name; if (typeof(name) == 'string') { func = function(node) { return node.nodeName == name; }; } for (i = 0; i < parents.length; i++) { if (func(parents[i])) return parents[i]; } }; cm.setActive('visualaid', ed.hasVisual); t._updateUndoStatus(ed); cm.setDisabled('outdent', !ed.queryCommandState('Outdent')); p = getParent('A'); if (c = cm.get('link')) { c.setDisabled((!p && co) || (p && !p.href)); c.setActive(!!p && (!p.name && !p.id)); } if (c = cm.get('unlink')) { c.setDisabled(!p && co); c.setActive(!!p && !p.name && !p.id); } if (c = cm.get('anchor')) { c.setActive(!co && !!p && (p.name || (p.id && !p.href))); } p = getParent('IMG'); if (c = cm.get('image')) c.setActive(!co && !!p && n.className.indexOf('mceItem') == -1); if (c = cm.get('styleselect')) { t._importClasses(); formatNames = []; each(c.items, function(item) { formatNames.push(item.value); }); matches = ed.formatter.matchAll(formatNames); c.select(matches[0]); tinymce.each(matches, function(match, index) { if (index > 0) { c.mark(match); } }); } if (c = cm.get('formatselect')) { p = getParent(ed.dom.isBlock); if (p) c.select(p.nodeName.toLowerCase()); } // Find out current fontSize, fontFamily and fontClass getParent(function(n) { if (n.nodeName === 'SPAN') { if (!cl && n.className) cl = n.className; } if (ed.dom.is(n, s.theme_advanced_font_selector)) { if (!fz && n.style.fontSize) fz = n.style.fontSize; if (!fn && n.style.fontFamily) fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase(); if (!fc && n.style.color) fc = n.style.color; if (!bc && n.style.backgroundColor) bc = n.style.backgroundColor; } return false; }); if (c = cm.get('fontselect')) { c.select(function(v) { return v.replace(/^([^,]+).*/, '$1').toLowerCase() == fn; }); } // Select font size if (c = cm.get('fontsizeselect')) { // Use computed style if (s.theme_advanced_runtime_fontsize && !fz && !cl) fz = ed.dom.getStyle(n, 'fontSize', true); c.select(function(v) { if (v.fontSize && v.fontSize === fz) return true; if (v['class'] && v['class'] === cl) return true; }); } if (s.theme_advanced_show_current_color) { function updateColor(controlId, color) { if (c = cm.get(controlId)) { if (!color) color = c.settings.default_color; if (color !== c.value) { c.displayColor(color); } } } updateColor('forecolor', fc); updateColor('backcolor', bc); } if (s.theme_advanced_show_current_color) { function updateColor(controlId, color) { if (c = cm.get(controlId)) { if (!color) color = c.settings.default_color; if (color !== c.value) { c.displayColor(color); } } }; updateColor('forecolor', fc); updateColor('backcolor', bc); } if (s.theme_advanced_path && s.theme_advanced_statusbar_location) { p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'}); if (t.statusKeyboardNavigation) { t.statusKeyboardNavigation.destroy(); t.statusKeyboardNavigation = null; } DOM.setHTML(p, ''); getParent(function(n) { var na = n.nodeName.toLowerCase(), u, pi, ti = ''; // Ignore non element and bogus/hidden elements if (n.nodeType != 1 || na === 'br' || n.getAttribute('data-mce-bogus') || DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved')) return; // Handle prefix if (tinymce.isIE && n.scopeName !== 'HTML' && n.scopeName) na = n.scopeName + ':' + na; // Remove internal prefix na = na.replace(/mce\:/g, ''); // Handle node name switch (na) { case 'b': na = 'strong'; break; case 'i': na = 'em'; break; case 'img': if (v = DOM.getAttrib(n, 'src')) ti += 'src: ' + v + ' '; break; case 'a': if (v = DOM.getAttrib(n, 'name')) { ti += 'name: ' + v + ' '; na += '#' + v; } if (v = DOM.getAttrib(n, 'href')) ti += 'href: ' + v + ' '; break; case 'font': if (v = DOM.getAttrib(n, 'face')) ti += 'font: ' + v + ' '; if (v = DOM.getAttrib(n, 'size')) ti += 'size: ' + v + ' '; if (v = DOM.getAttrib(n, 'color')) ti += 'color: ' + v + ' '; break; case 'span': if (v = DOM.getAttrib(n, 'style')) ti += 'style: ' + v + ' '; break; } if (v = DOM.getAttrib(n, 'id')) ti += 'id: ' + v + ' '; if (v = n.className) { v = v.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g, ''); if (v) { ti += 'class: ' + v + ' '; if (ed.dom.isBlock(n) || na == 'img' || na == 'span') na += '.' + v; } } na = na.replace(/(html:)/g, ''); na = {name : na, node : n, title : ti}; t.onResolveName.dispatch(t, na); ti = na.title; na = na.name; //u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');"; pi = DOM.create('a', {'href' : "javascript:;", role: 'button', onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na); if (p.hasChildNodes()) { p.insertBefore(DOM.create('span', {'aria-hidden': 'true'}, '\u00a0\u00bb '), p.firstChild); p.insertBefore(pi, p.firstChild); } else p.appendChild(pi); }, ed.getBody()); if (DOM.select('a', p).length > 0) { t.statusKeyboardNavigation = new tinymce.ui.KeyboardNavigation({ root: ed.id + "_path_row", items: DOM.select('a', p), excludeFromTabOrder: true, onCancel: function() { ed.focus(); } }, DOM); } } }, // Commands gets called by execCommand _sel : function(v) { this.editor.execCommand('mceSelectNodeDepth', false, v); }, _mceInsertAnchor : function(ui, v) { var ed = this.editor; ed.windowManager.open({ url : this.url + '/anchor.htm', width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)), height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)), inline : true }, { theme_url : this.url }); }, _mceCharMap : function() { var ed = this.editor; ed.windowManager.open({ url : this.url + '/charmap.htm', width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)), height : 265 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)), inline : true }, { theme_url : this.url }); }, _mceHelp : function() { var ed = this.editor; ed.windowManager.open({ url : this.url + '/about.htm', width : 480, height : 380, inline : true }, { theme_url : this.url }); }, _mceShortcuts : function() { var ed = this.editor; ed.windowManager.open({ url: this.url + '/shortcuts.htm', width: 480, height: 380, inline: true }, { theme_url: this.url }); }, _mceColorPicker : function(u, v) { var ed = this.editor; v = v || {}; ed.windowManager.open({ url : this.url + '/color_picker.htm', width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)), height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)), close_previous : false, inline : true }, { input_color : v.color, func : v.func, theme_url : this.url }); }, _mceCodeEditor : function(ui, val) { var ed = this.editor; ed.windowManager.open({ url : this.url + '/source_editor.htm', width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)), height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)), inline : true, resizable : true, maximizable : true }, { theme_url : this.url }); }, _mceImage : function(ui, val) { var ed = this.editor; // Internal image object like a flash placeholder if (ed.dom.getAttrib(ed.selection.getNode(), 'class', '').indexOf('mceItem') != -1) return; ed.windowManager.open({ url : this.url + '/image.htm', width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)), height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)), inline : true }, { theme_url : this.url }); }, _mceLink : function(ui, val) { var ed = this.editor; ed.windowManager.open({ url : this.url + '/link.htm', width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)), height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)), inline : true }, { theme_url : this.url }); }, _mceNewDocument : function() { var ed = this.editor; ed.windowManager.confirm('advanced.newdocument', function(s) { if (s) ed.execCommand('mceSetContent', false, ''); }); }, _mceForeColor : function() { var t = this; this._mceColorPicker(0, { color: t.fgColor, func : function(co) { t.fgColor = co; t.editor.execCommand('ForeColor', false, co); } }); }, _mceBackColor : function() { var t = this; this._mceColorPicker(0, { color: t.bgColor, func : function(co) { t.bgColor = co; t.editor.execCommand('HiliteColor', false, co); } }); }, _ufirst : function(s) { return s.substring(0, 1).toUpperCase() + s.substring(1); } }); tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme); }(tinymce)); glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/image.htm000066400000000000000000000077061226600447100230360ustar00rootroot00000000000000 {#advanced_dlg.image_title}
     
    x
    glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/img/000077500000000000000000000000001226600447100220045ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/img/colorpicker.jpg000066400000000000000000000050301226600447100250200ustar00rootroot00000000000000JFIF>CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default quality C    $.' ",#(7),01444'9=82<.342C  2!!22222222222222222222222222222222222222222222222222,"1A!"2!" ?4xzu!^Y:5xo(D\;>5ӭF"3F_fX(˦>ZY9(r֮JFDw&m_YcƟD343^*晚FiE1/}K_oC~?G+?]#}7‡\y8Ly3۳OnO=cg?L#2Ŗ(ǖ8\SGlq=\Qq-kZ+PByL2lNZiv,yBYǞO=:| Nu<}9^?O+DWקu85h΍4e4`IYy)rQVJEy2g 4ХǟD34G)ddc'b/93Ng>\ 9^Dyۯ=|ٮ6:N?dq峟>ɌuC Wcv>\p8]hW?M+B %䰥bu : 䚫]X ^5pON?ztx~E[Yp_NgG-E;Qྜྷ. zr/G^uF]1Cay? W&)ۢb'rSYD 9'Wr\pEUr)qѓ)2S92sm2g8ǧ;sCLdsno_>}oǖ8V2ьqqƜBqqU?C x9KaG!+av`,$+`,6XKYzt8XwM$W]q7HZ:<5ק3h,՛F+0/ut7[ 6BYNg0(E_b(gmGeJ9MFn9JRftLy9fc ci掗,`Rs9V2͒Z1Fuc|XFBV6‡b1 =׃lv, {0b 64V*tmUuf(8hٳq6qPzHJ7qV-9u@~u.iPw7G`YF麤귘k"RQ9HG%)LE r(3ȣӻ#f鏕ntyc,o|fv0\/iyȵ~ 2Ac'b9;1X!Ƭg 33 wh,.՛+`,6YubFXt^V?5qƮ6Yqз zQqAnf]~3PZjTV4@ꕪ=RZ@(oJ?4QE)rQp3y)GC$ǦnFNF 63rAQaɇ%-r!_g'f+979Q~e s;΃35A~`l2Fl]a~=bh؍'3v? ?=H-ѫd?aP lu h?LzjhZh% _mA*T")K}vV/tT2Lz'l?dDDIqqpaQ&Mf[+&Yə2d; L3!(.(,t*, X[4V`K,]ΕKE ʭU٤̲rcT?44铃f*‚ڲ D6u%Z2pkiy93Wu["z'F5Tm2'PFB6fC2vfҁ;7 QD$Hto6J}+4}ҺJt> H@( UGC%2iGt_WO;Uhһw͢U]Q;_a;YIO_a;]#vha]'TUUeE `l]Yu"nU2uʿ˿e2)W}&]'N}TT}/~t>ҍt>>]DDXE'DӴG:8O'D'i#:9:'H:D;DCڑ'DWHވ(:ND퐝/D;'dDG 'I"N"glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/img/flash.gif000066400000000000000000000003571226600447100235750ustar00rootroot00000000000000GIF89aj}nVjz\䂏8Z(J!,@I}Hz3F ba 0D% BQ`A E/p! pL%M'!*@S4fH_iVq 3>* G4ac eg7j#BG&-ier]0H =G48}x;glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/img/icons.gif000066400000000000000000000273161226600447100236170ustar00rootroot00000000000000GIF89a<`n%4O8*opqyn4Kcpz1QﮏХX̣XݹpQQRԚ=8)؊Ssb/i䴕T|ՍxY.-Y]fr[vOmAwl𑣹tlaUOPhĸ5f-M97ϰQϨ˴g急ٺO5`pˑ6MGYur虙Rkƴq*KKzBRc򅊝򨩶suRyMFH|lOf>봱0ChBgd}ΓR{kW@Ks@`A8?g..<QkܱS"X^Sp%cWnNX 9Lp𨸸Jvc"Zڎr̦PUg2Rr6[[Z?ː()'Р9c!,< H*\ȰÇ#JHŋ3jȱǏ CIɓ(}ԨeC0cʜ)ʛ8sɳϟ@ JѣH;x`iӗJJUͤXjpQ.I((ٳhܥKۋ*6ݻx~vu^~ LÈzM3]u؉\*-z(g 0.ti ? ĺHlጐ򉧏%|*s|z > dF萑ą6J{kL8dD.\ {=VѷGhqK. rp Vham. 6f@H A C$aD TleB j<~GV}I 9I 5>jT #dIq1CD, af`fjV"p gDP5Yt?'B!(!ߠUFޑ G]]GFtX %`d;^ڑ38HD(q m4fH뭺jPkFt &aH. @A# 1o enB,l 0A@i3%PG?P L0ލNN5\s^S].jB"D$#rwBPChD?W2{ѳq&D@FfE}E~!&sq.$zԉD G TDjB=#61J*k__$%H-CvI|FXK&bBV/K3I:'@0BGG\8K 7+D5tLP/r}iܕH 6.*T'5C)F(@ 7 I-n@@"' D$(Qq$`p^_! ^Vt/r=MӘב&4A|R!PG'"LPUޔ+V|\ߠ| Yr?1:cI7M?CN.S 2e@}D BRL0A38H!*y.`PC2$v1)y悞-sfvxĢ״EAD 0/X}ַx2Fw %:O tq&.MLSzp@6(n?h8Qr+~T2[i$Eg? -((Dla0B q2 2S dI bM"fE7 1#F&$ 405 W[6E Xv\2UI'ZcփTK8!=[5H0ZiF0ъr 0nKQ%i.Ep7PB.p̲Zfsl!x@J0!, \#8*N:&[@}G ڙM6A҅2b ,gq喅<A"Hs`9W2j]Aq:XxDBV&f,D|?&'fĺ풡e3EEɵa3Zط64aNho,d@>CnKNg4A;dD qB[6fjD\7!T0]\H1TkZú ` R=1$=mBqB46\!EMC"tU Ә(H"$-1q!XWMT4%5v)JiKfz[/{ɴ."]P"1Vm#FOLr?ιdOsdr31d1#r B.ApfXlL)HMxlWe8NzSa^rsVV_ [jS5̎]@ºw_2aE@8Cͺ(ebY͠sA"GdfC"9SH$4H b7JSֈX ]SĦ Vԉ7JJ(]=QIO"$g!լ5rEY]#8 $ q@ AT^3Y?gE{K#tA5.g9OS"FPtZ@t$Fr PVr"d^".ufPh@Pj6yJ 1zL y!kqwNc'waTt93x$ (b |FāGEPzpWPsAG@ 7'8h wW7 qaaL !6${gX6|T0s37drUuV>{ W}AqG+}'Aq+s(gc7|#vG@Bt tQ3]g> uǘ>Y',Udt^cŅlUR(j!hP ).rn $jv@Q<\-Cl1&yEHG͐ f $p S`2b&iXexquA1!`cacsov8W#wMp-%6p ͕SUOX#lc(l1# =7W=wWhwsK\P4xAPkE8sTiH`1C.W]vQ8R{YGų G (XY8S@ 4ё U!i8{qTUӅry&.@qNh>4y&H&f W3U^@٩:Zz:|:Zzګ++Zj Țo`(X]7zκC0P"8W`lmpqml0Dd0 pAЯ:! : GP ; K >*p21۱ pP *aIC.O2;28г0 U0UF{p[0p  SЊԚb O0n]` px{ZP  J06pTWp\ p;S '@P@`@ @d >cpI! ۹+ Z%++ePؓ;`c ˼K;Q{ + 8[`:%r"_"@@{` BPl ` ¬.b  p š@ ;{=[*נ[88*%8P:5 aYpzPZxPVl/Z `@` +l< n0 b7q<q6`nP1 0 rRLȃRLrѷQ`'$7>pW05.>pP RRRP2Ygk"@Y ']+  pO0 Vpl <-`@`@1 ƀE H`4}pÛpZ`]rP>5 pl0vx q 8+aL hl a Nj]"- e œž=^ϐAﲵqUkȭ` P ?mp9m-0Sb(qQ'@v!]lOn@P Mk Թ=;[JP?  < /;P;`6 ]0ί3"^j ϟa 2>;rt&6a_]+AQ L1!R^0 ?t ֽ&.`ow-NP  LpWP |nې0VP[r0`/p ` n H NA 1p#&0:٭ ps0@i9߿OHdx0C< t3PXO2|c^zEV2BEdg /6K#`L_A}!kQ&LpӠƥM&ݸUYvj#M ,$H.hc/RFJ{r#Xc!z Zl*x`a!%N!% tQ ~r HR'OiGN a5Ҏjas(>ܫn ԆR{:Buތ"'Lɑc|WlN?]=OR8RUX 8  `' & 0v!(>5Fh +pE*)$6/sܱG>x 5"#| %|HuǤrˬ$tJA`G 0`Ǖj@ `2h83G xk^hKأx^!6zo "tv`>@j J\9ܠu4 Xa0dڨcX4V $$lAMgOQ OiѢ[8PVK $ZYhFe. &| $H2I"y+C:L$Cxv؃n2x'{'`23^1|-XI}#>jS)eZ҂h &>&C^3"߈&IY$ B_}eUz/{}OGJ-A 46ax T;y/Gg04 (aH3xC B1Q pؔ.dp`jd 0DatAr t0Jկ^TXoA$2BA[xHȭʴc@ (ĺ6. FfND -C'"2 W-`bIiF1vBE\)1EIe*bj2B.^d'vHJRd"IԌd<$@c6gMp(ZdGd87gǃ!QC6 6lh;9v 'VФ@ pZĥ2ԡHy2!mC 4nwpa!(HсqHaG8'8r3Y`9 kHցϩ&T1<ZCU50( E5o2$7ܲyX܄J8`+a a:Ba7N kC%G@V  Le1{ЯelaKFA=8Z~`&(vTNv“JpP e`T( B"fIE#a/8uxjYhF!# A+`!Z䢯`" a5DźF_4^C3adQs(Gp Ex=#-8h`H{.8H"Gz-zZԢ0J)R'.@X%ɕkK\2IL:eSDrLK◴gpMNęf8 G4p[@zD @15ORcèFBFZX$(1hi!V2OtvIxp0Ci0Bq Àf4pIMq't#V Tc3De!CɈL $h? pGՂ d2\ H@C V!h]2?= hO şpFaw82T\^W>xF8Ab[n.@-н@BN06 !`QZ ^. 7U 7OpEhDr ^0ӨBpx$\C ̂@DlDR /pAGkA9)` ?dp(?NlR56Na-ؗ?| d y'?fQiZRZQ>rB}X*Ie1—f#d1 @ b`Np3O5uO /tuj'D9byj Y1i`K KK@@_4MxS#( .H5]^^akhb66?`)hh;1i*UlSnCbp7ۈ+`P`K`H5>F V7!7 ?>09>C*E\#D\7PĊ'9? A,ęD\Fřߑ:9"SSZ`X p./h+YAHX<_􂧋:Dp1'^:Jh˅0ӆ$;+x/+0s`)ʻ" xIWZ@i <.P<%@1 Ppp#3H0xo: K.#1"8ט E#cH {8AHR[A3Ky# ,fϚ JɆ` X;0JHJ (>02#R k ˙I1xbzs?lBӃ73N?:ӿz>4>0C+@M}X r@dw:4dQC p0< 耰y+V0->>'( ;!@hC}݀EP&7xgU ͨ NTP%zP{p5HHBx"`Уm@ Q WXpCfxJd$ҧC>H:l0j܈m ^7h'h@4Xǃp p/+sdGZ0z ,K!%Xٔ׬ՠ`([=dfݿ `a4H\ & ?mʮJ pVr^&\yso?]Y}}0lL;ၚA[,JYm/c\`x<'ciɄ6BhL8h :S`S** > ݂Kd7uՊ [@"[M[7X[&lexeǒ@,[`¥%Z XmBf\!H$ uFhe݈odh؃o]G \ph8(@`-ph|LE $(<(qPHMITK=s6C#(uQCՆ`~cm~1iI#>vc~{8&֊_%0p"~.P^Ra"Fj'aQ>#p&K|?#"#Y>: ;p@TTH, J[KpVu}(&Ug [k֊;h XB(F`N{JP ŐNli$ʙv,ߖI ʣ8قׂPB Wn x8g'o,0MGɨ~n7-)SSjZ@ZHThG]<@䂐 Tf_ 8H0(NM|MM&Ԏʖl %Ȋ Pj^Gfqpq^᪶j>EpJ r&Snr[m)Ͻ!x^,r-r2i L Ӟr~m s9s:7٪9ݨs>7js:J}AVHtE_DU/4ɰk| L LPCuR/uS?R/CuVouWuXuYuZu[u\u]u^u_u`vavb/vc?vdOve_vfovgvhvivjguvljvnvovpwq#3XxW7wxwywzw{@s?_xHB@Y͙Xͅ h7Xwwxxx7}to$h+WxG"xyyzG_xwpB|x7"7ȃ@ZyXC_zozzwrxt$|x$x(/z/z?{O{_p{{w{`BHx1_Wy4e{/|?|_$BHKN+D$|>؆}}/}^YG}_g}?$XU݇!{?W)SI?~O~_~X/`UG Y`:"w":">t~?~/]fTKO0[;,h „ 2l!Ĉ'Rh"6rرA3bR .h{#Μ:w'РB-j(ҤJ2miSPjMb4i)YX|ax-ܸrҭk.޼z틴T{< [e\4h3ТG.m4jƗ RPh\|k8B͎ʗ3o9ҧjabp5 ǏoA8Qo=ӯV_g 8 x zV* J8!Zx!j!;glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/img/iframe.gif000066400000000000000000000011301226600447100237310ustar00rootroot00000000000000GIF89a[{ܒfyuvնZ|X{z`yooSssVvaSs\~psҀTuzڒ\~XzlWychlQqQrdrTupn_z^![,[[76 3P2'>4[VU[[Y@[% EG:#$I.![A OH08=Z[ ,1Q;[ NL[)9F <[&R Ɩ+<݂BdETKXr ,/*d % \rP ;glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/img/pagebreak.gif000066400000000000000000000005051226600447100244140ustar00rootroot00000000000000GIF89ad t]Othh[QB!,d I8ͻ`(d Y8#9.aBp8Uck<AtBU5qC n`U8k u-z 0Ck S@BNNVf7NK_NhJ k =?h  {}ʇ:dYx&sH\ bRN OO 5@`@siL‡#J;glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/img/quicktime.gif000066400000000000000000000004551226600447100244720ustar00rootroot00000000000000GIF89aM6nX brt |)t7 !,@'Ga1pxLtd iCY(D08)d b2HJd#w |yON*#d x x"Bil-/"hj. #;8 > " R  G+D !;glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/img/realmedia.gif000066400000000000000000000006671226600447100244270ustar00rootroot00000000000000GIF89a%RPM@kű@=;.+)c5xHVusq}$pX Jfff!,%' N(?b@hKxy<б$C"A T` ;glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/img/windowsmedia.gif000066400000000000000000000006371226600447100251730ustar00rootroot00000000000000GIF89a?uS-ѩaY0@G愅p+fҎG,LWKqxwwV&^qKNCiiimKx+tnV^K~3fp!BWuWr(a;vTHo9!?," %lhhD 4],G:jͤ\fఄTs5 !*$/  ;-!&1/<'9;=7+; :78(3.2 "+%?>))'=., ? ., B 2%3cB(  ~;glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/js/000077500000000000000000000000001226600447100216445ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/js/about.js000066400000000000000000000042331226600447100233160ustar00rootroot00000000000000tinyMCEPopup.requireLangPack(); function init() { var ed, tcont; tinyMCEPopup.resizeToInnerSize(); ed = tinyMCEPopup.editor; // Give FF some time window.setTimeout(insertHelpIFrame, 10); tcont = document.getElementById('plugintablecontainer'); document.getElementById('plugins_tab').style.display = 'none'; var html = ""; html += ''; html += ''; html += ''; html += ''; html += ''; html += ''; html += ''; html += ''; html += ''; tinymce.each(ed.plugins, function(p, n) { var info; if (!p.getInfo) return; html += ''; info = p.getInfo(); if (info.infourl != null && info.infourl != '') html += ''; else html += ''; if (info.authorurl != null && info.authorurl != '') html += ''; else html += ''; html += ''; html += ''; document.getElementById('plugins_tab').style.display = ''; }); html += ''; html += '
    ' + ed.getLang('advanced_dlg.about_plugin') + '' + ed.getLang('advanced_dlg.about_author') + '' + ed.getLang('advanced_dlg.about_version') + '
    ' + info.longname + '' + info.longname + '' + info.author + '' + info.author + '' + info.version + '
    '; tcont.innerHTML = html; tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion; tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate; } function insertHelpIFrame() { var html; if (tinyMCEPopup.getParam('docs_url')) { html = ''; document.getElementById('iframecontainer').innerHTML = html; document.getElementById('help_tab').style.display = 'block'; document.getElementById('help_tab').setAttribute("aria-hidden", "false"); } } tinyMCEPopup.onInit.add(init); glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/js/anchor.js000066400000000000000000000027321226600447100234600ustar00rootroot00000000000000tinyMCEPopup.requireLangPack(); var AnchorDialog = { init : function(ed) { var action, elm, f = document.forms[0]; this.editor = ed; elm = ed.dom.getParent(ed.selection.getNode(), 'A'); v = ed.dom.getAttrib(elm, 'name') || ed.dom.getAttrib(elm, 'id'); if (v) { this.action = 'update'; f.anchorName.value = v; } f.insert.value = ed.getLang(elm ? 'update' : 'insert'); }, update : function() { var ed = this.editor, elm, name = document.forms[0].anchorName.value, attribName; if (!name || !/^[a-z][a-z0-9\-\_:\.]*$/i.test(name)) { tinyMCEPopup.alert('advanced_dlg.anchor_invalid'); return; } tinyMCEPopup.restoreSelection(); if (this.action != 'update') ed.selection.collapse(1); var aRule = ed.schema.getElementRule('a'); if (!aRule || aRule.attributes.name) { attribName = 'name'; } else { attribName = 'id'; } elm = ed.dom.getParent(ed.selection.getNode(), 'A'); if (elm) { elm.setAttribute(attribName, name); elm[attribName] = name; ed.undoManager.add(); } else { // create with zero-sized nbsp so that in Webkit where anchor is on last line by itself caret cannot be placed after it var attrs = {'class' : 'mceItemAnchor'}; attrs[attribName] = name; ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', attrs, '\uFEFF')); ed.nodeChanged(); } tinyMCEPopup.close(); } }; tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog); glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/js/charmap.js000066400000000000000000000366611226600447100236310ustar00rootroot00000000000000/** * charmap.js * * Copyright 2009, Moxiecode Systems AB * Released under LGPL License. * * License: http://tinymce.moxiecode.com/license * Contributing: http://tinymce.moxiecode.com/contributing */ tinyMCEPopup.requireLangPack(); var charmap = [ [' ', ' ', true, 'no-break space'], ['&', '&', true, 'ampersand'], ['"', '"', true, 'quotation mark'], // finance ['¢', '¢', true, 'cent sign'], ['€', '€', true, 'euro sign'], ['£', '£', true, 'pound sign'], ['¥', '¥', true, 'yen sign'], // signs ['©', '©', true, 'copyright sign'], ['®', '®', true, 'registered sign'], ['™', '™', true, 'trade mark sign'], ['‰', '‰', true, 'per mille sign'], ['µ', 'µ', true, 'micro sign'], ['·', '·', true, 'middle dot'], ['•', '•', true, 'bullet'], ['…', '…', true, 'three dot leader'], ['′', '′', true, 'minutes / feet'], ['″', '″', true, 'seconds / inches'], ['§', '§', true, 'section sign'], ['¶', '¶', true, 'paragraph sign'], ['ß', 'ß', true, 'sharp s / ess-zed'], // quotations ['‹', '‹', true, 'single left-pointing angle quotation mark'], ['›', '›', true, 'single right-pointing angle quotation mark'], ['«', '«', true, 'left pointing guillemet'], ['»', '»', true, 'right pointing guillemet'], ['‘', '‘', true, 'left single quotation mark'], ['’', '’', true, 'right single quotation mark'], ['“', '“', true, 'left double quotation mark'], ['”', '”', true, 'right double quotation mark'], ['‚', '‚', true, 'single low-9 quotation mark'], ['„', '„', true, 'double low-9 quotation mark'], ['<', '<', true, 'less-than sign'], ['>', '>', true, 'greater-than sign'], ['≤', '≤', true, 'less-than or equal to'], ['≥', '≥', true, 'greater-than or equal to'], ['–', '–', true, 'en dash'], ['—', '—', true, 'em dash'], ['¯', '¯', true, 'macron'], ['‾', '‾', true, 'overline'], ['¤', '¤', true, 'currency sign'], ['¦', '¦', true, 'broken bar'], ['¨', '¨', true, 'diaeresis'], ['¡', '¡', true, 'inverted exclamation mark'], ['¿', '¿', true, 'turned question mark'], ['ˆ', 'ˆ', true, 'circumflex accent'], ['˜', '˜', true, 'small tilde'], ['°', '°', true, 'degree sign'], ['−', '−', true, 'minus sign'], ['±', '±', true, 'plus-minus sign'], ['÷', '÷', true, 'division sign'], ['⁄', '⁄', true, 'fraction slash'], ['×', '×', true, 'multiplication sign'], ['¹', '¹', true, 'superscript one'], ['²', '²', true, 'superscript two'], ['³', '³', true, 'superscript three'], ['¼', '¼', true, 'fraction one quarter'], ['½', '½', true, 'fraction one half'], ['¾', '¾', true, 'fraction three quarters'], // math / logical ['ƒ', 'ƒ', true, 'function / florin'], ['∫', '∫', true, 'integral'], ['∑', '∑', true, 'n-ary sumation'], ['∞', '∞', true, 'infinity'], ['√', '√', true, 'square root'], ['∼', '∼', false,'similar to'], ['≅', '≅', false,'approximately equal to'], ['≈', '≈', true, 'almost equal to'], ['≠', '≠', true, 'not equal to'], ['≡', '≡', true, 'identical to'], ['∈', '∈', false,'element of'], ['∉', '∉', false,'not an element of'], ['∋', '∋', false,'contains as member'], ['∏', '∏', true, 'n-ary product'], ['∧', '∧', false,'logical and'], ['∨', '∨', false,'logical or'], ['¬', '¬', true, 'not sign'], ['∩', '∩', true, 'intersection'], ['∪', '∪', false,'union'], ['∂', '∂', true, 'partial differential'], ['∀', '∀', false,'for all'], ['∃', '∃', false,'there exists'], ['∅', '∅', false,'diameter'], ['∇', '∇', false,'backward difference'], ['∗', '∗', false,'asterisk operator'], ['∝', '∝', false,'proportional to'], ['∠', '∠', false,'angle'], // undefined ['´', '´', true, 'acute accent'], ['¸', '¸', true, 'cedilla'], ['ª', 'ª', true, 'feminine ordinal indicator'], ['º', 'º', true, 'masculine ordinal indicator'], ['†', '†', true, 'dagger'], ['‡', '‡', true, 'double dagger'], // alphabetical special chars ['À', 'À', true, 'A - grave'], ['Á', 'Á', true, 'A - acute'], ['Â', 'Â', true, 'A - circumflex'], ['Ã', 'Ã', true, 'A - tilde'], ['Ä', 'Ä', true, 'A - diaeresis'], ['Å', 'Å', true, 'A - ring above'], ['Æ', 'Æ', true, 'ligature AE'], ['Ç', 'Ç', true, 'C - cedilla'], ['È', 'È', true, 'E - grave'], ['É', 'É', true, 'E - acute'], ['Ê', 'Ê', true, 'E - circumflex'], ['Ë', 'Ë', true, 'E - diaeresis'], ['Ì', 'Ì', true, 'I - grave'], ['Í', 'Í', true, 'I - acute'], ['Î', 'Î', true, 'I - circumflex'], ['Ï', 'Ï', true, 'I - diaeresis'], ['Ð', 'Ð', true, 'ETH'], ['Ñ', 'Ñ', true, 'N - tilde'], ['Ò', 'Ò', true, 'O - grave'], ['Ó', 'Ó', true, 'O - acute'], ['Ô', 'Ô', true, 'O - circumflex'], ['Õ', 'Õ', true, 'O - tilde'], ['Ö', 'Ö', true, 'O - diaeresis'], ['Ø', 'Ø', true, 'O - slash'], ['Œ', 'Œ', true, 'ligature OE'], ['Š', 'Š', true, 'S - caron'], ['Ù', 'Ù', true, 'U - grave'], ['Ú', 'Ú', true, 'U - acute'], ['Û', 'Û', true, 'U - circumflex'], ['Ü', 'Ü', true, 'U - diaeresis'], ['Ý', 'Ý', true, 'Y - acute'], ['Ÿ', 'Ÿ', true, 'Y - diaeresis'], ['Þ', 'Þ', true, 'THORN'], ['à', 'à', true, 'a - grave'], ['á', 'á', true, 'a - acute'], ['â', 'â', true, 'a - circumflex'], ['ã', 'ã', true, 'a - tilde'], ['ä', 'ä', true, 'a - diaeresis'], ['å', 'å', true, 'a - ring above'], ['æ', 'æ', true, 'ligature ae'], ['ç', 'ç', true, 'c - cedilla'], ['è', 'è', true, 'e - grave'], ['é', 'é', true, 'e - acute'], ['ê', 'ê', true, 'e - circumflex'], ['ë', 'ë', true, 'e - diaeresis'], ['ì', 'ì', true, 'i - grave'], ['í', 'í', true, 'i - acute'], ['î', 'î', true, 'i - circumflex'], ['ï', 'ï', true, 'i - diaeresis'], ['ð', 'ð', true, 'eth'], ['ñ', 'ñ', true, 'n - tilde'], ['ò', 'ò', true, 'o - grave'], ['ó', 'ó', true, 'o - acute'], ['ô', 'ô', true, 'o - circumflex'], ['õ', 'õ', true, 'o - tilde'], ['ö', 'ö', true, 'o - diaeresis'], ['ø', 'ø', true, 'o slash'], ['œ', 'œ', true, 'ligature oe'], ['š', 'š', true, 's - caron'], ['ù', 'ù', true, 'u - grave'], ['ú', 'ú', true, 'u - acute'], ['û', 'û', true, 'u - circumflex'], ['ü', 'ü', true, 'u - diaeresis'], ['ý', 'ý', true, 'y - acute'], ['þ', 'þ', true, 'thorn'], ['ÿ', 'ÿ', true, 'y - diaeresis'], ['Α', 'Α', true, 'Alpha'], ['Β', 'Β', true, 'Beta'], ['Γ', 'Γ', true, 'Gamma'], ['Δ', 'Δ', true, 'Delta'], ['Ε', 'Ε', true, 'Epsilon'], ['Ζ', 'Ζ', true, 'Zeta'], ['Η', 'Η', true, 'Eta'], ['Θ', 'Θ', true, 'Theta'], ['Ι', 'Ι', true, 'Iota'], ['Κ', 'Κ', true, 'Kappa'], ['Λ', 'Λ', true, 'Lambda'], ['Μ', 'Μ', true, 'Mu'], ['Ν', 'Ν', true, 'Nu'], ['Ξ', 'Ξ', true, 'Xi'], ['Ο', 'Ο', true, 'Omicron'], ['Π', 'Π', true, 'Pi'], ['Ρ', 'Ρ', true, 'Rho'], ['Σ', 'Σ', true, 'Sigma'], ['Τ', 'Τ', true, 'Tau'], ['Υ', 'Υ', true, 'Upsilon'], ['Φ', 'Φ', true, 'Phi'], ['Χ', 'Χ', true, 'Chi'], ['Ψ', 'Ψ', true, 'Psi'], ['Ω', 'Ω', true, 'Omega'], ['α', 'α', true, 'alpha'], ['β', 'β', true, 'beta'], ['γ', 'γ', true, 'gamma'], ['δ', 'δ', true, 'delta'], ['ε', 'ε', true, 'epsilon'], ['ζ', 'ζ', true, 'zeta'], ['η', 'η', true, 'eta'], ['θ', 'θ', true, 'theta'], ['ι', 'ι', true, 'iota'], ['κ', 'κ', true, 'kappa'], ['λ', 'λ', true, 'lambda'], ['μ', 'μ', true, 'mu'], ['ν', 'ν', true, 'nu'], ['ξ', 'ξ', true, 'xi'], ['ο', 'ο', true, 'omicron'], ['π', 'π', true, 'pi'], ['ρ', 'ρ', true, 'rho'], ['ς', 'ς', true, 'final sigma'], ['σ', 'σ', true, 'sigma'], ['τ', 'τ', true, 'tau'], ['υ', 'υ', true, 'upsilon'], ['φ', 'φ', true, 'phi'], ['χ', 'χ', true, 'chi'], ['ψ', 'ψ', true, 'psi'], ['ω', 'ω', true, 'omega'], // symbols ['ℵ', 'ℵ', false,'alef symbol'], ['ϖ', 'ϖ', false,'pi symbol'], ['ℜ', 'ℜ', false,'real part symbol'], ['ϑ','ϑ', false,'theta symbol'], ['ϒ', 'ϒ', false,'upsilon - hook symbol'], ['℘', '℘', false,'Weierstrass p'], ['ℑ', 'ℑ', false,'imaginary part'], // arrows ['←', '←', true, 'leftwards arrow'], ['↑', '↑', true, 'upwards arrow'], ['→', '→', true, 'rightwards arrow'], ['↓', '↓', true, 'downwards arrow'], ['↔', '↔', true, 'left right arrow'], ['↵', '↵', false,'carriage return'], ['⇐', '⇐', false,'leftwards double arrow'], ['⇑', '⇑', false,'upwards double arrow'], ['⇒', '⇒', false,'rightwards double arrow'], ['⇓', '⇓', false,'downwards double arrow'], ['⇔', '⇔', false,'left right double arrow'], ['∴', '∴', false,'therefore'], ['⊂', '⊂', false,'subset of'], ['⊃', '⊃', false,'superset of'], ['⊄', '⊄', false,'not a subset of'], ['⊆', '⊆', false,'subset of or equal to'], ['⊇', '⊇', false,'superset of or equal to'], ['⊕', '⊕', false,'circled plus'], ['⊗', '⊗', false,'circled times'], ['⊥', '⊥', false,'perpendicular'], ['⋅', '⋅', false,'dot operator'], ['⌈', '⌈', false,'left ceiling'], ['⌉', '⌉', false,'right ceiling'], ['⌊', '⌊', false,'left floor'], ['⌋', '⌋', false,'right floor'], ['⟨', '〈', false,'left-pointing angle bracket'], ['⟩', '〉', false,'right-pointing angle bracket'], ['◊', '◊', true, 'lozenge'], ['♠', '♠', true, 'black spade suit'], ['♣', '♣', true, 'black club suit'], ['♥', '♥', true, 'black heart suit'], ['♦', '♦', true, 'black diamond suit'], [' ', ' ', false,'en space'], [' ', ' ', false,'em space'], [' ', ' ', false,'thin space'], ['‌', '‌', false,'zero width non-joiner'], ['‍', '‍', false,'zero width joiner'], ['‎', '‎', false,'left-to-right mark'], ['‏', '‏', false,'right-to-left mark'], ['­', '­', false,'soft hyphen'] ]; tinyMCEPopup.onInit.add(function() { tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML()); addKeyboardNavigation(); }); function addKeyboardNavigation(){ var tableElm, cells, settings; cells = tinyMCEPopup.dom.select("a.charmaplink", "charmapgroup"); settings ={ root: "charmapgroup", items: cells }; cells[0].tabindex=0; tinyMCEPopup.dom.addClass(cells[0], "mceFocus"); if (tinymce.isGecko) { cells[0].focus(); } else { setTimeout(function(){ cells[0].focus(); }, 100); } tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom); } function renderCharMapHTML() { var charsPerRow = 20, tdWidth=20, tdHeight=20, i; var html = '
    '+ ''; var cols=-1; for (i=0; i' + '' + charmap[i][1] + ''; if ((cols+1) % charsPerRow == 0) html += ''; } } if (cols % charsPerRow > 0) { var padd = charsPerRow - (cols % charsPerRow); for (var i=0; i '; } html += '
    '; html = html.replace(/<\/tr>/g, ''); return html; } function insertChar(chr) { tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';'); // Refocus in window if (tinyMCEPopup.isWindow) window.focus(); tinyMCEPopup.editor.focus(); tinyMCEPopup.close(); } function previewChar(codeA, codeB, codeN) { var elmA = document.getElementById('codeA'); var elmB = document.getElementById('codeB'); var elmV = document.getElementById('codeV'); var elmN = document.getElementById('codeN'); if (codeA=='#160;') { elmV.innerHTML = '__'; } else { elmV.innerHTML = '&' + codeA; } elmB.innerHTML = '&' + codeA; elmA.innerHTML = '&' + codeB; elmN.innerHTML = codeN; } glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/js/color_picker.js000066400000000000000000000336061226600447100246650ustar00rootroot00000000000000tinyMCEPopup.requireLangPack(); var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false; var colors = [ "#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033", "#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099", "#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff", "#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033", "#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399", "#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff", "#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333", "#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399", "#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff", "#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633", "#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699", "#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff", "#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633", "#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999", "#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff", "#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933", "#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999", "#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff", "#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33", "#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99", "#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff", "#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33", "#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99", "#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff", "#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33", "#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99", "#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff" ]; var named = { '#F0F8FF':'Alice Blue','#FAEBD7':'Antique White','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige', '#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'Blanched Almond','#0000FF':'Blue','#8A2BE2':'Blue Violet','#A52A2A':'Brown', '#DEB887':'Burly Wood','#5F9EA0':'Cadet Blue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'Cornflower Blue', '#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'Dark Blue','#008B8B':'Dark Cyan','#B8860B':'Dark Golden Rod', '#A9A9A9':'Dark Gray','#A9A9A9':'Dark Grey','#006400':'Dark Green','#BDB76B':'Dark Khaki','#8B008B':'Dark Magenta','#556B2F':'Dark Olive Green', '#FF8C00':'Darkorange','#9932CC':'Dark Orchid','#8B0000':'Dark Red','#E9967A':'Dark Salmon','#8FBC8F':'Dark Sea Green','#483D8B':'Dark Slate Blue', '#2F4F4F':'Dark Slate Gray','#2F4F4F':'Dark Slate Grey','#00CED1':'Dark Turquoise','#9400D3':'Dark Violet','#FF1493':'Deep Pink','#00BFFF':'Deep Sky Blue', '#696969':'Dim Gray','#696969':'Dim Grey','#1E90FF':'Dodger Blue','#B22222':'Fire Brick','#FFFAF0':'Floral White','#228B22':'Forest Green', '#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'Ghost White','#FFD700':'Gold','#DAA520':'Golden Rod','#808080':'Gray','#808080':'Grey', '#008000':'Green','#ADFF2F':'Green Yellow','#F0FFF0':'Honey Dew','#FF69B4':'Hot Pink','#CD5C5C':'Indian Red','#4B0082':'Indigo','#FFFFF0':'Ivory', '#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'Lavender Blush','#7CFC00':'Lawn Green','#FFFACD':'Lemon Chiffon','#ADD8E6':'Light Blue', '#F08080':'Light Coral','#E0FFFF':'Light Cyan','#FAFAD2':'Light Golden Rod Yellow','#D3D3D3':'Light Gray','#D3D3D3':'Light Grey','#90EE90':'Light Green', '#FFB6C1':'Light Pink','#FFA07A':'Light Salmon','#20B2AA':'Light Sea Green','#87CEFA':'Light Sky Blue','#778899':'Light Slate Gray','#778899':'Light Slate Grey', '#B0C4DE':'Light Steel Blue','#FFFFE0':'Light Yellow','#00FF00':'Lime','#32CD32':'Lime Green','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon', '#66CDAA':'Medium Aqua Marine','#0000CD':'Medium Blue','#BA55D3':'Medium Orchid','#9370D8':'Medium Purple','#3CB371':'Medium Sea Green','#7B68EE':'Medium Slate Blue', '#00FA9A':'Medium Spring Green','#48D1CC':'Medium Turquoise','#C71585':'Medium Violet Red','#191970':'Midnight Blue','#F5FFFA':'Mint Cream','#FFE4E1':'Misty Rose','#FFE4B5':'Moccasin', '#FFDEAD':'Navajo White','#000080':'Navy','#FDF5E6':'Old Lace','#808000':'Olive','#6B8E23':'Olive Drab','#FFA500':'Orange','#FF4500':'Orange Red','#DA70D6':'Orchid', '#EEE8AA':'Pale Golden Rod','#98FB98':'Pale Green','#AFEEEE':'Pale Turquoise','#D87093':'Pale Violet Red','#FFEFD5':'Papaya Whip','#FFDAB9':'Peach Puff', '#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'Powder Blue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'Rosy Brown','#4169E1':'Royal Blue', '#8B4513':'Saddle Brown','#FA8072':'Salmon','#F4A460':'Sandy Brown','#2E8B57':'Sea Green','#FFF5EE':'Sea Shell','#A0522D':'Sienna','#C0C0C0':'Silver', '#87CEEB':'Sky Blue','#6A5ACD':'Slate Blue','#708090':'Slate Gray','#708090':'Slate Grey','#FFFAFA':'Snow','#00FF7F':'Spring Green', '#4682B4':'Steel Blue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet', '#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'White Smoke','#FFFF00':'Yellow','#9ACD32':'Yellow Green' }; var namedLookup = {}; function init() { var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')), key, value; tinyMCEPopup.resizeToInnerSize(); generatePicker(); generateWebColors(); generateNamedColors(); if (inputColor) { changeFinalColor(inputColor); col = convertHexToRGB(inputColor); if (col) updateLight(col.r, col.g, col.b); } for (key in named) { value = named[key]; namedLookup[value.replace(/\s+/, '').toLowerCase()] = key.replace(/#/, '').toLowerCase(); } } function toHexColor(color) { var matches, red, green, blue, toInt = parseInt; function hex(value) { value = parseInt(value).toString(16); return value.length > 1 ? value : '0' + value; // Padd with leading zero }; color = tinymce.trim(color); color = color.replace(/^[#]/, '').toLowerCase(); // remove leading '#' color = namedLookup[color] || color; matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/.exec(color); if (matches) { red = toInt(matches[1]); green = toInt(matches[2]); blue = toInt(matches[3]); } else { matches = /^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/.exec(color); if (matches) { red = toInt(matches[1], 16); green = toInt(matches[2], 16); blue = toInt(matches[3], 16); } else { matches = /^([0-9a-f])([0-9a-f])([0-9a-f])$/.exec(color); if (matches) { red = toInt(matches[1] + matches[1], 16); green = toInt(matches[2] + matches[2], 16); blue = toInt(matches[3] + matches[3], 16); } else { return ''; } } } return '#' + hex(red) + hex(green) + hex(blue); } function insertAction() { var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func'); var hexColor = toHexColor(color); if (hexColor === '') { var text = tinyMCEPopup.editor.getLang('advanced_dlg.invalid_color_value'); tinyMCEPopup.alert(text + ': ' + color); } else { tinyMCEPopup.restoreSelection(); if (f) f(hexColor); tinyMCEPopup.close(); } } function showColor(color, name) { if (name) document.getElementById("colorname").innerHTML = name; document.getElementById("preview").style.backgroundColor = color; document.getElementById("color").value = color.toUpperCase(); } function convertRGBToHex(col) { var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi"); if (!col) return col; var rgb = col.replace(re, "$1,$2,$3").split(','); if (rgb.length == 3) { r = parseInt(rgb[0]).toString(16); g = parseInt(rgb[1]).toString(16); b = parseInt(rgb[2]).toString(16); r = r.length == 1 ? '0' + r : r; g = g.length == 1 ? '0' + g : g; b = b.length == 1 ? '0' + b : b; return "#" + r + g + b; } return col; } function convertHexToRGB(col) { if (col.indexOf('#') != -1) { col = col.replace(new RegExp('[^0-9A-F]', 'gi'), ''); r = parseInt(col.substring(0, 2), 16); g = parseInt(col.substring(2, 4), 16); b = parseInt(col.substring(4, 6), 16); return {r : r, g : g, b : b}; } return null; } function generatePicker() { var el = document.getElementById('light'), h = '', i; for (i = 0; i < detail; i++){ h += '
    '; } el.innerHTML = h; } function generateWebColors() { var el = document.getElementById('webcolors'), h = '', i; if (el.className == 'generated') return; // TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby. h += ''; el.innerHTML = h; el.className = 'generated'; paintCanvas(el); enableKeyboardNavigation(el.firstChild); } function paintCanvas(el) { tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) { var context; if (canvas.getContext && (context = canvas.getContext("2d"))) { context.fillStyle = canvas.getAttribute('data-color'); context.fillRect(0, 0, 10, 10); } }); } function generateNamedColors() { var el = document.getElementById('namedcolors'), h = '', n, v, i = 0; if (el.className == 'generated') return; for (n in named) { v = named[n]; h += ''; if (tinyMCEPopup.editor.forcedHighContrastMode) { h += ''; } h += ''; h += ''; i++; } el.innerHTML = h; el.className = 'generated'; paintCanvas(el); enableKeyboardNavigation(el); } function enableKeyboardNavigation(el) { tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', { root: el, items: tinyMCEPopup.dom.select('a', el) }, tinyMCEPopup.dom); } function dechex(n) { return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16); } function computeColor(e) { var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB, pos = tinyMCEPopup.dom.getPos(e.target); x = e.offsetX ? e.offsetX : (e.target ? e.clientX - pos.x : 0); y = e.offsetY ? e.offsetY : (e.target ? e.clientY - pos.y : 0); partWidth = document.getElementById('colors').width / 6; partDetail = detail / 2; imHeight = document.getElementById('colors').height; r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255; g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth); b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth); coef = (imHeight - y) / imHeight; r = 128 + (r - 128) * coef; g = 128 + (g - 128) * coef; b = 128 + (b - 128) * coef; changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b)); updateLight(r, g, b); } function updateLight(r, g, b) { var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color; for (i=0; i=0) && (i'); }, init : function() { var f = document.forms[0], ed = tinyMCEPopup.editor; // Setup browse button document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); if (isVisible('srcbrowser')) document.getElementById('src').style.width = '180px'; e = ed.selection.getNode(); this.fillFileList('image_list', tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList')); if (e.nodeName == 'IMG') { f.src.value = ed.dom.getAttrib(e, 'src'); f.alt.value = ed.dom.getAttrib(e, 'alt'); f.border.value = this.getAttrib(e, 'border'); f.vspace.value = this.getAttrib(e, 'vspace'); f.hspace.value = this.getAttrib(e, 'hspace'); f.width.value = ed.dom.getAttrib(e, 'width'); f.height.value = ed.dom.getAttrib(e, 'height'); f.insert.value = ed.getLang('update'); this.styleVal = ed.dom.getAttrib(e, 'style'); selectByValue(f, 'image_list', f.src.value); selectByValue(f, 'align', this.getAttrib(e, 'align')); this.updateStyle(); } }, fillFileList : function(id, l) { var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; l = typeof(l) === 'function' ? l() : window[l]; if (l && l.length > 0) { lst.options[lst.options.length] = new Option('', ''); tinymce.each(l, function(o) { lst.options[lst.options.length] = new Option(o[0], o[1]); }); } else dom.remove(dom.getParent(id, 'tr')); }, update : function() { var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el; tinyMCEPopup.restoreSelection(); if (f.src.value === '') { if (ed.selection.getNode().nodeName == 'IMG') { ed.dom.remove(ed.selection.getNode()); ed.execCommand('mceRepaint'); } tinyMCEPopup.close(); return; } if (!ed.settings.inline_styles) { args = tinymce.extend(args, { vspace : nl.vspace.value, hspace : nl.hspace.value, border : nl.border.value, align : getSelectValue(f, 'align') }); } else args.style = this.styleVal; tinymce.extend(args, { src : f.src.value.replace(/ /g, '%20'), alt : f.alt.value, width : f.width.value, height : f.height.value }); el = ed.selection.getNode(); if (el && el.nodeName == 'IMG') { ed.dom.setAttribs(el, args); tinyMCEPopup.editor.execCommand('mceRepaint'); tinyMCEPopup.editor.focus(); } else { tinymce.each(args, function(value, name) { if (value === "") { delete args[name]; } }); ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1}); ed.undoManager.add(); } tinyMCEPopup.close(); }, updateStyle : function() { var dom = tinyMCEPopup.dom, st = {}, v, f = document.forms[0]; if (tinyMCEPopup.editor.settings.inline_styles) { tinymce.each(tinyMCEPopup.dom.parseStyle(this.styleVal), function(value, key) { st[key] = value; }); // Handle align v = getSelectValue(f, 'align'); if (v) { if (v == 'left' || v == 'right') { st['float'] = v; delete st['vertical-align']; } else { st['vertical-align'] = v; delete st['float']; } } else { delete st['float']; delete st['vertical-align']; } // Handle border v = f.border.value; if (v || v == '0') { if (v == '0') st['border'] = '0'; else st['border'] = v + 'px solid black'; } else delete st['border']; // Handle hspace v = f.hspace.value; if (v) { delete st['margin']; st['margin-left'] = v + 'px'; st['margin-right'] = v + 'px'; } else { delete st['margin-left']; delete st['margin-right']; } // Handle vspace v = f.vspace.value; if (v) { delete st['margin']; st['margin-top'] = v + 'px'; st['margin-bottom'] = v + 'px'; } else { delete st['margin-top']; delete st['margin-bottom']; } // Merge st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st), 'img'); this.styleVal = dom.serializeStyle(st, 'img'); } }, getAttrib : function(e, at) { var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; if (ed.settings.inline_styles) { switch (at) { case 'align': if (v = dom.getStyle(e, 'float')) return v; if (v = dom.getStyle(e, 'vertical-align')) return v; break; case 'hspace': v = dom.getStyle(e, 'margin-left') v2 = dom.getStyle(e, 'margin-right'); if (v && v == v2) return parseInt(v.replace(/[^0-9]/g, '')); break; case 'vspace': v = dom.getStyle(e, 'margin-top') v2 = dom.getStyle(e, 'margin-bottom'); if (v && v == v2) return parseInt(v.replace(/[^0-9]/g, '')); break; case 'border': v = 0; tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { sv = dom.getStyle(e, 'border-' + sv + '-width'); // False or not the same as prev if (!sv || (sv != v && v !== 0)) { v = 0; return false; } if (sv) v = sv; }); if (v) return parseInt(v.replace(/[^0-9]/g, '')); break; } } if (v = dom.getAttrib(e, at)) return v; return ''; }, resetImageData : function() { var f = document.forms[0]; f.width.value = f.height.value = ""; }, updateImageData : function() { var f = document.forms[0], t = ImageDialog; if (f.width.value == "") f.width.value = t.preloadImg.width; if (f.height.value == "") f.height.value = t.preloadImg.height; }, getImageData : function() { var f = document.forms[0]; this.preloadImg = new Image(); this.preloadImg.onload = this.updateImageData; this.preloadImg.onerror = this.resetImageData; this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value); } }; ImageDialog.preInit(); tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/js/link.js000066400000000000000000000115231226600447100231410ustar00rootroot00000000000000tinyMCEPopup.requireLangPack(); var LinkDialog = { preInit : function() { var url; if (url = tinyMCEPopup.getParam("external_link_list_url")) document.write(''); }, init : function() { var f = document.forms[0], ed = tinyMCEPopup.editor; // Setup browse button document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link'); if (isVisible('hrefbrowser')) document.getElementById('href').style.width = '180px'; this.fillClassList('class_list'); this.fillFileList('link_list', 'tinyMCELinkList'); this.fillTargetList('target_list'); if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) { f.href.value = ed.dom.getAttrib(e, 'href'); f.linktitle.value = ed.dom.getAttrib(e, 'title'); f.insert.value = ed.getLang('update'); selectByValue(f, 'link_list', f.href.value); selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target')); selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class')); } }, update : function() { var f = document.forms[0], ed = tinyMCEPopup.editor, e, b, href = f.href.value.replace(/ /g, '%20'); tinyMCEPopup.restoreSelection(); e = ed.dom.getParent(ed.selection.getNode(), 'A'); // Remove element if there is no href if (!f.href.value) { if (e) { b = ed.selection.getBookmark(); ed.dom.remove(e, 1); ed.selection.moveToBookmark(b); tinyMCEPopup.execCommand("mceEndUndoLevel"); tinyMCEPopup.close(); return; } } // Create new anchor elements if (e == null) { ed.getDoc().execCommand("unlink", false, null); tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); tinymce.each(ed.dom.select("a"), function(n) { if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') { e = n; ed.dom.setAttribs(e, { href : href, title : f.linktitle.value, target : f.target_list ? getSelectValue(f, "target_list") : null, 'class' : f.class_list ? getSelectValue(f, "class_list") : null }); } }); } else { ed.dom.setAttribs(e, { href : href, title : f.linktitle.value }); if (f.target_list) { ed.dom.setAttrib(e, 'target', getSelectValue(f, "target_list")); } if (f.class_list) { ed.dom.setAttrib(e, 'class', getSelectValue(f, "class_list")); } } // Don't move caret if selection was image if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') { ed.focus(); ed.selection.select(e); ed.selection.collapse(0); tinyMCEPopup.storeSelection(); } tinyMCEPopup.execCommand("mceEndUndoLevel"); tinyMCEPopup.close(); }, checkPrefix : function(n) { if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email'))) n.value = 'mailto:' + n.value; if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external'))) n.value = 'http://' + n.value; }, fillFileList : function(id, l) { var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; l = window[l]; if (l && l.length > 0) { lst.options[lst.options.length] = new Option('', ''); tinymce.each(l, function(o) { lst.options[lst.options.length] = new Option(o[0], o[1]); }); } else dom.remove(dom.getParent(id, 'tr')); }, fillClassList : function(id) { var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { cl = []; tinymce.each(v.split(';'), function(v) { var p = v.split('='); cl.push({'title' : p[0], 'class' : p[1]}); }); } else cl = tinyMCEPopup.editor.dom.getClasses(); if (cl.length > 0) { lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); tinymce.each(cl, function(o) { lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); }); } else dom.remove(dom.getParent(id, 'tr')); }, fillTargetList : function(id) { var dom = tinyMCEPopup.dom, lst = dom.get(id), v; lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self'); lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank'); if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) { tinymce.each(v.split(','), function(v) { v = v.split('='); lst.options[lst.options.length] = new Option(v[0], v[1]); }); } } }; LinkDialog.preInit(); tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog); glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/js/source_editor.js000066400000000000000000000032361226600447100250540ustar00rootroot00000000000000tinyMCEPopup.requireLangPack(); tinyMCEPopup.onInit.add(onLoadInit); function saveContent() { tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true}); tinyMCEPopup.close(); } function onLoadInit() { tinyMCEPopup.resizeToInnerSize(); // Remove Gecko spellchecking if (tinymce.isGecko) document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck"); document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true}); if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) { turnWrapOn(); document.getElementById('wraped').checked = true; } resizeInputs(); } function setWrap(val) { var v, n, s = document.getElementById('htmlSource'); s.wrap = val; if (!tinymce.isIE) { v = s.value; n = s.cloneNode(false); n.setAttribute("wrap", val); s.parentNode.replaceChild(n, s); n.value = v; } } function setWhiteSpaceCss(value) { var el = document.getElementById('htmlSource'); tinymce.DOM.setStyle(el, 'white-space', value); } function turnWrapOff() { if (tinymce.isWebKit) { setWhiteSpaceCss('pre'); } else { setWrap('off'); } } function turnWrapOn() { if (tinymce.isWebKit) { setWhiteSpaceCss('pre-wrap'); } else { setWrap('soft'); } } function toggleWordWrap(elm) { if (elm.checked) { turnWrapOn(); } else { turnWrapOff(); } } function resizeInputs() { var vp = tinyMCEPopup.dom.getViewPort(window), el; el = document.getElementById('htmlSource'); if (el) { el.style.width = (vp.w - 20) + 'px'; el.style.height = (vp.h - 65) + 'px'; } } glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/000077500000000000000000000000001226600447100223345ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/ar.js000066400000000000000000000035501226600447100232770ustar00rootroot00000000000000tinyMCE.addI18n('ar.advanced',{ style_select:"Styles", font_size:"Font size", fontdefault:"Font family", block:"Format", paragraph:"Paragraph", div:"Div", address:"Address", pre:"Preformatted", h1:"Heading 1", h2:"Heading 2", h3:"Heading 3", h4:"Heading 4", h5:"Heading 5", h6:"Heading 6", blockquote:"Blockquote", code:"Code", samp:"Code sample", dt:"Definition term ", dd:"Definition description", bold_desc:"Bold (Ctrl+B)", italic_desc:"Italic (Ctrl+I)", underline_desc:"Underline (Ctrl+U)", striketrough_desc:"Strikethrough", justifyleft_desc:"Align left", justifycenter_desc:"Align center", justifyright_desc:"Align right", justifyfull_desc:"Align full", bullist_desc:"Unordered list", numlist_desc:"Ordered list", outdent_desc:"Outdent", indent_desc:"Indent", undo_desc:"Undo (Ctrl+Z)", redo_desc:"Redo (Ctrl+Y)", link_desc:"Insert/edit link", unlink_desc:"Unlink", image_desc:"Insert/edit image", cleanup_desc:"Cleanup messy code", code_desc:"Edit HTML Source", sub_desc:"Subscript", sup_desc:"Superscript", hr_desc:"Insert horizontal ruler", removeformat_desc:"Remove formatting", custom1_desc:"Your custom description here", forecolor_desc:"Select text color", backcolor_desc:"Select background color", charmap_desc:"Insert custom character", visualaid_desc:"Toggle guidelines/invisible elements", anchor_desc:"Insert/edit anchor", cut_desc:"Cut", copy_desc:"Copy", paste_desc:"Paste", image_props_desc:"Image properties", newdocument_desc:"New document", help_desc:"Help", blockquote_desc:"Blockquote", clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?", path:"Path", newdocument:"Are you sure you want clear all contents?", toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X", more_colors:"More colors" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/ar_dlg.js000066400000000000000000000032741226600447100241300ustar00rootroot00000000000000tinyMCE.addI18n('ar.advanced_dlg',{ about_title:"About TinyMCE", about_general:"About", about_help:"Help", about_license:"License", about_plugins:"Plugins", about_plugin:"Plugin", about_author:"Author", about_version:"Version", about_loaded:"Loaded plugins", anchor_title:"Insert/edit anchor", anchor_name:"Anchor name", code_title:"HTML Source Editor", code_wordwrap:"Word wrap", colorpicker_title:"Select a color", colorpicker_picker_tab:"Picker", colorpicker_picker_title:"Color picker", colorpicker_palette_tab:"Palette", colorpicker_palette_title:"Palette colors", colorpicker_named_tab:"Named", colorpicker_named_title:"Named colors", colorpicker_color:"Color:", colorpicker_name:"Name:", charmap_title:"Select custom character", image_title:"Insert/edit image", image_src:"Image URL", image_alt:"Image description", image_list:"Image list", image_border:"Border", image_dimensions:"Dimensions", image_vspace:"Vertical space", image_hspace:"Horizontal space", image_align:"Alignment", image_align_baseline:"Baseline", image_align_top:"Top", image_align_middle:"Middle", image_align_bottom:"Bottom", image_align_texttop:"Text top", image_align_textbottom:"Text bottom", image_align_left:"Left", image_align_right:"Right", link_title:"Insert/edit link", link_url:"Link URL", link_target:"Target", link_target_same:"Open link in the same window", link_target_blank:"Open link in a new window", link_titlefield:"Title", link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", link_list:"Link list" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/az.js000066400000000000000000000054571226600447100233170ustar00rootroot00000000000000tinyMCE.addI18n('az.advanced',{ style_select:"Still\u0259r", font_size:"\u015Erift \u00F6l\u00E7\u00FC\u015F\u00FC", fontdefault:"\u015Erift", block:"Format", paragraph:"Abzas", div:"B\u00F6lm\u0259", address:"\u00DCnvan", pre:"Formatlanm\u0131\u015F m\u0259tn", h1:"Ba\u015Fl\u0131q 1", h2:"Ba\u015Fl\u0131q 2", h3:"Ba\u015Fl\u0131q 3", h4:"Ba\u015Fl\u0131q 4", h5:"Ba\u015Fl\u0131q 5", h6:"Ba\u015Fl\u0131q 6", blockquote:"Sitat bloku", code:"Kod", samp:"Kod n\u00FCmun\u0259si", dt:"M\u00FC\u0259yy\u0259n edil\u0259n termin", dd:"Terminin m\u00FC\u0259yy\u0259n edilm\u0259si", bold_desc:"Yar\u0131qal\u0131n (Ctrl+B)", italic_desc:"Kursiv (Ctrl+I)", underline_desc:"Altdan x\u0259tt (Ctrl+U)", striketrough_desc:"Qaralanm\u0131\u015F", justifyleft_desc:"Soldan d\u00FCzl\u0259ndir", justifycenter_desc:"M\u0259rk\u0259z\u0259 d\u00FCzl\u0259ndir", justifyright_desc:"Sa\u011Fdan d\u00FCzl\u0259ndir", justifyfull_desc:"Enin\u0259 d\u00FCzl\u0259ndir", bullist_desc:"Qeyd edilmi\u015F siyah\u0131", numlist_desc:"N\u00F6mr\u0259l\u0259nmi\u015F siyah\u0131", outdent_desc:"Bo\u015F yeri ki\u00E7ilt", indent_desc:"Bo\u015F yeri b\u00F6y\u00FCt", undo_desc:"L\u0259\u011Fv et (Ctrl+Z)", redo_desc:"T\u0259krarla (Ctrl+Y)", link_desc:"\u018Flav\u0259 et/ke\u00E7idi redakt\u0259 et", unlink_desc:"Ke\u00E7idi sil", image_desc:"\u018Flav\u0259 et/\u015F\u0259kili redakt\u0259 et", cleanup_desc:"\u018Fyri kodu t\u0259mizl\u0259", code_desc:"HTML-m\u0259nb\u0259ni redakt\u0259 et", sub_desc:"A\u015Fa\u011F\u0131 indeks", sup_desc:"Yuxar\u0131 indeks", hr_desc:"\u00DCf\u00FCqi x\u0259tt \u0259lav\u0259 et", removeformat_desc:"Formatlaman\u0131 l\u0259\u011Fv et", custom1_desc:"\u00D6z t\u0259svirinizi daxil edin", forecolor_desc:"M\u0259tnin r\u0259ngini se\u00E7", backcolor_desc:"Fonun r\u0259ngini se\u00E7", charmap_desc:"X\u00FCsusi simvol \u0259lav\u0259 et", visualaid_desc:"G\u00F6nd\u0259ril\u0259n/g\u00F6r\u00FCnm\u0259z elementl\u0259ri yand\u0131r/s\u00F6nd\u00FCr", anchor_desc:"L\u00F6vb\u0259r \u0259lav\u0259/redakt\u0259 et", cut_desc:"K\u0259s", copy_desc:"Kopyala", paste_desc:"\u018Flav\u0259 et", image_props_desc:"\u015E\u0259kil x\u00FCsusiyy\u0259ti", newdocument_desc:"Yeni s\u0259n\u0259d", help_desc:"K\u00F6m\u0259k", blockquote_desc:"Sitat bloku", clipboard_msg:"Kopyalama/\u018Flav\u0259 et Mozilla v\u0259 Firefox-da i\u015Fl\u0259mir.\r\nN\u0259 ba\u015F verdiyi haqda daha \u0259trafl\u0131 \u00F6yr\u0259nm\u0259k ist\u0259yirsiniz?", path:"Yol", newdocument:"\u0130\u00E7ind\u0259kil\u0259ri tam t\u0259mizl\u0259m\u0259kd\u0259 \u0259minsiniz?", toolbar_focus:"Alt+Q - al\u0259t d\u00FCym\u0259l\u0259rin\u0259 ke\u00E7, Alt-Z - redaktoruna ke\u00E7, Alt-X - elementl\u0259r yoluna ke\u00E7", more_colors:"Daha \u00E7ox r\u0259ng", image_delta_width:"65" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/az_dlg.js000066400000000000000000000047471226600447100241460ustar00rootroot00000000000000tinyMCE.addI18n('az.advanced_dlg',{ about_title:"TinyMCE haqda", about_general:"Proqram haqq\u0131nda", about_help:"K\u00F6m\u0259k", about_license:"Lisenziya", about_plugins:"Plaginl\u0259r", about_plugin:"Plaginl\u0259r", about_author:"M\u00FC\u0259llif", about_version:"Versiya", about_loaded:"Y\u00FCkl\u0259nil\u0259n plaginl\u0259r", anchor_title:"L\u00F6bv\u0259r \u0259lav\u0259/redakt\u0259 et", anchor_name:"L\u00F6vb\u0259r ad\u0131", code_title:"HTML-m\u0259nb\u0259 redaktoru", code_wordwrap:"S\u00F6zl\u0259rin s\u0259tr\u0259 ke\u00E7idi", colorpicker_title:"R\u0259ngi se\u00E7", colorpicker_picker_tab:"Se\u00E7im", colorpicker_picker_title:"R\u0259ng se\u00E7imi", colorpicker_palette_tab:"Palitra", colorpicker_palette_title:"Palitra r\u0259ngl\u0259ri", colorpicker_named_tab:"Adland\u0131r\u0131lm\u0131\u015F", colorpicker_named_title:"Adland\u0131r\u0131lm\u0131\u015F r\u0259ngl\u0259r", colorpicker_color:"R\u0259ng:", colorpicker_name:"Ad\u0131:", charmap_title:"X\u00FCsusi simvol se\u00E7in", image_title:"\u015E\u0259kli \u0259lav\u0259/redakt\u0259 et", image_src:"\u015E\u0259klin \u00FCnvan\u0131", image_alt:"\u015E\u0259klin t\u0259sviri", image_list:"\u015E\u0259kil siyah\u0131s\u0131", image_border:"S\u0259rh\u0259d", image_dimensions:"\u00D6l\u00E7\u00FCl\u0259r", image_vspace:"\u015Eaquli f\u0259za", image_hspace:"\u00DCf\u00FCqi f\u0259za", image_align:"Tarazla\u015Fd\u0131r", image_align_baseline:"Bazis liniyas\u0131 \u00FCzr\u0259", image_align_top:"Yuxar\u0131 il\u0259", image_align_middle:"M\u0259rk\u0259z il\u0259", image_align_bottom:"A\u015Fa\u011F\u0131 il\u0259", image_align_texttop:"M\u0259tn yuxar\u0131s\u0131 il\u0259", image_align_textbottom:"M\u0259tn a\u015Fa\u011F\u0131s\u0131 \u00FCzr\u0259", image_align_left:"Sola", image_align_right:"Sa\u011Fa", link_title:"Ke\u00E7idi \u0259lav\u0259/redakt\u0259 et", link_url:"Ke\u00E7id \u00FCnvan\u0131", link_target:"H\u0259d\u0259f", link_target_same:"Ke\u00E7idi h\u0259min p\u0259nc\u0259r\u0259d\u0259 a\u00E7", link_target_blank:"Ke\u00E7idi yeni p\u0259nc\u0259r\u0259d\u0259 a\u00E7", link_titlefield:"Ad\u0131", link_is_email:"Daxil edil\u0259n \u00FCnvan e-po\u00E7ta b\u0259nz\u0259yir. mailto: prefiksini \u0259lav\u0259 etm\u0259k ist\u0259yirsiniz?", link_is_external:"Daxil edil\u0259n \u00FCnvan xarici ke\u00E7id\u0259 b\u0259nz\u0259yir. http:// prefiksini \u0259lav\u0259 etm\u0259k ist\u0259yirsiniz?", link_list:"Ke\u00E7idl\u0259r siyah\u0131s\u0131" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/be.js000066400000000000000000000152041226600447100232620ustar00rootroot00000000000000tinyMCE.addI18n('be.advanced',{ style_select:"\u0421\u0442\u044B\u043B\u0456", font_size:"\u041F\u0430\u043C\u0435\u0440 \u0448\u0440\u044B\u0444\u0442\u0430", fontdefault:"\u0428\u0440\u044B\u0444\u0442", block:"\u0424\u0430\u0440\u043C\u0430\u0442", paragraph:"\u0410\u0431\u0437\u0430\u0446", div:"\u041F\u0430\u0434\u0437\u0435\u043B", address:"\u0410\u0434\u0440\u0430\u0441", pre:"\u0410\u0434\u0444\u0430\u0440\u043C\u0430\u0442\u0430\u0432\u0430\u043D\u044B \u0442\u044D\u043A\u0441\u0442", h1:"\u0417\u0430\u0433\u0430\u043B\u043E\u0432\u0430\u043A 1", h2:"\u0417\u0430\u0433\u0430\u043B\u043E\u0432\u0430\u043A 2", h3:"\u0417\u0430\u0433\u0430\u043B\u043E\u0432\u0430\u043A 3", h4:"\u0417\u0430\u0433\u0430\u043B\u043E\u0432\u0430\u043A 4", h5:"\u0417\u0430\u0433\u0430\u043B\u043E\u0432\u0430\u043A 5", h6:"\u0417\u0430\u0433\u0430\u043B\u043E\u0432\u0430\u043A 6", blockquote:"\u0411\u043B\u043E\u043A \u0432\u044B\u043D\u044F\u0442\u043A\u0456", code:"\u041A\u043E\u0434", samp:"\u041F\u0440\u044B\u043A\u043B\u0430\u0434 \u043A\u043E\u0434\u0430", dt:"\u0412\u044B\u0437\u043D\u0430\u0447\u0430\u0435\u043C\u044B \u0442\u044D\u0440\u043C\u0456\u043D", dd:"\u0410\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u0442\u044D\u0440\u043C\u0456\u043D\u0430", bold_desc:"\u0422\u043E\u045E\u0441\u0442\u044B (Ctrl+B)", italic_desc:"\u041A\u0443\u0440\u0441\u0456\u045E (Ctrl+I)", underline_desc:"\u041F\u0430\u0434\u043A\u0440\u044D\u0441\u043B\u0435\u043D\u044B (Ctrl+U)", striketrough_desc:"\u041F\u0435\u0440\u0430\u043A\u0440\u044D\u0441\u043B\u0435\u043D\u044B", justifyleft_desc:"\u0412\u044B\u0440\u0430\u045E\u043D\u043E\u045E\u0432\u0430\u043D\u043D\u0435 \u043D\u0430\u043B\u0435\u0432\u0430", justifycenter_desc:"\u0412\u044B\u0440\u0430\u045E\u043D\u043E\u045E\u0432\u0430\u043D\u043D\u0435 \u043F\u0430 \u0446\u044D\u043D\u0442\u0440\u044B", justifyright_desc:"\u0412\u044B\u0440\u0430\u045E\u043D\u043E\u045E\u0432\u0430\u043D\u043D\u0435 \u043D\u0430\u043F\u0440\u0430\u0432\u0430", justifyfull_desc:"\u0412\u044B\u0440\u0430\u045E\u043D\u043E\u045E\u0432\u0430\u043D\u043D\u0435 \u043F\u0430 \u0448\u044B\u0440\u044B\u043D\u0456", bullist_desc:"\u041C\u0430\u0440\u043A\u0456\u0440\u0430\u0432\u0430\u043D\u044B \u0441\u043F\u0456\u0441", numlist_desc:"\u041D\u0443\u043C\u0430\u0440\u0430\u0432\u0430\u043D\u044B \u0441\u043F\u0456\u0441", outdent_desc:"\u041F\u0430\u043C\u0435\u043D\u0448\u044B\u0446\u044C \u0432\u043E\u0434\u0441\u0442\u0443\u043F", indent_desc:"\u041F\u0430\u0432\u044F\u043B\u0456\u0447\u044B\u0446\u044C \u0432\u043E\u0434\u0441\u0442\u0443\u043F", undo_desc:"\u0410\u0434\u043C\u044F\u043D\u0456\u0446\u044C (Ctrl+Z)", redo_desc:"\u041F\u0430\u045E\u0442\u0430\u0440\u044B\u0446\u044C (Ctrl+Y)", link_desc:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044C/\u0440\u044D\u0434\u0430\u0433\u0430\u0432\u0430\u0446\u044C \u0441\u043F\u0430\u0441\u044B\u043B\u043A\u0443", unlink_desc:"\u0412\u044B\u0434\u0430\u043B\u0456\u0446\u044C \u0441\u043F\u0430\u0441\u044B\u043B\u043A\u0443", image_desc:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044C/\u0440\u044D\u0434\u0430\u0433\u0430\u0432\u0430\u0446\u044C \u043C\u0430\u043B\u044E\u043D\u0430\u043A", cleanup_desc:"\u041F\u0430\u0447\u044B\u0441\u0446\u0456\u0446\u044C \u0431\u0440\u0443\u0434\u043D\u044B \u043A\u043E\u0434", code_desc:"\u0420\u044D\u0434\u0430\u0433\u0430\u0432\u0430\u0446\u044C HTML-\u0437\u044B\u0445\u043E\u0434\u043D\u0456\u043A", sub_desc:"\u041D\u0456\u0436\u043D\u0456 \u0430\u0437\u043D\u0430\u0447\u043D\u0456\u043A", sup_desc:"\u0412\u0435\u0440\u0445\u043D\u0456 \u0430\u0437\u043D\u0430\u0447\u043D\u0456\u043A", hr_desc:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044C \u0433\u0430\u0440\u044B\u0437\u0430\u043D\u0442\u0430\u043B\u044C\u043D\u0443\u044E \u043B\u0456\u043D\u0456\u044E", removeformat_desc:"\u041F\u0440\u044B\u0431\u0440\u0430\u0446\u044C \u0444\u0430\u0440\u043C\u0430\u0442\u0430\u0432\u0430\u043D\u043D\u0435", custom1_desc:"\u0423\u0432\u044F\u0434\u0437\u0456\u0446\u0435 \u0432\u0430\u0448\u0430 \u0430\u043F\u0456\u0441\u0430\u043D\u043D\u0435", forecolor_desc:"\u0410\u0431\u0440\u0430\u0446\u044C \u043A\u043E\u043B\u0435\u0440 \u0442\u044D\u043A\u0441\u0442\u0443", backcolor_desc:"\u0410\u0431\u0440\u0430\u0446\u044C \u043A\u043E\u043B\u0435\u0440 \u0444\u043E\u043D\u0443", charmap_desc:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044C \u0430\u0434\u043C\u044B\u0441\u043B\u043E\u0432\u044B \u0437\u043D\u0430\u043A", visualaid_desc:"\u0423\u043B\u0443\u0447\u044B\u0446\u044C/\u0432\u044B\u043A\u043B\u044E\u0447\u044B\u0446\u044C \u043D\u0430\u043A\u0456\u0440\u0430\u0432\u0430\u043B\u044C\u043D\u044B\u044F/\u043D\u044F\u0431\u0430\u0447\u043D\u044B\u044F \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B", anchor_desc:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044C/\u0440\u044D\u0434\u0430\u0433\u0430\u0432\u0430\u0446\u044C \u044F\u043A\u0430\u0440", cut_desc:"\u0412\u044B\u0440\u0430\u0437\u0430\u0446\u044C", copy_desc:"\u041A\u0430\u043F\u0456\u044F\u0432\u0430\u0446\u044C", paste_desc:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044C", image_props_desc:"\u0423\u043B\u0430\u0441\u0446\u0456\u0432\u0430\u0441\u0446\u0456 \u043C\u0430\u043B\u044E\u043D\u043A\u0430", newdocument_desc:"\u041D\u043E\u0432\u044B \u0434\u0430\u043A\u0443\u043C\u0435\u043D\u0442", help_desc:"\u0414\u0430\u043F\u0430\u043C\u043E\u0433\u0430", blockquote_desc:"\u0411\u043B\u043E\u043A \u0432\u044B\u043D\u044F\u0442\u043A\u0456", clipboard_msg:"\u041A\u0430\u043F\u0456\u044F\u0432\u0430\u043D\u043D\u0435/\u0423\u0441\u0442\u0430\u045E\u043A\u0430 \u043D\u0435 \u043F\u0440\u0430\u0446\u0443\u0435 \u045E Mozilla \u0456 Firefox.\r\n\u0416\u0430\u0434\u0430\u0435\u0446\u0435 \u043F\u0430\u0434\u0440\u0430\u0431\u044F\u0437\u043D\u0435\u0439 \u043F\u0430\u0437\u043D\u0430\u0446\u044C, \u0443 \u0447\u044B\u043C \u0441\u043F\u0440\u0430\u0432\u0430?", path:"\u0428\u043B\u044F\u0445", newdocument:"\u0412\u044B \u045E\u043F\u044D\u045E\u043D\u0435\u043D\u044B\u044F, \u0448\u0442\u043E \u0436\u0430\u0434\u0430\u0435\u0446\u0435 \u0430\u0447\u044B\u0441\u0446\u0456\u0446\u044C \u0443\u0441\u0451 \u0437\u043C\u0435\u0441\u0446\u0456\u0432\u0430?", toolbar_focus:"\u041F\u0435\u0440\u0430\u0439\u0441\u0446\u0456 \u0434\u0430 \u043A\u043D\u043E\u043F\u0430\u043A \u043F\u0440\u044B\u043B\u0430\u0434 - Alt+Q, \u041F\u0435\u0440\u0430\u0439\u0441\u0446\u0456 \u0434\u0430 \u0440\u044D\u0434\u0430\u043A\u0442\u0430\u0440\u0430 - Alt-Z, \u041F\u0435\u0440\u0430\u0439\u0441\u0446\u0456 \u0434\u0430 \u0448\u043B\u044F\u0445\u0443 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430 - Alt-X", more_colors:"\u042F\u0448\u0447\u044D \u043A\u043E\u043B\u0435\u0440\u044B" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/be_dlg.js000066400000000000000000000116721226600447100241150ustar00rootroot00000000000000tinyMCE.addI18n('be.advanced_dlg',{ about_title:"\u0410\u0431 TinyMCE", about_general:"\u0410\u0431 \u043F\u0440\u0430\u0433\u0440\u0430\u043C\u0435", about_help:"\u0414\u0430\u043F\u0430\u043C\u043E\u0433\u0430", about_license:"\u041B\u0456\u0446\u044D\u043D\u0437\u0456\u044F", about_plugins:"\u0423\u0431\u0443\u0434\u043E\u0432\u044B", about_plugin:"\u0423\u0431\u0443\u0434\u043E\u0432\u0430", about_author:"\u0410\u045E\u0442\u0430\u0440", about_version:"\u0412\u0435\u0440\u0441\u0456\u044F", about_loaded:"\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u043D\u044B\u044F \u045E\u0431\u0443\u0434\u043E\u0432\u044B", anchor_title:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C/\u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u044F\u043A\u043E\u0440\u044C", anchor_name:"\u0418\u043C\u044F \u044F\u043A\u043E\u0440\u044F", code_title:"\u0420\u044D\u0434\u0430\u043A\u0442\u0430\u0440 HTML-\u0437\u044B\u0445\u043E\u0434\u043D\u0456\u043A\u0430", code_wordwrap:"\u041F\u0435\u0440\u0430\u043D\u043E\u0441 \u0441\u043B\u043E\u045E", colorpicker_title:"\u0410\u0431\u044F\u0440\u044B\u0446\u0435 \u043A\u043E\u043B\u0435\u0440", colorpicker_picker_tab:"\u0412\u044B\u0431\u0430\u0440", colorpicker_picker_title:"\u0412\u044B\u0431\u0430\u0440 \u043A\u043E\u043B\u0435\u0440\u0443", colorpicker_palette_tab:"\u041F\u0430\u043B\u0456\u0442\u0440\u0430", colorpicker_palette_title:"\u041A\u043E\u043B\u0435\u0440\u044B \u043F\u0430\u043B\u0456\u0442\u0440\u044B", colorpicker_named_tab:"\u041D\u0430\u0439\u043C\u0435\u043D\u043D\u044B", colorpicker_named_title:"\u041D\u0430\u0439\u043C\u0435\u043D\u043D\u044B\u044F \u043A\u043E\u043B\u0435\u0440\u044B", colorpicker_color:"\u041A\u043E\u043B\u0435\u0440:", colorpicker_name:"\u041D\u0430\u0437\u043E\u045E:", charmap_title:"\u0410\u0431\u044F\u0440\u044B\u0446\u0435 \u0430\u0434\u043C\u044B\u0441\u043B\u043E\u0432\u044B \u0437\u043D\u0430\u043A", image_title:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044C/\u0440\u044D\u0434\u0430\u0433\u0430\u0432\u0430\u0446\u044C \u043C\u0430\u043B\u044E\u043D\u0430\u043A", image_src:"\u0410\u0434\u0440\u0430\u0441 \u043C\u0430\u043B\u044E\u043D\u043A\u0430", image_alt:"\u0410\u043F\u0456\u0441\u0430\u043D\u043D\u0435 \u043C\u0430\u043B\u044E\u043D\u043A\u0430", image_list:"\u0421\u043F\u0456\u0441 \u043C\u0430\u043B\u044E\u043D\u043A\u0430\u045E", image_border:"\u041C\u044F\u0436\u0430", image_dimensions:"\u041F\u0430\u043C\u0435\u0440\u044B", image_vspace:"\u0412\u0435\u0440\u0442\u044B\u043A\u0430\u043B\u044C\u043D\u0430\u044F \u043F\u0440\u0430\u0441\u0442\u043E\u0440\u0430", image_hspace:"\u0413\u0430\u0440\u044B\u0437\u0430\u043D\u0442\u0430\u043B\u044C\u043D\u0430\u044F \u043F\u0440\u0430\u0441\u0442\u043E\u0440\u0430", image_align:"\u0412\u044B\u0440\u0430\u045E\u043D\u043E\u045E\u0432\u0430\u043D\u043D\u0435", image_align_baseline:"\u041F\u0430 \u0431\u0430\u0437\u0456\u0441\u043D\u0430\u0439 \u043B\u0456\u043D\u0456\u0456", image_align_top:"\u041F\u0430 \u0432\u0435\u0440\u0441\u0435", image_align_middle:"\u041F\u0430 \u0446\u044D\u043D\u0442\u0440\u044B", image_align_bottom:"\u041F\u0430 \u043D\u0456\u0437\u0435", image_align_texttop:"\u041F\u0430 \u0432\u0435\u0440\u0441\u0435 \u0442\u044D\u043A\u0441\u0442\u0443", image_align_textbottom:"\u041F\u0430 \u043D\u0456\u0437\u0435 \u0442\u044D\u043A\u0441\u0442\u0443", image_align_left:"\u041D\u0430\u043B\u0435\u0432\u0430", image_align_right:"\u041D\u0430\u043F\u0440\u0430\u0432\u0430", link_title:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044C/\u0440\u044D\u0434\u0430\u0433\u0430\u0432\u0430\u0446\u044C \u0441\u043F\u0430\u0441\u044B\u043B\u043A\u0443", link_url:"\u0410\u0434\u0440\u0430\u0441 \u0441\u043F\u0430\u0441\u044B\u043B\u043A\u0456", link_target:"\u041C\u044D\u0442\u0430", link_target_same:"\u0410\u0434\u043A\u0440\u044B\u0446\u044C \u0441\u043F\u0430\u0441\u044B\u043B\u043A\u0443 \u045E \u0442\u044B\u043C \u0436\u0430 \u0430\u043A\u043D\u0435", link_target_blank:"\u0410\u0434\u043A\u0440\u044B\u0446\u044C \u0441\u043F\u0430\u0441\u044B\u043B\u043A\u0443 \u045E \u043D\u043E\u0432\u044B\u043C \u0430\u043A\u043D\u0435", link_titlefield:"\u041D\u0430\u0437\u043E\u045E", link_is_email:"\u0423\u0432\u0435\u0434\u0437\u0435\u043D\u044B \u0430\u0434\u0440\u0430\u0441 \u043F\u0430\u0434\u043E\u0431\u043D\u044B \u043D\u0430 email, \u0432\u044B \u0436\u0430\u0434\u0430\u0435\u0446\u0435 \u0434\u0430\u0434\u0430\u0446\u044C \u043F\u0440\u044D\u0444\u0456\u043A\u0441 mailto:?", link_is_external:"\u0423\u0432\u0435\u0434\u0437\u0435\u043D\u044B \u0430\u0434\u0440\u0430\u0441 \u043F\u0430\u0434\u043E\u0431\u043D\u044B \u043D\u0430 \u0432\u043E\u043D\u043A\u0430\u0432\u0443\u044E \u0441\u043F\u0430\u0441\u044B\u043B\u043A\u0443, \u0432\u044B \u0436\u0430\u0434\u0430\u0435\u0446\u0435 \u0434\u0430\u0434\u0430\u0446\u044C \u043F\u0440\u044D\u0444\u0456\u043A\u0441 http://?", link_list:"\u0421\u043F\u0456\u0441 \u0441\u043F\u0430\u0441\u044B\u043B\u0430\u043A" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/bg.js000066400000000000000000000142271226600447100232700ustar00rootroot00000000000000tinyMCE.addI18n('bg.advanced',{ style_select:"\u0421\u0442\u0438\u043B\u043E\u0432\u0435", font_size:"\u0420\u0430\u0437\u043C\u0435\u0440 \u043D\u0430 \u0448\u0440\u0438\u0444\u0442\u0430", fontdefault:"\u0428\u0440\u0438\u0444\u0442", block:"\u0424\u043E\u0440\u043C\u0430\u0442", paragraph:"\u041F\u0430\u0440\u0430\u0433\u0440\u0430\u0444", div:"Div", address:"\u0410\u0434\u0440\u0435\u0441", pre:"\u041F\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043B\u043D\u043E \u0444\u043E\u0440\u043C\u0430\u0442\u0438\u0440\u0430\u043D", h1:"\u0417\u0430\u0433\u043B\u0430\u0432\u0438\u0435 1", h2:"\u0417\u0430\u0433\u043B\u0430\u0432\u0438\u0435 2", h3:"\u0417\u0430\u0433\u043B\u0430\u0432\u0438\u0435 3", h4:"\u0417\u0430\u0433\u043B\u0430\u0432\u0438\u0435 4", h5:"\u0417\u0430\u0433\u043B\u0430\u0432\u0438\u0435 5", h6:"\u0417\u0430\u0433\u043B\u0430\u0432\u0438\u0435 6", blockquote:"\u0426\u0438\u0442\u0430\u0442", code:"\u041A\u043E\u0434", samp:"\u041F\u0440\u043E\u043C\u0435\u0440\u0435\u043D \u043A\u043E\u0434", dt:"\u0414\u0435\u0444\u0438\u043D\u0438\u0446\u0438\u044F ", dd:"\u041E\u043F\u0438\u0441\u0430\u043D\u0438\u0435 \u043D\u0430 \u0434\u0435\u0444\u0438\u043D\u0438\u0446\u0438\u044F", bold_desc:"\u041F\u043E\u043B\u0443\u0447\u0435\u0440 (Ctrl+B)", italic_desc:"\u041A\u0443\u0440\u0441\u0438\u0432 (Ctrl+I)", underline_desc:"\u041F\u043E\u0434\u0447\u0435\u0440\u0442\u0430\u043D (Ctrl+U)", striketrough_desc:"\u0417\u0430\u0447\u0435\u0440\u0442\u0430\u043D", justifyleft_desc:"\u041F\u043E\u0434\u0440\u0430\u0432\u043D\u044F\u0432\u0430\u043D\u0435 \u043E\u0442\u043B\u044F\u0432\u043E", justifycenter_desc:"\u0426\u0435\u043D\u0442\u0440\u0438\u0440\u0430\u043D\u043E", justifyright_desc:"\u041F\u043E\u0434\u0440\u0430\u0432\u043D\u044F\u0432\u0430\u043D\u0435 \u043E\u0442\u0434\u044F\u0441\u043D\u043E", justifyfull_desc:"\u0414\u0432\u0443\u0441\u0442\u0440\u0430\u043D\u043D\u043E", bullist_desc:"\u0412\u043E\u0434\u0430\u0447\u0438", numlist_desc:"\u041D\u043E\u043C\u0435\u0440\u0430", outdent_desc:"\u041D\u0430\u043C\u0430\u043B\u044F\u0432\u0430\u043D\u0435 \u043D\u0430 \u043E\u0442\u0441\u0442\u044A\u043F\u0430", indent_desc:"\u0423\u0432\u0435\u043B\u0438\u0447\u0430\u0432\u0430\u043D\u0435 \u043D\u0430 \u043E\u0442\u0441\u0442\u044A\u043F\u0430", undo_desc:"\u041E\u0442\u043C\u044F\u043D\u0430 (Ctrl+Z)", redo_desc:"\u0412\u044A\u0437\u0441\u0442\u0430\u043D\u043E\u0432\u044F\u0432\u0430\u043D\u0435 (Ctrl+Y)", link_desc:"\u0412\u043C\u044A\u043A\u0432\u0430\u043D\u0435/\u0440\u0435\u0434\u0430\u043A\u0446\u0438\u044F \u043D\u0430 \u0445\u0438\u043F\u0435\u0440\u0432\u0440\u044A\u0437\u043A\u0430", unlink_desc:"\u041F\u0440\u0435\u043C\u0430\u0445\u043D\u0438 \u0445\u0438\u043F\u0435\u0440\u0432\u0440\u044A\u0437\u043A\u0430", image_desc:"\u0412\u043C\u044A\u043A\u0432\u0430\u043D\u0435/\u0440\u0435\u0434\u0430\u043A\u0446\u0438\u044F \u043D\u0430 \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0430", cleanup_desc:"\u0418\u0437\u0447\u0438\u0441\u0442\u0438 \u043A\u043E\u0434\u0430", code_desc:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u0430\u0439 HTML", sub_desc:"\u0414\u043E\u043B\u0435\u043D \u0438\u043D\u0434\u0435\u043A\u0441", sup_desc:"\u0413\u043E\u0440\u0435\u043D \u0438\u043D\u0434\u0435\u043A\u0441", hr_desc:"\u0412\u043C\u044A\u043A\u043D\u0438 \u0445\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u043D\u0430 \u043B\u0438\u043D\u0438\u044F", removeformat_desc:"\u041F\u0440\u0435\u043C\u0430\u0445\u043D\u0438 \u0444\u043E\u0440\u043C\u0430\u0442\u0438\u0440\u0430\u043D\u0435\u0442\u043E", custom1_desc:"\u0412\u0430\u0448\u0435\u0442\u043E \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435 \u0442\u0443\u043A", forecolor_desc:"\u0418\u0437\u0431\u0435\u0440\u0438 \u0446\u0432\u044F\u0442 \u043D\u0430 \u0442\u0435\u043A\u0441\u0442\u0430", backcolor_desc:"\u0418\u0437\u0431\u0435\u0440\u0438 \u0446\u0432\u044F\u0442 \u043D\u0430 \u0444\u043E\u043D\u0430", charmap_desc:"\u0412\u043C\u044A\u043A\u043D\u0438 \u0441\u0438\u043C\u0432\u043E\u043B", visualaid_desc:"\u0412\u043A\u043B./\u0438\u0437\u043A\u043B. \u043D\u0435\u0432\u0438\u0434\u0438\u043C\u0438\u0442\u0435 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438", anchor_desc:"\u0412\u043C\u044A\u043A\u043D\u0438/\u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u0430\u0439 \u043A\u043E\u0442\u0432\u0430", cut_desc:"\u0418\u0437\u0440\u044F\u0437\u0432\u0430\u043D\u0435", copy_desc:"\u041A\u043E\u043F\u0438\u0440\u0430\u043D\u0435", paste_desc:"\u041F\u043E\u0441\u0442\u0430\u0432\u044F\u043D\u0435", image_props_desc:"\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u043D\u0430 \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0430\u0442\u0430", newdocument_desc:"\u041D\u043E\u0432 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442", help_desc:"\u041F\u043E\u043C\u043E\u0449", blockquote_desc:"\u0426\u0438\u0442\u0430\u0442", clipboard_msg:"\u041A\u043E\u043F\u0438\u0440\u0430\u043D\u0435/\u041E\u0442\u0440\u044F\u0437\u0432\u0430\u043D\u0435/\u041F\u043E\u0441\u0442\u0430\u0432\u044F\u043D\u0435 \u043D\u0435 \u0435 \u0434\u043E\u0441\u0442\u044A\u043F\u043D\u043E \u043F\u043E\u0434 Mozilla \u0438 Firefox.\r\n\u0416\u0435\u043B\u0430\u0435\u0442\u0435 \u043B\u0438 \u043F\u043E\u0432\u0435\u0447\u0435 \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u0437\u0430 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0430?", path:"\u041F\u044A\u0442", newdocument:"\u0421\u0438\u0433\u0443\u0440\u0435\u043D \u043B\u0438 \u0441\u0442\u0435, \u0447\u0435 \u0438\u0441\u043A\u0430\u0442\u0435 \u0434\u0430 \u0438\u0437\u0447\u0438\u0441\u0442\u0438\u0442\u0435 \u0446\u044F\u043B\u043E\u0442\u043E \u0441\u044A\u0434\u044A\u0440\u0436\u0430\u043D\u0438\u0435?", toolbar_focus:"\u041E\u0442\u0438\u0434\u0438 \u043F\u0440\u0438 \u0431\u0443\u0442\u043E\u043D\u0438\u0442\u0435 - Alt+Q, \u041E\u0442\u0438\u0434\u0438 \u043F\u0440\u0438 \u0440\u0435\u0434\u0430\u043A\u0442\u043E\u0440\u0430 - Alt-Z, \u041E\u0442\u0438\u0434\u0438 \u043F\u0440\u0438 \u043F\u044A\u0442\u0435\u043A\u0430\u0442\u0430 \u043D\u0430 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438\u0442\u0435 - Alt-X", more_colors:"\u041E\u0449\u0435 \u0446\u0432\u0435\u0442\u043E\u0432\u0435" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/bg_dlg.js000066400000000000000000000117421226600447100241150ustar00rootroot00000000000000tinyMCE.addI18n('bg.advanced_dlg',{ about_title:"\u041E\u0442\u043D\u043E\u0441\u043D\u043E TinyMCE", about_general:"\u041E\u0442\u043D\u043E\u0441\u043D\u043E", about_help:"\u041F\u043E\u043C\u043E\u0449", about_license:"\u041B\u0438\u0446\u0435\u043D\u0437", about_plugins:"\u0414\u043E\u0431\u0430\u0432\u043A\u0438", about_plugin:"\u0414\u043E\u0431\u0430\u0432\u043A\u0430", about_author:"\u0410\u0432\u0442\u043E\u0440", about_version:"\u0412\u0435\u0440\u0441\u0438\u044F", about_loaded:"\u0417\u0430\u0440\u0435\u0434\u0435\u043D\u0438 \u0434\u043E\u0431\u0430\u0432\u043A\u0438", anchor_title:"\u0412\u043C\u044A\u043A\u043D\u0438/\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u0430\u0439 \u043A\u043E\u0442\u0432\u0430", anchor_name:"\u0418\u043C\u0435 \u043D\u0430 \u043A\u043E\u0442\u0432\u0430\u0442\u0430", code_title:"\u0420\u0435\u0434\u0430\u043A\u0442\u043E\u0440 \u043D\u0430 HTML", code_wordwrap:"\u041F\u0440\u0435\u043D\u043E\u0441 \u043D\u0430 \u0434\u0443\u043C\u0438", colorpicker_title:"\u0418\u0437\u0431\u0435\u0440\u0435\u0442\u0435 \u0446\u0432\u044F\u0442", colorpicker_picker_tab:"\u0418\u0437\u0431\u043E\u0440", colorpicker_picker_title:"\u0418\u0437\u0431\u043E\u0440 \u043D\u0430 \u0446\u0432\u044F\u0442", colorpicker_palette_tab:"\u041F\u0430\u043B\u0438\u0442\u0440\u0430", colorpicker_palette_title:"\u0426\u0432\u0435\u0442\u043E\u0432\u0430 \u043F\u0430\u043B\u0438\u0442\u0440\u0430", colorpicker_named_tab:"\u0418\u043C\u0435\u043D\u0443\u0432\u0430\u043D\u0438", colorpicker_named_title:"\u0418\u043C\u0435\u043D\u0443\u0432\u0430\u043D\u0438 \u0446\u0432\u0435\u0442\u043E\u0432\u0435", colorpicker_color:"\u0426\u0432\u044F\u0442:", colorpicker_name:"\u0418\u043C\u0435:", charmap_title:"\u0418\u0437\u0431\u0435\u0440\u0435\u0442\u0435 \u0441\u0438\u043C\u0432\u043E\u043B", image_title:"\u0412\u043C\u044A\u043A\u043D\u0438/\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u0430\u0439 \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0430", image_src:"URL \u043D\u0430 \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0430", image_alt:"\u041E\u043F\u0438\u0441\u0430\u043D\u0438\u0435 \u043D\u0430 \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0430", image_list:"\u0421\u043F\u0438\u0441\u044A\u043A \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438", image_border:"\u0420\u0430\u043C\u043A\u0430", image_dimensions:"\u0420\u0430\u0437\u043C\u0435\u0440\u0438", image_vspace:"\u0412\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u043D\u043E \u0440\u0430\u0437\u0441\u0442\u043E\u044F\u043D\u0438\u0435", image_hspace:"\u0425\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u043D\u043E \u0440\u0430\u0437\u0441\u0442\u043E\u044F\u043D\u0438\u0435", image_align:"\u041F\u043E\u0434\u0440\u0430\u0432\u043D\u044F\u0432\u0430\u043D\u0435", image_align_baseline:"\u0411\u0430\u0437\u043E\u0432\u0430 \u043B\u0438\u043D\u0438\u044F", image_align_top:"\u0413\u043E\u0440\u0435", image_align_middle:"\u0426\u0435\u043D\u0442\u0440\u0438\u0440\u0430\u043D\u0435", image_align_bottom:"\u0414\u043E\u043B\u0443", image_align_texttop:"\u0422\u0435\u043A\u0441\u0442 \u0433\u043E\u0440\u0435", image_align_textbottom:"\u0422\u0435\u043A\u0441\u0442 \u0434\u043E\u043B\u0443", image_align_left:"\u041B\u044F\u0432\u043E", image_align_right:"\u0414\u044F\u0441\u043D\u043E", link_title:"\u0412\u043C\u044A\u043A\u043D\u0438/\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u0430\u0439 \u0445\u0438\u043F\u0435\u0440\u0432\u0440\u044A\u0437\u043A\u0430", link_url:"URL \u043D\u0430 \u0445\u0438\u043F\u0435\u0440\u0432\u0440\u044A\u0437\u043A\u0430", link_target:"\u0426\u0435\u043B", link_target_same:"\u041E\u0442\u0432\u043E\u0440\u0438 \u0445\u0438\u043F\u0435\u0440\u0432\u0440\u044A\u0437\u043A\u0430\u0442\u0430 \u0432 \u0441\u044A\u0449\u0438\u044F\u0442 \u043F\u0440\u043E\u0437\u043E\u0440\u0435\u0446", link_target_blank:"\u041E\u0442\u0432\u043E\u0440\u0438 \u0445\u0438\u043F\u0435\u0440\u0432\u0440\u044A\u0437\u043A\u0430\u0442\u0430 \u0432 \u043D\u043E\u0432 \u043F\u0440\u043E\u0437\u043E\u0440\u0435\u0446", link_titlefield:"\u0417\u0430\u0433\u043B\u0430\u0432\u0438\u0435", link_is_email:"URL-\u0442\u043E \u043A\u043E\u0435\u0442\u043E \u0432\u044A\u0432\u0435\u0434\u043E\u0445\u0442\u0435 \u0435 email \u0430\u0434\u0440\u0435\u0441, \u0436\u0435\u043B\u0430\u0435\u0442\u0435 \u043B\u0438 \u0434\u0430 \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u0435 \u043D\u0443\u0436\u043D\u0438\u044F\u0442 mailto: \u043F\u0440\u0435\u0444\u0438\u043A\u0441?", link_is_external:"URL-\u0442\u043E \u043A\u043E\u0435\u0442\u043E \u0432\u044A\u0432\u0435\u0434\u043E\u0445\u0442\u0435 \u0435 \u0432\u044A\u043D\u0448\u043D\u0430 \u0445\u0438\u043F\u0435\u0440\u0432\u0440\u044A\u0437\u043A\u0430, \u0436\u0435\u043B\u0430\u0435\u0442\u0435 \u043B\u0438 \u0434\u0430 \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u0435 \u043D\u0443\u0436\u043D\u0438\u044F\u0442 http:// \u043F\u0440\u0435\u0444\u0438\u043A\u0441?", link_list:"\u0421\u043F\u0438\u0441\u044A\u043A \u043B\u0438\u043D\u043A\u043E\u0432\u0435" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/bn.js000066400000000000000000000035501226600447100232740ustar00rootroot00000000000000tinyMCE.addI18n('bn.advanced',{ style_select:"Styles", font_size:"Font size", fontdefault:"Font family", block:"Format", paragraph:"Paragraph", div:"Div", address:"Address", pre:"Preformatted", h1:"Heading 1", h2:"Heading 2", h3:"Heading 3", h4:"Heading 4", h5:"Heading 5", h6:"Heading 6", blockquote:"Blockquote", code:"Code", samp:"Code sample", dt:"Definition term ", dd:"Definition description", bold_desc:"Bold (Ctrl+B)", italic_desc:"Italic (Ctrl+I)", underline_desc:"Underline (Ctrl+U)", striketrough_desc:"Strikethrough", justifyleft_desc:"Align left", justifycenter_desc:"Align center", justifyright_desc:"Align right", justifyfull_desc:"Align full", bullist_desc:"Unordered list", numlist_desc:"Ordered list", outdent_desc:"Outdent", indent_desc:"Indent", undo_desc:"Undo (Ctrl+Z)", redo_desc:"Redo (Ctrl+Y)", link_desc:"Insert/edit link", unlink_desc:"Unlink", image_desc:"Insert/edit image", cleanup_desc:"Cleanup messy code", code_desc:"Edit HTML Source", sub_desc:"Subscript", sup_desc:"Superscript", hr_desc:"Insert horizontal ruler", removeformat_desc:"Remove formatting", custom1_desc:"Your custom description here", forecolor_desc:"Select text color", backcolor_desc:"Select background color", charmap_desc:"Insert custom character", visualaid_desc:"Toggle guidelines/invisible elements", anchor_desc:"Insert/edit anchor", cut_desc:"Cut", copy_desc:"Copy", paste_desc:"Paste", image_props_desc:"Image properties", newdocument_desc:"New document", help_desc:"Help", blockquote_desc:"Blockquote", clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?", path:"Path", newdocument:"Are you sure you want clear all contents?", toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X", more_colors:"More colors" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/bn_dlg.js000066400000000000000000000032741226600447100241250ustar00rootroot00000000000000tinyMCE.addI18n('bn.advanced_dlg',{ about_title:"About TinyMCE", about_general:"About", about_help:"Help", about_license:"License", about_plugins:"Plugins", about_plugin:"Plugin", about_author:"Author", about_version:"Version", about_loaded:"Loaded plugins", anchor_title:"Insert/edit anchor", anchor_name:"Anchor name", code_title:"HTML Source Editor", code_wordwrap:"Word wrap", colorpicker_title:"Select a color", colorpicker_picker_tab:"Picker", colorpicker_picker_title:"Color picker", colorpicker_palette_tab:"Palette", colorpicker_palette_title:"Palette colors", colorpicker_named_tab:"Named", colorpicker_named_title:"Named colors", colorpicker_color:"Color:", colorpicker_name:"Name:", charmap_title:"Select custom character", image_title:"Insert/edit image", image_src:"Image URL", image_alt:"Image description", image_list:"Image list", image_border:"Border", image_dimensions:"Dimensions", image_vspace:"Vertical space", image_hspace:"Horizontal space", image_align:"Alignment", image_align_baseline:"Baseline", image_align_top:"Top", image_align_middle:"Middle", image_align_bottom:"Bottom", image_align_texttop:"Text top", image_align_textbottom:"Text bottom", image_align_left:"Left", image_align_right:"Right", link_title:"Insert/edit link", link_url:"Link URL", link_target:"Target", link_target_same:"Open link in the same window", link_target_blank:"Open link in a new window", link_titlefield:"Title", link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", link_list:"Link list" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/br.js000066400000000000000000000043351226600447100233020ustar00rootroot00000000000000tinyMCE.addI18n('br.advanced',{ style_select:"Estilos", font_size:"Tamanho", fontdefault:"Fam\u00EDlia(Fonte)", block:"Formata\u00E7\u00E3o", paragraph:"Par\u00E1grafo", div:"Div", address:"Endere\u00E7o", pre:"Pr\u00E9-formatado", h1:"Cabe\u00E7alho 1", h2:"Cabe\u00E7alho 2", h3:"Cabe\u00E7alho 3", h4:"Cabe\u00E7alho 4", h5:"Cabe\u00E7alho 5", h6:"Cabe\u00E7alho 6", blockquote:"Cita\u00E7\u00E3o em bloco", code:"C\u00F3digo", samp:"Amostra de c\u00F3digo", dt:"Termo de defini\u00E7\u00E3o", dd:"Descri\u00E7\u00E3o de defini\u00E7\u00E3o", bold_desc:"Negrito (Ctrl+B)", italic_desc:"It\u00E1lico (Ctrl+I)", underline_desc:"Sublinhado (Ctrl+U)", striketrough_desc:"Riscado", justifyleft_desc:"Alinhar \u00E0 esquerda", justifycenter_desc:"Centralizar", justifyright_desc:"Alinhar \u00E0 direita", justifyfull_desc:"Justificar", bullist_desc:"Marcadores", numlist_desc:"Numera\u00E7\u00E3o", outdent_desc:"Diminuir recuo", indent_desc:"Aumentar recuo", undo_desc:"Desfazer (Ctrl+Z)", redo_desc:"Refazer (Ctrl+Y)", link_desc:"Inserir/editar hyperlink", unlink_desc:"Remover hyperlink", image_desc:"Inserir/editar imagem", cleanup_desc:"Limpar c\u00F3digo incorreto", code_desc:"Editar c\u00F3digo fonte", sub_desc:"Subscrito", sup_desc:"Superscrito", hr_desc:"Inserir separador horizontal", removeformat_desc:"Remover formata\u00E7\u00E3o", custom1_desc:"Insira aqui a sua descri\u00E7\u00E3o personalizada", forecolor_desc:"Selecionar cor do texto", backcolor_desc:"Selecionar cor de fundo", charmap_desc:"Inserir caracteres especiais", visualaid_desc:"Alternar guias/elementos invis\u00EDveis", anchor_desc:"Inserir/editar \u00E2ncora", cut_desc:"Cortar", copy_desc:"Copiar", paste_desc:"Colar", image_props_desc:"Propriedades de imagem", newdocument_desc:"Novo documento", help_desc:"Ajuda", blockquote_desc:"Cita\u00E7\u00E3o em bloco", clipboard_msg:"Copiar/cortar/colar n\u00E3o est\u00E1 dispon\u00EDvel no Mozilla e Firefox. Deseja obter mais informa\u00E7\u00F5es sobre isso?", path:"Endere\u00E7o", newdocument:"Tem certeza de que deseja apagar tudo?", toolbar_focus:"Ir para ferramentas - Alt+Q, Ir para o editor - Alt-Z, Ir para endere\u00E7o do elemento - Alt-X", more_colors:"Mais cores" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/br_dlg.js000066400000000000000000000036301226600447100241250ustar00rootroot00000000000000tinyMCE.addI18n('br.advanced_dlg',{ about_title:"Sobre o TinyMCE", about_general:"Sobre", about_help:"Ajuda", about_license:"Licen\u00E7a", about_plugins:"Plugins", about_plugin:"Plugin", about_author:"Autor", about_version:"Vers\u00E3o", about_loaded:"Plugins Instalados", anchor_title:"Inserir/editar \u00E2ncora", anchor_name:"Nome da \u00E2ncora", code_title:"Editor HTML", code_wordwrap:"Quebra autom\u00E1tica de linha", colorpicker_title:"Seleccione uma cor", colorpicker_picker_tab:"Editor", colorpicker_picker_title:"Editor de Cores", colorpicker_palette_tab:"Paleta", colorpicker_palette_title:"Paleta de Cores", colorpicker_named_tab:"Personalizadas", colorpicker_named_title:"Cores Personalizadas", colorpicker_color:"Cor:", colorpicker_name:"Nome:", charmap_title:"Selecionar caracteres personalizados", image_title:"Inserir/editar imagem", image_src:"Endere\u00E7o da imagem", image_alt:"Descri\u00E7\u00E3o da imagem", image_list:"Lista de imagens", image_border:"Limites", image_dimensions:"Dimens\u00F5es", image_vspace:"Espa\u00E7o Vertical", image_hspace:"Espa\u00E7o Horizontal", image_align:"Alinhamento", image_align_baseline:"Sobre a linha de texto", image_align_top:"Topo", image_align_middle:"Meio", image_align_bottom:"Abaixo", image_align_texttop:"Topo do texto", image_align_textbottom:"Base do texto", image_align_left:"Esquerda", image_align_right:"Direita", link_title:"Inserir/editar hyperlink", link_url:"URL do hyperink", link_target:"Alvo", link_target_same:"Abrir hyperlink na mesma janela", link_target_blank:"Abrir hyperlink em nova janela", link_titlefield:"T\u00EDtulo", link_is_email:"A URL digitada parece ser um endere\u00E7o de e-mail. Deseja acrescentar o (necess\u00E1rio) prefixo mailto:?", link_is_external:"A URL digitada parece conduzir a um link externo. Deseja acrescentar o (necess\u00E1rio) prefixo http://?", link_list:"Lista de Links" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/bs.js000066400000000000000000000037101226600447100232770ustar00rootroot00000000000000tinyMCE.addI18n('bs.advanced',{ style_select:"Stilovi", font_size:"Veli\u010Dina pisma", fontdefault:"Vrsta pisma", block:"Format", paragraph:"Paragraf", div:"Div", address:"Adresa", pre:"Oblikovano", h1:"Naslov 1", h2:"Naslov 2", h3:"Naslov 3", h4:"Naslov 4", h5:"Naslov 5", h6:"Naslov 6", blockquote:"Citat", code:"Kod", samp:"Primjer koda", dt:"Definicija pojma", dd:"Opis definicije", bold_desc:"Podebljaj (Ctrl+B)", italic_desc:"Kurziv (Ctrl+I)", underline_desc:"Podcrtaj (Ctrl+U)", striketrough_desc:"Precrtaj", justifyleft_desc:"Poravnaj lijevo", justifycenter_desc:"Centriraj", justifyright_desc:"Poravnaj desno", justifyfull_desc:"Poravnaj potpuno", bullist_desc:"Neure\u0111ena lista", numlist_desc:"Ure\u0111ena lista", outdent_desc:"Uvuci", indent_desc:"Izvuci", undo_desc:"Poni\u0161ti (Ctrl+Z)", redo_desc:"Ponovi (Ctrl+Y)", link_desc:"Umetni/uredi poveznicu", unlink_desc:"Poni\u0161ti poveznicu", image_desc:"Umetni/uredi sliku", cleanup_desc:"Po\u010Disti kod", code_desc:"Uredi HTML izvor", sub_desc:"Indeks", sup_desc:"Eksponent", hr_desc:"Umetni vodoravnu crtu", removeformat_desc:"Poni\u0161ti oblikovanje", custom1_desc:"Vlastiti opis ovdje", forecolor_desc:"Odaberite boju teksta", backcolor_desc:"Odaberite boju pozadine", charmap_desc:"Umetni vlastiti znak", visualaid_desc:"Vodilice/nevidljivi elementi", anchor_desc:"Umetni/uredi sidro", cut_desc:"Izre\u017Ei", copy_desc:"Kopiraj", paste_desc:"Zalijepi", image_props_desc:"Svojstva slike", newdocument_desc:"Novi dokument", help_desc:"Pomo\u0107", blockquote_desc:"Citiraj", clipboard_msg:"Kopiraj/Izre\u017Ei/Zalijepi nije dostupno u Mozilla i Firefox preglednicima. Vi\u0161e informacija?", path:"Staza", newdocument:"Jeste li sigurni da \u017Eelite izbrisati cijeli sadr\u017Eaj?", toolbar_focus:"Prije\u0111i na alatnu traku - Alt+Q, prije\u0111i na ure\u0111iva\u010D - Alt-Z, prije\u0111i na element path - Alt-X", more_colors:"Vi\u0161e boja" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/bs_dlg.js000066400000000000000000000033501226600447100241250ustar00rootroot00000000000000tinyMCE.addI18n('bs.advanced_dlg',{ about_title:"TinyMCE", about_general:"O programu", about_help:"Pomo\u0107", about_license:"Licenca", about_plugins:"Dodaci", about_plugin:"Dodatak", about_author:"Autor", about_version:"Verzija", about_loaded:"Postoje\u0107i dodaci", anchor_title:"Umetni/uredi sidro", anchor_name:"Ime sidra", code_title:"HTML ure\u0111iva\u010D", code_wordwrap:"Omatanje teksta", colorpicker_title:"Izbor boje", colorpicker_picker_tab:"Odabir", colorpicker_picker_title:"Odabir boje", colorpicker_palette_tab:"Paleta", colorpicker_palette_title:"Paleta boja", colorpicker_named_tab:"Imenovano", colorpicker_named_title:"Imenovane boje", colorpicker_color:"Boja:", colorpicker_name:"Naziv:", charmap_title:"Odaberite znak", image_title:"Umetni/uredi sliku", image_src:"URL slike", image_alt:"Opis slike", image_list:"Lista slika", image_border:"Obrub", image_dimensions:"Dimenzije", image_vspace:"Okomiti razmak", image_hspace:"Vodoravni razmak", image_align:"Poravnavanje", image_align_baseline:"Osnovna linija", image_align_top:"Vrh", image_align_middle:"Sredina", image_align_bottom:"Dno", image_align_texttop:"Vrh teksta", image_align_textbottom:"Dno teksta", image_align_left:"Lijevo", image_align_right:"Desno", link_title:"Umetni/uredi poveznicu", link_url:"URL poveznice", link_target:"Meta", link_target_same:"Otvori poveznicu u istom prozoru", link_target_blank:"Otvori poveznicu u novom prozoru", link_titlefield:"Naslov", link_is_email:"URL koji ste unijeli izgleda kao e-mail adresa, \u017Eelite li dodati potrebni mailto: prefiks?", link_is_external:"URL koji ste unijeli izgleda kao vanjska poveznica, \u017Eelite li dodati potrebni http:// prefiks?", link_list:"Lista poveznica" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/ca.js000066400000000000000000000042701226600447100232600ustar00rootroot00000000000000tinyMCE.addI18n('ca.advanced',{ style_select:"Estils", font_size:"Mida de font", fontdefault:"Fam\u00EDlia de font", block:"Format", paragraph:"Par\u00E0graf", div:"Capa", address:"Adre\u00E7a", pre:"Preformatat", h1:"Encap\u00E7alament 1", h2:"Encap\u00E7alament 2", h3:"Encap\u00E7alament 3", h4:"Encap\u00E7alament 4", h5:"Encap\u00E7alament 5", h6:"Encap\u00E7alament 6", blockquote:"Citabloc", code:"Codi", samp:"Mostra el Codi", dt:"Terme de definici\u00F3 ", dd:"Descripci\u00F3 de definici\u00F3", bold_desc:"Negreta (Ctrl+B)", italic_desc:"Cursiva (Ctrl+I)", underline_desc:"Subratllat (Ctrl+U)", striketrough_desc:"Barrat", justifyleft_desc:"Alineaci\u00F3 esquerra", justifycenter_desc:"Alineaci\u00F3 al centre", justifyright_desc:"Alineaci\u00F3 dreta", justifyfull_desc:"Justificat", bullist_desc:"Llista no numerada", numlist_desc:"Llista numerada", outdent_desc:"Redueix el sagnat", indent_desc:"Augmenta el sagnat", undo_desc:"Desf\u00E9s (Ctrl+Z)", redo_desc:"Ref\u00E9s (Ctrl+Y)", link_desc:"Insereix/edita enlla\u00E7", unlink_desc:"Desenlla\u00E7a", image_desc:"Insereix/edita imatge", cleanup_desc:"Poleix el codi", code_desc:"Edita el codi font HTML", sub_desc:"Sub\u00EDndex", sup_desc:"Super\u00EDndex", hr_desc:"Insereix un filet horitzontal", removeformat_desc:"Elimina el format", custom1_desc:"Aqu\u00ED la vostra pr\u00F2pia descripci\u00F3", forecolor_desc:"Selecci\u00F3 del color de text", backcolor_desc:"Selecci\u00F3 del color de fons", charmap_desc:"Insereix un car\u00E0cter", visualaid_desc:"Commuta elements guies/invisibles", anchor_desc:"Insereix/edita \u00E0ncora", cut_desc:"Retalla", copy_desc:"Copia", paste_desc:"Enganxa", image_props_desc:"Propietats de la imatge", newdocument_desc:"Nou document", help_desc:"Ajuda", blockquote_desc:"Citabloc", clipboard_msg:"Copia/Retalla/Enganxa no es troba disponible ni al Mozilla ni al Firefox.\r\nVoleu m\u00E9s informaci\u00F3 sobre aix\u00F2?", path:"Cam\u00ED", newdocument:"Esteu segur que voleu buidar tots els continguts?", toolbar_focus:"Salta als botons d\'eina - Alt+Q, Salta a l\'editor - Alt-Z, Salta al cam\u00ED de l\'element - Alt-X", more_colors:"M\u00E9s colors" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/ca_dlg.js000066400000000000000000000037231226600447100241100ustar00rootroot00000000000000tinyMCE.addI18n('ca.advanced_dlg',{ about_title:"Quant al TinyMCE", about_general:"Quant a", about_help:"Ajuda", about_license:"Llic\u00E8ncia", about_plugins:"Connectors", about_plugin:"Connector", about_author:"Autor", about_version:"Versi\u00F3", about_loaded:"Connectors carregats", anchor_title:"Insereix/edita \u00E0ncora", anchor_name:"Nom de l\'\u00E0ncora", code_title:"Editor de codi font HTML", code_wordwrap:"Embolcall de paraula", colorpicker_title:"Selecci\u00F3 de color", colorpicker_picker_tab:"Capturador", colorpicker_picker_title:"Capturador de color", colorpicker_palette_tab:"Paleta", colorpicker_palette_title:"Paleta de colors", colorpicker_named_tab:"Per nom", colorpicker_named_title:"Colors pel seu nom", colorpicker_color:"Color:", colorpicker_name:"Nom:", charmap_title:"Selecci\u00F3 de car\u00E0cter", image_title:"Insereix/edita imatge", image_src:"URL de la imatge", image_alt:"Descripci\u00F3 de la imatge", image_list:"Llista de la imatge", image_border:"Vora", image_dimensions:"Dimensions", image_vspace:"Espai vertical", image_hspace:"Espai horitzontal", image_align:"Alineaci\u00F3", image_align_baseline:"L\u00EDnia de base", image_align_top:"A dalt", image_align_middle:"Al Mig", image_align_bottom:"A baix", image_align_texttop:"Part superior del text", image_align_textbottom:"Part inferior del text", image_align_left:"Esquerra", image_align_right:"Dreta", link_title:"Insereix/edita enlla\u00E7", link_url:"URL de l\'enlla\u00E7", link_target:"Dest\u00ED", link_target_same:"Obre l\'enlla\u00E7 a la mateixa finestra", link_target_blank:"Obre l\'enlla\u00E7 a una nova finestra", link_titlefield:"T\u00EDtol", link_is_email:"L\'URL que heu introdu\u00EFt sembla ser una adre\u00E7a de correu, voleu afegir-hi el prefix requerit mailto: ?", link_is_external:"L\'URL que heu introdu\u00EFt sembla ser un enlla\u00E7 extern, voleu afegir-hi el prefix requerit http:// ?", link_list:"Llista d\'enlla\u00E7os" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/ch.js000066400000000000000000000047131226600447100232710ustar00rootroot00000000000000tinyMCE.addI18n('ch.advanced',{ style_select:"\u6837\u5F0F", font_size:"\u6587\u5B57\u5927\u5C0F", fontdefault:"\u5B57\u4F53", block:"\u683C\u5F0F", paragraph:"\u6BB5\u843D", div:"DIV\u5C42", address:"\u5730\u5740", pre:"\u9884\u6392\u683C\u5F0F", h1:"\u6807\u98981", h2:"\u6807\u98982", h3:"\u6807\u98983", h4:"\u6807\u98984", h5:"\u6807\u98985", h6:"\u6807\u98986", blockquote:"\u5F15\u7528", code:"\u4EE3\u7801", samp:"\u4EE3\u7801\u6837\u5F0F", dt:"\u540D\u8BCD\u5B9A\u4E49", dd:"\u540D\u8BCD\u89E3\u91CA", bold_desc:"\u7C97\u4F53(Ctrl+B)", italic_desc:"\u659C\u4F53(Ctrl+I)", underline_desc:"\u4E0B\u5212\u7EBF(Ctrl+U)", striketrough_desc:"\u5220\u9664\u7EBF", justifyleft_desc:"\u5DE6\u5BF9\u9F50", justifycenter_desc:"\u5C45\u4E2D", justifyright_desc:"\u53F3\u5BF9\u9F50", justifyfull_desc:"\u4E24\u7AEF\u5BF9\u9F50", bullist_desc:"\u9879\u76EE\u7B26\u53F7", numlist_desc:"\u7F16\u53F7", outdent_desc:"\u51CF\u5C11\u7F29\u8FDB", indent_desc:"\u589E\u52A0\u7F29\u8FDB", undo_desc:"\u64A4\u9500(Ctrl+Z)", redo_desc:"\u91CD\u505A(Ctrl+Y)", link_desc:"\u63D2\u5165/\u7F16\u8F91\u8D85\u94FE\u63A5", unlink_desc:"\u53D6\u6D88\u8D85\u94FE\u63A5", image_desc:"\u63D2\u5165/\u7F16\u8F91\u56FE\u50CF", cleanup_desc:"\u6E05\u7406\u4EE3\u7801", code_desc:"\u7F16\u8F91\u6E90\u4EE3\u7801", sub_desc:"\u4E0B\u6807", sup_desc:"\u4E0A\u6807", hr_desc:"\u63D2\u5165\u6C34\u5E73\u7EBF", removeformat_desc:"\u6E05\u9664\u6837\u5F0F", custom1_desc:"\u81EA\u5B9A\u4E49\u63CF\u8FF0", forecolor_desc:"\u524D\u666F\u8272", backcolor_desc:"\u80CC\u666F\u8272", charmap_desc:"\u63D2\u5165\u7279\u6B8A\u5B57\u7B26", visualaid_desc:"\u663E\u793A/\u9690\u85CF\u4E0D\u53EF\u89C1\u5143\u7D20", anchor_desc:"\u63D2\u5165/\u7F16\u8F91\u951A\u70B9", cut_desc:"\u526A\u5207", copy_desc:"\u590D\u5236", paste_desc:"\u7C98\u8D34", image_props_desc:"\u56FE\u50CF\u5C5E\u6027", newdocument_desc:"\u65B0\u6587\u4EF6", help_desc:"\u8BF4\u660E", blockquote_desc:"\u5F15\u7528", clipboard_msg:"\u590D\u5236\u3001\u526A\u5207\u53CA\u7C98\u8D34\u529F\u80FD\u5728Mozilla\u548CFirefox\u4E2D\u65E0\u6CD5\u4F7F\u7528\u3002 \n\u662F\u5426\u9700\u8981\u4E86\u89E3\u66F4\u591A\u6709\u5173\u6B64\u95EE\u9898\u7684\u4FE1\u606F\uFF1F", path:"\u4F4D\u7F6E", newdocument:"\u60A8\u786E\u8BA4\u8981\u6E05\u9664\u6240\u6709\u5185\u5BB9\u5417\uFF1F", toolbar_focus:"\u5DE5\u5177\u6309\u94AE- Alt+Q,\u7F16\u8F91\u5668- Alt-Z,\u7EC4\u4EF6\u4F4D\u7F6E- Alt-X", more_colors:"\u66F4\u591A\u989C\u8272" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/ch_dlg.js000066400000000000000000000044071226600447100241170ustar00rootroot00000000000000tinyMCE.addI18n('ch.advanced_dlg',{ about_title:"\u5173\u4E8ETinyMCE", about_general:"\u5173\u4E8E", about_help:"\u8BF4\u660E", about_license:"\u6388\u6743", about_plugins:"\u6240\u6709\u63D2\u4EF6", about_plugin:"\u63D2\u4EF6", about_author:"\u4F5C\u8005", about_version:"\u7248\u672C", about_loaded:"\u5DF2\u52A0\u8F7D\u7684\u63D2\u4EF6", anchor_title:"\u63D2\u5165/\u7F16\u8F91\u951A\u70B9", anchor_name:"\u951A\u70B9\u540D\u79F0", code_title:"HTML\u6E90\u4EE3\u7801\u7F16\u8F91\u5668", code_wordwrap:"\u81EA\u52A8\u6362\u884C", colorpicker_title:"\u9009\u62E9\u989C\u8272", colorpicker_picker_tab:"\u62FE\u8272\u5668", colorpicker_picker_title:"\u62FE\u8272\u5668", colorpicker_palette_tab:"\u5B89\u5168\u8272", colorpicker_palette_title:"\u5B89\u5168\u8272", colorpicker_named_tab:"\u547D\u540D\u8272", colorpicker_named_title:"\u547D\u540D\u8272", colorpicker_color:"\u989C\u8272:", colorpicker_name:"\u540D\u79F0:", charmap_title:"\u63D2\u5165\u7279\u6B8A\u5B57\u7B26", image_title:"\u63D2\u5165/\u7F16\u8F91\u56FE\u50CF", image_src:"\u56FE\u50CF\u5730\u5740", image_alt:"\u56FE\u50CF\u8BF4\u660E", image_list:"\u56FE\u50CF\u5217\u8868", image_border:"\u8FB9\u6846", image_dimensions:"\u5C3A\u5BF8", image_vspace:"\u5782\u76F4\u95F4\u8DDD", image_hspace:"\u6C34\u5E73\u95F4\u8DDD", image_align:"\u5BF9\u9F50\u65B9\u5F0F", image_align_baseline:"\u57FA\u7EBF", image_align_top:"\u9876\u7AEF", image_align_middle:"\u5C45\u4E2D", image_align_bottom:"\u5E95\u90E8", image_align_texttop:"\u6587\u5B57\u4E0A\u65B9", image_align_textbottom:"\u6587\u5B57\u4E0B\u65B9", image_align_left:"\u5C45\u5DE6", image_align_right:"\u5C45\u53F3", link_title:"\u63D2\u5165/\u7F16\u8F91\u94FE\u63A5", link_url:"\u94FE\u63A5\u5730\u5740", link_target:"\u76EE\u6807", link_target_same:"\u540C\u4E00\u7A97\u53E3", link_target_blank:"\u65B0\u7A97\u53E3", link_titlefield:"\u6807\u9898", link_is_email:"\u60A8\u8F93\u5165\u7684\u662F\u4E00\u4E2A\u7535\u5B50\u90AE\u5BC4\u5730\u5740\uFF0C\u662F\u5426\u9700\u8981\u5728\u5730\u5740\u5F00\u5934\u52A0\u5165mailto:\uFF1F", link_is_external:"\u60A8\u8F93\u5165\u7684\u662F\u4E00\u4E2A\u5916\u90E8\u94FE\u63A5\uFF0C\u662F\u5426\u9700\u8981\u5728\u7F51\u5740\u5F00\u5934\u52A0\u5165http://\uFF1F", link_list:"\u94FE\u63A5\u5217\u8868" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/cs.js000066400000000000000000000044041226600447100233010ustar00rootroot00000000000000tinyMCE.addI18n('cs.advanced',{ style_select:"--- Styly ---", font_size:"- Velikost p\u00EDsma -", fontdefault:"--- P\u00EDsma ---", block:"-- Form\u00E1t --", paragraph:"Odstavec", div:"Div", address:"Adresa", pre:"P\u0159edform\u00E1tov\u00E1no", h1:"Nadpis 1", h2:"Nadpis 2", h3:"Nadpis 3", h4:"Nadpis 4", h5:"Nadpis 5", h6:"Nadpis 6", blockquote:"Odsazen\u00FD blok textu", code:"K\u00F3d", samp:"Vzorek", dt:"Term\u00EDn", dd:"Definice", bold_desc:"Tu\u010Dn\u00E9 (Ctrl+B)", italic_desc:"Kurz\u00EDva (Ctrl+I)", underline_desc:"Podtr\u017Een\u00E9 (Ctrl+U)", striketrough_desc:"P\u0159e\u0161krtnut\u00E9", justifyleft_desc:"Zarovnat doleva", justifycenter_desc:"Zarovnat na st\u0159ed", justifyright_desc:"Zarovnat doprava", justifyfull_desc:"Zarovnat do bloku", bullist_desc:"Seznam s odr\u00E1\u017Ekami", numlist_desc:"\u010C\u00EDslovan\u00FD seznam", outdent_desc:"Zmen\u0161it odsazen\u00ED", indent_desc:"Zv\u011Bt\u0161it odsazen\u00ED", undo_desc:"Zp\u011Bt (Ctrl+Z)", redo_desc:"Znovu (Ctrl+Y)", link_desc:"Vlo\u017Eit/upravit odkaz", unlink_desc:"Zru\u0161it odkaz", image_desc:"Vlo\u017Eit/upravit obr\u00E1zek", cleanup_desc:"Vy\u010Distit k\u00F3d", code_desc:"Upravit HTML k\u00F3d", sub_desc:"Doln\u00ED index", sup_desc:"Horn\u00ED index", hr_desc:"Vlo\u017Eit vodorovn\u00FD odd\u011Blova\u010D", removeformat_desc:"Zru\u0161it form\u00E1tov\u00E1n\u00ED", custom1_desc:"Libovoln\u00FD popisek", forecolor_desc:"Barva textu", backcolor_desc:"Barva pozad\u00ED", charmap_desc:"Vlo\u017Eit speci\u00E1ln\u00ED znak", visualaid_desc:"Zviditelnit zna\u010Dky", anchor_desc:"Vlo\u017Eit/upravit kotvu", cut_desc:"Vyjmout", copy_desc:"Kop\u00EDrovat", paste_desc:"Vlo\u017Eit", image_props_desc:"Vlastnosti obr\u00E1zku", newdocument_desc:"Nov\u00FD dokument", help_desc:"N\u00E1pov\u011Bda", blockquote_desc:"Blok citace", clipboard_msg:"Funkce kop\u00EDrovat/vyjmout/vlo\u017Eit nejsou pou\u017Eiteln\u00E9 v Mozille a Firefoxu.\nChcete v\u00EDce informac\u00ED?", path:"Cesta", newdocument:"Jste si opravdu jisti, \u017Ee chcete vymazat ve\u0161ker\u00FD obsah?", toolbar_focus:"Skok na li\u0161tu n\u00E1stroj\u016F - Alt+Q, skok do editoru - Alt-Z, skok na cestu prvk\u016F - Alt-X", more_colors:"Dal\u0161\u00ED barvy" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/cs_dlg.js000066400000000000000000000037561226600447100241400ustar00rootroot00000000000000tinyMCE.addI18n('cs.advanced_dlg',{ about_title:"O TinyMCE", about_general:"O programu", about_help:"N\u00E1pov\u011Bda", about_license:"Licence", about_plugins:"Pluginy", about_plugin:"Plugin", about_author:"Autor", about_version:"Verze", about_loaded:"Na\u010Dten\u00E9 pluginy", anchor_title:"Vlo\u017Eit/upravit kotvu", anchor_name:"N\u00E1zev kotvy", code_title:"HTML", code_wordwrap:"Zalomen\u00ED \u0159\u00E1dk\u016F", colorpicker_title:"V\u00FDb\u011Br barvy", colorpicker_picker_tab:"Kap\u00E1tko", colorpicker_picker_title:"Kap\u00E1tko", colorpicker_palette_tab:"Paleta", colorpicker_palette_title:"Paleta barev", colorpicker_named_tab:"N\u00E1zvy", colorpicker_named_title:"Pojmenovan\u00E9 barvy", colorpicker_color:"Vybran\u00E1 barva:", colorpicker_name:"N\u00E1zev:", charmap_title:"Vlo\u017Eit speci\u00E1ln\u00ED znak", image_title:"Vlo\u017Eit/upravit obr\u00E1zek", image_src:"URL obr\u00E1zku", image_alt:"Popis obr\u00E1zku", image_list:"Seznam obr\u00E1zk\u016F", image_border:"R\u00E1me\u010Dek", image_dimensions:"Rozm\u011Bry", image_vspace:"Vertik\u00E1ln\u00ED mezera", image_hspace:"Horizont\u00E1ln\u00ED mezera", image_align:"Zarovn\u00E1n\u00ED", image_align_baseline:"Na z\u00E1kladnu", image_align_top:"Nahoru", image_align_middle:"Na st\u0159ed \u0159\u00E1dku", image_align_bottom:"Dol\u016F", image_align_texttop:"S vrchem \u0159\u00E1dku", image_align_textbottom:"Se spodkem \u0159\u00E1dku", image_align_left:"Vlevo", image_align_right:"Vpravo", link_title:"Vlo\u017Eit/upravit odkaz", link_url:"URL odkazu", link_target:"C\u00EDl", link_target_same:"Otev\u0159\u00EDt odkaz ve stejn\u00E9m okn\u011B", link_target_blank:"Otev\u0159\u00EDt odkaz v nov\u00E9m okn\u011B", link_titlefield:"Titulek", link_is_email:"Zadan\u00E9 URL vypad\u00E1 jako e-mailov\u00E1 adresa, chcete doplnit prefix mailto:?", link_is_external:"Zadan\u00E9 URL vypad\u00E1 jako extern\u00ED odkaz, chcete doplnit prefix http://?", link_list:"Seznam odkaz\u016F" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/cy.js000066400000000000000000000037711226600447100233150ustar00rootroot00000000000000tinyMCE.addI18n('cy.advanced',{ style_select:"Ardulliau", font_size:"Maint Ffont", fontdefault:"Teulu ffont", block:"Fformat", paragraph:"Paragraff", div:"Div", address:"Cyfeririad", pre:"Rhagffomatiwyd", h1:"Pennawd 1", h2:"Pennawd 2", h3:"Pennawd 3", h4:"Pennawd 4", h5:"Pennawd 5", h6:"Pennawd 6", blockquote:"Dyfyniad bloc", code:"C\u00F4d", samp:"Sampl c\u00F4d", dt:"Term diffiniad ", dd:"Disgrifiad diffiniad", bold_desc:"Trwm (Ctrl+B)", italic_desc:"Italig (Ctrl+I)", underline_desc:"Tanlinellu (Ctrl+U)", striketrough_desc:"Taro drwodd", justifyleft_desc:"Alinio i'r chwith", justifycenter_desc:"Alinio i'r canol", justifyright_desc:"Alinio i'r dde", justifyfull_desc:"Alinio llawn", bullist_desc:"Rhestr didrenus", numlist_desc:"Rhestr trenus", outdent_desc:"Alloli", indent_desc:"Mewnoli", undo_desc:"Dadwneud (Ctrl+Z)", redo_desc:"Ailwneud (Ctrl+Y)", link_desc:"Mewnosod/golygu cyswllt", unlink_desc:"Datgysylltu", image_desc:"Mewnosod/golygu delwedd", cleanup_desc:"Glanhau c\u00F4d anhrefnus", code_desc:"Golygu Ffynhonell HTML", sub_desc:"Isysgrif", sup_desc:"Uwchysgrif", hr_desc:"Mewnosod mesurydd llorweddol", removeformat_desc:"Tynnu fformatio", custom1_desc:"Eich disgrifiad addasiedig yma", forecolor_desc:"Dewis lliw testun", backcolor_desc:"Dewis lliw cefndir", charmap_desc:"Mewnosod n\u00F4d addasiedig", visualaid_desc:"Toglu llinellau cyfeirydd/elfennau anweledig", anchor_desc:"Mewnosod/golygu angor", cut_desc:"Torri", copy_desc:"Cop\u00EFo", paste_desc:"Gludo", image_props_desc:"Priodweddau delwedd", newdocument_desc:"Dogfen newydd", help_desc:"Cymorth", blockquote_desc:"Dyfyniad bloc", clipboard_msg:"Nid yw Cop\u00EFo/Torri/Gludo ar gael mewn Mozilla a Firefox.\r\nYdych chi eisiau mwy o wybodaeth am y mater yma?", path:"Llwybr", newdocument:"A ydych chi'n si\u0175r eich bod eisiau clirio'r holl cynnwys?", toolbar_focus:"Neidio i botymau offeryn - Alt+Q, Neidio i olygydd - Alt-Z, Neidio i lwybr elfen - Alt-X", more_colors:"Mwy o liwiau" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/cy_dlg.js000066400000000000000000000034751226600447100241440ustar00rootroot00000000000000tinyMCE.addI18n('cy.advanced_dlg',{ about_title:"Ynglyn TinyMCE", about_general:"Ynglyn", about_help:"Cymorth", about_license:"Twyddedd", about_plugins:"Ategion", about_plugin:"Ategyn", about_author:"Awdur", about_version:"Fersion", about_loaded:"Ategion wedi llwytho", anchor_title:"Mewnosod/golygu angor", anchor_name:"Enw angor", code_title:"Golygydd Ffynhonell HTML", code_wordwrap:"Amlapio geiriau", colorpicker_title:"Dewis lliw", colorpicker_picker_tab:"Dweisydd", colorpicker_picker_title:"Dewisydd lliw", colorpicker_palette_tab:"Palet", colorpicker_palette_title:"Lliwiau palet", colorpicker_named_tab:"Wedi'u enwi", colorpicker_named_title:"Lliwiau wedi'u enwi", colorpicker_color:"Lliw:", colorpicker_name:"Enw:", charmap_title:"Dewis n\u00F4d addasiedig", image_title:"Mewnosod/golygu delwedd", image_src:"URL delwedd", image_alt:"disgrifiad delwedd", image_list:"Rhestr delweddau", image_border:"Border", image_dimensions:"Dimensiynau", image_vspace:"Gofod fertigol", image_hspace:"Gofod llorweddol", image_align:"Aliniad", image_align_baseline:"Gwaelodlin", image_align_top:"Pen", image_align_middle:"Canol", image_align_bottom:"Gwaelod", image_align_texttop:"Pen testun", image_align_textbottom:"Gwaelod testun", image_align_left:"Chwith", image_align_right:"De", link_title:"Mewnosod/golygu cyswllt", link_url:"URL cyswllt", link_target:"Targed", link_target_same:"Agor cyswllt yn yr un ffenst", link_target_blank:"Agor cyswllt mewn ffenst newydd", link_titlefield:"Teitl", link_is_email:"Mae'r URL a rydych wedi rhoi yn edrych fel cyferiad e-bost, ydych chi eisiau ychwanegu'r rhagddodiad mailto: sydd angen?", link_is_external:"Mae'r URL a rydych wedi rhoi yn edrych fel cyswllt allannol, ydych chi eisiau ychwanegu'r rhagddodiad http:// sydd angen?", link_list:"Rhestr cysylltau" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/da.js000066400000000000000000000040761226600447100232650ustar00rootroot00000000000000tinyMCE.addI18n('da.advanced',{ style_select:"Typografier", font_size:"Skriftst\u00F8rrelse", fontdefault:"Skrifttype", block:"Format", paragraph:"Afsnit", div:"Div", address:"Adresse", pre:"Pr\u00E6formatteret", h1:"Overskrift 1", h2:"Overskrift 2", h3:"Overskrift 3", h4:"Overskrift 4", h5:"Overskrift 5", h6:"Overskrift 6", blockquote:"Blokcitat", code:"Kode", samp:"Kodeeksempel", dt:"Definitionsterm ", dd:"Definitionsbeskrivelse", bold_desc:"Fed (Ctrl+B)", italic_desc:"Kursiv (Ctrl+I)", underline_desc:"Understreget (Ctrl+U)", striketrough_desc:"Gennemstreget", justifyleft_desc:"Venstrejusteret", justifycenter_desc:"Centreret", justifyright_desc:"H\u00F8jrejusteret", justifyfull_desc:"Lige marginer", bullist_desc:"Unummereret punktopstilling", numlist_desc:"Nummereret punktopstilling", outdent_desc:"Formindsk indrykning", indent_desc:"\u00D8g indrykning", undo_desc:"Fortryd (Ctrl+Z)", redo_desc:"Gendan (Ctrl+Y)", link_desc:"Inds\u00E6t/rediger link", unlink_desc:"Fjern link", image_desc:"Inds\u00E6t/rediger billede", cleanup_desc:"Ryd op i uordentlig kode", code_desc:"Rediger HTML-kilde", sub_desc:"S\u00E6nket skrift", sup_desc:"H\u00E6vet skrift", hr_desc:"Inds\u00E6t horisontal linie", removeformat_desc:"Fjern formatering", custom1_desc:"Din egen beskrivelse her", forecolor_desc:"V\u00E6lg tekstfarve", backcolor_desc:"V\u00E6lg baggrundsfarve", charmap_desc:"Inds\u00E6t specialtegn", visualaid_desc:"Sl\u00E5 hj\u00E6lp/synlige elementer til/fra", anchor_desc:"Inds\u00E6t/rediger anker", cut_desc:"Klip", copy_desc:"Kopier", paste_desc:"Inds\u00E6t", image_props_desc:"Billedegenskaber", newdocument_desc:"Nyt dokument", help_desc:"Hj\u00E6lp", blockquote_desc:"Blokcitat", clipboard_msg:"Kopier/Klip/inds\u00E6t er ikke muligt i Mozilla og Firefox.\nVil du have mere information om dette emne?", path:"Sti", newdocument:"Er du sikker p\u00E5 du vil slette alt indhold?", toolbar_focus:"Hop til v\u00E6rkt\u00F8jsknapper - Alt+Q, Skift til redigering - Alt-Z, Skift til element sti - Alt-X", more_colors:"Flere farver" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/da_dlg.js000066400000000000000000000036071226600447100241120ustar00rootroot00000000000000tinyMCE.addI18n('da.advanced_dlg',{ about_title:"Om TinyMCE", about_general:"Om", about_help:"Hj\u00E6lp", about_license:"Licens", about_plugins:"Udvidelser", about_plugin:"Udvidelse", about_author:"Forfatter", about_version:"Version", about_loaded:"Indl\u00E6ste udvidelser", anchor_title:"Inds\u00E6t/rediger anker", anchor_name:"Navn p\u00E5 anker", code_title:"HTML kildekode-redigering", code_wordwrap:"Tekstombrydning", colorpicker_title:"V\u00E6lg en farve", colorpicker_picker_tab:"V\u00E6lger", colorpicker_picker_title:"Farvev\u00E6lger", colorpicker_palette_tab:"Palette", colorpicker_palette_title:"Palette-farver", colorpicker_named_tab:"Navngivet", colorpicker_named_title:"Navngivet farve", colorpicker_color:"Farve:", colorpicker_name:"Navn:", charmap_title:"V\u00E6lg specialtegn", image_title:"Inds\u00E6t/rediger billede", image_src:"Billede URL", image_alt:"Billedbeskrivelse", image_list:"Liste over billeder", image_border:"Kant", image_dimensions:"Dimensioner", image_vspace:"Vertikal afstand", image_hspace:"Horisontal afstand", image_align:"Justering", image_align_baseline:"Grundlinie", image_align_top:"Toppen", image_align_middle:"Centreret", image_align_bottom:"Bunden", image_align_texttop:"Tekst toppen", image_align_textbottom:"Tekst bunden", image_align_left:"Venstre", image_align_right:"H\u00F8jre", link_title:"Inds\u00E6t/rediger link", link_url:"Link URL", link_target:"Target", link_target_same:"\u00C5ben link i samme vindue", link_target_blank:"\u00C5ben link i nyt vindue", link_titlefield:"Titel", link_is_email:"Den URL, der er indtastet, ser ud til at v\u00E6re en emailadresse. Vil du have tilf\u00F8jet det p\u00E5kr\u00E6vede mailto: foran?", link_is_external:"Den URL, der er indtastet, ser ud til at v\u00E6re et eksternt link. Vil du have tilf\u00F8jet det p\u00E5kr\u00E6vede http:// foran?", link_list:"Liste over links" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/de.js000066400000000000000000000043311226600447100232630ustar00rootroot00000000000000tinyMCE.addI18n('de.advanced',{ style_select:"Format", font_size:"Schriftgr\u00F6\u00DFe", fontdefault:"Schriftart", block:"Vorlage", paragraph:"Absatz", div:"Zusammenh\u00E4ngender Bereich", address:"Adresse", pre:"Rohdaten", h1:"\u00DCberschrift 1", h2:"\u00DCberschrift 2", h3:"\u00DCberschrift 3", h4:"\u00DCberschrift 4", h5:"\u00DCberschrift 5", h6:"\u00DCberschrift 6", blockquote:"Zitatblock", code:"Code", samp:"Beispiel", dt:"Definitionsbegriff", dd:"Definitionsbeschreibung", bold_desc:"Fett (Strg+B)", italic_desc:"Kursiv (Strg+I)", underline_desc:"Unterstrichen (Strg+U)", striketrough_desc:"Durchgestrichen", justifyleft_desc:"Links ausgerichtet", justifycenter_desc:"Mittig ausgerichtet", justifyright_desc:"Rechts ausgerichtet", justifyfull_desc:"Blocksatz", bullist_desc:"Unsortierte Liste", numlist_desc:"Sortierte Liste", outdent_desc:"Ausr\u00FCcken", indent_desc:"Einr\u00FCcken", undo_desc:"R\u00FCckg\u00E4ngig (Strg+Z)", redo_desc:"Wiederholen (Strg+Y)", link_desc:"Link einf\u00FCgen/ver\u00E4ndern", unlink_desc:"Link entfernen", image_desc:"Bild einf\u00FCgen/ver\u00E4ndern", cleanup_desc:"Quellcode aufr\u00E4umen", code_desc:"HTML-Quellcode bearbeiten", sub_desc:"Tiefgestellt", sup_desc:"Hochgestellt", hr_desc:"Trennlinie einf\u00FCgen", removeformat_desc:"Formatierungen zur\u00FCcksetzen", custom1_desc:"Benutzerdefinierte Beschreibung", forecolor_desc:"Textfarbe", backcolor_desc:"Hintergrundfarbe", charmap_desc:"Sonderzeichen einf\u00FCgen", visualaid_desc:"Hilfslinien und unsichtbare Elemente ein-/ausblenden", anchor_desc:"Anker einf\u00FCgen/ver\u00E4ndern", cut_desc:"Ausschneiden", copy_desc:"Kopieren", paste_desc:"Einf\u00FCgen", image_props_desc:"Bildeigenschaften", newdocument_desc:"Neues Dokument", help_desc:"Hilfe", blockquote_desc:"Zitatblock", clipboard_msg:"Kopieren, Ausschneiden und Einf\u00FCgen sind im Mozilla Firefox nicht m\u00F6glich.\r\nWollen Sie mehr \u00FCber dieses Problem erfahren?", path:"Pfad", newdocument:"Wollen Sie wirklich den ganzen Inhalt l\u00F6schen?", toolbar_focus:"Zur Werkzeugleiste springen: Alt+Q; Zum Editor springen: Alt-Z; Zum Elementpfad springen: Alt-X", more_colors:"Weitere Farben", anchor_delta_width:"13" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/de_dlg.js000066400000000000000000000035051226600447100241130ustar00rootroot00000000000000tinyMCE.addI18n('de.advanced_dlg',{ about_title:"\u00DCber TinyMCE", about_general:"\u00DCber\u2026", about_help:"Hilfe", about_license:"Lizenzbedingungen", about_plugins:"Plugins", about_plugin:"Plugin", about_author:"Urheber", about_version:"Version", about_loaded:"Geladene Plugins", anchor_title:"Anker einf\u00FCgen/ver\u00E4ndern", anchor_name:"Name des Ankers", code_title:"HTML-Quellcode bearbeiten", code_wordwrap:"Automatischer Zeilenumbruch", colorpicker_title:"Farbe", colorpicker_picker_tab:"Farbwahl", colorpicker_picker_title:"Farbwahl", colorpicker_palette_tab:"Palette", colorpicker_palette_title:"Farbpalette", colorpicker_named_tab:"Benannte Farben", colorpicker_named_title:"Benannte Farben", colorpicker_color:"Farbe:", colorpicker_name:"Name:", charmap_title:"Sonderzeichen", image_title:"Bild einf\u00FCgen/bearbeiten", image_src:"Adresse", image_alt:"Alternativtext", image_list:"Bilderliste", image_border:"Rahmen", image_dimensions:"Ausma\u00DFe", image_vspace:"Vertikaler Abstand", image_hspace:"Horizontaler Abstand", image_align:"Ausrichtung", image_align_baseline:"Zeile", image_align_top:"Oben", image_align_middle:"Mittig", image_align_bottom:"Unten", image_align_texttop:"Oben im Text", image_align_textbottom:"Unten im Text", image_align_left:"Links", image_align_right:"Rechts", link_title:"Link einf\u00FCgen/bearbeiten", link_url:"Adresse", link_target:"Fenster", link_target_same:"Im selben Fenster \u00F6ffnen", link_target_blank:"Neues Fenster \u00F6ffnen", link_titlefield:"Titel", link_is_email:"Diese Adresse scheint eine E-Mail-Adresse zu sein. M\u00F6chten Sie das dazu ben\u00F6tigte mailto: voranstellen?", link_is_external:"Diese Adresse scheint ein externer Link zu sein. M\u00F6chten Sie das dazu ben\u00F6tigte http:// voranstellen?", link_list:"Linkliste" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/dv.js000066400000000000000000000035501226600447100233060ustar00rootroot00000000000000tinyMCE.addI18n('dv.advanced',{ style_select:"Styles", font_size:"Font size", fontdefault:"Font family", block:"Format", paragraph:"Paragraph", div:"Div", address:"Address", pre:"Preformatted", h1:"Heading 1", h2:"Heading 2", h3:"Heading 3", h4:"Heading 4", h5:"Heading 5", h6:"Heading 6", blockquote:"Blockquote", code:"Code", samp:"Code sample", dt:"Definition term ", dd:"Definition description", bold_desc:"Bold (Ctrl+B)", italic_desc:"Italic (Ctrl+I)", underline_desc:"Underline (Ctrl+U)", striketrough_desc:"Strikethrough", justifyleft_desc:"Align left", justifycenter_desc:"Align center", justifyright_desc:"Align right", justifyfull_desc:"Align full", bullist_desc:"Unordered list", numlist_desc:"Ordered list", outdent_desc:"Outdent", indent_desc:"Indent", undo_desc:"Undo (Ctrl+Z)", redo_desc:"Redo (Ctrl+Y)", link_desc:"Insert/edit link", unlink_desc:"Unlink", image_desc:"Insert/edit image", cleanup_desc:"Cleanup messy code", code_desc:"Edit HTML Source", sub_desc:"Subscript", sup_desc:"Superscript", hr_desc:"Insert horizontal ruler", removeformat_desc:"Remove formatting", custom1_desc:"Your custom description here", forecolor_desc:"Select text color", backcolor_desc:"Select background color", charmap_desc:"Insert custom character", visualaid_desc:"Toggle guidelines/invisible elements", anchor_desc:"Insert/edit anchor", cut_desc:"Cut", copy_desc:"Copy", paste_desc:"Paste", image_props_desc:"Image properties", newdocument_desc:"New document", help_desc:"Help", blockquote_desc:"Blockquote", clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?", path:"Path", newdocument:"Are you sure you want clear all contents?", toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X", more_colors:"More colors" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/dv_dlg.js000066400000000000000000000032741226600447100241370ustar00rootroot00000000000000tinyMCE.addI18n('dv.advanced_dlg',{ about_title:"About TinyMCE", about_general:"About", about_help:"Help", about_license:"License", about_plugins:"Plugins", about_plugin:"Plugin", about_author:"Author", about_version:"Version", about_loaded:"Loaded plugins", anchor_title:"Insert/edit anchor", anchor_name:"Anchor name", code_title:"HTML Source Editor", code_wordwrap:"Word wrap", colorpicker_title:"Select a color", colorpicker_picker_tab:"Picker", colorpicker_picker_title:"Color picker", colorpicker_palette_tab:"Palette", colorpicker_palette_title:"Palette colors", colorpicker_named_tab:"Named", colorpicker_named_title:"Named colors", colorpicker_color:"Color:", colorpicker_name:"Name:", charmap_title:"Select custom character", image_title:"Insert/edit image", image_src:"Image URL", image_alt:"Image description", image_list:"Image list", image_border:"Border", image_dimensions:"Dimensions", image_vspace:"Vertical space", image_hspace:"Horizontal space", image_align:"Alignment", image_align_baseline:"Baseline", image_align_top:"Top", image_align_middle:"Middle", image_align_bottom:"Bottom", image_align_texttop:"Text top", image_align_textbottom:"Text bottom", image_align_left:"Left", image_align_right:"Right", link_title:"Insert/edit link", link_url:"Link URL", link_target:"Target", link_target_same:"Open link in the same window", link_target_blank:"Open link in a new window", link_titlefield:"Title", link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", link_list:"Link list" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/el.js000066400000000000000000000154661226600447100233060ustar00rootroot00000000000000tinyMCE.addI18n('el.advanced',{ style_select:"\u03A3\u03C4\u03C5\u03BB", font_size:"\u039C\u03AD\u03B3\u03B5\u03B8\u03BF\u03C2 \u0393\u03C1\u03B1\u03BC\u03BC\u03AC\u03C4\u03C9\u03BD", fontdefault:"\u0393\u03C1\u03B1\u03BC\u03BC\u03B1\u03C4\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC", block:"\u039C\u03BF\u03C1\u03C6\u03BF\u03C0\u03BF\u03AF\u03B7\u03C3\u03B7", paragraph:"\u03A0\u03B1\u03C1\u03AC\u03B3\u03C1\u03B1\u03C6\u03BF\u03C2", div:"Div", address:"\u0394\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7", pre:"Pre", h1:"\u0395\u03C0\u03B9\u03BA\u03B5\u03C6\u03B1\u03BB\u03AF\u03B4\u03B1 1", h2:"\u0395\u03C0\u03B9\u03BA\u03B5\u03C6\u03B1\u03BB\u03AF\u03B4\u03B1 2", h3:"\u0395\u03C0\u03B9\u03BA\u03B5\u03C6\u03B1\u03BB\u03AF\u03B4\u03B1 3", h4:"\u0395\u03C0\u03B9\u03BA\u03B5\u03C6\u03B1\u03BB\u03AF\u03B4\u03B1 4", h5:"\u0395\u03C0\u03B9\u03BA\u03B5\u03C6\u03B1\u03BB\u03AF\u03B4\u03B1 5", h6:"\u0395\u03C0\u03B9\u03BA\u03B5\u03C6\u03B1\u03BB\u03AF\u03B4\u03B1 6", blockquote:"Blockquote", code:"\u039A\u03CE\u03B4\u03B9\u03BA\u03B1\u03C2", samp:"\u0394\u03B5\u03AF\u03B3\u03BC\u03B1 \u039A\u03CE\u03B4\u03B9\u03BA\u03B1", dt:"\u039F\u03C1\u03B9\u03C3\u03BC\u03CC\u03C2", dd:"\u03A0\u03B5\u03C1\u03B9\u03B3\u03C1\u03B1\u03C6\u03AE \u039F\u03C1\u03B9\u03C3\u03BC\u03BF\u03CD", bold_desc:"\u039C\u03B1\u03CD\u03C1\u03B1 (Ctrl+B)", italic_desc:"\u03A0\u03BB\u03AC\u03B3\u03B9\u03B1 (Ctrl+I)", underline_desc:"\u03A5\u03C0\u03BF\u03B3\u03C1\u03B1\u03BC\u03BC\u03B9\u03C3\u03BC\u03AD\u03BD\u03B1 (Ctrl+U)", striketrough_desc:"\u0394\u03B9\u03B1\u03B3\u03C1\u03B1\u03BC\u03BC\u03B9\u03C3\u03BC\u03AD\u03BD\u03B1", justifyleft_desc:"\u03A3\u03C4\u03BF\u03AF\u03C7\u03B9\u03C3\u03B7 \u03B1\u03C1\u03B9\u03C3\u03C4\u03B5\u03C1\u03AC", justifycenter_desc:"\u03A3\u03C4\u03BF\u03AF\u03C7\u03B9\u03C3\u03B7 \u03BA\u03AD\u03BD\u03C4\u03C1\u03BF", justifyright_desc:"\u03A3\u03C4\u03BF\u03AF\u03C7\u03B9\u03C3\u03B7 \u03B4\u03B5\u03BE\u03B9\u03AC", justifyfull_desc:"\u03A3\u03C4\u03BF\u03AF\u03C7\u03B9\u03C3\u03B7 \u03C0\u03BB\u03AE\u03C1\u03B7\u03C2", bullist_desc:"\u039B\u03AF\u03C3\u03C4\u03B1 \u03C7\u03C9\u03C1\u03AF\u03C2 \u03C3\u03B5\u03B9\u03C1\u03AC", numlist_desc:"\u039B\u03AF\u03C3\u03C4\u03B1 \u03BC\u03B5 \u03C3\u03B5\u03B9\u03C1\u03AC", outdent_desc:"\u03A0\u03C1\u03BF\u03B5\u03BE\u03BF\u03C7\u03AE", indent_desc:"\u0395\u03C3\u03BF\u03C7\u03AE", undo_desc:"\u0391\u03BD\u03B1\u03AF\u03C1\u03B5\u03C3\u03B7 (Ctrl+Z)", redo_desc:"\u0395\u03C0\u03B1\u03BD\u03AC\u03BB\u03B7\u03C8\u03B7 (Ctrl+Y)", link_desc:"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE/\u03B5\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1 \u03C3\u03C5\u03BD\u03B4\u03AD\u03C3\u03BC\u03BF\u03C5", unlink_desc:"\u039A\u03B1\u03C4\u03AC\u03C1\u03B3\u03B7\u03C3\u03B7 \u03C3\u03C5\u03BD\u03B4\u03AD\u03C3\u03BC\u03BF\u03C5", image_desc:"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE/\u03B5\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1 \u03B5\u03B9\u03BA\u03CC\u03BD\u03B1\u03C2", cleanup_desc:"\u039A\u03B1\u03B8\u03B1\u03C1\u03B9\u03C3\u03BC\u03CC\u03C2 \u03BC\u03C0\u03B5\u03C1\u03B4\u03B5\u03BC\u03AD\u03BD\u03BF\u03C5 \u03BA\u03CE\u03B4\u03B9\u03BA\u03B1", code_desc:"\u0395\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1 HTML \u039A\u03CE\u03B4\u03B9\u03BA\u03B1", sub_desc:"\u0394\u03B5\u03AF\u03BA\u03C4\u03B7\u03C2", sup_desc:"\u0395\u03BA\u03B8\u03AD\u03C4\u03B7\u03C2", hr_desc:"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE \u03BF\u03C1\u03B9\u03B6\u03CC\u03BD\u03C4\u03B9\u03B1\u03C2 \u03B3\u03C1\u03B1\u03BC\u03BC\u03AE\u03C2", removeformat_desc:"\u0391\u03C6\u03B1\u03AF\u03C1\u03B5\u03C3\u03B7 \u03BC\u03BF\u03C1\u03C6\u03BF\u03C0\u03BF\u03AF\u03B7\u03C3\u03B7\u03C2", custom1_desc:"\u0397 \u03C0\u03B5\u03C1\u03B9\u03B3\u03C1\u03B1\u03C6\u03AE \u03C3\u03B1\u03C2 \u03B5\u03B4\u03CE", forecolor_desc:"\u0395\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE \u03C7\u03C1\u03CE\u03BC\u03B1\u03C4\u03BF\u03C2 \u03BA\u03B5\u03B9\u03BC\u03AD\u03BD\u03BF\u03C5", backcolor_desc:"\u0395\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE \u03C7\u03C1\u03CE\u03BC\u03B1\u03C4\u03BF\u03C2 \u03C6\u03CC\u03BD\u03C4\u03BF\u03C5", charmap_desc:"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE \u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B1", visualaid_desc:"\u0395\u03BC\u03C6\u03AC\u03BD\u03B9\u03C3\u03B7/\u0391\u03C0\u03CC\u03BA\u03C1\u03C5\u03C8\u03B7 \u03B2\u03BF\u03B7\u03B8\u03B7\u03C4\u03B9\u03BA\u03CE\u03BD \u03B3\u03C1\u03B1\u03BC\u03BC\u03CE\u03BD \u03BA\u03B1\u03B9 \u03B1\u03CC\u03C1\u03B1\u03C4\u03C9\u03BD \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03C9\u03BD", anchor_desc:"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE/\u03B5\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1 anchor", cut_desc:"\u0391\u03C0\u03BF\u03BA\u03BF\u03C0\u03AE", copy_desc:"\u0391\u03BD\u03C4\u03B9\u03B3\u03C1\u03B1\u03C6\u03AE", paste_desc:"\u0395\u03C0\u03B9\u03BA\u03CC\u03BB\u03BB\u03B7\u03C3\u03B7", image_props_desc:"\u0399\u03B4\u03B9\u03CC\u03C4\u03B7\u03C4\u03B5\u03C2 \u03B5\u03B9\u03BA\u03CC\u03BD\u03B1\u03C2", newdocument_desc:"\u039D\u03AD\u03BF \u03AD\u03B3\u03B3\u03C1\u03B1\u03C6\u03BF", help_desc:"\u0392\u03BF\u03AE\u03B8\u03B5\u03B9\u03B1", blockquote_desc:"Blockquote", clipboard_msg:"\u039F\u03B9 \u03BB\u03B5\u03B9\u03C4\u03BF\u03C5\u03C1\u03B3\u03AF\u03B5\u03C2 \u0391\u03BD\u03C4\u03B9\u03B3\u03C1\u03B1\u03C6\u03AE/\u0391\u03C0\u03BF\u03BA\u03BF\u03C0\u03AE/\u0395\u03C0\u03B9\u03BA\u03CC\u03BB\u03BB\u03B7\u03C3\u03B7 \u03B4\u03B5\u03BD \u03B5\u03AF\u03BD\u03B1\u03B9 \u03B4\u03B9\u03B1\u03B8\u03AD\u03C3\u03B9\u03BC\u03B5\u03C2 \u03C3\u03B5 Mozilla \u03BA\u03B1\u03B9 Firefox.\n\u0398\u03AD\u03BB\u03B5\u03C4\u03B5 \u03C0\u03B5\u03C1\u03B9\u03C3\u03C3\u03CC\u03C4\u03B5\u03C1\u03B5\u03C2 \u03C0\u03BB\u03B7\u03C1\u03BF\u03C6\u03BF\u03C1\u03AF\u03B5\u03C2 ;", path:"\u0394\u03B9\u03B1\u03B4\u03C1\u03BF\u03BC\u03AE", newdocument:"\u03A3\u03B9\u03AF\u03B3\u03BF\u03C5\u03C1\u03B1 \u03B8\u03AD\u03BB\u03B5\u03C4\u03B5 \u03BD\u03B1 \u03BA\u03B1\u03B8\u03B1\u03C1\u03AF\u03C3\u03B5\u03C4\u03B5 \u03CC\u03BB\u03BF \u03C4\u03BF \u03C0\u03B5\u03C1\u03B9\u03B5\u03C7\u03CC\u03BC\u03B5\u03BD\u03BF ;", toolbar_focus:"\u039C\u03B5\u03C4\u03AC\u03B2\u03B1\u03C3\u03B7 \u03C3\u03C4\u03B1 \u03BA\u03BF\u03C5\u03BC\u03C0\u03B9\u03AC \u03B5\u03C1\u03B3\u03B1\u03BB\u03B5\u03AF\u03C9\u03BD - Alt+Q, \u039C\u03B5\u03C4\u03AC\u03B2\u03B1\u03C3\u03B7 \u03C3\u03C4\u03BF\u03BD \u03B5\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03C4\u03AE \u03BA\u03B5\u03B9\u03BC\u03AD\u03BD\u03BF\u03C5 - Alt-Z, \u039C\u03B5\u03C4\u03AC\u03B2\u03B1\u03C3\u03B7 \u03C3\u03C4\u03B7\u03BD \u03B4\u03B9\u03B1\u03B4\u03C1\u03BF\u03BC\u03AE \u03C4\u03BF\u03C5 \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03BF\u03C5 - Alt-X", more_colors:"\u03A0\u03B5\u03C1\u03B9\u03C3\u03C3\u03CC\u03C4\u03B5\u03C1\u03B1 \u03C7\u03C1\u03CE\u03BC\u03B1\u03C4\u03B1", image_delta_width:"20", link_delta_width:"80" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/el_dlg.js000066400000000000000000000125341226600447100241250ustar00rootroot00000000000000tinyMCE.addI18n('el.advanced_dlg',{ about_title:"\u03A3\u03C7\u03B5\u03C4\u03B9\u03BA\u03AC \u03BC\u03B5 \u03C4\u03BF TinyMCE", about_general:"\u03A3\u03C7\u03B5\u03C4\u03B9\u03BA\u03AC", about_help:"\u0392\u03BF\u03AE\u03B8\u03B5\u03B9\u03B1", about_license:"\u0386\u03B4\u03B5\u03B9\u03B1", about_plugins:"\u03A3\u03C7\u03B5\u03C4\u03B9\u03BA\u03AC \u03BC\u03B5 \u03C4\u03B1 \u03C0\u03C1\u03CC\u03C3\u03B8\u03B5\u03C4\u03B1", about_plugin:"\u03A3\u03C7\u03B5\u03C4\u03B9\u03BA\u03AC \u03BC\u03B5 \u03C4\u03BF \u03C0\u03C1\u03CC\u03C3\u03B8\u03B5\u03C4\u03BF", about_author:"\u03A3\u03C5\u03B3\u03B3\u03C1\u03B1\u03C6\u03AD\u03B1\u03C2", about_version:"\u0388\u03BA\u03B4\u03BF\u03C3\u03B7", about_loaded:"\u03A6\u03BF\u03C1\u03C4\u03C9\u03BC\u03AD\u03BD\u03B1 \u03C0\u03C1\u03CC\u03C3\u03B8\u03B5\u03C4\u03B1", anchor_title:"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE/\u03B5\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1 anchor", anchor_name:"\u038C\u03BD\u03BF\u03BC\u03B1 anchor", code_title:"\u0395\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03C4\u03AE\u03C2 \u03BA\u03CE\u03B4\u03B9\u03BA\u03B1 HTML", code_wordwrap:"\u0391\u03BD\u03B1\u03B4\u03AF\u03C0\u03BB\u03C9\u03C3\u03B7 \u03BA\u03B5\u03B9\u03BC\u03AD\u03BD\u03BF\u03C5", colorpicker_title:"\u0394\u03B9\u03B1\u03BB\u03AD\u03BE\u03C4\u03B5 \u03C7\u03C1\u03CE\u03BC\u03B1", colorpicker_picker_tab:"\u0395\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE", colorpicker_picker_title:"\u0395\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE \u03C7\u03C1\u03CE\u03BC\u03B1\u03C4\u03BF\u03C2", colorpicker_palette_tab:"\u03A0\u03B1\u03BB\u03AD\u03C4\u03B1", colorpicker_palette_title:"\u03A7\u03C1\u03CE\u03BC\u03B1\u03C4\u03B1 \u03C0\u03B1\u03BB\u03AD\u03C4\u03B1\u03C2", colorpicker_named_tab:"\u039F\u03BD\u03BF\u03BC\u03B1\u03C3\u03C4\u03B9\u03BA\u03AC", colorpicker_named_title:"\u039F\u03BD\u03BF\u03BC\u03B1\u03C3\u03C4\u03B9\u03BA\u03AC \u03C7\u03C1\u03CE\u03BC\u03B1\u03C4\u03B1", colorpicker_color:"\u03A7\u03C1\u03CE\u03BC\u03B1:", colorpicker_name:"\u038C\u03BD\u03BF\u03BC\u03B1:", charmap_title:"\u0395\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE \u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B1", image_title:"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE/\u03B5\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1 \u03B5\u03B9\u03BA\u03CC\u03BD\u03B1\u03C2", image_src:"\u0394\u03B9\u03B1\u03B4\u03C1\u03BF\u03BC\u03AE URL \u0395\u03B9\u03BA\u03CC\u03BD\u03B1\u03C2", image_alt:"\u03A0\u03B5\u03C1\u03B9\u03B3\u03C1\u03B1\u03C6\u03AE \u03B5\u03B9\u03BA\u03CC\u03BD\u03B1\u03C2", image_list:"\u039B\u03AF\u03C3\u03C4\u03B1 \u03B5\u03B9\u03BA\u03CC\u03BD\u03C9\u03BD", image_border:"\u03A0\u03BB\u03B1\u03AF\u03C3\u03B9\u03BF", image_dimensions:"\u0394\u03B9\u03B1\u03C3\u03C4\u03AC\u03C3\u03B5\u03B9\u03C2", image_vspace:"\u0391\u03C0\u03CC\u03C3\u03C4\u03B1\u03C3\u03B7 \u03BA\u03AC\u03B8\u03B5\u03C4\u03B7", image_hspace:"\u0391\u03C0\u03CC\u03C3\u03C4\u03B1\u03C3\u03B7 \u03BF\u03C1\u03B9\u03B6\u03CC\u03BD\u03C4\u03B9\u03B1", image_align:"\u03A3\u03C4\u03BF\u03AF\u03C7\u03B9\u03C3\u03B7", image_align_baseline:"\u0393\u03C1\u03B1\u03BC\u03BC\u03AE \u03C3\u03C4\u03BF\u03AF\u03C7\u03B9\u03C3\u03B7\u03C2 \u03B3\u03C1\u03B1\u03BC\u03BC\u03AC\u03C4\u03C9\u03BD", image_align_top:"\u0395\u03C0\u03AC\u03BD\u03C9", image_align_middle:"\u039C\u03AD\u03C3\u03B7", image_align_bottom:"\u039A\u03AC\u03C4\u03C9", image_align_texttop:"\u039A\u03AD\u03B9\u03BC\u03B5\u03BD\u03BF \u03C0\u03AC\u03BD\u03C9", image_align_textbottom:"\u039A\u03B5\u03AF\u03BC\u03B5\u03BD\u03BF \u03BA\u03AC\u03C4\u03C9", image_align_left:"\u0391\u03C1\u03B9\u03C3\u03C4\u03B5\u03C1\u03AC", image_align_right:"\u0394\u03B5\u03BE\u03B9\u03AC", link_title:"\u0395\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE/\u03B5\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1 \u03C3\u03C5\u03BD\u03B4\u03AD\u03C3\u03BC\u03BF\u03C5", link_url:"\u0394\u03B9\u03B1\u03B4\u03C1\u03BF\u03BC\u03AE URL \u03C3\u03C5\u03BD\u03B4\u03AD\u03C3\u03BC\u03BF\u03C5", link_target:"\u03A3\u03C4\u03CC\u03C7\u03BF\u03C2", link_target_same:"\u0386\u03BD\u03BF\u03B9\u03B3\u03BC\u03B1 \u03C3\u03C4\u03BF \u03AF\u03B4\u03B9\u03BF \u03C0\u03B1\u03C1\u03AC\u03B8\u03C5\u03C1\u03BF", link_target_blank:"\u0386\u03BD\u03BF\u03B9\u03B3\u03BC\u03B1 \u03C3\u03B5 \u03BD\u03AD\u03BF \u03C0\u03B1\u03C1\u03AC\u03B8\u03C5\u03C1\u03BF", link_titlefield:"\u03A4\u03AF\u03C4\u03BB\u03BF\u03C2", link_is_email:"\u0397 \u03B4\u03B9\u03B1\u03B4\u03C1\u03BF\u03BC\u03AE URL \u03C0\u03BF\u03C5 \u03B5\u03B9\u03C3\u03AC\u03B3\u03B1\u03C4\u03B5 \u03C6\u03B1\u03AF\u03BD\u03B5\u03C4\u03B1\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 email, \u03BD\u03B1 \u03C0\u03C1\u03BF\u03C3\u03C4\u03B5\u03B8\u03B5\u03AF \u03C4\u03BF \u03B1\u03C0\u03B1\u03C1\u03B1\u03AF\u03C4\u03B7\u03C4\u03BF mailto: ;", link_is_external:"\u0397 \u03B4\u03B9\u03B1\u03B4\u03C1\u03BF\u03BC\u03AE URL \u03C0\u03BF\u03C5 \u03B5\u03B9\u03C3\u03AC\u03B3\u03B1\u03C4\u03B5 \u03C6\u03B1\u03AF\u03BD\u03B5\u03C4\u03B1\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03B5\u03BE\u03C9\u03C4\u03B5\u03C1\u03B9\u03BA\u03CC\u03C2 \u03C3\u03CD\u03BD\u03B4\u03B5\u03C3\u03BC\u03BF\u03C2, \u03BD\u03B1 \u03C0\u03C1\u03BF\u03C3\u03C4\u03B5\u03B8\u03B5\u03AF \u03C4\u03BF \u03B1\u03C0\u03B1\u03C1\u03B1\u03AF\u03C4\u03B7\u03C4\u03BF http:// ;", link_list:"\u039B\u03AF\u03C3\u03C4\u03B1 \u03C3\u03C5\u03BD\u03B4\u03AD\u03C3\u03BC\u03C9\u03BD" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/en.js000066400000000000000000000044451226600447100233030ustar00rootroot00000000000000tinyMCE.addI18n('en.advanced',{"underline_desc":"Underline (Ctrl+U)","italic_desc":"Italic (Ctrl+I)","bold_desc":"Bold (Ctrl+B)",dd:"Definition Description",dt:"Definition Term ",samp:"Code Sample",code:"Code",blockquote:"Block Quote",h6:"Heading 6",h5:"Heading 5",h4:"Heading 4",h3:"Heading 3",h2:"Heading 2",h1:"Heading 1",pre:"Preformatted",address:"Address",div:"DIV",paragraph:"Paragraph",block:"Format",fontdefault:"Font Family","font_size":"Font Size","style_select":"Styles","anchor_delta_height":"","anchor_delta_width":"","charmap_delta_height":"","charmap_delta_width":"","colorpicker_delta_height":"","colorpicker_delta_width":"","link_delta_height":"","link_delta_width":"","image_delta_height":"","image_delta_width":"","more_colors":"More Colors...","toolbar_focus":"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X",newdocument:"Are you sure you want clear all contents?",path:"Path","clipboard_msg":"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?","blockquote_desc":"Block Quote","help_desc":"Help","newdocument_desc":"New Document","image_props_desc":"Image Properties","paste_desc":"Paste (Ctrl+V)","copy_desc":"Copy (Ctrl+C)","cut_desc":"Cut (Ctrl+X)","anchor_desc":"Insert/Edit Anchor","visualaid_desc":"show/Hide Guidelines/Invisible Elements","charmap_desc":"Insert Special Character","backcolor_desc":"Select Background Color","forecolor_desc":"Select Text Color","custom1_desc":"Your Custom Description Here","removeformat_desc":"Remove Formatting","hr_desc":"Insert Horizontal Line","sup_desc":"Superscript","sub_desc":"Subscript","code_desc":"Edit HTML Source","cleanup_desc":"Cleanup Messy Code","image_desc":"Insert/Edit Image","unlink_desc":"Unlink","link_desc":"Insert/Edit Link","redo_desc":"Redo (Ctrl+Y)","undo_desc":"Undo (Ctrl+Z)","indent_desc":"Increase Indent","outdent_desc":"Decrease Indent","numlist_desc":"Insert/Remove Numbered List","bullist_desc":"Insert/Remove Bulleted List","justifyfull_desc":"Align Full","justifyright_desc":"Align Right","justifycenter_desc":"Align Center","justifyleft_desc":"Align Left","striketrough_desc":"Strikethrough","help_shortcut":"Press ALT-F10 for toolbar. Press ALT-0 for help","rich_text_area":"Rich Text Area","shortcuts_desc":"Accessability Help",toolbar:"Toolbar"});glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/en_dlg.js000066400000000000000000000036741226600447100241340ustar00rootroot00000000000000tinyMCE.addI18n('en.advanced_dlg', {"link_list":"Link List","link_is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","link_is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?","link_titlefield":"Title","link_target_blank":"Open Link in a New Window","link_target_same":"Open Link in the Same Window","link_target":"Target","link_url":"Link URL","link_title":"Insert/Edit Link","image_align_right":"Right","image_align_left":"Left","image_align_textbottom":"Text Bottom","image_align_texttop":"Text Top","image_align_bottom":"Bottom","image_align_middle":"Middle","image_align_top":"Top","image_align_baseline":"Baseline","image_align":"Alignment","image_hspace":"Horizontal Space","image_vspace":"Vertical Space","image_dimensions":"Dimensions","image_alt":"Image Description","image_list":"Image List","image_border":"Border","image_src":"Image URL","image_title":"Insert/Edit Image","charmap_title":"Select Special Character", "charmap_usage":"Use left and right arrows to navigate.","colorpicker_name":"Name:","colorpicker_color":"Color:","colorpicker_named_title":"Named Colors","colorpicker_named_tab":"Named","colorpicker_palette_title":"Palette Colors","colorpicker_palette_tab":"Palette","colorpicker_picker_title":"Color Picker","colorpicker_picker_tab":"Picker","colorpicker_title":"Select a Color","code_wordwrap":"Word Wrap","code_title":"HTML Source Editor","anchor_name":"Anchor Name","anchor_title":"Insert/Edit Anchor","about_loaded":"Loaded Plugins","about_version":"Version","about_author":"Author","about_plugin":"Plugin","about_plugins":"Plugins","about_license":"License","about_help":"Help","about_general":"About","about_title":"About TinyMCE","anchor_invalid":"Please specify a valid anchor name.","accessibility_help":"Accessibility Help","accessibility_usage_title":"General Usage","invalid_color_value":"Invalid color value","":""}); glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/es.js000066400000000000000000000042321226600447100233020ustar00rootroot00000000000000tinyMCE.addI18n('es.advanced',{ style_select:"Estilos", font_size:"Tama\u00F1o", fontdefault:"Fuente", block:"Formato", paragraph:"P\u00E1rrafo", div:"Div", address:"Direcci\u00F3n", pre:"Preformateado", h1:"Encabezado 1", h2:"Encabezado 2", h3:"Encabezado 3", h4:"Encabezado 4", h5:"Encabezado 5", h6:"Encabezado 6", blockquote:"Cita", code:"C\u00F3digo", samp:"Ejemplo de c\u00F3digo", dt:"T\u00E9rmino de definici\u00F3n", dd:"Descripci\u00F3n de definici\u00F3n", bold_desc:"Negrita (Ctrl+B)", italic_desc:"Cursiva (Ctrl+I)", underline_desc:"Subrayado (Ctrl+U)", striketrough_desc:"Tachado", justifyleft_desc:"Alinear a la izquierda", justifycenter_desc:"Alinear al centro", justifyright_desc:"Alinear a la derecha", justifyfull_desc:"Justificar", bullist_desc:"Lista desordenada", numlist_desc:"Lista ordenada", outdent_desc:"Reducir sangr\u00EDa", indent_desc:"Aumentar sangr\u00EDa", undo_desc:"Deshacer (Ctrl+Z)", redo_desc:"Rehacer (Ctrl+Y)", link_desc:"Insertar/editar hiperv\u00EDnculo", unlink_desc:"Quitar hiperv\u00EDnculo", image_desc:"Insertar/editar imagen", cleanup_desc:"Limpiar c\u00F3digo basura", code_desc:"Editar c\u00F3digo HTML", sub_desc:"Sub\u00EDndice", sup_desc:"Super\u00EDndice", hr_desc:"Insertar regla horizontal", removeformat_desc:"Limpiar formato", custom1_desc:"Su descripci\u00F3n personal aqu\u00ED", forecolor_desc:"Elegir color del texto", backcolor_desc:"Elegir color de fondo", charmap_desc:"Insertar caracteres personalizados", visualaid_desc:"Mostrar/ocultar l\u00EDnea de gu\u00EDa/elementos invisibles", anchor_desc:"Insertar/editar ancla", cut_desc:"Cortar", copy_desc:"Copiar", paste_desc:"Pegar", image_props_desc:"Propiedades de imagen", newdocument_desc:"Nuevo documento", help_desc:"Ayuda", blockquote_desc:"Cita", clipboard_msg:"Copiar/Cortar/Pegar no se encuentra disponible en Mozilla y Firefox.\n \u00BFQuiere m\u00E1s informaci\u00F3n sobre este tema?", path:"Ruta", newdocument:" \u00BFSeguro que desea limpiar todo el contenido?", toolbar_focus:"Ir a los botones de herramientas - Alt+Q, Ir al editor - Alt-Z, Ir a la ruta del elemento - Alt-X", more_colors:"M\u00E1s colores" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/es_dlg.js000066400000000000000000000037051226600447100241340ustar00rootroot00000000000000tinyMCE.addI18n('es.advanced_dlg',{ about_title:"Acerca de TinyMCE", about_general:"Acerca de ", about_help:"Ayuda", about_license:"Licencia", about_plugins:"Complementos", about_plugin:"Complemento", about_author:"Autor", about_version:"Versi\u00F3n", about_loaded:"Complementos cargados", anchor_title:"Insertar/editar ancla", anchor_name:"Nombre del ancla", code_title:"Editor del c\u00F3digo fuente HTML", code_wordwrap:"Ajustar al margen", colorpicker_title:"Elegir color", colorpicker_picker_tab:"Selector", colorpicker_picker_title:"Paleta de color", colorpicker_palette_tab:"Paleta", colorpicker_palette_title:"Paleta de colores", colorpicker_named_tab:"Nombrados", colorpicker_named_title:"Colores nombrados", colorpicker_color:"Color:", colorpicker_name:"Nombre:", charmap_title:"Elegir caracter personalizado", image_title:"Insertar/editar imagen", image_src:"URL de la Imagen", image_alt:"Descripci\u00F3n de la Imagen", image_list:"Lista de la Imagen", image_border:"Borde", image_dimensions:"Dimensi\u00F3n", image_vspace:"Espacio vertical", image_hspace:"Espacio horizontal", image_align:"Alineaci\u00F3n", image_align_baseline:"L\u00EDnea base", image_align_top:"Arriba", image_align_middle:"Medio", image_align_bottom:"Debajo", image_align_texttop:"Texto arriba", image_align_textbottom:"Texto debajo", image_align_left:"Izquierda", image_align_right:"Derecha", link_title:"Insertar/editar hiperv\u00EDnculo", link_url:"URL del hiperv\u00EDnculo", link_target:"Destino", link_target_same:"Abrir v\u00EDnculo en la misma ventana", link_target_blank:"Abrir v\u00EDnculo en una ventana nueva", link_titlefield:"T\u00EDtulo", link_is_email:"La URL que introdujo parece ser una direcci\u00F3n de email, \u00BFdesea agregar el prefijo mailto: necesario?", link_is_external:"La URL que introdujo parece ser un v\u00EDnculo externo, \u00BFdesea agregar el prefijo http:// necesario?", link_list:"Lista de hiperv\u00EDnculos" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/et.js000066400000000000000000000041271226600447100233060ustar00rootroot00000000000000tinyMCE.addI18n('et.advanced',{ style_select:"Stiilid", font_size:"Fondi suurus", fontdefault:"Font", block:"Formaat", paragraph:"Paragraaf", div:"Div", address:"Aadress", pre:"Eelformeeritud", h1:"Heading 1", h2:"Heading 2", h3:"Heading 3", h4:"Heading 4", h5:"Heading 5", h6:"Heading 6", blockquote:"Plokkviide", code:"Kood", samp:"Koodi n\u00E4ide", dt:"Defineeringu tingimus", dd:"Defineeringu kirjeldus", bold_desc:"Rasvane (Ctrl+B)", italic_desc:"Kursiiv (Ctrl+I)", underline_desc:"Allajoonitud (Ctrl+U)", striketrough_desc:"L\u00E4bijoonitud", justifyleft_desc:"Vasak joondus", justifycenter_desc:"Keskjoondus", justifyright_desc:"Parem joondus", justifyfull_desc:"T\u00E4isjoondus", bullist_desc:"Ebakorrap\u00E4rane loetelu", numlist_desc:"Korrap\u00E4rane loetelu", outdent_desc:"Taanda v\u00E4lja", indent_desc:"Taanda sisse", undo_desc:"V\u00F5ta tagasi (Ctrl+Z)", redo_desc:"Tee uuesti (Ctrl+Y)", link_desc:"Sisesta/redigeeri link", unlink_desc:"Eemalda link", image_desc:"Sisesta/redigeeri pilt", cleanup_desc:"Puhasta segane kood", code_desc:"Redigeeri HTML l\u00E4htekoodi", sub_desc:"Alaindeks", sup_desc:"\u00DClaindeks", hr_desc:"Sisesta horisontaalne joonlaud", removeformat_desc:"Eemalda vormindus", custom1_desc:"Teie kohandatud kirjeldus siia", forecolor_desc:"Vali teksti v\u00E4rv", backcolor_desc:"Vali tausta v\u00E4rv", charmap_desc:"Sisesta kohandatud kirjam\u00E4rk", visualaid_desc:"L\u00FClita \u00FCmber juhtjooned/n\u00E4htamatud elemendid", anchor_desc:"Sisesta/redigeeri ankur", cut_desc:"L\u00F5ika", copy_desc:"Kopeeri", paste_desc:"Kleebi", image_props_desc:"Pildi kirjeldus", newdocument_desc:"Uus dokument", help_desc:"Abi", blockquote_desc:"Plokkviide", clipboard_msg:"Kopeeri/L\u00F5ika/Kleebi ei ole Mozillas ja Firefoxis saadaval. Kas soovid rohkem infot selle probleemi kohta?", path:"Tee", newdocument:"Oled sa kindel, et tahad kustutada k\u00F5ik sisud?", toolbar_focus:"H\u00FCppa t\u00F6\u00F6riista nuppudele - Alt+Q, H\u00FCppa redigeerijale - Alt-Z, H\u00FCppa elemendi teele - Alt-X", more_colors:"Rohkem v\u00E4rve" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/et_dlg.js000066400000000000000000000034301226600447100241300ustar00rootroot00000000000000tinyMCE.addI18n('et.advanced_dlg',{ about_title:"Teave TinyMCE kohta", about_general:"Teave", about_help:"Abi", about_license:"Litsents", about_plugins:"Lisad", about_plugin:"Lisa", about_author:"Autor", about_version:"Versioon", about_loaded:"Laetud lisad", anchor_title:"Sisesta/redigeeri ankur", anchor_name:"Ankru nimi", code_title:"HTML koodi redaktor", code_wordwrap:"S\u00F5na pakkimine", colorpicker_title:"Vali v\u00E4rv", colorpicker_picker_tab:"Korjaja", colorpicker_picker_title:"V\u00E4rvi korjaja", colorpicker_palette_tab:"Palett", colorpicker_palette_title:"Palett v\u00E4rvid", colorpicker_named_tab:"Nimetatud", colorpicker_named_title:"Nimetatud v\u00E4rvid", colorpicker_color:"V\u00E4rv:", colorpicker_name:"Nimi:", charmap_title:"Vali kohandatud t\u00E4hem\u00E4rk", image_title:"Sisestal/redigeeri pilt", image_src:"Pildi URL", image_alt:"Pildi kirjeldus", image_list:"Pildi loend", image_border:"Raam", image_dimensions:"Dimensioonid", image_vspace:"Vertikaalne vahe", image_hspace:"Horisontaalne vahe", image_align:"Reastus", image_align_baseline:"Kirjajoondus", image_align_top:"\u00DClemine", image_align_middle:"Keskmine", image_align_bottom:"Alumine", image_align_texttop:"Teksti tipp", image_align_textbottom:"Teksti p\u00F5hi", image_align_left:"Vasak", image_align_right:"Parem", link_title:"Sisesta/redigeeri link", link_url:"Link URL", link_target:"Sihtala", link_target_same:"Ava link samas aknas", link_target_blank:"Ava link uues aknas", link_titlefield:"Tiitel", link_is_email:"URL, mille te sisestasite, tundub olevat emaili aadress, kas soovite, et lisataks mailto: eesliite?", link_is_external:"URL, mille sisestasite, tundub olevat v\u00E4line link, kas soovite, et lisataks http:// eesliite?", link_list:"Lingi loetelu" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/fa.js000066400000000000000000000123761226600447100232710ustar00rootroot00000000000000tinyMCE.addI18n('fa.advanced',{ style_select:"\u0627\u0633\u062A\u06CC\u0644 \u0647\u0627", font_size:"\u0627\u0646\u062F\u0627\u0632\u0647 \u0642\u0644\u0645", fontdefault:"\u062E\u0627\u0646\u0648\u0627\u062F\u0647 \u0642\u0644\u0645", block:"\u0642\u0627\u0644\u0628", paragraph:"\u067E\u0627\u0631\u0627\u06AF\u0631\u0627\u0641", div:"Div", address:"\u0622\u062F\u0631\u0633", pre:"\u0642\u0627\u0644\u0628 \u0628\u0646\u062F\u06CC \u0634\u062F\u0647 \u0627\u0632 \u0642\u0628\u0644", h1:"\u0639\u0646\u0648\u0627\u0646 \u06AF\u0630\u0627\u0631\u06CC \u06F1", h2:"\u0639\u0646\u0648\u0627\u0646 \u06AF\u0630\u0627\u0631\u06CC 2", h3:"\u0639\u0646\u0648\u0627\u0646 \u06AF\u0630\u0627\u0631\u06CC 3", h4:"\u0639\u0646\u0648\u0627\u0646 \u06AF\u0630\u0627\u0631\u06CC 4", h5:"\u0639\u0646\u0648\u0627\u0646 \u06AF\u0630\u0627\u0631\u06CC 5", h6:"\u0639\u0646\u0648\u0627\u0646 \u06AF\u0630\u0627\u0631\u06CC 6", blockquote:"\u0628\u0644\u0648\u0643 \u0646\u0642\u0644 \u0642\u0648\u0644", code:"\u0643\u062F", samp:"\u0646\u0645\u0648\u0646\u0647 \u0643\u062F", dt:"\u062A\u0639\u0631\u06CC\u0641 \u0648\u0627\u0698\u0647 ", dd:"\u062A\u0639\u0631\u06CC\u0641 \u062A\u0648\u0636\u06CC\u062D", bold_desc:"\u0636\u062E\u06CC\u0645 (Ctrl+B)", italic_desc:"\u0643\u062C (Ctrl+I)", underline_desc:"\u0632\u06CC\u0631 \u062E\u0637 (Ctrl+U)", striketrough_desc:"\u062E\u0637 \u0648\u0633\u0637", justifyleft_desc:"\u062A\u0631\u0627\u0632 \u0686\u067E", justifycenter_desc:"\u062A\u0631\u0627\u0632 \u0648\u0633\u0637", justifyright_desc:"\u062A\u0631\u0627\u0632 \u0631\u0627\u0633\u062A", justifyfull_desc:"\u062A\u0631\u0627\u0632 \u0643\u0627\u0645\u0644", bullist_desc:"\u0644\u06CC\u0633\u062A \u0646\u0627\u0645\u0631\u062A\u0628", numlist_desc:"\u0644\u06CC\u0633\u062A \u0645\u0631\u062A\u0628", outdent_desc:"\u0628\u06CC\u0631\u0648\u0646 \u0622\u0645\u062F\u06AF\u06CC", indent_desc:"\u062A\u0648\u0631\u0641\u062A\u06AF\u06CC", undo_desc:"\u0627\u0646\u062C\u0627\u0645 \u0639\u0645\u0644 \u0642\u0628\u0644 (Ctrl+Z)", redo_desc:"\u0627\u0646\u062C\u0627\u0645 \u0639\u0645\u0644 \u0628\u0639\u062F (Ctrl+Y)", link_desc:"\u062F\u0631\u062C/\u0648\u06CC\u0631\u0627\u06CC\u0634 \u0644\u06CC\u0646\u0643", unlink_desc:"\u063A\u06CC\u0631 \u0644\u06CC\u0646\u0643 \u0643\u0631\u062F\u0646", image_desc:"\u062F\u0631\u062C/\u0648\u06CC\u0631\u0627\u06CC\u0634 \u062A\u0635\u0648\u06CC\u0631", cleanup_desc:"\u067E\u0627\u0643 \u0633\u0627\u0632\u06CC \u0643\u062F \u0647\u0627\u06CC \u0628\u0647\u0645 \u062E\u0648\u0631\u062F\u0647", code_desc:"\u0648\u06CC\u0631\u0627\u06CC\u0634 \u0633\u0648\u0631\u0633 HTML", sub_desc:"\u067E\u0627\u06CC\u06CC\u0646 \u0646\u0648\u06CC\u0633", sup_desc:"\u0628\u0627\u0644\u0627 \u0646\u0648\u06CC\u0633", hr_desc:"\u062F\u0631\u062C \u062E\u0637 \u0627\u0641\u0642\u06CC", removeformat_desc:"\u062D\u0630\u0641 \u0642\u0627\u0644\u0628 \u0628\u0646\u062F\u06CC", custom1_desc:"\u062A\u0648\u0636\u06CC\u062D \u0633\u0641\u0627\u0631\u0634\u06CC \u0634\u0645\u0627 \u062F\u0631 \u0627\u06CC\u0646\u062C\u0627", forecolor_desc:"\u0627\u0646\u062A\u062E\u0627\u0628 \u0631\u0646\u06AF \u0645\u062A\u0646", backcolor_desc:"\u0627\u0646\u062A\u062E\u0627\u0628 \u0631\u0646\u06AF \u0632\u0645\u06CC\u0646\u0647", charmap_desc:"\u062F\u0631\u062C \u0643\u0627\u0631\u0627\u0643\u062A\u0631 \u0633\u0641\u0627\u0631\u0634\u06CC", visualaid_desc:"\u062A\u0639\u0648\u06CC\u0636 \u0639\u0646\u0627\u0635\u0631 \u062E\u0637\u0648\u0637 \u0631\u0627\u0647\u0646\u0645\u0627/\u063A\u06CC\u0631 \u0642\u0627\u0628\u0644 \u0646\u0645\u0627\u06CC\u0627\u0646", anchor_desc:"\u062F\u0631\u062C/\u0648\u06CC\u0631\u0627\u06CC\u0634 \u0644\u0646\u06AF\u0631", cut_desc:"\u0628\u0631\u0634 (Cut)", copy_desc:"\u0643\u067E\u06CC", paste_desc:"\u0686\u0633\u0628\u0627\u0646\u062F\u0646 (Paste)", image_props_desc:"\u0645\u0634\u062E\u0635\u0627\u062A \u062A\u0635\u0648\u06CC\u0631", newdocument_desc:"\u0633\u0646\u062F \u062C\u062F\u06CC\u062F", help_desc:"\u0631\u0627\u0647\u0646\u0645\u0627\u06CC\u06CC", blockquote_desc:"\u0628\u0644\u0648\u0643 \u0646\u0642\u0644 \u0642\u0648\u0644", clipboard_msg:"\u0643\u067E\u06CC/\u0628\u0631\u0634 (Cut)/\u0686\u0633\u0628\u0627\u0646\u062F\u0646 (Paste) \u062F\u0631 Mozilla \u0648 Firefox \u0642\u0627\u0628\u0644 \u062F\u0633\u062A\u0631\u0633 \u0646\u0645\u06CC \u0628\u0627\u0634\u062F.\r\n\u0622\u06CC\u0627 \u0634\u0645\u0627 \u0627\u0637\u0644\u0627\u0639\u0627\u062A \u0628\u06CC\u0634\u062A\u0631\u06CC \u062F\u0631\u0628\u0627\u0631\u0647 \u0627\u06CC\u0646 \u0645\u0648\u0636\u0648\u0639 \u0645\u06CC \u062E\u0648\u0627\u0647\u06CC\u062F\u061F", path:"\u0645\u0633\u06CC\u0631", newdocument:"\u0622\u06CC\u0627 \u0634\u0645\u0627 \u0645\u06CC \u062E\u0648\u0627\u0647\u06CC\u062F \u062A\u0627 \u062A\u0645\u0627\u0645\u06CC \u0645\u062D\u062A\u0648\u0627 \u0631\u0627 \u067E\u0627\u0643 \u0643\u0646\u06CC\u062F\u061F", toolbar_focus:"\u067E\u0631\u0634 \u0628\u0647 \u062F\u0643\u0645\u0647 \u0647\u0627\u06CC \u0627\u0628\u0632\u0627\u0631 - Alt+Q \u060C \u067E\u0631\u0634 \u0628\u0647 \u0648\u06CC\u0631\u0627\u06CC\u0634\u06AF\u0631 - Alt-Z \u060C \u067E\u0631\u0634 \u0628\u0647 \u0645\u0633\u06CC\u0631 \u0639\u0646\u0635\u0631 - Alt-X", more_colors:"\u0631\u0646\u06AF\u0647\u0627\u06CC \u0628\u06CC\u0634\u062A\u0631" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/fa_dlg.js000066400000000000000000000107151226600447100241120ustar00rootroot00000000000000tinyMCE.addI18n('fa.advanced_dlg',{ about_title:"\u062F\u0631\u0628\u0627\u0631\u0647 TinyMCE", about_general:"\u062F\u0631\u0628\u0627\u0631\u0647", about_help:"\u0631\u0627\u0647\u0646\u0645\u0627\u06CC\u06CC", about_license:"\u0644\u06CC\u0633\u0627\u0646\u0633", about_plugins:"\u0627\u0644\u062D\u0627\u0642\u0627\u062A", about_plugin:"\u0627\u0644\u062D\u0627\u0642\u0647", about_author:"\u0645\u0624\u0644\u0641", about_version:"\u0646\u0633\u062E\u0647", about_loaded:"\u0627\u0644\u062D\u0627\u0642\u0627\u062A \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u0634\u062F\u0647", anchor_title:"\u062F\u0631\u062C/\u0648\u06CC\u0631\u0627\u06CC\u0634 \u0644\u0646\u06AF\u0631 (Anchor)", anchor_name:"\u0646\u0627\u0645 \u0644\u0646\u06AF\u0631 (Anchor)", code_title:"\u0648\u06CC\u0631\u0627\u06CC\u0634 \u0633\u0648\u0631\u0633 HTML", code_wordwrap:"\u0634\u0643\u0633\u062A\u0646 \u062E\u0637\u0648\u0637", colorpicker_title:"\u0627\u0646\u062A\u062E\u0627\u0628 \u06CC\u0643 \u0631\u0646\u06AF", colorpicker_picker_tab:"\u0627\u0646\u062A\u062E\u0627\u0628 \u0643\u0646\u0646\u062F\u0647", colorpicker_picker_title:"\u0627\u0646\u062A\u062E\u0627\u0628 \u0643\u0646\u0646\u062F\u0647 \u0631\u0646\u06AF", colorpicker_palette_tab:"\u0627\u0644\u06AF\u0648", colorpicker_palette_title:"\u0631\u0646\u06AF \u0647\u0627\u06CC \u0627\u0644\u06AF\u0648", colorpicker_named_tab:"\u0646\u0627\u0645 \u062F\u0627\u0631", colorpicker_named_title:"\u0631\u0646\u06AF \u0647\u0627\u06CC \u0646\u0627\u0645 \u062F\u0627\u0631", colorpicker_color:"\u0631\u0646\u06AF:", colorpicker_name:"\u0646\u0627\u0645:", charmap_title:"\u0627\u0646\u062A\u062E\u0627\u0628 \u0643\u0627\u0631\u0627\u0643\u062A\u0631 \u0633\u0641\u0627\u0631\u0634\u06CC", image_title:"\u062F\u0631\u062C/\u0648\u06CC\u0631\u0627\u06CC\u0634 \u062A\u0635\u0648\u06CC\u0631", image_src:"URL \u062A\u0635\u0648\u06CC\u0631", image_alt:"\u062A\u0648\u0636\u06CC\u062D \u062A\u0635\u0648\u06CC\u0631", image_list:"\u0644\u06CC\u0633\u062A \u062A\u0635\u0648\u06CC\u0631", image_border:"\u062D\u0627\u0634\u06CC\u0647", image_dimensions:"\u0627\u0628\u0639\u0627\u062F", image_vspace:"\u0641\u0627\u0635\u0644\u0647 \u0639\u0645\u0648\u062F\u06CC", image_hspace:"\u0641\u0627\u0635\u0644\u0647 \u0627\u0641\u0642\u06CC", image_align:"\u062A\u0631\u0627\u0632", image_align_baseline:"\u062E\u0637 \u067E\u0627\u06CC\u0647", image_align_top:"\u0628\u0627\u0644\u0627", image_align_middle:"\u0648\u0633\u0637", image_align_bottom:"\u067E\u0627\u06CC\u06CC\u0646", image_align_texttop:"\u0628\u0627\u0644\u0627 \u0645\u062A\u0646", image_align_textbottom:"\u067E\u0627\u06CC\u06CC\u0646 \u0645\u062A\u0646", image_align_left:"\u0686\u067E", image_align_right:"\u0631\u0627\u0633\u062A", link_title:"\u062F\u0631\u062C/\u0648\u06CC\u0631\u0627\u06CC\u0634 \u0644\u06CC\u0646\u0643", link_url:"URL \u0644\u06CC\u0646\u0643", link_target:"\u0645\u0642\u0635\u062F (Target)", link_target_same:"\u0628\u0627\u0632\u0634\u062F\u0646 \u0644\u06CC\u0646\u0643 \u062F\u0631 \u0647\u0645\u0627\u0646 \u067E\u0646\u062C\u0631\u0647", link_target_blank:"\u0628\u0627\u0632 \u0634\u062F\u0646 \u0644\u06CC\u0646\u0643 \u062F\u0631 \u06CC\u0643 \u067E\u0646\u062C\u0631\u0647 \u062C\u062F\u06CC\u062F", link_titlefield:"\u0639\u0646\u0648\u0627\u0646", link_is_email:"URL \u06CC \u0643\u0647 \u0634\u0645\u0627 \u0648\u0627\u0631\u062F \u0646\u0645\u0648\u062F\u0647 \u0627\u06CC\u062F \u0628\u0647 \u0646\u0638\u0631 \u0645\u06CC \u0622\u06CC\u062F \u0643\u0647 \u06CC\u0643 \u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644 \u0645\u06CC \u0628\u0627\u0634\u062F \u060C \u0622\u06CC\u0627 \u0645\u0627\u06CC\u0644\u06CC\u062F \u062A\u0627 \u067E\u06CC\u0634\u0648\u0646\u062F \u0627\u062C\u0628\u0627\u0631\u06CC \u0644\u0627\u0632\u0645\u0647 :mailto \u0631\u0627 \u0627\u0636\u0627\u0641\u0647 \u0646\u0645\u0627\u0626\u06CC\u062F\u061F", link_is_external:"URL \u06CC \u0643\u0647 \u0634\u0645\u0627 \u0648\u0627\u0631\u062F \u0646\u0645\u0648\u062F\u0647 \u0627\u06CC\u062F \u0628\u0647 \u0646\u0638\u0631 \u0645\u06CC \u0622\u06CC\u062F \u0643\u0647 \u0644\u06CC\u0646\u0643 \u062E\u0627\u0631\u062C\u06CC \u0645\u06CC \u0628\u0627\u0634\u062F \u060C \u0622\u06CC\u0627 \u0645\u0627\u06CC\u0644\u06CC\u062F \u062A\u0627 \u067E\u06CC\u0634\u0648\u0646\u062F \u0644\u0627\u0632\u0645\u0647 //:http \u0631\u0627 \u0627\u0636\u0627\u0641\u0647 \u0646\u0645\u0627\u0626\u06CC\u062F\u061F", link_list:"\u0644\u06CC\u0633\u062A \u0644\u06CC\u0646\u0643" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/fi.js000066400000000000000000000044411226600447100232730ustar00rootroot00000000000000tinyMCE.addI18n('fi.advanced',{ style_select:"Tyylit", font_size:"Kirjasinkoko", fontdefault:"Kirjasin", block:"Muotoilu", paragraph:"Kappale", div:"Div", address:"Osoite", pre:"Esimuotoiltu (pre)", h1:"Otsikko 1", h2:"Otsikko 2", h3:"Otsikko 3", h4:"Otsikko 4", h5:"Otsikko 5", h6:"Otsikko 6", blockquote:"Pitk\u00E4 lainaus", code:"Koodi", samp:"Koodiesimerkki", dt:"M\u00E4\u00E4rittelyn ehto ", dd:"M\u00E4\u00E4rittelyn kuvaus", bold_desc:"Lihavoitu (Ctrl+B)", italic_desc:"Kursivoitu (Ctrl+I)", underline_desc:"Alleviivattu (Ctrl+U)", striketrough_desc:"Yliviivattu", justifyleft_desc:"Tasaus vasemmalle", justifycenter_desc:"Keskitetty", justifyright_desc:"Tasaus oikealle", justifyfull_desc:"Tasattu", bullist_desc:"J\u00E4rjest\u00E4m\u00E4t\u00F6n lista", numlist_desc:"J\u00E4rjestetty lista", outdent_desc:"Loitonna", indent_desc:"Sisenn\u00E4", undo_desc:"Peru (Ctrl+Z)", redo_desc:"Tee uudelleen (Ctrl+Y)", link_desc:"Lis\u00E4\u00E4/muuta linkki", unlink_desc:"Poista linkki", image_desc:"Lis\u00E4\u00E4/muuta kuva", cleanup_desc:"Siisti sekainen koodi", code_desc:"Muokkaa HTML-koodia", sub_desc:"Alaindeksi", sup_desc:"Yl\u00E4indeksi", hr_desc:"Lis\u00E4\u00E4 vaakasuora viivain", removeformat_desc:"Poista muotoilu", custom1_desc:"Oma kuvauksesi t\u00E4h\u00E4n", forecolor_desc:"Valitse tekstin v\u00E4ri", backcolor_desc:"Valitse taustan v\u00E4ri", charmap_desc:"Lis\u00E4\u00E4 erikoismerkki", visualaid_desc:"Suuntaviivat/N\u00E4kym\u00E4tt\u00F6m\u00E4t elementit", anchor_desc:"Lis\u00E4\u00E4/Muokkaa ankkuri", cut_desc:"Leikkaa", copy_desc:"Kopioi", paste_desc:"Liit\u00E4", image_props_desc:"Kuvan ominaisuudet", newdocument_desc:"Uusi tiedosto", help_desc:"Ohje", blockquote_desc:"Pitk\u00E4 lainaus", clipboard_msg:"Kopioi/Leikkaa/Liit\u00E4 -painikkeet eiv\u00E4t toimi Mozilla ja Firefox -selaimilla. Voit kuitenkin k\u00E4ytt\u00E4\u00E4 n\u00E4pp\u00E4inyhdistelmi\u00E4 kopioimiseen (ctrl+c), leikkaamiseen (ctrl+x) ja liitt\u00E4miseen (ctrl+v). Haluatko lis\u00E4\u00E4 tietoa?", path:"Polku", newdocument:"Haluatko varmasti tyhjent\u00E4\u00E4 kaiken sis\u00E4ll\u00F6n?", toolbar_focus:"Siirry ty\u00F6kaluihin - Alt+Q, Siirry tekstieditoriin - Alt-Z, Siirry elementin polkuun - Alt-X", more_colors:"Enemm\u00E4n v\u00E4rej\u00E4" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/fi_dlg.js000066400000000000000000000036641226600447100241270ustar00rootroot00000000000000tinyMCE.addI18n('fi.advanced_dlg',{ about_title:"Tietoja TinyMCE:st\u00E4", about_general:"Tietoja", about_help:"Ohje", about_license:"Lisenssi", about_plugins:"Lis\u00E4osat", about_plugin:"Lis\u00E4osa", about_author:"Kirjoittaja", about_version:"Versio", about_loaded:"Ladatut lis\u00E4osat", anchor_title:"Liit\u00E4/muokkaa ankkuria", anchor_name:"Ankkurin nimi", code_title:"HTML-koodin muokkaus", code_wordwrap:"Automaattinen rivinvaihto", colorpicker_title:"Valitse v\u00E4ri", colorpicker_picker_tab:"Valitsin", colorpicker_picker_title:"V\u00E4rin valitsin", colorpicker_palette_tab:"Paletti", colorpicker_palette_title:"V\u00E4ripaletti", colorpicker_named_tab:"Nimetty", colorpicker_named_title:"Nimetyt v\u00E4rit", colorpicker_color:"V\u00E4ri:", colorpicker_name:"Nimi:", charmap_title:"Valitse erikoismerkki", image_title:"Lis\u00E4\u00E4/muokkaa kuvaa", image_src:"Kuvan osoite", image_alt:"Kuvan kuvaus", image_list:"Kuvalista", image_border:"Reunus", image_dimensions:"Mitat", image_vspace:"Pystysuuntainen tila", image_hspace:"Vaakasuuntainen tila", image_align:"Tasaus", image_align_baseline:"Tekstin tasossa", image_align_top:"Yl\u00F6s", image_align_middle:"Keskelle", image_align_bottom:"Alas", image_align_texttop:"Tekstin yl\u00E4osaan", image_align_textbottom:"Tekstin alaosaan", image_align_left:"Vasemmalle", image_align_right:"Oikealle", link_title:"Lis\u00E4\u00E4/muuta linkki", link_url:"Linkin osoite", link_target:"Kohde", link_target_same:"Avaa linkki samassa ikkunassa", link_target_blank:"Avaa linkki uuteen ikkunaan", link_titlefield:"Otsikko", link_is_email:"Antamasi osoite n\u00E4ytt\u00E4\u00E4 olevan s\u00E4hk\u00F6postiosoite. Haluatko lis\u00E4t\u00E4 siihen mailto:-etuliitteen?", link_is_external:"Antamasi osoite n\u00E4ytt\u00E4\u00E4 johtavan ulkopuoliselle sivustolle. Haluatko lis\u00E4t\u00E4 linkin eteen http://-etuliitteen? (suositus)", link_list:"Linkkilista" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/fr.js000066400000000000000000000043661226600447100233120ustar00rootroot00000000000000tinyMCE.addI18n('fr.advanced',{ style_select:"Styles", font_size:"Taille police", fontdefault:"Police", block:"Format", paragraph:"Paragraphe", div:"Div", address:"Adresse", pre:"Pr\u00E9format\u00E9", h1:"Titre 1", h2:"Titre 2", h3:"Titre 3", h4:"Titre 4", h5:"Titre 5", h6:"Titre 6", blockquote:"Bloc de citation", code:"Code", samp:"Exemple de code", dt:"Terme \u00E0 d\u00E9finir", dd:"D\u00E9finition du terme", bold_desc:"Gras (Ctrl+B)", italic_desc:"Italique (Ctrl+I)", underline_desc:"Soulign\u00E9 (Ctrl+U)", striketrough_desc:"Barr\u00E9", justifyleft_desc:"Align\u00E9 \u00E0 gauche", justifycenter_desc:"Centr\u00E9", justifyright_desc:"Align\u00E9 \u00E0 droite", justifyfull_desc:"Justifi\u00E9", bullist_desc:"Liste \u00E0 puces", numlist_desc:"Liste num\u00E9rot\u00E9e", outdent_desc:"Retirer l'indentation", indent_desc:"Indenter", undo_desc:"Annuler (Ctrl+Z)", redo_desc:"R\u00E9tablir (Ctrl+Y)", link_desc:"Ins\u00E9rer / \u00E9diter le lien", unlink_desc:"Supprimer le lien", image_desc:"Ins\u00E9rer / \u00E9diter l'image", cleanup_desc:"Nettoyer le code", code_desc:"\u00C9diter le code source HTML", sub_desc:"Indice", sup_desc:"Exposant", hr_desc:"Ins\u00E9rer un trait horizontal", removeformat_desc:"Supprimer le formatage", custom1_desc:"Votre description personnalis\u00E9e ici", forecolor_desc:"Choisir la couleur du texte", backcolor_desc:"Choisir la couleur de surlignage", charmap_desc:"Ins\u00E9rer des caract\u00E8res sp\u00E9ciaux", visualaid_desc:"Activer / d\u00E9sactiver les guides et les \u00E9l\u00E9ments invisibles", anchor_desc:"Ins\u00E9rer / \u00E9diter une ancre", cut_desc:"Couper", copy_desc:"Copier", paste_desc:"Coller", image_props_desc:"Propri\u00E9t\u00E9s de l'image", newdocument_desc:"Nouveau document", help_desc:"Aide", blockquote_desc:"Citation", clipboard_msg:"Vous ne pouvez pas copier/couper/coller sous Mozilla et sous Firefox.\nSouhaitez-vous en apprendre davantage sur ce probl\u00E8me ?", path:"Chemin", newdocument:"Souhaitez-vous vraiment effacer tout le contenu du document ?", toolbar_focus:"Atteindre les boutons de l'\u00E9diteur - Alt+Q, Aller \u00E0 l'\u00E9diteur - Alt-Z, Aller au chemin de l'\u00E9l\u00E9ment - Alt-X", more_colors:"Plus de couleurs" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/fr_dlg.js000066400000000000000000000037601226600447100241350ustar00rootroot00000000000000tinyMCE.addI18n('fr.advanced_dlg',{ about_title:"\u00C0 propos de TinyMCE", about_general:"\u00C0 propos", about_help:"Aide", about_license:"Licence", about_plugins:"Plugins", about_plugin:"Plugin", about_author:"Auteur", about_version:"Version", about_loaded:"Plugins charg\u00E9s", anchor_title:"Ins\u00E9rer / \u00E9diter une ancre", anchor_name:"Nom de l'ancre", code_title:"\u00C9diteur de source HTML", code_wordwrap:"Retour \u00E0 la ligne", colorpicker_title:"Choisir une couleur", colorpicker_picker_tab:"Nuancier", colorpicker_picker_title:"Nuancier", colorpicker_palette_tab:"Palette", colorpicker_palette_title:"Couleurs de la palette", colorpicker_named_tab:"Noms", colorpicker_named_title:"Couleurs nomm\u00E9es", colorpicker_color:"Couleur :", colorpicker_name:"Nom :", charmap_title:"Choisir le caract\u00E8re \u00E0 ins\u00E9rer", image_title:"Ins\u00E9rer / \u00E9diter une image", image_src:"URL de l'image", image_alt:"Description de l'image", image_list:"Liste d'images", image_border:"Bordure", image_dimensions:"Dimensions", image_vspace:"Espacement vertical", image_hspace:"Espacement horizontal", image_align:"Alignement", image_align_baseline:"Normal", image_align_top:"En haut", image_align_middle:"Au milieu", image_align_bottom:"En bas", image_align_texttop:"Texte en haut", image_align_textbottom:"Texte en bas", image_align_left:"Gauche (flottant)", image_align_right:"Droite (flottant)", link_title:"Ins\u00E9rer / \u00E9diter un lien", link_url:"URL du lien", link_target:"Cible", link_target_same:"Ouvrir dans la m\u00EAme fen\u00EAtre", link_target_blank:"Ouvrir dans une nouvelle fen\u00EAtre", link_titlefield:"Titre", link_is_email:"L'URL que vous avez saisie semble \u00EAtre une adresse e-mail, souhaitez-vous ajouter le pr\u00E9fixe \u00AB mailto: \u00BB ?", link_is_external:"L'URL que vous avez saisie semble \u00EAtre une adresse web externe. Souhaitez-vous ajouter le pr\u00E9fixe \u00AB http:// \u00BB ?", link_list:"Liste de liens" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/gl.js000066400000000000000000000043311226600447100232750ustar00rootroot00000000000000tinyMCE.addI18n('gl.advanced',{ style_select:"Estilos", font_size:"Tama\u00F1o", fontdefault:"Fonte", block:"Formato", paragraph:"P\u00E1rrafo", div:"Div", address:"Enderezo", pre:"Pre-formateado", h1:"Encabezamento 1", h2:"Encabezamento 2", h3:"Encabezamento 3", h4:"Encabezamento 4", h5:"Encabezamento 5", h6:"Encabezamento 6", blockquote:"Bloque de cita", code:"C\u00F3digo", samp:"Mostra de c\u00F3digo", dt:"Termo de definici\u00F3n", dd:"Descripci\u00F3n de definici\u00F3n", bold_desc:"Negrita (Ctrl+B)", italic_desc:"Cursiva (Ctrl+I)", underline_desc:"Subli\u00F1ado (Ctrl+U)", striketrough_desc:"Tachado", justifyleft_desc:"Ali\u00F1ar \u00E1 esquerda", justifycenter_desc:"Ali\u00F1ar \u00F3 centro", justifyright_desc:"Ali\u00F1ar \u00E1 dereita", justifyfull_desc:"Xustificar", bullist_desc:"Lista desordenada", numlist_desc:"Lista ordenada", outdent_desc:"Reducir sangr\u00EDa", indent_desc:"Aumentar sangr\u00EDa", undo_desc:"Desfacer (Ctrl+Z)", redo_desc:"Re-facer (Ctrl+Y)", link_desc:"Insertar/editar hiperv\u00EDnculo", unlink_desc:"Quitar hiperv\u00EDnculo", image_desc:"Insertar/editar imaxe", cleanup_desc:"Limpiar lixo no c\u00F3digo", code_desc:"Editar c\u00F3digo HTML", sub_desc:"Sub\u00EDndice", sup_desc:"Super\u00EDndice", hr_desc:"Insertar regra horizontal", removeformat_desc:"quitar formato", custom1_desc:"A s\u00FAa descripci\u00F3n persoal aqu\u00ED", forecolor_desc:"Seleccionar cor do texto", backcolor_desc:"Seleccionar cor do fondo", charmap_desc:"Insertar caracteres persoalizados", visualaid_desc:"Mostrar/ocultar li\u00F1a de gu\u00EDa/elementos invisibres", anchor_desc:"Insertar/editar \u00E1ncora", cut_desc:"Cortar", copy_desc:"Copiar", paste_desc:"Pegar", image_props_desc:"Propiedades de imaxe", newdocument_desc:"Novo documento", help_desc:"Axuda", blockquote_desc:"Cita", clipboard_msg:"Copiar/Cortar/Pegar non est\u00E1 disponible en Mozilla e Firefox.\r\n\u00BFDesexa obter mais informaci\u00F3n sobre de este asunto?", path:"Ruta", newdocument:"\u00BFSeguro que desexa limpar todo o contido?", toolbar_focus:"Ir \u00F3s bot\u00F3ns de ferramentas - Alt+Q, Ir \u00F3 editor - Alt-Z, Ir \u00E1 ruta do elemento - Alt-X", more_colors:"M\u00E1is cores" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/gl_dlg.js000066400000000000000000000036301226600447100241240ustar00rootroot00000000000000tinyMCE.addI18n('gl.advanced_dlg',{ about_title:"Sobre TinyMCE", about_general:"Sobre", about_help:"Axuda", about_license:"Licencia", about_plugins:"Comprementos", about_plugin:"Compremento", about_author:"Autor", about_version:"Versi\u00F3n", about_loaded:"Comprementos cargados", anchor_title:"Insertar/editar \u00E1ncora", anchor_name:"Nome da \u00E1ncora", code_title:"Editor HTML", code_wordwrap:"Cortar li\u00F1as autom\u00E1ticamente", colorpicker_title:"Seleccionar cor", colorpicker_picker_tab:"Selector", colorpicker_picker_title:"Selector de cores", colorpicker_palette_tab:"Paleta", colorpicker_palette_title:"Paleta de cores", colorpicker_named_tab:"Nomeados", colorpicker_named_title:"Cores nomeados", colorpicker_color:"Cor:", colorpicker_name:"Nome:", charmap_title:"Seleccionar caracter personalizado", image_title:"Insertar/editar imaxe", image_src:"URL da imaxe", image_alt:"Descripci\u00F3n da imaxe", image_list:"Lista de Imaxes", image_border:"Borde", image_dimensions:"Dimensi\u00F3n", image_vspace:"Espacio vertical", image_hspace:"Espacio horizontal", image_align:"Ali\u00F1aci\u00F3n", image_align_baseline:"Li\u00F1a base", image_align_top:"Arriba", image_align_middle:"Medio", image_align_bottom:"Abaixo", image_align_texttop:"Texto arriba", image_align_textbottom:"Texto abaixo", image_align_left:"Esquerda", image_align_right:"Dereita", link_title:"Insertar/editar enlace", link_url:"URL do enlace", link_target:"Obxetivo", link_target_same:"Abrir v\u00EDnculo na mesma vent\u00E1", link_target_blank:"Abrir v\u00EDnculo nunha vent\u00E1 nova", link_titlefield:"T\u00EDtulo", link_is_email:"A URL introducida semella ser un enderezo de e-mail, \u00BFDesexa engadi-lo prefixo necesario mailto:?", link_is_external:"A URL introducida semella ser un v\u00EDnculo externo, \u00BFDesexa engadi-lo prefixo necesario http://?", link_list:"Lista de hiperv\u00EDnculos" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/gu.js000066400000000000000000000035501226600447100233100ustar00rootroot00000000000000tinyMCE.addI18n('gu.advanced',{ style_select:"Styles", font_size:"Font size", fontdefault:"Font family", block:"Format", paragraph:"Paragraph", div:"Div", address:"Address", pre:"Preformatted", h1:"Heading 1", h2:"Heading 2", h3:"Heading 3", h4:"Heading 4", h5:"Heading 5", h6:"Heading 6", blockquote:"Blockquote", code:"Code", samp:"Code sample", dt:"Definition term ", dd:"Definition description", bold_desc:"Bold (Ctrl+B)", italic_desc:"Italic (Ctrl+I)", underline_desc:"Underline (Ctrl+U)", striketrough_desc:"Strikethrough", justifyleft_desc:"Align left", justifycenter_desc:"Align center", justifyright_desc:"Align right", justifyfull_desc:"Align full", bullist_desc:"Unordered list", numlist_desc:"Ordered list", outdent_desc:"Outdent", indent_desc:"Indent", undo_desc:"Undo (Ctrl+Z)", redo_desc:"Redo (Ctrl+Y)", link_desc:"Insert/edit link", unlink_desc:"Unlink", image_desc:"Insert/edit image", cleanup_desc:"Cleanup messy code", code_desc:"Edit HTML Source", sub_desc:"Subscript", sup_desc:"Superscript", hr_desc:"Insert horizontal ruler", removeformat_desc:"Remove formatting", custom1_desc:"Your custom description here", forecolor_desc:"Select text color", backcolor_desc:"Select background color", charmap_desc:"Insert custom character", visualaid_desc:"Toggle guidelines/invisible elements", anchor_desc:"Insert/edit anchor", cut_desc:"Cut", copy_desc:"Copy", paste_desc:"Paste", image_props_desc:"Image properties", newdocument_desc:"New document", help_desc:"Help", blockquote_desc:"Blockquote", clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?", path:"Path", newdocument:"Are you sure you want clear all contents?", toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X", more_colors:"More colors" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/gu_dlg.js000066400000000000000000000032741226600447100241410ustar00rootroot00000000000000tinyMCE.addI18n('gu.advanced_dlg',{ about_title:"About TinyMCE", about_general:"About", about_help:"Help", about_license:"License", about_plugins:"Plugins", about_plugin:"Plugin", about_author:"Author", about_version:"Version", about_loaded:"Loaded plugins", anchor_title:"Insert/edit anchor", anchor_name:"Anchor name", code_title:"HTML Source Editor", code_wordwrap:"Word wrap", colorpicker_title:"Select a color", colorpicker_picker_tab:"Picker", colorpicker_picker_title:"Color picker", colorpicker_palette_tab:"Palette", colorpicker_palette_title:"Palette colors", colorpicker_named_tab:"Named", colorpicker_named_title:"Named colors", colorpicker_color:"Color:", colorpicker_name:"Name:", charmap_title:"Select custom character", image_title:"Insert/edit image", image_src:"Image URL", image_alt:"Image description", image_list:"Image list", image_border:"Border", image_dimensions:"Dimensions", image_vspace:"Vertical space", image_hspace:"Horizontal space", image_align:"Alignment", image_align_baseline:"Baseline", image_align_top:"Top", image_align_middle:"Middle", image_align_bottom:"Bottom", image_align_texttop:"Text top", image_align_textbottom:"Text bottom", image_align_left:"Left", image_align_right:"Right", link_title:"Insert/edit link", link_url:"Link URL", link_target:"Target", link_target_same:"Open link in the same window", link_target_blank:"Open link in a new window", link_titlefield:"Title", link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", link_list:"Link list" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/he.js000066400000000000000000000110231226600447100232630ustar00rootroot00000000000000tinyMCE.addI18n('he.advanced',{ style_select:"\u05E1\u05D2\u05E0\u05D5\u05E0\u05D5\u05EA", font_size:"\u05D2\u05D5\u05D3\u05DC \u05D2\u05D5\u05E4\u05DF", fontdefault:"\u05D2\u05D5\u05E4\u05DF", block:"\u05E2\u05D9\u05E6\u05D5\u05D1", paragraph:"\u05E4\u05E1\u05E7\u05D4", div:"Div", address:"\u05DB\u05EA\u05D5\u05D1\u05EA", pre:"Preformatted", h1:"\u05DB\u05D5\u05EA\u05E8\u05EA 1", h2:"\u05DB\u05D5\u05EA\u05E8\u05EA 2", h3:"\u05DB\u05D5\u05EA\u05E8\u05EA 3", h4:"\u05DB\u05D5\u05EA\u05E8\u05EA 4", h5:"\u05DB\u05D5\u05EA\u05E8\u05EA 5", h6:"\u05DB\u05D5\u05EA\u05E8\u05EA 6", blockquote:"\u05E6\u05D9\u05D8\u05D5\u05D8 \u05E7\u05D8\u05E2", code:"\u05E7\u05D5\u05D3", samp:"\u05D3\u05D5\u05D2\u05DE\u05EA \u05E7\u05D5\u05D3", dt:"\u05DE\u05D5\u05E9\u05D2", dd:"\u05D4\u05D2\u05D3\u05E8\u05EA \u05D4\u05DE\u05D5\u05E9\u05D2", bold_desc:"\u05DE\u05D5\u05D3\u05D2\u05E9 (Ctrl+B)", italic_desc:"\u05E0\u05D8\u05D5\u05D9 (Ctrl+I)", underline_desc:"\u05E7\u05D5 \u05EA\u05D7\u05EA\u05D5\u05DF (Ctrl+U)", striketrough_desc:"\u05E7\u05D5 \u05D7\u05D5\u05E6\u05D4", justifyleft_desc:"\u05D9\u05D9\u05E9\u05D5\u05E8 \u05D8\u05E7\u05E1\u05D8 \u05DC\u05E9\u05DE\u05D0\u05DC", justifycenter_desc:"\u05DE\u05D9\u05E8\u05DB\u05D5\u05D6 \u05D8\u05E7\u05E1\u05D8", justifyright_desc:"\u05D9\u05D9\u05E9\u05D5\u05E8 \u05D8\u05E7\u05E1\u05D8 \u05DC\u05D9\u05DE\u05D9\u05DF", justifyfull_desc:"\u05D9\u05D9\u05E9\u05D5\u05E8 \u05DC\u05E9\u05E0\u05D9 \u05D4\u05E6\u05D3\u05D3\u05D9\u05DD", bullist_desc:"\u05EA\u05D1\u05DC\u05D9\u05D8\u05D9\u05DD", numlist_desc:"\u05DE\u05E1\u05E4\u05D5\u05E8", outdent_desc:"\u05D4\u05D2\u05D3\u05DC\u05EA \u05DB\u05E0\u05D9\u05E1\u05D4", indent_desc:"\u05D4\u05E7\u05D8\u05E0\u05EA \u05DB\u05E0\u05D9\u05E1\u05D4", undo_desc:"\u05D1\u05D9\u05D8\u05D5\u05DC \u05E4\u05E2\u05D5\u05DC\u05D4 (Ctrl+Z)", redo_desc:"\u05D7\u05D6\u05E8\u05D4 \u05E2\u05DC \u05E4\u05E2\u05D5\u05DC\u05D4 (Ctrl+Y)", link_desc:"\u05D4\u05D5\u05E1\u05E4\u05EA/\u05E2\u05E8\u05D9\u05DB\u05EA \u05E7\u05D9\u05E9\u05D5\u05E8", unlink_desc:"\u05D4\u05E1\u05E8\u05EA \u05E7\u05D9\u05E9\u05D5\u05E8", image_desc:"\u05D4\u05D5\u05E1\u05E4\u05D4/\u05E2\u05E8\u05D9\u05DB\u05EA \u05D3\u05E3 \u05EA\u05DE\u05D5\u05E0\u05D4", cleanup_desc:"\u05E0\u05D9\u05E7\u05D5\u05D9 \u05E7\u05D5\u05D3", code_desc:"\u05E2\u05E8\u05D9\u05DB\u05EA \u05E7\u05D5\u05D3 HTML", sub_desc:"\u05DB\u05EA\u05D1 \u05E2\u05D9\u05DC\u05D9", sup_desc:"\u05DB\u05EA\u05D1 \u05EA\u05D7\u05EA\u05D9", hr_desc:"\u05D4\u05D5\u05E1\u05E4\u05EA \u05E7\u05D5 \u05DE\u05E4\u05E8\u05D9\u05D3", removeformat_desc:"\u05D4\u05E1\u05E8\u05EA \u05E2\u05D9\u05E6\u05D5\u05D1", custom1_desc:"\u05D4\u05EA\u05D0\u05D5\u05E8 \u05E9\u05DC\u05DA \u05DB\u05D0\u05D5", forecolor_desc:"\u05D1\u05D7\u05D9\u05E8\u05EA \u05E6\u05D1\u05E2 \u05D2\u05D5\u05E4\u05DF", backcolor_desc:"\u05D1\u05D7\u05D9\u05E8\u05EA \u05E6\u05D1\u05E2 \u05E8\u05E7\u05E2", charmap_desc:"\u05D4\u05D5\u05E1\u05E4\u05EA \u05E1\u05D9\u05DE\u05DF", visualaid_desc:"\u05D4\u05E6\u05D2\u05D4 \u05D0\u05D5 \u05D4\u05E1\u05EA\u05E8\u05D4 \u05E9\u05DC \u05E1\u05D9\u05DE\u05D5\u05E0\u05D9 \u05E2\u05D9\u05E6\u05D5\u05D1", anchor_desc:"\u05D4\u05D5\u05E1\u05E4\u05EA/\u05E2\u05E8\u05D9\u05DB\u05EA \u05E1\u05D9\u05DE\u05E0\u05D9\u05D4", cut_desc:"\u05D2\u05D6\u05D9\u05E8\u05D4", copy_desc:"\u05D4\u05E2\u05EA\u05E7\u05D4", paste_desc:"\u05D4\u05D3\u05D1\u05E7\u05D4", image_props_desc:"\u05DE\u05D0\u05E4\u05D9\u05D9\u05E0\u05D9 \u05D4\u05EA\u05DE\u05D5\u05E0\u05D4", newdocument_desc:"\u05DE\u05E1\u05DE\u05DA \u05D7\u05D3\u05E9", help_desc:"\u05E2\u05D6\u05E8\u05D4", blockquote_desc:"\u05E6\u05D9\u05D8\u05D5\u05D8", clipboard_msg:"\u05D4\u05E2\u05EA\u05E7/\u05D2\u05D6\u05D5\u05E8/\u05D4\u05D3\u05D1\u05E7 \u05DC\u05D0 \u05D6\u05DE\u05D9\u05E0\u05D9\u05DD \u05D1 Mozilla \u05D5\u05D1-Firefox.\r\n \u05D4\u05D0\u05DD \u05D1\u05E8\u05E6\u05D5\u05E0\u05DA \u05DC\u05E7\u05D1\u05DC \u05DE\u05D9\u05D3\u05E2 \u05E0\u05D5\u05E1\u05E3 \u05E2\u05DC \u05D4\u05E0\u05D5\u05E9\u05D0?", path:"path", newdocument:"\u05D4\u05D0\u05DD \u05D1\u05E8\u05E6\u05D5\u05E0\u05DA \u05DC\u05DE\u05D7\u05D5\u05E7 \u05D0\u05EA \u05DB\u05DC \u05D4\u05EA\u05D5\u05DB\u05DF?", toolbar_focus:"\u05D4\u05E2\u05D1\u05E8\u05D4 \u05DC\u05E1\u05E8\u05D2\u05DC \u05D4\u05DB\u05DC\u05D9\u05DD - Alt+Q, \u05D4\u05E2\u05D1\u05E8\u05D4 \u05DC\u05DE\u05E2\u05D1\u05D3 \u05EA\u05DE\u05DC\u05D9\u05DC\u05D9\u05DD - Alt-Z, \u05D4\u05E2\u05D1\u05E8\u05D4 \u05DC\u05E0\u05EA\u05D9\u05D1 \u05D4\u05D0\u05DC\u05DE\u05D8\u05D9\u05DD - Alt-X", more_colors:"\u05E2\u05D5\u05D3 \u05E6\u05D1\u05E2\u05D9\u05DD" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/he_dlg.js000066400000000000000000000101321226600447100241110ustar00rootroot00000000000000tinyMCE.addI18n('he.advanced_dlg',{ about_title:"\u05D0\u05D5\u05D3\u05D5\u05EA TinyMCE", about_general:"\u05D0\u05D5\u05D3\u05D5\u05EA", about_help:"\u05E2\u05D6\u05E8\u05D4", about_license:"\u05E8\u05E9\u05D9\u05D5\u05DF", about_plugins:"\u05EA\u05D5\u05E1\u05E4\u05D5\u05EA", about_plugin:"\u05EA\u05D5\u05E1\u05E4\u05EA", about_author:"\u05D9\u05D5\u05E6\u05E8", about_version:"\u05D2\u05D9\u05E8\u05E1\u05D4", about_loaded:"\u05EA\u05D5\u05E1\u05E4\u05D5\u05EA \u05E4\u05E2\u05D9\u05DC\u05D5\u05EA", anchor_title:"\u05D4\u05D5\u05E1\u05E4\u05D4/\u05E2\u05E8\u05D9\u05DB\u05EA \u05E1\u05D9\u05DE\u05E0\u05D9\u05D4", anchor_name:"\u05E9\u05DD \u05D4\u05E1\u05D9\u05DE\u05E0\u05D9\u05D4", code_title:"\u05E2\u05D5\u05E8\u05DA \u05D4-HTML", code_wordwrap:"\u05D2\u05DC\u05D9\u05E9\u05EA \u05D8\u05E7\u05E1\u05D8", colorpicker_title:"\u05D1\u05D7\u05D9\u05E8\u05EA \u05E6\u05D1\u05E2", colorpicker_picker_tab:"\u05D1\u05D5\u05E8\u05E8", colorpicker_picker_title:"\u05D1\u05D5\u05E8\u05E8 \u05D4\u05E6\u05D1\u05E2\u05D9\u05DD", colorpicker_palette_tab:"\u05DC\u05D5\u05D7 \u05E6\u05D1\u05E2\u05D9\u05DD", colorpicker_palette_title:"\u05DC\u05D5\u05D7 \u05E6\u05D1\u05E2\u05D9\u05DD", colorpicker_named_tab:"\u05E6\u05D1\u05E2\u05D9\u05DD \u05D1\u05E2\u05DC\u05D9 \u05E9\u05DE\u05D5\u05EA", colorpicker_named_title:"\u05E6\u05D1\u05E2\u05D9\u05DD \u05D1\u05E2\u05DC\u05D9 \u05E9\u05DE\u05D5\u05EA", colorpicker_color:"\u05E6\u05D1\u05E2:", colorpicker_name:"\u05E9\u05DD:", charmap_title:"\u05D1\u05D7\u05D9\u05E8\u05EA \u05E1\u05D9\u05DE\u05DF", image_title:"\u05D4\u05D5\u05E1\u05E4\u05D4/\u05E2\u05E8\u05D9\u05DB\u05EA \u05EA\u05DE\u05D5\u05E0\u05D4", image_src:"\u05DB\u05EA\u05D5\u05D1\u05EA:", image_alt:"\u05EA\u05D9\u05D0\u05D5\u05E8", image_list:"\u05E8\u05E9\u05D9\u05DE\u05D4", image_border:"\u05D2\u05D1\u05D5\u05DC", image_dimensions:"\u05D2\u05D5\u05D3\u05DC", image_vspace:"\u05E8\u05D5\u05D5\u05D7 \u05D0\u05E0\u05DB\u05D9", image_hspace:"\u05E8\u05D5\u05D5\u05D7 \u05D0\u05D5\u05E4\u05E7\u05D9", image_align:"\u05D9\u05D9\u05E9\u05D5\u05E8", image_align_baseline:"\u05E7\u05D5 \u05D4\u05D4\u05EA\u05D7\u05DC\u05D4", image_align_top:"\u05E7\u05E6\u05D4 \u05D4\u05E2\u05DC\u05D9\u05D5\u05DF", image_align_middle:"\u05D0\u05DE\u05E6\u05E2", image_align_bottom:"\u05E7\u05E6\u05D4 \u05D4\u05EA\u05D7\u05EA\u05D5\u05DF", image_align_texttop:"\u05E7\u05E6\u05D4 \u05D4\u05E2\u05DC\u05D9\u05D5\u05DF \u05E9\u05DC \u05D4\u05D8\u05E7\u05E1\u05D8", image_align_textbottom:"\u05E7\u05E6\u05D4 \u05D4\u05EA\u05D7\u05EA\u05D5\u05DF \u05E9\u05DC \u05D4\u05D8\u05E7\u05E1\u05D8", image_align_left:"\u05E9\u05DE\u05D0\u05DC", image_align_right:"\u05D9\u05DE\u05D9\u05DF", link_title:"\u05D4\u05D5\u05E1\u05E4\u05D4/\u05E2\u05E8\u05D9\u05DB\u05EA \u05E7\u05D9\u05E9\u05D5\u05E8", link_url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D4\u05E7\u05D9\u05E9\u05D5\u05E8", link_target:"\u05D9\u05E2\u05D3", link_target_same:"\u05E4\u05EA\u05D7 \u05E7\u05D9\u05E9\u05D5\u05E8 \u05D1\u05D0\u05D5\u05EA\u05D5 \u05D7\u05DC\u05D5\u05DF", link_target_blank:"\u05E4\u05EA\u05D7 \u05E7\u05D9\u05E9\u05D5\u05E8 \u05D1\u05D7\u05DC\u05D5\u05DF \u05D7\u05D3\u05E9", link_titlefield:"\u05DB\u05D5\u05EA\u05E8\u05EA", link_is_email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D4-URL \u05E9\u05D4\u05D5\u05DB\u05E0\u05E1\u05D4 \u05D4\u05D9\u05D0 \u05DB\u05DB\u05DC \u05D4\u05E0\u05E8\u05D0\u05D4 \u05DB\u05EA\u05D5\u05D1\u05EA \u05DE\u05D9\u05D9\u05DC \u05D4\u05D0\u05DD \u05D1\u05E8\u05E6\u05D5\u05E0\u05DA \u05DC\u05D4\u05D5\u05E1\u05D9\u05E3 \u05D0\u05EA \u05D4\u05E7\u05D9\u05D3\u05D5\u05DE\u05EA MAILTO \u05D4\u05E0\u05D3\u05E8\u05E9\u05EA?", link_is_external:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D4-URL \u05E9\u05D4\u05D5\u05DB\u05E0\u05E1\u05D4 \u05D4\u05D9\u05D0 \u05DB\u05DB\u05DC \u05D4\u05E0\u05E8\u05D0\u05D4 \u05E7\u05D9\u05E9\u05D5\u05E8 \u05D7\u05D9\u05E6\u05D5\u05E0\u05D9 \u05D4\u05D0\u05DD \u05D1\u05E8\u05E6\u05D5\u05E0\u05DA \u05DC\u05D4\u05D5\u05E1\u05D9\u05E3 \u05D0\u05EA \u05D4\u05E7\u05D9\u05D3\u05D5\u05DE\u05EA http:// \u05D4\u05E0\u05D3\u05E8\u05E9\u05EA?", link_list:"\u05E8\u05E9\u05D9\u05DE\u05EA \u05E7\u05D9\u05E9\u05D5\u05E8\u05D9\u05DD" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/hi.js000066400000000000000000000035501226600447100232750ustar00rootroot00000000000000tinyMCE.addI18n('hi.advanced',{ style_select:"Styles", font_size:"Font size", fontdefault:"Font family", block:"Format", paragraph:"Paragraph", div:"Div", address:"Address", pre:"Preformatted", h1:"Heading 1", h2:"Heading 2", h3:"Heading 3", h4:"Heading 4", h5:"Heading 5", h6:"Heading 6", blockquote:"Blockquote", code:"Code", samp:"Code sample", dt:"Definition term ", dd:"Definition description", bold_desc:"Bold (Ctrl+B)", italic_desc:"Italic (Ctrl+I)", underline_desc:"Underline (Ctrl+U)", striketrough_desc:"Strikethrough", justifyleft_desc:"Align left", justifycenter_desc:"Align center", justifyright_desc:"Align right", justifyfull_desc:"Align full", bullist_desc:"Unordered list", numlist_desc:"Ordered list", outdent_desc:"Outdent", indent_desc:"Indent", undo_desc:"Undo (Ctrl+Z)", redo_desc:"Redo (Ctrl+Y)", link_desc:"Insert/edit link", unlink_desc:"Unlink", image_desc:"Insert/edit image", cleanup_desc:"Cleanup messy code", code_desc:"Edit HTML Source", sub_desc:"Subscript", sup_desc:"Superscript", hr_desc:"Insert horizontal ruler", removeformat_desc:"Remove formatting", custom1_desc:"Your custom description here", forecolor_desc:"Select text color", backcolor_desc:"Select background color", charmap_desc:"Insert custom character", visualaid_desc:"Toggle guidelines/invisible elements", anchor_desc:"Insert/edit anchor", cut_desc:"Cut", copy_desc:"Copy", paste_desc:"Paste", image_props_desc:"Image properties", newdocument_desc:"New document", help_desc:"Help", blockquote_desc:"Blockquote", clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?", path:"Path", newdocument:"Are you sure you want clear all contents?", toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X", more_colors:"More colors" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/hi_dlg.js000066400000000000000000000032741226600447100241260ustar00rootroot00000000000000tinyMCE.addI18n('hi.advanced_dlg',{ about_title:"About TinyMCE", about_general:"About", about_help:"Help", about_license:"License", about_plugins:"Plugins", about_plugin:"Plugin", about_author:"Author", about_version:"Version", about_loaded:"Loaded plugins", anchor_title:"Insert/edit anchor", anchor_name:"Anchor name", code_title:"HTML Source Editor", code_wordwrap:"Word wrap", colorpicker_title:"Select a color", colorpicker_picker_tab:"Picker", colorpicker_picker_title:"Color picker", colorpicker_palette_tab:"Palette", colorpicker_palette_title:"Palette colors", colorpicker_named_tab:"Named", colorpicker_named_title:"Named colors", colorpicker_color:"Color:", colorpicker_name:"Name:", charmap_title:"Select custom character", image_title:"Insert/edit image", image_src:"Image URL", image_alt:"Image description", image_list:"Image list", image_border:"Border", image_dimensions:"Dimensions", image_vspace:"Vertical space", image_hspace:"Horizontal space", image_align:"Alignment", image_align_baseline:"Baseline", image_align_top:"Top", image_align_middle:"Middle", image_align_bottom:"Bottom", image_align_texttop:"Text top", image_align_textbottom:"Text bottom", image_align_left:"Left", image_align_right:"Right", link_title:"Insert/edit link", link_url:"Link URL", link_target:"Target", link_target_same:"Open link in the same window", link_target_blank:"Open link in a new window", link_titlefield:"Title", link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", link_list:"Link list" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/hr.js000066400000000000000000000037101226600447100233040ustar00rootroot00000000000000tinyMCE.addI18n('hr.advanced',{ style_select:"Stilovi", font_size:"Veli\u010Dina pisma", fontdefault:"Vrsta pisma", block:"Format", paragraph:"Paragraf", div:"Div", address:"Adresa", pre:"Oblikovano", h1:"Naslov 1", h2:"Naslov 2", h3:"Naslov 3", h4:"Naslov 4", h5:"Naslov 5", h6:"Naslov 6", blockquote:"Citat", code:"Kod", samp:"Primjer koda", dt:"Definicija pojma", dd:"Opis definicije", bold_desc:"Podebljaj (Ctrl+B)", italic_desc:"Kurziv (Ctrl+I)", underline_desc:"Podcrtaj (Ctrl+U)", striketrough_desc:"Precrtaj", justifyleft_desc:"Poravnaj lijevo", justifycenter_desc:"Centriraj", justifyright_desc:"Poravnaj desno", justifyfull_desc:"Poravnaj potpuno", bullist_desc:"Neure\u0111ena lista", numlist_desc:"Ure\u0111ena lista", outdent_desc:"Uvuci", indent_desc:"Izvuci", undo_desc:"Poni\u0161ti (Ctrl+Z)", redo_desc:"Ponovi (Ctrl+Y)", link_desc:"Umetni/uredi poveznicu", unlink_desc:"Poni\u0161ti poveznicu", image_desc:"Umetni/uredi sliku", cleanup_desc:"Po\u010Disti kod", code_desc:"Uredi HTML izvor", sub_desc:"Indeks", sup_desc:"Eksponent", hr_desc:"Umetni vodoravnu crtu", removeformat_desc:"Poni\u0161ti oblikovanje", custom1_desc:"Vlastiti opis ovdje", forecolor_desc:"Odaberite boju teksta", backcolor_desc:"Odaberite boju pozadine", charmap_desc:"Umetni vlastiti znak", visualaid_desc:"Vodilice/nevidljivi elementi", anchor_desc:"Umetni/uredi sidro", cut_desc:"Izre\u017Ei", copy_desc:"Kopiraj", paste_desc:"Zalijepi", image_props_desc:"Svojstva slike", newdocument_desc:"Novi dokument", help_desc:"Pomo\u0107", blockquote_desc:"Citiraj", clipboard_msg:"Kopiraj/Izre\u017Ei/Zalijepi nije dostupno u Mozilla i Firefox preglednicima. Vi\u0161e informacija?", path:"Staza", newdocument:"Jeste li sigurni da \u017Eelite izbrisati cijeli sadr\u017Eaj?", toolbar_focus:"Prije\u0111i na alatnu traku - Alt+Q, prije\u0111i na ure\u0111iva\u010D - Alt-Z, prije\u0111i na element path - Alt-X", more_colors:"Vi\u0161e boja" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/hr_dlg.js000066400000000000000000000033501226600447100241320ustar00rootroot00000000000000tinyMCE.addI18n('hr.advanced_dlg',{ about_title:"TinyMCE", about_general:"O programu", about_help:"Pomo\u0107", about_license:"Licenca", about_plugins:"Dodaci", about_plugin:"Dodatak", about_author:"Autor", about_version:"Verzija", about_loaded:"Postoje\u0107i dodaci", anchor_title:"Umetni/uredi sidro", anchor_name:"Ime sidra", code_title:"HTML ure\u0111iva\u010D", code_wordwrap:"Omatanje teksta", colorpicker_title:"Izbor boje", colorpicker_picker_tab:"Odabir", colorpicker_picker_title:"Odabir boje", colorpicker_palette_tab:"Paleta", colorpicker_palette_title:"Paleta boja", colorpicker_named_tab:"Imenovano", colorpicker_named_title:"Imenovane boje", colorpicker_color:"Boja:", colorpicker_name:"Naziv:", charmap_title:"Odaberite znak", image_title:"Umetni/uredi sliku", image_src:"URL slike", image_alt:"Opis slike", image_list:"Lista slika", image_border:"Obrub", image_dimensions:"Dimenzije", image_vspace:"Okomiti razmak", image_hspace:"Vodoravni razmak", image_align:"Poravnavanje", image_align_baseline:"Osnovna linija", image_align_top:"Vrh", image_align_middle:"Sredina", image_align_bottom:"Dno", image_align_texttop:"Vrh teksta", image_align_textbottom:"Dno teksta", image_align_left:"Lijevo", image_align_right:"Desno", link_title:"Umetni/uredi poveznicu", link_url:"URL poveznice", link_target:"Meta", link_target_same:"Otvori poveznicu u istom prozoru", link_target_blank:"Otvori poveznicu u novom prozoru", link_titlefield:"Naslov", link_is_email:"URL koji ste unijeli izgleda kao e-mail adresa, \u017Eelite li dodati potrebni mailto: prefiks?", link_is_external:"URL koji ste unijeli izgleda kao vanjska poveznica, \u017Eelite li dodati potrebni http:// prefiks?", link_list:"Lista poveznica" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/hu.js000066400000000000000000000053211226600447100233070ustar00rootroot00000000000000tinyMCE.addI18n('hu.advanced',{ style_select:"St\u00EDlusok", font_size:"Bet\u0171m\u00E9ret", fontdefault:"Bet\u0171t\u00EDpus", block:"Form\u00E1tum", paragraph:"Bekezd\u00E9s", div:"Div", address:"C\u00EDm", pre:"El\u0151form\u00E1zott", h1:"C\u00EDmsor 1", h2:"C\u00EDmsor 2", h3:"C\u00EDmsor 3", h4:"C\u00EDmsor 4", h5:"C\u00EDmsor 5", h6:"C\u00EDmsor 6", blockquote:"Id\u00E9zet", code:"K\u00F3d", samp:"K\u00F3d minta", dt:"Defini\u00E1lt kifejez\u00E9s a defin\u00EDci\u00F3s list\u00E1ban", dd:"Defin\u00EDci\u00F3 a defin\u00EDci\u00F3s list\u00E1ban", bold_desc:"F\u00E9lk\u00F6v\u00E9r (Ctrl+B)", italic_desc:"D\u0151lt (Ctrl+I)", underline_desc:"Al\u00E1h\u00FAzott (Ctrl+U)", striketrough_desc:"\u00C1th\u00FAzott", justifyleft_desc:"Balra z\u00E1rt", justifycenter_desc:"K\u00F6z\u00E9pre z\u00E1rt", justifyright_desc:"Jobbra z\u00E1rt", justifyfull_desc:"Sorkiz\u00E1rt", bullist_desc:"Rendezetlen lista", numlist_desc:"Rendezett lista", outdent_desc:"Beh\u00FAz\u00E1s cs\u00F6kkent\u00E9se", indent_desc:"Beh\u00FAz\u00E1s n\u00F6vel\u00E9se", undo_desc:"Visszavon\u00E1s (Ctrl+Z)", redo_desc:"M\u00E9gis v\u00E9grehajt (Ctrl+Y)", link_desc:"Link besz\u00FAr\u00E1sa/szerkeszt\u00E9se", unlink_desc:"Link megsz\u00FCntet\u00E9se", image_desc:"K\u00E9p besz\u00FAr\u00E1sa/szerkeszt\u00E9se", cleanup_desc:"Rendetlen k\u00F3d takar\u00EDt\u00E1sa", code_desc:"HTML forr\u00E1s szerkeszt\u00E9se", sub_desc:"Als\u00F3 index", sup_desc:"Fels\u0151 index", hr_desc:"V\u00EDzszintes elv\u00E1laszt\u00F3 besz\u00FAr\u00E1sa", removeformat_desc:"Form\u00E1z\u00E1s elt\u00E1vol\u00EDt\u00E1sa", custom1_desc:"Az \u00F6n egyedi le\u00EDr\u00E1sa", forecolor_desc:"Sz\u00F6vegsz\u00EDn v\u00E1laszt\u00E1sa", backcolor_desc:"H\u00E1tt\u00E9rsz\u00EDn v\u00E1laszt\u00E1sa", charmap_desc:"Speci\u00E1lis karakter besz\u00FAr\u00E1sa", visualaid_desc:"Vezet\u0151vonalak/nem l\u00E1that\u00F3 elemek ki-/bekapcsol\u00E1sa", anchor_desc:"Horgony besz\u00FAr\u00E1sa/szerkeszt\u00E9se", cut_desc:"Kiv\u00E1g\u00E1s", copy_desc:"M\u00E1sol\u00E1s", paste_desc:"Besz\u00FAr\u00E1s", image_props_desc:"K\u00E9p tulajdons\u00E1gai", newdocument_desc:"\u00DAj dokumentum", help_desc:"Seg\u00EDts\u00E9g", blockquote_desc:"Id\u00E9zet", clipboard_msg:"A M\u00E1sol\u00E1s/Kiv\u00E1g\u00E1s/Besz\u00FAr\u00E1s funkci\u00F3k nem \u00E9rhet\u0151ek el Mozilla \u00E9s Firefox alatt. K\u00EDv\u00E1n t\u00F6bbet tudni err\u0151l a t\u00E9m\u00E1r\u00F3l?", path:"\u00DAtvonal", newdocument:"Biztosan t\u00F6rli az eddigi tartalmat?", toolbar_focus:"Eszk\u00F6zgombokra ugr\u00E1s - Alt+Q, Szerkeszt\u0151h\u00F6z ugr\u00E1s - Alt-Z, Elem\u00FAtvonalhoz ugr\u00E1s - Alt-X", more_colors:"T\u00F6bb sz\u00EDn" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/hu_dlg.js000066400000000000000000000041711226600447100241370ustar00rootroot00000000000000tinyMCE.addI18n('hu.advanced_dlg',{ about_title:"A TinyMCE-r\u0151l", about_general:"R\u00F3lunk", about_help:"Seg\u00EDts\u00E9g", about_license:"Licenc", about_plugins:"Pluginok", about_plugin:"Plugin", about_author:"Szerz\u0151", about_version:"Verzi\u00F3", about_loaded:"Bet\u00F6lt\u00F6tt pluginok", anchor_title:"Horgony besz\u00FAr\u00E1sa/szerkeszt\u00E9se", anchor_name:"Horgonyn\u00E9v", code_title:"HTML forr\u00E1s szerkeszt\u00E9se", code_wordwrap:"Sz\u00F6veg t\u00F6rdel\u00E9se", colorpicker_title:"Sz\u00EDnv\u00E1laszt\u00E1s", colorpicker_picker_tab:"V\u00E1laszt\u00F3", colorpicker_picker_title:"Sz\u00EDnv\u00E1laszt\u00F3", colorpicker_palette_tab:"Paletta", colorpicker_palette_title:"Paletta sz\u00EDnek", colorpicker_named_tab:"Elnevezettek", colorpicker_named_title:"Elnevezett sz\u00EDnek", colorpicker_color:"Sz\u00EDn:", colorpicker_name:"N\u00E9v:", charmap_title:"Egyedi karakter v\u00E1laszt\u00E1sa", image_title:"K\u00E9p besz\u00FAr\u00E1sa/szerkeszt\u00E9se", image_src:"K\u00E9p URL", image_alt:"K\u00E9p le\u00EDr\u00E1s", image_list:"K\u00E9p lista", image_border:"Keret", image_dimensions:"M\u00E9retek", image_vspace:"F\u00FCgg\u0151leges t\u00E1v", image_hspace:"V\u00EDzszintes t\u00E1v", image_align:"Igaz\u00EDt\u00E1s", image_align_baseline:"Alapvonalhoz", image_align_top:"Fentre", image_align_middle:"K\u00F6z\u00E9pre", image_align_bottom:"Lentre", image_align_texttop:"Sz\u00F6veg tetej\u00E9hez", image_align_textbottom:"Sz\u00F6veg alj\u00E1hoz", image_align_left:"Balra", image_align_right:"Jobbra", link_title:"Link besz\u00FAr\u00E1sa/szerkeszt\u00E9se", link_url:"Link URL", link_target:"Target", link_target_same:"Link azonos ablakba nyit\u00E1sa", link_target_blank:"Link \u00FAj ablakba nyit\u00E1sa", link_titlefield:"C\u00EDm", link_is_email:"A be\u00EDrt URL e-mail c\u00EDmnek t\u0171nik, k\u00EDv\u00E1nja a sz\u00FCks\u00E9ges mailto:-val kieg\u00E9sz\u00EDteni?", link_is_external:"A be\u00EDrt URL k\u00FCls\u0151 hivatkoz\u00E1snak t\u0171nik, k\u00EDv\u00E1nja a sz\u00FCks\u00E9ges http://-vel kieg\u00E9sz\u00EDteni?", link_list:"Link lista" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/hy.js000066400000000000000000000141671226600447100233230ustar00rootroot00000000000000tinyMCE.addI18n('hy.advanced',{ style_select:"\u0548\u0573\u0565\u0580", font_size:"\u0549\u0561\u0583\u057D", fontdefault:"\u054F\u0561\u057C\u0561\u057F\u0565\u057D\u0561\u056F", block:"\u0556\u0578\u0580\u0574\u0561\u057F", paragraph:"\u0556\u0578\u0580\u0574\u0561\u057F", div:"Div", address:"\u0540\u0561\u057D\u0581\u0565\u056B \u0578\u0573", pre:"\u0546\u0561\u056D\u0561\u057A\u0565\u057D \u0586\u0578\u0580\u0574\u0561\u057F\u0561\u057E\u0578\u0580\u057E\u0561\u056E", h1:"\u054E\u0565\u0580\u0576\u0561\u0563\u056B\u0580 1", h2:"\u054E\u0565\u0580\u0576\u0561\u0563\u056B\u0580 2", h3:"\u054E\u0565\u0580\u0576\u0561\u0563\u056B\u0580 3", h4:"\u054E\u0565\u0580\u0576\u0561\u0563\u056B\u0580 4", h5:"\u054E\u0565\u0580\u0576\u0561\u0563\u056B\u0580 5", h6:"\u054E\u0565\u0580\u0576\u0561\u0563\u056B\u0580 6", blockquote:"\u0544\u0565\u056F\u0576\u0561\u0562\u0561\u0576\u0578\u0582\u0569\u0575\u0578\u0582\u0576", code:"\u053F\u0578\u0564", samp:"\u053F\u0578\u0564\u056B \u0585\u0580\u056B\u0576\u0561\u056F", dt:"\u054F\u0565\u0580\u0574\u056B\u0576\u0576\u0565\u0580\u056B \u0562\u0561\u057C\u0561\u0580\u0561\u0576", dd:"\u0532\u0561\u057C\u0561\u0580\u0561\u0576 \u0562\u0561\u0581\u0561\u057F\u0580\u0578\u0582\u0569\u0575\u0578\u0582\u0576", bold_desc:"\u0540\u0561\u057D\u057F (Ctrl + B)", italic_desc:"\u0547\u0565\u0572 (Ctrl + I)", underline_desc:"\u0538\u0576\u0564\u0563\u056E\u057E\u0561\u056E (Ctrl + U)", striketrough_desc:"\u0531\u0580\u057F\u0561\u0563\u056E\u057E\u0561\u056E", justifyleft_desc:"\u0541\u0561\u056D \u0570\u0561\u057E\u0561\u057D\u0561\u0580\u0565\u0581\u0578\u0582\u0574", justifycenter_desc:"\u053F\u0565\u0576\u057F\u0580\u0578\u0576\u0561\u0581\u0576\u0565\u056C", justifyright_desc:"\u0531\u057B \u0570\u0561\u057E\u0561\u057D\u0561\u0580\u0565\u0581\u0578\u0582\u0574", justifyfull_desc:"\u0538\u057D\u057F \u056C\u0561\u0575\u0576\u0578\u0582\u0569\u0575\u0561\u0576", bullist_desc:"\u0551\u0561\u0576\u056F", numlist_desc:"\u0540\u0561\u0574\u0561\u0580\u0561\u056F\u0561\u056C\u057E\u0561\u056E \u0581\u0561\u0576\u056F", outdent_desc:"\u053F\u0580\u0573\u0561\u057F\u0565\u056C \u0570\u0565\u057C\u0561\u057E\u0578\u0580\u0578\u0582\u0569\u0575\u0578\u0582\u0576\u0568 \u0571\u0561\u056D \u0565\u0566\u0580\u056B\u0581", indent_desc:"\u0531\u057E\u0565\u056C\u0561\u0581\u0576\u0565\u056C \u0570\u0565\u057C\u0561\u057E\u0578\u0580\u0578\u0582\u0569\u0575\u0578\u0582\u0576\u0568 \u0571\u0561\u056D \u0565\u0566\u0580\u056B\u0581", undo_desc:"\u0535\u057F (Ctrl + Z)", redo_desc:"\u0531\u057C\u0561\u057B (Ctrl + Y)", link_desc:"\u054F\u0565\u0572\u0561\u0564\u0580\u0565\u056C / \u0583\u0578\u0583\u0578\u056D\u0565\u056C \u0570\u0572\u0578\u0582\u0574\u0568", unlink_desc:"\u0540\u0565\u057C\u0561\u0581\u0576\u0565\u056C \u0570\u0572\u0578\u0582\u0574\u0568", image_desc:"\u0531\u057E\u0565\u056C\u0561\u0581\u0576\u0565\u056C / \u0583\u0578\u0583\u0578\u056D\u0565\u056C \u0576\u056F\u0561\u0580", cleanup_desc:"\u0540\u0565\u057C\u0561\u0581\u0576\u0565\u056C \u0561\u057E\u0565\u056C\u0578\u0580\u0564 \u056F\u0578\u0564\u0568", code_desc:"\u0553\u0578\u0583\u0578\u056D\u0565\u056C HTML \u056F\u0578\u0564\u0568", sub_desc:"\u054D\u057F\u0578\u0580\u056B\u0576 \u056B\u0576\u0564\u0565\u0584\u057D", sup_desc:"\u054E\u0565\u0580\u056B\u0576 \u056B\u0576\u0564\u0565\u0584\u057D", hr_desc:"\u054F\u0565\u0572\u0561\u0564\u0580\u0565\u056C \u0570\u0578\u0580\u056B\u0566\u0578\u0576\u0561\u056F\u0561\u0576 \u0562\u0561\u056A\u0561\u0576\u056B\u0579", removeformat_desc:"\u0540\u0565\u057C\u0561\u0581\u0576\u0565\u056C \u0586\u0578\u0580\u0574\u0561\u057F\u0561\u057E\u0578\u0580\u0578\u0582\u0574\u0568", custom1_desc:"\u0541\u0565\u0580 \u0574\u0565\u056F\u0576\u0561\u0562\u0561\u0576\u0578\u0582\u0569\u0575\u0578\u0582\u0576\u0568", forecolor_desc:"\u0538\u0576\u057F\u0580\u0565\u0584 \u057F\u0565\u0584\u057D\u057F\u056B \u0563\u0578\u0582\u0575\u0576\u0568", backcolor_desc:"\u0538\u0576\u057F\u0580\u0565\u0584 \u0586\u0578\u0576\u056B \u0563\u0578\u0582\u0575\u0576\u0568", charmap_desc:"\u054F\u0565\u0572\u0561\u0564\u0580\u0565\u056C \u057D\u056B\u0574\u057E\u0578\u056C", visualaid_desc:"Toggle guidelines / invisible elements", anchor_desc:"\u0531\u057E\u0565\u056C\u0561\u0581\u0576\u0565\u056C / \u0583\u0578\u0583\u056D\u0565\u056C \u056D\u0561\u0580\u056B\u057D\u056D\u0568", cut_desc:"\u053F\u057F\u0580\u0565\u056C", copy_desc:"\u054A\u0561\u057F\u0573\u0565\u0576\u0565\u056C", paste_desc:"\u054F\u0565\u0572\u0561\u0564\u0580\u0565\u056C", image_props_desc:"\u0546\u056F\u0561\u0580\u056B \u057A\u0561\u0580\u0561\u0574\u0565\u057F\u0580\u0565\u0580", newdocument_desc:"\u0546\u0578\u0580 \u0583\u0561\u057D\u057F\u0561\u0569\u0578\u0582\u0572\u0569", help_desc:"\u0555\u0563\u0576\u0578\u0582\u0569\u0575\u0578\u0582\u0576", blockquote_desc:"\u0544\u0565\u056F\u0576\u0561\u0562\u0561\u0576\u0578\u0582\u0569\u0575\u0578\u0582\u0576", clipboard_msg:"\u054A\u0561\u057F\u0573\u0565\u0576\u0565\u056C / \u053F\u057F\u0580\u0565\u056C / \u054F\u0565\u0572\u0561\u0564\u0580\u0565\u056C (\u0574\u0561\u057F\u0579\u0565\u056C\u056B \u0579\u0567 Mozilla \u0587 Firefox \u0562\u0580\u0561\u0578\u0582\u0566\u0565\u0580\u0576\u0565\u0580\u0578\u0582\u0574) \ n \u0541\u0565\u0566 \u0570\u0565\u057F\u0561\u0584\u0580\u0584\u056B\u055E\u0580 \u0567 \u0561\u0575\u0564 \u056B\u0576\u0586\u0578\u0580\u0574\u0561\u0581\u056B\u0561\u0576", path:"\u0540\u0561\u057D\u0581\u0565", newdocument:"\u0540\u0561\u0574\u0578\u0566\u057E\u0561\u055E\u056E \u0565\u0584, \u0578\u0580 \u0581\u0561\u0576\u056F\u0561\u0576\u0578\u0582\u0574 \u0565\u0584 \u0561\u0574\u0562\u0578\u0572\u057B\u0568 \u0570\u0565\u057C\u0561\u0581\u0576\u0565\u056C", toolbar_focus:"\u0531\u0576\u0581\u0576\u0565\u056C \u057D\u0565\u0572\u0574\u0561\u056F\u0576\u0565\u0580\u056B \u057E\u0561\u0570\u0561\u0576\u0561\u056F - Alt + Q, \u0531\u0576\u0581\u0576\u0565\u056C \u056D\u0574\u0562\u0561\u0563\u0580\u056B\u0579\u056B\u0576 - Alt-Z, \u0531\u0576\u0581\u0576\u0565\u056C \u0570\u0561\u057D\u0581\u0565\u056B \u0567\u056C\u0565\u0574\u0565\u0576\u057F\u056B\u0576 - Alt-X", more_colors:"\u0547\u0561\u057F \u0563\u0578\u0582\u0575\u0576\u0565\u0580" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/hy_dlg.js000066400000000000000000000121161226600447100241410ustar00rootroot00000000000000tinyMCE.addI18n('hy.advanced_dlg',{ about_title:"TinyMCE \u053D\u0574\u0562\u0561\u0563\u0580\u056B\u0579", about_general:"\u053E\u0580\u0561\u0563\u0580\u0561\u0575\u056B\u0576 \u0561\u057A\u0561\u0570\u0578\u057E\u0574\u0561\u0576 \u0574\u0561\u057D\u056B\u0576 ...", about_help:"\u0555\u0563\u0576\u0578\u0582\u0569\u0575\u0578\u0582\u0576", about_license:"\u053C\u056B\u0581\u0565\u0576\u0566\u056B\u0561", about_plugins:"\u054A\u056C\u0561\u0563\u056B\u0576\u0576\u0565\u0580", about_plugin:"\u054A\u056C\u0561\u0563\u056B\u0576", about_author:"\u0540\u0565\u0572\u056B\u0576\u0561\u056F", about_version:"\u054F\u0561\u0580\u0562\u0565\u0580\u0561\u056F", about_loaded:"\u0532\u0565\u057C\u0562\u057E\u0561\u056E \u057A\u056C\u0561\u0563\u056B\u0576\u0576\u0565\u0580", anchor_title:"\u0531\u057E\u0565\u056C\u0561\u0581\u0576\u0565\u056C / \u0583\u0578\u0583\u0578\u056D\u0565\u056C \u056D\u0561\u0580\u056B\u057D\u056D\u0568", anchor_name:"\u053D\u0561\u0580\u056B\u057D\u056D \u0561\u0576\u057E\u0561\u0576\u0578\u0582\u0574", code_title:"HTML \u056F\u0578\u0564\u056B \u056D\u0574\u0562\u0561\u0563\u0580\u056B\u0579", code_wordwrap:"\u054F\u0565\u0572\u0561\u0583\u0578\u056D\u0565\u056C \u0562\u0561\u057C\u0565\u0580", colorpicker_title:"\u0538\u0576\u057F\u0580\u0565\u0584 \u0563\u0578\u0582\u0575\u0576", colorpicker_picker_tab:"\u0533\u0578\u0582\u0576\u0561\u0575\u056B\u0576 \u0585\u0580\u056B\u0576\u0561\u056F", colorpicker_picker_title:"\u0533\u0578\u0582\u0576\u0561\u0575\u056B\u0576 \u0585\u0580\u056B\u0576\u0561\u056F", colorpicker_palette_tab:"\u0551\u0561\u0576\u056F", colorpicker_palette_title:"\u0533\u0578\u0582\u0575\u0576\u0565\u0580\u056B \u0581\u0561\u0576\u056F", colorpicker_named_tab:"\u0538\u057D\u057F \u0561\u0576\u057E\u0561\u0576\u0574\u0561\u0576", colorpicker_named_title:"\u0538\u057D\u057F \u0561\u0576\u057E\u0561\u0576\u0574\u0561\u0576", colorpicker_color:"\u0533\u0578\u0582\u0575\u0576:", colorpicker_name:"\u0531\u0576\u057E\u0561\u0576\u0578\u0582\u0574:", charmap_title:"\u0538\u0576\u057F\u0580\u0565\u056C \u057A\u0561\u057F\u0561\u0570\u0561\u056F\u0561\u0576 \u057D\u056B\u0574\u057E\u0578\u056C", image_title:"\u0531\u057E\u0565\u056C\u0561\u0581\u0576\u0565\u056C / \u0583\u0578\u0583\u0578\u056D\u0565\u056C \u0576\u056F\u0561\u0580", image_src:"\u0540\u0561\u057D\u0581\u0565", image_alt:"\u0546\u056F\u0561\u0580\u0561\u0563\u0580\u0578\u0582\u0569\u0575\u0578\u0582\u0576", image_list:"\u0546\u056F\u0561\u0580\u0576\u0565\u0580\u056B \u0581\u0561\u0576\u056F", image_border:"\u0535\u0566\u0580", image_dimensions:"\u0549\u0561\u0583\u057D\u0565\u0580", image_vspace:"\u0548\u0582\u0572\u0572\u0561\u0570. \u0577\u0565\u0572\u0578\u0582\u0574", image_hspace:"\u0540\u0578\u0580\u056B\u0566. \u0577\u0565\u0572\u0578\u0582\u0574", image_align:"\u0540\u0561\u057E\u0561\u057D\u0561\u0580\u0565\u0581\u0578\u0582\u0574", image_align_baseline:"\u0538\u057D\u057F \u0562\u0561\u0566\u0561\u0575\u056B\u0576 \u0563\u056E\u056B", image_align_top:"\u0538\u057D\u057F \u057E\u0565\u0580\u056B\u0576 \u0565\u0566\u0580\u056B", image_align_middle:"\u053F\u0565\u0576\u057F\u0580\u0578\u0576\u0561\u0581\u0576\u0565\u056C", image_align_bottom:"\u0538\u057D\u057F \u057D\u057F\u0578\u0580\u056B\u0576 \u0563\u056E\u056B", image_align_texttop:"\u0538\u057D\u057F \u057F\u0565\u0584\u057D\u057F\u056B \u057E\u0565\u0580\u056B\u0576 \u0565\u0566\u0580\u056B", image_align_textbottom:"\u0538\u057D\u057F \u057F\u0565\u0584\u057D\u057F\u056B \u057D\u057F\u0578\u0580\u056B\u0576 \u0565\u0566\u0580\u056B", image_align_left:"\u0541\u0561\u056D \u0570\u0561\u057E\u0561\u057D\u0561\u0580\u0565\u0581\u0578\u0582\u0574", image_align_right:"\u0531\u057B \u0570\u0561\u057E\u0561\u057D\u0561\u0580\u0565\u0581\u0578\u0582\u0574", link_title:"\u0531\u057E\u0565\u056C\u0561\u0581\u0576\u0565\u056C / \u0583\u0578\u0583\u0578\u056D\u0565\u056C \u0570\u0572\u0578\u0582\u0574\u0568", link_url:"\u0540\u0572\u0574\u0561\u0576 \u0570\u0561\u057D\u0581\u0565", link_target:"\u0532\u0561\u0581\u0565\u056C ...", link_target_same:"\u0561\u0575\u057D \u057A\u0561\u057F\u0578\u0582\u0570\u0561\u0576\u0578\u0582\u0574", link_target_blank:"\u0576\u0578\u0580 \u057A\u0561\u057F\u0578\u0582\u0570\u0561\u0576\u0578\u0582\u0574", link_titlefield:"\u054E\u0565\u0580\u0576\u0561\u0563\u056B\u0580", link_is_email:"\u0546\u0565\u0580\u0561\u056E\u057E\u0561\u056E URL \u0570\u0561\u057D\u0581\u0565\u0576 \u0576\u0574\u0561\u0576 \u0567 email \u0570\u0561\u057D\u0581\u0565\u056B, \u0534\u0578\u0582\u0584 \u0581\u0561\u0576\u056F\u0561\u0576\u0578\u0582\u055E\u0574 \u0565\u0584 \u0561\u057E\u0565\u056C\u0561\u0581\u0576\u0565\u056C mailto:", link_is_external:"\u0546\u0565\u0580\u0561\u056E\u057E\u0561\u056E URL \u0570\u0561\u057D\u0581\u0565\u0576 \u0576\u0574\u0561\u0576 \u0567 \u0561\u0580\u057F\u0561\u0584\u056B\u0576 \u0570\u0572\u0574\u0561\u0576, \u0534\u0578\u0582\u0584 \u0581\u0561\u0576\u056F\u0561\u0576\u0578\u0582\u055E\u0574 \u0565\u0584 \u0561\u057E\u0565\u056C\u0561\u0581\u0576\u0565\u056C http://", link_list:"\u0540\u0572\u0578\u0582\u0574\u0576\u0565\u0580\u056B \u0581\u0561\u0576\u056F" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/ia.js000066400000000000000000000047101226600447100232650ustar00rootroot00000000000000tinyMCE.addI18n('ia.advanced',{ style_select:"\u6837\u5F0F", font_size:"\u5B57\u4F53\u5927\u5C0F", fontdefault:"\u5B57\u4F53", block:"\u683C\u5F0F", paragraph:"\u6BB5\u843D", div:"Div", address:"\u5730\u5740", pre:"\u9ED8\u8BA4\u683C\u5F0F", h1:"\u6807\u9898 1", h2:"\u6807\u9898 2", h3:"\u6807\u9898 3", h4:"\u6807\u9898 4", h5:"\u6807\u9898 5", h6:"\u6807\u9898 6", blockquote:"\u5F15\u7528", code:"\u4EE3\u7801", samp:"\u7A0B\u5E8F\u8303\u4F8B", dt:"\u540D\u8BCD\u5B9A\u4E49", dd:"\u540D\u8BCD\u89E3\u91CA", bold_desc:"\u7C97\u4F53 (Ctrl+B)", italic_desc:"\u659C\u4F53 (Ctrl+I)", underline_desc:"\u5E95\u7EBF (Ctrl+U)", striketrough_desc:"\u4E2D\u5212\u7EBF", justifyleft_desc:"\u5DE6\u5BF9\u9F50", justifycenter_desc:"\u5C45\u4E2D", justifyright_desc:"\u53F3\u5BF9\u9F50", justifyfull_desc:"\u4E24\u7AEF\u5BF9\u9F50", bullist_desc:"\u6E05\u5355\u7B26\u53F7", numlist_desc:"\u7F16\u53F7", outdent_desc:"\u51CF\u5C11\u7F29\u8FDB", indent_desc:"\u589E\u52A0\u7F29\u8FDB", undo_desc:"\u64A4\u9500 (Ctrl+Z)", redo_desc:"\u6062\u590D (Ctrl+Y)", link_desc:"\u63D2\u5165/\u7F16\u8F91 \u8FDE\u7ED3", unlink_desc:"\u53D6\u6D88\u8FDE\u7ED3", image_desc:"\u63D2\u5165/\u7F16\u8F91 \u56FE\u7247", cleanup_desc:"\u5220\u9664\u5197\u4F59\u7801", code_desc:"\u7F16\u8F91 HTML \u539F\u59CB\u7A0B\u5E8F\u4EE3\u7801", sub_desc:"\u4E0B\u6807", sup_desc:"\u4E0A\u6807", hr_desc:"\u63D2\u5165\u6C34\u5E73\u7EBF", removeformat_desc:"\u6E05\u9664\u6837\u5F0F", custom1_desc:"\u5728\u6B64\u8F93\u5165\u60A8\u7684\u81EA\u8BA2\u63CF\u8FF0", forecolor_desc:"\u9009\u62E9\u6587\u5B57\u989C\u8272", backcolor_desc:"\u9009\u62E9\u80CC\u666F\u989C\u8272", charmap_desc:"\u63D2\u5165\u7279\u6B8A\u7B26\u53F7", visualaid_desc:"\u7F51\u683C/\u9690\u85CF\u7EC4\u4EF6\uFF1F", anchor_desc:"\u63D2\u5165/\u7F16\u8F91 \u951A\u70B9", cut_desc:"\u526A\u5207 (Ctrl+X)", copy_desc:"\u590D\u5236 (Ctrl+C)", paste_desc:"\u7C98\u8D34 (Ctrl+V)", image_props_desc:"\u56FE\u7247\u5C5E\u6027", newdocument_desc:"\u65B0\u5EFA\u6587\u4EF6", help_desc:"\u5E2E\u52A9", blockquote_desc:"\u5F15\u7528", clipboard_msg:"\u590D\u5236\u3001\u526A\u5207\u548C\u7C98\u8D34\u529F\u80FD\u5728Mozilla \u548C Firefox\u4E2D\u65E0\u6CD5\u4F7F\u7528", path:"\u8DEF\u5F84", newdocument:"\u60A8\u786E\u8BA4\u8981\u5220\u9664\u5168\u90E8\u5185\u5BB9\u5417\uFF1F", toolbar_focus:"\u5DE5\u5177\u5217 - Alt+Q, \u7F16\u8F91\u5668 - Alt-Z, \u7EC4\u4EF6\u8DEF\u5F84 - Alt-X", more_colors:"\u66F4\u591A\u989C\u8272" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/ia_dlg.js000066400000000000000000000046511226600447100241170ustar00rootroot00000000000000tinyMCE.addI18n('ia.advanced_dlg',{ about_title:"\u5173\u4E8E TinyMCE", about_general:"\u5173\u4E8E", about_help:"\u5E2E\u52A9", about_license:"\u6388\u6743", about_plugins:"\u5168\u90E8\u5916\u6302\u7A0B\u5E8F", about_plugin:"\u5916\u6302\u7A0B\u5E8F", about_author:"\u4F5C\u8005", about_version:"\u7248\u672C", about_loaded:"\u5DF2\u52A0\u8F7D\u7684\u5916\u6302\u7A0B\u5E8F", anchor_title:"\u63D2\u5165/\u7F16\u8F91 \u951A\u70B9", anchor_name:"\u951A\u70B9\u540D\u79F0", code_title:"HTML \u539F\u59CB\u7A0B\u5E8F\u4EE3\u7801\u7F16\u8F91\u5668", code_wordwrap:"\u81EA\u52A8\u6362\u884C", colorpicker_title:"\u9009\u62E9\u989C\u8272", colorpicker_picker_tab:"\u9009\u62E9\u5668", colorpicker_picker_title:"\u53D6\u8272\u5668", colorpicker_palette_tab:"\u8272\u8C31", colorpicker_palette_title:"\u8272\u8C31\u989C\u8272", colorpicker_named_tab:"\u9ED8\u8BA4\u503C", colorpicker_named_title:"\u9ED8\u8BA4\u7684\u989C\u8272", colorpicker_color:"\u989C\u8272:", colorpicker_name:"\u8272\u540D:", charmap_title:"\u63D2\u5165\u7279\u6B8A\u7B26\u53F7", image_title:"\u63D2\u5165/\u7F16\u8F91 \u56FE\u7247", image_src:"\u56FE\u7247\u7F51\u5740", image_alt:"\u56FE\u7247\u8BF4\u660E", image_list:"\u56FE\u7247\u6E05\u5355", image_border:"\u8FB9\u6846", image_dimensions:"\u5C3A\u5BF8", image_vspace:"\u5782\u76F4\u95F4\u8DDD", image_hspace:"\u6C34\u5E73\u95F4\u8DDD", image_align:"\u5BF9\u9F50\u65B9\u5F0F", image_align_baseline:"\u57FA\u7EBF", image_align_top:"\u9876\u90E8\u5BF9\u9F50", image_align_middle:"\u4E2D\u90E8\u5BF9\u9F50", image_align_bottom:"\u5E95\u90E8\u5BF9\u9F50", image_align_texttop:"\u6587\u5B57\u4E0A\u65B9", image_align_textbottom:"\u6587\u5B57\u4E0B\u65B9", image_align_left:"\u5DE6\u5BF9\u9F50", image_align_right:"\u53F3\u5BF9\u9F50", link_title:"\u63D2\u5165/\u7F16\u8F91 \u8FDE\u7ED3", link_url:"\u8FDE\u7ED3\u7F51\u5740", link_target:"\u76EE\u6807", link_target_same:"\u5F53\u524D\u7A97\u53E3\u6253\u5F00", link_target_blank:"\u65B0\u7A97\u53E3\u6253\u5F00", link_titlefield:"\u6807\u9898", link_is_email:"\u60A8\u8F93\u5165\u7684\u5E94\u8BE5\u662F\u4E00\u4E2A\u7535\u5B50\u90AE\u5BC4\u5730\u5740\uFF0C\u662F\u5426\u9700\u8981\u5728\u7F51\u5740\u524D\u52A0\u4E0A mailto: ? ", link_is_external:"\u60A8\u8F93\u5165\u7684\u7F51\u5740\u5E94\u8BE5\u662F\u4E00\u4E2A\u5916\u90E8\u8FDE\u7ED3\uFF0C\u662F\u5426\u9700\u8981\u5728\u7F51\u5740\u524D\u52A0\u4E0A http:// ?", link_list:"\u8FDE\u7ED3\u6E05\u5355" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/id.js000066400000000000000000000034741226600447100232760ustar00rootroot00000000000000tinyMCE.addI18n('id.advanced',{ style_select:"Styles", font_size:"Font size", fontdefault:"Font family", block:"Format", paragraph:"Paragraph", div:"Div", address:"Address", pre:"Preformatted", h1:"Heading 1", h2:"Heading 2", h3:"Heading 3", h4:"Heading 4", h5:"Heading 5", h6:"Heading 6", blockquote:"Blockquote", code:"Code", samp:"Code sample", dt:"Definition term ", dd:"Definition description", bold_desc:"Bold (Ctrl+B)", italic_desc:"Italic (Ctrl+I)", underline_desc:"Underline (Ctrl+U)", striketrough_desc:"Strikethrough", justifyleft_desc:"Align left", justifycenter_desc:"Align center", justifyright_desc:"Align right", justifyfull_desc:"Align full", bullist_desc:"Unordered list", numlist_desc:"Ordered list", outdent_desc:"Outdent", indent_desc:"Indent", undo_desc:"Undo (Ctrl+Z)", redo_desc:"Redo (Ctrl+Y)", link_desc:"Insert/edit link", unlink_desc:"Unlink", image_desc:"Insert/edit image", cleanup_desc:"Cleanup messy code", code_desc:"Edit HTML Source", sub_desc:"Subscript", sup_desc:"Superscript", hr_desc:"Insert horizontal ruler", removeformat_desc:"Remove formatting", custom1_desc:"Deskripsi disini", forecolor_desc:"Pilih text color", backcolor_desc:"Pilih background color", charmap_desc:"Insert custom character", visualaid_desc:"Toggle guidelines/invisible elements", anchor_desc:"Insert/edit anchor", cut_desc:"Cut", copy_desc:"Copy", paste_desc:"Paste", image_props_desc:"Image properties", newdocument_desc:"New document", help_desc:"Help", blockquote_desc:"Blockquote", clipboard_msg:"Copy/Cut/Paste tidak tersedia pada Mozilla dan Firefox.\nButuh info selengkapnya?", path:"Path", newdocument:"Yakin untuk menghapus semua konten?", toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X", more_colors:"More colors" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/id_dlg.js000066400000000000000000000032651226600447100241220ustar00rootroot00000000000000tinyMCE.addI18n('id.advanced_dlg',{ about_title:"Tentang TinyMCE", about_general:"Tentang", about_help:"Bantuan", about_license:"Lisensi", about_plugins:"Plugins", about_plugin:"Plugin", about_author:"Penulis", about_version:"Versi", about_loaded:"Loaded plugins", anchor_title:"Insert/edit anchor", anchor_name:"Anchor name", code_title:"HTML Source Editor", code_wordwrap:"Word wrap", colorpicker_title:"Select a color", colorpicker_picker_tab:"Picker", colorpicker_picker_title:"Color picker", colorpicker_palette_tab:"Palette", colorpicker_palette_title:"Palette colors", colorpicker_named_tab:"Named", colorpicker_named_title:"Named colors", colorpicker_color:"Color:", colorpicker_name:"Name:", charmap_title:"Pilih custom character", image_title:"Insert/edit image", image_src:"Image URL", image_alt:"Image description", image_list:"Image list", image_border:"Border", image_dimensions:"Dimensions", image_vspace:"Vertical space", image_hspace:"Horizontal space", image_align:"Alignment", image_align_baseline:"Baseline", image_align_top:"Top", image_align_middle:"Middle", image_align_bottom:"Bottom", image_align_texttop:"Text top", image_align_textbottom:"Text bottom", image_align_left:"Left", image_align_right:"Right", link_title:"Insert/edit link", link_url:"Link URL", link_target:"Target", link_target_same:"Buka link pada window yang sama", link_target_blank:"Buka link pada window baru", link_titlefield:"Judul", link_is_email:"URL yang Anda sisipkan tampaknya e-mail, Anda ingin menambahkan awalan 'mailto:'?", link_is_external:"URL yang Anda sisipkan tampaknya link eksternal, Anda ingin menambahkan awalan 'http://'?", link_list:"Daftar Link" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/ii.js000066400000000000000000000051101226600447100232700ustar00rootroot00000000000000tinyMCE.addI18n('ii.advanced',{ style_select:"\u6837\u5F0F", font_size:"\u5B57\u4F53\u5927\u5C0F", fontdefault:"\u5B57\u4F53", block:"\u683C\u5F0F", paragraph:"\u6BB5\u843D", div:"DIV\u5C42", address:"\u5730\u5740", pre:"\u65E0\u5F0F\u6837\u7F16\u6392", h1:"\u6807\u98981", h2:"\u6807\u98982", h3:"\u6807\u98983", h4:"\u6807\u98984", h5:"\u6807\u98985", h6:"\u6807\u98986", blockquote:"\u5F15\u7528", code:"\u4EE3\u7801", samp:"\u4EE3\u7801\u6837\u4F8B", dt:"\u540D\u8BCD\u5B9A\u4E49", dd:"\u540D\u8BCD\u89E3\u91CA", bold_desc:"\u9ED1\u4F53(Ctrl+B)", italic_desc:"\u659C\u4F53(Ctrl+I)", underline_desc:"\u5E95\u7EBF(Ctrl+U)", striketrough_desc:"\u5220\u9664\u7EBF", justifyleft_desc:"\u5DE6\u5BF9\u9F50", justifycenter_desc:"\u5C45\u4E2D", justifyright_desc:"\u53F3\u5BF9\u9F50", justifyfull_desc:"\u4E24\u7AEF\u5BF9\u9F50", bullist_desc:"\u4E13\u6848\u7B26\u53F7", numlist_desc:"\u7F16\u53F7", outdent_desc:"\u51CF\u5C11\u7F29\u6392", indent_desc:"\u589E\u52A0\u7F29\u6392", undo_desc:"\u64A4\u9500(Ctrl+Z)", redo_desc:"\u91CD\u505A(Ctrl+Y)", link_desc:"\u63D2\u5165/\u7F16\u8F91\u8FDE\u7ED3", unlink_desc:"\u53D6\u6D88\u8FDE\u7ED3", image_desc:"\u63D2\u5165/\u7F16\u8F91\u56FE\u7247", cleanup_desc:"\u6E05\u9664\u591A\u4F59\u4EE3\u7801", code_desc:"\u7F16\u8F91HTML\u539F\u59CB\u7A0B\u5F0F\u7801", sub_desc:"\u4E0B\u6807", sup_desc:"\u4E0A\u6807", hr_desc:"\u63D2\u5165\u6C34\u5E73\u7EBF", removeformat_desc:"\u6E05\u9664\u6837\u5F0F", custom1_desc:"\u5728\u6B64\u8F93\u5165\u60A8\u7684\u81EA\u8BA2\u63CF\u8FF0", forecolor_desc:"\u9009\u62E9\u6587\u5B57\u989C\u8272", backcolor_desc:"\u9009\u62E9\u80CC\u666F\u989C\u8272", charmap_desc:"\u63D2\u5165\u7279\u6B8A\u7B26\u53F7", visualaid_desc:"\u5F00\u5173\u683C\u7EBF/\u9690\u85CF\u5143\u4EF6", anchor_desc:"\u63D2\u5165/\u7F16\u8F91\u951A\u70B9", cut_desc:"\u526A\u5207", copy_desc:"\u590D\u5236", paste_desc:"\u7C98\u8D34", image_props_desc:"\u56FE\u7247\u5C5E\u6027", newdocument_desc:"\u65B0\u6587\u4EF6", help_desc:"\u8BF4\u660E", blockquote_desc:"\u5F15\u7528", clipboard_msg:"\u590D\u5236\u3001\u526A\u5207\u53CA\u7C98\u8D34\u529F\u80FD\u5728Mozilla\u548CFirefox\u4E2D\u4E0D\u80FD\u4F7F\u7528\u3002 \n\u662F\u5426\u9700\u8981\u4E86\u89E3\u66F4\u591A\u6709\u5173\u6B64\u95EE\u9898\u7684\u8D44\u8BAF\uFF1F", path:"\u4F4D\u7F6E", newdocument:"\u60A8\u786E\u8BA4\u8981\u6E05\u9664\u5168\u90E8\u5185\u5BB9\u5417\uFF1F", toolbar_focus:"\u5DE5\u5177\u6309\u94AE- Alt+Q,\u7F16\u8F91\u5668- Alt-Z,\u5143\u4EF6\u4F4D\u7F6E- Alt-X", more_colors:"\u66F4\u591A\u989C\u8272", link_delta_width:"40", link_delta_height:"60" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/ii_dlg.js000066400000000000000000000050111226600447100241160ustar00rootroot00000000000000tinyMCE.addI18n('ii.advanced_dlg',{ about_title:"\u5173\u4E8ETinyMCE", about_general:"\u5173\u4E8E", about_help:"\u5E2E\u52A9", about_license:"\u6388\u6743", about_plugins:"\u5168\u90E8\u5916\u6302\u7A0B\u5F0F", about_plugin:"\u5916\u6302\u7A0B\u5F0F", about_author:"\u4F5C\u8005", about_version:"\u7248\u672C", about_loaded:"\u5DF2\u8F7D\u5165\u7684\u5916\u6302\u7A0B\u5F0F", anchor_title:"\u63D2\u5165/\u7F16\u8F91\u951A\u70B9", anchor_name:"\u951A\u70B9\u540D\u79F0", code_title:"HTML\u539F\u59CB\u7A0B\u5F0F\u7801\u7F16\u8F91\u5668", code_wordwrap:"\u6574\u5B57\u6362\u884C", colorpicker_title:"\u6311\u9009\u989C\u8272", colorpicker_picker_tab:"\u9009\u8272\u5668", colorpicker_picker_title:"\u9009\u8272\u5668", colorpicker_palette_tab:"\u8272\u76D8", colorpicker_palette_title:"\u8272\u76D8\u989C\u8272", colorpicker_named_tab:"\u9884\u8BBE\u7684", colorpicker_named_title:"\u9884\u8BBE\u7684\u989C\u8272", colorpicker_color:"\u989C\u8272:", colorpicker_name:"\u540D\u79F0:", charmap_title:"\u63D2\u5165\u7279\u6B8A\u7B26\u53F7", image_title:"\u63D2\u5165/\u7F16\u8F91\u56FE\u7247", image_src:"\u56FE\u7247\u4F4D\u5740", image_alt:"\u56FE\u7247\u8BF4\u660E", image_list:"\u56FE\u7247\u6E05\u5355", image_border:"\u8FB9\u6846", image_dimensions:"\u5C3A\u5BF8", image_vspace:"\u5782\u76F4\u95F4\u8DDD", image_hspace:"\u6C34\u51C6\u95F4\u8DDD", image_align:"\u5BF9\u9F50\u65B9\u5F0F", image_align_baseline:"\u57FA\u7EBF", image_align_top:"\u4E0A\u65B9\u5BF9\u9F50", image_align_middle:"\u5C45\u4E2D\u5BF9\u9F50", image_align_bottom:"\u5E95\u90E8\u5BF9\u9F50", image_align_texttop:"\u6587\u5B57\u4E0A\u65B9", image_align_textbottom:"\u6587\u5B57\u4E0B\u65B9", image_align_left:"\u9760\u5DE6\u5BF9\u9F50", image_align_right:"\u9760\u53F3\u5BF9\u9F50", link_title:"\u63D2\u5165/\u7F16\u8F91\u8FDE\u7ED3", link_url:"\u8FDE\u7ED3\u4F4D\u5740", link_target:"\u76EE\u6807", link_target_same:"\u5C06\u94FE\u63A5\u7F51\u5740\u5728\u6B64\u7A97\u53E3\u6253\u5F00", link_target_blank:"\u5C06\u94FE\u63A5\u7F51\u5740\u5728\u65B0\u7A97\u53E3\u6253\u5F00", link_titlefield:"\u6807\u9898", link_is_email:"\u60A8\u8F93\u5165\u7684\u7F51\u5740\u5E94\u8BE5\u662F\u4E00\u4E2A\u7535\u5B50\u90AE\u5BC4\u5730\u5740\uFF0C\u662F\u5426\u9700\u8981\u5728\u4F4D\u5740\u524D\u65B9\u52A0\u5165mailto:\uFF1F", link_is_external:"\u60A8\u8F93\u5165\u7684\u7F51\u5740\u5E94\u8BE5\u662F\u4E00\u4E2A\u5916\u90E8\u8FDE\u7ED3\uFF0C\u662F\u5426\u9700\u8981\u5728\u7F51\u5740\u524D\u65B9\u52A0\u5165http://\uFF1F", link_list:"\u8FDE\u7ED3\u6E05\u5355" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/is.js000066400000000000000000000042261226600447100233110ustar00rootroot00000000000000tinyMCE.addI18n('is.advanced',{ style_select:"St\u00EDlsni\u00F0", font_size:"Leturst\u00E6r\u00F0", fontdefault:"Leturger\u00F0", block:"Format", paragraph:"M\u00E1lsgrein", div:"Div", address:"Heimilisfang", pre:"Forsni\u00F0i\u00F0", h1:"Fyrirs\u00F6gn 1", h2:"Fyrirs\u00F6gn 2", h3:"Fyrirs\u00F6gn 3", h4:"Fyrirs\u00F6gn 4", h5:"Fyrirs\u00F6gn 5", h6:"Fyrirs\u00F6gn 6", blockquote:"Blockquote", code:"K\u00F3\u00F0i", samp:"K\u00F3\u00F0ad\u00E6mi", dt:"Definition term ", dd:"Definition description", bold_desc:"Feitletra (Ctrl+B)", italic_desc:"Sk\u00E1letra (Ctrl+I)", underline_desc:"Undirstrika (Ctrl+U)", striketrough_desc:"Yfirstrika", justifyleft_desc:"Vinstrijafna", justifycenter_desc:"Mi\u00F0jujafna", justifyright_desc:"H\u00E6grijafna", justifyfull_desc:"Jafna", bullist_desc:"B\u00F3lulisti", numlist_desc:"N\u00FAmera\u00F0ur listi", outdent_desc:"Draga \u00FAt", indent_desc:"Draga inn", undo_desc:"Taka til baka (Ctrl+Z)", redo_desc:"Endurtaka (Ctrl+Y)", link_desc:"Setja inn/breyta hlekk", unlink_desc:"Afhlekkja", image_desc:"Setja inn/breyta mynd", cleanup_desc:"Hreinsa sk\u00EDtugan k\u00F3\u00F0a", code_desc:"Breyta HTML k\u00F3\u00F0a", sub_desc:"Subscript", sup_desc:"Superscript", hr_desc:"Setja inn l\u00E1r\u00E9tta l\u00EDnu", removeformat_desc:"Hreinsa sni\u00F0", custom1_desc:"L\u00FDsingin \u00FE\u00EDn h\u00E9r", forecolor_desc:"Veldu lit texta", backcolor_desc:"Veldu bakgrunnslit", charmap_desc:"Setja inn t\u00E1kn", visualaid_desc:"Toggle guidelines/invisible elements", anchor_desc:"Setja inn/breyta akkeri", cut_desc:"Klippa", copy_desc:"Afrita", paste_desc:"L\u00EDma", image_props_desc:"Stillingar myndar", newdocument_desc:"N\u00FDtt skjal", help_desc:"Hj\u00E1lp", blockquote_desc:"Blockquote", clipboard_msg:"Afrita/Klippa/L\u00EDma er ekki a\u00F0gengilegt \u00ED Mozilla og Firefox eins og er.\nViltu f\u00E1 n\u00E1nari uppl\u00FDsingar?", path:"Sl\u00F3\u00F0", newdocument:"Ertu viss um a\u00F0 \u00FE\u00FA viljir hreinsa allt?", toolbar_focus:"Hoppa \u00ED t\u00F3lastiku - Alt+Q, Hoppa \u00ED ritil - Alt-Z, Hoppa \u00ED sl\u00F3\u00F0 - Alt-X", more_colors:"Fleiri litir" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/is_dlg.js000066400000000000000000000036371226600447100241440ustar00rootroot00000000000000tinyMCE.addI18n('is.advanced_dlg',{ about_title:"Um TinyMCE", about_general:"Um", about_help:"Hj\u00E1lp", about_license:"Leyfi", about_plugins:"Vi\u00F0b\u00E6tur", about_plugin:"Vi\u00F0b\u00E6tur", about_author:"H\u00F6fundur", about_version:"\u00DAtg\u00E1fa", about_loaded:"Vi\u00F0b\u00E6tur \u00ED notkun", anchor_title:"Setja inn/breyta akkeri", anchor_name:"Nafn akkeris", code_title:"HTML k\u00F3\u00F0a ritill", code_wordwrap:"Word wrap", colorpicker_title:"Veldu lit", colorpicker_picker_tab:"Veljari", colorpicker_picker_title:"Litaveljari", colorpicker_palette_tab:"Litaspjald", colorpicker_palette_title:"Litir litaspjalds", colorpicker_named_tab:"Nefndir", colorpicker_named_title:"Nefndir litir", colorpicker_color:"Litur:", colorpicker_name:"Nafn:", charmap_title:"Veldu t\u00E1kn", image_title:"Setja inn/breyta mynd", image_src:"Sl\u00F3\u00F0 myndar", image_alt:"L\u00FDsing myndar", image_list:"Myndalisti", image_border:"Rammi", image_dimensions:"St\u00E6r\u00F0ir", image_vspace:"L\u00F3\u00F0r\u00E9tt loftun", image_hspace:"L\u00E1r\u00E9tt loftun", image_align:"J\u00F6fnun", image_align_baseline:"Baseline", image_align_top:"Toppur", image_align_middle:"Mi\u00F0ja", image_align_bottom:"Botn", image_align_texttop:"Toppur texta", image_align_textbottom:"Botn texta", image_align_left:"Vinstri", image_align_right:"H\u00E6gri", link_title:"Setja inn/breyta hlekk", link_url:"Sl\u00F3\u00F0 hlekks", link_target:"Target", link_target_same:"Opna hlekk \u00ED sama glugga", link_target_blank:"Opna hlekk \u00ED n\u00FDjum glugga", link_titlefield:"Titill", link_is_email:"Sl\u00F3\u00F0in sem \u00FE\u00FA sl\u00F3st inn vir\u00F0ist vera netfang, viltu b\u00E6ta vi\u00F0 mailto: forskeytinu?", link_is_external:"Sl\u00F3\u00F0in sem \u00FE\u00FA sl\u00F3st inn vir\u00F0ist vera utana\u00F0komandi, viltu b\u00E6ta vi\u00F0 http:// forskeytinu?", link_list:"Hlekkjalisti" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/it.js000066400000000000000000000041741226600447100233140ustar00rootroot00000000000000tinyMCE.addI18n('it.advanced',{ style_select:"Stili", font_size:"Grandezza carattere", fontdefault:"Famiglia carattere", block:"Formato", paragraph:"Paragrafo", div:"Div", address:"Indirizzo", pre:"Preformattato", h1:"Intestazione 1", h2:"Intestazione 2", h3:"Intestazione 3", h4:"Intestazione 4", h5:"Intestazione 5", h6:"Intestazione 6", blockquote:"Testo quotato", code:"Codice", samp:"Esempio codice", dt:"Termine definizione", dd:"Descrizione definizione", bold_desc:"Grassetto (Ctrl+B)", italic_desc:"Corsivo (Ctrl+I)", underline_desc:"Sottolineato (Ctrl+U)", striketrough_desc:"Barrato", justifyleft_desc:"Allinea a sinistra", justifycenter_desc:"Centra", justifyright_desc:"Allinea a destra", justifyfull_desc:"Giustifica", bullist_desc:"Lista non ordinata", numlist_desc:"Lista ordinata", outdent_desc:"Sposta verso esterno", indent_desc:"Sposta verso interno", undo_desc:"Annulla (Ctrl+Z)", redo_desc:"Ripristina (Ctrl+Y)", link_desc:"Inserisci/modifica collegamento", unlink_desc:"Togli collegamento", image_desc:"Inserisci/modifica immagine", cleanup_desc:"Pulisci codice disordinato", code_desc:"Modifica sorgente HTML", sub_desc:"Pedice", sup_desc:"Apice", hr_desc:"Inserisci riga orizzontale", removeformat_desc:"Rimuovi formattazione", custom1_desc:"La tua descrizione personalizzata qui", forecolor_desc:"Seleziona colore testo", backcolor_desc:"Seleziona colore sfondo", charmap_desc:"Inserisci carattere speciale", visualaid_desc:"Mostra/nascondi linee guida/elementi invisibili", anchor_desc:"Inserisci/modifica ancora", cut_desc:"Taglia", copy_desc:"Copia", paste_desc:"Incolla", image_props_desc:"Propriet\u00E0 immagine", newdocument_desc:"Nuovo documento", help_desc:"Aiuto", blockquote_desc:"Testo quotato", clipboard_msg:"Copia/Taglia/Incolla non \u00E8 disponibile in Mozilla e Firefox..\r\nSi desidera avere maggiori informazioni su questo problema?", path:"Percorso", newdocument:"Sei sicuro di voler cancellare tutti i contenuti?", toolbar_focus:"Vai ai pulsanti strumento - Alt+Q, Vai all'editor - Alt-Z, Vai al percorso dell'elemento - Alt-X", more_colors:"Colori aggiuntivi" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/it_dlg.js000066400000000000000000000035051226600447100241370ustar00rootroot00000000000000tinyMCE.addI18n('it.advanced_dlg',{ about_title:"Informazioni su TinyMCE", about_general:"Informazioni", about_help:"Aiuto", about_license:"Licenza", about_plugins:"Plugins", about_plugin:"Plugin", about_author:"Autore", about_version:"Versione", about_loaded:"Plugin caricati", anchor_title:"Inserisci/modifica ancora", anchor_name:"Nome ancora", code_title:"Editor sorgente HTML", code_wordwrap:"A capo automatico", colorpicker_title:"Seleziona un colore", colorpicker_picker_tab:"Selettore", colorpicker_picker_title:"Selettore colori", colorpicker_palette_tab:"Tavolozza", colorpicker_palette_title:"Tavolozza dei colori", colorpicker_named_tab:"Per nome", colorpicker_named_title:"Colori per nome", colorpicker_color:"Colore:", colorpicker_name:"Nome:", charmap_title:"Seleziona carattere speciale", image_title:"Inserisci/modifica immagine", image_src:"URL immagine", image_alt:"Descrizione", image_list:"Lista immagini", image_border:"Bordo", image_dimensions:"Dimensioni", image_vspace:"Spaziatura vert.", image_hspace:"Spaziatura orizz.", image_align:"Allineamentot", image_align_baseline:"Alla base", image_align_top:"In alto", image_align_middle:"In mezzo", image_align_bottom:"In basso", image_align_texttop:"In alto al testo", image_align_textbottom:"In basso al testo", image_align_left:"A sinistra", image_align_right:"A destra", link_title:"Inserisci/modifica collegamento", link_url:"URL link", link_target:"Target", link_target_same:"Apri link nella stessa finestra", link_target_blank:"Apri link in una nuova finestra", link_titlefield:"Titolo", link_is_email:"L'URL inserito sembra essere un indirizzo email. Aggiungere il necessario prefisso mailto: ?", link_is_external:"L'URL inserito sembra essere un link esterno. Aggiungere il necessario prefisso http:// ?", link_list:"Lista link" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/ja.js000066400000000000000000000060751226600447100232740ustar00rootroot00000000000000tinyMCE.addI18n('ja.advanced',{ style_select:"\u30B9\u30BF\u30A4\u30EB", font_size:"\u30D5\u30A9\u30F3\u30C8\u30B5\u30A4\u30BA", fontdefault:"\u30D5\u30A9\u30F3\u30C8", block:"\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8", paragraph:"\u6BB5\u843D", div:"Div", address:"\u4F4F\u6240", pre:"\u6574\u5F62\u6E08\u307F", h1:"\u898B\u51FA\u30571", h2:"\u898B\u51FA\u30572", h3:"\u898B\u51FA\u30573", h4:"\u898B\u51FA\u30574", h5:"\u898B\u51FA\u30575", h6:"\u898B\u51FA\u30576", blockquote:"\u5F15\u7528", code:"\u30BD\u30FC\u30B9\u30B3\u30FC\u30C9", samp:"\u30B3\u30FC\u30C9\u30B5\u30F3\u30D7\u30EB", dt:"\u8A9E\u53E5\u5B9A\u7FA9", dd:"\u8A9E\u53E5\u8AAC\u660E", bold_desc:"\u592A\u5B57 (Ctrl+B)", italic_desc:"\u659C\u4F53 (Ctrl+I)", underline_desc:"\u4E0B\u7DDA (Ctrl+U)", striketrough_desc:"\u6253\u6D88\u3057\u7DDA", justifyleft_desc:"\u5DE6\u63C3\u3048", justifycenter_desc:"\u4E2D\u592E\u63C3\u3048", justifyright_desc:"\u53F3\u63C3\u3048", justifyfull_desc:"\u5747\u7B49\u5272\u4ED8", bullist_desc:"\u756A\u53F7\u306A\u3057\u30EA\u30B9\u30C8", numlist_desc:"\u756A\u53F7\u3064\u304D\u30EA\u30B9\u30C8", outdent_desc:"\u30A4\u30F3\u30C7\u30F3\u30C8\u89E3\u9664", indent_desc:"\u30A4\u30F3\u30C7\u30F3\u30C8", undo_desc:"\u5143\u306B\u623B\u3059 (Ctrl+Z)", redo_desc:"\u3084\u308A\u76F4\u3059 (Ctrl+Y)", link_desc:"\u30EA\u30F3\u30AF\u306E\u633F\u5165/\u7DE8\u96C6", unlink_desc:"\u30EA\u30F3\u30AF\u89E3\u9664", image_desc:"\u753B\u50CF\u306E\u633F\u5165/\u7DE8\u96C6", cleanup_desc:"\u30B3\u30FC\u30C9\u6574\u5F62", code_desc:"HTML\u30BD\u30FC\u30B9\u7DE8\u96C6", sub_desc:"\u4E0B\u4ED8\u304D", sup_desc:"\u4E0A\u4ED8\u304D", hr_desc:"\u6C34\u5E73\u7DDA", removeformat_desc:"\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u89E3\u9664", custom1_desc:"\u8AAC\u660E\u6587\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002", forecolor_desc:"\u6587\u5B57\u8272", backcolor_desc:"\u80CC\u666F\u8272", charmap_desc:"\u7279\u6B8A\u6587\u5B57", visualaid_desc:"\u30AC\u30A4\u30C9\u30E9\u30A4\u30F3\u3068\u975E\u8868\u793A\u9805\u76EE\u306E\u8868\u793A\u5207\u66FF", anchor_desc:"\u30A2\u30F3\u30AB\u30FC\u306E\u633F\u5165/\u7DE8\u96C6", cut_desc:"\u5207\u308A\u53D6\u308A", copy_desc:"\u30B3\u30D4\u30FC", paste_desc:"\u8CBC\u308A\u4ED8\u3051", image_props_desc:"\u753B\u50CF\u306E\u30D7\u30ED\u30D1\u30C6\u30A3", newdocument_desc:"\u65B0\u898F\u4F5C\u6210", help_desc:"\u30D8\u30EB\u30D7", blockquote_desc:"\u5F15\u7528", clipboard_msg:"\u30B3\u30D4\u30FC/\u5207\u308A\u53D6\u308A/\u8CBC\u308A\u4ED8\u3051\u306FMozilla\u53CA\u3073Firefox\u3067\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002\n\u8A73\u7D30\u306F\u3053\u3061\u3089", path:"\u30D1\u30B9", newdocument:"\u7DE8\u96C6\u4E2D\u306E\u30C7\u30FC\u30BF\u3092\u7834\u68C4\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F", toolbar_focus:"\u30C4\u30FC\u30EB\u30DC\u30BF\u30F3\u3078\u30B8\u30E3\u30F3\u30D7 - Alt+Q, \u30A8\u30C7\u30A3\u30BF\u306B\u30B8\u30E3\u30F3\u30D7 - Alt-Z, \u30A8\u30EC\u30E1\u30F3\u30C8\u30D1\u30B9\u3078\u30B8\u30E3\u30F3\u30D7 - Alt-X", more_colors:"\u305D\u306E\u4ED6\u306E\u8272" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/ja_dlg.js000066400000000000000000000047121226600447100241160ustar00rootroot00000000000000tinyMCE.addI18n('ja.advanced_dlg',{ about_title:"TinyMCE\u306B\u3064\u3044\u3066", about_general:"\u8A73\u7D30", about_help:"\u30D8\u30EB\u30D7", about_license:"\u30E9\u30A4\u30BB\u30F3\u30B9", about_plugins:"\u30D7\u30E9\u30B0\u30A4\u30F3", about_plugin:"\u30D7\u30E9\u30B0\u30A4\u30F3", about_author:"\u4F5C\u8005", about_version:"\u30D0\u30FC\u30B8\u30E7\u30F3", about_loaded:"\u8AAD\u8FBC\u6E08\u307F\u30D7\u30E9\u30B0\u30A4\u30F3", anchor_title:"\u30A2\u30F3\u30AB\u30FC\u306E\u633F\u5165/\u7DE8\u96C6", anchor_name:"\u30A2\u30F3\u30AB\u30FC\u540D", code_title:"HTML\u30BD\u30FC\u30B9\u30A8\u30C7\u30A3\u30BF", code_wordwrap:"\u6298\u308A\u8FD4\u3057", colorpicker_title:"\u8272\u306E\u9078\u629E", colorpicker_picker_tab:"\u30AB\u30E9\u30FC\u30D4\u30C3\u30AB\u30FC", colorpicker_picker_title:"\u30AB\u30E9\u30FC\u30D4\u30C3\u30AB\u30FC", colorpicker_palette_tab:"\u30D1\u30EC\u30C3\u30C8", colorpicker_palette_title:"\u30D1\u30EC\u30C3\u30C8", colorpicker_named_tab:"\u65E2\u5B9A\u8272", colorpicker_named_title:"\u65E2\u5B9A\u8272", colorpicker_color:"\u30AB\u30E9\u30FC:", colorpicker_name:"\u540D\u524D:", charmap_title:"\u7279\u6B8A\u6587\u5B57", image_title:"\u753B\u50CF\u306E\u633F\u5165/\u7DE8\u96C6", image_src:"\u753B\u50CFURL", image_alt:"\u753B\u50CF\u306E\u8AAC\u660E", image_list:"\u4E00\u89A7\u304B\u3089\u9078\u3076", image_border:"\u67A0\u7DDA", image_dimensions:"\u30B5\u30A4\u30BA", image_vspace:"\u4E0A\u4E0B\u4F59\u767D", image_hspace:"\u5DE6\u53F3\u4F59\u767D", image_align:"\u914D\u7F6E", image_align_baseline:"Baseline", image_align_top:"Top", image_align_middle:"Middle", image_align_bottom:"Bottom", image_align_texttop:"Text top", image_align_textbottom:"Text bottom", image_align_left:"Left", image_align_right:"Right", link_title:"\u30EA\u30F3\u30AF\u306E\u633F\u5165/\u7DE8\u96C6", link_url:"\u30EA\u30F3\u30AFURL", link_target:"\u30BF\u30FC\u30B2\u30C3\u30C8", link_target_same:"\u540C\u3058\u30A6\u30A4\u30F3\u30C9\u30A6\u3067\u958B\u304F", link_target_blank:"\u65B0\u3057\u3044\u30A6\u30A4\u30F3\u30C9\u30A6\u3067\u958B\u304F", link_titlefield:"\u30BF\u30A4\u30C8\u30EB", link_is_email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F\u3002\u30EA\u30F3\u30AF\u306Bmailto:\u3092\u4ED8\u52A0\u3057\u307E\u3059\u304B\uFF1F", link_is_external:"\u30EA\u30F3\u30AF\u306Bhttp://\u3092\u4ED8\u52A0\u3057\u307E\u3059\u304B\uFF1F", link_list:"\u4E00\u89A7\u304B\u3089\u9078\u3076" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/ko.js000066400000000000000000000052311226600447100233040ustar00rootroot00000000000000tinyMCE.addI18n('ko.advanced',{ style_select:"\uC2A4\uD0C0\uC77C", font_size:"\uAE00\uAF34 \uD06C\uAE30", fontdefault:"\uAE00\uAF34", block:"\uD3EC\uB9F7", paragraph:"\uB2E8\uB77D", div:"Div", address:"\uC8FC\uC18C", pre:"pre", h1:"\uD45C\uC81C1", h2:"\uD45C\uC81C2", h3:"\uD45C\uC81C3", h4:"\uD45C\uC81C4", h5:"\uD45C\uC81C5", h6:"\uD45C\uC81C6", blockquote:"\uC778\uC6A9\uBB38", code:"\uCF54\uB4DC", samp:"\uC0D8\uD50C\uCF54\uB4DC", dt:"\uC5B4\uAD6C \uC815\uC758", dd:"\uC815\uC758 \uC124\uBA85", bold_desc:"\uAD75\uC740 \uAE00\uC528(Ctrl+B)", italic_desc:"\uC774\uD0E4\uB9AD(Ctrl+I)", underline_desc:"\uBC11\uC904(Ctrl+U)", striketrough_desc:"\uCDE8\uC18C\uC120", justifyleft_desc:"\uC67C\uCABD \uC815\uB82C", justifycenter_desc:"\uAC00\uC6B4\uB370 \uC815\uB82C", justifyright_desc:"\uC624\uB978\uCABD \uC815\uB82C", justifyfull_desc:"\uBC30\uBD84 \uC815\uB82C", bullist_desc:"\uBE44\uC21C\uCC28\uBAA9\uB85D", numlist_desc:"\uC21C\uCC28\uBAA9\uB85D", outdent_desc:"\uB0B4\uC5B4\uC4F0\uAE30", indent_desc:"\uB4E4\uC5EC\uC4F0\uAE30", undo_desc:"\uC2E4\uD589\uCDE8\uC18C(Ctrl+Z)", redo_desc:"\uB2E4\uC2DC\uC2E4\uD589(Ctrl+Y)", link_desc:"\uB9C1\uD06C\uC758 \uC0BD\uC785/\uD3B8\uC9D1", unlink_desc:"\uB9C1\uD06C \uC0AD\uC81C", image_desc:"\uC774\uBBF8\uC9C0 \uC0BD\uC785/\uD3B8\uC9D1", cleanup_desc:"\uC9C0\uC800\uBD84\uD55C \uCF54\uB4DC \uC0AD\uC81C", code_desc:"HTML \uD3B8\uC9D1", sub_desc:"\uC544\uB798\uCCA8\uC790", sup_desc:"\uC704\uCCA8\uC790", hr_desc:"\uAD6C\uBD84\uC120", removeformat_desc:"\uC11C\uC2DD \uD574\uC81C", custom1_desc:"\uCEE4\uC2A4\uD140 \uC124\uBA85", forecolor_desc:"\uAE00\uC790\uC0C9", backcolor_desc:"\uBC30\uACBD\uC0C9", charmap_desc:"\uD2B9\uC218 \uBB38\uC790", visualaid_desc:"\uAC00\uC774\uB4DC\uB77C\uC778 \uD45C\uC2DC/\uBE44\uD45C\uC2DC", anchor_desc:"\uC5E5\uCEE4 \uC0BD\uC785/\uD3B8\uC9D1", cut_desc:"\uC798\uB77C\uB0B4\uAE30", copy_desc:"\uBCF5\uC0AC", paste_desc:"\uBD99\uC774\uAE30", image_props_desc:"\uC774\uBBF8\uC9C0\uC18D\uC131", newdocument_desc:"\uC2E0\uADDC\uAE00 \uC791\uC131", help_desc:"\uB3C4\uC6C0\uB9D0", blockquote_desc:"\uC778\uC6A9\uBB38", clipboard_msg:"\uBCF5\uC0AC/\uC798\uB77C\uB0B4\uAE30/\uBD99\uC774\uAE30\uB294 Mozilla \uBC0FFirefox \uC5D0\uC11C \uC0AC\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n\uC0C1\uC138\uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uAE4C?", path:"Path", newdocument:"\uD3B8\uC9D1\uC911\uC758 \uB370\uC774\uD130\uB97C \uBAA8\uB450 \uC783\uC5B4\uB3C4 \uAD1C\uCC2E\uC2B5\uB2C8\uAE4C?", toolbar_focus:"\uBC84\uD2BC\uC73C\uB85C \uC810\uD504 - Alt+Q, \uC5D0\uB514\uD130\uB85C \uC810\uD504 - Alt-Z, Jump to element path - Alt-X", more_colors:"\uADF8 \uC678\uC758 \uC0C9" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/ko_dlg.js000066400000000000000000000043051226600447100241330ustar00rootroot00000000000000tinyMCE.addI18n('ko.advanced_dlg',{ about_title:"TinyMCE\uC5D0 \uB300\uD558\uC5EC", about_general:"About", about_help:"\uB3C4\uC6C0\uB9D0", about_license:"\uB77C\uC774\uC13C\uC2A4", about_plugins:"\uD50C\uB7EC\uADF8\uC778", about_plugin:"\uD50C\uB7EC\uADF8\uC778", about_author:"\uC81C\uC791\uC790", about_version:"\uBC84\uC83C", about_loaded:"\uC2E4\uD589\uB41C \uD50C\uB7EC\uADF8\uC778", anchor_title:"\uC5E5\uCEE4 \uC0BD\uC785/\uD3B8\uC9D1", anchor_name:"\uC5E5\uCEE4\uBA85", code_title:"\uC18C\uC2A4 \uD3B8\uC9D1", code_wordwrap:"\uC6CC\uB4DC\uB7A9", colorpicker_title:"\uC0C9\uC744 \uC120\uD0DD", colorpicker_picker_tab:"\uD53D\uCEE4", colorpicker_picker_title:"\uCEEC\uB7EC \uD53D\uCEE4", colorpicker_palette_tab:"\uD314\uB808\uD2B8", colorpicker_palette_title:"\uD314\uB808\uD2B8 \uC0C9", colorpicker_named_tab:"\uC0C9 \uC774\uB984", colorpicker_named_title:"\uC0C9", colorpicker_color:"Color:", colorpicker_name:"\uC0C9 \uC774\uB984:", charmap_title:"\uD2B9\uC218 \uBB38\uC790", image_title:"\uC774\uBBF8\uC9C0\uC758 \uC0BD\uC785/\uD3B8\uC9D1", image_src:"\uC774\uBBF8\uC9C0 URL", image_alt:"\uC774\uBBF8\uC9C0 \uC124\uBA85", image_list:"\uC774\uBBF8\uC9C0 \uBAA9\uB85D", image_border:"\uD14C\uB450\uB9AC\uC120", image_dimensions:"\uD06C\uAE30", image_vspace:"\uC0C1\uD558 \uC5EC\uBC31", image_hspace:"\uC88C\uC6B0 \uC5EC\uBC31", image_align:"\uC815\uB82C", image_align_baseline:"\uAE30\uC900\uC120", image_align_top:"Top", image_align_middle:"Middle", image_align_bottom:"Bottom", image_align_texttop:"Text top", image_align_textbottom:"Text bottom", image_align_left:"Left", image_align_right:"Right", link_title:"\uB9C1\uD06C\uC758 \uC0BD\uC785/\uD3B8\uC9D1", link_url:"\uB9C1\uD06C URL", link_target:"Target", link_target_same:"\uAC19\uC740\uCC3D", link_target_blank:"\uC0C8\uCC3D", link_titlefield:"\uC81C\uBAA9", link_is_email:"\uBA54\uC77C\uC8FC\uC18C\uAC00 \uC785\uB825\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n\uBA54\uC77C\uC8FC\uC18C\uC758 \uC55E\uC5D0 mailto:\uB97C \uBD99\uC785\uB2C8\uAE4C?", link_is_external:"\uC678\uBD80URL\uC774 \uC785\uB825\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\nURL\uC758 \uC55E\uC5D0 http://\uB97C \uBD99\uC785\uB2C8\uAE4C?", link_list:"\uB9C1\uD06C \uBAA9\uB85D" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/lt.js000066400000000000000000000051701226600447100233140ustar00rootroot00000000000000tinyMCE.addI18n('lt.advanced',{ style_select:"Stiliai", font_size:"\u0160rifto dydis", fontdefault:"\u0160rifto \u0161eima", block:"Formatas", paragraph:"Paragrafas", div:"Div \u017Eym\u0117", address:"Adresas", pre:"I\u0161 anksto formatuotas", h1:"Antra\u0161t\u0117 1", h2:"Antra\u0161t\u0117 2", h3:"Antra\u0161t\u0117 3", h4:"Antra\u0161t\u0117 4", h5:"Antra\u0161t\u0117 5", h6:"Antra\u0161t\u0117 6", blockquote:"Citatos blokas", code:"Kodas", samp:"Kodo pavyzdys", dt:"Apibr\u0117\u017Eimo terminas", dd:"Apibr\u0117\u017Eimo apra\u0161as", bold_desc:"Pusjuodis (Ctrl+B)", italic_desc:"Kursyvas (Ctrl+I)", underline_desc:"Pabrauktas (Ctrl+U)", striketrough_desc:"Perbrauktas", justifyleft_desc:"Lygiuoti pagal kair\u0119", justifycenter_desc:"Centruoti", justifyright_desc:"Lygiuoti pagal de\u0161in\u0119", justifyfull_desc:"Lygiuoti pagal abu kra\u0161tus", bullist_desc:"Nesunumeruotas s\u0105ra\u0161as", numlist_desc:"Sunumeruotas s\u0105ra\u0161as", outdent_desc:"Atvirk\u0161tin\u0117 \u012Ftrauka", indent_desc:"\u012Etrauka", undo_desc:"At\u0161aukti (Ctrl+Z)", redo_desc:"Gr\u0105\u017Einti (Ctrl+Y)", link_desc:"\u012Eterpti/redaguoti nuorod\u0105", unlink_desc:"Pa\u0161alinti nuorod\u0105", image_desc:"\u012Eterpti/redaguoti paveiksl\u0117l\u012F", cleanup_desc:"I\u0161valyti netvarking\u0105 kod\u0105", code_desc:"Redaguoti HTML i\u0161eities kod\u0105", sub_desc:"Apatinis indeksas", sup_desc:"Vir\u0161utinis indeksas", hr_desc:"\u012Eterpti horizontali\u0105 linij\u0105", removeformat_desc:"Pa\u0161alinti formatavim\u0105", custom1_desc:"J\u016Bs\u0173 apra\u0161as \u010Dia", forecolor_desc:"Parinkti teksto spalv\u0105", backcolor_desc:"Parinkti fono spalv\u0105", charmap_desc:"\u012Eterpti nestandartin\u012F simbol\u012F", visualaid_desc:"Kaitalioti gaires/nematom\u0173 element\u0173 rodym\u0105", anchor_desc:"\u012Eterpti/redaguoti prierai\u0161\u0105", cut_desc:"I\u0161kirpti", copy_desc:"Kopijuoti", paste_desc:"\u012Ed\u0117ti", image_props_desc:"Paveiksl\u0117lio nustatymai", newdocument_desc:"Naujas dokumentas", help_desc:"Pagalba", blockquote_desc:"Citatos blokas", clipboard_msg:"Kopijavimas/I\u0161kirpimas/\u012Ed\u0117jimas negalimas Mozilla ir Firefox nar\u0161ykl\u0117se.\r\nAr norite daugiau informacijos apie \u0161i\u0105 problem\u0105?", path:"Kelias", newdocument:"Ar tikrai norite i\u0161valyti vis\u0105 turin\u012F?", toolbar_focus:"Per\u0161okimas prie \u012Franki\u0173 juostos mygtuk\u0173 - Alt+Q, Per\u0161okimas prie redaktoriaus - Alt-Z, Per\u0161okimas prie element\u0173 kelio - Alt-X", more_colors:"Daugiau spalv\u0173", link_delta_width:"70" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/lt_dlg.js000066400000000000000000000042401226600447100241370ustar00rootroot00000000000000tinyMCE.addI18n('lt.advanced_dlg',{ about_title:"Apie TinyMCE", about_general:"Apie", about_help:"Pagalba", about_license:"Licencija", about_plugins:"Papildiniai", about_plugin:"Papildinys", about_author:"Autorius", about_version:"Versija", about_loaded:"\u012Ekelti papildiniai", anchor_title:"\u012Eterpti/redaguoti prierai\u0161\u0105", anchor_name:"Prierai\u0161o vardas", code_title:"HTML i\u0161eities kodo redaktorius", code_wordwrap:"Skaidyti tekst\u0105", colorpicker_title:"Pasirinkti spalv\u0105", colorpicker_picker_tab:"Parinkiklis", colorpicker_picker_title:"Spalvos parinkiklis", colorpicker_palette_tab:"Palet\u0117", colorpicker_palette_title:"Palet\u0117s spalvos", colorpicker_named_tab:"\u012Evardintosios", colorpicker_named_title:"\u012Evardintosios spalvos", colorpicker_color:"Spalva:", colorpicker_name:"Pavadinimas:", charmap_title:"Pasirinkti nestandartin\u012F simbol\u012F", image_title:"\u012Eterpti/redaguoti paveiksl\u0117l\u012F", image_src:"Paveiksl\u0117lio URL adresas", image_alt:"Paveiksl\u0117lio apra\u0161as", image_list:"Paveiksl\u0117li\u0173 s\u0105ra\u0161as", image_border:"R\u0117melis", image_dimensions:"I\u0161matavimai", image_vspace:"Vertikalus tarpas", image_hspace:"Horizontalus tarpas", image_align:"Lygiavimas", image_align_baseline:"Pradiniame ta\u0161ke", image_align_top:"Vir\u0161uje", image_align_middle:"Viduryje", image_align_bottom:"Apa\u010Dioje", image_align_texttop:"Teksto vir\u0161uje", image_align_textbottom:"Teksto apa\u010Dioje", image_align_left:"Kair\u0117je", image_align_right:"De\u0161in\u0117je", link_title:"\u012Eterpti/redaguoti nuorod\u0105", link_url:"Nuorodos URL adresas", link_target:"Paskirtis", link_target_same:"Atverti tame pa\u010Diame lange", link_target_blank:"Atverti naujame lange", link_titlefield:"Pavadinimas", link_is_email:"URL adresas, kur\u012F \u012Fved\u0117te yra el. pa\u0161to adresas, ar norite prid\u0117ti reikaling\u0105 mailto: prefiks\u0105?", link_is_external:"URL adresas, kur\u012F \u012Fved\u0117te yra i\u0161orin\u0117 nuoroda, ar norite prid\u0117ti reikaling\u0105 http:// prefiks\u0105?", link_list:"Nuorod\u0173 s\u0105ra\u0161as" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/lv.js000066400000000000000000000046561226600447100233260ustar00rootroot00000000000000tinyMCE.addI18n('lv.advanced',{ style_select:"Stili", font_size:"Fonta lielums", fontdefault:"Fonta veids", block:"Form\u0101ts", paragraph:"Rindkopa", div:"Div\u012Bzija", address:"Adrese", pre:"Priek\u0161format\u0113ts", h1:"Virsraksts 1", h2:"Virsraksts 2", h3:"Virsraksts 3", h4:"Virsraksts 4", h5:"Virsraksts 5", h6:"Virsraksts 6", blockquote:"Cit\u0101ts", code:"Kods", samp:"Koda piem\u0113rs", dt:"Defin\u012Bcijas termins ", dd:"Defin\u012Bcijas apraksts", bold_desc:"Treknraksts (Ctrl+B)", italic_desc:"Sl\u012Bpraksts (Ctrl+I)", underline_desc:"Pasv\u012Btrojums (Ctrl+U)", striketrough_desc:"P\u0101rsv\u012Btrojums", justifyleft_desc:"Novietot pa kreisi", justifycenter_desc:"Centr\u0113t", justifyright_desc:"Novietot pa labi", justifyfull_desc:"Nol\u012Bdzin\u0101t malas", bullist_desc:"Nenumur\u0113ts saraksts", numlist_desc:"Numur\u0113ts saraksts", outdent_desc:"Uzk\u0101pe", indent_desc:"Atk\u0101pe", undo_desc:"Atsaukt (Ctrl+Z)", redo_desc:"Atatsaukt (Ctrl+Y)", link_desc:"Ievietot/Redi\u0123\u0113t saiti", unlink_desc:"Atsait\u0113t", image_desc:"Ievietot/Redi\u0123\u0113t att\u0113lu", cleanup_desc:"Izt\u012Br\u012Bt nek\u0101rt\u012Bgu kodu", code_desc:"Redi\u0123\u0113t HTML kodu", sub_desc:"Apak\u0161raksts", sup_desc:"Aug\u0161raksts", hr_desc:"Ievietot horizont\u0101lu sv\u012Btru", removeformat_desc:"Izdz\u0113st format\u0113to", custom1_desc:"Tevis izdom\u0101ts apraksts \u0161eit", forecolor_desc:"Uzst\u0101d\u012Bt teksta kr\u0101su", backcolor_desc:"Uzst\u0101d\u012Bt fona kr\u0101su", charmap_desc:"Ievietot simbolu", visualaid_desc:"Uzlikt/Nov\u0101kt pal\u012Bgsv\u012Btras/neredzamos elementus", anchor_desc:"Ievietot/Redi\u0123\u0113t enkursaiti", cut_desc:"Izgriezt", copy_desc:"Kop\u0113t", paste_desc:"Iekop\u0113t", image_props_desc:"Bildes iestat\u012Bjumi", newdocument_desc:"Jauns dokuments", help_desc:"Pal\u012Bdz\u012Bba", blockquote_desc:"Cit\u0101ts", clipboard_msg:"Iesp\u0113ja Kop\u0113t/Izgriezt/Iekop\u0113t nav pieejama p\u0101rl\u016Bkiem Mozilla and Firefox.\r\nVai J\u016Bs v\u0113laties uzzin\u0101t vair\u0101k par \u0161o probl\u0113mu?", path:"Atra\u0161an\u0101s vieta", newdocument:"Vai J\u016Bs esat p\u0101rliecin\u0101ti, ka v\u0113laties izdz\u0113st visu saturu?", toolbar_focus:"Iet uz r\u012Bkpog\u0101m - Alt+Q, Iet uz redaktoru - Alt-Z, Iet uz elementa atra\u0161an\u0101s vietu - Alt-X", more_colors:"Vair\u0101k kr\u0101su" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/lv_dlg.js000066400000000000000000000041671226600447100241510ustar00rootroot00000000000000tinyMCE.addI18n('lv.advanced_dlg',{ about_title:"Par TinyMCE", about_general:"Par", about_help:"Pal\u012Bdz\u012Bba", about_license:"Licence", about_plugins:"Papildmodu\u013Ci", about_plugin:"Papildmodulis", about_author:"Autors", about_version:"Versija", about_loaded:"Iestat\u012Btie papildmodu\u013Ci", anchor_title:"Ievietot/Redi\u0123\u0113t enkursaiti", anchor_name:"Enkursaites nosaukums", code_title:"HTML koda redaktors", code_wordwrap:"V\u0101rdu p\u0101rne\u0161ana jaun\u0101 rind\u0101", colorpicker_title:"Izv\u0113l\u0113ties kr\u0101su", colorpicker_picker_tab:"Izv\u0113lnis", colorpicker_picker_title:"Kr\u0101su izv\u0113lnis", colorpicker_palette_tab:"Palete", colorpicker_palette_title:"Kr\u0101su palete", colorpicker_named_tab:"Nosaukts", colorpicker_named_title:"Nosaukt\u0101s kr\u0101sas", colorpicker_color:"Kr\u0101sa:", colorpicker_name:"Nosaukums:", charmap_title:"Izv\u0113lies simbolu", image_title:"Ievietot/Redi\u0123\u0113t att\u0113lu", image_src:"Att\u0113la URL", image_alt:"Att\u0113la apraksts", image_list:"Att\u0113lu saraksts", image_border:"Apmale", image_dimensions:"Izm\u0113ri", image_vspace:"Vertik\u0101l\u0101 atstarpe", image_hspace:"Horizont\u0101l\u0101 atstarpe", image_align:"Novietojums", image_align_baseline:"Pati apak\u0161a", image_align_top:"Aug\u0161a", image_align_middle:"Vidus", image_align_bottom:"Apak\u0161a", image_align_texttop:"Teksta aug\u0161a", image_align_textbottom:"Teksta apak\u0161a", image_align_left:"Pa kreisi", image_align_right:"Pa labi", link_title:"Ievietot/Redi\u0123\u0113t saiti", link_url:"Saites URL", link_target:"M\u0113r\u0137is", link_target_same:"Atv\u0113rt saiti \u0161ai pa\u0161\u0101 log\u0101", link_target_blank:"Atv\u0113rt saiti jaun\u0101 log\u0101", link_titlefield:"Nosaukums", link_is_email:"Ievad\u012Btais URL \u0161\u0137iet ir e-pasta adrese, vai tu v\u0113lies pirms t\u0101s pievienot mailto: pried\u0113kli? ", link_is_external:"Ievad\u012Btais URL \u0161\u0137iet ir \u0101r\u0113j\u0101 saite, vai tu v\u0113lies pirms t\u0101s pievienot http:// pried\u0113kli?", link_list:"Sai\u0161u saraksts" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/mk.js000066400000000000000000000044041226600447100233030ustar00rootroot00000000000000tinyMCE.addI18n('mk.advanced',{ style_select:"Stilovi", font_size:"Veli\u010Dina pisma", fontdefault:"Vrsta pisma", block:"Format", paragraph:"Paragraf", div:"Div", address:"Adresa", pre:"Oblikovano", h1:"\u041D\u0430\u0441\u043B\u043E\u0432 1", h2:"\u041D\u0430\u0441\u043B\u043E\u0432 2", h3:"\u041D\u0430\u0441\u043B\u043E\u0432 3", h4:"\u041D\u0430\u0441\u043B\u043E\u0432 4", h5:"\u041D\u0430\u0441\u043B\u043E\u0432 5", h6:"\u041D\u0430\u0441\u043B\u043E\u0432 6", blockquote:"Citat", code:"Kod", samp:"Primjer koda", dt:"Definicija pojma", dd:"Opis definicije", bold_desc:"Podebljaj (Ctrl+B)", italic_desc:"Kurziv (Ctrl+I)", underline_desc:"Podcrtaj (Ctrl+U)", striketrough_desc:"Precrtaj", justifyleft_desc:"Poravnaj levo", justifycenter_desc:"Centriraj", justifyright_desc:"Poravnaj desno", justifyfull_desc:"Poravnaj potpuno", bullist_desc:"Neure\u0111ena lista", numlist_desc:"Ure\u0111ena lista", outdent_desc:"Uvuci", indent_desc:"Izvuci", undo_desc:"Poni\u0161ti (Ctrl+Z)", redo_desc:"Ponovi (Ctrl+Y)", link_desc:"\u0412\u043C\u0435\u0442\u043D\u0438/uredi poveznicu", unlink_desc:"Poni\u0161ti poveznicu", image_desc:"\u0412\u043C\u0435\u0442\u043D\u0438/uredi sliku", cleanup_desc:"Po\u010Disti kod", code_desc:"Uredi HTML izvor", sub_desc:"Indeks", sup_desc:"Eksponent", hr_desc:"\u0412\u043C\u0435\u0442\u043D\u0438 vodoravnu crtu", removeformat_desc:"Poni\u0161ti oblikovanje", custom1_desc:"Vlastiti opis ovdje", forecolor_desc:"Odaberite boju teksta", backcolor_desc:"Odaberite boju pozadine", charmap_desc:"\u0412\u043C\u0435\u0442\u043D\u0438 vlastiti znak", visualaid_desc:"Vodilice/nevidljivi elementi", anchor_desc:"\u0412\u043C\u0435\u0442\u043D\u0438/uredi sidro", cut_desc:"Izre\u017Ei", copy_desc:"Kopiraj", paste_desc:"Zalepi", image_props_desc:"Svojstva slike", newdocument_desc:"Novi dokument", help_desc:"Pomo\u0107", blockquote_desc:"Citiraj", clipboard_msg:"Kopiraj/Izre\u017Ei/Zalepi nije dostupno u Mozilla i Firefox preglednicima. Vi\u0161e informacija?", path:"Staza", newdocument:"Jeste li sigurni da \u017Eelite izbrisati celi sadr\u017Eaj?", toolbar_focus:"Pre\u0111i na alatnu traku - Alt+Q, pre\u0111i na ure\u0111iva\u010D - Alt-Z, pre\u0111i na element path - Alt-X", more_colors:"Vi\u0161e boja" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/mk_dlg.js000066400000000000000000000073151226600447100241350ustar00rootroot00000000000000tinyMCE.addI18n('mk.advanced_dlg',{ about_title:"TinyMCE", about_general:"\u0417\u0430 \u043F\u0440\u043E\u0433\u0440\u0430\u043C\u0430\u0442\u0430", about_help:"\u041F\u043E\u043C\u043E\u0448", about_license:"\u041B\u0438\u0446\u0435\u043D\u0446\u0430", about_plugins:"\u0414\u043E\u0434\u0430\u0442\u043E\u0446\u0438", about_plugin:"\u0414\u043E\u0434\u0430\u0442\u043E\u043A", about_author:"\u0410\u0432\u0442\u043E\u0440", about_version:"\u0412\u0435\u0440\u0437\u0438\u0458\u0430", about_loaded:"\u041F\u043E\u0441\u0442\u043E\u0435\u0447\u043A\u0438 \u0434\u043E\u0434\u0430\u0442\u043E\u0446\u0438", anchor_title:"\u0412\u043C\u0435\u0442\u043D\u0438/\u0441\u0440\u0435\u0434\u0438 \u0441\u0438\u0434\u0440\u043E", anchor_name:"\u0418\u043C\u0435 \u043D\u0430 \u0441\u0438\u0434\u0440\u043E\u0442\u043E", code_title:"HTML \u0441\u0440\u0435\u0434\u0443\u0432\u0430\u0447", code_wordwrap:"\u041F\u0440\u0435\u043A\u043B\u043E\u043F\u0443\u0432\u0430\u045A\u0435 \u043D\u0430 \u0442\u0435\u043A\u0441\u0442\u043E\u0442", colorpicker_title:"\u0418\u0437\u0431\u043E\u0440 \u043D\u0430 \u0431\u043E\u0438", colorpicker_picker_tab:"\u041E\u0434\u0431\u0435\u0440\u0438", colorpicker_picker_title:"\u041E\u0434\u0431\u0435\u0440\u0438 \u0431\u043E\u0438", colorpicker_palette_tab:"\u041F\u0430\u043B\u0435\u0442\u0430", colorpicker_palette_title:"\u041F\u0430\u043B\u0435\u0442\u0430 \u043D\u0430 \u0431\u043E\u0438", colorpicker_named_tab:"\u0418\u043C\u0435\u043D\u0443\u0432\u0430\u043D\u043E", colorpicker_named_title:"\u0418\u043C\u0435\u043D\u0443\u0432\u0430\u043D\u0438 \u0431\u043E\u0438", colorpicker_color:"\u0411\u043E\u0458\u0430:", colorpicker_name:"\u0418\u043C\u0435:", charmap_title:"\u041E\u0434\u0431\u0435\u0440\u0435\u0442\u0435 \u0437\u043D\u0430\u043A", image_title:"\u0412\u043C\u0435\u0442\u043D\u0438/\u0441\u0440\u0435\u0434\u0438 \u0441\u043B\u0438\u043A\u0438", image_src:"\u041B\u0438\u043D\u043A \u043D\u0430 \u0441\u043B\u0438\u043A\u0430\u0442\u0430", image_alt:"\u041E\u043F\u0438\u0441 \u043D\u0430 \u0441\u043B\u0438\u043A\u0430\u0442\u0430", image_list:"\u041B\u0438\u0441\u0442\u0430 \u043D\u0430 \u0441\u043B\u0438\u043A\u0438\u0442\u0435", image_border:"\u0420\u0430\u0431", image_dimensions:"\u0414\u0438\u043C\u0435\u043D\u0437\u0438\u0438", image_vspace:"\u0412\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u0435\u043D \u043F\u0440\u043E\u0441\u0442\u043E\u0440", image_hspace:"\u0425\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u0435\u043D \u043F\u0440\u043E\u0441\u0442\u043E\u0440", image_align:"\u041F\u043E\u0440\u0430\u043C\u043D\u0443\u0432\u0430\u045A\u0435", image_align_baseline:"\u041E\u0441\u043D\u043E\u0432\u043D\u0430 \u043B\u0438\u043D\u0438\u0458\u0430", image_align_top:"\u0412\u0440\u0432", image_align_middle:"\u0421\u0440\u0435\u0434\u0438\u043D\u0430", image_align_bottom:"\u0414\u043D\u043E", image_align_texttop:"\u0412\u0440\u0432 \u043D\u0430 \u0442\u0435\u043A\u0441\u0442\u043E\u0442", image_align_textbottom:"\u0414\u043D\u043E \u043D\u0430 \u0442\u0435\u043A\u0441\u0442\u043E\u0442", image_align_left:"\u041B\u0435\u0432\u043E", image_align_right:"\u0414\u0435\u0441\u043D\u043E", link_title:"\u0412\u043C\u0435\u0442\u043D\u0438/\u0441\u0440\u0435\u0434\u0438 \u043B\u0438\u043D\u043A", link_url:"URL poveznice", link_target:"Meta", link_target_same:"Otvori poveznicu u istom prozoru", link_target_blank:"Otvori poveznicu u novom prozoru", link_titlefield:"\u041D\u0430\u0441\u043B\u043E\u0432", link_is_email:"URL koji ste uneli izgleda kao e-mail adresa, \u017Eelite li dodati potrebni mailto: prefiks?", link_is_external:"URL koji ste uneli izgleda kao vanjska poveznica, \u017Eelite li dodati potrebni http:// prefiks?", link_list:"Lista poveznica" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/ml.js000066400000000000000000000063431226600447100233100ustar00rootroot00000000000000tinyMCE.addI18n('ml.advanced',{ style_select:"\u0D30\u0D42\u0D2A\u0D2D\u0D02\u0D17\u0D3F", font_size:"\u0D05\u0D15\u0D4D\u0D37\u0D30\u0D35\u0D32\u0D41\u0D2A\u0D4D\u0D2A\u0D02", fontdefault:"\u0D05\u0D15\u0D4D\u0D37\u0D30\u0D15\u0D42\u0D1F\u0D4D\u0D1F\u0D02", block:"\u0D18\u0D1F\u0D28", paragraph:"\u0D16\u0D23\u0D4D\u0D21\u0D3F\u0D15", div:"Div", address:"\u0D35\u0D3F\u0D32\u0D3E\u0D38\u0D02", pre:"Preformatted", h1:"\u0D24\u0D32\u0D15\u0D4D\u0D15\u0D46\u0D1F\u0D4D\u0D1F\u0D41\u0D4D 1", h2:"\u0D24\u0D32\u0D15\u0D4D\u0D15\u0D46\u0D1F\u0D4D\u0D1F\u0D41\u0D4D 2", h3:"\u0D24\u0D32\u0D15\u0D4D\u0D15\u0D46\u0D1F\u0D4D\u0D1F\u0D41\u0D4D 3", h4:"\u0D24\u0D32\u0D15\u0D4D\u0D15\u0D46\u0D1F\u0D4D\u0D1F\u0D41\u0D4D 4", h5:"\u0D24\u0D32\u0D15\u0D4D\u0D15\u0D46\u0D1F\u0D4D\u0D1F\u0D41\u0D4D 5", h6:"\u0D24\u0D32\u0D15\u0D4D\u0D15\u0D46\u0D1F\u0D4D\u0D1F\u0D41\u0D4D 6", blockquote:"Blockquote", code:"Code", samp:"Code sample", dt:"Definition term ", dd:"Definition description", bold_desc:"Bold (Ctrl+B)", italic_desc:"Italic (Ctrl+I)", underline_desc:"Underline (Ctrl+U)", striketrough_desc:"Strikethrough", justifyleft_desc:"Align left", justifycenter_desc:"Align center", justifyright_desc:"Align right", justifyfull_desc:"Align full", bullist_desc:"Unordered list", numlist_desc:"Ordered list", outdent_desc:"Outdent", indent_desc:"Indent", undo_desc:"Undo (Ctrl+Z)", redo_desc:"Redo (Ctrl+Y)", link_desc:"Insert/edit link", unlink_desc:"\u0D35\u0D3F\u0D1A\u0D4D\u0D1B\u0D47\u0D26\u0D3F\u0D15\u0D4D\u0D15\u0D41\u0D15", image_desc:"Insert/edit image", cleanup_desc:"Cleanup messy code", code_desc:"Edit HTML Source", sub_desc:"Subscript", sup_desc:"Superscript", hr_desc:"Insert horizontal ruler", removeformat_desc:"Remove formatting", custom1_desc:"Your custom description here", forecolor_desc:"Select text color", backcolor_desc:"Select background color", charmap_desc:"Insert custom character", visualaid_desc:"Toggle guidelines/invisible elements", anchor_desc:"Insert/edit anchor", cut_desc:"\u0D2E\u0D41\u0D31\u0D3F\u0D15\u0D4D\u0D15\u0D41\u0D15", copy_desc:"\u0D2A\u0D15\u0D30\u0D4D\u200D\u0D24\u0D4D\u0D24\u0D41\u0D15", paste_desc:"\u0D12\u0D1F\u0D4D\u0D1F\u0D3F\u0D15\u0D4D\u0D15\u0D41\u0D15", image_props_desc:"Image properties", newdocument_desc:"New document", help_desc:"Help", blockquote_desc:"Blockquote", clipboard_msg:"\u0D2E\u0D41\u0D31\u0D3F\u0D15\u0D4D\u0D15\u0D32\u0D4D\u200D/\u0D2A\u0D15\u0D30\u0D4D\u200D\u0D24\u0D4D\u0D24\u0D32\u0D4D\u200D/\u0D12\u0D1F\u0D4D\u0D1F\u0D3F\u0D15\u0D4D\u0D15\u0D32\u0D4D\u200D \u0D0E\u0D28\u0D4D\u0D28\u0D3F\u0D35 '\u0D2E\u0D4B\u0D38\u0D3F\u0D32\u0D4D\u0D32'\u0D2F\u0D3F\u0D32\u0D41\u0D02 '\u0D2B\u0D2F\u0D30\u0D4D\u200D\u0D2B\u0D4B\u0D15\u0D4D\u0D38\u0D4D'\u0D32\u0D41\u0D02 \u0D32\u0D2D\u0D4D\u0D2F\u0D2E\u0D32\u0D4D\u0D32. \n\u0D24\u0D3E\u0D19\u0D4D\u0D15\u0D33\u0D4D\u200D\u0D15\u0D4D\u0D15\u0D41 \u0D07\u0D24\u0D3F\u0D28\u0D46 \u0D15\u0D41\u0D31\u0D3F\u0D1A\u0D4D\u0D1A\u0D41\u0D4D \u0D15\u0D42\u0D1F\u0D41\u0D24\u0D32\u0D4D\u200D \u0D05\u0D31\u0D3F\u0D2F\u0D23\u0D4B ?", path:"Path", newdocument:"Are you sure you want clear all contents?", toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X", more_colors:"More colors" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/ml_dlg.js000066400000000000000000000045161226600447100241360ustar00rootroot00000000000000tinyMCE.addI18n('ml.advanced_dlg',{ about_title:"About TinyMCE", about_general:"About", about_help:"\u0D38\u0D39\u0D3E\u0D2F\u0D02", about_license:"License", about_plugins:"Plugins", about_plugin:"Plugin", about_author:"Author", about_version:"\u0D2A\u0D24\u0D3F\u0D2A\u0D4D\u0D2A\u0D41\u0D4D", about_loaded:"Loaded plugins", anchor_title:"Insert/edit anchor", anchor_name:"\u0D28\u0D19\u0D4D\u0D15\u0D42\u0D30 \u0D2A\u0D47\u0D30\u0D41\u0D4D", code_title:"HTML Source Editor", code_wordwrap:"Word wrap", colorpicker_title:"\u0D28\u0D3F\u0D31\u0D02 \u0D24\u0D3F\u0D30\u0D1E\u0D4D\u0D1E\u0D46\u0D1F\u0D41\u0D15\u0D4D\u0D15\u0D41\u0D15", colorpicker_picker_tab:"Picker", colorpicker_picker_title:"Color picker", colorpicker_palette_tab:"Palette", colorpicker_palette_title:"Palette colors", colorpicker_named_tab:"\u0D2A\u0D47\u0D30\u0D3F\u0D1F\u0D4D\u0D1F", colorpicker_named_title:"\u0D2A\u0D47\u0D30\u0D3F\u0D1F\u0D4D\u0D1F \u0D28\u0D3F\u0D31\u0D19\u0D4D\u0D19\u0D33\u0D4D\u200D", colorpicker_color:"\u0D28\u0D3F\u0D31\u0D02:", colorpicker_name:"\u0D2A\u0D47\u0D30\u0D41\u0D4D:", charmap_title:"Select custom character", image_title:"Insert/edit image", image_src:"Image URL", image_alt:"Image description", image_list:"Image list", image_border:"\u0D05\u0D24\u0D3F\u0D30\u0D41\u0D4D", image_dimensions:"\u0D05\u0D33\u0D35\u0D41\u0D15\u0D33\u0D4D\u200D", image_vspace:"\u0D32\u0D02\u0D2C \u0D38\u0D4D\u0D25\u0D32\u0D02", image_hspace:"\u0D24\u0D3F\u0D30\u0D36\u0D4D\u0D1A\u0D40\u0D28 \u0D38\u0D4D\u0D25\u0D32\u0D02", image_align:"Alignment", image_align_baseline:"Baseline", image_align_top:"Top", image_align_middle:"\u0D28\u0D1F\u0D41\u0D35\u0D3F\u0D32\u0D4D\u200D", image_align_bottom:"Bottom", image_align_texttop:"Text top", image_align_textbottom:"Text bottom", image_align_left:"Left", image_align_right:"Right", link_title:"Insert/edit link", link_url:"\u0D2C\u0D3E\u0D28\u0D4D\u0D27\u0D35 \u0D35\u0D3F\u0D32\u0D3E\u0D38\u0D02", link_target:"Target", link_target_same:"Open link in the same window", link_target_blank:"Open link in a new window", link_titlefield:"Title", link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", link_list:"Link list" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/mn.js000066400000000000000000000140251226600447100233060ustar00rootroot00000000000000tinyMCE.addI18n('mn.advanced',{ style_select:"\u0425\u044D\u043B\u0431\u044D\u0440\u0436\u04AF\u04AF\u043B\u044D\u043B\u0442", font_size:"\u0424\u043E\u043D\u0442\u044B\u043D \u0445\u044D\u043C\u0436\u044D\u044D", fontdefault:"\u0424\u043E\u043D\u0442", block:"\u0425\u044D\u0432", paragraph:"\u041F\u0430\u0440\u0430\u0433\u0440\u0430\u0444", div:"\u0425\u0430\u043C\u0442\u0430\u0442\u0433\u0430\u0441\u0430\u043D \u043C\u0443\u0436", address:"\u0425\u0430\u044F\u0433", pre:"\u0422\u04AF\u04AF\u0445\u0438\u0439 \u04E9\u0433\u04E9\u0433\u0434\u04E9\u043B", h1:"\u0413\u0430\u0440\u0447\u0438\u0433 1", h2:"\u0413\u0430\u0440\u0447\u0438\u0433 2", h3:"\u0413\u0430\u0440\u0447\u0438\u0433 3", h4:"\u0413\u0430\u0440\u0447\u0438\u0433 4", h5:"\u0413\u0430\u0440\u0447\u0438\u0433 5", h6:"\u0413\u0430\u0440\u0447\u0438\u0433 6", blockquote:"\u0418\u0448\u043B\u044D\u043B", code:"\u041A\u043E\u0434", samp:"\u0416\u0438\u0448\u044D\u044D", dt:"\u0422\u043E\u0434\u043E\u0440\u0445\u043E\u0439\u043B\u043E\u043B\u0442", dd:"\u0422\u0430\u0439\u043B\u0431\u0430\u0440", bold_desc:"\u0422\u043E\u0434 (Ctrl+B)", italic_desc:"\u041D\u0430\u043B\u0443\u0443 (Ctrl+I)", underline_desc:"\u0414\u043E\u043E\u0433\u0443\u0443\u0440 \u0437\u0443\u0440\u0430\u0430\u0441 (Ctrl+U)", striketrough_desc:"\u0414\u0430\u0440\u0441\u0430\u043D", justifyleft_desc:"\u0417\u04AF\u04AF\u043D \u0436\u0438\u0433\u0434\u0440\u04AF\u04AF\u043B\u0441\u044D\u043D", justifycenter_desc:"\u0413\u043E\u043B\u0434 \u0436\u0438\u0433\u0434\u0440\u04AF\u04AF\u043B\u0441\u044D\u043D", justifyright_desc:"\u0411\u0430\u0440\u0443\u0443\u043D \u0436\u0438\u0433\u0434\u0440\u04AF\u04AF\u043B\u0441\u044D\u043D", justifyfull_desc:"\u0422\u044D\u0433\u0448\u0438\u043B\u0441\u044D\u043D", bullist_desc:"\u0422\u043E\u043E\u0447\u0438\u043B\u0442", numlist_desc:"\u0414\u0443\u0433\u0430\u0430\u0440\u043B\u0430\u043B\u0442", outdent_desc:"\u0414\u043E\u0433\u043E\u043B \u043C\u04E9\u0440 \u0443\u0441\u0442\u0433\u0430\u0445", indent_desc:"\u0414\u043E\u0433\u043E\u043B \u043C\u04E9\u0440 \u043E\u0440\u0443\u0443\u043B\u0430\u0445", undo_desc:"\u0411\u0443\u0446\u0430\u0430\u0445 (Ctrl+Z)", redo_desc:"\u0426\u0443\u0446\u043B\u0430\u0445 (Ctrl+Y)", link_desc:"\u0425\u043E\u043B\u0431\u043E\u043E\u0441 \u043E\u0440\u0443\u0443\u043B\u0430\u0445/\u04E9\u04E9\u0440\u0447\u043B\u04E9\u0445", unlink_desc:"\u0425\u043E\u043B\u0431\u043E\u043E\u0441 \u0443\u0441\u0442\u0433\u0430\u0445", image_desc:"\u0417\u0443\u0440\u0430\u0433 \u043E\u0440\u0443\u0443\u043B\u0430\u0445/\u04E9\u04E9\u0440\u0447\u043B\u04E9\u0445", cleanup_desc:"\u042D\u0445 \u043A\u043E\u0434 \u0446\u044D\u0432\u044D\u0440\u043B\u044D\u0445", code_desc:"HTML-\u044D\u0445 \u043A\u043E\u0434 \u0437\u0430\u0441\u0430\u0445", sub_desc:"\u0414\u043E\u043E\u0440 \u0431\u0430\u0439\u0440\u043B\u0430\u043B", sup_desc:"\u0414\u044D\u044D\u0440 \u0431\u0430\u0439\u0440\u043B\u0430\u043B", hr_desc:"\u0422\u0443\u0441\u0433\u0430\u0430\u0440\u043B\u0430\u0433\u0447 \u043E\u0440\u0443\u0443\u043B\u0430\u0445", removeformat_desc:"\u0425\u044D\u043B\u0431\u044D\u0440\u0436\u04AF\u04AF\u043B\u044D\u043B\u0442 \u0443\u0441\u0442\u0433\u0430\u0445", custom1_desc:"\u0425\u044D\u0440\u044D\u0433\u043B\u044D\u0433\u0447\u0438\u0439\u043D \u0442\u043E\u0434\u043E\u0440\u0445\u043E\u0439\u043B\u0441\u043E\u043D \u0442\u0430\u0439\u043B\u0431\u0430\u0440", forecolor_desc:"\u0411\u0438\u0447\u0432\u044D\u0440\u0438\u0439\u043D \u04E9\u043D\u0433\u04E9", backcolor_desc:"\u0414\u044D\u0432\u0441\u0433\u044D\u0440 \u04E9\u043D\u0433\u04E9", charmap_desc:"\u0422\u0443\u0441\u0433\u0430\u0439 \u0442\u044D\u043C\u0434\u044D\u0433\u0442 \u043E\u0440\u0443\u0443\u043B\u0430\u0445", visualaid_desc:"\u0422\u0443\u0441\u043B\u0430\u0445 \u0448\u0443\u0433\u0430\u043C \u0431\u0430 \u04AF\u043B \u04AF\u0437\u044D\u0433\u0434\u044D\u0445 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u04AF\u04AF\u0434\u0438\u0439\u0433 \u0445\u0430\u0440\u0443\u0443\u043B\u0430\u0445/\u0434\u0430\u043B\u0434\u043B\u0430\u0445", anchor_desc:"\u0413\u0430\u0434\u0430\u0441 \u043E\u0440\u0443\u0443\u043B\u0430\u0445/\u04E9\u04E9\u0440\u0447\u043B\u04E9\u0445", cut_desc:"\u0422\u0430\u0441\u043B\u0430\u043D \u0430\u0432\u0430\u0445", copy_desc:"\u0425\u0443\u0443\u043B\u0430\u0445", paste_desc:"\u041E\u0440\u0443\u0443\u043B\u0430\u0445", image_props_desc:"\u0417\u0443\u0440\u0433\u0438\u0439\u043D \u0442\u043E\u0434\u0440\u0443\u0443\u043B\u0433\u0430", newdocument_desc:"\u0428\u0438\u043D\u044D \u0431\u0430\u0440\u0438\u043C\u0442", help_desc:"\u0422\u0443\u0441\u043B\u0430\u043C\u0436", blockquote_desc:"\u0418\u0448\u043B\u044D\u043B", clipboard_msg:"\u0425\u0443\u0443\u043B\u0430\u0445, \u0442\u0430\u0441\u043B\u0430\u043D \u0430\u0432\u0430\u0445 \u0431\u0443\u0443\u043B\u0433\u0430\u0445 \u043D\u044C \u041C\u043E\u0437\u0438\u043B\u043B\u0430 \u0424\u0430\u0439\u0440\u0444\u043E\u043A\u0441 \u0434\u044D\u044D\u0440 \u0431\u043E\u043B\u043E\u043C\u0436\u0433\u04AF\u0439. \r\n \u0422\u0430 \u044D\u043D\u044D \u0430\u0441\u0443\u0443\u0434\u043B\u044B\u043D \u0442\u0430\u043B\u0430\u0430\u0440 \u0434\u044D\u043B\u0433\u044D\u0440\u044D\u043D\u0433\u04AF\u0439 \u043C\u044D\u0434\u044D\u0445\u0438\u0439\u0433 \u0445\u04AF\u0441\u044D\u0436 \u0431\u0430\u0439\u043D\u0430 \u0443\u0443?", path:"\u0417\u0430\u043C", newdocument:"\u0422\u0430 \u0431\u04AF\u0445 \u0430\u0433\u0443\u0443\u043B\u0433\u044B\u0433 \u0443\u0441\u0442\u0433\u0430\u0445\u0434\u0430\u0430 \u0438\u0442\u0433\u044D\u043B\u0442\u044D\u0439 \u0431\u0430\u0439\u043D\u0430 \u0443\u0443?", toolbar_focus:"\u0411\u0430\u0433\u0430\u0436 \u0441\u0430\u043C\u0431\u0430\u0440 \u043B\u0443\u0443 \u04AF\u0441\u0440\u044D\u0445\u044D\u0434: Alt+Q; \u0417\u0430\u0441\u0432\u0430\u0440\u043B\u0430\u0433\u0447 \u0440\u0443\u0443 \u04AF\u0441\u0440\u044D\u0445\u044D\u0434: Alt-Z; \u042D\u043B\u0435\u043C\u0435\u043D\u0442\u0438\u0439\u043D \u0437\u0430\u043C \u0440\u0443\u0443 \u04AF\u0441\u0440\u044D\u0445\u044D\u0434: Alt-X", more_colors:"\u0411\u0443\u0441\u0430\u0434 \u04E9\u043D\u0433\u04E9" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/mn_dlg.js000066400000000000000000000113551226600447100241370ustar00rootroot00000000000000tinyMCE.addI18n('mn.advanced_dlg',{ about_title:"TinyMCE \u0442\u0443\u0445\u0430\u0439", about_general:"\u0422\u0443\u0445\u0430\u0439\u2026", about_help:"\u0422\u0443\u0441\u043B\u0430\u043C\u0436", about_license:"\u041B\u0438\u0446\u0435\u043D\u0437\u0438\u0439\u043D \u043D\u04E9\u0445\u0446\u04E9\u043B", about_plugins:"\u041F\u043B\u0430\u0433\u0438\u043D", about_plugin:"\u041F\u043B\u0430\u0433\u0438\u043D", about_author:"\u0417\u043E\u0445\u0438\u043E\u0433\u0447", about_version:"\u0425\u0443\u0432\u0438\u043B\u0431\u0430\u0440", about_loaded:"\u0410\u0447\u0430\u0430\u043B\u0430\u0433\u0434\u0441\u0430\u043D \u041F\u043B\u0430\u0433\u0438\u043D\u04AF\u04AF\u0434", anchor_title:"\u0413\u0430\u0434\u0430\u0441 \u043E\u0440\u0443\u0443\u043B\u0430\u0445/\u04E9\u04E9\u0440\u0447\u043B\u04E9\u0445", anchor_name:"\u0413\u0430\u0434\u0430\u0441\u043D\u044B \u043D\u044D\u0440", code_title:"HTML-\u044D\u0445 \u043A\u043E\u0434 \u0437\u0430\u0441\u0432\u0430\u0440\u043B\u0430\u0445", code_wordwrap:"\u0410\u0432\u0442\u043E\u043C\u0430\u0442 \u043C\u04E9\u0440 \u043E\u0440\u043E\u043E\u043B\u0442", colorpicker_title:"\u04E8\u043D\u0433\u04E9", colorpicker_picker_tab:"\u04E8\u043D\u0433\u04E9 \u0441\u043E\u043D\u0433\u043E\u043B\u0442", colorpicker_picker_title:"\u04E8\u043D\u0433\u04E9 \u0441\u043E\u043D\u0433\u043E\u043B\u0442", colorpicker_palette_tab:"\u041D\u0438\u0439\u043B\u04AF\u04AF\u0440", colorpicker_palette_title:"\u04E8\u043D\u0433\u04E9\u043D\u0438\u0439 \u043D\u0438\u0439\u043B\u04AF\u04AF\u0440", colorpicker_named_tab:"\u041D\u044D\u0440\u043B\u044D\u0441\u044D\u043D \u04E9\u043D\u0433\u04E9", colorpicker_named_title:"\u041D\u044D\u0440\u043B\u044D\u0441\u044D\u043D \u04E9\u043D\u0433\u04E9", colorpicker_color:"\u04E8\u043D\u0433\u04E9:", colorpicker_name:"\u041D\u044D\u0440:", charmap_title:"\u0422\u0443\u0441\u0433\u0430\u0439 \u0442\u044D\u043C\u0434\u044D\u0433\u0442", image_title:"\u0417\u0443\u0440\u0430\u0433 \u043E\u0440\u0443\u0443\u043B\u0430\u0445/\u04E9\u04E9\u0440\u0447\u043B\u04E9\u0445", image_src:"\u0425\u0430\u044F\u0433", image_alt:"\u0425\u043E\u0451\u0440\u0434\u043E\u0433\u0447 \u0431\u0438\u0447\u0432\u044D\u0440", image_list:"\u0417\u0443\u0440\u0433\u0438\u0439\u043D \u0436\u0430\u0433\u0441\u0430\u0430\u043B\u0442", image_border:"\u0425\u04AF\u0440\u044D\u044D", image_dimensions:"\u0425\u044D\u043C\u0436\u044D\u044D\u0441", image_vspace:"\u0411\u043E\u0441\u043E\u043E \u0430\u043B\u0441\u043B\u0430\u043B\u0442", image_hspace:"\u0425\u044D\u0432\u0442\u044D\u044D \u0430\u043B\u0441\u043B\u0430\u043B\u0442", image_align:"\u0416\u0438\u0433\u0434\u0440\u04AF\u04AF\u043B\u044D\u043B\u0442", image_align_baseline:"\u041C\u04E9\u0440", image_align_top:"\u0414\u044D\u044D\u0440", image_align_middle:"\u0414\u0443\u043D\u0434", image_align_bottom:"\u0414\u043E\u043E\u0440", image_align_texttop:"\u0411\u0438\u0447\u0432\u044D\u0440\u0438\u0439\u043D \u0434\u044D\u044D\u0440", image_align_textbottom:"\u0411\u0438\u0447\u0432\u044D\u0440\u0438\u0439\u043D \u0434\u043E\u043E\u0440", image_align_left:"\u0417\u04AF\u04AF\u043D", image_align_right:"\u0411\u0430\u0440\u0443\u0443\u043D", link_title:"\u0425\u043E\u043B\u0431\u043E\u043E\u0441 \u043E\u0440\u0443\u0443\u043B\u0430\u0445/\u04E9\u04E9\u0440\u0447\u043B\u04E9\u0445", link_url:"\u0425\u0430\u044F\u0433", link_target:"\u0426\u043E\u043D\u0445", link_target_same:"\u0422\u0443\u0445\u0430\u0439\u043D \u0446\u043E\u043D\u0445\u043E\u043D\u0434 \u043D\u044D\u044D\u0445", link_target_blank:"\u0428\u0438\u043D\u044D \u0446\u043E\u043D\u0445\u043E\u043D\u0434 \u043D\u044D\u044D\u0445", link_titlefield:"\u0413\u0430\u0440\u0447\u0438\u0433", link_is_email:"\u0425\u0430\u044F\u0433 \u0434\u044D\u044D\u0440 \u0418\u043C\u044D\u0439\u043B \u0445\u0430\u044F\u0433 \u0431\u0430\u0439\u0445 \u0448\u0438\u0433 \u0445\u0430\u0440\u0430\u0433\u0434\u0430\u043D\u0430. \u0422\u0430 \u0442\u04AF\u04AF\u043D\u0434 \u0448\u0430\u0430\u0440\u0434\u043B\u0430\u0433\u0430\u0442\u0430\u0439 mailto: \u043D\u044D\u043C\u044D\u0445\u0438\u0439\u0433 \u0445\u04AF\u0441\u044D\u0436 \u0431\u0430\u0439\u043D\u0430 \u0443\u0443?", link_is_external:"\u0425\u0430\u044F\u0433 \u0434\u044D\u044D\u0440 \u0433\u0430\u0434\u0430\u0430\u0434 \u0445\u043E\u043B\u0431\u043E\u043E\u0441 \u0431\u0430\u0439\u0433\u0430\u0430 \u0445\u0430\u0440\u0430\u0433\u0434\u0430\u043D\u0430. \u0422\u0430 \u0437\u04E9\u0432 \u0445\u043E\u043B\u0431\u043E\u043E\u0441 \u0431\u043E\u043B\u0433\u043E\u0445\u044B\u043D \u0442\u0443\u043B\u0434 http:// \u043D\u044D\u043C\u044D\u0445\u0438\u0439\u0433 \u0445\u04AF\u0441\u044D\u0436 \u0431\u0430\u0439\u043D\u0430 \u0443\u0443?", link_list:"\u0425\u043E\u043B\u0431\u043E\u043E\u0441\u044B\u043D \u0436\u0430\u0433\u0441\u0430\u0430\u043B\u0442" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/ms.js000066400000000000000000000035541226600447100233200ustar00rootroot00000000000000tinyMCE.addI18n('ms.advanced',{ style_select:"Gaya", font_size:"Saiz Huruf", fontdefault:"Jenis Huruf", block:"Format", paragraph:"Perenggan", div:"Div", address:"Alamat", pre:"Telah diformatkan", h1:"Tajuk 1", h2:"Tajuk 2", h3:"Tajuk 3", h4:"Tajuk 4", h5:"Tajuk 5", h6:"Tajuk 6", blockquote:"Petikan blok", code:"Kod", samp:"Contoh kod", dt:"Maksud terma", dd:"Maksud huraian", bold_desc:"Tebal (Ctrl+B)", italic_desc:"Condong (Ctrl+I)", underline_desc:"Garis bawah (Ctrl+U)", striketrough_desc:"Garis tengah", justifyleft_desc:"Selari kekiri", justifycenter_desc:"Selari ketengah", justifyright_desc:"Selari kekanan", justifyfull_desc:"Selari penuh", bullist_desc:"Senarai tidak tertib", numlist_desc:"Senarai tertib", outdent_desc:"Lekuk kebelakang", indent_desc:"Lekuk kedepan", undo_desc:"Undur (Ctrl+Z)", redo_desc:"Maju (Ctrl+Y)", link_desc:"Sisip/sunting pautan", unlink_desc:"Tiada pautan", image_desc:"Sisip/sunting imej", cleanup_desc:"Bersihkan kod", code_desc:"Sunting kod HTML", sub_desc:"Subskrip", sup_desc:"Superskrip", hr_desc:"Sisip pembaris mengufuk", removeformat_desc:"Alih format", custom1_desc:"Huraian anda di sini", forecolor_desc:"Pilih warna teks", backcolor_desc:"Pilih warna latar belakang", charmap_desc:"Sisip aksara", visualaid_desc:"Alih garis panduan/unsur tak nampak", anchor_desc:"Sisip/sunting anchor", cut_desc:"Potong", copy_desc:"Salin", paste_desc:"Tempel", image_props_desc:"Alatan imej", newdocument_desc:"Dokumen baru", help_desc:"Bantuan", blockquote_desc:"Petikan blok", clipboard_msg:"Salin/Potong/Tempel tidak disokong dalam Mozilla dan Firefox.\r\nAdakah anda mahu informasi lanjut tentang isu ini?", path:"Laluan", newdocument:"Hapus semua kandungan?", toolbar_focus:"Lompat ke butang alatan - Alt+Q, Lompat ke editor - Alt-Z, Lompat ke unsur laluan - Alt-X", more_colors:"Warna lain" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/ms_dlg.js000066400000000000000000000032741226600447100241450ustar00rootroot00000000000000tinyMCE.addI18n('ms.advanced_dlg',{ about_title:"Perihal TinyMCE", about_general:"Perihal", about_help:"Bantuan", about_license:"Lesen", about_plugins:"Plugins", about_plugin:"Plugin", about_author:"Pengarang", about_version:"Versi", about_loaded:"Muatan plugins", anchor_title:"Sisip/sunting sauh", anchor_name:"Nama sauh", code_title:"Penyunting HTML", code_wordwrap:"Sisip perkataan", colorpicker_title:"Pilih warna", colorpicker_picker_tab:"Pemungut", colorpicker_picker_title:"Pemungut warna", colorpicker_palette_tab:"Palet", colorpicker_palette_title:"Palet warna", colorpicker_named_tab:"Dinamakan", colorpicker_named_title:"Warna telah dinamakan", colorpicker_color:"Warna:", colorpicker_name:"Nama:", charmap_title:"Pilih aksara sendiri", image_title:"Sisip/sunting imej", image_src:"Imej URL", image_alt:"Huraian imej", image_list:"Senarai imej", image_border:"Sempadan", image_dimensions:"Dimensi", image_vspace:"Ruangan tegak", image_hspace:"Ruangan ufuk", image_align:"Penyelarian", image_align_baseline:"Garis pangkal", image_align_top:"Atas", image_align_middle:"Tengah", image_align_bottom:"Bawah", image_align_texttop:"Teks atas", image_align_textbottom:"Teks bawah", image_align_left:"Kiri", image_align_right:"Kanan", link_title:"Sisip/sunting pautan", link_url:"Pautan URL", link_target:"Sasaran", link_target_same:"Buka pautan dalam tetingkap yang sama", link_target_blank:"Buka pautan dalam tetingkap yang sama", link_titlefield:"Tajuk", link_is_email:"URL yang anda masukkan adalah alamat emel, tambah \"mailto\": di awalan?", link_is_external:"URL yang anda masukkan adalah pautan luar, tambah \"http://\" di awalan?", link_list:"Senarai pautan" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/nb.js000066400000000000000000000036501226600447100232750ustar00rootroot00000000000000tinyMCE.addI18n('nb.advanced',{ style_select:"Stiler", font_size:"Skriftst\u00F8rrelse", fontdefault:"Skriftfamilie", block:"Format", paragraph:"Avsnitt", div:"Div", address:"Adresse", pre:"Pre-formatert", h1:"Overskrift 1", h2:"Overskrift 2", h3:"Overskrift 3", h4:"Overskrift 4", h5:"Overskrift 5", h6:"Overskrift 6", blockquote:"Innrykkinnrykk", code:"Kode", samp:"Kodeeksempel", dt:"Definisjonsuttrykk", dd:"Definisjonsbeskrivelse", bold_desc:"Fet", italic_desc:"Kursiv", underline_desc:"Understreking", striketrough_desc:"Gjennomstreking", justifyleft_desc:"Venstrejuster", justifycenter_desc:"Midtstill", justifyright_desc:"H\u00F8yrejuster", justifyfull_desc:"Blokkjuster", bullist_desc:"Punktliste", numlist_desc:"Nummerliste", outdent_desc:"Reduser innrykk", indent_desc:"\u00D8k innrykk", undo_desc:"Angre", redo_desc:"Gj\u00F8r om", link_desc:"Sett inn / endre lenke", unlink_desc:"Fjern lenke", image_desc:"Sett inn / endre bilde", cleanup_desc:"Rens ukurant kode", code_desc:"Redigere HTML-koden", sub_desc:"Senket skrift", sup_desc:"Hevet skrift", hr_desc:"Sett inn horisontal linje", removeformat_desc:"Fjern formatering", custom1_desc:"Beskrivelse av spesialfunksjon", forecolor_desc:"Velg skriftfarge", backcolor_desc:"Velg bakgrunnsfarge", charmap_desc:"Sett inn spesialtegn", visualaid_desc:"Sl\u00E5 av/p\u00E5 usynlige elementer", anchor_desc:"Sett inn / endre anker", cut_desc:"Klipp ut", copy_desc:"Kopier", paste_desc:"Lim inn", image_props_desc:"Bildeegenskaper", newdocument_desc:"Nytt dokument", help_desc:"Hjelp", blockquote_desc:"Innrykk", clipboard_msg:"Klipp ut / Kopier /Lim inn fungerer ikke i Mozilla og Firefox. \r\n Vil du vite mer om dette?", path:"Sti", newdocument:"Er du sikker p\u00E5 at du vil slette alt innhold?", toolbar_focus:"Skift til verkt\u00F8yknapper - Alt+Q, Skift til editor - Alt-Z, Skift til elementsti - Alt-", more_colors:"Flere farger" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/nb_dlg.js000066400000000000000000000035041226600447100241210ustar00rootroot00000000000000tinyMCE.addI18n('nb.advanced_dlg',{ about_title:"Om TinyMCE", about_general:"Om", about_help:"Hjelp", about_license:"Lisens", about_plugins:"Programtillegg", about_plugin:"Programtillegg", about_author:"Utvikler", about_version:"Versjon", about_loaded:"Lastede programtillegg", anchor_title:"Sett inn / endre anker", anchor_name:"Ankernavn", code_title:"HTML-editor", code_wordwrap:"Tekstbryting", colorpicker_title:"Velg en farge", colorpicker_picker_tab:"Velg farge", colorpicker_picker_title:"Fargevalg", colorpicker_palette_tab:"Palett", colorpicker_palette_title:"Palettfarger", colorpicker_named_tab:"Navnevalg", colorpicker_named_title:"Fargenavn", colorpicker_color:"Farge:", colorpicker_name:"Navn:", charmap_title:"Velg spesialtegn", image_title:"Sett inn / endre bilde", image_src:"Bildets URL", image_alt:"Bildebeskrivelse", image_list:"Bildeliste", image_border:"Ramme", image_dimensions:"Dimensjoner", image_vspace:"Vertikal avstand", image_hspace:"Horisontal avstand", image_align:"Justering", image_align_baseline:"Bunnlinje", image_align_top:"Topp", image_align_middle:"Midtstilt", image_align_bottom:"Bunn", image_align_texttop:"Teksttopp", image_align_textbottom:"Tekstbunn", image_align_left:"Venstre", image_align_right:"H\u00F8yre", link_title:"Sett inn /endre lenke", link_url:"Lenkens URL", link_target:"M\u00E5lside", link_target_same:"\u00C5pne i dette vinduet", link_target_blank:"\u00C5pne i nytt vindu", link_titlefield:"Tittel", link_is_email:"Nettadressen du skrev inn ser ut til \u00E5 v\u00E6re en e-postadresse. \u00D8nsker du \u00E5 legge til det p\u00E5krevde mailto:-prefikset?", link_is_external:"Nettadressen du skrev inn ser ut til \u00E5 v\u00E6re en ekstern nettadresse. \u00D8nsker du \u00E5 legge til det p\u00E5krevde http://-prefikset?", link_list:"Lenkeliste" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/nl.js000066400000000000000000000036331226600447100233100ustar00rootroot00000000000000tinyMCE.addI18n('nl.advanced',{ style_select:"Stijlen", font_size:"Tekengrootte", fontdefault:"Lettertype", block:"Opmaak", paragraph:"Alinea", div:"Div", address:"Adres", pre:"Vaste opmaak", h1:"Kop 1", h2:"Kop 2", h3:"Kop 3", h4:"Kop 4", h5:"Kop 5", h6:"Kop 6", blockquote:"Citaat", code:"Code", samp:"Codevoorbeeld", dt:"Definitieterm", dd:"Definitiebeschrijving", bold_desc:"Vet (Ctrl+B)", italic_desc:"Cursief (Ctrl+I)", underline_desc:"Onderstrepen (Ctrl+U)", striketrough_desc:"Doorhalen", justifyleft_desc:"Links uitlijnen", justifycenter_desc:"Centreren", justifyright_desc:"Rechts uitlijnen", justifyfull_desc:"Uitvullen", bullist_desc:"Opsommingstekens", numlist_desc:"Nummering", outdent_desc:"Inspringing verkleinen", indent_desc:"Inspringing vergroten", undo_desc:"Ongedaan maken (Ctrl+Z)", redo_desc:"Herhalen (Ctrl+Y)", link_desc:"Link invoegen/bewerken", unlink_desc:"Link verwijderen", image_desc:"Afbeelding invoegen/bewerken", cleanup_desc:"Code opruimen", code_desc:"HTML bron bewerken", sub_desc:"Subscript", sup_desc:"Superscript", hr_desc:"Scheidingslijn invoegen", removeformat_desc:"Opmaak verwijderen", custom1_desc:"Uw eigen beschrijving hier", forecolor_desc:"Tekstkleur", backcolor_desc:"Tekstmarkeringskleur", charmap_desc:"Symbool invoegen", visualaid_desc:"Hulplijnen weergeven", anchor_desc:"Anker invoegen/bewerken", cut_desc:"Knippen", copy_desc:"Kopi\u00EBren", paste_desc:"Plakken", image_props_desc:"Afbeeldingseigenschappen", newdocument_desc:"Nieuw document", help_desc:"Help", blockquote_desc:"Citaat", clipboard_msg:"Kopi\u00EBren/knippen/plakken is niet beschikbaar in Mozilla en Firefox.\nWilt u meer informatie over deze beperking?", path:"Pad", newdocument:"Weet u zeker dat u alle inhoud wilt wissen?", toolbar_focus:"Spring naar werkbalk - Alt+Q, Spring naar tekst - Alt-Z, Spring naar elementpad - Alt-X", more_colors:"Meer kleuren" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/nl_dlg.js000066400000000000000000000033511226600447100241330ustar00rootroot00000000000000tinyMCE.addI18n('nl.advanced_dlg',{ about_title:"Over TinyMCE", about_general:"Info", about_help:"Help", about_license:"Licentie", about_plugins:"Invoegtoepassingen", about_plugin:"Invoegtoepassing", about_author:"Auteur", about_version:"Versie", about_loaded:"Geladen Invoegtoepassingen", anchor_title:"Anker invoegen/bewerken", anchor_name:"Ankernaam", code_title:"HTML Bron", code_wordwrap:"Automatische terugloop", colorpicker_title:"Kleuren", colorpicker_picker_tab:"Alle kleuren", colorpicker_picker_title:"Alle kleuren", colorpicker_palette_tab:"Palet", colorpicker_palette_title:"Paletkleuren", colorpicker_named_tab:"Benoemd", colorpicker_named_title:"Benoemde kleuren", colorpicker_color:"Kleur:", colorpicker_name:"Naam:", charmap_title:"Symbolen", image_title:"Afbeelding invoegen/bewerken", image_src:"Bestand/URL", image_alt:"Beschrijving", image_list:"Lijst", image_border:"Rand", image_dimensions:"Afmetingen", image_vspace:"Verticale ruimte", image_hspace:"Horizontale ruimte", image_align:"Uitlijning", image_align_baseline:"Basislijn", image_align_top:"Boven", image_align_middle:"Midden", image_align_bottom:"Onder", image_align_texttop:"Bovenkant tekst", image_align_textbottom:"Onderkant tekst", image_align_left:"Links", image_align_right:"Rechts", link_title:"Link invoegen/bewerken", link_url:"URL", link_target:"Doel", link_target_same:"Link in hetzelfde venster openen", link_target_blank:"Link in een nieuw venster openen", link_titlefield:"Titel", link_is_email:"De ingevoerde URL lijkt op een e-mailadres. Wilt u de vereiste mailto: tekst voorvoegen?", link_is_external:"De ingevoerde URL lijkt op een externe link. Wilt u de vereiste http:// tekst voorvoegen?", link_list:"Link lijst" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/nn.js000066400000000000000000000036261226600447100233140ustar00rootroot00000000000000tinyMCE.addI18n('nn.advanced',{ style_select:"Stilar", font_size:"Skriftstorleik", fontdefault:"Skriftfamilie", block:"Format", paragraph:"Avsnitt", div:"Div", address:"Adresse", pre:"Pre-formatert", h1:"Overskrift 1", h2:"Overskrift 2", h3:"Overskrift 3", h4:"Overskrift 4", h5:"Overskrift 5", h6:"Overskrift 6", blockquote:"Innrykk", code:"Kode", samp:"Kodeeksempel", dt:"Definisjonsuttrykk", dd:"Definisjonsbeskrivelse", bold_desc:"Feit", italic_desc:"Kursiv", underline_desc:"Understreking", striketrough_desc:"Gjennomstreking", justifyleft_desc:"Venstrejustert", justifycenter_desc:"Midtstilt", justifyright_desc:"H\u00F8grejustert", justifyfull_desc:"Blokkjustert", bullist_desc:"Punktliste", numlist_desc:"Nummerliste", outdent_desc:"Reduser innrykk", indent_desc:"Auk innrykk", undo_desc:"Angre", redo_desc:"Gjer om", link_desc:"Set inn / endre lenkje", unlink_desc:"Fjern lenkje", image_desc:"Set inn / endre bilete", cleanup_desc:"Rens grisete kode", code_desc:"Redigere HTML-koden", sub_desc:"Senka skrift", sup_desc:"Heva skrift", hr_desc:"Set inn horisontal linje", removeformat_desc:"Fjern formatering", custom1_desc:"Din spesialfunksjondefinisjon her", forecolor_desc:"Vel skriftfarge", backcolor_desc:"Vel bakgrunnsfarge", charmap_desc:"Set inn spesialteikn", visualaid_desc:"Sl\u00E5 av/p\u00E5 usynlige element", anchor_desc:"Set inn / endre anker", cut_desc:"Klipp ut", copy_desc:"Kopier", paste_desc:"Lim inn", image_props_desc:"Eigenskaper for bilete", newdocument_desc:"Nytt dokument", help_desc:"Hjelp", blockquote_desc:"Innrykk", clipboard_msg:"Klipp ut / Kopier /Lim inn fungerer ikkje i Mozilla og Firefox. \r\n Vil du vite meir om dette?", path:"Sti", newdocument:"Er du sikker p\u00E5 at du vil slette alt innhald?", toolbar_focus:"Skift til verktyknappar - Alt+Q, Skift til editor - Alt-Z, Skift til elementsti - Alt-", more_colors:"Fleire fargar" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/nn_dlg.js000066400000000000000000000034641226600447100241420ustar00rootroot00000000000000tinyMCE.addI18n('nn.advanced_dlg',{ about_title:"Om TinyMCE", about_general:"Om", about_help:"Hjelp", about_license:"Lisens", about_plugins:"Programtillegg", about_plugin:"Programtillegg", about_author:"Utviklar", about_version:"Versjon", about_loaded:"Lasta programtillegg", anchor_title:"Set inn / endre anker", anchor_name:"Ankernamn", code_title:"HTML-editor", code_wordwrap:"Tekstbryting", colorpicker_title:"Vel ein farge", colorpicker_picker_tab:"Vel farge", colorpicker_picker_title:"Fargeval", colorpicker_palette_tab:"Palett", colorpicker_palette_title:"Palettfargar", colorpicker_named_tab:"Namneval", colorpicker_named_title:"Fargenamn", colorpicker_color:"Farge:", colorpicker_name:"Namn:", charmap_title:"Vel spesialteikn", image_title:"Set inn / endre bilete", image_src:"Bilete-URL", image_alt:"Bileteomtale", image_list:"Liste med bilete", image_border:"Ramme", image_dimensions:"Dimensjonar", image_vspace:"Vertikal avstand", image_hspace:"Horisontal avstand", image_align:"Justering", image_align_baseline:"Botnlinje", image_align_top:"Topp", image_align_middle:"Midtstilt", image_align_bottom:"Botn", image_align_texttop:"Teksttopp", image_align_textbottom:"Tekstbotn", image_align_left:"Venstre", image_align_right:"H\u00F8gre", link_title:"Set inn / endre lenkje", link_url:"Lenkje-URL", link_target:"Vindauge", link_target_same:"Opne i dette vindauget", link_target_blank:"Opne i nytt vindauget", link_titlefield:"Tittel", link_is_email:"Nettadressa du skreiv inn ser ut til \u00E5 vere ein e-postadresse. \u00D8nskjer du \u00E5 leggje til det obligatoriske mailto:-prefikset?", link_is_external:"Nettadressa du skreiv inn ser ut til \u00E5 vere ein ekstern nettadresse. \u00D8nskjer du \u00E5 leggje til det obligatoriske http://-prefikset?", link_list:"Lenkjeliste" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/no.js000066400000000000000000000036351226600447100233150ustar00rootroot00000000000000tinyMCE.addI18n('no.advanced',{ style_select:"Stiler", font_size:"Skriftst\u00F8rrelse", fontdefault:"Skriftfamilie", block:"Format", paragraph:"Avsnitt", div:"Div", address:"Adresse", pre:"Pre-formatert", h1:"Overskrift 1", h2:"Overskrift 2", h3:"Overskrift 3", h4:"Overskrift 4", h5:"Overskrift 5", h6:"Overskrift 6", blockquote:"Innrykk", code:"Kode", samp:"Kodeeksempel", dt:"Definisjonsuttrykk", dd:"Definisjonsbeskrivelse", bold_desc:"Fet", italic_desc:"Kursiv", underline_desc:"Understrek", striketrough_desc:"Gjennomstrek", justifyleft_desc:"Venstrejustert", justifycenter_desc:"Midtstilt", justifyright_desc:"H\u00F8yrejustert", justifyfull_desc:"Blokkjustert", bullist_desc:"Punktliste", numlist_desc:"Nummerliste", outdent_desc:"Reduser innrykk", indent_desc:"\u00D8k innrykk", undo_desc:"Angre", redo_desc:"Gj\u00F8r om", link_desc:"Sett inn / endre lenke", unlink_desc:"Fjern lenke", image_desc:"Sett inn / endre bilde", cleanup_desc:"Rens grisete kode", code_desc:"Redigere HTML-kode", sub_desc:"Senk skrift", sup_desc:"Hev skrift", hr_desc:"Sett inn horisontal linje", removeformat_desc:"Fjern formatering", custom1_desc:"Din spesialfunksjondefinisjon her", forecolor_desc:"Vel skriftfarge", backcolor_desc:"Vel bakgrunnsfarge", charmap_desc:"Sett inn spesialtegn", visualaid_desc:"Sl\u00E5 av/p\u00E5 usynlige element", anchor_desc:"Sett inn / endre anker", cut_desc:"Klipp ut", copy_desc:"Kopier", paste_desc:"Lim inn", image_props_desc:"Egenskaper for bilde", newdocument_desc:"Nytt dokument", help_desc:"Hjelp", blockquote_desc:"Innrykk", clipboard_msg:"Klipp ut / Kopier /Lim inn fungerer ikke i Mozilla og Firefox. \r\n Vil du vite mer om dette?", path:"Sti", newdocument:"Er du sikker p\u00E5 at du vil slette alt innhold?", toolbar_focus:"Skift til verkt\u00F8yknapper - Alt+Q, Skift til editor - Alt-Z, Skift til elementsti - Alt-", more_colors:"Flere farger" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/no_dlg.js000066400000000000000000000034671226600447100241460ustar00rootroot00000000000000tinyMCE.addI18n('no.advanced_dlg',{ about_title:"Om TinyMCE", about_general:"Om", about_help:"Hjelp", about_license:"Lisens", about_plugins:"Programtillegg", about_plugin:"Programtillegg", about_author:"Utvikler", about_version:"Versjon", about_loaded:"Last programtillegg", anchor_title:"Sett inn / endre anker", anchor_name:"Ankernavn", code_title:"HTML-editor", code_wordwrap:"Tekstbryting", colorpicker_title:"Velg en farge", colorpicker_picker_tab:"Velg farge", colorpicker_picker_title:"Fargevalg", colorpicker_palette_tab:"Palett", colorpicker_palette_title:"Palettfarger", colorpicker_named_tab:"Navnevalg", colorpicker_named_title:"Fargenavn", colorpicker_color:"Farge:", colorpicker_name:"Navn:", charmap_title:"Velg spesialtegn", image_title:"Sett inn / endre bilde", image_src:"Bilde-URL", image_alt:"Bildeomtale", image_list:"Liste med bilde", image_border:"Ramme", image_dimensions:"Dimensjoner", image_vspace:"Vertikal avstand", image_hspace:"Horisontal avstand", image_align:"Justering", image_align_baseline:"Bunnlinje", image_align_top:"Topp", image_align_middle:"Midtstilt", image_align_bottom:"Bunn", image_align_texttop:"Teksttopp", image_align_textbottom:"Tekstbunn", image_align_left:"Venstre", image_align_right:"H\u00F8yre", link_title:"Sett inn / endre lenke", link_url:"Lenke-URL", link_target:"Vindu", link_target_same:"\u00C5pne i dette vinduet", link_target_blank:"\u00C5pne i nytt vindu", link_titlefield:"Tittel", link_is_email:"Nettadressen du skrev inn ser ut til \u00E5 v\u00E6re en e-postadresse. \u00D8nsker du \u00E5 legge til det obligatoriske mailto:-prefikset?", link_is_external:"Nettadressen du skrev inn ser ut til \u00E5 v\u00E6re en ekstern nettadresse. \u00D8nsker du \u00E5 legge til det obligatoriske http://-prefikset?", link_list:"Lenkeliste" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/pl.js000066400000000000000000000045451226600447100233150ustar00rootroot00000000000000tinyMCE.addI18n('pl.advanced',{ style_select:"Styl", font_size:"Rozmiar czcionki", fontdefault:"Rodzaj czcionki", block:"Format", paragraph:"Paragraf", div:"Div", address:"Adres", pre:"Czcionka o sta\u0142ej szeroko\u015Bci", h1:"Nag\u0142\u00F3wek 1", h2:"Nag\u0142\u00F3wek 2", h3:"Nag\u0142\u00F3wek 3", h4:"Nag\u0142\u00F3wek 4", h5:"Nag\u0142\u00F3wek 5", h6:"Nag\u0142\u00F3wek 6", blockquote:"Wydzielony blok", code:"Kod", samp:"Pr\u00F3bka kodu", dt:"Definicja terminu ", dd:"Opis terminu", bold_desc:"Pogrubienie (Ctrl+B)", italic_desc:"Kursywa (Ctrl+I)", underline_desc:"Podkre\u015Blenie (Ctrl+U)", striketrough_desc:"Przekre\u015Blenia", justifyleft_desc:"Wyr\u00F3wnaj do lewej", justifycenter_desc:"Wycentruj", justifyright_desc:"Wyr\u00F3wnaj do prawej", justifyfull_desc:"R\u00F3wnanie do prawej i lewej", bullist_desc:"Lista nienumerowana", numlist_desc:"Lista numerowana", outdent_desc:"Cofnij wci\u0119cie", indent_desc:"Wci\u0119cie", undo_desc:"Cofnij (Ctrl+Z)", redo_desc:"Pon\u00F3w (Ctrl+Y)", link_desc:"Wstaw/edytuj link", unlink_desc:"Usu\u0144 link", image_desc:"Wstaw/edytuj obraz", cleanup_desc:"Wyczy\u015B\u0107 nieuporz\u0105dkowany kod", code_desc:"Edytuj \u017Ar\u00F3d\u0142o HTML", sub_desc:"Indeks dolny", sup_desc:"Indeks g\u00F3rny", hr_desc:"Wstaw poziom\u0105 lini\u0119", removeformat_desc:"Usu\u0144 formatowanie", custom1_desc:"Tw\u00F3j niestandardowy opis tutaj", forecolor_desc:"Wybierz kolor tekstu", backcolor_desc:"Wybierz kolor t\u0142a", charmap_desc:"Wstaw niestandardowy znak", visualaid_desc:"Prze\u0142\u0105cz widoczno\u015B\u0107 wska\u017Anik\u00F3w i niewidocznych element\u00F3w", anchor_desc:"Wstaw/edytuj kotwic\u0119", cut_desc:"Wytnij", copy_desc:"Kopiuj", paste_desc:"Wklej", image_props_desc:"W\u0142a\u015Bciwo\u015Bci obrazka", newdocument_desc:"Nowy dokument", help_desc:"Pomoc", blockquote_desc:"Blok cytatu", clipboard_msg:"Akcje Kopiuj/Wytnij/Wklej nie s\u0105 dost\u0119pne w Mozilli i Firefox.\nCzy chcesz wi\u0119cej informacji o tym problemie?", path:"\u015Acie\u017Cka", newdocument:"Czy jeste\u015B pewnien, ze chcesz wyczy\u015Bci\u0107 ca\u0142\u0105 zawarto\u015B\u0107?", toolbar_focus:"Przeskocz do przycisk\u00F3w narz\u0119dzi - Alt+Q, Przeskocz do edytora - Alt-Z, Przeskocz do elementu \u015Bcie\u017Cki - Alt-X", more_colors:"Wi\u0119cej kolor\u00F3w" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/pl_dlg.js000066400000000000000000000036271226600447100241430ustar00rootroot00000000000000tinyMCE.addI18n('pl.advanced_dlg',{ about_title:"O TinyMCE", about_general:"O TinyMCE", about_help:"Pomoc", about_license:"Licencja", about_plugins:"Wtyczki", about_plugin:"Wtyczka", about_author:"Autor", about_version:"Wersja", about_loaded:"Za\u0142adowane wtyczki", anchor_title:"Wstaw/Edytuj zakotwiczenie", anchor_name:"Nazwa zakotwiczenia", code_title:"Edytor \u017Ar\u00F3d\u0142a HTML", code_wordwrap:"Zawijanie s\u0142\u00F3w", colorpicker_title:"Wybierz kolor", colorpicker_picker_tab:"Wybieranie", colorpicker_picker_title:"Wybieranie kolor\u00F3w", colorpicker_palette_tab:"Paleta", colorpicker_palette_title:"Paleta kolor\u00F3w", colorpicker_named_tab:"Nazwane", colorpicker_named_title:"Nazwane kolory", colorpicker_color:"Kolor:", colorpicker_name:"Nazwa:", charmap_title:"Wybierz niestandardowy znak", image_title:"Wstaw/Edytuj obraz", image_src:"URL obrazka", image_alt:"Opis obrazka", image_list:"Lista obrazk\u00F3w", image_border:"Ramka", image_dimensions:"Rozmiary", image_vspace:"Pionowy odst\u0119p", image_hspace:"Poziomy odst\u0119p", image_align:"Wyr\u00F3wnanie", image_align_baseline:"Linia bazowa", image_align_top:"G\u00F3ra", image_align_middle:"\u015Arodek", image_align_bottom:"Dolny", image_align_texttop:"G\u00F3rny tekst", image_align_textbottom:"Dolny tekst", image_align_left:"Lewy", image_align_right:"Prawy", link_title:"Wstaw/edytuj link", link_url:"Link URL", link_target:"Cel", link_target_same:"Otw\u00F3rz link w tym samym oknie", link_target_blank:"Otw\u00F3rz link w nowym oknie", link_titlefield:"Tytu\u0142", link_is_email:"URL kt\u00F3ry otworzy\u0142e\u015B wydaje si\u0119 by\u0107 adresem mailowym, czy chcesz doda\u0107 odpowiedni prefix mailto: ?", link_is_external:"URL kt\u00F3ry otworzy\u0142e\u015B wydaje si\u0119 by\u0107 zewn\u0119trznym linkiem, czy chcesz doda\u0107 wymagany prefix http:// ?", link_list:"Lista link\u00F3w" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/ps.js000066400000000000000000000035501226600447100233170ustar00rootroot00000000000000tinyMCE.addI18n('ps.advanced',{ style_select:"Styles", font_size:"Font size", fontdefault:"Font family", block:"Format", paragraph:"Paragraph", div:"Div", address:"Address", pre:"Preformatted", h1:"Heading 1", h2:"Heading 2", h3:"Heading 3", h4:"Heading 4", h5:"Heading 5", h6:"Heading 6", blockquote:"Blockquote", code:"Code", samp:"Code sample", dt:"Definition term ", dd:"Definition description", bold_desc:"Bold (Ctrl+B)", italic_desc:"Italic (Ctrl+I)", underline_desc:"Underline (Ctrl+U)", striketrough_desc:"Strikethrough", justifyleft_desc:"Align left", justifycenter_desc:"Align center", justifyright_desc:"Align right", justifyfull_desc:"Align full", bullist_desc:"Unordered list", numlist_desc:"Ordered list", outdent_desc:"Outdent", indent_desc:"Indent", undo_desc:"Undo (Ctrl+Z)", redo_desc:"Redo (Ctrl+Y)", link_desc:"Insert/edit link", unlink_desc:"Unlink", image_desc:"Insert/edit image", cleanup_desc:"Cleanup messy code", code_desc:"Edit HTML Source", sub_desc:"Subscript", sup_desc:"Superscript", hr_desc:"Insert horizontal ruler", removeformat_desc:"Remove formatting", custom1_desc:"Your custom description here", forecolor_desc:"Select text color", backcolor_desc:"Select background color", charmap_desc:"Insert custom character", visualaid_desc:"Toggle guidelines/invisible elements", anchor_desc:"Insert/edit anchor", cut_desc:"Cut", copy_desc:"Copy", paste_desc:"Paste", image_props_desc:"Image properties", newdocument_desc:"New document", help_desc:"Help", blockquote_desc:"Blockquote", clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?", path:"Path", newdocument:"Are you sure you want clear all contents?", toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X", more_colors:"More colors" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/ps_dlg.js000066400000000000000000000032741226600447100241500ustar00rootroot00000000000000tinyMCE.addI18n('ps.advanced_dlg',{ about_title:"About TinyMCE", about_general:"About", about_help:"Help", about_license:"License", about_plugins:"Plugins", about_plugin:"Plugin", about_author:"Author", about_version:"Version", about_loaded:"Loaded plugins", anchor_title:"Insert/edit anchor", anchor_name:"Anchor name", code_title:"HTML Source Editor", code_wordwrap:"Word wrap", colorpicker_title:"Select a color", colorpicker_picker_tab:"Picker", colorpicker_picker_title:"Color picker", colorpicker_palette_tab:"Palette", colorpicker_palette_title:"Palette colors", colorpicker_named_tab:"Named", colorpicker_named_title:"Named colors", colorpicker_color:"Color:", colorpicker_name:"Name:", charmap_title:"Select custom character", image_title:"Insert/edit image", image_src:"Image URL", image_alt:"Image description", image_list:"Image list", image_border:"Border", image_dimensions:"Dimensions", image_vspace:"Vertical space", image_hspace:"Horizontal space", image_align:"Alignment", image_align_baseline:"Baseline", image_align_top:"Top", image_align_middle:"Middle", image_align_bottom:"Bottom", image_align_texttop:"Text top", image_align_textbottom:"Text bottom", image_align_left:"Left", image_align_right:"Right", link_title:"Insert/edit link", link_url:"Link URL", link_target:"Target", link_target_same:"Open link in the same window", link_target_blank:"Open link in a new window", link_titlefield:"Title", link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", link_list:"Link list" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/pt.js000066400000000000000000000043521226600447100233210ustar00rootroot00000000000000tinyMCE.addI18n('pt.advanced',{ style_select:"Estilos", font_size:"Tamanho", fontdefault:"Tipo de fonte", block:"Formata\u00E7\u00E3o", paragraph:"Par\u00E1grafo", div:"Div", address:"Endere\u00E7o", pre:"Pr\u00E9-formatado", h1:"T\u00EDtulo 1", h2:"T\u00EDtulo 2", h3:"T\u00EDtulo 3", h4:"T\u00EDtulo 4", h5:"T\u00EDtulo 5", h6:"T\u00EDtulo 6", blockquote:"Cita\u00E7\u00E3o em bloco", code:"C\u00F3digo", samp:"Amostra de c\u00F3digo", dt:"Termo da defini\u00E7\u00E3o", dd:"Descri\u00E7\u00E3o da defini\u00E7\u00E3o", bold_desc:"Negrito (Ctrl+B)", italic_desc:"It\u00E1lico (Ctrl+I)", underline_desc:"Sublinhado (Ctrl+U)", striketrough_desc:"Riscado", justifyleft_desc:"Alinhar \u00E0 esquerda", justifycenter_desc:"Centralizar", justifyright_desc:"Alinhar \u00E0 direita", justifyfull_desc:"Justificar", bullist_desc:"Marcadores", numlist_desc:"Numera\u00E7\u00E3o", outdent_desc:"Diminuir recuo", indent_desc:"Aumentar recuo", undo_desc:"Desfazer (Ctrl+Z)", redo_desc:"Refazer (Ctrl+Y)", link_desc:"Inserir/editar hyperlink", unlink_desc:"Remover hyperlink", image_desc:"Inserir/editar imagem", cleanup_desc:"Limpar c\u00F3digo incorreto", code_desc:"Editar c\u00F3digo fonte", sub_desc:"Inferior \u00E0 linha", sup_desc:"Superior \u00E0 linha", hr_desc:"Inserir separador horizontal", removeformat_desc:"Remover formata\u00E7\u00E3o", custom1_desc:"Insira aqui a sua descri\u00E7\u00E3o personalizada", forecolor_desc:"Selecionar a cor do texto", backcolor_desc:"Selecionar a cor de fundo", charmap_desc:"Inserir caracteres especiais", visualaid_desc:"Alternar guias/elementos invis\u00EDveis", anchor_desc:"Inserir/editar \u00E2ncora", cut_desc:"Recortar", copy_desc:"Copiar", paste_desc:"Colar", image_props_desc:"Propriedades da imagem", newdocument_desc:"Novo documento", help_desc:"Ajuda", blockquote_desc:"Cita\u00E7\u00E3o em bloco", clipboard_msg:"Copiar/recortar/colar n\u00E3o est\u00E1 dispon\u00EDvel no Mozilla e Firefox. Deseja mais informa\u00E7\u00F5es sobre este problema?", path:"Endere\u00E7o", newdocument:"Tem a certeza que deseja apagar tudo?", toolbar_focus:"Ir para as ferramentas - Alt+Q, Ir para o editor - Alt-Z, Ir para o endere\u00E7o do elemento - Alt-X", more_colors:"Mais cores" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/pt_dlg.js000066400000000000000000000036231226600447100241470ustar00rootroot00000000000000tinyMCE.addI18n('pt.advanced_dlg',{ about_title:"Sobre o TinyMCE", about_general:"Sobre", about_help:"Ajuda", about_license:"Licen\u00E7a", about_plugins:"Plugins", about_plugin:"Plugin", about_author:"Autor", about_version:"Vers\u00E3o", about_loaded:"Plugins Instalados", anchor_title:"Inserir/editar \u00E2ncora", anchor_name:"Nome da \u00E2ncora", code_title:"Editor HTML", code_wordwrap:"Quebra autom\u00E1tica de linha", colorpicker_title:"Selecione uma cor", colorpicker_picker_tab:"Editor", colorpicker_picker_title:"Editor de Cores", colorpicker_palette_tab:"Paleta", colorpicker_palette_title:"Paleta de Cores", colorpicker_named_tab:"Personalizadas", colorpicker_named_title:"Cores Personalizadas", colorpicker_color:"Cor:", colorpicker_name:"Nome:", charmap_title:"Selecionar caracteres personalizados", image_title:"Inserir/editar imagem", image_src:"Endere\u00E7o da imagem", image_alt:"Descri\u00E7\u00E3o da imagem", image_list:"Lista de imagens", image_border:"Limites", image_dimensions:"Dimens\u00F5es", image_vspace:"Espa\u00E7o Vertical", image_hspace:"Espa\u00E7o Horizontal", image_align:"Alinhamento", image_align_baseline:"Sobre a linha de texto", image_align_top:"Topo", image_align_middle:"Meio", image_align_bottom:"Abaixo", image_align_texttop:"Topo do texto", image_align_textbottom:"Base do texto", image_align_left:"Esquerda", image_align_right:"Direita", link_title:"Inserir/editar hyperlink", link_url:"URL do hyperink", link_target:"Alvo", link_target_same:"Abrir hyperlink na mesma janela", link_target_blank:"Abrir hyperlink em nova janela", link_titlefield:"T\u00EDtulo", link_is_email:"A URL digitada parece ser um endere\u00E7o de e-mail. Deseja acrescentar o prefixo necess\u00E1rio mailto:?", link_is_external:"A URL digitada parece conduzir a um link externo. Deseja acrescentar o prefixo necess\u00E1rio http://?", link_list:"Lista de Links" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/ro.js000066400000000000000000000041521226600447100233140ustar00rootroot00000000000000tinyMCE.addI18n('ro.advanced',{ style_select:"Stiluri", font_size:"M\u0103rime font", fontdefault:"Font", block:"Format", paragraph:"Paragraf", div:"Div", address:"Adres\u0103", pre:"Preformatat", h1:"Titlu 1", h2:"Titlu 2", h3:"Titlu 3", h4:"Titlu 4", h5:"Titlu 5", h6:"Titlu 6", blockquote:"Citat", code:"Cod", samp:"Mostr\u0103 de cod", dt:"Termen definit ", dd:"Defini\u0163ie", bold_desc:"\u00CEngro\u015Fat (Ctrl+B)", italic_desc:"Italic (Ctrl+I)", underline_desc:"Subliniat (Ctrl+U)", striketrough_desc:"T\u0103iat", justifyleft_desc:"Aliniere la st\u00E2nga", justifycenter_desc:"Centrare", justifyright_desc:"Aliniere la dreapta", justifyfull_desc:"Aliniere pe toat\u0103 l\u0103\u0163imea", bullist_desc:"List\u0103 neordonat\u0103", numlist_desc:"List\u0103 ordonat\u0103", outdent_desc:"De-indenteaz\u0103", indent_desc:"Indenteaz\u0103", undo_desc:"Undo (Ctrl+Z)", redo_desc:"Ref\u0103 (Ctrl+Y)", link_desc:"Inserare/editare leg\u0103tur\u0103", unlink_desc:"\u015Eterge leg\u0103tura", image_desc:"Inserare/editare imagine", cleanup_desc:"Cur\u0103\u0163are cod", code_desc:"Editare surs\u0103 HTML", sub_desc:"Subscript", sup_desc:"Superscript", hr_desc:"Insereaz\u0103 linie orizontal\u0103", removeformat_desc:"Anuleaz\u0103 formatarea", custom1_desc:"Descriere ...", forecolor_desc:"Culoare text", backcolor_desc:"Culoare fundal", charmap_desc:"Inserare caracter special", visualaid_desc:"Comut\u0103 ghidajele/elementele invizibile", anchor_desc:"Inserare/editare ancor\u0103", cut_desc:"Taie", copy_desc:"Copiaz\u0103", paste_desc:"Lipe\u015Fte", image_props_desc:"Detalii imagine", newdocument_desc:"Document nou", help_desc:"Autor", blockquote_desc:"Citat", clipboard_msg:"Copierea/T\u0103ierea/Lipirea nu sunt disponibile \u00EEn Mozilla \u015Fi Firefox.\nDori\u0163i mai multe informa\u0163ii despre aceast\u0103 problem\u0103?", path:"Cale", newdocument:"Sigur dori\u0163i s\u0103 \u015Fterge\u0163i tot?", toolbar_focus:"S\u0103ri\u0163i la instrumente - Alt+Q, S\u0103ri\u0163i la editor - Alt-Z, S\u0103ri\u0163i la cale - Alt-X", more_colors:"Mai multe culori" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/ro_dlg.js000066400000000000000000000040421226600447100241400ustar00rootroot00000000000000tinyMCE.addI18n('ro.advanced_dlg',{ about_title:"Despre TinyMCE", about_general:"Despre", about_help:"Ajutor", about_license:"Licen\u0163\u0103", about_plugins:"Module", about_plugin:"Modul", about_author:"Autor", about_version:"Versiune", about_loaded:"Module \u00EEnc\u0103rcate", anchor_title:"Inserare/editare ancor\u0103", anchor_name:"Nume ancor\u0103", code_title:"Editor surs\u0103 HTML", code_wordwrap:"Word wrap", colorpicker_title:"Alege\u0163i o culoare", colorpicker_picker_tab:"Pipet\u0103", colorpicker_picker_title:"Pipet\u0103 de culori", colorpicker_palette_tab:"Palet\u0103", colorpicker_palette_title:"Palet\u0103 de culori", colorpicker_named_tab:"Denumite", colorpicker_named_title:"Culori denumite", colorpicker_color:"Culoare:", colorpicker_name:"Nume:", charmap_title:"Alege\u0163i un caracter special", image_title:"Insereaz\u0103/editeaz\u0103 o imagine", image_src:"URL imagine", image_alt:"Descriere imagine", image_list:"List\u0103 de imagini", image_border:"Bordur\u0103", image_dimensions:"Dimensiuni", image_vspace:"Spa\u0163iu vertical", image_hspace:"Spa\u0163iu orizontal", image_align:"Aliniere", image_align_baseline:"Baseline", image_align_top:"Sus", image_align_middle:"La mijloc", image_align_bottom:"Jos", image_align_texttop:"Textul sus", image_align_textbottom:"Textul la mijloc", image_align_left:"St\u00E2nga", image_align_right:"Dreapta", link_title:"Inserare/editare leg\u0103tur\u0103", link_url:"URL leg\u0103tur\u0103", link_target:"\u0162int\u0103", link_target_same:"Deschide leg\u0103tura \u00EEn aceea\u015Fi fereastr\u0103", link_target_blank:"Deschide leg\u0103tura \u00EEntr-o fereastr\u0103 nou\u0103", link_titlefield:"Titlu", link_is_email:"URL-ul pe care l-a\u0163i introdus pare a fi o adres\u0103 de e-mail. Dori\u0163i s\u0103 adaug \u015Fi prefixul mailto: necesar?", link_is_external:"URL-ul pe care l-a\u0163i introdus pare a fi o leg\u0103tur\u0103 extern\u0103. Dori\u0163i s\u0103 adaug \u015Fi prefixul http:// necesar?", link_list:"Lista de leg\u0103turi" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/ru.js000066400000000000000000000140101226600447100233140ustar00rootroot00000000000000tinyMCE.addI18n('ru.advanced',{ style_select:"\u0421\u0442\u0438\u043B\u0438", font_size:"\u0420\u0430\u0437\u043C\u0435\u0440 \u0448\u0440\u0438\u0444\u0442\u0430", fontdefault:"\u0428\u0440\u0438\u0444\u0442", block:"\u0424\u043E\u0440\u043C\u0430\u0442", paragraph:"\u0410\u0431\u0437\u0430\u0446", div:"Div", address:"\u0421\u0442\u0438\u043B\u044C \u0430\u0434\u0440\u0435\u0441\u0430", pre:"\u041F\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043B\u044C\u043D\u043E \u0444\u043E\u0440\u043C\u0430\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0439", h1:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A 1", h2:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A 2", h3:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A 3", h4:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A 4", h5:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A 5", h6:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A 6", blockquote:"\u0426\u0438\u0442\u0430\u0442\u0430", code:"\u041A\u043E\u0434", samp:"\u041F\u0440\u0438\u043C\u0435\u0440 \u043A\u043E\u0434\u0430", dt:"\u0421\u043F\u0440\u0430\u0432\u043E\u0447\u043D\u0438\u043A \u0442\u0435\u0440\u043C\u0438\u043D", dd:"\u0421\u043F\u0440\u0430\u0432\u043E\u0447\u043D\u0438\u043A \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435", bold_desc:"\u0416\u0438\u0440\u043D\u044B\u0439 (Ctrl + B)", italic_desc:"\u041A\u0443\u0440\u0441\u0438\u0432 (Ctrl + I)", underline_desc:"\u041F\u043E\u0434\u0447\u0435\u0440\u043A\u043D\u0443\u0442\u044B\u0439 (Ctrl + U)", striketrough_desc:"\u0417\u0430\u0447\u0435\u0440\u043A\u043D\u0443\u0442\u044B\u0439", justifyleft_desc:"\u041F\u043E \u043B\u0435\u0432\u043E\u043C\u0443 \u043A\u0440\u0430\u044E", justifycenter_desc:"\u041F\u043E \u0446\u0435\u043D\u0442\u0440\u0443", justifyright_desc:"\u041F\u043E \u043F\u0440\u0430\u0432\u043E\u043C\u0443 \u043A\u0440\u0430\u044E", justifyfull_desc:"\u041F\u043E \u0448\u0438\u0440\u0438\u043D\u0435", bullist_desc:"\u0421\u043F\u0438\u0441\u043E\u043A", numlist_desc:"\u041D\u0443\u043C\u0435\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0439 \u0441\u043F\u0438\u0441\u043E\u043A", outdent_desc:"\u0423\u043C\u0435\u043D\u044C\u0448\u0438\u0442\u044C \u043E\u0442\u0441\u0442\u0443\u043F", indent_desc:"\u0423\u0432\u0435\u043B\u0438\u0447\u0438\u0442\u044C \u043E\u0442\u0441\u0442\u0443\u043F", undo_desc:"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C (Ctrl + Z)", redo_desc:"\u0412\u0435\u0440\u043D\u0443\u0442\u044C (Ctrl + Y)", link_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C / \u0438\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u0443", unlink_desc:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u0443", image_desc:"\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F", cleanup_desc:"\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u043B\u0438\u0448\u043D\u0438\u0439 \u043A\u043E\u0434", code_desc:"\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C HTML \u043A\u043E\u0434", sub_desc:"\u041D\u0438\u0436\u043D\u0438\u0439 \u0438\u043D\u0434\u0435\u043A\u0441", sup_desc:"\u0412\u0435\u0440\u0445\u043D\u0438\u0439 \u0438\u043D\u0434\u0435\u043A\u0441", hr_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u0435\u043B\u044C", removeformat_desc:"\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0444\u043E\u0440\u043C\u0430\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435", custom1_desc:"\u0412\u0430\u0448 \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u043B\u044C\u043D\u044B\u0439 \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435 \u0437\u0434\u0435\u0441\u044C", forecolor_desc:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0446\u0432\u0435\u0442 \u0442\u0435\u043A\u0441\u0442\u0430", backcolor_desc:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0446\u0432\u0435\u0442 \u0444\u043E\u043D\u0430", charmap_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u0441\u0438\u043C\u0432\u043E\u043B", visualaid_desc:"Toggle guidelines / invisible elements", anchor_desc:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C / \u0438\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u044F\u043A\u043E\u0440\u044C", cut_desc:"\u0412\u044B\u0440\u0435\u0437\u0430\u0442\u044C", copy_desc:"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C", paste_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C", image_props_desc:"\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F", newdocument_desc:"\u041D\u043E\u0432\u044B\u0439 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442", help_desc:"\u041F\u043E\u043C\u043E\u0449\u044C", blockquote_desc:"\u0426\u0438\u0442\u0430\u0442\u0430", clipboard_msg:"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C / \u0412\u044B\u0440\u0435\u0437\u0430\u0442\u044C / \u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C (\u043D\u0435 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E \u0432 Mozilla \u0438 Firefox) \ n \u0412\u0430\u043C \u0438\u043D\u0442\u0435\u0440\u0435\u0441\u043D\u0430\u044F \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043E\u0431 \u044D\u0442\u043E\u043C?", path:"\u041F\u0443\u0442\u044C", newdocument:"\u0412\u044B \u0443\u0432\u0435\u0440\u0435\u043D\u044B, \u0447\u0442\u043E \u0445\u043E\u0442\u0438\u0442\u0435 \u0432\u0441\u0435 \u0443\u0434\u0430\u043B\u0438\u0442\u044C?", toolbar_focus:"\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043D\u0430 \u043F\u0430\u043D\u0435\u043B\u044C \u043A\u043D\u043E\u043F\u043E\u043A - Alt + Q, \u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043A \u0440\u0435\u0434\u0430\u043A\u0442\u043E\u0440\u0443 - Alt-Z, \u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043D\u0430 \u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u043F\u0443\u0442\u0438 - Alt-X", more_colors:"\u0411\u043E\u043B\u044C\u0448\u0435 \u0446\u0432\u0435\u0442\u043E\u0432" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/ru_dlg.js000066400000000000000000000121021226600447100241420ustar00rootroot00000000000000tinyMCE.addI18n('ru.advanced_dlg',{ about_title:"\u041E \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0435 TinyMCE", about_general:"\u041E \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0435 ...", about_help:"\u041F\u043E\u043C\u043E\u0449\u044C", about_license:"\u041B\u0438\u0446\u0435\u043D\u0437\u0438\u044F", about_plugins:"\u041F\u043B\u0430\u0433\u0438\u043D\u044B", about_plugin:"\u041F\u043B\u0430\u0433\u0438\u043D", about_author:"\u0410\u0432\u0442\u043E\u0440", about_version:"\u0412\u0435\u0440\u0441\u0438\u044F", about_loaded:"\u0417\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u043D\u044B\u0435 \u043F\u043B\u0430\u0433\u0438\u043D\u044B", anchor_title:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C / \u0438\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u044F\u043A\u043E\u0440\u044C", anchor_name:"\u0418\u043C\u044F \u044F\u043A\u043E\u0440\u044F", code_title:"\u0420\u0435\u0434\u0430\u043A\u0442\u043E\u0440 HTML \u043A\u043E\u0434\u0430", code_wordwrap:"\u041F\u0435\u0440\u0435\u043D\u043E\u0441\u0438\u0442\u044C \u0441\u043B\u043E\u0432\u0430", colorpicker_title:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0446\u0432\u0435\u0442", colorpicker_picker_tab:"\u041F\u0438\u043F\u0435\u0442\u043A\u0430", colorpicker_picker_title:"\u041F\u0438\u043F\u0435\u0442\u043A\u0430 \u0446\u0432\u0435\u0442\u0430", colorpicker_palette_tab:"\u041F\u0430\u043B\u0438\u0442\u0440\u0430", colorpicker_palette_title:"\u041F\u0430\u043B\u0438\u0442\u0440\u0430 \u0446\u0432\u0435\u0442\u043E\u0432", colorpicker_named_tab:"\u041F\u043E \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u044E", colorpicker_named_title:"\u041F\u043E \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u044E", colorpicker_color:"\u0426\u0432\u0435\u0442:", colorpicker_name:"\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435:", charmap_title:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u043B\u044C\u043D\u044B\u0439 \u0441\u0438\u043C\u0432\u043E\u043B", image_title:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C / \u0438\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435", image_src:"\u0410\u0434\u0440\u0435\u0441", image_alt:"\u041E\u043F\u0438\u0441\u0430\u043D\u0438\u0435", image_list:"\u0421\u043F\u0438\u0441\u043E\u043A \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0439", image_border:"\u0413\u0440\u0430\u043D\u0438\u0446\u0430", image_dimensions:"\u0420\u0430\u0437\u043C\u0435\u0440\u044B", image_vspace:"\u0412\u0435\u0440\u0442. \u043E\u0442\u0441\u0442\u0443\u043F\u043B\u0435\u043D\u0438\u0435", image_hspace:"\u0413\u043E\u0440\u0438\u0437. \u043E\u0442\u0441\u0442\u0443\u043F\u043B\u0435\u043D\u0438\u0435", image_align:"\u0412\u044B\u0440\u0430\u0432\u043D\u0438\u0432\u0430\u043D\u0438\u0435", image_align_baseline:"\u041F\u043E \u0431\u0430\u0437\u043E\u0432\u043E\u0439 \u043B\u0438\u043D\u0438\u0438", image_align_top:"\u041F\u043E \u0432\u0435\u0440\u0445\u043D\u0435\u043C\u0443 \u043A\u0440\u0430\u044E", image_align_middle:"\u041F\u043E \u0446\u0435\u043D\u0442\u0440\u0443", image_align_bottom:"\u041F\u043E \u043D\u0438\u0436\u043D\u0435\u043C\u0443 \u043A\u0440\u0430\u044E", image_align_texttop:"\u041F\u043E \u0432\u0435\u0440\u0445\u043D\u0435\u043C\u0443 \u043A\u0440\u0430\u044E \u0442\u0435\u043A\u0441\u0442\u0430", image_align_textbottom:"\u041F\u043E \u043D\u0438\u0436\u043D\u0435\u043C\u0443 \u043A\u0440\u0430\u044E \u0442\u0435\u043A\u0441\u0442\u0430", image_align_left:"\u041F\u043E \u043B\u0435\u0432\u043E\u043C\u0443 \u043A\u0440\u0430\u044E", image_align_right:"\u041F\u043E \u043F\u0440\u0430\u0432\u043E\u043C\u0443 \u043A\u0440\u0430\u044E", link_title:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C / \u0438\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u0443", link_url:"\u0410\u0434\u0440\u0435\u0441 \u0441\u0441\u044B\u043B\u043A\u0438", link_target:"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0432 ...", link_target_same:"\u044D\u0442\u043E\u043C \u0436\u0435 \u043E\u043A\u043D\u0435", link_target_blank:"\u043D\u043E\u0432\u043E\u043C \u043E\u043A\u043D\u0435", link_titlefield:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A", link_is_email:"\u0412\u0432\u0435\u0434\u0435\u043D\u043D\u044B\u0439 URL \u043F\u043E\u0445\u043E\u0436 \u043D\u0430 email \u0430\u0434\u0440\u0435\u0441, \u0432\u044B \u0445\u043E\u0442\u0438\u0442\u0435 \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u044B\u0439 \u043F\u0440\u0435\u0444\u0438\u043A\u0441 mailto:?", link_is_external:"\u0412\u0432\u0435\u0434\u0435\u043D\u043D\u044B\u0439 URL \u043F\u043E\u0445\u043E\u0436 \u043D\u0430 \u0432\u043D\u0435\u0448\u043D\u044E\u044E \u0441\u0441\u044B\u043B\u043A\u0443, \u0432\u044B \u0445\u043E\u0442\u0438\u0442\u0435 \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u044B\u0439 \u043F\u0440\u0435\u0444\u0438\u043A\u0441 http://?", link_list:"\u0421\u043F\u0438\u0441\u043E\u043A \u0441\u0441\u044B\u043B\u043E\u043A" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/sc.js000066400000000000000000000051041226600447100232770ustar00rootroot00000000000000tinyMCE.addI18n('sc.advanced',{ style_select:"\u6837\u5F0F", font_size:"\u5B57\u4F53\u5927\u5C0F", fontdefault:"\u5B57\u4F53", block:"\u683C\u5F0F", paragraph:"\u6BB5\u843D", div:"DIV\u5C42", address:"\u5730\u5740", pre:"\u65E0\u5F0F\u6837\u7F16\u6392", h1:"\u6807\u98981", h2:"\u6807\u98982", h3:"\u6807\u98983", h4:"\u6807\u98984", h5:"\u6807\u98985", h6:"\u6807\u98986", blockquote:"\u5F15\u7528", code:"\u4EE3\u7801", samp:"\u4EE3\u7801\u6837\u4F8B", dt:"\u540D\u8BCD\u5B9A\u4E49", dd:"\u540D\u8BCD\u89E3\u91CA", bold_desc:"\u9ED1\u4F53(Ctrl+B)", italic_desc:"\u659C\u4F53(Ctrl+I)", underline_desc:"\u5E95\u7EBF(Ctrl+U)", striketrough_desc:"\u5220\u9664\u7EBF", justifyleft_desc:"\u5DE6\u5BF9\u9F50", justifycenter_desc:"\u5C45\u4E2D", justifyright_desc:"\u53F3\u5BF9\u9F50", justifyfull_desc:"\u4E24\u7AEF\u5BF9\u9F50", bullist_desc:"\u4E13\u6848\u7B26\u53F7", numlist_desc:"\u7F16\u53F7", outdent_desc:"\u51CF\u5C11\u7F29\u6392", indent_desc:"\u589E\u52A0\u7F29\u6392", undo_desc:"\u64A4\u9500(Ctrl+Z)", redo_desc:"\u91CD\u505A(Ctrl+Y)", link_desc:"\u63D2\u5165/\u7F16\u8F91\u8FDE\u7ED3", unlink_desc:"\u53D6\u6D88\u8FDE\u7ED3", image_desc:"\u63D2\u5165/\u7F16\u8F91\u56FE\u7247", cleanup_desc:"\u6E05\u9664\u591A\u4F59\u4EE3\u7801", code_desc:"\u7F16\u8F91HTML\u6E90\u4EE3\u7801", sub_desc:"\u4E0B\u6807", sup_desc:"\u4E0A\u6807", hr_desc:"\u63D2\u5165\u6C34\u5E73\u7EBF", removeformat_desc:"\u6E05\u9664\u6837\u5F0F", custom1_desc:"\u5728\u6B64\u8F93\u5165\u60A8\u7684\u81EA\u5B9A\u4E49\u63CF\u8FF0", forecolor_desc:"\u9009\u62E9\u6587\u5B57\u989C\u8272", backcolor_desc:"\u9009\u62E9\u80CC\u666F\u989C\u8272", charmap_desc:"\u63D2\u5165\u7279\u6B8A\u7B26\u53F7", visualaid_desc:"\u5F00\u5173\u683C\u7EBF/\u9690\u85CF\u5143\u4EF6", anchor_desc:"\u63D2\u5165/\u7F16\u8F91\u951A\u70B9", cut_desc:"\u526A\u4E0B", copy_desc:"\u590D\u5236", paste_desc:"\u8D34\u4E0A", image_props_desc:"\u56FE\u7247\u5C5E\u6027", newdocument_desc:"\u65B0\u6587\u4EF6", help_desc:"\u8BF4\u660E", blockquote_desc:"\u5F15\u7528", clipboard_msg:"\u590D\u5236\u3001\u526A\u4E0B\u53CA\u8D34\u4E0A\u529F\u80FD\u5728Mozilla\u548CFirefox\u4E2D\u4E0D\u80FD\u4F7F\u7528\u3002 \n\u662F\u5426\u9700\u8981\u4E86\u89E3\u66F4\u591A\u6709\u5173\u6B64\u95EE\u9898\u7684\u8D44\u8BAF\uFF1F ", path:"\u4F4D\u7F6E", newdocument:"\u60A8\u786E\u8BA4\u8981\u6E05\u9664\u5168\u90E8\u5185\u5BB9\u5417\uFF1F ", toolbar_focus:"\u5DE5\u5177\u6309\u94AE- Alt+Q,\u7F16\u8F91\u5668- Alt-Z,\u5143\u4EF6\u4F4D\u7F6E- Alt-X", more_colors:"\u66F4\u591A\u989C\u8272", link_delta_width:"40", link_delta_height:"60" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/sc_dlg.js000066400000000000000000000047171226600447100241360ustar00rootroot00000000000000tinyMCE.addI18n('sc.advanced_dlg',{ about_title:"\u5173\u4E8ETinyMCE", about_general:"\u5173\u4E8E", about_help:"\u8BF4\u660E", about_license:"\u6388\u6743", about_plugins:"\u5168\u90E8\u63D2\u4EF6", about_plugin:"\u63D2\u4EF6", about_author:"\u4F5C\u8005", about_version:"\u7248\u672C", about_loaded:"\u5DF2\u8F7D\u5165\u7684\u63D2\u4EF6", anchor_title:"\u63D2\u5165/\u7F16\u8F91\u951A\u70B9", anchor_name:"\u951A\u70B9\u540D\u79F0", code_title:"HTML\u6E90\u4EE3\u7801\u7F16\u8F91\u5668", code_wordwrap:"\u6574\u5B57\u6362\u884C", colorpicker_title:"\u6311\u9009\u989C\u8272", colorpicker_picker_tab:"\u9009\u8272\u5668", colorpicker_picker_title:"\u9009\u8272\u5668", colorpicker_palette_tab:"\u8272\u76D8", colorpicker_palette_title:"\u8272\u76D8\u989C\u8272", colorpicker_named_tab:"\u9884\u8BBE\u7684", colorpicker_named_title:"\u9884\u8BBE\u7684\u989C\u8272", colorpicker_color:"\u989C\u8272:", colorpicker_name:"\u540D\u79F0:", charmap_title:"\u63D2\u5165\u7279\u6B8A\u7B26\u53F7", image_title:"\u63D2\u5165/\u7F16\u8F91\u56FE\u7247", image_src:"\u56FE\u7247\u4F4D\u5740", image_alt:"\u56FE\u7247\u8BF4\u660E", image_list:"\u56FE\u7247\u5217\u8868", image_border:"\u8FB9\u6846", image_dimensions:"\u5C3A\u5BF8", image_vspace:"\u5782\u76F4\u95F4\u8DDD", image_hspace:"\u6C34\u51C6\u95F4\u8DDD", image_align:"\u5BF9\u9F50\u65B9\u5F0F", image_align_baseline:"\u57FA\u7EBF", image_align_top:"\u4E0A\u65B9\u5BF9\u9F50", image_align_middle:"\u5C45\u4E2D\u5BF9\u9F50", image_align_bottom:"\u5E95\u90E8\u5BF9\u9F50", image_align_texttop:"\u6587\u5B57\u4E0A\u65B9", image_align_textbottom:"\u6587\u5B57\u4E0B\u65B9", image_align_left:"\u9760\u5DE6\u5BF9\u9F50", image_align_right:"\u9760\u53F3\u5BF9\u9F50", link_title:"\u63D2\u5165/\u7F16\u8F91\u8FDE\u7ED3", link_url:"\u94FE\u7ED3\u4F4D\u5740", link_target:"\u76EE\u6807", link_target_same:"\u5C06\u94FE\u7ED3\u7F51\u5740\u5F00\u5728\u6B64\u89C6\u7A97", link_target_blank:"\u5C06\u8FDE\u7ED3\u7F51\u5740\u5F00\u5728\u65B0\u7A97\u53E3", link_titlefield:"\u6807\u9898", link_is_email:"\u60A8\u8F93\u5165\u7684\u7F51\u5740\u5E94\u8BE5\u662F\u4E00\u4E2A\u7535\u5B50\u90AE\u5BC4\u4F4D\u5740\uFF0C\u662F\u5426\u9700\u8981\u5728\u4F4D\u5740\u524D\u65B9\u52A0\u5165mailto:\uFF1F ", link_is_external:"\u60A8\u8F93\u5165\u7684\u7F51\u5740\u5E94\u8BE5\u662F\u4E00\u4E2A\u5916\u90E8\u8FDE\u7ED3\uFF0C\u662F\u5426\u9700\u8981\u5728\u7F51\u5740\u524D\u65B9\u52A0\u5165http://\uFF1F ", link_list:"\u94FE\u7ED3\u6E05\u5355" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/se.js000066400000000000000000000037401226600447100233050ustar00rootroot00000000000000tinyMCE.addI18n('se.advanced',{ style_select:"Stilar", font_size:"Fontstorlek", fontdefault:"Fontfamilj", block:"Format", paragraph:"Paragraf", div:"Div", address:"Adress", pre:"F\u00F6rformaterad", h1:"Rubrik 1", h2:"Rubrik 2", h3:"Rubrik 3", h4:"Rubrik 4", h5:"Rubrik 5", h6:"Rubrik 6", blockquote:"Blockcitat", code:"Kodblock", samp:"Kodexempel", dt:"Definitionsterm", dd:"Definitionsbeskrivning", bold_desc:"Fet (Ctrl+B)", italic_desc:"Kursiv (Ctrl+I)", underline_desc:"Understruken (Ctrl+U)", striketrough_desc:"Genomstruken", justifyleft_desc:"V\u00E4nsterst\u00E4lld", justifycenter_desc:"Centrera", justifyright_desc:"H\u00F6gerst\u00E4lld", justifyfull_desc:"Justera", bullist_desc:"Punktlista", numlist_desc:"Nummerlista", outdent_desc:"Drag tillbaka", indent_desc:"Indrag", undo_desc:"\u00C5ngra (Ctrl+Z)", redo_desc:"G\u00F6r om (Ctrl+Y)", link_desc:"Infoga/redigera l\u00E4nk", unlink_desc:"Ta bort l\u00E4nk", image_desc:"Infoga/redigera bild", cleanup_desc:"St\u00E4da upp i k\u00E4llkoden", code_desc:"Redigera HTML k\u00E4llkoden", sub_desc:"Subscript", sup_desc:"Superscript", hr_desc:"Infoga horisontell skiljelinje", removeformat_desc:"Ta bort formatering", forecolor_desc:"V\u00E4lj textf\u00E4rg", backcolor_desc:"V\u00E4lj bakgrundsf\u00E4rg", charmap_desc:"Infoga specialtecken", visualaid_desc:"Visa/d\u00F6lj visuella hj\u00E4lpmedel", anchor_desc:"Infoga/redigera bokm\u00E4rke", cut_desc:"Klipp ut", copy_desc:"Kopiera", paste_desc:"Klistra in", image_props_desc:"Bildinst\u00E4llningar", newdocument_desc:"Nytt dokument", help_desc:"Hj\u00E4lp", blockquote_desc:"Blockcitat", clipboard_msg:"Kopiera/klipp ut/klistra in \u00E4r inte tillg\u00E4ngligt i din webbl\u00E4sare.\nVill du veta mer om detta?", path:"Element", newdocument:"\u00C4r du s\u00E4ker p\u00E5 att du vill radera allt inneh\u00E5ll?", toolbar_focus:"Hoppa till verktygsf\u00E4ltet - Alt+Q, Hoppa till redigeraren - Alt-Z, Hoppa till element listan - Alt-X" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/se_dlg.js000066400000000000000000000035551226600447100241370ustar00rootroot00000000000000tinyMCE.addI18n('se.advanced_dlg',{ about_title:"Om TinyMCE", about_general:"Om", about_help:"Hj\u00E4lp", about_license:"Licens", about_plugins:"Om plug-in", about_plugin:"Om plug-in", about_author:"Utvecklare", about_version:"Version", about_loaded:"Laddade plug-ins", anchor_title:"Infoga/redigera bokm\u00E4rke", anchor_name:"Namn", code_title:"HTML k\u00E4llkodsl\u00E4ge", code_wordwrap:"Bryt ord", colorpicker_title:"V\u00E4lj en f\u00E4rg", colorpicker_picker_tab:"V\u00E4ljare", colorpicker_picker_title:"F\u00E4rgv\u00E4ljare", colorpicker_palette_tab:"Palett", colorpicker_palette_title:"Palettf\u00E4rger", colorpicker_named_tab:"Namngivna", colorpicker_named_title:"Namngivna f\u00E4rger", colorpicker_color:"F\u00E4rg:", colorpicker_name:"Namn:", charmap_title:"V\u00E4lj ett specialtecken", image_title:"Infoga/redigera bild", image_src:"Bildens URL", image_alt:"Bildens beskrivning", image_list:"Bildlista", image_border:"Ram", image_dimensions:"Dimensioner", image_vspace:"Vertikalrymd", image_hspace:"Horisontalrymd", image_align:"Justering", image_align_baseline:"Baslinje", image_align_top:"Toppen", image_align_middle:"Mitten", image_align_bottom:"Botten", image_align_texttop:"Toppen av texten", image_align_textbottom:"Botten av texten", image_align_left:"H\u00F6ger", image_align_right:"V\u00E4nster", link_title:"Infoga/redigera l\u00E4nk", link_url:"L\u00E4nkens URL", link_target:"M\u00E5l", link_target_same:"\u00D6ppna l\u00E4nken i samma f\u00F6nster", link_target_blank:"\u00D6ppna l\u00E4nken i ett nytt f\u00F6nster", link_titlefield:"Titel", link_is_email:"L\u00E4nken du angav verkar vara en e-post adress. Vill du infoga mailto: prefixet p\u00E5 l\u00E4nken?", link_is_external:"L\u00E4nken du angav verkar vara en extern adress. Vill du infoga http:// prefixet p\u00E5 l\u00E4nken?", link_list:"L\u00E4nklista" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/si.js000066400000000000000000000124611226600447100233110ustar00rootroot00000000000000tinyMCE.addI18n('si.advanced',{ style_select:"\u0DC1\u0DDB\u0DBD\u0DD2\u0DBA", font_size:"\u0DB4\u0DB1\u0DCA\u0DAF \u0DB4\u0DCA\u200D\u0DBB\u0DB8\u0DCF\u0DAB\u0DBA", fontdefault:"\u0DB4\u0DB1\u0DCA\u0DAF \u0DC3\u0DB8\u0DD6\u0DC4\u0DBA", block:"\u0D86\u0D9A\u0DD8\u0DAD\u0DD2\u0DBA", paragraph:"\u200D\u0DA1\u0DDA\u0DAF\u0DBA", div:"Div", address:"\u0DBD\u0DD2\u0DB4\u0DD2\u0DB1\u0DBA", pre:"\u0DB4\u0DD6\u0DBB\u0DCA\u0DC0 \u0DB1\u0DD2\u0DBB\u0DCA\u0DB8\u0DCF\u0DAB\u0DBA", h1:"\u0DB8\u0DCF\u0DAD\u0DD8\u0D9A\u0DCF\u0DC0 1", h2:"\u0DB8\u0DCF\u0DAD\u0DD8\u0D9A\u0DCF\u0DC0 2", h3:"\u0DB8\u0DCF\u0DAD\u0DD8\u0D9A\u0DCF\u0DC0 3", h4:"\u0DB8\u0DCF\u0DAD\u0DD8\u0D9A\u0DCF\u0DC0 4", h5:"\u0DB8\u0DCF\u0DAD\u0DD8\u0D9A\u0DCF\u0DC0 5", h6:"\u0DB8\u0DCF\u0DAD\u0DD8\u0D9A\u0DCF\u0DC0 6", blockquote:"Blockquote", code:"\u0D9A\u0DDA\u0DAD\u0DBA", samp:"\u0D9A\u0DDA\u0DAD \u0DC3\u0DCF\u0DB8\u0DCA\u0DB4\u0DBD", dt:"\u0DB1\u0DD2\u0DBB\u0DCA\u0DC0\u0DA0\u0DB1\u0DBA ", dd:"\u0DB1\u0DD2\u0DBB\u0DCA\u0DC0\u0DA0\u0DB1 \u0DC0\u0DD2\u0DC3\u0DCA\u0DAD\u0DBB\u0DBA", bold_desc:"Bold (Ctrl+B)", italic_desc:"Italic (Ctrl+I)", underline_desc:"Underline (Ctrl+U)", striketrough_desc:"Strikethrough", justifyleft_desc:"\u0DC0\u0DB8\u0DCA \u0DB4\u0DD9\u0DC5\u0DA7 \u0D9C\u0DB1\u0DCA\u0DB1\u0DC0\u0DCF", justifycenter_desc:"\u0DB8\u0DD0\u0DAF \u0DB4\u0DD9\u0DC5\u0DA7 \u0D9C\u0DB1\u0DCA\u0DB1\u0DC0\u0DCF", justifyright_desc:"\u0DAF\u0D9A\u0DD4\u0DAB\u0DD4 \u0DB4\u0DD9\u0DC5\u0DA7 \u0D9C\u0DB1\u0DCA\u0DB1\u0DC0\u0DCF", justifyfull_desc:"\u0DB4\u0DD9\u0DC5\u0DA7 \u0D9C\u0DB1\u0DCA\u0DB1\u0DC0\u0DCF", bullist_desc:"\u0D85\u0D9A\u0DCA\u200D\u0DBB\u0DB8\u0DCF\u0DB1\u0DD4\u0D9A\u0DD6\u0DBD \u0DBD\u0DD0\u0DBA\u0DD2\u0DC3\u0DCA\u0DAD\u0DD4\u0DC0", numlist_desc:"\u0D9A\u0DCA\u200D\u0DBB\u0DB8\u0DCF\u0DB1\u0DD4\u0D9A\u0DD6\u0DBD \u0DBD\u0DD0\u0DBA\u0DD2\u0DC3\u0DCA\u0DAD\u0DD4\u0DC0", outdent_desc:"Outdent", indent_desc:"Indent", undo_desc:"\u0DB1\u0DD2\u0DC1\u0DCA\u0DB4\u0DCA\u200D\u0DBB\u0DB7 \u0D9A\u0DBB\u0DB1\u0DCA\u0DB1(Ctrl+Z)", redo_desc:"\u0DB1\u0DD0\u0DC0\u0DAD \u0D9A\u0DBB\u0DB1\u0DC0\u0DCF (Ctrl+Y)", link_desc:"\u0DC3\u0DB8\u0DCA\u0DB6\u0DB1\u0DCA\u0DB0\u0D9A\u0DBA \u0D87\u0DAD\u0DD4\u0DC5\u0DD4/\u0DC3\u0D82\u0DC3\u0DCA\u0D9A\u0DBB\u0DAB\u0DBA \u0D9A\u0DBB\u0DB1\u0DCA\u0DB1", unlink_desc:"Unlink", image_desc:"\u0D85\u0DB1\u0DD4\u0DBB\u0DD6\u0DB4\u0DBA \u0D87\u0DAD\u0DD4\u0DC5\u0DD4/\u0DC3\u0D82\u0DC3\u0DCA\u0D9A\u0DBB\u0DAB\u0DBA \u0D9A\u0DBB\u0DB1\u0DCA\u0DB1 ", cleanup_desc:"\u0DC0\u0DD0\u0DBB\u0DAF\u0DD2 \u0D9A\u0DDA\u0DAD \u0D89\u0DC0\u0DAD\u0DCA \u0D9A\u0DBB\u0DB1\u0DCA\u0DB1", code_desc:" HTML \u0DB8\u0DD6\u0DBD\u0DCF\u0DC1\u0DCA\u200D\u0DBB\u0DBA \u0DC3\u0D82\u0DC3\u0DCA\u0D9A\u0DBB\u0DAB\u0DBA \u0D9A\u0DBB\u0DB1\u0DCA\u0DB1", sub_desc:"\u0DBA\u0DA7\u0DD2\u0DBD\u0D9A\u0DD4\u0DAB\u0DD4", sup_desc:"\u0D8B\u0DA9\u0DD4\u0DBD\u0D9A\u0DD4\u0DAB", hr_desc:"\u0DAD\u0DD2\u0DBB\u0DC3\u0DCA \u0DBB\u0DD6\u0DBD \u0D87\u0DAD\u0DD4\u0DBD\u0DCA \u0D9A\u0DBB\u0DB1\u0DCA\u0DB1", removeformat_desc:"\u0D86\u0D9A\u0DD8\u0DAD\u0DD2\u0D9A\u0DBB\u0DAB\u0DBA \u0D89\u0DC0\u0DAD\u0DCA\u0D9A\u0DBB\u0DB1\u0DC0\u0DCF", custom1_desc:"\u0D94\u0DB6\u0DDA \u0DC0\u0DCA\u200D\u0DBA\u0DC0\u0DC4\u0DCF\u0DBB\u0DD2\u0D9A \u0DC0\u0DD2\u0DC3\u0DCA\u0DAD\u0DBB\u0DBA", forecolor_desc:" \u0DB4\u0DCF\u0DAA\u0DBA\u0DD9\u0DC4\u0DD2 \u0DC0\u0DBB\u0DCA\u0DAB\u0DBA \u0DAD\u0DDD\u0DBB\u0DCF\u0D9C\u0DB1\u0DCA\u0DB1\u0DC0\u0DCF", backcolor_desc:"\u0DB4\u0DC3\u0DD4\u0DB6\u0DD2\u0DB8 \u0DC0\u0DBB\u0DCA\u0DAB\u0DBA \u0DAD\u0DDD\u0DBB\u0DCF\u0D9C\u0DB1\u0DCA\u0DB1\u0DC0\u0DCF", charmap_desc:" \u0DB7\u0DCF\u0DC0\u0DD2\u0DAD \u0D85\u0D9A\u0DCA\u0DC2\u0DBB\u0DBA \u0D87\u0DAD\u0DD4\u0DBD\u0DD4 \u0D9A\u0DBB\u0DB1\u0DCA\u0DB1", visualaid_desc:"\u0DB8\u0DCF\u0DBB\u0DCA\u0D9C\u0DC3\u0DD6\u0DA0\u0D9A/\u0D85\u0DAF\u0DD8\u0DC1\u0DCA\u200D\u0DBA \u0DB8\u0DD6\u0DBD\u0DD2\u0D9A\u0DCF\u0D82\u0D9C", anchor_desc:"\u0D86\u0DB0\u0DCF\u0DBB\u0DBA \u0D87\u0DAD\u0DD4\u0DC5\u0DD4/\u0DC3\u0D82\u0DC3\u0DCA\u0D9A\u0DBB\u0DAB\u0DBA \u0D9A\u0DBB\u0DB1\u0DCA\u0DB1 ", cut_desc:"Cut", copy_desc:"\t\u0DB4\u0DD2\u0DA7\u0DB4\u0DAD\u0DCA \u0D9A\u0DBB\u0DB1\u0DCA\u0DB1", image_props_desc:"\u0D85\u0DB1\u0DD4\u0DBB\u0DD6\u0DB4\u0DD2 \u0DBD\u0D9A\u0DCA\u0DC2\u0DAB\u0DBA", newdocument_desc:"\u0DB1\u0DC0 \u0DBD\u0DDA\u0D9B\u0DB1\u0DBA", help_desc:"\u0D8B\u0DB4\u0D9A\u0DCF\u0DBB\u0DBA", blockquote_desc:"Blockquote", clipboard_msg:"\u0DB4\u0DD2\u0DA7\u0DB4\u0DAD\u0DCA \u0D9A\u0DD2\u0DBB\u0DD3\u0DB8/\u0D89\u0DC0\u0DAD\u0DCA \u0D9A\u0DD2\u0DBB\u0DD3\u0DB8/\u0D87\u0DBD\u0DC0\u0DD3\u0DB8 \u0DB8\u0DDC\u0DC3\u0DD2\u0DBD\u0DCA\u0DBD\u0DCF \u0DC4\u0DCF \u0DC6\u0DBA\u0DBB\u0DCA \u0DC6\u0DDC\u0D9A\u0DCA\u0DC3\u0DCA \u0DC4\u0DD2 \u0D87\u0DAD\u0DD4\u0DC5\u0DAD\u0DCA \u0DB1\u0DDC\u0DC0\u0DDA.\r\n\u0D94\u0DB6\u0DA7 \u0DB8\u0DDA \u0DB4\u0DD2\u0DC5\u0DD2\u0DB6\u0DB3\u0DC0 \u0DAD\u0DA0\u0DAF\u0DD4\u0DBB\u0DA7\u0DAD\u0DCA \u0DAD\u0DDC\u0DBB\u0DAD\u0DD4\u0DBB\u0DD4 \u0D85\u0DC0\u0DC1\u0DCA\u200D\u0DBA \u0DC0\u0DDA\u0DAF?", path:"\u0DB8\u0D9F", newdocument:"\u0D94\u0DB6\u0DA7 \u0DB8\u0DD9\u0DB8 \u0D85\u0DB1\u0DCA\u0DAD\u0DBB\u0DCA\u0D9C\u0DAD\u0DBA \u0DB8\u0D9A\u0DCF \u0DAF\u0DD0\u0DB8\u0DD3\u0DB8\u0DA7 \u0D85\u0DC0\u0DC1\u0DCA\u200D\u0DBA \u0DB8 \u0DAF?", toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X", more_colors:"\u0DAD\u0DC0\u0DAD\u0DCA \u0DC0\u0DBB\u0DCA\u0DAB" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/si_dlg.js000066400000000000000000000106461226600447100241420ustar00rootroot00000000000000tinyMCE.addI18n('si.advanced_dlg',{ about_title:" TinyMCE \u0DB4\u0DD2\u0DC5\u0DD2\u0DB6\u0DB3", about_general:"\u0DC3\u0DC0\u0DD2\u0DC3\u0DCA\u0DAD\u0DBB\u0DCF\u0DAD\u0DCA\u0DB8\u0D9A\u0DC0", about_help:"\u0D8B\u0DB4\u0D9A\u0DCF\u0DBB\u0DBA", about_license:"\u0DB6\u0DBD\u0DB4\u0DAD\u0DCA\u200D\u0DBB\u0DBA", about_plugins:"Plugins", about_plugin:"Plugin", about_author:"\u0D9A\u0DAD\u0DD8", about_version:"\u0DC3\u0D82\u0DC3\u0DCA\u0D9A\u0DBB\u0DAB\u0DBA", about_loaded:"Loaded plugins", anchor_title:"\u0D86\u0DB0\u0DCF\u0DBB\u0DBA \u0D87\u0DAD\u0DD4\u0DC5\u0DD4/\u0DC3\u0D82\u0DC3\u0DCA\u0D9A\u0DBB\u0DAB\u0DBA \u0D9A\u0DBB\u0DB1\u0DCA\u0DB1", anchor_name:"\u0D86\u0DB0\u0DCF\u0DBB\u0D9A \u0DB1\u0DCF\u0DB8\u0DBA", code_title:"HTML \u0D9A\u0DDA\u0DAD \u0DC3\u0D82\u0DC3\u0DCA\u0D9A\u0DCF\u0DBB\u0D9A\u0DBA", code_wordwrap:"\u0DC0\u0DCF\u0D9C\u0DCA \u0DC0\u0DD9\u0DBD\u0DD4\u0DB8", colorpicker_title:"\u0DC0\u0DBB\u0DCA\u0DAB\u0DBA \u0DAD\u0DDD\u0DBB\u0DB1\u0DCA\u0DB1", colorpicker_picker_tab:"\t\u0D87\u0DC4\u0DD4\u0DC5\u0DD4\u0DB8\u0DCA \u0D9A\u0DD6\u0DBB ", colorpicker_picker_title:"\u0DC0\u0DBB\u0DCA\u0DAB \u0D87\u0DC4\u0DD4\u0DC5\u0DD4\u0DB8\u0DCA \u0D9A\u0DD6\u0DBB", colorpicker_palette_tab:"\t\u0DC0\u0DBB\u0DCA\u0DAB \u0D91\u0DBD\u0D9A\u0DBA", colorpicker_palette_title:"\t\u0DC0\u0DBB\u0DCA\u0DAB \u0D91\u0DBD\u0D9A \u0DC0\u0DBB\u0DCA\u0DAB", colorpicker_named_tab:"\u0DB1\u0DB8\u0DD0\u0DAD\u0DD2", colorpicker_named_title:"\u0DB1\u0DB8\u0DD0\u0DAD\u0DD2 \u0DC0\u0DBB\u0DCA\u0DAB", colorpicker_color:"\u0DC0\u0DBB\u0DCA\u0DAB:", colorpicker_name:"\u0DB1\u0DCF\u0DB8\u0DBA", charmap_title:"\u0DB7\u0DCF\u0DC0\u0DD2\u0DAD\u0DCF\u0DC0\u0DB1 \u0D9C\u0DD4\u0DAB\u0DCF\u0D82\u0D9C\u0DBA \u0DAD\u0DDD\u0DBB\u0DB1\u0DCA\u0DB1", image_title:"\u0D85\u0DB1\u0DD4\u0DBB\u0DD6\u0DB4\u0DBA\u0DD9\u0DC4\u0DD2 \u0D87\u0DAD\u0DD4\u0DC5\u0DD4/\u0DC3\u0D82\u0DC3\u0DCA\u0D9A\u0DBB\u0DAB\u0DBA \u0D9A\u0DBB\u0DB1\u0DCA\u0DB1", image_src:"\u0D85\u0DB1\u0DD4\u0DBB\u0DD6\u0DB4\u0DBA\u0DD9\u0DC4\u0DD2 URL", image_alt:"\u0D85\u0DB1\u0DD4\u0DBB\u0DD6\u0DB4\u0DBA\u0DD9\u0DC4\u0DD2 \u0DC0\u0DD2\u0DC3\u0DCA\u0DAD\u0DBB", image_list:"\u0D85\u0DB1\u0DD4\u0DBB\u0DD6\u0DB4 \u0DBD\u0DD0\u0DBA\u0DD2\u0DC3\u0DCA\u0DAD\u0DD4\u0DC0", image_border:"\u0DB6\u0DDD\u0DA9\u0DBB\u0DBA", image_dimensions:"\u0DB8\u0DCF\u0DB1", image_vspace:"\u0DC3\u0DD2\u0DBB\u0DC3\u0DCA \u0D85\u0DC0\u0D9A\u0DCF\u0DC1\u0DBA", image_hspace:"\u0DAD\u0DD2\u0DBB\u0DC3\u0DCA \u0D85\u0DC0\u0D9A\u0DCF\u0DC1\u0DBA", image_align:"\u0DB4\u0DD9\u0DBD \u0D9C\u0DD0\u0DB1\u0DCA\u0DC0\u0DD4\u0DB8", image_align_baseline:"\u0DB8\u0DD6\u0DBD\u0DD2\u0D9A\u0DBA", image_align_top:"\u0D89\u0DC4\u0DC5", image_align_middle:"\u0DB8\u0DD0\u0DAF", image_align_bottom:"\u0DBA\u0DA7", image_align_texttop:"\u0DB4\u0DCF\u0DA8\u0DBA \u0D89\u0DC4\u0DC5", image_align_textbottom:"\u0DB4\u0DCF\u0DA8\u0DBA \u0DB4\u0DC4\u0DC5", image_align_left:"\u0DC0\u0DB8\u0DA7", image_align_right:"\u0DAF\u0D9A\u0DD4\u0DAB\u0DA7", link_title:"\u0D87\u0DB8\u0DD4\u0DB1\u0DD4\u0DB8 \u0D87\u0DAD\u0DD4\u0DC5\u0DD4/\u0DC3\u0D82\u0DC3\u0DCA\u0D9A\u0DBB\u0DAB\u0DBA \u0D9A\u0DBB\u0DB1\u0DCA\u0DB1", link_url:"\u0D87\u0DB8\u0DD4\u0DB1\u0DD4\u0DB8 URL", link_target:"\u0D89\u0DBD\u0D9A\u0DCA\u0D9A\u0DBA", link_target_same:"\u0D87\u0DB8\u0DD4\u0DB1\u0DD4\u0DB8 \u0DC0\u0DD9\u0DB1\u0DB8 \u0D9A\u0DC0\u0DD4\u0DBD\u0DD4\u0DC0\u0D9A \u0DC0\u0DD2\u0DC0\u0DD8\u0DAD \u0D9A\u0DBB\u0DB1\u0DCA\u0DB1", link_target_blank:"\u0D87\u0DB8\u0DD4\u0DB1\u0DD4\u0DB8 \u0DC0\u0DD9\u0DB1\u0DB8 \u0D9A\u0DC0\u0DD4\u0DBD\u0DD4\u0DC0\u0D9A \u0DC0\u0DD2\u0DC0\u0DD8\u0DAD \u0D9A\u0DBB\u0DB1\u0DCA\u0DB1", link_titlefield:"\u0DB8\u0DCF\u0DAD\u0DD8\u0D9A\u0DCF\u0DC0", link_is_email:"\u0D94\u0DB6 \u0D87\u0DAD\u0DD4\u0DC5\u0DAD\u0DCA \u0D9A\u0DC5 URL \u0DBA \u0DC0\u0DD2\u0DAF\u0DCA\u200D\u0DBA\u0DD4\u0DAD\u0DCA \u0DAD\u0DD0\u0DB4\u0DD0\u0DBD \u0D9A\u0DCA \u0DB1\u0DB8\u0DCA \u0D94\u0DB6\u0DA7 \u0D91\u0DBA\u0DA7 \u0DB4\u0DCA\u200D\u0DBB\u0DC0\u0DDA\u0DC1 \u0DC0\u0DD3\u0DB8\u0DA7 \u0D85\u0DC0\u0DC1\u0DCA\u200D\u0DBA \u0DAF?", link_is_external:"\u0D94\u0DB6 \u0D87\u0DAD\u0DD4\u0DC5\u0DAD\u0DCA \u0D9A\u0DC5 URL \u0DBA \u0DB6\u0DCF\u0DC4\u0DD2\u0DBB \u0D87\u0DB8\u0DD2\u0DAB\u0DD4\u0DB8\u0D9A\u0DCA \u0DB1\u0DB8\u0DCA,\u0D94\u0DB6\u0DA7 \u0D91\u0DBA\u0DA7 \u0DB4\u0DCA\u200D\u0DBB\u0DC0\u0DDA\u0DC1 \u0DC0\u0DD3\u0DB8\u0DA7 \u0D85\u0DC0\u0DC1\u0DCA\u200D\u0DBA \u0DAF??", link_list:"\u0D87\u0DB8\u0DD4\u0DAB\u0DD4\u0DB8\u0DCA \u0DBD\u0DBA\u0DD2\u0DC3\u0DCA\u0DAD\u0DD4\u0DC0" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/sk.js000066400000000000000000000051321226600447100233100ustar00rootroot00000000000000tinyMCE.addI18n('sk.advanced',{ style_select:"- \u0160t\u00FDly -", font_size:"- Ve\u013Ekos\u0165 p\u00EDsma -", fontdefault:"- Typ p\u00EDsma -", block:"- Form\u00E1t -", paragraph:"Odstavec [p]", div:"Div", address:"Adresa [address]", pre:"Predform\u00E1t [pre]", h1:"Nadpis 1 [h1]", h2:"Nadpis 2 [h2]", h3:"Nadpis 3 [h3]", h4:"Nadpis 4 [h4]", h5:"Nadpis 5 [h5]", h6:"Nadpis 6 [h6]", blockquote:"Odsadenie", code:"K\u00F3d", samp:"Uk\u00E1\u017Eka k\u00F3du", dt:"Defin\u00EDcia podmienky", dd:"Defin\u00EDcia popisu", bold_desc:"Tu\u010Dn\u00FD text (Ctrl+B)", italic_desc:"\u0160ikm\u00FD text (kurziv\u00E1) (Ctrl+I)", underline_desc:"Pod\u010Diarknut\u00FD text (Ctrl+U)", striketrough_desc:"Pre\u0161krtnut\u00FD text", justifyleft_desc:"Zarovna\u0165 v\u013Eavo", justifycenter_desc:"Zarovna\u0165 na stred", justifyright_desc:"Zarovna\u0165 vpravo", justifyfull_desc:"Zarovna\u0165 do bloku", bullist_desc:"Zoznam s odr\u00E1\u017Ekami", numlist_desc:"\u010C\u00EDslovan\u00FD zoznam", outdent_desc:"Zmen\u0161i\u0165 odsadenie", indent_desc:"Zv\u00E4\u010D\u0161i\u0165 odsadenie", undo_desc:"Sp\u00E4\u0165 (Ctrl+Z)", redo_desc:"Znovu (Ctrl+Y)", link_desc:"Vlo\u017Ei\u0165/upravi\u0165 odkaz", unlink_desc:"Zru\u0161i\u0165 odkaz", image_desc:"Vlo\u017Ei\u0165/upravi\u0165 obr\u00E1zok", cleanup_desc:"Vy\u010Disti\u0165 neusporiadan\u00FD k\u00F3d", code_desc:"Zobrazi\u0165 HTML zdroj", sub_desc:"Doln\u00FD index", sup_desc:"Horn\u00FD index", hr_desc:"Vlo\u017Ei\u0165 vodorovn\u00FD odde\u013Eova\u010D", removeformat_desc:"Odstr\u00E1ni\u0165 form\u00E1tovanie", custom1_desc:"\u013Dubovoln\u00FD popisok", forecolor_desc:"Vlastn\u00E1 farba textu", backcolor_desc:"Vlastn\u00E1 farba pozadia", charmap_desc:"Vlo\u017Ei\u0165 vlastn\u00FD znak", visualaid_desc:"Zobrazi\u0165 pomocn\u00E9/skryt\u00E9 prvky", anchor_desc:"Vlo\u017Ei\u0165/upravi\u0165 n\u00E1zov kotvy", cut_desc:"Vystrihn\u00FA\u0165", copy_desc:"Kop\u00EDrova\u0165", paste_desc:"Vlo\u017Ei\u0165", image_props_desc:"Vlastnosti obr\u00E1zka", newdocument_desc:"Nov\u00FD dokument", help_desc:"N\u00E1poveda", blockquote_desc:"Citovan\u00FD text", clipboard_msg:"Funkcie kop\u00EDrova\u0165/vysrihn\u00FA\u0165/vlo\u017Ei\u0165 nie su podporovan\u00E9 prehliada\u010Dmi Mozilla a Firefox. \r\nChcete viac inform\u00E1ci\u00ED o tomto probl\u00E9me?", path:"Cesta", newdocument:"Naozaj chcete vy\u010Disti\u0165 v\u0161etok obsah?", toolbar_focus:"Prechod na n\u00E1strojov\u00E9 tla\u010Didl\u00E1 - Alt+Q, prechod k editoru - Alt-Z, prechod na cestu elementov - Alt-X", more_colors:"Viac farieb" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/sk_dlg.js000066400000000000000000000037421226600447100241430ustar00rootroot00000000000000tinyMCE.addI18n('sk.advanced_dlg',{ about_title:"O TinyMCE", about_general:"O Programe", about_help:"N\u00E1poveda", about_license:"Licencia", about_plugins:"Pluginy", about_plugin:"Plugin", about_author:"Autor", about_version:"Verzia", about_loaded:"Na\u010D\u00EDtan\u00E9 pluginy", anchor_title:"Vlo\u017Ei\u0165/upravi\u0165 n\u00E1zov kotvy", anchor_name:"N\u00E1zov kotvy", code_title:"Editor HTML", code_wordwrap:"Zalamova\u0165 riadky", colorpicker_title:"V\u00FDber farby", colorpicker_picker_tab:"Mie\u0161a\u010D", colorpicker_picker_title:"Mie\u0161a\u010D farieb", colorpicker_palette_tab:"Paleta", colorpicker_palette_title:"Paleta farieb", colorpicker_named_tab:"N\u00E1zvoslovia", colorpicker_named_title:"N\u00E1zvy farieb", colorpicker_color:"Farba:", colorpicker_name:"N\u00E1zov:", charmap_title:"V\u00FDber \u0161peci\u00E1lneho znaku", image_title:"Vlo\u017Ei\u0165/upravi\u0165 obr\u00E1zok", image_src:"URL obr\u00E1zka", image_alt:"Popis obr\u00E1zka", image_list:"Zoznam obr\u00E1zkov", image_border:"Okraj", image_dimensions:"Rozmery", image_vspace:"Vertik\u00E1lna medzera", image_hspace:"Horizont\u00E1lna medzera", image_align:"Usporiadanie", image_align_baseline:"Z\u00E1klad\u0148a", image_align_top:"Hore", image_align_middle:"Uprostred", image_align_bottom:"Dolu", image_align_texttop:"Text hore", image_align_textbottom:"Text dolu", image_align_left:"V\u013Eavo", image_align_right:"Vpravo", link_title:"Vlo\u017Ei\u0165/upravi\u0165 odkaz", link_url:"URL odkazu", link_target:"Cie\u013E odkazu", link_target_same:"Otvori\u0165 odkaz v rovnakom okne", link_target_blank:"Otvori\u0165 odkaz v novom okne", link_titlefield:"N\u00E1zov", link_is_email:"Zd\u00E1 sa, \u017Ee zadan\u00E1 URL je e-mailov\u00E1 adresa. Chcete vlo\u017Ei\u0165 povinn\u00FD prefix mailto: ?", link_is_external:"Zd\u00E1 sa, \u017Ee zadan\u00E1 URL je extern\u00FD odkaz. Chcete vlo\u017Ei\u0165 povinn\u00FD prefix http:// ?", link_list:"Zoznam odkazov" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/sl.js000066400000000000000000000037451226600447100233210ustar00rootroot00000000000000tinyMCE.addI18n('sl.advanced',{ style_select:"Izberite slog", font_size:"Velikost pisave", fontdefault:"Dru\u017Eina pisave", block:"oblika", paragraph:"odstavek", div:"blok", address:"naslov", pre:"predoblikovano", h1:"naslov 1", h2:"naslov 2", h3:"naslov 3", h4:"naslov 4", h5:"naslov 5", h6:"naslov 6", blockquote:"citat", code:"koda", samp:"kodni zgled", dt:"definicija - izraz", dd:"definicija - opis", bold_desc:"Krepko (Ctrl+B)", italic_desc:"Po\u0161evno (Ctrl+I)", underline_desc:"Pod\u010Drtano (Ctrl+U)", striketrough_desc:"Pre\u010Drtano", justifyleft_desc:"Poravnava levo", justifycenter_desc:"Poravnava na sredino", justifyright_desc:"Poravnava desno", justifyfull_desc:"Polna poravnava", bullist_desc:"Alineje", numlist_desc:"Na\u0161tevanje", outdent_desc:"Zamakni", indent_desc:"Odmakni ven", undo_desc:"Razveljavi (Ctrl+Z)", redo_desc:"Uveljavi (Ctrl+Y)", link_desc:"Vstavi/uredi povezavo", unlink_desc:"Odstrani povezavo", image_desc:"Vstavi/uredi sliko", cleanup_desc:"Pre\u010Disti kodo", code_desc:"Uredi kodo HTML", sub_desc:"Podpisano", sup_desc:"Nadpisano", hr_desc:"Vstavi \u010Drto", removeformat_desc:"Odstrani oblikovanje", custom1_desc:"Opis tule", forecolor_desc:"Izberite barvo pisave", backcolor_desc:"Izberite barvo ozadja", charmap_desc:"Vstavi posebni znak", visualaid_desc:"Preklop prikaza vodil", anchor_desc:"Vstavi/uredi sidro", cut_desc:"Izre\u017Ei", copy_desc:"Kopiraj", paste_desc:"Prilepi", image_props_desc:"Lastnosti slike", newdocument_desc:"Nov dokument", help_desc:"Pomo\u010D", blockquote_desc:"Citat", clipboard_msg:"Delo z odlo\u017Ei\u0161\u010Dem ni mogo\u010De v tem brskalniku. Lahko uporabljate kombinacije tipk Ctrl+X, Ctrl+C, Ctrl+V.\n\u017Delite ve\u010D informacij o tem?", path:"Pot", newdocument:"Ste prepri\u010Dani, da \u017Eelite odstraniti vsebino?", toolbar_focus:"Preskok na orodjarno - Alt+Q, Preskok v urejevalnik - Alt-Z, Preskok na pot elementa - Alt-X", more_colors:"Ve\u010D barv" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/sl_dlg.js000066400000000000000000000034271226600447100241440ustar00rootroot00000000000000tinyMCE.addI18n('sl.advanced_dlg',{ about_title:"O TinyMCE", about_general:"Vizitka", about_help:"Pomo\u010D", about_license:"Licenca", about_plugins:"Vsadki", about_plugin:"Vsadek", about_author:"Avtor", about_version:"Verzija", about_loaded:"Nalo\u017Eeni vsadki", anchor_title:"Vstavi/uredi sidro", anchor_name:"Ime sidra", code_title:"Urejevalnik kode HTML", code_wordwrap:"Prelomi vrstice", colorpicker_title:"Izberite barvo", colorpicker_picker_tab:"Izbor", colorpicker_picker_title:"Izbor barve", colorpicker_palette_tab:"Paleta", colorpicker_palette_title:"Barve palete", colorpicker_named_tab:"Poimenovane", colorpicker_named_title:"Poimenovane barve", colorpicker_color:"Barva:", colorpicker_name:"Ime:", charmap_title:"Izberite posebni znak", image_title:"Vstavi/uredi sliko", image_src:"Naslov URL slike", image_alt:"Opis slike", image_list:"Seznam slik", image_border:"Obroba", image_dimensions:"Dimenzije", image_vspace:"Prostor zg/sp", image_hspace:"Prostor le/de", image_align:"Poravnava", image_align_baseline:"osnovna \u010Drta", image_align_top:"vrh", image_align_middle:"sredina", image_align_bottom:"dno", image_align_texttop:"vrh besedila", image_align_textbottom:"dno besedila", image_align_left:"levo, plavajo\u010De", image_align_right:"desno, plavajo\u010De", link_title:"Vstavi/uredi povezavo", link_url:"Naslov URL", link_target:"Ime cilja", link_target_same:"odpri povezavo v istem oknu", link_target_blank:"odpri povezavo v novem oknu", link_titlefield:"Naslov", link_is_email:"Vneseni naslov verjetno prestavlja e-naslov, \u017Eelite da dodam zahtevano predpono \'mailto:\'?", link_is_external:"Vneseni naslov verjetno predstavlja zunanjo povezavo, \u017Eelite da dodam zahtevano predpono \'http://\'?", link_list:"Seznam povezav" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/sq.js000066400000000000000000000043031226600447100233150ustar00rootroot00000000000000tinyMCE.addI18n('sq.advanced',{ style_select:"Stilet", font_size:"Madh\u00EBsia e tekstit", fontdefault:"Familja e tekstit", block:"Formati", paragraph:"Paragraf", div:"Div", address:"Adres\u00EB", pre:"Para formatuar", h1:"Kok\u00EB 1", h2:"Kok\u00EB 2", h3:"Kok\u00EB 3", h4:"Kok\u00EB 4", h5:"Kok\u00EB 5", h6:"Kok\u00EB 6", blockquote:"Bllok", code:"Kod", samp:"Shembull kodi", dt:"Terma e p\u00EBrcaktimit ", dd:"P\u00EBrshkrimi i p\u00EBrcaktimit", bold_desc:"I Trash\u00EB (Ctrl+B)", italic_desc:"I Pjerr\u00EBt (Ctrl+I)", underline_desc:"I N\u00EBnvizuar (Ctrl+U)", striketrough_desc:"Vij\u00EB n\u00EB mes", justifyleft_desc:"Drejtimi majtas", justifycenter_desc:"Drejtimi qend\u00EBr", justifyright_desc:"Drejtimi djathtas", justifyfull_desc:"Drejtim i plot\u00EB", bullist_desc:"List\u00EB e parregullt", numlist_desc:"List\u00EB e rregullt", outdent_desc:"Hiq kryerradh\u00EB", indent_desc:"Vendos kryerradh\u00EB", undo_desc:"\u00C7b\u00EBj (Ctrl+Z)", redo_desc:"Rib\u00EBj (Ctrl+Y)", link_desc:"Fut/edito lidhje", unlink_desc:"Hiq lidhje", image_desc:"Fut/edito foto", cleanup_desc:"Pastro kodin", code_desc:"Edito kodin HTML", sub_desc:"N\u00EBn shkrim", sup_desc:"Mbi shkrim", hr_desc:"Fut linj\u00EB horizontale", removeformat_desc:"Fshi formatimin", custom1_desc:"P\u00EBshkrimi i personalizuar k\u00EBtu", forecolor_desc:"Zgjidh ngjyr\u00EBn e tekstit", backcolor_desc:"Zgjidh ngjyr\u00EBn e fush\u00EBs", charmap_desc:"Fut karakter t\u00EB personalizuar", visualaid_desc:"Shfaq/Fshih vijat ndihm\u00EBse dhe element\u00EBt e paduksh\u00EBm", anchor_desc:"Fut/edito lidhje", cut_desc:"Prit", copy_desc:"Kopjo", paste_desc:"Ngjit", image_props_desc:"Opsionet e fotos", newdocument_desc:"Dokument i Ri", help_desc:"Ndihm\u00EB", blockquote_desc:"Bllok", clipboard_msg:"Kopja/Prerja/Ngjitja nuk suportohen n\u00EB Mozilla dhe Firefox.\nD\u00EBshironi m\u00EB shum\u00EB informacione p\u00EBr k\u00EBt\u00EB \u00E7\u00EBshtje?", path:"Rruga", newdocument:"Jeni t\u00EB sigurt q\u00EB doni t'a fshini p\u00EBrmbajtjen?", toolbar_focus:"Shko tek butonat - Alt+Q, Shko tek editori - Alt+Z, Shko tek rruga e elementit - Alt+X", more_colors:"M\u00EB shum\u00EB ngjyra" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/sq_dlg.js000066400000000000000000000036711226600447100241520ustar00rootroot00000000000000tinyMCE.addI18n('sq.advanced_dlg',{ about_title:"Rreth TinyMCE", about_general:"Rreth", about_help:"Ndihm\u00EB", about_license:"Li\u00E7enca", about_plugins:"Shtesa", about_plugin:"Shtes\u00EB", about_author:"Autori", about_version:"Versioni", about_loaded:"Shtesa t\u00EB ngarkuara", anchor_title:"Fut/edito lidhje", anchor_name:"Emri i lidhjes", code_title:"Edituesi i kodit HTML", code_wordwrap:"Word wrap", colorpicker_title:"Zgjidh nj\u00EB ngjyr\u00EB", colorpicker_picker_tab:"Zgjedh\u00EBsi", colorpicker_picker_title:"Zgjedh\u00EBsi i ngjyr\u00EBs", colorpicker_palette_tab:"Librari", colorpicker_palette_title:"Ngjyrat e Libraris\u00EB", colorpicker_named_tab:"Em\u00EBruar", colorpicker_named_title:"Ngjyrat e em\u00EBruara", colorpicker_color:"Ngjyra:", colorpicker_name:"Emri:", charmap_title:"Zgjidh karakter t\u00EB personalizuar", image_title:"Fut/edio foto", image_src:"URL e fotos", image_alt:"P\u00EBrshkrimi i fotos", image_list:"Lista e fotove", image_border:"Korniza", image_dimensions:"P\u00EBrmasat", image_vspace:"Hap\u00EBsira Vertikale", image_hspace:"Hap\u00EBsira Horizontale", image_align:"Drejtimi", image_align_baseline:"Vij\u00EB fundore", image_align_top:"Krye", image_align_middle:"Mes", image_align_bottom:"Fund", image_align_texttop:"N\u00EB krye t\u00EB tekstit", image_align_textbottom:"N\u00EB fund t\u00EB tekstit", image_align_left:"Majtas", image_align_right:"Djathtas", link_title:"Fut/edito lidhje", link_url:"URL e lidhjes", link_target:"Sh\u00EBnjestra", link_target_same:"Hape lidhjen n\u00EB t\u00EB nj\u00EBjt\u00EBn dritare", link_target_blank:"Hape lidhjen n\u00EB dritare t\u00EB re", link_titlefield:"Titulli", link_is_email:"Lidhja q\u00EB keni futur duket si adres\u00EB emaili. Doni t\u00EB shtoni prefiksin mailto:?", link_is_external:"Lidhja q\u00EB keni futur duket si lidhje e jasht\u00EBme. Doni t\u00EB shtoni prefiksin http://?", link_list:"Lista e lidhjeve" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/sr.js000066400000000000000000000036631226600447100233260ustar00rootroot00000000000000tinyMCE.addI18n('sr.advanced',{ style_select:"Stilovi", font_size:"Veli\u010Dina pisma", fontdefault:"Vrsta pisma", block:"Format", paragraph:"Paragraf", div:"Div", address:"Adresa", pre:"Oblikovano", h1:"Naslov 1", h2:"Naslov 2", h3:"Naslov 3", h4:"Naslov 4", h5:"Naslov 5", h6:"Naslov 6", blockquote:"Citat", code:"Kod", samp:"Primjer koda", dt:"Definicija pojma", dd:"Opis definicije", bold_desc:"Podebljaj (Ctrl+B)", italic_desc:"Iskosi (Ctrl+I)", underline_desc:"Podcrtaj (Ctrl+U)", striketrough_desc:"Precrtaj", justifyleft_desc:"Poravnaj levo", justifycenter_desc:"Centriraj", justifyright_desc:"Poravnaj desno", justifyfull_desc:"Poravnaj potpuno", bullist_desc:"Neure\u0111ena lista", numlist_desc:"Ure\u0111ena lista", outdent_desc:"Uvuci", indent_desc:"Izvuci", undo_desc:"Poni\u0161ti (Ctrl+Z)", redo_desc:"Ponovi (Ctrl+Y)", link_desc:"Ubaci/promijeni link", unlink_desc:"Poni\u0161ti link", image_desc:"Umetni/uredi sliku", cleanup_desc:"Po\u010Disti kod", code_desc:"Uredi HTML izvor", sub_desc:"Indeks", sup_desc:"Eksponent", hr_desc:"Umetni vodoravnu crtu", removeformat_desc:"Poni\u0161ti oblikovanje", custom1_desc:"Vlastiti opis ovdje", forecolor_desc:"Odaberite boju teksta", backcolor_desc:"Odaberite boju pozadine", charmap_desc:"Umetni vlastiti znak", visualaid_desc:"Vodilice/nevidljivi elementi", anchor_desc:"Umetni/uredi sidro", cut_desc:"Izre\u017Ei", copy_desc:"Kopiraj", paste_desc:"Zalepi", image_props_desc:"Svojstva slike", newdocument_desc:"Novi dokument", help_desc:"Pomo\u0107", blockquote_desc:"Citiraj", clipboard_msg:"Kopiraj/Izre\u017Ei/Zalepi nije dostupno u Mozilla i Firefox preglednicima. Vi\u0161e informacija?", path:"Staza", newdocument:"Jeste li sigurni da \u017Eelite izbrisati celi sadr\u017Eaj?", toolbar_focus:"Pre\u0111i na alatnu traku - Alt+Q, pre\u0111i na ure\u0111iva\u010D - Alt-Z, pre\u0111i na element path - Alt-X", more_colors:"Vi\u0161e boja" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/sr_dlg.js000066400000000000000000000033121226600447100241430ustar00rootroot00000000000000tinyMCE.addI18n('sr.advanced_dlg',{ about_title:"TinyMCE", about_general:"O programu", about_help:"Pomo\u0107", about_license:"Licenca", about_plugins:"Dodaci", about_plugin:"Dodatak", about_author:"Autor", about_version:"Verzija", about_loaded:"Postoje\u0107i dodaci", anchor_title:"Umetni/uredi sidro", anchor_name:"Ime sidra", code_title:"HTML ure\u0111iva\u010D", code_wordwrap:"Omatanje teksta", colorpicker_title:"Izbor boje", colorpicker_picker_tab:"Odabir", colorpicker_picker_title:"Odabir boje", colorpicker_palette_tab:"Paleta", colorpicker_palette_title:"Paleta boja", colorpicker_named_tab:"Imenovano", colorpicker_named_title:"Imenovane boje", colorpicker_color:"Boja:", colorpicker_name:"Naziv:", charmap_title:"Odaberite znak", image_title:"Umetni/uredi sliku", image_src:"URL slike", image_alt:"Opis slike", image_list:"Lista slika", image_border:"Obrub", image_dimensions:"Dimenzije", image_vspace:"Okomiti razmak", image_hspace:"Vodoravni razmak", image_align:"Poravnavanje", image_align_baseline:"Osnovna linija", image_align_top:"Vrh", image_align_middle:"Sredina", image_align_bottom:"Dno", image_align_texttop:"Vrh teksta", image_align_textbottom:"Dno teksta", image_align_left:"Levo", image_align_right:"Desno", link_title:"Ubaci/promijeni link", link_url:"URL link", link_target:"Meta", link_target_same:"Otvori link u istom prozoru", link_target_blank:"Otvori link u novom prozoru", link_titlefield:"Naslov", link_is_email:"URL koji ste uneli izgleda kao e-mail adresa, \u017Eelite li dodati potrebni mailto: prefiks?", link_is_external:"URL koji ste uneli izgleda kao vanjski link, \u017Eelite li dodati potrebni http:// prefiks?", link_list:"Lista linkova" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/sv.js000066400000000000000000000037351226600447100233320ustar00rootroot00000000000000tinyMCE.addI18n('sv.advanced',{ style_select:"Stilar", font_size:"Fontstorlek", fontdefault:"Fontfamilj", block:"Format", paragraph:"Stycke", div:"Div", address:"Adress", pre:"F\u00F6rformaterad", h1:"Rubrik 1", h2:"Rubrik 2", h3:"Rubrik 3", h4:"Rubrik 4", h5:"Rubrik 5", h6:"Rubrik 6", blockquote:"Blockcitat", code:"Kodblock", samp:"Kodexempel", dt:"Definitionsterm", dd:"Definitionsbeskrivning", bold_desc:"Fet (Ctrl+B)", italic_desc:"Kursiv (Ctrl+I)", underline_desc:"Understruken (Ctrl+U)", striketrough_desc:"Genomstruken", justifyleft_desc:"V\u00E4nsterst\u00E4lld", justifycenter_desc:"Centrera", justifyright_desc:"H\u00F6gerst\u00E4lld", justifyfull_desc:"Justera", bullist_desc:"Punktlista", numlist_desc:"Nummerlista", outdent_desc:"Drag tillbaka", indent_desc:"Indrag", undo_desc:"\u00C5ngra (Ctrl+Z)", redo_desc:"G\u00F6r om (Ctrl+Y)", link_desc:"Infoga/redigera l\u00E4nk", unlink_desc:"Ta bort l\u00E4nk", image_desc:"Infoga/redigera bild", cleanup_desc:"St\u00E4da upp i k\u00E4llkoden", code_desc:"Redigera HTML k\u00E4llkoden", sub_desc:"Subscript", sup_desc:"Superscript", hr_desc:"Infoga horisontell skiljelinje", removeformat_desc:"Ta bort formatering", forecolor_desc:"V\u00E4lj textf\u00E4rg", backcolor_desc:"V\u00E4lj bakgrundsf\u00E4rg", charmap_desc:"Infoga specialtecken", visualaid_desc:"Visa/d\u00F6lj visuella hj\u00E4lpmedel", anchor_desc:"Infoga/redigera bokm\u00E4rke", cut_desc:"Klipp ut", copy_desc:"Kopiera", paste_desc:"Klistra in", image_props_desc:"Bildinst\u00E4llningar", newdocument_desc:"Nytt dokument", help_desc:"Hj\u00E4lp", blockquote_desc:"Blockcitat", clipboard_msg:"Kopiera/klipp ut/klistra in \u00E4r inte tillg\u00E4ngligt i din webbl\u00E4sare.\nVill du veta mer om detta?", path:"Element", newdocument:"\u00C4r du s\u00E4ker p\u00E5 att du vill radera allt inneh\u00E5ll?", toolbar_focus:"Hoppa till verktygsf\u00E4ltet - Alt+Q, Hoppa till redigeraren - Alt-Z, Hoppa till elementlistan - Alt-X" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/sv_dlg.js000066400000000000000000000035711226600447100241560ustar00rootroot00000000000000tinyMCE.addI18n('sv.advanced_dlg',{ about_title:"Om TinyMCE", about_general:"Om", about_help:"Hj\u00E4lp", about_license:"Licens", about_plugins:"Om plug-in", about_plugin:"Om plug-in", about_author:"Utvecklare", about_version:"Version", about_loaded:"Laddade plug-ins", anchor_title:"Infoga/redigera bokm\u00E4rke", anchor_name:"Namn", code_title:"HTML k\u00E4llkodsl\u00E4ge", code_wordwrap:"Bryt ord", colorpicker_title:"V\u00E4lj en f\u00E4rg", colorpicker_picker_tab:"V\u00E4ljare", colorpicker_picker_title:"F\u00E4rgv\u00E4ljare", colorpicker_palette_tab:"Palett", colorpicker_palette_title:"Palettf\u00E4rger", colorpicker_named_tab:"Namngivna", colorpicker_named_title:"Namngivna f\u00E4rger", colorpicker_color:"F\u00E4rg:", colorpicker_name:"Namn:", charmap_title:"V\u00E4lj ett specialtecken", image_title:"Infoga/redigera bild", image_src:"Bildens URL", image_alt:"Bildens beskrivning", image_list:"Bildlista", image_border:"Ram", image_dimensions:"Dimensioner", image_vspace:"Vertikalrymd", image_hspace:"Horisontalrymd", image_align:"Justering", image_align_baseline:"Baslinje", image_align_top:"Toppen", image_align_middle:"Mitten", image_align_bottom:"Botten", image_align_texttop:"Toppen av texten", image_align_textbottom:"Botten av texten", image_align_left:"V\u00E4nster", image_align_right:"H\u00F6ger", link_title:"Infoga/redigera l\u00E4nk", link_url:"L\u00E4nkens URL", link_target:"M\u00E5l", link_target_same:"\u00D6\u0096ppna l\u00E4nken i samma f\u00F6nster", link_target_blank:"\u00D6\u0096ppna l\u00E4nken i ett nytt f\u00F6nster", link_titlefield:"Titel", link_is_email:"L\u00E4nken du angav verkar vara en e-post adress. Vill du infoga mailto: prefixet p\u00E5 l\u00E4nken?", link_is_external:"L\u00E4nken du angav verkar vara en extern adress. Vill du infoga http:// prefixet p\u00E5 l\u00E4nken?", link_list:"L\u00E4nklista" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/ta.js000066400000000000000000000035501226600447100233010ustar00rootroot00000000000000tinyMCE.addI18n('ta.advanced',{ style_select:"Styles", font_size:"Font size", fontdefault:"Font family", block:"Format", paragraph:"Paragraph", div:"Div", address:"Address", pre:"Preformatted", h1:"Heading 1", h2:"Heading 2", h3:"Heading 3", h4:"Heading 4", h5:"Heading 5", h6:"Heading 6", blockquote:"Blockquote", code:"Code", samp:"Code sample", dt:"Definition term ", dd:"Definition description", bold_desc:"Bold (Ctrl+B)", italic_desc:"Italic (Ctrl+I)", underline_desc:"Underline (Ctrl+U)", striketrough_desc:"Strikethrough", justifyleft_desc:"Align left", justifycenter_desc:"Align center", justifyright_desc:"Align right", justifyfull_desc:"Align full", bullist_desc:"Unordered list", numlist_desc:"Ordered list", outdent_desc:"Outdent", indent_desc:"Indent", undo_desc:"Undo (Ctrl+Z)", redo_desc:"Redo (Ctrl+Y)", link_desc:"Insert/edit link", unlink_desc:"Unlink", image_desc:"Insert/edit image", cleanup_desc:"Cleanup messy code", code_desc:"Edit HTML Source", sub_desc:"Subscript", sup_desc:"Superscript", hr_desc:"Insert horizontal ruler", removeformat_desc:"Remove formatting", custom1_desc:"Your custom description here", forecolor_desc:"Select text color", backcolor_desc:"Select background color", charmap_desc:"Insert custom character", visualaid_desc:"Toggle guidelines/invisible elements", anchor_desc:"Insert/edit anchor", cut_desc:"Cut", copy_desc:"Copy", paste_desc:"Paste", image_props_desc:"Image properties", newdocument_desc:"New document", help_desc:"Help", blockquote_desc:"Blockquote", clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?", path:"Path", newdocument:"Are you sure you want clear all contents?", toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X", more_colors:"More colors" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/ta_dlg.js000066400000000000000000000032741226600447100241320ustar00rootroot00000000000000tinyMCE.addI18n('ta.advanced_dlg',{ about_title:"About TinyMCE", about_general:"About", about_help:"Help", about_license:"License", about_plugins:"Plugins", about_plugin:"Plugin", about_author:"Author", about_version:"Version", about_loaded:"Loaded plugins", anchor_title:"Insert/edit anchor", anchor_name:"Anchor name", code_title:"HTML Source Editor", code_wordwrap:"Word wrap", colorpicker_title:"Select a color", colorpicker_picker_tab:"Picker", colorpicker_picker_title:"Color picker", colorpicker_palette_tab:"Palette", colorpicker_palette_title:"Palette colors", colorpicker_named_tab:"Named", colorpicker_named_title:"Named colors", colorpicker_color:"Color:", colorpicker_name:"Name:", charmap_title:"Select custom character", image_title:"Insert/edit image", image_src:"Image URL", image_alt:"Image description", image_list:"Image list", image_border:"Border", image_dimensions:"Dimensions", image_vspace:"Vertical space", image_hspace:"Horizontal space", image_align:"Alignment", image_align_baseline:"Baseline", image_align_top:"Top", image_align_middle:"Middle", image_align_bottom:"Bottom", image_align_texttop:"Text top", image_align_textbottom:"Text bottom", image_align_left:"Left", image_align_right:"Right", link_title:"Insert/edit link", link_url:"Link URL", link_target:"Target", link_target_same:"Open link in the same window", link_target_blank:"Open link in a new window", link_titlefield:"Title", link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", link_list:"Link list" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/te.js000066400000000000000000000035501226600447100233050ustar00rootroot00000000000000tinyMCE.addI18n('te.advanced',{ style_select:"Styles", font_size:"Font size", fontdefault:"Font family", block:"Format", paragraph:"Paragraph", div:"Div", address:"Address", pre:"Preformatted", h1:"Heading 1", h2:"Heading 2", h3:"Heading 3", h4:"Heading 4", h5:"Heading 5", h6:"Heading 6", blockquote:"Blockquote", code:"Code", samp:"Code sample", dt:"Definition term ", dd:"Definition description", bold_desc:"Bold (Ctrl+B)", italic_desc:"Italic (Ctrl+I)", underline_desc:"Underline (Ctrl+U)", striketrough_desc:"Strikethrough", justifyleft_desc:"Align left", justifycenter_desc:"Align center", justifyright_desc:"Align right", justifyfull_desc:"Align full", bullist_desc:"Unordered list", numlist_desc:"Ordered list", outdent_desc:"Outdent", indent_desc:"Indent", undo_desc:"Undo (Ctrl+Z)", redo_desc:"Redo (Ctrl+Y)", link_desc:"Insert/edit link", unlink_desc:"Unlink", image_desc:"Insert/edit image", cleanup_desc:"Cleanup messy code", code_desc:"Edit HTML Source", sub_desc:"Subscript", sup_desc:"Superscript", hr_desc:"Insert horizontal ruler", removeformat_desc:"Remove formatting", custom1_desc:"Your custom description here", forecolor_desc:"Select text color", backcolor_desc:"Select background color", charmap_desc:"Insert custom character", visualaid_desc:"Toggle guidelines/invisible elements", anchor_desc:"Insert/edit anchor", cut_desc:"Cut", copy_desc:"Copy", paste_desc:"Paste", image_props_desc:"Image properties", newdocument_desc:"New document", help_desc:"Help", blockquote_desc:"Blockquote", clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?", path:"Path", newdocument:"Are you sure you want clear all contents?", toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X", more_colors:"More colors" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/te_dlg.js000066400000000000000000000032741226600447100241360ustar00rootroot00000000000000tinyMCE.addI18n('te.advanced_dlg',{ about_title:"About TinyMCE", about_general:"About", about_help:"Help", about_license:"License", about_plugins:"Plugins", about_plugin:"Plugin", about_author:"Author", about_version:"Version", about_loaded:"Loaded plugins", anchor_title:"Insert/edit anchor", anchor_name:"Anchor name", code_title:"HTML Source Editor", code_wordwrap:"Word wrap", colorpicker_title:"Select a color", colorpicker_picker_tab:"Picker", colorpicker_picker_title:"Color picker", colorpicker_palette_tab:"Palette", colorpicker_palette_title:"Palette colors", colorpicker_named_tab:"Named", colorpicker_named_title:"Named colors", colorpicker_color:"Color:", colorpicker_name:"Name:", charmap_title:"Select custom character", image_title:"Insert/edit image", image_src:"Image URL", image_alt:"Image description", image_list:"Image list", image_border:"Border", image_dimensions:"Dimensions", image_vspace:"Vertical space", image_hspace:"Horizontal space", image_align:"Alignment", image_align_baseline:"Baseline", image_align_top:"Top", image_align_middle:"Middle", image_align_bottom:"Bottom", image_align_texttop:"Text top", image_align_textbottom:"Text bottom", image_align_left:"Left", image_align_right:"Right", link_title:"Insert/edit link", link_url:"Link URL", link_target:"Target", link_target_same:"Open link in the same window", link_target_blank:"Open link in a new window", link_titlefield:"Title", link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", link_list:"Link list" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/th.js000066400000000000000000000113541226600447100233110ustar00rootroot00000000000000tinyMCE.addI18n('th.advanced',{ style_select:"\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A", font_size:"\u0E02\u0E19\u0E32\u0E14\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23", fontdefault:"\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23", block:"\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A", paragraph:"\u0E22\u0E48\u0E2D\u0E2B\u0E19\u0E49\u0E32", div:"Div", address:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48", pre:"\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E1E\u0E37\u0E49\u0E19\u0E10\u0E32\u0E19", h1:"Heading 1", h2:"Heading 2", h3:"Heading 3", h4:"Heading 4", h5:"Heading 5", h6:"Heading 6", blockquote:"\u0E2D\u0E49\u0E32\u0E07\u0E2D\u0E34\u0E07", code:"\u0E42\u0E04\u0E49\u0E14", samp:"\u0E42\u0E04\u0E49\u0E14\u0E15\u0E31\u0E27\u0E2D\u0E22\u0E48\u0E32\u0E07", dt:"\u0E04\u0E33\u0E19\u0E34\u0E22\u0E32\u0E21", dd:"\u0E23\u0E32\u0E22\u0E25\u0E30\u0E40\u0E2D\u0E35\u0E22\u0E14\u0E04\u0E33\u0E19\u0E34\u0E22\u0E32\u0E21", bold_desc:"\u0E15\u0E31\u0E27\u0E2B\u0E19\u0E32 (Ctrl+B)", italic_desc:"\u0E15\u0E31\u0E27\u0E40\u0E2D\u0E35\u0E22\u0E07 (Ctrl+I)", underline_desc:"\u0E15\u0E31\u0E27\u0E02\u0E35\u0E14\u0E40\u0E2A\u0E49\u0E19\u0E43\u0E15\u0E49(Ctrl+U)", striketrough_desc:"\u0E02\u0E35\u0E14\u0E06\u0E48\u0E32", justifyleft_desc:"\u0E08\u0E31\u0E14\u0E0B\u0E49\u0E32\u0E22", justifycenter_desc:"\u0E08\u0E31\u0E14\u0E01\u0E25\u0E32\u0E07", justifyright_desc:"\u0E08\u0E31\u0E14\u0E02\u0E27\u0E32", justifyfull_desc:"\u0E08\u0E31\u0E14\u0E40\u0E15\u0E47\u0E21\u0E2B\u0E19\u0E49\u0E32", bullist_desc:"\u0E25\u0E33\u0E14\u0E31\u0E1A\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23", numlist_desc:"\u0E25\u0E33\u0E14\u0E31\u0E1A\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02", outdent_desc:"\u0E25\u0E14\u0E01\u0E32\u0E23\u0E40\u0E22\u0E37\u0E49\u0E2D\u0E07", indent_desc:"\u0E40\u0E22\u0E37\u0E49\u0E2D\u0E07\u0E02\u0E27\u0E32", undo_desc:"\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01 (Ctrl+Z)", redo_desc:"\u0E22\u0E49\u0E2D\u0E19\u0E01\u0E25\u0E31\u0E1A (Ctrl+Y)", link_desc:"\u0E40\u0E1E\u0E34\u0E48\u0E21/\u0E41\u0E01\u0E49\u0E44\u0E02 \u0E25\u0E34\u0E49\u0E07\u0E04\u0E4C", unlink_desc:"\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01\u0E25\u0E34\u0E49\u0E07\u0E04\u0E4C", image_desc:"\u0E40\u0E1E\u0E34\u0E48\u0E21/\u0E41\u0E01\u0E49\u0E44\u0E02 \u0E23\u0E39\u0E1B", cleanup_desc:"\u0E25\u0E49\u0E32\u0E07\u0E42\u0E04\u0E49\u0E14", code_desc:"\u0E41\u0E01\u0E49\u0E44\u0E02 HTML", sub_desc:"\u0E15\u0E31\u0E27\u0E2B\u0E49\u0E2D\u0E22", sup_desc:"\u0E15\u0E31\u0E27\u0E22\u0E01", hr_desc:"\u0E43\u0E2A\u0E48\u0E40\u0E2A\u0E49\u0E19\u0E1A\u0E23\u0E23\u0E17\u0E31\u0E14", removeformat_desc:"\u0E25\u0E49\u0E32\u0E07\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A", custom1_desc:"\u0E43\u0E2A\u0E48\u0E23\u0E32\u0E22\u0E25\u0E30\u0E40\u0E2D\u0E35\u0E22\u0E14\u0E40\u0E2D\u0E07\u0E44\u0E14\u0E49\u0E17\u0E35\u0E48\u0E19\u0E35\u0E48", forecolor_desc:"\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2A\u0E35\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21", backcolor_desc:"\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2A\u0E35\u0E1E\u0E37\u0E49\u0E19\u0E2B\u0E25\u0E31\u0E07", charmap_desc:"\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23", visualaid_desc:"\u0E2A\u0E25\u0E31\u0E1A guidelines/\u0E0B\u0E48\u0E2D\u0E19 elements", anchor_desc:"\u0E40\u0E1E\u0E34\u0E48\u0E21/\u0E41\u0E01\u0E49\u0E44\u0E02 \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E25\u0E34\u0E49\u0E07\u0E04\u0E4C", cut_desc:"\u0E15\u0E31\u0E14", copy_desc:"\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01", paste_desc:"\u0E27\u0E32\u0E07", image_props_desc:"\u0E04\u0E38\u0E13\u0E2A\u0E21\u0E1A\u0E31\u0E15\u0E34\u0E23\u0E39\u0E1B", newdocument_desc:"\u0E40\u0E2D\u0E01\u0E2A\u0E32\u0E23\u0E43\u0E2B\u0E21\u0E48", help_desc:"\u0E0A\u0E48\u0E27\u0E22\u0E40\u0E2B\u0E25\u0E37\u0E2D", blockquote_desc:"\u0E2D\u0E49\u0E32\u0E07\u0E16\u0E36\u0E07", clipboard_msg:"\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01 / \u0E15\u0E31\u0E14 / \u0E27\u0E32\u0E07\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E21\u0E35\u0E43\u0E2B\u0E49\u0E1A\u0E23\u0E34\u0E01\u0E32\u0E23\u0E43\u0E19 Mozilla \u0E41\u0E25\u0E30 Firefox.\nDo \u0E04\u0E38\u0E13\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E15\u0E34\u0E21\u0E40\u0E01\u0E35\u0E48\u0E22\u0E27\u0E01\u0E31\u0E1A\u0E1B\u0E31\u0E0D\u0E2B\u0E32\u0E19\u0E35\u0E49\u0E2B\u0E23\u0E37\u0E2D\u0E44\u0E21\u0E48?", path:"\u0E1E\u0E32\u0E17", newdocument:"\u0E04\u0E38\u0E13\u0E41\u0E19\u0E48\u0E43\u0E08\u0E2B\u0E23\u0E37\u0E2D\u0E44\u0E21\u0E48\u0E27\u0E48\u0E32\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E25\u0E49\u0E32\u0E07\u0E40\u0E19\u0E37\u0E49\u0E2D\u0E2B\u0E32\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14?", toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X", more_colors:"\u0E2A\u0E35\u0E2D\u0E37\u0E48\u0E19\u0E46" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/th_dlg.js000066400000000000000000000105011226600447100241300ustar00rootroot00000000000000tinyMCE.addI18n('th.advanced_dlg',{ about_title:"\u0E40\u0E01\u0E35\u0E48\u0E22\u0E27\u0E01\u0E31\u0E1A TinyMCE", about_general:"\u0E40\u0E01\u0E35\u0E48\u0E22\u0E27\u0E01\u0E31\u0E1A\u0E40\u0E23\u0E32", about_help:"\u0E0A\u0E48\u0E27\u0E22\u0E40\u0E2B\u0E25\u0E37\u0E2D", about_license:"\u0E25\u0E34\u0E02\u0E2A\u0E34\u0E17\u0E18\u0E34\u0E4C", about_plugins:"\u0E1B\u0E25\u0E31\u0E4A\u0E01\u0E2D\u0E34\u0E19", about_plugin:"\u0E1B\u0E25\u0E31\u0E4A\u0E01\u0E2D\u0E34\u0E19", about_author:"\u0E1C\u0E39\u0E49\u0E40\u0E02\u0E35\u0E22\u0E19", about_version:"\u0E23\u0E38\u0E48\u0E19", about_loaded:"\u0E42\u0E2B\u0E25\u0E14\u0E1B\u0E25\u0E31\u0E4A\u0E01\u0E2D\u0E34\u0E19", anchor_title:"\u0E40\u0E1E\u0E34\u0E48\u0E21/\u0E41\u0E01\u0E49\u0E44\u0E02 \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E25\u0E34\u0E49\u0E07\u0E04\u0E4C", anchor_name:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E25\u0E34\u0E49\u0E07\u0E04\u0E4C", code_title:"\u0E41\u0E01\u0E49\u0E44\u0E02 HTML", code_wordwrap:"\u0E15\u0E31\u0E14\u0E04\u0E33", colorpicker_title:"\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2A\u0E35", colorpicker_picker_tab:"\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2A\u0E35", colorpicker_picker_title:"\u0E08\u0E32\u0E19\u0E2A\u0E35", colorpicker_palette_tab:"\u0E08\u0E32\u0E19\u0E2A\u0E35", colorpicker_palette_title:"\u0E08\u0E32\u0E19\u0E2A\u0E35", colorpicker_named_tab:"\u0E0A\u0E37\u0E48\u0E2D", colorpicker_named_title:"\u0E0A\u0E37\u0E48\u0E2D\u0E2A\u0E35", colorpicker_color:"\u0E2A\u0E35:", colorpicker_name:"\u0E0A\u0E37\u0E48\u0E2D:", charmap_title:"\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E40\u0E2D\u0E07", image_title:"\u0E40\u0E1E\u0E34\u0E48\u0E21/\u0E41\u0E01\u0E49\u0E44\u0E02 \u0E23\u0E39\u0E1B", image_src:"URL \u0E23\u0E39\u0E1B", image_alt:"\u0E23\u0E32\u0E22\u0E25\u0E30\u0E2D\u0E35\u0E22\u0E14\u0E23\u0E39\u0E1B", image_list:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E23\u0E39\u0E1B", image_border:"\u0E01\u0E23\u0E2D\u0E1A", image_dimensions:"\u0E02\u0E19\u0E32\u0E14", image_vspace:"\u0E23\u0E30\u0E22\u0E30\u0E2B\u0E48\u0E32\u0E07\u0E41\u0E19\u0E27\u0E15\u0E31\u0E49\u0E07", image_hspace:"\u0E23\u0E30\u0E22\u0E30\u0E2B\u0E48\u0E32\u0E07\u0E41\u0E19\u0E27\u0E19\u0E2D\u0E19", image_align:"\u0E15\u0E33\u0E41\u0E2B\u0E19\u0E48\u0E07\u0E08\u0E31\u0E14\u0E27\u0E32\u0E07", image_align_baseline:"\u0E40\u0E2A\u0E49\u0E19\u0E1E\u0E37\u0E49\u0E19", image_align_top:"\u0E1A\u0E19", image_align_middle:"\u0E01\u0E25\u0E32\u0E07", image_align_bottom:"\u0E25\u0E48\u0E32\u0E07", image_align_texttop:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E2D\u0E22\u0E39\u0E48\u0E1A\u0E19", image_align_textbottom:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E2D\u0E22\u0E39\u0E48\u0E25\u0E48\u0E32\u0E07", image_align_left:"\u0E0B\u0E49\u0E32\u0E22", image_align_right:"\u0E02\u0E27\u0E32", link_title:"\u0E40\u0E1E\u0E34\u0E48\u0E21/\u0E41\u0E01\u0E49\u0E44\u0E02 \u0E25\u0E34\u0E49\u0E07\u0E04\u0E4C", link_url:"\u0E25\u0E34\u0E49\u0E07\u0E04\u0E4C URL", link_target:"\u0E40\u0E1B\u0E49\u0E32\u0E2B\u0E21\u0E32\u0E22", link_target_same:"\u0E40\u0E1B\u0E34\u0E14\u0E25\u0E34\u0E49\u0E07\u0E04\u0E4C\u0E43\u0E19\u0E2B\u0E19\u0E49\u0E32\u0E15\u0E48\u0E32\u0E07\u0E40\u0E14\u0E35\u0E22\u0E27\u0E01\u0E31\u0E19", link_target_blank:"\u0E40\u0E1B\u0E34\u0E14\u0E25\u0E34\u0E49\u0E07\u0E04\u0E4C\u0E43\u0E19\u0E2B\u0E19\u0E49\u0E32\u0E15\u0E48\u0E32\u0E07\u0E43\u0E2B\u0E21\u0E48", link_titlefield:"\u0E0A\u0E37\u0E48\u0E2D", link_is_email:"URL \u0E17\u0E35\u0E48\u0E04\u0E38\u0E13\u0E1B\u0E49\u0E2D\u0E19\u0E14\u0E39\u0E40\u0E2B\u0E21\u0E37\u0E2D\u0E19\u0E27\u0E48\u0E32\u0E08\u0E30\u0E21\u0E35\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25\u0E2D\u0E22\u0E39\u0E48\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E40\u0E1E\u0E34\u0E48\u0E21 mailto: \u0E19\u0E33\u0E2B\u0E19\u0E49\u0E32\u0E2B\u0E23\u0E37\u0E2D\u0E44\u0E21\u0E48 ?", link_is_external:"URL \u0E17\u0E35\u0E48\u0E04\u0E38\u0E13\u0E1B\u0E49\u0E2D\u0E19\u0E14\u0E39\u0E40\u0E2B\u0E21\u0E37\u0E2D\u0E19\u0E27\u0E48\u0E32\u0E20\u0E32\u0E22\u0E19\u0E2D\u0E01\u0E25\u0E34\u0E07\u0E04\u0E04\u0E38\u0E13\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E40\u0E1E\u0E34\u0E48\u0E21 http:// \u0E2B\u0E23\u0E37\u0E2D\u0E44\u0E21\u0E48 ?", link_list:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E25\u0E34\u0E49\u0E07\u0E04\u0E4C" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/tr.js000066400000000000000000000040611226600447100233200ustar00rootroot00000000000000tinyMCE.addI18n('tr.advanced',{ style_select:"Stiller", font_size:"Yaz\u0131 boyu", fontdefault:"Yaz\u0131 ti", block:"Bi\u00E7", paragraph:"Paragraf", div:"B\u00F6", address:"Adres", pre:"\u00D6nformat", h1:"Ba\u015Fl", h2:"Ba\u015Fl", h3:"Ba\u015Fl", h4:"Ba\u015Fl", h5:"Ba\u015Fl", h6:"Ba\u015Fl", blockquote:"Al\u0131n", code:"Kod", samp:"Kod \u00F6rn", dt:"Tan\u0131m terim", dd:"Tan\u0131m a\u00E7\u0131k", bold_desc:"Kal\u0131n (Ctrl+", italic_desc:"E\u011Fik (Ctrl+", underline_desc:"Alt\u0131 \u00E7izgili (Ctr", striketrough_desc:"Ortas\u0131 \u00E7iz", justifyleft_desc:"Sola yasla", justifycenter_desc:"Ortala", justifyright_desc:"Sa\u011Fa yas", justifyfull_desc:"\u0130ki yana yas", bullist_desc:"S\u0131ras\u0131z l", numlist_desc:"S\u0131ral\u0131 l", outdent_desc:"D\u0131\u015Fa ka", indent_desc:"\u0130\u00E7e ka", undo_desc:"Geri al (Ctrl+Z)", redo_desc:"Tekrarla (Ctrl+Y)", link_desc:"Ba\u011Flant\u0131 ekle/d", unlink_desc:"Ba\u011Flant\u0131y", image_desc:"Resim ekle/d\u00FCzen", cleanup_desc:"Da\u011F\u0131n\u0131k kodu t", code_desc:"HTML Kayna\u011F\u0131n\u0131 ", sub_desc:"Altsimge", sup_desc:"\u00DCstsim", hr_desc:"Yatay \u00E7izgi ek", removeformat_desc:"Bi\u00E7imi kald", custom1_desc:"\u00D6zel a\u00E7\u0131klaman\u0131z\u0131 bu", forecolor_desc:"Metin rengi se", backcolor_desc:"Arkaplan rengi se", charmap_desc:"\u00D6zel karakter ek", visualaid_desc:"Y\u00F6nergeleri ve g\u00F6r\u00FCnmez elemanlarv", anchor_desc:"\u00C7engel noktas\u0131 ", cut_desc:"Kes", copy_desc:"Kopyala", paste_desc:"Yap\u0131", image_props_desc:"Resim \u00F6zellikle", newdocument_desc:"Yeni belge", help_desc:"Yard", blockquote_desc:"Al\u0131n", clipboard_msg:"Kopyala/Kes/Yap\u0131\u015Ft\u0131r Mozilla ve Firefox'ta kullan\u0131lamaz.\r\nBu konuda daha fazla bilgi edinmek ister ", path:"Yol", newdocument:"T\u00FCm i\u00E7eri\u011Fi bo\u015Faltmak istedinizden emin ", toolbar_focus:"Ara\u00E7 d\u00FC\u011Fmelerine atla - Alt+Q, Edit\u00F6re atla - Alt-Z, Eleman yoluna atla", more_colors:"Daha fazla renk" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/tr_dlg.js000066400000000000000000000036111226600447100241460ustar00rootroot00000000000000tinyMCE.addI18n('tr.advanced_dlg',{ about_title:"TinyMCE Hakk\u0131n", about_general:"Hakk\u0131n", about_help:"Yard", about_license:"Lisans", about_plugins:"Eklentiler", about_plugin:"Eklenti", about_author:"Yazar", about_version:"S\u00FC", about_loaded:"Y\u00FCkl\u00FC eklent", anchor_title:"\u00C7engel noktas\u0131 ekle/d", anchor_name:"\u00C7engel noktas\u0131", code_title:"HTML Kaynak Edit\u00F6", code_wordwrap:"S\u00F6zc\u00FCk ka", colorpicker_title:"Bir renk se", colorpicker_picker_tab:"Se\u00E7i", colorpicker_picker_title:"Renk se\u00E7i", colorpicker_palette_tab:"Palet", colorpicker_palette_title:"Palet renkleri", colorpicker_named_tab:"\u0130sim", colorpicker_named_title:"\u0130simli renkl", colorpicker_color:"Renk:", colorpicker_name:"\u0130si", charmap_title:"\u00D6zel karakter s", image_title:"Resim ekle/d\u00FCzen", image_src:"Resim URL", image_alt:"Resim tan\u0131", image_list:"Resim listesi", image_border:"Kenarl ", image_dimensions:"Boyutlar", image_vspace:"Dikey bo\u015Fl", image_hspace:"Yatay bo\u015Fl", image_align:"Hizalama", image_align_baseline:"Taban \u00E7izgi", image_align_top:"\u00DC", image_align_middle:"Orta", image_align_bottom:"Alt", image_align_texttop:"Metin \u00FCst", image_align_textbottom:"Metin altta", image_align_left:"Sola", image_align_right:"Sae", link_title:"Ba\u011Flant\u0131 ekle/d", link_url:"Ba\u011Flant\u0131", link_target:"Hedef", link_target_same:"Ba\u011Flant\u0131y\u0131 ayn\u0131 penc", link_target_blank:"Ba\u011Flant\u0131y\u0131 yeni pencer", link_titlefield:"Ba\u015F", link_is_email:"Girdi\u011Finiz URL bir e-posta adresi gibi g\u00F6z\u00FCk\u00FCyor, gerekli olan mailto: \u00F6nekinin eklenmesini iste", link_is_external:"Girdi\u011Finiz URL d\u0131\u015F bir ba\u011Flant\u0131 gibi g\u00F6z\u00FCk\u00FCyor, gerekli olan http:// \u00F6nekinin eklenmes", link_list:"Ba\u011Flant\u0131 lis" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/tt.js000066400000000000000000000047401226600447100233260ustar00rootroot00000000000000tinyMCE.addI18n('tt.advanced',{ style_select:"\u6A23\u5F0F", font_size:"\u5B57\u9AD4\u5927\u5C0F", fontdefault:"\u5B57\u9AD4", block:"\u683C\u5F0F", paragraph:"\u6BB5\u843D", div:"Div", address:"\u5730\u5740", pre:"\u9810\u8A2D\u683C\u5F0F", h1:"\u6A19\u984C 1", h2:"\u6A19\u984C 2", h3:"\u6A19\u984C 3", h4:"\u6A19\u984C 4", h5:"\u6A19\u984C 5", h6:"\u6A19\u984C 6", blockquote:"\u5F15\u7528", code:"\u4EE3\u78BC", samp:"\u7A0B\u5F0F\u7BC4\u4F8B", dt:"\u540D\u8A5E\u5B9A\u7FA9", dd:"\u540D\u8A5E\u89E3\u91CB", bold_desc:"\u7C97\u9AD4 (Ctrl+B)", italic_desc:"\u659C\u9AD4 (Ctrl+I)", underline_desc:"\u5E95\u7DDA (Ctrl+U)", striketrough_desc:"\u4E2D\u5283\u7DDA", justifyleft_desc:"\u9760\u5DE6\u5C0D\u9F4A", justifycenter_desc:"\u7F6E\u4E2D", justifyright_desc:"\u9760\u53F3\u5C0D\u9F4A", justifyfull_desc:"\u5169\u7AEF\u5C0D\u9F4A", bullist_desc:"\u6E05\u55AE\u7B26\u865F", numlist_desc:"\u7DE8\u865F", outdent_desc:"\u6E1B\u5C11\u7E2E\u6392", indent_desc:"\u589E\u52A0\u7E2E\u6392", undo_desc:"\u53D6\u6D88\u8B8A\u66F4 (Ctrl+Z)", redo_desc:"\u91CD\u4F5C\u8B8A\u66F4 (Ctrl+Y)", link_desc:"\u63D2\u5165/\u7DE8\u8F2F \u9023\u7D50", unlink_desc:"\u53D6\u6D88\u9023\u7D50", image_desc:"\u63D2\u5165/\u7DE8\u8F2F \u5716\u7247", cleanup_desc:"\u6E05\u9664\u5167\u5BB9", code_desc:"\u7DE8\u8F2F HTML \u539F\u59CB\u7A0B\u5F0F\u78BC", sub_desc:"\u4E0B\u6A19", sup_desc:"\u4E0A\u6A19", hr_desc:"\u63D2\u5165\u6C34\u5E73\u7DDA", removeformat_desc:"\u6E05\u9664\u6A23\u5F0F", custom1_desc:"\u5728\u6B64\u8F38\u5165\u60A8\u7684\u81EA\u8A02\u63CF\u8FF0", forecolor_desc:"\u9078\u64C7\u6587\u5B57\u9854\u8272", backcolor_desc:"\u9078\u64C7\u80CC\u666F\u9854\u8272", charmap_desc:"\u63D2\u5165\u7279\u6B8A\u7B26\u865F", visualaid_desc:"\u7DB2\u683C/\u96B1\u85CF\u5143\u4EF6\uFF1F", anchor_desc:"\u63D2\u5165/\u7DE8\u8F2F \u9328\u9EDE", cut_desc:"\u526A\u4E0B (Ctrl+X)", copy_desc:"\u8907\u88FD (Ctrl+C)", paste_desc:"\u8CBC\u4E0A (Ctrl+V)", image_props_desc:"\u5716\u7247\u5C6C\u6027", newdocument_desc:"\u65B0\u589E\u6587\u4EF6", help_desc:"\u8AAA\u660E", blockquote_desc:"\u5F15\u7528", clipboard_msg:"\u8907\u88FD\u3001\u526A\u4E0B\u548C\u8CBC\u4E0A\u529F\u80FD\u5728Mozilla \u548C Firefox\u4E2D\u7121\u6CD5\u4F7F\u7528", path:"\u8DEF\u5F91", newdocument:"\u60A8\u78BA\u8A8D\u8981\u522A\u9664\u5168\u90E8\u5167\u5BB9\u55CE\uFF1F", toolbar_focus:"\u5DE5\u5177\u5217 - Alt+Q, \u7DE8\u8F2F\u5668 - Alt-Z, \u5143\u4EF6\u8DEF\u5F91 - Alt-X", more_colors:"\u66F4\u591A\u9854\u8272" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/tt_dlg.js000066400000000000000000000046571226600447100241630ustar00rootroot00000000000000tinyMCE.addI18n('tt.advanced_dlg',{ about_title:"\u95DC\u65BC TinyMCE", about_general:"\u95DC\u65BC", about_help:"\u8AAA\u660E", about_license:"\u6388\u6B0A", about_plugins:"\u5168\u90E8\u5916\u639B\u7A0B\u5F0F", about_plugin:"\u5916\u639B\u7A0B\u5F0F", about_author:"\u4F5C\u8005", about_version:"\u7248\u672C", about_loaded:"\u5DF2\u8F09\u5165\u7684\u5916\u639B\u7A0B\u5F0F", anchor_title:"\u63D2\u5165/\u7DE8\u8F2F \u9328\u9EDE", anchor_name:"\u9328\u9EDE\u540D\u7A31", code_title:"HTML \u539F\u59CB\u7A0B\u5F0F\u78BC\u7DE8\u8F2F\u5668", code_wordwrap:"\u81EA\u52D5\u63DB\u884C", colorpicker_title:"\u9078\u64C7\u9854\u8272", colorpicker_picker_tab:"\u9078\u64C7\u5668", colorpicker_picker_title:"\u53D6\u8272\u5668", colorpicker_palette_tab:"\u8272\u8B5C", colorpicker_palette_title:"\u8272\u8B5C\u9854\u8272", colorpicker_named_tab:"\u9810\u8A2D\u503C", colorpicker_named_title:"\u9810\u8A2D\u7684\u9854\u8272", colorpicker_color:"\u9854\u8272:", colorpicker_name:"\u8272\u540D:", charmap_title:"\u63D2\u5165\u7279\u6B8A\u7B26\u865F", image_title:"\u63D2\u5165/\u7DE8\u8F2F \u5716\u7247", image_src:"\u5716\u7247\u7DB2\u5740", image_alt:"\u5716\u7247\u8AAA\u660E", image_list:"\u5716\u7247\u6E05\u55AE", image_border:"\u908A\u6846", image_dimensions:"\u5C3A\u5BF8", image_vspace:"\u5782\u76F4\u9593\u8DDD", image_hspace:"\u6C34\u5E73\u9593\u8DDD", image_align:"\u5C0D\u9F4A\u65B9\u5F0F", image_align_baseline:"\u57FA\u7DDA", image_align_top:"\u9802\u90E8\u5C0D\u9F4A", image_align_middle:"\u4E2D\u90E8\u5C0D\u9F4A", image_align_bottom:"\u5E95\u90E8\u5C0D\u9F4A", image_align_texttop:"\u6587\u5B57\u4E0A\u65B9", image_align_textbottom:"\u6587\u5B57\u4E0B\u65B9", image_align_left:"\u9760\u5DE6\u5C0D\u9F4A", image_align_right:"\u9760\u53F3\u5C0D\u9F4A", link_title:"\u63D2\u5165/\u7DE8\u8F2F \u9023\u7D50", link_url:"\u9023\u7D50\u7DB2\u5740", link_target:"\u76EE\u6A19", link_target_same:"\u7576\u524D\u7A97\u53E3\u6253\u958B", link_target_blank:"\u65B0\u7A97\u53E3\u6253\u958B", link_titlefield:"\u6A19\u984C", link_is_email:"\u60A8\u8F38\u5165\u7684\u61C9\u8A72\u662F\u4E00\u500B\u96FB\u5B50\u90F5\u4EF6\u5730\u5740\uFF0C\u662F\u5426\u9700\u8981\u5728\u7DB2\u5740\u524D\u52A0\u4E0A mailto: ? ", link_is_external:"\u60A8\u8F38\u5165\u7684\u7DB2\u5740\u61C9\u8A72\u662F\u4E00\u500B\u5916\u90E8\u9023\u7D50\uFF0C\u662F\u5426\u9700\u8981\u5728\u7DB2\u5740\u524D\u52A0\u4E0A http:// ?", link_list:"\u9023\u7D50\u6E05\u55AE" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/tw.js000066400000000000000000000051241226600447100233260ustar00rootroot00000000000000tinyMCE.addI18n('tw.advanced',{ style_select:"\u6A23\u5F0F", font_size:"\u5B57\u578B\u5927\u5C0F", fontdefault:"\u5B57\u578B", block:"\u683C\u5F0F", paragraph:"\u6BB5\u843D", div:"DIV\u6A19\u7C64", address:"\u5730\u5740", pre:"\u7DE8\u6392", h1:"\u6A19\u984C1", h2:"\u6A19\u984C2", h3:"\u6A19\u984C3", h4:"\u6A19\u984C4", h5:"\u6A19\u984C5", h6:"\u6A19\u984C6", blockquote:"\u5F15\u7528", code:"\u4EE3\u78BC", samp:"\u4EE3\u78BC\u6A23\u4F8B", dt:"\u540D\u8A5E\u5B9A\u7FA9", dd:"\u540D\u8A5E\u89E3\u91CB", bold_desc:"\u7C97\u9AD4(Ctrl+B)", italic_desc:"\u659C\u9AD4(Ctrl+I)", underline_desc:"\u5E95\u7DDA(Ctrl+U)", striketrough_desc:"\u522A\u9664\u7DDA", justifyleft_desc:"\u9760\u5DE6\u5C0D\u9F4A", justifycenter_desc:"\u7F6E\u4E2D\u5C0D\u9F4A", justifyright_desc:"\u9760\u53F3\u5C0D\u9F4A", justifyfull_desc:"\u5DE6\u53F3\u5C0D\u9F4A", bullist_desc:"\u9805\u76EE\u7B26\u865F", numlist_desc:"\u7DE8\u865F", outdent_desc:"\u6E1B\u5C11\u7E2E\u6392", indent_desc:"\u589E\u52A0\u7E2E\u6392", undo_desc:"\u9084\u539F(Ctrl+Z)", redo_desc:"\u91CD\u505A(Ctrl+Y)", link_desc:"\u63D2\u5165/\u7DE8\u8F2F\u9023\u7D50", unlink_desc:"\u53D6\u6D88\u9023\u7D50", image_desc:"\u63D2\u5165/\u7DE8\u8F2F\u5716\u7247", cleanup_desc:"\u6E05\u9664\u591A\u9918\u4EE3\u78BC", code_desc:"\u7DE8\u8F2FHTML\u539F\u59CB\u7A0B\u5F0F\u78BC", sub_desc:"\u4E0B\u6A19", sup_desc:"\u4E0A\u6A19", hr_desc:"\u63D2\u5165\u6C34\u5E73\u7DDA", removeformat_desc:"\u6E05\u9664\u6A23\u5F0F", custom1_desc:"\u5728\u6B64\u8F38\u5165\u60A8\u7684\u81EA\u8A02\u63CF\u8FF0", forecolor_desc:"\u9078\u64C7\u6587\u5B57\u984F\u8272", backcolor_desc:"\u9078\u64C7\u80CC\u666F\u984F\u8272", charmap_desc:"\u63D2\u5165\u7279\u6B8A\u7B26\u865F", visualaid_desc:"\u958B\u95DC\u683C\u7DDA/\u96B1\u85CF\u5143\u7D20", anchor_desc:"\u63D2\u5165/\u7DE8\u8F2F\u9328\u9EDE", cut_desc:"\u526A\u4E0B", copy_desc:"\u8907\u88FD", paste_desc:"\u8CBC\u4E0A", image_props_desc:"\u5716\u7247\u5C6C\u6027", newdocument_desc:"\u65B0\u6587\u4EF6", help_desc:"\u8AAA\u660E", blockquote_desc:"\u5F15\u7528", clipboard_msg:"\u8907\u88FD\u3001\u526A\u4E0B\u53CA\u8CBC\u4E0A\u529F\u80FD\u5728Mozilla\u548CFirefox\u4E2D\u4E0D\u80FD\u4F7F\u7528\u3002 \n\u662F\u5426\u9700\u8981\u77AD\u89E3\u66F4\u591A\u6709\u95DC\u6B64\u554F\u984C\u7684\u8CC7\u8A0A\uFF1F", path:"\u4F4D\u7F6E", newdocument:"\u60A8\u78BA\u8A8D\u8981\u6E05\u9664\u5168\u90E8\u5167\u5BB9\u55CE\uFF1F", toolbar_focus:"\u5DE5\u5177\u6309\u9215- Alt+Q,\u7DE8\u8F2F\u5668- Alt-Z,\u5143\u4EF6\u4F4D\u7F6E- Alt-X", more_colors:"\u66F4\u591A\u984F\u8272", link_delta_width:"40", link_delta_height:"60" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/tw_dlg.js000066400000000000000000000047531226600447100241630ustar00rootroot00000000000000tinyMCE.addI18n('tw.advanced_dlg',{ about_title:"\u95DC\u65BCTinyMCE", about_general:"\u95DC\u65BC", about_help:"\u8AAA\u660E", about_license:"\u6388\u6B0A", about_plugins:"\u5168\u90E8\u5916\u639B\u7A0B\u5F0F", about_plugin:"\u5916\u639B\u7A0B\u5F0F", about_author:"\u4F5C\u8005", about_version:"\u7248\u672C", about_loaded:"\u5DF2\u8F09\u5165\u7684\u5916\u639B\u7A0B\u5F0F", anchor_title:"\u63D2\u5165/\u7DE8\u8F2F\u9328\u9EDE", anchor_name:"\u9328\u9EDE\u540D\u7A31", code_title:"HTML\u539F\u59CB\u7A0B\u5F0F\u78BC\u7DE8\u8F2F\u5668", code_wordwrap:"\u5F37\u8FEB\u63DB\u884C", colorpicker_title:"\u6311\u9078\u984F\u8272", colorpicker_picker_tab:"\u9078\u8272\u5668", colorpicker_picker_title:"\u9078\u8272\u5668", colorpicker_palette_tab:"\u8272\u76E4", colorpicker_palette_title:"\u8272\u76E4\u984F\u8272", colorpicker_named_tab:"\u9810\u8A2D\u7684", colorpicker_named_title:"\u9810\u8A2D\u7684\u984F\u8272", colorpicker_color:"\u984F\u8272:", colorpicker_name:"\u540D\u7A31:", charmap_title:"\u63D2\u5165\u7279\u6B8A\u7B26\u865F", image_title:"\u63D2\u5165/\u7DE8\u8F2F\u5716\u7247", image_src:"\u5716\u7247\u4F4D\u7F6E", image_alt:"\u5716\u7247\u8AAA\u660E", image_list:"\u5716\u7247\u6E05\u55AE", image_border:"\u908A\u6846", image_dimensions:"\u5C3A\u5BF8", image_vspace:"\u5782\u76F4\u9593\u8DDD", image_hspace:"\u6C34\u5E73\u9593\u8DDD", image_align:"\u5C0D\u9F4A\u65B9\u5F0F", image_align_baseline:"\u57FA\u7DDA", image_align_top:"\u9760\u4E0A\u5C0D\u9F4A", image_align_middle:"\u7F6E\u4E2D\u5C0D\u9F4A", image_align_bottom:"\u9760\u4E0B\u5C0D\u9F4A", image_align_texttop:"\u6587\u5B57\u4E0A\u65B9", image_align_textbottom:"\u6587\u5B57\u4E0B\u65B9", image_align_left:"\u9760\u5DE6\u5C0D\u9F4A", image_align_right:"\u9760\u53F3\u5C0D\u9F4A", link_title:"\u63D2\u5165/\u7DE8\u8F2F\u9023\u7D50", link_url:"\u9023\u7D50\u4F4D\u5740", link_target:"\u76EE\u6A19", link_target_same:"\u958B\u555F\u9023\u7D50\u65BC\u6B64\u8996\u7A97", link_target_blank:"\u958B\u555F\u9023\u7D50\u65BC\u65B0\u7684\u8996\u7A97", link_titlefield:"\u6A19\u984C", link_is_email:"\u60A8\u8F38\u5165\u7684\u7DB2\u5740\u61C9\u8A72\u662F\u4E00\u500B\u96FB\u5B50\u90F5\u4EF6\u4F4D\u5740\uFF0C\u662F\u5426\u9700\u8981\u5728\u4F4D\u5740\u524D\u65B9\u52A0\u5165mailto:\uFF1F", link_is_external:"\u60A8\u8F38\u5165\u7684\u7DB2\u5740\u61C9\u8A72\u662F\u4E00\u500B\u5916\u90E8\u9023\u7D50\uFF0C\u662F\u5426\u9700\u8981\u5728\u7DB2\u5740\u524D\u65B9\u52A0\u5165http://\uFF1F", link_list:"\u9023\u7D50\u6E05\u55AE" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/uk.js000066400000000000000000000136361226600447100233220ustar00rootroot00000000000000tinyMCE.addI18n('uk.advanced',{ style_select:"\u0421\u0442\u0438\u043B\u0456", font_size:"\u0420\u043E\u0437\u043C\u0456\u0440 \u0448\u0440\u0438\u0444\u0442\u0443", fontdefault:"\u0428\u0440\u0438\u0444\u0442", block:"\u0424\u043E\u0440\u043C\u0430\u0442", paragraph:"\u0410\u0431\u0437\u0430\u0446", div:"Div", address:"\u0421\u0442\u0438\u043B\u044C \u0430\u0434\u0440\u0435\u0441\u0438", pre:"\u041F\u043E\u043F\u0435\u0440\u0435\u0434\u043D\u044C\u043E \u0444\u043E\u0440\u043C\u0430\u0442\u043E\u0432\u0430\u043D\u0438\u0439", h1:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A 1", h2:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A 2", h3:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A 3", h4:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A 4", h5:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A 5", h6:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A 6", blockquote:"\u0426\u0438\u0442\u0430\u0442\u0430", code:"\u041A\u043E\u0434", samp:"\u041F\u0440\u0438\u043A\u043B\u0430\u0434 \u043A\u043E\u0434\u0443", dt:"\u0414\u043E\u0432\u0456\u0434\u043D\u0438\u043A \u0442\u0435\u0440\u043C\u0456\u043D ", dd:"\u0414\u043E\u0432\u0456\u0434\u043D\u0438\u043A \u043E\u043F\u0438\u0441 ", bold_desc:"\u0416\u0438\u0440\u043D\u0438\u0439 (Ctrl+B)", italic_desc:"\u041A\u0443\u0440\u0441\u0438\u0432 (Ctrl+I)", underline_desc:"\u041F\u0456\u0434\u043A\u0440\u0435\u0441\u043B\u0435\u043D\u0438\u0439 (Ctrl+U)", striketrough_desc:"\u0417\u0430\u043A\u0440\u0435\u0441\u043B\u0435\u043D\u0438\u0439", justifyleft_desc:"\u041F\u043E \u043B\u0456\u0432\u043E\u043C\u0443 \u043A\u0440\u0430\u044E", justifycenter_desc:"\u041F\u043E \u0446\u0435\u043D\u0442\u0440\u0443", justifyright_desc:"\u041F\u043E \u043F\u0440\u0430\u0432\u043E\u043C\u0443 \u043A\u0440\u0430\u044E", justifyfull_desc:"\u041F\u043E \u0448\u0438\u0440\u0438\u043D\u0456", bullist_desc:"\u0421\u043F\u0438\u0441\u043E\u043A", numlist_desc:"\u041D\u0443\u043C\u0435\u0440\u043E\u0432\u0430\u043D\u0438\u0439 \u0441\u043F\u0438\u0441\u043E\u043A", outdent_desc:"\u0417\u043C\u0435\u043D\u0448\u0442\u0438\u0442\u0438 \u0432\u0456\u0434\u0441\u0442\u0443\u043F", indent_desc:"\u0417\u0431\u0456\u043B\u044C\u0448\u0438\u0442\u0438 \u0432\u0456\u0434\u0441\u0442\u0443\u043F", undo_desc:"\u0412\u0456\u0434\u043C\u0456\u043D\u0438\u0442\u0438 (Ctrl+Z)", redo_desc:"\u041F\u043E\u0432\u0435\u0440\u043D\u0443\u0442\u0438 (Ctrl+Y)", link_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438/\u0437\u043C\u0456\u043D\u0438\u0442\u0438 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F", unlink_desc:"\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F", image_desc:"\u0414\u043E\u0434\u0430\u0442\u0438/\u0437\u043C\u0456\u043D\u0438\u0442\u0438 \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F", cleanup_desc:"\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u0438 \u0437\u0430\u0439\u0432\u044B\u0439 \u043A\u043E\u0434", code_desc:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 HTML \u043A\u043E\u0434", sub_desc:"\u041D\u0438\u0436\u043D\u0456\u0439 \u0456\u043D\u0434\u0435\u043A\u0441", sup_desc:"\u0412\u0435\u0440\u0445\u043D\u0456\u0439 \u0456\u043D\u0434\u0435\u043A\u0441", hr_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u0438\u0439 \u0440\u043E\u0437\u0434\u0456\u043B\u044C\u043D\u0438\u043A", removeformat_desc:"\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u0438 \u0444\u043E\u0440\u043C\u0430\u0442\u0443\u0432\u0430\u043D\u043D\u044F", custom1_desc:"\u0412\u0430\u0448 \u0434\u043E\u0432\u0456\u043B\u044C\u043D\u0438\u0439 \u043E\u043F\u0438\u0441 \u0442\u0443\u0442", forecolor_desc:"\u0412\u0438\u0431\u0440\u0430\u0442\u0438 \u043A\u043E\u043B\u0456\u0440 \u0442\u0435\u043A\u0441\u0442\u0443", backcolor_desc:"\u0412\u0438\u0431\u0440\u0430\u0442\u0438 \u043A\u043E\u043B\u0456\u0440 \u0444\u043E\u043D\u0443", charmap_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438 \u0441\u0438\u043C\u0432\u043E\u043B", visualaid_desc:"Toggle guidelines/invisible elements", anchor_desc:"\u0414\u043E\u0434\u0430\u0442\u0438/\u0437\u043C\u0456\u043D\u0438\u0442\u0438 \u044F\u043A\u0456\u0440", cut_desc:"\u0412\u0438\u0440\u0456\u0437\u0430\u0442\u0438", copy_desc:"\u041A\u043E\u043F\u0456\u044E\u0432\u0430\u0442\u0438", paste_desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438", image_props_desc:"\u0412\u043B\u0430\u0441\u0442\u0438\u0432\u043E\u0441\u0442\u0456 \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F", newdocument_desc:"\u041D\u043E\u0432\u0438\u0439 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442", help_desc:"\u0414\u043E\u043F\u043E\u043C\u043E\u0433\u0430", blockquote_desc:"\u0426\u0438\u0442\u0430\u0442\u0430", clipboard_msg:"\u041A\u043E\u043F\u0456\u044E\u0432\u0430\u0442\u0438/\u0412\u0438\u0440\u0456\u0437\u0430\u0442\u0438/\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438 \u043D\u0435 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0456 \u0432 Mozilla \u0438 Firefox.\n\u0412\u0430\u043C \u0446\u0456\u043A\u0430\u0432\u0430 \u0456\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0456\u044F \u043F\u0440\u043E \u0446\u0435?", path:"\u0428\u043B\u044F\u0445", newdocument:"\u0412\u0438 \u043F\u0435\u0432\u043D\u0456, \u0449\u043E \u0431\u0430\u0436\u0430\u0454\u0442\u0435 \u0432\u0441\u0435 \u0432\u0438\u0434\u0430\u043B\u0438\u0442\u0438?", toolbar_focus:"\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043D\u0430 \u043F\u0430\u043D\u0435\u043B\u044C \u043A\u043D\u043E\u043F\u043E\u043A - Alt+Q, \u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u0434\u043E \u0440\u0435\u0434\u0430\u043A\u0442\u043E\u0440\u0443 - Alt-Z, \u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043D\u0430 \u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u0448\u043B\u044F\u0445\u0443 - Alt-X", more_colors:"\u0411\u0456\u043B\u044C\u0448\u0435 \u043A\u043E\u043B\u044C\u043E\u0440\u0456\u0432" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/uk_dlg.js000066400000000000000000000120421226600447100241360ustar00rootroot00000000000000tinyMCE.addI18n('uk.advanced_dlg',{ about_title:"\u041F\u0440\u043E \u043F\u0440\u043E\u0434\u0443\u043A\u0442 TinyMCE", about_general:"\u041F\u0440\u043E \u043F\u0440\u043E\u0434\u0443\u043A\u0442...", about_help:"\u0414\u043E\u043F\u043E\u043C\u043E\u0433\u0430", about_license:"\u041B\u0456\u0446\u0435\u043D\u0437\u0456\u044F", about_plugins:"\u0414\u043E\u0434\u0430\u0442\u043A\u0438", about_plugin:"\u0414\u043E\u0434\u0430\u0442\u043E\u043A", about_author:"\u0410\u0432\u0442\u043E\u0440", about_version:"\u0412\u0435\u0440\u0441\u0456\u044F", about_loaded:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u0456 \u0434\u043E\u0434\u0430\u0442\u043A\u0438", anchor_title:"\u0414\u043E\u0434\u0430\u0442\u0438/\u0437\u043C\u0456\u043D\u0438\u0442\u0438 \u044F\u043A\u0456\u0440", anchor_name:"\u041D\u0430\u0437\u0432\u0430 \u044F\u043A\u043E\u0440\u044F", code_title:"\u0420\u0435\u0434\u0430\u043A\u0442\u043E\u0440 HTML \u043A\u043E\u0434\u0443", code_wordwrap:"\u041F\u0435\u0440\u0435\u043D\u043E\u0441\u0438\u0442\u0438 \u0441\u043B\u043E\u0432\u0430", colorpicker_title:"\u0412\u0438\u0431\u0440\u0430\u0442\u0438 \u043A\u043E\u043B\u0456\u0440", colorpicker_picker_tab:"\u041F\u0456\u043F\u0435\u0442\u043A\u0430", colorpicker_picker_title:"\u041F\u0456\u043F\u0435\u0442\u043A\u0430 \u043A\u043E\u043B\u044C\u043E\u0440\u0443", colorpicker_palette_tab:"\u041F\u0430\u043B\u0456\u0442\u0440\u0430", colorpicker_palette_title:"\u041F\u0430\u043B\u0456\u0442\u0440\u0430 \u043A\u043E\u043B\u044C\u043E\u0440\u0456\u0432", colorpicker_named_tab:"\u0417\u0430 \u043D\u0430\u0437\u0432\u043E\u044E", colorpicker_named_title:"\u0417\u0430 \u043D\u0430\u0437\u0432\u043E\u044E", colorpicker_color:"\u041A\u043E\u043B\u0456\u0440:", colorpicker_name:"\u041D\u0430\u0439\u043C\u0435\u043D\u0443\u0432\u0430\u043D\u043D\u044F:", charmap_title:"\u0412\u0438\u0431\u0440\u0430\u0442\u0438 \u0434\u043E\u0432\u0456\u043B\u044C\u043D\u0438\u0439 \u0441\u0438\u043C\u0432\u043E\u043B", image_title:"\u0414\u043E\u0434\u0430\u0442\u0438/\u0437\u043C\u0456\u043D\u0438\u0442\u0438 \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F", image_src:"\u0410\u0434\u0440\u0435\u0441\u0430", image_alt:"\u041E\u043F\u0438\u0441", image_list:"\u0421\u043F\u0438\u0441\u043E\u043A \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u044C", image_border:"\u0420\u0430\u043C\u043A\u0430", image_dimensions:"\u0420\u043E\u0437\u043C\u0456\u0440\u0438", image_vspace:"\u0412\u0435\u0440\u0442. \u0432\u0456\u0434\u0441\u0442\u0443\u043F", image_hspace:"\u0413\u043E\u0440\u0438\u0437. \u0432\u0456\u0434\u0441\u0442\u0443\u043F", image_align:"\u0412\u0438\u0440\u0456\u0432\u043D\u044E\u0432\u0430\u043D\u043D\u044F", image_align_baseline:"\u041F\u043E \u0431\u0430\u0437\u043E\u0432\u0456\u0439 \u043B\u0438\u043D\u0456\u0457", image_align_top:"\u041F\u043E \u0432\u0435\u0440\u0445\u043D\u044C\u043E\u043C\u0443 \u043A\u0440\u0430\u044E", image_align_middle:"\u041F\u043E \u0446\u0435\u043D\u0442\u0440\u0443", image_align_bottom:"\u041F\u043E \u043D\u0438\u0436\u043D\u044C\u043E\u043C\u0443 \u043A\u0440\u0430\u044E", image_align_texttop:"\u041F\u043E \u0432\u0435\u0440\u0445\u043D\u044C\u043E\u043C\u0443 \u043A\u0440\u0430\u044E \u0442\u0435\u043A\u0441\u0442\u0443", image_align_textbottom:"\u041F\u043E \u043D\u0438\u0436\u043D\u044C\u043E\u043C\u0443 \u043A\u0440\u0430\u044E \u0442\u0435\u043A\u0441\u0442\u0443", image_align_left:"\u041F\u043E \u043B\u0456\u0432\u043E\u043C\u0443 \u043A\u0440\u0430\u044E", image_align_right:"\u041F\u043E \u043F\u0440\u0430\u0432\u043E\u043C\u0443 \u043A\u0440\u0430\u044E", link_title:"\u0414\u043E\u0434\u0430\u0442\u0438/\u0437\u043C\u0456\u043D\u0438\u0442\u0438 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F", link_url:"\u0410\u0434\u0440\u0435\u0441\u0430 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F", link_target:"\u0412\u0456\u0434\u043A\u0440\u0438\u0442\u0438 \u0432...", link_target_same:"\u0446\u044C\u043E\u043C\u0443 \u0436\u0435 \u0432\u0456\u043A\u043D\u0456", link_target_blank:"\u043D\u043E\u0432\u043E\u043C\u0443 \u0432\u0456\u043A\u043D\u0456", link_titlefield:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A", link_is_email:"\u0412\u0432\u0435\u0434\u0435\u043D\u0438\u0439 URL \u0441\u0445\u043E\u0436\u0438\u0439 \u043D\u0430 email \u0430\u0434\u0440\u0435\u0441\u0443, \u0432\u0438 \u0431\u0430\u0436\u0430\u0454\u0442\u0435 \u0434\u043E\u0434\u0430\u0442\u0438 \u043F\u043E\u0442\u0440\u0456\u0431\u043D\u0438\u0439 \u043F\u0440\u0435\u0444\u0456\u043A\u0441 mailto:?", link_is_external:"\u0412\u0432\u0435\u0434\u0435\u043D\u0438\u0439 URL \u0441\u0445\u043E\u0436\u0438\u0439 \u043D\u0430 \u0437\u043E\u0432\u043D\u0456\u0448\u043D\u0454 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F, \u0432\u0438 \u0431\u0430\u0436\u0430\u0454\u0442\u0435 \u0434\u043E\u0434\u0430\u0442\u0438 \u043F\u043E\u0442\u0440\u0456\u0431\u043D\u0438\u0439 \u043F\u0440\u0435\u0444\u0456\u043A\u0441 http://?", link_list:"\u0421\u043F\u0438\u0441\u043E\u043A \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u044C" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/ur.js000066400000000000000000000043471226600447100233300ustar00rootroot00000000000000tinyMCE.addI18n('ur.advanced',{ style_select:"Styles", font_size:"Font size", fontdefault:"Font family", block:"Format", paragraph:"Paragraph", div:"Div", address:"\u0627\u06CC\u0688\u0631\u06CC\u0633", pre:"\u067E\u0631\u06CC \u0641\u0627\u0631\u0645\u06CC\u0679\u0688", h1:"\u06C1\u06CC\u0688\u0646\u06AF \u0627\u0648\u0644", h2:"\u06C1\u06CC\u0688\u0646\u06AF \u062F\u0648\u0645", h3:"\u06C1\u06CC\u0688\u0646\u06AF \u0633\u0648\u0645", h4:"\u06C1\u06CC\u0688\u0646\u06AF \u0686\u06C1\u0627\u0631\u0645", h5:"\u06C1\u06CC\u0688\u0646\u06AF \u067E\u0646\u062C\u0645", h6:"\u06C1\u06CC\u0688\u0646\u06AF \u0634\u0634\u0645", blockquote:"\u0628\u0644\u0627\u06A9 \u06A9\u0648\u0679", code:"\u06A9\u0648\u0688", samp:"Code sample", dt:"Definition term ", dd:"Definition description", bold_desc:"Bold (Ctrl+B)", italic_desc:"Italic (Ctrl+I)", underline_desc:"Underline (Ctrl+U)", striketrough_desc:"Strikethrough", justifyleft_desc:"Align left", justifycenter_desc:"Align center", justifyright_desc:"Align right", justifyfull_desc:"Align full", bullist_desc:"Unordered list", numlist_desc:"Ordered list", outdent_desc:"Outdent", indent_desc:"Indent", undo_desc:"Undo (Ctrl+Z)", redo_desc:"Redo (Ctrl+Y)", link_desc:"Insert/edit link", unlink_desc:"Unlink", image_desc:"Insert/edit image", cleanup_desc:"Cleanup messy code", code_desc:"Edit HTML Source", sub_desc:"Subscript", sup_desc:"Superscript", hr_desc:"Insert horizontal ruler", removeformat_desc:"Remove formatting", custom1_desc:"Your custom description here", forecolor_desc:"Select text color", backcolor_desc:"Select background color", charmap_desc:"Insert custom character", visualaid_desc:"Toggle guidelines/invisible elements", anchor_desc:"Insert/edit anchor", cut_desc:"Cut", copy_desc:"Copy", paste_desc:"Paste", image_props_desc:"Image properties", newdocument_desc:"New document", help_desc:"Help", blockquote_desc:"Blockquote", clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?", path:"Path", newdocument:"Are you sure you want clear all contents?", toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X", more_colors:"More colors" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/ur_dlg.js000066400000000000000000000032741226600447100241540ustar00rootroot00000000000000tinyMCE.addI18n('ur.advanced_dlg',{ about_title:"About TinyMCE", about_general:"About", about_help:"Help", about_license:"License", about_plugins:"Plugins", about_plugin:"Plugin", about_author:"Author", about_version:"Version", about_loaded:"Loaded plugins", anchor_title:"Insert/edit anchor", anchor_name:"Anchor name", code_title:"HTML Source Editor", code_wordwrap:"Word wrap", colorpicker_title:"Select a color", colorpicker_picker_tab:"Picker", colorpicker_picker_title:"Color picker", colorpicker_palette_tab:"Palette", colorpicker_palette_title:"Palette colors", colorpicker_named_tab:"Named", colorpicker_named_title:"Named colors", colorpicker_color:"Color:", colorpicker_name:"Name:", charmap_title:"Select custom character", image_title:"Insert/edit image", image_src:"Image URL", image_alt:"Image description", image_list:"Image list", image_border:"Border", image_dimensions:"Dimensions", image_vspace:"Vertical space", image_hspace:"Horizontal space", image_align:"Alignment", image_align_baseline:"Baseline", image_align_top:"Top", image_align_middle:"Middle", image_align_bottom:"Bottom", image_align_texttop:"Text top", image_align_textbottom:"Text bottom", image_align_left:"Left", image_align_right:"Right", link_title:"Insert/edit link", link_url:"Link URL", link_target:"Target", link_target_same:"Open link in the same window", link_target_blank:"Open link in a new window", link_titlefield:"Title", link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", link_list:"Link list" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/vi.js000066400000000000000000000036461226600447100233210ustar00rootroot00000000000000tinyMCE.addI18n('vi.advanced',{ style_select:"Ki\u1EC3u", font_size:"K\u00EDch th\u01B0\u1EDBc font", fontdefault:"T\u00EAn font ch\u1EEF", block:"\u0110\u1ECBnh d\u1EA1ng", paragraph:"Paragraph", div:"Div", address:"Address", pre:"Preformatted", h1:"Heading 1", h2:"Heading 2", h3:"Heading 3", h4:"Heading 4", h5:"Heading 5", h6:"Heading 6", blockquote:"Tr\u00EDch d\u1EABn", code:"Code", samp:"Code sample", dt:"Definition term ", dd:"Definition description", bold_desc:"Bold (Ctrl+B)", italic_desc:"Italic (Ctrl+I)", underline_desc:"Underline (Ctrl+U)", striketrough_desc:"Strikethrough", justifyleft_desc:"Align left", justifycenter_desc:"Align center", justifyright_desc:"Align right", justifyfull_desc:"Align full", bullist_desc:"Unordered list", numlist_desc:"Ordered list", outdent_desc:"Outdent", indent_desc:"Indent", undo_desc:"Undo (Ctrl+Z)", redo_desc:"Redo (Ctrl+Y)", link_desc:"Insert/edit link", unlink_desc:"Unlink", image_desc:"Insert/edit image", cleanup_desc:"Cleanup messy code", code_desc:"Edit HTML Source", sub_desc:"Subscript", sup_desc:"Superscript", hr_desc:"Insert horizontal ruler", removeformat_desc:"Remove formatting", custom1_desc:"Your custom description here", forecolor_desc:"Select text color", backcolor_desc:"Select background color", charmap_desc:"Insert custom character", visualaid_desc:"Toggle guidelines/invisible elements", anchor_desc:"Insert/edit anchor", cut_desc:"Cut", copy_desc:"Copy", paste_desc:"Paste", image_props_desc:"Image properties", newdocument_desc:"New document", help_desc:"Help", blockquote_desc:"Blockquote", clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?", path:"Path", newdocument:"Are you sure you want clear all contents?", toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X", more_colors:"More colors" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/vi_dlg.js000066400000000000000000000032741226600447100241440ustar00rootroot00000000000000tinyMCE.addI18n('vi.advanced_dlg',{ about_title:"About TinyMCE", about_general:"About", about_help:"Help", about_license:"License", about_plugins:"Plugins", about_plugin:"Plugin", about_author:"Author", about_version:"Version", about_loaded:"Loaded plugins", anchor_title:"Insert/edit anchor", anchor_name:"Anchor name", code_title:"HTML Source Editor", code_wordwrap:"Word wrap", colorpicker_title:"Select a color", colorpicker_picker_tab:"Picker", colorpicker_picker_title:"Color picker", colorpicker_palette_tab:"Palette", colorpicker_palette_title:"Palette colors", colorpicker_named_tab:"Named", colorpicker_named_title:"Named colors", colorpicker_color:"Color:", colorpicker_name:"Name:", charmap_title:"Select custom character", image_title:"Insert/edit image", image_src:"Image URL", image_alt:"Image description", image_list:"Image list", image_border:"Border", image_dimensions:"Dimensions", image_vspace:"Vertical space", image_hspace:"Horizontal space", image_align:"Alignment", image_align_baseline:"Baseline", image_align_top:"Top", image_align_middle:"Middle", image_align_bottom:"Bottom", image_align_texttop:"Text top", image_align_textbottom:"Text bottom", image_align_left:"Left", image_align_right:"Right", link_title:"Insert/edit link", link_url:"Link URL", link_target:"Target", link_target_same:"Open link in the same window", link_target_blank:"Open link in a new window", link_titlefield:"Title", link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", link_list:"Link list" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/zh.js000066400000000000000000000051021226600447100233110ustar00rootroot00000000000000tinyMCE.addI18n('zh.advanced',{ style_select:"\u6A23\u5F0F", font_size:"\u5B57\u9AD4\u5927\u5C0F", fontdefault:"\u5B57\u9AD4", block:"\u683C\u5F0F", paragraph:"\u6BB5\u843D", div:"DIV\u6A19\u7C64", address:"\u5730\u5740", pre:"\u7DE8\u6392", h1:"\u6A19\u984C1", h2:"\u6A19\u984C2", h3:"\u6A19\u984C3", h4:"\u6A19\u984C4", h5:"\u6A19\u984C5", h6:"\u6A19\u984C6", blockquote:"\u5F15\u7528", code:"\u4EE3\u78BC", samp:"\u4EE3\u78BC\u6A23\u4F8B", dt:"\u540D\u8A5E\u5B9A\u7FA9", dd:"\u540D\u8A5E\u89E3\u91CB", bold_desc:"\u9ED1\u9AD4(Ctrl+B)", italic_desc:"\u659C\u9AD4(Ctrl+I)", underline_desc:"\u5E95\u7DDA(Ctrl+U)", striketrough_desc:"\u522A\u9664\u7DDA", justifyleft_desc:"\u9760\u5DE6\u5C0D\u9F4A", justifycenter_desc:"\u7F6E\u4E2D\u5C0D\u9F4A", justifyright_desc:"\u9760\u53F3\u5C0D\u9F4A", justifyfull_desc:"\u5DE6\u53F3\u5C0D\u9F4A", bullist_desc:"\u9805\u76EE\u7B26\u865F", numlist_desc:"\u7DE8\u865F", outdent_desc:"\u6E1B\u5C11\u7E2E\u6392", indent_desc:"\u589E\u52A0\u7E2E\u6392", undo_desc:"\u9084\u539F(Ctrl+Z)", redo_desc:"\u91CD\u505A(Ctrl+Y)", link_desc:"\u63D2\u5165/\u7DE8\u8F2F\u9023\u7D50", unlink_desc:"\u53D6\u6D88\u9023\u7D50", image_desc:"\u63D2\u5165/\u7DE8\u8F2F\u5716\u7247", cleanup_desc:"\u6E05\u9664\u591A\u9918\u4EE3\u78BC", code_desc:"\u7DE8\u8F2FHTML\u6E90\u4EE3\u78BC", sub_desc:"\u4E0B\u6A19", sup_desc:"\u4E0A\u6A19", hr_desc:"\u63D2\u5165\u6C34\u5E73\u7DDA", removeformat_desc:"\u6E05\u9664\u6A23\u5F0F", custom1_desc:"\u5728\u6B64\u8F38\u5165\u60A8\u7684\u81EA\u5B9A\u7FA9\u63CF\u8FF0", forecolor_desc:"\u9078\u64C7\u6587\u5B57\u984F\u8272", backcolor_desc:"\u9078\u64C7\u80CC\u666F\u984F\u8272", charmap_desc:"\u63D2\u5165\u7279\u6B8A\u7B26\u865F", visualaid_desc:"\u7DB2\u683C\u7DDA/\u96B1\u85CF\u5143\u7D20", anchor_desc:"\u63D2\u5165/\u7DE8\u8F2F\u9328\u9EDE", cut_desc:"\u526A\u5207", copy_desc:"\u8907\u88FD", paste_desc:"\u7C98\u8CBC", image_props_desc:"\u5716\u7247\u5C6C\u6027", newdocument_desc:"\u65B0\u5EFA", help_desc:"\u8AAA\u660E", blockquote_desc:"\u5F15\u7528", clipboard_msg:"\u8907\u88FD\u3001\u526A\u5207\u53CA\u7C98\u8CBC\u529F\u80FD\u5728Mozilla\u548CFirefox\u4E2D\u4E0D\u80FD\u4F7F\u7528\u3002 \n\u662F\u5426\u9700\u8981\u77AD\u89E3\u66F4\u591A\u6709\u95DC\u6B64\u554F\u984C\u7684\u4FE1\u606F\uFF1F", path:"\u4F4D\u7F6E", newdocument:"\u60A8\u78BA\u8A8D\u8981\u6E05\u9664\u5168\u90E8\u5167\u5BB9\u55CE\uFF1F", toolbar_focus:"\u5DE5\u5177\u6309\u9215- Alt+Q,\u7DE8\u8F2F\u5668- Alt-Z,\u7D44\u4EF6\u4F4D\u7F6E- Alt-X", more_colors:"\u66F4\u591A\u984F\u8272", link_delta_width:"40", link_delta_height:"60" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/zh_dlg.js000066400000000000000000000046731226600447100241530ustar00rootroot00000000000000tinyMCE.addI18n('zh.advanced_dlg',{ about_title:"\u95DC\u65BCTinyMCE", about_general:"\u95DC\u65BC", about_help:"\u8AAA\u660E", about_license:"\u6388\u6B0A", about_plugins:"\u5168\u90E8\u63D2\u4EF6", about_plugin:"\u63D2\u4EF6", about_author:"\u4F5C\u8005", about_version:"\u7248\u672C", about_loaded:"\u5DF2\u8F09\u5165\u7684\u63D2\u4EF6", anchor_title:"\u63D2\u5165/\u7DE8\u8F2F\u9328\u9EDE", anchor_name:"\u9328\u9EDE\u540D\u7A31", code_title:"HTML\u6E90\u4EE3\u78BC\u7DE8\u8F2F\u5668", code_wordwrap:"\u5F37\u5236\u63DB\u884C", colorpicker_title:"\u6311\u9078\u984F\u8272", colorpicker_picker_tab:"\u9078\u8272\u5668", colorpicker_picker_title:"\u9078\u8272\u5668", colorpicker_palette_tab:"\u8272\u76E4", colorpicker_palette_title:"\u8272\u76E4\u984F\u8272", colorpicker_named_tab:"\u9810\u8A2D\u7684", colorpicker_named_title:"\u9810\u8A2D\u7684\u984F\u8272", colorpicker_color:"\u984F\u8272:", colorpicker_name:"\u540D\u7A31:", charmap_title:"\u63D2\u5165\u7279\u6B8A\u7B26\u865F", image_title:"\u63D2\u5165/\u7DE8\u8F2F\u5716\u7247", image_src:"\u5716\u7247\u4F4D\u7F6E", image_alt:"\u5716\u7247\u8AAA\u660E", image_list:"\u5716\u7247\u5217\u8868", image_border:"\u908A\u6846", image_dimensions:"\u5C3A\u5BF8", image_vspace:"\u5782\u76F4\u9593\u8DDD", image_hspace:"\u6C34\u5E73\u9593\u8DDD", image_align:"\u5C0D\u9F4A\u65B9\u5F0F", image_align_baseline:"\u57FA\u7DDA", image_align_top:"\u9760\u4E0A\u5C0D\u9F4A", image_align_middle:"\u7F6E\u4E2D\u5C0D\u9F4A", image_align_bottom:"\u9760\u4E0B\u5C0D\u9F4A", image_align_texttop:"\u6587\u5B57\u4E0A\u65B9", image_align_textbottom:"\u6587\u5B57\u4E0B\u65B9", image_align_left:"\u9760\u5DE6\u5C0D\u9F4A", image_align_right:"\u9760\u53F3\u5C0D\u9F4A", link_title:"\u63D2\u5165/\u7DE8\u8F2F\u9023\u7D50", link_url:"\u93C8\u63A5\u5730\u5740", link_target:"\u76EE\u6A19", link_target_same:"\u958B\u555F\u93C8\u63A5\u65BC\u6B64\u7A97\u53E3", link_target_blank:"\u958B\u555F\u93C8\u63A5\u65BC\u65B0\u7684\u7A97\u53E3", link_titlefield:"\u6A19\u984C", link_is_email:"\u60A8\u8F38\u5165\u7684\u7DB2\u5740\u61C9\u8A72\u662F\u4E00\u500B\u96FB\u5B50\u90F5\u4EF6\u5730\u5740\uFF0C\u662F\u5426\u9700\u8981\u5728\u5730\u5740\u524D\u65B9\u52A0\u5165mailto:\uFF1F", link_is_external:"\u60A8\u8F38\u5165\u7684\u7DB2\u5740\u61C9\u8A72\u662F\u4E00\u500B\u5916\u90E8\u9023\u7D50\uFF0C\u662F\u5426\u9700\u8981\u5728\u7DB2\u5740\u524D\u65B9\u52A0\u5165http://\uFF1F", link_list:"\u93C8\u63A5\u6E05\u55AE" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/zu.js000066400000000000000000000050301226600447100233260ustar00rootroot00000000000000tinyMCE.addI18n('zu.advanced',{ style_select:"\u6837\u5F0F", font_size:"\u5B57\u4F53\u5927\u5C0F", fontdefault:"\u5B57\u4F53", block:"\u683C\u5F0F", paragraph:"\u6BB5\u843D", div:"DIV\u5C42", address:"\u5730\u5740", pre:"\u65E0\u5F0F\u6837\u7F16\u6392", h1:"\u6807\u98981", h2:"\u6807\u98982", h3:"\u6807\u98983", h4:"\u6807\u98984", h5:"\u6807\u98985", h6:"\u6807\u98986", blockquote:"\u5F15\u7528", code:"\u4EE3\u7801", samp:"\u4EE3\u7801\u6837\u4F8B", dt:"\u540D\u8BCD\u5B9A\u4E49", dd:"\u540D\u8BCD\u89E3\u91CA", bold_desc:"\u9ED1\u4F53(Ctrl+B)", italic_desc:"\u659C\u4F53(Ctrl+I)", underline_desc:"\u4E0B\u5212\u7EBF(Ctrl+U)", striketrough_desc:"\u5220\u9664\u7EBF", justifyleft_desc:"\u5DE6\u5BF9\u9F50", justifycenter_desc:"\u5C45\u4E2D", justifyright_desc:"\u53F3\u5BF9\u9F50", justifyfull_desc:"\u4E24\u7AEF\u5BF9\u9F50", bullist_desc:"\u5706\u70B9", numlist_desc:"\u7F16\u53F7", outdent_desc:"\u51CF\u5C11\u7F29\u8FDB", indent_desc:"\u589E\u52A0\u7F29\u8FDB", undo_desc:"\u64A4\u9500(Ctrl+Z)", redo_desc:"\u91CD\u505A(Ctrl+Y)", link_desc:"\u63D2\u5165/\u7F16\u8F91\u94FE\u63A5", unlink_desc:"\u53D6\u6D88\u94FE\u63A5", image_desc:"\u63D2\u5165/\u7F16\u8F91\u56FE\u7247", cleanup_desc:"\u6E05\u9664\u591A\u4F59\u4EE3\u7801", code_desc:"\u7F16\u8F91HTML", sub_desc:"\u4E0B\u6807", sup_desc:"\u4E0A\u6807", hr_desc:"\u63D2\u5165\u6C34\u5E73\u7EBF", removeformat_desc:"\u6E05\u9664\u6837\u5F0F", custom1_desc:"\u5728\u6B64\u8F93\u5165\u60A8\u7684\u63CF\u8FF0", forecolor_desc:"\u9009\u62E9\u6587\u5B57\u989C\u8272", backcolor_desc:"\u9009\u62E9\u80CC\u666F\u989C\u8272", charmap_desc:"\u63D2\u5165\u7279\u6B8A\u7B26\u53F7", visualaid_desc:"\u5F00\u5173\u683C\u7EBF/\u9690\u85CF\u5143\u4EF6", anchor_desc:"\u63D2\u5165/\u7F16\u8F91\u951A\u70B9", cut_desc:"\u526A\u5207", copy_desc:"\u590D\u5236", paste_desc:"\u7C98\u8D34", image_props_desc:"\u56FE\u7247\u5C5E\u6027", newdocument_desc:"\u65B0\u6587\u4EF6", help_desc:"\u8BF4\u660E", blockquote_desc:"\u5F15\u7528", clipboard_msg:"\u590D\u5236\u3001\u526A\u5207\u53CA\u7C98\u8D34\u529F\u80FD\u5728Mozilla\u548CFirefox\u4E2D\u4E0D\u80FD\u4F7F\u7528\u3002 \n\u662F\u5426\u9700\u8981\u4E86\u89E3\u66F4\u591A\u6709\u5173\u6B64\u95EE\u9898\u7684\u4FE1\u606F\uFF1F", path:"\u4F4D\u7F6E", newdocument:"\u60A8\u786E\u8BA4\u8981\u6E05\u9664\u5168\u90E8\u5185\u5BB9\u5417\uFF1F", toolbar_focus:"\u5DE5\u5177\u6309\u94AE- Alt+Q,\u7F16\u8F91\u5668- Alt-Z,\u5143\u4EF6\u4F4D\u7F6E- Alt-X", more_colors:"\u66F4\u591A\u989C\u8272", link_delta_width:"40", link_delta_height:"60" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/langs/zu_dlg.js000066400000000000000000000046571226600447100241720ustar00rootroot00000000000000tinyMCE.addI18n('zu.advanced_dlg',{ about_title:"\u5173\u4E8ETinyMCE", about_general:"\u5173\u4E8E", about_help:"\u5E2E\u52A9", about_license:"\u6388\u6743", about_plugins:"\u5168\u90E8\u63D2\u4EF6", about_plugin:"\u63D2\u4EF6", about_author:"\u4F5C\u8005", about_version:"\u7248\u672C", about_loaded:"\u5DF2\u8F7D\u5165\u7684\u63D2\u4EF6", anchor_title:"\u63D2\u5165/\u7F16\u8F91\u951A\u70B9", anchor_name:"\u951A\u70B9\u540D\u79F0", code_title:"HTML\u7F16\u8F91\u5668", code_wordwrap:"\u6574\u5B57\u6362\u884C", colorpicker_title:"\u6311\u9009\u989C\u8272", colorpicker_picker_tab:"\u9009\u8272\u5668", colorpicker_picker_title:"\u9009\u8272\u5668", colorpicker_palette_tab:"\u8C03\u8272\u677F", colorpicker_palette_title:"\u8C03\u8272\u677F\u989C\u8272", colorpicker_named_tab:"\u9884\u8BBE\u7684", colorpicker_named_title:"\u9884\u8BBE\u7684\u989C\u8272", colorpicker_color:"\u989C\u8272:", colorpicker_name:"\u540D\u79F0:", charmap_title:"\u63D2\u5165\u7279\u6B8A\u7B26\u53F7", image_title:"\u63D2\u5165/\u7F16\u8F91\u56FE\u7247", image_src:"\u56FE\u7247\u5730\u5740", image_alt:"\u56FE\u7247\u8BF4\u660E", image_list:"\u56FE\u7247\u6E05\u5355", image_border:"\u8FB9\u6846", image_dimensions:"\u5C3A\u5BF8", image_vspace:"\u5782\u76F4\u95F4\u8DDD", image_hspace:"\u6C34\u51C6\u95F4\u8DDD", image_align:"\u5BF9\u9F50\u65B9\u5F0F", image_align_baseline:"\u57FA\u7EBF", image_align_top:"\u4E0A\u65B9\u5BF9\u9F50", image_align_middle:"\u5C45\u4E2D\u5BF9\u9F50", image_align_bottom:"\u5E95\u90E8\u5BF9\u9F50", image_align_texttop:"\u6587\u5B57\u4E0A\u65B9", image_align_textbottom:"\u6587\u5B57\u4E0B\u65B9", image_align_left:"\u9760\u5DE6\u5BF9\u9F50", image_align_right:"\u9760\u53F3\u5BF9\u9F50", link_title:"\u63D2\u5165/\u7F16\u8F91\u94FE\u63A5", link_url:"\u94FE\u63A5\u5730\u5740", link_target:"\u76EE\u6807", link_target_same:"\u5728\u6B64\u7A97\u53E3\u6253\u5F00\u94FE\u63A5", link_target_blank:"\u5728\u65B0\u7A97\u53E3\u6253\u5F00\u94FE\u63A5", link_titlefield:"\u6807\u9898", link_is_email:"\u60A8\u8F93\u5165\u7684\u7F51\u5740\u5E94\u8BE5\u662F\u4E00\u4E2A\u7535\u5B50\u90AE\u4EF6\u5730\u5740\uFF0C\u662F\u5426\u9700\u8981\u5728\u5730\u5740\u524D\u65B9\u52A0\u5165mailto:\uFF1F", link_is_external:"\u60A8\u8F93\u5165\u7684\u7F51\u5740\u5E94\u8BE5\u662F\u4E00\u4E2A\u5916\u90E8\u94FE\u63A5\uFF0C\u662F\u5426\u9700\u8981\u5728\u7F51\u5740\u524D\u65B9\u52A0\u5165http://\uFF1F", link_list:"\u94FE\u63A5\u6E05\u5355" });glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/link.htm000066400000000000000000000047371226600447100227120ustar00rootroot00000000000000 {#advanced_dlg.link_title}
     
    glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/shortcuts.htm000066400000000000000000000033041226600447100240000ustar00rootroot00000000000000 {#advanced_dlg.accessibility_help}

    {#advanced_dlg.accessibility_usage_title}

    Toolbars

    Press ALT-F10 to move focus to the toolbars. Navigate through the buttons using the arrow keys. Press enter to activate a button and return focus to the editor. Press escape to return focus to the editor without performing any actions.

    Status Bar

    To access the editor status bar, press ALT-F11. Use the left and right arrow keys to navigate between elements in the path. Press enter or space to select an element. Press escape to return focus to the editor without changing the selection.

    Context Menu

    Press shift-F10 to activate the context menu. Use the up and down arrow keys to move between menu items. To open sub-menus press the right arrow key. To close submenus press the left arrow key. Press escape to close the context menu.

    Keyboard Shortcuts

    Keystroke Function
    Control-BBold
    Control-IItalic
    Control-ZUndo
    Control-YRedo
    glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/skins/000077500000000000000000000000001226600447100223575ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/skins/default/000077500000000000000000000000001226600447100240035ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/skins/default/content.css000066400000000000000000000050571226600447100261760ustar00rootroot00000000000000body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} body {background:#FFF;} body.mceForceColors {background:#FFF; color:#000;} body.mceBrowserDefaults {background:transparent; color:inherit; font-size:inherit; font-family:inherit;} h1 {font-size: 2em} h2 {font-size: 1.5em} h3 {font-size: 1.17em} h4 {font-size: 1em} h5 {font-size: .83em} h6 {font-size: .75em} .mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} a.mceItemAnchor {display:inline-block; -webkit-user-select:all; -webkit-user-modify:read-only; -moz-user-select:all; -moz-user-modify:read-only; width:11px !important; height:11px !important; background:url(img/items.gif) no-repeat center center} span.mceItemNbsp {background: #DDD} td.mceSelected, th.mceSelected {background-color:#3399ff !important} img {border:0;} table, img, hr, .mceItemAnchor {cursor:default} table td, table th {cursor:text} ins {border-bottom:1px solid green; text-decoration: none; color:green} del {color:red; text-decoration:line-through} cite {border-bottom:1px dashed blue} acronym {border-bottom:1px dotted #CCC; cursor:help} abbr {border-bottom:1px dashed #CCC; cursor:help} /* IE */ * html body { scrollbar-3dlight-color:#F0F0EE; scrollbar-arrow-color:#676662; scrollbar-base-color:#F0F0EE; scrollbar-darkshadow-color:#DDD; scrollbar-face-color:#E0E0DD; scrollbar-highlight-color:#F0F0EE; scrollbar-shadow-color:#F0F0EE; scrollbar-track-color:#F5F5F5; } img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} font[face=mceinline] {font-family:inherit !important} *[contentEditable]:focus {outline:0} .mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} .mceItemShockWave {background-image:url(../../img/shockwave.gif)} .mceItemFlash {background-image:url(../../img/flash.gif)} .mceItemQuickTime {background-image:url(../../img/quicktime.gif)} .mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} .mceItemRealMedia {background-image:url(../../img/realmedia.gif)} .mceItemVideo {background-image:url(../../img/video.gif)} .mceItemAudio {background-image:url(../../img/video.gif)} .mceItemEmbeddedAudio {background-image:url(../../img/video.gif)} .mceItemIframe {background-image:url(../../img/iframe.gif)} .mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/skins/default/dialog.css000066400000000000000000000132011226600447100257510ustar00rootroot00000000000000/* Generic */ body { font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; scrollbar-3dlight-color:#F0F0EE; scrollbar-arrow-color:#676662; scrollbar-base-color:#F0F0EE; scrollbar-darkshadow-color:#DDDDDD; scrollbar-face-color:#E0E0DD; scrollbar-highlight-color:#F0F0EE; scrollbar-shadow-color:#F0F0EE; scrollbar-track-color:#F5F5F5; background:#F0F0EE; padding:0; margin:8px 8px 0 8px; } html {background:#F0F0EE;} td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} textarea {resize:none;outline:none;} a:link, a:visited {color:black;} a:hover {color:#2B6FB6;} .nowrap {white-space: nowrap} /* Forms */ fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} legend {color:#2B6FB6; font-weight:bold;} label.msg {display:none;} label.invalid {color:#EE0000; display:inline;} input.invalid {border:1px solid #EE0000;} input {background:#FFF; border:1px solid #CCC;} input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} input, select, textarea {border:1px solid #808080;} input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} .input_noborder {border:0;} /* Buttons */ #insert, #cancel, input.button, .updateButton { border:0; margin:0; padding:0; font-weight:bold; width:94px; height:26px; background:url(img/buttons.png) 0 -26px; cursor:pointer; padding-bottom:2px; float:left; } #insert {background:url(img/buttons.png) 0 -52px} #cancel {background:url(img/buttons.png) 0 0; float:right} /* Browse */ a.pickcolor, a.browse {text-decoration:none} a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} .mceOldBoxModel a.browse span {width:22px; height:20px;} a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} .mceOldBoxModel a.pickcolor span {width:21px; height:17px;} a.pickcolor:hover span {background-color:#B2BBD0;} a.pickcolor:hover span.disabled {} /* Charmap */ table.charmap {border:1px solid #AAA; text-align:center} td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} #charmap a {display:block; color:#000; text-decoration:none; border:0} #charmap a:hover {background:#CCC;color:#2B6FB6} #charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} #charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} /* Source */ .wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} .mceActionPanel {margin-top:5px;} /* Tabs classes */ .tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;} .tabs ul {margin:0; padding:0; list-style:none;} .tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} .tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} .tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} .tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;} .tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} .tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} /* Panels */ .panel_wrapper div.panel {display:none;} .panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} .panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} /* Columns */ .column {float:left;} .properties {width:100%;} .properties .column1 {} .properties .column2 {text-align:left;} /* Titles */ h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} h3 {font-size:14px;} .title {font-size:12px; font-weight:bold; color:#2B6FB6;} /* Dialog specific */ #link .panel_wrapper, #link div.current {height:125px;} #image .panel_wrapper, #image div.current {height:200px;} #plugintable thead {font-weight:bold; background:#DDD;} #plugintable, #about #plugintable td {border:1px solid #919B9C;} #plugintable {width:96%; margin-top:10px;} #pluginscontainer {height:290px; overflow:auto;} #colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px} #colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline} #colorpicker #preview_wrapper { text-align:center; padding-top:4px; white-space: nowrap} #colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} #colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} #colorpicker #light div {overflow:hidden;} #colorpicker .panel_wrapper div.current {height:175px;} #colorpicker #namedcolors {width:150px;} #colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} #colorpicker #colornamecontainer {margin-top:5px;} #colorpicker #picker_panel fieldset {margin:auto;width:325px;} glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/skins/default/img/000077500000000000000000000000001226600447100245575ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/skins/default/img/buttons.png000066400000000000000000000060751226600447100267730ustar00rootroot00000000000000PNG  IHDR^NQOPLTE! 𴳲[[[^žu\ apī' xxxlllHHH»***kkkܻĽǿ޾444JJJ׷ĻٹyyyzzzKKK߿]]]ȿvvvü^0}#999UUUBBB111KYYYᑢ9```nnnDY>>>rrrMMMӿtttgggċ%%%bq慅쑐1M IDATxڵ_SWor0[3 i 0 f$A8"ʦ -Uu[8֥>mgKJ |sJ?W(..^P W _n LӦ?QxXXx)wT5k֬=T0SKcPJ^Yh3yp "%C_J,`NNNj LXZJlY<Ճjqԡ$w(0QjCpr^v?fTJP@'ի8",QZKIIQCCHڒ,cYCԮSJjuzYR~uD\&\KCv&srh/T](שԚ.3 Nb7RYjen1jlhn6\ǩihpnl`u :͌hC/F3ڠ KW 75560. ̧X #l5.dҤW5M&[{Z\L*M2ԈؐlE{ИQ"[mJ2bTvuu ;`dD4 Gts?qVnf& B Mf5 WG/Mh Hu=M/~!gƍW^piJ}܁}O;/XOQ#rqj8mË9!|}1k^߬7k8޾s*eifsmpp9' w.[^; &O0PQSSLzzRc3Ka)6 bfr` +ZT`&EE+T@/E mUоx&Xe1J딕'bXY,vEekb#B ++ke*+?sU8wEih$:)~/@,YYXLZp9*+&~>hnx''b 3uSN׳(ݴXP|sqf3&KISG=+W/Ds{񱱱q!m8tZ8n{cc86{Ibӿ:9|>e˖*Bibq2 u-><6333nw|R-Yx-0^36#GG:70dyݛGK{L--Үᵻ-P2U$ΤOeBܳܛ>JQd\g{J[8$$k'{=I Ç;r>XQW.}`Qy]z;@q)C`n_MЧi!OG|4GPs02!Yqф??Ws}}?NۏFg'UJ\#dCf!cDfu+7n ?-*Y`b{圪xn;蛞Ue#ŋ Nq?Satr!\{ ʗwyN\_V9n'̷9#^|8]az[]X4똼vYF:΄q+V>Y~ =nueYsl-x3(,l Lm9q&XmgϮgVl[j߾Ukn.-ӆʕRFD1e ,)h2H}9'[6BF_.ۧ43+Sn{Mpfka#wi)>햭|[87=s%w*IjCd*fFTcJ6?.mQXC /B"Ja%?*儏.m⡁.MTקui)ڥY nJV&:8<Tqs 046tH.դo.MҐA0j4.Mz%bBv{NHGJ@=K3 'xXo@q&[O9#hE#`ؖ6lp+NIENDB`glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/skins/default/img/items.gif000066400000000000000000000001001226600447100263560ustar00rootroot00000000000000GIF89a !, @Dwڃq|a4b;glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif000066400000000000000000000001041226600447100274170ustar00rootroot00000000000000GIF89a!, zq(׉*;glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/skins/default/img/menu_check.gif000066400000000000000000000001061226600447100273440ustar00rootroot00000000000000GIF89a!,;i#~ʶ{;glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/skins/default/img/progress.gif000066400000000000000000000033731226600447100271200ustar00rootroot00000000000000GIF89a 򺺺444ėTTT! NETSCAPE2.0!, I)KͧJJ5URK(&05+/mbp z 1;$1CI* HCh`Ao"3qT5\8aBdwxG=YgwHbvA=0V\\; ;H0t%HsrY™ ,bLv|?4BvʛPu9+& 2x& k& U] vo opraT&!,{ 'e7\l-)S7@&4+`yTSL\:=Jk:;eĈ8cA8Oj@b/+:{ tyt#|- mN qK!,lI+8b̠y h*Zp=3`C`B"pX 9bPB`Z= 8>u,St"ΦOT\um|; 8~*!,xIA]GeAPb)"!s BI М V 5q((X2=,I n#&AVq5t sny\)_g|r5!,gD+8[{`&y_hI)(L "+gN8l5"LA .%@%O@8NgL+Ƀpus/ jȩjVj c7 I!,\0t p hQm6Tqmx( 6'sa@`]-lz0 _g ir!` !,s ءXP\|)pWʄQ稊G.}!*1p v;Tݩ2 X )|f%9`}0PFd~ezGw);glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/skins/default/img/tabs.gif000066400000000000000000000024521226600447100262020ustar00rootroot00000000000000GIF89a,Z62Jb͑󡳻!6,,Z@@CQ(Ȥrl:ШtJZج6[XxL.zn|N(~562*(, H*\ #JHŋ3jȱǏ CI$"HXɲ˗0cʜI͛8sɳ@}GѣH*]ʴӧPJJիXƢ`ÊKóhӶKЀڷpVSܻxk®޿ Lp+^̸d ̘L˘3k̹ϠCMӨOaװc˞M۸sͻ  +_μУKNسkνwVNOӫ_Ͼ˟O3p (h& 6F(a[ue$eevJZ$hb/ Չ,⋞4h8.n:Aԁ ZFn;1P圫杇 un:;R~`:?cB_nG %Cg{3|T\g"3v>|bOŬ\jHk30MWȝ .Vl8 kU|w#L/!5 naԡSNEztPu*!G_;Dau* ϊ Bacpp7E {<-@jТѢ8/!WaYaZ|AV:. R xX8`T@h5ZZ켡T~12wa{M Gc6ÿzG|RQЃ6P` 8Ƕـ`0UуGQ" #T3J@i~u"NQ N7'dl1tkUqtH{o+p๭0Jer<2$sOI̍t$jM͐!u:uV̑\N %]=y*yJ@& ÁF a.De,uXuQR ;!rcaG-GiFkΣx+#'"_]|OԐ흢6zbG䞦@p]uE@3u<*R0ܨ3TTK{Ly<,;{/g"N3|F- 20׫dS%r{9y|zg|5!5/EXumE.9;2_v%YT]kf- T)9;crt#=;Ou]2{)rnR$wyD)'-=$g0 UAڸ@F(cûD8oޒ.YL&HMG8Cfn3PCpf:t@,9!g>& X-V=kd_'*AO@%E?Orߜ9F2^,YO @ x$E.QWBR]%2(c Vb D-=,kRV%(cc@u8:A9* A##nJ  QVD9VW(c1$K/qÀ 8ϑI(c `18g0?ƏIu*QK9 M>+D3n9N3ќlN9RƑ H8Ki>]RJ8jXz%e(c͒ڢ*(Cܡ8Z,CEY"^ Qq'BjڪQq2s8N4uU#8݇ lU0(ॆL Kb c-zUO؟LCDTH9y%l((*sz>.mff~=IENDB`glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png000066400000000000000000000012131226600447100275370ustar00rootroot00000000000000PNG  IHDRXB pHYs  PLTESSSrv|ĻƻǼȾɿ?MPTW[^beimrv{ǀɄˉ͎uz߄btRNS,ЩWIDATX핱jA   jL&]g/ FTA{X6ZofoO6|)wG/X}Ƈ"qK`^æ)}j6lIՒVA3s}j ѯgT2hr/-@@6ǘGWN-NGmIXu]&ؼ!o`fuTy?nWLz1&ع?Tpu{֘޸7E}{:߼6~5Y3߳ϑѾ{}dkzJ/`W~hA=pHʃ&~[9gR33hχ <kq3"Wu$k363ڠkxG"A%xX_0dh)%%̖7nҿrg>OGtqƚQ:x+<烿`må),N!\#ew|g}o/esF`5Wpf.?~6w!sܝkC횛A//}o~F:pt!XjGD~y@qnG;8ox3 ='] ?NIPנOpZ}&o4sw0%1_(QנSp(e9# Ʒ9D \]O~!Ψ# ^+g Sa1\CͻY+r|(;sZvs~(D?"!xcl~fL9Y`QD99`~}vwrS+ O~zh1iu ؽTyZbpQ׹*>MD0&s7 + 8ݴC0Mวsܴ?-`gmYApS?^vsT1:KzAs5FDM9>-;V~U Z݄rcS΍9qOG)`3-%tۆrEK2SEk1 ^{ܿ_;2_i1̧IENDB`glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/skins/o2k7/ui.css000066400000000000000000000360551226600447100243010ustar00rootroot00000000000000/* Reset */ .o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} .o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} .o2k7Skin table td {vertical-align:middle} /* Containers */ .o2k7Skin table {background:transparent} .o2k7Skin iframe {display:block;} .o2k7Skin .mceToolbar {height:26px} /* External */ .o2k7Skin .mceExternalToolbar {position:absolute; border:1px solid #ABC6DD; border-bottom:0; display:none} .o2k7Skin .mceExternalToolbar td.mceToolbar {padding-right:13px;} .o2k7Skin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} /* Layout */ .o2k7Skin table.mceLayout {border:0; border-left:1px solid #ABC6DD; border-right:1px solid #ABC6DD} .o2k7Skin table.mceLayout tr.mceFirst td {border-top:1px solid #ABC6DD} .o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD} .o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0} .o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD} .o2k7Skin td.mceToolbar{background:#E5EFFD} .o2k7Skin .mceStatusbar {background:#E5EFFD; display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px} .o2k7Skin .mceStatusbar div {float:left; padding:2px} .o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0} .o2k7Skin .mceStatusbar a:hover {text-decoration:underline} .o2k7Skin table.mceToolbar {margin-left:3px} .o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;} .o2k7Skin .mceToolbar td.mceFirst span {margin:0} .o2k7Skin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} .o2k7Skin .mceToolbar .mceToolbarEndListBox span, .o2k7Skin .mceToolbar .mceToolbarStartListBox span {display:none} .o2k7Skin span.mceIcon, .o2k7Skin img.mceIcon {display:block; width:20px; height:20px} .o2k7Skin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} .o2k7Skin td.mceCenter {text-align:center;} .o2k7Skin td.mceCenter table {margin:0 auto; text-align:left;} .o2k7Skin td.mceRight table {margin:0 0 0 auto;} /* Button */ .o2k7Skin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} .o2k7Skin a.mceButton span, .o2k7Skin a.mceButton img {margin-left:1px} .o2k7Skin .mceOldBoxModel a.mceButton span, .o2k7Skin .mceOldBoxModel a.mceButton img {margin:0 0 0 1px} .o2k7Skin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} .o2k7Skin a.mceButtonActive, .o2k7Skin a.mceButtonSelected {background-position:0 -44px} .o2k7Skin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} .o2k7Skin .mceButtonLabeled {width:auto} .o2k7Skin .mceButtonLabeled span.mceIcon {float:left} .o2k7Skin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} .o2k7Skin .mceButtonDisabled .mceButtonLabel {color:#888} /* Separator */ .o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} /* ListBox */ .o2k7Skin .mceListBox {padding-left: 3px} .o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block} .o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} .o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0} .o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF} .o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px} .o2k7Skin .mceListBoxDisabled .mceText {color:gray} .o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden; margin-left:3px} .o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px} .o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;} /* SplitButton */ .o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px; direction:ltr} .o2k7Skin .mceSplitButton {background:url(img/button_bg.png)} .o2k7Skin .mceSplitButton a.mceAction {width:22px} .o2k7Skin .mceSplitButton span.mceAction {width:22px; background-image:url(../../img/icons.gif)} .o2k7Skin .mceSplitButton a.mceOpen {width:10px; background:url(img/button_bg.png) -44px 0} .o2k7Skin .mceSplitButton span.mceOpen {display:none} .o2k7Skin table.mceSplitButtonEnabled:hover a.mceAction, .o2k7Skin .mceSplitButtonHover a.mceAction, .o2k7Skin .mceSplitButtonSelected {background:url(img/button_bg.png) 0 -22px} .o2k7Skin table.mceSplitButtonEnabled:hover a.mceOpen, .o2k7Skin .mceSplitButtonHover a.mceOpen, .o2k7Skin .mceSplitButtonSelected a.mceOpen {background-position:-44px -44px} .o2k7Skin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} .o2k7Skin .mceSplitButtonActive {background-position:0 -44px} /* ColorSplitButton */ .o2k7Skin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} .o2k7Skin .mceColorSplitMenu td {padding:2px} .o2k7Skin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} .o2k7Skin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} .o2k7Skin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} .o2k7Skin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} .o2k7Skin a.mceMoreColors:hover {border:1px solid #0A246A} .o2k7Skin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a;overflow:hidden} .o2k7Skin .mce_forecolor span.mceAction, .o2k7Skin .mce_backcolor span.mceAction {height:15px;overflow:hidden} /* Menu */ .o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD; direction:ltr} .o2k7Skin .mceNoIcons span.mceIcon {width:0;} .o2k7Skin .mceNoIcons a .mceText {padding-left:10px} .o2k7Skin .mceMenu table {background:#FFF} .o2k7Skin .mceMenu a, .o2k7Skin .mceMenu span, .o2k7Skin .mceMenu {display:block} .o2k7Skin .mceMenu td {height:20px} .o2k7Skin .mceMenu a {position:relative;padding:3px 0 4px 0} .o2k7Skin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} .o2k7Skin .mceMenu span.mceText, .o2k7Skin .mceMenu .mcePreview {font-size:11px} .o2k7Skin .mceMenu pre.mceText {font-family:Monospace} .o2k7Skin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} .o2k7Skin .mceMenu .mceMenuItemEnabled a:hover, .o2k7Skin .mceMenu .mceMenuItemActive {background-color:#dbecf3} .o2k7Skin td.mceMenuItemSeparator {background:#DDD; height:1px} .o2k7Skin .mceMenuItemTitle a {border:0; background:#E5EFFD; border-bottom:1px solid #ABC6DD} .o2k7Skin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} .o2k7Skin .mceMenuItemDisabled .mceText {color:#888} .o2k7Skin .mceMenuItemSelected .mceIcon {background:url(../default/img/menu_check.gif)} .o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center} .o2k7Skin .mceMenu span.mceMenuLine {display:none} .o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;} .o2k7Skin .mceMenuItem td, .o2k7Skin .mceMenuItem th {line-height: normal} /* Progress,Resize */ .o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} .o2k7Skin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} /* Rtl */ .mceRtl .mceListBox .mceText {text-align: right; padding: 0 4px 0 0} .mceRtl .mceMenuItem .mceText {text-align: right} /* Formats */ .o2k7Skin .mce_formatPreview a {font-size:10px} .o2k7Skin .mce_p span.mceText {} .o2k7Skin .mce_address span.mceText {font-style:italic} .o2k7Skin .mce_pre span.mceText {font-family:monospace} .o2k7Skin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} .o2k7Skin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} .o2k7Skin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} .o2k7Skin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} .o2k7Skin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} .o2k7Skin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} /* Theme */ .o2k7Skin span.mce_bold {background-position:0 0} .o2k7Skin span.mce_italic {background-position:-60px 0} .o2k7Skin span.mce_underline {background-position:-140px 0} .o2k7Skin span.mce_strikethrough {background-position:-120px 0} .o2k7Skin span.mce_undo {background-position:-160px 0} .o2k7Skin span.mce_redo {background-position:-100px 0} .o2k7Skin span.mce_cleanup {background-position:-40px 0} .o2k7Skin span.mce_bullist {background-position:-20px 0} .o2k7Skin span.mce_numlist {background-position:-80px 0} .o2k7Skin span.mce_justifyleft {background-position:-460px 0} .o2k7Skin span.mce_justifyright {background-position:-480px 0} .o2k7Skin span.mce_justifycenter {background-position:-420px 0} .o2k7Skin span.mce_justifyfull {background-position:-440px 0} .o2k7Skin span.mce_anchor {background-position:-200px 0} .o2k7Skin span.mce_indent {background-position:-400px 0} .o2k7Skin span.mce_outdent {background-position:-540px 0} .o2k7Skin span.mce_link {background-position:-500px 0} .o2k7Skin span.mce_unlink {background-position:-640px 0} .o2k7Skin span.mce_sub {background-position:-600px 0} .o2k7Skin span.mce_sup {background-position:-620px 0} .o2k7Skin span.mce_removeformat {background-position:-580px 0} .o2k7Skin span.mce_newdocument {background-position:-520px 0} .o2k7Skin span.mce_image {background-position:-380px 0} .o2k7Skin span.mce_help {background-position:-340px 0} .o2k7Skin span.mce_code {background-position:-260px 0} .o2k7Skin span.mce_hr {background-position:-360px 0} .o2k7Skin span.mce_visualaid {background-position:-660px 0} .o2k7Skin span.mce_charmap {background-position:-240px 0} .o2k7Skin span.mce_paste {background-position:-560px 0} .o2k7Skin span.mce_copy {background-position:-700px 0} .o2k7Skin span.mce_cut {background-position:-680px 0} .o2k7Skin span.mce_blockquote {background-position:-220px 0} .o2k7Skin .mce_forecolor span.mceAction {background-position:-720px 0} .o2k7Skin .mce_backcolor span.mceAction {background-position:-760px 0} .o2k7Skin span.mce_forecolorpicker {background-position:-720px 0} .o2k7Skin span.mce_backcolorpicker {background-position:-760px 0} /* Plugins */ .o2k7Skin span.mce_advhr {background-position:-0px -20px} .o2k7Skin span.mce_ltr {background-position:-20px -20px} .o2k7Skin span.mce_rtl {background-position:-40px -20px} .o2k7Skin span.mce_emotions {background-position:-60px -20px} .o2k7Skin span.mce_fullpage {background-position:-80px -20px} .o2k7Skin span.mce_fullscreen {background-position:-100px -20px} .o2k7Skin span.mce_iespell {background-position:-120px -20px} .o2k7Skin span.mce_insertdate {background-position:-140px -20px} .o2k7Skin span.mce_inserttime {background-position:-160px -20px} .o2k7Skin span.mce_absolute {background-position:-180px -20px} .o2k7Skin span.mce_backward {background-position:-200px -20px} .o2k7Skin span.mce_forward {background-position:-220px -20px} .o2k7Skin span.mce_insert_layer {background-position:-240px -20px} .o2k7Skin span.mce_insertlayer {background-position:-260px -20px} .o2k7Skin span.mce_movebackward {background-position:-280px -20px} .o2k7Skin span.mce_moveforward {background-position:-300px -20px} .o2k7Skin span.mce_media {background-position:-320px -20px} .o2k7Skin span.mce_nonbreaking {background-position:-340px -20px} .o2k7Skin span.mce_pastetext {background-position:-360px -20px} .o2k7Skin span.mce_pasteword {background-position:-380px -20px} .o2k7Skin span.mce_selectall {background-position:-400px -20px} .o2k7Skin span.mce_preview {background-position:-420px -20px} .o2k7Skin span.mce_print {background-position:-440px -20px} .o2k7Skin span.mce_cancel {background-position:-460px -20px} .o2k7Skin span.mce_save {background-position:-480px -20px} .o2k7Skin span.mce_replace {background-position:-500px -20px} .o2k7Skin span.mce_search {background-position:-520px -20px} .o2k7Skin span.mce_styleprops {background-position:-560px -20px} .o2k7Skin span.mce_table {background-position:-580px -20px} .o2k7Skin span.mce_cell_props {background-position:-600px -20px} .o2k7Skin span.mce_delete_table {background-position:-620px -20px} .o2k7Skin span.mce_delete_col {background-position:-640px -20px} .o2k7Skin span.mce_delete_row {background-position:-660px -20px} .o2k7Skin span.mce_col_after {background-position:-680px -20px} .o2k7Skin span.mce_col_before {background-position:-700px -20px} .o2k7Skin span.mce_row_after {background-position:-720px -20px} .o2k7Skin span.mce_row_before {background-position:-740px -20px} .o2k7Skin span.mce_merge_cells {background-position:-760px -20px} .o2k7Skin span.mce_table_props {background-position:-980px -20px} .o2k7Skin span.mce_row_props {background-position:-780px -20px} .o2k7Skin span.mce_split_cells {background-position:-800px -20px} .o2k7Skin span.mce_template {background-position:-820px -20px} .o2k7Skin span.mce_visualchars {background-position:-840px -20px} .o2k7Skin span.mce_abbr {background-position:-860px -20px} .o2k7Skin span.mce_acronym {background-position:-880px -20px} .o2k7Skin span.mce_attribs {background-position:-900px -20px} .o2k7Skin span.mce_cite {background-position:-920px -20px} .o2k7Skin span.mce_del {background-position:-940px -20px} .o2k7Skin span.mce_ins {background-position:-960px -20px} .o2k7Skin span.mce_pagebreak {background-position:0 -40px} .o2k7Skin span.mce_restoredraft {background-position:-20px -40px} .o2k7Skin span.mce_spellchecker {background-position:-540px -20px} .o2k7Skin span.mce_visualblocks {background-position: -40px -40px} glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/skins/o2k7/ui_black.css000066400000000000000000000032371226600447100254310ustar00rootroot00000000000000/* Black */ .o2k7SkinBlack .mceToolbar .mceToolbarStart span, .o2k7SkinBlack .mceToolbar .mceToolbarEnd span, .o2k7SkinBlack .mceButton, .o2k7SkinBlack .mceSplitButton, .o2k7SkinBlack .mceSeparator, .o2k7SkinBlack .mceSplitButton a.mceOpen, .o2k7SkinBlack .mceListBox a.mceOpen {background-image:url(img/button_bg_black.png)} .o2k7SkinBlack td.mceToolbar, .o2k7SkinBlack td.mceStatusbar, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF} .o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0} .o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7SkinBlack .mceListBoxHover .mceText, .o2k7SkinBlack .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0} .o2k7SkinBlack .mceExternalToolbar, .o2k7SkinBlack .mceListBox .mceText, .o2k7SkinBlack div.mceMenu, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceFirst td, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceLast td, .o2k7SkinBlack .mceIframeContainer {border-color: #535353;} .o2k7SkinBlack table.mceSplitButtonEnabled:hover a.mceAction, .o2k7SkinBlack .mceSplitButtonHover a.mceAction, .o2k7SkinBlack .mceSplitButtonSelected {background-image:url(img/button_bg_black.png)} .o2k7SkinBlack .mceMenu .mceMenuItemEnabled a:hover, .o2k7SkinBlack .mceMenu .mceMenuItemActive {background-color:#FFE7A1}glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css000066400000000000000000000015341226600447100256570ustar00rootroot00000000000000/* Silver */ .o2k7SkinSilver .mceToolbar .mceToolbarStart span, .o2k7SkinSilver .mceButton, .o2k7SkinSilver .mceSplitButton, .o2k7SkinSilver .mceSeparator, .o2k7SkinSilver .mceSplitButton a.mceOpen, .o2k7SkinSilver .mceListBox a.mceOpen {background-image:url(img/button_bg_silver.png)} .o2k7SkinSilver td.mceToolbar, .o2k7SkinSilver td.mceStatusbar, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee} .o2k7SkinSilver .mceListBox .mceText {background:#FFF} .o2k7SkinSilver .mceExternalToolbar, .o2k7SkinSilver .mceListBox .mceText, .o2k7SkinSilver div.mceMenu, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceFirst td, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceLast td, .o2k7SkinSilver .mceIframeContainer {border-color: #bbb} glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/advanced/source_editor.htm000066400000000000000000000023651226600447100246160ustar00rootroot00000000000000 {#advanced_dlg.code_title}

    glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/simple/000077500000000000000000000000001226600447100207545ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/simple/editor_template.js000066400000000000000000000042621226600447100244770ustar00rootroot00000000000000(function(){var a=tinymce.DOM;tinymce.ThemeManager.requireLangPack("simple");tinymce.create("tinymce.themes.SimpleTheme",{init:function(c,d){var e=this,b=["Bold","Italic","Underline","Strikethrough","InsertUnorderedList","InsertOrderedList"],f=c.settings;e.editor=c;c.contentCSS.push(d+"/skins/"+f.skin+"/content.css");c.onInit.add(function(){c.onNodeChange.add(function(h,g){tinymce.each(b,function(i){g.get(i.toLowerCase()).setActive(h.queryCommandState(i))})})});a.loadCSS((f.editor_css?c.documentBaseURI.toAbsolute(f.editor_css):"")||d+"/skins/"+f.skin+"/ui.css")},renderUI:function(h){var e=this,i=h.targetNode,b,c,d=e.editor,f=d.controlManager,g;i=a.insertAfter(a.create("span",{id:d.id+"_container","class":"mceEditor "+d.settings.skin+"SimpleSkin"}),i);i=g=a.add(i,"table",{cellPadding:0,cellSpacing:0,"class":"mceLayout"});i=c=a.add(i,"tbody");i=a.add(c,"tr");i=b=a.add(a.add(i,"td"),"div",{"class":"mceIframeContainer"});i=a.add(a.add(c,"tr",{"class":"last"}),"td",{"class":"mceToolbar mceLast",align:"center"});c=e.toolbar=f.createToolbar("tools1");c.add(f.createButton("bold",{title:"simple.bold_desc",cmd:"Bold"}));c.add(f.createButton("italic",{title:"simple.italic_desc",cmd:"Italic"}));c.add(f.createButton("underline",{title:"simple.underline_desc",cmd:"Underline"}));c.add(f.createButton("strikethrough",{title:"simple.striketrough_desc",cmd:"Strikethrough"}));c.add(f.createSeparator());c.add(f.createButton("undo",{title:"simple.undo_desc",cmd:"Undo"}));c.add(f.createButton("redo",{title:"simple.redo_desc",cmd:"Redo"}));c.add(f.createSeparator());c.add(f.createButton("cleanup",{title:"simple.cleanup_desc",cmd:"mceCleanup"}));c.add(f.createSeparator());c.add(f.createButton("insertunorderedlist",{title:"simple.bullist_desc",cmd:"InsertUnorderedList"}));c.add(f.createButton("insertorderedlist",{title:"simple.numlist_desc",cmd:"InsertOrderedList"}));c.renderTo(i);return{iframeContainer:b,editorContainer:d.id+"_container",sizeContainer:g,deltaHeight:-20}},getInfo:function(){return{longname:"Simple theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.ThemeManager.add("simple",tinymce.themes.SimpleTheme)})();glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/simple/editor_template_src.js000066400000000000000000000062051226600447100253450ustar00rootroot00000000000000/** * editor_template_src.js * * Copyright 2009, Moxiecode Systems AB * Released under LGPL License. * * License: http://tinymce.moxiecode.com/license * Contributing: http://tinymce.moxiecode.com/contributing */ (function() { var DOM = tinymce.DOM; // Tell it to load theme specific language pack(s) tinymce.ThemeManager.requireLangPack('simple'); tinymce.create('tinymce.themes.SimpleTheme', { init : function(ed, url) { var t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings; t.editor = ed; ed.contentCSS.push(url + "/skins/" + s.skin + "/content.css"); ed.onInit.add(function() { ed.onNodeChange.add(function(ed, cm) { tinymce.each(states, function(c) { cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c)); }); }); }); DOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css"); }, renderUI : function(o) { var t = this, n = o.targetNode, ic, tb, ed = t.editor, cf = ed.controlManager, sc; n = DOM.insertAfter(DOM.create('span', {id : ed.id + '_container', 'class' : 'mceEditor ' + ed.settings.skin + 'SimpleSkin'}), n); n = sc = DOM.add(n, 'table', {cellPadding : 0, cellSpacing : 0, 'class' : 'mceLayout'}); n = tb = DOM.add(n, 'tbody'); // Create iframe container n = DOM.add(tb, 'tr'); n = ic = DOM.add(DOM.add(n, 'td'), 'div', {'class' : 'mceIframeContainer'}); // Create toolbar container n = DOM.add(DOM.add(tb, 'tr', {'class' : 'last'}), 'td', {'class' : 'mceToolbar mceLast', align : 'center'}); // Create toolbar tb = t.toolbar = cf.createToolbar("tools1"); tb.add(cf.createButton('bold', {title : 'simple.bold_desc', cmd : 'Bold'})); tb.add(cf.createButton('italic', {title : 'simple.italic_desc', cmd : 'Italic'})); tb.add(cf.createButton('underline', {title : 'simple.underline_desc', cmd : 'Underline'})); tb.add(cf.createButton('strikethrough', {title : 'simple.striketrough_desc', cmd : 'Strikethrough'})); tb.add(cf.createSeparator()); tb.add(cf.createButton('undo', {title : 'simple.undo_desc', cmd : 'Undo'})); tb.add(cf.createButton('redo', {title : 'simple.redo_desc', cmd : 'Redo'})); tb.add(cf.createSeparator()); tb.add(cf.createButton('cleanup', {title : 'simple.cleanup_desc', cmd : 'mceCleanup'})); tb.add(cf.createSeparator()); tb.add(cf.createButton('insertunorderedlist', {title : 'simple.bullist_desc', cmd : 'InsertUnorderedList'})); tb.add(cf.createButton('insertorderedlist', {title : 'simple.numlist_desc', cmd : 'InsertOrderedList'})); tb.renderTo(n); return { iframeContainer : ic, editorContainer : ed.id + '_container', sizeContainer : sc, deltaHeight : -20 }; }, getInfo : function() { return { longname : 'Simple theme', author : 'Moxiecode Systems AB', authorurl : 'http://tinymce.moxiecode.com', version : tinymce.majorVersion + "." + tinymce.minorVersion } } }); tinymce.ThemeManager.add('simple', tinymce.themes.SimpleTheme); })();glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/simple/img/000077500000000000000000000000001226600447100215305ustar00rootroot00000000000000glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/simple/img/icons.gif000066400000000000000000000014461226600447100233370ustar00rootroot00000000000000GIF89a)৳y4Kc1QXԚ=8)؊xYY]fm񑣹ĸϰQ˴ƴqЍ_oBܱWn9c!),@pH,Ȥrl:Шt XVN$V9H*a'<oTGuurBsE kS#[ Io[""KYKHPB  "BFYX%gJi|JrQ M|Z{Ns‹[I[' &L gr3.m@)hQ$U$K!`zF6%Qͱ#N4"F7&;GCI,ŜQ )H `,J)" 7tVU!#ʝK.R˷߿K2((fյYxFAT#v,h +ɑғ!\e)٘p"3L@fbXɆI(`̉ X[(mY$M~,7 &p|P6 H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3-gAMA|Q cHRMz%u0`:o_FPLTEΙ߃ÃÄĄÛ࠼䕯ՠ▯ԸV}⟻ᠼ⠻ܟޠޟݴIMMNNV`defjvߍux|܁܃كڄڄߋߍyyxzلutvu_`hji·͆ψUVWW`Ԙبڪʴɴ٩۶ڵʴɳӵӵڵ8DtRNSS%IDATxloFFQ QDucOUQ8,YD !% {3dAh 䈽!HAHv_JRT xK l{a-p_tOsɷnt.=t:p8sklVg!8H$o‡>uᩛp& FtŮQ G7w%^pD"a!Tdd)B 艵Xl)@߈O2V^Dl"fi!]I$I>!$$9=H4MMASE1=ۈ ) &f) '6֞O Ae>2 }vaaDl#0dfvavefa'b_`=zyfeq_99n^?\2-۷ Ù@0`  Az*4z(PVq\[8. qcnzy#:Fz<ByqMvnkt\wIi$RT."JrTT*ʥ00ˊYQv=QEQE ̉1{(٬bV<Db3'q ʫ} SiRUUUS5U4\GMS5MSUS5MT ?>>>>~gws AdI$IdI%Y2(6y-˒$K,2*o%YMUeY|>䯃èT 0 0N*''jr%咮Wczxxx2;bQ)EQR, "ykop[a+Ol7x@!x x0ه^GǏݫ~^~^]]`n_e۝N/͋ߚM{l^\4q4M4341M4Ml,˲eVjYxjYV˲ XVeYV ky6zQ^z^o4긓95M4zvfy=k{qbTqR1 eJժWKjo18(E({XTpPvR>䷓ l'q $/'y\G><-I^Hn 'pl7Iwnf7d2tBAg(wM`gKIENDB`glpi-0.84.3+dfsg.1/lib/tiny_mce/themes/simple/skins/o2k7/ui.css000066400000000000000000000044441226600447100240220ustar00rootroot00000000000000/* Reset */ .o2k7SimpleSkin table, .o2k7SimpleSkin tbody, .o2k7SimpleSkin a, .o2k7SimpleSkin img, .o2k7SimpleSkin tr, .o2k7SimpleSkin div, .o2k7SimpleSkin td, .o2k7SimpleSkin iframe, .o2k7SimpleSkin span, .o2k7SimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} /* Containers */ .o2k7SimpleSkin {position:relative} .o2k7SimpleSkin table.mceLayout {background:#E5EFFD; border:1px solid #ABC6DD;} .o2k7SimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #ABC6DD;} .o2k7SimpleSkin .mceToolbar {height:26px;} /* Layout */ .o2k7SimpleSkin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; } .o2k7SimpleSkin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} .o2k7SimpleSkin span.mceIcon, .o2k7SimpleSkin img.mceIcon {display:block; width:20px; height:20px} .o2k7SimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} /* Button */ .o2k7SimpleSkin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} .o2k7SimpleSkin a.mceButton span, .o2k7SimpleSkin a.mceButton img {margin:1px 0 0 1px} .o2k7SimpleSkin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} .o2k7SimpleSkin a.mceButtonActive {background-position:0 -44px} .o2k7SimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} /* Separator */ .o2k7SimpleSkin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} /* Theme */ .o2k7SimpleSkin span.mce_bold {background-position:0 0} .o2k7SimpleSkin span.mce_italic {background-position:-60px 0} .o2k7SimpleSkin span.mce_underline {background-position:-140px 0} .o2k7SimpleSkin span.mce_strikethrough {background-position:-120px 0} .o2k7SimpleSkin span.mce_undo {background-position:-160px 0} .o2k7SimpleSkin span.mce_redo {background-position:-100px 0} .o2k7SimpleSkin span.mce_cleanup {background-position:-40px 0} .o2k7SimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} .o2k7SimpleSkin span.mce_insertorderedlist {background-position:-80px 0} glpi-0.84.3+dfsg.1/lib/tiny_mce/tiny_mce.js000066400000000000000000007032451226600447100203560ustar00rootroot00000000000000(function(e){var a=/^\s*|\s*$/g,b,d="B".replace(/A(.)|B/,"$1")==="$1";var c={majorVersion:"3",minorVersion:"5.8",releaseDate:"2012-11-20",_init:function(){var s=this,q=document,o=navigator,g=o.userAgent,m,f,l,k,j,r;s.isOpera=e.opera&&opera.buildNumber;s.isWebKit=/WebKit/.test(g);s.isIE=!s.isWebKit&&!s.isOpera&&(/MSIE/gi).test(g)&&(/Explorer/gi).test(o.appName);s.isIE6=s.isIE&&/MSIE [56]/.test(g);s.isIE7=s.isIE&&/MSIE [7]/.test(g);s.isIE8=s.isIE&&/MSIE [8]/.test(g);s.isIE9=s.isIE&&/MSIE [9]/.test(g);s.isGecko=!s.isWebKit&&/Gecko/.test(g);s.isMac=g.indexOf("Mac")!=-1;s.isAir=/adobeair/i.test(g);s.isIDevice=/(iPad|iPhone)/.test(g);s.isIOS5=s.isIDevice&&g.match(/AppleWebKit\/(\d*)/)[1]>=534;if(e.tinyMCEPreInit){s.suffix=tinyMCEPreInit.suffix;s.baseURL=tinyMCEPreInit.base;s.query=tinyMCEPreInit.query;return}s.suffix="";f=q.getElementsByTagName("base");for(m=0;m0?b:[f.scope]);if(e===false){break}}a.inDispatch=false;return e}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,i,d,c,h;e=tinymce.trim(e);g=f.settings=g||{};if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^[\w\-]*:?\/\//.test(e)){h=g.base_uri?g.base_uri.path:new tinymce.util.URI(location.href).directory;e=((g.base_uri&&g.base_uri.protocol)||"http")+"://mce_host"+f.toAbsPath(h,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});c=g.base_uri;if(c){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host==="mce_host"){f.port=c.port}if(!f.host||f.host==="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var d=this,f;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:d});if((b.host!="mce_host"&&d.host!=b.host&&b.host)||d.port!=b.port||d.protocol!=b.protocol){return b.getURI()}var c=d.getURI(),e=b.getURI();if(c==e||(c.charAt(c.length-1)=="/"&&c.substr(0,c.length-1)==e)){return c}f=d.toRelPath(d.path,b.path);if(b.query){f+="?"+b.query}if(b.anchor){f+="#"+b.anchor}return f},toAbsolute:function(b,c){b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length=g.length||g[e]!=c[e]){f=e+1;break}}}if(f===1){return h}for(e=0,b=g.length-(f-1);e=0;c--){if(f[c].length===0||f[c]==="."){continue}if(f[c]===".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!==0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(c,e,d){var b=new Date();b.setTime(b.getTime()-1000);this.set(c,"",b,e,d)}})})();(function(){function serialize(o,quote){var i,v,t,name;quote=quote||'"';if(o==null){return"null"}t=typeof o;if(t=="string"){v="\bb\tt\nn\ff\rr\"\"''\\\\";return quote+o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(a,b){if(quote==='"'&&a==="'"){return a}i=v.indexOf(b);if(i+1){return"\\"+v.charAt(i+1)}a=b.charCodeAt().toString(16);return"\\u"+"0000".substring(a.length)+a})+quote}if(t=="object"){if(o.hasOwnProperty&&Object.prototype.toString.call(o)==="[object Array]"){for(i=0,v="[";i0?",":"")+serialize(o[i],quote)}return v+"]"}v="{";for(name in o){if(o.hasOwnProperty(name)){v+=typeof o[name]!="function"?(v.length>1?","+quote:quote)+name+quote+":"+serialize(o[name],quote):""}}return v+"}"}return""+o}tinymce.util.JSON={serialize:serialize,parse:function(s){try{return eval("("+s+")")}catch(ex){}}}})();tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){if(e){e.call(f.error_scope||f.scope,h,g)}};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(a){a.VK={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(b){return b.shiftKey||b.ctrlKey||b.altKey},metaKeyPressed:function(b){return a.isMac?b.metaKey:b.ctrlKey&&!b.altKey}}})(tinymce);tinymce.util.Quirks=function(a){var j=tinymce.VK,f=j.BACKSPACE,k=j.DELETE,e=a.dom,l=a.selection,H=a.settings,v=a.parser,o=a.serializer,E=tinymce.each;function A(N,M){try{a.getDoc().execCommand(N,false,M)}catch(L){}}function n(){var L=a.getDoc().documentMode;return L?L:6}function z(L){return L.isDefaultPrevented()}function J(){function L(O){var M,Q,N,P;M=l.getRng();Q=e.getParent(M.startContainer,e.isBlock);if(O){Q=e.getNext(Q,e.isBlock)}if(Q){N=Q.firstChild;while(N&&N.nodeType==3&&N.nodeValue.length===0){N=N.nextSibling}if(N&&N.nodeName==="SPAN"){P=N.cloneNode(false)}}E(e.select("span",Q),function(R){R.setAttribute("data-mce-mark","1")});a.getDoc().execCommand(O?"ForwardDelete":"Delete",false,null);Q=e.getParent(M.startContainer,e.isBlock);E(e.select("span",Q),function(R){var S=l.getBookmark();if(P){e.replace(P.cloneNode(false),R,true)}else{if(!R.getAttribute("data-mce-mark")){e.remove(R,true)}else{R.removeAttribute("data-mce-mark")}}l.moveToBookmark(S)})}a.onKeyDown.add(function(M,O){var N;N=O.keyCode==k;if(!z(O)&&(N||O.keyCode==f)&&!j.modifierPressed(O)){O.preventDefault();L(N)}});a.addCommand("Delete",function(){L()})}function q(){function L(O){var N=e.create("body");var P=O.cloneContents();N.appendChild(P);return l.serializer.serialize(N,{format:"html"})}function M(N){var P=L(N);var Q=e.createRng();Q.selectNode(a.getBody());var O=L(Q);return P===O}a.onKeyDown.add(function(O,Q){var P=Q.keyCode,N;if(!z(Q)&&(P==k||P==f)){N=O.selection.isCollapsed();if(N&&!e.isEmpty(O.getBody())){return}if(tinymce.isIE&&!N){return}if(!N&&!M(O.selection.getRng())){return}O.setContent("");O.selection.setCursorLocation(O.getBody(),0);O.nodeChanged()}})}function I(){a.onKeyDown.add(function(L,M){if(!z(M)&&M.keyCode==65&&j.metaKeyPressed(M)){M.preventDefault();L.execCommand("SelectAll")}})}function K(){if(!a.settings.content_editable){e.bind(a.getDoc(),"focusin",function(L){l.setRng(l.getRng())});e.bind(a.getDoc(),"mousedown",function(L){if(L.target==a.getDoc().documentElement){a.getWin().focus();l.setRng(l.getRng())}})}}function B(){a.onKeyDown.add(function(L,O){if(!z(O)&&O.keyCode===f){if(l.isCollapsed()&&l.getRng(true).startOffset===0){var N=l.getNode();var M=N.previousSibling;if(M&&M.nodeName&&M.nodeName.toLowerCase()==="hr"){e.remove(M);tinymce.dom.Event.cancel(O)}}}})}function y(){if(!Range.prototype.getClientRects){a.onMouseDown.add(function(M,N){if(!z(N)&&N.target.nodeName==="HTML"){var L=M.getBody();L.blur();setTimeout(function(){L.focus()},0)}})}}function h(){a.onClick.add(function(L,M){M=M.target;if(/^(IMG|HR)$/.test(M.nodeName)){l.getSel().setBaseAndExtent(M,0,M,1)}if(M.nodeName=="A"&&e.hasClass(M,"mceItemAnchor")){l.select(M)}L.nodeChanged()})}function c(){function M(){var O=e.getAttribs(l.getStart().cloneNode(false));return function(){var P=l.getStart();if(P!==a.getBody()){e.setAttrib(P,"style",null);E(O,function(Q){P.setAttributeNode(Q.cloneNode(true))})}}}function L(){return !l.isCollapsed()&&e.getParent(l.getStart(),e.isBlock)!=e.getParent(l.getEnd(),e.isBlock)}function N(O,P){P.preventDefault();return false}a.onKeyPress.add(function(O,Q){var P;if(!z(Q)&&(Q.keyCode==8||Q.keyCode==46)&&L()){P=M();O.getDoc().execCommand("delete",false,null);P();Q.preventDefault();return false}});e.bind(a.getDoc(),"cut",function(P){var O;if(!z(P)&&L()){O=M();a.onKeyUp.addToTop(N);setTimeout(function(){O();a.onKeyUp.remove(N)},0)}})}function b(){var M,L;e.bind(a.getDoc(),"selectionchange",function(){if(L){clearTimeout(L);L=0}L=window.setTimeout(function(){var N=l.getRng();if(!M||!tinymce.dom.RangeUtils.compareRanges(N,M)){a.nodeChanged();M=N}},50)})}function x(){document.body.setAttribute("role","application")}function t(){a.onKeyDown.add(function(L,N){if(!z(N)&&N.keyCode===f){if(l.isCollapsed()&&l.getRng(true).startOffset===0){var M=l.getNode().previousSibling;if(M&&M.nodeName&&M.nodeName.toLowerCase()==="table"){return tinymce.dom.Event.cancel(N)}}}})}function C(){if(n()>7){return}A("RespectVisibilityInDesign",true);a.contentStyles.push(".mceHideBrInPre pre br {display: none}");e.addClass(a.getBody(),"mceHideBrInPre");v.addNodeFilter("pre",function(L,N){var O=L.length,Q,M,R,P;while(O--){Q=L[O].getAll("br");M=Q.length;while(M--){R=Q[M];P=R.prev;if(P&&P.type===3&&P.value.charAt(P.value-1)!="\n"){P.value+="\n"}else{R.parent.insert(new tinymce.html.Node("#text",3),R,true).value="\n"}}}});o.addNodeFilter("pre",function(L,N){var O=L.length,Q,M,R,P;while(O--){Q=L[O].getAll("br");M=Q.length;while(M--){R=Q[M];P=R.prev;if(P&&P.type==3){P.value=P.value.replace(/\r?\n$/,"")}}}})}function g(){e.bind(a.getBody(),"mouseup",function(N){var M,L=l.getNode();if(L.nodeName=="IMG"){if(M=e.getStyle(L,"width")){e.setAttrib(L,"width",M.replace(/[^0-9%]+/g,""));e.setStyle(L,"width","")}if(M=e.getStyle(L,"height")){e.setAttrib(L,"height",M.replace(/[^0-9%]+/g,""));e.setStyle(L,"height","")}}})}function d(){a.onKeyDown.add(function(R,S){var Q,L,M,O,P,T,N;Q=S.keyCode==k;if(!z(S)&&(Q||S.keyCode==f)&&!j.modifierPressed(S)){L=l.getRng();M=L.startContainer;O=L.startOffset;N=L.collapsed;if(M.nodeType==3&&M.nodeValue.length>0&&((O===0&&!N)||(N&&O===(Q?0:1)))){nonEmptyElements=R.schema.getNonEmptyElements();S.preventDefault();P=e.create("br",{id:"__tmp"});M.parentNode.insertBefore(P,M);R.getDoc().execCommand(Q?"ForwardDelete":"Delete",false,null);M=l.getRng().startContainer;T=M.previousSibling;if(T&&T.nodeType==1&&!e.isBlock(T)&&e.isEmpty(T)&&!nonEmptyElements[T.nodeName.toLowerCase()]){e.remove(T)}e.remove("__tmp")}}})}function G(){a.onKeyDown.add(function(P,Q){var N,M,R,L,O;if(z(Q)||Q.keyCode!=j.BACKSPACE){return}N=l.getRng();M=N.startContainer;R=N.startOffset;L=e.getRoot();O=M;if(!N.collapsed||R!==0){return}while(O&&O.parentNode&&O.parentNode.firstChild==O&&O.parentNode!=L){O=O.parentNode}if(O.tagName==="BLOCKQUOTE"){P.formatter.toggle("blockquote",null,O);N=e.createRng();N.setStart(M,0);N.setEnd(M,0);l.setRng(N)}})}function F(){function L(){a._refreshContentEditable();A("StyleWithCSS",false);A("enableInlineTableEditing",false);if(!H.object_resizing){A("enableObjectResizing",false)}}if(!H.readonly){a.onBeforeExecCommand.add(L);a.onMouseDown.add(L)}}function s(){function L(M,N){E(e.select("a"),function(Q){var O=Q.parentNode,P=e.getRoot();if(O.lastChild===Q){while(O&&!e.isBlock(O)){if(O.parentNode.lastChild!==O||O===P){return}O=O.parentNode}e.add(O,"br",{"data-mce-bogus":1})}})}a.onExecCommand.add(function(M,N){if(N==="CreateLink"){L(M)}});a.onSetContent.add(l.onSetContent.add(L))}function m(){if(H.forced_root_block){a.onInit.add(function(){A("DefaultParagraphSeparator",H.forced_root_block)})}}function p(){function L(N,M){if(!N||!M.initial){a.execCommand("mceRepaint")}}a.onUndo.add(L);a.onRedo.add(L);a.onSetContent.add(L)}function i(){a.onKeyDown.add(function(M,N){var L;if(!z(N)&&N.keyCode==f){L=M.getDoc().selection.createRange();if(L&&L.item){N.preventDefault();M.undoManager.beforeChange();e.remove(L.item(0));M.undoManager.add()}}})}function r(){var L;if(n()>=10){L="";E("p div h1 h2 h3 h4 h5 h6".split(" "),function(M,N){L+=(N>0?",":"")+M+":empty"});a.contentStyles.push(L+"{padding-right: 1px !important}")}}function u(){var N,M,ad,L,Y,ab,Z,ac,O,P,aa,W,V,X=document,T=a.getDoc();if(!H.object_resizing||H.webkit_fake_resize===false){return}A("enableObjectResizing",false);aa={n:[0.5,0,0,-1],e:[1,0.5,1,0],s:[0.5,1,0,1],w:[0,0.5,-1,0],nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};function R(ah){var ag,af;ag=ah.screenX-ab;af=ah.screenY-Z;W=ag*Y[2]+ac;V=af*Y[3]+O;W=W<5?5:W;V=V<5?5:V;if(j.modifierPressed(ah)||(ad.nodeName=="IMG"&&Y[2]*Y[3]!==0)){W=Math.round(V/P);V=Math.round(W*P)}e.setStyles(L,{width:W,height:V});if(Y[2]<0&&L.clientWidth<=W){e.setStyle(L,"left",N+(ac-W))}if(Y[3]<0&&L.clientHeight<=V){e.setStyle(L,"top",M+(O-V))}}function ae(){function af(ag,ah){if(ah){if(ad.style[ag]||!a.schema.isValid(ad.nodeName.toLowerCase(),ag)){e.setStyle(ad,ag,ah)}else{e.setAttrib(ad,ag,ah)}}}af("width",W);af("height",V);e.unbind(T,"mousemove",R);e.unbind(T,"mouseup",ae);if(X!=T){e.unbind(X,"mousemove",R);e.unbind(X,"mouseup",ae)}e.remove(L);Q(ad)}function Q(ai){var ag,ah,af;S();ag=e.getPos(ai);N=ag.x;M=ag.y;ah=ai.offsetWidth;af=ai.offsetHeight;if(ad!=ai){ad=ai;W=V=0}E(aa,function(al,aj){var ak;ak=e.get("mceResizeHandle"+aj);if(!ak){ak=e.add(T.documentElement,"div",{id:"mceResizeHandle"+aj,"class":"mceResizeHandle",style:"cursor:"+aj+"-resize; margin:0; padding:0"});e.bind(ak,"mousedown",function(am){am.preventDefault();ae();ab=am.screenX;Z=am.screenY;ac=ad.clientWidth;O=ad.clientHeight;P=O/ac;Y=al;L=ad.cloneNode(true);e.addClass(L,"mceClonedResizable");e.setStyles(L,{left:N,top:M,margin:0});T.documentElement.appendChild(L);e.bind(T,"mousemove",R);e.bind(T,"mouseup",ae);if(X!=T){e.bind(X,"mousemove",R);e.bind(X,"mouseup",ae)}})}else{e.show(ak)}e.setStyles(ak,{left:(ah*al[0]+N)-(ak.offsetWidth/2),top:(af*al[1]+M)-(ak.offsetHeight/2)})});if(!tinymce.isOpera&&ad.nodeName=="IMG"){ad.setAttribute("data-mce-selected","1")}}function S(){if(ad){ad.removeAttribute("data-mce-selected")}for(var af in aa){e.hide("mceResizeHandle"+af)}}a.contentStyles.push(".mceResizeHandle {position: absolute;border: 1px solid black;background: #FFF;width: 5px;height: 5px;z-index: 10000}.mceResizeHandle:hover {background: #000}img[data-mce-selected] {outline: 1px solid black}img.mceClonedResizable, table.mceClonedResizable {position: absolute;outline: 1px dashed black;opacity: .5;z-index: 10000}");function U(){var af=e.getParent(l.getNode(),"table,img");E(e.select("img[data-mce-selected]"),function(ag){ag.removeAttribute("data-mce-selected")});if(af){Q(af)}else{S()}}a.onNodeChange.add(U);e.bind(T,"selectionchange",U);a.serializer.addAttributeFilter("data-mce-selected",function(af,ag){var ah=af.length;while(ah--){af[ah].attr(ag,null)}})}function D(){if(n()<9){v.addNodeFilter("noscript",function(L){var M=L.length,N,O;while(M--){N=L[M];O=N.firstChild;if(O){N.attr("data-mce-innertext",O.value)}}});o.addNodeFilter("noscript",function(L){var M=L.length,N,P,O;while(M--){N=L[M];P=L[M].firstChild;if(P){P.value=tinymce.html.Entities.decode(P.value)}else{O=N.attributes.map["data-mce-innertext"];if(O){N.attr("data-mce-innertext",null);P=new tinymce.html.Node("#text",3);P.value=O;P.raw=true;N.append(P)}}}})}}t();G();q();if(tinymce.isWebKit){d();J();K();h();m();if(tinymce.isIDevice){b()}else{u();I()}}if(tinymce.isIE){B();x();C();g();i();r();D()}if(tinymce.isGecko){B();y();c();F();s();p()}if(tinymce.isOpera){u()}};(function(j){var a,g,d,k=/[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,f=/[<>&\"\']/g,c=/&(#x|#)?([\w]+);/g,i={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"};g={'"':""","'":"'","<":"<",">":">","&":"&"};d={"<":"<",">":">","&":"&",""":'"',"'":"'"};function h(l){var m;m=document.createElement("div");m.innerHTML=l;return m.textContent||m.innerText||l}function e(m,p){var n,o,l,q={};if(m){m=m.split(",");p=p||10;for(n=0;n1){return"&#"+(((n.charCodeAt(0)-55296)*1024)+(n.charCodeAt(1)-56320)+65536)+";"}return g[n]||"&#"+n.charCodeAt(0)+";"})},encodeNamed:function(n,l,m){m=m||a;return n.replace(l?k:b,function(o){return g[o]||m[o]||o})},getEncodeFunc:function(l,o){var p=j.html.Entities;o=e(o)||a;function m(r,q){return r.replace(q?k:b,function(s){return g[s]||o[s]||"&#"+s.charCodeAt(0)+";"||s})}function n(r,q){return p.encodeNamed(r,q,o)}l=j.makeMap(l.replace(/\+/g,","));if(l.named&&l.numeric){return m}if(l.named){if(o){return n}return p.encodeNamed}if(l.numeric){return p.encodeNumeric}return p.encodeRaw},decode:function(l){return l.replace(c,function(n,m,o){if(m){o=parseInt(o,m.length===2?16:10);if(o>65535){o-=65536;return String.fromCharCode(55296+(o>>10),56320+(o&1023))}else{return i[o]||String.fromCharCode(o)}}return d[n]||a[n]||h(n)})}}})(tinymce);tinymce.html.Styles=function(d,f){var k=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,h=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,b=/\s*([^:]+):\s*([^;]+);?/g,l=/\s+$/,m=/rgb/,e,g,a={},j;d=d||{};j="\\\" \\' \\; \\: ; : \uFEFF".split(" ");for(g=0;g1?r:"0"+r}return"#"+o(q)+o(p)+o(i)}return{toHex:function(i){return i.replace(k,c)},parse:function(s){var z={},q,n,x,r,v=d.url_converter,y=d.url_converter_scope||this;function p(D,G){var F,C,B,E;F=z[D+"-top"+G];if(!F){return}C=z[D+"-right"+G];if(F!=C){return}B=z[D+"-bottom"+G];if(C!=B){return}E=z[D+"-left"+G];if(B!=E){return}z[D+G]=E;delete z[D+"-top"+G];delete z[D+"-right"+G];delete z[D+"-bottom"+G];delete z[D+"-left"+G]}function u(C){var D=z[C],B;if(!D||D.indexOf(" ")<0){return}D=D.split(" ");B=D.length;while(B--){if(D[B]!==D[0]){return false}}z[C]=D[0];return true}function A(D,C,B,E){if(!u(C)){return}if(!u(B)){return}if(!u(E)){return}z[D]=z[C]+" "+z[B]+" "+z[E];delete z[C];delete z[B];delete z[E]}function t(B){r=true;return a[B]}function i(C,B){if(r){C=C.replace(/\uFEFF[0-9]/g,function(D){return a[D]})}if(!B){C=C.replace(/\\([\'\";:])/g,"$1")}return C}function o(C,B,F,E,G,D){G=G||D;if(G){G=i(G);return"'"+G.replace(/\'/g,"\\'")+"'"}B=i(B||F||E);if(v){B=v.call(y,B,"style")}return"url('"+B.replace(/\'/g,"\\'")+"')"}if(s){s=s.replace(/\\[\"\';:\uFEFF]/g,t).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(B){return B.replace(/[;:]/g,t)});while(q=b.exec(s)){n=q[1].replace(l,"").toLowerCase();x=q[2].replace(l,"");if(n&&x.length>0){if(n==="font-weight"&&x==="700"){x="bold"}else{if(n==="color"||n==="background-color"){x=x.toLowerCase()}}x=x.replace(k,c);x=x.replace(h,o);z[n]=r?i(x,true):x}b.lastIndex=q.index+q[0].length}p("border","");p("border","-width");p("border","-color");p("border","-style");p("padding","");p("margin","");A("border","border-width","border-style","border-color");if(z.border==="medium none"){delete z.border}}return z},serialize:function(p,r){var o="",n,q;function i(t){var x,u,s,v;x=f.styles[t];if(x){for(u=0,s=x.length;u0){o+=(o.length>0?" ":"")+t+": "+v+";"}}}}if(r&&f&&f.styles){i("*");i(r)}else{for(n in p){q=p[n];if(q!==e&&q.length>0){o+=(o.length>0?" ":"")+n+": "+q+";"}}}return o}}};(function(f){var a={},e=f.makeMap,g=f.each;function d(j,i){return j.split(i||",")}function h(m,l){var j,k={};function i(n){return n.replace(/[A-Z]+/g,function(o){return i(m[o])})}for(j in m){if(m.hasOwnProperty(j)){m[j]=i(m[j])}}i(l).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g,function(q,o,n,p){n=d(n,"|");k[o]={attributes:e(n),attributesOrder:n,children:e(p,"|",{"#comment":{}})}});return k}function b(){var i=a.html5;if(!i){i=a.html5=h({A:"id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"#|a|abbr|area|audio|b|bdo|br|button|canvas|cite|code|command|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|meta|meter|noscript|object|output|progress|q|ruby|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|var|video|wbr",C:"#|a|abbr|area|address|article|aside|audio|b|bdo|blockquote|br|button|canvas|cite|code|command|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|menu|meta|meter|nav|noscript|ol|object|output|p|pre|progress|q|ruby|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|ul|var|video"},"html[A|manifest][body|head]head[A][base|command|link|meta|noscript|script|style|title]title[A][#]base[A|href|target][]link[A|href|rel|media|type|sizes][]meta[A|http-equiv|name|content|charset][]style[A|type|media|scoped][#]script[A|charset|type|src|defer|async][#]noscript[A][C]body[A][C]section[A][C]nav[A][C]article[A][C]aside[A][C]h1[A][B]h2[A][B]h3[A][B]h4[A][B]h5[A][B]h6[A][B]hgroup[A][h1|h2|h3|h4|h5|h6]header[A][C]footer[A][C]address[A][C]p[A][B]br[A][]pre[A][B]dialog[A][dd|dt]blockquote[A|cite][C]ol[A|start|reversed][li]ul[A][li]li[A|value][C]dl[A][dd|dt]dt[A][B]dd[A][C]a[A|href|target|ping|rel|media|type][B]em[A][B]strong[A][B]small[A][B]cite[A][B]q[A|cite][B]dfn[A][B]abbr[A][B]code[A][B]var[A][B]samp[A][B]kbd[A][B]sub[A][B]sup[A][B]i[A][B]b[A][B]mark[A][B]progress[A|value|max][B]meter[A|value|min|max|low|high|optimum][B]time[A|datetime][B]ruby[A][B|rt|rp]rt[A][B]rp[A][B]bdo[A][B]span[A][B]ins[A|cite|datetime][B]del[A|cite|datetime][B]figure[A][C|legend|figcaption]figcaption[A][C]img[A|alt|src|height|width|usemap|ismap][]iframe[A|name|src|height|width|sandbox|seamless][]embed[A|src|height|width|type][]object[A|data|type|height|width|usemap|name|form|classid][param]param[A|name|value][]details[A|open][C|legend]command[A|type|label|icon|disabled|checked|radiogroup][]menu[A|type|label][C|li]legend[A][C|B]div[A][C]source[A|src|type|media][]audio[A|src|autobuffer|autoplay|loop|controls][source]video[A|src|autobuffer|autoplay|loop|controls|width|height|poster][source]hr[A][]form[A|accept-charset|action|autocomplete|enctype|method|name|novalidate|target][C]fieldset[A|disabled|form|name][C|legend]label[A|form|for][B]input[A|type|accept|alt|autocomplete|autofocus|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value|name][]button[A|autofocus|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|name|value|type][B]select[A|autofocus|disabled|form|multiple|name|size][option|optgroup]datalist[A][B|option]optgroup[A|disabled|label][option]option[A|disabled|selected|label|value][]textarea[A|autofocus|disabled|form|maxlength|name|placeholder|readonly|required|rows|cols|wrap][]keygen[A|autofocus|challenge|disabled|form|keytype|name][]output[A|for|form|name][B]canvas[A|width|height][]map[A|name][B|C]area[A|shape|coords|href|alt|target|media|rel|ping|type][]mathml[A][]svg[A][]table[A|border][caption|colgroup|thead|tfoot|tbody|tr]caption[A][C]colgroup[A|span][col]col[A|span][]thead[A][tr]tfoot[A][tr]tbody[A][tr]tr[A][th|td]th[A|headers|rowspan|colspan|scope][B]td[A|headers|rowspan|colspan][C]wbr[A][]")}return i}function c(){var i=a.html4;if(!i){i=a.html4=h({Z:"H|K|N|O|P",Y:"X|form|R|Q",ZG:"E|span|width|align|char|charoff|valign",X:"p|T|div|U|W|isindex|fieldset|table",ZF:"E|align|char|charoff|valign",W:"pre|hr|blockquote|address|center|noframes",ZE:"abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height",ZD:"[E][S]",U:"ul|ol|dl|menu|dir",ZC:"p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"X|S|Q",S:"R|P",ZA:"a|G|J|M|O|P",R:"a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe",E:"A|B|C",D:"accesskey|tabindex|onfocus|onblur",C:"onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"lang|xml:lang|dir",A:"id|class|style|title"},"script[id|charset|type|language|src|defer|xml:space][]style[B|id|type|media|title|xml:space][]object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]param[id|name|value|valuetype|type][]p[E|align][#|S]a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]br[A|clear][]span[E][#|S]bdo[A|C|B][#|S]applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]h1[E|align][#|S]img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]map[B|C|A|name][X|form|Q|area]h2[E|align][#|S]iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]h3[E|align][#|S]tt[E][#|S]i[E][#|S]b[E][#|S]u[E][#|S]s[E][#|S]strike[E][#|S]big[E][#|S]small[E][#|S]font[A|B|size|color|face][#|S]basefont[id|size|color|face][]em[E][#|S]strong[E][#|S]dfn[E][#|S]code[E][#|S]q[E|cite][#|S]samp[E][#|S]kbd[E][#|S]var[E][#|S]cite[E][#|S]abbr[E][#|S]acronym[E][#|S]sub[E][#|S]sup[E][#|S]input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]optgroup[E|disabled|label][option]option[E|selected|disabled|label|value][]textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]label[E|for|accesskey|onfocus|onblur][#|S]button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[E|align][#|S]ins[E|cite|datetime][#|Y]h5[E|align][#|S]del[E|cite|datetime][#|Y]h6[E|align][#|S]div[E|align][#|Y]ul[E|type|compact][li]li[E|type|value][#|Y]ol[E|type|compact|start][li]dl[E|compact][dt|dd]dt[E][#|S]dd[E][#|Y]menu[E|compact][li]dir[E|compact][li]pre[E|width|xml:space][#|ZA]hr[E|align|noshade|size|width][]blockquote[E|cite][#|Y]address[E][#|S|p]center[E][#|Y]noframes[E][#|Y]isindex[A|B|prompt][]fieldset[E][#|legend|Y]legend[E|accesskey|align][#|S]table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]caption[E|align][#|S]col[ZG][]colgroup[ZG][col]thead[ZF][tr]tr[ZF|bgcolor][th|td]th[E|ZE][#|Y]form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]noscript[E][#|Y]td[E|ZE][#|Y]tfoot[ZF][tr]tbody[ZF][tr]area[E|D|shape|coords|href|nohref|alt|target][]base[id|href|target][]body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]")}return i}f.html.Schema=function(A){var u=this,s={},k={},j=[],D,y;var o,q,z,r,v,n,p={};function m(F,E,H){var G=A[F];if(!G){G=a[F];if(!G){G=e(E," ",e(E.toUpperCase()," "));G=f.extend(G,H);a[F]=G}}else{G=e(G,",",e(G.toUpperCase()," "))}return G}A=A||{};y=A.schema=="html5"?b():c();if(A.verify_html===false){A.valid_elements="*[*]"}if(A.valid_styles){D={};g(A.valid_styles,function(F,E){D[E]=f.explode(F)})}o=m("whitespace_elements","pre script noscript style textarea");q=m("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr");z=m("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr");r=m("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls");n=m("non_empty_elements","td th iframe video audio object",z);textBlockElementsMap=m("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure");v=m("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex samp option datalist select optgroup",textBlockElementsMap);function i(E){return new RegExp("^"+E.replace(/([?+*])/g,".$1")+"$")}function C(L){var K,G,Z,V,aa,F,I,U,X,Q,Y,ac,O,J,W,E,S,H,ab,ad,P,T,N=/^([#+\-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,R=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,M=/[*?+]/;if(L){L=d(L);if(s["@"]){S=s["@"].attributes;H=s["@"].attributesOrder}for(K=0,G=L.length;K=0){for(U=A.length-1;U>=V;U--){T=A[U];if(T.valid){n.end(T.name)}}A.length=V}}function p(U,T,Y,X,W){var Z,V;T=T.toLowerCase();Y=T in H?T:j(Y||X||W||"");if(v&&!z&&T.indexOf("data-")!==0){Z=P[T];if(!Z&&F){V=F.length;while(V--){Z=F[V];if(Z.pattern.test(T)){break}}if(V===-1){Z=null}}if(!Z){return}if(Z.validValues&&!(Y in Z.validValues)){return}}N.map[T]=Y;N.push({name:T,value:Y})}l=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g");D=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g;K={script:/<\/script[^>]*>/gi,style:/<\/style[^>]*>/gi,noscript:/<\/noscript[^>]*>/gi};M=e.getShortEndedElements();J=c.self_closing_elements||e.getSelfClosingElements();H=e.getBoolAttrs();v=c.validate;s=c.remove_internals;y=c.fix_self_closing;q=a.isIE;o=/^:/;while(g=l.exec(E)){if(G0&&A[A.length-1].name===I){u(I)}if(!v||(m=e.getElementRule(I))){k=true;if(v){P=m.attributes;F=m.attributePatterns}if(R=g[8]){z=R.indexOf("data-mce-type")!==-1;if(z&&s){k=false}N=[];N.map={};R.replace(D,p)}else{N=[];N.map={}}if(v&&!z){S=m.attributesRequired;L=m.attributesDefault;f=m.attributesForced;if(f){Q=f.length;while(Q--){t=f[Q];r=t.name;h=t.value;if(h==="{$uid}"){h="mce_"+x++}N.map[r]=h;N.push({name:r,value:h})}}if(L){Q=L.length;while(Q--){t=L[Q];r=t.name;if(!(r in N.map)){h=t.value;if(h==="{$uid}"){h="mce_"+x++}N.map[r]=h;N.push({name:r,value:h})}}}if(S){Q=S.length;while(Q--){if(S[Q] in N.map){break}}if(Q===-1){k=false}}if(N.map["data-mce-bogus"]){k=false}}if(k){n.start(I,N,O)}}else{k=false}if(B=K[I]){B.lastIndex=G=g.index+g[0].length;if(g=B.exec(E)){if(k){C=E.substr(G,g.index-G)}G=g.index+g[0].length}else{C=E.substr(G);G=E.length}if(k&&C.length>0){n.text(C,true)}if(k){n.end(I)}l.lastIndex=G;continue}if(!O){if(!R||R.indexOf("/")!=R.length-1){A.push({name:I,valid:k})}else{if(k){n.end(I)}}}}else{if(I=g[1]){n.comment(I)}else{if(I=g[2]){n.cdata(I)}else{if(I=g[3]){n.doctype(I)}else{if(I=g[4]){n.pi(I,g[5])}}}}}}G=g.index+g[0].length}if(G=0;Q--){I=A[Q];if(I.valid){n.end(I.name)}}}}})(tinymce);(function(d){var c=/^[ \t\r\n]*$/,e={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};function a(k,l,j){var i,h,f=j?"lastChild":"firstChild",g=j?"prev":"next";if(k[f]){return k[f]}if(k!==l){i=k[g];if(i){return i}for(h=k.parent;h&&h!==l;h=h.parent){i=h[g];if(i){return i}}}}function b(f,g){this.name=f;this.type=g;if(g===1){this.attributes=[];this.attributes.map={}}}d.extend(b.prototype,{replace:function(g){var f=this;if(g.parent){g.remove()}f.insert(g,f);f.remove();return f},attr:function(h,l){var f=this,g,j,k;if(typeof h!=="string"){for(j in h){f.attr(j,h[j])}return f}if(g=f.attributes){if(l!==k){if(l===null){if(h in g.map){delete g.map[h];j=g.length;while(j--){if(g[j].name===h){g=g.splice(j,1);return f}}}return f}if(h in g.map){j=g.length;while(j--){if(g[j].name===h){g[j].value=l;break}}}else{g.push({name:h,value:l})}g.map[h]=l;return f}else{return g.map[h]}}},clone:function(){var g=this,n=new b(g.name,g.type),h,f,m,j,k;if(m=g.attributes){k=[];k.map={};for(h=0,f=m.length;h1){x.reverse();A=o=f.filterNode(x[0].clone());for(u=0;u0){Q.value=l;Q=Q.prev}else{O=Q.prev;Q.remove();Q=O}}}function H(O){var P,l={};for(P in O){if(P!=="li"&&P!="p"){l[P]=O[P]}}return l}n=new b.html.SaxParser({validate:z,self_closing_elements:H(h.getSelfClosingElements()),cdata:function(l){B.append(K("#cdata",4)).value=l},text:function(P,l){var O;if(!L){P=P.replace(k," ");if(B.lastChild&&o[B.lastChild.name]){P=P.replace(E,"")}}if(P.length!==0){O=K("#text",3);O.raw=!!l;B.append(O).value=P}},comment:function(l){B.append(K("#comment",8)).value=l},pi:function(l,O){B.append(K(l,7)).value=O;I(B)},doctype:function(O){var l;l=B.append(K("#doctype",10));l.value=O;I(B)},start:function(l,W,P){var U,R,Q,O,S,X,V,T;Q=z?h.getElementRule(l):{};if(Q){U=K(Q.outputName||l,1);U.attributes=W;U.shortEnded=P;B.append(U);T=p[B.name];if(T&&p[U.name]&&!T[U.name]){M.push(U)}R=d.length;while(R--){S=d[R].name;if(S in W.map){F=c[S];if(F){F.push(U)}else{c[S]=[U]}}}if(o[l]){I(U)}if(!P){B=U}if(!L&&s[l]){L=true}}},end:function(l){var S,P,R,O,Q;P=z?h.getElementRule(l):{};if(P){if(o[l]){if(!L){S=B.firstChild;if(S&&S.type===3){R=S.value.replace(E,"");if(R.length>0){S.value=R;S=S.next}else{O=S.next;S.remove();S=O}while(S&&S.type===3){R=S.value;O=S.next;if(R.length===0||y.test(R)){S.remove();S=O}S=O}}S=B.lastChild;if(S&&S.type===3){R=S.value.replace(t,"");if(R.length>0){S.value=R;S=S.prev}else{O=S.prev;S.remove();S=O}while(S&&S.type===3){R=S.value;O=S.prev;if(R.length===0||y.test(R)){S.remove();S=O}S=O}}}}if(L&&s[l]){L=false}if(P.removeEmpty||P.paddEmpty){if(B.isEmpty(u)){if(P.paddEmpty){B.empty().append(new a("#text","3")).value="\u00a0"}else{if(!B.attributes.map.name&&!B.attributes.map.id){Q=B.parent;B.empty().remove();B=Q;return}}}}B=B.parent}}},h);J=B=new a(m.context||g.root_name,11);n.parse(v);if(z&&M.length){if(!m.context){j(M)}else{m.invalid=true}}if(q&&J.name=="body"){G()}if(!m.invalid){for(N in i){F=e[N];A=i[N];x=A.length;while(x--){if(!A[x].parent){A.splice(x,1)}}for(D=0,C=F.length;D0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}c.push("<",m);if(k){for(n=0,j=k.length;n0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}},end:function(h){var i;c.push("");if(a&&d[h]&&c.length>0){i=c[c.length-1];if(i.length>0&&i!=="\n"){c.push("\n")}}},text:function(i,h){if(i.length>0){c[c.length]=h?i:f(i)}},cdata:function(h){c.push("")},comment:function(h){c.push("")},pi:function(h,i){if(i){c.push("")}else{c.push("")}if(a){c.push("\n")}},doctype:function(h){c.push("",a?"\n":"")},reset:function(){c.length=0},getContent:function(){return c.join("").replace(/\n$/,"")}}};(function(a){a.html.Serializer=function(c,d){var b=this,e=new a.html.Writer(c);c=c||{};c.validate="validate" in c?c.validate:true;b.schema=d=d||new a.html.Schema();b.writer=e;b.serialize=function(h){var g,i;i=c.validate;g={3:function(k,j){e.text(k.value,k.raw)},8:function(j){e.comment(j.value)},7:function(j){e.pi(j.name,j.value)},10:function(j){e.doctype(j.value)},4:function(j){e.cdata(j.value)},11:function(j){if((j=j.firstChild)){do{f(j)}while(j=j.next)}}};e.reset();function f(k){var t=g[k.type],j,o,s,r,p,u,n,m,q;if(!t){j=k.name;o=k.shortEnded;s=k.attributes;if(i&&s&&s.length>1){u=[];u.map={};q=d.getElementRule(k.name);for(n=0,m=q.attributesOrder.length;n=8;k.boxModel=!e.isIE||o.compatMode=="CSS1Compat"||k.stdMode;k.hasOuterHTML="outerHTML" in o.createElement("a");k.settings=l=e.extend({keep_values:false,hex_colors:1},l);k.schema=l.schema;k.styles=new e.html.Styles({url_converter:l.url_converter,url_converter_scope:l.url_converter_scope},l.schema);if(e.isIE6){try{o.execCommand("BackgroundImageCache",false,true)}catch(m){k.cssFlicker=true}}k.fixDoc(o);k.events=l.ownEvents?new e.dom.EventUtils(l.proxy):e.dom.Event;e.addUnload(k.destroy,k);n=l.schema?l.schema.getBlockElements():{};k.isBlock=function(q){if(!q){return false}var p=q.nodeType;if(p){return !!(p===1&&n[q.nodeName])}return !!n[q]}},fixDoc:function(k){var j=this.settings,i;if(b&&j.schema){("abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video").replace(/\w+/g,function(l){k.createElement(l)});for(i in j.schema.getCustomElements()){k.createElement(i)}}},clone:function(k,i){var j=this,m,l;if(!b||k.nodeType!==1||i){return k.cloneNode(i)}l=j.doc;if(!i){m=l.createElement(k.nodeName);g(j.getAttribs(k),function(n){j.setAttrib(m,n.nodeName,j.getAttrib(k,n.nodeName))});return m}return m.firstChild},getRoot:function(){var i=this,j=i.settings;return(j&&i.get(j.root_element))||i.doc.body},getViewPort:function(j){var k,i;j=!j?this.win:j;k=j.document;i=this.boxModel?k.documentElement:k.body;return{x:j.pageXOffset||i.scrollLeft,y:j.pageYOffset||i.scrollTop,w:j.innerWidth||i.clientWidth,h:j.innerHeight||i.clientHeight}},getRect:function(l){var k,i=this,j;l=i.get(l);k=i.getPos(l);j=i.getSize(l);return{x:k.x,y:k.y,w:j.w,h:j.h}},getSize:function(l){var j=this,i,k;l=j.get(l);i=j.getStyle(l,"width");k=j.getStyle(l,"height");if(i.indexOf("px")===-1){i=0}if(k.indexOf("px")===-1){k=0}return{w:parseInt(i,10)||l.offsetWidth||l.clientWidth,h:parseInt(k,10)||l.offsetHeight||l.clientHeight}},getParent:function(k,j,i){return this.getParents(k,j,i,false)},getParents:function(s,m,k,q){var j=this,i,l=j.settings,p=[];s=j.get(s);q=q===undefined;if(l.strict_root){k=k||j.getRoot()}if(d(m,"string")){i=m;if(m==="*"){m=function(o){return o.nodeType==1}}else{m=function(o){return j.is(o,i)}}}while(s){if(s==k||!s.nodeType||s.nodeType===9){break}if(!m||m(s)){if(q){p.push(s)}else{return s}}s=s.parentNode}return q?p:null},get:function(i){var j;if(i&&this.doc&&typeof(i)=="string"){j=i;i=this.doc.getElementById(i);if(i&&i.id!==j){return this.doc.getElementsByName(j)[1]}}return i},getNext:function(j,i){return this._findSib(j,i,"nextSibling")},getPrev:function(j,i){return this._findSib(j,i,"previousSibling")},select:function(k,j){var i=this;return e.dom.Sizzle(k,i.get(j)||i.get(i.settings.root_element)||i.doc,[])},is:function(l,j){var k;if(l.length===undefined){if(j==="*"){return l.nodeType==1}if(c.test(j)){j=j.toLowerCase().split(/,/);l=l.nodeName.toLowerCase();for(k=j.length-1;k>=0;k--){if(j[k]==l){return true}}return false}}return e.dom.Sizzle.matches(j,l.nodeType?[l]:l).length>0},add:function(l,o,i,k,m){var j=this;return this.run(l,function(r){var q,n;q=d(o,"string")?j.doc.createElement(o):o;j.setAttribs(q,i);if(k){if(k.nodeType){q.appendChild(k)}else{j.setHTML(q,k)}}return !m?r.appendChild(q):q})},create:function(k,i,j){return this.add(this.doc.createElement(k),k,i,j,1)},createHTML:function(q,i,m){var p="",l=this,j;p+="<"+q;for(j in i){if(i.hasOwnProperty(j)){p+=" "+j+'="'+l.encode(i[j])+'"'}}if(typeof(m)!="undefined"){return p+">"+m+""}return p+" />"},remove:function(i,j){return this.run(i,function(l){var m,k=l.parentNode;if(!k){return null}if(j){while(m=l.firstChild){if(!e.isIE||m.nodeType!==3||m.nodeValue){k.insertBefore(m,l)}else{l.removeChild(m)}}}return k.removeChild(l)})},setStyle:function(l,i,j){var k=this;return k.run(l,function(o){var n,m;n=o.style;i=i.replace(/-(\D)/g,function(q,p){return p.toUpperCase()});if(k.pixelStyles.test(i)&&(e.is(j,"number")||/^[\-0-9\.]+$/.test(j))){j+="px"}switch(i){case"opacity":if(b){n.filter=j===""?"":"alpha(opacity="+(j*100)+")";if(!l.currentStyle||!l.currentStyle.hasLayout){n.display="inline-block"}}n[i]=n["-moz-opacity"]=n["-khtml-opacity"]=j||"";break;case"float":b?n.styleFloat=j:n.cssFloat=j;break;default:n[i]=j||""}if(k.settings.update_styles){k.setAttrib(o,"data-mce-style")}})},getStyle:function(l,i,k){l=this.get(l);if(!l){return}if(this.doc.defaultView&&k){i=i.replace(/[A-Z]/g,function(m){return"-"+m});try{return this.doc.defaultView.getComputedStyle(l,null).getPropertyValue(i)}catch(j){return null}}i=i.replace(/-(\D)/g,function(n,m){return m.toUpperCase()});if(i=="float"){i=b?"styleFloat":"cssFloat"}if(l.currentStyle&&k){return l.currentStyle[i]}return l.style?l.style[i]:undefined},setStyles:function(l,m){var j=this,k=j.settings,i;i=k.update_styles;k.update_styles=0;g(m,function(o,p){j.setStyle(l,p,o)});k.update_styles=i;if(k.update_styles){j.setAttrib(l,k.cssText)}},removeAllAttribs:function(i){return this.run(i,function(l){var k,j=l.attributes;for(k=j.length-1;k>=0;k--){l.removeAttributeNode(j.item(k))}})},setAttrib:function(k,l,i){var j=this;if(!k||!l){return}if(j.settings.strict){l=l.toLowerCase()}return this.run(k,function(p){var o=j.settings;var m=p.getAttribute(l);if(i!==null){switch(l){case"style":if(!d(i,"string")){g(i,function(q,r){j.setStyle(p,r,q)});return}if(o.keep_values){if(i&&!j._isRes(i)){p.setAttribute("data-mce-style",i,2)}else{p.removeAttribute("data-mce-style",2)}}p.style.cssText=i;break;case"class":p.className=i||"";break;case"src":case"href":if(o.keep_values){if(o.url_converter){i=o.url_converter.call(o.url_converter_scope||j,i,l,p)}j.setAttrib(p,"data-mce-"+l,i,2)}break;case"shape":p.setAttribute("data-mce-style",i);break}}if(d(i)&&i!==null&&i.length!==0){p.setAttribute(l,""+i,2)}else{p.removeAttribute(l,2)}if(tinyMCE.activeEditor&&m!=i){var n=tinyMCE.activeEditor;n.onSetAttrib.dispatch(n,p,l,i)}})},setAttribs:function(j,k){var i=this;return this.run(j,function(l){g(k,function(m,o){i.setAttrib(l,o,m)})})},getAttrib:function(m,o,k){var i,j=this,l;m=j.get(m);if(!m||m.nodeType!==1){return k===l?false:k}if(!d(k)){k=""}if(/^(src|href|style|coords|shape)$/.test(o)){i=m.getAttribute("data-mce-"+o);if(i){return i}}if(b&&j.props[o]){i=m[j.props[o]];i=i&&i.nodeValue?i.nodeValue:i}if(!i){i=m.getAttribute(o,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(o)){if(m[j.props[o]]===true&&i===""){return o}return i?o:""}if(m.nodeName==="FORM"&&m.getAttributeNode(o)){return m.getAttributeNode(o).nodeValue}if(o==="style"){i=i||m.style.cssText;if(i){i=j.serializeStyle(j.parseStyle(i),m.nodeName);if(j.settings.keep_values&&!j._isRes(i)){m.setAttribute("data-mce-style",i)}}}if(f&&o==="class"&&i){i=i.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(b){switch(o){case"rowspan":case"colspan":if(i===1){i=""}break;case"size":if(i==="+0"||i===20||i===0){i=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(i===0){i=""}break;case"hspace":if(i===-1){i=""}break;case"maxlength":case"tabindex":if(i===32768||i===2147483647||i==="32768"){i=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(i===65535){return o}return k;case"shape":i=i.toLowerCase();break;default:if(o.indexOf("on")===0&&i){i=e._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1",""+i)}}}return(i!==l&&i!==null&&i!=="")?""+i:k},getPos:function(q,l){var j=this,i=0,p=0,m,o=j.doc,k;q=j.get(q);l=l||o.body;if(q){if(q.getBoundingClientRect){q=q.getBoundingClientRect();m=j.boxModel?o.documentElement:o.body;i=q.left+(o.documentElement.scrollLeft||o.body.scrollLeft)-m.clientTop;p=q.top+(o.documentElement.scrollTop||o.body.scrollTop)-m.clientLeft;return{x:i,y:p}}k=q;while(k&&k!=l&&k.nodeType){i+=k.offsetLeft||0;p+=k.offsetTop||0;k=k.offsetParent}k=q.parentNode;while(k&&k!=l&&k.nodeType){i-=k.scrollLeft||0;p-=k.scrollTop||0;k=k.parentNode}}return{x:i,y:p}},parseStyle:function(i){return this.styles.parse(i)},serializeStyle:function(j,i){return this.styles.serialize(j,i)},addStyle:function(j){var k=this.doc,i;styleElm=k.getElementById("mceDefaultStyles");if(!styleElm){styleElm=k.createElement("style"),styleElm.id="mceDefaultStyles";styleElm.type="text/css";i=k.getElementsByTagName("head")[0];if(i.firstChild){i.insertBefore(styleElm,i.firstChild)}else{i.appendChild(styleElm)}}if(styleElm.styleSheet){styleElm.styleSheet.cssText+=j}else{styleElm.appendChild(k.createTextNode(j))}},loadCSS:function(i){var k=this,l=k.doc,j;if(!i){i=""}j=l.getElementsByTagName("head")[0];g(i.split(","),function(m){var n;if(k.files[m]){return}k.files[m]=true;n=k.create("link",{rel:"stylesheet",href:e._addVer(m)});if(b&&l.documentMode&&l.recalc){n.onload=function(){if(l.recalc){l.recalc()}n.onload=null}}j.appendChild(n)})},addClass:function(i,j){return this.run(i,function(k){var l;if(!j){return 0}if(this.hasClass(k,j)){return k.className}l=this.removeClass(k,j);return k.className=(l!=""?(l+" "):"")+j})},removeClass:function(k,l){var i=this,j;return i.run(k,function(n){var m;if(i.hasClass(n,l)){if(!j){j=new RegExp("(^|\\s+)"+l+"(\\s+|$)","g")}m=n.className.replace(j," ");m=e.trim(m!=" "?m:"");n.className=m;if(!m){n.removeAttribute("class");n.removeAttribute("className")}return m}return n.className})},hasClass:function(j,i){j=this.get(j);if(!j||!i){return false}return(" "+j.className+" ").indexOf(" "+i+" ")!==-1},show:function(i){return this.setStyle(i,"display","block")},hide:function(i){return this.setStyle(i,"display","none")},isHidden:function(i){i=this.get(i);return !i||i.style.display=="none"||this.getStyle(i,"display")=="none"},uniqueId:function(i){return(!i?"mce_":i)+(this.counter++)},setHTML:function(k,j){var i=this;return i.run(k,function(m){if(b){while(m.firstChild){m.removeChild(m.firstChild)}try{m.innerHTML="
    "+j;m.removeChild(m.firstChild)}catch(l){var n=i.create("div");n.innerHTML="
    "+j;g(e.grep(n.childNodes),function(p,o){if(o&&m.canHaveHTML){m.appendChild(p)}})}}else{m.innerHTML=j}return j})},getOuterHTML:function(k){var j,i=this;k=i.get(k);if(!k){return null}if(k.nodeType===1&&i.hasOuterHTML){return k.outerHTML}j=(k.ownerDocument||i.doc).createElement("body");j.appendChild(k.cloneNode(true));return j.innerHTML},setOuterHTML:function(l,j,m){var i=this;function k(p,o,r){var s,q;q=r.createElement("body");q.innerHTML=o;s=q.lastChild;while(s){i.insertAfter(s.cloneNode(true),p);s=s.previousSibling}i.remove(p)}return this.run(l,function(o){o=i.get(o);if(o.nodeType==1){m=m||o.ownerDocument||i.doc;if(b){try{if(b&&o.nodeType==1){o.outerHTML=j}else{k(o,j,m)}}catch(n){k(o,j,m)}}else{k(o,j,m)}}})},decode:h.decode,encode:h.encodeAllRaw,insertAfter:function(i,j){j=this.get(j);return this.run(i,function(l){var k,m;k=j.parentNode;m=j.nextSibling;if(m){k.insertBefore(l,m)}else{k.appendChild(l)}return l})},replace:function(m,l,i){var j=this;if(d(l,"array")){m=m.cloneNode(true)}return j.run(l,function(k){if(i){g(e.grep(k.childNodes),function(n){m.appendChild(n)})}return k.parentNode.replaceChild(m,k)})},rename:function(l,i){var k=this,j;if(l.nodeName!=i.toUpperCase()){j=k.create(i);g(k.getAttribs(l),function(m){k.setAttrib(j,m.nodeName,k.getAttrib(l,m.nodeName))});k.replace(j,l,1)}return j||l},findCommonAncestor:function(k,i){var l=k,j;while(l){j=i;while(j&&l!=j){j=j.parentNode}if(l==j){break}l=l.parentNode}if(!l&&k.ownerDocument){return k.ownerDocument.documentElement}return l},toHex:function(i){var k=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(i);function j(l){l=parseInt(l,10).toString(16);return l.length>1?l:"0"+l}if(k){i="#"+j(k[1])+j(k[2])+j(k[3]);return i}return i},getClasses:function(){var n=this,j=[],m,o={},p=n.settings.class_filter,l;if(n.classes){return n.classes}function q(i){g(i.imports,function(s){q(s)});g(i.cssRules||i.rules,function(s){switch(s.type||1){case 1:if(s.selectorText){g(s.selectorText.split(","),function(r){r=r.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(r)||!/\.[\w\-]+$/.test(r)){return}l=r;r=e._replace(/.*\.([a-z0-9_\-]+).*/i,"$1",r);if(p&&!(r=p(r,l))){return}if(!o[r]){j.push({"class":r});o[r]=1}})}break;case 3:q(s.styleSheet);break}})}try{g(n.doc.styleSheets,q)}catch(k){}if(j.length>0){n.classes=j}return j},run:function(l,k,j){var i=this,m;if(i.doc&&typeof(l)==="string"){l=i.get(l)}if(!l){return false}j=j||this;if(!l.nodeType&&(l.length||l.length===0)){m=[];g(l,function(o,n){if(o){if(typeof(o)=="string"){o=i.doc.getElementById(o)}m.push(k.call(j,o,n))}});return m}return k.call(j,l)},getAttribs:function(j){var i;j=this.get(j);if(!j){return[]}if(b){i=[];if(j.nodeName=="OBJECT"){return j.attributes}if(j.nodeName==="OPTION"&&this.getAttrib(j,"selected")){i.push({specified:1,nodeName:"selected"})}j.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(k){i.push({specified:1,nodeName:k})});return i}return j.attributes},isEmpty:function(m,k){var r=this,o,n,q,j,l,p=0;m=m.firstChild;if(m){j=new e.dom.TreeWalker(m,m.parentNode);k=k||r.schema?r.schema.getNonEmptyElements():null;do{q=m.nodeType;if(q===1){if(m.getAttribute("data-mce-bogus")){continue}l=m.nodeName.toLowerCase();if(k&&k[l]){if(l==="br"){p++;continue}return false}n=r.getAttribs(m);o=m.attributes.length;while(o--){l=m.attributes[o].nodeName;if(l==="name"||l==="data-mce-bookmark"){return false}}}if(q==8){return false}if((q===3&&!a.test(m.nodeValue))){return false}}while(m=j.next())}return p<=1},destroy:function(j){var i=this;i.win=i.doc=i.root=i.events=i.frag=null;if(!j){e.removeUnload(i.destroy)}},createRng:function(){var i=this.doc;return i.createRange?i.createRange():new e.dom.Range(this)},nodeIndex:function(m,n){var i=0,k,l,j;if(m){for(k=m.nodeType,m=m.previousSibling,l=m;m;m=m.previousSibling){j=m.nodeType;if(n&&j==3){if(j==k||!m.nodeValue.length){continue}}i++;k=j}}return i},split:function(m,l,p){var q=this,i=q.createRng(),n,k,o;function j(v){var t,s=v.childNodes,u=v.nodeType;function x(A){var z=A.previousSibling&&A.previousSibling.nodeName=="SPAN";var y=A.nextSibling&&A.nextSibling.nodeName=="SPAN";return z&&y}if(u==1&&v.getAttribute("data-mce-type")=="bookmark"){return}for(t=s.length-1;t>=0;t--){j(s[t])}if(u!=9){if(u==3&&v.nodeValue.length>0){var r=e.trim(v.nodeValue).length;if(!q.isBlock(v.parentNode)||r>0||r===0&&x(v)){return}}else{if(u==1){s=v.childNodes;if(s.length==1&&s[0]&&s[0].nodeType==1&&s[0].getAttribute("data-mce-type")=="bookmark"){v.parentNode.insertBefore(s[0],v)}if(s.length||/^(br|hr|input|img)$/i.test(v.nodeName)){return}}}q.remove(v)}return v}if(m&&l){i.setStart(m.parentNode,q.nodeIndex(m));i.setEnd(l.parentNode,q.nodeIndex(l));n=i.extractContents();i=q.createRng();i.setStart(l.parentNode,q.nodeIndex(l)+1);i.setEnd(m.parentNode,q.nodeIndex(m)+1);k=i.extractContents();o=m.parentNode;o.insertBefore(j(n),m);if(p){o.replaceChild(p,l)}else{o.insertBefore(l,m)}o.insertBefore(j(k),m);q.remove(m);return p||l}},bind:function(l,i,k,j){return this.events.add(l,i,k,j||this)},unbind:function(k,i,j){return this.events.remove(k,i,j)},fire:function(k,j,i){return this.events.fire(k,j,i)},getContentEditable:function(j){var i;if(j.nodeType!=1){return null}i=j.getAttribute("data-mce-contenteditable");if(i&&i!=="inherit"){return i}return j.contentEditable!=="inherit"?j.contentEditable:null},_findSib:function(l,i,j){var k=this,m=i;if(l){if(d(m,"string")){m=function(n){return k.is(n,i)}}for(l=l[j];l;l=l[j]){if(m(l)){return l}}}return null},_isRes:function(i){return/^(top|left|bottom|right|width|height)/i.test(i)||/;\s*(top|left|bottom|right|width|height)/i.test(i)}});e.DOM=new e.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var O=this,e=c.doc,U=0,F=1,j=2,E=true,S=false,W="startOffset",h="startContainer",Q="endContainer",A="endOffset",k=tinymce.extend,n=c.nodeIndex;k(O,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:E,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:J,setEndBefore:K,setEndAfter:u,collapse:B,selectNode:y,selectNodeContents:G,compareBoundaryPoints:v,deleteContents:p,extractContents:I,cloneContents:d,insertNode:D,surroundContents:N,cloneRange:L,toStringIE:T});function x(){return e.createDocumentFragment()}function q(X,t){C(E,X,t)}function s(X,t){C(S,X,t)}function g(t){q(t.parentNode,n(t))}function J(t){q(t.parentNode,n(t)+1)}function K(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function B(t){if(t){O[Q]=O[h];O[A]=O[W]}else{O[h]=O[Q];O[W]=O[A]}O.collapsed=E}function y(t){g(t);u(t)}function G(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(aa,t){var ad=O[h],Y=O[W],ac=O[Q],X=O[A],ab=t.startContainer,af=t.startOffset,Z=t.endContainer,ae=t.endOffset;if(aa===0){return H(ad,Y,ab,af)}if(aa===1){return H(ac,X,ab,af)}if(aa===2){return H(ac,X,Z,ae)}if(aa===3){return H(ad,Y,Z,ae)}}function p(){l(j)}function I(){return l(U)}function d(){return l(F)}function D(aa){var X=this[h],t=this[W],Z,Y;if((X.nodeType===3||X.nodeType===4)&&X.nodeValue){if(!t){X.parentNode.insertBefore(aa,X)}else{if(t>=X.nodeValue.length){c.insertAfter(aa,X)}else{Z=X.splitText(t);X.parentNode.insertBefore(aa,Z)}}}else{if(X.childNodes.length>0){Y=X.childNodes[t]}if(Y){X.insertBefore(aa,Y)}else{X.appendChild(aa)}}}function N(X){var t=O.extractContents();O.insertNode(X);X.appendChild(t);O.selectNode(X)}function L(){return k(new b(c),{startContainer:O[h],startOffset:O[W],endContainer:O[Q],endOffset:O[A],collapsed:O.collapsed,commonAncestorContainer:O.commonAncestorContainer})}function P(t,X){var Y;if(t.nodeType==3){return t}if(X<0){return t}Y=t.firstChild;while(Y&&X>0){--X;Y=Y.nextSibling}if(Y){return Y}return t}function m(){return(O[h]==O[Q]&&O[W]==O[A])}function H(Z,ab,X,aa){var ac,Y,t,ad,af,ae;if(Z==X){if(ab==aa){return 0}if(ab0){O.collapse(X)}}else{O.collapse(X)}O.collapsed=m();O.commonAncestorContainer=c.findCommonAncestor(O[h],O[Q])}function l(ad){var ac,Z=0,af=0,X,ab,Y,aa,t,ae;if(O[h]==O[Q]){return f(ad)}for(ac=O[Q],X=ac.parentNode;X;ac=X,X=X.parentNode){if(X==O[h]){return r(ac,ad)}++Z}for(ac=O[h],X=ac.parentNode;X;ac=X,X=X.parentNode){if(X==O[Q]){return V(ac,ad)}++af}ab=af-Z;Y=O[h];while(ab>0){Y=Y.parentNode;ab--}aa=O[Q];while(ab<0){aa=aa.parentNode;ab++}for(t=Y.parentNode,ae=aa.parentNode;t!=ae;t=t.parentNode,ae=ae.parentNode){Y=t;aa=ae}return o(Y,aa,ad)}function f(ac){var ae,af,t,Y,Z,ad,aa,X,ab;if(ac!=j){ae=x()}if(O[W]==O[A]){return ae}if(O[h].nodeType==3){af=O[h].nodeValue;t=af.substring(O[W],O[A]);if(ac!=F){Y=O[h];X=O[W];ab=O[A]-O[W];if(X===0&&ab>=Y.nodeValue.length-1){Y.parentNode.removeChild(Y)}else{Y.deleteData(X,ab)}O.collapse(E)}if(ac==j){return}if(t.length>0){ae.appendChild(e.createTextNode(t))}return ae}Y=P(O[h],O[W]);Z=O[A]-O[W];while(Y&&Z>0){ad=Y.nextSibling;aa=z(Y,ac);if(ae){ae.appendChild(aa)}--Z;Y=ad}if(ac!=F){O.collapse(E)}return ae}function r(ad,aa){var ac,ab,X,t,Z,Y;if(aa!=j){ac=x()}ab=i(ad,aa);if(ac){ac.appendChild(ab)}X=n(ad);t=X-O[W];if(t<=0){if(aa!=F){O.setEndBefore(ad);O.collapse(S)}return ac}ab=ad.previousSibling;while(t>0){Z=ab.previousSibling;Y=z(ab,aa);if(ac){ac.insertBefore(Y,ac.firstChild)}--t;ab=Z}if(aa!=F){O.setEndBefore(ad);O.collapse(S)}return ac}function V(ab,aa){var ad,X,ac,t,Z,Y;if(aa!=j){ad=x()}ac=R(ab,aa);if(ad){ad.appendChild(ac)}X=n(ab);++X;t=O[A]-X;ac=ab.nextSibling;while(ac&&t>0){Z=ac.nextSibling;Y=z(ac,aa);if(ad){ad.appendChild(Y)}--t;ac=Z}if(aa!=F){O.setStartAfter(ab);O.collapse(E)}return ad}function o(ab,t,ae){var Y,ag,aa,ac,ad,X,af,Z;if(ae!=j){ag=x()}Y=R(ab,ae);if(ag){ag.appendChild(Y)}aa=ab.parentNode;ac=n(ab);ad=n(t);++ac;X=ad-ac;af=ab.nextSibling;while(X>0){Z=af.nextSibling;Y=z(af,ae);if(ag){ag.appendChild(Y)}af=Z;--X}Y=i(t,ae);if(ag){ag.appendChild(Y)}if(ae!=F){O.setStartAfter(ab);O.collapse(E)}return ag}function i(ac,ad){var Y=P(O[Q],O[A]-1),ae,ab,aa,t,X,Z=Y!=O[Q];if(Y==ac){return M(Y,Z,S,ad)}ae=Y.parentNode;ab=M(ae,S,S,ad);while(ae){while(Y){aa=Y.previousSibling;t=M(Y,Z,S,ad);if(ad!=j){ab.insertBefore(t,ab.firstChild)}Z=E;Y=aa}if(ae==ac){return ab}Y=ae.previousSibling;ae=ae.parentNode;X=M(ae,S,S,ad);if(ad!=j){X.appendChild(ab)}ab=X}}function R(ac,ad){var Z=P(O[h],O[W]),aa=Z!=O[h],ae,ab,Y,t,X;if(Z==ac){return M(Z,aa,E,ad)}ae=Z.parentNode;ab=M(ae,S,E,ad);while(ae){while(Z){Y=Z.nextSibling;t=M(Z,aa,E,ad);if(ad!=j){ab.appendChild(t)}aa=E;Z=Y}if(ae==ac){return ab}Z=ae.nextSibling;ae=ae.parentNode;X=M(ae,S,E,ad);if(ad!=j){X.appendChild(ab)}ab=X}}function M(t,aa,ad,ae){var Z,Y,ab,X,ac;if(aa){return z(t,ae)}if(t.nodeType==3){Z=t.nodeValue;if(ad){X=O[W];Y=Z.substring(X);ab=Z.substring(0,X)}else{X=O[A];Y=Z.substring(0,X);ab=Z.substring(X)}if(ae!=F){t.nodeValue=ab}if(ae==j){return}ac=c.clone(t,S);ac.nodeValue=Y;return ac}if(ae==j){return}return c.clone(t,S)}function z(X,t){if(t!=j){return t==F?c.clone(X,E):X}X.parentNode.removeChild(X)}function T(){return c.create("body",null,d()).outerText}return O}a.Range=b;b.prototype.toString=function(){return this.toStringIE()}})(tinymce.dom);(function(){function a(d){var b=this,h=d.dom,c=true,f=false;function e(i,j){var k,t=0,q,n,m,l,o,r,p=-1,s;k=i.duplicate();k.collapse(j);s=k.parentElement();if(s.ownerDocument!==d.dom.doc){return}while(s.contentEditable==="false"){s=s.parentNode}if(!s.hasChildNodes()){return{node:s,inside:1}}m=s.children;q=m.length-1;while(t<=q){r=Math.floor((t+q)/2);l=m[r];k.moveToElementText(l);p=k.compareEndPoints(j?"StartToStart":"EndToEnd",i);if(p>0){q=r-1}else{if(p<0){t=r+1}else{return{node:l}}}}if(p<0){if(!l){k.moveToElementText(s);k.collapse(true);l=s;n=true}else{k.collapse(false)}o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",1)===0||s!=k.parentElement()){break}o++}}else{k.collapse(true);o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",-1)===0||s!=k.parentElement()){break}o++}}return{node:l,position:p,offset:o,inside:n}}function g(){var i=d.getRng(),r=h.createRng(),l,k,p,q,m,j;l=i.item?i.item(0):i.parentElement();if(l.ownerDocument!=h.doc){return r}k=d.isCollapsed();if(i.item){r.setStart(l.parentNode,h.nodeIndex(l));r.setEnd(r.startContainer,r.startOffset+1);return r}function o(A){var u=e(i,A),s,y,z=0,x,v,t;s=u.node;y=u.offset;if(u.inside&&!s.hasChildNodes()){r[A?"setStart":"setEnd"](s,0);return}if(y===v){r[A?"setStartBefore":"setEndAfter"](s);return}if(u.position<0){x=u.inside?s.firstChild:s.nextSibling;if(!x){r[A?"setStartAfter":"setEndAfter"](s);return}if(!y){if(x.nodeType==3){r[A?"setStart":"setEnd"](x,0)}else{r[A?"setStartBefore":"setEndBefore"](x)}return}while(x){t=x.nodeValue;z+=t.length;if(z>=y){s=x;z-=y;z=t.length-z;break}x=x.nextSibling}}else{x=s.previousSibling;if(!x){return r[A?"setStartBefore":"setEndBefore"](s)}if(!y){if(s.nodeType==3){r[A?"setStart":"setEnd"](x,s.nodeValue.length)}else{r[A?"setStartAfter":"setEndAfter"](x)}return}while(x){z+=x.nodeValue.length;if(z>=y){s=x;z-=y;break}x=x.previousSibling}}r[A?"setStart":"setEnd"](s,z)}try{o(true);if(!k){o()}}catch(n){if(n.number==-2147024809){m=b.getBookmark(2);p=i.duplicate();p.collapse(true);l=p.parentElement();if(!k){p=i.duplicate();p.collapse(false);q=p.parentElement();q.innerHTML=q.innerHTML}l.innerHTML=l.innerHTML;b.moveToBookmark(m);i=d.getRng();o(true);if(!k){o()}}else{throw n}}return r}this.getBookmark=function(m){var j=d.getRng(),o,i,l={};function n(u){var t,p,s,r,q=[];t=u.parentNode;p=h.getRoot().parentNode;while(t!=p&&t.nodeType!==9){s=t.children;r=s.length;while(r--){if(u===s[r]){q.push(r);break}}u=t;t=t.parentNode}return q}function k(q){var p;p=e(j,q);if(p){return{position:p.position,offset:p.offset,indexes:n(p.node),inside:p.inside}}}if(m===2){if(!j.item){l.start=k(true);if(!d.isCollapsed()){l.end=k()}}else{l.start={ctrl:true,indexes:n(j.item(0))}}}return l};this.moveToBookmark=function(k){var j,i=h.doc.body;function m(o){var r,q,n,p;r=h.getRoot();for(q=o.length-1;q>=0;q--){p=r.children;n=o[q];if(n<=p.length-1){r=p[n]}}return r}function l(r){var n=k[r?"start":"end"],q,p,o;if(n){q=n.position>0;p=i.createTextRange();p.moveToElementText(m(n.indexes));offset=n.offset;if(offset!==o){p.collapse(n.inside||q);p.moveStart("character",q?-offset:offset)}else{p.collapse(r)}j.setEndPoint(r?"StartToStart":"EndToStart",p);if(r){j.collapse(true)}}}if(k.start){if(k.start.ctrl){j=i.createControlRange();j.addElement(m(k.start.indexes));j.select()}else{j=i.createTextRange();l(true);l();j.select()}}};this.addRange=function(i){var n,l,k,p,v,q,t,s=d.dom.doc,m=s.body,r,u;function j(C){var y,B,x,A,z;x=h.create("a");y=C?k:v;B=C?p:q;A=n.duplicate();if(y==s||y==s.documentElement){y=m;B=0}if(y.nodeType==3){y.parentNode.insertBefore(x,y);A.moveToElementText(x);A.moveStart("character",B);h.remove(x);n.setEndPoint(C?"StartToStart":"EndToEnd",A)}else{z=y.childNodes;if(z.length){if(B>=z.length){h.insertAfter(x,z[z.length-1])}else{y.insertBefore(x,z[B])}A.moveToElementText(x)}else{if(y.canHaveHTML){y.innerHTML="\uFEFF";x=y.firstChild;A.moveToElementText(x);A.collapse(f)}}n.setEndPoint(C?"StartToStart":"EndToEnd",A);h.remove(x)}}k=i.startContainer;p=i.startOffset;v=i.endContainer;q=i.endOffset;n=m.createTextRange();if(k==v&&k.nodeType==1){if(p==q&&!k.hasChildNodes()){if(k.canHaveHTML){t=k.previousSibling;if(t&&!t.hasChildNodes()&&h.isBlock(t)){t.innerHTML="\uFEFF"}else{t=null}k.innerHTML="\uFEFF\uFEFF";n.moveToElementText(k.lastChild);n.select();h.doc.selection.clear();k.innerHTML="";if(t){t.innerHTML=""}return}else{p=h.nodeIndex(k);k=k.parentNode}}if(p==q-1){try{u=k.childNodes[p];l=m.createControlRange();l.addElement(u);l.select();r=d.getRng();if(r.item&&u===r.item(0)){return}}catch(o){}}}j(true);j();n.select()};this.getRangeAt=g}tinymce.dom.TridentSelection=a})();(function(){var n=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i="sizcache",o=0,r=Object.prototype.toString,h=false,g=true,q=/\\/g,u=/\r\n/g,x=/\W/;[0,0].sort(function(){g=false;return 0});var d=function(C,e,F,G){F=F||[];e=e||document;var I=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!C||typeof C!=="string"){return F}var z,K,N,y,J,M,L,E,B=true,A=d.isXML(e),D=[],H=C;do{n.exec("");z=n.exec(H);if(z){H=z[3];D.push(z[1]);if(z[2]){y=z[3];break}}}while(z);if(D.length>1&&j.exec(C)){if(D.length===2&&k.relative[D[0]]){K=s(D[0]+D[1],e,G)}else{K=k.relative[D[0]]?[e]:d(D.shift(),e);while(D.length){C=D.shift();if(k.relative[C]){C+=D.shift()}K=s(C,K,G)}}}else{if(!G&&D.length>1&&e.nodeType===9&&!A&&k.match.ID.test(D[0])&&!k.match.ID.test(D[D.length-1])){J=d.find(D.shift(),e,A);e=J.expr?d.filter(J.expr,J.set)[0]:J.set[0]}if(e){J=G?{expr:D.pop(),set:l(G)}:d.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&e.parentNode?e.parentNode:e,A);K=J.expr?d.filter(J.expr,J.set):J.set;if(D.length>0){N=l(K)}else{B=false}while(D.length){M=D.pop();L=M;if(!k.relative[M]){M=""}else{L=D.pop()}if(L==null){L=e}k.relative[M](N,L,A)}}else{N=D=[]}}if(!N){N=K}if(!N){d.error(M||C)}if(r.call(N)==="[object Array]"){if(!B){F.push.apply(F,N)}else{if(e&&e.nodeType===1){for(E=0;N[E]!=null;E++){if(N[E]&&(N[E]===true||N[E].nodeType===1&&d.contains(e,N[E]))){F.push(K[E])}}}else{for(E=0;N[E]!=null;E++){if(N[E]&&N[E].nodeType===1){F.push(K[E])}}}}}else{l(N,F)}if(y){d(y,I,F,G);d.uniqueSort(F)}return F};d.uniqueSort=function(y){if(p){h=g;y.sort(p);if(h){for(var e=1;e0};d.find=function(E,e,F){var D,z,B,A,C,y;if(!E){return[]}for(z=0,B=k.order.length;z":function(D,y){var C,B=typeof y==="string",z=0,e=D.length;if(B&&!x.test(y)){y=y.toLowerCase();for(;z=0)){if(!z){e.push(C)}}else{if(z){y[B]=false}}}}return false},ID:function(e){return e[1].replace(q,"")},TAG:function(y,e){return y[1].replace(q,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){d.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var y=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(y[1]+(y[2]||1))-0;e[3]=y[3]-0}else{if(e[2]){d.error(e[0])}}e[0]=o++;return e},ATTR:function(B,y,z,e,C,D){var A=B[1]=B[1].replace(q,"");if(!D&&k.attrMap[A]){B[1]=k.attrMap[A]}B[4]=(B[4]||B[5]||"").replace(q,"");if(B[2]==="~="){B[4]=" "+B[4]+" "}return B},PSEUDO:function(B,y,z,e,C){if(B[1]==="not"){if((n.exec(B[3])||"").length>1||/^\w/.test(B[3])){B[3]=d(B[3],null,null,y)}else{var A=d.filter(B[3],y,z,true^C);if(!z){e.push.apply(e,A)}return false}}else{if(k.match.POS.test(B[0])||k.match.CHILD.test(B[0])){return true}}return B},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(z,y,e){return !!d(e[3],z).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(z){var e=z.getAttribute("type"),y=z.type;return z.nodeName.toLowerCase()==="input"&&"text"===y&&(e===y||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(y){var e=y.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===y.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(y){var e=y.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===y.type},button:function(y){var e=y.nodeName.toLowerCase();return e==="input"&&"button"===y.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(y,e){return e===0},last:function(z,y,e,A){return y===A.length-1},even:function(y,e){return e%2===0},odd:function(y,e){return e%2===1},lt:function(z,y,e){return ye[3]-0},nth:function(z,y,e){return e[3]-0===y},eq:function(z,y,e){return e[3]-0===y}},filter:{PSEUDO:function(z,E,D,F){var e=E[1],y=k.filters[e];if(y){return y(z,D,E,F)}else{if(e==="contains"){return(z.textContent||z.innerText||b([z])||"").indexOf(E[3])>=0}else{if(e==="not"){var A=E[3];for(var C=0,B=A.length;C=0)}}},ID:function(y,e){return y.nodeType===1&&y.getAttribute("id")===e},TAG:function(y,e){return(e==="*"&&y.nodeType===1)||!!y.nodeName&&y.nodeName.toLowerCase()===e},CLASS:function(y,e){return(" "+(y.className||y.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(C,A){var z=A[1],e=d.attr?d.attr(C,z):k.attrHandle[z]?k.attrHandle[z](C):C[z]!=null?C[z]:C.getAttribute(z),D=e+"",B=A[2],y=A[4];return e==null?B==="!=":!B&&d.attr?e!=null:B==="="?D===y:B==="*="?D.indexOf(y)>=0:B==="~="?(" "+D+" ").indexOf(y)>=0:!y?D&&e!==false:B==="!="?D!==y:B==="^="?D.indexOf(y)===0:B==="$="?D.substr(D.length-y.length)===y:B==="|="?D===y||D.substr(0,y.length+1)===y+"-":false},POS:function(B,y,z,C){var e=y[2],A=k.setFilters[e];if(A){return A(B,z,y,C)}}}};var j=k.match.POS,c=function(y,e){return"\\"+(e-0+1)};for(var f in k.match){k.match[f]=new RegExp(k.match[f].source+(/(?![^\[]*\])(?![^\(]*\))/.source));k.leftMatch[f]=new RegExp(/(^(?:.|\r|\n)*?)/.source+k.match[f].source.replace(/\\(\d+)/g,c))}k.match.globalPOS=j;var l=function(y,e){y=Array.prototype.slice.call(y,0);if(e){e.push.apply(e,y);return e}return y};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(v){l=function(B,A){var z=0,y=A||[];if(r.call(B)==="[object Array]"){Array.prototype.push.apply(y,B)}else{if(typeof B.length==="number"){for(var e=B.length;z";e.insertBefore(y,e.firstChild);if(document.getElementById(z)){k.find.ID=function(B,C,D){if(typeof C.getElementById!=="undefined"&&!D){var A=C.getElementById(B[1]);return A?A.id===B[1]||typeof A.getAttributeNode!=="undefined"&&A.getAttributeNode("id").nodeValue===B[1]?[A]:undefined:[]}};k.filter.ID=function(C,A){var B=typeof C.getAttributeNode!=="undefined"&&C.getAttributeNode("id");return C.nodeType===1&&B&&B.nodeValue===A}}e.removeChild(y);e=y=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){k.find.TAG=function(y,C){var B=C.getElementsByTagName(y[1]);if(y[1]==="*"){var A=[];for(var z=0;B[z];z++){if(B[z].nodeType===1){A.push(B[z])}}B=A}return B}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){k.attrHandle.href=function(y){return y.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=d,A=document.createElement("div"),z="__sizzle__";A.innerHTML="

    ";if(A.querySelectorAll&&A.querySelectorAll(".TEST").length===0){return}d=function(L,C,G,K){C=C||document;if(!K&&!d.isXML(C)){var J=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(L);if(J&&(C.nodeType===1||C.nodeType===9)){if(J[1]){return l(C.getElementsByTagName(L),G)}else{if(J[2]&&k.find.CLASS&&C.getElementsByClassName){return l(C.getElementsByClassName(J[2]),G)}}}if(C.nodeType===9){if(L==="body"&&C.body){return l([C.body],G)}else{if(J&&J[3]){var F=C.getElementById(J[3]);if(F&&F.parentNode){if(F.id===J[3]){return l([F],G)}}else{return l([],G)}}}try{return l(C.querySelectorAll(L),G)}catch(H){}}else{if(C.nodeType===1&&C.nodeName.toLowerCase()!=="object"){var D=C,E=C.getAttribute("id"),B=E||z,N=C.parentNode,M=/^\s*[+~]/.test(L);if(!E){C.setAttribute("id",B)}else{B=B.replace(/'/g,"\\$&")}if(M&&N){C=C.parentNode}try{if(!M||N){return l(C.querySelectorAll("[id='"+B+"'] "+L),G)}}catch(I){}finally{if(!E){D.removeAttribute("id")}}}}}return e(L,C,G,K)};for(var y in e){d[y]=e[y]}A=null})()}(function(){var e=document.documentElement,z=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(z){var B=!z.call(document.createElement("div"),"div"),y=false;try{z.call(document.documentElement,"[test!='']:sizzle")}catch(A){y=true}d.matchesSelector=function(D,F){F=F.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!d.isXML(D)){try{if(y||!k.match.PSEUDO.test(F)&&!/!=/.test(F)){var C=z.call(D,F);if(C||!B||D.document&&D.document.nodeType!==11){return C}}}catch(E){}}return d(F,null,null,[D]).length>0}}})();(function(){var e=document.createElement("div");e.innerHTML="
    ";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}k.order.splice(1,0,"CLASS");k.find.CLASS=function(y,z,A){if(typeof z.getElementsByClassName!=="undefined"&&!A){return z.getElementsByClassName(y[1])}};e=null})();function a(y,D,C,G,E,F){for(var A=0,z=G.length;A0){B=e;break}}}e=e[y]}G[A]=B}}}if(document.documentElement.contains){d.contains=function(y,e){return y!==e&&(y.contains?y.contains(e):true)}}else{if(document.documentElement.compareDocumentPosition){d.contains=function(y,e){return !!(y.compareDocumentPosition(e)&16)}}else{d.contains=function(){return false}}}d.isXML=function(e){var y=(e?e.ownerDocument||e:0).documentElement;return y?y.nodeName!=="HTML":false};var s=function(z,e,D){var C,E=[],B="",F=e.nodeType?[e]:e;while((C=k.match.PSEUDO.exec(z))){B+=C[0];z=z.replace(k.match.PSEUDO,"")}z=k.relative[z]?z+"*":z;for(var A=0,y=F.length;A"+(i.item?i.item(0).outerHTML:i.htmlText);m.removeChild(m.firstChild)}else{m.innerHTML=i.toString()}}if(/^\s/.test(m.innerHTML)){j=" "}if(/\s+$/.test(m.innerHTML)){l=" "}h.getInner=true;h.content=g.isCollapsed()?"":j+g.serializer.serialize(m,h)+l;g.onGetContent.dispatch(g,h);return h.content},setContent:function(h,j){var o=this,g=o.getRng(),k,l=o.win.document,n,m;j=j||{format:"html"};j.set=true;h=j.content=h;if(!j.no_events){o.onBeforeSetContent.dispatch(o,j)}h=j.content;if(g.insertNode){h+='_';if(g.startContainer==l&&g.endContainer==l){l.body.innerHTML=h}else{g.deleteContents();if(l.body.childNodes.length===0){l.body.innerHTML=h}else{if(g.createContextualFragment){g.insertNode(g.createContextualFragment(h))}else{n=l.createDocumentFragment();m=l.createElement("div");n.appendChild(m);m.outerHTML=h;g.insertNode(n)}}}k=o.dom.get("__caret");g=l.createRange();g.setStartBefore(k);g.setEndBefore(k);o.setRng(g);o.dom.remove("__caret");try{o.setRng(g)}catch(i){}}else{if(g.item){l.execCommand("Delete",false,null);g=o.getRng()}if(/^\s+/.test(h)){g.pasteHTML('_'+h);o.dom.remove("__mce_tmp")}else{g.pasteHTML(h)}}if(!j.no_events){o.onSetContent.dispatch(o,j)}},getStart:function(){var i=this,h=i.getRng(),j,g,l,k;if(h.duplicate||h.item){if(h.item){return h.item(0)}l=h.duplicate();l.collapse(1);j=l.parentElement();if(j.ownerDocument!==i.dom.doc){j=i.dom.getRoot()}g=k=h.parentElement();while(k=k.parentNode){if(k==j){j=g;break}}return j}else{j=h.startContainer;if(j.nodeType==1&&j.hasChildNodes()){j=j.childNodes[Math.min(j.childNodes.length-1,h.startOffset)]}if(j&&j.nodeType==3){return j.parentNode}return j}},getEnd:function(){var h=this,g=h.getRng(),j,i;if(g.duplicate||g.item){if(g.item){return g.item(0)}g=g.duplicate();g.collapse(0);j=g.parentElement();if(j.ownerDocument!==h.dom.doc){j=h.dom.getRoot()}if(j&&j.nodeName=="BODY"){return j.lastChild||j}return j}else{j=g.endContainer;i=g.endOffset;if(j.nodeType==1&&j.hasChildNodes()){j=j.childNodes[i>0?i-1:i]}if(j&&j.nodeType==3){return j.parentNode}return j}},getBookmark:function(s,v){var y=this,n=y.dom,h,k,j,o,i,p,q,m="\uFEFF",x;function g(z,A){var t=0;e(n.select(z),function(C,B){if(C==A){t=B}});return t}function u(t){function z(E){var A,D,C,B=E?"start":"end";A=t[B+"Container"];D=t[B+"Offset"];if(A.nodeType==1&&A.nodeName=="TR"){C=A.childNodes;A=C[Math.min(E?D:D-1,C.length-1)];if(A){D=E?0:A.childNodes.length;t["set"+(E?"Start":"End")](A,D)}}}z(true);z();return t}function l(){var z=y.getRng(true),t=n.getRoot(),A={};function B(E,J){var D=E[J?"startContainer":"endContainer"],I=E[J?"startOffset":"endOffset"],C=[],F,H,G=0;if(D.nodeType==3){if(v){for(F=D.previousSibling;F&&F.nodeType==3;F=F.previousSibling){I+=F.nodeValue.length}}C.push(I)}else{H=D.childNodes;if(I>=H.length&&H.length){G=1;I=Math.max(0,H.length-1)}C.push(y.dom.nodeIndex(H[I],v)+G)}for(;D&&D!=t;D=D.parentNode){C.push(y.dom.nodeIndex(D,v))}return C}A.start=B(z,true);if(!y.isCollapsed()){A.end=B(z)}return A}if(s==2){if(y.tridentSel){return y.tridentSel.getBookmark(s)}return l()}if(s){return{rng:y.getRng()}}h=y.getRng();j=n.uniqueId();o=tinyMCE.activeEditor.selection.isCollapsed();x="overflow:hidden;line-height:0px";if(h.duplicate||h.item){if(!h.item){k=h.duplicate();try{h.collapse();h.pasteHTML(''+m+"");if(!o){k.collapse(false);h.moveToElementText(k.parentElement());if(h.compareEndPoints("StartToEnd",k)===0){k.move("character",-1)}k.pasteHTML(''+m+"")}}catch(r){return null}}else{p=h.item(0);i=p.nodeName;return{name:i,index:g(i,p)}}}else{p=y.getNode();i=p.nodeName;if(i=="IMG"){return{name:i,index:g(i,p)}}k=u(h.cloneRange());if(!o){k.collapse(false);k.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_end",style:x},m))}h=u(h);h.collapse(true);h.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_start",style:x},m))}y.moveToBookmark({id:j,keep:1});return{id:j}},moveToBookmark:function(o){var s=this,m=s.dom,j,i,g,r,k,u,p,q;function h(A){var t=o[A?"start":"end"],x,y,z,v;if(t){z=t[0];for(y=r,x=t.length-1;x>=1;x--){v=y.childNodes;if(t[x]>v.length-1){return}y=v[t[x]]}if(y.nodeType===3){z=Math.min(t[0],y.nodeValue.length)}if(y.nodeType===1){z=Math.min(t[0],y.childNodes.length)}if(A){g.setStart(y,z)}else{g.setEnd(y,z)}}return true}function l(B){var v=m.get(o.id+"_"+B),A,t,y,z,x=o.keep;if(v){A=v.parentNode;if(B=="start"){if(!x){t=m.nodeIndex(v)}else{A=v.firstChild;t=1}k=u=A;p=q=t}else{if(!x){t=m.nodeIndex(v)}else{A=v.firstChild;t=1}u=A;q=t}if(!x){z=v.previousSibling;y=v.nextSibling;e(d.grep(v.childNodes),function(C){if(C.nodeType==3){C.nodeValue=C.nodeValue.replace(/\uFEFF/g,"")}});while(v=m.get(o.id+"_"+B)){m.remove(v,1)}if(z&&y&&z.nodeType==y.nodeType&&z.nodeType==3&&!d.isOpera){t=z.nodeValue.length;z.appendData(y.nodeValue);m.remove(y);if(B=="start"){k=u=z;p=q=t}else{u=z;q=t}}}}}function n(t){if(m.isBlock(t)&&!t.innerHTML&&!b){t.innerHTML='
    '}return t}if(o){if(o.start){g=m.createRng();r=m.getRoot();if(s.tridentSel){return s.tridentSel.moveToBookmark(o)}if(h(true)&&h()){s.setRng(g)}}else{if(o.id){l("start");l("end");if(k){g=m.createRng();g.setStart(n(k),p);g.setEnd(n(u),q);s.setRng(g)}}else{if(o.name){s.select(m.select(o.name)[o.index])}else{if(o.rng){s.setRng(o.rng)}}}}}},select:function(l,k){var j=this,m=j.dom,h=m.createRng(),g;function i(n,p){var o=new a(n,n);do{if(n.nodeType==3&&d.trim(n.nodeValue).length!==0){if(p){h.setStart(n,0)}else{h.setEnd(n,n.nodeValue.length)}return}if(n.nodeName=="BR"){if(p){h.setStartBefore(n)}else{h.setEndBefore(n)}return}}while(n=(p?o.next():o.prev()))}if(l){g=m.nodeIndex(l);h.setStart(l.parentNode,g);h.setEnd(l.parentNode,g+1);if(k){i(l,1);i(l)}j.setRng(h)}return l},isCollapsed:function(){var g=this,i=g.getRng(),h=g.getSel();if(!i||i.item){return false}if(i.compareEndPoints){return i.compareEndPoints("StartToEnd",i)===0}return !h||i.collapsed},collapse:function(g){var i=this,h=i.getRng(),j;if(h.item){j=h.item(0);h=i.win.document.body.createTextRange();h.moveToElementText(j)}h.collapse(!!g);i.setRng(h)},getSel:function(){var h=this,g=this.win;return g.getSelection?g.getSelection():g.document.selection},getRng:function(m){var h=this,j,g,l,k=h.win.document;if(m&&h.tridentSel){return h.tridentSel.getRangeAt(0)}try{if(j=h.getSel()){g=j.rangeCount>0?j.getRangeAt(0):(j.createRange?j.createRange():k.createRange())}}catch(i){}if(d.isIE&&g&&g.setStart&&k.selection.createRange().item){l=k.selection.createRange().item(0);g=k.createRange();g.setStartBefore(l);g.setEndAfter(l)}if(!g){g=k.createRange?k.createRange():k.body.createTextRange()}if(g.setStart&&g.startContainer.nodeType===9&&g.collapsed){l=h.dom.getRoot();g.setStart(l,0);g.setEnd(l,0)}if(h.selectedRange&&h.explicitRange){if(g.compareBoundaryPoints(g.START_TO_START,h.selectedRange)===0&&g.compareBoundaryPoints(g.END_TO_END,h.selectedRange)===0){g=h.explicitRange}else{h.selectedRange=null;h.explicitRange=null}}return g},setRng:function(k,g){var j,i=this;if(!i.tridentSel){j=i.getSel();if(j){i.explicitRange=k;try{j.removeAllRanges()}catch(h){}j.addRange(k);if(g===false&&j.extend){j.collapse(k.endContainer,k.endOffset);j.extend(k.startContainer,k.startOffset)}i.selectedRange=j.rangeCount>0?j.getRangeAt(0):null}}else{if(k.cloneRange){try{i.tridentSel.addRange(k);return}catch(h){}}try{k.select()}catch(h){}}},setNode:function(h){var g=this;g.setContent(g.dom.getOuterHTML(h));return h},getNode:function(){var i=this,h=i.getRng(),j=i.getSel(),m,l=h.startContainer,g=h.endContainer;function k(q,o){var p=q;while(q&&q.nodeType===3&&q.length===0){q=o?q.nextSibling:q.previousSibling}return q||p}if(!h){return i.dom.getRoot()}if(h.setStart){m=h.commonAncestorContainer;if(!h.collapsed){if(h.startContainer==h.endContainer){if(h.endOffset-h.startOffset<2){if(h.startContainer.hasChildNodes()){m=h.startContainer.childNodes[h.startOffset]}}}if(l.nodeType===3&&g.nodeType===3){if(l.length===h.startOffset){l=k(l.nextSibling,true)}else{l=l.parentNode}if(h.endOffset===0){g=k(g.previousSibling,false)}else{g=g.parentNode}if(l&&l===g){return l}}}if(m&&m.nodeType==3){return m.parentNode}return m}return h.item?h.item(0):h.parentElement()},getSelectedBlocks:function(p,h){var o=this,k=o.dom,m,l,i,j=[];m=k.getParent(p||o.getStart(),k.isBlock);l=k.getParent(h||o.getEnd(),k.isBlock);if(m){j.push(m)}if(m&&l&&m!=l){i=m;var g=new a(m,k.getRoot());while((i=g.next())&&i!=l){if(k.isBlock(i)){j.push(i)}}}if(l&&m!=l){j.push(l)}return j},isForward:function(){var i=this.dom,g=this.getSel(),j,h;if(!g||g.anchorNode==null||g.focusNode==null){return true}j=i.createRng();j.setStart(g.anchorNode,g.anchorOffset);j.collapse(true);h=i.createRng();h.setStart(g.focusNode,g.focusOffset);h.collapse(true);return j.compareBoundaryPoints(j.START_TO_START,h)<=0},normalize:function(){var h=this,g,m,l,j,i;function k(p){var o,r,n,s=h.dom,u=s.getRoot(),q,t,v;function y(z,A){var B=new a(z,s.getParent(z.parentNode,s.isBlock)||u);while(z=B[A?"prev":"next"]()){if(z.nodeName==="BR"){return true}}}function x(B,z){var C,A;z=z||o;C=new a(z,s.getParent(z.parentNode,s.isBlock)||u);while(q=C[B?"prev":"next"]()){if(q.nodeType===3&&q.nodeValue.length>0){o=q;r=B?q.nodeValue.length:0;m=true;return}if(s.isBlock(q)||t[q.nodeName.toLowerCase()]){return}A=q}if(l&&A){o=A;m=true;r=0}}o=g[(p?"start":"end")+"Container"];r=g[(p?"start":"end")+"Offset"];t=s.schema.getNonEmptyElements();if(o.nodeType===9){o=s.getRoot();r=0}if(o===u){if(p){q=o.childNodes[r>0?r-1:0];if(q){v=q.nodeName.toLowerCase();if(t[q.nodeName]||q.nodeName=="TABLE"){return}}}if(o.hasChildNodes()){o=o.childNodes[Math.min(!p&&r>0?r-1:r,o.childNodes.length-1)];r=0;if(o.hasChildNodes()&&!/TABLE/.test(o.nodeName)){q=o;n=new a(o,u);do{if(q.nodeType===3&&q.nodeValue.length>0){r=p?0:q.nodeValue.length;o=q;m=true;break}if(t[q.nodeName.toLowerCase()]){r=s.nodeIndex(q);o=q.parentNode;if(q.nodeName=="IMG"&&!p){r++}m=true;break}}while(q=(p?n.next():n.prev()))}}}if(l){if(o.nodeType===3&&r===0){x(true)}if(o.nodeType===1){q=o.childNodes[r];if(q&&q.nodeName==="BR"&&!y(q)&&!y(q,true)){x(true,o.childNodes[r])}}}if(p&&!l&&o.nodeType===3&&r===o.nodeValue.length){x(false)}if(m){g["set"+(p?"Start":"End")](o,r)}}if(d.isIE){return}g=h.getRng();l=g.collapsed;k(true);if(!l){k()}if(m){if(l){g.collapse(true)}h.setRng(g,h.isForward())}},selectorChanged:function(g,j){var h=this,i;if(!h.selectorChangedData){h.selectorChangedData={};i={};h.editor.onNodeChange.addToTop(function(l,k,o){var p=h.dom,m=p.getParents(o,null,p.getRoot()),n={};e(h.selectorChangedData,function(r,q){e(m,function(s){if(p.is(s,q)){if(!i[q]){e(r,function(t){t(true,{node:s,selector:q,parents:m})});i[q]=r}n[q]=r;return false}})});e(i,function(r,q){if(!n[q]){delete i[q];e(r,function(s){s(false,{node:o,selector:q,parents:m})})}})})}if(!h.selectorChangedData[g]){h.selectorChangedData[g]=[]}h.selectorChangedData[g].push(j);return h},scrollIntoView:function(k){var j,h,g=this,i=g.dom;h=i.getViewPort(g.editor.getWin());j=i.getPos(k).y;if(jh.y+h.h){g.editor.getWin().scrollTo(0,j0){p.setEndPoint("StartToStart",o)}else{p.setEndPoint("EndToEnd",o)}p.select()}}else{l()}}function l(){var p=n.selection.createRange();if(o&&!p.item&&p.compareEndPoints("StartToEnd",p)===0){o.select()}h.unbind(n,"mouseup",l);h.unbind(n,"mousemove",m);o=k=0}n.documentElement.unselectable=true;h.bind(n,["mousedown","contextmenu"],function(p){if(p.target.nodeName==="HTML"){if(k){l()}g=n.documentElement;if(g.scrollHeight>g.clientHeight){return}k=1;o=j(p.x,p.y);if(o){h.bind(n,"mouseup",l);h.bind(n,"mousemove",m);h.win.focus();o.select()}}})}})})(tinymce);(function(a){a.dom.Serializer=function(e,i,f){var h,b,d=a.isIE,g=a.each,c;if(!e.apply_source_formatting){e.indent=false}i=i||a.DOM;f=f||new a.html.Schema(e);e.entity_encoding=e.entity_encoding||"named";e.remove_trailing_brs="remove_trailing_brs" in e?e.remove_trailing_brs:true;h=new a.util.Dispatcher(self);b=new a.util.Dispatcher(self);c=new a.html.DomParser(e,f);c.addAttributeFilter("src,href,style",function(k,j){var o=k.length,l,q,n="data-mce-"+j,p=e.url_converter,r=e.url_converter_scope,m;while(o--){l=k[o];q=l.attributes.map[n];if(q!==m){l.attr(j,q.length>0?q:null);l.attr(n,null)}else{q=l.attributes.map[j];if(j==="style"){q=i.serializeStyle(i.parseStyle(q),l.name)}else{if(p){q=p.call(r,q,j,l.name)}}l.attr(j,q.length>0?q:null)}}});c.addAttributeFilter("class",function(j,k){var l=j.length,m,n;while(l--){m=j[l];n=m.attr("class").replace(/(?:^|\s)mce(Item\w+|Selected)(?!\S)/g,"");m.attr("class",n.length>0?n:null)}});c.addAttributeFilter("data-mce-type",function(j,l,k){var m=j.length,n;while(m--){n=j[m];if(n.attributes.map["data-mce-type"]==="bookmark"&&!k.cleanup){n.remove()}}});c.addAttributeFilter("data-mce-expando",function(j,l,k){var m=j.length;while(m--){j[m].attr(l,null)}});c.addNodeFilter("noscript",function(j){var k=j.length,l;while(k--){l=j[k].firstChild;if(l){l.value=a.html.Entities.decode(l.value)}}});c.addNodeFilter("script,style",function(k,l){var m=k.length,n,o;function j(p){return p.replace(/()/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}while(m--){n=k[m];o=n.firstChild?n.firstChild.value:"";if(l==="script"){n.attr("type",(n.attr("type")||"text/javascript").replace(/^mce\-/,""));if(o.length>0){n.firstChild.value="// "}}else{if(o.length>0){n.firstChild.value=""}}}});c.addNodeFilter("#comment",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.value.indexOf("[CDATA[")===0){m.name="#cdata";m.type=4;m.value=m.value.replace(/^\[CDATA\[|\]\]$/g,"")}else{if(m.value.indexOf("mce:protected ")===0){m.name="#text";m.type=3;m.raw=true;m.value=unescape(m.value).substr(14)}}}});c.addNodeFilter("xml:namespace,input",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.type===7){m.remove()}else{if(m.type===1){if(k==="input"&&!("type" in m.attributes.map)){m.attr("type","text")}}}}});if(e.fix_list_elements){c.addNodeFilter("ul,ol",function(k,l){var m=k.length,n,j;while(m--){n=k[m];j=n.parent;if(j.name==="ul"||j.name==="ol"){if(n.prev&&n.prev.name==="li"){n.prev.append(n)}}}})}c.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style",function(j,k){var l=j.length;while(l--){j[l].attr(k,null)}});return{schema:f,addNodeFilter:c.addNodeFilter,addAttributeFilter:c.addAttributeFilter,onPreProcess:h,onPostProcess:b,serialize:function(o,m){var l,p,k,j,n;if(d&&i.select("script,style,select,map").length>0){n=o.innerHTML;o=o.cloneNode(false);i.setHTML(o,n)}else{o=o.cloneNode(true)}l=o.ownerDocument.implementation;if(l.createHTMLDocument){p=l.createHTMLDocument("");g(o.nodeName=="BODY"?o.childNodes:[o],function(q){p.body.appendChild(p.importNode(q,true))});if(o.nodeName!="BODY"){o=p.body.firstChild}else{o=p.body}k=i.doc;i.doc=p}m=m||{};m.format=m.format||"html";if(!m.no_events){m.node=o;h.dispatch(self,m)}j=new a.html.Serializer(e,f);m.content=j.serialize(c.parse(a.trim(m.getInner?o.innerHTML:i.getOuterHTML(o)),m));if(!m.cleanup){m.content=m.content.replace(/\uFEFF/g,"")}if(!m.no_events){b.dispatch(self,m)}if(k){i.doc=k}m.node=null;return m.content},addRules:function(j){f.addValidElements(j)},setRules:function(j){f.setValidElements(j)}}}})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],e={},d=[],g=0,f;function b(m,v){var x=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}v()}function u(){if(typeof(console)!=="undefined"&&console.log){console.log("Failed to load: "+m)}}n=q.uniqueId();if(a.isIE6){o=new a.util.URI(m);r=location;if(o.host==r.hostname&&o.port==r.port&&(o.protocol+":")==r.protocol&&o.protocol.toLowerCase()!="file"){a.util.XHR.send({url:a._addVer(o.getURI()),success:function(y){var t=q.create("script",{type:"text/javascript"});t.text=y;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()},error:u});return}}s=document.createElement("script");s.id=n;s.type="text/javascript";s.src=a._addVer(m);if(!a.isIE){s.onload=p}s.onerror=u;if(!a.isOpera){s.onreadystatechange=function(){var t=s.readyState;if(t=="complete"||t=="loaded"){p()}}}(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}this.isDone=function(m){return l[m]==i};this.markDone=function(m){l[m]=i};this.add=this.load=function(m,q,n){var o,p=l[m];if(p==f){j.push(m);l[m]=c}if(q){if(!e[m]){e[m]=[]}e[m].push({func:q,scope:n||this})}};this.loadQueue=function(n,m){this.loadScripts(j,n,m)};this.loadScripts=function(m,q,p){var o;function n(r){a.each(e[r],function(s){s.func.call(s.scope)});e[r]=f}d.push({func:q,scope:p||this});o=function(){var r=a.grep(m);m.length=0;a.each(r,function(s){if(l[s]==i){n(s);return}if(l[s]!=k){l[s]=k;g++;b(s,function(){l[s]=i;g--;n(s);o()})}});if(!g){a.each(d,function(s){s.func.call(s.scope)});d.length=0}};o()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,s){var i=d.startContainer,l=d.startOffset,t=d.endContainer,m=d.endOffset,j,g,o,h,r,q,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(u){s([u])});return}function f(u){var v;v=u[0];if(v.nodeType===3&&v===i&&l>=v.nodeValue.length){u.splice(0,1)}v=u[u.length-1];if(m===0&&u.length>0&&v===t&&v.nodeType===3){u.splice(u.length-1,1)}return u}function p(x,v,u){var y=[];for(;x&&x!=u;x=x[v]){y.push(x)}return y}function n(v,u){do{if(v.parentNode==u){return v}v=v.parentNode}while(v)}function k(x,v,y){var u=y?"nextSibling":"previousSibling";for(h=x,r=h.parentNode;h&&h!=v;h=r){r=h.parentNode;q=p(h==x?h:h[u],u);if(q.length){if(!y){q.reverse()}s(f(q))}}}if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[l]}if(t.nodeType==1&&t.hasChildNodes()){t=t.childNodes[Math.min(m-1,t.childNodes.length-1)]}if(i==t){return s(f([i]))}j=c.findCommonAncestor(i,t);for(h=i;h;h=h.parentNode){if(h===t){return k(i,j,true)}if(h===j){break}}for(h=t;h;h=h.parentNode){if(h===i){return k(t,j)}if(h===j){break}}g=n(i,j)||i;o=n(t,j)||t;k(i,g,true);q=p(g==i?g:g.nextSibling,"nextSibling",o==t?o.nextSibling:o);if(q.length){s(f(q))}k(t,o)};this.split=function(e){var h=e.startContainer,d=e.startOffset,i=e.endContainer,g=e.endOffset;function f(j,k){return j.splitText(k)}if(h==i&&h.nodeType==3){if(d>0&&dd){g=g-d;h=i=f(i,g).previousSibling;g=i.nodeValue.length;d=0}else{g=0}}}else{if(h.nodeType==3&&d>0&&d0&&g=m.length){r=0}}t=m[r];f.setAttrib(g,"tabindex","-1");f.setAttrib(t.id,"tabindex","0");f.get(t.id).focus();if(e.actOnFocus){e.onAction(t.id)}if(s){a.cancel(s)}};p=function(z){var v=37,u=39,y=38,A=40,r=27,t=14,s=13,x=32;switch(z.keyCode){case v:if(i){q.moveFocus(-1)}break;case u:if(i){q.moveFocus(1)}break;case y:if(o){q.moveFocus(-1)}break;case A:if(o){q.moveFocus(1)}break;case r:if(e.onCancel){e.onCancel();a.cancel(z)}break;case t:case s:case x:if(e.onAction){e.onAction(g);a.cancel(z)}break}};c(m,function(t,r){var s,u;if(!t.id){t.id=f.uniqueId("_mce_item_")}u=f.get(t.id);if(l){f.bind(u,"blur",h);s="-1"}else{s=(r===0?"0":"-1")}u.setAttribute("tabindex",s);f.bind(u,"focus",k)});if(m[0]){g=m[0].id}f.setAttrib(n,"tabindex","-1");var j=f.get(n);f.bind(j,"focus",d);f.bind(j,"keydown",p)}})})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(f,e,d){this.id=f;this.settings=e=e||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=e.scope||this;this.disabled=0;this.active=0;this.editor=d},setAriaProperty:function(f,e){var d=b.get(this.id+"_aria")||b.get(this.id);if(d){b.setAttrib(d,"aria-"+f,!!e)}},focus:function(){b.get(this.id).focus()},setDisabled:function(d){if(d!=this.disabled){this.setAriaProperty("disabled",d);this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d;this.setAriaProperty("pressed",d)}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(c,b,a){this.parent(c,b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator";this.setDisabled(true)},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix,role:"separator","aria-orientation":"vertical",tabindex:"-1"})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.setAriaProperty("checked",!!f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;j.keyboard_focus=i.keyboard_focus;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},focus:function(){var g=this;if(g.keyboardNav){g.keyboardNav.focus()}},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.offsetWidth,j.max_width):g.offsetWidth;k=j.max_height?Math.min(g.offsetHeight,j.max_height):g.offsetHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeightv){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return false}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=z.items[x.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,m+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}a.add(o,"keydown",z._keyHandler,z);z.onShowMenu.dispatch(z);if(A.keyboard_focus){z._setupKeyboardNav()}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(h,"mouseover",g.mouseOverFunc);a.remove(c.select("a",h),"focus",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);a.remove(h,"keydown",g._keyHandler);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{role:"listbox",id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000;outline:0"});if(i.settings.parent){c.setAttrib(g,"aria-parent","menu_"+i.settings.parent.id)}k=c.add(g,"div",{role:"presentation",id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{role:"presentation",id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_setupKeyboardNav:function(){var i,h,g=this;i=c.get("menu_"+g.id);h=c.select("a[role=option]","menu_"+g.id);h.splice(0,0,i);g.keyboardNav=new e.ui.KeyboardNavigation({root:"menu_"+g.id,items:h,onCancel:function(){g.hideMenu()},enableUpDown:true});i.focus()},_keyHandler:function(g){var h=this,i;switch(g.keyCode){case 37:if(h.settings.parent){h.hideMenu();h.settings.parent.focus();a.cancel(g)}break;case 39:if(h.mouseOverFunc){h.mouseOverFunc(g)}break}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,q.titleItem?"th":"td");i=p=c.add(i,"a",{id:h.id+"_aria",role:q.titleItem?"presentation":"option",href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});if(q.parent){c.setAttrib(p,"aria-haspopup","true");c.setAttrib(p,"aria-owns","menu_"+h.id)}c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){if(typeof h.settings.style=="function"){h.settings.style=h.settings.style()}c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(e,d,c){this.parent(e,d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='';if(e.image&&!(this.editor&&this.editor.forcedHighContrastMode)){d+=''+a.encode(e.title)+''+(c?''+c+"":"")}else{d+=''+(c?''+c+"":"")}d+='";d+="";return d},postRender:function(){var d=this,e=d.settings,c;if(b.isIE&&d.editor){b.dom.Event.add(d.id,"mousedown",function(f){var g=d.editor.selection.getNode().nodeName;c=g==="IMG"?d.editor.selection.getBookmark():null})}b.dom.Event.add(d.id,"click",function(f){if(!d.isDisabled()){if(b.isIE&&d.editor&&c!==null){d.editor.selection.moveToBookmark(c)}return e.onclick.call(e.scope,f)}});b.dom.Event.add(d.id,"keyup",function(f){if(!d.isDisabled()&&f.keyCode==b.VK.SPACEBAR){return e.onclick.call(e.scope,f)}})}})})(tinymce);(function(e){var d=e.DOM,b=e.dom.Event,f=e.each,a=e.util.Dispatcher,c;e.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(j,i,g){var h=this;h.parent(j,i,g);h.items=[];h.onChange=new a(h);h.onPostRender=new a(h);h.onAdd=new a(h);h.onRenderMenu=new e.util.Dispatcher(this);h.classPrefix="mceListBox";h.marked={}},select:function(h){var g=this,j,i;g.marked={};if(h==c){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(k){return k==h}}if(h!=g.selectedValue){f(g.items,function(l,k){if(i(l.value)){j=1;g.selectByIndex(k);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(g){var i=this,j,k,h;i.marked={};if(g!=i.selectedIndex){j=d.get(i.id+"_text");h=d.get(i.id+"_voiceDesc");k=i.items[g];if(k){i.selectedValue=k.value;i.selectedIndex=g;d.setHTML(j,d.encode(k.title));d.setHTML(h,i.settings.title+" - "+k.title);d.removeClass(j,"mceTitle");d.setAttrib(i.id,"aria-valuenow",k.title)}else{d.setHTML(j,d.encode(i.settings.title));d.setHTML(h,d.encode(i.settings.title));d.addClass(j,"mceTitle");i.selectedValue=i.selectedIndex=null;d.setAttrib(i.id,"aria-valuenow",i.settings.title)}j=0}},mark:function(g){this.marked[g]=true},add:function(j,g,i){var h=this;i=i||{};i=e.extend(i,{title:j,value:g});h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return this.items.length},renderHTML:function(){var j="",g=this,i=g.settings,k=g.classPrefix;j='';j+="";j+="";j+="";return j},showMenu:function(){var h=this,j,i=d.get(this.id),g;if(h.isDisabled()||h.items.length===0){return}if(h.menu&&h.menu.isMenuVisible){return h.hideMenu()}if(!h.isMenuRendered){h.renderMenu();h.isMenuRendered=true}j=d.getPos(i);g=h.menu;g.settings.offset_x=j.x;g.settings.offset_y=j.y;g.settings.keyboard_focus=!e.isOpera;f(h.items,function(k){if(g.items[k.id]){g.items[k.id].setSelected(0)}});f(h.items,function(k){if(g.items[k.id]&&h.marked[k.value]){g.items[k.id].setSelected(1)}if(k.value===h.selectedValue){g.items[k.id].setSelected(1)}});g.showMenu(0,i.clientHeight);b.add(d.doc,"mousedown",h.hideMenu,h);d.addClass(h.id,h.classPrefix+"Selected")},hideMenu:function(h){var g=this;if(g.menu&&g.menu.isMenuVisible){d.removeClass(g.id,g.classPrefix+"Selected");if(h&&h.type=="mousedown"&&(h.target.id==g.id+"_text"||h.target.id==g.id+"_open")){return}if(!h||!d.getParent(h.target,".mceMenu")){d.removeClass(g.id,g.classPrefix+"Selected");b.remove(d.doc,"mousedown",g.hideMenu,g);g.menu.hideMenu()}}},renderMenu:function(){var h=this,g;g=h.settings.control_manager.createDropMenu(h.id+"_menu",{menu_line:1,"class":h.classPrefix+"Menu mceNoIcons",max_width:250,max_height:150});g.onHideMenu.add(function(){h.hideMenu();h.focus()});g.add({title:h.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(h.settings.onselect("")!==false){h.select("")}}});f(h.items,function(i){if(i.value===c){g.add({title:i.title,role:"option","class":"mceMenuItemTitle",onclick:function(){if(h.settings.onselect("")!==false){h.select("")}}})}else{i.id=d.uniqueId();i.role="option";i.onclick=function(){if(h.settings.onselect(i.value)!==false){h.select(i.value)}};g.add(i)}});h.onRenderMenu.dispatch(h,g);h.menu=g},postRender:function(){var g=this,h=g.classPrefix;b.add(g.id,"click",g.showMenu,g);b.add(g.id,"keydown",function(i){if(i.keyCode==32){g.showMenu(i);b.cancel(i)}});b.add(g.id,"focus",function(){if(!g._focused){g.keyDownHandler=b.add(g.id,"keydown",function(i){if(i.keyCode==40){g.showMenu();b.cancel(i)}});g.keyPressHandler=b.add(g.id,"keypress",function(j){var i;if(j.keyCode==13){i=g.selectedValue;g.selectedValue=null;b.cancel(j);g.settings.onselect(i)}})}g._focused=1});b.add(g.id,"blur",function(){b.remove(g.id,"keydown",g.keyDownHandler);b.remove(g.id,"keypress",g.keyPressHandler);g._focused=0});if(e.isIE6||!d.boxModel){b.add(g.id,"mouseover",function(){if(!d.hasClass(g.id,h+"Disabled")){d.addClass(g.id,h+"Hover")}});b.add(g.id,"mouseout",function(){if(!d.hasClass(g.id,h+"Disabled")){d.removeClass(g.id,h+"Hover")}})}g.onPostRender.dispatch(g,d.get(g.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(e){var d=e.DOM,b=e.dom.Event,f=e.each,a=e.util.Dispatcher,c;e.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(h,g){this.parent(h,g);this.classPrefix="mceNativeListBox"},setDisabled:function(g){d.get(this.id).disabled=g;this.setAriaProperty("disabled",g)},isDisabled:function(){return d.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==c){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(k){return k==h}}if(h!=g.selectedValue){f(g.items,function(l,k){if(i(l.value)){j=1;g.selectByIndex(k);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(g){d.get(this.id).selectedIndex=g+1;this.selectedValue=this.items[g]?this.items[g].value:null},add:function(k,h,g){var j,i=this;g=g||{};g.value=h;if(i.isRendered()){d.add(d.get(this.id),"option",g,k)}j={title:k,value:h,attribs:g};i.items.push(j);i.onAdd.dispatch(i,j)},getLength:function(){return this.items.length},renderHTML:function(){var i,g=this;i=d.createHTML("option",{value:""},"-- "+g.settings.title+" --");f(g.items,function(h){i+=d.createHTML("option",{value:h.value},h.title)});i=d.createHTML("select",{id:g.id,"class":"mceNativeListBox","aria-labelledby":g.id+"_aria"},i);i+=d.createHTML("span",{id:g.id+"_aria",style:"display: none"},g.settings.title);return i},postRender:function(){var h=this,i,j=true;h.rendered=true;function g(l){var k=h.items[l.target.selectedIndex-1];if(k&&(k=k.value)){h.onChange.dispatch(h,k);if(h.settings.onselect){h.settings.onselect(k)}}}b.add(h.id,"change",g);b.add(h.id,"keydown",function(l){var k;b.remove(h.id,"change",i);j=false;k=b.add(h.id,"blur",function(){if(j){return}j=true;b.add(h.id,"change",g);b.remove(h.id,"blur",k)});if(e.isWebKit&&(l.keyCode==37||l.keyCode==39)){return b.prevent(l)}if(l.keyCode==13||l.keyCode==32){g(l);return b.cancel(l)}});h.onPostRender.dispatch(h,d.get(h.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(g,f,e){this.parent(g,f,e);this.onRenderMenu=new c.util.Dispatcher(this);f.menu_container=f.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.firstChild.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(function(){f.hideMenu();f.focus()});f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(g,f,e){this.parent(g,f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="";if(g.image){e=b.createHTML("img ",{src:g.image,role:"presentation","class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}e+=b.createHTML("span",{"class":"mceVoiceLabel mceIconOnly",id:f.id+"_voice",style:"display:none;"},g.title);i+=""+b.createHTML("a",{role:"button",id:f.id+"_action",tabindex:"-1",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"";e=b.createHTML("span",{"class":"mceOpen "+g["class"]},'');i+=""+b.createHTML("a",{role:"button",id:f.id+"_open",tabindex:"-1",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"";i+="";i=b.createHTML("table",{role:"presentation","class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",title:g.title},i);return b.createHTML("div",{id:f.id,role:"button",tabindex:"0","aria-labelledby":f.id+"_voice","aria-haspopup":"true"},i)},postRender:function(){var e=this,g=e.settings,f;if(g.onclick){f=function(h){if(!e.isDisabled()){g.onclick(e.value);a.cancel(h)}};a.add(e.id+"_action","click",f);a.add(e.id,["click","keydown"],function(h){var k=32,m=14,i=13,j=38,l=40;if((h.keyCode===32||h.keyCode===13||h.keyCode===14)&&!h.altKey&&!h.ctrlKey&&!h.metaKey){f();a.cancel(h)}else{if(h.type==="click"||h.keyCode===l){e.showMenu();a.cancel(h)}}})}a.add(e.id+"_open","click",function(h){e.showMenu();a.cancel(h)});a.add([e.id,e.id+"_open"],"focus",function(){e._focused=1});a.add([e.id,e.id+"_open"],"blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open");a.clear(this.id)}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(i,h,f){var g=this;g.parent(i,h,f);g.settings=h=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},g.settings);g.onShowMenu=new d.util.Dispatcher(g);g.onHideMenu=new d.util.Dispatcher(g);g.value=h.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.firstChild.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.keyboardNav=new d.ui.KeyboardNavigation({root:f.id+"_menu",items:c.select("a",f.id+"_menu"),onCancel:function(){f.hideMenu();f.focus()}});f.keyboardNav.focus();f.isMenuVisible=1},hideMenu:function(g){var f=this;if(f.isMenuVisible){if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.isMenuVisible=0;f.onHideMenu.dispatch();f.keyboardNav.destroy()}},renderMenu:function(){var p=this,h,k=0,q=p.settings,g,j,l,o,f;o=c.add(q.menu_container,"div",{role:"listbox",id:p.id+"_menu","class":q.menu_class+" "+q["class"],style:"position:absolute;left:0;top:-1000px;"});h=c.add(o,"div",{"class":q["class"]+" mceSplitButtonMenu"});c.add(h,"span",{"class":"mceMenuLine"});g=c.add(h,"table",{role:"presentation","class":"mceColorSplitMenu"});j=c.add(g,"tbody");k=0;e(b(q.colors,"array")?q.colors:q.colors.split(","),function(m){m=m.replace(/^#/,"");if(!k--){l=c.add(j,"tr");k=q.grid_width-1}g=c.add(l,"td");var i={href:"javascript:;",style:{backgroundColor:"#"+m},title:p.editor.getLang("colors."+m,m),"data-mce-color":"#"+m};if(!d.isIE){i.role="option"}g=c.add(g,"a",i);if(p.editor.forcedHighContrastMode){g=c.add(g,"canvas",{width:16,height:16,"aria-hidden":"true"});if(g.getContext&&(f=g.getContext("2d"))){f.fillStyle="#"+m;f.fillRect(0,0,16,16)}else{c.remove(g)}}});if(q.more_colors_func){g=c.add(j,"tr");g=c.add(g,"td",{colspan:q.grid_width,"class":"mceMoreColors"});g=c.add(g,"a",{role:"option",id:p.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},q.more_colors_title);a.add(g,"click",function(i){q.more_colors_func.call(q.more_colors_scope||this);return a.cancel(i)})}c.addClass(h,"mceColorSplitMenu");a.add(p.id+"_menu","mousedown",function(i){return a.cancel(i)});a.add(p.id+"_menu","click",function(i){var m;i=c.getParent(i.target,"a",j);if(i&&i.nodeName.toLowerCase()=="a"&&(m=i.getAttribute("data-mce-color"))){p.setColor(m)}return false});return o},setColor:function(f){this.displayColor(f);this.hideMenu();this.settings.onselect(f)},displayColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){var f=this;f.parent();a.clear(f.id+"_menu");a.clear(f.id+"_more");c.remove(f.id+"_menu");if(f.keyboardNav){f.keyboardNav.destroy()}}})})(tinymce);(function(b){var d=b.DOM,c=b.each,a=b.dom.Event;b.create("tinymce.ui.ToolbarGroup:tinymce.ui.Container",{renderHTML:function(){var f=this,i=[],e=f.controls,j=b.each,g=f.settings;i.push('
    ');i.push("");i.push('");j(e,function(h){i.push(h.renderHTML())});i.push("");i.push("
    ");return i.join("")},focus:function(){var e=this;d.get(e.id).focus()},postRender:function(){var f=this,e=[];c(f.controls,function(g){c(g.controls,function(h){if(h.id){e.push(h)}})});f.keyNav=new b.ui.KeyboardNavigation({root:f.id,items:e,onCancel:function(){if(b.isWebKit){d.get(f.editor.id+"_ifr").focus()}f.editor.focus()},excludeFromTabOrder:!f.settings.tab_focus_toolbar})},destroy:function(){var e=this;e.parent();e.keyNav.destroy();a.clear(e.id)}})})(tinymce);(function(a){var c=a.DOM,b=a.each;a.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var m=this,f="",j,k,n=m.settings,e,d,g,l;l=m.controls;for(e=0;e"))}if(d&&k.ListBox){if(d.Button||d.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarEnd"},c.createHTML("span",null,""))}}if(c.stdMode){f+=''+k.renderHTML()+""}else{f+=""+k.renderHTML()+""}if(g&&k.ListBox){if(g.Button||g.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarStart"},c.createHTML("span",null,""))}}}j="mceToolbarEnd";if(k.Button){j+=" mceToolbarEndButton"}else{if(k.SplitButton){j+=" mceToolbarEndSplitButton"}else{if(k.ListBox){j+=" mceToolbarEndListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,""));return c.createHTML("table",{id:m.id,"class":"mceToolbar"+(n["class"]?" "+n["class"]:""),cellpadding:"0",cellspacing:"0",align:m.settings.align||"",role:"presentation",tabindex:"-1"},""+f+"")}})})(tinymce);(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{AddOnManager:function(){var d=this;d.items=[];d.urls={};d.lookup={};d.onAdd=new a(d)},get:function(d){if(this.lookup[d]){return this.lookup[d].instance}else{return undefined}},dependencies:function(e){var d;if(this.lookup[e]){d=this.lookup[e].dependencies}return d||[]},requireLangPack:function(e){var d=b.settings;if(d&&d.language&&d.language_load!==false){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(f,e,d){this.items.push(e);this.lookup[f]={instance:e,dependencies:d};this.onAdd.dispatch(this,f,e);return e},createUrl:function(d,e){if(typeof e==="object"){return e}else{return{prefix:d.prefix,resource:e,suffix:d.suffix}}},addComponents:function(f,d){var e=this.urls[f];b.each(d,function(g){b.ScriptLoader.add(e+"/"+g)})},load:function(j,f,d,h){var g=this,e=f;function i(){var k=g.dependencies(j);b.each(k,function(m){var l=g.createUrl(f,m);g.load(l.resource,l,undefined,undefined)});if(d){if(h){d.call(h)}else{d.call(b.ScriptLoader)}}}if(g.urls[j]){return}if(typeof f==="object"){e=f.prefix+f.resource+f.suffix}if(e.indexOf("/")!==0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}g.urls[j]=e.substring(0,e.lastIndexOf("/"));if(g.lookup[j]){i()}else{b.ScriptLoader.add(e,i,h)}}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(x){var v=this,o,n=j.ScriptLoader,u,l=[],r;function q(t){var s=t.id;if(!s){s=t.name;if(s&&!k.get(s)){s=t.name}else{s=k.uniqueId()}t.setAttribute("id",s)}return s}function m(z,A,t){var y=z[A];if(!y){return}if(j.is(y,"string")){t=y.replace(/\.\w+$/,"");t=t?j.resolve(t):0;y=j.resolve(y)}return y.apply(t||this,Array.prototype.slice.call(arguments,2))}function p(t,s){return s.constructor===RegExp?s.test(t.className):k.hasClass(t,s)}v.settings=x;i.bind(window,"ready",function(){var s,t;m(x,"onpageload");switch(x.mode){case"exact":s=x.elements||"";if(s.length>0){g(e(s),function(y){if(k.get(y)){r=new j.Editor(y,x);l.push(r);r.render(1)}else{g(document.forms,function(z){g(z.elements,function(A){if(A.name===y){y="mce_editor_"+c++;k.setAttrib(A,"id",y);r=new j.Editor(y,x);l.push(r);r.render(1)}})})}})}break;case"textareas":case"specific_textareas":g(k.select("textarea"),function(y){if(x.editor_deselector&&p(y,x.editor_deselector)){return}if(!x.editor_selector||p(y,x.editor_selector)){r=new j.Editor(q(y),x);l.push(r);r.render(1)}});break;default:if(x.types){g(x.types,function(y){g(k.select(y.selector),function(A){var z=new j.Editor(q(A),j.extend({},x,y));l.push(z);z.render(1)})})}else{if(x.selector){g(k.select(x.selector),function(z){var y=new j.Editor(q(z),x);l.push(y);y.render(1)})}}}if(x.oninit){s=t=0;g(l,function(y){t++;if(!y.initialized){y.onInit.add(function(){s++;if(s==t){m(x,"oninit")}})}else{s++}if(s==t){m(x,"oninit")}})}})},get:function(l){if(l===a){return this.editors}if(!this.editors.hasOwnProperty(l)){return a}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l':"",visual:n,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",apply_source_formatting:n,directionality:"ltr",forced_root_block:"p",hidden_input:n,padd_empty_editor:n,render_ui:n,indentation:"30px",fix_table_elements:n,inline_styles:n,convert_fonts_to_spans:n,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",validate:n,entity_encoding:"named",url_converter:m.convertURL,url_converter_scope:m,ie7_compat:n},o);m.id=m.editorId=p;m.isNotDirty=false;m.plugins={};m.documentBaseURI=new k.util.URI(o.document_base_url||k.documentBaseURL,{base_uri:tinyMCE.baseURI});m.baseURI=k.baseURI;m.contentCSS=[];m.contentStyles=[];m.setupEvents();m.execCommands={};m.queryStateCommands={};m.queryValueCommands={};m.execCallback("setup",m)},render:function(o){var p=this,q=p.settings,r=p.id,m=k.ScriptLoader;if(!j.domLoaded){j.add(window,"ready",function(){p.render()});return}tinyMCE.settings=q;if(!p.getElement()){return}if(k.isIDevice&&!k.isIOS5){return}if(!/TEXTAREA|INPUT/i.test(p.getElement().nodeName)&&q.hidden_input&&l.getParent(r,"form")){l.insertAfter(l.create("input",{type:"hidden",name:r}),r)}if(!q.content_editable){p.orgVisibility=p.getElement().style.visibility;p.getElement().style.visibility="hidden"}if(k.WindowManager){p.windowManager=new k.WindowManager(p)}if(q.encoding=="xml"){p.onGetContent.add(function(s,t){if(t.save){t.content=l.encode(t.content)}})}if(q.add_form_submit_trigger){p.onSubmit.addToTop(function(){if(p.initialized){p.save();p.isNotDirty=1}})}if(q.add_unload_trigger){p._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(p.initialized&&!p.destroyed&&!p.isHidden()){p.save({format:"raw",no_events:true})}})}k.addUnload(p.destroy,p);if(q.submit_patch){p.onBeforeRenderUI.add(function(){var s=p.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){p.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){k.triggerSave();p.isNotDirty=1;return p.formElement._mceOldSubmit(p.formElement)}}s=null})}function n(){if(q.language&&q.language_load!==false){m.add(k.baseURL+"/langs/"+q.language+".js")}if(q.theme&&typeof q.theme!="function"&&q.theme.charAt(0)!="-"&&!h.urls[q.theme]){h.load(q.theme,"themes/"+q.theme+"/editor_template"+k.suffix+".js")}i(g(q.plugins),function(t){if(t&&!c.urls[t]){if(t.charAt(0)=="-"){t=t.substr(1,t.length);var s=c.dependencies(t);i(s,function(v){var u={prefix:"plugins/",resource:v,suffix:"/editor_plugin"+k.suffix+".js"};v=c.createUrl(u,v);c.load(v.resource,v)})}else{if(t=="safari"){return}c.load(t,{prefix:"plugins/",resource:t,suffix:"/editor_plugin"+k.suffix+".js"})}}});m.loadQueue(function(){if(!p.removed){p.init()}})}n()},init:function(){var q,G=this,H=G.settings,D,y,z,C=G.getElement(),p,m,E,v,B,F,x,r=[];k.add(G);H.aria_label=H.aria_label||l.getAttrib(C,"aria-label",G.getLang("aria.rich_text_area"));if(H.theme){if(typeof H.theme!="function"){H.theme=H.theme.replace(/-/,"");p=h.get(H.theme);G.theme=new p();if(G.theme.init){G.theme.init(G,h.urls[H.theme]||k.documentBaseURL.replace(/\/$/,""))}}else{G.theme=H.theme}}function A(s){var t=c.get(s),o=c.urls[s]||k.documentBaseURL.replace(/\/$/,""),n;if(t&&k.inArray(r,s)===-1){i(c.dependencies(s),function(u){A(u)});n=new t(G,o);G.plugins[s]=n;if(n.init){n.init(G,o);r.push(s)}}}i(g(H.plugins.replace(/\-/g,"")),A);if(H.popup_css!==false){if(H.popup_css){H.popup_css=G.documentBaseURI.toAbsolute(H.popup_css)}else{H.popup_css=G.baseURI.toAbsolute("themes/"+H.theme+"/skins/"+H.skin+"/dialog.css")}}if(H.popup_css_add){H.popup_css+=","+G.documentBaseURI.toAbsolute(H.popup_css_add)}G.controlManager=new k.ControlManager(G);G.onBeforeRenderUI.dispatch(G,G.controlManager);if(H.render_ui&&G.theme){G.orgDisplay=C.style.display;if(typeof H.theme!="function"){D=H.width||C.style.width||C.offsetWidth;y=H.height||C.style.height||C.offsetHeight;z=H.min_height||100;F=/^[0-9\.]+(|px)$/i;if(F.test(""+D)){D=Math.max(parseInt(D,10)+(p.deltaWidth||0),100)}if(F.test(""+y)){y=Math.max(parseInt(y,10)+(p.deltaHeight||0),z)}p=G.theme.renderUI({targetNode:C,width:D,height:y,deltaWidth:H.delta_width,deltaHeight:H.delta_height});l.setStyles(p.sizeContainer||p.editorContainer,{width:D,height:y});y=(p.iframeHeight||y)+(typeof(y)=="number"?(p.deltaHeight||0):"");if(y';if(H.document_base_url!=k.documentBaseURL){G.iframeHTML+=''}if(k.isIE8){if(H.ie7_compat){G.iframeHTML+=''}else{G.iframeHTML+=''}}G.iframeHTML+='';for(x=0;x'}G.contentCSS=[];v=H.body_id||"tinymce";if(v.indexOf("=")!=-1){v=G.getParam("body_id","","hash");v=v[G.id]||v}B=H.body_class||"";if(B.indexOf("=")!=-1){B=G.getParam("body_class","","hash");B=B[G.id]||""}G.iframeHTML+='
    ";if(k.relaxedDomain&&(b||(k.isOpera&&parseFloat(opera.version())<11))){E='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+G.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody();})()'}q=l.add(p.iframeContainer,"iframe",{id:G.id+"_ifr",src:E||'javascript:""',frameBorder:"0",allowTransparency:"true",title:H.aria_label,style:{width:"100%",height:y,display:"block"}});G.contentAreaContainer=p.iframeContainer;if(p.editorContainer){l.get(p.editorContainer).style.display=G.orgDisplay}C.style.visibility=G.orgVisibility;l.get(G.id).style.display="none";l.setAttrib(G.id,"aria-hidden",true);if(!k.relaxedDomain||!E){G.initContentBody()}C=q=p=null},initContentBody:function(){var n=this,p=n.settings,q=l.get(n.id),r=n.getDoc(),o,m,s;if((!b||!k.relaxedDomain)&&!p.content_editable){r.open();r.write(n.iframeHTML);r.close();if(k.relaxedDomain){r.domain=k.relaxedDomain}}if(p.content_editable){l.addClass(q,"mceContentBody");n.contentDocument=r=p.content_document||document;n.contentWindow=p.content_window||window;n.bodyElement=q;p.content_document=p.content_window=null}m=n.getBody();m.disabled=true;if(!p.readonly){m.contentEditable=n.getParam("content_editable_state",true)}m.disabled=false;n.schema=new k.html.Schema(p);n.dom=new k.dom.DOMUtils(r,{keep_values:true,url_converter:n.convertURL,url_converter_scope:n,hex_colors:p.force_hex_style_colors,class_filter:p.class_filter,update_styles:true,root_element:p.content_editable?n.id:null,schema:n.schema});n.parser=new k.html.DomParser(p,n.schema);n.parser.addAttributeFilter("src,href,style",function(t,u){var v=t.length,y,A=n.dom,z,x;while(v--){y=t[v];z=y.attr(u);x="data-mce-"+u;if(!y.attributes.map[x]){if(u==="style"){y.attr(x,A.serializeStyle(A.parseStyle(z),y.name))}else{y.attr(x,n.convertURL(z,u,y.name))}}}});n.parser.addNodeFilter("script",function(t,u){var v=t.length,x;while(v--){x=t[v];x.attr("type","mce-"+(x.attr("type")||"text/javascript"))}});n.parser.addNodeFilter("#cdata",function(t,u){var v=t.length,x;while(v--){x=t[v];x.type=8;x.name="#comment";x.value="[CDATA["+x.value+"]]"}});n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(u,v){var x=u.length,y,t=n.schema.getNonEmptyElements();while(x--){y=u[x];if(y.isEmpty(t)){y.empty().append(new k.html.Node("br",1)).shortEnded=true}}});n.serializer=new k.dom.Serializer(p,n.dom,n.schema);n.selection=new k.dom.Selection(n.dom,n.getWin(),n.serializer,n);n.formatter=new k.Formatter(n);n.undoManager=new k.UndoManager(n);n.forceBlocks=new k.ForceBlocks(n);n.enterKey=new k.EnterKey(n);n.editorCommands=new k.EditorCommands(n);n.onExecCommand.add(function(t,u){if(!/^(FontName|FontSize)$/.test(u)){n.nodeChanged()}});n.serializer.onPreProcess.add(function(t,u){return n.onPreProcess.dispatch(n,u,t)});n.serializer.onPostProcess.add(function(t,u){return n.onPostProcess.dispatch(n,u,t)});n.onPreInit.dispatch(n);if(!p.browser_spellcheck&&!p.gecko_spellcheck){r.body.spellcheck=false}if(!p.readonly){n.bindNativeEvents()}n.controlManager.onPostRender.dispatch(n,n.controlManager);n.onPostRender.dispatch(n);n.quirks=k.util.Quirks(n);if(p.directionality){m.dir=p.directionality}if(p.nowrap){m.style.whiteSpace="nowrap"}if(p.protect){n.onBeforeSetContent.add(function(t,u){i(p.protect,function(v){u.content=u.content.replace(v,function(x){return""})})})}n.onSetContent.add(function(){n.addVisual(n.getBody())});if(p.padd_empty_editor){n.onPostProcess.add(function(t,u){u.content=u.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
    [\r\n]*)$/,"")})}n.load({initial:true,format:"html"});n.startContent=n.getContent({format:"raw"});n.initialized=true;n.onInit.dispatch(n);n.execCallback("setupcontent_callback",n.id,m,r);n.execCallback("init_instance_callback",n);n.focus(true);n.nodeChanged({initial:true});if(n.contentStyles.length>0){s="";i(n.contentStyles,function(t){s+=t+"\r\n"});n.dom.addStyle(s)}i(n.contentCSS,function(t){n.dom.loadCSS(t)});if(p.auto_focus){setTimeout(function(){var t=k.get(p.auto_focus);t.selection.select(t.getBody(),1);t.selection.collapse(1);t.getBody().focus();t.getWin().focus()},100)}q=r=m=null},focus:function(p){var o,u=this,t=u.selection,q=u.settings.content_editable,n,r,s=u.getDoc(),m;if(!p){if(u.lastIERng){t.setRng(u.lastIERng)}n=t.getRng();if(n.item){r=n.item(0)}u._refreshContentEditable();if(!q){u.getWin().focus()}if(k.isGecko||q){m=u.getBody();if(m.setActive){m.setActive()}else{m.focus()}if(q){t.normalize()}}if(r&&r.ownerDocument==s){n=s.body.createControlRange();n.addElement(r);n.select()}}if(k.activeEditor!=u){if((o=k.activeEditor)!=null){o.onDeactivate.dispatch(o,u)}u.onActivate.dispatch(u,o)}k._setActive(u)},execCallback:function(q){var m=this,p=m.settings[q],o;if(!p){return}if(m.callbackLookup&&(o=m.callbackLookup[q])){p=o.func;o=o.scope}if(d(p,"string")){o=p.replace(/\.\w+$/,"");o=o?k.resolve(o):0;p=k.resolve(p);m.callbackLookup=m.callbackLookup||{};m.callbackLookup[q]={func:p,scope:o}}return p.apply(o||m,Array.prototype.slice.call(arguments,1))},translate:function(m){var o=this.settings.language||"en",n=k.i18n;if(!m){return""}return n[o+"."+m]||m.replace(/\{\#([^\}]+)\}/g,function(q,p){return n[o+"."+p]||"{#"+p+"}"})},getLang:function(o,m){return k.i18n[(this.settings.language||"en")+"."+o]||(d(m)?m:"{#"+o+"}")},getParam:function(t,q,m){var r=k.trim,p=d(this.settings[t])?this.settings[t]:q,s;if(m==="hash"){s={};if(d(p,"string")){i(p.indexOf("=")>0?p.split(/[;,](?![^=;,]*(?:[;,]|$))/):p.split(","),function(n){n=n.split("=");if(n.length>1){s[r(n[0])]=r(n[1])}else{s[r(n[0])]=r(n)}})}else{s=p}return s}return p},nodeChanged:function(q){var m=this,n=m.selection,p;if(m.initialized){q=q||{};p=n.getStart()||m.getBody();p=b&&p.ownerDocument!=m.getDoc()?m.getBody():p;q.parents=[];m.dom.getParent(p,function(o){if(o.nodeName=="BODY"){return true}q.parents.push(o)});m.onNodeChange.dispatch(m,q?q.controlManager||m.controlManager:m.controlManager,p,n.isCollapsed(),q)}},addButton:function(n,o){var m=this;m.buttons=m.buttons||{};m.buttons[n]=o},addCommand:function(m,o,n){this.execCommands[m]={func:o,scope:n||this}},addQueryStateHandler:function(m,o,n){this.queryStateCommands[m]={func:o,scope:n||this}},addQueryValueHandler:function(m,o,n){this.queryValueCommands[m]={func:o,scope:n||this}},addShortcut:function(o,q,m,p){var n=this,r;if(n.settings.custom_shortcuts===false){return false}n.shortcuts=n.shortcuts||{};if(d(m,"string")){r=m;m=function(){n.execCommand(r,false,null)}}if(d(m,"object")){r=m;m=function(){n.execCommand(r[0],r[1],r[2])}}i(g(o),function(s){var t={func:m,scope:p||this,desc:n.translate(q),alt:false,ctrl:false,shift:false};i(g(s,"+"),function(u){switch(u){case"alt":case"ctrl":case"shift":t[u]=true;break;default:t.charCode=u.charCodeAt(0);t.keyCode=u.toUpperCase().charCodeAt(0)}});n.shortcuts[(t.ctrl?"ctrl":"")+","+(t.alt?"alt":"")+","+(t.shift?"shift":"")+","+t.keyCode]=t});return true},execCommand:function(u,r,x,m){var p=this,q=0,v,n;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(u)&&(!m||!m.skip_focus)){p.focus()}m=f({},m);p.onBeforeExecCommand.dispatch(p,u,r,x,m);if(m.terminate){return false}if(p.execCallback("execcommand_callback",p.id,p.selection.getNode(),u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}if(v=p.execCommands[u]){n=v.func.call(v.scope,r,x);if(n!==true){p.onExecCommand.dispatch(p,u,r,x,m);return n}}i(p.plugins,function(o){if(o.execCommand&&o.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);q=1;return false}});if(q){return true}if(p.theme&&p.theme.execCommand&&p.theme.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}if(p.editorCommands.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}p.getDoc().execCommand(u,r,x);p.onExecCommand.dispatch(p,u,r,x,m)},queryCommandState:function(q){var n=this,r,p;if(n._isHidden()){return}if(r=n.queryStateCommands[q]){p=r.func.call(r.scope);if(p!==true){return p}}r=n.editorCommands.queryCommandState(q);if(r!==-1){return r}try{return this.getDoc().queryCommandState(q)}catch(m){}},queryCommandValue:function(r){var n=this,q,p;if(n._isHidden()){return}if(q=n.queryValueCommands[r]){p=q.func.call(q.scope);if(p!==true){return p}}q=n.editorCommands.queryCommandValue(r);if(d(q)){return q}try{return this.getDoc().queryCommandValue(r)}catch(m){}},show:function(){var m=this;l.show(m.getContainer());l.hide(m.id);m.load()},hide:function(){var m=this,n=m.getDoc();if(b&&n){n.execCommand("SelectAll")}m.save();l.hide(m.getContainer());l.setStyle(m.id,"display",m.orgDisplay)},isHidden:function(){return !l.isHidden(this.id)},setProgressState:function(m,n,p){this.onSetProgressState.dispatch(this,m,n,p);return m},load:function(q){var m=this,p=m.getElement(),n;if(p){q=q||{};q.load=true;n=m.setContent(d(p.value)?p.value:p.innerHTML,q);q.element=p;if(!q.no_events){m.onLoadContent.dispatch(m,q)}q.element=p=null;return n}},save:function(r){var m=this,q=m.getElement(),n,p;if(!q||!m.initialized){return}r=r||{};r.save=true;r.element=q;n=r.content=m.getContent(r);if(!r.no_events){m.onSaveContent.dispatch(m,r)}n=r.content;if(!/TEXTAREA|INPUT/i.test(q.nodeName)){q.innerHTML=n;if(p=l.getParent(m.id,"form")){i(p.elements,function(o){if(o.name==m.id){o.value=n;return false}})}}else{q.value=n}r.element=q=null;return n},setContent:function(r,p){var o=this,n,m=o.getBody(),q;p=p||{};p.format=p.format||"html";p.set=true;p.content=r;if(!p.no_events){o.onBeforeSetContent.dispatch(o,p)}r=p.content;if(!k.isIE&&(r.length===0||/^\s+$/.test(r))){q=o.settings.forced_root_block;if(q){r="<"+q+'>
    "}else{r='
    '}m.innerHTML=r;o.selection.select(m,true);o.selection.collapse(true);return}if(p.format!=="raw"){r=new k.html.Serializer({},o.schema).serialize(o.parser.parse(r))}p.content=k.trim(r);o.dom.setHTML(m,p.content);if(!p.no_events){o.onSetContent.dispatch(o,p)}if(!o.settings.content_editable||document.activeElement===o.getBody()){o.selection.normalize()}return p.content},getContent:function(o){var n=this,p,m=n.getBody();o=o||{};o.format=o.format||"html";o.get=true;o.getInner=true;if(!o.no_events){n.onBeforeGetContent.dispatch(n,o)}if(o.format=="raw"){p=m.innerHTML}else{if(o.format=="text"){p=m.innerText||m.textContent}else{p=n.serializer.serialize(m,o)}}if(o.format!="text"){o.content=k.trim(p)}else{o.content=p}if(!o.no_events){n.onGetContent.dispatch(n,o)}return o.content},isDirty:function(){var m=this;return k.trim(m.startContent)!=k.trim(m.getContent({format:"raw",no_events:1}))&&!m.isNotDirty},getContainer:function(){var m=this;if(!m.container){m.container=l.get(m.editorContainer||m.id+"_parent")}return m.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return l.get(this.settings.content_element||this.id)},getWin:function(){var m=this,n;if(!m.contentWindow){n=l.get(m.id+"_ifr");if(n){m.contentWindow=n.contentWindow}}return m.contentWindow},getDoc:function(){var m=this,n;if(!m.contentDocument){n=m.getWin();if(n){m.contentDocument=n.document}}return m.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(o,n,q){var m=this,p=m.settings;if(p.urlconverter_callback){return m.execCallback("urlconverter_callback",o,q,true,n)}if(!p.convert_urls||(q&&q.nodeName=="LINK")||o.indexOf("file:")===0){return o}if(p.relative_urls){return m.documentBaseURI.toRelative(o)}o=m.documentBaseURI.toAbsolute(o,p.remove_script_host);return o},addVisual:function(q){var n=this,o=n.settings,p=n.dom,m;q=q||n.getBody();if(!d(n.hasVisual)){n.hasVisual=o.visual}i(p.select("table,a",q),function(s){var r;switch(s.nodeName){case"TABLE":m=o.visual_table_class||"mceItemTable";r=p.getAttrib(s,"border");if(!r||r=="0"){if(n.hasVisual){p.addClass(s,m)}else{p.removeClass(s,m)}}return;case"A":if(!p.getAttrib(s,"href",false)){r=p.getAttrib(s,"name")||s.id;m="mceItemAnchor";if(r){if(n.hasVisual){p.addClass(s,m)}else{p.removeClass(s,m)}}}return}});n.onVisualAid.dispatch(n,q,n.hasVisual)},remove:function(){var m=this,o=m.getContainer(),n=m.getDoc();if(!m.removed){m.removed=1;if(b&&n){n.execCommand("SelectAll")}m.save();l.setStyle(m.id,"display",m.orgDisplay);if(!m.settings.content_editable){j.unbind(m.getWin());j.unbind(m.getDoc())}j.unbind(m.getBody());j.clear(o);m.execCallback("remove_instance_callback",m);m.onRemove.dispatch(m);m.onExecCommand.listeners=[];k.remove(m);l.remove(o)}},destroy:function(n){var m=this;if(m.destroyed){return}if(a){j.unbind(m.getDoc());j.unbind(m.getWin());j.unbind(m.getBody())}if(!n){k.removeUnload(m.destroy);tinyMCE.onBeforeUnload.remove(m._beforeUnload);if(m.theme&&m.theme.destroy){m.theme.destroy()}m.controlManager.destroy();m.selection.destroy();m.dom.destroy()}if(m.formElement){m.formElement.submit=m.formElement._mceOldSubmit;m.formElement._mceOldSubmit=null}m.contentAreaContainer=m.formElement=m.container=m.settings.content_element=m.bodyElement=m.contentDocument=m.contentWindow=null;if(m.selection){m.selection=m.selection.win=m.selection.dom=m.selection.dom.doc=null}m.destroyed=1},_refreshContentEditable:function(){var n=this,m,o;if(n._isHidden()){m=n.getBody();o=m.parentNode;o.removeChild(m);o.appendChild(m);m.focus()}},_isHidden:function(){var m;if(!a){return 0}m=this.selection.getSel();return(!m||!m.rangeCount||m.rangeCount===0)}})})(tinymce);(function(a){var b=a.each;a.Editor.prototype.setupEvents=function(){var c=this,d=c.settings;b(["onPreInit","onBeforeRenderUI","onPostRender","onLoad","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState","onSetAttrib"],function(e){c[e]=new a.util.Dispatcher(c)});if(d.cleanup_callback){c.onBeforeSetContent.add(function(e,f){f.content=e.execCallback("cleanup_callback","insert_to_editor",f.content,f)});c.onPreProcess.add(function(e,f){if(f.set){e.execCallback("cleanup_callback","insert_to_editor_dom",f.node,f)}if(f.get){e.execCallback("cleanup_callback","get_from_editor_dom",f.node,f)}});c.onPostProcess.add(function(e,f){if(f.set){f.content=e.execCallback("cleanup_callback","insert_to_editor",f.content,f)}if(f.get){f.content=e.execCallback("cleanup_callback","get_from_editor",f.content,f)}})}if(d.save_callback){c.onGetContent.add(function(e,f){if(f.save){f.content=e.execCallback("save_callback",e.id,f.content,e.getBody())}})}if(d.handle_event_callback){c.onEvent.add(function(f,g,h){if(c.execCallback("handle_event_callback",g,f,h)===false){g.preventDefault();g.stopPropagation()}})}if(d.handle_node_change_callback){c.onNodeChange.add(function(f,e,g){f.execCallback("handle_node_change_callback",f.id,g,-1,-1,true,f.selection.isCollapsed())})}if(d.save_callback){c.onSaveContent.add(function(e,g){var f=e.execCallback("save_callback",e.id,g.content,e.getBody());if(f){g.content=f}})}if(d.onchange_callback){c.onChange.add(function(f,e){f.execCallback("onchange_callback",f,e)})}};a.Editor.prototype.bindNativeEvents=function(){var l=this,f,d=l.settings,e=l.dom,h;h={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function c(i,m){var n=i.type;if(l.removed){return}if(l.onEvent.dispatch(l,i,m)!==false){l[h[i.fakeType||i.type]].dispatch(l,i,m)}}function j(i){l.focus(true)}function k(i,m){if(m.keyCode!=65||!a.VK.metaKeyPressed(m)){l.selection.normalize()}l.nodeChanged()}b(h,function(m,n){var i=d.content_editable?l.getBody():l.getDoc();switch(n){case"contextmenu":e.bind(i,n,c);break;case"paste":e.bind(l.getBody(),n,c);break;case"submit":case"reset":e.bind(l.getElement().form||a.DOM.getParent(l.id,"form"),n,c);break;default:e.bind(i,n,c)}});e.bind(d.content_editable?l.getBody():(a.isGecko?l.getDoc():l.getWin()),"focus",function(i){l.focus(true)});if(d.content_editable&&a.isOpera){e.bind(l.getBody(),"click",j);e.bind(l.getBody(),"keydown",j)}l.onMouseUp.add(k);l.onKeyUp.add(function(i,n){var m=n.keyCode;if((m>=33&&m<=36)||(m>=37&&m<=40)||m==13||m==45||m==46||m==8||(a.isMac&&(m==91||m==93))||n.ctrlKey){k(i,n)}});l.onReset.add(function(){l.setContent(l.startContent,{format:"raw"})});function g(m,i){if(m.altKey||m.ctrlKey||m.metaKey){b(l.shortcuts,function(n){var o=a.isMac?m.metaKey:m.ctrlKey;if(n.ctrl!=o||n.alt!=m.altKey||n.shift!=m.shiftKey){return}if(m.keyCode==n.keyCode||(m.charCode&&m.charCode==n.charCode)){m.preventDefault();if(i){n.func.call(n.scope)}return true}})}}l.onKeyUp.add(function(i,m){g(m)});l.onKeyPress.add(function(i,m){g(m)});l.onKeyDown.add(function(i,m){g(m,true)});if(a.isOpera){l.onClick.add(function(i,m){m.preventDefault()})}}})(tinymce);(function(d){var e=d.each,b,a=true,c=false;d.EditorCommands=function(n){var m=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,q=n.formatter,o;function r(z,y,x){var v;z=z.toLowerCase();if(v=j.exec[z]){v(z,y,x);return a}return c}function l(x){var v;x=x.toLowerCase();if(v=j.state[x]){return v(x)}return -1}function h(x){var v;x=x.toLowerCase();if(v=j.value[x]){return v(x)}return c}function u(v,x){x=x||"exec";e(v,function(z,y){e(y.toLowerCase().split(","),function(A){j[x][A]=z})})}d.extend(this,{execCommand:r,queryCommandState:l,queryCommandValue:h,addCommands:u});function f(y,x,v){if(x===b){x=c}if(v===b){v=null}return n.getDoc().execCommand(y,x,v)}function t(v){return q.match(v)}function s(v,x){q.toggle(v,x?{value:x}:b)}function i(v){o=p.getBookmark(v)}function g(){p.moveToBookmark(o)}u({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(z){var y=n.getDoc(),v;try{f(z)}catch(x){v=a}if(v||!y.queryCommandSupported(z)){if(d.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(A){if(A){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(v){if(p.isCollapsed()){p.select(p.getNode())}f(v);p.collapse(c)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(v){var x=v.substring(7);e("left,center,right,full".split(","),function(y){if(x!=y){q.remove("align"+y)}});s("align"+x);r("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(y){var v,x;f(y);v=m.getParent(p.getNode(),"ol,ul");if(v){x=v.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(x.nodeName)){i();m.split(x,v);g()}}},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){s(v)},"ForeColor,HiliteColor,FontName":function(y,x,v){s(y,v)},FontSize:function(z,y,x){var v,A;if(x>=1&&x<=7){A=d.explode(k.font_size_style_values);v=d.explode(k.font_size_classes);if(v){x=v[x-1]||x}else{x=A[x-1]||x}}s(z,x)},RemoveFormat:function(v){q.remove(v)},mceBlockQuote:function(v){s("blockquote")},FormatBlock:function(y,x,v){return s(v||"p")},mceCleanup:function(){var v=p.getBookmark();n.setContent(n.getContent({cleanup:a}),{cleanup:a});p.moveToBookmark(v)},mceRemoveNode:function(z,y,x){var v=x||p.getNode();if(v!=n.getBody()){i();n.dom.remove(v,a);g()}},mceSelectNodeDepth:function(z,y,x){var v=0;m.getParent(p.getNode(),function(A){if(A.nodeType==1&&v++==x){p.select(A);return c}},n.getBody())},mceSelectNode:function(y,x,v){p.select(v)},mceInsertContent:function(B,I,K){var y,J,E,z,F,G,D,C,L,x,A,M,v,H;y=n.parser;J=new d.html.Serializer({},n.schema);v='\uFEFF';G={content:K,format:"html"};p.onBeforeSetContent.dispatch(p,G);K=G.content;if(K.indexOf("{$caret}")==-1){K+="{$caret}"}K=K.replace(/\{\$caret\}/,v);if(!p.isCollapsed()){n.getDoc().execCommand("Delete",false,null)}E=p.getNode();G={context:E.nodeName.toLowerCase()};F=y.parse(K,G);A=F.lastChild;if(A.attr("id")=="mce_marker"){D=A;for(A=A.prev;A;A=A.walk(true)){if(A.type==3||!m.isBlock(A.name)){A.parent.insert(D,A,A.name==="br");break}}}if(!G.invalid){K=J.serialize(F);A=E.firstChild;M=E.lastChild;if(!A||(A===M&&A.nodeName==="BR")){m.setHTML(E,K)}else{p.setContent(K)}}else{p.setContent(v);E=p.getNode();z=n.getBody();if(E.nodeType==9){E=A=z}else{A=E}while(A!==z){E=A;A=A.parentNode}K=E==z?z.innerHTML:m.getOuterHTML(E);K=J.serialize(y.parse(K.replace(//i,function(){return J.serialize(F)})));if(E==z){m.setHTML(z,K)}else{m.setOuterHTML(E,K)}}D=m.get("mce_marker");C=m.getRect(D);L=m.getViewPort(n.getWin());if((C.y+C.h>L.y+L.h||C.yL.x+L.w||C.x")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(y,x,v){n.execCommand("mceInsertContent",false,v.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(z,y,x){var v;if(typeof(x)=="string"){x={href:x}}v=m.getParent(p.getNode(),"a");x.href=x.href.replace(" ","%20");if(!v||!x.href){q.remove("link")}if(x.href){q.apply("link",x,v)}},selectAll:function(){var x=m.getRoot(),v=m.createRng();if(p.getRng().setStart){v.setStart(x,0);v.setEnd(x,x.childNodes.length);p.setRng(v)}else{f("SelectAll")}}});u({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(z){var x="align"+z.substring(7);var v=p.isCollapsed()?[m.getParent(p.getNode(),m.isBlock)]:p.getSelectedBlocks();var y=d.map(v,function(A){return !!q.matchNode(A,x)});return d.inArray(y,a)!==-1},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){return t(v)},mceBlockQuote:function(){return t("blockquote")},Outdent:function(){var v;if(k.inline_styles){if((v=m.getParent(p.getStart(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}if((v=m.getParent(p.getEnd(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}}return l("InsertUnorderedList")||l("InsertOrderedList")||(!k.inline_styles&&!!m.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(x){var v=m.getParent(p.getNode(),"ul,ol");return v&&(x==="insertunorderedlist"&&v.tagName==="UL"||x==="insertorderedlist"&&v.tagName==="OL")}},"state");u({"FontSize,FontName":function(y){var x=0,v;if(v=m.getParent(p.getNode(),"span")){if(y=="fontsize"){x=v.style.fontSize}else{x=v.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return x}},"value");u({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}})(tinymce);(function(b){var a=b.util.Dispatcher;b.UndoManager=function(h){var l,i=0,e=[],g,k,j,f;function c(){return b.trim(h.getContent({format:"raw",no_events:1}).replace(/]+data-mce-bogus[^>]+>[\u200B\uFEFF]+<\/span>/g,""))}function d(){l.typing=false;l.add()}onBeforeAdd=new a(l);k=new a(l);j=new a(l);f=new a(l);k.add(function(m,n){if(m.hasUndo()){return h.onChange.dispatch(h,n,m)}});j.add(function(m,n){return h.onUndo.dispatch(h,n,m)});f.add(function(m,n){return h.onRedo.dispatch(h,n,m)});h.onInit.add(function(){l.add()});h.onBeforeExecCommand.add(function(m,p,o,q,n){if(p!="Undo"&&p!="Redo"&&p!="mceRepaint"&&(!n||!n.skip_undo)){l.beforeChange()}});h.onExecCommand.add(function(m,p,o,q,n){if(p!="Undo"&&p!="Redo"&&p!="mceRepaint"&&(!n||!n.skip_undo)){l.add()}});h.onSaveContent.add(d);h.dom.bind(h.dom.getRoot(),"dragend",d);h.dom.bind(h.getBody(),"focusout",function(m){if(!h.removed&&l.typing){d()}});h.onKeyUp.add(function(m,o){var n=o.keyCode;if((n>=33&&n<=36)||(n>=37&&n<=40)||n==45||n==13||o.ctrlKey){d()}});h.onKeyDown.add(function(m,o){var n=o.keyCode;if((n>=33&&n<=36)||(n>=37&&n<=40)||n==45){if(l.typing){d()}return}if((n<16||n>20)&&n!=224&&n!=91&&!l.typing){l.beforeChange();l.typing=true;l.add()}});h.onMouseDown.add(function(m,n){if(l.typing){d()}});h.addShortcut("ctrl+z","undo_desc","Undo");h.addShortcut("ctrl+y","redo_desc","Redo");l={data:e,typing:false,onBeforeAdd:onBeforeAdd,onAdd:k,onUndo:j,onRedo:f,beforeChange:function(){g=h.selection.getBookmark(2,true)},add:function(p){var m,n=h.settings,o;p=p||{};p.content=c();l.onBeforeAdd.dispatch(l,p);o=e[i];if(o&&o.content==p.content){return null}if(e[i]){e[i].beforeBookmark=g}if(n.custom_undo_redo_levels){if(e.length>n.custom_undo_redo_levels){for(m=0;m0){n=e[--i];h.setContent(n.content,{format:"raw"});h.selection.moveToBookmark(n.beforeBookmark);l.onUndo.dispatch(l,n)}return n},redo:function(){var m;if(i0||this.typing},hasRedo:function(){return i0){g.moveEnd("character",q)}g.select()}catch(n){}}}c.nodeChanged()}}if(b.forced_root_block){c.onKeyUp.add(f);c.onNodeChange.add(f)}};(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(j){var o,k,g,h=this,m=h.editor,n,f;if(!h.controlFactories){h.controlFactories=[];d(m.plugins,function(i){if(i.createControl){h.controlFactories.push(i)}})}n=h.controlFactories;for(k=0,g=n.length;k1||ag==ay||ag.tagName=="BR"){return ag}}}var aq=aa.selection.getRng();var av=aq.startContainer;var ap=aq.endContainer;if(av!=ap&&aq.endOffset===0){var au=ar(av,ap);var at=au.nodeType==3?au.length:au.childNodes.length;aq.setEnd(au,at)}return aq}function ad(at,ay,aw,av,aq){var ap=[],ar=-1,ax,aA=-1,au=-1,az;T(at.childNodes,function(aC,aB){if(aC.nodeName==="UL"||aC.nodeName==="OL"){ar=aB;ax=aC;return false}});T(at.childNodes,function(aC,aB){if(aC.nodeName==="SPAN"&&c.getAttrib(aC,"data-mce-type")=="bookmark"){if(aC.id==ay.id+"_start"){aA=aB}else{if(aC.id==ay.id+"_end"){au=aB}}}});if(ar<=0||(aAar)){T(a.grep(at.childNodes),aq);return 0}else{az=c.clone(aw,X);T(a.grep(at.childNodes),function(aC,aB){if((aAar&&aB>ar)){ap.push(aC);aC.parentNode.removeChild(aC)}});if(aAar){at.insertBefore(az,ax.nextSibling)}}av.push(az);T(ap,function(aB){az.appendChild(aB)});return az}}function an(aq,at,aw){var ap=[],av,ar,au=true;av=am.inline||am.block;ar=c.create(av);ab(ar);N.walk(aq,function(ax){var ay;function az(aA){var aF,aD,aB,aC,aE;aE=au;aF=aA.nodeName.toLowerCase();aD=aA.parentNode.nodeName.toLowerCase();if(aA.nodeType===1&&x(aA)){aE=au;au=x(aA)==="true";aC=true}if(g(aF,"br")){ay=0;if(am.block){c.remove(aA)}return}if(am.wrapper&&y(aA,ae,al)){ay=0;return}if(au&&!aC&&am.block&&!am.wrapper&&I(aF)){aA=c.rename(aA,av);ab(aA);ap.push(aA);ay=0;return}if(am.selector){T(ah,function(aG){if("collapsed" in aG&&aG.collapsed!==ai){return}if(c.is(aA,aG.selector)&&!b(aA)){ab(aA,aG);aB=true}});if(!am.inline||aB){ay=0;return}}if(au&&!aC&&d(av,aF)&&d(aD,av)&&!(!aw&&aA.nodeType===3&&aA.nodeValue.length===1&&aA.nodeValue.charCodeAt(0)===65279)&&!b(aA)){if(!ay){ay=c.clone(ar,X);aA.parentNode.insertBefore(ay,aA);ap.push(ay)}ay.appendChild(aA)}else{if(aF=="li"&&at){ay=ad(aA,at,ar,ap,az)}else{ay=0;T(a.grep(aA.childNodes),az);if(aC){au=aE}ay=0}}}T(ax,az)});if(am.wrap_links===false){T(ap,function(ax){function ay(aC){var aB,aA,az;if(aC.nodeName==="A"){aA=c.clone(ar,X);ap.push(aA);az=a.grep(aC.childNodes);for(aB=0;aB1||!H(az))&&ax===0){c.remove(az,1);return}if(am.inline||am.wrapper){if(!am.exact&&ax===1){az=ay(az)}T(ah,function(aB){T(c.select(aB.inline,az),function(aD){var aC;if(aB.wrap_links===false){aC=aD.parentNode;do{if(aC.nodeName==="A"){return}}while(aC=aC.parentNode)}Z(aB,al,aD,aB.exact?aD:null)})});if(y(az.parentNode,ae,al)){c.remove(az,1);az=0;return C}if(am.merge_with_parents){c.getParent(az.parentNode,function(aB){if(y(aB,ae,al)){c.remove(az,1);az=0;return C}})}if(az&&am.merge_siblings!==false){az=u(E(az),az);az=u(az,E(az,C))}}})}if(am){if(ag){if(ag.nodeType){ac=c.createRng();ac.setStartBefore(ag);ac.setEndAfter(ag);an(p(ac,ah),null,true)}else{an(ag,null,true)}}else{if(!ai||!am.inline||c.select("td.mceSelected,th.mceSelected").length){var ao=aa.selection.getNode();if(!m&&ah[0].defaultBlock&&!c.getParent(ao,c.isBlock)){Y(ah[0].defaultBlock)}aa.selection.setRng(af());ak=r.getBookmark();an(p(r.getRng(C),ah),ak);if(am.styles&&(am.styles.color||am.styles.textDecoration)){a.walk(ao,L,"childNodes");L(ao)}r.moveToBookmark(ak);R(r.getRng(C));aa.nodeChanged()}else{U("apply",ae,al)}}}}function B(ad,am,af){var ag=V(ad),ao=ag[0],ak,aj,ac,al=true;function ae(av){var au,at,ar,aq,ax,aw;if(av.nodeType===3){return}if(av.nodeType===1&&x(av)){ax=al;al=x(av)==="true";aw=true}au=a.grep(av.childNodes);if(al&&!aw){for(at=0,ar=ag.length;at=0;ac--){ab=ah[ac].selector;if(!ab){return C}for(ag=ad.length-1;ag>=0;ag--){if(c.is(ad[ag],ab)){return C}}}}return X}function J(ab,ae,ac){var ad;if(!P){P={};ad={};aa.onNodeChange.addToTop(function(ag,af,ai){var ah=n(ai),aj={};T(P,function(ak,al){T(ah,function(am){if(y(am,al,{},ak.similar)){if(!ad[al]){T(ak,function(an){an(true,{node:am,format:al,parents:ah})});ad[al]=ak}aj[al]=ak;return false}})});T(ad,function(ak,al){if(!aj[al]){delete ad[al];T(ak,function(am){am(false,{node:ai,format:al,parents:ah})})}})})}T(ab.split(","),function(af){if(!P[af]){P[af]=[];P[af].similar=ac}P[af].push(ae)});return this}a.extend(this,{get:V,register:l,apply:Y,remove:B,toggle:F,match:k,matchAll:v,matchNode:y,canApply:z,formatChanged:J});j();W();function h(ab,ac){if(g(ab,ac.inline)){return C}if(g(ab,ac.block)){return C}if(ac.selector){return c.is(ab,ac.selector)}}function g(ac,ab){ac=ac||"";ab=ab||"";ac=""+(ac.nodeName||ac);ab=""+(ab.nodeName||ab);return ac.toLowerCase()==ab.toLowerCase()}function O(ac,ab){var ad=c.getStyle(ac,ab);if(ab=="color"||ab=="backgroundColor"){ad=c.toHex(ad)}if(ab=="fontWeight"&&ad==700){ad="bold"}return""+ad}function q(ab,ac){if(typeof(ab)!="string"){ab=ab(ac)}else{if(ac){ab=ab.replace(/%(\w+)/g,function(ae,ad){return ac[ad]||ae})}}return ab}function f(ab){return ab&&ab.nodeType===3&&/^([\t \r\n]+|)$/.test(ab.nodeValue)}function S(ad,ac,ab){var ae=c.create(ac,ab);ad.parentNode.insertBefore(ae,ad);ae.appendChild(ad);return ae}function p(ab,am,ae){var ap,an,ah,al,ad=ab.startContainer,ai=ab.startOffset,ar=ab.endContainer,ak=ab.endOffset;function ao(aA){var au,ax,az,aw,av,at;au=ax=aA?ad:ar;av=aA?"previousSibling":"nextSibling";at=c.getRoot();function ay(aB){return aB.nodeName=="BR"&&aB.getAttribute("data-mce-bogus")&&!aB.nextSibling}if(au.nodeType==3&&!f(au)){if(aA?ai>0:akan?an:ai];if(ad.nodeType==3){ai=0}}if(ar.nodeType==1&&ar.hasChildNodes()){an=ar.childNodes.length-1;ar=ar.childNodes[ak>an?an:ak-1];if(ar.nodeType==3){ak=ar.nodeValue.length}}function aq(au){var at=au;while(at){if(at.nodeType===1&&x(at)){return x(at)==="false"?at:au}at=at.parentNode}return au}function aj(au,ay,aA){var ax,av,az,at;function aw(aC,aE){var aF,aB,aD=aC.nodeValue;if(typeof(aE)=="undefined"){aE=aA?aD.length:0}if(aA){aF=aD.lastIndexOf(" ",aE);aB=aD.lastIndexOf("\u00a0",aE);aF=aF>aB?aF:aB;if(aF!==-1&&!ae){aF++}}else{aF=aD.indexOf(" ",aE);aB=aD.indexOf("\u00a0",aE);aF=aF!==-1&&(aB===-1||aF0&&ah.node.nodeType===3&&ah.node.nodeValue.charAt(ah.offset-1)===" "){if(ah.offset>1){ar=ah.node;ar.splitText(ah.offset-1)}}}}if(am[0].inline||am[0].block_expand){if(!am[0].inline||(ad.nodeType!=3||ai===0)){ad=ao(true)}if(!am[0].inline||(ar.nodeType!=3||ak===ar.nodeValue.length)){ar=ao()}}if(am[0].selector&&am[0].expand!==X&&!am[0].inline){ad=af(ad,"previousSibling");ar=af(ar,"nextSibling")}if(am[0].block||am[0].selector){ad=ac(ad,"previousSibling");ar=ac(ar,"nextSibling");if(am[0].block){if(!H(ad)){ad=ao(true)}if(!H(ar)){ar=ao()}}}if(ad.nodeType==1){ai=s(ad);ad=ad.parentNode}if(ar.nodeType==1){ak=s(ar)+1;ar=ar.parentNode}return{startContainer:ad,startOffset:ai,endContainer:ar,endOffset:ak}}function Z(ah,ag,ae,ab){var ad,ac,af;if(!h(ae,ah)){return X}if(ah.remove!="all"){T(ah.styles,function(aj,ai){aj=q(aj,ag);if(typeof(ai)==="number"){ai=aj;ab=0}if(!ab||g(O(ab,ai),aj)){c.setStyle(ae,ai,"")}af=1});if(af&&c.getAttrib(ae,"style")==""){ae.removeAttribute("style");ae.removeAttribute("data-mce-style")}T(ah.attributes,function(ak,ai){var aj;ak=q(ak,ag);if(typeof(ai)==="number"){ai=ak;ab=0}if(!ab||g(c.getAttrib(ab,ai),ak)){if(ai=="class"){ak=c.getAttrib(ae,ai);if(ak){aj="";T(ak.split(/\s+/),function(al){if(/mce\w+/.test(al)){aj+=(aj?" ":"")+al}});if(aj){c.setAttrib(ae,ai,aj);return}}}if(ai=="class"){ae.removeAttribute("className")}if(e.test(ai)){ae.removeAttribute("data-mce-"+ai)}ae.removeAttribute(ai)}});T(ah.classes,function(ai){ai=q(ai,ag);if(!ab||c.hasClass(ab,ai)){c.removeClass(ae,ai)}});ac=c.getAttribs(ae);for(ad=0;adad?ad:af]}if(ab.nodeType===3&&ag&&af>=ab.nodeValue.length){ab=new t(ab,aa.getBody()).next()||ab}if(ab.nodeType===3&&!ag&&af===0){ab=new t(ab,aa.getBody()).prev()||ab}return ab}function U(ak,ab,ai){var al="_mce_caret",ac=aa.settings.caret_debug;function ad(ap){var ao=c.create("span",{id:al,"data-mce-bogus":true,style:ac?"color:red":""});if(ap){ao.appendChild(aa.getDoc().createTextNode(G))}return ao}function aj(ap,ao){while(ap){if((ap.nodeType===3&&ap.nodeValue!==G)||ap.childNodes.length>1){return false}if(ao&&ap.nodeType===1){ao.push(ap)}ap=ap.firstChild}return true}function ag(ao){while(ao){if(ao.id===al){return ao}ao=ao.parentNode}}function af(ao){var ap;if(ao){ap=new t(ao,ao);for(ao=ap.current();ao;ao=ap.next()){if(ao.nodeType===3){return ao}}}}function ae(aq,ap){var ar,ao;if(!aq){aq=ag(r.getStart());if(!aq){while(aq=c.get(al)){ae(aq,false)}}}else{ao=r.getRng(true);if(aj(aq)){if(ap!==false){ao.setStartBefore(aq);ao.setEndBefore(aq)}c.remove(aq)}else{ar=af(aq);if(ar.nodeValue.charAt(0)===G){ar=ar.deleteData(0,1)}c.remove(aq,1)}r.setRng(ao)}}function ah(){var aq,ao,av,au,ar,ap,at;aq=r.getRng(true);au=aq.startOffset;ap=aq.startContainer;at=ap.nodeValue;ao=ag(r.getStart());if(ao){av=af(ao)}if(at&&au>0&&au=0;at--){aq.appendChild(c.clone(ax[at],false));aq=aq.firstChild}aq.appendChild(c.doc.createTextNode(G));aq=aq.firstChild;c.insertAfter(aw,ay);r.setCursorLocation(aq,1)}}function an(){var ap,ao,aq;ao=ag(r.getStart());if(ao&&!c.isEmpty(ao)){a.walk(ao,function(ar){if(ar.nodeType==1&&ar.id!==al&&!c.isEmpty(ar)){c.setAttrib(ar,"data-mce-bogus",null)}},"childNodes")}}if(!self._hasCaretEvents){aa.onBeforeGetContent.addToTop(function(){var ao=[],ap;if(aj(ag(r.getStart()),ao)){ap=ao.length;while(ap--){c.setAttrib(ao[ap],"data-mce-bogus","1")}}});a.each("onMouseUp onKeyUp".split(" "),function(ao){aa[ao].addToTop(function(){ae();an()})});aa.onKeyDown.addToTop(function(ao,aq){var ap=aq.keyCode;if(ap==8||ap==37||ap==39){ae(ag(r.getStart()))}an()});r.onSetContent.add(an);self._hasCaretEvents=true}if(ak=="apply"){ah()}else{am()}}function R(ac){var ab=ac.startContainer,ai=ac.startOffset,ae,ah,ag,ad,af;if(ab.nodeType==3&&ai>=ab.nodeValue.length){ai=s(ab);ab=ab.parentNode;ae=true}if(ab.nodeType==1){ad=ab.childNodes;ab=ad[Math.min(ai,ad.length-1)];ah=new t(ab,c.getParent(ab,c.isBlock));if(ai>ad.length-1||ae){ah.next()}for(ag=ah.current();ag;ag=ah.next()){if(ag.nodeType==3&&!f(ag)){af=c.create("a",null,G);ag.parentNode.insertBefore(af,ag);ac.setStart(ag,0);r.setRng(ac);c.remove(af);return}}}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;function b(j,i){e.each(i,function(l,k){if(l){g.setStyle(j,k,l)}});g.rename(j,"span")}function f(i,j){g=i.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",j.node),function(k){d[k.nodeName.toLowerCase()](a.dom,k)})}}if(c.inline_styles){h=e.explode(c.font_size_legacy_values);d={font:function(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size,10)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};a.onPreProcess.add(f);a.onSetContent.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}});(function(b){var a=b.dom.TreeWalker;b.EnterKey=function(f){var i=f.dom,e=f.selection,d=f.settings,h=f.undoManager,c=f.schema.getNonEmptyElements();function g(A){var v=e.getRng(true),G,j,z,u,p,M,B,o,k,n,t,J,x,C;function E(N){return N&&i.isBlock(N)&&!/^(TD|TH|CAPTION|FORM)$/.test(N.nodeName)&&!/^(fixed|absolute)/i.test(N.style.position)&&i.getContentEditable(N)!=="true"}function F(O){var N;if(b.isIE&&i.isBlock(O)){N=e.getRng();O.appendChild(i.create("span",null,"\u00a0"));e.select(O);O.lastChild.outerHTML="";e.setRng(N)}}function y(P){var O=P,Q=[],N;while(O=O.firstChild){if(i.isBlock(O)){return}if(O.nodeType==1&&!c[O.nodeName.toLowerCase()]){Q.push(O)}}N=Q.length;while(N--){O=Q[N];if(!O.hasChildNodes()||(O.firstChild==O.lastChild&&O.firstChild.nodeValue==="")){i.remove(O)}else{if(O.nodeName=="A"&&(O.innerText||O.textContent)===" "){i.remove(O)}}}}function m(O){var T,R,N,U,S,Q=O,P;N=i.createRng();if(O.hasChildNodes()){T=new a(O,O);while(R=T.current()){if(R.nodeType==3){N.setStart(R,0);N.setEnd(R,0);break}if(c[R.nodeName.toLowerCase()]){N.setStartBefore(R);N.setEndBefore(R);break}Q=R;R=T.next()}if(!R){N.setStart(Q,0);N.setEnd(Q,0)}}else{if(O.nodeName=="BR"){if(O.nextSibling&&i.isBlock(O.nextSibling)){if(!M||M<9){P=i.create("br");O.parentNode.insertBefore(P,O)}N.setStartBefore(O);N.setEndBefore(O)}else{N.setStartAfter(O);N.setEndAfter(O)}}else{N.setStart(O,0);N.setEnd(O,0)}}e.setRng(N);i.remove(P);S=i.getViewPort(f.getWin());U=i.getPos(O).y;if(US.y+S.h){f.getWin().scrollTo(0,U'}return R}function q(Q){var P,O,N;if(z.nodeType==3&&(Q?u>0:u=z.nodeValue.length){if(!b.isIE&&!D()){P=i.create("br");v.insertNode(P);v.setStartAfter(P);v.setEndAfter(P);O=true}}P=i.create("br");v.insertNode(P);if(b.isIE&&t=="PRE"&&(!M||M<8)){P.parentNode.insertBefore(i.doc.createTextNode("\r"),P)}N=i.create("span",{}," ");P.parentNode.insertBefore(N,P);e.scrollIntoView(N);i.remove(N);if(!O){v.setStartAfter(P);v.setEndAfter(P)}else{v.setStartBefore(P);v.setEndBefore(P)}e.setRng(v);h.add()}function s(N){do{if(N.nodeType===3){N.nodeValue=N.nodeValue.replace(/^[\r\n]+/,"")}N=N.firstChild}while(N)}function K(P){var N=i.getRoot(),O,Q;O=P;while(O!==N&&i.getContentEditable(O)!=="false"){if(i.getContentEditable(O)==="true"){Q=O}O=O.parentNode}return O!==N?Q:N}function I(O){var N;if(!b.isIE){O.normalize();N=O.lastChild;if(!N||(/^(left|right)$/gi.test(i.getStyle(N,"float",true)))){i.add(O,"br")}}}if(!v.collapsed){f.execCommand("Delete");return}if(A.isDefaultPrevented()){return}z=v.startContainer;u=v.startOffset;x=(d.force_p_newlines?"p":"")||d.forced_root_block;x=x?x.toUpperCase():"";M=i.doc.documentMode;B=A.shiftKey;if(z.nodeType==1&&z.hasChildNodes()){C=u>z.childNodes.length-1;z=z.childNodes[Math.min(u,z.childNodes.length-1)]||z;if(C&&z.nodeType==3){u=z.nodeValue.length}else{u=0}}j=K(z);if(!j){return}h.beforeChange();if(!i.isBlock(j)&&j!=i.getRoot()){if(!x||B){L()}return}if((x&&!B)||(!x&&B)){z=l(z,u)}p=i.getParent(z,i.isBlock);n=p?i.getParent(p.parentNode,i.isBlock):null;t=p?p.nodeName.toUpperCase():"";J=n?n.nodeName.toUpperCase():"";if(J=="LI"&&!A.ctrlKey){p=n;t=J}if(t=="LI"){if(!x&&B){L();return}if(i.isEmpty(p)){if(/^(UL|OL|LI)$/.test(n.parentNode.nodeName)){return false}H();return}}if(t=="PRE"&&d.br_in_pre!==false){if(!B){L();return}}else{if((!x&&!B&&t!="LI")||(x&&B)){L();return}}x=x||"P";if(q()){if(/^(H[1-6]|PRE)$/.test(t)&&J!="HGROUP"){o=r(x)}else{o=r()}if(d.end_container_on_empty_block&&E(n)&&i.isEmpty(p)){o=i.split(n,p)}else{i.insertAfter(o,p)}m(o)}else{if(q(true)){o=p.parentNode.insertBefore(r(),p);F(o)}else{G=v.cloneRange();G.setEndAfter(p);k=G.extractContents();s(k);o=k.firstChild;i.insertAfter(k,p);y(o);I(p);m(o)}}i.setAttrib(o,"id","");h.add()}f.onKeyDown.add(function(k,j){if(j.keyCode==13){if(g(j)!==false){j.preventDefault()}}})}})(tinymce);glpi-0.84.3+dfsg.1/lib/tiny_mce/tiny_mce_popup.js000066400000000000000000000112501226600447100215650ustar00rootroot00000000000000 // Uncomment and change this document.domain value if you are loading the script cross subdomains // document.domain = 'moxiecode.com'; var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document,{ownEvents:true,proxy:tinyMCEPopup._eventProxy});b.dom.bind(window,"ready",b._onDOMLoaded,b);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},10)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('